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    undefined5;
typedef unsigned long long    undefined8;
typedef unsigned short    ushort;
typedef unsigned short    wchar16;
typedef short    wchar_t;
typedef unsigned short    word;
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__RTTIBaseClassDescriptor _s__RTTIBaseClassDescriptor, *P_s__RTTIBaseClassDescriptor;

typedef struct _s__RTTIBaseClassDescriptor RTTIBaseClassDescriptor;

typedef RTTIBaseClassDescriptor *RTTIBaseClassDescriptor *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 _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 ulonglong __uint64;

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 _s_TryBlockMapEntry _s_TryBlockMapEntry, *P_s_TryBlockMapEntry;

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

typedef struct _s_TryBlockMapEntry TryBlockMapEntry;

typedef struct _com_error _com_error, *P_com_error;

struct _com_error { // PlaceHolder Class Structure
};

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

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 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_FuncInfo FuncInfo;

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 ulong DWORD;

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 _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 _SECURITY_ATTRIBUTES _SECURITY_ATTRIBUTES, *P_SECURITY_ATTRIBUTES;

typedef int BOOL;

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

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 _OVERLAPPED *LPOVERLAPPED;

typedef DWORD (*PTHREAD_START_ROUTINE)(LPVOID);

typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;

typedef struct _SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES;

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 _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 _SYSTEMTIME *LPSYSTEMTIME;

typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;

typedef struct _iobuf _iobuf, *P_iobuf;

typedef struct _iobuf FILE;

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

typedef int PMFN;

typedef struct _s_ThrowInfo _s_ThrowInfo, *P_s_ThrowInfo;

typedef struct _s_ThrowInfo 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 char *va_list;

typedef ulonglong uintptr_t;

typedef struct bad_alloc bad_alloc, *Pbad_alloc;

struct bad_alloc { // PlaceHolder Class Structure
};

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 ulonglong *PDWORD64;

typedef ULONG_PTR SIZE_T;

typedef longlong INT_PTR;

typedef uint UINT;

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

typedef TIMECALLBACK *LPTIMECALLBACK;

typedef UINT MMRESULT;

typedef struct sockaddr sockaddr, *Psockaddr;

typedef ushort u_short;

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

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_ostream<wchar_t,struct_std::char_traits<wchar_t>_> basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>, *Pbasic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>;

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

typedef struct ios_base ios_base, *Pios_base;

struct ios_base { // 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 basic_streambuf<wchar_t,struct_std::char_traits<wchar_t>_> basic_streambuf<wchar_t,struct_std::char_traits<wchar_t>_>, *Pbasic_streambuf<wchar_t,struct_std::char_traits<wchar_t>_>;

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

typedef struct fpos<int> fpos<int>, *Pfpos<int>;

struct fpos<int> { // PlaceHolder Structure
};

typedef struct locale locale, *Plocale;

struct locale { // PlaceHolder Structure
};

typedef struct _Lockit _Lockit, *P_Lockit;

struct _Lockit { // PlaceHolder Structure
};

typedef struct bad_cast bad_cast, *Pbad_cast;

struct bad_cast { // PlaceHolder Structure
};

typedef enum _Uninitialized {
} _Uninitialized;

typedef struct _Fac_tidy_reg_t _Fac_tidy_reg_t, *P_Fac_tidy_reg_t;

struct _Fac_tidy_reg_t { // PlaceHolder Structure
};

typedef struct basic_istream<wchar_t,struct_std::char_traits<wchar_t>_> basic_istream<wchar_t,struct_std::char_traits<wchar_t>_>, *Pbasic_istream<wchar_t,struct_std::char_traits<wchar_t>_>;

struct basic_istream<wchar_t,struct_std::char_traits<wchar_t>_> { // 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 _Container_base0 _Container_base0, *P_Container_base0;

struct _Container_base0 { // PlaceHolder Structure
};

typedef struct ctype<wchar_t> ctype<wchar_t>, *Pctype<wchar_t>;

struct ctype<wchar_t> { // PlaceHolder Structure
};

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

struct basic_ios<wchar_t,struct_std::char_traits<wchar_t>_> { // 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 _Mutex _Mutex, *P_Mutex;

struct _Mutex { // PlaceHolder Structure
};

typedef struct _Locimp _Locimp, *P_Locimp;

struct _Locimp { // PlaceHolder Structure
};

typedef struct facet facet, *Pfacet;

struct facet { // PlaceHolder Structure
};

typedef struct id id, *Pid;

struct id { // PlaceHolder Structure
};

typedef struct SubAllocator SubAllocator, *PSubAllocator;

struct SubAllocator { // PlaceHolder Structure
};

typedef struct CAtlBaseModule CAtlBaseModule, *PCAtlBaseModule;

struct CAtlBaseModule { // PlaceHolder Structure
};

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 int (*_onexit_t)(void);

typedef void (*_invalid_parameter_handler)(wchar_t *, wchar_t *, wchar_t *, uint, uintptr_t);

typedef DWORD LCTYPE;

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 _SETJMP_FLOAT128 _SETJMP_FLOAT128, *P_SETJMP_FLOAT128;

typedef struct _SETJMP_FLOAT128 SETJMP_FLOAT128;

typedef SETJMP_FLOAT128 _JBTYPE;

struct _SETJMP_FLOAT128 {
    ulonglong Part[2];
};

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;

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

typedef struct _CONSOLE_SCREEN_BUFFER_INFO *PCONSOLE_SCREEN_BUFFER_INFO;

typedef struct lconv lconv, *Plconv;

struct lconv {
    char *decimal_point;
    char *thousands_sep;
    char *grouping;
    char *int_curr_symbol;
    char *currency_symbol;
    char *mon_decimal_point;
    char *mon_thousands_sep;
    char *mon_grouping;
    char *positive_sign;
    char *negative_sign;
    char int_frac_digits;
    char frac_digits;
    char p_cs_precedes;
    char p_sep_by_space;
    char n_cs_precedes;
    char n_sep_by_space;
    char p_sign_posn;
    char n_sign_posn;
    wchar_t *_W_decimal_point;
    wchar_t *_W_thousands_sep;
    wchar_t *_W_int_curr_symbol;
    wchar_t *_W_currency_symbol;
    wchar_t *_W_mon_decimal_point;
    wchar_t *_W_mon_thousands_sep;
    wchar_t *_W_positive_sign;
    wchar_t *_W_negative_sign;
};

typedef ushort wint_t;

typedef longlong __time64_t;

typedef ulonglong size_t;

typedef int errno_t;

typedef size_t rsize_t;


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

typedef struct _GUID _GUID, *P_GUID;

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

typedef uchar *RPC_CSTR;

typedef ushort *RPC_WSTR;

typedef GUID UUID;

typedef long RPC_STATUS;

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 struct _RUNTIME_FUNCTION *PRUNTIME_FUNCTION;

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 _M128A *PM128A;

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 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 EXCEPTION_DISPOSITION (EXCEPTION_ROUTINE)(struct _EXCEPTION_RECORD *, PVOID, struct _CONTEXT *, PVOID);

typedef struct _UNWIND_HISTORY_TABLE _UNWIND_HISTORY_TABLE, *P_UNWIND_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 enum _HEAP_INFORMATION_CLASS {
    HeapCompatibilityInformation=0,
    HeapEnableTerminationOnCorruption=1
} _HEAP_INFORMATION_CLASS;

typedef char CHAR;

typedef CHAR *LPCSTR;

typedef LONG *PLONG;

typedef CHAR *LPSTR;

typedef wchar_t WCHAR;

typedef DWORD ACCESS_MASK;

typedef struct _KNONVOLATILE_CONTEXT_POINTERS _KNONVOLATILE_CONTEXT_POINTERS, *P_KNONVOLATILE_CONTEXT_POINTERS;

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

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 enum _HEAP_INFORMATION_CLASS HEAP_INFORMATION_CLASS;

typedef WCHAR *LPWSTR;

typedef struct _IMAGE_SECTION_HEADER *PIMAGE_SECTION_HEADER;

typedef WCHAR *LPCWSTR;

typedef struct _UNWIND_HISTORY_TABLE *PUNWIND_HISTORY_TABLE;

typedef long HRESULT;

typedef struct _KNONVOLATILE_CONTEXT_POINTERS *PKNONVOLATILE_CONTEXT_POINTERS;

typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;

typedef DWORD LCID;

typedef HANDLE *PHANDLE;

typedef ULONG_PTR HCRYPTPROV;

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 struct HKEY__ HKEY__, *PHKEY__;

struct HKEY__ {
    int unused;
};

typedef DWORD *LPDWORD;

typedef int *LPINT;

typedef struct HINSTANCE__ HINSTANCE__, *PHINSTANCE__;

typedef struct HINSTANCE__ *HINSTANCE;

struct HINSTANCE__ {
    int unused;
};

typedef struct HWND__ HWND__, *PHWND__;

typedef struct HWND__ *HWND;

struct HWND__ {
    int unused;
};

typedef struct HRSRC__ HRSRC__, *PHRSRC__;

struct HRSRC__ {
    int unused;
};

typedef HINSTANCE HMODULE;

typedef HANDLE HLOCAL;

typedef long *LPLONG;

typedef struct _FILETIME _FILETIME, *P_FILETIME;

typedef struct _FILETIME *LPFILETIME;

struct _FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
};

typedef INT_PTR (*FARPROC)(void);

typedef struct HKEY__ *HKEY;

typedef HKEY *PHKEY;

typedef HANDLE HGLOBAL;

typedef BOOL *LPBOOL;

typedef BYTE *PBYTE;

typedef void *LPCVOID;

typedef struct HRSRC__ *HRSRC;

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 ACCESS_MASK REGSAM;

typedef LONG LSTATUS;



ulonglong DAT_1405d84f0;
undefined DAT_140475be8;
undefined8 DAT_140607fd8;
DWORD DAT_140607bc8;
undefined8 *DAT_140607fc8;
undefined FUN_1400012a0;
undefined8 *DAT_140607fd0;
ulonglong DAT_1405e7298;
undefined8 DAT_1405e7280;
pointer[1] vftable;
undefined8 DAT_140607fc8;
pointer[2] vftable;
undefined DAT_1405d3608;
undefined *PTR_DAT_1405d8010;
uint DAT_14060b7c4;
int DAT_14060a120;
undefined LAB_140448470;
pointer[14] vftable;
undefined4 DAT_140607db8;
undefined4 DAT_140607dbc;
undefined4 DAT_140607dc0;
undefined4 DAT_140607dc4;
undefined DAT_1404763a0;
undefined DAT_1404763a8;
undefined DAT_1404763d0;
LPCRITICAL_SECTION DAT_140607fe8;
undefined8 DAT_140607be8;
pointer[17] vftable;
undefined DAT_140476668;
undefined DAT_140476fac;
undefined DAT_140607d90;
undefined8 DAT_140607ff0;
undefined8 *DAT_140607ff0;
undefined8 DAT_140607fd0;
undefined DAT_1405d85a0;
undefined2 *DAT_140607fd8;
undefined2 *DAT_140608008;
longlong DAT_140607ff0;
undefined2 *DAT_140607ff8;
longlong DAT_140608000;
undefined2 *DAT_140607c18;
undefined8 *DAT_140608008;
undefined8 *DAT_140607fd8;
undefined8 *DAT_140607ff8;
longlong DAT_140607fe0;
undefined4 DAT_140607bcc;
undefined4 DAT_140607bd0;
pointer PTR_s_Server_Shutdown._1405e7198;
undefined8 DAT_140609ed0;
char DAT_140607be0;
uint DAT_140607bd4;
undefined DAT_1404765b0;
longlong *DAT_140607ff8;
int DAT_140607c2c;
int DAT_140607bc8;
int DAT_140607bd0;
double DAT_1405dfc60;
int DAT_140607bd8;
longlong DAT_140607fd0;
int DAT_140607bd4;
int DAT_140607bdc;
int DAT_140607bcc;
void *DAT_140607cb0;
uint DAT_14060b7f4;
undefined8 DAT_140609468;
undefined8 DAT_140609470;
undefined LAB_140448930;
undefined8 DAT_1405d84f0;
undefined2 DAT_140477960;
pointer[150] vftable;
undefined *PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8;
pointer[18] vftable;
pointer[21] vftable;
pointer[126] vftable;
pointer[25] vftable;
pointer[139] vftable;
pointer[114] vftable;
longlong DAT_140607ff8;
undefined DAT_1405d36c0;
undefined4 DAT_1404c5240;
undefined *PTR_DAT_1405d8008;
undefined DAT_1405d3660;
pointer[3] vftable;
undefined1 DAT_14047e238;
uint DAT_1405e70c8;
undefined *PTR_s_&amp;_1405e70c0;
undefined4 DAT_1405e70d8;
undefined *PTR_DAT_1405e70d0;
undefined4 DAT_1405e70e8;
undefined *PTR_DAT_1405e70e0;
undefined4 DAT_1405e70f8;
undefined *PTR_s_&quot;_1405e70f0;
undefined4 DAT_1405e7108;
undefined *PTR_s_&apos;_1405e7100;
undefined *PTR_s_Error_when_TiXmlDocument_added_t_1405e70b0;
undefined *PTR_s_Memory_allocation_failed._1405e7048;
undefined *PTR_s_Failed_to_open_file_1405e7040;
undefined *PTR_s_Error_document_empty._1405e7098;
ulonglong DAT_140607bf0;
undefined DAT_14047e280;
undefined DAT_14047e284;
undefined DAT_14047e290;
undefined DAT_14047e294;
undefined DAT_14047e2dc;
undefined DAT_14047e328;
undefined DAT_14047c460;
pointer PTR_s_&amp;_1405e70c0;
undefined4 DAT_1405e70c8;
undefined1 DAT_1405e70cc;
char DAT_1405e0652;
pointer PTR_s_No_error_1405e7030;
undefined1 DAT_14047e748;
undefined *PTR_s_Error_parsing_Element._1405e7050;
undefined DAT_14047e264;
undefined1 DAT_14047e338;
undefined *PTR_s_Error_reading_Element_value._1405e7060;
undefined *PTR_s_Error_parsing_Unknown._1405e7080;
undefined DAT_14047e334;
undefined1 DAT_14047e34c;
undefined *PTR_s_Error_parsing_Declaration._1405e7090;
pointer[4] vftable;
undefined8 DAT_140607ff8;
undefined DAT_14047edb0;
undefined *PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8;
pointer[85] vftable;
pointer[529] vftable;
uint DAT_14060b7c0;
int DAT_140609ec0;
undefined LAB_140448480;
int DAT_1405d8140;
pointer[457] vftable;
pointer[23] vftable;
pointer[291] vftable;
pointer[371] vftable;
pointer[267] vftable;
pointer[41] vftable;
pointer[165] vftable;
pointer[45] vftable;
pointer[37] vftable;
pointer[31] vftable;
uint DAT_1406093d4;
undefined DAT_1406093c8;
undefined DAT_1406093d0;
char DAT_140607be1;
undefined8 *DAT_140607c18;
undefined8 *DAT_140607c20;
uint DAT_140608010;
undefined8 DAT_140608018;
float DAT_140608020;
undefined8 DAT_140608000;
ulonglong DAT_1405e73e0;
undefined2 DAT_1405e73c8;
undefined1 DAT_1405e0652;
undefined1 DAT_14049a49c;
undefined1 DAT_140607be2;
undefined1 DAT_140607be3;
undefined1 DAT_140607c15;
undefined1 DAT_1405deafa;
undefined1 DAT_140607c17;
undefined1 DAT_1405deafb;
undefined1 DAT_1405e0650;
undefined *PTR_`vftable'_14044a440;
undefined DAT_14049a76c;
undefined2 DAT_14049a7b0;
ulonglong DAT_1405e7408;
undefined8 DAT_1405e73f0;
undefined DAT_14049ab50;
pointer[15] vftable;
undefined *PTR__BADOFF_14044a428;
undefined8 DAT_140607fe0;
pointer[29] vftable;
undefined4 DAT_140607bdc;
undefined8 DAT_140608030;
undefined8 *DAT_140608028;
undefined8 *DAT_140608000;
undefined8 *DAT_140607fe0;
undefined8 *DAT_140608030;
undefined8 *DAT_140608038;
undefined8 DAT_140608008;
pointer[16] vftable;
undefined8 DAT_140608028;
undefined8 DAT_140608038;
undefined8 DAT_140607dd8;
void *DAT_140607dd0;
undefined DAT_140607dc8;
longlong *DAT_140607dd0;
undefined8 *DAT_140607dd0;
longlong DAT_140607dd8;
longlong DAT_140607dd0;
uint DAT_14060cefc;
undefined LAB_1404485e0;
undefined DAT_14060a450;
undefined8 DAT_14060b758;
undefined8 DAT_14060b768;
undefined DAT_14060b778;
undefined DAT_14060b780;
undefined DAT_14060b788;
undefined DAT_14060b7a8;
undefined DAT_14060b7ac;
undefined DAT_14060b7b0;
undefined DAT_14060b7b8;
undefined DAT_14060b78c;
undefined DAT_14060b790;
undefined DAT_14060b794;
undefined DAT_14060b798;
undefined DAT_14060b7a0;
undefined4 DAT_14060b750;
undefined8 DAT_14060b760;
undefined8 DAT_14060b770;
longlong *DAT_14060b770;
longlong *DAT_14060b760;
undefined DAT_14049c7b8;
int DAT_14060b750;
void *DAT_14060b758;
void *DAT_14060b768;
undefined DAT_14049c898;
uint DAT_14060cef8;
undefined LAB_1404485f0;
uint DAT_14060cef4;
undefined LAB_140448600;
undefined8 DAT_140609250;
uint DAT_14060cef0;
undefined DAT_140448610;
undefined DAT_14060cd80;
uint DAT_14060ceec;
undefined LAB_140448620;
undefined8 DAT_140609200;
undefined DAT_14060b350;
undefined DAT_14060b358;
undefined DAT_14060b360;
undefined DAT_14060b380;
undefined DAT_14060b384;
undefined DAT_14060b388;
undefined DAT_14060b390;
undefined DAT_14060b364;
undefined DAT_14060b368;
undefined DAT_14060b36c;
undefined DAT_14060b370;
undefined DAT_14060b378;
undefined DAT_14060b398;
undefined DAT_14060b3a0;
undefined DAT_14060b3a8;
undefined DAT_14060b3c8;
undefined DAT_14060b3cc;
undefined DAT_14060b3d0;
undefined DAT_14060b3d8;
undefined DAT_14060b3ac;
undefined DAT_14060b3b0;
undefined DAT_14060b3b4;
undefined DAT_14060b3b8;
undefined DAT_14060b3c0;
undefined DAT_14060b3e0;
undefined DAT_14060b3e8;
undefined DAT_14060b3f0;
undefined DAT_14060b410;
undefined DAT_14060b414;
undefined DAT_14060b418;
undefined DAT_14060b420;
undefined DAT_14060b3f4;
undefined DAT_14060b3f8;
undefined DAT_14060b3fc;
undefined DAT_14060b400;
undefined DAT_14060b408;
undefined DAT_14060b428;
undefined DAT_14060b430;
undefined DAT_14060b438;
undefined DAT_14060b458;
undefined DAT_14060b45c;
undefined DAT_14060b460;
undefined DAT_14060b468;
undefined DAT_14060b43c;
undefined DAT_14060b440;
undefined DAT_14060b444;
undefined DAT_14060b448;
undefined DAT_14060b450;
undefined DAT_14060b470;
undefined DAT_14060b478;
undefined DAT_14060b480;
undefined DAT_14060b4a0;
undefined DAT_14060b4a4;
undefined DAT_14060b4a8;
undefined DAT_14060b4b0;
undefined DAT_14060b484;
undefined DAT_14060b488;
undefined DAT_14060b48c;
undefined DAT_14060b490;
undefined DAT_14060b498;
undefined DAT_14060b4b8;
undefined DAT_14060b4c0;
undefined DAT_14060b4c8;
undefined DAT_14060b4e8;
undefined DAT_14060b4ec;
undefined DAT_14060b4f0;
undefined DAT_14060b4f8;
undefined DAT_14060b4cc;
undefined DAT_14060b4d0;
undefined DAT_14060b4d4;
undefined DAT_14060b4d8;
undefined DAT_14060b4e0;
undefined DAT_14060b500;
undefined DAT_14060b508;
undefined FUN_140162300;
undefined DAT_14060b510;
undefined DAT_14060b530;
undefined DAT_14060b534;
undefined DAT_14060b538;
undefined DAT_14060b540;
undefined DAT_14060b514;
undefined DAT_14060b518;
undefined DAT_14060b51c;
undefined DAT_14060b520;
undefined DAT_14060b528;
undefined LAB_140147020;
undefined8 DAT_14060b310;
undefined DAT_14060b548;
undefined DAT_14060b6c8;
undefined2 DAT_140475bc8;
undefined DAT_14047c104;
undefined DAT_14047c108;
undefined UNK_14047c109;
undefined DAT_14047c10c;
undefined UNK_14047c10d;
undefined DAT_14047c110;
undefined UNK_14047c111;
undefined DAT_14047c114;
undefined UNK_14047c115;
undefined DAT_14047c118;
undefined DAT_14047c11c;
undefined2 DAT_14049d834;
undefined2 DAT_14049d838;
undefined2 DAT_14049d83c;
undefined2 DAT_14049d840;
undefined2 DAT_14049d844;
undefined2 DAT_14049d848;
undefined2 DAT_14049d84c;
undefined2 DAT_14049d850;
undefined2 DAT_14049d854;
undefined DAT_14049d858;
undefined DAT_14049d85c;
undefined DAT_14049d860;
undefined DAT_14049d864;
uint *DAT_140607c18;
int DAT_140607c28;
int DAT_1405e1090;
int DAT_140607be4;
int DAT_1405e1038;
undefined DAT_14049a36c;
uint DAT_14060cee8;
ulonglong DAT_14060ced8;
undefined DAT_14060ced0;
undefined8 DAT_14060cec0;
undefined FUN_140448630;
uint DAT_14060cebc;
undefined LAB_140448670;
undefined DAT_1406092c0;
undefined DAT_1406092c8;
undefined DAT_1406092d0;
undefined DAT_1406092d8;
undefined DAT_1406092e0;
undefined DAT_1406092e8;
undefined DAT_1406092f0;
undefined DAT_1406092f8;
undefined DAT_140609300;
undefined DAT_140609308;
undefined8 DAT_14060930c;
undefined8 DAT_140608040;
undefined *PTR_u_nWeaponID01_1405e10c0;
undefined *PTR_u_nArmorID01_1405e1120;
undefined *PTR_u_nAccess01_1405e1180;
undefined *PTR_u_nEtc01_1405e11e0;
undefined8 DAT_1406091a8;
undefined DAT_1406091b0;
undefined4 DAT_1406091b8;
undefined DAT_1406091d8;
undefined DAT_1406091dc;
undefined DAT_1406091e0;
undefined DAT_1406091e8;
undefined DAT_1406091bc;
undefined DAT_1406091c0;
undefined DAT_1406091c4;
undefined DAT_1406091c8;
undefined DAT_1406091d0;
undefined8 DAT_140609160;
uint DAT_1406091b8;
undefined4 DAT_14047c100;
uint DAT_14060ceb8;
undefined FUN_140448690;
uint DAT_14060ceb4;
undefined LAB_1404486b0;
undefined8 DAT_140609110;
undefined DAT_14060b2c8;
undefined8 DAT_14060b2d0;
undefined DAT_14060b2d8;
undefined DAT_14060b2f8;
undefined DAT_14060b2fc;
undefined DAT_14060b300;
undefined DAT_14060b308;
undefined DAT_14060b2dc;
undefined DAT_14060b2e0;
undefined DAT_14060b2e4;
undefined DAT_14060b2e8;
undefined DAT_14060b2f0;
undefined8 DAT_14060b2c0;
longlong DAT_14060b2c0;
longlong DAT_14060b2d0;
uint DAT_14060ceb0;
undefined LAB_1404486c0;
undefined DAT_14060bebc;
undefined DAT_14060bec0;
undefined DAT_14060bec4;
undefined DAT_14060bec8;
undefined DAT_14060becc;
undefined DAT_14060bed0;
undefined DAT_14060bed4;
undefined DAT_14060bed8;
undefined DAT_14060bedc;
undefined DAT_14060bee0;
undefined DAT_14060be90;
undefined DAT_14060be94;
undefined DAT_14060be98;
undefined DAT_14060be9c;
undefined DAT_14060bea0;
undefined DAT_14060bea4;
undefined DAT_14060bea8;
undefined DAT_14060beac;
undefined DAT_14060beb0;
undefined DAT_14060beb4;
undefined DAT_14060beb8;
undefined DAT_14060c060;
undefined DAT_14060c064;
undefined DAT_14060c068;
undefined DAT_14060c06c;
undefined DAT_14060c070;
undefined DAT_14060c074;
undefined DAT_14060c078;
undefined DAT_14060c07c;
undefined DAT_14060c080;
undefined DAT_14060c084;
undefined DAT_14060c034;
undefined DAT_14060c038;
undefined DAT_14060c03c;
undefined DAT_14060c040;
undefined DAT_14060c044;
undefined DAT_14060c048;
undefined DAT_14060c04c;
undefined DAT_14060c050;
undefined DAT_14060c054;
undefined DAT_14060c058;
undefined DAT_14060c05c;
undefined DAT_14060b82c;
undefined DAT_14060b830;
undefined DAT_14060b834;
undefined DAT_14060b838;
undefined DAT_14060b83c;
undefined DAT_14060b840;
undefined DAT_14060b844;
undefined DAT_14060b848;
undefined DAT_14060b84c;
undefined DAT_14060b850;
undefined DAT_14060b800;
undefined DAT_14060b804;
undefined DAT_14060b808;
undefined DAT_14060b80c;
undefined DAT_14060b810;
undefined DAT_14060b814;
undefined DAT_14060b818;
undefined DAT_14060b81c;
undefined DAT_14060b820;
undefined DAT_14060b824;
undefined DAT_14060b828;
uint DAT_14060ceac;
undefined DAT_1404486d0;
uint DAT_14060cf80;
undefined LAB_1404486e0;
undefined8 DAT_1406090c0;
undefined DAT_140608f98;
undefined DAT_140608fa0;
undefined DAT_140608fa8;
undefined DAT_140608fc8;
undefined DAT_140608fcc;
undefined DAT_140608fd0;
undefined DAT_140608fd8;
undefined DAT_140608fac;
undefined DAT_140608fb0;
undefined DAT_140608fb4;
undefined DAT_140608fb8;
undefined DAT_140608fc0;
undefined DAT_140608fe0;
undefined DAT_140608fe8;
undefined DAT_140608ff0;
undefined DAT_140609010;
undefined DAT_140609014;
undefined DAT_140609018;
undefined DAT_140609020;
undefined DAT_140608ff4;
undefined DAT_140608ff8;
undefined DAT_140608ffc;
undefined DAT_140609000;
undefined DAT_140609008;
undefined DAT_140609028;
undefined DAT_140609030;
undefined DAT_140609038;
undefined DAT_140609058;
undefined DAT_14060905c;
undefined DAT_140609060;
undefined DAT_140609068;
undefined DAT_14060903c;
undefined DAT_140609040;
undefined DAT_140609044;
undefined DAT_140609048;
undefined DAT_140609050;
undefined8 DAT_140609070;
undefined8 DAT_140609078;
undefined8 DAT_140609080;
undefined8 DAT_140609090;
undefined8 DAT_140609098;
undefined8 DAT_1406090a0;
undefined8 DAT_140608f50;
void *DAT_140609090;
void *DAT_140609070;
undefined8 *DAT_140609078;
undefined8 *DAT_140609080;
undefined4 *DAT_140609098;
undefined4 *DAT_1406090a0;
uint DAT_14060cea8;
undefined LAB_1404486f0;
undefined *PTR_u_fHairCutPro00_1405e0fd8;
undefined *PTR_u_fHairCutPro01_1405e0fe0;
undefined *PTR_u_fHairCutPro02_1405e0fe8;
undefined *PTR_u_fFailPro00_1405e0fc0;
undefined *PTR_u_fFailPro01_1405e0fc8;
undefined *PTR_u_fFailPro02_1405e0fd0;
pointer PTR_u_nItemID00_1405e0888;
undefined *PTR_u_nItemCount00_1405e0f60;
undefined *PTR_u_nFailID00_1405e0fa8;
undefined *PTR_u_nHairCutID00_1405e0ff0;
uint DAT_14060cea4;
undefined LAB_140448700;
undefined8 DAT_140608f00;
undefined *PTR_u_fDyeingPro00_1405e0f90;
undefined *PTR_u_fDyeingPro01_1405e0f98;
undefined *PTR_u_fDyeingPro02_1405e0fa0;
uint DAT_14060cea0;
undefined LAB_140448710;
undefined8 DAT_140608eb0;
uint DAT_14060ce9c;
undefined LAB_140448720;
undefined8 DAT_140608e60;
undefined DAT_140608e18;
undefined DAT_140608e20;
undefined DAT_140608e28;
undefined DAT_140608e48;
undefined DAT_140608e4c;
undefined DAT_140608e50;
undefined DAT_140608e58;
undefined DAT_140608e2c;
undefined DAT_140608e30;
undefined DAT_140608e34;
undefined DAT_140608e38;
undefined DAT_140608e40;
undefined8 DAT_140608dd0;
uint DAT_14060ce98;
undefined FUN_140448730;
undefined8 DAT_140608d78;
undefined DAT_140608d80;
undefined4 DAT_140608d88;
undefined DAT_140608da8;
undefined DAT_140608dac;
undefined DAT_140608db0;
undefined DAT_140608db8;
undefined DAT_140608d8c;
undefined DAT_140608d90;
undefined DAT_140608d94;
undefined DAT_140608d98;
undefined DAT_140608da0;
undefined8 DAT_140608d30;
uint DAT_140608d88;
uint DAT_14060ce94;
undefined FUN_140448750;
undefined DAT_14049f290;
uint DAT_14060ce90;
undefined LAB_140448770;
undefined8 DAT_140608ce0;
uint DAT_14060ce8c;
undefined LAB_140448780;
undefined8 DAT_140608c90;
uint DAT_14060ce88;
undefined8 DAT_140609298;
undefined8 DAT_1406092a0;
undefined8 DAT_1406092a8;
undefined FUN_140448790;
uint DAT_14060ce84;
undefined8 DAT_140608c40;
undefined FUN_1404487d0;
uint DAT_14060ce80;
undefined8 DAT_140608bf0;
undefined FUN_1404487f0;
undefined DAT_140608b58;
undefined DAT_140608b60;
undefined DAT_140608b68;
undefined DAT_140608b88;
undefined DAT_140608b8c;
undefined DAT_140608b90;
undefined DAT_140608b98;
undefined DAT_140608b6c;
undefined DAT_140608b70;
undefined DAT_140608b74;
undefined DAT_140608b78;
undefined DAT_140608b80;
undefined DAT_140608ba0;
undefined DAT_140608ba8;
undefined DAT_140608bb0;
undefined DAT_140608bd0;
undefined DAT_140608bd4;
undefined DAT_140608bd8;
undefined DAT_140608be0;
undefined DAT_140608bb4;
undefined DAT_140608bb8;
undefined DAT_140608bbc;
undefined DAT_140608bc0;
undefined DAT_140608bc8;
undefined8 DAT_140608b10;
uint DAT_14060cf7c;
undefined FUN_140448810;
undefined DAT_14049f888;
undefined DAT_14049f890;
undefined DAT_14049f898;
uint DAT_14060ce7c;
undefined LAB_140448850;
undefined8 DAT_140608ac0;
undefined DAT_14060cb94;
undefined DAT_14060cba8;
undefined4 DAT_14060cbd8;
uint DAT_14060ce78;
undefined DAT_140448860;
undefined DAT_14060cbc0;
undefined FUN_140147140;
undefined8 DAT_140608910;
undefined DAT_140608958;
uint DAT_14060ce74;
undefined FUN_140448870;
uint DAT_14060ce70;
undefined LAB_1404488b0;
undefined8 DAT_1406088c0;
uint DAT_14060ce6c;
undefined LAB_1404488c0;
undefined8 DAT_140608870;
uint DAT_14060ce68;
undefined LAB_1404488d0;
undefined8 DAT_140608820;
uint DAT_14060ce64;
undefined LAB_1404488e0;
undefined8 DAT_1406087d0;
void *DAT_140609298;
undefined4 *DAT_1406092a0;
undefined4 *DAT_140609298;
undefined4 *DAT_1406092a8;
longlong DAT_1406092a0;
longlong DAT_140609298;
longlong DAT_1406092a8;
void *DAT_1406092a8;
void *DAT_1406092a0;
undefined DAT_14060a46c;
undefined DAT_14060a460;
undefined DAT_14060a484;
undefined DAT_14060a464;
undefined DAT_14060a468;
undefined DAT_14060a458;
undefined DAT_14060a480;
undefined DAT_14060a488;
undefined DAT_14060a490;
undefined DAT_14060a470;
undefined DAT_14060a478;
undefined DAT_14060926c;
undefined4 DAT_140609260;
undefined4 DAT_140609284;
undefined DAT_140609264;
undefined DAT_140609268;
undefined8 DAT_140609258;
undefined4 DAT_140609280;
undefined8 DAT_140609288;
undefined8 DAT_140609290;
longlong DAT_140609270;
ulonglong DAT_140609278;
uint DAT_140609260;
longlong DAT_140609250;
void *DAT_140609250;
int DAT_140609280;
longlong *DAT_140609288;
undefined DAT_14060921c;
undefined4 DAT_140609210;
undefined DAT_140609234;
undefined DAT_140609214;
undefined DAT_140609218;
undefined8 DAT_140609208;
undefined4 DAT_140609230;
undefined8 DAT_140609238;
undefined8 DAT_140609240;
undefined DAT_140609220;
ulonglong DAT_140609228;
undefined DAT_14060917c;
undefined4 DAT_140609170;
undefined4 DAT_140609194;
undefined DAT_140609174;
undefined DAT_140609178;
undefined8 DAT_140609168;
undefined4 DAT_140609190;
undefined8 DAT_140609198;
undefined8 DAT_1406091a0;
longlong DAT_140609180;
ulonglong DAT_140609188;
uint DAT_140609170;
longlong DAT_140609160;
undefined DAT_14060912c;
undefined4 DAT_140609120;
undefined4 DAT_140609144;
undefined DAT_140609124;
undefined DAT_140609128;
undefined8 DAT_140609118;
undefined4 DAT_140609140;
undefined8 DAT_140609148;
undefined8 DAT_140609150;
longlong DAT_140609130;
ulonglong DAT_140609138;
uint DAT_140609120;
longlong DAT_140609110;
undefined DAT_1406090dc;
undefined4 DAT_1406090d0;
undefined4 DAT_1406090f4;
undefined DAT_1406090d4;
undefined DAT_1406090d8;
undefined8 DAT_1406090c8;
undefined4 DAT_1406090f0;
undefined8 DAT_1406090f8;
undefined8 DAT_140609100;
longlong DAT_1406090e0;
ulonglong DAT_1406090e8;
uint DAT_1406090d0;
longlong DAT_1406090c0;
undefined DAT_140608f6c;
undefined4 DAT_140608f60;
undefined4 DAT_140608f84;
undefined DAT_140608f64;
undefined DAT_140608f68;
undefined8 DAT_140608f58;
undefined4 DAT_140608f80;
undefined8 DAT_140608f88;
undefined8 DAT_140608f90;
longlong DAT_140608f70;
ulonglong DAT_140608f78;
uint DAT_140608f60;
longlong DAT_140608f50;
undefined DAT_140608f1c;
undefined4 DAT_140608f10;
undefined DAT_140608f34;
undefined DAT_140608f14;
undefined DAT_140608f18;
undefined DAT_140608f08;
undefined4 DAT_140608f30;
undefined8 DAT_140608f38;
undefined DAT_140608f40;
undefined DAT_140608f20;
undefined DAT_140608f28;
undefined DAT_140608ecc;
undefined4 DAT_140608ec0;
undefined4 DAT_140608ee4;
undefined DAT_140608ec4;
undefined DAT_140608ec8;
undefined8 DAT_140608eb8;
undefined4 DAT_140608ee0;
undefined8 DAT_140608ee8;
undefined8 DAT_140608ef0;
longlong DAT_140608ed0;
ulonglong DAT_140608ed8;
uint DAT_140608ec0;
longlong DAT_140608eb0;
undefined DAT_140608e7c;
undefined4 DAT_140608e70;
undefined4 DAT_140608e94;
undefined DAT_140608e74;
undefined DAT_140608e78;
undefined8 DAT_140608e68;
undefined4 DAT_140608e90;
undefined8 DAT_140608e98;
undefined8 DAT_140608ea0;
longlong DAT_140608e80;
ulonglong DAT_140608e88;
uint DAT_140608e70;
longlong DAT_140608e60;
undefined DAT_140608dec;
undefined4 DAT_140608de0;
undefined4 DAT_140608e04;
undefined DAT_140608de4;
undefined DAT_140608de8;
undefined8 DAT_140608dd8;
undefined4 DAT_140608e00;
undefined8 DAT_140608e08;
undefined8 DAT_140608e10;
longlong DAT_140608df0;
ulonglong DAT_140608df8;
uint DAT_140608de0;
longlong DAT_140608dd0;
undefined DAT_140608d4c;
undefined4 DAT_140608d40;
undefined4 DAT_140608d64;
undefined DAT_140608d44;
undefined DAT_140608d48;
undefined8 DAT_140608d38;
undefined4 DAT_140608d60;
undefined8 DAT_140608d68;
undefined8 DAT_140608d70;
longlong DAT_140608d50;
ulonglong DAT_140608d58;
uint DAT_140608d40;
longlong DAT_140608d30;
undefined DAT_140608cfc;
undefined4 DAT_140608cf0;
undefined4 DAT_140608d14;
undefined DAT_140608cf4;
undefined DAT_140608cf8;
undefined8 DAT_140608ce8;
undefined4 DAT_140608d10;
undefined8 DAT_140608d18;
undefined8 DAT_140608d20;
longlong DAT_140608d00;
ulonglong DAT_140608d08;
uint DAT_140608cf0;
longlong DAT_140608ce0;
void *DAT_140608ce0;
int DAT_140608d10;
longlong *DAT_140608d18;
undefined DAT_140608cac;
undefined4 DAT_140608ca0;
undefined4 DAT_140608cc4;
undefined DAT_140608ca4;
undefined DAT_140608ca8;
undefined8 DAT_140608c98;
undefined4 DAT_140608cc0;
undefined8 DAT_140608cc8;
undefined8 DAT_140608cd0;
longlong DAT_140608cb0;
ulonglong DAT_140608cb8;
uint DAT_140608ca0;
longlong DAT_140608c90;
undefined DAT_140608c5c;
undefined4 DAT_140608c50;
undefined4 DAT_140608c74;
undefined DAT_140608c54;
undefined DAT_140608c58;
undefined8 DAT_140608c48;
undefined4 DAT_140608c70;
undefined8 DAT_140608c78;
undefined8 DAT_140608c80;
longlong DAT_140608c60;
ulonglong DAT_140608c68;
uint DAT_140608c50;
longlong DAT_140608c40;
void *DAT_140608c40;
int DAT_140608c70;
longlong *DAT_140608c78;
undefined DAT_140608c0c;
undefined4 DAT_140608c00;
undefined4 DAT_140608c24;
undefined DAT_140608c04;
undefined DAT_140608c08;
undefined8 DAT_140608bf8;
undefined4 DAT_140608c20;
undefined8 DAT_140608c28;
undefined8 DAT_140608c30;
longlong DAT_140608c10;
ulonglong DAT_140608c18;
uint DAT_140608c00;
longlong DAT_140608bf0;
void *DAT_140608bf0;
int DAT_140608c20;
longlong *DAT_140608c28;
undefined DAT_140608b2c;
undefined4 DAT_140608b20;
undefined4 DAT_140608b44;
undefined DAT_140608b24;
undefined DAT_140608b28;
undefined8 DAT_140608b18;
undefined4 DAT_140608b40;
undefined8 DAT_140608b48;
undefined8 DAT_140608b50;
longlong DAT_140608b30;
ulonglong DAT_140608b38;
uint DAT_140608b20;
longlong DAT_140608b10;
void *DAT_140608b10;
int DAT_140608b40;
longlong *DAT_140608b48;
undefined DAT_140608adc;
undefined4 DAT_140608ad0;
undefined4 DAT_140608af4;
undefined DAT_140608ad4;
undefined DAT_140608ad8;
undefined8 DAT_140608ac8;
undefined4 DAT_140608af0;
undefined8 DAT_140608af8;
undefined8 DAT_140608b00;
longlong DAT_140608ae0;
ulonglong DAT_140608ae8;
uint DAT_140608ad0;
longlong DAT_140608ac0;
undefined DAT_14060892c;
undefined4 DAT_140608920;
undefined4 DAT_140608944;
undefined DAT_140608924;
undefined DAT_140608928;
undefined8 DAT_140608918;
undefined4 DAT_140608940;
undefined8 DAT_140608948;
undefined8 DAT_140608950;
longlong DAT_140608930;
ulonglong DAT_140608938;
uint DAT_140608920;
longlong DAT_140608910;
undefined DAT_1406088dc;
undefined4 DAT_1406088d0;
undefined4 DAT_1406088f4;
undefined DAT_1406088d4;
undefined DAT_1406088d8;
undefined8 DAT_1406088c8;
undefined4 DAT_1406088f0;
undefined8 DAT_1406088f8;
undefined8 DAT_140608900;
longlong DAT_1406088e0;
ulonglong DAT_1406088e8;
uint DAT_1406088d0;
longlong DAT_1406088c0;
undefined DAT_14060888c;
undefined4 DAT_140608880;
undefined4 DAT_1406088a4;
undefined DAT_140608884;
undefined DAT_140608888;
undefined8 DAT_140608878;
undefined4 DAT_1406088a0;
undefined8 DAT_1406088a8;
undefined8 DAT_1406088b0;
longlong DAT_140608890;
ulonglong DAT_140608898;
uint DAT_140608880;
longlong DAT_140608870;
undefined DAT_14060883c;
undefined4 DAT_140608830;
undefined4 DAT_140608854;
undefined DAT_140608834;
undefined DAT_140608838;
undefined8 DAT_140608828;
undefined4 DAT_140608850;
undefined8 DAT_140608858;
undefined8 DAT_140608860;
longlong DAT_140608840;
ulonglong DAT_140608848;
uint DAT_140608830;
longlong DAT_140608820;
undefined DAT_1406087ec;
undefined4 DAT_1406087e0;
undefined4 DAT_140608804;
undefined DAT_1406087e4;
float DAT_1406087e8;
undefined8 DAT_1406087d8;
undefined4 DAT_140608800;
undefined8 DAT_140608808;
undefined8 DAT_140608810;
longlong DAT_1406087f0;
ulonglong DAT_1406087f8;
uint DAT_1406087e0;
longlong DAT_1406087d0;
longlong DAT_140609290;
ulonglong DAT_140609258;
int DAT_140609230;
uint DAT_140609210;
longlong DAT_140609240;
ulonglong DAT_140609208;
longlong *DAT_140609238;
void *DAT_140609160;
int DAT_140609190;
longlong *DAT_140609198;
void *DAT_140609110;
int DAT_140609140;
longlong *DAT_140609148;
void *DAT_1406090c0;
int DAT_1406090f0;
longlong *DAT_1406090f8;
void *DAT_140608f50;
int DAT_140608f80;
longlong *DAT_140608f88;
int DAT_140608f30;
uint DAT_140608f10;
longlong *DAT_140608f38;
void *DAT_140608eb0;
int DAT_140608ee0;
longlong *DAT_140608ee8;
void *DAT_140608e60;
int DAT_140608e90;
longlong *DAT_140608e98;
void *DAT_140608dd0;
int DAT_140608e00;
longlong *DAT_140608e08;
void *DAT_140608d30;
int DAT_140608d60;
longlong *DAT_140608d68;
longlong DAT_140608d20;
ulonglong DAT_140608ce8;
void *DAT_140608c90;
int DAT_140608cc0;
longlong *DAT_140608cc8;
longlong DAT_140608c80;
ulonglong DAT_140608c48;
longlong DAT_140608c30;
ulonglong DAT_140608bf8;
longlong DAT_140608b50;
ulonglong DAT_140608b18;
void *DAT_140608ac0;
int DAT_140608af0;
longlong *DAT_140608af8;
void *DAT_140608910;
int DAT_140608940;
longlong *DAT_140608948;
void *DAT_1406088c0;
int DAT_1406088f0;
longlong *DAT_1406088f8;
void *DAT_140608870;
int DAT_1406088a0;
longlong *DAT_1406088a8;
void *DAT_140608820;
int DAT_140608850;
longlong *DAT_140608858;
void *DAT_1406087d0;
int DAT_140608800;
longlong *DAT_140608808;
undefined8 *DAT_140609290;
uint DAT_140609284;
undefined8 *DAT_140609288;
ulonglong DAT_140609270;
undefined8 *DAT_1406091a0;
uint DAT_140609194;
undefined8 *DAT_140609198;
ulonglong DAT_140609168;
ulonglong DAT_140609180;
longlong DAT_1406091a0;
undefined8 *DAT_140609150;
uint DAT_140609144;
undefined8 *DAT_140609148;
ulonglong DAT_140609118;
ulonglong DAT_140609130;
longlong DAT_140609150;
undefined8 *DAT_140609100;
uint DAT_1406090f4;
undefined8 *DAT_1406090f8;
ulonglong DAT_1406090c8;
ulonglong DAT_1406090e0;
longlong DAT_140609100;
undefined8 *DAT_140608f90;
uint DAT_140608f84;
undefined8 *DAT_140608f88;
ulonglong DAT_140608f58;
ulonglong DAT_140608f70;
longlong DAT_140608f90;
undefined8 *DAT_140608ef0;
uint DAT_140608ee4;
undefined8 *DAT_140608ee8;
ulonglong DAT_140608eb8;
ulonglong DAT_140608ed0;
longlong DAT_140608ef0;
undefined8 *DAT_140608ea0;
uint DAT_140608e94;
undefined8 *DAT_140608e98;
ulonglong DAT_140608e68;
ulonglong DAT_140608e80;
longlong DAT_140608ea0;
undefined8 *DAT_140608e10;
uint DAT_140608e04;
undefined8 *DAT_140608e08;
ulonglong DAT_140608dd8;
ulonglong DAT_140608df0;
longlong DAT_140608e10;
undefined8 *DAT_140608d70;
uint DAT_140608d64;
undefined8 *DAT_140608d68;
ulonglong DAT_140608d38;
ulonglong DAT_140608d50;
longlong DAT_140608d70;
undefined8 *DAT_140608d20;
uint DAT_140608d14;
undefined8 *DAT_140608d18;
ulonglong DAT_140608d00;
undefined8 *DAT_140608cd0;
uint DAT_140608cc4;
undefined8 *DAT_140608cc8;
ulonglong DAT_140608c98;
ulonglong DAT_140608cb0;
longlong DAT_140608cd0;
undefined8 *DAT_140608c80;
uint DAT_140608c74;
undefined8 *DAT_140608c78;
ulonglong DAT_140608c60;
undefined8 *DAT_140608c30;
uint DAT_140608c24;
undefined8 *DAT_140608c28;
ulonglong DAT_140608c10;
undefined8 *DAT_140608b50;
uint DAT_140608b44;
undefined8 *DAT_140608b48;
ulonglong DAT_140608b30;
undefined8 *DAT_140608b00;
uint DAT_140608af4;
undefined8 *DAT_140608af8;
ulonglong DAT_140608ac8;
ulonglong DAT_140608ae0;
longlong DAT_140608b00;
undefined8 *DAT_140608950;
uint DAT_140608944;
undefined8 *DAT_140608948;
ulonglong DAT_140608918;
ulonglong DAT_140608930;
longlong DAT_140608950;
undefined8 *DAT_140608900;
uint DAT_1406088f4;
undefined8 *DAT_1406088f8;
ulonglong DAT_1406088c8;
ulonglong DAT_1406088e0;
longlong DAT_140608900;
undefined8 *DAT_1406088b0;
uint DAT_1406088a4;
undefined8 *DAT_1406088a8;
ulonglong DAT_140608878;
ulonglong DAT_140608890;
longlong DAT_1406088b0;
undefined8 *DAT_140608860;
uint DAT_140608854;
undefined8 *DAT_140608858;
ulonglong DAT_140608828;
ulonglong DAT_140608840;
longlong DAT_140608860;
undefined8 *DAT_140608810;
uint DAT_140608804;
undefined8 *DAT_140608808;
ulonglong DAT_1406087d8;
ulonglong DAT_1406087f0;
longlong DAT_140608810;
TypeDescriptor RTTI_Type_Descriptor;
undefined4 DAT_140609430;
undefined DAT_140609434;
undefined DAT_14060943c;
undefined DAT_140609440;
undefined FUN_14015b7d0;
undefined1 DAT_14060944c;
undefined FUN_14015b810;
undefined DAT_140609450;
undefined DAT_140609458;
undefined1 DAT_14060945a;
undefined4 DAT_14060945c;
undefined4 DAT_140609460;
undefined DAT_140609464;
undefined4 DAT_140609478;
undefined4 DAT_14060947c;
undefined4 DAT_140609480;
undefined4 DAT_140609484;
undefined4 DAT_140609488;
undefined DAT_14060948c;
undefined DAT_140609494;
undefined4 DAT_14060949c;
undefined8 DAT_1406094a0;
undefined8 DAT_1406094a8;
undefined8 DAT_1406094b0;
undefined DAT_1406094c0;
undefined4 DAT_1406094c8;
undefined8 DAT_140609c20;
undefined8 DAT_140609c28;
undefined4 DAT_140609c30;
undefined DAT_140609c50;
undefined DAT_140609c54;
undefined DAT_140609c58;
undefined DAT_140609c60;
undefined DAT_140609c34;
undefined DAT_140609c38;
undefined DAT_140609c3c;
undefined DAT_140609c40;
undefined DAT_140609c48;
undefined4 DAT_140609c68;
undefined4 DAT_140609c6c;
undefined4 DAT_140609c70;
undefined4 DAT_140609c74;
undefined4 DAT_140609cc8;
undefined4 DAT_140609ccc;
undefined4 DAT_140609cd0;
undefined DAT_140609cb8;
undefined DAT_140609cc0;
undefined LAB_140160780;
undefined LAB_1401607a0;
undefined4 DAT_1406094d0;
undefined4 DAT_1406095b0;
undefined4 DAT_1406095e8;
undefined4 DAT_140609770;
undefined DAT_140609c78;
undefined DAT_140609c98;
undefined8 *DAT_140609ca0;
undefined8 *DAT_140609c80;
void *DAT_1406094a0;
longlong DAT_140609c88;
ulonglong DAT_1405e7458;
undefined8 DAT_1405e7440;
int DAT_1406094c8;
int DAT_1406095b0;
undefined4 DAT_1406095b4;
int DAT_1406095b8;
int DAT_140609620;
undefined4 DAT_140609624;
int DAT_140609628;
undefined DAT_140609690;
undefined DAT_140609694;
undefined DAT_140609698;
undefined DAT_140609700;
undefined DAT_140609704;
undefined DAT_140609708;
int DAT_1406095e8;
undefined4 DAT_1406095ec;
int DAT_1406095f0;
int DAT_140609658;
undefined4 DAT_14060965c;
int DAT_140609660;
undefined DAT_1406096c8;
undefined DAT_1406096cc;
undefined DAT_1406096d0;
undefined DAT_140609738;
undefined DAT_14060973c;
undefined DAT_140609740;
undefined4 DAT_1406094d4;
undefined4 DAT_1406094d8;
undefined8 DAT_1406094e0;
undefined8 DAT_1406095c0;
undefined8 DAT_1406095f8;
undefined8 DAT_140609630;
undefined8 DAT_140609668;
undefined DAT_1406096a0;
undefined DAT_1406096d8;
undefined DAT_140609710;
undefined DAT_140609748;
int DAT_140609430;
undefined1 DAT_140609434;
undefined1 DAT_140609435;
undefined1 DAT_14060943b;
undefined1 DAT_140609436;
undefined1 DAT_140609437;
undefined1 DAT_140609438;
int DAT_140609460;
undefined1 DAT_140609439;
undefined1 DAT_14060943a;
undefined1 DAT_14060943c;
undefined1 DAT_14060943d;
undefined1 DAT_14060943e;
undefined1 DAT_14060943f;
int DAT_14060945c;
undefined1 DAT_140609441;
undefined1 DAT_140609442;
undefined1 DAT_140609458;
int DAT_140609450;
undefined1 DAT_140609454;
undefined1 DAT_140609455;
undefined1 DAT_140609456;
undefined1 DAT_140609457;
undefined4 DAT_140609774;
undefined8 DAT_140609778;
undefined1 DAT_140609440;
float DAT_140609cb8;
float DAT_140609cbc;
float DAT_140609cc0;
float DAT_140609cc4;
double DAT_140609468;
double DAT_140609470;
undefined1 DAT_140609459;
undefined DAT_14060949c;
int *DAT_1406094a8;
int *DAT_1406094b0;
int DAT_1406094c0;
int DAT_1406094c4;
undefined DAT_1404a0894;
undefined DAT_1404a0898;
longlong *DAT_140609c80;
longlong DAT_140609c28;
uint DAT_140609c30;
longlong *DAT_140609c20;
longlong *DAT_140609ca0;
undefined1 DAT_140609443;
longlong DAT_1406094a8;
longlong DAT_1406094a0;
int DAT_140609478;
int DAT_14060947c;
int DAT_140609480;
int DAT_140609484;
int DAT_140609488;
undefined1 DAT_140609444;
undefined DAT_140609448;
int DAT_14060948c;
int DAT_140609cc8;
int DAT_140609ccc;
int DAT_140609cd0;
undefined DAT_14060b250;
undefined DAT_14060b258;
undefined DAT_14060b260;
undefined DAT_14060b268;
undefined DAT_14060b270;
undefined DAT_14060b278;
undefined DAT_14060b280;
undefined DAT_14060b2a0;
undefined DAT_14060b2a4;
undefined DAT_14060b2a8;
undefined DAT_14060b2b0;
undefined DAT_14060b284;
undefined DAT_14060b288;
undefined DAT_14060b28c;
undefined DAT_14060b290;
undefined DAT_14060b298;
uint DAT_14060ce60;
undefined LAB_140448980;
uint DAT_14060ce5c;
undefined DAT_14060cbb8;
undefined DAT_140448990;
uint DAT_14060ce58;
undefined DAT_14060cbb0;
undefined DAT_1404489a0;
undefined DAT_14060b180;
undefined DAT_14060b188;
undefined DAT_14060b190;
undefined8 DAT_14060b198;
undefined8 DAT_14060b1a0;
undefined DAT_14060b1a8;
undefined8 DAT_14060b1b8;
undefined8 DAT_14060b1c0;
undefined4 DAT_14060b1c8;
undefined DAT_14060b1e8;
undefined DAT_14060b1ec;
undefined DAT_14060b1f0;
undefined DAT_14060b1f8;
undefined DAT_14060b1cc;
undefined DAT_14060b1d0;
undefined DAT_14060b1d4;
undefined DAT_14060b1d8;
undefined DAT_14060b1e0;
undefined DAT_14060b200;
undefined DAT_14060b208;
undefined DAT_14060b210;
undefined DAT_14060b230;
undefined DAT_14060b234;
undefined DAT_14060b238;
undefined DAT_14060b240;
undefined DAT_14060b214;
undefined DAT_14060b218;
undefined DAT_14060b21c;
undefined DAT_14060b220;
undefined DAT_14060b228;
void *DAT_14060b1a0;
void *DAT_14060b198;
uint DAT_14060b1c8;
longlong DAT_14060b1c0;
uint DAT_14060ce54;
undefined LAB_1404489b0;
undefined DAT_14060abc0;
undefined DAT_14060abc8;
undefined DAT_14060abd0;
undefined DAT_14060abf0;
undefined DAT_14060abf4;
undefined DAT_14060abf8;
undefined DAT_14060ac00;
undefined DAT_14060abd4;
undefined DAT_14060abd8;
undefined DAT_14060abdc;
undefined DAT_14060abe0;
undefined DAT_14060abe8;
undefined DAT_14060ae20;
undefined DAT_14060ae28;
undefined DAT_14060ae30;
undefined DAT_14060ae50;
undefined DAT_14060ae54;
undefined DAT_14060ae58;
undefined DAT_14060ae60;
undefined DAT_14060ae34;
undefined DAT_14060ae38;
undefined DAT_14060ae3c;
undefined DAT_14060ae40;
undefined DAT_14060ae48;
undefined DAT_14060ae68;
undefined thunk_FUN_1401625e0;
undefined DAT_14060ae70;
undefined DAT_14060ae78;
undefined DAT_14060ae98;
undefined DAT_14060ae9c;
undefined DAT_14060aea0;
undefined DAT_14060aea8;
undefined DAT_14060ae7c;
undefined DAT_14060ae80;
undefined DAT_14060ae84;
undefined DAT_14060ae88;
undefined DAT_14060ae90;
undefined DAT_14060b0f0;
undefined DAT_14060b0f8;
undefined DAT_14060b100;
undefined DAT_14060b120;
undefined DAT_14060b124;
undefined DAT_14060b128;
undefined DAT_14060b130;
undefined DAT_14060b104;
undefined DAT_14060b108;
undefined FUN_14023be90;
undefined DAT_14060b10c;
undefined DAT_14060b110;
undefined DAT_14060b118;
undefined DAT_14060b138;
undefined DAT_14060b140;
undefined DAT_14060b148;
undefined DAT_14060b168;
undefined DAT_14060b16c;
undefined DAT_14060b170;
undefined DAT_14060b178;
undefined DAT_14060b14c;
undefined DAT_14060b150;
undefined DAT_14060b154;
undefined DAT_14060b158;
undefined DAT_14060b160;
undefined LAB_1400030e0;
undefined LAB_1401629c0;
undefined8 DAT_14060ab80;
undefined DAT_14060ac60;
undefined DAT_14060aeb0;
undefined DAT_14060afd0;
undefined4 DAT_14060ac8c;
longlong DAT_14060ac08;
longlong DAT_14060ac20;
longlong DAT_14060ac18;
longlong DAT_14060ac28;
longlong DAT_14060ac30;
longlong DAT_14060ac38;
longlong DAT_14060ac40;
longlong DAT_14060ac48;
longlong DAT_14060ac58;
longlong DAT_14060ac50;
longlong DAT_14060ac10;
longlong DAT_14060aba0;
undefined DAT_1404a31fc;
undefined DAT_1404a3200;
undefined DAT_1404a3208;
uint DAT_14060ce50;
undefined LAB_1404489c0;
undefined basic_string<>;
pointer[8] vftable;
pointer[7] vftable;
int DAT_140607cb8;
uint DAT_140607c2c;
pointer[40] vftable;
longlong DAT_140607cc0;
pointer[433] vftable;
pointer[113] vftable;
int DAT_14060804c;
int DAT_140608054;
int DAT_140608050;
int DAT_140608048;
undefined DAT_14047baa4;
undefined DAT_14047ba94;
undefined DAT_14047ba9c;
char DAT_140609440;
uint DAT_140609cd8;
undefined8 DAT_140608070;
undefined8 DAT_140608060;
longlong DAT_140608068;
undefined DAT_140448680;
undefined2 DAT_1404a4d58;
int DAT_140608058;
int DAT_14060805c;
undefined DAT_14047ba80;
int DAT_14060808c;
char DAT_14060a0e3;
char DAT_14060a0e4;
undefined8 DAT_1406080b8;
undefined8 DAT_140608098;
undefined8 DAT_1406080a0;
int DAT_140608090;
int DAT_140608094;
undefined8 DAT_140608080;
int DAT_140608088;
undefined DAT_14047ba74;
uint DAT_140608048;
uint DAT_140608050;
undefined DAT_14047ba78;
longlong DAT_1406080b8;
undefined8 DAT_140608078;
int DAT_1406080a8;
uint DAT_140609420;
undefined4 DAT_140609410;
undefined4 DAT_140609414;
undefined4 DAT_140609418;
undefined DAT_14060941c;
pointer[384] vftable;
pointer[378] vftable;
char DAT_140607be3;
char DAT_140607be2;
int DAT_1406080ac;
int DAT_1406080b4;
int DAT_1406080b0;
undefined *DAT_140607bb8;
int DAT_1406080cc;
int DAT_1406080c8;
int DAT_1406080c4;
int DAT_1406080d8;
int DAT_1406080fc;
int DAT_1406080dc;
undefined DAT_1404a8a90;
undefined DAT_1404a8ae0;
undefined8 DAT_140608118;
undefined4 DAT_14044e480;
undefined DAT_14047ba28;
uint DAT_1406080dc;
uint DAT_14060804c;
undefined DAT_14047ba50;
undefined8 DAT_140608110;
int *DAT_140607cc0;
int DAT_1406080d4;
undefined DAT_14047ba3c;
undefined DAT_14047ba40;
int DAT_1406080d0;
undefined DAT_14047ba44;
undefined DAT_14047ba10;
undefined DAT_14047ba2c;
undefined DAT_14047ba30;
undefined DAT_14047ba34;
int DAT_1406080e4;
int DAT_1406080e0;
int DAT_1406093c0;
undefined4 DAT_1406093bc;
undefined DAT_14047ba54;
int DAT_1406080c0;
undefined4 DAT_14060cfc0;
uint DAT_140608054;
undefined DAT_14047ba38;
undefined DAT_14047ba48;
undefined DAT_14047ba4c;
char DAT_140609442;
undefined DAT_14047ba70;
char DAT_14060943b;
char DAT_14060a0e5;
char DAT_140609457;
undefined FUN_140448b80;
uint DAT_14060cf78;
undefined8 DAT_14060cf58;
undefined8 *DAT_14060cf60;
undefined8 *DAT_14060cf68;
undefined DAT_14047ba60;
undefined DAT_14047ba5c;
char DAT_14060944c;
undefined DAT_140477f34;
undefined *PTR_PTR_1405d8520;
longlong DAT_140608098;
longlong DAT_1406080a0;
longlong DAT_140608080;
undefined4 DAT_140607cb8;
undefined DAT_14047ba64;
undefined DAT_14047ba68;
undefined DAT_14047ba6c;
undefined DAT_1404a8f60;
undefined DAT_1404a8fb0;
char DAT_140609435;
ulonglong DAT_140607cc0;
char DAT_14060943d;
undefined DAT_14047ba14;
undefined DAT_14047ba58;
float UNK_000022b8;
float UNK_000022c0;
int DAT_1406093b8;
undefined DAT_1406093a8;
int DAT_1406080e8;
int DAT_1406080ec;
int DAT_1406080f0;
int DAT_1406080f4;
int DAT_1406080f8;
int DAT_140608100;
int DAT_140608104;
int DAT_140608108;
int DAT_14060810c;
pointer[6] vftable;
undefined DAT_14047ba04;
undefined DAT_14047ba08;
undefined DAT_1404a92e0;
pointer PTR_u_fDropItemCount01_1405e03f8;
undefined *PTR_u_nEnd01_1405dfc88;
int DAT_140608124;
undefined FUN_1402755d0;
int DAT_140608120;
int DAT_140608128;
int DAT_14060812c;
int DAT_1405d8848;
undefined DAT_1404ab6d0;
undefined DAT_1404ab720;
undefined DAT_1404ab760;
int DAT_1406093a4;
undefined DAT_1404ab798;
undefined8 DAT_14060d080;
undefined DAT_1404ab7c8;
undefined DAT_1404ab800;
undefined DAT_14047b9ec;
undefined DAT_14047b9e4;
undefined DAT_14047b9fc;
undefined DAT_14047b9f8;
undefined DAT_14047ba00;
undefined DAT_14047b9f4;
uint DAT_14060b7cc;
int DAT_140608718;
undefined DAT_140448e50;
int DAT_14060872c;
int DAT_140608734;
int DAT_140608730;
undefined DAT_1404ab8e8;
undefined DAT_1404ab900;
undefined DAT_1404ab918;
undefined DAT_1404ab928;
undefined DAT_1404ab938;
undefined DAT_1404ab948;
undefined DAT_1404ab950;
undefined DAT_1404ab964;
undefined DAT_1404ab970;
undefined DAT_1404ab984;
undefined DAT_1404ab990;
undefined DAT_1404ab9a4;
undefined DAT_1404ab9b0;
undefined DAT_1404ab9bc;
undefined DAT_1404ab9c0;
undefined DAT_1404ab9cc;
undefined DAT_1404ab9d8;
undefined DAT_1404ab9e4;
undefined DAT_1404ab9ec;
undefined DAT_1404ab9f4;
undefined DAT_1404aba00;
undefined DAT_1404aba10;
undefined DAT_1404aba1c;
undefined DAT_1404aba24;
undefined DAT_1404aba30;
undefined DAT_1404aba3c;
undefined DAT_1404aba48;
undefined DAT_1404aba50;
undefined DAT_1404aba58;
undefined DAT_1404aba64;
undefined DAT_1404aba6c;
undefined DAT_1404aba74;
undefined DAT_1404aba7c;
undefined DAT_1404aba88;
undefined DAT_1404aba90;
undefined DAT_1404abaa0;
undefined DAT_1404abab0;
undefined DAT_1404abab8;
undefined DAT_1404abac8;
undefined DAT_1404abad8;
undefined DAT_1404abae8;
undefined DAT_1404abaf8;
undefined DAT_1404abb08;
undefined DAT_1404abb20;
undefined DAT_1404abb30;
undefined DAT_1404abb40;
undefined DAT_1404abb50;
undefined DAT_1404abb60;
undefined DAT_1404abb70;
undefined DAT_1404abb80;
undefined DAT_1404abb98;
undefined DAT_1404abbb0;
undefined DAT_1404abbc0;
undefined DAT_1404abbd0;
undefined DAT_1404abbe8;
undefined DAT_1404abbf8;
undefined DAT_1404abc08;
undefined DAT_1404abc20;
undefined DAT_1404abc30;
undefined DAT_1404abc40;
undefined DAT_1404abc58;
undefined DAT_1404abc68;
undefined DAT_1404abc78;
undefined DAT_1404abc88;
undefined DAT_1404abca0;
undefined DAT_1404abcb8;
undefined DAT_1404abcd8;
undefined DAT_1404abcf8;
undefined DAT_1404abd18;
undefined DAT_1404abd30;
undefined DAT_1404abd48;
undefined DAT_1404abd58;
undefined DAT_1404abd68;
undefined DAT_1404abd80;
undefined DAT_1404abd98;
undefined DAT_1404abdb8;
undefined DAT_1404abdd0;
undefined DAT_1404abde8;
undefined DAT_1404abe00;
undefined DAT_1404abe18;
undefined DAT_1404abe38;
undefined DAT_1404abe48;
undefined DAT_1404abe60;
undefined DAT_1404abe78;
undefined DAT_1404abe90;
undefined DAT_1404abea0;
undefined DAT_1404abeb0;
undefined DAT_1404abec0;
undefined DAT_1404abed8;
undefined DAT_1404abef0;
undefined DAT_1404abf08;
undefined DAT_1404abf20;
undefined DAT_1404abf38;
undefined DAT_1404abf50;
undefined DAT_1404abf68;
undefined DAT_1404abf80;
undefined DAT_1404abf98;
undefined DAT_1404abfb0;
undefined DAT_1404abfc0;
undefined DAT_1404abfd0;
undefined DAT_1404abfe0;
undefined DAT_1404abff8;
undefined DAT_1404ac010;
undefined DAT_1404ac028;
undefined DAT_1404ac038;
undefined DAT_1404ac048;
undefined DAT_1404ac060;
undefined DAT_1404ac070;
undefined DAT_1404ac080;
undefined DAT_1404ac090;
undefined DAT_1404ac0a8;
undefined DAT_1404ac0c0;
undefined DAT_1404ac0d0;
undefined DAT_1404ac0e0;
undefined DAT_1404ac0f8;
undefined DAT_1404ac108;
undefined DAT_1404ac120;
undefined DAT_1404ac138;
undefined DAT_1404ac158;
undefined DAT_1404ac168;
undefined DAT_1404ac178;
undefined DAT_1404ac188;
undefined DAT_1404ac1a0;
undefined DAT_1404ac1b8;
undefined DAT_1404ac1d0;
undefined DAT_1404ac1e8;
undefined DAT_1404ac1f8;
undefined DAT_1404ac210;
undefined DAT_1404ac228;
undefined DAT_1404ac240;
undefined DAT_1404ac258;
undefined DAT_1404ac26c;
undefined DAT_1404ac270;
undefined DAT_1404ac294;
undefined DAT_1404ac298;
undefined DAT_1404ac2a0;
undefined DAT_1404ac2b0;
undefined DAT_1404ac2c0;
undefined DAT_1404ac2d0;
undefined DAT_1404ac2e0;
undefined DAT_1404ac2f0;
undefined DAT_1404ac300;
undefined DAT_1404ac310;
undefined DAT_1404ac4e8;
undefined DAT_1404ac4f8;
undefined DAT_1404ac508;
undefined DAT_1404a8ff8;
int DAT_140608744;
int DAT_140608740;
int DAT_140608728;
int DAT_140608738;
undefined8 DAT_140608068;
int DAT_140607cbc;
uint DAT_1406080a8;
int DAT_140608150;
int DAT_140608154;
double DAT_1405dfc58;
int DAT_140608140;
undefined8 DAT_140608148;
undefined4 UNK_00000214;
undefined4 UNK_00000218;
undefined4 UNK_000000fc;
int DAT_140608158;
int DAT_140608160;
int DAT_14060815c;
int DAT_140608164;
int DAT_140608168;
undefined8 DAT_14060d130;
pointer[350] vftable;
undefined2 DAT_1404ac548;
undefined2 DAT_1404ac560;
undefined DAT_1404ad198;
undefined2 DAT_14049dca8;
pointer[349] vftable;
undefined8 DAT_1406081e0;
int DAT_140608178;
undefined8 DAT_140608170;
int DAT_1406081cc;
undefined LAB_14023bec0;
undefined LAB_14023bed0;
IMAGE_DOS_HEADER IMAGE_DOS_HEADER_140000000;
uint switchdataD_1402237e8;
int DAT_14060813c;
undefined4 DAT_140608138;
longlong DAT_1406081d8;
int DAT_140608190;
int DAT_14060818c;
uint DAT_1406081ac;
undefined4 DAT_1406081b0;
float DAT_1406081b8;
int DAT_140608134;
undefined4 DAT_140608130;
uint DAT_14060819c;
float DAT_1406081a0;
float DAT_1406081a4;
float DAT_1406081a8;
uint DAT_1406081bc;
undefined4 DAT_1406081b4;
undefined4 DAT_1406081b8;
float DAT_1406081c0;
float DAT_1406081c4;
float DAT_1406081c8;
undefined2 DAT_1404ad3e8;
undefined2 DAT_1404ad418;
undefined2 DAT_1404ad430;
uint DAT_14060ab70;
undefined8 DAT_14060ab50;
longlong DAT_14060ab58;
undefined DAT_14060ab60;
undefined FUN_140448c50;
int DAT_1406081d0;
undefined8 DAT_1406081f0;
undefined8 DAT_1406081f8;
undefined DAT_140607d08;
float UNK_000000fc;
int UNK_00000218;
int UNK_00000214;
undefined2 DAT_1404ae120;
undefined2 DAT_1404ae130;
longlong DAT_1406081f8;
float DAT_1406081b4;
undefined DAT_140607ef8;
undefined DAT_140607f18;
undefined8 DAT_140607ef0;
undefined1 DAT_140607f08;
pointer vftable_meta_ptr;
undefined DAT_140607f10;
undefined DAT_140607f20;
undefined DAT_140607f28;
undefined8 DAT_14049ab70;
undefined UNK_14049aca8;
uint DAT_140609408;
undefined DAT_1406093e8;
int DAT_1406093fc;
undefined1 DAT_140609400;
undefined LAB_140448cb0;
int DAT_140608200;
int DAT_140608204;
longlong DAT_1406081f0;
undefined2 DAT_1404aed90;
undefined2 DAT_1404d2988;
undefined8 DAT_140608220;
uint DAT_14060b7f0;
undefined8 DAT_14060b7d0;
longlong DAT_14060b7d8;
undefined FUN_140448cd0;
undefined DAT_14060b7e0;
uint DAT_140608208;
float DAT_140608218;
undefined DAT_140608210;
undefined8 DAT_140608210;
undefined8 DAT_140607d00;
undefined8 DAT_140608228;
undefined2 DAT_1404b5e10;
int DAT_140608230;
int DAT_140608234;
undefined FUN_140129b90;
undefined DAT_14047b98c;
undefined DAT_14047b990;
undefined FUN_140004650;
undefined LAB_140003b90;
undefined DAT_1404b5fa0;
undefined DAT_14047b988;
int DAT_1406093a0;
undefined8 DAT_14060d140;
undefined DAT_1404b5fd0;
undefined DAT_14047b978;
undefined DAT_14047b980;
undefined DAT_14047b97c;
int DAT_140608238;
int DAT_140607cc8;
pointer[20] vftable;
longlong DAT_140607fd8;
undefined DAT_1404a34c8;
undefined DAT_1404b7058;
undefined DAT_1404b7080;
undefined DAT_1404b70e4;
undefined DAT_14047b970;
undefined DAT_140607f30;
undefined4 *DAT_140607c18;
undefined DAT_1404b7c6c;
undefined DAT_1404b72b8;
int DAT_140608198;
undefined4 DAT_14060818c;
undefined4 DAT_140608194;
LPCRITICAL_SECTION DAT_140608240;
longlong *DAT_140606108;
longlong *DAT_140606100;
int DAT_14060823c;
char DAT_140607c16;
HWND DAT_140607bc0;
pointer PTR_1404c0038;
undefined DAT_1404781f0;
undefined DAT_14047a3f0;
undefined DAT_14047a7f0;
undefined DAT_14047abf0;
undefined DAT_14047aff0;
undefined1 DAT_14047b3f0;
undefined DAT_1404782f0;
undefined DAT_1404793f0;
undefined DAT_1404797f0;
undefined DAT_140479bf0;
undefined DAT_140479ff0;
undefined DAT_14047b41c;
undefined DAT_14047b424;
undefined DAT_14047b42c;
pointer[9] vftable;
undefined4 DAT_1406081c0;
undefined4 DAT_1406081c4;
undefined4 DAT_1406081c8;
uint DAT_140608248;
undefined4 DAT_140608250;
undefined4 DAT_140608254;
undefined4 DAT_140608258;
undefined4 DAT_1406081a4;
undefined4 DAT_1406081a0;
undefined4 DAT_1406081a8;
undefined DAT_1405d3810;
uint DAT_14060817c;
undefined4 DAT_140608180;
undefined4 DAT_140608184;
undefined4 DAT_140608188;
uint DAT_140477958;
uint DAT_14047795c;
undefined DAT_140608018;
undefined8 DAT_140608260;
undefined LAB_1402c70a0;
undefined FUN_14033a390;
undefined FUN_1401407c0;
uint DAT_1406093e4;
undefined DAT_1406093d8;
undefined DAT_1406093e0;
undefined8 DAT_140608268;
undefined FUN_14034ebc0;
LPCRITICAL_SECTION DAT_140608270;
LPCRITICAL_SECTION DAT_140608278;
LPCRITICAL_SECTION DAT_140608280;
undefined FUN_14034eb10;
undefined LAB_14034e920;
undefined8 DAT_140607fb0;
undefined8 DAT_140607fa8;
undefined4 DAT_140608700;
undefined DAT_140608708;
undefined DAT_140608710;
undefined DAT_140608718;
undefined DAT_140608720;
undefined DAT_140608728;
undefined DAT_140608730;
undefined DAT_140608738;
undefined DAT_140608740;
ulonglong DAT_1405e74f8;
undefined8 DAT_1405e74e0;
pointer PTR_u_LOG_CONNECTION_1405db7f0;
undefined DAT_1402d7818;
undefined DAT_14060a258;
undefined DAT_14060a260;
undefined DAT_14060a268;
undefined DAT_14060a288;
undefined DAT_14060a28c;
undefined DAT_14060a290;
undefined DAT_14060a298;
undefined DAT_14060a26c;
undefined DAT_14060a270;
undefined DAT_14060a274;
undefined DAT_14060a278;
undefined DAT_14060a280;
undefined DAT_14060a2a0;
undefined DAT_14060a2a8;
undefined DAT_14060a2b0;
undefined DAT_14060a2d0;
undefined DAT_14060a2d4;
undefined DAT_14060a2d8;
undefined DAT_14060a2e0;
undefined DAT_14060a2b4;
undefined DAT_14060a2b8;
undefined DAT_14060a2bc;
undefined DAT_14060a2c0;
undefined DAT_14060a2c8;
undefined DAT_14060a2e8;
undefined DAT_14060a2f0;
undefined DAT_14060a2f8;
undefined DAT_14060a318;
undefined DAT_14060a31c;
undefined DAT_14060a320;
undefined DAT_14060a328;
undefined DAT_14060a2fc;
undefined DAT_14060a300;
undefined DAT_14060a304;
undefined DAT_14060a308;
undefined DAT_14060a310;
undefined DAT_14060a330;
undefined DAT_14060a338;
undefined DAT_14060a340;
undefined DAT_14060a360;
undefined DAT_14060a364;
undefined DAT_14060a368;
undefined DAT_14060a370;
undefined DAT_14060a344;
undefined DAT_14060a348;
undefined DAT_14060a34c;
undefined DAT_14060a350;
undefined DAT_14060a358;
undefined DAT_14060a378;
undefined DAT_14060a380;
undefined DAT_14060a388;
undefined DAT_14060a3a8;
undefined DAT_14060a3ac;
undefined DAT_14060a3b0;
undefined DAT_14060a3b8;
undefined DAT_14060a38c;
undefined DAT_14060a390;
undefined DAT_14060a394;
undefined DAT_14060a398;
undefined DAT_14060a3a0;
undefined DAT_14060a3c0;
undefined DAT_14060a3c8;
undefined DAT_14060a3d0;
undefined DAT_14060a3f0;
undefined DAT_14060a3f4;
undefined DAT_14060a3f8;
undefined DAT_14060a400;
undefined DAT_14060a3d4;
undefined DAT_14060a3d8;
undefined DAT_14060a3dc;
undefined DAT_14060a3e0;
undefined DAT_14060a3e8;
undefined DAT_14060a408;
undefined DAT_14060a410;
undefined DAT_14060a418;
undefined DAT_14060a438;
undefined DAT_14060a43c;
undefined DAT_14060a440;
undefined DAT_14060a448;
undefined DAT_14060a41c;
undefined DAT_14060a420;
undefined DAT_14060a424;
undefined DAT_14060a428;
undefined DAT_14060a430;
undefined DAT_14060a210;
pointer PTR_u_nItemValue00_1405db4f0;
undefined LAB_1402e12f0;
undefined FUN_1402e3a00;
undefined LAB_1402e11d0;
undefined FUN_1402e3980;
uint DAT_14060cf50;
undefined FUN_140448e60;
pointer PTR_u_nQuest00_1405db750;
uint DAT_14060cf48;
undefined LAB_140448ed0;
undefined DAT_14060a1c0;
uint DAT_14060cf44;
undefined LAB_140448ee0;
undefined DAT_14060a170;
undefined DAT_14060a22c;
undefined DAT_14060a220;
undefined DAT_14060a244;
undefined DAT_14060a224;
undefined DAT_14060a228;
undefined DAT_14060a218;
undefined DAT_14060a240;
undefined DAT_14060a248;
undefined DAT_14060a250;
undefined DAT_14060a230;
undefined DAT_14060a238;
undefined DAT_14060a1dc;
undefined DAT_14060a1d0;
undefined DAT_14060a1f4;
undefined DAT_14060a1d4;
undefined DAT_14060a1d8;
undefined DAT_14060a1c8;
undefined DAT_14060a1f0;
undefined DAT_14060a1f8;
undefined DAT_14060a200;
undefined DAT_14060a1e0;
undefined DAT_14060a1e8;
undefined DAT_14060a18c;
undefined DAT_14060a180;
undefined DAT_14060a1a4;
undefined DAT_14060a184;
undefined DAT_14060a188;
undefined DAT_14060a178;
undefined DAT_14060a1a0;
undefined DAT_14060a1a8;
undefined DAT_14060a1b0;
undefined DAT_14060a190;
undefined DAT_14060a198;
undefined8 DAT_14060aa60;
undefined DAT_14060aa68;
undefined4 DAT_14060aa70;
undefined DAT_14060aa90;
undefined DAT_14060aa94;
undefined DAT_14060aa98;
undefined DAT_14060aaa0;
undefined DAT_14060aa74;
undefined DAT_14060aa78;
undefined DAT_14060aa7c;
undefined DAT_14060aa80;
undefined DAT_14060aa88;
undefined DAT_14060aaa8;
undefined DAT_14060aab0;
undefined DAT_14060aab8;
undefined DAT_14060aad8;
undefined DAT_14060aadc;
undefined DAT_14060aae0;
undefined DAT_14060aae8;
undefined DAT_14060aabc;
undefined DAT_14060aac0;
undefined DAT_14060aac4;
undefined DAT_14060aac8;
undefined DAT_14060aad0;
undefined DAT_14060ab30;
undefined DAT_14060ab38;
undefined DAT_14060ab40;
undefined8 DAT_14060aaf0;
pointer PTR_u_nRandomQuestGroup00_1405dabf8;
undefined *PTR_u_fRandomProbability00_1405daee8;
pointer PTR_u_nShopID00_1405db030;
pointer PTR_u_nQuestGroup00_1405db160;
pointer PTR_u_nMissionGroup00_1405db1b0;
longlong DAT_14060ab10;
uint DAT_14060aa70;
ulonglong DAT_14060aaf8;
undefined DAT_1404c7f70;
undefined FUN_140448ef0;
uint DAT_14060cf40;
uint DAT_14060cf3c;
undefined LAB_140448f40;
undefined8 DAT_1406086b0;
undefined DAT_1406086cc;
undefined4 DAT_1406086c0;
undefined4 DAT_1406086e4;
undefined DAT_1406086c4;
undefined DAT_1406086c8;
undefined8 DAT_1406086b8;
undefined4 DAT_1406086e0;
undefined8 DAT_1406086e8;
undefined8 DAT_1406086f0;
longlong DAT_1406086d0;
ulonglong DAT_1406086d8;
uint DAT_1406086c0;
longlong DAT_1406086b0;
void *DAT_1406086b0;
int DAT_1406086e0;
longlong *DAT_1406086e8;
undefined8 *DAT_1406086f0;
uint DAT_1406086e4;
undefined8 *DAT_1406086e8;
ulonglong DAT_1406086b8;
ulonglong DAT_1406086d0;
longlong DAT_1406086f0;
undefined *PTR_u_nItemCode00_1405daf10;
pointer PTR_u_fRatio00_1405daf60;
undefined FUN_140448f50;
uint DAT_14060cf38;
undefined DAT_140608678;
undefined8 DAT_140608688;
undefined DAT_140608690;
undefined DAT_140608698;
longlong *DAT_14060a4d8;
longlong *DAT_14060a4c8;
longlong *DAT_14060a4b8;
longlong *DAT_14060a4a8;
longlong DAT_140608060;
LPCRITICAL_SECTION DAT_140608290;
undefined2 DAT_1404c8368;
undefined2 DAT_1404c8378;
undefined2 DAT_1404c8388;
uint DAT_14060cf34;
undefined DAT_14060a4a0;
undefined8 DAT_14060a4a8;
undefined DAT_14060a4b0;
undefined8 DAT_14060a4b8;
undefined DAT_14060a4c0;
undefined8 DAT_14060a4c8;
undefined DAT_14060a4d0;
undefined8 DAT_14060a4d8;
undefined LAB_140448f90;
uint DAT_14060cf30;
undefined DAT_140448fa0;
undefined DAT_14060cdf0;
uint DAT_14060cf2c;
undefined DAT_14060cde0;
undefined DAT_140448fb0;
LPCRITICAL_SECTION DAT_140608298;
undefined DAT_1404a3500;
pointer[192] vftable;
char DAT_140607ccc;
undefined DAT_1404cad68;
undefined4 DAT_140607c2c;
undefined DAT_140607c3c;
uint DAT_14060939c;
undefined DAT_140609390;
undefined DAT_140609394;
undefined DAT_140609398;
undefined8 DAT_14060a940;
undefined DAT_14060a948;
undefined4 DAT_14060a950;
undefined DAT_14060a970;
undefined DAT_14060a974;
undefined DAT_14060a978;
undefined DAT_14060a980;
undefined DAT_14060a954;
undefined DAT_14060a958;
undefined DAT_14060a95c;
undefined DAT_14060a960;
undefined DAT_14060a968;
undefined8 DAT_14060a988;
undefined DAT_14060a990;
undefined4 DAT_14060a998;
undefined DAT_14060a9b8;
undefined DAT_14060a9bc;
undefined DAT_14060a9c0;
undefined DAT_14060a9c8;
undefined DAT_14060a99c;
undefined DAT_14060a9a0;
undefined DAT_14060a9a4;
undefined DAT_14060a9a8;
undefined DAT_14060a9b0;
undefined DAT_14060a9d0;
undefined DAT_14060a9d8;
undefined DAT_14060a9e0;
undefined DAT_14060aa00;
undefined DAT_14060aa04;
undefined DAT_14060aa08;
undefined DAT_14060aa10;
undefined DAT_14060a9e4;
undefined DAT_14060a9e8;
undefined DAT_14060a9ec;
undefined DAT_14060a9f0;
undefined DAT_14060a9f8;
undefined DAT_14060aa18;
undefined DAT_14060aa20;
undefined DAT_14060aa28;
undefined DAT_14060aa48;
undefined DAT_14060aa4c;
undefined DAT_14060aa50;
undefined DAT_14060aa58;
undefined DAT_14060aa2c;
undefined DAT_14060aa30;
undefined DAT_14060aa34;
undefined DAT_14060aa38;
undefined DAT_14060aa40;
uint DAT_14060a998;
uint DAT_14060a950;
undefined DAT_1404cbef0;
uint DAT_14060cf4c;
undefined FUN_140448fc0;
uint DAT_14060cf28;
undefined LAB_140449000;
undefined8 DAT_140608630;
undefined DAT_14060864c;
undefined4 DAT_140608640;
undefined4 DAT_140608664;
undefined DAT_140608644;
undefined DAT_140608648;
undefined8 DAT_140608638;
undefined4 DAT_140608660;
undefined8 DAT_140608668;
undefined8 DAT_140608670;
longlong DAT_140608650;
ulonglong DAT_140608658;
uint DAT_140608640;
longlong DAT_140608630;
void *DAT_140608630;
int DAT_140608660;
longlong *DAT_140608668;
undefined8 *DAT_140608670;
uint DAT_140608664;
undefined8 *DAT_140608668;
ulonglong DAT_140608638;
ulonglong DAT_140608650;
longlong DAT_140608670;
undefined DAT_1405f2410;
uint DAT_14060cf24;
undefined LAB_140449010;
undefined8 DAT_1406085e0;
undefined DAT_1406085fc;
undefined4 DAT_1406085f0;
undefined4 DAT_140608614;
undefined DAT_1406085f4;
undefined DAT_1406085f8;
undefined8 DAT_1406085e8;
undefined4 DAT_140608610;
undefined8 DAT_140608618;
undefined8 DAT_140608620;
longlong DAT_140608600;
ulonglong DAT_140608608;
uint DAT_1406085f0;
longlong DAT_1406085e0;
void *DAT_1406085e0;
int DAT_140608610;
longlong *DAT_140608618;
undefined8 *DAT_140608620;
uint DAT_140608614;
undefined8 *DAT_140608618;
ulonglong DAT_1406085e8;
ulonglong DAT_140608600;
longlong DAT_140608620;
undefined DAT_1404cedb8;
uint DAT_14060b7c8;
undefined FUN_140449020;
undefined8 DAT_1406085b8;
undefined8 DAT_1406085c0;
undefined DAT_1406085c8;
undefined8 DAT_140608570;
undefined DAT_1405d3988;
undefined DAT_14060858c;
undefined4 DAT_140608580;
undefined DAT_1406085a4;
undefined DAT_140608584;
undefined DAT_140608588;
undefined8 DAT_140608578;
undefined4 DAT_1406085a0;
undefined8 DAT_1406085a8;
undefined8 DAT_1406085b0;
undefined DAT_140608590;
ulonglong DAT_140608598;
void *DAT_140608570;
int DAT_1406085a0;
uint DAT_140608580;
longlong *DAT_1406085a8;
undefined DAT_1405d3a60;
undefined DAT_1405d3b38;
longlong DAT_1406085b0;
ulonglong DAT_140608578;
undefined DAT_1405d3c10;
undefined *PTR_`vftable'_14044a420;
undefined DAT_1404cf4f0;
facet *DAT_1406082a0;
undefined *PTR_id_14044a560;
undefined DAT_1405d3c48;
undefined DAT_140477e44;
pointer PTR_u_szDesc00_1405da610;
uint DAT_14060cf20;
undefined LAB_140449100;
undefined8 DAT_1406084d0;
undefined *PTR_u_fValue00_1405da5e0;
uint DAT_14060cf1c;
undefined LAB_140449110;
undefined8 DAT_140608520;
undefined DAT_14060853c;
undefined4 DAT_140608530;
undefined4 DAT_140608554;
undefined DAT_140608534;
undefined DAT_140608538;
undefined8 DAT_140608528;
undefined4 DAT_140608550;
undefined8 DAT_140608558;
undefined8 DAT_140608560;
longlong DAT_140608540;
ulonglong DAT_140608548;
uint DAT_140608530;
longlong DAT_140608520;
void *DAT_140608520;
int DAT_140608550;
longlong *DAT_140608558;
undefined8 *DAT_140608560;
uint DAT_140608554;
undefined8 *DAT_140608558;
ulonglong DAT_140608528;
ulonglong DAT_140608540;
longlong DAT_140608560;
undefined8 *DAT_140608510;
uint DAT_140608504;
undefined8 *DAT_140608508;
ulonglong DAT_1406084d8;
longlong DAT_1406084d0;
ulonglong DAT_1406084f0;
int DAT_140608500;
uint DAT_1406084e0;
undefined DAT_1406084ec;
undefined4 DAT_1406084e0;
undefined4 DAT_140608504;
undefined DAT_1406084e4;
undefined DAT_1406084e8;
undefined8 DAT_1406084d8;
undefined4 DAT_140608500;
undefined8 DAT_140608508;
undefined8 DAT_140608510;
longlong DAT_1406084f0;
ulonglong DAT_1406084f8;
void *DAT_1406084d0;
longlong DAT_140608510;
longlong *DAT_140608508;
uint DAT_140609450;
undefined8 DAT_140608488;
undefined DAT_140608490;
undefined4 DAT_140608498;
undefined DAT_1406084b8;
undefined DAT_1406084bc;
undefined DAT_1406084c0;
undefined DAT_1406084c8;
undefined DAT_14060849c;
undefined DAT_1406084a0;
undefined DAT_1406084a4;
undefined DAT_1406084a8;
undefined DAT_1406084b0;
undefined8 DAT_140608440;
uint DAT_140608498;
uint DAT_14060cf18;
undefined FUN_140449120;
uint DAT_14060cf14;
undefined LAB_140449140;
undefined8 DAT_1406083f0;
longlong DAT_1406083d0;
uint DAT_14060cf10;
undefined8 DAT_1406083b0;
undefined FUN_140449150;
undefined DAT_14060a500;
uint DAT_14060cf0c;
undefined LAB_14031d770;
undefined LAB_140449170;
undefined DAT_14060845c;
undefined4 DAT_140608450;
undefined4 DAT_140608474;
undefined DAT_140608454;
undefined DAT_140608458;
undefined8 DAT_140608448;
undefined4 DAT_140608470;
undefined8 DAT_140608478;
undefined8 DAT_140608480;
longlong DAT_140608460;
ulonglong DAT_140608468;
uint DAT_140608450;
longlong DAT_140608440;
undefined DAT_14060840c;
undefined4 DAT_140608400;
undefined4 DAT_140608424;
undefined DAT_140608404;
undefined DAT_140608408;
undefined8 DAT_1406083f8;
undefined4 DAT_140608420;
undefined8 DAT_140608428;
undefined8 DAT_140608430;
longlong DAT_140608410;
ulonglong DAT_140608418;
uint DAT_140608400;
longlong DAT_1406083f0;
undefined *DAT_1406083b8;
undefined4 DAT_1406083d8;
undefined1 DAT_1406083c8;
undefined8 DAT_1406083d0;
undefined8 DAT_1406083e0;
undefined8 DAT_1406083e8;
void *DAT_140608440;
int DAT_140608470;
longlong *DAT_140608478;
void *DAT_1406083f0;
int DAT_140608420;
longlong *DAT_140608428;
ulonglong DAT_1406083b8;
undefined8 *DAT_1406083e0;
undefined8 DAT_1406083b8;
undefined8 *DAT_140608480;
uint DAT_140608474;
undefined8 *DAT_140608478;
ulonglong DAT_140608448;
ulonglong DAT_140608460;
longlong DAT_140608480;
undefined8 *DAT_140608430;
uint DAT_140608424;
undefined8 *DAT_140608428;
ulonglong DAT_1406083f8;
ulonglong DAT_140608410;
longlong DAT_140608430;
ulonglong DAT_1406083e8;
ulonglong DAT_1406083d0;
longlong DAT_1406083b8;
float DAT_1406083d8;
ulonglong DAT_1406083b0;
longlong *DAT_1406083b0;
longlong *DAT_1406083e0;
undefined DAT_1404ac540;
int DAT_140609388;
undefined8 DAT_140609380;
longlong DAT_140608170;
longlong *DAT_140608170;
uint DAT_14060cf08;
undefined LAB_140449190;
undefined8 DAT_140608360;
undefined DAT_1404d27b0;
uint DAT_14060cf04;
undefined LAB_1404491a0;
undefined8 DAT_140608310;
uint DAT_14060cf00;
undefined LAB_1404491b0;
undefined8 DAT_1406082c0;
undefined DAT_14060837c;
undefined4 DAT_140608370;
undefined4 DAT_140608394;
undefined DAT_140608374;
undefined DAT_140608378;
undefined8 DAT_140608368;
undefined4 DAT_140608390;
undefined8 DAT_140608398;
undefined8 DAT_1406083a0;
longlong DAT_140608380;
ulonglong DAT_140608388;
uint DAT_140608370;
longlong DAT_140608360;
void *DAT_140608360;
int DAT_140608390;
longlong *DAT_140608398;
undefined DAT_14060832c;
undefined4 DAT_140608320;
undefined4 DAT_140608344;
undefined DAT_140608324;
undefined DAT_140608328;
undefined8 DAT_140608318;
undefined4 DAT_140608340;
undefined8 DAT_140608348;
undefined8 DAT_140608350;
longlong DAT_140608330;
ulonglong DAT_140608338;
uint DAT_140608320;
longlong DAT_140608310;
void *DAT_140608310;
int DAT_140608340;
longlong *DAT_140608348;
undefined DAT_1406082dc;
undefined4 DAT_1406082d0;
undefined4 DAT_1406082f4;
undefined DAT_1406082d4;
undefined DAT_1406082d8;
undefined8 DAT_1406082c8;
undefined4 DAT_1406082f0;
undefined8 DAT_1406082f8;
undefined8 DAT_140608300;
longlong DAT_1406082e0;
ulonglong DAT_1406082e8;
uint DAT_1406082d0;
longlong DAT_1406082c0;
void *DAT_1406082c0;
int DAT_1406082f0;
longlong *DAT_1406082f8;
longlong DAT_1406083a0;
ulonglong DAT_140608368;
longlong DAT_140608350;
ulonglong DAT_140608318;
longlong DAT_140608300;
ulonglong DAT_1406082c8;
undefined8 *DAT_1406083a0;
uint DAT_140608394;
undefined8 *DAT_140608398;
ulonglong DAT_140608380;
undefined8 *DAT_140608350;
uint DAT_140608344;
undefined8 *DAT_140608348;
ulonglong DAT_140608330;
undefined8 *DAT_140608300;
uint DAT_1406082f4;
undefined8 *DAT_1406082f8;
ulonglong DAT_1406082e0;
LPCRITICAL_SECTION DAT_1406082a8;
undefined4 DAT_1406081ec;
int DAT_1406081e8;
LPCRITICAL_SECTION DAT_1406082b0;
undefined2 DAT_1404d3e18;
undefined2 DAT_1404d3e28;
undefined2 DAT_1404ceb70;
LPCRITICAL_SECTION DAT_1406082b8;
undefined2 DAT_1404d41c0;
undefined4 DAT_14060936c;
undefined4 DAT_140609374;
int DAT_140609370;
int DAT_140609378;
undefined DAT_1404d50e0;
int DAT_140609368;
undefined8 DAT_1405f0468;
int DAT_140609360;
undefined DAT_140609364;
uint DAT_1405f0568;
undefined DAT_1405f0500;
int DAT_1405f0648;
int DAT_1405f0580;
undefined *DAT_1405f0508;
longlong DAT_1405f0520;
char DAT_1405d8000;
uint DAT_1405f0588;
undefined DAT_1405f0584;
undefined DAT_1405f05c8;
uint DAT_1405f0638;
undefined1 DAT_1405f0630;
undefined LAB_140449270;
undefined DAT_1405f0600;
pointer[5] vftable;
int DAT_1405d8098;
double DAT_1405d8090;
undefined DAT_1405f0650;
char DAT_1405d8280;
uint DAT_1405f06a8;
undefined8 DAT_1405f06a0;
undefined DAT_1405f06b0;
undefined FUN_140449290;
undefined4 DAT_1405d83d0;
undefined2 DAT_1405d83d4;
char DAT_1405f0950;
undefined *PTR_u_www.nettention.co.kr_1405d8288;
undefined4 DAT_1405d8290;
undefined *PTR_s_GET_/PNReport/ReportError.php?Te_1405d8298;
undefined *PTR_s_HTTP/1.1_User-Agent:_Mozilla/5.0_1405d82a0;
undefined FUN_140352bc0;
char DAT_1405d8340;
uint DAT_1405f07c0;
undefined LAB_1404492e0;
undefined DAT_1405f0700;
undefined DAT_1405f07c8;
char DAT_1405d8380;
uint DAT_1405f0804;
undefined LAB_1404492f0;
undefined DAT_1405f0800;
undefined DAT_1405f0898;
undefined DAT_14044d0b0;
undefined DAT_14049aa7c;
char DAT_1405d83c0;
uint DAT_1405f0858;
undefined LAB_140449320;
undefined DAT_1405f0810;
undefined DAT_1405f0860;
undefined DAT_14044d150;
undefined8 DAT_1405f0900;
undefined *PTR_u_CListNode_reports_a_consistency_p_1405d8470;
undefined DAT_14044d258;
undefined DAT_14044d3b8;
undefined *DAT_1405f0900;
undefined FUN_140357430;
undefined DAT_1405f0958;
undefined DAT_1405f0990;
undefined DAT_14044db98;
undefined DAT_1405f13b0;
int DAT_1405f13a8;
uint DAT_1405f13a8;
uint DAT_1405f13f0;
ulonglong DAT_1405f13b0;
undefined LAB_140449360;
undefined DAT_1405f13b8;
char DAT_1405f064d;
undefined DAT_14044e320;
undefined DAT_14044e340;
char DAT_1405d84c0;
uint DAT_1405f1e18;
undefined DAT_1405f1400;
undefined DAT_1405f1dd8;
undefined LAB_140449380;
undefined DAT_1405f1de0;
undefined DAT_1405f1e20;
undefined DAT_14044e430;
uintptr_t DAT_1405d84f0;
undefined _type_info_dtor_internal_method;
PVOID DAT_14060d4a8;
PVOID DAT_14060d4a0;
undefined4 DAT_1405f2404;
undefined4 DAT_1405f2400;
undefined DAT_1405f1e74;
undefined DAT_1405f1e70;
undefined4 DAT_1405f1e58;
undefined8 DAT_1405f1e60;
undefined8 DAT_1405f1e68;
undefined FUN_14035ac0c;
void *DAT_14060d490;
int DAT_14060d488;
undefined8 DAT_14060d498;
undefined *PTR___winitenv_14044a670;
uint DAT_1405f1e78;
int DAT_1405f1e5c;
int DAT_1405f1e7c;
undefined DAT_14044ade8;
undefined DAT_14044b7e0;
undefined DAT_14044b7e8;
undefined DAT_14044b800;
void *StackBase;
undefined FUN_14035ad20;
undefined4 DAT_1405f1e5c;
undefined *PTR__fmode_14044a638;
undefined4 DAT_1405f240c;
undefined *PTR__commode_14044a640;
undefined4 DAT_1405f2408;
int DAT_1405d851c;
int DAT_1405d8518;
void *StackLimit;
undefined DAT_1405f1f30;
DWORD64 DAT_1405f2028;
undefined DAT_1405f1ea0;
undefined DAT_1405f1fb0;
undefined DAT_1405f1e90;
undefined DAT_1405f1e94;
undefined8 DAT_1405d84f8;
int DAT_1405f1f28;
undefined DAT_1405f1fc8;
pointer PTR_DAT_14044e4a0;
undefined FUN_14035ab70;
undefined8 DAT_14052b1c8;
undefined8 DAT_14052b1d8;
ulonglong DAT_1405d84f8;
undefined1 DAT_140607fc0;
undefined DAT_14044e4d0;
undefined *PTR_LAB_14044e4e0;
undefined *PTR_Allocate_14044e508;
undefined DAT_1405d8550;
pointer PTR_FUN_14044e560;
undefined DAT_1405d3518;
undefined8 DAT_1405d8138;
undefined4 DAT_1405d8148;
undefined1 DAT_1405d8145;
char DAT_1405d8880;
uint DAT_1405f2618;
undefined8 DAT_1405f2610;
undefined DAT_1405f2620;
undefined FUN_140449400;
undefined *PTR_u_Duplicated_RMI_ID_is_found._Revi_1405d9000;
undefined *PTR_u_Already_async_callback_may_occur_1405d9010;
int DAT_1405d8190;
short DAT_1405d83d4;
int DAT_1405d83d0;
char DAT_1405f064f;
undefined UNK_14036047e;
undefined UNK_140360484;
undefined UNK_1403604db;
undefined DAT_1405f2490;
undefined UNK_140361e1f;
pointer PTR_vftable_1405d95c0;
double DAT_1405d8198;
undefined *PTR_DAT_1405d8918;
undefined *PTR_DAT_1405d8910;
undefined *PTR_DAT_1405d8908;
undefined *PTR_DAT_1405d8900;
undefined *PTR_DAT_1405d88f8;
undefined *PTR_DAT_1405d88f0;
undefined *PTR_DAT_1405d88e8;
undefined *PTR_DAT_1405d88e0;
undefined *PTR_DAT_1405d88d8;
undefined *PTR_DAT_1405d88d0;
undefined *PTR_DAT_1405d88c8;
undefined *PTR_DAT_1405d88c0;
undefined *PTR_DAT_1405d88b8;
undefined *PTR_DAT_1405d88b0;
undefined *PTR_DAT_1405d88a8;
undefined *PTR_DAT_1405d88a0;
undefined *PTR_DAT_1405d8898;
undefined *PTR_DAT_1405d8890;
undefined *PTR_DAT_1405d8888;
undefined *PTR_DAT_1405d8930;
undefined *PTR_DAT_1405d8938;
undefined *PTR_DAT_1405d8940;
undefined *PTR_DAT_1405d8948;
undefined *PTR_DAT_1405d8950;
undefined *PTR_DAT_1405d8958;
undefined *PTR_DAT_1405d8960;
undefined *PTR_DAT_1405d8968;
undefined *PTR_DAT_1405d8970;
undefined *PTR_DAT_1405d8978;
undefined *PTR_DAT_1405d8980;
undefined *PTR_DAT_1405d8988;
undefined *PTR_DAT_1405d8990;
undefined *PTR_DAT_1405d8998;
undefined *PTR_DAT_1405d89a0;
undefined *PTR_DAT_1405d89a8;
undefined *PTR_DAT_1405d89b0;
double DAT_1405f0688;
undefined UNK_14036b2bd;
undefined UNK_14036b2ea;
undefined UNK_14036b2fc;
undefined UNK_14036b329;
undefined DAT_140452aa0;
undefined2 DAT_1405f08d8;
undefined DAT_1405f08d0;
double DAT_1405d80f8;
undefined1 DAT_1405d81cc;
undefined UNK_14036c432;
undefined UNK_14036c438;
undefined UNK_14036c43e;
undefined UNK_14036c444;
undefined UNK_14036c44a;
undefined UNK_14036c450;
undefined UNK_14036c456;
undefined UNK_14036c45c;
undefined UNK_14036c462;
undefined UNK_14036c50d;
undefined DAT_1405d8158;
undefined *PTR_u_Collection_object_can_use_fast_h_1405d81d0;
undefined *PTR_DAT_1405d8920;
undefined *PTR_DAT_1405d8928;
undefined DAT_140453250;
undefined DAT_140453360;
int DAT_1405f2680;
undefined8 DAT_1405f2688;

// 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_1405d84f0 ^ (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_1405d84f0 ^ (ulonglong)auStack_248;
  lVar1 = param_1 + 0x3c;
  if (param_2 != 0) {
    lVar1 = param_2;
  }
  FUN_140001b80(param_1 + 0x246,L"%s [%u]",lVar1,*(undefined4 *)(param_1 + 0x450));
  local_228 = L'\0';
  memset(local_226,0,0x206);
  FUN_140001b50(&local_228,&DAT_140475be8,param_1 + 0x246);
  SetConsoleTitleW(&local_228);
  return;
}



void FUN_1400012a0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4)

{
  FUN_140418da0(DAT_140607fd8,L"Invalid parameter detected in function %s. File: %s Line: %d\n",
                param_2,param_3,param_4);
  FUN_140418da0(DAT_140607fd8,L"Expression: %s\n",param_1);
  return;
}



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

undefined8 FUN_1400012f0(int param_1,longlong param_2)

{
  short sVar1;
  char cVar2;
  DWORD DVar3;
  _invalid_parameter_handler _Handler;
  undefined8 *puVar4;
  ulonglong uVar5;
  undefined8 *puVar6;
  short *psVar7;
  HANDLE *ppvVar8;
  void *local_res18;
  undefined1 local_res20 [8];
  HANDLE local_2028;
  undefined1 local_2020 [8192];
  undefined8 uStack_20;
  
  uStack_20 = 0x1400012fe;
  DAT_140607bc8 = timeGetTime();
  FUN_140178e00(local_res20);
  cVar2 = FUN_140004720(local_res20);
  if (cVar2 != '\0') {
    FUN_140004790();
    FUN_1400014f0();
    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_140001710(&DAT_1405e7280,*(short **)(param_2 + 8),~uVar5 - 1);
    }
    puVar4 = (undefined8 *)0x0;
    local_2028 = (HANDLE)0x0;
    memset(local_2020,0,0x2000);
    DVar3 = GetProcessHeaps(0x400,&local_2028);
    if (DVar3 != 0) {
      ppvVar8 = &local_2028;
      uVar5 = (ulonglong)DVar3;
      do {
        local_res18 = (void *)CONCAT44(local_res18._4_4_,2);
        HeapSetInformation(*ppvVar8,HeapCompatibilityInformation,&local_res18,4);
        ppvVar8 = ppvVar8 + 1;
        uVar5 = uVar5 - 1;
      } while (uVar5 != 0);
    }
    _Handler = _set_invalid_parameter_handler(FUN_1400012a0);
    local_res18 = operator_new(0xe8);
    if (local_res18 != (void *)0x0) {
      puVar4 = (undefined8 *)FUN_140005770(local_res18);
    }
    puVar6 = &DAT_1405e7280;
    if (7 < DAT_1405e7298) {
      puVar6 = DAT_1405e7280;
    }
    DAT_140607fd0 = puVar4;
    FUN_140005930(puVar4,puVar6);
    FUN_1400061f0(DAT_140607fd0);
    FUN_140005c10(DAT_140607fd0);
    if (DAT_140607fd0 != (undefined8 *)0x0) {
      (**(code **)*DAT_140607fd0)(DAT_140607fd0,1);
    }
    if (DAT_140607fc8 != (undefined8 *)0x0) {
      (**(code **)*DAT_140607fc8)(DAT_140607fc8,1);
    }
    _set_invalid_parameter_handler(_Handler);
  }
  FUN_1400046f0(local_res20);
  return 0;
}



void FUN_1400014c0(undefined8 param_1,short *param_2)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1,param_2,~uVar2 - 1);
  return;
}



void FUN_1400014f0(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_140607fc8 = puVar1;
    *(undefined2 *)((longlong)puVar1 + 0x454) = 0x17;
    return;
  }
  DAT_140607fc8 = (undefined8 *)0x0;
  return;
}



undefined8 * FUN_1400015a0(undefined8 *param_1,byte param_2)

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



undefined8 *
FUN_1400015e0(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_140001870(param_1,uVar3 + param_3,0xffffffffffffffff);
    FUN_140001870(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_1400019f0(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;
}



undefined8 * FUN_140001710(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_1400015e0(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_1400019f0(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_140001870(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;
}



undefined1 FUN_140001910(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_1400019f0(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;
}



void FUN_1400019f0(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_140001ae0(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;
}



void * FUN_140001ae0(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_1405d3608);
}



void FUN_140001b50(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_140001b80(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;
}



exception * FUN_140001bb0(exception *param_1,exception *param_2)

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



exception * FUN_140001c00(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;
}



undefined8 * FUN_140001c40(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_140001ca0(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_140001ce0(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_140195b20(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_140001d68;
    }
  }
  if (puVar2 == *(undefined8 **)(param_1 + 0x20)) {
    FUN_140195b20(puVar1);
  }
  if (*(undefined8 **)(param_1 + 0x18) != (undefined8 *)0x0) {
    **(undefined8 **)(param_1 + 0x18) = param_2;
  }
LAB_140001d68:
  *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + 8;
  return;
}



void FUN_140001d80(undefined8 param_1)

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



void FUN_140001e70(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_1400026a0((*(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_1400026a0(lVar6,uVar4);
            uVar4 = (ulonglong)((int)uVar4 + 1);
          }
          uVar3 = uVar3 + 1;
        } while ((longlong)uVar3 < (longlong)iVar1);
      }
    }
  }
  return;
}



undefined8 * FUN_140001f50(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_14034fe70();
  param_1[6] = PTR_DAT_1405d8010;
  *(undefined8 *)((longlong)param_1 + 0x3c) = 0;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
    *(undefined1 *)((longlong)param_1 + 0x1c) = 0;
    param_1[5] = 0x4024000000000000;
  }
  return param_1;
}



undefined8 * FUN_140002010(undefined8 *param_1,uint param_2)

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



void FUN_140002070(undefined8 *param_1)

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



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

void FUN_1400020c0(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_1405d84f0 ^ (ulonglong)auStack_b8;
  puVar3 = *(undefined **)(param_1 + 0x30);
  if ((((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
      (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_14035b3f0(&local_68);
    local_5c = DAT_140607db8;
    local_58 = DAT_140607dbc;
    local_54 = DAT_140607dc0;
    local_50 = DAT_140607dc4;
    if (local_68 == (undefined *)0x0) {
      local_68 = PTR_DAT_1405d8010;
    }
    if (*(undefined **)(param_1 + 0x30) != local_68) {
      uVar4 = FUN_14034fe70();
      local_88 = uVar4;
      FUN_14034ed40(uVar4);
      puVar3 = local_68;
      local_80 = 1;
      if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) &&
         (puVar6 = local_68 + -8, puVar6 != (undefined *)0x0)) {
        uVar5 = FUN_14034fe70();
        local_98 = uVar5;
        FUN_14034ed40(uVar5);
        local_90 = 1;
        piVar1 = (int *)(puVar3 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar6);
        }
        FUN_14034edd0(uVar5);
      }
      local_68 = *(undefined **)(param_1 + 0x30);
      if (((local_68 != PTR_DAT_1405d8010) && (local_68 != (undefined *)0x0)) &&
         (local_68 != (undefined *)0x8)) {
        *(int *)(local_68 + -4) = *(int *)(local_68 + -4) + 1;
      }
      FUN_14034edd0(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_1403555d0(local_48);
    puVar3 = local_68;
    if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) &&
       (puVar6 = local_68 + -8, puVar6 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_98 = uVar4;
      FUN_14034ed40(uVar4);
      local_90 = 1;
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar6);
      }
      FUN_14034edd0(uVar4);
    }
  }
  return;
}



void FUN_1400022f0(longlong param_1)

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



undefined8 FUN_140002320(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_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 == 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_140005370(4,L"ERROR >> MagiCommonSession::ProcConnect | Time over!");
      return 0;
    }
  } while( true );
}



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

void FUN_140002440(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_1405d84f0 ^ (ulonglong)auStack_68;
  puVar1 = *(undefined **)(param_1 + 0x30);
  if ((((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1405d8010)) &&
      (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_140002870(param_1,&local_40);
      wprintf(L"%s : RETRY CONNECT : IP[ %s ] PORT[ %d ]\n");
      FUN_1400020c0(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_140002550(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_1405d84f0 ^ (ulonglong)auStack_68;
  puVar1 = *(undefined **)(param_1 + 0x30);
  if (((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1405d8010)) && (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_140002870(dVar3,&local_40);
        wprintf(L"%s : RETRY CONNECT : ADDRESS[ %s ] PORT[ %d ]\n");
        FUN_1400020c0(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_1400026a0(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_1405d84f0 ^ (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_140002870(param_1,&local_50);
  FUN_140002c00(&local_78,&local_50,0,0xffffffffffffffff);
  FUN_140002aa0(&local_78,L" Sessoion",9);
  if (*(char *)(param_1 + 0x18) == '\0') {
    uVar2 = 10;
    pwVar1 = L"[ DisUse ]";
  }
  else {
    uVar2 = 7;
    pwVar1 = L"[ Use ]";
  }
  FUN_140001710(&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_140002870(longlong param_1,undefined8 param_2)

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



undefined8 * FUN_140002aa0(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_140002c00(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_1400019f0(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_140002c00(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_1400019f0(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_140002d30(longlong *param_1,int param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  undefined *puVar4;
  
  puVar4 = PTR_DAT_1405d8010;
  puVar1 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8010;
  }
  *param_1 = (longlong)puVar1;
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  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_14034fef0();
    if (piVar2 != (int *)0x0) {
      *piVar2 = 0;
      piVar2[1] = 1;
    }
    puVar1 = PTR_DAT_1405d8010;
    *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_14034fd20(piVar2 + 2,puVar4,param_2);
    FUN_1400031d0(param_1);
    *param_1 = (longlong)(piVar2 + 2);
  }
  return;
}



void FUN_140002e10(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_1405d8010;
  }
  else if ((puVar6 != PTR_DAT_1405d8010) && ((int *)(puVar6 + -8) != (int *)0x0)) {
    if (*(int *)(puVar6 + -4) < 2) {
      return;
    }
    if (*(int *)(puVar6 + -8) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    puVar3 = (undefined4 *)FUN_14034fef0();
    uVar4 = 0;
    if (puVar3 != (undefined4 *)0x0) {
      *puVar3 = 0;
      puVar3[1] = 1;
    }
    puVar1 = PTR_DAT_1405d8010;
    puVar6 = (undefined *)*param_1;
    if (puVar6 == (undefined *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = uVar4;
      if (puVar6 != PTR_DAT_1405d8010) {
        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_14034fd20(puVar3 + 2,puVar6,uVar4);
    FUN_1400031d0(param_1);
    *param_1 = (longlong)(puVar3 + 2);
    return;
  }
  puVar2 = (undefined8 *)FUN_14034fef0();
  *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_140002f00(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_1405d8010)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (((param_2 <= iVar3) && (param_2 = 0, puVar2 != (undefined *)0x0)) &&
     (puVar2 != PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 < iVar3) {
    FUN_140002d30(param_1,iVar3);
  }
  FUN_140002e10(param_1);
  puVar2 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1405d8010;
  }
  return puVar2;
}



void FUN_140002f80(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_1405d8010)) {
    iVar2 = *(int *)(puVar1 + -8);
  }
  if ((iVar2 <= iVar3) && (iVar3 = 0, puVar1 != (undefined *)0x0)) {
    if (puVar1 == PTR_DAT_1405d8010) {
      return;
    }
    iVar3 = *(int *)(puVar1 + -8);
  }
  if (((puVar1 != PTR_DAT_1405d8010) && (puVar1 != (undefined *)0x0)) &&
     ((int *)(puVar1 + -8) != (int *)0x0)) {
    *(int *)(puVar1 + -8) = iVar3;
    *(undefined2 *)(puVar1 + (longlong)iVar3 * 2) = 0;
  }
  return;
}



void FUN_140002fe0(longlong *param_1)

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



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

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8010;
  iVar2 = FUN_14034fcf0(param_2);
  iVar1 = iVar2;
  if ((0 < param_3) && (iVar1 = param_3, iVar2 < param_3)) {
    iVar1 = iVar2;
  }
  uVar3 = FUN_140002f00(param_1,iVar1);
  FUN_14034fd20(uVar3,param_2,iVar1);
  FUN_140002fe0(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_1405d8010;
  }
  *param_1 = (longlong)puVar1;
  if ((undefined *)*param_2 != puVar1) {
    uVar2 = FUN_14034fe70();
    FUN_14034ed40(uVar2);
    FUN_1400031d0(param_1);
    puVar1 = (undefined *)*param_2;
    *param_1 = (longlong)puVar1;
    if (((puVar1 != PTR_DAT_1405d8010) && (puVar1 != (undefined *)0x0)) &&
       (puVar1 != (undefined *)0x8)) {
      *(int *)(puVar1 + -4) = *(int *)(puVar1 + -4) + 1;
    }
    FUN_14034edd0(uVar2);
  }
  return;
}



void FUN_1400031a0(undefined8 *param_1)

{
  if (*(char *)(param_1 + 1) != '\0') {
    FUN_14034edd0(*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_1405d8010)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1405d8010;
  }
  else {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar3);
    *param_1 = (longlong)PTR_DAT_1405d8010;
  }
  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_1405d8010)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1405d8010;
  }
  else {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar3);
    *param_1 = (longlong)PTR_DAT_1405d8010;
  }
  return;
}



undefined8 * FUN_140003270(undefined8 *param_1)

{
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8010;
  return param_1;
}



void FUN_1400032a0(undefined8 *param_1)

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



void * FUN_1400032b0(void *param_1,uint param_2)

{
  FUN_14035b3e0();
  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_14035b3e0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void * FUN_140003320(void *param_1,uint param_2)

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



void FUN_140003350(undefined8 *param_1)

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



void FUN_140003370(void)

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



undefined8 * FUN_140003380(undefined8 *param_1,byte param_2)

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



undefined8 * FUN_1400033c0(undefined8 *param_1,uint param_2)

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



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,0x20,param_2,param_3,(va_list)&local_res20);
  return;
}



void FUN_140003460(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_140003490(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_1400034c0(longlong param_1)

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



void FUN_1400034d0(undefined8 *param_1)

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



void FUN_1400034f0(undefined8 *param_1)

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



undefined8 * FUN_140003530(undefined8 *param_1,uint param_2)

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



undefined1 *
FUN_140003590(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_140003e50(param_1 + 0x200,&DAT_140476668,3,param_4,0xfffffffffffffffe);
  *(undefined4 *)(param_1 + 0x228) = 1000;
  return param_1;
}



void FUN_140003700(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_140003960(longlong param_1,longlong param_2)

{
  FUN_140003d90(param_1,param_2,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0x50,param_2 + 0x50,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0x78,param_2 + 0x78,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0xa0,param_2 + 0xa0,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 200,param_2 + 200,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0xf0,param_2 + 0xf0,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0x118,param_2 + 0x118,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0x140,param_2 + 0x140,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x168) = *(undefined4 *)(param_2 + 0x168);
  FUN_140003d90(param_1 + 0x170,param_2 + 0x170,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0x198,param_2 + 0x198,0,0xffffffffffffffff);
  FUN_140003d90(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_140003d90(param_1 + 0x200,param_2 + 0x200,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x228) = *(undefined4 *)(param_2 + 0x228);
  return param_1;
}



void FUN_140003bb0(longlong *param_1)

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



void FUN_140003c10(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_140003cd0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140004340(param_1[1],((longlong)(param_2 - uVar2) / 0x230) * 0x230 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140003cd0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140004340(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x230;
  return;
}



void FUN_140003cd0(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_140003f20(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140003f20(param_1,uVar2);
  }
  return;
}



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

{
  code *pcVar1;
  char cVar2;
  undefined8 *puVar3;
  ulonglong _Size;
  
  if (param_3 <= (ulonglong)param_2[2]) {
    _Size = param_2[2] - param_3;
    if (param_4 < _Size) {
      _Size = param_4;
    }
    if (param_1 == param_2) {
      FUN_140004090(param_1,_Size + param_3,0xffffffffffffffff);
      FUN_140004090(param_1,0,param_3);
    }
    else {
      cVar2 = FUN_140004130(param_1,_Size);
      if (cVar2 != '\0') {
        if (0xf < (ulonglong)param_2[3]) {
          param_2 = (undefined8 *)*param_2;
        }
        puVar3 = param_1;
        if (0xf < (ulonglong)param_1[3]) {
          puVar3 = (undefined8 *)*param_1;
        }
        memcpy(puVar3,(void *)((longlong)param_2 + param_3),_Size);
        param_1[2] = _Size;
        puVar3 = param_1;
        if (0xf < (ulonglong)param_1[3]) {
          puVar3 = (undefined8 *)*param_1;
        }
        *(undefined1 *)((longlong)puVar3 + _Size) = 0;
      }
    }
    return param_1;
  }
  std::_Xout_of_range("invalid string position");
  pcVar1 = (code *)swi(3);
  puVar3 = (undefined8 *)(*pcVar1)();
  return puVar3;
}



undefined8 * FUN_140003e50(undefined8 *param_1,undefined8 *param_2,size_t param_3)

{
  ulonglong uVar1;
  char cVar2;
  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_140003d90(param_1,param_1,(longlong)param_2 - (longlong)puVar3,param_3);
        return puVar3;
      }
    }
  }
  cVar2 = FUN_140004130(param_1,param_3);
  if (cVar2 != '\0') {
    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_140003f20(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_1405d3608);
    }
    pcVar3 = local_res10;
    FUN_140004690(*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_140003700(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_140004090(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_140004130(undefined8 *param_1,ulonglong param_2)

{
  code *pcVar1;
  undefined1 uVar2;
  
  if (param_2 == 0xffffffffffffffff) {
    std::_Xlength_error("string too long");
    pcVar1 = (code *)swi(3);
    uVar2 = (*pcVar1)();
    return uVar2;
  }
  if ((ulonglong)param_1[3] < param_2) {
    FUN_1400041a0(param_1,param_2,param_1[2]);
    return param_2 != 0;
  }
  if (param_2 == 0) {
    param_1[2] = 0;
    if (0xf < (ulonglong)param_1[3]) {
      param_1 = (undefined8 *)*param_1;
    }
    *(undefined1 *)param_1 = 0;
  }
  return param_2 != 0;
}



void FUN_1400041a0(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_1405d3608);
  }
  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_1400042e0(__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_1405d3608);
  }
  return pvVar1;
}



undefined1 * FUN_140004340(undefined1 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0x18) = 0xf;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *param_1 = 0;
  FUN_140003d90(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x40) = 0xf;
  *(undefined8 *)(param_1 + 0x38) = 0;
  param_1[0x28] = 0;
  FUN_140003d90(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x68) = 0xf;
  *(undefined8 *)(param_1 + 0x60) = 0;
  param_1[0x50] = 0;
  FUN_140003d90(param_1 + 0x50,param_2 + 0x50,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x90) = 0xf;
  *(undefined8 *)(param_1 + 0x88) = 0;
  param_1[0x78] = 0;
  FUN_140003d90(param_1 + 0x78,param_2 + 0x78,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0xb8) = 0xf;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  param_1[0xa0] = 0;
  FUN_140003d90(param_1 + 0xa0,param_2 + 0xa0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0xe0) = 0xf;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  param_1[200] = 0;
  FUN_140003d90(param_1 + 200,param_2 + 200,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x108) = 0xf;
  *(undefined8 *)(param_1 + 0x100) = 0;
  param_1[0xf0] = 0;
  FUN_140003d90(param_1 + 0xf0,param_2 + 0xf0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x130) = 0xf;
  *(undefined8 *)(param_1 + 0x128) = 0;
  param_1[0x118] = 0;
  FUN_140003d90(param_1 + 0x118,param_2 + 0x118,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x158) = 0xf;
  *(undefined8 *)(param_1 + 0x150) = 0;
  param_1[0x140] = 0;
  FUN_140003d90(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_140003d90(param_1 + 0x170,param_2 + 0x170,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1b0) = 0xf;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  param_1[0x198] = 0;
  FUN_140003d90(param_1 + 0x198,param_2 + 0x198,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1d8) = 0xf;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  param_1[0x1c0] = 0;
  FUN_140003d90(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_140003d90(param_1 + 0x200,param_2 + 0x200,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x228) = *(undefined4 *)(param_2 + 0x228);
  return param_1;
}



undefined1 * FUN_140004650(undefined1 *param_1,undefined8 param_2)

{
  *(undefined8 *)(param_1 + 0x18) = 0xf;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *param_1 = 0;
  FUN_140003d90(param_1,param_2,0,0xffffffffffffffff);
  return param_1;
}



longlong FUN_140004690(longlong param_1,longlong param_2,longlong param_3)

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



void FUN_1400046f0(undefined8 *param_1)

{
  ReleaseMutex((HANDLE)*param_1);
                    // WARNING: Could not recover jumptable at 0x00014000470a. Too many branches
                    // WARNING: Treating indirect jump as call
  CloseHandle((HANDLE)*param_1);
  return;
}



undefined4 FUN_140004720(undefined8 *param_1)

{
  DWORD DVar1;
  HANDLE pvVar2;
  wchar_t *_Format;
  
  pvVar2 = CreateMutexW((LPSECURITY_ATTRIBUTES)0x0,1,L"Global\\RustyHearts_Auction");
  *param_1 = pvVar2;
  DVar1 = GetLastError();
  if (DVar1 == 5) {
    _Format = L"ERROR_ACCESS_DENIED!!! %s \n";
  }
  else {
    if (DVar1 != 0xb7) {
      return 1;
    }
    _Format = L"ERROR_ALREADY_EXISTS!!! %s \n";
  }
  wprintf(_Format);
  Sleep(3000);
  return 0;
}



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

void FUN_140004790(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_1405d84f0 ^ (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_140003460(local_228,0x104,L"%s\\Dump_%d-%d-%d",local_228);
  BT_InstallSehFilter();
  BT_SetAppVersion(&DAT_140476fac);
  BT_SetAppName(L"AUCTION_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_1400048b0(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_1405d84f0 ^ (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_140003460(&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_140003430(&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_140004a80(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_1405d84f0 ^ (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_140003490(&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_140005740(&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_140004c00(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_1405d84f0 ^ (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_140003460(&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_140003430(&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,0x000140004e20)

undefined8 FUN_140004da0(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_1405d84f0 ^ (ulonglong)auStack_268;
  if ((param_1 != 0) && (param_2 != 0)) {
    local_228 = L'\0';
    memset(local_226,0,0x206);
    local_248 = param_1;
    FUN_140003460(&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,0x000140004f36)

undefined8 FUN_140004ec0(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_1405d84f0 ^ (ulonglong)auStack_168;
  if ((param_1 != 0) && (param_2 != 0)) {
    local_128 = '\0';
    memset(local_127,0,0x103);
    local_148 = param_1;
    FUN_140003490(&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_140004fd0(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 0x000140005021. 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_140005030(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_1405d84f0 ^ (ulonglong)auStack_58;
  if (param_2 == 0) {
    uVar2 = 0;
  }
  else {
    local_38 = (HANDLE)0xffffffffffffffff;
    iVar1 = FUN_140004fd0(&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_1400050f0(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_1405d84f0 ^ (ulonglong)auStack_648;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  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_1400048b0(&local_628,&local_228,&local_428,1);
  if (iVar1 != 0) {
    FUN_140004da0(&local_228,&local_628);
    OutputDebugStringW(&local_628);
    wprintf(L"%s");
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  }
  else {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  }
  return iVar1 != 0;
}



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

bool FUN_140005230(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_1405d84f0 ^ (ulonglong)auStack_648;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  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_1400048b0(&local_628,&local_228,&local_428,0);
  if (iVar1 != 0) {
    FUN_140004da0(&local_228,&local_628);
    OutputDebugStringW(&local_628);
    wprintf(L"%s");
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  }
  else {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  }
  return iVar1 != 0;
}



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

bool FUN_140005370(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_1405d84f0 ^ (ulonglong)auStack_658;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  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_1400048b0(&local_638,&local_238,&local_438,1);
  if (iVar1 != 0) {
    FUN_140004da0(&local_238,&local_638);
    OutputDebugStringW(&local_638);
    FUN_140005030(param_1,&local_638);
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  }
  else {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  }
  return iVar1 != 0;
}



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

undefined8 FUN_1400054b0(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_1405d84f0 ^ (ulonglong)auStack_348;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  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_140004a80(&local_328,&local_128,&local_228);
  if (iVar1 == 0) {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
    return 0;
  }
  FUN_140004ec0(&local_128,&local_328);
  OutputDebugStringA(&local_328);
  printf("%s");
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  return 1;
}



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

bool FUN_140005600(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_1405d84f0 ^ (ulonglong)auStack_648;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  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_140004c00(&local_628,&local_228,&local_428);
  if (iVar1 != 0) {
    FUN_140004da0(&local_228,&local_628);
    OutputDebugStringW(&local_628);
    wprintf(L"%s");
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  }
  else {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  }
  return iVar1 != 0;
}



void FUN_140005740(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;
}



undefined8 *
FUN_140005770(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 = MagiAuctionServer::vftable;
  param_1[1] = MagiAuctionServer::vftable;
  param_1[9] = 0;
  param_1[0xe] = 0;
  *(undefined4 *)(param_1 + 0xf) = 1;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x10,uVar1,1,param_4,uVar4);
  param_1[0x17] = 0;
  param_1[0x18] = 0;
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  param_1[0x1c] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  pvVar2 = operator_new(0xe8);
  if (pvVar2 != (void *)0x0) {
    uVar3 = FUN_140291c20(pvVar2);
  }
  DAT_140607ff0 = uVar3;
  return param_1;
}



void * FUN_140005850(void *param_1,uint param_2)

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



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

{
  *param_1 = MagiAuctionServer::vftable;
  param_1[1] = MagiAuctionServer::vftable;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  if (DAT_140607ff0 != (undefined8 *)0x0) {
    (**(code **)*DAT_140607ff0)(DAT_140607ff0,1,param_3,param_4,0xfffffffffffffffe);
  }
  FUN_14034edf0(param_1 + 0x10);
  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;
  *param_1 = MBISingleton<>::vftable;
  DAT_140607fd0 = 0;
  return;
}



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

void FUN_140005930(longlong param_1,undefined8 param_2)

{
  WCHAR WVar1;
  longlong lVar2;
  char cVar3;
  void *pvVar4;
  undefined2 *puVar5;
  ulonglong uVar6;
  undefined2 *puVar7;
  WCHAR *pWVar8;
  undefined1 auStack_248 [32];
  undefined2 *local_228;
  undefined8 local_220;
  WCHAR local_218 [256];
  ulonglong local_18;
  
  local_220 = 0xfffffffffffffffe;
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_248;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
  }
  if ((DAT_14060a120 != 200) && (DAT_14060a120 != 100)) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 != 1000) goto LAB_140005a03;
  }
  setlocale(0,"kor");
LAB_140005a03:
  setlocale(0,(char *)0x0);
  printf("Locale is: %s\n");
  FUN_140352f10(0);
  pvVar4 = operator_new(0x30);
  *(void **)(param_1 + 0x48) = pvVar4;
  local_228 = operator_new(0xe8);
  puVar7 = (undefined2 *)0x0;
  puVar5 = puVar7;
  if (local_228 != (undefined2 *)0x0) {
    puVar5 = (undefined2 *)FUN_140418c90(local_228);
  }
  DAT_140607fd8 = puVar5;
  FUN_140418f10(puVar5);
  local_228 = operator_new(8);
  puVar5 = puVar7;
  if (local_228 != (undefined2 *)0x0) {
    puVar5 = (undefined2 *)FUN_14012c9c0(local_228);
  }
  local_228 = (undefined2 *)CONCAT44(local_228._4_4_,2);
  DAT_140608008 = puVar5;
  *(undefined4 *)(param_1 + 0x10) = 2;
  printf("STEP : TABLE_LOAD \n");
  lVar2 = *(longlong *)(param_1 + 0x38);
  if ((lVar2 != 0) && (*(char *)(lVar2 + 0x1a) != '\0')) {
    (**(code **)(*(longlong *)(lVar2 + 0x68) + 0xb0))
              ((longlong *)(lVar2 + 0x68),1,&DAT_1405d85a0,&local_228);
  }
  FUN_140291e90(DAT_140607ff0);
  FUN_140137690();
  local_228 = operator_new(0x98);
  puVar5 = puVar7;
  if (local_228 != (undefined2 *)0x0) {
    puVar5 = (undefined2 *)FUN_140416800(local_228);
  }
  lVar2 = DAT_140608000;
  DAT_140607ff8 = puVar5;
  *(undefined1 *)(DAT_140608000 + 0x1e8) = 10;
  FUN_140124600(lVar2,param_2);
  *(undefined1 *)(DAT_140607ff0 + 0xb8) = 1;
  cVar3 = FUN_1400078d0(*(undefined8 *)(param_1 + 0x48));
  if (cVar3 == '\0') {
    FUN_140005c10(param_1);
  }
  GetCurrentDirectoryW(0x100,local_218);
  if (DAT_140607c18 == (undefined2 *)0x0) {
    puVar5 = operator_new(0x28);
    if (puVar5 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar5 + 0xc) = 7;
      *(undefined8 *)(puVar5 + 8) = 0;
      *puVar5 = 0;
      uVar6 = 0xffffffffffffffff;
      pWVar8 = local_218;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        WVar1 = *pWVar8;
        pWVar8 = pWVar8 + 1;
      } while (WVar1 != L'\0');
      local_228 = puVar5;
      FUN_140001710(puVar5,local_218,~uVar6 - 1);
      puVar7 = puVar5;
    }
  }
  else {
    uVar6 = 0xffffffffffffffff;
    pWVar8 = local_218;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      WVar1 = *pWVar8;
      pWVar8 = pWVar8 + 1;
    } while (WVar1 != L'\0');
    FUN_140001710(DAT_140607c18,local_218,~uVar6 - 1);
    puVar7 = DAT_140607c18;
  }
  DAT_140607c18 = puVar7;
  return;
}



void FUN_140005c10(longlong param_1)

{
  undefined4 *puVar1;
  undefined8 *puVar2;
  
  puVar1 = *(undefined4 **)(param_1 + 0x48);
  operator_delete__(*(void **)(puVar1 + 2));
  *(undefined8 *)(puVar1 + 2) = 0;
  *(undefined8 *)(puVar1 + 4) = 0;
  *puVar1 = 0;
  if (*(void **)(param_1 + 0x48) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x48));
  }
  puVar2 = *(undefined8 **)(param_1 + 0xb8);
  *(undefined8 *)(param_1 + 0x48) = 0;
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
  }
  puVar2 = DAT_140608008;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
  }
  FUN_140418a90(DAT_140607fd8);
  if (DAT_140607fd8 != (undefined8 *)0x0) {
    (**(code **)*DAT_140607fd8)(DAT_140607fd8,1);
  }
  if (DAT_140607ff8 != (undefined8 *)0x0) {
    (**(code **)*DAT_140607ff8)(DAT_140607ff8,1);
  }
  FUN_140123d30();
  return;
}



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

undefined8 FUN_140005cd0(longlong param_1)

{
  undefined1 uVar1;
  longlong lVar2;
  longlong lVar3;
  longlong *plVar4;
  ushort uVar5;
  int iVar6;
  int iVar7;
  longlong *plVar8;
  undefined **ppuVar9;
  undefined1 auStack_e8 [32];
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined4 local_78;
  undefined8 local_68;
  undefined1 local_60;
  undefined7 uStack_5f;
  undefined8 local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_e8;
  iVar6 = _kbhit();
  while (iVar6 != 0) {
    iVar6 = _getch();
    iVar6 = (int)(char)iVar6;
    if (*(int *)(param_1 + 0x78) == 0) {
      iVar7 = toupper(iVar6);
      switch(iVar7) {
      case 0x45:
        DAT_140607bd0 = 1;
        printf("%s\n");
        return 0;
      case 0x46:
        DAT_140607bcc = 1;
        printf("%s\n");
        break;
      default:
        printf("........... Message : Unknown Control Command.\n");
        break;
      case 0x4c:
        *(undefined4 *)(param_1 + 0x78) = 1;
        printf("%s\n");
        break;
      case 0x4d:
        FUN_14012a430(DAT_140607fe0);
        lVar2 = DAT_140607fe0;
        if (*(longlong *)(param_1 + 0x38) != 0) {
          *(undefined1 *)(*(longlong *)(param_1 + 0x38) + 0x18) =
               *(undefined1 *)(DAT_140607fe0 + 0x16);
        }
        lVar3 = *(longlong *)(param_1 + 0x50);
        if (lVar3 != 0) {
          uVar1 = *(undefined1 *)(lVar2 + 8);
          plVar4 = *(longlong **)(lVar3 + 0x10);
          for (plVar8 = *(longlong **)(lVar3 + 8); plVar8 != plVar4; plVar8 = plVar8 + 1) {
            *(undefined1 *)(*plVar8 + 0x18) = uVar1;
          }
        }
        lVar3 = *(longlong *)(param_1 + 0x58);
        if (lVar3 != 0) {
          uVar1 = *(undefined1 *)(lVar2 + 9);
          plVar4 = *(longlong **)(lVar3 + 0x10);
          for (plVar8 = *(longlong **)(lVar3 + 8); plVar8 != plVar4; plVar8 = plVar8 + 1) {
            *(undefined1 *)(*plVar8 + 0x18) = uVar1;
          }
        }
        printf("%s\n");
        break;
      case 0x50:
        lVar2 = *(longlong *)(param_1 + 0x70);
        if (lVar2 != 0) {
          local_88 = 0;
          local_c0 = 0;
          local_c8 = 0;
          local_b0 = 0;
          local_b8 = 0;
          local_90 = 0;
          local_98 = 0;
          local_a0 = 0;
          local_a8 = 0;
          local_80 = 0;
          local_78 = 0;
          if (*(longlong *)(lVar2 + 0x18) != 0) {
            (**(code **)(**(longlong **)(lVar2 + 0x18) + 0xb0))
                      (*(longlong **)(lVar2 + 0x18),&local_c8);
            printf("--------------------------------------------------\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");
            printf("--------------------------------------------------\n");
          }
        }
        printf("%s\n");
        break;
      case 0x52:
        DAT_140607bd4 = (uint)(DAT_140607bd4 == 0);
        printf("%s %s\n");
        break;
      case 0x54:
        DAT_140607be0 = DAT_140607be0 == '\0';
        printf("%s %s\n");
        break;
      case 0x56:
        if ((DAT_14060b7c4 & 1) == 0) {
          DAT_14060b7c4 = DAT_14060b7c4 | 1;
          FUN_140418590();
          atexit((_func_5014 *)&LAB_140448470);
        }
        FUN_140416d30(&DAT_140609ed0);
        printf("%s\n");
      }
    }
    else {
      iVar7 = toupper(iVar6);
      if (iVar7 == 0x55) {
        *(undefined4 *)(param_1 + 0x78) = 0;
        printf("%s\n");
        ppuVar9 = &PTR_s_Server_Shutdown__1405e7198;
        do {
          uVar5 = GetAsyncKeyState(0xa0);
          if (((uVar5 & 0x8001) != 0) || (*(char *)(ppuVar9 + 1) == '\0')) {
            printf(" \'%c\'\t: %s\n");
          }
          ppuVar9 = ppuVar9 + 3;
        } while ((longlong)ppuVar9 < 0x1405e7288);
      }
    }
    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_1404156a0(&local_60);
      printf("PROTOCOL : %s\n");
      if (0xf < local_48) {
        operator_delete((void *)CONCAT71(uStack_5f,local_60));
      }
      local_48 = 0xf;
      local_50 = 0;
      local_60 = 0;
      printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
    }
    iVar6 = _kbhit();
  }
  return 2;
}



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

undefined8 FUN_1400061f0(longlong param_1)

{
  double dVar1;
  double dVar2;
  undefined1 auVar3 [16];
  undefined1 auVar4 [16];
  undefined1 auVar5 [16];
  undefined1 auVar6 [16];
  bool bVar7;
  double dVar8;
  char cVar9;
  undefined4 uVar10;
  DWORD DVar11;
  DWORD DVar12;
  int iVar13;
  longlong *plVar14;
  undefined8 *puVar15;
  longlong *plVar16;
  longlong *plVar17;
  longlong *plVar18;
  longlong *plVar19;
  longlong *plVar20;
  longlong *plVar21;
  void *pvVar22;
  longlong *plVar23;
  longlong lVar24;
  longlong lVar25;
  longlong lVar26;
  longlong lVar27;
  undefined4 uVar28;
  undefined4 uVar29;
  undefined4 uVar30;
  undefined4 uVar31;
  undefined1 auStack_358 [32];
  longlong *local_338;
  longlong *local_330;
  longlong local_328;
  longlong *local_320;
  longlong *local_318;
  longlong *local_310;
  longlong *local_308;
  longlong *local_300;
  longlong *local_2f8;
  undefined4 local_2f0 [2];
  undefined4 local_2e8 [2];
  undefined4 local_2e0 [2];
  longlong local_2d8;
  undefined8 *local_2d0;
  longlong *local_2c8;
  longlong *local_2c0;
  undefined8 *local_2b8;
  longlong *local_2b0;
  undefined8 *local_2a8;
  longlong *local_2a0;
  undefined8 *local_298;
  longlong *local_290;
  longlong *local_288;
  undefined1 local_280;
  longlong *local_278;
  undefined1 local_270;
  undefined8 local_268;
  char *local_260;
  DWORD local_258;
  char *local_250;
  DWORD local_248;
  char *local_240;
  DWORD local_238;
  undefined8 local_228;
  undefined2 local_220;
  undefined6 uStack_21e;
  undefined8 local_210;
  ulonglong local_208;
  undefined2 local_1f8;
  undefined6 uStack_1f6;
  undefined8 local_1e8;
  ulonglong local_1e0;
  undefined8 local_1c8;
  undefined2 local_1c0;
  undefined6 uStack_1be;
  undefined8 local_1b0;
  ulonglong local_1a8;
  undefined2 local_198;
  undefined6 uStack_196;
  undefined8 local_188;
  ulonglong local_180;
  undefined8 local_168;
  undefined2 local_160;
  undefined6 uStack_15e;
  undefined8 local_150;
  ulonglong local_148;
  undefined2 local_138;
  undefined6 uStack_136;
  undefined8 local_128;
  ulonglong local_120;
  undefined8 local_108;
  undefined2 local_100;
  undefined6 uStack_fe;
  undefined8 local_f0;
  ulonglong local_e8;
  undefined2 local_d8;
  undefined6 uStack_d6;
  undefined8 local_c8;
  ulonglong local_c0;
  ulonglong local_a8;
  
  local_268 = 0xfffffffffffffffe;
  local_a8 = DAT_1405d84f0 ^ (ulonglong)auStack_358;
  local_328 = param_1;
  FUN_1400050f0(L"# Auction Server Startup #\n\n");
  CoInitialize((LPVOID)0x0);
  FUN_140005230(L"+ Prepare Startup\n");
  local_338 = operator_new(0xa90);
  plVar23 = (longlong *)0x0;
  plVar14 = plVar23;
  if (local_338 != (longlong *)0x0) {
    plVar14 = (longlong *)FUN_14000a2e0(local_338);
  }
  if (plVar14 == (longlong *)0x0) {
    local_300 = (longlong *)0x0;
  }
  else {
    local_300 = (longlong *)FUN_14034fef0(0x10);
    local_300[1] = 1;
    *local_300 = (longlong)plVar14;
  }
  plVar14 = local_300;
  puVar15 = operator_new(0x28);
  if (puVar15 == (undefined8 *)0x0) {
    local_310 = (longlong *)0x0;
    plVar16 = plVar23;
  }
  else {
    plVar16 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar16 = (longlong *)*plVar14;
    }
    *puVar15 = plVar16;
    puVar15[1] = 0;
    puVar15[2] = 0;
    puVar15[3] = 0;
    plVar16 = (longlong *)FUN_14034fef0(0x48);
    local_338 = plVar16;
    local_330 = plVar16;
    if (plVar16 != (longlong *)0x0) {
      uVar10 = FUN_1403c0cc0();
      FUN_14034ec60(plVar16,uVar10,1);
    }
    local_310 = plVar16;
    FUN_14034ed40(plVar16);
    plVar16[8] = 1;
    plVar16[7] = (longlong)puVar15;
    FUN_14034edd0(plVar16);
  }
  puVar15 = operator_new(0x28);
  if (puVar15 == (undefined8 *)0x0) {
    local_2f8 = (longlong *)0x0;
    plVar17 = plVar23;
  }
  else {
    plVar17 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar17 = (longlong *)*plVar14;
    }
    *puVar15 = plVar17;
    puVar15[1] = 0;
    puVar15[2] = 0;
    puVar15[3] = 0;
    plVar17 = (longlong *)FUN_14034fef0(0x48);
    local_338 = plVar17;
    local_330 = plVar17;
    if (plVar17 != (longlong *)0x0) {
      uVar10 = FUN_1403c0cc0();
      FUN_14034ec60(plVar17,uVar10,1);
    }
    local_2f8 = plVar17;
    FUN_14034ed40(plVar17);
    plVar17[8] = 1;
    plVar17[7] = (longlong)puVar15;
    FUN_14034edd0(plVar17);
  }
  puVar15 = operator_new(0x28);
  if (puVar15 == (undefined8 *)0x0) {
    local_318 = (longlong *)0x0;
    plVar18 = plVar23;
  }
  else {
    plVar18 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar18 = (longlong *)*plVar14;
    }
    *puVar15 = plVar18;
    puVar15[1] = 0;
    puVar15[2] = 0;
    puVar15[3] = 0;
    plVar18 = (longlong *)FUN_14034fef0(0x48);
    local_338 = plVar18;
    local_330 = plVar18;
    if (plVar18 != (longlong *)0x0) {
      uVar10 = FUN_1403c0cc0();
      FUN_14034ec60(plVar18,uVar10,1);
    }
    local_318 = plVar18;
    FUN_14034ed40(plVar18);
    plVar18[8] = 1;
    plVar18[7] = (longlong)puVar15;
    FUN_14034edd0(plVar18);
  }
  puVar15 = operator_new(0x28);
  if (puVar15 == (undefined8 *)0x0) {
    local_308 = (longlong *)0x0;
    plVar19 = plVar23;
  }
  else {
    plVar19 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar19 = (longlong *)*plVar14;
    }
    *puVar15 = plVar19;
    puVar15[1] = 0;
    puVar15[2] = 0;
    puVar15[3] = 0;
    plVar19 = (longlong *)FUN_14034fef0(0x48);
    local_338 = plVar19;
    local_330 = plVar19;
    if (plVar19 != (longlong *)0x0) {
      uVar10 = FUN_1403c0cc0();
      FUN_14034ec60(plVar19,uVar10,1);
    }
    local_308 = plVar19;
    FUN_14034ed40(plVar19);
    plVar19[8] = 1;
    plVar19[7] = (longlong)puVar15;
    FUN_14034edd0(plVar19);
  }
  local_338 = operator_new(0xf0);
  local_320 = plVar23;
  if (local_338 != (void *)0x0) {
    plVar20 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar20 = (longlong *)*plVar14;
    }
    local_320 = (longlong *)FUN_14012af60(local_338,plVar20);
  }
  if (local_320 == (longlong *)0x0) {
    local_2c0 = (longlong *)0x0;
    local_330 = (longlong *)0x0;
    plVar20 = plVar23;
  }
  else {
    plVar20 = (longlong *)FUN_14034fef0(0x48);
    local_338 = plVar20;
    local_2c0 = plVar20;
    if (plVar20 != (longlong *)0x0) {
      local_330 = plVar20;
      uVar10 = FUN_1403c0cc0();
      FUN_14034ec60(plVar20,uVar10,1);
    }
    local_330 = plVar20;
    FUN_14034ed40(plVar20);
    plVar20[8] = 1;
    plVar20[7] = (longlong)local_320;
    FUN_14034edd0(plVar20);
  }
  plVar21 = plVar23;
  if (plVar16 != (longlong *)0x0) {
    plVar21 = (longlong *)plVar16[7];
  }
  local_338 = (longlong *)(local_328 + 0x50);
  *local_338 = (longlong)plVar21;
  plVar21 = plVar23;
  if (plVar17 != (longlong *)0x0) {
    plVar21 = (longlong *)plVar17[7];
  }
  *(longlong **)(local_328 + 0x58) = plVar21;
  plVar21 = plVar23;
  if (plVar18 != (longlong *)0x0) {
    plVar21 = (longlong *)plVar18[7];
  }
  *(longlong **)(local_328 + 0x60) = plVar21;
  plVar21 = plVar23;
  if (plVar19 != (longlong *)0x0) {
    plVar21 = (longlong *)plVar19[7];
  }
  *(longlong **)(local_328 + 0x68) = plVar21;
  plVar21 = plVar23;
  if (plVar20 != (longlong *)0x0) {
    plVar21 = (longlong *)plVar20[7];
  }
  *(longlong **)(local_328 + 0x38) = plVar21;
  plVar21 = plVar23;
  if (plVar14 != (longlong *)0x0) {
    plVar21 = (longlong *)*plVar14;
  }
  *(longlong **)(local_328 + 0x70) = plVar21;
  local_320 = (longlong *)CONCAT44(local_320._4_4_,1);
  local_2d8 = local_328 + 8;
  *(undefined4 *)(local_328 + 0x10) = 1;
  printf("STEP : AGENT \n");
  lVar26 = *(longlong *)(local_2d8 + 0x30);
  if ((lVar26 != 0) && (*(char *)(lVar26 + 0x1a) != '\0')) {
    (**(code **)(*(longlong *)(lVar26 + 0x68) + 0xb0))
              ((longlong *)(lVar26 + 0x68),1,&DAT_1405d85a0,&local_320);
  }
  if ((*(longlong *)(local_328 + 0x38) == 0) || (cVar9 = FUN_14012b4a0(), cVar9 != '\0')) {
    plVar21 = plVar23;
    if (plVar16 != (longlong *)0x0) {
      plVar21 = (longlong *)plVar16[7];
    }
    FUN_14016cfe0(plVar21,*(undefined4 *)(DAT_140608000 + 0x144),0xc);
    plVar16 = plVar23;
    if (plVar17 != (longlong *)0x0) {
      plVar16 = (longlong *)plVar17[7];
    }
    FUN_14016cfe0(plVar16,*(undefined4 *)(DAT_140608000 + 0x148),0x11);
    plVar16 = plVar23;
    if (plVar18 != (longlong *)0x0) {
      plVar16 = (longlong *)plVar18[7];
    }
    FUN_14016cfe0(plVar16,*(undefined4 *)(DAT_140608000 + 0x148),0x12);
    plVar16 = plVar23;
    if (plVar19 != (longlong *)0x0) {
      plVar16 = (longlong *)plVar19[7];
    }
    FUN_14016cfe0(plVar16,*(undefined4 *)(DAT_140608000 + 0x148),0x13);
    lVar26 = local_328;
    plVar16 = local_338;
    plVar17 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar17 = (longlong *)*plVar14;
    }
    plVar17[0x98] = *local_338;
    plVar17 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar17 = (longlong *)*plVar14;
    }
    plVar17[0x99] = *(longlong *)(local_328 + 0x58);
    plVar17 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar17 = (longlong *)*plVar14;
    }
    plVar17[0x9a] = *(longlong *)(local_328 + 0x60);
    plVar17 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar17 = (longlong *)*plVar14;
    }
    plVar17[0x9b] = *(longlong *)(local_328 + 0x68);
    local_2e8[0] = 3;
    *(undefined4 *)(local_328 + 0x10) = 3;
    printf("STEP : DB_LOAD \n");
    lVar27 = *(longlong *)(lVar26 + 0x38);
    if ((lVar27 != 0) && (*(char *)(lVar27 + 0x1a) != '\0')) {
      (**(code **)(*(longlong *)(lVar27 + 0x68) + 0xb0))
                ((longlong *)(lVar27 + 0x68),1,&DAT_1405d85a0,local_2e8);
    }
    lVar25 = 4;
    local_2e0[0] = 4;
    *(undefined4 *)(lVar26 + 0x10) = 4;
    printf("STEP : SESSION_CONNECT \n");
    lVar27 = *(longlong *)(lVar26 + 0x38);
    if ((lVar27 != 0) && (*(char *)(lVar27 + 0x1a) != '\0')) {
      (**(code **)(*(longlong *)(lVar27 + 0x68) + 0xb0))
                ((longlong *)(lVar27 + 0x68),1,&DAT_1405d85a0,local_2e0);
    }
    local_228 = 0;
    local_208 = 7;
    local_210 = 0;
    local_220 = 0;
    local_1e0 = 7;
    local_1e8 = 0;
    local_1f8 = 0;
    if (*(longlong *)(DAT_140608000 + 0x1c8) != 0) {
      auVar3._8_8_ = 0;
      auVar3._0_8_ = *(ulonglong *)(DAT_140608000 + 0x1b0);
      local_2a8 = (undefined8 *)
                  (*(longlong *)(DAT_140608000 + 0x1a8) +
                  SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xc)) % auVar3,0) * 8);
      for (local_2a0 = (longlong *)*local_2a8; local_2a0 != (longlong *)0x0;
          local_2a0 = (longlong *)*local_2a0) {
        if ((char)local_2a0[1] == '\f') {
          if (local_2a0 != (longlong *)0x0) goto LAB_140006937;
          break;
        }
      }
    }
    local_2a8 = (undefined8 *)0x0;
    local_2a0 = plVar23;
LAB_140006937:
    if ((local_2a0 != (longlong *)0x0) &&
       (puVar15 = (undefined8 *)local_2a0[2], puVar15 != (undefined8 *)local_2a0[3])) {
      local_228 = *puVar15;
      FUN_1400015e0(&local_220,puVar15 + 1,0,0xffffffffffffffff);
      FUN_1400015e0(&local_1f8,puVar15 + 6,0,0xffffffffffffffff);
      FUN_14016d840(*plVar16);
      FUN_14016d5c0(*plVar16);
    }
    if (7 < local_1e0) {
      operator_delete((void *)CONCAT62(uStack_1f6,local_1f8));
    }
    local_1e0 = 7;
    local_1e8 = 0;
    local_1f8 = 0;
    if (7 < local_208) {
      operator_delete((void *)CONCAT62(uStack_21e,local_220));
    }
    local_208 = 7;
    local_210 = 0;
    local_220 = 0;
    local_168 = 0;
    local_148 = 7;
    local_150 = 0;
    local_160 = 0;
    local_120 = 7;
    local_128 = 0;
    local_138 = 0;
    if (*(longlong *)(DAT_140608000 + 0x1c8) != 0) {
      auVar4._8_8_ = 0;
      auVar4._0_8_ = *(ulonglong *)(DAT_140608000 + 0x1b0);
      local_2d0 = (undefined8 *)
                  (*(longlong *)(DAT_140608000 + 0x1a8) +
                  SUB168((ZEXT816(0) << 0x40 | ZEXT816(0x11)) % auVar4,0) * 8);
      for (local_2c8 = (longlong *)*local_2d0; local_2c8 != (longlong *)0x0;
          local_2c8 = (longlong *)*local_2c8) {
        if ((char)local_2c8[1] == '\x11') {
          if (local_2c8 != (longlong *)0x0) goto LAB_140006a69;
          break;
        }
      }
    }
    local_2d0 = (undefined8 *)0x0;
    local_2c8 = plVar23;
LAB_140006a69:
    if ((local_2c8 != (longlong *)0x0) &&
       (puVar15 = (undefined8 *)local_2c8[2], puVar15 != (undefined8 *)local_2c8[3])) {
      local_168 = *puVar15;
      FUN_1400015e0(&local_160,puVar15 + 1,0,0xffffffffffffffff);
      FUN_1400015e0(&local_138,puVar15 + 6,0,0xffffffffffffffff);
      FUN_14016d840(*(undefined8 *)(lVar26 + 0x58));
      FUN_14016d5c0(*(undefined8 *)(lVar26 + 0x58));
    }
    if (7 < local_120) {
      operator_delete((void *)CONCAT62(uStack_136,local_138));
    }
    local_120 = 7;
    local_128 = 0;
    local_138 = 0;
    if (7 < local_148) {
      operator_delete((void *)CONCAT62(uStack_15e,local_160));
    }
    local_148 = 7;
    local_150 = 0;
    local_160 = 0;
    local_1c8 = 0;
    local_1a8 = 7;
    local_1b0 = 0;
    local_1c0 = 0;
    local_180 = 7;
    local_188 = 0;
    local_198 = 0;
    if (*(longlong *)(DAT_140608000 + 0x1c8) != 0) {
      auVar5._8_8_ = 0;
      auVar5._0_8_ = *(ulonglong *)(DAT_140608000 + 0x1b0);
      local_2b8 = (undefined8 *)
                  (*(longlong *)(DAT_140608000 + 0x1a8) +
                  SUB168((ZEXT816(0) << 0x40 | ZEXT816(0x12)) % auVar5,0) * 8);
      for (local_2b0 = (longlong *)*local_2b8; local_2b0 != (longlong *)0x0;
          local_2b0 = (longlong *)*local_2b0) {
        if ((char)local_2b0[1] == '\x12') {
          if (local_2b0 != (longlong *)0x0) goto LAB_140006bca;
          break;
        }
      }
    }
    local_2b8 = (undefined8 *)0x0;
    local_2b0 = plVar23;
LAB_140006bca:
    if ((local_2b0 != (longlong *)0x0) &&
       (puVar15 = (undefined8 *)local_2b0[2], puVar15 != (undefined8 *)local_2b0[3])) {
      local_1c8 = *puVar15;
      FUN_1400015e0(&local_1c0,puVar15 + 1,0,0xffffffffffffffff);
      FUN_1400015e0(&local_198,puVar15 + 6,0,0xffffffffffffffff);
      FUN_14016d840(*(undefined8 *)(lVar26 + 0x60));
      FUN_14016d360(*(undefined8 *)(lVar26 + 0x60));
    }
    if (7 < local_180) {
      operator_delete((void *)CONCAT62(uStack_196,local_198));
    }
    local_180 = 7;
    local_188 = 0;
    local_198 = 0;
    if (7 < local_1a8) {
      operator_delete((void *)CONCAT62(uStack_1be,local_1c0));
    }
    local_1a8 = 7;
    local_1b0 = 0;
    local_1c0 = 0;
    local_108 = 0;
    local_e8 = 7;
    local_f0 = 0;
    local_100 = 0;
    local_c0 = 7;
    local_c8 = 0;
    local_d8 = 0;
    if (*(longlong *)(DAT_140608000 + 0x1c8) != 0) {
      auVar6._8_8_ = 0;
      auVar6._0_8_ = *(ulonglong *)(DAT_140608000 + 0x1b0);
      local_298 = (undefined8 *)
                  (*(longlong *)(DAT_140608000 + 0x1a8) +
                  SUB168((ZEXT816(0) << 0x40 | ZEXT816(0x13)) % auVar6,0) * 8);
      for (local_290 = (longlong *)*local_298; local_290 != (longlong *)0x0;
          local_290 = (longlong *)*local_290) {
        if ((char)local_290[1] == '\x13') {
          if (local_290 != (longlong *)0x0) goto LAB_140006d32;
          break;
        }
      }
    }
    local_298 = (undefined8 *)0x0;
    local_290 = plVar23;
LAB_140006d32:
    if ((local_290 != (longlong *)0x0) &&
       (puVar15 = (undefined8 *)local_290[2], puVar15 != (undefined8 *)local_290[3])) {
      local_108 = *puVar15;
      FUN_1400015e0(&local_100,puVar15 + 1,0,0xffffffffffffffff);
      FUN_1400015e0(&local_d8,puVar15 + 6,0,0xffffffffffffffff);
      FUN_14016d840(*(undefined8 *)(lVar26 + 0x68),&local_108);
      FUN_14016d360(*(undefined8 *)(lVar26 + 0x68));
    }
    if (7 < local_c0) {
      operator_delete((void *)CONCAT62(uStack_d6,local_d8));
    }
    local_c0 = 7;
    local_c8 = 0;
    local_d8 = 0;
    if (7 < local_e8) {
      operator_delete((void *)CONCAT62(uStack_fe,local_100));
    }
    local_e8 = 7;
    local_f0 = 0;
    local_100 = 0;
    plVar17 = plVar23;
    if (plVar14 != (longlong *)0x0) {
      plVar17 = (longlong *)*plVar14;
    }
    FUN_14000a770(plVar17);
    if (*plVar16 != 0) {
      plVar16 = (longlong *)(**(longlong **)(*plVar16 + 8) + 0x70);
      (**(code **)(*plVar16 + 0x660))(plVar16,1,&DAT_1405d85a0);
    }
    FUN_1400050f0(&DAT_1404765b0);
    FUN_1400050f0(L"# Auction Server Running... #\n");
    pvVar22 = operator_new(0x18);
    plVar16 = plVar23;
    if (pvVar22 != (void *)0x0) {
      plVar16 = (longlong *)FUN_1404162b0(pvVar22);
    }
    plVar17 = DAT_140607ff8;
    puVar15 = (undefined8 *)DAT_140607ff8[2];
    if (puVar15 != (undefined8 *)0x0) {
      (**(code **)*puVar15)(puVar15,1);
    }
    plVar17[2] = (longlong)plVar16;
    if (plVar16 != (longlong *)0x0) {
      lVar27 = (**(code **)(*plVar16 + 8))(plVar16);
      plVar17[6] = lVar27;
      plVar17[7] = lVar27;
    }
    plVar17[0x12] = 0x3ff0000000000000;
    plVar16 = operator_new(0x28);
    local_338 = plVar16;
    if (plVar16 != (longlong *)0x0) {
      *plVar16 = (longlong)Magi::Timer::vftable;
      plVar23 = DAT_140607ff8;
      plVar16[1] = (longlong)DAT_140607ff8;
      plVar16[2] = 0;
      plVar16[3] = 0;
      *(undefined1 *)(plVar16 + 4) = 0;
      *(undefined4 *)((longlong)plVar16 + 0x24) = 0x3f800000;
      (**(code **)(*plVar23 + 0x10))(plVar23,plVar16);
      plVar23 = plVar16;
    }
    *(longlong **)(lVar26 + 0xb8) = plVar23;
    uVar10 = 0;
    uVar28 = 0;
    plVar23 = (longlong *)(lVar26 + 0x50);
    do {
      lVar26 = local_2d8;
      lVar27 = 0;
      lVar24 = (longlong)DAT_140607c2c;
      if (0 < lVar24) {
        do {
          FUN_140001ce0(lVar26,*(undefined8 *)(*(longlong *)(*plVar23 + 8) + lVar27 * 8));
          lVar27 = lVar27 + 1;
        } while (lVar27 < lVar24);
      }
      lVar27 = local_328;
      lVar26 = 0;
      plVar23 = plVar23 + 1;
      lVar25 = lVar25 + -1;
    } while (lVar25 != 0);
    FUN_140001ce0(local_328 + 8,*(undefined8 *)(local_328 + 0x38));
    local_2f0[0] = 5;
    *(undefined4 *)(lVar27 + 0x10) = 5;
    if (DAT_140607bc8 != 0) {
      printf("********************************\n");
      timeGetTime();
      printf("** Server Load Time : %u sec\n");
      printf("********************************\n");
    }
    printf("STEP : SERVER_RUN \n");
    lVar25 = *(longlong *)(lVar27 + 0x38);
    uVar29 = uVar10;
    uVar31 = uVar28;
    dVar1 = DAT_1405dfc60;
    if ((lVar25 != 0) && (*(char *)(lVar25 + 0x1a) != '\0')) {
      (**(code **)(*(longlong *)(lVar25 + 0x68) + 0xb0))
                ((longlong *)(lVar25 + 0x68),1,&DAT_1405d85a0,local_2f0);
      dVar1 = DAT_1405dfc60;
    }
    while ((dVar8 = DAT_1405dfc60, DAT_1405dfc60 = dVar1, DAT_140607bd0 == 0 &&
           (plVar20 = local_2c0, *(char *)(*(longlong *)(lVar27 + 0x70) + 8) == '\0'))) {
      if (*(char *)(*(longlong *)(lVar27 + 0x70) + 0xc) != '\0') {
        printf("Lock(Main) - Succeed\n");
        lVar25 = *(longlong *)(lVar27 + 0x38);
        if (lVar25 != 0) {
          printf("Server Lock Check Succeed !!!\n");
          plVar23 = (longlong *)(lVar25 + 0x68);
          (**(code **)(*plVar23 + 0x70))(plVar23,1,&DAT_1405d85a0);
        }
        *(undefined1 *)(*(longlong *)(lVar27 + 0x70) + 0xc) = 0;
      }
      FUN_1404165f0(DAT_140607ff8);
      dVar1 = *(double *)(*(longlong *)(lVar27 + 0xb8) + 0x10);
      dVar2 = *(double *)(lVar27 + 0xd8);
      local_250 = "AgentSession->Process";
      DVar11 = timeGetTime();
      local_248 = DVar11;
      if ((*(longlong *)(lVar27 + 0x38) != 0) && (*(char *)(DAT_140608000 + 0x150) != '\0')) {
        FUN_140002550(*(longlong *)(lVar27 + 0x38),dVar1);
        if ((*(longlong *)(lVar27 + 0x38) != 0) &&
           ((*(char *)(*(longlong *)(lVar27 + 0x38) + 0x1a) != '\0' &&
            (*(double *)(lVar27 + 0x40) + 1.0 <= dVar1)))) {
          *(double *)(lVar27 + 0x40) = dVar1;
          if (plVar14 == (longlong *)0x0) {
            lVar25 = 0;
          }
          else {
            lVar25 = *plVar14;
          }
          FUN_14012b7b0(*(undefined8 *)(lVar27 + 0x38),
                        *(undefined4 *)(*(longlong *)(lVar27 + 0x70) + 0xa4c),
                        *(undefined4 *)(lVar25 + 0xa50));
        }
      }
      DVar12 = timeGetTime();
      if (0x32 < DVar12 - DVar11) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar12 - DVar11,"AgentSession->Process");
      }
      local_260 = "DBCSessionManager->Process";
      DVar11 = timeGetTime();
      local_258 = DVar11;
      FUN_14016d1b0(*(undefined8 *)(lVar27 + 0x50),dVar1);
      DVar12 = timeGetTime();
      if (0x32 < DVar12 - DVar11) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar12 - DVar11,"DBCSessionManager->Process")
        ;
      }
      local_240 = "DBCLogSessionManager->Process";
      DVar11 = timeGetTime();
      local_238 = DVar11;
      FUN_14016d1b0(*(undefined8 *)(lVar27 + 0x58),dVar1);
      DVar12 = timeGetTime();
      if (0x32 < DVar12 - DVar11) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar12 - DVar11,
                      "DBCLogSessionManager->Process");
      }
      if (DAT_140607be0 != '\0') {
        printf("RetryConnectSession\n");
        iVar13 = (int)(*(longlong *)(lVar27 + 0x20) - *(longlong *)(lVar27 + 0x18) >> 3);
        lVar25 = lVar26;
        if (0 < iVar13) {
          do {
            if (*(longlong *)(*(longlong *)(lVar27 + 0x18) + lVar25 * 8) != 0) {
              *(undefined1 *)(*(longlong *)(*(longlong *)(lVar27 + 0x18) + lVar25 * 8) + 0x1c) = 1;
            }
            lVar25 = lVar25 + 1;
          } while (lVar25 < iVar13);
        }
        DAT_140607be0 = DAT_140607be0 == '\0';
      }
      uVar30 = (undefined4)((ulonglong)dVar1 >> 0x20);
      if (dVar8 <= dVar1 - (double)CONCAT44(uVar31,uVar29)) {
        DAT_140607bd8 = DAT_140607bd8 + 1;
        FUN_140005cd0(lVar27);
        (**(code **)(**(longlong **)(lVar27 + 0x70) + 0x388))
                  (*(longlong **)(lVar27 + 0x70),dVar1,dVar1 - dVar2);
        uVar29 = SUB84(dVar1,0);
        uVar31 = uVar30;
      }
      if (*(double *)(lVar27 + 0xe0) + 90.0 < dVar1) {
        *(double *)(lVar27 + 0xe0) = dVar1;
        FUN_14034ed40(lVar27 + 0x80);
        FUN_1400084d0(*(undefined8 *)(DAT_140607fd0 + 0x48));
        FUN_14034edd0(lVar27 + 0x80);
      }
      if (1.0 <= dVar1 - (double)CONCAT44(uVar28,uVar10)) {
        if (DAT_140607bd4 != 0) {
          printf("FPS : [%d], Connect[%d]\n");
        }
        DAT_140607bdc = DAT_140607bd8;
        DAT_140607bd8 = 0;
        uVar10 = SUB84(dVar1,0);
        uVar28 = uVar30;
      }
      if (DAT_140607bcc != 0) {
        DAT_140607bcc = 0;
        wprintf(L"-AUCTION SERVER [CODE:%d]----------------------------------------------------\n");
        if (plVar14 == (longlong *)0x0) {
          lVar25 = 0;
        }
        else {
          lVar25 = *plVar14;
        }
        wprintf(L"PRIVATE NETWORK : ADDRESS[ %s ] PORT[ %d ]\n");
        if ((0 < *(int *)(lVar25 + 0x2c)) && (*(int *)(lVar25 + 0x30) != 0)) {
          wprintf(L"UDP : PORT [ %d ] COUNT [ %d ]\n");
        }
        FUN_140001d80(lVar27 + 8);
      }
      *(double *)(lVar27 + 0xd8) = dVar1;
      Sleep(1);
      plVar20 = local_2c0;
      dVar1 = DAT_1405dfc60;
      DAT_1405dfc60 = dVar8;
    }
    FUN_140005230(L"+ Prepare Stop\n");
    if (plVar14 == (longlong *)0x0) {
      lVar27 = 0;
    }
    else {
      lVar27 = *plVar14;
    }
    FUN_14000a890(lVar27);
    if (plVar14 == (longlong *)0x0) {
      lVar27 = 0;
    }
    else {
      lVar27 = *plVar14;
    }
    *(undefined8 *)(lVar27 + 0x4c0) = 0;
    if (plVar14 == (longlong *)0x0) {
      lVar27 = 0;
    }
    else {
      lVar27 = *plVar14;
    }
    *(undefined8 *)(lVar27 + 0x4c8) = 0;
    if (plVar14 == (longlong *)0x0) {
      lVar27 = 0;
    }
    else {
      lVar27 = *plVar14;
    }
    *(undefined8 *)(lVar27 + 0x4d0) = 0;
    if (plVar14 == (longlong *)0x0) {
      lVar27 = 0;
    }
    else {
      lVar27 = *plVar14;
    }
    *(undefined8 *)(lVar27 + 0x4d8) = 0;
    CoUninitialize();
    FUN_1400050f0(L"# Auction Server Stoped... #\n");
    if (plVar14 != (longlong *)0x0) {
      lVar26 = *plVar14;
    }
    if (*(char *)(lVar26 + 8) == '\0') {
      FUN_140005230(L"Press any key... \n");
      getchar();
    }
    if (plVar20 != (longlong *)0x0) {
      local_288 = plVar20;
      FUN_14034ed40(plVar20);
      bVar7 = true;
      local_280 = 1;
      plVar23 = plVar20 + 8;
      *plVar23 = *plVar23 + -1;
      if (*plVar23 == 0) {
        FUN_14034edd0(plVar20);
        bVar7 = false;
        local_280 = 0;
        puVar15 = (undefined8 *)plVar20[7];
        local_338 = plVar20;
        if (puVar15 != (undefined8 *)0x0) {
          (**(code **)*puVar15)(puVar15,1);
        }
        FUN_14034edf0(plVar20);
        FUN_14034ff60(plVar20);
      }
      if (bVar7) {
        FUN_14034edd0(plVar20);
        local_280 = 0;
      }
    }
    FUN_1400075f0(&local_308);
    FUN_1400075f0(&local_318);
    FUN_1400075f0(&local_2f8);
    FUN_1400075f0(&local_310);
  }
  else {
    if (plVar20 != (longlong *)0x0) {
      local_278 = plVar20;
      FUN_14034ed40(plVar20);
      bVar7 = true;
      local_270 = 1;
      plVar23 = plVar20 + 8;
      *plVar23 = *plVar23 + -1;
      if (*plVar23 == 0) {
        FUN_14034edd0(plVar20);
        bVar7 = false;
        local_270 = 0;
        puVar15 = (undefined8 *)plVar20[7];
        local_338 = plVar20;
        if (puVar15 != (undefined8 *)0x0) {
          (**(code **)*puVar15)(puVar15,1);
        }
        FUN_14034edf0(plVar20);
        FUN_14034ff60(plVar20);
      }
      if (bVar7) {
        FUN_14034edd0(plVar20);
        local_270 = 0;
      }
    }
    FUN_1400075f0(&local_308);
    FUN_1400075f0(&local_318);
    FUN_1400075f0(&local_2f8);
    FUN_1400075f0(&local_310);
  }
  plVar23 = local_300;
  if (plVar14 != (longlong *)0x0) {
    plVar14 = plVar14 + 1;
    *plVar14 = *plVar14 + -1;
    if (*plVar14 == 0) {
      plVar14 = (longlong *)*local_300;
      if (plVar14 != (longlong *)0x0) {
        (**(code **)(*plVar14 + 0x80))(plVar14,1);
      }
      FUN_14034ff60(plVar23);
    }
  }
  return 0;
}



void FUN_140007590(longlong *param_1)

{
  longlong *plVar1;
  
  if ((*param_1 != 0) &&
     (*(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1,
     *(longlong *)(*param_1 + 8) == 0)) {
    param_1 = (longlong *)*param_1;
    plVar1 = (longlong *)*param_1;
    if (plVar1 != (longlong *)0x0) {
      (**(code **)(*plVar1 + 0x80))(plVar1,1);
    }
    FUN_14034ff60(param_1);
  }
  return;
}



void FUN_1400075f0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_14034ed40(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_14034edd0(lVar1);
      lVar1 = *param_1;
      FUN_140007730(lVar1);
      FUN_14034ff60(lVar1);
    }
    else {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



void FUN_140007680(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_14034ed40(lVar1);
    bVar4 = true;
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_14034edd0(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_14034edf0(lVar2);
      FUN_14034ff60(lVar2);
    }
    if (bVar4) {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



void FUN_140007730(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x38);
  if (pvVar1 != (void *)0x0) {
    FUN_14016d120(pvVar1);
    if (DAT_140607cb0 != (void *)0x0) {
      operator_delete__(DAT_140607cb0);
      DAT_140607cb0 = (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);
  }
  FUN_14034edf0(param_1);
  return;
}



void FUN_1400077c0(longlong param_1)

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



undefined8 * FUN_1400077d0(undefined8 *param_1,uint param_2)

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



void FUN_140007830(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 0x000140007857. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 * FUN_140007870(undefined8 *param_1,byte param_2)

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



void FUN_1400078b0(undefined8 *param_1)

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



bool FUN_1400078d0(undefined4 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  void *pvVar2;
  longlong lVar3;
  int iVar4;
  undefined4 *puVar5;
  void *pvVar6;
  
  pvVar2 = (void *)0x0;
  *(undefined8 *)(param_1 + 2) = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 6) = 0;
  *param_1 = 0;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
    atexit((_func_5014 *)&LAB_140448470);
  }
  pvVar6 = pvVar2;
  if (DAT_14060a120 == 1000) {
    pvVar1 = operator_new(0x347d80);
    if (pvVar1 != (void *)0x0) {
      iVar4 = 9999;
      puVar5 = (undefined4 *)((longlong)pvVar1 + 0xc);
      do {
        *(undefined1 *)(puVar5 + -1) = 0;
        *puVar5 = 0;
        FUN_14000e6c0(puVar5 + 3);
        *(undefined8 *)(puVar5 + -3) = 0;
        *(undefined8 *)(puVar5 + 1) = 0;
        puVar5 = puVar5 + 0x56;
        iVar4 = iVar4 + -1;
        pvVar6 = pvVar1;
      } while (-1 < iVar4);
    }
    iVar4 = 10000;
  }
  else {
    pvVar1 = operator_new(1720000000);
    if (pvVar1 != (void *)0x0) {
      iVar4 = 4999999;
      puVar5 = (undefined4 *)((longlong)pvVar1 + 0xc);
      do {
        *(undefined1 *)(puVar5 + -1) = 0;
        *puVar5 = 0;
        FUN_14000e6c0(puVar5 + 3);
        *(undefined8 *)(puVar5 + -3) = 0;
        *(undefined8 *)(puVar5 + 1) = 0;
        puVar5 = puVar5 + 0x56;
        iVar4 = iVar4 + -1;
        pvVar6 = pvVar1;
      } while (-1 < iVar4);
    }
    iVar4 = 5000000;
  }
  *(void **)(param_1 + 2) = pvVar6;
  lVar3 = (longlong)iVar4;
  pvVar1 = pvVar2;
  if (iVar4 != 0) {
    do {
      *(int *)((longlong)pvVar2 + *(longlong *)(param_1 + 2) + 0xc) = (int)pvVar1;
      *(undefined1 *)((longlong)pvVar2 + *(longlong *)(param_1 + 2) + 8) = 0;
      pvVar2 = (void *)((longlong)pvVar2 + 0x158);
      lVar3 = lVar3 + -1;
      pvVar1 = (void *)(ulonglong)((int)pvVar1 + 1);
    } while (lVar3 != 0);
  }
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  *(undefined8 *)(param_1 + 8) = DAT_140609468;
  *(undefined8 *)(param_1 + 10) = DAT_140609470;
  return pvVar6 != (void *)0x0;
}



void FUN_140007a80(int *param_1,int param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  int iVar5;
  longlong lVar6;
  
  lVar6 = (longlong)param_2 * 0x158;
  puVar1 = (undefined8 *)(lVar6 + *(longlong *)(param_1 + 2));
  puVar4 = *(undefined8 **)(param_1 + 4);
  if (puVar1 == *(undefined8 **)(param_1 + 4)) {
    *(undefined8 *)(param_1 + 4) = *puVar1;
  }
  else {
    do {
      puVar3 = puVar4;
      if (puVar3 == (undefined8 *)0x0) goto LAB_140007ac8;
      puVar4 = (undefined8 *)*puVar3;
    } while ((undefined8 *)*puVar3 != puVar1);
    *puVar3 = *puVar1;
  }
LAB_140007ac8:
  *param_1 = *param_1 + -1;
  iVar5 = *param_1;
  if (*param_1 < 1) {
    iVar5 = 0;
  }
  *param_1 = iVar5;
  lVar2 = *(longlong *)(param_1 + 2);
  *(undefined8 *)(lVar6 + lVar2) = 0;
  *(undefined8 *)(lVar6 + 0x10 + lVar2) = 0;
  *(undefined1 *)(lVar6 + 8 + lVar2) = 0;
  memset((void *)(lVar6 + 0x18 + lVar2),0,0x140);
  return;
}



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

longlong FUN_140007b00(longlong param_1,ulonglong *param_2,uint param_3)

{
  longlong lVar1;
  bool bVar2;
  
  if ((4999999 < param_3) ||
     (lVar1 = (longlong)(int)param_3 * 0x158 + *(longlong *)(param_1 + 8), lVar1 == 0)) {
    return 0;
  }
  bVar2 = *param_2 < *(ulonglong *)(lVar1 + 0x18);
  if ((*param_2 == *(ulonglong *)(lVar1 + 0x18)) &&
     (bVar2 = param_2[1] < *(ulonglong *)(lVar1 + 0x20), param_2[1] == *(ulonglong *)(lVar1 + 0x20))
     ) {
    return lVar1;
  }
  if (1 - bVar2 != (uint)(bVar2 != 0)) {
    lVar1 = 0;
  }
  return lVar1;
}



ulonglong FUN_140007bc0(int *param_1,void *param_2)

{
  uint uVar1;
  char *pcVar2;
  longlong lVar3;
  uint *puVar4;
  uint *puVar5;
  uint *puVar6;
  uint *puVar7;
  
  puVar4 = (uint *)0x0;
  pcVar2 = (char *)(*(longlong *)(param_1 + 2) + 8);
  puVar6 = puVar4;
  puVar7 = puVar4;
  do {
    if (*pcVar2 == '\0') {
      lVar3 = (longlong)(int)puVar7 * 0x158;
      *(undefined1 *)(lVar3 + 8 + *(longlong *)(param_1 + 2)) = 1;
      puVar5 = (uint *)(lVar3 + *(longlong *)(param_1 + 2));
      if (puVar5 != (uint *)0x0) {
        *(undefined8 *)puVar5 = *(undefined8 *)(param_1 + 4);
        *param_1 = *param_1 + 1;
        *(uint **)(param_1 + 4) = puVar5;
      }
      break;
    }
    puVar6 = (uint *)((longlong)puVar6 + 1);
    puVar7 = (uint *)(ulonglong)((int)puVar7 + 1);
    pcVar2 = pcVar2 + 0x158;
    puVar5 = puVar4;
  } while ((longlong)puVar6 < 5000000);
  uVar1 = *(uint *)((longlong)param_2 + 0x18);
  lVar3 = FUN_140137690();
  puVar6 = puVar4;
  if (*(longlong *)(lVar3 + 0x88) != 0) {
    for (puVar7 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                            ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
        puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xa6)) {
      if ((puVar7[0xa8] == uVar1) && (*puVar7 == uVar1)) {
        if (puVar7 != (uint *)0x0) {
          puVar4 = puVar7;
          puVar6 = puVar7 + 2;
        }
        break;
      }
    }
  }
  if (puVar5 != (uint *)0x0) {
    if (puVar6 == (uint *)0x0) {
      puVar4 = (uint *)FUN_140007a80(param_1,puVar5[3]);
    }
    else {
      FUN_140009c40();
      puVar4 = memcpy(puVar5 + 6,param_2,0x140);
      *(uint **)(puVar5 + 4) = puVar6;
    }
  }
  return (ulonglong)puVar4 & 0xffffffffffffff00;
}



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

void FUN_140007ce0(int *param_1,uint param_2,undefined4 param_3,int param_4,undefined4 param_5,
                  undefined4 param_6,undefined4 param_7,undefined4 param_8,undefined4 param_9,
                  undefined4 param_10,undefined4 param_11,undefined4 param_12,undefined8 param_13)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  code *pcVar4;
  longlong lVar5;
  undefined8 *puVar6;
  uint uVar7;
  undefined8 uVar8;
  undefined8 uVar9;
  char cVar10;
  int iVar11;
  undefined1 *puVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  ushort uVar15;
  int iVar16;
  undefined1 auStack_1d8 [32];
  undefined8 local_1b8;
  undefined8 local_1b0;
  undefined4 local_1a8;
  undefined4 local_1a0;
  undefined4 local_198;
  undefined8 local_190;
  uint local_188 [2];
  undefined1 *local_180;
  undefined1 *local_178;
  undefined1 *local_170;
  undefined4 local_160 [2];
  undefined8 local_158;
  undefined8 local_150;
  undefined1 local_148 [168];
  undefined4 local_a0;
  int local_50;
  undefined4 local_4c;
  ulonglong local_48;
  
  local_150 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_1d8;
  local_158 = param_13;
  uVar15 = 0;
  local_180 = (undefined1 *)0x0;
  local_178 = (undefined1 *)0x0;
  local_170 = (undefined1 *)0x0;
  iVar16 = param_4 * 0x1e;
  puVar12 = (undefined1 *)0x0;
  uVar8 = local_190;
  local_188[0] = param_2;
  local_160[0] = param_3;
  if ((0 < param_4) && (puVar12 = (undefined1 *)0x0, iVar16 + -0x1e < *param_1)) {
    puVar3 = *(undefined8 **)(param_1 + 4);
    uVar9 = param_13;
    while (local_190 = uVar9, puVar6 = puVar3, puVar6 != (undefined8 *)0x0) {
      puVar3 = (undefined8 *)*puVar6;
      uVar9 = local_190;
      if ((*(char *)(puVar6 + 1) == '\x01') &&
         ((-1 < *(int *)((longlong)puVar6 + 0xc) || (*(int *)((longlong)puVar6 + 0xc) < 5000000))))
      {
        local_198 = param_12;
        local_1a0 = param_11;
        local_1a8 = param_10;
        uVar14 = (ulonglong)local_1b0 >> 0x20;
        local_1b0 = (uint *)CONCAT44((int)uVar14,param_9);
        uVar14 = (ulonglong)local_1b8 >> 0x20;
        local_1b8 = (undefined1 **)CONCAT44((int)uVar14,param_8);
        cVar10 = FUN_14000d6a0(puVar6,param_5,param_6,param_7);
        puVar12 = local_180;
        uVar9 = local_158;
        uVar8 = local_190;
        if (cVar10 == '\x01') {
          if ((iVar16 + -0x1e <= (int)(uint)uVar15) && ((int)(uint)uVar15 < iVar16)) {
            if (0x1d < (ulonglong)((longlong)local_178 - (longlong)local_180 >> 8)) break;
            FUN_14000a270(local_148);
            iVar11 = FUN_140009c40();
            iVar2 = *(int *)((longlong)puVar6 + 0x14c);
            FUN_14000e390(local_148,puVar6 + 3);
            local_a0 = *(undefined4 *)((longlong)puVar6 + 0xc);
            local_50 = (*(int *)(puVar6 + 0x2a) - iVar11) + iVar2 * 0x3c;
            local_4c = FUN_140009cb0(puVar6);
            if ((local_148 < local_178) && (local_180 <= local_148)) {
              lVar5 = -(longlong)local_180;
              if (local_178 == local_170) {
                uVar14 = (longlong)local_178 - (longlong)local_180 >> 8;
                if (0xfffffffffffffe < uVar14) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar4 = (code *)swi(3);
                  (*pcVar4)();
                  return;
                }
                uVar14 = uVar14 + 1;
                uVar13 = (longlong)local_170 - (longlong)local_180 >> 8;
                if (uVar13 < uVar14) {
                  if (0xffffffffffffff - (uVar13 >> 1) < uVar13) {
                    uVar13 = 0;
                  }
                  else {
                    uVar13 = uVar13 + (uVar13 >> 1);
                  }
                  if (uVar13 < uVar14) {
                    uVar13 = uVar14;
                  }
                  FUN_14000a000(&local_180,uVar13);
                }
              }
              puVar12 = local_178;
              if (local_178 != (undefined1 *)0x0) {
                memcpy(local_178,local_180 + ((ulonglong)(local_148 + lVar5) & 0xffffffffffffff00),
                       0x100);
                puVar12 = local_178;
              }
            }
            else {
              if (local_178 == local_170) {
                uVar14 = (longlong)local_178 - (longlong)local_180 >> 8;
                if (0xfffffffffffffe < uVar14) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar4 = (code *)swi(3);
                  (*pcVar4)();
                  return;
                }
                uVar14 = uVar14 + 1;
                uVar13 = (longlong)local_170 - (longlong)local_180 >> 8;
                if (uVar13 < uVar14) {
                  if (0xffffffffffffff - (uVar13 >> 1) < uVar13) {
                    uVar13 = 0;
                  }
                  else {
                    uVar13 = uVar13 + (uVar13 >> 1);
                  }
                  if (uVar13 < uVar14) {
                    uVar13 = uVar14;
                  }
                  FUN_14000a000(&local_180,uVar13);
                }
              }
              puVar12 = (undefined1 *)0x0;
              if (local_178 != (undefined1 *)0x0) {
                memcpy(local_178,local_148,0x100);
                local_178 = local_178 + 0x100;
                goto LAB_140007fed;
              }
            }
            local_178 = puVar12 + 0x100;
          }
LAB_140007fed:
          uVar15 = uVar15 + 1;
          puVar12 = local_180;
          uVar9 = local_158;
          uVar8 = local_190;
        }
      }
    }
  }
  local_190 = uVar8;
  uVar7 = local_188[0];
  if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
    local_188[0] = (uint)uVar15;
    plVar1 = (longlong *)(*(longlong *)(DAT_140607fd0 + 0x70) + 0x9c8);
    local_1b0 = local_188;
    local_1b8 = &local_180;
    (**(code **)(*plVar1 + 0x40))(plVar1,uVar7,&DAT_1405d85a0,local_160);
    puVar12 = local_180;
  }
  if (puVar12 != (undefined1 *)0x0) {
    operator_delete(puVar12);
  }
  return;
}



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

void FUN_1400080b0(longlong param_1,ulonglong param_2,undefined4 param_3,int param_4,
                  ulonglong *param_5,char param_6)

{
  longlong *plVar1;
  code *pcVar2;
  longlong lVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  int iVar6;
  int iVar7;
  ulonglong uVar8;
  longlong *plVar9;
  ulonglong uVar10;
  undefined1 *puVar11;
  undefined1 *puVar12;
  ushort uVar13;
  bool bVar14;
  undefined1 auStack_1e8 [32];
  undefined1 **local_1c8;
  uint *local_1c0;
  uint local_1b8 [2];
  undefined1 *local_1b0;
  undefined1 *local_1a8;
  undefined1 *local_1a0;
  undefined4 local_190 [2];
  undefined8 local_188;
  undefined4 local_180;
  undefined4 uStack_17c;
  undefined4 local_178;
  undefined4 uStack_174;
  undefined4 local_170;
  undefined4 uStack_16c;
  undefined4 local_168;
  undefined4 uStack_164;
  undefined4 local_160;
  undefined4 uStack_15c;
  undefined4 local_158;
  undefined4 uStack_154;
  undefined1 local_148 [168];
  undefined4 local_a0;
  undefined8 local_9c;
  undefined8 local_94;
  undefined8 local_8c;
  undefined8 local_84;
  undefined8 local_7c;
  undefined8 local_74;
  undefined8 local_6c;
  undefined8 local_64;
  undefined8 local_5c;
  undefined4 local_54;
  int local_50;
  undefined4 local_4c;
  ulonglong local_48;
  
  local_188 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_1e8;
  local_1b8[0] = (uint)param_2;
  uVar13 = 0;
  local_1b0 = (undefined1 *)0x0;
  local_1a8 = (undefined1 *)0x0;
  local_1a0 = (undefined1 *)0x0;
  puVar11 = (undefined1 *)0x0;
  local_190[0] = param_3;
  if ((0 < param_4) &&
     (plVar9 = *(longlong **)(param_1 + 0x10), puVar11 = (undefined1 *)0x0,
     puVar12 = (undefined1 *)0x0, *(longlong **)(param_1 + 0x10) != (longlong *)0x0)) {
    do {
      plVar1 = (longlong *)*plVar9;
      puVar11 = puVar12;
      if (((char)plVar9[1] == '\x01') &&
         ((-1 < *(int *)((longlong)plVar9 + 0xc) || (*(int *)((longlong)plVar9 + 0xc) < 5000000))))
      {
        local_160 = (undefined4)plVar9[0x23];
        uStack_15c = *(undefined4 *)((longlong)plVar9 + 0x11c);
        uVar10 = plVar9[0x23];
        local_158 = (undefined4)plVar9[0x24];
        uStack_154 = *(undefined4 *)((longlong)plVar9 + 0x124);
        uVar5 = plVar9[0x24];
        local_170 = (undefined4)plVar9[0x18];
        uStack_16c = *(undefined4 *)((longlong)plVar9 + 0xc4);
        uVar8 = plVar9[0x18];
        local_168 = (undefined4)plVar9[0x19];
        uStack_164 = *(undefined4 *)((longlong)plVar9 + 0xcc);
        uVar4 = plVar9[0x19];
        bVar14 = uVar8 < uVar10;
        iVar6 = 0;
        if ((uVar8 != uVar10) || (bVar14 = uVar4 < uVar5, uVar4 != uVar5)) {
          iVar6 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
        }
        if ((iVar6 != 0) || (param_6 != '\x01')) {
          if (param_6 == '\0') {
            local_180 = (undefined4)plVar9[0x18];
            uStack_17c = *(undefined4 *)((longlong)plVar9 + 0xc4);
            local_178 = (undefined4)plVar9[0x19];
            uStack_174 = *(undefined4 *)((longlong)plVar9 + 0xcc);
          }
          else {
            local_180 = (undefined4)plVar9[0x23];
            uStack_17c = *(undefined4 *)((longlong)plVar9 + 0x11c);
            local_178 = (undefined4)plVar9[0x24];
            uStack_174 = *(undefined4 *)((longlong)plVar9 + 0x124);
          }
          bVar14 = CONCAT44(uStack_17c,local_180) < *param_5;
          if ((CONCAT44(uStack_17c,local_180) == *param_5) &&
             (bVar14 = CONCAT44(uStack_174,local_178) < param_5[1],
             CONCAT44(uStack_174,local_178) == param_5[1])) {
            iVar6 = 0;
          }
          else {
            iVar6 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
          }
          if (iVar6 == 0) {
            FUN_14000a170(local_148);
            local_7c = 0;
            local_54 = 0;
            local_9c = 0;
            local_94 = 0;
            local_8c = 0;
            local_84 = 0;
            local_74 = 0;
            local_6c = 0;
            local_64 = 0;
            local_5c = 0;
            iVar7 = FUN_140009c40();
            iVar6 = *(int *)((longlong)plVar9 + 0x14c);
            FUN_14000e390(local_148,plVar9 + 3);
            local_a0 = *(undefined4 *)((longlong)plVar9 + 0xc);
            local_50 = ((int)plVar9[0x2a] - iVar7) + iVar6 * 0x3c;
            local_4c = FUN_140009cb0(plVar9);
            if ((local_148 < local_1a8) && (local_1b0 <= local_148)) {
              lVar3 = -(longlong)local_1b0;
              if (local_1a8 == local_1a0) {
                uVar8 = (longlong)local_1a8 - (longlong)local_1b0 >> 8;
                if (0xfffffffffffffe < uVar8) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar2 = (code *)swi(3);
                  (*pcVar2)();
                  return;
                }
                uVar8 = uVar8 + 1;
                uVar10 = (longlong)local_1a0 - (longlong)local_1b0 >> 8;
                if (uVar10 < uVar8) {
                  if (0xffffffffffffff - (uVar10 >> 1) < uVar10) {
                    uVar10 = 0;
                  }
                  else {
                    uVar10 = uVar10 + (uVar10 >> 1);
                  }
                  if (uVar10 < uVar8) {
                    uVar10 = uVar8;
                  }
                  FUN_14000a000(&local_1b0,uVar10);
                }
              }
              puVar11 = local_1b0 + ((ulonglong)(local_148 + lVar3) & 0xffffffffffffff00);
              if (local_1a8 != (undefined1 *)0x0) {
LAB_1400083f8:
                memcpy(local_1a8,puVar11,0x100);
              }
            }
            else {
              if (local_1a8 == local_1a0) {
                uVar8 = (longlong)local_1a8 - (longlong)local_1b0 >> 8;
                if (0xfffffffffffffe < uVar8) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar2 = (code *)swi(3);
                  (*pcVar2)();
                  return;
                }
                uVar8 = uVar8 + 1;
                uVar10 = (longlong)local_1a0 - (longlong)local_1b0 >> 8;
                if (uVar10 < uVar8) {
                  if (0xffffffffffffff - (uVar10 >> 1) < uVar10) {
                    uVar10 = 0;
                  }
                  else {
                    uVar10 = uVar10 + (uVar10 >> 1);
                  }
                  if (uVar10 < uVar8) {
                    uVar10 = uVar8;
                  }
                  FUN_14000a000(&local_1b0,uVar10);
                }
              }
              if (local_1a8 != (undefined1 *)0x0) {
                puVar11 = local_148;
                goto LAB_1400083f8;
              }
            }
            local_1a8 = local_1a8 + 0x100;
            uVar13 = uVar13 + 1;
            puVar11 = local_1b0;
          }
        }
      }
      plVar9 = plVar1;
      puVar12 = puVar11;
    } while (plVar1 != (longlong *)0x0);
    param_2 = (ulonglong)local_1b8[0];
  }
  if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
    local_1b8[0] = (uint)uVar13;
    plVar9 = (longlong *)(*(longlong *)(DAT_140607fd0 + 0x70) + 0x9c8);
    local_1c0 = local_1b8;
    local_1c8 = &local_1b0;
    (**(code **)(*plVar9 + 0x50))(plVar9,param_2,&DAT_1405d85a0,local_190);
    puVar11 = local_1b0;
  }
  if (puVar11 != (undefined1 *)0x0) {
    operator_delete(puVar11);
  }
  return;
}



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

void FUN_1400084d0(int *param_1)

{
  undefined8 *puVar1;
  undefined *puVar2;
  int *piVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined8 *puVar9;
  longlong lVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  undefined4 uVar14;
  int iVar15;
  uint uVar16;
  undefined8 uVar17;
  longlong lVar18;
  longlong *plVar19;
  undefined *puVar20;
  ulonglong uVar21;
  ulonglong uVar22;
  undefined *puVar23;
  int iVar24;
  bool bVar25;
  undefined1 auStack_278 [32];
  undefined4 *local_258;
  undefined **local_250;
  undefined8 *local_248;
  undefined8 *local_240;
  undefined8 local_238;
  undefined4 *local_230;
  undefined *local_228;
  undefined *local_220;
  undefined *local_218;
  undefined4 local_210 [2];
  undefined4 local_208 [2];
  undefined4 local_200 [2];
  undefined **local_1f8;
  longlong *local_1f0;
  ulonglong local_1e8;
  ulonglong local_1e0;
  undefined8 local_1d8;
  undefined4 local_1d0 [2];
  undefined4 local_1c8 [2];
  undefined4 local_1c0 [2];
  longlong local_1b8;
  undefined8 local_1b0;
  undefined1 local_1a8;
  undefined8 local_1a0;
  undefined1 local_198;
  undefined8 local_190;
  undefined1 local_188;
  undefined8 local_180;
  longlong local_178;
  undefined8 uStack_170;
  undefined4 local_168;
  undefined4 uStack_164;
  undefined4 uStack_160;
  undefined4 uStack_15c;
  undefined4 local_158;
  undefined4 uStack_154;
  undefined4 uStack_150;
  undefined4 uStack_14c;
  longlong local_148;
  undefined8 uStack_140;
  longlong local_138;
  undefined8 uStack_130;
  undefined4 local_128;
  undefined4 uStack_124;
  undefined4 uStack_120;
  undefined4 uStack_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  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;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 uStack_c4;
  undefined4 local_c0;
  undefined4 uStack_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  ulonglong local_38;
  
  local_180 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_278;
  if (0 < *param_1) {
    local_1b8 = FUN_140009c40();
    puVar6 = *(undefined8 **)(param_1 + 4);
    lVar10 = local_1b8;
    while (puVar9 = puVar6, puVar9 != (undefined8 *)0x0) {
      puVar6 = (undefined8 *)*puVar9;
      if ((*(char *)(puVar9 + 1) == '\x01') &&
         (((-1 < *(int *)((longlong)puVar9 + 0xc) || (*(int *)((longlong)puVar9 + 0xc) < 5000000))
          && (lVar18 = lVar10 - puVar9[0x2a], lVar10 = local_1b8,
             *(int *)((longlong)puVar9 + 0x14c) * 0x3c < lVar18)))) {
        local_58 = (undefined4)puVar9[0x23];
        uStack_54 = *(undefined4 *)((longlong)puVar9 + 0x11c);
        uVar22 = puVar9[0x23];
        local_50 = (undefined4)puVar9[0x24];
        uStack_4c = *(undefined4 *)((longlong)puVar9 + 0x124);
        uVar8 = puVar9[0x24];
        local_c8 = (undefined4)puVar9[0x18];
        uStack_c4 = *(undefined4 *)((longlong)puVar9 + 0xc4);
        uVar21 = puVar9[0x18];
        local_c0 = (undefined4)puVar9[0x19];
        uStack_bc = *(undefined4 *)((longlong)puVar9 + 0xcc);
        uVar7 = puVar9[0x19];
        bVar25 = uVar21 < uVar22;
        iVar24 = 0;
        if ((uVar21 != uVar22) || (bVar25 = uVar7 < uVar8, iVar11 = iVar24, uVar7 != uVar8)) {
          iVar11 = (1 - (uint)bVar25) - (uint)(bVar25 != 0);
        }
        if (iVar11 == 0) {
          local_148 = puVar9[0x18];
          uStack_140 = puVar9[0x19];
          local_128 = 0;
          uStack_124 = 0;
          uStack_120 = 0;
          uStack_11c = 0;
          uVar14 = FUN_140009cb0(puVar9);
          puVar1 = puVar9 + 0x1c;
          local_238 = (undefined4 *)CONCAT44(local_238._4_4_,uVar14);
          local_240 = (undefined8 *)0x0;
          local_250 = (undefined **)&local_148;
          local_258 = &local_128;
          local_248 = puVar1;
          FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),puVar9,0x1d8,0x19);
          local_48 = *(undefined4 *)(puVar9 + 0x18);
          local_44 = *(undefined4 *)((longlong)puVar9 + 0xc4);
          local_40 = *(undefined4 *)(puVar9 + 0x19);
          local_3c = *(undefined4 *)((longlong)puVar9 + 0xcc);
          local_f8 = *(undefined4 *)(puVar9 + 0x1a);
          local_f4 = *(undefined4 *)((longlong)puVar9 + 0xd4);
          local_f0 = *(undefined4 *)(puVar9 + 0x1b);
          local_ec = *(undefined4 *)((longlong)puVar9 + 0xdc);
          local_240 = (undefined8 *)CONCAT44(local_240._4_4_,7);
          local_250 = (undefined **)&local_48;
          local_258 = &local_f8;
          local_248 = puVar1;
          FUN_1400091a0(0,&DAT_140477960,puVar9 + 3,0);
          FUN_14034fe70();
          local_218 = PTR_DAT_1405d8010;
          iVar15 = FUN_14034fcf0(puVar1);
          iVar11 = iVar24;
          if ((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1405d8010)) {
            iVar11 = *(int *)(local_218 + -8);
          }
          iVar13 = 0;
          iVar12 = iVar15;
          if (((iVar15 <= iVar11) && (iVar12 = iVar24, local_218 != (undefined *)0x0)) &&
             (iVar12 = iVar13, local_218 != PTR_DAT_1405d8010)) {
            iVar12 = *(int *)(local_218 + -8);
          }
          iVar24 = 1;
          if (1 < iVar12) {
            iVar24 = iVar12;
          }
          iVar11 = iVar13;
          if ((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1405d8010)) {
            iVar11 = *(int *)(local_218 + -8);
          }
          if (iVar11 < iVar24) {
            FUN_140002d30(&local_218);
          }
          FUN_140002e10(&local_218);
          puVar20 = local_218;
          if (local_218 == (undefined *)0x0) {
            puVar20 = PTR_DAT_1405d8010;
          }
          FUN_14034fd20(puVar20,puVar1,iVar15);
          puVar20 = local_218;
          if (local_218 == (undefined *)0x0) {
            puVar20 = PTR_DAT_1405d8010;
          }
          uVar16 = FUN_14034fcf0(puVar20);
          puVar20 = PTR_DAT_1405d8010;
          uVar21 = 0;
          if (0 < (int)uVar16) {
            uVar21 = (ulonglong)uVar16;
          }
          iVar24 = iVar13;
          if ((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1405d8010)) {
            iVar24 = *(int *)(local_218 + -8);
          }
          iVar11 = (int)uVar21;
          if (((int)uVar21 < iVar24) || (iVar11 = iVar13, local_218 == (undefined *)0x0)) {
LAB_140008f46:
            if (((local_218 != PTR_DAT_1405d8010) && (local_218 != (undefined *)0x0)) &&
               ((int *)(local_218 + -8) != (int *)0x0)) {
              *(int *)(local_218 + -8) = iVar11;
              *(undefined2 *)(local_218 + (longlong)iVar11 * 2) = 0;
            }
          }
          else if (local_218 != PTR_DAT_1405d8010) {
            iVar11 = *(int *)(local_218 + -8);
            goto LAB_140008f46;
          }
          lVar10 = DAT_140607fd0;
          local_1c8[0] = *(undefined4 *)(puVar9 + 6);
          local_98 = *(undefined4 *)(puVar9 + 3);
          local_94 = *(undefined4 *)((longlong)puVar9 + 0x1c);
          local_90 = *(undefined4 *)(puVar9 + 4);
          local_8c = *(undefined4 *)((longlong)puVar9 + 0x24);
          local_d8 = *(undefined4 *)(puVar9 + 0x18);
          local_d4 = *(undefined4 *)((longlong)puVar9 + 0xc4);
          local_d0 = *(undefined4 *)(puVar9 + 0x19);
          local_cc = *(undefined4 *)((longlong)puVar9 + 0xcc);
          local_1d0[0] = 0xe5;
          local_1c0[0] = 0;
          if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
            local_1f8 = Proud::CFastArray<>::vftable;
            local_1f0 = (longlong *)0x0;
            local_1e8 = 0;
            local_1e0 = 0;
            local_1d8 = 0;
            FUN_14000ac20(*(longlong *)(DAT_140607fd0 + 0x70),&local_1f8);
            uVar21 = local_1e8;
            uVar22 = local_1e8;
            if ((int)local_1e0 == 0) {
              uVar22 = 0;
            }
            plVar19 = (longlong *)(*(longlong *)(lVar10 + 0x70) + 0x9c8);
            local_230 = local_1d0;
            local_238 = local_1c8;
            local_240 = (undefined8 *)&local_98;
            local_248 = (undefined8 *)&local_d8;
            local_250 = &local_218;
            local_258 = local_1c0;
            (**(code **)(*plVar19 + 0x88))(plVar19,uVar22,local_1e0 & 0xffffffff,&DAT_1405d85a0);
            puVar20 = PTR_DAT_1405d8010;
            if (uVar21 != 0) {
              if (local_1f0 == (longlong *)0x0) {
                FUN_14034ff60(uVar21);
                puVar20 = PTR_DAT_1405d8010;
              }
              else {
                (**(code **)(*local_1f0 + 0x18))(local_1f0,uVar21);
                puVar20 = PTR_DAT_1405d8010;
              }
            }
          }
          puVar23 = local_218;
          if (((local_218 != (undefined *)0x0) && (local_218 != puVar20)) &&
             (puVar2 = local_218 + -8, puVar2 != (undefined *)0x0)) {
            uVar17 = FUN_14034fe70();
            local_1b0 = uVar17;
            FUN_14034ed40(uVar17);
            local_1a8 = 1;
            piVar3 = (int *)(puVar23 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(uVar17);
            local_1a8 = 0;
            puVar20 = PTR_DAT_1405d8010;
          }
          puVar23 = local_220;
          local_218 = puVar20;
          if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
            piVar3 = (int *)(*(longlong *)(DAT_140607fd0 + 0x70) + 0xa50);
            *piVar3 = *piVar3 + -1;
          }
        }
        else {
          local_138 = puVar9[0x23];
          uStack_130 = puVar9[0x24];
          local_158 = 0;
          uStack_154 = 0;
          uStack_150 = 0;
          uStack_14c = 0;
          puVar4 = puVar9 + 0x1c;
          puVar5 = puVar9 + 0x25;
          local_238._4_4_ = (undefined4)((ulonglong)local_238 >> 0x20);
          local_250 = (undefined **)&local_138;
          local_258 = &local_158;
          local_248 = puVar5;
          local_240 = puVar4;
          local_238._0_4_ = *(undefined4 *)(puVar9 + 0x29);
          FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),puVar9,0x1d8,0x17);
          local_178 = puVar9[0x18];
          uStack_170 = puVar9[0x19];
          local_168 = 0;
          uStack_164 = 0;
          uStack_160 = 0;
          uStack_15c = 0;
          local_238 = (undefined4 *)CONCAT44(local_238._4_4_,*(undefined4 *)(puVar9 + 0x29));
          local_258 = &local_168;
          local_250 = (undefined **)&local_178;
          local_248 = puVar4;
          local_240 = puVar5;
          FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),puVar9,0x1d8);
          local_b8 = *(undefined4 *)(puVar9 + 0x23);
          local_b4 = *(undefined4 *)((longlong)puVar9 + 0x11c);
          local_b0 = *(undefined4 *)(puVar9 + 0x24);
          local_ac = *(undefined4 *)((longlong)puVar9 + 0x124);
          local_78 = *(undefined4 *)(puVar9 + 0x21);
          local_74 = *(undefined4 *)((longlong)puVar9 + 0x10c);
          local_70 = *(undefined4 *)(puVar9 + 0x22);
          local_6c = *(undefined4 *)((longlong)puVar9 + 0x114);
          puVar1 = puVar9 + 3;
          local_240 = (undefined8 *)CONCAT44(local_240._4_4_,10);
          local_250 = (undefined **)&local_b8;
          local_258 = &local_78;
          local_248 = puVar5;
          FUN_1400091a0(0,&DAT_140477960,puVar1);
          FUN_14034fe70();
          local_228 = PTR_DAT_1405d8010;
          iVar11 = FUN_14034fcf0(puVar5);
          iVar15 = 0;
          iVar24 = iVar15;
          if ((local_228 != (undefined *)0x0) && (local_228 != PTR_DAT_1405d8010)) {
            iVar24 = *(int *)(local_228 + -8);
          }
          iVar13 = 0;
          iVar12 = iVar11;
          if (((iVar11 <= iVar24) && (iVar12 = iVar15, local_228 != (undefined *)0x0)) &&
             (iVar12 = iVar13, local_228 != PTR_DAT_1405d8010)) {
            iVar12 = *(int *)(local_228 + -8);
          }
          iVar24 = 1;
          if (1 < iVar12) {
            iVar24 = iVar12;
          }
          if ((local_228 != (undefined *)0x0) && (local_228 != PTR_DAT_1405d8010)) {
            iVar13 = *(int *)(local_228 + -8);
          }
          if (iVar13 < iVar24) {
            FUN_140002d30(&local_228);
          }
          FUN_140002e10(&local_228);
          puVar20 = local_228;
          if (local_228 == (undefined *)0x0) {
            puVar20 = PTR_DAT_1405d8010;
          }
          FUN_14034fd20(puVar20,puVar5,iVar11);
          puVar20 = local_228;
          if (local_228 == (undefined *)0x0) {
            puVar20 = PTR_DAT_1405d8010;
          }
          iVar11 = FUN_14034fcf0(puVar20);
          puVar20 = PTR_DAT_1405d8010;
          iVar15 = 0;
          iVar24 = 0;
          if (0 < iVar11) {
            iVar24 = iVar11;
          }
          iVar11 = iVar15;
          if ((local_228 != (undefined *)0x0) && (local_228 != PTR_DAT_1405d8010)) {
            iVar11 = *(int *)(local_228 + -8);
          }
          if ((iVar24 < iVar11) || (iVar24 = iVar15, local_228 == (undefined *)0x0)) {
LAB_140008858:
            if (((local_228 != PTR_DAT_1405d8010) && (local_228 != (undefined *)0x0)) &&
               ((int *)(local_228 + -8) != (int *)0x0)) {
              *(int *)(local_228 + -8) = iVar24;
              *(undefined2 *)(local_228 + (longlong)iVar24 * 2) = 0;
            }
          }
          else if (local_228 != PTR_DAT_1405d8010) {
            iVar24 = *(int *)(local_228 + -8);
            goto LAB_140008858;
          }
          lVar10 = DAT_140607fd0;
          local_210[0] = *(undefined4 *)(puVar9 + 6);
          local_108 = *(undefined4 *)puVar1;
          local_104 = *(undefined4 *)((longlong)puVar9 + 0x1c);
          local_100 = *(undefined4 *)(puVar9 + 4);
          local_fc = *(undefined4 *)((longlong)puVar9 + 0x24);
          local_e8 = *(undefined4 *)(puVar9 + 0x23);
          local_e4 = *(undefined4 *)((longlong)puVar9 + 0x11c);
          local_e0 = *(undefined4 *)(puVar9 + 0x24);
          local_dc = *(undefined4 *)((longlong)puVar9 + 0x124);
          local_200[0] = 0xe7;
          local_208[0] = 0;
          if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
            local_1f8 = Proud::CFastArray<>::vftable;
            local_1f0 = (longlong *)0x0;
            local_1e8 = 0;
            local_1e0 = 0;
            local_1d8 = 0;
            FUN_14000ac20(*(longlong *)(DAT_140607fd0 + 0x70),&local_1f8);
            uVar21 = local_1e8;
            uVar22 = local_1e8;
            if ((int)local_1e0 == 0) {
              uVar22 = 0;
            }
            plVar19 = (longlong *)(*(longlong *)(lVar10 + 0x70) + 0x9c8);
            local_230 = local_200;
            local_238 = local_210;
            local_240 = (undefined8 *)&local_108;
            local_248 = (undefined8 *)&local_e8;
            local_250 = &local_228;
            local_258 = local_208;
            (**(code **)(*plVar19 + 0x88))(plVar19,uVar22,local_1e0 & 0xffffffff,&DAT_1405d85a0);
            puVar20 = PTR_DAT_1405d8010;
            if (uVar21 != 0) {
              if (local_1f0 == (longlong *)0x0) {
                FUN_14034ff60(uVar21);
                puVar20 = PTR_DAT_1405d8010;
              }
              else {
                (**(code **)(*local_1f0 + 0x18))(local_1f0,uVar21);
                puVar20 = PTR_DAT_1405d8010;
              }
            }
          }
          puVar23 = local_228;
          if (((local_228 != (undefined *)0x0) && (local_228 != puVar20)) &&
             (puVar2 = local_228 + -8, puVar2 != (undefined *)0x0)) {
            uVar17 = FUN_14034fe70();
            local_1a0 = uVar17;
            FUN_14034ed40(uVar17);
            local_198 = 1;
            piVar3 = (int *)(puVar23 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(uVar17);
            local_198 = 0;
            puVar20 = PTR_DAT_1405d8010;
          }
          local_228 = puVar20;
          FUN_140009cb0(puVar9);
          local_118 = *(undefined4 *)(puVar9 + 0x18);
          local_114 = *(undefined4 *)((longlong)puVar9 + 0xc4);
          local_110 = *(undefined4 *)(puVar9 + 0x19);
          local_10c = *(undefined4 *)((longlong)puVar9 + 0xcc);
          local_a8 = *(undefined4 *)(puVar9 + 0x1a);
          local_a4 = *(undefined4 *)((longlong)puVar9 + 0xd4);
          local_a0 = *(undefined4 *)(puVar9 + 0x1b);
          local_9c = *(undefined4 *)((longlong)puVar9 + 0xdc);
          local_240 = (undefined8 *)CONCAT44(local_240._4_4_,8);
          local_250 = (undefined **)&local_118;
          local_258 = &local_a8;
          local_248 = puVar4;
          FUN_1400091a0(0,&DAT_140477960,0);
          FUN_14034fe70();
          local_220 = PTR_DAT_1405d8010;
          iVar11 = FUN_14034fcf0(puVar4);
          iVar15 = 0;
          iVar24 = iVar15;
          if ((local_220 != (undefined *)0x0) && (local_220 != PTR_DAT_1405d8010)) {
            iVar24 = *(int *)(local_220 + -8);
          }
          iVar13 = 0;
          iVar12 = iVar11;
          if (((iVar11 <= iVar24) && (iVar12 = iVar15, local_220 != (undefined *)0x0)) &&
             (iVar12 = iVar13, local_220 != PTR_DAT_1405d8010)) {
            iVar12 = *(int *)(local_220 + -8);
          }
          iVar24 = 1;
          if (1 < iVar12) {
            iVar24 = iVar12;
          }
          if ((local_220 != (undefined *)0x0) && (local_220 != PTR_DAT_1405d8010)) {
            iVar13 = *(int *)(local_220 + -8);
          }
          if (iVar13 < iVar24) {
            FUN_140002d30(&local_220);
          }
          FUN_140002e10(&local_220);
          puVar20 = local_220;
          if (local_220 == (undefined *)0x0) {
            puVar20 = PTR_DAT_1405d8010;
          }
          FUN_14034fd20(puVar20,puVar4,iVar11);
          puVar20 = local_220;
          if (local_220 == (undefined *)0x0) {
            puVar20 = PTR_DAT_1405d8010;
          }
          iVar11 = FUN_14034fcf0(puVar20);
          puVar23 = PTR_DAT_1405d8010;
          iVar15 = 0;
          iVar24 = 0;
          if (0 < iVar11) {
            iVar24 = iVar11;
          }
          iVar11 = iVar15;
          if ((local_220 != (undefined *)0x0) && (local_220 != PTR_DAT_1405d8010)) {
            iVar11 = *(int *)(local_220 + -8);
          }
          if ((iVar24 < iVar11) || (iVar24 = iVar15, local_220 == (undefined *)0x0)) {
LAB_140008bac:
            if (((local_220 != PTR_DAT_1405d8010) && (local_220 != (undefined *)0x0)) &&
               ((int *)(local_220 + -8) != (int *)0x0)) {
              *(int *)(local_220 + -8) = iVar24;
              *(undefined2 *)(local_220 + (longlong)iVar24 * 2) = 0;
            }
          }
          else if (local_220 != PTR_DAT_1405d8010) {
            iVar24 = *(int *)(local_220 + -8);
            goto LAB_140008bac;
          }
          lVar10 = DAT_140607fd0;
          local_210[0] = *(undefined4 *)(puVar9 + 6);
          local_88 = *(undefined4 *)puVar1;
          local_84 = *(undefined4 *)((longlong)puVar9 + 0x1c);
          local_80 = *(undefined4 *)(puVar9 + 4);
          local_7c = *(undefined4 *)((longlong)puVar9 + 0x24);
          local_68 = *(undefined4 *)(puVar9 + 0x18);
          local_64 = *(undefined4 *)((longlong)puVar9 + 0xc4);
          local_60 = *(undefined4 *)(puVar9 + 0x19);
          local_5c = *(undefined4 *)((longlong)puVar9 + 0xcc);
          local_208[0] = 0xe6;
          local_200[0] = 0;
          if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
            local_1f8 = Proud::CFastArray<>::vftable;
            local_1f0 = (longlong *)0x0;
            local_1e8 = 0;
            local_1e0 = 0;
            local_1d8 = 0;
            FUN_14000ac20(*(longlong *)(DAT_140607fd0 + 0x70),&local_1f8);
            uVar21 = local_1e8;
            uVar22 = local_1e8;
            if ((int)local_1e0 == 0) {
              uVar22 = 0;
            }
            plVar19 = (longlong *)(*(longlong *)(lVar10 + 0x70) + 0x9c8);
            local_230 = local_208;
            local_238 = local_210;
            local_240 = (undefined8 *)&local_88;
            local_248 = (undefined8 *)&local_68;
            local_250 = &local_220;
            local_258 = local_200;
            (**(code **)(*plVar19 + 0x88))(plVar19,uVar22,local_1e0 & 0xffffffff,&DAT_1405d85a0);
            puVar23 = PTR_DAT_1405d8010;
            if (uVar21 != 0) {
              if (local_1f0 == (longlong *)0x0) {
                FUN_14034ff60(uVar21);
                puVar23 = PTR_DAT_1405d8010;
              }
              else {
                (**(code **)(*local_1f0 + 0x18))(local_1f0,uVar21);
                puVar23 = PTR_DAT_1405d8010;
              }
            }
          }
          puVar20 = local_220;
          if (((local_220 != (undefined *)0x0) && (local_220 != puVar23)) &&
             (puVar2 = local_220 + -8, puVar2 != (undefined *)0x0)) {
            uVar17 = FUN_14034fe70();
            local_190 = uVar17;
            FUN_14034ed40(uVar17);
            local_188 = 1;
            piVar3 = (int *)(puVar20 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(uVar17);
            local_188 = 0;
            puVar23 = PTR_DAT_1405d8010;
          }
        }
        local_220 = puVar23;
        if (*(longlong *)(DAT_140607fd0 + 0x50) != 0) {
          plVar19 = (longlong *)(**(longlong **)(*(longlong *)(DAT_140607fd0 + 0x50) + 8) + 0x70);
          (**(code **)(*plVar19 + 0x680))(plVar19,1,&DAT_1405d85a0,puVar9 + 3);
        }
        FUN_140007a80(param_1,*(undefined4 *)((longlong)puVar9 + 0xc));
        lVar10 = local_1b8;
      }
    }
  }
  return;
}



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

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

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  undefined *puVar7;
  undefined8 uVar8;
  longlong *plVar9;
  undefined *puVar10;
  int iVar11;
  uint uVar12;
  uint uVar13;
  undefined4 local_res20 [2];
  undefined1 auStack_1e8 [32];
  undefined4 *local_1c8;
  undefined8 local_1c0;
  undefined **local_1b8;
  undefined **local_1b0;
  undefined **local_1a8;
  undefined **local_1a0;
  undefined4 *local_198;
  undefined **local_190;
  uint *local_188;
  undefined1 *local_180;
  undefined4 **local_178;
  undefined *local_168;
  undefined *local_160;
  undefined *local_158;
  undefined2 local_150 [4];
  undefined *local_148;
  undefined1 local_140;
  uint local_138;
  undefined4 local_134;
  undefined8 local_130;
  undefined1 local_128;
  undefined4 *local_120;
  undefined4 *local_118;
  undefined4 *local_110;
  undefined8 local_100;
  undefined4 local_f8;
  undefined4 uStack_f4;
  undefined4 uStack_f0;
  undefined4 uStack_ec;
  undefined2 local_e4;
  undefined2 local_e2;
  undefined4 local_e0;
  undefined2 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined2 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined2 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined1 local_94;
  undefined1 local_93;
  undefined1 local_92;
  undefined4 local_90;
  undefined2 local_8c;
  undefined2 local_8a;
  undefined4 local_88;
  undefined2 local_7c;
  undefined2 local_64;
  undefined2 local_62;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  ulonglong local_48;
  
  local_100 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_1e8;
  local_res20[0] = param_4;
  local_134 = param_1;
  FUN_14000a170(&local_f8);
  if (param_3 == (undefined4 *)0x0) {
    local_120 = param_3;
    local_118 = param_3;
    local_110 = param_3;
    if (*(longlong *)(DAT_140607fd0 + 0x50) == 0) goto LAB_140009aa5;
    uVar13 = 0;
    local_160 = (undefined *)CONCAT44(local_160._4_4_,9);
    local_138 = uVar13;
    FUN_14034fe70();
    local_148 = PTR_DAT_1405d8010;
    uVar5 = FUN_14034fcf0(param_2);
    uVar12 = uVar13;
    if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) {
      uVar12 = *(uint *)(local_148 + -8);
    }
    uVar6 = uVar5;
    if ((((int)uVar5 <= (int)uVar12) && (uVar6 = uVar13, local_148 != (undefined *)0x0)) &&
       (local_148 != PTR_DAT_1405d8010)) {
      uVar6 = *(uint *)(local_148 + -8);
    }
    uVar12 = 1;
    if (1 < (int)uVar6) {
      uVar12 = uVar6;
    }
    uVar6 = uVar13;
    if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) {
      uVar6 = *(uint *)(local_148 + -8);
    }
    if ((int)uVar6 < (int)uVar12) {
      FUN_140002d30(&local_148);
    }
    FUN_140002e10(&local_148);
    puVar10 = local_148;
    if (local_148 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar10,param_2,uVar5);
    puVar10 = local_148;
    if (local_148 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1405d8010;
    }
    iVar3 = FUN_14034fcf0(puVar10);
    iVar11 = 0;
    if (0 < iVar3) {
      iVar11 = iVar3;
    }
    iVar3 = 0;
    if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) {
      iVar3 = *(int *)(local_148 + -8);
    }
    if ((iVar11 < iVar3) || (iVar11 = 0, local_148 == (undefined *)0x0)) {
LAB_140009719:
      if (((local_148 != PTR_DAT_1405d8010) && (local_148 != (undefined *)0x0)) &&
         ((int *)(local_148 + -8) != (int *)0x0)) {
        *(int *)(local_148 + -8) = iVar11;
        *(undefined2 *)(local_148 + (longlong)iVar11 * 2) = 0;
      }
    }
    else if (local_148 != PTR_DAT_1405d8010) {
      iVar11 = *(int *)(local_148 + -8);
      goto LAB_140009719;
    }
    FUN_14034fe70();
    local_168 = PTR_DAT_1405d8010;
    uVar5 = FUN_14034fcf0(param_7);
    uVar12 = uVar13;
    if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) {
      uVar12 = *(uint *)(local_168 + -8);
    }
    uVar6 = uVar5;
    if ((((int)uVar5 <= (int)uVar12) && (uVar6 = uVar13, local_168 != (undefined *)0x0)) &&
       (local_168 != PTR_DAT_1405d8010)) {
      uVar6 = *(uint *)(local_168 + -8);
    }
    uVar12 = 1;
    if (1 < (int)uVar6) {
      uVar12 = uVar6;
    }
    uVar6 = uVar13;
    if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) {
      uVar6 = *(uint *)(local_168 + -8);
    }
    if ((int)uVar6 < (int)uVar12) {
      FUN_140002d30(&local_168);
    }
    FUN_140002e10(&local_168);
    puVar10 = local_168;
    if (local_168 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar10,param_7,uVar5);
    puVar10 = local_168;
    if (local_168 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1405d8010;
    }
    iVar3 = FUN_14034fcf0(puVar10);
    iVar11 = 0;
    if (0 < iVar3) {
      iVar11 = iVar3;
    }
    iVar3 = 0;
    if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) {
      iVar3 = *(int *)(local_168 + -8);
    }
    if ((iVar11 < iVar3) || (iVar11 = 0, local_168 == (undefined *)0x0)) {
LAB_14000980e:
      if (((local_168 != PTR_DAT_1405d8010) && (local_168 != (undefined *)0x0)) &&
         ((int *)(local_168 + -8) != (int *)0x0)) {
        *(int *)(local_168 + -8) = iVar11;
        *(undefined2 *)(local_168 + (longlong)iVar11 * 2) = 0;
      }
    }
    else if (local_168 != PTR_DAT_1405d8010) {
      iVar11 = *(int *)(local_168 + -8);
      goto LAB_14000980e;
    }
    FUN_14034fe70();
    local_158 = PTR_DAT_1405d8010;
    uVar5 = FUN_14034fcf0(param_7);
    uVar12 = uVar13;
    if ((local_158 != (undefined *)0x0) && (local_158 != PTR_DAT_1405d8010)) {
      uVar12 = *(uint *)(local_158 + -8);
    }
    uVar6 = uVar5;
    if ((((int)uVar5 <= (int)uVar12) && (uVar6 = uVar13, local_158 != (undefined *)0x0)) &&
       (local_158 != PTR_DAT_1405d8010)) {
      uVar6 = *(uint *)(local_158 + -8);
    }
    uVar12 = 1;
    if (1 < (int)uVar6) {
      uVar12 = uVar6;
    }
    uVar6 = uVar13;
    if ((local_158 != (undefined *)0x0) && (local_158 != PTR_DAT_1405d8010)) {
      uVar6 = *(uint *)(local_158 + -8);
    }
    if ((int)uVar6 < (int)uVar12) {
      FUN_140002d30(&local_158);
    }
    FUN_140002e10(&local_158);
    puVar10 = local_158;
    if (local_158 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar10,param_7,uVar5);
    puVar10 = local_158;
    if (local_158 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1405d8010;
    }
    uVar5 = FUN_14034fcf0(puVar10);
    uVar12 = uVar13;
    if (0 < (int)uVar5) {
      uVar12 = uVar5;
    }
    uVar5 = uVar13;
    if ((local_158 != (undefined *)0x0) && (local_158 != PTR_DAT_1405d8010)) {
      uVar5 = *(uint *)(local_158 + -8);
    }
    if (((int)uVar12 < (int)uVar5) || (uVar12 = uVar13, local_158 == (undefined *)0x0)) {
LAB_140009903:
      if (((local_158 != PTR_DAT_1405d8010) && (local_158 != (undefined *)0x0)) &&
         ((uint *)(local_158 + -8) != (uint *)0x0)) {
        *(uint *)(local_158 + -8) = uVar12;
        *(undefined2 *)(local_158 + (longlong)(int)uVar12 * 2) = 0;
      }
    }
    else if (local_158 != PTR_DAT_1405d8010) {
      uVar12 = *(uint *)(local_158 + -8);
      goto LAB_140009903;
    }
    local_150[0] = 0;
    plVar9 = (longlong *)(**(longlong **)(*(longlong *)(DAT_140607fd0 + 0x50) + 8) + 0x70);
    local_178 = &local_120;
    local_180 = &stack0x00000040;
    local_188 = &local_138;
    local_190 = &local_160;
    local_198 = local_res20;
    local_1a0 = &local_148;
    local_1a8 = &local_168;
    local_1b0 = &local_158;
    local_1b8 = (undefined **)param_6;
    local_1c0 = param_5;
    local_1c8 = &local_134;
    (**(code **)(*plVar9 + 0x330))(plVar9,1,&DAT_1405d85a0,local_150);
    puVar10 = local_158;
    if (((local_158 != (undefined *)0x0) && (local_158 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_158 + -8, puVar1 != (undefined *)0x0)) {
      uVar8 = FUN_14034fe70();
      local_130 = uVar8;
      FUN_14034ed40(uVar8);
      local_128 = 1;
      piVar2 = (int *)(puVar10 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar8);
    }
    puVar10 = local_168;
    local_158 = PTR_DAT_1405d8010;
    if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_168 + -8, puVar1 != (undefined *)0x0)) {
      uVar8 = FUN_14034fe70();
      local_130 = uVar8;
      FUN_14034ed40(uVar8);
      local_128 = 1;
      piVar2 = (int *)(puVar10 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar8);
    }
    puVar10 = local_148;
    local_168 = PTR_DAT_1405d8010;
    if (((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_148 + -8, puVar1 != (undefined *)0x0)) {
      uVar8 = FUN_14034fe70();
      local_130 = uVar8;
      FUN_14034ed40(uVar8);
      local_128 = 1;
      piVar2 = (int *)(puVar10 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar8);
    }
LAB_140009aa5:
    if (local_120 == (undefined4 *)0x0) {
      return;
    }
    operator_delete(local_120);
    return;
  }
  local_e4 = *(undefined2 *)(param_3 + 5);
  local_e2 = *(undefined2 *)((longlong)param_3 + 0x16);
  local_f8 = *param_3;
  uStack_f4 = param_3[1];
  uStack_f0 = param_3[2];
  uStack_ec = param_3[3];
  local_e0 = param_3[6];
  local_dc = *(undefined2 *)(param_3 + 7);
  local_d8 = param_3[8];
  local_d4 = param_3[9];
  local_d0 = *(undefined2 *)(param_3 + 10);
  local_c8 = param_3[0xc];
  local_c4 = param_3[0xd];
  local_c0 = param_3[0xe];
  local_bc = param_3[0xf];
  local_b8 = param_3[0x10];
  local_b4 = param_3[0x11];
  local_cc = param_3[0xb];
  local_b0 = *(undefined2 *)(param_3 + 0x12);
  local_ac = param_3[0x13];
  local_a8 = param_3[0x14];
  local_a4 = param_3[0x15];
  local_a0 = param_3[0x16];
  local_9c = param_3[0x17];
  local_98 = param_3[0x18];
  local_94 = *(undefined1 *)(param_3 + 0x19);
  local_93 = *(undefined1 *)((longlong)param_3 + 0x65);
  local_92 = *(undefined1 *)((longlong)param_3 + 0x66);
  local_8c = *(undefined2 *)(param_3 + 0x1b);
  local_8a = *(undefined2 *)((longlong)param_3 + 0x6e);
  local_88 = param_3[0x1c];
  local_7c = *(undefined2 *)(param_3 + 0x1f);
  local_64 = *(undefined2 *)(param_3 + 0x25);
  local_62 = *(undefined2 *)((longlong)param_3 + 0x96);
  local_60 = param_3[0x26];
  local_5c = param_3[0x27];
  local_58 = param_3[0x28];
  local_90 = param_3[0x1a];
  if (*(longlong *)(DAT_140607fd0 + 0x50) == 0) {
    return;
  }
  FUN_14034fe70();
  local_168 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_2);
  iVar11 = 0;
  if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) {
    iVar11 = *(int *)(local_168 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar11) && (iVar4 = 0, local_168 != (undefined *)0x0)) &&
     (local_168 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_168 + -8);
  }
  iVar11 = 1;
  if (1 < iVar4) {
    iVar11 = iVar4;
  }
  iVar4 = 0;
  if ((local_168 != (undefined *)0x0) && (iVar4 = 0, local_168 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_168 + -8);
  }
  if (iVar4 < iVar11) {
    FUN_140002d30(&local_168);
  }
  FUN_140002e10(&local_168);
  puVar10 = local_168;
  if (local_168 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,param_2,iVar3);
  puVar10 = local_168;
  if (local_168 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar10);
  iVar11 = 0;
  if (0 < iVar3) {
    iVar11 = iVar3;
  }
  iVar3 = 0;
  if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_168 + -8);
  }
  if ((iVar11 < iVar3) || (iVar11 = 0, local_168 == (undefined *)0x0)) {
LAB_1400093fb:
    if (((local_168 != PTR_DAT_1405d8010) && (local_168 != (undefined *)0x0)) &&
       ((int *)(local_168 + -8) != (int *)0x0)) {
      *(int *)(local_168 + -8) = iVar11;
      *(undefined2 *)(local_168 + (longlong)iVar11 * 2) = 0;
    }
  }
  else if (local_168 != PTR_DAT_1405d8010) {
    iVar11 = *(int *)(local_168 + -8);
    goto LAB_1400093fb;
  }
  FUN_14034fe70();
  local_160 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_7);
  iVar11 = 0;
  if ((local_160 != (undefined *)0x0) && (iVar11 = 0, local_160 != PTR_DAT_1405d8010)) {
    iVar11 = *(int *)(local_160 + -8);
  }
  iVar4 = iVar3;
  if (iVar3 <= iVar11) {
    iVar4 = 0;
    if ((local_160 != (undefined *)0x0) && (iVar4 = 0, local_160 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(local_160 + -8);
    }
  }
  iVar11 = 1;
  if (1 < iVar4) {
    iVar11 = iVar4;
  }
  iVar4 = 0;
  if ((local_160 != (undefined *)0x0) && (iVar4 = 0, local_160 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_160 + -8);
  }
  if (iVar4 < iVar11) {
    FUN_140002d30(&local_160);
  }
  FUN_140002e10(&local_160);
  puVar10 = local_160;
  if (local_160 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,param_7,iVar3);
  puVar10 = local_160;
  if (local_160 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar10);
  iVar11 = 0;
  if (0 < iVar3) {
    iVar11 = iVar3;
  }
  iVar3 = 0;
  if ((local_160 != (undefined *)0x0) && (iVar3 = 0, local_160 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_160 + -8);
  }
  if ((iVar3 <= iVar11) && (iVar11 = 0, local_160 != (undefined *)0x0)) {
    if (local_160 == PTR_DAT_1405d8010) goto LAB_14000950d;
    iVar11 = *(int *)(local_160 + -8);
  }
  if (((local_160 != PTR_DAT_1405d8010) && (local_160 != (undefined *)0x0)) &&
     ((int *)(local_160 + -8) != (int *)0x0)) {
    *(int *)(local_160 + -8) = iVar11;
    *(undefined2 *)(local_160 + (longlong)iVar11 * 2) = 0;
  }
LAB_14000950d:
  plVar9 = (longlong *)(**(longlong **)(*(longlong *)(DAT_140607fd0 + 0x50) + 8) + 0x70);
  local_1a8 = (undefined **)&stack0x00000040;
  local_1b0 = &local_168;
  local_1b8 = &local_160;
  local_1c0 = param_6;
  local_1c8 = local_res20;
  (**(code **)(*plVar9 + 0x6a0))(plVar9,1,&DAT_1405d85a0,&local_f8);
  puVar10 = local_160;
  if (((local_160 != (undefined *)0x0) && (local_160 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_160 + -8, puVar1 != (undefined *)0x0)) {
    puVar7 = (undefined *)FUN_14034fe70();
    local_148 = puVar7;
    FUN_14034ed40(puVar7);
    local_140 = 1;
    piVar2 = (int *)(puVar10 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(puVar7);
  }
  puVar10 = local_168;
  if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_168 + -8, puVar1 != (undefined *)0x0)) {
    local_160 = PTR_DAT_1405d8010;
    puVar7 = (undefined *)FUN_14034fe70();
    local_148 = puVar7;
    FUN_14034ed40(puVar7);
    local_140 = 1;
    piVar2 = (int *)(puVar10 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(puVar7);
  }
  return;
}



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

int FUN_140009ae0(longlong param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  int iVar3;
  int iVar4;
  bool bVar5;
  
  iVar4 = 0;
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  while (puVar2 = puVar1, puVar2 != (undefined8 *)0x0) {
    puVar1 = (undefined8 *)*puVar2;
    if ((*(char *)(puVar2 + 1) == '\x01') &&
       ((-1 < *(int *)((longlong)puVar2 + 0xc) || (*(int *)((longlong)puVar2 + 0xc) < 5000000)))) {
      bVar5 = (ulonglong)puVar2[0x18] < *param_2;
      if ((puVar2[0x18] == *param_2) &&
         (bVar5 = (ulonglong)puVar2[0x19] < param_2[1], puVar2[0x19] == param_2[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
      }
      if (iVar3 == 0) {
        iVar4 = iVar4 + 1;
      }
    }
  }
  return iVar4;
}



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

int FUN_140009b90(longlong param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  int iVar3;
  int iVar4;
  bool bVar5;
  
  iVar4 = 0;
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  while (puVar2 = puVar1, puVar2 != (undefined8 *)0x0) {
    puVar1 = (undefined8 *)*puVar2;
    if ((*(char *)(puVar2 + 1) == '\x01') &&
       ((-1 < *(int *)((longlong)puVar2 + 0xc) || (*(int *)((longlong)puVar2 + 0xc) < 5000000)))) {
      bVar5 = (ulonglong)puVar2[0x23] < *param_2;
      if ((puVar2[0x23] == *param_2) &&
         (bVar5 = (ulonglong)puVar2[0x24] < param_2[1], puVar2[0x24] == param_2[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
      }
      if (iVar3 == 0) {
        iVar4 = iVar4 + 1;
      }
    }
  }
  return iVar4;
}



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

longlong FUN_140009c40(void)

{
  undefined1 auStack_48 [32];
  _FILETIME local_28;
  _SYSTEMTIME local_20;
  ulonglong local_10;
  
  local_10 = DAT_1405d84f0 ^ (ulonglong)auStack_48;
  GetLocalTime(&local_20);
  SystemTimeToFileTime(&local_20,&local_28);
  return (longlong)local_28 / 600000000;
}



int FUN_140009cb0(longlong param_1)

{
  int *piVar1;
  double dVar2;
  int local_res8 [2];
  int local_res10 [6];
  
  dVar2 = 0.0;
  if (*(longlong *)(param_1 + 0x10) != 0) {
    dVar2 = (double)*(int *)(*(longlong *)(param_1 + 0x10) + 0x170) * 0.1;
    if (1 < *(short *)(param_1 + 0x34)) {
      dVar2 = dVar2 * (double)(int)*(short *)(param_1 + 0x34);
    }
  }
  local_res8[0] = 1;
  local_res10[0] = (int)((((double)*(int *)(param_1 + 0x14c) * 0.75) / 24.0) * dVar2);
  piVar1 = local_res8;
  if (0 < local_res10[0]) {
    piVar1 = local_res10;
  }
  return *piVar1;
}



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

void FUN_140009d30(longlong param_1,longlong param_2,uint param_3,int param_4,undefined4 *param_5,
                  undefined4 *param_6,wchar_t *param_7,wchar_t *param_8,int param_9)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  byte *pbVar4;
  longlong lVar5;
  double dVar6;
  undefined1 auStack_1a8 [32];
  uint *local_188;
  uint local_178 [2];
  wchar_t *local_170;
  longlong local_168;
  uint local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  wchar_t local_130 [5];
  undefined4 local_126 [5];
  undefined1 local_110 [4];
  undefined4 local_10c;
  undefined4 local_108;
  undefined1 local_104 [4];
  undefined4 local_100;
  undefined4 local_fc;
  undefined1 local_f8 [4];
  uint local_f4;
  undefined1 local_f0;
  undefined1 local_ef;
  undefined4 local_ee;
  int local_ae;
  undefined4 local_aa;
  undefined4 local_a6;
  undefined4 local_a2;
  int local_9e;
  int local_9a;
  undefined4 local_96;
  undefined8 local_92;
  int local_8a;
  wchar_t local_86 [16];
  int local_66;
  ulonglong local_58;
  
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_1a8;
  local_170 = param_7;
  local_178[0] = param_3;
  local_168 = param_1;
  memset(&local_158,0,0xf6);
  puVar1 = (undefined4 *)(param_2 + 0x18);
  if (puVar1 != (undefined4 *)0x0) {
    local_110 = (undefined1  [4])*puVar1;
    local_10c = *(undefined4 *)(param_2 + 0x1c);
    local_108 = *(undefined4 *)(param_2 + 0x20);
    local_104 = *(undefined1 (*) [4])(param_2 + 0x24);
    local_100 = *(undefined4 *)(param_2 + 0x30);
    local_fc = *(undefined4 *)(param_2 + 0x44);
    local_f8 = (undefined1  [4])(int)*(short *)(param_2 + 0x40);
    local_f4 = (uint)*(ushort *)(param_2 + 0x94);
    local_f0 = *(undefined1 *)(param_2 + 0x60);
    local_ef = *(undefined1 *)(param_2 + 0x84);
    local_ae = (int)*(short *)(param_2 + 0x34);
    local_aa = *(undefined4 *)(param_2 + 0x104);
    local_a2 = *(undefined4 *)(param_2 + 0x100);
    local_96 = *(undefined4 *)(param_2 + 0x14c);
    local_ee = *(undefined4 *)(param_2 + 0x3c);
    lVar5 = 3;
    puVar2 = (undefined4 *)(param_2 + 0x54);
    pbVar4 = (byte *)(param_2 + 0x7c);
    do {
      puVar3 = puVar2 + 1;
      lVar5 = lVar5 + -1;
      *(undefined4 *)((longlong)local_130 + (6 - (longlong)puVar1) + (longlong)puVar3) = puVar2[-3];
      *(undefined4 *)((longlong)local_126 + (8 - (longlong)puVar1) + (longlong)puVar3) = *puVar2;
      *(undefined4 *)(&stack0xfffffffffffffeee + -(longlong)puVar1 + (longlong)puVar3) = puVar2[4];
      *(undefined4 *)((longlong)&local_108 + (2 - (longlong)puVar1) + (longlong)puVar3) = puVar2[7];
      *(uint *)((longlong)&local_fc + (2 - (longlong)puVar1) + (longlong)puVar3) = (uint)*pbVar4;
      puVar2 = puVar3;
      pbVar4 = pbVar4 + 1;
      param_1 = local_168;
      param_7 = local_170;
    } while (lVar5 != 0);
  }
  local_154 = *(undefined4 *)(DAT_140608000 + 0x140);
  local_a6 = *(undefined4 *)(param_2 + 0x148);
  local_9e = FUN_140009cb0(param_2);
  local_150 = *param_5;
  local_92 = 0;
  local_14c = param_5[1];
  local_158 = local_178[0];
  local_144 = param_5[3];
  local_140 = *param_6;
  local_148 = param_5[2];
  local_13c = param_6[1];
  local_138 = param_6[2];
  local_134 = param_6[3];
  local_66 = param_4;
  if (param_7 != (wchar_t *)0x0) {
    wcscpy_s(local_130,0x10,param_7);
  }
  if (0 < param_9) {
    local_8a = param_9;
  }
  if (param_4 == 0x15) {
    local_8a = *(int *)(param_2 + 0x148);
    dVar6 = (double)local_8a * *(double *)(param_1 + 0x28);
  }
  else {
    if (param_4 != 0x16) goto LAB_140009f7a;
    local_8a = *(int *)(param_2 + 0x100);
    dVar6 = (double)local_8a * *(double *)(param_1 + 0x20);
  }
  local_9a = (int)dVar6 - local_9e;
  local_8a = local_8a - local_9a;
LAB_140009f7a:
  if (param_8 != (wchar_t *)0x0) {
    wcscpy_s(local_86,0x10,param_8);
  }
  if (*(longlong *)(DAT_140607fd0 + 0x58) != 0) {
    local_188 = &local_158;
    local_178[0] = local_178[0] & 0xffff0000;
    lVar5 = **(longlong **)(*(longlong *)(DAT_140607fd0 + 0x58) + 8);
    (**(code **)(*(longlong *)(lVar5 + 0x70) + 0xd70))(lVar5 + 0x70,1,&DAT_1405d85a0,local_178);
  }
  return;
}



void FUN_14000a000(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 (0xffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 8) < 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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14000a110(*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 * 0x100);
    param_1[1] = (longlong)(pcVar4 + (lVar2 - (longlong)pvVar1 & 0xffffffffffffff00));
    *param_1 = (longlong)pcVar4;
  }
  return;
}



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

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



undefined4 * FUN_14000a170(undefined4 *param_1)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  lVar2 = 0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[4] = 0;
  param_1[3] = 0;
  param_1[6] = 0;
  *(undefined2 *)(param_1 + 5) = 0xffff;
  *(undefined2 *)((longlong)param_1 + 0x16) = 0xffff;
  *(undefined2 *)(param_1 + 7) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 10) = 0;
  param_1[0xb] = 0;
  *(undefined2 *)(param_1 + 0x12) = 0;
  *(undefined8 *)(param_1 + 0x1a) = 0;
  param_1[0x1c] = 0;
  *(undefined2 *)(param_1 + 0x1f) = 0;
  param_1[0x20] = 0;
  param_1[0x21] = 0;
  param_1[0x22] = 0;
  param_1[0x24] = 0;
  param_1[0x23] = 0;
  *(undefined8 *)(param_1 + 0x26) = 0;
  *(undefined2 *)(param_1 + 0x25) = 1;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined2 *)((longlong)param_1 + 0x96) = 3;
  puVar1 = param_1 + 0xf;
  do {
    puVar1[-3] = 0;
    *puVar1 = 0;
    *(undefined1 *)((longlong)param_1 + lVar2 + 100) = 0;
    lVar2 = lVar2 + 1;
    puVar1[4] = 0;
    puVar1[7] = 0;
    puVar1 = puVar1 + 1;
  } while (lVar2 < 3);
  *(undefined8 *)(param_1 + 0x1d) = 0;
  return param_1;
}



longlong FUN_14000a270(longlong param_1)

{
  FUN_14000a170();
  *(undefined8 *)(param_1 + 0xcc) = 0;
  *(undefined8 *)(param_1 + 0xf4) = 0;
  *(undefined4 *)(param_1 + 0xa8) = 0;
  *(undefined4 *)(param_1 + 0xfc) = 0;
  *(undefined8 *)(param_1 + 0xac) = 0;
  *(undefined8 *)(param_1 + 0xb4) = 0;
  *(undefined8 *)(param_1 + 0xbc) = 0;
  *(undefined8 *)(param_1 + 0xc4) = 0;
  *(undefined8 *)(param_1 + 0xd4) = 0;
  *(undefined8 *)(param_1 + 0xdc) = 0;
  *(undefined8 *)(param_1 + 0xe4) = 0;
  *(undefined8 *)(param_1 + 0xec) = 0;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014000a443)
// WARNING: Removing unreachable block (ram,0x00014000a44c)
// WARNING: Removing unreachable block (ram,0x00014000a46d)
// WARNING: Removing unreachable block (ram,0x00014000a476)

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

{
  undefined4 uVar1;
  
  FUN_14016e420(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  param_1[0x134] = Proud::INetServerEvent::vftable;
  FUN_140388e70(param_1 + 0x135);
  *param_1 = MagiAuctionNetwork::vftable;
  param_1[0x58] = MagiAuctionNetwork::vftable;
  param_1[0x5c] = MagiAuctionNetwork::vftable;
  param_1[0x60] = MagiAuctionNetwork::vftable;
  param_1[100] = MagiAuctionNetwork::vftable;
  param_1[0x68] = MagiAuctionNetwork::vftable;
  param_1[0x134] = MagiAuctionNetwork::vftable;
  param_1[0x135] = MagiAuctionNetwork::vftable;
  FUN_140385af0();
  param_1[0x139] = AUCTION2SERVERS_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x9dc) != 1) {
    FUN_14034fa20();
  }
  param_1[0x139] = RNP::Auction2ServersProxy::vftable;
  *(undefined1 *)(param_1 + 0x13c) = 0;
  *(undefined1 *)(param_1 + 0x13d) = 0;
  param_1[0x147] = 0;
  param_1[0x13e] = 0;
  param_1[0x13f] = 0;
  param_1[0x140] = 0;
  *(undefined4 *)(param_1 + 0x142) = 0x11;
  param_1[0x141] = 0;
  *(undefined4 *)(param_1 + 0x146) = 0;
  *(undefined4 *)((longlong)param_1 + 0xa14) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x143) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xa1c) = 0x40100000;
  param_1[0x144] = 0x26;
  param_1[0x145] = 0;
  param_1[0x148] = 1;
  *(undefined8 *)((longlong)param_1 + 0xa4c) = 0;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x14b,uVar1,1);
  return param_1;
}



void * FUN_14000a4d0(void *param_1,uint param_2)

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



void FUN_14000a500(undefined8 *param_1)

{
  *param_1 = MagiAuctionNetwork::vftable;
  param_1[0x58] = MagiAuctionNetwork::vftable;
  param_1[0x5c] = MagiAuctionNetwork::vftable;
  param_1[0x60] = MagiAuctionNetwork::vftable;
  param_1[100] = MagiAuctionNetwork::vftable;
  param_1[0x68] = MagiAuctionNetwork::vftable;
  param_1[0x134] = MagiAuctionNetwork::vftable;
  param_1[0x135] = MagiAuctionNetwork::vftable;
  FUN_14000a890();
  FUN_14034edf0(param_1 + 0x14b);
  FUN_14000c870(param_1 + 0x13d);
  param_1[0x139] = RNP::Auction2ServersProxy::vftable;
  FUN_140385b20();
  param_1[0x135] = RNP::Servers2AuctionStub::vftable;
  FUN_140388ea0(param_1 + 0x135);
  param_1[0x134] = Proud::INetServerEvent::vftable;
  FUN_14035b3e0(param_1 + 0x134);
  FUN_14016ec80(param_1);
  return;
}



void FUN_14000a610(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_14035bff0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_140005600(L"OnError MagiAuctionServer : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar3);
  }
  return;
}



void FUN_14000a6b0(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_14035bff0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_140005600(L"OnWarning MagiAuctionServer : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar3);
  }
  return;
}



void FUN_14000a750(undefined8 param_1,longlong *param_2)

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



void FUN_14000a770(longlong param_1)

{
  longlong lVar1;
  DWORD DVar2;
  void *pvVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  
  pvVar3 = operator_new(0x18);
  if (pvVar3 == (void *)0x0) {
    plVar4 = (longlong *)0x0;
  }
  else {
    plVar4 = (longlong *)FUN_1404162b0(pvVar3);
  }
  lVar1 = DAT_140607ff8;
  puVar5 = *(undefined8 **)(DAT_140607ff8 + 0x10);
  if (puVar5 != (undefined8 *)0x0) {
    (**(code **)*puVar5)(puVar5,1);
  }
  *(longlong **)(lVar1 + 0x10) = plVar4;
  if (plVar4 != (longlong *)0x0) {
    uVar6 = (**(code **)(*plVar4 + 8))(plVar4);
    *(undefined8 *)(lVar1 + 0x30) = uVar6;
    *(undefined8 *)(lVar1 + 0x38) = uVar6;
  }
  *(undefined8 *)(lVar1 + 0x90) = 0x3ff0000000000000;
  DVar2 = timeGetTime();
  *(uint *)(param_1 + 0xa48) = DVar2 / 1000;
  plVar4 = (longlong *)FUN_14037bff0();
  *(longlong **)(param_1 + 0x18) = plVar4;
  (**(code **)(*plVar4 + 0x10))(plVar4,param_1 + 0x9a8);
  (**(code **)(**(longlong **)(param_1 + 0x18) + 8))(*(longlong **)(param_1 + 0x18),param_1 + 0x9c8)
  ;
  (**(code **)(**(longlong **)(param_1 + 0x18) + 0x130))
            (*(longlong **)(param_1 + 0x18),param_1 + 0x9a0);
  puVar5 = (undefined8 *)(DAT_140608000 + 0x30);
  if (7 < *(ulonglong *)(DAT_140608000 + 0x48)) {
    puVar5 = (undefined8 *)*puVar5;
  }
  FUN_14000d470(param_1 + 0x20,puVar5);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(DAT_140608000 + 0x80);
  FUN_14012bcf0(param_1 + 0x18);
  return;
}



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

{
  longlong lVar1;
  void *pvVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong lVar7;
  undefined1 uVar8;
  
  uVar6 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0xa58;
  lVar7 = lVar1;
  FUN_14034ed40(lVar1);
  uVar8 = 1;
  lVar4 = 0;
  if (*(longlong *)(param_1 + 0xa08) != 0) {
    lVar4 = *(longlong *)(param_1 + 0x9f8);
  }
  while( true ) {
    if (lVar4 == 0) {
      FUN_14000c890(param_1 + 0x9e8);
      puVar3 = *(undefined8 **)(param_1 + 0x18);
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1,param_3,param_4,uVar6,lVar7,uVar8);
      }
      *(undefined8 *)(param_1 + 0x18) = 0;
      FUN_14034edd0(lVar1);
      return;
    }
    if (lVar4 == 0) break;
    lVar5 = 0;
    if (lVar4 != 0) {
      lVar5 = *(longlong *)(lVar4 + 0x10);
    }
    pvVar2 = *(void **)(lVar4 + 8);
    lVar4 = lVar5;
    if (pvVar2 != (void *)0x0) {
      if (7 < *(ulonglong *)((longlong)pvVar2 + 0x20)) {
        operator_delete(*(void **)((longlong)pvVar2 + 8));
      }
      *(undefined8 *)((longlong)pvVar2 + 0x20) = 7;
      *(undefined8 *)((longlong)pvVar2 + 0x18) = 0;
      *(undefined2 *)((longlong)pvVar2 + 8) = 0;
      operator_delete(pvVar2);
    }
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_14000a9a0(longlong param_1,uint *param_2)

{
  ulonglong uVar1;
  uint *puVar2;
  
  uVar1 = (ulonglong)*param_2 % (ulonglong)*(uint *)(param_1 + 0xa10);
  if ((*(longlong *)(param_1 + 0x9f0) != 0) &&
     (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x9f0) + uVar1 * 8), puVar2 != (uint *)0x0)) {
    while ((uint)uVar1 == puVar2[8] % *(uint *)(param_1 + 0xa10)) {
      if (*puVar2 == *param_2) {
        FUN_14000c9c0(param_1 + 0x9e8,puVar2);
        break;
      }
      puVar2 = *(uint **)(puVar2 + 4);
      if (puVar2 == (uint *)0x0) {
        *(undefined4 *)(param_1 + 0xa4c) = *(undefined4 *)(param_1 + 0xa08);
        return;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa4c) = *(undefined4 *)(param_1 + 0xa08);
  return;
}



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

{
  int *piVar1;
  longlong lVar2;
  uint uVar3;
  undefined4 *puVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  undefined *puVar7;
  undefined *local_res8;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  puVar4 = operator_new(0x30);
  if (puVar4 != (undefined4 *)0x0) {
    *puVar4 = 0;
    *(undefined8 *)(puVar4 + 8) = 7;
    *(undefined8 *)(puVar4 + 6) = 0;
    *(undefined2 *)(puVar4 + 2) = 0;
  }
  *puVar4 = *(undefined4 *)(param_2 + 6);
  lVar2 = param_1 + 0xb8;
  lVar9 = lVar2;
  FUN_14034ed40(lVar2);
  uVar10 = 1;
  plVar5 = (longlong *)(**(code **)*param_2)(param_2,&local_res8);
  puVar7 = (undefined *)*plVar5;
  if ((undefined *)*plVar5 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  FUN_1400050f0(L"New Server : HostID:[%d][%s]",*puVar4,puVar7,param_4,uVar8,lVar9,uVar10);
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (local_res8 + -8 != (undefined *)0x0)) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    piVar1 = (int *)(local_res8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res8 + -8);
    }
    FUN_14034edd0(uVar8);
  }
  puVar6 = (undefined8 *)FUN_14000c7b0(param_1 + 0x48,puVar4);
  *puVar6 = puVar4;
  FUN_14034edd0(lVar2);
  uVar3 = (uint)*(undefined8 *)(param_1 + 0x68);
  *(uint *)(param_1 + 0xac) = uVar3;
  if (*(uint *)(param_1 + 0xa4) < uVar3) {
    *(uint *)(param_1 + 0xa4) = uVar3;
  }
  return;
}



void FUN_14000ab50(longlong param_1,longlong param_2)

{
  void *pvVar1;
  ulonglong uVar2;
  uint *puVar3;
  
  FUN_14034ed40(param_1 + 0xb8);
  uVar2 = (ulonglong)*(uint *)(param_2 + 0x30) % (ulonglong)*(uint *)(param_1 + 0x70);
  if ((*(longlong *)(param_1 + 0x50) != 0) &&
     (puVar3 = *(uint **)(*(longlong *)(param_1 + 0x50) + uVar2 * 8), puVar3 != (uint *)0x0)) {
    while ((uint)uVar2 == puVar3[8] % *(uint *)(param_1 + 0x70)) {
      if (*puVar3 == *(uint *)(param_2 + 0x30)) {
        pvVar1 = *(void **)(puVar3 + 2);
        if (pvVar1 != (void *)0x0) {
          FUN_14000a9a0(param_1 + -0x9a0,pvVar1);
          if (7 < *(ulonglong *)((longlong)pvVar1 + 0x20)) {
            operator_delete(*(void **)((longlong)pvVar1 + 8));
          }
          *(undefined8 *)((longlong)pvVar1 + 0x20) = 7;
          *(undefined8 *)((longlong)pvVar1 + 0x18) = 0;
          *(undefined2 *)((longlong)pvVar1 + 8) = 0;
          operator_delete(pvVar1);
        }
        break;
      }
      puVar3 = *(uint **)(puVar3 + 4);
      if (puVar3 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(param_1 + 0xb8);
  return;
}



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

{
  longlong lVar1;
  undefined4 uVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  int iVar7;
  longlong lVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  undefined8 uVar11;
  longlong lVar12;
  undefined1 uVar13;
  
  uVar11 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0xa58;
  lVar12 = lVar1;
  FUN_14034ed40(lVar1);
  uVar13 = 1;
  if (*(longlong *)(param_1 + 0xa08) == 0) {
    puVar9 = (undefined4 *)0x0;
  }
  else {
    puVar9 = *(undefined4 **)(param_1 + 0x9f8);
  }
  while( true ) {
    if (puVar9 == (undefined4 *)0x0) {
      FUN_14034edd0(lVar1);
      return;
    }
    if (puVar9 == (undefined4 *)0x0) break;
    puVar10 = (undefined4 *)0x0;
    if (puVar9 != (undefined4 *)0x0) {
      puVar10 = *(undefined4 **)(puVar9 + 4);
    }
    uVar2 = *puVar9;
    iVar3 = *(int *)(param_2 + 0x18);
    if (iVar3 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    iVar7 = *(int *)(param_2 + 0x18);
    FUN_14012c550(param_2,iVar7 + 1,param_3,param_4,uVar11,lVar12,uVar13);
    iVar7 = iVar7 - iVar3;
    if ((0 < iVar7) && (iVar7 = iVar7 + -1, lVar8 = (longlong)iVar7, -1 < iVar7)) {
      lVar6 = (lVar8 + iVar3) * 4 + 4;
      do {
        lVar4 = FUN_14012c6a0(param_2);
        lVar5 = FUN_14012c6a0(param_2);
        *(undefined4 *)(lVar5 + lVar6) = *(undefined4 *)(lVar4 + -4 + lVar6);
        lVar6 = lVar6 + -4;
        lVar8 = lVar8 + -1;
      } while (-1 < lVar8);
    }
    lVar8 = FUN_14012c6a0(param_2);
    *(undefined4 *)(lVar8 + (longlong)iVar3 * 4) = uVar2;
    puVar9 = puVar10;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



undefined8
FUN_14000ad70(longlong param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             void *param_5,int *param_6)

{
  uint uVar1;
  int *piVar2;
  int iVar3;
  undefined4 uVar4;
  char *pcVar5;
  longlong lVar6;
  undefined8 uVar7;
  uint *puVar8;
  longlong lVar9;
  uint *puVar10;
  uint *puVar11;
  uint *puVar12;
  double dVar13;
  undefined8 in_stack_ffffffffffffff50;
  int local_98;
  uint local_94;
  undefined4 local_90;
  uint local_8c;
  char *local_88;
  DWORD local_80;
  longlong local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 uStack_60;
  undefined8 local_58;
  undefined8 uStack_50;
  longlong local_48;
  undefined1 local_40;
  
  uVar4 = (undefined4)((ulonglong)in_stack_ffffffffffffff50 >> 0x20);
  local_70 = 0xfffffffffffffffe;
  local_88 = "S2A_Register_AuctionItem";
  local_78 = **(longlong **)(*(longlong *)(param_1 + -0x4e0) + 8) + 0x70;
  local_90 = param_2;
  local_80 = timeGetTime();
  local_48 = param_1 + 0xb0;
  FUN_14034ed40(local_48);
  local_40 = 1;
  local_98 = 0xe0;
  piVar2 = *(int **)(DAT_140607fd0 + 0x48);
  puVar12 = (uint *)0x0;
  pcVar5 = (char *)(*(longlong *)(piVar2 + 2) + 8);
  puVar8 = puVar12;
  puVar10 = puVar12;
  do {
    if (*pcVar5 == '\0') {
      lVar9 = (longlong)(int)puVar10 * 0x158;
      *(undefined1 *)(lVar9 + 8 + *(longlong *)(piVar2 + 2)) = 1;
      puVar11 = (uint *)(lVar9 + *(longlong *)(piVar2 + 2));
      if (puVar11 != (uint *)0x0) {
        *(undefined8 *)puVar11 = *(undefined8 *)(piVar2 + 4);
        *(uint **)(piVar2 + 4) = puVar11;
        *piVar2 = *piVar2 + 1;
      }
      break;
    }
    puVar10 = (uint *)(ulonglong)((int)puVar10 + 1);
    puVar8 = (uint *)((longlong)puVar8 + 1);
    pcVar5 = pcVar5 + 0x158;
    puVar11 = puVar12;
  } while ((longlong)puVar8 < 5000000);
  uVar1 = *(uint *)((longlong)param_5 + 0x18);
  lVar6 = FUN_140137690();
  lVar9 = DAT_140607fd0;
  puVar8 = puVar12;
  if (*(longlong *)(lVar6 + 0x88) != 0) {
    for (puVar10 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                             ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar6 + 0x98)) * 8);
        puVar10 != (uint *)0x0; puVar10 = *(uint **)(puVar10 + 0xa6)) {
      if ((puVar10[0xa8] == uVar1) && (*puVar10 == uVar1)) {
        if (puVar10 != (uint *)0x0) {
          if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          puVar8 = puVar10 + 2;
        }
        break;
      }
    }
  }
  iVar3 = FUN_140009ae0(*(undefined8 *)(DAT_140607fd0 + 0x48),(longlong)param_5 + 0xa8);
  if (*param_6 + 5 <= iVar3) {
    local_98 = 0xd7;
  }
  if (puVar11 == (uint *)0x0) {
    local_98 = 0xd5;
  }
  if (puVar8 == (uint *)0x0) {
    local_98 = 0x19;
  }
  else if (local_98 == 0xe0) {
    if (puVar11 != (uint *)0x0) {
      uVar7 = FUN_140009c40();
      memcpy(puVar11 + 6,param_5,0x140);
      *(uint **)(puVar11 + 4) = puVar8;
      *(undefined8 *)(puVar11 + 0x54) = uVar7;
      FUN_14000d7b0(puVar11);
      lVar9 = DAT_140607fd0;
    }
    *(int *)(param_1 + 0xa8) = *(int *)(param_1 + 0xa8) + 1;
    if ((puVar11 != (uint *)0x0) && (puVar8 = puVar11 + 6, puVar8 != (uint *)0x0)) {
      local_58 = *(undefined8 *)(puVar11 + 0x30);
      uStack_50 = *(undefined8 *)(puVar11 + 0x32);
      local_68 = *(undefined8 *)(puVar11 + 0x34);
      uStack_60 = *(undefined8 *)(puVar11 + 0x36);
      uVar4 = FUN_140009cb0(puVar11);
      FUN_140009d30(*(undefined8 *)(lVar9 + 0x48),puVar11,0x1d6,1,&local_68,&local_58,puVar8 + 0x32,
                    0,uVar4);
    }
    goto LAB_14000b0c1;
  }
  if (puVar11 != (uint *)0x0) {
    FUN_140007a80(*(undefined8 *)(lVar9 + 0x48),puVar11[3]);
  }
  if (puVar8 != (uint *)0x0) {
    dVar13 = (double)(int)puVar8[0x5c] * 0.1;
    if (1 < *(short *)((longlong)param_5 + 0x1c)) {
      dVar13 = dVar13 * (double)(int)*(short *)((longlong)param_5 + 0x1c);
    }
    local_8c = 1;
    local_94 = (uint)(((double)*(int *)((longlong)param_5 + 0x134) * 0.75 * dVar13) / 24.0);
    puVar8 = &local_8c;
    if (0 < (int)local_94) {
      puVar8 = &local_94;
    }
    puVar12 = (uint *)(ulonglong)*puVar8;
  }
  FUN_1400091a0(*param_4,&DAT_140477960,param_5,puVar12,(longlong)param_5 + 0xb8,
                (longlong)param_5 + 0xa8,(longlong)param_5 + 200,CONCAT44(uVar4,0xb));
LAB_14000b0c1:
  (**(code **)(*(longlong *)(param_1 + 0x20) + 0x30))
            ((longlong *)(param_1 + 0x20),local_90,&DAT_1405d85a0,param_4,&local_98);
  FUN_14034edd0(param_1 + 0xb0);
  FUN_14004b970(&local_88);
  return 1;
}



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

{
  undefined *puVar1;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "S2A_Search_AuctionItem";
  local_10 = **(longlong **)(*(longlong *)(param_1 + -0x4e0) + 8) + 0x70;
  local_18 = timeGetTime();
  puVar1 = (undefined *)*param_14;
  if ((undefined *)*param_14 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8010;
  }
  FUN_140007ce0(*(undefined8 *)(DAT_140607fd0 + 0x48),param_2,*param_4,*param_5,*param_6,*param_7,
                *param_8,*param_9,*param_10,*param_11,*param_12,*param_13,puVar1);
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  undefined8 uVar1;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar1 = 0xfffffffffffffffe;
  local_20 = "S2A_Search_TypeList";
  local_10 = **(longlong **)(*(longlong *)(param_1 + -0x4e0) + 8) + 0x70;
  local_18 = timeGetTime();
  FUN_1400080b0(*(undefined8 *)(DAT_140607fd0 + 0x48),param_2,*param_4,*param_5,param_6,*param_7,
                uVar1);
  FUN_14004b970(&local_20);
  return 1;
}



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

undefined8
FUN_14000b2e0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,int *param_6,undefined8 param_7,int *param_8,undefined **param_9,
             longlong *param_10,undefined **param_11)

{
  undefined *puVar1;
  int *piVar2;
  undefined **ppuVar3;
  longlong lVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  longlong lVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  longlong lVar11;
  undefined *puVar12;
  longlong *plVar13;
  undefined8 *puVar14;
  undefined *puVar15;
  longlong lVar16;
  int iVar17;
  undefined4 *puVar18;
  bool bVar19;
  undefined1 auStack_1b8 [32];
  undefined **local_198;
  undefined **local_190;
  undefined **local_188;
  undefined **local_180;
  undefined4 *local_178;
  undefined4 *local_170;
  undefined4 local_168 [2];
  undefined *local_160;
  undefined4 local_158 [2];
  undefined4 local_150 [2];
  undefined **local_148;
  longlong *local_140;
  longlong local_138;
  ulonglong local_130;
  undefined8 local_128;
  undefined4 local_120;
  undefined4 *local_118;
  undefined *local_108;
  undefined *puStack_100;
  int *local_f8;
  longlong *local_f0;
  char *local_e8;
  DWORD local_e0;
  longlong local_d8;
  longlong local_d0;
  undefined1 local_c8;
  undefined8 local_c0;
  undefined *local_b8;
  undefined4 local_b0;
  undefined4 uStack_ac;
  undefined8 local_a8;
  undefined4 uStack_a0;
  undefined4 uStack_9c;
  undefined *local_98;
  undefined8 uStack_90;
  undefined2 local_88;
  undefined6 uStack_86;
  undefined2 uStack_80;
  undefined6 uStack_7e;
  undefined2 uStack_78;
  undefined6 local_76;
  undefined2 uStack_70;
  undefined6 local_6e;
  undefined2 uStack_68;
  undefined6 local_66;
  undefined2 uStack_60;
  undefined6 local_5e;
  undefined2 uStack_58;
  undefined6 local_56;
  undefined2 uStack_50;
  undefined2 uStack_4e;
  ulonglong local_48;
  
  local_c0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_1b8;
  local_f8 = param_8;
  local_f0 = param_10;
  local_e8 = "S2A_Buy_AuctionItem";
  local_d8 = **(longlong **)(*(longlong *)(param_1 + -0x4e0) + 8) + 0x70;
  local_120 = param_2;
  local_118 = param_4;
  local_e0 = timeGetTime();
  local_d0 = param_1 + 0xb0;
  FUN_14034ed40(local_d0);
  local_c8 = 1;
  lVar11 = FUN_140007b00(*(undefined8 *)(DAT_140607fd0 + 0x48),param_5);
  puVar18 = local_118;
  local_168[0] = 0xd2;
  if (((lVar11 != 0) && (*(char *)(lVar11 + 8) == '\x01')) &&
     ((-1 < *(int *)(lVar11 + 0xc) || (*(int *)(lVar11 + 0xc) < 5000000)))) {
    local_b8 = *(undefined **)(lVar11 + 0xc0);
    local_b0 = *(undefined4 *)(lVar11 + 200);
    uStack_ac = *(undefined4 *)(lVar11 + 0xcc);
    puVar15 = *(undefined **)(lVar11 + 200);
    bVar19 = local_b8 < *param_9;
    if ((local_b8 == *param_9) && (bVar19 = puVar15 < param_9[1], puVar15 == param_9[1])) {
      iVar8 = 0;
    }
    else {
      iVar8 = (1 - (uint)bVar19) - (uint)(bVar19 != 0);
    }
    if (iVar8 == 0) {
      local_168[0] = 0xd9;
    }
    else if (*(int *)(lVar11 + 0x100) == 0) {
      local_168[0] = 0xde;
    }
    else if ((*(int *)(lVar11 + 0x30) == *param_6) && (*(int *)(lVar11 + 0x100) == *param_8)) {
      local_188 = (undefined **)*param_10;
      if ((undefined **)*param_10 == (undefined **)0x0) {
        local_188 = (undefined **)PTR_DAT_1405d8010;
      }
      local_180 = (undefined **)CONCAT44(local_180._4_4_,10);
      local_190 = param_9;
      local_198 = param_11;
      FUN_1400091a0(*local_118,&DAT_140477960,lVar11 + 0x18,0);
      local_a8._0_4_ = *(undefined4 *)(lVar11 + 0x118);
      local_a8._4_4_ = *(undefined4 *)(lVar11 + 0x11c);
      puVar15 = *(undefined **)(lVar11 + 0x118);
      uStack_a0 = *(undefined4 *)(lVar11 + 0x120);
      uStack_9c = *(undefined4 *)(lVar11 + 0x124);
      uVar6 = *(ulonglong *)(lVar11 + 0x120);
      local_b8 = *(undefined **)(lVar11 + 0xc0);
      local_b0 = *(undefined4 *)(lVar11 + 200);
      uStack_ac = *(undefined4 *)(lVar11 + 0xcc);
      uVar5 = *(ulonglong *)(lVar11 + 200);
      bVar19 = local_b8 < puVar15;
      if ((local_b8 == puVar15) && (bVar19 = uVar5 < uVar6, uVar5 == uVar6)) {
        iVar8 = 0;
      }
      else {
        iVar8 = (1 - (uint)bVar19) - (uint)(bVar19 != 0);
      }
      if (iVar8 != 0) {
        local_98 = *(undefined **)(lVar11 + 0x118);
        uStack_90 = *(undefined8 *)(lVar11 + 0x120);
        local_a8._0_4_ = 0;
        local_a8._4_4_ = 0;
        uStack_a0 = 0;
        uStack_9c = 0;
        local_180 = (undefined **)(lVar11 + 0xe0);
        ppuVar3 = (undefined **)(lVar11 + 0x128);
        local_178 = (undefined4 *)CONCAT44(local_178._4_4_,*(undefined4 *)(lVar11 + 0x148));
        local_190 = &local_98;
        local_198 = (undefined **)&local_a8;
        local_188 = ppuVar3;
        FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),lVar11,0x1d8,0x1b);
        local_a8._0_4_ = *(undefined4 *)(lVar11 + 0x118);
        local_a8._4_4_ = *(undefined4 *)(lVar11 + 0x11c);
        uStack_a0 = *(undefined4 *)(lVar11 + 0x120);
        uStack_9c = *(undefined4 *)(lVar11 + 0x124);
        local_b8 = *(undefined **)(lVar11 + 0x108);
        local_b0 = *(undefined4 *)(lVar11 + 0x110);
        uStack_ac = *(undefined4 *)(lVar11 + 0x114);
        local_180 = (undefined **)CONCAT44(local_180._4_4_,9);
        local_190 = (undefined **)&local_a8;
        local_198 = &local_b8;
        local_188 = ppuVar3;
        FUN_1400091a0(*puVar18,&DAT_140477960,0);
        FUN_14034fe70();
        local_b8 = PTR_DAT_1405d8010;
        iVar9 = FUN_14034fcf0(ppuVar3);
        iVar17 = 0;
        iVar8 = iVar17;
        if ((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1405d8010)) {
          iVar8 = *(int *)(local_b8 + -8);
        }
        iVar10 = 0;
        if (((iVar9 <= iVar8) && (iVar9 = iVar17, local_b8 != (undefined *)0x0)) &&
           (iVar9 = iVar10, local_b8 != PTR_DAT_1405d8010)) {
          iVar9 = *(int *)(local_b8 + -8);
        }
        iVar8 = 1;
        if (1 < iVar9) {
          iVar8 = iVar9;
        }
        if ((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1405d8010)) {
          iVar10 = *(int *)(local_b8 + -8);
        }
        if (iVar10 < iVar8) {
          FUN_140002d30(&local_b8);
        }
        FUN_140002e10(&local_b8);
        puVar15 = local_b8;
        if (local_b8 == (undefined *)0x0) {
          puVar15 = PTR_DAT_1405d8010;
        }
        FUN_14034fd20(puVar15,ppuVar3);
        puVar15 = local_b8;
        if (local_b8 == (undefined *)0x0) {
          puVar15 = PTR_DAT_1405d8010;
        }
        iVar9 = FUN_14034fcf0(puVar15);
        iVar17 = 0;
        iVar8 = 0;
        if (0 < iVar9) {
          iVar8 = iVar9;
        }
        iVar9 = iVar17;
        if ((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1405d8010)) {
          iVar9 = *(int *)(local_b8 + -8);
        }
        if ((iVar8 < iVar9) || (iVar8 = iVar17, local_b8 == (undefined *)0x0)) {
LAB_14000b6e5:
          if (((local_b8 != PTR_DAT_1405d8010) && (local_b8 != (undefined *)0x0)) &&
             ((int *)(local_b8 + -8) != (int *)0x0)) {
            *(int *)(local_b8 + -8) = iVar8;
            *(undefined2 *)(local_b8 + (longlong)iVar8 * 2) = 0;
          }
        }
        else if (local_b8 != PTR_DAT_1405d8010) {
          iVar8 = *(int *)(local_b8 + -8);
          goto LAB_14000b6e5;
        }
        lVar4 = DAT_140607fd0;
        local_158[0] = *(undefined4 *)(lVar11 + 0x30);
        local_a8._0_4_ = *(undefined4 *)(lVar11 + 0x18);
        local_a8._4_4_ = *(undefined4 *)(lVar11 + 0x1c);
        uStack_a0 = *(undefined4 *)(lVar11 + 0x20);
        uStack_9c = *(undefined4 *)(lVar11 + 0x24);
        local_98 = *(undefined **)(lVar11 + 0x118);
        uStack_90 = *(undefined8 *)(lVar11 + 0x120);
        local_150[0] = 0xe8;
        local_160._0_4_ = 0;
        if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
          local_148 = Proud::CFastArray<>::vftable;
          local_140 = (longlong *)0x0;
          local_138 = 0;
          local_130 = 0;
          local_128 = 0;
          FUN_14000ac20(*(longlong *)(DAT_140607fd0 + 0x70),&local_148);
          lVar7 = local_138;
          lVar16 = local_138;
          if ((int)local_130 == 0) {
            lVar16 = 0;
          }
          plVar13 = (longlong *)(*(longlong *)(lVar4 + 0x70) + 0x9c8);
          local_170 = local_150;
          local_178 = local_158;
          local_180 = (undefined **)&local_a8;
          local_188 = &local_98;
          local_198 = &local_160;
          local_190 = &local_b8;
          (**(code **)(*plVar13 + 0x88))(plVar13,lVar16,local_130 & 0xffffffff,&DAT_1405d85a0);
          if (lVar7 != 0) {
            if (local_140 == (longlong *)0x0) {
              FUN_14034ff60(lVar7);
            }
            else {
              (**(code **)(*local_140 + 0x18))(local_140,lVar7);
            }
          }
        }
        puVar15 = local_b8;
        if (((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_b8 + -8, puVar1 != (undefined *)0x0)) {
          puVar12 = (undefined *)FUN_14034fe70();
          local_108 = puVar12;
          FUN_14034ed40(puVar12);
          puStack_100 = (undefined *)CONCAT71(puStack_100._1_7_,1);
          piVar2 = (int *)(puVar15 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(puVar12);
        }
      }
      FUN_140009cb0(lVar11);
      local_88 = 0;
      uStack_86 = 0;
      uStack_80 = 0;
      uStack_7e = 0;
      uStack_78 = 0;
      local_76 = 0;
      uStack_70 = 0;
      local_6e = 0;
      uStack_68 = 0;
      local_66 = 0;
      uStack_60 = 0;
      local_5e = 0;
      uStack_58 = 0;
      local_56 = 0;
      uStack_50 = 0;
      uStack_4e = 0;
      lVar4 = *(longlong *)(lVar11 + 0x10);
      if (lVar4 != 0) {
        puVar14 = (undefined8 *)(lVar4 + 8);
        if (7 < *(ulonglong *)(lVar4 + 0x20)) {
          puVar14 = (undefined8 *)*puVar14;
        }
        local_88 = (undefined2)*puVar14;
        uStack_86 = (undefined6)((ulonglong)*puVar14 >> 0x10);
        uStack_80 = (undefined2)puVar14[1];
        uStack_7e = (undefined6)((ulonglong)puVar14[1] >> 0x10);
        uStack_78 = (undefined2)puVar14[2];
        local_76 = (undefined6)((ulonglong)puVar14[2] >> 0x10);
        uStack_70 = (undefined2)puVar14[3];
        local_6e = (undefined6)((ulonglong)puVar14[3] >> 0x10);
        uStack_68 = (undefined2)puVar14[4];
        local_66 = (undefined6)((ulonglong)puVar14[4] >> 0x10);
        uStack_60 = (undefined2)puVar14[5];
        local_5e = (undefined6)((ulonglong)puVar14[5] >> 0x10);
        uStack_58 = (undefined2)puVar14[6];
        local_56 = (undefined6)((ulonglong)puVar14[6] >> 0x10);
        uStack_50 = (undefined2)*(undefined4 *)(puVar14 + 7);
        uStack_4e = (undefined2)((uint)*(undefined4 *)(puVar14 + 7) >> 0x10);
      }
      local_108 = *(undefined **)(lVar11 + 0xc0);
      puStack_100 = *(undefined **)(lVar11 + 200);
      local_98 = (undefined *)0x0;
      uStack_90 = 0;
      local_180 = (undefined **)*local_f0;
      if ((undefined *)*local_f0 == (undefined *)0x0) {
        local_180 = (undefined **)PTR_DAT_1405d8010;
      }
      puVar14 = (undefined8 *)(lVar11 + 0xe0);
      local_190 = &local_108;
      local_198 = &local_98;
      local_188 = (undefined **)puVar14;
      local_178._0_4_ = *local_f8;
      FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),lVar11,0x1d8,0x16);
      local_108 = *param_9;
      puStack_100 = param_9[1];
      local_98 = (undefined *)0x0;
      uStack_90 = 0;
      local_188 = (undefined **)*local_f0;
      if ((undefined *)*local_f0 == (undefined *)0x0) {
        local_188 = (undefined **)PTR_DAT_1405d8010;
      }
      local_178 = (undefined4 *)CONCAT44(local_178._4_4_,*local_f8);
      local_190 = &local_108;
      local_198 = &local_98;
      local_180 = (undefined **)puVar14;
      FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),lVar11,0x1d8,0x18);
      puVar18 = local_118;
      local_98 = *(undefined **)(lVar11 + 0xc0);
      uStack_90 = *(undefined8 *)(lVar11 + 200);
      local_a8._0_4_ = *(undefined4 *)(lVar11 + 0xd0);
      local_a8._4_4_ = *(undefined4 *)(lVar11 + 0xd4);
      uStack_a0 = *(undefined4 *)(lVar11 + 0xd8);
      uStack_9c = *(undefined4 *)(lVar11 + 0xdc);
      local_180 = (undefined **)CONCAT44(local_180._4_4_,8);
      local_190 = &local_98;
      local_198 = (undefined **)&local_a8;
      local_188 = (undefined **)puVar14;
      FUN_1400091a0(*local_118,&local_88,0);
      FUN_14034fe70();
      local_b8 = PTR_DAT_1405d8010;
      iVar9 = FUN_14034fcf0(puVar14);
      iVar17 = 0;
      iVar8 = iVar17;
      if ((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1405d8010)) {
        iVar8 = *(int *)(local_b8 + -8);
      }
      iVar10 = iVar9;
      if (((iVar9 <= iVar8) && (iVar10 = iVar17, local_b8 != (undefined *)0x0)) &&
         (local_b8 != PTR_DAT_1405d8010)) {
        iVar10 = *(int *)(local_b8 + -8);
      }
      iVar8 = 1;
      if (1 < iVar10) {
        iVar8 = iVar10;
      }
      iVar17 = 0;
      if ((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1405d8010)) {
        iVar17 = *(int *)(local_b8 + -8);
      }
      if (iVar17 < iVar8) {
        FUN_140002d30(&local_b8,iVar8);
      }
      FUN_140002e10(&local_b8);
      puVar15 = local_b8;
      if (local_b8 == (undefined *)0x0) {
        puVar15 = PTR_DAT_1405d8010;
      }
      FUN_14034fd20(puVar15,puVar14,iVar9);
      puVar15 = local_b8;
      if (local_b8 == (undefined *)0x0) {
        puVar15 = PTR_DAT_1405d8010;
      }
      iVar9 = FUN_14034fcf0(puVar15);
      puVar15 = PTR_DAT_1405d8010;
      iVar17 = 0;
      iVar8 = 0;
      if (0 < iVar9) {
        iVar8 = iVar9;
      }
      iVar9 = iVar17;
      if ((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1405d8010)) {
        iVar9 = *(int *)(local_b8 + -8);
      }
      if ((iVar8 < iVar9) || (iVar8 = iVar17, local_b8 == (undefined *)0x0)) {
LAB_14000bb53:
        if (((local_b8 != PTR_DAT_1405d8010) && (local_b8 != (undefined *)0x0)) &&
           ((int *)(local_b8 + -8) != (int *)0x0)) {
          *(int *)(local_b8 + -8) = iVar8;
          *(undefined2 *)(local_b8 + (longlong)iVar8 * 2) = 0;
        }
      }
      else if (local_b8 != PTR_DAT_1405d8010) {
        iVar8 = *(int *)(local_b8 + -8);
        goto LAB_14000bb53;
      }
      lVar4 = DAT_140607fd0;
      local_158[0] = *(undefined4 *)(lVar11 + 0x30);
      local_98 = *(undefined **)(lVar11 + 0x18);
      uStack_90 = *(undefined8 *)(lVar11 + 0x20);
      local_a8._0_4_ = *(undefined4 *)(lVar11 + 0xc0);
      local_a8._4_4_ = *(undefined4 *)(lVar11 + 0xc4);
      uStack_a0 = *(undefined4 *)(lVar11 + 200);
      uStack_9c = *(undefined4 *)(lVar11 + 0xcc);
      local_160._0_4_ = 0xe4;
      local_150[0] = 0;
      if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
        local_148 = Proud::CFastArray<>::vftable;
        local_140 = (longlong *)0x0;
        local_138 = 0;
        local_130 = 0;
        local_128 = 0;
        FUN_14000ac20(*(longlong *)(DAT_140607fd0 + 0x70),&local_148);
        lVar7 = local_138;
        lVar16 = local_138;
        if ((int)local_130 == 0) {
          lVar16 = 0;
        }
        plVar13 = (longlong *)(*(longlong *)(lVar4 + 0x70) + 0x9c8);
        local_170 = (undefined4 *)&local_160;
        local_178 = local_158;
        local_180 = &local_98;
        local_188 = (undefined **)&local_a8;
        local_198 = (undefined **)local_150;
        local_190 = &local_b8;
        (**(code **)(*plVar13 + 0x88))(plVar13,lVar16,local_130 & 0xffffffff,&DAT_1405d85a0);
        puVar15 = PTR_DAT_1405d8010;
        if (lVar7 != 0) {
          if (local_140 == (longlong *)0x0) {
            FUN_14034ff60(lVar7);
            puVar15 = PTR_DAT_1405d8010;
          }
          else {
            (**(code **)(*local_140 + 0x18))(local_140,lVar7);
            puVar15 = PTR_DAT_1405d8010;
          }
        }
      }
      puVar1 = local_b8;
      if (((local_b8 != (undefined *)0x0) && (local_b8 != puVar15)) &&
         (puVar15 = local_b8 + -8, puVar15 != (undefined *)0x0)) {
        puVar12 = (undefined *)FUN_14034fe70();
        local_108 = puVar12;
        FUN_14034ed40(puVar12);
        puStack_100 = (undefined *)CONCAT71(puStack_100._1_7_,1);
        piVar2 = (int *)(puVar1 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar15);
        }
        FUN_14034edd0(puVar12);
      }
      FUN_14000da40(lVar11);
      FUN_140007a80(*(undefined8 *)(DAT_140607fd0 + 0x48),*(undefined4 *)(lVar11 + 0xc));
      local_168[0] = 0xe1;
      *(int *)(param_1 + 0xa8) = *(int *)(param_1 + 0xa8) + -1;
      goto LAB_14000bd41;
    }
  }
  local_188 = (undefined **)*param_10;
  if ((undefined8 *)*param_10 == (undefined8 *)0x0) {
    local_188 = (undefined **)PTR_DAT_1405d8010;
  }
  local_180 = (undefined **)CONCAT44(local_180._4_4_,0xc);
  local_190 = param_9;
  local_198 = param_11;
  FUN_1400091a0(*local_118,&DAT_140477960,0,*param_8);
LAB_14000bd41:
  local_198 = (undefined **)local_168;
  (**(code **)(*(longlong *)(param_1 + 0x20) + 0x60))
            ((longlong *)(param_1 + 0x20),local_120,&DAT_1405d85a0,puVar18);
  FUN_14034edd0(param_1 + 0xb0);
  FUN_14004b970(&local_e8);
  return 1;
}



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

{
  longlong lVar1;
  undefined *puVar2;
  undefined8 in_stack_ffffffffffffff50;
  longlong lVar3;
  int local_98;
  undefined4 local_94;
  char *local_90;
  DWORD local_88;
  longlong local_80;
  longlong local_78;
  undefined1 local_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;
  undefined8 local_48;
  undefined4 uVar4;
  
  uVar4 = (undefined4)((ulonglong)in_stack_ffffffffffffff50 >> 0x20);
  local_48 = 0xfffffffffffffffe;
  local_90 = "S2A_Bid_AuctionItem";
  local_80 = **(longlong **)(*(longlong *)(param_1 + -0x4e0) + 8) + 0x70;
  local_94 = param_2;
  local_88 = timeGetTime();
  local_78 = param_1 + 0xb0;
  FUN_14034ed40(local_78);
  local_70 = 1;
  local_98 = 0xd2;
  lVar1 = FUN_140007b00(*(undefined8 *)(DAT_140607fd0 + 0x48),param_5,*param_6);
  if (lVar1 != 0) {
    puVar2 = (undefined *)*param_10;
    if ((undefined *)*param_10 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1405d8010;
    }
    local_98 = FUN_14000dd90(lVar1,*param_4,*param_8,param_9,puVar2,param_11);
    if (local_98 == 0xe2) {
      FUN_14000d840(lVar1);
      if (local_98 == 0xe2) goto LAB_14000bf83;
    }
    local_58 = *param_9;
    uStack_54 = param_9[1];
    uStack_50 = param_9[2];
    uStack_4c = param_9[3];
    local_68 = 0;
    uStack_64 = 0;
    uStack_60 = 0;
    uStack_5c = 0;
    puVar2 = (undefined *)*param_10;
    if ((undefined *)*param_10 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1405d8010;
    }
    lVar3 = lVar1 + 0xe0;
    FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),lVar1,0x1d7,0xc,&local_68,&local_58,puVar2,
                  lVar3,*param_8);
    uVar4 = (undefined4)((ulonglong)lVar3 >> 0x20);
  }
  puVar2 = (undefined *)*param_10;
  if ((undefined *)*param_10 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1405d8010;
  }
  FUN_1400091a0(*param_4,&DAT_140477960,0,*param_8,param_11,param_9,puVar2,CONCAT44(uVar4,9));
LAB_14000bf83:
  (**(code **)(*(longlong *)(param_1 + 0x20) + 0x70))
            ((longlong *)(param_1 + 0x20),local_94,&DAT_1405d85a0,param_4,&local_98);
  FUN_14034edd0(param_1 + 0xb0);
  FUN_14004b970(&local_90);
  return 1;
}



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

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

{
  undefined *puVar1;
  int *piVar2;
  undefined4 *puVar3;
  longlong lVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  longlong lVar7;
  longlong lVar8;
  undefined *puVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  longlong lVar14;
  undefined8 uVar15;
  undefined *puVar16;
  longlong *plVar17;
  longlong lVar18;
  int iVar19;
  bool bVar20;
  undefined1 auStack_168 [32];
  undefined **local_148;
  undefined **local_140;
  undefined4 *local_138;
  undefined **local_130;
  undefined4 *local_128;
  undefined4 *local_120;
  undefined4 local_118 [2];
  undefined4 local_110 [2];
  undefined4 local_108 [2];
  undefined4 local_100 [2];
  undefined **local_f8;
  longlong *local_f0;
  longlong local_e8;
  ulonglong local_e0;
  undefined8 local_d8;
  undefined8 local_c8;
  undefined4 uStack_c0;
  undefined4 uStack_bc;
  char *local_b8;
  DWORD local_b0;
  longlong local_a8;
  undefined8 local_a0;
  undefined4 local_98;
  undefined4 uStack_94;
  undefined4 uStack_90;
  undefined4 uStack_8c;
  longlong local_88;
  undefined1 local_80;
  undefined *local_78;
  undefined4 local_70;
  undefined4 uStack_6c;
  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_a0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_168;
  local_b8 = "S2A_SellingCancle_AuctionItem";
  local_a8 = **(longlong **)(*(longlong *)(param_1 + -0x4e0) + 8) + 0x70;
  local_b0 = timeGetTime();
  lVar4 = param_1 + 0xb0;
  local_88 = lVar4;
  FUN_14034ed40(lVar4);
  local_80 = 1;
  local_118[0] = 0xd2;
  uVar15 = *(undefined8 *)(DAT_140607fd0 + 0x48);
  lVar14 = FUN_140007b00(uVar15,param_7);
  if (lVar14 == 0) goto LAB_14000c5fd;
  local_78 = *(undefined **)(lVar14 + 0xc0);
  local_70 = *(undefined4 *)(lVar14 + 200);
  uStack_6c = *(undefined4 *)(lVar14 + 0xcc);
  uVar5 = *(ulonglong *)(lVar14 + 200);
  bVar20 = local_78 < (undefined *)*param_6;
  iVar10 = 0;
  if ((local_78 != (undefined *)*param_6) ||
     (bVar20 = uVar5 < param_6[1], iVar11 = iVar10, uVar5 != param_6[1])) {
    iVar11 = (1 - (uint)bVar20) - (uint)(bVar20 != 0);
  }
  if (iVar11 != 0) {
    local_118[0] = 0xdf;
    goto LAB_14000c5fd;
  }
  local_68 = *(undefined4 *)(lVar14 + 0x118);
  uStack_64 = *(undefined4 *)(lVar14 + 0x11c);
  puVar16 = *(undefined **)(lVar14 + 0x118);
  uStack_60 = *(undefined4 *)(lVar14 + 0x120);
  uStack_5c = *(undefined4 *)(lVar14 + 0x124);
  uVar6 = *(ulonglong *)(lVar14 + 0x120);
  local_78 = *(undefined **)(lVar14 + 0xc0);
  local_70 = *(undefined4 *)(lVar14 + 200);
  uStack_6c = *(undefined4 *)(lVar14 + 0xcc);
  uVar5 = *(ulonglong *)(lVar14 + 200);
  bVar20 = local_78 < puVar16;
  if ((local_78 != puVar16) || (bVar20 = uVar5 < uVar6, uVar5 != uVar6)) {
    iVar10 = (1 - (uint)bVar20) - (uint)(bVar20 != 0);
  }
  puVar16 = local_78;
  if (iVar10 != 0) {
    local_58 = *(undefined4 *)(lVar14 + 0x118);
    uStack_54 = *(undefined4 *)(lVar14 + 0x11c);
    uStack_50 = *(undefined4 *)(lVar14 + 0x120);
    uStack_4c = *(undefined4 *)(lVar14 + 0x124);
    local_68 = 0;
    uStack_64 = 0;
    uStack_60 = 0;
    uStack_5c = 0;
    puVar3 = (undefined4 *)(lVar14 + 0x128);
    local_130 = (undefined **)(lVar14 + 0xe0);
    local_128 = (undefined4 *)CONCAT44(local_128._4_4_,*(undefined4 *)(lVar14 + 0x148));
    local_140 = (undefined **)&local_58;
    local_148 = (undefined **)&local_68;
    local_138 = puVar3;
    FUN_140009d30(uVar15,lVar14,0x1d8,0x1d);
    local_68 = *(undefined4 *)(lVar14 + 0x118);
    uStack_64 = *(undefined4 *)(lVar14 + 0x11c);
    uStack_60 = *(undefined4 *)(lVar14 + 0x120);
    uStack_5c = *(undefined4 *)(lVar14 + 0x124);
    local_78 = *(undefined **)(lVar14 + 0x108);
    local_70 = *(undefined4 *)(lVar14 + 0x110);
    uStack_6c = *(undefined4 *)(lVar14 + 0x114);
    local_130 = (undefined **)CONCAT44(local_130._4_4_,9);
    local_148 = &local_78;
    local_140 = (undefined **)&local_68;
    local_138 = puVar3;
    FUN_1400091a0(*param_4,&DAT_140477960,0);
    FUN_14034fe70();
    local_78 = PTR_DAT_1405d8010;
    iVar11 = FUN_14034fcf0(puVar3);
    iVar19 = 0;
    iVar10 = iVar19;
    if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
      iVar10 = *(int *)(local_78 + -8);
    }
    iVar13 = 0;
    iVar12 = iVar11;
    if (((iVar11 <= iVar10) && (iVar12 = iVar19, local_78 != (undefined *)0x0)) &&
       (iVar12 = iVar13, local_78 != PTR_DAT_1405d8010)) {
      iVar12 = *(int *)(local_78 + -8);
    }
    iVar10 = 1;
    if (1 < iVar12) {
      iVar10 = iVar12;
    }
    if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
      iVar13 = *(int *)(local_78 + -8);
    }
    if (iVar13 < iVar10) {
      FUN_140002d30(&local_78);
    }
    FUN_140002e10(&local_78);
    puVar16 = local_78;
    if (local_78 == (undefined *)0x0) {
      puVar16 = PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar16,puVar3,iVar11);
    puVar16 = local_78;
    if (local_78 == (undefined *)0x0) {
      puVar16 = PTR_DAT_1405d8010;
    }
    iVar11 = FUN_14034fcf0(puVar16);
    puVar16 = PTR_DAT_1405d8010;
    iVar19 = 0;
    iVar10 = 0;
    if (0 < iVar11) {
      iVar10 = iVar11;
    }
    iVar11 = iVar19;
    if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
      iVar11 = *(int *)(local_78 + -8);
    }
    if ((iVar10 < iVar11) || (iVar10 = iVar19, local_78 == (undefined *)0x0)) {
LAB_14000c334:
      if (((local_78 != PTR_DAT_1405d8010) && (local_78 != (undefined *)0x0)) &&
         ((int *)(local_78 + -8) != (int *)0x0)) {
        *(int *)(local_78 + -8) = iVar10;
        *(undefined2 *)(local_78 + (longlong)iVar10 * 2) = 0;
      }
    }
    else if (local_78 != PTR_DAT_1405d8010) {
      iVar10 = *(int *)(local_78 + -8);
      goto LAB_14000c334;
    }
    lVar7 = DAT_140607fd0;
    local_100[0] = *(undefined4 *)(lVar14 + 0x30);
    local_68 = *(undefined4 *)(lVar14 + 0x18);
    uStack_64 = *(undefined4 *)(lVar14 + 0x1c);
    uStack_60 = *(undefined4 *)(lVar14 + 0x20);
    uStack_5c = *(undefined4 *)(lVar14 + 0x24);
    local_58 = *(undefined4 *)(lVar14 + 0x118);
    uStack_54 = *(undefined4 *)(lVar14 + 0x11c);
    uStack_50 = *(undefined4 *)(lVar14 + 0x120);
    uStack_4c = *(undefined4 *)(lVar14 + 0x124);
    local_108[0] = 0xe8;
    local_110[0] = 0;
    if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
      local_f8 = Proud::CFastArray<>::vftable;
      local_f0 = (longlong *)0x0;
      local_e8 = 0;
      local_e0 = 0;
      local_d8 = 0;
      FUN_14000ac20(*(longlong *)(DAT_140607fd0 + 0x70),&local_f8);
      lVar8 = local_e8;
      lVar18 = local_e8;
      if ((int)local_e0 == 0) {
        lVar18 = 0;
      }
      plVar17 = (longlong *)(*(longlong *)(lVar7 + 0x70) + 0x9c8);
      local_120 = local_108;
      local_128 = local_100;
      local_138 = &local_58;
      local_140 = &local_78;
      local_148 = (undefined **)local_110;
      local_130 = (undefined **)&local_68;
      (**(code **)(*plVar17 + 0x88))(plVar17,lVar18,local_e0 & 0xffffffff,&DAT_1405d85a0);
      puVar16 = PTR_DAT_1405d8010;
      if (lVar8 != 0) {
        if (local_f0 == (longlong *)0x0) {
          FUN_14034ff60(lVar8);
          puVar16 = PTR_DAT_1405d8010;
        }
        else {
          (**(code **)(*local_f0 + 0x18))(local_f0,lVar8);
          puVar16 = PTR_DAT_1405d8010;
        }
      }
    }
    puVar9 = local_78;
    if (((local_78 != (undefined *)0x0) && (local_78 != puVar16)) &&
       (puVar1 = local_78 + -8, puVar1 != (undefined *)0x0)) {
      uVar15 = FUN_14034fe70();
      local_c8 = uVar15;
      FUN_14034ed40(uVar15);
      uStack_c0 = CONCAT31(uStack_c0._1_3_,1);
      piVar2 = (int *)(puVar9 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar15);
      puVar16 = PTR_DAT_1405d8010;
    }
  }
  local_78 = puVar16;
  local_c8 = *(undefined8 *)(lVar14 + 0xc0);
  uStack_c0 = *(undefined4 *)(lVar14 + 200);
  uStack_bc = *(undefined4 *)(lVar14 + 0xcc);
  local_98 = 0;
  uStack_94 = 0;
  uStack_90 = 0;
  uStack_8c = 0;
  local_128 = (undefined4 *)CONCAT44(local_128._4_4_,0xffffffff);
  local_130 = (undefined **)0x0;
  local_140 = (undefined **)&local_c8;
  local_148 = (undefined **)&local_98;
  local_138 = (undefined4 *)(lVar14 + 0xe0);
  FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),lVar14,0x1d8,0x1a);
  if (*(longlong *)(DAT_140607fd0 + 0x50) != 0) {
    plVar17 = (longlong *)(**(longlong **)(*(longlong *)(DAT_140607fd0 + 0x50) + 8) + 0x70);
    (**(code **)(*plVar17 + 0x680))(plVar17,1,&DAT_1405d85a0,lVar14 + 0x18);
  }
  local_58 = *(undefined4 *)(lVar14 + 0xc0);
  uStack_54 = *(undefined4 *)(lVar14 + 0xc4);
  uStack_50 = *(undefined4 *)(lVar14 + 200);
  uStack_4c = *(undefined4 *)(lVar14 + 0xcc);
  local_68 = *(undefined4 *)(lVar14 + 0xd0);
  uStack_64 = *(undefined4 *)(lVar14 + 0xd4);
  uStack_60 = *(undefined4 *)(lVar14 + 0xd8);
  uStack_5c = *(undefined4 *)(lVar14 + 0xdc);
  local_130 = (undefined **)CONCAT44(local_130._4_4_,0xd);
  local_140 = (undefined **)&local_58;
  local_148 = (undefined **)&local_68;
  local_138 = (undefined4 *)(lVar14 + 0xe0);
  FUN_1400091a0(*param_4,&DAT_140477960,lVar14 + 0x18,0);
  FUN_140007a80(*(undefined8 *)(DAT_140607fd0 + 0x48),*(undefined4 *)(lVar14 + 0xc));
  local_118[0] = 0xe3;
  *(int *)(param_1 + 0xa8) = *(int *)(param_1 + 0xa8) + -1;
LAB_14000c5fd:
  local_148 = (undefined **)local_118;
  (**(code **)(*(longlong *)(param_1 + 0x20) + 0x80))
            ((longlong *)(param_1 + 0x20),param_2,&DAT_1405d85a0,param_4);
  FUN_14034edd0(lVar4);
  FUN_14004b970(&local_b8);
  return 1;
}



undefined8
FUN_14000c660(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  longlong lVar1;
  undefined8 uVar2;
  int iVar3;
  undefined4 local_res8 [2];
  undefined8 uVar4;
  longlong lVar5;
  undefined1 uVar6;
  char *local_30;
  DWORD local_28;
  longlong local_20;
  
  uVar4 = 0xfffffffffffffffe;
  local_30 = "S2A_SellingCancle_AuctionItem";
  local_20 = **(longlong **)(*(longlong *)(param_1 + -0x4e0) + 8) + 0x70;
  local_28 = timeGetTime();
  lVar1 = param_1 + 0xb0;
  lVar5 = lVar1;
  FUN_14034ed40(lVar1);
  uVar6 = 1;
  local_res8[0] = 0x155;
  uVar2 = *(undefined8 *)(DAT_140607fd0 + 0x48);
  iVar3 = FUN_140009ae0(uVar2,param_5);
  if (iVar3 < 1) {
    iVar3 = FUN_140009b90(uVar2,param_5);
    local_res8[0] = 0x155;
    if (0 < iVar3) {
      local_res8[0] = 0x157;
    }
  }
  else {
    local_res8[0] = 0x156;
  }
  (**(code **)(*(longlong *)(param_1 + 0x20) + 0xa0))
            ((longlong *)(param_1 + 0x20),param_2,&DAT_1405d85a0,param_4,param_6,param_7,param_8,
             local_res8,uVar4,lVar5,uVar6);
  FUN_14034edd0(lVar1);
  FUN_14004b970(&local_30);
  return 1;
}



uint * FUN_14000c7b0(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_14000c84d;
    }
    if (lVar3 != 0) goto LAB_14000c829;
  }
  cVar5 = FUN_14000cae0(param_1,(ulonglong)uVar2,CONCAT71((int7)((ulonglong)lVar3 >> 8),1));
  if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
LAB_14000c829:
  FUN_14000cbd0(param_1);
  puVar6 = (uint *)FUN_14000cd80(param_1,param_2,uVar4,uVar1);
  FUN_14000cbd0(param_1);
LAB_14000c84d:
  return puVar6 + 2;
}



void FUN_14000c870(void)

{
  FUN_14000c890();
  return;
}



void FUN_14000c890(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_14000cbd0();
  lVar4 = *(longlong *)(param_1 + 0x10);
  while (lVar4 != 0) {
    plVar1 = *(longlong **)(param_1 + 0x50);
    lVar5 = *(longlong *)(lVar4 + 0x10);
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_14034ff60(*(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_14000cbd0(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_14000cd00(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14000cbd0(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_14000c9c0(longlong param_1,longlong param_2)

{
  uint uVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar1 = *(uint *)(param_1 + 0x28);
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x20) % (ulonglong)uVar1;
  if (*(longlong *)(param_1 + 0x20) == 1) {
    *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar3 * 8) = 0;
    *(undefined8 *)(param_1 + 0x10) = 0;
    *(undefined8 *)(param_1 + 0x18) = 0;
  }
  else {
    uVar4 = (uint)uVar3;
    if (((*(longlong *)(param_2 + 0x18) == 0) ||
        (*(uint *)(*(longlong *)(param_2 + 0x18) + 0x20) % uVar1 != uVar4)) &&
       ((*(longlong *)(param_2 + 0x10) == 0 ||
        (*(uint *)(*(longlong *)(param_2 + 0x10) + 0x20) % uVar1 != uVar4)))) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar3 * 8) = 0;
    }
    else if (param_2 == *(longlong *)(*(longlong *)(param_1 + 8) + (longlong)(int)uVar4 * 8)) {
      *(undefined8 *)(*(longlong *)(param_1 + 8) + uVar3 * 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);
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x50);
  if (plVar2 != (longlong *)0x0) {
    (**(code **)(*plVar2 + 0x18))(plVar2,param_2);
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    FUN_14000cbd0(param_1);
    return;
  }
  FUN_14034ff60(param_2);
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  FUN_14000cbd0(param_1);
  return;
}



undefined8 FUN_14000cae0(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_14034ff60();
    *(undefined8 *)(param_1 + 8) = 0;
  }
  if (param_3 != '\0') {
    _Size = (ulonglong)param_2 << 3;
    _Dst = (void *)FUN_14034fef0(_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_14000cbd0(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_14034f420(local_58,L"CFastMap consistency error #0!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    lVar1 = *(longlong *)(param_1 + 0x10);
    lVar3 = lVar1;
    while (lVar3 != 0) {
      lVar2 = *(longlong *)(lVar3 + 0x10);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x18) != lVar3)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #1!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar3 == lVar1) && (*(longlong *)(lVar3 + 0x18) != 0)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #2!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar3 == *(longlong *)(param_1 + 0x18)) && (lVar2 != 0)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #3!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar2;
    }
    if (iVar4 != *(int *)(param_1 + 0x20)) {
      for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 0x10)) {
      }
      FUN_14034f420(local_58,L"CFastMap consistency error #4!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  return;
}



uint FUN_14000cd00(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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined4 * FUN_14000cd80(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_14034fef0(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_14000cbd0(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_14000cbd0(param_1);
    FUN_14000cbd0(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_14000cbd0(param_1);
  FUN_14000cbd0(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_14000cd00(param_1);
    FUN_14000cec0(param_1,uVar4);
  }
  FUN_14000cbd0(param_1);
  return puVar5;
}



void FUN_14000cec0(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  void *_Dst;
  ulonglong uVar6;
  ulonglong uVar7;
  int iVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  
  if (param_2 == 0) {
    param_2 = FUN_14000cd00();
  }
  if (param_2 != *(uint *)(param_1 + 0x28)) {
    if (*(longlong *)(param_1 + 8) == 0) {
      FUN_14000cae0(param_1,param_2,0);
      return;
    }
    _Dst = (void *)FUN_14034fef0((ulonglong)param_2 << 3);
    if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    memset(_Dst,0,(ulonglong)param_2 << 3);
    uVar7 = 0;
    uVar5 = *(ulonglong *)(param_1 + 0x10);
    uVar9 = uVar7;
    uVar10 = uVar7;
    while (uVar5 != 0) {
      uVar1 = *(ulonglong *)(uVar5 + 0x10);
      uVar4 = (ulonglong)*(uint *)(uVar5 + 0x20) % (ulonglong)param_2;
      lVar2 = *(longlong *)((longlong)_Dst + uVar4 * 8);
      iVar8 = (int)uVar9;
      if (iVar8 == 0) {
        *(undefined8 *)(uVar5 + 0x18) = 0;
        *(undefined8 *)(uVar5 + 0x10) = 0;
        uVar9 = 1;
        uVar7 = uVar5;
        uVar10 = uVar5;
      }
      else if (lVar2 == 0) {
        *(undefined8 *)(uVar5 + 0x18) = 0;
        *(ulonglong *)(uVar5 + 0x10) = uVar7;
        if (uVar7 != 0) {
          *(ulonglong *)(uVar7 + 0x18) = uVar5;
        }
        uVar9 = (ulonglong)(iVar8 + 1);
        uVar7 = uVar5;
      }
      else {
        uVar6 = uVar5;
        if (*(longlong *)(lVar2 + 0x18) != 0) {
          *(ulonglong *)(*(longlong *)(lVar2 + 0x18) + 0x10) = uVar5;
          uVar6 = uVar7;
        }
        uVar3 = *(undefined8 *)(lVar2 + 0x18);
        *(longlong *)(uVar5 + 0x10) = lVar2;
        uVar9 = (ulonglong)(iVar8 + 1);
        *(undefined8 *)(uVar5 + 0x18) = uVar3;
        *(ulonglong *)(lVar2 + 0x18) = uVar5;
        uVar7 = uVar6;
      }
      *(ulonglong *)((longlong)_Dst + uVar4 * 8) = uVar5;
      uVar5 = uVar1;
    }
    FUN_14034ff60(*(undefined8 *)(param_1 + 8));
    *(void **)(param_1 + 8) = _Dst;
    *(uint *)(param_1 + 0x28) = param_2;
    *(ulonglong *)(param_1 + 0x10) = uVar7;
    *(ulonglong *)(param_1 + 0x18) = uVar10;
    FUN_14000cbd0(param_1);
    FUN_14000d020(param_1);
  }
  return;
}



void FUN_14000d020(longlong param_1)

{
  ulonglong uVar1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  fVar5 = (float)*(uint *)(param_1 + 0x28) * *(float *)(param_1 + 0x34);
  lVar2 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar4 = (float)*(uint *)(param_1 + 0x28) * *(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;
}



void FUN_14000d0a0(longlong param_1)

{
  FUN_14000a4d0(param_1 + -0x9a0);
  return;
}



void FUN_14000d0b0(longlong param_1)

{
  FUN_14000a4d0(param_1 + -0x2c0);
  return;
}



void FUN_14000d0c0(longlong param_1)

{
  FUN_14000a4d0(param_1 + -0x9a8);
  return;
}



void FUN_14000d0d0(longlong param_1)

{
  FUN_14000a4d0(param_1 + -0x2e0);
  return;
}



void FUN_14000d0e0(longlong param_1)

{
  FUN_14000a4d0(param_1 + -0x300);
  return;
}



void FUN_14000d0f0(longlong param_1)

{
  FUN_14000a4d0(param_1 + -800);
  return;
}



void FUN_14000d100(longlong param_1)

{
  FUN_14000a4d0(param_1 + -0x340);
  return;
}



undefined8 FUN_14000d110(void)

{
  return 0xb034;
}



undefined8 FUN_14000d120(void)

{
  return 0xb02c;
}



undefined8 FUN_14000d130(void)

{
  return 7000;
}



undefined8 FUN_14000d140(void)

{
  return 0x7927;
}



undefined8 FUN_14000d150(void)

{
  return 31000;
}



undefined8 FUN_14000d160(void)

{
  return 0x9cd0;
}



undefined8 FUN_14000d170(void)

{
  return 0x3340;
}



undefined8 FUN_14000d180(void)

{
  return 13000;
}



undefined1 FUN_14000d190(void)

{
  return 0;
}



undefined8 FUN_14000d1a0(void)

{
  return 0x2b7d;
}



void FUN_14000d1b0(undefined8 param_1,undefined8 param_2,undefined8 *param_3)

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



wchar_t * FUN_14000d1e0(void)

{
  return L"AUCTION";
}



void * FUN_14000d1f0(void *param_1,uint param_2)

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



void FUN_14000d220(longlong *param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined8 uVar2;
  
  puVar1 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8008;
  }
  *param_1 = (longlong)puVar1;
  if ((undefined *)*param_2 != puVar1) {
    uVar2 = FUN_14034fe70();
    FUN_14034ed40(uVar2);
    FUN_14000d2c0(param_1);
    puVar1 = (undefined *)*param_2;
    *param_1 = (longlong)puVar1;
    if (((puVar1 != PTR_DAT_1405d8008) && (puVar1 != (undefined *)0x0)) &&
       (puVar1 != (undefined *)0x8)) {
      *(int *)(puVar1 + -4) = *(int *)(puVar1 + -4) + 1;
    }
    FUN_14034edd0(uVar2);
  }
  return;
}



void FUN_14000d2c0(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  puVar2 = (undefined *)*param_1;
  if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1405d8008)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1405d8008;
  }
  else {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar3);
    *param_1 = (longlong)PTR_DAT_1405d8008;
  }
  return;
}



void thunk_FUN_14000d2c0(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  puVar2 = (undefined *)*param_1;
  if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1405d8008)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1405d8008;
  }
  else {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar3);
    *param_1 = (longlong)PTR_DAT_1405d8008;
  }
  return;
}



exception *
FUN_14000d360(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_14034fe70();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1405d8008;
  FUN_14000d220(param_1 + 0x40,param_2 + 0x40,param_3,param_4,uVar1);
  return param_1;
}



void FUN_14000d3f0(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;
}



void FUN_14000d450(undefined4 param_1)

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



longlong * FUN_14000d470(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_14034fe70();
  puVar2 = PTR_DAT_1405d8010;
  local_res8 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_2);
  iVar6 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(puVar2 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar6) && (iVar4 = 0, puVar2 != (undefined *)0x0)) && (puVar2 != PTR_DAT_1405d8010)
     ) {
    iVar4 = *(int *)(puVar2 + -8);
  }
  iVar6 = 1;
  if (1 < iVar4) {
    iVar6 = iVar4;
  }
  iVar4 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar4 = 0, puVar2 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(puVar2 + -8);
  }
  if (iVar4 < iVar6) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar2 = local_res8;
  puVar7 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,param_2,iVar3,param_4,uVar8);
  puVar7 = puVar2;
  if (puVar2 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar7);
  puVar7 = PTR_DAT_1405d8010;
  iVar6 = 0;
  if (0 < iVar3) {
    iVar6 = iVar3;
  }
  iVar3 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar3 = 0, puVar2 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if ((iVar3 <= iVar6) && (iVar6 = 0, puVar2 != (undefined *)0x0)) {
    if (puVar2 == PTR_DAT_1405d8010) goto LAB_14000d590;
    iVar6 = *(int *)(puVar2 + -8);
  }
  if (((puVar2 != PTR_DAT_1405d8010) && (puVar2 != (undefined *)0x0)) &&
     ((int *)(puVar2 + -8) != (int *)0x0)) {
    *(int *)(puVar2 + -8) = iVar6;
    *(undefined2 *)(puVar2 + (longlong)iVar6 * 2) = 0;
  }
LAB_14000d590:
  puVar5 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar5 = puVar7;
  }
  *param_1 = (longlong)puVar5;
  if (puVar2 != puVar5) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    FUN_1400031d0(param_1);
    *param_1 = (longlong)puVar2;
    if (((puVar2 != PTR_DAT_1405d8010) && (puVar2 != (undefined *)0x0)) &&
       (puVar2 != (undefined *)0x8)) {
      *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
    }
    FUN_14034edd0(uVar8);
    puVar7 = PTR_DAT_1405d8010;
  }
  if (((puVar2 != (undefined *)0x0) && (puVar2 != puVar7)) && (puVar2 + -8 != (undefined *)0x0)) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(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_14035b3e0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14000d690(undefined8 *param_1)

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



undefined8
FUN_14000d6a0(longlong param_1,int param_2,int param_3,int param_4,int param_5,int param_6,
             int param_7,int param_8,int param_9,wchar_t *param_10)

{
  longlong lVar1;
  wchar_t *pwVar2;
  bool bVar3;
  
  lVar1 = *(longlong *)(param_1 + 0x10);
  if (lVar1 == 0) {
    return 0;
  }
  if (param_3 != -1) {
    if (param_4 == -1) {
      if (param_5 == -1) {
        if (param_3 != *(int *)(lVar1 + 200)) {
          return 0;
        }
        goto LAB_14000d71e;
      }
      bVar3 = param_3 == *(int *)(lVar1 + 200);
    }
    else {
      if (param_5 == -1) {
        if ((param_3 != *(int *)(lVar1 + 200)) || (param_4 != *(int *)(lVar1 + 0xc0))) {
          return 0;
        }
        goto LAB_14000d71e;
      }
      if (param_3 != *(int *)(lVar1 + 200)) {
        return 0;
      }
      bVar3 = param_4 == *(int *)(lVar1 + 0xc0);
    }
    if (!bVar3) {
      return 0;
    }
    if (param_5 != *(int *)(lVar1 + 0xc4)) {
      return 0;
    }
  }
LAB_14000d71e:
  if (((param_6 == -1) || (param_6 == *(int *)(lVar1 + 0xcc))) &&
     ((param_7 == -1 || (param_7 <= *(short *)(param_1 + 0x40))))) {
    if (((param_2 != -1) && (*(int *)(lVar1 + 0x100) != 0)) && (*(int *)(lVar1 + 0x100) != param_2))
    {
      return 0;
    }
    if (((param_8 == -1) || (param_9 == -1)) ||
       ((param_9 <= *(int *)(lVar1 + 0x108) && (*(int *)(lVar1 + 0x108) <= param_8)))) {
      if (*param_10 != L'\0') {
        pwVar2 = (wchar_t *)(lVar1 + 8);
        if (7 < *(ulonglong *)(lVar1 + 0x20)) {
          pwVar2 = *(wchar_t **)pwVar2;
        }
        pwVar2 = wcsstr(pwVar2,param_10);
        if (pwVar2 == (wchar_t *)0x0) {
          return 0;
        }
      }
      return 1;
    }
  }
  return 0;
}



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

void FUN_14000d7b0(undefined8 param_1)

{
  longlong lVar1;
  undefined1 auStack_198 [32];
  undefined1 local_178 [352];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_198;
  FUN_14000e540(local_178);
  FUN_14000da90(param_1,local_178);
  if (*(longlong *)(DAT_140607fd0 + 0x50) != 0) {
    lVar1 = **(longlong **)(*(longlong *)(DAT_140607fd0 + 0x50) + 8);
    (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x670))(lVar1 + 0x70,1,&DAT_1405d85a0,local_178);
  }
  return;
}



void FUN_14000d840(longlong param_1)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  longlong *plVar7;
  int iVar8;
  undefined *local_res10;
  
  if (*(longlong *)(DAT_140607fd0 + 0x50) == 0) {
    return;
  }
  FUN_14034fe70();
  local_res10 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_1 + 0x128);
  iVar8 = 0;
  if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_res10 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_res10 != (undefined *)0x0)) &&
     (local_res10 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res10 + -8);
  }
  iVar8 = 1;
  if (1 < iVar4) {
    iVar8 = iVar4;
  }
  iVar4 = 0;
  if ((local_res10 != (undefined *)0x0) && (iVar4 = 0, local_res10 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res10 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_res10);
  }
  FUN_140002e10(&local_res10);
  puVar6 = local_res10;
  if (local_res10 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_1 + 0x128,iVar3);
  puVar6 = local_res10;
  if (local_res10 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_res10 != (undefined *)0x0) && (iVar3 = 0, local_res10 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res10 + -8);
  }
  if ((iVar3 <= iVar8) && (iVar8 = 0, local_res10 != (undefined *)0x0)) {
    if (local_res10 == PTR_DAT_1405d8010) goto LAB_14000d978;
    iVar8 = *(int *)(local_res10 + -8);
  }
  if (((local_res10 != PTR_DAT_1405d8010) && (local_res10 != (undefined *)0x0)) &&
     ((int *)(local_res10 + -8) != (int *)0x0)) {
    *(int *)(local_res10 + -8) = iVar8;
    *(undefined2 *)(local_res10 + (longlong)iVar8 * 2) = 0;
  }
LAB_14000d978:
  plVar7 = (longlong *)(**(longlong **)(*(longlong *)(DAT_140607fd0 + 0x50) + 8) + 0x70);
  (**(code **)(*plVar7 + 0x690))
            (plVar7,1,&DAT_1405d85a0,param_1 + 0x18,param_1 + 0x148,param_1 + 0x118,&local_res10,
             param_1 + 0x108);
  puVar6 = local_res10;
  if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    FUN_14034ed40(uVar5);
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_14000da40(longlong param_1)

{
  longlong lVar1;
  
  if (*(longlong *)(DAT_140607fd0 + 0x50) != 0) {
    lVar1 = **(longlong **)(*(longlong *)(DAT_140607fd0 + 0x50) + 8);
    (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x680))(lVar1 + 0x70,1,&DAT_1405d85a0,param_1 + 0x18)
    ;
  }
  return;
}



void FUN_14000da90(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  undefined8 *puVar2;
  
  *(undefined2 *)(param_2 + 10) = *(undefined2 *)(param_1 + 0x2c);
  *(undefined2 *)((longlong)param_2 + 0x52) = *(undefined2 *)(param_1 + 0x2e);
  param_2[6] = *(undefined8 *)(param_1 + 0x18);
  param_2[7] = *(undefined8 *)(param_1 + 0x20);
  *(undefined4 *)((longlong)param_2 + 0x54) = *(undefined4 *)(param_1 + 0x30);
  *(undefined2 *)(param_2 + 0xb) = *(undefined2 *)(param_1 + 0x34);
  *(undefined4 *)((longlong)param_2 + 0x5a) = *(undefined4 *)(param_1 + 0x38);
  *(undefined4 *)((longlong)param_2 + 0x5e) = *(undefined4 *)(param_1 + 0x3c);
  *(undefined2 *)((longlong)param_2 + 0x62) = *(undefined2 *)(param_1 + 0x40);
  *(undefined4 *)((longlong)param_2 + 100) = *(undefined4 *)(param_1 + 0x48);
  *(undefined4 *)((longlong)param_2 + 0x6c) = *(undefined4 *)(param_1 + 0x4c);
  *(undefined4 *)((longlong)param_2 + 0x74) = *(undefined4 *)(param_1 + 0x50);
  *(undefined4 *)(param_2 + 0xd) = *(undefined4 *)(param_1 + 0x54);
  *(undefined4 *)(param_2 + 0xe) = *(undefined4 *)(param_1 + 0x58);
  *(undefined4 *)(param_2 + 0xf) = *(undefined4 *)(param_1 + 0x5c);
  *(undefined4 *)((longlong)param_2 + 0x7c) = *(undefined4 *)(param_1 + 0x44);
  *(undefined2 *)(param_2 + 0x10) = *(undefined2 *)(param_1 + 0x60);
  *(undefined4 *)((longlong)param_2 + 0x82) = *(undefined4 *)(param_1 + 100);
  *(undefined4 *)((longlong)param_2 + 0x8a) = *(undefined4 *)(param_1 + 0x68);
  *(undefined4 *)((longlong)param_2 + 0x92) = *(undefined4 *)(param_1 + 0x6c);
  *(undefined4 *)((longlong)param_2 + 0x86) = *(undefined4 *)(param_1 + 0x70);
  *(undefined4 *)((longlong)param_2 + 0x8e) = *(undefined4 *)(param_1 + 0x74);
  *(undefined4 *)((longlong)param_2 + 0x96) = *(undefined4 *)(param_1 + 0x78);
  *(undefined1 *)((longlong)param_2 + 0x9a) = *(undefined1 *)(param_1 + 0x7c);
  *(undefined1 *)((longlong)param_2 + 0x9b) = *(undefined1 *)(param_1 + 0x7d);
  *(undefined1 *)((longlong)param_2 + 0x9c) = *(undefined1 *)(param_1 + 0x7e);
  *(undefined4 *)((longlong)param_2 + 0x10f) = *(undefined4 *)(param_1 + 0x88);
  *(undefined2 *)((longlong)param_2 + 0xb1) = *(undefined2 *)(param_1 + 0x84);
  *(undefined2 *)((longlong)param_2 + 0xb3) = *(undefined2 *)(param_1 + 0x86);
  *(undefined4 *)((longlong)param_2 + 0x10f) = *(undefined4 *)(param_1 + 0x88);
  *(undefined2 *)((longlong)param_2 + 0x10d) = *(undefined2 *)(param_1 + 0x94);
  *param_2 = *(undefined8 *)(param_1 + 0xe0);
  param_2[1] = *(undefined8 *)(param_1 + 0xe8);
  param_2[2] = *(undefined8 *)(param_1 + 0xf0);
  param_2[3] = *(undefined8 *)(param_1 + 0xf8);
  *(undefined8 *)((longlong)param_2 + 0xbd) = *(undefined8 *)(param_1 + 0x128);
  *(undefined8 *)((longlong)param_2 + 0xc5) = *(undefined8 *)(param_1 + 0x130);
  *(undefined8 *)((longlong)param_2 + 0xcd) = *(undefined8 *)(param_1 + 0x138);
  *(undefined8 *)((longlong)param_2 + 0xd5) = *(undefined8 *)(param_1 + 0x140);
  param_2[4] = *(undefined8 *)(param_1 + 0xc0);
  param_2[5] = *(undefined8 *)(param_1 + 200);
  *(undefined8 *)((longlong)param_2 + 0xed) = *(undefined8 *)(param_1 + 0x118);
  *(undefined8 *)((longlong)param_2 + 0xf5) = *(undefined8 *)(param_1 + 0x120);
  param_2[8] = *(undefined8 *)(param_1 + 0xd0);
  param_2[9] = *(undefined8 *)(param_1 + 0xd8);
  *(undefined8 *)((longlong)param_2 + 0xdd) = *(undefined8 *)(param_1 + 0x108);
  *(undefined8 *)((longlong)param_2 + 0xe5) = *(undefined8 *)(param_1 + 0x110);
  *(undefined4 *)((longlong)param_2 + 0xb5) = *(undefined4 *)(param_1 + 0x100);
  *(undefined4 *)((longlong)param_2 + 0xb9) = *(undefined4 *)(param_1 + 0x104);
  *(undefined4 *)((longlong)param_2 + 0xfd) = *(undefined4 *)(param_1 + 0x148);
  *(undefined4 *)((longlong)param_2 + 0x101) = *(undefined4 *)(param_1 + 0x14c);
  *(undefined8 *)((longlong)param_2 + 0x105) = *(undefined8 *)(param_1 + 0x150);
  *(undefined2 *)((longlong)param_2 + 0x9d) = *(undefined2 *)(param_1 + 0xac);
  *(undefined2 *)((longlong)param_2 + 0x9f) = *(undefined2 *)(param_1 + 0xae);
  *(undefined4 *)((longlong)param_2 + 0xa1) = *(undefined4 *)(param_1 + 0xb0);
  *(undefined4 *)((longlong)param_2 + 0xa5) = *(undefined4 *)(param_1 + 0xb4);
  *(undefined4 *)((longlong)param_2 + 0xa9) = *(undefined4 *)(param_1 + 0xb8);
  *(undefined4 *)((longlong)param_2 + 0xad) = *(undefined4 *)(param_1 + 0x80);
  lVar1 = *(longlong *)(param_1 + 0x10);
  if (lVar1 != 0) {
    puVar2 = (undefined8 *)(lVar1 + 8);
    if (7 < *(ulonglong *)(lVar1 + 0x20)) {
      puVar2 = (undefined8 *)*puVar2;
    }
    *(undefined8 *)((longlong)param_2 + 0x117) = *puVar2;
    *(undefined8 *)((longlong)param_2 + 0x11f) = puVar2[1];
    *(undefined8 *)((longlong)param_2 + 0x127) = puVar2[2];
    *(undefined8 *)((longlong)param_2 + 0x12f) = puVar2[3];
    *(undefined8 *)((longlong)param_2 + 0x137) = puVar2[4];
    *(undefined8 *)((longlong)param_2 + 0x13f) = puVar2[5];
    *(undefined8 *)((longlong)param_2 + 0x147) = puVar2[6];
    *(undefined4 *)((longlong)param_2 + 0x14f) = *(undefined4 *)(puVar2 + 7);
    *(undefined2 *)((longlong)param_2 + 0x151) = 0;
    *(undefined2 *)((longlong)param_2 + 0x153) =
         *(undefined2 *)(*(longlong *)(param_1 + 0x10) + 0x108);
    *(undefined4 *)((longlong)param_2 + 0x155) =
         *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 200);
  }
  return;
}



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

undefined8
FUN_14000dd90(longlong param_1,undefined4 param_2,int param_3,ulonglong *param_4,undefined8 *param_5
             ,undefined4 *param_6)

{
  undefined *puVar1;
  int *piVar2;
  undefined4 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  undefined *puVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  ulonglong uVar11;
  undefined *puVar12;
  longlong *plVar13;
  longlong lVar14;
  int iVar15;
  bool bVar16;
  undefined1 auStack_138 [32];
  undefined **local_118;
  undefined **local_110;
  undefined8 *local_108;
  undefined4 *local_100;
  undefined4 *local_f8;
  undefined4 *local_f0;
  undefined4 local_e8 [2];
  undefined4 local_e0 [2];
  undefined4 local_d8 [2];
  undefined **local_d0;
  longlong *local_c8;
  longlong local_c0;
  ulonglong local_b8;
  undefined8 local_b0;
  ulonglong local_a8;
  undefined4 uStack_a0;
  undefined4 uStack_9c;
  undefined8 local_98;
  undefined4 local_88;
  undefined4 uStack_84;
  undefined4 uStack_80;
  undefined4 uStack_7c;
  undefined *local_78;
  undefined4 local_70;
  undefined4 uStack_6c;
  undefined8 local_68;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 uStack_50;
  undefined4 uStack_4c;
  ulonglong local_48;
  
  local_98 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_138;
  bVar16 = *(ulonglong *)(param_1 + 0xc0) < *param_4;
  iVar15 = 0;
  if ((*(ulonglong *)(param_1 + 0xc0) != *param_4) ||
     (bVar16 = *(ulonglong *)(param_1 + 200) < param_4[1], iVar9 = iVar15,
     *(ulonglong *)(param_1 + 200) != param_4[1])) {
    iVar9 = (1 - (uint)bVar16) - (uint)(bVar16 != 0);
  }
  if (iVar9 == 0) {
    return 0xda;
  }
  iVar9 = *(int *)(param_1 + 0x148);
  if (param_3 < iVar9) {
    return 0xdc;
  }
  if (param_3 == iVar9) {
    bVar16 = *(ulonglong *)(param_1 + 0x118) < *(ulonglong *)(param_1 + 0xc0);
    if ((*(ulonglong *)(param_1 + 0x118) != *(ulonglong *)(param_1 + 0xc0)) ||
       (bVar16 = *(ulonglong *)(param_1 + 0x120) < *(ulonglong *)(param_1 + 200), iVar8 = iVar15,
       *(ulonglong *)(param_1 + 0x120) != *(ulonglong *)(param_1 + 200))) {
      iVar8 = (1 - (uint)bVar16) - (uint)(bVar16 != 0);
    }
    if (iVar8 != 0) {
      return 0xdc;
    }
  }
  else if ((*(int *)(param_1 + 0x100) <= param_3) && (*(int *)(param_1 + 0x100) != 0)) {
    return 0xdd;
  }
  bVar16 = *(ulonglong *)(param_1 + 0x118) < *param_4;
  if ((*(ulonglong *)(param_1 + 0x118) != *param_4) ||
     (bVar16 = *(ulonglong *)(param_1 + 0x120) < param_4[1], iVar8 = iVar15,
     *(ulonglong *)(param_1 + 0x120) != param_4[1])) {
    iVar8 = (1 - (uint)bVar16) - (uint)(bVar16 != 0);
  }
  if (iVar8 == 0) {
    return 0xdb;
  }
  local_68._0_4_ = *(undefined4 *)(param_1 + 0x118);
  local_68._4_4_ = *(undefined4 *)(param_1 + 0x11c);
  puVar12 = *(undefined **)(param_1 + 0x118);
  uStack_60 = *(undefined4 *)(param_1 + 0x120);
  uStack_5c = *(undefined4 *)(param_1 + 0x124);
  uVar4 = *(ulonglong *)(param_1 + 0x120);
  local_78 = *(undefined **)(param_1 + 0xc0);
  local_70 = *(undefined4 *)(param_1 + 200);
  uStack_6c = *(undefined4 *)(param_1 + 0xcc);
  uVar11 = *(ulonglong *)(param_1 + 200);
  bVar16 = local_78 < puVar12;
  if ((local_78 != puVar12) || (bVar16 = uVar11 < uVar4, iVar8 = iVar15, uVar11 != uVar4)) {
    iVar8 = (1 - (uint)bVar16) - (uint)(bVar16 != 0);
  }
  if (iVar8 == 0) goto LAB_14000e27c;
  local_58 = *(undefined4 *)(param_1 + 0x118);
  uStack_54 = *(undefined4 *)(param_1 + 0x11c);
  uStack_50 = *(undefined4 *)(param_1 + 0x120);
  uStack_4c = *(undefined4 *)(param_1 + 0x124);
  local_68._0_4_ = 0;
  local_68._4_4_ = 0;
  uStack_60 = 0;
  uStack_5c = 0;
  puVar3 = (undefined4 *)(param_1 + 0x128);
  local_100 = (undefined4 *)(param_1 + 0xe0);
  local_f8 = (undefined4 *)CONCAT44(local_f8._4_4_,iVar9);
  local_110 = (undefined **)&local_58;
  local_118 = (undefined **)&local_68;
  local_108 = (undefined8 *)puVar3;
  FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),param_1,0x1d8,0x1c);
  local_68._0_4_ = *(undefined4 *)(param_1 + 0x118);
  local_68._4_4_ = *(undefined4 *)(param_1 + 0x11c);
  uStack_60 = *(undefined4 *)(param_1 + 0x120);
  uStack_5c = *(undefined4 *)(param_1 + 0x124);
  local_78 = *(undefined **)(param_1 + 0x108);
  local_70 = *(undefined4 *)(param_1 + 0x110);
  uStack_6c = *(undefined4 *)(param_1 + 0x114);
  local_100 = (undefined4 *)CONCAT44(local_100._4_4_,9);
  local_110 = (undefined **)&local_68;
  local_118 = &local_78;
  local_108 = (undefined8 *)puVar3;
  FUN_1400091a0(param_2,&DAT_140477960,0,*(undefined4 *)(param_1 + 0x148));
  FUN_14034fe70();
  local_78 = PTR_DAT_1405d8010;
  iVar9 = FUN_14034fcf0(puVar3);
  if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
    iVar15 = *(int *)(local_78 + -8);
  }
  iVar10 = 0;
  iVar8 = iVar9;
  if (((iVar9 <= iVar15) && (iVar8 = iVar10, local_78 != (undefined *)0x0)) &&
     (local_78 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_78 + -8);
  }
  iVar15 = 1;
  if (1 < iVar8) {
    iVar15 = iVar8;
  }
  iVar8 = iVar10;
  if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_78 + -8);
  }
  if (iVar8 < iVar15) {
    FUN_140002d30(&local_78);
  }
  FUN_140002e10(&local_78);
  puVar12 = local_78;
  if (local_78 == (undefined *)0x0) {
    puVar12 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar12,puVar3,iVar9);
  puVar12 = local_78;
  if (local_78 == (undefined *)0x0) {
    puVar12 = PTR_DAT_1405d8010;
  }
  iVar9 = FUN_14034fcf0(puVar12);
  puVar12 = PTR_DAT_1405d8010;
  iVar15 = 0;
  if (0 < iVar9) {
    iVar15 = iVar9;
  }
  iVar9 = iVar10;
  if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
    iVar9 = *(int *)(local_78 + -8);
  }
  if ((iVar15 < iVar9) || (iVar15 = iVar10, local_78 == (undefined *)0x0)) {
LAB_14000e0f1:
    if (((local_78 != PTR_DAT_1405d8010) && (local_78 != (undefined *)0x0)) &&
       ((int *)(local_78 + -8) != (int *)0x0)) {
      *(int *)(local_78 + -8) = iVar15;
      *(undefined2 *)(local_78 + (longlong)iVar15 * 2) = 0;
    }
  }
  else if (local_78 != PTR_DAT_1405d8010) {
    iVar15 = *(int *)(local_78 + -8);
    goto LAB_14000e0f1;
  }
  lVar5 = DAT_140607fd0;
  local_d8[0] = *(undefined4 *)(param_1 + 0x30);
  local_68._0_4_ = *(undefined4 *)(param_1 + 0x18);
  local_68._4_4_ = *(undefined4 *)(param_1 + 0x1c);
  uStack_60 = *(undefined4 *)(param_1 + 0x20);
  uStack_5c = *(undefined4 *)(param_1 + 0x24);
  local_58 = *(undefined4 *)(param_1 + 0x118);
  uStack_54 = *(undefined4 *)(param_1 + 0x11c);
  uStack_50 = *(undefined4 *)(param_1 + 0x120);
  uStack_4c = *(undefined4 *)(param_1 + 0x124);
  local_e0[0] = 0xe8;
  local_e8[0] = 0;
  if (*(longlong *)(DAT_140607fd0 + 0x70) != 0) {
    local_d0 = Proud::CFastArray<>::vftable;
    local_c8 = (longlong *)0x0;
    local_c0 = 0;
    local_b8 = 0;
    local_b0 = 0;
    FUN_14000ac20(*(longlong *)(DAT_140607fd0 + 0x70),&local_d0);
    lVar6 = local_c0;
    lVar14 = local_c0;
    if ((int)local_b8 == 0) {
      lVar14 = 0;
    }
    plVar13 = (longlong *)(*(longlong *)(lVar5 + 0x70) + 0x9c8);
    local_f0 = local_e0;
    local_f8 = local_d8;
    local_100 = (undefined4 *)&local_68;
    local_108 = (undefined8 *)&local_58;
    local_110 = &local_78;
    local_118 = (undefined **)local_e8;
    (**(code **)(*plVar13 + 0x88))(plVar13,lVar14,local_b8 & 0xffffffff,&DAT_1405d85a0);
    puVar12 = PTR_DAT_1405d8010;
    if (lVar6 != 0) {
      if (local_c8 == (longlong *)0x0) {
        FUN_14034ff60(lVar6);
        puVar12 = PTR_DAT_1405d8010;
      }
      else {
        (**(code **)(*local_c8 + 0x18))(local_c8,lVar6);
        puVar12 = PTR_DAT_1405d8010;
      }
    }
  }
  puVar7 = local_78;
  if (((local_78 != (undefined *)0x0) && (local_78 != puVar12)) &&
     (puVar1 = local_78 + -8, puVar1 != (undefined *)0x0)) {
    uVar11 = FUN_14034fe70();
    local_a8 = uVar11;
    FUN_14034ed40(uVar11);
    uStack_a0 = CONCAT31(uStack_a0._1_3_,1);
    piVar2 = (int *)(puVar7 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar11);
    puVar12 = PTR_DAT_1405d8010;
  }
  local_78 = puVar12;
LAB_14000e27c:
  local_a8 = *param_4;
  uStack_a0 = (undefined4)param_4[1];
  uStack_9c = *(undefined4 *)((longlong)param_4 + 0xc);
  local_88 = 0;
  uStack_84 = 0;
  uStack_80 = 0;
  uStack_7c = 0;
  local_100 = (undefined4 *)(param_1 + 0xe0);
  local_f8 = (undefined4 *)CONCAT44(local_f8._4_4_,param_3);
  local_108 = param_5;
  local_110 = (undefined **)&local_a8;
  local_118 = (undefined **)&local_88;
  FUN_140009d30(*(undefined8 *)(DAT_140607fd0 + 0x48),param_1,0x1d7,0xb);
  *(int *)(param_1 + 0x118) = (int)*param_4;
  *(undefined4 *)(param_1 + 0x11c) = *(undefined4 *)((longlong)param_4 + 4);
  *(int *)(param_1 + 0x120) = (int)param_4[1];
  *(undefined4 *)(param_1 + 0x124) = *(undefined4 *)((longlong)param_4 + 0xc);
  *(int *)(param_1 + 0x148) = param_3;
  *(undefined4 *)(param_1 + 0x108) = *param_6;
  *(undefined4 *)(param_1 + 0x10c) = param_6[1];
  *(undefined4 *)(param_1 + 0x110) = param_6[2];
  *(undefined4 *)(param_1 + 0x114) = param_6[3];
  *(undefined8 *)(param_1 + 0x128) = *param_5;
  *(undefined8 *)(param_1 + 0x130) = param_5[1];
  *(undefined8 *)(param_1 + 0x138) = param_5[2];
  *(undefined8 *)(param_1 + 0x140) = param_5[3];
  return 0xe2;
}



undefined4 * FUN_14000e390(undefined4 *param_1,undefined4 *param_2)

{
  *(undefined2 *)(param_1 + 5) = *(undefined2 *)(param_2 + 5);
  *(undefined2 *)((longlong)param_1 + 0x16) = *(undefined2 *)((longlong)param_2 + 0x16);
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  param_1[3] = param_2[3];
  param_1[6] = param_2[6];
  *(undefined2 *)(param_1 + 7) = *(undefined2 *)(param_2 + 7);
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  *(undefined2 *)(param_1 + 10) = *(undefined2 *)(param_2 + 10);
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0xb] = param_2[0xb];
  *(undefined2 *)(param_1 + 0x12) = *(undefined2 *)(param_2 + 0x12);
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  param_1[0x16] = param_2[0x16];
  param_1[0x17] = param_2[0x17];
  param_1[0x18] = param_2[0x18];
  *(undefined1 *)(param_1 + 0x19) = *(undefined1 *)(param_2 + 0x19);
  *(undefined1 *)((longlong)param_1 + 0x65) = *(undefined1 *)((longlong)param_2 + 0x65);
  *(undefined1 *)((longlong)param_1 + 0x66) = *(undefined1 *)((longlong)param_2 + 0x66);
  param_1[0x1c] = param_2[0x1c];
  *(undefined2 *)(param_1 + 0x1b) = *(undefined2 *)(param_2 + 0x1b);
  *(undefined2 *)((longlong)param_1 + 0x6e) = *(undefined2 *)((longlong)param_2 + 0x6e);
  *(undefined8 *)(param_1 + 0x2b) = *(undefined8 *)(param_2 + 0x32);
  *(undefined8 *)(param_1 + 0x2d) = *(undefined8 *)(param_2 + 0x34);
  *(undefined8 *)(param_1 + 0x2f) = *(undefined8 *)(param_2 + 0x36);
  *(undefined8 *)(param_1 + 0x31) = *(undefined8 *)(param_2 + 0x38);
  *(undefined8 *)(param_1 + 0x35) = *(undefined8 *)(param_2 + 0x44);
  *(undefined8 *)(param_1 + 0x37) = *(undefined8 *)(param_2 + 0x46);
  *(undefined8 *)(param_1 + 0x39) = *(undefined8 *)(param_2 + 0x48);
  *(undefined8 *)(param_1 + 0x3b) = *(undefined8 *)(param_2 + 0x4a);
  param_1[0x33] = param_2[0x3a];
  param_1[0x34] = param_2[0x3b];
  param_1[0x3d] = param_2[0x4c];
  *(undefined2 *)(param_1 + 0x1f) = *(undefined2 *)(param_2 + 0x1f);
  *(undefined2 *)(param_1 + 0x25) = *(undefined2 *)(param_2 + 0x25);
  *(undefined2 *)((longlong)param_1 + 0x96) = *(undefined2 *)((longlong)param_2 + 0x96);
  param_1[0x26] = param_2[0x26];
  param_1[0x27] = param_2[0x27];
  param_1[0x28] = param_2[0x28];
  param_1[0x1a] = param_2[0x1a];
  return param_1;
}



undefined8 * FUN_14000e540(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;
}



longlong FUN_14000e6c0(longlong param_1)

{
  FUN_14000a170();
  *(undefined4 *)(param_1 + 0xa8) = 0;
  *(undefined4 *)(param_1 + 0xac) = 0;
  *(undefined4 *)(param_1 + 0xb0) = 0;
  *(undefined4 *)(param_1 + 0xb4) = 0;
  *(undefined4 *)(param_1 + 0xb8) = 0;
  *(undefined4 *)(param_1 + 0xbc) = 0;
  *(undefined4 *)(param_1 + 0xc0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined4 *)(param_1 + 0xc4) = 0;
  *(undefined4 *)(param_1 + 0xf0) = 0;
  *(undefined4 *)(param_1 + 0xf4) = 0;
  *(undefined4 *)(param_1 + 0xf8) = 0;
  *(undefined4 *)(param_1 + 0xfc) = 0;
  *(undefined4 *)(param_1 + 0x100) = 0;
  *(undefined4 *)(param_1 + 0x104) = 0;
  *(undefined4 *)(param_1 + 0x108) = 0;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined4 *)(param_1 + 0x10c) = 0;
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined8 *)(param_1 + 0x118) = 0;
  *(undefined8 *)(param_1 + 0x120) = 0;
  *(undefined8 *)(param_1 + 0x128) = 0;
  return param_1;
}



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

void FUN_14000e7f0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined1 auStack_198 [32];
  longlong local_178;
  undefined1 local_170;
  undefined8 local_168;
  undefined1 local_158 [320];
  ulonglong local_18;
  
  local_168 = 0xfffffffffffffffe;
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_198;
  lVar1 = param_1 + 0xa58;
  local_178 = lVar1;
  FUN_14034ed40(lVar1);
  local_170 = 1;
  uVar4 = (param_2[1] - *param_2) / 0x159;
  iVar2 = (int)uVar4;
  *(int *)(param_1 + 0xa50) = *(int *)(param_1 + 0xa50) + iVar2;
  if (iVar2 != 0) {
    lVar3 = 0;
    uVar4 = uVar4 & 0xffffffff;
    do {
      FUN_14000e6c0(local_158);
      FUN_14000e8e0(local_158,lVar3 + *param_2);
      FUN_140007bc0(*(undefined8 *)(DAT_140607fd0 + 0x48),local_158);
      lVar3 = lVar3 + 0x159;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  FUN_14034edd0(lVar1);
  return;
}



undefined8 * FUN_14000e8e0(undefined8 *param_1,undefined8 *param_2)

{
  *(undefined2 *)((longlong)param_1 + 0x14) = *(undefined2 *)(param_2 + 10);
  *(undefined2 *)((longlong)param_1 + 0x16) = *(undefined2 *)((longlong)param_2 + 0x52);
  *param_1 = param_2[6];
  param_1[1] = param_2[7];
  *(undefined4 *)(param_1 + 3) = *(undefined4 *)((longlong)param_2 + 0x54);
  *(undefined2 *)((longlong)param_1 + 0x1c) = *(undefined2 *)(param_2 + 0xb);
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)((longlong)param_2 + 0x5a);
  *(undefined4 *)((longlong)param_1 + 0x24) = *(undefined4 *)((longlong)param_2 + 0x5e);
  *(undefined2 *)(param_1 + 5) = *(undefined2 *)((longlong)param_2 + 0x62);
  *(undefined4 *)(param_1 + 6) = *(undefined4 *)((longlong)param_2 + 100);
  *(undefined4 *)((longlong)param_1 + 0x34) = *(undefined4 *)((longlong)param_2 + 0x6c);
  *(undefined4 *)(param_1 + 7) = *(undefined4 *)((longlong)param_2 + 0x74);
  *(undefined4 *)((longlong)param_1 + 0x3c) = *(undefined4 *)(param_2 + 0xd);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_2 + 0xe);
  *(undefined4 *)((longlong)param_1 + 0x44) = *(undefined4 *)(param_2 + 0xf);
  *(undefined4 *)((longlong)param_1 + 0x2c) = *(undefined4 *)((longlong)param_2 + 0x7c);
  *(undefined2 *)(param_1 + 9) = *(undefined2 *)(param_2 + 0x10);
  *(undefined4 *)((longlong)param_1 + 0x4c) = *(undefined4 *)((longlong)param_2 + 0x82);
  *(undefined4 *)(param_1 + 10) = *(undefined4 *)((longlong)param_2 + 0x8a);
  *(undefined4 *)((longlong)param_1 + 0x54) = *(undefined4 *)((longlong)param_2 + 0x92);
  *(undefined4 *)(param_1 + 0xb) = *(undefined4 *)((longlong)param_2 + 0x86);
  *(undefined4 *)((longlong)param_1 + 0x5c) = *(undefined4 *)((longlong)param_2 + 0x8e);
  *(undefined4 *)(param_1 + 0xc) = *(undefined4 *)((longlong)param_2 + 0x96);
  *(undefined1 *)((longlong)param_1 + 100) = *(undefined1 *)((longlong)param_2 + 0x9a);
  *(undefined1 *)((longlong)param_1 + 0x65) = *(undefined1 *)((longlong)param_2 + 0x9b);
  *(undefined1 *)((longlong)param_1 + 0x66) = *(undefined1 *)((longlong)param_2 + 0x9c);
  *(undefined4 *)(param_1 + 0xe) = *(undefined4 *)((longlong)param_2 + 0x10f);
  *(undefined2 *)((longlong)param_1 + 0x6c) = *(undefined2 *)((longlong)param_2 + 0xb1);
  *(undefined2 *)((longlong)param_1 + 0x6e) = *(undefined2 *)((longlong)param_2 + 0xb3);
  param_1[0x19] = *param_2;
  param_1[0x1a] = param_2[1];
  param_1[0x1b] = param_2[2];
  param_1[0x1c] = param_2[3];
  param_1[0x22] = *(undefined8 *)((longlong)param_2 + 0xbd);
  param_1[0x23] = *(undefined8 *)((longlong)param_2 + 0xc5);
  param_1[0x24] = *(undefined8 *)((longlong)param_2 + 0xcd);
  param_1[0x25] = *(undefined8 *)((longlong)param_2 + 0xd5);
  param_1[0x15] = param_2[4];
  param_1[0x16] = param_2[5];
  param_1[0x20] = *(undefined8 *)((longlong)param_2 + 0xed);
  param_1[0x21] = *(undefined8 *)((longlong)param_2 + 0xf5);
  param_1[0x17] = param_2[8];
  param_1[0x18] = param_2[9];
  param_1[0x1e] = *(undefined8 *)((longlong)param_2 + 0xdd);
  param_1[0x1f] = *(undefined8 *)((longlong)param_2 + 0xe5);
  *(undefined4 *)(param_1 + 0x1d) = *(undefined4 *)((longlong)param_2 + 0xb5);
  *(undefined4 *)((longlong)param_1 + 0xec) = *(undefined4 *)((longlong)param_2 + 0xb9);
  *(undefined4 *)(param_1 + 0x26) = *(undefined4 *)((longlong)param_2 + 0xfd);
  *(undefined4 *)((longlong)param_1 + 0x134) = *(undefined4 *)((longlong)param_2 + 0x101);
  param_1[0x27] = *(undefined8 *)((longlong)param_2 + 0x105);
  *(undefined2 *)((longlong)param_1 + 0x7c) = *(undefined2 *)((longlong)param_2 + 0x10d);
  *(undefined2 *)((longlong)param_1 + 0x94) = *(undefined2 *)((longlong)param_2 + 0x9d);
  *(undefined2 *)((longlong)param_1 + 0x96) = *(undefined2 *)((longlong)param_2 + 0x9f);
  *(undefined4 *)(param_1 + 0x13) = *(undefined4 *)((longlong)param_2 + 0xa1);
  *(undefined4 *)((longlong)param_1 + 0x9c) = *(undefined4 *)((longlong)param_2 + 0xa5);
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)((longlong)param_2 + 0xa9);
  *(undefined4 *)(param_1 + 0xd) = *(undefined4 *)((longlong)param_2 + 0xad);
  return param_1;
}



void FUN_14000eb30(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_140607be8;
  }
  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_140607be8) {
    operator_delete__(pvVar2);
  }
  return;
}



longlong * FUN_14000ec00(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_140607be8;
    }
    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_140607be8) {
      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_14000ed00(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_14000eb30(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_14000ed80(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_14000eb30();
  }
  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_14000edf0(undefined8 *param_1)

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



undefined8 * FUN_14000ee00(undefined8 *param_1,byte param_2)

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



undefined8 FUN_14000ee30(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 0x00014000ee6a. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar2 = (**(code **)(*param_1 + 0x20))(param_1);
  return uVar2;
}



undefined8 * FUN_14000ee70(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_140607be8;
  param_1[6] = &DAT_140607be8;
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_14000ec00(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_14000ec00(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_14000ef20(undefined8 param_1,undefined8 param_2)

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



undefined8 * FUN_14000ef30(undefined8 *param_1,uint param_2)

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



undefined8 FUN_14000efa0(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_14000f470();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



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

{
  param_1[1] = 0xffffffffffffffff;
  param_1[2] = 0;
  param_1[7] = &DAT_140607be8;
  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_14000ec00(param_1 + 7,&DAT_14047e238,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_14000f470();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14000f0b0(undefined8 *param_1)

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



void FUN_14000f120(longlong *param_1)

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



void * FUN_14000f130(void *param_1,uint param_2)

{
  FUN_14000f0b0();
  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_14000f470();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



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

void FUN_14000f1a0(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_1405d84f0 ^ (ulonglong)auStack_78;
  piVar4 = (int *)*param_1;
  iVar5 = 0;
  uVar7 = *(undefined8 *)piVar4;
  if (0 < (int)uVar7) {
    do {
      _Src = PTR_s__amp__1405e70c0;
      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_1405e70c8;
          uVar9 = *plVar3 + uVar8;
          if (((ulonglong)plVar3[1] < uVar9) && ((ulonglong)plVar3[1] < plVar3[1] + uVar9)) {
            FUN_14000eb30(param_2);
          }
          memmove((void *)(*(longlong *)*param_2 + 0x10 + *param_2),_Src,uVar8);
          *(ulonglong *)*param_2 = uVar9;
          *(undefined1 *)(*param_2 + 0x10 + uVar9) = 0;
          goto LAB_14000f408;
        }
        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_14000eb30(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_14000ed00(param_2,PTR_DAT_1405e70d0,DAT_1405e70d8);
        }
        else if (bVar2 == 0x3e) {
          FUN_14000ed00(param_2,PTR_DAT_1405e70e0,DAT_1405e70e8);
        }
        else if (bVar2 == 0x22) {
          FUN_14000ed00(param_2,PTR_s__quot__1405e70f0,DAT_1405e70f8);
        }
        else if (bVar2 == 0x27) {
          FUN_14000ed00(param_2,PTR_s__apos__1405e7100,DAT_1405e7108);
        }
        else if (bVar2 < 0x20) {
          FUN_140005740(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_14000eb30(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_14000ed80(param_2,bVar2);
        }
LAB_14000f408:
        iVar5 = iVar5 + 1;
      }
      piVar4 = (int *)*param_1;
      uVar7 = *(undefined8 *)piVar4;
    } while (iVar5 < (int)uVar7);
  }
  return;
}



void * FUN_14000f440(void *param_1,uint param_2)

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



void FUN_14000f470(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_140607be8) {
    operator_delete__((void *)param_1[8]);
  }
  *param_1 = TiXmlBase::vftable;
  return;
}



void FUN_14000f4f0(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_14000f550(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_14000f5da;
        }
        param_1 = (longlong *)param_1[3];
      } while (param_1 != (longlong *)0x0);
      lVar2 = 0;
LAB_14000f5da:
      if (*(char *)(lVar2 + 0x58) == '\0') {
        uVar3 = 0xffffffffffffffff;
        *(undefined1 *)(lVar2 + 0x58) = 1;
        *(undefined4 *)(lVar2 + 0x5c) = 0x10;
        pcVar5 = PTR_s_Error_when_TiXmlDocument_added_t_1405e70b0;
        do {
          if (uVar3 == 0) break;
          uVar3 = uVar3 - 1;
          cVar1 = *pcVar5;
          pcVar5 = pcVar5 + 1;
        } while (cVar1 != '\0');
        FUN_14000ec00(lVar2 + 0x60,PTR_s_Error_when_TiXmlDocument_added_t_1405e70b0,~uVar3 - 1);
        *(undefined8 *)(lVar2 + 0x74) = 0xffffffffffffffff;
      }
    }
  }
  return (undefined8 *)0x0;
}



undefined8 FUN_14000f670(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_14000f6d0:
      lVar6 = (**(code **)(*plVar5 + 0x30))(plVar5);
      if (lVar6 != 0) {
                    // WARNING: Could not recover jumptable at 0x00014000f73d. 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_14000f6d0;
        plVar5 = (longlong *)plVar5[10];
        if (plVar5 == (longlong *)0x0) {
          return 0;
        }
      } while( true );
    }
    plVar5 = (longlong *)plVar5[10];
  } while( true );
}



undefined8 FUN_14000f750(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  while( true ) {
    if (plVar1 == (longlong *)0x0) {
      return 0;
    }
    lVar2 = (**(code **)(*plVar1 + 0x30))(plVar1);
    if (lVar2 != 0) break;
    plVar1 = (longlong *)plVar1[10];
  }
                    // WARNING: Could not recover jumptable at 0x00014000f78a. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar3 = (**(code **)(*plVar1 + 0x30))(plVar1);
  return uVar3;
}



undefined8 * FUN_14000f790(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_140607be8;
  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_140607be8;
  param_1[0x11] = &DAT_140607be8;
  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_14000ec00(param_1 + 7,param_2,~uVar3 - 1,param_4,0xfffffffffffffffe);
  return param_1;
}



void * FUN_14000f850(void *param_1,uint param_2)

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



void FUN_14000f880(undefined8 *param_1)

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



void FUN_14000f900(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  FUN_14000f4f0();
  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_14000f990(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_14000f9e0(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_r0x00014000fa60;
      }
      break;
    }
  }
  pvVar5 = operator_new(0x50);
  if (pvVar5 == (void *)0x0) {
    lVar7 = 0;
  }
  else {
    lVar7 = FUN_14000ee70(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__1405e7048;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  FUN_14000ec00(lVar7 + 0x60,PTR_s_Memory_allocation_failed__1405e7048,~uVar6 - 1);
  *(undefined8 *)(lVar7 + 0x74) = 0xffffffffffffffff;
  return;
  while( true ) {
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
    if (cVar1 == '\0') break;
code_r0x00014000fa60:
    if (uVar6 == 0) break;
  }
  FUN_14000ec00(plVar3 + 6,param_3,~uVar6 - 1,plVar3,0xfffffffffffffffe);
  return;
}



void FUN_14000fb50(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_14000fd20(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_14000ec00(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_14000f9e0(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_14000f550(param_2,uVar4);
  }
  return;
}



void FUN_14000fdf0(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 0x00014000fe64. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x18))(param_2,param_1);
  return;
}



longlong FUN_14000fe70(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_14000f790(pvVar1,*(longlong *)(param_1 + 0x38) + 0x10,param_3,param_4,uVar3);
  }
  if (lVar2 == 0) {
    lVar2 = 0;
  }
  else {
    FUN_14000fd20(param_1,lVar2);
  }
  return lVar2;
}



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

{
  param_1[1] = 0xffffffffffffffff;
  param_1[2] = 0;
  param_1[7] = &DAT_140607be8;
  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_140607be8;
  *(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_14000ec00(param_1 + 0xc,&DAT_14047e238,0,param_4,0xfffffffffffffffe);
  *(undefined8 *)((longlong)param_1 + 0x74) = 0;
  return param_1;
}



undefined8 * FUN_14000ff80(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_140607be8;
  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_140607be8;
  *(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_14000ec00(param_1 + 7,param_2,~uVar2 - 1,param_4,0xfffffffffffffffe);
  *(undefined1 *)(param_1 + 0xb) = 0;
  *(undefined4 *)((longlong)param_1 + 0x5c) = 0;
  FUN_14000ec00(param_1 + 0xc,&DAT_14047e238,0);
  *(undefined8 *)((longlong)param_1 + 0x74) = 0;
  return param_1;
}



ulonglong FUN_140010050(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_140607be8;
  }
  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_14000ec00(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_1400101d0(param_1,local_res8);
    fclose(_File);
    if (psVar10 != &DAT_140607be8) {
      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_1405e7040;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        cVar1 = *pcVar8;
        pcVar8 = pcVar8 + 1;
      } while (cVar1 != '\0');
      uVar6 = FUN_14000ec00(param_1 + 0x60,PTR_s_Failed_to_open_file_1405e7040,~uVar6 - 1,param_4,
                            uVar9,psVar11);
      *(undefined4 *)(param_1 + 0x78) = 0xffffffff;
      *(undefined4 *)(param_1 + 0x74) = 0xffffffff;
    }
    if (psVar10 != &DAT_140607be8) {
      operator_delete__(local_38);
      uVar6 = extraout_RAX;
    }
    uVar6 = uVar6 & 0xffffffffffffff00;
  }
  return uVar6;
}



// WARNING: Type propagation algorithm not settling

undefined8 FUN_1400101d0(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_1405e7040;
  }
  else {
    FUN_14000f4f0();
    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_140607be8;
      if (DAT_140607bf0 < uVar14) {
        FUN_14000eb30(&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_140607be8;
            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_140607be8;
                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_140607be8) {
                  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_140607be8;
                  uVar2 = *puVar13;
                  if (uVar15 == 0) {
                    local_res10 = &DAT_140607be8;
                  }
                  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_140607be8) {
                    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_140607be8;
                uVar3 = *puVar12;
                if (uVar2 == 0) {
                  puVar13 = &DAT_140607be8;
                }
                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_140607be8) {
                  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_14000ed00(&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_140607be8) {
            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_1405e7040;
          do {
            if (uVar14 == 0) break;
            uVar14 = uVar14 - 1;
            cVar1 = *pcVar9;
            pcVar9 = pcVar9 + 1;
          } while (cVar1 != '\0');
          FUN_14000ec00(param_1 + 0xc,PTR_s_Failed_to_open_file_1405e7040,~uVar14 - 1);
          *(undefined8 *)((longlong)param_1 + 0x74) = 0xffffffffffffffff;
        }
      }
      if (puVar13 == &DAT_140607be8) {
        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__1405e7098;
  }
  uVar14 = 0xffffffffffffffff;
  pcVar17 = pcVar9;
  do {
    if (uVar14 == 0) break;
    uVar14 = uVar14 - 1;
    cVar1 = *pcVar17;
    pcVar17 = pcVar17 + 1;
  } while (cVar1 != '\0');
  FUN_14000ec00(param_1 + 0xc,pcVar9,~uVar14 - 1);
  *(undefined8 *)((longlong)param_1 + 0x74) = 0xffffffffffffffff;
  return 0;
}



void FUN_1400106e0(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_14000ec00(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_14000ec00(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_14000f550(param_2,uVar3);
  }
  return;
}



longlong FUN_140010790(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_14000fee0(pvVar1);
  }
  if (lVar2 == 0) {
    lVar2 = 0;
  }
  else {
    FUN_1400106e0(param_1,lVar2,param_3,param_4,uVar3);
  }
  return lVar2;
}



void FUN_1400107f0(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_140010850(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 0x0001400108b4. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_2 + 0x20))(param_2,param_1);
  return;
}



void FUN_1400108c0(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_140607be8;
  local_30 = &DAT_140607be8;
  FUN_14000f1a0(param_1 + 0x20,&local_20,param_3,param_4,0xfffffffffffffffe);
  FUN_14000f1a0(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_140010b15;
          FUN_14000ed00(param_3,puVar4 + 2,*puVar4);
          plVar2 = (longlong *)*param_3;
          uVar6 = *plVar2 + 2;
          if (((ulonglong)plVar2[1] < uVar6) && ((ulonglong)plVar2[1] < plVar2[1] + uVar6)) {
            FUN_14000eb30(param_3);
          }
          memmove((void *)(*param_3 + *(longlong *)*param_3 + 0x10),&DAT_14047e290,2);
          *(ulonglong *)*param_3 = uVar6;
          *(undefined1 *)(*param_3 + 0x10 + uVar6) = 0;
          FUN_14000ed00(param_3,puVar3 + 2,*puVar3);
          plVar2 = (longlong *)*param_3;
          uVar6 = *plVar2 + 1;
          if (((ulonglong)plVar2[1] < uVar6) && ((ulonglong)plVar2[1] < plVar2[1] + uVar6)) {
            FUN_14000eb30(param_3);
          }
          _Src = &DAT_14047e294;
          goto LAB_140010af0;
        }
        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_14000ed00(param_3,puVar4 + 2,*puVar4);
    plVar2 = (longlong *)*param_3;
    uVar6 = *plVar2 + 2;
    if (((ulonglong)plVar2[1] < uVar6) && ((ulonglong)plVar2[1] < plVar2[1] + uVar6)) {
      FUN_14000eb30(param_3);
    }
    memmove((void *)(*param_3 + *(longlong *)*param_3 + 0x10),&DAT_14047e280,2);
    *(ulonglong *)*param_3 = uVar6;
    *(undefined1 *)(*param_3 + 0x10 + uVar6) = 0;
    FUN_14000ed00(param_3,puVar3 + 2,*puVar3);
    plVar2 = (longlong *)*param_3;
    uVar6 = *plVar2 + 1;
    if (((ulonglong)plVar2[1] < uVar6) && ((ulonglong)plVar2[1] < plVar2[1] + uVar6)) {
      FUN_14000eb30(param_3);
    }
    _Src = &DAT_14047e284;
LAB_140010af0:
    memmove((void *)(*param_3 + *(longlong *)*param_3 + 0x10),_Src,1);
    *(ulonglong *)*param_3 = uVar6;
    *(undefined1 *)(*param_3 + 0x10 + uVar6) = 0;
  }
LAB_140010b15:
  if (puVar3 != &DAT_140607be8) {
    operator_delete__(local_28);
  }
  if (puVar4 != &DAT_140607be8) {
    operator_delete__(local_18);
  }
  return;
}



void FUN_140010b60(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 0x000140010bb6. Too many branches
                    // WARNING: Treating indirect jump as call
  fprintf(param_2,"<!--%s-->");
  return;
}



void FUN_140010bc0(undefined8 param_1,longlong *param_2)

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



undefined8 * FUN_140010bd0(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_140607be8;
  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_14000ec00(puVar2 + 7,pcVar4,~uVar3 - 1);
  puVar2[2] = *(undefined8 *)(param_1 + 0x10);
  return puVar2;
}



void FUN_140010c80(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_140607be8;
    FUN_14000f1a0(param_1 + 0x38,&local_20,param_3,param_4,0xfffffffffffffffe);
    puVar1 = local_20;
    fprintf(param_2,"%s");
    if (puVar1 != &DAT_140607be8) {
      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_140010d60(undefined8 param_1,longlong *param_2)

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



longlong FUN_140010d70(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_14000eff0();
  }
  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_14000ec00(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_140010e00(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_14000eb30(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_14000eb30(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),"version=\"",9);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
      FUN_14000ed00(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_14000eb30(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),&DAT_14047e2dc,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_14000eb30(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),"encoding=\"",10);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
      FUN_14000ed00(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_14000eb30(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),&DAT_14047e2dc,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_14000eb30(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),"standalone=\"",0xc);
      *(ulonglong *)*param_4 = uVar3;
      *(undefined1 *)(*param_4 + 0x10 + uVar3) = 0;
      FUN_14000ed00(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_14000eb30(param_4);
      }
      memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),&DAT_14047e2dc,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_14000eb30(param_4);
    }
    memmove((void *)(*param_4 + *(longlong *)*param_4 + 0x10),&DAT_14047e328,2);
    *(ulonglong *)*param_4 = uVar3;
    *(undefined1 *)(lVar2 + 0x12 + *param_4) = 0;
  }
  return;
}



void FUN_1400111c0(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_14000ec00(param_2 + 0x38,pcVar3,~uVar2 - 1);
  *(undefined8 *)(param_2 + 0x10) = *(undefined8 *)(param_1 + 0x10);
  FUN_14000ec00(param_2 + 0x58,*(undefined8 **)(param_1 + 0x58) + 2,
                **(undefined8 **)(param_1 + 0x58));
  FUN_14000ec00(param_2 + 0x68,*(undefined8 **)(param_1 + 0x68) + 2,
                **(undefined8 **)(param_1 + 0x68));
  FUN_14000ec00(param_2 + 0x78,*(undefined8 **)(param_1 + 0x78) + 2,
                **(undefined8 **)(param_1 + 0x78));
  return;
}



void FUN_140011250(undefined8 param_1,longlong *param_2)

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



undefined8 * FUN_140011260(undefined8 param_1)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x88);
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = 0xffffffffffffffff;
    puVar1[2] = 0;
    puVar1[7] = &DAT_140607be8;
    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_140607be8;
    puVar1[0xd] = &DAT_140607be8;
    puVar1[0xf] = &DAT_140607be8;
    FUN_1400111c0(param_1,puVar1);
    return puVar1;
  }
  return (undefined8 *)0x0;
}



void FUN_1400112f0(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 0x000140011346. Too many branches
                    // WARNING: Treating indirect jump as call
  fprintf(param_2,"<%s>");
  return;
}



void FUN_140011350(undefined8 param_1,longlong *param_2)

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



undefined8 * FUN_140011360(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_140607be8;
  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_14000ec00(puVar2 + 7,pcVar4,~uVar3 - 1);
  puVar2[2] = *(undefined8 *)(param_1 + 0x10);
  return puVar2;
}



void FUN_140011410(undefined8 *param_1)

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



undefined4 FUN_140011460(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_140011490(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_1405d84f0 ^ (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_1400115a0(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_r0x0001400115d8:
    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_r0x0001400115d8;
          }
          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_r0x0001400115d8;
                    }
                    if (bVar2 == 0xbf) {
                      pbVar5 = pbVar4 + 3;
                      goto joined_r0x0001400115d8;
                    }
                  }
                  iVar7 = iVar7 + 1;
                  pbVar5 = pbVar4 + 3;
                  goto joined_r0x0001400115d8;
                }
                pbVar5 = pbVar4 + 3;
              }
              goto joined_r0x0001400115d8;
            }
          }
          else if (param_3 == 1) {
            iVar6 = *(int *)(&DAT_14047c460 + (ulonglong)bVar1 * 4);
            if (iVar6 == 0) {
              iVar6 = 1;
            }
            iVar7 = iVar7 + 1;
            pbVar5 = pbVar4 + iVar6;
            goto joined_r0x0001400115d8;
          }
          iVar7 = iVar7 + 1;
          pbVar5 = pbVar4 + 1;
          goto joined_r0x0001400115d8;
        }
        iVar8 = iVar8 + 1;
        iVar7 = 0;
        pbVar5 = pbVar4 + 1;
        if (pbVar4[1] == 0xd) {
          pbVar5 = pbVar4 + 2;
        }
      }
      goto joined_r0x0001400115d8;
    }
    *param_1 = iVar8;
    param_1[1] = iVar7;
    *(byte **)(param_1 + 2) = pbVar4;
  }
  return;
}



byte * FUN_1400116f0(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_140011750;
          if (param_1[2] == 0xbe) {
            param_1 = param_1 + 3;
          }
          else {
            if (param_1[2] != 0xbf) goto LAB_140011750;
            param_1 = param_1 + 3;
          }
        }
      }
      else {
LAB_140011750:
        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_1400117d0(byte *param_1,undefined8 param_2)

{
  byte bVar1;
  int iVar2;
  byte *pbVar3;
  
  FUN_14000ec00(param_2,&DAT_14047e238,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_14000ec00(param_2,param_1);
  }
  return pbVar3;
}



char * FUN_140011890(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_1400119c0:
          if (param_4 != 1) {
            *param_2 = (char)iVar4;
            *param_3 = 1;
            return param_1 + lVar7 + 1;
          }
          FUN_140011490(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_1400119c0;
        }
      }
      return (char *)0x0;
    }
  }
  ppuVar6 = &PTR_s__amp__1405e70c0;
  do {
    iVar5 = strncmp(*ppuVar6,param_1,(ulonglong)*(uint *)(ppuVar6 + 1));
    if (iVar5 == 0) {
      *param_3 = 1;
      *param_2 = (&DAT_1405e70cc)[(longlong)iVar4 * 0x10];
      return param_1 + (uint)(&DAT_1405e70c8)[(longlong)iVar4 * 4];
    }
    ppuVar6 = ppuVar6 + 2;
    iVar4 = iVar4 + 1;
  } while ((longlong)ppuVar6 < 0x1405e7110);
  *param_2 = *param_1;
  return param_1 + 1;
}



undefined8 FUN_140011a80(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_140011b00;
      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_140011b00;
      _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_140011b00:
    uVar2 = 1;
  }
  else {
    uVar2 = 0;
  }
  return uVar2;
}



byte * FUN_140011b50(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_14000ec00(param_2,&DAT_14047e238,0);
  if ((param_3 == '\0') || (DAT_1405e0652 == '\0')) {
    while (param_1 != (byte *)0x0) {
      if ((*param_1 == 0) || (cVar4 = FUN_140011a80(param_1,param_4,0,param_5), cVar4 != '\0'))
      goto LAB_140011e52;
      local_res18[0] = 0;
      if (param_5 == 1) {
        local_res8[0] = *(int *)(&DAT_14047c460 + (ulonglong)*param_1 * 4);
        if (local_res8[0] == 1) goto LAB_140011dca;
        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_140011dca:
        if (*param_1 == 0x26) {
          param_1 = (byte *)FUN_140011890(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_14000eb30(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_1400116f0(param_1,param_5);
    if (param_1 == (byte *)0x0) {
      return (byte *)0x0;
    }
    do {
      if ((*param_1 == 0) || (cVar4 = FUN_140011a80(param_1,param_4,0,param_5), cVar4 != '\0'))
      goto LAB_140011e52;
      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_14000ed80(param_2);
          bVar3 = false;
        }
        local_res18[0] = 0;
        if (param_5 == 1) {
          local_res8[0] = *(int *)(&DAT_14047c460 + (ulonglong)*param_1 * 4);
          if (local_res8[0] == 1) goto LAB_140011c8d;
          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_140011cad;
          }
          param_1 = (byte *)0x0;
LAB_140011cb2:
          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_14000eb30(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_140011c8d:
          if (*param_1 == 0x26) {
            param_1 = (byte *)FUN_140011890(param_1,local_res18,local_res8,param_5);
LAB_140011cad:
            if (local_res8[0] != 1) goto LAB_140011cb2;
          }
          else {
            local_res18[0] = (uint)*param_1;
            param_1 = param_1 + 1;
          }
          FUN_14000ed80(param_2,(undefined1)local_res18[0]);
        }
      }
    } while (param_1 != (byte *)0x0);
  }
  return (byte *)0x0;
LAB_140011e52:
  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_140011e70(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_14000ec00(param_1 + 0x60,&DAT_14047e238,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_1400116f0(param_2,param_4);
    if (pcVar4 != (char *)0x0) {
      do {
        if ((*pcVar4 == '\0') ||
           (plVar5 = (longlong *)FUN_140012190(param_1,pcVar4,param_4), plVar5 == (longlong *)0x0))
        break;
        uVar6 = (**(code **)(*plVar5 + 0x10))(plVar5,pcVar4,&local_48,param_4);
        FUN_14000f550(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_14001205a;
              iVar2 = tolower((int)pcVar4[lVar7 + -0x14047e728]);
              iVar3 = tolower((int)*pcVar4);
            } while ((iVar2 == iVar3) && (pcVar4 = pcVar4 + 1, pcVar4[lVar7 + -0x14047e728] != '\0')
                    );
            if (*pcVar4 != '\0') {
              pcVar4 = "UTF8";
              if (*(char *)(lVar7 + 0x10) != '\0') {
                do {
                  if (*pcVar4 == '\0') goto LAB_14001205a;
                  iVar2 = tolower((int)pcVar4[lVar7 + -0x14047e730]);
                  iVar3 = tolower((int)*pcVar4);
                } while ((iVar2 == iVar3) &&
                        (pcVar4 = pcVar4 + 1, pcVar4[lVar7 + -0x14047e730] != '\0'));
                if (*pcVar4 == '\0') goto LAB_14001205a;
              }
              param_4 = 2;
              goto LAB_14001205f;
            }
          }
LAB_14001205a:
          param_4 = 1;
        }
LAB_14001205f:
        pcVar4 = (char *)FUN_1400116f0(uVar6,param_4);
      } while (pcVar4 != (char *)0x0);
      if (*(longlong *)(param_1 + 0x28) != 0) {
        return pcVar4;
      }
      cVar1 = *(char *)(param_1 + 0x58);
      goto LAB_140012099;
    }
  }
  cVar1 = *(char *)(param_1 + 0x58);
LAB_140012099:
  if (cVar1 == '\0') {
    uVar8 = 0xffffffffffffffff;
    *(undefined1 *)(param_1 + 0x58) = 1;
    *(undefined4 *)(param_1 + 0x5c) = 0xd;
    pcVar4 = PTR_s_Error_document_empty__1405e7098;
    do {
      if (uVar8 == 0) break;
      uVar8 = uVar8 - 1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    FUN_14000ec00(param_1 + 0x60,PTR_s_Error_document_empty__1405e7098,~uVar8 - 1);
    *(undefined8 *)(param_1 + 0x74) = 0xffffffffffffffff;
  }
  return (char *)0x0;
}



void FUN_1400120f0(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_1405e7030)[param_2];
    do {
      if (uVar2 == 0) break;
      uVar2 = uVar2 - 1;
      cVar1 = *pcVar3;
      pcVar3 = pcVar3 + 1;
    } while (cVar1 != '\0');
    FUN_14000ec00(param_1 + 0x60,(&PTR_s_No_error_1405e7030)[param_2],~uVar2 - 1);
    *(undefined8 *)(param_1 + 0x74) = 0xffffffffffffffff;
    if ((param_3 != 0) && (param_4 != (undefined8 *)0x0)) {
      FUN_1400115a0(param_4,param_3,param_5);
      *(undefined8 *)(param_1 + 0x74) = *param_4;
    }
  }
  return;
}



undefined8 *
FUN_140012190(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_1400116f0(param_2,param_3 & 0xffffffff,param_3,param_4,0xfffffffffffffffe);
  if (((pcVar3 == (char *)0x0) || (*pcVar3 == '\0')) || (*pcVar3 != '<')) {
    return (undefined8 *)0x0;
  }
  lVar4 = FUN_14000ee30(param_1);
  pcVar3 = (char *)FUN_1400116f0(pcVar3,param_3 & 0xffffffff);
  if (pcVar3 == (char *)0x0) {
    return (undefined8 *)0x0;
  }
  if (*pcVar3 == '\0') {
    return (undefined8 *)0x0;
  }
  cVar1 = FUN_140011a80(pcVar3,&DAT_14047e748,1,param_3 & 0xffffffff);
  if (cVar1 == '\0') {
    pcVar6 = "<!--";
    cVar1 = *pcVar3;
    if (cVar1 != '\0') {
      do {
        if (*pcVar6 == '\0') goto LAB_1400122bb;
      } while (((pcVar3 + -0x14047e350)[(longlong)pcVar6] == *pcVar6) &&
              (pcVar6 = pcVar6 + 1, (pcVar3 + -0x14047e350)[(longlong)pcVar6] != '\0'));
      if (*pcVar6 == '\0') {
LAB_1400122bb:
        puVar5 = operator_new(0x58);
        if (puVar5 != (undefined8 *)0x0) {
          puVar5[1] = 0xffffffffffffffff;
          puVar5[2] = 0;
          puVar5[7] = &DAT_140607be8;
          puVar5[3] = 0;
          *(undefined4 *)(puVar5 + 4) = 2;
          puVar5[5] = 0;
          puVar5[6] = 0;
          puVar5[9] = 0;
          puVar5[10] = 0;
          *puVar5 = TiXmlComment::vftable;
          goto LAB_140012435;
        }
        goto LAB_1400123ed;
      }
    }
    pcVar6 = "<![CDATA[";
    if (cVar1 != '\0') {
      do {
        if (*pcVar6 == '\0') goto LAB_140012341;
      } while (((pcVar3 + -0x14047e340)[(longlong)pcVar6] == *pcVar6) &&
              (pcVar6 = pcVar6 + 1, (pcVar3 + -0x14047e340)[(longlong)pcVar6] != '\0'));
      if (*pcVar6 == '\0') {
LAB_140012341:
        pvVar7 = operator_new(0x60);
        puVar5 = (undefined8 *)0x0;
        if (pvVar7 != (void *)0x0) {
          puVar5 = (undefined8 *)FUN_14000eff0();
        }
        *(undefined1 *)(puVar5 + 0xb) = 1;
        goto LAB_140012435;
      }
    }
    pcVar6 = "<!";
    if (cVar1 == '\0') {
LAB_1400123f3:
      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_14000f790(pvVar7,&DAT_14047e238);
        }
        goto LAB_140012435;
      }
    }
    else {
      do {
        if (*pcVar6 == '\0') goto LAB_14001239a;
      } while ((pcVar6[(longlong)(pcVar3 + -0x14047e750)] == *pcVar6) &&
              (pcVar6 = pcVar6 + 1, pcVar6[(longlong)(pcVar3 + -0x14047e750)] != '\0'));
      if (*pcVar6 != '\0') goto LAB_1400123f3;
    }
LAB_14001239a:
    puVar5 = operator_new(0x58);
    if (puVar5 != (undefined8 *)0x0) {
      puVar5[1] = 0xffffffffffffffff;
      puVar5[2] = 0;
      puVar5[7] = &DAT_140607be8;
      puVar5[3] = 0;
      *(undefined4 *)(puVar5 + 4) = 3;
      puVar5[5] = 0;
      puVar5[6] = 0;
      puVar5[9] = 0;
      puVar5[10] = 0;
      *puVar5 = TiXmlUnknown::vftable;
      goto LAB_140012435;
    }
  }
  else {
    puVar5 = operator_new(0x88);
    if (puVar5 != (undefined8 *)0x0) {
      puVar5[1] = 0xffffffffffffffff;
      puVar5[2] = 0;
      puVar5[7] = &DAT_140607be8;
      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_140607be8;
      puVar5[0xd] = &DAT_140607be8;
      puVar5[0xf] = &DAT_140607be8;
      goto LAB_140012435;
    }
  }
LAB_1400123ed:
  puVar5 = (undefined8 *)0x0;
LAB_140012435:
  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__1405e7048;
  do {
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_14000ec00(lVar4 + 0x60,PTR_s_Memory_allocation_failed__1405e7048,~uVar8 - 1);
  *(undefined8 *)(lVar4 + 0x74) = 0xffffffffffffffff;
  return (undefined8 *)0x0;
}



char * FUN_1400124a0(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_1400116f0(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_14001251a;
    }
  }
  lVar10 = 0;
LAB_14001251a:
  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__1405e7050;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      cVar2 = *pcVar9;
      pcVar9 = pcVar9 + 1;
    } while (cVar2 != '\0');
    FUN_14000ec00(lVar10 + 0x60,PTR_s_Error_parsing_Element__1405e7050,~uVar17 - 1);
    *(undefined4 *)(lVar10 + 0x78) = 0xffffffff;
    *(undefined4 *)(lVar10 + 0x74) = 0xffffffff;
    return (char *)0x0;
  }
  if (param_3 != (longlong *)0x0) {
    FUN_1400115a0(param_3,pcVar9,param_4);
    param_1[1] = *param_3;
  }
  if (*pcVar9 != '<') {
    if (lVar10 == 0) {
      return (char *)0x0;
    }
    FUN_1400120f0(lVar10,4,pcVar9,param_3,param_4);
    return (char *)0x0;
  }
  uVar11 = FUN_1400116f0(pcVar9 + 1,param_4);
  pcVar9 = (char *)FUN_1400117d0(uVar11,param_1 + 7);
  if ((pcVar9 == (char *)0x0) || (*pcVar9 == '\0')) {
    if (lVar10 == 0) {
      return (char *)0x0;
    }
    FUN_1400120f0(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_14047e338,*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_140607be8;
      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_140607be8) {
      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_140607be8;
    }
    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_140607be8) {
      operator_delete__(local_60);
    }
  }
  memmove((void *)(*psVar13 + 0x10 + (longlong)psVar13),&DAT_14047e264,1);
  *psVar13 = uVar17;
  *(undefined1 *)(sVar4 + 0x11 + (longlong)psVar13) = 0;
  while( true ) {
    if (*pcVar9 == '\0') {
      if (psVar13 != &DAT_140607be8) {
        operator_delete__(psVar19);
        return pcVar9;
      }
      return pcVar9;
    }
    pcVar14 = (char *)FUN_1400116f0(pcVar9,param_4);
    if ((pcVar14 == (char *)0x0) || (cVar2 = *pcVar14, cVar2 == '\0')) {
      if (lVar10 != 0) {
        FUN_1400120f0(lVar10,7,pcVar9,param_3,param_4);
      }
      goto LAB_140012944;
    }
    if (cVar2 == '/') {
      if (pcVar14[1] == '>') {
        if (psVar13 != &DAT_140607be8) {
          operator_delete__(psVar19);
        }
        return pcVar14 + 2;
      }
      if (lVar10 != 0) {
        FUN_1400120f0(lVar10,8,pcVar14 + 1,param_3,param_4);
      }
      goto LAB_140012944;
    }
    if (cVar2 == '>') break;
    plVar15 = operator_new(0x50);
    if (plVar15 == (longlong *)0x0) {
      if (lVar10 != 0) {
        FUN_1400120f0(lVar10,3,pcVar9,param_3,param_4);
      }
      goto LAB_140012944;
    }
    *(undefined4 *)((longlong)plVar15 + 0xc) = 0xffffffff;
    *(undefined4 *)(plVar15 + 1) = 0xffffffff;
    plVar15[2] = 0;
    *plVar15 = (longlong)TiXmlAttribute::vftable;
    plVar15[4] = (longlong)&DAT_140607be8;
    plVar15[6] = (longlong)&DAT_140607be8;
    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_1400120f0(lVar10,4,pcVar14,param_3,param_4);
      }
      (**(code **)*plVar15)(plVar15,1);
      goto LAB_140012944;
    }
    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_r0x000140012924;
        }
        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_140012b60(param_1,pcVar14 + 1,param_3,param_4);
  if ((pcVar9 == (char *)0x0) || (*pcVar9 == '\0')) {
    if (lVar10 != 0) {
      FUN_1400120f0(lVar10,9,pcVar9,param_3,param_4);
    }
  }
  else {
    psVar16 = psVar13 + 2;
    lVar18 = (longlong)pcVar9 - (longlong)psVar16;
    do {
      if ((char)*psVar16 == '\0') goto LAB_140012a19;
    } while ((*(char *)(lVar18 + (longlong)psVar16) == (char)*psVar16) &&
            (psVar16 = (size_t *)((longlong)psVar16 + 1),
            *(char *)(lVar18 + (longlong)psVar16) != '\0'));
    if ((char)*psVar16 == '\0') {
LAB_140012a19:
      sVar4 = *psVar13;
      if (psVar13 != &DAT_140607be8) {
        operator_delete__(psVar19);
        return pcVar9 + sVar4;
      }
      return pcVar9 + sVar4;
    }
    if (lVar10 != 0) {
      FUN_1400120f0(lVar10,9,pcVar9,param_3,param_4);
    }
  }
  goto LAB_140012944;
  while( true ) {
    uVar17 = uVar17 - 1;
    cVar2 = *pcVar9;
    pcVar9 = pcVar9 + 1;
    if (cVar2 == '\0') break;
code_r0x000140012924:
    if (uVar17 == 0) break;
  }
  FUN_14000ec00(plVar6 + 6,(char *)(plVar15[6] + 0x10),~uVar17 - 1);
  (**(code **)*plVar15)(plVar15,1);
LAB_140012944:
  if (psVar13 != &DAT_140607be8) {
    operator_delete__(psVar19);
  }
  return (char *)0x0;
}



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

{
  char cVar1;
  byte bVar2;
  int iVar3;
  longlong lVar4;
  char *pcVar5;
  void *pvVar6;
  longlong *plVar7;
  ulonglong *puVar8;
  char *pcVar9;
  ulonglong uVar10;
  undefined8 uVar11;
  
  uVar11 = 0xfffffffffffffffe;
  for (plVar7 = param_1; plVar7 != (longlong *)0x0; plVar7 = (longlong *)plVar7[3]) {
    lVar4 = (**(code **)(*plVar7 + 0x20))(plVar7);
    if (lVar4 != 0) {
      lVar4 = (**(code **)(*plVar7 + 0x20))(plVar7);
      goto LAB_140012bca;
    }
  }
  lVar4 = 0;
LAB_140012bca:
  pcVar5 = (char *)FUN_1400116f0(param_2,param_4);
  if (pcVar5 != (char *)0x0) {
    if (*pcVar5 == '\0') {
      return pcVar5;
    }
    if (*pcVar5 == '<') {
      pcVar9 = "</";
      do {
        if (*pcVar9 == '\0') {
          return pcVar5;
        }
      } while (((pcVar5 + -0x14047e338)[(longlong)pcVar9] == *pcVar9) &&
              (pcVar9 = pcVar9 + 1, (pcVar5 + -0x14047e338)[(longlong)pcVar9] != '\0'));
      if (*pcVar9 == '\0') {
        return pcVar5;
      }
      plVar7 = (longlong *)FUN_140012190(param_1,pcVar5,param_4);
      if (plVar7 == (longlong *)0x0) {
        return (char *)0x0;
      }
      param_2 = (char *)(**(code **)(*plVar7 + 0x10))(plVar7,pcVar5,param_3,param_4,uVar11);
LAB_140012d00:
      FUN_14000f550(param_1,plVar7);
    }
    else {
      pvVar6 = operator_new(0x60);
      if (pvVar6 == (void *)0x0) {
        plVar7 = (longlong *)0x0;
      }
      else {
        plVar7 = (longlong *)FUN_14000eff0();
      }
      if (plVar7 == (longlong *)0x0) {
        if (lVar4 == 0) {
          return (char *)0x0;
        }
        if (*(char *)(lVar4 + 0x58) != '\0') {
          return (char *)0x0;
        }
        *(undefined1 *)(lVar4 + 0x58) = 1;
        *(undefined4 *)(lVar4 + 0x5c) = 3;
        uVar10 = 0xffffffffffffffff;
        pcVar5 = PTR_s_Memory_allocation_failed__1405e7048;
        goto code_r0x000140012d39;
      }
      if (DAT_1405e0652 == '\0') {
        pcVar5 = param_2;
      }
      param_2 = (char *)(**(code **)(*plVar7 + 0x10))(plVar7,pcVar5,param_3,param_4);
      uVar10 = 0;
      puVar8 = (ulonglong *)plVar7[7];
      if (*puVar8 != 0) {
        do {
          bVar2 = *(byte *)((longlong)puVar8 + uVar10 + 0x10);
          iVar3 = isspace((uint)bVar2);
          if (((iVar3 == 0) && (bVar2 != 10)) && (bVar2 != 0xd)) goto LAB_140012d00;
          uVar10 = (ulonglong)((int)uVar10 + 1);
          puVar8 = (ulonglong *)plVar7[7];
        } while (uVar10 < *puVar8);
      }
      (**(code **)*plVar7)(plVar7,1);
    }
    goto LAB_140012bca;
  }
  if ((lVar4 != 0) && (*(char *)(lVar4 + 0x58) == '\0')) {
    *(undefined1 *)(lVar4 + 0x58) = 1;
    *(undefined4 *)(lVar4 + 0x5c) = 6;
    uVar10 = 0xffffffffffffffff;
    pcVar5 = PTR_s_Error_reading_Element_value__1405e7060;
    do {
      if (uVar10 == 0) break;
      uVar10 = uVar10 - 1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar5 + 1;
    } while (cVar1 != '\0');
    FUN_14000ec00(lVar4 + 0x60,PTR_s_Error_reading_Element_value__1405e7060,~uVar10 - 1);
    *(undefined8 *)(lVar4 + 0x74) = 0xffffffffffffffff;
  }
  return (char *)0x0;
  while( true ) {
    uVar10 = uVar10 - 1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    if (cVar1 == '\0') break;
code_r0x000140012d39:
    if (uVar10 == 0) break;
  }
  FUN_14000ec00(lVar4 + 0x60,PTR_s_Memory_allocation_failed__1405e7048,~uVar10 - 1);
  *(undefined8 *)(lVar4 + 0x74) = 0xffffffffffffffff;
  return (char *)0x0;
}



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

{
  char cVar1;
  longlong *plVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  ulonglong uVar6;
  char *pcVar7;
  
  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_140012e1d;
    }
  }
  lVar3 = 0;
LAB_140012e1d:
  pcVar4 = (char *)FUN_1400116f0(param_2,param_4);
  if (param_3 != (longlong *)0x0) {
    FUN_1400115a0(param_3,pcVar4,param_4);
    param_1[1] = *param_3;
  }
  if (((pcVar4 == (char *)0x0) || (*pcVar4 == '\0')) || (*pcVar4 != '<')) {
    if ((lVar3 != 0) && (*(char *)(lVar3 + 0x58) == '\0')) {
      uVar6 = 0xffffffffffffffff;
      *(undefined1 *)(lVar3 + 0x58) = 1;
      *(undefined4 *)(lVar3 + 0x5c) = 10;
      pcVar5 = PTR_s_Error_parsing_Unknown__1405e7080;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
      } while (cVar1 != '\0');
      FUN_14000ec00(lVar3 + 0x60,PTR_s_Error_parsing_Unknown__1405e7080,~uVar6 - 1);
      *(undefined8 *)(lVar3 + 0x74) = 0xffffffffffffffff;
      if ((pcVar4 != (char *)0x0) && (param_3 != (longlong *)0x0)) {
        FUN_1400115a0(param_3,pcVar4,param_4);
        *(longlong *)(lVar3 + 0x74) = *param_3;
      }
    }
    pcVar5 = (char *)0x0;
  }
  else {
    FUN_14000ec00(param_1 + 7,&DAT_14047e238,0);
    while (pcVar5 = pcVar4 + 1, pcVar5 != (char *)0x0) {
      if (*pcVar5 == '\0') goto LAB_140012edb;
      if (*pcVar5 == '>') goto LAB_140012ee0;
      FUN_14000ed80();
      pcVar4 = pcVar5;
    }
    if ((lVar3 != 0) && (*(char *)(lVar3 + 0x58) == '\0')) {
      uVar6 = 0xffffffffffffffff;
      *(undefined1 *)(lVar3 + 0x58) = 1;
      *(undefined4 *)(lVar3 + 0x5c) = 10;
      pcVar7 = PTR_s_Error_parsing_Unknown__1405e7080;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        cVar1 = *pcVar7;
        pcVar7 = pcVar7 + 1;
      } while (cVar1 != '\0');
      FUN_14000ec00(lVar3 + 0x60,PTR_s_Error_parsing_Unknown__1405e7080,~uVar6 - 1);
      *(undefined8 *)(lVar3 + 0x74) = 0xffffffffffffffff;
    }
LAB_140012edb:
    if (*pcVar5 == '>') {
LAB_140012ee0:
      pcVar5 = pcVar4 + 2;
    }
  }
  return pcVar5;
}



char * FUN_140012f80(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_140012fcd;
    }
  }
  uVar6 = 0;
LAB_140012fcd:
  plVar1 = param_1 + 7;
  FUN_14000ec00(plVar1,&DAT_14047e238,0);
  pcVar4 = (char *)FUN_1400116f0(param_2,param_4);
  if (param_3 != (longlong *)0x0) {
    FUN_1400115a0(param_3,pcVar4,param_4);
    param_1[1] = *param_3;
  }
  pcVar7 = "<!--";
  if ((pcVar4 != (char *)0x0) && (*pcVar4 != '\0')) {
    do {
      if (*pcVar7 == '\0') goto LAB_140013050;
    } while (((pcVar4 + -0x14047e350)[(longlong)pcVar7] == *pcVar7) &&
            (pcVar7 = pcVar7 + 1, (pcVar4 + -0x14047e350)[(longlong)pcVar7] != '\0'));
    if (*pcVar7 == '\0') {
LAB_140013050:
      FUN_14000ec00(plVar1,&DAT_14047e238,0);
      pcVar7 = pcVar4 + 4;
      if (pcVar7 == (char *)0x0) {
        return (char *)0x0;
      }
      pcVar4 = pcVar4 + -0x14047e354;
      while (*pcVar7 != '\0') {
        pcVar5 = "-->";
        do {
          if (*pcVar5 == '\0') goto LAB_140013120;
        } 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_14000eb30(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_140013120:
      return pcVar7 + 3;
    }
  }
  FUN_1400120f0(uVar6,0xb,pcVar4,param_3,param_4);
  return (char *)0x0;
}



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

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  undefined *puVar4;
  
  pcVar2 = (char *)FUN_1400116f0(param_2,param_4);
  if ((pcVar2 != (char *)0x0) && (*pcVar2 != '\0')) {
    if (param_3 != (undefined8 *)0x0) {
      FUN_1400115a0(param_3,pcVar2,param_4);
      *(undefined8 *)(param_1 + 8) = *param_3;
    }
    pcVar3 = (char *)FUN_1400117d0(pcVar2,param_1 + 0x20);
    if ((pcVar3 != (char *)0x0) && (*pcVar3 != '\0')) {
      pcVar2 = (char *)FUN_1400116f0(pcVar3,param_4);
      if ((pcVar2 == (char *)0x0) || ((*pcVar2 == '\0' || (*pcVar2 != '=')))) {
        if (*(longlong *)(param_1 + 0x18) != 0) {
          FUN_1400120f0(*(longlong *)(param_1 + 0x18),7,pcVar2,param_3,param_4);
        }
        return (char *)0x0;
      }
      pcVar2 = (char *)FUN_1400116f0(pcVar2 + 1,param_4);
      if ((pcVar2 != (char *)0x0) && (cVar1 = *pcVar2, cVar1 != '\0')) {
        if (cVar1 == '\'') {
          puVar4 = &DAT_14047e294;
        }
        else {
          if (cVar1 != '\"') {
            FUN_14000ec00(param_1 + 0x30,&DAT_14047e238,0);
            while( true ) {
              if (*pcVar2 == '\0') {
                return pcVar2;
              }
              cVar1 = FUN_140011460();
              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_1400120f0(*(longlong *)(param_1 + 0x18),7,pcVar2,param_3,param_4);
                }
                return (char *)0x0;
              }
              FUN_14000ed80(param_1 + 0x30);
              pcVar2 = pcVar2 + 1;
              if (pcVar2 == (char *)0x0) {
                return (char *)0x0;
              }
            }
            return pcVar2;
          }
          puVar4 = &DAT_14047e284;
        }
        pcVar2 = (char *)FUN_140011b50(pcVar2 + 1,param_1 + 0x30,0,puVar4,param_4);
        return pcVar2;
      }
    }
    if (*(longlong *)(param_1 + 0x18) != 0) {
      FUN_1400120f0(*(longlong *)(param_1 + 0x18),7,pcVar2,param_3,param_4);
    }
  }
  return (char *)0x0;
}



longlong FUN_140013350(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_14000ec00(plVar1,&DAT_14047e238,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_1400133c9;
    }
  }
  uVar5 = 0;
LAB_1400133c9:
  if (param_3 != (longlong *)0x0) {
    FUN_1400115a0(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_14001344b;
      } while (((param_2 + -0x14047e340)[(longlong)pcVar7] == *pcVar7) &&
              (pcVar7 = pcVar7 + 1, (param_2 + -0x14047e340)[(longlong)pcVar7] != '\0'));
      if (*pcVar7 == '\0') goto LAB_14001344b;
    }
    lVar4 = FUN_140011b50(param_2,plVar1,1,&DAT_14047e334,param_4);
    if (lVar4 != 0) {
      return lVar4 + -1;
    }
  }
  else {
LAB_14001344b:
    *(undefined1 *)(param_1 + 0xb) = 1;
    if ((param_2 != (char *)0x0) && (*param_2 != '\0')) {
      do {
        if (*pcVar6 == '\0') goto LAB_140013485;
      } while (((param_2 + -0x14047e340)[(longlong)pcVar6] == *pcVar6) &&
              (pcVar6 = pcVar6 + 1, (param_2 + -0x14047e340)[(longlong)pcVar6] != '\0'));
      if (*pcVar6 == '\0') {
LAB_140013485:
        pcVar6 = param_2 + 9;
        if (pcVar6 != (char *)0x0) {
          param_2 = param_2 + -0x14047e343;
          while (cVar2 = *pcVar6, cVar2 != '\0') {
            pcVar7 = "]]>";
            do {
              if (*pcVar7 == '\0') goto LAB_14001352c;
            } 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_14000eb30(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_14001352c:
        local_30 = &DAT_140607be8;
        lVar4 = FUN_140011b50(pcVar6,&local_30,0,&DAT_14047e34c,param_4);
        if (local_30 == &DAT_140607be8) {
          return lVar4;
        }
        operator_delete__(local_28);
        return lVar4;
      }
    }
    FUN_1400120f0(uVar5,0xf,param_2,param_3,param_4);
  }
  return 0;
}



byte * FUN_1400135a0(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_1400116f0(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_14001361a;
    }
  }
  lVar6 = 0;
LAB_14001361a:
  if ((pcVar5 != (char *)0x0) && (*pcVar5 != '\0')) {
    pcVar10 = "<?xml";
    do {
      if (*pcVar10 == '\0') goto LAB_14001368f;
      iVar8 = (int)(pcVar5 + -0x14047e748)[(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 + -0x14047e748)[(longlong)pcVar10] != '\0'));
    if (*pcVar10 == '\0') {
LAB_14001368f:
      if (param_3 != (longlong *)0x0) {
        FUN_1400115a0(param_3,pcVar5,param_4);
        param_1[1] = *param_3;
      }
      FUN_14000ec00(param_1 + 0xb,&DAT_14047e238,0);
      FUN_14000ec00(param_1 + 0xd,&DAT_14047e238,0);
      FUN_14000ec00(param_1 + 0xf,&DAT_14047e238,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_1400116f0(pbVar11,param_4);
          if ((pbVar11 == (byte *)0x0) || (*pbVar11 == 0)) break;
          do {
            if (*pcVar5 == '\0') goto LAB_1400137ac;
            iVar8 = (int)(char)(pbVar11 + -0x14047e758)[(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 + -0x14047e758)[(longlong)pcVar5] != 0));
          if (*pcVar5 != '\0') break;
LAB_1400137ac:
          local_80 = 0xffffffffffffffff;
          local_78 = 0;
          local_88 = TiXmlAttribute::vftable;
          local_68 = &DAT_140607be8;
          local_58 = &DAT_140607be8;
          local_70 = 0;
          local_40 = 0;
          local_48 = 0;
          pbVar11 = (byte *)FUN_140013160(&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_14000ec00(param_1 + 0xb,local_58 + 2,~uVar7 - 1);
LAB_140013a14:
          if (puVar9 != &DAT_140607be8) {
            operator_delete__(local_50);
          }
          if (local_68 != &DAT_140607be8) {
            operator_delete__(local_60);
          }
        }
        pcVar5 = "encoding";
        if ((pbVar11 != (byte *)0x0) && (*pbVar11 != 0)) {
          do {
            if (*pcVar5 == '\0') goto LAB_14001388b;
            iVar8 = (int)pcVar5[(longlong)(pbVar11 + -0x14047e760)];
            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 + -0x14047e760)] != '\0'));
          if (*pcVar5 == '\0') {
LAB_14001388b:
            local_80 = 0xffffffffffffffff;
            local_78 = 0;
            local_88 = TiXmlAttribute::vftable;
            local_68 = &DAT_140607be8;
            local_58 = &DAT_140607be8;
            local_70 = 0;
            local_40 = 0;
            local_48 = 0;
            pbVar11 = (byte *)FUN_140013160(&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_14000ec00(param_1 + 0xd,local_58 + 2,~uVar7 - 1);
            goto LAB_140013a14;
          }
        }
        pcVar5 = "standalone";
        if (pbVar11 == (byte *)0x0) {
          return (byte *)0x0;
        }
        if (*pbVar11 != 0) {
          do {
            if (*pcVar5 == '\0') goto LAB_14001396b;
            iVar8 = (int)pcVar5[(longlong)(pbVar11 + -0x14047e770)];
            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 + -0x14047e770)] != '\0'));
          if (*pcVar5 == '\0') {
LAB_14001396b:
            local_80 = 0xffffffffffffffff;
            local_78 = 0;
            local_88 = TiXmlAttribute::vftable;
            local_68 = &DAT_140607be8;
            local_58 = &DAT_140607be8;
            local_70 = 0;
            local_40 = 0;
            local_48 = 0;
            pbVar11 = (byte *)FUN_140013160(&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_14000ec00(param_1 + 0xf,local_58 + 2,~uVar7 - 1);
            goto LAB_140013a14;
          }
        }
        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__1405e7090;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar5 + 1;
    } while (cVar1 != '\0');
    FUN_14000ec00(lVar6 + 0x60,PTR_s_Error_parsing_Declaration__1405e7090,~uVar7 - 1);
    *(undefined8 *)(lVar6 + 0x74) = 0xffffffffffffffff;
  }
  return (byte *)0x0;
}



void FUN_140013ac0(undefined8 *param_1)

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



undefined8 * FUN_140013ad0(undefined8 *param_1,byte param_2)

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



undefined8 FUN_140013b00(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x20);
}



void * FUN_140013b10(void *param_1,uint param_2)

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



void FUN_140013b40(undefined8 *param_1)

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



void FUN_140013b60(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_1402675e0(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_1402675e0(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_140013bf0(undefined8 *param_1,byte param_2)

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



void FUN_140013c30(longlong param_1)

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



undefined8 * FUN_140013c40(undefined8 *param_1,byte param_2)

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



void FUN_140013c70(undefined8 *param_1)

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



undefined8 * FUN_140013c80(undefined8 *param_1,byte param_2)

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



undefined8 * FUN_140013cb0(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_140013d10(void)

{
  return 45000;
}



undefined8 FUN_140013d20(void)

{
  return 0xafd1;
}



undefined1
FUN_140013d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafc9);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"A2S_Register_AuctionItem_Result",
                     0xafc9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140013e20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafc9);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"A2S_Register_AuctionItem_Result",
                     0xafc9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafca);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 8);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011af60(local_30,lVar2);
      lVar2 = lVar2 + 0x100;
    } while (lVar2 != param_5[1]);
  }
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"A2S_Search_AuctionItem_Result",0xafca)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0xafca);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 8);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_14011af60(local_40,lVar2);
      lVar2 = lVar2 + 0x100;
    } while (lVar2 != param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"A2S_Search_AuctionItem_Result",
                     0xafca);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafcb);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 8);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011af60(local_30,lVar2);
      lVar2 = lVar2 + 0x100;
    } while (lVar2 != param_5[1]);
  }
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"A2S_Search_TypeList_Result",0xafcb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0xafcb);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 8);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_14011af60(local_40,lVar2);
      lVar2 = lVar2 + 0x100;
    } while (lVar2 != param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"A2S_Search_TypeList_Result",0xafcb);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140014400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafcc);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"A2S_Buy_AuctionItem_Result",0xafcc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400144f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafcc);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"A2S_Buy_AuctionItem_Result",0xafcc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400145f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafcd);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"A2S_Bid_AuctionItem_Result",0xafcd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400146e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafcd);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"A2S_Bid_AuctionItem_Result",0xafcd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400147e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafce);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"A2S_SellingCancle_AuctionItem_Result",
                     0xafce);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400148d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafce);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"A2S_SellingCancle_AuctionItem_Result",0xafce);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400149d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafcf);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"A2S_AuctionMsg",0xafcf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140014b10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafcf);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"A2S_AuctionMsg",0xafcf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140014c50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafd0);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"A2S_Search_Sell_Bid_Item_Result",
                     0xafd0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140014d80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xafd0);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"A2S_Search_Sell_Bid_Item_Result",
                     0xafd0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

undefined8 FUN_140014eb0(longlong *param_1,int *param_2,undefined8 param_3)

{
  longlong *plVar1;
  undefined2 *puVar2;
  int *piVar3;
  int iVar4;
  undefined2 *puVar5;
  char cVar6;
  undefined4 uVar7;
  DWORD DVar8;
  longlong *plVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  int iVar12;
  DWORD DVar13;
  undefined1 auStack_3e8 [32];
  undefined8 *local_3c8;
  longlong **local_3c0;
  undefined8 *local_3b8;
  longlong **local_3b0;
  longlong **local_3a8;
  longlong **local_3a0;
  undefined8 *local_398;
  undefined4 *local_390;
  undefined4 *local_388;
  longlong **local_380;
  undefined2 *local_378;
  undefined8 local_370;
  undefined4 local_368;
  undefined4 local_364;
  undefined8 local_360;
  wchar_t *local_358;
  int local_350;
  undefined8 local_348;
  int local_340;
  undefined2 **local_338;
  undefined8 local_330;
  undefined4 local_328;
  undefined4 local_324;
  undefined4 local_320;
  undefined4 local_31c;
  undefined2 *local_318;
  undefined2 *local_310;
  undefined2 *local_308;
  undefined2 *local_300;
  undefined2 *local_2f8;
  undefined2 *local_2f0;
  undefined *local_2e8;
  undefined *local_2e0;
  undefined4 local_2d8 [2];
  undefined *local_2d0;
  undefined4 local_2c8 [2];
  undefined *local_2c0;
  undefined *local_2b8;
  undefined2 *local_2b0;
  undefined4 local_2a8;
  undefined4 local_2a4;
  undefined4 local_2a0;
  undefined4 local_29c;
  undefined4 local_298;
  undefined4 local_294;
  undefined *local_290;
  undefined *local_288;
  undefined *local_280;
  undefined *local_278;
  undefined8 local_270;
  undefined1 local_268;
  undefined *local_260;
  undefined1 local_258 [4];
  int local_254;
  undefined8 local_220;
  undefined1 local_1f8 [8];
  undefined1 local_1f0 [8];
  undefined1 local_1e8 [8];
  undefined8 local_1e0;
  undefined1 local_1d8 [8];
  undefined8 local_1d0;
  undefined1 local_1c8;
  longlong *local_1c0 [2];
  longlong *local_1b0;
  undefined1 local_1a8;
  undefined1 local_1a0 [24];
  undefined8 local_188 [2];
  short local_174;
  short local_172;
  undefined4 local_170;
  short local_16c;
  ulonglong local_48;
  
  local_1e0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_3e8;
  iVar4 = param_2[10];
  if (iVar4 == 0) {
    FUN_140385b50(param_1,0);
  }
  iVar12 = *param_2;
  cVar6 = FUN_140384a90(param_2,&local_294);
  if (cVar6 == '\0') {
switchD_140014f4e_default:
    FUN_140383db0(param_2,(int)((iVar12 >> 0x1f & 7U) + iVar12) >> 3);
    uVar11 = 0;
  }
  else {
    local_220 = param_3;
    switch(local_294) {
    case 0xb02d:
      FUN_14035b390(local_258);
      local_254 = param_2[10];
      local_258[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_370);
      FUN_14000e6c0(local_188);
      FUN_14011a980(param_2,local_188);
      FUN_1403840e0(param_2,&local_368,4);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"S2A_Register_AuctionItem");
      iVar12 = 0;
      DVar13 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_3c8 = (undefined8 *)&DAT_140477960;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0xb02d,L"S2A_Register_AuctionItem");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_378 = (undefined2 *)PTR_DAT_1405d8010;
        local_298 = (undefined4)local_370;
        FUN_1403a1a60(&local_378,&local_298);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_14034fe70();
        local_1c0[0] = (longlong *)PTR_DAT_1405d8010;
        local_3c0 = (longlong **)CONCAT44(local_3c0._4_4_,(int)local_16c);
        local_3c8 = (undefined8 *)CONCAT44(local_3c8._4_4_,local_170);
        FUN_140017720(local_1c0,L"{%d,%d,%d,%d }",(int)local_174,(int)local_172);
        FUN_140017520(&local_378,local_1c0);
        plVar9 = local_1c0[0];
        if (((local_1c0[0] != (longlong *)0x0) && (local_1c0[0] != (longlong *)PTR_DAT_1405d8010))
           && (plVar1 = local_1c0[0] + -1, plVar1 != (longlong *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          piVar3 = (int *)((longlong)plVar9 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(plVar1);
          }
          FUN_14034edd0(uVar11);
        }
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_330);
        FUN_140017790(&local_378,&DAT_14047edb0);
        if ((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) {
          iVar12 = *(int *)(local_378 + -4);
        }
        local_1c0[0] = (longlong *)FUN_1400174a0(&local_378,&local_288,iVar12 + -2);
        if (local_378 == (undefined2 *)0x0) {
          local_378 = (undefined2 *)PTR_DAT_1405d8010;
        }
        if ((undefined2 *)*local_1c0[0] != local_378) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          puVar5 = local_378;
          local_1c8 = 1;
          if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010))
             && (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
            plVar9 = (longlong *)FUN_14034fe70();
            local_1b0 = plVar9;
            FUN_14034ed40(plVar9);
            local_1a8 = 1;
            piVar3 = (int *)(puVar5 + -2);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(plVar9);
          }
          local_378 = (undefined2 *)*local_1c0[0];
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        if (((local_288 != (undefined *)0x0) && (local_288 != PTR_DAT_1405d8010)) &&
           (local_288 + -8 != (undefined *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          piVar3 = (int *)(local_288 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_288 + -8);
          }
          FUN_14034edd0(uVar11);
        }
        local_338 = &local_310;
        local_288 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_310 = (undefined2 *)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_310 = (undefined2 *)0x0;
        }
        if (local_378 != (undefined2 *)PTR_DAT_1405d8010) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          FUN_1400031d0(&local_310);
          local_310 = local_378;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        FUN_14034fe70();
        local_2b8 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"S2A_Register_AuctionItem");
        uVar11 = FUN_140002f00(&local_2b8,uVar7);
        FUN_14034fd20(uVar11,L"S2A_Register_AuctionItem",uVar7);
        FUN_140002fe0(&local_2b8);
        (**(code **)(*param_1 + 0x28))(param_1,0xb02d,&local_2b8,&local_310);
        local_3c8 = (undefined8 *)local_378;
        if (local_378 == (undefined2 *)0x0) {
          local_3c8 = (undefined8 *)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0xb02d,L"S2A_Register_AuctionItem");
        puVar5 = local_378;
        if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) &&
           (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          piVar3 = (int *)(puVar5 + -2);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(puVar2);
          }
          FUN_14034edd0(uVar11);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb02d);
        local_358 = L"S2A_Register_AuctionItem";
        local_350 = iVar4;
        local_348 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_360);
        DVar13 = GetTickCount();
      }
      local_3c0 = (longlong **)&local_330;
      local_3c8 = local_188;
      cVar6 = (**(code **)(*param_1 + 0x38))(param_1,iVar4,local_258,&local_370);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"S2A_Register_AuctionItem");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb02d);
        local_358 = L"S2A_Register_AuctionItem";
LAB_140015465:
        local_350 = iVar4;
        local_348 = param_3;
        DVar8 = GetTickCount();
        local_340 = DVar8 - DVar13;
        (**(code **)(*param_1 + 0x18))(param_1,&local_360);
      }
      break;
    case 0xb02e:
      FUN_14035b390(local_258);
      local_254 = param_2[10];
      local_258[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_368);
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_370._0_4_ = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_370._4_4_ = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_364 = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_330._4_4_ = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_328 = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_320 = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_324 = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_31c = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_330._0_4_ = local_378._0_4_;
      }
      FUN_14034fe70();
      local_1c0[0] = (longlong *)PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_2,local_1c0);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"S2A_Search_AuctionItem");
      DVar13 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_3c8 = (undefined8 *)&DAT_140477960;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0xb02e,L"S2A_Search_AuctionItem");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_378 = (undefined2 *)PTR_DAT_1405d8010;
        local_2a0 = local_368;
        FUN_1403a1a60(&local_378,&local_2a0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_370);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,(undefined4 *)((longlong)&local_370 + 4));
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_364);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,(undefined4 *)((longlong)&local_330 + 4));
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_328);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_320);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_324);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_31c);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_330);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d20(&local_378,local_1c0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        DVar8 = DVar13;
        if ((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) {
          DVar8 = *(DWORD *)(local_378 + -4);
        }
        local_338 = (undefined2 **)FUN_1400174a0(&local_378,&local_278,DVar8 - 2);
        if (local_378 == (undefined2 *)0x0) {
          local_378 = (undefined2 *)PTR_DAT_1405d8010;
        }
        if (*local_338 != local_378) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          puVar5 = local_378;
          local_1c8 = 1;
          if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010))
             && (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
            plVar9 = (longlong *)FUN_14034fe70();
            local_1b0 = plVar9;
            FUN_14034ed40(plVar9);
            local_1a8 = 1;
            piVar3 = (int *)(puVar5 + -2);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(plVar9);
          }
          local_378 = *local_338;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        if (((local_278 != (undefined *)0x0) && (local_278 != PTR_DAT_1405d8010)) &&
           (local_278 + -8 != (undefined *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          piVar3 = (int *)(local_278 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_278 + -8);
          }
          FUN_14034edd0(uVar11);
        }
        local_338 = &local_308;
        local_278 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_308 = (undefined2 *)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_308 = (undefined2 *)0x0;
        }
        if (local_378 != (undefined2 *)PTR_DAT_1405d8010) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          FUN_1400031d0(&local_308);
          local_308 = local_378;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        FUN_14034fe70();
        local_2e8 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"S2A_Search_AuctionItem");
        uVar11 = FUN_140002f00(&local_2e8,uVar7);
        FUN_14034fd20(uVar11,L"S2A_Search_AuctionItem",uVar7);
        FUN_140002fe0(&local_2e8);
        (**(code **)(*param_1 + 0x28))(param_1,0xb02e,&local_2e8,&local_308);
        local_3c8 = (undefined8 *)local_378;
        if (local_378 == (undefined2 *)0x0) {
          local_3c8 = (undefined8 *)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0xb02e,L"S2A_Search_AuctionItem");
        puVar5 = local_378;
        if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) &&
           (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          piVar3 = (int *)(puVar5 + -2);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(puVar2);
          }
          FUN_14034edd0(uVar11);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb02e);
        local_358 = L"S2A_Search_AuctionItem";
        local_350 = iVar4;
        local_348 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_360);
        DVar13 = GetTickCount();
      }
      local_380 = local_1c0;
      local_388 = (undefined4 *)&local_330;
      local_390 = &local_31c;
      local_398 = (undefined8 *)&local_324;
      local_3a0 = (longlong **)&local_320;
      local_3a8 = (longlong **)&local_328;
      local_3b0 = (longlong **)((longlong)&local_330 + 4);
      local_3b8 = (undefined8 *)&local_364;
      local_3c0 = (longlong **)((longlong)&local_370 + 4);
      local_3c8 = &local_370;
      cVar6 = (**(code **)(*param_1 + 0x40))(param_1,iVar4,local_258,&local_368);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"S2A_Search_AuctionItem");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb02e);
        local_358 = L"S2A_Search_AuctionItem";
        local_350 = iVar4;
        local_348 = param_3;
        DVar8 = GetTickCount();
        local_340 = DVar8 - DVar13;
        (**(code **)(*param_1 + 0x18))(param_1,&local_360);
      }
      plVar9 = local_1c0[0];
      if (((local_1c0[0] != (longlong *)0x0) && (local_1c0[0] != (longlong *)PTR_DAT_1405d8010)) &&
         (plVar1 = local_1c0[0] + -1, plVar1 != (longlong *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_1d0 = uVar11;
        FUN_14034ed40(uVar11);
        local_1c8 = 1;
        piVar3 = (int *)((longlong)plVar9 + -4);
        *piVar3 = *piVar3 + -1;
        if (*piVar3 == 0) {
          FUN_14034ff60(plVar1);
        }
        FUN_14034edd0(uVar11);
      }
      break;
    case 0xb02f:
      FUN_14035b390(local_258);
      local_254 = param_2[10];
      local_258[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_368);
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_370._4_4_ = local_378._0_4_;
      }
      FUN_1403a1710(param_2,local_1c0);
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_370._0_4_ = local_378._0_4_;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"S2A_Search_TypeList");
      iVar12 = 0;
      DVar13 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_3c8 = (undefined8 *)&DAT_140477960;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0xb02f,L"S2A_Search_TypeList");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_378 = (undefined2 *)PTR_DAT_1405d8010;
        local_2a4 = local_368;
        FUN_1403a1a60(&local_378,&local_2a4);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,(undefined4 *)((longlong)&local_370 + 4));
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,local_1c0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_370);
        FUN_140017790(&local_378,&DAT_14047edb0);
        if ((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) {
          iVar12 = *(int *)(local_378 + -4);
        }
        local_338 = (undefined2 **)FUN_1400174a0(&local_378,&local_290,iVar12 + -2);
        if (local_378 == (undefined2 *)0x0) {
          local_378 = (undefined2 *)PTR_DAT_1405d8010;
        }
        if (*local_338 != local_378) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          puVar5 = local_378;
          local_1c8 = 1;
          if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010))
             && (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
            plVar9 = (longlong *)FUN_14034fe70();
            local_1b0 = plVar9;
            FUN_14034ed40(plVar9);
            local_1a8 = 1;
            piVar3 = (int *)(puVar5 + -2);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(plVar9);
          }
          local_378 = *local_338;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        if (((local_290 != (undefined *)0x0) && (local_290 != PTR_DAT_1405d8010)) &&
           (local_290 + -8 != (undefined *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          piVar3 = (int *)(local_290 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_290 + -8);
          }
          FUN_14034edd0(uVar11);
        }
        local_338 = &local_2f8;
        local_290 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_2f8 = (undefined2 *)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_2f8 = (undefined2 *)0x0;
        }
        if (local_378 != (undefined2 *)PTR_DAT_1405d8010) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          FUN_1400031d0(&local_2f8);
          local_2f8 = local_378;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        FUN_14034fe70();
        local_2e0 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"S2A_Search_TypeList");
        uVar11 = FUN_140002f00(&local_2e0,uVar7);
        FUN_14034fd20(uVar11,L"S2A_Search_TypeList",uVar7);
        FUN_140002fe0(&local_2e0);
        (**(code **)(*param_1 + 0x28))(param_1,0xb02f,&local_2e0,&local_2f8);
        local_3c8 = (undefined8 *)local_378;
        if (local_378 == (undefined2 *)0x0) {
          local_3c8 = (undefined8 *)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0xb02f,L"S2A_Search_TypeList");
        puVar5 = local_378;
        if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) &&
           (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_1d0 = uVar11;
          FUN_14034ed40(uVar11);
          local_1c8 = 1;
          piVar3 = (int *)(puVar5 + -2);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(puVar2);
          }
          FUN_14034edd0(uVar11);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb02f);
        local_358 = L"S2A_Search_TypeList";
        local_350 = iVar4;
        local_348 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_360);
        DVar13 = GetTickCount();
      }
      local_3b8 = &local_370;
      local_3c0 = local_1c0;
      local_3c8 = (undefined8 *)((longlong)&local_370 + 4);
      cVar6 = (**(code **)(*param_1 + 0x48))(param_1,iVar4,local_258,&local_368);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"S2A_Search_TypeList")
        ;
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb02f);
        local_358 = L"S2A_Search_TypeList";
        goto LAB_140015465;
      }
      break;
    case 0xb030:
      FUN_14035b390(local_258);
      local_254 = param_2[10];
      local_258[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_368);
      FUN_1403a1710(param_2,&local_1d0);
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_364 = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_370._4_4_ = local_378._0_4_;
      }
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_370._0_4_ = local_378._0_4_;
      }
      FUN_1403a1710(param_2,&local_1b0);
      FUN_14034fe70();
      local_1c0[0] = (longlong *)PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_2,local_1c0);
      FUN_1403a1710(param_2,local_1a0);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"S2A_Buy_AuctionItem");
      DVar13 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_3c8 = (undefined8 *)&DAT_140477960;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0xb030,L"S2A_Buy_AuctionItem");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_378 = (undefined2 *)PTR_DAT_1405d8010;
        local_29c = local_368;
        FUN_1403a1a60(&local_378,&local_29c);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,&local_1d0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_364);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,(undefined4 *)((longlong)&local_370 + 4));
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_370);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,&local_1b0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d20(&local_378,local_1c0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,local_1a0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        DVar8 = DVar13;
        if ((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) {
          DVar8 = *(DWORD *)(local_378 + -4);
        }
        local_338 = (undefined2 **)FUN_1400174a0(&local_378,&local_260,DVar8 - 2);
        if (local_378 == (undefined2 *)0x0) {
          local_378 = (undefined2 *)PTR_DAT_1405d8010;
        }
        if (*local_338 != local_378) {
          uVar11 = FUN_14034fe70();
          local_270 = uVar11;
          FUN_14034ed40(uVar11);
          puVar5 = local_378;
          local_268 = 1;
          if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010))
             && (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
            uVar10 = FUN_14034fe70();
            local_360 = uVar10;
            FUN_14034ed40(uVar10);
            local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
            piVar3 = (int *)(puVar5 + -2);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(uVar10);
          }
          local_378 = *local_338;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        if (((local_260 != (undefined *)0x0) && (local_260 != PTR_DAT_1405d8010)) &&
           (local_260 + -8 != (undefined *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_360 = uVar11;
          FUN_14034ed40(uVar11);
          local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
          piVar3 = (int *)(local_260 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_260 + -8);
          }
          FUN_14034edd0(uVar11);
        }
        local_338 = &local_300;
        local_260 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_300 = (undefined2 *)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_300 = (undefined2 *)0x0;
        }
        if (local_378 != (undefined2 *)PTR_DAT_1405d8010) {
          uVar11 = FUN_14034fe70();
          local_360 = uVar11;
          FUN_14034ed40(uVar11);
          local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
          FUN_1400031d0(&local_300);
          local_300 = local_378;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        FUN_14034fe70();
        local_2d0 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"S2A_Buy_AuctionItem");
        uVar11 = FUN_140002f00(&local_2d0,uVar7);
        FUN_14034fd20(uVar11,L"S2A_Buy_AuctionItem",uVar7);
        FUN_140002fe0(&local_2d0);
        (**(code **)(*param_1 + 0x28))(param_1,0xb030,&local_2d0,&local_300);
        local_3c8 = (undefined8 *)local_378;
        if (local_378 == (undefined2 *)0x0) {
          local_3c8 = (undefined8 *)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0xb030,L"S2A_Buy_AuctionItem");
        puVar5 = local_378;
        if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) &&
           (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_360 = uVar11;
          FUN_14034ed40(uVar11);
          local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
          piVar3 = (int *)(puVar5 + -2);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(puVar2);
          }
          FUN_14034edd0(uVar11);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb030);
        local_358 = L"S2A_Buy_AuctionItem";
        local_350 = iVar4;
        local_348 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_360);
        DVar13 = GetTickCount();
      }
      local_398 = (undefined8 *)local_1a0;
      local_3a0 = local_1c0;
      local_3a8 = &local_1b0;
      local_3b0 = (longlong **)&local_370;
      local_3b8 = (undefined8 *)((longlong)&local_370 + 4);
      local_3c0 = (longlong **)&local_364;
      local_3c8 = &local_1d0;
      cVar6 = (**(code **)(*param_1 + 0x50))(param_1,iVar4,local_258,&local_368);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"S2A_Buy_AuctionItem")
        ;
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb030);
        local_358 = L"S2A_Buy_AuctionItem";
        local_350 = iVar4;
        local_348 = param_3;
        DVar8 = GetTickCount();
        local_340 = DVar8 - DVar13;
        (**(code **)(*param_1 + 0x18))(param_1,&local_360);
      }
      plVar9 = local_1c0[0];
      if (((local_1c0[0] != (longlong *)0x0) && (local_1c0[0] != (longlong *)PTR_DAT_1405d8010)) &&
         (plVar1 = local_1c0[0] + -1, plVar1 != (longlong *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_360 = uVar11;
        FUN_14034ed40(uVar11);
        local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
        piVar3 = (int *)((longlong)plVar9 + -4);
        *piVar3 = *piVar3 + -1;
        if (*piVar3 == 0) {
          FUN_14034ff60(plVar1);
        }
        FUN_14034edd0(uVar11);
      }
      break;
    case 0xb031:
      FUN_14035b390(local_258);
      local_254 = param_2[10];
      local_258[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_368);
      FUN_1403a1710(param_2,local_1a0);
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_364 = local_378._0_4_;
      }
      FUN_1403840e0(param_2,(undefined4 *)((longlong)&local_330 + 4),4);
      FUN_1403840e0(param_2,&local_328,4);
      FUN_1403a1710(param_2,&local_1b0);
      FUN_14034fe70();
      local_1c0[0] = (longlong *)PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_2,local_1c0);
      FUN_1403a1710(param_2,&local_1d0);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"S2A_Bid_AuctionItem");
      DVar13 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_3c8 = (undefined8 *)&DAT_140477960;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0xb031,L"S2A_Bid_AuctionItem");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_378 = (undefined2 *)PTR_DAT_1405d8010;
        local_2d8[0] = local_368;
        FUN_1403a1a60(&local_378,local_2d8);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,local_1a0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_364);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,(undefined4 *)((longlong)&local_370 + 4));
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_370);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,&local_1b0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d20(&local_378,local_1c0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,&local_1d0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        DVar8 = DVar13;
        if ((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) {
          DVar8 = *(DWORD *)(local_378 + -4);
        }
        local_338 = (undefined2 **)FUN_1400174a0(&local_378,&local_280,DVar8 - 2);
        if (local_378 == (undefined2 *)0x0) {
          local_378 = (undefined2 *)PTR_DAT_1405d8010;
        }
        if (*local_338 != local_378) {
          uVar11 = FUN_14034fe70();
          local_360 = uVar11;
          FUN_14034ed40(uVar11);
          puVar5 = local_378;
          local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
          if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010))
             && (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
            uVar10 = FUN_14034fe70();
            local_270 = uVar10;
            FUN_14034ed40(uVar10);
            local_268 = 1;
            piVar3 = (int *)(puVar5 + -2);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(uVar10);
          }
          local_378 = *local_338;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        if (((local_280 != (undefined *)0x0) && (local_280 != PTR_DAT_1405d8010)) &&
           (local_280 + -8 != (undefined *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_360 = uVar11;
          FUN_14034ed40(uVar11);
          local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
          piVar3 = (int *)(local_280 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_280 + -8);
          }
          FUN_14034edd0(uVar11);
        }
        local_338 = &local_318;
        local_280 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_318 = (undefined2 *)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_318 = (undefined2 *)0x0;
        }
        if (local_378 != (undefined2 *)PTR_DAT_1405d8010) {
          uVar11 = FUN_14034fe70();
          local_360 = uVar11;
          FUN_14034ed40(uVar11);
          local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
          FUN_1400031d0(&local_318);
          local_318 = local_378;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        FUN_14034fe70();
        local_2c0 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"S2A_Bid_AuctionItem");
        uVar11 = FUN_140002f00(&local_2c0,uVar7);
        FUN_14034fd20(uVar11,L"S2A_Bid_AuctionItem",uVar7);
        FUN_140002fe0(&local_2c0);
        (**(code **)(*param_1 + 0x28))(param_1,0xb031,&local_2c0,&local_318);
        local_3c8 = (undefined8 *)local_378;
        if (local_378 == (undefined2 *)0x0) {
          local_3c8 = (undefined8 *)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0xb031,L"S2A_Bid_AuctionItem");
        puVar5 = local_378;
        if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) &&
           (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
          uVar11 = FUN_14034fe70();
          local_360 = uVar11;
          FUN_14034ed40(uVar11);
          local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
          piVar3 = (int *)(puVar5 + -2);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(puVar2);
          }
          FUN_14034edd0(uVar11);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb031);
        local_358 = L"S2A_Bid_AuctionItem";
        local_350 = iVar4;
        local_348 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_360);
        DVar13 = GetTickCount();
      }
      local_398 = &local_1d0;
      local_3a0 = local_1c0;
      local_3a8 = &local_1b0;
      local_3b0 = (longlong **)&local_370;
      local_3b8 = (undefined8 *)((longlong)&local_370 + 4);
      local_3c0 = (longlong **)&local_364;
      local_3c8 = (undefined8 *)local_1a0;
      cVar6 = (**(code **)(*param_1 + 0x58))(param_1,iVar4,local_258,&local_368);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"S2A_Bid_AuctionItem")
        ;
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb031);
        local_358 = L"S2A_Bid_AuctionItem";
        local_350 = iVar4;
        local_348 = param_3;
        DVar8 = GetTickCount();
        local_340 = DVar8 - DVar13;
        (**(code **)(*param_1 + 0x18))(param_1,&local_360);
      }
      plVar9 = local_1c0[0];
      if (((local_1c0[0] != (longlong *)0x0) && (local_1c0[0] != (longlong *)PTR_DAT_1405d8010)) &&
         (plVar1 = local_1c0[0] + -1, plVar1 != (longlong *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_360 = uVar11;
        FUN_14034ed40(uVar11);
        local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
        piVar3 = (int *)((longlong)plVar9 + -4);
        *piVar3 = *piVar3 + -1;
        if (*piVar3 == 0) {
          FUN_14034ff60(plVar1);
        }
        FUN_14034edd0(uVar11);
      }
      break;
    case 0xb032:
      FUN_14035b390(local_258);
      local_254 = param_2[10];
      local_258[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_368);
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_370._0_4_ = local_378._0_4_;
      }
      FUN_1403a1710(param_2,&local_1b0);
      FUN_1403a1710(param_2,&local_1d0);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"S2A_SellingCancle_AuctionItem");
      DVar13 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_3c8 = (undefined8 *)&DAT_140477960;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0xb032,L"S2A_SellingCancle_AuctionItem");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_378 = (undefined2 *)PTR_DAT_1405d8010;
        local_2a8 = local_368;
        FUN_1403a1a60(&local_378,&local_2a8);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_370);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,&local_1b0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,&local_1d0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        DVar8 = DVar13;
        if ((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) {
          DVar8 = *(DWORD *)(local_378 + -4);
        }
        local_338 = (undefined2 **)FUN_1400174a0(&local_378,local_1f8,DVar8 - 2);
        if (local_378 == (undefined2 *)0x0) {
          local_378 = (undefined2 *)PTR_DAT_1405d8010;
        }
        if (*local_338 != local_378) {
          uVar11 = FUN_14034fe70();
          local_360 = uVar11;
          FUN_14034ed40(uVar11);
          puVar5 = local_378;
          local_358 = (wchar_t *)CONCAT71(local_358._1_7_,1);
          if (((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010))
             && (puVar2 = local_378 + -4, puVar2 != (undefined2 *)0x0)) {
            uVar10 = FUN_14034fe70();
            local_270 = uVar10;
            FUN_14034ed40(uVar10);
            local_268 = 1;
            piVar3 = (int *)(puVar5 + -2);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar2);
            }
            FUN_14034edd0(uVar10);
          }
          local_378 = *local_338;
          if (((local_378 != (undefined2 *)PTR_DAT_1405d8010) && (local_378 != (undefined2 *)0x0))
             && (local_378 != (undefined2 *)0x8)) {
            *(int *)(local_378 + -2) = *(int *)(local_378 + -2) + 1;
          }
          FUN_14034edd0(uVar11);
        }
        FUN_1400031d0(local_1f8);
        local_338 = &local_2b0;
        FUN_14034fe70();
        local_2b0 = (undefined2 *)PTR_DAT_1405d8010;
        FUN_140003100(&local_2b0,&local_378);
        uVar11 = FUN_140003060(local_1e8,L"S2A_SellingCancle_AuctionItem",0);
        (**(code **)(*param_1 + 0x28))(param_1,0xb032,uVar11,&local_2b0);
        local_3c8 = (undefined8 *)local_378;
        if (local_378 == (undefined2 *)0x0) {
          local_3c8 = (undefined8 *)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0xb032,L"S2A_SellingCancle_AuctionItem");
        FUN_1400031d0(&local_378);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb032);
        local_358 = L"S2A_SellingCancle_AuctionItem";
        local_350 = iVar4;
        local_348 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_360);
        DVar13 = GetTickCount();
      }
      local_3b8 = &local_1d0;
      local_3c0 = &local_1b0;
      local_3c8 = &local_370;
      cVar6 = (**(code **)(*param_1 + 0x60))(param_1,iVar4,local_258,&local_368);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"S2A_SellingCancle_AuctionItem");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb032);
        local_358 = L"S2A_SellingCancle_AuctionItem";
        goto LAB_140015465;
      }
      break;
    case 0xb033:
      FUN_14035b390(local_258);
      local_254 = param_2[10];
      local_258[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_368);
      FUN_1403a1710(param_2,&local_1d0);
      cVar6 = FUN_1403840e0(param_2,&local_378,4);
      if (cVar6 != '\0') {
        local_370._4_4_ = local_378._0_4_;
      }
      FUN_1403840e0(param_2,&local_364,4);
      FUN_14034fe70();
      local_1c0[0] = (longlong *)PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_2,local_1c0);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"S2A_Search_Sell_Bid_Item");
      DVar13 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          local_3c8 = (undefined8 *)&DAT_140477960;
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0xb033,L"S2A_Search_Sell_Bid_Item");
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_378 = (undefined2 *)PTR_DAT_1405d8010;
        local_2c8[0] = local_368;
        FUN_1403a1a60(&local_378,local_2c8);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d70(&local_378,&local_1d0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,(undefined4 *)((longlong)&local_370 + 4));
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1a60(&local_378,&local_370);
        FUN_140017790(&local_378,&DAT_14047edb0);
        FUN_1403a1d20(&local_378,local_1c0);
        FUN_140017790(&local_378,&DAT_14047edb0);
        DVar8 = DVar13;
        if ((local_378 != (undefined2 *)0x0) && (local_378 != (undefined2 *)PTR_DAT_1405d8010)) {
          DVar8 = *(DWORD *)(local_378 + -4);
        }
        uVar11 = FUN_1400174a0(&local_378,local_1f0,DVar8 - 2);
        FUN_140003100(&local_378,uVar11);
        FUN_1400031d0(local_1f0);
        local_338 = &local_2f0;
        FUN_14034fe70();
        local_2f0 = (undefined2 *)PTR_DAT_1405d8010;
        FUN_140003100(&local_2f0,&local_378);
        uVar11 = FUN_140003060(local_1d8,L"S2A_Search_Sell_Bid_Item",0);
        (**(code **)(*param_1 + 0x28))(param_1,0xb033,uVar11,&local_2f0);
        local_3c8 = (undefined8 *)local_378;
        if (local_378 == (undefined2 *)0x0) {
          local_3c8 = (undefined8 *)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0xb033,L"S2A_Search_Sell_Bid_Item");
        FUN_1400031d0(&local_378);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb033);
        local_358 = L"S2A_Search_Sell_Bid_Item";
        local_350 = iVar4;
        local_348 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_360);
        DVar13 = GetTickCount();
      }
      local_3b0 = local_1c0;
      local_3b8 = &local_370;
      local_3c0 = (longlong **)((longlong)&local_370 + 4);
      local_3c8 = &local_1d0;
      cVar6 = (**(code **)(*param_1 + 0x68))(param_1,iVar4,local_258,&local_368);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"S2A_Search_Sell_Bid_Item");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_360 = CONCAT44(local_360._4_4_,0xb033);
        local_358 = L"S2A_Search_Sell_Bid_Item";
        local_350 = iVar4;
        local_348 = param_3;
        DVar8 = GetTickCount();
        local_340 = DVar8 - DVar13;
        (**(code **)(*param_1 + 0x18))(param_1,&local_360);
      }
      FUN_1400031d0(local_1c0);
      break;
    default:
      goto switchD_140014f4e_default;
    }
    uVar11 = 1;
  }
  return uVar11;
}



// 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::Auction2ServersProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140017440(undefined8 *param_1)

{
  *param_1 = RNP::Auction2ServersProxy::vftable;
  FUN_140385b20();
  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::Servers2AuctionStub::vftable;
  FUN_140388ea0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140017490(undefined8 *param_1)

{
  *param_1 = RNP::Servers2AuctionStub::vftable;
  FUN_140388ea0();
  return;
}



undefined8 * FUN_1400174a0(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_1405d8010)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 <= param_3) {
    FUN_14034fe70();
    *param_2 = PTR_DAT_1405d8010;
    FUN_140003100(param_2,param_1);
    return param_2;
  }
  if (puVar2 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1405d8010;
  }
  FUN_140003060(param_2,puVar2);
  return param_2;
}



void FUN_140017520(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_1405d8010)) && (0 < *(int *)(puVar4 + -8))
     ) {
    puVar7 = (undefined *)*param_1;
    iVar5 = 0;
    if ((puVar7 != (undefined *)0x0) && (puVar7 != PTR_DAT_1405d8010)) {
      iVar5 = *(int *)(puVar7 + -8);
    }
    iVar3 = *(int *)(puVar4 + -8) + iVar5;
    iVar1 = 0;
    if ((puVar7 != (undefined *)0x0) && (iVar1 = 0, puVar7 != PTR_DAT_1405d8010)) {
      iVar1 = *(int *)(puVar7 + -8);
    }
    if (((iVar3 <= iVar1) && (iVar3 = 0, puVar7 != (undefined *)0x0)) &&
       (puVar7 != PTR_DAT_1405d8010)) {
      iVar3 = *(int *)(puVar7 + -8);
    }
    iVar1 = 0;
    iVar2 = 1;
    if (1 < iVar3) {
      iVar2 = iVar3;
    }
    if ((puVar7 != (undefined *)0x0) && (puVar7 != PTR_DAT_1405d8010)) {
      iVar1 = *(int *)(puVar7 + -8);
    }
    if (iVar1 < iVar2) {
      FUN_140002d30(param_1,iVar2);
    }
    FUN_140002e10(param_1);
    puVar4 = (undefined *)*param_2;
    uVar6 = 0;
    puVar7 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1405d8010;
    }
    if ((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) {
      uVar6 = *(undefined4 *)(puVar4 + -8);
    }
    if (puVar4 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar7 + (longlong)iVar5 * 2,puVar4,uVar6);
    puVar4 = (undefined *)*param_2;
    iVar1 = 0;
    if ((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) {
      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_1405d8010)) {
      iVar3 = *(int *)(puVar4 + -8);
    }
    if ((iVar3 <= iVar2) && (iVar2 = 0, puVar4 != (undefined *)0x0)) {
      if (puVar4 == PTR_DAT_1405d8010) {
        return;
      }
      iVar2 = *(int *)(puVar4 + -8);
    }
    if (((puVar4 != PTR_DAT_1405d8010) && (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_140017690(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_1405d84f0 ^ (ulonglong)auStack_858;
  if (param_2 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  iVar1 = vswprintf_s(local_838,0x400,param_2,param_3);
  uVar2 = FUN_140002f00(param_1,iVar1);
  FUN_14034fd20(uVar2,local_838,iVar1);
  FUN_140002fe0(param_1);
  return;
}



void FUN_140017720(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_140017690(param_1,param_2,&local_res18);
  return;
}



undefined8 * FUN_140017750(undefined8 *param_1,undefined8 param_2)

{
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8010;
  FUN_140003100(param_1,param_2);
  return param_1;
}



void FUN_140017790(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_14034fcf0(param_2);
    puVar8 = (undefined *)*param_1;
    iVar7 = 0;
    iVar6 = 0;
    iVar3 = 0;
    iVar4 = iVar6;
    if ((puVar8 != (undefined *)0x0) && (iVar4 = iVar3, puVar8 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(puVar8 + -8);
    }
    iVar5 = iVar4 + iVar1;
    if ((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1405d8010)) {
      iVar3 = *(int *)(puVar8 + -8);
    }
    iVar2 = iVar5;
    if (((iVar5 <= iVar3) && (iVar2 = iVar6, puVar8 != (undefined *)0x0)) &&
       (puVar8 != PTR_DAT_1405d8010)) {
      iVar2 = *(int *)(puVar8 + -8);
    }
    iVar3 = 1;
    if (1 < iVar2) {
      iVar3 = iVar2;
    }
    if ((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1405d8010)) {
      iVar7 = *(int *)(puVar8 + -8);
    }
    if (iVar7 < iVar3) {
      FUN_140002d30(param_1);
    }
    FUN_140002e10(param_1);
    puVar8 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar8 + (longlong)iVar4 * 2,param_2,iVar1);
    FUN_140002f80(param_1,iVar5);
  }
  return;
}



undefined8 FUN_140017880(undefined8 param_1,undefined4 *param_2)

{
  undefined8 uVar1;
  undefined4 local_res18 [4];
  
  uVar1 = FUN_1403840e0(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);
}



void FUN_1400178c0(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_14034f7d0();
  }
  if (param_3 != 0) {
    if (*param_1 == 0) {
      FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    lVar1 = param_1[1];
    iVar2 = (int)lVar1 + param_3;
    if ((iVar2 < 0) || (*(int *)((longlong)param_1 + 0xc) < iVar2)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(int *)(param_1 + 1) = iVar2;
    FUN_14000d3f0(*param_1 + (longlong)(int)lVar1,param_2,(longlong)param_3);
  }
  return;
}



int FUN_140017930(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_14034f7d0();
    }
    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_1400179d0(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_140017930();
      plVar1 = *(longlong **)(param_1 + 8);
      lVar3 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_14034fef0(lVar3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar3);
        }
      }
      else {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_14034ff20(*(undefined8 *)(param_1 + 0x10),lVar3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,*(undefined8 *)(param_1 + 0x10),lVar3);
        }
        if (lVar3 == 0) {
          FUN_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      *(longlong *)(param_1 + 0x10) = lVar3;
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140017a90(longlong param_1,undefined8 param_2,int param_3)

{
  int iVar1;
  longlong lVar2;
  
  if (param_3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (param_3 != 0) {
    iVar1 = *(int *)(param_1 + 0x18);
    FUN_1400179d0(param_1,iVar1 + param_3);
    if (*(int *)(param_1 + 0x18) == 0) {
      lVar2 = 0;
    }
    else {
      lVar2 = *(longlong *)(param_1 + 0x10);
    }
    FUN_14000d3f0(lVar2 + iVar1,param_2,(longlong)param_3);
  }
  return;
}



void FUN_140017b00(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_140399790();
      }
    }
    else if (*(longlong *)(param_1 + 0x10) == 0) {
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      iVar1 = *(int *)(lVar2 + 0x18);
      FUN_1400179d0(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_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    iVar1 = *(int *)(param_1 + 0x18);
    iVar3 = iVar1 + 1;
    if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(int *)(param_1 + 0x18) = iVar3;
    *(undefined1 *)((longlong)iVar1 + *(longlong *)(param_1 + 0x10)) = 0xfe;
  }
  return;
}



void FUN_140017be0(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_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_140017a90();
      FUN_140017b00(param_1);
      return;
    }
                    // WARNING: Subroutine does not return
    FUN_140399790();
  }
  FUN_1400178c0(param_1 + 0x10);
  FUN_140017b00(param_1);
  return;
}



void FUN_140017c50(longlong param_1,undefined2 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined2 local_res10 [4];
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  local_res10[0] = param_2;
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_1400179d0(lVar2,iVar1 + 2);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_14000d3f0(lVar4 + iVar1,local_res10,2);
    goto LAB_140017d28;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 2;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_14000d3f0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),local_res10,2);
LAB_140017d28:
  FUN_140017b00(param_1);
  return;
}



void FUN_140017d50(longlong *param_1)

{
  if (*param_1 != 0) {
    if (*(int *)((longlong)param_1 + 0xc) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 1) = 0;
  }
  return;
}



void FUN_140017d80(longlong param_1)

{
  FUN_140399690();
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(int *)(param_1 + 0x14) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0x10) = 0;
  }
  return;
}



void FUN_140017dc0(longlong param_1)

{
  FUN_140399690(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return;
}



undefined8 FUN_140017e10(void)

{
  return 0x2fe7;
}



undefined8 FUN_140017e20(void)

{
  return 11000;
}



undefined8 FUN_140017e30(void)

{
  return 0x2b47;
}



undefined1
FUN_140017e40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee1);
  FUN_140058470(local_30,*param_4);
  FUN_140385940(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140385940(local_30,param_9);
  FUN_140385940(local_30,param_10);
  FUN_140385940(local_30,param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))(param_1,local_res10,1,param_3,local_30,L"REQ_AUTH",0x2ee1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140017fa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee1);
  FUN_140058470(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140385940(local_30,param_10);
  FUN_140385940(local_30,param_11);
  FUN_140385940(local_30,param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_AUTH",0x2ee1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018110(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee2);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_1403859e0(local_30,param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140017c50(local_30,*param_14);
  FUN_140058770(local_30,*param_15);
  FUN_140017c50(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOGOUT",0x2ee2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400182a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee2);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140385940(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  FUN_1403859e0(local_30,param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140017c50(local_30,*param_15);
  FUN_140058770(local_30,*param_16);
  FUN_140017c50(local_30,*param_17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_LOGOUT",0x2ee2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140018440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee3);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee3);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee4);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_IP",0x2ee4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018710(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee5);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018910(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee5);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400189f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee6);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018ae0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee6);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018be0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee7);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_1403a17c0(local_30,param_5 + 2);
  FUN_140058870(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018d10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee7);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_1403a17c0(local_30,param_6 + 2);
  FUN_140058870(local_30,*param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee8);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_1403a17c0(local_30,param_5 + 2);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,param_7[1]);
  FUN_1403a17c0(local_30,param_7 + 2);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,param_8[1]);
  FUN_140017c50(local_30,param_8[2]);
  FUN_1403a17c0(local_30,param_8 + 7);
  FUN_1403a17c0(local_30,param_8 + 0xf);
  FUN_140058670(local_30,*(undefined8 *)(param_8 + 3));
  FUN_140385a20(local_30,param_8 + 0x17);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140018ff0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2ee8);
  FUN_140017c50(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,param_6[1]);
  FUN_1403a17c0(local_40,param_6 + 2);
  FUN_1403859e0(local_40,param_7);
  FUN_140058470(local_40,*param_8);
  FUN_140058470(local_40,param_8[1]);
  FUN_1403a17c0(local_40,param_8 + 2);
  FUN_140017c50(local_40,*param_9);
  FUN_140017c50(local_40,param_9[1]);
  FUN_140017c50(local_40,param_9[2]);
  FUN_1403a17c0(local_40,param_9 + 7);
  FUN_1403a17c0(local_40,param_9 + 0xf);
  FUN_140058670(local_40,*(undefined8 *)(param_9 + 3));
  FUN_140385a20(local_40,param_9 + 0x17);
  FUN_140385a20(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee9);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1401182c0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_ITEM",0x2ee9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400192d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee9);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eea);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_SKILL",0x2eea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eea);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1403a17c0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400196e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eeb);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400197f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eeb);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019910(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eec);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019a10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eec);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019b20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eed);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eed);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019dd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eee);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140019f20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eee);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001a080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eef);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001a1d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eef);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001a330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef0);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001a480(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef0);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001a5e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef1);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001a720(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef1);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001a860(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef2);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1401182c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ITEM_UPDATE",0x2ef2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001a970(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef2);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001aa90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef3);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001aba0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef3);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001acc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef4);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ae00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001af40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef5);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b040(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef5);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b150(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef6);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b240(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef6);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef7);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef7);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef8);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_QUEST",0x2ef8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b6a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef8);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b7e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef9);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058670(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_QUEST",0x2ef9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001b970(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef9);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058670(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001bb10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efa);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_QUEST",0x2efa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001bc10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efa);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001bd20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efb);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001be20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efb);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001bf30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efc);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c040(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efc);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efd);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efd);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efe);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efe);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c580(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eff);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eff);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c7b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f00);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001c8f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f00);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ca40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f01);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001cb40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f01);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001cc50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f02);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001cd60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f02);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ce80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f03);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001cf80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f03);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001d090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f04);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SAVE_MONEY",0x2f04);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001d190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f04);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001d2a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f05);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001d3b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f05);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001d4d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f06);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_7[1] - *param_7 >> 4);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001d620(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f06);
  FUN_140017c50(local_40,*param_5);
  FUN_1403a17c0(local_40,param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,param_8[1] - *param_8 >> 4);
  lVar2 = *param_8;
  if (lVar2 != param_8[1]) {
    do {
      FUN_1403a17c0(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001d770(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f07);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_30,param_7[1] - *param_7 >> 4);
  lVar3 = *param_7;
  if (lVar3 != param_7[1]) {
    do {
      FUN_1403a17c0(local_30,lVar3);
      lVar3 = lVar3 + 0x10;
    } while (lVar3 != param_7[1]);
  }
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001d8f0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f07);
  FUN_140017c50(local_40,*param_5);
  FUN_1403a17c0(local_40,param_6);
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 4);
  lVar3 = *param_8;
  if (lVar3 != param_8[1]) {
    do {
      FUN_1403a17c0(local_40,lVar3);
      lVar3 = lVar3 + 0x10;
    } while (lVar3 != param_8[1]);
  }
  FUN_140058470(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001da80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f08);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001dbb0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f08);
  FUN_140017c50(local_40,*param_5);
  FUN_1403a17c0(local_40,param_6);
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001dcf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f09);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ddf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f09);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001df00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0a);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e000(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0a);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e110(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0b);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_1403a17c0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140385940(local_30,param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_CREATE",0x2f0b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0b);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140017c50(local_30,*param_10);
  FUN_1403a17c0(local_30,param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0c);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_DELETE",0x2f0c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0c);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e640(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0d);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_LIST",0x2f0d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e750(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0d);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e870(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0e);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_GET",0x2f0e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001e980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0e);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001eaa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0f);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ebb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0f);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ecd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f10);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ede0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f10);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ef00(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f11);
  FUN_140017c50(local_40,*param_4);
  FUN_140058470(local_40,*param_5);
  FUN_1403a17c0(local_40,param_6);
  FUN_1403a17c0(local_40,param_7);
  FUN_1403859e0(local_40,param_8);
  FUN_1403859e0(local_40,param_9);
  FUN_1403859e0(local_40,param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,*param_13);
  FUN_140058470(local_40,*param_14);
  FUN_140058470(local_40,(param_15[1] - *param_15) / 0x12);
  lVar2 = *param_15;
  if (lVar2 != param_15[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140017c50(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f0d0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f11);
  FUN_140017c50(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_1403a17c0(local_40,param_7);
  FUN_1403a17c0(local_40,param_8);
  FUN_1403859e0(local_40,param_9);
  FUN_1403859e0(local_40,param_10);
  FUN_1403859e0(local_40,param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,*param_13);
  FUN_140058470(local_40,*param_14);
  FUN_140058470(local_40,*param_15);
  FUN_140058470(local_40,(param_16[1] - *param_16) / 0x12);
  lVar2 = *param_16;
  if (lVar2 != param_16[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140017c50(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f2b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f12);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_DEL",0x2f12);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f3b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f12);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f4c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f13);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_UPDATE",0x2f13);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f5b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f13);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f6b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f14);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_LIST",0x2f14);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f7b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f14);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f8c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f15);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_OPEN",0x2f15);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001f9d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f15);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001faf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f16);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001fbf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f16);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001fd00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f17);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,param_7[1] - *param_7 >> 4);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_1403a17c0(local_30,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_7[1]);
  }
  FUN_140058470(local_30,param_8[1] - *param_8 >> 2);
  puVar3 = (undefined4 *)*param_8;
  if (puVar3 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_30,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_8[1]);
  }
  FUN_140058470(local_30,param_9[1] - *param_9 >> 2);
  puVar3 = (undefined4 *)*param_9;
  if (puVar3 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_30,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_9[1]);
  }
  FUN_140058470(local_30,param_10[1] - *param_10 >> 4);
  lVar2 = *param_10;
  if (lVar2 != param_10[1]) {
    do {
      FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14001ff10(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f17);
  FUN_140017c50(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_1403a17c0(local_40,param_7);
  FUN_140058470(local_40,param_8[1] - *param_8 >> 4);
  lVar2 = *param_8;
  if (lVar2 != param_8[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_8[1]);
  }
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar3 = (undefined4 *)*param_9;
  if (puVar3 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_9[1]);
  }
  FUN_140058470(local_40,param_10[1] - *param_10 >> 2);
  puVar3 = (undefined4 *)*param_10;
  if (puVar3 != (undefined4 *)param_10[1]) {
    do {
      FUN_140058470(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_10[1]);
  }
  FUN_140058470(local_40,param_11[1] - *param_11 >> 4);
  lVar2 = *param_11;
  if (lVar2 != param_11[1]) {
    do {
      FUN_1403a17c0(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020120(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f18);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020220(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f18);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f19);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_RETURN",0x2f19);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f19);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020540(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1a);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400206c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1a);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058770(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020850(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1b);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1b);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1c);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_FRIEND_LIST",0x2f1c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1c);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1d);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ADD_FRIEND",0x2f1d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020d80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1d);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020ea0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1e);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DEL_FRIEND",0x2f1e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140020fb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1e);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400210d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1f);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_ADD_BAN",0x2f1f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400211f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1f);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f20);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DEL_BAN",0x2f20);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f20);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021550(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f21);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021670(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f21);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400217a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f22);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140017c50(local_30,*param_10);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021910(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f22);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140017c50(local_30,*param_10);
  FUN_140017c50(local_30,*param_11);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021a90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f23);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021be0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f23);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021d40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f24);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f24);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140021f70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f25);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f25);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022180(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f26);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f26);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022390(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f27);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f27);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400225a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f28);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400226b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f28);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400227d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f29);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_1403a17c0(local_30,param_11);
  FUN_1403859e0(local_30,param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CREATE_GUILD",0x2f29);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022970(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f29);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140017c50(local_30,*param_10);
  FUN_1403859e0(local_30,param_11);
  FUN_1403a17c0(local_30,param_12);
  FUN_1403859e0(local_30,param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140022b20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2a);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_GUILD",0x2f2a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022c00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2a);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022ce0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2b);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022de0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2b);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140022ef0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2c);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,param_7[1] - *param_7 >> 1);
  puVar2 = (undefined2 *)*param_7;
  if (puVar2 != (undefined2 *)param_7[1]) {
    do {
      FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023040(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f2c);
  FUN_140017c50(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_1403a17c0(local_40,param_7);
  FUN_140058470(local_40,param_8[1] - *param_8 >> 1);
  puVar2 = (undefined2 *)*param_8;
  if (puVar2 != (undefined2 *)param_8[1]) {
    do {
      FUN_140017c50(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2d);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400232a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2d);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400233c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2e);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400234d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2e);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400235f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2f);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023700(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2f);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f30);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_1403a17c0(local_30,param_5 + 2);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 1));
  FUN_1403a17c0(local_30,param_6 + 5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023960(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f30);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_1403a17c0(local_30,param_6 + 2);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 1));
  FUN_1403a17c0(local_30,param_7 + 5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023ac0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f31);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023be0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f31);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023d10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f32);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023e40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f32);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140023f70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f33);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f33);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024180(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f34);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_1403a17c0(local_30,param_5 + 2);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DISBAND_GUILD",0x2f34);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400242a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f34);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_1403a17c0(local_30,param_6 + 2);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400243d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f35);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400244e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f35);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f36);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024710(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f36);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f37);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024940(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f37);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f38);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024b50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f38);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f39);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f39);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024e20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3a);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140024f80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3a);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400250f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3b);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025230(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3b);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3c);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025450(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3c);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3d);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058470(local_30,param_5[2]);
  FUN_1403a17c0(local_30,param_5 + 3);
  FUN_1403a17c0(local_30,param_5 + 7);
  FUN_140058470(local_30,param_5[0xb]);
  FUN_140058470(local_30,param_5[0xc]);
  FUN_140058670(local_30,*(undefined8 *)(param_5 + 0xd));
  FUN_140058670(local_30,*(undefined8 *)(param_5 + 0xf));
  FUN_140385a20(local_30,param_5 + 0x19);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400256b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3d);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_140058470(local_30,param_6[2]);
  FUN_1403a17c0(local_30,param_6 + 3);
  FUN_1403a17c0(local_30,param_6 + 7);
  FUN_140058470(local_30,param_6[0xb]);
  FUN_140058470(local_30,param_6[0xc]);
  FUN_140058670(local_30,*(undefined8 *)(param_6 + 0xd));
  FUN_140058670(local_30,*(undefined8 *)(param_6 + 0xf));
  FUN_140385a20(local_30,param_6 + 0x19);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3e);
  FUN_140017c50(local_30,*param_4);
  FUN_14011f6e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025930(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3e);
  FUN_140017c50(local_30,*param_5);
  FUN_14011f6e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025a20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3f);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_5 + 1);
  FUN_1403a17c0(local_30,param_5 + 5);
  FUN_140058670(local_30,*(undefined8 *)(param_5 + 9));
  FUN_140058470(local_30,param_5[0xb]);
  FUN_140058470(local_30,param_5[0xc]);
  FUN_140385a20(local_30,param_5 + 0x15);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3f);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_6 + 1);
  FUN_1403a17c0(local_30,param_6 + 5);
  FUN_140058670(local_30,*(undefined8 *)(param_6 + 9));
  FUN_140058470(local_30,param_6[0xb]);
  FUN_140058470(local_30,param_6[0xc]);
  FUN_140385a20(local_30,param_6 + 0x15);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025cd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f40);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*(undefined2 *)(param_5 + 1));
  FUN_1403a17c0(local_30,param_5 + 0x13);
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 0xb));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 0xf));
  FUN_140017c50(local_30,*(undefined2 *)(param_5 + 3));
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 7));
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025e20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f40);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*(undefined2 *)(param_6 + 1));
  FUN_1403a17c0(local_30,param_6 + 0x13);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 0xb));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 0xf));
  FUN_140017c50(local_30,*(undefined2 *)(param_6 + 3));
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 7));
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140025f80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f41);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026100(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f41);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f42);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_14011f610(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_GOLD",0x2f42);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f42);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_14011f610(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f43);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_14011f4a0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEM",0x2f43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026590(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f43);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_14011f4a0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400266a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f44);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_ALL_AUCTIONLIST",0x2f44);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140026760(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140026830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f45);
  FUN_140119ea0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_REGISTER_AUCTIONITEM",0x2f45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026910(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f45);
  FUN_140119ea0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400269f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f46);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_AUCTIONITEM",0x2f46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026ad0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f46);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026bb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f47);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_AUCTIONITEM",0x2f47);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026cd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f47);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026e00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f48);
  FUN_1401182c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SENDMAIL_AUCTIONMNG",0x2f48);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140026f40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f48);
  FUN_1401182c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f49);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400271b0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f49);
  FUN_140017c50(local_40,*param_5);
  FUN_1403a17c0(local_40,param_6);
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400272f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4a);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400273f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4a);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027500(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4b);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4b);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027710(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4c);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027810(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4c);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4d);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027a20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4d);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027b30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4e);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_DELETE",0x2f4e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4e);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027d10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4f);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140017c50(local_30,*param_10);
  FUN_140017c50(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058470(local_30,*param_18);
  FUN_140058470(local_30,*param_19);
  FUN_140058570(local_30,*param_20);
  FUN_140058570(local_30,*param_21);
  FUN_140058470(local_30,*param_22);
  FUN_140058470(local_30,*param_23);
  FUN_140058570(local_30,*param_24);
  FUN_140058570(local_30,*param_25);
  FUN_140058570(local_30,*param_26);
  FUN_140058570(local_30,*param_27);
  FUN_140058570(local_30,*param_28);
  FUN_140058470(local_30,*param_29);
  FUN_140058770(local_30,*param_30);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_CREATE",0x2f4f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140027fc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4f);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_140017c50(local_30,*param_11);
  FUN_140017c50(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058470(local_30,*param_18);
  FUN_140058470(local_30,*param_19);
  FUN_140058470(local_30,*param_20);
  FUN_140058570(local_30,*param_21);
  FUN_140058570(local_30,*param_22);
  FUN_140058470(local_30,*param_23);
  FUN_140058470(local_30,*param_24);
  FUN_140058570(local_30,*param_25);
  FUN_140058570(local_30,*param_26);
  FUN_140058570(local_30,*param_27);
  FUN_140058570(local_30,*param_28);
  FUN_140058570(local_30,*param_29);
  FUN_140058470(local_30,*param_30);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f50);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140058670(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058470(local_30,*param_18);
  FUN_140058470(local_30,*param_19);
  FUN_140058570(local_30,*param_20);
  FUN_140058570(local_30,*param_21);
  FUN_140058470(local_30,*param_22);
  FUN_140058470(local_30,*param_23);
  FUN_140058570(local_30,*param_24);
  FUN_140058570(local_30,*param_25);
  FUN_140058570(local_30,*param_26);
  FUN_140058570(local_30,*param_27);
  FUN_140058570(local_30,*param_28);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_UPDATE",0x2f50);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028500(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f50);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058770(local_30,*param_9);
  FUN_140017c50(local_30,*param_10);
  FUN_140058670(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058470(local_30,*param_18);
  FUN_140058470(local_30,*param_19);
  FUN_140058470(local_30,*param_20);
  FUN_140058570(local_30,*param_21);
  FUN_140058570(local_30,*param_22);
  FUN_140058470(local_30,*param_23);
  FUN_140058470(local_30,*param_24);
  FUN_140058570(local_30,*param_25);
  FUN_140058570(local_30,*param_26);
  FUN_140058570(local_30,*param_27);
  FUN_140058570(local_30,*param_28);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028790(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f51);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PET_READLIST",0x2f51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028890(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f51);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400289a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f52);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028ae0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f52);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058770(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f53);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f53);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f54);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140028f60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f54);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f55);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400291b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f55);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400292e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f56);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400293f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f56);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f57);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029610(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f57);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029720(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f58);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f58);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058770(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029930(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f59);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029a40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f59);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5a);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029c60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5a);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029d70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5b);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 0x10));
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029ea0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5b);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*(undefined4 *)(param_8 + 0x10));
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140029fe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5c);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002a110(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5c);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002a240(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5d);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002a350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5d);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14002a470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_AUTH_BLACKLISTIP",0x2f5e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14002a530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14002a600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_AUTH_PCROOMIP",0x2f5f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14002a6c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002a790(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f60);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002a8e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f60);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002aa30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f61);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ab20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f61);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ac10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f62);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058770(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ad60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f62);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058770(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002aec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f63);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002afb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f63);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b0a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f64);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b1e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f64);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f65);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f65);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f66);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f66);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b6f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f67);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_DEPOSIT",0x2f67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b800(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f67);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002b920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f68);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_PAYMENT",0x2f68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ba30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f68);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002bb50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f69);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002bc80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f69);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002bdc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6a);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002bec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6a);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002bfd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6b);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c0f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6b);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c220(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6c);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c360(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6c);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c4a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6d);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c5a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6d);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c6b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6e);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c7c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6e);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c8e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6f);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002c9f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6f);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002cb10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f70);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002cc20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f70);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002cd40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f71);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ce50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f71);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002cf70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f72);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f72);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d1a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f73);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d2b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f73);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d3d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f74);
  FUN_140385940(local_30,param_4);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d4c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f74);
  FUN_140385940(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d5b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f75);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d6b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f75);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d7c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f76);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002d940(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f76);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002db00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f77);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002dc00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f77);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002dd10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f78);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002de10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f78);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002df20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f79);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e020(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f79);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e130(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7a);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SERVER_MCU",0x2f7a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e220(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7a);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7b);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7b);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7c);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_14011db60(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e630(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7c);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_14011db60(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7d);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_14011db60(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7d);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_14011db60(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002e950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7e);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ea50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7e);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002eb60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7f);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ec60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7f);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ed70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f80);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002eeb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f80);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f000(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f81);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f150(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f81);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f2b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f82);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_14011f3e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f3b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f82);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_14011f3e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f4c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f83);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f5c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f83);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f6d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f84);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_14004be50(local_30,param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f810(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f84);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_14004be50(local_30,param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002f950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f85);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002fa60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f85);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002fb80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f86);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140385940(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CHARACTER_ROB",0x2f86);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002fc90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f86);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002fdb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f87);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_5 + 1);
  FUN_1403a17c0(local_30,param_5 + 5);
  FUN_140058870(local_30,*(undefined1 *)(param_5 + 0x11));
  FUN_1403a17c0(local_30,(longlong)param_5 + 0x45);
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 0x5d));
  FUN_140058770(local_30,*(undefined8 *)((longlong)param_5 + 0x55));
  FUN_140385a20(local_30,param_5 + 9);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14002ff10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f87);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_6 + 1);
  FUN_1403a17c0(local_30,param_6 + 5);
  FUN_140058870(local_30,*(undefined1 *)(param_6 + 0x11));
  FUN_1403a17c0(local_30,(longlong)param_6 + 0x45);
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_6 + 0x5d));
  FUN_140058770(local_30,*(undefined8 *)((longlong)param_6 + 0x55));
  FUN_140385a20(local_30,param_6 + 9);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f88);
  FUN_140017c50(local_30,*param_4);
  FUN_14011f9a0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f88);
  FUN_140017c50(local_30,*param_5);
  FUN_14011f9a0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f89);
  FUN_140017c50(local_30,*param_4);
  FUN_14011f840(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f89);
  FUN_140017c50(local_30,*param_5);
  FUN_14011f840(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8a);
  FUN_140017c50(local_30,*param_4);
  FUN_14011fb50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8a);
  FUN_140017c50(local_30,*param_5);
  FUN_14011fb50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030620(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8b);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_FORTUNE",0x2f8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030780(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f8b);
  FUN_140017c50(local_40,*param_5);
  FUN_1403a17c0(local_40,param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  FUN_140058870(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400308e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8c);
  FUN_140017c50(local_30,*param_4);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400309d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8c);
  FUN_140017c50(local_30,*param_5);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140030ac0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8d);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030ba0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8d);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030c80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8e);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_5 + 1);
  FUN_1403a17c0(local_30,param_5 + 5);
  FUN_140058870(local_30,*(undefined1 *)(param_5 + 9));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_5 + 0x25));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_5 + 0x26));
  FUN_140058670(local_30,*(undefined8 *)((longlong)param_5 + 0x2a9));
  FUN_140385a20(local_30,(longlong)param_5 + 0x27);
  FUN_140385a20(local_30,(longlong)param_5 + 0x47);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030df0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8e);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_6 + 1);
  FUN_1403a17c0(local_30,param_6 + 5);
  FUN_140058870(local_30,*(undefined1 *)(param_6 + 9));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_6 + 0x25));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_6 + 0x26));
  FUN_140058670(local_30,*(undefined8 *)((longlong)param_6 + 0x2a9));
  FUN_140385a20(local_30,(longlong)param_6 + 0x27);
  FUN_140385a20(local_30,(longlong)param_6 + 0x47);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140030f70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8f);
  FUN_1403859e0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400310b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8f);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400311f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f90);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_UPDATE_INQUIRY",0x2f90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031300(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f90);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f91);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f91);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140031600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f92);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_INQUIRY",0x2f92);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400316c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f92);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_READ_INQUIRY",0x2f92);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140031790(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f93);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_DELETE_INQUIRY",0x2f93);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031870(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f93);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f94);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GM_AUTH",0x2f94);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031a50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f94);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031b50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f95);
  FUN_1403859e0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INSERT_BLACKIP",0x2f95);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f95);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f96);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031e70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f96);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140031fb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f97);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400320b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f97);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400321c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f98);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140032310(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f98);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140032470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f99);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140032580(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f99);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400326a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9a);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400327b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9a);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400328d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9b);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140032a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9b);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058570(local_30,*param_15);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140032c30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9c);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140032d40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9c);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140032e60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9d);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140032f50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9d);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033040(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9e);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033150(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9e);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9f);
  FUN_140017c50(local_30,*param_4);
  FUN_14011fc00(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_GUILD_LOG",0x2f9f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033360(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9f);
  FUN_140017c50(local_30,*param_5);
  FUN_14011fc00(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033450(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa0);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400335f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa0);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033790(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa1);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400338d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa1);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033a10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa2);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033b10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa2);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa3);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa3);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033e30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa4);
  FUN_140017c50(local_30,*param_4);
  FUN_14011fcb0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_QUEST_LOG",0x2fa4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140033f20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa4);
  FUN_140017c50(local_30,*param_5);
  FUN_14011fcb0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034010(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa5);
  FUN_140017c50(local_30,*param_4);
  FUN_14011ff20(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_CHARACTER",0x2fa5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034100(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa5);
  FUN_140017c50(local_30,*param_5);
  FUN_14011ff20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400341f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa6);
  FUN_140017c50(local_30,*param_4);
  FUN_14011fd60(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEMTRADE",0x2fa6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400342e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa6);
  FUN_140017c50(local_30,*param_5);
  FUN_14011fd60(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400343d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa7);
  FUN_140120010(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400344b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa7);
  FUN_140120010(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034590(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa8);
  FUN_140017c50(local_30,*param_4);
  FUN_140058770(local_30,*(undefined8 *)(param_4 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_4 + 5));
  FUN_140385a20(local_30,param_4 + 7);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400346a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa8);
  FUN_140017c50(local_30,*param_5);
  FUN_140058770(local_30,*(undefined8 *)(param_5 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 5));
  FUN_140385a20(local_30,param_5 + 7);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400347c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa9);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*(undefined2 *)(param_4 + 1));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_4 + 6));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_4 + 10));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_4 + 0x229));
  FUN_140385a20(local_30,(longlong)param_4 + 0xb);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400348f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa9);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*(undefined2 *)(param_5 + 1));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 6));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_5 + 10));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_5 + 0x229));
  FUN_140385a20(local_30,(longlong)param_5 + 0xb);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034a30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2faa);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*(undefined1 *)(param_4 + 1));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_4 + 5));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_4 + 9));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_4 + 0xd));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_4 + 0x11));
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2faa);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*(undefined1 *)(param_5 + 1));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 5));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 9));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 0xd));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 0x11));
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034ca0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fab);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*(undefined1 *)(param_4 + 1));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_4 + 5));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_4 + 0x26));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_4 + 0x2a));
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034dc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fab);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*(undefined1 *)(param_5 + 1));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_5 + 5));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 0x26));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 0x2a));
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034ef0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fac);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140034ff0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fac);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035100(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fad);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_5 + 1);
  FUN_1403a17c0(local_30,param_5 + 5);
  FUN_140058470(local_30,param_5[9]);
  FUN_140058470(local_30,param_5[10]);
  FUN_140058470(local_30,param_5[0xb]);
  FUN_140058470(local_30,param_5[0xc]);
  FUN_140058470(local_30,param_5[0xd]);
  FUN_140385980(local_30,param_5 + 0xe);
  FUN_140385a20(local_30,(longlong)param_5 + 0x6a);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fad);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_6 + 1);
  FUN_1403a17c0(local_30,param_6 + 5);
  FUN_140058470(local_30,param_6[9]);
  FUN_140058470(local_30,param_6[10]);
  FUN_140058470(local_30,param_6[0xb]);
  FUN_140058470(local_30,param_6[0xc]);
  FUN_140058470(local_30,param_6[0xd]);
  FUN_140385980(local_30,param_6 + 0xe);
  FUN_140385a20(local_30,(longlong)param_6 + 0x6a);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fae);
  FUN_140017c50(local_30,*param_4);
  FUN_1401201a0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOGINOUT_LOG",0x2fae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035500(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fae);
  FUN_140017c50(local_30,*param_5);
  FUN_1401201a0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400355f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2faf);
  FUN_140017c50(local_30,*param_4);
  FUN_1401200f0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CONNECTION_LOG",0x2faf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400356e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2faf);
  FUN_140017c50(local_30,*param_5);
  FUN_1401200f0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CONNECTION_LOG",0x2faf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400357d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb0);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_5 + 1);
  FUN_140058470(local_30,param_5[5]);
  FUN_140058470(local_30,param_5[6]);
  FUN_140058870(local_30,*(undefined1 *)(param_5 + 7));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_5 + 0x1d));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_5 + 0x1e));
  FUN_140385980(local_30,(longlong)param_5 + 0x1f);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035930(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb0);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_6 + 1);
  FUN_140058470(local_30,param_6[5]);
  FUN_140058470(local_30,param_6[6]);
  FUN_140058870(local_30,*(undefined1 *)(param_6 + 7));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_6 + 0x1d));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_6 + 0x1e));
  FUN_140385980(local_30,(longlong)param_6 + 0x1f);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035aa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb1);
  FUN_140017c50(local_30,*param_4);
  FUN_140120280(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_MAIL_LOG",0x2fb1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035b90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb1);
  FUN_140017c50(local_30,*param_5);
  FUN_140120280(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035c80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb2);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_1403a17c0(local_30,param_5 + 2);
  FUN_140058470(local_30,param_5[6]);
  FUN_140058470(local_30,param_5[7]);
  FUN_1403a17c0(local_30,param_5 + 8);
  FUN_140385980(local_30,param_5 + 0xc);
  FUN_140385a20(local_30,(longlong)param_5 + 0x62);
  FUN_140385a20(local_30,(longlong)param_5 + 0x82);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140035df0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb2);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_1403a17c0(local_30,param_6 + 2);
  FUN_140058470(local_30,param_6[6]);
  FUN_140058470(local_30,param_6[7]);
  FUN_1403a17c0(local_30,param_6 + 8);
  FUN_140385980(local_30,param_6 + 0xc);
  FUN_140385a20(local_30,(longlong)param_6 + 0x62);
  FUN_140385a20(local_30,(longlong)param_6 + 0x82);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140035f70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_CONNECTION_TEST",0x2fb3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140036030(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_CONNECTION_TEST",0x2fb3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036100(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb4);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_1403859e0(local_30,param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140017c50(local_30,*param_14);
  FUN_140058770(local_30,*param_15);
  FUN_140017c50(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOGOUT_LOG",0x2fb4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140385940(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  FUN_1403859e0(local_30,param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140017c50(local_30,*param_15);
  FUN_140058770(local_30,*param_16);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb5);
  FUN_140017c50(local_30,*param_4);
  FUN_140120340(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_AUCTION",0x2fb5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb5);
  FUN_140017c50(local_30,*param_5);
  FUN_140120340(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036610(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb6);
  FUN_140017c50(local_30,*param_4);
  FUN_140120500(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEMMAIL",0x2fb6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036700(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb6);
  FUN_140017c50(local_30,*param_5);
  FUN_140120500(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400367f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb7);
  FUN_140017c50(local_30,*param_4);
  FUN_140120670(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ITEMS",0x2fb7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400368e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb7);
  FUN_140017c50(local_30,*param_5);
  FUN_140120670(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400369d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb8);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036ac0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb8);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140036bb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_REAL_TIME_EVENT",0x2fb9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140036c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036d40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fba);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fba);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140036f70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbb);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbb);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,param_7[1]);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400371c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbc);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400372e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbc);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,param_7[1]);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbd);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbd);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,param_7[1]);
  FUN_140058570(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbe);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_BUFF",0x2fbe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037760(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbe);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140037870(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbf);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbf);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037a30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc0);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037b30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc0);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc1);
  FUN_140017c50(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_1401182c0(local_30,param_11);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037db0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc1);
  FUN_140017c50(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_1401182c0(local_30,param_12);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140037f30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc2);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038040(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc2);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140038160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_WORLD_SERVER",0x2fc3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140038220(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400382f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc4);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140385940(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  FUN_1403859e0(local_30,param_12);
  FUN_140058670(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_REWARD_COUPON",0x2fc4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140385940(local_30,param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_1403859e0(local_30,param_11);
  FUN_140058470(local_30,*param_12);
  FUN_1403859e0(local_30,param_13);
  FUN_140058670(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc5);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400386f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc5);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400387e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc6);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400388d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc6);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400389c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc7);
  FUN_140017c50(local_30,*param_4);
  FUN_1401208c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_PET",0x2fc7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038ab0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc7);
  FUN_140017c50(local_30,*param_5);
  FUN_1401208c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038ba0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc8);
  FUN_140017c50(local_30,*param_4);
  FUN_1401207f0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_ACCOUNT",0x2fc8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038c90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc8);
  FUN_140017c50(local_30,*param_5);
  FUN_1401207f0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038d80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc9);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038e80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc9);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140038f90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fca);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_REWARD",0x2fca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fca);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400391a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fcb);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_1401182c0(local_30,param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_REWARD_ITEM",0x2fcb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fcb);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  FUN_1401182c0(local_30,param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400394e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fcc);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400395d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fcc);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400396d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fcd);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058470(local_30,param_5[2]);
  FUN_140058470(local_30,param_5[3]);
  FUN_140058470(local_30,param_5[4]);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039800(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fcd);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_140058470(local_30,param_6[2]);
  FUN_140058470(local_30,param_6[3]);
  FUN_140058470(local_30,param_6[4]);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039940(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fce);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039a30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fce);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039b20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fcf);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fcf);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd0);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_1403a17c0(local_30,param_5 + 2);
  FUN_1403a17c0(local_30,param_5 + 6);
  FUN_140058470(local_30,param_5[10]);
  FUN_140058470(local_30,param_5[0xb]);
  FUN_140058470(local_30,param_5[0xc]);
  FUN_140385a20(local_30,param_5 + 0xd);
  FUN_140385a20(local_30,param_5 + 0x15);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140039ea0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd0);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_1403a17c0(local_30,param_6 + 2);
  FUN_1403a17c0(local_30,param_6 + 6);
  FUN_140058470(local_30,param_6[10]);
  FUN_140058470(local_30,param_6[0xb]);
  FUN_140058470(local_30,param_6[0xc]);
  FUN_140385a20(local_30,param_6 + 0xd);
  FUN_140385a20(local_30,param_6 + 0x15);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a020(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd1);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a110(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd1);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a210(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd2);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a300(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd2);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd3);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140017c50(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_INVEN_SLOT",0x2fd3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a550(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd3);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140017c50(local_30,*param_10);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a6b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd4);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058470(local_30,param_5[2]);
  FUN_1403a17c0(local_30,param_5 + 3);
  FUN_1403a17c0(local_30,param_5 + 7);
  FUN_1403a17c0(local_30,param_5 + 0xb);
  FUN_1401182c0(local_30,param_5 + 0x17);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a800(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_140058470(local_30,param_6[2]);
  FUN_1403a17c0(local_30,param_6 + 3);
  FUN_1403a17c0(local_30,param_6 + 7);
  FUN_1403a17c0(local_30,param_6 + 0xb);
  FUN_1401182c0(local_30,param_6 + 0x17);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003a960(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd5);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003aa60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd5);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003ab70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd6);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003ac70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd6);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003ad80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd7);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003ae80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd7);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003af90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd8);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd8);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b1a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd9);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b2b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fd9);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1401182c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b3d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fda);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b4d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fda);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b5e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fdb);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_READ_SKILL",0x2fdb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b6e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fdb);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b7f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fdc);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003b930(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fdc);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003ba80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fdd);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003bb80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fdd);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003bc90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fde);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_1403a17c0(local_30,param_5 + 2);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 5));
  FUN_1403a17c0(local_30,param_6 + 9);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003be00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fde);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_1403a17c0(local_30,param_6 + 2);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 5));
  FUN_1403a17c0(local_30,param_7 + 9);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003bf80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fdf);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fdf);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe0);
  FUN_140017c50(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 5));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 9));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 0xd));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 0x11));
  FUN_1403a17c0(local_30,param_5 + 0x15);
  FUN_1403a17c0(local_30,param_5 + 0x25);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c2c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe0);
  FUN_140017c50(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 5));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 9));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 0xd));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 0x11));
  FUN_1403a17c0(local_30,param_6 + 0x15);
  FUN_1403a17c0(local_30,param_6 + 0x25);
  FUN_140385a20(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe1);
  FUN_140058470(local_30,*param_4);
  FUN_140385940(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_SECOND_PASS",0x2fe1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe1);
  FUN_140058470(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c640(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe2);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c750(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe2);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c870(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe3);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_LOG_CASH",0x2fe3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003c980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe3);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003caa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe4);
  FUN_140017c50(local_30,*param_4);
  FUN_140385940(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140385940(local_30,param_9);
  FUN_140385940(local_30,param_10);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003cc00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe4);
  FUN_140017c50(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140385940(local_30,param_10);
  FUN_140385940(local_30,param_11);
  FUN_140385940(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003cd70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe5);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003ce80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe5);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003cfa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe6);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14003d0a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fe6);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}


/*
Unable to decompile 'FUN_14003d1b0'
Cause: Exception while decompiling 14003d1b0: 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_140388ea0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14004b8e0(undefined8 *param_1)

{
  *param_1 = RNP::Dbc2ServersStub::vftable;
  FUN_140388ea0();
  return;
}



void FUN_14004b8f0(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_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14004b960(undefined8 *param_1)

{
  *param_1 = RNP::Servers2DbcProxy::vftable;
  FUN_140385b20();
  return;
}



void FUN_14004b970(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_14060b7c0 & 1) == 0) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
  }
  if (DAT_140609ec0 != 1000) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 != 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_14034fe70();
      local_res18 = PTR_DAT_1405d8008;
      iVar4 = FUN_14034fd90(uVar7);
      if (local_res18 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_res18 == PTR_DAT_1405d8008) {
        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_1405d8008) {
          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_1405d8008) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(local_res18 + -8);
      }
      if (iVar5 < iVar6) {
        FUN_140057890(&local_res18);
      }
      FUN_140057970(&local_res18);
      puVar8 = local_res18;
      if (local_res18 == (undefined *)0x0) {
        puVar8 = PTR_DAT_1405d8008;
      }
      FUN_14034fdc0(puVar8,uVar7,iVar4);
      iVar6 = FUN_14034fd90();
      iVar4 = 0;
      if (0 < iVar6) {
        iVar4 = iVar6;
      }
      if (local_res18 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_res18 == PTR_DAT_1405d8008) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(local_res18 + -8);
      }
      if (iVar6 <= iVar4) {
        if (local_res18 == (undefined *)0x0) {
          iVar4 = 0;
        }
        else if (local_res18 == PTR_DAT_1405d8008) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(local_res18 + -8);
        }
      }
      if (((local_res18 != PTR_DAT_1405d8008) && (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_1405d85a0,&local_res18,local_res10);
      puVar8 = local_res18;
      if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1405d8008)) &&
         (puVar2 = local_res18 + -8, puVar2 != (undefined *)0x0)) {
        uVar7 = FUN_14034fe70();
        FUN_14034ed40(uVar7);
        piVar1 = (int *)(puVar8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar2);
        }
        FUN_14034edd0(uVar7);
      }
    }
  }
  return;
}



void FUN_14004bbc0(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;
}



undefined8 FUN_14004bc20(undefined8 param_1,longlong *param_2)

{
  undefined2 *puVar1;
  
  FUN_140058470(param_1,(param_2[1] - *param_2) / 0x34);
  puVar1 = (undefined2 *)*param_2;
  if (puVar1 != (undefined2 *)param_2[1]) {
    do {
      FUN_140017c50(param_1,*puVar1);
      FUN_140017c50(param_1,puVar1[0x11]);
      FUN_140058770(param_1,*(undefined8 *)(puVar1 + 0x12));
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 0x16));
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 0x18));
      FUN_140385a20(param_1,puVar1 + 1);
      puVar1 = puVar1 + 0x1a;
    } while (puVar1 != (undefined2 *)param_2[1]);
  }
  return param_1;
}



undefined8 FUN_14004bcd0(undefined8 param_1,longlong *param_2)

{
  undefined2 *puVar1;
  
  FUN_140058470(param_1,param_2[1] - *param_2 >> 5);
  puVar1 = (undefined2 *)*param_2;
  if (puVar1 != (undefined2 *)param_2[1]) {
    do {
      FUN_140017c50(param_1,*puVar1);
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 1));
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 4));
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 6));
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 8));
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 10));
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 0xc));
      FUN_140058470(param_1,*(undefined4 *)(puVar1 + 0xe));
      FUN_140017c50(param_1,puVar1[3]);
      puVar1 = puVar1 + 0x10;
    } while (puVar1 != (undefined2 *)param_2[1]);
  }
  return param_1;
}



undefined8 FUN_14004bd90(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  
  FUN_140058470(param_1,(param_2[1] - *param_2) / 0x50);
  lVar1 = *param_2;
  if (lVar1 != param_2[1]) {
    do {
      FUN_1403a17c0(param_1,lVar1);
      FUN_1403a17c0(param_1,lVar1 + 0x10);
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x20));
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x24));
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x28));
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x2c));
      FUN_140385a20(param_1,lVar1 + 0x30);
      lVar1 = lVar1 + 0x50;
    } while (lVar1 != param_2[1]);
  }
  return param_1;
}



undefined8 FUN_14004be50(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  
  FUN_140058470(param_1,(param_2[1] - *param_2) / 0x44);
  lVar1 = *param_2;
  if (lVar1 != param_2[1]) {
    do {
      FUN_1403a17c0(param_1,lVar1);
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x10));
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x14));
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x18));
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x1c));
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x20));
      FUN_140385a20(param_1,lVar1 + 0x24);
      lVar1 = lVar1 + 0x44;
    } while (lVar1 != param_2[1]);
  }
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014004bf82)
// WARNING: Removing unreachable block (ram,0x00014004bf90)

undefined8 FUN_14004bf00(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_1403840e0(param_1,local_res8,4);
  uVar4 = local_res8[0];
  uVar9 = (ulonglong)local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1405d8140 <= (int)local_res8[0])) {
    FUN_1403a1730(local_res8[0]);
  }
  FUN_140051790(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_1403840e0(param_1,local_res8,4);
      local_38 = 0;
      if (cVar5 != '\0') {
        local_38 = local_res8[0];
      }
      cVar5 = FUN_1403840e0(param_1,local_res10,4);
      uStack_34 = 0;
      if (cVar5 != '\0') {
        uStack_34 = local_res10[0];
      }
      cVar5 = FUN_1403840e0(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_1400553f0(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_1400553f0(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;
}



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

undefined8 FUN_14004c0e0(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  longlong lVar2;
  uint uVar3;
  char cVar4;
  longlong lVar5;
  ulonglong uVar6;
  undefined1 auStack_68 [32];
  uint local_48 [2];
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  uint local_30;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  FUN_1403840e0(param_1,local_48,4);
  uVar3 = local_48[0];
  uVar6 = (ulonglong)local_48[0];
  if (((int)local_48[0] < 0) || (DAT_1405d8140 <= (int)local_48[0])) {
    FUN_1403a1730(local_48[0]);
  }
  FUN_1400518d0(param_2,(longlong)(int)uVar3);
  lVar1 = *param_2;
  lVar5 = param_2[1] - lVar1;
  lVar2 = lVar5 >> 0x3f;
  if ((lVar5 / 0x14 + lVar2 != lVar2) && (lVar1 != param_2[1])) {
    param_2[1] = lVar1;
  }
  if (0 < (int)uVar3) {
    do {
      local_40 = 0;
      local_30 = 0;
      local_3c = 0;
      local_38 = 0;
      local_34 = 0;
      FUN_1403a1710(param_1,&local_40);
      cVar4 = FUN_1403840e0(param_1,local_48,4);
      if (cVar4 != '\0') {
        local_30 = local_48[0];
      }
      FUN_140051a10(param_2,&local_40);
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
  }
  return param_1;
}



void FUN_14004c240(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x14,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004c310(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_1405d84f0 ^ (ulonglong)auStack_108;
  FUN_1403840e0(param_1,local_e8,4);
  if (((int)local_e8[0] < 0) || (DAT_1405d8140 <= (int)local_e8[0])) {
    FUN_1403a1730(local_e8[0]);
  }
  FUN_140051ae0(param_2,(longlong)(int)local_e8[0]);
  FUN_140051c20(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_140118570(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_140055550(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)((((longlong)&local_d8 - (longlong)puVar1) / 0x97) * 0x97 + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_14004c4c5:
          memcpy(_Dst,puVar3,0x97);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_140055550(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_d8;
          goto LAB_14004c4c5;
        }
      }
      param_2[1] = param_2[1] + 0x97;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_14004c520(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x97,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004c5f0(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_1405d84f0 ^ (ulonglong)auStack_88;
  cVar4 = FUN_1403840e0(param_1,&local_60,4);
  uVar7 = local_58[0];
  if (cVar4 != '\0') {
    uVar7 = local_60;
  }
  if (((int)uVar7 < 0) || (DAT_1405d8140 <= (int)uVar7)) {
    FUN_1403a1730(uVar7);
  }
  FUN_140051cb0(param_2,(longlong)(int)uVar7);
  FUN_140051de0(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_1403a1710(param_1,&local_50);
      cVar4 = FUN_1403840e0(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_1403840e0(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_1403840e0(uVar5,local_58,4);
      if (cVar4 != '\0') {
        local_40._4_4_ = local_58[0];
      }
      cVar4 = FUN_1403840e0(uVar5,&local_60,2);
      if (cVar4 != '\0') {
        local_38 = (undefined2)local_60;
      }
      cVar4 = FUN_1403840e0(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_140055600(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_140055600(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_14004c860(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x1b,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14004c920(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_1403840e0(param_1,local_res10,4);
  uVar4 = local_res10[0];
  if (((int)local_res10[0] < 0) || (DAT_1405d8140 <= (int)local_res10[0])) {
    FUN_1403a1730(local_res10[0]);
  }
  FUN_140051e60(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_1403840e0(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_1400556a0(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_1400556a0(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_14004ca70(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",param_2[1] - *param_2 >> 2,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004cb20(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_1405d84f0 ^ (ulonglong)auStack_a8;
  FUN_1403840e0(param_1,local_88,4);
  if (((int)local_88[0] < 0) || (DAT_1405d8140 <= (int)local_88[0])) {
    FUN_1403a1730(local_88[0]);
  }
  FUN_140051f20(param_2,(longlong)(int)local_88[0]);
  FUN_140052060(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_140120b90(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_140055790(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_140055790(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_14004cd50(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x38,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004ce20(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_1405d84f0 ^ (ulonglong)auStack_188;
  FUN_1403840e0(param_1,local_168,4);
  if (((int)local_168[0] < 0) || (DAT_1405d8140 <= (int)local_168[0])) {
    FUN_1403a1730(local_168[0]);
  }
  FUN_1400520f0(param_2,(longlong)(int)local_168[0]);
  FUN_140052230(param_2);
  if (0 < (int)local_168[0]) {
    uVar2 = (ulonglong)local_168[0];
    do {
      FUN_1400582e0(local_158);
      FUN_14011b1c0(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_140055840(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined1 *)
                 (((longlong)(local_158 + -(longlong)puVar1) / 0x122) * 0x122 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_14004cf4d:
          memcpy(_Dst,puVar3,0x122);
        }
      }
      else {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_140055840(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = local_158;
          goto LAB_14004cf4d;
        }
      }
      param_2[1] = param_2[1] + 0x122;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_14004cfa0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x122,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004d070(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_1405d84f0 ^ (ulonglong)auStack_98;
  FUN_1403840e0(param_1,local_78,4);
  if (((int)local_78[0] < 0) || (DAT_1405d8140 <= (int)local_78[0])) {
    FUN_1403a1730(local_78[0]);
  }
  FUN_1400522c0(param_2,(longlong)(int)local_78[0]);
  FUN_140052400(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_14011c0b0(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_1400558f0(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_1400558f0(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_14004d260(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x34,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004d330(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_1405d84f0 ^ (ulonglong)auStack_f8;
  FUN_1403840e0(param_1,local_d8,4);
  if (((int)local_d8[0] < 0) || (DAT_1405d8140 <= (int)local_d8[0])) {
    FUN_1403a1730(local_d8[0]);
  }
  FUN_140052490(param_2);
  FUN_1400525d0(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_14011c200(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_1400559a0(param_2);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)((((longlong)&local_c8 - (longlong)puVar1) / 0x88) * 0x88 + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_14004d488:
          memcpy(_Dst,puVar3,0x88);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_1400559a0(param_2);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_c8;
          goto LAB_14004d488;
        }
      }
      param_2[1] = param_2[1] + 0x88;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_14004d4e0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x88,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004d5b0(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_1405d84f0 ^ (ulonglong)auStack_3a8;
  FUN_1403840e0(param_1,local_388,4);
  uVar1 = (ulonglong)local_388[0];
  if (((int)local_388[0] < 0) || (DAT_1405d8140 <= (int)local_388[0])) {
    FUN_1403a1730(local_388[0]);
  }
  FUN_140052660(param_2);
  FUN_1400527a0(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_140118fb0(param_1,&local_378);
      FUN_140052830(param_2);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_14004d720(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(lVar5),8) + lVar5;
  FUN_140017720(local_res10,L"<Array %d>",(lVar4 >> 9) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_14034fe70();
    FUN_14034ed40(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar6);
  }
  return;
}



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

undefined8 FUN_14004d7f0(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_1405d84f0 ^ (ulonglong)auStack_108;
  FUN_1403840e0(param_1,local_e8,4);
  if (((int)local_e8[0] < 0) || (DAT_1405d8140 <= (int)local_e8[0])) {
    FUN_1403a1730(local_e8[0]);
  }
  FUN_140052910(param_2,(longlong)(int)local_e8[0]);
  FUN_140052a50(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_140119270(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_140055b00(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)((((longlong)&local_d8 - (longlong)puVar1) / 0x9f) * 0x9f + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_14004d9a9:
          memcpy(_Dst,puVar3,0x9f);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_140055b00(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_d8;
          goto LAB_14004d9a9;
        }
      }
      param_2[1] = param_2[1] + 0x9f;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_14004da00(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x9f,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014004db5b)
// WARNING: Removing unreachable block (ram,0x00014004db60)

undefined8 FUN_14004dad0(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_1403840e0(param_1,local_res8,4);
  uVar3 = local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1405d8140 <= (int)local_res8[0])) {
    FUN_1403a1730(local_res8[0]);
  }
  FUN_140051790(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_1403840e0(param_1,local_58,4);
      local_50 = 0;
      if (cVar4 != '\0') {
        local_50 = local_58[0];
      }
      cVar4 = FUN_1403840e0(param_1,local_res8,2);
      uStack_4c = 0;
      if (cVar4 != '\0') {
        uStack_4c = (undefined2)local_res8[0];
      }
      cVar4 = FUN_1403840e0(param_1,local_res10,2);
      uStack_4a = 0;
      if (cVar4 != '\0') {
        uStack_4a = local_res10[0];
      }
      cVar4 = FUN_1403840e0(param_1,local_res18,2);
      uVar6 = 0;
      if (cVar4 != '\0') {
        uVar6 = local_res18[0];
      }
      local_48 = CONCAT22(local_48._2_2_,uVar6);
      cVar4 = FUN_1403840e0(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_1400553f0(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_14004dcfb:
          *(undefined4 *)(puVar8 + 1) = uVar5;
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_1400553f0(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_14004dcfb;
        }
      }
      param_2[1] = param_2[1] + 0xc;
      uVar10 = uVar10 - 1;
    } while (uVar10 != 0);
  }
  return param_1;
}



void FUN_14004dd30(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0xc,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004de00(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_1405d84f0 ^ (ulonglong)auStack_88;
  cVar4 = FUN_1403840e0(param_1,&local_68,4);
  uVar6 = local_64;
  if (cVar4 != '\0') {
    uVar6 = local_68;
  }
  if (((int)uVar6 < 0) || (DAT_1405d8140 <= (int)uVar6)) {
    FUN_1403a1730(uVar6);
  }
  FUN_140052ae0(param_2,(longlong)(int)uVar6);
  FUN_140052c20(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_1403a1710(param_1,&local_58);
      cVar4 = FUN_1403840e0(param_1,&local_68,4);
      uVar6 = (uint)local_48;
      if (cVar4 != '\0') {
        uVar6 = local_68;
      }
      local_48._0_4_ = uVar6;
      cVar4 = FUN_1403840e0(param_1,local_60,4);
      if (cVar4 != '\0') {
        local_48._4_4_ = local_60[0];
      }
      cVar4 = FUN_1403840e0(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_140055bb0(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_140055bb0(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_14004e010(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x1c,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014004e14a)
// WARNING: Removing unreachable block (ram,0x00014004e150)

undefined8 FUN_14004e0e0(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_1403840e0(param_1,local_res10,4);
  if (((int)local_res10[0] < 0) || (DAT_1405d8140 <= (int)local_res10[0])) {
    FUN_1403a1730(local_res10[0]);
  }
  FUN_1402c10c0(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_140119680(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_140055dc0(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_14004e26a:
          puVar3[3] = local_20;
        }
      }
      else {
        if (puVar1 == (undefined2 *)param_2[2]) {
          FUN_140055dc0(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_14004e26a;
        }
      }
      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_14004e2a0(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_1405d84f0 ^ (ulonglong)auStack_d8;
  FUN_1403840e0(param_1,local_b8,4);
  if (((int)local_b8[0] < 0) || (DAT_1405d8140 <= (int)local_b8[0])) {
    FUN_1403a1730(local_b8[0]);
  }
  FUN_140052ca0(param_2,(longlong)(int)local_b8[0]);
  FUN_140052de0(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_14011c780(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_140055c60(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_140055c60(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_14004e4a0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x5e,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004e570(undefined8 param_1,undefined8 param_2)

{
  ulonglong uVar1;
  undefined1 auStack_c8 [32];
  uint local_a8 [4];
  undefined2 local_98;
  undefined4 local_96;
  undefined2 local_92;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined4 local_78;
  undefined2 local_74;
  undefined8 local_72;
  undefined8 local_6a;
  undefined8 local_62;
  undefined2 local_5a;
  undefined1 local_58;
  undefined4 local_57;
  undefined2 local_53;
  undefined8 local_51;
  undefined8 local_49;
  undefined8 local_41;
  undefined8 local_39;
  undefined8 local_31;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  FUN_1403840e0(param_1,local_a8,4);
  uVar1 = (ulonglong)local_a8[0];
  if (((int)local_a8[0] < 0) || (DAT_1405d8140 <= (int)local_a8[0])) {
    FUN_1403a1730(local_a8[0]);
  }
  FUN_140052e70(param_2,(longlong)(int)local_a8[0]);
  FUN_140052fb0(param_2);
  if (0 < (int)local_a8[0]) {
    do {
      local_51 = 0;
      local_98 = 0;
      local_96 = 0;
      local_92 = 0;
      local_90 = 0;
      local_49 = 0;
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_74 = 0;
      local_72 = 0;
      local_6a = 0;
      local_62 = 0;
      local_5a = 0;
      local_58 = 0;
      local_57 = 0;
      local_53 = 0;
      local_41 = 0;
      local_39 = 0;
      local_31 = 0;
      FUN_140118b10(param_1,&local_98);
      FUN_140053040(param_2,&local_98);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_14004e6a0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(lVar5),8) + lVar5;
  FUN_140017720(local_res10,L"<Array %d>",(lVar4 >> 6) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_14034fe70();
    FUN_14034ed40(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar6);
  }
  return;
}



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

undefined8 FUN_14004e770(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_1405d84f0 ^ (ulonglong)auStack_68;
  FUN_1403840e0(param_1,local_48,4);
  if (((int)local_48[0] < 0) || (DAT_1405d8140 <= (int)local_48[0])) {
    FUN_1403a1730(local_48[0]);
  }
  FUN_1402c10c0(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_140118a30(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_140055dc0(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_140055dc0(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;
}



void FUN_14004e970(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",param_2[1] - *param_2 >> 5,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004ea20(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_1405d84f0 ^ (ulonglong)auStack_98;
  cVar4 = FUN_1403840e0(param_1,&local_78,4);
  uVar6 = local_74;
  if (cVar4 != '\0') {
    uVar6 = local_78;
  }
  if (((int)uVar6 < 0) || (DAT_1405d8140 <= (int)uVar6)) {
    FUN_1403a1730(uVar6);
  }
  FUN_1402c10c0(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_1403a1710(param_1,&local_68);
      cVar4 = FUN_1403840e0(param_1,&local_78,4);
      uVar6 = (uint)local_58;
      if (cVar4 != '\0') {
        uVar6 = local_78;
      }
      local_58._0_4_ = uVar6;
      cVar4 = FUN_1403840e0(param_1,&local_74,4);
      if (cVar4 != '\0') {
        local_58._4_4_ = local_74;
      }
      cVar4 = FUN_1403840e0(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_140055dc0(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_140055dc0(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;
}



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

undefined8 FUN_14004ec60(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_1405d84f0 ^ (ulonglong)auStack_1b8;
  FUN_1403840e0(param_1,local_198,4);
  if (((int)local_198[0] < 0) || (DAT_1405d8140 <= (int)local_198[0])) {
    FUN_1403a1730(local_198[0]);
  }
  FUN_140053110(param_2,(longlong)(int)local_198[0]);
  FUN_140053250(param_2);
  if (0 < (int)local_198[0]) {
    uVar2 = (ulonglong)local_198[0];
    do {
      FUN_14000e540(local_188);
      FUN_1401197b0(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_140055e40(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined1 *)
                 (((longlong)(local_188 + -(longlong)puVar1) / 0x159) * 0x159 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_14004ed8d:
          memcpy(_Dst,puVar3,0x159);
        }
      }
      else {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_140055e40(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = local_188;
          goto LAB_14004ed8d;
        }
      }
      param_2[1] = param_2[1] + 0x159;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_14004ede0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x159,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004eeb0(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_1405d84f0 ^ (ulonglong)auStack_138;
  FUN_1403840e0(param_1,local_118,4);
  if (((int)local_118[0] < 0) || (DAT_1405d8140 <= (int)local_118[0])) {
    FUN_1403a1730(local_118[0]);
  }
  FUN_1400532e0(param_2,(longlong)(int)local_118[0]);
  FUN_140053420(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_1401210f0(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_140055ef0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined4 *)
                 ((((longlong)&local_108 - (longlong)puVar1) / 0xaf) * 0xaf + *param_2);
        if (_Dst != (void *)0x0) {
LAB_14004f077:
          memcpy(_Dst,puVar3,0xaf);
        }
      }
      else {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_140055ef0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_108;
          goto LAB_14004f077;
        }
      }
      param_2[1] = param_2[1] + 0xaf;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_14004f0e0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0xaf,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004f1b0(undefined8 param_1,undefined8 param_2)

{
  ulonglong uVar1;
  undefined1 auStack_b8 [32];
  uint local_98 [4];
  undefined8 local_88;
  undefined8 uStack_80;
  undefined4 local_78;
  undefined1 local_74 [40];
  undefined8 local_4c;
  undefined8 local_44;
  undefined8 local_3c;
  undefined8 local_34;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  FUN_1403840e0(param_1,local_98,4);
  uVar1 = (ulonglong)local_98[0];
  if (((int)local_98[0] < 0) || (DAT_1405d8140 <= (int)local_98[0])) {
    FUN_1403a1730(local_98[0]);
  }
  FUN_1400534b0(param_2);
  FUN_1400535f0(param_2);
  if (0 < (int)local_98[0]) {
    do {
      local_78 = 0;
      local_88 = 0;
      uStack_80 = 0;
      memset(local_74,0,0x28);
      local_4c = 0;
      local_44 = 0;
      local_3c = 0;
      local_34 = 0;
      FUN_14011ccf0(param_1,&local_88);
      FUN_140053680(param_2);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_14004f2b0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(lVar5),8) + lVar5;
  FUN_140017720(local_res10,L"<Array %d>",(lVar4 >> 6) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_14034fe70();
    FUN_14034ed40(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar6);
  }
  return;
}



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

undefined8 FUN_14004f380(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_1405d84f0 ^ (ulonglong)auStack_f8;
  FUN_1403840e0(param_1,local_d8,4);
  if (((int)local_d8[0] < 0) || (DAT_1405d8140 <= (int)local_d8[0])) {
    FUN_1403a1730(local_d8[0]);
  }
  FUN_140053750(param_2,(longlong)(int)local_d8[0]);
  FUN_140053890(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_14011d440(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_140056050(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined1 *)
                 (((longlong)(&local_c8 + -(longlong)puVar1) / 0x85) * 0x85 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_14004f4e7:
          memcpy(_Dst,puVar3,0x85);
        }
      }
      else {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_140056050(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_c8;
          goto LAB_14004f4e7;
        }
      }
      param_2[1] = param_2[1] + 0x85;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_14004f530(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x85,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004f600(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_1405d84f0 ^ (ulonglong)auStack_78;
  cVar4 = FUN_1403840e0(param_1,&local_58,4);
  uVar8 = local_54;
  if (cVar4 != '\0') {
    uVar8 = local_58;
  }
  if (((int)uVar8 < 0) || (DAT_1405d8140 <= (int)uVar8)) {
    FUN_1403a1730(uVar8);
  }
  FUN_1401df3a0(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_1403a1710(param_1,&local_50);
      cVar4 = FUN_1403840e0(param_1,&local_58,4);
      uVar8 = (uint)local_40;
      if (cVar4 != '\0') {
        uVar8 = local_58;
      }
      local_40._0_4_ = uVar8;
      cVar4 = FUN_1403840e0(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_140056100(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_140056100(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_14004f850(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x18,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8
FUN_14004f920(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_1403840e0(param_1,&local_res8,4,param_4,0xfffffffffffffffe);
  puVar4 = local_res8;
  iVar3 = (int)local_res8;
  if (((int)local_res8 < 0) || (DAT_1405d8140 <= (int)local_res8)) {
    FUN_1403a1730((ulonglong)local_res8 & 0xffffffff);
  }
  FUN_1400539e0(param_2,(longlong)iVar3);
  FUN_140053b10(param_2);
  if (0 < iVar3) {
    uVar6 = (ulonglong)puVar4 & 0xffffffff;
    do {
      FUN_14034fe70();
      local_res8 = PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_1,&local_res8);
      FUN_140053ba0(param_2,&local_res8);
      puVar4 = local_res8;
      if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
         (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
        uVar5 = FUN_14034fe70();
        FUN_14034ed40(uVar5);
        piVar2 = (int *)(puVar4 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar5);
      }
      local_res8 = PTR_DAT_1405d8010;
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
  }
  return param_1;
}



void FUN_14004fa40(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",param_2[1] - *param_2 >> 3,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004faf0(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_1405d84f0 ^ (ulonglong)auStack_d8;
  FUN_1403840e0(param_1,local_b8,4);
  if (((int)local_b8[0] < 0) || (DAT_1405d8140 <= (int)local_b8[0])) {
    FUN_1403a1730(local_b8[0]);
  }
  FUN_140053c80(param_2,(longlong)(int)local_b8[0]);
  FUN_140053dc0(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_14011d630(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_140056230(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_140056230(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_14004fce0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x62,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14004fdb0(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_1405d84f0 ^ (ulonglong)auStack_138;
  FUN_1403840e0(param_1,local_118,4);
  if (((int)local_118[0] < 0) || (DAT_1405d8140 <= (int)local_118[0])) {
    FUN_1403a1730(local_118[0]);
  }
  FUN_140053e50(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_140056b80(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_14011d790(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_1400562e0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar5 = (undefined4 *)
                 ((((longlong)&local_108 - (longlong)puVar1) / 0xa4) * 0xa4 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_14004ffc1:
          memcpy(_Dst,puVar5,0xa4);
        }
      }
      else {
        if (puVar5 == (undefined4 *)param_2[2]) {
          FUN_1400562e0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar5 = &local_108;
          goto LAB_14004ffc1;
        }
      }
      param_2[1] = param_2[1] + 0xa4;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  return param_1;
}



void FUN_140050020(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0xa4,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_1400500f0(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_1405d84f0 ^ (ulonglong)auStack_b8;
  FUN_1403840e0(param_1,local_98,4);
  if (((int)local_98[0] < 0) || (DAT_1405d8140 <= (int)local_98[0])) {
    FUN_1403a1730(local_98[0]);
  }
  FUN_140053f90(param_2,(longlong)(int)local_98[0]);
  FUN_1400540d0(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_14011de50(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_140056390(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_140056390(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_1400502c0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x50,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_140050390(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_1405d84f0 ^ (ulonglong)auStack_338;
  FUN_1403840e0(param_1,local_318,4);
  if (((int)local_318[0] < 0) || (DAT_1405d8140 <= (int)local_318[0])) {
    FUN_1403a1730(local_318[0]);
  }
  FUN_140054160(param_2,(longlong)(int)local_318[0]);
  FUN_1400542a0(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_14011e180(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_140056440(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined4 *)
                 ((((longlong)&local_308 - (longlong)puVar1) / 0x2b1) * 0x2b1 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_14005055d:
          memcpy(_Dst,puVar3,0x2b1);
        }
      }
      else {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_140056440(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_308;
          goto LAB_14005055d;
        }
      }
      param_2[1] = param_2[1] + 0x2b1;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_1400505c0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x2b1,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_140050690(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_1405d84f0 ^ (ulonglong)auStack_178;
  FUN_1403840e0(param_1,local_158,4);
  if (((int)local_158[0] < 0) || (DAT_1405d8140 <= (int)local_158[0])) {
    FUN_1403a1730(local_158[0]);
  }
  FUN_140054330(param_2);
  FUN_140054470(param_2);
  if (0 < (int)local_158[0]) {
    uVar2 = (ulonglong)local_158[0];
    do {
      local_148 = 0;
      memset(local_140,0,0x100);
      FUN_14011e4a0(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_1400564f0(param_2);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)
                 (((longlong)(local_140 + (-8 - (longlong)puVar1)) / 0x108) * 0x108 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_1400507cd:
          memcpy(_Dst,puVar3,0x108);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_1400564f0(param_2);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_148;
          goto LAB_1400507cd;
        }
      }
      param_2[1] = param_2[1] + 0x108;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140050820(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x108,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014005096a)
// WARNING: Removing unreachable block (ram,0x000140050970)

undefined8 FUN_1400508f0(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  longlong lVar2;
  uint uVar3;
  char cVar4;
  longlong lVar5;
  ulonglong uVar6;
  uint local_res8 [2];
  undefined4 local_res10 [2];
  undefined4 local_res18 [4];
  uint local_38;
  undefined4 local_34;
  undefined4 local_30;
  
  FUN_1403840e0(param_1,local_res8,4);
  uVar3 = local_res8[0];
  uVar6 = (ulonglong)local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1405d8140 <= (int)local_res8[0])) {
    FUN_1403a1730(local_res8[0]);
  }
  FUN_140275900(param_2,(longlong)(int)uVar3);
  lVar1 = *param_2;
  lVar5 = param_2[1] - lVar1;
  lVar2 = lVar5 >> 0x3f;
  if ((lVar5 / 0xc + lVar2 != lVar2) && (lVar1 != param_2[1])) {
    param_2[1] = lVar1;
  }
  if (0 < (int)uVar3) {
    do {
      local_30 = 0;
      cVar4 = FUN_1403840e0(param_1,local_res8,4);
      local_38 = 0;
      if (cVar4 != '\0') {
        local_38 = local_res8[0];
      }
      cVar4 = FUN_1403840e0(param_1,local_res10,4);
      local_34 = 0;
      if (cVar4 != '\0') {
        local_34 = local_res10[0];
      }
      cVar4 = FUN_1403840e0(param_1,local_res18,4);
      if (cVar4 != '\0') {
        local_30 = local_res18[0];
      }
      FUN_140054500(param_2,&local_38);
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
  }
  return param_1;
}



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

undefined8 FUN_140050a40(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_1405d84f0 ^ (ulonglong)auStack_f8;
  FUN_1403840e0(param_1,local_d8,4);
  if (((int)local_d8[0] < 0) || (DAT_1405d8140 <= (int)local_d8[0])) {
    FUN_1403a1730(local_d8[0]);
  }
  FUN_1400545d0(param_2);
  FUN_140054710(param_2);
  if (0 < (int)local_d8[0]) {
    uVar2 = (ulonglong)local_d8[0];
    do {
      local_c8 = 0;
      memset(local_c4,0,0x80);
      FUN_14011e6d0(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_140056650(param_2);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined4 *)
                 (((longlong)(local_c4 + (-4 - (longlong)puVar1)) / 0x84) * 0x84 + *param_2);
        if (_Dst != (void *)0x0) {
LAB_140050b7d:
          memcpy(_Dst,puVar3,0x84);
        }
      }
      else {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_140056650(param_2);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_c8;
          goto LAB_140050b7d;
        }
      }
      param_2[1] = param_2[1] + 0x84;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140050bd0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x84,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_140050ca0(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_1405d84f0 ^ (ulonglong)auStack_a8;
  FUN_1403840e0(param_1,local_88,4);
  uVar1 = (ulonglong)local_88[0];
  if (((int)local_88[0] < 0) || (DAT_1405d8140 <= (int)local_88[0])) {
    FUN_1403a1730(local_88[0]);
  }
  FUN_1400547a0(param_2,(longlong)(int)local_88[0]);
  FUN_140054890(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_14011e7b0(param_1,&local_78);
      FUN_140054930(param_2,&local_78);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_140050dc0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x41,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_140050e90(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_1405d84f0 ^ (ulonglong)auStack_68;
  FUN_1403840e0(param_1,local_48,4);
  uVar2 = (ulonglong)local_48[0];
  if (((int)local_48[0] < 0) || (DAT_1405d8140 <= (int)local_48[0])) {
    FUN_1403a1730(local_48[0]);
  }
  FUN_140054a00(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_140056b00(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_140121e60(param_1,&local_40);
      FUN_140054b40(param_2,&local_40);
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140050fb0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x7bdef7bdef7bdef7) * SEXT816(lVar5),8) + lVar5;
  FUN_140017720(local_res10,L"<Array %d>",(lVar4 >> 4) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_14034fe70();
    FUN_14034ed40(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar6);
  }
  return;
}



undefined8 FUN_140051080(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_1403840e0(param_1,local_res8,4);
  uVar2 = local_res8[0];
  uVar7 = (ulonglong)local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1405d8140 <= (int)local_res8[0])) {
    FUN_1403a1730(local_res8[0]);
  }
  FUN_140054c50(param_2,(longlong)(int)uVar2);
  FUN_140054d80(param_2);
  if (0 < (int)uVar2) {
    do {
      cVar3 = FUN_1403840e0(param_1,local_res8,1);
      uVar6 = 0;
      if (cVar3 != '\0') {
        uVar6 = (undefined1)local_res8[0];
      }
      local_48 = uVar6;
      cVar3 = FUN_1403840e0(param_1,local_res18,4);
      uVar5 = 0;
      if (cVar3 != '\0') {
        uVar5 = local_res18[0];
      }
      local_47 = uVar5;
      cVar3 = FUN_1403840e0(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_1400568d0(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_1400568d0(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_140051240(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 9,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_140051300(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  ulonglong uVar2;
  undefined4 *puVar3;
  undefined1 auStack_58 [32];
  uint local_38 [2];
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  FUN_1403840e0(param_1,local_38,4);
  if (((int)local_38[0] < 0) || (DAT_1405d8140 <= (int)local_38[0])) {
    FUN_1403a1730(local_38[0]);
  }
  FUN_1402d2250(param_2,(longlong)(int)local_38[0]);
  uVar2 = *param_2;
  if (((longlong)(param_2[1] - uVar2) >> 4 != 0) && (uVar2 != param_2[1])) {
    param_2[1] = uVar2;
  }
  if (0 < (int)local_38[0]) {
    uVar2 = (ulonglong)local_38[0];
    do {
      FUN_1403a1710(param_1,&local_30);
      puVar1 = (undefined4 *)param_2[1];
      if ((&local_30 < puVar1) && (puVar3 = (undefined4 *)*param_2, puVar3 <= &local_30)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_140055370(param_2,1);
        }
        puVar1 = (undefined4 *)param_2[1];
        puVar3 = (undefined4 *)
                 (((longlong)&local_30 - (longlong)puVar3 & 0xfffffffffffffff0U) + *param_2);
        if (puVar1 != (undefined4 *)0x0) {
          *puVar1 = *puVar3;
          puVar1[1] = puVar3[1];
          puVar1[2] = puVar3[2];
          puVar1[3] = puVar3[3];
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_140055370(param_2,1);
        }
        puVar1 = (undefined4 *)param_2[1];
        if (puVar1 != (undefined4 *)0x0) {
          *puVar1 = local_30;
          puVar1[1] = local_2c;
          puVar1[2] = local_28;
          puVar1[3] = local_24;
        }
      }
      param_2[1] = param_2[1] + 0x10;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_140051490(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",param_2[1] - *param_2 >> 4,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_140051540(undefined8 param_1,undefined8 param_2)

{
  ulonglong uVar1;
  undefined1 auStack_a8 [32];
  uint local_88 [4];
  undefined4 local_78;
  undefined4 uStack_74;
  undefined4 uStack_70;
  undefined4 uStack_6c;
  undefined8 local_68;
  undefined8 local_60;
  undefined4 local_58;
  undefined8 local_54;
  undefined8 local_4c;
  undefined8 local_44;
  undefined8 local_3c;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  FUN_1403840e0(param_1,local_88,4);
  uVar1 = (ulonglong)local_88[0];
  if (((int)local_88[0] < 0) || (DAT_1405d8140 <= (int)local_88[0])) {
    FUN_1403a1730(local_88[0]);
  }
  FUN_1400550c0(param_2,(longlong)(int)local_88[0]);
  FUN_140055200(param_2);
  if (0 < (int)local_88[0]) {
    do {
      local_68 = 0;
      local_60 = 0;
      local_58 = 0;
      local_54 = 0;
      local_4c = 0;
      local_78 = 0;
      uStack_74 = 0;
      uStack_70 = 0;
      uStack_6c = 0;
      local_44 = 0;
      local_3c = 0;
      FUN_14011dcf0(param_1,&local_78);
      FUN_1400552a0(param_2,&local_78);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_140051630(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x44,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_140051700(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_140055370(param_1,1);
    }
    param_2 = (undefined4 *)
              (((longlong)param_2 - (longlong)puVar2 & 0xfffffffffffffff0U) + *param_1);
  }
  else if (puVar1 == (undefined4 *)param_1[2]) {
    FUN_140055370(param_1,1);
  }
  puVar1 = (undefined4 *)param_1[1];
  if (puVar1 != (undefined4 *)0x0) {
    *puVar1 = *param_2;
    puVar1[1] = param_2[1];
    puVar1[2] = param_2[2];
    puVar1[3] = param_2[3];
  }
  param_1[1] = param_1[1] + 0x10;
  return;
}



void FUN_140051790(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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_1400570d0(*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_1400518d0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140056d60(*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_140051a10(ulonglong *param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  puVar1 = (undefined8 *)param_1[1];
  if ((param_2 < puVar1) && ((undefined8 *)*param_1 <= param_2)) {
    lVar3 = ((longlong)param_2 - (longlong)*param_1) / 0x14;
    if (puVar1 == (undefined8 *)param_1[2]) {
      FUN_1400554a0(param_1,1);
    }
    puVar1 = (undefined8 *)param_1[1];
    uVar2 = *param_1;
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = *(undefined8 *)(uVar2 + lVar3 * 0x14);
      puVar1[1] = *(undefined8 *)(uVar2 + 8 + lVar3 * 0x14);
      *(undefined4 *)(puVar1 + 2) = *(undefined4 *)(uVar2 + 0x10 + lVar3 * 0x14);
      param_1[1] = param_1[1] + 0x14;
      return;
    }
  }
  else {
    if (puVar1 == (undefined8 *)param_1[2]) {
      FUN_1400554a0(param_1,1);
    }
    puVar1 = (undefined8 *)param_1[1];
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = *param_2;
      puVar1[1] = param_2[1];
      *(undefined4 *)(puVar1 + 2) = *(undefined4 *)(param_2 + 2);
    }
  }
  param_1[1] = param_1[1] + 0x14;
  return;
}



void FUN_140051ae0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140056db0(*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,0x000140051c70)

void FUN_140051c20(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_140051cb0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140056e10(*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,0x000140051e16)
// WARNING: Removing unreachable block (ram,0x000140051e20)

void FUN_140051de0(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_140051e60(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_140055720(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_140051f20(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140056e70(*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,0x00014005209a)
// WARNING: Removing unreachable block (ram,0x0001400520a0)

void FUN_140052060(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_1400520f0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140056ee0(*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,0x000140052280)

void FUN_140052230(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_1400522c0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140056f40(*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,0x00014005243a)
// WARNING: Removing unreachable block (ram,0x000140052440)

void FUN_140052400(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_140052490(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140056fb0(*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,0x000140052620)

void FUN_1400525d0(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_140052660(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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_140057010(*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,0x0001400527f1)

void FUN_1400527a0(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_140052830(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_140055a50(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_140055a50(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_140052910(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057070(*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,0x000140052aa0)

void FUN_140052a50(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_140052ae0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057110(*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,0x000140052c5a)
// WARNING: Removing unreachable block (ram,0x000140052c60)

void FUN_140052c20(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_140052ca0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057160(*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,0x000140052e30)

void FUN_140052de0(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_140052e70(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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_1400571c0(*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,0x000140053001)

void FUN_140052fb0(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_140053040(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(-0x6c657a3bf6c657a3) * SEXT816(lVar2),8);
    if (pvVar1 == (void *)param_1[2]) {
      FUN_140055d10(param_1,1);
    }
    if ((void *)param_1[1] != (void *)0x0) {
      memcpy((void *)param_1[1],(void *)(((lVar2 >> 6) - (lVar2 >> 0x3f)) * 0x6f + *param_1),0x6f);
    }
    param_1[1] = param_1[1] + 0x6f;
    return;
  }
  if (pvVar1 == (void *)param_1[2]) {
    FUN_140055d10(param_1,1);
  }
  if ((void *)param_1[1] != (void *)0x0) {
    memcpy((void *)param_1[1],param_2,0x6f);
  }
  param_1[1] = param_1[1] + 0x6f;
  return;
}



void FUN_140053110(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057220(*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,0x0001400532a0)

void FUN_140053250(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_1400532e0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057280(*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,0x000140053470)

void FUN_140053420(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_1400534b0(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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_1400572e0(*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,0x000140053641)

void FUN_1400535f0(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_140053680(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(-0x4de9bd37a6f4de9b) * SEXT816(lVar2),8);
    if (pvVar1 == (void *)param_1[2]) {
      FUN_140055fa0(param_1,1);
    }
    if ((void *)param_1[1] != (void *)0x0) {
      memcpy((void *)param_1[1],(void *)(((lVar2 >> 6) - (lVar2 >> 0x3f)) * 0x5c + *param_1),0x5c);
    }
    param_1[1] = param_1[1] + 0x5c;
    return;
  }
  if (pvVar1 == (void *)param_1[2]) {
    FUN_140055fa0(param_1,1);
  }
  if ((void *)param_1[1] != (void *)0x0) {
    memcpy((void *)param_1[1],param_2,0x5c);
  }
  param_1[1] = param_1[1] + 0x5c;
  return;
}



void FUN_140053750(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057340(*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,0x0001400538e0)

void FUN_140053890(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_140053920(ulonglong *param_1,undefined8 *param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  longlong lVar4;
  
  puVar3 = (undefined8 *)param_1[1];
  if ((param_2 < puVar3) && ((undefined8 *)*param_1 <= param_2)) {
    lVar4 = (longlong)param_2 - (longlong)*param_1;
    lVar4 = lVar4 / 6 + (lVar4 >> 0x3f);
    lVar4 = (lVar4 >> 2) - (lVar4 >> 0x3f);
    if (puVar3 == (undefined8 *)param_1[2]) {
      FUN_140056100(param_1,1);
    }
    puVar3 = (undefined8 *)param_1[1];
    uVar1 = *param_1;
    if (puVar3 == (undefined8 *)0x0) goto LAB_1400539ce;
    *puVar3 = *(undefined8 *)(uVar1 + lVar4 * 0x18);
    puVar3[1] = *(undefined8 *)(uVar1 + 8 + lVar4 * 0x18);
    uVar2 = *(undefined8 *)(uVar1 + 0x10 + lVar4 * 0x18);
  }
  else {
    if (puVar3 == (undefined8 *)param_1[2]) {
      FUN_140056100(param_1,1);
    }
    puVar3 = (undefined8 *)param_1[1];
    if (puVar3 == (undefined8 *)0x0) goto LAB_1400539ce;
    *puVar3 = *param_2;
    puVar3[1] = param_2[1];
    uVar2 = param_2[2];
  }
  puVar3[2] = uVar2;
LAB_1400539ce:
  param_1[1] = param_1[1] + 0x18;
  return;
}



void FUN_1400539e0(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_1405d3608);
    }
    pcVar3 = local_res10;
    FUN_1400573f0(*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,0x000140053b4a)
// WARNING: Removing unreachable block (ram,0x000140053b50)

void FUN_140053b10(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_140053ba0(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_1400561b0(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    uVar1 = *param_1;
    puVar3 = (undefined8 *)param_1[1];
    if (puVar3 != (undefined8 *)0x0) {
      FUN_14034fe70();
      *puVar3 = PTR_DAT_1405d8010;
      FUN_140003100(puVar3,uVar1 + ((longlong)(param_2 - uVar2) >> 3) * 8);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_1400561b0(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    puVar3 = (undefined8 *)param_1[1];
    if (puVar3 != (undefined8 *)0x0) {
      FUN_14034fe70();
      *puVar3 = PTR_DAT_1405d8010;
      FUN_140003100(puVar3,param_2);
    }
  }
  param_1[1] = param_1[1] + 8;
  return;
}



void FUN_140053c80(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057460(*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,0x000140053e10)

void FUN_140053dc0(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_140053e50(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1400574c0(*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_140053f90(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057520(*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,0x000140054120)

void FUN_1400540d0(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_140054160(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057580(*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,0x0001400542f0)

void FUN_1400542a0(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_140054330(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1400575e0(*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,0x0001400544c0)

void FUN_140054470(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_140054500(longlong *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  puVar1 = (undefined4 *)param_1[1];
  if ((param_2 < puVar1) && ((undefined4 *)*param_1 <= param_2)) {
    lVar3 = (longlong)param_2 - *param_1;
    lVar3 = lVar3 / 6 + (lVar3 >> 0x3f);
    lVar3 = (lVar3 >> 1) - (lVar3 >> 0x3f);
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_1400565a0(param_1,1);
    }
    puVar1 = (undefined4 *)param_1[1];
    lVar2 = *param_1;
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *(undefined4 *)(lVar2 + lVar3 * 0xc);
      puVar1[1] = *(undefined4 *)(lVar2 + 4 + lVar3 * 0xc);
      puVar1[2] = *(undefined4 *)(lVar2 + 8 + lVar3 * 0xc);
      param_1[1] = param_1[1] + 0xc;
      return;
    }
  }
  else {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_1400565a0(param_1,1);
    }
    puVar1 = (undefined4 *)param_1[1];
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *param_2;
      puVar1[1] = param_2[1];
      puVar1[2] = param_2[2];
    }
  }
  param_1[1] = param_1[1] + 0xc;
  return;
}



void FUN_1400545d0(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 (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) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x84);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057640(*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 * 0x84);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x84) * 0x84);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



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

void FUN_140054710(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_1400547a0(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 (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) {
    lVar4 = FUN_1400567b0(param_2);
    FUN_1400576a0(*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 * 0x41 + lVar4;
    param_1[1] = ((lVar2 - (longlong)pvVar1) / 0x41) * 0x41 + lVar4;
    *param_1 = lVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400548ca)
// WARNING: Removing unreachable block (ram,0x0001400548d0)

void FUN_140054890(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_140054930(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_140056700(param_1,1);
    }
    param_2 = (undefined8 *)((((longlong)param_2 - (longlong)puVar2) / 0x41) * 0x41 + *param_1);
  }
  else if (puVar1 == (undefined8 *)param_1[2]) {
    FUN_140056700(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_140054a00(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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_140057720(*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_140054b40(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_140056820(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_140056820(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_140054c50(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057780(*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,0x000140054db8)
// WARNING: Removing unreachable block (ram,0x000140054dd0)

void FUN_140054d80(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_140054e10(longlong *param_1,undefined1 *param_2)

{
  undefined1 *puVar1;
  undefined1 *puVar2;
  
  puVar1 = (undefined1 *)param_1[1];
  if ((param_2 < puVar1) && (puVar2 = (undefined1 *)*param_1, puVar2 <= param_2)) {
    if (puVar1 == (undefined1 *)param_1[2]) {
      FUN_1400568d0(param_1,1);
    }
    puVar1 = (undefined1 *)param_1[1];
    puVar2 = (undefined1 *)((((longlong)param_2 - (longlong)puVar2) / 9) * 9 + *param_1);
    if (puVar1 != (undefined1 *)0x0) {
      *puVar1 = *puVar2;
      *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar2 + 1);
      *(undefined4 *)(puVar1 + 5) = *(undefined4 *)(puVar2 + 5);
      param_1[1] = param_1[1] + 9;
      return;
    }
  }
  else {
    if (puVar1 == (undefined1 *)param_1[2]) {
      FUN_1400568d0(param_1,1);
    }
    puVar1 = (undefined1 *)param_1[1];
    if (puVar1 != (undefined1 *)0x0) {
      *puVar1 = *param_2;
      *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(param_2 + 1);
      *(undefined4 *)(puVar1 + 5) = *(undefined4 *)(param_2 + 5);
    }
  }
  param_1[1] = param_1[1] + 9;
  return;
}



void FUN_140054ed0(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 (0xe38e38e38e38e38 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x12) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x12);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1400577c0(*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 * 0x12);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x12) * 0x12);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_140055000(ulonglong *param_1,undefined8 *param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  undefined2 uVar3;
  undefined8 *puVar4;
  
  puVar4 = (undefined8 *)param_1[1];
  if ((param_2 < puVar4) && ((undefined8 *)*param_1 <= param_2)) {
    lVar2 = ((longlong)param_2 - (longlong)*param_1) / 0x12;
    if (puVar4 == (undefined8 *)param_1[2]) {
      FUN_140056970(param_1,1);
    }
    puVar4 = (undefined8 *)param_1[1];
    uVar1 = *param_1;
    if (puVar4 == (undefined8 *)0x0) goto LAB_1400550a8;
    *puVar4 = *(undefined8 *)(uVar1 + lVar2 * 0x12);
    puVar4[1] = *(undefined8 *)(uVar1 + 8 + lVar2 * 0x12);
    uVar3 = *(undefined2 *)(uVar1 + 0x10 + lVar2 * 0x12);
  }
  else {
    if (puVar4 == (undefined8 *)param_1[2]) {
      FUN_140056970(param_1,1);
    }
    puVar4 = (undefined8 *)param_1[1];
    if (puVar4 == (undefined8 *)0x0) goto LAB_1400550a8;
    *puVar4 = *param_2;
    puVar4[1] = param_2[1];
    uVar3 = *(undefined2 *)(param_2 + 2);
  }
  *(undefined2 *)(puVar4 + 2) = uVar3;
LAB_1400550a8:
  param_1[1] = param_1[1] + 0x12;
  return;
}



void FUN_1400550c0(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 (0x3c3c3c3c3c3c3c3 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x44) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x44);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140057810(*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 * 0x44);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x44) * 0x44);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014005523a)
// WARNING: Removing unreachable block (ram,0x000140055240)

void FUN_140055200(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x44 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400552a0(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_140056a10(param_1,1);
    }
    param_2 = (undefined8 *)((((longlong)param_2 - (longlong)puVar2) / 0x44) * 0x44 + *param_1);
  }
  else if (puVar1 == (undefined8 *)param_1[2]) {
    FUN_140056a10(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];
    *(undefined4 *)(puVar1 + 8) = *(undefined4 *)(param_2 + 8);
  }
  param_1[1] = param_1[1] + 0x44;
  return;
}



void FUN_140055370(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 4;
  if (0xfffffffffffffffU - 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 >> 4;
  if (uVar2 < uVar3) {
    if (0xfffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_1402d2250(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402d2250(param_1,uVar2);
  }
  return;
}



void FUN_1400553f0(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_140051790(param_1,uVar3);
  }
  return;
}



void FUN_1400554a0(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_1400518d0(param_1,uVar2);
  }
  return;
}



void FUN_140055550(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_140051ae0(param_1,uVar2);
  }
  return;
}



void FUN_140055600(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_140051cb0(param_1,uVar2);
  }
  return;
}



void FUN_1400556a0(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_140051e60(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140051e60(param_1,uVar2);
  }
  return;
}



void * FUN_140055720(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_1405d3608);
}



void FUN_140055790(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_140051f20(param_1,uVar2);
  }
  return;
}



void FUN_140055840(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_1400520f0(param_1,uVar2);
  }
  return;
}



void FUN_1400558f0(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_1400522c0(param_1,uVar2);
  }
  return;
}



void FUN_1400559a0(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_140052490(param_1,uVar2);
  }
  return;
}



void FUN_140055a50(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_140052660(param_1,uVar3);
  }
  return;
}



void FUN_140055b00(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_140052910(param_1,uVar2);
  }
  return;
}



void FUN_140055bb0(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_140052ae0(param_1,uVar2);
  }
  return;
}



void FUN_140055c60(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_140052ca0(param_1,uVar2);
  }
  return;
}



void FUN_140055d10(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_140052e70(param_1,uVar3);
  }
  return;
}



void FUN_140055dc0(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_1402c10c0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402c10c0(param_1,uVar2);
  }
  return;
}



void FUN_140055e40(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_140053110(param_1,uVar2);
  }
  return;
}



void FUN_140055ef0(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_1400532e0(param_1,uVar2);
  }
  return;
}



void FUN_140055fa0(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_1400534b0(param_1,uVar3);
  }
  return;
}



void FUN_140056050(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_140053750(param_1,uVar2);
  }
  return;
}



void FUN_140056100(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_1401df3a0(param_1,uVar3);
  }
  return;
}



void FUN_1400561b0(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_1400539e0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400539e0(param_1,uVar2);
  }
  return;
}



void FUN_140056230(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_140053c80(param_1,uVar2);
  }
  return;
}



void FUN_1400562e0(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_140053e50(param_1,uVar2);
  }
  return;
}



void FUN_140056390(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_140053f90(param_1,uVar2);
  }
  return;
}



void FUN_140056440(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_140054160(param_1,uVar2);
  }
  return;
}



void FUN_1400564f0(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_140054330(param_1,uVar2);
  }
  return;
}



void FUN_1400565a0(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_140275900(param_1,uVar3);
  }
  return;
}



void FUN_140056650(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_1400545d0(param_1,uVar2);
  }
  return;
}



void FUN_140056700(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_1400547a0(param_1,uVar2);
  }
  return;
}



void * FUN_1400567b0(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x3f03f03f03f03f1) &&
     (pvVar1 = operator_new(param_1 * 0x41), 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_1405d3608);
}



void FUN_140056820(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_140054a00(param_1,uVar3);
  }
  return;
}



void FUN_1400568d0(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_140054c50(param_1,uVar2);
  }
  return;
}



void FUN_140056970(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x12;
  if (0xe38e38e38e38e38U - 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) / 0x12;
  if (uVar2 < uVar3) {
    if (0xe38e38e38e38e38 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140054ed0(param_1,uVar2);
  }
  return;
}



void FUN_140056a10(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x44;
  if (0x3c3c3c3c3c3c3c3U - 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) / 0x44;
  if (uVar2 < uVar3) {
    if (0x3c3c3c3c3c3c3c3 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400550c0(param_1,uVar2);
  }
  return;
}



ulonglong FUN_140056ac0(longlong *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  
  uVar1 = param_1[2] - *param_1 >> 2;
  if (0x3fffffffffffffff - (uVar1 >> 1) < uVar1) {
    uVar1 = 0;
    if (param_2 != 0) {
      uVar1 = param_2;
    }
    return uVar1;
  }
  uVar1 = uVar1 + (uVar1 >> 1);
  if (uVar1 < param_2) {
    uVar1 = param_2;
  }
  return uVar1;
}



undefined8 * FUN_140056b00(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_140056b80(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_140056d60(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_140056db0(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_140056e10(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_140056e70(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_140056ee0(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_140056f40(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_140056fb0(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_140057010(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_140057070(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_1400570d0(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_140057110(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_140057160(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_1400571c0(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;
}



void * FUN_140057220(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_140057280(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_1400572e0(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_140057340(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_1400573a0(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_1400573f0(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_14034fe70();
      *param_3 = PTR_DAT_1405d8010;
      FUN_140003100(param_3,param_1);
    }
    param_3 = param_3 + 1;
  }
  return param_3;
}



void * FUN_140057460(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_1400574c0(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_140057520(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_140057580(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_1400575e0(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;
}



void * FUN_140057640(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_1400576a0(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_140057720(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_140057780(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_1400577c0(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x12)) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
      *(undefined2 *)(param_3 + 2) = *(undefined2 *)(param_1 + 2);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x12);
  }
  return param_3;
}



undefined8 * FUN_140057810(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x44)) {
    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];
      *(undefined4 *)(param_3 + 8) = *(undefined4 *)(param_1 + 8);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x44);
  }
  return param_3;
}



void FUN_140057890(longlong *param_1,int param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  undefined *puVar4;
  
  puVar4 = PTR_DAT_1405d8008;
  puVar1 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8008;
  }
  *param_1 = (longlong)puVar1;
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (param_2 == 0) {
    FUN_14000d2c0(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_14034fef0();
    if (piVar2 != (int *)0x0) {
      *piVar2 = 0;
      piVar2[1] = 1;
    }
    puVar1 = PTR_DAT_1405d8008;
    *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_14034fdc0(piVar2 + 2,puVar4,param_2);
    FUN_14000d2c0(param_1);
    *param_1 = (longlong)(piVar2 + 2);
  }
  return;
}



void FUN_140057970(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_1405d8008;
  }
  else if ((puVar6 != PTR_DAT_1405d8008) && ((int *)(puVar6 + -8) != (int *)0x0)) {
    if (*(int *)(puVar6 + -4) < 2) {
      return;
    }
    if (*(int *)(puVar6 + -8) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    puVar3 = (undefined4 *)FUN_14034fef0();
    uVar4 = 0;
    if (puVar3 != (undefined4 *)0x0) {
      *puVar3 = 0;
      puVar3[1] = 1;
    }
    puVar1 = PTR_DAT_1405d8008;
    puVar6 = (undefined *)*param_1;
    if (puVar6 == (undefined *)0x0) {
      uVar5 = 0;
    }
    else {
      uVar5 = uVar4;
      if (puVar6 != PTR_DAT_1405d8008) {
        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_14034fdc0(puVar3 + 2,puVar6,uVar4);
    FUN_14000d2c0(param_1);
    *param_1 = (longlong)(puVar3 + 2);
    return;
  }
  puVar2 = (undefined8 *)FUN_14034fef0();
  *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_140057a60(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_1405d8008)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (((param_2 <= iVar3) && (param_2 = 0, puVar2 != (undefined *)0x0)) &&
     (puVar2 != PTR_DAT_1405d8008)) {
    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_1405d8008)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 < iVar3) {
    FUN_140057890(param_1,iVar3);
  }
  FUN_140057970(param_1);
  puVar2 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1405d8008;
  }
  return puVar2;
}



void FUN_140057ae0(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_1405d8008) {
    iVar3 = 0;
  }
  else {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (iVar3 <= iVar4) {
    if (puVar2 == (undefined *)0x0) {
      iVar4 = 0;
    }
    else if (puVar2 == PTR_DAT_1405d8008) {
      iVar4 = 0;
    }
    else {
      iVar4 = *(int *)(puVar2 + -8);
    }
  }
  if (((puVar2 != PTR_DAT_1405d8008) && (puVar2 != (undefined *)0x0)) &&
     (piVar1 = (int *)(puVar2 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar4;
    *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
  }
  return;
}



void FUN_140057b50(longlong *param_1)

{
  undefined4 uVar1;
  undefined *puVar2;
  
  puVar2 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1405d8008;
  }
  uVar1 = FUN_14034fd90(puVar2);
  FUN_140057ae0(param_1,uVar1);
  return;
}



longlong * FUN_140057b80(longlong *param_1,undefined8 param_2,int param_3)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined *puVar5;
  
  FUN_14034fe70();
  *param_1 = (longlong)PTR_DAT_1405d8008;
  iVar2 = FUN_14034fd90(param_2);
  iVar1 = iVar2;
  if ((0 < param_3) && (iVar1 = param_3, iVar2 < param_3)) {
    iVar1 = iVar2;
  }
  uVar4 = FUN_140057a60(param_1,iVar1);
  FUN_14034fdc0(uVar4,param_2,iVar1);
  puVar5 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar5 = PTR_DAT_1405d8008;
  }
  uVar3 = FUN_14034fd90(puVar5);
  FUN_140057ae0(param_1,uVar3);
  return param_1;
}



undefined8 * FUN_140057c10(undefined8 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  *(undefined8 *)((longlong)param_1 + 0xac) = 0;
  *(undefined8 *)((longlong)param_1 + 0xdc) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xec) = 0;
  *(undefined8 *)((longlong)param_1 + 0xb4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xf4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xfc) = 0;
  *(undefined8 *)((longlong)param_1 + 0x104) = 0;
  *(undefined8 *)((longlong)param_1 + 0x10c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x114) = 0;
  *(undefined8 *)((longlong)param_1 + 0x11c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x124) = 0;
  *(undefined8 *)((longlong)param_1 + 300) = 0;
  *(undefined8 *)((longlong)param_1 + 0x174) = 0;
  *(undefined1 *)((longlong)param_1 + 0x17c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x17d) = 0;
  memset(param_1 + 5,0,100);
  *(undefined8 *)((longlong)param_1 + 0x8c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x94) = 0;
  *(undefined8 *)((longlong)param_1 + 0x9c) = 0;
  *(undefined8 *)((longlong)param_1 + 0xa4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xbc) = 0;
  *(undefined8 *)((longlong)param_1 + 0xc4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xcc) = 0;
  *(undefined8 *)((longlong)param_1 + 0xd4) = 0;
  memset(param_1 + 0x1e,0,0x44);
  *(undefined8 *)((longlong)param_1 + 0x134) = 0;
  *(undefined8 *)((longlong)param_1 + 0x13c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x144) = 0;
  *(undefined8 *)((longlong)param_1 + 0x14c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x154) = 0;
  *(undefined8 *)((longlong)param_1 + 0x15c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x164) = 0;
  *(undefined8 *)((longlong)param_1 + 0x16c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x174) = 0;
  return param_1;
}



undefined8 * FUN_140057d80(undefined8 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined2 *)((longlong)param_1 + 0x8c) = 0;
  *(undefined8 *)((longlong)param_1 + 0xae) = 0;
  *(undefined8 *)((longlong)param_1 + 0xb6) = 0;
  *(undefined4 *)((longlong)param_1 + 0xbe) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe2) = 0;
  param_1[4] = 0;
  memset(param_1 + 5,0,100);
  *(undefined8 *)((longlong)param_1 + 0x8e) = 0;
  *(undefined8 *)((longlong)param_1 + 0x96) = 0;
  *(undefined8 *)((longlong)param_1 + 0x9e) = 0;
  *(undefined8 *)((longlong)param_1 + 0xa6) = 0;
  *(undefined8 *)((longlong)param_1 + 0xc2) = 0;
  *(undefined8 *)((longlong)param_1 + 0xca) = 0;
  *(undefined8 *)((longlong)param_1 + 0xd2) = 0;
  *(undefined8 *)((longlong)param_1 + 0xda) = 0;
  return param_1;
}



undefined8 FUN_140057e30(undefined8 param_1,undefined4 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_140057e70(undefined8 param_1,undefined4 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  return param_1;
}



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

undefined4 * FUN_140057eb0(undefined4 *param_1)

{
  errno_t eVar1;
  int iVar2;
  undefined1 auStack_98 [32];
  undefined8 local_78;
  undefined4 local_70;
  __time64_t local_68;
  short local_60;
  short local_5e;
  undefined2 local_5c;
  undefined2 local_5a;
  undefined2 local_58;
  undefined2 local_56;
  undefined2 local_54;
  undefined2 local_52;
  undefined8 local_50;
  undefined8 local_48;
  tm local_40;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  *param_1 = 0;
  *(undefined8 *)(param_1 + 1) = 0;
  *(undefined8 *)(param_1 + 3) = 0;
  *(undefined8 *)(param_1 + 5) = 0;
  *(undefined8 *)(param_1 + 7) = 0;
  local_68 = _time64((__time64_t *)0x0);
  local_78 = 0;
  local_70 = 0;
  eVar1 = _localtime64_s(&local_40,&local_68);
  if (eVar1 == 0) {
    local_60 = (short)local_40.tm_year + 0x76c;
    local_52 = 0;
    local_5e = (short)local_40.tm_mon + 1;
    local_5c = (undefined2)local_40.tm_wday;
    local_5a = (undefined2)local_40.tm_mday;
    local_58 = (undefined2)local_40.tm_hour;
    local_56 = (undefined2)local_40.tm_min;
    local_54 = (undefined2)local_40.tm_sec;
    iVar2 = Ordinal_184();
    local_50 = 0;
    local_48 = 0;
    if (iVar2 != 0) {
      Ordinal_185(local_78);
    }
  }
  *(undefined8 *)(param_1 + 0xb) = 0;
  *(undefined8 *)(param_1 + 9) = local_78;
  *(undefined8 *)(param_1 + 0xd) = 0;
  *(undefined8 *)(param_1 + 0xf) = 0;
  *(undefined8 *)(param_1 + 0x11) = 0;
  *(undefined8 *)(param_1 + 0x13) = 0;
  memset(param_1 + 0x15,0,100);
  return param_1;
}



undefined1 FUN_140058000(undefined8 param_1,undefined8 *param_2)

{
  char cVar1;
  undefined8 local_res18 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res18,8);
  if (cVar1 == '\0') {
    return 0;
  }
  *param_2 = local_res18[0];
  return 1;
}



undefined4 * FUN_140058040(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_1400580a0(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;
}



undefined8 FUN_140058130(undefined8 param_1,undefined8 *param_2)

{
  char cVar1;
  undefined8 local_res8;
  
  cVar1 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    *param_2 = local_res8;
  }
  return param_1;
}



undefined8 FUN_140058170(undefined8 param_1,undefined2 *param_2)

{
  char cVar1;
  undefined2 local_res8 [4];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_1400581b0(undefined8 param_1,undefined2 *param_2)

{
  undefined8 uVar1;
  undefined2 local_res18 [8];
  
  uVar1 = FUN_1403840e0(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_1400581f0(undefined8 param_1,undefined1 *param_2)

{
  undefined8 uVar1;
  undefined1 local_res18 [16];
  
  uVar1 = FUN_1403840e0(param_1,local_res18,1);
  if ((char)uVar1 == '\0') {
    return uVar1;
  }
  *param_2 = local_res18[0];
  return 1;
}



undefined4 * FUN_140058230(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_1400582e0(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;
}



undefined8 FUN_140058430(undefined8 param_1,undefined1 *param_2)

{
  char cVar1;
  undefined1 local_res8 [8];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  return param_1;
}



void FUN_140058470(longlong param_1,undefined4 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined4 local_res10 [2];
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  local_res10[0] = param_2;
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_1400179d0(lVar2,iVar1 + 4);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_14000d3f0(lVar4 + iVar1,local_res10,4);
    goto LAB_140058547;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 4;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_14000d3f0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),local_res10,4);
LAB_140058547:
  FUN_140017b00(param_1);
  return;
}



void FUN_140058570(longlong param_1,undefined4 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined4 local_res10 [2];
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  local_res10[0] = param_2;
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_1400179d0(lVar2,iVar1 + 4);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_14000d3f0(lVar4 + iVar1,local_res10,4);
    goto LAB_140058649;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 4;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_14000d3f0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),local_res10,4);
LAB_140058649:
  FUN_140017b00(param_1);
  return;
}



void FUN_140058670(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined8 local_res10;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  local_res10 = param_2;
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_1400179d0(lVar2,iVar1 + 8);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_14000d3f0(lVar4 + iVar1,&local_res10,8);
    goto LAB_140058749;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 8;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_14000d3f0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),&local_res10,8);
LAB_140058749:
  FUN_140017b00(param_1);
  return;
}



void FUN_140058770(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined8 local_res10;
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  local_res10 = param_2;
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_1400179d0(lVar2,iVar1 + 8);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_14000d3f0(lVar4 + iVar1,&local_res10,8);
    goto LAB_140058848;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 8;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_14000d3f0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),&local_res10,8);
LAB_140058848:
  FUN_140017b00(param_1);
  return;
}



void FUN_140058870(longlong param_1,undefined1 param_2)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  undefined1 local_res10 [8];
  undefined1 local_58 [80];
  
  lVar4 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  lVar2 = *(longlong *)(param_1 + 8);
  local_res10[0] = param_2;
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_1400179d0(lVar2,iVar1 + 1);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_14000d3f0(lVar4 + iVar1,local_res10,1);
    goto LAB_140058947;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 1;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_14000d3f0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),local_res10,1);
LAB_140058947:
  FUN_140017b00(param_1);
  return;
}



undefined8 FUN_140058970(void)

{
  return 12000;
}



undefined8 FUN_140058980(void)

{
  return 0x2fc3;
}



undefined1
FUN_140058990(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee1);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DB_ERROR",0x2ee1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140058a70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee1);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DB_ERROR",0x2ee1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140058b50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined2 *param_6,undefined2 *param_7,undefined2 *param_8,
             undefined8 *param_9,undefined4 *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,undefined1 *param_20,
             undefined4 *param_21,undefined8 param_22,undefined8 param_23,undefined8 param_24)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee2);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058770(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058770(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058470(local_30,param_17[1]);
  FUN_140058470(local_30,param_17[2]);
  FUN_140058470(local_30,param_17[3]);
  FUN_140058470(local_30,param_17[4]);
  FUN_140058470(local_30,param_17[5]);
  FUN_140058470(local_30,*param_18);
  FUN_140058470(local_30,*param_19);
  FUN_140058870(local_30,*param_20);
  FUN_140058470(local_30,*param_21);
  FUN_1403a17c0(local_30,param_22);
  FUN_1403859e0(local_30,param_23);
  FUN_1403859e0(local_30,param_24);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_CHARACTER_INFO",0x2ee2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140058db0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *param_7,undefined2 *param_8,
             undefined2 *param_9,undefined8 *param_10,undefined4 *param_11,undefined8 *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,
             undefined1 *param_21,undefined4 *param_22,undefined8 param_23,undefined8 param_24,
             undefined8 param_25)

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2ee2);
  FUN_140058470(local_40,*param_5);
  FUN_1403859e0(local_40,param_6);
  FUN_140017c50(local_40,*param_7);
  FUN_140017c50(local_40,*param_8);
  FUN_140017c50(local_40,*param_9);
  FUN_140058770(local_40,*param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058770(local_40,*param_12);
  FUN_140058470(local_40,*param_13);
  FUN_140058470(local_40,*param_14);
  FUN_140058470(local_40,*param_15);
  FUN_140058470(local_40,*param_16);
  FUN_140058470(local_40,*param_17);
  FUN_140058470(local_40,*param_18);
  FUN_140058470(local_40,param_18[1]);
  FUN_140058470(local_40,param_18[2]);
  FUN_140058470(local_40,param_18[3]);
  FUN_140058470(local_40,param_18[4]);
  FUN_140058470(local_40,param_18[5]);
  FUN_140058470(local_40,*param_19);
  FUN_140058470(local_40,*param_20);
  FUN_140058870(local_40,*param_21);
  FUN_140058470(local_40,*param_22);
  FUN_1403a17c0(local_40,param_23);
  FUN_1403859e0(local_40,param_24);
  FUN_1403859e0(local_40,param_25);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PU_CHARACTER_INFO",0x2ee2);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059020(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee3);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UPDATE_FATIGUE",0x2ee3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059110(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee3);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UPDATE_FATIGUE",0x2ee3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059210(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             longlong *param_5)

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee4);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 4);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_30,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVENTORY",0x2ee4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059330(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,longlong *param_6)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2ee4);
  FUN_140017c50(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 4);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_INVENTORY",0x2ee4);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059460(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee5);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_COMMON_RESULT",0x2ee5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059550(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee5);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_COMMON_RESULT",0x2ee5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140059650(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined2 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2ee6);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 1);
  puVar2 = (undefined2 *)*param_4;
  if (puVar2 != (undefined2 *)param_4[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_RESP_BATTLE_INFO",0x2ee6);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2ee6);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 1);
  puVar2 = (undefined2 *)*param_5;
  if (puVar2 != (undefined2 *)param_5[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RESP_BATTLE_INFO",0x2ee6);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059880(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee7);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058770(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATUS_LEVEL_UP",0x2ee7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400599c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee7);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATUS_LEVEL_UP",0x2ee7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059b10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 *param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee8);
  FUN_140058470(local_30,*param_4);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATUS_EXP",0x2ee8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee8);
  FUN_140058470(local_30,*param_5);
  FUN_140058770(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATUS_EXP",0x2ee8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059d70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee9);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_DESTROY_RESULT",0x2ee9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ee9);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_1403a17c0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_DESTROY_RESULT",0x2ee9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140059fa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eea);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_14011a5b0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVENTORY_SET",0x2eea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a0a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eea);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_14011a5b0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INVENTORY_SET",0x2eea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14005a1b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eeb);
  FUN_14011a5b0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RANDOM_RUNE_SET",0x2eeb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eeb);
  FUN_14011a5b0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RANDOM_RUNE_SET",0x2eeb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eec);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_14011a5b0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVENTORY_UPDATE",0x2eec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eec);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_14011a5b0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INVENTORY_UPDATE",0x2eec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a580(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eed);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVENTORY_DURABILITY_UPDATE",0x2eed
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a690(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eed);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INVENTORY_DURABILITY_UPDATE",
                     0x2eed);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a7b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eee);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVENTORY_GOLD_UPDATE",0x2eee);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a890(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eee);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INVENTORY_GOLD_UPDATE",0x2eee);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005a970(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined8 param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eef);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MOVE_STORAGE",0x2eef);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eef);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MOVE_STORAGE",0x2eef);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005abe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef0);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STORAGE_INFO",0x2ef0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005ace0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef0);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STORAGE_INFO",0x2ef0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005adf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef1);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STORAGE_UPGRADE",0x2ef1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005aee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef1);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STORAGE_UPGRADE",0x2ef1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005afe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef2);
  FUN_140017c50(local_30,*param_4);
  FUN_14011a5b0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STORAGE_UPDATE",0x2ef2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005b0e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef2);
  FUN_140017c50(local_30,*param_5);
  FUN_14011a5b0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STORAGE_UPDATE",0x2ef2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005b1f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined2 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef3);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058870(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUEST_SET",0x2ef3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef3);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058870(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUEST_SET",0x2ef3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005b530(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6,undefined4 *param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef4);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUEST_UPDATE",0x2ef4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005b6a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined2 *param_7,undefined4 *param_8,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUEST_UPDATE",0x2ef4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005b810(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef5);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUEST_ACCEPT_RESULT",0x2ef5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005b910(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef5);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUEST_ACCEPT_RESULT",0x2ef5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005ba20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef6);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CONTACT_NPC_RESULT",0x2ef6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005bb20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef6);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CONTACT_NPC_RESULT",0x2ef6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005bc30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef7);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUEST_GIVEUP_RESULT",0x2ef7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005bd20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef7);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUEST_GIVEUP_RESULT",0x2ef7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005be10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef8);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PART_CHANGE_NOTIFY",0x2ef8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005bf10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef8);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PART_CHANGE_NOTIFY",0x2ef8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005c020(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 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef9);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_WEAPON_CHANGE_NOTIFY",0x2ef9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005c150(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 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2ef9);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_WEAPON_CHANGE_NOTIFY",0x2ef9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005c280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efa);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PORTAL_WARP_RESULT",0x2efa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005c3a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efa);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PORTAL_WARP_RESULT",0x2efa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005c4d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined2 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efb);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_EQUIP_RESULT",0x2efb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efb);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_EQUIP_RESULT",0x2efb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005c730(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efc);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_UNEQUIP_RESULT",0x2efc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efc);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_UNEQUIP_RESULT",0x2efc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005c960(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efd);
  FUN_1403a17c0(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UPDATE_ITEM_BINDS",0x2efd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efd);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UPDATE_ITEM_BINDS",0x2efd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005cb70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efe);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ATTACK_STATUS",0x2efe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005cd10(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,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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2efe);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ATTACK_STATUS",0x2efe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005cec0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eff);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ATTACK_STATUS_PLAYER",0x2eff);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005d060(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,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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2eff);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ATTACK_STATUS_PLAYER",0x2eff);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005d210(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f00);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEFENSE_STATUS",0x2f00);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005d360(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,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f00);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEFENSE_STATUS",0x2f00);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005d4b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f01);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_POINT_VALUE",0x2f01);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f01);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_POINT_VALUE",0x2f01);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005d720(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f02);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PERCENT_VALUE",0x2f02);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f02);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PERCENT_VALUE",0x2f02);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005d990(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f03);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OPTION_VALUE",0x2f03);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f03);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_OPTION_VALUE",0x2f03);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005dc00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f04);
  FUN_140058470(local_30,*param_4);
  FUN_14008d250(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_FLAG_VALUE",0x2f04);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005dcf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f04);
  FUN_140058470(local_30,*param_5);
  FUN_14008d250(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_FLAG_VALUE",0x2f04);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005dde0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f05);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EXTRA_POINT_VALUE",0x2f05);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f05);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_EXTRA_POINT_VALUE",0x2f05);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005e050(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f06);
  FUN_1403a17c0(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_USE",0x2f06);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f06);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_USE",0x2f06);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005e290(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f07);
  FUN_1403a17c0(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_USE_RESULT",0x2f07);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f07);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_USE_RESULT",0x2f07);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005e4d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f08);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_USE_EFFECT",0x2f08);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005e5c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f08);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_USE_EFFECT",0x2f08);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14005e6c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f09);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_EFFECT_REFRESH",0x2f09);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14005e780(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f09);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_EFFECT_REFRESH",0x2f09);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005e850(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,param_10[1]);
  FUN_140058570(local_30,param_10[2]);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,param_11[1]);
  FUN_140058570(local_30,param_11[2]);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_EFFECT",0x2f0a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005ea00(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,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15)

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f0a);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,*param_8);
  FUN_140058470(local_40,*param_9);
  FUN_140058470(local_40,*param_10);
  FUN_140058570(local_40,*param_11);
  FUN_140058570(local_40,param_11[1]);
  FUN_140058570(local_40,param_11[2]);
  FUN_140058570(local_40,*param_12);
  FUN_140058570(local_40,param_12[1]);
  FUN_140058570(local_40,param_12[2]);
  FUN_140058470(local_40,*param_13);
  FUN_140058470(local_40,*param_14);
  FUN_140058470(local_40,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_ADD_EFFECT",0x2f0a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005ebc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0b);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_EFFECT_END",0x2f0b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005ecc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0b);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_EFFECT_END",0x2f0b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005edd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0c);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUICK_SLOT_UPDATE",0x2f0c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005ef10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined8 param_6,undefined4 *param_7,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0c);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUICK_SLOT_UPDATE",0x2f0c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005f060(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0d);
  FUN_1403a17c0(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_USE_QUICKSLOT",0x2f0d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0d);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_USE_QUICKSLOT",0x2f0d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005f270(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0e);
  FUN_1403a17c0(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUICK_SLOT_ITEM_USE_RESULT",0x2f0e)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0e);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUICK_SLOT_ITEM_USE_RESULT",
                     0x2f0e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005f4b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0f);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUICK_SLOT_ITEM_DESTROY_RESULT",
                     0x2f0f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005f5c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f0f);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUICK_SLOT_ITEM_DESTROY_RESULT",
                     0x2f0f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005f6e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f10);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSERT_SKILL_U",0x2f10);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005f810(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f10);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSERT_SKILL_U",0x2f10);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005f940(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f11);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EQUIP_SKILL_U",0x2f11);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005fa40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f11);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EQUIP_SKILL_U",0x2f11);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f12);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_30,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_EQUIP_INFO",0x2f12);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14005fcf0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,longlong *param_6,longlong *param_7,longlong *param_8)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f12);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PLAYER_EQUIP_INFO",0x2f12);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14005fea0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LEARN_SKILL_RESULT",0x2f13);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14005ff60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LEARN_SKILL_RESULT",0x2f13);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060030(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f14);
  FUN_140017c50(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUICK_SLOT_SKILL_UPDATE",0x2f14);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f14);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUICK_SLOT_SKILL_UPDATE",0x2f14);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f15);
  FUN_140017c50(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUICK_SLOT_EMPTY_UPDATE",0x2f15);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f15);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUICK_SLOT_EMPTY_UPDATE",0x2f15);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060480(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f16);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUEST_REWARD_COMPLETE",0x2f16);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060570(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f16);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUEST_REWARD_COMPLETE",0x2f16);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060670(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f17);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UPDATE_HEARTS",0x2f17);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060750(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f17);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UPDATE_HEARTS",0x2f17);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060830(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f18);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SWAP_INVENTORY",0x2f18);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060960(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f18);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SWAP_INVENTORY",0x2f18);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060a90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f19);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SWAP_STORAGE",0x2f19);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060bc0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f19);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SWAP_STORAGE",0x2f19);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060cf0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1a);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SWAP_QUICKSLOT",0x2f1a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1a);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SWAP_QUICKSLOT",0x2f1a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140060f60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1b);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_WEIGHT_PENALTY",0x2f1b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140061040(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1b);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_WEIGHT_PENALTY",0x2f1b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140061120(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1c);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))(param_1,local_res10,1,param_3,local_30,L"PT_NOTICE",0x2f1c)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140061200(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1c);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NOTICE",0x2f1c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400612e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1d);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NOTICE_STRING",0x2f1d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400613c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1d);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NOTICE_STRING",0x2f1d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400614a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1e);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_1403859e0(local_30,param_10);
  FUN_1401182c0(local_30,param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHATTING",0x2f1e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140061600(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1e);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140017c50(local_30,*param_10);
  FUN_1403859e0(local_30,param_11);
  FUN_1401182c0(local_30,param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHATTING",0x2f1e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140061770(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1f);
  FUN_1403859e0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_WHISPER_CHATTING",0x2f1f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400618a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f1f);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1403859e0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_WHISPER_CHATTING",0x2f1f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400619d0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f20);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_CONTROL_KEY_SAVE",0x2f20);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f20);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_CONTROL_KEY_SAVE",0x2f20);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140061c00(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f21);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_CONTROL_KEY_READ",0x2f21);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f21);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_CONTROL_KEY_READ",0x2f21);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140061e30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f22);
  FUN_140385940(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_BOX_STATE_M",0x2f22);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140061f50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f22);
  FUN_140385940(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_BOX_STATE_M",0x2f22);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062070(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f23);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_BOX_STATE_ENEMY_RESPAWN_M",
                     0x2f23);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062190(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f23);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_BOX_STATE_ENEMY_RESPAWN_M",
                     0x2f23);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400622b0(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 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f24);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_BOX_STATE_ENEMY_RESPAWN_ADD",
                     0x2f24);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062420(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 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f24);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,param_9[1]);
  FUN_140058570(local_30,param_9[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_BOX_STATE_ENEMY_RESPAWN_ADD"
                     ,0x2f24);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400625a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f25);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SELECT_STAGE_ICON",0x2f25);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062680(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f25);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SELECT_STAGE_ICON",0x2f25);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140062760(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f26);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SELECT_STAGE_ICON_DISABLE",0x2f26);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f26);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SELECT_STAGE_ICON_DISABLE",0x2f26
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140062920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f27);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ROLLOVER_STAGE_ICON",0x2f27);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062a00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f27);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ROLLOVER_STAGE_ICON",0x2f27);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140062ae0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f28);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ROLLOUT_STAGE_ICON",0x2f28);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062bc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f28);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ROLLOUT_STAGE_ICON",0x2f28);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062ca0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f29);
  FUN_140017c50(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MAP_SELECT_SET_LEVEL",0x2f29);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140062d80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f29);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MAP_SELECT_SET_LEVEL",0x2f29);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140062e60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SELECTED_MAP_CLOSE",0x2f2a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140062f20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SELECTED_MAP_CLOSE",0x2f2a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2b);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_30,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OPEN_MAP_SELECT",0x2f2b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140063190(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,longlong *param_6,longlong *param_7,longlong *param_8)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f2b);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_OPEN_MAP_SELECT",0x2f2b);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2c);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_30,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RETRY_OPEN_MAP_SELECT",0x2f2c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400634e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,longlong *param_6,longlong *param_7,longlong *param_8)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f2c);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RETRY_OPEN_MAP_SELECT",0x2f2c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140063690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CLOSE_MAP_SELECT",0x2f2d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140063750(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CLOSE_MAP_SELECT",0x2f2d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140063820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RETRY_CLOSE_MAP_SELECT",0x2f2e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400638e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RETRY_CLOSE_MAP_SELECT",0x2f2e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400639b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2f);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_STAGE_ICON_SHOW",0x2f2f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140063a90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f2f);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_STAGE_ICON_SHOW",0x2f2f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140063b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f30);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_STAGE_ICON_ENABLE",0x2f30);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140063c50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f30);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_STAGE_ICON_ENABLE",0x2f30);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140063d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f31);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_STAGE_MAX_LEVEL",0x2f31);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140063e20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f31);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_STAGE_MAX_LEVEL",0x2f31);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2f32);
  FUN_1403859e0(local_38,param_4);
  FUN_140058470(local_38,*param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_RETURN_LOBBY_RESULT",0x2f32);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2f32);
  FUN_1403859e0(local_38,param_5);
  FUN_140058470(local_38,*param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_RETURN_LOBBY_RESULT",0x2f32);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140064140(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f33);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_ENCHANT_ITEM",0x2f33);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140064220(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f33);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_ENCHANT_ITEM",0x2f33);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140064300(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f34);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_MIX_ITEM",0x2f34);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f34);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_MIX_ITEM",0x2f34);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400644f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f35);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_CHANGE_JOB",0x2f35);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400645d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f35);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_CHANGE_JOB",0x2f35);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400646b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f36);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SKILL_RESET",0x2f36);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140064790(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f36);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SKILL_RESET",0x2f36);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140064870(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f37);
  FUN_140017c50(local_30,*param_4);
  FUN_14011a5b0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REPURCHASE_INVENTORY_SET",0x2f37);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140064960(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f37);
  FUN_140017c50(local_30,*param_5);
  FUN_14011a5b0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REPURCHASE_INVENTORY_SET",0x2f37)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140064a50(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f38);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0xc);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 1));
      FUN_140017c50(local_40,*(undefined2 *)((longlong)puVar2 + 6));
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 2));
      FUN_140017c50(local_40,*(undefined2 *)((longlong)puVar2 + 10));
      puVar2 = puVar2 + 3;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_DUNGEON_RANK_LOAD",0x2f38);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f38);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0xc);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 1));
      FUN_140017c50(local_40,*(undefined2 *)((longlong)puVar2 + 6));
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 2));
      FUN_140017c50(local_40,*(undefined2 *)((longlong)puVar2 + 10));
      puVar2 = puVar2 + 3;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_DUNGEON_RANK_LOAD",0x2f38);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140064d00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f39);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_RANK",0x2f39);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f39);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_RANK",0x2f39);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140064f70(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f3a);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0xac);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_RESP_DECOMPOSITION_ITEM",0x2f3a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f3a);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0xac);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RESP_DECOMPOSITION_ITEM",0x2f3a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400651c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3b);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUEST_CHEAT_DELETE",0x2f3b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400652b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3b);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUEST_CHEAT_DELETE",0x2f3b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400653a0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f3c);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x1c);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x14));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x18));
      lVar2 = lVar2 + 0x1c;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_TITLE_LOAD",0x2f3c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f3c);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x1c);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x14));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x18));
      lVar2 = lVar2 + 0x1c;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_TITLE_LOAD",0x2f3c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065630(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3d);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TITLE_EQUIP_RESULT",0x2f3d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065730(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3d);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TITLE_EQUIP_RESULT",0x2f3d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3e);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TITLE_UNEQUIP_RESULT",0x2f3e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065930(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3e);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TITLE_UNEQUIP_RESULT",0x2f3e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065a20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3f);
  FUN_140017c50(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RELEASE_SERVER_CONNECT_WAIT",0x2f3f
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065b00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f3f);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RELEASE_SERVER_CONNECT_WAIT",
                     0x2f3f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065be0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f40);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_EQUIP_TITLE",0x2f40);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065cd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f40);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_EQUIP_TITLE",0x2f40);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140065dd0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f41);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*(undefined4 *)(param_4 + 0x10));
  FUN_140058470(local_30,*(undefined4 *)(param_4 + 0x14));
  FUN_140058470(local_30,*(undefined4 *)(param_4 + 0x18));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TITLE_ADD",0x2f41);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f41);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 0x10));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 0x14));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 0x18));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TITLE_ADD",0x2f41);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140065fe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f42);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_WEAPON_CRITICAL",0x2f42);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400660d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f42);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_WEAPON_CRITICAL",0x2f42);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400661d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f43);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SCALE_CHANGE",0x2f43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400662c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f43);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SCALE_CHANGE",0x2f43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400663c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f44);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NO_GUARD_STATE",0x2f44);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400664b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f44);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NO_GUARD_STATE",0x2f44);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400665b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f45);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STORAGE_GOLD_UPDATE",0x2f45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140066690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f45);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STORAGE_GOLD_UPDATE",0x2f45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140066770(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f46);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVENTORY_STORAGE_GOLD_UPDATE",
                     0x2f46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140066870(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f46);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INVENTORY_STORAGE_GOLD_UPDATE",
                     0x2f46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140066980(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f47);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_GUILD_NAME",0x2f47);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140066a90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f47);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403859e0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_GUILD_NAME",0x2f47);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f48);
  FUN_140058470(local_30,(param_4[1] - *param_4) / 0x1c);
  puVar2 = (undefined1 *)*param_4;
  if (puVar2 != (undefined1 *)param_4[1]) {
    do {
      FUN_140058870(local_30,*puVar2);
      FUN_1403a17c0(local_30,puVar2 + 0xc);
      FUN_140058470(local_30,*(undefined4 *)(puVar2 + 4));
      FUN_140017c50(local_30,*(undefined2 *)(puVar2 + 2));
      FUN_140058470(local_30,*(undefined4 *)(puVar2 + 8));
      puVar2 = puVar2 + 0x1c;
    } while (puVar2 != (undefined1 *)param_4[1]);
  }
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUICK_SLOT_UPDATE_LIST",0x2f48);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f48);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x1c);
  puVar2 = (undefined1 *)*param_5;
  if (puVar2 != (undefined1 *)param_5[1]) {
    do {
      FUN_140058870(local_40,*puVar2);
      FUN_1403a17c0(local_40,puVar2 + 0xc);
      FUN_140058470(local_40,*(undefined4 *)(puVar2 + 4));
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 2));
      FUN_140058470(local_40,*(undefined4 *)(puVar2 + 8));
      puVar2 = puVar2 + 0x1c;
    } while (puVar2 != (undefined1 *)param_5[1]);
  }
  FUN_140058470(local_40,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_QUICK_SLOT_UPDATE_LIST",0x2f48);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f49);
  FUN_140058470(local_30,(param_4[1] - *param_4) / 0x18);
  puVar2 = (undefined1 *)*param_4;
  if (puVar2 != (undefined1 *)param_4[1]) {
    do {
      FUN_140058870(local_30,*puVar2);
      FUN_1403a17c0(local_30,puVar2 + 8);
      FUN_140058470(local_30,*(undefined4 *)(puVar2 + 4));
      FUN_140058870(local_30,puVar2[1]);
      puVar2 = puVar2 + 0x18;
    } while (puVar2 != (undefined1 *)param_4[1]);
  }
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUICK_SLOT_SKILL_UPDATE_LIST",
                     0x2f49);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f49);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x18);
  puVar2 = (undefined1 *)*param_5;
  if (puVar2 != (undefined1 *)param_5[1]) {
    do {
      FUN_140058870(local_40,*puVar2);
      FUN_1403a17c0(local_40,puVar2 + 8);
      FUN_140058470(local_40,*(undefined4 *)(puVar2 + 4));
      FUN_140058870(local_40,puVar2[1]);
      puVar2 = puVar2 + 0x18;
    } while (puVar2 != (undefined1 *)param_5[1]);
  }
  FUN_140058470(local_40,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_QUICK_SLOT_SKILL_UPDATE_LIST",
                     0x2f49);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4a);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 1);
  puVar2 = (undefined2 *)*param_4;
  if (puVar2 != (undefined2 *)param_4[1]) {
    do {
      FUN_140017c50(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_4[1]);
  }
  FUN_140058470(local_30,(param_5[1] - *param_5) / 0xac);
  lVar3 = *param_5;
  if (lVar3 != param_5[1]) {
    do {
      FUN_14011a5b0(local_30,lVar3);
      lVar3 = lVar3 + 0xac;
    } while (lVar3 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REPURCHASE_INVENTORY_SET_LIST",
                     0x2f4a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *puVar2;
  longlong lVar3;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4a);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 1);
  puVar2 = (undefined2 *)*param_5;
  if (puVar2 != (undefined2 *)param_5[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_5[1]);
  }
  FUN_140058470(local_40,(param_6[1] - *param_6) / 0xac);
  lVar3 = *param_6;
  if (lVar3 != param_6[1]) {
    do {
      FUN_14011a5b0(local_40,lVar3);
      lVar3 = lVar3 + 0xac;
    } while (lVar3 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_REPURCHASE_INVENTORY_SET_LIST",
                     0x2f4a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4b);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 1);
  puVar2 = (undefined2 *)*param_4;
  if (puVar2 != (undefined2 *)param_4[1]) {
    do {
      FUN_140017c50(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_4[1]);
  }
  FUN_140058470(local_30,param_5[1] - *param_5 >> 1);
  puVar2 = (undefined2 *)*param_5;
  if (puVar2 != (undefined2 *)param_5[1]) {
    do {
      FUN_140017c50(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_5[1]);
  }
  FUN_140058470(local_30,(param_6[1] - *param_6) / 0xac);
  lVar3 = *param_6;
  if (lVar3 != param_6[1]) {
    do {
      FUN_14011a5b0(local_30,lVar3);
      lVar3 = lVar3 + 0xac;
    } while (lVar3 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVENTORY_SET_LIST",0x2f4b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *puVar2;
  longlong lVar3;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4b);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 1);
  puVar2 = (undefined2 *)*param_5;
  if (puVar2 != (undefined2 *)param_5[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 1);
  puVar2 = (undefined2 *)*param_6;
  if (puVar2 != (undefined2 *)param_6[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_6[1]);
  }
  FUN_140058470(local_40,(param_7[1] - *param_7) / 0xac);
  lVar3 = *param_7;
  if (lVar3 != param_7[1]) {
    do {
      FUN_14011a5b0(local_40,lVar3);
      lVar3 = lVar3 + 0xac;
    } while (lVar3 != param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_INVENTORY_SET_LIST",0x2f4b);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140067780(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4c);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x34);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x14));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x18));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x1c));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x20));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x24));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x28));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x2c));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x30));
      lVar2 = lVar2 + 0x34;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_QUEST_SET_LIST",0x2f4c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4c);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x34);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x14));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x18));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x1c));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x20));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x24));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x28));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x2c));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x30));
      lVar2 = lVar2 + 0x34;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_QUEST_SET_LIST",0x2f4c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f4d);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 1);
  puVar2 = (undefined2 *)*param_4;
  if (puVar2 != (undefined2 *)param_4[1]) {
    do {
      FUN_140017c50(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_4[1]);
  }
  FUN_140058470(local_30,(param_5[1] - *param_5) / 0xac);
  lVar3 = *param_5;
  if (lVar3 != param_5[1]) {
    do {
      FUN_14011a5b0(local_30,lVar3);
      lVar3 = lVar3 + 0xac;
    } while (lVar3 != param_5[1]);
  }
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STORAGE_UPDATE_LIST",0x2f4d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *puVar2;
  longlong lVar3;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4d);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 1);
  puVar2 = (undefined2 *)*param_5;
  if (puVar2 != (undefined2 *)param_5[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_5[1]);
  }
  FUN_140058470(local_40,(param_6[1] - *param_6) / 0xac);
  lVar3 = *param_6;
  if (lVar3 != param_6[1]) {
    do {
      FUN_14011a5b0(local_40,lVar3);
      lVar3 = lVar3 + 0xac;
    } while (lVar3 != param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_STORAGE_UPDATE_LIST",0x2f4d);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140067db0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4e);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x18);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140017c50(local_40,*(undefined2 *)(lVar2 + 0x14));
      lVar2 = lVar2 + 0x18;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_SKILL_LIST",0x2f4e);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4e);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x18);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140017c50(local_40,*(undefined2 *)(lVar2 + 0x14));
      lVar2 = lVar2 + 0x18;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_SKILL_LIST",0x2f4e);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140068020(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4f);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x18);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 1));
      FUN_1403a17c0(local_40,puVar2 + 2);
      puVar2 = puVar2 + 6;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_EQUIP_SKILL_LIST",0x2f4f);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f4f);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x18);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 1));
      FUN_1403a17c0(local_40,puVar2 + 2);
      puVar2 = puVar2 + 6;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_EQUIP_SKILL_LIST",0x2f4f);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140068290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f50);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_WEAPON_CRITICAL_ENEMY",0x2f50);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140068380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f50);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_WEAPON_CRITICAL_ENEMY",0x2f50);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140068480(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f51);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NO_GUARD_STATE_ENEMY",0x2f51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140068570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f51);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NO_GUARD_STATE_ENEMY",0x2f51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f52);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_POINT_VALUE_ENEMY",0x2f52);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f52);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_POINT_VALUE_ENEMY",0x2f52);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f53);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058570(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PERCENT_VALUE_ENEMY",0x2f53);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f53);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058570(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PERCENT_VALUE_ENEMY",0x2f53);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f54);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OPTION_VALUE_ENEMY",0x2f54);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f54);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_OPTION_VALUE_ENEMY",0x2f54);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140068d60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f55);
  FUN_140058470(local_30,*param_4);
  FUN_14008d250(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_FLAG_VALUE_ENEMY",0x2f55);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140068e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f55);
  FUN_140058470(local_30,*param_5);
  FUN_14008d250(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_FLAG_VALUE_ENEMY",0x2f55);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f56);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EXTRA_POINT_VALUE_ENEMY",0x2f56);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f56);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_EXTRA_POINT_VALUE_ENEMY",0x2f56);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140069190(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f57);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x18);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x14));
      lVar2 = lVar2 + 0x18;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_QUEST_FINISH_SET_LIST",0x2f57);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f57);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x18);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x14));
      lVar2 = lVar2 + 0x18;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_QUEST_FINISH_SET_LIST",0x2f57);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140069400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f58);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ALREADY_LOGIN",0x2f58);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400694c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f58);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ALREADY_LOGIN",0x2f58);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140069590(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f59);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHANGE_SKILL_LEVEL",0x2f59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f59);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHANGE_SKILL_LEVEL",0x2f59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400697a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5a);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GODMODE_ENEMY",0x2f5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5a);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GODMODE_ENEMY",0x2f5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140069990(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5b);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GODMODE",0x2f5b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5b);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GODMODE",0x2f5b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5c);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,(param_5[1] - *param_5) / 0xac);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011a5b0(local_30,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_INVENTORY_SET_LIST",0x2f5c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f5c);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,(param_6[1] - *param_6) / 0xac);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RESULT_INVENTORY_SET_LIST",0x2f5c
                    );
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140069e00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5d);
  FUN_140017c50(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_INVENTORY_REMOVE",0x2f5d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140069ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5d);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_INVENTORY_REMOVE",0x2f5d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140069fc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined2 *param_6,undefined2 *param_7,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5e);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_COSTUMEPACK_ITEM_EQUIP_RESULT",
                     0x2f5e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5e);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_COSTUMEPACK_ITEM_EQUIP_RESULT",
                     0x2f5e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006a250(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5f);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NOTIFY_CHARACTER_TIME_OVER",0x2f5f)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006a330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f5f);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NOTIFY_CHARACTER_TIME_OVER",
                     0x2f5f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006a410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f60);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NOTIFY_ITEM_TIME_OVER",0x2f60);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006a510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f60);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NOTIFY_ITEM_TIME_OVER",0x2f60);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006a620(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f61);
  FUN_1403859e0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_FRIEND_STAUS",0x2f61);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006a740(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f61);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_FRIEND_STAUS",0x2f61);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006a860(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f62);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_ITEM_RESULT",0x2f62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006a950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f62);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_ITEM_RESULT",0x2f62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f63);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,(param_6[1] - *param_6) / 0xac);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_14011a5b0(local_30,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_MYSTERYBOX_RESULT_INVENTORY_SET_LIST",0x2f63);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f63);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,(param_7[1] - *param_7) / 0xac);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,
                     L"PT_MYSTERYBOX_RESULT_INVENTORY_SET_LIST",0x2f63);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f64);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,(param_6[1] - *param_6) / 0xac);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_14011a5b0(local_30,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_LUCKYPENNY_RESULT_INVENTORY_SET_LIST",0x2f64);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f64);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,(param_7[1] - *param_7) / 0xac);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,
                     L"PT_LUCKYPENNY_RESULT_INVENTORY_SET_LIST",0x2f64);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006afb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f65);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_UPDATE_CHARACTER_DUEL_POINT",0x2f65
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006b090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f65);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_UPDATE_CHARACTER_DUEL_POINT",
                     0x2f65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006b170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f66);
  FUN_140058770(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_UPDATE_CHARACTER_DUEL_EXP",0x2f66);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006b250(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f66);
  FUN_140058770(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_UPDATE_CHARACTER_DUEL_EXP",0x2f66
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006b330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f67);
  FUN_140058770(local_30,*param_4);
  FUN_140058770(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_UPDATE_CHARACTER_DUEL_LADDER",
                     0x2f67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006b420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f67);
  FUN_140058770(local_30,*param_5);
  FUN_140058770(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_UPDATE_CHARACTER_DUEL_LADDER",
                     0x2f67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f68);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,(param_5[1] - *param_5) / 0xac);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011a5b0(local_30,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_RUNEVENDINGMACHINE_RESULT_INVENTORY_SET_LIST",0x2f68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f68);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,(param_6[1] - *param_6) / 0xac);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,
                     L"PT_RUNEVENDINGMACHINE_RESULT_INVENTORY_SET_LIST",0x2f68);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006b7a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f69);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RUNEVENDINGMACHINE_RESULT",0x2f69);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006b880(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f69);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RUNEVENDINGMACHINE_RESULT",0x2f69
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006b960(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADDITION_VALUE",0x2f6a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f6a);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_ADDITION_VALUE",0x2f6a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006bbd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6b);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADDITION_SP",0x2f6b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006bcb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6b);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADDITION_SP",0x2f6b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006bd90(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f6c);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x18);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x14));
      lVar2 = lVar2 + 0x18;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_ACTIVE_PACKAGE_INFO",0x2f6c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f6c);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x18);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x10));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x14));
      lVar2 = lVar2 + 0x18;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_ACTIVE_PACKAGE_INFO",0x2f6c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c000(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6d);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1401182c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENCHANT_NOTICE",0x2f6d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c100(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6d);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1401182c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENCHANT_NOTICE",0x2f6d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c200(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6e);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_CASH_BALANCE",0x2f6e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c2f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6e);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_CASH_BALANCE",0x2f6e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c3f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_BUY_CASH_PRODUCT",0x2f6f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c4f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f6f);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_BUY_CASH_PRODUCT",0x2f6f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006c600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f70);
  FUN_14004bd90(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_LIST_CASH_PRODUCT",0x2f70);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c6e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f70);
  FUN_14004bd90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_LIST_CASH_PRODUCT",0x2f70)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c7c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f71);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_CHECK_RECVUSER",0x2f71);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006c8c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f71);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_CHECK_RECVUSER",0x2f71);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006c9d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f72);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NEW_MAIL_NOTIFY",0x2f72);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006ca90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f72);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NEW_MAIL_NOTIFY",0x2f72);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006cb60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f73);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_MSG_WHISPER",0x2f73);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006cc40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f73);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_MSG_WHISPER",0x2f73);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006cd20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined8 *param_7,undefined4 *param_8,
             undefined8 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined4 *param_15,undefined4 *param_16,
             undefined1 *param_17,undefined4 *param_18,undefined4 *param_19,undefined1 *param_20,
             undefined4 *param_21,undefined4 *param_22,undefined8 param_23,undefined8 param_24,
             undefined8 param_25)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f74);
  FUN_1403a17c0(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058770(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,param_15[1]);
  FUN_140058470(local_30,param_15[2]);
  FUN_140058470(local_30,param_15[3]);
  FUN_140058470(local_30,param_15[4]);
  FUN_140058470(local_30,param_15[5]);
  FUN_140058470(local_30,*param_16);
  FUN_140058870(local_30,*param_17);
  FUN_140058470(local_30,*param_18);
  FUN_140058470(local_30,*param_19);
  FUN_140058870(local_30,*param_20);
  FUN_140058470(local_30,*param_21);
  FUN_140058470(local_30,*param_22);
  FUN_1403a17c0(local_30,param_23);
  FUN_1403859e0(local_30,param_24);
  FUN_1403859e0(local_30,param_25);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_CHARACTER_INFO_SELECT",0x2f74);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006cfa0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined2 *param_6,undefined2 *param_7,undefined8 *param_8,
             undefined4 *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,undefined1 *param_18,undefined4 *param_19,undefined4 *param_20,
             undefined1 *param_21,undefined4 *param_22,undefined4 *param_23,undefined8 param_24,
             undefined8 param_25,undefined8 param_26)

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f74);
  FUN_1403a17c0(local_40,param_5);
  FUN_140017c50(local_40,*param_6);
  FUN_140017c50(local_40,*param_7);
  FUN_140058770(local_40,*param_8);
  FUN_140058470(local_40,*param_9);
  FUN_140058770(local_40,*param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,*param_13);
  FUN_140058470(local_40,*param_14);
  FUN_140058470(local_40,*param_15);
  FUN_140058470(local_40,*param_16);
  FUN_140058470(local_40,param_16[1]);
  FUN_140058470(local_40,param_16[2]);
  FUN_140058470(local_40,param_16[3]);
  FUN_140058470(local_40,param_16[4]);
  FUN_140058470(local_40,param_16[5]);
  FUN_140058470(local_40,*param_17);
  FUN_140058870(local_40,*param_18);
  FUN_140058470(local_40,*param_19);
  FUN_140058470(local_40,*param_20);
  FUN_140058870(local_40,*param_21);
  FUN_140058470(local_40,*param_22);
  FUN_140058470(local_40,*param_23);
  FUN_1403a17c0(local_40,param_24);
  FUN_1403859e0(local_40,param_25);
  FUN_1403859e0(local_40,param_26);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PU_CHARACTER_INFO_SELECT",0x2f74);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006d230(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f75);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NOTIFY_LIMIT_GOLD",0x2f75);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006d320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f75);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NOTIFY_LIMIT_GOLD",0x2f75);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006d420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f76);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_ITEM_LOCK",0x2f76);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006d510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f76);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_ITEM_LOCK",0x2f76);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006d610(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f77);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_ITEM_MIX_RESULT",0x2f77);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006d700(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f77);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_ITEM_MIX_RESULT",0x2f77);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006d800(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f78);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CONTACT_NPC_GROUP_RESULT",0x2f78);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006d900(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f78);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CONTACT_NPC_GROUP_RESULT",0x2f78)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006da10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f79);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_STRENGTHEN_COMPOSE",0x2f79);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006daf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f79);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_STRENGTHEN_COMPOSE",0x2f79);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006dbd0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f7a);
  FUN_140058470(local_40,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_140058870(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"PT_XTRAP_CS_STEP1",0x2f7a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006dcd0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f7a);
  FUN_140058470(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(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"PT_XTRAP_CS_STEP1",0x2f7a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006dde0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7b);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_XTRAP_CS_DISCONNECTED",0x2f7b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006dec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7b);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_XTRAP_CS_DISCONNECTED",0x2f7b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006dfa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7c);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_DEL_COUNT",0x2f7c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006e090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7c);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_DEL_COUNT",0x2f7c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006e190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7d);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MGS_SERVER_NOTICE",0x2f7d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006e280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7d);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MGS_SERVER_NOTICE",0x2f7d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006e370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_OPEN_SYSCONSOLE",0x2f7e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006e430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_OPEN_SYSCONSOLE",0x2f7e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006e500(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIFT_CASH_ITEM",0x2f7f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006e5c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f7f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIFT_CASH_ITEM",0x2f7f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006e690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f80);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UNIQUE_ITEM_GET_NOTICE",0x2f80);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006e7a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f80);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UNIQUE_ITEM_GET_NOTICE",0x2f80);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006e8c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f81);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_HAIR_COLOR_CHANGE",0x2f81);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006e9a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f81);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_HAIR_COLOR_CHANGE",0x2f81);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006ea80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f82);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_HAIR_CUT_CHANGE",0x2f82);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006eb60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f82);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_HAIR_CUT_CHANGE",0x2f82);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006ec40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f83);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_RESP_HAIR_COLOR_CHANGE_NOTIFY",
                     0x2f83);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006ed70(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f83);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_RESP_HAIR_COLOR_CHANGE_NOTIFY",
                     0x2f83);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006eeb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f84);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_RESP_HAIR_CUT_CHANGE_NOTIFY",0x2f84
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006efe0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f84);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_RESP_HAIR_CUT_CHANGE_NOTIFY",
                     0x2f84);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006f120(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f85);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_14011a5b0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_INVENTORY_UPDATE",0x2f85);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f85);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_14011a5b0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_INVENTORY_UPDATE",0x2f85);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006f380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f86);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_PET_REBIRTH_COINT_VALUE",0x2f86
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006f460(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f86);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_PET_REBIRTH_COINT_VALUE",
                     0x2f86);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006f540(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f87);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GM_SERVER_JOIN",0x2f87);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006f640(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f87);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GM_SERVER_JOIN",0x2f87);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006f740(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f88);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_CASHSHOP_OPEN",0x2f88);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f88);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_CASHSHOP_OPEN",0x2f88);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006f9b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f89);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_COSTUME_CHARGE",0x2f89);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006fa90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f89);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_COSTUME_CHARGE",0x2f89);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006fb70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8a);
  FUN_140058870(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INQUIRY",0x2f8a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006fc60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8a);
  FUN_140058870(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INQUIRY",0x2f8a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006fd50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_OPEN_SCRIPT_LOG",0x2f8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006fe10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_OPEN_SCRIPT_LOG",0x2f8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14006fee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8c);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NOTIFY_PACKAGE_TIME_OVER",0x2f8c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14006ffc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8c);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NOTIFY_PACKAGE_TIME_OVER",0x2f8c)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400700a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8d);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_INSERT_INQUIRY",0x2f8d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070180(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8d);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_INSERT_INQUIRY",0x2f8d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8e);
  FUN_140017c50(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVENTORY_RESET_PAGE",0x2f8e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070340(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8e);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INVENTORY_RESET_PAGE",0x2f8e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8f);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STORAGE_RESET",0x2f8f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070500(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f8f);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STORAGE_RESET",0x2f8f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400705e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f90);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UPDATE_GUILD_POINT",0x2f90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400706e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f90);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UPDATE_GUILD_POINT",0x2f90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400707f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f91);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUEST_SKIP_RESULT",0x2f91);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400708e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f91);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUEST_SKIP_RESULT",0x2f91);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400709d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f92);
  FUN_14011a5b0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RANDOM_BOX_SET",0x2f92);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070ab0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f92);
  FUN_14011a5b0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RANDOM_BOX_SET",0x2f92);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140070b90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f93);
  FUN_14011a5b0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CUBE_BOX_SET",0x2f93);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f93);
  FUN_14011a5b0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CUBE_BOX_SET",0x2f93);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070d50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f94);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_OTHER_CHARACTER_INFO_SESSION_RESULT",0x2f94);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140070e30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f94);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_OTHER_CHARACTER_INFO_SESSION_RESULT",0x2f94);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f95);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 1);
  puVar2 = (undefined2 *)*param_5;
  if (puVar2 != (undefined2 *)param_5[1]) {
    do {
      FUN_140017c50(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_5[1]);
  }
  FUN_140058470(local_30,(param_6[1] - *param_6) / 0xac);
  lVar3 = *param_6;
  if (lVar3 != param_6[1]) {
    do {
      FUN_14011a5b0(local_30,lVar3);
      lVar3 = lVar3 + 0xac;
    } while (lVar3 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_EQUIP_INVENTORY",0x2f95);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *puVar2;
  longlong lVar3;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2f95);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 1);
  puVar2 = (undefined2 *)*param_6;
  if (puVar2 != (undefined2 *)param_6[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_6[1]);
  }
  FUN_140058470(local_40,(param_7[1] - *param_7) / 0xac);
  lVar3 = *param_7;
  if (lVar3 != param_7[1]) {
    do {
      FUN_14011a5b0(local_40,lVar3);
      lVar3 = lVar3 + 0xac;
    } while (lVar3 != param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PLAYER_EQUIP_INVENTORY",0x2f95);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140071200(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f96);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TITLE_EXPIRE_DELETE",0x2f96);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140071300(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f96);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TITLE_EXPIRE_DELETE",0x2f96);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140071410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f97);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_RANDOM_QUEST",0x2f97);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400714f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f97);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_RANDOM_QUEST",0x2f97);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400715d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f98);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUEST_ACCEPT_FAIL_RANDOM_QUEST",
                     0x2f98);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400716c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f98);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUEST_ACCEPT_FAIL_RANDOM_QUEST",
                     0x2f98);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400717c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f99);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_4[1]);
  FUN_140058570(local_30,param_4[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_INSERT_BUFF",0x2f99);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400718b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f99);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_INSERT_BUFF",0x2f99);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400719c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_4[1]);
  FUN_140058570(local_30,param_4[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_UPDATE_BUFF",0x2f9a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140071ab0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9a);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_UPDATE_BUFF",0x2f9a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140071bc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9b);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_4[1]);
  FUN_140058570(local_30,param_4[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_DELETE_BUFF",0x2f9b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140071cb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9b);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_DELETE_BUFF",0x2f9b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140071dc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9c);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_PART_CHANGE_NOTIFY",0x2f9c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140071ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9c);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_PART_CHANGE_NOTIFY",0x2f9c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072000(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9d);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UPDATE_CASH_MILEAGE",0x2f9d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400720e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9d);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UPDATE_CASH_MILEAGE",0x2f9d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400721c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9e);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UPDATE_CHARACTER_NAME",0x2f9e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400722a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9e);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UPDATE_CHARACTER_NAME",0x2f9e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SYMBOL_MARK_ENEMY",0x2f9f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2f9f);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SYMBOL_MARK_ENEMY",0x2f9f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa0);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SYMBOL_MARK",0x2fa0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa0);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SYMBOL_MARK",0x2fa0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072760(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa1);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"NOTIFY_PC_ROOM_EVENT_TIME",0x2fa1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa1);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"NOTIFY_PC_ROOM_EVENT_TIME",0x2fa1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072920(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa2);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PC_ROOM_SHOP_ITEM_BUY_RESULT",
                     0x2fa2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072a20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa2);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PC_ROOM_SHOP_ITEM_BUY_RESULT",
                     0x2fa2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140072b30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_READ_ALL_DATA_COMPLETE",
                     0x2fa3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140072bf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_READ_ALL_DATA_COMPLETE"
                     ,0x2fa3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072cc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa4);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_READY_RESULT",0x2fa4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072da0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_READY_RESULT",0x2fa4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072e80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa5);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TIME_SHUT_DOWN",0x2fa5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140072f70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa5);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TIME_SHUT_DOWN",0x2fa5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa6);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_REWARD_COUPON",0x2fa6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa6);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_REWARD_COUPON",0x2fa6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa7);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_PET_CHARGE",0x2fa7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa7);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_PET_CHARGE",0x2fa7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa8);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_CHANGE_PET_NAME",0x2fa8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa8);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_CHANGE_PET_NAME",0x2fa8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073680(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa9);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_CHANGE_JOB_M",0x2fa9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073770(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fa9);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_CHANGE_JOB_M",0x2fa9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073870(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2faa);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_EVENT_ITEM",0x2faa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073990(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2faa);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_EVENT_ITEM",0x2faa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fab);
  FUN_14008d310(local_30,param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PROTOCOL_CHECK_RESP",0x2fab);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fab);
  FUN_14008d310(local_40,param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PROTOCOL_CHECK_RESP",0x2fab);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140073d00(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fac);
  FUN_140058470(local_40,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_140058870(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"PT_NPROTECT_CHECK",0x2fac);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140073e00(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fac);
  FUN_140058470(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(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"PT_NPROTECT_CHECK",0x2fac);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140073f10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fad);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NPROTECT_DISCONNECTED",0x2fad);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140073fd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fad);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NPROTECT_DISCONNECTED",0x2fad);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400740a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fae);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_PARTY_SKILL_LIST",0x2fae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fae);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_PARTY_SKILL_LIST",0x2fae);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2faf);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OPEN_PARTY_MISSION_SELECT",0x2faf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2faf);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_OPEN_PARTY_MISSION_SELECT",0x2faf
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074580(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb0);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SELECT_PARTY_MISSION_INDEX",0x2fb0)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb0);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SELECT_PARTY_MISSION_INDEX",
                     0x2fb0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140074740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CLOSE_PARTY_MISSION_SELECT",0x2fb1)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140074800(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CLOSE_PARTY_MISSION_SELECT",
                     0x2fb1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400748d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb2);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SCROLL_PARTY_MISSION",0x2fb2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400749b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb2);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SCROLL_PARTY_MISSION",0x2fb2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140074a90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ASK_DAY_MISSION_START",0x2fb3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140074b50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ASK_DAY_MISSION_START",0x2fb3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb4);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SELECT_ASK_DAY_MISSION_START",
                     0x2fb4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074d00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SELECT_ASK_DAY_MISSION_START",
                     0x2fb4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074de0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb5);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_MISSION_ID",0x2fb5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb5);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_MISSION_ID",0x2fb5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140074fa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb6);
  FUN_140017c50(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SERVER_FPS",0x2fb6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140075080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb6);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SERVER_FPS",0x2fb6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140075160(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             longlong *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb7);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_SHOP_CONTROL",0x2fb7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fb7);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_SHOP_CONTROL",0x2fb7);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140075490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb8);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_RUNE_EXTRACTION",0x2fb8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140075580(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb8);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_RUNE_EXTRACTION",0x2fb8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140075680(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb9);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_UPDATE_DAY_PARTY_MISSION",
                     0x2fb9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140075770(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fb9);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_UPDATE_DAY_PARTY_MISSION",
                     0x2fb9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140075870(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fba);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_PLAYTIME_STATUS",0x2fba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fba);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_PLAYTIME_STATUS",0x2fba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbb);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,(param_5[1] - *param_5) / 9);
  puVar2 = (undefined1 *)*param_5;
  if (puVar2 != (undefined1 *)param_5[1]) {
    do {
      FUN_140058870(local_30,*puVar2);
      FUN_140058470(local_30,*(undefined4 *)(puVar2 + 1));
      FUN_140058470(local_30,*(undefined4 *)(puVar2 + 5));
      puVar2 = puVar2 + 9;
    } while (puVar2 != (undefined1 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_GUILD_SKILL_LIST_ONCE",0x2fbb)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fbb);
  FUN_1403a17c0(local_40,param_5);
  FUN_140058470(local_40,(param_6[1] - *param_6) / 9);
  puVar2 = (undefined1 *)*param_6;
  if (puVar2 != (undefined1 *)param_6[1]) {
    do {
      FUN_140058870(local_40,*puVar2);
      FUN_140058470(local_40,*(undefined4 *)(puVar2 + 1));
      FUN_140058470(local_40,*(undefined4 *)(puVar2 + 5));
      puVar2 = puVar2 + 9;
    } while (puVar2 != (undefined1 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RESP_GUILD_SKILL_LIST_ONCE",
                     0x2fbb);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fbc);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar2 = (undefined4 *)*param_9;
  if (puVar2 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_9[1]);
  }
  FUN_14008d250(local_40,param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058470(local_40,param_11[1]);
  FUN_140058470(local_40,param_11[2]);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,param_13[1] - *param_13 >> 2);
  puVar2 = (undefined4 *)*param_13;
  if (puVar2 != (undefined4 *)param_13[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_13[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_CONTENT_CONTROL",0x2fbc);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fbc);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,*param_8);
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar2 = (undefined4 *)*param_9;
  if (puVar2 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_9[1]);
  }
  FUN_140058470(local_40,param_10[1] - *param_10 >> 2);
  puVar2 = (undefined4 *)*param_10;
  if (puVar2 != (undefined4 *)param_10[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_10[1]);
  }
  FUN_14008d250(local_40,param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,param_12[1]);
  FUN_140058470(local_40,param_12[2]);
  FUN_140058470(local_40,*param_13);
  FUN_140058470(local_40,param_14[1] - *param_14 >> 2);
  puVar2 = (undefined4 *)*param_14;
  if (puVar2 != (undefined4 *)param_14[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_14[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_CONTENT_CONTROL",0x2fbc);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140076200(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbd);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BILLING_ERROR",0x2fbd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400762e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbd);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BILLING_ERROR",0x2fbd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400763c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbe);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_APEX_LOGIN",0x2fbe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140076480(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fbe);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_APEX_LOGIN",0x2fbe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140076550(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fbf);
  FUN_140058470(local_40,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_140058870(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"PT_RESP_APEX_DATA",0x2fbf);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140076650(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2fbf);
  FUN_140058470(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(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"PT_RESP_APEX_DATA",0x2fbf);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140076760(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc0);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_APEX_KILL",0x2fc0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140076820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc0);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_APEX_KILL",0x2fc0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400768f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_READY_APEX_LOGIN",0x2fc1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400769b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_READY_APEX_LOGIN",0x2fc1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140076a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_APEX_LOGOUT",0x2fc2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140076b40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2fc2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_APEX_LOGOUT",0x2fc2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}


/*
Unable to decompile 'FUN_140076c10'
Cause: Exception while decompiling 140076c10: 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::CommonC2sStub::vftable;
  FUN_140388ea0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14008cf80(undefined8 *param_1)

{
  *param_1 = RNP::CommonC2sStub::vftable;
  FUN_140388ea0();
  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::CommonS2cProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14008cfd0(undefined8 *param_1)

{
  *param_1 = RNP::CommonS2cProxy::vftable;
  FUN_140385b20();
  return;
}



undefined8 * FUN_14008cfe0(undefined8 *param_1)

{
  undefined4 local_res8 [2];
  
  local_res8[0] = 0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  FUN_14008d100(param_1,0,local_res8);
  param_1[4] = 0;
  return param_1;
}



void FUN_14008d020(undefined8 *param_1)

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



void FUN_14008d060(longlong *param_1)

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



void FUN_14008d0a0(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_14008d100(undefined8 *param_1,longlong param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  char cVar2;
  undefined4 *puVar3;
  longlong lVar4;
  
  cVar2 = FUN_14008d170();
  if (cVar2 != '\0') {
    puVar1 = (undefined4 *)*param_1;
    puVar3 = puVar1;
    for (lVar4 = param_2; lVar4 != 0; lVar4 = lVar4 + -1) {
      *puVar3 = *param_3;
      puVar3 = puVar3 + 1;
    }
    param_1[1] = puVar1 + param_2;
  }
  return;
}



undefined8 FUN_14008d170(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_14008d1e0(param_2);
    *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;
}



void * FUN_14008d1e0(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x4000000000000000) && (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_1405d3608);
}



undefined8 FUN_14008d250(undefined8 param_1,longlong *param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  
  FUN_140058470();
  lVar5 = *param_2;
  uVar4 = 0;
  while( true ) {
    uVar1 = param_2[4];
    lVar6 = *param_2;
    uVar3 = 0;
    if (uVar1 != 0) {
      if (((longlong)uVar1 < 0) && (uVar1 != 0)) {
        lVar2 = (-uVar1 - 1 >> 5) * -4 + -4;
      }
      else {
        lVar2 = (uVar1 >> 5) * 4;
      }
      lVar6 = lVar6 + lVar2;
      uVar3 = (ulonglong)((uint)uVar1 & 0x1f);
    }
    if ((lVar5 == lVar6) && (uVar4 == uVar3)) break;
    FUN_140058870();
    if (uVar4 < 0x1f) {
      uVar4 = uVar4 + 1;
    }
    else {
      uVar4 = 0;
      lVar5 = lVar5 + 4;
    }
  }
  return param_1;
}



undefined8 FUN_14008d310(undefined8 param_1,longlong *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined1 local_58 [80];
  
  FUN_140058470(param_1,(param_2[1] - *param_2) / 0x28);
  puVar2 = (undefined8 *)*param_2;
  if (puVar2 != (undefined8 *)param_2[1]) {
    do {
      if (0x7fffffff < (ulonglong)puVar2[2]) {
        FUN_14034f420(local_58,L"WriteString failed! length=%I64d");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      puVar1 = puVar2;
      if (7 < (ulonglong)puVar2[3]) {
        puVar1 = (undefined8 *)*puVar2;
      }
      FUN_140385820(param_1,puVar1);
      puVar2 = puVar2 + 5;
    } while (puVar2 != (undefined8 *)param_2[1]);
  }
  return param_1;
}



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

undefined8 FUN_14008d3d0(undefined8 param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  undefined4 *puVar2;
  longlong lVar3;
  uint uVar4;
  char cVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined4 *puVar8;
  undefined1 uVar9;
  ulonglong uVar10;
  uint local_res8 [2];
  undefined4 local_res10 [2];
  undefined4 local_res18;
  undefined1 uStackX_1c;
  
  FUN_1403840e0(param_1,local_res8,4);
  uVar4 = local_res8[0];
  uVar10 = (ulonglong)local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1405d8140 <= (int)local_res8[0])) {
    FUN_1403a1730(local_res8[0]);
  }
  FUN_14008dfa0(param_2,(longlong)(int)uVar4);
  uVar1 = *param_2;
  lVar7 = param_2[1] - uVar1;
  lVar3 = lVar7 >> 0x3f;
  if ((lVar7 / 5 + lVar3 != lVar3) && (uVar1 != param_2[1])) {
    param_2[1] = uVar1;
  }
  if (0 < (int)uVar4) {
    do {
      cVar5 = FUN_1403840e0(param_1,local_res8,1);
      uVar9 = 0;
      if (cVar5 != '\0') {
        uVar9 = (undefined1)local_res8[0];
      }
      local_res18 = CONCAT31(local_res18._1_3_,uVar9);
      cVar5 = FUN_1403840e0(param_1,local_res10,4);
      puVar2 = (undefined4 *)param_2[1];
      uVar6 = 0;
      if (cVar5 != '\0') {
        uVar6 = local_res10[0];
      }
      local_res18._1_3_ = (undefined3)uVar6;
      uStackX_1c = (undefined1)((uint)uVar6 >> 0x18);
      if ((&local_res18 < puVar2) && (puVar8 = (undefined4 *)*param_2, puVar8 <= &local_res18)) {
        if (puVar2 == (undefined4 *)param_2[2]) {
          FUN_14008ed00(param_2,1);
        }
        puVar2 = (undefined4 *)param_2[1];
        puVar8 = (undefined4 *)((((longlong)&local_res18 - (longlong)puVar8) / 5) * 5 + *param_2);
        if (puVar2 != (undefined4 *)0x0) {
          *puVar2 = *puVar8;
          *(undefined1 *)(puVar2 + 1) = *(undefined1 *)(puVar8 + 1);
        }
      }
      else {
        if (puVar2 == (undefined4 *)param_2[2]) {
          FUN_14008ed00(param_2,1);
        }
        puVar2 = (undefined4 *)param_2[1];
        if (puVar2 != (undefined4 *)0x0) {
          *puVar2 = local_res18;
          *(undefined1 *)(puVar2 + 1) = uStackX_1c;
        }
      }
      param_2[1] = param_2[1] + 5;
      uVar10 = uVar10 - 1;
    } while (uVar10 != 0);
  }
  return param_1;
}



void FUN_14008d580(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 5,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14008d650(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_1403840e0(param_1,local_res10,4);
  iVar4 = local_res10[0];
  if ((local_res10[0] < 0) || (DAT_1405d8140 <= local_res10[0])) {
    FUN_1403a1730(local_res10[0]);
  }
  FUN_14008e0d0(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_1403840e0(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_14008e0d0(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_14008e0d0(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;
}



undefined8 FUN_14008d820(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_1403840e0(param_1,local_res10,4);
  iVar4 = local_res10[0];
  if ((local_res10[0] < 0) || (DAT_1405d8140 <= local_res10[0])) {
    FUN_1403a1730(local_res10[0]);
  }
  FUN_14008e180(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_1403840e0(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_14008e180(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_14008e180(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;
}



void FUN_14008d9f0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",param_2[1] - *param_2,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14008daa0(undefined8 param_1,undefined8 param_2)

{
  uint uVar1;
  char cVar2;
  undefined1 uVar3;
  ulonglong uVar4;
  uint local_res8 [2];
  
  FUN_1403840e0(param_1,local_res8,4);
  uVar1 = local_res8[0];
  if (((int)local_res8[0] < 0) || (DAT_1405d8140 <= (int)local_res8[0])) {
    FUN_1403a1730(local_res8[0]);
  }
  FUN_14030db30(param_2,(longlong)(int)uVar1 + 0x1fU >> 5);
  FUN_14008e270(param_2);
  if (0 < (int)uVar1) {
    uVar4 = (ulonglong)uVar1;
    uVar3 = (undefined1)local_res8[0];
    do {
      cVar2 = FUN_1403840e0(param_1,local_res8,1);
      if (cVar2 != '\0') {
        uVar3 = (undefined1)local_res8[0];
      }
      FUN_14008e330(param_2,uVar3);
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_14008db60(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",*(undefined8 *)(param_2 + 0x20),param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_14008dc10(undefined8 param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  void *_Dst;
  longlong lVar3;
  undefined1 *puVar4;
  undefined1 auStack_118 [32];
  uint local_f8 [4];
  undefined1 local_e8 [168];
  undefined4 local_40;
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_118;
  FUN_1403840e0(param_1,local_f8,4);
  if (((int)local_f8[0] < 0) || (DAT_1405d8140 <= (int)local_f8[0])) {
    FUN_1403a1730(local_f8[0]);
  }
  FUN_14008e560(param_2,(longlong)(int)local_f8[0]);
  uVar1 = param_2[1];
  lVar2 = uVar1 - *param_2;
  lVar3 = lVar2 >> 0x3f;
  if ((lVar2 / 0xac + lVar3 != lVar3) && (*param_2 != uVar1)) {
    uVar1 = FUN_14008fc00(uVar1,uVar1);
    param_2[1] = uVar1;
  }
  if (0 < (int)local_f8[0]) {
    uVar1 = (ulonglong)local_f8[0];
    do {
      FUN_14000a170(local_e8);
      local_40 = 0;
      FUN_14011a150(param_1,local_e8);
      puVar4 = (undefined1 *)param_2[1];
      if ((local_e8 < puVar4) && ((undefined1 *)*param_2 <= local_e8)) {
        lVar3 = (longlong)(local_e8 + -(longlong)*param_2) / 0x56 +
                ((longlong)(local_e8 + -(longlong)*param_2) >> 0x3f);
        if (puVar4 == (undefined1 *)param_2[2]) {
          FUN_14008f210(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar4 = (undefined1 *)(((lVar3 >> 1) - (lVar3 >> 0x3f)) * 0xac + *param_2);
        if (_Dst != (void *)0x0) {
LAB_14008dd74:
          memcpy(_Dst,puVar4,0xac);
        }
      }
      else {
        if (puVar4 == (undefined1 *)param_2[2]) {
          FUN_14008f210(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar4 = local_e8;
          goto LAB_14008dd74;
        }
      }
      param_2[1] = param_2[1] + 0xac;
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_14008ddc0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0xac,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_14008de90(longlong *param_1,ulonglong param_2)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  char *pcVar4;
  char *local_res10;
  undefined **local_20 [3];
  
  if (0x7fffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)(param_1[2] - *param_1 >> 1) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 2);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    memmove(local_res10,(void *)*param_1,(param_1[1] - *param_1 >> 1) * 2);
    pvVar1 = (void *)*param_1;
    lVar2 = param_1[1];
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 2);
    param_1[1] = (longlong)(pcVar4 + (lVar2 - (longlong)pvVar1 >> 1) * 2);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_14008dfa0(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 (0x3333333333333333 < 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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14008fdb0(*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 * 5);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 5) * 5);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



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

void FUN_14008e0d0(longlong *param_1,ulonglong param_2)

{
  void *pvVar1;
  longlong lVar2;
  void *_Dst;
  
  if ((ulonglong)(param_1[2] - *param_1) < param_2) {
    _Dst = (void *)FUN_1400042e0(param_2);
    memmove(_Dst,(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)_Dst + param_2;
    param_1[1] = (lVar2 - (longlong)pvVar1) + (longlong)_Dst;
    *param_1 = (longlong)_Dst;
  }
  return;
}



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

void FUN_14008e180(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_1405d3608);
    }
    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_14008e270(longlong *param_1)

{
  ulonglong uVar1;
  longlong local_38;
  ulonglong uStack_30;
  longlong local_28 [2];
  undefined1 local_18 [24];
  
  uVar1 = param_1[4];
  if (uVar1 != 0) {
    local_28[0] = *param_1;
    if (((longlong)uVar1 < 0) && (uVar1 != 0)) {
      local_38 = (-uVar1 - 1 >> 5) * -4 + -4;
    }
    else {
      local_38 = (uVar1 >> 5) * 4;
    }
    local_38 = local_28[0] + local_38;
    uStack_30 = (ulonglong)((uint)uVar1 & 0x1f);
    local_28[1] = 0;
    FUN_14008edb0(param_1,local_18,local_28,&local_38);
  }
  return;
}



void FUN_14008e330(longlong *param_1,undefined1 param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  longlong local_18;
  ulonglong uStack_10;
  
  uVar1 = param_1[4];
  local_18 = *param_1;
  uStack_10 = 0;
  if (uVar1 != 0) {
    if (((longlong)uVar1 < 0) && (uVar1 != 0)) {
      lVar2 = (-uVar1 - 1 >> 5) * -4 + -4;
    }
    else {
      lVar2 = (uVar1 >> 5) * 4;
    }
    local_18 = local_18 + lVar2;
    uStack_10 = (ulonglong)((uint)uVar1 & 0x1f);
  }
  FUN_14008f040(param_1,&local_18,1,param_2);
  return;
}



void FUN_14008e3c0(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_1405d3608);
      }
    }
    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_14008e4d0(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_14008f190(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_14008f190(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_14008e560(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  if (0x17d05f417d05f41 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0xac) < param_2) {
    lVar3 = FUN_14008f2c0(param_2);
    FUN_14008fdf0(*param_1,param_1[1],lVar3,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) / 0x56 + (param_1[1] - (longlong)pvVar1 >> 0x3f);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = param_2 * 0xac + lVar3;
    param_1[1] = ((lVar4 >> 1) - (lVar4 >> 0x3f)) * 0xac + lVar3;
    *param_1 = lVar3;
  }
  return;
}



void FUN_14008e650(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 / 0x56 + (lVar2 >> 0x3f);
    if (pvVar1 == (void *)param_1[2]) {
      FUN_14008f210(param_1,1);
    }
    param_2 = (void *)(((lVar2 >> 1) - (lVar2 >> 0x3f)) * 0xac + *param_1);
  }
  else if (pvVar1 == (void *)param_1[2]) {
    FUN_14008f210(param_1,1);
  }
  if ((void *)param_1[1] != (void *)0x0) {
    memcpy((void *)param_1[1],param_2,0xac);
  }
  param_1[1] = param_1[1] + 0xac;
  return;
}



void FUN_14008e6f0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14008fe50(*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;
}



void FUN_14008e830(longlong *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  puVar1 = (undefined4 *)param_1[1];
  if ((param_2 < puVar1) && ((undefined4 *)*param_1 <= param_2)) {
    lVar3 = (longlong)param_2 - *param_1;
    lVar3 = lVar3 / 6 + (lVar3 >> 0x3f);
    lVar3 = (lVar3 >> 2) - (lVar3 >> 0x3f);
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_14008f3e0(param_1,1);
    }
    puVar1 = (undefined4 *)param_1[1];
    lVar2 = *param_1;
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *(undefined4 *)(lVar2 + lVar3 * 0x18);
      puVar1[1] = *(undefined4 *)(lVar2 + 4 + lVar3 * 0x18);
      puVar1[2] = *(undefined4 *)(lVar2 + 8 + lVar3 * 0x18);
      puVar1[3] = *(undefined4 *)(lVar2 + 0xc + lVar3 * 0x18);
      puVar1[4] = *(undefined4 *)(lVar2 + 0x10 + lVar3 * 0x18);
      puVar1[5] = *(undefined4 *)(lVar2 + 0x14 + lVar3 * 0x18);
      param_1[1] = param_1[1] + 0x18;
      return;
    }
  }
  else {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_14008f3e0(param_1,1);
    }
    puVar1 = (undefined4 *)param_1[1];
    if (puVar1 != (undefined4 *)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];
    }
  }
  param_1[1] = param_1[1] + 0x18;
  return;
}



void FUN_14008e930(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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_14008feb0(*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_14008ea70(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_14008f490(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_14008f490(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_14008eb00(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_14008f5c0(param_2);
    FUN_14008ff10(*param_1,param_1[1],lVar4);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_14008d0a0(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_14008ec00(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  ulonglong uVar2;
  undefined2 *puVar3;
  
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_14008f510(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    uVar1 = *param_1;
    puVar3 = (undefined2 *)param_1[1];
    if (puVar3 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar3 + 0xc) = 7;
      *(undefined8 *)(puVar3 + 8) = 0;
      *puVar3 = 0;
      FUN_1400015e0(puVar3,uVar1 + ((longlong)(param_2 - uVar2) / 0x28) * 0x28,0,0xffffffffffffffff)
      ;
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14008f510(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    puVar3 = (undefined2 *)param_1[1];
    if (puVar3 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar3 + 0xc) = 7;
      *(undefined8 *)(puVar3 + 8) = 0;
      *puVar3 = 0;
      FUN_1400015e0(puVar3,param_2,0,0xffffffffffffffff);
    }
  }
  param_1[1] = param_1[1] + 0x28;
  return;
}



void FUN_14008ed00(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 5;
  if (0x3333333333333333U - 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 (0x3333333333333333 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14008dfa0(param_1,uVar2);
  }
  return;
}



longlong * FUN_14008edb0(longlong *param_1,longlong *param_2,longlong *param_3,longlong *param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  uint *puVar3;
  ulonglong uVar4;
  uint *puVar5;
  uint *puVar6;
  ulonglong uVar7;
  ulonglong uStack_40;
  ulonglong uStack_30;
  
  puVar3 = (uint *)*param_1;
  uVar1 = param_1[4];
  uStack_40 = 0;
  puVar6 = puVar3;
  if (uVar1 != 0) {
    uVar4 = (*param_3 - (longlong)puVar3 >> 2) * 0x20 + param_3[1];
    if (((longlong)uVar4 < 0) && (uVar4 != 0)) {
      lVar2 = (-uVar4 - 1 >> 5) * -4 + -4;
    }
    else {
      lVar2 = (uVar4 >> 5) * 4;
    }
    puVar6 = (uint *)((longlong)puVar3 + lVar2);
    uStack_40 = (ulonglong)((uint)uVar4 & 0x1f);
  }
  uStack_30 = 0;
  puVar5 = puVar3;
  if (uVar1 != 0) {
    uVar4 = (*param_4 - (longlong)puVar3 >> 2) * 0x20 + param_4[1];
    if (((longlong)uVar4 < 0) && (uVar4 != 0)) {
      lVar2 = (-uVar4 - 1 >> 5) * -4 + -4;
    }
    else {
      lVar2 = (uVar4 >> 5) * 4;
    }
    puVar5 = (uint *)((longlong)puVar3 + lVar2);
    uStack_30 = (ulonglong)((uint)uVar4 & 0x1f);
  }
  uVar4 = ((longlong)puVar6 - (longlong)puVar3 >> 2) * 0x20 + uStack_40;
  if ((puVar6 != puVar5) || (uStack_40 != uStack_30)) {
    uVar7 = 0;
    if (uVar1 != 0) {
      if (((longlong)uVar1 < 0) && (uVar1 != 0)) {
        lVar2 = (-uVar1 - 1 >> 5) * -4 + -4;
      }
      else {
        lVar2 = (uVar1 >> 5) * 4;
      }
      puVar3 = (uint *)((longlong)puVar3 + lVar2);
      uVar7 = (ulonglong)((uint)uVar1 & 0x1f);
    }
    while ((puVar5 != puVar3 || (uStack_30 != uVar7))) {
      if ((*puVar5 & 1 << ((byte)uStack_30 & 0x1f)) == 0) {
        *puVar6 = *puVar6 & ~(1 << ((byte)uStack_40 & 0x1f));
      }
      else {
        *puVar6 = *puVar6 | 1 << ((byte)uStack_40 & 0x1f);
      }
      if (uStack_40 < 0x1f) {
        uStack_40 = uStack_40 + 1;
      }
      else {
        uStack_40 = 0;
        puVar6 = puVar6 + 1;
      }
      if (uStack_30 < 0x1f) {
        uStack_30 = uStack_30 + 1;
      }
      else {
        uStack_30 = 0;
        puVar5 = puVar5 + 1;
      }
    }
    FUN_14008f850(param_1,uStack_40 + ((longlong)puVar6 - *param_1 >> 2) * 0x20);
  }
  if (((longlong)uVar4 < 0) && (uVar4 != 0)) {
    lVar2 = (-uVar4 - 1 >> 5) * -4 + -4;
  }
  else {
    lVar2 = (uVar4 >> 5) * 4;
  }
  *param_2 = *param_1 + lVar2;
  param_2[1] = (ulonglong)((uint)uVar4 & 0x1f);
  return param_2;
}



void FUN_14008f040(longlong *param_1,undefined8 param_2,longlong param_3,char param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  uint *local_18;
  
  uVar4 = FUN_14008f630();
  lVar2 = *param_1;
  uVar1 = uVar4 + param_3;
  if (((longlong)uVar1 < 0) && (uVar1 != 0)) {
    lVar5 = (-uVar1 - 1 >> 5) * -4 + -4;
  }
  else {
    lVar5 = (uVar1 >> 5) * 4;
  }
  if (((longlong)uVar4 < 0) && (uVar4 != 0)) {
    lVar6 = (-uVar4 - 1 >> 5) * -4 + -4;
  }
  else {
    lVar6 = (uVar4 >> 5) * 4;
  }
  local_18 = (uint *)(lVar2 + lVar6);
  uVar4 = (ulonglong)((uint)uVar4 & 0x1f);
  while ((local_18 != (uint *)(lVar2 + lVar5) || (uVar4 != ((uint)uVar1 & 0x1f)))) {
    uVar3 = 1 << ((byte)uVar4 & 0x1f);
    if (param_4 == '\0') {
      *local_18 = *local_18 & ~uVar3;
    }
    else {
      *local_18 = *local_18 | uVar3;
    }
    if (uVar4 < 0x1f) {
      uVar4 = uVar4 + 1;
    }
    else {
      uVar4 = 0;
      local_18 = local_18 + 1;
    }
  }
  return;
}



void FUN_14008f190(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_14008e3c0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14008e3c0(param_1,uVar2);
  }
  return;
}



void FUN_14008f210(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) / 0x56 + (param_1[1] - *param_1 >> 0x3f);
  uVar4 = (lVar2 >> 1) - (lVar2 >> 0x3f);
  if (0x17d05f417d05f41U - 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) / 0xac;
  if (uVar3 < uVar4) {
    if (0x17d05f417d05f41 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_14008e560(param_1,uVar3);
  }
  return;
}



void * FUN_14008f2c0(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x17d05f417d05f42) &&
     (pvVar1 = operator_new(param_1 * 0xac), 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_1405d3608);
}



void FUN_14008f330(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_14008e6f0(param_1,uVar2);
  }
  return;
}



void FUN_14008f3e0(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_14008e930(param_1,uVar3);
  }
  return;
}



void FUN_14008f490(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_14030db30(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14030db30(param_1,uVar2);
  }
  return;
}



void FUN_14008f510(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x28;
  if (0x666666666666666U - 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) / 0x28;
  if (uVar2 < uVar3) {
    if (0x666666666666666 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14008eb00(param_1,uVar2);
  }
  return;
}



void * FUN_14008f5c0(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_1405d3608);
}



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

{
  ulonglong uVar1;
  uint *puVar2;
  code *pcVar3;
  longlong lVar4;
  ulonglong uVar5;
  uint *local_38;
  ulonglong uStack_30;
  uint *local_28;
  ulonglong uStack_20;
  
  uVar5 = (*param_2 - *param_1 >> 2) * 0x20 + param_2[1];
  if (param_3 != 0) {
    if (-param_1[4] - 1U < param_3) {
      std::_Xlength_error("vector<bool> too long");
      pcVar3 = (code *)swi(3);
      uVar5 = (*pcVar3)();
      return uVar5;
    }
    FUN_14008f910(param_1,param_1[4] + 0x1f + param_3 >> 5);
    uVar1 = param_1[4];
    if (uVar1 == 0) {
      param_1[4] = param_3;
    }
    else {
      puVar2 = (uint *)*param_1;
      uStack_20 = 0;
      local_28 = puVar2;
      if (uVar1 != 0) {
        if (((longlong)uVar1 < 0) && (uVar1 != 0)) {
          lVar4 = (-uVar1 - 1 >> 5) * -4 + -4;
        }
        else {
          lVar4 = (uVar1 >> 5) * 4;
        }
        local_28 = (uint *)((longlong)puVar2 + lVar4);
        uStack_20 = (ulonglong)((uint)uVar1 & 0x1f);
      }
      uVar1 = uVar1 + param_3;
      param_1[4] = uVar1;
      uStack_30 = 0;
      local_38 = puVar2;
      if (uVar1 != 0) {
        if (((longlong)uVar1 < 0) && (uVar1 != 0)) {
          lVar4 = (-uVar1 - 1 >> 5) * -4 + -4;
        }
        else {
          lVar4 = (uVar1 >> 5) * 4;
        }
        local_38 = (uint *)((longlong)puVar2 + lVar4);
        uStack_30 = (ulonglong)((uint)uVar1 & 0x1f);
      }
      if (((longlong)uVar5 < 0) && (uVar5 != 0)) {
        lVar4 = (-uVar5 - 1 >> 5) * -4 + -4;
      }
      else {
        lVar4 = (uVar5 >> 5) * 4;
      }
      while (((uint *)((longlong)puVar2 + lVar4) != local_28 || (((uint)uVar5 & 0x1f) != uStack_20))
            ) {
        if (uStack_20 == 0) {
          uStack_20 = 0x1f;
          local_28 = local_28 + -1;
        }
        else {
          uStack_20 = uStack_20 - 1;
        }
        if (uStack_30 == 0) {
          uStack_30 = 0x1f;
          local_38 = local_38 + -1;
        }
        else {
          uStack_30 = uStack_30 - 1;
        }
        if ((*local_28 & 1 << ((byte)uStack_20 & 0x1f)) == 0) {
          *local_38 = *local_38 & ~(1 << ((byte)uStack_30 & 0x1f));
        }
        else {
          *local_38 = *local_38 | 1 << ((byte)uStack_30 & 0x1f);
        }
      }
    }
  }
  return uVar5;
}



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

void FUN_14008f850(longlong *param_1,ulonglong param_2)

{
  void *_Dst;
  uint *puVar1;
  void *_Src;
  ulonglong uVar2;
  
  _Src = (void *)param_1[1];
  uVar2 = param_2 + 0x1f >> 5;
  if ((uVar2 < (ulonglong)((longlong)_Src - *param_1 >> 2)) &&
     (_Dst = (void *)(*param_1 + uVar2 * 4), _Dst != _Src)) {
    memmove(_Dst,_Src,0);
    param_1[1] = (longlong)_Dst;
  }
  param_1[4] = param_2;
  if ((param_2 & 0x1f) != 0) {
    puVar1 = (uint *)(*param_1 + -4 + uVar2 * 4);
    *puVar1 = *puVar1 & (1 << ((byte)param_2 & 0x1f)) - 1U;
  }
  return;
}



void FUN_14008f910(longlong *param_1,ulonglong param_2)

{
  void *_Dst;
  void *_Src;
  ulonglong uVar1;
  undefined4 local_18 [4];
  
  _Src = (void *)param_1[1];
  local_18[0] = 0;
  uVar1 = (longlong)_Src - *param_1 >> 2;
  if (param_2 <= uVar1) {
    if ((param_2 < uVar1) && (_Dst = (void *)(*param_1 + param_2 * 4), _Dst != _Src)) {
      memmove(_Dst,_Src,0);
      param_1[1] = (longlong)_Dst;
    }
    return;
  }
  FUN_14008f9a0(param_1,_Src,param_2 - uVar1,local_18);
  return;
}



void FUN_14008f9a0(longlong *param_1,undefined4 *param_2,ulonglong param_3,undefined4 *param_4)

{
  size_t _Size;
  undefined4 uVar1;
  code *pcVar2;
  longlong lVar3;
  void *pvVar4;
  void *pvVar5;
  longlong lVar6;
  ulonglong uVar7;
  undefined4 *puVar8;
  void *_Src;
  
  if (param_3 != 0) {
    pvVar4 = (void *)param_1[1];
    lVar3 = *param_1;
    lVar6 = (longlong)pvVar4 - lVar3 >> 2;
    if (0x3fffffffffffffffU - lVar6 < param_3) {
      std::_Xlength_error("vector<T> too long");
      pcVar2 = (code *)swi(3);
      (*pcVar2)();
      return;
    }
    uVar7 = lVar6 + param_3;
    if ((ulonglong)(param_1[2] - lVar3 >> 2) < uVar7) {
      lVar3 = FUN_140056ac0(param_1,uVar7,lVar3,uVar7,0xfffffffffffffffe);
      pvVar4 = (void *)FUN_14008d1e0(lVar3);
      lVar6 = (longlong)param_2 - *param_1 >> 2;
      puVar8 = (undefined4 *)((longlong)pvVar4 + lVar6 * 4);
      for (uVar7 = param_3; uVar7 != 0; uVar7 = uVar7 - 1) {
        *puVar8 = *param_4;
        puVar8 = puVar8 + 1;
      }
      memmove(pvVar4,(void *)*param_1,(longlong)param_2 - *param_1 & 0xfffffffffffffffc);
      memmove((void *)((longlong)pvVar4 + (lVar6 + param_3) * 4),param_2,
              param_1[1] - (longlong)param_2 & 0xfffffffffffffffc);
      pvVar5 = (void *)*param_1;
      lVar6 = param_1[1];
      if (pvVar5 != (void *)0x0) {
        operator_delete(pvVar5);
      }
      param_1[2] = (longlong)((longlong)pvVar4 + lVar3 * 4);
      param_1[1] = (longlong)((longlong)pvVar4 + (param_3 + (lVar6 - (longlong)pvVar5 >> 2)) * 4);
      *param_1 = (longlong)pvVar4;
    }
    else if ((ulonglong)((longlong)pvVar4 - (longlong)param_2 >> 2) < param_3) {
      uVar1 = *param_4;
      memmove(param_2 + param_3,param_2,((longlong)pvVar4 - (longlong)param_2 >> 2) * 4);
      puVar8 = (undefined4 *)param_1[1];
      for (lVar3 = param_3 - ((longlong)puVar8 - (longlong)param_2 >> 2); lVar3 != 0;
          lVar3 = lVar3 + -1) {
        *puVar8 = uVar1;
        puVar8 = puVar8 + 1;
      }
      param_1[1] = param_1[1] + param_3 * 4;
      lVar3 = param_1[1];
      for (; param_2 != (undefined4 *)(lVar3 + param_3 * -4); param_2 = param_2 + 1) {
        *param_2 = uVar1;
      }
    }
    else {
      uVar1 = *param_4;
      _Src = (void *)((longlong)pvVar4 + param_3 * -4);
      _Size = ((longlong)pvVar4 - (longlong)_Src >> 2) * 4;
      pvVar5 = memmove(pvVar4,_Src,_Size);
      param_1[1] = (longlong)((longlong)pvVar5 + _Size);
      lVar3 = (longlong)_Src - (longlong)param_2 >> 2;
      memmove((void *)((longlong)pvVar4 + lVar3 * -4),param_2,lVar3 * 4);
      puVar8 = param_2;
      if (param_2 != param_2 + param_3) {
        do {
          *puVar8 = uVar1;
          puVar8 = puVar8 + 1;
        } while (puVar8 != param_2 + param_3);
      }
    }
  }
  return;
}



undefined4 * FUN_14008fc00(undefined2 *param_1,undefined2 *param_2,undefined4 *param_3)

{
  undefined2 *puVar1;
  undefined2 *puVar2;
  undefined4 *puVar3;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0xb;
    puVar3 = param_3;
    do {
      *(undefined2 *)(puVar3 + 5) = puVar2[-1];
      *(undefined2 *)((longlong)puVar3 + 0x16) = *puVar2;
      *puVar3 = *(undefined4 *)(puVar2 + -0xb);
      puVar3[1] = *(undefined4 *)(puVar2 + -9);
      puVar3[2] = *(undefined4 *)(puVar2 + -7);
      puVar3[3] = *(undefined4 *)(puVar2 + -5);
      puVar3[6] = *(undefined4 *)(puVar2 + 1);
      *(undefined2 *)(puVar3 + 7) = puVar2[3];
      puVar3[8] = *(undefined4 *)(puVar2 + 5);
      puVar3[9] = *(undefined4 *)(puVar2 + 7);
      *(undefined2 *)(puVar3 + 10) = puVar2[9];
      puVar3[0xc] = *(undefined4 *)(puVar2 + 0xd);
      puVar3[0xd] = *(undefined4 *)(puVar2 + 0xf);
      puVar3[0xe] = *(undefined4 *)(puVar2 + 0x11);
      puVar3[0xf] = *(undefined4 *)(puVar2 + 0x13);
      puVar3[0x10] = *(undefined4 *)(puVar2 + 0x15);
      puVar3[0x11] = *(undefined4 *)(puVar2 + 0x17);
      puVar3[0xb] = *(undefined4 *)(puVar2 + 0xb);
      *(undefined2 *)(puVar3 + 0x12) = puVar2[0x19];
      puVar3[0x13] = *(undefined4 *)(puVar2 + 0x1b);
      puVar3[0x14] = *(undefined4 *)(puVar2 + 0x1d);
      puVar3[0x15] = *(undefined4 *)(puVar2 + 0x1f);
      puVar3[0x16] = *(undefined4 *)(puVar2 + 0x21);
      puVar3[0x17] = *(undefined4 *)(puVar2 + 0x23);
      puVar3[0x18] = *(undefined4 *)(puVar2 + 0x25);
      *(undefined1 *)(puVar3 + 0x19) = *(undefined1 *)(puVar2 + 0x27);
      *(undefined1 *)((longlong)puVar3 + 0x65) = *(undefined1 *)((longlong)puVar2 + 0x4f);
      *(undefined1 *)((longlong)puVar3 + 0x66) = *(undefined1 *)(puVar2 + 0x28);
      puVar3[0x1a] = *(undefined4 *)(puVar2 + 0x29);
      *(undefined2 *)(puVar3 + 0x1b) = puVar2[0x2b];
      *(undefined2 *)((longlong)puVar3 + 0x6e) = puVar2[0x2c];
      puVar3[0x1c] = *(undefined4 *)(puVar2 + 0x2d);
      *(undefined2 *)(puVar3 + 0x1f) = puVar2[0x33];
      puVar3[0x20] = *(undefined4 *)(puVar2 + 0x35);
      puVar3[0x21] = *(undefined4 *)(puVar2 + 0x37);
      puVar3[0x22] = *(undefined4 *)(puVar2 + 0x39);
      puVar3[0x23] = *(undefined4 *)(puVar2 + 0x3b);
      puVar3[0x24] = *(undefined4 *)(puVar2 + 0x3d);
      *(undefined2 *)(puVar3 + 0x25) = puVar2[0x3f];
      *(undefined2 *)((longlong)puVar3 + 0x96) = puVar2[0x40];
      puVar3[0x26] = *(undefined4 *)(puVar2 + 0x41);
      puVar3[0x27] = *(undefined4 *)(puVar2 + 0x43);
      param_3 = puVar3 + 0x2b;
      puVar3[0x28] = *(undefined4 *)(puVar2 + 0x45);
      puVar3[0x29] = *(undefined4 *)(puVar2 + 0x47);
      puVar3[0x1a] = *(undefined4 *)(puVar2 + 0x29);
      puVar3[0x2a] = *(undefined4 *)(puVar2 + 0x49);
      puVar1 = puVar2 + 0x4b;
      puVar2 = puVar2 + 0x56;
      puVar3 = param_3;
    } while (puVar1 != param_2);
  }
  return param_3;
}



undefined4 * FUN_14008fdb0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined4 *)((longlong)param_1 + 5)) {
    if (param_3 != (undefined4 *)0x0) {
      *param_3 = *param_1;
      *(undefined1 *)(param_3 + 1) = *(undefined1 *)(param_1 + 1);
    }
    param_3 = (undefined4 *)((longlong)param_3 + 5);
  }
  return param_3;
}



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

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



undefined4 * FUN_14008fe50(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 7) {
    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];
      param_3[5] = param_1[5];
      param_3[6] = param_1[6];
    }
    param_3 = param_3 + 7;
  }
  return param_3;
}



undefined4 * FUN_14008feb0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 6) {
    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];
      param_3[5] = param_1[5];
    }
    param_3 = param_3 + 6;
  }
  return param_3;
}



undefined2 * FUN_14008ff10(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_14008ff90(param_3,param_1);
    }
    param_3 = param_3 + 0x14;
  }
  return param_3;
}



undefined8 * FUN_14008ff90(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;
}



undefined4 * FUN_140090020(undefined4 *param_1,undefined4 *param_2)

{
  *(undefined2 *)(param_1 + 5) = *(undefined2 *)(param_2 + 5);
  *(undefined2 *)((longlong)param_1 + 0x16) = *(undefined2 *)((longlong)param_2 + 0x16);
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  param_1[3] = param_2[3];
  param_1[6] = param_2[6];
  *(undefined2 *)(param_1 + 7) = *(undefined2 *)(param_2 + 7);
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  *(undefined2 *)(param_1 + 10) = *(undefined2 *)(param_2 + 10);
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0xb] = param_2[0xb];
  *(undefined2 *)(param_1 + 0x12) = *(undefined2 *)(param_2 + 0x12);
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  param_1[0x16] = param_2[0x16];
  param_1[0x17] = param_2[0x17];
  param_1[0x18] = param_2[0x18];
  *(undefined1 *)(param_1 + 0x19) = *(undefined1 *)(param_2 + 0x19);
  *(undefined1 *)((longlong)param_1 + 0x65) = *(undefined1 *)((longlong)param_2 + 0x65);
  *(undefined1 *)((longlong)param_1 + 0x66) = *(undefined1 *)((longlong)param_2 + 0x66);
  param_1[0x1a] = param_2[0x1a];
  *(undefined2 *)(param_1 + 0x1b) = *(undefined2 *)(param_2 + 0x1b);
  *(undefined2 *)((longlong)param_1 + 0x6e) = *(undefined2 *)((longlong)param_2 + 0x6e);
  param_1[0x1c] = param_2[0x1c];
  *(undefined2 *)(param_1 + 0x1f) = *(undefined2 *)(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];
  *(undefined2 *)(param_1 + 0x25) = *(undefined2 *)(param_2 + 0x25);
  *(undefined2 *)((longlong)param_1 + 0x96) = *(undefined2 *)((longlong)param_2 + 0x96);
  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[0x1a] = param_2[0x1a];
  param_1[0x2a] = param_2[0x2a];
  return param_1;
}



// Library Function - Multiple Matches With Same Base Name
//  public: __cdecl std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class
// std::allocator<unsigned short> >::basic_string<unsigned short,struct std::char_traits<unsigned
// short>,class std::allocator<unsigned short> >(class std::basic_string<unsigned short,struct
// std::char_traits<unsigned short>,class std::allocator<unsigned short> > const & __ptr64) __ptr64
//  public: __cdecl std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
// std::allocator<wchar_t> >::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
// std::allocator<wchar_t> >(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
// std::allocator<wchar_t> > const & __ptr64) __ptr64
// 
// Libraries: Visual Studio 2010 Release, Visual Studio 2012 Release

undefined2 * basic_string<>(undefined2 *param_1,undefined8 param_2)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff);
  return param_1;
}



undefined8
FUN_1400901d0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  char cVar3;
  ulonglong uVar4;
  short *psVar5;
  short *psVar6;
  short *local_res8;
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res8 = (short *)PTR_DAT_1405d8010;
  cVar3 = FUN_140385220(param_1,&local_res8);
  if (cVar3 != '\0') {
    psVar5 = local_res8;
    if (local_res8 == (short *)0x0) {
      psVar5 = (short *)PTR_DAT_1405d8010;
    }
    uVar4 = 0xffffffffffffffff;
    psVar6 = psVar5;
    do {
      if (uVar4 == 0) break;
      uVar4 = uVar4 - 1;
      sVar2 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_2,psVar5,~uVar4 - 1,param_4,uVar7);
  }
  psVar5 = local_res8;
  if (((local_res8 != (short *)0x0) && (local_res8 != (short *)PTR_DAT_1405d8010)) &&
     (psVar6 = local_res8 + -4, psVar6 != (short *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar1 = (int *)(psVar5 + -2);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(psVar6);
    }
    FUN_14034edd0(uVar7);
  }
  return param_1;
}



longlong FUN_1400902a0(longlong param_1)

{
  FUN_14000a170();
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return param_1;
}



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

undefined8 FUN_1400902d0(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_1405d84f0 ^ (ulonglong)auStack_48;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  local_1c = 0;
  uVar1 = FUN_1403840e0(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_140090370(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_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_1400179d0(lVar2,iVar1 + 0x10);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_14000d3f0(lVar4 + iVar1,param_2,0x10);
    goto LAB_14009043a;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_14034f420(local_68,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 0x10;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_14000d3f0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),param_2,0x10);
LAB_14009043a:
  FUN_140017b00(param_1);
  return;
}



undefined8 FUN_140090460(void)

{
  return 0x332c;
}



undefined8 FUN_140090470(void)

{
  return 0x3336;
}



undefined1
FUN_140090480(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x332d);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_QUEST_ITEM_RESULT",0x332d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x332d);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_QUEST_ITEM_RESULT",0x332d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090640(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x332e);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_CHEAT_CHECK_HPMP",0x332e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090760(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x332e);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_CHEAT_CHECK_HPMP",0x332e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090880(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x332f);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_CHEAT_MYLOBBYINFO",0x332f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090980(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x332f);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_CHEAT_MYLOBBYINFO",0x332f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090a90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3330);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_KICK",0x3330);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3330);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_KICK",0x3330);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3331);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_QUEST_INFO",0x3331);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x3331);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_ACK_QUEST_INFO",0x3331);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090f00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3332);
  FUN_140058870(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))(param_1,local_res10,1,param_3,local_30,L"PT_NOTICE",0x3332)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140090ff0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3332);
  FUN_140058870(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NOTICE",0x3332);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400910e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3333);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STOP_SAY",0x3333);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400911c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3333);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STOP_SAY",0x3333);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400912a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3334);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STOP_USE",0x3334);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140091380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3334);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STOP_USE",0x3334);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140091460(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x3335);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_EQUIP_ITEM",0x3335);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x3335);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_EQUIP_ITEM",0x3335);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}


/*
Unable to decompile 'FUN_140091690'
Cause: Exception while decompiling 140091690: 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::CheatS2cProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1400a4350(undefined8 *param_1)

{
  *param_1 = RNP::CheatS2cProxy::vftable;
  FUN_140385b20();
  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::CheatC2sStub::vftable;
  FUN_140388ea0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1400a43a0(undefined8 *param_1)

{
  *param_1 = RNP::CheatC2sStub::vftable;
  FUN_140388ea0();
  return;
}



undefined8 FUN_1400a43b0(void)

{
  return 40000;
}



undefined1
FUN_1400a43c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c41);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DAMAGE_ONE_TIME_PASS",0x9c41);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a44b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c41);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DAMAGE_ONE_TIME_PASS",0x9c41);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a45b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c42);
  FUN_1400d3f10(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENEMY_PACKET_GROUP",0x9c42);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a4690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c42);
  FUN_1400d3f10(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENEMY_PACKET_GROUP",0x9c42);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a4770(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c43);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_GIVE_UP_RELEASE",0x9c43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a4830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c43);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_GIVE_UP_RELEASE",0x9c43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a4900(longlong *param_1,undefined4 param_2,undefined8 param_3,int *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c44);
  FUN_140058470(local_30,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_140058870(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_4 + 2));
  }
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_DAMAGE",0x9c44);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a4a50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             int *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c44);
  FUN_140058470(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_5 + 2));
  }
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PLAYER_DAMAGE",0x9c44);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a4ba0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c45);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_USE_SKILL",0x9c45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a4ca0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c45);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_USE_SKILL",0x9c45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a4db0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c46);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_USE_SKILL_ATTACK_MOTION",
                     0x9c46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a4ef0(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 *param_9,undefined1 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c46);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_USE_SKILL_ATTACK_MOTION",
                     0x9c46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a5040(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c47);
  FUN_140058470(local_40,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_140058870(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"PT_PLAYER_SUCKING",0x9c47);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a5140(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c47);
  FUN_140058470(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(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"PT_PLAYER_SUCKING",0x9c47);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a5250(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c48);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_TRIGGER_ACTION",0x9c48);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a5330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c48);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_TRIGGER_ACTION",0x9c48);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a5410(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c49);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATUS_SET",0x9c49);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a5550(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c49);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATUS_SET",0x9c49);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a56a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4a);
  FUN_140017c50(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_TARGET_MOVE",0x9c4a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a57b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4a);
  FUN_140017c50(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_TARGET_MOVE",0x9c4a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a58d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4b);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_TARGET_MOVE_M",0x9c4b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a5a10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4b);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058570(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_TARGET_MOVE_M",0x9c4b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a5b60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4c);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,param_6[1]);
  FUN_140058870(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_POSITION_M",0x9c4c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a5ca0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4c);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_POSITION_M",0x9c4c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4d);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_30,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_EQUIP_INFO",0x9c4d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a5f90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,longlong *param_6,longlong *param_7,longlong *param_8)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c4d);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PLAYER_EQUIP_INFO",0x9c4d);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a6140(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4e);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_ACTIVE_SKILL_BUFF",0x9c4e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a6270(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4e);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_ACTIVE_SKILL_BUFF",0x9c4e)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a63b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined2 *param_6,undefined4 *param_7,undefined1 *param_8,
             undefined4 *param_9,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,param_11[1]);
  FUN_140058570(local_30,param_11[2]);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,param_12[1]);
  FUN_140058570(local_30,param_12[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_SKILL_ADD_EFFECT",0x9c4f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a6540(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined2 *param_7,undefined4 *param_8,
             undefined1 *param_9,undefined4 *param_10,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c4f);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,param_12[1]);
  FUN_140058570(local_30,param_12[2]);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,param_13[1]);
  FUN_140058570(local_30,param_13[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_SKILL_ADD_EFFECT",0x9c4f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a6710(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined1 *param_7,undefined4 *param_8,
             undefined2 *param_9,undefined4 *param_10,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c50);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,param_12[1]);
  FUN_140058570(local_30,param_12[2]);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,param_13[1]);
  FUN_140058570(local_30,param_13[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_PUSH_ADD_EFFECT",0x9c50);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c50);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058870(local_40,*param_8);
  FUN_140058470(local_40,*param_9);
  FUN_140017c50(local_40,*param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058870(local_40,*param_12);
  FUN_140058570(local_40,*param_13);
  FUN_140058570(local_40,param_13[1]);
  FUN_140058570(local_40,param_13[2]);
  FUN_140058570(local_40,*param_14);
  FUN_140058570(local_40,param_14[1]);
  FUN_140058570(local_40,param_14[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PLAYER_PUSH_ADD_EFFECT",0x9c50);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a6a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c51);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_END_ADD_EFFECT",0x9c51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a6b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c51);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_END_ADD_EFFECT",0x9c51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c52);
  FUN_140058870(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  FUN_140058470(local_30,param_9[1] - *param_9 >> 2);
  puVar2 = (undefined4 *)*param_9;
  if (puVar2 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_9[1]);
  }
  FUN_14008d250(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_DAMAGE_UI",0x9c52);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c52);
  FUN_140058870(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058870(local_40,*param_8);
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar2 = (undefined4 *)*param_9;
  if (puVar2 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_9[1]);
  }
  FUN_140058470(local_40,param_10[1] - *param_10 >> 2);
  puVar2 = (undefined4 *)*param_10;
  if (puVar2 != (undefined4 *)param_10[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_10[1]);
  }
  FUN_14008d250(local_40,param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PLAYER_DAMAGE_UI",0x9c52);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a6fe0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c53);
  FUN_140058870(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_COUNTER_CRITICAL",0x9c53);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a70e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c53);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_COUNTER_CRITICAL",0x9c53);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a71f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c54);
  FUN_140058870(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_JUST_GUARD",0x9c54);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c54);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_JUST_GUARD",0x9c54);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a73e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c55);
  FUN_140058870(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_DAMAGE_UI_BY_SERVER",0x9c55)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7500(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c55);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_DAMAGE_UI_BY_SERVER",
                     0x9c55);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7620(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined1 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c56);
  FUN_140058870(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_ANOMALY_UI_BY_SERVER",0x9c56
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7740(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5,undefined1 *param_6,undefined1 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c56);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_ANOMALY_UI_BY_SERVER",
                     0x9c56);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7860(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c57);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_EFFECT_STACK",0x9c57);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c57);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_EFFECT_STACK",0x9c57);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a7a50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c58);
  FUN_140122f50(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_SHOOT",0x9c58);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7b30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c58);
  FUN_140122f50(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_SHOOT",0x9c58);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7c10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c59);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_ACTIVE_SKILL_ONE_SELF",
                     0x9c59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c59);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_ACTIVE_SKILL_ONE_SELF",
                     0x9c59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5a);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_ATTACK_SPEED_M",0x9c5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a7f40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5a);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_ATTACK_SPEED_M",0x9c5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8040(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5b);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_PVP_STATE",0x9c5b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8130(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5b);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_PVP_STATE",0x9c5b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a8230(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_PVP_SKILL_DAMAGE",0x9c5c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a82f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_PVP_SKILL_DAMAGE",0x9c5c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a83c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5d);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_PVP_DEATH",0x9c5d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a84a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5d);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_PVP_DEATH",0x9c5d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8580(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5e);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STOP",0x9c5e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5e);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STOP",0x9c5e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8770(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5f);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_SET_DEATH",0x9c5f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8860(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c5f);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_SET_DEATH",0x9c5f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8960(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c60);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_SET_STAY",0x9c60);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8ab0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c60);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_SET_STAY",0x9c60);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8c20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c61);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_SET_STAY_M",0x9c61);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8d70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c61);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_SET_STAY_M",0x9c61);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a8ee0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined1 *param_7,undefined4 *param_8,
             undefined1 *param_9,undefined4 *param_10,undefined1 *param_11,undefined4 *param_12,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c62);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,param_12[1]);
  FUN_140058570(local_30,param_12[2]);
  FUN_140058870(local_30,*param_13);
  FUN_140058870(local_30,param_13[1]);
  FUN_140058870(local_30,param_13[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_SET_DOWN",0x9c62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c62);
  FUN_140058470(local_40,*param_5);
  FUN_140017c50(local_40,*param_6);
  FUN_140017c50(local_40,*param_7);
  FUN_140058870(local_40,*param_8);
  FUN_140058470(local_40,*param_9);
  FUN_140058870(local_40,*param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058870(local_40,*param_12);
  FUN_140058570(local_40,*param_13);
  FUN_140058570(local_40,param_13[1]);
  FUN_140058570(local_40,param_13[2]);
  FUN_140058870(local_40,*param_14);
  FUN_140058870(local_40,param_14[1]);
  FUN_140058870(local_40,param_14[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PLAYER_STATE_SET_DOWN",0x9c62);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a9230(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c63);
  FUN_1401226c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_SET",0x9c63);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a9310(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c63);
  FUN_1401226c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_SET",0x9c63);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a93f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c64);
  FUN_1401226c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_SET_PVP",0x9c64);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a94d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c64);
  FUN_1401226c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_SET_PVP",0x9c64);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400a95b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c65);
  FUN_140122ac0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_ATTACK",0x9c65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a9690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c65);
  FUN_140122ac0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_ATTACK",0x9c65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a9770(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c66);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_TRIGGER_ACTION",0x9c66
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a98e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c66);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,param_9[1]);
  FUN_140058870(local_30,param_9[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_TRIGGER_ACTION",
                     0x9c66);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a9a60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined4 *param_7,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c67);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,param_9[1]);
  FUN_140058570(local_30,param_9[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_DUMP",0x9c67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c67);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,param_9[1]);
  FUN_140058870(local_30,param_9[2]);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,param_10[1]);
  FUN_140058570(local_30,param_10[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_DUMP",0x9c67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a9db0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c68);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_SET_M",0x9c68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400a9f20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c68);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,param_9[1]);
  FUN_140058870(local_30,param_9[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_SET_M",0x9c68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aa0a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c69);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,param_6[1]);
  FUN_140058870(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_POSITION",0x9c69);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aa1f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined1 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c69);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_POSITION",0x9c69);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aa360(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6a);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATE_POLYMORPH_END",0x9c6a)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aa440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6a);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATE_POLYMORPH_END",
                     0x9c6a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aa520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6b);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_SET_PUSH",0x9c6b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aa660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6b);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_SET_PUSH",0x9c6b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aa7b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6c);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,param_4[1]);
  FUN_140058570(local_30,param_4[2]);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_PVP_PUSH",0x9c6c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aa8d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6c);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_PVP_PUSH",0x9c6c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aaa10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6d);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_DEBUG_ADD",0x9c6d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aab60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6d);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_DEBUG_ADD",0x9c6d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aacc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6e);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_DEBUG_REMOVE",0x9c6e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aada0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6e);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_DEBUG_REMOVE",0x9c6e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aae80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6f);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,param_9[1]);
  FUN_140058870(local_30,param_9[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_DEBUG_INFO",0x9c6f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab000(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6,undefined2 *param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c6f);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,param_9[1]);
  FUN_140058570(local_30,param_9[2]);
  FUN_140058870(local_30,*param_10);
  FUN_140058870(local_30,param_10[1]);
  FUN_140058870(local_30,param_10[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_DEBUG_INFO",0x9c6f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c70);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_END_CONDITION",0x9c70);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c70);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_END_CONDITION",0x9c70);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c71);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENEMY_DEBUG_ADD",0x9c71);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab4d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c71);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENEMY_DEBUG_ADD",0x9c71);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab630(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c72);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENEMY_DEBUG_REMOVE",0x9c72);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab710(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c72);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENEMY_DEBUG_REMOVE",0x9c72);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab7f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c73);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,param_9[1]);
  FUN_140058870(local_30,param_9[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENEMY_DEBUG_INFO",0x9c73);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ab970(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6,undefined2 *param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c73);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,param_9[1]);
  FUN_140058570(local_30,param_9[2]);
  FUN_140058870(local_30,*param_10);
  FUN_140058870(local_30,param_10[1]);
  FUN_140058870(local_30,param_10[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENEMY_DEBUG_INFO",0x9c73);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400abb00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *param_5,undefined1 *param_6,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c74);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,param_6[1]);
  FUN_140058870(local_30,param_6[2]);
  FUN_140385940(local_30,param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_PLAYER_CHARGE_AUTO_MOVE_TURN_MOTION",0x9c74);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c74);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  FUN_140385940(local_30,param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_PLAYER_CHARGE_AUTO_MOVE_TURN_MOTION",0x9c74);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400abdb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *param_5,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c75);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_PLAYER_CHARGE_AUTO_MOVE_TURN_ATTACK",0x9c75);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400abec0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6,undefined8 param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c75);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140385940(local_30,param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_PLAYER_CHARGE_AUTO_MOVE_TURN_ATTACK",0x9c75);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400abfe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c76);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MOVE_EFFECT_POSITION",0x9c76);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ac0f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c76);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MOVE_EFFECT_POSITION",0x9c76);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ac210(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 *param_5,undefined2 *param_6,undefined4 *param_7,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c77);
  FUN_140058470(local_30,*param_4);
  FUN_140058770(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SHOOT_STATE",0x9c77);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c77);
  FUN_140058470(local_30,*param_5);
  FUN_140058770(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,param_9[1]);
  FUN_140058870(local_30,param_9[2]);
  FUN_140058870(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SHOOT_STATE",0x9c77);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ac520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c78);
  FUN_140058770(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BALL_SHOOT",0x9c78);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ac600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c78);
  FUN_140058770(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BALL_SHOOT",0x9c78);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ac6e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *param_5,undefined1 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c79);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_CONDITION",0x9c79);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c79);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_CONDITION",0x9c79);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ac950(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7a);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_END_CONDITION_PLAYER",0x9c7a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aca70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6,undefined1 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7a);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_END_CONDITION_PLAYER",0x9c7a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400acb90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7b);
  FUN_140058470(local_30,*param_4);
  FUN_140058770(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SHOOT_GUIDED_CHANGE_TARGET",0x9c7b)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400acc90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7b);
  FUN_140058470(local_30,*param_5);
  FUN_140058770(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SHOOT_GUIDED_CHANGE_TARGET",
                     0x9c7b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400acda0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7c);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENEMY_DEBUG_AI_INFO",0x9c7c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400acef0(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,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7c);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENEMY_DEBUG_AI_INFO",0x9c7c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad040(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7d);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RISING_DAMAGE_ENABLE",0x9c7d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7d);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RISING_DAMAGE_ENABLE",0x9c7d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad250(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7e);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CANT_ATTACK_TYPE",0x9c7e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7e);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CANT_ATTACK_TYPE",0x9c7e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad460(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7f);
  FUN_140058470(local_30,*param_4);
  FUN_140120f40(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UPDATE_BATTLE_INFO",0x9c7f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad550(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c7f);
  FUN_140058470(local_30,*param_5);
  FUN_140120f40(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UPDATE_BATTLE_INFO",0x9c7f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad640(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c80);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_ONLINE_USER_INFO_RQ",0x9c80);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad720(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c80);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_ONLINE_USER_INFO_RQ",0x9c80);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad800(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c81);
  FUN_140058770(local_30,*param_4);
  FUN_140120f40(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_ONLINE_USER_INFO",0x9c81);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad8f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c81);
  FUN_140058770(local_30,*param_5);
  FUN_140120f40(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_ONLINE_USER_INFO",0x9c81);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ad9e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c82);
  FUN_140017c50(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_BATTLE_RANK_LIST_RQ",0x9c82);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400adac0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c82);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_BATTLE_RANK_LIST_RQ",0x9c82);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400adba0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c83);
  FUN_140017c50(local_30,*param_4);
  FUN_14004bc20(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_BATTLE_RANK_LIST",0x9c83);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400adc90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c83);
  FUN_140017c50(local_30,*param_5);
  FUN_14004bc20(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_BATTLE_RANK_LIST",0x9c83);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400add80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c84);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,param_4[1]);
  FUN_140058570(local_30,param_4[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_INIT_POS",0x9c84);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ade80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c84);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_INIT_POS",0x9c84);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c85);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058870(local_30,*param_12);
  FUN_140058870(local_30,param_12[1]);
  FUN_140058870(local_30,param_12[2]);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,param_13[1]);
  FUN_140058570(local_30,param_13[2]);
  FUN_140017c50(local_30,*param_14);
  FUN_140017c50(local_30,*param_15);
  FUN_140058870(local_30,*param_16);
  FUN_140058870(local_30,*param_17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_STATE_ATTACK",0x9c85);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c85);
  FUN_140058470(local_40,*param_5);
  FUN_140017c50(local_40,*param_6);
  FUN_140017c50(local_40,*param_7);
  FUN_140058870(local_40,*param_8);
  FUN_140058870(local_40,*param_9);
  FUN_140058470(local_40,*param_10);
  FUN_140058870(local_40,*param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058870(local_40,*param_13);
  FUN_140058870(local_40,param_13[1]);
  FUN_140058870(local_40,param_13[2]);
  FUN_140058570(local_40,*param_14);
  FUN_140058570(local_40,param_14[1]);
  FUN_140058570(local_40,param_14[2]);
  FUN_140017c50(local_40,*param_15);
  FUN_140017c50(local_40,*param_16);
  FUN_140058870(local_40,*param_17);
  FUN_140058870(local_40,*param_18);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PET_STATE_ATTACK",0x9c85);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ae380(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined1 *param_7,undefined1 *param_8,
             undefined4 *param_9,undefined1 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined2 *param_13,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c86);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_140058870(local_30,param_10[1]);
  FUN_140058870(local_30,param_10[2]);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,param_11[1]);
  FUN_140058570(local_30,param_11[2]);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,param_12[1]);
  FUN_140058570(local_30,param_12[2]);
  FUN_140017c50(local_30,*param_13);
  FUN_140017c50(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_STATE_JUMP_DOWN_ATTACK",0x9c86)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c86);
  FUN_140058470(local_40,*param_5);
  FUN_140017c50(local_40,*param_6);
  FUN_140017c50(local_40,*param_7);
  FUN_140058870(local_40,*param_8);
  FUN_140058870(local_40,*param_9);
  FUN_140058470(local_40,*param_10);
  FUN_140058870(local_40,*param_11);
  FUN_140058870(local_40,param_11[1]);
  FUN_140058870(local_40,param_11[2]);
  FUN_140058570(local_40,*param_12);
  FUN_140058570(local_40,param_12[1]);
  FUN_140058570(local_40,param_12[2]);
  FUN_140058570(local_40,*param_13);
  FUN_140058570(local_40,param_13[1]);
  FUN_140058570(local_40,param_13[2]);
  FUN_140017c50(local_40,*param_14);
  FUN_140017c50(local_40,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PET_STATE_JUMP_DOWN_ATTACK",
                     0x9c86);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ae730(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined1 *param_7,undefined4 *param_8,
             undefined1 *param_9,undefined4 *param_10,undefined1 *param_11,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c87);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  FUN_140058870(local_30,*param_12);
  FUN_140058870(local_30,param_12[1]);
  FUN_140058870(local_30,param_12[2]);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,param_13[1]);
  FUN_140058570(local_30,param_13[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_STATE_SET_DOWN",0x9c87);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c87);
  FUN_140058470(local_40,*param_5);
  FUN_140017c50(local_40,*param_6);
  FUN_140017c50(local_40,*param_7);
  FUN_140058870(local_40,*param_8);
  FUN_140058470(local_40,*param_9);
  FUN_140058870(local_40,*param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058870(local_40,*param_12);
  FUN_140058870(local_40,*param_13);
  FUN_140058870(local_40,param_13[1]);
  FUN_140058870(local_40,param_13[2]);
  FUN_140058570(local_40,*param_14);
  FUN_140058570(local_40,param_14[1]);
  FUN_140058570(local_40,param_14[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PET_STATE_SET_DOWN",0x9c87);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aea80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined1 *param_7,undefined1 *param_8,
             undefined4 *param_9,undefined1 *param_10,undefined4 *param_11,undefined1 *param_12,
             undefined4 *param_13,undefined2 *param_14,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c88);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058870(local_30,*param_12);
  FUN_140058870(local_30,param_12[1]);
  FUN_140058870(local_30,param_12[2]);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,param_13[1]);
  FUN_140058570(local_30,param_13[2]);
  FUN_140017c50(local_30,*param_14);
  FUN_140017c50(local_30,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_STATE_SET",0x9c88);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c88);
  FUN_140058470(local_40,*param_5);
  FUN_140017c50(local_40,*param_6);
  FUN_140017c50(local_40,*param_7);
  FUN_140058870(local_40,*param_8);
  FUN_140058870(local_40,*param_9);
  FUN_140058470(local_40,*param_10);
  FUN_140058870(local_40,*param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058870(local_40,*param_13);
  FUN_140058870(local_40,param_13[1]);
  FUN_140058870(local_40,param_13[2]);
  FUN_140058570(local_40,*param_14);
  FUN_140058570(local_40,param_14[1]);
  FUN_140058570(local_40,param_14[2]);
  FUN_140017c50(local_40,*param_15);
  FUN_140017c50(local_40,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PET_STATE_SET",0x9c88);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aee10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c89);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_NEXT_MOVE_POINT",0x9c89);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400aef60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c89);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_NEXT_MOVE_POINT",0x9c89);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400af0d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8a);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,param_6[1]);
  FUN_140058870(local_30,param_6[2]);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_STATE_MENACE",0x9c8a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8a);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_STATE_MENACE",0x9c8a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400af390(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8b);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_FOLLOW_OWNER",0x9c8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400af480(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8b);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_FOLLOW_OWNER",0x9c8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400af580(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8c);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_JUMP_FOLLOW_OWNER",0x9c8c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8c);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_JUMP_FOLLOW_OWNER",0x9c8c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400af7d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8d);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_PICKUP_ITEM",0x9c8d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8d);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_PICKUP_ITEM",0x9c8d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400afa20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8e);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_JUMP_PICKUP_ITEM",0x9c8e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8e);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_JUMP_PICKUP_ITEM",0x9c8e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400afc70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             int *param_5)

{
  undefined1 uVar1;
  undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c8f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_5 + 2));
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_DAMAGE",0x9c8f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400afd90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,int *param_6)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c8f);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[2] - *param_6);
  puVar2 = *(undefined1 **)param_6;
  if (puVar2 != *(undefined1 **)(param_6 + 2)) {
    do {
      FUN_140058870(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_6 + 2));
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PET_DAMAGE",0x9c8f);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400afec0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c90);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_DEATH",0x9c90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c90);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_DEATH",0x9c90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b00d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c91);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_STATUS_SET",0x9c91);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b01d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c91);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_STATUS_SET",0x9c91);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b02e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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,undefined4 *param_16,
             undefined4 *param_17,undefined4 *param_18,undefined4 *param_19,undefined4 *param_20,
             undefined4 *param_21,undefined4 *param_22,undefined4 *param_23,undefined8 *param_24)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c92);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058570(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058570(local_30,*param_18);
  FUN_140058570(local_30,*param_19);
  FUN_140058570(local_30,*param_20);
  FUN_140058570(local_30,*param_21);
  FUN_140058570(local_30,*param_22);
  FUN_140058470(local_30,*param_23);
  FUN_140058770(local_30,*param_24);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_CREATE",0x9c92);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b0520(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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,
             undefined4 *param_17,undefined4 *param_18,undefined4 *param_19,undefined4 *param_20,
             undefined4 *param_21,undefined4 *param_22,undefined4 *param_23,undefined4 *param_24,
             undefined8 *param_25)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c92);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058570(local_30,*param_15);
  FUN_140058570(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058470(local_30,*param_18);
  FUN_140058570(local_30,*param_19);
  FUN_140058570(local_30,*param_20);
  FUN_140058570(local_30,*param_21);
  FUN_140058570(local_30,*param_22);
  FUN_140058570(local_30,*param_23);
  FUN_140058470(local_30,*param_24);
  FUN_140058770(local_30,*param_25);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_CREATE",0x9c92);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c93);
  FUN_140058470(local_30,(param_4[1] - *param_4) / 0x94);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_140121840(local_30,lVar2);
      lVar2 = lVar2 + 0x94;
    } while (lVar2 != param_4[1]);
  }
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_ADD",0x9c93);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c93);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x94);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_140121840(local_40,lVar2);
      lVar2 = lVar2 + 0x94;
    } while (lVar2 != param_5[1]);
  }
  FUN_140058870(local_40,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PET_ADD",0x9c93);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b09f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c94);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_SUMMON",0x9c94);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b0af0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c94);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_SUMMON",0x9c94);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b0c00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c95);
  FUN_1400d3fe0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_SUMMON_M",0x9c95);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b0ce0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c95);
  FUN_1400d3fe0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_SUMMON_M",0x9c95);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b0dc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c96);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_CLOSE",0x9c96);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b0eb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c96);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_CLOSE",0x9c96);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b0fb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c97);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_CLOSE_M",0x9c97);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b10a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c97);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_CLOSE_M",0x9c97);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b11a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c98);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_RECOVERY",0x9c98);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c98);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_RECOVERY",0x9c98);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1390(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c99);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_LEVEL_EXP",0x9c99);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b14d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c99);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_LEVEL_EXP",0x9c99);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1620(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_INTIMACY_LEVEL_EXP",0x9c9a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1740(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9a);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_INTIMACY_LEVEL_EXP",0x9c9a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1860(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9b);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_ADD_EXP",0x9c9b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1960(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9b);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_ADD_EXP",0x9c9b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b1a70(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c9c);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_WAKE_UP_PRE_LOADING",0x9c9c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9c9c);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_WAKE_UP_PRE_LOADING",0x9c9c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1ca0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9d);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_WAKE_UP",0x9c9d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1d90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9d);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_WAKE_UP",0x9c9d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1e90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9e);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_MODE_CHANGE_REQ",0x9c9e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b1f70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9e);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_MODE_CHANGE_REQ",0x9c9e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b2050(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_MODE_CHANGE",0x9c9f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b2140(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9c9f);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_MODE_CHANGE",0x9c9f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b2240(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca0);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_RECOVERY",0x9ca0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b2320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca0);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_RECOVERY",0x9ca0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b2400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca1);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ON_ATTACK_EVENT",0x9ca1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b24f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca1);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ON_ATTACK_EVENT",0x9ca1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b25f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca2);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENEMY_REQ_ESCAPE",0x9ca2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b26d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca2);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENEMY_REQ_ESCAPE",0x9ca2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b27b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca3);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,param_5[1]);
  FUN_140058570(local_30,param_5[2]);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,param_6[1]);
  FUN_140058870(local_30,param_6[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENEMY_ESCAPE",0x9ca3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b28f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca3);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENEMY_ESCAPE",0x9ca3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b2a40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca4);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PET_LIST",0x9ca4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b2b20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PET_LIST",0x9ca4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b2c00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca5);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PET_ADD",0x9ca5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b2ce0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca5);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PET_ADD",0x9ca5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b2dc0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9ca6);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x39);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_1403a17c0(local_40,puVar2 + 1);
      FUN_140058870(local_40,*(undefined1 *)(puVar2 + 5));
      FUN_140058470(local_40,*(undefined4 *)((longlong)puVar2 + 0x15));
      FUN_140385a20(local_40,(longlong)puVar2 + 0x19);
      puVar2 = (undefined4 *)((longlong)puVar2 + 0x39);
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_ACK_PET_LIST",0x9ca6);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9ca6);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x39);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_1403a17c0(local_40,puVar2 + 1);
      FUN_140058870(local_40,*(undefined1 *)(puVar2 + 5));
      FUN_140058470(local_40,*(undefined4 *)((longlong)puVar2 + 0x15));
      FUN_140385a20(local_40,(longlong)puVar2 + 0x19);
      puVar2 = (undefined4 *)((longlong)puVar2 + 0x39);
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_ACK_PET_LIST",0x9ca6);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b3070(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca7);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_4 + 1);
  FUN_140058870(local_30,*(undefined1 *)(param_4 + 5));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_4 + 0x15));
  FUN_140385a20(local_30,(longlong)param_4 + 0x19);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_PET_LISTDATA",0x9ca7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca7);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_5 + 1);
  FUN_140058870(local_30,*(undefined1 *)(param_5 + 5));
  FUN_140058470(local_30,*(undefined4 *)((longlong)param_5 + 0x15));
  FUN_140385a20(local_30,(longlong)param_5 + 0x19);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_PET_LISTDATA",0x9ca7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b32d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca8);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PET_INVENTORY_ITEM_LIST",0x9ca8
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b33c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca8);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PET_INVENTORY_ITEM_LIST",
                     0x9ca8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b34b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca9);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_REQ_REVIVAL_PET_INVENTORY_ITEM_LIST",0x9ca9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b3590(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ca9);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_REQ_REVIVAL_PET_INVENTORY_ITEM_LIST",0x9ca9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b3670(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9caa);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,(param_7[1] - *param_7) / 0xac);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_14011a5b0(local_30,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_PET_INVENTORY_ITEM_LIST",0x9caa
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b37d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined8 param_7,longlong *param_8)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9caa);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_1403a17c0(local_40,param_7);
  FUN_140058470(local_40,(param_8[1] - *param_8) / 0xac);
  lVar2 = *param_8;
  if (lVar2 != param_8[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_ACK_PET_INVENTORY_ITEM_LIST",
                     0x9caa);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cab);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,(param_7[1] - *param_7) / 0xac);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_14011a5b0(local_30,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_7[1]);
  }
  FUN_140058470(local_30,*param_8);
  FUN_1403859e0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_ACK_REVIVAL_PET_INVENTORY_ITEM_LIST",0x9cab);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9cab);
  FUN_140058470(local_40,*param_5);
  FUN_1403a17c0(local_40,param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,(param_8[1] - *param_8) / 0xac);
  lVar2 = *param_8;
  if (lVar2 != param_8[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_8[1]);
  }
  FUN_140058470(local_40,*param_9);
  FUN_1403859e0(local_40,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,
                     L"PT_ACK_REVIVAL_PET_INVENTORY_ITEM_LIST",0x9cab);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b3c60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cac);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MOVE_PET_INVENTORY_TO_INVENTORY",
                     0x9cac);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cac);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1403a17c0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MOVE_PET_INVENTORY_TO_INVENTORY",
                     0x9cac);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b3f10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cad);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MOVE_INVENTORY_TO_PET_INVENTORY",
                     0x9cad);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cad);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1403a17c0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MOVE_INVENTORY_TO_PET_INVENTORY",
                     0x9cad);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b41c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cae);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MOVE_PET_INVEN_TO_PET_INVENTORY",
                     0x9cae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b42f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cae);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MOVE_PET_INVEN_TO_PET_INVENTORY",
                     0x9cae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4420(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9caf);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PET_REBIRTH",0x9caf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4530(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9caf);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PET_REBIRTH",0x9caf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4650(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb0);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_14011a5b0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_PET_REBIRTH",0x9cb0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4760(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb0);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_14011a5b0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_PET_REBIRTH",0x9cb0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4880(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb1);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REMOVE_PET_INVENTORY_ITEM",0x9cb1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb1);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REMOVE_PET_INVENTORY_ITEM",0x9cb1
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4a90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb2);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REMOVE_PET_INVENTORY_ITEM_ALL",
                     0x9cb2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4b80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb2);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REMOVE_PET_INVENTORY_ITEM_ALL",
                     0x9cb2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4c70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb3);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHANGE_PET_TYPE",0x9cb3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb3);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHANGE_PET_TYPE",0x9cb3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b4e60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb4);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHANGE_PET_STET",0x9cb4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b5000(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,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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHANGE_PET_STET",0x9cb4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b51a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined1 *param_6,undefined2 *param_7,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb5);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_EAT_ITEM",0x9cb5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb5);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_EAT_ITEM",0x9cb5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b5430(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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,undefined4 *param_16,
             undefined4 *param_17,undefined4 *param_18,undefined4 *param_19,undefined4 *param_20,
             undefined4 *param_21,undefined4 *param_22,undefined4 *param_23)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb6);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058570(local_30,*param_18);
  FUN_140058570(local_30,*param_19);
  FUN_140058570(local_30,*param_20);
  FUN_140058570(local_30,*param_21);
  FUN_140058570(local_30,*param_22);
  FUN_140058470(local_30,*param_23);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_STATUS_UPDATE",0x9cb6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b5660(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,undefined4 *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)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb6);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  FUN_140058470(local_30,*param_18);
  FUN_140058570(local_30,*param_19);
  FUN_140058570(local_30,*param_20);
  FUN_140058570(local_30,*param_21);
  FUN_140058570(local_30,*param_22);
  FUN_140058570(local_30,*param_23);
  FUN_140058470(local_30,*param_24);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_STATUS_UPDATE",0x9cb6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b58a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb7);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PET_GRADE",0x9cb7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b5980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb7);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PET_GRADE",0x9cb7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b5a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb8);
  FUN_140121840(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_PET_GRADE",0x9cb8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b5b50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb8);
  FUN_140121840(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_PET_GRADE",0x9cb8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b5c40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined2 *param_4,
             undefined2 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb9);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_EMOTION_START",0x9cb9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cb9);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_EMOTION_START",0x9cb9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b5e80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5,undefined2 *param_6,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cba);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_EMOTION_START_M",0x9cba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cba);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_EMOTION_START_M",0x9cba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b60f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbb);
  FUN_1403859e0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_DEATH_NOTICE",0x9cbb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbb);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_DEATH_NOTICE",0x9cbb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6300(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbc);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_EAT_OK",0x9cbc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbc);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_EAT_OK",0x9cbc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6540(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbd);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PET_HARVEST",0x9cbd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6630(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbd);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PET_HARVEST",0x9cbd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6730(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbe);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_PET_HARVEST",0x9cbe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbe);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_PET_HARVEST",0x9cbe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6940(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbf);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_DELETE",0x9cbf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6a30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cbf);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_DELETE",0x9cbf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b6b30(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9cc0);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x39);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_1403a17c0(local_40,puVar2 + 1);
      FUN_140058870(local_40,*(undefined1 *)(puVar2 + 5));
      FUN_140058470(local_40,*(undefined4 *)((longlong)puVar2 + 0x15));
      FUN_140385a20(local_40,(longlong)puVar2 + 0x19);
      puVar2 = (undefined4 *)((longlong)puVar2 + 0x39);
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_PET_DEAD_LIST",0x9cc0);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9cc0);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x39);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_1403a17c0(local_40,puVar2 + 1);
      FUN_140058870(local_40,*(undefined1 *)(puVar2 + 5));
      FUN_140058470(local_40,*(undefined4 *)((longlong)puVar2 + 0x15));
      FUN_140385a20(local_40,(longlong)puVar2 + 0x19);
      puVar2 = (undefined4 *)((longlong)puVar2 + 0x39);
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PET_DEAD_LIST",0x9cc0);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6de0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc1);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STAT_UPDATE",0x9cc1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b6f00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc1);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STAT_UPDATE",0x9cc1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b7020(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc2);
  FUN_140058470(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_STATE_MOVING_ATTACK",0x9cc2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b7110(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined2 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc2);
  FUN_140058470(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_STATE_MOVING_ATTACK",0x9cc2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b7210(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc3);
  FUN_140058870(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRIGGER_BOX_RESULT",0x9cc3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc3);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRIGGER_BOX_RESULT",0x9cc3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b7400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc4);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_REENTER",0x9cc4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b74e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_REENTER",0x9cc4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b75c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc5);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_GUILD_INFO",0x9cc5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b76d0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc5);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_GUILD_INFO",0x9cc5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b77f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc6);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_STATUS_CHECK",0x9cc6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b78d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc6);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_STATUS_CHECK",0x9cc6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b79b0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9cc7);
  FUN_140058470(local_40,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_140058870(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"PT_REQ_PLAYER_STATUS_CHECK",0x9cc7);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b7ab0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x9cc7);
  FUN_140058470(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(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"PT_REQ_PLAYER_STATUS_CHECK",0x9cc7);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b7bc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc8);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_FISHING",0x9cc8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b7d10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc8);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_FISHING",0x9cc8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b7e70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_FISHING_OFF",0x9cc9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400b7f30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cc9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_FISHING_OFF",0x9cc9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8000(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cca);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,param_6[1]);
  FUN_140058570(local_30,param_6[2]);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,param_7[1]);
  FUN_140058870(local_30,param_7[2]);
  FUN_140058470(local_30,*param_8);
  FUN_14011a5b0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_FISHING_M",0x9cca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8180(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cca);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  FUN_140058470(local_30,*param_9);
  FUN_14011a5b0(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_FISHING_M",0x9cca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8310(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ccb);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,param_8[1]);
  FUN_140058870(local_30,param_8[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_FISHING_GET_M",0x9ccb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8470(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ccb);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,param_9[1]);
  FUN_140058870(local_30,param_9[2]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_FISHING_GET_M",0x9ccb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b85f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ccc);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_PERCENT_VALUE",0x9ccc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8740(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,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ccc);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_PERCENT_VALUE",0x9ccc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8890(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ccd);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_CRITICAL",0x9ccd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ccd);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_CRITICAL",0x9ccd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cce);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PET_GHOST_REBIRTH",0x9cce);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9cce);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PET_GHOST_REBIRTH",0x9cce);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ccf);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_PET_GHOST_REBIRTH",0x9ccf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400b8d60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x9ccf);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_PET_GHOST_REBIRTH",0x9ccf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}


/*
Unable to decompile 'FUN_1400b8e60'
Cause: Exception while decompiling 1400b8e60: process: timeout

*/


void FUN_1400d3df0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 200)) {
    operator_delete(*(void **)(param_1 + 0xb0));
  }
  *(undefined8 *)(param_1 + 200) = 7;
  *(undefined8 *)(param_1 + 0xc0) = 0;
  *(undefined2 *)(param_1 + 0xb0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xa0)) {
    operator_delete(*(void **)(param_1 + 0x88));
  }
  *(undefined8 *)(param_1 + 0xa0) = 7;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined2 *)(param_1 + 0x88) = 0;
  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::CharacterStub::vftable;
  FUN_140388ea0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1400d3eb0(undefined8 *param_1)

{
  *param_1 = RNP::CharacterStub::vftable;
  FUN_140388ea0();
  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::CharacterProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1400d3f00(undefined8 *param_1)

{
  *param_1 = RNP::CharacterProxy::vftable;
  FUN_140385b20();
  return;
}



undefined8 FUN_1400d3f10(undefined8 param_1,longlong *param_2)

{
  byte bVar1;
  undefined1 *puVar2;
  ulonglong uVar3;
  undefined1 *puVar4;
  
  FUN_140058470(param_1,(param_2[1] - *param_2) / 0x10c);
  puVar2 = (undefined1 *)*param_2;
  if (puVar2 != (undefined1 *)param_2[1]) {
    do {
      bVar1 = puVar2[8];
      FUN_140058870(param_1,*puVar2);
      FUN_140058870(param_1,bVar1);
      if (bVar1 != 0) {
        puVar4 = puVar2 + 0xc;
        uVar3 = (ulonglong)(uint)bVar1;
        do {
          FUN_140058870(param_1,*puVar4);
          puVar4 = puVar4 + 1;
          uVar3 = uVar3 - 1;
        } while (uVar3 != 0);
      }
      puVar2 = puVar2 + 0x10c;
    } while (puVar2 != (undefined1 *)param_2[1]);
  }
  return param_1;
}



undefined8 FUN_1400d3fe0(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  undefined4 *puVar2;
  
  lVar1 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(param_2[1] - *param_2),8) +
          (param_2[1] - *param_2);
  FUN_140058470(param_1,(lVar1 >> 5) - (lVar1 >> 0x3f));
  puVar2 = (undefined4 *)*param_2;
  if (puVar2 != (undefined4 *)param_2[1]) {
    do {
      FUN_140058470(param_1,*puVar2);
      FUN_140058470(param_1,puVar2[1]);
      FUN_1403a17c0(param_1,puVar2 + 2);
      FUN_140017c50(param_1,*(undefined2 *)(puVar2 + 6));
      FUN_140058870(param_1,*(undefined1 *)((longlong)puVar2 + 0x3a));
      FUN_140058870(param_1,*(undefined1 *)((longlong)puVar2 + 0x3b));
      FUN_140385a20(param_1,(longlong)puVar2 + 0x1a);
      puVar2 = puVar2 + 0xf;
    } while (puVar2 != (undefined4 *)param_2[1]);
  }
  return param_1;
}



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

undefined8 FUN_1400d40a0(undefined8 param_1,ulonglong *param_2)

{
  undefined1 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined1 *puVar3;
  undefined1 auStack_178 [32];
  uint local_158 [4];
  undefined1 local_148 [4];
  undefined8 local_144;
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_178;
  FUN_1403840e0(param_1,local_158,4);
  if (((int)local_158[0] < 0) || (DAT_1405d8140 <= (int)local_158[0])) {
    FUN_1403a1730(local_158[0]);
  }
  FUN_1400d4ab0(param_2,(longlong)(int)local_158[0]);
  FUN_1400d4bf0(param_2);
  if (0 < (int)local_158[0]) {
    uVar2 = (ulonglong)local_158[0];
    do {
      local_148[0] = 0;
      local_144 = 0;
      FUN_1401222e0(param_1,local_148);
      puVar3 = (undefined1 *)param_2[1];
      if ((local_148 < puVar3) && (puVar1 = (undefined1 *)*param_2, puVar1 <= local_148)) {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_1400d5530(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined1 *)
                 (((longlong)(local_148 + -(longlong)puVar1) / 0x10c) * 0x10c + *param_2);
        if (_Dst != (void *)0x0) {
LAB_1400d41d0:
          memcpy(_Dst,puVar3,0x10c);
        }
      }
      else {
        if (puVar3 == (undefined1 *)param_2[2]) {
          FUN_1400d5530(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = local_148;
          goto LAB_1400d41d0;
        }
      }
      param_2[1] = param_2[1] + 0x10c;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_1400d4230(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x10c,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_1400d4300(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined8 *puVar3;
  undefined1 auStack_128 [32];
  uint local_108 [4];
  undefined8 local_f8;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined8 local_e0;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined4 local_c0;
  undefined1 local_bc;
  undefined8 local_bb;
  undefined2 local_b3;
  undefined8 local_b1;
  undefined8 local_a9;
  undefined8 local_a1;
  undefined8 local_99;
  undefined8 local_91;
  undefined4 local_89;
  undefined4 local_85;
  undefined1 local_81;
  undefined8 local_80;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  ulonglong local_58;
  
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_128;
  FUN_1403840e0(param_1,local_108,4);
  if (((int)local_108[0] < 0) || (DAT_1405d8140 <= (int)local_108[0])) {
    FUN_1403a1730(local_108[0]);
  }
  FUN_1400d4d20(param_2,(longlong)(int)local_108[0]);
  FUN_1400d4e60(param_2);
  if (0 < (int)local_108[0]) {
    uVar2 = (ulonglong)local_108[0];
    do {
      local_b1 = 0;
      local_89 = 0;
      local_85 = 0;
      local_f0 = 0;
      local_f8 = 0;
      local_78 = 0;
      local_74 = 0;
      local_70 = 0;
      local_ec = 0;
      local_6c = 0;
      local_68 = 0;
      local_e8 = 0;
      local_c0 = 0;
      local_e4 = 0;
      local_bc = 0;
      local_bb = 0;
      local_b3 = 0;
      local_a9 = 0;
      local_e0 = 0;
      local_d8 = 0;
      local_d0 = 0;
      local_c8 = 0;
      local_a1 = 0;
      local_99 = 0;
      local_91 = 0;
      local_81 = 0;
      local_80 = 0;
      FUN_1401214b0(param_1,&local_f8);
      puVar3 = (undefined8 *)param_2[1];
      if ((&local_f8 < puVar3) && (puVar1 = (undefined8 *)*param_2, puVar1 <= &local_f8)) {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_1400d55e0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined8 *)((((longlong)&local_f8 - (longlong)puVar1) / 0x94) * 0x94 + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_1400d44dd:
          memcpy(_Dst,puVar3,0x94);
        }
      }
      else {
        if (puVar3 == (undefined8 *)param_2[2]) {
          FUN_1400d55e0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_f8;
          goto LAB_1400d44dd;
        }
      }
      param_2[1] = param_2[1] + 0x94;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



void FUN_1400d4540(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x94,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_1400d4610(undefined8 param_1,undefined8 param_2)

{
  ulonglong uVar1;
  undefined1 auStack_88 [32];
  uint local_68 [2];
  undefined8 local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined2 local_48;
  undefined8 local_46;
  undefined8 local_3e;
  undefined8 local_36;
  undefined8 local_2e;
  undefined2 local_26;
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  FUN_1403840e0(param_1,local_68,4);
  uVar1 = (ulonglong)local_68[0];
  if (((int)local_68[0] < 0) || (DAT_1405d8140 <= (int)local_68[0])) {
    FUN_1403a1730(local_68[0]);
  }
  FUN_1400d4f90(param_2,(longlong)(int)local_68[0]);
  FUN_1400d50d0(param_2);
  if (0 < (int)local_68[0]) {
    do {
      local_58 = 0;
      local_60 = 0;
      local_54 = 0;
      local_48 = 0;
      local_50 = 0;
      local_26 = 0;
      local_4c = 0;
      local_46 = 0;
      local_3e = 0;
      local_36 = 0;
      local_2e = 0;
      FUN_140121a60(param_1,&local_60);
      FUN_1400d5170(param_2,&local_60);
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_1400d4710(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  lVar5 = param_2[1] - *param_2;
  lVar4 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar5),8) + lVar5;
  FUN_140017720(local_res10,L"<Array %d>",(lVar4 >> 5) - (lVar4 >> 0x3f),lVar5,uVar6);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_14034fe70();
    FUN_14034ed40(uVar6);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar6);
  }
  return;
}



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

undefined8 FUN_1400d47e0(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  undefined8 *puVar5;
  undefined1 auStack_98 [32];
  uint local_78 [2];
  undefined4 local_70;
  undefined4 uStack_6c;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 local_60;
  undefined4 uStack_5c;
  undefined1 uStack_58;
  undefined7 uStack_57;
  undefined1 uStack_50;
  undefined7 local_4f;
  undefined1 uStack_48;
  undefined7 local_47;
  undefined1 uStack_40;
  undefined7 local_3f;
  undefined1 uStack_38;
  ulonglong local_30;
  
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  FUN_1403840e0(param_1,local_78,4);
  if (((int)local_78[0] < 0) || (DAT_1405d8140 <= (int)local_78[0])) {
    FUN_1403a1730(local_78[0]);
  }
  FUN_1400d52a0(param_2,(longlong)(int)local_78[0]);
  FUN_1400d53d0(param_2);
  if (0 < (int)local_78[0]) {
    uVar4 = (ulonglong)local_78[0];
    do {
      uStack_6c = 0;
      local_70 = 0;
      local_68 = 0;
      uStack_64 = 0;
      uStack_5c = 0;
      uStack_58 = 0;
      local_60 = 0;
      uStack_57 = 0;
      uStack_50 = 0;
      local_4f = 0;
      uStack_48 = 0;
      local_47 = 0;
      uStack_40 = 0;
      local_3f = 0;
      uStack_38 = 0;
      FUN_140121ba0(param_1,&local_70);
      puVar1 = (undefined4 *)param_2[1];
      if ((&local_70 < puVar1) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_70)) {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_1400d5740(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        puVar5 = (undefined8 *)((((longlong)&local_70 - (longlong)puVar2) / 0x39) * 0x39 + *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];
          *(undefined1 *)(puVar3 + 7) = *(undefined1 *)(puVar5 + 7);
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_1400d5740(param_2,1);
        }
        puVar3 = (undefined8 *)param_2[1];
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = CONCAT44(uStack_6c,local_70);
          puVar3[1] = CONCAT44(uStack_64,local_68);
          puVar3[2] = CONCAT44(uStack_5c,local_60);
          puVar3[3] = CONCAT71(uStack_57,uStack_58);
          puVar3[4] = CONCAT71(local_4f,uStack_50);
          puVar3[5] = CONCAT71(local_47,uStack_48);
          puVar3[6] = CONCAT71(local_3f,uStack_40);
          *(undefined1 *)(puVar3 + 7) = uStack_38;
        }
      }
      param_2[1] = param_2[1] + 0x39;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_1400d49f0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x39,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_1400d4ab0(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 (0xf4898d5f85bb39 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x10c) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x10c);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1400d57e0(*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 * 0x10c);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x10c) * 0x10c);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



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

void FUN_1400d4bf0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x10c + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400d4c80(ulonglong *param_1,void *param_2)

{
  void *pvVar1;
  void *pvVar2;
  
  pvVar1 = (void *)param_1[1];
  if ((param_2 < pvVar1) && (pvVar2 = (void *)*param_1, pvVar2 <= param_2)) {
    if (pvVar1 == (void *)param_1[2]) {
      FUN_1400d5530(param_1,1);
    }
    param_2 = (void *)((((longlong)param_2 - (longlong)pvVar2) / 0x10c) * 0x10c + *param_1);
  }
  else if (pvVar1 == (void *)param_1[2]) {
    FUN_1400d5530(param_1,1);
  }
  if ((void *)param_1[1] != (void *)0x0) {
    memcpy((void *)param_1[1],param_2,0x10c);
  }
  param_1[1] = param_1[1] + 0x10c;
  return;
}



void FUN_1400d4d20(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 (0x1bacf914c1bacf9 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x94) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x94);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1400d5840(*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 * 0x94);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x94) * 0x94);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



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

void FUN_1400d4e60(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x94 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400d4ef0(ulonglong *param_1,void *param_2)

{
  void *pvVar1;
  void *pvVar2;
  
  pvVar1 = (void *)param_1[1];
  if ((param_2 < pvVar1) && (pvVar2 = (void *)*param_1, pvVar2 <= param_2)) {
    if (pvVar1 == (void *)param_1[2]) {
      FUN_1400d55e0(param_1,1);
    }
    param_2 = (void *)((((longlong)param_2 - (longlong)pvVar2) / 0x94) * 0x94 + *param_1);
  }
  else if (pvVar1 == (void *)param_1[2]) {
    FUN_1400d55e0(param_1,1);
  }
  if ((void *)param_1[1] != (void *)0x0) {
    memcpy((void *)param_1[1],param_2,0x94);
  }
  param_1[1] = param_1[1] + 0x94;
  return;
}



void FUN_1400d4f90(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 (0x444444444444444 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  lVar4 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar4 >> 5) - (lVar4 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x3c);
      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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_1400d58a0(*param_1,param_1[1],local_res10,param_4,uVar5);
    pvVar1 = (void *)*param_1;
    lVar4 = (param_1[1] - (longlong)pvVar1) +
            SUB168(SEXT816(-0x7777777777777777) * SEXT816(param_1[1] - (longlong)pvVar1),8);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x3c);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 5) - (lVar4 >> 0x3f)) * 0x3c);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



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

void FUN_1400d50d0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *param_1;
  lVar2 = param_1[1] - lVar1;
  lVar2 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar2),8) + lVar2;
  if ((lVar2 >> 5 != lVar2 >> 0x3f) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400d5170(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(-0x7777777777777777) * SEXT816(lVar2),8);
    if (puVar1 == (undefined8 *)param_1[2]) {
      FUN_1400d5690(param_1,1);
    }
    puVar1 = (undefined8 *)param_1[1];
    puVar3 = (undefined8 *)(((lVar2 >> 5) - (lVar2 >> 0x3f)) * 0x3c + *param_1);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = *puVar3;
      puVar1[1] = puVar3[1];
      puVar1[2] = puVar3[2];
      puVar1[3] = puVar3[3];
      puVar1[4] = puVar3[4];
      puVar1[5] = puVar3[5];
      puVar1[6] = puVar3[6];
      *(undefined4 *)(puVar1 + 7) = *(undefined4 *)(puVar3 + 7);
    }
    param_1[1] = param_1[1] + 0x3c;
    return;
  }
  if (puVar1 == (undefined8 *)param_1[2]) {
    FUN_1400d5690(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];
    *(undefined4 *)(puVar1 + 7) = *(undefined4 *)(param_2 + 7);
  }
  param_1[1] = param_1[1] + 0x3c;
  return;
}



void FUN_1400d52a0(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 (0x47dc11f7047dc11 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x39) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x39);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1400d5910(*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 * 0x39);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x39) * 0x39);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001400d5406)
// WARNING: Removing unreachable block (ram,0x0001400d5410)

void FUN_1400d53d0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x39 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1400d5470(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_1400d5740(param_1,1);
    }
    param_2 = (undefined8 *)((((longlong)param_2 - (longlong)puVar2) / 0x39) * 0x39 + *param_1);
  }
  else if (puVar1 == (undefined8 *)param_1[2]) {
    FUN_1400d5740(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];
    *(undefined1 *)(puVar1 + 7) = *(undefined1 *)(param_2 + 7);
  }
  param_1[1] = param_1[1] + 0x39;
  return;
}



void FUN_1400d5530(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x10c;
  if (0xf4898d5f85bb39U - 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) / 0x10c;
  if (uVar2 < uVar3) {
    if (0xf4898d5f85bb39 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400d4ab0(param_1,uVar2);
  }
  return;
}



void FUN_1400d55e0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x94;
  if (0x1bacf914c1bacf9U - 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) / 0x94;
  if (uVar2 < uVar3) {
    if (0x1bacf914c1bacf9 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400d4d20(param_1,uVar2);
  }
  return;
}



void FUN_1400d5690(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (param_1[1] - *param_1) +
          SUB168(SEXT816(-0x7777777777777777) * SEXT816(param_1[1] - *param_1),8);
  uVar4 = (lVar2 >> 5) - (lVar2 >> 0x3f);
  if (0x444444444444444U - param_2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + param_2;
  lVar2 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  uVar3 = (lVar2 >> 5) - (lVar2 >> 0x3f);
  if (uVar3 < uVar4) {
    if (0x444444444444444 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_1400d4f90(param_1,uVar3);
  }
  return;
}



void FUN_1400d5740(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x39;
  if (0x47dc11f7047dc11U - 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) / 0x39;
  if (uVar2 < uVar3) {
    if (0x47dc11f7047dc11 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1400d52a0(param_1,uVar2);
  }
  return;
}



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

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



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

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



undefined8 * FUN_1400d58a0(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x3c)) {
    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];
      *(undefined4 *)(param_3 + 7) = *(undefined4 *)(param_1 + 7);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x3c);
  }
  return param_3;
}



undefined8 * FUN_1400d5910(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = (undefined8 *)((longlong)param_1 + 0x39)) {
    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];
      *(undefined1 *)(param_3 + 7) = *(undefined1 *)(param_1 + 7);
    }
    param_3 = (undefined8 *)((longlong)param_3 + 0x39);
  }
  return param_3;
}



undefined8 FUN_1400d5a90(void)

{
  return 30000;
}



undefined8 FUN_1400d5aa0(void)

{
  return 0x75e8;
}



undefined1
FUN_1400d5ab0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7531);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ANIBG_SET_MOTION",0x7531);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d5bb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7531);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ANIBG_SET_MOTION",0x7531);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d5cc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7532);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIMMICK_SET_MOTION",0x7532);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d5dc0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7532);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIMMICK_SET_MOTION",0x7532);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d5ed0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7533);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIMMICK_SET_END",0x7533);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d5fb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7533);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIMMICK_SET_END",0x7533);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7534);
  FUN_140058470(local_30,*param_4);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_ENV_MODEL",0x7534);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6180(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7534);
  FUN_140058470(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_ENV_MODEL",0x7534);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d6270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7535);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEL_ENV_MODEL",0x7535);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7535);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEL_ENV_MODEL",0x7535);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7536);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIMMICK_SET_LOOP",0x7536);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7536);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIMMICK_SET_LOOP",0x7536);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6610(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7537);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIMMICK_SET_TEMPLATE_ID",0x7537);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6700(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7537);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIMMICK_SET_TEMPLATE_ID",0x7537);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d67f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7538);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_MINI_MAP_SPRITE_NAME",0x7538);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d68d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7538);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_MINI_MAP_SPRITE_NAME",0x7538)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d69b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7539);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_MAP_SPRITE_NAME",0x7539);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6a90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7539);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_MAP_SPRITE_NAME",0x7539);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6b70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753a);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ANIBG_SET_RENDER_ARRAY",0x753a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6c90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753a);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ANIBG_SET_RENDER_ARRAY",0x753a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6db0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753b);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIMMICK_SET_RENDER_ARRAY",0x753b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6ed0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753b);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIMMICK_SET_RENDER_ARRAY",0x753b)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d6ff0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753c);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ANIBG_SET_RENDER",0x753c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d70e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753c);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ANIBG_SET_RENDER",0x753c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d71d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753d);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIMMICK_SET_RENDER",0x753d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d72c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753d);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIMMICK_SET_RENDER",0x753d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d73b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753e);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_TRIGGER_UINOTIFY",0x753e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753e);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_TRIGGER_UINOTIFY",0x753e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_TRIGGER_UINOTIFY_TIME",0x753f
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x753f);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_TRIGGER_UINOTIFY_TIME",
                     0x753f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7760(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7540);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_PORTAL_ACTIVE",0x7540);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7540);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_PORTAL_ACTIVE",0x7540);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7541);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_ALL_PORTAL_ACTIVE",0x7541);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7a30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7541);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_ALL_PORTAL_ACTIVE",0x7541);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7b10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7542);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_NPCBOX_NPC_SHOW_ALL",0x7542);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7bf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7542);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_NPCBOX_NPC_SHOW_ALL",0x7542);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7cd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7543);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_NPCBOX_NPC_SHOW",0x7543);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7dc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7543);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_NPCBOX_NPC_SHOW",0x7543);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d7eb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7544);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SHOW_MAP_TITLE",0x7544);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d7f90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7544);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SHOW_MAP_TITLE",0x7544);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7545);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_MDATA",0x7545);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7545);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_MDATA",0x7545);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8250(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7546);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAY_MDATA",0x7546);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8350(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7546);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAY_MDATA",0x7546);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d8460(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7547);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SHOW_ROULETTE",0x7547);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d8520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7547);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SHOW_ROULETTE",0x7547);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d85f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7548);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SHOW_RESULT",0x7548);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d86d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7548);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SHOW_RESULT",0x7548);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d87b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7549);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SHOW_DIR_ARROW",0x7549);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8890(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7549);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SHOW_DIR_ARROW",0x7549);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8970(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_MAP_TITLE_DIFFUSE",0x754a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8a70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754a);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_MAP_TITLE_DIFFUSE",0x754a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8b80(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,longlong *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754b);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SPLIT_MOVE_PORTAL",0x754b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x754b);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,*param_8);
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar2 = (undefined4 *)*param_9;
  if (puVar2 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_9[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_SPLIT_MOVE_PORTAL",0x754b);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754c);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SPLIT_MOVE_PORTAL_RESULT",0x754c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d8f30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754c);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SPLIT_MOVE_PORTAL_RESULT",0x754c)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d9010(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUESTION_BOX_CLOSE",0x754d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d90d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUESTION_BOX_CLOSE",0x754d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d91a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754e);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUESTION_BOX",0x754e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754e);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUESTION_BOX",0x754e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9360(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754f);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_SINGLE_QUESTION_BOX",0x754f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x754f);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_SINGLE_QUESTION_BOX",0x754f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d9520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7550);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CLOSE_SINGLE_QUESTION_BOX",0x7550);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400d95e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7550);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CLOSE_SINGLE_QUESTION_BOX",0x7550
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d96b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7551);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_ALL_MAP_SELECT_PORTAL_ACTIVE",
                     0x7551);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9790(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7551);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_ALL_MAP_SELECT_PORTAL_ACTIVE"
                     ,0x7551);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9870(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7552);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_IN_AREA_BOX_ACTIVE",0x7552);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7552);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_IN_AREA_BOX_ACTIVE",0x7552);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7553);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_ALL_IN_AREA_BOX_ACTIVE",0x7553)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9b40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7553);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_ALL_IN_AREA_BOX_ACTIVE",
                     0x7553);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7554);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_START_POINT",0x7554);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9d00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7554);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_START_POINT",0x7554);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9de0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7555);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_FADE_MDATA",0x7555);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9ed0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7555);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_FADE_MDATA",0x7555);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400d9fc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7556);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAY_FADE_MDATA",0x7556);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400da0c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7556);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAY_FADE_MDATA",0x7556);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400da1d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7557);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_EVENT_TIME",0x7557);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400da2c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7557);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_EVENT_TIME",0x7557);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400da3c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7558);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CLEAR_EVENT_TIME",0x7558);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400da480(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7558);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CLEAR_EVENT_TIME",0x7558);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400da550(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7559);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEMBOX_SET_TABLE",0x7559);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400da640(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7559);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEMBOX_SET_TABLE",0x7559);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400da730(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755a);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEMBOX_SET_OPEN_ENABLE",0x755a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400da820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755a);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEMBOX_SET_OPEN_ENABLE",0x755a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400da910(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755b);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEMBOX_SET_OPEN",0x755b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400da9f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755b);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEMBOX_SET_OPEN",0x755b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400daad0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755c);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEMBOX_SET_RENDER",0x755c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dabc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755c);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEMBOX_SET_RENDER",0x755c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dacb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755d);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CAMERABOX_SET_DEFAULT",0x755d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dada0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755d);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CAMERABOX_SET_DEFAULT",0x755d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dae90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755e);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESET_HIT_BOX_FIRST",0x755e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400daf80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755e);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESET_HIT_BOX_FIRST",0x755e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400db070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_HELP_LUA_FUNCTION_RESET",0x755f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400db130(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x755f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_HELP_LUA_FUNCTION_RESET",0x755f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400db200(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7560);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_WARP_IN_BOX",0x7560);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400db2e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7560);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_WARP_IN_BOX",0x7560);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400db3c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7561);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_HIT_TELEPORT",0x7561);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400db4b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7561);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_HIT_TELEPORT",0x7561);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400db5a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7562);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_TRIGGER_BOX_STATE",0x7562);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400db690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7562);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_TRIGGER_BOX_STATE",0x7562);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400db780(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7563);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_HIT_BOX_SET_STATE",0x7563);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400db870(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7563);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_HIT_BOX_SET_STATE",0x7563);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400db960(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7564);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_HIT_BOX_SET_ENABLE",0x7564);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dba50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7564);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_HIT_BOX_SET_ENABLE",0x7564)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dbb40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7565);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SKID_BOX_STATE",0x7565);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dbc40(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7565);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SKID_BOX_STATE",0x7565);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dbd50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7566);
  FUN_140385940(local_30,param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SKID_BOX_VELOCITY",0x7566);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7566);
  FUN_140385940(local_30,param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SKID_BOX_VELOCITY",0x7566);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dbfc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7567);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_NAVIMESH_CUTOFF_TIME",0x7567);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7567);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_NAVIMESH_CUTOFF_TIME",0x7567)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dc1d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7568);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_ALL_NAVIMESH_CUTOFF",0x7568);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dc2b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7568);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_ALL_NAVIMESH_CUTOFF",0x7568);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dc390(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7569);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_NAVIMESH_CUTOFF",0x7569);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dc480(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7569);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_NAVIMESH_CUTOFF",0x7569);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dc570(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,param_10[1]);
  FUN_140058470(local_30,param_10[2]);
  FUN_140058470(local_30,param_10[3]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STAGE_CLEAR_RESULT",0x756a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dc6f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756a);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,param_11[1]);
  FUN_140058470(local_30,param_11[2]);
  FUN_140058470(local_30,param_11[3]);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STAGE_CLEAR_RESULT",0x756a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dc880(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756b);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_CAMERA_PLAY",0x756b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756b);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_CAMERA_PLAY",0x756b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dca90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756c);
  FUN_140385940(local_30,param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_CAMERA_PLAY_NEXT",0x756c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dcb80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756c);
  FUN_140385940(local_30,param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_CAMERA_PLAY_NEXT",0x756c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dcc70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756d);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_CAMERA_FREE",0x756d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dcd50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756d);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_CAMERA_FREE",0x756d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dce30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756e);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_SCENE_PLAY",0x756e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dcf20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756e);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_SCENE_PLAY",0x756e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400dd010(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_SCENE_STOP",0x756f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400dd0d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x756f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_SCENE_STOP",0x756f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd1a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7570);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CAMERA_BOX_SKIP",0x7570);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7570);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CAMERA_BOX_SKIP",0x7570);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7571);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CAMERA_CHANGE",0x7571);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7571);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CAMERA_CHANGE",0x7571);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7572);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CAMERA_BLOCK_CHANGE",0x7572);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd650(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7572);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CAMERA_BLOCK_CHANGE",0x7572);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7573);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_OPTION_INT",0x7573);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7573);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_OPTION_INT",0x7573);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dd920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7574);
  FUN_140385940(local_30,param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_OPTION_FLOAT",0x7574);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dda10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7574);
  FUN_140385940(local_30,param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_OPTION_FLOAT",0x7574);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ddb00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7575);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_FOCUS_RANGE",0x7575);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ddbe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7575);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_FOCUS_RANGE",0x7575);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ddcc0(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 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7576);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_FOG",0x7576);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dddf0(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 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7576);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_FOG",0x7576);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ddf30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7577);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_BACK_COLOR",0x7577);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de030(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7577);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_BACK_COLOR",0x7577);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de140(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7578);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_SSAO_RANGE",0x7578);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de220(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7578);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_SSAO_RANGE",0x7578);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de300(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7579);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_SSAO_FACTOR",0x7579);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de3e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7579);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_SSAO_FACTOR",0x7579);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de4c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757a);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_BLOOM_DEVIATION",0x757a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de5a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757a);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_BLOOM_DEVIATION",0x757a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de680(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757b);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_BLOOM_MULTIPLIER",0x757b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de760(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757b);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_BLOOM_MULTIPLIER",0x757b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757c);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_BLOOM_THRESHOLD",0x757c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400de920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757c);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_BLOOM_THRESHOLD",0x757c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dea00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757d);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_STAR_THRESHOLD",0x757d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400deae0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757d);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_STAR_THRESHOLD",0x757d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400debc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757e);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CM_SET_COLORGRADING_SETTEXTURE",
                     0x757e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400deca0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757e);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CM_SET_COLORGRADING_SETTEXTURE",
                     0x757e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ded80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757f);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_OPEN_ENVIRONMENT_STREAM",
                     0x757f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dee60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x757f);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_OPEN_ENVIRONMENT_STREAM",
                     0x757f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400def40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7580);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_OPEN_STREAM",0x7580);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400df020(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7580);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_OPEN_STREAM",0x7580);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400df100(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7581);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_END_ENVIRONMENT_STREAM",
                     0x7581);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400df1c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7581);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_END_ENVIRONMENT_STREAM",
                     0x7581);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400df290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7582);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_END_STEAM",0x7582);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400df350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7582);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_END_STEAM",0x7582);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400df420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7583);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_SET_VOLUME_BGM",0x7583);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400df500(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7583);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_SET_VOLUME_BGM",0x7583);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400df5e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7584);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_SET_VOLUME_SAMPLE",0x7584);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400df6c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7584);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_SET_VOLUME_SAMPLE",0x7584);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400df7a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7585);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_SET_FADE_SAMPLE_VOLUME_BGM",
                     0x7585);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400df890(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7585);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_SET_FADE_SAMPLE_VOLUME_BGM"
                     ,0x7585);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400df990(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7586);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_SET_SAMPLE_VOLUME_BGM",0x7586
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dfa70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7586);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_SET_SAMPLE_VOLUME_BGM",
                     0x7586);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dfb50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7587);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_SOUND_SET_SAMPLE_VOLUME_ENVIRONMENT_BGM",0x7587);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dfc30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7587);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_SOUND_SET_SAMPLE_VOLUME_ENVIRONMENT_BGM",0x7587);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400dfd10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7588);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SOUND_PLAY_SOUND",0x7588);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400dfdf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7588);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SOUND_PLAY_SOUND",0x7588);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400dfed0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7589);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_PLAY",0x7589);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400dff90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7589);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_PLAY",0x7589);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e0060(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_FORCE_KILL_ENEMY",0x758a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e0120(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_FORCE_KILL_ENEMY",0x758a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e01f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758b);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_CHARACTER_MANAGER_SET_ATTACK_DISABLE",0x758b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e02d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758b);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_CHARACTER_MANAGER_SET_ATTACK_DISABLE",0x758b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e03b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_STOP",0x758c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e0470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_STOP",0x758c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0540(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758d);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_ANI",
                     0x758d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0640(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758d);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_ANI",
                     0x758d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0750(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758e);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_SHOP",
                     0x758e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758e);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_SHOP",
                     0x758e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0930(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758f);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_SKILL",
                     0x758f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0a20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x758f);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_SKILL",
                     0x758f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0b10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7590);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_ENCHANT",
                     0x7590);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0c00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7590);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_CHARACTER_MANAGER_SET_NPC_ENCHANT",0x7590);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0cf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7591);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_MIX",
                     0x7591);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0de0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7591);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_MIX",
                     0x7591);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0ed0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7592);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_DIALOG",
                     0x7592);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e0fc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7592);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_SET_NPC_DIALOG"
                     ,0x7592);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e10b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7593);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_INC_FATIGUE",
                     0x7593);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7593);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_INC_FATIGUE",
                     0x7593);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7594);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_DEC_FATIGUE",
                     0x7594);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7594);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_DEC_FATIGUE",
                     0x7594);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7595);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_CHARACTER_MANAGER_SET_RENDER_PLAYER",0x7595);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7595);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_CHARACTER_MANAGER_SET_RENDER_PLAYER",0x7595);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e15f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7596);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_CHARACTER_MANAGER_ENEMY_CONDITION_SET",0x7596);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e16e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7596);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_CHARACTER_MANAGER_ENEMY_CONDITION_SET",0x7596);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e17e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7597);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_CHARACTER_MANAGER_ENEMY_PRELOAD_ENEMY",0x7597);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e18c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7597);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_CHARACTER_MANAGER_ENEMY_PRELOAD_ENEMY",0x7597);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e19a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7598);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     L"PT_CHARACTER_MANAGER_ENEMY_DELETE_PRELOAD_ENEMY",0x7598);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7598);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_CHARACTER_MANAGER_ENEMY_DELETE_PRELOAD_ENEMY",0x7598);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7599);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_ACTIVE_CONTROL",
                     0x7599);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x7599);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_ACTIVE_CONTROL"
                     ,0x7599);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759a);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_SET_LUCK",0x759a)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e1e00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759a);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_SET_LUCK",
                     0x759a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e1ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHARACTER_MANAGER_CLEAR_MISSION",
                     0x759b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e1fa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHARACTER_MANAGER_CLEAR_MISSION",
                     0x759b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e2070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_TIME_LIMIT_CLOSE",0x759c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e2130(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_TIME_LIMIT_CLOSE",0x759c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2200(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759d);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_TIME_LIMIT",0x759d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e22e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759d);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_TIME_LIMIT",0x759d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e23c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759e);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MAP_CHANGE",0x759e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e24a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759e);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MAP_CHANGE",0x759e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e2580(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759f);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MINIMAP_CHANGE",0x759f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x759f);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MINIMAP_CHANGE",0x759f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a0);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MAP_PLAYER_ICON_RENDER",
                     0x75a0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a0);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MAP_PLAYER_ICON_RENDER",
                     0x75a0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2900(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a1);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MINI_MAP_PLAYER_ICON_RENDER"
                     ,0x75a1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e29e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a1);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_UI_SET_MINI_MAP_PLAYER_ICON_RENDER",0x75a1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2ac0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a2);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MAP_ICON_RENDER",0x75a2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2bb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a2);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MAP_ICON_RENDER",0x75a2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2ca0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a3);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MINI_MAP_ICON_RENDER",0x75a3
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2d90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a3);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MINI_MAP_ICON_RENDER",
                     0x75a3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e2e80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a4);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SHOW_WINDOW",0x75a4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e2f60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a4);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SHOW_WINDOW",0x75a4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e3040(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a5);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_ALPHA_SHOW_WINDOW",0x75a5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e3120(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a5);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_ALPHA_SHOW_WINDOW",0x75a5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e3200(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a6);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MINIMAP_ICON_LOOP",0x75a6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e32f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a6);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MINIMAP_ICON_LOOP",0x75a6)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e33e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a7);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MINIMAP_ICON_INDEX",0x75a7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e34d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a7);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MINIMAP_ICON_INDEX",0x75a7
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e35c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a8);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MINIMAP_ICON_TYPE",0x75a8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e36b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a8);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MINIMAP_ICON_TYPE",0x75a8)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e37a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a9);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MINIMAP_ICON_PLAY_POS",
                     0x75a9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e38a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75a9);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MINIMAP_ICON_PLAY_POS",
                     0x75a9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e39b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75aa);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MINIMAP_ICON",0x75aa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e3ad0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75aa);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MINIMAP_ICON",0x75aa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e3bf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ab);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_NPC_DIALOG_SPEECH",0x75ab);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e3ce0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ab);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_NPC_DIALOG_SPEECH",0x75ab)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e3de0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ac);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_NPC_DIALOG_TEXT_ID",0x75ac);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e3ed0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ac);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_NPC_DIALOG_TEXT_ID",0x75ac
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e3fd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ad);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_MAP_TITLE_SPRITE",0x75ad);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e40b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ad);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_MAP_TITLE_SPRITE",0x75ad);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e4190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ae);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_CLOSE_NPC_DIALOG",0x75ae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e4250(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ae);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_CLOSE_NPC_DIALOG",0x75ae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e4320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75af);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_DIALOG_SPRITE",0x75af);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e4400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75af);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_DIALOG_SPRITE",0x75af);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e44e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b0);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_DIALOG_SPEECH",0x75b0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e45c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b0);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_DIALOG_SPEECH",0x75b0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e46a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b1);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058670(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_DIALOG_SPEECH_TIME",0x75b1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e47a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b1);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058670(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_DIALOG_SPEECH_TIME",0x75b1
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e48b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b2);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_LINK_DIALOG_SPEECH",0x75b2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e4990(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b2);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_LINK_DIALOG_SPEECH",0x75b2
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e4a70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_CLOSE_DIALOG",0x75b3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e4b30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_CLOSE_DIALOG",0x75b3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e4c00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b4);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_BASE_SWF_OPEN",0x75b4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e4cf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b4);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_BASE_SWF_OPEN",0x75b4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e4de0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b5);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SWF_OPEN",0x75b5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e4ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b5);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SWF_OPEN",0x75b5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e4fa0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined1 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b6);
  FUN_140058870(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_ARROW_SWF_OPEN",0x75b6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e50c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5,undefined1 *param_6,undefined1 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b6);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_ARROW_SWF_OPEN",0x75b6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e51e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b7);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_TYPOGRAPHY_SWF_OPEN",0x75b7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e52c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b7);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_TYPOGRAPHY_SWF_OPEN",0x75b7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e53a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b8);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  FUN_140385940(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_MISSION_SWF_OPEN",0x75b8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e54b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b8);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  FUN_140385940(local_30,param_7);
  FUN_140385940(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_MISSION_SWF_OPEN",0x75b8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e55c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b9);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_OPTION_BUTTON_ENABLE",0x75b9
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e56b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75b9);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_OPTION_BUTTON_ENABLE",
                     0x75b9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e57a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ba);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_END_TUTORIAL",0x75ba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e5860(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ba);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_END_TUTORIAL",0x75ba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e5930(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75bb);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_CLOSE_SELECT_ID_SWF",0x75bb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e5a10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75bb);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_CLOSE_SELECT_ID_SWF",0x75bb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e5af0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75bc);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_COUNT",0x75bc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e5bd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75bc);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_COUNT",0x75bc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e5cb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75bd);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_START_TIME_LIMIT_RED",0x75bd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e5db0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75bd);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_START_TIME_LIMIT_RED",0x75bd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e5ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75be);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_START_TIME_LIMIT",0x75be);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e5fb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75be);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_START_TIME_LIMIT",0x75be);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e60b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75bf);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_END_TIME_LIMIT",0x75bf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e6170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75bf);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_END_TIME_LIMIT",0x75bf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6240(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c0);
  FUN_140058470(local_30,*param_4);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_START_TIME_LIMIT_2",0x75c0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6340(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c0);
  FUN_140058470(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_START_TIME_LIMIT_2",0x75c0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6450(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c1);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_END_TIME_LIMIT_2",0x75c1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c1);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_END_TIME_LIMIT_2",0x75c1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e6610(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_END_TIME_LIMIT_RED",0x75c2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e66d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_END_TIME_LIMIT_RED",0x75c2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e67a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_END_ELAPSED_TIME",0x75c3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e6860(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_END_ELAPSED_TIME",0x75c3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e6930(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_START_ELAPSED_TIME",0x75c4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e69f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_START_ELAPSED_TIME",0x75c4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e6ac0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c5);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_BASE_SWF_SET_DOCK",0x75c5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6ba0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c5);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_BASE_SWF_SET_DOCK",0x75c5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6c80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c6);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_BASE_SWF_GOTO_AND_PLAY",0x75c6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6d60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c6);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_BASE_SWF_GOTO_AND_PLAY",0x75c6
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6e40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c7);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SET_FLOOR",0x75c7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e6f20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c7);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SET_FLOOR",0x75c7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7000(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c8);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_BASE_SWF_GOTO_AND_STOP",0x75c8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e70e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c8);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_BASE_SWF_GOTO_AND_STOP",0x75c8
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e71c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c9);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_GOTO_AND_PLAY_SELECT_ID_SWF",
                     0x75c9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e72b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75c9);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_GOTO_AND_PLAY_SELECT_ID_SWF",
                     0x75c9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e73b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ca);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_GOTO_AND_STOP_SELECT_ID_SWF",
                     0x75ca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e74a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ca);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_GOTO_AND_STOP_SELECT_ID_SWF",
                     0x75ca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e75a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75cb);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_BASE_SWF_CLOSE",0x75cb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e7660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75cb);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_BASE_SWF_CLOSE",0x75cb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7730(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75cc);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_UI_SWF_SET_VISIBLE",0x75cc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75cc);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_UI_SWF_SET_VISIBLE",0x75cc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75cd);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DROP_ITEM_CLEAR",0x75cd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7a00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75cd);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DROP_ITEM_CLEAR",0x75cd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7ae0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ce);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_MISSION_NPC",0x75ce);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7bd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75ce);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_MISSION_NPC",0x75ce);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7cd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75cf);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_MISSION",0x75cf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75cf);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_MISSION",0x75cf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7ec0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d0);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_MISSION_RESULT",0x75d0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e7fe0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined1 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d0);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_MISSION_RESULT",0x75d0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e8100(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_CLEAR_MISSION",0x75d1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e81c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_CLEAR_MISSION",0x75d1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d2);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_TELEPORT_POS",0x75d2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d2);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_TELEPORT_POS",0x75d2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8450(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d3);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEBUG_SET_TEMP",0x75d3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8540(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d3);
  FUN_140385940(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEBUG_SET_TEMP",0x75d3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8630(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d4);
  FUN_140385940(local_30,param_4);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEBUG_SET_TEMP_STRING",0x75d4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8720(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d4);
  FUN_140385940(local_30,param_5);
  FUN_140385940(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEBUG_SET_TEMP_STRING",0x75d4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e8810(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEBUG_TEMP_CLEAR",0x75d5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e88d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEBUG_TEMP_CLEAR",0x75d5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e89a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d6);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEBUG_LUA_FILE",0x75d6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d6);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEBUG_LUA_FILE",0x75d6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d7);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_PORTAL_WARP_RESULT",0x75d7)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d7);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_PORTAL_WARP_RESULT",
                     0x75d7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d8);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_PORTAL_MAP_WARP_RESULT",
                     0x75d8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8e20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d8);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_PORTAL_MAP_WARP_RESULT",
                     0x75d8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e8f30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d9);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_SCENE_WORLD_LOAD",0x75d9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9010(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75d9);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_SCENE_WORLD_LOAD",0x75d9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e90f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75da);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_SCENE_WORLD_CLEAR",0x75da);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e91b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75da);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_SCENE_WORLD_CLEAR",0x75da);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75db);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_IN_DUNGEON_CLOSE",0x75db);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9390(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75db);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_IN_DUNGEON_CLOSE",0x75db)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e94a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75dc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ASK_KEY",0x75dc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e9560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75dc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ASK_KEY",0x75dc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9630(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,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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75dd);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058870(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SUMMON_GIMMICK",0x75dd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e97c0(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,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75dd);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,param_9[1]);
  FUN_140058570(local_30,param_9[2]);
  FUN_140058870(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SUMMON_GIMMICK",0x75dd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9970(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75de);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REMOVE_SUMMON_GIMMICK",0x75de);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9ac0(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,undefined4 *param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75de);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REMOVE_SUMMON_GIMMICK",0x75de);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75df);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MOVE_PORTAL",0x75df);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9d00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75df);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MOVE_PORTAL",0x75df);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400e9de0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e0);
  FUN_1400d3f10(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BREAK_INTO_PACKET_GROUP",0x75e0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e0);
  FUN_1400d3f10(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BREAK_INTO_PACKET_GROUP",0x75e0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400e9fa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e1);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_TELEPORT",0x75e1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ea0c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e1);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_TELEPORT",0x75e1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ea1f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e2);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_VOTE_DIALOG_OPEN",0x75e2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ea2d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e2);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_VOTE_DIALOG_OPEN",0x75e2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ea3b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e3);
  FUN_140017c50(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_VOTE_DIALOG_RESULT",0x75e3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ea4a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e3);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_VOTE_DIALOG_RESULT",0x75e3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ea5a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_VOTE_DIALOG_FINISH",0x75e4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ea660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_VOTE_DIALOG_FINISH",0x75e4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ea730(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e5);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SHOW_TRAING",0x75e5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ea820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e5);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SHOW_TRAING",0x75e5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ea920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e6);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_EVENT_TIME",0x75e6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400eaa10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e6);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_EVENT_TIME",0x75e6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400eab10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e7);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_FIRST_START_POINT",0x75e7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400eabf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x75e7);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_FIRST_START_POINT",0x75e7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined8 FUN_1400eacd0(longlong *param_1,int *param_2,undefined8 param_3)

{
  undefined **ppuVar1;
  longlong *plVar2;
  int *piVar3;
  int iVar4;
  longlong *plVar5;
  char cVar6;
  undefined4 uVar7;
  DWORD DVar8;
  DWORD DVar9;
  undefined ***pppuVar10;
  undefined8 uVar11;
  undefined8 uVar12;
  undefined1 uVar13;
  undefined *puVar14;
  undefined *puVar15;
  undefined **ppuVar16;
  int iVar17;
  undefined *local_res10 [2];
  undefined **local_res20;
  undefined8 local_278;
  wchar_t *local_270;
  int local_268;
  undefined8 local_260;
  int local_258;
  void *local_250;
  wchar_t *local_248;
  undefined8 local_240;
  undefined8 local_238;
  undefined8 local_230;
  longlong *local_228;
  undefined ***local_220;
  undefined1 local_218;
  undefined8 local_210;
  undefined1 local_208;
  undefined1 local_1f8 [4];
  int local_1f4;
  undefined8 local_1c0;
  undefined **local_198;
  undefined *local_190;
  undefined **local_188;
  undefined **local_180;
  undefined *local_178;
  undefined **local_170;
  undefined *local_168;
  undefined *local_160;
  undefined **local_158;
  undefined **local_150;
  undefined **local_148;
  undefined **local_140;
  undefined *local_138;
  undefined **local_130;
  undefined *local_128;
  undefined **local_120;
  undefined *local_118;
  undefined4 local_110 [2];
  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;
  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];
  undefined8 local_70;
  undefined1 local_68 [8];
  undefined1 local_60 [8];
  undefined1 local_58 [8];
  undefined1 local_50 [8];
  undefined1 local_48 [8];
  undefined1 local_40 [8];
  
  local_70 = 0xfffffffffffffffe;
  iVar4 = param_2[10];
  if (iVar4 == 0) {
    FUN_140385b50(param_1,0);
  }
  iVar17 = *param_2;
  cVar6 = FUN_140384a90(param_2,local_110);
  if (cVar6 == '\0') {
switchD_1400ead63_default:
    FUN_140383db0(param_2,(int)((iVar17 >> 0x1f & 7U) + iVar17) >> 3);
    uVar12 = 0;
  }
  else {
    local_1c0 = param_3;
    switch(local_110[0]) {
    case 0x7919:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,4);
      uVar7 = local_res10[0]._0_4_;
      if (cVar6 != '\0') {
        uVar7 = local_res20._0_4_;
      }
      local_res10[0] = (undefined *)CONCAT44(local_res10[0]._4_4_,uVar7);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_EVENT_SCENE_STOP");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x7919,L"PT_REQ_EVENT_SCENE_STOP",&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        local_228 = (longlong *)FUN_1400174a0(&local_res20,&local_d8,iVar17 + -2);
        if (local_res20 == (undefined **)0x0) {
          local_res20 = (undefined **)PTR_DAT_1405d8010;
        }
        if ((undefined **)*local_228 != local_res20) {
          pppuVar10 = (undefined ***)FUN_14034fe70();
          local_220 = pppuVar10;
          FUN_14034ed40(pppuVar10);
          ppuVar16 = local_res20;
          local_218 = 1;
          if (((local_res20 != (undefined **)0x0) &&
              (local_res20 != (undefined **)PTR_DAT_1405d8010)) &&
             (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
            uVar12 = FUN_14034fe70();
            local_210 = uVar12;
            FUN_14034ed40(uVar12);
            local_208 = 1;
            piVar3 = (int *)((longlong)ppuVar16 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(ppuVar1);
            }
            FUN_14034edd0(uVar12);
          }
          local_res20 = (undefined **)*local_228;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(pppuVar10);
        }
        if (((local_d8 != (undefined *)0x0) && (local_d8 != PTR_DAT_1405d8010)) &&
           (local_d8 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_210 = uVar12;
          FUN_14034ed40(uVar12);
          local_208 = 1;
          piVar3 = (int *)(local_d8 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_d8 + -8);
          }
          FUN_14034edd0(uVar12);
        }
        local_220 = &local_180;
        local_d8 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_180 = (undefined **)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_180 = (undefined **)0x0;
        }
        if (local_res20 != (undefined **)PTR_DAT_1405d8010) {
          uVar12 = FUN_14034fe70();
          local_210 = uVar12;
          FUN_14034ed40(uVar12);
          local_208 = 1;
          FUN_1400031d0(&local_180);
          local_180 = local_res20;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        FUN_14034fe70();
        local_138 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"PT_REQ_EVENT_SCENE_STOP");
        uVar12 = FUN_140002f00(&local_138,uVar7);
        FUN_14034fd20(uVar12,L"PT_REQ_EVENT_SCENE_STOP",uVar7);
        FUN_140002fe0(&local_138);
        (**(code **)(*param_1 + 0x28))(param_1,0x7919,&local_138,&local_180);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x7919,L"PT_REQ_EVENT_SCENE_STOP",ppuVar16);
        ppuVar16 = local_res20;
        if (((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
           && (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
          uVar12 = FUN_14034fe70();
          local_210 = uVar12;
          FUN_14034ed40(uVar12);
          local_208 = 1;
          piVar3 = (int *)((longlong)ppuVar16 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(ppuVar1);
          }
          FUN_14034edd0(uVar12);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7919);
        local_270 = L"PT_REQ_EVENT_SCENE_STOP";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x38))(param_1,iVar4,local_1f8,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"PT_REQ_EVENT_SCENE_STOP");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x7919);
        local_248 = L"PT_REQ_EVENT_SCENE_STOP";
LAB_1400ed8ae:
        local_240 = CONCAT44(local_240._4_4_,iVar4);
        local_238 = param_3;
        DVar9 = GetTickCount();
        local_230 = CONCAT44(local_230._4_4_,DVar9 - DVar8);
        (**(code **)(*param_1 + 0x18))(param_1,&local_250);
      }
      break;
    case 0x791a:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,4);
      uVar7 = local_res10[0]._0_4_;
      if (cVar6 != '\0') {
        uVar7 = local_res20._0_4_;
      }
      local_res10[0] = (undefined *)CONCAT44(local_res10[0]._4_4_,uVar7);
      FUN_14034fe70();
      local_228 = (longlong *)PTR_DAT_1405d8008;
      thunk_FUN_140384ec0(param_2,&local_228);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_EVENT_SCENE_PLAY_NEXT");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x791a,L"PT_REQ_EVENT_SCENE_PLAY_NEXT",
                     &DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        FUN_1403a1c60(&local_res20,&local_228);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        DVar9 = DVar8;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          DVar9 = *(DWORD *)(local_res20 + -1);
        }
        local_220 = (undefined ***)FUN_1400174a0(&local_res20,&local_e8,DVar9 - 2);
        if (local_res20 == (undefined **)0x0) {
          local_res20 = (undefined **)PTR_DAT_1405d8010;
        }
        if (*local_220 != local_res20) {
          uVar12 = FUN_14034fe70();
          local_210 = uVar12;
          FUN_14034ed40(uVar12);
          ppuVar16 = local_res20;
          local_208 = 1;
          if (((local_res20 != (undefined **)0x0) &&
              (local_res20 != (undefined **)PTR_DAT_1405d8010)) &&
             (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
            uVar11 = FUN_14034fe70();
            local_278 = uVar11;
            FUN_14034ed40(uVar11);
            local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
            piVar3 = (int *)((longlong)ppuVar16 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(ppuVar1);
            }
            FUN_14034edd0(uVar11);
          }
          local_res20 = *local_220;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        if (((local_e8 != (undefined *)0x0) && (local_e8 != PTR_DAT_1405d8010)) &&
           (local_e8 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)(local_e8 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_e8 + -8);
          }
          FUN_14034edd0(uVar12);
        }
        local_220 = &local_188;
        local_e8 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_188 = (undefined **)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_188 = (undefined **)0x0;
        }
        if (local_res20 != (undefined **)PTR_DAT_1405d8010) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          FUN_1400031d0(&local_188);
          local_188 = local_res20;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        FUN_14034fe70();
        local_128 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"PT_REQ_EVENT_SCENE_PLAY_NEXT");
        uVar12 = FUN_140002f00(&local_128,uVar7);
        FUN_14034fd20(uVar12,L"PT_REQ_EVENT_SCENE_PLAY_NEXT",uVar7);
        FUN_140002fe0(&local_128);
        (**(code **)(*param_1 + 0x28))(param_1,0x791a,&local_128,&local_188);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x791a,L"PT_REQ_EVENT_SCENE_PLAY_NEXT",ppuVar16);
        ppuVar16 = local_res20;
        if (((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
           && (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)((longlong)ppuVar16 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(ppuVar1);
          }
          FUN_14034edd0(uVar12);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x791a);
        local_270 = L"PT_REQ_EVENT_SCENE_PLAY_NEXT";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x40))(param_1,iVar4,local_1f8,local_res10,&local_228);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"PT_REQ_EVENT_SCENE_PLAY_NEXT");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x791a);
        local_248 = L"PT_REQ_EVENT_SCENE_PLAY_NEXT";
        local_240 = CONCAT44(local_240._4_4_,iVar4);
        local_238 = param_3;
        DVar9 = GetTickCount();
        local_230 = CONCAT44(local_230._4_4_,DVar9 - DVar8);
        (**(code **)(*param_1 + 0x18))(param_1,&local_250);
      }
      plVar5 = local_228;
      if (((local_228 != (longlong *)0x0) && (local_228 != (longlong *)PTR_DAT_1405d8008)) &&
         (plVar2 = local_228 + -1, plVar2 != (longlong *)0x0)) {
        uVar12 = FUN_14034fe70();
        local_278 = uVar12;
        FUN_14034ed40(uVar12);
        local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
        piVar3 = (int *)((longlong)plVar5 + -4);
        *piVar3 = *piVar3 + -1;
        if (*piVar3 == 0) {
          FUN_14034ff60(plVar2);
        }
        FUN_14034edd0(uVar12);
      }
      break;
    case 0x791b:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_EVENT_SCENE_CONTINUE");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x791b,L"PT_REQ_EVENT_SCENE_CONTINUE",
                     &DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        puVar14 = PTR_DAT_1405d8010;
        local_res10[0] = PTR_DAT_1405d8010;
        local_res20 = (undefined **)FUN_1400174a0(local_res10,&local_f0,0xfffffffe);
        if (puVar14 == (undefined *)0x0) {
          puVar14 = PTR_DAT_1405d8010;
        }
        local_res10[0] = puVar14;
        if (*local_res20 != puVar14) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1405d8010)) &&
             (puVar14 + -8 != (undefined *)0x0)) {
            uVar11 = FUN_14034fe70();
            local_210 = uVar11;
            FUN_14034ed40(uVar11);
            local_208 = 1;
            piVar3 = (int *)(puVar14 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar14 + -8);
            }
            FUN_14034edd0(uVar11);
          }
          puVar14 = *local_res20;
          if (((puVar14 != PTR_DAT_1405d8010) && (puVar14 != (undefined *)0x0)) &&
             (puVar14 != (undefined *)0x8)) {
            *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
          }
          local_res10[0] = puVar14;
          FUN_14034edd0(uVar12);
        }
        if (((local_f0 != (undefined *)0x0) && (local_f0 != PTR_DAT_1405d8010)) &&
           (local_f0 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)(local_f0 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_f0 + -8);
          }
          FUN_14034edd0(uVar12);
        }
        local_res20 = &local_178;
        local_f0 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_178 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_178 = (undefined *)0x0;
        }
        if (puVar14 != PTR_DAT_1405d8010) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          FUN_1400031d0(&local_178);
          if (((puVar14 != PTR_DAT_1405d8010) && (puVar14 != (undefined *)0x0)) &&
             (puVar14 != (undefined *)0x8)) {
            *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
          }
          local_178 = puVar14;
          FUN_14034edd0(uVar12);
        }
        FUN_14034fe70();
        local_118 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"PT_REQ_EVENT_SCENE_CONTINUE");
        uVar12 = FUN_140002f00(&local_118,uVar7);
        FUN_14034fd20(uVar12,L"PT_REQ_EVENT_SCENE_CONTINUE",uVar7);
        FUN_140002fe0(&local_118);
        (**(code **)(*param_1 + 0x28))(param_1,0x791b,&local_118,&local_178);
        puVar15 = puVar14;
        if (puVar14 == (undefined *)0x0) {
          puVar15 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x791b,L"PT_REQ_EVENT_SCENE_CONTINUE",puVar15);
        if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1405d8010)) &&
           (puVar14 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)(puVar14 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(puVar14 + -8);
          }
          FUN_14034edd0(uVar12);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x791b);
        local_270 = L"PT_REQ_EVENT_SCENE_CONTINUE";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x48))(param_1,iVar4,local_1f8);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"PT_REQ_EVENT_SCENE_CONTINUE");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x791b);
        local_248 = L"PT_REQ_EVENT_SCENE_CONTINUE";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x791c:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_FORCE_KILL_ENEMY");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x791c,L"PT_REQ_FORCE_KILL_ENEMY",&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        puVar14 = PTR_DAT_1405d8010;
        local_res10[0] = PTR_DAT_1405d8010;
        local_res20 = (undefined **)FUN_1400174a0(local_res10,&local_c8,0xfffffffe);
        if (puVar14 == (undefined *)0x0) {
          puVar14 = PTR_DAT_1405d8010;
        }
        local_res10[0] = puVar14;
        if (*local_res20 != puVar14) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1405d8010)) &&
             (puVar14 + -8 != (undefined *)0x0)) {
            uVar11 = FUN_14034fe70();
            local_210 = uVar11;
            FUN_14034ed40(uVar11);
            local_208 = 1;
            piVar3 = (int *)(puVar14 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(puVar14 + -8);
            }
            FUN_14034edd0(uVar11);
          }
          puVar14 = *local_res20;
          if (((puVar14 != PTR_DAT_1405d8010) && (puVar14 != (undefined *)0x0)) &&
             (puVar14 != (undefined *)0x8)) {
            *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
          }
          local_res10[0] = puVar14;
          FUN_14034edd0(uVar12);
        }
        if (((local_c8 != (undefined *)0x0) && (local_c8 != PTR_DAT_1405d8010)) &&
           (local_c8 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)(local_c8 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_c8 + -8);
          }
          FUN_14034edd0(uVar12);
        }
        local_res20 = &local_190;
        local_c8 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_190 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_190 = (undefined *)0x0;
        }
        if (puVar14 != PTR_DAT_1405d8010) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          FUN_1400031d0(&local_190);
          if (((puVar14 != PTR_DAT_1405d8010) && (puVar14 != (undefined *)0x0)) &&
             (puVar14 != (undefined *)0x8)) {
            *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
          }
          local_190 = puVar14;
          FUN_14034edd0(uVar12);
        }
        FUN_14034fe70();
        local_108 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"PT_REQ_FORCE_KILL_ENEMY");
        uVar12 = FUN_140002f00(&local_108,uVar7);
        FUN_14034fd20(uVar12,L"PT_REQ_FORCE_KILL_ENEMY",uVar7);
        FUN_140002fe0(&local_108);
        (**(code **)(*param_1 + 0x28))(param_1,0x791c,&local_108,&local_190);
        puVar15 = puVar14;
        if (puVar14 == (undefined *)0x0) {
          puVar15 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x791c,L"PT_REQ_FORCE_KILL_ENEMY",puVar15);
        if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1405d8010)) &&
           (puVar14 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)(puVar14 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(puVar14 + -8);
          }
          FUN_14034edd0(uVar12);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x791c);
        local_270 = L"PT_REQ_FORCE_KILL_ENEMY";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x50))(param_1,iVar4,local_1f8);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"PT_REQ_FORCE_KILL_ENEMY");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x791c);
        local_248 = L"PT_REQ_FORCE_KILL_ENEMY";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x791d:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,4);
      uVar7 = local_228._0_4_;
      if (cVar6 != '\0') {
        uVar7 = local_res20._0_4_;
      }
      local_228 = (longlong *)CONCAT44(local_228._4_4_,uVar7);
      cVar6 = FUN_1403840e0(param_2,&local_res20,1);
      uVar13 = local_res10[0]._0_1_;
      if (cVar6 != '\0') {
        uVar13 = local_res20._0_1_;
      }
      local_res10[0] = (undefined *)CONCAT71(local_res10[0]._1_7_,uVar13);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_UI_DIALOG");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x791d,L"PT_REQ_UI_DIALOG",&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,&local_228);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        FUN_1403a18c0(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        local_220 = (undefined ***)FUN_1400174a0(&local_res20,&local_e0,iVar17 + -2);
        if (local_res20 == (undefined **)0x0) {
          local_res20 = (undefined **)PTR_DAT_1405d8010;
        }
        if (*local_220 != local_res20) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          ppuVar16 = local_res20;
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          if (((local_res20 != (undefined **)0x0) &&
              (local_res20 != (undefined **)PTR_DAT_1405d8010)) &&
             (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
            uVar11 = FUN_14034fe70();
            local_210 = uVar11;
            FUN_14034ed40(uVar11);
            local_208 = 1;
            piVar3 = (int *)((longlong)ppuVar16 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(ppuVar1);
            }
            FUN_14034edd0(uVar11);
          }
          local_res20 = *local_220;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        if (((local_e0 != (undefined *)0x0) && (local_e0 != PTR_DAT_1405d8010)) &&
           (local_e0 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)(local_e0 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_e0 + -8);
          }
          FUN_14034edd0(uVar12);
        }
        local_220 = &local_198;
        local_e0 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_198 = (undefined **)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_198 = (undefined **)0x0;
        }
        if (local_res20 != (undefined **)PTR_DAT_1405d8010) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          FUN_1400031d0(&local_198);
          local_198 = local_res20;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        FUN_14034fe70();
        local_f8 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"PT_REQ_UI_DIALOG");
        uVar12 = FUN_140002f00(&local_f8,uVar7);
        FUN_14034fd20(uVar12,L"PT_REQ_UI_DIALOG",uVar7);
        FUN_140002fe0(&local_f8);
        (**(code **)(*param_1 + 0x28))(param_1,0x791d,&local_f8,&local_198);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x791d,L"PT_REQ_UI_DIALOG",ppuVar16);
        ppuVar16 = local_res20;
        if (((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
           && (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)((longlong)ppuVar16 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(ppuVar1);
          }
          FUN_14034edd0(uVar12);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x791d);
        local_270 = L"PT_REQ_UI_DIALOG";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x58))(param_1,iVar4,local_1f8,&local_228,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_REQ_UI_DIALOG");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x791d);
        local_248 = L"PT_REQ_UI_DIALOG";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x791e:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,4);
      uVar7 = local_res10[0]._0_4_;
      if (cVar6 != '\0') {
        uVar7 = local_res20._0_4_;
      }
      local_res10[0] = (undefined *)CONCAT44(local_res10[0]._4_4_,uVar7);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_SWF_OPEN");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x791e,L"PT_REQ_SWF_OPEN",&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        local_220 = (undefined ***)FUN_1400174a0(&local_res20,&local_d0,iVar17 + -2);
        if (local_res20 == (undefined **)0x0) {
          local_res20 = (undefined **)PTR_DAT_1405d8010;
        }
        if (*local_220 != local_res20) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          ppuVar16 = local_res20;
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          if (((local_res20 != (undefined **)0x0) &&
              (local_res20 != (undefined **)PTR_DAT_1405d8010)) &&
             (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
            uVar11 = FUN_14034fe70();
            local_210 = uVar11;
            FUN_14034ed40(uVar11);
            local_208 = 1;
            piVar3 = (int *)((longlong)ppuVar16 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(ppuVar1);
            }
            FUN_14034edd0(uVar11);
          }
          local_res20 = *local_220;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        if (((local_d0 != (undefined *)0x0) && (local_d0 != PTR_DAT_1405d8010)) &&
           (local_d0 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)(local_d0 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(local_d0 + -8);
          }
          FUN_14034edd0(uVar12);
        }
        local_220 = &local_170;
        local_d0 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_170 = (undefined **)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_170 = (undefined **)0x0;
        }
        if (local_res20 != (undefined **)PTR_DAT_1405d8010) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          FUN_1400031d0(&local_170);
          local_170 = local_res20;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        FUN_14034fe70();
        local_168 = PTR_DAT_1405d8010;
        uVar7 = FUN_14034fcf0(L"PT_REQ_SWF_OPEN");
        uVar12 = FUN_140002f00(&local_168,uVar7);
        FUN_14034fd20(uVar12,L"PT_REQ_SWF_OPEN",uVar7);
        FUN_140002fe0(&local_168);
        (**(code **)(*param_1 + 0x28))(param_1,0x791e,&local_168,&local_170);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x791e,L"PT_REQ_SWF_OPEN",ppuVar16);
        ppuVar16 = local_res20;
        if (((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
           && (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          piVar3 = (int *)((longlong)ppuVar16 + -4);
          *piVar3 = *piVar3 + -1;
          if (*piVar3 == 0) {
            FUN_14034ff60(ppuVar1);
          }
          FUN_14034edd0(uVar12);
        }
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x791e);
        local_270 = L"PT_REQ_SWF_OPEN";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x60))(param_1,iVar4,local_1f8,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_REQ_SWF_OPEN");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x791e);
        local_248 = L"PT_REQ_SWF_OPEN";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x791f:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,4);
      uVar7 = local_res10[0]._0_4_;
      if (cVar6 != '\0') {
        uVar7 = local_res20._0_4_;
      }
      local_res10[0] = (undefined *)CONCAT44(local_res10[0]._4_4_,uVar7);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_SWF_CLOSE");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x791f,L"PT_REQ_SWF_CLOSE",&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        local_220 = (undefined ***)FUN_1400174a0(&local_res20,local_b0,iVar17 + -2);
        if (local_res20 == (undefined **)0x0) {
          local_res20 = (undefined **)PTR_DAT_1405d8010;
        }
        if (*local_220 != local_res20) {
          uVar12 = FUN_14034fe70();
          local_278 = uVar12;
          FUN_14034ed40(uVar12);
          ppuVar16 = local_res20;
          local_270 = (wchar_t *)CONCAT71(local_270._1_7_,1);
          if (((local_res20 != (undefined **)0x0) &&
              (local_res20 != (undefined **)PTR_DAT_1405d8010)) &&
             (ppuVar1 = local_res20 + -1, ppuVar1 != (undefined **)0x0)) {
            uVar11 = FUN_14034fe70();
            local_210 = uVar11;
            FUN_14034ed40(uVar11);
            local_208 = 1;
            piVar3 = (int *)((longlong)ppuVar16 + -4);
            *piVar3 = *piVar3 + -1;
            if (*piVar3 == 0) {
              FUN_14034ff60(ppuVar1);
            }
            FUN_14034edd0(uVar11);
          }
          local_res20 = *local_220;
          if (((local_res20 != (undefined **)PTR_DAT_1405d8010) &&
              (local_res20 != (undefined **)0x0)) && (local_res20 != (undefined **)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        FUN_1400031d0(local_b0);
        local_220 = &local_150;
        FUN_14034fe70();
        local_150 = (undefined **)PTR_DAT_1405d8010;
        FUN_140003100(&local_150,&local_res20);
        uVar12 = FUN_140003060(local_80,L"PT_REQ_SWF_CLOSE",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x791f,uVar12,&local_150);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x791f,L"PT_REQ_SWF_CLOSE",ppuVar16);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x791f);
        local_270 = L"PT_REQ_SWF_CLOSE";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x68))(param_1,iVar4,local_1f8,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_REQ_SWF_CLOSE");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x791f);
        local_248 = L"PT_REQ_SWF_CLOSE";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x7920:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,4);
      uVar7 = local_res10[0]._0_4_;
      if (cVar6 != '\0') {
        uVar7 = local_res20._0_4_;
      }
      local_res10[0] = (undefined *)CONCAT44(local_res10[0]._4_4_,uVar7);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_QUESTION_BOX_RESPONSE");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x7920,L"PT_REQ_QUESTION_BOX_RESPONSE",
                     &DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        uVar12 = FUN_1400174a0(&local_res20,local_b8,iVar17 + -2);
        FUN_140003100(&local_res20,uVar12);
        FUN_1400031d0(local_b8);
        local_220 = &local_120;
        FUN_14034fe70();
        local_120 = (undefined **)PTR_DAT_1405d8010;
        FUN_140003100(&local_120,&local_res20);
        uVar12 = FUN_140003060(local_60,L"PT_REQ_QUESTION_BOX_RESPONSE",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7920,uVar12,&local_120);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x7920,L"PT_REQ_QUESTION_BOX_RESPONSE",ppuVar16);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7920);
        local_270 = L"PT_REQ_QUESTION_BOX_RESPONSE";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x70))(param_1,iVar4,local_1f8,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"PT_REQ_QUESTION_BOX_RESPONSE");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x7920);
        local_248 = L"PT_REQ_QUESTION_BOX_RESPONSE";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x7921:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,4);
      uVar7 = local_res10[0]._0_4_;
      if (cVar6 != '\0') {
        uVar7 = local_res20._0_4_;
      }
      local_res10[0] = (undefined *)CONCAT44(local_res10[0]._4_4_,uVar7);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_ADD_ENEMY_PP");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x7921,L"PT_REQ_ADD_ENEMY_PP",&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        uVar12 = FUN_1400174a0(&local_res20,local_a8,iVar17 + -2);
        FUN_140003100(&local_res20,uVar12);
        FUN_1400031d0(local_a8);
        local_220 = &local_140;
        FUN_14034fe70();
        local_140 = (undefined **)PTR_DAT_1405d8010;
        FUN_140003100(&local_140,&local_res20);
        uVar12 = FUN_140003060(local_50,L"PT_REQ_ADD_ENEMY_PP",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7921,uVar12,&local_140);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x7921,L"PT_REQ_ADD_ENEMY_PP",ppuVar16);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7921);
        local_270 = L"PT_REQ_ADD_ENEMY_PP";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x78))(param_1,iVar4,local_1f8,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_REQ_ADD_ENEMY_PP")
        ;
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x7921);
        local_248 = L"PT_REQ_ADD_ENEMY_PP";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x7922:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,4);
      uVar7 = local_res10[0]._0_4_;
      if (cVar6 != '\0') {
        uVar7 = local_res20._0_4_;
      }
      local_res10[0] = (undefined *)CONCAT44(local_res10[0]._4_4_,uVar7);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_SET_SINGLE_QUESTION_BOX_RESULT");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x7922,L"PT_SET_SINGLE_QUESTION_BOX_RESULT",
                     &DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        uVar12 = FUN_1400174a0(&local_res20,local_98,iVar17 + -2);
        FUN_140003100(&local_res20,uVar12);
        FUN_1400031d0(local_98);
        local_220 = &local_100;
        FUN_14034fe70();
        local_100 = (undefined **)PTR_DAT_1405d8010;
        FUN_140003100(&local_100,&local_res20);
        uVar12 = FUN_140003060(local_40,L"PT_SET_SINGLE_QUESTION_BOX_RESULT",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7922,uVar12,&local_100);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x7922,L"PT_SET_SINGLE_QUESTION_BOX_RESULT",ppuVar16
                  );
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7922);
        local_270 = L"PT_SET_SINGLE_QUESTION_BOX_RESULT";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x80))(param_1,iVar4,local_1f8,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"PT_SET_SINGLE_QUESTION_BOX_RESULT");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x7922);
        local_248 = L"PT_SET_SINGLE_QUESTION_BOX_RESULT";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x7923:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      FUN_14034fe70();
      local_res20 = (undefined **)PTR_DAT_1405d8008;
      thunk_FUN_140384ec0(param_2,&local_res20);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_REQ_EVENT_HIT_BOX_CHECK");
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x7923,L"PT_REQ_EVENT_HIT_BOX_CHECK",
                     &DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = PTR_DAT_1405d8010;
        FUN_1403a1c60(local_res10,&local_res20);
        FUN_140017790(local_res10,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) {
          iVar17 = *(int *)(local_res10[0] + -8);
        }
        uVar12 = FUN_1400174a0(local_res10,local_88,iVar17 + -2);
        FUN_140003100(local_res10,uVar12);
        FUN_1400031d0(local_88);
        local_220 = &local_130;
        FUN_14034fe70();
        local_130 = (undefined **)PTR_DAT_1405d8010;
        FUN_140003100(&local_130,local_res10);
        uVar12 = FUN_140003060(local_58,L"PT_REQ_EVENT_HIT_BOX_CHECK",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7923,uVar12,&local_130);
        puVar14 = local_res10[0];
        if (local_res10[0] == (undefined *)0x0) {
          puVar14 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x7923,L"PT_REQ_EVENT_HIT_BOX_CHECK",puVar14);
        FUN_1400031d0(local_res10);
      }
      DVar8 = 0;
      if (((char)param_1[3] == '\0') && (DVar8 = 0, *(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7923);
        local_270 = L"PT_REQ_EVENT_HIT_BOX_CHECK";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x88))(param_1,iVar4,local_1f8,&local_res20);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"PT_REQ_EVENT_HIT_BOX_CHECK");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x7923);
        local_248 = L"PT_REQ_EVENT_HIT_BOX_CHECK";
        local_240 = CONCAT44(local_240._4_4_,iVar4);
        local_238 = param_3;
        DVar9 = GetTickCount();
        local_230 = CONCAT44(local_230._4_4_,DVar9 - DVar8);
        (**(code **)(*param_1 + 0x18))(param_1,&local_250);
      }
      FUN_14000d2c0(&local_res20);
      break;
    case 0x7924:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      iVar17 = 0;
      local_res10[0] = (undefined *)((ulonglong)local_res10[0] & 0xffffffff00000000);
      local_250 = (void *)0x0;
      local_248 = (wchar_t *)0x0;
      local_240 = 0;
      FUN_14008d100(&local_250,0,local_res10);
      local_230 = 0;
      FUN_14008daa0(param_2,&local_250);
      (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_ACK_KEY");
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x7924,L"PT_ACK_KEY",&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = PTR_DAT_1405d8010;
        FUN_14008db60(local_res10,&local_250);
        FUN_140017790(local_res10,&DAT_14047edb0);
        if ((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) {
          iVar17 = *(int *)(local_res10[0] + -8);
        }
        uVar12 = FUN_1400174a0(local_res10,local_c0,iVar17 + -2);
        FUN_140003100(local_res10,uVar12);
        FUN_1400031d0(local_c0);
        local_res20 = &local_160;
        FUN_14034fe70();
        local_160 = PTR_DAT_1405d8010;
        FUN_140003100(&local_160,local_res10);
        uVar12 = FUN_140003060(local_68,L"PT_ACK_KEY",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7924,uVar12,&local_160);
        puVar14 = local_res10[0];
        if (local_res10[0] == (undefined *)0x0) {
          puVar14 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x7924,L"PT_ACK_KEY",puVar14);
        FUN_1400031d0(local_res10);
      }
      DVar8 = 0;
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7924);
        local_270 = L"PT_ACK_KEY";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x90))(param_1,iVar4,local_1f8,&local_250);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_ACK_KEY");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7924);
        local_270 = L"PT_ACK_KEY";
        local_268 = iVar4;
        local_260 = param_3;
        DVar9 = GetTickCount();
        local_258 = DVar9 - DVar8;
        (**(code **)(*param_1 + 0x18))(param_1,&local_278);
      }
      local_230 = 0;
      if (local_250 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_250);
        operator_delete(local_250);
      }
      break;
    case 0x7925:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,1);
      uVar13 = local_res10[0]._0_1_;
      if (cVar6 != '\0') {
        uVar13 = local_res20._0_1_;
      }
      local_res10[0] = (undefined *)CONCAT71(local_res10[0]._1_7_,uVar13);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_EVENT_SCENE_SET_IGNORE");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x7925,L"PT_EVENT_SCENE_SET_IGNORE",&DAT_140477960
                    );
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a18c0(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        uVar12 = FUN_1400174a0(&local_res20,local_90,iVar17 + -2);
        FUN_140003100(&local_res20,uVar12);
        FUN_1400031d0(local_90);
        local_220 = &local_158;
        FUN_14034fe70();
        local_158 = (undefined **)PTR_DAT_1405d8010;
        FUN_140003100(&local_158,&local_res20);
        uVar12 = FUN_140003060(local_48,L"PT_EVENT_SCENE_SET_IGNORE",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7925,uVar12,&local_158);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x7925,L"PT_EVENT_SCENE_SET_IGNORE",ppuVar16);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7925);
        local_270 = L"PT_EVENT_SCENE_SET_IGNORE";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0x98))(param_1,iVar4,local_1f8,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))
                  ((longlong *)param_1[2],L"PT_EVENT_SCENE_SET_IGNORE");
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x7925);
        local_248 = L"PT_EVENT_SCENE_SET_IGNORE";
        goto LAB_1400ed8ae;
      }
      break;
    case 0x7926:
      FUN_14035b390(local_1f8);
      local_1f4 = param_2[10];
      local_1f8[0] = (undefined1)param_2[0x10];
      cVar6 = FUN_1403840e0(param_2,&local_res20,1);
      uVar13 = local_res10[0]._0_1_;
      if (cVar6 != '\0') {
        uVar13 = local_res20._0_1_;
      }
      local_res10[0] = (undefined *)CONCAT71(local_res10[0]._1_7_,uVar13);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,L"PT_RESP_VOTE_DIALOG");
      DVar8 = 0;
      if (*(char *)((longlong)param_1 + 0x19) == '\0') {
        if ((char)param_1[3] == '\0') {
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar4,0x7926,L"PT_RESP_VOTE_DIALOG",&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined **)PTR_DAT_1405d8010;
        FUN_1403a18c0(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar17 = 0;
        if ((local_res20 != (undefined **)0x0) && (local_res20 != (undefined **)PTR_DAT_1405d8010))
        {
          iVar17 = *(int *)(local_res20 + -1);
        }
        uVar12 = FUN_1400174a0(&local_res20,local_a0,iVar17 + -2);
        FUN_140003100(&local_res20,uVar12);
        FUN_1400031d0(local_a0);
        local_220 = &local_148;
        FUN_14034fe70();
        local_148 = (undefined **)PTR_DAT_1405d8010;
        FUN_140003100(&local_148,&local_res20);
        uVar12 = FUN_140003060(local_78,L"PT_RESP_VOTE_DIALOG",0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7926,uVar12,&local_148);
        ppuVar16 = local_res20;
        if (local_res20 == (undefined **)0x0) {
          ppuVar16 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar4,0x7926,L"PT_RESP_VOTE_DIALOG",ppuVar16);
        FUN_1400031d0(&local_res20);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_278 = CONCAT44(local_278._4_4_,0x7926);
        local_270 = L"PT_RESP_VOTE_DIALOG";
        local_268 = iVar4;
        local_260 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_278);
        DVar8 = GetTickCount();
      }
      cVar6 = (**(code **)(*param_1 + 0xa0))(param_1,iVar4,local_1f8,local_res10);
      if (cVar6 == '\0') {
        (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_RESP_VOTE_DIALOG")
        ;
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_250 = (void *)CONCAT44(local_250._4_4_,0x7926);
        local_248 = L"PT_RESP_VOTE_DIALOG";
        goto LAB_1400ed8ae;
      }
      break;
    default:
      goto switchD_1400ead63_default;
    }
    uVar12 = 1;
  }
  return uVar12;
}



// 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::WorldC2sStub::vftable;
  FUN_140388ea0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1400ed980(undefined8 *param_1)

{
  *param_1 = RNP::WorldC2sStub::vftable;
  FUN_140388ea0();
  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::WorldS2cProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1400ed9d0(undefined8 *param_1)

{
  *param_1 = RNP::WorldS2cProxy::vftable;
  FUN_140385b20();
  return;
}



undefined8 FUN_1400ed9e0(void)

{
  return 5000;
}



undefined8 FUN_1400ed9f0(void)

{
  return 0x140c;
}



undefined8 FUN_1400eda00(void)

{
  return 6000;
}



undefined8 FUN_1400eda10(void)

{
  return 0x1783;
}



undefined8 FUN_1400eda20(void)

{
  return 0x1b6b;
}



undefined8 FUN_1400eda30(void)

{
  return 8000;
}



undefined8 FUN_1400eda40(void)

{
  return 0x1f91;
}



undefined8 FUN_1400eda50(void)

{
  return 9000;
}



undefined8 FUN_1400eda60(void)

{
  return 0x233d;
}



undefined8 FUN_1400eda70(void)

{
  return 10000;
}



undefined8 FUN_1400eda80(void)

{
  return 0x2721;
}



undefined8 FUN_1400eda90(void)

{
  return 46000;
}



undefined8 FUN_1400edaa0(void)

{
  return 0xb3be;
}



undefined1 FUN_1400edab0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1389);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVALID_PROTOCOL",0x1389);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400edb70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1389);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INVALID_PROTOCOL",0x1389);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x138a);
  FUN_140385940(local_38,param_4);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_GET_AUTH_INFO",0x138a);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x138a);
  FUN_140385940(local_38,param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_GET_AUTH_INFO",0x138a);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ede40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             int *param_5)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x138b);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(local_38,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_5 + 2));
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_GET_AUTH_INFO_01",0x138b);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400edf70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,int *param_6)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 uStack_50;
  undefined4 uStack_4c;
  undefined1 local_48 [8];
  undefined1 local_40 [8];
  longlong local_38;
  int local_2c;
  
  FUN_1403841b0(local_48);
  FUN_140383c40(local_48);
  FUN_140017c50(local_48,0x138b);
  local_58 = *param_5;
  uStack_54 = param_5[1];
  uStack_50 = param_5[2];
  uStack_4c = param_5[3];
  FUN_140090370(local_48,&local_58);
  FUN_140058470(local_48,param_6[2] - *param_6);
  puVar2 = *(undefined1 **)param_6;
  if (puVar2 != *(undefined1 **)(param_6 + 2)) {
    do {
      FUN_140058870(local_48,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_6 + 2));
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_48,L"PT_GET_AUTH_INFO_01",0x138b);
  FUN_140399690(local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ee0a0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x138c);
  FUN_140058470(local_40,param_4[2] - *param_4);
  puVar2 = *(undefined1 **)param_4;
  if (puVar2 != *(undefined1 **)(param_4 + 2)) {
    do {
      FUN_140058870(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"PT_GET_AUTH_INFO_02",0x138c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ee1a0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x138c);
  FUN_140058470(local_40,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(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"PT_GET_AUTH_INFO_02",0x138c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ee2b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x138d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_AUTH_INFO_SUCC_U",0x138d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ee370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x138d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_AUTH_INFO_SUCC_U",0x138d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ee440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x138e);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_AUTH_INFO_FAIL_U",0x138e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ee520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x138e);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_AUTH_INFO_FAIL_U",0x138e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ee600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x138f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_CHARACTER_SELECT_LIST",0x138f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ee6c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x138f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_CHARACTER_SELECT_LIST",0x138f
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ee790(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1390);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_CHARACTER_SELECT_LIST_SUCC_U",
                     0x1390);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ee850(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1390);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_CHARACTER_SELECT_LIST_SUCC_U"
                     ,0x1390);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ee920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1391);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_CHARACTER_SELECT_LIST_FAIL_U",
                     0x1391);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400eea00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1391);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GET_CHARACTER_SELECT_LIST_FAIL_U"
                     ,0x1391);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1392);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 7);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_14011ba80(local_30,lVar2);
      lVar2 = lVar2 + 0x80;
    } while (lVar2 != param_4[1]);
  }
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GET_CHARACTER_SELECT_LIST_U",0x1392
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1392);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 7);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011ba80(local_40,lVar2);
      lVar2 = lVar2 + 0x80;
    } while (lVar2 != param_5[1]);
  }
  FUN_140058470(local_40,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_GET_CHARACTER_SELECT_LIST_U",
                     0x1392);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400eed30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1393);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CREATE_CHARACTER",0x1393);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400eee20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1393);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CREATE_CHARACTER",0x1393);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400eef10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1394);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058770(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CREATE_CHARACTER_SUCC_U",0x1394);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ef0c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 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,undefined4 *param_14,undefined4 *param_15)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1394);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058770(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CREATE_CHARACTER_SUCC_U",0x1394);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ef270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1395);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CREATE_CHARACTER_FAIL_U",0x1395);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ef350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1395);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CREATE_CHARACTER_FAIL_U",0x1395);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ef430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1396);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DELETE_CHARACTER",0x1396);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ef510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1396);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DELETE_CHARACTER",0x1396);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ef5f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1397);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DELETE_CHARACTER_RESULT",0x1397);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ef6e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1397);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DELETE_CHARACTER_RESULT",0x1397);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ef7e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1398);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DIRECT_LOBBY",0x1398);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ef8c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1398);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DIRECT_LOBBY",0x1398);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ef9a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1399);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_LOAD_COMPLETE",0x1399);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400efa60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1399);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_LOAD_COMPLETE",0x1399);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400efb30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_ENTER",0x139a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400efc50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139a);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_ENTER",0x139a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400efd70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139b);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INDIVIDUAL_ROOM",0x139b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400efe90(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined1 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139b);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INDIVIDUAL_ROOM",0x139b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400effb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139c);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INDIVIDUAL_ROOM_SUCC_U",0x139c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139c);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INDIVIDUAL_ROOM_SUCC_U",0x139c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0210(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139d);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INDIVIDUAL_ROOM_COMPLETE",0x139d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f02f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139d);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INDIVIDUAL_ROOM_COMPLETE",0x139d)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f03d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139e);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_ENTER_SUCC_U",0x139e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0510(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139e);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_ENTER_SUCC_U",0x139e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139f);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_ENTER_FAIL_U",0x139f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x139f);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_ENTER_FAIL_U",0x139f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0820(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *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,undefined1 *param_15,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a0);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058870(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_ENTER_EXISTING_U",0x13a0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f09c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 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 *param_16,
             undefined4 *param_17)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a0);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058570(local_30,*param_15);
  FUN_140058870(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_ENTER_EXISTING_U",0x13a0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a1);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_ACTIVE_RANGE_LEAVE_M",0x13a1)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0c50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a1);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_ACTIVE_RANGE_LEAVE_M",
                     0x13a1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f0d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_LEAVE_SUCC_U",0x13a2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f0df0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_LEAVE_SUCC_U",0x13a2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a3);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_INVITE_PARTY",0x13a3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f0fa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a3);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_INVITE_PARTY",0x13a3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f1080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_INVITE_PARTY_SUCC_U",0x13a4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f1140(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_INVITE_PARTY_SUCC_U",0x13a4
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1210(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a5);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_INVITE_PARTY_FAIL_U",0x13a5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1300(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a5);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_INVITE_PARTY_FAIL_U",0x13a5
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13a6);
  FUN_1403859e0(local_38,param_4);
  FUN_140058470(local_38,*param_5);
  FUN_140058470(local_38,*param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_8);
  FUN_140058470(local_38,*param_9);
  FUN_140058870(local_38,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_LOBBY_INVITE_PARTY_U",0x13a6);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13a6);
  FUN_1403859e0(local_38,param_5);
  FUN_140058470(local_38,*param_6);
  FUN_140058470(local_38,*param_7);
  local_48 = *param_8;
  uStack_44 = param_8[1];
  uStack_40 = param_8[2];
  uStack_3c = param_8[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_9);
  FUN_140058470(local_38,*param_10);
  FUN_140058870(local_38,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_LOBBY_INVITE_PARTY_U",0x13a6);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13a7);
  FUN_1403859e0(local_38,param_4);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_6);
  FUN_140058470(local_38,*param_7);
  FUN_140058870(local_38,*param_8);
  FUN_140058470(local_38,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_LOBBY_INVITE_PARTY_ANSWER",0x13a7);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1820(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,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13a7);
  FUN_1403859e0(local_38,param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_7);
  FUN_140058470(local_38,*param_8);
  FUN_140058870(local_38,*param_9);
  FUN_140058470(local_38,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_LOBBY_INVITE_PARTY_ANSWER",0x13a7
                    );
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a8);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_INVITE_PARTY_ANSWER_FAIL_U",
                     0x13a8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a8);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_INVITE_PARTY_ANSWER_FAIL_U"
                     ,0x13a8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1b90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a9);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_KICK_PARTY",0x13a9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13a9);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_KICK_PARTY",0x13a9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1d50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13aa);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MASTER_CHANGE_PARTY",0x13aa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f1e30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13aa);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MASTER_CHANGE_PARTY",0x13aa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ab);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_GAME_START_FAIL_U",0x13ab);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13ab);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_LOBBY_GAME_START_FAIL_U",0x13ab);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ac);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ROOM_GAME_START_M",0x13ac);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2240(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ac);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ROOM_GAME_START_M",0x13ac);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ad);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PORTAL_MAP_WARP",0x13ad);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ad);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PORTAL_MAP_WARP",0x13ad);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ae);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RETURN_LOBBY_SUCC",0x13ae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ae);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RETURN_LOBBY_SUCC",0x13ae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2700(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13af);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ROOM_CHAR_INFO",0x13af);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13af);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ROOM_CHAR_INFO",0x13af);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f2960(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b0);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ROOM_LEAVE",0x13b0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f2a20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b0);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ROOM_LEAVE",0x13b0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2af0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b1);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_TRIGGER_STATE",0x13b1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2be0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b1);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_TRIGGER_STATE",0x13b1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2cd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b2);
  FUN_1403859e0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_NPCBOX_NPCMOTION",0x13b2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2dd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b2);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_NPCBOX_NPCMOTION",0x13b2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b3);
  FUN_1403859e0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_NPCBOX_NPC_SHOW",0x13b3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f2fd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b3);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_NPCBOX_NPC_SHOW",0x13b3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f30c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_ROULETTE",0x13b4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f3180(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_ROULETTE",0x13b4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3250(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b5);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_ADDROULETTE",0x13b5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b5);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_ADDROULETTE",0x13b5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b6);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PORTAL_MAP_WARP_RESULT",0x13b6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3500(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b6);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PORTAL_MAP_WARP_RESULT",0x13b6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined4 *puVar3;
  undefined4 local_res10 [2];
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13b7);
  FUN_140058470(local_40,*param_4);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 4);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar3 = (undefined4 *)*param_6;
  if (puVar3 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar3 = (undefined4 *)*param_7;
  if (puVar3 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar3 = (undefined4 *)*param_8;
  if (puVar3 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_8[1]);
  }
  FUN_1403859e0(local_40,param_9);
  FUN_1403859e0(local_40,param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058470(local_40,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_SEND_MAIL",0x13b7);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined4 *puVar3;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13b7);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 4);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      lVar2 = lVar2 + 0x10;
    } while (lVar2 != param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar3 = (undefined4 *)*param_7;
  if (puVar3 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar3 = (undefined4 *)*param_8;
  if (puVar3 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_8[1]);
  }
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar3 = (undefined4 *)*param_9;
  if (puVar3 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar3);
      puVar3 = puVar3 + 1;
    } while (puVar3 != (undefined4 *)param_9[1]);
  }
  FUN_1403859e0(local_40,param_10);
  FUN_1403859e0(local_40,param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_SEND_MAIL",0x13b7);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3a50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b8);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SEND_MAIL_RESULT",0x13b8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3b40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b8);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SEND_MAIL_RESULT",0x13b8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3c30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b9);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RECV_MAIL_INFO",0x13b9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3d10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13b9);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RECV_MAIL_INFO",0x13b9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ba);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058670(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  lVar2 = SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(param_13[1] - *param_13),8) +
          (param_13[1] - *param_13);
  FUN_140058470(local_30,(lVar2 >> 7) - (lVar2 >> 0x3f));
  lVar2 = *param_13;
  if (lVar2 != param_13[1]) {
    do {
      FUN_14011a790(local_30,lVar2);
      lVar2 = lVar2 + 0xb8;
    } while (lVar2 != param_13[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RECV_MAIL",0x13ba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f3fd0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 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,
             undefined4 *param_13,longlong *param_14)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13ba);
  FUN_1403a17c0(local_40,param_5);
  FUN_1403859e0(local_40,param_6);
  FUN_1403859e0(local_40,param_7);
  FUN_140058470(local_40,*param_8);
  FUN_140058470(local_40,*param_9);
  FUN_140058470(local_40,*param_10);
  FUN_140058670(local_40,*param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,*param_13);
  lVar2 = SUB168(SEXT816(-0x4de9bd37a6f4de9b) * SEXT816(param_14[1] - *param_14),8) +
          (param_14[1] - *param_14);
  FUN_140058470(local_40,(lVar2 >> 7) - (lVar2 >> 0x3f));
  lVar2 = *param_14;
  if (lVar2 != param_14[1]) {
    do {
      FUN_14011a790(local_40,lVar2);
      lVar2 = lVar2 + 0xb8;
    } while (lVar2 != param_14[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RECV_MAIL",0x13ba);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f41c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13bb);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_MAIL_OPEN",0x13bb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f42a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13bb);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_MAIL_OPEN",0x13bb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f4380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13bc);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_MAIL_ITEM_MOVE",0x13bc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f4460(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13bc);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_MAIL_ITEM_MOVE",0x13bc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f4540(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13bd);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CLEAR_MAIL",0x13bd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f4620(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13bd);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CLEAR_MAIL",0x13bd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f4700(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13be);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_MAIL_ITEM_MOVE",0x13be);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f47e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13be);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_MAIL_ITEM_MOVE",0x13be);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f48c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13bf);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_MAIL_DELETE",0x13bf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f49a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13bf);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_MAIL_DELETE",0x13bf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f4a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c0);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_MAIL_DELETE",0x13c0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f4b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c0);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_MAIL_DELETE",0x13c0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f4c60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_ALL_MAIL",0x13c1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f4d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_ALL_MAIL",0x13c1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f4df0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_RELOAD_MAIL",0x13c2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f4eb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_RELOAD_MAIL",0x13c2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f4f80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c3);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHANNEL_CHANGE",0x13c3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c3);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHANNEL_CHANGE",0x13c3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f5170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_AVATAR_CHANGE",0x13c4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f5230(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_AVATAR_CHANGE",0x13c4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5300(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c5);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RETURN_LOBBY_POS",0x13c5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c5);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RETURN_LOBBY_POS",0x13c5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5550(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c6);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_FIRST_LOGIN_EVENT",0x13c6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5640(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c6);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_FIRST_LOGIN_EVENT",0x13c6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f5740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RETURN_INDIVIDUAL_ROOM",0x13c7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f5800(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RETURN_INDIVIDUAL_ROOM",0x13c7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f58d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIVE_UP_RECOVERY",0x13c8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f5990(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIVE_UP_RECOVERY",0x13c8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f5a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RECOVERY",0x13c9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f5b20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13c9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RECOVERY",0x13c9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5bf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ca);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOG_HITTING",0x13ca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5d10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ca);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOG_HITTING",0x13ca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5e30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13cb);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOG_DAMAGE",0x13cb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f5f50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13cb);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOG_DAMAGE",0x13cb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f6070(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13cc);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_SERVER",0x13cc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f6190(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 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13cc);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_SERVER",0x13cc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13cd);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_DUNGEON_LOADING",0x13cd);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13cd);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_DUNGEON_LOADING",0x13cd);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13ce);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_REQ_LOAD_CHAR_LOBBY",0x13ce);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13ce);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_REQ_LOAD_CHAR_LOBBY",0x13ce);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f66f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13cf);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_BATTLE_INFO",0x13cf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f67b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13cf);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_BATTLE_INFO",0x13cf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f6880(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d0);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_CHANNEL_JOIN",0x13d0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f6960(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d0);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_CHANNEL_JOIN",0x13d0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13d1);
  FUN_1403859e0(local_38,param_4);
  FUN_140058470(local_38,*param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_BATTLE_SERVER_INFO",0x13d1);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13d1);
  FUN_1403859e0(local_38,param_5);
  FUN_140058470(local_38,*param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_BATTLE_SERVER_INFO",0x13d1);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f6c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESET_FATIGUE",0x13d2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f6d30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESET_FATIGUE",0x13d2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f6e00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d3);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_FATIGUE",0x13d3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f6ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d3);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_FATIGUE",0x13d3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f6fc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d4);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_GOLD_PAYMAENT_MAIL",0x13d4)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f70a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_GOLD_PAYMAENT_MAIL",
                     0x13d4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f7180(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d5);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_RETURN_MAIL",0x13d5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f7260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d5);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_RETURN_MAIL",0x13d5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f7340(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d6);
  FUN_1403a17c0(local_30,param_4);
  FUN_14004bcd0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EQUIP_ITEM_SIMPLE",0x13d6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f7430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d6);
  FUN_1403a17c0(local_30,param_5);
  FUN_14004bcd0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EQUIP_ITEM_SIMPLE",0x13d6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f7520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EQUIP_ITEM_SIMPLE_END",0x13d7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f75e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EQUIP_ITEM_SIMPLE_END",0x13d7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f76b0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d8);
  FUN_140017c50(local_30,*(undefined2 *)(param_4 + 0x20));
  FUN_140017c50(local_30,*(undefined2 *)(param_4 + 0x22));
  FUN_140017c50(local_30,*(undefined2 *)(param_4 + 0x24));
  FUN_140385a20(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OTHER_CHARACTER_INFO_RESULT",0x13d8
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13d8);
  FUN_140017c50(local_30,*(undefined2 *)(param_5 + 0x20));
  FUN_140017c50(local_30,*(undefined2 *)(param_5 + 0x22));
  FUN_140017c50(local_30,*(undefined2 *)(param_5 + 0x24));
  FUN_140385a20(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_OTHER_CHARACTER_INFO_RESULT",
                     0x13d8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f78c0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13d9);
  lVar2 = SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(param_4[1] - *param_4),8) +
          (param_4[1] - *param_4);
  FUN_140058470(local_40,(lVar2 >> 6) - (lVar2 >> 0x3f));
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_140118e50(local_40,lVar2);
      lVar2 = lVar2 + 0x6f;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_OTHER_CHARACTER_EQUIP_ITEM_RESULT",
                     0x13d9);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13d9);
  lVar2 = SUB168(SEXT816(-0x6c657a3bf6c657a3) * SEXT816(param_5[1] - *param_5),8) +
          (param_5[1] - *param_5);
  FUN_140058470(local_40,(lVar2 >> 6) - (lVar2 >> 0x3f));
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_140118e50(local_40,lVar2);
      lVar2 = lVar2 + 0x6f;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,
                     L"PT_OTHER_CHARACTER_EQUIP_ITEM_RESULT",0x13d9);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f7b10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13da);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_INVITE_PARTY_BY_NAME",0x13da)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f7bf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13da);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_INVITE_PARTY_BY_NAME",
                     0x13da);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13db);
  FUN_1403859e0(local_38,param_4);
  FUN_140058470(local_38,*param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_GUILDLOBBY_SERVER",0x13db);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f7e00(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 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13db);
  FUN_1403859e0(local_38,param_5);
  FUN_140058470(local_38,*param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_GUILDLOBBY_SERVER",0x13db);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f7f30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13dc);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_REQ_LOAD_CHAR_GUILD_LOBBY",0x13dc);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13dc);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_REQ_LOAD_CHAR_GUILD_LOBBY",0x13dc
                    );
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f8110(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13dd);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHANNEL_BONUS",0x13dd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f8250(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 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13dd);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHANNEL_BONUS",0x13dd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f83a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13de);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PORTAL_ENEMY_REARING_WARP",
                     0x13de);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f8490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13de);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PORTAL_ENEMY_REARING_WARP",
                     0x13de);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f8590(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13df);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PORTAL_ENEMY_REARING_WARP_RESULT",
                     0x13df);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f8680(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13df);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PORTAL_ENEMY_REARING_WARP_RESULT"
                     ,0x13df);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f8780(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *param_5,undefined2 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e0);
  FUN_1403a17c0(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_REARING_CREATE",0x13e0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f88c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined2 *param_6,undefined2 *param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e0);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058870(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_REARING_CREATE",0x13e0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f8a10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e1);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_REARING_CREATE",0x13e1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f8af0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e1);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_REARING_CREATE",0x13e1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f8bd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_REARING_ROOM_ENTER",0x13e2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f8c90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_REARING_ROOM_ENTER",0x13e2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f8d60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_REARING_ROOM_ENTER",0x13e3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f8e20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_REARING_ROOM_ENTER",0x13e3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f8ef0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13e4);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x36);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140017c50(local_40,*(undefined2 *)(lVar2 + 0x10));
      FUN_140385a20(local_40,lVar2 + 0x16);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x12));
      lVar2 = lVar2 + 0x36;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_REARING_LISTVIEWINFO",0x13e4);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13e4);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x36);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140017c50(local_40,*(undefined2 *)(lVar2 + 0x10));
      FUN_140385a20(local_40,lVar2 + 0x16);
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x12));
      lVar2 = lVar2 + 0x36;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_REARING_LISTVIEWINFO",0x13e4);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f9180(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             int *param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e5);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,param_5[2] - *param_5);
  puVar2 = *(undefined1 **)param_5;
  if (puVar2 != *(undefined1 **)(param_5 + 2)) {
    do {
      FUN_140058870(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_5 + 2));
  }
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_REARING_ACTION",0x13e5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f92b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,int *param_6,undefined1 *param_7)

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13e5);
  FUN_1403a17c0(local_40,param_5);
  FUN_140058470(local_40,param_6[2] - *param_6);
  puVar2 = *(undefined1 **)param_6;
  if (puVar2 != *(undefined1 **)(param_6 + 2)) {
    do {
      FUN_140058870(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != *(undefined1 **)(param_6 + 2));
  }
  FUN_140058870(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_REQ_REARING_ACTION",0x13e5);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f93e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e6);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_REARING_ACTION",0x13e6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f94c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e6);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_REARING_ACTION",0x13e6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f95a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e7);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_REARING_INFO",0x13e7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f9690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e7);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_REARING_INFO",0x13e7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f9780(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e8);
  FUN_14011db60(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_REARING_INFO",0x13e8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f9860(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e8);
  FUN_14011db60(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_REARING_INFO",0x13e8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f9940(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined2 *param_5,undefined4 *param_6,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e9);
  FUN_140058870(local_30,*param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_REARING_ENDING",0x13e9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13e9);
  FUN_140058870(local_30,*param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_REARING_ENDING",0x13e9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f9bb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ea);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_REARING_REWARD",0x13ea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f9c90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ea);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_REARING_REWARD",0x13ea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f9d70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13eb);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_REARING_REWARD",0x13eb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400f9e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13eb);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_REARING_REWARD",0x13eb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400f9f30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ec);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_REARING_BOOST",0x13ec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fa010(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ec);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_REARING_BOOST",0x13ec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fa0f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ed);
  FUN_140017c50(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_REARING_BOOST",0x13ed);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fa1d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ed);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_REARING_BOOST",0x13ed);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fa2b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ee);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_CHANNEL_LIST",0x13ee);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fa390(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ee);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_CHANNEL_LIST",0x13ee);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fa470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ef);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_CHANNEL_LIST",0x13ef);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fa570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13ef);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_CHANNEL_LIST",0x13ef);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fa680(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13f0);
  FUN_140058470(local_38,*param_4);
  FUN_1403859e0(local_38,param_5);
  FUN_140058470(local_38,*param_6);
  FUN_140058470(local_38,*param_7);
  local_48 = *param_8;
  uStack_44 = param_8[1];
  uStack_40 = param_8[2];
  uStack_3c = param_8[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_ACK_LOBBY_SERVER_INFO",0x13f0);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13f0);
  FUN_140058470(local_38,*param_5);
  FUN_1403859e0(local_38,param_6);
  FUN_140058470(local_38,*param_7);
  FUN_140058470(local_38,*param_8);
  local_48 = *param_9;
  uStack_44 = param_9[1];
  uStack_40 = param_9[2];
  uStack_3c = param_9[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_ACK_LOBBY_SERVER_INFO",0x13f0);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fa900(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_CHANNEL_CHANGE_WAIT",0x13f1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fa9c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_CHANNEL_CHANGE_WAIT",0x13f1
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400faa90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f2);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_MEMBER_ALIASE_CHANGE",0x13f2)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fab90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f2);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_MEMBER_ALIASE_CHANGE",
                     0x13f2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fac90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f3);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LOBBY_ENTER_PORTAL_ID",0x13f3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fad90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f3);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LOBBY_ENTER_PORTAL_ID",0x13f3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400faea0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_SERVER_ALIVE",0x13f4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400faf60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_SERVER_ALIVE",0x13f4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fb030(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_SERVER_ALIVE",0x13f5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fb0f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_SERVER_ALIVE",0x13f5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fb1c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f6);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_FORTUNE",0x13f6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fb2a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f6);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_FORTUNE",0x13f6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fb380(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f7);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_FORTUNE",0x13f7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x13f7);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058870(local_40,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RESP_FORTUNE",0x13f7);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fb5f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_FORTUNE_END",0x13f8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fb6b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_FORTUNE_END",0x13f8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fb780(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_MAIL_ATTACH",0x13f9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fb840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13f9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_MAIL_ATTACH",0x13f9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fb910(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fa);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_MAIL_ATTACH",0x13fa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fba00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fa);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_MAIL_ATTACH",0x13fa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fbb00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fb);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PROCESS_HEART_BIT",0x13fb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fbbc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fb);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PROCESS_HEART_BIT",0x13fb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fbc90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_PROCESS_HEART_BIT",0x13fc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fbd50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_PROCESS_HEART_BIT",0x13fc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fbe20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fd);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_REARING_DEL",0x13fd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fbf00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fd);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_REARING_DEL",0x13fd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fbfe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fe);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_REARING_DEL",0x13fe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fc0c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x13fe);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_REARING_DEL",0x13fe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13ff);
  FUN_140385940(local_38,param_4);
  FUN_140385940(local_38,param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_GET_AUTH_INFO_PWE_TYPE",0x13ff);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fc2c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x13ff);
  FUN_140385940(local_38,param_5);
  FUN_140385940(local_38,param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_GET_AUTH_INFO_PWE_TYPE",0x13ff);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fc3f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1400);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_2ND_CLASS_CREATE",0x1400);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fc4e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1400);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_2ND_CLASS_CREATE",0x1400);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fc5d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined2 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1401);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(local_30,*param_7);
  FUN_140017c50(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_2ND_CLASS_CREATE_BY_ITEM",0x1401);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1401);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(local_30,*param_8);
  FUN_140017c50(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_2ND_CLASS_CREATE_BY_ITEM",0x1401)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fc830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1402);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_MINIGAME_OPEN",0x1402);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fc910(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1402);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_MINIGAME_OPEN",0x1402);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x1403);
  FUN_1403859e0(local_38,param_4);
  FUN_140058470(local_38,*param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_RESP_MINIGAME_SERVER_INFO",0x1403);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x1403);
  FUN_1403859e0(local_38,param_5);
  FUN_140058470(local_38,*param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_RESP_MINIGAME_SERVER_INFO",0x1403
                    );
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fcc20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1404);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_MEMBER_NAME_CHANGE",0x1404);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fcd20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1404);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_MEMBER_NAME_CHANGE",0x1404)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fce20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1405);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INFO_BOOTH_MINIGAME",0x1405);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1405);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INFO_BOOTH_MINIGAME",0x1405);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fd030(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1406);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_REAL_TIME_NPC_SHOW",0x1406);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1406);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_REAL_TIME_NPC_SHOW",0x1406);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fd260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1407);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RANDOM_QUEST_CHANGE_NOTIFY",0x1407)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fd320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1407);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RANDOM_QUEST_CHANGE_NOTIFY",
                     0x1407);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x1408);
  FUN_140385940(local_38,param_4);
  FUN_140385940(local_38,param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_GET_AUTH_INFO_WAYI_TYPE",0x1408);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x1408);
  FUN_140385940(local_38,param_5);
  FUN_140385940(local_38,param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_GET_AUTH_INFO_WAYI_TYPE",0x1408);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x1409);
  FUN_140385940(local_38,param_4);
  FUN_140385940(local_38,param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058870(local_38,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_GET_AUTH_INFO_SEGA_TYPE",0x1409);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fd730(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined1 *param_8)

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x1409);
  FUN_140385940(local_38,param_5);
  FUN_140385940(local_38,param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058870(local_38,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_GET_AUTH_INFO_SEGA_TYPE",0x1409);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fd860(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined1 *param_7,undefined8 param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x140a);
  FUN_140385940(local_38,param_4);
  FUN_140385940(local_38,param_5);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058870(local_38,*param_7);
  FUN_140385940(local_38,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_GET_AUTH_INFO_XUNLEI_TYPE",0x140a);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x140a);
  FUN_140385940(local_38,param_5);
  FUN_140385940(local_38,param_6);
  local_48 = *param_7;
  uStack_44 = param_7[1];
  uStack_40 = param_7[2];
  uStack_3c = param_7[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058870(local_38,*param_8);
  FUN_140385940(local_38,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_GET_AUTH_INFO_XUNLEI_TYPE",0x140a
                    );
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x140b);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058570(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_ITEM_OPTION",0x140b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x140b);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058570(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_PARTY_ITEM_OPTION",0x140b);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fdd90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1771);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MOVE_BOOTH",0x1771);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1771);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MOVE_BOOTH",0x1771);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fdff0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1772);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OTHER_BOOTH_STATUS_INFO",0x1772);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fe0e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1772);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_OTHER_BOOTH_STATUS_INFO",0x1772);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fe1e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1773);
  FUN_140058470(local_30,*param_4);
  FUN_14011a5b0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OTHER_BOOTH_UPDATE",0x1773);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fe2d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1773);
  FUN_140058470(local_30,*param_5);
  FUN_14011a5b0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_OTHER_BOOTH_UPDATE",0x1773);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fe3c0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1774);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_OTHER_BOOTH_SET_GOLD",0x1774);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1774);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_OTHER_BOOTH_SET_GOLD",0x1774);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fe5f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1775);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_STATUS_INFO",0x1775);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fe6d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1775);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_STATUS_INFO",0x1775);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fe7b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1776);
  FUN_140058470(local_30,*param_4);
  FUN_14011a5b0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_UPDATE",0x1776);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fe8a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1776);
  FUN_140058470(local_30,*param_5);
  FUN_14011a5b0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_UPDATE",0x1776);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400fe990(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1777);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_SOLD",0x1777);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1777);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_SOLD",0x1777);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400febf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1778);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_START",0x1778);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fecb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1778);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_START",0x1778);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fed80(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1779);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_BOOTH_SET_GOLD",0x1779);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1779);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_BOOTH_SET_GOLD",0x1779);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fefb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_START_RESULT",0x177a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ff070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_START_RESULT",0x177a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ff140(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177b);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_INFO",0x177b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177b);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_INFO",0x177b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ff330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_END",0x177c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ff3f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_END",0x177c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ff4c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_END_RESULT",0x177d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ff580(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_END_RESULT",0x177d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ff650(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177e);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_REQUEST",0x177e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ff730(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177e);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_REQUEST",0x177e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ff810(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177f);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_BUY_ITEM",0x177f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ff950(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x177f);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_BUY_ITEM",0x177f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ffaa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1780);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BOOTH_BUY_ITEM_RESULT",0x1780);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1400ffbb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1780);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BOOTH_BUY_ITEM_RESULT",0x1780);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400ffcd0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1781);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0xac);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_BOOTH_LIST",0x1781);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1781);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0xac);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_BOOTH_LIST",0x1781);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1400fff20(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1782);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0xac);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_OTHER_BOOTH_LIST",0x1782);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1782);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0xac);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_OTHER_BOOTH_LIST",0x1782);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b59);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_BAN_BY_SESSION",0x1b59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b59);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_BAN_BY_SESSION",0x1b59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5a);
  FUN_1403859e0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_BAN_BY_NAME",0x1b5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5a);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_BAN_BY_NAME",0x1b5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5b);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_FRIEND_BY_SESSION",0x1b5b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100610(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5b);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_FRIEND_BY_SESSION",0x1b5b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401006f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5c);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_FRIEND_BY_NAME",0x1b5c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401007d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5c);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_FRIEND_BY_NAME",0x1b5c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401008b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5d);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEL_BAN",0x1b5d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100990(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5d);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEL_BAN",0x1b5d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100a70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5e);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEL_BAN_RESULT",0x1b5e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5e);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEL_BAN_RESULT",0x1b5e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100c50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5f);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_BAN_RESULT",0x1b5f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100d50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b5f);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_BAN_RESULT",0x1b5f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b60);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SET_BAN_MEMO",0x1b60);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140100f40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b60);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SET_BAN_MEMO",0x1b60);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140101030(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1b61);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x70);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140385a20(local_40,lVar2 + 0x10);
      FUN_140385a20(local_40,lVar2 + 0x30);
      lVar2 = lVar2 + 0x70;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_BAN_SET",0x1b61);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1b61);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x70);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_1403a17c0(local_40,lVar2);
      FUN_140385a20(local_40,lVar2 + 0x10);
      FUN_140385a20(local_40,lVar2 + 0x30);
      lVar2 = lVar2 + 0x70;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_BAN_SET",0x1b61);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401012a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b62);
  FUN_140116a90(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_FRIEND_SET",0x1b62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101380(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b62);
  FUN_140116a90(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_FRIEND_SET",0x1b62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101460(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b63);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ADD_FRIEND_RESULT",0x1b63);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101570(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b63);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ADD_FRIEND_RESULT",0x1b63);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140101690(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b64);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEL_FRIEND",0x1b64);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101770(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b64);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEL_FRIEND",0x1b64);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101850(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b65);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEL_FRIEND_RESULT",0x1b65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101940(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b65);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEL_FRIEND_RESULT",0x1b65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140101a30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b66);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_FRIEND_LIST",0x1b66);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140101af0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b66);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_FRIEND_LIST",0x1b66);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101bc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b67);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_FRIEND_INFO",0x1b67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101ca0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b67);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_FRIEND_INFO",0x1b67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101d80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b68);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BAN_INFO",0x1b68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140101e60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b68);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BAN_INFO",0x1b68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140101f40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b69);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_FRIEND_RECOMMEND",0x1b69);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140102000(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1b69);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_FRIEND_RECOMMEND",0x1b69);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401020d0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1b6a);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x28);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 9));
      FUN_140058870(local_40,*(undefined1 *)((longlong)puVar2 + 0x26));
      FUN_140385a20(local_40,puVar2 + 1);
      puVar2 = puVar2 + 10;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_FRIEND_RECOMMEND_LIST",0x1b6a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1b6a);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x28);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140017c50(local_40,*(undefined2 *)(puVar2 + 9));
      FUN_140058870(local_40,*(undefined1 *)((longlong)puVar2 + 0x26));
      FUN_140385a20(local_40,puVar2 + 1);
      puVar2 = puVar2 + 10;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_FRIEND_RECOMMEND_LIST",0x1b6a);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

undefined8 FUN_140102360(longlong *param_1,int *param_2,undefined8 param_3)

{
  undefined ***pppuVar1;
  undefined **ppuVar2;
  undefined *puVar3;
  int *piVar4;
  int iVar5;
  undefined ***pppuVar6;
  undefined *puVar7;
  char cVar8;
  undefined4 uVar9;
  DWORD DVar10;
  DWORD DVar11;
  void *pvVar12;
  undefined **ppuVar13;
  undefined8 uVar14;
  int iVar15;
  undefined1 auStack_338 [32];
  undefined *****local_318;
  undefined ***local_310;
  undefined4 *local_308;
  undefined ***local_2f8;
  void *local_2f0;
  wchar_t *local_2e8;
  undefined8 local_2e0;
  undefined8 local_2d8;
  int local_2d0;
  undefined *local_2c8;
  undefined ****local_2c0;
  undefined4 local_2b8 [4];
  undefined1 local_2a8 [4];
  int local_2a4;
  undefined8 local_270;
  undefined ***local_248;
  undefined ***local_240;
  undefined ***local_238;
  undefined ***local_230;
  undefined ***local_228;
  undefined *local_220;
  undefined ***local_218;
  undefined *local_210;
  undefined *local_208;
  undefined ***local_200;
  undefined4 local_1f8 [2];
  undefined ***local_1f0;
  undefined ***local_1e8;
  undefined ***local_1e0;
  undefined ***local_1d8;
  undefined ***local_1d0;
  undefined *local_1c8;
  undefined ***local_1c0;
  undefined *local_1b8;
  undefined ***local_1b0;
  undefined ***local_1a8;
  undefined ***local_1a0;
  undefined ***local_198;
  undefined4 local_190 [2];
  undefined *local_188;
  undefined4 local_180 [2];
  undefined *local_178;
  undefined *local_170;
  undefined *local_168;
  undefined *local_160;
  undefined *local_158;
  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];
  undefined8 local_e8;
  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];
  undefined **local_78 [2];
  undefined **local_68;
  wchar_t *local_60;
  int local_58;
  undefined8 local_50;
  int local_48;
  ulonglong local_40;
  
  local_e8 = 0xfffffffffffffffe;
  local_40 = DAT_1405d84f0 ^ (ulonglong)auStack_338;
  iVar5 = param_2[10];
  if (iVar5 == 0) {
    FUN_140385b50(param_1,0);
  }
  iVar15 = *param_2;
  cVar8 = FUN_140384a90(param_2,local_180);
  if (cVar8 == '\0') {
switchD_140102404_default:
    FUN_140383db0(param_2,(int)((iVar15 >> 0x1f & 7U) + iVar15) >> 3);
    return 0;
  }
  local_270 = param_3;
  switch(local_180[0]) {
  case 0x1b59:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_2c8);
    FUN_14034fe70();
    local_78[0] = (undefined **)PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,local_78);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_ADD_BAN_BY_SESSION");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b59,L"PT_ADD_BAN_BY_SESSION");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      local_1f8[0] = local_2c8._0_4_;
      FUN_1403a1a60(&local_2f8,local_1f8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1d20(&local_2f8,local_78);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      local_2c0 = (undefined ****)FUN_1400174a0(&local_2f8,&local_158,DVar11 - 2);
      if (local_2f8 == (undefined ***)0x0) {
        local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      }
      if (*local_2c0 != local_2f8) {
        ppuVar13 = (undefined **)FUN_14034fe70();
        local_68 = ppuVar13;
        FUN_14034ed40(ppuVar13);
        pppuVar6 = local_2f8;
        local_60 = (wchar_t *)CONCAT71(local_60._1_7_,1);
        if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010))
           && (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
          pvVar12 = (void *)FUN_14034fe70();
          local_2f0 = pvVar12;
          FUN_14034ed40(pvVar12);
          local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
          piVar4 = (int *)((longlong)pppuVar6 + -4);
          *piVar4 = *piVar4 + -1;
          if (*piVar4 == 0) {
            FUN_14034ff60(pppuVar1);
          }
          FUN_14034edd0(pvVar12);
        }
        local_2f8 = *local_2c0;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(ppuVar13);
      }
      if (((local_158 != (undefined *)0x0) && (local_158 != PTR_DAT_1405d8010)) &&
         (local_158 + -8 != (undefined *)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)(local_158 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(local_158 + -8);
        }
        FUN_14034edd0(pvVar12);
      }
      local_2c0 = &local_238;
      local_158 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_238 = (undefined ***)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_238 = (undefined ***)0x0;
      }
      if (local_2f8 != (undefined ***)PTR_DAT_1405d8010) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        FUN_1400031d0(&local_238);
        local_238 = local_2f8;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      FUN_14034fe70();
      local_1c8 = PTR_DAT_1405d8010;
      uVar9 = FUN_14034fcf0(L"PT_ADD_BAN_BY_SESSION");
      uVar14 = FUN_140002f00(&local_1c8,uVar9);
      FUN_14034fd20(uVar14,L"PT_ADD_BAN_BY_SESSION",uVar9);
      FUN_140002fe0(&local_1c8);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b59,&local_1c8,&local_238);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b59,L"PT_ADD_BAN_BY_SESSION");
      pppuVar6 = local_2f8;
      if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) &&
         (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)((longlong)pppuVar6 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(pppuVar1);
        }
        FUN_14034edd0(pvVar12);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b59);
      local_2e8 = L"PT_ADD_BAN_BY_SESSION";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    local_318 = (undefined *****)local_78;
    cVar8 = (**(code **)(*param_1 + 0x38))(param_1,iVar5,local_2a8,&local_2c8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_ADD_BAN_BY_SESSION")
      ;
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b59);
      local_2e8 = L"PT_ADD_BAN_BY_SESSION";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      DVar11 = GetTickCount();
      local_2d0 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_2f0);
    }
    ppuVar13 = local_78[0];
    if (local_78[0] == (undefined **)0x0) {
      return 1;
    }
    if (local_78[0] == (undefined **)PTR_DAT_1405d8010) {
      return 1;
    }
    ppuVar2 = local_78[0] + -1;
    if (ppuVar2 == (undefined **)0x0) {
      return 1;
    }
    pvVar12 = (void *)FUN_14034fe70();
    local_2f0 = pvVar12;
    FUN_14034ed40(pvVar12);
    local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
    piVar4 = (int *)((longlong)ppuVar13 + -4);
    *piVar4 = *piVar4 + -1;
    if (*piVar4 == 0) {
      FUN_14034ff60(ppuVar2);
    }
    FUN_14034edd0(pvVar12);
    return 1;
  case 0x1b5a:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_14034fe70();
    local_2c8 = PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,&local_2c8);
    FUN_14034fe70();
    local_78[0] = (undefined **)PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,local_78);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_ADD_BAN_BY_NAME");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b5a,L"PT_ADD_BAN_BY_NAME");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1d20(&local_2f8,&local_2c8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1d20(&local_2f8,local_78);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      local_2c0 = (undefined ****)FUN_1400174a0(&local_2f8,&local_178,DVar11 - 2);
      if (local_2f8 == (undefined ***)0x0) {
        local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      }
      if (*local_2c0 != local_2f8) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        pppuVar6 = local_2f8;
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010))
           && (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
          ppuVar13 = (undefined **)FUN_14034fe70();
          local_68 = ppuVar13;
          FUN_14034ed40(ppuVar13);
          local_60 = (wchar_t *)CONCAT71(local_60._1_7_,1);
          piVar4 = (int *)((longlong)pppuVar6 + -4);
          *piVar4 = *piVar4 + -1;
          if (*piVar4 == 0) {
            FUN_14034ff60(pppuVar1);
          }
          FUN_14034edd0(ppuVar13);
        }
        local_2f8 = *local_2c0;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      if (((local_178 != (undefined *)0x0) && (local_178 != PTR_DAT_1405d8010)) &&
         (local_178 + -8 != (undefined *)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)(local_178 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(local_178 + -8);
        }
        FUN_14034edd0(pvVar12);
      }
      local_2c0 = &local_240;
      local_178 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_240 = (undefined ***)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_240 = (undefined ***)0x0;
      }
      if (local_2f8 != (undefined ***)PTR_DAT_1405d8010) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        FUN_1400031d0(&local_240);
        local_240 = local_2f8;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      FUN_14034fe70();
      local_208 = PTR_DAT_1405d8010;
      uVar9 = FUN_14034fcf0(L"PT_ADD_BAN_BY_NAME");
      uVar14 = FUN_140002f00(&local_208,uVar9);
      FUN_14034fd20(uVar14,L"PT_ADD_BAN_BY_NAME",uVar9);
      FUN_140002fe0(&local_208);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b5a,&local_208,&local_240);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b5a,L"PT_ADD_BAN_BY_NAME");
      pppuVar6 = local_2f8;
      if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) &&
         (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)((longlong)pppuVar6 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(pppuVar1);
        }
        FUN_14034edd0(pvVar12);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5a);
      local_2e8 = L"PT_ADD_BAN_BY_NAME";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    local_318 = (undefined *****)local_78;
    cVar8 = (**(code **)(*param_1 + 0x40))(param_1,iVar5,local_2a8,&local_2c8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_ADD_BAN_BY_NAME");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5a);
      local_2e8 = L"PT_ADD_BAN_BY_NAME";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      DVar11 = GetTickCount();
      local_2d0 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_2f0);
    }
    ppuVar13 = local_78[0];
    if (((local_78[0] != (undefined **)0x0) && (local_78[0] != (undefined **)PTR_DAT_1405d8010)) &&
       (ppuVar2 = local_78[0] + -1, ppuVar2 != (undefined **)0x0)) {
      pvVar12 = (void *)FUN_14034fe70();
      local_2f0 = pvVar12;
      FUN_14034ed40(pvVar12);
      local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
      piVar4 = (int *)((longlong)ppuVar13 + -4);
      *piVar4 = *piVar4 + -1;
      if (*piVar4 == 0) {
        FUN_14034ff60(ppuVar2);
      }
      FUN_14034edd0(pvVar12);
    }
    puVar7 = local_2c8;
    if (local_2c8 == (undefined *)0x0) {
      return 1;
    }
    if (local_2c8 == PTR_DAT_1405d8010) {
      return 1;
    }
    puVar3 = local_2c8 + -8;
    if (puVar3 == (undefined *)0x0) {
      return 1;
    }
    local_78[0] = (undefined **)PTR_DAT_1405d8010;
    pvVar12 = (void *)FUN_14034fe70();
    local_2f0 = pvVar12;
    FUN_14034ed40(pvVar12);
    local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
    piVar4 = (int *)(puVar7 + -4);
    *piVar4 = *piVar4 + -1;
    if (*piVar4 == 0) {
      FUN_14034ff60(puVar3);
    }
    FUN_14034edd0(pvVar12);
    return 1;
  case 0x1b5b:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_2c8);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_ADD_FRIEND_BY_SESSION");
    iVar15 = 0;
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b5b,L"PT_ADD_FRIEND_BY_SESSION");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      local_190[0] = local_2c8._0_4_;
      FUN_1403a1a60(&local_2f8,local_190);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_2f8 + -1);
      }
      local_2c0 = (undefined ****)FUN_1400174a0(&local_2f8,&local_160,iVar15 + -2);
      if (local_2f8 == (undefined ***)0x0) {
        local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      }
      if (*local_2c0 != local_2f8) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        pppuVar6 = local_2f8;
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010))
           && (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
          ppuVar13 = (undefined **)FUN_14034fe70();
          local_68 = ppuVar13;
          FUN_14034ed40(ppuVar13);
          local_60 = (wchar_t *)CONCAT71(local_60._1_7_,1);
          piVar4 = (int *)((longlong)pppuVar6 + -4);
          *piVar4 = *piVar4 + -1;
          if (*piVar4 == 0) {
            FUN_14034ff60(pppuVar1);
          }
          FUN_14034edd0(ppuVar13);
        }
        local_2f8 = *local_2c0;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      if (((local_160 != (undefined *)0x0) && (local_160 != PTR_DAT_1405d8010)) &&
         (local_160 + -8 != (undefined *)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)(local_160 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(local_160 + -8);
        }
        FUN_14034edd0(pvVar12);
      }
      local_2c0 = &local_248;
      local_160 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_248 = (undefined ***)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_248 = (undefined ***)0x0;
      }
      if (local_2f8 != (undefined ***)PTR_DAT_1405d8010) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        FUN_1400031d0(&local_248);
        local_248 = local_2f8;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      FUN_14034fe70();
      local_188 = PTR_DAT_1405d8010;
      uVar9 = FUN_14034fcf0(L"PT_ADD_FRIEND_BY_SESSION");
      uVar14 = FUN_140002f00(&local_188,uVar9);
      FUN_14034fd20(uVar14,L"PT_ADD_FRIEND_BY_SESSION",uVar9);
      FUN_140002fe0(&local_188);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b5b,&local_188,&local_248);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b5b,L"PT_ADD_FRIEND_BY_SESSION");
      pppuVar6 = local_2f8;
      if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) &&
         (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)((longlong)pppuVar6 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(pppuVar1);
        }
        FUN_14034edd0(pvVar12);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5b);
      local_2e8 = L"PT_ADD_FRIEND_BY_SESSION";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    cVar8 = (**(code **)(*param_1 + 0x48))(param_1,iVar5,local_2a8,&local_2c8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PT_ADD_FRIEND_BY_SESSION");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5b);
    local_2e8 = L"PT_ADD_FRIEND_BY_SESSION";
    break;
  case 0x1b5c:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_14034fe70();
    local_78[0] = (undefined **)PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,local_78);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_ADD_FRIEND_BY_NAME");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b5c,L"PT_ADD_FRIEND_BY_NAME");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1d20(&local_2f8,local_78);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      local_2c0 = (undefined ****)FUN_1400174a0(&local_2f8,&local_170,DVar11 - 2);
      if (local_2f8 == (undefined ***)0x0) {
        local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      }
      if (*local_2c0 != local_2f8) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        pppuVar6 = local_2f8;
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010))
           && (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
          ppuVar13 = (undefined **)FUN_14034fe70();
          local_68 = ppuVar13;
          FUN_14034ed40(ppuVar13);
          local_60 = (wchar_t *)CONCAT71(local_60._1_7_,1);
          piVar4 = (int *)((longlong)pppuVar6 + -4);
          *piVar4 = *piVar4 + -1;
          if (*piVar4 == 0) {
            FUN_14034ff60(pppuVar1);
          }
          FUN_14034edd0(ppuVar13);
        }
        local_2f8 = *local_2c0;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      if (((local_170 != (undefined *)0x0) && (local_170 != PTR_DAT_1405d8010)) &&
         (local_170 + -8 != (undefined *)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)(local_170 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(local_170 + -8);
        }
        FUN_14034edd0(pvVar12);
      }
      local_2c0 = &local_228;
      local_170 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_228 = (undefined ***)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_228 = (undefined ***)0x0;
      }
      if (local_2f8 != (undefined ***)PTR_DAT_1405d8010) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        FUN_1400031d0(&local_228);
        local_228 = local_2f8;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      FUN_14034fe70();
      local_220 = PTR_DAT_1405d8010;
      uVar9 = FUN_14034fcf0(L"PT_ADD_FRIEND_BY_NAME");
      uVar14 = FUN_140002f00(&local_220,uVar9);
      FUN_14034fd20(uVar14,L"PT_ADD_FRIEND_BY_NAME",uVar9);
      FUN_140002fe0(&local_220);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b5c,&local_220,&local_228);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b5c,L"PT_ADD_FRIEND_BY_NAME");
      pppuVar6 = local_2f8;
      if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) &&
         (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)((longlong)pppuVar6 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(pppuVar1);
        }
        FUN_14034edd0(pvVar12);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5c);
      local_2e8 = L"PT_ADD_FRIEND_BY_NAME";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    cVar8 = (**(code **)(*param_1 + 0x50))(param_1,iVar5,local_2a8,local_78);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_ADD_FRIEND_BY_NAME")
      ;
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5c);
      local_2e8 = L"PT_ADD_FRIEND_BY_NAME";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      DVar11 = GetTickCount();
      local_2d0 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_2f0);
    }
    ppuVar13 = local_78[0];
    if (local_78[0] == (undefined **)0x0) {
      return 1;
    }
    if (local_78[0] == (undefined **)PTR_DAT_1405d8010) {
      return 1;
    }
    ppuVar2 = local_78[0] + -1;
    if (ppuVar2 == (undefined **)0x0) {
      return 1;
    }
    pvVar12 = (void *)FUN_14034fe70();
    local_2f0 = pvVar12;
    FUN_14034ed40(pvVar12);
    local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
    piVar4 = (int *)((longlong)ppuVar13 + -4);
    *piVar4 = *piVar4 + -1;
    if (*piVar4 == 0) {
      FUN_14034ff60(ppuVar2);
    }
    FUN_14034edd0(pvVar12);
    return 1;
  case 0x1b5d:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_1403a1710(param_2,local_78);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_DEL_BAN");
    iVar15 = 0;
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b5d,L"PT_DEL_BAN");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1d70(&local_2f8,local_78);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_2f8 + -1);
      }
      local_2c0 = (undefined ****)FUN_1400174a0(&local_2f8,&local_168,iVar15 + -2);
      if (local_2f8 == (undefined ***)0x0) {
        local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      }
      if (*local_2c0 != local_2f8) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        pppuVar6 = local_2f8;
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010))
           && (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
          ppuVar13 = (undefined **)FUN_14034fe70();
          local_68 = ppuVar13;
          FUN_14034ed40(ppuVar13);
          local_60 = (wchar_t *)CONCAT71(local_60._1_7_,1);
          piVar4 = (int *)((longlong)pppuVar6 + -4);
          *piVar4 = *piVar4 + -1;
          if (*piVar4 == 0) {
            FUN_14034ff60(pppuVar1);
          }
          FUN_14034edd0(ppuVar13);
        }
        local_2f8 = *local_2c0;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
         (local_168 + -8 != (undefined *)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)(local_168 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(local_168 + -8);
        }
        FUN_14034edd0(pvVar12);
      }
      local_2c0 = &local_230;
      local_168 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_230 = (undefined ***)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_230 = (undefined ***)0x0;
      }
      if (local_2f8 != (undefined ***)PTR_DAT_1405d8010) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        FUN_1400031d0(&local_230);
        local_230 = local_2f8;
        if (((local_2f8 != (undefined ***)PTR_DAT_1405d8010) && (local_2f8 != (undefined ***)0x0))
           && (local_2f8 != (undefined ***)0x8)) {
          *(int *)((longlong)local_2f8 + -4) = *(int *)((longlong)local_2f8 + -4) + 1;
        }
        FUN_14034edd0(pvVar12);
      }
      FUN_14034fe70();
      local_1b8 = PTR_DAT_1405d8010;
      uVar9 = FUN_14034fcf0(L"PT_DEL_BAN");
      uVar14 = FUN_140002f00(&local_1b8,uVar9);
      FUN_14034fd20(uVar14,L"PT_DEL_BAN",uVar9);
      FUN_140002fe0(&local_1b8);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b5d,&local_1b8,&local_230);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b5d,L"PT_DEL_BAN");
      pppuVar6 = local_2f8;
      if (((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) &&
         (pppuVar1 = local_2f8 + -1, pppuVar1 != (undefined ***)0x0)) {
        pvVar12 = (void *)FUN_14034fe70();
        local_2f0 = pvVar12;
        FUN_14034ed40(pvVar12);
        local_2e8 = (wchar_t *)CONCAT71(local_2e8._1_7_,1);
        piVar4 = (int *)((longlong)pppuVar6 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(pppuVar1);
        }
        FUN_14034edd0(pvVar12);
      }
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5d);
      local_2e8 = L"PT_DEL_BAN";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    cVar8 = (**(code **)(*param_1 + 0x58))(param_1,iVar5,local_2a8,local_78);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_DEL_BAN");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5d);
    local_2e8 = L"PT_DEL_BAN";
    break;
  case 0x1b5e:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    cVar8 = FUN_1403840e0(param_2,&local_2c8,4);
    if (cVar8 != '\0') {
      local_2b8[0] = local_2c8._0_4_;
    }
    FUN_1403a1710(param_2,local_78);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_DEL_BAN_RESULT");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b5e,L"PT_DEL_BAN_RESULT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1ac0(&local_2f8,local_2b8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1d70(&local_2f8,local_78);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_128,DVar11 - 2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_128);
      local_2c0 = &local_1e8;
      FUN_14034fe70();
      local_1e8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1e8,&local_2f8);
      uVar14 = FUN_140003060(local_80,L"PT_DEL_BAN_RESULT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b5e,uVar14,&local_1e8);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b5e,L"PT_DEL_BAN_RESULT");
      FUN_1400031d0(&local_2f8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5e);
      local_2e8 = L"PT_DEL_BAN_RESULT";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    local_318 = (undefined *****)local_78;
    cVar8 = (**(code **)(*param_1 + 0x60))(param_1,iVar5,local_2a8,local_2b8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_DEL_BAN_RESULT");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5e);
    local_2e8 = L"PT_DEL_BAN_RESULT";
    break;
  case 0x1b5f:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_1403a1710(param_2,&local_68);
    FUN_14034fe70();
    local_2c8 = PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,&local_2c8);
    FUN_14034fe70();
    local_78[0] = (undefined **)PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,local_78);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_ADD_BAN_RESULT");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b5f,L"PT_ADD_BAN_RESULT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1d70(&local_2f8,&local_68);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1d20(&local_2f8,&local_2c8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1d20(&local_2f8,local_78);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_f0,DVar11 - 2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_f0);
      local_2c0 = &local_198;
      FUN_14034fe70();
      local_198 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_198,&local_2f8);
      uVar14 = FUN_140003060(local_d8,L"PT_ADD_BAN_RESULT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b5f,uVar14,&local_198);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b5f,L"PT_ADD_BAN_RESULT");
      FUN_1400031d0(&local_2f8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5f);
      local_2e8 = L"PT_ADD_BAN_RESULT";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    local_310 = local_78;
    local_318 = (undefined *****)&local_2c8;
    cVar8 = (**(code **)(*param_1 + 0x68))(param_1,iVar5,local_2a8,&local_68);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_ADD_BAN_RESULT");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b5f);
      local_2e8 = L"PT_ADD_BAN_RESULT";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      DVar11 = GetTickCount();
      local_2d0 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_2f0);
    }
    FUN_1400031d0(local_78);
    FUN_1400031d0(&local_2c8);
    return 1;
  case 0x1b60:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_1403a1710(param_2,&local_68);
    FUN_14034fe70();
    local_78[0] = (undefined **)PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,local_78);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_SET_BAN_MEMO")
    ;
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b60,L"PT_SET_BAN_MEMO");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1d70(&local_2f8,&local_68);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1d20(&local_2f8,local_78);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_118,DVar11 - 2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_118);
      local_2c0 = &local_1d8;
      FUN_14034fe70();
      local_1d8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1d8,&local_2f8);
      uVar14 = FUN_140003060(local_88,L"PT_SET_BAN_MEMO",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b60,uVar14,&local_1d8);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b60,L"PT_SET_BAN_MEMO");
      FUN_1400031d0(&local_2f8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b60);
      local_2e8 = L"PT_SET_BAN_MEMO";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    local_318 = (undefined *****)local_78;
    cVar8 = (**(code **)(*param_1 + 0x70))(param_1,iVar5,local_2a8,&local_68);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_SET_BAN_MEMO");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b60);
      local_2e8 = L"PT_SET_BAN_MEMO";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      DVar11 = GetTickCount();
      local_2d0 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_2f0);
    }
    FUN_1400031d0(local_78);
    return 1;
  case 0x1b61:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    iVar15 = 0;
    DVar10 = 0;
    local_2f0 = (void *)0x0;
    local_2e8 = (wchar_t *)0x0;
    local_2e0 = 0;
    FUN_140116b40(param_2,&local_2f0);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_BAN_SET");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b61,L"PT_BAN_SET");
        goto LAB_14010435b;
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140116d10(&local_2f8,&local_2f0);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_138,iVar15 + -2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_138);
      local_2c0 = &local_1a8;
      FUN_14034fe70();
      local_1a8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1a8,&local_2f8);
      uVar14 = FUN_140003060(local_c8,L"PT_BAN_SET",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b61,uVar14,&local_1a8);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b61,L"PT_BAN_SET");
      FUN_1400031d0(&local_2f8);
LAB_14010435b:
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_68 = (undefined **)CONCAT44(local_68._4_4_,0x1b61);
        local_60 = L"PT_BAN_SET";
        local_58 = iVar5;
        local_50 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_68);
        DVar10 = GetTickCount();
      }
    }
    cVar8 = (**(code **)(*param_1 + 0x78))(param_1,iVar5,local_2a8,&local_2f0);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_BAN_SET");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_68 = (undefined **)CONCAT44(local_68._4_4_,0x1b61);
      local_60 = L"PT_BAN_SET";
      local_58 = iVar5;
      local_50 = param_3;
      DVar11 = GetTickCount();
      local_48 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_68);
    }
LAB_1401057f8:
    if (local_2f0 == (void *)0x0) {
      return 1;
    }
    std::_Container_base0::_Orphan_all((_Container_base0 *)&local_2f0);
    operator_delete(local_2f0);
    return 1;
  case 0x1b62:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    iVar15 = 0;
    DVar10 = 0;
    local_2f0 = (void *)0x0;
    local_2e8 = (wchar_t *)0x0;
    local_2e0 = 0;
    FUN_140116de0(param_2,&local_2f0);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_FRIEND_SET");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b62,L"PT_FRIEND_SET");
        goto LAB_1401045a3;
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_14004cd50(&local_2f8,&local_2f0);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_f8,iVar15 + -2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_f8);
      local_2c0 = &local_218;
      FUN_14034fe70();
      local_218 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_218,&local_2f8);
      uVar14 = FUN_140003060(local_98,L"PT_FRIEND_SET",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b62,uVar14,&local_218);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b62,L"PT_FRIEND_SET");
      FUN_1400031d0(&local_2f8);
LAB_1401045a3:
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_68 = (undefined **)CONCAT44(local_68._4_4_,0x1b62);
        local_60 = L"PT_FRIEND_SET";
        local_58 = iVar5;
        local_50 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_68);
        DVar10 = GetTickCount();
      }
    }
    cVar8 = (**(code **)(*param_1 + 0x80))(param_1,iVar5,local_2a8,&local_2f0);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_FRIEND_SET");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_68 = (undefined **)CONCAT44(local_68._4_4_,0x1b62);
      local_60 = L"PT_FRIEND_SET";
      local_58 = iVar5;
      local_50 = param_3;
      DVar11 = GetTickCount();
      local_48 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_68);
    }
    goto LAB_1401057f8;
  case 0x1b63:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_1403a1710(param_2,&local_68);
    FUN_14034fe70();
    local_2c0 = (undefined ****)PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,&local_2c0);
    cVar8 = FUN_1403840e0(param_2,local_78,4);
    uVar9 = local_2c8._0_4_;
    if (cVar8 != '\0') {
      uVar9 = local_78[0]._0_4_;
    }
    local_2c8 = (undefined *)CONCAT44(local_2c8._4_4_,uVar9);
    cVar8 = FUN_1403840e0(param_2,&local_2f8,4);
    if (cVar8 != '\0') {
      local_2b8[0] = local_2f8._0_4_;
    }
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_ADD_FRIEND_RESULT");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b63,L"PT_ADD_FRIEND_RESULT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1d70(&local_2f8,&local_68);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1d20(&local_2f8,&local_2c0);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1a60(&local_2f8,&local_2c8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1a60(&local_2f8,local_2b8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_150,DVar11 - 2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_150);
      local_78[0] = &local_210;
      FUN_14034fe70();
      local_210 = PTR_DAT_1405d8010;
      FUN_140003100(&local_210,&local_2f8);
      uVar14 = FUN_140003060(local_b8,L"PT_ADD_FRIEND_RESULT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b63,uVar14,&local_210);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b63,L"PT_ADD_FRIEND_RESULT");
      FUN_1400031d0(&local_2f8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b63);
      local_2e8 = L"PT_ADD_FRIEND_RESULT";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    local_308 = local_2b8;
    local_310 = (undefined ***)&local_2c8;
    local_318 = &local_2c0;
    cVar8 = (**(code **)(*param_1 + 0x88))(param_1,iVar5,local_2a8,&local_68);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_ADD_FRIEND_RESULT");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b63);
      local_2e8 = L"PT_ADD_FRIEND_RESULT";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      DVar11 = GetTickCount();
      local_2d0 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_2f0);
    }
    FUN_1400031d0(&local_2c0);
    return 1;
  case 0x1b64:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    FUN_1403a1710(param_2,&local_68);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_DEL_FRIEND");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b64,L"PT_DEL_FRIEND");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1d70(&local_2f8,&local_68);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_108,DVar11 - 2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_108);
      local_2c0 = &local_200;
      FUN_14034fe70();
      local_200 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_200,&local_2f8);
      uVar14 = FUN_140003060(local_90,L"PT_DEL_FRIEND",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b64,uVar14,&local_200);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b64,L"PT_DEL_FRIEND");
      FUN_1400031d0(&local_2f8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b64);
      local_2e8 = L"PT_DEL_FRIEND";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    cVar8 = (**(code **)(*param_1 + 0x90))(param_1,iVar5,local_2a8,&local_68);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_DEL_FRIEND");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b64);
    local_2e8 = L"PT_DEL_FRIEND";
    break;
  case 0x1b65:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    cVar8 = FUN_1403840e0(param_2,&local_2f8,4);
    uVar9 = local_2c8._0_4_;
    if (cVar8 != '\0') {
      uVar9 = local_2f8._0_4_;
    }
    local_2c8 = (undefined *)CONCAT44(local_2c8._4_4_,uVar9);
    FUN_1403a1710(param_2,&local_68);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_DEL_FRIEND_RESULT");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b65,L"PT_DEL_FRIEND_RESULT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1ac0(&local_2f8,&local_2c8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      FUN_1403a1d70(&local_2f8,&local_68);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_148,DVar11 - 2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_148);
      local_2c0 = &local_1f0;
      FUN_14034fe70();
      local_1f0 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1f0,&local_2f8);
      uVar14 = FUN_140003060(local_a8,L"PT_DEL_FRIEND_RESULT",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b65,uVar14,&local_1f0);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b65,L"PT_DEL_FRIEND_RESULT");
      FUN_1400031d0(&local_2f8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b65);
      local_2e8 = L"PT_DEL_FRIEND_RESULT";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    local_318 = (undefined *****)&local_68;
    cVar8 = (**(code **)(*param_1 + 0x98))(param_1,iVar5,local_2a8,&local_2c8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_DEL_FRIEND_RESULT");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b65);
    local_2e8 = L"PT_DEL_FRIEND_RESULT";
    break;
  case 0x1b66:
    FUN_14035b390(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"PT_REQ_FRIEND_LIST");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b66,L"PT_REQ_FRIEND_LIST");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      uVar14 = FUN_1400174a0(&local_2f8,local_140,0xfffffffe);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_140);
      local_2c0 = &local_1e0;
      FUN_14034fe70();
      local_1e0 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1e0,&local_2f8);
      uVar14 = FUN_140003060(local_e0,L"PT_REQ_FRIEND_LIST",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b66,uVar14,&local_1e0);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b66,L"PT_REQ_FRIEND_LIST");
      FUN_1400031d0(&local_2f8);
    }
    DVar10 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b66);
      local_2e8 = L"PT_REQ_FRIEND_LIST";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    cVar8 = (**(code **)(*param_1 + 0xa0))(param_1,iVar5,local_2a8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_REQ_FRIEND_LIST");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b66);
    local_2e8 = L"PT_REQ_FRIEND_LIST";
    break;
  case 0x1b67:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    cVar8 = FUN_1403840e0(param_2,&local_2f8,4);
    uVar9 = local_2c8._0_4_;
    if (cVar8 != '\0') {
      uVar9 = local_2f8._0_4_;
    }
    local_2c8 = (undefined *)CONCAT44(local_2c8._4_4_,uVar9);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_FRIEND_INFO");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b67,L"PT_FRIEND_INFO");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_2f8,&local_2c8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_130,DVar11 - 2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_130);
      local_2c0 = &local_1d0;
      FUN_14034fe70();
      local_1d0 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1d0,&local_2f8);
      uVar14 = FUN_140003060(local_d0,L"PT_FRIEND_INFO",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b67,uVar14,&local_1d0);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b67,L"PT_FRIEND_INFO");
      FUN_1400031d0(&local_2f8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b67);
      local_2e8 = L"PT_FRIEND_INFO";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    cVar8 = (**(code **)(*param_1 + 0xa8))(param_1,iVar5,local_2a8,&local_2c8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_FRIEND_INFO");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b67);
    local_2e8 = L"PT_FRIEND_INFO";
    break;
  case 0x1b68:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    cVar8 = FUN_1403840e0(param_2,&local_2f8,4);
    uVar9 = local_2c8._0_4_;
    if (cVar8 != '\0') {
      uVar9 = local_2f8._0_4_;
    }
    local_2c8 = (undefined *)CONCAT44(local_2c8._4_4_,uVar9);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,L"PT_BAN_INFO");
    DVar10 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b68,L"PT_BAN_INFO");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_2f8,&local_2c8);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      DVar11 = DVar10;
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        DVar11 = *(DWORD *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_120,DVar11 - 2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_120);
      local_2c0 = &local_1c0;
      FUN_14034fe70();
      local_1c0 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1c0,&local_2f8);
      uVar14 = FUN_140003060(local_c0,L"PT_BAN_INFO",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b68,uVar14,&local_1c0);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b68,L"PT_BAN_INFO");
      FUN_1400031d0(&local_2f8);
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b68);
      local_2e8 = L"PT_BAN_INFO";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    cVar8 = (**(code **)(*param_1 + 0xb0))(param_1,iVar5,local_2a8,&local_2c8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))((longlong *)param_1[2],L"PT_BAN_INFO");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b68);
    local_2e8 = L"PT_BAN_INFO";
    break;
  case 0x1b69:
    FUN_14035b390(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"PT_REQ_FRIEND_RECOMMEND");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b69,L"PT_REQ_FRIEND_RECOMMEND");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      uVar14 = FUN_1400174a0(&local_2f8,local_110,0xfffffffe);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_110);
      local_2c0 = &local_1b0;
      FUN_14034fe70();
      local_1b0 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1b0,&local_2f8);
      uVar14 = FUN_140003060(local_b0,L"PT_REQ_FRIEND_RECOMMEND",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b69,uVar14,&local_1b0);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b69,L"PT_REQ_FRIEND_RECOMMEND");
      FUN_1400031d0(&local_2f8);
    }
    DVar10 = 0;
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b69);
      local_2e8 = L"PT_REQ_FRIEND_RECOMMEND";
      local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
      local_2d8 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_2f0);
      DVar10 = GetTickCount();
    }
    cVar8 = (**(code **)(*param_1 + 0xb8))(param_1,iVar5,local_2a8);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PT_REQ_FRIEND_RECOMMEND");
    }
    if ((char)param_1[3] != '\0') {
      return 1;
    }
    if (*(char *)((longlong)param_1 + 0x1a) == '\0') {
      return 1;
    }
    local_2f0 = (void *)CONCAT44(local_2f0._4_4_,0x1b69);
    local_2e8 = L"PT_REQ_FRIEND_RECOMMEND";
    break;
  case 0x1b6a:
    FUN_14035b390(local_2a8);
    local_2a4 = param_2[10];
    local_2a8[0] = (undefined1)param_2[0x10];
    iVar15 = 0;
    DVar10 = 0;
    local_2f0 = (void *)0x0;
    local_2e8 = (wchar_t *)0x0;
    local_2e0 = 0;
    FUN_140116f90(param_2,&local_2f0);
    (**(code **)(*(longlong *)param_1[2] + 0x48))
              ((longlong *)param_1[2],param_2,L"PT_FRIEND_RECOMMEND_LIST");
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_318 = (undefined *****)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar5,0x1b6a,L"PT_FRIEND_RECOMMEND_LIST");
        goto LAB_140105742;
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_2f8 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140117120(&local_2f8,&local_2f0);
      FUN_140017790(&local_2f8,&DAT_14047edb0);
      if ((local_2f8 != (undefined ***)0x0) && (local_2f8 != (undefined ***)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_2f8 + -1);
      }
      uVar14 = FUN_1400174a0(&local_2f8,local_100,iVar15 + -2);
      FUN_140003100(&local_2f8,uVar14);
      FUN_1400031d0(local_100);
      local_2c0 = &local_1a0;
      FUN_14034fe70();
      local_1a0 = (undefined ***)PTR_DAT_1405d8010;
      FUN_140003100(&local_1a0,&local_2f8);
      uVar14 = FUN_140003060(local_a0,L"PT_FRIEND_RECOMMEND_LIST",0);
      (**(code **)(*param_1 + 0x28))(param_1,0x1b6a,uVar14,&local_1a0);
      local_318 = (undefined *****)local_2f8;
      if (local_2f8 == (undefined ***)0x0) {
        local_318 = (undefined *****)PTR_DAT_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar5,0x1b6a,L"PT_FRIEND_RECOMMEND_LIST");
      FUN_1400031d0(&local_2f8);
LAB_140105742:
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_68 = (undefined **)CONCAT44(local_68._4_4_,0x1b6a);
        local_60 = L"PT_FRIEND_RECOMMEND_LIST";
        local_58 = iVar5;
        local_50 = param_3;
        (**(code **)(*param_1 + 0x20))(param_1,&local_68);
        DVar10 = GetTickCount();
      }
    }
    cVar8 = (**(code **)(*param_1 + 0xc0))(param_1,iVar5,local_2a8,&local_2f0);
    if (cVar8 == '\0') {
      (**(code **)(*(longlong *)param_1[2] + 0x40))
                ((longlong *)param_1[2],L"PT_FRIEND_RECOMMEND_LIST");
    }
    if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
      local_68 = (undefined **)CONCAT44(local_68._4_4_,0x1b6a);
      local_60 = L"PT_FRIEND_RECOMMEND_LIST";
      local_58 = iVar5;
      local_50 = param_3;
      DVar11 = GetTickCount();
      local_48 = DVar11 - DVar10;
      (**(code **)(*param_1 + 0x18))(param_1,&local_68);
    }
    goto LAB_1401057f8;
  default:
    goto switchD_140102404_default;
  }
  local_2e0 = CONCAT44(local_2e0._4_4_,iVar5);
  local_2d8 = param_3;
  DVar11 = GetTickCount();
  local_2d0 = DVar11 - DVar10;
  (**(code **)(*param_1 + 0x18))(param_1,&local_2f0);
  return 1;
}



undefined1 FUN_1401058a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f41);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_CREATE",0x1f41);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140105980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f41);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_CREATE",0x1f41);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140105a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f42);
  FUN_1403859e0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_CREATE_NOTICE",0x1f42);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140105b50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f42);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_CREATE_NOTICE",0x1f42);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140105c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f43);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_INVITE",0x1f43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140105d40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f43);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_INVITE",0x1f43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140105e40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f44);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_INVITE_U",0x1f44);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140105f60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f44);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403859e0(local_30,param_8);
  FUN_1403a17c0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_INVITE_U",0x1f44);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140106090(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined8 param_6,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f45);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INVITE_GUILD_ANSWER",0x1f45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f45);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INVITE_GUILD_ANSWER",0x1f45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401062e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f46);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_INVITE_SUCC_U",0x1f46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401063c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f46);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_INVITE_SUCC_U",0x1f46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401064a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f47);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_INVITE_FAIL_U",0x1f47);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140106590(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f47);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_INVITE_FAIL_U",0x1f47);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140106680(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_LEAVE_SUCC_U",0x1f48);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140106740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_LEAVE_SUCC_U",0x1f48);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140106810(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f49);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_QUIT",0x1f49);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401068d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f49);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_QUIT",0x1f49);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401069a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4a);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_QUIT_RESULT",0x1f4a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140106a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4a);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_QUIT_RESULT",0x1f4a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140106b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_GUILD_INFO",0x1f4b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140106c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_GUILD_INFO",0x1f4b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4c);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058770(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058770(local_30,*param_11);
  FUN_140058470(local_30,param_12[1] - *param_12 >> 1);
  puVar2 = (undefined2 *)*param_12;
  if (puVar2 != (undefined2 *)param_12[1]) {
    do {
      FUN_140017c50(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_12[1]);
  }
  FUN_1403859e0(local_30,param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_INFO",0x1f4c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1f4c);
  FUN_1403a17c0(local_40,param_5);
  FUN_1403859e0(local_40,param_6);
  FUN_1403a17c0(local_40,param_7);
  FUN_140058770(local_40,*param_8);
  FUN_140058470(local_40,*param_9);
  FUN_140058470(local_40,*param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058770(local_40,*param_12);
  FUN_140058470(local_40,param_13[1] - *param_13 >> 1);
  puVar2 = (undefined2 *)*param_13;
  if (puVar2 != (undefined2 *)param_13[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_13[1]);
  }
  FUN_1403859e0(local_40,param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_GUILD_INFO",0x1f4c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140107080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4d);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_GUILD_MEMBER_INFO",0x1f4d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4d);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_GUILD_MEMBER_INFO",0x1f4d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107240(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined8 *param_10,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4e);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058670(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_MEMBER_INFO",0x1f4e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4e);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058670(local_30,*param_11);
  FUN_140058870(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_MEMBER_INFO",0x1f4e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140107520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4f);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_NOTICE",0x1f4f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f4f);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_NOTICE",0x1f4f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401076e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f50);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_ICON",0x1f50);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401077c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f50);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_ICON",0x1f50);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401078a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f51);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_MEMBER_LOGIN",0x1f51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f51);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_MEMBER_LOGIN",0x1f51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140107a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f52);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_MEMBER_LOGOUT",0x1f52);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107b40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f52);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_MEMBER_LOGOUT",0x1f52);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107c20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f53);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_LEADER_CHANGE",0x1f53);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107d10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f53);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_LEADER_CHANGE",0x1f53);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107e00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f54);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_PERMISSION_CHANGE",0x1f54);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140107f00(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f54);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_PERMISSION_CHANGE",0x1f54);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f55);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 1);
  puVar2 = (undefined2 *)*param_5;
  if (puVar2 != (undefined2 *)param_5[1]) {
    do {
      FUN_140017c50(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_PERMISSION_SET",0x1f55);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1f55);
  FUN_1403a17c0(local_40,param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 1);
  puVar2 = (undefined2 *)*param_6;
  if (puVar2 != (undefined2 *)param_6[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_GUILD_PERMISSION_SET",0x1f55);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140108260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f56);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_MEMBER_REMOVE",0x1f56);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140108350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f56);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_MEMBER_REMOVE",0x1f56);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140108440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f57);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_ROOM_ENTER_REQ",0x1f57);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140108520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f57);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_ROOM_ENTER_REQ",0x1f57);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140108600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f58);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_ROOM_OUT_REQ",0x1f58);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401086e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f58);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_ROOM_OUT_REQ",0x1f58);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401087c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f59);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_LIST_REQ",0x1f59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140108880(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f59);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_LIST_REQ",0x1f59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140108950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_DISBAND",0x1f5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140108a10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_DISBAND",0x1f5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140108ae0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5b);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_ENTER_SUCC_U",0x1f5b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140108bf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5b);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_ENTER_SUCC_U",0x1f5b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140108d10(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *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,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5c);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058870(local_30,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_ENTER_NEW_M",0x1f5c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140108ea0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 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 *param_16)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5c);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058570(local_30,*param_15);
  FUN_140058870(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_ENTER_NEW_M",0x1f5c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140109070(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *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,undefined1 *param_15,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5d);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058870(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_ENTER_EXISTING_U",0x1f5d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140109210(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 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 *param_16,
             undefined4 *param_17)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5d);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058570(local_30,*param_15);
  FUN_140058870(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_ENTER_EXISTING_U",0x1f5d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401093c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5e);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_ACTIVE_RANGE_LEAVE_M",0x1f5e)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401094a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5e);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_ACTIVE_RANGE_LEAVE_M",
                     0x1f5e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140109580(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5f);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_ACTIVE_RANGE_ENTER_BASIC_U",
                     0x1f5f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140109710(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 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)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f5f);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_ACTIVE_RANGE_ENTER_BASIC_U"
                     ,0x1f5f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401098a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f60);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OTHER_CHARACTER_INFO",0x1f60);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140109980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f60);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_OTHER_CHARACTER_INFO",0x1f60);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140109a60(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined2 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1f61);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 1);
  puVar2 = (undefined2 *)*param_4;
  if (puVar2 != (undefined2 *)param_4[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_GUILD_PERMISSION_SET_CHANGE",0x1f61
                    );
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined2 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1f61);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 1);
  puVar2 = (undefined2 *)*param_5;
  if (puVar2 != (undefined2 *)param_5[1]) {
    do {
      FUN_140017c50(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined2 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_GUILD_PERMISSION_SET_CHANGE",
                     0x1f61);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140109c90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f62);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_GRADE_CHANGE",0x1f62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140109db0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f62);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_GRADE_CHANGE",0x1f62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140109ee0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f63);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_GRADE_CHANGE_RESULT",0x1f63);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a000(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f63);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_GRADE_CHANGE_RESULT",0x1f63
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a130(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f64);
  FUN_1403859e0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_GRADE_CHANGE_NOTIFY",0x1f64);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a240(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f64);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_GRADE_CHANGE_NOTIFY",0x1f64
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a360(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f65);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_INCREASE_EXP",0x1f65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a460(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f65);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_INCREASE_EXP",0x1f65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f66);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_INCREASE_EXP_RESULT",0x1f66);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a650(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f66);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_INCREASE_EXP_RESULT",0x1f66
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f67);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_INCREASE_EXP_NOTIFY",0x1f67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f67);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_INCREASE_EXP_NOTIFY",0x1f67
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010a940(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f68);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_GUILD_INCREASE_EXP_LOG",0x1f68)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010aa30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f68);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_GUILD_INCREASE_EXP_LOG",
                     0x1f68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ab20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f69);
  FUN_1403859e0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_GUILD_INCREASE_EXP_LOG",0x1f69)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ac20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f69);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_GUILD_INCREASE_EXP_LOG",
                     0x1f69);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ad20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6a);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_LEVEL_UP",0x1f6a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ae10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6a);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_LEVEL_UP",0x1f6a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010af00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6b);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_LEVEL_UP_RESULT",0x1f6b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010aff0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6b);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_LEVEL_UP_RESULT",0x1f6b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b0e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6c);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_LEVEL_UP_NOTIFY",0x1f6c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b200(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6c);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_LEVEL_UP_NOTIFY",0x1f6c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6d);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_DEPOSIT",0x1f6d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6d);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_DEPOSIT",0x1f6d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b500(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6e);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_DEPOSIT_RESULT",
                     0x1f6e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b620(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6e);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_DEPOSIT_RESULT",
                     0x1f6e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6f);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_PAYMENT",0x1f6f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f6f);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_PAYMENT",0x1f6f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010b920(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f70);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058770(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_PAYMENT_RESULT",
                     0x1f70);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ba40(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f70);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_PAYMENT_RESULT",
                     0x1f70);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010bb60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f71);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_ITEM_LIST",0x1f71);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010bc50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f71);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_ITEM_LIST",0x1f71);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f72);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,(param_6[1] - *param_6) / 0xac);
  lVar2 = *param_6;
  if (lVar2 != param_6[1]) {
    do {
      FUN_14011a5b0(local_30,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_ITEM_LIST_RESULT",
                     0x1f72);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1f72);
  FUN_1403a17c0(local_40,param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,(param_7[1] - *param_7) / 0xac);
  lVar2 = *param_7;
  if (lVar2 != param_7[1]) {
    do {
      FUN_14011a5b0(local_40,lVar2);
      lVar2 = lVar2 + 0xac;
    } while (lVar2 != param_7[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_GUILD_STORAGE_ITEM_LIST_RESULT",
                     0x1f72);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010bfe0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f73);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_PUSH_ITEM",0x1f73);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010c120(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f73);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_PUSH_ITEM",0x1f73);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010c270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f74);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_PUSH_ITEM_RESULT",
                     0x1f74);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010c360(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f74);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_PUSH_ITEM_RESULT",
                     0x1f74);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010c450(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f75);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_POP_ITEM",0x1f75);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010c590(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f75);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_POP_ITEM",0x1f75);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010c6e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f76);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_POP_ITEM_RESULT",
                     0x1f76);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010c7d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f76);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_POP_ITEM_RESULT",
                     0x1f76);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14010c8c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f77);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_USE_LOG",0x1f77);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010c9a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f77);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_USE_LOG",0x1f77);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14010ca80(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1f78);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x85);
  puVar2 = (undefined1 *)*param_4;
  if (puVar2 != (undefined1 *)param_4[1]) {
    do {
      FUN_140058870(local_40,*puVar2);
      FUN_140385a20(local_40,puVar2 + 1);
      FUN_140385a20(local_40,puVar2 + 0x29);
      FUN_140385a20(local_40,puVar2 + 0x49);
      puVar2 = puVar2 + 0x85;
    } while (puVar2 != (undefined1 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_GUILD_STORAGE_USE_LOG_RESULT",
                     0x1f78);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1f78);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x85);
  puVar2 = (undefined1 *)*param_5;
  if (puVar2 != (undefined1 *)param_5[1]) {
    do {
      FUN_140058870(local_40,*puVar2);
      FUN_140385a20(local_40,puVar2 + 1);
      FUN_140385a20(local_40,puVar2 + 0x29);
      FUN_140385a20(local_40,puVar2 + 0x49);
      puVar2 = puVar2 + 0x85;
    } while (puVar2 != (undefined1 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_GUILD_STORAGE_USE_LOG_RESULT",
                     0x1f78);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14010cd20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f79);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CREATE_GUILD_STORAGE",0x1f79);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ce00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f79);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CREATE_GUILD_STORAGE",0x1f79);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010cee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7a);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CREATE_GUILD_STORAGE_RESULT",0x1f7a
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010cfd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7a);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CREATE_GUILD_STORAGE_RESULT",
                     0x1f7a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d0c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7b);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_EXTENSION",0x1f7b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d1b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7b);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_EXTENSION",0x1f7b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d2a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7c);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_EXTENSION_RESULT",
                     0x1f7c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d390(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7c);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_EXTENSION_RESULT",
                     0x1f7c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14010d480(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7d);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_GUILD_STORAGE_INFO",0x1f7d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7d);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_GUILD_STORAGE_INFO",0x1f7d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d640(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7e);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_GUILD_STORAGE_INFO",0x1f7e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d770(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *param_6,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7e);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058770(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_GUILD_STORAGE_INFO",0x1f7e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d8a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7f);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_GUILD_MEMBER_UPDATE",0x1f7f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010d9a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f7f);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_GUILD_MEMBER_UPDATE",0x1f7f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010daa0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined1 *param_6,undefined1 *param_7,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f80);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_GUILD_STORAGE_ITEM_MOVE",0x1f80
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f80);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_GUILD_STORAGE_ITEM_MOVE",
                     0x1f80);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010dd40(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined8 param_5,undefined1 *param_6,undefined1 *param_7,undefined8 param_8,
             undefined1 *param_9,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f81);
  FUN_140058870(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_14011a5b0(local_30,param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_14011a5b0(local_30,param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_GUILD_STORAGE_ITEM_UPDATE",
                     0x1f81);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f81);
  FUN_140058870(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_14011a5b0(local_30,param_9);
  FUN_140058870(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  FUN_14011a5b0(local_30,param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_GUILD_STORAGE_ITEM_UPDATE",
                     0x1f81);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010e020(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f82);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058770(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_GUILD_STORAGE_UPDATE",0x1f82);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010e150(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined1 *param_6,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f82);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058770(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_GUILD_STORAGE_UPDATE",0x1f82)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010e280(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined1 *param_6,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f83);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_14011a5b0(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_GUILD_STORAGE_ITEM_UPDATE2",
                     0x1f83);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f83);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_14011a5b0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_GUILD_STORAGE_ITEM_UPDATE2",
                     0x1f83);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010e4e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,longlong 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f84);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140017c50(local_30,*(undefined2 *)(param_6 + 0x10));
  FUN_140017c50(local_30,*(undefined2 *)(param_6 + 0x12));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 0x14));
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(local_30,*(undefined2 *)(param_7 + 0x10));
  FUN_140017c50(local_30,*(undefined2 *)(param_7 + 0x12));
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 0x14));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_GUILD_STORAGE_ITEM_MOVE2",
                     0x1f84);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010e640(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,longlong param_7,longlong param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f84);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140017c50(local_30,*(undefined2 *)(param_7 + 0x10));
  FUN_140017c50(local_30,*(undefined2 *)(param_7 + 0x12));
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 0x14));
  FUN_1403a17c0(local_30,param_8);
  FUN_140017c50(local_30,*(undefined2 *)(param_8 + 0x10));
  FUN_140017c50(local_30,*(undefined2 *)(param_8 + 0x12));
  FUN_140058470(local_30,*(undefined4 *)(param_8 + 0x14));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_GUILD_STORAGE_ITEM_MOVE2",
                     0x1f84);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14010e7c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f85);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_OPEN",0x1f85);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010e8a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f85);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_OPEN",0x1f85);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14010e980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f86);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_CLOSED",0x1f86);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ea60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f86);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_CLOSED",0x1f86);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010eb40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f87);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_ERROR",0x1f87);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ec20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f87);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_ERROR",0x1f87);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ed00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f88);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1403a17c0(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_PUSH_ITEM2",0x1f88);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ee50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f88);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_1403a17c0(local_30,param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_PUSH_ITEM2",0x1f88)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010efb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f89);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_1403a17c0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_STORAGE_POP_ITEM2",0x1f89);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f89);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_1403a17c0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_STORAGE_POP_ITEM2",0x1f89);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010f260(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined1 *param_6,undefined8 param_7,undefined1 *param_8,
             undefined1 *param_9,undefined8 param_10,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8a);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_1403a17c0(local_30,param_10);
  FUN_140058870(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_GUILD_STORAGE_ITEM_MOVE2",
                     0x1f8a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8a);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_1403a17c0(local_30,param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_1403a17c0(local_30,param_11);
  FUN_140058870(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_GUILD_STORAGE_ITEM_MOVE2",
                     0x1f8a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14010f540(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8b);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_GUILD_SKILL_LIST",0x1f8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010f620(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8b);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_GUILD_SKILL_LIST",0x1f8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8c);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,(param_5[1] - *param_5) / 9);
  puVar2 = (undefined1 *)*param_5;
  if (puVar2 != (undefined1 *)param_5[1]) {
    do {
      FUN_140058870(local_30,*puVar2);
      FUN_140058470(local_30,*(undefined4 *)(puVar2 + 1));
      FUN_140058470(local_30,*(undefined4 *)(puVar2 + 5));
      puVar2 = puVar2 + 9;
    } while (puVar2 != (undefined1 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_SKILL_LIST",0x1f8c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x1f8c);
  FUN_1403a17c0(local_40,param_5);
  FUN_140058470(local_40,(param_6[1] - *param_6) / 9);
  puVar2 = (undefined1 *)*param_6;
  if (puVar2 != (undefined1 *)param_6[1]) {
    do {
      FUN_140058870(local_40,*puVar2);
      FUN_140058470(local_40,*(undefined4 *)(puVar2 + 1));
      FUN_140058470(local_40,*(undefined4 *)(puVar2 + 5));
      puVar2 = puVar2 + 9;
    } while (puVar2 != (undefined1 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_GUILD_SKILL_LIST",0x1f8c);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010f9a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8d);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 5));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_SKILL_INFO",0x1f8d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010fac0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8d);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 5));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_SKILL_INFO",0x1f8d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010fbf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8e);
  FUN_140058870(local_30,*param_4);
  FUN_140058470(local_30,*(undefined4 *)(param_4 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_4 + 5));
  FUN_1403a17c0(local_30,param_4 + 9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_GUILD_SKILL_LEARN",0x1f8e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010fcf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8e);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 5));
  FUN_1403a17c0(local_30,param_5 + 9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_GUILD_SKILL_LEARN",0x1f8e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010fe00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8f);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GUILD_SKILL_LEARN_RESULT",0x1f8f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010fee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f8f);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GUILD_SKILL_LEARN_RESULT",0x1f8f)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14010ffc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f90);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 5));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_GUILD_SKILL_LEARN",0x1f90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401100d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x1f90);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 1));
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 5));
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_GUILD_SKILL_LEARN",0x1f90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401101f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2329);
  FUN_140058470(local_30,*param_4);
  FUN_140121d60(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_INFO",0x2329);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401102e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2329);
  FUN_140058470(local_30,*param_5);
  FUN_140121d60(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_INFO",0x2329);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401103d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232a);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_ADD_PLAYER",0x232a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232a);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058870(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_ADD_PLAYER",0x232a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401106e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232b);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_REMOVE_PLAYER",0x232b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401107e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232b);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_REMOVE_PLAYER",0x232b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401108f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232c);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_MASTER_PLAYER",0x232c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232c);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_MASTER_PLAYER",0x232c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140110ae0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232d);
  FUN_1403859e0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUICK_PARTY_REGISTRATION",0x232d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232d);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUICK_PARTY_REGISTRATION",0x232d)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x232e);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  FUN_1403859e0(local_38,param_5);
  FUN_140058470(local_38,*param_6);
  FUN_140058470(local_38,*param_7);
  FUN_140058470(local_38,*param_8);
  FUN_140058870(local_38,*param_9);
  FUN_140058470(local_38,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_QUICK_PARTY_MODIFICATION",0x232e);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x232e);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  FUN_1403859e0(local_38,param_6);
  FUN_140058470(local_38,*param_7);
  FUN_140058470(local_38,*param_8);
  FUN_140058470(local_38,*param_9);
  FUN_140058870(local_38,*param_10);
  FUN_140058470(local_38,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_QUICK_PARTY_MODIFICATION",0x232e)
  ;
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140111070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_QUICK_PARTY_LIST",0x232f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140111130(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x232f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_QUICK_PARTY_LIST",0x232f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140111200(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2330);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x8c);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_140121d60(local_40,lVar2);
      lVar2 = lVar2 + 0x8c;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_QUICK_PARTY_LIST",0x2330);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2330);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x8c);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_140121d60(local_40,lVar2);
      lVar2 = lVar2 + 0x8c;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_QUICK_PARTY_LIST",0x2330);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2331);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_5);
  FUN_140058470(local_38,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_REQ_PARTY_OFFER",0x2331);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2331);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_6);
  FUN_140058470(local_38,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_REQ_PARTY_OFFER",0x2331);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140111680(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2332);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_REQ_PARTY_INFO",0x2332);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2332);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_REQ_PARTY_INFO",0x2332);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2333);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_5);
  FUN_140058470(local_38,*param_6);
  FUN_1403859e0(local_38,param_7);
  FUN_140058470(local_38,*param_8);
  FUN_140058870(local_38,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_PARTY_MEMBER_INFO",0x2333);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2333);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  FUN_140058470(local_38,*param_6);
  FUN_140058470(local_38,*param_7);
  FUN_1403859e0(local_38,param_8);
  FUN_140058470(local_38,*param_9);
  FUN_140058870(local_38,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_PARTY_MEMBER_INFO",0x2333);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140111b10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2334);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_QUIT",0x2334);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140111bd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2334);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_QUIT",0x2334);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140111ca0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2335);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_QUICK_PARTY_SEARCH_LIST",0x2335
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140111d90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2335);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_QUICK_PARTY_SEARCH_LIST",
                     0x2335);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140111e90(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2336);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x8c);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_140121d60(local_40,lVar2);
      lVar2 = lVar2 + 0x8c;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_QUICK_PARTY_SERCH_LIST",0x2336);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x2336);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x8c);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_140121d60(local_40,lVar2);
      lVar2 = lVar2 + 0x8c;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_QUICK_PARTY_SERCH_LIST",0x2336);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401120e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2337);
  FUN_140058870(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PARTY_CHANGE",0x2337);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2337);
  FUN_140058870(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PARTY_CHANGE",0x2337);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140112390(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2338);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_MSG",0x2338);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401124a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2338);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_MSG",0x2338);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401125c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2339);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_INVALID_PARTY",0x2339);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x2339);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_INVALID_PARTY",0x2339);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401127a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x233a);
  FUN_140058870(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PARTY_LIST_SEARCH",0x233a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401128c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x233a);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PARTY_LIST_SEARCH",0x233a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401129e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *param_4,
             undefined1 *param_5,undefined4 *param_6,undefined4 *param_7,longlong *param_8)

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x233b);
  FUN_140058870(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,(param_8[1] - *param_8) / 0x8c);
  lVar2 = *param_8;
  if (lVar2 != param_8[1]) {
    do {
      FUN_140121d60(local_30,lVar2);
      lVar2 = lVar2 + 0x8c;
    } while (lVar2 != param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RES_PARTY_LIST_SEARCH",0x233b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x233b);
  FUN_140058870(local_40,*param_5);
  FUN_140058870(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,*param_8);
  FUN_140058470(local_40,(param_9[1] - *param_9) / 0x8c);
  lVar2 = *param_9;
  if (lVar2 != param_9[1]) {
    do {
      FUN_140121d60(local_40,lVar2);
      lVar2 = lVar2 + 0x8c;
    } while (lVar2 != param_9[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RES_PARTY_LIST_SEARCH",0x233b);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140112ce0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x233c);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_GAUGE",0x233c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140112dc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x233c);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_GAUGE",0x233c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140112ea0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2711);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_REQUEST",0x2711);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140112f90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2711);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_REQUEST",0x2711);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113080(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2712);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_ACCEPT",0x2712);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2712);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_ACCEPT",0x2712);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2713);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_REJECT",0x2713);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2713);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_REJECT",0x2713);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140113450(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2714);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_BEGIN",0x2714);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140113510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2714);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_BEGIN",0x2714);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401135e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2715);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_CANCEL",0x2715);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401136a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2715);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_CANCEL",0x2715);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113770(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2716);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_CANCEL_RESULT",0x2716);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113850(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2716);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_CANCEL_RESULT",0x2716);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113930(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2717);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_14011a5b0(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_ADD_ITEM",0x2717);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113a70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2717);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_14011a5b0(local_30,param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_ADD_ITEM",0x2717);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140113bb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2718);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_REMOVE_ITEM",0x2718);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113c90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2718);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_REMOVE_ITEM",0x2718);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113d70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2719);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_SET_GOLD",0x2719);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2719);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_SET_GOLD",0x2719);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140113f30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271a);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_FREEZE",0x271a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114010(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271a);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_FREEZE",0x271a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401140f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_CONFIRM",0x271b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1401141b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_CONFIRM",0x271b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271c);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_COMPLETE",0x271c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114360(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271c);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_COMPLETE",0x271c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271d);
  FUN_140058470(local_30,*param_4);
  FUN_14011a5b0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_ADD_ITEM_NOTIFY",0x271d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271d);
  FUN_140058470(local_30,*param_5);
  FUN_14011a5b0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_ADD_ITEM_NOTIFY",0x271d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114620(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271e);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_REMOVE_ITEM_NOTIFY",0x271e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114710(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271e);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_REMOVE_ITEM_NOTIFY",0x271e)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114800(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_SET_GOLD_NOTIFY",0x271f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401148f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x271f);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_SET_GOLD_NOTIFY",0x271f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401149f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2720);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRADE_FREEZE_NOTIFY",0x2720);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x2720);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRADE_FREEZE_NOTIFY",0x2720);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114be0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b1);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REGISTER_AUCTION_ITEM",0xb3b1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114d50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b1);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REGISTER_AUCTION_ITEM",0xb3b1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b2);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REGISTER_AUCTION_ITEM_RESULT",
                     0xb3b2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140114fa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b2);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REGISTER_AUCTION_ITEM_RESULT",
                     0xb3b2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115080(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b3);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_1403859e0(local_30,param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SEARCH_AUCTION_ITEM",0xb3b3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115210(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,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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b3);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_1403859e0(local_30,param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SEARCH_AUCTION_ITEM",0xb3b3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b4);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 8);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_14011af60(local_30,lVar2);
      lVar2 = lVar2 + 0x100;
    } while (lVar2 != param_4[1]);
  }
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SEARCH_AUCTION_ITEM_RESULT",0xb3b4)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0xb3b4);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 8);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011af60(local_40,lVar2);
      lVar2 = lVar2 + 0x100;
    } while (lVar2 != param_5[1]);
  }
  FUN_140058470(local_40,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_SEARCH_AUCTION_ITEM_RESULT",
                     0xb3b4);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b5);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SEARCH_AUCTION_TYPELIST",0xb3b5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401156f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b5);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SEARCH_AUCTION_TYPELIST",0xb3b5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b6);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 8);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_14011af60(local_30,lVar2);
      lVar2 = lVar2 + 0x100;
    } while (lVar2 != param_4[1]);
  }
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SEARCH_AUCTION_TYPELIST_RESULT",
                     0xb3b6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



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

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0xb3b6);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 8);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_14011af60(local_40,lVar2);
      lVar2 = lVar2 + 0x100;
    } while (lVar2 != param_5[1]);
  }
  FUN_140058470(local_40,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_SEARCH_AUCTION_TYPELIST_RESULT",
                     0xb3b6);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115a40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b7);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BUY_AUCTION_ITEM",0xb3b7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115b50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b7);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BUY_AUCTION_ITEM",0xb3b7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b8);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BUY_AUCTION_ITEM_RESULT",0xb3b8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115d50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b8);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BUY_AUCTION_ITEM_RESULT",0xb3b8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115e30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b9);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BID_AUCTION_ITEM",0xb3b9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140115f40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3b9);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BID_AUCTION_ITEM",0xb3b9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140116060(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3ba);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BID_AUCTION_ITEM_RESULT",0xb3ba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140116140(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3ba);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BID_AUCTION_ITEM_RESULT",0xb3ba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140116220(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3bb);
  FUN_140058470(local_30,*param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CANCLE_AUCTION_ITEM",0xb3bb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140116320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3bb);
  FUN_140058470(local_30,*param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CANCLE_AUCTION_ITEM",0xb3bb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140116430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3bc);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CANCLE_AUCTION_ITEM_RESULT",0xb3bc)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140116510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3bc);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CANCLE_AUCTION_ITEM_RESULT",
                     0xb3bc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401165f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3bd);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_AUCTION_MSG",0xb3bd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1401166f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xb3bd);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_AUCTION_MSG",0xb3bd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



// 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::TcpProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140116840(undefined8 *param_1)

{
  *param_1 = RNP::TcpProxy::vftable;
  FUN_140385b20();
  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::TcpBoothProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140116890(undefined8 *param_1)

{
  *param_1 = RNP::TcpBoothProxy::vftable;
  FUN_140385b20();
  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::TcpFriendStub::vftable;
  FUN_140388ea0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1401168e0(undefined8 *param_1)

{
  *param_1 = RNP::TcpFriendStub::vftable;
  FUN_140388ea0();
  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::TcpFriendProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140116930(undefined8 *param_1)

{
  *param_1 = RNP::TcpFriendProxy::vftable;
  FUN_140385b20();
  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::TcpGuildProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140116980(undefined8 *param_1)

{
  *param_1 = RNP::TcpGuildProxy::vftable;
  FUN_140385b20();
  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::TcpPartyProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1401169d0(undefined8 *param_1)

{
  *param_1 = RNP::TcpPartyProxy::vftable;
  FUN_140385b20();
  return;
}



void FUN_1401169e0(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::TcpTradeProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140116a30(undefined8 *param_1)

{
  *param_1 = RNP::TcpTradeProxy::vftable;
  FUN_140385b20();
  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::TcpAuctionProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_140116a80(undefined8 *param_1)

{
  *param_1 = RNP::TcpAuctionProxy::vftable;
  FUN_140385b20();
  return;
}



undefined8 FUN_140116a90(undefined8 param_1,longlong *param_2)

{
  longlong lVar1;
  
  FUN_140058470(param_1,(param_2[1] - *param_2) / 0x38);
  lVar1 = *param_2;
  if (lVar1 != param_2[1]) {
    do {
      FUN_1403a17c0(param_1,lVar1);
      FUN_140017c50(param_1,*(undefined2 *)(lVar1 + 0x30));
      FUN_140058870(param_1,*(undefined1 *)(lVar1 + 0x32));
      FUN_140058870(param_1,*(undefined1 *)(lVar1 + 0x33));
      FUN_140058470(param_1,*(undefined4 *)(lVar1 + 0x34));
      FUN_140385a20(param_1,lVar1 + 0x10);
      lVar1 = lVar1 + 0x38;
    } while (lVar1 != param_2[1]);
  }
  return param_1;
}



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

undefined8 FUN_140116b40(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;
  undefined8 local_58;
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_d8;
  FUN_1403840e0(param_1,local_b8,4);
  if (((int)local_b8[0] < 0) || (DAT_1405d8140 <= (int)local_b8[0])) {
    FUN_1403a1730(local_b8[0]);
  }
  FUN_140117410(param_2,(longlong)(int)local_b8[0]);
  FUN_140117550(param_2);
  if (0 < (int)local_b8[0]) {
    uVar4 = (ulonglong)local_b8[0];
    do {
      local_98 = 0;
      uStack_90 = 0;
      local_88 = 0;
      uStack_80 = 0;
      local_78 = 0;
      local_a8 = 0;
      uStack_a4 = 0;
      uStack_a0 = 0;
      uStack_9c = 0;
      uStack_70 = 0;
      local_68 = 0;
      uStack_60 = 0;
      local_58 = 0;
      uStack_50 = 0;
      local_48 = 0;
      uStack_40 = 0;
      FUN_14011ca90(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_1401179e0(param_2,1);
        }
        if ((void *)param_2[1] != (void *)0x0) {
          memcpy((void *)param_2[1],
                 (void *)((((longlong)&local_a8 - (longlong)puVar2) / 0x70) * 0x70 + *param_2),0x70)
          ;
        }
      }
      else {
        if (puVar1 == (undefined4 *)param_2[2]) {
          FUN_1401179e0(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] = local_58;
          puVar3[0xb] = uStack_50;
          puVar3[0xc] = local_48;
          puVar3[0xd] = uStack_40;
        }
      }
      param_2[1] = param_2[1] + 0x70;
      uVar4 = uVar4 - 1;
    } while (uVar4 != 0);
  }
  return param_1;
}



void FUN_140116d10(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x70,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 FUN_140116de0(undefined8 param_1,ulonglong *param_2)

{
  undefined4 *puVar1;
  void *_Dst;
  ulonglong uVar2;
  undefined4 *puVar3;
  undefined1 auStack_98 [32];
  uint local_78 [2];
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  FUN_1403840e0(param_1,local_78,4);
  if (((int)local_78[0] < 0) || (DAT_1405d8140 <= (int)local_78[0])) {
    FUN_1403a1730(local_78[0]);
  }
  FUN_1401175e0(param_2,(longlong)(int)local_78[0]);
  FUN_1401176d0(param_2);
  if (0 < (int)local_78[0]) {
    uVar2 = (ulonglong)local_78[0];
    do {
      local_70 = 0;
      local_40 = 0;
      local_6c = 0;
      local_68 = 0;
      local_64 = 0;
      local_60 = 0;
      local_58 = 0;
      local_50 = 0;
      local_48 = 0;
      FUN_14011c950(param_1,&local_70);
      puVar3 = (undefined4 *)param_2[1];
      if ((&local_70 < puVar3) && (puVar1 = (undefined4 *)*param_2, puVar1 <= &local_70)) {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_140117a90(param_2,1);
        }
        _Dst = (void *)param_2[1];
        puVar3 = (undefined4 *)((((longlong)&local_70 - (longlong)puVar1) / 0x38) * 0x38 + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_140116f43:
          memcpy(_Dst,puVar3,0x38);
        }
      }
      else {
        if (puVar3 == (undefined4 *)param_2[2]) {
          FUN_140117a90(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar3 = &local_70;
          goto LAB_140116f43;
        }
      }
      param_2[1] = param_2[1] + 0x38;
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0);
  }
  return param_1;
}



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

undefined8 FUN_140116f90(undefined8 param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  void *_Dst;
  undefined8 *puVar2;
  ulonglong uVar3;
  undefined1 auStack_88 [32];
  uint local_68 [2];
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined4 local_40;
  undefined2 local_3c;
  undefined1 local_3a;
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  FUN_1403840e0(param_1,local_68,4);
  if (((int)local_68[0] < 0) || (DAT_1405d8140 <= (int)local_68[0])) {
    FUN_1403a1730(local_68[0]);
  }
  FUN_140117760(param_2,(longlong)(int)local_68[0]);
  FUN_1401178a0(param_2);
  if (0 < (int)local_68[0]) {
    uVar3 = (ulonglong)local_68[0];
    do {
      local_3c = 0;
      local_3a = 0;
      local_60 = 0;
      local_58 = 0;
      local_50 = 0;
      local_48 = 0;
      local_40 = 0;
      FUN_14011cbf0(param_1,&local_60);
      puVar2 = (undefined8 *)param_2[1];
      if ((&local_60 < puVar2) && (puVar1 = (undefined8 *)*param_2, puVar1 <= &local_60)) {
        if (puVar2 == (undefined8 *)param_2[2]) {
          FUN_140117bb0(param_2,1);
        }
        puVar2 = (undefined8 *)(*param_2 + (((longlong)&local_60 - (longlong)puVar1) / 0x28) * 0x28)
        ;
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
LAB_1401170d6:
          memcpy(_Dst,puVar2,0x28);
        }
      }
      else {
        if (puVar2 == (undefined8 *)param_2[2]) {
          FUN_140117bb0(param_2,1);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar2 = &local_60;
          goto LAB_1401170d6;
        }
      }
      param_2[1] = param_2[1] + 0x28;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  return param_1;
}



void FUN_140117120(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"<Array %d>",(param_2[1] - *param_2) / 0x28,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_1401171f0(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 (0x1642c8590b21642 < 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 >> 7) - (lVar4 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0xb8);
      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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_140117c60(*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 * 0xb8);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 7) - (lVar4 >> 0x3f)) * 0xb8);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



void FUN_140117330(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(-0x4de9bd37a6f4de9b) * SEXT816(lVar2),8);
    if (pvVar1 == (void *)param_1[2]) {
      FUN_140117930(param_1,1);
    }
    if ((void *)param_1[1] != (void *)0x0) {
      memcpy((void *)param_1[1],(void *)(((lVar2 >> 7) - (lVar2 >> 0x3f)) * 0xb8 + *param_1),0xb8);
    }
    param_1[1] = param_1[1] + 0xb8;
    return;
  }
  if (pvVar1 == (void *)param_1[2]) {
    FUN_140117930(param_1,1);
  }
  if ((void *)param_1[1] != (void *)0x0) {
    memcpy((void *)param_1[1],param_2,0xb8);
  }
  param_1[1] = param_1[1] + 0xb8;
  return;
}



void FUN_140117410(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 (0x249249249249249 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x70) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x70);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140117cc0(*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 * 0x70);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x70) * 0x70);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



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

void FUN_140117550(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x70 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1401175e0(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 (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) {
    lVar4 = FUN_140117b40(param_2);
    FUN_140117d20(*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 * 0x38 + lVar4;
    param_1[1] = ((lVar2 - (longlong)pvVar1) / 0x38) * 0x38 + lVar4;
    *param_1 = lVar4;
  }
  return;
}



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

void FUN_1401176d0(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_140117760(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 (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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140117d80(*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 * 0x28);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x28) * 0x28);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



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

void FUN_1401178a0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = *param_1;
  lVar3 = param_1[1] - lVar1;
  lVar2 = lVar3 >> 0x3f;
  if ((lVar3 / 0x28 + lVar2 != lVar2) && (lVar1 != param_1[1])) {
    param_1[1] = lVar1;
  }
  return;
}



void FUN_140117930(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 >> 7) - (lVar2 >> 0x3f);
  if (0x1642c8590b21642U - 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 >> 7) - (lVar2 >> 0x3f);
  if (uVar3 < uVar4) {
    if (0x1642c8590b21642 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
    }
    else {
      uVar3 = uVar3 + (uVar3 >> 1);
    }
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_1401171f0(param_1,uVar3);
  }
  return;
}



void FUN_1401179e0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x70;
  if (0x249249249249249U - 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) / 0x70;
  if (uVar2 < uVar3) {
    if (0x249249249249249 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140117410(param_1,uVar2);
  }
  return;
}



void FUN_140117a90(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_1401175e0(param_1,uVar2);
  }
  return;
}



void * FUN_140117b40(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x492492492492493) &&
     (pvVar1 = operator_new(param_1 * 0x38), 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_1405d3608);
}



void FUN_140117bb0(longlong *param_1,longlong param_2)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x28;
  if (0x666666666666666U - 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) / 0x28;
  if (uVar2 < uVar3) {
    if (0x666666666666666 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140117760(param_1,uVar2);
  }
  return;
}



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

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



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

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



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

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



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

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



undefined8 FUN_140117de0(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_1403a1710();
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x14) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x16) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x18) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x1c) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x20) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x28) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x30) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x34) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x38) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x3c) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x40) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x44) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x2c) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x48) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 100) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x65) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x66) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x4c) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x50) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x54) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x58) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x5c) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x60) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x6c) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x6e) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x70) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x7c) = (undefined2)local_res8[0];
  }
  FUN_1403a1710(param_1,param_2 + 0x80);
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x90) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x94) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x96) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x98) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x9c) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0xa0) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x68) = local_res8[0];
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x74),4,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_1401182c0(undefined8 param_1,longlong param_2)

{
  FUN_1403a17c0();
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x10));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x14));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x16));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x18));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x1c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x24));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x28));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x30));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x34));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x3c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x2c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x48));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 100));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x65));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x66));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x50));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x54));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x58));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x5c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x60));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6e));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x70));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x7c));
  FUN_1403a17c0(param_1,param_2 + 0x80);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x90));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x94));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x96));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x98));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x9c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa0));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x68));
  FUN_140385a20(param_1,param_2 + 0x74);
  return param_1;
}



void FUN_1401184b0(undefined8 param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{%d,%d,%d,%d }",(int)*(short *)(param_2 + 0x14),
                (int)*(short *)(param_2 + 0x16),*(undefined4 *)(param_2 + 0x18),
                (int)*(short *)(param_2 + 0x1c),uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_140118570(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_1403a1710();
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x10) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x12) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x14) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x1a) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x1e) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x22) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x28) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x2c) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x30) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x34) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x38) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x3c) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x40) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x42) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x46) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x4a) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x4e) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x52) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x56) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x5a) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x5b) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x5c) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x5d) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x5f) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x61) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x6d) = (undefined2)local_res8[0];
  }
  FUN_1403a1710(param_1,param_2 + 0x6f);
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x7f) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x83) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x85) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x87) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x8b) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x8f) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x93) = local_res8[0];
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x65),4,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_140118a30(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_1403a1710();
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x10) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x12) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x14) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x1a) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x1e) = (undefined2)local_res8[0];
  }
  return param_1;
}



undefined8 FUN_140118b10(undefined8 param_1,undefined2 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *param_2 = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    param_2[3] = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 4) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 6) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 10) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xc) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xe) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    param_2[0x12] = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x13) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x15) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x17) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x19) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x1b) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x1d) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x41) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x43) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x45) = (undefined2)local_res8[0];
  }
  FUN_1403a1710(param_1,(longlong)param_2 + 0x47);
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x57) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x5b) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x5f) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)((longlong)param_2 + 0x61) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 99) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x67) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x6b) = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_140118e50(undefined8 param_1,undefined2 *param_2)

{
  FUN_140017c50(param_1,*param_2);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 1));
  FUN_140017c50(param_1,param_2[3]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 4));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 6));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 8));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 10));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xc));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xe));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x10));
  FUN_140017c50(param_1,param_2[0x12]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x13));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x15));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x17));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x19));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x1b));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x1d));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x41));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x43));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x45));
  FUN_1403a17c0(param_1,(longlong)param_2 + 0x47);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x57));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x5b));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x5f));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x61));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 99));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x67));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x6b));
  return param_1;
}



undefined8 FUN_140118fb0(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_1403a1710();
  FUN_1403a1710(param_1,param_2 + 0x10);
  cVar2 = FUN_1403840e0(param_1,&local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x31c) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 800) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x322) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x326) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x328) = CONCAT44(uStackX_c,CONCAT22(uStackX_a,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x330) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x332) = CONCAT22(uStackX_a,local_res8);
  }
  FUN_14034fe70();
  local_res20 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res18 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res20);
  thunk_FUN_140385220(param_1,&local_res18);
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x20),0x10,pwVar3);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x40),0x10,pwVar3);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x60),0x15e,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1405d8010;
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_140119270(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_1403a1710();
  FUN_1403a1710(param_1,param_2 + 0x10);
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x20) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x22) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x28) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x2a) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x2e) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x32) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x34) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x38) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x3c) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x40) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x44) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x48) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x4c) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x50) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x52) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x56) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x5a) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x5e) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x62) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x66) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x6a) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x6b) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x6c) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x6d) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x6f) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x71) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x7b) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x7d) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x7f) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x83) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x87) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x8b) = local_res8[0];
  }
  FUN_1403a1710(param_1,param_2 + 0x8f);
  return param_1;
}



undefined8 FUN_140119680(undefined8 param_1,undefined2 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *param_2 = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 4) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 6) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 10) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xc) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xe) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    param_2[3] = (undefined2)local_res8[0];
  }
  return param_1;
}



undefined8 FUN_1401197b0(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_14034fe70();
  local_res20 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res18 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res20);
  pwVar4 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s(param_2,0x10,pwVar4);
  FUN_1403a1710(param_1,param_2 + 0x10);
  FUN_1403a1710(param_1,param_2 + 0x18);
  FUN_1403a1710(param_1,param_2 + 0x20);
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x28] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x29] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x2c] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2d) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x31] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x32) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x34) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x36) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x38) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x40] = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x41) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x43) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x45) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x47) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x49) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4b) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x4d) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)((longlong)param_2 + 0x9b) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x4e) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0x9d) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0x9f) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xa1) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xa5) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xa9) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xad) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0x10f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0xb1) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0xb3) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xb5) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xb9) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  thunk_FUN_140385220(param_1,&local_res18);
  pwVar4 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0xbd),0x10,pwVar4);
  FUN_1403a1710(param_1,(longlong)param_2 + 0xdd);
  FUN_1403a1710(param_1,(longlong)param_2 + 0xed);
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0xfd) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)((longlong)param_2 + 0x101) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(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_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0x10d) = CONCAT11(uStackX_9,local_res8);
  }
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0x117),0x1e,pwVar4);
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)((longlong)param_2 + 0x153) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(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_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  pwVar4 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  pwVar4 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1405d8010;
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  return param_1;
}



undefined8 FUN_140119ea0(undefined8 param_1,longlong param_2)

{
  FUN_140385a20();
  FUN_1403a17c0(param_1,param_2 + 0x20);
  FUN_1403a17c0(param_1,param_2 + 0x30);
  FUN_1403a17c0(param_1,param_2 + 0x40);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x50));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x52));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x54));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x58));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x5a));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x5e));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x62));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 100));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x68));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x6c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x70));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x74));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x78));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x7c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x80));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x82));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x86));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x8a));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x8e));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x92));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x96));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x9a));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x9b));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x9c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x9d));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x9f));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa1));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa5));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa9));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xad));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x10f));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0xb1));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0xb3));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xb5));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xb9));
  FUN_140385a20(param_1,param_2 + 0xbd);
  FUN_1403a17c0(param_1,param_2 + 0xdd);
  FUN_1403a17c0(param_1,param_2 + 0xed);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xfd));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x101));
  FUN_140058770(param_1,*(undefined8 *)(param_2 + 0x105));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x10d));
  FUN_140385a20(param_1,param_2 + 0x117);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x153));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x155));
  return param_1;
}



undefined8 FUN_14011a150(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_1403a1710();
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x14) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x16) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x18) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x1c) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x20) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x28) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x30) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x34) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x38) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x3c) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x40) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x44) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x2c) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x48) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 100) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x65) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x66) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x4c) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x50) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x54) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x58) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x5c) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x60) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x6c) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x6e) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x70) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x7c) = (undefined2)local_res8[0];
  }
  FUN_1403a1710(param_1,param_2 + 0x80);
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x90) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x94) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x96) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x98) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x9c) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xa0) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x68) = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_14011a5b0(undefined8 param_1,longlong param_2)

{
  FUN_1403a17c0();
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x10));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x14));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x16));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x18));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x1c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x24));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x28));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x30));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x34));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x3c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x2c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x48));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 100));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x65));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x66));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x50));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x54));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x58));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x5c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x60));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6e));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x70));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x7c));
  FUN_1403a17c0(param_1,param_2 + 0x80);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x90));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x94));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x96));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x98));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x9c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa0));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x68));
  return param_1;
}



undefined8 FUN_14011a790(undefined8 param_1,longlong param_2)

{
  FUN_1403a17c0(param_1,param_2 + 0xa8);
  FUN_1403a17c0(param_1,param_2);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x14));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x16));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x18));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x1c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x24));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x28));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x30));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x34));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x3c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x2c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x48));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 100));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x65));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x66));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x50));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x54));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x58));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x5c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x60));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6e));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x70));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x7c));
  FUN_1403a17c0(param_1,param_2 + 0x80);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x90));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x94));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x96));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x98));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x9c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa0));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x68));
  return param_1;
}



undefined8 FUN_14011a980(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;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res18 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_1403a1710(param_1,param_2);
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x14) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x16) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x18) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x1c) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x20) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x24) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x28) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x30) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x34) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x38) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x40) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x44) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x48) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x50) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x54) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x58) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x5c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x60) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 100) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x65) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x66) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x6c) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x6e) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x94) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x96) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x98) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x9c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xa0) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x68) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_1403a1710(param_1,param_2 + 0xa8);
  FUN_1403a1710(param_1,param_2 + 0xb8);
  thunk_FUN_140385220(param_1,&local_res18);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 200),0x10,pwVar3);
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xe8) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xec) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_1403a1710(param_1,param_2 + 0x100);
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x110),0x10,pwVar3);
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x130) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x134) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x138) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  pwVar3 = local_res10;
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x7c) = CONCAT11(uStackX_9,local_res8);
  }
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res18;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1405d8010;
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_14011af60(undefined8 param_1,longlong param_2)

{
  FUN_1403a17c0();
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x14));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x16));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x18));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x1c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x24));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x28));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x30));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x34));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x3c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x2c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x48));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x50));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x54));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x58));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x5c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x60));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 100));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x65));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x66));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6e));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x94));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x96));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x98));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x9c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa0));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x68));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa8));
  FUN_140385a20(param_1,param_2 + 0xac);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xcc));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xd0));
  FUN_140385a20(param_1,param_2 + 0xd4);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xf4));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xf8));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xfc));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x7c));
  return param_1;
}



bool FUN_14011b180(longlong *param_1)

{
  bool bVar1;
  
  bVar1 = false;
  if ((*param_1 != 0) || (param_1[1] != 0)) {
    bVar1 = true;
  }
  if ((!bVar1) && ((int)param_1[3] == 0)) {
    return *(short *)((longlong)param_1 + 0x1c) < 1;
  }
  return false;
}



undefined8 FUN_14011b1c0(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_1403a1710();
  FUN_1403a1710(param_1,param_2 + 0x10);
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x20) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x42) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x44) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x46) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(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_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x50) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x54) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x58) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x5c) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x5e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x62) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 100) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x68) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_1403a1710(param_1,param_2 + 0x6c);
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x7c) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x7e) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x80) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x82) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x84) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x88) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x8a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x8e) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(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_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x9b) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x90) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x91) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x92) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x9f) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa0) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa1) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa2) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa3) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa4) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0xa5) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xa6) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xa8) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xaa) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xac) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xae) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xb0) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xb2) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xb4) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xb6) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xba) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xbe) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xc0) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0xc4) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xc6) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(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_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xd2) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xd6) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_14034fe70();
  local_res20 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res20);
  pwVar3 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x22),0x10,pwVar3);
  FUN_14034fe70();
  local_res18 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res18);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0xda),0x14,pwVar3);
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x102),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1405d8010;
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



void FUN_14011b9d0(undefined8 param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %d %s }",(int)*(short *)(param_2 + 0x20),param_2 + 0x22,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14011ba80(undefined8 param_1,longlong param_2)

{
  FUN_1403a17c0();
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x30));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x32));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x33));
  FUN_140058770(param_1,*(undefined8 *)(param_2 + 0x38));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x48));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x50));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x54));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x58));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x5c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x5e));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x60));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x62));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 100));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x66));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x68));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6a));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x6c));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x6e));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x70));
  FUN_140058670(param_1,*(undefined8 *)(param_2 + 0x78));
  FUN_140385a20(param_1,param_2 + 0x10);
  return param_1;
}



undefined8 FUN_14011bbc0(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_1403840e0(param_1,local_res8,2,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    param_2[0x10] = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    param_2[0x11] = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    param_2[0x12] = local_res8[0];
  }
  FUN_14034fe70();
  local_res18 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res18);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s(param_2,0x10,pwVar3);
  pwVar3 = local_res18;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



void FUN_14011bce0(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_14034fe70();
  local_res18[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res18,L"{ %s }",param_2,param_4,uVar4);
  FUN_140017520(param_1,local_res18);
  puVar3 = local_res18[0];
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res18[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14011bd90(undefined8 param_1,undefined8 *param_2)

{
  char cVar1;
  undefined4 local_res8;
  undefined4 uStackX_c;
  
  cVar1 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    *param_2 = CONCAT44(uStackX_c,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x14) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    param_2[3] = CONCAT44(uStackX_c,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 4) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x24) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 5) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x2c) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 6) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x34) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 7) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x3c) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x44) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 9) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x4c) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 10) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x54) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 2) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0xc) = local_res8;
  }
  return param_1;
}



void FUN_14011bff0(undefined8 param_1,undefined8 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %I64d %d %d %d }",*param_2,*(undefined4 *)(param_2 + 1),
                *(undefined4 *)(param_2 + 4),*(undefined4 *)((longlong)param_2 + 0x24),uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14011c0b0(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_1403840e0(param_1,local_res8,2);
  if (cVar2 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res10,2);
  if (cVar2 != '\0') {
    param_2[0x11] = local_res10[0];
  }
  cVar2 = FUN_1403840e0(param_1,&local_30,8);
  if (cVar2 != '\0') {
    *(undefined8 *)(param_2 + 0x12) = local_30;
  }
  cVar2 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x16) = local_res18[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res20,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x18) = local_res20[0];
  }
  FUN_14034fe70();
  local_38 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_38);
  pwVar4 = local_38;
  if (local_38 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s(param_2 + 1,0x10,pwVar4);
  pwVar4 = local_38;
  if (((local_38 != (wchar_t *)0x0) && (local_38 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_38 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    local_30 = uVar3;
    FUN_14034ed40(uVar3);
    local_28 = 1;
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  return param_1;
}



undefined8 FUN_14011c200(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_1403a1710();
  FUN_1403a1710(param_1,param_2 + 0x10);
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x20) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x22) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x84) = local_res8[0];
  }
  FUN_14034fe70();
  local_res18[0] = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,local_res18);
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x24),0x10,pwVar3);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x44),0x20,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1405d8010;
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_14011c3c0(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_1403a1710();
  FUN_1403a1710(param_1,param_2 + 0x38);
  lVar6 = 8;
  cVar2 = FUN_1403840e0(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_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x50) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x54) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x58) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x2c2) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x2c6) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x2c4) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x2c8) = local_res8;
  }
  puVar4 = (undefined2 *)(param_2 + 0x2b2);
  do {
    cVar2 = FUN_1403840e0(param_1,&local_res8,2);
    if (cVar2 != '\0') {
      *puVar4 = CONCAT11(uStackX_9,local_res8);
    }
    puVar4 = puVar4 + 1;
    lVar6 = lVar6 + -1;
  } while (lVar6 != 0);
  FUN_14034fe70();
  local_res20 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res18 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res20);
  thunk_FUN_140385220(param_1,&local_res18);
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar5 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar5 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcsncpy_s((wchar_t *)(param_2 + 0x10),0x14,pwVar5,0x13);
  pwVar5 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar5 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcsncpy_s((wchar_t *)(param_2 + 0x5a),100,pwVar5,99);
  pwVar5 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar5 = (wchar_t *)PTR_DAT_1405d8010;
  }
  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_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar5 = pwVar5 + -2;
    *(int *)pwVar5 = *(int *)pwVar5 + -1;
    if (*(int *)pwVar5 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  pwVar5 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar5 = pwVar5 + -2;
    *(int *)pwVar5 = *(int *)pwVar5 + -1;
    if (*(int *)pwVar5 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  pwVar5 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1405d8010;
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar5 = pwVar5 + -2;
    *(int *)pwVar5 = *(int *)pwVar5 + -1;
    if (*(int *)pwVar5 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  return param_1;
}



void FUN_14011c6d0(undefined8 param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %s %d }",param_2 + 0x10,(int)*(short *)(param_2 + 0x58),uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14011c780(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_1403a1710();
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x50) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x52) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x54) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,8,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x56) = CONCAT62(uStackX_a,local_res8);
  }
  FUN_14034fe70();
  local_res18[0] = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,local_res18);
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x10),0x10,pwVar3);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x30),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1405d8010;
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_14011c950(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_1403a1710();
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x30) = (undefined2)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x32) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x33) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x34) = local_res8[0];
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x10),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_14011ca90(undefined8 param_1,longlong param_2)

{
  wchar_t *pwVar1;
  undefined8 uVar2;
  wchar_t *pwVar3;
  wchar_t *local_res8;
  wchar_t *local_res10;
  
  FUN_1403a1710();
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res8 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  thunk_FUN_140385220(param_1,&local_res8);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x10),0x10,pwVar3);
  pwVar3 = local_res8;
  if (local_res8 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x30),0x20,pwVar3);
  pwVar3 = local_res8;
  if (((local_res8 != (wchar_t *)0x0) && (local_res8 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res8 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar2 = FUN_14034fe70();
    FUN_14034ed40(uVar2);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar2);
  }
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res8 = (wchar_t *)PTR_DAT_1405d8010;
    uVar2 = FUN_14034fe70();
    FUN_14034ed40(uVar2);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar2);
  }
  return param_1;
}



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

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined2 local_res8 [4];
  wchar_t *local_res10;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_140384b70();
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x26) = (undefined1)local_res8[0];
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 4),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_14011ccf0(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_1403a1710();
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  FUN_14034fe70();
  local_res18[0] = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,local_res18);
  pwVar3 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x14),0x14,pwVar3);
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x3c),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1405d8010;
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



void FUN_14011ce60(undefined8 param_1,undefined4 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %d %d }",*param_2,param_2[1],uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14011cf10(undefined8 param_1,longlong param_2)

{
  FUN_140384b70();
  FUN_140384b70(param_1,param_2 + 4);
  FUN_1403a1710(param_1,param_2 + 8);
  return param_1;
}



void FUN_14011cf50(undefined8 param_1,short *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined *local_res10 [3];
  
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %s %d %d }",param_2 + 0x17,(int)*param_2,(int)param_2[2]);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8
FUN_14011d010(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_1403840e0(param_1,&local_res8,2,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[1] = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[2] = local_res8;
  }
  FUN_1403a1710(param_1,param_2 + 7);
  FUN_1403a1710(param_1,param_2 + 0xf);
  cVar2 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 3) = CONCAT62(uStackX_a,local_res8);
  }
  FUN_14034fe70();
  local_res18[0] = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,local_res18);
  pwVar4 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcsncpy_s(param_2 + 0x17,0x10,pwVar4,0xf);
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcsncpy_s(param_2 + 0x27,0x10,pwVar4,0xf);
  pwVar4 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  pwVar4 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1405d8010;
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  return param_1;
}



void FUN_14011d1f0(undefined8 param_1,undefined1 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %d %d }",*(undefined4 *)(param_2 + 1),*param_2,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14011d2a0(undefined8 param_1,undefined1 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *param_2 = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  FUN_1403a1710(param_1,param_2 + 5);
  FUN_1403a1710(param_1,param_2 + 0x15);
  return param_1;
}



undefined8 FUN_14011d310(undefined8 param_1,undefined1 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *param_2 = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 5) = local_res8[0];
  }
  return param_1;
}



void FUN_14011d390(undefined8 param_1,undefined1 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %d %d }",*(undefined4 *)(param_2 + 5),*param_2,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8
FUN_14011d440(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_1403840e0(param_1,local_res8,1,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8[0];
  }
  FUN_14034fe70();
  local_res20 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res20);
  pwVar4 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 1),0x14,pwVar4);
  FUN_14034fe70();
  local_res18 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res18);
  pwVar4 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x29),0x10,pwVar4);
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x49),0x1e,pwVar4);
  pwVar4 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  pwVar4 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  pwVar4 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1405d8010;
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  return param_1;
}



undefined8 FUN_14011d630(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_1403840e0(param_1,local_res8,2,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    param_2[0x20] = local_res8[0];
  }
  FUN_14034fe70();
  local_res18[0] = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,local_res18);
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar4 = local_res18[0];
  if (local_res18[0] == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s(param_2,0x20,pwVar4);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s(param_2 + 0x21,0x10,pwVar4);
  pwVar4 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  pwVar4 = local_res18[0];
  if (((local_res18[0] != (wchar_t *)0x0) && (local_res18[0] != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18[0] + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res10 = (wchar_t *)PTR_DAT_1405d8010;
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  return param_1;
}



undefined8
FUN_14011d790(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_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *param_2 = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    param_2[1] = local_res8;
  }
  FUN_1403a1710(param_1,param_2 + 2);
  FUN_1403a1710(param_1,param_2 + 10);
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x12) = CONCAT22(uStackX_a,local_res8);
  }
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s(param_2 + 0x14,0x10,pwVar3);
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x24] = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x25) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x27) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x29) = CONCAT44(uStackX_c,CONCAT22(uStackX_a,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2d) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x2f) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x31) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    param_2[0x33] = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x34) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x36) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x38) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3a) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3c) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x3e) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x40) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x42) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x44) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x46) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x48) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4a) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4c) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4e) = CONCAT22(uStackX_a,local_res8);
  }
  cVar2 = FUN_1403840e0(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_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_14011db60(undefined8 param_1,undefined2 *param_2)

{
  FUN_140017c50(param_1,*param_2);
  FUN_140017c50(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 10);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x12));
  FUN_140385a20(param_1,param_2 + 0x14);
  FUN_140017c50(param_1,param_2[0x24]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x25));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x27));
  FUN_140058670(param_1,*(undefined8 *)(param_2 + 0x29));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x2d));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x2f));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x31));
  FUN_140017c50(param_1,param_2[0x33]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x34));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x36));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x3a));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x3c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x3e));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x42));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x46));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x48));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x4a));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x4e));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x50));
  return param_1;
}



undefined8 FUN_14011dcf0(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_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_1403a1710(param_1,param_2);
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x14) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x18) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x1c) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x20) = local_res8[0];
  }
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x24),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_14011de50(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_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_1403a1710(param_1,param_2);
  FUN_1403a1710(param_1,param_2 + 0x10);
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x20) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x28) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x2c) = local_res8[0];
  }
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x30),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_14011dfa0(undefined8 param_1,longlong param_2)

{
  FUN_140385a20();
  FUN_140385a20(param_1,param_2 + 0x40);
  FUN_1403a17c0(param_1,param_2 + 0x80);
  FUN_140058770(param_1,*(undefined8 *)(param_2 + 0x90));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x98));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x9c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa0));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xa4));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0xa8));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0xa9));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xac));
  return param_1;
}



void FUN_14011e060(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_14034fe70();
  local_res10 = PTR_DAT_1405d8010;
  plVar3 = (longlong *)FUN_14011ecb0(&local_res18,param_2 + 1);
  puVar4 = (undefined *)*plVar3;
  if ((undefined *)*plVar3 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_140017720(&local_res10,L"{ %d %s }",*param_2,puVar4,uVar5);
  if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1405d8010)) &&
     (local_res18 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    FUN_14034ed40(uVar5);
    piVar1 = (int *)(local_res18 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18 + -8);
    }
    FUN_14034edd0(uVar5);
  }
  FUN_140017520(param_1,&local_res10);
  puVar4 = local_res10;
  if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) &&
     (puVar2 = local_res10 + -8, puVar2 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    FUN_14034ed40(uVar5);
    piVar1 = (int *)(puVar4 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



undefined8
FUN_14011e180(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_1403840e0(param_1,&local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8;
  }
  FUN_1403a1710(param_1,param_2 + 1);
  FUN_1403a1710(param_1,param_2 + 5);
  cVar2 = FUN_1403840e0(param_1,&local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 9) = (undefined1)local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)((longlong)param_2 + 0x25) = (undefined1)local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)((longlong)param_2 + 0x26) = (undefined1)local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)((longlong)param_2 + 0x2a9) = CONCAT44(uStackX_c,local_res8);
  }
  FUN_14034fe70();
  local_res20 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res18 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res20);
  thunk_FUN_140385220(param_1,&local_res18);
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res20;
  if (local_res20 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0x27),0x10,pwVar3);
  pwVar3 = local_res18;
  if (local_res18 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)((longlong)param_2 + 0x47),0x32,pwVar3);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  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_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res18;
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  if (((local_res18 != (wchar_t *)0x0) && (local_res18 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res18 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  pwVar3 = local_res20;
  if (((local_res20 != (wchar_t *)0x0) && (local_res20 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res20 + -4, pwVar1 != (wchar_t *)0x0)) {
    local_res18 = (wchar_t *)PTR_DAT_1405d8010;
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



void FUN_14011e3f0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %s }",param_2 + 8,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8
FUN_14011e4a0(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_1403840e0(param_1,local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    param_2[1] = local_res8[0];
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 2),0x80,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



void FUN_14011e5a0(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res18 [2];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res18[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res18,L"{ %d }",*param_2,param_4,uVar4);
  FUN_140017520(param_1,local_res18);
  puVar3 = local_res18[0];
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res18[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_14011e650(undefined8 param_1,undefined4 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    param_2[1] = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    param_2[2] = local_res8[0];
  }
  return param_1;
}



undefined8
FUN_14011e6d0(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_1403840e0(param_1,local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar2 != '\0') {
    *param_2 = local_res8[0];
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar4 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar4 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 1),0x40,pwVar4);
  pwVar4 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    pwVar4 = pwVar4 + -2;
    *(int *)pwVar4 = *(int *)pwVar4 + -1;
    if (*(int *)pwVar4 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar3);
  }
  return param_1;
}



undefined8
FUN_14011e7b0(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_1403840e0(param_1,&local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar5 != '\0') {
    *param_2 = local_res8._0_4_;
  }
  FUN_1403a1710(param_1,param_2 + 1);
  cVar5 = FUN_1403840e0(param_1,&local_res8,4,param_4,uVar7);
  if (cVar5 != '\0') {
    param_2[0xd] = local_res8._0_4_;
  }
  cVar5 = FUN_1403840e0(param_1,&local_res8,4,param_4,uVar7);
  if (cVar5 != '\0') {
    param_2[0xe] = local_res8._0_4_;
  }
  cVar5 = FUN_1403840e0(param_1,&local_res8,1,param_4,uVar7);
  if (cVar5 != '\0') {
    *(undefined1 *)(param_2 + 0xf) = local_res8._0_1_;
  }
  cVar5 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar5 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x3d) = local_res8._0_4_;
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  puVar3 = PTR_DAT_1405d8010;
  local_res8 = PTR_DAT_1405d8010;
  FUN_14034fe70();
  puVar4 = PTR_DAT_1405d8010;
  local_res18 = PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar6 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar6 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 5),0x10,pwVar6);
  if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
     (puVar4 + -8 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar1 = (int *)(puVar4 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar4 + -8);
    }
    FUN_14034edd0(uVar7);
  }
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar3 + -8);
    }
    FUN_14034edd0(uVar7);
  }
  pwVar6 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar2 = local_res10 + -4, pwVar2 != (wchar_t *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    pwVar6 = pwVar6 + -2;
    *(int *)pwVar6 = *(int *)pwVar6 + -1;
    if (*(int *)pwVar6 == 0) {
      FUN_14034ff60(pwVar2);
    }
    FUN_14034edd0(uVar7);
  }
  return param_1;
}



undefined8
FUN_14011e9c0(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_1403840e0(param_1,local_res8,4,param_4,0xfffffffffffffffe);
  if (cVar3 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar3 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar7);
  if (cVar3 != '\0') {
    param_2[1] = local_res8[0];
  }
  cVar3 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar7);
  if (cVar3 != '\0') {
    param_2[2] = local_res8[0];
  }
  cVar3 = FUN_1403840e0(param_1,local_res8,1,param_4,uVar7);
  if (cVar3 != '\0') {
    *(undefined1 *)(param_2 + 3) = (undefined1)local_res8[0];
  }
  cVar3 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar7);
  if (cVar3 != '\0') {
    param_2[4] = local_res8[0];
  }
  cVar3 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar3 != '\0') {
    param_2[5] = local_res8[0];
  }
  cVar3 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar3 != '\0') {
    param_2[6] = local_res8[0];
  }
  cVar3 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar3 != '\0') {
    param_2[7] = local_res8[0];
  }
  cVar3 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar3 != '\0') {
    *(undefined1 *)(param_2 + 8) = (undefined1)local_res8[0];
  }
  FUN_14034fe70();
  local_res20 = (short *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res18 = (short *)PTR_DAT_1405d8010;
  FUN_14034fe70();
  local_res10 = (short *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res20);
  thunk_FUN_140385220(param_1,&local_res18);
  thunk_FUN_140385220(param_1,&local_res10);
  psVar5 = local_res20;
  if (local_res20 == (short *)0x0) {
    psVar5 = (short *)PTR_DAT_1405d8010;
  }
  uVar4 = 0xffffffffffffffff;
  psVar6 = psVar5;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar2 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_2 + 10,psVar5,~uVar4 - 1);
  psVar5 = local_res18;
  if (local_res18 == (short *)0x0) {
    psVar5 = (short *)PTR_DAT_1405d8010;
  }
  uVar4 = 0xffffffffffffffff;
  psVar6 = psVar5;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar2 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_2 + 0x14,psVar5,~uVar4 - 1);
  psVar5 = local_res10;
  if (local_res10 == (short *)0x0) {
    psVar5 = (short *)PTR_DAT_1405d8010;
  }
  uVar4 = 0xffffffffffffffff;
  psVar6 = psVar5;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar2 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_2 + 0x1e,psVar5,~uVar4 - 1);
  psVar5 = local_res10;
  if (((local_res10 != (short *)0x0) && (local_res10 != (short *)PTR_DAT_1405d8010)) &&
     (psVar6 = local_res10 + -4, psVar6 != (short *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar1 = (int *)(psVar5 + -2);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(psVar6);
    }
    FUN_14034edd0(uVar7);
  }
  psVar5 = local_res18;
  local_res10 = (short *)PTR_DAT_1405d8010;
  if (((local_res18 != (short *)0x0) && (local_res18 != (short *)PTR_DAT_1405d8010)) &&
     (psVar6 = local_res18 + -4, psVar6 != (short *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar1 = (int *)(psVar5 + -2);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(psVar6);
    }
    FUN_14034edd0(uVar7);
  }
  psVar5 = local_res20;
  if (((local_res20 != (short *)0x0) && (local_res20 != (short *)PTR_DAT_1405d8010)) &&
     (psVar6 = local_res20 + -4, psVar6 != (short *)0x0)) {
    local_res18 = (short *)PTR_DAT_1405d8010;
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar1 = (int *)(psVar5 + -2);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(psVar6);
    }
    FUN_14034edd0(uVar7);
  }
  return param_1;
}



longlong * FUN_14011ecb0(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_14034fe70();
  local_res20 = PTR_DAT_1405d8010;
  cVar3 = FUN_1403576a0(param_2,&local_res20,param_3,param_4,uVar5);
  if (cVar3 == '\0') {
    FUN_14034fe70();
    puVar2 = local_res20;
    puVar4 = PTR_DAT_1405d8010;
    *param_1 = (longlong)PTR_DAT_1405d8010;
    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_14034fe70();
    FUN_14034ed40(uVar5);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar4);
    }
  }
  else {
    FUN_14034fe70();
    puVar4 = PTR_DAT_1405d8010;
    *param_1 = (longlong)PTR_DAT_1405d8010;
    if (puVar4 == (undefined *)0x0) {
      *param_1 = 0;
    }
    if (local_res20 != (undefined *)*param_1) {
      uVar5 = FUN_14034fe70();
      FUN_14034ed40(uVar5);
      FUN_1400031d0(param_1);
      *param_1 = (longlong)local_res20;
      if (((local_res20 != PTR_DAT_1405d8010) && (local_res20 != (undefined *)0x0)) &&
         (local_res20 != (undefined *)0x8)) {
        *(int *)(local_res20 + -4) = *(int *)(local_res20 + -4) + 1;
      }
      FUN_14034edd0(uVar5);
      puVar4 = PTR_DAT_1405d8010;
    }
    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_14034fe70();
    FUN_14034ed40(uVar5);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar4);
    }
  }
  FUN_14034edd0(uVar5);
  return param_1;
}



undefined8 FUN_14011ee30(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_1403840e0(param_1,local_res8,4);
    if (cVar1 != '\0') {
      *param_2 = local_res8[0];
    }
    FUN_1403a1710(param_1,puVar3);
    puVar3 = puVar3 + 4;
    param_2 = param_2 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  return param_1;
}



void FUN_14011eeb0(undefined8 param_1,undefined4 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(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_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined8 * FUN_14011f090(undefined8 *param_1)

{
  errno_t eVar1;
  int iVar2;
  undefined1 auStack_98 [32];
  undefined8 local_78;
  undefined4 local_70;
  __time64_t local_68;
  short local_60;
  short local_5e;
  undefined2 local_5c;
  undefined2 local_5a;
  undefined2 local_58;
  undefined2 local_56;
  undefined2 local_54;
  undefined2 local_52;
  undefined8 local_50;
  undefined8 local_48;
  tm local_40;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  local_68 = _time64((__time64_t *)0x0);
  local_78 = 0;
  local_70 = 0;
  eVar1 = _localtime64_s(&local_40,&local_68);
  if (eVar1 == 0) {
    local_60 = (short)local_40.tm_year + 0x76c;
    local_52 = 0;
    local_5e = (short)local_40.tm_mon + 1;
    local_5c = (undefined2)local_40.tm_wday;
    local_5a = (undefined2)local_40.tm_mday;
    local_58 = (undefined2)local_40.tm_hour;
    local_56 = (undefined2)local_40.tm_min;
    local_54 = (undefined2)local_40.tm_sec;
    iVar2 = Ordinal_184();
    local_50 = 0;
    local_48 = 0;
    if (iVar2 != 0) {
      Ordinal_185(local_78);
    }
  }
  *(undefined4 *)(param_1 + 1) = 0;
  *param_1 = local_78;
  *(undefined8 *)((longlong)param_1 + 0xc) = 0;
  *(undefined8 *)((longlong)param_1 + 0x14) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 0;
  param_1[0x16] = 0;
  *(undefined2 *)(param_1 + 0x18) = 0;
  param_1[0x17] = 0;
  *(undefined1 *)((longlong)param_1 + 0xc2) = 0;
  *(undefined4 *)((longlong)param_1 + 0xc3) = 0;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x34) = 0;
  *(undefined8 *)((longlong)param_1 + 0x3c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x44) = 0;
  memset((void *)((longlong)param_1 + 0x4c),0,100);
  return param_1;
}



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

undefined8 * FUN_14011f210(undefined8 *param_1)

{
  errno_t eVar1;
  int iVar2;
  undefined1 auStack_98 [32];
  undefined8 local_78;
  undefined4 local_70;
  __time64_t local_68;
  short local_60;
  short local_5e;
  undefined2 local_5c;
  undefined2 local_5a;
  undefined2 local_58;
  undefined2 local_56;
  undefined2 local_54;
  undefined2 local_52;
  undefined8 local_50;
  undefined8 local_48;
  tm local_40;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  local_68 = _time64((__time64_t *)0x0);
  local_78 = 0;
  local_70 = 0;
  eVar1 = _localtime64_s(&local_40,&local_68);
  if (eVar1 == 0) {
    local_60 = (short)local_40.tm_year + 0x76c;
    local_52 = 0;
    local_5e = (short)local_40.tm_mon + 1;
    local_5c = (undefined2)local_40.tm_wday;
    local_5a = (undefined2)local_40.tm_mday;
    local_58 = (undefined2)local_40.tm_hour;
    local_56 = (undefined2)local_40.tm_min;
    local_54 = (undefined2)local_40.tm_sec;
    iVar2 = Ordinal_184();
    local_50 = 0;
    local_48 = 0;
    if (iVar2 != 0) {
      Ordinal_185(local_78);
    }
  }
  *param_1 = local_78;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0x11] = 0;
  param_1[0xc] = 0;
  param_1[0x12] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  memset(param_1 + 0x13,0,0x32);
  *(undefined8 *)((longlong)param_1 + 0xca) = 0;
  *(undefined8 *)((longlong)param_1 + 0xd2) = 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;
  *(undefined2 *)((longlong)param_1 + 0xfa) = 0;
  return param_1;
}



undefined8 FUN_14011f3e0(undefined8 param_1,undefined8 *param_2)

{
  FUN_140058670(param_1,*param_2);
  FUN_1403a17c0(param_1,(longlong)param_2 + 0xc);
  FUN_1403a17c0(param_1,(longlong)param_2 + 0x1c);
  FUN_1403a17c0(param_1,param_2 + 0x16);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 1));
  FUN_1403a17c0(param_1,param_2 + 0x16);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x18));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xc2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc3));
  FUN_140385a20(param_1,(longlong)param_2 + 0x2c);
  FUN_140385a20(param_1,(longlong)param_2 + 0x4c);
  return param_1;
}



undefined8 FUN_14011f4a0(undefined8 param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 0x1f);
  FUN_1403a17c0(param_1,param_2 + 0x2b);
  FUN_140058470(param_1,param_2[0x2f]);
  FUN_140058470(param_1,param_2[0x30]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x31));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc5));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xc9));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xca));
  puVar1 = (undefined4 *)((longlong)param_2 + 0xd7);
  lVar2 = 3;
  do {
    FUN_140058470(param_1,puVar1[-3]);
    FUN_140058470(param_1,*puVar1);
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xe3));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xe7));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xeb));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xef));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xf3));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xf7));
  FUN_140385a20(param_1,param_2 + 6);
  FUN_140385a20(param_1,param_2 + 0x23);
  return param_1;
}



undefined8 FUN_14011f610(undefined8 param_1,undefined8 *param_2)

{
  FUN_140058670(param_1,*param_2);
  FUN_1403a17c0(param_1,param_2 + 1);
  FUN_1403a17c0(param_1,param_2 + 3);
  FUN_1403a17c0(param_1,param_2 + 9);
  FUN_1403a17c0(param_1,param_2 + 0xb);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x11));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x8c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x12));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x94));
  FUN_140385a20(param_1,param_2 + 5);
  FUN_140385a20(param_1,param_2 + 0xd);
  FUN_140385980(param_1,param_2 + 0x13);
  FUN_140385980(param_1,(longlong)param_2 + 0xca);
  return param_1;
}



undefined8 FUN_14011f6e0(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_1403a17c0(param_1,param_2 + 1);
  FUN_1403a17c0(param_1,(longlong)param_2 + 0x46);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x76));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x7a));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x7e));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x87));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x89));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x8b));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x8d));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x8f));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x93));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x97));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x9b));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x9f));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xa3));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x29));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xa6));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xa7));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xab));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xaf));
  FUN_140385980(param_1,param_2 + 5);
  FUN_140385a20(param_1,(longlong)param_2 + 0x56);
  FUN_140385a20(param_1,(longlong)param_2 + 0x7f);
  return param_1;
}



undefined8 FUN_14011f840(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_1403a17c0(param_1,param_2 + 1);
  FUN_1403a17c0(param_1,param_2 + 0x1e);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x2a));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xa9));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xad));
  FUN_1403a17c0(param_1,(longlong)param_2 + 0xb1);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc1));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc5));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc9));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xcd));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xd1));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xd5));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xd9));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xdd));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xe1));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xe5));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xe9));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xed));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xf1));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xf5));
  FUN_140385a20(param_1,param_2 + 0x22);
  FUN_140385a20(param_1,param_2 + 5);
  return param_1;
}



undefined8 FUN_14011f9a0(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  
  FUN_140058470(param_1,*param_2);
  FUN_1403a17c0(param_1,param_2 + 1);
  FUN_1403a17c0(param_1,param_2 + 0x1e);
  FUN_140058470(param_1,param_2[0x2a]);
  FUN_140058470(param_1,param_2[0x2b]);
  FUN_140058470(param_1,param_2[0x2c]);
  FUN_1403a17c0(param_1,param_2 + 0x2d);
  FUN_140058470(param_1,param_2[0x31]);
  FUN_140058470(param_1,param_2[0x32]);
  FUN_1403a17c0(param_1,param_2 + 0x33);
  FUN_140058470(param_1,param_2[0x8f]);
  FUN_140058470(param_1,param_2[0x90]);
  FUN_1403a17c0(param_1,param_2 + 0x91);
  FUN_140058470(param_1,param_2[0xed]);
  FUN_140058470(param_1,param_2[0xee]);
  FUN_140058470(param_1,param_2[0xef]);
  FUN_140058470(param_1,param_2[0xf0]);
  FUN_140058470(param_1,param_2[0xf9]);
  FUN_140058470(param_1,param_2[0xfa]);
  FUN_140385a20(param_1,param_2 + 5);
  FUN_140385a20(param_1,param_2 + 0x22);
  FUN_140385a20(param_1,param_2 + 0x37);
  FUN_140385a20(param_1,param_2 + 0x95);
  FUN_140385a20(param_1,param_2 + 0xf1);
  param_2 = param_2 + 0x9d;
  lVar1 = 10;
  do {
    FUN_140385a20(param_1,param_2 + -0x5e);
    FUN_140385a20(param_1,param_2);
    param_2 = param_2 + 8;
    lVar1 = lVar1 + -1;
  } while (lVar1 != 0);
  return param_1;
}



undefined8 FUN_14011fb50(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_1403a17c0(param_1,param_2 + 1);
  FUN_1403a17c0(param_1,param_2 + 5);
  FUN_140058470(param_1,param_2[0x11]);
  FUN_140058470(param_1,param_2[0x12]);
  FUN_140058470(param_1,param_2[0x13]);
  FUN_1403a17c0(param_1,param_2 + 0x14);
  FUN_140058470(param_1,param_2[0x20]);
  FUN_140058470(param_1,param_2[0x21]);
  FUN_140058470(param_1,param_2[0x22]);
  FUN_140385a20(param_1,param_2 + 9);
  FUN_140385a20(param_1,param_2 + 0x18);
  return param_1;
}



undefined8 FUN_14011fc00(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_140058470(param_1,param_2[0x18]);
  FUN_140058470(param_1,param_2[0x19]);
  FUN_140058770(param_1,*(undefined8 *)(param_2 + 0x1a));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x1c));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xce));
  FUN_140385a20(param_1,param_2 + 6);
  FUN_140385a20(param_1,(longlong)param_2 + 0x72);
  FUN_140385a20(param_1,param_2 + 0x10);
  FUN_140385a20(param_1,(longlong)param_2 + 0x92);
  return param_1;
}



undefined8 FUN_14011fcb0(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 2));
  FUN_1403a17c0(param_1,(longlong)param_2 + 10);
  FUN_1403a17c0(param_1,(longlong)param_2 + 0x1a);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x2a));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x2e));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x32));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x36));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x3a));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x3e));
  FUN_140385980(param_1,(longlong)param_2 + 0x42);
  FUN_140385a20(param_1,param_2 + 0x1d);
  return param_1;
}



undefined8 FUN_14011fd60(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  undefined4 *puVar2;
  
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 6);
  FUN_1403a17c0(param_1,param_2 + 0x2b);
  FUN_1403a17c0(param_1,param_2 + 0x2f);
  FUN_1403a17c0(param_1,param_2 + 0x54);
  FUN_140058470(param_1,param_2[0x58]);
  FUN_140058470(param_1,param_2[0x59]);
  FUN_140058470(param_1,param_2[0x5a]);
  FUN_140058470(param_1,param_2[0x5b]);
  FUN_140058470(param_1,param_2[0x5c]);
  FUN_140058470(param_1,param_2[0x5d]);
  FUN_140058470(param_1,param_2[0x5e]);
  lVar1 = 0;
  puVar2 = param_2 + 0x62;
  do {
    FUN_140058470(param_1,puVar2[-3]);
    FUN_140058470(param_1,*puVar2);
    FUN_140058470(param_1,puVar2[3]);
    FUN_140058470(param_1,puVar2[6]);
    FUN_140058870(param_1,*(undefined1 *)(lVar1 + 0x1ac + (longlong)param_2));
    lVar1 = lVar1 + 1;
    puVar2 = puVar2 + 1;
  } while (lVar1 < 3);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x1af));
  FUN_140058770(param_1,*(undefined8 *)((longlong)param_2 + 0x1b3));
  FUN_140058770(param_1,*(undefined8 *)((longlong)param_2 + 0x1bb));
  FUN_140058770(param_1,*(undefined8 *)((longlong)param_2 + 0x1c3));
  FUN_140385a20(param_1,param_2 + 10);
  FUN_140385a20(param_1,param_2 + 0x23);
  FUN_140385a20(param_1,param_2 + 0x33);
  FUN_140385a20(param_1,param_2 + 0x4c);
  return param_1;
}



undefined8 FUN_14011ff20(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 6);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xae));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xb2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xb6));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xba));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xbe));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xe2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xe6));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0x23));
  FUN_140385a20(param_1,(longlong)param_2 + 0x8e);
  FUN_140385a20(param_1,(longlong)param_2 + 0xc2);
  FUN_140385a20(param_1,param_2 + 10);
  return param_1;
}



undefined8 FUN_140120010(undefined8 param_1,undefined8 *param_2)

{
  FUN_140058770(param_1,*param_2);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 1));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0xc));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xe));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xf));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xd4));
  FUN_140058670(param_1,*(undefined8 *)((longlong)param_2 + 0xd9));
  FUN_140058670(param_1,*(undefined8 *)((longlong)param_2 + 0xe1));
  FUN_140385a20(param_1,param_2 + 2);
  FUN_140385a20(param_1,(longlong)param_2 + 0x74);
  FUN_140385a20(param_1,(longlong)param_2 + 0x94);
  FUN_140385a20(param_1,(longlong)param_2 + 0xb4);
  FUN_140385a20(param_1,(longlong)param_2 + 0xd5);
  FUN_140385a20(param_1,(longlong)param_2 + 0xd7);
  return param_1;
}



undefined8 FUN_1401200f0(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 6);
  FUN_140058470(param_1,param_2[10]);
  FUN_140058770(param_1,*(undefined8 *)(param_2 + 0xb));
  FUN_140058470(param_1,param_2[0xd]);
  FUN_140058470(param_1,param_2[0xe]);
  FUN_140058470(param_1,param_2[0xf]);
  FUN_140385a20(param_1,param_2 + 0x20);
  FUN_140385a20(param_1,param_2 + 0x18);
  FUN_140385a20(param_1,param_2 + 0x10);
  return param_1;
}



undefined8 FUN_1401201a0(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_140058470(param_1,param_2[6]);
  FUN_140058470(param_1,param_2[7]);
  FUN_1403a17c0(param_1,param_2 + 8);
  FUN_140058470(param_1,param_2[0xc]);
  FUN_140058470(param_1,param_2[0xd]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0xe));
  FUN_140058770(param_1,*(undefined8 *)((longlong)param_2 + 0x39));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x41));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x45));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x49));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x4d));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x51));
  FUN_140385980(param_1,(longlong)param_2 + 0x55);
  FUN_140385a20(param_1,(longlong)param_2 + 0x87);
  return param_1;
}



undefined8 FUN_140120280(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_140058470(param_1,param_2[6]);
  FUN_140058470(param_1,param_2[7]);
  FUN_1403a17c0(param_1,param_2 + 8);
  FUN_1403a17c0(param_1,param_2 + 0xc);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x10));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x41));
  FUN_140385980(param_1,(longlong)param_2 + 0x45);
  FUN_140385a20(param_1,(longlong)param_2 + 0x77);
  FUN_140385a20(param_1,(longlong)param_2 + 0x97);
  FUN_140385a20(param_1,(longlong)param_2 + 0xb7);
  return param_1;
}



undefined8 FUN_140120340(undefined8 param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 6);
  FUN_1403a17c0(param_1,param_2 + 0x12);
  FUN_140058470(param_1,param_2[0x16]);
  FUN_140058470(param_1,param_2[0x17]);
  FUN_140058470(param_1,param_2[0x18]);
  FUN_140058470(param_1,param_2[0x19]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x1a));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x69));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x6a));
  puVar1 = (undefined4 *)((longlong)param_2 + 0x7a);
  lVar2 = 3;
  do {
    FUN_140058470(param_1,puVar1[-3]);
    FUN_140058470(param_1,*puVar1);
    FUN_140058470(param_1,puVar1[3]);
    FUN_140058470(param_1,puVar1[6]);
    FUN_140058470(param_1,puVar1[9]);
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xaa));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xae));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xb2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xb6));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xba));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xbe));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc6));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xca));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xce));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xf2));
  FUN_140385a20(param_1,param_2 + 10);
  FUN_140385a20(param_1,(longlong)param_2 + 0xd2);
  return param_1;
}



undefined8 FUN_140120500(undefined8 param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 6);
  FUN_1403a17c0(param_1,param_2 + 0x12);
  FUN_140058470(param_1,param_2[0x16]);
  FUN_140058470(param_1,param_2[0x17]);
  FUN_140058470(param_1,param_2[0x18]);
  FUN_140058470(param_1,param_2[0x19]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x1a));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x69));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x6a));
  puVar1 = (undefined4 *)((longlong)param_2 + 0x7a);
  lVar2 = 3;
  do {
    FUN_140058470(param_1,puVar1[-3]);
    FUN_140058470(param_1,*puVar1);
    FUN_140058470(param_1,puVar1[3]);
    FUN_140058470(param_1,puVar1[6]);
    FUN_140058470(param_1,puVar1[9]);
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xaa));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xae));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xb2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xb6));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xda));
  FUN_140385a20(param_1,param_2 + 10);
  FUN_140385a20(param_1,(longlong)param_2 + 0xba);
  return param_1;
}



undefined8 FUN_140120670(undefined8 param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 6);
  FUN_1403a17c0(param_1,param_2 + 0x12);
  FUN_140058470(param_1,param_2[0x16]);
  FUN_140058470(param_1,param_2[0x17]);
  FUN_140058470(param_1,param_2[0x18]);
  FUN_140058470(param_1,param_2[0x19]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x1a));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x69));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x6a));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x6e));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xae));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xb2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xb6));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xba));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xbe));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc6));
  puVar1 = (undefined4 *)((longlong)param_2 + 0x7e);
  lVar2 = 3;
  do {
    FUN_140058470(param_1,puVar1[-3]);
    FUN_140058470(param_1,*puVar1);
    FUN_140058470(param_1,puVar1[3]);
    FUN_140058470(param_1,puVar1[6]);
    FUN_140058470(param_1,puVar1[9]);
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_140385a20(param_1,param_2 + 10);
  return param_1;
}



undefined8 FUN_1401207f0(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_140058470(param_1,param_2[2]);
  FUN_1403a17c0(param_1,param_2 + 3);
  FUN_1403a17c0(param_1,param_2 + 7);
  FUN_140058470(param_1,param_2[0x2c]);
  FUN_140058470(param_1,param_2[0x2d]);
  FUN_140058470(param_1,param_2[0x2e]);
  FUN_140058470(param_1,param_2[0x2f]);
  FUN_140058470(param_1,param_2[0x30]);
  FUN_140058470(param_1,param_2[0x31]);
  FUN_140385a20(param_1,param_2 + 0x24);
  FUN_140385a20(param_1,param_2 + 0xb);
  return param_1;
}



undefined8 FUN_1401208c0(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_1403a17c0(param_1,param_2 + 6);
  FUN_1403a17c0(param_1,param_2 + 0x2b);
  FUN_140058470(param_1,param_2[0x37]);
  FUN_140058470(param_1,param_2[0x38]);
  FUN_140058770(param_1,*(undefined8 *)(param_2 + 0x39));
  FUN_140058470(param_1,param_2[0x3b]);
  FUN_140058470(param_1,param_2[0x3c]);
  FUN_140058470(param_1,param_2[0x3d]);
  FUN_140058470(param_1,param_2[0x3e]);
  FUN_140058470(param_1,param_2[0x3f]);
  FUN_140058470(param_1,param_2[0x40]);
  FUN_140058470(param_1,param_2[0x41]);
  FUN_140058470(param_1,param_2[0x42]);
  FUN_140058570(param_1,param_2[0x43]);
  FUN_140058570(param_1,param_2[0x44]);
  FUN_140058470(param_1,param_2[0x45]);
  FUN_140058470(param_1,param_2[0x46]);
  FUN_140058470(param_1,param_2[0x47]);
  FUN_140058470(param_1,param_2[0x48]);
  FUN_140058470(param_1,param_2[0x49]);
  FUN_140058470(param_1,param_2[0x4a]);
  FUN_140058470(param_1,param_2[0x4b]);
  FUN_140058470(param_1,param_2[0x4c]);
  FUN_140058470(param_1,param_2[0x4d]);
  FUN_140058470(param_1,param_2[0x4e]);
  FUN_140058470(param_1,param_2[0x4f]);
  FUN_140058470(param_1,param_2[0x50]);
  FUN_140058470(param_1,param_2[0x51]);
  FUN_140058470(param_1,param_2[0x52]);
  FUN_140058470(param_1,param_2[0x53]);
  FUN_140058570(param_1,param_2[0x54]);
  FUN_140058570(param_1,param_2[0x55]);
  FUN_140058470(param_1,param_2[0x56]);
  FUN_140058470(param_1,param_2[0x57]);
  FUN_140058470(param_1,param_2[0x58]);
  FUN_140058470(param_1,param_2[0x59]);
  FUN_140058470(param_1,param_2[0x5a]);
  FUN_140058470(param_1,param_2[0x5b]);
  FUN_140058470(param_1,param_2[0x5c]);
  FUN_140058470(param_1,param_2[0x5d]);
  FUN_140058470(param_1,param_2[0x5e]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x5f));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x17d));
  FUN_140385a20(param_1,param_2 + 0x23);
  FUN_140385a20(param_1,param_2 + 10);
  FUN_140385a20(param_1,param_2 + 0x2f);
  return param_1;
}



undefined8 FUN_140120b90(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined2 local_res8;
  undefined2 uStackX_a;
  undefined4 uStackX_c;
  
  FUN_1403a1710();
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x10) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x14) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x1a) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x1e) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x22) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x26) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(uint *)(param_2 + 0x2a) = CONCAT22(uStackX_a,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    *(ulonglong *)(param_2 + 0x2e) = CONCAT44(uStackX_c,CONCAT22(uStackX_a,local_res8));
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x36) = local_res8;
  }
  return param_1;
}



undefined8 FUN_140120cf0(undefined8 param_1,undefined8 *param_2)

{
  char cVar1;
  undefined4 local_res8 [4];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_38 [2];
  undefined8 local_30;
  undefined8 local_28 [2];
  
  cVar1 = FUN_1403840e0(param_1,&local_30,8);
  if (cVar1 != '\0') {
    *param_2 = local_30;
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 1) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0xc) = local_res18[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res20,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 2) = local_res20[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_38,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x14) = local_38[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_28,8);
  if (cVar1 != '\0') {
    param_2[3] = local_28[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 4) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x24) = local_res18[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 5) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x2c) = local_res18[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 6) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x34) = local_res18[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 7) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x3c) = local_res18[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x44) = local_res18[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 9) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x4c) = local_res18[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 10) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res18,4);
  if (cVar1 != '\0') {
    *(undefined4 *)((longlong)param_2 + 0x54) = local_res18[0];
  }
  return param_1;
}



undefined8 FUN_140120f40(undefined8 param_1,undefined8 *param_2)

{
  FUN_140058770(param_1,*param_2);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 1));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0xc));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 2));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x14));
  FUN_140058670(param_1,param_2[3]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 4));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x24));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 5));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x2c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 6));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x34));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 7));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x3c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 8));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x44));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 9));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x4c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 10));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x54));
  return param_1;
}



void FUN_140121040(undefined8 param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined *local_res10 [3];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %d, %d }",*(undefined4 *)(param_2 + 0x20),
                *(undefined4 *)(param_2 + 0x24),uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_1401210f0(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_1403a1710();
  FUN_1403a1710(param_1,param_2 + 0x10);
  FUN_1403a1710(param_1,param_2 + 0x20);
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x30) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x52) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x54) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(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_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x60) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(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_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x6a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x6e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x72) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x76) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x7a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x7e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x82) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x86) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x8a) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x8e) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x92) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x93) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x97) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x9b) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x9f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xa3) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xa7) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0xab) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x32),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_1401214b0(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_140384b70();
  FUN_140384b70(param_1,param_2 + 4);
  FUN_1403a1710(param_1,param_2 + 8);
  cVar2 = FUN_1403840e0(param_1,&local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x38) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x3c) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x3d) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,2);
  if (cVar2 != '\0') {
    *(ushort *)(param_2 + 0x45) = CONCAT11(uStackX_9,local_res8);
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar2 != '\0') {
    *(ulonglong *)(param_2 + 0x47) =
         CONCAT44(uStackX_c,CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8)));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x4f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x53) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x57) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x5b) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x5f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 99) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x67) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x6b) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x6f) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x73) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x77) = local_res8;
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x78) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x7c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x80) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x84) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x88) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x8c) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  cVar2 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar2 != '\0') {
    *(uint *)(param_2 + 0x90) = CONCAT22(uStackX_a,CONCAT11(uStackX_9,local_res8));
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x18),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_140121840(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_1403a17c0(param_1,param_2 + 2);
  FUN_140058470(param_1,param_2[0xe]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0xf));
  FUN_140058770(param_1,*(undefined8 *)((longlong)param_2 + 0x3d));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x45));
  FUN_140058670(param_1,*(undefined8 *)((longlong)param_2 + 0x47));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x4f));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x53));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x57));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x5b));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x5f));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 99));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x67));
  FUN_140058470(param_1,*(undefined4 *)((longlong)param_2 + 0x6b));
  FUN_140058570(param_1,*(undefined4 *)((longlong)param_2 + 0x6f));
  FUN_140058570(param_1,*(undefined4 *)((longlong)param_2 + 0x73));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x77));
  FUN_140058470(param_1,param_2[0x1e]);
  FUN_140058470(param_1,param_2[0x1f]);
  FUN_140058570(param_1,param_2[0x20]);
  FUN_140058570(param_1,param_2[0x21]);
  FUN_140058570(param_1,param_2[0x22]);
  FUN_140058570(param_1,param_2[0x23]);
  FUN_140058570(param_1,param_2[0x24]);
  FUN_140385a20(param_1,param_2 + 6);
  return param_1;
}



void FUN_1401219b0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %s }",param_2 + 0x18,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

{
  wchar_t *pwVar1;
  char cVar2;
  wchar_t *pwVar3;
  undefined2 local_res8 [4];
  wchar_t *local_res10;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_140384b70();
  FUN_140384b70(param_1,param_2 + 4);
  FUN_1403a1710(param_1,param_2 + 8);
  cVar2 = FUN_1403840e0(param_1,local_res8,2,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x3a) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x3b) = (undefined1)local_res8[0];
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x1a),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



undefined8 FUN_140121ba0(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_140384b70();
  FUN_1403a1710(param_1,param_2 + 4);
  cVar2 = FUN_1403840e0(param_1,local_res8,1,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined1 *)(param_2 + 0x14) = (undefined1)local_res8[0];
  }
  cVar2 = FUN_1403840e0(param_1,local_res8,4,param_4,uVar4);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_2 + 0x15) = local_res8[0];
  }
  FUN_14034fe70();
  local_res10 = (wchar_t *)PTR_DAT_1405d8010;
  thunk_FUN_140385220(param_1,&local_res10);
  pwVar3 = local_res10;
  if (local_res10 == (wchar_t *)0x0) {
    pwVar3 = (wchar_t *)PTR_DAT_1405d8010;
  }
  wcscpy_s((wchar_t *)(param_2 + 0x19),0x10,pwVar3);
  pwVar3 = local_res10;
  if (((local_res10 != (wchar_t *)0x0) && (local_res10 != (wchar_t *)PTR_DAT_1405d8010)) &&
     (pwVar1 = local_res10 + -4, pwVar1 != (wchar_t *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    pwVar3 = pwVar3 + -2;
    *(int *)pwVar3 = *(int *)pwVar3 + -1;
    if (*(int *)pwVar3 == 0) {
      FUN_14034ff60(pwVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return param_1;
}



void FUN_140121cb0(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_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %s }",param_2 + 0x19,param_4,uVar4);
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_140121d60(undefined8 param_1,undefined1 *param_2)

{
  undefined4 local_18;
  undefined4 uStack_14;
  undefined4 uStack_10;
  undefined4 uStack_c;
  
  FUN_140058870(param_1,*param_2);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x24));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 1));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x2c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x30));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x28));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x34));
  local_18 = *(undefined4 *)(param_2 + 0x3c);
  uStack_14 = *(undefined4 *)(param_2 + 0x40);
  uStack_10 = *(undefined4 *)(param_2 + 0x44);
  uStack_c = *(undefined4 *)(param_2 + 0x48);
  FUN_140090370(param_1,&local_18);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x18));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x1c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_140058870(param_1,param_2[5]);
  FUN_140058870(param_1,param_2[6]);
  FUN_1403a17c0(param_1,param_2 + 8);
  FUN_140058870(param_1,param_2[7]);
  FUN_140385a20(param_1,param_2 + 0x4c);
  FUN_140385a20(param_1,param_2 + 0x6c);
  return param_1;
}



undefined8 FUN_140121e60(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_1403a1710();
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x14) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x18) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x1a) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x1e) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x1c) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x1d) = (undefined1)local_res8[0];
  }
  return param_1;
}



void FUN_140121f60(longlong param_1,void *param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = 4;
  iVar2 = 4;
  iVar1 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar1 = 0x100 - *(int *)(param_1 + 4), 0 < iVar1)) {
    memcpy(param_2,(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy((void *)((longlong)param_2 + 4),(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1)
           ,(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar3 = 0x100 - *(int *)(param_1 + 4), 0 < iVar3)) {
    memcpy((void *)((longlong)param_2 + 8),(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1)
           ,(longlong)iVar3);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar3;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_140122040(longlong param_1,void *param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = 1;
  iVar2 = 1;
  iVar1 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar1 = 0x100 - *(int *)(param_1 + 4), 0 < iVar1)) {
    memcpy(param_2,(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy((void *)((longlong)param_2 + 1),(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1)
           ,(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar3 = 0x100 - *(int *)(param_1 + 4), 0 < iVar3)) {
    memcpy((void *)((longlong)param_2 + 2),(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1)
           ,(longlong)iVar3);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar3;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_140122120(longlong param_1,void *param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = 4;
  iVar2 = 4;
  iVar1 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar1 = 0x100 - *(int *)(param_1 + 4), 0 < iVar1)) {
    memcpy((void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),param_2,(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy((void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(void *)((longlong)param_2 + 4)
           ,(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar3 = 0x100 - *(int *)(param_1 + 4), 0 < iVar3)) {
    memcpy((void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(void *)((longlong)param_2 + 8)
           ,(longlong)iVar3);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar3;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_140122200(longlong param_1,void *param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = 1;
  iVar2 = 1;
  iVar1 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar1 = 0x100 - *(int *)(param_1 + 4), 0 < iVar1)) {
    memcpy((void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),param_2,(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy((void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(void *)((longlong)param_2 + 1)
           ,(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar3 = 0x100 - *(int *)(param_1 + 4), 0 < iVar3)) {
    memcpy((void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(void *)((longlong)param_2 + 2)
           ,(longlong)iVar3);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar3;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



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

undefined8 FUN_1401222e0(undefined8 param_1,byte *param_2)

{
  byte bVar1;
  char cVar2;
  uint uVar3;
  byte *pbVar4;
  ulonglong uVar5;
  uint uVar6;
  uint uVar7;
  undefined1 auStack_168 [32];
  byte local_148 [16];
  byte local_138 [256];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_168;
  FUN_1403840e0(param_1,local_148,1);
  bVar1 = local_148[0];
  FUN_1403840e0(param_1,local_148,1);
  uVar6 = (uint)local_148[0];
  uVar7 = (uint)local_148[0];
  if (local_148[0] != 0) {
    pbVar4 = local_138;
    uVar5 = (ulonglong)uVar7;
    do {
      cVar2 = FUN_1403840e0(param_1,local_148,1);
      if (cVar2 != '\0') {
        *pbVar4 = local_148[0];
      }
      pbVar4 = pbVar4 + 1;
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  *param_2 = bVar1;
  uVar3 = uVar7;
  if (0x100 < (int)(*(int *)(param_2 + 4) + uVar6)) {
    uVar3 = 0x100 - *(int *)(param_2 + 4);
  }
  if (0 < (int)uVar3) {
    memcpy(param_2 + (longlong)*(int *)(param_2 + 4) + 0xc,local_138,(longlong)(int)uVar3);
    *(uint *)(param_2 + 4) = *(int *)(param_2 + 4) + uVar3;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  param_2[4] = 0;
  param_2[5] = 0;
  param_2[6] = 0;
  param_2[7] = 0;
  *(uint *)(param_2 + 8) = uVar7;
  return param_1;
}



undefined8 FUN_140122420(undefined8 param_1,undefined4 *param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    param_2[1] = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    param_2[2] = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_1401224a0(undefined8 param_1,undefined1 *param_2)

{
  char cVar1;
  undefined1 local_res8 [8];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *param_2 = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    param_2[1] = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    param_2[2] = local_res8[0];
  }
  return param_1;
}



undefined8 FUN_140122520(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_140384b70();
  FUN_140384b70(param_1,param_2 + 4);
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 8) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 10) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0xc) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0xd) = (undefined1)local_res8[0];
  }
  FUN_140384b70(param_1,param_2 + 0x10);
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x14) = (undefined1)local_res8[0];
  }
  FUN_140384b70(param_1,param_2 + 0x18);
  FUN_1401224a0(param_1,param_2 + 0x1c);
  FUN_140122420(param_1,param_2 + 0x20);
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x2c) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0x2e) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x30) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x34) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x35) = (undefined1)local_res8[0];
  }
  return param_1;
}



undefined8 FUN_1401226c0(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 2));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 10));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 3));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xd));
  FUN_140058470(param_1,param_2[4]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 5));
  FUN_140058470(param_1,param_2[6]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 7));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x1d));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x1e));
  FUN_140058570(param_1,param_2[8]);
  FUN_140058570(param_1,param_2[9]);
  FUN_140058570(param_1,param_2[10]);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0xb));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 0x2e));
  FUN_140058470(param_1,param_2[0xc]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0xd));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x35));
  return param_1;
}



void FUN_1401227d0(undefined8 param_1,undefined4 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined *local_res10 [3];
  
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %d %d %d}",*param_2,param_2[1],*(undefined2 *)(param_2 + 2));
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



undefined8 FUN_140122880(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  FUN_140384b70();
  FUN_140384b70(param_1,param_2 + 4);
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 8) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 10) = (undefined2)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0xc) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0xd) = (undefined1)local_res8[0];
  }
  FUN_140384b70(param_1,param_2 + 0x10);
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x14) = (undefined1)local_res8[0];
  }
  FUN_140384b70(param_1,param_2 + 0x18);
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x1c) = (undefined1)local_res8[0];
  }
  FUN_140384b70(param_1,param_2 + 0x20);
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x28) = local_res8[0];
  }
  FUN_1401224a0(param_1,param_2 + 0x2c);
  FUN_140122420(param_1,param_2 + 0x30);
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x3c) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x40) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x44) = (undefined1)local_res8[0];
  }
  FUN_140122420(param_1,param_2 + 0x48);
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x54) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x58) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x5c) = (undefined1)local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,1);
  if (cVar1 != '\0') {
    *(undefined1 *)(param_2 + 0x5d) = (undefined1)local_res8[0];
  }
  return param_1;
}



undefined8 FUN_140122ac0(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140058470(param_1,param_2[1]);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 2));
  FUN_140017c50(param_1,*(undefined2 *)((longlong)param_2 + 10));
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 3));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0xd));
  FUN_140058470(param_1,param_2[4]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 5));
  FUN_140058470(param_1,param_2[6]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 7));
  FUN_140058470(param_1,param_2[8]);
  FUN_140058570(param_1,param_2[9]);
  FUN_140058570(param_1,param_2[10]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0xb));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x2d));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x2e));
  FUN_140058570(param_1,param_2[0xc]);
  FUN_140058570(param_1,param_2[0xd]);
  FUN_140058570(param_1,param_2[0xe]);
  FUN_140058470(param_1,param_2[0xf]);
  FUN_140058470(param_1,param_2[0x10]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x11));
  FUN_140058570(param_1,param_2[0x12]);
  FUN_140058570(param_1,param_2[0x13]);
  FUN_140058570(param_1,param_2[0x14]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x15));
  FUN_140058470(param_1,param_2[0x16]);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 0x17));
  FUN_140058870(param_1,*(undefined1 *)((longlong)param_2 + 0x5d));
  return param_1;
}



undefined8 FUN_140122c40(undefined8 param_1,undefined1 *param_2)

{
  char cVar1;
  undefined4 local_res8;
  undefined4 uStackX_c;
  
  cVar1 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar1 != '\0') {
    *param_2 = (undefined1)local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar1 != '\0') {
    param_2[1] = (undefined1)local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar1 != '\0') {
    param_2[2] = (undefined1)local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,1);
  if (cVar1 != '\0') {
    param_2[3] = (undefined1)local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 4) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0xc) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x10) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x14) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,8);
  if (cVar1 != '\0') {
    *(ulonglong *)(param_2 + 0x58) = CONCAT44(uStackX_c,local_res8);
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x18) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x1c) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x20) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x24) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x28) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x2c) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x30) = local_res8;
  }
  FUN_140384b70(param_1,param_2 + 0x3c);
  FUN_140384b70(param_1,param_2 + 0x40);
  FUN_140384b70(param_1,param_2 + 0x4c);
  FUN_140384b70(param_1,param_2 + 0x50);
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x60) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 100) = local_res8;
  }
  FUN_1401224a0(param_1,param_2 + 0x68);
  FUN_140122420(param_1,param_2 + 0x6c);
  FUN_140122420(param_1,param_2 + 0x78);
  FUN_1400901d0(param_1,param_2 + 0x88);
  FUN_1400901d0(param_1,param_2 + 0xb0);
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x34) = local_res8;
  }
  cVar1 = FUN_1403840e0(param_1,&local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 0x38) = local_res8;
  }
  FUN_140384b70(param_1,param_2 + 0x44);
  FUN_140384b70(param_1,param_2 + 0x48);
  return param_1;
}



undefined8 FUN_140122f50(undefined8 param_1,undefined1 *param_2)

{
  ulonglong uVar1;
  longlong *plVar2;
  undefined1 local_58 [80];
  
  FUN_140058870(param_1,*param_2);
  FUN_140058870(param_1,param_2[1]);
  FUN_140058870(param_1,param_2[2]);
  FUN_140058870(param_1,param_2[3]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 4));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 8));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0xc));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x10));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x14));
  FUN_140058770(param_1,*(undefined8 *)(param_2 + 0x58));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x18));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x1c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x24));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x28));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x2c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x30));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x3c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x40));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x4c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x50));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x60));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 100));
  FUN_140058870(param_1,param_2[0x68]);
  FUN_140058870(param_1,param_2[0x69]);
  FUN_140058870(param_1,param_2[0x6a]);
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x6c));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x70));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x74));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x78));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x7c));
  FUN_140058570(param_1,*(undefined4 *)(param_2 + 0x80));
  plVar2 = (longlong *)(param_2 + 0x88);
  uVar1 = *(ulonglong *)(param_2 + 0x98);
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (7 < *(ulonglong *)(param_2 + 0xa0)) {
    plVar2 = (longlong *)*plVar2;
  }
  FUN_140385820(param_1,plVar2,uVar1 & 0xffffffff);
  plVar2 = (longlong *)(param_2 + 0xb0);
  uVar1 = *(ulonglong *)(param_2 + 0xc0);
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (7 < *(ulonglong *)(param_2 + 200)) {
    plVar2 = (longlong *)*plVar2;
  }
  FUN_140385820(param_1,plVar2,uVar1 & 0xffffffff);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x34));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x38));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x44));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x48));
  return param_1;
}



void FUN_1401231b0(undefined8 param_1,longlong param_2)

{
  undefined *puVar1;
  int *piVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined *local_res10 [3];
  
  FUN_14034fe70();
  local_res10[0] = PTR_DAT_1405d8010;
  FUN_140017720(local_res10,L"{ %d %I64d %d}",*(undefined4 *)(param_2 + 0x3c),
                *(undefined8 *)(param_2 + 0x58),*(undefined4 *)(param_2 + 4));
  FUN_140017520(param_1,local_res10);
  puVar3 = local_res10[0];
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res10[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



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

undefined * FUN_140123260(float *param_1,float *param_2,float param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float *pfVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  if ((DAT_1406093d4 & 1) == 0) {
    DAT_1406093d4 = DAT_1406093d4 | 1;
  }
  fVar1 = param_2[1];
  fVar2 = *param_2;
  fVar3 = param_2[2];
  fVar8 = fVar1 * param_1[1] + fVar2 * *param_1 + fVar3 * param_1[2];
  fVar5 = cosf(param_3);
  fVar6 = 1.0 - fVar5;
  fVar7 = sinf(param_3);
  pfVar4 = (float *)FUN_140124030(param_2,param_1);
  _DAT_1406093c8 =
       CONCAT44(fVar5 * param_1[1] + fVar7 * pfVar4[1] + fVar1 * fVar8 * fVar6,
                fVar5 * *param_1 + fVar7 * *pfVar4 + fVar2 * fVar8 * fVar6);
  _DAT_1406093d0 = fVar5 * param_1[2] + fVar7 * pfVar4[2] + fVar3 * fVar8 * fVar6;
  return &DAT_1406093c8;
}



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

void FUN_1401233d0(undefined8 param_1,short *param_2)

{
  ulonglong uVar1;
  short sVar2;
  code *pcVar3;
  short *psVar4;
  undefined2 *puVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined2 local_60;
  undefined6 uStack_5e;
  ulonglong local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  local_48 = 7;
  uVar6 = 0;
  local_50 = 0;
  local_60 = 0;
  psVar4 = param_2;
  uVar7 = uVar6;
  if (*param_2 != 0) {
    do {
      sVar2 = *psVar4;
      if (sVar2 == 0x5c) {
        FUN_14008ec00(param_1,&local_60);
        local_50 = 0;
        puVar5 = &local_60;
        if (7 < local_48) {
          puVar5 = (undefined2 *)CONCAT62(uStack_5e,local_60);
        }
        *puVar5 = 0;
        uVar6 = local_50;
      }
      else {
        if (-uVar6 - 1 < 2) {
          std::_Xlength_error("string too long");
          goto LAB_14012353b;
        }
        uVar1 = uVar6 + 1;
        if (0x7ffffffffffffffe < uVar1) {
          std::_Xlength_error("string too long");
          pcVar3 = (code *)swi(3);
          (*pcVar3)();
          return;
        }
        if (local_48 < uVar1) {
          FUN_1400019f0(&local_60,uVar1,uVar6);
          uVar6 = local_50;
        }
        else if (uVar1 == 0) {
          local_50 = 0;
          puVar5 = &local_60;
          if (7 < local_48) {
            puVar5 = (undefined2 *)CONCAT62(uStack_5e,local_60);
          }
          *puVar5 = 0;
          uVar6 = local_50;
        }
        if (uVar1 != 0) {
          puVar5 = &local_60;
          if (7 < local_48) {
            puVar5 = (undefined2 *)CONCAT62(uStack_5e,local_60);
          }
          puVar5[uVar6] = sVar2;
          puVar5 = &local_60;
          if (7 < local_48) {
            puVar5 = (undefined2 *)CONCAT62(uStack_5e,local_60);
          }
          local_50 = uVar1;
          puVar5[uVar1] = 0;
          uVar6 = local_50;
        }
      }
      uVar7 = uVar7 + 1;
      psVar4 = param_2 + uVar7;
    } while (param_2[uVar7] != 0);
    if (uVar6 != 0) {
      FUN_14008ec00(param_1,&local_60);
    }
  }
LAB_14012353b:
  if (7 < local_48) {
    operator_delete((void *)CONCAT62(uStack_5e,local_60));
  }
  return;
}



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

void FUN_140123580(wchar_t *param_1,wchar_t *param_2,short *param_3)

{
  short sVar1;
  wchar_t *pwVar2;
  ulonglong uVar3;
  wchar_t *pwVar4;
  wchar_t *pwVar5;
  wchar_t *pwVar6;
  wchar_t *pwVar7;
  uint uVar8;
  ulonglong uVar9;
  wchar_t *pwVar10;
  wchar_t *pwVar11;
  undefined1 auStack_6b8 [32];
  wchar_t *local_698;
  wchar_t *local_690;
  undefined8 local_688;
  wchar_t *local_678;
  wchar_t *local_670;
  undefined8 local_668;
  undefined8 local_658;
  wchar_t local_648 [256];
  wchar_t local_448 [256];
  wchar_t local_248 [256];
  ulonglong local_48;
  
  local_658 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_6b8;
  sVar1 = *param_3;
  if (sVar1 == 0x5c) {
    FUN_140418da0(DAT_140607fd8,L"Wrong File Name - [%s]");
  }
  wcscpy_s(local_448,0x100,param_3 + (int)(uint)(sVar1 == 0x5c));
  wcscpy_s(local_248,0x100,param_3 + (int)(uint)(sVar1 == 0x5c));
  wcscpy_s(local_648,0x100,param_2);
  PathStripPathW(local_248);
  PathRemoveFileSpecW(local_448);
  PathRemoveFileSpecW(local_648);
  local_698 = (wchar_t *)0x0;
  local_690 = (wchar_t *)0x0;
  local_688 = 0;
  local_678 = (wchar_t *)0x0;
  local_670 = (wchar_t *)0x0;
  local_668 = 0;
  FUN_1401233d0(&local_698,local_648);
  FUN_1401233d0(&local_678);
  pwVar2 = local_670;
  pwVar7 = local_698;
  pwVar11 = local_690;
  if (local_678 != local_670) {
    pwVar10 = local_678 + 8;
    pwVar6 = local_670;
    do {
      uVar3 = *(ulonglong *)pwVar10;
      pwVar2 = pwVar10 + -8;
      pwVar5 = pwVar2;
      if (7 < *(ulonglong *)(pwVar10 + 4)) {
        pwVar5 = *(wchar_t **)pwVar2;
      }
      pwVar4 = L".";
      for (uVar9 = (ulonglong)(uVar3 != 0); uVar9 != 0; uVar9 = uVar9 - 1) {
        if (*pwVar5 != *pwVar4) {
          uVar8 = 1;
          if ((ushort)*pwVar5 < (ushort)*pwVar4) {
            uVar8 = 0xffffffff;
          }
          goto LAB_14012372d;
        }
        pwVar5 = pwVar5 + 1;
        pwVar4 = pwVar4 + 1;
      }
      uVar8 = 0;
LAB_14012372d:
      if (uVar8 == 0) {
        if (uVar3 == 0) {
          uVar8 = 0xffffffff;
        }
        else {
          uVar8 = (uint)(uVar3 != 1);
        }
      }
      if (uVar8 == 0) {
        for (pwVar7 = pwVar10 + 0xc; pwVar7 != pwVar6; pwVar7 = pwVar7 + 0x14) {
          if (pwVar2 != pwVar7) {
            if (7 < *(ulonglong *)(pwVar2 + 0xc)) {
              operator_delete(*(void **)pwVar2);
            }
            pwVar2[0xc] = L'\a';
            pwVar2[0xd] = L'\0';
            pwVar2[0xe] = L'\0';
            pwVar2[0xf] = L'\0';
            pwVar2[8] = L'\0';
            pwVar2[9] = L'\0';
            pwVar2[10] = L'\0';
            pwVar2[0xb] = L'\0';
            *pwVar2 = L'\0';
            if (*(ulonglong *)(pwVar2 + 0x20) < 8) {
              memmove(pwVar2,pwVar7,(*(ulonglong *)(pwVar2 + 0x1c) + 1) * 2);
            }
            else {
              *(ulonglong *)pwVar2 = *(ulonglong *)pwVar7;
              pwVar7[0] = L'\0';
              pwVar7[1] = L'\0';
              pwVar7[2] = L'\0';
              pwVar7[3] = L'\0';
            }
            *(ulonglong *)(pwVar2 + 8) = *(ulonglong *)(pwVar2 + 0x1c);
            *(ulonglong *)(pwVar2 + 0xc) = *(ulonglong *)(pwVar2 + 0x20);
            pwVar2[0x1c] = L'\0';
            pwVar2[0x1d] = L'\0';
            pwVar2[0x1e] = L'\0';
            pwVar2[0x1f] = L'\0';
            pwVar2[0x20] = L'\0';
            pwVar2[0x21] = L'\0';
            pwVar2[0x22] = L'\0';
            pwVar2[0x23] = L'\0';
          }
          pwVar2 = pwVar2 + 0x14;
        }
        pwVar2 = pwVar6 + -0x14;
        pwVar7 = local_698;
        for (pwVar4 = pwVar2; local_698 = pwVar7, pwVar5 = pwVar2, pwVar4 != pwVar6;
            pwVar4 = pwVar4 + 0x14) {
          if (7 < *(ulonglong *)(pwVar4 + 0xc)) {
            operator_delete(*(void **)pwVar4);
          }
          pwVar4[0xc] = L'\a';
          pwVar4[0xd] = L'\0';
          pwVar4[0xe] = L'\0';
          pwVar4[0xf] = L'\0';
          pwVar4[8] = L'\0';
          pwVar4[9] = L'\0';
          pwVar4[10] = L'\0';
          pwVar4[0xb] = L'\0';
          *pwVar4 = L'\0';
          pwVar7 = local_698;
        }
      }
      else {
        if (7 < *(ulonglong *)(pwVar10 + 4)) {
          pwVar2 = *(wchar_t **)pwVar2;
        }
        uVar9 = 2;
        if (uVar3 < 2) {
          uVar9 = uVar3;
        }
        pwVar5 = L"..";
        for (; uVar9 != 0; uVar9 = uVar9 - 1) {
          if (*pwVar2 != *pwVar5) {
            uVar8 = 1;
            if ((ushort)*pwVar2 < (ushort)*pwVar5) {
              uVar8 = 0xffffffff;
            }
            goto LAB_14012387d;
          }
          pwVar2 = pwVar2 + 1;
          pwVar5 = pwVar5 + 1;
        }
        uVar8 = 0;
LAB_14012387d:
        if (uVar8 == 0) {
          if (uVar3 < 2) {
            uVar8 = 0xffffffff;
          }
          else {
            uVar8 = (uint)(uVar3 != 2);
          }
        }
        if (uVar8 == 0) {
          for (pwVar2 = pwVar10 + 0xc; pwVar2 != pwVar6; pwVar2 = pwVar2 + 0x14) {
            FUN_14008ff90();
          }
          pwVar2 = pwVar6 + -0x14;
          pwVar7 = local_698;
          for (pwVar5 = pwVar2; local_698 = pwVar7, pwVar5 != pwVar6; pwVar5 = pwVar5 + 0x14) {
            if (7 < *(ulonglong *)(pwVar5 + 0xc)) {
              operator_delete(*(void **)pwVar5);
            }
            pwVar5[0xc] = L'\a';
            pwVar5[0xd] = L'\0';
            pwVar5[0xe] = L'\0';
            pwVar5[0xf] = L'\0';
            pwVar5[8] = L'\0';
            pwVar5[9] = L'\0';
            pwVar5[10] = L'\0';
            pwVar5[0xb] = L'\0';
            *pwVar5 = L'\0';
            pwVar7 = local_698;
          }
          pwVar5 = pwVar2;
          if (pwVar7 != pwVar11) {
            pwVar6 = pwVar11 + -0x14;
            local_670 = pwVar2;
            if (7 < *(ulonglong *)(pwVar11 + -8)) {
              operator_delete(*(void **)pwVar6);
            }
            pwVar11[-8] = L'\a';
            pwVar11[-7] = L'\0';
            pwVar11[-6] = L'\0';
            pwVar11[-5] = L'\0';
            pwVar11[-0xc] = L'\0';
            pwVar11[-0xb] = L'\0';
            pwVar11[-10] = L'\0';
            pwVar11[-9] = L'\0';
            *pwVar6 = L'\0';
            pwVar11 = pwVar6;
            local_690 = pwVar6;
            pwVar5 = local_670;
          }
        }
        else {
          pwVar10 = pwVar10 + 0x14;
          pwVar2 = pwVar6;
          pwVar5 = local_670;
        }
      }
      local_670 = pwVar5;
      pwVar6 = pwVar2;
    } while (pwVar10 + -8 != pwVar2);
  }
  pwVar6 = local_678;
  uVar3 = 0;
  memset(param_1,0,0x200);
  for (pwVar10 = pwVar7; pwVar5 = pwVar6, pwVar10 != pwVar11; pwVar10 = pwVar10 + 0x14) {
    pwVar5 = pwVar10;
    if (7 < *(ulonglong *)(pwVar10 + 0xc)) {
      pwVar5 = *(wchar_t **)pwVar10;
    }
    wcscat_s(param_1,0x100,pwVar5);
    wcscat_s(param_1,0x100,L"\\");
  }
  for (; pwVar5 != pwVar2; pwVar5 = pwVar5 + 0x14) {
    pwVar10 = pwVar5;
    if (7 < *(ulonglong *)(pwVar5 + 0xc)) {
      pwVar10 = *(wchar_t **)pwVar5;
    }
    wcscat_s(param_1,0x100,pwVar10);
    wcscat_s(param_1,0x100,L"\\");
  }
  wcscat_s(param_1,0x100,local_248);
  pwVar10 = pwVar2;
  for (pwVar5 = pwVar6; pwVar5 != pwVar2; pwVar5 = pwVar5 + 0x14) {
    if (7 < *(ulonglong *)(pwVar5 + 0xc)) {
      operator_delete(*(void **)pwVar5);
    }
    pwVar5[0xc] = L'\a';
    pwVar5[0xd] = L'\0';
    pwVar5[0xe] = L'\0';
    pwVar5[0xf] = L'\0';
    pwVar5[8] = L'\0';
    pwVar5[9] = L'\0';
    pwVar5[10] = L'\0';
    pwVar5[0xb] = L'\0';
    *pwVar5 = L'\0';
    pwVar10 = pwVar6;
  }
  if (DAT_140607be1 != '\0') {
    do {
      if ((ushort)(param_1[uVar3] + L'﾿') < 0x1a) {
        param_1[uVar3] = param_1[uVar3] + L' ';
      }
      uVar3 = uVar3 + 1;
    } while (uVar3 < 0x100);
  }
  pwVar2 = pwVar6;
  if (pwVar6 != (wchar_t *)0x0) {
    for (; pwVar2 != pwVar10; pwVar2 = pwVar2 + 0x14) {
      if (7 < *(ulonglong *)(pwVar2 + 0xc)) {
        operator_delete(*(void **)pwVar2);
      }
      pwVar2[0xc] = L'\a';
      pwVar2[0xd] = L'\0';
      pwVar2[0xe] = L'\0';
      pwVar2[0xf] = L'\0';
      pwVar2[8] = L'\0';
      pwVar2[9] = L'\0';
      pwVar2[10] = L'\0';
      pwVar2[0xb] = L'\0';
      *pwVar2 = L'\0';
    }
    operator_delete(pwVar6);
  }
  pwVar2 = pwVar7;
  if (pwVar7 != (wchar_t *)0x0) {
    for (; pwVar2 != pwVar11; pwVar2 = pwVar2 + 0x14) {
      if (7 < *(ulonglong *)(pwVar2 + 0xc)) {
        operator_delete(*(void **)pwVar2);
      }
      pwVar2[0xc] = L'\a';
      pwVar2[0xd] = L'\0';
      pwVar2[0xe] = L'\0';
      pwVar2[0xf] = L'\0';
      pwVar2[8] = L'\0';
      pwVar2[9] = L'\0';
      pwVar2[10] = L'\0';
      pwVar2[0xb] = L'\0';
      *pwVar2 = L'\0';
    }
    operator_delete(pwVar7);
  }
  return;
}



float * FUN_140123b20(float *param_1,float *param_2,float *param_3,float *param_4,float param_5)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  
  fVar1 = param_3[1];
  fVar2 = param_4[1];
  fVar7 = *param_2 - *param_4;
  fVar8 = param_2[1] - param_4[1];
  fVar9 = param_2[2] - param_4[2];
  fVar3 = param_3[2];
  fVar4 = param_4[2];
  fVar6 = fVar7 * fVar7 + fVar8 * fVar8 + fVar9 * fVar9;
  fVar5 = (float)(0x5f3759df - ((int)fVar6 >> 1));
  fVar5 = fVar5 * (1.5 - fVar5 * fVar5 * fVar6 * 0.5);
  *param_1 = ((*param_3 - *param_4) - fVar7) * param_5 + fVar7;
  param_1[1] = ((fVar1 - fVar2) - fVar8) * param_5 + fVar8;
  param_1[2] = ((fVar3 - fVar4) - fVar9) * param_5 + fVar9;
  fVar6 = (1.5 - fVar5 * fVar5 * fVar6 * 0.5) * fVar5 * fVar6;
  D3DXVec3Normalize(param_1,param_1);
  fVar1 = param_1[2];
  fVar2 = *param_1;
  fVar3 = param_1[1];
  *param_1 = fVar6 * fVar2;
  param_1[1] = fVar6 * fVar3;
  param_1[2] = fVar6 * fVar1;
  *param_1 = fVar6 * fVar2 + *param_4;
  param_1[1] = fVar6 * fVar3 + param_4[1];
  param_1[2] = fVar6 * fVar1 + param_4[2];
  return param_1;
}



undefined2 * FUN_140123ce0(void)

{
  undefined2 *puVar1;
  
  if (DAT_140607c18 == (undefined2 *)0x0) {
    puVar1 = operator_new(0x28);
    DAT_140607c18 = (undefined2 *)0x0;
    if (puVar1 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar1 + 0xc) = 7;
      *(undefined8 *)(puVar1 + 8) = 0;
      DAT_140607c18 = puVar1;
      *puVar1 = 0;
      return puVar1;
    }
  }
  return DAT_140607c18;
}



void FUN_140123d30(void)

{
  undefined8 *puVar1;
  
  puVar1 = DAT_140607c18;
  if (DAT_140607c18 != (undefined8 *)0x0) {
    if (7 < (ulonglong)DAT_140607c18[3]) {
      operator_delete((void *)*DAT_140607c18);
    }
    puVar1[3] = 7;
    puVar1[2] = 0;
    *(undefined2 *)puVar1 = 0;
    operator_delete(puVar1);
    DAT_140607c18 = (undefined8 *)0x0;
  }
  puVar1 = DAT_140607c20;
  if (DAT_140607c20 != (undefined8 *)0x0) {
    if (0xf < (ulonglong)DAT_140607c20[3]) {
      operator_delete((void *)*DAT_140607c20);
    }
    puVar1[3] = 0xf;
    puVar1[2] = 0;
    *(undefined1 *)puVar1 = 0;
    operator_delete(puVar1);
    DAT_140607c20 = (undefined8 *)0x0;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140123deb)
// WARNING: Removing unreachable block (ram,0x000140123df0)

void FUN_140123dc0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != param_1[1]) {
    FUN_14008d0a0(lVar1,param_1[1]);
    param_1[1] = lVar1;
  }
  return;
}



ulonglong FUN_140123e30(ushort *param_1,ulonglong param_2,ushort *param_3,ulonglong param_4)

{
  int iVar1;
  ulonglong uVar2;
  
  if (*(ulonglong *)(param_1 + 8) < param_2) {
    param_2 = *(ulonglong *)(param_1 + 8);
  }
  if (7 < *(ulonglong *)(param_1 + 0xc)) {
    param_1 = *(ushort **)param_1;
  }
  uVar2 = param_4;
  if (param_2 < param_4) {
    uVar2 = param_2;
  }
  do {
    if (uVar2 == 0) {
      iVar1 = 0;
LAB_140123e7e:
      uVar2 = (ulonglong)iVar1;
      if (iVar1 == 0) {
        if (param_2 < param_4) {
          return 0xffffffff;
        }
        uVar2 = (ulonglong)(param_2 != param_4);
      }
      return uVar2;
    }
    if (*param_1 != *param_3) {
      iVar1 = 1;
      if (*param_1 < *param_3) {
        iVar1 = -1;
      }
      goto LAB_140123e7e;
    }
    param_1 = param_1 + 1;
    param_3 = param_3 + 1;
    uVar2 = uVar2 - 1;
  } while( true );
}



bool FUN_140123eb0(longlong param_1,short *param_2)

{
  short sVar1;
  int iVar2;
  ulonglong uVar3;
  short *psVar4;
  
  uVar3 = 0xffffffffffffffff;
  psVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  iVar2 = FUN_140123e30(param_1,*(undefined8 *)(param_1 + 0x10),param_2,~uVar3 - 1);
  return iVar2 == 0;
}



void FUN_140123ef0(undefined8 *param_1,longlong param_2,longlong param_3,undefined2 param_4)

{
  undefined2 *puVar1;
  
  if (param_3 != 1) {
    if (7 < (ulonglong)param_1[3]) {
      param_1 = (undefined8 *)*param_1;
    }
    puVar1 = (undefined2 *)((longlong)param_1 + param_2 * 2);
    if (param_3 != 0) {
      for (; param_3 != 0; param_3 = param_3 + -1) {
        *puVar1 = param_4;
        puVar1 = puVar1 + 1;
      }
    }
    return;
  }
  if (7 < (ulonglong)param_1[3]) {
    param_1 = (undefined8 *)*param_1;
  }
  *(undefined2 *)((longlong)param_1 + param_2 * 2) = param_4;
  return;
}



undefined8 * FUN_140123f40(undefined8 *param_1,ulonglong param_2,undefined2 param_3)

{
  ulonglong uVar1;
  code *pcVar2;
  undefined8 *puVar3;
  
  if (-param_1[2] - 1 <= param_2) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    puVar3 = (undefined8 *)(*pcVar2)();
    return puVar3;
  }
  if (param_2 != 0) {
    uVar1 = param_1[2] + param_2;
    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_1400019f0(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;
    }
    FUN_140123ef0(param_1,param_1[2],param_2,param_3);
    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_140124030(float *param_1,float *param_2)

{
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = param_1[1] * param_2[2] - param_2[1] * param_1[2];
  DAT_140608018._4_4_ = param_1[2] * *param_2 - *param_1 * param_2[2];
  DAT_140608020 = param_2[1] * *param_1 - param_1[1] * *param_2;
  return &DAT_140608018;
}



void FUN_1401240b0(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_140124120(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_1405d84f0 ^ (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_1402ca220(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_140354510(&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_1405d8008;
    }
    local_138 = local_130;
    FUN_14012a1d0(&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_140001710(&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_14000d2c0(plVar6);
      plVar6 = plVar6 + 1;
      uVar3 = uVar3 - 1;
    } while (uVar3 != 0);
  }
  if (local_1b8 != (longlong *)0x0) {
    if (local_1c0 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*local_1c0 + 0x18))(local_1c0,local_1b8);
    }
  }
  return param_1;
}



void * FUN_140124420(void *param_1,uint param_2)

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



void FUN_140124450(undefined8 *param_1)

{
  *param_1 = MagiServerOption::vftable;
  if (param_1[0x35] != 0) {
    FUN_1401293f0();
  }
  if (param_1[0x31] != 0) {
    FUN_1401291a0(param_1[0x31],param_1[0x32]);
    operator_delete((void *)param_1[0x31]);
  }
  param_1[0x31] = 0;
  param_1[0x32] = 0;
  param_1[0x33] = 0;
  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_140608000 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



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

ulonglong FUN_140124600(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_1405d84f0 ^ (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_140125a10(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_140001710(&local_a8,param_2,~uVar8 - 1);
    pcVar7 = (char *)FUN_140415220(&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_140003e50(&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_140124d00(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
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_140124840(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_1405d84f0 ^ (ulonglong)auStack_128;
  *(undefined4 *)(param_1 + 0x140) = *param_2;
  *(undefined1 *)(param_1 + 0x1e8) = *(undefined1 *)(param_2 + 3);
  FUN_1400015e0(param_1 + 8,param_2 + 0x1e,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x30,param_2 + 10,0,0xffffffffffffffff);
  FUN_1400015e0(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 = &DAT_1405e73c8;
  if (7 < DAT_1405e73e0) {
    psVar8 = _DAT_1405e73c8;
  }
  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_140001710(&local_58,psVar8,~uVar5 - 1);
  FUN_140415220(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_14000ff80(local_108,pppppppuVar9);
  DAT_1405e0652 = 0;
  cVar2 = FUN_140010050(local_108,local_d0 + 2);
  plVar11 = local_e0;
  if (cVar2 == '\0') {
    pppppppuVar9 = local_80;
    if (0xf < local_68) {
      pppppppuVar9 = local_80[0];
    }
    FUN_1400054b0("Error File Name %s : %d - %s",pppppppuVar9,local_ac,local_a8 + 2);
    local_108[0] = TiXmlDocument::vftable;
    if (local_a8 != &DAT_140607be8) {
      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_140607be8) {
      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_140124a83;
  }
LAB_140124ac0:
  cVar2 = *(char *)(param_1 + 0x1e8);
  if (cVar2 == '\x05') {
    *(undefined4 *)(param_1 + 0x158) = 1;
  }
  else {
    if (cVar2 == '\f') {
      if (lVar4 == 0) goto LAB_140124c57;
      pcVar10 = "game";
    }
    else if (cVar2 == '\x11') {
      if (lVar4 == 0) goto LAB_140124c57;
      pcVar10 = "log";
    }
    else if (cVar2 == '\x12') {
      if (lVar4 == 0) goto LAB_140124c57;
      pcVar10 = "chat";
    }
    else {
      if ((cVar2 != '\x13') || (lVar4 == 0)) goto LAB_140124c57;
      pcVar10 = "emergency";
    }
    lVar4 = FUN_14000f670(lVar4,pcVar10);
    if (lVar4 != 0) {
      lVar6 = FUN_14000f670(lVar4,"db_account");
      if (lVar6 != 0) {
        FUN_1401277b0(param_1 + 0x90,param_1 + 0x130,lVar6);
      }
      lVar6 = FUN_14000f670(lVar4,&DAT_14049a49c);
      if (lVar6 != 0) {
        FUN_1401277b0(param_1 + 0xb8,param_1 + 0x134,lVar6);
      }
      lVar6 = FUN_14000f670(lVar4,"db_game");
      if (lVar6 != 0) {
        FUN_1401277b0(param_1 + 0xe0,param_1 + 0x138,lVar6);
      }
      lVar6 = FUN_14000f670(lVar4,"db_log");
      if (lVar6 != 0) {
        FUN_1401277b0(param_1 + 0x108,param_1 + 0x13c,lVar6);
      }
      lVar4 = FUN_14000f670(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_140124c57:
  local_108[0] = TiXmlDocument::vftable;
  if (local_a8 != &DAT_140607be8) {
    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_140607be8) {
    operator_delete__(local_c8);
  }
  local_108[0] = TiXmlBase::vftable;
  if (0xf < local_68) {
    operator_delete(local_80[0]);
  }
  return 1;
LAB_140124a83:
  while (lVar6 = (**(code **)(*plVar11 + 0x30))(plVar11), lVar6 == 0) {
    do {
      plVar11 = (longlong *)plVar11[10];
      if (plVar11 == (longlong *)0x0) goto LAB_140124ac0;
      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_140124ac0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_140124d00(longlong param_1,int param_2)

{
  short sVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  short *psVar9;
  undefined8 *******pppppppuVar10;
  longlong *plVar11;
  longlong *plVar12;
  char *pcVar13;
  char *pcVar14;
  char *pcVar15;
  char *pcVar16;
  char *pcVar17;
  char *pcVar18;
  short *psVar19;
  char *pcVar20;
  char *_Str;
  bool bVar21;
  undefined1 auStack_258 [32];
  undefined **local_238 [5];
  longlong *local_210;
  undefined8 *local_200;
  void *local_1f8;
  undefined4 local_1dc;
  undefined8 *local_1d8;
  void *local_1d0;
  basic_ios<> *local_1b8;
  undefined8 local_1b0;
  longlong local_1a8;
  undefined1 local_1a0 [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_1b0 = 0xfffffffffffffffe;
  local_40 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  psVar9 = &DAT_1405e73c8;
  if (7 < DAT_1405e73e0) {
    psVar9 = _DAT_1405e73c8;
  }
  local_a0 = 7;
  _Str = (char *)0x0;
  local_a8 = 0;
  local_b8 = 0;
  uVar5 = 0xffffffffffffffff;
  psVar19 = psVar9;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    sVar1 = *psVar19;
    psVar19 = psVar19 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_b8,psVar9,~uVar5 - 1);
  FUN_140415220(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;
  pppppppuVar10 = local_68;
  if (0xf < local_50) {
    pppppppuVar10 = local_68[0];
  }
  FUN_14000ff80(local_238,pppppppuVar10);
  DAT_1405e0652 = 0;
  cVar2 = FUN_140010050(local_238,local_200 + 2);
  if (cVar2 == '\0') {
    FUN_1400054b0("Error : %d - %s",local_1dc,local_1d8 + 2);
    local_238[0] = TiXmlDocument::vftable;
    if (local_1d8 != &DAT_140607be8) {
      operator_delete__(local_1d0);
    }
    local_238[0] = TiXmlNode::vftable;
    while (local_210 != (longlong *)0x0) {
      plVar12 = (longlong *)local_210[10];
      (**(code **)*local_210)(local_210,1);
      local_210 = plVar12;
    }
    if (local_200 != &DAT_140607be8) {
      operator_delete__(local_1f8);
    }
    local_238[0] = TiXmlBase::vftable;
    if (0xf < local_50) {
      operator_delete(local_68[0]);
    }
    return 0;
  }
  if ((*(byte *)(param_1 + 0x1e8) < 0xd) ||
     (plVar12 = local_210, (byte)(*(byte *)(param_1 + 0x1e8) - 0x11) < 3)) {
    FUN_140127fe0(param_1);
    plVar12 = local_210;
  }
  for (; plVar12 != (longlong *)0x0; plVar12 = (longlong *)plVar12[10]) {
    bVar21 = (char *)(plVar12[7] + 0x10) == (char *)0x0;
    lVar6 = 0xd;
    pcVar13 = (char *)(plVar12[7] + 0x10);
    pcVar14 = "agentmanager";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar21 = *pcVar13 == *pcVar14;
      pcVar13 = pcVar13 + 1;
      pcVar14 = pcVar14 + 1;
    } while (bVar21);
    if (bVar21) goto LAB_140124f13;
  }
LAB_140124f74:
  *(int *)(param_1 + 0x154) = param_2;
  *(undefined1 *)(param_1 + 0x150) = 1;
  FUN_140128370(&local_1a8);
  std::basic_ostream<>::operator<<((basic_ostream<> *)&local_1a8,param_2);
  FUN_140128410(&local_1a8,&local_90);
  for (plVar12 = local_210; plVar11 = local_210, plVar12 != (longlong *)0x0;
      plVar12 = (longlong *)plVar12[10]) {
    bVar21 = (char *)(plVar12[7] + 0x10) == (char *)0x0;
    lVar6 = 0xc;
    pcVar13 = (char *)(plVar12[7] + 0x10);
    pcVar14 = "each_option";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar21 = *pcVar13 == *pcVar14;
      pcVar13 = pcVar13 + 1;
      pcVar14 = pcVar14 + 1;
    } while (bVar21);
    if (bVar21) goto LAB_140124fe6;
  }
joined_r0x00014012516b:
  do {
    plVar12 = local_210;
    if (plVar11 == (longlong *)0x0) goto joined_r0x000140125237;
    bVar21 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
    lVar6 = 4;
    pcVar13 = (char *)(plVar11[7] + 0x10);
    pcVar14 = "dns";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar21 = *pcVar13 == *pcVar14;
      pcVar13 = pcVar13 + 1;
      pcVar14 = pcVar14 + 1;
    } while (bVar21);
    if (bVar21) goto LAB_140125197;
    plVar11 = (longlong *)plVar11[10];
  } while( true );
LAB_140124f13:
  while (lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12), lVar6 == 0) {
    do {
      plVar12 = (longlong *)plVar12[10];
      if (plVar12 == (longlong *)0x0) goto LAB_140124f74;
      bVar21 = (char *)(plVar12[7] + 0x10) == (char *)0x0;
      lVar6 = 0xd;
      pcVar13 = (char *)(plVar12[7] + 0x10);
      pcVar14 = "agentmanager";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
    } while (!bVar21);
  }
  lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12);
  if ((lVar6 != 0) && (lVar6 = FUN_14000f670(lVar6,"server"), lVar6 != 0)) {
    FUN_140127890(param_1,lVar6,0x15);
  }
  goto LAB_140124f74;
LAB_140124fe6:
  while (lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12), lVar6 == 0) {
    do {
      plVar12 = (longlong *)plVar12[10];
      plVar11 = local_210;
      if (plVar12 == (longlong *)0x0) goto joined_r0x00014012516b;
      bVar21 = (char *)(plVar12[7] + 0x10) == (char *)0x0;
      lVar6 = 0xc;
      pcVar13 = (char *)(plVar12[7] + 0x10);
      pcVar14 = "each_option";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
    } while (!bVar21);
  }
  lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12);
  plVar11 = local_210;
  if (lVar6 != 0) {
    for (plVar12 = *(longlong **)(lVar6 + 0x28); pcVar13 = _Str, plVar12 != (longlong *)0x0;
        plVar12 = (longlong *)plVar12[10]) {
      lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12);
      if (lVar6 != 0) {
        pcVar13 = (char *)(**(code **)(*plVar12 + 0x30))(plVar12);
        break;
      }
    }
joined_r0x000140125063:
    plVar11 = local_210;
    if (pcVar13 != (char *)0x0) {
      pcVar14 = (char *)(*(longlong *)(pcVar13 + 0x38) + 0x10);
      if (pcVar14 != (char *)0x0) {
        for (pcVar15 = *(char **)(pcVar13 + 0xa0); pcVar15 != pcVar13 + 0x58;
            pcVar15 = *(char **)(pcVar15 + 0x48)) {
          bVar21 = (char *)(*(longlong *)(pcVar15 + 0x20) + 0x10) == (char *)0x0;
          lVar6 = 5;
          pcVar16 = (char *)(*(longlong *)(pcVar15 + 0x20) + 0x10);
          pcVar17 = "code";
          do {
            if (lVar6 == 0) break;
            lVar6 = lVar6 + -1;
            bVar21 = *pcVar16 == *pcVar17;
            pcVar16 = pcVar16 + 1;
            pcVar17 = pcVar17 + 1;
          } while (bVar21);
          if (bVar21) {
            if ((char *)(*(longlong *)(pcVar15 + 0x30) + 0x10) != (char *)0x0) {
              pcVar16 = &local_90;
              if (0xf < local_78) {
                pcVar16 = (char *)CONCAT71(uStack_8f,local_90);
              }
              iVar3 = _stricmp(pcVar16,(char *)(*(longlong *)(pcVar15 + 0x30) + 0x10));
              if (iVar3 == 0) {
                iVar3 = _stricmp(pcVar14,"guild");
                if (iVar3 == 0) {
                  *(undefined4 *)(param_1 + 0x158) = 1;
                }
                else {
                  iVar3 = _stricmp(pcVar14,"api");
                  if (iVar3 == 0) {
                    FUN_140127890(param_1,pcVar13,0x17);
                  }
                }
              }
            }
            break;
          }
        }
      }
      for (plVar12 = *(longlong **)(pcVar13 + 0x50); pcVar13 = _Str, plVar12 != (longlong *)0x0;
          plVar12 = (longlong *)plVar12[10]) {
        lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12);
        if (lVar6 != 0) {
          pcVar13 = (char *)(**(code **)(*plVar12 + 0x30))(plVar12);
          break;
        }
      }
      goto joined_r0x000140125063;
    }
  }
  goto joined_r0x00014012516b;
LAB_140125197:
  while (lVar6 = (**(code **)(*plVar11 + 0x30))(plVar11), lVar6 == 0) {
    do {
      plVar11 = (longlong *)plVar11[10];
      plVar12 = local_210;
      if (plVar11 == (longlong *)0x0) goto joined_r0x000140125237;
      bVar21 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
      lVar6 = 4;
      pcVar13 = (char *)(plVar11[7] + 0x10);
      pcVar14 = "dns";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
    } while (!bVar21);
  }
  lVar6 = (**(code **)(*plVar11 + 0x30))(plVar11);
  plVar12 = local_210;
  if (lVar6 != 0) {
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); lVar8 != lVar6 + 0x58;
        lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar13 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar13 == (char *)0x0;
      lVar4 = 4;
      pcVar14 = "dns";
      do {
        if (lVar4 == 0) break;
        lVar4 = lVar4 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar13 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        if (pcVar13 != (char *)0x0) {
          iVar3 = atoi(pcVar13);
          *(bool *)(param_1 + 0x151) = 0 < iVar3;
          plVar12 = local_210;
        }
        break;
      }
    }
  }
joined_r0x000140125237:
  do {
    plVar11 = local_210;
    if (plVar12 == (longlong *)0x0) goto joined_r0x000140125307;
    bVar21 = (char *)(plVar12[7] + 0x10) == (char *)0x0;
    lVar6 = 0xb;
    pcVar13 = (char *)(plVar12[7] + 0x10);
    pcVar14 = "code_start";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar21 = *pcVar13 == *pcVar14;
      pcVar13 = pcVar13 + 1;
      pcVar14 = pcVar14 + 1;
    } while (bVar21);
    if (bVar21) break;
    plVar12 = (longlong *)plVar12[10];
  } while( true );
  while (lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12), lVar6 == 0) {
    do {
      plVar12 = (longlong *)plVar12[10];
      plVar11 = local_210;
      if (plVar12 == (longlong *)0x0) goto joined_r0x000140125307;
      bVar21 = (char *)(plVar12[7] + 0x10) == (char *)0x0;
      lVar6 = 0xb;
      pcVar13 = (char *)(plVar12[7] + 0x10);
      pcVar14 = "code_start";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
    } while (!bVar21);
  }
  lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12);
  plVar11 = local_210;
  if (lVar6 != 0) {
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); lVar8 != lVar6 + 0x58;
        lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar13 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar13 == (char *)0x0;
      lVar4 = 0xb;
      pcVar14 = "code_start";
      do {
        if (lVar4 == 0) break;
        lVar4 = lVar4 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar13 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        if (pcVar13 != (char *)0x0) {
          iVar3 = atoi(pcVar13);
          *(bool *)(param_1 + 0x152) = 0 < iVar3;
          plVar11 = local_210;
        }
        break;
      }
    }
  }
joined_r0x000140125307:
  do {
    if (plVar11 == (longlong *)0x0) goto LAB_14012554c;
    bVar21 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
    lVar6 = 8;
    pcVar13 = (char *)(plVar11[7] + 0x10);
    pcVar14 = "setting";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar21 = *pcVar13 == *pcVar14;
      pcVar13 = pcVar13 + 1;
      pcVar14 = pcVar14 + 1;
    } while (bVar21);
    if (bVar21) break;
    plVar11 = (longlong *)plVar11[10];
  } while( true );
  while (lVar6 = (**(code **)(*plVar11 + 0x30))(plVar11), lVar6 == 0) {
    do {
      plVar11 = (longlong *)plVar11[10];
      if (plVar11 == (longlong *)0x0) goto LAB_14012554c;
      bVar21 = (char *)(plVar11[7] + 0x10) == (char *)0x0;
      lVar6 = 8;
      pcVar13 = (char *)(plVar11[7] + 0x10);
      pcVar14 = "setting";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
    } while (!bVar21);
  }
  lVar6 = (**(code **)(*plVar11 + 0x30))(plVar11);
  if (lVar6 != 0) {
    lVar4 = lVar6 + 0x58;
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); pcVar13 = _Str, lVar8 != lVar4;
        lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar13 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar13 == (char *)0x0;
      lVar7 = 6;
      pcVar14 = "multi";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar13 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); pcVar14 = _Str, lVar8 != lVar4;
        lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar14 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar14 == (char *)0x0;
      lVar7 = 5;
      pcVar15 = "lock";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar14 == *pcVar15;
        pcVar14 = pcVar14 + 1;
        pcVar15 = pcVar15 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar14 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); pcVar15 = _Str, lVar8 != lVar4;
        lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar15 == (char *)0x0;
      lVar7 = 0xd;
      pcVar16 = "start_server";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar15 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); pcVar16 = _Str, lVar8 != lVar4;
        lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar16 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar16 == (char *)0x0;
      lVar7 = 0xe;
      pcVar17 = "revive_server";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar16 == *pcVar17;
        pcVar16 = pcVar16 + 1;
        pcVar17 = pcVar17 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar16 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar6 = *(longlong *)(lVar6 + 0xa0); pcVar17 = _Str, lVar6 != lVar4;
        lVar6 = *(longlong *)(lVar6 + 0x48)) {
      pcVar17 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
      bVar21 = pcVar17 == (char *)0x0;
      lVar8 = 0xd;
      pcVar18 = "open_channel";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar21 = *pcVar17 == *pcVar18;
        pcVar17 = pcVar17 + 1;
        pcVar18 = pcVar18 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar17 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
        break;
      }
    }
    if (pcVar13 != (char *)0x0) {
      iVar3 = atoi(pcVar13);
      *(bool *)(param_1 + 0x166) = 0 < iVar3;
    }
    if (pcVar16 != (char *)0x0) {
      iVar3 = atoi(pcVar16);
      *(bool *)(param_1 + 0x171) = 0 < iVar3;
    }
    if (pcVar17 != (char *)0x0) {
      iVar3 = atoi(pcVar17);
      *(bool *)(param_1 + 0x170) = 0 < iVar3;
    }
    if (pcVar14 != (char *)0x0) {
      iVar3 = atoi(pcVar14);
      *(double *)(param_1 + 0x168) = (double)iVar3;
    }
    if (pcVar15 != (char *)0x0) {
      iVar3 = atoi(pcVar15);
      *(double *)(param_1 + 0x178) = (double)iVar3;
    }
  }
LAB_14012554c:
  DAT_140607be2 = 0;
  DAT_140607be3 = 0;
  DAT_140607c15 = 0;
  DAT_1405deafa = 0;
  DAT_140607c17 = 0;
  DAT_1405deafb = 1;
  DAT_1405e0650 = 1;
  for (plVar12 = local_210; plVar12 != (longlong *)0x0; plVar12 = (longlong *)plVar12[10]) {
    bVar21 = (char *)(plVar12[7] + 0x10) == (char *)0x0;
    lVar6 = 8;
    pcVar13 = (char *)(plVar12[7] + 0x10);
    pcVar14 = "develop";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar21 = *pcVar13 == *pcVar14;
      pcVar13 = pcVar13 + 1;
      pcVar14 = pcVar14 + 1;
    } while (bVar21);
    if (bVar21) goto LAB_1401255b6;
  }
  goto LAB_140125863;
LAB_1401255b6:
  while (lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12), lVar6 == 0) {
    do {
      plVar12 = (longlong *)plVar12[10];
      if (plVar12 == (longlong *)0x0) goto LAB_140125863;
      bVar21 = (char *)(plVar12[7] + 0x10) == (char *)0x0;
      lVar6 = 8;
      pcVar13 = (char *)(plVar12[7] + 0x10);
      pcVar14 = "develop";
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
    } while (!bVar21);
  }
  lVar6 = (**(code **)(*plVar12 + 0x30))(plVar12);
  if (lVar6 != 0) {
    lVar4 = lVar6 + 0x58;
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); pcVar13 = _Str, lVar8 != lVar4;
        lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar13 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar13 == (char *)0x0;
      lVar7 = 8;
      pcVar14 = "preload";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar13 == *pcVar14;
        pcVar13 = pcVar13 + 1;
        pcVar14 = pcVar14 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar13 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); lVar8 != lVar4; lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar14 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar14 == (char *)0x0;
      lVar7 = 0xd;
      pcVar15 = "preload_char";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar14 == *pcVar15;
        pcVar14 = pcVar14 + 1;
        pcVar15 = pcVar15 + 1;
      } while (bVar21);
      if (bVar21) {
        _Str = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); lVar8 != lVar4; lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar14 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar14 == (char *)0x0;
      lVar7 = 0xc;
      pcVar15 = "enemy_debug";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar14 == *pcVar15;
        pcVar14 = pcVar14 + 1;
        pcVar15 = pcVar15 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar14 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        goto LAB_1401256c0;
      }
    }
    pcVar14 = (char *)0x0;
LAB_1401256c0:
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); lVar8 != lVar4; lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar15 == (char *)0x0;
      lVar7 = 10;
      pcVar16 = "enemy_one";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar15 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        goto LAB_140125700;
      }
    }
    pcVar15 = (char *)0x0;
LAB_140125700:
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); lVar8 != lVar4; lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar16 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar16 == (char *)0x0;
      lVar7 = 0xd;
      pcVar17 = "player_debug";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar16 == *pcVar17;
        pcVar16 = pcVar16 + 1;
        pcVar17 = pcVar17 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar16 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        goto LAB_140125740;
      }
    }
    pcVar16 = (char *)0x0;
LAB_140125740:
    for (lVar8 = *(longlong *)(lVar6 + 0xa0); lVar8 != lVar4; lVar8 = *(longlong *)(lVar8 + 0x48)) {
      pcVar17 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar21 = pcVar17 == (char *)0x0;
      lVar7 = 9;
      pcVar18 = "lua_text";
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        bVar21 = *pcVar17 == *pcVar18;
        pcVar17 = pcVar17 + 1;
        pcVar18 = pcVar18 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar17 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        goto LAB_14012577f;
      }
    }
    pcVar17 = (char *)0x0;
LAB_14012577f:
    for (lVar6 = *(longlong *)(lVar6 + 0xa0); lVar6 != lVar4; lVar6 = *(longlong *)(lVar6 + 0x48)) {
      pcVar18 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
      bVar21 = pcVar18 == (char *)0x0;
      lVar8 = 9;
      pcVar20 = "lua_send";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar21 = *pcVar18 == *pcVar20;
        pcVar18 = pcVar18 + 1;
        pcVar20 = pcVar20 + 1;
      } while (bVar21);
      if (bVar21) {
        pcVar18 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
        goto LAB_1401257bf;
      }
    }
    pcVar18 = (char *)0x0;
LAB_1401257bf:
    if (pcVar13 != (char *)0x0) {
      iVar3 = atoi(pcVar13);
      DAT_1405deafb = 0 < iVar3;
    }
    if (_Str != (char *)0x0) {
      iVar3 = atoi(_Str);
      DAT_1405e0650 = 0 < iVar3;
    }
    if (pcVar15 != (char *)0x0) {
      iVar3 = atoi(pcVar15);
      DAT_140607be3 = 0 < iVar3;
    }
    if (pcVar14 != (char *)0x0) {
      iVar3 = atoi(pcVar14);
      DAT_140607be2 = 0 < iVar3;
    }
    if (pcVar16 != (char *)0x0) {
      iVar3 = atoi(pcVar16);
      DAT_140607c15 = 0 < iVar3;
    }
    if (pcVar17 != (char *)0x0) {
      iVar3 = atoi(pcVar17);
      DAT_1405deafa = 0 < iVar3;
    }
    if (pcVar18 != (char *)0x0) {
      iVar3 = atoi(pcVar18);
      DAT_140607c17 = 0 < iVar3;
    }
  }
LAB_140125863:
  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 ***)(local_1a0 + (longlong)*(int *)(local_1a8 + 4) + -8) =
       std::basic_ostringstream<>::vftable;
  FUN_140128440(local_1a0);
  *(code **)(local_1a0 + (longlong)*(int *)(local_1a8 + 4) + -8) = _vftable__exref;
  std::basic_ios<>::~basic_ios<>(local_120);
  local_238[0] = TiXmlDocument::vftable;
  if (local_1d8 != &DAT_140607be8) {
    operator_delete__(local_1d0);
  }
  local_238[0] = TiXmlNode::vftable;
  while (local_210 != (longlong *)0x0) {
    plVar12 = (longlong *)local_210[10];
    (**(code **)*local_210)(local_210,1);
    local_210 = plVar12;
  }
  if (local_200 != &DAT_140607be8) {
    operator_delete__(local_1f8);
  }
  local_238[0] = TiXmlBase::vftable;
  if (0xf < local_50) {
    operator_delete(local_68[0]);
  }
  return 1;
}



void FUN_140125990(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_140128440(param_1 + 1);
  *(code **)(this + (longlong)*(int *)(*param_1 + 4) + -0x88) = _vftable__exref;
                    // WARNING: Could not recover jumptable at 0x0001401259fb. 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_140125a10(longlong param_1,LPCWSTR param_2)

{
  char **ppcVar1;
  WCHAR WVar2;
  char cVar3;
  int iVar4;
  char **ppcVar5;
  char *pcVar6;
  undefined8 uVar7;
  longlong lVar8;
  ulonglong uVar9;
  longlong lVar10;
  longlong lVar11;
  longlong lVar12;
  wchar_t *_Format;
  longlong *plVar13;
  longlong *plVar14;
  char *pcVar15;
  char *pcVar16;
  char *pcVar17;
  char *pcVar18;
  char *pcVar19;
  LPCWSTR pWVar20;
  char *pcVar21;
  LPCSTR pCVar22;
  WCHAR *pWVar23;
  LPCSTR pCVar24;
  bool bVar25;
  undefined1 auStackY_4e8 [32];
  char *local_4a0;
  char *local_498 [2];
  undefined **local_488;
  undefined8 local_480;
  undefined8 local_478;
  undefined8 local_470;
  undefined4 local_468;
  longlong *local_460;
  undefined8 local_458;
  undefined8 *local_450;
  void *local_448;
  undefined8 local_440;
  undefined8 local_438;
  undefined1 local_430;
  undefined4 local_42c;
  undefined8 *local_428;
  void *local_420;
  undefined4 local_418;
  undefined8 local_414;
  undefined1 local_40c;
  char *local_408;
  char *local_400;
  char *local_3f8;
  char *local_3f0;
  char *local_3e8;
  undefined8 local_3e0;
  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_3e0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStackY_4e8;
  local_368[0] = '\0';
  memset(local_368 + 1,0,0x103);
  lVar8 = -1;
  pWVar20 = param_2;
  do {
    if (lVar8 == 0) break;
    lVar8 = lVar8 + -1;
    WVar2 = *pWVar20;
    pWVar20 = pWVar20 + 1;
  } while (WVar2 != L'\0');
  pcVar15 = (char *)0x0;
  WideCharToMultiByte(0,0,param_2,~(uint)lVar8,local_368,0x104,(LPCSTR)0x0,(LPBOOL)0x0);
  local_480 = 0xffffffffffffffff;
  local_478 = 0;
  local_450 = &DAT_140607be8;
  local_470 = 0;
  local_468 = 0;
  local_460 = (longlong *)0x0;
  local_458 = 0;
  local_440 = 0;
  local_438 = 0;
  local_488 = TiXmlDocument::vftable;
  local_428 = &DAT_140607be8;
  local_414 = 0xffffffffffffffff;
  local_418 = 4;
  local_40c = 0;
  uVar9 = 0xffffffffffffffff;
  pcVar6 = local_368;
  do {
    if (uVar9 == 0) break;
    uVar9 = uVar9 - 1;
    cVar3 = *pcVar6;
    pcVar6 = pcVar6 + 1;
  } while (cVar3 != '\0');
  FUN_14000ec00(&local_450,local_368,~uVar9 - 1);
  local_430 = 0;
  local_42c = 0;
  FUN_14000ec00(&local_428,&DAT_14047e238,0);
  local_414 = 0;
  DAT_1405e0652 = 0;
  cVar3 = FUN_140010050(&local_488);
  if (cVar3 == '\0') {
    FUN_1400054b0("Error : %d - %s",local_42c,local_428 + 2);
    local_488 = TiXmlDocument::vftable;
    if (local_428 != &DAT_140607be8) {
      operator_delete__(local_420);
    }
    local_488 = TiXmlNode::vftable;
    plVar14 = local_460;
    while (plVar14 != (longlong *)0x0) {
      plVar13 = (longlong *)plVar14[10];
      (**(code **)*plVar14)(plVar14,1);
      plVar14 = plVar13;
    }
    if (local_450 != &DAT_140607be8) {
      operator_delete__(local_448);
    }
    return 0;
  }
  memset(local_258,0,0x208);
  for (plVar14 = local_460; plVar14 != (longlong *)0x0; plVar14 = (longlong *)plVar14[10]) {
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 7;
    pcVar6 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "server";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar6 == *pcVar16;
      pcVar6 = pcVar6 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) goto LAB_140125c26;
  }
  goto LAB_1401263f7;
LAB_140125c26:
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      if (plVar14 == (longlong *)0x0) goto LAB_1401263f7;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 7;
      pcVar6 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "server";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))();
  if (lVar8 != 0) {
    lVar10 = lVar8 + 0x58;
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 5;
      pcVar16 = "name";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        local_408 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140125cb5;
      }
    }
    local_408 = (char *)0x0;
LAB_140125cb5:
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 5;
      pcVar16 = "code";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        local_4a0 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140125cf7;
      }
    }
    local_4a0 = (char *)0x0;
LAB_140125cf7:
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 0xb;
      pcVar16 = "private_ip";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        local_498[0] = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140125d37;
      }
    }
    local_498[0] = (char *)0x0;
LAB_140125d37:
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 0xd;
      pcVar16 = "private_port";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        local_400 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140125d75;
      }
    }
    local_400 = (char *)0x0;
LAB_140125d75:
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 10;
      pcVar16 = "public_ip";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        local_3e8 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140125db5;
      }
    }
    local_3e8 = (char *)0x0;
LAB_140125db5:
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 0xc;
      pcVar16 = "public_port";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        local_3f8 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140125df5;
      }
    }
    local_3f8 = (char *)0x0;
LAB_140125df5:
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 0xf;
      pcVar16 = "public_udpport";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        local_3f0 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140125e35;
      }
    }
    local_3f0 = (char *)0x0;
LAB_140125e35:
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); pCVar24 = pcVar15, lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 0xb;
      pcVar16 = "thread_num";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        pCVar24 = (LPCSTR)(*(longlong *)(lVar12 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); pcVar6 = pcVar15, lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar6 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar6 == (char *)0x0;
      lVar11 = 6;
      pcVar16 = "agent";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar6 == *pcVar16;
        pcVar6 = pcVar6 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar6 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); pcVar16 = pcVar15, lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar16 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar16 == (char *)0x0;
      lVar11 = 6;
      pcVar17 = "debug";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar16 == *pcVar17;
        pcVar16 = pcVar16 + 1;
        pcVar17 = pcVar17 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar16 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar17 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar17 == (char *)0x0;
      lVar11 = 6;
      pcVar19 = "world";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar17 == *pcVar19;
        pcVar17 = pcVar17 + 1;
        pcVar19 = pcVar19 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar15 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar17 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar17 == (char *)0x0;
      lVar11 = 10;
      pcVar19 = "udp_count";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar17 == *pcVar19;
        pcVar17 = pcVar17 + 1;
        pcVar19 = pcVar19 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar17 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        goto LAB_140125f76;
      }
    }
    pcVar17 = (char *)0x0;
LAB_140125f76:
    pcVar19 = (char *)0x0;
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar10;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar18 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar18 == (char *)0x0;
      lVar11 = 0xc;
      pcVar21 = "private_dns";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar18 == *pcVar21;
        pcVar18 = pcVar18 + 1;
        pcVar21 = pcVar21 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar19 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar8 = *(longlong *)(lVar8 + 0xa0); lVar8 != lVar10; lVar8 = *(longlong *)(lVar8 + 0x48))
    {
      pcVar18 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar25 = pcVar18 == (char *)0x0;
      lVar12 = 0xb;
      pcVar21 = "public_dns";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        bVar25 = *pcVar18 == *pcVar21;
        pcVar18 = pcVar18 + 1;
        pcVar21 = pcVar21 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar18 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        goto LAB_140125ff3;
      }
    }
    pcVar18 = (char *)0x0;
LAB_140125ff3:
    if (pcVar19 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar8 = -1;
      pcVar21 = pcVar19;
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        cVar3 = *pcVar21;
        pcVar21 = pcVar21 + 1;
      } while (cVar3 != '\0');
      FUN_140003e50(&local_398,pcVar19);
      uVar7 = FUN_140415310(&local_3d8,&local_398);
      FUN_14008ff90(param_1 + 0x30,uVar7);
      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_498[0] != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar8 = -1;
      pcVar19 = local_498[0];
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        cVar3 = *pcVar19;
        pcVar19 = pcVar19 + 1;
      } while (cVar3 != '\0');
      FUN_140003e50(&local_398);
      uVar7 = FUN_140415310(&local_3d8,&local_398);
      FUN_14008ff90(param_1 + 0x30,uVar7);
      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 (pcVar18 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar8 = -1;
      pcVar19 = pcVar18;
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        cVar3 = *pcVar19;
        pcVar19 = pcVar19 + 1;
      } while (cVar3 != '\0');
      FUN_140003e50(&local_398,pcVar18);
      uVar7 = FUN_140415310(&local_3d8,&local_398);
      FUN_14008ff90(param_1 + 0x58,uVar7);
      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_3e8 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar8 = -1;
      pcVar19 = local_3e8;
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        cVar3 = *pcVar19;
        pcVar19 = pcVar19 + 1;
      } while (cVar3 != '\0');
      FUN_140003e50(&local_398);
      uVar7 = FUN_140415310(&local_3d8,&local_398);
      FUN_14008ff90(param_1 + 0x58,uVar7);
      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_400 != (char *)0x0) {
      iVar4 = atoi(local_400);
      *(int *)(param_1 + 0x80) = iVar4;
    }
    if (local_3f8 != (char *)0x0) {
      iVar4 = atoi(local_3f8);
      *(int *)(param_1 + 0x84) = iVar4;
    }
    if (local_3f0 != (char *)0x0) {
      iVar4 = atoi(local_3f0);
      *(int *)(param_1 + 0x88) = iVar4;
    }
    if (local_408 != (char *)0x0) {
      local_380 = 0xf;
      local_388 = 0;
      local_398 = 0;
      lVar8 = -1;
      pcVar19 = local_408;
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        cVar3 = *pcVar19;
        pcVar19 = pcVar19 + 1;
      } while (cVar3 != '\0');
      FUN_140003e50(&local_398);
      FUN_140415310(&local_3d8,&local_398);
      FUN_14008ff90(param_1 + 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 (pCVar24 == (LPCSTR)0x0) {
      *(undefined4 *)(param_1 + 0x15c) = 1;
    }
    else {
      memset(local_258,0,0x208);
      MultiByteToWideChar(0,1,pCVar24,0x104,local_258,0x104);
      ppcVar1 = (char **)(param_1 + 0x15c);
      iVar4 = _wtoi(local_258);
      *(int *)ppcVar1 = iVar4;
      local_498[0] = (char *)CONCAT44(local_498[0]._4_4_,1);
      ppcVar5 = local_498;
      if (1 < *(int *)ppcVar1) {
        ppcVar5 = ppcVar1;
      }
      *(int *)ppcVar1 = *(int *)ppcVar5;
    }
    if (local_4a0 != (char *)0x0) {
      iVar4 = atoi(local_4a0);
      *(int *)(param_1 + 0x154) = iVar4;
    }
    if (pcVar6 != (char *)0x0) {
      iVar4 = atoi(pcVar6);
      *(bool *)(param_1 + 0x150) = iVar4 == 1;
    }
    if (pcVar16 != (char *)0x0) {
      iVar4 = atoi(pcVar16);
      *(bool *)(param_1 + 0x165) = iVar4 == 1;
    }
    if (pcVar15 != (char *)0x0) {
      iVar4 = atoi(pcVar15);
      *(int *)(param_1 + 0x140) = iVar4;
    }
    if (pcVar17 != (char *)0x0) {
      iVar4 = atoi(pcVar17);
      *(int *)(param_1 + 0x8c) = iVar4;
    }
  }
LAB_1401263f7:
  pcVar6 = (char *)0x0;
  for (plVar14 = local_460; plVar13 = local_460, plVar14 != (longlong *)0x0;
      plVar14 = (longlong *)plVar14[10]) {
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 0xb;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "db_account";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) goto LAB_140126433;
  }
joined_r0x00014012648f:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x000140126510;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 7;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "db_web";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) goto LAB_1401264b4;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
LAB_140126433:
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x00014012648f;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 0xb;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "db_account";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    FUN_1401277b0(param_1 + 0x90,param_1 + 0x130);
    plVar13 = local_460;
  }
  goto joined_r0x00014012648f;
LAB_1401264b4:
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x000140126510;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 7;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "db_web";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    FUN_1401277b0(param_1 + 0xb8,param_1 + 0x134);
    plVar14 = local_460;
  }
joined_r0x000140126510:
  do {
    plVar13 = local_460;
    if (plVar14 == (longlong *)0x0) goto joined_r0x00014012659f;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 8;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "db_game";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x00014012659f;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 8;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "db_game";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    FUN_1401277b0(param_1 + 0xe0,param_1 + 0x138);
    plVar13 = local_460;
  }
joined_r0x00014012659f:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x000140126620;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 0xc;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "db_game_log";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x000140126620;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 0xc;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "db_game_log";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    FUN_1401277b0(param_1 + 0x108,param_1 + 0x13c);
    plVar14 = local_460;
  }
joined_r0x000140126620:
  do {
    plVar13 = local_460;
    if (plVar14 == (longlong *)0x0) goto joined_r0x0001401266f1;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 4;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "dbc";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x0001401266f1;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 4;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "dbc";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar8 + 0x58;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar15 == (char *)0x0;
      lVar10 = 0x13;
      pcVar16 = "write_thread_count";
      do {
        if (lVar10 == 0) break;
        lVar10 = lVar10 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar15 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        if (pcVar15 != (char *)0x0) {
          iVar4 = atoi(pcVar15);
          *(int *)(param_1 + 0x14c) = iVar4;
          plVar13 = local_460;
        }
        break;
      }
    }
  }
joined_r0x0001401266f1:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x0001401267c1;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 9;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "db_cache";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x0001401267c1;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 9;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "db_cache";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar8 + 0x58;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar15 == (char *)0x0;
      lVar10 = 0xe;
      pcVar16 = "session_count";
      do {
        if (lVar10 == 0) break;
        lVar10 = lVar10 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar15 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        if (pcVar15 != (char *)0x0) {
          iVar4 = atoi(pcVar15);
          *(int *)(param_1 + 0x144) = iVar4;
          plVar14 = local_460;
        }
        break;
      }
    }
  }
joined_r0x0001401267c1:
  do {
    if (plVar14 == (longlong *)0x0) goto LAB_140126885;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 0xd;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "db_log_cache";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      if (plVar14 == (longlong *)0x0) goto LAB_140126885;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 0xd;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "db_log_cache";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  if (lVar8 == 0) {
LAB_140126885:
    iVar4 = *(int *)(param_1 + 0x144);
LAB_14012688c:
    *(int *)(param_1 + 0x148) = iVar4;
    plVar14 = local_460;
  }
  else {
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); plVar14 = local_460, lVar12 != lVar8 + 0x58;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar15 == (char *)0x0;
      lVar10 = 0xe;
      pcVar16 = "session_count";
      do {
        if (lVar10 == 0) break;
        lVar10 = lVar10 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar15 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        if (pcVar15 != (char *)0x0) {
          iVar4 = atoi(pcVar15);
          goto LAB_14012688c;
        }
        break;
      }
    }
  }
  do {
    plVar13 = local_460;
    if (plVar14 == (longlong *)0x0) goto joined_r0x000140126917;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 0xd;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "agentmanager";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x000140126917;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 0xd;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "agentmanager";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar13 = local_460;
  }
joined_r0x000140126917:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x000140126997;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 9;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "db_cache";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x000140126997;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 9;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "db_cache";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar14 = local_460;
  }
joined_r0x000140126997:
  do {
    plVar13 = local_460;
    if (plVar14 == (longlong *)0x0) goto joined_r0x000140126a17;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 0xd;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "db_log_cache";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x000140126a17;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 0xd;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "db_log_cache";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar13 = local_460;
  }
joined_r0x000140126a17:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x000140126a97;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 0xb;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "msg_server";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x000140126a97;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 0xb;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "msg_server";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar14 = local_460;
  }
joined_r0x000140126a97:
  do {
    plVar13 = local_460;
    if (plVar14 == (longlong *)0x0) goto joined_r0x000140126b17;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 10;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "gm_server";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x000140126b17;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 10;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "gm_server";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar13 = local_460;
  }
joined_r0x000140126b17:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x000140126b97;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 0xf;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "auction_server";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x000140126b97;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 0xf;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "auction_server";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar14 = local_460;
  }
joined_r0x000140126b97:
  do {
    plVar13 = local_460;
    if (plVar14 == (longlong *)0x0) goto joined_r0x000140126c17;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 0xf;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "manager_server";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x000140126c17;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 0xf;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "manager_server";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar13 = local_460;
  }
joined_r0x000140126c17:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x000140126c97;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 0xd;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "match_server";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x000140126c97;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 0xd;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "match_server";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar14 = local_460;
  }
joined_r0x000140126c97:
  do {
    plVar13 = local_460;
    if (plVar14 == (longlong *)0x0) goto joined_r0x000140126d17;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 0xd;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "agent_server";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x000140126d17;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 0xd;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "agent_server";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar13 = local_460;
  }
joined_r0x000140126d17:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x000140126d97;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 4;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "api";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x000140126d97;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 4;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "api";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    FUN_140127890(param_1,lVar8);
    plVar14 = local_460;
  }
joined_r0x000140126d97:
  do {
    plVar13 = local_460;
    if (plVar14 == (longlong *)0x0) goto joined_r0x000140126e66;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 4;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "dns";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      plVar13 = local_460;
      if (plVar14 == (longlong *)0x0) goto joined_r0x000140126e66;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 4;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "dns";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  plVar13 = local_460;
  if (lVar8 != 0) {
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); lVar12 != lVar8 + 0x58;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar15 == (char *)0x0;
      lVar10 = 4;
      pcVar16 = "dns";
      do {
        if (lVar10 == 0) break;
        lVar10 = lVar10 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar15 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        if (pcVar15 != (char *)0x0) {
          iVar4 = atoi(pcVar15);
          *(bool *)(param_1 + 0x151) = 0 < iVar4;
          plVar13 = local_460;
        }
        break;
      }
    }
  }
joined_r0x000140126e66:
  do {
    plVar14 = local_460;
    if (plVar13 == (longlong *)0x0) goto joined_r0x000140126fa0;
    bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
    lVar8 = 8;
    pcVar15 = (char *)(plVar13[7] + 0x10);
    pcVar16 = "setting";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) break;
    plVar13 = (longlong *)plVar13[10];
  } while( true );
  while (lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13), lVar8 == 0) {
    do {
      plVar13 = (longlong *)plVar13[10];
      plVar14 = local_460;
      if (plVar13 == (longlong *)0x0) goto joined_r0x000140126fa0;
      bVar25 = (char *)(plVar13[7] + 0x10) == (char *)0x0;
      lVar8 = 8;
      pcVar15 = (char *)(plVar13[7] + 0x10);
      pcVar16 = "setting";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar13 + 0x30))(plVar13);
  plVar14 = local_460;
  if (lVar8 != 0) {
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); pcVar15 = pcVar6, lVar12 != lVar8 + 0x58;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar15 == (char *)0x0;
      lVar10 = 6;
      pcVar16 = "multi";
      do {
        if (lVar10 == 0) break;
        lVar10 = lVar10 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar15 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar12 = *(longlong *)(lVar8 + 0xa0); pcVar16 = pcVar6, lVar12 != lVar8 + 0x58;
        lVar12 = *(longlong *)(lVar12 + 0x48)) {
      pcVar16 = (char *)(*(longlong *)(lVar12 + 0x20) + 0x10);
      bVar25 = pcVar16 == (char *)0x0;
      lVar10 = 5;
      pcVar17 = "lock";
      do {
        if (lVar10 == 0) break;
        lVar10 = lVar10 + -1;
        bVar25 = *pcVar16 == *pcVar17;
        pcVar16 = pcVar16 + 1;
        pcVar17 = pcVar17 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar16 = (char *)(*(longlong *)(lVar12 + 0x30) + 0x10);
        break;
      }
    }
    if (pcVar15 != (char *)0x0) {
      iVar4 = atoi(pcVar15);
      *(bool *)(param_1 + 0x166) = 0 < iVar4;
    }
    plVar14 = local_460;
    if (pcVar16 != (char *)0x0) {
      iVar4 = atoi(pcVar16);
      *(double *)(param_1 + 0x168) = (double)iVar4;
      plVar14 = local_460;
    }
  }
joined_r0x000140126fa0:
  do {
    if (plVar14 == (longlong *)0x0) goto LAB_140127133;
    bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
    lVar8 = 5;
    pcVar15 = (char *)(plVar14[7] + 0x10);
    pcVar16 = "auto";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar25 = *pcVar15 == *pcVar16;
      pcVar15 = pcVar15 + 1;
      pcVar16 = pcVar16 + 1;
    } while (bVar25);
    if (bVar25) goto LAB_140126fd6;
    plVar14 = (longlong *)plVar14[10];
  } while( true );
joined_r0x000140127394:
  if (lVar10 == lVar12) goto LAB_1401273d9;
  pcVar18 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
  bVar25 = pcVar18 == (char *)0x0;
  lVar11 = 3;
  pcVar21 = "id";
  do {
    if (lVar11 == 0) break;
    lVar11 = lVar11 + -1;
    bVar25 = *pcVar18 == *pcVar21;
    pcVar18 = pcVar18 + 1;
    pcVar21 = pcVar21 + 1;
  } while (bVar25);
  if (bVar25) {
    pcVar19 = (char *)(*(longlong *)(lVar10 + 0x30) + 0x10);
    goto LAB_1401273d9;
  }
  lVar10 = *(longlong *)(lVar10 + 0x48);
  goto joined_r0x000140127394;
LAB_140126fd6:
  while (lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14), lVar8 == 0) {
    do {
      plVar14 = (longlong *)plVar14[10];
      if (plVar14 == (longlong *)0x0) goto LAB_140127133;
      bVar25 = (char *)(plVar14[7] + 0x10) == (char *)0x0;
      lVar8 = 5;
      pcVar15 = (char *)(plVar14[7] + 0x10);
      pcVar16 = "auto";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
    } while (!bVar25);
  }
  lVar8 = (**(code **)(*plVar14 + 0x30))(plVar14);
  if (lVar8 != 0) {
    lVar12 = lVar8 + 0x58;
    for (lVar10 = *(longlong *)(lVar8 + 0xa0); pcVar15 = pcVar6, lVar10 != lVar12;
        lVar10 = *(longlong *)(lVar10 + 0x48)) {
      pcVar15 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
      bVar25 = pcVar15 == (char *)0x0;
      lVar11 = 0xd;
      pcVar16 = "start_server";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar15 == *pcVar16;
        pcVar15 = pcVar15 + 1;
        pcVar16 = pcVar16 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar15 = (char *)(*(longlong *)(lVar10 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar10 = *(longlong *)(lVar8 + 0xa0); pcVar16 = pcVar6, lVar10 != lVar12;
        lVar10 = *(longlong *)(lVar10 + 0x48)) {
      pcVar16 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
      bVar25 = pcVar16 == (char *)0x0;
      lVar11 = 0xe;
      pcVar17 = "revive_server";
      do {
        if (lVar11 == 0) break;
        lVar11 = lVar11 + -1;
        bVar25 = *pcVar16 == *pcVar17;
        pcVar16 = pcVar16 + 1;
        pcVar17 = pcVar17 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar16 = (char *)(*(longlong *)(lVar10 + 0x30) + 0x10);
        break;
      }
    }
    for (lVar8 = *(longlong *)(lVar8 + 0xa0); lVar8 != lVar12; lVar8 = *(longlong *)(lVar8 + 0x48))
    {
      pcVar17 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
      bVar25 = pcVar17 == (char *)0x0;
      lVar10 = 0xd;
      pcVar19 = "open_channel";
      do {
        if (lVar10 == 0) break;
        lVar10 = lVar10 + -1;
        bVar25 = *pcVar17 == *pcVar19;
        pcVar17 = pcVar17 + 1;
        pcVar19 = pcVar19 + 1;
      } while (bVar25);
      if (bVar25) {
        pcVar6 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
        break;
      }
    }
    if (pcVar15 != (char *)0x0) {
      iVar4 = atoi(pcVar15);
      *(double *)(param_1 + 0x178) = (double)iVar4;
    }
    if (pcVar16 != (char *)0x0) {
      iVar4 = atoi(pcVar16);
      *(bool *)(param_1 + 0x171) = 0 < iVar4;
    }
    if (pcVar6 != (char *)0x0) {
      iVar4 = atoi(pcVar6);
      *(bool *)(param_1 + 0x170) = 0 < iVar4;
    }
  }
LAB_140127133:
  lVar8 = FUN_14000f670(&local_488,"guildlobby");
  if ((lVar8 != 0) && (pcVar6 = (char *)FUN_14000f990(lVar8,"value"), pcVar6 != (char *)0x0)) {
    iVar4 = atoi(pcVar6);
    *(uint *)(param_1 + 0x158) = (uint)(0 < iVar4);
  }
  DAT_140607c17 = 0;
  lVar8 = FUN_14000f670(&local_488,"lua_send");
  if (lVar8 != 0) {
    pcVar6 = (char *)FUN_14000f990(lVar8,&DAT_14049a76c);
    iVar4 = atoi(pcVar6);
    DAT_140607c17 = 0 < iVar4;
  }
  if ((*(int *)(param_1 + 0x154) == 0) && (lVar8 = FUN_14000f670(&local_488,"Option"), lVar8 != 0))
  {
    uVar7 = FUN_14000f670(&local_488,"Option");
    lVar8 = FUN_14000f670(uVar7,"channel");
    while (lVar8 != 0) {
      pcVar6 = (char *)0x0;
      lVar12 = lVar8 + 0x58;
      for (lVar10 = *(longlong *)(lVar8 + 0xa0); pCVar24 = pcVar6, lVar10 != lVar12;
          lVar10 = *(longlong *)(lVar10 + 0x48)) {
        pcVar15 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
        bVar25 = pcVar15 == (char *)0x0;
        lVar11 = 5;
        pcVar16 = "name";
        do {
          if (lVar11 == 0) break;
          lVar11 = lVar11 + -1;
          bVar25 = *pcVar15 == *pcVar16;
          pcVar15 = pcVar15 + 1;
          pcVar16 = pcVar16 + 1;
        } while (bVar25);
        if (bVar25) {
          pCVar24 = (LPCSTR)(*(longlong *)(lVar10 + 0x30) + 0x10);
          break;
        }
      }
      for (lVar10 = *(longlong *)(lVar8 + 0xa0); pcVar15 = pcVar6, lVar10 != lVar12;
          lVar10 = *(longlong *)(lVar10 + 0x48)) {
        pcVar15 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
        bVar25 = pcVar15 == (char *)0x0;
        lVar11 = 7;
        pcVar16 = "minlev";
        do {
          if (lVar11 == 0) break;
          lVar11 = lVar11 + -1;
          bVar25 = *pcVar15 == *pcVar16;
          pcVar15 = pcVar15 + 1;
          pcVar16 = pcVar16 + 1;
        } while (bVar25);
        if (bVar25) {
          pcVar15 = (char *)(*(longlong *)(lVar10 + 0x30) + 0x10);
          break;
        }
      }
      for (lVar10 = *(longlong *)(lVar8 + 0xa0); pcVar16 = pcVar6, lVar10 != lVar12;
          lVar10 = *(longlong *)(lVar10 + 0x48)) {
        pcVar16 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
        bVar25 = pcVar16 == (char *)0x0;
        lVar11 = 7;
        pcVar17 = "maxlev";
        do {
          if (lVar11 == 0) break;
          lVar11 = lVar11 + -1;
          bVar25 = *pcVar16 == *pcVar17;
          pcVar16 = pcVar16 + 1;
          pcVar17 = pcVar17 + 1;
        } while (bVar25);
        if (bVar25) {
          pcVar16 = (char *)(*(longlong *)(lVar10 + 0x30) + 0x10);
          break;
        }
      }
      for (lVar10 = *(longlong *)(lVar8 + 0xa0); lVar10 != lVar12;
          lVar10 = *(longlong *)(lVar10 + 0x48)) {
        pcVar17 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
        bVar25 = pcVar17 == (char *)0x0;
        lVar11 = 6;
        pcVar19 = "group";
        do {
          if (lVar11 == 0) break;
          lVar11 = lVar11 + -1;
          bVar25 = *pcVar17 == *pcVar19;
          pcVar17 = pcVar17 + 1;
          pcVar19 = pcVar19 + 1;
        } while (bVar25);
        if (bVar25) {
          pcVar6 = (char *)(*(longlong *)(lVar10 + 0x30) + 0x10);
          break;
        }
      }
      for (lVar10 = *(longlong *)(lVar8 + 0xa0); lVar10 != lVar12;
          lVar10 = *(longlong *)(lVar10 + 0x48)) {
        pcVar17 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
        bVar25 = pcVar17 == (char *)0x0;
        lVar11 = 5;
        pcVar19 = "type";
        do {
          if (lVar11 == 0) break;
          lVar11 = lVar11 + -1;
          bVar25 = *pcVar17 == *pcVar19;
          pcVar17 = pcVar17 + 1;
          pcVar19 = pcVar19 + 1;
        } while (bVar25);
        if (bVar25) {
          pcVar17 = (char *)(*(longlong *)(lVar10 + 0x30) + 0x10);
          goto LAB_140127356;
        }
      }
      pcVar17 = (char *)0x0;
LAB_140127356:
      pcVar19 = (char *)0x0;
      for (lVar10 = *(longlong *)(lVar8 + 0xa0); lVar10 != lVar12;
          lVar10 = *(longlong *)(lVar10 + 0x48)) {
        pcVar18 = (char *)(*(longlong *)(lVar10 + 0x20) + 0x10);
        bVar25 = pcVar18 == (char *)0x0;
        lVar11 = 3;
        pcVar21 = "id";
        do {
          if (lVar11 == 0) break;
          lVar11 = lVar11 + -1;
          bVar25 = *pcVar18 == *pcVar21;
          pcVar18 = pcVar18 + 1;
          pcVar21 = pcVar21 + 1;
        } while (bVar25);
        if (bVar25) {
          if (*(longlong *)(lVar10 + 0x30) != -0x10) {
            lVar10 = *(longlong *)(lVar8 + 0xa0);
            goto joined_r0x000140127394;
          }
          break;
        }
      }
      pcVar19 = "1";
LAB_1401273d9:
      memset(local_258,0,0x208);
      lVar12 = -1;
      pCVar22 = pCVar24;
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        cVar3 = *pCVar22;
        pCVar22 = pCVar22 + 1;
      } while (cVar3 != '\0');
      MultiByteToWideChar(0,1,pCVar24,~(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;
      pWVar23 = local_258;
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        WVar2 = *pWVar23;
        pWVar23 = pWVar23 + 1;
      } while (WVar2 != L'\0');
      FUN_140001710(&local_3d8,local_258);
      if (pcVar15 != (char *)0x0) {
        iVar4 = atoi(pcVar15);
        local_3b0 = CONCAT44(local_3b0._4_4_,iVar4);
      }
      if (pcVar16 != (char *)0x0) {
        iVar4 = atoi(pcVar16);
        local_3b0 = CONCAT44(iVar4,(undefined4)local_3b0);
      }
      if (pcVar6 != (char *)0x0) {
        iVar4 = atoi(pcVar6);
        local_3a8 = CONCAT44(local_3a8._4_4_,iVar4);
      }
      if (pcVar17 != (char *)0x0) {
        iVar4 = atoi(pcVar17);
        local_3a0 = CONCAT44(local_3a0._4_4_,iVar4);
      }
      if (pcVar19 != (char *)0x0) {
        iVar4 = atoi(pcVar19);
        local_3a8 = CONCAT44(iVar4,(undefined4)local_3a8);
      }
      FUN_140128250(param_1 + 0x188,&local_3d8);
      lVar8 = FUN_14000f750(lVar8);
      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_140001710(&local_3d8,&DAT_14049a7b0,3);
      local_3b0 = 0x6400000001;
      local_3a8 = 0x100000001;
      local_3a0 = CONCAT44(local_3a0._4_4_,1);
      FUN_140128250(param_1 + 0x188,&local_3d8);
      if (7 < local_3c0) {
        operator_delete((void *)CONCAT62(uStack_3d6,local_3d8));
      }
    }
  }
  DAT_140607be2 = 0;
  DAT_140607be3 = 0;
  DAT_140607c15 = 0;
  DAT_1405deafa = 0;
  DAT_1405deafb = 1;
  DAT_1405e0650 = 1;
  lVar8 = FUN_14000f670(&local_488,"develop");
  if (lVar8 != 0) {
    pcVar6 = (char *)FUN_14000f990(lVar8,"preload");
    pcVar15 = (char *)FUN_14000f990(lVar8,"preload_char");
    pcVar16 = (char *)FUN_14000f990(lVar8,"enemy_debug");
    pcVar17 = (char *)FUN_14000f990(lVar8,"enemy_one");
    pcVar19 = (char *)FUN_14000f990(lVar8,"player_debug");
    pcVar18 = (char *)FUN_14000f990(lVar8,"lua_text");
    if (pcVar6 != (char *)0x0) {
      iVar4 = atoi(pcVar6);
      DAT_1405deafb = 0 < iVar4;
    }
    if (pcVar15 != (char *)0x0) {
      iVar4 = atoi(pcVar15);
      DAT_1405e0650 = 0 < iVar4;
    }
    if (pcVar17 != (char *)0x0) {
      iVar4 = atoi(pcVar17);
      DAT_140607be3 = 0 < iVar4;
    }
    if (pcVar16 != (char *)0x0) {
      iVar4 = atoi(pcVar16);
      DAT_140607be2 = 0 < iVar4;
    }
    if (pcVar19 != (char *)0x0) {
      iVar4 = atoi(pcVar19);
      DAT_140607c15 = 0 < iVar4;
    }
    if (pcVar18 != (char *)0x0) {
      iVar4 = atoi(pcVar18);
      DAT_1405deafa = 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_488 = TiXmlDocument::vftable;
  if (local_428 != &DAT_140607be8) {
    operator_delete__(local_420);
  }
  FUN_14000f470(&local_488);
  return 1;
}



void FUN_1401277b0(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_140003e50(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_140127890(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_1405d84f0 ^ (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_140003e50(&local_f0,pcVar10,~uVar8 - 1);
  _Src = (void **)FUN_140415310(&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_140128a60(puVar3 + 2,&local_c8);
          goto LAB_140127be9;
        }
        break;
      }
    }
  }
  local_158 = (void *)0x0;
  local_150 = (undefined4 *)0x0;
  local_148 = 0;
  FUN_140128f50(&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_1400015e0(local_150 + 2,&local_c0,0,0xffffffffffffffff);
    *(undefined8 *)(puVar5 + 0x12) = 7;
    *(undefined8 *)(puVar5 + 0x10) = 0;
    *(undefined2 *)(puVar5 + 0xc) = 0;
    FUN_1400015e0(puVar5 + 0xc,local_98,0,0xffffffffffffffff);
  }
  local_150 = puVar5 + 0x16;
  local_f0 = param_3;
  FUN_140129930(&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_140129660(param_1 + 0x1a8,local_120,&local_68);
  }
  else {
    FUN_140129540(param_1 + 0x1a8,local_108,&local_68,&local_68);
  }
  if (pvVar4 != (void *)0x0) {
    FUN_1401297b0(pvVar4,uVar6);
    operator_delete(pvVar4);
  }
  pvVar4 = local_158;
  if (local_158 != (void *)0x0) {
    FUN_1401297b0(local_158,puVar5 + 0x16);
    operator_delete(pvVar4);
  }
LAB_140127be9:
  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_140127c40(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1401297b0(*(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_140127c80(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_140128a60(puVar2 + 2,param_2);
          return;
        }
        break;
      }
    }
  }
  local_90 = (void *)0x0;
  local_88 = 0;
  local_80 = 0;
  FUN_140128a60(&local_90,param_2);
  FUN_140129930(&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_140129660(plVar1,local_40,local_70);
  }
  else {
    FUN_140129540(plVar1,local_28,local_70,local_70);
  }
  if (pvVar3 != (void *)0x0) {
    FUN_1401297b0(pvVar3,uVar4);
    operator_delete(pvVar3);
  }
  pvVar3 = local_90;
  if (local_90 != (void *)0x0) {
    FUN_1401297b0(local_90,local_88);
    operator_delete(pvVar3);
  }
  return;
}



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

undefined2 * FUN_140127de0(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_1405d84f0 ^ (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_1401240b0(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_140003e50(&local_188,pcVar4,~uVar7 - 1);
      psVar5 = (short *)FUN_140415310(&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_140001710(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_140001710(param_1,pwVar8,uVar12);
  return param_1;
}



undefined8 FUN_140127fe0(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_1405e73f0;
  if (0xf < DAT_1405e7408) {
    puVar3 = DAT_1405e73f0;
  }
  FUN_14000ff80(local_98,puVar3);
  DAT_1405e0652 = 0;
  cVar1 = FUN_140010050(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_140607be8) {
      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_140607be8) {
      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_140128123;
  }
LAB_140128175:
  local_98[0] = TiXmlDocument::vftable;
  if (local_38 != &DAT_140607be8) {
    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_140607be8) {
    operator_delete__(local_58);
  }
  return 1;
LAB_140128123:
  while (lVar2 = (**(code **)(*plVar4 + 0x30))(plVar4), lVar2 == 0) {
    do {
      plVar4 = (longlong *)plVar4[10];
      if (plVar4 == (longlong *)0x0) goto LAB_140128175;
      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_140127890(param_1,lVar2,0xd);
  }
  goto LAB_140128175;
}



void FUN_140128210(longlong *param_1)

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



void FUN_140128250(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_140128bc0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140129830(param_1[1],(param_2 - uVar2 & 0xffffffffffffffc0) + *param_1,param_3,param_4,
                    uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140128bc0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140129830(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x40;
  return;
}



void FUN_1401282f0(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_14000d2c0(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 0x00014012835b. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_14034ff60();
  }
  return;
}



basic_ostream<> * FUN_140128370(basic_ostream<> *param_1)

{
  *(undefined **)param_1 = &DAT_14049ab50;
  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_140128410(longlong param_1,undefined8 param_2)

{
  FUN_140128c50(param_1 + 8);
  return param_2;
}



void FUN_140128440(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 0x0001401284a0. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(param_1);
  return;
}



int FUN_1401284b0(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_1400042e0(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_1401286f0(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_140128740(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_1401287b0(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_14012892e;
    }
    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_14012892e;
    }
  }
  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_140128830:
        param_3 = *(longlong *)_BADOFF_exref;
      }
    }
    else if (param_4 != 0) goto LAB_140128830;
    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_14012892e;
    }
  }
  param_3 = *(longlong *)_BADOFF_exref;
LAB_14012892e:
  *param_2 = param_3;
  param_2[1] = 0;
  *(undefined4 *)(param_2 + 2) = 0;
  return param_2;
}



longlong * FUN_140128950(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;
}



void FUN_140128a60(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_140128f50(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1401298a0(param_1[1],((longlong)(param_2 - uVar2) / 0x58) * 0x58 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140128f50(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1401298a0(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x58;
  return;
}



void * FUN_140128b20(void *param_1,uint param_2)

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



void * FUN_140128b50(longlong param_1,uint param_2)

{
  void *pvVar1;
  
  pvVar1 = (void *)(param_1 + -0x88);
  FUN_140125990(pvVar1);
  if ((param_2 & 1) != 0) {
    operator_delete(pvVar1);
  }
  return pvVar1;
}



void * FUN_140128b90(void *param_1,uint param_2)

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



void FUN_140128bc0(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_140129090(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140129090(param_1,uVar2);
  }
  return;
}



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

void ** FUN_140128c50(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_1405d84f0 ^ (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_140003e50(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_140003e50(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;
}



undefined8 FUN_140128ee0(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_140129300(param_2);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    uVar2 = 1;
    param_1[2] = param_2 * 0x58 + lVar3;
  }
  return uVar2;
}



void FUN_140128f50(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_140129200(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140129200(param_1,uVar2);
  }
  return;
}



void FUN_140129010(longlong *param_1)

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



void FUN_140129050(longlong *param_1)

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



void FUN_140129090(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140129a80(*param_1,param_1[1],local_res10,param_4,uVar5);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_1401291a0();
      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_1401291a0(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_140129200(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_140129300(param_2);
    FUN_140129b30(*param_1,param_1[1],lVar4);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_1401297b0(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_140129300(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_1405d3608);
}



void FUN_140129370(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_1401293d0(longlong *param_1)

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



void FUN_1401293f0(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_140129540(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_1401295a5:
      local_38 = (undefined8 *)0x0;
      local_30 = 0;
      local_40 = param_1;
      FUN_140129d20(&local_40);
      puVar2 = local_38;
      if (local_38 + 1 != (undefined8 *)0x0) {
        *(undefined1 *)(local_38 + 1) = *param_4;
        FUN_140129930(local_38 + 2,param_4 + 8);
      }
      local_30 = CONCAT11(1,(undefined1)local_30);
      cVar3 = FUN_1401299b0(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_1401295a5;
    }
    puVar2 = (undefined8 *)*puVar2;
  } while( true );
}



longlong * FUN_140129660(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_140129d20(&local_30);
  puVar5 = local_28;
  pbVar1 = (byte *)(local_28 + 1);
  local_res8 = pbVar1;
  local_res10 = pbVar1;
  if (pbVar1 != (byte *)0x0) {
    *pbVar1 = *param_3;
    FUN_140129930(local_28 + 2);
  }
  local_20 = CONCAT11(1,(undefined1)local_20);
  bVar4 = *pbVar1;
  if (*param_1 == 0) {
    local_res8 = (byte *)FUN_1402c9710(param_1,1);
    ppbVar2 = (byte **)(param_1 + 1);
    ppbVar7 = &local_res8;
    if (local_res8 <= *ppbVar2) {
      ppbVar7 = ppbVar2;
    }
    *ppbVar2 = *ppbVar7;
    FUN_140346140(param_1);
    FUN_140296160(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_1402c9710(param_1);
      if (lVar6 != param_1[1]) {
        FUN_140129bd0(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_1401297b0(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;
}



undefined2 * FUN_140129830(undefined2 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff);
  *(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 param_1;
}



undefined4 * FUN_1401298a0(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_1400015e0(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_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  return param_1;
}



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

{
  char cVar1;
  undefined8 uVar2;
  
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  cVar1 = FUN_140128ee0(param_1,(param_2[1] - *param_2) / 0x58,param_2[1] - *param_2,param_4,
                        0xfffffffffffffffe);
  if (cVar1 != '\0') {
    uVar2 = FUN_140129e00(*param_2,param_2[1],*param_1);
    param_1[1] = uVar2;
  }
  return param_1;
}



undefined8 FUN_1401299b0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_140129bd0(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140129a20(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_1401297b0(*(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;
}



undefined2 * FUN_140129a80(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_1400015e0(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;
}



longlong FUN_140129b30(longlong param_1,longlong param_2,longlong param_3)

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



void FUN_140129b90(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;
}



void FUN_140129bd0(longlong *param_1,ulonglong param_2)

{
  byte bVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined8 *puVar8;
  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_140346140(&local_40);
  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;
    }
  }
  local_40 = lVar7;
  local_38 = lVar6;
  local_28 = lVar3;
  lVar6 = FUN_1402961d0(param_1);
  param_1[7] = lVar6;
  if (lVar3 != 0) {
    FUN_1401293f0(&local_28);
    lVar7 = local_40;
  }
  if (lVar7 != 0) {
    FUN_1401293f0(&local_40);
  }
  return;
}



void FUN_140129d20(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_1401297b0(*(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_1405d3608);
}



longlong FUN_140129e00(longlong param_1,longlong param_2,longlong param_3)

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



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

{
  longlong lVar1;
  ulonglong uVar2;
  code *pcVar3;
  char cVar4;
  undefined8 *puVar5;
  
  if (param_2 != (undefined8 *)0x0) {
    uVar2 = param_1[3];
    puVar5 = param_1;
    if (0xf < uVar2) {
      puVar5 = (undefined8 *)*param_1;
    }
    if (puVar5 <= param_2) {
      puVar5 = param_1;
      if (0xf < uVar2) {
        puVar5 = (undefined8 *)*param_1;
      }
      if (param_2 < (undefined8 *)((longlong)puVar5 + param_1[2])) {
        puVar5 = param_1;
        if (0xf < uVar2) {
          puVar5 = (undefined8 *)*param_1;
        }
        puVar5 = (undefined8 *)
                 FUN_14012a000(param_1,param_1,(longlong)param_2 - (longlong)puVar5,param_3);
        return puVar5;
      }
    }
  }
  if (param_3 < -param_1[2] - 1) {
    if (param_3 != 0) {
      lVar1 = param_1[2] + param_3;
      cVar4 = FUN_140004130(param_1,lVar1);
      if (cVar4 != '\0') {
        puVar5 = param_1;
        if (0xf < (ulonglong)param_1[3]) {
          puVar5 = (undefined8 *)*param_1;
        }
        memcpy((void *)((longlong)puVar5 + param_1[2]),param_2,param_3);
        param_1[2] = lVar1;
        puVar5 = param_1;
        if (0xf < (ulonglong)param_1[3]) {
          puVar5 = (undefined8 *)*param_1;
        }
        *(undefined1 *)((longlong)puVar5 + lVar1) = 0;
      }
    }
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar3 = (code *)swi(3);
  puVar5 = (undefined8 *)(*pcVar3)();
  return puVar5;
}



undefined8 * FUN_140129f70(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_14012a000(undefined8 *param_1,undefined8 *param_2,ulonglong param_3,ulonglong param_4)

{
  longlong lVar1;
  code *pcVar2;
  char cVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  
  if ((ulonglong)param_2[2] < param_3) {
    std::_Xout_of_range("invalid string position");
    pcVar2 = (code *)swi(3);
    puVar4 = (undefined8 *)(*pcVar2)();
    return puVar4;
  }
  uVar5 = param_2[2] - param_3;
  if (uVar5 < param_4) {
    param_4 = uVar5;
  }
  if (param_4 < -param_1[2] - 1) {
    if (param_4 != 0) {
      lVar1 = param_1[2] + param_4;
      cVar3 = FUN_140004130(param_1,lVar1);
      if (cVar3 != '\0') {
        if (0xf < (ulonglong)param_2[3]) {
          param_2 = (undefined8 *)*param_2;
        }
        puVar4 = param_1;
        if (0xf < (ulonglong)param_1[3]) {
          puVar4 = (undefined8 *)*param_1;
        }
        memcpy((void *)((longlong)puVar4 + param_1[2]),(void *)((longlong)param_2 + param_3),param_4
              );
        param_1[2] = lVar1;
        puVar4 = param_1;
        if (0xf < (ulonglong)param_1[3]) {
          puVar4 = (undefined8 *)*param_1;
        }
        *(undefined1 *)((longlong)puVar4 + lVar1) = 0;
      }
    }
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar2 = (code *)swi(3);
  puVar4 = (undefined8 *)(*pcVar2)();
  return puVar4;
}



void FUN_14012a0e0(undefined8 *param_1)

{
  if ((undefined8 *)*param_1 != param_1 + 1) {
    free((undefined8 *)*param_1);
  }
  return;
}



void FUN_14012a100(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_14000d450(0x80070057);
  }
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  if (param_3 == (void *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  pvVar1 = (void *)*param_1;
  if (pvVar1 == param_3) {
    if (param_2 <= param_4) {
      *param_1 = (longlong)param_3;
      goto LAB_14012a191;
    }
    pvVar1 = calloc((longlong)param_2,2);
  }
  else {
    if (param_2 <= param_4) {
      free(pvVar1);
      *param_1 = (longlong)param_3;
      goto LAB_14012a191;
    }
    pvVar1 = _recalloc(pvVar1,(longlong)param_2,2);
    if (pvVar1 == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  *param_1 = (longlong)pvVar1;
LAB_14012a191:
  if (*param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
  return;
}



void FUN_14012a1b0(void)

{
  DWORD DVar1;
  
  DVar1 = GetLastError();
  if (0 < (int)DVar1) {
    DVar1 = DVar1 & 0xffff | 0x80070000;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(DVar1);
}



void FUN_14012a1d0(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_14012a100(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_14012a100(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_14012a1b0();
      pcVar1 = (code *)swi(3);
      (*pcVar1)();
      return;
    }
  }
  return;
}



undefined8 * FUN_14012a2e0(undefined8 *param_1,byte param_2)

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



void FUN_14012a320(undefined8 *param_1)

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



undefined8 *
FUN_14012a340(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_140003e50(param_1 + 3,"option\\customoption.xml",0x17,param_4,0xfffffffffffffffe);
  FUN_14012a430(param_1);
  return param_1;
}



undefined8 * FUN_14012a3c0(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_140607fe0 = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14012a430(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_14000ff80(local_98,plVar6);
  DAT_1405e0652 = 0;
  cVar1 = FUN_140010050(local_98,local_60 + 2);
  if (cVar1 == '\0') {
    local_98[0] = TiXmlDocument::vftable;
    if (local_38 != &DAT_140607be8) {
      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_140607be8) {
      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_14012a546;
      plVar6 = (longlong *)plVar6[10];
      plVar7 = local_70;
    } while (plVar6 != (longlong *)0x0);
    goto joined_r0x00014012a803;
  }
  goto LAB_14012ac0b;
LAB_14012a546:
  while (lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6), lVar3 == 0) {
    do {
      plVar6 = (longlong *)plVar6[10];
      plVar7 = local_70;
      if (plVar6 == (longlong *)0x0) goto joined_r0x00014012a803;
      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_r0x00014012a5cb;
      }
    }
  }
joined_r0x00014012a803:
  do {
    if (plVar7 == (longlong *)0x0) goto LAB_14012ac0b;
    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_14012a836;
    plVar7 = (longlong *)plVar7[10];
  } while( true );
joined_r0x00014012a5cb:
  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_r0x00014012a62d;
          }
          break;
        }
      }
    }
    goto LAB_14012a7c9;
  }
  goto joined_r0x00014012a803;
  while( true ) {
    lVar4 = lVar4 + -1;
    cVar1 = *pcVar10;
    pcVar10 = pcVar10 + 1;
    if (cVar1 == '\0') break;
code_r0x00014012a62d:
    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_14012a7c9:
  plVar6 = *(longlong **)(lVar3 + 0x50);
  while( true ) {
    plVar7 = local_70;
    if (plVar6 == (longlong *)0x0) goto joined_r0x00014012a803;
    lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
    if (lVar3 != 0) break;
    plVar6 = (longlong *)plVar6[10];
  }
  lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
  goto joined_r0x00014012a5cb;
LAB_14012a836:
  while (lVar3 = (**(code **)(*plVar7 + 0x30))(plVar7), lVar3 == 0) {
    do {
      plVar7 = (longlong *)plVar7[10];
      if (plVar7 == (longlong *)0x0) goto LAB_14012ac0b;
      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_14012ac0b;
            lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
            if (lVar3 != 0) break;
            plVar6 = (longlong *)plVar6[10];
          }
          lVar3 = (**(code **)(*plVar6 + 0x30))(plVar6);
        }
        break;
      }
    }
  }
LAB_14012ac0b:
  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_140607be8) {
    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_140607be8) {
    operator_delete__(local_58);
  }
  return;
}



undefined8 * FUN_14012af00(undefined8 *param_1,byte param_2)

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



void FUN_14012af40(undefined8 *param_1)

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



undefined8 * FUN_14012af60(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  
  FUN_140001f50();
  FUN_140388e70(param_1 + 9);
  *param_1 = MGSAgentSession::vftable;
  param_1[9] = MGSAgentSession::vftable;
  puVar1 = param_1 + 0xd;
  FUN_140385af0(puVar1);
  *puVar1 = SERVER2AGENT_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x7c) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *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_1403c0cc0();
  FUN_14034ec60(param_1 + 0x17,uVar2,1);
  return param_1;
}



void * FUN_14012b040(void *param_1,uint param_2)

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



void FUN_14012b070(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_14034edf0(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_140385b20();
  param_1[9] = RNP::Agent2ServerStub::vftable;
  FUN_140388ea0(param_1 + 9);
  *param_1 = MagiCommonSession::vftable;
  FUN_1400031d0(param_1 + 6);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_14035b3e0(param_1);
  return;
}



void FUN_14012b170(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_14035bff0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_140005600(L"OnError MGSAgentSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar3);
  }
  return;
}



void FUN_14012b210(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_14035bff0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_140005600(L"OnWarning MGSAgentSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar3);
  }
  return;
}



void FUN_14012b2b0(undefined8 param_1,longlong *param_2)

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



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

void FUN_14012b2d0(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_1405d84f0 ^ (ulonglong)auStack_c8;
  local_68 = 7;
  local_70 = 0;
  local_80 = 0;
  local_40 = 7;
  local_48 = 0;
  local_58 = 0;
  if (*(longlong *)(DAT_140608000 + 0x1c8) != 0) {
    auVar3._8_8_ = 0;
    auVar3._0_8_ = *(ulonglong *)(DAT_140608000 + 0x1b0);
    for (puVar1 = *(undefined8 **)
                   (*(longlong *)(DAT_140608000 + 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_1400015e0(&local_80,puVar2 + 1,0,0xffffffffffffffff);
        FUN_1400015e0(&local_58,puVar2 + 6,0,0xffffffffffffffff);
        puVar6 = &local_58;
        if (7 < local_40) {
          puVar6 = (undefined2 *)CONCAT62(uStack_56,local_58);
        }
        FUN_14034fe70();
        local_a8 = PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar6);
        uVar5 = FUN_140002f00(&local_a8,uVar4);
        FUN_14034fd20(uVar5,puVar6,uVar4);
        FUN_140002fe0(&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_1400020c0(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_14012b4a0(longlong param_1)

{
  char cVar1;
  longlong lVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong *plVar5;
  
  DVar3 = GetTickCount();
  lVar2 = DAT_140607fe0;
  *(undefined4 *)(param_1 + 0x40) = 0xd;
  *(undefined1 *)(param_1 + 0x18) = *(undefined1 *)(lVar2 + 0x16);
  plVar5 = (longlong *)FUN_1403c5e60();
  *(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_140608000 + 0x150) != '\0') {
    FUN_14012b2d0(param_1);
    cVar1 = *(char *)(param_1 + 0x88);
    while (cVar1 == '\0') {
      FUN_140002440(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_14012b5a0(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_140608000 + 0x1ec) << 0x20;
    local_10 = *(undefined8 *)(DAT_140608000 + 0x1f0);
    local_res8 = *(undefined4 *)(DAT_140608000 + 0x154);
    (**(code **)(*(longlong *)(param_1 + 0x68) + 0x30))
              ((longlong *)(param_1 + 0x68),1,&DAT_1405d85a0,&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_14035bff0(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_1405d8010)) &&
       (puVar2 + -8 != (undefined *)0x0)) {
      lVar3 = FUN_14034fe70();
      local_20 = lVar3;
      FUN_14034ed40(lVar3);
      local_18 = CONCAT31(local_18._1_3_,1);
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar2 + -8);
      }
      FUN_14034edd0(lVar3);
    }
  }
  return;
}



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

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined *local_res8;
  
  puVar2 = (undefined8 *)FUN_14035bff0(param_2,&local_res8,param_3,param_4,0xfffffffffffffffe);
  FUN_140418da0(DAT_140607fd8,L"Agent Disconnected %s \n",*puVar2);
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (local_res8 + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res8 + -8);
    }
    FUN_14034edd0(uVar3);
  }
  *(undefined2 *)(param_1 + 0x19) = 0;
  *(undefined1 *)(param_1 + 0x1b) = 1;
  *(undefined1 *)(param_1 + 0x88) = 0;
  return;
}



void FUN_14012b7b0(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  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_50 = 0;
    local_48 = DAT_140607bdc;
    local_34 = 1;
    local_33 = *(undefined1 *)(DAT_140608000 + 0x171);
    local_30 = (void *)0x0;
    local_28 = 0;
    local_20 = 0;
    local_4c = param_2;
    local_38 = param_3;
    FUN_14012d140(DAT_140608030,&local_30);
    local_res8[0] = *(undefined4 *)(DAT_140608000 + 0x154);
    (**(code **)(*(longlong *)(param_1 + 0x68) + 0x40))
              ((longlong *)(param_1 + 0x68),1,&DAT_1405d85a0,local_res8,&local_50,&local_30,uVar1);
    if (local_30 != (void *)0x0) {
      operator_delete(local_30);
    }
  }
  return;
}



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

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  int iVar7;
  undefined *local_res8;
  
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_2);
  iVar7 = 0;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_res8 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar7) && (iVar4 = 0, local_res8 != (undefined *)0x0)) &&
     (local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  iVar7 = 1;
  if (1 < iVar4) {
    iVar7 = iVar4;
  }
  iVar4 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  if (iVar4 < iVar7) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_2,iVar3);
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar7 = 0;
  if (0 < iVar3) {
    iVar7 = iVar3;
  }
  iVar3 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar3 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -8);
  }
  if ((iVar3 <= iVar7) && (iVar7 = 0, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_14012b9d7;
    iVar7 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar7;
    *(undefined2 *)(local_res8 + (longlong)iVar7 * 2) = 0;
  }
LAB_14012b9d7:
  (**(code **)(*(longlong *)(param_1 + 0x68) + 0x80))
            ((longlong *)(param_1 + 0x68),1,&DAT_1405d85a0,&local_res8,param_3,param_4);
  puVar6 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    FUN_14034ed40(uVar5);
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_14012ba70(longlong param_1)

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



undefined8 FUN_14012ba80(void)

{
  return 0x84df;
}



undefined8 FUN_14012ba90(void)

{
  return 34000;
}



void FUN_14012baa0(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;
}



undefined8 FUN_14012bb00(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_140055720(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_14012bb70(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_14012baa0(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_14012bb00(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_1402bc5f0(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_14012bcb0(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,0x00014012c070)
// WARNING: Removing unreachable block (ram,0x00014012c077)
// WARNING: Removing unreachable block (ram,0x00014012c090)
// WARNING: Removing unreachable block (ram,0x00014012c09c)
// WARNING: Removing unreachable block (ram,0x00014012c094)
// WARNING: Removing unreachable block (ram,0x00014012c0a2)
// WARNING: Removing unreachable block (ram,0x00014012c0b4)

void FUN_14012bcf0(undefined8 *param_1)

{
  int *piVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined *puVar6;
  undefined4 *puVar7;
  int iVar8;
  undefined4 *puVar9;
  undefined *puVar10;
  undefined4 *puVar11;
  longlong lVar12;
  int iVar13;
  undefined4 *puVar14;
  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;
  undefined8 local_a4;
  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_1405d84f0 ^ (ulonglong)auStack_178;
  (**(code **)(*(longlong *)*param_1 + 0x178))((longlong *)*param_1,0x406e000000000000);
  FUN_14035b460(&local_f8);
  if (*(char *)(DAT_140608000 + 0x151) == '\0') {
    if (local_f0 == (undefined *)0x0) {
      local_f0 = PTR_DAT_1405d8010;
    }
    if ((undefined *)param_1[1] == local_f0) goto LAB_14012bf87;
    uVar4 = FUN_14034fe70();
    local_150 = uVar4;
    FUN_14034ed40(uVar4);
    puVar6 = local_f0;
    local_148 = 1;
    if (((local_f0 != (undefined *)0x0) && (local_f0 != PTR_DAT_1405d8010)) &&
       (puVar10 = local_f0 + -8, puVar10 != (undefined *)0x0)) {
      lVar3 = FUN_14034fe70();
      local_140 = lVar3;
      FUN_14034ed40(lVar3);
      local_138 = 1;
      piVar1 = (int *)(puVar6 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar10);
      }
      FUN_14034edd0(lVar3);
    }
    local_f0 = (undefined *)param_1[1];
    if (((local_f0 != PTR_DAT_1405d8010) && (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_1405d8010;
    }
    if ((undefined *)param_1[1] != local_f8) {
      lVar3 = FUN_14034fe70();
      local_140 = lVar3;
      FUN_14034ed40(lVar3);
      puVar6 = local_f8;
      local_138 = 1;
      if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1405d8010)) &&
         (puVar10 = local_f8 + -8, puVar10 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_150 = uVar4;
        FUN_14034ed40(uVar4);
        local_148 = 1;
        piVar1 = (int *)(puVar6 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar10);
        }
        FUN_14034edd0(uVar4);
      }
      local_f8 = (undefined *)param_1[1];
      if (((local_f8 != PTR_DAT_1405d8010) && (local_f8 != (undefined *)0x0)) &&
         (local_f8 != (undefined *)0x8)) {
        *(int *)(local_f8 + -4) = *(int *)(local_f8 + -4) + 1;
      }
      FUN_14034edd0(lVar3);
    }
    puVar6 = (undefined *)param_1[1];
    if ((undefined *)param_1[1] == (undefined *)0x0) {
      puVar6 = PTR_DAT_1405d8010;
    }
    puVar5 = (undefined8 *)FUN_140127de0(&local_120,puVar6);
    if (7 < (ulonglong)puVar5[3]) {
      puVar5 = (undefined8 *)*puVar5;
    }
    FUN_14000d470(&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_1405d8010;
    }
    param_1[1] = puVar6;
    if (local_f8 == puVar6) goto LAB_14012bf87;
    uVar4 = FUN_14034fe70();
    local_150 = uVar4;
    FUN_14034ed40(uVar4);
    local_148 = 1;
    FUN_1400031d0(param_1 + 1);
    param_1[1] = local_f8;
    if (((local_f8 != PTR_DAT_1405d8010) && (local_f8 != (undefined *)0x0)) &&
       (local_f8 != (undefined *)0x8)) {
      *(int *)(local_f8 + -4) = *(int *)(local_f8 + -4) + 1;
    }
  }
  FUN_14034edd0(uVar4);
LAB_14012bf87:
  local_e8 = *(undefined4 *)(param_1 + 2);
  local_b4 = DAT_140607db8;
  local_b0 = DAT_140607dbc;
  local_ac = DAT_140607dc0;
  local_a8 = DAT_140607dc4;
  local_80 = 0;
  local_9c = 0x80;
  puVar14 = (undefined4 *)0x0;
  local_a4 = 0;
  local_91 = 1;
  iVar13 = *(int *)((longlong)param_1 + 0x14);
  if ((iVar13 < 1) || (*(int *)(param_1 + 3) < 1)) {
    (**(code **)(*(longlong *)*param_1 + 0x180))((longlong *)*param_1,2);
  }
  else {
    local_120 = Proud::CFastArray<int,0>::vftable;
    local_118 = (longlong *)0x0;
    local_fc = 0;
    local_110 = (undefined4 *)0x0;
    local_108 = 0;
    uStack_104 = 0;
    uStack_100 = 0;
    local_b8 = 1;
    puVar9 = puVar14;
    if (iVar13 < *(int *)(param_1 + 3) + iVar13) {
      do {
        iVar8 = (int)puVar9;
        if (iVar8 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        FUN_14012c550(&local_120,iVar8 + 1);
        puVar9 = (undefined4 *)(ulonglong)local_108;
        puVar7 = local_110;
        if (local_108 == 0) {
          puVar7 = puVar14;
        }
        puVar7[iVar8] = iVar13;
        iVar13 = iVar13 + 1;
      } while (iVar13 < *(int *)(param_1 + 3) + *(int *)((longlong)param_1 + 0x14));
      if ((int)local_108 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
    puVar7 = local_110;
    plVar2 = local_118;
    iVar13 = (int)puVar9;
    FUN_14012c550(&local_e0,puVar9);
    puVar9 = local_d0;
    if (local_c8 == 0) {
      puVar9 = puVar14;
    }
    puVar11 = puVar7;
    if (iVar13 == 0) {
      puVar11 = puVar14;
    }
    lVar3 = (longlong)iVar13;
    if (0 < iVar13) {
      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_14034ff60(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_1405d8010;
  }
  FUN_1400050f0(L"Server Start : ADDRESS[%s] PORT[%d]",puVar6,local_e8);
  lVar3 = local_158;
  if (local_158 != 0) {
    local_140 = local_158;
    FUN_14034ed40(local_158);
    local_138 = 1;
    *(longlong *)(local_158 + 0x40) = *(longlong *)(local_158 + 0x40) + -1;
    if (*(longlong *)(local_158 + 0x40) == 0) {
      FUN_14034edd0(lVar3);
      lVar3 = local_158;
      local_138 = 0;
      FUN_14012c760(local_158);
      FUN_14034ff60(lVar3);
    }
    else {
      FUN_14034edd0(lVar3);
    }
  }
  local_70 = Proud::CFastArray<int,0>::vftable;
  if (local_60 != 0) {
    if (local_68 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    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_14034ff60();
    }
    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_1405d8010)) &&
     (puVar10 = local_f8 + -8, puVar10 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    local_150 = uVar4;
    FUN_14034ed40(uVar4);
    local_148 = 1;
    piVar1 = (int *)(puVar6 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar10);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_14012c340(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_14034ff60();
    }
    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_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,*(longlong *)(param_1 + 0x28));
    }
  }
  FUN_1400031d0(param_1 + 8);
  FUN_1400031d0(param_1);
  return;
}



void FUN_14012c3e0(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_14012c550(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_14034f7d0();
}



void FUN_14012c460(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_14012c550(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_14012c6a0(param_1);
        lVar3 = FUN_14012c6a0(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_14012c6a0(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_14034f7d0();
}



void FUN_14012c550(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_14012c6b0();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_14034fef0(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_14034fef0(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_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_14034ff60(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined4 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



undefined8 FUN_14012c6a0(longlong param_1)

{
  if (*(int *)(param_1 + 0x18) == 0) {
    return 0;
  }
  return *(undefined8 *)(param_1 + 0x10);
}



int FUN_14012c6b0(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_14034f7d0();
    }
    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_14034ff60(LPVOID param_1)

{
  HANDLE hHeap;
  
  hHeap = GetProcessHeap();
                    // WARNING: Could not recover jumptable at 0x00014034ff7c. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapFree(hHeap,0,param_1);
  return;
}



void FUN_14012c760(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (lVar1 != 0) {
    FUN_1400031d0(lVar1 + 0x58);
    FUN_1403555d0(lVar1 + 0x28);
    FUN_1400031d0(lVar1 + 0x10);
    FUN_14034ff60(lVar1);
  }
  FUN_14034edf0(param_1);
  return;
}



void FUN_14012c7d0(undefined8 param_1)

{
  FUN_14012c760();
  FUN_14034ff60(param_1);
  return;
}



void FUN_14012c7f0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_14034ed40(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_14034edd0(lVar1);
      lVar1 = *param_1;
      FUN_14012c760(lVar1);
      FUN_14034ff60(lVar1);
    }
    else {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



longlong * FUN_14012c880(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_14034fef0(0x48);
    if (lVar2 != 0) {
      uVar1 = FUN_1403c0cc0();
      FUN_14034ec60(lVar2,uVar1,1,param_4,uVar3);
    }
    *param_1 = lVar2;
    FUN_14034ed40(lVar2);
    *(undefined8 *)(*param_1 + 0x40) = 1;
    *(longlong *)(*param_1 + 0x38) = param_2;
    FUN_14034edd0(lVar2);
  }
  return param_1;
}



undefined8 * FUN_14012c920(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_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14012c980(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 0x00014012c9a7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 * FUN_14012c9c0(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_140608028 = puVar5;
  if (puVar2 != (undefined8 *)0x0) {
    *puVar2 = MagiServerFile::vftable;
    puVar2[1] = 0;
    puVar2[2] = 0;
    puVar2[3] = 0;
    DAT_140608028 = puVar2;
  }
  pvVar3 = operator_new(0x1f8);
  puVar2 = puVar5;
  if (pvVar3 != (void *)0x0) {
    puVar2 = (undefined8 *)FUN_140124120(pvVar3);
  }
  DAT_140608000 = puVar2;
  pvVar3 = operator_new(0x50);
  puVar2 = puVar5;
  if (pvVar3 != (void *)0x0) {
    puVar2 = (undefined8 *)FUN_14012a340(pvVar3);
  }
  DAT_140607fe0 = puVar2;
  puVar4 = operator_new(0x80);
  puVar2 = puVar5;
  if (puVar4 != (undefined8 *)0x0) {
    *puVar4 = MagiRealTimeEventData::vftable;
    FUN_1402ca220(puVar4 + 1);
    uVar1 = FUN_1403c0cc0();
    FUN_14034ec60(puVar4 + 9,uVar1,1);
    puVar2 = puVar4;
  }
  DAT_140608030 = 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_1402ca220(puVar2 + 7);
    puVar5 = puVar2;
  }
  DAT_140608038 = puVar5;
  return param_1;
}



void * FUN_14012cb30(void *param_1,uint param_2)

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



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

{
  *param_1 = MagiAgentCommon::vftable;
  if (DAT_140608038 != (undefined8 *)0x0) {
    (**(code **)*DAT_140608038)(DAT_140608038,1,param_3,param_4,0xfffffffffffffffe);
  }
  if (DAT_140608000 != (undefined8 *)0x0) {
    (**(code **)*DAT_140608000)(DAT_140608000,1);
  }
  if (DAT_140607fe0 != (undefined8 *)0x0) {
    (**(code **)*DAT_140607fe0)(DAT_140607fe0,1);
  }
  if (DAT_140608030 != (undefined8 *)0x0) {
    (**(code **)*DAT_140608030)(DAT_140608030,1);
  }
  if (DAT_140608028 != (undefined8 *)0x0) {
    (**(code **)*DAT_140608028)(DAT_140608028,1);
  }
  *param_1 = MBISingleton<>::vftable;
  DAT_140608008 = 0;
  return;
}



undefined8 * FUN_14012cc10(undefined8 *param_1,byte param_2)

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



void FUN_14012cc50(undefined8 *param_1)

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



void FUN_14012cc70(undefined8 *param_1)

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



void FUN_14012cc80(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_140608000 + 0x171) == '\0';
  *(bool *)(DAT_140608000 + 0x171) = bVar1;
  if (!bVar1) {
                    // WARNING: Could not recover jumptable at 0x00014012cce2. Too many branches
                    // WARNING: Treating indirect jump as call
    printf("Auto Revive Off !!!\n");
    return;
  }
                    // WARNING: Could not recover jumptable at 0x00014012ccd4. Too many branches
                    // WARNING: Treating indirect jump as call
  printf("Auto Revive On !!!\n");
  return;
}



undefined8 * FUN_14012cd40(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiServerFile::vftable;
  if (param_1[1] != 0) {
    FUN_14012cdc0(param_1[1],param_1[2]);
    operator_delete((void *)param_1[1]);
  }
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *param_1 = MBISingleton<>::vftable;
  DAT_140608028 = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14012cdc0(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 + 2;
      puVar2 = puVar2 + 6;
    } while (puVar1 != param_2);
  }
  return;
}



undefined8 * FUN_14012ce20(undefined8 *param_1,byte param_2)

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



undefined8 * FUN_14012ce60(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiRealTimeEventData::vftable;
  FUN_14034edf0(param_1 + 9);
  if (param_1[1] != 0) {
    FUN_14012e3f0();
  }
  *param_1 = MBISingleton<>::vftable;
  DAT_140608030 = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14012cee0(longlong param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  void *_Dst;
  undefined8 uVar2;
  longlong lVar3;
  undefined1 uVar4;
  undefined1 local_150 [24];
  undefined1 local_138 [32];
  undefined4 local_118;
  undefined1 local_114 [268];
  
  uVar2 = 0xfffffffffffffffe;
  _Dst = (void *)FUN_14012d0a0(param_1,*param_2,param_3,param_4,0xfffffffffffffffe);
  lVar1 = param_1 + 0x48;
  lVar3 = lVar1;
  FUN_14034ed40(lVar1);
  uVar4 = 1;
  if (_Dst == (void *)0x0) {
    local_118 = *param_2;
    memcpy(local_114,param_2,0x108);
    if (*(longlong *)(param_1 + 0x28) == 0) {
      FUN_14012d3b0(param_1 + 8,local_138,&local_118);
    }
    else {
      FUN_14012d210(param_1 + 8,local_150,&local_118,&local_118,uVar2,lVar3,uVar4);
    }
  }
  else {
    memcpy(_Dst,param_2,0x108);
  }
  FUN_14034edd0(lVar1);
  return;
}



void FUN_14012cfa0(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong *plVar6;
  longlong *local_18;
  
  FUN_14034ed40();
  if (*(longlong *)(param_1 + 0x28) != 0) {
    uVar5 = (ulonglong)(longlong)param_2 % *(ulonglong *)(param_1 + 0x10);
    local_18 = (longlong *)(*(longlong *)(param_1 + 8) + uVar5 * 8);
    for (plVar4 = *(longlong **)(*(longlong *)(param_1 + 8) + uVar5 * 8); plVar4 != (longlong *)0x0;
        plVar4 = (longlong *)*plVar4) {
      if (param_2 == (int)plVar4[1]) {
        if (plVar4 != (longlong *)0x0) goto LAB_14012cffe;
        break;
      }
    }
  }
  plVar4 = (longlong *)0x0;
  local_18 = (longlong *)0x0;
LAB_14012cffe:
  if (plVar4 != (longlong *)0x0) {
    lVar1 = *plVar4;
    plVar6 = local_18;
    while (lVar1 == 0) {
      plVar6 = plVar6 + 1;
      lVar1 = *plVar6;
    }
    *(longlong *)(param_1 + 0x28) = *(longlong *)(param_1 + 0x28) + -1;
    plVar2 = (longlong *)*local_18;
    plVar3 = local_18;
    while (plVar2 != plVar4) {
      plVar3 = (longlong *)*plVar3;
      plVar2 = (longlong *)*plVar3;
    }
    *plVar3 = *plVar4;
    operator_delete(plVar4);
    if ((local_18 == *(longlong **)(param_1 + 0x38)) && (*local_18 == 0)) {
      *(longlong **)(param_1 + 0x38) = plVar6;
    }
  }
  FUN_14034edd0(param_1 + 0x48);
  return;
}



longlong FUN_14012d0a0(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined8 *puVar2;
  
  lVar1 = param_1 + 0x48;
  FUN_14034ed40(lVar1);
  if (*(longlong *)(param_1 + 0x28) != 0) {
    for (puVar2 = *(undefined8 **)
                   (*(longlong *)(param_1 + 8) +
                   ((ulonglong)(longlong)param_2 % *(ulonglong *)(param_1 + 0x10)) * 8);
        puVar2 != (undefined8 *)0x0; puVar2 = (undefined8 *)*puVar2) {
      if (param_2 == *(int *)(puVar2 + 1)) {
        if (puVar2 != (undefined8 *)0x0) {
          FUN_14034edd0(lVar1);
          return (longlong)puVar2 + 0xc;
        }
        break;
      }
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



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

{
  longlong lVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined1 uVar8;
  
  uVar4 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x48;
  lVar7 = lVar1;
  FUN_14034ed40(lVar1);
  uVar8 = 1;
  if (*(longlong *)(param_1 + 0x28) == 0) {
    puVar5 = (undefined8 *)0x0;
  }
  else {
    puVar5 = *(undefined8 **)(param_1 + 0x38);
    if (puVar5 != (undefined8 *)0x0) {
      puVar6 = (undefined8 *)*puVar5;
      puVar3 = puVar5;
      puVar2 = puVar6;
      goto joined_r0x00014012d1b8;
    }
  }
  puVar6 = (undefined8 *)0x0;
  puVar3 = puVar5;
  puVar2 = puVar6;
joined_r0x00014012d1b8:
  while (puVar2 != (undefined8 *)0x0) {
    FUN_14012e5c0(param_2,(longlong)puVar2 + 0xc,param_3,param_4,uVar4,puVar5,puVar6,lVar7,uVar8);
    puVar2 = (undefined8 *)*puVar2;
    while (puVar2 == (undefined8 *)0x0) {
      puVar3 = puVar3 + 1;
      puVar2 = (undefined8 *)*puVar3;
    }
    if (puVar3 == puVar2) {
      puVar2 = (undefined8 *)0x0;
    }
  }
  FUN_14034edd0(lVar1);
  return;
}



longlong * FUN_14012d210(longlong *param_1,longlong *param_2,int *param_3,undefined4 *param_4)

{
  int iVar1;
  char cVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  char *local_res8;
  undefined **local_160 [3];
  undefined8 local_148;
  undefined8 local_138 [36];
  
  local_148 = 0xfffffffffffffffe;
  iVar1 = *param_3;
  puVar5 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar1 % (ulonglong)param_1[1]) * 8);
  puVar3 = (undefined8 *)*puVar5;
  do {
    if (puVar3 == (undefined8 *)0x0) {
LAB_14012d284:
      puVar3 = operator_new(0x118);
      if (puVar3 != (undefined8 *)0x0) {
        local_138[0] = 0;
        memcpy(puVar3,local_138,0x118);
        if (puVar3 + 1 != (undefined8 *)0x0) {
          *(undefined4 *)(puVar3 + 1) = *param_4;
          memcpy((void *)((longlong)puVar3 + 0xc),param_4 + 1,0x108);
        }
        cVar2 = FUN_14027dc40(param_1);
        if (cVar2 != '\0') {
          puVar5 = (undefined8 *)
                   (*param_1 + ((ulonglong)(longlong)iVar1 % (ulonglong)param_1[1]) * 8);
        }
        *puVar3 = *puVar5;
        *puVar5 = puVar3;
        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)puVar3;
        *(undefined1 *)(param_2 + 2) = 1;
        return param_2;
      }
      local_res8 = (char *)0x0;
      std::exception::exception((exception *)local_160,&local_res8);
      local_160[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_160,(ThrowInfo *)&DAT_1405d3608);
    }
    if (iVar1 == *(int *)(puVar3 + 1)) {
      if (puVar3 != (undefined8 *)0x0) {
        *param_2 = (longlong)puVar5;
        param_2[1] = (longlong)puVar3;
        *(undefined1 *)(param_2 + 2) = 0;
        return param_2;
      }
      goto LAB_14012d284;
    }
    puVar3 = (undefined8 *)*puVar3;
  } while( true );
}



longlong * FUN_14012d3b0(longlong *param_1,longlong *param_2,int *param_3)

{
  int *piVar1;
  char **ppcVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 *_Dst;
  longlong lVar5;
  char **ppcVar6;
  char *local_res8;
  undefined **local_160 [3];
  undefined8 local_148;
  undefined8 local_138 [36];
  
  local_148 = 0xfffffffffffffffe;
  _Dst = operator_new(0x118);
  if (_Dst != (undefined8 *)0x0) {
    local_138[0] = 0;
    memcpy(_Dst,local_138,0x118);
    piVar1 = (int *)(_Dst + 1);
    if (piVar1 != (int *)0x0) {
      *piVar1 = *param_3;
      memcpy((void *)((longlong)_Dst + 0xc),param_3 + 1,0x108);
    }
    iVar4 = *piVar1;
    if (*param_1 == 0) {
      local_res8 = (char *)FUN_1402c9710(param_1,1);
      ppcVar2 = (char **)(param_1 + 1);
      ppcVar6 = &local_res8;
      if (local_res8 <= *ppcVar2) {
        ppcVar6 = ppcVar2;
      }
      *ppcVar2 = *ppcVar6;
      FUN_140346140(param_1);
      FUN_140296160(param_1);
    }
    else if ((ulonglong)param_1[7] < 2) {
      local_res8 = (char *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      lVar5 = FUN_1402c9710(param_1);
      if (lVar5 != param_1[1]) {
        FUN_14027dcb0(param_1);
      }
    }
    puVar3 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar4 % (ulonglong)param_1[1]) * 8);
    *_Dst = *puVar3;
    *puVar3 = _Dst;
    param_1[4] = param_1[4] + 1;
    param_1[6] = (longlong)puVar3;
    *param_2 = (longlong)puVar3;
    param_2[1] = (longlong)_Dst;
    *(undefined1 *)(param_2 + 2) = 1;
    return param_2;
  }
  local_res8 = (char *)0x0;
  std::exception::exception((exception *)local_160,&local_res8);
  local_160[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_160,(ThrowInfo *)&DAT_1405d3608);
}



undefined8 * FUN_14012d580(undefined8 *param_1,byte param_2)

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



void FUN_14012d5c0(undefined8 *param_1)

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



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

undefined8 FUN_14012d5e0(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_1405d84f0 ^ (ulonglong)auStack_158;
  lVar1 = param_4[1];
  lVar2 = *param_4;
  if (lVar2 == lVar1) {
    *(undefined1 *)(param_1 + 0x40) = 1;
  }
  else {
    do {
      FUN_14012da60(local_c8,lVar2);
      if (*(int *)(DAT_140608000 + 0x154) == local_c4) {
        FUN_140124840(DAT_140608000,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_1400015e0(&local_f8,&local_a0,0,0xffffffffffffffff);
        FUN_140127c80(DAT_140608000,&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_14012d7c0(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_14012d7f0(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_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x10))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1);
  }
  return 1;
}



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

{
  undefined4 local_res8 [2];
  
  local_res8[0] = *param_4;
  FUN_14034ed40(param_1 + 0x70);
  FUN_14012e5c0(param_1 + 0x50,local_res8);
  FUN_14034edd0(param_1 + 0x70);
  return 1;
}



undefined8
FUN_14012d890(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_14012d8d0(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_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x40))(*(longlong **)(param_1 + 0x48),puVar1);
  }
  return 1;
}



undefined8
FUN_14012d900(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_14012d930(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_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x50))(*(longlong **)(param_1 + 0x48),puVar1);
  }
  return 1;
}



undefined8
FUN_14012d960(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_14012d9d0(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_14012da60(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_1400015e0(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_1400015e0(param_1 + 0x14,param_2 + 0x14,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x24) = 7;
  *(undefined8 *)(param_1 + 0x22) = 0;
  *(undefined2 *)(param_1 + 0x1e) = 0;
  FUN_1400015e0(param_1 + 0x1e,param_2 + 0x1e,0,0xffffffffffffffff);
  return param_1;
}



undefined8
FUN_14012db40(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_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x58))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1);
  }
  return 1;
}



undefined8
FUN_14012db80(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_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x60))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1);
  }
  return 1;
}



undefined8
FUN_14012dbc0(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_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x68))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1);
  }
  return 1;
}



undefined8
FUN_14012dc00(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_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x70))
              (*(longlong **)(param_1 + 0x48),*param_4,puVar1,*param_6,*param_7);
  }
  return 1;
}



undefined8
FUN_14012dc50(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_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x78))
              (*(longlong **)(param_1 + 0x48),*param_4,*param_5,*param_6,puVar1);
  }
  return 1;
}



undefined8 * FUN_14012dca0(undefined8 *param_1,uint param_2)

{
  *param_1 = MagiServerManager::vftable;
  if (param_1[7] != 0) {
    FUN_14012e3f0();
  }
  FUN_14012e060(param_1 + 1);
  DAT_140608038 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14012dd10(longlong *param_1)

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



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

{
  ulonglong uVar1;
  ulonglong uVar2;
  
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_14012de40(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    if (param_1[1] != 0) {
      FUN_14012da60(param_1[1],((longlong)(param_2 - uVar2) / 0xa0) * 0xa0 + *param_1);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14012de40(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    if (param_1[1] != 0) {
      FUN_14012da60(param_1[1],param_2);
    }
  }
  param_1[1] = param_1[1] + 0xa0;
  return;
}



void FUN_14012de40(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_14012def0(param_1,uVar2);
  }
  return;
}



void FUN_14012def0(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_1405d3608);
    }
    pcVar3 = local_res10;
    FUN_14012e480(*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_14012d9d0(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_14012e060(undefined8 *param_1)

{
  undefined8 *puVar1;
  ulonglong uVar2;
  undefined8 *puVar3;
  longlong lVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  undefined8 *local_58;
  longlong lStack_50;
  
  if (param_1[1] != 0) {
    uVar2 = param_1[3];
    puVar9 = (undefined8 *)*param_1;
    uVar5 = uVar2;
    uVar7 = 8;
    do {
      uVar6 = uVar7;
      uVar7 = uVar5 % uVar6;
      uVar5 = uVar6;
    } while (uVar7 != 0);
    local_58 = (undefined8 *)param_1[1];
    lStack_50 = param_1[2];
    do {
      puVar3 = *(undefined8 **)(lStack_50 + -0x10 + (longlong)local_58);
      lVar4 = *(longlong *)(lStack_50 + -8 + (longlong)local_58);
      puVar1 = (undefined8 *)(lStack_50 + -0x10 + (longlong)local_58);
      if (local_58 != puVar1) {
        puVar8 = local_58 + 0x1b;
        do {
          if (puVar8 + -0x1b == puVar9) {
            puVar9 = (undefined8 *)*puVar9;
          }
          else {
            if ((void *)*puVar8 != (void *)0x0) {
              operator_delete((void *)*puVar8);
            }
            *puVar8 = 0;
            puVar8[1] = 0;
            puVar8[2] = 0;
            FUN_14012d9d0(puVar8 + -0x1b);
          }
          puVar8 = puVar8 + uVar2 / uVar6;
        } while (puVar8 + -0x1b != puVar1);
      }
      operator_delete__(local_58);
      local_58 = puVar3;
      lStack_50 = lVar4;
    } while (puVar3 != (undefined8 *)0x0);
    param_1[1] = 0;
  }
  FUN_14012e360(param_1);
  return;
}



void FUN_14012e1e0(undefined8 *param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  longlong lVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  ulonglong uVar8;
  longlong lVar9;
  longlong lVar10;
  ulonglong uVar11;
  
  uVar11 = param_1[3];
  uVar8 = 8;
  do {
    uVar5 = uVar8;
    uVar8 = uVar11 % uVar5;
    uVar11 = uVar5;
  } while (uVar8 != 0);
  uVar5 = (ulonglong)param_1[3] / uVar5;
  uVar11 = uVar5 * 8;
  lVar9 = param_1[4] * uVar11;
  lVar10 = lVar9 + 0x10;
  puVar6 = (undefined8 *)thunk_FUN_1403fbcdc(lVar10);
  if (puVar6 != (undefined8 *)0x0) {
    param_1[4] = param_1[4] << 1;
    puVar7 = (undefined8 *)((((lVar10 + uVar5 * -8) - 0x10) / uVar11) * uVar11 + (longlong)puVar6);
    *puVar7 = *param_1;
    if (puVar7 != puVar6) {
      for (puVar2 = puVar7 + -uVar5; puVar2 != puVar6; puVar2 = puVar2 + -uVar5) {
        *puVar2 = puVar7;
        puVar7 = puVar2;
      }
      *puVar6 = puVar7;
    }
    puVar7 = (undefined8 *)param_1[1];
    *param_1 = puVar6;
    if ((puVar7 == (undefined8 *)0x0) || (puVar6 < puVar7)) {
      *(undefined8 **)((longlong)puVar6 + lVar9) = puVar7;
      *(undefined8 *)((longlong)puVar6 + lVar9 + 8) = param_1[2];
      param_1[1] = puVar6;
      param_1[2] = lVar10;
    }
    else {
      lVar3 = param_1[2];
      lVar1 = *(longlong *)(lVar3 + -0x10 + (longlong)param_1[1]);
      puVar7 = (undefined8 *)param_1[1];
      while ((lVar1 != 0 &&
             (puVar2 = *(undefined8 **)(lVar3 + -0x10 + (longlong)puVar7), puVar2 <= puVar6))) {
        lVar3 = *(longlong *)(lVar3 + -8 + (longlong)puVar7);
        lVar1 = *(longlong *)(lVar3 + -0x10 + (longlong)puVar2);
        puVar7 = puVar2;
      }
      uVar4 = *(undefined8 *)(lVar3 + -8 + (longlong)puVar7);
      *(undefined8 *)((longlong)puVar6 + lVar9) = *(undefined8 *)(lVar3 + -0x10 + (longlong)puVar7);
      *(undefined8 *)((longlong)puVar6 + lVar9 + 8) = uVar4;
      *(undefined8 **)(lVar3 + -0x10 + (longlong)puVar7) = puVar6;
      *(longlong *)(lVar3 + -8 + (longlong)puVar7) = lVar10;
    }
    *param_1 = *(undefined8 *)*param_1;
    return;
  }
  return;
}



ulonglong FUN_14012e360(undefined8 *param_1)

{
  void *pvVar1;
  ulonglong in_RAX;
  void *local_28;
  longlong lStack_20;
  
  lStack_20 = param_1[2];
  local_28 = (void *)param_1[1];
  if ((void *)param_1[1] != (void *)0x0) {
    do {
      pvVar1 = *(void **)(lStack_20 + -0x10 + (longlong)local_28);
      lStack_20 = *(longlong *)(lStack_20 + -8 + (longlong)local_28);
      operator_delete__(local_28);
      local_28 = pvVar1;
    } while (pvVar1 != (void *)0x0);
    param_1[1] = 0;
    *param_1 = 0;
    param_1[4] = param_1[5];
    return CONCAT71((int7)((ulonglong)param_1[5] >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



void FUN_14012e3f0(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;
}



longlong FUN_14012e480(longlong param_1,longlong param_2,longlong param_3)

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



undefined4 * FUN_14012e4e0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 1) {
    if (param_3 != (undefined4 *)0x0) {
      *param_3 = *param_1;
    }
    param_3 = param_3 + 1;
  }
  return param_3;
}



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

{
  char cVar1;
  undefined8 uVar2;
  
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  cVar1 = FUN_14012bb00(param_1,param_2[1] - *param_2 >> 2,param_3,param_4,0xfffffffffffffffe);
  if (cVar1 != '\0') {
    uVar2 = FUN_14012e4e0(*param_2,param_2[1],*param_1);
    param_1[1] = uVar2;
  }
  return param_1;
}



undefined8 * FUN_14012e580(undefined8 *param_1,byte param_2)

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



void FUN_14012e5c0(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_1400556a0(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_1400556a0(param_1,1);
    }
    if ((undefined4 *)param_1[1] != (undefined4 *)0x0) {
      *(undefined4 *)param_1[1] = *param_2;
    }
  }
  param_1[1] = param_1[1] + 4;
  return;
}



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

{
  code *pcVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  
  if (param_4 != (undefined8 *)0x0) {
    uVar4 = param_1[3];
    puVar2 = param_1;
    if (7 < uVar4) {
      puVar2 = (undefined8 *)*param_1;
    }
    if (puVar2 <= param_4) {
      puVar2 = param_1;
      if (7 < uVar4) {
        puVar2 = (undefined8 *)*param_1;
      }
      if (param_4 < (undefined8 *)((longlong)puVar2 + param_1[2] * 2)) {
        puVar2 = param_1;
        if (7 < uVar4) {
          puVar2 = (undefined8 *)*param_1;
        }
        puVar2 = (undefined8 *)
                 FUN_14012e940(param_1,param_2,param_3,param_1,
                               (longlong)param_4 - (longlong)puVar2 >> 1,param_5);
        return puVar2;
      }
    }
  }
  uVar4 = param_1[2];
  if (uVar4 < param_2) {
    std::_Xout_of_range("invalid string position");
    pcVar1 = (code *)swi(3);
    puVar2 = (undefined8 *)(*pcVar1)();
    return puVar2;
  }
  uVar5 = uVar4 - param_2;
  if (uVar5 < param_3) {
    param_3 = uVar5;
  }
  if (uVar4 - param_3 < -param_5 - 1) {
    if (param_5 < param_3) {
      puVar3 = param_1;
      puVar2 = param_1;
      if (7 < (ulonglong)param_1[3]) {
        puVar3 = (undefined8 *)*param_1;
        puVar2 = (undefined8 *)*param_1;
      }
      memmove((void *)((longlong)puVar3 + (param_2 + param_5) * 2),
              (void *)((longlong)puVar2 + (param_2 + param_3) * 2),(uVar5 - param_3) * 2);
    }
    if ((param_5 != 0) || (param_3 != 0)) {
      uVar4 = (param_1[2] - param_3) + param_5;
      if (0x7ffffffffffffffe < uVar4) {
        std::_Xlength_error("string too long");
        pcVar1 = (code *)swi(3);
        puVar2 = (undefined8 *)(*pcVar1)();
        return puVar2;
      }
      if ((ulonglong)param_1[3] < uVar4) {
        FUN_1400019f0(param_1,uVar4);
        if (uVar4 == 0) {
          return param_1;
        }
      }
      else if (uVar4 == 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 (param_3 < param_5) {
        puVar3 = param_1;
        puVar2 = param_1;
        if (7 < (ulonglong)param_1[3]) {
          puVar3 = (undefined8 *)*param_1;
          puVar2 = (undefined8 *)*param_1;
        }
        memmove((void *)((longlong)puVar3 + (param_2 + param_5) * 2),
                (void *)((longlong)puVar2 + (param_2 + param_3) * 2),(uVar5 - param_3) * 2);
      }
      puVar2 = param_1;
      if (7 < (ulonglong)param_1[3]) {
        puVar2 = (undefined8 *)*param_1;
      }
      memcpy((void *)((longlong)puVar2 + param_2 * 2),param_4,param_5 * 2);
      param_1[2] = uVar4;
      puVar2 = param_1;
      if (7 < (ulonglong)param_1[3]) {
        puVar2 = (undefined8 *)*param_1;
      }
      *(undefined2 *)((longlong)puVar2 + uVar4 * 2) = 0;
    }
    return param_1;
  }
  std::_Xlength_error("string too long");
  pcVar1 = (code *)swi(3);
  puVar2 = (undefined8 *)(*pcVar1)();
  return puVar2;
}



undefined * FUN_14012e890(void)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  DAT_140607dd8 = 0;
  pvVar1 = operator_new(0x30);
  if (pvVar1 != (void *)0x0) {
    DAT_140607dd0 = pvVar1;
    *(void **)pvVar1 = pvVar1;
    *(void **)((longlong)DAT_140607dd0 + 8) = DAT_140607dd0;
    *(void **)((longlong)DAT_140607dd0 + 0x10) = DAT_140607dd0;
    *(undefined1 *)((longlong)DAT_140607dd0 + 0x28) = 1;
    *(undefined1 *)((longlong)DAT_140607dd0 + 0x29) = 1;
    return &DAT_140607dc8;
  }
  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_1405d3608);
}



void FUN_14012e930(void)

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



longlong *
FUN_14012e940(longlong *param_1,ulonglong param_2,ulonglong param_3,longlong *param_4,
             ulonglong param_5,ulonglong param_6)

{
  ulonglong uVar1;
  code *pcVar2;
  ulonglong uVar3;
  longlong *plVar4;
  longlong *plVar5;
  void *_Dst;
  void *_Src;
  size_t _Size;
  ulonglong uVar6;
  longlong lVar7;
  
  uVar1 = param_1[2];
  if ((uVar1 < param_2) || ((ulonglong)param_4[2] < param_5)) {
    std::_Xout_of_range("invalid string position");
    pcVar2 = (code *)swi(3);
    plVar4 = (longlong *)(*pcVar2)();
    return plVar4;
  }
  uVar6 = uVar1 - param_2;
  if (uVar6 < param_3) {
    param_3 = uVar6;
  }
  uVar3 = param_4[2] - param_5;
  if (uVar3 < param_6) {
    param_6 = uVar3;
  }
  if (-param_6 - 1 <= uVar1 - param_3) {
    std::_Xlength_error("string too long");
    pcVar2 = (code *)swi(3);
    plVar4 = (longlong *)(*pcVar2)();
    return plVar4;
  }
  uVar3 = (uVar1 - param_3) + param_6;
  lVar7 = uVar6 - param_3;
  if (uVar1 < uVar3) {
    if (0x7ffffffffffffffe < uVar3) {
      std::_Xlength_error("string too long");
      pcVar2 = (code *)swi(3);
      plVar4 = (longlong *)(*pcVar2)();
      return plVar4;
    }
    if ((ulonglong)param_1[3] < uVar3) {
      FUN_1400019f0(param_1,uVar3);
    }
    else if (uVar3 == 0) {
      param_1[2] = 0;
      plVar4 = param_1;
      if (7 < (ulonglong)param_1[3]) {
        plVar4 = (longlong *)*param_1;
      }
      *(undefined2 *)plVar4 = 0;
    }
  }
  uVar1 = param_1[3];
  if (param_1 == param_4) {
    if (param_3 < param_6) {
      if (param_2 < param_5) {
        uVar6 = param_2 + param_3;
        if (param_5 < uVar6) {
          plVar5 = param_1;
          plVar4 = param_1;
          if (7 < uVar1) {
            plVar5 = (longlong *)*param_1;
            plVar4 = (longlong *)*param_1;
          }
          memmove((void *)((longlong)plVar5 + param_2 * 2),(void *)((longlong)plVar4 + param_5 * 2),
                  param_3 * 2);
          plVar5 = param_1;
          plVar4 = param_1;
          if (7 < (ulonglong)param_1[3]) {
            plVar5 = (longlong *)*param_1;
            plVar4 = (longlong *)*param_1;
          }
          memmove((void *)((longlong)plVar5 + (param_2 + param_6) * 2),
                  (void *)((longlong)plVar4 + uVar6 * 2),lVar7 * 2);
          plVar5 = param_1;
          plVar4 = param_1;
          if (7 < (ulonglong)param_1[3]) {
            plVar5 = (longlong *)*param_1;
            plVar4 = (longlong *)*param_1;
          }
          _Dst = (void *)((longlong)plVar5 + uVar6 * 2);
          _Src = (void *)((longlong)plVar4 + (param_6 + param_5) * 2);
          _Size = (param_6 - param_3) * 2;
        }
        else {
          plVar5 = param_1;
          plVar4 = param_1;
          if (7 < uVar1) {
            plVar5 = (longlong *)*param_1;
            plVar4 = (longlong *)*param_1;
          }
          memmove((void *)((longlong)plVar5 + (param_2 + param_6) * 2),
                  (void *)((longlong)plVar4 + uVar6 * 2),lVar7 * 2);
          plVar5 = param_1;
          plVar4 = param_1;
          if (7 < (ulonglong)param_1[3]) {
            plVar5 = (longlong *)*param_1;
            plVar4 = (longlong *)*param_1;
          }
          _Size = param_6 * 2;
          _Src = (void *)((longlong)plVar4 + ((param_5 - param_3) + param_6) * 2);
          _Dst = (void *)((longlong)plVar5 + param_2 * 2);
        }
      }
      else {
        plVar5 = param_1;
        plVar4 = param_1;
        if (7 < uVar1) {
          plVar5 = (longlong *)*param_1;
          plVar4 = (longlong *)*param_1;
        }
        memmove((void *)((longlong)plVar5 + (param_2 + param_6) * 2),
                (void *)((longlong)plVar4 + (param_2 + param_3) * 2),lVar7 * 2);
        if ((ulonglong)param_1[3] < 8) {
          _Src = (void *)((longlong)param_1 + param_5 * 2);
          _Size = param_6 * 2;
          _Dst = (void *)((longlong)param_1 + param_2 * 2);
        }
        else {
          _Src = (void *)(*param_1 + param_5 * 2);
          _Size = param_6 * 2;
          _Dst = (void *)(*param_1 + param_2 * 2);
        }
      }
    }
    else {
      plVar5 = param_1;
      plVar4 = param_1;
      if (7 < uVar1) {
        plVar5 = (longlong *)*param_1;
        plVar4 = (longlong *)*param_1;
      }
      memmove((void *)((longlong)plVar5 + param_2 * 2),(void *)((longlong)plVar4 + param_5 * 2),
              param_6 * 2);
      plVar5 = param_1;
      plVar4 = param_1;
      if (7 < (ulonglong)param_1[3]) {
        plVar5 = (longlong *)*param_1;
        plVar4 = (longlong *)*param_1;
      }
      _Size = lVar7 * 2;
      _Src = (void *)((longlong)plVar4 + (param_2 + param_3) * 2);
      _Dst = (void *)((longlong)plVar5 + (param_2 + param_6) * 2);
    }
    memmove(_Dst,_Src,_Size);
  }
  else {
    plVar5 = param_1;
    plVar4 = param_1;
    if (7 < uVar1) {
      plVar5 = (longlong *)*param_1;
      plVar4 = (longlong *)*param_1;
    }
    memmove((void *)((longlong)plVar5 + (param_2 + param_6) * 2),
            (void *)((longlong)plVar4 + (param_2 + param_3) * 2),lVar7 * 2);
    if (7 < (ulonglong)param_4[3]) {
      param_4 = (longlong *)*param_4;
    }
    plVar4 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      plVar4 = (longlong *)*param_1;
    }
    memcpy((void *)((longlong)plVar4 + param_2 * 2),(void *)((longlong)param_4 + param_5 * 2),
           param_6 * 2);
  }
  param_1[2] = uVar3;
  plVar4 = param_1;
  if (7 < (ulonglong)param_1[3]) {
    plVar4 = (longlong *)*param_1;
  }
  *(undefined2 *)((longlong)plVar4 + uVar3 * 2) = 0;
  return param_1;
}



longlong * FUN_14012ecd0(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_140607dd0) && (param_3 == DAT_140607dd0)) {
    FUN_14012f1e0();
    *param_1 = *DAT_140607dd0;
    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_14012ee90(local_res20,param_2);
    param_2 = local_res10;
  }
  *param_1 = (longlong)param_2;
  return param_1;
}



void FUN_14012ed90(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_14008f5c0(param_2);
    FUN_14012f3b0(*param_1,param_1[1],lVar4);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140129370(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;
}



undefined8 * FUN_14012ee90(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_140607dd0[1] == param_2) {
        DAT_140607dd0[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_14012f063;
    }
  }
  else {
    plVar9 = (longlong *)*plVar7;
  }
  plVar8 = (longlong *)param_2[1];
  if (*(char *)((longlong)plVar9 + 0x29) == '\0') {
    plVar9[1] = (longlong)plVar8;
  }
  if ((longlong *)DAT_140607dd0[1] == param_2) {
    DAT_140607dd0[1] = plVar9;
  }
  else if ((longlong *)*plVar8 == param_2) {
    *plVar8 = (longlong)plVar9;
  }
  else {
    plVar8[2] = (longlong)plVar9;
  }
  if ((longlong *)*DAT_140607dd0 == 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_140607dd0 = plVar7;
  }
  if ((longlong *)DAT_140607dd0[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_140607dd0[2] = plVar2;
    }
    else {
      DAT_140607dd0[2] = plVar8;
    }
  }
LAB_14012f063:
  if ((char)param_2[5] == '\x01') {
    if (plVar9 != (longlong *)DAT_140607dd0[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_14012f2c0(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_14012f320();
                plVar8 = (longlong *)plVar7[2];
              }
              *(char *)(plVar8 + 5) = (char)plVar7[5];
              *(undefined1 *)(plVar7 + 5) = 1;
              *(undefined1 *)(plVar8[2] + 0x28) = 1;
              FUN_14012f2c0(plVar7);
              break;
            }
LAB_14012f13d:
            *(undefined1 *)(plVar8 + 5) = 0;
          }
        }
        else {
          if ((char)plVar8[5] == '\0') {
            *(undefined1 *)(plVar8 + 5) = 1;
            *(undefined1 *)(plVar7 + 5) = 0;
            FUN_14012f320(plVar7);
            plVar8 = (longlong *)*plVar7;
          }
          if (*(char *)((longlong)plVar8 + 0x29) == '\0') {
            if ((*(char *)(plVar8[2] + 0x28) == '\x01') && (*(char *)(*plVar8 + 0x28) == '\x01'))
            goto LAB_14012f13d;
            if (*(char *)(*plVar8 + 0x28) == '\x01') {
              *(undefined1 *)(plVar8[2] + 0x28) = 1;
              *(undefined1 *)(plVar8 + 5) = 0;
              FUN_14012f2c0();
              plVar8 = (longlong *)*plVar7;
            }
            *(char *)(plVar8 + 5) = (char)plVar7[5];
            *(undefined1 *)(plVar7 + 5) = 1;
            *(undefined1 *)(*plVar8 + 0x28) = 1;
            FUN_14012f320(plVar7);
            break;
          }
        }
        plVar8 = (longlong *)plVar7[1];
        plVar9 = plVar7;
      } while (plVar7 != (longlong *)DAT_140607dd0[1]);
    }
    *(undefined1 *)(plVar9 + 5) = 1;
  }
  operator_delete(param_2);
  if (DAT_140607dd8 != 0) {
    DAT_140607dd8 = DAT_140607dd8 + -1;
  }
  *param_1 = plVar10;
  return param_1;
}



void FUN_14012f1e0(void)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  cVar1 = *(char *)((longlong)*(longlong **)(DAT_140607dd0 + 8) + 0x29);
  plVar3 = *(longlong **)(DAT_140607dd0 + 8);
  while (cVar1 == '\0') {
    FUN_14012f260(&DAT_140607dc8,plVar3[2]);
    plVar2 = (longlong *)*plVar3;
    operator_delete(plVar3);
    plVar3 = plVar2;
    cVar1 = *(char *)((longlong)plVar2 + 0x29);
  }
  *(longlong *)(DAT_140607dd0 + 8) = DAT_140607dd0;
  *(longlong *)DAT_140607dd0 = DAT_140607dd0;
  *(longlong *)(DAT_140607dd0 + 0x10) = DAT_140607dd0;
  DAT_140607dd8 = 0;
  return;
}



void FUN_14012f260(undefined8 param_1,longlong *param_2)

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



void FUN_14012f2c0(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_140607dd0 + 8)) {
    *(longlong **)(DAT_140607dd0 + 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_14012f320(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_140607dd0 + 8)) {
    *(longlong *)(DAT_140607dd0 + 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_14012f380(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;
}



undefined1 * FUN_14012f3b0(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_140129f70(param_3,param_1);
    }
    param_3 = param_3 + 0x28;
  }
  return param_3;
}



void thunk_FUN_140147940(void)

{
  FUN_140147940();
  return;
}



void FUN_14012f440(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  longlong lVar8;
  int *piVar9;
  undefined4 *puVar10;
  int iVar11;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_ENCHANT");
  if (lVar8 != 0) {
    FUN_1402d98b0(param_1);
    iVar1 = *(int *)(lVar8 + 0x70);
    iVar11 = 1;
    if (0 < iVar1) {
      do {
        uVar4 = FUN_1402970c0(lVar8,L"nBranch");
        piVar9 = (int *)FUN_140296600(lVar8,iVar11,uVar4,L"nBranch",1);
        iVar2 = *piVar9;
        uVar4 = FUN_1402970c0(lVar8,L"nSubCategory");
        piVar9 = (int *)FUN_140296600(lVar8,iVar11,uVar4,L"nSubCategory",1);
        iVar3 = *piVar9;
        uVar4 = FUN_1402970c0(lVar8,L"nEnchantItemCount");
        puVar10 = (undefined4 *)FUN_140296600(lVar8,iVar11,uVar4,L"nEnchantItemCount",1);
        uVar4 = *puVar10;
        uVar5 = FUN_1402970c0(lVar8,L"nInchantAddItem");
        puVar10 = (undefined4 *)FUN_140296600(lVar8,iVar11,uVar5,L"nInchantAddItem",1);
        uVar5 = *puVar10;
        uVar6 = FUN_1402970c0(lVar8,L"nInchantfailItemMin");
        puVar10 = (undefined4 *)FUN_140296600(lVar8,iVar11,uVar6,L"nInchantfailItemMin",1);
        uVar6 = *puVar10;
        uVar7 = FUN_1402970c0(lVar8,L"nInchantfailItemMax");
        puVar10 = (undefined4 *)FUN_140296600(lVar8,iVar11,uVar7,L"nInchantfailItemMax",1);
        local_38 = CONCAT44(iVar3,iVar2);
        local_30 = CONCAT44(uVar5,uVar4);
        local_28 = CONCAT44(*puVar10,uVar6);
        FUN_140147850(param_1,((longlong)iVar2 << 0x20) + (longlong)iVar3,&local_38);
        iVar11 = iVar11 + 1;
      } while (iVar11 <= iVar1);
    }
  }
  return;
}



undefined * FUN_14012f630(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetItemEnchantDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cefc & 1) == 0) {
    DAT_14060cefc = DAT_14060cefc | 1;
    FUN_140147780(0x3f400000,0x3e800000,0x40100000);
    FUN_14012f440(&DAT_14060a450);
    atexit((_func_5014 *)&LAB_1404485e0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetItemEnchantDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060a450;
}



// WARNING: Removing unreachable block (ram,0x00014012f7d1)
// WARNING: Removing unreachable block (ram,0x00014012f7da)
// WARNING: Removing unreachable block (ram,0x00014012f7fb)
// WARNING: Removing unreachable block (ram,0x00014012f804)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined4 * FUN_14012f6f0(void)

{
  undefined8 in_R9;
  
  DAT_14060b758 = 0;
  FUN_14015b420(&DAT_14060b760,0,0,in_R9,0xfffffffffffffffe);
  DAT_14060b768 = 0;
  FUN_14015b420(&DAT_14060b770,0,0);
  _DAT_14060b778 = 0;
  _DAT_14060b780 = 0;
  _DAT_14060b788 = 0x11;
  _DAT_14060b7a8 = 0;
  _DAT_14060b7ac = 10;
  _DAT_14060b7b0 = 0;
  _DAT_14060b7b8 = 0;
  _DAT_14060b78c = 0x3f400000;
  _DAT_14060b790 = 0x3e800000;
  _DAT_14060b794 = 0x40100000;
  _DAT_14060b798 = 0x26;
  _DAT_14060b7a0 = 0;
  FUN_14012f8e0();
  return &DAT_14060b750;
}



void thunk_FUN_140147b00(void)

{
  FUN_140147b00();
  return;
}



void FUN_14012f850(void)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  FUN_140147b00(&DAT_14060b778);
  plVar3 = DAT_14060b770;
  if (DAT_14060b770 != (longlong *)0x0) {
    LOCK();
    plVar1 = DAT_14060b770 + 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);
      }
    }
  }
  plVar3 = DAT_14060b760;
  if (DAT_14060b760 != (longlong *)0x0) {
    LOCK();
    plVar1 = DAT_14060b760 + 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;
}



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

void FUN_14012f8e0(void)

{
  short sVar1;
  int iVar2;
  undefined1 auVar3 [16];
  undefined1 auVar4 [16];
  wchar_t *pwVar5;
  wchar_t *pwVar6;
  longlong *plVar7;
  uint uVar8;
  undefined4 uVar9;
  longlong lVar10;
  undefined4 *puVar12;
  short *psVar13;
  longlong lVar14;
  __uint64 _Var15;
  int *piVar16;
  ulonglong uVar17;
  wchar_t *pwVar18;
  wchar_t *pwVar19;
  wchar_t *pwVar20;
  longlong *plVar21;
  undefined2 *puVar22;
  int *piVar23;
  short *psVar24;
  double dVar25;
  undefined1 auStack_428 [32];
  undefined1 local_408;
  undefined1 local_3f8;
  undefined1 local_3f7;
  undefined8 local_3f0;
  float local_3e8;
  undefined4 uStack_3e4;
  undefined8 local_3e0;
  float local_3d8;
  undefined4 uStack_3d4;
  uint local_3d0;
  uint local_3cc;
  int local_3c8;
  int *local_3c0;
  wchar_t *local_3b8;
  wchar_t *local_3b0;
  undefined8 local_3a8;
  wchar_t *local_398;
  wchar_t *local_390;
  undefined8 local_388;
  float local_378;
  float local_374;
  float local_370;
  float local_368;
  float local_364;
  float local_360;
  wchar_t *local_358;
  wchar_t *local_350;
  undefined8 local_348;
  int *local_338;
  undefined8 local_328;
  undefined8 local_320;
  undefined8 local_318;
  undefined8 local_310;
  undefined4 local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  undefined4 local_2ec;
  undefined4 local_2e8;
  undefined4 local_2e4;
  undefined4 local_2e0;
  undefined4 local_2dc;
  undefined4 local_2d8;
  undefined8 local_2d4;
  undefined8 local_2cc;
  undefined8 local_2c4;
  undefined4 local_2bc;
  undefined8 local_2b8;
  undefined8 local_2b0;
  undefined4 local_2a8;
  undefined4 local_2a4;
  undefined4 local_2a0;
  undefined8 local_29c;
  undefined8 local_294;
  undefined8 local_28c;
  undefined8 local_284;
  undefined8 local_27c;
  undefined8 local_274;
  undefined8 local_26c;
  undefined8 local_264;
  undefined2 local_258;
  undefined6 uStack_256;
  undefined8 local_248;
  ulonglong local_240;
  undefined8 local_230;
  undefined8 local_228;
  undefined2 local_218;
  undefined6 uStack_216;
  undefined8 local_208;
  ulonglong local_200;
  wchar_t local_1f0;
  undefined6 uStack_1ee;
  undefined8 local_1e0;
  ulonglong local_1d8;
  wchar_t local_1c8;
  undefined6 uStack_1c6;
  undefined8 local_1b8;
  ulonglong local_1b0;
  undefined2 local_1a0;
  undefined6 uStack_19e;
  undefined8 local_190;
  ulonglong local_188;
  undefined2 local_178;
  undefined6 uStack_176;
  undefined8 local_168;
  ulonglong local_160;
  int local_148;
  undefined1 local_140 [160];
  undefined2 local_a0;
  undefined6 uStack_9e;
  undefined8 local_90;
  ulonglong local_88;
  ulonglong local_68;
  int *piVar11;
  
  local_328 = 0xfffffffffffffffe;
  local_68 = DAT_1405d84f0 ^ (ulonglong)auStack_428;
  lVar10 = FUN_1402933b0(DAT_140607ff0,L"ENCHANT_INFO");
  if (lVar10 != 0) {
    FUN_140147a30(&DAT_14060b778);
    piVar23 = (int *)0x0;
    local_338 = piVar23;
    if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
      piVar11 = piVar23;
      plVar21 = *(longlong **)(lVar10 + 0x68);
      do {
        if (*plVar21 != 0) {
          local_338 = (int *)(*(longlong **)(lVar10 + 0x68))[(longlong)piVar11];
          break;
        }
        uVar8 = (int)piVar11 + 1;
        piVar11 = (int *)(ulonglong)uVar8;
        plVar21 = plVar21 + 1;
      } while (uVar8 < *(uint *)(lVar10 + 0x78));
    }
LAB_14012f99e:
    local_3c0 = local_338;
    if (local_338 != (int *)0x0) {
      iVar2 = *local_338;
      local_2f8 = 0;
      local_2f4 = 0;
      local_2f0 = 0;
      local_2ec = 0;
      local_2e8 = 0;
      local_2e4 = 0;
      local_2e0 = 0;
      local_2dc = 0;
      local_2d8 = 0;
      local_2d4 = 0;
      local_2cc = 0;
      local_2c4 = 0;
      local_2bc = 0;
      local_2a4 = 0;
      local_2a0 = 0;
      local_240 = 7;
      local_248 = 0;
      local_258 = 0;
      local_230 = 0;
      local_228 = 0;
      local_2b8 = 1;
      local_2b0 = 0;
      local_2a8 = 0;
      local_29c = 0;
      local_294 = 0;
      local_28c = 0;
      local_284 = 0;
      local_27c = 0;
      local_274 = 0;
      local_26c = 0;
      local_264 = 0;
      local_3c8 = iVar2;
      FUN_140001710(&local_258,&DAT_140477960,0);
      uVar9 = FUN_1402970c0(lVar10,L"fWeaponValue");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fWeaponValue");
      local_2f0 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"nWeaponPlus");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nWeaponPlus");
      local_2ec = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"fWeaponProbability");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fWeaponProbability");
      local_2f8 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"fDefenseProbability");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fDefenseProbability");
      local_2f4 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"fDefReal00");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fDefReal00");
      local_2e8 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"fDefReal01");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fDefReal01");
      local_2e4 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"fDefReal02");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fDefReal02");
      local_2e0 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"fDefReal03");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fDefReal03");
      local_2dc = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"fDefReal04");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fDefReal04");
      local_2d8 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"nWeaponFailType");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nWeaponFailType");
      local_2d4 = CONCAT44(local_2d4._4_4_,*puVar12);
      uVar9 = FUN_1402970c0(lVar10,L"nWeaponEnchantDownCount");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nWeaponEnchantDownCount");
      local_2d4 = CONCAT44(*puVar12,(undefined4)local_2d4);
      uVar9 = FUN_1402970c0(lVar10,L"nDefenseFailType");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nDefenseFailType");
      local_2cc = CONCAT44(local_2cc._4_4_,*puVar12);
      uVar9 = FUN_1402970c0(lVar10,L"nDefenseEnchantDownCount");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nDefenseEnchantDownCount");
      local_2cc = CONCAT44(*puVar12,(undefined4)local_2cc);
      uVar9 = FUN_1402970c0(lVar10,L"nItemFailType");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nItemFailType");
      local_2c4 = CONCAT44(local_2c4._4_4_,*puVar12);
      uVar9 = FUN_1402970c0(lVar10,L"nItemEnchantDownCount");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nItemEnchantDownCount");
      local_2c4 = CONCAT44(*puVar12,(undefined4)local_2c4);
      uVar9 = FUN_1402970c0(lVar10,L"fItemProbability");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fItemProbability");
      local_2bc = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"nEffectType");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nEffectType");
      local_2b8 = CONCAT44(local_2b8._4_4_,*puVar12);
      uVar9 = FUN_1402970c0(lVar10,L"szGlowColor");
      local_408 = 1;
      psVar13 = (short *)FUN_140296990(lVar10,iVar2,uVar9,L"szGlowColor");
      local_1d8 = 7;
      local_1e0 = 0;
      local_1f0 = L'\0';
      uVar17 = 0xffffffffffffffff;
      psVar24 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar24;
        psVar24 = psVar24 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_1f0,psVar13,~uVar17 - 1);
      uVar9 = FUN_1402970c0(lVar10,L"fGlowSpeed");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fGlowSpeed");
      local_2a4 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"fGlowWide");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fGlowWide");
      local_2a0 = *puVar12;
      uVar9 = FUN_1402970c0(lVar10,L"szDriftFresnelSize");
      local_408 = 1;
      psVar13 = (short *)FUN_140296990(lVar10,iVar2,uVar9,L"szDriftFresnelSize");
      local_160 = 7;
      local_168 = 0;
      local_178 = 0;
      uVar17 = 0xffffffffffffffff;
      psVar24 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar24;
        psVar24 = psVar24 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_178,psVar13,~uVar17 - 1);
      uVar9 = FUN_1402970c0(lVar10,L"szDriftFresnelScrollSpeed");
      local_408 = 1;
      psVar13 = (short *)FUN_140296990(lVar10,iVar2,uVar9,L"szDriftFresnelScrollSpeed");
      local_200 = 7;
      local_208 = 0;
      local_218 = 0;
      uVar17 = 0xffffffffffffffff;
      psVar24 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar24;
        psVar24 = psVar24 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_218,psVar13,~uVar17 - 1);
      uVar9 = FUN_1402970c0(lVar10,L"sz4DriftFresnelPower");
      local_408 = 1;
      psVar13 = (short *)FUN_140296990(lVar10,iVar2,uVar9,L"sz4DriftFresnelPower");
      local_188 = 7;
      local_190 = 0;
      local_1a0 = 0;
      uVar17 = 0xffffffffffffffff;
      psVar24 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar24;
        psVar24 = psVar24 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_1a0,psVar13,~uVar17 - 1);
      uVar9 = FUN_1402970c0(lVar10,L"szDriftFresnelColor");
      local_408 = 1;
      psVar13 = (short *)FUN_140296990(lVar10,iVar2,uVar9,L"szDriftFresnelColor");
      local_1b0 = 7;
      local_1b8 = 0;
      local_1c8 = L'\0';
      uVar17 = 0xffffffffffffffff;
      psVar24 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar24;
        psVar24 = psVar24 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_1c8,psVar13,~uVar17 - 1);
      local_3b8 = (wchar_t *)0x0;
      local_3b0 = (wchar_t *)0x0;
      local_3a8 = 0;
      local_398 = (wchar_t *)0x0;
      local_390 = (wchar_t *)0x0;
      local_388 = 0;
      local_358 = (wchar_t *)0x0;
      local_350 = (wchar_t *)0x0;
      local_348 = 0;
      local_320 = 0;
      local_318 = 0;
      local_310 = 0;
      puVar22 = &local_178;
      if (7 < local_160) {
        puVar22 = (undefined2 *)CONCAT62(uStack_176,local_178);
      }
      FUN_140415930(&local_3b8,puVar22,&DAT_14049c7b8);
      puVar22 = &local_218;
      if (7 < local_200) {
        puVar22 = (undefined2 *)CONCAT62(uStack_216,local_218);
      }
      FUN_140415930(&local_398,puVar22,&DAT_14049c7b8);
      puVar22 = &local_1a0;
      if (7 < local_188) {
        puVar22 = (undefined2 *)CONCAT62(uStack_19e,local_1a0);
      }
      FUN_140415930(&local_358,puVar22,&DAT_14049c7b8);
      pwVar5 = local_3b8;
      if (((longlong)local_3b0 - (longlong)local_3b8) / 0x28 == 4) {
        pwVar18 = local_3b8;
        if (7 < *(ulonglong *)(local_3b8 + 0xc)) {
          pwVar18 = *(wchar_t **)local_3b8;
        }
        dVar25 = _wtof(pwVar18);
        local_29c = CONCAT44(local_29c._4_4_,(float)dVar25);
        pwVar18 = pwVar5 + 0x14;
        if (7 < *(ulonglong *)(pwVar5 + 0x20)) {
          pwVar18 = *(wchar_t **)pwVar18;
        }
        dVar25 = _wtof(pwVar18);
        local_29c = CONCAT44((float)dVar25,(undefined4)local_29c);
        pwVar18 = pwVar5 + 0x28;
        if (7 < *(ulonglong *)(pwVar5 + 0x34)) {
          pwVar18 = *(wchar_t **)pwVar18;
        }
        dVar25 = _wtof(pwVar18);
        local_294 = CONCAT44(local_294._4_4_,(float)dVar25);
        pwVar18 = pwVar5 + 0x3c;
        if (7 < *(ulonglong *)(pwVar5 + 0x48)) {
          pwVar18 = *(wchar_t **)pwVar18;
        }
        dVar25 = _wtof(pwVar18);
        local_294 = CONCAT44((float)dVar25,(undefined4)local_294);
      }
      pwVar18 = local_398;
      if (((longlong)local_390 - (longlong)local_398) / 0x28 == 4) {
        pwVar19 = local_398;
        if (7 < *(ulonglong *)(local_398 + 0xc)) {
          pwVar19 = *(wchar_t **)local_398;
        }
        dVar25 = _wtof(pwVar19);
        local_28c = CONCAT44(local_28c._4_4_,(float)dVar25);
        pwVar19 = pwVar18 + 0x14;
        if (7 < *(ulonglong *)(pwVar18 + 0x20)) {
          pwVar19 = *(wchar_t **)pwVar19;
        }
        dVar25 = _wtof(pwVar19);
        local_28c = CONCAT44((float)dVar25,(undefined4)local_28c);
        pwVar19 = pwVar18 + 0x28;
        if (7 < *(ulonglong *)(pwVar18 + 0x34)) {
          pwVar19 = *(wchar_t **)pwVar19;
        }
        dVar25 = _wtof(pwVar19);
        local_284 = CONCAT44(local_284._4_4_,(float)dVar25);
        pwVar19 = pwVar18 + 0x3c;
        if (7 < *(ulonglong *)(pwVar18 + 0x48)) {
          pwVar19 = *(wchar_t **)pwVar19;
        }
        dVar25 = _wtof(pwVar19);
        local_284 = CONCAT44((float)dVar25,(undefined4)local_284);
      }
      pwVar6 = local_350;
      pwVar19 = local_358;
      if (((longlong)local_350 - (longlong)local_358) / 0x28 == 2) {
        pwVar20 = local_358;
        if (7 < *(ulonglong *)(local_358 + 0xc)) {
          pwVar20 = *(wchar_t **)local_358;
        }
        dVar25 = _wtof(pwVar20);
        local_27c = CONCAT44(local_27c._4_4_,(float)dVar25);
        pwVar20 = pwVar19 + 0x14;
        if (7 < *(ulonglong *)(pwVar19 + 0x20)) {
          pwVar20 = *(wchar_t **)pwVar20;
        }
        dVar25 = _wtof(pwVar20);
        local_27c = CONCAT44((float)dVar25,(undefined4)local_27c);
        local_274 = 0;
      }
      uVar9 = FUN_1402970c0(lVar10,L"szDriftFresnelTexture");
      local_408 = 1;
      psVar13 = (short *)FUN_140296990(lVar10,local_3c8,uVar9,L"szDriftFresnelTexture");
      uVar17 = 0xffffffffffffffff;
      psVar24 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar24;
        psVar24 = psVar24 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_258,psVar13,~uVar17 - 1);
      uVar9 = FUN_1402970c0(lVar10,L"nWeaponPenalty_01");
      iVar2 = local_3c8;
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,local_3c8,uVar9,L"nWeaponPenalty_01");
      local_230 = CONCAT44(local_230._4_4_,*puVar12);
      uVar9 = FUN_1402970c0(lVar10,L"nWeaponPenalty_02");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nWeaponPenalty_02");
      local_230 = CONCAT44(*puVar12,(undefined4)local_230);
      uVar9 = FUN_1402970c0(lVar10,L"nDefensePenalty_01");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nDefensePenalty_01");
      local_228 = CONCAT44(local_228._4_4_,*puVar12);
      uVar9 = FUN_1402970c0(lVar10,L"nDefensePenalty_02");
      local_408 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar10,iVar2,uVar9,L"nDefensePenalty_02");
      local_228 = CONCAT44(*puVar12,(undefined4)local_228);
      local_3d0 = 0;
      pwVar20 = &local_1f0;
      if (7 < local_1d8) {
        pwVar20 = (wchar_t *)CONCAT62(uStack_1ee,local_1f0);
      }
      swscanf_s(pwVar20,L"%x");
      local_378 = (float)(local_3d0 >> 0x10 & 0xff) / 255.0;
      local_374 = (float)(local_3d0 >> 8 & 0xff) / 255.0;
      local_3e8 = (float)(local_3d0 & 0xff) / 255.0;
      local_3f0 = (void *)CONCAT44(local_374,local_378);
      uStack_3e4 = 0x3f800000;
      local_2b8 = CONCAT44(local_378,(undefined4)local_2b8);
      local_2b0 = CONCAT44(local_3e8,local_374);
      local_2a8 = 0x3f800000;
      local_3cc = 0;
      pwVar20 = &local_1c8;
      if (7 < local_1b0) {
        pwVar20 = (wchar_t *)CONCAT62(uStack_1c6,local_1c8);
      }
      local_370 = local_3e8;
      swscanf_s(pwVar20,L"%x");
      local_368 = (float)(local_3cc >> 0x10 & 0xff) / 255.0;
      local_364 = (float)(local_3cc >> 8 & 0xff) / 255.0;
      local_3d8 = (float)(local_3cc & 0xff) / 255.0;
      local_3e0 = (void *)CONCAT44(local_364,local_368);
      uStack_3d4 = 0x3f800000;
      local_26c = CONCAT44(local_364,local_368);
      local_264 = CONCAT44(0x3f800000,local_3d8);
      local_148 = iVar2;
      local_360 = local_3d8;
      FUN_140150260(local_140,&local_2f8);
      FUN_140147960(&DAT_14060b778);
      if (7 < local_88) {
        operator_delete((void *)CONCAT62(uStack_9e,local_a0));
      }
      local_88 = 7;
      local_90 = 0;
      local_a0 = 0;
      pwVar20 = pwVar19;
      if (pwVar19 != (wchar_t *)0x0) {
        for (; pwVar20 != pwVar6; pwVar20 = pwVar20 + 0x14) {
          if (7 < *(ulonglong *)(pwVar20 + 0xc)) {
            operator_delete(*(void **)pwVar20);
          }
          pwVar20[0xc] = L'\a';
          pwVar20[0xd] = L'\0';
          pwVar20[0xe] = L'\0';
          pwVar20[0xf] = L'\0';
          pwVar20[8] = L'\0';
          pwVar20[9] = L'\0';
          pwVar20[10] = L'\0';
          pwVar20[0xb] = L'\0';
          *pwVar20 = L'\0';
        }
        operator_delete(pwVar19);
      }
      pwVar6 = local_390;
      pwVar19 = pwVar18;
      if (pwVar18 != (wchar_t *)0x0) {
        for (; pwVar19 != pwVar6; pwVar19 = pwVar19 + 0x14) {
          if (7 < *(ulonglong *)(pwVar19 + 0xc)) {
            operator_delete(*(void **)pwVar19);
          }
          pwVar19[0xc] = L'\a';
          pwVar19[0xd] = L'\0';
          pwVar19[0xe] = L'\0';
          pwVar19[0xf] = L'\0';
          pwVar19[8] = L'\0';
          pwVar19[9] = L'\0';
          pwVar19[10] = L'\0';
          pwVar19[0xb] = L'\0';
          *pwVar19 = L'\0';
        }
        operator_delete(pwVar18);
      }
      pwVar19 = local_3b0;
      pwVar18 = pwVar5;
      if (pwVar5 != (wchar_t *)0x0) {
        for (; pwVar18 != pwVar19; pwVar18 = pwVar18 + 0x14) {
          if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
            operator_delete(*(void **)pwVar18);
          }
          pwVar18[0xc] = L'\a';
          pwVar18[0xd] = L'\0';
          pwVar18[0xe] = L'\0';
          pwVar18[0xf] = L'\0';
          pwVar18[8] = L'\0';
          pwVar18[9] = L'\0';
          pwVar18[10] = L'\0';
          pwVar18[0xb] = L'\0';
          *pwVar18 = L'\0';
        }
        operator_delete(pwVar5);
      }
      if (7 < local_1b0) {
        operator_delete((void *)CONCAT62(uStack_1c6,local_1c8));
      }
      local_1b0 = 7;
      local_1b8 = 0;
      local_1c8 = L'\0';
      if (7 < local_188) {
        operator_delete((void *)CONCAT62(uStack_19e,local_1a0));
      }
      local_188 = 7;
      local_190 = 0;
      local_1a0 = 0;
      if (7 < local_200) {
        operator_delete((void *)CONCAT62(uStack_216,local_218));
      }
      local_200 = 7;
      local_208 = 0;
      local_218 = 0;
      if (7 < local_160) {
        operator_delete((void *)CONCAT62(uStack_176,local_178));
      }
      local_160 = 7;
      local_168 = 0;
      local_178 = 0;
      if (7 < local_1d8) {
        operator_delete((void *)CONCAT62(uStack_1ee,local_1f0));
      }
      local_1d8 = 7;
      local_1e0 = 0;
      local_1f0 = L'\0';
      if (7 < local_240) {
        operator_delete((void *)CONCAT62(uStack_256,local_258));
      }
      local_240 = 7;
      local_248 = 0;
      local_258 = 0;
      local_338 = *(int **)(local_3c0 + 6);
      if (local_338 == (int *)0x0) {
        uVar8 = (uint)local_3c0[8] % *(uint *)(lVar10 + 0x78) + 1;
        lVar14 = (longlong)(int)uVar8 << 3;
        local_338 = piVar23;
        do {
          if (*(uint *)(lVar10 + 0x78) <= uVar8) break;
          if (*(longlong *)(*(longlong *)(lVar10 + 0x68) + lVar14) != 0) {
            local_338 = *(int **)(*(longlong *)(lVar10 + 0x68) + lVar14);
          }
          uVar8 = uVar8 + 1;
          lVar14 = lVar14 + 8;
        } while (local_338 == (int *)0x0);
      }
      goto LAB_14012f99e;
    }
    lVar10 = FUN_1402933b0(DAT_140607ff0,&DAT_14049c898);
    if (lVar10 != 0) {
      DAT_14060b750 = *(int *)(lVar10 + 0x70);
      auVar3._8_8_ = 0;
      auVar3._0_8_ = (longlong)DAT_14060b750;
      _Var15 = SUB168(ZEXT816(4) * auVar3,0);
      if (SUB168(ZEXT816(4) * auVar3,8) != 0) {
        _Var15 = 0xffffffffffffffff;
      }
      local_3e0 = operator_new(_Var15);
      local_3f8 = 0;
      FUN_14015b420(&local_3d8,local_3e0,0);
      plVar21 = DAT_14060b760;
      DAT_14060b758 = local_3e0;
      plVar7 = (longlong *)CONCAT44(uStack_3d4,local_3d8);
      if (DAT_14060b760 != (longlong *)0x0) {
        LOCK();
        plVar7 = DAT_14060b760 + 1;
        lVar14 = *plVar7;
        DAT_14060b760 = (longlong *)CONCAT44(uStack_3d4,local_3d8);
        *(int *)plVar7 = (int)*plVar7 + -1;
        UNLOCK();
        plVar7 = DAT_14060b760;
        if ((int)lVar14 == 1) {
          (**(code **)(*plVar21 + 8))(plVar21);
          LOCK();
          piVar11 = (int *)((longlong)plVar21 + 0xc);
          iVar2 = *piVar11;
          *piVar11 = *piVar11 + -1;
          UNLOCK();
          plVar7 = DAT_14060b760;
          if (iVar2 == 1) {
            (**(code **)(*plVar21 + 0x10))(plVar21);
            plVar7 = DAT_14060b760;
          }
        }
      }
      DAT_14060b760 = plVar7;
      auVar4._8_8_ = 0;
      auVar4._0_8_ = (longlong)DAT_14060b750;
      _Var15 = SUB168(ZEXT816(4) * auVar4,0);
      if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
        _Var15 = 0xffffffffffffffff;
      }
      local_3f0 = operator_new(_Var15);
      local_3f7 = 0;
      FUN_14015b420(&local_3e8,local_3f0,0);
      plVar21 = DAT_14060b770;
      DAT_14060b768 = local_3f0;
      plVar7 = (longlong *)CONCAT44(uStack_3e4,local_3e8);
      if (DAT_14060b770 != (longlong *)0x0) {
        LOCK();
        plVar7 = DAT_14060b770 + 1;
        lVar14 = *plVar7;
        DAT_14060b770 = (longlong *)CONCAT44(uStack_3e4,local_3e8);
        *(int *)plVar7 = (int)*plVar7 + -1;
        UNLOCK();
        plVar7 = DAT_14060b770;
        if ((int)lVar14 == 1) {
          (**(code **)(*plVar21 + 8))(plVar21);
          LOCK();
          piVar11 = (int *)((longlong)plVar21 + 0xc);
          iVar2 = *piVar11;
          *piVar11 = *piVar11 + -1;
          UNLOCK();
          plVar7 = DAT_14060b770;
          if (iVar2 == 1) {
            (**(code **)(*plVar21 + 0x10))(plVar21);
            plVar7 = DAT_14060b770;
          }
        }
      }
      DAT_14060b770 = plVar7;
      piVar11 = piVar23;
      if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
        piVar16 = piVar23;
        plVar21 = *(longlong **)(lVar10 + 0x68);
        do {
          if (*plVar21 != 0) {
            piVar11 = (int *)(*(longlong **)(lVar10 + 0x68))[(longlong)piVar16];
            break;
          }
          uVar8 = (int)piVar16 + 1;
          piVar16 = (int *)(ulonglong)uVar8;
          plVar21 = plVar21 + 1;
        } while (uVar8 < *(uint *)(lVar10 + 0x78));
      }
LAB_140130940:
      piVar16 = piVar11;
      if (piVar16 != (int *)0x0) {
        iVar2 = *piVar16;
        uVar9 = FUN_1402970c0(lVar10,L"fDefenseValue");
        local_408 = 1;
        puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fDefenseValue");
        *(undefined4 *)((longlong)DAT_14060b758 + (longlong)iVar2 * 4 + -4) = *puVar12;
        uVar9 = FUN_1402970c0(lVar10,L"fDefensePlus");
        local_408 = 1;
        puVar12 = (undefined4 *)FUN_1402967b0(lVar10,iVar2,uVar9,L"fDefensePlus");
        *(undefined4 *)((longlong)DAT_14060b768 + (longlong)iVar2 * 4 + -4) = *puVar12;
        piVar11 = *(int **)(piVar16 + 6);
        if (*(int **)(piVar16 + 6) == (int *)0x0) {
          uVar8 = (uint)piVar16[8] % *(uint *)(lVar10 + 0x78) + 1;
          lVar14 = (longlong)(int)uVar8 << 3;
          piVar11 = piVar23;
          do {
            if (*(uint *)(lVar10 + 0x78) <= uVar8) break;
            if (*(longlong *)(*(longlong *)(lVar10 + 0x68) + lVar14) != 0) {
              piVar11 = *(int **)(*(longlong *)(lVar10 + 0x68) + lVar14);
            }
            uVar8 = uVar8 + 1;
            lVar14 = lVar14 + 8;
          } while (piVar11 == (int *)0x0);
        }
        goto LAB_140130940;
      }
    }
  }
  return;
}



void FUN_140130a50(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0xb8)) {
    operator_delete(*(void **)(param_1 + 0xa0));
  }
  *(undefined8 *)(param_1 + 0xb8) = 7;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined2 *)(param_1 + 0xa0) = 0;
  return;
}



void FUN_140130aa0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0xc0)) {
    operator_delete(*(void **)(param_1 + 0xa8));
  }
  *(undefined8 *)(param_1 + 0xc0) = 7;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  return;
}



float FUN_140130af0(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x28) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x28) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x38)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x38)) {
      if ((puVar1[0x3a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0.0;
        }
        if (param_3 == 1) {
          if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          return (float)puVar1[2] * 100.0;
        }
        if (param_3 == 2) {
          if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          return (float)puVar1[3] * 100.0;
        }
        if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        return (float)puVar1[0x11] * 100.0;
      }
    }
  }
  return 0.0;
}



uint FUN_140130bb0(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x28) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x28) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x38)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x38)) {
      if ((puVar1[0x3a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        if (param_3 == 1) {
          if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          return puVar1[0xb];
        }
        if (param_3 == 2) {
          if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          return puVar1[0xd];
        }
        if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        return puVar1[0xf];
      }
    }
  }
  return 0;
}



uint FUN_140130c50(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x28) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x28) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x38)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x38)) {
      if ((puVar1[0x3a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        if (param_3 == 1) {
          if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          return puVar1[0xc];
        }
        if (param_3 == 2) {
          if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          return puVar1[0xe];
        }
        if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        return puVar1[0x10];
      }
    }
  }
  return 0;
}



undefined8
FUN_140130cf0(int *param_1,uint param_2,int param_3,undefined4 param_4,undefined4 *param_5,
             undefined4 *param_6,uint *param_7)

{
  uint *puVar1;
  uint *puVar2;
  
  puVar2 = (uint *)0x0;
  if (*(longlong *)(param_1 + 10) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 10) +
                            ((ulonglong)param_2 % (ulonglong)(uint)param_1[0xe]) * 8);
        (puVar2 = (uint *)0x0, puVar1 != (uint *)0x0 &&
        ((puVar1[0x3a] != param_2 || (puVar2 = puVar1, *puVar1 != param_2))));
        puVar1 = *(uint **)(puVar1 + 0x38)) {
    }
  }
  if (((puVar2 != (uint *)0x0) && (0 < param_3)) && (param_3 < *param_1)) {
    switch(param_4) {
    case 1:
      if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      *param_7 = puVar2[6];
      break;
    case 2:
      if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      *param_7 = puVar2[7];
      break;
    default:
      *param_7 = 0;
      break;
    case 4:
      if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      *param_7 = puVar2[8];
      break;
    case 5:
      if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      *param_7 = puVar2[9];
      break;
    case 6:
      if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      *param_7 = puVar2[10];
    }
    *param_5 = *(undefined4 *)(*(longlong *)(param_1 + 2) + -4 + (longlong)param_3 * 4);
    *param_6 = *(undefined4 *)(*(longlong *)(param_1 + 6) + -4 + (longlong)param_3 * 4);
    return 1;
  }
  *param_5 = 0;
  *param_6 = 0;
  *param_7 = 0;
  return 0;
}



undefined4 * FUN_140130e80(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetEnchantInfoDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cef8 & 1) == 0) {
    DAT_14060cef8 = DAT_14060cef8 | 1;
    FUN_14012f6f0();
    atexit((_func_5014 *)&LAB_1404485f0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetEnchantInfoDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060b750;
}



void thunk_FUN_140147dc0(void)

{
  FUN_140147dc0();
  return;
}



void FUN_140130f20(void)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  longlong lVar6;
  int *piVar7;
  undefined4 *puVar8;
  int iVar9;
  undefined8 local_20;
  undefined8 local_18;
  
  lVar6 = FUN_1402933b0(DAT_140607ff0,L"ENCHANT_VARIABLE");
  if (lVar6 != 0) {
    FUN_140147cc0();
    iVar1 = *(int *)(lVar6 + 0x70);
    iVar9 = 1;
    if (0 < iVar1) {
      do {
        uVar4 = FUN_1402970c0(lVar6,L"nCategory");
        piVar7 = (int *)FUN_140296600(lVar6,iVar9,uVar4,L"nCategory",1);
        iVar2 = *piVar7;
        uVar4 = FUN_1402970c0(lVar6,L"nSubCategory");
        piVar7 = (int *)FUN_140296600(lVar6,iVar9,uVar4,L"nSubCategory",1);
        iVar3 = *piVar7;
        uVar4 = FUN_1402970c0(lVar6,L"fPParameter01");
        puVar8 = (undefined4 *)FUN_1402967b0(lVar6,iVar9,uVar4,L"fPParameter01",1);
        uVar4 = *puVar8;
        uVar5 = FUN_1402970c0(lVar6,L"fMParameter02");
        puVar8 = (undefined4 *)FUN_1402967b0(lVar6,iVar9,uVar5,L"fMParameter02",1);
        local_20 = CONCAT44(iVar3,iVar2);
        local_18 = CONCAT44(*puVar8,uVar4);
        FUN_140147bf0(((longlong)iVar2 << 0x20) + (longlong)iVar3,&local_20);
        iVar9 = iVar9 + 1;
      } while (iVar9 <= iVar1);
    }
  }
  return;
}



undefined8 * FUN_1401310a0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetEnchantVariableDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cef4 & 1) == 0) {
    DAT_14060cef4 = DAT_14060cef4 | 1;
    FUN_140147b20(0x3f400000,0x3e800000,0x40100000);
    FUN_140130f20();
    atexit((_func_5014 *)&LAB_140448600);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetEnchantVariableDB",uVar3,pcVar4
                  ,DVar5);
  }
  return &DAT_140609250;
}



void FUN_140131150(undefined8 *param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = FUN_1402933b0(DAT_140607ff0,L"FRANTZ_PARTS");
  uVar2 = DAT_140607ff0;
  *param_1 = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"ANGELA_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[1] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"TUDE_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[2] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"NATASHA_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[3] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"FRANTZ_AVATAR01_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[4] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"ANGELA_AVATAR01_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[5] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"TUDE_AVATAR01_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[6] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"NATASHA_AVATAR01_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[7] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"FRANTZ_AVATAR02_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[8] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"ANGELA_AVATAR01_PARTS");
  uVar2 = DAT_140607ff0;
  param_1[9] = uVar1;
  uVar2 = FUN_1402933b0(uVar2,L"TUDE_AVATAR01_PARTS");
  param_1[10] = uVar2;
  return;
}



undefined8 FUN_140131260(wchar_t *param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  iVar1 = _wcsicmp(param_1,L"hair");
  if (iVar1 != 0) {
    iVar1 = _wcsicmp(param_1,L"band");
    if (iVar1 != 0) {
      iVar1 = _wcsicmp(param_1,L"face");
      if (iVar1 == 0) {
        return 0xb;
      }
      iVar1 = _wcsicmp(param_1,L"tie");
      if (iVar1 == 0) {
        return 0xc;
      }
      iVar1 = _wcsicmp(param_1,L"coat");
      if (iVar1 != 0) {
        iVar1 = _wcsicmp(param_1,L"jacket");
        if (iVar1 != 0) {
          iVar1 = _wcsicmp(param_1,L"shirt");
          if (iVar1 != 0) {
            iVar1 = _wcsicmp(param_1,L"blouse");
            if (iVar1 != 0) {
              iVar1 = _wcsicmp(param_1,L"pants");
              if (iVar1 != 0) {
                iVar1 = _wcsicmp(param_1,L"skirt");
                if (iVar1 != 0) {
                  iVar1 = _wcsicmp(param_1,L"glove");
                  if (iVar1 != 0) {
                    iVar1 = _wcsicmp(param_1,L"arm");
                    if (iVar1 != 0) {
                      iVar1 = _wcsicmp(param_1,L"shoes");
                      if (iVar1 == 0) {
                        return 0x11;
                      }
                      iVar1 = _wcsicmp(param_1,L"hair_base");
                      if (iVar1 == 0) {
                        return 0x14;
                      }
                      iVar1 = _wcsicmp(param_1,L"accessory01");
                      if (iVar1 == 0) {
                        return 0x12;
                      }
                      iVar1 = _wcsicmp(param_1,L"accessory02");
                      uVar2 = 0xffffffff;
                      if (iVar1 == 0) {
                        uVar2 = 0x13;
                      }
                      return uVar2;
                    }
                  }
                  return 0x10;
                }
              }
              return 0xf;
            }
          }
          return 0xe;
        }
      }
      return 0xd;
    }
  }
  return 10;
}



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

{
  undefined4 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  if (param_3 < 1) {
    return 0xffffffff;
  }
  if (param_2 < 0x66) {
    if (param_2 == 0x65) {
      uVar3 = param_1[4];
    }
    else if (param_2 == 1) {
      uVar3 = *param_1;
    }
    else if (param_2 == 2) {
      uVar3 = param_1[1];
    }
    else if (param_2 == 3) {
      uVar3 = param_1[2];
    }
    else {
      if (param_2 != 4) {
        return 0xffffffff;
      }
      uVar3 = param_1[3];
    }
  }
  else if (param_2 == 0x66) {
    uVar3 = param_1[8];
  }
  else if (param_2 == 0xc9) {
    uVar3 = param_1[5];
  }
  else if (param_2 == 0x12d) {
    uVar3 = param_1[6];
  }
  else {
    if (param_2 != 0x191) {
      return 0xffffffff;
    }
    uVar3 = param_1[7];
  }
  uVar1 = FUN_1402970c0(uVar3,L"szCostumeSlotName");
  lVar2 = FUN_140296990(uVar3,param_3,uVar1,L"szCostumeSlotName",1);
  if (lVar2 == 0) {
    return 0xffffffff;
  }
  uVar3 = FUN_140131260(lVar2);
  return uVar3;
}



undefined * FUN_140131520(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetPartsDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cef0 & 1) == 0) {
    DAT_14060cef0 = DAT_14060cef0 | 1;
    FUN_140131150(&DAT_14060cd80);
    atexit((_func_5014 *)&DAT_140448610);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetPartsDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_14060cd80;
}



void thunk_FUN_140147f80(void)

{
  FUN_140147f80();
  return;
}



void FUN_1401315d0(undefined8 param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  longlong lVar10;
  undefined4 uVar11;
  undefined4 uVar12;
  undefined4 uVar13;
  undefined4 uVar14;
  longlong lVar15;
  longlong *plVar16;
  undefined4 *puVar17;
  longlong lVar18;
  uint uVar19;
  int *piVar20;
  int *piVar21;
  int iVar22;
  longlong local_78 [4];
  longlong local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  
  local_78[0] = FUN_1402933b0(DAT_140607ff0,L"FRANTZ_WEAPON");
  local_78[1] = FUN_1402933b0(DAT_140607ff0,L"ANGELA_WEAPON");
  local_78[2] = FUN_1402933b0(DAT_140607ff0,L"TUDE_WEAPON");
  local_78[3] = FUN_1402933b0(DAT_140607ff0,L"NATASHA_WEAPON");
  lVar15 = 0;
  do {
    if (local_78[lVar15] == 0) {
      return;
    }
    lVar15 = lVar15 + 1;
  } while (lVar15 < 4);
  iVar22 = 0;
  lVar15 = 0;
  do {
    lVar10 = local_78[lVar15];
    piVar20 = (int *)0x0;
    if (*(longlong *)(lVar10 + 0x70) != 0) {
      uVar19 = 0;
      if (*(uint *)(lVar10 + 0x78) != 0) {
        plVar16 = *(longlong **)(lVar10 + 0x68);
        do {
          if (*plVar16 != 0) {
            piVar20 = (int *)(*(longlong **)(lVar10 + 0x68))[(longlong)piVar20];
            goto LAB_1401316d0;
          }
          uVar19 = uVar19 + 1;
          piVar20 = (int *)((longlong)piVar20 + 1);
          plVar16 = plVar16 + 1;
        } while (uVar19 < *(uint *)(lVar10 + 0x78));
      }
      piVar20 = (int *)0x0;
    }
LAB_1401316d0:
    piVar21 = piVar20;
    if (piVar21 != (int *)0x0) {
      iVar1 = *piVar21;
      uVar11 = FUN_1402970c0(lVar10,L"nPhysicalAttackMin");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,iVar1,uVar11,L"nPhysicalAttackMin",1);
      uVar2 = *puVar17;
      uVar11 = FUN_1402970c0(lVar10,L"nPhysicalAttackMax");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,iVar1,uVar11,L"nPhysicalAttackMax",1);
      uVar3 = *puVar17;
      uVar11 = FUN_1402970c0(lVar10,L"nMagicAttackMin");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,iVar1,uVar11,L"nMagicAttackMin",1);
      uVar4 = *puVar17;
      uVar11 = FUN_1402970c0(lVar10,L"nMagicAttackMax");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,iVar1,uVar11,L"nMagicAttackMax",1);
      uVar5 = *puVar17;
      uVar11 = FUN_1402970c0(lVar10,L"nPhysicalAttackMin_B");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,iVar1,uVar11,L"nPhysicalAttackMin_B",1);
      uVar6 = *puVar17;
      uVar11 = FUN_1402970c0(lVar10,L"nPhysicalAttackMax_B");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,iVar1,uVar11,L"nPhysicalAttackMax_B",1);
      uVar7 = *puVar17;
      uVar11 = FUN_1402970c0(lVar10,L"nMagicAttackMin_B");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,iVar1,uVar11,L"nMagicAttackMin_B",1);
      uVar8 = *puVar17;
      uVar11 = FUN_1402970c0(lVar10,L"nMagicAttackMax_B");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,iVar1,uVar11,L"nMagicAttackMax_B",1);
      uVar9 = *puVar17;
      uVar11 = FUN_1402970c0(lVar10,L"fCritical");
      puVar17 = (undefined4 *)FUN_1402967b0(lVar10,iVar1,uVar11,L"fCritical",1);
      uVar11 = *puVar17;
      uVar12 = FUN_1402970c0(lVar10,L"fAttackSpeed");
      puVar17 = (undefined4 *)FUN_1402967b0(lVar10,iVar1,uVar12,L"fAttackSpeed",1);
      uVar12 = *puVar17;
      uVar13 = FUN_1402970c0(lVar10,L"fPushWeight");
      puVar17 = (undefined4 *)FUN_1402967b0(lVar10,iVar1,uVar13,L"fPushWeight",1);
      uVar13 = *puVar17;
      uVar14 = FUN_1402970c0(lVar10,L"fRisingWeight");
      puVar17 = (undefined4 *)FUN_1402967b0(lVar10,iVar1,uVar14,L"fRisingWeight",1);
      local_50 = CONCAT44(uVar3,uVar2);
      local_48 = CONCAT44(uVar5,uVar4);
      local_40 = CONCAT44(uVar7,uVar6);
      local_58 = ((longlong)(iVar22 + 1) << 0x20) + (longlong)iVar1;
      local_38 = CONCAT44(uVar9,uVar8);
      local_30 = CONCAT44(uVar12,uVar11);
      local_28 = CONCAT44(*puVar17,uVar13);
      FUN_140147eb0(param_1,local_58,&local_50);
      piVar20 = *(int **)(piVar21 + 6);
      if (piVar20 == (int *)0x0) {
        uVar19 = (uint)piVar21[8] % *(uint *)(lVar10 + 0x78) + 1;
        lVar18 = (longlong)(int)uVar19 << 3;
        do {
          if (*(uint *)(lVar10 + 0x78) <= uVar19) break;
          if (*(longlong *)(lVar18 + *(longlong *)(lVar10 + 0x68)) != 0) {
            piVar20 = *(int **)(lVar18 + *(longlong *)(lVar10 + 0x68));
          }
          uVar19 = uVar19 + 1;
          lVar18 = lVar18 + 8;
        } while (piVar20 == (int *)0x0);
      }
      goto LAB_1401316d0;
    }
    lVar15 = lVar15 + 1;
    iVar22 = iVar22 + 1;
    if (3 < lVar15) {
      return;
    }
  } while( true );
}



undefined8 * FUN_1401319f0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetWeaponDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ceec & 1) == 0) {
    DAT_14060ceec = DAT_14060ceec | 1;
    FUN_140147de0(0x3f400000,0x3e800000,0x40100000);
    FUN_1401315d0(&DAT_140609200);
    atexit((_func_5014 *)&LAB_140448620);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetWeaponDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_140609200;
}



// WARNING: Removing unreachable block (ram,0x000140131b64)
// WARNING: Removing unreachable block (ram,0x000140131b6d)
// WARNING: Removing unreachable block (ram,0x000140131b8e)
// WARNING: Removing unreachable block (ram,0x000140131b97)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140131ab0(void)

{
  FUN_1402ca220(&DAT_14060b310);
  _DAT_14060b350 = 0;
  _DAT_14060b358 = 0;
  _DAT_14060b360 = 0x11;
  _DAT_14060b380 = 0;
  _DAT_14060b384 = 10;
  _DAT_14060b388 = 0;
  _DAT_14060b390 = 0;
  _DAT_14060b364 = 0x3f400000;
  _DAT_14060b368 = 0x3e800000;
  _DAT_14060b36c = 0x40100000;
  _DAT_14060b370 = 0x26;
  _DAT_14060b378 = 0;
  _DAT_14060b398 = 0;
  _DAT_14060b3a0 = 0;
  _DAT_14060b3a8 = 0x11;
  _DAT_14060b3c8 = 0;
  _DAT_14060b3cc = 10;
  _DAT_14060b3d0 = 0;
  _DAT_14060b3d8 = 0;
  _DAT_14060b3ac = 0x3f400000;
  _DAT_14060b3b0 = 0x3e800000;
  _DAT_14060b3b4 = 0x40100000;
  _DAT_14060b3c0 = 0;
  _DAT_14060b3e0 = 0;
  _DAT_14060b3e8 = 0;
  _DAT_14060b3f0 = 0x11;
  _DAT_14060b410 = 0;
  _DAT_14060b414 = 10;
  _DAT_14060b418 = 0;
  _DAT_14060b420 = 0;
  _DAT_14060b3f4 = 0x3f400000;
  _DAT_14060b3f8 = 0x3e800000;
  _DAT_14060b3fc = 0x40100000;
  _DAT_14060b408 = 0;
  _DAT_14060b428 = 0;
  _DAT_14060b430 = 0;
  _DAT_14060b438 = 0x11;
  _DAT_14060b458 = 0;
  _DAT_14060b45c = 10;
  _DAT_14060b460 = 0;
  _DAT_14060b468 = 0;
  _DAT_14060b43c = 0x3f400000;
  _DAT_14060b440 = 0x3e800000;
  _DAT_14060b444 = 0x40100000;
  _DAT_14060b450 = 0;
  _DAT_14060b470 = 0;
  _DAT_14060b478 = 0;
  _DAT_14060b480 = 0x11;
  _DAT_14060b4a0 = 0;
  _DAT_14060b4a4 = 10;
  _DAT_14060b4a8 = 0;
  _DAT_14060b4b0 = 0;
  _DAT_14060b484 = 0x3f400000;
  _DAT_14060b488 = 0x3e800000;
  _DAT_14060b48c = 0x40100000;
  _DAT_14060b498 = 0;
  _DAT_14060b4b8 = 0;
  _DAT_14060b4c0 = 0;
  _DAT_14060b4c8 = 0x11;
  _DAT_14060b4e8 = 0;
  _DAT_14060b4ec = 10;
  _DAT_14060b4f0 = 0;
  _DAT_14060b4f8 = 0;
  _DAT_14060b4cc = 0x3f400000;
  _DAT_14060b4d0 = 0x3e800000;
  _DAT_14060b4d4 = 0x40100000;
  _DAT_14060b4e0 = 0;
  _DAT_14060b500 = 0;
  _DAT_14060b508 = 0;
  _DAT_14060b510 = 0x11;
  _DAT_14060b530 = 0;
  _DAT_14060b534 = 10;
  _DAT_14060b538 = 0;
  _DAT_14060b540 = 0;
  _DAT_14060b514 = 0x3f400000;
  _DAT_14060b518 = 0x3e800000;
  _DAT_14060b51c = 0x40100000;
  _DAT_14060b528 = 0;
  _DAT_14060b3b8 = _DAT_14060b370;
  _DAT_14060b400 = _DAT_14060b370;
  _DAT_14060b448 = _DAT_14060b370;
  _DAT_14060b490 = _DAT_14060b370;
  _DAT_14060b4d8 = _DAT_14060b370;
  _DAT_14060b520 = _DAT_14060b370;
  _eh_vector_constructor_iterator_
            (&DAT_14060b548,0x20,0xc,(_func_void_void_ptr *)&LAB_140147020,FUN_140162300);
  _eh_vector_constructor_iterator_
            (&DAT_14060b6c8,0x20,4,(_func_void_void_ptr *)&LAB_140147020,FUN_140162300);
  FUN_140135080(&DAT_14060b310);
  return &DAT_14060b310;
}



void thunk_FUN_140148110(void)

{
  FUN_140148110();
  return;
}



void thunk_FUN_140148360(void)

{
  FUN_140148360();
  return;
}



void thunk_FUN_140148520(void)

{
  FUN_140148520();
  return;
}



void thunk_FUN_1401486e0(void)

{
  FUN_1401486e0();
  return;
}



void thunk_FUN_1401487f0(void)

{
  FUN_1401487f0();
  return;
}



void FUN_140131ec0(void)

{
  _eh_vector_destructor_iterator_(&DAT_14060b6c8,0x20,4,FUN_140162300);
  _eh_vector_destructor_iterator_(&DAT_14060b548,0x20,0xc,FUN_140162300);
  FUN_140148360(&DAT_14060b500);
  FUN_1401487f0(&DAT_14060b4b8);
  FUN_1401487f0(&DAT_14060b470);
  FUN_1401486e0(&DAT_14060b428);
  FUN_140148520(&DAT_14060b3e0);
  FUN_140148360(&DAT_14060b398);
  FUN_140148110(&DAT_14060b350);
  if (DAT_14060b310 != 0) {
    FUN_14014ff00(&DAT_14060b310);
  }
  return;
}



void FUN_140131f90(longlong param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  FUN_140148040(param_1 + 0x40);
  FUN_140148200(param_1 + 0x88);
  FUN_140148450(param_1 + 0xd0);
  FUN_140148610(param_1 + 0x118);
  uVar2 = DAT_140607ff0;
  uVar1 = FUN_140294ca0(DAT_140607ff0,L"ITEM_LIST");
  FUN_140294650(uVar2,L"ITEM_LIST");
  FUN_140292e80(uVar2,L"ITEM_LIST",uVar1);
  uVar2 = DAT_140607ff0;
  uVar1 = FUN_140294ca0(DAT_140607ff0,L"ITEM_LIST_COSTUME");
  FUN_140294650(uVar2,L"ITEM_LIST_COSTUME");
  FUN_140292e80(uVar2,L"ITEM_LIST_COSTUME",uVar1);
  if ((DAT_14060b7c0 & 1) == 0) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
  }
  uVar1 = DAT_140607ff0;
  if (DAT_140609ec0 == 1000) {
    uVar2 = FUN_140294ca0(DAT_140607ff0,L"ITEM_LIST_MKY");
    FUN_140294650(uVar1,L"ITEM_LIST_MKY");
    FUN_140292e80(uVar1,L"ITEM_LIST_MKY",uVar2);
  }
  uVar2 = DAT_140607ff0;
  uVar1 = FUN_140294ca0(DAT_140607ff0,L"ITEM_OPTION_LIST");
  FUN_140294650(uVar2,L"ITEM_OPTION_LIST");
  FUN_140292e80(uVar2,L"ITEM_OPTION_LIST",uVar1);
  uVar2 = DAT_140607ff0;
  uVar1 = FUN_140294ca0(DAT_140607ff0,L"ITEM_FIELD_MESH");
  FUN_140294650(uVar2,L"ITEM_FIELD_MESH");
  FUN_140292e80(uVar2,L"ITEM_FIELD_MESH",uVar1);
  FUN_140135080(param_1);
  return;
}



longlong FUN_140132150(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 7;
  *(undefined2 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  *(undefined8 *)(param_1 + 0xa8) = 7;
  *(undefined2 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x1b8) = 0;
  *(undefined8 *)(param_1 + 0x1c0) = 7;
  *(undefined2 *)(param_1 + 0x1a8) = 0;
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined8 *)(param_1 + 0x208) = 0;
  *(undefined8 *)(param_1 + 0x210) = 0;
  *(undefined8 *)(param_1 + 0x228) = 0;
  *(undefined8 *)(param_1 + 0x230) = 0;
  *(undefined8 *)(param_1 + 0x238) = 0;
  *(undefined8 *)(param_1 + 0x248) = 0;
  *(undefined8 *)(param_1 + 0x250) = 0;
  *(undefined8 *)(param_1 + 600) = 0;
  *(undefined8 *)(param_1 + 0x268) = 0;
  *(undefined8 *)(param_1 + 0x270) = 0;
  *(undefined8 *)(param_1 + 0x278) = 0;
  return param_1;
}



void FUN_140132210(longlong param_1)

{
  if (*(void **)(param_1 + 0x268) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x268));
  }
  *(undefined8 *)(param_1 + 0x268) = 0;
  *(undefined8 *)(param_1 + 0x270) = 0;
  *(undefined8 *)(param_1 + 0x278) = 0;
  if (*(void **)(param_1 + 0x248) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x248));
  }
  *(undefined8 *)(param_1 + 0x248) = 0;
  *(undefined8 *)(param_1 + 0x250) = 0;
  *(undefined8 *)(param_1 + 600) = 0;
  if (*(void **)(param_1 + 0x228) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x228));
  }
  *(undefined8 *)(param_1 + 0x228) = 0;
  *(undefined8 *)(param_1 + 0x230) = 0;
  *(undefined8 *)(param_1 + 0x238) = 0;
  if (*(void **)(param_1 + 0x200) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x200));
  }
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined8 *)(param_1 + 0x208) = 0;
  *(undefined8 *)(param_1 + 0x210) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1c0)) {
    operator_delete(*(void **)(param_1 + 0x1a8));
  }
  *(undefined8 *)(param_1 + 0x1c0) = 7;
  *(undefined8 *)(param_1 + 0x1b8) = 0;
  *(undefined2 *)(param_1 + 0x1a8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xa8)) {
    operator_delete(*(void **)(param_1 + 0x90));
  }
  *(undefined8 *)(param_1 + 0xa8) = 7;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  *(undefined2 *)(param_1 + 0x90) = 0;
  if (*(void **)(param_1 + 0x60) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x60));
  }
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  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;
}



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

undefined4 FUN_140132390(longlong *param_1,short *param_2)

{
  short sVar1;
  ushort *puVar2;
  undefined4 uVar3;
  ulonglong uVar4;
  ushort *puVar5;
  short *psVar6;
  ulonglong uVar7;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  ushort local_40;
  undefined6 uStack_3e;
  longlong local_30;
  ulonglong local_28;
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  local_28 = 7;
  uVar7 = 0;
  local_30 = 0;
  local_40 = 0;
  uVar4 = 0xffffffffffffffff;
  psVar6 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_40,param_2,~uVar4 - 1);
  if (param_1[4] != 0) {
    puVar5 = &local_40;
    if (7 < local_28) {
      puVar5 = (ushort *)CONCAT62(uStack_3e,local_40);
    }
    puVar2 = &local_40;
    if (7 < local_28) {
      puVar2 = (ushort *)CONCAT62(uStack_3e,local_40);
    }
    for (; puVar2 != puVar5 + local_30; puVar2 = puVar2 + 1) {
      uVar7 = uVar7 ^ (uVar7 >> 2) + uVar7 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar2;
    }
    uVar7 = FUN_1402cb0b0(*param_1 + (uVar7 % (ulonglong)param_1[1]) * 8,&local_40);
  }
  if (7 < local_28) {
    operator_delete((void *)CONCAT62(uStack_3e,local_40));
  }
  if (uVar7 == 0) {
    uVar3 = 0xffffffff;
  }
  else {
    uVar3 = *(undefined4 *)(uVar7 + 0x30);
  }
  return uVar3;
}



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

void FUN_1401324d0(longlong param_1,longlong param_2,undefined8 param_3,char param_4,char param_5)

{
  short sVar1;
  longlong lVar2;
  code *pcVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  char cVar6;
  uint uVar7;
  undefined4 uVar8;
  uint uVar9;
  short *psVar10;
  uint *puVar11;
  undefined4 *puVar12;
  undefined4 *puVar13;
  undefined4 *puVar14;
  uint *puVar15;
  int *piVar16;
  longlong lVar17;
  longlong *plVar18;
  ulonglong uVar19;
  ushort *puVar20;
  wchar_t *pwVar21;
  ushort *puVar22;
  undefined *puVar23;
  uint *puVar24;
  uint *puVar25;
  uint *puVar26;
  short *psVar27;
  undefined8 *puVar28;
  uint *puVar29;
  uint *puVar30;
  ushort *puVar31;
  uint uVar32;
  uint uVar33;
  undefined1 auStack_878 [32];
  undefined1 local_858;
  uint local_848;
  char local_844;
  undefined8 *local_840;
  undefined8 *local_838;
  undefined8 local_830;
  uint local_820;
  uint local_81c;
  longlong local_818;
  uint *local_810;
  longlong local_808;
  undefined8 local_800;
  undefined8 local_7f8;
  undefined1 local_7f0 [24];
  uint local_7d8 [2];
  undefined2 local_7d0 [8];
  longlong local_7c0;
  undefined8 local_7b8;
  undefined2 local_7a8 [8];
  longlong local_798;
  undefined8 local_790;
  uint local_780;
  uint *local_778;
  uint *local_770;
  uint *local_768;
  undefined4 local_758;
  undefined4 local_754;
  undefined4 local_750;
  undefined4 local_74c;
  undefined2 local_748 [8];
  undefined8 local_738;
  undefined8 local_730;
  undefined4 local_720;
  undefined4 local_71c;
  undefined4 local_718;
  undefined4 local_714;
  undefined4 local_710;
  undefined4 local_70c;
  undefined4 local_708;
  undefined4 local_704;
  undefined4 local_700;
  int local_6fc;
  undefined4 local_6f8;
  undefined4 local_6f4;
  undefined4 local_6f0;
  undefined4 local_6ec;
  undefined4 local_6e8;
  undefined4 local_6e4;
  undefined4 local_6e0;
  undefined4 local_6dc;
  undefined4 local_6d8;
  undefined4 local_6d4;
  undefined4 local_6d0;
  undefined4 local_6cc;
  undefined4 local_6c8;
  undefined4 local_6c0;
  undefined4 local_6bc;
  undefined4 local_6b8;
  undefined4 local_6b4;
  undefined4 local_6b0;
  undefined4 local_6ac;
  undefined4 local_6a8;
  undefined4 local_6a4;
  undefined4 local_6a0;
  undefined4 local_69c;
  undefined4 local_698;
  undefined4 local_694;
  undefined4 local_690;
  undefined4 local_68c;
  undefined4 local_688;
  undefined4 local_684;
  undefined4 local_680;
  undefined4 local_67c;
  undefined4 local_678;
  undefined4 local_674;
  undefined4 local_670;
  int local_66c;
  int local_668;
  undefined4 local_664;
  undefined4 local_660;
  undefined4 local_65c;
  undefined4 local_658;
  undefined4 local_654;
  undefined4 local_650;
  undefined4 local_64c;
  undefined4 local_648;
  undefined4 local_644;
  undefined4 local_640;
  undefined4 local_63c;
  undefined4 local_638;
  undefined2 local_630 [8];
  undefined8 local_620;
  undefined8 local_618;
  undefined4 local_608;
  undefined4 local_604;
  undefined4 local_600;
  undefined4 local_5fc;
  undefined4 local_5f8;
  undefined4 local_5f4;
  undefined4 local_5f0;
  undefined4 local_5e8;
  undefined4 local_5e4;
  undefined4 local_5e0;
  undefined4 local_5dc;
  undefined *local_5d8;
  undefined4 *local_5d0;
  undefined4 *local_5c8;
  undefined4 local_5b8;
  undefined4 local_5b4;
  uint *local_5b0;
  uint *local_5a8;
  uint *local_5a0;
  uint *local_590;
  uint *local_588;
  uint *local_580;
  uint *local_570;
  uint *local_568;
  uint *local_560;
  undefined4 local_550;
  undefined2 local_548;
  undefined6 uStack_546;
  undefined8 local_538;
  ulonglong local_530;
  uint local_520;
  undefined2 local_518;
  undefined6 uStack_516;
  undefined8 local_508;
  ulonglong local_500;
  uint local_4f0;
  uint local_4e8;
  undefined1 local_4e0 [664];
  undefined1 local_248 [512];
  ulonglong local_48;
  
  local_7f8 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_878;
  puVar25 = (uint *)0x0;
  puVar15 = puVar25;
  local_844 = param_4;
  local_818 = param_2;
  local_808 = param_1;
  local_800 = param_3;
  if ((*(longlong *)(param_2 + 0x70) != 0) && (*(uint *)(param_2 + 0x78) != 0)) {
    puVar11 = puVar25;
    plVar18 = *(longlong **)(param_2 + 0x68);
    do {
      if (*plVar18 != 0) {
        puVar15 = (uint *)(*(longlong **)(param_2 + 0x68))[(longlong)puVar11];
        break;
      }
      uVar7 = (int)puVar11 + 1;
      puVar11 = (uint *)(ulonglong)uVar7;
      plVar18 = plVar18 + 1;
    } while (uVar7 < *(uint *)(param_2 + 0x78));
  }
  do {
    do {
      uVar5 = local_800;
      cVar6 = local_844;
      if (puVar15 == (uint *)0x0) {
        return;
      }
      uVar7 = *puVar15;
      local_7b8 = 7;
      local_7c0 = 0;
      local_7d0[0] = 0;
      local_790 = 7;
      local_798 = 0;
      local_7a8[0] = 0;
      local_778 = (uint *)0x0;
      local_770 = (uint *)0x0;
      local_768 = (uint *)0x0;
      local_730 = 7;
      local_738 = 0;
      local_748[0] = 0;
      local_618 = 7;
      local_620 = 0;
      local_630[0] = 0;
      local_5d8 = (undefined *)0x0;
      local_5d0 = (undefined4 *)0x0;
      local_5c8 = (undefined4 *)0x0;
      local_5b0 = (uint *)0x0;
      local_5a8 = (uint *)0x0;
      local_5a0 = (uint *)0x0;
      local_590 = (uint *)0x0;
      local_588 = (uint *)0x0;
      local_580 = (uint *)0x0;
      local_570 = (uint *)0x0;
      local_568 = (uint *)0x0;
      local_560 = (uint *)0x0;
      local_820 = uVar7;
      local_810 = puVar15;
      local_7d8[0] = uVar7;
      uVar8 = FUN_1402970c0(local_800,L"wszDesc");
      local_858 = 1;
      psVar10 = (short *)FUN_140296b70(uVar5,uVar7,uVar8,L"wszDesc");
      uVar19 = 0xffffffffffffffff;
      psVar27 = psVar10;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar27;
        psVar27 = psVar27 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_7d0,psVar10,~uVar19 - 1);
      uVar8 = FUN_1402970c0(uVar5,L"wszItemDescription");
      local_858 = 1;
      psVar10 = (short *)FUN_140296b70(uVar5,uVar7,uVar8,L"wszItemDescription");
      uVar19 = 0xffffffffffffffff;
      psVar27 = psVar10;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar27;
        psVar27 = psVar27 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_630,psVar10,~uVar19 - 1);
      uVar8 = FUN_1402970c0(uVar5,L"wszGroupName");
      local_858 = 1;
      psVar10 = (short *)FUN_140296b70(uVar5,uVar7,uVar8,L"wszGroupName");
      uVar19 = 0xffffffffffffffff;
      psVar27 = psVar10;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar27;
        psVar27 = psVar27 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_7a8,psVar10,~uVar19 - 1);
      puVar15 = puVar25;
      do {
        FUN_14012f380(local_248,L"nWeaponID%02d",puVar15);
        uVar8 = FUN_1402970c0(param_2,local_248);
        local_858 = 1;
        puVar11 = (uint *)FUN_140296600(param_2,uVar7,uVar8,local_248);
        uVar33 = *puVar11;
        local_848 = uVar33;
        if (uVar33 != 0) {
          if ((&local_848 < local_770) && (local_778 <= &local_848)) {
            lVar17 = (longlong)&local_848 - (longlong)local_778;
            if (local_770 == local_768) {
              uVar19 = (longlong)local_770 - (longlong)local_778 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                (*pcVar3)();
                return;
              }
              puVar26 = (uint *)(uVar19 + 1);
              puVar11 = (uint *)((longlong)local_768 - (longlong)local_778 >> 2);
              if (puVar11 < puVar26) {
                puVar29 = puVar25;
                if (puVar11 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar11 >> 1))) {
                  puVar29 = (uint *)((longlong)puVar11 + ((ulonglong)puVar11 >> 1));
                }
                if (puVar29 < puVar26) {
                  puVar29 = puVar26;
                }
                FUN_140051e60(&local_778,puVar29);
              }
            }
            if (local_770 != (uint *)0x0) {
              *local_770 = local_778[lVar17 >> 2];
            }
          }
          else {
            if (local_770 == local_768) {
              uVar19 = (longlong)local_770 - (longlong)local_778 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_140134e20;
              }
              puVar26 = (uint *)(uVar19 + 1);
              puVar11 = (uint *)((longlong)local_768 - (longlong)local_778 >> 2);
              if (puVar11 < puVar26) {
                puVar29 = puVar25;
                if (puVar11 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar11 >> 1))) {
                  puVar29 = (uint *)((longlong)puVar11 + ((ulonglong)puVar11 >> 1));
                }
                if (puVar29 < puVar26) {
                  puVar29 = puVar26;
                }
                FUN_140051e60(&local_778,puVar29);
              }
            }
            if (local_770 != (uint *)0x0) {
              *local_770 = uVar33;
            }
          }
          local_770 = local_770 + 1;
        }
        uVar33 = (int)puVar15 + 1;
        puVar15 = (uint *)(ulonglong)uVar33;
      } while ((int)uVar33 < 3);
      uVar8 = FUN_1402970c0(param_2,L"nFishingRod");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nFishingRod");
      uVar8 = FUN_1402970c0(param_2,L"nFishingChair");
      local_858 = 1;
      puVar13 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nFishingChair");
      uVar8 = FUN_1402970c0(param_2,L"nFishingBucket");
      local_858 = 1;
      puVar14 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nFishingBucket");
      if (puVar12 != (undefined4 *)0x0) {
        local_758 = *puVar12;
      }
      if (puVar13 != (undefined4 *)0x0) {
        local_754 = *puVar13;
      }
      if (puVar14 != (undefined4 *)0x0) {
        local_750 = *puVar14;
      }
      uVar8 = FUN_1402970c0(param_2,L"nPartID");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nPartID");
      local_74c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"szIconName");
      local_858 = 1;
      psVar10 = (short *)FUN_140296990(param_2,uVar7,uVar8,L"szIconName");
      uVar19 = 0xffffffffffffffff;
      psVar27 = psVar10;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar27;
        psVar27 = psVar27 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_748,psVar10,~uVar19 - 1);
      uVar8 = FUN_1402970c0(param_2,L"nGroupID");
      local_858 = 1;
      puVar15 = (uint *)FUN_140296600(param_2,uVar7,uVar8,L"nGroupID");
      local_780 = *puVar15;
      uVar8 = FUN_1402970c0(param_2,L"nFieldItem");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nFieldItem");
      local_720 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nSkillID");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nSkillID");
      local_71c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nCategory");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nCategory");
      local_718 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nSubCategory");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nSubCategory");
      local_714 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nAuctionCategory");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nAuctionCategory");
      local_710 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nBranch");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nBranch");
      local_70c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nKind");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nKind");
      local_708 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nItemBrokenType");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nItemBrokenType");
      local_704 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nItemBrokenCount");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nItemBrokenCount");
      local_700 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nInventoryType");
      local_858 = 1;
      piVar16 = (int *)FUN_140296600(param_2,uVar7,uVar8,L"nInventoryType");
      local_6fc = *piVar16;
      uVar8 = FUN_1402970c0(param_2,L"nRestraintType");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nRestraintType");
      local_6f8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nReconItemId");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nReconItemId");
      local_6f4 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nReconItemCount");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nReconItemCount");
      local_6f0 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nReconstructionMax");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nReconstructionMax");
      local_6ec = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nQuest");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nQuest");
      local_6e8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nSocketCountMin");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nSocketCountMin");
      local_6e4 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nSocketCountMax");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nSocketCountMax");
      local_6e0 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nEquipGroup");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nEquipGroup");
      local_6dc = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nJobClass");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nJobClass");
      local_6d8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nTitleList");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nTitleList");
      local_6d4 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nLevelLimit");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nLevelLimit");
      local_6d0 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"fInvade");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(param_2,uVar7,uVar8,L"fInvade");
      local_6cc = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nUseable");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nUseable");
      local_6c8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nShareRule");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nShareRule");
      local_6c0 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nItemTrade");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nItemTrade");
      local_6bc = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nNpcTrade");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nNpcTrade");
      local_6b8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nDelete");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nDelete");
      local_6b4 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nOverlapCnt");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nOverlapCnt");
      local_6b0 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nMaxCarryCnt");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nMaxCarryCnt");
      local_6ac = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nAddEffectID");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nAddEffectID");
      local_6a8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nAddEffectID01");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nAddEffectID01");
      local_6a4 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nCashItem");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nCashItem");
      local_6a0 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"fCooltime");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(param_2,uVar7,uVar8,L"fCooltime");
      local_600 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nRemainTime");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nRemainTime");
      local_69c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nDurability");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nDurability");
      local_698 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nDefense");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nDefense");
      local_694 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nMagicDefense");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nMagicDefense");
      local_690 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nDefense_b");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nDefense_b");
      local_68c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nMagicDefense_b");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nMagicDefense_b");
      local_688 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"fArmorQualityMin");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(param_2,uVar7,uVar8,L"fArmorQualityMin");
      local_684 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"fArmorQualityMax");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(param_2,uVar7,uVar8,L"fArmorQualityMax");
      local_680 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"fMagicResistance");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(param_2,uVar7,uVar8,L"fMagicResistance");
      local_67c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"fLuck");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(param_2,uVar7,uVar8,L"fLuck");
      local_678 = *puVar12;
      if (param_5 == '\0') {
        uVar8 = FUN_1402970c0(param_2,L"nWeight");
        local_858 = 1;
        puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nWeight");
        local_674 = *puVar12;
      }
      else {
        local_674 = 0;
      }
      uVar8 = FUN_1402970c0(param_2,L"nRuneType");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nRuneType");
      local_670 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nBuyPrice");
      local_858 = 1;
      piVar16 = (int *)FUN_140296600(param_2,uVar7,uVar8,L"nBuyPrice");
      local_66c = *piVar16;
      uVar8 = FUN_1402970c0(param_2,L"nSellPrice");
      local_858 = 1;
      piVar16 = (int *)FUN_140296600(param_2,uVar7,uVar8,L"nSellPrice");
      local_668 = *piVar16;
      uVar8 = FUN_1402970c0(param_2,L"nEnchantCost");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nEnchantCost");
      local_664 = *puVar12;
      if (cVar6 == '\0') {
        uVar8 = FUN_1402970c0(param_2,L"nSetId");
        local_858 = 1;
        puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nSetId");
        local_660 = *puVar12;
      }
      else {
        local_660 = 0;
      }
      uVar8 = FUN_1402970c0(param_2,L"nOptionGroup");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nOptionGroup");
      local_65c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nOptionGroup_h");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nOptionGroup_h");
      local_658 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nOptionGroup_vh");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nOptionGroup_vh");
      local_654 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nOptionGroup_b");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nOptionGroup_b");
      local_650 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nOptionCountMin");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nOptionCountMin");
      local_64c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nOptionCountMax");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nOptionCountMax");
      local_648 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nFixOption00");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nFixOption00");
      local_644 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nFixOption01");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nFixOption01");
      local_640 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nFixOptionValue00");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nFixOptionValue00");
      local_63c = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nFixOptionValue01");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nFixOptionValue01");
      local_638 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nUnionPackageID");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nUnionPackageID");
      local_608 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nCostumePackID");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nCostumePackID");
      local_604 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nRiddleGroup");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nRiddleGroup");
      local_5fc = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"fActivityValue");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(param_2,uVar7,uVar8,L"fActivityValue");
      local_5f8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nNotice");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nNotice");
      local_5f4 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nRuneGroup");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nRuneGroup");
      local_5f0 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nPetEatGroup");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nPetEatGroup");
      local_5e8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nUseableValue00");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nUseableValue00");
      local_5e0 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nUseableValue01");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nUseableValue01");
      local_5dc = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nEnchantType");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nEnchantType");
      local_5b8 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nBindingOff");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nBindingOff");
      local_5b4 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nAccountStorage");
      local_858 = 1;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nAccountStorage");
      local_550 = *puVar12;
      uVar8 = FUN_1402970c0(param_2,L"nPetCostume");
      local_858 = 0;
      puVar12 = (undefined4 *)FUN_140296600(param_2,uVar7,uVar8,L"nPetCostume");
      if (puVar12 != (undefined4 *)0x0) {
        local_5e4 = *puVar12;
      }
      uVar8 = FUN_1402970c0(param_2,L"szSocketColor");
      local_858 = 1;
      lVar17 = FUN_140296990(param_2,uVar7,uVar8,L"szSocketColor");
      uVar33 = 0;
      if (lVar17 != 0) {
        local_840 = (undefined8 *)0x0;
        local_838 = (undefined8 *)0x0;
        local_830 = 0;
        FUN_140415930(&local_840,lVar17,&DAT_14049c7b8);
        lVar17 = (longlong)local_838 - (longlong)local_840 >> 0x3f;
        puVar23 = local_5d8;
        puVar15 = puVar25;
        puVar11 = puVar25;
        if (((longlong)local_838 - (longlong)local_840) / 0x28 + lVar17 != lVar17) {
          do {
            puVar22 = (ushort *)(local_840 + (longlong)puVar11 * 5);
            lVar17 = *(longlong *)(puVar22 + 8);
            puVar20 = puVar22;
            if (7 < *(ulonglong *)(puVar22 + 0xc)) {
              puVar20 = *(ushort **)puVar22;
            }
            puVar31 = &DAT_14049d834;
            for (uVar19 = (ulonglong)(lVar17 != 0); uVar9 = 0, uVar19 != 0; uVar19 = uVar19 - 1) {
              if (*puVar20 != *puVar31) {
                uVar9 = 1;
                if (*puVar20 < *puVar31) {
                  uVar9 = 0xffffffff;
                }
                break;
              }
              puVar20 = puVar20 + 1;
              puVar31 = puVar31 + 1;
            }
            if (uVar9 == 0) {
              if (lVar17 == 0) {
                uVar9 = 0xffffffff;
              }
              else {
                uVar9 = (uint)(lVar17 != 1);
              }
            }
            if (uVar9 == 0) {
LAB_140134119:
              if ((local_5d0 < &UNK_14047c109) || (&DAT_14047c108 < puVar23)) {
                if (local_5d0 == local_5c8) {
                  uVar19 = (longlong)local_5d0 - (longlong)puVar23 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
                    std::_Xlength_error("vector<T> too long");
                    goto LAB_140134e90;
                  }
                  puVar26 = (uint *)(uVar19 + 1);
                  puVar29 = (uint *)((longlong)local_5c8 - (longlong)puVar23 >> 2);
                  if (puVar29 < puVar26) {
                    puVar30 = puVar25;
                    if (puVar29 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar29 >> 1))) {
                      puVar30 = (uint *)((longlong)puVar29 + ((ulonglong)puVar29 >> 1));
                    }
                    if (puVar30 < puVar26) {
                      puVar30 = puVar26;
                    }
                    FUN_140051e60(&local_5d8,puVar30);
                    puVar23 = local_5d8;
                  }
                }
                if (local_5d0 != (undefined4 *)0x0) {
                  *local_5d0 = 1;
                  puVar23 = local_5d8;
                }
              }
              else {
                lVar17 = (longlong)&DAT_14047c108 - (longlong)puVar23 >> 2;
                if (local_5d0 == local_5c8) {
                  uVar19 = (longlong)local_5d0 - (longlong)puVar23 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
                    std::_Xlength_error("vector<T> too long");
                    pcVar3 = (code *)swi(3);
                    (*pcVar3)();
                    return;
                  }
LAB_140133e56:
                  puVar26 = (uint *)(uVar19 + 1);
                  puVar29 = (uint *)((longlong)local_5c8 - (longlong)puVar23 >> 2);
                  if (puVar29 < puVar26) {
                    puVar30 = puVar25;
                    if (puVar29 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar29 >> 1))) {
                      puVar30 = (uint *)((longlong)puVar29 + ((ulonglong)puVar29 >> 1));
                    }
                    if (puVar30 < puVar26) {
                      puVar30 = puVar26;
                    }
                    FUN_140051e60(&local_5d8,puVar30);
                    puVar23 = local_5d8;
                  }
                }
LAB_140133ea6:
                if (local_5d0 != (undefined4 *)0x0) {
                  *local_5d0 = *(undefined4 *)(puVar23 + lVar17 * 4);
                  puVar23 = local_5d8;
                }
              }
LAB_140134200:
              local_5d0 = local_5d0 + 1;
            }
            else {
              lVar17 = *(longlong *)(puVar22 + 8);
              puVar20 = puVar22;
              if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                puVar20 = *(ushort **)puVar22;
              }
              puVar31 = &DAT_14049d838;
              uVar9 = 0;
              for (uVar19 = (ulonglong)(lVar17 != 0); uVar32 = uVar9, uVar19 != 0;
                  uVar19 = uVar19 - 1) {
                if (*puVar20 != *puVar31) {
                  uVar32 = 1;
                  if (*puVar20 < *puVar31) {
                    uVar32 = 0xffffffff;
                  }
                  break;
                }
                puVar20 = puVar20 + 1;
                puVar31 = puVar31 + 1;
              }
              if (uVar32 == 0) {
                if (lVar17 == 0) {
                  uVar32 = 0xffffffff;
                }
                else {
                  uVar32 = (uint)(lVar17 != 1);
                }
              }
              if (uVar32 == 0) goto LAB_140134119;
              lVar17 = *(longlong *)(puVar22 + 8);
              puVar20 = puVar22;
              if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                puVar20 = *(ushort **)puVar22;
              }
              puVar31 = &DAT_14049d83c;
              for (uVar19 = (ulonglong)(lVar17 != 0); uVar32 = uVar9, uVar19 != 0;
                  uVar19 = uVar19 - 1) {
                if (*puVar20 != *puVar31) {
                  uVar32 = 1;
                  if (*puVar20 < *puVar31) {
                    uVar32 = 0xffffffff;
                  }
                  break;
                }
                puVar20 = puVar20 + 1;
                puVar31 = puVar31 + 1;
              }
              if (uVar32 == 0) {
                if (lVar17 == 0) {
                  uVar32 = 0xffffffff;
                }
                else {
                  uVar32 = (uint)(lVar17 != 1);
                }
              }
              if (uVar32 == 0) {
LAB_14013403b:
                if ((&UNK_14047c115 <= local_5d0) && (puVar23 <= &DAT_14047c114)) {
                  lVar17 = (longlong)&DAT_14047c114 - (longlong)puVar23 >> 2;
                  if (local_5d0 == local_5c8) {
                    uVar19 = (longlong)local_5d0 - (longlong)puVar23 >> 2;
                    if (0x3ffffffffffffffe < uVar19) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar3 = (code *)swi(3);
                      (*pcVar3)();
                      return;
                    }
                    goto LAB_140133e56;
                  }
                  goto LAB_140133ea6;
                }
                if (local_5d0 == local_5c8) {
                  uVar19 = (longlong)local_5d0 - (longlong)puVar23 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
                    std::_Xlength_error("vector<T> too long");
                    pcVar3 = (code *)swi(3);
                    (*pcVar3)();
                    return;
                  }
                  puVar26 = (uint *)(uVar19 + 1);
                  puVar29 = (uint *)((longlong)local_5c8 - (longlong)puVar23 >> 2);
                  if (puVar29 < puVar26) {
                    puVar30 = puVar25;
                    if (puVar29 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar29 >> 1))) {
                      puVar30 = (uint *)((longlong)puVar29 + ((ulonglong)puVar29 >> 1));
                    }
                    if (puVar30 < puVar26) {
                      puVar30 = puVar26;
                    }
                    FUN_140051e60(&local_5d8,puVar30);
                    puVar23 = local_5d8;
                  }
                }
                if (local_5d0 != (undefined4 *)0x0) {
                  *local_5d0 = 4;
                  puVar23 = local_5d8;
                }
                goto LAB_140134200;
              }
              lVar17 = *(longlong *)(puVar22 + 8);
              puVar20 = puVar22;
              if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                puVar20 = *(ushort **)puVar22;
              }
              puVar31 = &DAT_14049d840;
              for (uVar19 = (ulonglong)(lVar17 != 0); uVar32 = uVar9, uVar19 != 0;
                  uVar19 = uVar19 - 1) {
                if (*puVar20 != *puVar31) {
                  uVar32 = 1;
                  if (*puVar20 < *puVar31) {
                    uVar32 = 0xffffffff;
                  }
                  break;
                }
                puVar20 = puVar20 + 1;
                puVar31 = puVar31 + 1;
              }
              if (uVar32 == 0) {
                if (lVar17 == 0) {
                  uVar32 = 0xffffffff;
                }
                else {
                  uVar32 = (uint)(lVar17 != 1);
                }
              }
              if (uVar32 == 0) goto LAB_14013403b;
              lVar17 = *(longlong *)(puVar22 + 8);
              puVar20 = puVar22;
              if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                puVar20 = *(ushort **)puVar22;
              }
              puVar31 = &DAT_140475bc8;
              for (uVar19 = (ulonglong)(lVar17 != 0); uVar32 = uVar9, uVar19 != 0;
                  uVar19 = uVar19 - 1) {
                if (*puVar20 != *puVar31) {
                  uVar32 = 1;
                  if (*puVar20 < *puVar31) {
                    uVar32 = 0xffffffff;
                  }
                  break;
                }
                puVar20 = puVar20 + 1;
                puVar31 = puVar31 + 1;
              }
              if (uVar32 == 0) {
                if (lVar17 == 0) {
                  uVar32 = 0xffffffff;
                }
                else {
                  uVar32 = (uint)(lVar17 != 1);
                }
              }
              if (uVar32 == 0) {
LAB_140133f5d:
                if ((&UNK_14047c10d <= local_5d0) && (puVar23 <= &DAT_14047c10c)) {
                  lVar17 = (longlong)&DAT_14047c10c - (longlong)puVar23 >> 2;
                  if (local_5d0 == local_5c8) {
                    uVar19 = (longlong)local_5d0 - (longlong)puVar23 >> 2;
                    if (0x3ffffffffffffffe < uVar19) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar3 = (code *)swi(3);
                      (*pcVar3)();
                      return;
                    }
                    goto LAB_140133e56;
                  }
                  goto LAB_140133ea6;
                }
                if (local_5d0 == local_5c8) {
                  uVar19 = (longlong)local_5d0 - (longlong)puVar23 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
                    std::_Xlength_error("vector<T> too long");
                    pcVar3 = (code *)swi(3);
                    (*pcVar3)();
                    return;
                  }
                  puVar26 = (uint *)(uVar19 + 1);
                  puVar29 = (uint *)((longlong)local_5c8 - (longlong)puVar23 >> 2);
                  if (puVar29 < puVar26) {
                    puVar30 = puVar25;
                    if (puVar29 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar29 >> 1))) {
                      puVar30 = (uint *)((longlong)puVar29 + ((ulonglong)puVar29 >> 1));
                    }
                    if (puVar30 < puVar26) {
                      puVar30 = puVar26;
                    }
                    FUN_140051e60(&local_5d8,puVar30);
                    puVar23 = local_5d8;
                  }
                }
                if (local_5d0 != (undefined4 *)0x0) {
                  *local_5d0 = 2;
                  puVar23 = local_5d8;
                }
                goto LAB_140134200;
              }
              lVar17 = *(longlong *)(puVar22 + 8);
              puVar20 = puVar22;
              if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                puVar20 = *(ushort **)puVar22;
              }
              puVar31 = &DAT_14049d844;
              for (uVar19 = (ulonglong)(lVar17 != 0); uVar32 = uVar9, uVar19 != 0;
                  uVar19 = uVar19 - 1) {
                if (*puVar20 != *puVar31) {
                  uVar32 = 1;
                  if (*puVar20 < *puVar31) {
                    uVar32 = 0xffffffff;
                  }
                  break;
                }
                puVar20 = puVar20 + 1;
                puVar31 = puVar31 + 1;
              }
              if (uVar32 == 0) {
                if (lVar17 == 0) {
                  uVar32 = 0xffffffff;
                }
                else {
                  uVar32 = (uint)(lVar17 != 1);
                }
              }
              if (uVar32 == 0) goto LAB_140133f5d;
              lVar17 = *(longlong *)(puVar22 + 8);
              puVar20 = puVar22;
              if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                puVar20 = *(ushort **)puVar22;
              }
              puVar31 = &DAT_14049d848;
              for (uVar19 = (ulonglong)(lVar17 != 0); uVar32 = uVar9, uVar19 != 0;
                  uVar19 = uVar19 - 1) {
                if (*puVar20 != *puVar31) {
                  uVar32 = 1;
                  if (*puVar20 < *puVar31) {
                    uVar32 = 0xffffffff;
                  }
                  break;
                }
                puVar20 = puVar20 + 1;
                puVar31 = puVar31 + 1;
              }
              if (uVar32 == 0) {
                if (lVar17 == 0) {
                  uVar32 = 0xffffffff;
                }
                else {
                  uVar32 = (uint)(lVar17 != 1);
                }
              }
              if (uVar32 == 0) {
LAB_140133e06:
                if ((&UNK_14047c111 <= local_5d0) && (puVar23 <= &DAT_14047c110)) {
                  lVar17 = (longlong)&DAT_14047c110 - (longlong)puVar23 >> 2;
                  if (local_5d0 == local_5c8) {
                    uVar19 = (longlong)local_5d0 - (longlong)puVar23 >> 2;
                    if (0x3ffffffffffffffe < uVar19) {
LAB_140134e20:
                      std::_Xlength_error("vector<T> too long");
                      pcVar3 = (code *)swi(3);
                      (*pcVar3)();
                      return;
                    }
                    goto LAB_140133e56;
                  }
                  goto LAB_140133ea6;
                }
                if (local_5d0 == local_5c8) {
                  uVar19 = (longlong)local_5d0 - (longlong)puVar23 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
                    std::_Xlength_error("vector<T> too long");
                    pcVar3 = (code *)swi(3);
                    (*pcVar3)();
                    return;
                  }
                  puVar26 = (uint *)(uVar19 + 1);
                  puVar29 = (uint *)((longlong)local_5c8 - (longlong)puVar23 >> 2);
                  if (puVar29 < puVar26) {
                    puVar30 = puVar25;
                    if (puVar29 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar29 >> 1))) {
                      puVar30 = (uint *)((longlong)puVar29 + ((ulonglong)puVar29 >> 1));
                    }
                    if (puVar30 < puVar26) {
                      puVar30 = puVar26;
                    }
                    FUN_140051e60(&local_5d8,puVar30);
                    puVar23 = local_5d8;
                  }
                }
                if (local_5d0 != (undefined4 *)0x0) {
                  *local_5d0 = 3;
                  puVar23 = local_5d8;
                }
                goto LAB_140134200;
              }
              lVar17 = *(longlong *)(puVar22 + 8);
              puVar20 = puVar22;
              if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                puVar20 = *(ushort **)puVar22;
              }
              puVar31 = &DAT_14049d84c;
              for (uVar19 = (ulonglong)(lVar17 != 0); uVar32 = uVar9, uVar19 != 0;
                  uVar19 = uVar19 - 1) {
                if (*puVar20 != *puVar31) {
                  uVar32 = 1;
                  if (*puVar20 < *puVar31) {
                    uVar32 = 0xffffffff;
                  }
                  break;
                }
                puVar20 = puVar20 + 1;
                puVar31 = puVar31 + 1;
              }
              if (uVar32 == 0) {
                if (lVar17 == 0) {
                  uVar32 = 0xffffffff;
                }
                else {
                  uVar32 = (uint)(lVar17 != 1);
                }
              }
              if (uVar32 == 0) goto LAB_140133e06;
              lVar17 = *(longlong *)(puVar22 + 8);
              puVar20 = puVar22;
              if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                puVar20 = *(ushort **)puVar22;
              }
              puVar31 = &DAT_14049d850;
              for (uVar19 = (ulonglong)(lVar17 != 0); uVar19 != 0; uVar19 = uVar19 - 1) {
                if (*puVar20 != *puVar31) {
                  uVar9 = 1;
                  if (*puVar20 < *puVar31) {
                    uVar9 = 0xffffffff;
                  }
                  break;
                }
                puVar20 = puVar20 + 1;
                puVar31 = puVar31 + 1;
              }
              if (uVar9 == 0) {
                if (lVar17 == 0) {
                  uVar9 = 0xffffffff;
                }
                else {
                  uVar9 = (uint)(lVar17 != 1);
                }
              }
              if (uVar9 == 0) {
LAB_140133dfd:
                puVar23 = &DAT_14047c118;
LAB_140133dd5:
                FUN_14012e5c0(&local_5d8,puVar23);
                puVar23 = local_5d8;
              }
              else {
                lVar17 = *(longlong *)(puVar22 + 8);
                if (7 < *(ulonglong *)(puVar22 + 0xc)) {
                  puVar22 = *(ushort **)puVar22;
                }
                puVar20 = &DAT_14049d854;
                for (uVar19 = (ulonglong)(lVar17 != 0); uVar9 = uVar33, uVar19 != 0;
                    uVar19 = uVar19 - 1) {
                  if (*puVar22 != *puVar20) {
                    uVar9 = 1;
                    if (*puVar22 < *puVar20) {
                      uVar9 = 0xffffffff;
                    }
                    break;
                  }
                  puVar22 = puVar22 + 1;
                  puVar20 = puVar20 + 1;
                }
                if (uVar9 == 0) {
                  if (lVar17 == 0) {
                    uVar9 = 0xffffffff;
                  }
                  else {
                    uVar9 = (uint)(lVar17 != 1);
                  }
                }
                if (uVar9 == 0) goto LAB_140133dfd;
                cVar6 = FUN_140123eb0(local_840 + (longlong)puVar15 * 5,&DAT_14049d858);
                if ((cVar6 != '\0') ||
                   (cVar6 = FUN_140123eb0(local_840 + (longlong)puVar15 * 5,&DAT_14049d85c),
                   cVar6 != '\0')) {
                  puVar23 = &DAT_14047c104;
                  goto LAB_140133dd5;
                }
                cVar6 = FUN_140123eb0(local_840 + (longlong)puVar15 * 5,&DAT_14049d860);
                if ((cVar6 != '\0') ||
                   (cVar6 = FUN_140123eb0(local_840 + (longlong)puVar15 * 5,&DAT_14049d864),
                   puVar23 = local_5d8, cVar6 != '\0')) {
                  puVar23 = &DAT_14047c11c;
                  goto LAB_140133dd5;
                }
              }
            }
            puVar15 = (uint *)(ulonglong)((int)puVar15 + 1);
            puVar11 = (uint *)((longlong)puVar11 + 1);
          } while (puVar15 < (uint *)(((longlong)local_838 - (longlong)local_840) / 0x28));
        }
        if (local_840 != (undefined8 *)0x0) {
          std::_Container_base0::_Orphan_all((_Container_base0 *)&local_840);
          puVar4 = local_838;
          for (puVar28 = local_840; puVar28 != puVar4; puVar28 = puVar28 + 5) {
            if (7 < (ulonglong)puVar28[3]) {
              operator_delete((void *)*puVar28);
            }
            puVar28[3] = 7;
            puVar28[2] = 0;
            *(undefined2 *)puVar28 = 0;
          }
          operator_delete(local_840);
        }
      }
      local_81c = 0;
      uVar8 = FUN_1402970c0(param_2,L"szEquipClass");
      local_858 = 0;
      lVar17 = FUN_140296990(param_2,uVar7,uVar8,L"szEquipClass");
      if (lVar17 != 0) {
        local_840 = (undefined8 *)0x0;
        local_838 = (undefined8 *)0x0;
        local_830 = 0;
        FUN_140415930(&local_840,lVar17,&DAT_14049c7b8);
        if (local_840 != local_838) {
          FUN_140051e60(&local_5b0,((longlong)local_838 - (longlong)local_840) / 0x28);
        }
        lVar17 = (longlong)local_838 - (longlong)local_840 >> 0x3f;
        puVar15 = puVar25;
        puVar11 = puVar25;
        puVar26 = puVar25;
        if (((longlong)local_838 - (longlong)local_840) / 0x28 + lVar17 != lVar17) {
          do {
            pwVar21 = (wchar_t *)((longlong)puVar11 + (longlong)local_840);
            if (7 < *(ulonglong *)(pwVar21 + 0xc)) {
              pwVar21 = *(wchar_t **)pwVar21;
            }
            uVar7 = _wtoi(pwVar21);
            local_848 = uVar7;
            if (0 < (int)uVar7) {
              if ((&local_848 < local_5a8) && (local_5b0 <= &local_848)) {
                lVar17 = (longlong)&local_848 - (longlong)local_5b0;
                if (local_5a8 == local_5a0) {
                  uVar19 = (longlong)local_5a8 - (longlong)local_5b0 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
LAB_140134e90:
                    std::_Xlength_error("vector<T> too long");
                    pcVar3 = (code *)swi(3);
                    (*pcVar3)();
                    return;
                  }
                  puVar29 = (uint *)(uVar19 + 1);
                  puVar15 = (uint *)((longlong)local_5a0 - (longlong)local_5b0 >> 2);
                  if (puVar15 < puVar29) {
                    puVar30 = puVar25;
                    if (puVar15 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar15 >> 1))) {
                      puVar30 = (uint *)((longlong)puVar15 + ((ulonglong)puVar15 >> 1));
                    }
                    if (puVar30 < puVar29) {
                      puVar30 = puVar29;
                    }
                    FUN_140051e60(&local_5b0,puVar30);
                  }
                }
                if (local_5a8 != (uint *)0x0) {
                  *local_5a8 = local_5b0[lVar17 >> 2];
                }
                puVar15 = (uint *)(ulonglong)local_81c;
              }
              else {
                if (local_5a8 == local_5a0) {
                  uVar19 = (longlong)local_5a8 - (longlong)local_5b0 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
                    std::_Xlength_error("vector<T> too long");
                    goto LAB_140134eac;
                  }
                  puVar30 = (uint *)(uVar19 + 1);
                  puVar29 = (uint *)((longlong)local_5a0 - (longlong)local_5b0 >> 2);
                  if (puVar29 < puVar30) {
                    puVar24 = puVar25;
                    if (puVar29 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar29 >> 1))) {
                      puVar24 = (uint *)((longlong)puVar29 + ((ulonglong)puVar29 >> 1));
                    }
                    if (puVar24 < puVar30) {
                      puVar24 = puVar30;
                    }
                    FUN_140051e60(&local_5b0,puVar24);
                  }
                }
                if (local_5a8 != (uint *)0x0) {
                  *local_5a8 = uVar7;
                }
              }
              local_5a8 = local_5a8 + 1;
            }
            if ((DAT_14060b7c0 & 1) == 0) {
              DAT_14060b7c0 = DAT_14060b7c0 | 1;
              FUN_140417410();
              atexit((_func_5014 *)&LAB_140448480);
            }
            if (DAT_140609ec0 == 1000) {
              puVar15 = (uint *)(ulonglong)uVar7;
            }
            local_81c = (uint)puVar15;
            puVar26 = (uint *)(ulonglong)((int)puVar26 + 1);
            param_2 = local_818;
            puVar11 = puVar11 + 10;
          } while (puVar26 < (uint *)(((longlong)local_838 - (longlong)local_840) / 0x28));
        }
        uVar7 = local_820;
        if (local_840 != (undefined8 *)0x0) {
          std::_Container_base0::_Orphan_all((_Container_base0 *)&local_840);
          FUN_14008d0a0(local_840,local_838);
          operator_delete(local_840);
          uVar7 = local_820;
        }
      }
      uVar8 = FUN_1402970c0(param_2,L"szEquipClassGroup");
      local_858 = 0;
      lVar17 = FUN_140296990(param_2,uVar7,uVar8,L"szEquipClassGroup");
      if (lVar17 != 0) {
        local_840 = (undefined8 *)0x0;
        local_838 = (undefined8 *)0x0;
        local_830 = 0;
        FUN_140415930(&local_840,lVar17,&DAT_14049c7b8);
        if (local_840 != local_838) {
          FUN_140051e60(&local_590,((longlong)local_838 - (longlong)local_840) / 0x28);
        }
        lVar17 = (longlong)local_838 - (longlong)local_840 >> 0x3f;
        puVar15 = puVar25;
        puVar11 = puVar25;
        puVar26 = puVar25;
        uVar33 = 0;
        if (((longlong)local_838 - (longlong)local_840) / 0x28 + lVar17 != lVar17) {
          do {
            pwVar21 = (wchar_t *)((longlong)puVar15 + (longlong)local_840);
            if (7 < *(ulonglong *)(pwVar21 + 0xc)) {
              pwVar21 = *(wchar_t **)pwVar21;
            }
            uVar7 = _wtoi(pwVar21);
            local_848 = uVar7;
            if (0 < (int)uVar7) {
              if ((&local_848 < local_588) && (local_590 <= &local_848)) {
                lVar17 = (longlong)&local_848 - (longlong)local_590;
                if (local_588 == local_580) {
                  uVar19 = (longlong)local_588 - (longlong)local_590 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
LAB_140134eac:
                    std::_Xlength_error("vector<T> too long");
                    pcVar3 = (code *)swi(3);
                    (*pcVar3)();
                    return;
                  }
                  puVar30 = (uint *)(uVar19 + 1);
                  puVar29 = (uint *)((longlong)local_580 - (longlong)local_590 >> 2);
                  if (puVar29 < puVar30) {
                    puVar24 = puVar25;
                    if (puVar29 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar29 >> 1))) {
                      puVar24 = (uint *)((longlong)puVar29 + ((ulonglong)puVar29 >> 1));
                    }
                    if (puVar24 < puVar30) {
                      puVar24 = puVar30;
                    }
                    FUN_140051e60(&local_590,puVar24);
                  }
                }
                if (local_588 != (uint *)0x0) {
                  *local_588 = local_590[lVar17 >> 2];
                }
              }
              else {
                if (local_588 == local_580) {
                  uVar19 = (longlong)local_588 - (longlong)local_590 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
                    std::_Xlength_error("vector<T> too long");
                    goto LAB_140134ec8;
                  }
                  puVar30 = (uint *)(uVar19 + 1);
                  puVar29 = (uint *)((longlong)local_580 - (longlong)local_590 >> 2);
                  if (puVar29 < puVar30) {
                    puVar24 = puVar25;
                    if (puVar29 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar29 >> 1))) {
                      puVar24 = (uint *)((longlong)puVar29 + ((ulonglong)puVar29 >> 1));
                    }
                    if (puVar24 < puVar30) {
                      puVar24 = puVar30;
                    }
                    FUN_140051e60(&local_590,puVar24);
                  }
                }
                if (local_588 != (uint *)0x0) {
                  *local_588 = uVar7;
                }
              }
              local_588 = local_588 + 1;
            }
            if ((DAT_14060b7c0 & 1) == 0) {
              DAT_14060b7c0 = DAT_14060b7c0 | 1;
              FUN_140417410();
              atexit((_func_5014 *)&LAB_140448480);
            }
            if (DAT_140609ec0 == 1000) {
              puVar26 = (uint *)(ulonglong)uVar7;
            }
            uVar33 = (uint)puVar26;
            puVar11 = (uint *)(ulonglong)((int)puVar11 + 1);
            param_2 = local_818;
            puVar15 = puVar15 + 10;
          } while (puVar11 < (uint *)(((longlong)local_838 - (longlong)local_840) / 0x28));
        }
        uVar7 = local_820;
        if (local_840 != (undefined8 *)0x0) {
          std::_Container_base0::_Orphan_all((_Container_base0 *)&local_840);
          FUN_14008d0a0(local_840,local_838);
          operator_delete(local_840);
          uVar7 = local_820;
        }
      }
      uVar8 = FUN_1402970c0(param_2,L"szUseLimit");
      local_858 = 0;
      lVar17 = FUN_140296990(param_2,uVar7,uVar8,L"szUseLimit");
      if (lVar17 != 0) {
        local_840 = (undefined8 *)0x0;
        local_838 = (undefined8 *)0x0;
        local_830 = 0;
        FUN_140415930(&local_840,lVar17,&DAT_14049c7b8);
        if (local_840 != local_838) {
          FUN_140051e60(&local_570,((longlong)local_838 - (longlong)local_840) / 0x28);
        }
        lVar17 = (longlong)local_838 - (longlong)local_840 >> 0x3f;
        puVar15 = puVar25;
        puVar11 = puVar25;
        if (((longlong)local_838 - (longlong)local_840) / 0x28 + lVar17 != lVar17) {
          do {
            pwVar21 = (wchar_t *)((longlong)local_840 + (longlong)puVar15);
            if (7 < *(ulonglong *)(pwVar21 + 0xc)) {
              pwVar21 = *(wchar_t **)pwVar21;
            }
            uVar9 = _wtoi(pwVar21);
            local_848 = uVar9;
            if (0 < (int)uVar9) {
              if ((&local_848 < local_568) && (local_570 <= &local_848)) {
                lVar17 = (longlong)&local_848 - (longlong)local_570;
                if (local_568 == local_560) {
                  uVar19 = (longlong)local_568 - (longlong)local_570 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
LAB_140134ec8:
                    std::_Xlength_error("vector<T> too long");
                    pcVar3 = (code *)swi(3);
                    (*pcVar3)();
                    return;
                  }
                  puVar29 = (uint *)(uVar19 + 1);
                  puVar26 = (uint *)((longlong)local_560 - (longlong)local_570 >> 2);
                  if (puVar26 < puVar29) {
                    puVar30 = puVar25;
                    if (puVar26 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar26 >> 1))) {
                      puVar30 = (uint *)((longlong)puVar26 + ((ulonglong)puVar26 >> 1));
                    }
                    if (puVar30 < puVar29) {
                      puVar30 = puVar29;
                    }
                    FUN_140051e60(&local_570,puVar30);
                  }
                }
                if (local_568 != (uint *)0x0) {
                  *local_568 = local_570[lVar17 >> 2];
                }
              }
              else {
                if (local_568 == local_560) {
                  uVar19 = (longlong)local_568 - (longlong)local_570 >> 2;
                  if (0x3ffffffffffffffe < uVar19) {
                    std::_Xlength_error("vector<T> too long");
                    goto LAB_140134ee4;
                  }
                  puVar29 = (uint *)(uVar19 + 1);
                  puVar26 = (uint *)((longlong)local_560 - (longlong)local_570 >> 2);
                  if (puVar26 < puVar29) {
                    puVar30 = puVar25;
                    if (puVar26 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar26 >> 1))) {
                      puVar30 = (uint *)((longlong)puVar26 + ((ulonglong)puVar26 >> 1));
                    }
                    if (puVar30 < puVar29) {
                      puVar30 = puVar29;
                    }
                    FUN_140051e60(&local_570,puVar30);
                  }
                }
                if (local_568 != (uint *)0x0) {
                  *local_568 = uVar9;
                }
              }
              local_568 = local_568 + 1;
            }
            puVar11 = (uint *)(ulonglong)((int)puVar11 + 1);
            puVar15 = puVar15 + 10;
          } while (puVar11 < (uint *)(((longlong)local_838 - (longlong)local_840) / 0x28));
        }
        param_2 = local_818;
        if (local_840 != (undefined8 *)0x0) {
          std::_Container_base0::_Orphan_all((_Container_base0 *)&local_840);
          FUN_14008d0a0(local_840,local_838);
          operator_delete(local_840);
          param_2 = local_818;
        }
      }
      if (((local_66c != 0) && (local_668 != 0)) && (local_66c < local_668)) {
        printf("NPC Shop Price Error : ID [ %d ] - Buy [ %d ], Sell [ %d ]\n",(ulonglong)uVar7);
      }
      lVar17 = local_808;
      if (local_7c0 != 0) {
        local_500 = 7;
        local_508 = 0;
        local_518 = 0;
        FUN_1400015e0(&local_518,local_7d0,0,0xffffffffffffffff);
        local_530 = 7;
        local_538 = 0;
        local_548 = 0;
        local_4f0 = uVar7;
        FUN_14008ff90(&local_548,&local_518);
        lVar17 = local_808;
        local_520 = local_4f0;
        if (*(longlong *)(local_808 + 0x20) == 0) {
          FUN_1401500f0(local_808,&local_840,&local_548);
        }
        else {
          FUN_14014ffb0(local_808,local_7f0,&local_548,&local_548);
        }
        if (7 < local_530) {
          operator_delete((void *)CONCAT62(uStack_546,local_548));
        }
        local_530 = 7;
        local_538 = 0;
        local_548 = 0;
        if (7 < local_500) {
          operator_delete((void *)CONCAT62(uStack_516,local_518));
        }
      }
      local_4e8 = uVar7;
      FUN_1401503f0(local_4e0,local_7d8);
      plVar18 = (longlong *)(lVar17 + 0x88);
      FUN_140148130(plVar18,local_4e8,local_4e0);
      FUN_140132210(local_4e0);
      if ((0 < (int)local_780) && (local_798 != 0)) {
        lVar2 = *(longlong *)(lVar17 + 0x40);
        if (lVar2 != 0) {
          for (puVar15 = *(uint **)(lVar2 + ((ulonglong)local_780 %
                                            (ulonglong)*(uint *)(lVar17 + 0x50)) * 8);
              puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0xc)) {
            if ((puVar15[0xe] == local_780) && (*puVar15 == local_780)) {
              if (puVar15 != (uint *)0x0) goto LAB_140134cbd;
              break;
            }
          }
        }
        FUN_140147fa0((longlong *)(lVar17 + 0x40),local_780,local_7a8);
      }
LAB_140134cbd:
      if ((0 < (int)local_81c) && (local_6fc != 0)) {
        puVar15 = puVar25;
        if (*plVar18 != 0) {
          for (puVar11 = *(uint **)(*plVar18 +
                                   ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar17 + 0x98)) * 8);
              puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
            if ((puVar11[0xa8] == uVar7) && (*puVar11 == uVar7)) {
              if (puVar11 != (uint *)0x0) {
                if (puVar11 == (uint *)0x0) {
LAB_140134ee4:
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                puVar15 = puVar11 + 2;
              }
              break;
            }
          }
        }
        FUN_140134f40(lVar17,local_81c,puVar15);
      }
      if ((0 < (int)uVar33) && (local_6fc != 0)) {
        puVar15 = puVar25;
        if (*plVar18 != 0) {
          for (puVar11 = *(uint **)(*plVar18 +
                                   ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar17 + 0x98)) * 8);
              puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
            if ((puVar11[0xa8] == uVar7) && (*puVar11 == uVar7)) {
              if (puVar11 != (uint *)0x0) {
                if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                puVar15 = puVar11 + 2;
              }
              break;
            }
          }
        }
        FUN_140135020(lVar17,uVar33,puVar15);
      }
      FUN_140132210(local_7d8);
      puVar15 = *(uint **)(local_810 + 6);
    } while (puVar15 != (uint *)0x0);
    uVar7 = local_810[8] % *(uint *)(param_2 + 0x78) + 1;
    lVar17 = (longlong)(int)uVar7 << 3;
    puVar15 = puVar25;
    do {
      if (*(uint *)(param_2 + 0x78) <= uVar7) break;
      if (*(longlong *)(*(longlong *)(param_2 + 0x68) + lVar17) != 0) {
        puVar15 = *(uint **)(*(longlong *)(param_2 + 0x68) + lVar17);
      }
      uVar7 = uVar7 + 1;
      lVar17 = lVar17 + 8;
    } while (puVar15 == (uint *)0x0);
  } while( true );
}



void FUN_140134f30(longlong param_1)

{
  FUN_140132210(param_1 + 8);
  return;
}



void FUN_140134f40(longlong param_1,int param_2,longlong param_3)

{
  int iVar1;
  longlong local_res18 [2];
  
  if ((0 < *(int *)(param_3 + 0xc4)) && (*(int *)(param_3 + 0xc4) < 0x15)) {
    if (param_2 == 1) {
      iVar1 = 0;
    }
    else if (param_2 == 2) {
      iVar1 = 1;
    }
    else if (param_2 == 3) {
      iVar1 = 2;
    }
    else if (param_2 == 4) {
      iVar1 = 3;
    }
    else if (param_2 == 0x65) {
      iVar1 = 4;
    }
    else if (param_2 == 0xc9) {
      iVar1 = 5;
    }
    else if (param_2 == 0x12d) {
      iVar1 = 6;
    }
    else if (param_2 == 0x191) {
      iVar1 = 7;
    }
    else if (param_2 == 0x66) {
      iVar1 = 8;
    }
    else if (param_2 == 0xca) {
      iVar1 = 9;
    }
    else if (param_2 == 0x12e) {
      iVar1 = 10;
    }
    else {
      if (param_2 != 0x192) {
        return;
      }
      iVar1 = 0xb;
    }
    local_res18[0] = param_3;
    FUN_1401959b0((longlong)iVar1 * 0x20 + 0x238 + param_1,local_res18);
  }
  return;
}



void FUN_140135020(longlong param_1,int param_2,longlong param_3)

{
  int iVar1;
  longlong local_res18 [2];
  
  if ((0 < *(int *)(param_3 + 0xc4)) && (*(int *)(param_3 + 0xc4) < 0x15)) {
    if (param_2 == 1) {
      iVar1 = 0;
    }
    else if (param_2 == 2) {
      iVar1 = 1;
    }
    else if (param_2 == 3) {
      iVar1 = 2;
    }
    else {
      if (param_2 != 4) {
        return;
      }
      iVar1 = 3;
    }
    local_res18[0] = param_3;
    FUN_1401959b0((longlong)iVar1 * 0x20 + 0x3b8 + param_1,local_res18);
  }
  return;
}



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

void FUN_140135080(uint *param_1)

{
  ushort *puVar1;
  short sVar2;
  code *pcVar3;
  uint uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  uint *puVar11;
  undefined4 *puVar13;
  uint *puVar14;
  short *psVar15;
  short *psVar16;
  ulonglong uVar17;
  wchar_t *pwVar18;
  longlong *plVar19;
  ushort *puVar20;
  undefined2 *puVar21;
  uint *puVar22;
  uint *puVar23;
  uint uVar24;
  ushort *puVar25;
  uint *puVar26;
  undefined8 uVar27;
  wchar_t *pwVar28;
  undefined1 uVar29;
  undefined1 auStack_3c8 [32];
  undefined1 local_3a8;
  undefined1 local_398;
  uint local_394;
  uint local_390;
  uint local_38c;
  uint *local_388;
  uint *local_380;
  uint *local_378;
  ulonglong local_370;
  undefined8 local_368;
  undefined2 local_360;
  undefined2 uStack_35e;
  undefined4 uStack_35c;
  uint local_358;
  uint *local_350;
  uint *local_348;
  uint *local_340;
  undefined2 local_330;
  undefined2 uStack_32e;
  undefined4 uStack_32c;
  undefined4 local_328;
  undefined4 local_324;
  undefined8 local_320;
  void *local_318 [4];
  wchar_t *local_2f8;
  wchar_t *local_2f0;
  undefined8 local_2e8;
  ulonglong local_2e0;
  uint local_2c8;
  undefined2 local_2c0;
  undefined6 uStack_2be;
  longlong local_2b0;
  ulonglong local_2a8;
  undefined2 local_298;
  undefined6 uStack_296;
  undefined8 local_288;
  ulonglong local_280;
  uint local_270;
  undefined4 local_26c;
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined4 local_258;
  uint local_248 [2];
  uint local_240 [2];
  undefined2 local_238 [4];
  undefined8 local_230;
  undefined8 local_228;
  undefined8 local_220;
  ushort local_218;
  undefined6 uStack_216;
  undefined2 local_210 [4];
  longlong local_208;
  ulonglong local_200;
  undefined8 local_1f8;
  undefined4 local_1f0;
  uint local_1e8;
  undefined4 local_1e4;
  undefined4 local_1e0;
  undefined4 local_1dc;
  undefined8 local_1d8;
  undefined8 local_1d0;
  undefined2 local_1c0 [8];
  undefined8 local_1b0;
  undefined8 local_1a8;
  ushort local_198;
  undefined6 uStack_196;
  longlong local_188;
  ulonglong local_180;
  ushort local_170;
  undefined6 uStack_16e;
  longlong local_160;
  ulonglong local_158;
  uint local_148;
  undefined1 local_140 [264];
  ulonglong local_38;
  uint *puVar12;
  
  local_368 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_3c8;
  local_380 = param_1;
  printf("ItemList Table Loading !!! \n");
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST_STRING");
  if (lVar8 == 0) {
    return;
  }
  lVar9 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST");
  if (lVar9 == 0) {
    return;
  }
  if (((*(longlong *)(param_1 + 0x24) != 0) || (*(longlong *)(param_1 + 0x36) != 0)) ||
     (*(longlong *)(param_1 + 0x48) != 0)) {
    FUN_140418da0(DAT_140607fd8,L"ReInit Table ItemDB");
    FUN_140148200(param_1 + 0x22);
    FUN_140148450(param_1 + 0x34);
    FUN_140148610(param_1 + 0x46);
  }
  uVar29 = 0;
  local_398 = 0;
  if ((DAT_14060b7c0 & 1) == 0) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
  }
  if ((DAT_140609ec0 == 0x68) || (DAT_140609ec0 == 0xcc)) {
LAB_1401351bf:
    uVar29 = 1;
    local_398 = 1;
  }
  else {
    lVar10 = FUN_1404186a0();
    if ((*(int *)(lVar10 + 0x250) == 0xcc) || (*(int *)(lVar10 + 0x250) == 0x68))
    goto LAB_1401351bf;
  }
  local_3a8 = uVar29;
  FUN_1401324d0(param_1,lVar9,lVar8,0);
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST_WEAPON_STRING");
  lVar9 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST_WEAPON");
  if ((lVar9 != 0) && (lVar8 != 0)) {
    local_3a8 = uVar29;
    FUN_1401324d0(param_1,lVar9,lVar8,0);
  }
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST_ARMOR_STRING");
  lVar9 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST_ARMOR");
  if ((lVar9 != 0) && (lVar8 != 0)) {
    local_3a8 = uVar29;
    FUN_1401324d0(param_1,lVar9,lVar8,0);
  }
  puVar11 = (uint *)FUN_1402933b0(DAT_140607ff0,L"itempreview");
  if (puVar11 == (uint *)0x0) {
    return;
  }
  puVar26 = (uint *)0x0;
  puVar14 = puVar26;
  local_378 = puVar11;
  if ((*(longlong *)(puVar11 + 0x1c) != 0) && (puVar11[0x1e] != 0)) {
    puVar12 = puVar26;
    plVar19 = *(longlong **)(puVar11 + 0x1a);
    do {
      if (*plVar19 != 0) {
        puVar14 = (uint *)(*(longlong **)(puVar11 + 0x1a))[(longlong)puVar12];
        break;
      }
      uVar4 = (int)puVar12 + 1;
      puVar12 = (uint *)(ulonglong)uVar4;
      plVar19 = plVar19 + 1;
    } while (uVar4 < puVar11[0x1e]);
  }
LAB_1401352ca:
  local_388 = puVar14;
  if (puVar14 != (uint *)0x0) {
    uVar4 = *puVar14;
    local_350 = (uint *)0x0;
    local_348 = (uint *)0x0;
    local_340 = (uint *)0x0;
    local_360 = (undefined2)uVar4;
    uStack_35e = (undefined2)(uVar4 >> 0x10);
    local_38c = uVar4;
    uVar5 = FUN_1402970c0(puVar11,L"nPreViewItemID");
    local_3a8 = 1;
    puVar13 = (undefined4 *)FUN_140296600(puVar11,uVar4,uVar5,L"nPreViewItemID");
    uVar5 = *puVar13;
    uStack_35c = uVar5;
    uVar6 = FUN_1402970c0(puVar11,L"nPreViewClass");
    local_3a8 = 1;
    puVar14 = (uint *)FUN_140296600(puVar11,uVar4,uVar6,L"nPreViewClass");
    local_394 = *puVar14;
    local_358 = local_394;
    uVar6 = FUN_1402970c0(puVar11,L"szPreViewClass");
    local_3a8 = 0;
    psVar15 = (short *)FUN_140296990(puVar11,uVar4,uVar6,L"szPreViewClass");
    puVar14 = puVar26;
    uVar24 = local_394;
    if (psVar15 != (short *)0x0) {
      local_318[0] = (void *)0x7;
      local_320 = 0;
      local_330 = 0;
      uVar17 = 0xffffffffffffffff;
      psVar16 = psVar15;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar16;
        psVar16 = psVar16 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_330,psVar15,~uVar17 - 1);
      local_2f8 = (wchar_t *)0x0;
      local_2f0 = (wchar_t *)0x0;
      local_2e8 = 0;
      puVar21 = &local_330;
      if ((void *)0x7 < local_318[0]) {
        puVar21 = (undefined2 *)CONCAT44(uStack_32c,CONCAT22(uStack_32e,local_330));
      }
      FUN_140415930(&local_2f8,puVar21,&DAT_14049c7b8);
      local_390 = 0;
      local_370 = ((longlong)local_2f0 - (longlong)local_2f8) / 0x28;
      puVar12 = puVar26;
      puVar22 = puVar26;
      puVar23 = puVar26;
      param_1 = puVar26;
      pwVar28 = local_2f8;
      uVar24 = local_394;
      if (local_370 != 0) {
        do {
          pwVar18 = pwVar28;
          if (7 < *(ulonglong *)(pwVar28 + 0xc)) {
            pwVar18 = *(wchar_t **)pwVar28;
          }
          uVar4 = _wtoi(pwVar18);
          puVar14 = puVar23;
          local_394 = uVar4;
          if ((&local_394 < puVar12) && (puVar23 <= &local_394)) {
            if (puVar12 == param_1) {
              uVar17 = (longlong)puVar12 - (longlong)puVar23 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                (*pcVar3)();
                return;
              }
              puVar11 = (uint *)(uVar17 + 1);
              puVar22 = (uint *)((longlong)param_1 - (longlong)puVar23 >> 2);
              if (puVar22 < puVar11) {
                puVar14 = puVar26;
                if (puVar22 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar14 = (uint *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar14 < puVar11) {
                  puVar14 = puVar11;
                }
                FUN_140051e60(&local_350,puVar14);
                puVar12 = local_348;
                puVar14 = local_350;
                param_1 = local_340;
              }
            }
            if (puVar12 != (uint *)0x0) {
              *puVar12 = puVar14[(longlong)&local_394 - (longlong)puVar23 >> 2];
            }
          }
          else {
            uVar24 = (uint)puVar22;
            if (puVar12 == param_1) {
              uVar17 = (longlong)puVar12 - (longlong)puVar23 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_140135703;
              }
              puVar11 = (uint *)(uVar17 + 1);
              puVar23 = (uint *)((longlong)param_1 - (longlong)puVar23 >> 2);
              if (puVar23 < puVar11) {
                puVar14 = puVar26;
                if (puVar23 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar23 >> 1))) {
                  puVar14 = (uint *)((longlong)puVar23 + ((ulonglong)puVar23 >> 1));
                }
                if (puVar14 < puVar11) {
                  puVar14 = puVar11;
                }
                FUN_140051e60(&local_350,puVar14);
                puVar12 = local_348;
                puVar14 = local_350;
                param_1 = local_340;
                uVar24 = local_390;
              }
            }
            local_390 = uVar24;
            if (puVar12 != (uint *)0x0) {
              *puVar12 = uVar4;
            }
          }
          local_348 = puVar12 + 1;
          local_390 = local_390 + 1;
          puVar12 = local_348;
          puVar22 = (uint *)(ulonglong)local_390;
          puVar23 = puVar14;
          puVar11 = local_378;
          pwVar28 = pwVar28 + 0x14;
          uVar5 = uStack_35c;
          uVar24 = local_358;
        } while (local_390 < local_370);
      }
      pwVar18 = local_2f0;
      pwVar28 = local_2f8;
      if (local_2f8 != (wchar_t *)0x0) {
        for (; pwVar28 != pwVar18; pwVar28 = pwVar28 + 0x14) {
          if (7 < *(ulonglong *)(pwVar28 + 0xc)) {
            operator_delete(*(void **)pwVar28);
          }
          pwVar28[0xc] = L'\a';
          pwVar28[0xd] = L'\0';
          pwVar28[0xe] = L'\0';
          pwVar28[0xf] = L'\0';
          pwVar28[8] = L'\0';
          pwVar28[9] = L'\0';
          pwVar28[10] = L'\0';
          pwVar28[0xb] = L'\0';
          *pwVar28 = L'\0';
        }
        operator_delete(local_2f8);
      }
      uVar4 = local_38c;
      if ((void *)0x7 < local_318[0]) {
        operator_delete((void *)CONCAT44(uStack_32c,CONCAT22(uStack_32e,local_330)));
        uVar4 = local_38c;
      }
    }
    local_330 = (undefined2)uVar4;
    uStack_32e = (undefined2)(uVar4 >> 0x10);
    uVar6 = CONCAT22(uStack_35e,local_360);
    local_320 = CONCAT44(local_320._4_4_,uVar24);
    local_328 = uVar6;
    local_324 = uVar5;
    FUN_14012e520(local_318,&local_350);
    param_1 = local_380;
    FUN_140148700(local_380 + 0x58,CONCAT22(uStack_32e,local_330),&local_328);
    if (local_318[0] != (void *)0x0) {
      operator_delete(local_318[0]);
    }
    local_330 = (undefined2)uVar5;
    uStack_32e = (undefined2)((uint)uVar5 >> 0x10);
    local_320 = CONCAT44(local_320._4_4_,uVar24);
    local_328 = uVar6;
    local_324 = uVar5;
    FUN_14012e520(local_318,&local_350);
    FUN_140148700(param_1 + 0x6a);
    if (local_318[0] != (void *)0x0) {
      operator_delete(local_318[0]);
    }
    if (puVar14 != (uint *)0x0) {
      operator_delete(puVar14);
    }
    puVar14 = *(uint **)(local_388 + 6);
    if (puVar14 == (uint *)0x0) {
      uVar4 = local_388[8] % puVar11[0x1e] + 1;
      lVar8 = (longlong)(int)uVar4 << 3;
      puVar14 = puVar26;
      do {
        if (puVar11[0x1e] <= uVar4) break;
        if (*(longlong *)(*(longlong *)(puVar11 + 0x1a) + lVar8) != 0) {
          puVar14 = *(uint **)(*(longlong *)(puVar11 + 0x1a) + lVar8);
        }
        uVar4 = uVar4 + 1;
        lVar8 = lVar8 + 8;
      } while (puVar14 == (uint *)0x0);
    }
    goto LAB_1401352ca;
  }
LAB_140135703:
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_COSTUME_LIST_STRING");
  if (lVar8 == 0) {
    return;
  }
  lVar9 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST_COSTUME");
  uVar27 = 0;
  if ((DAT_14060b7c0 & 1) == 0) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
  }
  if ((DAT_140609ec0 != 0x65) && (DAT_140609ec0 != 0xc9)) {
    lVar10 = FUN_1404186a0();
    if ((*(int *)(lVar10 + 0x250) != 0xc9) && (*(int *)(lVar10 + 0x250) != 0x65)) {
      lVar10 = FUN_140418650();
      if ((*(int *)(lVar10 + 0x1e0) != 0x67) && (*(int *)(lVar10 + 0x1e0) != 0xcb)) {
        lVar10 = FUN_1404186a0();
        if ((*(int *)(lVar10 + 0x250) != 0xcb) && (*(int *)(lVar10 + 0x250) != 0x67))
        goto LAB_1401357bc;
      }
    }
  }
  uVar27 = 1;
LAB_1401357bc:
  uVar29 = local_398;
  if (lVar9 != 0) {
    local_3a8 = local_398;
    FUN_1401324d0(param_1,lVar9,lVar8,uVar27);
  }
  if ((DAT_14060b7c0 & 1) == 0) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
  }
  if ((DAT_140609ec0 == 1000) || (lVar8 = FUN_1404186a0(), *(int *)(lVar8 + 0x250) == 1000)) {
    lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST_MKY_STRING");
    if (lVar8 == 0) {
      return;
    }
    lVar9 = FUN_1402933b0(DAT_140607ff0,L"ITEM_LIST_MKY");
    if (lVar9 != 0) {
      local_3a8 = uVar29;
      FUN_1401324d0(param_1,lVar9,lVar8,0);
    }
  }
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_OPTION_LIST");
  if (lVar8 != 0) {
    puVar11 = puVar26;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar14 = puVar26;
      plVar19 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar19 != 0) {
          puVar11 = (uint *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar14];
          break;
        }
        uVar4 = (int)puVar14 + 1;
        puVar14 = (uint *)(ulonglong)uVar4;
        plVar19 = plVar19 + 1;
      } while (uVar4 < *(uint *)(lVar8 + 0x78));
    }
LAB_1401358c0:
    puVar14 = puVar11;
    if (puVar14 != (uint *)0x0) {
      uVar4 = *puVar14;
      local_2a8 = 7;
      local_2b0 = 0;
      local_2c0 = 0;
      local_280 = 7;
      local_288 = 0;
      local_298 = 0;
      local_2c8 = uVar4;
      uVar5 = FUN_1402970c0(lVar8,L"wszDesc");
      local_3a8 = 1;
      psVar16 = (short *)FUN_140296b70(lVar8,uVar4,uVar5,L"wszDesc");
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar16;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_2c0,psVar16,~uVar17 - 1);
      uVar5 = FUN_1402970c0(lVar8,L"wszDescNoColor");
      local_3a8 = 1;
      psVar16 = (short *)FUN_140296b70(lVar8,uVar4,uVar5,L"wszDescNoColor");
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar16;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_298,psVar16,~uVar17 - 1);
      if (local_2b0 == 0) {
        FUN_140001710(&local_2c0,L"empty desc",10);
        FUN_140001710(&local_298,L"empty desc",10);
      }
      uVar5 = FUN_1402970c0(lVar8,L"nActivityCondition");
      local_3a8 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar8,uVar4,uVar5,L"nActivityCondition");
      local_268 = *puVar13;
      uVar5 = FUN_1402970c0(lVar8,L"nSecTime");
      local_3a8 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar8,uVar4,uVar5,L"nSecTime");
      local_264 = *puVar13;
      uVar5 = FUN_1402970c0(lVar8,L"fValue");
      local_3a8 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar8,uVar4,uVar5,L"fValue");
      local_260 = *puVar13;
      uVar5 = FUN_1402970c0(lVar8,L"nCheckMinValue");
      local_3a8 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar8,uVar4,uVar5,L"nCheckMinValue");
      local_25c = *puVar13;
      uVar5 = FUN_1402970c0(lVar8,L"nCheckMaxValue");
      local_3a8 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar8,uVar4,uVar5,L"nCheckMaxValue");
      local_258 = *puVar13;
      uVar5 = FUN_1402970c0(lVar8,L"nClass");
      local_3a8 = 1;
      puVar11 = (uint *)FUN_140296600(lVar8,uVar4,uVar5,L"nClass");
      local_270 = *puVar11;
      uVar5 = FUN_1402970c0(lVar8,L"nSkillID");
      local_3a8 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar8,uVar4,uVar5);
      local_26c = *puVar13;
      local_378 = local_240;
      local_240[0] = local_2c8;
      local_220 = 7;
      local_228 = 0;
      local_238[0] = 0;
      local_248[0] = uVar4;
      FUN_1400015e0(local_238,&local_2c0,0,0xffffffffffffffff);
      local_1f8 = 7;
      local_200 = 0;
      local_210[0] = 0;
      FUN_1400015e0(local_210,&local_298,0,0xffffffffffffffff);
      param_1 = local_380;
      local_1e8 = local_270;
      local_1e4 = local_26c;
      local_1e0 = local_268;
      local_1dc = local_264;
      local_1d8 = CONCAT44(local_25c,local_260);
      local_1d0 = CONCAT44(local_1d0._4_4_,local_258);
      FUN_140148380(local_380 + 0x34);
      FUN_140136590(local_240);
      if (7 < local_280) {
        operator_delete((void *)CONCAT62(uStack_296,local_298));
      }
      local_280 = 7;
      local_288 = 0;
      local_298 = 0;
      if (7 < local_2a8) {
        operator_delete((void *)CONCAT62(uStack_2be,local_2c0));
      }
      local_2a8 = 7;
      local_2b0 = 0;
      local_2c0 = 0;
      puVar11 = *(uint **)(puVar14 + 6);
      if (*(uint **)(puVar14 + 6) == (uint *)0x0) {
        uVar4 = puVar14[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar9 = (longlong)(int)uVar4 << 3;
        puVar11 = puVar26;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar4) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar9) != 0) {
            puVar11 = *(uint **)(*(longlong *)(lVar8 + 0x68) + lVar9);
          }
          uVar4 = uVar4 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar11 == (uint *)0x0);
      }
      goto LAB_1401358c0;
    }
    lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_FIELD_MESH");
    if (lVar8 != 0) {
      puVar11 = puVar26;
      if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
        puVar14 = puVar26;
        plVar19 = *(longlong **)(lVar8 + 0x68);
        do {
          if (*plVar19 != 0) {
            puVar11 = (uint *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar14];
            break;
          }
          uVar4 = (int)puVar14 + 1;
          puVar14 = (uint *)(ulonglong)uVar4;
          plVar19 = plVar19 + 1;
        } while (uVar4 < *(uint *)(lVar8 + 0x78));
      }
LAB_140135cd0:
      puVar14 = puVar11;
      if (puVar14 != (uint *)0x0) {
        uVar4 = *puVar14;
        local_228 = 7;
        local_230 = 0;
        local_240[0] = local_240[0] & 0xffff0000;
        local_200 = 7;
        local_208 = 0;
        local_218 = 0;
        local_1d0 = 7;
        local_1d8 = 0;
        local_1e8 = local_1e8 & 0xffff0000;
        local_1a8 = 7;
        local_1b0 = 0;
        local_1c0[0] = 0;
        local_180 = 7;
        local_188 = 0;
        local_198 = 0;
        local_158 = 7;
        local_160 = 0;
        local_170 = 0;
        local_318[0] = (void *)0x7;
        local_320 = 0;
        local_330 = 0;
        local_348 = (uint *)0x7;
        local_350 = (uint *)0x0;
        local_360 = 0;
        local_2e0 = 7;
        local_2e8 = 0;
        local_2f8 = (wchar_t *)((ulonglong)local_2f8 & 0xffffffffffff0000);
        if (DAT_140607be1 == '\0') {
          if ((DAT_140607c18 == (uint *)0x0) &&
             (puVar11 = operator_new(0x28), DAT_140607c18 = puVar26, puVar11 != (uint *)0x0)) {
            puVar11[6] = 7;
            puVar11[7] = 0;
            puVar11[4] = 0;
            puVar11[5] = 0;
            *(undefined2 *)puVar11 = 0;
            DAT_140607c18 = puVar11;
          }
          FUN_1400015e0(&local_330,DAT_140607c18,0,0xffffffffffffffff);
          FUN_140002aa0(&local_330,&DAT_14049a36c,1);
          if ((DAT_140607c18 == (uint *)0x0) &&
             (puVar11 = operator_new(0x28), DAT_140607c18 = puVar26, puVar11 != (uint *)0x0)) {
            puVar11[6] = 7;
            puVar11[7] = 0;
            puVar11[4] = 0;
            puVar11[5] = 0;
            *(undefined2 *)puVar11 = 0;
            DAT_140607c18 = puVar11;
          }
          FUN_1400015e0(&local_360,DAT_140607c18,0,0xffffffffffffffff);
          FUN_140002aa0(&local_360,&DAT_14049a36c,1);
          if ((DAT_140607c18 == (uint *)0x0) &&
             (puVar11 = operator_new(0x28), DAT_140607c18 = puVar26, puVar11 != (uint *)0x0)) {
            puVar11[6] = 7;
            puVar11[7] = 0;
            puVar11[4] = 0;
            puVar11[5] = 0;
            *(undefined2 *)puVar11 = 0;
            DAT_140607c18 = puVar11;
          }
          FUN_1400015e0(&local_2f8,DAT_140607c18,0,0xffffffffffffffff);
          FUN_140002aa0(&local_2f8,&DAT_14049a36c,1);
        }
        local_248[0] = uVar4;
        uVar5 = FUN_1402970c0(lVar8,L"wszDesc");
        local_3a8 = 1;
        psVar16 = (short *)FUN_140296b70(lVar8,uVar4,uVar5,L"wszDesc");
        uVar17 = 0xffffffffffffffff;
        psVar15 = psVar16;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_240,psVar16,~uVar17 - 1);
        uVar5 = FUN_1402970c0(lVar8,L"fHeadPos");
        local_3a8 = 1;
        puVar13 = (undefined4 *)FUN_1402967b0(lVar8,uVar4,uVar5,L"fHeadPos");
        local_1f0 = *puVar13;
        uVar5 = FUN_1402970c0(lVar8,L"szDropAni");
        local_3a8 = 1;
        psVar16 = (short *)FUN_140296990(lVar8,uVar4,uVar5,L"szDropAni");
        uVar17 = 0xffffffffffffffff;
        psVar15 = psVar16;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_1e8,psVar16,~uVar17 - 1);
        uVar5 = FUN_1402970c0(lVar8,L"szStayAni");
        local_3a8 = 1;
        psVar16 = (short *)FUN_140296990(lVar8,uVar4,uVar5,L"szStayAni");
        uVar17 = 0xffffffffffffffff;
        psVar15 = psVar16;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_1c0,psVar16,~uVar17 - 1);
        uVar5 = FUN_1402970c0(lVar8,L"szMdata");
        local_3a8 = 1;
        psVar16 = (short *)FUN_140296990(lVar8,uVar4,uVar5,L"szMdata");
        uVar17 = 0xffffffffffffffff;
        psVar15 = psVar16;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_218,psVar16,~uVar17 - 1);
        if (local_208 != 0) {
          FUN_140002c00(&local_330,&local_218,0,0xffffffffffffffff);
          FUN_1400015e0(&local_218,&local_330,0,0xffffffffffffffff);
        }
        uVar5 = FUN_1402970c0(lVar8,L"szDropSound");
        local_3a8 = 1;
        psVar16 = (short *)FUN_140296990(lVar8,uVar4,uVar5,L"szDropSound");
        uVar17 = 0xffffffffffffffff;
        psVar15 = psVar16;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_198,psVar16,~uVar17 - 1);
        if (local_188 != 0) {
          FUN_140002c00(&local_360,&local_198,0,0xffffffffffffffff);
          FUN_1400015e0(&local_198,&local_360,0,0xffffffffffffffff);
        }
        uVar5 = FUN_1402970c0(lVar8,L"szStaySound");
        local_3a8 = 1;
        psVar16 = (short *)FUN_140296990(lVar8,uVar4,uVar5);
        uVar17 = 0xffffffffffffffff;
        psVar15 = psVar16;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_170,psVar16,~uVar17 - 1);
        if (local_160 != 0) {
          FUN_140002c00(&local_2f8,&local_170,0);
          FUN_1400015e0(&local_170,&local_2f8,0,0xffffffffffffffff);
        }
        puVar20 = &local_218;
        if (7 < local_200) {
          puVar20 = (ushort *)CONCAT62(uStack_216,local_218);
        }
        puVar1 = puVar20 + local_208;
        puVar25 = &local_218;
        if (7 < local_200) {
          puVar25 = (ushort *)CONCAT62(uStack_216,local_218);
        }
        if (puVar25 != puVar1) {
          lVar9 = (longlong)puVar20 - (longlong)puVar25;
          do {
            iVar7 = tolower((uint)*puVar25);
            *(short *)(lVar9 + (longlong)puVar25) = (short)iVar7;
            puVar25 = puVar25 + 1;
          } while (puVar25 != puVar1);
        }
        puVar20 = &local_198;
        if (7 < local_180) {
          puVar20 = (ushort *)CONCAT62(uStack_196,local_198);
        }
        puVar1 = puVar20 + local_188;
        puVar25 = &local_198;
        if (7 < local_180) {
          puVar25 = (ushort *)CONCAT62(uStack_196,local_198);
        }
        if (puVar25 != puVar1) {
          lVar9 = (longlong)puVar20 - (longlong)puVar25;
          do {
            iVar7 = tolower((uint)*puVar25);
            *(short *)(lVar9 + (longlong)puVar25) = (short)iVar7;
            puVar25 = puVar25 + 1;
          } while (puVar25 != puVar1);
        }
        puVar20 = &local_170;
        if (7 < local_158) {
          puVar20 = (ushort *)CONCAT62(uStack_16e,local_170);
        }
        puVar1 = puVar20 + local_160;
        puVar25 = &local_170;
        if (7 < local_158) {
          puVar25 = (ushort *)CONCAT62(uStack_16e,local_170);
        }
        if (puVar25 != puVar1) {
          lVar9 = (longlong)puVar20 - (longlong)puVar25;
          do {
            iVar7 = tolower((uint)*puVar25);
            *(short *)(lVar9 + (longlong)puVar25) = (short)iVar7;
            puVar25 = puVar25 + 1;
          } while (puVar25 != puVar1);
        }
        local_148 = uVar4;
        FUN_1401508c0(local_140,local_248);
        param_1 = local_380;
        FUN_140148540(local_380 + 0x46);
        FUN_140136600(local_140);
        if (7 < local_2e0) {
          operator_delete(local_2f8);
        }
        local_2e0 = 7;
        local_2e8 = 0;
        local_2f8 = (wchar_t *)((ulonglong)local_2f8 & 0xffffffffffff0000);
        if (7 < local_348) {
          operator_delete((void *)CONCAT44(uStack_35c,CONCAT22(uStack_35e,local_360)));
        }
        local_348 = (uint *)0x7;
        local_350 = (uint *)0x0;
        local_360 = 0;
        if ((void *)0x7 < local_318[0]) {
          operator_delete((void *)CONCAT44(uStack_32c,CONCAT22(uStack_32e,local_330)));
        }
        local_318[0] = (void *)0x7;
        local_320 = 0;
        local_330 = 0;
        FUN_140136600(local_248);
        puVar11 = *(uint **)(puVar14 + 6);
        if (*(uint **)(puVar14 + 6) == (uint *)0x0) {
          uVar4 = puVar14[8] % *(uint *)(lVar8 + 0x78) + 1;
          lVar9 = (longlong)(int)uVar4 << 3;
          puVar11 = puVar26;
          do {
            if (*(uint *)(lVar8 + 0x78) <= uVar4) break;
            if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar9) != 0) {
              puVar11 = *(uint **)(*(longlong *)(lVar8 + 0x68) + lVar9);
            }
            uVar4 = uVar4 + 1;
            lVar9 = lVar9 + 8;
          } while (puVar11 == (uint *)0x0);
        }
        goto LAB_140135cd0;
      }
      if ((DAT_14060b7c0 & 1) == 0) {
        DAT_14060b7c0 = DAT_14060b7c0 | 1;
        FUN_140417410();
        atexit((_func_5014 *)&LAB_140448480);
      }
      if (DAT_140609ec0 == 1000) {
        puVar11 = param_1 + 0x8e;
        lVar8 = 0xc;
        do {
          FUN_14014d680(*(longlong *)puVar11,*(longlong *)(puVar11 + 2),
                        *(longlong *)(puVar11 + 2) - *(longlong *)puVar11 >> 3,0);
          puVar14 = (uint *)(*(longlong *)(puVar11 + 2) - *(longlong *)puVar11 >> 3);
          if (puVar14 != (uint *)0x0) {
            plVar19 = *(longlong **)puVar11;
            puVar12 = puVar26;
            iVar7 = DAT_140607c28;
            do {
              DAT_140607c28 = *(int *)(*plVar19 + 0x100);
              if (iVar7 != DAT_140607c28) {
                DAT_1405e1090 = 1;
              }
              DAT_1405e1090 = DAT_1405e1090 + 1;
              puVar12 = (uint *)(ulonglong)((int)puVar12 + 1);
              plVar19 = plVar19 + 1;
              iVar7 = DAT_140607c28;
            } while (puVar12 < puVar14);
          }
          puVar11 = puVar11 + 8;
          lVar8 = lVar8 + -1;
        } while (lVar8 != 0);
        param_1 = param_1 + 0xee;
        lVar8 = 4;
        do {
          FUN_14014d7c0(*(longlong *)param_1,*(longlong *)(param_1 + 2),
                        *(longlong *)(param_1 + 2) - *(longlong *)param_1 >> 3,0);
          puVar11 = (uint *)(*(longlong *)(param_1 + 2) - *(longlong *)param_1 >> 3);
          if (puVar11 != (uint *)0x0) {
            plVar19 = *(longlong **)param_1;
            puVar14 = puVar26;
            iVar7 = DAT_140607be4;
            do {
              DAT_140607be4 = *(int *)(*plVar19 + 0x108);
              if (iVar7 != DAT_140607be4) {
                DAT_1405e1038 = 1;
              }
              DAT_1405e1038 = DAT_1405e1038 + 1;
              puVar14 = (uint *)(ulonglong)((int)puVar14 + 1);
              plVar19 = plVar19 + 1;
              iVar7 = DAT_140607be4;
            } while (puVar14 < puVar11);
          }
          param_1 = param_1 + 8;
          lVar8 = lVar8 + -1;
        } while (lVar8 != 0);
      }
    }
  }
  return;
}



void FUN_140136530(longlong param_1)

{
  if (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_140136560(longlong param_1)

{
  if (*(void **)(param_1 + 0x18) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x18));
  }
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  return;
}



void FUN_140136590(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_1401365f0(longlong param_1)

{
  FUN_140136590(param_1 + 8);
  return;
}



void FUN_140136600(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0xf0)) {
    operator_delete(*(void **)(param_1 + 0xd8));
  }
  *(undefined8 *)(param_1 + 0xf0) = 7;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined2 *)(param_1 + 0xd8) = 0;
  if (7 < *(ulonglong *)(param_1 + 200)) {
    operator_delete(*(void **)(param_1 + 0xb0));
  }
  *(undefined8 *)(param_1 + 200) = 7;
  *(undefined8 *)(param_1 + 0xc0) = 0;
  *(undefined2 *)(param_1 + 0xb0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xa0)) {
    operator_delete(*(void **)(param_1 + 0x88));
  }
  *(undefined8 *)(param_1 + 0xa0) = 7;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined2 *)(param_1 + 0x88) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x78)) {
    operator_delete(*(void **)(param_1 + 0x60));
  }
  *(undefined8 *)(param_1 + 0x78) = 7;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined2 *)(param_1 + 0x60) = 0;
  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_140136710(longlong param_1)

{
  FUN_140136600(param_1 + 8);
  return;
}



undefined8 FUN_140136720(longlong param_1,uint param_2)

{
  uint *puVar1;
  bool bVar2;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        bVar2 = puVar1 == (uint *)0x0;
        if (!bVar2) goto LAB_140136764;
        break;
      }
    }
  }
  puVar1 = (uint *)0x0;
  bVar2 = true;
LAB_140136764:
  return CONCAT71((int7)((ulonglong)puVar1 >> 8),!bVar2);
}



uint * FUN_140136770(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)0x0;
        }
        return puVar1 + 2;
      }
    }
  }
  return (uint *)0x0;
}



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

uint * FUN_1401367c0(longlong param_1,uint param_2)

{
  undefined8 uVar1;
  uint *puVar2;
  uint *puVar3;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xa6)) {
      if ((puVar2[0xa8] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 != (uint *)0x0) {
          puVar3 = puVar2 + 4;
          if (7 < *(ulonglong *)(puVar2 + 10)) {
            puVar3 = *(uint **)puVar3;
          }
          return puVar3;
        }
        break;
      }
    }
  }
  if (param_2 != 1) {
    if ((DAT_14060cee8 & 1) == 0) {
      DAT_14060cee8 = DAT_14060cee8 | 1;
      DAT_14060ced8 = 7;
      _DAT_14060ced0 = 0;
      DAT_14060cec0._0_2_ = 0;
      atexit(FUN_140448630);
    }
    FUN_1404155d0(&DAT_14060cec0,L"uk_%d",(ulonglong)param_2);
    puVar2 = (uint *)&DAT_14060cec0;
    if (7 < DAT_14060ced8) {
      puVar2 = (uint *)CONCAT62(DAT_14060cec0._2_6_,(undefined2)DAT_14060cec0);
    }
    return puVar2;
  }
  uVar1 = FUN_140160a70();
  puVar2 = (uint *)FUN_140160960(uVar1,0x40b);
  return puVar2;
}



uint FUN_1401368c0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x32];
      }
    }
  }
  return 0;
}



uint FUN_140136910(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x33];
      }
    }
  }
  return 0;
}



undefined8 FUN_140136960(longlong param_1,uint param_2)

{
  uint uVar1;
  uint *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0;
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xa6)) {
      if ((puVar2[0xa8] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 == (uint *)0x0) {
          return 0;
        }
        uVar1 = puVar2[0x46];
        if ((((uVar1 == 1) || (uVar1 == 0x1d)) || (uVar1 == 0x29)) || (uVar1 == 0x2b)) {
          uVar3 = 1;
        }
        return uVar3;
      }
    }
  }
  return 0;
}



uint FUN_1401369d0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x46];
      }
    }
  }
  return 0;
}



uint FUN_140136a20(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x44];
      }
    }
  }
  return 0;
}



uint FUN_140136a70(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 1;
        }
        return puVar1[0x4c];
      }
    }
  }
  return 1;
}



uint FUN_140136ad0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 1;
        }
        return puVar1[0x5b];
      }
    }
  }
  return 1;
}



uint FUN_140136b30(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (param_2 == 0) {
    return 0;
  }
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          return puVar1[0x39];
        }
        break;
      }
    }
  }
  if (param_2 != 1) {
    FUN_1400050f0(L"GetInventoryType Miss : %d",(ulonglong)param_2);
  }
  return 0xfffffffd;
}



uint FUN_140136bb0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 1;
        }
        return puVar1[0x52];
      }
    }
  }
  return 1;
}



uint FUN_140136c10(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 1;
        }
        return puVar1[0x3d];
      }
    }
  }
  return 1;
}



uint FUN_140136c70(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 1;
        }
        return puVar1[0x5e];
      }
    }
  }
  return 1;
}



uint FUN_140136cd0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 1;
        }
        return puVar1[0x5d];
      }
    }
  }
  return 1;
}



uint * FUN_140136d30(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)0x0;
        }
        return puVar1 + 0x4e;
      }
    }
  }
  return (uint *)0x0;
}



uint FUN_140136d80(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x35];
      }
    }
  }
  return 0;
}



uint FUN_140136dd0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x36];
      }
    }
  }
  return 0;
}



uint FUN_140136e20(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x40];
      }
    }
  }
  return 0;
}



uint FUN_140136e70(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x41];
      }
    }
  }
  return 0;
}



uint FUN_140136ec0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x79];
      }
    }
  }
  return 0;
}



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

float * FUN_140136f10(longlong param_1,uint param_2,float *param_3,longlong param_4,float *param_5,
                     int param_6,int param_7)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  uint *puVar6;
  int iVar7;
  float fVar8;
  __time64_t _Var9;
  undefined8 uVar10;
  float *pfVar11;
  float **ppfVar12;
  float *pfVar13;
  int iVar14;
  longlong lVar15;
  uint uVar16;
  longlong lVar17;
  undefined1 auStack_c8 [32];
  uint local_a8;
  uint local_a0;
  uint local_98;
  longlong local_90;
  float *local_88;
  float *local_78;
  undefined4 local_70 [2];
  float *local_68;
  float local_60 [4];
  ulonglong local_50;
  
  local_50 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  local_78 = param_5;
  if (*(longlong *)(param_1 + 0x88) != 0) {
    param_5 = (float *)((ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 0x98));
    for (puVar6 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xa6)) {
      if ((puVar6[0xa8] == param_2) && (*puVar6 == param_2)) {
        if (puVar6 == (uint *)0x0) {
          return param_5;
        }
        if (0.0 < (float)puVar6[0x7a]) {
          return param_5;
        }
        uVar1 = puVar6[0x35];
        if ((((uVar1 != 2) && (uVar1 != 5)) && (uVar1 != 4)) && (uVar1 != 6)) {
          if (puVar6[0x32] != 0x3c) {
            return param_5;
          }
          if (puVar6[0x33] != 100) {
            return param_5;
          }
        }
        local_68 = param_3;
        _Var9 = _time64((__time64_t *)0x0);
        srand((uint)_Var9);
        uVar16 = puVar6[0x61];
        if (param_6 != 1) {
          if (param_6 == 2) {
            uVar16 = puVar6[0x62];
          }
          else if (param_6 == 3) {
            uVar16 = puVar6[99];
          }
          else if (param_6 == 4) {
            uVar16 = puVar6[100];
          }
        }
        uVar2 = puVar6[0x44];
        uVar3 = puVar6[0x32];
        uVar4 = puVar6[0x33];
        if (param_7 == 0) {
          uVar5 = puVar6[0x65];
          iVar14 = (puVar6[0x66] - uVar5) + 1;
          param_7 = 0;
          if (iVar14 != 0) {
            iVar7 = rand();
            param_7 = uVar5 + iVar7 % iVar14;
          }
        }
        local_60[0] = 0.0;
        local_60[1] = 0.0;
        local_60[2] = 0.0;
        uVar10 = FUN_140162270();
        local_88 = local_60;
        local_a8 = uVar1;
        local_a0 = uVar3;
        local_98 = uVar4;
        local_90 = param_4;
        fVar8 = (float)FUN_140161d60(uVar10,param_7,uVar16,uVar2);
        *local_68 = fVar8;
        iVar14 = 0;
        pfVar11 = local_60;
        pfVar13 = local_60;
        lVar17 = (longlong)local_78 - (longlong)pfVar11;
        lVar15 = 3;
        do {
          iVar7 = *(int *)((param_4 - (longlong)local_60) + (longlong)pfVar13);
          if (0 < iVar7) {
            local_70[0] = 1;
            uVar10 = FUN_140162270();
            fVar8 = (float)FUN_140161c00(uVar10,iVar7,uVar2,uVar1);
            local_78 = (float *)CONCAT44(local_78._4_4_,(int)(fVar8 * *pfVar13));
            ppfVar12 = (float **)local_70;
            if (0 < (int)(fVar8 * *pfVar13)) {
              ppfVar12 = &local_78;
            }
            iVar14 = iVar14 + 1;
            pfVar11 = (float *)(ulonglong)*(uint *)ppfVar12;
            *(uint *)(lVar17 + (longlong)pfVar13) = *(uint *)ppfVar12;
          }
          pfVar13 = pfVar13 + 1;
          lVar15 = lVar15 + -1;
        } while (lVar15 != 0);
        if (iVar14 != 0) {
          return pfVar11;
        }
        *local_68 = 0.0;
        return local_68;
      }
    }
  }
  return param_5;
}



void FUN_1401371c0(longlong param_1,uint param_2,short *param_3,char *param_4)

{
  uint *puVar1;
  short sVar2;
  int iVar3;
  uint uVar4;
  ulonglong uVar5;
  uint uVar6;
  ulonglong uVar7;
  
  uVar5 = 0;
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return;
        }
        if (*(longlong *)(puVar1 + 0x82) == *(longlong *)(puVar1 + 0x84)) {
          uVar4 = puVar1[0x40];
          uVar6 = puVar1[0x3f];
          if (0 < (int)uVar4) {
            if ((int)uVar4 < 2) {
              *param_3 = (short)uVar6;
            }
            else {
              iVar3 = rand();
              *param_3 = (short)(iVar3 % (int)uVar4) + (short)uVar6;
            }
          }
          if (*param_3 == 0) {
            return;
          }
          do {
            uVar4 = rand();
            uVar4 = uVar4 & 0x80000003;
            if ((int)uVar4 < 0) {
              uVar4 = (uVar4 - 1 | 0xfffffffc) + 1;
            }
            uVar6 = (int)uVar5 + 1;
            uVar5 = (ulonglong)uVar6;
            *param_4 = (char)uVar4 + '\x01';
            param_4 = param_4 + 1;
          } while (uVar6 < (uint)(int)*param_3);
          return;
        }
        sVar2 = (short)(*(longlong *)(puVar1 + 0x84) - *(longlong *)(puVar1 + 0x82) >> 2);
        *param_3 = sVar2;
        uVar7 = uVar5;
        if (sVar2 == 0) {
          return;
        }
        do {
          uVar4 = (int)uVar7 + 1;
          *param_4 = *(char *)(uVar5 + *(longlong *)(puVar1 + 0x82));
          uVar5 = uVar5 + 4;
          uVar7 = (ulonglong)uVar4;
          param_4 = param_4 + 1;
        } while (uVar4 < (uint)(int)*param_3);
        return;
      }
    }
  }
  return;
}



uint FUN_140137300(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0xd0) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0xd0) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xe0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x20)) {
      if ((puVar1[0x22] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1b];
      }
    }
  }
  return 0;
}



uint FUN_140137350(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0xd0) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0xd0) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xe0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x20)) {
      if ((puVar1[0x22] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1c];
      }
    }
  }
  return 0;
}



int FUN_1401373a0(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  
  if ((0 < (int)param_2) && (*(longlong *)(param_1 + 0x88) != 0)) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return -1;
        }
        return (int)(((float)param_3 * 0.05 + 1.0) * (float)(int)puVar1[0x5f]);
      }
    }
  }
  return -1;
}



undefined8 FUN_140137420(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0xd0) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0xd0) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xe0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x20)) {
      if ((puVar1[0x22] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        if ((0 < (int)puVar1[0x1d]) && (0 < (int)puVar1[0x1e])) {
          if (param_3 < (int)puVar1[0x1d]) {
            return 0;
          }
          if ((int)puVar1[0x1e] < param_3) {
            return 0;
          }
        }
        return 1;
      }
    }
  }
  return 0;
}



uint FUN_140137490(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) goto LAB_1401374cf;
    }
  }
  puVar1 = (uint *)0x0;
LAB_1401374cf:
  if (puVar1 != (uint *)0x0) {
    return puVar1[0x51];
  }
  return 0;
}



uint FUN_1401374e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x18];
      }
    }
  }
  return 0;
}



undefined8 FUN_140137530(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) goto LAB_14013756f;
    }
  }
  puVar1 = (uint *)0x0;
LAB_14013756f:
  if (puVar1 != (uint *)0x0) {
    return CONCAT71((int7)((ulonglong)puVar1 >> 8),0 < (int)puVar1[0x50]);
  }
  return 0;
}



uint FUN_140137590(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) goto LAB_1401375cf;
    }
  }
  puVar1 = (uint *)0x0;
LAB_1401375cf:
  if (puVar1 != (uint *)0x0) {
    return puVar1[0x7a];
  }
  return 0;
}



uint FUN_1401375f0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) goto LAB_14013762f;
    }
  }
  puVar1 = (uint *)0x0;
LAB_14013762f:
  if (puVar1 != (uint *)0x0) {
    return puVar1[0x7e];
  }
  return 0;
}



uint FUN_140137640(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x80];
      }
    }
  }
  return 0;
}



undefined8 * FUN_140137690(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cebc & 1) == 0) {
    DAT_14060cebc = DAT_14060cebc | 1;
    FUN_140131ab0();
    atexit((_func_5014 *)&LAB_140448670);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetItemDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_14060b310;
}



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

undefined * FUN_140137720(void)

{
  undefined8 *puVar1;
  
  puVar1 = &DAT_14060930c;
  _DAT_1406092c0 = 0;
  _DAT_1406092c8 = 0;
  _DAT_1406092d0 = 0;
  _DAT_1406092d8 = 0;
  _DAT_1406092e0 = 0;
  _DAT_1406092e8 = 0;
  _DAT_1406092f0 = 0;
  _DAT_1406092f8 = 0;
  _DAT_140609300 = 0;
  _DAT_140609308 = 0;
  do {
    *puVar1 = 0;
    puVar1[1] = 0;
    puVar1 = (undefined8 *)((longlong)puVar1 + 0x14);
  } while ((longlong)puVar1 < 0x14060935c);
  return &DAT_1406092c0;
}



void FUN_1401377a0(longlong param_1,undefined4 param_2,undefined4 param_3,int param_4)

{
  undefined8 uVar1;
  undefined *puVar2;
  undefined4 uVar3;
  undefined4 *puVar4;
  undefined4 *puVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  puVar2 = (&PTR_u_nWeaponID01_1405e10c0)[param_4];
  uVar3 = FUN_1402970c0(uVar1,puVar2);
  puVar4 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar3,puVar2,1);
  puVar2 = (&PTR_u_nArmorID01_1405e1120)[param_4];
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  uVar3 = FUN_1402970c0(uVar1,puVar2);
  puVar5 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar3,puVar2,1);
  puVar2 = (&PTR_u_nAccess01_1405e1180)[param_4];
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  uVar3 = FUN_1402970c0(uVar1,puVar2);
  puVar6 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar3,puVar2,1);
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  puVar2 = (&PTR_u_nEtc01_1405e11e0)[param_4];
  uVar3 = FUN_1402970c0(uVar1,puVar2);
  puVar7 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar3,puVar2,1);
  FUN_140137e80(DAT_140608040,param_3,*puVar4,*puVar5,*puVar6,*puVar7);
  return;
}



void FUN_1401378e0(undefined8 param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"CARD_SELECT_ITEM_TYPE_RULE");
  FUN_140294650(uVar1,L"CARD_SELECT_ITEM_TYPE_RULE");
  FUN_140292e80(uVar1,L"CARD_SELECT_ITEM_TYPE_RULE",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"CARD_SELECT_ITEM_RULE");
  FUN_140294650(uVar1,L"CARD_SELECT_ITEM_RULE");
  FUN_140292e80(uVar1,L"CARD_SELECT_ITEM_RULE",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"CARD_SELECT_ITEM_LIST");
  FUN_140294650(uVar1,L"CARD_SELECT_ITEM_LIST");
  FUN_140292e80(uVar1,L"CARD_SELECT_ITEM_LIST",uVar2);
  FUN_1401379c0(param_1);
  return;
}



void FUN_1401379c0(longlong *param_1)

{
  undefined8 uVar1;
  undefined4 uVar2;
  int iVar3;
  uint uVar4;
  longlong lVar5;
  longlong lVar6;
  float *pfVar7;
  longlong *plVar8;
  int iVar9;
  int *piVar10;
  int *piVar11;
  
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"CARD_SELECT_ITEM_TYPE_RULE");
  uVar1 = DAT_140607ff0;
  *param_1 = lVar5;
  lVar5 = FUN_1402933b0(uVar1,L"CARD_SELECT_ITEM_RULE");
  uVar1 = DAT_140607ff0;
  param_1[1] = lVar5;
  lVar6 = FUN_1402933b0(uVar1,L"CARD_SELECT_ITEM_LIST");
  lVar5 = *param_1;
  param_1[2] = lVar6;
  if (((lVar5 != 0) && (param_1[1] != 0)) && (lVar6 != 0)) {
    uVar2 = FUN_1402970c0(lVar5,L"fNormal");
    pfVar7 = (float *)FUN_1402967b0(lVar5,1,uVar2,L"fNormal",1);
    lVar5 = *param_1;
    *(float *)(param_1 + 7) = *pfVar7 * 1000.0;
    uVar2 = FUN_1402970c0(lVar5,L"fMagic");
    pfVar7 = (float *)FUN_1402967b0(lVar5,1,uVar2,L"fMagic",1);
    lVar5 = *param_1;
    *(float *)((longlong)param_1 + 0x3c) = *pfVar7 * 1000.0;
    uVar2 = FUN_1402970c0(lVar5,L"fRare");
    pfVar7 = (float *)FUN_1402967b0(lVar5,1,uVar2,L"fRare",1);
    lVar5 = *param_1;
    *(float *)(param_1 + 8) = *pfVar7 * 1000.0;
    uVar2 = FUN_1402970c0(lVar5,L"fUnique");
    pfVar7 = (float *)FUN_1402967b0(lVar5,1,uVar2,L"fUnique",1);
    lVar5 = *param_1;
    *(float *)((longlong)param_1 + 0x44) = *pfVar7 * 1000.0;
    uVar2 = FUN_1402970c0(lVar5,L"fEpic");
    pfVar7 = (float *)FUN_1402967b0(lVar5,1,uVar2,L"fEpic",1);
    iVar9 = 1;
    lVar5 = 4;
    *(float *)(param_1 + 9) = *pfVar7 * 1000.0;
    plVar8 = param_1 + 10;
    do {
      lVar6 = param_1[1];
      uVar2 = FUN_1402970c0(lVar6,L"fWeapon");
      pfVar7 = (float *)FUN_1402967b0(lVar6,iVar9,uVar2,L"fWeapon",1);
      *(int *)((longlong)plVar8 + -4) = (int)(*pfVar7 * 1000.0);
      lVar6 = param_1[1];
      uVar2 = FUN_1402970c0(lVar6,L"fAccessory");
      pfVar7 = (float *)FUN_1402967b0(lVar6,iVar9,uVar2,L"fAccessory",1);
      *(int *)plVar8 = (int)(*pfVar7 * 1000.0);
      lVar6 = param_1[1];
      uVar2 = FUN_1402970c0(lVar6,L"fArmor");
      pfVar7 = (float *)FUN_1402967b0(lVar6,iVar9,uVar2,L"fArmor",1);
      *(int *)((longlong)plVar8 + 4) = (int)(*pfVar7 * 1000.0);
      lVar6 = param_1[1];
      uVar2 = FUN_1402970c0(lVar6,L"fEtc");
      pfVar7 = (float *)FUN_1402967b0(lVar6,iVar9,uVar2,L"fEtc",1);
      *(int *)(plVar8 + 1) = (int)(*pfVar7 * 1000.0);
      lVar6 = param_1[1];
      uVar2 = FUN_1402970c0(lVar6,L"fGold");
      pfVar7 = (float *)FUN_1402967b0(lVar6,iVar9,uVar2,L"fGold",1);
      iVar9 = iVar9 + 1;
      *(int *)((longlong)plVar8 + 0xc) = (int)(*pfVar7 * 1000.0);
      iVar3 = *(int *)((longlong)plVar8 + -4) + (int)*plVar8;
      *(int *)((longlong)plVar8 + 4) = *(int *)((longlong)plVar8 + 4) + iVar3;
      *(int *)plVar8 = iVar3;
      *(int *)(plVar8 + 1) = (int)plVar8[1] + *(int *)((longlong)plVar8 + 4);
      *(int *)((longlong)plVar8 + 0xc) = *(int *)((longlong)plVar8 + 0xc) + (int)plVar8[1];
      lVar5 = lVar5 + -1;
      plVar8 = (longlong *)((longlong)plVar8 + 0x14);
    } while (lVar5 != 0);
    lVar5 = param_1[2];
    if (*(longlong *)(lVar5 + 0x70) != 0) {
      uVar4 = 0;
      if (*(uint *)(lVar5 + 0x78) != 0) {
        plVar8 = *(longlong **)(lVar5 + 0x68);
        do {
          if (*plVar8 != 0) {
            piVar11 = (int *)(*(longlong **)(lVar5 + 0x68))[uVar4];
            goto LAB_140137d20;
          }
          uVar4 = uVar4 + 1;
          plVar8 = plVar8 + 1;
        } while (uVar4 < *(uint *)(lVar5 + 0x78));
      }
    }
    piVar11 = (int *)0x0;
LAB_140137d20:
    piVar10 = piVar11;
    if (piVar10 != (int *)0x0) {
      iVar9 = *piVar10;
      if (0 < iVar9) {
        FUN_1401377a0(param_1,iVar9,0,0);
        FUN_1401377a0(param_1,iVar9,1);
        FUN_1401377a0(param_1,iVar9,2);
        FUN_1401377a0(param_1,iVar9,3);
        FUN_1401377a0(param_1,iVar9,4);
        FUN_1401377a0(param_1,iVar9,5);
        FUN_1401377a0(param_1,iVar9,6);
        FUN_1401377a0(param_1,iVar9,7);
        FUN_1401377a0(param_1,iVar9,8);
        FUN_1401377a0(param_1,iVar9,9);
        FUN_1401377a0(param_1,iVar9,10);
        FUN_1401377a0(param_1,iVar9,0xb);
      }
      piVar11 = *(int **)(piVar10 + 6);
      if (piVar11 == (int *)0x0) {
        uVar4 = (uint)piVar10[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar6 = (longlong)(int)uVar4 << 3;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar4) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar6) != 0) {
            piVar11 = *(int **)(*(longlong *)(lVar5 + 0x68) + lVar6);
          }
          uVar4 = uVar4 + 1;
          lVar6 = lVar6 + 8;
        } while (piVar11 == (int *)0x0);
      }
      goto LAB_140137d20;
    }
  }
  return;
}



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

{
  longlong *plVar1;
  longlong lVar2;
  int local_res18 [2];
  int local_res20 [2];
  
  lVar2 = (longlong)param_2;
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  if (0 < param_3) {
    plVar1 = (longlong *)(lVar2 * 0x20 + 0x3c8 + param_1);
    FUN_14012e5c0(plVar1,local_res18);
    *(int *)(param_1 + 8 + lVar2 * 4) = (int)(plVar1[1] - *plVar1 >> 2);
  }
  if (0 < param_4) {
    plVar1 = (longlong *)(lVar2 * 0x20 + 0x6c8 + param_1);
    FUN_14012e5c0(plVar1,local_res20);
    *(int *)(param_1 + 0x68 + lVar2 * 4) = (int)(plVar1[1] - *plVar1 >> 2);
  }
  if (0 < param_5) {
    plVar1 = (longlong *)(lVar2 * 0x20 + 0x548 + param_1);
    FUN_14012e5c0(plVar1,&param_5);
    *(int *)(param_1 + 0x38 + lVar2 * 4) = (int)(plVar1[1] - *plVar1 >> 2);
  }
  if (0 < param_6) {
    plVar1 = (longlong *)(lVar2 * 0x20 + 0x848 + param_1);
    FUN_14012e5c0(plVar1,&param_6);
    *(int *)(param_1 + 0x98 + lVar2 * 4) = (int)(plVar1[1] - *plVar1 >> 2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140138058)
// WARNING: Removing unreachable block (ram,0x000140138061)
// WARNING: Removing unreachable block (ram,0x000140138082)
// WARNING: Removing unreachable block (ram,0x00014013808b)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140137f90(void)

{
  undefined8 in_R9;
  
  FUN_140148810(0x3f400000,0x3e800000,0x40100000,in_R9,0xfffffffffffffffe);
  DAT_1406091a8 = 0;
  _DAT_1406091b0 = 0;
  DAT_1406091b8 = 0x11;
  _DAT_1406091d8 = 0;
  _DAT_1406091dc = 10;
  _DAT_1406091e0 = 0;
  _DAT_1406091e8 = 0;
  _DAT_1406091bc = 0x3f400000;
  _DAT_1406091c0 = 0x3e800000;
  _DAT_1406091c4 = 0x40100000;
  _DAT_1406091c8 = 0x26;
  _DAT_1406091d0 = 0;
  FUN_1401380f0();
  return &DAT_140609160;
}



void thunk_FUN_140148a40(void)

{
  FUN_140148a40();
  return;
}



void thunk_FUN_140148af0(void)

{
  FUN_140148af0();
  return;
}



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

void FUN_1401380f0(void)

{
  ulonglong *puVar1;
  short sVar2;
  code *pcVar3;
  char cVar4;
  uint uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong lVar8;
  short *psVar9;
  undefined4 *puVar10;
  uint *puVar11;
  short *psVar12;
  longlong *plVar13;
  ulonglong uVar14;
  wchar_t *pwVar15;
  wchar_t *pwVar16;
  undefined4 *puVar17;
  undefined2 *puVar18;
  undefined4 *puVar19;
  undefined4 *puVar20;
  longlong lVar21;
  undefined4 *puVar22;
  undefined4 uVar23;
  wchar_t *pwVar24;
  longlong lVar25;
  longlong lVar26;
  undefined1 auStack_2f8 [32];
  undefined1 local_2d8;
  int local_2c8;
  undefined4 local_2c4;
  undefined4 *local_2c0;
  longlong local_2b8;
  wchar_t *local_2b0;
  wchar_t *local_2a8;
  undefined8 local_2a0;
  wchar_t *local_290;
  wchar_t *local_288;
  undefined8 local_280;
  undefined8 local_270;
  undefined4 local_268 [2];
  undefined2 local_260;
  undefined6 uStack_25e;
  undefined8 local_250;
  ulonglong local_248;
  int *local_238;
  int *local_230;
  int *local_228;
  undefined4 local_218;
  undefined4 local_214;
  undefined4 local_210;
  int *local_208;
  int *local_200;
  int *local_1f8;
  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;
  undefined4 local_1a4;
  uint local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined2 local_178;
  undefined6 uStack_176;
  undefined8 local_168;
  ulonglong local_160;
  undefined2 local_150;
  undefined6 uStack_14e;
  undefined8 local_140;
  ulonglong local_138;
  undefined4 local_128;
  undefined1 local_120 [8];
  void *local_118;
  ulonglong local_100;
  void *local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  void *local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  ulonglong local_38;
  
  local_270 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_2f8;
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ITEM_MIX");
  if (lVar8 != 0) {
    puVar20 = (undefined4 *)0x0;
    puVar10 = puVar20;
    local_2b8 = lVar8;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar17 = puVar20;
      plVar13 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar13 != 0) {
          puVar10 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar17];
          break;
        }
        uVar5 = (int)puVar17 + 1;
        puVar17 = (undefined4 *)(ulonglong)uVar5;
        plVar13 = plVar13 + 1;
      } while (uVar5 < *(uint *)(lVar8 + 0x78));
    }
LAB_14013818a:
    if (puVar10 != (undefined4 *)0x0) {
      uVar23 = *puVar10;
      local_248 = 7;
      local_250 = 0;
      local_260 = 0;
      local_238 = (int *)0x0;
      local_230 = (int *)0x0;
      local_228 = (int *)0x0;
      local_208 = (int *)0x0;
      local_200 = (int *)0x0;
      local_1f8 = (int *)0x0;
      local_2c4 = uVar23;
      local_2c0 = puVar10;
      local_268[0] = uVar23;
      uVar6 = FUN_1402970c0(lVar8,L"wszDesc");
      local_2d8 = 1;
      psVar9 = (short *)FUN_140296b70(lVar8,uVar23,uVar6,L"wszDesc");
      uVar14 = 0xffffffffffffffff;
      psVar12 = psVar9;
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar2 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_260,psVar9,~uVar14 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"nSortNumber");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nSortNumber");
      local_218 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nMixSubCategory");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nMixSubCategory");
      local_214 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nMixAble");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nMixAble");
      local_210 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nCost");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nCost");
      local_1e8 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"fItemMixPro00");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_1402967b0(lVar8,uVar23,uVar6,L"fItemMixPro00");
      local_1e4 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"fItemMixPro01");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_1402967b0(lVar8,uVar23,uVar6,L"fItemMixPro01");
      local_1e0 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"fItemMixPro02");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_1402967b0(lVar8,uVar23,uVar6,L"fItemMixPro02");
      local_1dc = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemMixCo00");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemMixCo00");
      local_1d8 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemMixCo01");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemMixCo01");
      local_1d4 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemMixCo02");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemMixCo02");
      local_1d0 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCode00");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCode00");
      local_1cc = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCode01");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCode01");
      local_1c8 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCode02");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCode02");
      local_1c4 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCode03");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCode03");
      local_1c0 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCode04");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCode04");
      local_1bc = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCount00");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCount00");
      local_1b8 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCount01");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCount01");
      local_1b4 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCount02");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCount02");
      local_1b0 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCount03");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCount03");
      local_1ac = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nItemCount04");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nItemCount04");
      local_1a8 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nCraftType");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nCraftType");
      local_1a4 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nCraftGroup");
      local_2d8 = 1;
      puVar11 = (uint *)FUN_140296600(lVar8,uVar23,uVar6,L"nCraftGroup");
      local_1a0 = *puVar11;
      uVar6 = FUN_1402970c0(lVar8,L"nHoldItem");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nHoldItem");
      local_19c = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nNextItem");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nNextItem");
      local_198 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nClassify00");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nClassify00");
      local_194 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nClassify01");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nClassify01");
      local_190 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nClassify02");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nClassify02");
      local_18c = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"nVisible");
      local_2d8 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar23,uVar6,L"nVisible");
      local_188 = *puVar10;
      uVar6 = FUN_1402970c0(lVar8,L"szMixCategory");
      local_2d8 = 1;
      psVar9 = (short *)FUN_140296990(lVar8,uVar23,uVar6,L"szMixCategory");
      local_160 = 7;
      local_168 = 0;
      local_178 = 0;
      uVar14 = 0xffffffffffffffff;
      psVar12 = psVar9;
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar2 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_178,psVar9,~uVar14 - 1);
      local_2b0 = (wchar_t *)0x0;
      local_2a8 = (wchar_t *)0x0;
      local_2a0 = 0;
      puVar18 = &local_178;
      if (7 < local_160) {
        puVar18 = (undefined2 *)CONCAT62(uStack_176,local_178);
      }
      FUN_140415930(&local_2b0,puVar18,&DAT_14049c7b8);
      lVar25 = (longlong)local_2a8 - (longlong)local_2b0 >> 0x3f;
      lVar26 = ((longlong)local_2a8 - (longlong)local_2b0) / 0x28 + lVar25;
      pwVar24 = local_2b0;
      puVar10 = puVar20;
      if (lVar26 != lVar25) {
        do {
          pwVar15 = pwVar24;
          if (7 < *(ulonglong *)(pwVar24 + 0xc)) {
            pwVar15 = *(wchar_t **)pwVar24;
          }
          iVar7 = _wtoi(pwVar15);
          local_2c8 = iVar7;
          if ((&local_2c8 < local_230) && (local_238 <= &local_2c8)) {
            lVar21 = (longlong)&local_2c8 - (longlong)local_238;
            if (local_230 == local_228) {
              uVar14 = (longlong)local_230 - (longlong)local_238 >> 2;
              if (0x3ffffffffffffffe < uVar14) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                (*pcVar3)();
                return;
              }
              puVar22 = (undefined4 *)(uVar14 + 1);
              puVar17 = (undefined4 *)((longlong)local_228 - (longlong)local_238 >> 2);
              if (puVar17 < puVar22) {
                puVar19 = puVar20;
                if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                  puVar19 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                }
                if (puVar19 < puVar22) {
                  puVar19 = puVar22;
                }
                FUN_140051e60(&local_238,puVar19);
              }
            }
            if (local_230 != (int *)0x0) {
              *local_230 = local_238[lVar21 >> 2];
            }
          }
          else {
            if (local_230 == local_228) {
              uVar14 = (longlong)local_230 - (longlong)local_238 >> 2;
              if (0x3ffffffffffffffe < uVar14) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_140138f38;
              }
              puVar22 = (undefined4 *)(uVar14 + 1);
              puVar17 = (undefined4 *)((longlong)local_228 - (longlong)local_238 >> 2);
              if (puVar17 < puVar22) {
                puVar19 = puVar20;
                if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                  puVar19 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                }
                if (puVar19 < puVar22) {
                  puVar19 = puVar22;
                }
                FUN_140051e60(&local_238,puVar19);
              }
            }
            if (local_230 != (int *)0x0) {
              *local_230 = iVar7;
            }
          }
          local_230 = local_230 + 1;
          puVar10 = (undefined4 *)(ulonglong)((int)puVar10 + 1);
          pwVar24 = pwVar24 + 0x14;
          uVar23 = local_2c4;
        } while (puVar10 < (undefined4 *)(lVar26 - lVar25));
      }
      uVar6 = FUN_1402970c0(lVar8,L"szGroup");
      local_2d8 = 1;
      psVar12 = (short *)FUN_140296990(lVar8,uVar23,uVar6,L"szGroup");
      if (psVar12 != (short *)0x0) {
        local_138 = 7;
        local_140 = 0;
        local_150 = 0;
        uVar14 = 0xffffffffffffffff;
        psVar9 = psVar12;
        do {
          if (uVar14 == 0) break;
          uVar14 = uVar14 - 1;
          sVar2 = *psVar9;
          psVar9 = psVar9 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_150,psVar12,~uVar14 - 1);
        local_290 = (wchar_t *)0x0;
        local_288 = (wchar_t *)0x0;
        local_280 = 0;
        puVar18 = &local_150;
        if (7 < local_138) {
          puVar18 = (undefined2 *)CONCAT62(uStack_14e,local_150);
        }
        FUN_140415930(&local_290,puVar18,&DAT_14049c7b8);
        pwVar24 = local_288;
        lVar8 = (longlong)local_288 - (longlong)local_290 >> 0x3f;
        lVar25 = ((longlong)local_288 - (longlong)local_290) / 0x28 + lVar8;
        pwVar15 = local_290;
        puVar10 = puVar20;
        if (lVar25 != lVar8) {
          do {
            pwVar16 = pwVar15;
            if (7 < *(ulonglong *)(pwVar15 + 0xc)) {
              pwVar16 = *(wchar_t **)pwVar15;
            }
            iVar7 = _wtoi(pwVar16);
            local_2c8 = iVar7;
            if ((&local_2c8 < local_200) && (local_208 <= &local_2c8)) {
              lVar26 = (longlong)&local_2c8 - (longlong)local_208;
              if (local_200 == local_1f8) {
                uVar14 = (longlong)local_200 - (longlong)local_208 >> 2;
                if (0x3ffffffffffffffe < uVar14) {
LAB_140138f38:
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  (*pcVar3)();
                  return;
                }
                puVar22 = (undefined4 *)(uVar14 + 1);
                puVar17 = (undefined4 *)((longlong)local_1f8 - (longlong)local_208 >> 2);
                if (puVar17 < puVar22) {
                  puVar19 = puVar20;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar19 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar19 < puVar22) {
                    puVar19 = puVar22;
                  }
                  FUN_140051e60(&local_208,puVar19);
                }
              }
              if (local_200 != (int *)0x0) {
                *local_200 = local_208[lVar26 >> 2];
              }
            }
            else {
              if (local_200 == local_1f8) {
                uVar14 = (longlong)local_200 - (longlong)local_208 >> 2;
                if (0x3ffffffffffffffe < uVar14) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_140138f54;
                }
                puVar22 = (undefined4 *)(uVar14 + 1);
                puVar17 = (undefined4 *)((longlong)local_1f8 - (longlong)local_208 >> 2);
                if (puVar17 < puVar22) {
                  puVar19 = puVar20;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar19 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar19 < puVar22) {
                    puVar19 = puVar22;
                  }
                  FUN_140051e60(&local_208,puVar19);
                }
              }
              if (local_200 != (int *)0x0) {
                *local_200 = iVar7;
              }
            }
            local_200 = local_200 + 1;
            puVar10 = (undefined4 *)(ulonglong)((int)puVar10 + 1);
            pwVar15 = pwVar15 + 0x14;
            uVar23 = local_2c4;
          } while (puVar10 < (undefined4 *)(lVar25 - lVar8));
        }
        pwVar16 = local_290;
        pwVar15 = local_290;
        if (local_290 != (wchar_t *)0x0) {
          for (; pwVar15 != pwVar24; pwVar15 = pwVar15 + 0x14) {
            if (7 < *(ulonglong *)(pwVar15 + 0xc)) {
              operator_delete(*(void **)pwVar15);
            }
            pwVar15[0xc] = L'\a';
            pwVar15[0xd] = L'\0';
            pwVar15[0xe] = L'\0';
            pwVar15[0xf] = L'\0';
            pwVar15[8] = L'\0';
            pwVar15[9] = L'\0';
            pwVar15[10] = L'\0';
            pwVar15[0xb] = L'\0';
            *pwVar15 = L'\0';
          }
          operator_delete(pwVar16);
        }
        lVar8 = local_2b8;
        if (7 < local_138) {
          operator_delete((void *)CONCAT62(uStack_14e,local_150));
          lVar8 = local_2b8;
        }
      }
      local_128 = uVar23;
      FUN_1401509f0(local_120,local_268);
      FUN_1401488e0(local_128);
      if (local_c0 != (void *)0x0) {
        operator_delete(local_c0);
      }
      local_c0 = (void *)0x0;
      local_b8 = 0;
      local_b0 = 0;
      if (local_f0 != (void *)0x0) {
        operator_delete(local_f0);
      }
      local_f0 = (void *)0x0;
      local_e8 = 0;
      local_e0 = 0;
      if (7 < local_100) {
        operator_delete(local_118);
      }
      uVar5 = local_1a0;
      uVar14 = (ulonglong)local_1a0 % (ulonglong)DAT_1406091b8;
      if (DAT_1406091a8 == 0) {
        cVar4 = FUN_1402c6d50(&DAT_1406091a8,(ulonglong)DAT_1406091b8,1);
        if (cVar4 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar11 = *(uint **)(DAT_1406091a8 + uVar14 * 8); puVar11 != (uint *)0x0;
            puVar11 = *(uint **)(puVar11 + 10)) {
          if ((puVar11[0xc] == local_1a0) && (*puVar11 == local_1a0)) goto LAB_140138cf3;
        }
      }
      puVar11 = (uint *)FUN_1402da9c0(&DAT_1406091a8,uVar5,uVar14,uVar5);
LAB_140138cf3:
      puVar1 = (ulonglong *)(puVar11 + 2);
      puVar10 = *(undefined4 **)(puVar11 + 4);
      if ((&local_2c4 < puVar10) && (puVar17 = (undefined4 *)*puVar1, puVar17 <= &local_2c4)) {
        if (puVar10 == *(undefined4 **)(puVar11 + 6)) {
          uVar14 = (longlong)puVar10 - (longlong)puVar17 >> 2;
          if (0x3ffffffffffffffe < uVar14) {
LAB_140138f54:
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          if ((ulonglong)((longlong)*(undefined4 **)(puVar11 + 6) - (longlong)puVar17 >> 2) <
              uVar14 + 1) {
            FUN_140051e60(puVar1);
          }
        }
        if (*(undefined4 **)(puVar11 + 4) != (undefined4 *)0x0) {
          **(undefined4 **)(puVar11 + 4) =
               *(undefined4 *)(*puVar1 + ((longlong)&local_2c4 - (longlong)puVar17 >> 2) * 4);
        }
      }
      else {
        if (puVar10 == *(undefined4 **)(puVar11 + 6)) {
          uVar14 = (longlong)((longlong)puVar10 - *puVar1) >> 2;
          if (0x3ffffffffffffffe < uVar14) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          if ((ulonglong)((longlong)((longlong)*(undefined4 **)(puVar11 + 6) - *puVar1) >> 2) <
              uVar14 + 1) {
            FUN_140051e60(puVar1);
          }
        }
        if (*(undefined4 **)(puVar11 + 4) != (undefined4 *)0x0) {
          **(undefined4 **)(puVar11 + 4) = uVar23;
        }
      }
      pwVar16 = local_2a8;
      pwVar15 = local_2b0;
      *(longlong *)(puVar11 + 4) = *(longlong *)(puVar11 + 4) + 4;
      pwVar24 = local_2b0;
      if (local_2b0 != (wchar_t *)0x0) {
        for (; pwVar24 != pwVar16; pwVar24 = pwVar24 + 0x14) {
          if (7 < *(ulonglong *)(pwVar24 + 0xc)) {
            operator_delete(*(void **)pwVar24);
          }
          pwVar24[0xc] = L'\a';
          pwVar24[0xd] = L'\0';
          pwVar24[0xe] = L'\0';
          pwVar24[0xf] = L'\0';
          pwVar24[8] = L'\0';
          pwVar24[9] = L'\0';
          pwVar24[10] = L'\0';
          pwVar24[0xb] = L'\0';
          *pwVar24 = L'\0';
        }
        operator_delete(pwVar15);
      }
      if (7 < local_160) {
        operator_delete((void *)CONCAT62(uStack_176,local_178));
      }
      local_160 = 7;
      local_168 = 0;
      local_178 = 0;
      if (local_208 != (int *)0x0) {
        operator_delete(local_208);
      }
      local_208 = (int *)0x0;
      local_200 = (int *)0x0;
      local_1f8 = (int *)0x0;
      if (local_238 != (int *)0x0) {
        operator_delete(local_238);
      }
      local_238 = (int *)0x0;
      local_230 = (int *)0x0;
      local_228 = (int *)0x0;
      if (7 < local_248) {
        operator_delete((void *)CONCAT62(uStack_25e,local_260));
      }
      puVar10 = *(undefined4 **)(local_2c0 + 6);
      if (puVar10 == (undefined4 *)0x0) {
        uVar5 = (uint)local_2c0[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar25 = (longlong)(int)uVar5 << 3;
        puVar10 = puVar20;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar5) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar25) != 0) {
            puVar10 = *(undefined4 **)(*(longlong *)(lVar8 + 0x68) + lVar25);
          }
          uVar5 = uVar5 + 1;
          lVar25 = lVar25 + 8;
        } while (puVar10 == (undefined4 *)0x0);
      }
      goto LAB_14013818a;
    }
  }
  return;
}



void FUN_140138fb0(longlong param_1)

{
  if (*(void **)(param_1 + 0x60) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x60));
  }
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  if (*(void **)(param_1 + 0x30) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 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_140139030(longlong param_1)

{
  FUN_140138fb0(param_1 + 8);
  return;
}



uint FUN_140139040(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x3c)) {
      if ((puVar1[0x3e] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 1;
        }
        puVar1 = puVar1 + 0x22;
        if ((int)*puVar1 < 1) {
          puVar1 = &DAT_14047c100;
        }
        return *puVar1;
      }
    }
  }
  return 1;
}



undefined8 * FUN_1401390a0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetItemMixDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ceb8 & 1) == 0) {
    DAT_14060ceb8 = DAT_14060ceb8 | 1;
    FUN_140137f90();
    atexit(FUN_140448690);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetItemMixDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_140609160;
}



void thunk_FUN_140148ca0(void)

{
  FUN_140148ca0();
  return;
}



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

void FUN_140139140(void)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  short *psVar7;
  undefined4 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  ulonglong uVar11;
  short *psVar12;
  undefined4 *puVar13;
  undefined1 auStack_128 [32];
  undefined1 local_108;
  undefined8 local_f8;
  undefined4 local_e8;
  undefined2 local_e0;
  undefined6 uStack_de;
  undefined8 local_d0;
  ulonglong local_c8;
  undefined4 local_b8;
  undefined4 uStack_b4;
  undefined4 uStack_b0;
  undefined4 uStack_ac;
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined4 uStack_a0;
  undefined4 uStack_9c;
  undefined4 local_98;
  undefined4 uStack_94;
  undefined4 local_88;
  undefined4 local_80;
  undefined2 local_78;
  undefined6 uStack_76;
  undefined8 local_68;
  ulonglong local_60;
  undefined8 local_50;
  undefined8 uStack_48;
  undefined4 local_40;
  undefined4 uStack_3c;
  undefined4 uStack_38;
  undefined4 uStack_34;
  undefined8 local_30;
  ulonglong local_28;
  undefined4 *puVar6;
  
  local_f8 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_128;
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"BASE_ITEM");
  if (lVar5 != 0) {
    puVar13 = (undefined4 *)0x0;
    puVar8 = puVar13;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar6 = puVar13;
      plVar10 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar10 != 0) {
          puVar8 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar3 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar3;
        plVar10 = plVar10 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_1401391d0:
    puVar6 = puVar8;
    if (puVar6 != (undefined4 *)0x0) {
      uVar2 = *puVar6;
      local_c8 = 7;
      local_d0 = 0;
      local_e0 = 0;
      local_e8 = uVar2;
      uVar4 = FUN_1402970c0(lVar5,L"szName");
      local_108 = 1;
      psVar7 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szName");
      uVar11 = 0xffffffffffffffff;
      psVar12 = psVar7;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_e0,psVar7,~uVar11 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"nItem00");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem00");
      local_b8 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem01");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem01");
      uStack_b4 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem02");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem02");
      uStack_b0 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem03");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem03");
      uStack_ac = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem04");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem04");
      local_a8 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem05");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem05");
      uStack_a4 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem06");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem06");
      uStack_a0 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem07");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem07");
      uStack_9c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem08");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem08");
      local_98 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nItem09");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItem09");
      uStack_94 = *puVar8;
      local_80 = local_e8;
      local_60 = 7;
      local_68 = 0;
      local_78 = 0;
      local_88 = uVar2;
      FUN_1400015e0(&local_78,&local_e0,0,0xffffffffffffffff);
      local_50 = CONCAT44(uStack_b4,local_b8);
      uStack_48 = CONCAT44(uStack_ac,uStack_b0);
      local_40 = local_a8;
      uStack_3c = uStack_a4;
      uStack_38 = uStack_a0;
      uStack_34 = uStack_9c;
      local_30 = CONCAT44(uStack_94,local_98);
      FUN_140148be0(local_88);
      if (7 < local_60) {
        operator_delete((void *)CONCAT62(uStack_76,local_78));
      }
      if (7 < local_c8) {
        operator_delete((void *)CONCAT62(uStack_de,local_e0));
      }
      puVar8 = *(undefined4 **)(puVar6 + 6);
      if (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar6[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar9 = (longlong)(int)uVar3 << 3;
        puVar8 = puVar13;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar9) != 0) {
            puVar8 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar9);
          }
          uVar3 = uVar3 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_1401391d0;
    }
  }
  return;
}



void FUN_140139500(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;
}



ulonglong FUN_140139540(longlong *param_1,uint param_2,void *param_3,void *param_4,void *param_5,
                       void *param_6,uint param_7)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  uint *puVar4;
  uint *puVar5;
  uint *puVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  ulonglong uVar10;
  
  uVar10 = (ulonglong)param_7;
  if (param_7 != 0) {
    param_2 = param_2 + param_7;
  }
  uVar8 = param_2 + 10;
  uVar7 = param_2 + 0x14;
  uVar9 = param_2 + 0x1e;
  lVar2 = *param_1;
  if (lVar2 != 0) {
    uVar1 = *(uint *)(param_1 + 2);
    uVar10 = (ulonglong)param_2 / (ulonglong)uVar1;
    for (puVar3 = *(uint **)(lVar2 + ((ulonglong)param_2 % (ulonglong)uVar1) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x18)) {
      if ((puVar3[0x1a] == param_2) && (*puVar3 == param_2)) {
        if (puVar3 == (uint *)0x0) {
          return uVar10;
        }
        uVar10 = (ulonglong)uVar8 / (ulonglong)uVar1;
        puVar4 = *(uint **)(lVar2 + ((ulonglong)uVar8 % (ulonglong)uVar1) * 8);
        while( true ) {
          if (puVar4 == (uint *)0x0) {
            return uVar10;
          }
          if ((puVar4[0x1a] == uVar8) && (*puVar4 == uVar8)) break;
          puVar4 = *(uint **)(puVar4 + 0x18);
        }
        if (puVar4 == (uint *)0x0) {
          return uVar10;
        }
        uVar10 = (ulonglong)uVar7 / (ulonglong)uVar1;
        puVar5 = *(uint **)(lVar2 + ((ulonglong)uVar7 % (ulonglong)uVar1) * 8);
        while( true ) {
          if (puVar5 == (uint *)0x0) {
            return uVar10;
          }
          if ((puVar5[0x1a] == uVar7) && (*puVar5 == uVar7)) break;
          puVar5 = *(uint **)(puVar5 + 0x18);
        }
        if (puVar5 == (uint *)0x0) {
          return uVar10;
        }
        uVar10 = (ulonglong)uVar9 / (ulonglong)uVar1;
        puVar6 = *(uint **)(lVar2 + ((ulonglong)uVar9 % (ulonglong)uVar1) * 8);
        while( true ) {
          if (puVar6 == (uint *)0x0) {
            return uVar10;
          }
          if ((puVar6[0x1a] == uVar9) && (*puVar6 == uVar9)) break;
          puVar6 = *(uint **)(puVar6 + 0x18);
        }
        if (puVar6 == (uint *)0x0) {
          return uVar10;
        }
        memcpy_s(param_3,0x28,puVar3 + 0xe,0x28);
        memcpy_s(param_4,0x28,puVar4 + 0xe,0x28);
        memcpy_s(param_5,0x28,puVar5 + 0xe,0x28);
        uVar9 = memcpy_s(param_6,0x28,puVar6 + 0xe,0x28);
        return (ulonglong)uVar9;
      }
    }
  }
  return uVar10;
}



undefined8 * FUN_1401396f0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetBaseItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ceb4 & 1) == 0) {
    DAT_14060ceb4 = DAT_14060ceb4 | 1;
    FUN_140148b10(0x3f400000,0x3e800000,0x40100000);
    FUN_140139140();
    atexit((_func_5014 *)&LAB_1404486b0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetBaseItemDB",uVar3,pcVar4,DVar5)
    ;
  }
  return &DAT_140609110;
}



// WARNING: Removing unreachable block (ram,0x000140139846)
// WARNING: Removing unreachable block (ram,0x00014013984f)
// WARNING: Removing unreachable block (ram,0x000140139870)
// WARNING: Removing unreachable block (ram,0x000140139879)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_1401397a0(void)

{
  _DAT_14060b2c8 = 0;
  DAT_14060b2d0 = 0;
  _DAT_14060b2d8 = 0x11;
  _DAT_14060b2f8 = 0;
  _DAT_14060b2fc = 10;
  _DAT_14060b300 = 0;
  _DAT_14060b308 = 0;
  _DAT_14060b2dc = 0x3f400000;
  _DAT_14060b2e0 = 0x3e800000;
  _DAT_14060b2e4 = 0x40100000;
  _DAT_14060b2e8 = 0x26;
  _DAT_14060b2f0 = 0;
  FUN_1401398c0();
  return &DAT_14060b2c0;
}



void thunk_FUN_140148e60(void)

{
  FUN_140148e60();
  return;
}



void FUN_1401398c0(void)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  uint uVar6;
  undefined4 uVar7;
  undefined4 *puVar9;
  undefined8 uVar10;
  float *pfVar11;
  longlong lVar12;
  longlong *plVar13;
  undefined4 *puVar14;
  undefined4 local_res8 [2];
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  void *local_140;
  undefined8 local_138;
  undefined8 local_130;
  void *local_120;
  undefined8 local_118;
  undefined8 local_110;
  void *local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  float local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined8 local_c8;
  undefined1 local_c0 [32];
  void *local_a0;
  void *local_80;
  undefined8 local_78;
  undefined8 local_70;
  void *local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined4 *puVar8;
  
  local_c8 = 0xfffffffffffffffe;
  DAT_14060b2c0 = FUN_1402933b0(DAT_140607ff0,L"ITEM_BROKEN");
  if (DAT_14060b2c0 != 0) {
    if (DAT_14060b2d0 != 0) {
      FUN_140418da0(DAT_140607fd8,L"ReInit Table ItemBrokenDB");
      FUN_140148d90(&DAT_14060b2c8);
    }
    lVar5 = DAT_14060b2c0;
    plVar1 = (longlong *)(DAT_14060b2c0 + 0x68);
    puVar14 = (undefined4 *)0x0;
    puVar9 = puVar14;
    if ((*(longlong *)(DAT_14060b2c0 + 0x70) != 0) && (*(uint *)(DAT_14060b2c0 + 0x78) != 0)) {
      plVar3 = (longlong *)*plVar1;
      puVar8 = puVar14;
      plVar13 = plVar3;
      do {
        if (*plVar13 != 0) {
          puVar9 = (undefined4 *)plVar3[(longlong)puVar8];
          break;
        }
        uVar6 = (int)puVar8 + 1;
        puVar8 = (undefined4 *)(ulonglong)uVar6;
        plVar13 = plVar13 + 1;
      } while (uVar6 < *(uint *)(DAT_14060b2c0 + 0x78));
    }
LAB_140139984:
    puVar8 = puVar9;
    lVar12 = DAT_14060b2c0;
    if (puVar8 != (undefined4 *)0x0) {
      uVar2 = *puVar8;
      local_140 = (void *)0x0;
      local_138 = 0;
      local_130 = 0;
      local_120 = (void *)0x0;
      local_118 = 0;
      local_110 = 0;
      local_100 = (void *)0x0;
      local_f8 = 0;
      local_f0 = 0;
      local_res8[0] = uVar2;
      local_158 = uVar2;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"nItem");
      puVar9 = (undefined4 *)FUN_140296600(lVar12,uVar2,uVar7,L"nItem",1);
      lVar12 = DAT_14060b2c0;
      local_154 = *puVar9;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"nItemID");
      puVar9 = (undefined4 *)FUN_140296600(lVar12,uVar2,uVar7,L"nItemID",1);
      lVar12 = DAT_14060b2c0;
      local_150 = *puVar9;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"nItemMinLv");
      puVar9 = (undefined4 *)FUN_140296600(lVar12,uVar2,uVar7,L"nItemMinLv",1);
      lVar12 = DAT_14060b2c0;
      local_14c = *puVar9;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"nItemMaxLv");
      puVar9 = (undefined4 *)FUN_140296600(lVar12,uVar2,uVar7,L"nItemMaxLv",1);
      lVar12 = DAT_14060b2c0;
      local_148 = *puVar9;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"szCategory");
      uVar10 = FUN_140296990(lVar12,uVar2,uVar7,L"szCategory",1);
      FUN_140416000(&local_140,uVar10);
      lVar12 = DAT_14060b2c0;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"szSubCategory");
      uVar10 = FUN_140296990(lVar12,uVar2,uVar7,L"szSubCategory",1);
      FUN_140416000(&local_120,uVar10);
      lVar12 = DAT_14060b2c0;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"szBranch");
      uVar10 = FUN_140296990(lVar12,uVar2,uVar7,L"szBranch",1);
      FUN_140416000(&local_100,uVar10);
      lVar12 = DAT_14060b2c0;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"fBrokenProbability");
      pfVar11 = (float *)FUN_1402967b0(lVar12,uVar2,uVar7,L"fBrokenProbability",1);
      lVar12 = DAT_14060b2c0;
      local_e0 = *pfVar11 * 1000.0;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"nItemrokenMinCount");
      puVar9 = (undefined4 *)FUN_140296600(lVar12,uVar2,uVar7,L"nItemrokenMinCount",1);
      lVar12 = DAT_14060b2c0;
      local_dc = *puVar9;
      uVar7 = FUN_1402970c0(DAT_14060b2c0,L"nItemBrokenMaxCount");
      puVar9 = (undefined4 *)FUN_140296600(lVar12,uVar2,uVar7,L"nItemBrokenMaxCount",1);
      local_d8 = *puVar9;
      puVar9 = (undefined4 *)FUN_140148e80(local_c0,local_res8,&local_158);
      FUN_140148cc0(&DAT_14060b2c8,*puVar9,puVar9 + 2);
      if (local_60 != (void *)0x0) {
        operator_delete(local_60);
      }
      local_60 = (void *)0x0;
      local_58 = 0;
      local_50 = 0;
      if (local_80 != (void *)0x0) {
        operator_delete(local_80);
      }
      local_80 = (void *)0x0;
      local_78 = 0;
      local_70 = 0;
      if (local_a0 != (void *)0x0) {
        operator_delete(local_a0);
      }
      if (local_100 != (void *)0x0) {
        operator_delete(local_100);
      }
      if (local_120 != (void *)0x0) {
        operator_delete(local_120);
      }
      if (local_140 != (void *)0x0) {
        operator_delete(local_140);
      }
      puVar9 = *(undefined4 **)(puVar8 + 6);
      if (*(undefined4 **)(puVar8 + 6) == (undefined4 *)0x0) {
        uVar6 = (uint)puVar8[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar12 = (longlong)(int)uVar6 << 3;
        puVar9 = puVar14;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar6) break;
          lVar4 = *plVar1;
          if (*(longlong *)(lVar12 + lVar4) != 0) {
            puVar9 = *(undefined4 **)(lVar12 + lVar4);
          }
          uVar6 = uVar6 + 1;
          lVar12 = lVar12 + 8;
        } while (puVar9 == (undefined4 *)0x0);
      }
      goto LAB_140139984;
    }
  }
  return;
}



void FUN_140139d00(longlong param_1)

{
  if (*(void **)(param_1 + 0x58) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  if (*(void **)(param_1 + 0x38) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  if (*(void **)(param_1 + 0x18) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x18));
  }
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  return;
}



void FUN_140139d70(longlong param_1)

{
  FUN_140139d00(param_1 + 8);
  return;
}



undefined8 * FUN_140139d80(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetItemBrokenDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ceb0 & 1) == 0) {
    DAT_14060ceb0 = DAT_14060ceb0 | 1;
    FUN_1401397a0();
    atexit((_func_5014 *)&LAB_1404486c0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetItemBrokenDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060b2c0;
}



void FUN_140139e10(int param_1,int param_2,undefined4 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  longlong lVar3;
  
  uVar1 = FUN_1402970c0(param_4,L"nItem00");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem00",1);
  *(undefined4 *)(&DAT_14060be90 + ((longlong)param_2 + (longlong)param_1 * 10) * 0x54) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem01");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem01",1);
  lVar3 = ((longlong)param_2 + (longlong)param_1 * 10) * 0x54;
  *(undefined4 *)(&DAT_14060be94 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem02");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem02",1);
  *(undefined4 *)(&DAT_14060be98 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem03");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem03",1);
  *(undefined4 *)(&DAT_14060be9c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem04");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem04",1);
  *(undefined4 *)(&DAT_14060bea0 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem05");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem05",1);
  *(undefined4 *)(&DAT_14060bea4 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem06");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem06",1);
  *(undefined4 *)(&DAT_14060bea8 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem07");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem07",1);
  *(undefined4 *)(&DAT_14060beac + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem08");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem08",1);
  *(undefined4 *)(&DAT_14060beb0 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem09");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem09",1);
  *(undefined4 *)(&DAT_14060beb4 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem10");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem10",1);
  *(undefined4 *)(&DAT_14060beb8 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem11");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem11",1);
  *(undefined4 *)(&DAT_14060bebc + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem12");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem12",1);
  *(undefined4 *)(&DAT_14060bec0 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem13");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem13",1);
  *(undefined4 *)(&DAT_14060bec4 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem14");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem14",1);
  *(undefined4 *)(&DAT_14060bec8 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem15");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem15",1);
  *(undefined4 *)(&DAT_14060becc + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem16");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem16",1);
  *(undefined4 *)(&DAT_14060bed0 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem17");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem17",1);
  *(undefined4 *)(&DAT_14060bed4 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem18");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem18",1);
  *(undefined4 *)(&DAT_14060bed8 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem19");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem19",1);
  *(undefined4 *)(&DAT_14060bedc + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem20");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem20",1);
  *(undefined4 *)(&DAT_14060bee0 + lVar3) = *puVar2;
  return;
}



void FUN_14013a290(int param_1,int param_2,undefined4 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  longlong lVar3;
  
  uVar1 = FUN_1402970c0(param_4,L"nItem00");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem00",1);
  lVar3 = (longlong)param_2 + (longlong)param_1 * 10;
  *(undefined4 *)(&DAT_14060c034 + lVar3 * 0x54) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem01");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem01",1);
  lVar3 = lVar3 * 0x54;
  *(undefined4 *)(&DAT_14060c038 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem02");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem02",1);
  *(undefined4 *)(&DAT_14060c03c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem03");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem03",1);
  *(undefined4 *)(&DAT_14060c040 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem04");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem04",1);
  *(undefined4 *)(&DAT_14060c044 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem05");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem05",1);
  *(undefined4 *)(&DAT_14060c048 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem06");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem06",1);
  *(undefined4 *)(&DAT_14060c04c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem07");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem07",1);
  *(undefined4 *)(&DAT_14060c050 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem08");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem08",1);
  *(undefined4 *)(&DAT_14060c054 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem09");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem09",1);
  *(undefined4 *)(&DAT_14060c058 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem10");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem10",1);
  *(undefined4 *)(&DAT_14060c05c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem11");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem11",1);
  *(undefined4 *)(&DAT_14060c060 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem12");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem12",1);
  *(undefined4 *)(&DAT_14060c064 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem13");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem13",1);
  *(undefined4 *)(&DAT_14060c068 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem14");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem14",1);
  *(undefined4 *)(&DAT_14060c06c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem15");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem15",1);
  *(undefined4 *)(&DAT_14060c070 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem16");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem16",1);
  *(undefined4 *)(&DAT_14060c074 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem17");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem17",1);
  *(undefined4 *)(&DAT_14060c078 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem18");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem18",1);
  *(undefined4 *)(&DAT_14060c07c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem19");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem19",1);
  *(undefined4 *)(&DAT_14060c080 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem20");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem20",1);
  *(undefined4 *)(&DAT_14060c084 + lVar3) = *puVar2;
  return;
}



void FUN_14013a6f0(int param_1,int param_2,undefined4 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  longlong lVar3;
  
  uVar1 = FUN_1402970c0(param_4,L"nItem00");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem00",1);
  lVar3 = ((longlong)param_1 * 5 + (longlong)param_2) * 0x54;
  *(undefined4 *)(&DAT_14060b800 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem01");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem01",1);
  *(undefined4 *)(&DAT_14060b804 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem02");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem02",1);
  *(undefined4 *)(&DAT_14060b808 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem03");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem03",1);
  *(undefined4 *)(&DAT_14060b80c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem04");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem04",1);
  *(undefined4 *)(&DAT_14060b810 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem05");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem05",1);
  *(undefined4 *)(&DAT_14060b814 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem06");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem06",1);
  *(undefined4 *)(&DAT_14060b818 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem07");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem07",1);
  *(undefined4 *)(&DAT_14060b81c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem08");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem08",1);
  *(undefined4 *)(&DAT_14060b820 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem09");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem09",1);
  *(undefined4 *)(&DAT_14060b824 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem10");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem10",1);
  *(undefined4 *)(&DAT_14060b828 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem11");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem11",1);
  *(undefined4 *)(&DAT_14060b82c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem12");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem12",1);
  *(undefined4 *)(&DAT_14060b830 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem13");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem13",1);
  *(undefined4 *)(&DAT_14060b834 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem14");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem14",1);
  *(undefined4 *)(&DAT_14060b838 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem15");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem15",1);
  *(undefined4 *)(&DAT_14060b83c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem16");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem16",1);
  *(undefined4 *)(&DAT_14060b840 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem17");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem17",1);
  *(undefined4 *)(&DAT_14060b844 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem18");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem18",1);
  *(undefined4 *)(&DAT_14060b848 + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem19");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem19",1);
  *(undefined4 *)(&DAT_14060b84c + lVar3) = *puVar2;
  uVar1 = FUN_1402970c0(param_4,L"nItem20");
  puVar2 = (undefined4 *)FUN_140296600(param_4,param_3,uVar1,L"nItem20",1);
  *(undefined4 *)(&DAT_14060b850 + lVar3) = *puVar2;
  return;
}



void FUN_14013ab00(void)

{
  undefined4 uVar1;
  longlong lVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"DEFAULT_ITEM");
  if (lVar2 != 0) {
    iVar5 = 0;
    iVar3 = 0;
    do {
      uVar1 = FUN_1402970c0(lVar2,L"szName");
      iVar4 = iVar3 + 1;
      FUN_140296990(lVar2,iVar4,uVar1,L"szName",1);
      FUN_14013a6f0(iVar3,0,iVar4,lVar2);
      FUN_14013a6f0(iVar3,1,iVar3 + 0xb,lVar2);
      FUN_14013a6f0(iVar3,2,iVar3 + 0x15,lVar2);
      FUN_14013a6f0(iVar3,3,iVar3 + 0x1f,lVar2);
      FUN_14013a6f0(iVar3,4,iVar3 + 0x29,lVar2);
      iVar3 = iVar4;
    } while (iVar4 < 4);
    iVar4 = 0;
    iVar3 = 0x65;
    do {
      uVar1 = FUN_1402970c0(lVar2,L"szName");
      FUN_140296990(lVar2,iVar3,uVar1,L"szName",1);
      FUN_140139e10(iVar4,0,iVar3,lVar2);
      FUN_140139e10(iVar4,1,iVar3 + 10,lVar2);
      FUN_140139e10(iVar4,2,iVar3 + 0x14,lVar2);
      FUN_140139e10(iVar4,3,iVar3 + 0x1e,lVar2);
      FUN_140139e10(iVar4,4,iVar3 + 0x28,lVar2);
      iVar3 = iVar3 + 100;
      iVar4 = iVar4 + 1;
    } while (iVar3 < 0x1f5);
    iVar3 = 0x66;
    do {
      uVar1 = FUN_1402970c0(lVar2,L"szName");
      FUN_140296990(lVar2,iVar3,uVar1,L"szName",1);
      FUN_14013a290(iVar5,0,iVar3,lVar2);
      FUN_14013a290(iVar5,1,iVar3 + 10,lVar2);
      FUN_14013a290(iVar5,2,iVar3 + 0x14,lVar2);
      FUN_14013a290(iVar5,3,iVar3 + 0x1e,lVar2);
      FUN_14013a290(iVar5,4,iVar3 + 0x28,lVar2);
      iVar3 = iVar3 + 100;
      iVar5 = iVar5 + 1;
    } while (iVar3 < 0x1f6);
  }
  return;
}



undefined * FUN_14013ad30(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetDefaultItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ceac & 1) == 0) {
    DAT_14060ceac = DAT_14060ceac | 1;
    FUN_14013ab00();
    atexit((_func_5014 *)&DAT_1404486d0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetDefaultItemDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060b800;
}



void thunk_FUN_140149040(void)

{
  FUN_140149040();
  return;
}



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

void FUN_14013add0(void)

{
  short sVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  short *psVar7;
  uint *puVar8;
  undefined4 *puVar9;
  longlong lVar10;
  longlong *plVar11;
  ulonglong uVar12;
  uint *puVar13;
  uint *puVar14;
  short *psVar15;
  uint uVar16;
  undefined1 auStack_178 [32];
  uint local_158;
  uint local_148 [2];
  longlong local_140;
  undefined8 local_138;
  uint local_128 [2];
  undefined2 local_120;
  undefined6 uStack_11e;
  undefined8 local_110;
  ulonglong local_108;
  uint local_f8 [4];
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined1 local_b8 [16];
  void *local_a8;
  ulonglong local_90;
  ulonglong local_38;
  uint *puVar6;
  uint *puVar17;
  
  local_138 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_178;
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"SET_ITEM");
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"SET_ITEM_STRING");
  if ((lVar4 != 0) && (lVar5 != 0)) {
    puVar14 = (uint *)0x0;
    puVar8 = puVar14;
    local_140 = lVar5;
    if ((*(longlong *)(lVar4 + 0x70) != 0) && (*(uint *)(lVar4 + 0x78) != 0)) {
      puVar6 = puVar14;
      plVar11 = *(longlong **)(lVar4 + 0x68);
      do {
        if (*plVar11 != 0) {
          puVar8 = (uint *)(*(longlong **)(lVar4 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar2 = (int)puVar6 + 1;
        puVar6 = (uint *)(ulonglong)uVar2;
        plVar11 = plVar11 + 1;
      } while (uVar2 < *(uint *)(lVar4 + 0x78));
    }
LAB_14013ae80:
    puVar6 = puVar8;
    if (puVar6 != (uint *)0x0) {
      uVar2 = *puVar6;
      local_108 = 7;
      local_110 = 0;
      local_120 = 0;
      local_148[0] = uVar2;
      local_128[0] = uVar2;
      uVar3 = FUN_1402970c0(lVar5,L"wszName");
      local_158._0_1_ = 1;
      psVar7 = (short *)FUN_140296b70(lVar5,uVar2,uVar3,L"wszName");
      uVar12 = 0xffffffffffffffff;
      psVar15 = psVar7;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_120,psVar7,~uVar12 - 1);
      uVar3 = FUN_1402970c0(lVar4,L"nSetItemID00");
      local_158._0_1_ = 1;
      puVar8 = (uint *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetItemID00");
      local_f8[0] = *puVar8;
      uVar3 = FUN_1402970c0(lVar4,L"nSetItemID01");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetItemID01");
      local_f8[1] = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetItemID02");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetItemID02");
      local_f8[2] = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetItemID03");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetItemID03");
      local_f8[3] = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetItemID04");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetItemID04");
      local_e8 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetItemID05");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetItemID05");
      local_e4 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOption00");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOption00");
      local_e0 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOption01");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOption01");
      local_dc = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOption02");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOption02");
      local_d8 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOption03");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOption03");
      local_d4 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOption04");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOption04");
      local_d0 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOptionvlue00");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOptionvlue00");
      local_cc = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOptionvlue01");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOptionvlue01");
      local_c8 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOptionvlue02");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOptionvlue02");
      local_c4 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOptionvlue03");
      local_158._0_1_ = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOptionvlue03");
      local_c0 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,L"nSetOptionvlue04");
      local_158 = CONCAT31(local_158._1_3_,1);
      puVar9 = (undefined4 *)FUN_140296600(lVar4,uVar2,uVar3,L"nSetOptionvlue04");
      local_bc = *puVar9;
      if ((DAT_14060b7c0 & 1) == 0) {
        DAT_14060b7c0 = DAT_14060b7c0 | 1;
        FUN_140417410();
        atexit((_func_5014 *)&LAB_140448480);
      }
      if (DAT_140609ec0 == 1000) {
        puVar8 = local_f8;
        puVar17 = puVar14;
        do {
          uVar16 = *puVar8;
          if (0 < (int)uVar16) {
            lVar5 = FUN_140137690();
            if (*(longlong *)(lVar5 + 0x88) != 0) {
              for (puVar13 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                                       ((ulonglong)uVar16 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8)
                  ; puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 0xa6)) {
                if ((puVar13[0xa8] == uVar16) && (*puVar13 == uVar16)) {
                  if (puVar13 != (uint *)0x0) {
                    if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    if (puVar13 != (uint *)0xfffffffffffffff8) {
                      if (puVar13[0x60] != uVar2) {
                        local_158 = puVar13[0x60];
                        FUN_140418da0(DAT_140607fd8,
                                      L"!!!Missed Set Item : SetID[%d]- ItemID[%d], SetID[%d]",uVar2
                                      ,*puVar8);
                      }
                      goto LAB_14013b324;
                    }
                  }
                  break;
                }
              }
            }
            uVar16 = *puVar8;
            lVar5 = FUN_140137690();
            if (*(longlong *)(lVar5 + 0x1f0) != 0) {
              for (puVar13 = *(uint **)(*(longlong *)(lVar5 + 0x1f0) +
                                       ((ulonglong)uVar16 % (ulonglong)*(uint *)(lVar5 + 0x200)) * 8
                                       ); puVar13 != (uint *)0x0;
                  puVar13 = *(uint **)(puVar13 + 0xa6)) {
                if ((puVar13[0xa8] == uVar16) && (*puVar13 == uVar16)) {
                  if (puVar13 != (uint *)0x0) {
                    if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    if (puVar13 != (uint *)0xfffffffffffffff8) goto LAB_14013b324;
                  }
                  break;
                }
              }
            }
            FUN_140418da0(DAT_140607fd8,L"!!!Invalid Set Item : SetID[%d]- ItemID[%d]",uVar2,*puVar8
                         );
          }
LAB_14013b324:
          uVar16 = (int)puVar17 + 1;
          puVar17 = (uint *)(ulonglong)uVar16;
          puVar8 = puVar8 + 1;
          lVar5 = local_140;
        } while ((int)uVar16 < 6);
      }
      puVar9 = (undefined4 *)FUN_140149060(local_b8,local_148,local_128);
      FUN_140148f80(*puVar9);
      if (7 < local_90) {
        operator_delete(local_a8);
      }
      if (7 < local_108) {
        operator_delete((void *)CONCAT62(uStack_11e,local_120));
      }
      puVar8 = *(uint **)(puVar6 + 6);
      if (*(uint **)(puVar6 + 6) == (uint *)0x0) {
        uVar2 = puVar6[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar10 = (longlong)(int)uVar2 << 3;
        puVar8 = puVar14;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar10 + *(longlong *)(lVar4 + 0x68)) != 0) {
            puVar8 = *(uint **)(lVar10 + *(longlong *)(lVar4 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar8 == (uint *)0x0);
      }
      goto LAB_14013ae80;
    }
  }
  return;
}



undefined8 * FUN_14013b410(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetSetItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf80 & 1) == 0) {
    DAT_14060cf80 = DAT_14060cf80 | 1;
    FUN_140148eb0(0x3f400000,0x3e800000,0x40100000);
    FUN_14013add0();
    atexit((_func_5014 *)&LAB_1404486e0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetSetItemDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_1406090c0;
}



// WARNING: Removing unreachable block (ram,0x00014013b588)
// WARNING: Removing unreachable block (ram,0x00014013b591)
// WARNING: Removing unreachable block (ram,0x00014013b5b2)
// WARNING: Removing unreachable block (ram,0x00014013b5bb)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14013b4c0(void)

{
  undefined8 in_XMM3_Qa;
  
  FUN_140149090(0x3f400000,0x3e800000,0x40100000,in_XMM3_Qa,0xfffffffffffffffe);
  _DAT_140608f98 = 0;
  _DAT_140608fa0 = 0;
  _DAT_140608fa8 = 0x11;
  _DAT_140608fc8 = 0;
  _DAT_140608fcc = 10;
  _DAT_140608fd0 = 0;
  _DAT_140608fd8 = 0;
  _DAT_140608fac = 0x3f400000;
  _DAT_140608fb0 = 0x3e800000;
  _DAT_140608fb4 = 0x40100000;
  _DAT_140608fb8 = 0x26;
  _DAT_140608fc0 = 0;
  _DAT_140608fe0 = 0;
  _DAT_140608fe8 = 0;
  _DAT_140608ff0 = 0x11;
  _DAT_140609010 = 0;
  _DAT_140609014 = 10;
  _DAT_140609018 = 0;
  _DAT_140609020 = 0;
  _DAT_140608ff4 = 0x3f400000;
  _DAT_140608ff8 = 0x3e800000;
  _DAT_140608ffc = 0x40100000;
  _DAT_140609008 = 0;
  _DAT_140609028 = 0;
  _DAT_140609030 = 0;
  _DAT_140609038 = 0x11;
  _DAT_140609058 = 0;
  _DAT_14060905c = 10;
  _DAT_140609060 = 0;
  _DAT_140609068 = 0;
  _DAT_14060903c = 0x3f400000;
  _DAT_140609040 = 0x3e800000;
  _DAT_140609044 = 0x40100000;
  _DAT_140609050 = 0;
  DAT_140609070 = 0;
  DAT_140609078 = 0;
  DAT_140609080 = 0;
  DAT_140609090 = 0;
  DAT_140609098 = 0;
  DAT_1406090a0 = 0;
  _DAT_140609000 = _DAT_140608fb8;
  _DAT_140609048 = _DAT_140608fb8;
  FUN_14013c1b0();
  return &DAT_140608f50;
}



void thunk_FUN_1401492c0(void)

{
  FUN_1401492c0();
  return;
}



void FUN_14013b700(void)

{
  if (DAT_140609090 != (void *)0x0) {
    operator_delete(DAT_140609090);
  }
  DAT_140609090 = (void *)0x0;
  DAT_140609098 = 0;
  DAT_1406090a0 = 0;
  if (DAT_140609070 != (void *)0x0) {
    operator_delete(DAT_140609070);
  }
  DAT_140609070 = (void *)0x0;
  DAT_140609078 = 0;
  DAT_140609080 = 0;
  FUN_140148af0(&DAT_140609028);
  FUN_140148af0(&DAT_140608fe0);
  FUN_140148af0(&DAT_140608f98);
  FUN_1401492c0();
  return;
}



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

void FUN_14013b790(longlong param_1)

{
  short sVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  uint uVar4;
  undefined4 uVar5;
  undefined4 *puVar7;
  short *psVar8;
  short *psVar9;
  short *psVar10;
  int *piVar11;
  undefined8 uVar12;
  ulonglong *puVar13;
  longlong lVar14;
  longlong *plVar15;
  ulonglong uVar16;
  undefined4 *puVar17;
  undefined1 auStack_248 [32];
  undefined1 local_228;
  undefined4 local_218 [2];
  undefined8 local_210;
  short *local_208;
  undefined8 local_200;
  undefined4 local_1f8;
  undefined4 local_1f4;
  undefined2 local_1f0;
  undefined6 uStack_1ee;
  undefined8 local_1e0;
  ulonglong local_1d8;
  undefined2 local_1c8;
  undefined6 uStack_1c6;
  undefined8 local_1b8;
  ulonglong local_1b0;
  undefined2 local_1a0;
  undefined6 uStack_19e;
  undefined8 local_190;
  ulonglong local_188;
  int local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  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;
  undefined1 local_118 [8];
  undefined1 local_110 [216];
  ulonglong local_38;
  undefined4 *puVar6;
  
  if (param_1 != 0) {
    local_200 = 0xfffffffffffffffe;
    local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_248;
    puVar17 = (undefined4 *)0x0;
    puVar7 = puVar17;
    if ((*(longlong *)(param_1 + 0x70) != 0) && (*(uint *)(param_1 + 0x78) != 0)) {
      puVar6 = puVar17;
      plVar15 = *(longlong **)(param_1 + 0x68);
      do {
        if (*plVar15 != 0) {
          puVar7 = (undefined4 *)(*(longlong **)(param_1 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar4 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar4;
        plVar15 = plVar15 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0x78));
    }
LAB_14013b810:
    puVar6 = puVar7;
    if (puVar6 != (undefined4 *)0x0) {
      uVar2 = *puVar6;
      local_1d8 = 7;
      local_1e0 = 0;
      local_1f0 = 0;
      local_1b0 = 7;
      local_1b8 = 0;
      local_1c8 = 0;
      local_188 = 7;
      local_190 = 0;
      local_1a0 = 0;
      local_218[0] = uVar2;
      local_1f8 = uVar2;
      uVar5 = FUN_1402970c0(param_1,L"nItemID");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nItemID");
      local_1f4 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"wszName");
      local_228 = 1;
      psVar8 = (short *)FUN_140296b70(param_1,uVar2,uVar5,L"wszName");
      local_208 = psVar8;
      uVar5 = FUN_1402970c0(param_1,L"wszDesc");
      local_228 = 1;
      psVar9 = (short *)FUN_140296b70(param_1,uVar2,uVar5,L"wszDesc");
      uVar5 = FUN_1402970c0(param_1,L"szShopBigIcon");
      local_228 = 1;
      psVar10 = (short *)FUN_140296990(param_1,uVar2,uVar5,L"szShopBigIcon");
      if (psVar8 != (short *)0x0) {
        uVar16 = 0xffffffffffffffff;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          sVar1 = *psVar8;
          psVar8 = psVar8 + 1;
        } while (sVar1 != 0);
        FUN_140001710(&local_1f0,local_208,~uVar16 - 1);
      }
      if (psVar9 != (short *)0x0) {
        uVar16 = 0xffffffffffffffff;
        psVar8 = psVar9;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          sVar1 = *psVar8;
          psVar8 = psVar8 + 1;
        } while (sVar1 != 0);
        FUN_140001710(&local_1c8,psVar9,~uVar16 - 1);
      }
      if (psVar10 != (short *)0x0) {
        uVar16 = 0xffffffffffffffff;
        psVar8 = psVar10;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          sVar1 = *psVar8;
          psVar8 = psVar8 + 1;
        } while (sVar1 != 0);
        FUN_140001710(&local_1a0,psVar10,~uVar16 - 1);
      }
      uVar5 = FUN_1402970c0(param_1,L"nItemState");
      local_228 = 1;
      piVar11 = (int *)FUN_140296600(param_1,uVar2,uVar5,L"nItemState");
      local_178 = *piVar11;
      uVar5 = FUN_1402970c0(param_1,L"nCategory");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nCategory");
      local_174 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nJob");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nJob");
      local_170 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nCostumeCategory");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nCostumeCategory");
      local_16c = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nCostumeRank");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nCostumeRank");
      local_168 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nStartSellingDate");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nStartSellingDate");
      local_164 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nEndSellingDate");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nEndSellingDate");
      local_160 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nDeleteType");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nDeleteType");
      local_150 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nCostumeOptionGroup");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nCostumeOptionGroup");
      local_14c = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nItemType");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nItemType");
      local_148 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nValue00");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nValue00");
      local_144 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nCashCost00");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nCashCost00");
      local_140 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nHidden");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nHidden");
      local_13c = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nNoGift");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nNoGift");
      local_138 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nGracePeriod");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nGracePeriod");
      local_134 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nPaymentType");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nPaymentType");
      local_130 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nCashMileage");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nCashMileage");
      local_12c = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nCostumeSetID");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nCostumeSetID");
      local_128 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nSaleStartSellingDate");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nSaleStartSellingDate");
      local_15c = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nSaleEndSellingDate");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nSaleEndSellingDate");
      local_158 = *puVar7;
      uVar5 = FUN_1402970c0(param_1,L"nSaleCashCost00");
      local_228 = 1;
      puVar7 = (undefined4 *)FUN_140296600(param_1,uVar2,uVar5,L"nSaleCashCost00");
      local_154 = *puVar7;
      puVar7 = (undefined4 *)FUN_1401492e0(local_118,local_218,&local_1f8);
      FUN_140149160(*puVar7,puVar7 + 2);
      FUN_14013c120(local_110);
      local_210._0_4_ = local_1f8;
      local_210._4_4_ = local_1f4;
      if ((&local_210 < DAT_140609078) && (DAT_140609070 <= &local_210)) {
        lVar14 = (longlong)&local_210 - (longlong)DAT_140609070;
        if (DAT_140609078 == DAT_140609080) {
          FUN_140147240(&DAT_140609070);
        }
        if (DAT_140609078 != (undefined8 *)0x0) {
          uVar12 = DAT_140609070[lVar14 >> 3];
LAB_14013bdfe:
          *DAT_140609078 = uVar12;
        }
      }
      else {
        if (DAT_140609078 == DAT_140609080) {
          FUN_140147240(&DAT_140609070);
        }
        if (DAT_140609078 != (undefined8 *)0x0) {
          uVar12 = CONCAT44(local_210._4_4_,(undefined4)local_210);
          goto LAB_14013bdfe;
        }
      }
      DAT_140609078 = DAT_140609078 + 1;
      puVar13 = (ulonglong *)FUN_140148a60(&DAT_140608f98,local_174);
      puVar7 = (undefined4 *)puVar13[1];
      if ((local_218 < puVar7) && (puVar3 = (undefined4 *)*puVar13, puVar3 <= local_218)) {
        if (puVar7 == (undefined4 *)puVar13[2]) {
          FUN_1400556a0(puVar13,1);
        }
        if ((undefined4 *)puVar13[1] != (undefined4 *)0x0) {
          *(undefined4 *)puVar13[1] =
               *(undefined4 *)(*puVar13 + ((longlong)local_218 - (longlong)puVar3 >> 2) * 4);
        }
      }
      else {
        if (puVar7 == (undefined4 *)puVar13[2]) {
          FUN_1400556a0(puVar13,1);
        }
        if ((undefined4 *)puVar13[1] != (undefined4 *)0x0) {
          *(undefined4 *)puVar13[1] = uVar2;
        }
      }
      puVar13[1] = puVar13[1] + 4;
      puVar13 = (ulonglong *)FUN_140148a60(&DAT_140608fe0,local_148);
      puVar7 = (undefined4 *)puVar13[1];
      if ((local_218 < puVar7) && (puVar3 = (undefined4 *)*puVar13, puVar3 <= local_218)) {
        if (puVar7 == (undefined4 *)puVar13[2]) {
          FUN_1400556a0(puVar13,1);
        }
        if ((undefined4 *)puVar13[1] != (undefined4 *)0x0) {
          *(undefined4 *)puVar13[1] =
               *(undefined4 *)(*puVar13 + ((longlong)local_218 - (longlong)puVar3 >> 2) * 4);
        }
      }
      else {
        if (puVar7 == (undefined4 *)puVar13[2]) {
          FUN_1400556a0(puVar13,1);
        }
        if ((undefined4 *)puVar13[1] != (undefined4 *)0x0) {
          *(undefined4 *)puVar13[1] = uVar2;
        }
      }
      puVar13[1] = puVar13[1] + 4;
      puVar13 = (ulonglong *)FUN_140148a60(&DAT_140609028);
      puVar7 = (undefined4 *)puVar13[1];
      if ((&local_134 < puVar7) && (puVar3 = (undefined4 *)*puVar13, puVar3 <= &local_134)) {
        if (puVar7 == (undefined4 *)puVar13[2]) {
          FUN_1400556a0(puVar13);
        }
        puVar7 = (undefined4 *)puVar13[1];
        if (puVar7 != (undefined4 *)0x0) {
          uVar5 = *(undefined4 *)(*puVar13 + ((longlong)&local_134 - (longlong)puVar3 >> 2) * 4);
LAB_14013bf96:
          *puVar7 = uVar5;
        }
      }
      else {
        if (puVar7 == (undefined4 *)puVar13[2]) {
          FUN_1400556a0(puVar13);
        }
        puVar7 = (undefined4 *)puVar13[1];
        uVar5 = local_134;
        if (puVar7 != (undefined4 *)0x0) goto LAB_14013bf96;
      }
      puVar13[1] = puVar13[1] + 4;
      if ((local_178 == 2) || (local_178 == 4)) {
        if ((local_218 < DAT_140609098) && (DAT_140609090 <= local_218)) {
          lVar14 = (longlong)local_218 - (longlong)DAT_140609090;
          if (DAT_140609098 == DAT_1406090a0) {
            FUN_1400556a0(&DAT_140609090);
          }
          if (DAT_140609098 != (undefined4 *)0x0) {
            *DAT_140609098 = DAT_140609090[lVar14 >> 2];
          }
        }
        else {
          if (DAT_140609098 == DAT_1406090a0) {
            FUN_1400556a0(&DAT_140609090);
          }
          if (DAT_140609098 != (undefined4 *)0x0) {
            *DAT_140609098 = uVar2;
          }
        }
        DAT_140609098 = DAT_140609098 + 1;
      }
      if (7 < local_188) {
        operator_delete((void *)CONCAT62(uStack_19e,local_1a0));
      }
      local_188 = 7;
      local_190 = 0;
      local_1a0 = 0;
      if (7 < local_1b0) {
        operator_delete((void *)CONCAT62(uStack_1c6,local_1c8));
      }
      local_1b0 = 7;
      local_1b8 = 0;
      local_1c8 = 0;
      if (7 < local_1d8) {
        operator_delete((void *)CONCAT62(uStack_1ee,local_1f0));
      }
      puVar7 = *(undefined4 **)(puVar6 + 6);
      if (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0) {
        uVar4 = (uint)puVar6[8] % *(uint *)(param_1 + 0x78) + 1;
        lVar14 = (longlong)(int)uVar4 << 3;
        puVar7 = puVar17;
        do {
          if (*(uint *)(param_1 + 0x78) <= uVar4) break;
          if (*(longlong *)(lVar14 + *(longlong *)(param_1 + 0x68)) != 0) {
            puVar7 = *(undefined4 **)(lVar14 + *(longlong *)(param_1 + 0x68));
          }
          uVar4 = uVar4 + 1;
          lVar14 = lVar14 + 8;
        } while (puVar7 == (undefined4 *)0x0);
      }
      goto LAB_14013b810;
    }
  }
  return;
}



void FUN_14013c120(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  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_14013c1a0(longlong param_1)

{
  FUN_14013c120(param_1 + 8);
  return;
}



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

{
  undefined8 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = FUN_1402933b0(DAT_140607ff0,L"CASH_SHOP_LIST",param_3,param_4,0xfffffffffffffffe);
  FUN_14013b790(uVar1);
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 != 1000) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if ((DAT_14060a120 != 200) && (DAT_14060a120 != 100)) {
      if ((DAT_14060b7c0 & 1) == 0) {
        DAT_14060b7c0 = DAT_14060b7c0 | 1;
        FUN_140417410();
        atexit((_func_5014 *)&LAB_140448480);
      }
      if (((DAT_140609ec0 != 100) && (DAT_140609ec0 != 200)) &&
         (lVar2 = FUN_140418650(), *(int *)(lVar2 + 0x1e0) != 1000)) {
        return;
      }
    }
  }
  uVar1 = FUN_1402933b0(DAT_140607ff0,L"CASH_SHOP_LIST_OLD",param_3,param_4,uVar3);
  FUN_14013b790(uVar1);
  return;
}



uint FUN_14013c2c0(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x38)) {
      if ((puVar1[0x3a] == param_2) && (*puVar1 == param_2)) goto LAB_14013c2fc;
    }
  }
  puVar1 = (uint *)0x0;
LAB_14013c2fc:
  if (puVar1 != (uint *)0x0) {
    return puVar1[0x2f];
  }
  return 0;
}



undefined8 * FUN_14013c310(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetCashShopItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cea8 & 1) == 0) {
    DAT_14060cea8 = DAT_14060cea8 | 1;
    FUN_14013b4c0();
    atexit((_func_5014 *)&LAB_1404486f0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetCashShopItemDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608f50;
}



void thunk_FUN_1401494b0(void)

{
  FUN_1401494b0();
  return;
}



void FUN_14013c3b0(undefined8 param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"HAIR_CUT");
  FUN_140294650(uVar1,L"HAIR_CUT");
  FUN_140292e80(uVar1,L"HAIR_CUT",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"HAIR_CUT_STRING");
  FUN_140294650(uVar1,L"HAIR_CUT_STRING");
  FUN_140292e80(uVar1,L"HAIR_CUT_STRING",uVar2);
  FUN_14013c450(param_1);
  return;
}



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

void FUN_14013c450(undefined8 param_1)

{
  short sVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined *puVar4;
  wchar_t *pwVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  undefined4 *puVar10;
  short *psVar11;
  float *pfVar12;
  float *pfVar13;
  longlong lVar14;
  longlong *plVar15;
  ulonglong uVar16;
  wchar_t *pwVar17;
  undefined2 *puVar18;
  longlong lVar19;
  short *psVar20;
  double dVar21;
  undefined1 auStack_238 [32];
  undefined1 local_218;
  undefined4 local_208 [2];
  undefined8 local_200;
  longlong local_1f8;
  wchar_t *local_1f0;
  undefined8 local_1e8;
  undefined8 local_1e0;
  undefined8 local_1d0;
  undefined2 local_1c8;
  undefined6 uStack_1c6;
  longlong local_1b8;
  ulonglong local_1b0;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined2 local_188;
  undefined6 uStack_186;
  undefined8 local_178;
  ulonglong local_170;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  float local_154;
  float local_150;
  float local_14c;
  undefined4 local_148;
  float local_144;
  float local_140 [7];
  float local_124;
  float local_120;
  float local_11c [7];
  float local_100;
  float local_fc;
  undefined1 local_f8 [24];
  void *local_e0;
  ulonglong local_c8;
  ulonglong local_48;
  undefined4 *puVar9;
  
  local_1d0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_238;
  local_200 = param_1;
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"HAIR_CUT");
  if ((lVar8 != 0) && (local_1f8 = FUN_1402933b0(DAT_140607ff0,L"HAIR_CUT_STRING"), local_1f8 != 0))
  {
    puVar10 = (undefined4 *)0x0;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar9 = puVar10;
      plVar15 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar15 != 0) {
          puVar10 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar9];
          break;
        }
        uVar6 = (int)puVar9 + 1;
        puVar9 = (undefined4 *)(ulonglong)uVar6;
        plVar15 = plVar15 + 1;
      } while (uVar6 < *(uint *)(lVar8 + 0x78));
    }
LAB_14013c520:
    puVar9 = puVar10;
    lVar14 = local_1f8;
    lVar19 = 0;
    if (puVar9 != (undefined4 *)0x0) {
      uVar2 = *puVar9;
      local_170 = 7;
      local_178 = 0;
      local_188 = 0;
      local_208[0] = uVar2;
      local_198 = uVar2;
      uVar7 = FUN_1402970c0(lVar8,L"nItemID");
      local_218 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar7,L"nItemID");
      local_194 = *puVar10;
      uVar7 = FUN_1402970c0(lVar8,L"nGroupID");
      local_218 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar7,L"nGroupID");
      local_190 = *puVar10;
      uVar7 = FUN_1402970c0(lVar14,L"wszHairName");
      local_218 = 1;
      psVar11 = (short *)FUN_140296b70(lVar14,uVar2,uVar7,L"wszHairName");
      uVar16 = 0xffffffffffffffff;
      psVar20 = psVar11;
      do {
        if (uVar16 == 0) break;
        uVar16 = uVar16 - 1;
        sVar1 = *psVar20;
        psVar20 = psVar20 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_188,psVar11,~uVar16 - 1);
      uVar7 = FUN_1402970c0(lVar8,L"nVisible");
      local_218 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar7,L"nVisible");
      local_160 = *puVar10;
      uVar7 = FUN_1402970c0(lVar8,L"nHairDesc");
      local_218 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar7,L"nHairDesc");
      local_15c = *puVar10;
      uVar7 = FUN_1402970c0(lVar8,L"nClass");
      local_218 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar7,L"nClass");
      local_158 = *puVar10;
      uVar7 = FUN_1402970c0(lVar8,L"nGoldCost");
      local_218 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar7,L"nGoldCost");
      local_148 = *puVar10;
      uVar7 = FUN_1402970c0(lVar8,L"szOffset");
      local_218 = 1;
      psVar11 = (short *)FUN_140296990(lVar8,uVar2,uVar7,L"szOffset");
      local_1b0 = 7;
      local_1b8 = 0;
      local_1c8 = 0;
      uVar16 = 0xffffffffffffffff;
      psVar20 = psVar11;
      do {
        if (uVar16 == 0) break;
        uVar16 = uVar16 - 1;
        sVar1 = *psVar20;
        psVar20 = psVar20 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_1c8,psVar11,~uVar16 - 1);
      if (local_1b8 != 0) {
        local_1f0 = (wchar_t *)0x0;
        local_1e8 = 0;
        local_1e0 = 0;
        puVar18 = &local_1c8;
        if (7 < local_1b0) {
          puVar18 = (undefined2 *)CONCAT62(uStack_1c6,local_1c8);
        }
        FUN_140415930(&local_1f0,puVar18,&DAT_14049c7b8);
        pwVar5 = local_1f0;
        pwVar17 = local_1f0;
        if (7 < *(ulonglong *)(local_1f0 + 0xc)) {
          pwVar17 = *(wchar_t **)local_1f0;
        }
        dVar21 = _wtof(pwVar17);
        local_154 = (float)dVar21;
        pwVar17 = pwVar5 + 0x14;
        if (7 < *(ulonglong *)(pwVar5 + 0x20)) {
          pwVar17 = *(wchar_t **)pwVar17;
        }
        dVar21 = _wtof(pwVar17);
        local_150 = (float)dVar21;
        pwVar17 = pwVar5 + 0x28;
        if (7 < *(ulonglong *)(pwVar5 + 0x34)) {
          pwVar17 = *(wchar_t **)pwVar17;
        }
        dVar21 = _wtof(pwVar17);
        local_14c = (float)dVar21;
        FUN_14008d0a0(pwVar5,local_1e8);
        operator_delete(pwVar5);
      }
      uVar7 = FUN_1402970c0(lVar8,L"fHairCutSuccess");
      local_218 = 1;
      pfVar12 = (float *)FUN_1402967b0(lVar8,uVar2,uVar7,L"fHairCutSuccess");
      puVar4 = PTR_u_fHairCutPro00_1405e0fd8;
      local_144 = *pfVar12 * 100.0;
      uVar7 = FUN_1402970c0(lVar8,PTR_u_fHairCutPro00_1405e0fd8);
      local_218 = 1;
      pfVar12 = (float *)FUN_1402967b0(lVar8,uVar2,uVar7,puVar4);
      puVar4 = PTR_u_fHairCutPro01_1405e0fe0;
      local_140[6] = *pfVar12 * 100.0;
      uVar7 = FUN_1402970c0(lVar8,PTR_u_fHairCutPro01_1405e0fe0);
      local_218 = 1;
      pfVar12 = (float *)FUN_1402967b0(lVar8,uVar2,uVar7,puVar4);
      puVar4 = PTR_u_fHairCutPro02_1405e0fe8;
      local_124 = *pfVar12 * 100.0 + local_140[6];
      uVar7 = FUN_1402970c0(lVar8,PTR_u_fHairCutPro02_1405e0fe8);
      local_218 = 1;
      pfVar12 = (float *)FUN_1402967b0(lVar8,uVar2,uVar7,puVar4);
      puVar4 = PTR_u_fFailPro00_1405e0fc0;
      local_120 = *pfVar12 * 100.0 + local_124;
      uVar7 = FUN_1402970c0(lVar8,PTR_u_fFailPro00_1405e0fc0);
      local_218 = 1;
      pfVar12 = (float *)FUN_1402967b0(lVar8,uVar2,uVar7,puVar4);
      puVar4 = PTR_u_fFailPro01_1405e0fc8;
      local_11c[6] = *pfVar12 * 100.0;
      uVar7 = FUN_1402970c0(lVar8,PTR_u_fFailPro01_1405e0fc8);
      local_218 = 1;
      pfVar12 = (float *)FUN_1402967b0(lVar8,uVar2,uVar7,puVar4);
      puVar4 = PTR_u_fFailPro02_1405e0fd0;
      local_100 = *pfVar12 * 100.0 + local_11c[6];
      uVar7 = FUN_1402970c0(lVar8,PTR_u_fFailPro02_1405e0fd0);
      local_218 = 1;
      pfVar12 = (float *)FUN_1402967b0(lVar8,uVar2,uVar7,puVar4);
      local_fc = *pfVar12 * 100.0 + local_100;
      pfVar12 = local_140 + 3;
      do {
        uVar3 = *(undefined8 *)((longlong)&PTR_u_nItemID00_1405e0888 + lVar19);
        uVar7 = FUN_1402970c0(lVar8,uVar3);
        local_218 = 1;
        pfVar13 = (float *)FUN_140296600(lVar8,uVar2,uVar7,uVar3);
        pfVar12[-3] = *pfVar13;
        uVar3 = *(undefined8 *)((longlong)&PTR_u_nItemCount00_1405e0f60 + lVar19);
        uVar7 = FUN_1402970c0(lVar8,uVar3);
        local_218 = 1;
        pfVar13 = (float *)FUN_140296600(lVar8,uVar2,uVar7,uVar3);
        *pfVar12 = *pfVar13;
        uVar3 = *(undefined8 *)((longlong)&PTR_u_nHairCutID00_1405e0ff0 + lVar19);
        uVar7 = FUN_1402970c0(lVar8,uVar3);
        local_218 = 1;
        pfVar13 = (float *)FUN_140296600(lVar8,uVar2,uVar7,uVar3);
        pfVar12[6] = *pfVar13;
        uVar3 = *(undefined8 *)((longlong)&PTR_u_nFailID00_1405e0fa8 + lVar19);
        uVar7 = FUN_1402970c0(lVar8,uVar3);
        local_218 = 1;
        pfVar13 = (float *)FUN_140296600(lVar8,uVar2,uVar7,uVar3);
        pfVar12[9] = *pfVar13;
        lVar19 = lVar19 + 8;
        pfVar12 = pfVar12 + 1;
      } while (lVar19 < 0x18);
      puVar10 = (undefined4 *)FUN_1401494d0(local_f8,local_208,&local_198);
      FUN_1401493e0(local_200,*puVar10,puVar10 + 2);
      if (7 < local_c8) {
        operator_delete(local_e0);
      }
      if (7 < local_1b0) {
        operator_delete((void *)CONCAT62(uStack_1c6,local_1c8));
      }
      local_1b0 = 7;
      local_1b8 = 0;
      local_1c8 = 0;
      if (7 < local_170) {
        operator_delete((void *)CONCAT62(uStack_186,local_188));
      }
      puVar10 = *(undefined4 **)(puVar9 + 6);
      if (*(undefined4 **)(puVar9 + 6) == (undefined4 *)0x0) {
        puVar10 = (undefined4 *)0x0;
        uVar6 = (uint)puVar9[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar14 = (longlong)(int)uVar6 << 3;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar6) break;
          if (*(longlong *)(lVar14 + *(longlong *)(lVar8 + 0x68)) != 0) {
            puVar10 = *(undefined4 **)(lVar14 + *(longlong *)(lVar8 + 0x68));
          }
          uVar6 = uVar6 + 1;
          lVar14 = lVar14 + 8;
        } while (puVar10 == (undefined4 *)0x0);
      }
      goto LAB_14013c520;
    }
  }
  return;
}



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

{
  int iVar1;
  int iVar2;
  uint *puVar3;
  float fVar4;
  
  if (*param_1 != 0) {
    for (puVar3 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x2a)) {
      if ((puVar3[0x2c] == param_2) && (*puVar3 == param_2)) goto LAB_14013cb51;
    }
  }
  puVar3 = (uint *)0x0;
LAB_14013cb51:
  if ((puVar3 == (uint *)0x0) || (puVar3 == (uint *)0xfffffffffffffff8)) {
    return 0x125;
  }
  iVar1 = rand();
  iVar2 = rand();
  fVar4 = (float)iVar2 * 3.0517578e-05 * 100.0;
  if ((float)puVar3[0x17] <= (float)iVar1 * 3.0517578e-05 * 100.0) {
    if ((0.0 <= fVar4) && (fVar4 < (float)puVar3[0x27])) {
      *param_3 = puVar3[0x24];
      return 0x128;
    }
    if (((float)puVar3[0x27] <= fVar4) && (fVar4 < (float)puVar3[0x28])) {
      *param_3 = puVar3[0x25];
      return 0x128;
    }
    *param_3 = puVar3[0x26];
    return 0x128;
  }
  if ((0.0 <= fVar4) && (fVar4 < (float)puVar3[0x1e])) {
    *param_3 = puVar3[0x21];
    return 0x126;
  }
  if (((float)puVar3[0x1e] <= fVar4) && (fVar4 < (float)puVar3[0x1f])) {
    *param_3 = puVar3[0x22];
    return 0x127;
  }
  *param_3 = puVar3[0x23];
  return 0x127;
}



undefined4 * FUN_14013ccb0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff);
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  return param_1;
}



undefined8 * FUN_14013cde0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetHairCutItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cea4 & 1) == 0) {
    DAT_14060cea4 = DAT_14060cea4 | 1;
    FUN_140149310(0x3f400000,0x3e800000,0x40100000);
    FUN_14013c450(&DAT_140608f00);
    atexit((_func_5014 *)&LAB_140448700);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetHairCutItemDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608f00;
}



void thunk_FUN_140149690(void)

{
  FUN_140149690();
  return;
}



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

void FUN_14013ceb0(void)

{
  short sVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  code *pcVar4;
  undefined8 *puVar5;
  undefined *puVar6;
  wchar_t *pwVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  uint uVar10;
  undefined4 uVar11;
  int iVar12;
  longlong lVar13;
  undefined4 *puVar15;
  short *psVar16;
  longlong lVar17;
  float *pfVar18;
  float *pfVar19;
  longlong *plVar20;
  ulonglong uVar21;
  wchar_t *pwVar22;
  undefined4 *puVar23;
  undefined2 *puVar24;
  undefined4 *puVar25;
  undefined4 *puVar26;
  short *psVar27;
  wchar_t *pwVar28;
  uint *puVar29;
  undefined1 auStack_4b8 [32];
  undefined1 local_498;
  int local_488 [2];
  undefined4 *local_480;
  undefined4 *local_478;
  float local_470;
  float local_46c;
  float local_468;
  undefined4 local_464;
  undefined4 local_460;
  undefined4 local_45c;
  undefined4 local_458;
  undefined4 local_454;
  float local_450;
  float local_44c;
  float local_448;
  undefined4 local_444;
  undefined4 local_440;
  undefined4 local_43c;
  undefined4 local_438;
  undefined4 local_434;
  undefined4 local_430;
  undefined4 local_428;
  undefined4 uStack_424;
  undefined4 local_420;
  undefined4 uStack_41c;
  undefined4 local_418;
  undefined4 uStack_414;
  undefined4 local_410;
  undefined4 uStack_40c;
  undefined4 local_408;
  undefined4 uStack_404;
  undefined4 local_400;
  undefined4 uStack_3fc;
  longlong local_3f8;
  undefined4 local_3f0;
  undefined4 uStack_3ec;
  undefined4 local_3e8;
  undefined4 uStack_3e4;
  undefined4 local_3e0;
  undefined4 uStack_3dc;
  undefined4 local_3d8;
  undefined4 uStack_3d4;
  undefined4 local_3d0;
  undefined4 uStack_3cc;
  undefined4 local_3c8;
  undefined4 uStack_3c4;
  wchar_t *local_3c0;
  wchar_t *local_3b8;
  undefined8 local_3b0;
  undefined8 *local_3a0;
  undefined8 *local_398;
  undefined8 local_390;
  wchar_t *local_380;
  wchar_t *local_378;
  undefined8 local_370;
  undefined8 local_360;
  undefined2 local_358;
  undefined6 uStack_356;
  undefined8 local_348;
  ulonglong local_340;
  undefined2 local_330;
  undefined6 uStack_32e;
  undefined8 local_320;
  ulonglong local_318;
  undefined2 local_308;
  undefined6 uStack_306;
  undefined8 local_2f8;
  ulonglong local_2f0;
  undefined4 local_2d8;
  undefined4 local_2d4;
  undefined2 local_2d0;
  undefined6 uStack_2ce;
  undefined8 local_2c0;
  ulonglong local_2b8;
  undefined4 local_2a8;
  int *local_2a0;
  int *local_298;
  int *local_290;
  undefined4 auStack_280 [12];
  undefined4 auStack_250 [12];
  undefined4 local_220;
  float local_21c;
  undefined4 local_218;
  undefined1 local_214;
  float local_210 [10];
  float local_1e8;
  float local_1e4;
  float local_1e0 [4];
  float local_1d0;
  float local_1cc;
  undefined1 local_1c8 [16];
  void *local_1b8;
  ulonglong local_1a0;
  void *local_188;
  undefined8 local_180;
  undefined8 local_178;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined4 local_70;
  ulonglong local_68;
  undefined4 *puVar14;
  
  local_360 = 0xfffffffffffffffe;
  local_68 = DAT_1405d84f0 ^ (ulonglong)auStack_4b8;
  lVar13 = FUN_1402933b0(DAT_140607ff0,L"HAIR_DYEING");
  if (lVar13 != 0) {
    puVar25 = (undefined4 *)0x0;
    puVar15 = puVar25;
    local_3f8 = lVar13;
    if ((*(longlong *)(lVar13 + 0x70) != 0) && (*(uint *)(lVar13 + 0x78) != 0)) {
      puVar14 = puVar25;
      plVar20 = *(longlong **)(lVar13 + 0x68);
      do {
        if (*plVar20 != 0) {
          puVar15 = (undefined4 *)(*(longlong **)(lVar13 + 0x68))[(longlong)puVar14];
          break;
        }
        uVar10 = (int)puVar14 + 1;
        puVar14 = (undefined4 *)(ulonglong)uVar10;
        plVar20 = plVar20 + 1;
      } while (uVar10 < *(uint *)(lVar13 + 0x78));
    }
LAB_14013cf6a:
    if (puVar15 != (undefined4 *)0x0) {
      uVar2 = *puVar15;
      local_2b8 = 7;
      local_2c0 = 0;
      local_2d0 = 0;
      local_2a0 = (int *)0x0;
      local_298 = (int *)0x0;
      local_290 = (int *)0x0;
      local_480 = puVar15;
      local_440 = uVar2;
      local_2d8 = uVar2;
      uVar11 = FUN_1402970c0(lVar13,L"nGroupID");
      local_498 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar13,uVar2,uVar11,L"nGroupID");
      local_2d4 = *puVar15;
      uVar11 = FUN_1402970c0(lVar13,L"wszDyeingName");
      local_498 = 1;
      psVar16 = (short *)FUN_140296b70(lVar13,uVar2,uVar11,L"wszDyeingName");
      uVar21 = 0xffffffffffffffff;
      psVar27 = psVar16;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar27;
        psVar27 = psVar27 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_2d0,psVar16,~uVar21 - 1);
      uVar11 = FUN_1402970c0(lVar13,L"nDyeingDesc");
      local_498 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar13,uVar2,uVar11,L"nDyeingDesc");
      local_2a8 = *puVar15;
      uVar11 = FUN_1402970c0(lVar13,L"nGoldCost");
      local_498 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar13,uVar2,uVar11,L"nGoldCost");
      local_220 = *puVar15;
      uVar11 = FUN_1402970c0(lVar13,L"fGlowSpeed");
      local_498 = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar13,uVar2,uVar11,L"fGlowSpeed");
      local_218 = *puVar15;
      uVar11 = FUN_1402970c0(lVar13,L"nOutLine");
      local_498 = 1;
      lVar17 = FUN_140296600(lVar13,uVar2,uVar11,L"nOutLine");
      local_214 = lVar17 != 0;
      uVar11 = FUN_1402970c0(lVar13,L"fDyeingSuccess");
      local_498 = 1;
      pfVar18 = (float *)FUN_1402967b0(lVar13,uVar2,uVar11,L"fDyeingSuccess");
      puVar6 = PTR_u_fDyeingPro00_1405e0f90;
      local_21c = *pfVar18 * 100.0;
      uVar11 = FUN_1402970c0(lVar13,PTR_u_fDyeingPro00_1405e0f90);
      local_498 = 1;
      pfVar18 = (float *)FUN_1402967b0(lVar13,uVar2,uVar11,puVar6);
      puVar6 = PTR_u_fDyeingPro01_1405e0f98;
      local_210[9] = *pfVar18 * 100.0;
      uVar11 = FUN_1402970c0(lVar13,PTR_u_fDyeingPro01_1405e0f98);
      local_498 = 1;
      pfVar18 = (float *)FUN_1402967b0(lVar13,uVar2,uVar11,puVar6);
      puVar6 = PTR_u_fDyeingPro02_1405e0fa0;
      local_1e8 = *pfVar18 * 100.0 + local_210[9];
      uVar11 = FUN_1402970c0(lVar13,PTR_u_fDyeingPro02_1405e0fa0);
      local_498 = 1;
      pfVar18 = (float *)FUN_1402967b0(lVar13,uVar2,uVar11,puVar6);
      puVar6 = PTR_u_fFailPro00_1405e0fc0;
      local_1e4 = *pfVar18 * 100.0 + local_1e8;
      uVar11 = FUN_1402970c0(lVar13,PTR_u_fFailPro00_1405e0fc0);
      local_498 = 1;
      pfVar18 = (float *)FUN_1402967b0(lVar13,uVar2,uVar11,puVar6);
      puVar6 = PTR_u_fFailPro01_1405e0fc8;
      local_1e0[3] = *pfVar18 * 100.0;
      uVar11 = FUN_1402970c0(lVar13,PTR_u_fFailPro01_1405e0fc8);
      local_498 = 1;
      pfVar18 = (float *)FUN_1402967b0(lVar13,uVar2,uVar11,puVar6);
      puVar6 = PTR_u_fFailPro02_1405e0fd0;
      local_1d0 = *pfVar18 * 100.0 + local_1e0[3];
      uVar11 = FUN_1402970c0(lVar13,PTR_u_fFailPro02_1405e0fd0);
      local_498 = 1;
      pfVar18 = (float *)FUN_1402967b0(lVar13,uVar2,uVar11,puVar6);
      local_1cc = *pfVar18 * 100.0 + local_1d0;
      pfVar18 = local_210 + 3;
      puVar15 = puVar25;
      do {
        uVar3 = *(undefined8 *)(puVar15 + 0x50178222);
        uVar11 = FUN_1402970c0(lVar13,uVar3);
        local_498 = 1;
        pfVar19 = (float *)FUN_140296600(lVar13,uVar2,uVar11,uVar3);
        pfVar18[-3] = *pfVar19;
        uVar3 = *(undefined8 *)(puVar15 + 0x501783d8);
        uVar11 = FUN_1402970c0(lVar13,uVar3);
        local_498 = 1;
        pfVar19 = (float *)FUN_140296600(lVar13,uVar2,uVar11,uVar3);
        *pfVar18 = *pfVar19;
        uVar3 = *(undefined8 *)(puVar15 + 0x501783de);
        uVar11 = FUN_1402970c0(lVar13,uVar3);
        local_498 = 1;
        pfVar19 = (float *)FUN_140296600(lVar13,uVar2,uVar11,uVar3);
        pfVar18[3] = *pfVar19;
        uVar3 = *(undefined8 *)(puVar15 + 0x501783ea);
        uVar11 = FUN_1402970c0(lVar13,uVar3);
        local_498 = 1;
        pfVar19 = (float *)FUN_140296600(lVar13,uVar2,uVar11,uVar3);
        pfVar18[9] = *pfVar19;
        puVar15 = puVar15 + 2;
        pfVar18 = pfVar18 + 1;
      } while ((longlong)puVar15 < 0x18);
      uVar11 = FUN_1402970c0(lVar13,L"szClass");
      local_498 = 1;
      psVar16 = (short *)FUN_140296990(lVar13,uVar2,uVar11,L"szClass");
      local_318 = 7;
      local_320 = 0;
      local_330 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar27 = psVar16;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar27;
        psVar27 = psVar27 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_330,psVar16,~uVar21 - 1);
      local_380 = (wchar_t *)0x0;
      local_378 = (wchar_t *)0x0;
      local_370 = 0;
      puVar24 = &local_330;
      if (7 < local_318) {
        puVar24 = (undefined2 *)CONCAT62(uStack_32e,local_330);
      }
      FUN_140415930(&local_380,puVar24,&DAT_14049c7b8);
      puVar15 = (undefined4 *)(((longlong)local_378 - (longlong)local_380) / 0x28);
      pwVar28 = local_380;
      puVar14 = puVar25;
      local_478 = puVar15;
      if (puVar15 != (undefined4 *)0x0) {
        do {
          pwVar22 = pwVar28;
          if (7 < *(ulonglong *)(pwVar28 + 0xc)) {
            pwVar22 = *(wchar_t **)pwVar28;
          }
          iVar12 = _wtoi(pwVar22);
          local_488[0] = iVar12;
          if ((local_488 < local_298) && (local_2a0 <= local_488)) {
            lVar17 = (longlong)local_488 - (longlong)local_2a0;
            if (local_298 == local_290) {
              uVar21 = (longlong)local_298 - (longlong)local_2a0 >> 2;
              if (0x3ffffffffffffffe < uVar21) {
                std::_Xlength_error("vector<T> too long");
                pcVar4 = (code *)swi(3);
                (*pcVar4)();
                return;
              }
              puVar26 = (undefined4 *)(uVar21 + 1);
              puVar23 = (undefined4 *)((longlong)local_290 - (longlong)local_2a0 >> 2);
              puVar15 = local_478;
              if (puVar23 < puVar26) {
                puVar15 = puVar25;
                if (puVar23 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar23 >> 1))) {
                  puVar15 = (undefined4 *)((longlong)puVar23 + ((ulonglong)puVar23 >> 1));
                }
                if (puVar15 < puVar26) {
                  puVar15 = puVar26;
                }
                FUN_140051e60(&local_2a0,puVar15);
                puVar15 = local_478;
              }
            }
            if (local_298 != (int *)0x0) {
              *local_298 = local_2a0[lVar17 >> 2];
            }
          }
          else {
            if (local_298 == local_290) {
              uVar21 = (longlong)local_298 - (longlong)local_2a0 >> 2;
              if (0x3ffffffffffffffe < uVar21) {
                std::_Xlength_error("vector<T> too long");
                return;
              }
              puVar26 = (undefined4 *)(uVar21 + 1);
              puVar23 = (undefined4 *)((longlong)local_290 - (longlong)local_2a0 >> 2);
              puVar15 = local_478;
              if (puVar23 < puVar26) {
                puVar15 = puVar25;
                if (puVar23 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar23 >> 1))) {
                  puVar15 = (undefined4 *)((longlong)puVar23 + ((ulonglong)puVar23 >> 1));
                }
                if (puVar15 < puVar26) {
                  puVar15 = puVar26;
                }
                FUN_140051e60(&local_2a0,puVar15);
                puVar15 = local_478;
              }
            }
            if (local_298 != (int *)0x0) {
              *local_298 = iVar12;
            }
          }
          local_298 = local_298 + 1;
          puVar14 = (undefined4 *)(ulonglong)((int)puVar14 + 1);
          pwVar28 = pwVar28 + 0x14;
        } while (puVar14 < puVar15);
      }
      uVar11 = FUN_1402970c0(lVar13,L"szDyeingGlowColor");
      local_498 = 1;
      psVar16 = (short *)FUN_140296990(lVar13,uVar2,uVar11,L"szDyeingGlowColor");
      local_2f0 = 7;
      local_2f8 = 0;
      local_308 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar27 = psVar16;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar27;
        psVar27 = psVar27 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_308,psVar16,~uVar21 - 1);
      uVar11 = FUN_1402970c0(lVar13,L"szDyeingColor");
      local_498 = 1;
      psVar16 = (short *)FUN_140296990(lVar13,uVar2,uVar11,L"szDyeingColor");
      local_340 = 7;
      local_348 = 0;
      local_358 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar27 = psVar16;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar27;
        psVar27 = psVar27 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_358,psVar16,~uVar21 - 1);
      local_3c0 = (wchar_t *)0x0;
      local_3b8 = (wchar_t *)0x0;
      local_3b0 = 0;
      local_3a0 = (undefined8 *)0x0;
      local_398 = (undefined8 *)0x0;
      local_390 = 0;
      puVar24 = &local_358;
      if (7 < local_340) {
        puVar24 = (undefined2 *)CONCAT62(uStack_356,local_358);
      }
      FUN_140415930(&local_3c0,puVar24,&DAT_14049c7b8);
      puVar24 = &local_308;
      if (7 < local_2f0) {
        puVar24 = (undefined2 *)CONCAT62(uStack_306,local_308);
      }
      FUN_140415930(&local_3a0,puVar24,&DAT_14049c7b8);
      local_78 = 0;
      local_70 = 0;
      if (((longlong)local_3b8 - (longlong)local_3c0) / 0x28 == 3) {
        local_418 = 0x3f800000;
        uStack_414 = 0x3f800000;
        local_410 = 0x3f800000;
        uStack_40c = 0x3f800000;
        local_a8 = 0x3f8000003f800000;
        local_a0 = 0x3f8000003f800000;
        local_428 = 0x3f800000;
        uStack_424 = 0x3f800000;
        local_420 = 0x3f800000;
        uStack_41c = 0x3f800000;
        local_98 = 0x3f8000003f800000;
        local_90 = 0x3f8000003f800000;
        local_408 = 0x3f800000;
        uStack_404 = 0x3f800000;
        local_400 = 0x3f800000;
        uStack_3fc = 0x3f800000;
        local_88 = 0x3f8000003f800000;
        local_80 = 0x3f8000003f800000;
        local_464 = 0x3f800000;
        puVar29 = (uint *)&local_78;
        lVar17 = 3;
        puVar15 = puVar25;
        pwVar28 = local_3c0;
        do {
          pwVar22 = pwVar28;
          if (7 < *(ulonglong *)(pwVar28 + 0xc)) {
            pwVar22 = *(wchar_t **)pwVar28;
          }
          swscanf_s(pwVar22,L"%x");
          uVar10 = *puVar29;
          local_470 = (float)(uVar10 >> 0x10 & 0xff) / 255.0;
          local_46c = (float)(uVar10 >> 8 & 0xff) / 255.0;
          local_468 = (float)(uVar10 & 0xff) / 255.0;
          *(float *)((longlong)&local_a8 + (longlong)puVar15) = local_470;
          *(float *)((longlong)&local_a8 + 4 + (longlong)puVar15) = local_46c;
          *(float *)((longlong)&local_a0 + (longlong)puVar15) = local_468;
          *(undefined4 *)((longlong)&local_a0 + 4 + (longlong)puVar15) = 0x3f800000;
          local_454 = *(undefined4 *)((longlong)&local_a0 + 4 + (longlong)puVar15);
          local_458 = *(undefined4 *)((longlong)&local_a0 + (longlong)puVar15);
          local_45c = *(undefined4 *)((longlong)&local_a8 + 4 + (longlong)puVar15);
          local_460 = *(undefined4 *)((longlong)&local_a8 + (longlong)puVar15);
          *(undefined4 *)((longlong)auStack_280 + (longlong)puVar15) = local_460;
          *(undefined4 *)((longlong)(auStack_280 + 1) + (longlong)puVar15) = local_45c;
          *(undefined4 *)((longlong)(auStack_280 + 2) + (longlong)puVar15) = local_458;
          *(undefined4 *)((longlong)(auStack_280 + 3) + (longlong)puVar15) = local_454;
          pwVar28 = pwVar28 + 0x14;
          puVar29 = puVar29 + 1;
          puVar15 = puVar15 + 4;
          lVar17 = lVar17 + -1;
          lVar13 = local_3f8;
        } while (lVar17 != 0);
      }
      if (((longlong)local_398 - (longlong)local_3a0) / 0x28 == 3) {
        local_3f0 = 0x3f800000;
        uStack_3ec = 0x3f800000;
        local_3e8 = 0x3f800000;
        uStack_3e4 = 0x3f800000;
        local_a8 = 0x3f8000003f800000;
        local_a0 = 0x3f8000003f800000;
        local_3d0 = 0x3f800000;
        uStack_3cc = 0x3f800000;
        local_3c8 = 0x3f800000;
        uStack_3c4 = 0x3f800000;
        local_98 = 0x3f8000003f800000;
        local_90 = 0x3f8000003f800000;
        local_3e0 = 0x3f800000;
        uStack_3dc = 0x3f800000;
        local_3d8 = 0x3f800000;
        uStack_3d4 = 0x3f800000;
        local_88 = 0x3f8000003f800000;
        local_80 = 0x3f8000003f800000;
        local_444 = 0x3f800000;
        puVar29 = (uint *)&local_78;
        lVar17 = 3;
        puVar15 = puVar25;
        pwVar28 = local_3c0;
        do {
          pwVar22 = pwVar28;
          if (7 < *(ulonglong *)(pwVar28 + 0xc)) {
            pwVar22 = *(wchar_t **)pwVar28;
          }
          swscanf_s(pwVar22,L"%x");
          uVar10 = *puVar29;
          local_450 = (float)(uVar10 >> 0x10 & 0xff) / 255.0;
          local_44c = (float)(uVar10 >> 8 & 0xff) / 255.0;
          local_448 = (float)(uVar10 & 0xff) / 255.0;
          *(float *)((longlong)&local_a8 + (longlong)puVar15) = local_450;
          *(float *)((longlong)&local_a8 + 4 + (longlong)puVar15) = local_44c;
          *(float *)((longlong)&local_a0 + (longlong)puVar15) = local_448;
          *(undefined4 *)((longlong)&local_a0 + 4 + (longlong)puVar15) = 0x3f800000;
          local_430 = *(undefined4 *)((longlong)&local_a0 + 4 + (longlong)puVar15);
          local_434 = *(undefined4 *)((longlong)&local_a0 + (longlong)puVar15);
          local_438 = *(undefined4 *)((longlong)&local_a8 + 4 + (longlong)puVar15);
          local_43c = *(undefined4 *)((longlong)&local_a8 + (longlong)puVar15);
          *(undefined4 *)((longlong)auStack_250 + (longlong)puVar15) = local_43c;
          *(undefined4 *)((longlong)(auStack_250 + 1) + (longlong)puVar15) = local_438;
          *(undefined4 *)((longlong)(auStack_250 + 2) + (longlong)puVar15) = local_434;
          *(undefined4 *)((longlong)(auStack_250 + 3) + (longlong)puVar15) = local_430;
          pwVar28 = pwVar28 + 0x14;
          puVar29 = puVar29 + 1;
          puVar15 = puVar15 + 4;
          lVar17 = lVar17 + -1;
          lVar13 = local_3f8;
        } while (lVar17 != 0);
      }
      puVar9 = local_398;
      puVar8 = local_3a0;
      puVar15 = (undefined4 *)FUN_1401496b0(local_1c8,&local_440,&local_2d8);
      FUN_1401495d0(*puVar15);
      if (local_188 != (void *)0x0) {
        operator_delete(local_188);
      }
      local_188 = (void *)0x0;
      local_180 = 0;
      local_178 = 0;
      if (7 < local_1a0) {
        operator_delete(local_1b8);
      }
      puVar5 = puVar8;
      if (puVar8 != (undefined8 *)0x0) {
        for (; puVar5 != puVar9; puVar5 = puVar5 + 5) {
          if (7 < (ulonglong)puVar5[3]) {
            operator_delete((void *)*puVar5);
          }
          puVar5[3] = 7;
          puVar5[2] = 0;
          *(undefined2 *)puVar5 = 0;
        }
        operator_delete(puVar8);
      }
      pwVar7 = local_3b8;
      pwVar22 = local_3c0;
      pwVar28 = local_3c0;
      if (local_3c0 != (wchar_t *)0x0) {
        for (; pwVar28 != pwVar7; pwVar28 = pwVar28 + 0x14) {
          if (7 < *(ulonglong *)(pwVar28 + 0xc)) {
            operator_delete(*(void **)pwVar28);
          }
          pwVar28[0xc] = L'\a';
          pwVar28[0xd] = L'\0';
          pwVar28[0xe] = L'\0';
          pwVar28[0xf] = L'\0';
          pwVar28[8] = L'\0';
          pwVar28[9] = L'\0';
          pwVar28[10] = L'\0';
          pwVar28[0xb] = L'\0';
          *pwVar28 = L'\0';
        }
        operator_delete(pwVar22);
      }
      if (7 < local_340) {
        operator_delete((void *)CONCAT62(uStack_356,local_358));
      }
      local_340 = 7;
      local_348 = 0;
      local_358 = 0;
      if (7 < local_2f0) {
        operator_delete((void *)CONCAT62(uStack_306,local_308));
      }
      pwVar7 = local_378;
      pwVar22 = local_380;
      local_2f0 = 7;
      local_2f8 = 0;
      local_308 = 0;
      pwVar28 = local_380;
      if (local_380 != (wchar_t *)0x0) {
        for (; pwVar28 != pwVar7; pwVar28 = pwVar28 + 0x14) {
          if (7 < *(ulonglong *)(pwVar28 + 0xc)) {
            operator_delete(*(void **)pwVar28);
          }
          pwVar28[0xc] = L'\a';
          pwVar28[0xd] = L'\0';
          pwVar28[0xe] = L'\0';
          pwVar28[0xf] = L'\0';
          pwVar28[8] = L'\0';
          pwVar28[9] = L'\0';
          pwVar28[10] = L'\0';
          pwVar28[0xb] = L'\0';
          *pwVar28 = L'\0';
        }
        operator_delete(pwVar22);
      }
      if (7 < local_318) {
        operator_delete((void *)CONCAT62(uStack_32e,local_330));
      }
      local_318 = 7;
      local_320 = 0;
      local_330 = 0;
      if (local_2a0 != (int *)0x0) {
        operator_delete(local_2a0);
      }
      local_2a0 = (int *)0x0;
      local_298 = (int *)0x0;
      local_290 = (int *)0x0;
      if (7 < local_2b8) {
        operator_delete((void *)CONCAT62(uStack_2ce,local_2d0));
      }
      puVar15 = *(undefined4 **)(local_480 + 6);
      if (puVar15 == (undefined4 *)0x0) {
        uVar10 = (uint)local_480[8] % *(uint *)(lVar13 + 0x78) + 1;
        lVar17 = (longlong)(int)uVar10 << 3;
        puVar15 = puVar25;
        do {
          if (*(uint *)(lVar13 + 0x78) <= uVar10) break;
          if (*(longlong *)(lVar17 + *(longlong *)(lVar13 + 0x68)) != 0) {
            puVar15 = *(undefined4 **)(lVar17 + *(longlong *)(lVar13 + 0x68));
          }
          uVar10 = uVar10 + 1;
          lVar17 = lVar17 + 8;
        } while (puVar15 == (undefined4 *)0x0);
      }
      goto LAB_14013cf6a;
    }
  }
  return;
}



void FUN_14013dda0(longlong param_1)

{
  if (*(void **)(param_1 + 0x38) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 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_14013de00(longlong param_1)

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



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

{
  int iVar1;
  int iVar2;
  uint *puVar3;
  float fVar4;
  
  if (*param_1 != 0) {
    for (puVar3 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x46)) {
      if ((puVar3[0x48] == param_2) && (*puVar3 == param_2)) goto LAB_14013dea1;
    }
  }
  puVar3 = (uint *)0x0;
LAB_14013dea1:
  if ((puVar3 == (uint *)0x0) || (puVar3 == (uint *)0xfffffffffffffff8)) {
    return 0x121;
  }
  iVar1 = rand();
  iVar2 = rand();
  fVar4 = (float)iVar2 * 3.0517578e-05 * 100.0;
  if ((float)puVar3[0x31] <= (float)iVar1 * 3.0517578e-05 * 100.0) {
    if ((0.0 <= fVar4) && (fVar4 < (float)puVar3[0x43])) {
      *param_3 = puVar3[0x40];
      return 0x124;
    }
    if (((float)puVar3[0x43] <= fVar4) && (fVar4 < (float)puVar3[0x44])) {
      *param_3 = puVar3[0x41];
      return 0x124;
    }
    *param_3 = puVar3[0x42];
    return 0x124;
  }
  if ((0.0 <= fVar4) && (fVar4 < (float)puVar3[0x3d])) {
    *param_3 = puVar3[0x3a];
    return 0x122;
  }
  if (((float)puVar3[0x3d] <= fVar4) && (fVar4 < (float)puVar3[0x3e])) {
    *param_3 = puVar3[0x3b];
    return 0x123;
  }
  *param_3 = puVar3[0x3c];
  return 0x123;
}



undefined4 * FUN_14013e010(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_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff,0xfffffffffffffffe);
  param_1[0xc] = param_2[0xc];
  FUN_14012e520(param_1 + 0xe,param_2 + 0xe);
  memcpy(param_1 + 0x16,param_2 + 0x16,0x30);
  memcpy(param_1 + 0x22,param_2 + 0x22,0x30);
  param_1[0x2e] = param_2[0x2e];
  param_1[0x2f] = param_2[0x2f];
  param_1[0x30] = param_2[0x30];
  *(undefined1 *)(param_1 + 0x31) = *(undefined1 *)(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];
  param_1[0x36] = param_2[0x36];
  param_1[0x37] = param_2[0x37];
  param_1[0x38] = param_2[0x38];
  param_1[0x39] = param_2[0x39];
  param_1[0x3a] = param_2[0x3a];
  param_1[0x3b] = param_2[0x3b];
  param_1[0x3c] = param_2[0x3c];
  param_1[0x3d] = param_2[0x3d];
  param_1[0x3e] = param_2[0x3e];
  param_1[0x3f] = param_2[0x3f];
  param_1[0x40] = param_2[0x40];
  param_1[0x41] = param_2[0x41];
  param_1[0x42] = param_2[0x42];
  param_1[0x43] = param_2[0x43];
  return param_1;
}



undefined8 * FUN_14013e1c0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetHairDyeingItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cea0 & 1) == 0) {
    DAT_14060cea0 = DAT_14060cea0 | 1;
    FUN_140149500(0x3f400000,0x3e800000,0x40100000);
    FUN_14013ceb0();
    atexit((_func_5014 *)&LAB_140448710);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetHairDyeingItemDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608eb0;
}



void thunk_FUN_140149870(void)

{
  FUN_140149870();
  return;
}



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

void FUN_14013e280(void)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong lVar6;
  short *psVar8;
  undefined4 *puVar9;
  longlong lVar10;
  longlong *plVar11;
  ulonglong uVar12;
  short *psVar13;
  undefined4 *puVar14;
  undefined1 auStack_2e8 [32];
  undefined1 local_2c8;
  undefined4 local_2b8 [2];
  undefined8 local_2b0;
  undefined4 local_2a8 [2];
  undefined2 local_2a0;
  undefined6 uStack_29e;
  undefined8 local_290;
  ulonglong local_288;
  undefined2 local_278;
  undefined6 uStack_276;
  undefined8 local_268;
  ulonglong local_260;
  undefined4 local_250;
  undefined4 local_24c;
  undefined4 local_248;
  undefined2 local_240;
  undefined6 uStack_23e;
  undefined8 local_230;
  ulonglong local_228;
  undefined4 local_218;
  undefined4 local_214;
  undefined4 local_210;
  undefined4 local_20c;
  undefined4 local_208;
  undefined4 local_204;
  undefined4 local_200;
  undefined4 local_1fc;
  undefined4 local_1f8;
  undefined4 local_1f4;
  undefined4 local_1f0;
  undefined4 local_1ec;
  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;
  undefined4 local_1a4;
  undefined4 local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined1 local_168 [8];
  undefined1 local_160 [312];
  ulonglong local_28;
  undefined4 *puVar7;
  
  local_2b0 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_2e8;
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"UNION_PACKAGE");
  if ((lVar5 != 0) && (lVar6 = FUN_1402933b0(DAT_140607ff0,L"UNION_PACKAGE_STRING"), lVar6 != 0)) {
    puVar14 = (undefined4 *)0x0;
    puVar9 = puVar14;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar7 = puVar14;
      plVar11 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar11 != 0) {
          puVar9 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar7];
          break;
        }
        uVar3 = (int)puVar7 + 1;
        puVar7 = (undefined4 *)(ulonglong)uVar3;
        plVar11 = plVar11 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_14013e333:
    puVar7 = puVar9;
    if (puVar7 != (undefined4 *)0x0) {
      uVar2 = *puVar7;
      local_288 = 7;
      local_290 = 0;
      local_2a0 = 0;
      local_260 = 7;
      local_268 = 0;
      local_278 = 0;
      local_228 = 7;
      local_230 = 0;
      local_240 = 0;
      local_2b8[0] = uVar2;
      local_2a8[0] = uVar2;
      uVar4 = FUN_1402970c0(lVar6,L"wszName");
      local_2c8 = 1;
      psVar8 = (short *)FUN_140296b70(lVar6,uVar2,uVar4,L"wszName");
      uVar12 = 0xffffffffffffffff;
      psVar13 = psVar8;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_2a0,psVar8,~uVar12 - 1);
      uVar4 = FUN_1402970c0(lVar6,L"wszDesc");
      local_2c8 = 1;
      psVar8 = (short *)FUN_140296b70(lVar6,uVar2,uVar4,L"wszDesc");
      uVar12 = 0xffffffffffffffff;
      psVar13 = psVar8;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_278,psVar8,~uVar12 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"nEffectRemainTime");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nEffectRemainTime");
      local_248 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nPackageType");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nPackageType");
      local_250 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nOverlay");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nOverlay");
      local_24c = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"szPackageIcon");
      local_2c8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szPackageIcon");
      uVar12 = 0xffffffffffffffff;
      psVar13 = psVar8;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_240,psVar8,~uVar12 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"nEffectCode00");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nEffectCode00");
      local_218 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nEffectCode01");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nEffectCode01");
      local_214 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nEffectCode02");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nEffectCode02");
      local_210 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nEffectCode03");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nEffectCode03");
      local_20c = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nEffectCode04");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nEffectCode04");
      local_208 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nEffectCode05");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nEffectCode05");
      local_204 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"fEffectValue00");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fEffectValue00");
      local_200 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"fEffectValue01");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fEffectValue01");
      local_1fc = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"fEffectValue02");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fEffectValue02");
      local_1f8 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"fEffectValue03");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fEffectValue03");
      local_1f4 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"fEffectValue04");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fEffectValue04");
      local_1f0 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"fEffectValue05");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fEffectValue05");
      local_1ec = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode00");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode00");
      local_1e8 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode01");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode01");
      local_1e4 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode02");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode02");
      local_1e0 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode03");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode03");
      local_1dc = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode04");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode04");
      local_1d8 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode05");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode05");
      local_1d4 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode06");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode06");
      local_1d0 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode07");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode07");
      local_1cc = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode08");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode08");
      local_1c8 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode09");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode09");
      local_1c4 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode10");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode10");
      local_1c0 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCode11");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCode11");
      local_1bc = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount00");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount00");
      local_1b8 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount01");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount01");
      local_1b4 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount02");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount02");
      local_1b0 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount03");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount03");
      local_1ac = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount04");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount04");
      local_1a8 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount05");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount05");
      local_1a4 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount06");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount06");
      local_1a0 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount07");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount07");
      local_19c = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount08");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount08");
      local_198 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount09");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount09");
      local_194 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount10");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount10");
      local_190 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nItemCount11");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nItemCount11");
      local_18c = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nStringID00");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nStringID00");
      local_188 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nStringID01");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nStringID01");
      local_184 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nStringID02");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nStringID02");
      local_180 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nStringID03");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nStringID03");
      local_17c = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nStringID04");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nStringID04");
      local_178 = *puVar9;
      uVar4 = FUN_1402970c0(lVar5,L"nStringID05");
      local_2c8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nStringID05");
      local_174 = *puVar9;
      puVar9 = (undefined4 *)FUN_140149890(local_168,local_2b8,local_2a8);
      FUN_1401497b0(*puVar9);
      FUN_14013ed60(local_160);
      if (7 < local_228) {
        operator_delete((void *)CONCAT62(uStack_23e,local_240));
      }
      local_228 = 7;
      local_230 = 0;
      local_240 = 0;
      if (7 < local_260) {
        operator_delete((void *)CONCAT62(uStack_276,local_278));
      }
      local_260 = 7;
      local_268 = 0;
      local_278 = 0;
      if (7 < local_288) {
        operator_delete((void *)CONCAT62(uStack_29e,local_2a0));
      }
      puVar9 = *(undefined4 **)(puVar7 + 6);
      if (*(undefined4 **)(puVar7 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar7[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar10 = (longlong)(int)uVar3 << 3;
        puVar9 = puVar14;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar10) != 0) {
            puVar9 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar10);
          }
          uVar3 = uVar3 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar9 == (undefined4 *)0x0);
      }
      goto LAB_14013e333;
    }
  }
  return;
}



void FUN_14013ed60(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x80)) {
    operator_delete(*(void **)(param_1 + 0x68));
  }
  *(undefined8 *)(param_1 + 0x80) = 7;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined2 *)(param_1 + 0x68) = 0;
  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_14013edf0(longlong param_1)

{
  FUN_14013ed60(param_1 + 8);
  return;
}



void FUN_14013ee00(longlong *param_1,uint param_2,uint *param_3,uint *param_4)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x50)) {
      if ((puVar1[0x52] == param_2) && (*puVar1 == param_2)) goto LAB_14013ee3c;
    }
  }
  puVar1 = (uint *)0x0;
LAB_14013ee3c:
  if (puVar1 != (uint *)0x0) {
    *param_3 = puVar1[0x32];
    param_3[1] = puVar1[0x33];
    param_3[2] = puVar1[0x34];
    param_3[3] = puVar1[0x35];
    param_3[4] = puVar1[0x36];
    param_3[5] = puVar1[0x37];
    param_3[6] = puVar1[0x38];
    param_3[7] = puVar1[0x39];
    param_3[8] = puVar1[0x3a];
    param_3[9] = puVar1[0x3b];
    param_3[10] = puVar1[0x3c];
    param_3[0xb] = puVar1[0x3d];
    *param_4 = puVar1[0x3e];
    param_4[1] = puVar1[0x3f];
    param_4[2] = puVar1[0x40];
    param_4[3] = puVar1[0x41];
    param_4[4] = puVar1[0x42];
    param_4[5] = puVar1[0x43];
    param_4[6] = puVar1[0x44];
    param_4[7] = puVar1[0x45];
    param_4[8] = puVar1[0x46];
    param_4[9] = puVar1[0x47];
    param_4[10] = puVar1[0x48];
    param_4[0xb] = puVar1[0x49];
  }
  return;
}



undefined8 * FUN_14013ef40(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetUnionPackageItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce9c & 1) == 0) {
    DAT_14060ce9c = DAT_14060ce9c | 1;
    FUN_1401496e0(0x3f400000,0x3e800000,0x40100000);
    FUN_14013e280();
    atexit((_func_5014 *)&LAB_140448720);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetUnionPackageItemDB",uVar3,
                  pcVar4,DVar5);
  }
  return &DAT_140608e60;
}



// WARNING: Removing unreachable block (ram,0x00014013f0b8)
// WARNING: Removing unreachable block (ram,0x00014013f0c1)
// WARNING: Removing unreachable block (ram,0x00014013f0e2)
// WARNING: Removing unreachable block (ram,0x00014013f0eb)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14013eff0(void)

{
  undefined8 in_R9;
  
  FUN_1401498c0(0x3f400000,0x3e800000,0x40100000,in_R9,0xfffffffffffffffe);
  _DAT_140608e18 = 0;
  _DAT_140608e20 = 0;
  _DAT_140608e28 = 0x11;
  _DAT_140608e48 = 0;
  _DAT_140608e4c = 10;
  _DAT_140608e50 = 0;
  _DAT_140608e58 = 0;
  _DAT_140608e2c = 0x3f400000;
  _DAT_140608e30 = 0x3e800000;
  _DAT_140608e34 = 0x40100000;
  _DAT_140608e38 = 0x26;
  _DAT_140608e40 = 0;
  FUN_14013f140();
  return &DAT_140608dd0;
}



void thunk_FUN_140149a60(void)

{
  FUN_140149a60();
  return;
}



void FUN_14013f140(void)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  uint uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  longlong lVar7;
  ulonglong uVar8;
  undefined4 *puVar9;
  ulonglong *puVar10;
  longlong lVar11;
  longlong *plVar12;
  undefined4 *puVar13;
  undefined4 local_res8 [2];
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  
  lVar7 = FUN_1402933b0(DAT_140607ff0,L"COSTUME_SELECT_OPTION");
  if (lVar7 != 0) {
    if (*(longlong *)(lVar7 + 0x70) != 0) {
      uVar8 = 0;
      if (*(uint *)(lVar7 + 0x78) != 0) {
        plVar12 = *(longlong **)(lVar7 + 0x68);
        do {
          if (*plVar12 != 0) {
            puVar9 = (undefined4 *)(*(longlong **)(lVar7 + 0x68))[uVar8];
            goto LAB_14013f1b0;
          }
          uVar3 = (int)uVar8 + 1;
          uVar8 = (ulonglong)uVar3;
          plVar12 = plVar12 + 1;
        } while (uVar3 < *(uint *)(lVar7 + 0x78));
      }
    }
    puVar9 = (undefined4 *)0x0;
LAB_14013f1b0:
    puVar13 = puVar9;
    if (puVar13 != (undefined4 *)0x0) {
      uVar1 = *puVar13;
      local_res8[0] = uVar1;
      uVar4 = FUN_1402970c0(lVar7,L"nGroupID");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar4,L"nGroupID",1);
      uVar4 = *puVar9;
      uVar5 = FUN_1402970c0(lVar7,L"nCostumeOptionID");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar5,L"nCostumeOptionID",1);
      uVar5 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nCostumeOptionValue");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nCostumeOptionValue",1);
      local_28 = *puVar9;
      local_34 = uVar1;
      local_30 = uVar4;
      local_2c = uVar5;
      FUN_140149990(uVar1,&local_34);
      puVar10 = (ulonglong *)FUN_140148a60(&DAT_140608e18);
      puVar9 = (undefined4 *)puVar10[1];
      if ((local_res8 < puVar9) && (puVar2 = (undefined4 *)*puVar10, puVar2 <= local_res8)) {
        if (puVar9 == (undefined4 *)puVar10[2]) {
          FUN_1400556a0(puVar10,1);
        }
        if ((undefined4 *)puVar10[1] != (undefined4 *)0x0) {
          *(undefined4 *)puVar10[1] =
               *(undefined4 *)(*puVar10 + ((longlong)local_res8 - (longlong)puVar2 >> 2) * 4);
        }
      }
      else {
        if (puVar9 == (undefined4 *)puVar10[2]) {
          FUN_1400556a0(puVar10);
        }
        if ((undefined4 *)puVar10[1] != (undefined4 *)0x0) {
          *(undefined4 *)puVar10[1] = uVar1;
        }
      }
      puVar10[1] = puVar10[1] + 4;
      puVar9 = *(undefined4 **)(puVar13 + 6);
      if (puVar9 == (undefined4 *)0x0) {
        uVar3 = (uint)puVar13[8] % *(uint *)(lVar7 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar3 << 3;
        do {
          if (*(uint *)(lVar7 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar11 + *(longlong *)(lVar7 + 0x68)) != 0) {
            puVar9 = *(undefined4 **)(lVar11 + *(longlong *)(lVar7 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar11 = lVar11 + 8;
        } while (puVar9 == (undefined4 *)0x0);
      }
      goto LAB_14013f1b0;
    }
  }
  return;
}



undefined8 * FUN_14013f360(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetCostumeSelectOptionDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce98 & 1) == 0) {
    DAT_14060ce98 = DAT_14060ce98 | 1;
    FUN_14013eff0();
    atexit(FUN_140448730);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetCostumeSelectOptionDB",uVar3,
                  pcVar4,DVar5);
  }
  return &DAT_140608dd0;
}



// WARNING: Removing unreachable block (ram,0x00014013f4b8)
// WARNING: Removing unreachable block (ram,0x00014013f4c1)
// WARNING: Removing unreachable block (ram,0x00014013f4e2)
// WARNING: Removing unreachable block (ram,0x00014013f4eb)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14013f3f0(void)

{
  undefined8 in_R9;
  
  FUN_140149a80(0x3f400000,0x3e800000,0x40100000,in_R9,0xfffffffffffffffe);
  DAT_140608d78 = 0;
  _DAT_140608d80 = 0;
  DAT_140608d88 = 0x11;
  _DAT_140608da8 = 0;
  _DAT_140608dac = 10;
  _DAT_140608db0 = 0;
  _DAT_140608db8 = 0;
  _DAT_140608d8c = 0x3f400000;
  _DAT_140608d90 = 0x3e800000;
  _DAT_140608d94 = 0x40100000;
  _DAT_140608d98 = 0x26;
  _DAT_140608da0 = 0;
  FUN_14013f540();
  return &DAT_140608d30;
}



void thunk_FUN_140149cb0(void)

{
  FUN_140149cb0();
  return;
}



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

void FUN_14013f540(void)

{
  ulonglong *puVar1;
  short sVar2;
  code *pcVar3;
  wchar_t *pwVar4;
  char cVar5;
  uint uVar6;
  undefined4 uVar7;
  int iVar8;
  longlong lVar9;
  short *psVar10;
  undefined4 *puVar11;
  uint *puVar12;
  longlong lVar13;
  longlong *plVar14;
  ulonglong uVar15;
  wchar_t *pwVar16;
  undefined2 *puVar17;
  undefined4 *puVar18;
  undefined4 *puVar19;
  undefined4 *puVar20;
  undefined4 uVar21;
  longlong lVar22;
  short *psVar23;
  undefined4 *puVar24;
  wchar_t *pwVar25;
  longlong lVar26;
  undefined1 auStack_258 [32];
  undefined1 local_238;
  undefined4 local_228;
  int local_224;
  undefined4 *local_220;
  wchar_t *local_218;
  wchar_t *local_210;
  undefined8 local_208;
  undefined8 local_1f8;
  undefined4 local_1e8 [2];
  undefined2 local_1e0;
  undefined6 uStack_1de;
  undefined8 local_1d0;
  ulonglong local_1c8;
  int *local_1b8;
  int *local_1b0;
  int *local_1a8;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  uint local_18c;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined2 local_128;
  undefined6 uStack_126;
  undefined8 local_118;
  ulonglong local_110;
  undefined4 local_f8;
  undefined1 local_f0 [8];
  void *local_e8;
  ulonglong local_d0;
  void *local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  ulonglong local_38;
  
  local_1f8 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  lVar9 = FUN_1402933b0(DAT_140607ff0,L"COSTUME_MIX");
  if (lVar9 != 0) {
    puVar20 = (undefined4 *)0x0;
    puVar11 = puVar20;
    if ((*(longlong *)(lVar9 + 0x70) != 0) && (*(uint *)(lVar9 + 0x78) != 0)) {
      puVar18 = puVar20;
      plVar14 = *(longlong **)(lVar9 + 0x68);
      do {
        if (*plVar14 != 0) {
          puVar11 = (undefined4 *)(*(longlong **)(lVar9 + 0x68))[(longlong)puVar18];
          break;
        }
        uVar6 = (int)puVar18 + 1;
        puVar18 = (undefined4 *)(ulonglong)uVar6;
        plVar14 = plVar14 + 1;
      } while (uVar6 < *(uint *)(lVar9 + 0x78));
    }
LAB_14013f5d2:
    if (puVar11 != (undefined4 *)0x0) {
      uVar21 = *puVar11;
      local_1c8 = 7;
      local_1d0 = 0;
      local_1e0 = 0;
      local_1b8 = (int *)0x0;
      local_1b0 = (int *)0x0;
      local_1a8 = (int *)0x0;
      local_228 = uVar21;
      local_220 = puVar11;
      local_1e8[0] = uVar21;
      uVar7 = FUN_1402970c0(lVar9,L"wszDesc");
      local_238 = 1;
      psVar10 = (short *)FUN_140296b70(lVar9,uVar21,uVar7,L"wszDesc");
      uVar15 = 0xffffffffffffffff;
      psVar23 = psVar10;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar2 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_1e0,psVar10,~uVar15 - 1);
      uVar7 = FUN_1402970c0(lVar9,L"nSortNumber");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nSortNumber");
      local_194 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nCategory");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nCategory");
      local_198 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nMixAble");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nMixAble");
      local_190 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nCost");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nCost");
      local_188 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nGroup");
      local_238 = 1;
      puVar12 = (uint *)FUN_140296600(lVar9,uVar21,uVar7,L"nGroup");
      local_18c = *puVar12;
      uVar7 = FUN_1402970c0(lVar9,L"fItemMixPro00");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_1402967b0(lVar9,uVar21,uVar7,L"fItemMixPro00");
      local_184 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"fItemMixPro01");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_1402967b0(lVar9,uVar21,uVar7,L"fItemMixPro01");
      local_180 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"fItemMixPro02");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_1402967b0(lVar9,uVar21,uVar7,L"fItemMixPro02");
      local_17c = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemMixCo00");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemMixCo00");
      local_178 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemMixCo01");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemMixCo01");
      local_174 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemMixCo02");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemMixCo02");
      local_170 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCode00");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCode00");
      local_16c = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCode01");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCode01");
      local_168 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCode02");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCode02");
      local_164 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCode03");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCode03");
      local_160 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCode04");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCode04");
      local_15c = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCount00");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCount00");
      local_158 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCount01");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCount01");
      local_154 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCount02");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCount02");
      local_150 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCount03");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCount03");
      local_14c = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nItemCount04");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nItemCount04");
      local_148 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nClassify00");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nClassify00");
      local_144 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nClassify01");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nClassify01");
      local_140 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nClassify02");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nClassify02");
      local_13c = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"nVisible");
      local_238 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar21,uVar7,L"nVisible");
      local_138 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"szCharacterNum");
      local_238 = 1;
      psVar10 = (short *)FUN_140296990(lVar9,uVar21,uVar7,L"szCharacterNum");
      local_110 = 7;
      local_118 = 0;
      local_128 = 0;
      uVar15 = 0xffffffffffffffff;
      psVar23 = psVar10;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar2 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_128,psVar10,~uVar15 - 1);
      local_218 = (wchar_t *)0x0;
      local_210 = (wchar_t *)0x0;
      local_208 = 0;
      puVar17 = &local_128;
      if (7 < local_110) {
        puVar17 = (undefined2 *)CONCAT62(uStack_126,local_128);
      }
      FUN_140415930(&local_218,puVar17,&DAT_14049c7b8);
      lVar13 = (longlong)local_210 - (longlong)local_218 >> 0x3f;
      lVar26 = ((longlong)local_210 - (longlong)local_218) / 0x28 + lVar13;
      pwVar25 = local_218;
      puVar11 = puVar20;
      if (lVar26 != lVar13) {
        do {
          pwVar16 = pwVar25;
          if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
            pwVar16 = *(wchar_t **)pwVar25;
          }
          iVar8 = _wtoi(pwVar16);
          local_224 = iVar8;
          if ((&local_224 < local_1b0) && (local_1b8 <= &local_224)) {
            lVar22 = (longlong)&local_224 - (longlong)local_1b8;
            if (local_1b0 == local_1a8) {
              uVar15 = (longlong)local_1b0 - (longlong)local_1b8 >> 2;
              if (0x3ffffffffffffffe < uVar15) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                (*pcVar3)();
                return;
              }
              puVar24 = (undefined4 *)(uVar15 + 1);
              puVar18 = (undefined4 *)((longlong)local_1a8 - (longlong)local_1b8 >> 2);
              if (puVar18 < puVar24) {
                puVar19 = puVar20;
                if (puVar18 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar18 >> 1))) {
                  puVar19 = (undefined4 *)((longlong)puVar18 + ((ulonglong)puVar18 >> 1));
                }
                if (puVar19 < puVar24) {
                  puVar19 = puVar24;
                }
                FUN_140051e60(&local_1b8,puVar19);
              }
            }
            if (local_1b0 != (int *)0x0) {
              *local_1b0 = local_1b8[lVar22 >> 2];
            }
          }
          else {
            if (local_1b0 == local_1a8) {
              uVar15 = (longlong)local_1b0 - (longlong)local_1b8 >> 2;
              if (0x3ffffffffffffffe < uVar15) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                (*pcVar3)();
                return;
              }
              puVar24 = (undefined4 *)(uVar15 + 1);
              puVar18 = (undefined4 *)((longlong)local_1a8 - (longlong)local_1b8 >> 2);
              if (puVar18 < puVar24) {
                puVar19 = puVar20;
                if (puVar18 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar18 >> 1))) {
                  puVar19 = (undefined4 *)((longlong)puVar18 + ((ulonglong)puVar18 >> 1));
                }
                if (puVar19 < puVar24) {
                  puVar19 = puVar24;
                }
                FUN_140051e60(&local_1b8,puVar19);
              }
            }
            if (local_1b0 != (int *)0x0) {
              *local_1b0 = iVar8;
            }
          }
          local_1b0 = local_1b0 + 1;
          puVar11 = (undefined4 *)(ulonglong)((int)puVar11 + 1);
          pwVar25 = pwVar25 + 0x14;
          uVar21 = local_228;
        } while (puVar11 < (undefined4 *)(lVar26 - lVar13));
      }
      pwVar25 = local_210;
      local_f8 = uVar21;
      FUN_140150bb0(local_f0,local_1e8);
      FUN_140149b50(local_f8);
      if (local_c0 != (void *)0x0) {
        operator_delete(local_c0);
      }
      local_c0 = (void *)0x0;
      local_b8 = 0;
      local_b0 = 0;
      if (7 < local_d0) {
        operator_delete(local_e8);
      }
      uVar6 = local_18c;
      uVar15 = (ulonglong)local_18c % (ulonglong)DAT_140608d88;
      if (DAT_140608d78 == 0) {
        cVar5 = FUN_1402c6d50(&DAT_140608d78,(ulonglong)DAT_140608d88,1);
        if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar12 = *(uint **)(DAT_140608d78 + uVar15 * 8); puVar12 != (uint *)0x0;
            puVar12 = *(uint **)(puVar12 + 10)) {
          if ((puVar12[0xc] == local_18c) && (*puVar12 == local_18c)) goto LAB_14013fda1;
        }
      }
      puVar12 = (uint *)FUN_1402da9c0(&DAT_140608d78,uVar6,uVar15,uVar6);
LAB_14013fda1:
      puVar1 = (ulonglong *)(puVar12 + 2);
      puVar11 = *(undefined4 **)(puVar12 + 4);
      if ((&local_228 < puVar11) && (puVar18 = (undefined4 *)*puVar1, puVar18 <= &local_228)) {
        if (puVar11 == *(undefined4 **)(puVar12 + 6)) {
          uVar15 = (longlong)puVar11 - (longlong)puVar18 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          if ((ulonglong)((longlong)*(undefined4 **)(puVar12 + 6) - (longlong)puVar18 >> 2) <
              uVar15 + 1) {
            FUN_140051e60(puVar1);
          }
        }
        if (*(undefined4 **)(puVar12 + 4) != (undefined4 *)0x0) {
          **(undefined4 **)(puVar12 + 4) =
               *(undefined4 *)(*puVar1 + ((longlong)&local_228 - (longlong)puVar18 >> 2) * 4);
        }
      }
      else {
        if (puVar11 == *(undefined4 **)(puVar12 + 6)) {
          uVar15 = (longlong)((longlong)puVar11 - *puVar1) >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          if ((ulonglong)((longlong)((longlong)*(undefined4 **)(puVar12 + 6) - *puVar1) >> 2) <
              uVar15 + 1) {
            FUN_140051e60(puVar1);
          }
        }
        if (*(undefined4 **)(puVar12 + 4) != (undefined4 *)0x0) {
          **(undefined4 **)(puVar12 + 4) = local_228;
        }
      }
      pwVar4 = local_218;
      *(longlong *)(puVar12 + 4) = *(longlong *)(puVar12 + 4) + 4;
      pwVar16 = local_218;
      if (local_218 != (wchar_t *)0x0) {
        for (; pwVar16 != pwVar25; pwVar16 = pwVar16 + 0x14) {
          if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
            operator_delete(*(void **)pwVar16);
          }
          pwVar16[0xc] = L'\a';
          pwVar16[0xd] = L'\0';
          pwVar16[0xe] = L'\0';
          pwVar16[0xf] = L'\0';
          pwVar16[8] = L'\0';
          pwVar16[9] = L'\0';
          pwVar16[10] = L'\0';
          pwVar16[0xb] = L'\0';
          *pwVar16 = L'\0';
        }
        operator_delete(pwVar4);
      }
      if (7 < local_110) {
        operator_delete((void *)CONCAT62(uStack_126,local_128));
      }
      local_110 = 7;
      local_118 = 0;
      local_128 = 0;
      if (local_1b8 != (int *)0x0) {
        operator_delete(local_1b8);
      }
      local_1b8 = (int *)0x0;
      local_1b0 = (int *)0x0;
      local_1a8 = (int *)0x0;
      if (7 < local_1c8) {
        operator_delete((void *)CONCAT62(uStack_1de,local_1e0));
      }
      puVar11 = *(undefined4 **)(local_220 + 6);
      if (puVar11 == (undefined4 *)0x0) {
        uVar6 = (uint)local_220[8] % *(uint *)(lVar9 + 0x78) + 1;
        lVar13 = (longlong)(int)uVar6 << 3;
        puVar11 = puVar20;
        do {
          if (*(uint *)(lVar9 + 0x78) <= uVar6) break;
          if (*(longlong *)(*(longlong *)(lVar9 + 0x68) + lVar13) != 0) {
            puVar11 = *(undefined4 **)(*(longlong *)(lVar9 + 0x68) + lVar13);
          }
          uVar6 = uVar6 + 1;
          lVar13 = lVar13 + 8;
        } while (puVar11 == (undefined4 *)0x0);
      }
      goto LAB_14013f5d2;
    }
  }
  return;
}



void FUN_140140020(longlong param_1)

{
  if (*(void **)(param_1 + 0x30) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 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_140140080(longlong param_1)

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



uint FUN_1401400e0(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x30)) {
      if ((puVar1[0x32] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 1;
        }
        puVar1 = puVar1 + 0x1a;
        if ((int)*puVar1 < 1) {
          puVar1 = &DAT_14047c100;
        }
        return *puVar1;
      }
    }
  }
  return 1;
}



undefined8 * FUN_140140140(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetCostumeMixDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce94 & 1) == 0) {
    DAT_14060ce94 = DAT_14060ce94 | 1;
    FUN_14013f3f0();
    atexit(FUN_140448750);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetCostumeMixDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608d30;
}



void thunk_FUN_140149f60(void)

{
  FUN_140149f60();
  return;
}



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

void FUN_1401401e0(void)

{
  undefined4 uVar1;
  code *pcVar2;
  uint uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined4 *puVar8;
  undefined8 *puVar9;
  int *piVar10;
  int *piVar11;
  longlong *plVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  undefined4 *puVar15;
  longlong lVar16;
  undefined4 *puVar17;
  undefined4 *puVar18;
  int iVar19;
  int iVar20;
  int iVar21;
  undefined1 auStack_128 [32];
  undefined1 local_108;
  undefined4 local_f8;
  undefined4 *local_f0;
  longlong local_e8;
  int local_e0;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 *local_d0;
  undefined4 *local_c8;
  undefined4 *local_c0;
  int local_b0;
  int local_ac;
  int local_a8;
  int local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined8 local_88;
  undefined4 local_80;
  undefined4 uStack_7c;
  undefined4 local_78;
  undefined4 local_74;
  void *local_70;
  ulonglong local_68;
  int local_50;
  int local_4c;
  int local_48;
  int local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  ulonglong local_30;
  
  local_88 = 0xfffffffffffffffe;
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_128;
  lVar7 = FUN_1402933b0(DAT_140607ff0,L"MYSTERY_BOX");
  if (lVar7 != 0) {
    local_e8 = lVar7;
    FUN_140149e60();
    if (*(longlong *)(lVar7 + 0x70) != 0) {
      uVar13 = 0;
      if (*(uint *)(lVar7 + 0x78) != 0) {
        plVar12 = *(longlong **)(lVar7 + 0x68);
        do {
          if (*plVar12 != 0) {
            puVar8 = (undefined4 *)(*(longlong **)(lVar7 + 0x68))[uVar13];
            goto LAB_14014027a;
          }
          uVar3 = (int)uVar13 + 1;
          uVar13 = (ulonglong)uVar3;
          plVar12 = plVar12 + 1;
        } while (uVar3 < *(uint *)(lVar7 + 0x78));
      }
    }
    puVar8 = (undefined4 *)0x0;
LAB_14014027a:
    if (puVar8 != (undefined4 *)0x0) {
      uVar5 = *puVar8;
      puVar17 = (undefined4 *)0x0;
      local_d0 = (undefined4 *)0x0;
      puVar15 = (undefined4 *)0x0;
      local_c8 = (undefined4 *)0x0;
      puVar18 = (undefined4 *)0x0;
      local_c0 = (undefined4 *)0x0;
      local_f8 = uVar5;
      local_f0 = puVar8;
      uVar4 = FUN_1402970c0(lVar7,&DAT_14049f290);
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar5,uVar4,&DAT_14049f290);
      local_d8 = *puVar8;
      uVar4 = FUN_1402970c0(lVar7,L"nRiddleboxGroup");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar5,uVar4,L"nRiddleboxGroup");
      local_d4 = *puVar8;
      iVar19 = 0;
      do {
        puVar9 = (undefined8 *)FUN_1404154c0(&local_80,L"nItem%02d",iVar19);
        if (7 < (ulonglong)puVar9[3]) {
          puVar9 = (undefined8 *)*puVar9;
        }
        uVar4 = FUN_1402970c0(lVar7,puVar9);
        local_108 = 1;
        puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar5,uVar4,puVar9);
        if ((puVar8 < puVar15) && (puVar17 <= puVar8)) {
          lVar16 = (longlong)puVar8 - (longlong)puVar17;
          if (puVar15 == puVar18) {
            uVar13 = (longlong)puVar15 - (longlong)puVar17 >> 2;
            if (0x3ffffffffffffffe < uVar13) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar13 = uVar13 + 1;
            uVar14 = (longlong)puVar18 - (longlong)puVar17 >> 2;
            if (uVar14 < uVar13) {
              if (0x3fffffffffffffff - (uVar14 >> 1) < uVar14) {
                uVar14 = 0;
              }
              else {
                uVar14 = uVar14 + (uVar14 >> 1);
              }
              if (uVar14 < uVar13) {
                uVar14 = uVar13;
              }
              FUN_140051e60(&local_d0,uVar14);
              puVar15 = local_c8;
              puVar17 = local_d0;
              puVar18 = local_c0;
            }
          }
          if (puVar15 != (undefined4 *)0x0) {
            uVar4 = puVar17[lVar16 >> 2];
LAB_14014044e:
            *puVar15 = uVar4;
          }
        }
        else {
          if (puVar15 == puVar18) {
            uVar13 = (longlong)puVar15 - (longlong)puVar17 >> 2;
            if (0x3ffffffffffffffe < uVar13) {
              std::_Xlength_error("vector<T> too long");
              return;
            }
            uVar13 = uVar13 + 1;
            uVar14 = (longlong)puVar18 - (longlong)puVar17 >> 2;
            if (uVar14 < uVar13) {
              if (0x3fffffffffffffff - (uVar14 >> 1) < uVar14) {
                uVar14 = 0;
              }
              else {
                uVar14 = uVar14 + (uVar14 >> 1);
              }
              if (uVar14 < uVar13) {
                uVar14 = uVar13;
              }
              FUN_140051e60(&local_d0,uVar14);
              puVar15 = local_c8;
              puVar17 = local_d0;
              puVar18 = local_c0;
            }
          }
          if (puVar15 != (undefined4 *)0x0) {
            uVar4 = *puVar8;
            goto LAB_14014044e;
          }
        }
        puVar15 = puVar15 + 1;
        local_c8 = puVar15;
        if (7 < local_68) {
          operator_delete((void *)CONCAT44(uStack_7c,local_80));
        }
        iVar19 = iVar19 + 1;
      } while (iVar19 < 0x19);
      uVar4 = FUN_1402970c0(lVar7,L"nSectionEnd00");
      local_108 = 1;
      piVar10 = (int *)FUN_140296600(lVar7,uVar5,uVar4,L"nSectionEnd00");
      uVar4 = FUN_1402970c0(lVar7,L"nSectionStart00");
      local_108 = 1;
      piVar11 = (int *)FUN_140296600(lVar7,uVar5,uVar4,L"nSectionStart00");
      local_e0 = (*piVar10 - *piVar11) + 1;
      local_b0 = local_e0;
      uVar4 = FUN_1402970c0(lVar7,L"nSectionEnd01");
      local_108 = 1;
      piVar10 = (int *)FUN_140296600(lVar7,uVar5,uVar4,L"nSectionEnd01");
      uVar4 = FUN_1402970c0(lVar7,L"nSectionStart01");
      local_108 = 1;
      piVar11 = (int *)FUN_140296600(lVar7,uVar5,uVar4,L"nSectionStart01");
      iVar21 = (*piVar10 - *piVar11) + 1;
      local_ac = iVar21;
      uVar5 = FUN_1402970c0(lVar7,L"nSectionEnd02");
      uVar1 = local_f8;
      local_108 = 1;
      piVar10 = (int *)FUN_140296600(lVar7,local_f8,uVar5,L"nSectionEnd02");
      uVar5 = FUN_1402970c0(lVar7,L"nSectionStart02");
      local_108 = 1;
      piVar11 = (int *)FUN_140296600(lVar7,uVar1,uVar5,L"nSectionStart02");
      iVar20 = (*piVar10 - *piVar11) + 1;
      local_a8 = iVar20;
      uVar5 = FUN_1402970c0(lVar7,L"nSectionEnd03");
      local_108 = 1;
      piVar10 = (int *)FUN_140296600(lVar7,uVar1,uVar5,L"nSectionEnd03");
      uVar5 = FUN_1402970c0(lVar7,L"nSectionStart03");
      local_108 = 1;
      piVar11 = (int *)FUN_140296600(lVar7,uVar1,uVar5,L"nSectionStart03");
      lVar7 = local_e8;
      iVar19 = (*piVar10 - *piVar11) + 1;
      local_a4 = iVar19;
      uVar5 = FUN_1402970c0(local_e8,L"nProbability00");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar5,L"nProbability00");
      uVar5 = *puVar8;
      local_a0 = uVar5;
      uVar4 = FUN_1402970c0(lVar7,L"nProbability01");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar4,L"nProbability01");
      uVar4 = *puVar8;
      local_9c = uVar4;
      uVar6 = FUN_1402970c0(lVar7,L"nProbability02");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nProbability02");
      uVar1 = *puVar8;
      local_98 = uVar1;
      uVar6 = FUN_1402970c0(lVar7,L"nProbability03");
      local_108 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,local_f8,uVar6,L"nProbability03");
      uVar6 = *puVar8;
      local_80 = local_d8;
      local_78 = local_d8;
      local_74 = local_d4;
      local_94 = uVar6;
      FUN_14012e520(&local_70,&local_d0);
      local_50 = local_e0;
      local_4c = iVar21;
      local_48 = iVar20;
      local_44 = iVar19;
      local_40 = uVar5;
      local_3c = uVar4;
      local_38 = uVar1;
      local_34 = uVar6;
      FUN_140149da0(local_80);
      if (local_70 != (void *)0x0) {
        operator_delete(local_70);
      }
      if (local_d0 != (undefined4 *)0x0) {
        operator_delete(local_d0);
      }
      puVar8 = *(undefined4 **)(local_f0 + 6);
      lVar7 = local_e8;
      if (puVar8 == (undefined4 *)0x0) {
        uVar3 = (uint)local_f0[8] % *(uint *)(local_e8 + 0x78) + 1;
        lVar16 = (longlong)(int)uVar3 << 3;
        do {
          if (*(uint *)(local_e8 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar16 + *(longlong *)(local_e8 + 0x68)) != 0) {
            puVar8 = *(undefined4 **)(lVar16 + *(longlong *)(local_e8 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar16 = lVar16 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_14014027a;
    }
  }
  return;
}



void FUN_1401407c0(longlong param_1)

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



undefined8 FUN_1401407f0(longlong *param_1,uint param_2,uint *param_3,undefined4 *param_4)

{
  code *pcVar1;
  uint uVar2;
  int iVar3;
  undefined8 uVar5;
  longlong *plVar6;
  ulonglong uVar7;
  uint *puVar8;
  uint *puVar9;
  uint *puVar10;
  longlong lVar11;
  uint *puVar12;
  uint *puVar13;
  ushort uVar14;
  uint *local_60;
  uint *local_58;
  uint *local_50;
  uint *puVar4;
  
  puVar8 = (uint *)0x0;
  puVar9 = puVar8;
  if ((param_1[1] != 0) && (*(uint *)(param_1 + 2) != 0)) {
    puVar4 = puVar8;
    plVar6 = (longlong *)*param_1;
    do {
      if (*plVar6 != 0) {
        puVar9 = (uint *)((longlong *)*param_1)[(longlong)puVar4];
        break;
      }
      uVar2 = (int)puVar4 + 1;
      puVar4 = (uint *)(ulonglong)uVar2;
      plVar6 = plVar6 + 1;
    } while (uVar2 < *(uint *)(param_1 + 2));
  }
  local_60 = (uint *)0x0;
  local_58 = (uint *)0x0;
  local_50 = (uint *)0x0;
  uVar14 = 0;
  puVar4 = puVar8;
  puVar10 = puVar8;
  puVar13 = puVar8;
  if (param_1[1] != 0) {
    do {
      puVar12 = puVar8;
      if (puVar9 != (uint *)0x0) {
        puVar12 = puVar9 + 2;
        if (param_2 == puVar9[3]) {
          if ((puVar12 < puVar4) && (puVar10 <= puVar12)) {
            lVar11 = (longlong)puVar12 - (longlong)puVar10;
            if (puVar4 == puVar13) {
              uVar7 = (longlong)puVar4 - (longlong)puVar10 >> 2;
              if (0x3ffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                pcVar1 = (code *)swi(3);
                uVar5 = (*pcVar1)();
                return uVar5;
              }
              if ((ulonglong)((longlong)puVar13 - (longlong)puVar10 >> 2) < uVar7 + 1) {
                FUN_140051e60(&local_60);
                puVar4 = local_58;
                puVar10 = local_60;
                puVar13 = local_50;
              }
            }
            if (puVar4 != (uint *)0x0) {
              uVar2 = puVar10[lVar11 >> 2];
LAB_14014098e:
              *puVar4 = uVar2;
            }
          }
          else {
            if (puVar4 == puVar13) {
              uVar7 = (longlong)puVar4 - (longlong)puVar10 >> 2;
              if (0x3ffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                pcVar1 = (code *)swi(3);
                uVar5 = (*pcVar1)();
                return uVar5;
              }
              if ((ulonglong)((longlong)puVar13 - (longlong)puVar10 >> 2) < uVar7 + 1) {
                FUN_140051e60(&local_60);
                puVar4 = local_58;
                puVar10 = local_60;
                puVar13 = local_50;
              }
            }
            if (puVar4 != (uint *)0x0) {
              uVar2 = *puVar12;
              goto LAB_14014098e;
            }
          }
          puVar4 = puVar4 + 1;
          local_58 = puVar4;
        }
        puVar12 = *(uint **)(puVar9 + 0x14);
        if (puVar12 == (uint *)0x0) {
          uVar2 = puVar9[0x16] % *(uint *)(param_1 + 2) + 1;
          lVar11 = (longlong)(int)uVar2 << 3;
          puVar12 = puVar8;
          do {
            if (*(uint *)(param_1 + 2) <= uVar2) break;
            if (*(longlong *)(lVar11 + *param_1) != 0) {
              puVar12 = *(uint **)(lVar11 + *param_1);
            }
            uVar2 = uVar2 + 1;
            lVar11 = lVar11 + 8;
          } while (puVar12 == (uint *)0x0);
        }
      }
      uVar14 = uVar14 + 1;
      puVar9 = puVar12;
    } while ((ulonglong)uVar14 < (ulonglong)param_1[1]);
  }
  uVar7 = (longlong)puVar4 - (longlong)puVar10 >> 2;
  if (uVar7 == 0) {
    if (puVar10 != (uint *)0x0) {
      operator_delete(puVar10);
    }
  }
  else {
    iVar3 = rand();
    *param_3 = puVar10[(ulonglong)(longlong)iVar3 % uVar7];
    iVar3 = rand();
    iVar3 = iVar3 % 1000;
    uVar2 = *param_3;
    puVar9 = puVar8;
    if (*param_1 != 0) {
      for (puVar4 = *(uint **)(*param_1 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                              );
          (puVar9 = puVar8, puVar4 != (uint *)0x0 &&
          ((puVar4[0x16] != uVar2 || (puVar9 = puVar4, *puVar4 != uVar2))));
          puVar4 = *(uint **)(puVar4 + 0x14)) {
      }
    }
    if (puVar9 != (uint *)0x0) {
      if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      if ((int)puVar9[0x10] <= iVar3) {
        if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (iVar3 < (int)(puVar9[0x11] + puVar9[0x10])) {
          puVar8 = (uint *)0x1;
        }
        else {
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          puVar8 = (uint *)(ulonglong)
                           (((int)(puVar9[0x12] + puVar9[0x11] + puVar9[0x10]) <= iVar3) + 2);
        }
      }
      iVar3 = (int)puVar8;
      if (iVar3 == 0) {
        if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        iVar3 = rand();
        *param_4 = *(undefined4 *)
                    (*(longlong *)(puVar9 + 4) + (longlong)(iVar3 % (int)puVar9[0xc]) * 4);
      }
      else {
        if (iVar3 == 1) {
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          iVar3 = rand();
          iVar3 = iVar3 % (int)puVar9[0xd];
        }
        else if (iVar3 == 2) {
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          iVar3 = rand();
          iVar3 = iVar3 % (int)puVar9[0xe] + puVar9[0xd];
        }
        else {
          if (iVar3 != 3) goto LAB_140140d50;
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          iVar3 = rand();
          iVar3 = iVar3 % (int)puVar9[0xf] + puVar9[0xe] + puVar9[0xd];
        }
        *param_4 = *(undefined4 *)
                    (*(longlong *)(puVar9 + 4) + (longlong)(int)(iVar3 + puVar9[0xc]) * 4);
      }
LAB_140140d50:
      if (puVar10 != (uint *)0x0) {
        operator_delete(puVar10);
      }
      return 1;
    }
    if (puVar10 != (uint *)0x0) {
      operator_delete(puVar10);
      return 0;
    }
  }
  return 0;
}



undefined8 * FUN_140140d80(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetMysteryBoxDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce90 & 1) == 0) {
    DAT_14060ce90 = DAT_14060ce90 | 1;
    FUN_140149cd0(0x3f400000,0x3e800000,0x40100000);
    FUN_1401401e0();
    atexit((_func_5014 *)&LAB_140448770);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetMysteryBoxDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608ce0;
}



void thunk_FUN_14014a160(void)

{
  FUN_14014a160();
  return;
}



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

void FUN_140140e40(void)

{
  int iVar1;
  code *pcVar2;
  uint uVar3;
  undefined4 uVar4;
  undefined4 *puVar6;
  undefined8 *puVar7;
  int *piVar8;
  longlong lVar9;
  longlong *plVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  int *piVar13;
  int *piVar14;
  int *piVar15;
  int *piVar16;
  int *piVar17;
  int *piVar18;
  undefined1 auStack_198 [32];
  undefined1 local_178;
  int local_168;
  undefined4 local_164;
  longlong local_160;
  uint local_158;
  undefined4 *local_150;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  int *local_138;
  int *local_130;
  int *local_128;
  int *local_118;
  int *local_110;
  int *local_108;
  int *local_f8;
  int *local_f0;
  int *local_e8;
  undefined8 local_d8;
  undefined1 local_d0 [24];
  void *local_b8;
  void *local_98;
  undefined8 local_90;
  undefined8 local_88;
  void *local_78;
  undefined8 local_70;
  undefined8 local_68;
  void *local_58 [3];
  ulonglong local_40;
  ulonglong local_30;
  undefined4 *puVar5;
  
  local_d8 = 0xfffffffffffffffe;
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_198;
  local_160 = FUN_1402933b0(DAT_140607ff0,L"RUNE_MACHINE");
  if (local_160 != 0) {
    puVar6 = (undefined4 *)0x0;
    if ((*(longlong *)(local_160 + 0x70) != 0) && (*(uint *)(local_160 + 0x78) != 0)) {
      puVar5 = puVar6;
      plVar10 = *(longlong **)(local_160 + 0x68);
      do {
        if (*plVar10 != 0) {
          puVar6 = (undefined4 *)(*(longlong **)(local_160 + 0x68))[(longlong)puVar5];
          break;
        }
        uVar3 = (int)puVar5 + 1;
        puVar5 = (undefined4 *)(ulonglong)uVar3;
        plVar10 = plVar10 + 1;
      } while (uVar3 < *(uint *)(local_160 + 0x78));
    }
LAB_140140eda:
    piVar8 = (int *)0x0;
    if (puVar6 != (undefined4 *)0x0) {
      local_164 = *puVar6;
      local_138 = (int *)0x0;
      local_130 = (int *)0x0;
      local_128 = (int *)0x0;
      local_118 = (int *)0x0;
      local_110 = (int *)0x0;
      local_108 = (int *)0x0;
      local_f8 = (int *)0x0;
      local_f0 = (int *)0x0;
      local_e8 = (int *)0x0;
      local_150 = puVar6;
      local_148 = local_164;
      uVar4 = FUN_1402970c0(local_160,L"nNpcGroup");
      local_178 = 1;
      puVar6 = (undefined4 *)FUN_140296600(local_160,local_164,uVar4,L"nNpcGroup");
      local_144 = *puVar6;
      uVar4 = FUN_1402970c0(local_160,L"nItemCost");
      local_178 = 1;
      puVar6 = (undefined4 *)FUN_140296600(local_160,local_164,uVar4,L"nItemCost");
      local_140 = *puVar6;
      local_158 = 0;
      piVar13 = piVar8;
      piVar14 = piVar8;
      piVar15 = piVar8;
      piVar16 = piVar8;
      piVar17 = piVar8;
      piVar18 = piVar8;
      do {
        puVar7 = (undefined8 *)FUN_1404154c0(local_58,L"nItemID%02d",piVar8);
        if (7 < (ulonglong)puVar7[3]) {
          puVar7 = (undefined8 *)*puVar7;
        }
        uVar4 = FUN_1402970c0(local_160,puVar7);
        local_178 = 1;
        piVar8 = (int *)FUN_140296600(local_160,local_164,uVar4,puVar7);
        iVar1 = *piVar8;
        local_168 = iVar1;
        if (7 < local_40) {
          operator_delete(local_58[0]);
        }
        if (iVar1 < 1) break;
        if ((&local_168 < piVar13) && (piVar18 <= &local_168)) {
          lVar9 = (longlong)&local_168 - (longlong)piVar18;
          if (piVar13 == local_128) {
            uVar11 = (longlong)piVar13 - (longlong)piVar18 >> 2;
            if (0x3ffffffffffffffe < uVar11) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar11 = uVar11 + 1;
            uVar12 = (longlong)local_128 - (longlong)piVar18 >> 2;
            if (uVar12 < uVar11) {
              if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                uVar12 = 0;
              }
              else {
                uVar12 = uVar12 + (uVar12 >> 1);
              }
              if (uVar12 < uVar11) {
                uVar12 = uVar11;
              }
              FUN_140051e60(&local_138,uVar12);
              piVar13 = local_130;
              piVar14 = local_f0;
              piVar15 = local_110;
              piVar16 = local_f8;
              piVar17 = local_118;
              piVar18 = local_138;
            }
          }
          if (piVar13 != (int *)0x0) {
            *piVar13 = piVar18[lVar9 >> 2];
          }
        }
        else {
          if (piVar13 == local_128) {
            uVar11 = (longlong)piVar13 - (longlong)piVar18 >> 2;
            if (0x3ffffffffffffffe < uVar11) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar11 = uVar11 + 1;
            uVar12 = (longlong)local_128 - (longlong)piVar18 >> 2;
            if (uVar12 < uVar11) {
              if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                uVar12 = 0;
              }
              else {
                uVar12 = uVar12 + (uVar12 >> 1);
              }
              if (uVar12 < uVar11) {
                uVar12 = uVar11;
              }
              FUN_140051e60(&local_138,uVar12);
              piVar13 = local_130;
              piVar14 = local_f0;
              piVar15 = local_110;
              piVar16 = local_f8;
              piVar17 = local_118;
              piVar18 = local_138;
            }
          }
          if (piVar13 != (int *)0x0) {
            *piVar13 = iVar1;
          }
        }
        piVar13 = piVar13 + 1;
        local_130 = piVar13;
        puVar7 = (undefined8 *)FUN_1404154c0(local_58,L"nStart%02d",local_158);
        if (7 < (ulonglong)puVar7[3]) {
          puVar7 = (undefined8 *)*puVar7;
        }
        uVar4 = FUN_1402970c0(local_160,puVar7);
        local_178 = 1;
        piVar8 = (int *)FUN_140296600(local_160,local_164,uVar4,puVar7);
        iVar1 = *piVar8;
        local_168 = iVar1;
        if (7 < local_40) {
          operator_delete(local_58[0]);
        }
        if (iVar1 < 1) break;
        if ((&local_168 < piVar15) && (piVar17 <= &local_168)) {
          lVar9 = (longlong)&local_168 - (longlong)piVar17;
          if (piVar15 == local_108) {
            uVar11 = (longlong)piVar15 - (longlong)piVar17 >> 2;
            if (0x3ffffffffffffffe < uVar11) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar11 = uVar11 + 1;
            uVar12 = (longlong)local_108 - (longlong)piVar17 >> 2;
            if (uVar12 < uVar11) {
              if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                uVar12 = 0;
              }
              else {
                uVar12 = uVar12 + (uVar12 >> 1);
              }
              if (uVar12 < uVar11) {
                uVar12 = uVar11;
              }
              FUN_140051e60(&local_118,uVar12);
              piVar13 = local_130;
              piVar14 = local_f0;
              piVar15 = local_110;
              piVar16 = local_f8;
              piVar17 = local_118;
              piVar18 = local_138;
            }
          }
          if (piVar15 != (int *)0x0) {
            *piVar15 = piVar17[lVar9 >> 2];
          }
        }
        else {
          if (piVar15 == local_108) {
            uVar11 = (longlong)piVar15 - (longlong)piVar17 >> 2;
            if (0x3ffffffffffffffe < uVar11) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar11 = uVar11 + 1;
            uVar12 = (longlong)local_108 - (longlong)piVar17 >> 2;
            if (uVar12 < uVar11) {
              if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                uVar12 = 0;
              }
              else {
                uVar12 = uVar12 + (uVar12 >> 1);
              }
              if (uVar12 < uVar11) {
                uVar12 = uVar11;
              }
              FUN_140051e60(&local_118,uVar12);
              piVar13 = local_130;
              piVar14 = local_f0;
              piVar15 = local_110;
              piVar16 = local_f8;
              piVar17 = local_118;
              piVar18 = local_138;
            }
          }
          if (piVar15 != (int *)0x0) {
            *piVar15 = iVar1;
          }
        }
        piVar15 = piVar15 + 1;
        local_110 = piVar15;
        puVar7 = (undefined8 *)FUN_1404154c0(local_58,L"nEnd%02d",local_158);
        if (7 < (ulonglong)puVar7[3]) {
          puVar7 = (undefined8 *)*puVar7;
        }
        uVar4 = FUN_1402970c0(local_160,puVar7);
        local_178 = 1;
        piVar8 = (int *)FUN_140296600(local_160,local_164,uVar4,puVar7);
        iVar1 = *piVar8;
        local_168 = iVar1;
        if (7 < local_40) {
          operator_delete(local_58[0]);
        }
        if (iVar1 < 1) break;
        if ((&local_168 < piVar14) && (piVar16 <= &local_168)) {
          lVar9 = (longlong)&local_168 - (longlong)piVar16;
          if (piVar14 == local_e8) {
            uVar11 = (longlong)piVar14 - (longlong)piVar16 >> 2;
            if (0x3ffffffffffffffe < uVar11) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar11 = uVar11 + 1;
            uVar12 = (longlong)local_e8 - (longlong)piVar16 >> 2;
            if (uVar12 < uVar11) {
              if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                uVar12 = 0;
              }
              else {
                uVar12 = uVar12 + (uVar12 >> 1);
              }
              if (uVar12 < uVar11) {
                uVar12 = uVar11;
              }
              FUN_140051e60(&local_f8,uVar12);
              piVar13 = local_130;
              piVar14 = local_f0;
              piVar15 = local_110;
              piVar16 = local_f8;
              piVar17 = local_118;
              piVar18 = local_138;
            }
          }
          if (piVar14 != (int *)0x0) {
            *piVar14 = piVar16[lVar9 >> 2];
          }
        }
        else {
          if (piVar14 == local_e8) {
            uVar11 = (longlong)piVar14 - (longlong)piVar16 >> 2;
            if (0x3ffffffffffffffe < uVar11) {
              std::_Xlength_error("vector<T> too long");
              return;
            }
            uVar11 = uVar11 + 1;
            uVar12 = (longlong)local_e8 - (longlong)piVar16 >> 2;
            if (uVar12 < uVar11) {
              if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                uVar12 = 0;
              }
              else {
                uVar12 = uVar12 + (uVar12 >> 1);
              }
              if (uVar12 < uVar11) {
                uVar12 = uVar11;
              }
              FUN_140051e60(&local_f8,uVar12);
              piVar13 = local_130;
              piVar14 = local_f0;
              piVar15 = local_110;
              piVar16 = local_f8;
              piVar17 = local_118;
              piVar18 = local_138;
            }
          }
          if (piVar14 != (int *)0x0) {
            *piVar14 = iVar1;
          }
        }
        piVar14 = piVar14 + 1;
        local_158 = local_158 + 1;
        piVar8 = (int *)(ulonglong)local_158;
        local_f0 = piVar14;
      } while ((int)local_158 < 0x14);
      puVar6 = (undefined4 *)FUN_14014a180(local_d0,&local_164,&local_148);
      FUN_14014a050(*puVar6);
      if (local_78 != (void *)0x0) {
        operator_delete(local_78);
      }
      local_78 = (void *)0x0;
      local_70 = 0;
      local_68 = 0;
      if (local_98 != (void *)0x0) {
        operator_delete(local_98);
      }
      local_98 = (void *)0x0;
      local_90 = 0;
      local_88 = 0;
      if (local_b8 != (void *)0x0) {
        operator_delete(local_b8);
      }
      if (piVar16 != (int *)0x0) {
        operator_delete(piVar16);
      }
      if (piVar17 != (int *)0x0) {
        operator_delete(piVar17);
      }
      if (piVar18 != (int *)0x0) {
        operator_delete(piVar18);
      }
      puVar6 = *(undefined4 **)(local_150 + 6);
      if (puVar6 == (undefined4 *)0x0) {
        uVar3 = (uint)local_150[8] % *(uint *)(local_160 + 0x78) + 1;
        lVar9 = (longlong)(int)uVar3 << 3;
        puVar6 = (undefined4 *)0x0;
        do {
          if (*(uint *)(local_160 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar9 + *(longlong *)(local_160 + 0x68)) != 0) {
            puVar6 = *(undefined4 **)(lVar9 + *(longlong *)(local_160 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar6 == (undefined4 *)0x0);
      }
      goto LAB_140140eda;
    }
  }
  return;
}



void FUN_140141640(longlong param_1)

{
  if (*(void **)(param_1 + 0x50) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x50));
  }
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  if (*(void **)(param_1 + 0x30) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  if (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_1401416b0(longlong param_1)

{
  FUN_140141640(param_1 + 8);
  return;
}



undefined4 FUN_1401416c0(longlong *param_1,uint param_2)

{
  longlong lVar1;
  int iVar2;
  uint *puVar3;
  uint *puVar4;
  uint *puVar5;
  longlong lVar6;
  
  puVar3 = (uint *)0x0;
  puVar5 = puVar3;
  if (*param_1 != 0) {
    for (puVar4 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            );
        (puVar5 = puVar3, puVar4 != (uint *)0x0 &&
        ((puVar4[0x20] != param_2 || (puVar5 = puVar4, *puVar4 != param_2))));
        puVar4 = *(uint **)(puVar4 + 0x1e)) {
    }
  }
  if (puVar5 != (uint *)0x0) {
    lVar6 = *(longlong *)(puVar5 + 8);
    lVar1 = *(longlong *)(puVar5 + 6);
    iVar2 = rand();
    lVar6 = (longlong)(int)(lVar6 - lVar1 >> 2);
    if (0 < lVar6) {
      puVar4 = puVar3;
      do {
        if ((*(int *)(*(longlong *)(puVar5 + 0xe) + (longlong)puVar3 * 4) <= iVar2 % 10000) &&
           (iVar2 % 10000 <= *(int *)(*(longlong *)(puVar5 + 0x16) + (longlong)puVar3 * 4))) {
          return *(undefined4 *)(*(longlong *)(puVar5 + 6) + (longlong)(int)puVar4 * 4);
        }
        puVar3 = (uint *)((longlong)puVar3 + 1);
        puVar4 = (uint *)(ulonglong)((int)puVar4 + 1);
      } while ((longlong)puVar3 < lVar6);
    }
  }
  return 0xffffffff;
}



undefined8 * FUN_1401417a0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetRuneMachineDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce8c & 1) == 0) {
    DAT_14060ce8c = DAT_14060ce8c | 1;
    FUN_140149f80(0x3f400000,0x3e800000,0x40100000);
    FUN_140140e40();
    atexit((_func_5014 *)&LAB_140448780);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetRuneMachineDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608c90;
}



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

void FUN_140141850(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined4 *puVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined4 *puVar9;
  undefined1 auStack_58 [32];
  undefined1 local_38;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"RUNE_USE_COUNT");
  if (lVar4 != 0) {
    if (*(longlong *)(lVar4 + 0x70) != 0) {
      uVar5 = 0;
      if (*(uint *)(lVar4 + 0x78) != 0) {
        plVar8 = *(longlong **)(lVar4 + 0x68);
        do {
          if (*plVar8 != 0) {
            puVar6 = (undefined4 *)(*(longlong **)(lVar4 + 0x68))[uVar5];
            goto LAB_1401418c0;
          }
          uVar2 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar2;
          plVar8 = plVar8 + 1;
        } while (uVar2 < *(uint *)(lVar4 + 0x78));
      }
    }
    puVar6 = (undefined4 *)0x0;
LAB_1401418c0:
    puVar9 = puVar6;
    if (puVar9 != (undefined4 *)0x0) {
      uVar1 = *puVar9;
      local_28 = uVar1;
      uVar3 = FUN_1402970c0(lVar4,L"nRuneUseCount");
      local_38 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nRuneUseCount");
      local_24 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"fRuneUseprobability");
      local_38 = 1;
      puVar6 = (undefined4 *)FUN_1402967b0(lVar4,uVar1,uVar3,L"fRuneUseprobability");
      local_20 = *puVar6;
      FUN_140147080(&local_28);
      puVar6 = *(undefined4 **)(puVar9 + 6);
      if (puVar6 == (undefined4 *)0x0) {
        uVar2 = (uint)puVar9[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar7 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar7 + *(longlong *)(lVar4 + 0x68)) != 0) {
            puVar6 = *(undefined4 **)(lVar7 + *(longlong *)(lVar4 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar7 = lVar7 + 8;
        } while (puVar6 == (undefined4 *)0x0);
      }
      goto LAB_1401418c0;
    }
  }
  return;
}



undefined4 FUN_1401419b0(longlong *param_1)

{
  float fVar1;
  longlong lVar2;
  uint uVar3;
  int iVar4;
  float *pfVar5;
  ulonglong uVar6;
  uint uVar7;
  longlong lVar8;
  longlong lVar9;
  ulonglong uVar10;
  uint uVar11;
  longlong lVar12;
  float fVar13;
  
  iVar4 = rand();
  lVar2 = *param_1;
  uVar10 = 0;
  lVar8 = (param_1[1] - lVar2) / 6 + (param_1[1] - lVar2 >> 0x3f);
  lVar9 = lVar8 >> 1;
  lVar8 = lVar8 >> 0x3f;
  if (lVar9 != lVar8) {
    do {
      uVar3 = (uint)uVar10;
      uVar11 = uVar3 + 1;
      uVar7 = 0;
      lVar12 = 0;
      fVar13 = 0.0;
      if ((int)uVar11 < 4) {
LAB_140141a94:
        pfVar5 = (float *)(lVar2 + 8 + lVar12 * 0xc);
        uVar6 = (ulonglong)((uVar3 - uVar7) + 1);
        do {
          fVar1 = *pfVar5;
          pfVar5 = pfVar5 + 3;
          uVar6 = uVar6 - 1;
          fVar13 = fVar13 + fVar1 * 100.0;
        } while (uVar6 != 0);
      }
      else {
        uVar6 = (ulonglong)(uVar11 >> 2);
        uVar7 = (uVar11 >> 2) * 4;
        lVar12 = uVar6 * 4;
        pfVar5 = (float *)(lVar2 + 0x14);
        do {
          uVar6 = uVar6 - 1;
          fVar13 = pfVar5[-3] * 100.0 + fVar13 + *pfVar5 * 100.0 + pfVar5[3] * 100.0 +
                   pfVar5[6] * 100.0;
          pfVar5 = pfVar5 + 0xc;
        } while (uVar6 != 0);
        if (uVar7 <= uVar3) goto LAB_140141a94;
      }
      if (iVar4 % 100 < (int)fVar13) {
        return *(undefined4 *)(lVar2 + 4 + uVar10 * 0xc);
      }
      uVar10 = (ulonglong)uVar11;
    } while (uVar10 < (ulonglong)(lVar9 - lVar8));
  }
  return 0;
}



undefined8 * FUN_140141af0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetRuneUseCountDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce88 & 1) == 0) {
    DAT_14060ce88 = DAT_14060ce88 | 1;
    DAT_140609298 = 0;
    DAT_1406092a0 = 0;
    DAT_1406092a8 = 0;
    FUN_140141850();
    atexit(FUN_140448790);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetRuneUseCountDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140609298;
}



void thunk_FUN_14014a4f0(void)

{
  FUN_14014a4f0();
  return;
}



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

void FUN_140141bb0(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined8 *puVar6;
  float *pfVar7;
  undefined4 *puVar8;
  longlong *plVar9;
  int iVar10;
  longlong lVar11;
  undefined4 *puVar12;
  undefined1 auStack_a8 [32];
  undefined1 local_88;
  undefined8 local_78;
  undefined4 local_70;
  undefined4 uStack_6c;
  int local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  int local_44 [4];
  undefined4 local_34 [5];
  ulonglong local_20;
  
  local_78 = 0xfffffffffffffffe;
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"ActivityProbability");
  if (lVar4 != 0) {
    if (*(longlong *)(lVar4 + 0x70) != 0) {
      uVar5 = 0;
      if (*(uint *)(lVar4 + 0x78) != 0) {
        plVar9 = *(longlong **)(lVar4 + 0x68);
        do {
          if (*plVar9 != 0) {
            puVar8 = (undefined4 *)(*(longlong **)(lVar4 + 0x68))[uVar5];
            goto LAB_140141c40;
          }
          uVar2 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar2;
          plVar9 = plVar9 + 1;
        } while (uVar2 < *(uint *)(lVar4 + 0x78));
      }
    }
    puVar8 = (undefined4 *)0x0;
LAB_140141c40:
    puVar12 = puVar8;
    if (puVar12 != (undefined4 *)0x0) {
      uVar1 = *puVar12;
      lVar11 = 0;
      iVar10 = 1;
      local_48 = uVar1;
      do {
        puVar6 = (undefined8 *)FUN_1404154c0(&local_70,L"fStrengthen%02d",iVar10);
        if (7 < (ulonglong)puVar6[3]) {
          puVar6 = (undefined8 *)*puVar6;
        }
        uVar3 = FUN_1402970c0(lVar4,puVar6);
        local_88 = 1;
        pfVar7 = (float *)FUN_1402967b0(lVar4,uVar1,uVar3,puVar6);
        local_44[lVar11] = (int)*pfVar7;
        if (7 < CONCAT44(uStack_54,local_58)) {
          operator_delete((void *)CONCAT44(uStack_6c,local_70));
        }
        puVar6 = (undefined8 *)FUN_1404154c0(&local_70,L"fProbability%02d",iVar10);
        if (7 < (ulonglong)puVar6[3]) {
          puVar6 = (undefined8 *)*puVar6;
        }
        uVar3 = FUN_1402970c0(lVar4,puVar6);
        local_88 = 1;
        puVar8 = (undefined4 *)FUN_1402967b0(lVar4,uVar1,uVar3,puVar6);
        local_34[lVar11] = *puVar8;
        if (7 < CONCAT44(uStack_54,local_58)) {
          operator_delete((void *)CONCAT44(uStack_6c,local_70));
        }
        iVar10 = iVar10 + 1;
        lVar11 = lVar11 + 1;
      } while (lVar11 < 4);
      uStack_6c = local_48;
      local_68 = local_44[0];
      local_64 = local_44[1];
      local_60 = local_44[2];
      local_5c = local_44[3];
      local_58 = local_34[0];
      uStack_54 = local_34[1];
      local_50 = local_34[2];
      local_4c = local_34[3];
      local_70 = uVar1;
      FUN_14014a2e0(uVar1);
      puVar8 = *(undefined4 **)(puVar12 + 6);
      if (puVar8 == (undefined4 *)0x0) {
        uVar2 = (uint)puVar12[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar11 + *(longlong *)(lVar4 + 0x68)) != 0) {
            puVar8 = *(undefined4 **)(lVar11 + *(longlong *)(lVar4 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar11 = lVar11 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_140141c40;
    }
  }
  return;
}



uint * FUN_140141de0(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 10)) {
      if ((puVar1[0xc] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)0x0;
        }
        return puVar1 + 1;
      }
    }
  }
  return (uint *)0x0;
}



undefined8 * FUN_140141e20(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetActivityDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce84 & 1) == 0) {
    DAT_14060ce84 = DAT_14060ce84 | 1;
    FUN_14014a210(0x3f400000,0x3e800000,0x40100000);
    FUN_140141bb0();
    atexit(FUN_1404487d0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetActivityDB",uVar3,pcVar4,DVar5)
    ;
  }
  return &DAT_140608c40;
}



void thunk_FUN_14014a7b0(void)

{
  FUN_14014a7b0();
  return;
}



void FUN_140141ee0(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined4 *puVar8;
  undefined4 *puVar9;
  
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"ActivityBroken");
  if (lVar4 != 0) {
    if (*(longlong *)(lVar4 + 0x70) != 0) {
      uVar5 = 0;
      if (*(uint *)(lVar4 + 0x78) != 0) {
        plVar7 = *(longlong **)(lVar4 + 0x68);
        do {
          if (*plVar7 != 0) {
            puVar9 = (undefined4 *)(*(longlong **)(lVar4 + 0x68))[uVar5];
            goto LAB_140141f40;
          }
          uVar2 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar2;
          plVar7 = plVar7 + 1;
        } while (uVar2 < *(uint *)(lVar4 + 0x78));
      }
    }
    puVar9 = (undefined4 *)0x0;
LAB_140141f40:
    puVar8 = puVar9;
    if (puVar8 != (undefined4 *)0x0) {
      uVar1 = *puVar8;
      uVar3 = FUN_1402970c0(lVar4,L"fProbabilityB");
      FUN_1402967b0(lVar4,uVar1,uVar3,L"fProbabilityB",1);
      uVar3 = FUN_1402970c0(lVar4,L"fProbabilityE");
      FUN_1402967b0(lVar4,uVar1,uVar3,L"fProbabilityE",1);
      uVar3 = FUN_1402970c0(lVar4,L"nActivityID");
      FUN_140296600(lVar4,uVar1,uVar3,L"nActivityID",1);
      FUN_14014a5e0(uVar1);
      puVar9 = *(undefined4 **)(puVar8 + 6);
      if (puVar9 == (undefined4 *)0x0) {
        uVar2 = (uint)puVar8[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar6 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar6 + *(longlong *)(lVar4 + 0x68)) != 0) {
            puVar9 = *(undefined4 **)(lVar6 + *(longlong *)(lVar4 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar6 = lVar6 + 8;
        } while (puVar9 == (undefined4 *)0x0);
      }
      goto LAB_140141f40;
    }
  }
  return;
}



uint FUN_140142060(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 6)) {
      if ((puVar1[8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0xffffffff;
        }
        if (puVar1 == (uint *)0xfffffffffffffffc) {
          return 0xffffffff;
        }
        return puVar1[4];
      }
    }
  }
  return 0xffffffff;
}



undefined8 * FUN_1401420a0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetActivityBrokenDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce80 & 1) == 0) {
    DAT_14060ce80 = DAT_14060ce80 | 1;
    FUN_14014a510(0x3f400000,0x3e800000,0x40100000);
    FUN_140141ee0();
    atexit(FUN_1404487f0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetActivityBrokenDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608bf0;
}



// WARNING: Removing unreachable block (ram,0x000140142218)
// WARNING: Removing unreachable block (ram,0x000140142221)
// WARNING: Removing unreachable block (ram,0x000140142242)
// WARNING: Removing unreachable block (ram,0x00014014224b)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140142150(void)

{
  undefined8 in_XMM3_Qa;
  
  FUN_14014a7d0(0x3f400000,0x3e800000,0x40100000,in_XMM3_Qa,0xfffffffffffffffe);
  _DAT_140608b58 = 0;
  _DAT_140608b60 = 0;
  _DAT_140608b68 = 0x11;
  _DAT_140608b88 = 0;
  _DAT_140608b8c = 10;
  _DAT_140608b90 = 0;
  _DAT_140608b98 = 0;
  _DAT_140608b6c = 0x3f400000;
  _DAT_140608b70 = 0x3e800000;
  _DAT_140608b74 = 0x40100000;
  _DAT_140608b78 = 0x26;
  _DAT_140608b80 = 0;
  _DAT_140608ba0 = 0;
  _DAT_140608ba8 = 0;
  _DAT_140608bb0 = 0x11;
  _DAT_140608bd0 = 0;
  _DAT_140608bd4 = 10;
  _DAT_140608bd8 = 0;
  _DAT_140608be0 = 0;
  _DAT_140608bb4 = 0x3f400000;
  _DAT_140608bb8 = 0x3e800000;
  _DAT_140608bbc = 0x40100000;
  _DAT_140608bc8 = 0;
  _DAT_140608bc0 = _DAT_140608b78;
  FUN_140142300();
  return &DAT_140608b10;
}



void thunk_FUN_14014aa70(void)

{
  FUN_14014aa70();
  return;
}



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

void FUN_140142300(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  undefined4 *puVar6;
  float *pfVar7;
  int *piVar8;
  undefined8 *puVar9;
  int *piVar10;
  longlong lVar11;
  uint *puVar12;
  undefined8 uVar13;
  longlong *plVar14;
  undefined4 *puVar15;
  int *piVar16;
  undefined1 auStack_1c8 [32];
  int local_1a8;
  int local_198;
  undefined4 *local_190;
  undefined8 local_188;
  undefined4 local_178;
  undefined1 local_174 [140];
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  int local_dc;
  int local_d8;
  uint local_d4 [10];
  int local_ac [10];
  int local_84 [11];
  void *local_58 [3];
  ulonglong local_40;
  ulonglong local_30;
  undefined4 *puVar5;
  
  local_188 = 0xfffffffffffffffe;
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_1c8;
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"RandomRune");
  if (lVar4 != 0) {
    puVar15 = (undefined4 *)0x0;
    puVar6 = puVar15;
    if ((*(longlong *)(lVar4 + 0x70) != 0) && (*(uint *)(lVar4 + 0x78) != 0)) {
      puVar5 = puVar15;
      plVar14 = *(longlong **)(lVar4 + 0x68);
      do {
        if (*plVar14 != 0) {
          puVar6 = (undefined4 *)(*(longlong **)(lVar4 + 0x68))[(longlong)puVar5];
          break;
        }
        uVar2 = (int)puVar5 + 1;
        puVar5 = (undefined4 *)(ulonglong)uVar2;
        plVar14 = plVar14 + 1;
      } while (uVar2 < *(uint *)(lVar4 + 0x78));
    }
LAB_14014239a:
    if (puVar6 != (undefined4 *)0x0) {
      uVar1 = *puVar6;
      local_198 = 0;
      local_190 = puVar6;
      local_e8 = uVar1;
      uVar3 = FUN_1402970c0(lVar4,L"nRandomRuneGroup");
      local_1a8._0_1_ = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nRandomRuneGroup");
      local_e4 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nRuneGrade");
      local_1a8._0_1_ = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nRuneGrade");
      local_e0 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"fRandomGroupProbability");
      local_1a8._0_1_ = 1;
      pfVar7 = (float *)FUN_1402967b0(lVar4,uVar1,uVar3,L"fRandomGroupProbability");
      local_dc = (int)*pfVar7;
      uVar3 = FUN_1402970c0(lVar4,L"nMaxCount");
      local_1a8 = CONCAT31(local_1a8._1_3_,1);
      piVar8 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nMaxCount");
      local_d8 = *piVar8;
      piVar8 = local_ac;
      piVar16 = local_84;
      puVar6 = puVar15;
      do {
        puVar9 = (undefined8 *)FUN_1404154c0(local_58,L"nItemCode%02d",puVar6);
        if (7 < (ulonglong)puVar9[3]) {
          puVar9 = (undefined8 *)*puVar9;
        }
        uVar3 = FUN_1402970c0(lVar4,puVar9);
        local_1a8 = CONCAT31(local_1a8._1_3_,1);
        piVar10 = (int *)FUN_140296600(lVar4,uVar1,uVar3,puVar9);
        piVar8[-10] = *piVar10;
        if (7 < local_40) {
          operator_delete(local_58[0]);
        }
        puVar9 = (undefined8 *)FUN_1404154c0(local_58,L"nItemCount%02d",puVar6);
        if (7 < (ulonglong)puVar9[3]) {
          puVar9 = (undefined8 *)*puVar9;
        }
        uVar3 = FUN_1402970c0(lVar4,puVar9);
        local_1a8 = CONCAT31(local_1a8._1_3_,1);
        piVar10 = (int *)FUN_140296600(lVar4,uVar1,uVar3,puVar9);
        *piVar8 = *piVar10;
        if (7 < local_40) {
          operator_delete(local_58[0]);
        }
        puVar9 = (undefined8 *)FUN_1404154c0(local_58,L"nItemCodeCount%02d",puVar6);
        if (7 < (ulonglong)puVar9[3]) {
          puVar9 = (undefined8 *)*puVar9;
        }
        uVar3 = FUN_1402970c0(lVar4,puVar9);
        local_1a8 = CONCAT31(local_1a8._1_3_,1);
        piVar10 = (int *)FUN_140296600(lVar4,uVar1,uVar3,puVar9);
        piVar8[10] = *piVar10;
        if (7 < local_40) {
          operator_delete(local_58[0]);
        }
        uVar2 = piVar8[-10];
        if (0 < (int)uVar2) {
          lVar11 = FUN_140137690();
          if (*(longlong *)(lVar11 + 0x88) != 0) {
            for (puVar12 = *(uint **)(*(longlong *)(lVar11 + 0x88) +
                                     ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar11 + 0x98)) * 8);
                puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0xa6)) {
              if ((puVar12[0xa8] == uVar2) && (*puVar12 == uVar2)) {
                if (puVar12 != (uint *)0x0) {
                  local_198 = local_198 + *piVar8;
                  uVar13 = FUN_140148a60(&DAT_140608b58,local_e4);
                  FUN_14012e5c0(uVar13,piVar16 + -0x14);
                  uVar13 = FUN_140148a60(&DAT_140608ba0,local_e4);
                  FUN_14012e5c0(uVar13,piVar16);
                  goto LAB_140142633;
                }
                break;
              }
            }
          }
          local_d8 = local_d8 - *piVar8;
          piVar8[-10] = 0;
          *piVar8 = 0;
          piVar8[10] = 0;
        }
LAB_140142633:
        uVar2 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar2;
        piVar16 = piVar16 + 1;
        piVar8 = piVar8 + 1;
      } while ((int)uVar2 < 10);
      if (local_d8 != local_198) {
        local_1a8 = local_198;
        FUN_140005370(0xc,
                      L"GAME_DB ERR >> [TABLE:RandomRune ID:%d / nMaxCount:%d / nItemProbabilitySum:%d]"
                      ,local_e8);
      }
      local_178 = uVar1;
      memcpy(local_174,&local_e8,0x8c);
      FUN_14014a8a0(uVar1);
      puVar6 = *(undefined4 **)(local_190 + 6);
      if (puVar6 == (undefined4 *)0x0) {
        uVar2 = (uint)local_190[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar2 << 3;
        puVar6 = puVar15;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(*(longlong *)(lVar4 + 0x68) + lVar11) != 0) {
            puVar6 = *(undefined4 **)(*(longlong *)(lVar4 + 0x68) + lVar11);
          }
          uVar2 = uVar2 + 1;
          lVar11 = lVar11 + 8;
        } while (puVar6 == (undefined4 *)0x0);
      }
      goto LAB_14014239a;
    }
  }
  return;
}



void FUN_140142720(longlong *param_1,int param_2,undefined8 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if (param_1[1] != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar4 = (longlong *)*param_1;
      do {
        if (*plVar4 != 0) {
          lVar5 = ((longlong *)*param_1)[uVar2];
          goto LAB_140142764;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar4 = plVar4 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar5 = 0;
LAB_140142764:
  do {
    do {
      lVar3 = lVar5;
      if (lVar3 == 0) {
        return;
      }
      if ((lVar3 != -4) && (*(int *)(lVar3 + 8) == param_2)) {
        FUN_14012e5c0(param_3);
      }
      lVar5 = *(longlong *)(lVar3 + 0x90);
    } while (lVar5 != 0);
    uVar1 = *(uint *)(lVar3 + 0x98) % *(uint *)(param_1 + 2) + 1;
    lVar3 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar1) break;
      if (*(longlong *)(lVar3 + *param_1) != 0) {
        lVar5 = *(longlong *)(lVar3 + *param_1);
      }
      uVar1 = uVar1 + 1;
      lVar3 = lVar3 + 8;
    } while (lVar5 == 0);
  } while( true );
}



undefined8 * FUN_1401427f0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetRandomRuneDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf7c & 1) == 0) {
    DAT_14060cf7c = DAT_14060cf7c | 1;
    FUN_140142150();
    atexit(FUN_140448810);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetRandomRuneDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608b10;
}



void thunk_FUN_14014ac40(void)

{
  FUN_14014ac40();
  return;
}



void FUN_140142890(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined4 *puVar8;
  undefined4 *puVar9;
  
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"POTION_ITEM");
  if (lVar4 != 0) {
    if (*(longlong *)(lVar4 + 0x70) != 0) {
      uVar5 = 0;
      if (*(uint *)(lVar4 + 0x78) != 0) {
        plVar7 = *(longlong **)(lVar4 + 0x68);
        do {
          if (*plVar7 != 0) {
            puVar8 = (undefined4 *)(*(longlong **)(lVar4 + 0x68))[uVar5];
            goto LAB_140142900;
          }
          uVar2 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar2;
          plVar7 = plVar7 + 1;
        } while (uVar2 < *(uint *)(lVar4 + 0x78));
      }
    }
    puVar8 = (undefined4 *)0x0;
LAB_140142900:
    puVar9 = puVar8;
    if (puVar9 != (undefined4 *)0x0) {
      uVar1 = *puVar9;
      uVar3 = FUN_1402970c0(lVar4,&DAT_14049f290);
      FUN_140296600(lVar4,uVar1,uVar3,&DAT_14049f290,1);
      uVar3 = FUN_1402970c0(lVar4,L"nType");
      FUN_140296600(lVar4,uVar1,uVar3,L"nType",1);
      uVar3 = FUN_1402970c0(lVar4,&DAT_14049f888);
      FUN_1402967b0(lVar4,uVar1,uVar3,&DAT_14049f888,1);
      uVar3 = FUN_1402970c0(lVar4,&DAT_14049f890);
      FUN_1402967b0(lVar4,uVar1,uVar3,&DAT_14049f890,1);
      uVar3 = FUN_1402970c0(lVar4,&DAT_14049f898);
      FUN_1402967b0(lVar4,uVar1,uVar3,&DAT_14049f898,1);
      FUN_14014ab60(uVar1);
      puVar8 = *(undefined4 **)(puVar9 + 6);
      if (puVar8 == (undefined4 *)0x0) {
        uVar2 = (uint)puVar9[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar6 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar6 + *(longlong *)(lVar4 + 0x68)) != 0) {
            puVar8 = *(undefined4 **)(lVar6 + *(longlong *)(lVar4 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar6 = lVar6 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_140142900;
    }
  }
  return;
}



undefined8 * FUN_140142aa0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetPotionItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce7c & 1) == 0) {
    DAT_14060ce7c = DAT_14060ce7c | 1;
    FUN_14014aa90(0x3f400000,0x3e800000,0x40100000);
    FUN_140142890();
    atexit((_func_5014 *)&LAB_140448850);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetPotionItemDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608ac0;
}



void FUN_140142b50(void)

{
  float fVar1;
  undefined4 uVar2;
  int iVar3;
  int iVar4;
  uint uVar5;
  undefined4 uVar6;
  longlong lVar7;
  ulonglong uVar8;
  int *piVar9;
  float *pfVar10;
  longlong lVar11;
  longlong *plVar12;
  int *piVar13;
  undefined4 *puVar14;
  undefined4 *puVar15;
  
  lVar7 = FUN_1402933b0(DAT_140607ff0,L"Equip_CorrectProbability");
  if (lVar7 != 0) {
    if (*(longlong *)(lVar7 + 0x70) != 0) {
      uVar8 = 0;
      if (*(uint *)(lVar7 + 0x78) != 0) {
        plVar12 = *(longlong **)(lVar7 + 0x68);
        do {
          if (*plVar12 != 0) {
            puVar15 = (undefined4 *)(*(longlong **)(lVar7 + 0x68))[uVar8];
            goto LAB_140142bd4;
          }
          uVar5 = (int)uVar8 + 1;
          uVar8 = (ulonglong)uVar5;
          plVar12 = plVar12 + 1;
        } while (uVar5 < *(uint *)(lVar7 + 0x78));
      }
    }
    puVar15 = (undefined4 *)0x0;
LAB_140142bd4:
    puVar14 = puVar15;
    if (puVar14 != (undefined4 *)0x0) {
      uVar2 = *puVar14;
      uVar6 = FUN_1402970c0(lVar7,L"nAcquireRoute");
      piVar9 = (int *)FUN_140296600(lVar7,uVar2,uVar6,L"nAcquireRoute",1);
      iVar3 = *piVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nItemRank");
      piVar9 = (int *)FUN_140296600(lVar7,uVar2,uVar6,L"nItemRank",1);
      iVar4 = *piVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fProbability");
      pfVar10 = (float *)FUN_1402967b0(lVar7,uVar2,uVar6,L"fProbability",1);
      fVar1 = *pfVar10;
      if ((iVar3 - 1U < 0xb) && (iVar4 - 1U < 5)) {
        lVar11 = (longlong)iVar4 + (longlong)iVar3 * 10;
        *(int *)(&DAT_14060cb94 + lVar11 * 4) = iVar4;
        *(int *)(&DAT_14060cba8 + lVar11 * 4) = (int)(fVar1 * 100.0);
      }
      puVar15 = *(undefined4 **)(puVar14 + 6);
      if (puVar15 == (undefined4 *)0x0) {
        uVar5 = (uint)puVar14[8] % *(uint *)(lVar7 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar5 << 3;
        do {
          if (*(uint *)(lVar7 + 0x78) <= uVar5) break;
          if (*(longlong *)(lVar11 + *(longlong *)(lVar7 + 0x68)) != 0) {
            puVar15 = *(undefined4 **)(lVar11 + *(longlong *)(lVar7 + 0x68));
          }
          uVar5 = uVar5 + 1;
          lVar11 = lVar11 + 8;
        } while (puVar15 == (undefined4 *)0x0);
      }
      goto LAB_140142bd4;
    }
    piVar9 = &DAT_14060cbd8;
    do {
      piVar13 = piVar9 + 10;
      *piVar9 = *piVar9 + piVar9[-1];
      piVar9[1] = piVar9[1] + *piVar9;
      piVar9[2] = piVar9[2] + piVar9[1];
      piVar9[3] = piVar9[3] + piVar9[2];
      piVar9 = piVar13;
    } while ((longlong)piVar13 < 0x14060cd90);
  }
  return;
}



undefined4 FUN_140142d40(longlong param_1,int param_2)

{
  int iVar1;
  longlong lVar2;
  
  lVar2 = (longlong)param_2;
  if (10 < param_2 - 1U) {
    return 1;
  }
  iVar1 = rand();
  iVar1 = iVar1 % 100 + 1;
  if ((0 < iVar1) && (iVar1 <= *(int *)(param_1 + -0x14 + lVar2 * 0x28))) {
    return *(undefined4 *)(param_1 + -0x28 + lVar2 * 0x28);
  }
  if (*(int *)(param_1 + -0x14 + lVar2 * 0x28) < iVar1) {
    if (iVar1 <= *(int *)(param_1 + -0x10 + lVar2 * 0x28)) {
      return *(undefined4 *)(param_1 + -0x24 + lVar2 * 0x28);
    }
LAB_140142dca:
    if (iVar1 <= *(int *)(param_1 + -0xc + lVar2 * 0x28)) {
      return *(undefined4 *)(param_1 + -0x20 + lVar2 * 0x28);
    }
  }
  else {
    if (*(int *)(param_1 + -0x10 + lVar2 * 0x28) < iVar1) goto LAB_140142dca;
    if (iVar1 <= *(int *)(param_1 + -0xc + lVar2 * 0x28)) {
      if (iVar1 <= *(int *)(param_1 + -8 + lVar2 * 0x28)) {
        return 1;
      }
      goto LAB_140142e04;
    }
  }
  if (iVar1 <= *(int *)(param_1 + -8 + lVar2 * 0x28)) {
    return *(undefined4 *)(param_1 + -0x1c + lVar2 * 0x28);
  }
LAB_140142e04:
  if (*(int *)(param_1 + -4 + lVar2 * 0x28) < iVar1) {
    return 1;
  }
  return *(undefined4 *)(param_1 + -0x18 + lVar2 * 0x28);
}



undefined * FUN_140142e30(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetEquipCorrectProbabilityDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce78 & 1) == 0) {
    DAT_14060ce78 = DAT_14060ce78 | 1;
    FUN_140142b50();
    atexit((_func_5014 *)&DAT_140448860);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetEquipCorrectProbabilityDB",
                  uVar3,pcVar4,DVar5);
  }
  return &DAT_14060cbc0;
}



undefined8 * FUN_140142ec0(void)

{
  FUN_14014ac60(0x3f400000,0x3e800000,0x40100000);
  _eh_vector_constructor_iterator_
            (&DAT_140608958,0x20,0xb,(_func_void_void_ptr *)&LAB_140147020,FUN_140147140);
  FUN_140143170();
  return &DAT_140608910;
}



void thunk_FUN_14014adf0(void)

{
  FUN_14014adf0();
  return;
}



undefined8
FUN_140142f50(longlong param_1,int param_2,int param_3,uint param_4,undefined4 *param_5,
             undefined4 *param_6,undefined4 *param_7,undefined4 *param_8)

{
  uint *puVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  uint *puVar6;
  uint *puVar7;
  __time64_t _Var8;
  uint *puVar9;
  uint uVar10;
  uint *puVar11;
  longlong lVar12;
  longlong lVar13;
  
  lVar5 = FUN_140137690();
  puVar9 = (uint *)0x0;
  if (*(longlong *)(lVar5 + 0x88) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                            ((ulonglong)param_4 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xa6)) {
      if ((puVar6[0xa8] == param_4) && (*puVar6 == param_4)) {
        if (puVar6 != (uint *)0x0) goto LAB_140142fc2;
        break;
      }
    }
  }
  puVar6 = puVar9;
LAB_140142fc2:
  if ((puVar6 != (uint *)0x0) && (puVar6 != (uint *)0xfffffffffffffff8)) {
    if (param_2 - 1U < 0xb) {
      lVar13 = (longlong)(int)(param_2 - 1U) * 0x20;
      lVar5 = *(longlong *)(lVar13 + 0x50 + param_1) - *(longlong *)(lVar13 + 0x48 + param_1);
      iVar3 = (int)(lVar5 >> 0x3f);
      iVar2 = (int)(lVar5 / 0x70) + iVar3;
      puVar11 = puVar9;
      if (iVar2 != iVar3) {
        do {
          lVar5 = *(longlong *)(lVar13 + 0x48 + param_1);
          if ((((*(int *)(lVar5 + 8 + (longlong)puVar9) == param_2) &&
               (*(int *)(lVar5 + 0xc + (longlong)puVar9) == param_3)) &&
              (*(int *)(lVar5 + (longlong)puVar9) <= (int)puVar6[0x44])) &&
             ((int)puVar6[0x44] <= *(int *)(lVar5 + 4 + (longlong)puVar9))) {
            puVar1 = *(uint **)(lVar5 + 0x38 + (longlong)puVar9);
            puVar7 = *(uint **)(lVar5 + 0x30 + (longlong)puVar9);
            if (puVar7 != puVar1) {
              do {
                if (*puVar7 == puVar6[0x32]) break;
                puVar7 = puVar7 + 1;
              } while (puVar7 != puVar1);
              if (puVar7 != puVar1) {
                puVar1 = *(uint **)(lVar5 + 0x58 + (longlong)puVar9);
                puVar7 = *(uint **)(lVar5 + 0x50 + (longlong)puVar9);
                if (puVar7 != puVar1) {
                  do {
                    if (*puVar7 == puVar6[0x33]) break;
                    puVar7 = puVar7 + 1;
                  } while (puVar7 != puVar1);
                  if (puVar7 != puVar1) {
                    _Var8 = _time64((__time64_t *)0x0);
                    srand((uint)_Var8);
                    lVar5 = *(longlong *)(lVar13 + 0x48 + param_1);
                    lVar12 = (longlong)puVar11 * 0x70;
                    uVar4 = FUN_14015b2f0(*(undefined4 *)(lVar12 + 0x10 + lVar5),
                                          *(undefined4 *)(lVar12 + 0x14 + lVar5));
                    *param_5 = uVar4;
                    lVar5 = *(longlong *)(lVar13 + 0x48 + param_1);
                    uVar4 = FUN_14015b2f0(*(undefined4 *)(lVar12 + 0x18 + lVar5),
                                          *(undefined4 *)(lVar12 + 0x1c + lVar5));
                    *param_6 = uVar4;
                    lVar5 = *(longlong *)(lVar13 + 0x48 + param_1);
                    uVar4 = FUN_14015b2f0(*(undefined4 *)(lVar12 + 0x20 + lVar5),
                                          *(undefined4 *)(lVar12 + 0x24 + lVar5));
                    *param_7 = uVar4;
                    lVar5 = *(longlong *)(lVar13 + 0x48 + param_1);
                    uVar4 = FUN_14015b2f0(*(undefined4 *)(lVar12 + 0x28 + lVar5),
                                          *(undefined4 *)(lVar12 + 0x2c + lVar5));
                    *param_8 = uVar4;
                    return 1;
                  }
                }
              }
            }
          }
          uVar10 = (int)puVar11 + 1;
          puVar9 = puVar9 + 0x1c;
          puVar11 = (uint *)(ulonglong)uVar10;
        } while (uVar10 < (uint)(iVar2 - iVar3));
      }
    }
  }
  *param_5 = 0;
  *param_6 = 0;
  *param_7 = 0;
  *param_8 = 0;
  return 0;
}



void FUN_140143170(void)

{
  undefined4 uVar1;
  int iVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar7;
  undefined4 *puVar8;
  int *piVar9;
  longlong lVar10;
  longlong *plVar11;
  undefined4 *puVar12;
  undefined4 local_res8 [2];
  undefined4 local_118;
  undefined4 local_114;
  int local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  void *local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  void *local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined8 local_a8;
  undefined1 local_a0 [56];
  void *local_68;
  void *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined4 *puVar6;
  
  local_a8 = 0xfffffffffffffffe;
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"Equip_Correct");
  if (lVar5 != 0) {
    puVar12 = (undefined4 *)0x0;
    puVar8 = puVar12;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar6 = puVar12;
      plVar11 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar11 != 0) {
          puVar8 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar3 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar3;
        plVar11 = plVar11 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_1401431f1:
    puVar6 = puVar8;
    if (puVar6 != (undefined4 *)0x0) {
      uVar1 = *puVar6;
      local_e8 = (void *)0x0;
      local_e0 = 0;
      local_d8 = 0;
      local_c8 = (void *)0x0;
      local_c0 = 0;
      local_b8 = 0;
      local_res8[0] = uVar1;
      uVar4 = FUN_1402970c0(lVar5,L"szCategory");
      uVar7 = FUN_140296990(lVar5,uVar1,uVar4,L"szCategory",1);
      FUN_140416000(&local_e8,uVar7);
      uVar4 = FUN_1402970c0(lVar5,L"szSubCategory");
      uVar7 = FUN_140296990(lVar5,uVar1,uVar4,L"szSubCategory",1);
      FUN_140416000(&local_c8,uVar7);
      uVar4 = FUN_1402970c0(lVar5,L"nMinLimitLv");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nMinLimitLv",1);
      local_118 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nMaxLimitLv");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nMaxLimitLv",1);
      local_114 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nAcquireRoute");
      piVar9 = (int *)FUN_140296600(lVar5,uVar1,uVar4,L"nAcquireRoute",1);
      iVar2 = *piVar9;
      local_110 = iVar2;
      uVar4 = FUN_1402970c0(lVar5,L"nItemRank");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nItemRank",1);
      local_10c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nPhysicalMin");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nPhysicalMin",1);
      local_108 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nPhysicalMax");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nPhysicalMax",1);
      local_104 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nMagicalMin");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nMagicalMin",1);
      local_100 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nMagicalMax");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nMagicalMax",1);
      local_fc = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nDurabilityMin");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nDurabilityMin",1);
      local_f8 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nDurabilityMax");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nDurabilityMax",1);
      local_f4 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nWeightMin");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nWeightMin",1);
      local_f0 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nWeightMax");
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar4,L"nWeightMax",1);
      local_ec = *puVar8;
      puVar8 = (undefined4 *)FUN_14014ae10(local_a0,local_res8,&local_118);
      FUN_14014ad30(*puVar8);
      if (local_48 != (void *)0x0) {
        operator_delete(local_48);
      }
      local_48 = (void *)0x0;
      local_40 = 0;
      local_38 = 0;
      if (local_68 != (void *)0x0) {
        operator_delete(local_68);
      }
      uVar3 = iVar2 - 1;
      if (uVar3 < 0xb) {
        FUN_140147180(&DAT_140608958 + (longlong)(int)uVar3 * 0x20);
      }
      if (local_c8 != (void *)0x0) {
        operator_delete(local_c8);
      }
      if (local_e8 != (void *)0x0) {
        operator_delete(local_e8);
      }
      puVar8 = *(undefined4 **)(puVar6 + 6);
      if (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar6[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar10 = (longlong)(int)uVar3 << 3;
        puVar8 = puVar12;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar10) != 0) {
            puVar8 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar10);
          }
          uVar3 = uVar3 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_1401431f1;
    }
  }
  return;
}



void FUN_1401435b0(longlong param_1)

{
  if (*(void **)(param_1 + 0x50) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x50));
  }
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  if (*(void **)(param_1 + 0x30) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  return;
}



void FUN_140143600(longlong param_1)

{
  if (*(void **)(param_1 + 0x58) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  if (*(void **)(param_1 + 0x38) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  return;
}



undefined8 * FUN_140143650(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetEquipCorrectDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce74 & 1) == 0) {
    DAT_14060ce74 = DAT_14060ce74 | 1;
    FUN_140142ec0();
    atexit(FUN_140448870);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetEquipCorrectDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608910;
}



void thunk_FUN_14014afd0(void)

{
  FUN_14014afd0();
  return;
}



void FUN_1401436f0(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined4 *puVar6;
  int *piVar7;
  longlong lVar8;
  longlong *plVar9;
  int iVar10;
  undefined4 *puVar11;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 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;
  undefined4 local_40;
  undefined1 local_3c [52];
  
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"SocketChange");
  if (lVar4 != 0) {
    if (*(longlong *)(lVar4 + 0x70) != 0) {
      uVar5 = 0;
      if (*(uint *)(lVar4 + 0x78) != 0) {
        plVar9 = *(longlong **)(lVar4 + 0x68);
        do {
          if (*plVar9 != 0) {
            puVar6 = (undefined4 *)(*(longlong **)(lVar4 + 0x68))[uVar5];
            goto LAB_140143766;
          }
          uVar2 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar2;
          plVar9 = plVar9 + 1;
        } while (uVar2 < *(uint *)(lVar4 + 0x78));
      }
    }
    puVar6 = (undefined4 *)0x0;
LAB_140143766:
    puVar11 = puVar6;
    if (puVar11 != (undefined4 *)0x0) {
      uVar1 = *puVar11;
      uVar3 = FUN_1402970c0(lVar4,&DAT_14049f290);
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,&DAT_14049f290,1);
      local_78 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nType");
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nType",1);
      local_74 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nLevelMin");
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nLevelMin",1);
      local_70 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nLevelMax");
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nLevelMax",1);
      local_6c = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nBranch");
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nBranch",1);
      local_68 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nSocketCount00");
      piVar7 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nSocketCount00",1);
      iVar10 = *piVar7;
      local_64 = iVar10;
      uVar3 = FUN_1402970c0(lVar4,L"nSocketCount01");
      piVar7 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nSocketCount01",1);
      iVar10 = iVar10 + *piVar7;
      local_60 = iVar10;
      uVar3 = FUN_1402970c0(lVar4,L"nSocketCount02");
      piVar7 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nSocketCount02",1);
      iVar10 = iVar10 + *piVar7;
      local_5c = iVar10;
      uVar3 = FUN_1402970c0(lVar4,L"nSocketCount03");
      piVar7 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nSocketCount03",1);
      local_58 = iVar10 + *piVar7;
      uVar3 = FUN_1402970c0(lVar4,L"nRedSocket");
      piVar7 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nRedSocket",1);
      iVar10 = *piVar7;
      local_54 = iVar10;
      uVar3 = FUN_1402970c0(lVar4,L"nBlueSocket");
      piVar7 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nBlueSocket",1);
      iVar10 = iVar10 + *piVar7;
      local_50 = iVar10;
      uVar3 = FUN_1402970c0(lVar4,L"nYellowSocket");
      piVar7 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nYellowSocket",1);
      iVar10 = iVar10 + *piVar7;
      local_4c = iVar10;
      uVar3 = FUN_1402970c0(lVar4,L"nGreenSocket");
      piVar7 = (int *)FUN_140296600(lVar4,uVar1,uVar3,L"nGreenSocket",1);
      local_48 = iVar10 + *piVar7;
      local_40 = uVar1;
      memcpy(local_3c,&local_78,0x34);
      FUN_14014af10(uVar1);
      puVar6 = *(undefined4 **)(puVar11 + 6);
      if (puVar6 == (undefined4 *)0x0) {
        uVar2 = (uint)puVar11[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar8 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar8 + *(longlong *)(lVar4 + 0x68)) != 0) {
            puVar6 = *(undefined4 **)(lVar8 + *(longlong *)(lVar4 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar8 = lVar8 + 8;
        } while (puVar6 == (undefined4 *)0x0);
      }
      goto LAB_140143766;
    }
  }
  return;
}



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

void FUN_140143a70(longlong *param_1,int param_2,int param_3,int param_4,ulonglong *param_5)

{
  int *piVar1;
  code *pcVar2;
  uint uVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  int *piVar7;
  longlong *plVar8;
  longlong lVar9;
  ulonglong uVar10;
  int iVar11;
  ulonglong uVar12;
  int iVar13;
  int local_res8 [2];
  
  if (param_1[1] != 0) {
    uVar10 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar8 = (longlong *)*param_1;
      do {
        if (*plVar8 != 0) {
          lVar9 = ((longlong *)*param_1)[uVar10];
          goto LAB_140143ad5;
        }
        uVar3 = (int)uVar10 + 1;
        uVar10 = (ulonglong)uVar3;
        plVar8 = plVar8 + 1;
      } while (uVar3 < *(uint *)(param_1 + 2));
    }
  }
  lVar9 = 0;
LAB_140143ad5:
  do {
    lVar6 = lVar9;
    if (lVar6 == 0) {
      return;
    }
    if ((((param_2 == *(int *)(lVar6 + 8)) && (param_4 == *(int *)(lVar6 + 0x14))) &&
        (*(int *)(lVar6 + 0xc) <= param_3)) && (param_3 <= *(int *)(lVar6 + 0x10))) {
      iVar4 = rand();
      piVar7 = (int *)(lVar6 + 0x18);
      iVar11 = 0;
      lVar9 = 0;
      break;
    }
    lVar9 = *(longlong *)(lVar6 + 0x38);
    if (lVar9 == 0) {
      uVar3 = *(uint *)(lVar6 + 0x40) % *(uint *)(param_1 + 2) + 1;
      lVar6 = (longlong)(int)uVar3 << 3;
      do {
        if (*(uint *)(param_1 + 2) <= uVar3) break;
        if (*(longlong *)(*param_1 + lVar6) != 0) {
          lVar9 = *(longlong *)(*param_1 + lVar6);
        }
        uVar3 = uVar3 + 1;
        lVar6 = lVar6 + 8;
      } while (lVar9 == 0);
    }
  } while( true );
  while( true ) {
    lVar9 = lVar9 + 1;
    iVar11 = iVar11 + 1;
    piVar7 = piVar7 + 1;
    iVar13 = 0;
    if (3 < lVar9) break;
    iVar13 = iVar11;
    if (iVar4 % 10000 + 1 <= *piVar7) break;
  }
  iVar4 = 0;
  if (0 < iVar13) {
    do {
      iVar5 = rand();
      iVar11 = 0;
      lVar9 = 0;
      piVar7 = (int *)(lVar6 + 0x28);
      do {
        if (iVar5 % 10000 + 1 <= *piVar7) {
          piVar7 = (int *)param_5[1];
          iVar11 = iVar11 + 1;
          local_res8[0] = iVar11;
          if ((local_res8 < piVar7) && (piVar1 = (int *)*param_5, piVar1 <= local_res8)) {
            if (piVar7 == (int *)param_5[2]) {
              uVar10 = (longlong)piVar7 - (longlong)piVar1 >> 2;
              if (0x3ffffffffffffffe < uVar10) {
                std::_Xlength_error("vector<T> too long");
                pcVar2 = (code *)swi(3);
                (*pcVar2)();
                return;
              }
              uVar10 = uVar10 + 1;
              uVar12 = (longlong)param_5[2] - (longlong)piVar1 >> 2;
              if (uVar12 < uVar10) {
                if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                  uVar12 = 0;
                }
                else {
                  uVar12 = uVar12 + (uVar12 >> 1);
                }
                if (uVar12 < uVar10) {
                  uVar12 = uVar10;
                }
                FUN_140051e60(param_5,uVar12);
              }
            }
            if ((undefined4 *)param_5[1] != (undefined4 *)0x0) {
              *(undefined4 *)param_5[1] =
                   *(undefined4 *)(*param_5 + ((longlong)local_res8 - (longlong)piVar1 >> 2) * 4);
            }
          }
          else {
            if (piVar7 == (int *)param_5[2]) {
              uVar10 = (longlong)((longlong)piVar7 - *param_5) >> 2;
              if (0x3ffffffffffffffe < uVar10) {
                std::_Xlength_error("vector<T> too long");
                pcVar2 = (code *)swi(3);
                (*pcVar2)();
                return;
              }
              uVar10 = uVar10 + 1;
              uVar12 = (longlong)((longlong)param_5[2] - *param_5) >> 2;
              if (uVar12 < uVar10) {
                if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                  uVar12 = 0;
                }
                else {
                  uVar12 = uVar12 + (uVar12 >> 1);
                }
                if (uVar12 < uVar10) {
                  uVar12 = uVar10;
                }
                FUN_140051e60(param_5,uVar12);
              }
            }
            if ((int *)param_5[1] != (int *)0x0) {
              *(int *)param_5[1] = iVar11;
            }
          }
          param_5[1] = param_5[1] + 4;
          break;
        }
        lVar9 = lVar9 + 1;
        iVar11 = iVar11 + 1;
        piVar7 = piVar7 + 1;
      } while (lVar9 < 4);
      iVar4 = iVar4 + 1;
    } while (iVar4 < iVar13);
  }
  return;
}



undefined8 * FUN_140143d50(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetSocketChangeDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce70 & 1) == 0) {
    DAT_14060ce70 = DAT_14060ce70 | 1;
    FUN_14014ae40(0x3f400000,0x3e800000,0x40100000);
    FUN_1401436f0();
    atexit((_func_5014 *)&LAB_1404488b0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetSocketChangeDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_1406088c0;
}



void thunk_FUN_14014b180(void)

{
  FUN_14014b180();
  return;
}



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

void FUN_140143e10(void)

{
  short sVar1;
  undefined4 uVar2;
  code *pcVar3;
  wchar_t *pwVar4;
  uint uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong lVar8;
  undefined4 *puVar9;
  short *psVar10;
  longlong lVar11;
  longlong lVar12;
  int *piVar13;
  longlong *plVar14;
  ulonglong uVar15;
  wchar_t *pwVar16;
  undefined4 *puVar17;
  undefined4 *puVar18;
  undefined4 *puVar19;
  short *psVar20;
  undefined4 *puVar21;
  wchar_t *pwVar22;
  undefined1 auStack_238 [32];
  undefined1 local_218;
  int local_208;
  undefined4 local_204;
  wchar_t *local_200;
  wchar_t *local_1f8;
  undefined8 local_1f0;
  undefined4 *local_1e0;
  longlong local_1d8;
  longlong local_1d0;
  longlong local_1c8;
  undefined8 local_1c0;
  undefined4 local_1b8;
  undefined4 local_1b4;
  undefined4 local_1b0;
  undefined4 local_1ac;
  undefined2 local_1a8;
  undefined6 uStack_1a6;
  undefined8 local_198;
  ulonglong local_190;
  int *local_180;
  int *local_178;
  int *local_170;
  int *local_160;
  int *local_158;
  int *local_150;
  int *local_140;
  int *local_138;
  int *local_130;
  int *local_120;
  int *local_118;
  int *local_110;
  undefined1 local_f8 [8];
  undefined1 local_f0 [184];
  ulonglong local_38;
  
  local_1c0 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_238;
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"PrefixChange_Condition");
  if (lVar8 != 0) {
    puVar19 = (undefined4 *)0x0;
    puVar9 = puVar19;
    local_1c8 = lVar8;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar17 = puVar19;
      plVar14 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar14 != 0) {
          puVar9 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar17];
          break;
        }
        uVar5 = (int)puVar17 + 1;
        puVar17 = (undefined4 *)(ulonglong)uVar5;
        plVar14 = plVar14 + 1;
      } while (uVar5 < *(uint *)(lVar8 + 0x78));
    }
LAB_140143eaa:
    if (puVar9 != (undefined4 *)0x0) {
      uVar2 = *puVar9;
      local_190 = 7;
      local_198 = 0;
      local_1a8 = 0;
      local_180 = (int *)0x0;
      local_178 = (int *)0x0;
      local_170 = (int *)0x0;
      local_160 = (int *)0x0;
      local_158 = (int *)0x0;
      local_150 = (int *)0x0;
      local_140 = (int *)0x0;
      local_138 = (int *)0x0;
      local_130 = (int *)0x0;
      local_120 = (int *)0x0;
      local_118 = (int *)0x0;
      local_110 = (int *)0x0;
      local_204 = uVar2;
      local_1e0 = puVar9;
      uVar6 = FUN_1402970c0(lVar8,&DAT_14049f290);
      local_218 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,&DAT_14049f290);
      local_1b8 = *puVar9;
      uVar6 = FUN_1402970c0(lVar8,L"nLevelMin");
      local_218 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nLevelMin");
      local_1b0 = *puVar9;
      uVar6 = FUN_1402970c0(lVar8,L"nLevelMax");
      local_218 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nLevelMax");
      local_1ac = *puVar9;
      uVar6 = FUN_1402970c0(lVar8,L"nOptionGroup");
      local_218 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nOptionGroup");
      local_1b4 = *puVar9;
      uVar6 = FUN_1402970c0(lVar8,L"wszNote");
      local_218 = 1;
      psVar10 = (short *)FUN_140296b70(lVar8,uVar2,uVar6,L"wszNote");
      uVar15 = 0xffffffffffffffff;
      psVar20 = psVar10;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar1 = *psVar20;
        psVar20 = psVar20 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_1a8,psVar10,~uVar15 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"szBranch");
      local_218 = 1;
      lVar11 = FUN_140296990(lVar8,uVar2,uVar6,L"szBranch");
      uVar6 = FUN_1402970c0(lVar8,L"szCategory");
      local_218 = 1;
      lVar12 = FUN_140296990(lVar8,uVar2,uVar6,L"szCategory");
      local_1d0 = lVar12;
      uVar6 = FUN_1402970c0(lVar8,L"szSubCategory");
      local_218 = 1;
      local_1d8 = FUN_140296990(lVar8,uVar2,uVar6,L"szSubCategory");
      if (lVar11 != 0) {
        local_200 = (wchar_t *)0x0;
        local_1f8 = (wchar_t *)0x0;
        local_1f0 = 0;
        FUN_140415930(&local_200,lVar11,&DAT_14049c7b8);
        pwVar4 = local_1f8;
        lVar8 = (longlong)local_1f8 - (longlong)local_200 >> 0x3f;
        lVar11 = ((longlong)local_1f8 - (longlong)local_200) / 0x28 + lVar8;
        pwVar22 = local_200;
        puVar9 = puVar19;
        if (lVar11 != lVar8) {
          do {
            pwVar16 = pwVar22;
            if (7 < *(ulonglong *)(pwVar22 + 0xc)) {
              pwVar16 = *(wchar_t **)pwVar22;
            }
            iVar7 = _wtoi(pwVar16);
            local_208 = iVar7;
            if ((&local_208 < local_178) && (local_180 <= &local_208)) {
              lVar12 = (longlong)&local_208 - (longlong)local_180;
              if (local_178 == local_170) {
                uVar15 = (longlong)local_178 - (longlong)local_180 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  (*pcVar3)();
                  return;
                }
                puVar21 = (undefined4 *)(uVar15 + 1);
                puVar17 = (undefined4 *)((longlong)local_170 - (longlong)local_180 >> 2);
                if (puVar17 < puVar21) {
                  puVar18 = puVar19;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar18 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar18 < puVar21) {
                    puVar18 = puVar21;
                  }
                  FUN_140051e60(&local_180,puVar18);
                }
              }
              if (local_178 != (int *)0x0) {
                *local_178 = local_180[lVar12 >> 2];
              }
            }
            else {
              if (local_178 == local_170) {
                uVar15 = (longlong)local_178 - (longlong)local_180 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_140144d47;
                }
                puVar21 = (undefined4 *)(uVar15 + 1);
                puVar17 = (undefined4 *)((longlong)local_170 - (longlong)local_180 >> 2);
                if (puVar17 < puVar21) {
                  puVar18 = puVar19;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar18 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar18 < puVar21) {
                    puVar18 = puVar21;
                  }
                  FUN_140051e60(&local_180,puVar18);
                }
              }
              if (local_178 != (int *)0x0) {
                *local_178 = iVar7;
              }
            }
            local_178 = local_178 + 1;
            puVar9 = (undefined4 *)(ulonglong)((int)puVar9 + 1);
            lVar12 = local_1d0;
            pwVar22 = pwVar22 + 0x14;
          } while (puVar9 < (undefined4 *)(lVar11 - lVar8));
        }
        pwVar16 = local_200;
        pwVar22 = local_200;
        if (local_200 != (wchar_t *)0x0) {
          for (; pwVar22 != pwVar4; pwVar22 = pwVar22 + 0x14) {
            if (7 < *(ulonglong *)(pwVar22 + 0xc)) {
              operator_delete(*(void **)pwVar22);
            }
            pwVar22[0xc] = L'\a';
            pwVar22[0xd] = L'\0';
            pwVar22[0xe] = L'\0';
            pwVar22[0xf] = L'\0';
            pwVar22[8] = L'\0';
            pwVar22[9] = L'\0';
            pwVar22[10] = L'\0';
            pwVar22[0xb] = L'\0';
            *pwVar22 = L'\0';
          }
          operator_delete(pwVar16);
        }
      }
      if (lVar12 != 0) {
        local_200 = (wchar_t *)0x0;
        local_1f8 = (wchar_t *)0x0;
        local_1f0 = 0;
        FUN_140415930(&local_200,lVar12,&DAT_14049c7b8);
        pwVar4 = local_1f8;
        lVar8 = (longlong)local_1f8 - (longlong)local_200 >> 0x3f;
        lVar12 = ((longlong)local_1f8 - (longlong)local_200) / 0x28 + lVar8;
        pwVar22 = local_200;
        puVar9 = puVar19;
        if (lVar12 != lVar8) {
          do {
            pwVar16 = pwVar22;
            if (7 < *(ulonglong *)(pwVar22 + 0xc)) {
              pwVar16 = *(wchar_t **)pwVar22;
            }
            iVar7 = _wtoi(pwVar16);
            local_208 = iVar7;
            if ((&local_208 < local_158) && (local_160 <= &local_208)) {
              lVar11 = (longlong)&local_208 - (longlong)local_160;
              if (local_158 == local_150) {
                uVar15 = (longlong)local_158 - (longlong)local_160 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
LAB_140144d47:
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  (*pcVar3)();
                  return;
                }
                puVar21 = (undefined4 *)(uVar15 + 1);
                puVar17 = (undefined4 *)((longlong)local_150 - (longlong)local_160 >> 2);
                if (puVar17 < puVar21) {
                  puVar18 = puVar19;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar18 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar18 < puVar21) {
                    puVar18 = puVar21;
                  }
                  FUN_140051e60(&local_160,puVar18);
                }
              }
              if (local_158 != (int *)0x0) {
                *local_158 = local_160[lVar11 >> 2];
              }
            }
            else {
              if (local_158 == local_150) {
                uVar15 = (longlong)local_158 - (longlong)local_160 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_140144d63;
                }
                puVar21 = (undefined4 *)(uVar15 + 1);
                puVar17 = (undefined4 *)((longlong)local_150 - (longlong)local_160 >> 2);
                if (puVar17 < puVar21) {
                  puVar18 = puVar19;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar18 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar18 < puVar21) {
                    puVar18 = puVar21;
                  }
                  FUN_140051e60(&local_160,puVar18);
                }
              }
              if (local_158 != (int *)0x0) {
                *local_158 = iVar7;
              }
            }
            local_158 = local_158 + 1;
            puVar9 = (undefined4 *)(ulonglong)((int)puVar9 + 1);
            pwVar22 = pwVar22 + 0x14;
          } while (puVar9 < (undefined4 *)(lVar12 - lVar8));
        }
        pwVar16 = local_200;
        pwVar22 = local_200;
        if (local_200 != (wchar_t *)0x0) {
          for (; pwVar22 != pwVar4; pwVar22 = pwVar22 + 0x14) {
            if (7 < *(ulonglong *)(pwVar22 + 0xc)) {
              operator_delete(*(void **)pwVar22);
            }
            pwVar22[0xc] = L'\a';
            pwVar22[0xd] = L'\0';
            pwVar22[0xe] = L'\0';
            pwVar22[0xf] = L'\0';
            pwVar22[8] = L'\0';
            pwVar22[9] = L'\0';
            pwVar22[10] = L'\0';
            pwVar22[0xb] = L'\0';
            *pwVar22 = L'\0';
          }
          operator_delete(pwVar16);
        }
      }
      if (local_1d8 != 0) {
        local_200 = (wchar_t *)0x0;
        local_1f8 = (wchar_t *)0x0;
        local_1f0 = 0;
        FUN_140415930(&local_200,local_1d8,&DAT_14049c7b8);
        pwVar4 = local_1f8;
        lVar8 = (longlong)local_1f8 - (longlong)local_200 >> 0x3f;
        lVar12 = ((longlong)local_1f8 - (longlong)local_200) / 0x28 + lVar8;
        pwVar22 = local_200;
        puVar9 = puVar19;
        if (lVar12 != lVar8) {
          do {
            pwVar16 = pwVar22;
            if (7 < *(ulonglong *)(pwVar22 + 0xc)) {
              pwVar16 = *(wchar_t **)pwVar22;
            }
            iVar7 = _wtoi(pwVar16);
            local_208 = iVar7;
            if ((&local_208 < local_138) && (local_140 <= &local_208)) {
              lVar11 = (longlong)&local_208 - (longlong)local_140;
              if (local_138 == local_130) {
                uVar15 = (longlong)local_138 - (longlong)local_140 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
LAB_140144d63:
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  (*pcVar3)();
                  return;
                }
                puVar21 = (undefined4 *)(uVar15 + 1);
                puVar17 = (undefined4 *)((longlong)local_130 - (longlong)local_140 >> 2);
                if (puVar17 < puVar21) {
                  puVar18 = puVar19;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar18 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar18 < puVar21) {
                    puVar18 = puVar21;
                  }
                  FUN_140051e60(&local_140,puVar18);
                }
              }
              if (local_138 != (int *)0x0) {
                *local_138 = local_140[lVar11 >> 2];
              }
            }
            else {
              if (local_138 == local_130) {
                uVar15 = (longlong)local_138 - (longlong)local_140 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_140144d7f;
                }
                puVar21 = (undefined4 *)(uVar15 + 1);
                puVar17 = (undefined4 *)((longlong)local_130 - (longlong)local_140 >> 2);
                if (puVar17 < puVar21) {
                  puVar18 = puVar19;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar18 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar18 < puVar21) {
                    puVar18 = puVar21;
                  }
                  FUN_140051e60(&local_140,puVar18);
                }
              }
              if (local_138 != (int *)0x0) {
                *local_138 = iVar7;
              }
            }
            local_138 = local_138 + 1;
            puVar9 = (undefined4 *)(ulonglong)((int)puVar9 + 1);
            pwVar22 = pwVar22 + 0x14;
          } while (puVar9 < (undefined4 *)(lVar12 - lVar8));
        }
        pwVar16 = local_200;
        pwVar22 = local_200;
        if (local_200 != (wchar_t *)0x0) {
          for (; pwVar22 != pwVar4; pwVar22 = pwVar22 + 0x14) {
            if (7 < *(ulonglong *)(pwVar22 + 0xc)) {
              operator_delete(*(void **)pwVar22);
            }
            pwVar22[0xc] = L'\a';
            pwVar22[0xd] = L'\0';
            pwVar22[0xe] = L'\0';
            pwVar22[0xf] = L'\0';
            pwVar22[8] = L'\0';
            pwVar22[9] = L'\0';
            pwVar22[10] = L'\0';
            pwVar22[0xb] = L'\0';
            *pwVar22 = L'\0';
          }
          operator_delete(pwVar16);
        }
      }
      lVar8 = local_1c8;
      uVar6 = FUN_1402970c0(local_1c8,L"nPrefixOption00");
      uVar2 = local_204;
      local_218 = 1;
      piVar13 = (int *)FUN_140296600(lVar8,local_204,uVar6,L"nPrefixOption00");
      iVar7 = *piVar13;
      local_208 = iVar7;
      if ((&local_208 < local_118) && (local_120 <= &local_208)) {
        lVar12 = (longlong)&local_208 - (longlong)local_120;
        if (local_118 == local_110) {
          uVar15 = (longlong)local_118 - (longlong)local_120 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
LAB_140144d7f:
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          puVar17 = (undefined4 *)(uVar15 + 1);
          puVar9 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
          if (puVar9 < puVar17) {
            puVar21 = puVar19;
            if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
              puVar21 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
            }
            if (puVar21 < puVar17) {
              puVar21 = puVar17;
            }
            FUN_140051e60(&local_120,puVar21);
          }
        }
        if (local_118 != (int *)0x0) {
          *local_118 = local_120[lVar12 >> 2];
        }
      }
      else {
        if (local_118 == local_110) {
          uVar15 = (longlong)local_118 - (longlong)local_120 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          puVar17 = (undefined4 *)(uVar15 + 1);
          puVar9 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
          if (puVar9 < puVar17) {
            puVar21 = puVar19;
            if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
              puVar21 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
            }
            if (puVar21 < puVar17) {
              puVar21 = puVar17;
            }
            FUN_140051e60(&local_120,puVar21);
          }
        }
        if (local_118 != (int *)0x0) {
          *local_118 = iVar7;
        }
      }
      local_118 = local_118 + 1;
      uVar6 = FUN_1402970c0(lVar8,L"nPrefixOption01");
      local_218 = 1;
      piVar13 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nPrefixOption01");
      iVar7 = iVar7 + *piVar13;
      local_208 = iVar7;
      if ((&local_208 < local_118) && (local_120 <= &local_208)) {
        lVar12 = (longlong)&local_208 - (longlong)local_120;
        if (local_118 == local_110) {
          uVar15 = (longlong)local_118 - (longlong)local_120 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          puVar17 = (undefined4 *)(uVar15 + 1);
          puVar9 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
          if (puVar9 < puVar17) {
            puVar21 = puVar19;
            if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
              puVar21 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
            }
            if (puVar21 < puVar17) {
              puVar21 = puVar17;
            }
            FUN_140051e60(&local_120,puVar21);
          }
        }
        if (local_118 != (int *)0x0) {
          *local_118 = local_120[lVar12 >> 2];
        }
      }
      else {
        if (local_118 == local_110) {
          uVar15 = (longlong)local_118 - (longlong)local_120 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          puVar17 = (undefined4 *)(uVar15 + 1);
          puVar9 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
          if (puVar9 < puVar17) {
            puVar21 = puVar19;
            if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
              puVar21 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
            }
            if (puVar21 < puVar17) {
              puVar21 = puVar17;
            }
            FUN_140051e60(&local_120,puVar21);
          }
        }
        if (local_118 != (int *)0x0) {
          *local_118 = iVar7;
        }
      }
      local_118 = local_118 + 1;
      uVar6 = FUN_1402970c0(lVar8,L"nPrefixOption02");
      local_218 = 1;
      piVar13 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nPrefixOption02");
      iVar7 = iVar7 + *piVar13;
      local_208 = iVar7;
      if ((&local_208 < local_118) && (local_120 <= &local_208)) {
        lVar12 = (longlong)&local_208 - (longlong)local_120;
        if (local_118 == local_110) {
          uVar15 = (longlong)local_118 - (longlong)local_120 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          puVar17 = (undefined4 *)(uVar15 + 1);
          puVar9 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
          if (puVar9 < puVar17) {
            puVar21 = puVar19;
            if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
              puVar21 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
            }
            if (puVar21 < puVar17) {
              puVar21 = puVar17;
            }
            FUN_140051e60(&local_120,puVar21);
          }
        }
        if (local_118 != (int *)0x0) {
          *local_118 = local_120[lVar12 >> 2];
        }
      }
      else {
        if (local_118 == local_110) {
          uVar15 = (longlong)local_118 - (longlong)local_120 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          puVar17 = (undefined4 *)(uVar15 + 1);
          puVar9 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
          if (puVar9 < puVar17) {
            puVar21 = puVar19;
            if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
              puVar21 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
            }
            if (puVar21 < puVar17) {
              puVar21 = puVar17;
            }
            FUN_140051e60(&local_120,puVar21);
          }
        }
        if (local_118 != (int *)0x0) {
          *local_118 = iVar7;
        }
      }
      local_118 = local_118 + 1;
      uVar6 = FUN_1402970c0(lVar8,L"nPrefixOption03");
      local_218 = 1;
      piVar13 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nPrefixOption03");
      iVar7 = iVar7 + *piVar13;
      local_208 = iVar7;
      if ((&local_208 < local_118) && (local_120 <= &local_208)) {
        lVar12 = (longlong)&local_208 - (longlong)local_120;
        if (local_118 == local_110) {
          uVar15 = (longlong)local_118 - (longlong)local_120 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          puVar17 = (undefined4 *)(uVar15 + 1);
          puVar9 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
          if (puVar9 < puVar17) {
            puVar21 = puVar19;
            if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
              puVar21 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
            }
            if (puVar21 < puVar17) {
              puVar21 = puVar17;
            }
            FUN_140051e60(&local_120,puVar21);
          }
        }
        if (local_118 != (int *)0x0) {
          *local_118 = local_120[lVar12 >> 2];
        }
      }
      else {
        if (local_118 == local_110) {
          uVar15 = (longlong)local_118 - (longlong)local_120 >> 2;
          if (0x3ffffffffffffffe < uVar15) {
            std::_Xlength_error("vector<T> too long");
            return;
          }
          puVar17 = (undefined4 *)(uVar15 + 1);
          puVar9 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
          if (puVar9 < puVar17) {
            puVar21 = puVar19;
            if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
              puVar21 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
            }
            if (puVar21 < puVar17) {
              puVar21 = puVar17;
            }
            FUN_140051e60(&local_120,puVar21);
          }
        }
        if (local_118 != (int *)0x0) {
          *local_118 = iVar7;
        }
      }
      local_118 = local_118 + 1;
      puVar9 = (undefined4 *)FUN_14014b1a0(local_f8,&local_204,&local_1b8);
      FUN_14014b0c0(*puVar9);
      FUN_140144e20(local_f0);
      if (local_120 != (int *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_120);
        operator_delete(local_120);
      }
      local_120 = (int *)0x0;
      local_118 = (int *)0x0;
      local_110 = (int *)0x0;
      if (local_140 != (int *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_140);
        operator_delete(local_140);
      }
      local_140 = (int *)0x0;
      local_138 = (int *)0x0;
      local_130 = (int *)0x0;
      if (local_160 != (int *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_160);
        operator_delete(local_160);
      }
      local_160 = (int *)0x0;
      local_158 = (int *)0x0;
      local_150 = (int *)0x0;
      if (local_180 != (int *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_180);
        operator_delete(local_180);
      }
      local_180 = (int *)0x0;
      local_178 = (int *)0x0;
      local_170 = (int *)0x0;
      if (7 < local_190) {
        operator_delete((void *)CONCAT62(uStack_1a6,local_1a8));
      }
      puVar9 = *(undefined4 **)(local_1e0 + 6);
      if (puVar9 == (undefined4 *)0x0) {
        uVar5 = (uint)local_1e0[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar12 = (longlong)(int)uVar5 << 3;
        puVar9 = puVar19;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar5) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar12) != 0) {
            puVar9 = *(undefined4 **)(*(longlong *)(lVar8 + 0x68) + lVar12);
          }
          uVar5 = uVar5 + 1;
          lVar12 = lVar12 + 8;
        } while (puVar9 == (undefined4 *)0x0);
      }
      goto LAB_140143eaa;
    }
  }
  return;
}



void FUN_140144e20(longlong param_1)

{
  if (*(void **)(param_1 + 0x98) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x98));
  }
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  if (*(void **)(param_1 + 0x78) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x78));
  }
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x88) = 0;
  if (*(void **)(param_1 + 0x58) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  if (*(void **)(param_1 + 0x38) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_140144ee0(longlong param_1)

{
  FUN_140144e20(param_1 + 8);
  return;
}



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

void FUN_140144ef0(longlong *param_1,int *param_2,int param_3,int param_4,int param_5,int param_6,
                  int param_7)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  
  if (param_1[1] != 0) {
    uVar3 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar6 = ((longlong *)*param_1)[uVar3];
          goto LAB_140144f80;
        }
        uVar1 = (int)uVar3 + 1;
        uVar3 = (ulonglong)uVar1;
        plVar5 = plVar5 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar6 = 0;
LAB_140144f80:
  do {
    do {
      lVar4 = lVar6;
      if (lVar4 == 0) {
        return;
      }
      if (((*(int *)(lVar4 + 0x10) <= param_4) && (param_4 <= *(int *)(lVar4 + 0x14))) &&
         (*(int *)(lVar4 + 0xc) == param_3)) {
        lVar6 = 0;
        for (uVar3 = 0;
            uVar3 < (ulonglong)(*(longlong *)(lVar4 + 0x48) - *(longlong *)(lVar4 + 0x40) >> 2);
            uVar3 = (ulonglong)((int)uVar3 + 1)) {
          iVar2 = *(int *)(lVar6 + *(longlong *)(lVar4 + 0x40));
          if ((iVar2 == param_5) || (iVar2 == 0)) {
            uVar3 = 0;
            lVar6 = 0;
            goto LAB_140144ff0;
          }
          lVar6 = lVar6 + 4;
        }
      }
LAB_1401450b6:
      lVar6 = *(longlong *)(lVar4 + 0xc0);
    } while (lVar6 != 0);
    uVar1 = *(uint *)(lVar4 + 200) % *(uint *)(param_1 + 2) + 1;
    lVar4 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar1) break;
      if (*(longlong *)(*param_1 + lVar4) != 0) {
        lVar6 = *(longlong *)(*param_1 + lVar4);
      }
      uVar1 = uVar1 + 1;
      lVar4 = lVar4 + 8;
    } while (lVar6 == 0);
  } while( true );
LAB_140144ff0:
  if ((ulonglong)(*(longlong *)(lVar4 + 0x68) - *(longlong *)(lVar4 + 0x60) >> 2) <= uVar3)
  goto LAB_1401450b6;
  iVar2 = *(int *)(lVar6 + *(longlong *)(lVar4 + 0x60));
  if ((iVar2 == param_6) || (iVar2 == 0)) {
    uVar3 = 0;
    lVar6 = 0;
    goto LAB_140145025;
  }
  uVar3 = (ulonglong)((int)uVar3 + 1);
  lVar6 = lVar6 + 4;
  goto LAB_140144ff0;
LAB_140145025:
  if (uVar3 < (ulonglong)(*(longlong *)(lVar4 + 0x88) - *(longlong *)(lVar4 + 0x80) >> 2)) {
    iVar2 = *(int *)(lVar6 + *(longlong *)(lVar4 + 0x80));
    if ((iVar2 != param_7) && (iVar2 != 0)) goto code_r0x000140145051;
    iVar2 = rand();
    lVar6 = 0;
    for (uVar3 = 0;
        uVar3 < (ulonglong)(*(longlong *)(lVar4 + 0xa8) - *(longlong *)(lVar4 + 0xa0) >> 2);
        uVar3 = (ulonglong)((int)uVar3 + 1)) {
      if (iVar2 % 10000 + 1 < *(int *)(lVar6 + *(longlong *)(lVar4 + 0xa0))) {
        *param_2 = (int)uVar3;
        return;
      }
      lVar6 = lVar6 + 4;
    }
  }
  goto LAB_1401450b6;
code_r0x000140145051:
  uVar3 = (ulonglong)((int)uVar3 + 1);
  lVar6 = lVar6 + 4;
  goto LAB_140145025;
}



undefined8 * FUN_140145140(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetPrefixChangeConditionDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce6c & 1) == 0) {
    DAT_14060ce6c = DAT_14060ce6c | 1;
    FUN_14014aff0(0x3f400000,0x3e800000,0x40100000);
    FUN_140143e10();
    atexit((_func_5014 *)&LAB_1404488c0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetPrefixChangeConditionDB",uVar3,
                  pcVar4,DVar5);
  }
  return &DAT_140608870;
}



void thunk_FUN_14014b360(void)

{
  FUN_14014b360();
  return;
}



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

void FUN_140145200(void)

{
  short sVar1;
  undefined4 uVar2;
  code *pcVar3;
  wchar_t *pwVar4;
  uint uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong lVar8;
  undefined4 *puVar9;
  short *psVar10;
  longlong lVar11;
  undefined8 *puVar12;
  int *piVar13;
  longlong *plVar14;
  ulonglong uVar15;
  wchar_t *pwVar16;
  undefined4 *puVar17;
  undefined4 *puVar18;
  undefined4 *puVar19;
  longlong lVar20;
  short *psVar21;
  undefined4 *puVar22;
  undefined4 *puVar23;
  wchar_t *pwVar24;
  longlong lVar25;
  undefined1 auStack_258 [32];
  undefined1 local_238;
  int local_228 [2];
  longlong local_220;
  undefined4 local_218 [2];
  undefined4 *local_210;
  undefined8 local_208;
  wchar_t *local_200;
  wchar_t *local_1f8;
  undefined8 local_1f0;
  ulonglong local_1e8;
  undefined8 local_1d8;
  undefined8 local_1d0;
  undefined8 local_1c8;
  undefined4 local_1c0;
  undefined2 local_1b8;
  undefined6 uStack_1b6;
  undefined8 local_1a8;
  ulonglong local_1a0;
  int *local_190;
  int *local_188;
  int *local_180;
  int *local_170;
  int *local_168;
  int *local_160;
  int *local_150;
  int *local_148;
  int *local_140;
  longlong *local_130;
  longlong *local_128;
  longlong *local_120;
  undefined1 local_108 [8];
  undefined1 local_100 [200];
  ulonglong local_38;
  
  local_208 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"condition_select_item");
  if (lVar8 != 0) {
    puVar19 = (undefined4 *)0x0;
    puVar9 = puVar19;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar17 = puVar19;
      plVar14 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar14 != 0) {
          puVar9 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar17];
          break;
        }
        uVar5 = (int)puVar17 + 1;
        puVar17 = (undefined4 *)(ulonglong)uVar5;
        plVar14 = plVar14 + 1;
      } while (uVar5 < *(uint *)(lVar8 + 0x78));
    }
LAB_140145292:
    if (puVar9 != (undefined4 *)0x0) {
      uVar2 = *puVar9;
      local_1d8 = 0;
      local_1d0 = 0;
      local_1c8 = 0;
      local_1c0 = 0;
      local_1a0 = 7;
      local_1a8 = 0;
      local_1b8 = 0;
      local_190 = (int *)0x0;
      local_188 = (int *)0x0;
      local_180 = (int *)0x0;
      local_170 = (int *)0x0;
      local_168 = (int *)0x0;
      local_160 = (int *)0x0;
      local_150 = (int *)0x0;
      local_148 = (int *)0x0;
      local_140 = (int *)0x0;
      local_130 = (longlong *)0x0;
      local_128 = (longlong *)0x0;
      local_120 = (longlong *)0x0;
      local_218[0] = uVar2;
      local_210 = puVar9;
      uVar6 = FUN_1402970c0(lVar8,&DAT_14049f290);
      local_238 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,&DAT_14049f290);
      local_1d8 = CONCAT44(local_1d8._4_4_,*puVar9);
      uVar6 = FUN_1402970c0(lVar8,L"nGroup");
      local_238 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nGroup");
      local_1d8 = CONCAT44(*puVar9,(undefined4)local_1d8);
      uVar6 = FUN_1402970c0(lVar8,L"nLevelMax");
      local_238 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nLevelMax");
      local_1d0._4_4_ = *puVar9;
      uVar6 = FUN_1402970c0(lVar8,L"nLevelMin");
      local_238 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nLevelMin");
      local_1d0 = CONCAT44(local_1d0._4_4_,*puVar9);
      uVar6 = FUN_1402970c0(lVar8,L"nSelectItemType");
      local_238 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nSelectItemType");
      local_1c8 = CONCAT44(local_1c8._4_4_,*puVar9);
      uVar6 = FUN_1402970c0(lVar8,L"nTakeItemType");
      local_238 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nTakeItemType");
      local_1c8 = CONCAT44(*puVar9,(undefined4)local_1c8);
      uVar6 = FUN_1402970c0(lVar8,L"nRandomGroup");
      local_238 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nRandomGroup");
      local_1c0 = *puVar9;
      uVar6 = FUN_1402970c0(lVar8,L"szName");
      local_238 = 1;
      psVar10 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szName");
      uVar15 = 0xffffffffffffffff;
      psVar21 = psVar10;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar1 = *psVar21;
        psVar21 = psVar21 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_1b8,psVar10,~uVar15 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"szClass");
      local_238 = 0;
      lVar11 = FUN_140296990(lVar8,uVar2,uVar6,L"szClass");
      uVar6 = FUN_1402970c0(lVar8,L"szJob");
      local_238 = 0;
      local_220 = FUN_140296990(lVar8,uVar2,uVar6,L"szJob");
      if (lVar11 != 0) {
        local_200 = (wchar_t *)0x0;
        local_1f8 = (wchar_t *)0x0;
        local_1f0 = 0;
        FUN_140415930(&local_200,lVar11,&DAT_14049c7b8);
        lVar11 = (longlong)local_1f8 - (longlong)local_200 >> 0x3f;
        lVar25 = ((longlong)local_1f8 - (longlong)local_200) / 0x28 + lVar11;
        pwVar24 = local_200;
        puVar9 = puVar19;
        if (lVar25 != lVar11) {
          do {
            pwVar16 = pwVar24;
            if (7 < *(ulonglong *)(pwVar24 + 0xc)) {
              pwVar16 = *(wchar_t **)pwVar24;
            }
            iVar7 = _wtoi(pwVar16);
            local_228[0] = iVar7;
            if ((local_228 < local_188) && (local_190 <= local_228)) {
              lVar20 = (longlong)local_228 - (longlong)local_190;
              if (local_188 == local_180) {
                uVar15 = (longlong)local_188 - (longlong)local_190 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  (*pcVar3)();
                  return;
                }
                puVar22 = (undefined4 *)(uVar15 + 1);
                puVar17 = (undefined4 *)((longlong)local_180 - (longlong)local_190 >> 2);
                if (puVar17 < puVar22) {
                  puVar23 = puVar19;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar23 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar23 < puVar22) {
                    puVar23 = puVar22;
                  }
                  FUN_140051e60(&local_190,puVar23);
                }
              }
              if (local_188 != (int *)0x0) {
                *local_188 = local_190[lVar20 >> 2];
              }
            }
            else {
              if (local_188 == local_180) {
                uVar15 = (longlong)local_188 - (longlong)local_190 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_140145d27;
                }
                puVar22 = (undefined4 *)(uVar15 + 1);
                puVar17 = (undefined4 *)((longlong)local_180 - (longlong)local_190 >> 2);
                if (puVar17 < puVar22) {
                  puVar23 = puVar19;
                  if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                    puVar23 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
                  }
                  if (puVar23 < puVar22) {
                    puVar23 = puVar22;
                  }
                  FUN_140051e60(&local_190,puVar23);
                }
              }
              if (local_188 != (int *)0x0) {
                *local_188 = iVar7;
              }
            }
            local_188 = local_188 + 1;
            puVar9 = (undefined4 *)(ulonglong)((int)puVar9 + 1);
            pwVar24 = pwVar24 + 0x14;
          } while (puVar9 < (undefined4 *)(lVar25 - lVar11));
        }
        pwVar4 = local_1f8;
        pwVar16 = local_200;
        pwVar24 = local_200;
        if (local_200 != (wchar_t *)0x0) {
          for (; pwVar24 != pwVar4; pwVar24 = pwVar24 + 0x14) {
            if (7 < *(ulonglong *)(pwVar24 + 0xc)) {
              operator_delete(*(void **)pwVar24);
            }
            pwVar24[0xc] = L'\a';
            pwVar24[0xd] = L'\0';
            pwVar24[0xe] = L'\0';
            pwVar24[0xf] = L'\0';
            pwVar24[8] = L'\0';
            pwVar24[9] = L'\0';
            pwVar24[10] = L'\0';
            pwVar24[0xb] = L'\0';
            *pwVar24 = L'\0';
          }
          operator_delete(pwVar16);
        }
      }
      puVar9 = puVar19;
      uVar2 = local_218[0];
      if (local_220 != 0) {
        local_200 = (wchar_t *)0x0;
        local_1f8 = (wchar_t *)0x0;
        local_1f0 = 0;
        FUN_140415930(&local_200,local_220,&DAT_14049c7b8);
        lVar11 = (longlong)local_1f8 - (longlong)local_200 >> 0x3f;
        lVar25 = ((longlong)local_1f8 - (longlong)local_200) / 0x28 + lVar11;
        pwVar24 = local_200;
        puVar17 = puVar19;
        if (lVar25 != lVar11) {
          do {
            pwVar16 = pwVar24;
            if (7 < *(ulonglong *)(pwVar24 + 0xc)) {
              pwVar16 = *(wchar_t **)pwVar24;
            }
            iVar7 = _wtoi(pwVar16);
            local_228[0] = iVar7;
            if ((local_228 < local_168) && (local_170 <= local_228)) {
              lVar20 = (longlong)local_228 - (longlong)local_170;
              if (local_168 == local_160) {
                uVar15 = (longlong)local_168 - (longlong)local_170 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
LAB_140145d27:
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  (*pcVar3)();
                  return;
                }
                puVar23 = (undefined4 *)(uVar15 + 1);
                puVar22 = (undefined4 *)((longlong)local_160 - (longlong)local_170 >> 2);
                if (puVar22 < puVar23) {
                  puVar18 = puVar19;
                  if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                    puVar18 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                  }
                  if (puVar18 < puVar23) {
                    puVar18 = puVar23;
                  }
                  FUN_140051e60(&local_170,puVar18);
                }
              }
              if (local_168 != (int *)0x0) {
                *local_168 = local_170[lVar20 >> 2];
              }
            }
            else {
              if (local_168 == local_160) {
                uVar15 = (longlong)local_168 - (longlong)local_170 >> 2;
                if (0x3ffffffffffffffe < uVar15) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_140145d43;
                }
                puVar23 = (undefined4 *)(uVar15 + 1);
                puVar22 = (undefined4 *)((longlong)local_160 - (longlong)local_170 >> 2);
                if (puVar22 < puVar23) {
                  puVar18 = puVar19;
                  if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                    puVar18 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                  }
                  if (puVar18 < puVar23) {
                    puVar18 = puVar23;
                  }
                  FUN_140051e60(&local_170,puVar18);
                }
              }
              if (local_168 != (int *)0x0) {
                *local_168 = iVar7;
              }
            }
            local_168 = local_168 + 1;
            puVar17 = (undefined4 *)(ulonglong)((int)puVar17 + 1);
            pwVar24 = pwVar24 + 0x14;
          } while (puVar17 < (undefined4 *)(lVar25 - lVar11));
        }
        pwVar4 = local_1f8;
        pwVar16 = local_200;
        pwVar24 = local_200;
        uVar2 = local_218[0];
        if (local_200 != (wchar_t *)0x0) {
          for (; pwVar24 != pwVar4; pwVar24 = pwVar24 + 0x14) {
            if (7 < *(ulonglong *)(pwVar24 + 0xc)) {
              operator_delete(*(void **)pwVar24);
            }
            pwVar24[0xc] = L'\a';
            pwVar24[0xd] = L'\0';
            pwVar24[0xe] = L'\0';
            pwVar24[0xf] = L'\0';
            pwVar24[8] = L'\0';
            pwVar24[9] = L'\0';
            pwVar24[10] = L'\0';
            pwVar24[0xb] = L'\0';
            *pwVar24 = L'\0';
          }
          operator_delete(pwVar16);
          uVar2 = local_218[0];
        }
      }
      do {
        puVar12 = (undefined8 *)FUN_1404154c0(&local_200,L"nItemID%02d",puVar9);
        if (7 < (ulonglong)puVar12[3]) {
          puVar12 = (undefined8 *)*puVar12;
        }
        uVar6 = FUN_1402970c0(lVar8,puVar12);
        local_238 = 1;
        piVar13 = (int *)FUN_140296600(lVar8,uVar2,uVar6,puVar12);
        iVar7 = *piVar13;
        local_228[0] = iVar7;
        if (7 < local_1e8) {
          operator_delete(local_200);
        }
        if (iVar7 == 0) break;
        puVar12 = (undefined8 *)FUN_1404154c0(&local_200,L"nItemCount%02d",puVar9);
        if (7 < (ulonglong)puVar12[3]) {
          puVar12 = (undefined8 *)*puVar12;
        }
        uVar6 = FUN_1402970c0(lVar8,puVar12);
        local_238 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,puVar12);
        uVar6 = *puVar17;
        local_220 = CONCAT44(local_220._4_4_,uVar6);
        if (7 < local_1e8) {
          operator_delete(local_200);
        }
        if ((local_228 < local_148) && (local_150 <= local_228)) {
          lVar11 = (longlong)local_228 - (longlong)local_150;
          if (local_148 == local_140) {
            uVar15 = (longlong)local_148 - (longlong)local_150 >> 2;
            if (0x3ffffffffffffffe < uVar15) {
LAB_140145d43:
              std::_Xlength_error("vector<T> too long");
              pcVar3 = (code *)swi(3);
              (*pcVar3)();
              return;
            }
            puVar22 = (undefined4 *)(uVar15 + 1);
            puVar17 = (undefined4 *)((longlong)local_140 - (longlong)local_150 >> 2);
            if (puVar17 < puVar22) {
              puVar23 = puVar19;
              if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                puVar23 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
              }
              if (puVar23 < puVar22) {
                puVar23 = puVar22;
              }
              FUN_140051e60(&local_150,puVar23);
            }
          }
          if (local_148 != (int *)0x0) {
            *local_148 = local_150[lVar11 >> 2];
          }
        }
        else {
          if (local_148 == local_140) {
            uVar15 = (longlong)local_148 - (longlong)local_150 >> 2;
            if (0x3ffffffffffffffe < uVar15) {
              std::_Xlength_error("vector<T> too long");
              pcVar3 = (code *)swi(3);
              (*pcVar3)();
              return;
            }
            puVar22 = (undefined4 *)(uVar15 + 1);
            puVar17 = (undefined4 *)((longlong)local_140 - (longlong)local_150 >> 2);
            if (puVar17 < puVar22) {
              puVar23 = puVar19;
              if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                puVar23 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
              }
              if (puVar23 < puVar22) {
                puVar23 = puVar22;
              }
              FUN_140051e60(&local_150,puVar23);
            }
          }
          if (local_148 != (int *)0x0) {
            *local_148 = iVar7;
          }
        }
        local_148 = local_148 + 1;
        if ((&local_220 < local_128) && (local_130 <= &local_220)) {
          lVar11 = -8 - (longlong)local_130;
          if (local_128 == local_120) {
            uVar15 = (longlong)local_128 - (longlong)local_130 >> 2;
            if (0x3ffffffffffffffe < uVar15) {
              std::_Xlength_error("vector<T> too long");
              pcVar3 = (code *)swi(3);
              (*pcVar3)();
              return;
            }
            puVar22 = (undefined4 *)(uVar15 + 1);
            puVar17 = (undefined4 *)((longlong)local_120 - (longlong)local_130 >> 2);
            if (puVar17 < puVar22) {
              puVar23 = puVar19;
              if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                puVar23 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
              }
              if (puVar23 < puVar22) {
                puVar23 = puVar22;
              }
              FUN_140051e60(&local_130,puVar23);
            }
          }
          if (local_128 != (longlong *)0x0) {
            *(undefined4 *)local_128 =
                 *(undefined4 *)((longlong)local_130 + ((longlong)local_218 + lVar11 >> 2) * 4);
          }
        }
        else {
          if (local_128 == local_120) {
            uVar15 = (longlong)local_128 - (longlong)local_130 >> 2;
            if (0x3ffffffffffffffe < uVar15) {
              std::_Xlength_error("vector<T> too long");
              return;
            }
            puVar22 = (undefined4 *)(uVar15 + 1);
            puVar17 = (undefined4 *)((longlong)local_120 - (longlong)local_130 >> 2);
            if (puVar17 < puVar22) {
              puVar23 = puVar19;
              if (puVar17 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar17 >> 1))) {
                puVar23 = (undefined4 *)((longlong)puVar17 + ((ulonglong)puVar17 >> 1));
              }
              if (puVar23 < puVar22) {
                puVar23 = puVar22;
              }
              FUN_140051e60(&local_130,puVar23);
            }
          }
          if (local_128 != (longlong *)0x0) {
            *(undefined4 *)local_128 = uVar6;
          }
        }
        local_128 = (longlong *)((longlong)local_128 + 4);
        uVar5 = (int)puVar9 + 1;
        puVar9 = (undefined4 *)(ulonglong)uVar5;
      } while ((int)uVar5 < 6);
      puVar9 = (undefined4 *)FUN_14014b380(local_108,local_218,&local_1d8);
      FUN_14014b2a0(*puVar9);
      FUN_140145db0(local_100);
      if (local_130 != (longlong *)0x0) {
        operator_delete(local_130);
      }
      local_130 = (longlong *)0x0;
      local_128 = (longlong *)0x0;
      local_120 = (longlong *)0x0;
      if (local_150 != (int *)0x0) {
        operator_delete(local_150);
      }
      local_150 = (int *)0x0;
      local_148 = (int *)0x0;
      local_140 = (int *)0x0;
      if (local_170 != (int *)0x0) {
        operator_delete(local_170);
      }
      local_170 = (int *)0x0;
      local_168 = (int *)0x0;
      local_160 = (int *)0x0;
      if (local_190 != (int *)0x0) {
        operator_delete(local_190);
      }
      local_190 = (int *)0x0;
      local_188 = (int *)0x0;
      local_180 = (int *)0x0;
      if (7 < local_1a0) {
        operator_delete((void *)CONCAT62(uStack_1b6,local_1b8));
      }
      puVar9 = *(undefined4 **)(local_210 + 6);
      if (puVar9 == (undefined4 *)0x0) {
        uVar5 = (uint)local_210[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar5 << 3;
        puVar9 = puVar19;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar5) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar11) != 0) {
            puVar9 = *(undefined4 **)(*(longlong *)(lVar8 + 0x68) + lVar11);
          }
          uVar5 = uVar5 + 1;
          lVar11 = lVar11 + 8;
        } while (puVar9 == (undefined4 *)0x0);
      }
      goto LAB_140145292;
    }
  }
  return;
}



void FUN_140145db0(longlong param_1)

{
  if (*(void **)(param_1 + 0xa8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xa8));
  }
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  if (*(void **)(param_1 + 0x88) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x88));
  }
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  if (*(void **)(param_1 + 0x68) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x68));
  }
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  if (*(void **)(param_1 + 0x48) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x48));
  }
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x38)) {
    operator_delete(*(void **)(param_1 + 0x20));
  }
  *(undefined8 *)(param_1 + 0x38) = 7;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined2 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_140145e70(longlong param_1)

{
  FUN_140145db0(param_1 + 8);
  return;
}



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

{
  uint uVar1;
  uint *puVar2;
  uint *puVar3;
  uint uVar4;
  longlong lVar5;
  uint *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  uint local_res10 [2];
  
  if (*param_1 != 0) {
    for (puVar6 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0x34)) {
      if ((puVar6[0x36] == param_2) && (*puVar6 == param_2)) goto LAB_140145ecc;
    }
  }
  puVar6 = (uint *)0x0;
LAB_140145ecc:
  if (puVar6 != (uint *)0x0) {
    FUN_14012baa0(param_4);
    FUN_14012baa0(param_3);
    uVar7 = 0;
    if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    lVar8 = 0;
    while (uVar7 < (ulonglong)(*(longlong *)(puVar6 + 0x26) - *(longlong *)(puVar6 + 0x24) >> 2)) {
      FUN_14012e5c0(param_3);
      uVar1 = *(uint *)(lVar8 + *(longlong *)(puVar6 + 0x2c));
      uVar4 = *(uint *)(lVar8 + *(longlong *)(puVar6 + 0x24));
      lVar5 = FUN_140137690();
      if (*(longlong *)(lVar5 + 0x88) != 0) {
        for (puVar2 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                                ((ulonglong)uVar4 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
            puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xa6)) {
          if ((puVar2[0xa8] == uVar4) && (*puVar2 == uVar4)) {
            if (puVar2 != (uint *)0x0) {
              uVar4 = puVar2[0x4c];
              goto LAB_140145fb4;
            }
            break;
          }
        }
      }
      uVar4 = 1;
LAB_140145fb4:
      if ((int)uVar4 < (int)uVar1) {
        uVar1 = uVar4;
      }
      puVar2 = (uint *)param_4[1];
      local_res10[0] = uVar1;
      if ((local_res10 < puVar2) && (puVar3 = (uint *)*param_4, puVar3 <= local_res10)) {
        if (puVar2 == (uint *)param_4[2]) {
          FUN_1400556a0(param_4,1);
        }
        if ((undefined4 *)param_4[1] == (undefined4 *)0x0) goto LAB_140146037;
        uVar7 = (ulonglong)((int)uVar7 + 1);
        *(undefined4 *)param_4[1] =
             *(undefined4 *)(*param_4 + ((longlong)local_res10 - (longlong)puVar3 >> 2) * 4);
        param_4[1] = param_4[1] + 4;
        lVar8 = lVar8 + 4;
      }
      else {
        if (puVar2 == (uint *)param_4[2]) {
          FUN_1400556a0(param_4,1);
        }
        if ((uint *)param_4[1] != (uint *)0x0) {
          *(uint *)param_4[1] = uVar1;
        }
LAB_140146037:
        param_4[1] = param_4[1] + 4;
        uVar7 = (ulonglong)((int)uVar7 + 1);
        lVar8 = lVar8 + 4;
      }
    }
  }
  return;
}



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

undefined8 FUN_140146070(longlong *param_1,int param_2)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if (param_1[1] != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar4 = (longlong *)*param_1;
      do {
        if (*plVar4 != 0) {
          lVar5 = ((longlong *)*param_1)[uVar2];
          goto LAB_1401460c2;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar4 = plVar4 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar5 = 0;
LAB_1401460c2:
  do {
    do {
      lVar3 = lVar5;
      if (lVar3 == 0) {
        return 0;
      }
      if (*(int *)(lVar3 + 0xc) == param_2) {
        return CONCAT71((int7)((ulonglong)lVar3 >> 8),1);
      }
      lVar5 = *(longlong *)(lVar3 + 0xd0);
    } while (lVar5 != 0);
    uVar1 = *(uint *)(lVar3 + 0xd8) % *(uint *)(param_1 + 2) + 1;
    lVar3 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar1) break;
      if (*(longlong *)(lVar3 + *param_1) != 0) {
        lVar5 = *(longlong *)(lVar3 + *param_1);
      }
      uVar1 = uVar1 + 1;
      lVar3 = lVar3 + 8;
    } while (lVar5 == 0);
  } while( true );
}



ulonglong FUN_140146140(longlong *param_1,int param_2,int param_3,int param_4,int param_5,
                       undefined4 *param_6)

{
  uint uVar1;
  code *pcVar2;
  uint uVar3;
  longlong lVar4;
  longlong *plVar5;
  ulonglong uVar6;
  uint *puVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  uint *puVar10;
  uint *puVar11;
  uint *puVar12;
  longlong lVar13;
  uint *puVar14;
  uint *puVar15;
  uint *puVar16;
  uint local_98;
  uint *local_80;
  uint *local_78;
  uint *local_70;
  uint *local_60;
  uint *local_58;
  uint *local_50;
  
  if (param_1[1] != 0) {
    uVar6 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar13 = ((longlong *)*param_1)[uVar6];
          goto LAB_1401461aa;
        }
        uVar3 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar3;
        plVar5 = plVar5 + 1;
      } while (uVar3 < *(uint *)(param_1 + 2));
    }
  }
  lVar13 = 0;
LAB_1401461aa:
  local_60 = (uint *)0x0;
  puVar10 = (uint *)0x0;
  local_58 = (uint *)0x0;
  puVar16 = (uint *)0x0;
  local_50 = (uint *)0x0;
  local_80 = (uint *)0x0;
  local_78 = (uint *)0x0;
  local_70 = (uint *)0x0;
LAB_1401461cf:
  lVar4 = lVar13;
  if (lVar4 != 0) {
    if (*(int *)(lVar4 + 0xc) == param_2) {
      puVar11 = (uint *)(lVar4 + 8);
      if ((puVar11 < puVar10) && (local_60 <= puVar11)) {
        lVar13 = (longlong)puVar11 - (longlong)local_60;
        if (puVar10 == puVar16) {
          uVar6 = (longlong)puVar10 - (longlong)local_60 >> 2;
          if (0x3ffffffffffffffe < uVar6) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            uVar6 = (*pcVar2)();
            return uVar6;
          }
          if ((ulonglong)((longlong)puVar16 - (longlong)local_60 >> 2) < uVar6 + 1) {
            FUN_140051e60(&local_60);
            puVar10 = local_58;
            puVar16 = local_50;
          }
        }
        if (puVar10 != (uint *)0x0) {
          uVar3 = local_60[lVar13 >> 2];
LAB_1401462d4:
          *puVar10 = uVar3;
        }
      }
      else {
        if (puVar10 == puVar16) {
          uVar6 = (longlong)puVar10 - (longlong)local_60 >> 2;
          if (0x3ffffffffffffffe < uVar6) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            uVar6 = (*pcVar2)();
            return uVar6;
          }
          if ((ulonglong)((longlong)puVar16 - (longlong)local_60 >> 2) < uVar6 + 1) {
            FUN_140051e60(&local_60);
            puVar10 = local_58;
            puVar16 = local_50;
          }
        }
        if (puVar10 != (uint *)0x0) {
          uVar3 = *puVar11;
          goto LAB_1401462d4;
        }
      }
      puVar10 = puVar10 + 1;
      local_58 = puVar10;
    }
    lVar13 = *(longlong *)(lVar4 + 0xd0);
    if (lVar13 == 0) {
      uVar3 = *(uint *)(lVar4 + 0xd8) % *(uint *)(param_1 + 2) + 1;
      lVar4 = (longlong)(int)uVar3 << 3;
      do {
        if (*(uint *)(param_1 + 2) <= uVar3) break;
        if (*(longlong *)(lVar4 + *param_1) != 0) {
          lVar13 = *(longlong *)(lVar4 + *param_1);
        }
        uVar3 = uVar3 + 1;
        lVar4 = lVar4 + 8;
      } while (lVar13 == 0);
    }
    goto LAB_1401461cf;
  }
  uVar3 = 0;
  uVar6 = (longlong)puVar10 - (longlong)local_60 >> 2;
  puVar11 = local_60;
  puVar14 = local_80;
  puVar12 = local_78;
  puVar15 = local_70;
  if (uVar6 != 0) {
    do {
      uVar1 = *puVar11;
      if (*param_1 != 0) {
        for (puVar7 = *(uint **)(*param_1 +
                                ((ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
            puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0x34)) {
          if ((puVar7[0x36] == uVar1) && (*puVar7 == uVar1)) {
            if (puVar7 == (uint *)0x0) break;
            if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (param_3 < (int)puVar7[4]) {
              if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              if ((int)puVar7[5] < param_3) break;
            }
            if ((puVar11 < puVar12) && (puVar14 <= puVar11)) {
              lVar13 = (longlong)puVar11 - (longlong)puVar14;
              if (puVar12 == puVar15) {
                uVar8 = (longlong)puVar12 - (longlong)puVar14 >> 2;
                if (0x3ffffffffffffffe < uVar8) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar2 = (code *)swi(3);
                  uVar6 = (*pcVar2)();
                  return uVar6;
                }
                if ((ulonglong)((longlong)puVar15 - (longlong)puVar14 >> 2) < uVar8 + 1) {
                  FUN_140051e60(&local_80);
                  puVar14 = local_80;
                  puVar12 = local_78;
                  puVar15 = local_70;
                }
              }
              if (puVar12 != (uint *)0x0) {
                *puVar12 = puVar14[lVar13 >> 2];
              }
            }
            else {
              if (puVar12 == puVar15) {
                uVar8 = (longlong)puVar12 - (longlong)puVar14 >> 2;
                if (0x3ffffffffffffffe < uVar8) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar2 = (code *)swi(3);
                  uVar6 = (*pcVar2)();
                  return uVar6;
                }
                if ((ulonglong)((longlong)puVar15 - (longlong)puVar14 >> 2) < uVar8 + 1) {
                  FUN_140051e60(&local_80);
                  puVar14 = local_80;
                  puVar12 = local_78;
                  puVar15 = local_70;
                }
              }
              if (puVar12 != (uint *)0x0) {
                *puVar12 = *puVar11;
              }
            }
            puVar12 = puVar12 + 1;
            local_78 = puVar12;
            break;
          }
        }
      }
      uVar3 = uVar3 + 1;
      puVar11 = puVar11 + 1;
    } while (uVar3 < uVar6);
    if (puVar14 != puVar12) {
      if (local_60 != puVar10) {
        memmove(local_60,puVar10,0);
        local_58 = local_60;
        puVar10 = local_60;
        puVar14 = local_80;
      }
      local_98 = 0;
      uVar6 = (longlong)local_78 - (longlong)puVar14 >> 2;
      puVar12 = puVar14;
      puVar11 = local_60;
      if (uVar6 != 0) {
        do {
          uVar3 = *puVar14;
          if (*param_1 != 0) {
            for (puVar12 = *(uint **)(*param_1 +
                                     ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
                puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x34)) {
              if ((puVar12[0x36] == uVar3) && (*puVar12 == uVar3)) {
                if (puVar12 != (uint *)0x0) {
                  uVar8 = 0;
                  lVar13 = 0;
                  goto LAB_1401465f3;
                }
                break;
              }
            }
          }
LAB_140146758:
          local_98 = local_98 + 1;
          puVar14 = puVar14 + 1;
          puVar12 = local_80;
        } while (local_98 < uVar6);
      }
      if (puVar11 == puVar10) {
        *param_6 = 0x14f;
        if (puVar12 != (uint *)0x0) {
          operator_delete(puVar12);
          puVar11 = local_60;
        }
      }
      else {
        memmove(puVar12,local_78,0);
        local_78 = local_80;
        local_98 = 0;
        uVar6 = (longlong)puVar10 - (longlong)local_60 >> 2;
        puVar10 = local_80;
        puVar16 = local_70;
        puVar11 = local_80;
        puVar14 = local_60;
        if (uVar6 != 0) {
          do {
            uVar3 = *puVar14;
            if (*param_1 != 0) {
              for (puVar12 = *(uint **)(*param_1 +
                                       ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
                  puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x34)) {
                if ((puVar12[0x36] == uVar3) && (*puVar12 == uVar3)) {
                  if (puVar12 != (uint *)0x0) {
                    uVar8 = 0;
                    lVar13 = 0;
                    goto LAB_140146862;
                  }
                  break;
                }
              }
            }
LAB_1401469c2:
            local_98 = local_98 + 1;
            puVar14 = puVar14 + 1;
          } while (local_98 < uVar6);
          if (puVar10 != puVar11) {
            uVar3 = *puVar10;
            operator_delete(puVar10);
            if (local_60 != (uint *)0x0) {
              operator_delete(local_60);
            }
            return (ulonglong)uVar3;
          }
        }
        puVar11 = local_60;
        *param_6 = 0x150;
        if (puVar10 != (uint *)0x0) {
          operator_delete(puVar10);
        }
      }
      goto joined_r0x0001401467c3;
    }
  }
  *param_6 = 0x14e;
  puVar11 = local_60;
  if (puVar14 != (uint *)0x0) {
    operator_delete(puVar14);
    puVar11 = local_60;
  }
joined_r0x0001401467c3:
  if (puVar11 != (uint *)0x0) {
    operator_delete(puVar11);
  }
  return 0xffffffff;
LAB_1401465f3:
  if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if ((ulonglong)(*(longlong *)(puVar12 + 0x16) - *(longlong *)(puVar12 + 0x14) >> 2) <= uVar8)
  goto LAB_140146758;
  if (param_4 == *(int *)(lVar13 + *(longlong *)(puVar12 + 0x14))) {
    if ((puVar14 < puVar10) && (puVar11 <= puVar14)) {
      puVar15 = puVar11;
      if (puVar10 == puVar16) {
        uVar9 = (longlong)puVar10 - (longlong)puVar11 >> 2;
        if (0x3ffffffffffffffe < uVar9) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          uVar6 = (*pcVar2)();
          return uVar6;
        }
        if ((ulonglong)((longlong)puVar16 - (longlong)puVar11 >> 2) < uVar9 + 1) {
          FUN_140051e60(&local_60);
          puVar10 = local_58;
          puVar15 = local_60;
          puVar16 = local_50;
        }
      }
      if (puVar10 != (uint *)0x0) {
        uVar3 = puVar15[(longlong)puVar14 - (longlong)puVar11 >> 2];
LAB_14014672f:
        *puVar10 = uVar3;
      }
    }
    else {
      if (puVar10 == puVar16) {
        uVar9 = (longlong)puVar10 - (longlong)puVar11 >> 2;
        if (0x3ffffffffffffffe < uVar9) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          uVar6 = (*pcVar2)();
          return uVar6;
        }
        if ((ulonglong)((longlong)puVar16 - (longlong)puVar11 >> 2) < uVar9 + 1) {
          FUN_140051e60(&local_60);
          puVar10 = local_58;
          puVar16 = local_50;
        }
      }
      if (puVar10 != (uint *)0x0) {
        uVar3 = *puVar14;
        goto LAB_14014672f;
      }
    }
    puVar10 = puVar10 + 1;
    local_58 = puVar10;
  }
  uVar8 = (ulonglong)((int)uVar8 + 1);
  lVar13 = lVar13 + 4;
  puVar11 = local_60;
  goto LAB_1401465f3;
LAB_140146862:
  if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if ((ulonglong)(*(longlong *)(puVar12 + 0x1e) - *(longlong *)(puVar12 + 0x1c) >> 2) <= uVar8)
  goto LAB_1401469c2;
  if (param_5 == *(int *)(lVar13 + *(longlong *)(puVar12 + 0x1c))) {
    if ((puVar14 < puVar11) && (puVar10 <= puVar14)) {
      lVar4 = (longlong)puVar14 - (longlong)puVar10;
      if (puVar11 == puVar16) {
        uVar9 = (longlong)puVar11 - (longlong)puVar10 >> 2;
        if (0x3ffffffffffffffe < uVar9) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          uVar6 = (*pcVar2)();
          return uVar6;
        }
        if ((ulonglong)((longlong)puVar16 - (longlong)puVar10 >> 2) < uVar9 + 1) {
          FUN_140051e60(&local_80);
          puVar10 = local_80;
          puVar16 = local_70;
          puVar11 = local_78;
        }
      }
      if (puVar11 != (uint *)0x0) {
        uVar3 = puVar10[lVar4 >> 2];
LAB_1401469a7:
        *puVar11 = uVar3;
      }
    }
    else {
      if (puVar11 == puVar16) {
        uVar9 = (longlong)puVar11 - (longlong)puVar10 >> 2;
        if (0x3ffffffffffffffe < uVar9) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          uVar6 = (*pcVar2)();
          return uVar6;
        }
        if ((ulonglong)((longlong)puVar16 - (longlong)puVar10 >> 2) < uVar9 + 1) {
          FUN_140051e60(&local_80);
          puVar10 = local_80;
          puVar16 = local_70;
          puVar11 = local_78;
        }
      }
      if (puVar11 != (uint *)0x0) {
        uVar3 = *puVar14;
        goto LAB_1401469a7;
      }
    }
    puVar11 = puVar11 + 1;
    local_78 = puVar11;
  }
  uVar8 = (ulonglong)((int)uVar8 + 1);
  lVar13 = lVar13 + 4;
  goto LAB_140146862;
}



undefined8 * FUN_140146aa0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetConditionSelectItemDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce68 & 1) == 0) {
    DAT_14060ce68 = DAT_14060ce68 | 1;
    FUN_14014b1d0(0x3f400000,0x3e800000,0x40100000);
    FUN_140145200();
    atexit((_func_5014 *)&LAB_1404488d0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetConditionSelectItemDB",uVar3,
                  pcVar4,DVar5);
  }
  return &DAT_140608820;
}



void thunk_FUN_14014b570(void)

{
  FUN_14014b570();
  return;
}



void FUN_140146b60(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  longlong lVar5;
  ulonglong uVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"Rune_Release");
  if (lVar5 != 0) {
    if (*(longlong *)(lVar5 + 0x70) != 0) {
      uVar6 = 0;
      if (*(uint *)(lVar5 + 0x78) != 0) {
        plVar10 = *(longlong **)(lVar5 + 0x68);
        do {
          if (*plVar10 != 0) {
            puVar8 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[uVar6];
            goto LAB_140146be2;
          }
          uVar2 = (int)uVar6 + 1;
          uVar6 = (ulonglong)uVar2;
          plVar10 = plVar10 + 1;
        } while (uVar2 < *(uint *)(lVar5 + 0x78));
      }
    }
    puVar8 = (undefined4 *)0x0;
LAB_140146be2:
    puVar7 = puVar8;
    if (puVar7 != (undefined4 *)0x0) {
      uVar1 = *puVar7;
      uVar3 = FUN_1402970c0(lVar5,&DAT_14049f290);
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar3,&DAT_14049f290,1);
      uVar3 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nGroup");
      FUN_140296600(lVar5,uVar1,uVar4,L"nGroup",1);
      uVar4 = FUN_1402970c0(lVar5,L"nRuneColor");
      FUN_140296600(lVar5,uVar1,uVar4,L"nRuneColor",1);
      uVar4 = FUN_1402970c0(lVar5,L"nRelease");
      FUN_140296600(lVar5,uVar1,uVar4,L"nRelease",1);
      uVar4 = FUN_1402970c0(lVar5,L"nChange");
      FUN_140296600(lVar5,uVar1,uVar4,L"nChange",1);
      uVar4 = FUN_1402970c0(lVar5,L"nRuneItemID");
      FUN_140296600(lVar5,uVar1,uVar4,L"nRuneItemID",1);
      uVar4 = FUN_1402970c0(lVar5,L"nChangeRuneGroup");
      FUN_140296600(lVar5,uVar1,uVar4,L"nChangeRuneGroup",1);
      FUN_14014b480(uVar3);
      puVar8 = *(undefined4 **)(puVar7 + 6);
      if (puVar8 == (undefined4 *)0x0) {
        uVar2 = (uint)puVar7[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar9 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar9 + *(longlong *)(lVar5 + 0x68)) != 0) {
            puVar8 = *(undefined4 **)(lVar9 + *(longlong *)(lVar5 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_140146be2;
    }
  }
  return;
}



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

longlong FUN_140146df0(longlong *param_1,int param_2,int param_3)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if (param_1[1] != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar4 = (longlong *)*param_1;
      do {
        if (*plVar4 != 0) {
          lVar5 = ((longlong *)*param_1)[uVar2];
          goto LAB_140146e55;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar4 = plVar4 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar5 = 0;
LAB_140146e55:
  do {
    do {
      lVar3 = lVar5;
      if (lVar3 == 0) {
        return 0;
      }
      if ((*(int *)(lVar3 + 8) == param_2) && (*(int *)(lVar3 + 0xc) == param_3)) {
        return lVar3 + 4;
      }
      lVar5 = *(longlong *)(lVar3 + 0x20);
    } while (lVar5 != 0);
    uVar1 = *(uint *)(lVar3 + 0x28) % *(uint *)(param_1 + 2) + 1;
    lVar3 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar1) break;
      if (*(longlong *)(*param_1 + lVar3) != 0) {
        lVar5 = *(longlong *)(*param_1 + lVar3);
      }
      uVar1 = uVar1 + 1;
      lVar3 = lVar3 + 8;
    } while (lVar5 == 0);
  } while( true );
}



undefined8 * FUN_140146ee0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetRuneReleaseDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce64 & 1) == 0) {
    DAT_14060ce64 = DAT_14060ce64 | 1;
    FUN_14014b3b0(0x3f400000,0x3e800000,0x40100000);
    FUN_140146b60();
    atexit((_func_5014 *)&LAB_1404488e0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetRuneReleaseDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_1406087d0;
}



void FUN_140146f90(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 local_10;
  
  FUN_14015b420(&local_10,param_2,0);
  *param_1 = param_2;
  plVar3 = (longlong *)param_1[1];
  param_1[1] = local_10;
  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_140147000(longlong *param_1)

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



void FUN_140147040(void)

{
  if (DAT_140609298 != (void *)0x0) {
    operator_delete(DAT_140609298);
  }
  DAT_140609298 = (void *)0x0;
  DAT_1406092a0 = 0;
  DAT_1406092a8 = 0;
  return;
}



void FUN_140147080(undefined4 *param_1)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined4 *puVar4;
  
  if ((param_1 < DAT_1406092a0) && (DAT_140609298 <= param_1)) {
    lVar3 = ((longlong)param_1 - (longlong)DAT_140609298) / 6 +
            ((longlong)param_1 - (longlong)DAT_140609298 >> 0x3f);
    lVar3 = (lVar3 >> 1) - (lVar3 >> 0x3f);
    if (DAT_1406092a0 == DAT_1406092a8) {
      FUN_1401472d0();
    }
    puVar4 = DAT_1406092a0;
    puVar1 = DAT_140609298;
    if (DAT_1406092a0 == (undefined4 *)0x0) goto LAB_14014712e;
    *DAT_1406092a0 = DAT_140609298[lVar3 * 3];
    puVar4[1] = puVar1[lVar3 * 3 + 1];
    uVar2 = puVar1[lVar3 * 3 + 2];
  }
  else {
    if (DAT_1406092a0 == DAT_1406092a8) {
      FUN_1401472d0();
    }
    puVar4 = DAT_1406092a0;
    if (DAT_1406092a0 == (undefined4 *)0x0) goto LAB_14014712e;
    *DAT_1406092a0 = *param_1;
    puVar4[1] = param_1[1];
    uVar2 = param_1[2];
  }
  puVar4[2] = uVar2;
LAB_14014712e:
  DAT_1406092a0 = DAT_1406092a0 + 3;
  return;
}



void FUN_140147140(longlong *param_1)

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



void FUN_140147180(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_140147390(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140150d00(param_1[1],((longlong)(param_2 - uVar2) / 0x70) * 0x70 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140147390(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140150d00(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x70;
  return;
}



void FUN_140147240(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_1401fbb20(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1401fbb20(param_1,uVar2);
  }
  return;
}



void FUN_1401472d0(void)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = (DAT_1406092a0 - DAT_140609298) / 6 + (DAT_1406092a0 - DAT_140609298 >> 0x3f);
  uVar4 = (lVar2 >> 1) - (lVar2 >> 0x3f);
  if (0x1555555555555554 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  uVar3 = (DAT_1406092a8 - DAT_140609298) / 0xc;
  if (uVar3 < uVar4) {
    if (0x1555555555555555 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
      if (uVar4 != 0) {
        uVar3 = uVar4;
      }
      FUN_140147450(uVar3);
      return;
    }
    uVar3 = uVar3 + (uVar3 >> 1);
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140147450(uVar3);
  }
  return;
}



void FUN_140147390(longlong *param_1)

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



void FUN_140147450(ulonglong param_1)

{
  code *pcVar1;
  char *pcVar2;
  longlong lVar3;
  char *local_res8;
  undefined8 uVar4;
  undefined **local_20 [3];
  
  uVar4 = 0xfffffffffffffffe;
  if (0x1555555555555555 < param_1) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  if ((ulonglong)(((longlong)DAT_1406092a8 - (longlong)DAT_140609298) / 0xc) < param_1) {
    local_res8 = (char *)0x0;
    if ((param_1 != 0) && (local_res8 = operator_new(param_1 * 0xc), local_res8 == (char *)0x0)) {
      local_res8 = (char *)0x0;
      std::exception::exception((exception *)local_20,&local_res8);
      local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_20,(ThrowInfo *)&DAT_1405d3608);
    }
    pcVar2 = local_res8;
    FUN_1402533a0(DAT_140609298,DAT_1406092a0,local_res8,DAT_140609298,uVar4);
    lVar3 = ((longlong)DAT_1406092a0 - (longlong)DAT_140609298) / 6 +
            ((longlong)DAT_1406092a0 - (longlong)DAT_140609298 >> 0x3f);
    if (DAT_140609298 != (void *)0x0) {
      operator_delete(DAT_140609298);
    }
    DAT_1406092a8 = pcVar2 + param_1 * 0xc;
    DAT_1406092a0 = pcVar2 + ((lVar3 >> 1) - (lVar3 >> 0x3f)) * 0xc;
    DAT_140609298 = pcVar2;
  }
  return;
}



void FUN_1401475b0(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 (0x249249249249249 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x70) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x70);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1401599c0(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140147700(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x70);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0x70) * 0x70);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_140147700(undefined8 *param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0xc;
    do {
      if ((void *)puVar2[-2] != (void *)0x0) {
        operator_delete((void *)puVar2[-2]);
      }
      puVar2[-2] = 0;
      puVar2[-1] = 0;
      *puVar2 = 0;
      if ((void *)puVar2[-6] != (void *)0x0) {
        operator_delete((void *)puVar2[-6]);
      }
      puVar2[-6] = 0;
      puVar2[-5] = 0;
      puVar2[-4] = 0;
      puVar1 = puVar2 + 2;
      puVar2 = puVar2 + 0xe;
    } while (puVar1 != param_2);
  }
  return;
}



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

undefined * FUN_140147780(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060a46c = param_3;
  lVar1 = 0;
  _DAT_14060a460 = 0x11;
  _DAT_14060a484 = 10;
  _DAT_14060a464 = param_1;
  _DAT_14060a468 = param_2;
  param_3 = param_3 * 17.0;
  _DAT_14060a450 = 0;
  _DAT_14060a458 = 0;
  _DAT_14060a480 = 0;
  _DAT_14060a488 = 0;
  _DAT_14060a490 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  _DAT_14060a470 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  _DAT_14060a478 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    _DAT_14060a478 = 0;
  }
  return &DAT_14060a450;
}



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

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  uVar1 = (param_2 & 0xffffffff) % uVar4;
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[4]) {
      if (((int)puVar3[5] == (int)param_2) && (*puVar3 == param_2)) {
        *(undefined4 *)(puVar3 + 1) = *param_3;
        *(undefined4 *)((longlong)puVar3 + 0xc) = param_3[1];
        *(undefined4 *)(puVar3 + 2) = param_3[2];
        *(undefined4 *)((longlong)puVar3 + 0x14) = param_3[3];
        *(undefined4 *)(puVar3 + 3) = param_3[4];
        *(undefined4 *)((longlong)puVar3 + 0x1c) = param_3[5];
        return puVar3;
      }
    }
  }
  puVar3 = (ulonglong *)FUN_140150d90(param_1,param_2,uVar1,param_2 & 0xffffffff);
  *(undefined4 *)(puVar3 + 1) = *param_3;
  *(undefined4 *)((longlong)puVar3 + 0xc) = param_3[1];
  *(undefined4 *)(puVar3 + 2) = param_3[2];
  *(undefined4 *)((longlong)puVar3 + 0x14) = param_3[3];
  *(undefined4 *)(puVar3 + 3) = param_3[4];
  *(undefined4 *)((longlong)puVar3 + 0x1c) = param_3[5];
  return puVar3;
}



void FUN_140147940(void)

{
  FUN_1402d98b0(&DAT_14060a450);
  return;
}



uint * FUN_140147960(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14014b600(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1401510b0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_14014b600(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_140147a30(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_14014cae0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140147b00(void)

{
  FUN_140147a30();
  return;
}



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

undefined8 * FUN_140147b20(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060926c = param_3;
  lVar1 = 0;
  DAT_140609260 = 0x11;
  DAT_140609284 = 10;
  _DAT_140609264 = param_1;
  _DAT_140609268 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140609250 = 0;
  DAT_140609258 = 0;
  DAT_140609280 = 0;
  DAT_140609288 = 0;
  DAT_140609290 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140609270 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140609278 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140609278 = 0;
  }
  return &DAT_140609250;
}



ulonglong *
FUN_140147bf0(ulonglong param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  
  uVar1 = (param_1 & 0xffffffff) % (ulonglong)DAT_140609260;
  if (DAT_140609250 == 0) {
    cVar2 = FUN_14014cc30((ulonglong)DAT_140609260,CONCAT71((int7)(uVar1 >> 8),1),0,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(DAT_140609250 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[3]) {
      if (((int)puVar3[4] == (int)param_1) && (*puVar3 == param_1)) {
        *(undefined4 *)(puVar3 + 1) = *param_2;
        *(undefined4 *)((longlong)puVar3 + 0xc) = param_2[1];
        *(undefined4 *)(puVar3 + 2) = param_2[2];
        *(undefined4 *)((longlong)puVar3 + 0x14) = param_2[3];
        return puVar3;
      }
    }
  }
  puVar3 = (ulonglong *)FUN_140151410(param_1,uVar1,param_1 & 0xffffffff);
  *(undefined4 *)(puVar3 + 1) = *param_2;
  *(undefined4 *)((longlong)puVar3 + 0xc) = param_2[1];
  *(undefined4 *)(puVar3 + 2) = param_2[2];
  *(undefined4 *)((longlong)puVar3 + 0x14) = param_2[3];
  return puVar3;
}



void FUN_140147cc0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140609280 = DAT_140609280 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140609250;
  if ((DAT_140609250 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140609260, DAT_140609260 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x18);
        FUN_14014ce10(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140609250;
        uVar4 = DAT_140609260;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140609250 = (void *)0x0;
  DAT_140609258 = 0;
  if (DAT_140609280 == 0) {
    uVar5 = FUN_14014cd80(0);
    FUN_14014cc30(uVar5,0);
  }
  DAT_140609290 = 0;
  _Memory = DAT_140609288;
  if (DAT_140609288 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140609288 = (longlong *)0x0;
    DAT_140609280 = DAT_140609280 + -1;
    return;
  }
  DAT_140609280 = DAT_140609280 + -1;
  return;
}



void FUN_140147dc0(void)

{
  FUN_140147cc0();
  return;
}



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

undefined8 * FUN_140147de0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060921c = param_3;
  lVar1 = 0;
  DAT_140609210 = 0x11;
  _DAT_140609234 = 10;
  _DAT_140609214 = param_1;
  _DAT_140609218 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140609200 = 0;
  DAT_140609208 = 0;
  DAT_140609230 = 0;
  DAT_140609238 = 0;
  DAT_140609240 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  _DAT_140609220 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140609228 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140609228 = 0;
  }
  return &DAT_140609200;
}



ulonglong * FUN_140147eb0(longlong *param_1,ulonglong param_2,void *param_3)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  uVar1 = (param_2 & 0xffffffff) % uVar4;
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[7]) {
      if (((int)puVar3[8] == (int)param_2) && (*puVar3 == param_2)) {
        memcpy(puVar3 + 1,param_3,0x30);
        return puVar3;
      }
    }
  }
  puVar3 = (ulonglong *)FUN_140151570(param_1,param_2,uVar1,param_2 & 0xffffffff);
  memcpy(puVar3 + 1,param_3,0x30);
  return puVar3;
}



void FUN_140147f80(void)

{
  FUN_14014cec0();
  return;
}



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

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xc)) {
      if ((puVar1[0xe] == param_2) && (*puVar1 == param_2)) {
        FUN_1400015e0(puVar1 + 2,param_3,0,0xffffffffffffffff);
        return puVar1;
      }
    }
  }
  puVar1 = (uint *)FUN_14014d1c0(param_1,param_2,
                                 (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2),param_2,
                                 0xfffffffffffffffe);
  FUN_1400015e0(puVar1 + 2,param_3,0,0xffffffffffffffff);
  return puVar1;
}



void FUN_140148040(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 + 0x30);
        FUN_14014d100(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140148110(void)

{
  FUN_140148040();
  return;
}



uint * FUN_140148130(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0xa6)) {
      if ((puVar2[0xa8] == param_2) && (*puVar2 == param_2)) {
        FUN_14014b780(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140151ba0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_14014b780(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_140148200(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 + 0x298);
        FUN_14014d230(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1401482d0(longlong *param_1,longlong param_2)

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



void FUN_140148360(void)

{
  FUN_140148200();
  return;
}



uint * FUN_140148380(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x20)) {
      if ((puVar2[0x22] == param_2) && (*puVar2 == param_2)) {
        FUN_14014bc20(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140151d10(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_14014bc20(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_140148450(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 + 0x80);
        FUN_14014d360(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140148520(void)

{
  FUN_140148450();
  return;
}



uint * FUN_140148540(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x42)) {
      if ((puVar2[0x44] == param_2) && (*puVar2 == param_2)) {
        FUN_14014bca0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140152050(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_14014bca0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_140148610(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 + 0x108);
        FUN_14014d490(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1401486e0(void)

{
  FUN_140148610();
  return;
}



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

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0xe)) {
      if ((puVar2[0x10] == param_2) && (*puVar2 == param_2)) {
        puVar2[2] = *param_3;
        puVar2[3] = param_3[1];
        puVar2[4] = param_3[2];
        FUN_14012bb70(puVar2 + 6,param_3 + 4);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140152240(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  puVar2[2] = *param_3;
  puVar2[3] = param_3[1];
  puVar2[4] = param_3[2];
  FUN_14012bb70(puVar2 + 6,param_3 + 4);
  return puVar2;
}



void FUN_1401487f0(void)

{
  FUN_14014d530();
  return;
}



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

undefined8 * FUN_140148810(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060917c = param_3;
  lVar1 = 0;
  DAT_140609170 = 0x11;
  DAT_140609194 = 10;
  _DAT_140609174 = param_1;
  _DAT_140609178 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140609160 = 0;
  DAT_140609168 = 0;
  DAT_140609190 = 0;
  DAT_140609198 = 0;
  DAT_1406091a0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140609180 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140609188 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140609188 = 0;
  }
  return &DAT_140609160;
}



uint * FUN_1401488e0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140609170;
  if (DAT_140609160 == 0) {
    cVar2 = FUN_140152810((ulonglong)DAT_140609170,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140609160 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x3c)) {
      if ((puVar3[0x3e] == param_1) && (*puVar3 == param_1)) {
        FUN_14014bd60(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140152bd0(param_1,uVar1,param_1);
  FUN_14014bd60(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_1401489a0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0xf8) % (ulonglong)DAT_140609170;
  if (param_1 != *(longlong *)(DAT_140609160 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140609160 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xf0); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xf0))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xf0) = *(undefined8 *)(param_1 + 0xf0);
      FUN_140152d70(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140609160 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xf0);
  FUN_140152d70(param_1);
  return;
}



void FUN_140148a40(void)

{
  FUN_14014d900();
  return;
}



uint * FUN_140148a60(longlong *param_1,uint param_2)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,(ulonglong)*(uint *)(param_1 + 2),1);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 10)) {
      if ((puVar3[0xc] == param_2) && (*puVar3 == param_2)) goto LAB_140148ab4;
    }
  }
  puVar3 = (uint *)FUN_1402da9c0(param_1,param_2,uVar1,param_2);
LAB_140148ab4:
  return puVar3 + 2;
}



void FUN_140148af0(void)

{
  FUN_14014da00();
  return;
}



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

undefined8 * FUN_140148b10(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060912c = param_3;
  lVar1 = 0;
  DAT_140609120 = 0x11;
  DAT_140609144 = 10;
  _DAT_140609124 = param_1;
  _DAT_140609128 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140609110 = 0;
  DAT_140609118 = 0;
  DAT_140609140 = 0;
  DAT_140609148 = 0;
  DAT_140609150 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140609130 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140609138 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140609138 = 0;
  }
  return &DAT_140609110;
}



uint * FUN_140148be0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140609120;
  if (DAT_140609110 == 0) {
    cVar2 = FUN_140152ed0((ulonglong)DAT_140609120,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140609110 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x18)) {
      if ((puVar3[0x1a] == param_1) && (*puVar3 == param_1)) {
        FUN_14014bf00(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140153290(param_1,uVar1,param_1);
  FUN_14014bf00(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140148ca0(void)

{
  FUN_14014dad0();
  return;
}



uint * FUN_140148cc0(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x24)) {
      if ((puVar2[0x26] == param_2) && (*puVar2 == param_2)) {
        FUN_14014bf80(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140153680(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_14014bf80(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_140148d90(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 + 0x90);
        FUN_14014dce0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140148e60(void)

{
  FUN_140148d90();
  return;
}



undefined4 * FUN_140148e80(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140159a20(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_140148eb0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_1406090dc = param_3;
  lVar1 = 0;
  DAT_1406090d0 = 0x11;
  DAT_1406090f4 = 10;
  _DAT_1406090d4 = param_1;
  _DAT_1406090d8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_1406090c0 = 0;
  DAT_1406090c8 = 0;
  DAT_1406090f0 = 0;
  DAT_1406090f8 = 0;
  DAT_140609100 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_1406090e0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_1406090e8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_1406090e8 = 0;
  }
  return &DAT_1406090c0;
}



uint * FUN_140148f80(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_1406090d0;
  if (DAT_1406090c0 == 0) {
    cVar2 = FUN_140153810((ulonglong)DAT_1406090d0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_1406090c0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x1e)) {
      if ((puVar3[0x20] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c000(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140153bd0(param_1,uVar1,param_1);
  FUN_14014c000(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140149040(void)

{
  FUN_14014dd80();
  return;
}



undefined4 * FUN_140149060(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140159ab0(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_140149090(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608f6c = param_3;
  lVar1 = 0;
  DAT_140608f60 = 0x11;
  DAT_140608f84 = 10;
  _DAT_140608f64 = param_1;
  _DAT_140608f68 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608f50 = 0;
  DAT_140608f58 = 0;
  DAT_140608f80 = 0;
  DAT_140608f88 = 0;
  DAT_140608f90 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608f70 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608f78 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608f78 = 0;
  }
  return &DAT_140608f50;
}



uint * FUN_140149160(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608f60;
  if (DAT_140608f50 == 0) {
    cVar2 = FUN_140153e30((ulonglong)DAT_140608f60,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608f50 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x38)) {
      if ((puVar3[0x3a] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c0a0(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_1401541f0(param_1,uVar1,param_1);
  FUN_14014c0a0(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140149220(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0xe8) % (ulonglong)DAT_140608f60;
  if (param_1 != *(longlong *)(DAT_140608f50 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608f50 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xe0); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xe0))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xe0) = *(undefined8 *)(param_1 + 0xe0);
      FUN_1401543a0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608f50 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xe0);
  FUN_1401543a0(param_1);
  return;
}



void FUN_1401492c0(void)

{
  FUN_14014df00();
  return;
}



undefined4 * FUN_1401492e0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140159b60(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_140149310(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608f1c = param_3;
  lVar1 = 0;
  DAT_140608f10 = 0x11;
  _DAT_140608f34 = 10;
  _DAT_140608f14 = param_1;
  _DAT_140608f18 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608f00 = 0;
  _DAT_140608f08 = 0;
  DAT_140608f30 = 0;
  DAT_140608f38 = 0;
  _DAT_140608f40 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  _DAT_140608f20 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  _DAT_140608f28 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    _DAT_140608f28 = 0;
  }
  return &DAT_140608f00;
}



uint * FUN_1401493e0(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x2a)) {
      if ((puVar2[0x2c] == param_2) && (*puVar2 == param_2)) {
        FUN_14014c210(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140154600(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_14014c210(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_1401494b0(void)

{
  FUN_14014e000();
  return;
}



undefined4 * FUN_1401494d0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_14013ccb0(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_140149500(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608ecc = param_3;
  lVar1 = 0;
  DAT_140608ec0 = 0x11;
  DAT_140608ee4 = 10;
  _DAT_140608ec4 = param_1;
  _DAT_140608ec8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608eb0 = 0;
  DAT_140608eb8 = 0;
  DAT_140608ee0 = 0;
  DAT_140608ee8 = 0;
  DAT_140608ef0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608ed0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608ed8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608ed8 = 0;
  }
  return &DAT_140608eb0;
}



uint * FUN_1401495d0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608ec0;
  if (DAT_140608eb0 == 0) {
    cVar2 = FUN_140154840((ulonglong)DAT_140608ec0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608eb0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x46)) {
      if ((puVar3[0x48] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c320(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140154c00(param_1,uVar1,param_1);
  FUN_14014c320(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140149690(void)

{
  FUN_14014e1a0();
  return;
}



undefined4 * FUN_1401496b0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_14013e010(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_1401496e0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608e7c = param_3;
  lVar1 = 0;
  DAT_140608e70 = 0x11;
  DAT_140608e94 = 10;
  _DAT_140608e74 = param_1;
  _DAT_140608e78 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608e60 = 0;
  DAT_140608e68 = 0;
  DAT_140608e90 = 0;
  DAT_140608e98 = 0;
  DAT_140608ea0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608e80 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608e88 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608e88 = 0;
  }
  return &DAT_140608e60;
}



uint * FUN_1401497b0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608e70;
  if (DAT_140608e60 == 0) {
    cVar2 = FUN_140154eb0((ulonglong)DAT_140608e70,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608e60 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x50)) {
      if ((puVar3[0x52] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c560(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140155270(param_1,uVar1,param_1);
  FUN_14014c560(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140149870(void)

{
  FUN_14014e340();
  return;
}



undefined4 * FUN_140149890(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140159d10(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_1401498c0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608dec = param_3;
  lVar1 = 0;
  DAT_140608de0 = 0x11;
  DAT_140608e04 = 10;
  _DAT_140608de4 = param_1;
  _DAT_140608de8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608dd0 = 0;
  DAT_140608dd8 = 0;
  DAT_140608e00 = 0;
  DAT_140608e08 = 0;
  DAT_140608e10 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608df0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608df8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608df8 = 0;
  }
  return &DAT_140608dd0;
}



uint * FUN_140149990(uint param_1,uint *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608de0;
  if (DAT_140608dd0 == 0) {
    cVar2 = FUN_1401554d0((ulonglong)DAT_140608de0,CONCAT71((int7)(uVar1 >> 8),1),0,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608dd0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 6)) {
      if ((puVar3[8] == param_1) && (*puVar3 == param_1)) {
        puVar3[1] = *param_2;
        puVar3[2] = param_2[1];
        puVar3[3] = param_2[2];
        puVar3[4] = param_2[3];
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140155890(param_1,uVar1,param_1);
  puVar3[1] = *param_2;
  puVar3[2] = param_2[1];
  puVar3[3] = param_2[2];
  puVar3[4] = param_2[3];
  return puVar3;
}



void FUN_140149a60(void)

{
  FUN_14014e4e0();
  return;
}



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

undefined8 * FUN_140149a80(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608d4c = param_3;
  lVar1 = 0;
  DAT_140608d40 = 0x11;
  DAT_140608d64 = 10;
  _DAT_140608d44 = param_1;
  _DAT_140608d48 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608d30 = 0;
  DAT_140608d38 = 0;
  DAT_140608d60 = 0;
  DAT_140608d68 = 0;
  DAT_140608d70 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608d50 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608d58 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608d58 = 0;
  }
  return &DAT_140608d30;
}



uint * FUN_140149b50(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608d40;
  if (DAT_140608d30 == 0) {
    cVar2 = FUN_140155aa0((ulonglong)DAT_140608d40,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608d30 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x30)) {
      if ((puVar3[0x32] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c700(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140155e60(param_1,uVar1,param_1);
  FUN_14014c700(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140149c10(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 200) % (ulonglong)DAT_140608d40;
  if (param_1 != *(longlong *)(DAT_140608d30 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608d30 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xc0); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xc0))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xc0) = *(undefined8 *)(param_1 + 0xc0);
      FUN_140155ff0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608d30 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xc0);
  FUN_140155ff0(param_1);
  return;
}



void FUN_140149cb0(void)

{
  FUN_14014e660();
  return;
}



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

undefined8 * FUN_140149cd0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608cfc = param_3;
  lVar1 = 0;
  DAT_140608cf0 = 0x11;
  DAT_140608d14 = 10;
  _DAT_140608cf4 = param_1;
  _DAT_140608cf8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608ce0 = 0;
  DAT_140608ce8 = 0;
  DAT_140608d10 = 0;
  DAT_140608d18 = 0;
  DAT_140608d20 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608d00 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608d08 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608d08 = 0;
  }
  return &DAT_140608ce0;
}



uint * FUN_140149da0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608cf0;
  if (DAT_140608ce0 == 0) {
    cVar2 = FUN_14014e7e0((ulonglong)DAT_140608cf0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608ce0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x14)) {
      if ((puVar3[0x16] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c830(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140156320(param_1,uVar1,param_1);
  FUN_14014c830(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140149e60(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608d10 = DAT_140608d10 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608ce0;
  if ((DAT_140608ce0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608cf0, DAT_140608cf0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x50);
        FUN_14014e9c0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608ce0;
        uVar4 = DAT_140608cf0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608ce0 = (void *)0x0;
  DAT_140608ce8 = 0;
  if (DAT_140608d10 == 0) {
    uVar5 = FUN_14014e930(0);
    FUN_14014e7e0(uVar5,0);
  }
  DAT_140608d20 = 0;
  _Memory = DAT_140608d18;
  if (DAT_140608d18 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608d18 = (longlong *)0x0;
    DAT_140608d10 = DAT_140608d10 + -1;
    return;
  }
  DAT_140608d10 = DAT_140608d10 + -1;
  return;
}



void FUN_140149f60(void)

{
  FUN_140149e60();
  return;
}



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

undefined8 * FUN_140149f80(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608cac = param_3;
  lVar1 = 0;
  DAT_140608ca0 = 0x11;
  DAT_140608cc4 = 10;
  _DAT_140608ca4 = param_1;
  _DAT_140608ca8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608c90 = 0;
  DAT_140608c98 = 0;
  DAT_140608cc0 = 0;
  DAT_140608cc8 = 0;
  DAT_140608cd0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608cb0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608cb8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608cb8 = 0;
  }
  return &DAT_140608c90;
}



uint * FUN_14014a050(uint param_1,uint *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608ca0;
  if (DAT_140608c90 == 0) {
    cVar2 = FUN_1401564a0((ulonglong)DAT_140608ca0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608c90 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x1e)) {
      if ((puVar3[0x20] == param_1) && (*puVar3 == param_1)) {
        puVar3[2] = *param_2;
        puVar3[3] = param_2[1];
        puVar3[4] = param_2[2];
        FUN_14012bb70(puVar3 + 6,param_2 + 4);
        FUN_14012bb70(puVar3 + 0xe,param_2 + 0xc);
        FUN_14012bb70(puVar3 + 0x16,param_2 + 0x14);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140156860(param_1,uVar1,param_1);
  puVar3[2] = *param_2;
  puVar3[3] = param_2[1];
  puVar3[4] = param_2[2];
  FUN_14012bb70(puVar3 + 6,param_2 + 4);
  FUN_14012bb70(puVar3 + 0xe,param_2 + 0xc);
  FUN_14012bb70(puVar3 + 0x16,param_2 + 0x14);
  return puVar3;
}



void FUN_14014a160(void)

{
  FUN_14014ea90();
  return;
}



undefined4 *
FUN_14014a180(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3,undefined8 param_4)

{
  *param_1 = *param_2;
  param_1[2] = *param_3;
  param_1[3] = param_3[1];
  param_1[4] = param_3[2];
  FUN_14012e520(param_1 + 6,param_3 + 4,param_3,param_4,0xfffffffffffffffe);
  FUN_14012e520(param_1 + 0xe,param_3 + 0xc);
  FUN_14012e520(param_1 + 0x16,param_3 + 0x14);
  return param_1;
}



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

undefined8 * FUN_14014a210(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608c5c = param_3;
  lVar1 = 0;
  DAT_140608c50 = 0x11;
  DAT_140608c74 = 10;
  _DAT_140608c54 = param_1;
  _DAT_140608c58 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608c40 = 0;
  DAT_140608c48 = 0;
  DAT_140608c70 = 0;
  DAT_140608c78 = 0;
  DAT_140608c80 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608c60 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608c68 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608c68 = 0;
  }
  return &DAT_140608c40;
}



uint * FUN_14014a2e0(uint param_1,uint *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608c50;
  if (DAT_140608c40 == 0) {
    cVar2 = FUN_14014ec90((ulonglong)DAT_140608c50,CONCAT71((int7)(uVar1 >> 8),1),0,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608c40 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 10)) {
      if ((puVar3[0xc] == param_1) && (*puVar3 == param_1)) {
        puVar3[1] = *param_2;
        puVar3[2] = param_2[1];
        puVar3[3] = param_2[2];
        puVar3[4] = param_2[3];
        puVar3[5] = param_2[4];
        puVar3[6] = param_2[5];
        puVar3[7] = param_2[6];
        puVar3[8] = param_2[7];
        puVar3[9] = param_2[8];
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140156c90(param_1,uVar1,param_1);
  puVar3[1] = *param_2;
  puVar3[2] = param_2[1];
  puVar3[3] = param_2[2];
  puVar3[4] = param_2[3];
  puVar3[5] = param_2[4];
  puVar3[6] = param_2[5];
  puVar3[7] = param_2[6];
  puVar3[8] = param_2[7];
  puVar3[9] = param_2[8];
  return puVar3;
}



void FUN_14014a3f0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608c70 = DAT_140608c70 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608c40;
  if ((DAT_140608c40 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608c50, DAT_140608c50 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x28);
        FUN_14014ee70(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608c40;
        uVar4 = DAT_140608c50;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608c40 = (void *)0x0;
  DAT_140608c48 = 0;
  if (DAT_140608c70 == 0) {
    uVar5 = FUN_14014ede0(0);
    FUN_14014ec90(uVar5,0);
  }
  DAT_140608c80 = 0;
  _Memory = DAT_140608c78;
  if (DAT_140608c78 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608c78 = (longlong *)0x0;
    DAT_140608c70 = DAT_140608c70 + -1;
    return;
  }
  DAT_140608c70 = DAT_140608c70 + -1;
  return;
}



void FUN_14014a4f0(void)

{
  FUN_14014a3f0();
  return;
}



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

undefined8 * FUN_14014a510(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608c0c = param_3;
  lVar1 = 0;
  DAT_140608c00 = 0x11;
  DAT_140608c24 = 10;
  _DAT_140608c04 = param_1;
  _DAT_140608c08 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608bf0 = 0;
  DAT_140608bf8 = 0;
  DAT_140608c20 = 0;
  DAT_140608c28 = 0;
  DAT_140608c30 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608c10 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608c18 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608c18 = 0;
  }
  return &DAT_140608bf0;
}



uint * FUN_14014a5e0(uint param_1,uint *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608c00;
  if (DAT_140608bf0 == 0) {
    cVar2 = FUN_14014efa0((ulonglong)DAT_140608c00,CONCAT71((int7)(uVar1 >> 8),1),0,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608bf0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 6)) {
      if ((puVar3[8] == param_1) && (*puVar3 == param_1)) {
        puVar3[1] = *param_2;
        puVar3[2] = param_2[1];
        puVar3[3] = param_2[2];
        puVar3[4] = param_2[3];
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140156fd0(param_1,uVar1,param_1);
  puVar3[1] = *param_2;
  puVar3[2] = param_2[1];
  puVar3[3] = param_2[2];
  puVar3[4] = param_2[3];
  return puVar3;
}



void FUN_14014a6b0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608c20 = DAT_140608c20 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608bf0;
  if ((DAT_140608bf0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608c00, DAT_140608c00 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x18);
        FUN_14014f180(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608bf0;
        uVar4 = DAT_140608c00;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608bf0 = (void *)0x0;
  DAT_140608bf8 = 0;
  if (DAT_140608c20 == 0) {
    uVar5 = FUN_14014f0f0(0);
    FUN_14014efa0(uVar5,0);
  }
  DAT_140608c30 = 0;
  _Memory = DAT_140608c28;
  if (DAT_140608c28 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608c28 = (longlong *)0x0;
    DAT_140608c20 = DAT_140608c20 + -1;
    return;
  }
  DAT_140608c20 = DAT_140608c20 + -1;
  return;
}



void FUN_14014a7b0(void)

{
  FUN_14014a6b0();
  return;
}



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

undefined8 * FUN_14014a7d0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608b2c = param_3;
  lVar1 = 0;
  DAT_140608b20 = 0x11;
  DAT_140608b44 = 10;
  _DAT_140608b24 = param_1;
  _DAT_140608b28 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608b10 = 0;
  DAT_140608b18 = 0;
  DAT_140608b40 = 0;
  DAT_140608b48 = 0;
  DAT_140608b50 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608b30 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608b38 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608b38 = 0;
  }
  return &DAT_140608b10;
}



uint * FUN_14014a8a0(uint param_1,void *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608b20;
  if (DAT_140608b10 == 0) {
    cVar2 = FUN_14014f2d0((ulonglong)DAT_140608b20,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608b10 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x24)) {
      if ((puVar3[0x26] == param_1) && (*puVar3 == param_1)) {
        memcpy(puVar3 + 1,param_2,0x8c);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140157310(param_1,uVar1,param_1);
  memcpy(puVar3 + 1,param_2,0x8c);
  return puVar3;
}



void FUN_14014a970(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608b40 = DAT_140608b40 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608b10;
  if ((DAT_140608b10 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608b20, DAT_140608b20 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x90);
        FUN_14014f4b0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608b10;
        uVar4 = DAT_140608b20;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608b10 = (void *)0x0;
  DAT_140608b18 = 0;
  if (DAT_140608b40 == 0) {
    uVar5 = FUN_14014f420(0);
    FUN_14014f2d0(uVar5,0);
  }
  DAT_140608b50 = 0;
  _Memory = DAT_140608b48;
  if (DAT_140608b48 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608b48 = (longlong *)0x0;
    DAT_140608b40 = DAT_140608b40 + -1;
    return;
  }
  DAT_140608b40 = DAT_140608b40 + -1;
  return;
}



void FUN_14014aa70(void)

{
  FUN_14014a970();
  return;
}



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

undefined8 * FUN_14014aa90(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_140608adc = param_3;
  lVar1 = 0;
  DAT_140608ad0 = 0x11;
  DAT_140608af4 = 10;
  _DAT_140608ad4 = param_1;
  _DAT_140608ad8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608ac0 = 0;
  DAT_140608ac8 = 0;
  DAT_140608af0 = 0;
  DAT_140608af8 = 0;
  DAT_140608b00 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608ae0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608ae8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608ae8 = 0;
  }
  return &DAT_140608ac0;
}



uint * FUN_14014ab60(uint param_1,uint *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608ad0;
  if (DAT_140608ac0 == 0) {
    cVar2 = FUN_140157490((ulonglong)DAT_140608ad0,CONCAT71((int7)(uVar1 >> 8),1),0,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608ac0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 6)) {
      if ((puVar3[8] == param_1) && (*puVar3 == param_1)) {
        puVar3[1] = *param_2;
        puVar3[2] = param_2[1];
        puVar3[3] = param_2[2];
        puVar3[4] = param_2[3];
        puVar3[5] = param_2[4];
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140157850(param_1,uVar1,param_1);
  puVar3[1] = *param_2;
  puVar3[2] = param_2[1];
  puVar3[3] = param_2[2];
  puVar3[4] = param_2[3];
  puVar3[5] = param_2[4];
  return puVar3;
}



void FUN_14014ac40(void)

{
  FUN_14014f560();
  return;
}



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

undefined8 * FUN_14014ac60(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060892c = param_3;
  lVar1 = 0;
  DAT_140608920 = 0x11;
  DAT_140608944 = 10;
  _DAT_140608924 = param_1;
  _DAT_140608928 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608910 = 0;
  DAT_140608918 = 0;
  DAT_140608940 = 0;
  DAT_140608948 = 0;
  DAT_140608950 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608930 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608938 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608938 = 0;
  }
  return &DAT_140608910;
}



uint * FUN_14014ad30(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608920;
  if (DAT_140608910 == 0) {
    cVar2 = FUN_140157a60((ulonglong)DAT_140608920,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608910 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x1e)) {
      if ((puVar3[0x20] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c8a0(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140157e20(param_1,uVar1,param_1);
  FUN_14014c8a0(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_14014adf0(void)

{
  FUN_14014f6e0();
  return;
}



undefined4 * FUN_14014ae10(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140150d00(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_14014ae40(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_1406088dc = param_3;
  lVar1 = 0;
  DAT_1406088d0 = 0x11;
  DAT_1406088f4 = 10;
  _DAT_1406088d4 = param_1;
  _DAT_1406088d8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_1406088c0 = 0;
  DAT_1406088c8 = 0;
  DAT_1406088f0 = 0;
  DAT_1406088f8 = 0;
  DAT_140608900 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_1406088e0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_1406088e8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_1406088e8 = 0;
  }
  return &DAT_1406088c0;
}



uint * FUN_14014af10(uint param_1,void *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_1406088d0;
  if (DAT_1406088c0 == 0) {
    cVar2 = FUN_1401580a0((ulonglong)DAT_1406088d0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_1406088c0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0xe)) {
      if ((puVar3[0x10] == param_1) && (*puVar3 == param_1)) {
        memcpy(puVar3 + 1,param_2,0x34);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140158460(param_1,uVar1,param_1);
  memcpy(puVar3 + 1,param_2,0x34);
  return puVar3;
}



void FUN_14014afd0(void)

{
  FUN_14014f860();
  return;
}



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

undefined8 * FUN_14014aff0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060888c = param_3;
  lVar1 = 0;
  DAT_140608880 = 0x11;
  DAT_1406088a4 = 10;
  _DAT_140608884 = param_1;
  _DAT_140608888 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608870 = 0;
  DAT_140608878 = 0;
  DAT_1406088a0 = 0;
  DAT_1406088a8 = 0;
  DAT_1406088b0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608890 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608898 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608898 = 0;
  }
  return &DAT_140608870;
}



uint * FUN_14014b0c0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608880;
  if (DAT_140608870 == 0) {
    cVar2 = FUN_140158670((ulonglong)DAT_140608880,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608870 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x30)) {
      if ((puVar3[0x32] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c920(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140158a30(param_1,uVar1,param_1);
  FUN_14014c920(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_14014b180(void)

{
  FUN_14014f9e0();
  return;
}



undefined4 * FUN_14014b1a0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140159ed0(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_14014b1d0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060883c = param_3;
  lVar1 = 0;
  DAT_140608830 = 0x11;
  DAT_140608854 = 10;
  _DAT_140608834 = param_1;
  _DAT_140608838 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608820 = 0;
  DAT_140608828 = 0;
  DAT_140608850 = 0;
  DAT_140608858 = 0;
  DAT_140608860 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608840 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608848 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608848 = 0;
  }
  return &DAT_140608820;
}



uint * FUN_14014b2a0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608830;
  if (DAT_140608820 == 0) {
    cVar2 = FUN_140158cb0((ulonglong)DAT_140608830,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608820 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x34)) {
      if ((puVar3[0x36] == param_1) && (*puVar3 == param_1)) {
        FUN_14014c9b0(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140159070(param_1,uVar1,param_1);
  FUN_14014c9b0(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_14014b360(void)

{
  FUN_14014fb80();
  return;
}



undefined4 * FUN_14014b380(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140159f80(param_1 + 2,param_3);
  return param_1;
}



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

undefined8 * FUN_14014b3b0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_1406087ec = param_3;
  lVar1 = 0;
  DAT_1406087e0 = 0x11;
  DAT_140608804 = 10;
  _DAT_1406087e4 = param_1;
  DAT_1406087e8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_1406087d0 = 0;
  DAT_1406087d8 = 0;
  DAT_140608800 = 0;
  DAT_140608808 = 0;
  DAT_140608810 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_1406087f0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_1406087f8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_1406087f8 = 0;
  }
  return &DAT_1406087d0;
}



uint * FUN_14014b480(uint param_1,uint *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_1406087e0;
  if (DAT_1406087d0 == 0) {
    cVar2 = FUN_140159310((ulonglong)DAT_1406087e0,CONCAT71((int7)(uVar1 >> 8),1),0,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_1406087d0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 8)) {
      if ((puVar3[10] == param_1) && (*puVar3 == param_1)) {
        puVar3[1] = *param_2;
        puVar3[2] = param_2[1];
        puVar3[3] = param_2[2];
        puVar3[4] = param_2[3];
        puVar3[5] = param_2[4];
        puVar3[6] = param_2[5];
        puVar3[7] = param_2[6];
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_1401596d0(param_1,uVar1,param_1);
  puVar3[1] = *param_2;
  puVar3[2] = param_2[1];
  puVar3[3] = param_2[2];
  puVar3[4] = param_2[3];
  puVar3[5] = param_2[4];
  puVar3[6] = param_2[5];
  puVar3[7] = param_2[6];
  return puVar3;
}



void FUN_14014b570(void)

{
  FUN_14014fd20();
  return;
}



longlong FUN_14014b590(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  uint uVar4;
  
  lVar1 = *param_2;
  if (lVar1 == 0) {
    *param_2 = 0;
    return 0;
  }
  lVar3 = *(longlong *)(lVar1 + 0x18);
  if (lVar3 == 0) {
    uVar4 = *(uint *)(lVar1 + 0x20) % *(uint *)(param_1 + 2) + 1;
    lVar2 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar4) break;
      if (*(longlong *)(lVar2 + *param_1) != 0) {
        lVar3 = *(longlong *)(lVar2 + *param_1);
      }
      uVar4 = uVar4 + 1;
      lVar2 = lVar2 + 8;
    } while (lVar3 == 0);
  }
  *param_2 = lVar3;
  return lVar1;
}



undefined4 * FUN_14014b600(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  FUN_1400015e0(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff);
  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;
}



undefined4 * FUN_14014b780(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  param_1[0x16] = param_2[0x16];
  FUN_14012bb70(param_1 + 0x18,param_2 + 0x18);
  param_1[0x20] = param_2[0x20];
  param_1[0x21] = param_2[0x21];
  param_1[0x22] = param_2[0x22];
  param_1[0x23] = param_2[0x23];
  FUN_1400015e0(param_1 + 0x24,param_2 + 0x24,0,0xffffffffffffffff);
  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];
  param_1[0x36] = param_2[0x36];
  param_1[0x37] = param_2[0x37];
  param_1[0x38] = param_2[0x38];
  param_1[0x39] = param_2[0x39];
  param_1[0x3a] = param_2[0x3a];
  param_1[0x3b] = param_2[0x3b];
  param_1[0x3c] = param_2[0x3c];
  param_1[0x3d] = param_2[0x3d];
  param_1[0x3e] = param_2[0x3e];
  param_1[0x3f] = param_2[0x3f];
  param_1[0x40] = param_2[0x40];
  param_1[0x41] = param_2[0x41];
  param_1[0x42] = param_2[0x42];
  param_1[0x43] = param_2[0x43];
  param_1[0x44] = param_2[0x44];
  param_1[0x45] = param_2[0x45];
  param_1[0x46] = param_2[0x46];
  param_1[0x47] = param_2[0x47];
  param_1[0x48] = param_2[0x48];
  param_1[0x49] = param_2[0x49];
  param_1[0x4a] = param_2[0x4a];
  param_1[0x4b] = param_2[0x4b];
  param_1[0x4c] = param_2[0x4c];
  param_1[0x4d] = param_2[0x4d];
  param_1[0x4e] = param_2[0x4e];
  param_1[0x4f] = param_2[0x4f];
  param_1[0x50] = param_2[0x50];
  param_1[0x51] = param_2[0x51];
  param_1[0x52] = param_2[0x52];
  param_1[0x53] = param_2[0x53];
  param_1[0x54] = param_2[0x54];
  param_1[0x55] = param_2[0x55];
  param_1[0x56] = param_2[0x56];
  param_1[0x57] = param_2[0x57];
  param_1[0x58] = param_2[0x58];
  param_1[0x59] = param_2[0x59];
  param_1[0x5a] = param_2[0x5a];
  param_1[0x5b] = param_2[0x5b];
  param_1[0x5c] = param_2[0x5c];
  param_1[0x5d] = param_2[0x5d];
  param_1[0x5e] = param_2[0x5e];
  param_1[0x5f] = param_2[0x5f];
  param_1[0x60] = param_2[0x60];
  param_1[0x61] = param_2[0x61];
  param_1[0x62] = param_2[0x62];
  param_1[99] = param_2[99];
  param_1[100] = param_2[100];
  param_1[0x65] = param_2[0x65];
  param_1[0x66] = param_2[0x66];
  param_1[0x67] = param_2[0x67];
  param_1[0x68] = param_2[0x68];
  FUN_1400015e0(param_1 + 0x6a,param_2 + 0x6a,0,0xffffffffffffffff);
  param_1[0x74] = param_2[0x74];
  param_1[0x75] = param_2[0x75];
  param_1[0x76] = param_2[0x76];
  param_1[0x77] = param_2[0x77];
  param_1[0x78] = param_2[0x78];
  param_1[0x79] = param_2[0x79];
  param_1[0x7a] = param_2[0x7a];
  param_1[0x7b] = param_2[0x7b];
  param_1[0x7c] = param_2[0x7c];
  param_1[0x7d] = param_2[0x7d];
  param_1[0x7e] = param_2[0x7e];
  param_1[0x7f] = param_2[0x7f];
  FUN_14012bb70(param_1 + 0x80,param_2 + 0x80);
  param_1[0x88] = param_2[0x88];
  param_1[0x89] = param_2[0x89];
  FUN_14012bb70(param_1 + 0x8a,param_2 + 0x8a);
  FUN_14012bb70(param_1 + 0x92,param_2 + 0x92);
  FUN_14012bb70(param_1 + 0x9a,param_2 + 0x9a);
  param_1[0xa2] = param_2[0xa2];
  return param_1;
}



undefined4 * FUN_14014bc20(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_1400015e0(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];
  return param_1;
}



undefined4 * FUN_14014bca0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  param_1[0x16] = param_2[0x16];
  FUN_1400015e0(param_1 + 0x18,param_2 + 0x18,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x22,param_2 + 0x22,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x2c,param_2 + 0x2c,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x36,param_2 + 0x36,0,0xffffffffffffffff);
  return param_1;
}



undefined4 * FUN_14014bd60(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_14012bb70(param_1 + 0xc,param_2 + 0xc);
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  param_1[0x16] = param_2[0x16];
  FUN_14012bb70(param_1 + 0x18,param_2 + 0x18);
  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];
  param_1[0x36] = param_2[0x36];
  param_1[0x37] = param_2[0x37];
  param_1[0x38] = param_2[0x38];
  return param_1;
}



undefined4 * FUN_14014bf00(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  return param_1;
}



undefined4 * FUN_14014bf80(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];
  FUN_14012bb70();
  FUN_14012bb70(param_1 + 0xe,param_2 + 0xe);
  FUN_14012bb70(param_1 + 0x16,param_2 + 0x16);
  param_1[0x1e] = param_2[0x1e];
  param_1[0x1f] = param_2[0x1f];
  param_1[0x20] = param_2[0x20];
  return param_1;
}



undefined4 * FUN_14014c000(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  return param_1;
}



undefined4 * FUN_14014c0a0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff);
  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];
  return param_1;
}



undefined4 * FUN_14014c210(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff);
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  return param_1;
}



undefined4 * FUN_14014c320(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  param_1[0xc] = param_2[0xc];
  FUN_14012bb70(param_1 + 0xe,param_2 + 0xe);
  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];
  *(undefined1 *)(param_1 + 0x31) = *(undefined1 *)(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];
  param_1[0x36] = param_2[0x36];
  param_1[0x37] = param_2[0x37];
  param_1[0x38] = param_2[0x38];
  param_1[0x39] = param_2[0x39];
  param_1[0x3a] = param_2[0x3a];
  param_1[0x3b] = param_2[0x3b];
  param_1[0x3c] = param_2[0x3c];
  param_1[0x3d] = param_2[0x3d];
  param_1[0x3e] = param_2[0x3e];
  param_1[0x3f] = param_2[0x3f];
  param_1[0x40] = param_2[0x40];
  param_1[0x41] = param_2[0x41];
  param_1[0x42] = param_2[0x42];
  param_1[0x43] = param_2[0x43];
  return param_1;
}



undefined4 * FUN_14014c560(undefined4 *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_1400015e0(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];
  FUN_1400015e0(param_1 + 0x1a,param_2 + 0x1a,0,0xffffffffffffffff);
  param_1[0x24] = param_2[0x24];
  lVar2 = 0xc;
  param_1[0x25] = param_2[0x25];
  param_1[0x26] = param_2[0x26];
  param_1[0x27] = param_2[0x27];
  lVar3 = 0xc;
  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];
  puVar1 = param_1 + 0x30;
  do {
    lVar3 = lVar3 + -1;
    *puVar1 = *(undefined4 *)(((longlong)param_2 - (longlong)param_1) + (longlong)puVar1);
    puVar1 = puVar1 + 1;
  } while (lVar3 != 0);
  puVar1 = param_1 + 0x3c;
  do {
    lVar2 = lVar2 + -1;
    *puVar1 = *(undefined4 *)((longlong)puVar1 + ((longlong)param_2 - (longlong)param_1));
    puVar1 = puVar1 + 1;
  } while (lVar2 != 0);
  param_1[0x48] = param_2[0x48];
  param_1[0x49] = param_2[0x49];
  param_1[0x4a] = param_2[0x4a];
  param_1[0x4b] = param_2[0x4b];
  param_1[0x4c] = param_2[0x4c];
  param_1[0x4d] = param_2[0x4d];
  return param_1;
}



undefined4 * FUN_14014c700(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_14012bb70(param_1 + 0xc,param_2 + 0xc);
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  return param_1;
}



undefined4 * FUN_14014c830(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  FUN_14012bb70(param_1 + 2,param_2 + 2);
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  return param_1;
}



undefined4 * FUN_14014c8a0(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  FUN_14012bb70();
  FUN_14012bb70(param_1 + 0x14,param_2 + 0x14);
  return param_1;
}



undefined4 * FUN_14014c920(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];
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff);
  FUN_14012bb70(param_1 + 0xe,param_2 + 0xe);
  FUN_14012bb70(param_1 + 0x16,param_2 + 0x16);
  FUN_14012bb70(param_1 + 0x1e,param_2 + 0x1e);
  FUN_14012bb70(param_1 + 0x26,param_2 + 0x26);
  return param_1;
}



undefined4 * FUN_14014c9b0(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  FUN_1400015e0(param_1 + 8,param_2 + 8,0,0xffffffffffffffff);
  FUN_14012bb70(param_1 + 0x12,param_2 + 0x12);
  FUN_14012bb70(param_1 + 0x1a,param_2 + 0x1a);
  FUN_14012bb70(param_1 + 0x22,param_2 + 0x22);
  FUN_14012bb70(param_1 + 0x2a,param_2 + 0x2a);
  return param_1;
}



void FUN_14014ca50(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_14014cae0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0xe0);
  FUN_14014cae0(param_1,param_2);
  return;
}



void FUN_14014cae0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (7 < *(ulonglong *)(param_2 + 0xc0)) {
    operator_delete(*(void **)(param_2 + 0xa8));
  }
  *(undefined8 *)(param_2 + 0xc0) = 7;
  *(undefined8 *)(param_2 + 0xb8) = 0;
  *(undefined2 *)(param_2 + 0xa8) = 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_1402cddb0(param_1);
    FUN_140150f00(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_14014cbb0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x20) % (ulonglong)DAT_140609260;
  if (param_1 != *(longlong *)(DAT_140609250 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140609250 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x18); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x18))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x18) = *(undefined8 *)(param_1 + 0x18);
      FUN_14014ce10(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140609250 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x18);
  FUN_14014ce10(param_1);
  return;
}



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

undefined8 FUN_14014cc30(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140609250 != (void *)0x0) {
    operator_delete__(DAT_140609250);
    DAT_140609250 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140609250 = operator_new(_Var1);
    if (DAT_140609250 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140609250,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060926c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140609268;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140609278 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140609278 = 0;
  }
  DAT_140609270 = (longlong)fVar4 + lVar2;
  DAT_140609260 = param_1;
  return CONCAT71((int7)(DAT_140609278 >> 8),1);
}



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

uint FUN_14014cd80(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140609264;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_14014ce10(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x18) = DAT_140609290;
    DAT_140609258 = DAT_140609258 - 1;
    DAT_140609290 = param_1;
    if ((DAT_140609258 < DAT_140609278) && (DAT_140609280 == 0)) {
      uVar2 = FUN_14014cd80(DAT_140609258);
      FUN_140151230(uVar2);
    }
    if ((DAT_140609258 == 0) &&
       (DAT_140609290 = 0, _Memory = DAT_140609288, DAT_140609288 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140609288 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_14014cec0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *plVar7;
  ulonglong uVar8;
  uint uVar9;
  ulonglong uVar10;
  
  DAT_140609230 = DAT_140609230 + 1;
  uVar8 = 0;
  pvVar6 = DAT_140609200;
  if ((DAT_140609200 != (void *)0x0) && (uVar10 = uVar8, uVar4 = DAT_140609210, DAT_140609210 != 0))
  {
    do {
      lVar1 = *(longlong *)((longlong)pvVar6 + uVar8);
      lVar3 = DAT_140609240;
      while (DAT_140609240 = lVar1, DAT_140609240 != 0) {
        lVar1 = *(longlong *)(DAT_140609240 + 0x38);
        *(longlong *)(DAT_140609240 + 0x38) = lVar3;
        DAT_140609208 = DAT_140609208 - 1;
        if ((DAT_140609208 < DAT_140609228) && (DAT_140609230 == 0)) {
          uVar5 = FUN_1402cddb0(&DAT_140609200,DAT_140609208);
          FUN_14025e8b0(&DAT_140609200,uVar5);
        }
        pvVar6 = DAT_140609200;
        uVar4 = DAT_140609210;
        lVar3 = DAT_140609240;
        if ((DAT_140609208 == 0) &&
           (DAT_140609240 = 0, plVar7 = DAT_140609238, lVar3 = DAT_140609240,
           DAT_140609238 != (longlong *)0x0)) {
          do {
            plVar2 = (longlong *)*plVar7;
            free(plVar7);
            plVar7 = plVar2;
          } while (plVar2 != (longlong *)0x0);
          DAT_140609238 = (longlong *)0x0;
          pvVar6 = DAT_140609200;
          uVar4 = DAT_140609210;
          lVar3 = DAT_140609240;
        }
      }
      uVar9 = (int)uVar10 + 1;
      uVar8 = uVar8 + 8;
      uVar10 = (ulonglong)uVar9;
      DAT_140609240 = lVar3;
    } while (uVar9 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140609200 = (void *)0x0;
  DAT_140609208 = 0;
  if (DAT_140609230 == 0) {
    uVar5 = FUN_1402cddb0(&DAT_140609200,0);
    FUN_1402c6d50(&DAT_140609200,uVar5,0);
  }
  DAT_140609240 = 0;
  plVar7 = DAT_140609238;
  if (DAT_140609238 == (longlong *)0x0) {
    DAT_140609230 = DAT_140609230 + -1;
    return;
  }
  do {
    plVar2 = (longlong *)*plVar7;
    free(plVar7);
    plVar7 = plVar2;
  } while (plVar2 != (longlong *)0x0);
  DAT_140609238 = (longlong *)0x0;
  DAT_140609230 = DAT_140609230 + -1;
  return;
}



void FUN_14014d080(longlong *param_1,longlong param_2)

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



void FUN_14014d100(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (7 < *(ulonglong *)(param_2 + 0x20)) {
    operator_delete(*(void **)(param_2 + 8));
  }
  *(undefined8 *)(param_2 + 0x20) = 7;
  *(undefined8 *)(param_2 + 0x18) = 0;
  *(undefined2 *)(param_2 + 8) = 0;
  *(undefined8 *)(param_2 + 0x30) = *(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_1402cddb0(param_1);
    FUN_1401516d0(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_14014d1c0(longlong *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,(int)param_1[2],1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_140151880(param_1,param_2,param_3,param_4);
  return;
}



void FUN_14014d230(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140132210(param_2 + 8);
  *(undefined8 *)(param_2 + 0x298) = *(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_1402cddb0(param_1);
    FUN_1401519f0(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_14014d2d0(longlong *param_1,longlong param_2)

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



void FUN_14014d360(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140136590(param_2 + 8);
  *(undefined8 *)(param_2 + 0x80) = *(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_1402cddb0(param_1);
    FUN_1402db240(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_14014d400(longlong *param_1,longlong param_2)

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



void FUN_14014d490(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140136600(param_2 + 8);
  *(undefined8 *)(param_2 + 0x108) = *(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_1402cddb0(param_1);
    FUN_140151ea0(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_14014d530(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 + 0x38);
        FUN_1401523a0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_14014d600(longlong *param_1,longlong param_2)

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



void FUN_14014d680(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_14014d74b:
      if (1 < lVar1) {
        FUN_14015a500(param_1,param_2,param_4);
      }
      return;
    }
    if (param_3 < 1) {
      if (0x20 < lVar1) {
        if (8 < (longlong)(param_2 - param_1 & 0xfffffffffffffff8U)) {
          FUN_14015a2e0(param_1,param_2,param_4);
        }
        FUN_14015a3f0(param_1,param_2,param_4);
        return;
      }
      goto LAB_14014d74b;
    }
    FUN_140152450(&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_14014d680(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_14014d680(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



void FUN_14014d7c0(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_14014d88b:
      if (1 < lVar1) {
        FUN_14015aa10(param_1,param_2,param_4);
      }
      return;
    }
    if (param_3 < 1) {
      if (0x20 < lVar1) {
        if (8 < (longlong)(param_2 - param_1 & 0xfffffffffffffff8U)) {
          FUN_14015a7f0(param_1,param_2,param_4);
        }
        FUN_14015a900(param_1,param_2,param_4);
        return;
      }
      goto LAB_14014d88b;
    }
    FUN_140152630(&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_14014d7c0(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_14014d7c0(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



void FUN_14014d900(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140609190 = DAT_140609190 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140609160;
  if ((DAT_140609160 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140609170, DAT_140609170 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xf0);
        FUN_140152d70(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140609160;
        uVar4 = DAT_140609170;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140609160 = (void *)0x0;
  DAT_140609168 = 0;
  if (DAT_140609190 == 0) {
    uVar5 = FUN_140152b40(0);
    FUN_140152810(uVar5,0);
  }
  DAT_1406091a0 = 0;
  _Memory = DAT_140609198;
  if (DAT_140609198 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140609198 = (longlong *)0x0;
    DAT_140609190 = DAT_140609190 + -1;
    return;
  }
  DAT_140609190 = DAT_140609190 + -1;
  return;
}



void FUN_14014da00(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 + 0x28);
        FUN_140152e20(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_14014dad0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140609140 = DAT_140609140 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140609110;
  if ((DAT_140609110 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140609120, DAT_140609120 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x60);
        FUN_140153400(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140609110;
        uVar4 = DAT_140609120;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140609110 = (void *)0x0;
  DAT_140609118 = 0;
  if (DAT_140609140 == 0) {
    uVar5 = FUN_140153200(0);
    FUN_140152ed0(uVar5,0);
  }
  DAT_140609150 = 0;
  _Memory = DAT_140609148;
  if (DAT_140609148 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140609148 = (longlong *)0x0;
    DAT_140609140 = DAT_140609140 + -1;
    return;
  }
  DAT_140609140 = DAT_140609140 + -1;
  return;
}



void FUN_14014dbd0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x68) % (ulonglong)DAT_140609120;
  if (param_1 != *(longlong *)(DAT_140609110 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140609110 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x60); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x60))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x60) = *(undefined8 *)(param_1 + 0x60);
      FUN_140153400(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140609110 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x60);
  FUN_140153400(param_1);
  return;
}



void FUN_14014dc50(longlong *param_1,longlong param_2)

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



void FUN_14014dce0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140139d00(param_2 + 8);
  *(undefined8 *)(param_2 + 0x90) = *(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_1402cddb0(param_1);
    FUN_1401534d0(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_14014dd80(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_1406090f0 = DAT_1406090f0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_1406090c0;
  if ((DAT_1406090c0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_1406090d0, DAT_1406090d0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x78);
        FUN_140153d60(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_1406090c0;
        uVar4 = DAT_1406090d0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_1406090c0 = (void *)0x0;
  DAT_1406090c8 = 0;
  if (DAT_1406090f0 == 0) {
    uVar5 = FUN_140153b40(0);
    FUN_140153810(uVar5,0);
  }
  DAT_140609100 = 0;
  _Memory = DAT_1406090f8;
  if (DAT_1406090f8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_1406090f8 = (longlong *)0x0;
    DAT_1406090f0 = DAT_1406090f0 + -1;
    return;
  }
  DAT_1406090f0 = DAT_1406090f0 + -1;
  return;
}



void FUN_14014de80(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x80) % (ulonglong)DAT_1406090d0;
  if (param_1 != *(longlong *)(DAT_1406090c0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_1406090c0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x78); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x78))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x78) = *(undefined8 *)(param_1 + 0x78);
      FUN_140153d60(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_1406090c0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x78);
  FUN_140153d60(param_1);
  return;
}



void FUN_14014df00(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608f80 = DAT_140608f80 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608f50;
  if ((DAT_140608f50 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608f60, DAT_140608f60 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xe0);
        FUN_1401543a0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608f50;
        uVar4 = DAT_140608f60;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608f50 = (void *)0x0;
  DAT_140608f58 = 0;
  if (DAT_140608f80 == 0) {
    uVar5 = FUN_140154160(0);
    FUN_140153e30(uVar5,0);
  }
  DAT_140608f90 = 0;
  _Memory = DAT_140608f88;
  if (DAT_140608f88 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608f88 = (longlong *)0x0;
    DAT_140608f80 = DAT_140608f80 + -1;
    return;
  }
  DAT_140608f80 = DAT_140608f80 + -1;
  return;
}



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

void FUN_14014e000(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608f30 = DAT_140608f30 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608f00;
  if ((DAT_140608f00 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608f10, DAT_140608f10 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xa8);
        FUN_140154780(&DAT_140608f00,lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608f00;
        uVar4 = DAT_140608f10;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608f00 = (void *)0x0;
  _DAT_140608f08 = 0;
  if (DAT_140608f30 == 0) {
    uVar5 = FUN_1402cddb0(&DAT_140608f00,0);
    FUN_1402c6d50(&DAT_140608f00,uVar5,0);
  }
  _DAT_140608f40 = 0;
  _Memory = DAT_140608f38;
  if (DAT_140608f38 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608f38 = (longlong *)0x0;
    DAT_140608f30 = DAT_140608f30 + -1;
    return;
  }
  DAT_140608f30 = DAT_140608f30 + -1;
  return;
}



void FUN_14014e1a0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608ee0 = DAT_140608ee0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608eb0;
  if ((DAT_140608eb0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608ec0, DAT_140608ec0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x118);
        FUN_140154dc0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608eb0;
        uVar4 = DAT_140608ec0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608eb0 = (void *)0x0;
  DAT_140608eb8 = 0;
  if (DAT_140608ee0 == 0) {
    uVar5 = FUN_140154b70(0);
    FUN_140154840(uVar5,0);
  }
  DAT_140608ef0 = 0;
  _Memory = DAT_140608ee8;
  if (DAT_140608ee8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608ee8 = (longlong *)0x0;
    DAT_140608ee0 = DAT_140608ee0 + -1;
    return;
  }
  DAT_140608ee0 = DAT_140608ee0 + -1;
  return;
}



void FUN_14014e2a0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x120) % (ulonglong)DAT_140608ec0;
  if (param_1 != *(longlong *)(DAT_140608eb0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608eb0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x118); lVar3 != param_1;
        lVar3 = *(longlong *)(lVar3 + 0x118)) {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x118) = *(undefined8 *)(param_1 + 0x118);
      FUN_140154dc0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608eb0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x118);
  FUN_140154dc0(param_1);
  return;
}



void FUN_14014e340(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608e90 = DAT_140608e90 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608e60;
  if ((DAT_140608e60 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608e70, DAT_140608e70 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x140);
        FUN_140155420(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608e60;
        uVar4 = DAT_140608e70;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608e60 = (void *)0x0;
  DAT_140608e68 = 0;
  if (DAT_140608e90 == 0) {
    uVar5 = FUN_1401551e0(0);
    FUN_140154eb0(uVar5,0);
  }
  DAT_140608ea0 = 0;
  _Memory = DAT_140608e98;
  if (DAT_140608e98 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608e98 = (longlong *)0x0;
    DAT_140608e90 = DAT_140608e90 + -1;
    return;
  }
  DAT_140608e90 = DAT_140608e90 + -1;
  return;
}



void FUN_14014e440(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x148) % (ulonglong)DAT_140608e70;
  if (param_1 != *(longlong *)(DAT_140608e60 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608e60 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x140); lVar3 != param_1;
        lVar3 = *(longlong *)(lVar3 + 0x140)) {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x140) = *(undefined8 *)(param_1 + 0x140);
      FUN_140155420(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608e60 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x140);
  FUN_140155420(param_1);
  return;
}



void FUN_14014e4e0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608e00 = DAT_140608e00 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608dd0;
  if ((DAT_140608dd0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608de0, DAT_140608de0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x18);
        FUN_1401559f0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608dd0;
        uVar4 = DAT_140608de0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608dd0 = (void *)0x0;
  DAT_140608dd8 = 0;
  if (DAT_140608e00 == 0) {
    uVar5 = FUN_140155800(0);
    FUN_1401554d0(uVar5,0);
  }
  DAT_140608e10 = 0;
  _Memory = DAT_140608e08;
  if (DAT_140608e08 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608e08 = (longlong *)0x0;
    DAT_140608e00 = DAT_140608e00 + -1;
    return;
  }
  DAT_140608e00 = DAT_140608e00 + -1;
  return;
}



void FUN_14014e5e0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x20) % (ulonglong)DAT_140608de0;
  if (param_1 != *(longlong *)(DAT_140608dd0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608dd0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x18); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x18))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x18) = *(undefined8 *)(param_1 + 0x18);
      FUN_1401559f0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608dd0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x18);
  FUN_1401559f0(param_1);
  return;
}



void FUN_14014e660(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608d60 = DAT_140608d60 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608d30;
  if ((DAT_140608d30 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608d40, DAT_140608d40 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xc0);
        FUN_140155ff0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608d30;
        uVar4 = DAT_140608d40;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608d30 = (void *)0x0;
  DAT_140608d38 = 0;
  if (DAT_140608d60 == 0) {
    uVar5 = FUN_140155dd0(0);
    FUN_140155aa0(uVar5,0);
  }
  DAT_140608d70 = 0;
  _Memory = DAT_140608d68;
  if (DAT_140608d68 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608d68 = (longlong *)0x0;
    DAT_140608d60 = DAT_140608d60 + -1;
    return;
  }
  DAT_140608d60 = DAT_140608d60 + -1;
  return;
}



void FUN_14014e760(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x58) % (ulonglong)DAT_140608cf0;
  if (param_1 != *(longlong *)(DAT_140608ce0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608ce0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x50); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x50))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x50) = *(undefined8 *)(param_1 + 0x50);
      FUN_14014e9c0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608ce0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x50);
  FUN_14014e9c0(param_1);
  return;
}



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

undefined8 FUN_14014e7e0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608ce0 != (void *)0x0) {
    operator_delete__(DAT_140608ce0);
    DAT_140608ce0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608ce0 = operator_new(_Var1);
    if (DAT_140608ce0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608ce0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608cfc;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608cf8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608d08 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608d08 = 0;
  }
  DAT_140608d00 = (longlong)fVar4 + lVar2;
  DAT_140608cf0 = param_1;
  return CONCAT71((int7)(DAT_140608d08 >> 8),1);
}



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

uint FUN_14014e930(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608cf4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_14014e9c0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(longlong *)(param_1 + 0x50) = DAT_140608d20;
  DAT_140608ce8 = DAT_140608ce8 - 1;
  DAT_140608d20 = param_1;
  if ((DAT_140608ce8 < DAT_140608d08) && (DAT_140608d10 == 0)) {
    uVar2 = FUN_14014e930(DAT_140608ce8);
    FUN_140156140(uVar2);
  }
  if (DAT_140608ce8 == 0) {
    DAT_140608d20 = 0;
    _Memory = DAT_140608d18;
    if (DAT_140608d18 != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608d18 = (longlong *)0x0;
    }
  }
  return;
}



void FUN_14014ea90(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608cc0 = DAT_140608cc0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608c90;
  if ((DAT_140608c90 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608ca0, DAT_140608ca0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x78);
        FUN_140156a00(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608c90;
        uVar4 = DAT_140608ca0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608c90 = (void *)0x0;
  DAT_140608c98 = 0;
  if (DAT_140608cc0 == 0) {
    uVar5 = FUN_1401567d0(0);
    FUN_1401564a0(uVar5,0);
  }
  DAT_140608cd0 = 0;
  _Memory = DAT_140608cc8;
  if (DAT_140608cc8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608cc8 = (longlong *)0x0;
    DAT_140608cc0 = DAT_140608cc0 + -1;
    return;
  }
  DAT_140608cc0 = DAT_140608cc0 + -1;
  return;
}



void FUN_14014eb90(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x80) % (ulonglong)DAT_140608ca0;
  if (param_1 != *(longlong *)(DAT_140608c90 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608c90 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x78); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x78))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x78) = *(undefined8 *)(param_1 + 0x78);
      FUN_140156a00(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608c90 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x78);
  FUN_140156a00(param_1);
  return;
}



void FUN_14014ec10(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x30) % (ulonglong)DAT_140608c50;
  if (param_1 != *(longlong *)(DAT_140608c40 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608c40 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x28); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x28))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x28) = *(undefined8 *)(param_1 + 0x28);
      FUN_14014ee70(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608c40 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x28);
  FUN_14014ee70(param_1);
  return;
}



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

undefined8 FUN_14014ec90(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608c40 != (void *)0x0) {
    operator_delete__(DAT_140608c40);
    DAT_140608c40 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608c40 = operator_new(_Var1);
    if (DAT_140608c40 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608c40,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608c5c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608c58;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608c68 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608c68 = 0;
  }
  DAT_140608c60 = (longlong)fVar4 + lVar2;
  DAT_140608c50 = param_1;
  return CONCAT71((int7)(DAT_140608c68 >> 8),1);
}



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

uint FUN_14014ede0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608c54;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_14014ee70(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x28) = DAT_140608c80;
    DAT_140608c48 = DAT_140608c48 - 1;
    DAT_140608c80 = param_1;
    if ((DAT_140608c48 < DAT_140608c68) && (DAT_140608c70 == 0)) {
      uVar2 = FUN_14014ede0(DAT_140608c48);
      FUN_140156ab0(uVar2);
    }
    if ((DAT_140608c48 == 0) &&
       (DAT_140608c80 = 0, _Memory = DAT_140608c78, DAT_140608c78 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608c78 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_14014ef20(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x20) % (ulonglong)DAT_140608c00;
  if (param_1 != *(longlong *)(DAT_140608bf0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608bf0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x18); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x18))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x18) = *(undefined8 *)(param_1 + 0x18);
      FUN_14014f180(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608bf0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x18);
  FUN_14014f180(param_1);
  return;
}



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

undefined8 FUN_14014efa0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608bf0 != (void *)0x0) {
    operator_delete__(DAT_140608bf0);
    DAT_140608bf0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608bf0 = operator_new(_Var1);
    if (DAT_140608bf0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608bf0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608c0c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608c08;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608c18 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608c18 = 0;
  }
  DAT_140608c10 = (longlong)fVar4 + lVar2;
  DAT_140608c00 = param_1;
  return CONCAT71((int7)(DAT_140608c18 >> 8),1);
}



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

uint FUN_14014f0f0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608c04;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_14014f180(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x18) = DAT_140608c30;
    DAT_140608bf8 = DAT_140608bf8 - 1;
    DAT_140608c30 = param_1;
    if ((DAT_140608bf8 < DAT_140608c18) && (DAT_140608c20 == 0)) {
      uVar2 = FUN_14014f0f0(DAT_140608bf8);
      FUN_140156df0(uVar2);
    }
    if ((DAT_140608bf8 == 0) &&
       (DAT_140608c30 = 0, _Memory = DAT_140608c28, DAT_140608c28 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608c28 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_14014f230(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x98) % (ulonglong)DAT_140608b20;
  if (param_1 != *(longlong *)(DAT_140608b10 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608b10 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x90); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x90))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x90) = *(undefined8 *)(param_1 + 0x90);
      FUN_14014f4b0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608b10 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x90);
  FUN_14014f4b0(param_1);
  return;
}



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

undefined8 FUN_14014f2d0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608b10 != (void *)0x0) {
    operator_delete__(DAT_140608b10);
    DAT_140608b10 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608b10 = operator_new(_Var1);
    if (DAT_140608b10 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608b10,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608b2c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608b28;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608b38 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608b38 = 0;
  }
  DAT_140608b30 = (longlong)fVar4 + lVar2;
  DAT_140608b20 = param_1;
  return CONCAT71((int7)(DAT_140608b38 >> 8),1);
}



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

uint FUN_14014f420(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608b24;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_14014f4b0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x90) = DAT_140608b50;
    DAT_140608b18 = DAT_140608b18 - 1;
    DAT_140608b50 = param_1;
    if ((DAT_140608b18 < DAT_140608b38) && (DAT_140608b40 == 0)) {
      uVar2 = FUN_14014f420(DAT_140608b18);
      FUN_140157130(uVar2);
    }
    if ((DAT_140608b18 == 0) &&
       (DAT_140608b50 = 0, _Memory = DAT_140608b48, DAT_140608b48 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608b48 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_14014f560(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608af0 = DAT_140608af0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608ac0;
  if ((DAT_140608ac0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608ad0, DAT_140608ad0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x18);
        FUN_1401579b0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608ac0;
        uVar4 = DAT_140608ad0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608ac0 = (void *)0x0;
  DAT_140608ac8 = 0;
  if (DAT_140608af0 == 0) {
    uVar5 = FUN_1401577c0(0);
    FUN_140157490(uVar5,0);
  }
  DAT_140608b00 = 0;
  _Memory = DAT_140608af8;
  if (DAT_140608af8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608af8 = (longlong *)0x0;
    DAT_140608af0 = DAT_140608af0 + -1;
    return;
  }
  DAT_140608af0 = DAT_140608af0 + -1;
  return;
}



void FUN_14014f660(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x20) % (ulonglong)DAT_140608ad0;
  if (param_1 != *(longlong *)(DAT_140608ac0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608ac0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x18); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x18))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x18) = *(undefined8 *)(param_1 + 0x18);
      FUN_1401579b0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608ac0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x18);
  FUN_1401579b0(param_1);
  return;
}



void FUN_14014f6e0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608940 = DAT_140608940 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608910;
  if ((DAT_140608910 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608920, DAT_140608920 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x78);
        FUN_140157fb0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608910;
        uVar4 = DAT_140608920;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608910 = (void *)0x0;
  DAT_140608918 = 0;
  if (DAT_140608940 == 0) {
    uVar5 = FUN_140157d90(0);
    FUN_140157a60(uVar5,0);
  }
  DAT_140608950 = 0;
  _Memory = DAT_140608948;
  if (DAT_140608948 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608948 = (longlong *)0x0;
    DAT_140608940 = DAT_140608940 + -1;
    return;
  }
  DAT_140608940 = DAT_140608940 + -1;
  return;
}



void FUN_14014f7e0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x80) % (ulonglong)DAT_140608920;
  if (param_1 != *(longlong *)(DAT_140608910 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608910 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x78); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x78))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x78) = *(undefined8 *)(param_1 + 0x78);
      FUN_140157fb0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608910 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x78);
  FUN_140157fb0(param_1);
  return;
}



void FUN_14014f860(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_1406088f0 = DAT_1406088f0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_1406088c0;
  if ((DAT_1406088c0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_1406088d0, DAT_1406088d0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x38);
        FUN_1401585c0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_1406088c0;
        uVar4 = DAT_1406088d0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_1406088c0 = (void *)0x0;
  DAT_1406088c8 = 0;
  if (DAT_1406088f0 == 0) {
    uVar5 = FUN_1401583d0(0);
    FUN_1401580a0(uVar5,0);
  }
  DAT_140608900 = 0;
  _Memory = DAT_1406088f8;
  if (DAT_1406088f8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_1406088f8 = (longlong *)0x0;
    DAT_1406088f0 = DAT_1406088f0 + -1;
    return;
  }
  DAT_1406088f0 = DAT_1406088f0 + -1;
  return;
}



void FUN_14014f960(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x40) % (ulonglong)DAT_1406088d0;
  if (param_1 != *(longlong *)(DAT_1406088c0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_1406088c0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x38); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x38))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x38) = *(undefined8 *)(param_1 + 0x38);
      FUN_1401585c0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_1406088c0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x38);
  FUN_1401585c0(param_1);
  return;
}



void FUN_14014f9e0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_1406088a0 = DAT_1406088a0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608870;
  if ((DAT_140608870 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608880, DAT_140608880 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xc0);
        FUN_140158c00(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608870;
        uVar4 = DAT_140608880;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608870 = (void *)0x0;
  DAT_140608878 = 0;
  if (DAT_1406088a0 == 0) {
    uVar5 = FUN_1401589a0(0);
    FUN_140158670(uVar5,0);
  }
  DAT_1406088b0 = 0;
  _Memory = DAT_1406088a8;
  if (DAT_1406088a8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_1406088a8 = (longlong *)0x0;
    DAT_1406088a0 = DAT_1406088a0 + -1;
    return;
  }
  DAT_1406088a0 = DAT_1406088a0 + -1;
  return;
}



void FUN_14014fae0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 200) % (ulonglong)DAT_140608880;
  if (param_1 != *(longlong *)(DAT_140608870 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608870 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xc0); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xc0))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xc0) = *(undefined8 *)(param_1 + 0xc0);
      FUN_140158c00(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608870 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xc0);
  FUN_140158c00(param_1);
  return;
}



void FUN_14014fb80(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608850 = DAT_140608850 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608820;
  if ((DAT_140608820 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608830, DAT_140608830 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xd0);
        FUN_140159260(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608820;
        uVar4 = DAT_140608830;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608820 = (void *)0x0;
  DAT_140608828 = 0;
  if (DAT_140608850 == 0) {
    uVar5 = FUN_140158fe0(0);
    FUN_140158cb0(uVar5,0);
  }
  DAT_140608860 = 0;
  _Memory = DAT_140608858;
  if (DAT_140608858 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608858 = (longlong *)0x0;
    DAT_140608850 = DAT_140608850 + -1;
    return;
  }
  DAT_140608850 = DAT_140608850 + -1;
  return;
}



void FUN_14014fc80(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0xd8) % (ulonglong)DAT_140608830;
  if (param_1 != *(longlong *)(DAT_140608820 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608820 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xd0); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xd0))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xd0) = *(undefined8 *)(param_1 + 0xd0);
      FUN_140159260(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608820 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xd0);
  FUN_140159260(param_1);
  return;
}



void FUN_14014fd20(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608800 = DAT_140608800 + 1;
  uVar7 = 0;
  pvVar6 = DAT_1406087d0;
  if ((DAT_1406087d0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_1406087e0, DAT_1406087e0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x20);
        FUN_140159840(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_1406087d0;
        uVar4 = DAT_1406087e0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_1406087d0 = (void *)0x0;
  DAT_1406087d8 = 0;
  if (DAT_140608800 == 0) {
    uVar5 = FUN_140159640(0);
    FUN_140159310(uVar5,0);
  }
  DAT_140608810 = 0;
  _Memory = DAT_140608808;
  if (DAT_140608808 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608808 = (longlong *)0x0;
    DAT_140608800 = DAT_140608800 + -1;
    return;
  }
  DAT_140608800 = DAT_140608800 + -1;
  return;
}



void FUN_14014fe20(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x28) % (ulonglong)DAT_1406087e0;
  if (param_1 != *(longlong *)(DAT_1406087d0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_1406087d0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x20); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x20))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x20) = *(undefined8 *)(param_1 + 0x20);
      FUN_140159840(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_1406087d0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x20);
  FUN_140159840(param_1);
  return;
}



longlong FUN_14014fea0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  uint uVar3;
  
  if (param_2 == 0) {
    return 0;
  }
  lVar2 = *(longlong *)(param_2 + 0x18);
  if (lVar2 == 0) {
    uVar3 = *(uint *)(param_2 + 0x20) % *(uint *)(param_1 + 2) + 1;
    lVar1 = (longlong)(int)uVar3 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar3) {
        return lVar2;
      }
      if (*(longlong *)(lVar1 + *param_1) != 0) {
        lVar2 = *(longlong *)(lVar1 + *param_1);
      }
      uVar3 = uVar3 + 1;
      lVar1 = lVar1 + 8;
    } while (lVar2 == 0);
  }
  return lVar2;
}



void FUN_14014ff00(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[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_14014ffb0(longlong *param_1,longlong *param_2,undefined8 param_3,longlong param_4)

{
  undefined8 *puVar1;
  char cVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  longlong *local_48;
  undefined8 *local_40;
  undefined2 local_38;
  
  uVar7 = 0xfffffffffffffffe;
  uVar3 = FUN_14015afa0(param_3);
  puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
  lVar4 = FUN_1402cb0b0(puVar6,param_3);
  if (lVar4 == 0) {
    local_40 = (undefined8 *)0x0;
    local_38 = 0;
    local_48 = param_1;
    FUN_14015ad60(&local_48);
    puVar1 = local_40;
    puVar5 = local_40 + 1;
    if (puVar5 != (undefined8 *)0x0) {
      local_40[4] = 7;
      local_40[3] = 0;
      *(undefined2 *)puVar5 = 0;
      FUN_1400015e0(puVar5,param_4,0,0xffffffffffffffff,uVar7,puVar5);
      *(undefined4 *)(puVar1 + 6) = *(undefined4 *)(param_4 + 0x28);
    }
    local_38 = CONCAT11(1,(undefined1)local_38);
    cVar2 = FUN_1401598f0(param_1);
    if (cVar2 != '\0') {
      puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
    }
    *puVar1 = *puVar6;
    *puVar6 = puVar1;
    param_1[4] = param_1[4] + 1;
    puVar5 = (undefined8 *)param_1[6];
    if (puVar6 < (undefined8 *)param_1[6]) {
      puVar5 = puVar6;
    }
    param_1[6] = (longlong)puVar5;
    *param_2 = (longlong)puVar6;
    param_2[1] = (longlong)puVar1;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)puVar6;
    param_2[1] = lVar4;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



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

{
  undefined8 **ppuVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined8 **ppuVar6;
  undefined8 *local_res8;
  undefined8 *local_res10;
  undefined8 uVar7;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  uVar7 = 0xfffffffffffffffe;
  local_38 = (undefined8 *)0x0;
  local_30 = 0;
  local_40 = param_1;
  FUN_14015ad60(&local_40);
  puVar3 = local_38;
  puVar2 = local_38 + 1;
  local_res8 = puVar2;
  local_res10 = puVar2;
  if (puVar2 != (undefined8 *)0x0) {
    local_38[4] = 7;
    local_38[3] = 0;
    *(undefined2 *)puVar2 = 0;
    FUN_1400015e0(puVar2,param_3,0,0xffffffffffffffff,uVar7);
    *(undefined4 *)(puVar3 + 6) = *(undefined4 *)(param_3 + 0x28);
  }
  local_30 = CONCAT11(1,(undefined1)local_30);
  uVar4 = FUN_14015afa0(puVar2);
  if (*param_1 == 0) {
    local_res8 = (undefined8 *)FUN_1402c9710(param_1,1);
    ppuVar1 = (undefined8 **)(param_1 + 1);
    ppuVar6 = &local_res8;
    if (local_res8 <= *ppuVar1) {
      ppuVar6 = ppuVar1;
    }
    *ppuVar1 = *ppuVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else {
    local_res10 = (undefined8 *)0x1;
    if ((ulonglong)param_1[7] < 2) {
      local_res8 = (undefined8 *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      lVar5 = FUN_1402c9710(param_1);
      if (lVar5 != param_1[1]) {
        FUN_14015aae0(param_1);
      }
    }
  }
  puVar2 = (undefined8 *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar3 = *puVar2;
  *puVar2 = puVar3;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)puVar2;
  *param_2 = (longlong)puVar2;
  param_2[1] = (longlong)puVar3;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



undefined4 * FUN_140150260(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  *(undefined8 *)(param_1 + 0x2e) = 7;
  *(undefined8 *)(param_1 + 0x2c) = 0;
  *(undefined2 *)(param_1 + 0x28) = 0;
  FUN_1400015e0(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff);
  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;
}



undefined4 * FUN_1401503f0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(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_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  param_1[0x16] = param_2[0x16];
  FUN_14012e520(param_1 + 0x18,param_2 + 0x18);
  param_1[0x20] = param_2[0x20];
  param_1[0x21] = param_2[0x21];
  param_1[0x22] = param_2[0x22];
  param_1[0x23] = param_2[0x23];
  *(undefined8 *)(param_1 + 0x2a) = 7;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined2 *)(param_1 + 0x24) = 0;
  FUN_1400015e0(param_1 + 0x24,param_2 + 0x24,0,0xffffffffffffffff);
  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];
  param_1[0x36] = param_2[0x36];
  param_1[0x37] = param_2[0x37];
  param_1[0x38] = param_2[0x38];
  param_1[0x39] = param_2[0x39];
  param_1[0x3a] = param_2[0x3a];
  param_1[0x3b] = param_2[0x3b];
  param_1[0x3c] = param_2[0x3c];
  param_1[0x3d] = param_2[0x3d];
  param_1[0x3e] = param_2[0x3e];
  param_1[0x3f] = param_2[0x3f];
  param_1[0x40] = param_2[0x40];
  param_1[0x41] = param_2[0x41];
  param_1[0x42] = param_2[0x42];
  param_1[0x43] = param_2[0x43];
  param_1[0x44] = param_2[0x44];
  param_1[0x45] = param_2[0x45];
  param_1[0x46] = param_2[0x46];
  param_1[0x47] = param_2[0x47];
  param_1[0x48] = param_2[0x48];
  param_1[0x49] = param_2[0x49];
  param_1[0x4a] = param_2[0x4a];
  param_1[0x4b] = param_2[0x4b];
  *(undefined8 *)(param_1 + 0x4c) = *(undefined8 *)(param_2 + 0x4c);
  param_1[0x4e] = param_2[0x4e];
  param_1[0x4f] = param_2[0x4f];
  param_1[0x50] = param_2[0x50];
  param_1[0x51] = param_2[0x51];
  param_1[0x52] = param_2[0x52];
  param_1[0x53] = param_2[0x53];
  param_1[0x54] = param_2[0x54];
  param_1[0x55] = param_2[0x55];
  param_1[0x56] = param_2[0x56];
  param_1[0x57] = param_2[0x57];
  param_1[0x58] = param_2[0x58];
  param_1[0x59] = param_2[0x59];
  param_1[0x5a] = param_2[0x5a];
  param_1[0x5b] = param_2[0x5b];
  param_1[0x5c] = param_2[0x5c];
  param_1[0x5d] = param_2[0x5d];
  param_1[0x5e] = param_2[0x5e];
  param_1[0x5f] = param_2[0x5f];
  param_1[0x60] = param_2[0x60];
  param_1[0x61] = param_2[0x61];
  param_1[0x62] = param_2[0x62];
  param_1[99] = param_2[99];
  param_1[100] = param_2[100];
  *(undefined8 *)(param_1 + 0x65) = *(undefined8 *)(param_2 + 0x65);
  *(undefined8 *)(param_1 + 0x67) = *(undefined8 *)(param_2 + 0x67);
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x6e) = 0;
  *(undefined2 *)(param_1 + 0x6a) = 0;
  FUN_1400015e0(param_1 + 0x6a,param_2 + 0x6a,0,0xffffffffffffffff);
  param_1[0x74] = param_2[0x74];
  param_1[0x75] = param_2[0x75];
  param_1[0x76] = param_2[0x76];
  param_1[0x77] = param_2[0x77];
  param_1[0x78] = param_2[0x78];
  param_1[0x79] = param_2[0x79];
  param_1[0x7a] = param_2[0x7a];
  param_1[0x7b] = param_2[0x7b];
  param_1[0x7c] = param_2[0x7c];
  param_1[0x7d] = param_2[0x7d];
  param_1[0x7e] = param_2[0x7e];
  param_1[0x7f] = param_2[0x7f];
  FUN_14012e520(param_1 + 0x80,param_2 + 0x80);
  param_1[0x88] = param_2[0x88];
  param_1[0x89] = param_2[0x89];
  FUN_14012e520(param_1 + 0x8a,param_2 + 0x8a);
  FUN_14012e520(param_1 + 0x92,param_2 + 0x92);
  FUN_14012e520(param_1 + 0x9a,param_2 + 0x9a);
  param_1[0xa2] = param_2[0xa2];
  return param_1;
}



undefined4 * FUN_1401508c0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(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_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  param_1[0x16] = param_2[0x16];
  *(undefined8 *)(param_1 + 0x1e) = 7;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  *(undefined2 *)(param_1 + 0x18) = 0;
  FUN_1400015e0(param_1 + 0x18,param_2 + 0x18,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x26) = 0;
  *(undefined2 *)(param_1 + 0x22) = 0;
  FUN_1400015e0(param_1 + 0x22,param_2 + 0x22,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x32) = 7;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined2 *)(param_1 + 0x2c) = 0;
  FUN_1400015e0(param_1 + 0x2c,param_2 + 0x2c,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x3c) = 7;
  *(undefined8 *)(param_1 + 0x3a) = 0;
  *(undefined2 *)(param_1 + 0x36) = 0;
  FUN_1400015e0(param_1 + 0x36,param_2 + 0x36,0,0xffffffffffffffff);
  return param_1;
}



undefined4 * FUN_1401509f0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff,0xfffffffffffffffe);
  FUN_14012e520(param_1 + 0xc,param_2 + 0xc);
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  param_1[0x16] = param_2[0x16];
  FUN_14012e520(param_1 + 0x18,param_2 + 0x18);
  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];
  param_1[0x36] = param_2[0x36];
  param_1[0x37] = param_2[0x37];
  param_1[0x38] = param_2[0x38];
  return param_1;
}



undefined4 * FUN_140150bb0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff,0xfffffffffffffffe);
  FUN_14012e520(param_1 + 0xc,param_2 + 0xc);
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  return param_1;
}



undefined4 *
FUN_140150d00(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  *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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  FUN_14012e520(param_1 + 0xc,param_2 + 0xc,param_3,param_4,0xfffffffffffffffe);
  FUN_14012e520(param_1 + 0x14,param_2 + 0x14);
  return param_1;
}



undefined8 *
FUN_140150d90(longlong *param_1,undefined8 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined8 *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) < 0x30)
      goto LAB_140150e57;
      lVar7 = uVar6 * 0x30;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_140150e57:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 6 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[4] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -6;
    }
  }
  puVar2 = (undefined8 *)param_1[8];
  if (puVar2 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = puVar2[4];
  *puVar2 = param_2;
  puVar2[1] = 0;
  puVar2[2] = 0;
  puVar2[3] = 0;
  *(undefined4 *)(puVar2 + 5) = param_4;
  param_1[1] = param_1[1] + 1;
  puVar2[4] = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined8 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_1402cddb0(param_1);
    FUN_1402dab20(param_1,uVar4);
  }
  return puVar2;
}



void FUN_140150f00(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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_1401510b0(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) < 0xf0)
      goto LAB_14015117d;
      lVar7 = uVar6 * 0xf0;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14015117d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x1e + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x1c] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x1e;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x38);
  *puVar2 = param_2;
  FUN_14015b330(puVar2 + 2);
  puVar2[0x3a] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x38) = *(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_1402cddb0(param_1);
    FUN_140150f00(param_1,uVar4);
  }
  return puVar2;
}



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

void FUN_140151230(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_14014cd80(DAT_140609258,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140609260) {
    if (DAT_140609250 == (void *)0x0) {
      FUN_14014cc30(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140609260;
      if (DAT_140609260 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140609250);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x18);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x20) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x18) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140609260;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140609250);
      fVar10 = (float)param_1 * _DAT_14060926c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140609270 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140609268;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140609250 = _Dst;
      DAT_140609260 = param_1;
      DAT_140609278 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140609278 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_140151410(undefined8 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140609290 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140609284);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x28)
      goto LAB_1401514da;
      lVar7 = uVar8 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_1401514da:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140609288;
    puVar4 = puVar6 + (ulonglong)(DAT_140609284 - 1) * 5 + 2;
    DAT_140609288 = puVar6;
    uVar2 = DAT_140609284;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[3] = DAT_140609290;
      puVar4 = puVar6 + -5;
      DAT_140609290 = puVar6;
    }
  }
  puVar6 = DAT_140609290;
  if (DAT_140609290 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140609290[3];
  *DAT_140609290 = param_1;
  DAT_140609290 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 4) = param_3;
  DAT_140609258 = DAT_140609258 + 1;
  puVar6[3] = *(undefined8 *)(DAT_140609250 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140609250 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140609270 < DAT_140609258) && (DAT_140609280 == 0)) {
    uVar5 = FUN_14014cd80();
    FUN_140151230(uVar5);
  }
  return puVar6;
}



undefined8 *
FUN_140151570(longlong *param_1,undefined8 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined8 *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) < 0x48)
      goto LAB_140151637;
      lVar7 = uVar6 * 0x48;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_140151637:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 9 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[7] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -9;
    }
  }
  puVar2 = (undefined8 *)param_1[8];
  if (puVar2 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = puVar2[7];
  *puVar2 = param_2;
  *(undefined4 *)(puVar2 + 8) = param_4;
  param_1[1] = param_1[1] + 1;
  puVar2[7] = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined8 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_1402cddb0(param_1);
    FUN_14025e8b0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1401516d0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x30);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x38) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x30) = *(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_140151880(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) < 0x40)
      goto LAB_140151947;
      lVar7 = uVar6 << 6;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_140151947:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 8 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[6] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -8;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0xc);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 8) = 7;
  *(undefined8 *)(puVar2 + 6) = 0;
  *(undefined2 *)(puVar2 + 2) = 0;
  puVar2[0xe] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0xc) = *(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_1402cddb0(param_1);
    FUN_1401516d0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1401519f0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x298);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x2a0) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x298) = *(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_140151ba0(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) < 0x2a8)
      goto LAB_140151c6d;
      lVar7 = uVar6 * 0x2a8;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_140151c6d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x55 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x53] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x55;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0xa6);
  *puVar2 = param_2;
  FUN_140132150(puVar2 + 2);
  puVar2[0xa8] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0xa6) = *(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_1402cddb0(param_1);
    FUN_1401519f0(param_1,uVar4);
  }
  return puVar2;
}



undefined4 *
FUN_140151d10(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) < 0x90)
      goto LAB_140151ddd;
      lVar7 = uVar6 * 0x90;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_140151ddd:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x12 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x10] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x12;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x20);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 10) = 7;
  *(undefined8 *)(puVar2 + 8) = 0;
  *(undefined2 *)(puVar2 + 4) = 0;
  *(undefined8 *)(puVar2 + 0x14) = 7;
  *(undefined8 *)(puVar2 + 0x12) = 0;
  *(undefined2 *)(puVar2 + 0xe) = 0;
  puVar2[0x22] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x20) = *(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_1402cddb0(param_1);
    FUN_1402db240(param_1,uVar4);
  }
  return puVar2;
}



void FUN_140151ea0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x108);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x110) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x108) = *(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_140152050(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) < 0x118)
      goto LAB_14015211d;
      lVar7 = uVar6 * 0x118;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14015211d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x23 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x21] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x23;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x42);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 10) = 7;
  *(undefined8 *)(puVar2 + 8) = 0;
  *(undefined2 *)(puVar2 + 4) = 0;
  *(undefined8 *)(puVar2 + 0x14) = 7;
  *(undefined8 *)(puVar2 + 0x12) = 0;
  *(undefined2 *)(puVar2 + 0xe) = 0;
  *(undefined8 *)(puVar2 + 0x20) = 7;
  *(undefined8 *)(puVar2 + 0x1e) = 0;
  *(undefined2 *)(puVar2 + 0x1a) = 0;
  *(undefined8 *)(puVar2 + 0x2a) = 7;
  *(undefined8 *)(puVar2 + 0x28) = 0;
  *(undefined2 *)(puVar2 + 0x24) = 0;
  *(undefined8 *)(puVar2 + 0x34) = 7;
  *(undefined8 *)(puVar2 + 0x32) = 0;
  *(undefined2 *)(puVar2 + 0x2e) = 0;
  *(undefined8 *)(puVar2 + 0x3e) = 7;
  *(undefined8 *)(puVar2 + 0x3c) = 0;
  *(undefined2 *)(puVar2 + 0x38) = 0;
  puVar2[0x44] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x42) = *(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_1402cddb0(param_1);
    FUN_140151ea0(param_1,uVar4);
  }
  return puVar2;
}



undefined4 *
FUN_140152240(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) < 0x48)
      goto LAB_1401522f7;
      lVar7 = uVar6 * 0x48;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401522f7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 9 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[7] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -9;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0xe);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 6) = 0;
  *(undefined8 *)(puVar2 + 8) = 0;
  *(undefined8 *)(puVar2 + 10) = 0;
  puVar2[0x10] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0xe) = *(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_1402cddb0(param_1);
    FUN_14025e8b0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1401523a0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(void **)(param_2 + 0x18) != (void *)0x0) {
    operator_delete(*(void **)(param_2 + 0x18));
  }
  *(undefined8 *)(param_2 + 0x18) = 0;
  *(undefined8 *)(param_2 + 0x20) = 0;
  *(undefined8 *)(param_2 + 0x28) = 0;
  *(undefined8 *)(param_2 + 0x38) = *(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_1402cddb0(param_1);
    FUN_14025e8b0(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;
}



undefined8 * FUN_140152450(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_14015a0c0(param_2,plVar2,param_3 + -1);
  plVar6 = plVar2 + 1;
  while (plVar8 = plVar2, param_2 < plVar8) {
    if ((*(int *)(plVar8[-1] + 0x100) < *(int *)(*plVar8 + 0x100)) ||
       (plVar2 = plVar8 + -1, *(int *)(*plVar8 + 0x100) < *(int *)(plVar8[-1] + 0x100))) break;
  }
  plVar2 = plVar6;
  plVar5 = plVar8;
  if (plVar6 < param_3) {
    do {
      plVar2 = plVar6;
      if ((*(int *)(*plVar6 + 0x100) < *(int *)(*plVar8 + 0x100)) ||
         (*(int *)(*plVar8 + 0x100) < *(int *)(*plVar6 + 0x100))) break;
      plVar6 = plVar6 + 1;
      plVar2 = plVar6;
    } while (plVar6 < param_3);
  }
joined_r0x000140152503:
  do {
    plVar1 = plVar8;
    if (param_3 <= plVar6) {
joined_r0x000140152544:
      while (plVar8 = plVar1, param_2 < plVar8) {
        plVar1 = plVar8 + -1;
        if (*(int *)(*plVar5 + 0x100) <= *(int *)(plVar8[-1] + 0x100)) {
          if (*(int *)(*plVar5 + 0x100) < *(int *)(plVar8[-1] + 0x100)) 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_r0x000140152503;
    }
    iVar3 = *(int *)(*plVar6 + 0x100);
    plVar7 = plVar2;
    if (iVar3 <= *(int *)(*plVar5 + 0x100)) {
      if (iVar3 < *(int *)(*plVar5 + 0x100)) goto joined_r0x000140152544;
      plVar7 = plVar2 + 1;
      lVar4 = *plVar2;
      *plVar2 = *plVar6;
      *plVar6 = lVar4;
    }
    plVar6 = plVar6 + 1;
    plVar2 = plVar7;
  } while( true );
}



undefined8 * FUN_140152630(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_14015a5d0(param_2,plVar2,param_3 + -1);
  plVar6 = plVar2 + 1;
  while (plVar8 = plVar2, param_2 < plVar8) {
    if ((*(int *)(plVar8[-1] + 0x108) < *(int *)(*plVar8 + 0x108)) ||
       (plVar2 = plVar8 + -1, *(int *)(*plVar8 + 0x108) < *(int *)(plVar8[-1] + 0x108))) break;
  }
  plVar2 = plVar6;
  plVar5 = plVar8;
  if (plVar6 < param_3) {
    do {
      plVar2 = plVar6;
      if ((*(int *)(*plVar6 + 0x108) < *(int *)(*plVar8 + 0x108)) ||
         (*(int *)(*plVar8 + 0x108) < *(int *)(*plVar6 + 0x108))) break;
      plVar6 = plVar6 + 1;
      plVar2 = plVar6;
    } while (plVar6 < param_3);
  }
joined_r0x0001401526e3:
  do {
    plVar1 = plVar8;
    if (param_3 <= plVar6) {
joined_r0x000140152724:
      while (plVar8 = plVar1, param_2 < plVar8) {
        plVar1 = plVar8 + -1;
        if (*(int *)(*plVar5 + 0x108) <= *(int *)(plVar8[-1] + 0x108)) {
          if (*(int *)(*plVar5 + 0x108) < *(int *)(plVar8[-1] + 0x108)) 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_r0x0001401526e3;
    }
    iVar3 = *(int *)(*plVar6 + 0x108);
    plVar7 = plVar2;
    if (iVar3 <= *(int *)(*plVar5 + 0x108)) {
      if (iVar3 < *(int *)(*plVar5 + 0x108)) goto joined_r0x000140152724;
      plVar7 = plVar2 + 1;
      lVar4 = *plVar2;
      *plVar2 = *plVar6;
      *plVar6 = lVar4;
    }
    plVar6 = plVar6 + 1;
    plVar2 = plVar7;
  } while( true );
}



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

undefined8 FUN_140152810(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140609160 != (void *)0x0) {
    operator_delete__(DAT_140609160);
    DAT_140609160 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140609160 = operator_new(_Var1);
    if (DAT_140609160 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140609160,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060917c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140609178;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140609188 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140609188 = 0;
  }
  DAT_140609180 = (longlong)fVar4 + lVar2;
  DAT_140609170 = param_1;
  return CONCAT71((int7)(DAT_140609188 >> 8),1);
}



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

void FUN_140152960(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140152b40(DAT_140609168,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140609170) {
    if (DAT_140609160 == (void *)0x0) {
      FUN_140152810(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140609170;
      if (DAT_140609170 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140609160);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xf0);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0xf8) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xf0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140609170;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140609160);
      fVar10 = (float)param_1 * _DAT_14060917c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140609180 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140609178;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140609160 = _Dst;
      DAT_140609170 = param_1;
      DAT_140609188 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140609188 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140152b40(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140609174;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140152bd0(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_1406091a0 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140609194);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x100)
      goto LAB_140152c9e;
      lVar8 = uVar7 << 8;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140152c9e:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140609198;
    puVar4 = puVar6 + (ulonglong)(DAT_140609194 - 1) * 0x20 + 2;
    DAT_140609198 = puVar6;
    uVar2 = DAT_140609194;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x1e] = DAT_1406091a0;
      puVar4 = puVar6 + -0x20;
      DAT_1406091a0 = puVar6;
    }
  }
  puVar6 = DAT_1406091a0;
  if (DAT_1406091a0 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_1406091a0[0x1e];
  *(undefined4 *)DAT_1406091a0 = param_1;
  DAT_1406091a0 = (undefined8 *)uVar3;
  puVar6[5] = 7;
  puVar6[4] = 0;
  *(undefined2 *)(puVar6 + 2) = 0;
  puVar6[7] = 0;
  puVar6[8] = 0;
  puVar6[9] = 0;
  puVar6[0xd] = 0;
  puVar6[0xe] = 0;
  puVar6[0xf] = 0;
  *(undefined4 *)(puVar6 + 0x1f) = param_3;
  DAT_140609168 = DAT_140609168 + 1;
  puVar6[0x1e] = *(undefined8 *)(DAT_140609160 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140609160 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140609180 < DAT_140609168) && (DAT_140609190 == 0)) {
    uVar5 = FUN_140152b40();
    FUN_140152960(uVar5);
  }
  return puVar6;
}



void FUN_140152d70(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_140138fb0(param_1 + 8);
    *(longlong *)(param_1 + 0xf0) = DAT_1406091a0;
    DAT_140609168 = DAT_140609168 - 1;
    DAT_1406091a0 = param_1;
    if ((DAT_140609168 < DAT_140609188) && (DAT_140609190 == 0)) {
      uVar2 = FUN_140152b40(DAT_140609168);
      FUN_140152960(uVar2);
    }
    if ((DAT_140609168 == 0) &&
       (DAT_1406091a0 = 0, _Memory = DAT_140609198, DAT_140609198 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140609198 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_140152e20(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(void **)(param_2 + 8) != (void *)0x0) {
    operator_delete(*(void **)(param_2 + 8));
  }
  *(undefined8 *)(param_2 + 8) = 0;
  *(undefined8 *)(param_2 + 0x10) = 0;
  *(undefined8 *)(param_2 + 0x18) = 0;
  *(undefined8 *)(param_2 + 0x28) = *(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_1402cddb0(param_1);
    FUN_1402da810(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;
}



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

undefined8 FUN_140152ed0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140609110 != (void *)0x0) {
    operator_delete__(DAT_140609110);
    DAT_140609110 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140609110 = operator_new(_Var1);
    if (DAT_140609110 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140609110,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060912c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140609128;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140609138 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140609138 = 0;
  }
  DAT_140609130 = (longlong)fVar4 + lVar2;
  DAT_140609120 = param_1;
  return CONCAT71((int7)(DAT_140609138 >> 8),1);
}



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

void FUN_140153020(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140153200(DAT_140609118,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140609120) {
    if (DAT_140609110 == (void *)0x0) {
      FUN_140152ed0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140609120;
      if (DAT_140609120 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140609110);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x60);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x68) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x60) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140609120;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140609110);
      fVar10 = (float)param_1 * _DAT_14060912c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140609130 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140609128;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140609110 = _Dst;
      DAT_140609120 = param_1;
      DAT_140609138 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140609138 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140153200(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140609124;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140153290(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140609150 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140609144);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x70)
      goto LAB_140153359;
      lVar8 = uVar7 * 0x70;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140153359:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140609148;
    puVar4 = puVar6 + (ulonglong)(DAT_140609144 - 1) * 0xe + 2;
    DAT_140609148 = puVar6;
    uVar2 = DAT_140609144;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0xc] = DAT_140609150;
      puVar4 = puVar6 + -0xe;
      DAT_140609150 = puVar6;
    }
  }
  puVar6 = DAT_140609150;
  if (DAT_140609150 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140609150[0xc];
  *(undefined4 *)DAT_140609150 = param_1;
  DAT_140609150 = (undefined8 *)uVar3;
  puVar6[5] = 7;
  puVar6[4] = 0;
  *(undefined2 *)(puVar6 + 2) = 0;
  *(undefined4 *)(puVar6 + 0xd) = param_3;
  DAT_140609118 = DAT_140609118 + 1;
  puVar6[0xc] = *(undefined8 *)(DAT_140609110 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140609110 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140609130 < DAT_140609118) && (DAT_140609140 == 0)) {
    uVar5 = FUN_140153200();
    FUN_140153020(uVar5);
  }
  return puVar6;
}



void FUN_140153400(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(longlong *)(param_1 + 0x60) = DAT_140609150;
  DAT_140609118 = DAT_140609118 - 1;
  DAT_140609150 = param_1;
  if ((DAT_140609118 < DAT_140609138) && (DAT_140609140 == 0)) {
    uVar2 = FUN_140153200(DAT_140609118);
    FUN_140153020(uVar2);
  }
  if (DAT_140609118 == 0) {
    DAT_140609150 = 0;
    _Memory = DAT_140609148;
    if (DAT_140609148 != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140609148 = (longlong *)0x0;
    }
  }
  return;
}



void FUN_1401534d0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x90);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x98) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x90) = *(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_140153680(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) < 0xa0)
      goto LAB_14015374d;
      lVar7 = uVar6 * 0xa0;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14015374d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x14 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x12] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x14;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x24);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 8) = 0;
  *(undefined8 *)(puVar2 + 10) = 0;
  *(undefined8 *)(puVar2 + 0xc) = 0;
  *(undefined8 *)(puVar2 + 0x10) = 0;
  *(undefined8 *)(puVar2 + 0x12) = 0;
  *(undefined8 *)(puVar2 + 0x14) = 0;
  *(undefined8 *)(puVar2 + 0x18) = 0;
  *(undefined8 *)(puVar2 + 0x1a) = 0;
  *(undefined8 *)(puVar2 + 0x1c) = 0;
  puVar2[0x26] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x24) = *(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_1402cddb0(param_1);
    FUN_1401534d0(param_1,uVar4);
  }
  return puVar2;
}



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

undefined8 FUN_140153810(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_1406090c0 != (void *)0x0) {
    operator_delete__(DAT_1406090c0);
    DAT_1406090c0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_1406090c0 = operator_new(_Var1);
    if (DAT_1406090c0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_1406090c0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_1406090dc;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_1406090d8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_1406090e8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_1406090e8 = 0;
  }
  DAT_1406090e0 = (longlong)fVar4 + lVar2;
  DAT_1406090d0 = param_1;
  return CONCAT71((int7)(DAT_1406090e8 >> 8),1);
}



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

void FUN_140153960(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140153b40(DAT_1406090c8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_1406090d0) {
    if (DAT_1406090c0 == (void *)0x0) {
      FUN_140153810(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_1406090d0;
      if (DAT_1406090d0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_1406090c0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x78);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x80) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x78) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_1406090d0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_1406090c0);
      fVar10 = (float)param_1 * _DAT_1406090dc;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406090e0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_1406090d8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406090c0 = _Dst;
      DAT_1406090d0 = param_1;
      DAT_1406090e8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_1406090e8 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140153b40(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_1406090d4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140153bd0(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140609100 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_1406090f4);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x88)
      goto LAB_140153cab;
      lVar8 = uVar7 * 0x88;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140153cab:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_1406090f8;
    puVar4 = puVar6 + (ulonglong)(DAT_1406090f4 - 1) * 0x11 + 2;
    DAT_1406090f8 = puVar6;
    uVar2 = DAT_1406090f4;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0xf] = DAT_140609100;
      puVar4 = puVar6 + -0x11;
      DAT_140609100 = puVar6;
    }
  }
  puVar6 = DAT_140609100;
  if (DAT_140609100 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140609100[0xf];
  *(undefined4 *)DAT_140609100 = param_1;
  DAT_140609100 = (undefined8 *)uVar3;
  puVar6[5] = 7;
  puVar6[4] = 0;
  *(undefined2 *)(puVar6 + 2) = 0;
  *(undefined4 *)(puVar6 + 0x10) = param_3;
  DAT_1406090c8 = DAT_1406090c8 + 1;
  puVar6[0xf] = *(undefined8 *)(DAT_1406090c0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_1406090c0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_1406090e0 < DAT_1406090c8) && (DAT_1406090f0 == 0)) {
    uVar5 = FUN_140153b40();
    FUN_140153960(uVar5);
  }
  return puVar6;
}



void FUN_140153d60(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(longlong *)(param_1 + 0x78) = DAT_140609100;
  DAT_1406090c8 = DAT_1406090c8 - 1;
  DAT_140609100 = param_1;
  if ((DAT_1406090c8 < DAT_1406090e8) && (DAT_1406090f0 == 0)) {
    uVar2 = FUN_140153b40(DAT_1406090c8);
    FUN_140153960(uVar2);
  }
  if (DAT_1406090c8 == 0) {
    DAT_140609100 = 0;
    _Memory = DAT_1406090f8;
    if (DAT_1406090f8 != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_1406090f8 = (longlong *)0x0;
    }
  }
  return;
}



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

undefined8 FUN_140153e30(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608f50 != (void *)0x0) {
    operator_delete__(DAT_140608f50);
    DAT_140608f50 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608f50 = operator_new(_Var1);
    if (DAT_140608f50 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608f50,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608f6c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608f68;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608f78 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608f78 = 0;
  }
  DAT_140608f70 = (longlong)fVar4 + lVar2;
  DAT_140608f60 = param_1;
  return CONCAT71((int7)(DAT_140608f78 >> 8),1);
}



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

void FUN_140153f80(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140154160(DAT_140608f58,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608f60) {
    if (DAT_140608f50 == (void *)0x0) {
      FUN_140153e30(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608f60;
      if (DAT_140608f60 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608f50);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xe0);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0xe8) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xe0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608f60;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608f50);
      fVar10 = (float)param_1 * _DAT_140608f6c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608f70 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608f68;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608f50 = _Dst;
      DAT_140608f60 = param_1;
      DAT_140608f78 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608f78 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140154160(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608f64;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_1401541f0(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608f90 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608f84);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xf0)
      goto LAB_1401542c1;
      lVar8 = uVar7 * 0xf0;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_1401542c1:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608f88;
    puVar4 = puVar6 + (ulonglong)(DAT_140608f84 - 1) * 0x1e + 2;
    DAT_140608f88 = puVar6;
    uVar2 = DAT_140608f84;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x1c] = DAT_140608f90;
      puVar4 = puVar6 + -0x1e;
      DAT_140608f90 = puVar6;
    }
  }
  puVar6 = DAT_140608f90;
  if (DAT_140608f90 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608f90[0x1c];
  *(undefined4 *)DAT_140608f90 = param_1;
  DAT_140608f90 = (undefined8 *)uVar3;
  puVar6[5] = 7;
  puVar6[4] = 0;
  *(undefined2 *)(puVar6 + 2) = 0;
  puVar6[10] = 7;
  puVar6[9] = 0;
  *(undefined2 *)(puVar6 + 7) = 0;
  puVar6[0xf] = 7;
  puVar6[0xe] = 0;
  *(undefined2 *)(puVar6 + 0xc) = 0;
  *(undefined4 *)(puVar6 + 0x1d) = param_3;
  DAT_140608f58 = DAT_140608f58 + 1;
  puVar6[0x1c] = *(undefined8 *)(DAT_140608f50 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608f50 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608f70 < DAT_140608f58) && (DAT_140608f80 == 0)) {
    uVar5 = FUN_140154160();
    FUN_140153f80(uVar5);
  }
  return puVar6;
}



void FUN_1401543a0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_14013c120(param_1 + 8);
    *(longlong *)(param_1 + 0xe0) = DAT_140608f90;
    DAT_140608f58 = DAT_140608f58 - 1;
    DAT_140608f90 = param_1;
    if ((DAT_140608f58 < DAT_140608f78) && (DAT_140608f80 == 0)) {
      uVar2 = FUN_140154160(DAT_140608f58);
      FUN_140153f80(uVar2);
    }
    if ((DAT_140608f58 == 0) &&
       (DAT_140608f90 = 0, _Memory = DAT_140608f88, DAT_140608f88 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608f88 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_140154450(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0xa8);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0xb0) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0xa8) = *(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_140154600(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) < 0xb8)
      goto LAB_1401546cd;
      lVar7 = uVar6 * 0xb8;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401546cd:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x17 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x15] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x17;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x2a);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 0xc) = 7;
  *(undefined8 *)(puVar2 + 10) = 0;
  *(undefined2 *)(puVar2 + 6) = 0;
  puVar2[0x2c] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x2a) = *(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_1402cddb0(param_1);
    FUN_140154450(param_1,uVar4);
  }
  return puVar2;
}



void FUN_140154780(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (7 < *(ulonglong *)(param_2 + 0x30)) {
    operator_delete(*(void **)(param_2 + 0x18));
  }
  *(undefined8 *)(param_2 + 0x30) = 7;
  *(undefined8 *)(param_2 + 0x28) = 0;
  *(undefined2 *)(param_2 + 0x18) = 0;
  *(undefined8 *)(param_2 + 0xa8) = *(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_1402cddb0(param_1);
    FUN_140154450(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;
}



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

undefined8 FUN_140154840(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608eb0 != (void *)0x0) {
    operator_delete__(DAT_140608eb0);
    DAT_140608eb0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608eb0 = operator_new(_Var1);
    if (DAT_140608eb0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608eb0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608ecc;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608ec8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608ed8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608ed8 = 0;
  }
  DAT_140608ed0 = (longlong)fVar4 + lVar2;
  DAT_140608ec0 = param_1;
  return CONCAT71((int7)(DAT_140608ed8 >> 8),1);
}



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

void FUN_140154990(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140154b70(DAT_140608eb8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608ec0) {
    if (DAT_140608eb0 == (void *)0x0) {
      FUN_140154840(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608ec0;
      if (DAT_140608ec0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608eb0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x118);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x120) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x118) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608ec0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608eb0);
      fVar10 = (float)param_1 * _DAT_140608ecc;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608ed0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608ec8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608eb0 = _Dst;
      DAT_140608ec0 = param_1;
      DAT_140608ed8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608ed8 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140154b70(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608ec4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 *
FUN_140154c00(undefined4 param_1,ulonglong param_2,ulonglong param_3,undefined8 param_4)

{
  undefined1 auVar1 [16];
  undefined8 uVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  int iVar6;
  ulonglong uVar7;
  longlong lVar8;
  undefined8 *puVar9;
  uint uVar10;
  undefined8 uVar11;
  
  uVar11 = 0xfffffffffffffffe;
  uVar7 = param_3;
  if (DAT_140608ef0 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608ee4);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x128)
      goto LAB_140154ce2;
      lVar8 = uVar7 * 0x128;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar5 = malloc(lVar8 + 0x10), puVar5 == (undefined8 *)0x0)) {
LAB_140154ce2:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar5 = DAT_140608ee8;
    puVar9 = puVar5 + (ulonglong)(DAT_140608ee4 - 1) * 0x25 + 2;
    DAT_140608ee8 = puVar5;
    uVar10 = DAT_140608ee4;
    while( true ) {
      puVar5 = puVar9;
      uVar10 = uVar10 - 1;
      uVar7 = (ulonglong)uVar10;
      if ((int)uVar10 < 0) break;
      puVar5[0x23] = DAT_140608ef0;
      puVar9 = puVar5 + -0x25;
      DAT_140608ef0 = puVar5;
    }
  }
  puVar5 = DAT_140608ef0;
  if (DAT_140608ef0 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = DAT_140608ef0[0x23];
  *(undefined4 *)DAT_140608ef0 = param_1;
  DAT_140608ef0 = (undefined8 *)uVar2;
  puVar5[5] = 7;
  puVar5[4] = 0;
  *(undefined2 *)(puVar5 + 2) = 0;
  puVar5[8] = 0;
  puVar5[9] = 0;
  puVar5[10] = 0;
  iVar6 = 3;
  iVar3 = 3;
  puVar9 = puVar5 + 0xc;
  while (iVar3 = iVar3 + -1, -1 < iVar3) {
    puVar9 = puVar9 + 2;
  }
  do {
    iVar6 = iVar6 + -1;
  } while (-1 < iVar6);
  *(int *)(puVar5 + 0x24) = (int)param_3;
  DAT_140608eb8 = DAT_140608eb8 + 1;
  puVar5[0x23] = *(undefined8 *)(DAT_140608eb0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608eb0 + (param_2 & 0xffffffff) * 8) = puVar5;
  if ((DAT_140608ed0 < DAT_140608eb8) && (DAT_140608ee0 == 0)) {
    uVar4 = FUN_140154b70(DAT_140608eb8,puVar9,uVar7,param_4,puVar5,uVar11);
    FUN_140154990(uVar4);
  }
  return puVar5;
}



void FUN_140154dc0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(void **)(param_1 + 0x40) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x40));
  }
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(longlong *)(param_1 + 0x118) = DAT_140608ef0;
  DAT_140608eb8 = DAT_140608eb8 - 1;
  DAT_140608ef0 = param_1;
  if ((DAT_140608eb8 < DAT_140608ed8) && (DAT_140608ee0 == 0)) {
    uVar2 = FUN_140154b70(DAT_140608eb8);
    FUN_140154990(uVar2);
  }
  if (DAT_140608eb8 == 0) {
    DAT_140608ef0 = 0;
    _Memory = DAT_140608ee8;
    if (DAT_140608ee8 != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608ee8 = (longlong *)0x0;
    }
  }
  return;
}



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

undefined8 FUN_140154eb0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608e60 != (void *)0x0) {
    operator_delete__(DAT_140608e60);
    DAT_140608e60 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608e60 = operator_new(_Var1);
    if (DAT_140608e60 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608e60,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608e7c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608e78;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608e88 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608e88 = 0;
  }
  DAT_140608e80 = (longlong)fVar4 + lVar2;
  DAT_140608e70 = param_1;
  return CONCAT71((int7)(DAT_140608e88 >> 8),1);
}



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

void FUN_140155000(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_1401551e0(DAT_140608e68,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608e70) {
    if (DAT_140608e60 == (void *)0x0) {
      FUN_140154eb0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608e70;
      if (DAT_140608e70 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608e60);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x140);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x148) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x140) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608e70;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608e60);
      fVar10 = (float)param_1 * _DAT_140608e7c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608e80 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608e78;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608e60 = _Dst;
      DAT_140608e70 = param_1;
      DAT_140608e88 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608e88 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_1401551e0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608e74;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140155270(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608ea0 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608e94);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x150)
      goto LAB_140155341;
      lVar8 = uVar7 * 0x150;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140155341:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608e98;
    puVar4 = puVar6 + (ulonglong)(DAT_140608e94 - 1) * 0x2a + 2;
    DAT_140608e98 = puVar6;
    uVar2 = DAT_140608e94;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x28] = DAT_140608ea0;
      puVar4 = puVar6 + -0x2a;
      DAT_140608ea0 = puVar6;
    }
  }
  puVar6 = DAT_140608ea0;
  if (DAT_140608ea0 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608ea0[0x28];
  *(undefined4 *)DAT_140608ea0 = param_1;
  DAT_140608ea0 = (undefined8 *)uVar3;
  puVar6[5] = 7;
  puVar6[4] = 0;
  *(undefined2 *)(puVar6 + 2) = 0;
  puVar6[10] = 7;
  puVar6[9] = 0;
  *(undefined2 *)(puVar6 + 7) = 0;
  puVar6[0x11] = 7;
  puVar6[0x10] = 0;
  *(undefined2 *)(puVar6 + 0xe) = 0;
  *(undefined4 *)(puVar6 + 0x29) = param_3;
  DAT_140608e68 = DAT_140608e68 + 1;
  puVar6[0x28] = *(undefined8 *)(DAT_140608e60 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608e60 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608e80 < DAT_140608e68) && (DAT_140608e90 == 0)) {
    uVar5 = FUN_1401551e0();
    FUN_140155000(uVar5);
  }
  return puVar6;
}



void FUN_140155420(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_14013ed60(param_1 + 8);
    *(longlong *)(param_1 + 0x140) = DAT_140608ea0;
    DAT_140608e68 = DAT_140608e68 - 1;
    DAT_140608ea0 = param_1;
    if ((DAT_140608e68 < DAT_140608e88) && (DAT_140608e90 == 0)) {
      uVar2 = FUN_1401551e0(DAT_140608e68);
      FUN_140155000(uVar2);
    }
    if ((DAT_140608e68 == 0) &&
       (DAT_140608ea0 = 0, _Memory = DAT_140608e98, DAT_140608e98 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608e98 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



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

undefined8 FUN_1401554d0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608dd0 != (void *)0x0) {
    operator_delete__(DAT_140608dd0);
    DAT_140608dd0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608dd0 = operator_new(_Var1);
    if (DAT_140608dd0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608dd0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608dec;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608de8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608df8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608df8 = 0;
  }
  DAT_140608df0 = (longlong)fVar4 + lVar2;
  DAT_140608de0 = param_1;
  return CONCAT71((int7)(DAT_140608df8 >> 8),1);
}



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

void FUN_140155620(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140155800(DAT_140608dd8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608de0) {
    if (DAT_140608dd0 == (void *)0x0) {
      FUN_1401554d0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608de0;
      if (DAT_140608de0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608dd0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x18);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x20) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x18) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608de0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608dd0);
      fVar10 = (float)param_1 * _DAT_140608dec;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608df0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608de8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608dd0 = _Dst;
      DAT_140608de0 = param_1;
      DAT_140608df8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608df8 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140155800(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608de4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140155890(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608e10 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608e04);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x28)
      goto LAB_14015595a;
      lVar7 = uVar8 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_14015595a:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608e08;
    puVar4 = puVar6 + (ulonglong)(DAT_140608e04 - 1) * 5 + 2;
    DAT_140608e08 = puVar6;
    uVar2 = DAT_140608e04;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[3] = DAT_140608e10;
      puVar4 = puVar6 + -5;
      DAT_140608e10 = puVar6;
    }
  }
  puVar6 = DAT_140608e10;
  if (DAT_140608e10 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608e10[3];
  *(undefined4 *)DAT_140608e10 = param_1;
  DAT_140608e10 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 4) = param_3;
  DAT_140608dd8 = DAT_140608dd8 + 1;
  puVar6[3] = *(undefined8 *)(DAT_140608dd0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608dd0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608df0 < DAT_140608dd8) && (DAT_140608e00 == 0)) {
    uVar5 = FUN_140155800();
    FUN_140155620(uVar5);
  }
  return puVar6;
}



void FUN_1401559f0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x18) = DAT_140608e10;
    DAT_140608dd8 = DAT_140608dd8 - 1;
    DAT_140608e10 = param_1;
    if ((DAT_140608dd8 < DAT_140608df8) && (DAT_140608e00 == 0)) {
      uVar2 = FUN_140155800(DAT_140608dd8);
      FUN_140155620(uVar2);
    }
    if ((DAT_140608dd8 == 0) &&
       (DAT_140608e10 = 0, _Memory = DAT_140608e08, DAT_140608e08 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608e08 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



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

undefined8 FUN_140155aa0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608d30 != (void *)0x0) {
    operator_delete__(DAT_140608d30);
    DAT_140608d30 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608d30 = operator_new(_Var1);
    if (DAT_140608d30 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608d30,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608d4c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608d48;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608d58 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608d58 = 0;
  }
  DAT_140608d50 = (longlong)fVar4 + lVar2;
  DAT_140608d40 = param_1;
  return CONCAT71((int7)(DAT_140608d58 >> 8),1);
}



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

void FUN_140155bf0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140155dd0(DAT_140608d38,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608d40) {
    if (DAT_140608d30 == (void *)0x0) {
      FUN_140155aa0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608d40;
      if (DAT_140608d40 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608d30);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xc0);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 200) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xc0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608d40;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608d30);
      fVar10 = (float)param_1 * _DAT_140608d4c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608d50 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608d48;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608d30 = _Dst;
      DAT_140608d40 = param_1;
      DAT_140608d58 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608d58 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140155dd0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608d44;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140155e60(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608d70 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608d64);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xd0)
      goto LAB_140155f32;
      lVar8 = uVar7 * 0xd0;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140155f32:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608d68;
    puVar4 = puVar6 + (ulonglong)(DAT_140608d64 - 1) * 0x1a + 2;
    DAT_140608d68 = puVar6;
    uVar2 = DAT_140608d64;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x18] = DAT_140608d70;
      puVar4 = puVar6 + -0x1a;
      DAT_140608d70 = puVar6;
    }
  }
  puVar6 = DAT_140608d70;
  if (DAT_140608d70 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608d70[0x18];
  *(undefined4 *)DAT_140608d70 = param_1;
  DAT_140608d70 = (undefined8 *)uVar3;
  puVar6[5] = 7;
  puVar6[4] = 0;
  *(undefined2 *)(puVar6 + 2) = 0;
  puVar6[7] = 0;
  puVar6[8] = 0;
  puVar6[9] = 0;
  *(undefined4 *)(puVar6 + 0x19) = param_3;
  DAT_140608d38 = DAT_140608d38 + 1;
  puVar6[0x18] = *(undefined8 *)(DAT_140608d30 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608d30 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608d50 < DAT_140608d38) && (DAT_140608d60 == 0)) {
    uVar5 = FUN_140155dd0();
    FUN_140155bf0(uVar5);
  }
  return puVar6;
}



void FUN_140155ff0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(void **)(param_1 + 0x38) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(longlong *)(param_1 + 0xc0) = DAT_140608d70;
  DAT_140608d38 = DAT_140608d38 - 1;
  DAT_140608d70 = param_1;
  if ((DAT_140608d38 < DAT_140608d58) && (DAT_140608d60 == 0)) {
    uVar2 = FUN_140155dd0(DAT_140608d38);
    FUN_140155bf0(uVar2);
  }
  if (DAT_140608d38 == 0) {
    DAT_140608d70 = 0;
    _Memory = DAT_140608d68;
    if (DAT_140608d68 != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608d68 = (longlong *)0x0;
    }
  }
  return;
}



longlong FUN_1401560e0(longlong param_1,longlong param_2,longlong param_3)

{
  if ((param_1 != param_2) && (param_2 != param_3)) {
    FUN_14015ae50();
    return param_1 + (param_3 - param_2 >> 2) * 4;
  }
  return param_1;
}



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

void FUN_140156140(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_14014e930(DAT_140608ce8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608cf0) {
    if (DAT_140608ce0 == (void *)0x0) {
      FUN_14014e7e0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608cf0;
      if (DAT_140608cf0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608ce0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x50);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x58) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x50) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608cf0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608ce0);
      fVar10 = (float)param_1 * _DAT_140608cfc;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608d00 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608cf8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608ce0 = _Dst;
      DAT_140608cf0 = param_1;
      DAT_140608d08 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608d08 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_140156320(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608d20 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608d14);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x60)
      goto LAB_1401563ea;
      lVar7 = uVar8 * 0x60;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_1401563ea:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608d18;
    puVar4 = puVar6 + (ulonglong)(DAT_140608d14 - 1) * 0xc + 2;
    DAT_140608d18 = puVar6;
    uVar2 = DAT_140608d14;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[10] = DAT_140608d20;
      puVar4 = puVar6 + -0xc;
      DAT_140608d20 = puVar6;
    }
  }
  puVar6 = DAT_140608d20;
  if (DAT_140608d20 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608d20[10];
  *(undefined4 *)DAT_140608d20 = param_1;
  DAT_140608d20 = (undefined8 *)uVar3;
  puVar6[2] = 0;
  puVar6[3] = 0;
  puVar6[4] = 0;
  *(undefined4 *)(puVar6 + 0xb) = param_3;
  DAT_140608ce8 = DAT_140608ce8 + 1;
  puVar6[10] = *(undefined8 *)(DAT_140608ce0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608ce0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608d00 < DAT_140608ce8) && (DAT_140608d10 == 0)) {
    uVar5 = FUN_14014e930();
    FUN_140156140(uVar5);
  }
  return puVar6;
}



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

undefined8 FUN_1401564a0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608c90 != (void *)0x0) {
    operator_delete__(DAT_140608c90);
    DAT_140608c90 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608c90 = operator_new(_Var1);
    if (DAT_140608c90 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608c90,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608cac;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608ca8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608cb8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608cb8 = 0;
  }
  DAT_140608cb0 = (longlong)fVar4 + lVar2;
  DAT_140608ca0 = param_1;
  return CONCAT71((int7)(DAT_140608cb8 >> 8),1);
}



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

void FUN_1401565f0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_1401567d0(DAT_140608c98,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608ca0) {
    if (DAT_140608c90 == (void *)0x0) {
      FUN_1401564a0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608ca0;
      if (DAT_140608ca0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608c90);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x78);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x80) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x78) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608ca0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608c90);
      fVar10 = (float)param_1 * _DAT_140608cac;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608cb0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608ca8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608c90 = _Dst;
      DAT_140608ca0 = param_1;
      DAT_140608cb8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608cb8 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_1401567d0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608ca4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140156860(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608cd0 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608cc4);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x88)
      goto LAB_14015693b;
      lVar8 = uVar7 * 0x88;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_14015693b:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608cc8;
    puVar4 = puVar6 + (ulonglong)(DAT_140608cc4 - 1) * 0x11 + 2;
    DAT_140608cc8 = puVar6;
    uVar2 = DAT_140608cc4;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0xf] = DAT_140608cd0;
      puVar4 = puVar6 + -0x11;
      DAT_140608cd0 = puVar6;
    }
  }
  puVar6 = DAT_140608cd0;
  if (DAT_140608cd0 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608cd0[0xf];
  *(undefined4 *)DAT_140608cd0 = param_1;
  DAT_140608cd0 = (undefined8 *)uVar3;
  puVar6[3] = 0;
  puVar6[4] = 0;
  puVar6[5] = 0;
  puVar6[7] = 0;
  puVar6[8] = 0;
  puVar6[9] = 0;
  puVar6[0xb] = 0;
  puVar6[0xc] = 0;
  puVar6[0xd] = 0;
  *(undefined4 *)(puVar6 + 0x10) = param_3;
  DAT_140608c98 = DAT_140608c98 + 1;
  puVar6[0xf] = *(undefined8 *)(DAT_140608c90 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608c90 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608cb0 < DAT_140608c98) && (DAT_140608cc0 == 0)) {
    uVar5 = FUN_1401567d0();
    FUN_1401565f0(uVar5);
  }
  return puVar6;
}



void FUN_140156a00(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140141640(param_1 + 8);
  *(longlong *)(param_1 + 0x78) = DAT_140608cd0;
  DAT_140608c98 = DAT_140608c98 - 1;
  DAT_140608cd0 = param_1;
  if ((DAT_140608c98 < DAT_140608cb8) && (DAT_140608cc0 == 0)) {
    uVar2 = FUN_1401567d0(DAT_140608c98);
    FUN_1401565f0(uVar2);
  }
  if (DAT_140608c98 == 0) {
    DAT_140608cd0 = 0;
    _Memory = DAT_140608cc8;
    if (DAT_140608cc8 != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608cc8 = (longlong *)0x0;
    }
  }
  return;
}



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

void FUN_140156ab0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_14014ede0(DAT_140608c48,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608c50) {
    if (DAT_140608c40 == (void *)0x0) {
      FUN_14014ec90(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608c50;
      if (DAT_140608c50 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608c40);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x28);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x30) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x28) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608c50;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608c40);
      fVar10 = (float)param_1 * _DAT_140608c5c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608c60 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608c58;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608c40 = _Dst;
      DAT_140608c50 = param_1;
      DAT_140608c68 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608c68 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_140156c90(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608c80 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608c74);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x38)
      goto LAB_140156d59;
      lVar8 = uVar7 * 0x38;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140156d59:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608c78;
    puVar4 = puVar6 + (ulonglong)(DAT_140608c74 - 1) * 7 + 2;
    DAT_140608c78 = puVar6;
    uVar2 = DAT_140608c74;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[5] = DAT_140608c80;
      puVar4 = puVar6 + -7;
      DAT_140608c80 = puVar6;
    }
  }
  puVar6 = DAT_140608c80;
  if (DAT_140608c80 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608c80[5];
  *(undefined4 *)DAT_140608c80 = param_1;
  DAT_140608c80 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 6) = param_3;
  DAT_140608c48 = DAT_140608c48 + 1;
  puVar6[5] = *(undefined8 *)(DAT_140608c40 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608c40 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608c60 < DAT_140608c48) && (DAT_140608c70 == 0)) {
    uVar5 = FUN_14014ede0();
    FUN_140156ab0(uVar5);
  }
  return puVar6;
}



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

void FUN_140156df0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_14014f0f0(DAT_140608bf8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608c00) {
    if (DAT_140608bf0 == (void *)0x0) {
      FUN_14014efa0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608c00;
      if (DAT_140608c00 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608bf0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x18);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x20) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x18) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608c00;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608bf0);
      fVar10 = (float)param_1 * _DAT_140608c0c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608c10 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608c08;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608bf0 = _Dst;
      DAT_140608c00 = param_1;
      DAT_140608c18 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608c18 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_140156fd0(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608c30 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608c24);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x28)
      goto LAB_14015709a;
      lVar7 = uVar8 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_14015709a:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608c28;
    puVar4 = puVar6 + (ulonglong)(DAT_140608c24 - 1) * 5 + 2;
    DAT_140608c28 = puVar6;
    uVar2 = DAT_140608c24;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[3] = DAT_140608c30;
      puVar4 = puVar6 + -5;
      DAT_140608c30 = puVar6;
    }
  }
  puVar6 = DAT_140608c30;
  if (DAT_140608c30 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608c30[3];
  *(undefined4 *)DAT_140608c30 = param_1;
  DAT_140608c30 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 4) = param_3;
  DAT_140608bf8 = DAT_140608bf8 + 1;
  puVar6[3] = *(undefined8 *)(DAT_140608bf0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608bf0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608c10 < DAT_140608bf8) && (DAT_140608c20 == 0)) {
    uVar5 = FUN_14014f0f0();
    FUN_140156df0(uVar5);
  }
  return puVar6;
}



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

void FUN_140157130(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_14014f420(DAT_140608b18,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608b20) {
    if (DAT_140608b10 == (void *)0x0) {
      FUN_14014f2d0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608b20;
      if (DAT_140608b20 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608b10);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x90);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x98) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x90) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608b20;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608b10);
      fVar10 = (float)param_1 * _DAT_140608b2c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608b30 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608b28;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608b10 = _Dst;
      DAT_140608b20 = param_1;
      DAT_140608b38 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608b38 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_140157310(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608b50 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608b44);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xa0)
      goto LAB_1401573ee;
      lVar7 = uVar8 * 0xa0;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_1401573ee:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608b48;
    puVar4 = puVar6 + (ulonglong)(DAT_140608b44 - 1) * 0x14 + 2;
    DAT_140608b48 = puVar6;
    uVar2 = DAT_140608b44;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x12] = DAT_140608b50;
      puVar4 = puVar6 + -0x14;
      DAT_140608b50 = puVar6;
    }
  }
  puVar6 = DAT_140608b50;
  if (DAT_140608b50 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608b50[0x12];
  *(undefined4 *)DAT_140608b50 = param_1;
  DAT_140608b50 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 0x13) = param_3;
  DAT_140608b18 = DAT_140608b18 + 1;
  puVar6[0x12] = *(undefined8 *)(DAT_140608b10 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608b10 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608b30 < DAT_140608b18) && (DAT_140608b40 == 0)) {
    uVar5 = FUN_14014f420();
    FUN_140157130(uVar5);
  }
  return puVar6;
}



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

undefined8 FUN_140157490(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608ac0 != (void *)0x0) {
    operator_delete__(DAT_140608ac0);
    DAT_140608ac0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608ac0 = operator_new(_Var1);
    if (DAT_140608ac0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608ac0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_140608adc;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608ad8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608ae8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608ae8 = 0;
  }
  DAT_140608ae0 = (longlong)fVar4 + lVar2;
  DAT_140608ad0 = param_1;
  return CONCAT71((int7)(DAT_140608ae8 >> 8),1);
}



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

void FUN_1401575e0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_1401577c0(DAT_140608ac8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608ad0) {
    if (DAT_140608ac0 == (void *)0x0) {
      FUN_140157490(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608ad0;
      if (DAT_140608ad0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608ac0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x18);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x20) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x18) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608ad0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608ac0);
      fVar10 = (float)param_1 * _DAT_140608adc;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608ae0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608ad8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608ac0 = _Dst;
      DAT_140608ad0 = param_1;
      DAT_140608ae8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608ae8 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_1401577c0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608ad4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140157850(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608b00 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608af4);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x28)
      goto LAB_14015791a;
      lVar7 = uVar8 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_14015791a:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608af8;
    puVar4 = puVar6 + (ulonglong)(DAT_140608af4 - 1) * 5 + 2;
    DAT_140608af8 = puVar6;
    uVar2 = DAT_140608af4;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[3] = DAT_140608b00;
      puVar4 = puVar6 + -5;
      DAT_140608b00 = puVar6;
    }
  }
  puVar6 = DAT_140608b00;
  if (DAT_140608b00 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608b00[3];
  *(undefined4 *)DAT_140608b00 = param_1;
  DAT_140608b00 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 4) = param_3;
  DAT_140608ac8 = DAT_140608ac8 + 1;
  puVar6[3] = *(undefined8 *)(DAT_140608ac0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608ac0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608ae0 < DAT_140608ac8) && (DAT_140608af0 == 0)) {
    uVar5 = FUN_1401577c0();
    FUN_1401575e0(uVar5);
  }
  return puVar6;
}



void FUN_1401579b0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x18) = DAT_140608b00;
    DAT_140608ac8 = DAT_140608ac8 - 1;
    DAT_140608b00 = param_1;
    if ((DAT_140608ac8 < DAT_140608ae8) && (DAT_140608af0 == 0)) {
      uVar2 = FUN_1401577c0(DAT_140608ac8);
      FUN_1401575e0(uVar2);
    }
    if ((DAT_140608ac8 == 0) &&
       (DAT_140608b00 = 0, _Memory = DAT_140608af8, DAT_140608af8 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608af8 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



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

undefined8 FUN_140157a60(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608910 != (void *)0x0) {
    operator_delete__(DAT_140608910);
    DAT_140608910 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608910 = operator_new(_Var1);
    if (DAT_140608910 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608910,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060892c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608928;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608938 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608938 = 0;
  }
  DAT_140608930 = (longlong)fVar4 + lVar2;
  DAT_140608920 = param_1;
  return CONCAT71((int7)(DAT_140608938 >> 8),1);
}



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

void FUN_140157bb0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140157d90(DAT_140608918,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608920) {
    if (DAT_140608910 == (void *)0x0) {
      FUN_140157a60(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608920;
      if (DAT_140608920 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608910);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x78);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x80) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x78) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608920;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608910);
      fVar10 = (float)param_1 * _DAT_14060892c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608930 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608928;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608910 = _Dst;
      DAT_140608920 = param_1;
      DAT_140608938 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608938 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140157d90(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608924;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140157e20(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608950 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608944);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x88)
      goto LAB_140157efb;
      lVar8 = uVar7 * 0x88;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140157efb:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608948;
    puVar4 = puVar6 + (ulonglong)(DAT_140608944 - 1) * 0x11 + 2;
    DAT_140608948 = puVar6;
    uVar2 = DAT_140608944;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0xf] = DAT_140608950;
      puVar4 = puVar6 + -0x11;
      DAT_140608950 = puVar6;
    }
  }
  puVar6 = DAT_140608950;
  if (DAT_140608950 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608950[0xf];
  *(undefined4 *)DAT_140608950 = param_1;
  DAT_140608950 = (undefined8 *)uVar3;
  puVar6[7] = 0;
  puVar6[8] = 0;
  puVar6[9] = 0;
  puVar6[0xb] = 0;
  puVar6[0xc] = 0;
  puVar6[0xd] = 0;
  *(undefined4 *)(puVar6 + 0x10) = param_3;
  DAT_140608918 = DAT_140608918 + 1;
  puVar6[0xf] = *(undefined8 *)(DAT_140608910 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608910 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608930 < DAT_140608918) && (DAT_140608940 == 0)) {
    uVar5 = FUN_140157d90();
    FUN_140157bb0(uVar5);
  }
  return puVar6;
}



void FUN_140157fb0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    if (*(void **)(param_1 + 0x58) != (void *)0x0) {
      operator_delete(*(void **)(param_1 + 0x58));
    }
    *(undefined8 *)(param_1 + 0x58) = 0;
    *(undefined8 *)(param_1 + 0x60) = 0;
    *(undefined8 *)(param_1 + 0x68) = 0;
    if (*(void **)(param_1 + 0x38) != (void *)0x0) {
      operator_delete(*(void **)(param_1 + 0x38));
    }
    *(undefined8 *)(param_1 + 0x38) = 0;
    *(undefined8 *)(param_1 + 0x40) = 0;
    *(undefined8 *)(param_1 + 0x48) = 0;
    *(longlong *)(param_1 + 0x78) = DAT_140608950;
    DAT_140608918 = DAT_140608918 - 1;
    DAT_140608950 = param_1;
    if ((DAT_140608918 < DAT_140608938) && (DAT_140608940 == 0)) {
      uVar2 = FUN_140157d90(DAT_140608918);
      FUN_140157bb0(uVar2);
    }
    if ((DAT_140608918 == 0) &&
       (DAT_140608950 = 0, _Memory = DAT_140608948, DAT_140608948 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608948 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



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

undefined8 FUN_1401580a0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_1406088c0 != (void *)0x0) {
    operator_delete__(DAT_1406088c0);
    DAT_1406088c0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_1406088c0 = operator_new(_Var1);
    if (DAT_1406088c0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_1406088c0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_1406088dc;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_1406088d8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_1406088e8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_1406088e8 = 0;
  }
  DAT_1406088e0 = (longlong)fVar4 + lVar2;
  DAT_1406088d0 = param_1;
  return CONCAT71((int7)(DAT_1406088e8 >> 8),1);
}



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

void FUN_1401581f0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_1401583d0(DAT_1406088c8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_1406088d0) {
    if (DAT_1406088c0 == (void *)0x0) {
      FUN_1401580a0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_1406088d0;
      if (DAT_1406088d0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_1406088c0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x38);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x40) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x38) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_1406088d0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_1406088c0);
      fVar10 = (float)param_1 * _DAT_1406088dc;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406088e0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_1406088d8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406088c0 = _Dst;
      DAT_1406088d0 = param_1;
      DAT_1406088e8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_1406088e8 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_1401583d0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_1406088d4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140158460(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608900 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_1406088f4);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x48)
      goto LAB_14015852a;
      lVar7 = uVar8 * 0x48;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_14015852a:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_1406088f8;
    puVar4 = puVar6 + (ulonglong)(DAT_1406088f4 - 1) * 9 + 2;
    DAT_1406088f8 = puVar6;
    uVar2 = DAT_1406088f4;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[7] = DAT_140608900;
      puVar4 = puVar6 + -9;
      DAT_140608900 = puVar6;
    }
  }
  puVar6 = DAT_140608900;
  if (DAT_140608900 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608900[7];
  *(undefined4 *)DAT_140608900 = param_1;
  DAT_140608900 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 8) = param_3;
  DAT_1406088c8 = DAT_1406088c8 + 1;
  puVar6[7] = *(undefined8 *)(DAT_1406088c0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_1406088c0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_1406088e0 < DAT_1406088c8) && (DAT_1406088f0 == 0)) {
    uVar5 = FUN_1401583d0();
    FUN_1401581f0(uVar5);
  }
  return puVar6;
}



void FUN_1401585c0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x38) = DAT_140608900;
    DAT_1406088c8 = DAT_1406088c8 - 1;
    DAT_140608900 = param_1;
    if ((DAT_1406088c8 < DAT_1406088e8) && (DAT_1406088f0 == 0)) {
      uVar2 = FUN_1401583d0(DAT_1406088c8);
      FUN_1401581f0(uVar2);
    }
    if ((DAT_1406088c8 == 0) &&
       (DAT_140608900 = 0, _Memory = DAT_1406088f8, DAT_1406088f8 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_1406088f8 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



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

undefined8 FUN_140158670(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608870 != (void *)0x0) {
    operator_delete__(DAT_140608870);
    DAT_140608870 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608870 = operator_new(_Var1);
    if (DAT_140608870 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608870,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060888c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608888;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608898 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608898 = 0;
  }
  DAT_140608890 = (longlong)fVar4 + lVar2;
  DAT_140608880 = param_1;
  return CONCAT71((int7)(DAT_140608898 >> 8),1);
}



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

void FUN_1401587c0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_1401589a0(DAT_140608878,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608880) {
    if (DAT_140608870 == (void *)0x0) {
      FUN_140158670(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608880;
      if (DAT_140608880 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608870);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xc0);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 200) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xc0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608880;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608870);
      fVar10 = (float)param_1 * _DAT_14060888c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608890 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608888;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608870 = _Dst;
      DAT_140608880 = param_1;
      DAT_140608898 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608898 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_1401589a0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608884;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140158a30(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_1406088b0 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_1406088a4);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xd0)
      goto LAB_140158b01;
      lVar8 = uVar7 * 0xd0;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140158b01:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_1406088a8;
    puVar4 = puVar6 + (ulonglong)(DAT_1406088a4 - 1) * 0x1a + 2;
    DAT_1406088a8 = puVar6;
    uVar2 = DAT_1406088a4;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x18] = DAT_1406088b0;
      puVar4 = puVar6 + -0x1a;
      DAT_1406088b0 = puVar6;
    }
  }
  puVar6 = DAT_1406088b0;
  if (DAT_1406088b0 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_1406088b0[0x18];
  *(undefined4 *)DAT_1406088b0 = param_1;
  DAT_1406088b0 = (undefined8 *)uVar3;
  puVar6[6] = 7;
  puVar6[5] = 0;
  *(undefined2 *)(puVar6 + 3) = 0;
  puVar6[8] = 0;
  puVar6[9] = 0;
  puVar6[10] = 0;
  puVar6[0xc] = 0;
  puVar6[0xd] = 0;
  puVar6[0xe] = 0;
  puVar6[0x10] = 0;
  puVar6[0x11] = 0;
  puVar6[0x12] = 0;
  puVar6[0x14] = 0;
  puVar6[0x15] = 0;
  puVar6[0x16] = 0;
  *(undefined4 *)(puVar6 + 0x19) = param_3;
  DAT_140608878 = DAT_140608878 + 1;
  puVar6[0x18] = *(undefined8 *)(DAT_140608870 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608870 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608890 < DAT_140608878) && (DAT_1406088a0 == 0)) {
    uVar5 = FUN_1401589a0();
    FUN_1401587c0(uVar5);
  }
  return puVar6;
}



void FUN_140158c00(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_140144e20(param_1 + 8);
    *(longlong *)(param_1 + 0xc0) = DAT_1406088b0;
    DAT_140608878 = DAT_140608878 - 1;
    DAT_1406088b0 = param_1;
    if ((DAT_140608878 < DAT_140608898) && (DAT_1406088a0 == 0)) {
      uVar2 = FUN_1401589a0(DAT_140608878);
      FUN_1401587c0(uVar2);
    }
    if ((DAT_140608878 == 0) &&
       (DAT_1406088b0 = 0, _Memory = DAT_1406088a8, DAT_1406088a8 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_1406088a8 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



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

undefined8 FUN_140158cb0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608820 != (void *)0x0) {
    operator_delete__(DAT_140608820);
    DAT_140608820 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608820 = operator_new(_Var1);
    if (DAT_140608820 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608820,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060883c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608838;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608848 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608848 = 0;
  }
  DAT_140608840 = (longlong)fVar4 + lVar2;
  DAT_140608830 = param_1;
  return CONCAT71((int7)(DAT_140608848 >> 8),1);
}



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

void FUN_140158e00(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140158fe0(DAT_140608828,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608830) {
    if (DAT_140608820 == (void *)0x0) {
      FUN_140158cb0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608830;
      if (DAT_140608830 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608820);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xd0);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0xd8) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xd0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608830;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608820);
      fVar10 = (float)param_1 * _DAT_14060883c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608840 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608838;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608820 = _Dst;
      DAT_140608830 = param_1;
      DAT_140608848 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608848 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140158fe0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608834;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140159070(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608860 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608854);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xe0)
      goto LAB_140159141;
      lVar8 = uVar7 * 0xe0;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140159141:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608858;
    puVar4 = puVar6 + (ulonglong)(DAT_140608854 - 1) * 0x1c + 2;
    DAT_140608858 = puVar6;
    uVar2 = DAT_140608854;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x1a] = DAT_140608860;
      puVar4 = puVar6 + -0x1c;
      DAT_140608860 = puVar6;
    }
  }
  puVar6 = DAT_140608860;
  if (DAT_140608860 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608860[0x1a];
  *(undefined4 *)DAT_140608860 = param_1;
  DAT_140608860 = (undefined8 *)uVar3;
  puVar6[1] = 0;
  puVar6[2] = 0;
  puVar6[3] = 0;
  *(undefined4 *)(puVar6 + 4) = 0;
  puVar6[8] = 7;
  puVar6[7] = 0;
  *(undefined2 *)(puVar6 + 5) = 0;
  puVar6[10] = 0;
  puVar6[0xb] = 0;
  puVar6[0xc] = 0;
  puVar6[0xe] = 0;
  puVar6[0xf] = 0;
  puVar6[0x10] = 0;
  puVar6[0x12] = 0;
  puVar6[0x13] = 0;
  puVar6[0x14] = 0;
  puVar6[0x16] = 0;
  puVar6[0x17] = 0;
  puVar6[0x18] = 0;
  *(undefined4 *)(puVar6 + 0x1b) = param_3;
  DAT_140608828 = DAT_140608828 + 1;
  puVar6[0x1a] = *(undefined8 *)(DAT_140608820 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608820 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608840 < DAT_140608828) && (DAT_140608850 == 0)) {
    uVar5 = FUN_140158fe0();
    FUN_140158e00(uVar5);
  }
  return puVar6;
}



void FUN_140159260(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_140145db0(param_1 + 8);
    *(longlong *)(param_1 + 0xd0) = DAT_140608860;
    DAT_140608828 = DAT_140608828 - 1;
    DAT_140608860 = param_1;
    if ((DAT_140608828 < DAT_140608848) && (DAT_140608850 == 0)) {
      uVar2 = FUN_140158fe0(DAT_140608828);
      FUN_140158e00(uVar2);
    }
    if ((DAT_140608828 == 0) &&
       (DAT_140608860 = 0, _Memory = DAT_140608858, DAT_140608858 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608858 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



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

undefined8 FUN_140159310(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_1406087d0 != (void *)0x0) {
    operator_delete__(DAT_1406087d0);
    DAT_1406087d0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_1406087d0 = operator_new(_Var1);
    if (DAT_1406087d0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_1406087d0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_1406087ec;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * DAT_1406087e8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_1406087f8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_1406087f8 = 0;
  }
  DAT_1406087f0 = (longlong)fVar4 + lVar2;
  DAT_1406087e0 = param_1;
  return CONCAT71((int7)(DAT_1406087f8 >> 8),1);
}



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

void FUN_140159460(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140159640(DAT_1406087d8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_1406087e0) {
    if (DAT_1406087d0 == (void *)0x0) {
      FUN_140159310(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_1406087e0;
      if (DAT_1406087e0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_1406087d0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x20);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x28) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x20) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_1406087e0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_1406087d0);
      fVar10 = (float)param_1 * _DAT_1406087ec;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406087f0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * DAT_1406087e8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406087d0 = _Dst;
      DAT_1406087e0 = param_1;
      DAT_1406087f8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_1406087f8 = uVar6;
      }
    }
  }
  return;
}



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

uint FUN_140159640(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_1406087e4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_1401596d0(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608810 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608804);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x30)
      goto LAB_1401597a9;
      lVar7 = uVar8 * 0x30;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_1401597a9:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608808;
    puVar4 = puVar6 + (ulonglong)(DAT_140608804 - 1) * 6 + 2;
    DAT_140608808 = puVar6;
    uVar2 = DAT_140608804;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[4] = DAT_140608810;
      puVar4 = puVar6 + -6;
      DAT_140608810 = puVar6;
    }
  }
  puVar6 = DAT_140608810;
  if (DAT_140608810 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608810[4];
  *(undefined4 *)DAT_140608810 = param_1;
  DAT_140608810 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 5) = param_3;
  DAT_1406087d8 = DAT_1406087d8 + 1;
  puVar6[4] = *(undefined8 *)(DAT_1406087d0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_1406087d0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_1406087f0 < DAT_1406087d8) && (DAT_140608800 == 0)) {
    uVar5 = FUN_140159640();
    FUN_140159460(uVar5);
  }
  return puVar6;
}



void FUN_140159840(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x20) = DAT_140608810;
    DAT_1406087d8 = DAT_1406087d8 - 1;
    DAT_140608810 = param_1;
    if ((DAT_1406087d8 < DAT_1406087f8) && (DAT_140608800 == 0)) {
      uVar2 = FUN_140159640(DAT_1406087d8);
      FUN_140159460(uVar2);
    }
    if ((DAT_1406087d8 == 0) &&
       (DAT_140608810 = 0, _Memory = DAT_140608808, DAT_140608808 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608808 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



undefined8 FUN_1401598f0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_14015aae0(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140159960(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      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_1401599c0(longlong param_1,longlong param_2,longlong param_3)

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



undefined4 *
FUN_140159a20(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  *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];
  FUN_14012e520(param_1 + 6,param_2 + 6,param_3,param_4,0xfffffffffffffffe);
  FUN_14012e520(param_1 + 0xe,param_2 + 0xe);
  FUN_14012e520(param_1 + 0x16,param_2 + 0x16);
  param_1[0x1e] = param_2[0x1e];
  param_1[0x1f] = param_2[0x1f];
  param_1[0x20] = param_2[0x20];
  return param_1;
}



undefined4 * FUN_140159ab0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  return param_1;
}



undefined4 * FUN_140159b60(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_1400015e0(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_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1c) = 7;
  *(undefined8 *)(param_1 + 0x1a) = 0;
  *(undefined2 *)(param_1 + 0x16) = 0;
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff);
  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];
  return param_1;
}



undefined4 * FUN_140159d10(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(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_1400015e0(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];
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x1e) = 0;
  *(undefined2 *)(param_1 + 0x1a) = 0;
  FUN_1400015e0(param_1 + 0x1a,param_2 + 0x1a,0,0xffffffffffffffff);
  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];
  memcpy(param_1 + 0x30,param_2 + 0x30,0x30);
  memcpy(param_1 + 0x3c,param_2 + 0x3c,0x30);
  param_1[0x48] = param_2[0x48];
  param_1[0x49] = param_2[0x49];
  param_1[0x4a] = param_2[0x4a];
  param_1[0x4b] = param_2[0x4b];
  param_1[0x4c] = param_2[0x4c];
  param_1[0x4d] = param_2[0x4d];
  return param_1;
}



undefined4 * FUN_140159ed0(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];
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff,0xfffffffffffffffe);
  FUN_14012e520(param_1 + 0xe,param_2 + 0xe);
  FUN_14012e520(param_1 + 0x16,param_2 + 0x16);
  FUN_14012e520(param_1 + 0x1e,param_2 + 0x1e);
  FUN_14012e520(param_1 + 0x26,param_2 + 0x26);
  return param_1;
}



undefined4 * FUN_140159f80(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  *(undefined8 *)(param_1 + 0xe) = 7;
  *(undefined8 *)(param_1 + 0xc) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  FUN_1400015e0(param_1 + 8,param_2 + 8,0,0xffffffffffffffff,0xfffffffffffffffe);
  FUN_14012e520(param_1 + 0x12,param_2 + 0x12);
  FUN_14012e520(param_1 + 0x1a,param_2 + 0x1a);
  FUN_14012e520(param_1 + 0x22,param_2 + 0x22);
  FUN_14012e520(param_1 + 0x2a,param_2 + 0x2a);
  return param_1;
}



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

{
  char cVar1;
  undefined8 uVar2;
  
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  cVar1 = FUN_14015b060(param_1,(param_2[1] - *param_2) / 0x28,param_2[1] - *param_2,param_4,
                        0xfffffffffffffffe);
  if (cVar1 != '\0') {
    uVar2 = FUN_14015af10(*param_2,param_2[1],*param_1);
    param_1[1] = uVar2;
  }
  return param_1;
}



void FUN_14015a0c0(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 + 0x100) < *(int *)(*param_1 + 0x100)) {
      *param_2 = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = *param_3;
    if (*(int *)(lVar1 + 0x100) < *(int *)(*param_2 + 0x100)) {
      *param_3 = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 0x100) < *(int *)(*param_1 + 0x100)) {
      *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 + 0x100) < *(int *)(*param_1 + 0x100)) {
      param_1[lVar2] = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = param_1[lVar2 * 2];
    if (*(int *)(lVar1 + 0x100) < *(int *)(param_1[lVar2] + 0x100)) {
      param_1[lVar2 * 2] = param_1[lVar2];
      param_1[lVar2] = lVar1;
    }
    lVar1 = param_1[lVar2];
    if (*(int *)(lVar1 + 0x100) < *(int *)(*param_1 + 0x100)) {
      param_1[lVar2] = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = *param_2;
    plVar3 = param_2 + -lVar2;
    if (*(int *)(lVar1 + 0x100) < *(int *)(*plVar3 + 0x100)) {
      *param_2 = *plVar3;
      *plVar3 = lVar1;
    }
    lVar1 = param_2[lVar2];
    if (*(int *)(lVar1 + 0x100) < *(int *)(*param_2 + 0x100)) {
      param_2[lVar2] = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 0x100) < *(int *)(*plVar3 + 0x100)) {
      *param_2 = *plVar3;
      *plVar3 = lVar1;
    }
    plVar4 = param_3 + lVar2 * -2;
    plVar3 = param_3 + -lVar2;
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 0x100) < *(int *)(*plVar4 + 0x100)) {
      *plVar3 = *plVar4;
      *plVar4 = lVar1;
    }
    lVar1 = *param_3;
    if (*(int *)(lVar1 + 0x100) < *(int *)(*plVar3 + 0x100)) {
      *param_3 = *plVar3;
      *plVar3 = lVar1;
    }
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 0x100) < *(int *)(*plVar4 + 0x100)) {
      *plVar3 = *plVar4;
      *plVar4 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 0x100) < *(int *)(param_1[lVar2] + 0x100)) {
      *param_2 = param_1[lVar2];
      param_1[lVar2] = lVar1;
    }
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 0x100) < *(int *)(*param_2 + 0x100)) {
      *plVar3 = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 0x100) < *(int *)(param_1[lVar2] + 0x100)) {
      *param_2 = param_1[lVar2];
      param_1[lVar2] = lVar1;
      return;
    }
  }
  return;
}



void FUN_14015a2e0(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) + 0x100) <
            *(int *)(*(longlong *)(param_1 + -8 + lVar5 * 8) + 0x100)) {
          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 + 0x100) <= *(int *)(lVar5 + 0x100)) break;
        *(longlong *)(param_1 + lVar1 * 8) = lVar5;
        lVar1 = lVar4;
      }
      *(longlong *)(param_1 + lVar1 * 8) = lVar2;
    } while (0 < lVar3);
  }
  return;
}



void FUN_14015a3f0(longlong *param_1,longlong param_2)

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



void FUN_14015a500(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong lVar4;
  
  if ((param_1 != param_2) && (plVar3 = param_1 + 1, plVar3 != param_2)) {
    lVar4 = (longlong)plVar3 - (longlong)param_1;
    do {
      lVar1 = *plVar3;
      plVar2 = plVar3;
      if (*(int *)(lVar1 + 0x100) < *(int *)(*param_1 + 0x100)) {
        memmove(plVar3 + (1 - (lVar4 >> 3)),param_1,(lVar4 >> 3) * 8);
        *param_1 = lVar1;
      }
      else {
        while( true ) {
          if (*(int *)(plVar2[-1] + 0x100) <= *(int *)(lVar1 + 0x100)) break;
          *plVar2 = plVar2[-1];
          plVar2 = plVar2 + -1;
        }
        *plVar2 = lVar1;
      }
      plVar3 = plVar3 + 1;
      lVar4 = lVar4 + 8;
    } while (plVar3 != param_2);
  }
  return;
}



void FUN_14015a5d0(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 + 0x108) < *(int *)(*param_1 + 0x108)) {
      *param_2 = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = *param_3;
    if (*(int *)(lVar1 + 0x108) < *(int *)(*param_2 + 0x108)) {
      *param_3 = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 0x108) < *(int *)(*param_1 + 0x108)) {
      *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 + 0x108) < *(int *)(*param_1 + 0x108)) {
      param_1[lVar2] = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = param_1[lVar2 * 2];
    if (*(int *)(lVar1 + 0x108) < *(int *)(param_1[lVar2] + 0x108)) {
      param_1[lVar2 * 2] = param_1[lVar2];
      param_1[lVar2] = lVar1;
    }
    lVar1 = param_1[lVar2];
    if (*(int *)(lVar1 + 0x108) < *(int *)(*param_1 + 0x108)) {
      param_1[lVar2] = *param_1;
      *param_1 = lVar1;
    }
    lVar1 = *param_2;
    plVar3 = param_2 + -lVar2;
    if (*(int *)(lVar1 + 0x108) < *(int *)(*plVar3 + 0x108)) {
      *param_2 = *plVar3;
      *plVar3 = lVar1;
    }
    lVar1 = param_2[lVar2];
    if (*(int *)(lVar1 + 0x108) < *(int *)(*param_2 + 0x108)) {
      param_2[lVar2] = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 0x108) < *(int *)(*plVar3 + 0x108)) {
      *param_2 = *plVar3;
      *plVar3 = lVar1;
    }
    plVar4 = param_3 + lVar2 * -2;
    plVar3 = param_3 + -lVar2;
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 0x108) < *(int *)(*plVar4 + 0x108)) {
      *plVar3 = *plVar4;
      *plVar4 = lVar1;
    }
    lVar1 = *param_3;
    if (*(int *)(lVar1 + 0x108) < *(int *)(*plVar3 + 0x108)) {
      *param_3 = *plVar3;
      *plVar3 = lVar1;
    }
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 0x108) < *(int *)(*plVar4 + 0x108)) {
      *plVar3 = *plVar4;
      *plVar4 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 0x108) < *(int *)(param_1[lVar2] + 0x108)) {
      *param_2 = param_1[lVar2];
      param_1[lVar2] = lVar1;
    }
    lVar1 = *plVar3;
    if (*(int *)(lVar1 + 0x108) < *(int *)(*param_2 + 0x108)) {
      *plVar3 = *param_2;
      *param_2 = lVar1;
    }
    lVar1 = *param_2;
    if (*(int *)(lVar1 + 0x108) < *(int *)(param_1[lVar2] + 0x108)) {
      *param_2 = param_1[lVar2];
      param_1[lVar2] = lVar1;
      return;
    }
  }
  return;
}



void FUN_14015a7f0(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) + 0x108) <
            *(int *)(*(longlong *)(param_1 + -8 + lVar5 * 8) + 0x108)) {
          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 + 0x108) <= *(int *)(lVar5 + 0x108)) break;
        *(longlong *)(param_1 + lVar1 * 8) = lVar5;
        lVar1 = lVar4;
      }
      *(longlong *)(param_1 + lVar1 * 8) = lVar2;
    } while (0 < lVar3);
  }
  return;
}



void FUN_14015a900(longlong *param_1,longlong param_2)

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



void FUN_14015aa10(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong lVar4;
  
  if ((param_1 != param_2) && (plVar3 = param_1 + 1, plVar3 != param_2)) {
    lVar4 = (longlong)plVar3 - (longlong)param_1;
    do {
      lVar1 = *plVar3;
      plVar2 = plVar3;
      if (*(int *)(lVar1 + 0x108) < *(int *)(*param_1 + 0x108)) {
        memmove(plVar3 + (1 - (lVar4 >> 3)),param_1,(lVar4 >> 3) * 8);
        *param_1 = lVar1;
      }
      else {
        while( true ) {
          if (*(int *)(plVar2[-1] + 0x108) <= *(int *)(lVar1 + 0x108)) break;
          *plVar2 = plVar2[-1];
          plVar2 = plVar2 + -1;
        }
        *plVar2 = lVar1;
      }
      plVar3 = plVar3 + 1;
      lVar4 = lVar4 + 8;
    } while (plVar3 != param_2);
  }
  return;
}



void FUN_14015aae0(longlong *param_1,ulonglong param_2)

{
  ushort uVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  longlong *plVar8;
  ushort *puVar9;
  longlong *plVar10;
  longlong lVar11;
  ushort *puVar12;
  ulonglong uVar13;
  undefined8 *puVar14;
  longlong *plVar15;
  longlong *local_40;
  ulonglong local_38;
  
  lVar11 = param_1[4];
  lVar2 = param_1[1];
  lVar3 = *param_1;
  local_40 = (longlong *)0x0;
  local_38 = param_2;
  FUN_140346140(&local_40);
  lVar4 = param_1[1];
  puVar5 = (undefined8 *)*param_1;
  *param_1 = 0;
  param_1[1] = lVar4;
  param_1[4] = 0;
  for (plVar15 = (longlong *)param_1[6]; plVar15 != (longlong *)(lVar3 + lVar2 * 8);
      plVar15 = plVar15 + 1) {
    plVar10 = (longlong *)*plVar15;
    while (plVar10 != (longlong *)0x0) {
      puVar9 = (ushort *)(plVar10 + 1);
      puVar12 = puVar9;
      if (7 < (ulonglong)plVar10[4]) {
        puVar12 = *(ushort **)puVar9;
      }
      uVar13 = 0;
      if (7 < (ulonglong)plVar10[4]) {
        puVar9 = *(ushort **)puVar9;
      }
      for (; puVar9 != puVar12 + plVar10[3]; puVar9 = puVar9 + 1) {
        uVar1 = *puVar9;
        uVar13 = uVar13 ^ (ulonglong)uVar1 + (uVar13 >> 2) + uVar13 * 0x40 + 0x9e3779b9;
      }
      *plVar15 = *plVar10;
      *plVar10 = local_40[uVar13 % local_38];
      local_40[uVar13 % local_38] = (longlong)plVar10;
      plVar10 = (longlong *)*plVar15;
    }
  }
  param_1[4] = lVar11;
  plVar15 = (longlong *)*param_1;
  *param_1 = (longlong)local_40;
  uVar13 = param_1[1];
  param_1[1] = local_38;
  if (param_1[4] == 0) {
    param_1[6] = *param_1 + local_38 * 8;
  }
  else {
    plVar10 = (longlong *)*param_1;
    param_1[6] = (longlong)plVar10;
    lVar11 = *plVar10;
    while (lVar11 == 0) {
      plVar10 = plVar10 + 1;
      param_1[6] = (longlong)plVar10;
      lVar11 = *plVar10;
    }
  }
  local_40 = plVar15;
  local_38 = uVar13;
  lVar11 = FUN_1402961d0(param_1);
  param_1[7] = lVar11;
  if (puVar5 != (undefined8 *)0x0) {
    for (puVar14 = puVar5; puVar14 != puVar5 + lVar4; puVar14 = puVar14 + 1) {
      puVar6 = (undefined8 *)*puVar14;
      *puVar14 = 0;
      while (puVar6 != (undefined8 *)0x0) {
        puVar7 = (undefined8 *)*puVar6;
        if (7 < (ulonglong)puVar6[4]) {
          operator_delete((void *)puVar6[1]);
        }
        puVar6[4] = 7;
        puVar6[3] = 0;
        *(undefined2 *)(puVar6 + 1) = 0;
        operator_delete(puVar6);
        puVar6 = puVar7;
      }
    }
    operator_delete(puVar5);
    uVar13 = local_38;
    plVar15 = local_40;
  }
  if (plVar15 != (longlong *)0x0) {
    plVar10 = plVar15 + uVar13;
    plVar8 = plVar15;
    for (; plVar15 != plVar10; plVar15 = plVar15 + 1) {
      puVar5 = (undefined8 *)*plVar15;
      *plVar15 = 0;
      while (puVar5 != (undefined8 *)0x0) {
        puVar14 = (undefined8 *)*puVar5;
        if (7 < (ulonglong)puVar5[4]) {
          operator_delete((void *)puVar5[1]);
        }
        puVar5[4] = 7;
        puVar5[3] = 0;
        *(undefined2 *)(puVar5 + 1) = 0;
        operator_delete(puVar5);
        puVar5 = puVar14;
      }
      plVar8 = local_40;
    }
    operator_delete(plVar8);
  }
  return;
}



void FUN_14015ad60(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 (7 < *(ulonglong *)(lVar1 + 0x20)) {
      operator_delete(*(void **)(lVar1 + 8));
    }
    *(undefined8 *)(lVar1 + 0x20) = 7;
    *(undefined8 *)(lVar1 + 0x18) = 0;
    *(undefined2 *)(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_1405d3608);
}



void FUN_14015ae50(undefined4 *param_1,longlong param_2,undefined4 *param_3)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  undefined4 *puVar4;
  undefined4 *puVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  
  lVar8 = (longlong)param_3 - (longlong)param_1 >> 2;
  lVar9 = param_2 - (longlong)param_1 >> 2;
  lVar3 = lVar9;
  lVar10 = lVar8;
  while (lVar2 = lVar3, lVar2 != 0) {
    lVar3 = lVar10 % lVar2;
    lVar10 = lVar2;
  }
  if ((lVar10 < lVar8) && (0 < lVar10)) {
    puVar7 = param_1 + lVar10;
    do {
      puVar5 = puVar7 + lVar9;
      puVar6 = puVar7;
      if (puVar7 + lVar9 == param_3) {
        puVar5 = param_1;
      }
      do {
        puVar4 = puVar5;
        uVar1 = *puVar6;
        *puVar6 = *puVar4;
        *puVar4 = uVar1;
        lVar3 = (longlong)param_3 - (longlong)puVar4 >> 2;
        if (lVar9 < lVar3) {
          puVar5 = puVar4 + lVar9;
        }
        else {
          puVar5 = param_1 + (lVar9 - lVar3);
        }
        puVar6 = puVar4;
      } while (puVar5 != puVar7);
      lVar10 = lVar10 + -1;
      puVar7 = puVar7 + -1;
    } while (0 < lVar10);
  }
  return;
}



undefined2 * FUN_14015af10(longlong param_1,longlong param_2,undefined2 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  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_1400015e0(param_3,param_1,0,0xffffffffffffffff,uVar1,param_3,param_3);
    }
    param_3 = param_3 + 0x14;
  }
  return param_3;
}



ulonglong FUN_14015afa0(ushort *param_1)

{
  ushort *puVar1;
  ushort *puVar2;
  ulonglong uVar3;
  
  puVar2 = param_1;
  if (7 < *(ulonglong *)(param_1 + 0xc)) {
    puVar2 = *(ushort **)param_1;
  }
  puVar1 = param_1 + 8;
  if (7 < *(ulonglong *)(param_1 + 0xc)) {
    param_1 = *(ushort **)param_1;
  }
  uVar3 = 0;
  for (; param_1 != puVar2 + *(longlong *)puVar1; param_1 = param_1 + 1) {
    uVar3 = uVar3 ^ (ulonglong)*param_1 + (uVar3 >> 2) + uVar3 * 0x40 + 0x9e3779b9;
  }
  return uVar3;
}



longlong FUN_14015b000(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x28) {
    FUN_1400015e0(param_3,param_1,0,0xffffffffffffffff);
    param_3 = param_3 + 0x28;
  }
  return param_3;
}



undefined8 FUN_14015b060(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 (0x666666666666666 < param_2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      uVar2 = (*pcVar1)();
      return uVar2;
    }
    lVar3 = FUN_14008f5c0(param_2);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    lVar3 = lVar3 + param_2 * 0x28;
    param_1[2] = lVar3;
    uVar2 = CONCAT71((int7)((ulonglong)lVar3 >> 8),1);
  }
  return uVar2;
}



undefined2 * FUN_14015b0d0(longlong param_1,longlong param_2,undefined2 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  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_1400015e0(param_3,param_1,0,0xffffffffffffffff,uVar1);
    }
    param_3 = param_3 + 0x14;
  }
  return param_3;
}



longlong * FUN_14015b160(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  char cVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong lVar7;
  
  lVar6 = *param_2;
  uVar2 = (param_2[1] - lVar6) / 0x28;
  if (uVar2 == 0) {
    FUN_140123dc0(param_1);
    return param_1;
  }
  lVar1 = *param_1;
  uVar3 = (param_1[1] - lVar1) / 0x28;
  if (uVar3 < uVar2) {
    if ((ulonglong)((param_1[2] - lVar1) / 0x28) < uVar2) {
      if (lVar1 != 0) {
        FUN_14008d0a0(lVar1,param_1[1]);
        operator_delete((void *)*param_1);
      }
      cVar4 = FUN_14015b060(param_1,(param_2[1] - *param_2) / 0x28);
      if (cVar4 == '\0') {
        return param_1;
      }
      lVar6 = *param_1;
      lVar7 = *param_2;
    }
    else {
      lVar7 = lVar6 + uVar3 * 0x28;
      FUN_14015b000(lVar6,lVar7,lVar1);
      lVar6 = param_1[1];
    }
    lVar6 = FUN_14015b0d0(lVar7,param_2[1],lVar6);
    param_1[1] = lVar6;
  }
  else {
    uVar5 = FUN_14015b000(lVar6,param_2[1],lVar1);
    FUN_14008d0a0(uVar5,param_1[1]);
    param_1[1] = *param_1 + ((param_2[1] - *param_2) / 0x28) * 0x28;
  }
  return param_1;
}



int FUN_14015b2f0(int param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  iVar2 = (param_2 - param_1) + 1;
  if (iVar2 == 0) {
    return 0;
  }
  iVar1 = rand();
  return param_1 + iVar1 % iVar2;
}



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

{
  *param_1 = 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;
  *(undefined4 *)(param_1 + 8) = 1;
  *(undefined8 *)((longlong)param_1 + 0x54) = 0;
  param_1[0x17] = 7;
  param_1[0x16] = 0;
  *(undefined2 *)(param_1 + 0x14) = 0;
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  *(undefined8 *)((longlong)param_1 + 0x44) = 0;
  *(undefined8 *)((longlong)param_1 + 0x4c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5c) = 0;
  *(undefined8 *)((longlong)param_1 + 100) = 0;
  *(undefined8 *)((longlong)param_1 + 0x6c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x74) = 0;
  *(undefined8 *)((longlong)param_1 + 0x7c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x84) = 0;
  *(undefined8 *)((longlong)param_1 + 0x8c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x94) = 0;
  FUN_140001710(param_1 + 0x14,&DAT_140477960,0,param_4,0xfffffffffffffffe);
  return param_1;
}



longlong FUN_14015b3e0(longlong param_1,type_info *param_2)

{
  bool bVar1;
  
  bVar1 = type_info::operator==
                    (param_2,(type_info *)&boost::checked_array_deleter<float>::RTTI_Type_Descriptor
                    );
  if (bVar1) {
    return param_1 + 0x18;
  }
  return 0;
}



undefined8 * FUN_14015b420(undefined8 *param_1,undefined8 param_2)

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



void FUN_14015b490(undefined8 *param_1)

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



// WARNING: Removing unreachable block (ram,0x00014015b6b2)
// WARNING: Removing unreachable block (ram,0x00014015b6bb)
// WARNING: Removing unreachable block (ram,0x00014015b6dc)
// WARNING: Removing unreachable block (ram,0x00014015b6e5)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined4 * FUN_14015b4b0(void)

{
  undefined4 *puVar1;
  
  DAT_140609430 = 0;
  _DAT_140609434 = 0x100;
  _DAT_14060943c = 0;
  _DAT_140609440 = 0x1000001;
  DAT_14060944c = 0;
  _DAT_140609450 = 0;
  _DAT_140609458 = 0;
  DAT_14060945a = 0;
  DAT_14060945c = 0x17;
  DAT_140609460 = 3000;
  _DAT_140609464 = 65000;
  DAT_140609468 = 0;
  DAT_140609470 = 0;
  DAT_140609478 = 1000;
  DAT_14060947c = 1000;
  DAT_140609480 = 200;
  DAT_140609484 = 300;
  DAT_140609488 = 3;
  _DAT_14060948c = 1;
  _DAT_140609494 = 0;
  DAT_14060949c = 0;
  DAT_1406094a0 = 0;
  DAT_1406094a8 = 0;
  DAT_1406094b0 = 0;
  _DAT_1406094c0 = 0;
  DAT_1406094c8 = 0;
  _eh_vector_constructor_iterator_
            (&DAT_1406094d0,0x38,4,(_func_void_void_ptr *)&LAB_1401607a0,FUN_14015b7d0);
  puVar1 = &DAT_1406095b0;
  _eh_vector_constructor_iterator_
            (&DAT_1406095b0,0x38,8,(_func_void_void_ptr *)&LAB_1401607a0,FUN_14015b7d0);
  _eh_vector_constructor_iterator_
            (&DAT_140609770,0x30,0x19,(_func_void_void_ptr *)&LAB_140160780,FUN_14015b810);
  DAT_140609c20 = 0;
  DAT_140609c28 = 0;
  DAT_140609c30 = 0x11;
  _DAT_140609c50 = 0;
  _DAT_140609c54 = 10;
  _DAT_140609c58 = 0;
  _DAT_140609c60 = 0;
  _DAT_140609c34 = 0x3f400000;
  _DAT_140609c38 = 0x3e800000;
  _DAT_140609c3c = 0x40100000;
  _DAT_140609c40 = 0x26;
  _DAT_140609c48 = 0;
  DAT_140609c68 = 0;
  DAT_140609c6c = 0;
  DAT_140609c70 = 0;
  DAT_140609c74 = 0;
  FUN_14015f7f0(&DAT_140609c78);
  FUN_14015f7f0(&DAT_140609c98);
  DAT_140609cc8 = 0;
  DAT_140609ccc = 10;
  DAT_140609cd0 = 50000;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 0x1c;
  } while ((longlong)puVar1 < 0x140609770);
  puVar1 = &DAT_1406095e8;
  do {
    *puVar1 = 0;
    puVar1 = puVar1 + 0x1c;
  } while ((longlong)puVar1 < 0x1406097a8);
  _DAT_140609cb8 = 0x3f8000003f800000;
  _DAT_140609cc0 = 0x3f8000003f800000;
  FUN_14015bad0();
  return &DAT_140609430;
}



void FUN_14015b7d0(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_14015b810(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_14015fde0(void)

{
  FUN_14015fde0();
  return;
}



void FUN_14015b860(void)

{
  undefined1 local_res18 [16];
  
  FUN_1402163c0(&DAT_140609c98,local_res18,*DAT_140609ca0,DAT_140609ca0,0xfffffffffffffffe);
  operator_delete(DAT_140609ca0);
  FUN_1402163c0(&DAT_140609c78,local_res18,*DAT_140609c80,DAT_140609c80);
  operator_delete(DAT_140609c80);
  FUN_14015fde0(&DAT_140609c20);
  _eh_vector_destructor_iterator_(&DAT_140609770,0x30,0x19,FUN_14015b810);
  _eh_vector_destructor_iterator_(&DAT_1406095b0,0x38,8,FUN_14015b7d0);
  _eh_vector_destructor_iterator_(&DAT_1406094d0,0x38,4,FUN_14015b7d0);
  if (DAT_1406094a0 != (void *)0x0) {
    operator_delete(DAT_1406094a0);
  }
  DAT_1406094a0 = (void *)0x0;
  DAT_1406094a8 = 0;
  DAT_1406094b0 = 0;
  return;
}



void FUN_14015b970(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_14015b9d0(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_14015ba30(int param_1,undefined4 param_2)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 **ppuVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined8 local_res18;
  undefined8 *local_res20;
  undefined1 local_18 [24];
  
  cVar1 = *(char *)((longlong)DAT_140609c80[1] + 0x21);
  puVar2 = (undefined8 *)DAT_140609c80[1];
  local_res18 = DAT_140609c80;
  while (puVar5 = puVar2, cVar1 == '\0') {
    if (*(int *)(puVar5 + 3) < param_1) {
      puVar2 = (undefined8 *)puVar5[2];
      puVar5 = local_res18;
    }
    else {
      puVar2 = (undefined8 *)*puVar5;
    }
    cVar1 = *(char *)((longlong)puVar2 + 0x21);
    local_res18 = puVar5;
  }
  if ((local_res18 == DAT_140609c80) || (param_1 < *(int *)(local_res18 + 3))) {
    local_res20 = DAT_140609c80;
    ppuVar3 = &local_res20;
  }
  else {
    ppuVar3 = (undefined8 **)&local_res18;
  }
  if (*ppuVar3 == DAT_140609c80) {
    local_res18 = (undefined8 *)CONCAT44(param_2,param_1);
    uVar4 = FUN_1401604c0(&DAT_140609c78,&local_res18);
    FUN_14015ff90(&DAT_140609c78,local_18,uVar4);
    return;
  }
  *(undefined4 *)((longlong)*ppuVar3 + 0x1c) = param_2;
  return;
}



void FUN_14015bad0(void)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  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;
  int local_24;
  int local_20;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  if (DAT_140609c88 == 0) {
    FUN_14015ba30(2);
    FUN_14015ba30(1);
    FUN_14015ba30(3);
    FUN_14015ba30(4);
    FUN_14015ba30(5);
    FUN_14015ba30(6);
  }
  DAT_140609470 = 0x3fc3333333333333;
  DAT_140609468 = 0x3fc3333333333333;
  puVar4 = &DAT_1405e7440;
  if (0xf < DAT_1405e7458) {
    puVar4 = DAT_1405e7440;
  }
  FUN_14000ff80(local_98,puVar4);
  DAT_1405e0652 = 0;
  cVar1 = FUN_140010050(local_98,local_60 + 2);
  plVar5 = local_70;
  if (cVar1 == '\0') {
    FUN_1404189a0(DAT_140607fd8,"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_140607be8) {
      operator_delete__(local_30);
    }
    local_98[0] = TiXmlNode::vftable;
    while (local_70 != (longlong *)0x0) {
      plVar5 = (longlong *)local_70[10];
      (**(code **)*local_70)(local_70,1);
      local_70 = plVar5;
    }
    if (local_60 == &DAT_140607be8) {
      return;
    }
    operator_delete__(local_58);
    return;
  }
  for (; plVar5 != (longlong *)0x0; plVar5 = (longlong *)plVar5[10]) {
    bVar8 = (char *)(plVar5[7] + 0x10) == (char *)0x0;
    lVar3 = 6;
    pcVar7 = (char *)(plVar5[7] + 0x10);
    pcVar6 = "limit";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar8 = *pcVar7 == *pcVar6;
      pcVar7 = pcVar7 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar8);
    if (bVar8) goto LAB_14015bc86;
  }
  goto LAB_14015c219;
code_r0x00014015bcfe:
  plVar5 = (longlong *)plVar5[10];
  if (plVar5 == (longlong *)0x0) goto LAB_14015c20f;
  goto LAB_14015bcf0;
LAB_14015bc86:
  while (lVar3 = (**(code **)(*plVar5 + 0x30))(plVar5), lVar3 == 0) {
    do {
      plVar5 = (longlong *)plVar5[10];
      if (plVar5 == (longlong *)0x0) goto LAB_14015c219;
      bVar8 = (char *)(plVar5[7] + 0x10) == (char *)0x0;
      lVar3 = 6;
      pcVar7 = (char *)(plVar5[7] + 0x10);
      pcVar6 = "limit";
      do {
        if (lVar3 == 0) break;
        lVar3 = lVar3 + -1;
        bVar8 = *pcVar7 == *pcVar6;
        pcVar7 = pcVar7 + 1;
        pcVar6 = pcVar6 + 1;
      } while (bVar8);
    } while (!bVar8);
  }
  lVar3 = (**(code **)(*plVar5 + 0x30))(plVar5);
  if (lVar3 != 0) {
    FUN_14012baa0(&DAT_1406094a0);
    plVar5 = *(longlong **)(lVar3 + 0x28);
    if (plVar5 != (longlong *)0x0) {
LAB_14015bcf0:
      lVar3 = (**(code **)(*plVar5 + 0x30))(plVar5);
      if (lVar3 == 0) goto code_r0x00014015bcfe;
      lVar3 = (**(code **)(*plVar5 + 0x30))(plVar5);
      while (lVar3 != 0) {
        pcVar7 = (char *)(*(longlong *)(lVar3 + 0x38) + 0x10);
        iVar2 = _stricmp(pcVar7,"avatar");
        if (iVar2 == 0) {
          FUN_14015c2b0(lVar3);
        }
        else {
          iVar2 = _stricmp(pcVar7,"class");
          if (iVar2 == 0) {
            FUN_14015c330(lVar3);
          }
          else {
            iVar2 = _stricmp(pcVar7,"level");
            if (iVar2 == 0) {
              FUN_14015c6a0(lVar3);
            }
            else {
              iVar2 = _stricmp(pcVar7,"shop");
              if (iVar2 == 0) {
                FUN_14015d1d0(lVar3);
              }
              else {
                iVar2 = _stricmp(pcVar7,"dungeon");
                if (iVar2 == 0) {
                  FUN_14015d3a0(lVar3);
                }
                else {
                  iVar2 = _stricmp(pcVar7,"cash_shop");
                  if (iVar2 == 0) {
                    FUN_14015c720(lVar3);
                  }
                  else {
                    iVar2 = _stricmp(pcVar7,"pcroom");
                    if (iVar2 == 0) {
                      FUN_14015c7f0(lVar3);
                    }
                    else {
                      iVar2 = _stricmp(pcVar7,"pvp_ladder");
                      if (iVar2 == 0) {
                        FUN_14015c8c0(lVar3);
                      }
                      else {
                        iVar2 = _stricmp(pcVar7,"pvp_massive");
                        if (iVar2 == 0) {
                          FUN_14015c940(lVar3);
                        }
                        else {
                          iVar2 = _stricmp(pcVar7,"pvp_raid");
                          if (iVar2 == 0) {
                            FUN_14015c9c0(lVar3);
                          }
                          else {
                            iVar2 = _stricmp(pcVar7,"pvp_ladder_pingcheck");
                            if (iVar2 == 0) {
                              FUN_14015ca40(lVar3);
                            }
                            else {
                              iVar2 = _stricmp(pcVar7,"inquiry");
                              if (iVar2 == 0) {
                                FUN_14015cb10(lVar3);
                              }
                              else {
                                iVar2 = _stricmp(pcVar7,"fortune");
                                if (iVar2 == 0) {
                                  FUN_14015cb90(lVar3);
                                }
                                else {
                                  iVar2 = _stricmp(pcVar7,"itemrune_mix");
                                  if (iVar2 == 0) {
                                    FUN_14015cc10(lVar3);
                                  }
                                  else {
                                    iVar2 = _stricmp(pcVar7,"party_summon");
                                    if (iVar2 == 0) {
                                      FUN_14015cc90(lVar3);
                                    }
                                    else {
                                      iVar2 = _stricmp(pcVar7,"trade_costume");
                                      if (iVar2 == 0) {
                                        FUN_14015cd10(lVar3);
                                      }
                                      else {
                                        iVar2 = _stricmp(pcVar7,"party_user");
                                        if (iVar2 == 0) {
                                          FUN_14015dbc0(lVar3);
                                        }
                                        else {
                                          iVar2 = _stricmp(pcVar7,"play_point");
                                          if (iVar2 == 0) {
                                            FUN_14015db40(lVar3);
                                          }
                                          else {
                                            iVar2 = _stricmp(pcVar7,"shut_down");
                                            if (iVar2 == 0) {
                                              FUN_14015cd90(lVar3);
                                            }
                                            else {
                                              iVar2 = _stricmp(pcVar7,"coupon");
                                              if (iVar2 == 0) {
                                                FUN_14015ce60(lVar3);
                                              }
                                              else {
                                                iVar2 = _stricmp(pcVar7,"pet_inven");
                                                if (iVar2 == 0) {
                                                  FUN_14015cee0(lVar3);
                                                }
                                                else {
                                                  iVar2 = _stricmp(pcVar7,"expid");
                                                  if (iVar2 == 0) {
                                                    FUN_14015cfe0(lVar3);
                                                  }
                                                  else {
                                                    iVar2 = _stricmp(pcVar7,"point_ratio");
                                                    if (iVar2 == 0) {
                                                      FUN_14015de60(lVar3);
                                                    }
                                                    else {
                                                      iVar2 = _stricmp(pcVar7,"auction");
                                                      if (iVar2 == 0) {
                                                        FUN_14015dff0(lVar3);
                                                      }
                                                      else {
                                                        iVar2 = _stricmp(pcVar7,"book_pictorial");
                                                        if (iVar2 == 0) {
                                                          FUN_14015cf60(lVar3);
                                                        }
                                                        else {
                                                          iVar2 = _stricmp(pcVar7,"party_mission");
                                                          if (iVar2 == 0) {
                                                            FUN_14015e0e0(lVar3);
                                                          }
                                                          else {
                                                            iVar2 = _stricmp(pcVar7,"hidden_dungeon"
                                                                            );
                                                            if (iVar2 == 0) {
                                                              FUN_14015e160(lVar3);
                                                            }
                                                            else {
                                                              iVar2 = _stricmp(pcVar7,"smart_server"
                                                                              );
                                                              if (iVar2 == 0) {
                                                                FUN_14015f100(lVar3);
                                                              }
                                                              else {
                                                                iVar2 = _stricmp(pcVar7,
                                                  "guild_content");
                                                  if (iVar2 == 0) {
                                                    FUN_14015f430(lVar3);
                                                  }
                                                  else {
                                                    iVar2 = _stricmp(pcVar7,"event");
                                                    if (iVar2 == 0) {
                                                      FUN_14015f530(lVar3);
                                                    }
                                                    else {
                                                      iVar2 = _stricmp(pcVar7,"guild_create");
                                                      if (iVar2 == 0) {
                                                        FUN_14015f5b0(lVar3);
                                                      }
                                                      else {
                                                        iVar2 = _stricmp(pcVar7,"quest_btn");
                                                        if (iVar2 == 0) {
                                                          FUN_14015f6d0(lVar3);
                                                        }
                                                        else {
                                                          iVar2 = _stricmp(pcVar7,"lobby_run");
                                                          if (iVar2 == 0) {
                                                            FUN_14015e1e0(lVar3);
                                                          }
                                                          else {
                                                            iVar2 = _stricmp(pcVar7,
                                                  "charaterslotblot");
                                                  if (iVar2 == 0) {
                                                    FUN_14015f2e0(lVar3);
                                                  }
                                                  else {
                                                    iVar2 = _stricmp(pcVar7,"bloodmode");
                                                    if (iVar2 == 0) {
                                                      FUN_14015f3b0(lVar3);
                                                    }
                                                    else {
                                                      iVar2 = _stricmp(pcVar7,"questblock");
                                                      if (iVar2 == 0) {
                                                        FUN_14015e260(lVar3);
                                                      }
                                                      else {
                                                        iVar2 = _stricmp(pcVar7,"log_display_level")
                                                        ;
                                                        if (iVar2 == 0) {
                                                          FUN_14015e380(lVar3);
                                                        }
                                                      }
                                                    }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        plVar5 = *(longlong **)(lVar3 + 0x50);
        while( true ) {
          if (plVar5 == (longlong *)0x0) goto LAB_14015c20f;
          lVar3 = (**(code **)(*plVar5 + 0x30))(plVar5);
          if (lVar3 != 0) break;
          plVar5 = (longlong *)plVar5[10];
        }
        lVar3 = (**(code **)(*plVar5 + 0x30))(plVar5);
      }
    }
LAB_14015c20f:
    FUN_14015e460();
  }
LAB_14015c219:
  local_98[0] = TiXmlDocument::vftable;
  if (local_38 != &DAT_140607be8) {
    operator_delete__(local_30);
  }
  local_98[0] = TiXmlNode::vftable;
  while (local_70 != (longlong *)0x0) {
    plVar5 = (longlong *)local_70[10];
    (**(code **)*local_70)(local_70,1);
    local_70 = plVar5;
  }
  if (local_60 != &DAT_140607be8) {
    operator_delete__(local_58);
  }
  return;
}



void FUN_14015c2b0(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  char *pcVar3;
  char *pcVar4;
  bool bVar5;
  
  lVar1 = *(longlong *)(param_1 + 0xa0);
  if (lVar1 == param_1 + 0x58) {
    return;
  }
  do {
    lVar2 = 0xc;
    pcVar3 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar5 = pcVar3 == (char *)0x0;
    pcVar4 = "only_create";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar5 = *pcVar3 == *pcVar4;
      pcVar3 = pcVar3 + 1;
      pcVar4 = pcVar4 + 1;
    } while (bVar5);
    if (bVar5) {
      pcVar3 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      if (pcVar3 == (char *)0x0) {
        return;
      }
      DAT_1406094c8 = atoi(pcVar3);
      return;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
    if (lVar1 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14015c330(longlong param_1)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  ulonglong uVar6;
  longlong lVar7;
  undefined8 *puVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  char *pcVar14;
  uint uVar15;
  bool bVar16;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  int local_60;
  uint uStack_5c;
  int local_58;
  undefined1 local_50;
  undefined7 uStack_4f;
  undefined8 local_40;
  ulonglong local_38;
  ulonglong local_28;
  
  local_68 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  lVar7 = param_1 + 0x58;
  pcVar14 = (char *)0x0;
  lVar2 = *(longlong *)(param_1 + 0xa0);
  for (lVar5 = lVar2; lVar4 = lVar2, pcVar9 = pcVar14, lVar5 != lVar7;
      lVar5 = *(longlong *)(lVar5 + 0x48)) {
    pcVar9 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar16 = pcVar9 == (char *)0x0;
    lVar3 = 4;
    pcVar10 = "use";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar16 = *pcVar9 == *pcVar10;
      pcVar9 = pcVar9 + 1;
      pcVar10 = pcVar10 + 1;
    } while (bVar16);
    if (bVar16) {
      pcVar9 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar5 = lVar2;
    pcVar10 = pcVar14;
    if (lVar4 == lVar7) break;
    pcVar10 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar16 = pcVar10 == (char *)0x0;
    lVar3 = 3;
    pcVar11 = "id";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar16 = *pcVar10 == *pcVar11;
      pcVar10 = pcVar10 + 1;
      pcVar11 = pcVar11 + 1;
    } while (bVar16);
    if (bVar16) {
      pcVar10 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
joined_r0x00014015c3e6:
  pcVar11 = pcVar14;
  if (lVar5 == lVar7) goto joined_r0x00014015c423;
  pcVar11 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar16 = pcVar11 == (char *)0x0;
  lVar4 = 5;
  pcVar12 = "name";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar16 = *pcVar11 == *pcVar12;
    pcVar11 = pcVar11 + 1;
    pcVar12 = pcVar12 + 1;
  } while (bVar16);
  if (bVar16) {
    pcVar11 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x00014015c423;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x00014015c3e6;
joined_r0x00014015c423:
  pcVar12 = pcVar14;
  if (lVar2 == lVar7) goto LAB_14015c460;
  pcVar12 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar16 = pcVar12 == (char *)0x0;
  lVar5 = 8;
  pcVar13 = "freeuse";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar16 = *pcVar12 == *pcVar13;
    pcVar12 = pcVar12 + 1;
    pcVar13 = pcVar13 + 1;
  } while (bVar16);
  if (bVar16) {
    pcVar12 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_14015c460;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x00014015c423;
LAB_14015c460:
  local_60 = 1;
  uStack_5c = 0;
  local_58 = 0;
  local_38 = 0xf;
  local_40 = 0;
  local_50 = 0;
  if (pcVar9 != (char *)0x0) {
    local_60 = atoi(pcVar9);
    pcVar14 = (char *)(ulonglong)uStack_5c;
  }
  uVar15 = (uint)pcVar14;
  if (pcVar10 != (char *)0x0) {
    uStack_5c = atoi(pcVar10);
    uVar15 = uStack_5c;
  }
  if (pcVar11 != (char *)0x0) {
    uVar6 = 0xffffffffffffffff;
    pcVar14 = pcVar11;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      cVar1 = *pcVar14;
      pcVar14 = pcVar14 + 1;
    } while (cVar1 != '\0');
    FUN_140003e50(&local_50,pcVar11,~uVar6 - 1);
    uVar15 = uStack_5c;
  }
  if (pcVar12 != (char *)0x0) {
    local_58 = atoi(pcVar12);
    uVar15 = uStack_5c;
  }
  if (uVar15 - 1 < 4) {
    lVar7 = (longlong)(int)(uVar15 - 1);
    (&DAT_1406094d0)[lVar7 * 0xe] = local_60;
    (&DAT_1406094d4)[lVar7 * 0xe] = uStack_5c;
    (&DAT_1406094d8)[lVar7 * 0xe] = local_58;
    puVar8 = &DAT_1406094e0 + lVar7 * 7;
  }
  else if (uVar15 == 0x65) {
    puVar8 = &DAT_1406095c0;
    DAT_1406095b4 = 0x65;
    DAT_1406095b0 = local_60;
    DAT_1406095b8 = local_58;
  }
  else if (uVar15 == 0xc9) {
    puVar8 = &DAT_140609630;
    DAT_140609624 = 0xc9;
    DAT_140609620 = local_60;
    DAT_140609628 = local_58;
  }
  else if (uVar15 == 0x12d) {
    puVar8 = (undefined8 *)&DAT_1406096a0;
    _DAT_140609694 = 0x12d;
    _DAT_140609690 = local_60;
    _DAT_140609698 = local_58;
  }
  else if (uVar15 == 0x191) {
    puVar8 = (undefined8 *)&DAT_140609710;
    _DAT_140609704 = 0x191;
    _DAT_140609700 = local_60;
    _DAT_140609708 = local_58;
  }
  else if (uVar15 == 0x66) {
    puVar8 = &DAT_1406095f8;
    DAT_1406095ec = 0x66;
    DAT_1406095e8 = local_60;
    DAT_1406095f0 = local_58;
  }
  else if (uVar15 == 0xca) {
    puVar8 = &DAT_140609668;
    DAT_14060965c = 0xca;
    DAT_140609658 = local_60;
    DAT_140609660 = local_58;
  }
  else if (uVar15 == 0x12e) {
    puVar8 = (undefined8 *)&DAT_1406096d8;
    _DAT_1406096cc = 0x12e;
    _DAT_1406096c8 = local_60;
    _DAT_1406096d0 = local_58;
  }
  else {
    if (uVar15 != 0x192) goto LAB_14015c665;
    puVar8 = (undefined8 *)&DAT_140609748;
    _DAT_14060973c = 0x192;
    _DAT_140609738 = local_60;
    _DAT_140609740 = local_58;
  }
  FUN_140003d90(puVar8,&local_50,0,0xffffffffffffffff);
LAB_14015c665:
  if (0xf < local_38) {
    operator_delete((void *)CONCAT71(uStack_4f,local_50));
  }
  return;
}



void FUN_14015c6a0(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  char *pcVar3;
  char *pcVar4;
  bool bVar5;
  
  lVar1 = *(longlong *)(param_1 + 0xa0);
  if (lVar1 == param_1 + 0x58) {
    return;
  }
  do {
    lVar2 = 6;
    pcVar3 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar5 = pcVar3 == (char *)0x0;
    pcVar4 = "value";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar5 = *pcVar3 == *pcVar4;
      pcVar3 = pcVar3 + 1;
      pcVar4 = pcVar4 + 1;
    } while (bVar5);
    if (bVar5) {
      pcVar3 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      if (pcVar3 == (char *)0x0) {
        return;
      }
      DAT_140609430 = atoi(pcVar3);
      return;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
    if (lVar1 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015c720(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  
  lVar1 = param_1 + 0x58;
  lVar3 = *(longlong *)(param_1 + 0xa0);
  do {
    if (lVar3 == lVar1) {
LAB_14015c77c:
      lVar3 = *(longlong *)(param_1 + 0xa0);
      if (lVar3 == lVar1) {
        return;
      }
      do {
        lVar4 = 9;
        pcVar5 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
        bVar7 = pcVar5 == (char *)0x0;
        pcVar6 = "all_view";
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          bVar7 = *pcVar5 == *pcVar6;
          pcVar5 = pcVar5 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar7);
        if (bVar7) {
          pcVar5 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
          if (pcVar5 == (char *)0x0) {
            return;
          }
          iVar2 = atoi(pcVar5);
          DAT_140609434 = 0 < iVar2;
          return;
        }
        lVar3 = *(longlong *)(lVar3 + 0x48);
        if (lVar3 == lVar1) {
          return;
        }
      } while( true );
    }
    lVar4 = 4;
    pcVar5 = (char *)(*(longlong *)(lVar3 + 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 *)(lVar3 + 0x30) + 0x10);
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        DAT_140609435 = 0 < iVar2;
      }
      goto LAB_14015c77c;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
}



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

void FUN_14015c7f0(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  
  lVar1 = param_1 + 0x58;
  lVar3 = *(longlong *)(param_1 + 0xa0);
  do {
    if (lVar3 == lVar1) {
LAB_14015c84c:
      lVar3 = *(longlong *)(param_1 + 0xa0);
      if (lVar3 == lVar1) {
        return;
      }
      do {
        lVar4 = 6;
        pcVar5 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
        bVar7 = pcVar5 == (char *)0x0;
        pcVar6 = "value";
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          bVar7 = *pcVar5 == *pcVar6;
          pcVar5 = pcVar5 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar7);
        if (bVar7) {
          pcVar5 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
          if (pcVar5 == (char *)0x0) {
            return;
          }
          _DAT_140609464 = atoi(pcVar5);
          return;
        }
        lVar3 = *(longlong *)(lVar3 + 0x48);
        if (lVar3 == lVar1) {
          return;
        }
      } while( true );
    }
    lVar4 = 4;
    pcVar5 = (char *)(*(longlong *)(lVar3 + 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 *)(lVar3 + 0x30) + 0x10);
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        DAT_14060943b = 0 < iVar2;
      }
      goto LAB_14015c84c;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
}



void FUN_14015c8c0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_140609436 = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015c940(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_140609437 = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015c9c0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_140609438 = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015ca40(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  
  lVar1 = param_1 + 0x58;
  lVar3 = *(longlong *)(param_1 + 0xa0);
  do {
    if (lVar3 == lVar1) {
LAB_14015ca9c:
      lVar3 = *(longlong *)(param_1 + 0xa0);
      if (lVar3 == lVar1) {
        return;
      }
      do {
        lVar4 = 5;
        pcVar5 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
        bVar7 = pcVar5 == (char *)0x0;
        pcVar6 = "time";
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          bVar7 = *pcVar5 == *pcVar6;
          pcVar5 = pcVar5 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar7);
        if (bVar7) {
          pcVar5 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
          if (pcVar5 == (char *)0x0) {
            return;
          }
          DAT_140609460 = atoi(pcVar5);
          return;
        }
        lVar3 = *(longlong *)(lVar3 + 0x48);
        if (lVar3 == lVar1) {
          return;
        }
      } while( true );
    }
    lVar4 = 4;
    pcVar5 = (char *)(*(longlong *)(lVar3 + 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 *)(lVar3 + 0x30) + 0x10);
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        DAT_140609439 = 0 < iVar2;
      }
      goto LAB_14015ca9c;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
}



void FUN_14015cb10(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_14060943a = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015cb90(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_14060943c = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015cc10(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_14060943d = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015cc90(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_14060943e = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015cd10(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_14060943f = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015cd90(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  
  lVar1 = param_1 + 0x58;
  lVar3 = *(longlong *)(param_1 + 0xa0);
  do {
    if (lVar3 == lVar1) {
LAB_14015cdec:
      lVar3 = *(longlong *)(param_1 + 0xa0);
      if (lVar3 == lVar1) {
        return;
      }
      do {
        lVar4 = 5;
        pcVar5 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
        bVar7 = pcVar5 == (char *)0x0;
        pcVar6 = "time";
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          bVar7 = *pcVar5 == *pcVar6;
          pcVar5 = pcVar5 + 1;
          pcVar6 = pcVar6 + 1;
        } while (bVar7);
        if (bVar7) {
          pcVar5 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
          if (pcVar5 == (char *)0x0) {
            return;
          }
          DAT_14060945c = atoi(pcVar5);
          return;
        }
        lVar3 = *(longlong *)(lVar3 + 0x48);
        if (lVar3 == lVar1) {
          return;
        }
      } while( true );
    }
    lVar4 = 4;
    pcVar5 = (char *)(*(longlong *)(lVar3 + 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 *)(lVar3 + 0x30) + 0x10);
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        DAT_140609441 = 0 < iVar2;
      }
      goto LAB_14015cdec;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
}



void FUN_14015ce60(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_140609442 = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015cee0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_14060944c = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015cf60(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_140609458 = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015cfe0(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  char *_Str;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  bool bVar13;
  
  lVar1 = param_1 + 0x58;
  _Str = (char *)0x0;
  lVar2 = *(longlong *)(param_1 + 0xa0);
  for (lVar6 = lVar2; lVar3 = lVar2, pcVar7 = _Str, lVar6 != lVar1;
      lVar6 = *(longlong *)(lVar6 + 0x48)) {
    lVar5 = 6;
    pcVar7 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar13 = pcVar7 == (char *)0x0;
    pcVar8 = "level";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar13 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar13);
    if (bVar13) {
      pcVar7 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar6 = lVar2;
    pcVar8 = _Str;
    if (lVar3 == lVar1) break;
    lVar5 = 5;
    pcVar8 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar13 = pcVar8 == (char *)0x0;
    pcVar9 = "mail";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar13 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar13);
    if (bVar13) {
      pcVar8 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
joined_r0x00014015d07e:
  lVar3 = lVar2;
  pcVar9 = _Str;
  if (lVar6 == lVar1) goto joined_r0x00014015d0ae;
  lVar5 = 6;
  pcVar9 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
  bVar13 = pcVar9 == (char *)0x0;
  pcVar10 = "trade";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar13 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar13);
  if (bVar13) {
    pcVar9 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
    goto joined_r0x00014015d0ae;
  }
  lVar6 = *(longlong *)(lVar6 + 0x48);
  goto joined_r0x00014015d07e;
joined_r0x00014015d0ae:
  pcVar10 = _Str;
  if (lVar3 == lVar1) goto joined_r0x00014015d0d7;
  lVar6 = 8;
  pcVar10 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
  bVar13 = pcVar10 == (char *)0x0;
  pcVar11 = "auction";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar13 = *pcVar10 == *pcVar11;
    pcVar10 = pcVar10 + 1;
    pcVar11 = pcVar11 + 1;
  } while (bVar13);
  if (bVar13) {
    pcVar10 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
    goto joined_r0x00014015d0d7;
  }
  lVar3 = *(longlong *)(lVar3 + 0x48);
  goto joined_r0x00014015d0ae;
joined_r0x00014015d0d7:
  if (lVar2 == lVar1) {
LAB_14015d139:
    if (pcVar7 != (char *)0x0) {
      DAT_140609450 = atoi(pcVar7);
    }
    if (pcVar8 != (char *)0x0) {
      iVar4 = atoi(pcVar8);
      DAT_140609454 = 0 < iVar4;
    }
    if (pcVar9 != (char *)0x0) {
      iVar4 = atoi(pcVar9);
      DAT_140609455 = 0 < iVar4;
    }
    if (pcVar10 != (char *)0x0) {
      iVar4 = atoi(pcVar10);
      DAT_140609456 = 0 < iVar4;
    }
    if (_Str != (char *)0x0) {
      iVar4 = atoi(_Str);
      DAT_140609457 = 0 < iVar4;
    }
    return;
  }
  lVar6 = 5;
  pcVar11 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar13 = pcVar11 == (char *)0x0;
  pcVar12 = "shop";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar13 = *pcVar11 == *pcVar12;
    pcVar11 = pcVar11 + 1;
    pcVar12 = pcVar12 + 1;
  } while (bVar13);
  if (bVar13) {
    _Str = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_14015d139;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x00014015d0d7;
}



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

void FUN_14015d1d0(longlong param_1)

{
  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_68 [32];
  undefined8 local_48;
  undefined8 local_40;
  undefined1 local_38;
  undefined7 uStack_37;
  undefined8 local_28;
  ulonglong local_20;
  ulonglong local_10;
  
  local_48 = 0xfffffffffffffffe;
  local_10 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  lVar5 = param_1 + 0x58;
  pcVar12 = (char *)0x0;
  lVar2 = *(longlong *)(param_1 + 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_r0x00014015d283:
  if (lVar2 == lVar5) goto LAB_14015d2c0;
  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_14015d2c0;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x00014015d283;
LAB_14015d2c0:
  local_40 = 1;
  local_20 = 0xf;
  local_28 = 0;
  local_38 = 0;
  if (pcVar9 != (char *)0x0) {
    iVar4 = atoi(pcVar9);
    local_40 = CONCAT44(local_40._4_4_,iVar4);
  }
  if (pcVar10 != (char *)0x0) {
    iVar4 = atoi(pcVar10);
    local_40 = CONCAT44(iVar4,(undefined4)local_40);
  }
  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_140003e50(&local_38,pcVar12,~uVar8 - 1);
  }
  lVar5 = (longlong)local_40._4_4_;
  (&DAT_140609770)[lVar5 * 0xc] = (undefined4)local_40;
  (&DAT_140609774)[lVar5 * 0xc] = local_40._4_4_;
  FUN_140003d90(&DAT_140609778 + lVar5 * 6,&local_38,0,0xffffffffffffffff);
  if (0xf < local_20) {
    operator_delete((void *)CONCAT71(uStack_37,local_38));
  }
  return;
}



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

void FUN_14015d3a0(longlong param_1)

{
  longlong lVar1;
  char cVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  longlong lVar8;
  ulonglong uVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  char *pcVar14;
  char *pcVar15;
  char *pcVar16;
  bool bVar17;
  double dVar18;
  undefined1 auStack_268 [32];
  int *local_248;
  char *local_240;
  char *local_238;
  char *local_230;
  char *local_228;
  char *local_220;
  char *local_218;
  char *local_210;
  undefined8 local_208;
  int local_1f8;
  undefined1 local_1f0;
  undefined7 uStack_1ef;
  undefined8 local_1e0;
  ulonglong local_1d8;
  undefined1 local_1c8;
  undefined7 uStack_1c7;
  undefined8 local_1b8;
  ulonglong local_1b0;
  float local_1a0 [34];
  int local_118;
  int local_110 [2];
  undefined1 local_108;
  undefined7 uStack_107;
  undefined8 local_f8;
  ulonglong local_f0;
  undefined1 local_e0;
  undefined7 uStack_df;
  undefined8 local_d0;
  ulonglong local_c8;
  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;
  undefined8 local_68;
  undefined8 uStack_60;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 uStack_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  ulonglong local_38;
  
  local_208 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_268;
  lVar1 = param_1 + 0x58;
  pcVar10 = (char *)0x0;
  iVar6 = 0;
  lVar3 = *(longlong *)(param_1 + 0xa0);
  for (lVar8 = lVar3; lVar4 = lVar3, lVar8 != lVar1; lVar8 = *(longlong *)(lVar8 + 0x48)) {
    pcVar11 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
    bVar17 = pcVar11 == (char *)0x0;
    lVar7 = 4;
    pcVar12 = "use";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar17);
    if (bVar17) {
      local_228 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
      goto joined_r0x00014015d443;
    }
  }
  local_228 = (char *)0x0;
joined_r0x00014015d443:
  do {
    lVar8 = lVar3;
    if (lVar4 == lVar1) break;
    pcVar11 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar17 = pcVar11 == (char *)0x0;
    lVar7 = 3;
    pcVar12 = "id";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar17);
    if (bVar17) {
      local_210 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      goto joined_r0x00014015d48b;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
  local_210 = (char *)0x0;
joined_r0x00014015d48b:
  do {
    lVar4 = lVar3;
    if (lVar8 == lVar1) break;
    pcVar11 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
    bVar17 = pcVar11 == (char *)0x0;
    lVar7 = 5;
    pcVar12 = "name";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar17);
    if (bVar17) {
      local_230 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
      goto joined_r0x00014015d4cd;
    }
    lVar8 = *(longlong *)(lVar8 + 0x48);
  } while( true );
  local_230 = (char *)0x0;
joined_r0x00014015d4cd:
  do {
    lVar8 = lVar3;
    pcVar11 = pcVar10;
    if (lVar4 == lVar1) break;
    pcVar11 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar17 = pcVar11 == (char *)0x0;
    lVar7 = 5;
    pcVar12 = "diff";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar11 == *pcVar12;
      pcVar11 = pcVar11 + 1;
      pcVar12 = pcVar12 + 1;
    } while (bVar17);
    if (bVar17) {
      pcVar11 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
joined_r0x00014015d506:
  lVar4 = lVar3;
  if (lVar8 == lVar1) goto LAB_14015d540;
  pcVar12 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
  bVar17 = pcVar12 == (char *)0x0;
  lVar7 = 3;
  pcVar13 = "hp";
  do {
    if (lVar7 == 0) break;
    lVar7 = lVar7 + -1;
    bVar17 = *pcVar12 == *pcVar13;
    pcVar12 = pcVar12 + 1;
    pcVar13 = pcVar13 + 1;
  } while (bVar17);
  if (bVar17) {
    local_218 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
    goto joined_r0x00014015d54b;
  }
  lVar8 = *(longlong *)(lVar8 + 0x48);
  goto joined_r0x00014015d506;
LAB_14015d540:
  local_218 = (char *)0x0;
joined_r0x00014015d54b:
  do {
    lVar8 = lVar3;
    if (lVar4 == lVar1) break;
    pcVar12 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar7 = 6;
    pcVar13 = "delay";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      local_220 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      goto joined_r0x00014015d58d;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
  local_220 = (char *)0x0;
joined_r0x00014015d58d:
  do {
    lVar4 = lVar3;
    if (lVar8 == lVar1) break;
    pcVar12 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar7 = 6;
    pcVar13 = "combo";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      local_240 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
      goto joined_r0x00014015d5cd;
    }
    lVar8 = *(longlong *)(lVar8 + 0x48);
  } while( true );
  local_240 = (char *)0x0;
joined_r0x00014015d5cd:
  do {
    lVar8 = lVar3;
    if (lVar4 == lVar1) break;
    pcVar12 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar7 = 7;
    pcVar13 = "attack";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      local_238 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      goto joined_r0x00014015d60d;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
  local_238 = (char *)0x0;
joined_r0x00014015d60d:
  do {
    lVar4 = lVar3;
    if (lVar8 == lVar1) break;
    pcVar12 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar7 = 9;
    pcVar13 = "range_hp";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      local_248 = (int *)(*(longlong *)(lVar8 + 0x30) + 0x10);
      goto joined_r0x00014015d64d;
    }
    lVar8 = *(longlong *)(lVar8 + 0x48);
  } while( true );
  local_248 = (int *)0x0;
joined_r0x00014015d64d:
  do {
    lVar8 = lVar3;
    pcVar12 = pcVar10;
    if (lVar4 == lVar1) break;
    pcVar12 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar17 = pcVar12 == (char *)0x0;
    lVar7 = 0xc;
    pcVar13 = "range_delay";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar17 = *pcVar12 == *pcVar13;
      pcVar12 = pcVar12 + 1;
      pcVar13 = pcVar13 + 1;
    } while (bVar17);
    if (bVar17) {
      pcVar12 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
joined_r0x00014015d686:
  lVar4 = lVar3;
  pcVar13 = pcVar10;
  if (lVar8 == lVar1) goto joined_r0x00014015d6c6;
  pcVar13 = (char *)(*(longlong *)(lVar8 + 0x20) + 0x10);
  bVar17 = pcVar13 == (char *)0x0;
  lVar7 = 0xc;
  pcVar14 = "range_combo";
  do {
    if (lVar7 == 0) break;
    lVar7 = lVar7 + -1;
    bVar17 = *pcVar13 == *pcVar14;
    pcVar13 = pcVar13 + 1;
    pcVar14 = pcVar14 + 1;
  } while (bVar17);
  if (bVar17) {
    pcVar13 = (char *)(*(longlong *)(lVar8 + 0x30) + 0x10);
    goto joined_r0x00014015d6c6;
  }
  lVar8 = *(longlong *)(lVar8 + 0x48);
  goto joined_r0x00014015d686;
joined_r0x00014015d6c6:
  pcVar14 = pcVar10;
  if (lVar4 == lVar1) goto joined_r0x00014015d703;
  pcVar14 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
  bVar17 = pcVar14 == (char *)0x0;
  lVar8 = 0xd;
  pcVar15 = "range_attack";
  do {
    if (lVar8 == 0) break;
    lVar8 = lVar8 + -1;
    bVar17 = *pcVar14 == *pcVar15;
    pcVar14 = pcVar14 + 1;
    pcVar15 = pcVar15 + 1;
  } while (bVar17);
  if (bVar17) {
    pcVar14 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
    goto joined_r0x00014015d703;
  }
  lVar4 = *(longlong *)(lVar4 + 0x48);
  goto joined_r0x00014015d6c6;
joined_r0x00014015d703:
  if (lVar3 == lVar1) goto LAB_14015d740;
  pcVar15 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
  bVar17 = pcVar15 == (char *)0x0;
  lVar8 = 10;
  pcVar16 = "diff_open";
  do {
    if (lVar8 == 0) break;
    lVar8 = lVar8 + -1;
    bVar17 = *pcVar15 == *pcVar16;
    pcVar15 = pcVar15 + 1;
    pcVar16 = pcVar16 + 1;
  } while (bVar17);
  if (bVar17) {
    pcVar10 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
    goto LAB_14015d740;
  }
  lVar3 = *(longlong *)(lVar3 + 0x48);
  goto joined_r0x00014015d703;
LAB_14015d740:
  local_1d8 = 0xf;
  local_1e0 = 0;
  local_1f0 = 0;
  local_1b0 = 0xf;
  local_1b8 = 0;
  local_1c8 = 0;
  local_1a0[0] = 0.0;
  local_1a0[1] = 0.0;
  local_1a0[2] = 0.0;
  local_1a0[3] = 0.0;
  local_1a0[4] = 0.0;
  local_1a0[5] = 0.0;
  local_1a0[6] = 0.0;
  local_1a0[7] = 0.0;
  local_1a0[8] = 0.0;
  local_1a0[9] = 0.0;
  local_1a0[10] = 0.0;
  local_1a0[0xb] = 0.0;
  local_1a0[0xc] = 0.0;
  local_1a0[0xd] = 0.0;
  local_1a0[0xe] = 0.0;
  local_1a0[0xf] = 0.0;
  local_1a0[0x10] = 0.0;
  local_1a0[0x11] = 0.0;
  local_1a0[0x12] = 0.0;
  local_1a0[0x13] = 0.0;
  local_1a0[0x14] = 0.0;
  local_1a0[0x15] = 0.0;
  local_1a0[0x16] = 0.0;
  local_1a0[0x17] = 0.0;
  local_1a0[0x18] = 0.0;
  local_1a0[0x19] = 0.0;
  local_1a0[0x1a] = 0.0;
  local_1a0[0x1b] = 0.0;
  local_1a0[0x1c] = 0.0;
  local_1a0[0x1d] = 0.0;
  local_1a0[0x1e] = 0.0;
  local_1a0[0x1f] = 0.0;
  local_1f8 = 0xf0001;
  iVar5 = iVar6;
  if ((pcVar11 != (char *)0x0) && (iVar5 = atoi(pcVar11), 2 < iVar5)) {
    iVar5 = 3;
  }
  if (local_210 != (char *)0x0) {
    iVar6 = atoi(local_210);
  }
  if (local_228 != (char *)0x0) {
    local_1f8 = atoi(local_228);
  }
  if (local_230 != (char *)0x0) {
    uVar9 = 0xffffffffffffffff;
    pcVar11 = local_230;
    do {
      if (uVar9 == 0) break;
      uVar9 = uVar9 - 1;
      cVar2 = *pcVar11;
      pcVar11 = pcVar11 + 1;
    } while (cVar2 != '\0');
    FUN_140003e50(&local_1f0,local_230,~uVar9 - 1);
  }
  if (local_218 != (char *)0x0) {
    dVar18 = atof(local_218);
    local_1a0[(longlong)iVar5 * 8 + 2] = (float)dVar18;
  }
  if (local_220 != (char *)0x0) {
    dVar18 = atof(local_220);
    local_1a0[(longlong)iVar5 * 8] = (float)dVar18;
  }
  if (local_240 != (char *)0x0) {
    dVar18 = atof(local_240);
    local_1a0[(longlong)iVar5 * 8 + 1] = (float)dVar18;
  }
  if (local_238 != (char *)0x0) {
    dVar18 = atof(local_238);
    local_1a0[(longlong)iVar5 * 8 + 3] = (float)dVar18;
  }
  if (local_248 != (int *)0x0) {
    dVar18 = atof((char *)local_248);
    local_1a0[(longlong)iVar5 * 8 + 6] = (float)dVar18;
  }
  if (pcVar12 != (char *)0x0) {
    dVar18 = atof(pcVar12);
    local_1a0[(longlong)iVar5 * 8 + 4] = (float)dVar18;
  }
  if (pcVar13 != (char *)0x0) {
    dVar18 = atof(pcVar13);
    local_1a0[(longlong)iVar5 * 8 + 5] = (float)dVar18;
  }
  if (pcVar14 != (char *)0x0) {
    dVar18 = atof(pcVar14);
    local_1a0[(longlong)iVar5 * 8 + 7] = (float)dVar18;
  }
  if (pcVar10 != (char *)0x0) {
    uVar9 = 0xffffffffffffffff;
    pcVar11 = pcVar10;
    do {
      if (uVar9 == 0) break;
      uVar9 = uVar9 - 1;
      cVar2 = *pcVar11;
      pcVar11 = pcVar11 + 1;
    } while (cVar2 != '\0');
    FUN_140003e50(&local_1c8,pcVar10,~uVar9 - 1);
  }
  if (0 < iVar6) {
    local_248 = local_110;
    local_110[0] = local_1f8;
    local_f0 = 0xf;
    local_f8 = 0;
    local_108 = 0;
    local_118 = iVar6;
    FUN_140003d90(&local_108,&local_1f0,0,0xffffffffffffffff);
    local_c8 = 0xf;
    local_d0 = 0;
    local_e0 = 0;
    FUN_140003d90(&local_e0,&local_1c8,0,0xffffffffffffffff);
    local_b8 = CONCAT44(local_1a0[1],local_1a0[0]);
    uStack_b0 = CONCAT44(local_1a0[3],local_1a0[2]);
    local_a8 = CONCAT44(local_1a0[5],local_1a0[4]);
    uStack_a0 = CONCAT44(local_1a0[7],local_1a0[6]);
    local_98 = CONCAT44(local_1a0[9],local_1a0[8]);
    uStack_90 = CONCAT44(local_1a0[0xb],local_1a0[10]);
    local_88 = CONCAT44(local_1a0[0xd],local_1a0[0xc]);
    uStack_80 = CONCAT44(local_1a0[0xf],local_1a0[0xe]);
    local_78 = CONCAT44(local_1a0[0x11],local_1a0[0x10]);
    uStack_70 = CONCAT44(local_1a0[0x13],local_1a0[0x12]);
    local_68 = CONCAT44(local_1a0[0x15],local_1a0[0x14]);
    uStack_60 = CONCAT44(local_1a0[0x17],local_1a0[0x16]);
    local_58 = local_1a0[0x18];
    uStack_54 = local_1a0[0x19];
    uStack_50 = local_1a0[0x1a];
    uStack_4c = local_1a0[0x1b];
    local_48 = local_1a0[0x1c];
    uStack_44 = local_1a0[0x1d];
    uStack_40 = local_1a0[0x1e];
    uStack_3c = local_1a0[0x1f];
    FUN_14015fc40(&DAT_140609c20,local_118,local_110);
    if (0xf < local_c8) {
      operator_delete((void *)CONCAT71(uStack_df,local_e0));
    }
    local_c8 = 0xf;
    local_d0 = 0;
    local_e0 = 0;
    if (0xf < local_f0) {
      operator_delete((void *)CONCAT71(uStack_107,local_108));
    }
  }
  if (0xf < local_1b0) {
    operator_delete((void *)CONCAT71(uStack_1c7,local_1c8));
  }
  local_1b0 = 0xf;
  local_1b8 = 0;
  local_1c8 = 0;
  if (0xf < local_1d8) {
    operator_delete((void *)CONCAT71(uStack_1ef,local_1f0));
  }
  return;
}



void FUN_14015db40(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_140609440 = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015dbc0(longlong param_1)

{
  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 *pcVar13;
  char *_Str;
  bool bVar14;
  
  lVar1 = param_1 + 0x58;
  _Str = (char *)0x0;
  lVar2 = *(longlong *)(param_1 + 0xa0);
  for (lVar6 = lVar2; lVar5 = lVar2, pcVar7 = _Str, lVar6 != lVar1;
      lVar6 = *(longlong *)(lVar6 + 0x48)) {
    lVar4 = 9;
    pcVar7 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
    bVar14 = pcVar7 == (char *)0x0;
    pcVar8 = "solo_max";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar14 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar14);
    if (bVar14) {
      pcVar7 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar6 = lVar2;
    pcVar8 = _Str;
    if (lVar5 == lVar1) break;
    lVar4 = 0xd;
    pcVar8 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar14 = pcVar8 == (char *)0x0;
    pcVar9 = "tutorial_max";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar14 = *pcVar8 == *pcVar9;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    } while (bVar14);
    if (bVar14) {
      pcVar8 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
    lVar5 = *(longlong *)(lVar5 + 0x48);
  } while( true );
joined_r0x00014015dc5e:
  lVar5 = lVar2;
  pcVar9 = _Str;
  if (lVar6 == lVar1) goto joined_r0x00014015dc8e;
  lVar4 = 0xb;
  pcVar9 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
  bVar14 = pcVar9 == (char *)0x0;
  pcVar10 = "normal_max";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar14 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar14);
  if (bVar14) {
    pcVar9 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
    goto joined_r0x00014015dc8e;
  }
  lVar6 = *(longlong *)(lVar6 + 0x48);
  goto joined_r0x00014015dc5e;
joined_r0x00014015dc8e:
  lVar6 = lVar2;
  pcVar10 = _Str;
  if (lVar5 == lVar1) goto joined_r0x00014015dcbe;
  lVar4 = 0xd;
  pcVar10 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar14 = pcVar10 == (char *)0x0;
  pcVar11 = "matching_max";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar14 = *pcVar10 == *pcVar11;
    pcVar10 = pcVar10 + 1;
    pcVar11 = pcVar11 + 1;
  } while (bVar14);
  if (bVar14) {
    pcVar10 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x00014015dcbe;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x00014015dc8e;
joined_r0x00014015dcbe:
  pcVar11 = _Str;
  if (lVar6 == lVar1) goto joined_r0x00014015dce7;
  lVar5 = 9;
  pcVar11 = (char *)(*(longlong *)(lVar6 + 0x20) + 0x10);
  bVar14 = pcVar11 == (char *)0x0;
  pcVar12 = "raid_max";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar14 = *pcVar11 == *pcVar12;
    pcVar11 = pcVar11 + 1;
    pcVar12 = pcVar12 + 1;
  } while (bVar14);
  if (bVar14) {
    pcVar11 = (char *)(*(longlong *)(lVar6 + 0x30) + 0x10);
    goto joined_r0x00014015dce7;
  }
  lVar6 = *(longlong *)(lVar6 + 0x48);
  goto joined_r0x00014015dcbe;
joined_r0x00014015dce7:
  if (lVar2 == lVar1) {
LAB_14015dd59:
    if (pcVar7 == (char *)0x0) {
      iVar3 = 1;
    }
    else {
      iVar3 = atoi(pcVar7);
    }
    FUN_14015ba30(2,iVar3);
    if (pcVar8 == (char *)0x0) {
      iVar3 = 1;
    }
    else {
      iVar3 = atoi(pcVar8);
    }
    FUN_14015ba30(1,iVar3);
    if (pcVar9 == (char *)0x0) {
      iVar3 = 4;
    }
    else {
      iVar3 = atoi(pcVar9);
    }
    FUN_14015ba30(3,iVar3);
    if (pcVar10 == (char *)0x0) {
      iVar3 = 4;
    }
    else {
      iVar3 = atoi(pcVar10);
    }
    FUN_14015ba30(4,iVar3);
    if (pcVar11 == (char *)0x0) {
      iVar3 = 8;
    }
    else {
      iVar3 = atoi(pcVar11);
    }
    FUN_14015ba30(5,iVar3);
    if (_Str != (char *)0x0) {
      iVar3 = atoi(_Str);
      FUN_14015ba30(6,iVar3);
      return;
    }
    FUN_14015ba30(6);
    return;
  }
  lVar6 = 0xc;
  pcVar12 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar14 = pcVar12 == (char *)0x0;
  pcVar13 = "default_max";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar14 = *pcVar12 == *pcVar13;
    pcVar12 = pcVar12 + 1;
    pcVar13 = pcVar13 + 1;
  } while (bVar14);
  if (bVar14) {
    _Str = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_14015dd59;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x00014015dce7;
}



void FUN_14015de60(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  char *_String;
  char *pcVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  bool bVar11;
  double dVar12;
  
  lVar1 = param_1 + 0x58;
  _String = (char *)0x0;
  lVar2 = *(longlong *)(param_1 + 0xa0);
  for (lVar5 = lVar2; lVar4 = lVar2, pcVar6 = _String, lVar5 != lVar1;
      lVar5 = *(longlong *)(lVar5 + 0x48)) {
    lVar3 = 4;
    pcVar6 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar11 = pcVar6 == (char *)0x0;
    pcVar7 = "one";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar11 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar11);
    if (bVar11) {
      pcVar6 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar5 = lVar2;
    pcVar7 = _String;
    if (lVar4 == lVar1) break;
    lVar3 = 4;
    pcVar7 = (char *)(*(longlong *)(lVar4 + 0x20) + 0x10);
    bVar11 = pcVar7 == (char *)0x0;
    pcVar8 = "two";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar11 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar11);
    if (bVar11) {
      pcVar7 = (char *)(*(longlong *)(lVar4 + 0x30) + 0x10);
      break;
    }
    lVar4 = *(longlong *)(lVar4 + 0x48);
  } while( true );
joined_r0x00014015deea:
  pcVar8 = _String;
  if (lVar5 == lVar1) goto joined_r0x00014015df17;
  lVar4 = 6;
  pcVar8 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar11 = pcVar8 == (char *)0x0;
  pcVar9 = "three";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar11 = *pcVar8 == *pcVar9;
    pcVar8 = pcVar8 + 1;
    pcVar9 = pcVar9 + 1;
  } while (bVar11);
  if (bVar11) {
    pcVar8 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x00014015df17;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x00014015deea;
joined_r0x00014015df17:
  if (lVar2 == lVar1) {
LAB_14015df6c:
    if (pcVar6 != (char *)0x0) {
      dVar12 = atof(pcVar6);
      DAT_140609cb8 = (float)dVar12;
    }
    if (pcVar7 != (char *)0x0) {
      dVar12 = atof(pcVar7);
      DAT_140609cbc = (float)dVar12;
    }
    if (pcVar8 != (char *)0x0) {
      dVar12 = atof(pcVar8);
      DAT_140609cc0 = (float)dVar12;
    }
    if (_String != (char *)0x0) {
      dVar12 = atof(_String);
      DAT_140609cc4 = (float)dVar12;
    }
    return;
  }
  lVar5 = 5;
  pcVar9 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar11 = pcVar9 == (char *)0x0;
  pcVar10 = "four";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar11 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar11);
  if (bVar11) {
    _String = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_14015df6c;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x00014015df17;
}



void FUN_14015dff0(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  char *_String;
  char *pcVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  double dVar8;
  
  _String = (char *)0x0;
  lVar1 = *(longlong *)(param_1 + 0xa0);
  for (lVar3 = lVar1; pcVar4 = _String, lVar3 != param_1 + 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_1 + 0x58) {
LAB_14015e085:
      if (pcVar4 != (char *)0x0) {
        dVar8 = atof(pcVar4);
        DAT_140609468 = (double)(float)dVar8;
      }
      if (_String != (char *)0x0) {
        dVar8 = atof(_String);
        DAT_140609470 = (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_14015e085;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_14015e0e0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_140609459 = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015e160(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_14060945a = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015e1e0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_14060949c._3_1_ = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015e260(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  int local_res8 [2];
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 3;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
    bVar6 = pcVar4 == (char *)0x0;
    pcVar5 = "id";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar6 = *pcVar4 == *pcVar5;
      pcVar4 = pcVar4 + 1;
      pcVar5 = pcVar5 + 1;
    } while (bVar6);
    if (bVar6) {
      pcVar4 = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      local_res8[0] = iVar1;
      if ((local_res8 < DAT_1406094a8) && (DAT_1406094a0 <= local_res8)) {
        lVar2 = (longlong)local_res8 - (longlong)DAT_1406094a0;
        if (DAT_1406094a8 == DAT_1406094b0) {
          FUN_1400556a0(&DAT_1406094a0,1);
        }
        if (DAT_1406094a8 != (int *)0x0) {
          *DAT_1406094a8 = DAT_1406094a0[lVar2 >> 2];
        }
      }
      else {
        if (DAT_1406094a8 == DAT_1406094b0) {
          FUN_1400556a0(&DAT_1406094a0,1);
        }
        if (DAT_1406094a8 != (int *)0x0) {
          *DAT_1406094a8 = iVar1;
        }
      }
      DAT_1406094a8 = DAT_1406094a8 + 1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015e380(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  char *_Str;
  char *pcVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  
  if (param_1 == 0) {
    return;
  }
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_1 + 0xa0);
  for (lVar3 = lVar1; pcVar4 = _Str, lVar3 != param_1 + 0x58; lVar3 = *(longlong *)(lVar3 + 0x48)) {
    lVar2 = 0x10;
    pcVar4 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar7 = pcVar4 == (char *)0x0;
    pcVar5 = "log_debug_level";
    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_1 + 0x58) {
LAB_14015e415:
      if (pcVar4 != (char *)0x0) {
        DAT_1406094c0 = atoi(pcVar4);
      }
      if (_Str == (char *)0x0) {
        return;
      }
      DAT_1406094c4 = atoi(_Str);
      return;
    }
    lVar3 = 0xf;
    pcVar5 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar7 = pcVar5 == (char *)0x0;
    pcVar6 = "log_info_level";
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar7 = *pcVar5 == *pcVar6;
      pcVar5 = pcVar5 + 1;
      pcVar6 = pcVar6 + 1;
    } while (bVar7);
    if (bVar7) {
      _Str = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      goto LAB_14015e415;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x00014015eea1)
// WARNING: Type propagation algorithm not settling

void FUN_14015e460(void)

{
  ulonglong uVar1;
  char cVar2;
  longlong *plVar3;
  code *pcVar4;
  longlong *plVar5;
  uint uVar6;
  undefined1 *puVar7;
  ulonglong uVar8;
  longlong lVar9;
  ulonglong uVar10;
  longlong *plVar11;
  undefined8 *puVar12;
  char *pcVar13;
  undefined8 *puVar14;
  ulonglong uVar15;
  undefined1 auStack_a8 [32];
  undefined8 *local_88;
  undefined4 local_80;
  undefined8 local_78;
  undefined8 local_70 [2];
  ulonglong local_60;
  ulonglong local_58;
  undefined8 local_48;
  undefined1 uStack_40;
  undefined1 uStack_3f;
  undefined2 uStack_3e;
  undefined4 uStack_3c;
  ulonglong local_38;
  
  local_78 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (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 = DAT_140609488;
  local_88 = (undefined8 *)CONCAT44(local_88._4_4_,DAT_140609484);
  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;
  uVar15 = 0;
  local_60 = 0;
  local_70[0]._0_1_ = 0;
  plVar11 = (longlong *)*DAT_140609c80;
  if (plVar11 != DAT_140609c80) {
    do {
      local_48._0_4_ = 0;
      local_48._4_4_ = 0;
      uStack_40 = 0;
      uStack_3f = 0;
      _itoa_s(*(int *)((longlong)plVar11 + 0x1c),(char *)&local_48,10,10);
      FUN_140129e70(local_70,&DAT_1404a0894,1);
      uVar10 = 0xffffffffffffffff;
      pcVar13 = (char *)&local_48;
      do {
        if (uVar10 == 0) break;
        uVar10 = uVar10 - 1;
        cVar2 = *pcVar13;
        pcVar13 = pcVar13 + 1;
      } while (cVar2 != '\0');
      uVar10 = ~uVar10 - 1;
      puVar12 = (undefined8 *)CONCAT71(local_70[0]._1_7_,(undefined1)local_70[0]);
      puVar14 = local_70;
      if (0xf < local_58) {
        puVar14 = puVar12;
      }
      if (&local_48 < puVar14) {
LAB_14015ea73:
        if (-local_60 - 1 <= uVar10) {
          std::_Xlength_error("string too long");
          pcVar4 = (code *)swi(3);
          (*pcVar4)();
          return;
        }
        if (uVar10 != 0) {
          uVar8 = local_60 + uVar10;
          if (uVar8 == 0xffffffffffffffff) {
            std::_Xlength_error("string too long");
            pcVar4 = (code *)swi(3);
            (*pcVar4)();
            return;
          }
          if (local_58 < uVar8) {
            FUN_1400041a0(local_70,uVar8,local_60);
LAB_14015eac8:
            puVar12 = (undefined8 *)CONCAT71(local_70[0]._1_7_,(undefined1)local_70[0]);
          }
          else if (uVar8 == 0) {
            local_60 = 0;
            puVar14 = local_70;
            if (0xf < local_58) {
              puVar14 = puVar12;
            }
            *(undefined1 *)puVar14 = 0;
            goto LAB_14015eac8;
          }
          if (uVar8 != 0) {
            puVar14 = local_70;
            if (0xf < local_58) {
              puVar14 = puVar12;
            }
            memcpy((undefined1 *)(local_60 + (longlong)puVar14),&local_48,uVar10);
            puVar7 = (undefined1 *)local_70;
            if (0xf < local_58) {
              puVar7 = (undefined1 *)CONCAT71(local_70[0]._1_7_,(undefined1)local_70[0]);
            }
            local_60 = uVar8;
            puVar7[uVar8] = 0;
          }
        }
      }
      else {
        puVar14 = local_70;
        if (0xf < local_58) {
          puVar14 = puVar12;
        }
        if ((undefined8 *)((longlong)puVar14 + local_60) <= &local_48) goto LAB_14015ea73;
        puVar14 = local_70;
        if (0xf < local_58) {
          puVar14 = puVar12;
        }
        uVar8 = (longlong)&local_48 - (longlong)puVar14;
        if (local_60 < uVar8) {
          std::_Xout_of_range("invalid string position");
          pcVar4 = (code *)swi(3);
          (*pcVar4)();
          return;
        }
        if (local_60 - uVar8 < uVar10) {
          uVar10 = local_60 - uVar8;
        }
        if (-local_60 - 1 <= uVar10) {
          std::_Xlength_error("string too long");
          pcVar4 = (code *)swi(3);
          (*pcVar4)();
          return;
        }
        if (uVar10 != 0) {
          uVar1 = local_60 + uVar10;
          if (uVar1 == 0xffffffffffffffff) {
            std::_Xlength_error("string too long");
            pcVar4 = (code *)swi(3);
            (*pcVar4)();
            return;
          }
          if (local_58 < uVar1) {
            FUN_1400041a0(local_70,uVar1,local_60);
LAB_14015ea1b:
            puVar12 = (undefined8 *)CONCAT71(local_70[0]._1_7_,(undefined1)local_70[0]);
          }
          else if (uVar1 == 0) {
            local_60 = 0;
            puVar14 = local_70;
            if (0xf < local_58) {
              puVar14 = puVar12;
            }
            *(undefined1 *)puVar14 = 0;
            goto LAB_14015ea1b;
          }
          if (uVar1 != 0) {
            puVar14 = local_70;
            if (0xf < local_58) {
              puVar14 = puVar12;
            }
            memcpy((undefined1 *)(local_60 + (longlong)puVar14),
                   (undefined1 *)((longlong)puVar14 + uVar8),uVar10);
            puVar7 = (undefined1 *)local_70;
            if (0xf < local_58) {
              puVar7 = (undefined1 *)CONCAT71(local_70[0]._1_7_,(undefined1)local_70[0]);
            }
            local_60 = uVar1;
            puVar7[uVar1] = 0;
          }
        }
      }
      FUN_140129e70(local_70,&DAT_1404a0898,1);
      if (*(char *)((longlong)plVar11 + 0x21) == '\0') {
        plVar3 = (longlong *)plVar11[2];
        if (*(char *)((longlong)plVar3 + 0x21) == '\0') {
          cVar2 = *(char *)(*plVar3 + 0x21);
          plVar11 = plVar3;
          plVar3 = (longlong *)*plVar3;
          while (cVar2 == '\0') {
            cVar2 = *(char *)(*plVar3 + 0x21);
            plVar11 = plVar3;
            plVar3 = (longlong *)*plVar3;
          }
        }
        else {
          cVar2 = *(char *)(plVar11[1] + 0x21);
          plVar5 = (longlong *)plVar11[1];
          plVar3 = plVar11;
          while ((plVar11 = plVar5, cVar2 == '\0' && (plVar3 == (longlong *)plVar11[2]))) {
            cVar2 = *(char *)(plVar11[1] + 0x21);
            plVar5 = (longlong *)plVar11[1];
            plVar3 = plVar11;
          }
        }
      }
    } while (plVar11 != DAT_140609c80);
  }
  printf("PartyUserMax              : %s\n");
  printf("\n");
  puVar12 = &DAT_1406094e0;
  puVar14 = &DAT_1406095c0;
  do {
    local_88 = puVar12;
    if (0xf < (ulonglong)puVar12[3]) {
      local_88 = (undefined8 *)*puVar12;
    }
    printf("Use : %s\t FreeUse : %s\t Class [%d] %s\n");
    puVar12 = puVar12 + 7;
  } while ((longlong)puVar12 < 0x1406095c0);
  do {
    local_88 = puVar14;
    if (0xf < (ulonglong)puVar14[3]) {
      local_88 = (undefined8 *)*puVar14;
    }
    printf("Use : %s\t FreeUse : %s\t 2ND Class #1 [%d] %s\n");
    puVar14 = puVar14 + 0xe;
  } while ((longlong)puVar14 < 0x140609780);
  puVar12 = &DAT_1406095f8;
  do {
    local_88 = puVar12;
    if (0xf < (ulonglong)puVar12[3]) {
      local_88 = (undefined8 *)*puVar12;
    }
    printf("Use : %s\t FreeUse : %s\t 2ND Class #2 [%d] %s\n");
    puVar12 = puVar12 + 0xe;
  } while ((longlong)puVar12 < 0x1406097b8);
  printf("\n");
  puVar12 = &DAT_140609778;
  do {
    printf("Use : %s\t Shop [%d] %s\n");
    puVar12 = puVar12 + 6;
  } while ((longlong)puVar12 < 0x140609c28);
  printf("\n");
  uVar10 = uVar15;
  if ((DAT_140609c28 != 0) && (uVar8 = uVar15, plVar11 = DAT_140609c20, DAT_140609c30 != 0)) {
    do {
      if (*plVar11 != 0) {
        uVar10 = DAT_140609c20[uVar8];
        break;
      }
      uVar6 = (int)uVar8 + 1;
      uVar8 = (ulonglong)uVar6;
      plVar11 = plVar11 + 1;
    } while (uVar6 < DAT_140609c30);
  }
  local_48._0_4_ = (undefined4)uVar10;
  local_48._4_4_ = (undefined4)(uVar10 >> 0x20);
  uStack_3e = 0x4060;
  uStack_3c = 1;
  uStack_40 = 0x20;
  uStack_3f = 0x9c;
  do {
    do {
      uVar8 = uVar10;
      if (uVar8 == 0) {
        printf("\n");
        plVar11 = (longlong *)*DAT_140609ca0;
        if (plVar11 != DAT_140609ca0) {
          do {
            printf("USE GUILD CONTENT [ID:%d][USE:%d]\n");
            if (*(char *)((longlong)plVar11 + 0x21) == '\0') {
              plVar3 = (longlong *)plVar11[2];
              if (*(char *)((longlong)plVar3 + 0x21) == '\0') {
                cVar2 = *(char *)(*plVar3 + 0x21);
                plVar11 = plVar3;
                plVar3 = (longlong *)*plVar3;
                while (cVar2 == '\0') {
                  cVar2 = *(char *)(*plVar3 + 0x21);
                  plVar11 = plVar3;
                  plVar3 = (longlong *)*plVar3;
                }
              }
              else {
                cVar2 = *(char *)(plVar11[1] + 0x21);
                plVar5 = (longlong *)plVar11[1];
                plVar3 = plVar11;
                while ((plVar11 = plVar5, cVar2 == '\0' && (plVar3 == (longlong *)plVar11[2]))) {
                  cVar2 = *(char *)(plVar11[1] + 0x21);
                  plVar5 = (longlong *)plVar11[1];
                  plVar3 = plVar11;
                }
              }
            }
          } while (plVar11 != DAT_140609ca0);
        }
        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 (DAT_1406094a8 - DAT_1406094a0 >> 2 != 0) {
          do {
            printf("Block Quset ID : %d\n");
            uVar15 = (ulonglong)((int)uVar15 + 1);
          } while (uVar15 < (ulonglong)(DAT_1406094a8 - DAT_1406094a0 >> 2));
        }
        printf("LOG_DEBUG_LEVEL [%d]   LOG_INFO_LEVEL [%d]\n");
        printf("-----------------------------------------\n");
        if (0xf < local_58) {
          operator_delete((void *)CONCAT71(local_70[0]._1_7_,(undefined1)local_70[0]));
        }
        return;
      }
      if (*(longlong *)(uVar8 + 0x48) == 0) {
        printf("Use : %s\t Dungeon [%d] %s\n");
      }
      else {
        local_88 = (undefined8 *)(uVar8 + 0x38);
        if (0xf < *(ulonglong *)(uVar8 + 0x50)) {
          local_88 = (undefined8 *)*local_88;
        }
        printf("Use : %s\t Dungeon [%d] %s DiffOpen [ %s ]\n");
      }
      uVar10 = *(ulonglong *)(uVar8 + 0xe0);
    } while (*(ulonglong *)(uVar8 + 0xe0) != 0);
    uVar6 = *(uint *)(uVar8 + 0xe8) % DAT_140609c30 + 1;
    lVar9 = (longlong)(int)uVar6 << 3;
    uVar10 = uVar15;
    do {
      if (DAT_140609c30 <= uVar6) break;
      if (*(longlong *)((longlong)DAT_140609c20 + lVar9) != 0) {
        uVar10 = *(ulonglong *)((longlong)DAT_140609c20 + lVar9);
      }
      uVar6 = uVar6 + 1;
      lVar9 = lVar9 + 8;
    } while (uVar10 == 0);
  } while( true );
}



undefined4 * FUN_14015f0c0(void)

{
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  return &DAT_140609430;
}



void FUN_14015f100(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  char *pcVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  char *pcVar10;
  char *pcVar11;
  char *_Str;
  bool bVar12;
  
  lVar1 = param_1 + 0x58;
  _Str = (char *)0x0;
  lVar2 = *(longlong *)(param_1 + 0xa0);
  for (lVar5 = lVar2; lVar3 = lVar2, pcVar6 = _Str, lVar5 != lVar1;
      lVar5 = *(longlong *)(lVar5 + 0x48)) {
    lVar4 = 0xc;
    pcVar6 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar12 = pcVar6 == (char *)0x0;
    pcVar7 = "basis_count";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar12 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar12);
    if (bVar12) {
      pcVar6 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    lVar5 = lVar2;
    pcVar7 = _Str;
    if (lVar3 == lVar1) break;
    lVar4 = 0x10;
    pcVar7 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar12 = pcVar7 == (char *)0x0;
    pcVar8 = "server_lockdown";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar12 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar12);
    if (bVar12) {
      pcVar7 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
joined_r0x00014015f19e:
  lVar3 = lVar2;
  pcVar8 = _Str;
  if (lVar5 == lVar1) goto joined_r0x00014015f1ce;
  lVar4 = 0xc;
  pcVar8 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
  bVar12 = pcVar8 == (char *)0x0;
  pcVar9 = "channel_add";
  do {
    if (lVar4 == 0) break;
    lVar4 = lVar4 + -1;
    bVar12 = *pcVar8 == *pcVar9;
    pcVar8 = pcVar8 + 1;
    pcVar9 = pcVar9 + 1;
  } while (bVar12);
  if (bVar12) {
    pcVar8 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
    goto joined_r0x00014015f1ce;
  }
  lVar5 = *(longlong *)(lVar5 + 0x48);
  goto joined_r0x00014015f19e;
joined_r0x00014015f1ce:
  pcVar9 = _Str;
  if (lVar3 == lVar1) goto joined_r0x00014015f1f7;
  lVar5 = 0x11;
  pcVar9 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
  bVar12 = pcVar9 == (char *)0x0;
  pcVar10 = "channel_lockdown";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar12 = *pcVar9 == *pcVar10;
    pcVar9 = pcVar9 + 1;
    pcVar10 = pcVar10 + 1;
  } while (bVar12);
  if (bVar12) {
    pcVar9 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
    goto joined_r0x00014015f1f7;
  }
  lVar3 = *(longlong *)(lVar3 + 0x48);
  goto joined_r0x00014015f1ce;
joined_r0x00014015f1f7:
  if (lVar2 == lVar1) {
LAB_14015f259:
    if (pcVar6 != (char *)0x0) {
      DAT_140609478 = atoi(pcVar6);
    }
    if (pcVar7 != (char *)0x0) {
      DAT_14060947c = atoi(pcVar7);
    }
    if (pcVar8 != (char *)0x0) {
      DAT_140609480 = atoi(pcVar8);
    }
    if (pcVar9 != (char *)0x0) {
      DAT_140609484 = atoi(pcVar9);
    }
    if (_Str != (char *)0x0) {
      DAT_140609488 = atoi(_Str);
    }
    return;
  }
  lVar5 = 0x13;
  pcVar10 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar12 = pcVar10 == (char *)0x0;
  pcVar11 = "max_server_channel";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar12 = *pcVar10 == *pcVar11;
    pcVar10 = pcVar10 + 1;
    pcVar11 = pcVar11 + 1;
  } while (bVar12);
  if (bVar12) {
    _Str = (char *)(*(longlong *)(lVar2 + 0x30) + 0x10);
    goto LAB_14015f259;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x00014015f1f7;
}



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

void FUN_14015f2e0(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *_Str;
  char *pcVar5;
  char *pcVar6;
  char *pcVar7;
  bool bVar8;
  
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_1 + 0xa0);
  for (lVar4 = lVar1; pcVar5 = _Str, lVar4 != param_1 + 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_1 + 0x58) {
LAB_14015f375:
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        DAT_140609444 = 0 < iVar2;
      }
      if (_Str != (char *)0x0) {
        _DAT_140609448 = atoi(_Str);
      }
      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_14015f375;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_14015f3b0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  
  lVar2 = *(longlong *)(param_1 + 0xa0);
  if (lVar2 == param_1 + 0x58) {
    return;
  }
  do {
    lVar3 = 4;
    pcVar4 = (char *)(*(longlong *)(lVar2 + 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 *)(lVar2 + 0x30) + 0x10);
      if (pcVar4 == (char *)0x0) {
        return;
      }
      iVar1 = atoi(pcVar4);
      DAT_140609443 = 0 < iVar1;
      return;
    }
    lVar2 = *(longlong *)(lVar2 + 0x48);
    if (lVar2 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015f430(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  char *_Str;
  char *pcVar6;
  char *pcVar7;
  char *pcVar8;
  bool bVar9;
  int local_res8;
  undefined1 local_resc;
  undefined1 local_18 [16];
  
  _Str = (char *)0x0;
  lVar1 = *(longlong *)(param_1 + 0xa0);
  for (lVar5 = lVar1; pcVar6 = _Str, lVar5 != param_1 + 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_1 + 0x58) {
LAB_14015f4c5:
      if (pcVar6 != (char *)0x0) {
        local_res8 = atoi(pcVar6);
        local_resc = 0;
        if (_Str != (char *)0x0) {
          iVar2 = atoi(_Str);
          local_resc = (char)iVar2;
        }
        uVar3 = FUN_140160500(&DAT_140609c98,&local_res8);
        FUN_14015ff90(&DAT_140609c98,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_14015f4c5;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
  } while( true );
}



void FUN_14015f530(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  char *pcVar3;
  char *pcVar4;
  bool bVar5;
  
  lVar1 = *(longlong *)(param_1 + 0xa0);
  if (lVar1 == param_1 + 0x58) {
    return;
  }
  do {
    lVar2 = 10;
    pcVar3 = (char *)(*(longlong *)(lVar1 + 0x20) + 0x10);
    bVar5 = pcVar3 == (char *)0x0;
    pcVar4 = "item_drop";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar5 = *pcVar3 == *pcVar4;
      pcVar3 = pcVar3 + 1;
      pcVar4 = pcVar4 + 1;
    } while (bVar5);
    if (bVar5) {
      pcVar3 = (char *)(*(longlong *)(lVar1 + 0x30) + 0x10);
      if (pcVar3 == (char *)0x0) {
        return;
      }
      DAT_14060948c = atoi(pcVar3);
      return;
    }
    lVar1 = *(longlong *)(lVar1 + 0x48);
    if (lVar1 == param_1 + 0x58) {
      return;
    }
  } while( true );
}



void FUN_14015f5b0(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  char *_Str;
  char *pcVar6;
  char *pcVar7;
  char *pcVar8;
  char *pcVar9;
  bool bVar10;
  
  lVar1 = param_1 + 0x58;
  _Str = (char *)0x0;
  lVar2 = *(longlong *)(param_1 + 0xa0);
  for (lVar5 = lVar2; lVar3 = lVar2, pcVar6 = _Str, lVar5 != lVar1;
      lVar5 = *(longlong *)(lVar5 + 0x48)) {
    lVar4 = 4;
    pcVar6 = (char *)(*(longlong *)(lVar5 + 0x20) + 0x10);
    bVar10 = pcVar6 == (char *)0x0;
    pcVar7 = "use";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar10 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar10);
    if (bVar10) {
      pcVar6 = (char *)(*(longlong *)(lVar5 + 0x30) + 0x10);
      break;
    }
  }
  do {
    pcVar7 = _Str;
    if (lVar3 == lVar1) break;
    lVar5 = 0x10;
    pcVar7 = (char *)(*(longlong *)(lVar3 + 0x20) + 0x10);
    bVar10 = pcVar7 == (char *)0x0;
    pcVar8 = "character_level";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar10 = *pcVar7 == *pcVar8;
      pcVar7 = pcVar7 + 1;
      pcVar8 = pcVar8 + 1;
    } while (bVar10);
    if (bVar10) {
      pcVar7 = (char *)(*(longlong *)(lVar3 + 0x30) + 0x10);
      break;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
joined_r0x00014015f637:
  if (lVar2 == lVar1) {
LAB_14015f67f:
    if (pcVar6 != (char *)0x0) {
      DAT_140609cc8 = atoi(pcVar6);
    }
    if (pcVar7 != (char *)0x0) {
      DAT_140609ccc = atoi(pcVar7);
    }
    if (_Str != (char *)0x0) {
      DAT_140609cd0 = atoi(_Str);
    }
    return;
  }
  lVar5 = 0xc;
  pcVar8 = (char *)(*(longlong *)(lVar2 + 0x20) + 0x10);
  bVar10 = pcVar8 == (char *)0x0;
  pcVar9 = "gold_demand";
  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);
    goto LAB_14015f67f;
  }
  lVar2 = *(longlong *)(lVar2 + 0x48);
  goto joined_r0x00014015f637;
}



void FUN_14015f6d0(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  
  lVar1 = param_1 + 0x58;
  for (lVar3 = *(longlong *)(param_1 + 0xa0); lVar3 != lVar1; lVar3 = *(longlong *)(lVar3 + 0x48)) {
    lVar4 = 4;
    pcVar5 = (char *)(*(longlong *)(lVar3 + 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 *)(lVar3 + 0x30) + 0x10);
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        DAT_14060949c._0_1_ = 0 < iVar2;
      }
      break;
    }
  }
  lVar3 = *(longlong *)(param_1 + 0xa0);
  do {
    if (lVar3 == lVar1) {
LAB_14015f77c:
      lVar3 = *(longlong *)(param_1 + 0xa0);
      if (lVar3 == lVar1) {
        return;
      }
      do {
        lVar4 = 7;
        pcVar5 = (char *)(*(longlong *)(lVar3 + 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 *)(lVar3 + 0x30) + 0x10);
          if (pcVar5 == (char *)0x0) {
            return;
          }
          iVar2 = atoi(pcVar5);
          DAT_14060949c._2_1_ = 0 < iVar2;
          return;
        }
        lVar3 = *(longlong *)(lVar3 + 0x48);
        if (lVar3 == lVar1) {
          return;
        }
      } while( true );
    }
    lVar4 = 7;
    pcVar5 = (char *)(*(longlong *)(lVar3 + 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 *)(lVar3 + 0x30) + 0x10);
      if (pcVar5 != (char *)0x0) {
        iVar2 = atoi(pcVar5);
        DAT_14060949c._1_1_ = 0 < iVar2;
      }
      goto LAB_14015f77c;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
}



longlong FUN_14015f7f0(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_1405d3608);
}



undefined8 * FUN_14015f880(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_14015fa4f;
    }
  }
  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_14015fa4f:
  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_14015fbe0(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_1402164a0(param_1,plVar8);
                plVar8 = (longlong *)plVar7[2];
              }
              *(char *)(plVar8 + 4) = (char)plVar7[4];
              *(undefined1 *)(plVar7 + 4) = 1;
              *(undefined1 *)(plVar8[2] + 0x20) = 1;
              FUN_14015fbe0(param_1,plVar7);
              break;
            }
LAB_14015fb40:
            *(undefined1 *)(plVar8 + 4) = 0;
          }
        }
        else {
          if ((char)plVar8[4] == '\0') {
            *(undefined1 *)(plVar8 + 4) = 1;
            *(undefined1 *)(plVar7 + 4) = 0;
            FUN_1402164a0(param_1,plVar7);
            plVar8 = (longlong *)*plVar7;
          }
          if (*(char *)((longlong)plVar8 + 0x21) == '\0') {
            if ((*(char *)(plVar8[2] + 0x20) == '\x01') && (*(char *)(*plVar8 + 0x20) == '\x01'))
            goto LAB_14015fb40;
            if (*(char *)(*plVar8 + 0x20) == '\x01') {
              *(undefined1 *)(plVar8[2] + 0x20) = 1;
              *(undefined1 *)(plVar8 + 4) = 0;
              FUN_14015fbe0(param_1,plVar8);
              plVar8 = (longlong *)*plVar7;
            }
            *(char *)(plVar8 + 4) = (char)plVar7[4];
            *(undefined1 *)(plVar7 + 4) = 1;
            *(undefined1 *)(*plVar8 + 0x20) = 1;
            FUN_1402164a0(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_14015fbe0(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_14015fc40(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14015fe00(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1401605c0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_14015fe00(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_14015fd10(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_1401603e0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_14015fde0(void)

{
  FUN_14015fd10();
  return;
}



undefined4 * FUN_14015fe00(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_140003d90(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_140003d90(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_14015ff90(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_14015fff7;
    }
    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_14015fff7:
  puVar5 = (undefined8 *)FUN_1401600b0(param_1,local_res8,bVar6,puVar5,param_3);
  *(undefined1 *)(param_2 + 1) = 1;
  *param_2 = *puVar5;
  return param_2;
}



undefined8 *
FUN_1401600b0(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_14016013a;
    }
    param_4[2] = param_5;
    lVar5 = *(longlong *)(param_1 + 8);
    if (param_4 != *(undefined8 **)(lVar5 + 0x10)) goto LAB_14016013a;
  }
  *(longlong **)(lVar5 + 0x10) = param_5;
LAB_14016013a:
  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_140160318;
      }
LAB_140160242:
      *(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_140160242;
      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_140160318:
      plVar6[1] = (longlong)plVar8;
    }
    cVar1 = *(char *)(plVar7[1] + 0x20);
  } while( true );
}



void FUN_140160350(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1401603e0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0xe0);
  FUN_1401603e0(param_1,param_2);
  return;
}



void FUN_1401603e0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1402cddb0(param_1);
    FUN_140150f00(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_1401604c0(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_140160540();
  if ((undefined4 *)(lVar1 + 0x18) != (undefined4 *)0x0) {
    *(undefined4 *)(lVar1 + 0x18) = *param_2;
    *(undefined4 *)(lVar1 + 0x1c) = param_2[1];
  }
  return;
}



void FUN_140160500(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_140160540();
  if ((undefined4 *)(lVar1 + 0x18) != (undefined4 *)0x0) {
    *(undefined4 *)(lVar1 + 0x18) = *param_2;
    *(undefined1 *)(lVar1 + 0x1c) = *(undefined1 *)(param_2 + 1);
  }
  return;
}



void FUN_140160540(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_1405d3608);
}



undefined4 *
FUN_1401605c0(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_14016068d;
      lVar8 = uVar7 * 0xf0;
    }
    if ((-lVar8 - 1U < 0x10) || (plVar4 = malloc(lVar8 + 0x10), plVar4 == (longlong *)0x0)) {
LAB_14016068d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(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_1402cddb0(param_1);
    FUN_140150f00(param_1,uVar3);
  }
  return puVar1;
}



// WARNING: Removing unreachable block (ram,0x000140160882)
// WARNING: Removing unreachable block (ram,0x00014016088b)
// WARNING: Removing unreachable block (ram,0x0001401608ac)
// WARNING: Removing unreachable block (ram,0x0001401608b5)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1401607c0(void)

{
  _DAT_14060b250 = 0;
  _DAT_14060b258 = 0;
  _DAT_14060b260 = 0;
  _DAT_14060b268 = 0;
  _DAT_14060b270 = 0;
  _DAT_14060b278 = 0;
  _DAT_14060b280 = 0x11;
  _DAT_14060b2a0 = 0;
  _DAT_14060b2a4 = 10;
  _DAT_14060b2a8 = 0;
  _DAT_14060b2b0 = 0;
  _DAT_14060b284 = 0x3f400000;
  _DAT_14060b288 = 0x3e800000;
  _DAT_14060b28c = 0x40100000;
  _DAT_14060b290 = 0x26;
  _DAT_14060b298 = 0;
  FUN_1401608e0();
  return &DAT_14060b250;
}



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

void FUN_1401608e0(void)

{
  _DAT_14060b250 = FUN_1402933b0(DAT_140607ff0,L"LOCAL_STRING");
  _DAT_14060b258 = FUN_1402933b0(DAT_140607ff0,L"DIALOG_STRING");
  _DAT_14060b260 = FUN_1402933b0(DAT_140607ff0,L"CREDIT_STRING");
  _DAT_14060b268 = FUN_1402933b0(DAT_140607ff0,L"LINK_DIALOG_STRING");
  return;
}



wchar_t * FUN_140160960(longlong *param_1,uint param_2)

{
  longlong lVar1;
  uint *puVar2;
  undefined4 uVar3;
  wchar_t *pwVar4;
  ulonglong uVar5;
  wchar_t *local_10;
  
  uVar5 = (ulonglong)param_2;
  if ((int)param_2 < 1) {
    return L"invalid_ID";
  }
  lVar1 = *param_1;
  if (lVar1 == 0) {
    return L"invalid_ID";
  }
  if (param_1[4] != 0) {
    for (puVar2 = *(uint **)(param_1[4] + (uVar5 % (ulonglong)*(uint *)(param_1 + 6)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 4)) {
      if ((puVar2[6] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 != (uint *)0x0) {
          return *(wchar_t **)(puVar2 + 2);
        }
        break;
      }
    }
  }
  uVar3 = FUN_1402970c0(lVar1,L"wszString");
  pwVar4 = (wchar_t *)FUN_140296b70(lVar1,uVar5,uVar3,L"wszString",1);
  if (pwVar4 != (wchar_t *)0x0) {
    local_10 = pwVar4;
    FUN_1401623f0(param_1 + 4,uVar5,&local_10);
    return pwVar4;
  }
  return L"invalid_ID";
}



undefined * FUN_140160a70(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetStringDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce60 & 1) == 0) {
    DAT_14060ce60 = DAT_14060ce60 | 1;
    FUN_1401607c0();
    atexit((_func_5014 *)&LAB_140448980);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetStringDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_14060b250;
}



void FUN_140160b00(undefined8 *param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar2 = DAT_140607ff0;
  uVar1 = FUN_140294ca0(DAT_140607ff0,L"QUEST_STRING");
  FUN_140294650(uVar2,L"QUEST_STRING");
  FUN_140292e80(uVar2,L"QUEST_STRING",uVar1);
  uVar2 = FUN_1402933b0(DAT_140607ff0,L"QUEST_STRING");
  *param_1 = uVar2;
  return;
}



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

undefined * FUN_140160b80(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetQuestStringDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce5c & 1) == 0) {
    DAT_14060ce5c = DAT_14060ce5c | 1;
    _DAT_14060cbb8 = 0;
    _DAT_14060cbb8 = FUN_1402933b0(DAT_140607ff0,L"QUEST_STRING");
    atexit((_func_5014 *)&DAT_140448990);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetQuestStringDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060cbb8;
}



void FUN_140160c30(undefined8 *param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar2 = DAT_140607ff0;
  uVar1 = FUN_140294ca0(DAT_140607ff0,L"MISSION_STRING");
  FUN_140294650(uVar2,L"MISSION_STRING");
  FUN_140292e80(uVar2,L"MISSION_STRING",uVar1);
  uVar2 = FUN_1402933b0(DAT_140607ff0,L"MISSION_STRING");
  *param_1 = uVar2;
  return;
}



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

undefined * FUN_140160cb0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetMissionStringDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce58 & 1) == 0) {
    DAT_14060ce58 = DAT_14060ce58 | 1;
    _DAT_14060cbb0 = FUN_1402933b0(DAT_140607ff0,L"MISSION_STRING");
    atexit((_func_5014 *)&DAT_1404489a0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetMissionStringDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060cbb0;
}



// WARNING: Removing unreachable block (ram,0x000140160e20)
// WARNING: Removing unreachable block (ram,0x000140160e29)
// WARNING: Removing unreachable block (ram,0x000140160e4a)
// WARNING: Removing unreachable block (ram,0x000140160e53)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_140160d50(void)

{
  _DAT_14060b180 = 0;
  _DAT_14060b188 = 0;
  _DAT_14060b190 = 0;
  DAT_14060b198 = 0;
  DAT_14060b1a0 = 0;
  _DAT_14060b1a8 = 0;
  DAT_14060b1b8 = 0;
  DAT_14060b1c0 = 0;
  DAT_14060b1c8 = 0x11;
  _DAT_14060b1e8 = 0;
  _DAT_14060b1ec = 10;
  _DAT_14060b1f0 = 0;
  _DAT_14060b1f8 = 0;
  _DAT_14060b1cc = 0x3f400000;
  _DAT_14060b1d0 = 0x3e800000;
  _DAT_14060b1d4 = 0x40100000;
  _DAT_14060b1d8 = 0x26;
  _DAT_14060b1e0 = 0;
  _DAT_14060b200 = 0;
  _DAT_14060b208 = 0;
  _DAT_14060b210 = 0x11;
  _DAT_14060b230 = 0;
  _DAT_14060b234 = 10;
  _DAT_14060b238 = 0;
  _DAT_14060b240 = 0;
  _DAT_14060b214 = 0x3f400000;
  _DAT_14060b218 = 0x3e800000;
  _DAT_14060b21c = 0x40100000;
  _DAT_14060b228 = 0;
  _DAT_14060b220 = _DAT_14060b1d8;
  FUN_1401612d0(&DAT_14060b180,0x26,0,0x3e800000,0xfffffffffffffffe);
  return &DAT_14060b180;
}



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

void FUN_140160ef0(void)

{
  undefined8 *puVar1;
  code *pcVar2;
  longlong *plVar3;
  void *pvVar4;
  uint uVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong *plVar8;
  ulonglong *puVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  
  uVar11 = 0;
  lVar6 = (longlong)DAT_14060b1a0 - (longlong)DAT_14060b198 >> 3;
  if (lVar6 != 0) {
    uVar10 = uVar11;
    if (lVar6 == 0) {
      std::_Xout_of_range("invalid vector<T> subscript");
      pcVar2 = (code *)swi(3);
      (*pcVar2)();
      return;
    }
    do {
      operator_delete(*(void **)((longlong)DAT_14060b198 + uVar10 * 8));
      uVar10 = uVar10 + 1;
    } while (uVar10 < (ulonglong)((longlong)DAT_14060b1a0 - (longlong)DAT_14060b198 >> 3));
  }
  pvVar4 = DAT_14060b198;
  if (DAT_14060b198 != DAT_14060b1a0) {
    memmove(DAT_14060b198,DAT_14060b1a0,0);
    DAT_14060b1a0 = pvVar4;
  }
  uVar12 = (ulonglong)DAT_14060b1c8;
  uVar10 = uVar11;
  plVar3 = DAT_14060b1b8;
  if ((DAT_14060b1c0 != 0) && (uVar7 = uVar11, plVar8 = DAT_14060b1b8, DAT_14060b1c8 != 0)) {
    do {
      if (*plVar8 != 0) {
        uVar10 = DAT_14060b1b8[uVar7];
        break;
      }
      uVar5 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar5;
      plVar8 = plVar8 + 1;
    } while (uVar5 < DAT_14060b1c8);
  }
  do {
    if (uVar10 == 0) {
      FUN_1401624a0(&DAT_14060b1b8);
      FUN_1401625e0(&DAT_14060b200);
      FUN_1401625e0(&DAT_14060b1b8);
      if (DAT_14060b198 != (void *)0x0) {
        operator_delete(DAT_14060b198);
      }
      DAT_14060b198 = (void *)0x0;
      DAT_14060b1a0 = (void *)0x0;
      _DAT_14060b1a8 = 0;
      return;
    }
    uVar7 = uVar11;
    if ((uVar10 != 0) && (uVar7 = *(ulonglong *)(uVar10 + 0x10), *(ulonglong *)(uVar10 + 0x10) == 0)
       ) {
      uVar5 = (int)((ulonglong)*(uint *)(uVar10 + 0x18) % uVar12) + 1;
      puVar9 = (ulonglong *)(plVar3 + (int)uVar5);
      uVar7 = uVar11;
      do {
        if ((uint)uVar12 <= uVar5) break;
        if (*puVar9 != 0) {
          uVar7 = *puVar9;
        }
        uVar5 = uVar5 + 1;
        puVar9 = puVar9 + 1;
      } while (uVar7 == 0);
    }
    puVar1 = *(undefined8 **)(uVar10 + 8);
    uVar10 = uVar7;
    if (puVar1 != (undefined8 *)0x0) {
      if ((void *)*puVar1 != (void *)0x0) {
        operator_delete((void *)*puVar1);
      }
      *puVar1 = 0;
      puVar1[1] = 0;
      puVar1[2] = 0;
      operator_delete(puVar1);
      uVar12 = (ulonglong)DAT_14060b1c8;
      plVar3 = DAT_14060b1b8;
    }
  } while( true );
}



void FUN_1401610c0(longlong param_1)

{
  void *_Dst;
  undefined8 *puVar1;
  ulonglong uVar2;
  uint uVar3;
  longlong lVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar4;
  
  _Dst = *(void **)(param_1 + 0x18);
  if (_Dst != *(void **)(param_1 + 0x20)) {
    memmove(_Dst,*(void **)(param_1 + 0x20),0);
    *(void **)(param_1 + 0x20) = _Dst;
  }
  uVar7 = 0;
  uVar2 = uVar7;
  if ((*(longlong *)(param_1 + 0x40) != 0) && (*(uint *)(param_1 + 0x48) != 0)) {
    uVar4 = uVar7;
    plVar6 = *(longlong **)(param_1 + 0x38);
    do {
      if (*plVar6 != 0) {
        uVar2 = (*(longlong **)(param_1 + 0x38))[uVar4];
        break;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      plVar6 = plVar6 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0x48));
  }
  do {
    if (uVar2 == 0) {
      FUN_1401624a0(param_1 + 0x38);
      return;
    }
    uVar4 = uVar7;
    if ((uVar2 != 0) && (uVar4 = *(ulonglong *)(uVar2 + 0x10), *(ulonglong *)(uVar2 + 0x10) == 0)) {
      uVar3 = *(uint *)(uVar2 + 0x18) % *(uint *)(param_1 + 0x48) + 1;
      lVar5 = (longlong)(int)uVar3 << 3;
      uVar4 = uVar7;
      do {
        if (*(uint *)(param_1 + 0x48) <= uVar3) break;
        if (*(longlong *)(*(longlong *)(param_1 + 0x38) + lVar5) != 0) {
          uVar4 = *(ulonglong *)(*(longlong *)(param_1 + 0x38) + lVar5);
        }
        uVar3 = uVar3 + 1;
        lVar5 = lVar5 + 8;
      } while (uVar4 == 0);
    }
    puVar1 = *(undefined8 **)(uVar2 + 8);
    uVar2 = uVar4;
    if (puVar1 != (undefined8 *)0x0) {
      if ((void *)*puVar1 != (void *)0x0) {
        operator_delete((void *)*puVar1);
      }
      *puVar1 = 0;
      puVar1[1] = 0;
      puVar1[2] = 0;
      operator_delete(puVar1);
    }
  } while( true );
}



void FUN_1401611f0(undefined8 param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  FUN_1401610c0();
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"NEW_ITEM_OPTION_CONDITION");
  FUN_140294650(uVar1,L"NEW_ITEM_OPTION_CONDITION");
  FUN_140292e80(uVar1,L"NEW_ITEM_OPTION_CONDITION",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"NEW_ITEM_OPTION_CONDITION_STRING");
  FUN_140294650(uVar1,L"NEW_ITEM_OPTION_CONDITION_STRING");
  FUN_140292e80(uVar1,L"NEW_ITEM_OPTION_CONDITION_STRING",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"NEW_ITEM_OPTION_VALUE");
  FUN_140294650(uVar1,L"NEW_ITEM_OPTION_VALUE");
  FUN_140292e80(uVar1,L"NEW_ITEM_OPTION_VALUE",uVar2);
  FUN_1401612d0(param_1);
  return;
}



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

void FUN_1401612d0(longlong *param_1)

{
  int **ppiVar1;
  int **ppiVar2;
  uint uVar3;
  undefined4 uVar4;
  int iVar5;
  longlong lVar6;
  int *piVar8;
  int *piVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  undefined8 uVar12;
  uint *puVar13;
  undefined4 *puVar14;
  longlong *plVar15;
  wchar_t *pwVar16;
  wchar_t *pwVar17;
  wchar_t *pwVar18;
  longlong *plVar19;
  longlong *plVar20;
  int iVar21;
  longlong *plVar22;
  longlong lVar23;
  undefined1 auStack_e8 [32];
  undefined1 local_c8;
  int *local_b8;
  longlong *local_b0;
  longlong *local_a8;
  longlong *local_a0;
  wchar_t *local_98;
  wchar_t *local_90;
  undefined8 local_88;
  wchar_t *local_78;
  wchar_t *local_70;
  undefined8 local_68;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  ulonglong local_30;
  longlong *plVar7;
  
  local_58 = 0xfffffffffffffffe;
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_e8;
  local_a0 = param_1;
  lVar6 = FUN_1402933b0(DAT_140607ff0,L"NEW_ITEM_OPTION_CONDITION");
  *param_1 = lVar6;
  lVar6 = FUN_1402933b0(DAT_140607ff0,L"NEW_ITEM_OPTION_CONDITION_STRING");
  param_1[1] = lVar6;
  if ((*param_1 != 0) && (lVar6 != 0)) {
    lVar6 = FUN_1402933b0(DAT_140607ff0);
    param_1[2] = lVar6;
    lVar6 = *param_1;
    plVar20 = (longlong *)(lVar6 + 0x68);
    plVar22 = (longlong *)0x0;
    iVar21 = 0;
    plVar19 = plVar22;
    local_a8 = plVar20;
    if ((*(longlong *)(lVar6 + 0x70) != 0) && (*(uint *)(lVar6 + 0x78) != 0)) {
      plVar7 = plVar22;
      plVar15 = (longlong *)*plVar20;
      do {
        if (*plVar15 != 0) {
          plVar19 = (longlong *)((longlong *)*plVar20)[(longlong)plVar7];
          break;
        }
        uVar3 = (int)plVar7 + 1;
        plVar7 = (longlong *)(ulonglong)uVar3;
        plVar15 = plVar15 + 1;
      } while (uVar3 < *(uint *)(lVar6 + 0x78));
    }
LAB_1401613b4:
    local_b0 = plVar19;
    if (local_b0 != (longlong *)0x0) {
      iVar5 = (int)*local_b0;
      if (0 < iVar5) {
        piVar8 = operator_new(0x5c);
        *piVar8 = iVar5;
        lVar6 = *param_1;
        local_b8 = piVar8;
        uVar4 = FUN_1402970c0(lVar6,L"nItemOptionID00");
        local_c8 = 1;
        piVar9 = (int *)FUN_140296600(lVar6,iVar5,uVar4,L"nItemOptionID00");
        piVar8[0x12] = *piVar9;
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"fvalueMin");
        local_c8 = 1;
        piVar9 = (int *)FUN_1402967b0(lVar6,iVar5,uVar4,L"fvalueMin");
        piVar8[0x13] = *piVar9;
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"fvalueMax");
        local_c8 = 1;
        piVar9 = (int *)FUN_1402967b0(lVar6,iVar5,uVar4,L"fvalueMax");
        piVar8[0x14] = *piVar9;
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"fNamevalueMin");
        local_c8 = 1;
        piVar9 = (int *)FUN_1402967b0(lVar6,iVar5,uVar4,L"fNamevalueMin");
        piVar8[0x15] = *piVar9;
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"fNamevalueMax");
        local_c8 = 1;
        piVar9 = (int *)FUN_1402967b0(lVar6,iVar5,uVar4,L"fNamevalueMax");
        piVar8[0x16] = *piVar9;
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"nOptionGroup");
        local_c8 = 1;
        piVar9 = (int *)FUN_140296600(lVar6,iVar5,uVar4,L"nOptionGroup");
        piVar8[1] = *piVar9;
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"nMinLimitLv");
        local_c8 = 1;
        piVar9 = (int *)FUN_140296600(lVar6,iVar5,uVar4,L"nMinLimitLv");
        piVar8[2] = *piVar9;
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"nMaxLimitLv");
        local_c8 = 1;
        piVar9 = (int *)FUN_140296600(lVar6,iVar5,uVar4,L"nMaxLimitLv");
        piVar8[3] = *piVar9;
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"szBranch");
        local_c8 = 1;
        uVar10 = FUN_140296990(lVar6,iVar5,uVar4,L"szBranch");
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"szCategory");
        local_c8 = 1;
        uVar11 = FUN_140296990(lVar6,iVar5,uVar4,L"szCategory");
        lVar6 = *param_1;
        uVar4 = FUN_1402970c0(lVar6,L"szSubCategory");
        local_c8 = 1;
        uVar12 = FUN_140296990(lVar6,iVar5,uVar4,L"szSubCategory");
        local_98 = (wchar_t *)0x0;
        local_90 = (wchar_t *)0x0;
        local_88 = 0;
        local_50 = (wchar_t *)0x0;
        local_48 = (wchar_t *)0x0;
        local_40 = 0;
        local_78 = (wchar_t *)0x0;
        local_70 = (wchar_t *)0x0;
        local_68 = 0;
        FUN_140415930(&local_98,uVar10,&DAT_14049c7b8);
        FUN_140415930(&local_50,uVar11,&DAT_14049c7b8);
        FUN_140415930(&local_78,uVar12,&DAT_14049c7b8);
        piVar9 = local_b8;
        lVar6 = (longlong)local_90 - (longlong)local_98;
        piVar8 = local_b8 + 4;
        lVar23 = 6;
        pwVar18 = local_98;
        plVar19 = plVar22;
        do {
          iVar5 = iVar21;
          if (plVar19 < (longlong *)(lVar6 / 0x28)) {
            pwVar16 = pwVar18;
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              pwVar16 = *(wchar_t **)pwVar18;
            }
            iVar5 = _wtoi(pwVar16);
          }
          *piVar8 = iVar5;
          plVar19 = (longlong *)((longlong)plVar19 + 1);
          piVar8 = piVar8 + 1;
          pwVar18 = pwVar18 + 0x14;
          lVar23 = lVar23 + -1;
        } while (lVar23 != 0);
        lVar6 = (longlong)local_48 - (longlong)local_50;
        piVar9 = piVar9 + 10;
        lVar23 = 4;
        pwVar18 = local_50;
        plVar19 = plVar22;
        do {
          iVar5 = iVar21;
          if (plVar19 < (longlong *)(lVar6 / 0x28)) {
            pwVar16 = pwVar18;
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              pwVar16 = *(wchar_t **)pwVar18;
            }
            iVar5 = _wtoi(pwVar16);
          }
          pwVar16 = local_70;
          *piVar9 = iVar5;
          plVar19 = (longlong *)((longlong)plVar19 + 1);
          piVar9 = piVar9 + 1;
          pwVar18 = pwVar18 + 0x14;
          lVar23 = lVar23 + -1;
        } while (lVar23 != 0);
        lVar6 = (longlong)local_70 - (longlong)local_78;
        piVar8 = local_b8 + 0xe;
        lVar23 = 4;
        pwVar18 = local_78;
        plVar19 = plVar22;
        do {
          iVar5 = iVar21;
          if (plVar19 < (longlong *)(lVar6 / 0x28)) {
            pwVar17 = pwVar18;
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              pwVar17 = *(wchar_t **)pwVar18;
            }
            iVar5 = _wtoi(pwVar17);
          }
          plVar20 = local_a0;
          *piVar8 = iVar5;
          plVar19 = (longlong *)((longlong)plVar19 + 1);
          piVar8 = piVar8 + 1;
          pwVar18 = pwVar18 + 0x14;
          lVar23 = lVar23 + -1;
        } while (lVar23 != 0);
        ppiVar1 = (int **)local_a0[4];
        if ((&local_b8 < ppiVar1) && (ppiVar2 = (int **)local_a0[3], ppiVar2 <= &local_b8)) {
          if (ppiVar1 == (int **)local_a0[5]) {
            FUN_140195b20(local_a0 + 3);
          }
          if ((undefined8 *)plVar20[4] != (undefined8 *)0x0) {
            *(undefined8 *)plVar20[4] =
                 *(undefined8 *)(plVar20[3] + ((longlong)&local_b8 - (longlong)ppiVar2 >> 3) * 8);
          }
        }
        else {
          if (ppiVar1 == (int **)local_a0[5]) {
            FUN_140195b20(local_a0 + 3);
          }
          if ((undefined8 *)plVar20[4] != (undefined8 *)0x0) {
            *(undefined8 *)plVar20[4] = local_b8;
          }
        }
        pwVar17 = local_78;
        plVar20[4] = plVar20[4] + 8;
        pwVar18 = local_78;
        if (local_78 != (wchar_t *)0x0) {
          for (; pwVar18 != pwVar16; pwVar18 = pwVar18 + 0x14) {
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              operator_delete(*(void **)pwVar18);
            }
            pwVar18[0xc] = L'\a';
            pwVar18[0xd] = L'\0';
            pwVar18[0xe] = L'\0';
            pwVar18[0xf] = L'\0';
            pwVar18[8] = L'\0';
            pwVar18[9] = L'\0';
            pwVar18[10] = L'\0';
            pwVar18[0xb] = L'\0';
            *pwVar18 = L'\0';
          }
          operator_delete(pwVar17);
        }
        pwVar17 = local_48;
        pwVar16 = local_50;
        pwVar18 = local_50;
        if (local_50 != (wchar_t *)0x0) {
          for (; pwVar18 != pwVar17; pwVar18 = pwVar18 + 0x14) {
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              operator_delete(*(void **)pwVar18);
            }
            pwVar18[0xc] = L'\a';
            pwVar18[0xd] = L'\0';
            pwVar18[0xe] = L'\0';
            pwVar18[0xf] = L'\0';
            pwVar18[8] = L'\0';
            pwVar18[9] = L'\0';
            pwVar18[10] = L'\0';
            pwVar18[0xb] = L'\0';
            *pwVar18 = L'\0';
          }
          operator_delete(pwVar16);
        }
        pwVar17 = local_90;
        pwVar16 = local_98;
        plVar20 = local_a8;
        param_1 = local_a0;
        pwVar18 = local_98;
        if (local_98 != (wchar_t *)0x0) {
          for (; pwVar18 != pwVar17; pwVar18 = pwVar18 + 0x14) {
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              operator_delete(*(void **)pwVar18);
            }
            pwVar18[0xc] = L'\a';
            pwVar18[0xd] = L'\0';
            pwVar18[0xe] = L'\0';
            pwVar18[0xf] = L'\0';
            pwVar18[8] = L'\0';
            pwVar18[9] = L'\0';
            pwVar18[10] = L'\0';
            pwVar18[0xb] = L'\0';
            *pwVar18 = L'\0';
          }
          operator_delete(pwVar16);
          plVar20 = local_a8;
          param_1 = local_a0;
        }
      }
      plVar19 = (longlong *)local_b0[3];
      if ((longlong *)local_b0[3] == (longlong *)0x0) {
        uVar3 = *(uint *)(local_b0 + 4) % *(uint *)(plVar20 + 2) + 1;
        lVar6 = (longlong)(int)uVar3 << 3;
        plVar19 = plVar22;
        do {
          if (*(uint *)(plVar20 + 2) <= uVar3) break;
          if (*(longlong *)(lVar6 + *plVar20) != 0) {
            plVar19 = *(longlong **)(lVar6 + *plVar20);
          }
          uVar3 = uVar3 + 1;
          lVar6 = lVar6 + 8;
        } while (plVar19 == (longlong *)0x0);
      }
      goto LAB_1401613b4;
    }
    lVar6 = param_1[2];
    local_b0 = (longlong *)0x0;
    plVar19 = plVar22;
    if ((*(longlong *)(lVar6 + 0x70) != 0) && (*(uint *)(lVar6 + 0x78) != 0)) {
      plVar20 = plVar22;
      plVar7 = *(longlong **)(lVar6 + 0x68);
      do {
        if (*plVar7 != 0) {
          plVar19 = (longlong *)(*(longlong **)(lVar6 + 0x68))[(longlong)plVar20];
          break;
        }
        uVar3 = (int)plVar20 + 1;
        plVar20 = (longlong *)(ulonglong)uVar3;
        plVar7 = plVar7 + 1;
      } while (uVar3 < *(uint *)(lVar6 + 0x78));
    }
LAB_140161980:
    plVar20 = plVar19;
    if (plVar20 != (longlong *)0x0) {
      iVar21 = (int)*plVar20;
      if (0 < iVar21) {
        lVar23 = param_1[2];
        uVar4 = FUN_1402970c0(lVar23,L"nItemOptionID");
        local_c8 = 1;
        puVar13 = (uint *)FUN_140296600(lVar23,iVar21,uVar4,L"nItemOptionID");
        uVar3 = *puVar13;
        if (0 < (int)uVar3) {
          lVar23 = param_1[2];
          uVar4 = FUN_1402970c0(lVar23,L"nMinLimitLv");
          local_c8 = 1;
          puVar14 = (undefined4 *)FUN_140296600(lVar23,iVar21,uVar4,L"nMinLimitLv");
          local_50 = (wchar_t *)CONCAT44(local_50._4_4_,*puVar14);
          lVar23 = param_1[2];
          uVar4 = FUN_1402970c0(lVar23,L"nMaxLimitLv");
          local_c8 = 1;
          puVar14 = (undefined4 *)FUN_140296600(lVar23,iVar21,uVar4,L"nMaxLimitLv");
          local_50 = (wchar_t *)CONCAT44(*puVar14,(undefined4)local_50);
          lVar23 = param_1[2];
          uVar4 = FUN_1402970c0(lVar23,L"fMagic");
          local_c8 = 1;
          puVar14 = (undefined4 *)FUN_1402967b0(lVar23,iVar21,uVar4,L"fMagic");
          local_48 = (wchar_t *)CONCAT44(local_48._4_4_,*puVar14);
          lVar23 = param_1[2];
          uVar4 = FUN_1402970c0(lVar23,L"fRare");
          local_c8 = 1;
          puVar14 = (undefined4 *)FUN_1402967b0(lVar23,iVar21,uVar4,L"fRare");
          local_48 = (wchar_t *)CONCAT44(*puVar14,(undefined4)local_48);
          lVar23 = param_1[2];
          uVar4 = FUN_1402970c0(lVar23,L"fUnique");
          local_c8 = 1;
          puVar14 = (undefined4 *)FUN_1402967b0(lVar23,iVar21,uVar4,L"fUnique");
          local_40 = CONCAT44(local_40._4_4_,*puVar14);
          lVar23 = param_1[2];
          uVar4 = FUN_1402970c0(lVar23,L"fEpic");
          local_c8 = 1;
          puVar14 = (undefined4 *)FUN_1402967b0(lVar23,iVar21,uVar4,L"fEpic");
          local_40 = CONCAT44(*puVar14,(undefined4)local_40);
          if (param_1[7] != 0) {
            for (puVar13 = *(uint **)(param_1[7] +
                                     ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 9)) * 8);
                puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 4)) {
              if ((puVar13[6] == uVar3) && (*puVar13 == uVar3)) {
                if (puVar13 != (uint *)0x0) {
                  FUN_1402ecd80(*(undefined8 *)(puVar13 + 2));
                  goto LAB_140161b7c;
                }
                break;
              }
            }
          }
          plVar19 = operator_new(0x20);
          local_a8 = plVar22;
          if (plVar19 != (longlong *)0x0) {
            *plVar19 = 0;
            plVar19[1] = 0;
            plVar19[2] = 0;
            local_a8 = plVar19;
          }
          FUN_1402ecd80(local_a8,&local_50);
          FUN_1401623f0(param_1 + 7,uVar3,&local_a8);
        }
      }
LAB_140161b7c:
      plVar19 = (longlong *)plVar20[3];
      if ((longlong *)plVar20[3] == (longlong *)0x0) {
        uVar3 = *(uint *)(plVar20 + 4) % *(uint *)(lVar6 + 0x78) + 1;
        lVar23 = (longlong)(int)uVar3 << 3;
        plVar19 = plVar22;
        do {
          if (*(uint *)(lVar6 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar23 + *(longlong *)(lVar6 + 0x68)) != 0) {
            plVar19 = *(longlong **)(lVar23 + *(longlong *)(lVar6 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar23 = lVar23 + 8;
        } while (plVar19 == (longlong *)0x0);
      }
      goto LAB_140161980;
    }
  }
  return;
}



ulonglong FUN_140161c00(longlong param_1,uint param_2,int param_3,int param_4)

{
  uint *puVar1;
  longlong *plVar2;
  code *pcVar3;
  int iVar4;
  int iVar5;
  ulonglong uVar6;
  longlong lVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  uint uVar10;
  
  if (*(longlong *)(param_1 + 0x38) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x38) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x48)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 4)) {
      if ((puVar1[6] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          plVar2 = *(longlong **)(puVar1 + 2);
          uVar6 = 0;
          lVar7 = (plVar2[1] - *plVar2) / 6 + (plVar2[1] - *plVar2 >> 0x3f);
          iVar4 = (int)(lVar7 >> 2);
          iVar5 = (int)(lVar7 >> 0x3f);
          if (iVar4 != iVar5) {
            lVar7 = *plVar2;
            uVar8 = uVar6;
            uVar9 = uVar6;
            goto LAB_140161cd0;
          }
        }
        break;
      }
    }
  }
  goto LAB_140161c54;
LAB_140161cd0:
  do {
    if ((ulonglong)((plVar2[1] - lVar7) / 0x18) <= uVar8) {
      std::_Xout_of_range("invalid vector<T> subscript");
      pcVar3 = (code *)swi(3);
      uVar6 = (*pcVar3)();
      return uVar6;
    }
    if ((*(int *)(uVar6 + lVar7) <= param_3) && (param_3 <= *(int *)(uVar6 + 4 + lVar7))) {
      if (param_4 != 2) {
        if (param_4 == 5) {
          uVar10 = *(uint *)(uVar6 + 0x10 + lVar7);
          goto LAB_140161c57;
        }
        if (param_4 == 4) {
          uVar10 = *(uint *)(uVar6 + 0xc + lVar7);
          goto LAB_140161c57;
        }
        if (param_4 == 6) {
          uVar10 = *(uint *)(uVar6 + 0x14 + lVar7);
          goto LAB_140161c57;
        }
        if ((param_2 != 0x802) || (param_4 != 1)) goto LAB_140161d09;
      }
      uVar10 = *(uint *)(uVar6 + 8 + lVar7);
      goto LAB_140161c57;
    }
LAB_140161d09:
    uVar10 = (int)uVar9 + 1;
    uVar9 = (ulonglong)uVar10;
    uVar8 = uVar8 + 1;
    uVar6 = uVar6 + 0x18;
  } while (uVar10 < (uint)(iVar4 - iVar5));
LAB_140161c54:
  uVar10 = 0;
LAB_140161c57:
  return (ulonglong)uVar10;
}



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

undefined4
FUN_140161d60(longlong param_1,int param_2,int param_3,int param_4,int param_5,int param_6,
             int param_7,undefined4 *param_8,float *param_9)

{
  undefined4 uVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  ulonglong uVar5;
  int *piVar6;
  undefined4 *puVar7;
  longlong lVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  undefined4 *puVar11;
  float *pfVar12;
  longlong lVar13;
  int iVar14;
  float fVar15;
  float fVar16;
  int local_res10 [2];
  undefined1 auStack_f8 [32];
  int local_d8;
  int local_d4;
  undefined4 *local_d0;
  ulonglong local_c8;
  float *local_c0;
  longlong local_b8;
  longlong local_b0;
  undefined4 *local_a8;
  undefined4 *local_a0;
  undefined4 *local_98;
  undefined8 local_88;
  undefined4 local_80;
  int local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  ulonglong local_60;
  
  local_88 = 0xfffffffffffffffe;
  local_60 = DAT_1405d84f0 ^ (ulonglong)auStack_f8;
  local_d4 = param_4;
  local_b0 = param_1;
  local_d0 = param_8;
  local_c0 = param_9;
  puVar10 = (undefined4 *)0x0;
  if (param_2 < 1) {
    *param_8 = 0;
    *param_9 = 0.0;
    param_8[1] = 0;
    param_9[1] = 0.0;
    param_8[2] = 0;
    param_9[2] = 0.0;
  }
  else {
    local_a8 = (undefined4 *)0x0;
    local_a0 = (undefined4 *)0x0;
    local_98 = (undefined4 *)0x0;
    uVar5 = *(longlong *)(param_1 + 0x20) - *(longlong *)(param_1 + 0x18) >> 3;
    local_res10[0] = param_2;
    local_d8 = param_3;
    if ((int)uVar5 != 0) {
      local_b8 = 0;
      local_c8 = uVar5 & 0xffffffff;
      puVar11 = puVar10;
      puVar7 = puVar10;
      do {
        puVar9 = *(undefined4 **)(local_b8 + *(longlong *)(local_b0 + 0x18));
        if (((((((puVar9[4] == param_5) || (puVar9[5] == param_5)) || (puVar9[6] == param_5)) ||
              ((puVar9[7] == param_5 || (puVar9[8] == param_5)))) ||
             ((puVar9[9] == param_5 || (puVar9[4] == 0)))) &&
            ((((puVar9[10] == param_6 || (puVar9[0xb] == param_6)) || (puVar9[0xc] == param_6)) ||
             ((puVar9[0xd] == param_6 || (puVar9[10] == 0)))))) &&
           ((((puVar9[0xe] == param_7 ||
              (((puVar9[0xf] == param_7 || (puVar9[0x10] == param_7)) || (puVar9[0x11] == param_7)))
              ) || (puVar9[0xe] == 0)) &&
            ((((int)puVar9[2] <= param_4 && (param_4 <= (int)puVar9[3])) &&
             (iVar3 = puVar9[1], iVar3 == param_3)))))) {
          uVar1 = *puVar9;
          local_80 = uVar1;
          local_7c = iVar3;
          local_78 = puVar9[0x12];
          local_74 = puVar9[0x13];
          local_70 = puVar9[0x14];
          local_6c = puVar9[0x15];
          local_68 = puVar9[0x16];
          if ((&local_80 < puVar11) && (puVar10 <= &local_80)) {
            lVar8 = (longlong)&local_80 - (longlong)puVar10;
            if (puVar11 == puVar7) {
              FUN_140162330(&local_a8);
              puVar10 = local_a8;
              puVar11 = local_a0;
              puVar7 = local_98;
              param_4 = local_d4;
            }
            puVar9 = puVar10 + (lVar8 / 0x1c) * 7;
            if (puVar11 != (undefined4 *)0x0) {
              *puVar11 = *puVar9;
              puVar11[1] = puVar9[1];
              puVar11[2] = puVar9[2];
              puVar11[3] = puVar9[3];
              puVar11[4] = puVar9[4];
              puVar11[5] = puVar9[5];
              uVar1 = puVar9[6];
LAB_140161ffc:
              puVar11[6] = uVar1;
            }
          }
          else {
            if (puVar11 == puVar7) {
              FUN_140162330(&local_a8);
              puVar10 = local_a8;
              puVar11 = local_a0;
              puVar7 = local_98;
              param_4 = local_d4;
            }
            if (puVar11 != (undefined4 *)0x0) {
              *puVar11 = uVar1;
              puVar11[1] = iVar3;
              puVar11[2] = local_78;
              puVar11[3] = local_74;
              puVar11[4] = local_70;
              puVar11[5] = local_6c;
              uVar1 = local_68;
              goto LAB_140161ffc;
            }
          }
          puVar11 = puVar11 + 7;
          local_a0 = puVar11;
          param_3 = local_d8;
        }
        pfVar12 = local_c0;
        local_b8 = local_b8 + 8;
        local_c8 = local_c8 - 1;
      } while (local_c8 != 0);
      if (puVar10 != puVar11) {
        local_d8 = (int)(((longlong)puVar11 - (longlong)puVar10) / 0x1c);
        piVar6 = local_res10;
        if (local_d8 <= local_res10[0]) {
          piVar6 = &local_d8;
        }
        iVar3 = *piVar6;
        iVar2 = rand();
        local_d8 = 0;
        iVar14 = 0;
        lVar13 = 0;
        local_c0 = (float *)(longlong)(iVar2 % iVar3);
        puVar7 = (undefined4 *)((longlong)local_d0 - (longlong)pfVar12);
        lVar8 = -(longlong)puVar10;
        local_d0 = puVar7;
        local_b0 = lVar8;
        iVar3 = local_res10[0];
        do {
          if ((iVar14 < iVar3) && (puVar10 != puVar11)) {
            iVar3 = rand();
            lVar8 = (longlong)
                    (int)((ulonglong)(longlong)iVar3 %
                         (ulonglong)((lVar8 + (longlong)puVar11) / 0x1c));
            *(undefined4 *)((longlong)local_d0 + (longlong)pfVar12) = puVar10[lVar8 * 7 + 2];
            if (local_c0 == (float *)lVar13) {
              local_d8 = puVar10[lVar8 * 7];
              uVar4 = rand();
              uVar4 = uVar4 & 0x80000001;
              if ((int)uVar4 < 0) {
                uVar4 = (uVar4 - 1 | 0xfffffffe) + 1;
              }
              if (uVar4 == 0) goto LAB_140162139;
              fVar15 = (float)puVar10[lVar8 * 7 + 6];
              fVar16 = (float)puVar10[lVar8 * 7 + 5];
            }
            else {
LAB_140162139:
              fVar15 = (float)puVar10[lVar8 * 7 + 4];
              fVar16 = (float)puVar10[lVar8 * 7 + 3];
            }
            iVar3 = rand();
            *pfVar12 = ((float)iVar3 / 32767.0) * (fVar15 - fVar16) + fVar16;
            puVar7 = puVar10 + lVar8 * 7 + 7;
            if (puVar7 != puVar11) {
              puVar9 = puVar7 + -7;
              do {
                *puVar9 = *puVar7;
                puVar9[1] = puVar7[1];
                puVar9[2] = puVar7[2];
                puVar9[3] = puVar7[3];
                puVar9[4] = puVar7[4];
                puVar9[5] = puVar7[5];
                puVar9[6] = puVar7[6];
                puVar7 = puVar7 + 7;
                puVar9 = puVar9 + 7;
              } while (puVar7 != puVar11);
            }
            puVar11 = puVar11 + -7;
            puVar7 = local_d0;
            lVar8 = local_b0;
            iVar3 = local_res10[0];
          }
          else {
            *(undefined4 *)((longlong)puVar7 + (longlong)pfVar12) = 0;
            *pfVar12 = 0.0;
          }
          iVar14 = iVar14 + 1;
          lVar13 = lVar13 + 1;
          pfVar12 = pfVar12 + 1;
          if (2 < lVar13) {
            if (puVar10 == (undefined4 *)0x0) {
              return local_d8;
            }
            operator_delete(puVar10);
            return local_d8;
          }
        } while( true );
      }
    }
    *local_d0 = 0;
    *local_c0 = 0.0;
    local_d0[1] = 0;
    local_c0[1] = 0.0;
    local_d0[2] = 0;
    local_c0[2] = 0.0;
    if (puVar10 != (undefined4 *)0x0) {
      operator_delete(puVar10);
    }
  }
  return 0;
}



undefined * FUN_140162270(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetItemOptionDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce54 & 1) == 0) {
    DAT_14060ce54 = DAT_14060ce54 | 1;
    FUN_140160d50();
    atexit((_func_5014 *)&LAB_1404489b0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetItemOptionDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060b180;
}



void FUN_140162300(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;
}



void FUN_140162330(longlong *param_1)

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



uint * FUN_1401623f0(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 4)) {
      if ((puVar2[6] == param_2) && (*puVar2 == param_2)) {
        *(undefined8 *)(puVar2 + 2) = *param_3;
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402da6b0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  *(undefined8 *)(puVar2 + 2) = *param_3;
  return puVar2;
}



void FUN_1401624a0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar7 = 0;
  if ((*param_1 != 0) && (uVar8 = uVar7, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(uVar8 + *param_1);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x10);
        *(longlong *)(lVar3 + 0x10) = param_1[8];
        param_1[1] = param_1[1] + -1;
        param_1[8] = lVar3;
        if (((ulonglong)param_1[1] < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          uVar4 = FUN_1402cddb0(param_1);
          FUN_140253ff0(param_1,uVar4);
        }
        lVar3 = lVar1;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar5 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar5;
              free(plVar5);
              plVar5 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      uVar8 = uVar8 + 8;
    } 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_1402cddb0(param_1,0);
    FUN_1402c6d50(param_1,uVar4,0);
  }
  param_1[8] = 0;
  plVar5 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar5;
      free(plVar5);
      plVar5 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_1401625e0(void)

{
  FUN_1401624a0();
  return;
}



float FUN_140162600(float param_1,float param_2)

{
  int iVar1;
  
  iVar1 = rand();
  return ((float)iVar1 / 32767.0) * (param_2 - param_1) + param_1;
}



// WARNING: Removing unreachable block (ram,0x000140162718)
// WARNING: Removing unreachable block (ram,0x000140162721)
// WARNING: Removing unreachable block (ram,0x000140162742)
// WARNING: Removing unreachable block (ram,0x00014016274b)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140162650(void)

{
  undefined8 uVar1;
  
  FUN_1402ca220(&DAT_14060ab80);
  _DAT_14060abc0 = 0;
  _DAT_14060abc8 = 0;
  _DAT_14060abd0 = 0x11;
  _DAT_14060abf0 = 0;
  _DAT_14060abf4 = 10;
  _DAT_14060abf8 = 0;
  _DAT_14060ac00 = 0;
  _DAT_14060abd4 = 0x3f400000;
  _DAT_14060abd8 = 0x3e800000;
  _DAT_14060abdc = 0x40100000;
  uVar1 = 0x26;
  _DAT_14060abe8 = 0;
  _DAT_14060abe0 = uVar1;
  _eh_vector_constructor_iterator_
            (&DAT_14060ac60,0x38,8,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  _DAT_14060ae20 = 0;
  _DAT_14060ae28 = 0;
  _DAT_14060ae30 = 0x11;
  _DAT_14060ae50 = 0;
  _DAT_14060ae54 = 10;
  _DAT_14060ae58 = 0;
  _DAT_14060ae60 = 0;
  _DAT_14060ae34 = 0x3f400000;
  _DAT_14060ae38 = 0x3e800000;
  _DAT_14060ae3c = 0x40100000;
  _DAT_14060ae48 = 0;
  _DAT_14060ae68 = 0;
  _DAT_14060ae70 = 0;
  _DAT_14060ae78 = 0x11;
  _DAT_14060ae98 = 0;
  _DAT_14060ae9c = 10;
  _DAT_14060aea0 = 0;
  _DAT_14060aea8 = 0;
  _DAT_14060ae7c = 0x3f400000;
  _DAT_14060ae80 = 0x3e800000;
  _DAT_14060ae84 = 0x40100000;
  _DAT_14060ae90 = 0;
  _DAT_14060ae40 = uVar1;
  _DAT_14060ae88 = uVar1;
  _eh_vector_constructor_iterator_
            (&DAT_14060aeb0,0x48,4,(_func_void_void_ptr *)&LAB_1401629c0,thunk_FUN_1401625e0);
  _eh_vector_constructor_iterator_
            (&DAT_14060afd0,0x48,4,(_func_void_void_ptr *)&LAB_1401629c0,thunk_FUN_1401625e0);
  _DAT_14060b0f0 = 0;
  _DAT_14060b0f8 = 0;
  _DAT_14060b100 = 0x11;
  _DAT_14060b120 = 0;
  _DAT_14060b124 = 10;
  _DAT_14060b128 = 0;
  _DAT_14060b130 = 0;
  _DAT_14060b104 = 0x3f400000;
  _DAT_14060b108 = 0x3e800000;
  _DAT_14060b10c = 0x40100000;
  _DAT_14060b118 = 0;
  _DAT_14060b138 = 0;
  _DAT_14060b140 = 0;
  _DAT_14060b148 = 0x11;
  _DAT_14060b168 = 0;
  _DAT_14060b16c = 10;
  _DAT_14060b170 = 0;
  _DAT_14060b178 = 0;
  _DAT_14060b14c = 0x3f400000;
  _DAT_14060b150 = 0x3e800000;
  _DAT_14060b154 = 0x40100000;
  _DAT_14060b160 = 0;
  _DAT_14060b110 = uVar1;
  _DAT_14060b158 = uVar1;
  FUN_140162b50();
  return &DAT_14060ab80;
}



void thunk_FUN_1401660f0(void)

{
  FUN_1401660f0();
  return;
}



void thunk_FUN_14032ce50(void)

{
  FUN_14032ce50();
  return;
}



void thunk_FUN_1401625e0(void)

{
  FUN_1401625e0();
  return;
}



void FUN_140162a80(void)

{
  FUN_1401625e0(&DAT_14060b138);
  FUN_1401625e0(&DAT_14060b0f0);
  _eh_vector_destructor_iterator_(&DAT_14060afd0,0x48,4,thunk_FUN_1401625e0);
  _eh_vector_destructor_iterator_(&DAT_14060aeb0,0x48,4,thunk_FUN_1401625e0);
  FUN_14032ce50(&DAT_14060ae68);
  FUN_14032ce50(&DAT_14060ae20);
  _eh_vector_destructor_iterator_(&DAT_14060ac60,0x38,8,FUN_14023be90);
  FUN_1401660f0(&DAT_14060abc0);
  if (DAT_14060ab80 != 0) {
    FUN_14014ff00(&DAT_14060ab80);
  }
  return;
}



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

void FUN_140162b50(void)

{
  ushort ****ppppuVar1;
  short sVar2;
  longlong lVar3;
  undefined4 uVar4;
  uint uVar5;
  int iVar6;
  longlong lVar7;
  short *psVar8;
  undefined4 *puVar9;
  int *piVar11;
  short *psVar12;
  ulonglong uVar13;
  longlong *plVar14;
  ushort ****ppppuVar15;
  uint uVar16;
  int iVar17;
  undefined4 *puVar18;
  ushort ****ppppuVar19;
  undefined *puVar20;
  int *piVar21;
  longlong lVar22;
  undefined1 auStack_1078 [32];
  undefined1 local_1058;
  longlong local_1048;
  undefined8 local_1040;
  undefined1 local_1038 [24];
  undefined1 local_1020 [24];
  void *local_1008 [2];
  longlong local_ff8;
  ulonglong local_ff0;
  int local_fe0;
  void *local_fd8 [2];
  longlong local_fc8;
  ulonglong local_fc0;
  int local_fb0;
  undefined1 local_fa8;
  undefined1 local_fa7;
  undefined1 local_fa6;
  int local_fa4;
  undefined4 local_fa0;
  undefined4 local_f9c;
  undefined4 local_f98;
  undefined4 local_f94;
  undefined4 local_f90;
  undefined4 local_f8c;
  undefined4 local_f88;
  undefined4 local_f84;
  undefined4 local_f80;
  undefined4 local_f7c;
  undefined4 local_f78;
  undefined4 local_f74;
  undefined4 local_f70;
  undefined4 local_f6c;
  undefined4 local_f68;
  undefined4 local_f64;
  undefined4 local_f60;
  undefined4 local_f5c;
  undefined4 local_f58;
  undefined4 local_f54;
  undefined4 local_f48;
  undefined4 local_f44;
  undefined4 local_f40;
  undefined4 local_f3c;
  undefined4 local_f38;
  undefined4 local_f34;
  undefined4 local_f30;
  undefined4 local_f2c;
  undefined4 local_f28;
  undefined4 local_f24;
  undefined4 local_f20;
  undefined4 local_f1c;
  undefined4 local_f18;
  undefined4 local_f14;
  undefined4 local_f10;
  undefined4 local_f0c;
  undefined4 local_f08;
  undefined4 local_f04;
  uint local_f00;
  undefined4 local_efc;
  undefined4 local_ef8;
  undefined4 local_ef4;
  undefined4 local_ef0;
  undefined4 local_eec;
  undefined4 local_ee8;
  undefined4 local_ee4;
  undefined4 local_ee0;
  undefined1 local_ed8 [40];
  undefined1 local_eb0 [40];
  undefined1 local_e88 [40];
  undefined1 local_e60 [40];
  undefined1 local_e38 [40];
  undefined1 local_e10 [40];
  undefined1 local_de8 [40];
  undefined1 local_dc0 [40];
  undefined1 local_d98 [40];
  undefined1 local_d70 [40];
  undefined1 local_d48 [40];
  undefined1 local_d20 [40];
  undefined1 local_cf8 [40];
  undefined1 local_cd0 [40];
  undefined1 local_ca8 [40];
  undefined1 local_c80 [40];
  undefined1 local_c58 [40];
  undefined1 local_c30 [40];
  undefined1 local_c08 [40];
  undefined1 local_be0 [40];
  undefined1 local_bb8 [40];
  undefined1 local_b90 [40];
  undefined1 local_b68 [40];
  undefined1 local_b40 [40];
  undefined1 local_b18 [40];
  undefined1 local_af0 [40];
  undefined1 local_ac8 [40];
  undefined1 local_aa0 [40];
  undefined1 local_a78 [40];
  undefined1 local_a50 [40];
  undefined1 local_a28 [40];
  undefined1 local_a00 [40];
  undefined1 local_9d8 [40];
  undefined1 local_9b0 [40];
  undefined1 local_988 [40];
  undefined1 local_960 [40];
  undefined1 local_938 [40];
  ushort ***local_910 [2];
  longlong local_900;
  ulonglong local_8f8;
  ushort ***local_8e8 [2];
  longlong local_8d8;
  ulonglong local_8d0;
  ushort ***local_8c0 [2];
  longlong local_8b0;
  ulonglong local_8a8;
  ushort ***local_898 [2];
  longlong local_888;
  ulonglong local_880;
  undefined1 local_870 [40];
  ushort ***local_848 [2];
  longlong local_838;
  ulonglong local_830;
  undefined1 local_820 [40];
  int local_7f8;
  undefined1 local_7f0 [1976];
  ulonglong local_38;
  undefined8 local_30;
  int *piVar10;
  
  local_30 = 0x140162b6c;
  local_1040 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_1078;
  DAT_14060ac08 = FUN_1402933b0(DAT_140607ff0,L"WORLD");
  DAT_14060ac20 = FUN_1402933b0(DAT_140607ff0,L"SCENE_DATA");
  lVar7 = FUN_1402933b0(DAT_140607ff0,L"WORLD_STRING");
  local_1048 = lVar7;
  DAT_14060ac18 = FUN_1402933b0(DAT_140607ff0,L"SERVER_LOBBY_ID");
  DAT_14060ac28 = FUN_1402933b0(DAT_140607ff0,L"MAP_CURTIS");
  DAT_14060ac30 = FUN_1402933b0(DAT_140607ff0,L"CORRIDOR_CURTIS");
  DAT_14060ac38 = FUN_1402933b0(DAT_140607ff0,L"EPISODEMODE_CURTIS");
  DAT_14060ac40 = FUN_1402933b0(DAT_140607ff0,L"CHALLENGEMODE_CURTIS");
  DAT_14060ac48 = FUN_1402933b0(DAT_140607ff0,L"FREEMODE_CURTIS");
  DAT_14060ac58 = FUN_1402933b0(DAT_140607ff0,L"PARTY_DUNGEONS");
  DAT_14060ac50 = FUN_1402933b0(DAT_140607ff0,L"MAPSELECT_CURTIS");
  DAT_14060ac10 = FUN_1402933b0(DAT_140607ff0,L"RANK_RESULT");
  if ((((((DAT_14060ac08 != 0) && (DAT_14060ac20 != 0)) && (lVar7 != 0)) &&
       (((DAT_14060ac18 != 0 && (DAT_14060ac28 != 0)) &&
        ((DAT_14060ac30 != 0 && ((DAT_14060ac38 != 0 && (DAT_14060ac40 != 0)))))))) &&
      (DAT_14060ac48 != 0)) &&
     (((DAT_14060ac58 != 0 && (DAT_14060ac50 != 0)) && (DAT_14060ac10 != 0)))) {
    iVar17 = 1;
    puVar18 = &DAT_14060ac8c;
    puVar20 = &DAT_14060ac60;
    lVar7 = 8;
    do {
      lVar22 = DAT_14060ac10;
      uVar4 = FUN_1402970c0(DAT_14060ac10,L"szRank");
      local_1058 = 1;
      psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szRank");
      uVar13 = 0xffffffffffffffff;
      psVar12 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar2 != 0);
      FUN_140001710(puVar20,psVar8,~uVar13 - 1);
      lVar22 = DAT_14060ac10;
      uVar4 = FUN_1402970c0(DAT_14060ac10,L"nRankPercentMin");
      local_1058 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRankPercentMin");
      if (puVar9 != (undefined4 *)0x0) {
        puVar18[-1] = *puVar9;
      }
      lVar22 = DAT_14060ac10;
      uVar4 = FUN_1402970c0(DAT_14060ac10,L"nRankPercentMax");
      local_1058 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRankPercentMax");
      *puVar18 = *puVar9;
      lVar22 = DAT_14060ac10;
      uVar4 = FUN_1402970c0(DAT_14060ac10,L"fRankRevision");
      local_1058 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar22,iVar17,uVar4,L"fRankRevision");
      puVar18[1] = *puVar9;
      puVar20 = puVar20 + 0x38;
      iVar17 = iVar17 + 1;
      puVar18 = puVar18 + 0xe;
      lVar7 = lVar7 + -1;
    } while (lVar7 != 0);
    FUN_14032ce70(&DAT_14060ae68);
    puVar20 = &DAT_14060afd0;
    lVar7 = 4;
    do {
      FUN_1401624a0(puVar20 + -0x120);
      FUN_1401624a0(puVar20);
      puVar20 = puVar20 + 0x48;
      lVar7 = lVar7 + -1;
    } while (lVar7 != 0);
    FUN_1401624a0(&DAT_14060b0f0);
    FUN_1401624a0(&DAT_14060b138);
    lVar7 = DAT_14060ac08;
    piVar21 = (int *)0x0;
    piVar11 = piVar21;
    if ((*(longlong *)(DAT_14060ac08 + 0x70) != 0) && (*(uint *)(DAT_14060ac08 + 0x78) != 0)) {
      piVar10 = piVar21;
      plVar14 = *(longlong **)(DAT_14060ac08 + 0x68);
      do {
        if (*plVar14 != 0) {
          piVar11 = (int *)(*(longlong **)(DAT_14060ac08 + 0x68))[(longlong)piVar10];
          break;
        }
        uVar5 = (int)piVar10 + 1;
        piVar10 = (int *)(ulonglong)uVar5;
        plVar14 = plVar14 + 1;
      } while (uVar5 < *(uint *)(DAT_14060ac08 + 0x78));
    }
LAB_140162f31:
    piVar10 = piVar11;
    if (piVar10 != (int *)0x0) {
      iVar17 = *piVar10;
      if (0 < iVar17) {
        FUN_140164b50(&local_fa8);
        lVar22 = DAT_14060ac08;
        local_fa4 = iVar17;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nWorldInstanceItemDropGroupList");
        local_1058 = 1;
        puVar18 = (undefined4 *)
                  FUN_140296600(lVar22,iVar17,uVar4,L"nWorldInstanceItemDropGroupList");
        lVar22 = DAT_14060ac08;
        local_fa0 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nWorldItemDropGroupList");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nWorldItemDropGroupList");
        lVar22 = DAT_14060ac08;
        local_f9c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nEventWorldItemDropGroupList");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nEventWorldItemDropGroupList");
        lVar22 = DAT_14060ac08;
        local_f98 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nGoldSpending");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nGoldSpending");
        lVar22 = DAT_14060ac08;
        local_f94 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szWorldFile");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szWorldFile");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_910,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nRareGold");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRareGold");
        lVar22 = DAT_14060ac08;
        local_f90 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nRareSilver");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRareSilver");
        lVar22 = DAT_14060ac08;
        local_f8c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nRareBronze");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRareBronze");
        lVar22 = DAT_14060ac08;
        local_f88 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nLoadingImageGroup");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nLoadingImageGroup");
        lVar22 = DAT_14060ac08;
        local_f84 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nLoadingTipGroup");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nLoadingTipGroup");
        lVar22 = DAT_14060ac08;
        local_f80 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageClearTime00");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageClearTime00");
        lVar22 = DAT_14060ac08;
        local_f7c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageClearTime01");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageClearTime01");
        lVar22 = DAT_14060ac08;
        local_f78 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageClearTime02");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageClearTime02");
        lVar22 = DAT_14060ac08;
        local_f74 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageClearTime03");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageClearTime03");
        lVar22 = DAT_14060ac08;
        if (puVar18 == (undefined4 *)0x0) {
          local_f70 = 0;
        }
        else {
          local_f70 = *puVar18;
        }
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageClearPoint00");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageClearPoint00");
        lVar22 = DAT_14060ac08;
        local_f6c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageClearPoint01");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageClearPoint01");
        lVar22 = DAT_14060ac08;
        local_f68 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageClearPoint02");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageClearPoint02");
        lVar22 = DAT_14060ac08;
        local_f64 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageClearPoint03");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageClearPoint03");
        lVar22 = DAT_14060ac08;
        if (puVar18 == (undefined4 *)0x0) {
          local_f60 = 0;
        }
        else {
          local_f60 = *puVar18;
        }
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nRaid");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRaid");
        lVar22 = DAT_14060ac08;
        local_f38 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nRootVillageID");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRootVillageID");
        lVar22 = DAT_14060ac08;
        local_f5c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nBonusExp00");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nBonusExp00");
        lVar22 = DAT_14060ac08;
        local_f58 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nWorldLevel");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nWorldLevel");
        lVar22 = DAT_14060ac08;
        local_f54 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nDungeonMaxTime");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nDungeonMaxTime");
        lVar22 = DAT_14060ac08;
        local_f48 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nRouletteConditionID");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRouletteConditionID");
        lVar22 = DAT_14060ac08;
        local_f44 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nTeenRouletteConditionID");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nTeenRouletteConditionID");
        lVar22 = DAT_14060ac08;
        local_f40 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nRareCardAdditionID");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRareCardAdditionID");
        lVar22 = DAT_14060ac08;
        local_f3c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nEntrance");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nEntrance");
        lVar22 = DAT_14060ac08;
        local_f34 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageRewardItemLevel");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageRewardItemLevel");
        lVar22 = DAT_14060ac08;
        local_f30 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageRewardItemMin");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageRewardItemMin");
        lVar22 = DAT_14060ac08;
        local_f2c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageRewardItemMax");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageRewardItemMax");
        lVar22 = DAT_14060ac08;
        local_f28 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageRewardGoldMin");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageRewardGoldMin");
        lVar22 = DAT_14060ac08;
        local_f24 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nStageRewardGoldMax");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nStageRewardGoldMax");
        lVar22 = DAT_14060ac08;
        local_f20 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nstageplaypoint");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nstageplaypoint");
        lVar22 = DAT_14060ac08;
        local_f1c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nDungeonShop");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nDungeonShop");
        lVar22 = DAT_14060ac08;
        local_f18 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szName");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szName");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_e38,psVar8,~uVar13 - 1);
        local_ff0 = 7;
        local_ff8 = 0;
        local_1008[0] = (void *)((ulonglong)local_1008[0] & 0xffffffffffff0000);
        FUN_1400015e0(local_1008,local_e38,0,0xffffffffffffffff);
        local_fc0 = 7;
        local_fc8 = 0;
        local_fd8[0] = (void *)((ulonglong)local_fd8[0] & 0xffffffffffff0000);
        local_fe0 = iVar17;
        if (local_ff0 < 8) {
          memmove(local_fd8,local_1008,local_ff8 * 2 + 2);
          local_fc0 = local_ff0;
        }
        else {
          local_fd8[0] = local_1008[0];
          local_1008[0] = (void *)0x0;
          local_fc0 = local_ff0;
        }
        local_fc8 = local_ff8;
        local_ff8 = 0;
        local_ff0 = 0;
        local_fb0 = local_fe0;
        if (DAT_14060aba0 == 0) {
          FUN_1401500f0(&DAT_14060ab80,local_1038,local_fd8);
        }
        else {
          FUN_14014ffb0(&DAT_14060ab80,local_1020,local_fd8,local_fd8);
        }
        if (7 < local_fc0) {
          operator_delete(local_fd8[0]);
        }
        local_fc0 = 7;
        local_fc8 = 0;
        local_fd8[0] = (void *)((ulonglong)local_fd8[0] & 0xffffffffffff0000);
        if (7 < local_ff0) {
          operator_delete(local_1008[0]);
        }
        lVar22 = local_1048;
        uVar4 = FUN_1402970c0(local_1048,L"wszNameUI");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296b70(lVar22,iVar17,uVar4,L"wszNameUI");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_e10,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szIconName");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szIconName");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_de8,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nSkipDungeonInfo");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nSkipDungeonInfo");
        lVar22 = DAT_14060ac08;
        local_f10 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szInfoSprite");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szInfoSprite");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_d98,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPlayLevel");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPlayLevel");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_dc0,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szNotifyPortal");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szNotifyPortal");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_d70,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szUnlockCondition");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szUnlockCondition");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_d48,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szUnlockHardCondition");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szUnlockHardCondition");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_d20,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szUnlockVeryHardCondition");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szUnlockVeryHardCondition");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_cf8,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szUnlockBloodCondition");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szUnlockBloodCondition");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_cd0,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szUnlockNoFatigueCondition");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szUnlockNoFatigueCondition");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_ca8,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyHP01");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyHP01");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_c80,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyHP02");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyHP02");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_c58,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyHP03");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyHP03");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_c30,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyHP");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyHP");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_c08,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyAttack01");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyAttack01");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_be0,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyAttack02");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyAttack02");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_bb8,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyAttack03");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyAttack03");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_b90,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyAttack");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyAttack");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_b68,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyGold");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyGold");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_b40,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szDifficultyExp");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szDifficultyExp");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_b18,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPreloadShoot01");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPreloadShoot01");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_af0,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPreloadShoot02");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPreloadShoot02");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_ac8,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPreloadShoot03");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPreloadShoot03");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_aa0,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPreloadShoot04");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPreloadShoot04");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_a78,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPreloadEnemy01");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPreloadEnemy01");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_a50,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPreloadEnemy02");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPreloadEnemy02");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_a28,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPreloadEnemy03");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPreloadEnemy03");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_a00,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPreloadEnemy04");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPreloadEnemy04");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_9d8,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szCategory");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szCategory");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_9b0,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szSubCategory");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szSubCategory");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_988,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szMinimap");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szMinimap");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_960,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szMap");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szMap");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_938,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nPartySummon");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nPartySummon");
        lVar22 = DAT_14060ac08;
        local_f0c = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nBloodMode");
        local_1058 = 1;
        piVar11 = (int *)FUN_140296600(lVar22,iVar17,uVar4,L"nBloodMode");
        lVar22 = DAT_14060ac08;
        local_fa8 = *piVar11 != 0;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szPlayBloodLevel");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szPlayBloodLevel");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_870,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nBloodRebirthLimit");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nBloodRebirthLimit");
        lVar22 = DAT_14060ac08;
        local_f04 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nRebirthLimit");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nRebirthLimit");
        lVar22 = DAT_14060ac08;
        local_f08 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nNoFatigueType");
        local_1058 = 1;
        piVar11 = (int *)FUN_140296600(lVar22,iVar17,uVar4,L"nNoFatigueType");
        lVar22 = DAT_14060ac08;
        local_f00 = (uint)(*piVar11 != 0);
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nNoPenalty");
        local_1058 = 1;
        piVar11 = (int *)FUN_140296600(lVar22,iVar17,uVar4,L"nNoPenalty");
        lVar22 = DAT_14060ac08;
        local_fa7 = *piVar11 != 0;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nUniqueness");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nUniqueness");
        lVar22 = DAT_14060ac08;
        local_efc = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nInDungeonType");
        local_1058 = 0;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nInDungeonType");
        lVar22 = DAT_14060ac08;
        if (puVar18 != (undefined4 *)0x0) {
          local_f14 = *puVar18;
        }
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nFishingGroup");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nFishingGroup");
        lVar22 = DAT_14060ac08;
        local_ef8 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szWorldLightFile");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szWorldLightFile");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_8e8,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szCharLightFile");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szCharLightFile");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_8c0,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szShadowLightFile");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szShadowLightFile");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_898,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szSky");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szSky");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_848,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nFreeCamera");
        local_1058 = 1;
        piVar11 = (int *)FUN_140296600(lVar22,iVar17,uVar4,L"nFreeCamera");
        lVar22 = DAT_14060ac08;
        local_fa6 = *piVar11 != 0;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nMiniMapMode");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nMiniMapMode");
        lVar22 = DAT_14060ac08;
        local_ef4 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szMap");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szMap");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_ed8,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szMinimap");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szMinimap");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_eb0,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"fMinimapStartX");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_1402967b0(lVar22,iVar17,uVar4,L"fMinimapStartX");
        lVar22 = DAT_14060ac08;
        local_eec = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"fMinimapStartZ");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_1402967b0(lVar22,iVar17,uVar4,L"fMinimapStartZ");
        lVar22 = DAT_14060ac08;
        local_ee8 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"fMinimapEndX");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_1402967b0(lVar22,iVar17,uVar4,L"fMinimapEndX");
        lVar22 = DAT_14060ac08;
        local_ee4 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"fMinimapEndZ");
        local_1058 = 1;
        puVar18 = (undefined4 *)FUN_1402967b0(lVar22,iVar17,uVar4,L"fMinimapEndZ");
        lVar22 = DAT_14060ac08;
        local_ee0 = *puVar18;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szMapTitleTop");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szMapTitleTop");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_e88,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szMapTitleBottom");
        local_1058 = 1;
        psVar8 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szMapTitleBottom");
        uVar13 = 0xffffffffffffffff;
        psVar12 = psVar8;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_e60,psVar8,~uVar13 - 1);
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"szMapPreviewImg");
        local_1058 = 0;
        psVar12 = (short *)FUN_140296990(lVar22,iVar17,uVar4,L"szMapPreviewImg");
        if (psVar12 != (short *)0x0) {
          uVar13 = 0xffffffffffffffff;
          psVar8 = psVar12;
          do {
            if (uVar13 == 0) break;
            uVar13 = uVar13 - 1;
            sVar2 = *psVar8;
            psVar8 = psVar8 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_820,psVar12,~uVar13 - 1);
        }
        lVar22 = DAT_14060ac08;
        uVar4 = FUN_1402970c0(DAT_14060ac08,L"nMapPreview");
        local_1058 = 0;
        puVar18 = (undefined4 *)FUN_140296600(lVar22,iVar17,uVar4,L"nMapPreview");
        if (puVar18 != (undefined4 *)0x0) {
          local_ef0 = *puVar18;
        }
        ppppuVar15 = local_910;
        if (7 < local_8f8) {
          ppppuVar15 = (ushort ****)local_910[0];
        }
        ppppuVar1 = (ushort ****)((longlong)ppppuVar15 + local_900 * 2);
        ppppuVar19 = local_910;
        if (7 < local_8f8) {
          ppppuVar19 = (ushort ****)local_910[0];
        }
        if (ppppuVar19 != ppppuVar1) {
          lVar22 = (longlong)ppppuVar15 - (longlong)ppppuVar19;
          do {
            iVar6 = tolower((uint)*(ushort *)ppppuVar19);
            *(short *)((longlong)ppppuVar19 + lVar22) = (short)iVar6;
            ppppuVar19 = (ushort ****)((longlong)ppppuVar19 + 2);
          } while (ppppuVar19 != ppppuVar1);
        }
        ppppuVar15 = local_8e8;
        if (7 < local_8d0) {
          ppppuVar15 = (ushort ****)local_8e8[0];
        }
        ppppuVar1 = (ushort ****)((longlong)ppppuVar15 + local_8d8 * 2);
        ppppuVar19 = local_8e8;
        if (7 < local_8d0) {
          ppppuVar19 = (ushort ****)local_8e8[0];
        }
        if (ppppuVar19 != ppppuVar1) {
          lVar22 = (longlong)ppppuVar15 - (longlong)ppppuVar19;
          do {
            iVar6 = tolower((uint)*(ushort *)ppppuVar19);
            *(short *)((longlong)ppppuVar19 + lVar22) = (short)iVar6;
            ppppuVar19 = (ushort ****)((longlong)ppppuVar19 + 2);
          } while (ppppuVar19 != ppppuVar1);
        }
        ppppuVar15 = local_8c0;
        if (7 < local_8a8) {
          ppppuVar15 = (ushort ****)local_8c0[0];
        }
        ppppuVar1 = (ushort ****)((longlong)ppppuVar15 + local_8b0 * 2);
        ppppuVar19 = local_8c0;
        if (7 < local_8a8) {
          ppppuVar19 = (ushort ****)local_8c0[0];
        }
        if (ppppuVar19 != ppppuVar1) {
          lVar22 = (longlong)ppppuVar15 - (longlong)ppppuVar19;
          do {
            iVar6 = tolower((uint)*(ushort *)ppppuVar19);
            *(short *)((longlong)ppppuVar19 + lVar22) = (short)iVar6;
            ppppuVar19 = (ushort ****)((longlong)ppppuVar19 + 2);
          } while (ppppuVar19 != ppppuVar1);
        }
        ppppuVar15 = local_898;
        if (7 < local_880) {
          ppppuVar15 = (ushort ****)local_898[0];
        }
        ppppuVar1 = (ushort ****)((longlong)ppppuVar15 + local_888 * 2);
        ppppuVar19 = local_898;
        if (7 < local_880) {
          ppppuVar19 = (ushort ****)local_898[0];
        }
        if (ppppuVar19 != ppppuVar1) {
          lVar22 = (longlong)ppppuVar15 - (longlong)ppppuVar19;
          do {
            iVar6 = tolower((uint)*(ushort *)ppppuVar19);
            *(short *)((longlong)ppppuVar19 + lVar22) = (short)iVar6;
            ppppuVar19 = (ushort ****)((longlong)ppppuVar19 + 2);
          } while (ppppuVar19 != ppppuVar1);
        }
        ppppuVar15 = local_848;
        if (7 < local_830) {
          ppppuVar15 = (ushort ****)local_848[0];
        }
        ppppuVar1 = (ushort ****)((longlong)ppppuVar15 + local_838 * 2);
        ppppuVar19 = local_848;
        if (7 < local_830) {
          ppppuVar19 = (ushort ****)local_848[0];
        }
        if (ppppuVar19 != ppppuVar1) {
          lVar22 = (longlong)ppppuVar15 - (longlong)ppppuVar19;
          do {
            iVar6 = tolower((uint)*(ushort *)ppppuVar19);
            *(short *)((longlong)ppppuVar19 + lVar22) = (short)iVar6;
            ppppuVar19 = (ushort ****)((longlong)ppppuVar19 + 2);
          } while (ppppuVar19 != ppppuVar1);
        }
        local_7f8 = iVar17;
        FUN_1401668f0(local_7f0,&local_fa8);
        FUN_140166020(&DAT_14060abc0,local_7f8,local_7f0);
        FUN_140164ed0(local_7f0);
        FUN_140164ed0(&local_fa8);
      }
      piVar11 = *(int **)(piVar10 + 6);
      if (*(int **)(piVar10 + 6) == (int *)0x0) {
        uVar5 = *(uint *)(lVar7 + 0x78);
        uVar16 = (uint)piVar10[8] % uVar5 + 1;
        lVar22 = (longlong)(int)uVar16 << 3;
        piVar11 = piVar21;
        do {
          if (uVar5 <= uVar16) break;
          lVar3 = *(longlong *)(lVar7 + 0x68);
          if (*(longlong *)(lVar3 + lVar22) != 0) {
            piVar11 = *(int **)(lVar3 + lVar22);
          }
          uVar16 = uVar16 + 1;
          lVar22 = lVar22 + 8;
        } while (piVar11 == (int *)0x0);
      }
      goto LAB_140162f31;
    }
  }
  return;
}



longlong FUN_140164b50(longlong param_1)

{
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  *(undefined8 *)(param_1 + 0x110) = 7;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined2 *)(param_1 + 0xf8) = 0;
  *(undefined8 *)(param_1 + 0x138) = 7;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 0x120) = 0;
  *(undefined8 *)(param_1 + 0x160) = 7;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined2 *)(param_1 + 0x148) = 0;
  *(undefined8 *)(param_1 + 0x188) = 7;
  *(undefined8 *)(param_1 + 0x180) = 0;
  *(undefined2 *)(param_1 + 0x170) = 0;
  *(undefined8 *)(param_1 + 0x1b0) = 7;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  *(undefined2 *)(param_1 + 0x198) = 0;
  *(undefined8 *)(param_1 + 0x1d8) = 7;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  *(undefined2 *)(param_1 + 0x1c0) = 0;
  *(undefined8 *)(param_1 + 0x200) = 7;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined2 *)(param_1 + 0x1e8) = 0;
  *(undefined8 *)(param_1 + 0x228) = 7;
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined2 *)(param_1 + 0x210) = 0;
  *(undefined8 *)(param_1 + 0x250) = 7;
  *(undefined8 *)(param_1 + 0x248) = 0;
  *(undefined2 *)(param_1 + 0x238) = 0;
  *(undefined8 *)(param_1 + 0x278) = 7;
  *(undefined8 *)(param_1 + 0x270) = 0;
  *(undefined2 *)(param_1 + 0x260) = 0;
  *(undefined8 *)(param_1 + 0x2a0) = 7;
  *(undefined8 *)(param_1 + 0x298) = 0;
  *(undefined2 *)(param_1 + 0x288) = 0;
  *(undefined8 *)(param_1 + 0x2c8) = 7;
  *(undefined8 *)(param_1 + 0x2c0) = 0;
  *(undefined2 *)(param_1 + 0x2b0) = 0;
  *(undefined8 *)(param_1 + 0x2f0) = 7;
  *(undefined8 *)(param_1 + 0x2e8) = 0;
  *(undefined2 *)(param_1 + 0x2d8) = 0;
  *(undefined8 *)(param_1 + 0x318) = 7;
  *(undefined8 *)(param_1 + 0x310) = 0;
  *(undefined2 *)(param_1 + 0x300) = 0;
  _eh_vector_constructor_iterator_
            ((void *)(param_1 + 0x328),0x28,4,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  _eh_vector_constructor_iterator_
            ((void *)(param_1 + 0x3c8),0x28,4,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  *(undefined8 *)(param_1 + 0x480) = 7;
  *(undefined8 *)(param_1 + 0x478) = 0;
  *(undefined2 *)(param_1 + 0x468) = 0;
  *(undefined8 *)(param_1 + 0x4a8) = 7;
  *(undefined8 *)(param_1 + 0x4a0) = 0;
  *(undefined2 *)(param_1 + 0x490) = 0;
  _eh_vector_constructor_iterator_
            ((void *)(param_1 + 0x4b8),0x28,4,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  _eh_vector_constructor_iterator_
            ((void *)(param_1 + 0x558),0x28,4,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  *(undefined8 *)(param_1 + 0x610) = 7;
  *(undefined8 *)(param_1 + 0x608) = 0;
  *(undefined2 *)(param_1 + 0x5f8) = 0;
  *(undefined8 *)(param_1 + 0x638) = 7;
  *(undefined8 *)(param_1 + 0x630) = 0;
  *(undefined2 *)(param_1 + 0x620) = 0;
  *(undefined8 *)(param_1 + 0x660) = 7;
  *(undefined8 *)(param_1 + 0x658) = 0;
  *(undefined2 *)(param_1 + 0x648) = 0;
  *(undefined8 *)(param_1 + 0x688) = 7;
  *(undefined8 *)(param_1 + 0x680) = 0;
  *(undefined2 *)(param_1 + 0x670) = 0;
  *(undefined8 *)(param_1 + 0x6b0) = 7;
  *(undefined8 *)(param_1 + 0x6a8) = 0;
  *(undefined2 *)(param_1 + 0x698) = 0;
  *(undefined8 *)(param_1 + 0x6d8) = 7;
  *(undefined8 *)(param_1 + 0x6d0) = 0;
  *(undefined2 *)(param_1 + 0x6c0) = 0;
  *(undefined8 *)(param_1 + 0x700) = 7;
  *(undefined8 *)(param_1 + 0x6f8) = 0;
  *(undefined2 *)(param_1 + 0x6e8) = 0;
  *(undefined8 *)(param_1 + 0x728) = 7;
  *(undefined8 *)(param_1 + 0x720) = 0;
  *(undefined2 *)(param_1 + 0x710) = 0;
  *(undefined8 *)(param_1 + 0x750) = 7;
  *(undefined8 *)(param_1 + 0x748) = 0;
  *(undefined2 *)(param_1 + 0x738) = 0;
  *(undefined8 *)(param_1 + 0x778) = 7;
  *(undefined8 *)(param_1 + 0x770) = 0;
  *(undefined2 *)(param_1 + 0x760) = 0;
  *(undefined8 *)(param_1 + 0x7a0) = 7;
  *(undefined8 *)(param_1 + 0x798) = 0;
  *(undefined2 *)(param_1 + 0x788) = 0;
  return param_1;
}



void FUN_140164ed0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x7a0)) {
    operator_delete(*(void **)(param_1 + 0x788));
  }
  *(undefined8 *)(param_1 + 0x7a0) = 7;
  *(undefined8 *)(param_1 + 0x798) = 0;
  *(undefined2 *)(param_1 + 0x788) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x778)) {
    operator_delete(*(void **)(param_1 + 0x760));
  }
  *(undefined8 *)(param_1 + 0x778) = 7;
  *(undefined8 *)(param_1 + 0x770) = 0;
  *(undefined2 *)(param_1 + 0x760) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x750)) {
    operator_delete(*(void **)(param_1 + 0x738));
  }
  *(undefined8 *)(param_1 + 0x750) = 7;
  *(undefined8 *)(param_1 + 0x748) = 0;
  *(undefined2 *)(param_1 + 0x738) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x728)) {
    operator_delete(*(void **)(param_1 + 0x710));
  }
  *(undefined8 *)(param_1 + 0x728) = 7;
  *(undefined8 *)(param_1 + 0x720) = 0;
  *(undefined2 *)(param_1 + 0x710) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x700)) {
    operator_delete(*(void **)(param_1 + 0x6e8));
  }
  *(undefined8 *)(param_1 + 0x700) = 7;
  *(undefined8 *)(param_1 + 0x6f8) = 0;
  *(undefined2 *)(param_1 + 0x6e8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x6d8)) {
    operator_delete(*(void **)(param_1 + 0x6c0));
  }
  *(undefined8 *)(param_1 + 0x6d8) = 7;
  *(undefined8 *)(param_1 + 0x6d0) = 0;
  *(undefined2 *)(param_1 + 0x6c0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x6b0)) {
    operator_delete(*(void **)(param_1 + 0x698));
  }
  *(undefined8 *)(param_1 + 0x6b0) = 7;
  *(undefined8 *)(param_1 + 0x6a8) = 0;
  *(undefined2 *)(param_1 + 0x698) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x688)) {
    operator_delete(*(void **)(param_1 + 0x670));
  }
  *(undefined8 *)(param_1 + 0x688) = 7;
  *(undefined8 *)(param_1 + 0x680) = 0;
  *(undefined2 *)(param_1 + 0x670) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x660)) {
    operator_delete(*(void **)(param_1 + 0x648));
  }
  *(undefined8 *)(param_1 + 0x660) = 7;
  *(undefined8 *)(param_1 + 0x658) = 0;
  *(undefined2 *)(param_1 + 0x648) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x638)) {
    operator_delete(*(void **)(param_1 + 0x620));
  }
  *(undefined8 *)(param_1 + 0x638) = 7;
  *(undefined8 *)(param_1 + 0x630) = 0;
  *(undefined2 *)(param_1 + 0x620) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x610)) {
    operator_delete(*(void **)(param_1 + 0x5f8));
  }
  *(undefined8 *)(param_1 + 0x610) = 7;
  *(undefined8 *)(param_1 + 0x608) = 0;
  *(undefined2 *)(param_1 + 0x5f8) = 0;
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x558),0x28,4,FUN_14023be90);
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x4b8),0x28,4,FUN_14023be90);
  if (7 < *(ulonglong *)(param_1 + 0x4a8)) {
    operator_delete(*(void **)(param_1 + 0x490));
  }
  *(undefined8 *)(param_1 + 0x4a8) = 7;
  *(undefined8 *)(param_1 + 0x4a0) = 0;
  *(undefined2 *)(param_1 + 0x490) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x480)) {
    operator_delete(*(void **)(param_1 + 0x468));
  }
  *(undefined8 *)(param_1 + 0x480) = 7;
  *(undefined8 *)(param_1 + 0x478) = 0;
  *(undefined2 *)(param_1 + 0x468) = 0;
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x3c8),0x28,4,FUN_14023be90);
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x328),0x28,4,FUN_14023be90);
  if (7 < *(ulonglong *)(param_1 + 0x318)) {
    operator_delete(*(void **)(param_1 + 0x300));
  }
  *(undefined8 *)(param_1 + 0x318) = 7;
  *(undefined8 *)(param_1 + 0x310) = 0;
  *(undefined2 *)(param_1 + 0x300) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2f0)) {
    operator_delete(*(void **)(param_1 + 0x2d8));
  }
  *(undefined8 *)(param_1 + 0x2f0) = 7;
  *(undefined8 *)(param_1 + 0x2e8) = 0;
  *(undefined2 *)(param_1 + 0x2d8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2c8)) {
    operator_delete(*(void **)(param_1 + 0x2b0));
  }
  *(undefined8 *)(param_1 + 0x2c8) = 7;
  *(undefined8 *)(param_1 + 0x2c0) = 0;
  *(undefined2 *)(param_1 + 0x2b0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2a0)) {
    operator_delete(*(void **)(param_1 + 0x288));
  }
  *(undefined8 *)(param_1 + 0x2a0) = 7;
  *(undefined8 *)(param_1 + 0x298) = 0;
  *(undefined2 *)(param_1 + 0x288) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x278)) {
    operator_delete(*(void **)(param_1 + 0x260));
  }
  *(undefined8 *)(param_1 + 0x278) = 7;
  *(undefined8 *)(param_1 + 0x270) = 0;
  *(undefined2 *)(param_1 + 0x260) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x250)) {
    operator_delete(*(void **)(param_1 + 0x238));
  }
  *(undefined8 *)(param_1 + 0x250) = 7;
  *(undefined8 *)(param_1 + 0x248) = 0;
  *(undefined2 *)(param_1 + 0x238) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x228)) {
    operator_delete(*(void **)(param_1 + 0x210));
  }
  *(undefined8 *)(param_1 + 0x228) = 7;
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined2 *)(param_1 + 0x210) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x200)) {
    operator_delete(*(void **)(param_1 + 0x1e8));
  }
  *(undefined8 *)(param_1 + 0x200) = 7;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined2 *)(param_1 + 0x1e8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1d8)) {
    operator_delete(*(void **)(param_1 + 0x1c0));
  }
  *(undefined8 *)(param_1 + 0x1d8) = 7;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  *(undefined2 *)(param_1 + 0x1c0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1b0)) {
    operator_delete(*(void **)(param_1 + 0x198));
  }
  *(undefined8 *)(param_1 + 0x1b0) = 7;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  *(undefined2 *)(param_1 + 0x198) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x188)) {
    operator_delete(*(void **)(param_1 + 0x170));
  }
  *(undefined8 *)(param_1 + 0x188) = 7;
  *(undefined8 *)(param_1 + 0x180) = 0;
  *(undefined2 *)(param_1 + 0x170) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x160)) {
    operator_delete(*(void **)(param_1 + 0x148));
  }
  *(undefined8 *)(param_1 + 0x160) = 7;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined2 *)(param_1 + 0x148) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x138)) {
    operator_delete(*(void **)(param_1 + 0x120));
  }
  *(undefined8 *)(param_1 + 0x138) = 7;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 0x120) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x110)) {
    operator_delete(*(void **)(param_1 + 0xf8));
  }
  *(undefined8 *)(param_1 + 0x110) = 7;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined2 *)(param_1 + 0xf8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xe8)) {
    operator_delete(*(void **)(param_1 + 0xd0));
  }
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  return;
}



void FUN_1401654b0(longlong param_1)

{
  FUN_140164ed0(param_1 + 8);
  return;
}



void FUN_1401654c0(longlong param_1,undefined8 param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  uint uVar4;
  undefined4 uVar5;
  int iVar6;
  ulonglong uVar7;
  wchar_t *_Str1;
  longlong lVar8;
  longlong *plVar9;
  undefined4 *puVar10;
  undefined4 *puVar11;
  
  lVar2 = *(longlong *)(param_1 + 0x88);
  if (*(longlong *)(lVar2 + 0x70) != 0) {
    uVar7 = 0;
    if (*(uint *)(lVar2 + 0x78) != 0) {
      plVar9 = *(longlong **)(lVar2 + 0x68);
      do {
        if (*plVar9 != 0) {
          puVar10 = (undefined4 *)(*(longlong **)(lVar2 + 0x68))[uVar7];
          goto LAB_140165512;
        }
        uVar4 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar4;
        plVar9 = plVar9 + 1;
      } while (uVar4 < *(uint *)(lVar2 + 0x78));
    }
  }
  puVar10 = (undefined4 *)0x0;
LAB_140165512:
  do {
    do {
      puVar11 = puVar10;
      if (puVar11 == (undefined4 *)0x0) {
        return;
      }
      uVar3 = *(undefined8 *)(param_1 + 0x88);
      uVar1 = *puVar11;
      uVar5 = FUN_1402970c0(uVar3,L"szCategory");
      _Str1 = (wchar_t *)FUN_140296990(uVar3,uVar1,uVar5,L"szCategory",1);
      if ((_Str1 != (wchar_t *)0x0) && (iVar6 = _wcsicmp(_Str1,L"GAME"), iVar6 == 0)) {
        FUN_14012e5c0(param_2);
      }
      puVar10 = *(undefined4 **)(puVar11 + 6);
    } while (puVar10 != (undefined4 *)0x0);
    uVar4 = (uint)puVar11[8] % *(uint *)(lVar2 + 0x78) + 1;
    lVar8 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(lVar2 + 0x78) <= uVar4) break;
      if (*(longlong *)(lVar8 + *(longlong *)(lVar2 + 0x68)) != 0) {
        puVar10 = *(undefined4 **)(lVar8 + *(longlong *)(lVar2 + 0x68));
      }
      uVar4 = uVar4 + 1;
      lVar8 = lVar8 + 8;
    } while (puVar10 == (undefined4 *)0x0);
  } while( true );
}



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

ulonglong FUN_1401655e0(longlong param_1,uint param_2,int param_3,int param_4)

{
  ulonglong uVar1;
  wchar_t *pwVar2;
  longlong *plVar3;
  ulonglong extraout_RAX;
  float *pfVar4;
  ulonglong extraout_RAX_00;
  ulonglong *puVar5;
  uint *puVar6;
  wchar_t *_Str;
  wchar_t *pwVar7;
  int iVar8;
  ulonglong uVar9;
  longlong lVar10;
  double dVar11;
  undefined1 auStack_d8 [32];
  wchar_t *local_b8;
  longlong local_b0;
  undefined8 local_a8;
  longlong *local_98;
  undefined8 local_90;
  undefined2 local_88;
  undefined6 uStack_86;
  undefined8 local_78;
  ulonglong local_70;
  ulonglong local_60;
  
  local_90 = 0xfffffffffffffffe;
  local_60 = DAT_1405d84f0 ^ (ulonglong)auStack_d8;
  uVar9 = (longlong)param_3 + ((longlong)(int)param_2 << 0x20);
  iVar8 = param_4 + -1;
  if (3 < param_4 + -1) {
    iVar8 = 3;
  }
  if (iVar8 < 0) {
    iVar8 = 0;
  }
  local_98 = (longlong *)(param_1 + 0x330 + (longlong)iVar8 * 0x48);
  if (*local_98 != 0) {
    for (puVar5 = *(ulonglong **)
                   (*local_98 + ((uVar9 & 0xffffffff) % (ulonglong)*(uint *)(local_98 + 2)) * 8);
        puVar5 != (ulonglong *)0x0; puVar5 = (ulonglong *)puVar5[2]) {
      if (((int)puVar5[3] == (int)uVar9) && (*puVar5 == uVar9)) {
        if (puVar5 != (ulonglong *)0x0) {
          return (uVar9 & 0xffffffff) / (ulonglong)*(uint *)(local_98 + 2);
        }
        break;
      }
    }
  }
  uVar1 = (ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 0x50);
  if (*(longlong *)(param_1 + 0x40) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(param_1 + 0x40) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x50)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0x1ee)) {
      if ((puVar6[0x1f0] == param_2) && (*puVar6 == param_2)) {
        if (puVar6 == (uint *)0x0) {
          return uVar1;
        }
        if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        puVar6 = puVar6 + (longlong)iVar8 * 10 + 0xcc;
        if (7 < *(ulonglong *)(puVar6 + 6)) {
          puVar6 = *(uint **)puVar6;
        }
        local_b8 = (wchar_t *)0x0;
        local_b0 = 0;
        local_a8 = 0;
        FUN_140415b90(&local_b8,puVar6,&DAT_1404a31fc);
        iVar8 = 1;
        if ((local_b0 - (longlong)local_b8) / 0x28 == 3) {
          local_70 = 7;
          local_78 = 0;
          local_88 = 0;
          FUN_140001710(&local_88,&DAT_1404a3200,1);
          FUN_14008ec00(&local_b8,&local_88);
          if (7 < local_70) {
            operator_delete((void *)CONCAT62(uStack_86,local_88));
          }
        }
        plVar3 = local_98;
        pwVar2 = local_b8;
        if ((ulonglong)((local_b0 - (longlong)local_b8) / 0x28) < 4) {
          if (local_b8 == (wchar_t *)0x0) {
            return -(local_b0 - (longlong)local_b8 >> 0x3f);
          }
          FUN_14008d0a0(local_b8,local_b0);
          operator_delete(pwVar2);
          return extraout_RAX;
        }
        lVar10 = 4;
        pwVar7 = local_b8;
        do {
          _Str = pwVar7;
          if (7 < *(ulonglong *)(pwVar7 + 0xc)) {
            _Str = *(wchar_t **)pwVar7;
          }
          dVar11 = _wtof(_Str);
          pfVar4 = (float *)FUN_1401661a0(plVar3,(longlong)iVar8 + ((longlong)(int)param_2 << 0x20))
          ;
          *pfVar4 = (float)dVar11;
          iVar8 = iVar8 + 1;
          pwVar7 = pwVar7 + 0x14;
          lVar10 = lVar10 + -1;
        } while (lVar10 != 0);
        uVar9 = FUN_1401661a0(plVar3,uVar9);
        if (pwVar2 == (wchar_t *)0x0) {
          return uVar9;
        }
        FUN_14008d0a0(pwVar2,local_b0);
        operator_delete(pwVar2);
        return extraout_RAX_00;
      }
    }
  }
  return uVar1;
}



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

ulonglong FUN_1401658a0(longlong param_1,uint param_2,int param_3,int param_4)

{
  ulonglong uVar1;
  wchar_t *pwVar2;
  longlong *plVar3;
  ulonglong extraout_RAX;
  float *pfVar4;
  ulonglong extraout_RAX_00;
  ulonglong *puVar5;
  uint *puVar6;
  wchar_t *_Str;
  wchar_t *pwVar7;
  int iVar8;
  ulonglong uVar9;
  longlong lVar10;
  double dVar11;
  undefined1 auStack_d8 [32];
  wchar_t *local_b8;
  longlong local_b0;
  undefined8 local_a8;
  longlong *local_98;
  undefined8 local_90;
  undefined2 local_88;
  undefined6 uStack_86;
  undefined8 local_78;
  ulonglong local_70;
  ulonglong local_60;
  
  local_90 = 0xfffffffffffffffe;
  local_60 = DAT_1405d84f0 ^ (ulonglong)auStack_d8;
  uVar9 = (longlong)param_3 + ((longlong)(int)param_2 << 0x20);
  iVar8 = param_4 + -1;
  if (3 < param_4 + -1) {
    iVar8 = 3;
  }
  if (iVar8 < 0) {
    iVar8 = 0;
  }
  local_98 = (longlong *)(param_1 + 0x450 + (longlong)iVar8 * 0x48);
  if (*local_98 != 0) {
    for (puVar5 = *(ulonglong **)
                   (*local_98 + ((uVar9 & 0xffffffff) % (ulonglong)*(uint *)(local_98 + 2)) * 8);
        puVar5 != (ulonglong *)0x0; puVar5 = (ulonglong *)puVar5[2]) {
      if (((int)puVar5[3] == (int)uVar9) && (*puVar5 == uVar9)) {
        if (puVar5 != (ulonglong *)0x0) {
          return (uVar9 & 0xffffffff) / (ulonglong)*(uint *)(local_98 + 2);
        }
        break;
      }
    }
  }
  uVar1 = (ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 0x50);
  if (*(longlong *)(param_1 + 0x40) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(param_1 + 0x40) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x50)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0x1ee)) {
      if ((puVar6[0x1f0] == param_2) && (*puVar6 == param_2)) {
        if (puVar6 == (uint *)0x0) {
          return uVar1;
        }
        if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        puVar6 = puVar6 + (longlong)iVar8 * 10 + 0xf4;
        if (7 < *(ulonglong *)(puVar6 + 6)) {
          puVar6 = *(uint **)puVar6;
        }
        local_b8 = (wchar_t *)0x0;
        local_b0 = 0;
        local_a8 = 0;
        FUN_140415b90(&local_b8,puVar6,&DAT_1404a31fc);
        if ((local_b0 - (longlong)local_b8) / 0x28 == 3) {
          local_70 = 7;
          local_78 = 0;
          local_88 = 0;
          FUN_140001710(&local_88,&DAT_1404a3208,3);
          FUN_14008ec00(&local_b8,&local_88);
          if (7 < local_70) {
            operator_delete((void *)CONCAT62(uStack_86,local_88));
          }
        }
        plVar3 = local_98;
        pwVar2 = local_b8;
        if ((local_b0 - (longlong)local_b8) / 0x28 != 4) {
          if (local_b8 == (wchar_t *)0x0) {
            return -(local_b0 - (longlong)local_b8 >> 0x3f);
          }
          FUN_14008d0a0(local_b8,local_b0);
          operator_delete(pwVar2);
          return extraout_RAX;
        }
        iVar8 = 1;
        lVar10 = 4;
        pwVar7 = local_b8;
        do {
          _Str = pwVar7;
          if (7 < *(ulonglong *)(pwVar7 + 0xc)) {
            _Str = *(wchar_t **)pwVar7;
          }
          dVar11 = _wtof(_Str);
          pfVar4 = (float *)FUN_1401661a0(plVar3,(longlong)iVar8 + ((longlong)(int)param_2 << 0x20))
          ;
          *pfVar4 = (float)dVar11;
          iVar8 = iVar8 + 1;
          pwVar7 = pwVar7 + 0x14;
          lVar10 = lVar10 + -1;
        } while (lVar10 != 0);
        uVar9 = FUN_1401661a0(plVar3,uVar9);
        if (pwVar2 == (wchar_t *)0x0) {
          return uVar9;
        }
        FUN_14008d0a0(pwVar2,local_b0);
        operator_delete(pwVar2);
        return extraout_RAX_00;
      }
    }
  }
  return uVar1;
}



ulonglong FUN_140165b60(longlong param_1,uint param_2,int param_3)

{
  ulonglong uVar1;
  wchar_t *pwVar2;
  ulonglong extraout_RAX;
  float *pfVar3;
  ulonglong extraout_RAX_00;
  longlong *plVar4;
  ulonglong *puVar5;
  uint *puVar6;
  wchar_t *_Str;
  uint *puVar7;
  wchar_t *pwVar8;
  ulonglong uVar9;
  int iVar10;
  longlong lVar11;
  longlong lVar12;
  double dVar13;
  wchar_t *local_60;
  longlong local_58;
  undefined8 local_50;
  
  lVar12 = (longlong)(int)param_2 << 0x20;
  uVar9 = param_3 + lVar12;
  plVar4 = (longlong *)(param_1 + 0x5b8);
  if (*plVar4 != 0) {
    for (puVar5 = *(ulonglong **)
                   (*plVar4 + ((uVar9 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x5c8)) * 8);
        puVar5 != (ulonglong *)0x0; puVar5 = (ulonglong *)puVar5[2]) {
      if (((int)puVar5[3] == (int)uVar9) && (*puVar5 == uVar9)) {
        if (puVar5 != (ulonglong *)0x0) {
          return (uVar9 & 0xffffffff) / (ulonglong)*(uint *)(param_1 + 0x5c8);
        }
        break;
      }
    }
  }
  uVar1 = (ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 0x50);
  if (*(longlong *)(param_1 + 0x40) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(param_1 + 0x40) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x50)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0x1ee)) {
      if ((puVar6[0x1f0] == param_2) && (*puVar6 == param_2)) {
        if (puVar6 == (uint *)0x0) {
          return uVar1;
        }
        if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        puVar7 = puVar6 + 0x126;
        if (7 < *(ulonglong *)(puVar6 + 300)) {
          puVar7 = *(uint **)puVar7;
        }
        local_60 = (wchar_t *)0x0;
        local_58 = 0;
        local_50 = 0;
        FUN_140415b90(&local_60,puVar7,&DAT_1404a31fc,(longlong)(int)param_2,0xfffffffffffffffe);
        pwVar2 = local_60;
        if ((local_58 - (longlong)local_60) / 0x28 != 4) {
          if (local_60 == (wchar_t *)0x0) {
            return -(local_58 - (longlong)local_60 >> 0x3f);
          }
          FUN_14008d0a0(local_60,local_58);
          operator_delete(pwVar2);
          return extraout_RAX;
        }
        iVar10 = 1;
        lVar11 = 4;
        pwVar8 = local_60;
        do {
          _Str = pwVar8;
          if (7 < *(ulonglong *)(pwVar8 + 0xc)) {
            _Str = *(wchar_t **)pwVar8;
          }
          dVar13 = _wtof(_Str);
          pfVar3 = (float *)FUN_1401661a0(plVar4,iVar10 + lVar12);
          *pfVar3 = (float)dVar13;
          iVar10 = iVar10 + 1;
          pwVar8 = pwVar8 + 0x14;
          lVar11 = lVar11 + -1;
        } while (lVar11 != 0);
        uVar9 = FUN_1401661a0(plVar4,uVar9);
        if (pwVar2 == (wchar_t *)0x0) {
          return uVar9;
        }
        FUN_14008d0a0(pwVar2,local_58);
        operator_delete(pwVar2);
        return extraout_RAX_00;
      }
    }
  }
  return uVar1;
}



void FUN_140165d80(longlong param_1,ulonglong *param_2,uint param_3,int param_4)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong *puVar3;
  uint *puVar4;
  ulonglong uVar5;
  bool bVar6;
  
  if (param_4 < 4) {
    lVar1 = *(longlong *)(param_1 + 0x2e8);
    uVar5 = ((longlong)(int)param_3 << 0x20) + (longlong)param_4;
    if (lVar1 != 0) {
      for (puVar2 = *(ulonglong **)
                     (lVar1 + ((uVar5 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x2f8)) * 8);
          puVar2 != (ulonglong *)0x0; puVar2 = (ulonglong *)puVar2[5]) {
        if (((int)puVar2[6] == (int)uVar5) && (*puVar2 == uVar5)) {
          if (puVar2 != (ulonglong *)0x0) {
            bVar6 = param_2 == puVar2 + 1;
            puVar3 = param_2;
            param_2 = puVar2 + 1;
            if (bVar6) {
              return;
            }
            goto LAB_140165e8a;
          }
          break;
        }
      }
    }
    if (*(longlong *)(param_1 + 0x40) != 0) {
      for (puVar4 = *(uint **)(*(longlong *)(param_1 + 0x40) +
                              ((ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x50)) * 8);
          puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0x1ee)) {
        if ((puVar4[0x1f0] == param_3) && (*puVar4 == param_3)) {
          if (puVar4 == (uint *)0x0) {
            return;
          }
          puVar4 = puVar4 + (longlong)(param_4 + -1) * 10 + 0x158;
          if (7 < *(ulonglong *)(puVar4 + 6)) {
            puVar4 = *(uint **)puVar4;
          }
          FUN_140415b90(param_2,puVar4,&DAT_14049c7b8);
          puVar3 = (ulonglong *)FUN_140166110((longlong *)(param_1 + 0x2e8),uVar5);
          if (puVar3 == param_2) {
            return;
          }
LAB_140165e8a:
          FUN_14015b160(puVar3,param_2);
          return;
        }
      }
    }
  }
  return;
}



undefined8 * FUN_140165ea0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetWorldDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060ce50 & 1) == 0) {
    DAT_14060ce50 = DAT_14060ce50 | 1;
    FUN_140162650();
    atexit((_func_5014 *)&LAB_1404489c0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetWorldDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_14060ab80;
}



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

{
  ulonglong uVar1;
  ulonglong uVar2;
  undefined2 *puVar3;
  
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (uVar2 = *param_1, uVar2 <= param_2)) {
    if (uVar1 == param_1[2]) {
      FUN_14008f510(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    uVar1 = *param_1;
    puVar3 = (undefined2 *)param_1[1];
    if (puVar3 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar3 + 0xc) = 7;
      *(undefined8 *)(puVar3 + 8) = 0;
      *puVar3 = 0;
      FUN_14008ff90(puVar3,uVar1 + ((longlong)(param_2 - uVar2) / 0x28) * 0x28);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14008f510(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
    puVar3 = (undefined2 *)param_1[1];
    if (puVar3 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar3 + 0xc) = 7;
      *(undefined8 *)(puVar3 + 8) = 0;
      *puVar3 = 0;
      FUN_14008ff90(puVar3,param_2);
    }
  }
  param_1[1] = param_1[1] + 0x28;
  return;
}



uint * FUN_140166020(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x1ee)) {
      if ((puVar2[0x1f0] == param_2) && (*puVar2 == param_2)) {
        FUN_140166230(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1401671f0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_140166230(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_1401660f0(void)

{
  FUN_140166790();
  return;
}



ulonglong * FUN_140166110(longlong *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  
  uVar1 = (param_2 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,(ulonglong)*(uint *)(param_1 + 2),1);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[5]) {
      if (((int)puVar3[6] == (int)param_2) && (*puVar3 == param_2)) goto LAB_140166167;
    }
  }
  puVar3 = (ulonglong *)FUN_140167410(param_1,param_2,uVar1,param_2 & 0xffffffff);
LAB_140166167:
  return puVar3 + 1;
}



ulonglong * FUN_1401661a0(longlong *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  
  uVar1 = (param_2 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,(ulonglong)*(uint *)(param_1 + 2),1);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[2]) {
      if (((int)puVar3[3] == (int)param_2) && (*puVar3 == param_2)) goto LAB_1401661f7;
    }
  }
  puVar3 = (ulonglong *)FUN_1402cb580(param_1,param_2,uVar1,param_2 & 0xffffffff);
LAB_1401661f7:
  return puVar3 + 1;
}



undefined1 * FUN_140166230(undefined1 *param_1,undefined1 *param_2)

{
  undefined1 *puVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x28);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x2c);
  *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(param_2 + 0x34);
  *(undefined4 *)(param_1 + 0x38) = *(undefined4 *)(param_2 + 0x38);
  *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_2 + 0x3c);
  *(undefined4 *)(param_1 + 0x40) = *(undefined4 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x44) = *(undefined4 *)(param_2 + 0x44);
  *(undefined4 *)(param_1 + 0x48) = *(undefined4 *)(param_2 + 0x48);
  *(undefined4 *)(param_1 + 0x4c) = *(undefined4 *)(param_2 + 0x4c);
  *(undefined4 *)(param_1 + 0x50) = *(undefined4 *)(param_2 + 0x50);
  *(undefined4 *)(param_1 + 0x54) = *(undefined4 *)(param_2 + 0x54);
  *(undefined4 *)(param_1 + 0x58) = *(undefined4 *)(param_2 + 0x58);
  *(undefined4 *)(param_1 + 0x5c) = *(undefined4 *)(param_2 + 0x5c);
  *(undefined4 *)(param_1 + 0x60) = *(undefined4 *)(param_2 + 0x60);
  *(undefined4 *)(param_1 + 100) = *(undefined4 *)(param_2 + 100);
  *(undefined4 *)(param_1 + 0x68) = *(undefined4 *)(param_2 + 0x68);
  *(undefined4 *)(param_1 + 0x6c) = *(undefined4 *)(param_2 + 0x6c);
  *(undefined4 *)(param_1 + 0x70) = *(undefined4 *)(param_2 + 0x70);
  *(undefined4 *)(param_1 + 0x74) = *(undefined4 *)(param_2 + 0x74);
  *(undefined4 *)(param_1 + 0x78) = *(undefined4 *)(param_2 + 0x78);
  *(undefined4 *)(param_1 + 0x7c) = *(undefined4 *)(param_2 + 0x7c);
  *(undefined4 *)(param_1 + 0x80) = *(undefined4 *)(param_2 + 0x80);
  *(undefined4 *)(param_1 + 0x84) = *(undefined4 *)(param_2 + 0x84);
  *(undefined4 *)(param_1 + 0x88) = *(undefined4 *)(param_2 + 0x88);
  *(undefined4 *)(param_1 + 0x8c) = *(undefined4 *)(param_2 + 0x8c);
  *(undefined4 *)(param_1 + 0x90) = *(undefined4 *)(param_2 + 0x90);
  *(undefined4 *)(param_1 + 0x94) = *(undefined4 *)(param_2 + 0x94);
  *(undefined4 *)(param_1 + 0x98) = *(undefined4 *)(param_2 + 0x98);
  *(undefined4 *)(param_1 + 0x9c) = *(undefined4 *)(param_2 + 0x9c);
  *(undefined4 *)(param_1 + 0xa0) = *(undefined4 *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0xa4) = *(undefined4 *)(param_2 + 0xa4);
  *(undefined4 *)(param_1 + 0xa8) = *(undefined4 *)(param_2 + 0xa8);
  *(undefined4 *)(param_1 + 0xac) = *(undefined4 *)(param_2 + 0xac);
  *(undefined4 *)(param_1 + 0xb0) = *(undefined4 *)(param_2 + 0xb0);
  *(undefined4 *)(param_1 + 0xb4) = *(undefined4 *)(param_2 + 0xb4);
  *(undefined4 *)(param_1 + 0xb8) = *(undefined4 *)(param_2 + 0xb8);
  *(undefined4 *)(param_1 + 0xbc) = *(undefined4 *)(param_2 + 0xbc);
  *(undefined4 *)(param_1 + 0xc0) = *(undefined4 *)(param_2 + 0xc0);
  *(undefined4 *)(param_1 + 0xc4) = *(undefined4 *)(param_2 + 0xc4);
  *(undefined4 *)(param_1 + 200) = *(undefined4 *)(param_2 + 200);
  FUN_1400015e0(param_1 + 0xd0,param_2 + 0xd0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xf8,param_2 + 0xf8,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x120,param_2 + 0x120,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x148,param_2 + 0x148,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x170,param_2 + 0x170,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x198,param_2 + 0x198,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1c0,param_2 + 0x1c0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1e8,param_2 + 0x1e8,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x210,param_2 + 0x210,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x238,param_2 + 0x238,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x260,param_2 + 0x260,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x288,param_2 + 0x288,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x2b0,param_2 + 0x2b0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x2d8,param_2 + 0x2d8,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x300,param_2 + 0x300,0,0xffffffffffffffff);
  lVar2 = 4;
  lVar3 = (longlong)param_2 - (longlong)param_1;
  lVar4 = 4;
  puVar1 = param_1 + 0x328;
  do {
    FUN_1400015e0(puVar1,puVar1 + lVar3,0,0xffffffffffffffff);
    puVar1 = puVar1 + 0x28;
    lVar4 = lVar4 + -1;
  } while (lVar4 != 0);
  puVar1 = param_1 + 0x3c8;
  lVar4 = 4;
  do {
    FUN_1400015e0(puVar1,puVar1 + lVar3,0,0xffffffffffffffff);
    puVar1 = puVar1 + 0x28;
    lVar4 = lVar4 + -1;
  } while (lVar4 != 0);
  FUN_1400015e0(param_1 + 0x468,param_2 + 0x468,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x490,param_2 + 0x490,0,0xffffffffffffffff);
  puVar1 = param_1 + 0x4b8;
  lVar4 = 4;
  do {
    FUN_1400015e0(puVar1,puVar1 + lVar3,0,0xffffffffffffffff);
    puVar1 = puVar1 + 0x28;
    lVar4 = lVar4 + -1;
  } while (lVar4 != 0);
  puVar1 = param_1 + 0x558;
  do {
    FUN_1400015e0(puVar1,puVar1 + lVar3,0,0xffffffffffffffff);
    puVar1 = puVar1 + 0x28;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_1400015e0(param_1 + 0x5f8,param_2 + 0x5f8,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x620,param_2 + 0x620,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x648,param_2 + 0x648,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x670,param_2 + 0x670,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x698,param_2 + 0x698,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x6c0,param_2 + 0x6c0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x6e8,param_2 + 0x6e8,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x710,param_2 + 0x710,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x738,param_2 + 0x738,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x760,param_2 + 0x760,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x788,param_2 + 0x788,0,0xffffffffffffffff);
  return param_1;
}



void FUN_140166790(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 + 0x7b8);
        FUN_140167370(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140166860(longlong *param_1,longlong param_2)

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



undefined1 * FUN_1401668f0(undefined1 *param_1,undefined1 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x28);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x2c);
  *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(param_2 + 0x34);
  *(undefined4 *)(param_1 + 0x38) = *(undefined4 *)(param_2 + 0x38);
  *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_2 + 0x3c);
  *(undefined4 *)(param_1 + 0x40) = *(undefined4 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x44) = *(undefined4 *)(param_2 + 0x44);
  *(undefined4 *)(param_1 + 0x48) = *(undefined4 *)(param_2 + 0x48);
  *(undefined4 *)(param_1 + 0x4c) = *(undefined4 *)(param_2 + 0x4c);
  *(undefined4 *)(param_1 + 0x50) = *(undefined4 *)(param_2 + 0x50);
  *(undefined4 *)(param_1 + 0x54) = *(undefined4 *)(param_2 + 0x54);
  *(undefined4 *)(param_1 + 0x58) = *(undefined4 *)(param_2 + 0x58);
  *(undefined4 *)(param_1 + 0x5c) = *(undefined4 *)(param_2 + 0x5c);
  *(undefined4 *)(param_1 + 0x60) = *(undefined4 *)(param_2 + 0x60);
  *(undefined4 *)(param_1 + 100) = *(undefined4 *)(param_2 + 100);
  *(undefined4 *)(param_1 + 0x68) = *(undefined4 *)(param_2 + 0x68);
  *(undefined4 *)(param_1 + 0x6c) = *(undefined4 *)(param_2 + 0x6c);
  *(undefined4 *)(param_1 + 0x70) = *(undefined4 *)(param_2 + 0x70);
  *(undefined4 *)(param_1 + 0x74) = *(undefined4 *)(param_2 + 0x74);
  *(undefined4 *)(param_1 + 0x78) = *(undefined4 *)(param_2 + 0x78);
  *(undefined4 *)(param_1 + 0x7c) = *(undefined4 *)(param_2 + 0x7c);
  *(undefined4 *)(param_1 + 0x80) = *(undefined4 *)(param_2 + 0x80);
  *(undefined4 *)(param_1 + 0x84) = *(undefined4 *)(param_2 + 0x84);
  *(undefined4 *)(param_1 + 0x88) = *(undefined4 *)(param_2 + 0x88);
  *(undefined4 *)(param_1 + 0x8c) = *(undefined4 *)(param_2 + 0x8c);
  *(undefined4 *)(param_1 + 0x90) = *(undefined4 *)(param_2 + 0x90);
  *(undefined4 *)(param_1 + 0x94) = *(undefined4 *)(param_2 + 0x94);
  *(undefined4 *)(param_1 + 0x98) = *(undefined4 *)(param_2 + 0x98);
  *(undefined4 *)(param_1 + 0x9c) = *(undefined4 *)(param_2 + 0x9c);
  *(undefined4 *)(param_1 + 0xa0) = *(undefined4 *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0xa4) = *(undefined4 *)(param_2 + 0xa4);
  *(undefined4 *)(param_1 + 0xa8) = *(undefined4 *)(param_2 + 0xa8);
  *(undefined4 *)(param_1 + 0xac) = *(undefined4 *)(param_2 + 0xac);
  *(undefined4 *)(param_1 + 0xb0) = *(undefined4 *)(param_2 + 0xb0);
  *(undefined4 *)(param_1 + 0xb4) = *(undefined4 *)(param_2 + 0xb4);
  *(undefined4 *)(param_1 + 0xb8) = *(undefined4 *)(param_2 + 0xb8);
  *(undefined4 *)(param_1 + 0xbc) = *(undefined4 *)(param_2 + 0xbc);
  *(undefined4 *)(param_1 + 0xc0) = *(undefined4 *)(param_2 + 0xc0);
  *(undefined4 *)(param_1 + 0xc4) = *(undefined4 *)(param_2 + 0xc4);
  *(undefined4 *)(param_1 + 200) = *(undefined4 *)(param_2 + 200);
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  FUN_1400015e0(param_1 + 0xd0,param_2 + 0xd0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x110) = 7;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined2 *)(param_1 + 0xf8) = 0;
  FUN_1400015e0(param_1 + 0xf8,param_2 + 0xf8,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x138) = 7;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 0x120) = 0;
  FUN_1400015e0(param_1 + 0x120,param_2 + 0x120,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x160) = 7;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined2 *)(param_1 + 0x148) = 0;
  FUN_1400015e0(param_1 + 0x148,param_2 + 0x148,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x188) = 7;
  *(undefined8 *)(param_1 + 0x180) = 0;
  *(undefined2 *)(param_1 + 0x170) = 0;
  FUN_1400015e0(param_1 + 0x170,param_2 + 0x170,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1b0) = 7;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  *(undefined2 *)(param_1 + 0x198) = 0;
  FUN_1400015e0(param_1 + 0x198,param_2 + 0x198,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1d8) = 7;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  *(undefined2 *)(param_1 + 0x1c0) = 0;
  FUN_1400015e0(param_1 + 0x1c0,param_2 + 0x1c0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x200) = 7;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined2 *)(param_1 + 0x1e8) = 0;
  FUN_1400015e0(param_1 + 0x1e8,param_2 + 0x1e8,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x228) = 7;
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined2 *)(param_1 + 0x210) = 0;
  FUN_1400015e0(param_1 + 0x210,param_2 + 0x210,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x250) = 7;
  *(undefined8 *)(param_1 + 0x248) = 0;
  *(undefined2 *)(param_1 + 0x238) = 0;
  FUN_1400015e0(param_1 + 0x238,param_2 + 0x238,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x278) = 7;
  *(undefined8 *)(param_1 + 0x270) = 0;
  *(undefined2 *)(param_1 + 0x260) = 0;
  FUN_1400015e0(param_1 + 0x260,param_2 + 0x260,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x2a0) = 7;
  *(undefined8 *)(param_1 + 0x298) = 0;
  *(undefined2 *)(param_1 + 0x288) = 0;
  FUN_1400015e0(param_1 + 0x288,param_2 + 0x288,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x2c8) = 7;
  *(undefined8 *)(param_1 + 0x2c0) = 0;
  *(undefined2 *)(param_1 + 0x2b0) = 0;
  FUN_1400015e0(param_1 + 0x2b0,param_2 + 0x2b0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x2f0) = 7;
  *(undefined8 *)(param_1 + 0x2e8) = 0;
  *(undefined2 *)(param_1 + 0x2d8) = 0;
  FUN_1400015e0(param_1 + 0x2d8,param_2 + 0x2d8,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x318) = 7;
  *(undefined8 *)(param_1 + 0x310) = 0;
  *(undefined2 *)(param_1 + 0x300) = 0;
  FUN_1400015e0(param_1 + 0x300,param_2 + 0x300,0,0xffffffffffffffff);
  _eh_vector_copy_constructor_iterator_
            (param_1 + 0x328,param_2 + 0x328,0x28,4,basic_string<>,FUN_14023be90);
  _eh_vector_copy_constructor_iterator_
            (param_1 + 0x3c8,param_2 + 0x3c8,0x28,4,basic_string<>,FUN_14023be90);
  *(undefined8 *)(param_1 + 0x480) = 7;
  *(undefined8 *)(param_1 + 0x478) = 0;
  *(undefined2 *)(param_1 + 0x468) = 0;
  FUN_1400015e0(param_1 + 0x468,param_2 + 0x468,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x4a8) = 7;
  *(undefined8 *)(param_1 + 0x4a0) = 0;
  *(undefined2 *)(param_1 + 0x490) = 0;
  FUN_1400015e0(param_1 + 0x490,param_2 + 0x490,0,0xffffffffffffffff);
  _eh_vector_copy_constructor_iterator_
            (param_1 + 0x4b8,param_2 + 0x4b8,0x28,4,basic_string<>,FUN_14023be90);
  _eh_vector_copy_constructor_iterator_
            (param_1 + 0x558,param_2 + 0x558,0x28,4,basic_string<>,FUN_14023be90);
  *(undefined8 *)(param_1 + 0x610) = 7;
  *(undefined8 *)(param_1 + 0x608) = 0;
  *(undefined2 *)(param_1 + 0x5f8) = 0;
  FUN_1400015e0(param_1 + 0x5f8,param_2 + 0x5f8,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x638) = 7;
  *(undefined8 *)(param_1 + 0x630) = 0;
  *(undefined2 *)(param_1 + 0x620) = 0;
  FUN_1400015e0(param_1 + 0x620,param_2 + 0x620,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x660) = 7;
  *(undefined8 *)(param_1 + 0x658) = 0;
  *(undefined2 *)(param_1 + 0x648) = 0;
  FUN_1400015e0(param_1 + 0x648,param_2 + 0x648,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x688) = 7;
  *(undefined8 *)(param_1 + 0x680) = 0;
  *(undefined2 *)(param_1 + 0x670) = 0;
  FUN_1400015e0(param_1 + 0x670,param_2 + 0x670,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x6b0) = 7;
  *(undefined8 *)(param_1 + 0x6a8) = 0;
  *(undefined2 *)(param_1 + 0x698) = 0;
  FUN_1400015e0(param_1 + 0x698,param_2 + 0x698,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x6d8) = 7;
  *(undefined8 *)(param_1 + 0x6d0) = 0;
  *(undefined2 *)(param_1 + 0x6c0) = 0;
  FUN_1400015e0(param_1 + 0x6c0,param_2 + 0x6c0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x700) = 7;
  *(undefined8 *)(param_1 + 0x6f8) = 0;
  *(undefined2 *)(param_1 + 0x6e8) = 0;
  FUN_1400015e0(param_1 + 0x6e8,param_2 + 0x6e8,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x728) = 7;
  *(undefined8 *)(param_1 + 0x720) = 0;
  *(undefined2 *)(param_1 + 0x710) = 0;
  FUN_1400015e0(param_1 + 0x710,param_2 + 0x710,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x750) = 7;
  *(undefined8 *)(param_1 + 0x748) = 0;
  *(undefined2 *)(param_1 + 0x738) = 0;
  FUN_1400015e0(param_1 + 0x738,param_2 + 0x738,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x778) = 7;
  *(undefined8 *)(param_1 + 0x770) = 0;
  *(undefined2 *)(param_1 + 0x760) = 0;
  FUN_1400015e0(param_1 + 0x760,param_2 + 0x760,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x7a0) = 7;
  *(undefined8 *)(param_1 + 0x798) = 0;
  *(undefined2 *)(param_1 + 0x788) = 0;
  FUN_1400015e0(param_1 + 0x788,param_2 + 0x788,0,0xffffffffffffffff);
  return param_1;
}



void FUN_140167040(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x7b8);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x7c0) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x7b8) = *(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_1401671f0(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) < 0x7c8)
      goto LAB_1401672bd;
      lVar7 = uVar6 * 0x7c8;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401672bd:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0xf9 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0xf7] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0xf9;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x1ee);
  *puVar2 = param_2;
  FUN_140164b50(puVar2 + 2);
  puVar2[0x1f0] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x1ee) = *(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_1402cddb0(param_1);
    FUN_140167040(param_1,uVar4);
  }
  return puVar2;
}



void FUN_140167370(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140164ed0(param_2 + 8);
  *(undefined8 *)(param_2 + 0x7b8) = *(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_1402cddb0(param_1);
    FUN_140167040(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;
}



undefined8 *
FUN_140167410(longlong *param_1,undefined8 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined8 *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) < 0x38)
      goto LAB_1401674c7;
      lVar7 = uVar6 * 0x38;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401674c7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 7 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[5] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -7;
    }
  }
  puVar2 = (undefined8 *)param_1[8];
  if (puVar2 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = puVar2[5];
  *puVar2 = param_2;
  puVar2[1] = 0;
  puVar2[2] = 0;
  puVar2[3] = 0;
  *(undefined4 *)(puVar2 + 6) = param_4;
  param_1[1] = param_1[1] + 1;
  puVar2[5] = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined8 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_1402cddb0(param_1);
    FUN_1402da810(param_1,uVar4);
  }
  return puVar2;
}



int FUN_140167570(int param_1,int param_2,int param_3,int param_4,float param_5)

{
  int *piVar1;
  float fVar2;
  int local_res8 [2];
  int local_res10 [6];
  
  if (param_1 < param_2) {
    fVar2 = ((float)param_1 / (float)param_4) * (float)param_3 * 1.5 * (param_5 + 0.9 + 0.0001);
    if (5 < param_2 - param_1) {
      fVar2 = fVar2 * (2.0 - (float)(param_2 - param_1) / 5.0);
    }
  }
  else {
    if (9 < param_1 - param_2) {
      return 1;
    }
    fVar2 = ((float)param_1 / (float)param_4) * (float)param_3 * 1.5 * (param_5 + 0.9 + 0.0001) *
            ((float)(param_2 - param_1) * 0.125 + 1.0);
  }
  local_res10[0] = 1;
  local_res8[0] = (int)fVar2;
  piVar1 = local_res8;
  if ((int)fVar2 < 2) {
    piVar1 = local_res10;
  }
  return *piVar1;
}



int FUN_140167670(int param_1,int param_2,int param_3,int param_4,float param_5,int *param_6)

{
  int iVar1;
  float *pfVar2;
  float *pfVar3;
  float local_res8 [2];
  
  iVar1 = rand();
  param_1 = param_1 - (int)((float)iVar1 * -3.0517578e-05 * (float)(param_2 - param_1));
  pfVar2 = local_res8;
  param_5 = ((float)((int)param_5 - param_3) * 0.005 + 0.8) * (float)param_4 * 0.01;
  local_res8[0] = 0.9;
  if (param_5 <= 0.9) {
    pfVar2 = &param_5;
  }
  pfVar3 = local_res8;
  param_5 = *pfVar2;
  local_res8[0] = -125.0;
  if (-125.0 <= *pfVar2) {
    pfVar3 = &param_5;
  }
  iVar1 = (int)((float)param_1 * *pfVar3);
  *param_6 = iVar1;
  return param_1 - iVar1;
}



ulonglong FUN_140167760(ushort *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ushort uVar1;
  int iVar2;
  undefined4 extraout_var;
  undefined4 extraout_var_00;
  undefined4 extraout_var_01;
  undefined4 extraout_var_02;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  iVar5 = 0;
  uVar4 = DAT_14060b7c4;
  iVar2 = DAT_14060a120;
  if (*param_1 != 0) {
    do {
      uVar1 = *param_1;
      uVar3 = (ulonglong)uVar1;
      if ((((uVar1 < 0x30) || (0x39 < uVar1)) && ((uVar1 < 0x61 || (0x7a < uVar1)))) &&
         ((uVar1 < 0x41 || (0x5a < uVar1)))) {
        if ((uVar4 & 1) == 0) {
          DAT_14060b7c4 = uVar4 | 1;
          FUN_140418590();
          iVar2 = atexit((_func_5014 *)&LAB_140448470);
          uVar3 = CONCAT44(extraout_var,iVar2);
          uVar4 = DAT_14060b7c4;
          iVar2 = DAT_14060a120;
        }
        if ((iVar2 == 0xca) || (iVar2 == 0x66)) {
          uVar1 = *param_1;
          uVar3 = (ulonglong)uVar1;
          if (((((uVar1 < 0x2e80) || (0x2eff < uVar1)) && ((uVar1 < 0x2f00 || (0x2fdf < uVar1)))) &&
              ((uVar1 < 0x3200 || (0x32ff < uVar1)))) &&
             ((((uVar1 < 0x3300 || (0x33ff < uVar1)) && ((uVar1 < 0x3400 || (0x4db5 < uVar1)))) &&
              ((uVar1 < 0x4e00 || (0x9fff < uVar1)))))) {
            if (uVar1 < 0xf900) goto LAB_140167b4d;
joined_r0x000140167afa:
            if (0xfaff < uVar1) goto LAB_140167b4d;
          }
        }
        else {
          if ((uVar4 & 1) == 0) {
            DAT_14060b7c4 = uVar4 | 1;
            FUN_140418590();
            iVar2 = atexit((_func_5014 *)&LAB_140448470);
            uVar3 = CONCAT44(extraout_var_00,iVar2);
            uVar4 = DAT_14060b7c4;
            iVar2 = DAT_14060a120;
          }
          if ((iVar2 == 0xcc) || (iVar2 == 0x68)) {
            uVar1 = *param_1;
            uVar3 = (ulonglong)uVar1;
            if ((((uVar1 < 0x2e80) || (0x2eff < uVar1)) &&
                (((uVar1 < 0x2f00 || (0x2fdf < uVar1)) && ((uVar1 < 0x3100 || (0x312f < uVar1))))))
               && ((((uVar1 < 0x3200 || (0x32ff < uVar1)) && ((uVar1 < 0x3300 || (0x33ff < uVar1))))
                   && (((uVar1 < 0x3400 || (0x4db5 < uVar1)) &&
                       ((uVar1 < 0x4e00 || (0x9fff < uVar1)))))))) {
              if (0xf8ff < uVar1) goto joined_r0x000140167afa;
              goto LAB_140167b4d;
            }
          }
          else {
            if ((uVar4 & 1) == 0) {
              DAT_14060b7c4 = uVar4 | 1;
              FUN_140418590();
              iVar2 = atexit((_func_5014 *)&LAB_140448470);
              uVar3 = CONCAT44(extraout_var_01,iVar2);
              uVar4 = DAT_14060b7c4;
              iVar2 = DAT_14060a120;
            }
            if ((iVar2 == 0xcb) || (iVar2 == 0x67)) {
              uVar1 = *param_1;
              uVar3 = (ulonglong)uVar1;
              if (((uVar1 < 0x2e80) || (0x2eff < uVar1)) &&
                 ((((uVar1 < 0x3040 || (0x309f < uVar1)) && ((uVar1 < 0x30a0 || (0x30ff < uVar1))))
                  && (((uVar1 < 0x3400 || (0x4db5 < uVar1)) &&
                      ((uVar1 < 0x4e00 || (0x9fff < uVar1)))))))) goto LAB_140167b4d;
            }
            else {
              if ((uVar4 & 1) == 0) {
                DAT_14060b7c4 = uVar4 | 1;
                FUN_140418590();
                iVar2 = atexit((_func_5014 *)&LAB_140448470);
                uVar3 = CONCAT44(extraout_var_02,iVar2);
                uVar4 = DAT_14060b7c4;
                iVar2 = DAT_14060a120;
              }
              if ((iVar2 == 200) || (iVar2 == 100)) {
                uVar1 = *param_1;
                uVar3 = (ulonglong)uVar1;
                if ((uVar1 < 0xac00) || (0xd7a3 < uVar1)) goto LAB_140167b4d;
              }
            }
          }
        }
      }
      param_4 = 0x2f00;
      iVar5 = iVar5 + 1;
      param_1 = param_1 + 1;
    } while (*param_1 != 0);
    if (iVar5 != 0) {
      return CONCAT71((int7)(uVar3 >> 8),1);
    }
  }
  uVar3 = FUN_140001710(param_2,L"Length Zero",0xb,param_4,uVar6);
LAB_140167b4d:
  return uVar3 & 0xffffffffffffff00;
}



void FUN_140167b70(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;
}



void FUN_140167bd0(longlong *param_1)

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



void FUN_140167bf0(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;
}



void FUN_140167cd0(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_140167da0(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  char cVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong *local_38;
  undefined8 *local_30;
  undefined2 local_28;
  
  uVar3 = FUN_14015afa0(param_3);
  puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
  lVar4 = FUN_1402cb0b0(puVar6,param_3);
  if (lVar4 == 0) {
    local_30 = (undefined8 *)0x0;
    local_28 = 0;
    local_38 = param_1;
    FUN_1401680c0(&local_38);
    puVar1 = local_30;
    if (local_30 + 1 != (undefined8 *)0x0) {
      FUN_1401681a0(local_30 + 1,param_4);
    }
    local_28 = CONCAT11(1,(undefined1)local_28);
    cVar2 = FUN_1402c92f0(param_1);
    if (cVar2 != '\0') {
      puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
    }
    *puVar1 = *puVar6;
    *puVar6 = puVar1;
    param_1[4] = param_1[4] + 1;
    puVar5 = (undefined8 *)param_1[6];
    if (puVar6 < (undefined8 *)param_1[6]) {
      puVar5 = puVar6;
    }
    param_1[6] = (longlong)puVar5;
    *param_2 = (longlong)puVar6;
    param_2[1] = (longlong)puVar1;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)puVar6;
    param_2[1] = lVar4;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



longlong * FUN_140167ec0(longlong *param_1,longlong *param_2)

{
  undefined8 **ppuVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined8 **ppuVar6;
  undefined8 *local_res8;
  undefined8 *local_res10;
  longlong *local_30;
  undefined8 *local_28;
  undefined2 local_20;
  
  local_28 = (undefined8 *)0x0;
  local_20 = 0;
  local_30 = param_1;
  FUN_1401680c0(&local_30);
  puVar3 = local_28;
  puVar2 = local_28 + 1;
  local_res8 = puVar2;
  local_res10 = puVar2;
  if (puVar2 != (undefined8 *)0x0) {
    FUN_1401681a0(puVar2);
  }
  local_20 = CONCAT11(1,(undefined1)local_20);
  uVar4 = FUN_14015afa0(puVar2);
  if (*param_1 == 0) {
    local_res8 = (undefined8 *)FUN_1402c9710(param_1,1);
    ppuVar1 = (undefined8 **)(param_1 + 1);
    ppuVar6 = &local_res8;
    if (local_res8 <= *ppuVar1) {
      ppuVar6 = ppuVar1;
    }
    *ppuVar1 = *ppuVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else {
    local_res10 = (undefined8 *)0x1;
    if ((ulonglong)param_1[7] < 2) {
      local_res8 = (undefined8 *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      lVar5 = FUN_1402c9710(param_1);
      if (lVar5 != param_1[1]) {
        FUN_1402c97f0(param_1);
      }
    }
  }
  puVar2 = (undefined8 *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar3 = *puVar2;
  *puVar2 = puVar3;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)puVar2;
  *param_2 = (longlong)puVar2;
  param_2[1] = (longlong)puVar3;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



void FUN_140168010(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 0x00014016806e. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(param_1);
  return;
}



void FUN_140168080(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_140167b70(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



void FUN_1401680c0(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_140167b70(*(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_1405d3608);
}



undefined2 * FUN_1401681a0(undefined2 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  param_1[0x14] = 0;
  FUN_1400015e0(param_1 + 0x14,param_2 + 0x28,0,0xffffffffffffffff);
  return param_1;
}



void FUN_140168220(longlong param_1)

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



undefined8 * FUN_140168240(undefined8 *param_1,uint param_2)

{
  char cVar1;
  
  *param_1 = MagiFileStream::vftable;
  cVar1 = FUN_140168350();
  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_1401682b0(undefined8 *param_1)

{
  char cVar1;
  
  *param_1 = MagiFileStream::vftable;
  cVar1 = FUN_140168350();
  if (cVar1 != '\0') {
    fclose((FILE *)param_1[3]);
    param_1[3] = 0;
  }
  *param_1 = MagiStream::vftable;
  return;
}



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

{
                    // WARNING: Could not recover jumptable at 0x000140168316. Too many branches
                    // WARNING: Treating indirect jump as call
  fread(param_2,param_3,1,*(FILE **)(param_1 + 0x18));
  return;
}



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

{
                    // WARNING: Could not recover jumptable at 0x000140168336. Too many branches
                    // WARNING: Treating indirect jump as call
  fwrite(param_2,param_3,1,*(undefined8 *)(param_1 + 0x18));
  return;
}



void FUN_140168340(longlong param_1,longlong param_2,int param_3)

{
                    // WARNING: Could not recover jumptable at 0x000140168344. Too many branches
                    // WARNING: Treating indirect jump as call
  _fseeki64(*(FILE **)(param_1 + 0x18),param_2,param_3);
  return;
}



bool FUN_140168350(longlong param_1)

{
  return *(longlong *)(param_1 + 0x18) != 0;
}



void FUN_140168360(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x000140168364. Too many branches
                    // WARNING: Treating indirect jump as call
  _ftelli64(*(FILE **)(param_1 + 0x18));
  return;
}



bool FUN_140168370(longlong param_1)

{
  int iVar1;
  
  iVar1 = feof(*(FILE **)(param_1 + 0x18));
  return iVar1 != 0;
}



undefined8 FUN_140168390(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_1401683f0(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_140168450(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_140168490(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_140168500(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_140168560(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_1401685e0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x20);
}



undefined8 FUN_1401685f0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x28);
}



bool FUN_140168600(longlong param_1)

{
  return *(longlong *)(param_1 + 0x20) == *(longlong *)(param_1 + 0x28);
}



bool FUN_140168610(longlong param_1)

{
  return *(longlong *)(param_1 + 0x18) != 0;
}



void FUN_140168620(undefined8 *param_1)

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



undefined8 * FUN_140168630(undefined8 *param_1,byte param_2)

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



uint FUN_140168660(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);
}



ulonglong FUN_1401686e0(char *param_1)

{
  longlong *plVar1;
  char *pcVar2;
  ulonglong uVar3;
  
  pcVar2 = param_1;
  if (0xf < *(ulonglong *)(param_1 + 0x18)) {
    pcVar2 = *(char **)param_1;
  }
  plVar1 = (longlong *)(param_1 + 0x10);
  if (0xf < *(ulonglong *)(param_1 + 0x18)) {
    param_1 = *(char **)param_1;
  }
  uVar3 = 0;
  for (; param_1 != pcVar2 + *plVar1; param_1 = param_1 + 1) {
    uVar3 = uVar3 ^ (longlong)*param_1 + (uVar3 >> 2) + uVar3 * 0x40 + 0x9e3779b9;
  }
  return uVar3;
}



void FUN_140168740(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_14035bff0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_140005600(L"OnError MGSDBCSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar3);
  }
  return;
}



void FUN_1401687e0(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_14035bff0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_140005600(L"OnWarning MGSDBCSession : %s",puVar4);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar3);
  }
  return;
}



void FUN_140168880(undefined8 param_1,longlong *param_2)

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



undefined8 * FUN_1401688a0(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  FUN_140001f50();
  FUN_140388e70(param_1 + 9);
  *param_1 = MGSDBCSession::vftable;
  param_1[9] = MGSDBCSession::vftable;
  param_1[0xd] = param_2;
  puVar1 = param_1 + 0xe;
  FUN_140385af0(puVar1);
  *puVar1 = SERVERS2DBC_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x84) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar1 = RNP::Servers2DbcProxy::vftable;
  *(undefined1 *)(param_1 + 0x11) = 0;
  return param_1;
}



void * FUN_140168940(void *param_1,uint param_2)

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



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

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = MGSDBCSession::vftable;
  param_1[9] = MGSDBCSession::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[0xe] = RNP::Servers2DbcProxy::vftable;
  FUN_140385b20();
  param_1[9] = RNP::Dbc2ServersStub::vftable;
  FUN_140388ea0(param_1 + 9);
  *param_1 = MagiCommonSession::vftable;
  FUN_1400031d0(param_1 + 6);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_14035b3e0(param_1);
  return;
}



void FUN_140168a30(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_140607fe0 + 8);
  }
  else if (param_2 == 0x11) {
    uVar2 = *(undefined1 *)(DAT_140607fe0 + 9);
  }
  else if (param_2 == 0x12) {
    uVar2 = *(undefined1 *)(DAT_140607fe0 + 10);
  }
  else {
    if (param_2 != 0x13) goto LAB_140168a90;
    uVar2 = *(undefined1 *)(DAT_140607fe0 + 0xb);
  }
  *(undefined1 *)(param_1 + 0x18) = uVar2;
LAB_140168a90:
  plVar1 = (longlong *)FUN_1403c5e60();
  *(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 + 0x70);
  }
  return;
}



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

{
  int *piVar1;
  undefined *puVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  undefined2 local_res8;
  undefined6 uStackX_a;
  
  *(undefined1 *)(param_1 + 0x19) = 0;
  if (*param_2 == 0) {
    *(undefined2 *)(param_1 + 0x1a) = 1;
    uVar5 = DAT_140607fd8;
    if (*(longlong **)(param_1 + 0x10) != (longlong *)0x0) {
      uVar3 = (**(code **)(**(longlong **)(param_1 + 0x10) + 0x30))();
      FUN_140418da0(uVar5,L"DBC Server Connected : HostID[%d]",uVar3);
    }
    if (*(longlong *)(param_1 + 0x68) != 0) {
      local_res8 = *(undefined2 *)(DAT_140608000 + 0x140);
      (**(code **)(*(longlong *)(param_1 + 0x70) + 0x5e0))
                ((longlong *)(param_1 + 0x70),1,&DAT_1405d85a0,&local_res8);
    }
  }
  else {
    *(undefined1 *)(param_1 + 0x1b) = 1;
    puVar4 = (undefined8 *)FUN_14035bff0(param_2,&local_res8,param_3,param_4,0xfffffffffffffffe);
    FUN_140418da0(DAT_140607fd8,L"DBC Server Connect Failed %s",*puVar4);
    puVar2 = (undefined *)CONCAT62(uStackX_a,local_res8);
    if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) &&
       (puVar2 + -8 != (undefined *)0x0)) {
      uVar5 = FUN_14034fe70();
      FUN_14034ed40(uVar5);
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar2 + -8);
      }
      FUN_14034edd0(uVar5);
    }
  }
  return;
}



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

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined *local_res8;
  
  puVar2 = (undefined8 *)FUN_14035bff0(param_2,&local_res8,param_3,param_4,0xfffffffffffffffe);
  FUN_140418da0(DAT_140607fd8,L"DBC Server Disconnected %s",*puVar2);
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (local_res8 + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res8 + -8);
    }
    FUN_14034edd0(uVar3);
  }
  *(undefined2 *)(param_1 + 0x19) = 0;
  *(undefined1 *)(param_1 + 0x1b) = 1;
  return;
}



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

{
  longlong *plVar1;
  DWORD DVar2;
  DWORD DVar3;
  undefined4 local_res8 [2];
  undefined8 uVar4;
  char *pcVar5;
  
  uVar4 = 0xfffffffffffffffe;
  pcVar5 = "ERROR_NOTIFY";
  DVar2 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    local_res8[0] = *param_5;
    plVar1 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x78);
    (**(code **)(*plVar1 + 0x30))(plVar1,*param_4,&DAT_1405d85a0,local_res8,uVar4,pcVar5,DVar2);
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"ERROR_NOTIFY");
  }
  return 1;
}



undefined8 FUN_140168d40(longlong param_1,undefined8 param_2,undefined8 param_3,undefined2 *param_4)

{
  DWORD DVar1;
  DWORD DVar2;
  
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    *(undefined2 *)(*(longlong *)(param_1 + 0x20) + 700) = *param_4;
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"RESP_DBC_THREAD_COUNT");
  }
  return 1;
}



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

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  char *pcVar7;
  
  uVar6 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    pcVar7 = "DBCSession-RESP_READ_ITEM_DROPGROUP";
    DVar2 = timeGetTime();
    uVar5 = (param_4[1] - *param_4) / 0xc;
    if ((int)uVar5 != 0) {
      lVar4 = 0;
      uVar5 = uVar5 & 0xffffffff;
      DVar3 = DVar2;
      do {
        lVar1 = *param_4;
        (**(code **)(**(longlong **)(param_1 + 0x20) + 0xb8))
                  (*(longlong **)(param_1 + 0x20),*(undefined4 *)(lVar4 + lVar1),
                   *(undefined4 *)(lVar4 + 4 + lVar1),*(undefined4 *)(lVar4 + 8 + lVar1),uVar6,
                   pcVar7,DVar3);
        lVar4 = lVar4 + 0xc;
        uVar5 = uVar5 - 1;
      } while (uVar5 != 0);
    }
    DVar3 = timeGetTime();
    if (0x32 < DVar3 - DVar2) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,
                    "DBCSession-RESP_READ_ITEM_DROPGROUP");
    }
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "DBCSession-RESP_READ_GUILD_INFO";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xc0))
              (*(longlong **)(param_1 + 0x20),*param_4,param_5);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_READ_GUILD_INFO",
                  uVar3,pcVar4,DVar5);
  }
  return 1;
}



undefined8
FUN_140168f40(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined1 *param_5,undefined8 param_6,undefined8 param_7)

{
  DWORD DVar1;
  DWORD DVar2;
  
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),param_4,*param_5,param_6,param_7);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_READ_GUILD_MEMBER"
                 );
  }
  return 1;
}



undefined8
FUN_140169000(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_OTHER_CHARACTER_INFO";
  DVar2 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (DVar3 = DVar2, lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    lVar8 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x3c0);
      (**(code **)(*plVar5 + 0x520))
                (plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0,param_5,uVar6,pcVar7,DVar3,lVar8,1
                );
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,
                  "DBCSession-RESP_OTHER_CHARACTER_INFO");
  }
  return 1;
}



undefined8
FUN_140169100(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_OTHER_CHARACTER_EQUIP_ITEM";
  DVar2 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (DVar3 = DVar2, lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    lVar8 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x3c0);
      (**(code **)(*plVar5 + 0x530))
                (plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0,param_5,uVar6,pcVar7,DVar3,lVar8,1
                );
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,
                  "DBCSession-RESP_OTHER_CHARACTER_EQUIP_ITEM");
  }
  return 1;
}



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

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_GUILD";
  DVar2 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    uVar5 = (param_4[1] - *param_4) / 0x14;
    if ((int)uVar5 != 0) {
      lVar4 = 0;
      uVar5 = uVar5 & 0xffffffff;
      lVar6 = lVar4;
      DVar3 = DVar2;
      do {
        lVar1 = **(longlong **)(param_1 + 0x20);
        (**(code **)(lVar1 + 0xa0))
                  (*(longlong **)(param_1 + 0x20),lVar6 + *param_4,
                   *(undefined4 *)(lVar4 + 0x10 + *param_4),lVar1,uVar7,pcVar8,DVar3);
        lVar6 = lVar6 + 0x14;
        lVar4 = lVar4 + 0x14;
        uVar5 = uVar5 - 1;
      } while (uVar5 != 0);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"DBCSession-RESP_READ_GUILD");
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  undefined *puVar3;
  undefined8 uVar4;
  char *pcVar5;
  
  uVar4 = 0xfffffffffffffffe;
  pcVar5 = "DBCSession-RESP_GUILD_CREATE";
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    puVar3 = (undefined *)*param_9;
    if ((undefined *)*param_9 == (undefined *)0x0) {
      puVar3 = PTR_DAT_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xd0))
              (*(longlong **)(param_1 + 0x20),*param_4,*param_5,*param_6,*param_7,*param_8,param_10,
               puVar3,uVar4,pcVar5,DVar1);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_GUILD_CREATE");
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "DBCSession-RESP_GUILD_TOTAL_CNT";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x90))(*(longlong **)(param_1 + 0x20),*param_4);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_GUILD_TOTAL_CNT",
                  uVar3,pcVar4,DVar5);
  }
  return 1;
}



undefined8 FUN_140169480(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_GUILD_LOAD_INFO";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x98))(*(longlong **)(param_1 + 0x20),param_4);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"RESP_GUILD_LOAD_INFO",uVar3,pcVar4
                  ,DVar5);
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xb0))
              (*(longlong **)(param_1 + 0x20),*param_4,param_5,param_6,*param_7,*param_8,*param_9);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"RESP_INVEN_SLOT");
  }
  return 1;
}



undefined1
FUN_140169600(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong *plVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong *plVar5;
  
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (plVar5 = (longlong *)FUN_14016e240(), plVar5 != (longlong *)0x0)) {
    plVar1 = plVar5 + 0xd0;
    FUN_14034ed40(plVar1);
    if ((char)plVar5[0xd7] != '\0') {
      uVar2 = (**(code **)(*plVar5 + 0x40))(plVar5,param_2,param_3,param_4,param_5);
      FUN_14034edd0(plVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_CHARACTER_GET_LIST");
      return uVar2;
    }
    FUN_14034edd0(plVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                  "DBCSession-RESP_CHARACTER_GET_LIST");
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  longlong *plVar3;
  undefined8 uVar4;
  char *pcVar5;
  
  uVar4 = 0xfffffffffffffffe;
  pcVar5 = "DBCSession-RESP_CHARACTER_GET_SIMPLE";
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x78);
    (**(code **)(*plVar3 + 0x930))
              (plVar3,*param_4,&DAT_1405d85a0,param_5,param_6,param_7,uVar4,pcVar5,DVar1);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,
                  "DBCSession-RESP_CHARACTER_GET_SIMPLE");
  }
  return 1;
}



undefined1
FUN_140169800(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6,undefined8 param_7)

{
  longlong *plVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong *plVar5;
  
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (plVar5 = (longlong *)FUN_14016e240(), plVar5 != (longlong *)0x0)) {
    plVar1 = plVar5 + 0xd0;
    FUN_14034ed40(plVar1);
    if ((char)plVar5[0xd7] != '\0') {
      uVar2 = (**(code **)(*plVar5 + 0x48))(plVar5,param_2,param_3,param_4,param_5,param_6,param_7);
      FUN_14034edd0(plVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_CHARACTER_CREATE");
      return uVar2;
    }
    FUN_14034edd0(plVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_CHARACTER_CREATE")
    ;
  }
  return 1;
}



undefined1
FUN_140169960(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong *plVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong *plVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_CHARACTER_CREATE_STEP01";
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (DVar4 = DVar3, plVar5 = (longlong *)FUN_14016e240(), plVar5 != (longlong *)0x0)) {
    plVar1 = plVar5 + 0xd0;
    plVar8 = plVar1;
    FUN_14034ed40(plVar1);
    if ((char)plVar5[0xd7] != '\0') {
      uVar2 = (**(code **)(*plVar5 + 0x50))
                        (plVar5,param_2,param_3,param_4,param_5,param_6,uVar6,pcVar7,DVar4,plVar8,1)
      ;
      FUN_14034edd0(plVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_CHARACTER_CREATE_STEP01");
      return uVar2;
    }
    FUN_14034edd0(plVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                  "DBCSession-RESP_CHARACTER_CREATE_STEP01");
  }
  return 1;
}



undefined1
FUN_140169ab0(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong *plVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong *plVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_CHARACTER_DELETE";
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (DVar4 = DVar3, plVar5 = (longlong *)FUN_14016e240(), plVar5 != (longlong *)0x0)) {
    plVar1 = plVar5 + 0xd0;
    plVar8 = plVar1;
    FUN_14034ed40(plVar1);
    if ((char)plVar5[0xd7] != '\0') {
      uVar2 = (**(code **)(*plVar5 + 0x58))
                        (plVar5,param_2,param_3,param_4,param_5,param_6,uVar6,pcVar7,DVar4,plVar8,1)
      ;
      FUN_14034edd0(plVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_CHARACTER_DELETE");
      return uVar2;
    }
    FUN_14034edd0(plVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_CHARACTER_DELETE")
    ;
  }
  return 1;
}



undefined1
FUN_140169c00(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong *plVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong *plVar5;
  longlong lVar6;
  
  if (*(longlong *)(param_1 + 0x20) == 0) {
    FUN_140005370(0xc,
                  L"ERR >> DEFRMI_DBC2SERVERS_PROTOCOL_RESP_CHARACTER_GET(MGSDBCSession) - m_pOwner is NULL!!!"
                 );
    uVar2 = 0;
  }
  else {
    lVar6 = *(longlong *)(param_1 + 0x20) + 0x40;
    FUN_14034ed40(lVar6);
    DVar3 = timeGetTime();
    if (*param_4 == 0) {
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_CHARACTER_GET"
                     );
      }
    }
    else if ((*(longlong *)(param_1 + 0x20) == 0) ||
            (plVar5 = (longlong *)FUN_14016e240(), plVar5 == (longlong *)0x0)) {
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_CHARACTER_GET"
                     );
      }
    }
    else {
      plVar1 = plVar5 + 0xd0;
      FUN_14034ed40(plVar1);
      if ((char)plVar5[0xd7] != '\0') {
        uVar2 = (**(code **)(*plVar5 + 0x60))(plVar5,param_2,param_3,param_4,param_5);
        FUN_14034edd0(plVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar3) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                        "DBCSession-RESP_CHARACTER_GET");
        }
        FUN_14034edd0(lVar6);
        return uVar2;
      }
      FUN_14034edd0(plVar1);
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_CHARACTER_GET"
                     );
      }
    }
    FUN_14034edd0(lVar6);
    uVar2 = 1;
  }
  return uVar2;
}



undefined8
FUN_140169de0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,int *param_5)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  DWORD DVar7;
  
  uVar5 = 0xfffffffffffffffe;
  pcVar6 = "DBCSession-RESP_READ_MONEY";
  DVar2 = timeGetTime();
  DVar7 = DVar2;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (0 < *param_5) {
        FUN_140197b90(lVar4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"DBCSession-RESP_READ_MONEY",uVar5,
                  pcVar6,DVar7);
  }
  return 1;
}



undefined1
FUN_140169ed0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_SELECT_DUEL_INFO";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d60f0(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_SELECT_DUEL_INFO");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_SELECT_DUEL_INFO",
                  uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined8
FUN_140169ff0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,
             undefined2 *param_5,undefined8 param_6)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined2 local_res20 [4];
  
  DVar2 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_res20[0] = *param_5;
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x380);
      (**(code **)(*plVar5 + 0x450))
                (plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0,local_res20,param_6);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,
                  "DBCSession-RESP_SELECT_BATTLE_RANK_LIST");
  }
  return 1;
}



undefined1
FUN_14016a120(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_ITEM";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d63a0(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_ITEM");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_ITEM",uVar7,pcVar8
                  ,DVar4);
  }
  return 1;
}



undefined1
FUN_14016a240(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_ITEM_LIGHT";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d67f0(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_ITEM_LIGHT");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_ITEM_LIGHT",uVar7,
                  pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016a360(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_SKILL";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d6b00(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_SKILL");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_SKILL",uVar7,
                  pcVar8,DVar4);
  }
  return 1;
}



undefined1 FUN_14016a480(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_SKILL_RESET";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d6d10(lVar6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_SKILL_RESET");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_SKILL_RESET",uVar7
                  ,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016a590(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_QUICKSLOT";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d78b0(lVar6,param_5,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_READ_QUICKSLOT")
      ;
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_READ_QUICKSLOT",
                  uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016a6b0(longlong param_1,undefined4 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong *plVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong *plVar5;
  
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (plVar5 = (longlong *)FUN_14016e240(), plVar5 != (longlong *)0x0)) {
    plVar1 = plVar5 + 0xd0;
    FUN_14034ed40(plVar1);
    if ((char)plVar5[0xd7] != '\0') {
      uVar2 = (**(code **)(*plVar5 + 0x68))(plVar5,param_2,param_3,param_4,param_5);
      FUN_14034edd0(plVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_GET_KEY_MAP");
      return uVar2;
    }
    FUN_14034edd0(plVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_GET_KEY_MAP");
  }
  return 1;
}



undefined1
FUN_14016a7f0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_QUEST";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d7a00(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_QUEST");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_QUEST",uVar7,
                  pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016a910(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_QUEST_FINISH";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d7b50(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_QUEST_FINISH");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_QUEST_FINISH",
                  uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016aa30(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_FRIEND";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d7ca0(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_FRIEND");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_FRIEND",uVar7,
                  pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016ab50(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_MAIL";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d82b0(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_MAIL");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_MAIL",uVar7,pcVar8
                  ,DVar4);
  }
  return 1;
}



undefined1
FUN_14016ac70(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_MAIL_ITEM";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d83f0(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_MAIL_ITEM");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_MAIL_ITEM",uVar7,
                  pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016ad90(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_DUNGEON_RANK";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d8530(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_READ_DUNGEON_RANK");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_READ_DUNGEON_RANK"
                  ,uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016aeb0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_TITLE";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d8780(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_TITLE");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_TITLE",uVar7,
                  pcVar8,DVar4);
  }
  return 1;
}



undefined8
FUN_14016afd0(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 = "DBCSession-RESP_IS_PUSH_QUEUE";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    FUN_14016e2f0(*(longlong *)(param_1 + 0x20),param_4,param_5);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_IS_PUSH_QUEUE",
                  uVar3,pcVar4,DVar5);
  }
  return 1;
}



undefined8
FUN_14016b060(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  
  DVar2 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x3c0);
      (**(code **)(*plVar5 + 0x500))
                (plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0,param_5,param_6);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"DBCSession-RESP_ITEM_EQUIP_SIMPLE"
                 );
  }
  return 1;
}



undefined8 FUN_14016b170(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  DWORD DVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_ITEM_EQUIP_SIMPLE_END";
  DVar2 = timeGetTime();
  DVar8 = DVar2;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x3c0);
      (**(code **)(*plVar5 + 0x510))(plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,
                  "DBCSession-RESP_ITEM_EQUIP_SIMPLE_END",uVar6,pcVar7,DVar8);
  }
  return 1;
}



undefined8 FUN_14016b270(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 = "DBCSession-RESP_READ_AUCTIONLIST";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xd8))(*(longlong **)(param_1 + 0x20),param_4);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_READ_AUCTIONLIST",
                  uVar3,pcVar4,DVar5);
  }
  return 1;
}



undefined1
FUN_14016b310(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_PETLIST";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d8a10(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_READ_PETLIST");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_READ_PETLIST",
                  uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined8
FUN_14016b430(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 = "DBCSession-RESP_GLUILD_INCREASE_EXP_LOG";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xe0))
              (*(longlong **)(param_1 + 0x20),param_4,param_5);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,
                  "DBCSession-RESP_GLUILD_INCREASE_EXP_LOG",uVar3,pcVar4,DVar5);
  }
  return 1;
}



undefined8
FUN_14016b4d0(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 = "DBCSession-RESP_GUILD_SKILL_LIST";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xe8))
              (*(longlong **)(param_1 + 0x20),param_4,param_5);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_GUILD_SKILL_LIST",
                  uVar3,pcVar4,DVar5);
  }
  return 1;
}



undefined8
FUN_14016b570(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined1 *param_7,undefined4 *param_8)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "DBCSession-RESP_GUILD_SKILL_LEARN";
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xf0))
              (*(longlong **)(param_1 + 0x20),param_4,param_5,*param_6,*param_7,*param_8,uVar3,
               pcVar4,DVar1);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_GUILD_SKILL_LEARN"
                 );
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "DBCSession-RESP_INSERT_GUILD_MEMBER";
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0xf8))
              (*(longlong **)(param_1 + 0x20),param_4,param_5,param_6,param_7,*param_8,uVar3,pcVar4,
               DVar1);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,
                  "DBCSession-RESP_INSERT_GUILD_MEMBER");
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "DBCSession-RESP_GUILD_MEMBER_REMOVE";
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x100))
              (*(longlong **)(param_1 + 0x20),param_4,param_5,*param_6,uVar3,pcVar4,DVar1);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,
                  "DBCSession-RESP_GUILD_MEMBER_REMOVE");
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "DBCSession-RESP_GUILD_DISBAND";
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x108))
              (*(longlong **)(param_1 + 0x20),param_4,param_5,*param_6,uVar3,pcVar4,DVar1);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_GUILD_DISBAND");
  }
  return 1;
}



undefined8
FUN_14016b840(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 *param_6,undefined4 *param_7,undefined1 *param_8)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "DBCSession-RESP_GUILD_STORAGE_INFO";
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x110))
              (*(longlong **)(param_1 + 0x20),param_4,*param_5,*param_6,*param_7,*param_8,uVar3,
               pcVar4,DVar1);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,
                  "DBCSession-RESP_GUILD_STORAGE_INFO");
  }
  return 1;
}



undefined8
FUN_14016b910(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 = "DBCSession-RESP_GUILD_USE_LOG";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x118))
              (*(longlong **)(param_1 + 0x20),param_4,param_5);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_GUILD_USE_LOG",
                  uVar3,pcVar4,DVar5);
  }
  return 1;
}



undefined8
FUN_14016b9b0(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 = "DBCSession-RESP_GUILD_STORAGE_ITEM_LIST";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x120))
              (*(longlong **)(param_1 + 0x20),param_4,param_5);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,
                  "DBCSession-RESP_GUILD_STORAGE_ITEM_LIST",uVar3,pcVar4,DVar5);
  }
  return 1;
}



undefined1
FUN_14016ba50(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_CASH_EFFECTINFO";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d8b20(lVar6,param_5,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_READ_CASH_EFFECTINFO");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,
                  "DBCSession-RESP_READ_CASH_EFFECTINFO",uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016bb70(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_ADD_FRIEND";
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (DVar4 = DVar3, lVar5 = FUN_14016e240(), lVar5 != 0)) {
    lVar1 = lVar5 + 0x680;
    lVar8 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar5 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d8cd0(lVar5,param_5,param_6,param_7,param_8,param_9,uVar6,pcVar7,DVar4,lVar8,1
                           );
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_ADD_FRIEND");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_ADD_FRIEND");
  }
  return 1;
}



undefined1
FUN_14016bcc0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9,
             undefined8 param_10)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar5 = FUN_14016e240(), lVar5 != 0)) {
    lVar1 = lVar5 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar5 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d9040(lVar5,param_5,param_6,param_7,param_8,param_9,param_10);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_ADD_BAN");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_ADD_BAN");
  }
  return 1;
}



undefined8 FUN_14016be10(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  DWORD DVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_NEW_MAIL_EXIST";
  DVar2 = timeGetTime();
  DVar8 = DVar2;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x78);
      (**(code **)(*plVar5 + 0x940))(plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"DBCSession-RESP_NEW_MAIL_EXIST",
                  uVar6,pcVar7,DVar8);
  }
  return 1;
}



undefined1
FUN_14016bf00(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_REARING_INFO";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d9100(lVar6,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_READ_REARING_INFO");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_READ_REARING_INFO"
                  ,uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016c020(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_CASH_PRODUCT_LIST";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d9220(lVar6,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_READ_CASH_PRODUCT_LIST");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,
                  "DBCSession-RESP_READ_CASH_PRODUCT_LIST",uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016c140(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,longlong *param_5,
             undefined1 *param_6,undefined4 *param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined *puVar6;
  
  DVar3 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    if (DAT_140607cb8 == 1) {
      if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
         (lVar5 = FUN_14016e240(), lVar5 != 0)) {
        lVar1 = lVar5 + 0x680;
        FUN_14034ed40(lVar1);
        if (*(char *)(lVar5 + 0x6b8) != '\0') {
          uVar2 = FUN_1401d9300(lVar5,param_5,param_6);
          FUN_14034edd0(lVar1);
          DVar4 = timeGetTime();
          if (DVar4 - DVar3 < 0x33) {
            return uVar2;
          }
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                        "DBCSession-RESP_INSERT_CASH_PRODUCT");
          return uVar2;
        }
        FUN_14034edd0(lVar1);
      }
    }
    else {
      puVar6 = (undefined *)*param_5;
      if ((undefined *)*param_5 == (undefined *)0x0) {
        puVar6 = PTR_DAT_1405d8010;
      }
      (**(code **)(**(longlong **)(param_1 + 0x20) + 0x128))
                (*(longlong **)(param_1 + 0x20),*param_4,puVar6,*param_6,*param_7);
    }
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                  "DBCSession-RESP_INSERT_CASH_PRODUCT");
  }
  return 1;
}



undefined1
FUN_14016c2c0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_PET_INVENTORY_ITEM";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d9420(lVar6,param_5,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_READ_PET_INVENTORY_ITEM");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,
                  "DBCSession-RESP_READ_PET_INVENTORY_ITEM",uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016c3e0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_FORTUNE";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d9510(lVar6,param_5,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_READ_FORTUNE");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_READ_FORTUNE",
                  uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined8
FUN_14016c500(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  
  DVar2 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x78);
      (**(code **)(*plVar5 + 0xac0))
                (plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0,param_5,param_6);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,
                  "DBCSession-RESP_READ_INQUIRY_CHARACTER");
  }
  return 1;
}



undefined8 FUN_14016c610(void)

{
  DWORD DVar1;
  DWORD DVar2;
  
  DVar1 = timeGetTime();
  wprintf(L"DBC RESP_CONNECTION_TEST : [ %s ] [ %d ]\n");
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_CONNECTION_TEST");
  }
  return 1;
}



undefined1
FUN_14016c680(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             )

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_BUFF";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d9bc0(lVar6,param_5);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_READ_BUFF");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,"DBCSession-RESP_READ_BUFF",uVar7,
                  pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016c7a0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_UPDATE_CHARACTER_NAME";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401dad50(lVar6,param_5,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_UPDATE_CHARACTER_NAME");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,
                  "DBCSession-RESP_UPDATE_CHARACTER_NAME",uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined8 FUN_14016c8c0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  DWORD DVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_READ_CHATACTER_ALL_DATA";
  DVar2 = timeGetTime();
  DVar8 = DVar2;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar4 = FUN_14016e240(), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      *(undefined4 *)(lVar4 + 0x2a0) = 1;
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x78);
      (**(code **)(*plVar5 + 0xc50))(plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,
                  "DBCSession-RESP_READ_CHATACTER_ALL_DATA",uVar6,pcVar7,DVar8);
  }
  return 1;
}



undefined1
FUN_14016c9c0(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-RESP_REWARD_COUPON";
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (DVar4 = DVar3, lVar5 = FUN_14016e240(), lVar5 != 0)) {
    lVar1 = lVar5 + 0x680;
    lVar8 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar5 + 0x6b8) != '\0') {
      uVar2 = FUN_1401db2f0(lVar5,param_7,param_8,param_9,uVar6,pcVar7,DVar4,lVar8,1);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_REWARD_COUPON");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"DBCSession-RESP_REWARD_COUPON");
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  undefined *puVar3;
  undefined8 uVar4;
  char *pcVar5;
  
  uVar4 = 0xfffffffffffffffe;
  pcVar5 = "DBCSession-RESP_PC_ROOM_POINT";
  DVar1 = timeGetTime();
  if (*(longlong *)(param_1 + 0x20) != 0) {
    puVar3 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar3 = PTR_DAT_1405d8010;
    }
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x130))
              (*(longlong **)(param_1 + 0x20),param_4,puVar3,*param_6,uVar4,pcVar5,DVar1);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_PC_ROOM_POINT");
  }
  return 1;
}



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

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  char *pcVar5;
  DWORD DVar6;
  undefined1 local_30 [40];
  
  uVar4 = 0xfffffffffffffffe;
  pcVar5 = "DBCSession-RESP_READ_PVP_RANK";
  DVar1 = timeGetTime();
  DVar6 = DVar1;
  if (*(longlong *)(param_1 + 0x20) != 0) {
    uVar3 = FUN_14016d9f0(local_30,param_5);
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x138))
              (*(longlong **)(param_1 + 0x20),*param_4,uVar3);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"DBCSession-RESP_READ_PVP_RANK",
                  uVar4,pcVar5,DVar6);
  }
  return 1;
}



undefined1
FUN_14016cc50(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_EXTERN_CASH_BALANCE";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401ddff0(lVar6,param_5,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_EXTERN_CASH_BALANCE");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,
                  "DBCSession-RESP_EXTERN_CASH_BALANCE",uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016cd70(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  DWORD DVar5;
  longlong lVar6;
  undefined8 uVar7;
  char *pcVar8;
  
  uVar7 = 0xfffffffffffffffe;
  pcVar8 = "DBCSession-RESP_READ_ACCOUNT_STORAGE_ITEM";
  DVar3 = timeGetTime();
  DVar4 = DVar3;
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (lVar6 = FUN_14016e240(), lVar6 != 0)) {
    lVar1 = lVar6 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar6 + 0x6b8) != '\0') {
      uVar2 = FUN_1401de080(lVar6,param_5,param_6);
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-RESP_READ_ACCOUNT_STORAGE_ITEM");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar5 = timeGetTime();
  if (0x32 < DVar5 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar5 - DVar3,
                  "DBCSession-RESP_READ_ACCOUNT_STORAGE_ITEM",uVar7,pcVar8,DVar4);
  }
  return 1;
}



undefined1
FUN_14016ce90(longlong param_1,undefined8 param_2,undefined8 param_3,int *param_4,undefined8 param_5
             ,undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "DBCSession-Rmi_RESP_READ_UNI_ACCOUNT_INFO";
  DVar3 = timeGetTime();
  if (((*param_4 != 0) && (*(longlong *)(param_1 + 0x20) != 0)) &&
     (DVar4 = DVar3, lVar5 = FUN_14016e240(), lVar5 != 0)) {
    lVar1 = lVar5 + 0x680;
    lVar8 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar5 + 0x6b8) != '\0') {
      uVar2 = FUN_1401de1e0(lVar5,param_5,param_6,param_7,param_8,param_9,uVar6,pcVar7,DVar4,lVar8,1
                           );
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (DVar4 - DVar3 < 0x33) {
        return uVar2;
      }
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                    "DBCSession-Rmi_RESP_READ_UNI_ACCOUNT_INFO");
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  DVar4 = timeGetTime();
  if (0x32 < DVar4 - DVar3) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                  "DBCSession-Rmi_RESP_READ_UNI_ACCOUNT_INFO");
  }
  return 1;
}



void FUN_14016cfe0(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_140607c2c = param_2;
  DAT_140607cb0 = operator_new(_Var4);
  if (0 < (int)param_2) {
    memset(DAT_140607cb0,0,(longlong)(int)param_2 << 2);
    if (0 < (int)param_2) {
      uVar6 = (ulonglong)param_2;
      do {
        local_res20 = operator_new(0x90);
        if (local_res20 == (void *)0x0) {
          pvVar5 = (void *)0x0;
        }
        else {
          pvVar5 = (void *)FUN_1401688a0(local_res20,*param_1);
        }
        local_res20 = pvVar5;
        if (pvVar5 != (void *)0x0) {
          FUN_140168a30(pvVar5,param_3);
          ppvVar1 = (void **)param_1[2];
          if (&local_res20 < ppvVar1) {
            ppvVar2 = (void **)param_1[1];
            if (&local_res20 < ppvVar2) goto LAB_14016d0dd;
            if (ppvVar1 == (void **)param_1[3]) {
              FUN_140195b20(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_14016d0dd:
            if (ppvVar1 == (void **)param_1[3]) {
              FUN_140195b20(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_14016d120(longlong param_1)

{
  undefined8 *puVar1;
  void *_Dst;
  int iVar2;
  int iVar3;
  longlong lVar4;
  
  iVar3 = 0;
  if (0 < DAT_140607c2c) {
    lVar4 = 0;
    iVar2 = DAT_140607c2c;
    do {
      puVar1 = *(undefined8 **)(lVar4 + *(longlong *)(param_1 + 8));
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
        iVar2 = DAT_140607c2c;
      }
      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;
}



void FUN_14016d1b0(longlong param_1,double param_2)

{
  longlong lVar1;
  undefined *puVar2;
  longlong *plVar3;
  uint uVar4;
  ulonglong uVar6;
  double dVar7;
  undefined2 local_40;
  undefined6 uStack_3e;
  undefined8 local_30;
  ulonglong local_28;
  ulonglong uVar5;
  
  uVar5 = 0;
  uVar6 = uVar5;
  if (0 < DAT_140607c2c) {
    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_1405d8010)) &&
           (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_28 = 7;
              local_30 = 0;
              local_40 = 0;
              FUN_140002870(lVar1,&local_40);
              wprintf(L"%s : RETRY CONNECT : ADDRESS[ %s ] PORT[ %d ]\n");
              FUN_1400020c0(lVar1);
              if (7 < local_28) {
                operator_delete((void *)CONCAT62(uStack_3e,local_40));
              }
            }
          }
        }
      }
      uVar4 = (int)uVar5 + 1;
      uVar5 = (ulonglong)uVar4;
      uVar6 = uVar6 + 8;
    } while ((int)uVar4 < DAT_140607c2c);
  }
  return;
}



void FUN_14016d360(longlong param_1)

{
  int *piVar1;
  char cVar2;
  longlong lVar3;
  undefined *puVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined *puVar7;
  longlong lVar8;
  int iVar9;
  undefined *local_88;
  undefined2 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined1 local_68 [48];
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  iVar9 = 0;
  if (0 < DAT_140607c2c) {
    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_1405d8010)) &&
            (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_14035b3f0(&local_88);
          local_7c = DAT_140607db8;
          local_78 = DAT_140607dbc;
          local_74 = DAT_140607dc0;
          local_70 = DAT_140607dc4;
          if (local_88 == (undefined *)0x0) {
            local_88 = PTR_DAT_1405d8010;
          }
          if (*(undefined **)(lVar3 + 0x30) != local_88) {
            uVar5 = FUN_14034fe70();
            FUN_14034ed40(uVar5);
            puVar4 = local_88;
            if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1405d8010)) &&
               (puVar7 = local_88 + -8, puVar7 != (undefined *)0x0)) {
              uVar6 = FUN_14034fe70();
              FUN_14034ed40(uVar6);
              piVar1 = (int *)(puVar4 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(puVar7);
              }
              FUN_14034edd0(uVar6);
            }
            local_88 = *(undefined **)(lVar3 + 0x30);
            if (((local_88 != PTR_DAT_1405d8010) && (local_88 != (undefined *)0x0)) &&
               (local_88 != (undefined *)0x8)) {
              *(int *)(local_88 + -4) = *(int *)(local_88 + -4) + 1;
            }
            FUN_14034edd0(uVar5);
          }
          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_1403555d0(local_68);
          puVar4 = local_88;
          if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1405d8010)) &&
             (puVar7 = local_88 + -8, puVar7 != (undefined *)0x0)) {
            uVar5 = FUN_14034fe70();
            FUN_14034ed40(uVar5);
            piVar1 = (int *)(puVar4 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar7);
            }
            FUN_14034edd0(uVar5);
          }
        }
      }
      iVar9 = iVar9 + 1;
      lVar8 = lVar8 + 8;
    } while (iVar9 < DAT_140607c2c);
  }
  return;
}



undefined8 FUN_14016d5c0(longlong param_1)

{
  int *piVar1;
  longlong lVar2;
  undefined *puVar3;
  char cVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  wchar_t *pwVar7;
  undefined *puVar8;
  int iVar9;
  longlong lVar10;
  undefined *local_88;
  undefined2 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined1 local_68 [48];
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  iVar9 = 0;
  if (0 < DAT_140607c2c) {
    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_14016d7eb:
          FUN_140005370(4,pwVar7);
        }
        else {
          puVar3 = *(undefined **)(lVar2 + 0x30);
          if (((puVar3 == (undefined *)0x0) || (puVar3 == PTR_DAT_1405d8010)) ||
             (*(int *)(puVar3 + -8) < 1)) {
            pwVar7 = L"ERROR >> MagiCommonSession::Connect2 | m_Address is empty!";
            goto LAB_14016d7eb;
          }
          if (*(char *)(lVar2 + 0x18) == '\0') {
            pwVar7 = L"ERROR >> MagiCommonSession::Connect2 | IsUse is false!";
            goto LAB_14016d7eb;
          }
          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_14016d809;
          }
          FUN_14035b3f0(&local_88);
          local_7c = DAT_140607db8;
          local_78 = DAT_140607dbc;
          local_74 = DAT_140607dc0;
          local_70 = DAT_140607dc4;
          if (local_88 == (undefined *)0x0) {
            local_88 = PTR_DAT_1405d8010;
          }
          if (*(undefined **)(lVar2 + 0x30) != local_88) {
            uVar5 = FUN_14034fe70();
            FUN_14034ed40(uVar5);
            puVar3 = local_88;
            if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1405d8010)) &&
               (puVar8 = local_88 + -8, puVar8 != (undefined *)0x0)) {
              uVar6 = FUN_14034fe70();
              FUN_14034ed40(uVar6);
              piVar1 = (int *)(puVar3 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(puVar8);
              }
              FUN_14034edd0(uVar6);
            }
            local_88 = *(undefined **)(lVar2 + 0x30);
            if (((local_88 != PTR_DAT_1405d8010) && (local_88 != (undefined *)0x0)) &&
               (local_88 != (undefined *)0x8)) {
              *(int *)(local_88 + -4) = *(int *)(local_88 + -4) + 1;
            }
            FUN_14034edd0(uVar5);
          }
          local_80 = *(undefined2 *)(lVar2 + 0x38);
          cVar4 = FUN_140002320(lVar2);
          FUN_1403555d0(local_68);
          puVar3 = local_88;
          if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1405d8010)) &&
             (puVar8 = local_88 + -8, puVar8 != (undefined *)0x0)) {
            uVar5 = FUN_14034fe70();
            FUN_14034ed40(uVar5);
            piVar1 = (int *)(puVar3 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar8);
            }
            FUN_14034edd0(uVar5);
          }
          if (cVar4 != '\0') goto LAB_14016d809;
        }
        FUN_140005370(0xc,L"ERROR >> DBC CONNECTION FAILED - [%d]",iVar9);
      }
LAB_14016d809:
      iVar9 = iVar9 + 1;
      lVar10 = lVar10 + 8;
    } while (iVar9 < DAT_140607c2c);
  }
  return 1;
}



void FUN_14016d840(longlong param_1,undefined4 *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  int iVar4;
  undefined *puVar5;
  int iVar6;
  longlong *plVar7;
  undefined4 *puVar8;
  undefined *local_res8;
  
  plVar1 = *(longlong **)(param_1 + 0x10);
  plVar7 = *(longlong **)(param_1 + 8);
  do {
    if (plVar7 == plVar1) {
      return;
    }
    lVar2 = *plVar7;
    if (*(ulonglong *)(param_2 + 0x12) < 8) {
      puVar8 = param_2 + 0xc;
    }
    else {
      puVar8 = *(undefined4 **)(param_2 + 0xc);
    }
    FUN_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    iVar3 = FUN_14034fcf0(puVar8);
    iVar6 = 0;
    if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
      iVar6 = *(int *)(local_res8 + -8);
    }
    iVar4 = iVar3;
    if (((iVar3 <= iVar6) && (iVar4 = 0, local_res8 != (undefined *)0x0)) &&
       (local_res8 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(local_res8 + -8);
    }
    iVar6 = 1;
    if (1 < iVar4) {
      iVar6 = iVar4;
    }
    iVar4 = 0;
    if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(local_res8 + -8);
    }
    if (iVar4 < iVar6) {
      FUN_140002d30(&local_res8);
    }
    FUN_140002e10(&local_res8);
    puVar5 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar5,puVar8,iVar3);
    puVar5 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8010;
    }
    iVar3 = FUN_14034fcf0(puVar5);
    iVar6 = 0;
    if (0 < iVar3) {
      iVar6 = iVar3;
    }
    iVar3 = 0;
    if ((local_res8 != (undefined *)0x0) && (iVar3 = 0, local_res8 != PTR_DAT_1405d8010)) {
      iVar3 = *(int *)(local_res8 + -8);
    }
    if ((iVar6 < iVar3) || (iVar6 = 0, local_res8 == (undefined *)0x0)) {
LAB_14016d97b:
      if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
         ((int *)(local_res8 + -8) != (int *)0x0)) {
        *(int *)(local_res8 + -8) = iVar6;
        *(undefined2 *)(local_res8 + (longlong)iVar6 * 2) = 0;
      }
    }
    else if (local_res8 != PTR_DAT_1405d8010) {
      iVar6 = *(int *)(local_res8 + -8);
      goto LAB_14016d97b;
    }
    FUN_140003100(lVar2 + 0x30,&local_res8);
    FUN_1400031d0(&local_res8);
    *(undefined2 *)(lVar2 + 0x38) = *(undefined2 *)(param_2 + 1);
    *(undefined4 *)(lVar2 + 0x3c) = *param_2;
    plVar7 = plVar7 + 1;
  } while( true );
}



longlong * FUN_14016d9f0(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) / 0x41;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  if (uVar2 != 0) {
    if (0x3f03f03f03f03f0 < uVar2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      plVar3 = (longlong *)(*pcVar1)();
      return plVar3;
    }
    lVar4 = FUN_1400567b0(uVar2);
    *param_1 = lVar4;
    param_1[1] = lVar4;
    param_1[2] = uVar2 * 0x41 + lVar4;
    lVar4 = FUN_14016dab0(*param_2,param_2[1],lVar4,param_4,uVar5);
    param_1[1] = lVar4;
  }
  return param_1;
}



undefined8 * FUN_14016dab0(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;
}



void FUN_14016db30(longlong param_1)

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



// WARNING: Removing unreachable block (ram,0x00014016dc6e)
// WARNING: Removing unreachable block (ram,0x00014016dc77)
// WARNING: Removing unreachable block (ram,0x00014016dc98)
// WARNING: Removing unreachable block (ram,0x00014016dca1)

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

{
  undefined8 *puVar1;
  undefined4 uVar2;
  undefined8 *local_res10;
  
  *param_1 = MagiAgentReceive::vftable;
  *(undefined4 *)(param_1 + 1) = 0;
  *(undefined2 *)((longlong)param_1 + 0xc) = 0;
  *(undefined1 *)((longlong)param_1 + 0xe) = 0;
  *(undefined4 *)(param_1 + 2) = 0;
  param_1[3] = 0;
  FUN_14034fe70(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  param_1[4] = PTR_DAT_1405d8010;
  param_1[5] = 0;
  *(undefined4 *)(param_1 + 6) = 0;
  *param_1 = MGSGameProudBase::vftable;
  *(undefined4 *)(param_1 + 7) = 0;
  uVar2 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 8,uVar2,1);
  puVar1 = param_1 + 0xf;
  local_res10 = puVar1;
  FUN_140385af0();
  *puVar1 = COMMON_S2C::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x8c) != 1) {
    FUN_14034fa20();
  }
  *puVar1 = RNP::CommonS2cProxy::vftable;
  *(undefined1 *)(param_1 + 0x12) = 0;
  param_1[0x2b] = 0;
  param_1[0x2c] = 0;
  *(undefined4 *)(param_1 + 0x2d) = 0x11;
  *(undefined4 *)(param_1 + 0x31) = 0;
  *(undefined4 *)((longlong)param_1 + 0x18c) = 10;
  param_1[0x32] = 0;
  param_1[0x33] = 0;
  *(undefined4 *)((longlong)param_1 + 0x16c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x2e) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x174) = 0x40100000;
  param_1[0x2f] = 0x26;
  param_1[0x30] = 0;
  param_1[0x34] = 0;
  param_1[0x35] = 0;
  param_1[0x36] = 0;
  param_1[0x38] = 0;
  param_1[0x39] = 0;
  param_1[0x3a] = 0;
  uVar2 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x3c,uVar2,1);
  param_1[0x43] = 0;
  FUN_140175950(param_1 + 0x50,&local_res10);
  *(undefined4 *)(param_1 + 0x57) = 0;
  *(undefined2 *)((longlong)param_1 + 700) = 0xffff;
  return param_1;
}



void FUN_14016dd40(undefined8 param_1,char param_2,int param_3,undefined4 *param_4)

{
  void *pvVar1;
  longlong lVar2;
  undefined8 uVar3;
  _SYSTEMTIME local_30;
  
  GetLocalTime(&local_30);
  wprintf(
         L"%04d-%02d-%02d %02d:%02d:%02d : PT_REAL_TIME_EVENT WORLD [%d] STATE [%d] EventID [%d] [%d] [%s]\n"
         );
  if (param_3 == *(int *)(DAT_140608000 + 0x140)) {
    if (param_2 == '\0') {
      lVar2 = DAT_140607cc0;
      if (DAT_140607cc0 == 0) {
        pvVar1 = operator_new(0x130);
        lVar2 = 0;
        if (pvVar1 != (void *)0x0) {
          lVar2 = FUN_1401e04e0(pvVar1);
        }
      }
      DAT_140607cc0 = lVar2;
      uVar3 = 2;
    }
    else {
      lVar2 = DAT_140607cc0;
      if (DAT_140607cc0 == 0) {
        pvVar1 = operator_new(0x130);
        lVar2 = 0;
        if (pvVar1 != (void *)0x0) {
          lVar2 = FUN_1401e04e0(pvVar1);
        }
      }
      DAT_140607cc0 = lVar2;
      uVar3 = 1;
    }
    FUN_1401e0a40(DAT_140607cc0,*param_4,uVar3);
  }
  return;
}



void FUN_14016de70(longlong param_1,undefined8 param_2)

{
  int *piVar1;
  undefined *puVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  int iVar9;
  int iVar10;
  longlong lVar11;
  undefined *local_res8;
  undefined **local_30;
  longlong *local_28;
  longlong local_20;
  ulonglong local_18;
  undefined8 local_10;
  
  local_30 = Proud::CFastArray<>::vftable;
  local_28 = (longlong *)0x0;
  local_20 = 0;
  local_18 = 0;
  local_10 = 0;
  FUN_14016e090(param_1,&local_30);
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8008;
  iVar4 = FUN_14034fd90(param_2);
  iVar9 = 0;
  iVar10 = iVar9;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8008)) {
    iVar10 = *(int *)(local_res8 + -8);
  }
  iVar5 = 0;
  iVar6 = iVar4;
  if (((iVar4 <= iVar10) && (iVar6 = iVar9, local_res8 != (undefined *)0x0)) &&
     (iVar6 = iVar5, local_res8 != PTR_DAT_1405d8008)) {
    iVar6 = *(int *)(local_res8 + -8);
  }
  iVar10 = 1;
  if (1 < iVar6) {
    iVar10 = iVar6;
  }
  iVar9 = iVar5;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8008)) {
    iVar9 = *(int *)(local_res8 + -8);
  }
  if (iVar9 < iVar10) {
    FUN_140057890(&local_res8);
  }
  FUN_140057970(&local_res8);
  puVar8 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar8,param_2,iVar4);
  puVar8 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8008;
  }
  iVar4 = FUN_14034fd90(puVar8);
  lVar3 = local_20;
  iVar10 = 0;
  if (0 < iVar4) {
    iVar10 = iVar4;
  }
  iVar4 = iVar5;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8008)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  if ((iVar4 <= iVar10) && (iVar10 = iVar5, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8008) goto LAB_14016dfca;
    iVar10 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8008) && (local_res8 != (undefined *)0x0)) &&
     (piVar1 = (int *)(local_res8 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar10;
    *(undefined1 *)((longlong)iVar10 + 8 + (longlong)piVar1) = 0;
  }
LAB_14016dfca:
  lVar11 = local_20;
  if ((int)local_18 == 0) {
    lVar11 = 0;
  }
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x3d8))
            ((longlong *)(param_1 + 0x78),lVar11,local_18 & 0xffffffff,&DAT_1405d85a0,&local_res8);
  puVar8 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8008)) &&
     (puVar2 = local_res8 + -8, puVar2 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar1 = (int *)(puVar8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar7);
  }
  if (lVar3 != 0) {
    if (local_28 == (longlong *)0x0) {
      FUN_14034ff60(lVar3);
    }
    else {
      (**(code **)(*local_28 + 0x18))(local_28,lVar3);
    }
  }
  return;
}



void FUN_14016e090(longlong param_1,longlong param_2)

{
  undefined4 uVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined4 *puVar9;
  int iVar10;
  longlong lVar11;
  undefined4 *puVar12;
  
  FUN_14034ed40(param_1 + 0x1e0);
  if (*(longlong *)(param_1 + 0x160) != 0) {
    uVar4 = 0;
    if (*(uint *)(param_1 + 0x168) != 0) {
      plVar8 = *(longlong **)(param_1 + 0x158);
      do {
        if (*plVar8 != 0) {
          puVar12 = (undefined4 *)(*(longlong **)(param_1 + 0x158))[uVar4];
          goto joined_r0x00014016e111;
        }
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        plVar8 = plVar8 + 1;
      } while (uVar3 < *(uint *)(param_1 + 0x168));
    }
  }
  puVar12 = (undefined4 *)0x0;
joined_r0x00014016e111:
  do {
    if (puVar12 == (undefined4 *)0x0) {
      FUN_14034edd0(param_1 + 0x1e0);
      return;
    }
    if (puVar12 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    puVar9 = (undefined4 *)0x0;
    if ((puVar12 != (undefined4 *)0x0) &&
       (puVar9 = *(undefined4 **)(puVar12 + 4), puVar9 == (undefined4 *)0x0)) {
      uVar3 = (uint)puVar12[6] % *(uint *)(param_1 + 0x168) + 1;
      lVar5 = (longlong)(int)uVar3 << 3;
      do {
        if (*(uint *)(param_1 + 0x168) <= uVar3) break;
        if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x158)) != 0) {
          puVar9 = *(undefined4 **)(lVar5 + *(longlong *)(param_1 + 0x158));
        }
        uVar3 = uVar3 + 1;
        lVar5 = lVar5 + 8;
      } while (puVar9 == (undefined4 *)0x0);
    }
    uVar1 = *puVar12;
    iVar2 = *(int *)(param_2 + 0x18);
    if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    iVar10 = *(int *)(param_2 + 0x18);
    FUN_14012c550(param_2);
    iVar10 = iVar10 - iVar2;
    if ((0 < iVar10) && (iVar10 = iVar10 + -1, lVar5 = (longlong)iVar10, -1 < iVar10)) {
      lVar11 = (iVar2 + lVar5) * 4;
      do {
        lVar6 = FUN_14012c6a0(param_2);
        lVar7 = FUN_14012c6a0(param_2);
        *(undefined4 *)(lVar7 + 4 + lVar11) = *(undefined4 *)(lVar6 + lVar11);
        lVar11 = lVar11 + -4;
        lVar5 = lVar5 + -1;
      } while (-1 < lVar5);
    }
    lVar5 = FUN_14012c6a0(param_2);
    *(undefined4 *)(lVar5 + (longlong)iVar2 * 4) = uVar1;
    puVar12 = puVar9;
  } while( true );
}



longlong FUN_14016e240(longlong param_1,uint param_2)

{
  longlong lVar1;
  longlong lVar2;
  uint *puVar3;
  
  lVar1 = param_1 + 0x1e0;
  FUN_14034ed40(lVar1);
  if (*(longlong *)(param_1 + 0x158) != 0) {
    for (puVar3 = *(uint **)(*(longlong *)(param_1 + 0x158) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x168)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 4)) {
      if ((puVar3[6] == param_2) && (*puVar3 == param_2)) {
        if ((puVar3 != (uint *)0x0) &&
           (lVar2 = *(longlong *)(puVar3 + 2), *(char *)(lVar2 + 0x28c) == '\0')) {
          FUN_14034edd0(lVar1);
          return lVar2;
        }
        break;
      }
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



undefined8 FUN_14016e2f0(longlong param_1,int *param_2,int *param_3)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  undefined2 local_res18 [4];
  undefined8 uVar4;
  longlong lVar5;
  
  uVar4 = 0xfffffffffffffffe;
  iVar1 = *param_3;
  if (iVar1 == 0x14) {
    lVar3 = param_1 + 0x1e0;
    FUN_14034ed40(lVar3);
    FUN_14008e4d0(param_1 + 0x1c0,param_2);
  }
  else if ((((iVar1 == 1) || (iVar1 == 2)) || (iVar1 == 3)) ||
          (((iVar1 == 4 || (iVar1 == 5)) || ((iVar1 == 0xf || (iVar1 == 0x10)))))) {
    if (*param_2 == 0) {
      return 1;
    }
    lVar2 = FUN_14016e240();
    if (lVar2 == 0) {
      return 1;
    }
    lVar3 = lVar2 + 0x680;
    lVar5 = lVar3;
    FUN_14034ed40(lVar3);
    if (*(char *)(lVar2 + 0x6b8) != '\0') {
      local_res18[0] = (undefined2)*param_3;
      (**(code **)(*(longlong *)(param_1 + 0x78) + 0x610))
                ((longlong *)(param_1 + 0x78),*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_res18,
                 uVar4,lVar5,1);
    }
  }
  else {
    if (iVar1 != 0xe) {
      return 1;
    }
    lVar3 = param_1 + 0x1e0;
    FUN_14034ed40(lVar3);
    FUN_14008e4d0(param_1 + 0x1a0,param_2);
  }
  FUN_14034edd0(lVar3);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014016e881)
// WARNING: Removing unreachable block (ram,0x00014016e88a)
// WARNING: Removing unreachable block (ram,0x00014016e8ab)
// WARNING: Removing unreachable block (ram,0x00014016e8b4)

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

{
  undefined4 uVar1;
  void *pvVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  longlong lVar5;
  
  FUN_14016db40(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_140388e70(param_1 + 0x58);
  param_1[0x58] = RNP::CommonC2sStub::vftable;
  FUN_140388e70(param_1 + 0x5c);
  param_1[0x5c] = RNP::CheatC2sStub::vftable;
  FUN_140388e70(param_1 + 0x60);
  param_1[0x60] = RNP::CharacterStub::vftable;
  FUN_140388e70(param_1 + 100);
  param_1[100] = RNP::WorldC2sStub::vftable;
  FUN_140388e70(param_1 + 0x68);
  *param_1 = MGSGameProud::vftable;
  param_1[0x58] = MGSGameProud::vftable;
  param_1[0x5c] = MGSGameProud::vftable;
  param_1[0x60] = MGSGameProud::vftable;
  param_1[100] = MGSGameProud::vftable;
  param_1[0x68] = MGSGameProud::vftable;
  puVar4 = param_1 + 0x6c;
  FUN_140385af0(puVar4);
  *puVar4 = CHEAT_S2C::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x374) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::CheatS2cProxy::vftable;
  *(undefined1 *)(param_1 + 0x6f) = 0;
  puVar4 = param_1 + 0x70;
  FUN_140385af0(puVar4);
  *puVar4 = CHARACTER_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x394) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::CharacterProxy::vftable;
  *(undefined1 *)(param_1 + 0x73) = 0;
  puVar4 = param_1 + 0x74;
  FUN_140385af0(puVar4);
  *puVar4 = WORLD_S2C::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x3b4) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::WorldS2cProxy::vftable;
  *(undefined1 *)(param_1 + 0x77) = 0;
  puVar4 = param_1 + 0x78;
  FUN_140385af0(puVar4);
  *puVar4 = TCP_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x3d4) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::TcpProxy::vftable;
  *(undefined1 *)(param_1 + 0x7b) = 0;
  puVar4 = param_1 + 0x7c;
  FUN_140385af0(puVar4);
  *puVar4 = UDP_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x3f4) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::UdpProxy::vftable;
  *(undefined1 *)(param_1 + 0x7f) = 0;
  puVar4 = param_1 + 0x80;
  FUN_140385af0(puVar4);
  *puVar4 = TCP_BOOTH_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x414) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::TcpBoothProxy::vftable;
  *(undefined1 *)(param_1 + 0x83) = 0;
  puVar4 = param_1 + 0x84;
  FUN_140385af0(puVar4);
  *puVar4 = TCP_FRIEND_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x434) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::TcpFriendProxy::vftable;
  *(undefined1 *)(param_1 + 0x87) = 0;
  puVar4 = param_1 + 0x88;
  FUN_140385af0(puVar4);
  *puVar4 = TCP_GUILD_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x454) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::TcpGuildProxy::vftable;
  *(undefined1 *)(param_1 + 0x8b) = 0;
  puVar4 = param_1 + 0x8c;
  FUN_140385af0(puVar4);
  *puVar4 = TCP_PARTY_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x474) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::TcpPartyProxy::vftable;
  *(undefined1 *)(param_1 + 0x8f) = 0;
  puVar4 = param_1 + 0x90;
  FUN_140385af0(puVar4);
  *puVar4 = TCP_TRADE_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x494) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::TcpTradeProxy::vftable;
  *(undefined1 *)(param_1 + 0x93) = 0;
  puVar4 = param_1 + 0x94;
  FUN_140385af0(puVar4);
  *puVar4 = TCP_AUCTION_PROTOCOL::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x4b4) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar4 = RNP::TcpAuctionProxy::vftable;
  *(undefined1 *)(param_1 + 0x97) = 0;
  uVar3 = 0;
  param_1[0x9c] = 0;
  param_1[0x9d] = 0;
  param_1[0x9e] = 0;
  param_1[0x9f] = 0;
  FUN_1401755e0(param_1 + 0xa0);
  param_1[0xa4] = 0;
  *(undefined4 *)(param_1 + 0xa5) = 0;
  param_1[0xa6] = 0;
  param_1[0xa7] = 0;
  *(undefined4 *)(param_1 + 0xa8) = 0x11;
  *(undefined4 *)(param_1 + 0xac) = 0;
  *(undefined4 *)((longlong)param_1 + 0x564) = 10;
  param_1[0xad] = 0;
  param_1[0xae] = 0;
  *(undefined4 *)((longlong)param_1 + 0x544) = 0x3f400000;
  *(undefined4 *)(param_1 + 0xa9) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x54c) = 0x40100000;
  param_1[0xaa] = 0x26;
  param_1[0xab] = 4;
  param_1[0xab] = 0;
  pvVar2 = operator_new(0x338);
  if (pvVar2 != (void *)0x0) {
    uVar3 = FUN_1401e2b10(pvVar2);
  }
  param_1[0xaf] = uVar3;
  param_1[0xb0] = 0;
  param_1[0xb1] = 0;
  param_1[0xb2] = 0;
  *(undefined4 *)(param_1 + 0xb3) = 0;
  param_1[0xb4] = 0;
  param_1[0xb5] = 0;
  param_1[0xb6] = 0;
  param_1[0xb7] = 0;
  param_1[0xb9] = 0;
  param_1[0xba] = 0;
  param_1[0xbb] = 0;
  param_1[0xbc] = 0;
  param_1[0xbe] = 0;
  param_1[0xbf] = 0;
  param_1[0xc0] = 0;
  param_1[0xc1] = 0;
  param_1[0xc3] = 0;
  param_1[0xc4] = 0;
  param_1[0xc5] = 0;
  param_1[199] = 0;
  param_1[200] = 0;
  param_1[0xc9] = 0;
  param_1[0xcb] = 0;
  param_1[0xcc] = 0;
  param_1[0xcd] = 0;
  param_1[0xcf] = 0;
  param_1[0xd0] = 0;
  param_1[0xd1] = 0;
  param_1[0xd3] = 0;
  param_1[0xd4] = 0;
  param_1[0xd5] = 0;
  param_1[0xd7] = 0;
  param_1[0xd8] = 0;
  param_1[0xd9] = 0;
  param_1[0xdb] = 0;
  param_1[0xdc] = 0;
  param_1[0xdd] = 0;
  param_1[0xdf] = 0;
  param_1[0xe0] = 0;
  param_1[0xe1] = 0;
  param_1[0xe3] = 0;
  param_1[0xe4] = 0;
  param_1[0xe5] = 0;
  param_1[0xe7] = 0;
  param_1[0xe8] = 0;
  param_1[0xe9] = 0;
  param_1[0xeb] = 0;
  param_1[0xec] = 0;
  param_1[0xed] = 0;
  param_1[0xef] = 0;
  param_1[0xf0] = 0;
  param_1[0xf1] = 0;
  param_1[0xf3] = 0;
  param_1[0xf4] = 0;
  param_1[0xf5] = 0;
  param_1[0xf7] = 0;
  param_1[0xf8] = 0;
  param_1[0xf9] = 0;
  param_1[0xfb] = 0;
  param_1[0xfc] = 0;
  param_1[0xfd] = 0;
  param_1[0xff] = 0;
  param_1[0x100] = 0;
  param_1[0x101] = 0;
  param_1[0x103] = 0;
  param_1[0x104] = 0;
  param_1[0x105] = 0;
  param_1[0x107] = 0;
  param_1[0x108] = 0;
  param_1[0x109] = 0;
  param_1[0x10b] = 0;
  param_1[0x10c] = 0;
  param_1[0x10d] = 0;
  param_1[0x10f] = 0;
  param_1[0x110] = 0;
  param_1[0x111] = 0;
  param_1[0x113] = 0;
  param_1[0x114] = 0;
  param_1[0x115] = 0;
  param_1[0x117] = 0;
  param_1[0x118] = 0;
  *(undefined4 *)(param_1 + 0x119) = 0x11;
  *(undefined4 *)(param_1 + 0x11d) = 0;
  *(undefined4 *)((longlong)param_1 + 0x8ec) = 10;
  param_1[0x11e] = 0;
  param_1[0x11f] = 0;
  *(undefined4 *)((longlong)param_1 + 0x8cc) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x11a) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x8d4) = 0x40100000;
  param_1[0x11b] = 0x26;
  param_1[0x11c] = 0;
  param_1[0x120] = 0;
  param_1[0x121] = 0;
  param_1[0x122] = 0;
  param_1[0x124] = 0;
  param_1[0x125] = 0;
  param_1[0x126] = 0;
  param_1[0x128] = 0;
  param_1[0x129] = 0;
  param_1[0x12a] = 0;
  *(undefined2 *)(param_1 + 300) = 0x100;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x12d,uVar1,1);
  param_1[0x98] = 0;
  param_1[0x99] = 0;
  param_1[0x9a] = 0;
  param_1[0x9b] = 0;
  puVar4 = param_1 + 0x1f;
  lVar5 = 0x18;
  do {
    *(undefined4 *)(puVar4 + -0xc) = 0;
    *(undefined4 *)puVar4 = 0;
    *(undefined4 *)(puVar4 + 0x25) = 0;
    puVar4 = (undefined8 *)((longlong)puVar4 + 4);
    lVar5 = lVar5 + -1;
  } while (lVar5 != 0);
  param_1[0x56] = 0;
  return param_1;
}



void * FUN_14016ec50(void *param_1,uint param_2)

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



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

{
  undefined8 *puVar1;
  undefined1 local_res18 [16];
  
  *param_1 = MGSGameProud::vftable;
  param_1[0x58] = MGSGameProud::vftable;
  param_1[0x5c] = MGSGameProud::vftable;
  param_1[0x60] = MGSGameProud::vftable;
  param_1[100] = MGSGameProud::vftable;
  param_1[0x68] = MGSGameProud::vftable;
  puVar1 = (undefined8 *)param_1[0xaf];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,0xfffffffffffffffe);
  }
  param_1[0xaf] = 0;
  FUN_140419190();
  FUN_14016f3e0(param_1);
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[3] = 0;
  FUN_14034edf0(param_1 + 0x12d);
  if ((void *)param_1[0x128] != (void *)0x0) {
    operator_delete((void *)param_1[0x128]);
  }
  param_1[0x128] = 0;
  param_1[0x129] = 0;
  param_1[0x12a] = 0;
  if ((void *)param_1[0x124] != (void *)0x0) {
    operator_delete((void *)param_1[0x124]);
  }
  param_1[0x124] = 0;
  param_1[0x125] = 0;
  param_1[0x126] = 0;
  if ((void *)param_1[0x120] != (void *)0x0) {
    operator_delete((void *)param_1[0x120]);
  }
  param_1[0x120] = 0;
  param_1[0x121] = 0;
  param_1[0x122] = 0;
  FUN_140176250(param_1 + 0x117);
  if ((void *)param_1[0x113] != (void *)0x0) {
    operator_delete((void *)param_1[0x113]);
  }
  param_1[0x113] = 0;
  param_1[0x114] = 0;
  param_1[0x115] = 0;
  if ((void *)param_1[0x10f] != (void *)0x0) {
    operator_delete((void *)param_1[0x10f]);
  }
  param_1[0x10f] = 0;
  param_1[0x110] = 0;
  param_1[0x111] = 0;
  if ((void *)param_1[0x10b] != (void *)0x0) {
    operator_delete((void *)param_1[0x10b]);
  }
  param_1[0x10b] = 0;
  param_1[0x10c] = 0;
  param_1[0x10d] = 0;
  if ((void *)param_1[0x107] != (void *)0x0) {
    operator_delete((void *)param_1[0x107]);
  }
  param_1[0x107] = 0;
  param_1[0x108] = 0;
  param_1[0x109] = 0;
  if ((void *)param_1[0x103] != (void *)0x0) {
    operator_delete((void *)param_1[0x103]);
  }
  param_1[0x103] = 0;
  param_1[0x104] = 0;
  param_1[0x105] = 0;
  if (param_1[0xff] != 0) {
    FUN_140175d50(param_1[0xff],param_1[0x100]);
    operator_delete((void *)param_1[0xff]);
  }
  param_1[0xff] = 0;
  param_1[0x100] = 0;
  param_1[0x101] = 0;
  if ((void *)param_1[0xfb] != (void *)0x0) {
    operator_delete((void *)param_1[0xfb]);
  }
  param_1[0xfb] = 0;
  param_1[0xfc] = 0;
  param_1[0xfd] = 0;
  if (param_1[0xf7] != 0) {
    FUN_140175cf0(param_1[0xf7],param_1[0xf8]);
    operator_delete((void *)param_1[0xf7]);
  }
  param_1[0xf7] = 0;
  param_1[0xf8] = 0;
  param_1[0xf9] = 0;
  if (param_1[0xf3] != 0) {
    FUN_140175cf0(param_1[0xf3],param_1[0xf4]);
    operator_delete((void *)param_1[0xf3]);
  }
  param_1[0xf3] = 0;
  param_1[0xf4] = 0;
  param_1[0xf5] = 0;
  FUN_140175850(param_1 + 0xef);
  if (param_1[0xeb] != 0) {
    FUN_1403409c0(param_1[0xeb],param_1[0xec]);
    operator_delete((void *)param_1[0xeb]);
  }
  param_1[0xeb] = 0;
  param_1[0xec] = 0;
  param_1[0xed] = 0;
  if (param_1[0xe7] != 0) {
    FUN_1401766a0(param_1[0xe7],param_1[0xe8]);
    operator_delete((void *)param_1[0xe7]);
  }
  param_1[0xe7] = 0;
  param_1[0xe8] = 0;
  param_1[0xe9] = 0;
  if (param_1[0xe3] != 0) {
    FUN_140341ff0(param_1[0xe3],param_1[0xe4]);
    operator_delete((void *)param_1[0xe3]);
  }
  param_1[0xe3] = 0;
  param_1[0xe4] = 0;
  param_1[0xe5] = 0;
  if ((void *)param_1[0xdf] != (void *)0x0) {
    operator_delete((void *)param_1[0xdf]);
  }
  param_1[0xdf] = 0;
  param_1[0xe0] = 0;
  param_1[0xe1] = 0;
  if ((void *)param_1[0xdb] != (void *)0x0) {
    operator_delete((void *)param_1[0xdb]);
  }
  param_1[0xdb] = 0;
  param_1[0xdc] = 0;
  param_1[0xdd] = 0;
  if (param_1[0xd7] != 0) {
    FUN_140175c90(param_1[0xd7],param_1[0xd8]);
    operator_delete((void *)param_1[0xd7]);
  }
  param_1[0xd7] = 0;
  param_1[0xd8] = 0;
  param_1[0xd9] = 0;
  if (param_1[0xd3] != 0) {
    FUN_140176610(param_1[0xd3],param_1[0xd4]);
    operator_delete((void *)param_1[0xd3]);
  }
  param_1[0xd3] = 0;
  param_1[0xd4] = 0;
  param_1[0xd5] = 0;
  if (param_1[0xcf] != 0) {
    FUN_140176590(param_1[0xcf],param_1[0xd0]);
    operator_delete((void *)param_1[0xcf]);
  }
  param_1[0xcf] = 0;
  param_1[0xd0] = 0;
  param_1[0xd1] = 0;
  if ((void *)param_1[0xcb] != (void *)0x0) {
    operator_delete((void *)param_1[0xcb]);
  }
  param_1[0xcb] = 0;
  param_1[0xcc] = 0;
  param_1[0xcd] = 0;
  if (param_1[199] != 0) {
    FUN_140176500(param_1[199],param_1[200]);
    operator_delete((void *)param_1[199]);
  }
  param_1[199] = 0;
  param_1[200] = 0;
  param_1[0xc9] = 0;
  FUN_1401751b0(param_1 + 0xc3);
  FUN_140175150(param_1 + 0xbf);
  if (param_1[0xba] != 0) {
    FUN_140175730(param_1[0xba],param_1[0xbb]);
    operator_delete((void *)param_1[0xba]);
  }
  param_1[0xba] = 0;
  param_1[0xbb] = 0;
  param_1[0xbc] = 0;
  if (param_1[0xb5] != 0) {
    FUN_140175730(param_1[0xb5],param_1[0xb6]);
    operator_delete((void *)param_1[0xb5]);
  }
  param_1[0xb5] = 0;
  param_1[0xb6] = 0;
  param_1[0xb7] = 0;
  FUN_140176230(param_1 + 0xa6);
  FUN_1401e27c0(param_1 + 0xa0,local_res18,*(undefined8 *)param_1[0xa1],(undefined8 *)param_1[0xa1])
  ;
  operator_delete((void *)param_1[0xa1]);
  param_1[0x94] = RNP::TcpAuctionProxy::vftable;
  FUN_140385b20();
  param_1[0x90] = RNP::TcpTradeProxy::vftable;
  FUN_140385b20();
  param_1[0x8c] = RNP::TcpPartyProxy::vftable;
  FUN_140385b20();
  param_1[0x88] = RNP::TcpGuildProxy::vftable;
  FUN_140385b20();
  param_1[0x84] = RNP::TcpFriendProxy::vftable;
  FUN_140385b20();
  param_1[0x80] = RNP::TcpBoothProxy::vftable;
  FUN_140385b20();
  param_1[0x7c] = RNP::UdpProxy::vftable;
  FUN_140385b20();
  param_1[0x78] = RNP::TcpProxy::vftable;
  FUN_140385b20();
  param_1[0x74] = RNP::WorldS2cProxy::vftable;
  FUN_140385b20();
  param_1[0x70] = RNP::CharacterProxy::vftable;
  FUN_140385b20();
  param_1[0x6c] = RNP::CheatS2cProxy::vftable;
  FUN_140385b20();
  param_1[0x68] = RNP::TcpFriendStub::vftable;
  FUN_140388ea0(param_1 + 0x68);
  param_1[100] = RNP::WorldC2sStub::vftable;
  FUN_140388ea0(param_1 + 100);
  param_1[0x60] = RNP::CharacterStub::vftable;
  FUN_140388ea0(param_1 + 0x60);
  param_1[0x5c] = RNP::CheatC2sStub::vftable;
  FUN_140388ea0(param_1 + 0x5c);
  param_1[0x58] = RNP::CommonC2sStub::vftable;
  FUN_140388ea0(param_1 + 0x58);
  FUN_140176eb0(param_1);
  return;
}



void FUN_14016f3e0(longlong param_1)

{
  char cVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  
  plVar5 = (longlong *)**(longlong **)(param_1 + 0x508);
  if (plVar5 != *(longlong **)(param_1 + 0x508)) {
    do {
      puVar2 = (undefined8 *)plVar5[4];
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      if (*(char *)((longlong)plVar5 + 0x29) == '\0') {
        plVar3 = (longlong *)plVar5[2];
        if (*(char *)((longlong)plVar3 + 0x29) == '\0') {
          cVar1 = *(char *)(*plVar3 + 0x29);
          plVar5 = plVar3;
          plVar3 = (longlong *)*plVar3;
          while (cVar1 == '\0') {
            cVar1 = *(char *)(*plVar3 + 0x29);
            plVar5 = plVar3;
            plVar3 = (longlong *)*plVar3;
          }
        }
        else {
          cVar1 = *(char *)(plVar5[1] + 0x29);
          plVar4 = (longlong *)plVar5[1];
          plVar3 = plVar5;
          while ((plVar5 = plVar4, cVar1 == '\0' && (plVar3 == (longlong *)plVar5[2]))) {
            cVar1 = *(char *)(plVar5[1] + 0x29);
            plVar4 = (longlong *)plVar5[1];
            plVar3 = plVar5;
          }
        }
      }
    } while (plVar5 != *(longlong **)(param_1 + 0x508));
  }
  plVar5 = *(longlong **)(*(longlong *)(param_1 + 0x508) + 8);
  cVar1 = *(char *)((longlong)plVar5 + 0x29);
  while (cVar1 == '\0') {
    FUN_14012f260(param_1 + 0x500,plVar5[2]);
    plVar3 = (longlong *)*plVar5;
    operator_delete(plVar5);
    plVar5 = plVar3;
    cVar1 = *(char *)((longlong)plVar3 + 0x29);
  }
  *(longlong *)(*(longlong *)(param_1 + 0x508) + 8) = *(longlong *)(param_1 + 0x508);
  *(undefined8 *)*(undefined8 *)(param_1 + 0x508) = *(undefined8 *)(param_1 + 0x508);
  *(longlong *)(*(longlong *)(param_1 + 0x508) + 0x10) = *(longlong *)(param_1 + 0x508);
  *(undefined8 *)(param_1 + 0x510) = 0;
  return;
}



void FUN_14016f4d0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x218) = 0;
  return;
}



void FUN_14016f4e0(longlong param_1,longlong param_2,undefined4 param_3,int param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  undefined4 local_res18 [2];
  undefined8 in_stack_ffffffffffffff78;
  undefined4 uVar7;
  undefined8 in_stack_ffffffffffffff80;
  undefined4 uVar9;
  undefined2 *puVar8;
  undefined4 *puVar10;
  undefined1 local_68 [2];
  undefined2 local_66;
  short local_64;
  undefined2 local_62;
  undefined4 local_60 [2];
  undefined8 local_58;
  longlong *local_50;
  longlong *local_48;
  undefined1 local_40 [24];
  
  uVar7 = (undefined4)((ulonglong)in_stack_ffffffffffffff78 >> 0x20);
  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffff80 >> 0x20);
  local_58 = 0xfffffffffffffffe;
  local_res18[0] = param_3;
  FUN_140198570(param_2,&local_50);
  plVar1 = local_50;
  if (local_50 != (longlong *)0x0) {
    if (local_50 == local_48) {
      if (*local_50 != 0) {
        lVar4 = FUN_1402d63a0(*local_50,local_res18[0],1);
        if (lVar4 == 0) {
          LOCK();
          plVar1 = plVar1 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 != 0) {
            return;
          }
          puVar2 = (undefined8 *)*local_50;
          plVar1 = local_50;
        }
        else {
          FUN_140198d00(param_2,local_40,0,*(int *)(lVar4 + 0x70) + -1,
                        CONCAT44(uVar7,local_res18[0]),CONCAT44(uVar9,1));
          local_68[0] = 1;
          lVar5 = (**(code **)(*(longlong *)*plVar1 + 0x270))();
          local_60[0] = *(undefined4 *)(lVar5 + 0x6c);
          local_66 = 1;
          puVar10 = local_60;
          puVar8 = &local_66;
          (**(code **)(*(longlong *)(param_1 + 0x78) + 800))
                    (param_1 + 0x78,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_40,local_res18
                     ,puVar8,puVar10,local_68);
          if (-1 < param_4) {
            FUN_1401993d0(param_2,local_40,local_res18[0],1,param_4,
                          (ulonglong)puVar8 & 0xffffffff00000000,
                          (ulonglong)puVar10 & 0xffffffff00000000);
          }
          if ((0 < *(int *)(lVar4 + 0x70)) &&
             (iVar3 = FUN_140198ec0(param_2,0,*(int *)(lVar4 + 0x70) + -1,local_40), iVar3 != 0)) {
            local_64 = *(short *)(lVar4 + 0x70) + -1;
            local_62 = 0;
            (**(code **)(*(longlong *)(param_1 + 0x78) + 0x330))
                      (param_1 + 0x78,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_62,
                       &local_64,local_40);
          }
          LOCK();
          plVar1 = plVar1 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 != 0) {
            return;
          }
          puVar2 = (undefined8 *)*local_50;
          plVar1 = local_50;
        }
        goto joined_r0x00014016f6f5;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_48) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 != 0) {
    return;
  }
  puVar2 = (undefined8 *)*local_50;
  plVar1 = local_50;
joined_r0x00014016f6f5:
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
  }
  operator_delete(plVar1);
  return;
}



void FUN_14016f730(longlong param_1,longlong param_2,uint param_3,undefined4 param_4,
                  undefined4 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)

{
  ulonglong *puVar1;
  void *pvVar2;
  uint uVar3;
  ulonglong *puVar4;
  longlong lVar5;
  uint *puVar6;
  int iVar7;
  longlong *plVar8;
  longlong *plVar9;
  uint uVar10;
  longlong *plVar11;
  undefined2 uVar12;
  ulonglong uVar13;
  bool bVar14;
  uint local_res18 [2];
  undefined4 local_res20 [2];
  undefined8 in_stack_fffffffffffffd38;
  undefined4 uVar18;
  undefined8 uVar15;
  undefined4 *puVar16;
  undefined4 *puVar17;
  undefined8 in_stack_fffffffffffffd40;
  undefined4 uVar20;
  undefined4 *puVar19;
  undefined8 in_stack_fffffffffffffd48;
  undefined4 uVar23;
  undefined8 uVar21;
  int *piVar22;
  undefined8 in_stack_fffffffffffffd50;
  undefined4 uVar26;
  undefined8 uVar24;
  undefined1 *puVar25;
  undefined8 in_stack_fffffffffffffd58;
  undefined4 uVar28;
  undefined4 *puVar27;
  undefined4 local_298;
  int local_294;
  undefined2 local_290;
  undefined2 local_28e;
  undefined2 local_28c;
  undefined2 local_28a;
  undefined2 local_288;
  undefined2 local_286 [3];
  undefined4 local_280;
  undefined4 uStack_27c;
  undefined4 local_278;
  undefined4 uStack_274;
  longlong *local_270;
  longlong *local_268;
  undefined4 local_260 [2];
  undefined4 local_258;
  undefined4 local_254;
  undefined4 local_250;
  undefined4 local_24c;
  longlong *local_248;
  longlong *local_240;
  undefined4 local_238;
  undefined4 local_234;
  undefined4 local_230;
  undefined4 local_22c;
  undefined4 local_228;
  undefined4 local_224;
  undefined4 local_220;
  undefined4 local_21c;
  undefined4 local_218;
  undefined4 local_214;
  undefined4 local_210;
  undefined4 local_20c;
  undefined4 local_208;
  undefined4 local_204;
  undefined4 local_200;
  undefined4 local_1fc;
  undefined4 local_1f8;
  undefined4 local_1f4;
  undefined4 local_1f0;
  undefined4 local_1ec;
  undefined8 local_1e8;
  undefined4 local_1e0;
  undefined4 uStack_1dc;
  undefined4 uStack_1d8;
  undefined4 uStack_1d4;
  undefined4 local_1c8;
  undefined4 uStack_1c4;
  undefined4 uStack_1c0;
  undefined4 uStack_1bc;
  undefined2 local_1b4;
  undefined2 local_1b2;
  uint local_1b0;
  undefined4 local_120;
  undefined1 local_118 [16];
  undefined1 local_108 [16];
  undefined1 local_f8 [16];
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffd38 >> 0x20);
  uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffd40 >> 0x20);
  uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffd48 >> 0x20);
  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffd50 >> 0x20);
  uVar28 = (undefined4)((ulonglong)in_stack_fffffffffffffd58 >> 0x20);
  local_1e8 = 0xfffffffffffffffe;
  uVar13 = (ulonglong)(int)param_3;
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  FUN_14000a170(&local_1c8);
  local_120 = 0;
  puVar27 = (undefined4 *)CONCAT44(uVar28,param_12);
  uVar24 = CONCAT44(uVar26,param_11);
  uVar21 = CONCAT44(uVar23,param_10);
  puVar19 = (undefined4 *)CONCAT44(uVar20,param_9);
  uVar15 = CONCAT44(uVar18,param_8);
  FUN_1401aac30(3,&local_1c8,param_5,param_6,uVar15,puVar19,uVar21,uVar24,puVar27,param_13);
  uVar18 = (undefined4)((ulonglong)uVar15 >> 0x20);
  uVar20 = (undefined4)((ulonglong)uVar21 >> 0x20);
  uVar23 = (undefined4)((ulonglong)uVar24 >> 0x20);
  FUN_140197b70(param_2,&local_270);
  local_294 = -1;
  local_1e0 = local_1c8;
  uStack_1dc = uStack_1c4;
  uStack_1d8 = uStack_1c0;
  uStack_1d4 = uStack_1bc;
  local_298 = param_4;
  if (param_3 == 5) {
    puVar4 = (ulonglong *)FUN_140199da0(local_1c8,local_108,&local_1c8,&local_298);
  }
  else if (param_3 == 6) {
    puVar4 = (ulonglong *)FUN_140199f30(local_1c8,local_118,&local_1c8,&local_298);
  }
  else {
    piVar22 = &local_294;
    puVar19 = &local_298;
    puVar16 = &local_1c8;
    puVar4 = (ulonglong *)
             FUN_14019a0c0(local_1c8,local_f8,local_res18,local_res20,puVar16,puVar19,piVar22);
    uVar18 = (undefined4)((ulonglong)puVar16 >> 0x20);
    uVar20 = (undefined4)((ulonglong)piVar22 >> 0x20);
  }
  plVar11 = local_270;
  local_280 = (undefined4)*puVar4;
  uStack_27c = *(undefined4 *)((longlong)puVar4 + 4);
  puVar1 = puVar4 + 1;
  local_278 = (undefined4)*puVar1;
  uStack_274 = *(undefined4 *)((longlong)puVar4 + 0xc);
  if ((*puVar4 == 0) && (*puVar1 == 0)) {
    bVar14 = false;
  }
  else {
    bVar14 = true;
  }
  if (!bVar14) {
    if (local_270 == (longlong *)0x0) {
      return;
    }
    if (local_270 != local_268) goto LAB_14016ff0a;
    LOCK();
    plVar11 = local_270 + 1;
    *(int *)plVar11 = (int)*plVar11 + -1;
    iVar7 = (int)*plVar11;
    UNLOCK();
    goto LAB_14016ff2d;
  }
  bVar14 = *puVar4 < CONCAT44(uStack_1dc,local_1e0);
  if ((*puVar4 == CONCAT44(uStack_1dc,local_1e0)) &&
     (bVar14 = *puVar1 < CONCAT44(uStack_1d4,uStack_1d8), *puVar1 == CONCAT44(uStack_1d4,uStack_1d8)
     )) {
    iVar7 = 0;
  }
  else {
    iVar7 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
  }
  uVar12 = (undefined2)param_3;
  if (iVar7 == 0) {
    local_1b2 = (undefined2)local_298;
    local_258 = *(undefined4 *)(param_2 + 0x160);
    local_254 = *(undefined4 *)(param_2 + 0x164);
    local_250 = *(undefined4 *)(param_2 + 0x168);
    local_24c = *(undefined4 *)(param_2 + 0x16c);
    local_228 = *(undefined4 *)(param_2 + 0x170);
    local_224 = *(undefined4 *)(param_2 + 0x174);
    local_220 = *(undefined4 *)(param_2 + 0x178);
    local_21c = *(undefined4 *)(param_2 + 0x17c);
    iVar7 = *(int *)(param_2 + 0x284);
    local_260[0] = *(undefined4 *)(param_2 + 8);
    local_1b4 = uVar12;
    if ((-1 < iVar7) && (iVar7 < *(short *)(param_1 + 700))) {
      if ((CONCAT44(uStack_1c4,local_1c8) == 0) && (CONCAT44(uStack_1bc,uStack_1c0) == 0)) {
        bVar14 = false;
      }
      else {
        bVar14 = true;
      }
      if (((bVar14) && (local_1b0 != 0)) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
        param_6 = CONCAT22(param_6._2_2_,(short)iVar7);
        plVar8 = (longlong *)
                 (*(longlong *)
                   (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                   (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
        puVar27 = &local_1c8;
        puVar25 = (undefined1 *)&param_7;
        puVar16 = &local_258;
        puVar19 = &local_228;
        puVar17 = local_260;
        (**(code **)(*plVar8 + 0xb0))
                  (plVar8,1,&DAT_1405d85a0,&param_6,puVar17,puVar19,puVar16,puVar25,puVar27);
        uVar18 = (undefined4)((ulonglong)puVar17 >> 0x20);
        uVar20 = (undefined4)((ulonglong)puVar16 >> 0x20);
        uVar23 = (undefined4)((ulonglong)puVar25 >> 0x20);
      }
    }
    plVar8 = local_268;
    if (plVar11 == (longlong *)0x0) {
LAB_14016fa4f:
      lVar5 = 0;
    }
    else {
      if (plVar11 != local_268) {
        iVar7 = DAT_140608048 + 1;
        bVar14 = DAT_140608048 == 0;
        DAT_140608048 = iVar7;
        if (bVar14) {
          FUN_140176d60(1);
        }
        goto LAB_14016fa4f;
      }
      lVar5 = *plVar11;
    }
    uVar26 = *(undefined4 *)(lVar5 + 0x50a0);
    if (plVar11 == (longlong *)0x0) {
LAB_14016fa7e:
      lVar5 = 0;
    }
    else {
      if (plVar11 != plVar8) {
        iVar7 = DAT_140608048 + 1;
        bVar14 = DAT_140608048 == 0;
        DAT_140608048 = iVar7;
        if (bVar14) {
          FUN_140176d60(1);
        }
        goto LAB_14016fa7e;
      }
      lVar5 = *plVar11;
    }
    FUN_1402024f0(param_1,param_2,&local_1c8,0x193,CONCAT44(uVar18,0x50),
                  (ulonglong)puVar19 & 0xffffffff00000000,
                  CONCAT44(uVar20,*(undefined4 *)(lVar5 + 0x50a0)),CONCAT44(uVar23,uVar26),
                  (ulonglong)puVar27 & 0xffffffff00000000,0);
  }
  else {
    local_208 = *(undefined4 *)(param_2 + 0x160);
    local_204 = *(undefined4 *)(param_2 + 0x164);
    local_200 = *(undefined4 *)(param_2 + 0x168);
    local_1fc = *(undefined4 *)(param_2 + 0x16c);
    local_238 = *(undefined4 *)(param_2 + 0x170);
    local_234 = *(undefined4 *)(param_2 + 0x174);
    local_230 = *(undefined4 *)(param_2 + 0x178);
    local_22c = *(undefined4 *)(param_2 + 0x17c);
    iVar7 = *(int *)(param_2 + 0x284);
    if (((-1 < iVar7) && (iVar7 < *(short *)(param_1 + 700))) &&
       (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_288 = (undefined2)iVar7;
      plVar8 = (longlong *)
               (*(longlong *)
                 (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                 (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
      (**(code **)(*plVar8 + 0x140))
                (plVar8,1,&DAT_1405d85a0,&local_288,&local_238,&local_208,&local_1c8);
    }
  }
  uVar10 = local_1b0;
  lVar5 = FUN_140137690();
  uVar3 = local_1b0;
  if (*(longlong *)(lVar5 + 0x88) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                            ((ulonglong)uVar10 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xa6)) {
      if ((puVar6[0xa8] == uVar10) && (*puVar6 == uVar10)) {
        if (puVar6 != (uint *)0x0) {
          if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar10 = puVar6[0x18];
          goto LAB_14016fbe9;
        }
        break;
      }
    }
  }
  uVar10 = 0;
LAB_14016fbe9:
  lVar5 = FUN_1402e0270();
  if ((int)uVar3 < 1) {
LAB_14016fc31:
    lVar5 = FUN_1402e0270();
    if (0 < (int)uVar10) {
      if (*(longlong *)(lVar5 + 0x1f8) != 0) {
        for (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x1f8) +
                                ((ulonglong)uVar10 % (ulonglong)*(uint *)(lVar5 + 0x208)) * 8);
            puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 2)) {
          if ((puVar6[4] == uVar10) && (*puVar6 == uVar10)) goto LAB_14016fc74;
        }
      }
      puVar6 = (uint *)0x0;
LAB_14016fc74:
      if (puVar6 != (uint *)0x0) goto LAB_14016fc79;
    }
  }
  else {
    if (*(longlong *)(lVar5 + 0x1b0) != 0) {
      for (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x1b0) +
                              ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar5 + 0x1c0)) * 8);
          puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 2)) {
        if ((puVar6[4] == uVar3) && (*puVar6 == uVar3)) goto LAB_14016fc2c;
      }
    }
    puVar6 = (uint *)0x0;
LAB_14016fc2c:
    if (puVar6 == (uint *)0x0) goto LAB_14016fc31;
LAB_14016fc79:
    if ((((param_3 == 1) || (param_3 == 2)) || (param_3 == 3)) || ((param_3 == 4 || (param_3 == 5)))
       ) {
      FUN_1401a8bb0(param_2,local_1b0);
    }
  }
  if (-1 < local_294) {
    FUN_14000a170(local_e8);
    local_40 = 0;
    FUN_140197b70(param_2,&local_248);
    plVar8 = local_248;
    if (local_248 != (longlong *)0x0) {
      if (local_248 == local_240) {
        if (((*local_248 != 0) && (lVar5 = FUN_140174f00(&local_248), param_3 < 5)) &&
           (local_294 < 0x18)) {
          lVar5 = ((longlong)local_294 + uVar13 * 0x18) * 0xac + lVar5;
          *(undefined2 *)(lVar5 + 0x14) = uVar12;
          *(short *)(lVar5 + 0x16) = (short)local_294;
          FUN_140090020(local_e8);
          local_218 = *(undefined4 *)(param_2 + 0x160);
          local_214 = *(undefined4 *)(param_2 + 0x164);
          local_210 = *(undefined4 *)(param_2 + 0x168);
          local_20c = *(undefined4 *)(param_2 + 0x16c);
          local_1f8 = *(undefined4 *)(param_2 + 0x170);
          local_1f4 = *(undefined4 *)(param_2 + 0x174);
          local_1f0 = *(undefined4 *)(param_2 + 0x178);
          local_1ec = *(undefined4 *)(param_2 + 0x17c);
          iVar7 = *(int *)(param_2 + 0x284);
          if (((-1 < iVar7) && (iVar7 < *(short *)(param_1 + 700))) &&
             (*(longlong *)(param_1 + 0x4c0) != 0)) {
            local_28e = (undefined2)iVar7;
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                       (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar9 + 0x140))
                      (plVar9,1,&DAT_1405d85a0,&local_28e,&local_1f8,&local_218,local_e8);
          }
          local_28c = (undefined2)local_294;
          local_286[0] = uVar12;
          (**(code **)(*(longlong *)(param_1 + 0x78) + 0xe0))
                    ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                     local_286,&local_28c,local_e8);
        }
      }
      else {
        iVar7 = DAT_140608048 + 1;
        bVar14 = DAT_140608048 == 0;
        DAT_140608048 = iVar7;
        if (bVar14) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar8 != (longlong *)0x0) {
      if (plVar8 == local_240) {
        LOCK();
        plVar8 = plVar8 + 1;
        *(int *)plVar8 = (int)*plVar8 + -1;
        UNLOCK();
        if ((int)*plVar8 == 0) {
          pvVar2 = (void *)*local_248;
          if (pvVar2 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar2 + 0xf630);
            operator_delete(pvVar2);
          }
          operator_delete(local_248);
        }
        uVar13 = (ulonglong)local_res18[0];
        plVar11 = local_270;
      }
      else {
        iVar7 = DAT_140608050 + 1;
        bVar14 = DAT_140608050 == 0;
        DAT_140608050 = iVar7;
        if (bVar14) {
          FUN_140176d60(1);
        }
      }
    }
  }
  local_28a = (undefined2)local_298;
  local_290 = (undefined2)uVar13;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0xe0))
            ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_290,
             &local_28a,&local_1c8);
  if (plVar11 == (longlong *)0x0) {
    return;
  }
  if (plVar11 != local_268) {
LAB_14016ff0a:
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
  LOCK();
  plVar11 = plVar11 + 1;
  *(int *)plVar11 = (int)*plVar11 + -1;
  iVar7 = (int)*plVar11;
  UNLOCK();
LAB_14016ff2d:
  if (iVar7 == 0) {
    pvVar2 = (void *)*local_270;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_270);
  }
  return;
}



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

{
  int iVar1;
  undefined4 uVar2;
  void *pvVar3;
  undefined8 *puVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined4 *puVar8;
  ulonglong *puVar9;
  longlong lVar10;
  longlong *plVar11;
  longlong *plVar12;
  longlong *plVar13;
  bool bVar14;
  undefined4 local_res18 [2];
  undefined8 in_stack_fffffffffffffcd8;
  uint uVar15;
  undefined8 in_stack_fffffffffffffce0;
  uint uVar18;
  undefined4 *puVar16;
  undefined4 uVar19;
  ulonglong uVar17;
  undefined8 in_stack_fffffffffffffce8;
  uint uVar21;
  ulonglong *puVar20;
  undefined8 in_stack_fffffffffffffcf0;
  uint uVar23;
  longlong lVar22;
  undefined4 uVar24;
  undefined8 in_stack_fffffffffffffcf8;
  uint uVar28;
  longlong lVar25;
  ulonglong *puVar26;
  undefined4 uVar29;
  ulonglong uVar27;
  int local_2f8;
  undefined2 local_2f4;
  undefined2 local_2f2;
  undefined2 local_2f0;
  undefined2 local_2ee [3];
  undefined4 local_2e8;
  undefined4 local_2e4;
  undefined4 local_2e0;
  undefined4 local_2dc;
  longlong *local_2d8;
  longlong *local_2d0;
  longlong *local_2c8;
  longlong *local_2c0;
  undefined4 local_2b8 [2];
  undefined4 local_2b0 [2];
  undefined4 local_2a8;
  undefined4 uStack_2a4;
  undefined4 local_2a0;
  undefined4 uStack_29c;
  undefined4 local_298;
  undefined4 local_294;
  undefined4 local_290;
  undefined4 local_28c;
  undefined4 local_288;
  undefined4 local_284;
  undefined4 local_280;
  undefined4 local_27c;
  undefined4 local_278;
  undefined4 local_274;
  undefined4 local_270;
  undefined4 local_26c;
  ulonglong local_268;
  ulonglong uStack_260;
  undefined8 local_258;
  ulonglong local_248;
  ulonglong uStack_240;
  undefined2 local_232;
  short local_22c;
  undefined4 local_1a0;
  undefined1 local_198 [16];
  undefined1 local_188 [168];
  undefined4 local_e0;
  undefined1 local_d8 [176];
  
  uVar15 = (uint)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20);
  uVar18 = (uint)((ulonglong)in_stack_fffffffffffffce0 >> 0x20);
  uVar21 = (uint)((ulonglong)in_stack_fffffffffffffce8 >> 0x20);
  uVar23 = (uint)((ulonglong)in_stack_fffffffffffffcf0 >> 0x20);
  uVar28 = (uint)((ulonglong)in_stack_fffffffffffffcf8 >> 0x20);
  local_258 = 0xfffffffffffffffe;
  local_2b8[0] = 0x10;
  local_res18[0] = param_3;
  FUN_14000a170(&local_248);
  iVar7 = param_5;
  local_1a0 = 0;
  lVar25 = (ulonglong)uVar28 << 0x20;
  lVar22 = (ulonglong)uVar23 << 0x20;
  puVar20 = (ulonglong *)((ulonglong)uVar21 << 0x20);
  lVar10 = (ulonglong)uVar18 << 0x20;
  FUN_1401aac30(3,&local_248,param_4,param_5,(ulonglong)uVar15 << 0x20,lVar10,puVar20,lVar22,lVar25,
                0);
  uVar19 = (undefined4)((ulonglong)lVar10 >> 0x20);
  uVar24 = (undefined4)((ulonglong)lVar22 >> 0x20);
  uVar29 = (undefined4)((ulonglong)lVar25 >> 0x20);
  local_2f8 = -1;
  local_2e8 = 0;
  local_2e4 = 0;
  local_2e0 = 0;
  local_2dc = 0;
  FUN_140198570(param_2,&local_2c8);
  plVar13 = local_2c0;
  plVar12 = local_2c8;
  if (local_2c8 != (longlong *)0x0) {
    if (local_2c8 == local_2c0) {
      if ((*local_2c8 != 0) &&
         (plVar11 = (longlong *)FUN_140208860(*local_2c8,local_res18[0]), plVar11 != (longlong *)0x0
         )) {
        puVar8 = (undefined4 *)(**(code **)(*plVar11 + 0x280))(plVar11);
        local_2e8 = *puVar8;
        local_2e4 = puVar8[1];
        local_2e0 = puVar8[2];
        local_2dc = puVar8[3];
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar14 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  local_268 = local_248;
  uStack_260 = uStack_240;
  memcpy(local_d8,&local_248,0xac);
  puVar9 = (ulonglong *)FUN_1401b5940(param_2,local_198,local_res18[0],local_d8,&local_2f8);
  iVar5 = local_2f8;
  local_2a8 = (undefined4)*puVar9;
  uStack_2a4 = *(undefined4 *)((longlong)puVar9 + 4);
  puVar26 = puVar9 + 1;
  local_2a0 = (undefined4)*puVar26;
  uStack_29c = *(undefined4 *)((longlong)puVar9 + 0xc);
  if ((*puVar9 == 0) && (*puVar26 == 0)) {
    bVar14 = false;
  }
  else {
    bVar14 = true;
  }
  if (bVar14) {
    bVar14 = *puVar9 < local_268;
    if ((*puVar9 == local_268) && (bVar14 = *puVar26 < uStack_260, *puVar26 == uStack_260)) {
      iVar6 = 0;
    }
    else {
      iVar6 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
    }
    iVar1 = *(int *)(param_2 + 0x284);
    uVar2 = *(undefined4 *)(param_2 + 0x160);
    if (iVar6 == 0) {
      local_232 = (undefined2)local_2f8;
      local_284 = *(undefined4 *)(param_2 + 0x164);
      local_280 = *(undefined4 *)(param_2 + 0x168);
      local_27c = *(undefined4 *)(param_2 + 0x16c);
      local_2b0[0] = *(undefined4 *)(param_2 + 8);
      local_288 = uVar2;
      if (((-1 < iVar1) && (iVar1 < *(short *)(param_1 + 700))) &&
         (*(longlong *)(param_1 + 0x4c0) != 0)) {
        plVar11 = (longlong *)
                  (*(longlong *)
                    (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
        puVar8 = local_2b8;
        puVar20 = (ulonglong *)&local_288;
        puVar16 = &local_2e8;
        puVar26 = &local_248;
        local_2ee[0] = (short)iVar1;
        (**(code **)(*plVar11 + 0xb80))
                  (plVar11,1,&DAT_1405d85a0,local_2ee,local_2b0,puVar16,puVar20,puVar8,&local_248);
        uVar19 = (undefined4)((ulonglong)puVar16 >> 0x20);
        uVar24 = (undefined4)((ulonglong)puVar8 >> 0x20);
        uVar29 = (undefined4)((ulonglong)puVar26 >> 0x20);
      }
      FUN_140197b70(param_2,&local_2d8);
      plVar11 = local_2d8;
      if (plVar12 != (longlong *)0x0) {
        if (plVar12 == plVar13) {
          if ((*plVar12 != 0) && (local_2d8 != (longlong *)0x0)) {
            if (local_2d8 == local_2d0) {
              if (*local_2d8 != 0) {
                uVar27 = CONCAT44(uVar29,(int)local_22c);
                uVar17 = CONCAT44(uVar19,param_5);
                FUN_140203700(param_1,0x1c6,0x29,param_2,&local_248,uVar17,
                              (ulonglong)puVar20 & 0xffffffff00000000,
                              CONCAT44(uVar24,local_22c - param_5),uVar27);
                FUN_1402024f0(param_1,param_2,&local_248,0x193,0x50,uVar17 & 0xffffffff00000000,
                              *(undefined4 *)(*plVar11 + 0x50a0),*(undefined4 *)(*plVar11 + 0x50a0),
                              uVar27 & 0xffffffff00000000,0);
              }
            }
            else {
              iVar7 = DAT_140608048 + 1;
              bVar14 = DAT_140608048 == 0;
              DAT_140608048 = iVar7;
              if (bVar14) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else {
          iVar7 = DAT_14060804c + 1;
          bVar14 = DAT_14060804c == 0;
          DAT_14060804c = iVar7;
          if (bVar14) {
            FUN_140176d60(1);
          }
        }
      }
      if (plVar11 != (longlong *)0x0) {
        if (plVar11 == local_2d0) {
          LOCK();
          plVar11 = plVar11 + 1;
          *(int *)plVar11 = (int)*plVar11 + -1;
          UNLOCK();
          plVar12 = local_2c8;
          plVar13 = local_2c0;
          iVar5 = local_2f8;
          if ((int)*plVar11 == 0) {
            pvVar3 = (void *)*local_2d8;
            if (pvVar3 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar3 + 0xf630);
              operator_delete(pvVar3);
            }
            operator_delete(local_2d8);
            plVar12 = local_2c8;
            plVar13 = local_2c0;
            iVar5 = local_2f8;
          }
        }
        else {
          iVar7 = DAT_140608050 + 1;
          bVar14 = DAT_140608050 == 0;
          DAT_140608050 = iVar7;
          if (bVar14) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      local_294 = *(undefined4 *)(param_2 + 0x164);
      local_290 = *(undefined4 *)(param_2 + 0x168);
      local_28c = *(undefined4 *)(param_2 + 0x16c);
      local_298 = uVar2;
      if (((-1 < iVar1) && (iVar1 < *(short *)(param_1 + 700))) &&
         (*(longlong *)(param_1 + 0x4c0) != 0)) {
        param_5 = CONCAT22(param_5._2_2_,(short)iVar1);
        plVar11 = (longlong *)
                  (*(longlong *)
                    (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
        puVar8 = &local_298;
        puVar20 = &local_248;
        (**(code **)(*plVar11 + 0xc00))
                  (plVar11,1,&DAT_1405d85a0,&param_5,&local_2e8,puVar8,&local_248);
        uVar19 = (undefined4)((ulonglong)puVar8 >> 0x20);
      }
      FUN_140203700(param_1,0x1c6,0x29,param_2,&local_248,CONCAT44(uVar19,iVar7),
                    (ulonglong)puVar20 & 0xffffffff00000000,CONCAT44(uVar24,local_22c - iVar7),
                    CONCAT44(uVar29,(int)local_22c));
      iVar5 = local_2f8;
    }
    if (-1 < iVar5) {
      FUN_14000a170(local_188);
      local_e0 = 0;
      lVar10 = FUN_1401b5430(param_2,local_res18[0]);
      if (lVar10 != 0) {
        if ((iVar5 < 0x18) && (iVar5 < (int)(uint)*(byte *)(lVar10 + 0x2041))) {
          lVar10 = ((longlong)iVar5 + 0x18) * 0xac + lVar10;
          iVar7 = FUN_14011b180(lVar10);
          if (iVar7 == 0) {
            FUN_140090020(local_188,lVar10);
          }
        }
        local_278 = *(undefined4 *)(param_2 + 0x160);
        local_274 = *(undefined4 *)(param_2 + 0x164);
        local_270 = *(undefined4 *)(param_2 + 0x168);
        local_26c = *(undefined4 *)(param_2 + 0x16c);
        iVar7 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar7) && (iVar7 < *(short *)(param_1 + 700))) &&
           (*(longlong *)(param_1 + 0x4c0) != 0)) {
          local_2f0 = (undefined2)iVar7;
          plVar11 = (longlong *)
                    (*(longlong *)
                      (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                      (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar11 + 0xc00))
                    (plVar11,1,&DAT_1405d85a0,&local_2f0,&local_2e8,&local_278,local_188);
        }
        local_2f4 = (short)iVar5;
        (**(code **)(*(longlong *)(param_1 + 0x78) + 0xa70))
                  ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                   &DAT_14047baa4,&local_2e8,local_res18,&local_2f4,local_188);
      }
    }
    local_2f2 = (short)iVar5;
    (**(code **)(*(longlong *)(param_1 + 0x78) + 0xa70))
              ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
               &DAT_14047baa4,&local_2e8,local_res18,&local_2f2,&local_248);
  }
  if (plVar12 != (longlong *)0x0) {
    if (plVar12 == plVar13) {
      LOCK();
      plVar12 = plVar12 + 1;
      *(int *)plVar12 = (int)*plVar12 + -1;
      UNLOCK();
      if ((int)*plVar12 == 0) {
        puVar4 = (undefined8 *)*local_2c8;
        if (puVar4 != (undefined8 *)0x0) {
          (**(code **)*puVar4)(puVar4,1);
        }
        operator_delete(local_2c8);
      }
    }
    else {
      iVar7 = DAT_140608054 + 1;
      bVar14 = DAT_140608054 == 0;
      DAT_140608054 = iVar7;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



void FUN_140170690(longlong param_1,longlong param_2,int param_3,undefined4 *param_4)

{
  short sVar1;
  undefined8 *puVar2;
  void *pvVar3;
  char cVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  undefined4 uVar8;
  uint uVar9;
  undefined4 uVar10;
  undefined8 uVar11;
  longlong lVar12;
  undefined4 *puVar13;
  size_t sVar14;
  longlong *plVar15;
  longlong *plVar16;
  wchar_t *pwVar17;
  ulonglong uVar18;
  undefined2 uVar19;
  longlong *plVar20;
  bool bVar21;
  undefined2 local_res18 [4];
  longlong *local_res20;
  undefined8 in_stack_fffffffffffffd18;
  undefined4 *puVar22;
  undefined2 *puVar23;
  undefined4 *in_stack_fffffffffffffd20;
  undefined8 in_stack_fffffffffffffd28;
  undefined4 uVar24;
  undefined8 in_stack_fffffffffffffd30;
  undefined4 uVar26;
  undefined8 uVar25;
  longlong *in_stack_fffffffffffffd38;
  undefined4 uVar27;
  uint local_2b8;
  uint local_2b4;
  int local_2b0 [2];
  longlong *local_2a8;
  longlong *local_2a0;
  int local_298;
  undefined2 local_294;
  undefined2 local_292;
  undefined4 local_290 [2];
  longlong *local_288;
  longlong *local_280;
  undefined4 local_278;
  undefined4 local_274;
  undefined4 local_270;
  undefined4 local_26c;
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined4 local_258;
  undefined4 local_254;
  undefined4 local_250;
  undefined4 local_24c;
  undefined4 local_248;
  undefined4 local_244;
  undefined4 local_240;
  undefined4 local_23c;
  longlong *local_238;
  longlong *local_230;
  undefined8 local_228;
  longlong local_218;
  longlong local_210;
  undefined2 local_204;
  undefined2 local_202;
  uint local_200;
  short local_1fc;
  undefined4 local_170;
  undefined1 local_168 [8];
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  wchar_t local_140 [48];
  undefined4 local_e0;
  undefined4 local_dc;
  int local_d8;
  undefined4 local_d4;
  char local_d0 [104];
  undefined1 local_68 [16];
  undefined1 local_58 [16];
  undefined1 local_48 [16];
  
  uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffd28 >> 0x20);
  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffd30 >> 0x20);
  uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffd18 >> 0x20);
  local_228 = 0xfffffffffffffffe;
  sVar1 = *(short *)(param_4 + 7);
  local_298 = sVar1 * param_3;
  uVar11 = FUN_140137690();
  uVar5 = FUN_140136b30(uVar11,param_4[6]);
  local_2b8 = uVar5;
  iVar6 = FUN_140199700(param_2,sVar1 * param_3);
  if (iVar6 == 0) {
    return;
  }
  FUN_140197b70(param_2,&local_2a8);
  plVar20 = local_2a8;
  if (local_2a8 != (longlong *)0x0) {
    if (local_2a8 == local_2a0) {
      if (*local_2a8 != 0) {
        local_2b0[0] = -1;
        lVar12 = FUN_140174f00(&local_2a8);
        if (uVar5 == 5) {
          iVar7 = FUN_1401e8610(lVar12);
          *(int *)(lVar12 + 0x50a4) = iVar7;
          iVar6 = -1;
          if (iVar7 < 0) goto LAB_140170f65;
        }
        else {
          local_2b0[0] = -1;
          if (((int)uVar5 < 0) ||
             (iVar7 = FUN_1401eeb60(lVar12,&local_2b8,param_4,local_2b0), iVar6 = local_2b0[0],
             iVar7 == 0)) goto LAB_140170f65;
        }
        puVar13 = (undefined4 *)FUN_140357570(local_58);
        *param_4 = *puVar13;
        param_4[1] = puVar13[1];
        param_4[2] = puVar13[2];
        param_4[3] = puVar13[3];
        if ((uVar5 == 1) && (param_4[0x28] == 0)) {
          uVar11 = FUN_140137690();
          uVar8 = FUN_140136bb0(uVar11,param_4[6]);
          param_4[9] = uVar8;
        }
        if (param_4[0x1a] == 0) {
          uVar11 = FUN_140137690();
          uVar8 = FUN_140136ad0(uVar11,param_4[6]);
          param_4[0x1a] = uVar8;
        }
        local_2b4 = 0xffffffff;
        FUN_14000a170(&local_218);
        local_170 = 0;
        uVar11 = FUN_140174f00(&local_2a8);
        uVar19 = (undefined2)uVar5;
        if (uVar5 == 5) {
          FUN_1401e8ba0(uVar11,local_68,param_4,&local_2b4);
          uVar11 = FUN_140174f00(&local_2a8);
          FUN_1401ecc20(uVar11,&local_2b4,&local_218);
          uVar9 = local_2b4;
        }
        else {
          if (iVar6 == -1) {
            if ((int)uVar5 < 0) {
LAB_1401708ca:
              uVar9 = 0xffffffff;
            }
            else {
              uVar9 = FUN_1401e8350(uVar11,&local_2b8,param_4,local_48);
            }
          }
          else {
            if ((int)uVar5 < 0) goto LAB_1401708ca;
            puVar13 = param_4;
            uVar9 = FUN_1401e8130(uVar11,param_2,&local_2b8,local_2b0,param_4);
            uVar10 = (undefined4)((ulonglong)puVar13 >> 0x20);
          }
          local_2b4 = uVar9;
          lVar12 = FUN_140174f00(&local_2a8);
          if ((uVar5 < 5) && (uVar9 < 0x18)) {
            lVar12 = ((longlong)(int)uVar9 + (longlong)(int)uVar5 * 0x18) * 0xac + lVar12;
            *(undefined2 *)(lVar12 + 0x14) = uVar19;
            *(short *)(lVar12 + 0x16) = (short)uVar9;
            FUN_140090020(&local_218);
          }
        }
        uVar27 = (undefined4)((ulonglong)in_stack_fffffffffffffd38 >> 0x20);
        local_292 = (undefined2)uVar9;
        uVar8 = *(undefined4 *)(param_2 + 0x160);
        if (local_2b0[0] == -1) {
          local_274 = *(undefined4 *)(param_2 + 0x164);
          local_270 = *(undefined4 *)(param_2 + 0x168);
          local_26c = *(undefined4 *)(param_2 + 0x16c);
          local_268 = *(undefined4 *)(param_2 + 0x170);
          local_264 = *(undefined4 *)(param_2 + 0x174);
          local_260 = *(undefined4 *)(param_2 + 0x178);
          local_25c = *(undefined4 *)(param_2 + 0x17c);
          iVar6 = *(int *)(param_2 + 0x284);
          local_290[0] = *(undefined4 *)(param_2 + 8);
          local_278 = uVar8;
          local_204 = uVar19;
          local_202 = local_292;
          if ((-1 < iVar6) && (iVar6 < *(short *)(param_1 + 700))) {
            if ((local_218 == 0) && (local_210 == 0)) {
              bVar21 = false;
            }
            else {
              bVar21 = true;
            }
            if (((bVar21) && (local_200 != 0)) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
              local_res18[0] = (undefined2)iVar6;
              plVar15 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                          (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
              in_stack_fffffffffffffd38 = &local_218;
              uVar26 = 1;
              puVar13 = &local_278;
              in_stack_fffffffffffffd20 = &local_268;
              puVar22 = local_290;
              (**(code **)(*plVar15 + 0xb0))
                        (plVar15,1,&DAT_1405d85a0,local_res18,puVar22,in_stack_fffffffffffffd20,
                         puVar13,&DAT_14047ba94,in_stack_fffffffffffffd38);
              uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
              uVar10 = (undefined4)((ulonglong)puVar22 >> 0x20);
            }
          }
          FUN_140198570(param_2,&local_288);
          plVar15 = local_288;
          uVar27 = (undefined4)((ulonglong)in_stack_fffffffffffffd38 >> 0x20);
          local_res20 = local_288;
          if (local_288 != (longlong *)0x0) {
            if (local_288 == local_280) {
              if (*local_288 != 0) {
                lVar12 = FUN_140174f00(&local_2a8);
                uVar8 = *(undefined4 *)(lVar12 + 0x50a0);
                lVar12 = FUN_140174f00(&local_2a8);
                uVar18 = (ulonglong)in_stack_fffffffffffffd38 & 0xffffffff00000000;
                uVar25 = CONCAT44(uVar26,uVar8);
                uVar11 = CONCAT44(uVar24,*(undefined4 *)(lVar12 + 0x50a0));
                FUN_1402024f0(param_1,param_2,&local_218,0x191,CONCAT44(uVar10,0x20),
                              (ulonglong)in_stack_fffffffffffffd20 & 0xffffffff00000000,uVar11,
                              uVar25,uVar18,0);
                uVar24 = (undefined4)((ulonglong)uVar11 >> 0x20);
                uVar26 = (undefined4)((ulonglong)uVar25 >> 0x20);
                uVar27 = (undefined4)(uVar18 >> 0x20);
                plVar15 = local_res20;
              }
            }
            else {
              iVar6 = DAT_14060804c + 1;
              bVar21 = DAT_14060804c == 0;
              DAT_14060804c = iVar6;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          if (plVar15 != (longlong *)0x0) {
            if (plVar15 == local_280) {
              LOCK();
              plVar15 = plVar15 + 1;
              *(int *)plVar15 = (int)*plVar15 + -1;
              UNLOCK();
              if ((int)*plVar15 == 0) {
                puVar2 = (undefined8 *)*local_288;
                if (puVar2 != (undefined8 *)0x0) {
                  (**(code **)*puVar2)(puVar2,1);
                }
                operator_delete(local_288);
              }
              plVar20 = local_2a8;
              uVar5 = local_2b8;
              local_292 = (short)local_2b4;
            }
            else {
              iVar6 = DAT_140608054 + 1;
              bVar21 = DAT_140608054 == 0;
              DAT_140608054 = iVar6;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else {
          local_244 = *(undefined4 *)(param_2 + 0x164);
          local_240 = *(undefined4 *)(param_2 + 0x168);
          local_23c = *(undefined4 *)(param_2 + 0x16c);
          local_258 = *(undefined4 *)(param_2 + 0x170);
          local_254 = *(undefined4 *)(param_2 + 0x174);
          local_250 = *(undefined4 *)(param_2 + 0x178);
          local_24c = *(undefined4 *)(param_2 + 0x17c);
          iVar6 = *(int *)(param_2 + 0x284);
          local_248 = uVar8;
          if (((-1 < iVar6) && (iVar6 < *(short *)(param_1 + 700))) &&
             (*(longlong *)(param_1 + 0x4c0) != 0)) {
            local_res20 = (longlong *)CONCAT62(local_res20._2_6_,(short)iVar6);
            plVar16 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                        (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            plVar15 = &local_218;
            (**(code **)(*plVar16 + 0x140))
                      (plVar16,1,&DAT_1405d85a0,&local_res20,&local_258,&local_248,plVar15);
            uVar24 = (undefined4)((ulonglong)plVar15 >> 0x20);
          }
        }
        local_294 = (undefined2)uVar5;
        plVar15 = &local_218;
        puVar23 = &local_292;
        (**(code **)(*(longlong *)(param_1 + 0x78) + 0xe0))
                  ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                   &local_294,puVar23,plVar15);
        uVar10 = (undefined4)((ulonglong)puVar23 >> 0x20);
        if (0 < local_298) {
          FUN_140198570(param_2,&local_238);
          FUN_14011f210(local_168);
          plVar16 = local_238;
          local_160 = *(undefined4 *)(param_2 + 0x160);
          local_15c = *(undefined4 *)(param_2 + 0x164);
          local_158 = *(undefined4 *)(param_2 + 0x168);
          local_154 = *(undefined4 *)(param_2 + 0x16c);
          local_150 = *(undefined4 *)(param_2 + 0x170);
          local_14c = *(undefined4 *)(param_2 + 0x174);
          local_148 = *(undefined4 *)(param_2 + 0x178);
          local_144 = *(undefined4 *)(param_2 + 0x17c);
          if (local_238 != (longlong *)0x0) {
            if (local_238 == local_230) {
              lVar12 = *local_238;
              if (lVar12 != 0) {
                pwVar17 = (wchar_t *)(lVar12 + 0xd0);
                if (7 < *(ulonglong *)(lVar12 + 0xe8)) {
                  pwVar17 = *(wchar_t **)pwVar17;
                }
                sVar14 = wcsnlen(pwVar17,0x10);
                if (sVar14 < 0x10) {
                  pwVar17 = (wchar_t *)(*plVar16 + 0xd0);
                  if (7 < *(ulonglong *)(*plVar16 + 0xe8)) {
                    pwVar17 = *(wchar_t **)pwVar17;
                  }
                  wcscpy_s(local_140,0x10,pwVar17);
                }
              }
            }
            else {
              iVar6 = DAT_14060804c + 1;
              bVar21 = DAT_14060804c == 0;
              DAT_14060804c = iVar6;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          strcpy_s(local_d0,0x32,(char *)(param_2 + 0x330));
          local_e0 = 3;
          lVar12 = FUN_140174f00(&local_2a8);
          local_dc = *(undefined4 *)(lVar12 + 0x50a0);
          local_d8 = local_298;
          FUN_140197b90(param_2,-local_298);
          lVar12 = FUN_140174f00(&local_2a8);
          local_d4 = *(undefined4 *)(lVar12 + 0x50a0);
          FUN_1401fe560(param_1,*(undefined4 *)(param_2 + 0x288),*(undefined4 *)(param_2 + 0x284),
                        local_168);
          lVar12 = FUN_140174f00(&local_2a8);
          FUN_1402024f0(param_1,param_2,0,0x196,CONCAT44(uVar10,0x20),
                        (ulonglong)plVar15 & 0xffffffff00000000,CONCAT44(uVar24,local_dc),
                        CONCAT44(uVar26,*(undefined4 *)(lVar12 + 0x50a0)),CONCAT44(uVar27,local_298)
                        ,0);
          FUN_140203700(param_1,0x19a,1,param_2,param_4,(int)*(short *)(param_4 + 7),local_298,
                        (int)local_1fc - (int)*(short *)(param_4 + 7),(int)local_1fc);
          if (plVar16 != (longlong *)0x0) {
            if (plVar16 == local_230) {
              LOCK();
              plVar16 = plVar16 + 1;
              *(int *)plVar16 = (int)*plVar16 + -1;
              UNLOCK();
              plVar20 = local_2a8;
              uVar5 = local_2b8;
              if ((int)*plVar16 == 0) {
                puVar2 = (undefined8 *)*local_238;
                if (puVar2 != (undefined8 *)0x0) {
                  (**(code **)*puVar2)(puVar2,1);
                }
                operator_delete(local_238);
                plVar20 = local_2a8;
                uVar5 = local_2b8;
              }
            }
            else {
              iVar6 = DAT_140608054 + 1;
              bVar21 = DAT_140608054 == 0;
              DAT_140608054 = iVar6;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
        }
        uVar11 = FUN_140137690();
        uVar10 = FUN_1401374e0(uVar11,local_200);
        uVar11 = FUN_1402e0270();
        uVar18 = (ulonglong)local_200;
        cVar4 = FUN_1402df630(uVar11,uVar18);
        if (cVar4 == '\0') {
          uVar11 = FUN_1402e0270();
          cVar4 = FUN_1402df680(uVar11,uVar10);
          if (cVar4 == '\0') goto LAB_140170f65;
          uVar18 = (ulonglong)local_200;
        }
        if ((((uVar5 == 1) || (uVar5 == 2)) || (uVar5 == 3)) || ((uVar5 == 4 || (uVar5 == 5)))) {
          FUN_1401a8bb0(param_2,uVar18 & 0xffffffff);
        }
        goto LAB_140170f65;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar21 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar20 == (longlong *)0x0) {
    return;
  }
  if (plVar20 != local_2a0) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_140170f65:
  LOCK();
  plVar20 = plVar20 + 1;
  *(int *)plVar20 = (int)*plVar20 + -1;
  UNLOCK();
  if ((int)*plVar20 == 0) {
    pvVar3 = (void *)*local_2a8;
    if (pvVar3 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar3 + 0xf630);
      operator_delete(pvVar3);
    }
    operator_delete(local_2a8);
  }
  return;
}



void FUN_140170fc0(longlong param_1,longlong param_2,uint param_3,int param_4,int param_5)

{
  undefined4 uVar1;
  undefined8 *puVar2;
  void *pvVar3;
  char cVar4;
  uint uVar5;
  int iVar6;
  uint uVar7;
  undefined4 uVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined4 *puVar11;
  size_t sVar12;
  longlong *plVar13;
  wchar_t *pwVar14;
  uint *puVar15;
  undefined2 uVar16;
  ulonglong uVar17;
  int iVar18;
  longlong *plVar19;
  bool bVar20;
  undefined2 local_res18 [4];
  int local_res20;
  undefined8 in_stack_fffffffffffffc58;
  undefined4 *puVar21;
  undefined4 *in_stack_fffffffffffffc60;
  longlong *plVar22;
  undefined8 in_stack_fffffffffffffc68;
  undefined4 uVar23;
  undefined8 in_stack_fffffffffffffc70;
  undefined8 uVar24;
  undefined4 uVar25;
  undefined8 in_stack_fffffffffffffc78;
  undefined8 uVar26;
  undefined4 uVar27;
  uint local_378;
  uint local_374;
  int local_370;
  longlong *local_368;
  longlong *local_360;
  int local_358;
  undefined2 local_354;
  undefined2 local_352;
  undefined4 local_350 [2];
  longlong *local_348;
  longlong *local_340;
  longlong *local_338;
  longlong *local_330;
  undefined4 local_328;
  undefined4 local_324;
  undefined4 local_320;
  undefined4 local_31c;
  undefined4 local_318;
  undefined4 local_314;
  undefined4 local_310;
  undefined4 local_30c;
  undefined4 local_308;
  undefined4 local_304;
  undefined4 local_300;
  undefined4 local_2fc;
  undefined4 local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  undefined4 local_2ec;
  longlong *local_2e8;
  longlong *local_2e0;
  undefined8 local_2d8;
  longlong local_2c8;
  longlong local_2c0;
  undefined2 local_2b4;
  undefined2 local_2b2;
  uint local_2b0;
  short local_2ac;
  undefined4 local_220;
  undefined4 local_218;
  undefined4 uStack_214;
  undefined4 uStack_210;
  undefined4 uStack_20c;
  uint local_200;
  undefined2 local_1fc;
  undefined4 local_1f4;
  undefined4 local_1b0;
  undefined2 local_182;
  undefined4 local_170;
  undefined1 local_168 [8];
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  wchar_t local_140 [48];
  undefined4 local_e0;
  undefined4 local_dc;
  int local_d8;
  undefined4 local_d4;
  char local_d0 [104];
  undefined1 local_68 [16];
  undefined1 local_58 [16];
  undefined1 local_48 [16];
  
  uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffc68 >> 0x20);
  uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffffc70 >> 0x20);
  uVar27 = (undefined4)((ulonglong)in_stack_fffffffffffffc78 >> 0x20);
  uVar8 = (undefined4)((ulonglong)in_stack_fffffffffffffc58 >> 0x20);
  local_2d8 = 0xfffffffffffffffe;
  iVar18 = param_4 * param_5;
  local_res20 = param_4;
  local_370 = iVar18;
  uVar9 = FUN_140137690();
  uVar5 = FUN_140136b30(uVar9);
  local_378 = uVar5;
  lVar10 = FUN_140137690();
  if (*(longlong *)(lVar10 + 0x88) != 0) {
    for (puVar15 = *(uint **)(*(longlong *)(lVar10 + 0x88) +
                             ((ulonglong)param_3 % (ulonglong)*(uint *)(lVar10 + 0x98)) * 8);
        puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0xa6)) {
      if ((puVar15[0xa8] == param_3) && (*puVar15 == param_3)) {
        if (puVar15 != (uint *)0x0) goto LAB_140171068;
        break;
      }
    }
  }
  puVar15 = (uint *)0x0;
LAB_140171068:
  if (puVar15 != (uint *)0x0) {
    if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    if (puVar15[0x46] == 0x25) {
      FUN_140198570(param_2,&local_338);
      plVar19 = local_338;
      if (local_338 == (longlong *)0x0) {
LAB_140171178:
        if (plVar19 == (longlong *)0x0) {
          return;
        }
        if (plVar19 != local_330) {
          if (DAT_140608054 != 0) {
            DAT_140608054 = DAT_140608054 + 1;
            return;
          }
          DAT_140608054 = DAT_140608054 + 1;
          FUN_140176d60(1);
          return;
        }
      }
      else {
        if (local_338 != local_330) {
          iVar18 = DAT_14060804c + 1;
          bVar20 = DAT_14060804c == 0;
          DAT_14060804c = iVar18;
          if (bVar20) {
            FUN_140176d60(1);
          }
          goto LAB_140171178;
        }
        lVar10 = *local_338;
        if (lVar10 == 0) goto LAB_140171178;
        bVar20 = *(float *)(lVar10 + 0x2294) == 0.0;
        if ((0x12 < bVar20 - 1) ||
           (*(float *)(lVar10 + 0x2280 + (longlong)(int)(uint)bVar20 * 4) == 0.0)) {
          LOCK();
          plVar19 = local_338 + 1;
          *(int *)plVar19 = (int)*plVar19 + -1;
          UNLOCK();
          uVar5 = local_378;
          if ((int)*plVar19 == 0) {
            puVar2 = (undefined8 *)*local_338;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
            }
            operator_delete(local_338);
            uVar5 = local_378;
          }
          goto LAB_1401711aa;
        }
      }
      LOCK();
      plVar19 = plVar19 + 1;
      *(int *)plVar19 = (int)*plVar19 + -1;
      UNLOCK();
      if ((int)*plVar19 != 0) {
        return;
      }
      puVar2 = (undefined8 *)*local_338;
      local_368 = local_338;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      goto LAB_140171a96;
    }
  }
LAB_1401711aa:
  iVar18 = FUN_140199700(param_2,iVar18);
  if (iVar18 == 0) {
    return;
  }
  FUN_140197b70(param_2,&local_368);
  plVar19 = local_368;
  if (local_368 == (longlong *)0x0) {
LAB_140171a42:
    if (plVar19 == (longlong *)0x0) {
      return;
    }
    if (plVar19 != local_360) {
      if (DAT_140608050 != 0) {
        DAT_140608050 = DAT_140608050 + 1;
        return;
      }
      DAT_140608050 = DAT_140608050 + 1;
      FUN_140176d60(1);
      return;
    }
  }
  else {
    if (local_368 != local_360) {
      iVar18 = DAT_140608048 + 1;
      bVar20 = DAT_140608048 == 0;
      DAT_140608048 = iVar18;
      if (bVar20) {
        FUN_140176d60(1);
      }
      goto LAB_140171a42;
    }
    if (*local_368 == 0) goto LAB_140171a42;
    FUN_14000a170(&local_218);
    local_170 = 0;
    local_358 = -1;
    local_200 = param_3;
    local_1fc = (short)param_4;
    lVar10 = FUN_140174f00(&local_368);
    if (uVar5 == 5) {
      iVar6 = FUN_1401e8610(lVar10);
      *(int *)(lVar10 + 0x50a4) = iVar6;
      iVar18 = -1;
      if (-1 < iVar6) {
LAB_140171299:
        puVar11 = (undefined4 *)FUN_140357570(local_58);
        local_218 = *puVar11;
        uStack_214 = puVar11[1];
        uStack_210 = puVar11[2];
        uStack_20c = puVar11[3];
        local_182 = 7;
        uVar9 = FUN_140137690();
        local_1b0 = FUN_140136ad0(uVar9,param_3);
        if (uVar5 == 1) {
          uVar9 = FUN_140137690();
          local_1f4 = FUN_140136bb0(uVar9,param_3);
        }
        FUN_1401a40e0(&local_218);
        local_374 = 0xffffffff;
        FUN_14000a170(&local_2c8);
        local_220 = 0;
        uVar9 = FUN_140174f00(&local_368);
        uVar16 = (undefined2)uVar5;
        if (uVar5 == 5) {
          FUN_1401e8ba0(uVar9,local_48,&local_218,&local_374);
          uVar9 = FUN_140174f00(&local_368);
          FUN_1401ecc20(uVar9,&local_374,&local_2c8);
          uVar7 = local_374;
        }
        else {
          if (iVar18 == -1) {
            if ((int)uVar5 < 0) {
LAB_1401713b2:
              uVar7 = 0xffffffff;
            }
            else {
              uVar7 = FUN_1401e8350(uVar9,&local_378,&local_218,local_68);
            }
          }
          else {
            if ((int)uVar5 < 0) goto LAB_1401713b2;
            puVar11 = &local_218;
            uVar7 = FUN_1401e8130(uVar9,param_2,&local_378,&local_358,puVar11);
            uVar8 = (undefined4)((ulonglong)puVar11 >> 0x20);
          }
          local_374 = uVar7;
          lVar10 = FUN_140174f00(&local_368);
          if ((uVar5 < 5) && (uVar7 < 0x18)) {
            lVar10 = ((longlong)(int)uVar7 + (longlong)(int)uVar5 * 0x18) * 0xac + lVar10;
            *(undefined2 *)(lVar10 + 0x14) = uVar16;
            *(short *)(lVar10 + 0x16) = (short)uVar7;
            FUN_140090020(&local_2c8);
          }
        }
        local_354 = (undefined2)uVar7;
        uVar1 = *(undefined4 *)(param_2 + 0x160);
        if (iVar18 == -1) {
          local_324 = *(undefined4 *)(param_2 + 0x164);
          local_320 = *(undefined4 *)(param_2 + 0x168);
          local_31c = *(undefined4 *)(param_2 + 0x16c);
          local_318 = *(undefined4 *)(param_2 + 0x170);
          local_314 = *(undefined4 *)(param_2 + 0x174);
          local_310 = *(undefined4 *)(param_2 + 0x178);
          local_30c = *(undefined4 *)(param_2 + 0x17c);
          iVar18 = *(int *)(param_2 + 0x284);
          local_350[0] = *(undefined4 *)(param_2 + 8);
          local_328 = uVar1;
          local_2b4 = uVar16;
          local_2b2 = local_354;
          if ((-1 < iVar18) && (iVar18 < *(short *)(param_1 + 700))) {
            if ((local_2c8 == 0) && (local_2c0 == 0)) {
              bVar20 = false;
            }
            else {
              bVar20 = true;
            }
            if (((bVar20) && (local_2b0 != 0)) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
              param_5 = CONCAT22(param_5._2_2_,(short)iVar18);
              plVar13 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                          (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
              uVar25 = 1;
              puVar11 = &local_328;
              in_stack_fffffffffffffc60 = &local_318;
              puVar21 = local_350;
              plVar22 = &local_2c8;
              (**(code **)(*plVar13 + 0xb0))
                        (plVar13,1,&DAT_1405d85a0,&param_5,puVar21,in_stack_fffffffffffffc60,puVar11
                         ,&DAT_14047ba94,&local_2c8);
              uVar23 = (undefined4)((ulonglong)puVar11 >> 0x20);
              uVar27 = (undefined4)((ulonglong)plVar22 >> 0x20);
              uVar8 = (undefined4)((ulonglong)puVar21 >> 0x20);
            }
          }
          FUN_140198570(param_2,&local_348);
          plVar22 = local_348;
          if (local_348 != (longlong *)0x0) {
            if (local_348 == local_340) {
              if (*local_348 != 0) {
                lVar10 = FUN_140174f00(&local_368);
                uVar1 = *(undefined4 *)(lVar10 + 0x50a0);
                lVar10 = FUN_140174f00();
                uVar26 = CONCAT44(uVar27,local_370);
                uVar24 = CONCAT44(uVar25,uVar1);
                uVar9 = CONCAT44(uVar23,*(int *)(lVar10 + 0x50a0) + local_370);
                FUN_1402024f0(param_1,param_2,&local_2c8,0x191,CONCAT44(uVar8,0x20),
                              (ulonglong)in_stack_fffffffffffffc60 & 0xffffffff00000000,uVar9,uVar24
                              ,uVar26,0);
                uVar23 = (undefined4)((ulonglong)uVar9 >> 0x20);
                uVar25 = (undefined4)((ulonglong)uVar24 >> 0x20);
                uVar27 = (undefined4)((ulonglong)uVar26 >> 0x20);
              }
            }
            else {
              iVar18 = DAT_14060804c + 1;
              bVar20 = DAT_14060804c == 0;
              DAT_14060804c = iVar18;
              if (bVar20) {
                FUN_140176d60(1);
              }
            }
          }
          if (plVar22 != (longlong *)0x0) {
            if (plVar22 == local_340) {
              LOCK();
              plVar22 = plVar22 + 1;
              *(int *)plVar22 = (int)*plVar22 + -1;
              UNLOCK();
              if ((int)*plVar22 == 0) {
                puVar2 = (undefined8 *)*local_348;
                if (puVar2 != (undefined8 *)0x0) {
                  (**(code **)*puVar2)(puVar2,1);
                }
                operator_delete(local_348);
              }
              plVar19 = local_368;
              uVar5 = local_378;
              local_354 = (short)local_374;
            }
            else {
              iVar18 = DAT_140608054 + 1;
              bVar20 = DAT_140608054 == 0;
              DAT_140608054 = iVar18;
              if (bVar20) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else {
          local_2f4 = *(undefined4 *)(param_2 + 0x164);
          local_2f0 = *(undefined4 *)(param_2 + 0x168);
          local_2ec = *(undefined4 *)(param_2 + 0x16c);
          local_308 = *(undefined4 *)(param_2 + 0x170);
          local_304 = *(undefined4 *)(param_2 + 0x174);
          local_300 = *(undefined4 *)(param_2 + 0x178);
          local_2fc = *(undefined4 *)(param_2 + 0x17c);
          iVar18 = *(int *)(param_2 + 0x284);
          local_2f8 = uVar1;
          if (((-1 < iVar18) && (iVar18 < *(short *)(param_1 + 700))) &&
             (*(longlong *)(param_1 + 0x4c0) != 0)) {
            local_res18[0] = (undefined2)iVar18;
            plVar13 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                        (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            in_stack_fffffffffffffc60 = &local_2f8;
            puVar11 = &local_308;
            plVar22 = &local_2c8;
            (**(code **)(*plVar13 + 0x140))
                      (plVar13,1,&DAT_1405d85a0,local_res18,puVar11,in_stack_fffffffffffffc60,
                       &local_2c8);
            uVar8 = (undefined4)((ulonglong)puVar11 >> 0x20);
            uVar23 = (undefined4)((ulonglong)plVar22 >> 0x20);
          }
          lVar10 = FUN_140174f00(&local_368);
          uVar1 = *(undefined4 *)(lVar10 + 0x50a0);
          lVar10 = FUN_140174f00();
          uVar26 = CONCAT44(uVar27,local_370);
          uVar24 = CONCAT44(uVar25,uVar1);
          uVar9 = CONCAT44(uVar23,*(int *)(lVar10 + 0x50a0) + local_370);
          FUN_1402024f0(param_1,param_2,&local_2c8,0x191,CONCAT44(uVar8,0x20),
                        (ulonglong)in_stack_fffffffffffffc60 & 0xffffffff00000000,uVar9,uVar24,
                        uVar26,0);
          uVar23 = (undefined4)((ulonglong)uVar9 >> 0x20);
          uVar25 = (undefined4)((ulonglong)uVar24 >> 0x20);
          uVar27 = (undefined4)((ulonglong)uVar26 >> 0x20);
        }
        local_352 = (undefined2)uVar5;
        plVar22 = &local_2c8;
        (**(code **)(*(longlong *)(param_1 + 0x78) + 0xe0))
                  ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                   &local_352,&local_354,&local_2c8);
        uVar8 = (undefined4)((ulonglong)plVar22 >> 0x20);
        if (0 < local_370) {
          FUN_14011f210(local_168);
          local_160 = *(undefined4 *)(param_2 + 0x160);
          local_15c = *(undefined4 *)(param_2 + 0x164);
          local_158 = *(undefined4 *)(param_2 + 0x168);
          local_154 = *(undefined4 *)(param_2 + 0x16c);
          local_150 = *(undefined4 *)(param_2 + 0x170);
          local_14c = *(undefined4 *)(param_2 + 0x174);
          local_148 = *(undefined4 *)(param_2 + 0x178);
          local_144 = *(undefined4 *)(param_2 + 0x17c);
          FUN_140198570(param_2,&local_2e8);
          plVar22 = local_2e8;
          if (local_2e8 != (longlong *)0x0) {
            if (local_2e8 == local_2e0) {
              lVar10 = *local_2e8;
              if (lVar10 != 0) {
                pwVar14 = (wchar_t *)(lVar10 + 0xd0);
                if (7 < *(ulonglong *)(lVar10 + 0xe8)) {
                  pwVar14 = *(wchar_t **)pwVar14;
                }
                sVar12 = wcsnlen(pwVar14,0x10);
                if (sVar12 < 0x10) {
                  pwVar14 = (wchar_t *)(*plVar22 + 0xd0);
                  if (7 < *(ulonglong *)(*plVar22 + 0xe8)) {
                    pwVar14 = *(wchar_t **)pwVar14;
                  }
                  wcscpy_s(local_140,0x10,pwVar14);
                }
              }
            }
            else {
              iVar18 = DAT_14060804c + 1;
              bVar20 = DAT_14060804c == 0;
              DAT_14060804c = iVar18;
              if (bVar20) {
                FUN_140176d60(1);
              }
            }
          }
          strcpy_s(local_d0,0x32,(char *)(param_2 + 0x330));
          local_e0 = 3;
          lVar10 = FUN_140174f00(&local_368);
          local_dc = *(undefined4 *)(lVar10 + 0x50a0);
          local_d8 = local_370;
          FUN_140197b90(param_2,-local_370);
          lVar10 = FUN_140174f00(&local_368);
          local_d4 = *(undefined4 *)(lVar10 + 0x50a0);
          FUN_1401fe560(param_1,*(undefined4 *)(param_2 + 0x288),*(undefined4 *)(param_2 + 0x284),
                        local_168);
          FUN_140203700(param_1,0x19a,1,param_2,&local_2c8,CONCAT44(uVar8,local_res20),
                        CONCAT44(uVar23,local_370),CONCAT44(uVar25,local_2ac - local_res20),
                        CONCAT44(uVar27,(int)local_2ac));
          if (plVar22 != (longlong *)0x0) {
            if (plVar22 == local_2e0) {
              LOCK();
              plVar22 = plVar22 + 1;
              *(int *)plVar22 = (int)*plVar22 + -1;
              UNLOCK();
              plVar19 = local_368;
              uVar5 = local_378;
              if ((int)*plVar22 == 0) {
                puVar2 = (undefined8 *)*local_2e8;
                if (puVar2 != (undefined8 *)0x0) {
                  (**(code **)*puVar2)(puVar2,1);
                }
                operator_delete(local_2e8);
                plVar19 = local_368;
                uVar5 = local_378;
              }
            }
            else {
              iVar18 = DAT_140608054 + 1;
              bVar20 = DAT_140608054 == 0;
              DAT_140608054 = iVar18;
              if (bVar20) {
                FUN_140176d60(1);
              }
            }
          }
        }
        uVar9 = FUN_140137690();
        uVar8 = FUN_1401374e0(uVar9,local_2b0);
        uVar9 = FUN_1402e0270();
        uVar17 = (ulonglong)local_2b0;
        cVar4 = FUN_1402df630(uVar9,uVar17);
        if (cVar4 == '\0') {
          uVar9 = FUN_1402e0270();
          cVar4 = FUN_1402df680(uVar9,uVar8);
          if (cVar4 == '\0') goto LAB_140171a69;
          uVar17 = (ulonglong)local_2b0;
        }
        if ((((uVar5 == 1) || (uVar5 == 2)) || (uVar5 == 3)) || ((uVar5 == 4 || (uVar5 == 5)))) {
          FUN_1401a8bb0(param_2,uVar17 & 0xffffffff);
        }
      }
    }
    else {
      local_358 = -1;
      if ((-1 < (int)uVar5) &&
         (iVar6 = FUN_1401eeb60(lVar10,&local_378,&local_218,&local_358), iVar18 = local_358,
         iVar6 != 0)) goto LAB_140171299;
    }
  }
LAB_140171a69:
  LOCK();
  plVar19 = plVar19 + 1;
  *(int *)plVar19 = (int)*plVar19 + -1;
  UNLOCK();
  if ((int)*plVar19 != 0) {
    return;
  }
  pvVar3 = (void *)*local_368;
  if (pvVar3 != (void *)0x0) {
    FUN_14034edf0((longlong)pvVar3 + 0xf630);
    operator_delete(pvVar3);
  }
LAB_140171a96:
  operator_delete(local_368);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140171c71)
// WARNING: Removing unreachable block (ram,0x000140171cdf)

void FUN_140171ac0(longlong param_1,longlong param_2,uint param_3)

{
  int *piVar1;
  void *pvVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined4 uVar5;
  longlong *plVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  longlong lVar9;
  uint *puVar10;
  undefined4 *puVar11;
  undefined4 *puVar12;
  undefined4 *puVar13;
  longlong **pplVar14;
  uint uVar15;
  undefined4 *puVar16;
  longlong *plVar17;
  undefined4 *puVar18;
  bool bVar19;
  undefined4 *local_res10;
  uint local_res18 [2];
  undefined4 *local_res20;
  undefined8 in_stack_fffffffffffffef8;
  undefined4 local_d8;
  undefined4 local_d4;
  longlong *local_d0;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  longlong *local_b8;
  longlong *local_b0;
  undefined4 local_a8 [2];
  undefined4 *local_a0;
  undefined4 *local_98;
  undefined8 local_90;
  undefined8 *local_80;
  undefined8 *local_78;
  undefined4 *local_70;
  undefined4 *local_68;
  undefined8 local_60;
  undefined8 local_50;
  
  uVar5 = (undefined4)((ulonglong)in_stack_fffffffffffffef8 >> 0x20);
  if (param_2 == 0) {
    return;
  }
  local_50 = 0xfffffffffffffffe;
  local_res18[0] = param_3;
  FUN_140198570(param_2);
  plVar17 = local_b8;
  uVar15 = local_res18[0];
  local_d0 = local_b8;
  if (local_b8 == (longlong *)0x0) {
LAB_1401720aa:
    if (plVar17 == (longlong *)0x0) {
      return;
    }
    if (plVar17 != local_b0) {
      if (DAT_140608054 != 0) {
        DAT_140608054 = DAT_140608054 + 1;
        return;
      }
      DAT_140608054 = DAT_140608054 + 1;
      FUN_140176d60(1);
      return;
    }
  }
  else {
    if (local_b8 != local_b0) {
      iVar4 = DAT_14060804c + 1;
      bVar19 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar19) {
        FUN_140176d60(1);
      }
      goto LAB_1401720aa;
    }
    if (*local_b8 == 0) goto LAB_1401720aa;
    plVar6 = (longlong *)FUN_1402e8ff0();
    if (*plVar6 != 0) {
      for (puVar10 = *(uint **)(*plVar6 + ((ulonglong)uVar15 % (ulonglong)*(uint *)(plVar6 + 2)) * 8
                               ); puVar10 != (uint *)0x0; puVar10 = *(uint **)(puVar10 + 0x24)) {
        if ((puVar10[0x26] == uVar15) && (*puVar10 == uVar15)) {
          if (puVar10 != (uint *)0x0) {
            if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar15 = puVar10[3];
            goto LAB_140171bb2;
          }
          break;
        }
      }
    }
    uVar15 = 0;
LAB_140171bb2:
    puVar16 = (undefined4 *)0x0;
    uVar7 = FUN_140137690();
    FUN_140136b30(uVar7,local_res18[0]);
    if (uVar15 != 0) {
      if (uVar15 == 1) {
        iVar4 = FUN_140199b60(param_2,local_res18[0]);
        if (iVar4 == 0) {
          local_c0 = 0;
          pplVar14 = (longlong **)&local_c0;
        }
        else {
          iVar4 = FUN_140172110(param_1,5,param_2,local_res18[0],CONCAT44(uVar5,4));
          if (iVar4 == 0) {
            local_c4 = 0;
            pplVar14 = (longlong **)&local_c4;
          }
          else {
            uVar7 = FUN_1402e8ff0();
            iVar4 = FUN_1402e90a0(uVar7,local_res18[0]);
            lVar9 = (**(code **)(*(longlong *)*plVar17 + 0x270))();
            if (lVar9 != 0) {
              FUN_140203700(param_1,0x19b,4,param_2,0,iVar4,0,*(int *)(lVar9 + 8),
                            *(int *)(lVar9 + 8) - iVar4);
            }
            *(int *)(lVar9 + 8) = *(int *)(lVar9 + 8) - iVar4;
            iVar4 = *(int *)(lVar9 + 8);
            if (*(int *)(lVar9 + 8) < 1) {
              iVar4 = 0;
            }
            *(int *)(lVar9 + 8) = iVar4;
            FUN_1401fcc40(param_1,param_2);
            local_c8 = 1;
            pplVar14 = (longlong **)&local_c8;
          }
        }
LAB_14017207e:
        (**(code **)(*(longlong *)(param_1 + 0x78) + 0x840))
                  ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,pplVar14
                   ,local_res18);
      }
      else if (uVar15 == 4) {
        iVar4 = FUN_140199c80(param_2,local_res18[0]);
        if (iVar4 == 0) {
          local_d0 = (longlong *)((ulonglong)local_d0 & 0xffffffff00000000);
          pplVar14 = &local_d0;
        }
        else {
          iVar4 = FUN_140172110(param_1,5,param_2,local_res18[0],CONCAT44(uVar5,4));
          if (iVar4 == 0) {
            local_d8 = 0;
            pplVar14 = (longlong **)&local_d8;
          }
          else {
            uVar7 = FUN_1402e8ff0();
            iVar4 = FUN_1402e90a0(uVar7,local_res18[0]);
            lVar9 = (**(code **)(*(longlong *)*plVar17 + 0x270))();
            if (lVar9 != 0) {
              FUN_140203700(param_1,0x19b,4,param_2,0,iVar4,0,*(int *)(lVar9 + 8),
                            *(int *)(lVar9 + 8) - iVar4);
            }
            *(int *)(lVar9 + 0x10) = *(int *)(lVar9 + 0x10) - iVar4;
            iVar4 = *(int *)(lVar9 + 0x10);
            if (iVar4 < 1) {
              iVar4 = 0;
            }
            *(int *)(lVar9 + 0x10) = iVar4;
            FUN_1401fca40(param_1,param_2);
            local_bc = 1;
            pplVar14 = (longlong **)&local_bc;
          }
        }
        goto LAB_14017207e;
      }
LAB_1401720a0:
      LOCK();
      plVar17 = plVar17 + 1;
      lVar9 = *plVar17;
      *(int *)plVar17 = (int)*plVar17 + -1;
      UNLOCK();
      iVar4 = (int)lVar9 + -1;
      goto LAB_1401720d6;
    }
    iVar4 = FUN_140199850(param_2,local_res18[0]);
    if (iVar4 == 0) {
      local_a8[0] = 0;
      pplVar14 = (longlong **)local_a8;
      goto LAB_14017207e;
    }
    iVar4 = FUN_140172110(param_1,10,param_2,local_res18[0],CONCAT44(uVar5,3));
    uVar15 = local_res18[0];
    if (iVar4 == 0) {
      local_d4 = 0;
      pplVar14 = (longlong **)&local_d4;
      goto LAB_14017207e;
    }
    local_70 = (undefined4 *)0x0;
    local_res10 = (undefined4 *)0x0;
    local_68 = (undefined4 *)0x0;
    local_60 = 0;
    local_a0 = (undefined4 *)0x0;
    local_98 = (undefined4 *)0x0;
    local_90 = 0;
    plVar6 = (longlong *)FUN_1402e8ff0();
    puVar18 = puVar16;
    if (*plVar6 != 0) {
      for (puVar10 = *(uint **)(*plVar6 + ((ulonglong)uVar15 % (ulonglong)*(uint *)(plVar6 + 2)) * 8
                               ); puVar10 != (uint *)0x0; puVar10 = *(uint **)(puVar10 + 0x24)) {
        if ((puVar10[0x26] == uVar15) && (*puVar10 == uVar15)) {
          puVar18 = (undefined4 *)0x0;
          if (puVar10 != (uint *)0x0) {
            FUN_14012bb70(&local_70);
            local_res10 = local_68;
            puVar18 = local_70;
          }
          break;
        }
      }
    }
    uVar15 = local_res18[0];
    plVar6 = (longlong *)FUN_1402e8ff0();
    puVar8 = puVar16;
    puVar12 = puVar16;
    if (*plVar6 != 0) {
      for (puVar10 = *(uint **)(*plVar6 + ((ulonglong)uVar15 % (ulonglong)*(uint *)(plVar6 + 2)) * 8
                               ); puVar10 != (uint *)0x0; puVar10 = *(uint **)(puVar10 + 0x24)) {
        if ((puVar10[0x26] == uVar15) && (*puVar10 == uVar15)) {
          if (puVar10 != (uint *)0x0) {
            FUN_14012bb70(&local_a0,puVar10 + 0x10);
            puVar8 = local_98;
            puVar12 = local_a0;
          }
          break;
        }
      }
    }
    puVar13 = (undefined4 *)((longlong)local_res10 - (longlong)puVar18 >> 2);
    local_res10 = puVar13;
    if (((puVar13 != (undefined4 *)0x0) &&
        (puVar8 = (undefined4 *)((longlong)puVar8 - (longlong)puVar12 >> 2),
        puVar8 != (undefined4 *)0x0)) && (puVar13 == puVar8)) {
      FUN_140197b70(param_2,&local_80);
      puVar8 = local_a0;
      puVar11 = puVar18;
      if (puVar13 != (undefined4 *)0x0) {
        do {
          local_res20 = puVar11;
          uVar7 = FUN_140137690();
          uVar5 = FUN_140136b30(uVar7,*puVar11);
          local_res10 = (undefined4 *)CONCAT44(local_res10._4_4_,uVar5);
          uVar7 = FUN_140174f00(&local_80);
          FUN_1401f11c0(uVar7,param_2,&local_res10,puVar18 + (longlong)puVar16,
                        puVar8 + (longlong)puVar16,0x19b,3);
          puVar16 = (undefined4 *)(ulonglong)((int)puVar16 + 1);
          local_res20 = local_res20 + 1;
          puVar11 = local_res20;
          puVar12 = local_a0;
          plVar17 = local_d0;
        } while (puVar16 < puVar13);
      }
      local_res20 = (undefined4 *)CONCAT44(local_res20._4_4_,1);
      (**(code **)(*(longlong *)(param_1 + 0x78) + 0x840))
                ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                 &local_res20,local_res18);
      if (local_80 != (undefined8 *)0x0) {
        if (local_80 == local_78) {
          LOCK();
          piVar1 = (int *)(local_80 + 1);
          iVar4 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          puVar12 = local_a0;
          plVar17 = local_b8;
          puVar18 = local_70;
          if (iVar4 == 1) {
            pvVar2 = (void *)*local_80;
            if (pvVar2 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar2 + 0xf630);
              operator_delete(pvVar2);
            }
            operator_delete(local_80);
            puVar12 = local_a0;
            plVar17 = local_b8;
            puVar18 = local_70;
          }
        }
        else {
          iVar4 = DAT_140608050 + 1;
          bVar19 = DAT_140608050 == 0;
          DAT_140608050 = iVar4;
          if (bVar19) {
            FUN_140176d60(1);
          }
        }
      }
      if (puVar12 != (undefined4 *)0x0) {
        operator_delete(puVar12);
      }
      if (puVar18 != (undefined4 *)0x0) {
        operator_delete(puVar18);
      }
      goto LAB_1401720a0;
    }
    if (puVar12 != (undefined4 *)0x0) {
      operator_delete(puVar12);
    }
    if (puVar18 != (undefined4 *)0x0) {
      operator_delete(puVar18);
    }
  }
  LOCK();
  plVar17 = plVar17 + 1;
  *(int *)plVar17 = (int)*plVar17 + -1;
  iVar4 = (int)*plVar17;
  UNLOCK();
LAB_1401720d6:
  if (iVar4 == 0) {
    puVar3 = (undefined8 *)*local_b8;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_b8);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140172254)
// WARNING: Removing unreachable block (ram,0x0001401721f8)

undefined8
FUN_140172110(longlong param_1,undefined4 param_2,longlong param_3,uint param_4,undefined4 param_5)

{
  longlong *plVar1;
  void *pvVar2;
  ushort uVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  uint uVar7;
  uint uVar8;
  longlong *plVar9;
  undefined8 uVar10;
  longlong lVar11;
  uint *puVar12;
  longlong *plVar13;
  longlong *plVar14;
  uint *puVar15;
  longlong lVar16;
  uint *puVar17;
  undefined2 uVar18;
  ulonglong uVar19;
  bool bVar20;
  undefined8 in_stack_fffffffffffffd98;
  undefined8 in_stack_fffffffffffffda0;
  uint uVar22;
  undefined4 uVar23;
  undefined4 *puVar21;
  undefined8 in_stack_fffffffffffffda8;
  uint uVar24;
  undefined8 in_stack_fffffffffffffdb0;
  uint uVar25;
  undefined4 uVar26;
  undefined8 in_stack_fffffffffffffdb8;
  uint uVar29;
  longlong lVar27;
  undefined4 uVar30;
  ulonglong uVar28;
  uint local_238;
  int local_234;
  undefined2 local_230;
  undefined2 local_22e;
  undefined2 local_22c [2];
  longlong *local_228;
  longlong *local_220;
  int local_218 [2];
  longlong local_210;
  int local_208;
  int local_204;
  undefined4 local_200;
  undefined4 local_1fc;
  undefined4 local_1f8;
  undefined4 local_1f4;
  undefined4 local_1f0;
  undefined4 local_1ec;
  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;
  undefined8 local_1c0;
  longlong local_1b8;
  longlong local_1b0;
  ushort local_1a4;
  undefined2 local_1a2;
  uint local_1a0;
  short local_19c;
  undefined4 local_110;
  undefined1 local_108 [20];
  ushort local_f4 [2];
  uint local_f0;
  short local_ec;
  undefined4 local_60;
  undefined1 local_58 [16];
  longlong local_48;
  undefined1 local_38 [16];
  
  uVar7 = (uint)((ulonglong)in_stack_fffffffffffffd98 >> 0x20);
  uVar22 = (uint)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
  uVar24 = (uint)((ulonglong)in_stack_fffffffffffffda8 >> 0x20);
  uVar25 = (uint)((ulonglong)in_stack_fffffffffffffdb0 >> 0x20);
  uVar29 = (uint)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
  local_1c0 = 0xfffffffffffffffe;
  FUN_140197b70(param_3);
  plVar1 = local_228;
  if (local_228 != (longlong *)0x0) {
    if (local_228 == local_220) {
      if (*local_228 != 0) {
        FUN_14000a170(local_108);
        puVar17 = (uint *)0x0;
        uVar8 = 0;
        local_60 = 0;
        plVar9 = (longlong *)FUN_1402e8ff0();
        local_f0 = uVar8;
        if (*plVar9 != 0) {
          for (puVar12 = *(uint **)(*plVar9 +
                                   ((ulonglong)param_4 % (ulonglong)*(uint *)(plVar9 + 2)) * 8);
              puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x24)) {
            if ((puVar12[0x26] == param_4) && (*puVar12 == param_4)) {
              if (puVar12 != (uint *)0x0) {
                local_f0 = puVar12[5];
              }
              break;
            }
          }
        }
        plVar9 = (longlong *)FUN_1402e8ff0();
        uVar5 = uVar8;
        if (*plVar9 != 0) {
          for (puVar12 = *(uint **)(*plVar9 +
                                   ((ulonglong)param_4 % (ulonglong)*(uint *)(plVar9 + 2)) * 8);
              puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x24)) {
            if ((puVar12[0x26] == param_4) && (*puVar12 == param_4)) {
              if (puVar12 != (uint *)0x0) {
                uVar5 = puVar12[6];
              }
              break;
            }
          }
        }
        local_ec = (short)uVar5;
        lVar27 = (ulonglong)uVar29 << 0x20;
        lVar16 = (ulonglong)uVar25 << 0x20;
        plVar9 = (longlong *)((ulonglong)uVar24 << 0x20);
        lVar11 = (ulonglong)uVar22 << 0x20;
        FUN_1401aac30(param_2,local_108,local_f0,(int)local_ec,(ulonglong)uVar7 << 0x20,lVar11,
                      plVar9,lVar16,lVar27,0);
        uVar26 = (undefined4)((ulonglong)lVar16 >> 0x20);
        uVar30 = (undefined4)((ulonglong)lVar27 >> 0x20);
        uVar23 = (undefined4)((ulonglong)lVar11 >> 0x20);
        local_234 = -1;
        local_238 = 0xffffffff;
        if (local_f4[0] == 5) {
          lVar11 = *plVar1;
          iVar6 = FUN_1401e8610(lVar11);
          *(int *)(lVar11 + 0x50a4) = iVar6;
          iVar4 = -1;
          if (iVar6 < 0) goto LAB_1401728d4;
        }
        else {
          local_204 = (int)(short)local_f4[0];
          local_234 = -1;
          if (((short)local_f4[0] < 0) ||
             (iVar6 = FUN_1401eeb60(*plVar1,&local_204,local_108,&local_234), iVar4 = local_234,
             iVar6 == 0)) goto LAB_1401728d4;
        }
        FUN_14000a170(&local_1b8);
        uVar3 = local_f4[0];
        local_110 = 0;
        if (local_f4[0] == 5) {
          uVar10 = FUN_140174f00(&local_228);
          FUN_1401e8ba0(uVar10,local_38,local_108,&local_238);
          local_210 = FUN_140174f00(&local_228);
          lVar11 = local_210 + 0xf630;
          local_48 = lVar11;
          FUN_14034ed40(lVar11);
          uVar19 = (ulonglong)(int)local_238;
          if (local_238 < 0x78) {
            FUN_140090020(&local_1b8,uVar19 * 0xac + 0x50a8 + local_210);
            FUN_14034edd0(lVar11);
          }
          else {
            FUN_14034edd0(lVar11);
          }
        }
        else {
          if (iVar4 == -1) {
            local_218[0] = (int)(short)local_f4[0];
            uVar10 = FUN_140174f00(&local_228);
            if ((short)uVar3 < 0) {
LAB_140172420:
              uVar19 = 0xffffffff;
            }
            else {
              uVar7 = FUN_1401e8350(uVar10,local_218,local_108,local_58);
              uVar19 = (ulonglong)uVar7;
            }
          }
          else {
            local_208 = (int)(short)local_f4[0];
            uVar10 = FUN_140174f00(&local_228);
            if ((short)uVar3 < 0) goto LAB_140172420;
            uVar7 = FUN_1401e8130(uVar10,param_3,&local_208,&local_234,local_108);
            uVar19 = (ulonglong)uVar7;
          }
          uVar3 = local_f4[0];
          uVar7 = (uint)uVar19;
          lVar16 = (longlong)(short)local_f4[0];
          local_238 = uVar7;
          lVar11 = FUN_140174f00(&local_228);
          if ((uVar3 < 5) && (uVar7 < 0x18)) {
            lVar11 = ((longlong)(int)uVar7 + lVar16 * 0x18) * 0xac + lVar11;
            *(ushort *)(lVar11 + 0x14) = uVar3;
            *(short *)(lVar11 + 0x16) = (short)uVar19;
            FUN_140090020(&local_1b8);
          }
        }
        uVar18 = (undefined2)uVar19;
        if (iVar4 == -1) {
          local_1a4 = local_f4[0];
          local_1e0 = *(undefined4 *)(param_3 + 0x160);
          local_1dc = *(undefined4 *)(param_3 + 0x164);
          local_1d8 = *(undefined4 *)(param_3 + 0x168);
          local_1d4 = *(undefined4 *)(param_3 + 0x16c);
          local_1f0 = *(undefined4 *)(param_3 + 0x170);
          local_1ec = *(undefined4 *)(param_3 + 0x174);
          local_1e8 = *(undefined4 *)(param_3 + 0x178);
          local_1e4 = *(undefined4 *)(param_3 + 0x17c);
          iVar4 = *(int *)(param_3 + 0x284);
          local_210 = CONCAT44(local_210._4_4_,*(undefined4 *)(param_3 + 8));
          local_1a2 = uVar18;
          if ((-1 < iVar4) && (iVar4 < *(short *)(param_1 + 700))) {
            if ((local_1b8 != 0) || (local_1b0 != 0)) {
              uVar8 = 1;
            }
            if (((uVar8 != 0) && (local_1a0 != 0)) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
              local_22e = (undefined2)iVar4;
              plVar13 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                          (longlong)*(int *)(param_3 + 0x288) * 8) + 0x70);
              plVar14 = &local_1b8;
              uVar26 = 1;
              plVar9 = (longlong *)&local_1e0;
              puVar21 = &local_1f0;
              (**(code **)(*plVar13 + 0xb0))
                        (plVar13,1,&DAT_1405d85a0,&local_22e,&local_210,puVar21,plVar9,
                         &DAT_14047ba9c,plVar14);
              uVar23 = (undefined4)((ulonglong)puVar21 >> 0x20);
              uVar30 = (undefined4)((ulonglong)plVar14 >> 0x20);
            }
          }
        }
        else {
          local_1d0 = *(undefined4 *)(param_3 + 0x160);
          local_1cc = *(undefined4 *)(param_3 + 0x164);
          local_1c8 = *(undefined4 *)(param_3 + 0x168);
          local_1c4 = *(undefined4 *)(param_3 + 0x16c);
          local_200 = *(undefined4 *)(param_3 + 0x170);
          local_1fc = *(undefined4 *)(param_3 + 0x174);
          local_1f8 = *(undefined4 *)(param_3 + 0x178);
          local_1f4 = *(undefined4 *)(param_3 + 0x17c);
          iVar4 = *(int *)(param_3 + 0x284);
          if (((-1 < iVar4) && (iVar4 < *(short *)(param_1 + 700))) &&
             (*(longlong *)(param_1 + 0x4c0) != 0)) {
            local_22c[0] = (undefined2)iVar4;
            plVar14 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                        (longlong)*(int *)(param_3 + 0x288) * 8) + 0x70);
            plVar9 = &local_1b8;
            puVar21 = &local_1d0;
            (**(code **)(*plVar14 + 0x140))
                      (plVar14,1,&DAT_1405d85a0,local_22c,&local_200,puVar21,plVar9);
            uVar23 = (undefined4)((ulonglong)puVar21 >> 0x20);
          }
        }
        iVar4 = (int)local_19c;
        uVar28 = CONCAT44(uVar30,iVar4);
        uVar19 = CONCAT44(uVar23,iVar4);
        FUN_140203700(param_1,0x19a,param_5,param_3,&local_1b8,uVar19,
                      (ulonglong)plVar9 & 0xffffffff00000000,CONCAT44(uVar26,iVar4 - local_ec),
                      uVar28);
        FUN_1402024f0(param_1,param_3,&local_1b8,0x191,param_5,uVar19 & 0xffffffff00000000,
                      *(undefined4 *)(*plVar1 + 0x50a0),*(undefined4 *)(*plVar1 + 0x50a0),
                      uVar28 & 0xffffffff00000000,0);
        local_230 = uVar18;
        (**(code **)(*(longlong *)(param_1 + 0x78) + 0xe0))
                  ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_3 + 8),&DAT_1405d85a0,local_f4
                   ,&local_230,&local_1b8);
        uVar7 = local_1a0;
        lVar11 = FUN_140137690();
        uVar22 = local_1a0;
        if (*(longlong *)(lVar11 + 0x88) != 0) {
          for (puVar12 = *(uint **)(*(longlong *)(lVar11 + 0x88) +
                                   ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar11 + 0x98)) * 8);
              puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0xa6)) {
            if ((puVar12[0xa8] == uVar7) && (*puVar12 == uVar7)) {
              if (puVar12 != (uint *)0x0) {
                if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar7 = puVar12[0x18];
                goto LAB_1401727a9;
              }
              break;
            }
          }
        }
        uVar7 = 0;
LAB_1401727a9:
        lVar11 = FUN_1402e0270();
        if ((int)uVar22 < 1) {
LAB_1401727fc:
          lVar11 = FUN_1402e0270();
          if ((int)uVar7 < 1) goto LAB_140172872;
          puVar12 = puVar17;
          if (*(longlong *)(lVar11 + 0x1f8) != 0) {
            for (puVar15 = *(uint **)(*(longlong *)(lVar11 + 0x1f8) +
                                     ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar11 + 0x208)) * 8);
                (puVar12 = puVar17, puVar15 != (uint *)0x0 &&
                ((puVar15[4] != uVar7 || (puVar12 = puVar15, *puVar15 != uVar7))));
                puVar15 = *(uint **)(puVar15 + 2)) {
            }
          }
          if (puVar12 == (uint *)0x0) goto LAB_140172872;
        }
        else {
          puVar12 = puVar17;
          if (*(longlong *)(lVar11 + 0x1b0) != 0) {
            for (puVar15 = *(uint **)(*(longlong *)(lVar11 + 0x1b0) +
                                     ((ulonglong)uVar22 % (ulonglong)*(uint *)(lVar11 + 0x1c0)) * 8)
                ; (puVar12 = puVar17, puVar15 != (uint *)0x0 &&
                  ((puVar15[4] != uVar22 || (puVar12 = puVar15, *puVar15 != uVar22))));
                puVar15 = *(uint **)(puVar15 + 2)) {
            }
          }
          if (puVar12 == (uint *)0x0) goto LAB_1401727fc;
        }
        if ((((local_f4[0] == 1) || (local_f4[0] == 2)) || (local_f4[0] == 3)) ||
           ((local_f4[0] == 4 || (local_f4[0] == 5)))) {
          FUN_1401a8bb0(param_3,local_1a0);
        }
LAB_140172872:
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          pvVar2 = (void *)*local_228;
          if (pvVar2 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar2 + 0xf630);
            operator_delete(pvVar2);
          }
          operator_delete(local_228);
        }
        return 1;
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar20 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 0;
  }
  if (plVar1 != local_220) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 0;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_1401728d4:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar2 = (void *)*local_228;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_228);
  }
  return 0;
}



undefined1
FUN_140172930(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PC_ROOM_SHOP_ITEM_BUY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401b8890(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140172a30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PC_ROOM_SHOP_ITEM_BUY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401b8ba0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140172b30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_SHOP_ITEM_BUY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401b8e50(lVar3,param_5,param_6,param_4,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140172c30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_SHOP_ITEM_SELL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401b9040(lVar3,param_5,param_6,param_7,param_8,param_9,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140172d50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_SHOP_ITEM_BUY_REPURCHASE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401b9a60(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140172e50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  longlong local_30;
  undefined1 local_28;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar3 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_REPURCHASE_INVENTORY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    local_30 = lVar1;
    FUN_14034ed40(lVar1);
    local_28 = 1;
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_40 = *(undefined4 *)(lVar2 + 0x170);
      local_3c = *(undefined4 *)(lVar2 + 0x174);
      local_38 = *(undefined4 *)(lVar2 + 0x178);
      local_34 = *(undefined4 *)(lVar2 + 0x17c);
      FUN_140174c40(*(undefined8 *)(lVar2 + 0xb50),&local_40,lVar2,param_4,uVar3);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140172f50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_DEL_FRIEND";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x188) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x340,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401b9b70(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140173050(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_ADD_BAN_BY_SESSION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x188) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x340,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401b9d10(lVar3,param_2,param_4,param_5,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140173160(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_ADD_BAN_BY_NAME";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x188) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x340,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401b9f00(lVar3,param_2,param_4,param_5,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140173270(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_FRIEND_BY_SESSION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x188) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x340,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ba250(lVar3,param_2,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140173370(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_FRIEND_LIST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x188) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x340,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ba3e0(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140173460(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_FRIEND_BY_NAME";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x188) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x340,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ba4c0(lVar3,param_2,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140173560(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_DEL_BAN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x188) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x340,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ba7f0(lVar3,param_2,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140173660(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_SET_BAN_MEMO";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x188) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x340,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ba8a0(lVar3,param_2,param_4,param_5,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140173770(longlong param_1,int param_2)

{
  longlong lVar1;
  char *local_30;
  DWORD local_28;
  longlong local_20;
  
  local_30 = "PT_REQ_NOTICE";
  local_20 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_28 = timeGetTime();
  if ((param_2 != 0) && (lVar1 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar1 != 0)) {
    FUN_14034ed40(lVar1 + 0x680);
    if (*(char *)(lVar1 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1 + 0x680);
    }
    else {
      FUN_14034edd0(lVar1 + 0x680);
    }
  }
  FUN_14004b970(&local_30);
  return 1;
}



undefined1
FUN_140173820(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PET_CHARGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401da390(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140173940(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_CHANGE_PET_NAME";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401da540(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140173a60(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PACKAGE_DELETE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401daba0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



void FUN_140173b60(longlong param_1,int param_2,undefined4 param_3,undefined4 param_4)

{
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if ((DAT_140609440 != '\0') && (param_2 != 0)) {
    (**(code **)(*(longlong *)(param_1 + 0x78) + 0x50))
              ((longlong *)(param_1 + 0x78),param_2,&DAT_1405d85a0,local_res18,local_res20);
  }
  return;
}



void FUN_140173bf0(longlong param_1,undefined4 *param_2,short *param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  undefined2 local_58;
  undefined6 uStack_56;
  undefined8 local_48;
  ulonglong local_40;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  
  FUN_14034ed40();
  local_40 = 7;
  local_48 = 0;
  local_58 = 0;
  local_68 = *param_2;
  uStack_64 = param_2[1];
  uStack_60 = param_2[2];
  uStack_5c = param_2[3];
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_3;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_58,param_3,~uVar2 - 1);
  local_30 = *param_4;
  local_2c = param_4[1];
  local_28 = param_4[2];
  local_24 = param_4[3];
  local_20 = param_5;
  local_1c = param_6;
  FUN_140175090(param_1 + 0x5d0,&local_68);
  if (7 < local_40) {
    operator_delete((void *)CONCAT62(uStack_56,local_58));
  }
  local_40 = 7;
  local_48 = 0;
  local_58 = 0;
  FUN_14034edd0(param_1 + 0x1e0);
  return;
}



void FUN_140173d20(longlong param_1,undefined4 *param_2,short *param_3,undefined4 *param_4,
                  undefined4 param_5)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  undefined2 local_58;
  undefined6 uStack_56;
  undefined8 local_48;
  ulonglong local_40;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  FUN_14034ed40();
  local_40 = 7;
  local_48 = 0;
  local_58 = 0;
  local_68 = *param_2;
  uStack_64 = param_2[1];
  uStack_60 = param_2[2];
  uStack_5c = param_2[3];
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_3;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_58,param_3,~uVar2 - 1);
  local_30 = *param_4;
  local_2c = param_4[1];
  local_28 = param_4[2];
  local_24 = param_4[3];
  local_20 = param_5;
  FUN_140174fd0(param_1 + 0x5a8,&local_68);
  if (7 < local_40) {
    operator_delete((void *)CONCAT62(uStack_56,local_58));
  }
  local_40 = 7;
  local_48 = 0;
  local_58 = 0;
  FUN_14034edd0(param_1 + 0x1e0);
  return;
}



void FUN_140173e40(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  longlong lVar1;
  longlong lVar2;
  undefined4 local_res18 [4];
  undefined4 local_28 [2];
  undefined8 local_20;
  longlong local_18;
  undefined1 local_10;
  
  local_20 = 0xfffffffffffffffe;
  local_28[0] = 0;
  lVar1 = param_1 + 0x1e0;
  local_res18[0] = param_3;
  local_18 = lVar1;
  FUN_14034ed40(lVar1);
  local_10 = 1;
  lVar2 = FUN_14016e240(param_1,param_2);
  if (lVar2 != 0) {
    (**(code **)(*(longlong *)(param_1 + 0x78) + 0x900))
              ((longlong *)(param_1 + 0x78),*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_res18,
               local_28);
  }
  FUN_14034edd0(lVar1);
  return;
}



void FUN_140173ee0(longlong *param_1,undefined4 param_2,int param_3,undefined4 param_4,
                  longlong *param_5)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong *plVar6;
  undefined *puVar7;
  undefined4 local_res8 [2];
  undefined2 local_res10 [4];
  int local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_68 [2];
  undefined8 local_60;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 local_50;
  undefined4 uStack_4c;
  longlong *local_48;
  undefined1 local_40;
  
  local_60 = 0xfffffffffffffffe;
  bVar3 = false;
  local_68[0] = 0;
  plVar1 = param_1 + 0x3c;
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  local_48 = plVar1;
  FUN_14034ed40(plVar1);
  local_40 = 1;
  uVar4 = param_2;
  if (local_res18[0] == 0x11a) {
    puVar7 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1405d8010;
    }
    uVar4 = (**(code **)(*param_1 + 0x168))(param_1,puVar7);
  }
  lVar5 = FUN_14016e240(param_1,uVar4);
  if (lVar5 == 0) goto LAB_14017415a;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
LAB_140173fd0:
    (**(code **)(param_1[0xf] + 0x910))
              (param_1 + 0xf,param_2,&DAT_1405d85a0,local_res18,local_res20,local_68);
  }
  else {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 == 0xca) goto LAB_140173fd0;
  }
  if (local_res18[0] == 0) {
LAB_140174045:
    if (local_res18[0] == 0x11a) goto LAB_14017404c;
    if (local_res18[0] == 0x13c) {
      (**(code **)(param_1[0xf] + 0x910))
                (param_1 + 0xf,uVar4,&DAT_1405d85a0,local_res18,local_res20,local_68);
    }
  }
  else {
    if (local_res18[0] != 0x11a) {
      if (local_res18[0] != 0x13c) {
        (**(code **)(param_1[0xf] + 0x910))
                  (param_1 + 0xf,uVar4,&DAT_1405d85a0,local_res18,local_res20,local_68);
        goto LAB_14017415a;
      }
      goto LAB_140174045;
    }
LAB_14017404c:
    (**(code **)(param_1[0xf] + 0xa10))(param_1 + 0xf,uVar4,&DAT_1405d85a0);
  }
  *(undefined1 *)(lVar5 + 0x5ec) = 1;
  local_58 = *(undefined4 *)(lVar5 + 0x160);
  uStack_54 = *(undefined4 *)(lVar5 + 0x164);
  local_50 = *(undefined4 *)(lVar5 + 0x168);
  uStack_4c = *(undefined4 *)(lVar5 + 0x16c);
  iVar2 = *(int *)(lVar5 + 0x284);
  local_res8[0] = uVar4;
  if ((-1 < iVar2) && (iVar2 < *(short *)((longlong)param_1 + 700))) {
    if ((*(longlong *)(lVar5 + 0x160) != 0) || (*(longlong *)(lVar5 + 0x168) != 0)) {
      bVar3 = true;
    }
    if ((bVar3) && (param_1[0x98] != 0)) {
      local_res10[0] = (undefined2)iVar2;
      plVar6 = (longlong *)
               (*(longlong *)
                 (*(longlong *)(param_1[0x98] + 8) + (longlong)*(int *)(lVar5 + 0x288) * 8) + 0x70);
      (**(code **)(*plVar6 + 0xa50))(plVar6,1,&DAT_1405d85a0,local_res10,local_res8,&local_58);
    }
  }
LAB_14017415a:
  FUN_14034edd0(plVar1);
  return;
}



void FUN_140174180(longlong param_1,wchar_t *param_2)

{
  longlong lVar1;
  int iVar2;
  DWORD DVar3;
  DWORD DVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  longlong lVar8;
  short *psVar9;
  short *psVar10;
  undefined1 uVar11;
  
  iVar2 = _wcsicmp(param_2,L"itemlist");
  if (iVar2 == 0) {
    uVar5 = FUN_140137690();
    FUN_140131f90(uVar5);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"itemoption");
  if (iVar2 == 0) {
    uVar5 = FUN_140162270();
    FUN_1401611f0(uVar5);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"cardselectitemlist");
  if (iVar2 == 0) {
    DVar3 = timeGetTime();
    if ((DAT_140609cd8 & 1) == 0) {
      DAT_140609cd8 = DAT_140609cd8 | 1;
      FUN_140137720();
      atexit((_func_5014 *)&DAT_140448680);
    }
    DVar4 = timeGetTime();
    if (0x32 < DVar4 - DVar3) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"GetCardSelectItemDB");
    }
    FUN_1401378e0(&DAT_1406092c0);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"mission");
  if (iVar2 == 0) {
    uVar5 = FUN_1402eb020();
    FUN_1402eabd0(uVar5);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"missionstring");
  if (iVar2 == 0) {
    uVar5 = FUN_140160cb0();
    FUN_140160c30(uVar5);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"quest");
  if (iVar2 == 0) {
    uVar5 = FUN_1402e0270();
    FUN_1402db860(uVar5);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"questgroup");
  if (iVar2 == 0) {
    uVar6 = FUN_1402e07c0();
    FUN_1402e21e0(uVar6);
    uVar5 = DAT_140607ff0;
    uVar7 = FUN_140294ca0(DAT_140607ff0,L"QUEST_GROUP");
    FUN_140294650(uVar5,L"QUEST_GROUP");
    FUN_140292e80(uVar5,L"QUEST_GROUP",uVar7);
    FUN_1402e0310(uVar6);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"queststring");
  if (iVar2 == 0) {
    uVar5 = FUN_140160b80();
    FUN_140160b00(uVar5);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"questtrigger");
  if (iVar2 == 0) {
    uVar6 = FUN_1402e0f00();
    FUN_1402e2470(uVar6);
    uVar5 = DAT_140607ff0;
    uVar7 = FUN_140294ca0(DAT_140607ff0,L"QUEST_TRIGGER");
    FUN_140294650(uVar5,L"QUEST_TRIGGER");
    FUN_140292e80(uVar5,L"QUEST_TRIGGER",uVar7);
    FUN_1402e0890(uVar6);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"attack");
  if (iVar2 == 0) {
    uVar5 = FUN_1402ec660();
    FUN_1402ec3a0(uVar5);
    FUN_14020edb0(DAT_140608070);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"skill");
  if (iVar2 == 0) {
    uVar5 = FUN_1402ec2c0();
    FUN_1402eb280(uVar5);
    FUN_1402eda20(DAT_140608060);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"command");
  if (iVar2 == 0) {
    FUN_1402f2e90(DAT_140608068);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"soul");
  if (iVar2 == 0) {
    FUN_1402f3050(DAT_140608068);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"motion");
  if (iVar2 == 0) {
    FUN_1402f33f0(DAT_140608068);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"specialgauge");
  if (iVar2 == 0) {
    FUN_1402f3770(DAT_140608068);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"haircut");
  if (iVar2 == 0) {
    uVar5 = FUN_14013cde0();
    FUN_14013c3b0(uVar5);
    return;
  }
  iVar2 = _wcsicmp(param_2,L"enemy");
  uVar5 = DAT_140607ff0;
  uVar11 = iVar2 == 0;
  if ((bool)uVar11) {
    uVar6 = FUN_140294ca0(DAT_140607ff0,&DAT_1404a4d58);
    FUN_140294650(uVar5,&DAT_1404a4d58);
    FUN_140292e80(uVar5,&DAT_1404a4d58,uVar6);
    lVar1 = DAT_140608068;
    lVar8 = 6;
    psVar9 = &DAT_1404a4d58;
    psVar10 = &DAT_1404a4d58;
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      uVar11 = *psVar9 == *psVar10;
      psVar9 = psVar9 + 1;
      psVar10 = psVar10 + 1;
    } while ((bool)uVar11);
    if ((bool)uVar11) {
      FUN_1402f3920(DAT_140608068 + 0x58);
      FUN_1402ee410(lVar1);
      return;
    }
  }
  else {
    iVar2 = _wcsicmp(param_2,L"dropgrouplist");
    if (iVar2 == 0) {
      FUN_1401e30b0(*(undefined8 *)(param_1 + 0x578));
      return;
    }
    _wcsicmp(param_2,L"ITEM_DROP_GROUP_LIST");
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401747e4)
// WARNING: Removing unreachable block (ram,0x000140174808)
// WARNING: Removing unreachable block (ram,0x0001401747eb)
// WARNING: Removing unreachable block (ram,0x0001401747ff)
// WARNING: Removing unreachable block (ram,0x00014017480d)
// WARNING: Removing unreachable block (ram,0x000140174819)
// WARNING: Removing unreachable block (ram,0x000140174826)
// WARNING: Removing unreachable block (ram,0x00014017483b)

undefined8
FUN_140174650(longlong param_1,ulonglong *param_2,undefined8 param_3,short param_4,
             undefined8 param_5)

{
  int *piVar1;
  ulonglong *puVar2;
  void *pvVar3;
  ulonglong uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined4 uVar7;
  ulonglong uVar8;
  undefined4 *puVar9;
  ulonglong *puVar10;
  ulonglong uVar11;
  undefined4 *puVar12;
  int iVar13;
  undefined4 *puVar14;
  uint uVar15;
  bool bVar16;
  undefined8 uVar17;
  undefined8 *local_80;
  undefined8 *local_78;
  longlong local_70;
  char local_68;
  uint local_60;
  uint uStack_5c;
  uint local_58;
  uint uStack_54;
  uint local_50;
  uint local_4c;
  uint local_48;
  uint local_44;
  
  uVar17 = 0xfffffffffffffffe;
  local_70 = param_1 + 0x1e0;
  FUN_14034ed40();
  local_68 = '\x01';
  local_60 = (uint)*param_2;
  uStack_5c = *(uint *)((longlong)param_2 + 4);
  local_58 = (uint)param_2[1];
  uStack_54 = *(uint *)((longlong)param_2 + 0xc);
  uVar4 = param_2[1];
  uVar15 = local_60 ^ uStack_5c ^ local_58 ^ uStack_54;
  if ((*(longlong *)(param_1 + 0x530) != 0) &&
     (puVar10 = *(ulonglong **)
                 (*(longlong *)(param_1 + 0x530) +
                 ((ulonglong)uVar15 % (ulonglong)*(uint *)(param_1 + 0x540)) * 8),
     puVar10 != (ulonglong *)0x0)) {
    uVar11 = 0;
    do {
      if ((uint)puVar10[5] == uVar15) {
        bVar16 = *puVar10 < *param_2;
        if (*puVar10 == *param_2) {
          bVar16 = puVar10[1] < uVar4;
          uVar8 = uVar11;
          if (puVar10[1] != uVar4) goto LAB_140174709;
        }
        else {
LAB_140174709:
          uVar8 = (ulonglong)((1 - (uint)bVar16) - (uint)(bVar16 != 0));
        }
        if ((int)uVar8 == 0) {
          if (puVar10 != (ulonglong *)0x0) {
            puVar2 = (ulonglong *)puVar10[2];
            if (puVar2 != (ulonglong *)0x0) {
              if (puVar2 == (ulonglong *)puVar10[3]) {
                uVar11 = *puVar2;
              }
              else {
                iVar13 = DAT_140608058 + 1;
                bVar16 = DAT_140608058 == 0;
                DAT_140608058 = iVar13;
                if (bVar16) {
                  FUN_140176d60(1);
                }
              }
            }
            FUN_1401e7790(uVar11,param_5,param_3,(int)param_4,uVar17);
            goto LAB_14017490e;
          }
          break;
        }
      }
      puVar10 = (ulonglong *)puVar10[4];
    } while (puVar10 != (ulonglong *)0x0);
  }
  puVar12 = (undefined4 *)0x0;
  local_80 = (undefined8 *)0x0;
  puVar9 = operator_new(0x1060);
  puVar14 = puVar12;
  if (puVar9 != (undefined4 *)0x0) {
    *puVar9 = 0xffffffff;
    iVar13 = 0x18;
    puVar14 = puVar9 + 1;
    while (iVar13 = iVar13 + -1, -1 < iVar13) {
      FUN_14000a170(puVar14);
      puVar14[0x2a] = 0;
      puVar14 = puVar14 + 0x2b;
    }
    uVar7 = FUN_1403c0cc0();
    FUN_14034ec60(puVar9 + 0x40a,uVar7,1);
    puVar14 = puVar9;
  }
  if (puVar14 == (undefined4 *)0x0) {
    local_80 = (undefined8 *)0x0;
  }
  else {
    local_80 = operator_new(0x10);
    *local_80 = puVar14;
    *(undefined4 *)(local_80 + 1) = 1;
  }
  puVar5 = local_80;
  local_50 = (uint)*param_2;
  local_4c = *(uint *)((longlong)param_2 + 4);
  local_48 = (uint)param_2[1];
  local_44 = *(uint *)((longlong)param_2 + 0xc);
  local_78 = local_80;
  FUN_140176110(param_1 + 0x530,&local_50,&local_80);
  if (puVar5 != (undefined8 *)0x0) {
    puVar12 = (undefined4 *)*puVar5;
  }
  FUN_1401e7790(puVar12,param_5,param_3,(int)param_4);
  puVar6 = local_80;
  if (puVar5 != (undefined8 *)0x0) {
    LOCK();
    piVar1 = (int *)(puVar5 + 1);
    iVar13 = *piVar1;
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    if (iVar13 == 1) {
      pvVar3 = (void *)*local_80;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0x1028);
        operator_delete(pvVar3);
      }
      operator_delete(puVar6);
    }
  }
LAB_14017490e:
  if (local_68 != '\0') {
    FUN_14034edd0(local_70);
  }
  return 1;
}



void FUN_140174950(longlong param_1,ulonglong *param_2,short param_3,undefined4 param_4,
                  longlong param_5,undefined8 param_6)

{
  int iVar1;
  ulonglong *puVar2;
  float fVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  ulonglong uVar7;
  undefined8 uVar8;
  longlong lVar9;
  ulonglong uVar10;
  float *pfVar11;
  ulonglong *puVar12;
  ulonglong uVar13;
  uint uVar14;
  bool bVar15;
  float fVar16;
  float local_res8 [2];
  float local_res10 [2];
  undefined1 local_f8 [168];
  undefined4 local_50;
  
  FUN_14034ed40(param_1 + 0x1e0);
  uVar10 = param_2[1];
  uVar14 = (uint)*param_2 ^ *(uint *)((longlong)param_2 + 4) ^ (uint)param_2[1] ^
           *(uint *)((longlong)param_2 + 0xc);
  if ((*(longlong *)(param_1 + 0x530) != 0) &&
     (puVar12 = *(ulonglong **)
                 (*(longlong *)(param_1 + 0x530) +
                 ((ulonglong)uVar14 % (ulonglong)*(uint *)(param_1 + 0x540)) * 8),
     puVar12 != (ulonglong *)0x0)) {
    uVar13 = 0;
    do {
      if ((uint)puVar12[5] == uVar14) {
        bVar15 = *puVar12 < *param_2;
        if ((*puVar12 != *param_2) ||
           (bVar15 = puVar12[1] < uVar10, uVar7 = uVar13, puVar12[1] != uVar10)) {
          uVar7 = (ulonglong)((1 - (uint)bVar15) - (uint)(bVar15 != 0));
        }
        if ((int)uVar7 == 0) {
          if (puVar12 != (ulonglong *)0x0) {
            FUN_14000a170(local_f8);
            local_50 = 0;
            puVar2 = (ulonglong *)puVar12[2];
            uVar10 = uVar13;
            if (puVar2 != (ulonglong *)0x0) {
              if (puVar2 == (ulonglong *)puVar12[3]) {
                uVar10 = *puVar2;
              }
              else {
                iVar5 = DAT_140608058 + 1;
                bVar15 = DAT_140608058 == 0;
                DAT_140608058 = iVar5;
                if (bVar15) {
                  FUN_140176d60(1);
                }
              }
            }
            iVar5 = FUN_1401e7230(uVar10,(int)param_3,param_4,local_f8);
            if (iVar5 != 0) {
              fVar16 = 1.1;
              if (*(float *)(param_5 + 0x228c) != 0.0) {
                fVar16 = 1.0;
              }
              uVar8 = FUN_140137690();
              iVar6 = FUN_140136c70(uVar8,param_4);
              local_res8[0] = 0.0;
              cVar4 = FUN_1401b4a60(param_6,local_res8,0x66);
              fVar3 = local_res8[0];
              iVar5 = iVar6;
              if (cVar4 == '\x01') {
                iVar5 = (int)((float)iVar6 * local_res8[0]) + iVar6;
                lVar9 = FUN_1404186a0();
                if ((*(int *)(lVar9 + 0x250) == 1000) ||
                   (lVar9 = FUN_1404186a0(), *(char *)(lVar9 + 0x215) == '\x01')) {
                  lVar9 = FUN_14015f0c0();
                  iVar1 = *(int *)(lVar9 + 0x90);
                  if ((0 < iVar1) && ((iVar1 < 6 && (2 < iVar1)))) {
                    FUN_140005370(0xd,L"INFO >> GUILD SKILL | ITEM REBUY %d = (%d + (%d * %.2f))",
                                  iVar5,iVar6,iVar6,(double)fVar3);
                  }
                }
              }
              local_res10[0] = (float)(int)((float)iVar5 * fVar16);
              local_res8[0] = 1.4013e-45;
              pfVar11 = local_res8;
              if (0 < (int)((float)iVar5 * fVar16)) {
                pfVar11 = local_res10;
              }
              FUN_140170690(param_1,param_6,*pfVar11,local_f8);
              puVar2 = (ulonglong *)puVar12[2];
              if (puVar2 != (ulonglong *)0x0) {
                if (puVar2 == (ulonglong *)puVar12[3]) {
                  uVar13 = *puVar2;
                }
                else {
                  iVar5 = DAT_140608058 + 1;
                  bVar15 = DAT_140608058 == 0;
                  DAT_140608058 = iVar5;
                  if (bVar15) {
                    FUN_140176d60(1);
                  }
                }
              }
              FUN_1401e7150(uVar13,param_6,(int)param_3);
            }
          }
          break;
        }
      }
      puVar12 = (ulonglong *)puVar12[4];
    } while (puVar12 != (ulonglong *)0x0);
  }
  FUN_14034edd0(param_1 + 0x1e0);
  return;
}



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

{
  ulonglong *puVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  ulonglong *puVar5;
  ulonglong uVar6;
  uint uVar7;
  bool bVar8;
  
  FUN_14034ed40(param_1 + 0x1e0);
  uVar2 = param_2[1];
  uVar7 = (uint)*param_2 ^ *(uint *)((longlong)param_2 + 4) ^ *(uint *)((longlong)param_2 + 0xc) ^
          (uint)param_2[1];
  if ((*(longlong *)(param_1 + 0x530) != 0) &&
     (puVar5 = *(ulonglong **)
                (*(longlong *)(param_1 + 0x530) +
                ((ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x540)) * 8),
     puVar5 != (ulonglong *)0x0)) {
    uVar6 = 0;
    do {
      if ((uint)puVar5[5] == uVar7) {
        bVar8 = *puVar5 < *param_2;
        if ((*puVar5 != *param_2) || (bVar8 = puVar5[1] < uVar2, uVar4 = uVar6, puVar5[1] != uVar2))
        {
          uVar4 = (ulonglong)((1 - (uint)bVar8) - (uint)(bVar8 != 0));
        }
        if ((int)uVar4 == 0) {
          if (puVar5 != (ulonglong *)0x0) {
            puVar1 = (ulonglong *)puVar5[2];
            if (puVar1 != (ulonglong *)0x0) {
              if (puVar1 == (ulonglong *)puVar5[3]) {
                uVar6 = *puVar1;
              }
              else {
                iVar3 = DAT_140608058 + 1;
                bVar8 = DAT_140608058 == 0;
                DAT_140608058 = iVar3;
                if (bVar8) {
                  FUN_140176d60(1);
                }
              }
            }
            FUN_1401e7300(uVar6,param_3);
          }
          break;
        }
      }
      puVar5 = (ulonglong *)puVar5[4];
    } while (puVar5 != (ulonglong *)0x0);
  }
  FUN_14034edd0(param_1 + 0x1e0);
  return;
}



undefined8
FUN_140174d70(longlong param_1,int param_2,undefined8 param_3,short *param_4,short *param_5,
             short *param_6)

{
  longlong lVar1;
  char cVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined4 local_res8 [2];
  undefined4 local_res10 [2];
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_SELECT_ITEM_USE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      cVar2 = FUN_1401dc8c0(lVar3,(int)*param_4,(int)*param_5,(int)*param_6);
      if (cVar2 == '\0') {
        local_res10[0] = 0x19;
        local_res8[0] = 0x2b0c;
        plVar4 = (longlong *)(*(longlong *)(lVar3 + 0xb50) + 0x78);
        (**(code **)(*plVar4 + 0x70))
                  (plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,local_res8,local_res10);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



void FUN_140174ea0(longlong param_1)

{
  int *piVar1;
  longlong lVar2;
  
  piVar1 = (int *)(param_1 + 0x58);
  lVar2 = 3;
  do {
    if ((piVar1[-3] == 0x642) && (0 < *piVar1)) {
      *(int *)(param_1 + 0xa4) = *(int *)(param_1 + 0xa4) + *piVar1 * 100;
    }
    piVar1 = piVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  return;
}



void thunk_FUN_140175470(void)

{
  FUN_140175470();
  return;
}



void thunk_FUN_1401754f0(void)

{
  FUN_1401754f0();
  return;
}



undefined8 FUN_140174f00(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_140608048 + 1;
    bVar3 = DAT_140608048 == 0;
    DAT_140608048 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void thunk_FUN_140175570(void)

{
  FUN_140175570();
  return;
}



undefined8 FUN_140174f50(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_14060804c + 1;
    bVar3 = DAT_14060804c == 0;
    DAT_14060804c = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void FUN_140174f90(longlong *param_1)

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



void FUN_140174fd0(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_140175670(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140176720(param_1[1],((longlong)(param_2 - uVar2) / 0x50) * 0x50 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140175670(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140176720(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x50;
  return;
}



void FUN_140175090(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_140175790(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1401767a0(param_1[1],((longlong)(param_2 - uVar2) / 0x50) * 0x50 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140175790(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1401767a0(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x50;
  return;
}



void FUN_140175150(longlong *param_1)

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



void FUN_1401751b0(longlong *param_1)

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



void FUN_140175210(longlong *param_1)

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



void FUN_140175250(longlong *param_1)

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



void FUN_140175290(longlong *param_1)

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



void FUN_1401752d0(longlong *param_1)

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



void FUN_140175310(longlong *param_1)

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



void FUN_140175350(longlong *param_1)

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



void FUN_140175390(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_1403409c0(*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_140175850(void)

{
  FUN_140175850();
  return;
}



void FUN_1401753e0(longlong *param_1)

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



void FUN_140175420(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140175d50(*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_1401758d0(void)

{
  FUN_1401758d0();
  return;
}



void FUN_140175470(undefined8 *param_1)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  
  puVar2 = (undefined4 *)*param_1;
  if (puVar2 != (undefined4 *)0x0) {
    puVar1 = (undefined4 *)param_1[1];
    for (; puVar2 != puVar1; puVar2 = (undefined4 *)((longlong)puVar2 + 0x3e)) {
      *puVar2 = 0;
      *(undefined2 *)(puVar2 + 1) = 0;
      *(undefined8 *)((longlong)puVar2 + 6) = 0;
      *(undefined8 *)((longlong)puVar2 + 0xe) = 0;
      *(undefined8 *)((longlong)puVar2 + 0x16) = 0;
      *(undefined8 *)((longlong)puVar2 + 0x1e) = 0;
      *(undefined8 *)((longlong)puVar2 + 0x26) = 0;
      *(undefined8 *)((longlong)puVar2 + 0x2e) = 0;
      *(undefined8 *)((longlong)puVar2 + 0x36) = 0;
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1401754f0(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_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608050 + 1;
      bVar5 = DAT_140608050 == 0;
      DAT_140608050 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_140175570(undefined8 *param_1)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  int iVar4;
  bool bVar5;
  
  plVar2 = (longlong *)*param_1;
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == (longlong *)param_1[1]) {
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar2 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          *param_1 = 0;
          puVar3 = (undefined8 *)*plVar2;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(plVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar5 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



longlong FUN_1401755e0(longlong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [4];
  
  *(undefined8 *)(param_1 + 0x10) = 0;
  pvVar1 = operator_new(0x30);
  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) + 0x28) = 1;
    *(undefined1 *)(*(longlong *)(param_1 + 8) + 0x29) = 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_1405d3608);
}



void FUN_140175670(longlong *param_1)

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



void FUN_140175730(ulonglong *param_1,ulonglong *param_2)

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



void FUN_140175790(longlong *param_1)

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



void FUN_140175850(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0x30) {
      if (*(void **)(lVar2 + 0x10) != (void *)0x0) {
        operator_delete(*(void **)(lVar2 + 0x10));
      }
      *(undefined8 *)(lVar2 + 0x10) = 0;
      *(undefined8 *)(lVar2 + 0x18) = 0;
      *(undefined8 *)(lVar2 + 0x20) = 0;
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1401758d0(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_14034edf0((longlong)pvVar3 + 0x1028);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14060805c + 1;
      bVar5 = DAT_14060805c == 0;
      DAT_14060805c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140175950(undefined8 *param_1)

{
  undefined8 *puVar1;
  char *local_res18 [2];
  undefined **local_20 [3];
  
  *param_1 = 0;
  puVar1 = operator_new(0x10);
  if (puVar1 != (undefined8 *)0x0) {
    *param_1 = puVar1;
    *puVar1 = 0;
    puVar1[1] = 0;
    *(undefined8 **)*param_1 = param_1;
    param_1[1] = 0;
    param_1[2] = 0;
    param_1[3] = 0;
    param_1[4] = 0;
    return param_1;
  }
  local_res18[0] = (char *)0x0;
  std::exception::exception((exception *)local_20,local_res18);
  local_20[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_20,(ThrowInfo *)&DAT_1405d3608);
}



void FUN_1401759f0(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 (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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140176a60(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140175730(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x50);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0x50) * 0x50);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_140175b40(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 (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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140176b20(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140175730(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x50);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0x50) * 0x50);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_140175c90(ulonglong *param_1,ulonglong *param_2)

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



void FUN_140175cf0(ulonglong *param_1,ulonglong *param_2)

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



void FUN_140175d50(ulonglong *param_1,ulonglong *param_2)

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



undefined8 * FUN_140175db0(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 + 0x29) != '\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 + 0x29) == '\0') {
    cVar1 = *(char *)(*plVar9 + 0x29);
    plVar8 = (longlong *)*plVar9;
    while (cVar1 == '\0') {
      cVar1 = *(char *)(*plVar8 + 0x29);
      plVar9 = plVar8;
      plVar8 = (longlong *)*plVar8;
    }
  }
  else {
    cVar1 = *(char *)(param_3[1] + 0x29);
    plVar10 = (longlong *)param_3[1];
    plVar8 = param_3;
    while ((plVar9 = plVar10, cVar1 == '\0' && (plVar8 == (longlong *)plVar9[2]))) {
      cVar1 = *(char *)(plVar9[1] + 0x29);
      plVar10 = (longlong *)plVar9[1];
      plVar8 = plVar9;
    }
  }
  plVar8 = (longlong *)*param_3;
  if (*(char *)((longlong)plVar8 + 0x29) == '\0') {
    plVar10 = plVar8;
    if ((*(char *)(*plVar7 + 0x29) == '\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 + 0x29) == '\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[5];
      *(char *)(plVar9 + 5) = (char)param_3[5];
      *(char *)(param_3 + 5) = (char)lVar3;
      goto LAB_140175f7f;
    }
  }
  else {
    plVar10 = (longlong *)*plVar7;
  }
  plVar8 = (longlong *)param_3[1];
  if (*(char *)((longlong)plVar10 + 0x29) == '\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 + 0x29) == '\0') {
      cVar1 = *(char *)(*plVar10 + 0x29);
      plVar2 = (longlong *)*plVar10;
      plVar7 = plVar10;
      while (plVar5 = plVar2, cVar1 == '\0') {
        plVar2 = (longlong *)*plVar5;
        cVar1 = *(char *)((longlong)plVar2 + 0x29);
        plVar7 = plVar5;
      }
    }
    **(undefined8 **)(param_1 + 8) = plVar7;
  }
  lVar3 = *(longlong *)(param_1 + 8);
  if (*(longlong **)(lVar3 + 0x10) == param_3) {
    if (*(char *)((longlong)plVar10 + 0x29) == '\0') {
      cVar1 = *(char *)(plVar10[2] + 0x29);
      plVar7 = (longlong *)plVar10[2];
      plVar2 = plVar10;
      while (plVar5 = plVar7, cVar1 == '\0') {
        plVar7 = (longlong *)plVar5[2];
        cVar1 = *(char *)((longlong)plVar7 + 0x29);
        plVar2 = plVar5;
      }
      *(longlong **)(lVar3 + 0x10) = plVar2;
    }
    else {
      *(longlong **)(lVar3 + 0x10) = plVar8;
    }
  }
LAB_140175f7f:
  if ((char)param_3[5] == '\x01') {
    if (plVar10 != *(longlong **)(*(longlong *)(param_1 + 8) + 8)) {
      do {
        plVar7 = plVar8;
        if ((char)plVar10[5] != '\x01') break;
        plVar8 = (longlong *)*plVar7;
        if (plVar10 == plVar8) {
          plVar8 = (longlong *)plVar7[2];
          if ((char)plVar8[5] == '\0') {
            *(undefined1 *)(plVar8 + 5) = 1;
            *(undefined1 *)(plVar7 + 5) = 0;
            FUN_1401e2760(param_1,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_140176d00(param_1,plVar8);
                plVar8 = (longlong *)plVar7[2];
              }
              *(char *)(plVar8 + 5) = (char)plVar7[5];
              *(undefined1 *)(plVar7 + 5) = 1;
              *(undefined1 *)(plVar8[2] + 0x28) = 1;
              FUN_1401e2760(param_1,plVar7);
              break;
            }
LAB_140176070:
            *(undefined1 *)(plVar8 + 5) = 0;
          }
        }
        else {
          if ((char)plVar8[5] == '\0') {
            *(undefined1 *)(plVar8 + 5) = 1;
            *(undefined1 *)(plVar7 + 5) = 0;
            FUN_140176d00(param_1,plVar7);
            plVar8 = (longlong *)*plVar7;
          }
          if (*(char *)((longlong)plVar8 + 0x29) == '\0') {
            if ((*(char *)(plVar8[2] + 0x28) == '\x01') && (*(char *)(*plVar8 + 0x28) == '\x01'))
            goto LAB_140176070;
            if (*(char *)(*plVar8 + 0x28) == '\x01') {
              *(undefined1 *)(plVar8[2] + 0x28) = 1;
              *(undefined1 *)(plVar8 + 5) = 0;
              FUN_1401e2760(param_1,plVar8);
              plVar8 = (longlong *)*plVar7;
            }
            *(char *)(plVar8 + 5) = (char)plVar7[5];
            *(undefined1 *)(plVar7 + 5) = 1;
            *(undefined1 *)(*plVar8 + 0x28) = 1;
            FUN_140176d00(param_1,plVar7);
            break;
          }
        }
        plVar8 = (longlong *)plVar7[1];
        plVar10 = plVar7;
      } while (plVar7 != *(longlong **)(*(longlong *)(param_1 + 8) + 8));
    }
    *(undefined1 *)(plVar10 + 5) = 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;
}



ulonglong * FUN_140176110(longlong *param_1,ulonglong *param_2,ulonglong *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_1402c6d50(param_1,uVar5,1,uVar5,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + ((ulonglong)uVar4 % uVar5) * 8);
        puVar3 != (ulonglong *)0x0; puVar3 = (ulonglong *)puVar3[4]) {
      if ((uint)puVar3[5] == 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) {
          if (puVar3[2] == *param_3) {
            return puVar3;
          }
          FUN_1401758d0(puVar3 + 2);
          uVar5 = *param_3;
          puVar3[2] = uVar5;
          puVar3[3] = uVar5;
          if (uVar5 == 0) {
            return puVar3;
          }
          LOCK();
          *(int *)(uVar5 + 8) = *(int *)(uVar5 + 8) + 1;
          UNLOCK();
          return puVar3;
        }
      }
    }
  }
  puVar3 = (ulonglong *)FUN_140176820(param_1,param_2,(ulonglong)uVar4 % uVar5,uVar4);
  if (puVar3[2] != *param_3) {
    FUN_1401758d0(puVar3 + 2);
    uVar5 = *param_3;
    puVar3[2] = uVar5;
    puVar3[3] = uVar5;
    if (uVar5 != 0) {
      LOCK();
      *(int *)(uVar5 + 8) = *(int *)(uVar5 + 8) + 1;
      UNLOCK();
    }
  }
  return puVar3;
}



void FUN_140176230(void)

{
  FUN_140176270();
  return;
}



void FUN_140176250(void)

{
  FUN_1401763c0();
  return;
}



void FUN_140176270(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 + 0x20);
        FUN_140176980(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140176340(longlong *param_1,longlong param_2)

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



void FUN_1401763c0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar7 = 0;
  if ((*param_1 != 0) && (uVar8 = uVar7, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(uVar8 + *param_1);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x18);
        *(longlong *)(lVar3 + 0x18) = param_1[8];
        param_1[1] = param_1[1] + -1;
        param_1[8] = lVar3;
        if (((ulonglong)param_1[1] < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          uVar4 = FUN_1402cddb0(param_1);
          FUN_1401e56e0(param_1,uVar4);
        }
        lVar3 = lVar1;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar5 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar5;
              free(plVar5);
              plVar5 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      uVar8 = uVar8 + 8;
    } 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_1402cddb0(param_1,0);
    FUN_1401e5630(param_1,uVar4);
  }
  param_1[8] = 0;
  plVar5 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar5;
      free(plVar5);
      plVar5 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_140176500(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0x12;
    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 + 0x14;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_140176590(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 10;
    do {
      if ((void *)puVar2[2] != (void *)0x0) {
        operator_delete((void *)puVar2[2]);
      }
      puVar2[2] = 0;
      puVar2[3] = 0;
      puVar2[4] = 0;
      if (7 < *puVar2) {
        operator_delete((void *)puVar2[-3]);
      }
      *puVar2 = 7;
      puVar2[-1] = 0;
      *(undefined2 *)(puVar2 + -3) = 0;
      puVar1 = puVar2 + 6;
      puVar2 = puVar2 + 0x10;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_140176610(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0xf;
    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 + 0x11;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_1401766a0(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0xe;
    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 + 0x10;
    } while (puVar1 != param_2);
  }
  return;
}



undefined4 * FUN_140176720(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];
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff);
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  return param_1;
}



undefined4 * FUN_1401767a0(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];
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff);
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  return param_1;
}



undefined4 *
FUN_140176820(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) < 0x30)
      goto LAB_1401768d7;
      lVar7 = uVar6 * 0x30;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401768d7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 6 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[4] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -6;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 8);
  *puVar2 = *param_2;
  puVar2[1] = param_2[1];
  puVar2[2] = param_2[2];
  puVar2[3] = param_2[3];
  *(undefined8 *)(puVar2 + 4) = 0;
  puVar2[10] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 8) = *(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_1402cddb0(param_1);
    FUN_1402dab20(param_1,uVar4);
  }
  return puVar2;
}



void FUN_140176980(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1401758d0(param_2 + 0x10);
  *(undefined8 *)(param_2 + 0x20) = *(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_1402cddb0(param_1);
    FUN_1402dab20(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_140176a20(longlong param_1)

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



undefined4 * FUN_140176a60(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  for (; param_1 != param_2; param_1 = param_1 + 0x14) {
    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];
      *(undefined8 *)(param_3 + 10) = 7;
      *(undefined8 *)(param_3 + 8) = 0;
      *(undefined2 *)(param_3 + 4) = 0;
      FUN_1400015e0(param_3 + 4,param_1 + 4,0,0xffffffffffffffff,uVar1);
      param_3[0xe] = param_1[0xe];
      param_3[0xf] = param_1[0xf];
      param_3[0x10] = param_1[0x10];
      param_3[0x11] = param_1[0x11];
      param_3[0x12] = param_1[0x12];
    }
    param_3 = param_3 + 0x14;
  }
  return param_3;
}



longlong FUN_140176b20(longlong param_1,longlong param_2,longlong param_3)

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



void FUN_140176b80(longlong param_1)

{
  if (*(void **)(param_1 + 0x80) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x80));
  }
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  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;
  return;
}



void FUN_140176c10(longlong param_1)

{
  if (*(void **)(param_1 + 0xa8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xa8));
  }
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x98)) {
    operator_delete(*(void **)(param_1 + 0x80));
  }
  *(undefined8 *)(param_1 + 0x98) = 7;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined2 *)(param_1 + 0x80) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  return;
}



void FUN_140176cb0(longlong param_1)

{
  FUN_14016ec50(param_1 + -0x300);
  return;
}



void FUN_140176cc0(longlong param_1)

{
  FUN_14016ec50(param_1 + -800);
  return;
}



void FUN_140176cd0(longlong param_1)

{
  FUN_14016ec50(param_1 + -0x340);
  return;
}



void FUN_140176ce0(longlong param_1)

{
  FUN_14016ec50(param_1 + -0x2c0);
  return;
}



void FUN_140176cf0(longlong param_1)

{
  FUN_14016ec50(param_1 + -0x2e0);
  return;
}



void FUN_140176d00(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *param_2;
  *param_2 = *(longlong *)(lVar1 + 0x10);
  if (*(char *)(*(longlong *)(lVar1 + 0x10) + 0x29) == '\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_140176d60(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;
}



undefined8 * FUN_140176e20(undefined8 *param_1,uint param_2)

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



undefined8 FUN_140176e80(undefined8 param_1,uint param_2)

{
  FUN_1403555d0();
  if ((param_2 & 1) != 0) {
    FUN_14035b640(param_1);
  }
  return param_1;
}



void FUN_140176eb0(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  *param_1 = MGSGameProudBase::vftable;
  FUN_140176fd0(param_1 + 0x50);
  operator_delete((void *)param_1[0x50]);
  param_1[0x50] = 0;
  FUN_14034edf0(param_1 + 0x3c);
  if ((void *)param_1[0x38] != (void *)0x0) {
    operator_delete((void *)param_1[0x38]);
  }
  param_1[0x38] = 0;
  param_1[0x39] = 0;
  param_1[0x3a] = 0;
  if ((void *)param_1[0x34] != (void *)0x0) {
    operator_delete((void *)param_1[0x34]);
  }
  param_1[0x34] = 0;
  param_1[0x35] = 0;
  param_1[0x36] = 0;
  FUN_1401625e0(param_1 + 0x2b);
  param_1[0xf] = RNP::CommonS2cProxy::vftable;
  FUN_140385b20();
  FUN_14034edf0(param_1 + 8);
  puVar1 = (undefined8 *)param_1[3];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[3] = 0;
  FUN_1400031d0(param_1 + 4);
  *param_1 = MagiAgentReceive::vftable;
  return;
}



void FUN_140176fd0(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;
}



void * FUN_140177060(void *param_1,uint param_2)

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



undefined1 FUN_140177090(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_SUCKING";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ba980(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140177190(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ON_ATTACK_EVENT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401baab0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140177290(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_DAMAGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bae10(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_1401773b0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_USE_SKILL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bacc0(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_1401774c0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_USE_SKILL_ATTACK_MOTION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bab80(lVar3,param_4,param_5,param_6,param_7,param_8,param_9);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8
FUN_1401775f0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar3 = 0xfffffffffffffffe;
  local_20 = "PT_SET_CONDITION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x300,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    lVar4 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401b81f0(lVar2,param_4,param_5,param_6,param_7,param_8,uVar3,lVar4,1);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_1401776f0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_EMOTION_START";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401baff0(lVar3,param_2,param_4,param_5,param_6,param_7,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140177820(longlong param_1)

{
  char *local_28;
  DWORD local_20;
  longlong local_18;
  
  local_28 = "PT_REQ_REENTER";
  local_18 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_20 = timeGetTime();
  FUN_14004b970(&local_28);
  return 1;
}



undefined1
FUN_140177870(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_TARGET_MOVE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bb100(lVar3,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



void FUN_140177960(undefined8 param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  bool bVar4;
  longlong *local_18;
  longlong *local_10;
  
  FUN_140198570(param_2,&local_18);
  plVar1 = local_18;
  if (local_18 != (longlong *)0x0) {
    if (local_18 == local_10) {
      if (*local_18 != 0) {
        FUN_1402f88a0(*local_18,param_3);
        FUN_1402f8960(*plVar1,param_4);
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar4 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar4) {
        FUN_140176d60(1);
      }
    }
    if (plVar1 == local_10) {
      LOCK();
      plVar1 = plVar1 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        puVar2 = (undefined8 *)*local_18;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        operator_delete(local_18);
      }
    }
    else {
      iVar3 = DAT_140608054 + 1;
      bVar4 = DAT_140608054 == 0;
      DAT_140608054 = iVar3;
      if (bVar4) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



undefined8 FUN_140177a20(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_STATUS_SET";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x300,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      (**(code **)(**(longlong **)(lVar2 + 0xb50) + 0x170))(*(longlong **)(lVar2 + 0xb50),lVar2);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_140177b10(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_POSITION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bb1d0(lVar3,param_5,param_6,param_4,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140177c10(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_TRIGGER_ACTION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bb310(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140177d10(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_STATE_TRIGGER_ACTION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bb5f0(lVar3,param_5,param_6,param_7,param_8);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140177e20(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_STATE_SET_STAY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bb730(lVar3,param_5,param_6,param_7,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140177f20(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_STATE_SET_DOWN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bb870(lVar3,param_5,param_6,param_8,param_11,param_12,param_13);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140178050(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_STATE_DUMP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bba90(lVar3,param_5,param_6,param_7,param_8,param_9,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140178170(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_STATE_ATTACK";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bbbc0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140178270(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_ACTIVE_SKILL_BUFF";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bbc80(lVar3,param_5,param_6,param_4,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140178370(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_SKILL_ADD_EFFECT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bbd60(lVar3,param_5,param_6,param_9,param_10,param_11,param_12);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar3 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_END_ADD_EFFECT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x300,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    lVar4 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if ((*(longlong *)(lVar2 + 0xb58) != 0) &&
         (lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0xb58) + 0x48), lVar2 != 0)) {
        FUN_140195410(lVar2,*param_4,*param_5,*param_6,uVar3,lVar4,1);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_1401785a0(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_PUSH_ADD_EFFECT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bc0f0(lVar3,param_5,param_6,param_7,param_8,param_9,param_10,param_11,
                              param_12,param_13,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140178700(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PLAYER_ACTIVE_SKILL_ONE_SELF";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bcb60(lVar3,param_5,param_6,param_4,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140178800(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_STATE_SET";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bcc40(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140178900(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_WAKE_UP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bced0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140178a00(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PLAYER_MODE_CHANGE_REQ";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bcfa0(lVar3,param_2,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140178b00(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_GET_ONLINE_USER_INFO_RQ";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bd0c0(lVar3,param_2,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140178c00(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_GET_BATTLE_RANK_LIST_RQ";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bd1f0(lVar3,param_2,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140178d00(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PLAYER_STATUS_CHECK";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c2120(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 * FUN_140178e00(undefined8 *param_1)

{
  *param_1 = 0;
  return param_1;
}



undefined8 * FUN_140178e10(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;
}



undefined8 FUN_140178e80(void)

{
  return 0;
}



void FUN_140178e90(void)

{
  return;
}



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

{
  undefined *puVar1;
  int *piVar2;
  bool bVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  undefined8 uVar9;
  undefined8 *puVar10;
  undefined *puVar11;
  undefined *local_res8;
  undefined4 local_res10 [2];
  undefined *local_88;
  undefined4 local_80;
  undefined4 uStack_7c;
  undefined8 local_78;
  undefined8 local_70;
  undefined1 local_68;
  void *local_60 [3];
  ulonglong local_48;
  
  local_78 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  uVar4 = (**(code **)(*param_1 + 0x168))(param_1,param_7);
  lVar8 = FUN_14016e240(param_1,uVar4);
  if (lVar8 != 0) {
    local_88 = *(undefined **)(lVar8 + 0x194);
    local_80 = *(undefined4 *)(lVar8 + 0x19c);
    uStack_7c = *(undefined4 *)(lVar8 + 0x1a0);
    if ((local_88 == (undefined *)0x0) && (*(longlong *)(lVar8 + 0x19c) == 0)) {
      bVar3 = false;
    }
    else {
      bVar3 = true;
    }
    if (!bVar3) {
      FUN_14034fe70();
      local_88 = PTR_DAT_1405d8010;
      iVar5 = FUN_14034fcf0(param_3);
      if (local_88 == (undefined *)0x0) {
        iVar7 = 0;
      }
      else if (local_88 == PTR_DAT_1405d8010) {
        iVar7 = 0;
      }
      else {
        iVar7 = *(int *)(local_88 + -8);
      }
      iVar6 = iVar5;
      if (iVar5 <= iVar7) {
        if (local_88 == (undefined *)0x0) {
          iVar6 = 0;
        }
        else if (local_88 == PTR_DAT_1405d8010) {
          iVar6 = 0;
        }
        else {
          iVar6 = *(int *)(local_88 + -8);
        }
      }
      iVar7 = 1;
      if (1 < iVar6) {
        iVar7 = iVar6;
      }
      if (local_88 == (undefined *)0x0) {
        iVar6 = 0;
      }
      else if (local_88 == PTR_DAT_1405d8010) {
        iVar6 = 0;
      }
      else {
        iVar6 = *(int *)(local_88 + -8);
      }
      if (iVar6 < iVar7) {
        FUN_140002d30(&local_88);
      }
      FUN_140002e10(&local_88);
      puVar11 = local_88;
      if (local_88 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      FUN_14034fd20(puVar11,param_3,iVar5);
      puVar11 = local_88;
      if (local_88 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      iVar7 = FUN_14034fcf0(puVar11);
      iVar5 = 0;
      if (0 < iVar7) {
        iVar5 = iVar7;
      }
      iVar7 = 0;
      if ((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1405d8010)) {
        iVar7 = *(int *)(local_88 + -8);
      }
      if ((iVar5 < iVar7) || (iVar5 = 0, local_88 == (undefined *)0x0)) {
LAB_14017904e:
        if (((local_88 != PTR_DAT_1405d8010) && (local_88 != (undefined *)0x0)) &&
           ((int *)(local_88 + -8) != (int *)0x0)) {
          *(int *)(local_88 + -8) = iVar5;
          *(undefined2 *)(local_88 + (longlong)iVar5 * 2) = 0;
        }
      }
      else if (local_88 != PTR_DAT_1405d8010) {
        iVar5 = *(int *)(local_88 + -8);
        goto LAB_14017904e;
      }
      FUN_14034fe70();
      local_res8 = PTR_DAT_1405d8010;
      iVar7 = FUN_14034fcf0(param_6);
      iVar5 = 0;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar5 = *(int *)(local_res8 + -8);
      }
      iVar6 = iVar7;
      if (((iVar7 <= iVar5) && (iVar6 = 0, local_res8 != (undefined *)0x0)) &&
         (local_res8 != PTR_DAT_1405d8010)) {
        iVar6 = *(int *)(local_res8 + -8);
      }
      iVar5 = 1;
      if (1 < iVar6) {
        iVar5 = iVar6;
      }
      iVar6 = 0;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar6 = *(int *)(local_res8 + -8);
      }
      if (iVar6 < iVar5) {
        FUN_140002d30(&local_res8,iVar5);
      }
      FUN_140002e10(&local_res8);
      puVar11 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      FUN_14034fd20(puVar11,param_6,iVar7);
      puVar11 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      iVar7 = FUN_14034fcf0(puVar11);
      iVar5 = 0;
      if (0 < iVar7) {
        iVar5 = iVar7;
      }
      iVar7 = 0;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar7 = *(int *)(local_res8 + -8);
      }
      if ((iVar7 <= iVar5) && (iVar5 = 0, local_res8 != (undefined *)0x0)) {
        if (local_res8 == PTR_DAT_1405d8010) goto LAB_14017916a;
        iVar5 = *(int *)(local_res8 + -8);
      }
      if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
         ((int *)(local_res8 + -8) != (int *)0x0)) {
        *(int *)(local_res8 + -8) = iVar5;
        *(undefined2 *)(local_res8 + (longlong)iVar5 * 2) = 0;
      }
LAB_14017916a:
      (**(code **)(param_1[0x88] + 0x60))
                (param_1 + 0x88,*(undefined4 *)(lVar8 + 8),&DAT_1405d85a0,param_5,&local_res8,
                 local_res10,&local_88,param_4);
      puVar11 = local_res8;
      if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
         (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_70 = uVar9;
        FUN_14034ed40(uVar9);
        local_68 = 1;
        piVar2 = (int *)(puVar11 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar9);
      }
      puVar11 = local_88;
      if (local_88 == (undefined *)0x0) {
        return;
      }
      if (local_88 == PTR_DAT_1405d8010) {
        return;
      }
      puVar1 = local_88 + -8;
      if (puVar1 == (undefined *)0x0) {
        return;
      }
      local_res8 = PTR_DAT_1405d8010;
      uVar9 = FUN_14034fe70();
      local_70 = uVar9;
      FUN_14034ed40(uVar9);
      local_68 = 1;
      piVar2 = (int *)(puVar11 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar9);
      return;
    }
  }
  if ((param_1[0x9e] == 0) || (*(char *)(param_1[0x9e] + 0x1a) == '\0')) {
    puVar10 = (undefined8 *)FUN_140415800(local_60,param_5);
    if (7 < (ulonglong)puVar10[3]) {
      puVar10 = (undefined8 *)*puVar10;
    }
    FUN_1400050f0(L"FAILED >> RecvGuildInviteFromManager [%s][%s][%s]",puVar10,param_3,param_7);
    if (local_48 < 8) {
      return;
    }
    operator_delete(local_60[0]);
    return;
  }
  FUN_14034fe70();
  local_88 = PTR_DAT_1405d8010;
  iVar7 = FUN_14034fcf0(param_7);
  iVar5 = 0;
  if ((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_88 + -8);
  }
  iVar6 = iVar7;
  if (((iVar7 <= iVar5) && (iVar6 = 0, local_88 != (undefined *)0x0)) &&
     (local_88 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_88 + -8);
  }
  iVar5 = 1;
  if (1 < iVar6) {
    iVar5 = iVar6;
  }
  iVar6 = 0;
  if ((local_88 != (undefined *)0x0) && (iVar6 = 0, local_88 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_88 + -8);
  }
  if (iVar6 < iVar5) {
    FUN_140002d30(&local_88);
  }
  FUN_140002e10(&local_88);
  puVar11 = local_88;
  if (local_88 == (undefined *)0x0) {
    puVar11 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar11,param_7,iVar7);
  puVar11 = local_88;
  if (local_88 == (undefined *)0x0) {
    puVar11 = PTR_DAT_1405d8010;
  }
  iVar7 = FUN_14034fcf0(puVar11);
  iVar5 = 0;
  if (0 < iVar7) {
    iVar5 = iVar7;
  }
  iVar7 = 0;
  if ((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_88 + -8);
  }
  if ((iVar5 < iVar7) || (iVar5 = 0, local_88 == (undefined *)0x0)) {
LAB_140179352:
    if (((local_88 != PTR_DAT_1405d8010) && (local_88 != (undefined *)0x0)) &&
       ((int *)(local_88 + -8) != (int *)0x0)) {
      *(int *)(local_88 + -8) = iVar5;
      *(undefined2 *)(local_88 + (longlong)iVar5 * 2) = 0;
    }
  }
  else if (local_88 != PTR_DAT_1405d8010) {
    iVar5 = *(int *)(local_88 + -8);
    goto LAB_140179352;
  }
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar7 = FUN_14034fcf0(param_3);
  iVar5 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar5 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_res8 + -8);
  }
  iVar6 = iVar7;
  if (iVar7 <= iVar5) {
    iVar6 = 0;
    if ((local_res8 != (undefined *)0x0) && (iVar6 = 0, local_res8 != PTR_DAT_1405d8010)) {
      iVar6 = *(int *)(local_res8 + -8);
    }
  }
  iVar5 = 1;
  if (1 < iVar6) {
    iVar5 = iVar6;
  }
  iVar6 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar6 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_res8 + -8);
  }
  if (iVar6 < iVar5) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar11 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar11 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar11,param_3,iVar7);
  puVar11 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar11 = PTR_DAT_1405d8010;
  }
  iVar7 = FUN_14034fcf0(puVar11);
  iVar5 = 0;
  if (0 < iVar7) {
    iVar5 = iVar7;
  }
  iVar7 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar7 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_res8 + -8);
  }
  if ((iVar7 <= iVar5) && (iVar5 = 0, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_140179469;
    iVar5 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar5;
    *(undefined2 *)(local_res8 + (longlong)iVar5 * 2) = 0;
  }
LAB_140179469:
  (**(code **)(*(longlong *)(param_1[0x9e] + 0x70) + 0x150))
            ((longlong *)(param_1[0x9e] + 0x70),1,&DAT_1405d85a0,local_res10,&local_res8,&local_88,
             &DAT_14047ba80);
  puVar11 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar9 = FUN_14034fe70();
    local_70 = uVar9;
    FUN_14034ed40(uVar9);
    local_68 = 1;
    piVar2 = (int *)(puVar11 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar9);
  }
  puVar11 = local_88;
  if (((local_88 != (undefined *)0x0) && (local_88 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_88 + -8, puVar1 != (undefined *)0x0)) {
    local_res8 = PTR_DAT_1405d8010;
    uVar9 = FUN_14034fe70();
    local_70 = uVar9;
    FUN_14034ed40(uVar9);
    local_68 = 1;
    piVar2 = (int *)(puVar11 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar9);
  }
  return;
}



void FUN_1401795a0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                  int param_5)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined *puVar7;
  int iVar8;
  int local_48 [2];
  undefined *local_40;
  undefined *local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined1 local_20;
  
  local_30 = 0xfffffffffffffffe;
  lVar5 = FUN_14016e240();
  if (lVar5 == 0) {
    FUN_1400050f0(L"ERROR >> RecvGuildInvitAnswerFromManager : rc is NULL!!!");
    return;
  }
  FUN_14034fe70();
  if (param_5 == 0xec) {
    local_38 = PTR_DAT_1405d8010;
    iVar3 = FUN_14034fcf0(param_4);
    iVar8 = 0;
    if ((local_38 != (undefined *)0x0) && (local_38 != PTR_DAT_1405d8010)) {
      iVar8 = *(int *)(local_38 + -8);
    }
    iVar4 = iVar3;
    if (((iVar3 <= iVar8) && (iVar4 = 0, local_38 != (undefined *)0x0)) &&
       (local_38 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(local_38 + -8);
    }
    iVar8 = 1;
    if (1 < iVar4) {
      iVar8 = iVar4;
    }
    iVar4 = 0;
    if ((local_38 != (undefined *)0x0) && (iVar4 = 0, local_38 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(local_38 + -8);
    }
    if (iVar4 < iVar8) {
      FUN_140002d30(&local_38);
    }
    FUN_140002e10(&local_38);
    puVar7 = local_38;
    if (local_38 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar7,param_4,iVar3);
    puVar7 = local_38;
    if (local_38 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1405d8010;
    }
    iVar3 = FUN_14034fcf0(puVar7);
    iVar8 = 0;
    if (0 < iVar3) {
      iVar8 = iVar3;
    }
    iVar3 = 0;
    if ((local_38 != (undefined *)0x0) && (iVar3 = 0, local_38 != PTR_DAT_1405d8010)) {
      iVar3 = *(int *)(local_38 + -8);
    }
    if ((iVar8 < iVar3) || (iVar8 = 0, local_38 == (undefined *)0x0)) {
LAB_14017983a:
      if (((local_38 != PTR_DAT_1405d8010) && (local_38 != (undefined *)0x0)) &&
         ((int *)(local_38 + -8) != (int *)0x0)) {
        *(int *)(local_38 + -8) = iVar8;
        *(undefined2 *)(local_38 + (longlong)iVar8 * 2) = 0;
      }
    }
    else if (local_38 != PTR_DAT_1405d8010) {
      iVar8 = *(int *)(local_38 + -8);
      goto LAB_14017983a;
    }
    (**(code **)(*(longlong *)(param_1 + 0x440) + 0x80))
              ((longlong *)(param_1 + 0x440),*(undefined4 *)(lVar5 + 8),&DAT_1405d85a0,&local_38);
    puVar7 = local_38;
    if (local_38 == (undefined *)0x0) {
      return;
    }
    if (local_38 == PTR_DAT_1405d8010) {
      return;
    }
    puVar1 = local_38 + -8;
    if (puVar1 == (undefined *)0x0) {
      return;
    }
    uVar6 = FUN_14034fe70();
    local_28 = uVar6;
    FUN_14034ed40(uVar6);
    local_20 = 1;
    piVar2 = (int *)(puVar7 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    goto LAB_1401798b8;
  }
  local_40 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_4);
  iVar8 = 0;
  if ((local_40 != (undefined *)0x0) && (local_40 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_40 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_40 != (undefined *)0x0)) &&
     (local_40 != PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar4 = *(int *)(local_40 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_40);
  }
  FUN_140002e10(&local_40);
  puVar7 = local_40;
  if (local_40 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,param_4,iVar3);
  puVar7 = local_40;
  if (local_40 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar7);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_40 != (undefined *)0x0) && (iVar3 = 0, local_40 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_40 + -8);
  }
  if ((iVar8 < iVar3) || (iVar8 = 0, local_40 == (undefined *)0x0)) {
LAB_1401796d4:
    if (((local_40 != PTR_DAT_1405d8010) && (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_1405d8010) {
    iVar8 = *(int *)(local_40 + -8);
    goto LAB_1401796d4;
  }
  local_48[0] = param_5;
  (**(code **)(*(longlong *)(param_1 + 0x440) + 0x90))
            ((longlong *)(param_1 + 0x440),*(undefined4 *)(lVar5 + 8),&DAT_1405d85a0,local_48,
             &local_40);
  puVar7 = local_40;
  if (local_40 == (undefined *)0x0) {
    return;
  }
  if (local_40 == PTR_DAT_1405d8010) {
    return;
  }
  puVar1 = local_40 + -8;
  if (puVar1 == (undefined *)0x0) {
    return;
  }
  uVar6 = FUN_14034fe70();
  local_28 = uVar6;
  FUN_14034ed40(uVar6);
  local_20 = 1;
  piVar2 = (int *)(puVar7 + -4);
  *piVar2 = *piVar2 + -1;
  if (*piVar2 == 0) {
    FUN_14034ff60(puVar1);
  }
LAB_1401798b8:
  FUN_14034edd0(uVar6);
  return;
}



void thunk_FUN_1401798f0(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_1402160c0(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14060808c + 1;
      bVar5 = DAT_14060808c == 0;
      DAT_14060808c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401798f0(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_1402160c0(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14060808c + 1;
      bVar5 = DAT_14060808c == 0;
      DAT_14060808c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



undefined8
FUN_140179970(longlong param_1,int param_2,undefined8 param_3,undefined4 *param_4,short *param_5)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_DEL_ITEM_COUNT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401a6520(lVar2,*param_4,(int)*param_5);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_140179a50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_ITEM_DESTROY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c9e80(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  int local_res8 [2];
  int local_res10 [2];
  int local_48;
  int local_44 [3];
  longlong local_38;
  undefined1 local_30;
  char *local_28;
  DWORD local_20;
  longlong local_18;
  
  local_44[1] = -2;
  local_44[2] = -1;
  local_28 = "PT_REQ_MOVE_STORAGE";
  local_18 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_20 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    local_38 = lVar1;
    FUN_14034ed40(lVar1);
    local_30 = 1;
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_res10[0] = (int)*param_8;
      local_res8[0] = (int)*param_7;
      local_48 = (int)*param_5;
      local_44[0] = (int)*param_4;
      FUN_1401a3880(lVar2,local_44,&local_48,param_6,local_res8,local_res10,*param_9);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_28);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  int local_res8 [2];
  int local_res10 [2];
  int local_48;
  int local_44 [3];
  longlong local_38;
  undefined1 local_30;
  char *local_28;
  DWORD local_20;
  longlong local_18;
  
  local_44[1] = -2;
  local_44[2] = -1;
  local_28 = "PT_REQ_MOVE_INVENTORY";
  local_18 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_20 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    local_38 = lVar1;
    FUN_14034ed40(lVar1);
    local_30 = 1;
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_res10[0] = (int)*param_8;
      local_res8[0] = (int)*param_7;
      local_48 = (int)*param_5;
      local_44[0] = (int)*param_4;
      FUN_14019b620(lVar2,local_44,&local_48,param_6,local_res8,local_res10,*param_9);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_28);
  return 1;
}



undefined1
FUN_140179e00(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_QUICK_MOVE_INVENTORY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ca200(lVar3,param_4,param_5,param_6,param_7,param_8,param_9);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140179f30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_COSTUMEPACK_EQUIP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ca390(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017a040(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_MOVE_RESULT_INVENTORY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ca5f0(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  uint uVar2;
  ulonglong uVar3;
  int *piVar4;
  uint uVar5;
  longlong lVar6;
  undefined4 local_res8 [2];
  undefined8 uVar7;
  longlong lVar8;
  undefined1 uVar9;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar7 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_RANDOM_QUEST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  lVar1 = param_1 + 0x6a8;
  lVar8 = lVar1;
  FUN_14034ed40(lVar1);
  uVar9 = 1;
  piVar4 = *(int **)(param_1 + 0x640);
  lVar6 = *(longlong *)(param_1 + 0x648) - (longlong)piVar4 >> 2;
  if (lVar6 == *(longlong *)(param_1 + 0x688) - *(longlong *)(param_1 + 0x680) >> 2) {
    uVar3 = 0;
    uVar5 = (uint)lVar6;
    if (uVar5 != 0) {
      do {
        if (*piVar4 == *param_4) {
          (**(code **)(*(longlong *)(param_1 + -0x248) + 0xb90))
                    ((longlong *)(param_1 + -0x248),param_2,&DAT_1405d85a0,
                     *(longlong *)(param_1 + 0x680) + uVar3 * 4);
          FUN_14034edd0(lVar1);
          goto LAB_14017a336;
        }
        uVar2 = (int)uVar3 + 1;
        uVar3 = (ulonglong)uVar2;
        piVar4 = piVar4 + 1;
      } while (uVar2 < uVar5);
    }
  }
  else {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 != 1000) {
      if ((DAT_14060b7c4 & 1) == 0) {
        DAT_14060b7c4 = DAT_14060b7c4 | 1;
        FUN_140418590();
        atexit((_func_5014 *)&LAB_140448470);
      }
      if ((((DAT_14060a120 != 200) && (DAT_14060a120 != 0xc9)) && (DAT_14060a120 != 0xca)) &&
         ((DAT_14060a120 != 0xcb && (DAT_14060a120 != 0xcc)))) goto LAB_14017a306;
    }
    FUN_140418da0(DAT_140607fd8,
                  L"Error Size : RandomQuestNpcInstanceID [ %d ] != RandomQuestQuestCode [ %d ]",
                  *(longlong *)(param_1 + 0x648) - *(longlong *)(param_1 + 0x640) >> 2,
                  *(longlong *)(param_1 + 0x688) - *(longlong *)(param_1 + 0x680) >> 2,uVar7,lVar8,
                  uVar9);
  }
LAB_14017a306:
  local_res8[0] = 0;
  (**(code **)(*(longlong *)(param_1 + -0x248) + 0xb90))
            ((longlong *)(param_1 + -0x248),param_2,&DAT_1405d85a0,local_res8);
  FUN_14034edd0(lVar1);
LAB_14017a336:
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_14017a360(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_QUEST_SKIP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ca7a0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017a460(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_QUEST_ACCEPT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ca900(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017a560(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_QUEST_COMPLETE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cad20(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017a670(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_QUEST_SHOW_UPDATE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cb060(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017a770(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_QUEST_GIVEUP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cb1f0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017a870(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_CONTACT_NPC";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cb440(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017a970(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PART_CHANGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cb5a0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017aa70(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_WEAPON_CHANGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cb7d0(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8
FUN_14017ab90(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PORTAL_WARP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar3 = (longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x78);
      (**(code **)(*plVar3 + 0x1c0))
                (plVar3,*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,param_4,param_5,param_6,param_7);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_14017aca0(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_ITEM_EQUIP_REFRESH";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cba40(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017ad90(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_ITEM_EQUIP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cbae0(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017aeb0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_ITEM_UNEQUIP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cbbe0(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017afc0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_ITEM_UNBINDS";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cbcd0(lVar3,param_4,param_5,param_6,param_7,param_8,param_9);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_TRADE_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_140171ac0(*(undefined8 *)(lVar2 + 0xb50),lVar2,*param_4);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8
FUN_14017b1d0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,short *param_5,
             short *param_6)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  int local_res8 [2];
  int local_res10 [2];
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_ITEM_USE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_res10[0] = (int)*param_6;
      local_res8[0] = (int)*param_5;
      iVar2 = FUN_1401a2790(lVar3,local_res8,local_res10,param_4);
      if (iVar2 == 0) {
        local_res10[0] = 0x19;
        local_res8[0] = 0x2b0c;
        plVar4 = (longlong *)(*(longlong *)(lVar3 + 0xb50) + 0x78);
        (**(code **)(*plVar4 + 0x70))
                  (plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,local_res8,local_res10);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_14017b310(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_MOVE_QUICKSLOT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cc090(lVar3,param_4,param_5,param_6,param_7,param_8,param_9);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8
FUN_14017b440(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,short *param_5,
             undefined8 param_6,undefined4 *param_7)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined4 local_res8 [2];
  int local_res10 [2];
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_USE_QUICKSLOT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_res10[0] = (int)*param_5;
      iVar2 = FUN_1401a2d80(lVar3,local_res10,param_4,*param_7);
      if (iVar2 == 0) {
        local_res10[0] = 0x19;
        local_res8[0] = 0x2b14;
        plVar4 = (longlong *)(*(longlong *)(lVar3 + 0xb50) + 0x78);
        (**(code **)(*plVar4 + 0x70))
                  (plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,local_res8,local_res10);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8
FUN_14017b570(longlong param_1,int param_2,undefined8 param_3,short *param_4,undefined4 *param_5,
             undefined8 param_6)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined2 local_res10 [4];
  undefined8 uVar5;
  longlong lVar6;
  char *local_30;
  DWORD local_28;
  longlong local_20;
  
  uVar5 = 0xfffffffffffffffe;
  local_30 = "PT_REQ_EQUIP_SKILL";
  local_20 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_28 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    lVar6 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      iVar2 = FUN_140198ec0(lVar3,(int)*param_4,*param_5,param_6);
      if (iVar2 != 0) {
        local_res10[0] = *(undefined2 *)param_5;
        plVar4 = (longlong *)(*(longlong *)(lVar3 + 0xb50) + 0x78);
        (**(code **)(*plVar4 + 0x330))
                  (plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,param_4,local_res10,param_6,
                   uVar5,lVar6);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_30);
  return 1;
}



undefined8 FUN_14017b6b0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_LEARN_SKILL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401b0ec0(lVar2,param_4);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_14017b780(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_UPDATE_ITEM_QUEST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cc220(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_14017b880(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar3 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_LOGOUT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    lVar4 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      (**(code **)(**(longlong **)(lVar2 + 0xb50) + 0x188))
                (*(longlong **)(lVar2 + 0xb50),lVar2,3,param_4,uVar3,lVar4,1);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_14017b950(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_CHATTING";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cc400(lVar3,param_2,param_4,param_6,param_7,param_8,param_9,param_10,
                              param_11,param_12,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017bab0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_WHISPER_CHATTING";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cd420(lVar3,param_4,param_5,param_7,param_8,param_9,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8
FUN_14017bbe0(longlong param_1,int param_2,undefined8 param_3,short *param_4,short *param_5,
             undefined8 param_6,short *param_7,short *param_8)

{
  longlong lVar1;
  longlong lVar2;
  int local_res8 [2];
  int local_res10 [2];
  int local_48;
  int local_44 [3];
  longlong local_38;
  undefined1 local_30;
  char *local_28;
  DWORD local_20;
  longlong local_18;
  
  local_44[1] = -2;
  local_44[2] = -1;
  local_28 = "PT_REQ_BOOTH_MOVE_INVENTORY";
  local_18 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_20 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    local_38 = lVar1;
    FUN_14034ed40(lVar1);
    local_30 = 1;
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_res10[0] = (int)*param_8;
      local_res8[0] = (int)*param_7;
      local_48 = (int)*param_5;
      local_44[0] = (int)*param_4;
      FUN_14019b2d0(lVar2,local_44,&local_48,param_6,local_res8,local_res10);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_28);
  return 1;
}



undefined8
FUN_14017bd20(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined4 *param_5
             ,short *param_6,short *param_7,short *param_8)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined4 local_res8 [2];
  undefined4 local_res10 [2];
  undefined8 in_stack_ffffffffffffffa8;
  undefined4 uVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar5 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);
  local_20 = "PT_REQ_SKILL_QUICKSLOT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      iVar2 = FUN_1401993d0(lVar3,param_4,*param_5,(int)*param_6,CONCAT44(uVar5,(int)*param_7),1,
                            (int)*param_8);
      if (iVar2 == 0) {
        local_res10[0] = 0x16;
        local_res8[0] = 0x2b12;
        plVar4 = (longlong *)(*(longlong *)(lVar3 + 0xb50) + 0x78);
        (**(code **)(*plVar4 + 0x70))
                  (plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,local_res8,local_res10);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8
FUN_14017be80(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,short *param_5,
             undefined4 *param_6)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined4 local_res8 [2];
  undefined4 local_res10 [2];
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_EMPTY_QUICKSLOT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      iVar2 = FUN_140199580(lVar3,param_4,(int)*param_5,*param_6);
      if (iVar2 == 0) {
        local_res10[0] = 0x35;
        local_res8[0] = 0x2b13;
        plVar4 = (longlong *)(*(longlong *)(lVar3 + 0xb50) + 0x78);
        (**(code **)(*plVar4 + 0x70))
                  (plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,local_res8,local_res10);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_SWAP_INVENTORY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401a3270(lVar2,(int)*param_4,(int)*param_5,(int)*param_6,param_7,param_8,*param_9);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_14017c0c0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_GOLD_IN_STORAGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cd710(lVar3,param_2,param_4,param_5,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017c1d0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_GOLD_OUT_STORAGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cdd40(lVar3,param_2,param_4,param_5,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8
FUN_14017c2e0(longlong param_1,int param_2,undefined8 param_3,short *param_4,short *param_5,
             undefined8 param_6,undefined8 param_7,undefined4 *param_8)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar3 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_SWAP_STORAGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    lVar4 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401a3470(lVar2,(int)*param_4,(int)*param_5,param_6,param_7,*param_8,uVar3,lVar4,1);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8
FUN_14017c3e0(longlong param_1,int param_2,undefined8 param_3,short *param_4,short *param_5,
             short *param_6,short *param_7,short *param_8)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar3 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_SWAP_QUICKSLOT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    lVar4 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401a3680(lVar2,(int)*param_4,(int)*param_5,(int)*param_6,(int)*param_7,(int)*param_8,
                    uVar3,lVar4,1);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_14017c4f0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_ITEM_REPAIR";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401ce510(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_14017c600(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_ALL_ITEM_REPAIR";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401cf060(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017c6f0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ITEM_BOX_STATE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d00e0(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017c810(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ITEM_BOX_STATE_ENEMY_RESPAWN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d0180(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017c930(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_ENCHANT_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d0210(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017ca50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_MIX_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d0450(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017cb70(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_DECOMPOSITION_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d05b0(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_14017cc80(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_UNEQUIP_TITLE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401d97b0(lVar2);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_14017cd40(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_EQUIP_TITLE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d1a10(lVar3,param_2,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017ce40(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_ITEM_SOCKET_PENETRATION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d1e80(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14017cf50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_ITEM_SOCKET_EQUIP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d1fd0(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_14017d060(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_CONTROL_KEY_SAVE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d2120(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_14017d160(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_RUNEVENDINGMACHINE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401ac110(lVar2,param_4);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_14017d230(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  
  DVar3 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = timeGetTime();
    if (0x32 < DVar4 - DVar3) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_CHANGE_ITEMOPTION");
    }
  }
  else {
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_CHANGE_ITEMOPTION");
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar2 = FUN_1401d21d0(lVar5,param_4,param_5,param_6,param_7,param_8,param_9);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar3) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_CHANGE_ITEMOPTION");
        }
        return uVar2;
      }
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_CHANGE_ITEMOPTION");
        return 1;
      }
    }
  }
  return 1;
}



undefined1
FUN_14017d3e0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  
  DVar3 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = timeGetTime();
    if (0x32 < DVar4 - DVar3) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_SAVE_FATIGUE_STORAGE");
    }
  }
  else {
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_SAVE_FATIGUE_STORAGE");
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar2 = FUN_1401d2420(lVar5,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar3) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_SAVE_FATIGUE_STORAGE"
                       );
        }
        return uVar2;
      }
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_SAVE_FATIGUE_STORAGE");
        return 1;
      }
    }
  }
  return 1;
}



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

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  DWORD DVar7;
  
  uVar5 = 0xfffffffffffffffe;
  pcVar6 = "PT_REQ_USE_FATIGUE_STORAGE";
  DVar2 = timeGetTime();
  DVar7 = DVar2;
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401ade80(lVar4,*param_4);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_USE_FATIGUE_STORAGE",uVar5,
                  pcVar6,DVar7);
  }
  return 1;
}



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

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  DWORD DVar7;
  
  uVar5 = 0xfffffffffffffffe;
  pcVar6 = "PT_REQ_TIDY_STORAGE";
  DVar2 = timeGetTime();
  DVar7 = DVar2;
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401af6f0(lVar4,*param_4);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_TIDY_STORAGE",uVar5,pcVar6,
                  DVar7);
  }
  return 1;
}



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

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  DWORD DVar7;
  
  uVar5 = 0xfffffffffffffffe;
  pcVar6 = "PT_REQ_TIDY_INVENTORY";
  DVar2 = timeGetTime();
  DVar7 = DVar2;
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401af890(lVar4,*param_4);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_TIDY_INVENTORY",uVar5,
                  pcVar6,DVar7);
  }
  return 1;
}



undefined1 FUN_14017d840(longlong param_1,int param_2)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  undefined1 uVar9;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_CASH_BALANCE";
  DVar2 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = DVar2;
    DVar3 = timeGetTime();
    if (0x32 < DVar3 - DVar2) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_CASH_BALANCE",uVar6,
                    pcVar7,DVar4);
    }
  }
  else {
    DVar4 = DVar2;
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_CASH_BALANCE",uVar6,
                      pcVar7,DVar4);
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      lVar8 = lVar1;
      FUN_14034ed40(lVar1);
      uVar9 = 1;
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar9 = FUN_1401d2670(lVar5);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar2) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar2,"PT_REQ_CASH_BALANCE");
        }
        return uVar9;
      }
      FUN_14034edd0(lVar1);
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_CASH_BALANCE",uVar6,
                      pcVar7,DVar4,lVar8,uVar9);
        return 1;
      }
    }
  }
  return 1;
}



undefined1
FUN_14017d9a0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  undefined1 uVar9;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_BUY_CASH_PRODUCT";
  DVar2 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = DVar2;
    DVar3 = timeGetTime();
    if (0x32 < DVar3 - DVar2) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_BUY_CASH_PRODUCT",uVar6,
                    pcVar7,DVar4);
    }
  }
  else {
    DVar4 = DVar2;
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_BUY_CASH_PRODUCT",uVar6
                      ,pcVar7,DVar4);
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      lVar8 = lVar1;
      FUN_14034ed40(lVar1);
      uVar9 = 1;
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar9 = FUN_1401d2a30(lVar5,param_4,param_5);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar2) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar2,"PT_REQ_BUY_CASH_PRODUCT");
        }
        return uVar9;
      }
      FUN_14034edd0(lVar1);
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_BUY_CASH_PRODUCT",uVar6
                      ,pcVar7,DVar4,lVar8,uVar9);
        return 1;
      }
    }
  }
  return 1;
}



undefined1 FUN_14017db20(longlong param_1,int param_2)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  undefined1 uVar9;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_LIST_CASH_PRODUCT";
  DVar2 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = DVar2;
    DVar3 = timeGetTime();
    if (0x32 < DVar3 - DVar2) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_LIST_CASH_PRODUCT",uVar6,
                    pcVar7,DVar4);
    }
  }
  else {
    DVar4 = DVar2;
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_LIST_CASH_PRODUCT",
                      uVar6,pcVar7,DVar4);
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      lVar8 = lVar1;
      FUN_14034ed40(lVar1);
      uVar9 = 1;
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar9 = FUN_1401d3780(lVar5);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar2) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar2,"PT_REQ_LIST_CASH_PRODUCT");
        }
        return uVar9;
      }
      FUN_14034edd0(lVar1);
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_LIST_CASH_PRODUCT",
                      uVar6,pcVar7,DVar4,lVar8,uVar9);
        return 1;
      }
    }
  }
  return 1;
}



undefined8
FUN_14017dc80(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,short *param_5,
             short *param_6)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  int local_res10 [2];
  int local_48 [2];
  undefined8 local_40;
  char *local_38;
  DWORD local_30;
  longlong local_28;
  undefined1 local_20;
  
  local_40 = 0xfffffffffffffffe;
  local_38 = "PT_REQ_MOVE_CASH_PRODUCT";
  DVar2 = timeGetTime();
  local_30 = DVar2;
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    local_28 = lVar1;
    FUN_14034ed40(lVar1);
    local_20 = 1;
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_res10[0] = (int)*param_6;
      local_48[0] = (int)*param_5;
      FUN_1401af9f0(lVar4,local_48,local_res10,param_4);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_MOVE_CASH_PRODUCT");
  }
  return 1;
}



undefined8 FUN_14017dd90(longlong param_1,int param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined *puVar5;
  
  DVar2 = timeGetTime();
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      puVar5 = (undefined *)*param_4;
      if ((undefined *)*param_4 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1405d8010;
      }
      FUN_140200100(*(undefined8 *)(lVar4 + 0xb50),*(undefined4 *)(lVar4 + 0x288),
                    *(undefined4 *)(lVar4 + 0x284),*(undefined4 *)(lVar4 + 8),puVar5);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_CHECK_RECVUSER");
  }
  return 1;
}



undefined8
FUN_14017dea0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,short *param_5,
             short *param_6,longlong *param_7,undefined1 *param_8)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined *puVar5;
  int local_res10 [2];
  int local_48 [2];
  undefined8 local_40;
  char *local_38;
  DWORD local_30;
  longlong local_28;
  undefined1 local_20;
  
  local_40 = 0xfffffffffffffffe;
  local_38 = "PT_REQ_ITEM_LOCK";
  DVar2 = timeGetTime();
  local_30 = DVar2;
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    local_28 = lVar1;
    FUN_14034ed40(lVar1);
    local_20 = 1;
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      local_res10[0] = (int)*param_6;
      local_48[0] = (int)*param_5;
      puVar5 = (undefined *)*param_7;
      if ((undefined *)*param_7 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1405d8010;
      }
      FUN_1401b0a60(lVar4,local_48,local_res10,param_4,puVar5,*param_8);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_ITEM_LOCK");
  }
  return 1;
}



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

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  longlong lVar7;
  
  uVar5 = 0xfffffffffffffffe;
  pcVar6 = "PT_REQ_CASH_ENCHANT_COMPOSE";
  DVar2 = timeGetTime();
  if ((param_2 != 0) && (DVar3 = DVar2, lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)
     ) {
    lVar1 = lVar4 + 0x680;
    lVar7 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401b20e0(lVar4,lVar4,*param_4,*param_5,*param_6,*param_7,uVar5,pcVar6,DVar3,lVar7,1);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_CASH_ENCHANT_COMPOSE");
  }
  return 1;
}



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

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  longlong lVar7;
  
  uVar5 = 0xfffffffffffffffe;
  pcVar6 = "PT_REQ_STRENGTHEN_COMPOSE";
  DVar2 = timeGetTime();
  if ((param_2 != 0) && (DVar3 = DVar2, lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)
     ) {
    lVar1 = lVar4 + 0x680;
    lVar7 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401b2760(lVar4,lVar4,*param_4,*param_5,*param_6,*param_7,uVar5,pcVar6,DVar3,lVar7,1);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_STRENGTHEN_COMPOSE");
  }
  return 1;
}



undefined1
FUN_14017e220(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_STRENGTHEN_COMPOSE_PET";
  DVar3 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = timeGetTime();
    if (0x32 < DVar4 - DVar3) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_STRENGTHEN_COMPOSE_PET");
    }
  }
  else {
    DVar4 = DVar3;
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_STRENGTHEN_COMPOSE_PET"
                     );
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      lVar8 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar2 = FUN_1401d3800(lVar5,param_4,param_5,param_6,param_7,param_8,uVar6,pcVar7,DVar4,lVar8
                              ,1);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar3) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,
                        "PT_REQ_STRENGTHEN_COMPOSE_PET");
        }
        return uVar2;
      }
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_STRENGTHEN_COMPOSE_PET"
                     );
        return 1;
      }
    }
  }
  return 1;
}



undefined8 FUN_14017e3c0(longlong param_1,int param_2)

{
  DWORD DVar1;
  DWORD DVar2;
  longlong lVar3;
  undefined8 uVar4;
  char *pcVar5;
  DWORD DVar6;
  
  uVar4 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if ((DAT_14060a120 != 200) && (DAT_14060a120 != 100)) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 != 1000) {
      if ((DAT_14060b7c4 & 1) == 0) {
        DAT_14060b7c4 = DAT_14060b7c4 | 1;
        FUN_140418590();
        atexit((_func_5014 *)&LAB_140448470);
      }
      if ((DAT_14060a120 != 0xcb) && (DAT_14060a120 != 0x67)) {
        return 1;
      }
    }
  }
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a0e3 != '\0') {
    pcVar5 = "PT_RESP_NPROTECT";
    DVar1 = timeGetTime();
    DVar6 = DVar1;
    if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar3 != 0)) {
      FUN_14034ed40(lVar3 + 0x680);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar3 + 0x680);
      }
      else {
        FUN_14034edd0(lVar3 + 0x680);
      }
    }
    DVar2 = timeGetTime();
    if (0x32 < DVar2 - DVar1) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"PT_RESP_NPROTECT",uVar4,pcVar5,
                    DVar6);
    }
  }
  return 1;
}



undefined8 FUN_14017e570(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  DWORD DVar7;
  
  uVar5 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if ((DAT_14060a120 == 0xc9) || (DAT_14060a120 == 0x65)) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a0e4 != '\0') {
      pcVar6 = "PT_XTRAP_CS_STEP2";
      DVar2 = timeGetTime();
      DVar7 = DVar2;
      if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
        lVar1 = lVar4 + 0x680;
        FUN_14034ed40(lVar1);
        if (*(char *)(lVar4 + 0x6b8) == '\0') {
          FUN_14034edd0(lVar1);
        }
        else {
          FUN_1401d39d0(lVar4,param_4);
          FUN_14034edd0(lVar1);
        }
      }
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_XTRAP_CS_STEP2",uVar5,
                      pcVar6,DVar7);
      }
    }
  }
  return 1;
}



undefined8 FUN_14017e6d0(longlong param_1,int param_2)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  undefined8 uVar5;
  char *pcVar6;
  DWORD DVar7;
  
  uVar5 = 0xfffffffffffffffe;
  pcVar6 = "PT_CHECK_QUEST_MODE_CHANGE";
  DVar2 = timeGetTime();
  DVar7 = DVar2;
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401a8a00(lVar4);
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_CHECK_QUEST_MODE_CHANGE",uVar5,
                  pcVar6,DVar7);
  }
  return 1;
}



undefined8 FUN_14017e7b0(longlong param_1,int param_2)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  DWORD DVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_OPEN_SCRIPT_LOG";
  DVar2 = timeGetTime();
  DVar8 = DVar2;
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar4 + 0x298)) {
        plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0xad0))(plVar5,param_2,&DAT_1405d85a0);
      }
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_OPEN_SCRIPT_LOG",uVar6,
                  pcVar7,DVar8);
  }
  return 1;
}



undefined8 FUN_14017e8b0(longlong param_1,int param_2)

{
  longlong lVar1;
  code *pcVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  undefined4 local_res10 [2];
  undefined2 local_b8;
  undefined6 uStack_b6;
  undefined8 local_a8;
  ulonglong local_a0;
  undefined4 *local_90;
  undefined4 *local_88;
  undefined4 *local_80;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_60;
  char *local_50;
  DWORD local_48;
  longlong local_40;
  undefined1 local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  local_50 = "PT_PROTOCOL_CHECK";
  DVar3 = timeGetTime();
  local_48 = DVar3;
  if (param_2 == 0) {
    DVar4 = timeGetTime();
    if (0x32 < DVar4 - DVar3) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_PROTOCOL_CHECK");
    }
  }
  else {
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_PROTOCOL_CHECK");
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      local_40 = lVar1;
      FUN_14034ed40(lVar1);
      local_38 = 1;
      if (*(char *)(lVar5 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar3) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_PROTOCOL_CHECK");
        }
      }
      else {
        uVar9 = 0;
        local_70 = 0;
        local_68 = 0;
        local_60 = 0;
        local_90 = (undefined4 *)0x0;
        local_88 = (undefined4 *)0x0;
        local_80 = (undefined4 *)0x0;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AGENTMONITOR2AGENTMANAGER_PROTOCOL::Rmi_Last",0x2c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x866d;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0x866d;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AGENTMANAGER2AGENTMONITOR_PROTOCOL::Rmi_Last",0x2c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x86d3;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0x86d3;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AGENT2AGENTMANAGER_PROTOCOL::Rmi_Last",0x25);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x85a4;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0x85a4;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AGENTMANAGER2AGENT_PROTOCOL::Rmi_Last",0x25);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x860e;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0x860e;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AGENT2SERVER_PROTOCOL::Rmi_Last",0x1f);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x84df;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0x84df;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"SERVER2AGENT_PROTOCOL::Rmi_Last",0x1f);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x8541;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0x8541;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AUCTION2SERVERS_PROTOCOL::Rmi_Last",0x22);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xafd1;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0xafd1;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"SERVERS2AUCTION_PROTOCOL::Rmi_Last",0x22);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xb034;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              uVar8 = uVar9;
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar8 = uVar7 + (uVar7 >> 1);
              }
              if (uVar8 < uVar10) {
                uVar8 = uVar10;
              }
              FUN_140051e60(&local_90,uVar8);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0xb034;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"CHARACTER_PROTOCOL::Rmi_Last",0x1c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x9cd0;
        if ((local_res10 < local_88) && (local_90 <= local_res10)) {
          lVar5 = (longlong)local_res10 - (longlong)local_90;
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar9 = uVar7 + (uVar7 >> 1);
              }
              if (uVar9 < uVar10) {
                uVar9 = uVar10;
              }
              FUN_140051e60(&local_90,uVar9);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = local_90[lVar5 >> 2];
          }
        }
        else {
          if (local_88 == local_80) {
            uVar10 = (longlong)local_88 - (longlong)local_90 >> 2;
            if (0x3ffffffffffffffe < uVar10) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              uVar6 = (*pcVar2)();
              return uVar6;
            }
            uVar10 = uVar10 + 1;
            uVar7 = (longlong)local_80 - (longlong)local_90 >> 2;
            if (uVar7 < uVar10) {
              if (uVar7 <= 0x3fffffffffffffff - (uVar7 >> 1)) {
                uVar9 = uVar7 + (uVar7 >> 1);
              }
              if (uVar9 < uVar10) {
                uVar9 = uVar10;
              }
              FUN_140051e60(&local_90,uVar9);
            }
          }
          if (local_88 != (undefined4 *)0x0) {
            *local_88 = 0x9cd0;
          }
        }
        local_88 = local_88 + 1;
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"CHEAT_S2C::Rmi_Last",0x13);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x3336;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"CHEAT_C2S::Rmi_Last",0x13);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x3340;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"COMMON_C2S::Rmi_Last",0x14);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x2b7d;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"COMMON_S2C::Rmi_Last",0x14);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x2fc3;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"DBC2SERVERS_PROTOCOL::Rmi_Last",0x1e);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x2b47;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"SERVERS2DBC_PROTOCOL::Rmi_Last",0x1e);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x2fe7;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"G2G_PROTOCOL::Rmi_Last",0x16);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xa8e;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"GG_PROTOCOL::Rmi_Last",0x15);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x9d2;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"PG_PROTOCOL::Rmi_Last",0x15);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x604;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"SERVERS2GM_PROTOCOL::Rmi_Last",0x1d);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x7d16;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"GM2SERVERS_PROTOCOL::Rmi_Last",0x1d);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x80f9;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AGENTMANAGER2GMTOOLS_PROTOCOL::Rmi_Last",0x27);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x9473;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"GMTOOLS2AGENTMANAGER_PROTOCOL::Rmi_Last",0x27);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x985d;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"GUILDLOBBY2SERVERS_PROTOCOL::Rmi_Last",0x25);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x3eae;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"SERVERS2GUILDLOBBY_PROTOCOL::Rmi_Last",0x25);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x4291;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"L2S_PROTOCOL::Rmi_Last",0x16);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xbc5;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"S2L_PROTOCOL::Rmi_Last",0x16);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xc24;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"MANAGER2S_PROTOCOL::Rmi_Last",0x1c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xc37b;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"S2MANAGER_PROTOCOL::Rmi_Last",0x1c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xc75a;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"MATCH2SERVER_PROTOCOL::Rmi_Last",0x1f);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x4670;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"SERVER2MATCH_PROTOCOL::Rmi_Last",0x1f);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x4a6b;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"MINIGAME2CLIENT_PROTOCOL::Rmi_Last",0x22);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x9c4c;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"CLIENT2MINIGAME_PROTOCOL::Rmi_Last",0x22);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xa02f;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"MSG2SERVERS_PROTOCOL::Rmi_Last",0x1e);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x36bb;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"SERVERS2MSG_PROTOCOL::Rmi_Last",0x1e);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x3aa1;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AM2A_PROTOCOL::Rmi_Last",0x17);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x7535;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"A2AM_PROTOCOL::Rmi_Last",0x17);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x791a;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"A2RHS_PROTOCOL::Rmi_Last",0x18);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x7d04;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"RHS2A_PROTOCOL::Rmi_Last",0x18);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x80ea;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AgentC2S::Rmi_Last",0x12);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x3ea;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"AgentS2C::Rmi_Last",0x12);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x7d5;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"TCP_AUCTION_PROTOCOL::Rmi_Last",0x1e);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0xb3be;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"TCP_BOOTH_PROTOCOL::Rmi_Last",0x1c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x1783;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"TCP_FRIEND_PROTOCOL::Rmi_Last",0x1d);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x1b6b;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"TCP_GUILD_PROTOCOL::Rmi_Last",0x1c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x1f91;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"TCP_PARTY_PROTOCOL::Rmi_Last",0x1c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x233d;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"TCP_TRADE_PROTOCOL::Rmi_Last",0x1c);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x2721;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"UDP_PROTOCOL::Rmi_Last",0x16);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x4ef7;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"TCP_PROTOCOL::Rmi_Last",0x16);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x140c;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"WORLD_S2C::Rmi_Last",0x13);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x75e8;
        FUN_14012e5c0(&local_90,local_res10);
        local_a0 = 7;
        local_a8 = 0;
        local_b8 = 0;
        FUN_140001710(&local_b8,L"WORLD_C2S::Rmi_Last",0x13);
        FUN_14008ec00(&local_70,&local_b8);
        if (7 < local_a0) {
          operator_delete((void *)CONCAT62(uStack_b6,local_b8));
        }
        local_res10[0] = 0x7927;
        FUN_14012e5c0(&local_90,local_res10);
        (**(code **)(*(longlong *)(param_1 + -0x248) + 0xcd0))
                  ((longlong *)(param_1 + -0x248),param_2,&DAT_1405d85a0,&local_70,&local_90);
        if (local_90 != (undefined4 *)0x0) {
          std::_Container_base0::_Orphan_all((_Container_base0 *)&local_90);
          operator_delete(local_90);
        }
        local_90 = (undefined4 *)0x0;
        local_88 = (undefined4 *)0x0;
        local_80 = (undefined4 *)0x0;
        FUN_14008d060(&local_70);
        FUN_14034edd0(lVar1);
        FUN_140418b00(&local_50);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401805b0(longlong param_1,int param_2)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  char *pcVar7;
  DWORD DVar8;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_OPEN_SYSCONSOLE";
  DVar2 = timeGetTime();
  DVar8 = DVar2;
  if ((param_2 != 0) && (lVar4 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar4 != 0)) {
    lVar1 = lVar4 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar4 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar4 + 0x298)) {
        plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0xa00))(plVar5,param_2,&DAT_1405d85a0);
      }
      FUN_14034edd0(lVar1);
    }
  }
  DVar3 = timeGetTime();
  if (0x32 < DVar3 - DVar2) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_OPEN_SYSCONSOLE",uVar6,
                  pcVar7,DVar8);
  }
  return 1;
}



undefined1 FUN_1401806b0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  undefined1 uVar9;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_HAIR_CUT_CHANGE";
  DVar2 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = DVar2;
    DVar3 = timeGetTime();
    if (0x32 < DVar3 - DVar2) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_HAIR_CUT_CHANGE",uVar6,
                    pcVar7,DVar4);
    }
  }
  else {
    DVar4 = DVar2;
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_HAIR_CUT_CHANGE",uVar6,
                      pcVar7,DVar4);
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      lVar8 = lVar1;
      FUN_14034ed40(lVar1);
      uVar9 = 1;
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar9 = FUN_1401d3ac0(lVar5,param_2,param_4);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar2) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar2,"PT_REQ_HAIR_CUT_CHANGE");
        }
        return uVar9;
      }
      FUN_14034edd0(lVar1);
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_HAIR_CUT_CHANGE",uVar6,
                      pcVar7,DVar4,lVar8,uVar9);
        return 1;
      }
    }
  }
  return 1;
}



undefined1 FUN_140180820(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  undefined1 uVar9;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_HAIR_COLOR_CHANGE";
  DVar2 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = DVar2;
    DVar3 = timeGetTime();
    if (0x32 < DVar3 - DVar2) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_HAIR_COLOR_CHANGE",uVar6,
                    pcVar7,DVar4);
    }
  }
  else {
    DVar4 = DVar2;
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_HAIR_COLOR_CHANGE",
                      uVar6,pcVar7,DVar4);
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      lVar8 = lVar1;
      FUN_14034ed40(lVar1);
      uVar9 = 1;
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar9 = FUN_1401d4390(lVar5,param_2,param_4);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar2) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar2,"PT_REQ_HAIR_COLOR_CHANGE");
        }
        return uVar9;
      }
      FUN_14034edd0(lVar1);
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_HAIR_COLOR_CHANGE",
                      uVar6,pcVar7,DVar4,lVar8,uVar9);
        return 1;
      }
    }
  }
  return 1;
}



undefined1
FUN_140180990(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_INSERT_INQUIRY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d4f00(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140180a90(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_UPDATE_INQUIRY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d5360(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140180b90(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_DELETE_INQUIRY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d5470(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140180c80(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PET_REBIRTH_COINT_VALUE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d5670(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140180d80(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_CASHSHOP_OPEN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d57a0(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140180e70(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  
  DVar3 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = timeGetTime();
    if (0x32 < DVar4 - DVar3) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_COSTUME_CHARGE");
    }
  }
  else {
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_COSTUME_CHARGE");
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar2 = FUN_1401d58c0(lVar5,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar3) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_COSTUME_CHARGE");
        }
        return uVar2;
      }
      FUN_14034edd0(lVar1);
      DVar4 = timeGetTime();
      if (0x32 < DVar4 - DVar3) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar3,"PT_REQ_COSTUME_CHARGE");
        return 1;
      }
    }
  }
  return 1;
}



undefined1
FUN_140181000(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_QUEST_CLIENT_COMPLETE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d5a80(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140181110(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  DWORD DVar2;
  DWORD DVar3;
  DWORD DVar4;
  longlong lVar5;
  undefined8 uVar6;
  char *pcVar7;
  longlong lVar8;
  undefined1 uVar9;
  
  uVar6 = 0xfffffffffffffffe;
  pcVar7 = "PT_REQ_COSTUME_CHARGE";
  DVar2 = timeGetTime();
  if (param_2 == 0) {
    DVar4 = DVar2;
    DVar3 = timeGetTime();
    if (0x32 < DVar3 - DVar2) {
      FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_COSTUME_CHARGE",uVar6,
                    pcVar7,DVar4);
    }
  }
  else {
    DVar4 = DVar2;
    lVar5 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar5 == 0) {
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_COSTUME_CHARGE",uVar6,
                      pcVar7,DVar4);
        return 1;
      }
    }
    else {
      lVar1 = lVar5 + 0x680;
      lVar8 = lVar1;
      FUN_14034ed40(lVar1);
      uVar9 = 1;
      if (*(char *)(lVar5 + 0x6b8) != '\0') {
        uVar9 = FUN_1401d96b0(lVar5,param_4,param_5);
        FUN_14034edd0(lVar1);
        DVar4 = timeGetTime();
        if (0x32 < DVar4 - DVar2) {
          FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar4 - DVar2,"PT_REQ_COSTUME_CHARGE");
        }
        return uVar9;
      }
      FUN_14034edd0(lVar1);
      DVar3 = timeGetTime();
      if (0x32 < DVar3 - DVar2) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar3 - DVar2,"PT_REQ_COSTUME_CHARGE",uVar6,
                      pcVar7,DVar4,lVar8,uVar9);
        return 1;
      }
    }
  }
  return 1;
}



undefined1 FUN_140181290(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_DELETE_BUFF";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d9e50(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8
FUN_140181390(longlong param_1,int param_2,undefined8 param_3,short *param_4,short *param_5,
             short *param_6,short *param_7)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_TARGET_ITEM_USE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401dd7c0(lVar2,(int)*param_4,(int)*param_5,(int)*param_6,(int)*param_7);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8 FUN_140181490(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_UPDATE_TUTORIAL_STEP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401de370(lVar2,param_4);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140181560(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_GUILD_SKILL_LIST_ONCE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2c0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d0ec0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140181660(longlong param_1,int param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined *puVar3;
  undefined8 uVar4;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  longlong local_30;
  undefined1 local_28;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_SET_SECOND_PASS";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x208) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2c0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    local_30 = lVar1;
    FUN_14034ed40(lVar1);
    local_28 = 1;
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      puVar3 = (undefined *)*param_4;
      if ((undefined *)*param_4 == (undefined *)0x0) {
        puVar3 = PTR_DAT_1405d8008;
      }
      local_40 = *(undefined4 *)(lVar2 + 0x160);
      local_3c = *(undefined4 *)(lVar2 + 0x164);
      local_38 = *(undefined4 *)(lVar2 + 0x168);
      local_34 = *(undefined4 *)(lVar2 + 0x16c);
      FUN_1401fbdd0(*(undefined8 *)(lVar2 + 0xb50),*(undefined4 *)(lVar2 + 0x288),
                    *(undefined4 *)(lVar2 + 0x284),param_2,&local_40,puVar3,uVar4);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140181790(void)

{
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_STORAGE_UPGRADE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_1401a3cb0(lVar2,*param_4,0);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140181880(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ADD_SKILL_POINT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c2400(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140181980(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_LEARN_SKILL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        if (*(int *)(lVar3 + 0x298) < 100) {
          uVar2 = 1;
        }
        else {
          uVar2 = FUN_1401c2640(lVar3);
        }
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140181a80(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_DELETE_ALL_SKILL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c28b0(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_ADD_EXP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    lVar5 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        if (*(longlong *)(lVar2 + 0xb58) == 0) {
          uVar3 = 0;
        }
        else {
          uVar3 = *(undefined4 *)(*(longlong *)(lVar2 + 0xb58) + 8);
        }
        FUN_1401fce00(*(undefined8 *)(lVar2 + 0xb50),uVar3,lVar2,*param_4,uVar4,lVar5,1);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8 FUN_140181c60(longlong param_1,int param_2,undefined8 param_3,int *param_4)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_GOLD";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if ((99 < *(int *)(lVar2 + 0x298)) && (0 < *param_4)) {
        FUN_140197b90(lVar2);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_140181d40(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_ADD_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c2be0(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140181e50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_ADD_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c2ce0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140181f50(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_RELOAD_TABLE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c2da0();
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140182030(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_RELOAD_SELECTED_TABLE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_140248e60(DAT_1406080b8);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_1401820f0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_CHECK_QUEST_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c2e90(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_DROP_EVENT_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    lVar5 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (((99 < *(int *)(lVar3 + 0x298)) && (0 < *param_5)) &&
         (plVar2 = *(longlong **)(lVar3 + 0xb58), plVar2 != (longlong *)0x0)) {
        (**(code **)(*plVar2 + 0x98))(plVar2,*param_4,*param_5,"my_xyz",uVar4,lVar5,1);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_140182310(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_QUEST_ITEM_BY_NAME";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c2f20(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140182410(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_QUEST_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c30f0(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140182530(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_QUEST_COMPLTE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_1401a5d70(lVar2);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_140182600(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_QUEST_ACCEPT_FINISH";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c3280(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140182700(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_QUEST_ACCEPT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c3450(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_QUEST_STATE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_1401a5c10(lVar2,*param_4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_1401828e0(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ALL_QUEST_DELETE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c35d0(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_1401829d0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_QUEST_DELETE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c3720(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ADD_HEART";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_1401a5fd0(lVar2,*param_4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8 FUN_140182bb0(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ADD_GIVEUP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_1401a5ec0(lVar2);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140182c80(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_BASE_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c3880(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_CHANGE_JOB";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_140197ef0(lVar2,*param_4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_ITEM_TIME_LIMIT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_14016f730(*(undefined8 *)(lVar2 + 0xb50),lVar2,*param_6,*param_7,*param_4,*param_5,0x13,
                      0,0,0,0,0,0);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_140182fa0(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_ITEM_TIME_LIMIT_OPTION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c3b00(lVar3,param_4,param_5,param_6,param_7,param_9,param_10);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_1401830d0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_ITEM_OPTION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c3bd0(lVar3,param_4,param_5,param_6,param_7,param_8,param_9);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140183200(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_ITEM_OPTION2";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c3ca0(lVar3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,
                              param_11);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140183350(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_ITEM_OPTION3";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c3ef0(lVar3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,
                              param_11,param_12,param_13);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_1401834c0(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ADD_ITEM_SOCKET";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        if (*(int *)(lVar3 + 0x298) < 100) {
          uVar2 = 1;
        }
        else {
          uVar2 = FUN_1401c3dc0(lVar3,param_4,param_6,param_8,param_9,param_10,param_11,param_12,
                                param_13);
        }
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_KILL_ENEMY_COUNT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if ((99 < *(int *)(lVar2 + 0x298)) && (lVar2 = *(longlong *)(lVar2 + 0xb58), lVar2 != 0)) {
        printf("CHEAT_KILL_ENEMY_COUNT : ENEMY_ID [ %d ] COUNT [ %d ]\n");
        FUN_14026f7c0(lVar2,*param_4,*param_5);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140183730(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_SET_HP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c4050(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140183830(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_SET_SG";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c4160(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140183930(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_I_WANNA_DIE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c42c0(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ADD_ENEMY_COUNT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (((99 < *(int *)(lVar2 + 0x298)) && (lVar2 = *(longlong *)(lVar2 + 0xb58), lVar2 != 0)) &&
         (iVar3 = 0, 0 < *param_5)) {
        do {
          FUN_140272d90(*(undefined8 *)(lVar2 + 0x48),*param_4);
          iVar3 = iVar3 + 1;
        } while (iVar3 < *param_5);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140183b40(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ADD_ENEMY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c43d0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140183c40(longlong param_1,int param_2)

{
  longlong lVar1;
  char *local_30;
  DWORD local_28;
  longlong local_20;
  
  local_30 = "PT_CHEAT_AI_TEST";
  local_20 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_28 = timeGetTime();
  if ((param_2 != 0) && (lVar1 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar1 != 0)) {
    FUN_14034ed40(lVar1 + 0x680);
    if (*(char *)(lVar1 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1 + 0x680);
    }
    else {
      FUN_14034edd0(lVar1 + 0x680);
    }
  }
  FUN_14004b970(&local_30);
  return 1;
}



undefined1 FUN_140183d00(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ALL_DUNGEON_CLEAR";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c4470(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  undefined *puVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_SET_TEMP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (((99 < *(int *)(lVar2 + 0x298)) && (*(longlong *)(lVar2 + 0xb58) != 0)) &&
         (lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0xb58) + 0x30), lVar2 != 0)) {
        puVar3 = (undefined *)*param_4;
        if ((undefined *)*param_4 == (undefined *)0x0) {
          puVar3 = PTR_DAT_1405d8008;
        }
        if (puVar3 != (undefined *)0x0) {
          FUN_140246d80(lVar2,puVar3,*param_5);
        }
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8
FUN_140183f00(longlong param_1,int param_2,undefined8 param_3,longlong *param_4,longlong *param_5)

{
  longlong lVar1;
  longlong lVar2;
  undefined *puVar3;
  undefined *puVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_SET_TEMP_STRING";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (((99 < *(int *)(lVar2 + 0x298)) && (*(longlong *)(lVar2 + 0xb58) != 0)) &&
         (lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0xb58) + 0x30), lVar2 != 0)) {
        puVar4 = (undefined *)*param_5;
        if ((undefined *)*param_5 == (undefined *)0x0) {
          puVar4 = PTR_DAT_1405d8008;
        }
        puVar3 = (undefined *)*param_4;
        if ((undefined *)*param_4 == (undefined *)0x0) {
          puVar3 = PTR_DAT_1405d8008;
        }
        FUN_140246ea0(lVar2,puVar3,puVar4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140184010(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_GET_LEVEL_QUEST_NPC";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c4570(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140184110(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_GET_LEVEL_QUEST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c4be0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140184210(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ALL_QUEST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c4ea0(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140184300(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ALL_WORLD";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (((DAT_14060a120 == 1000) && (param_2 != 0)) &&
     (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      (**(code **)(**(longlong **)(lVar2 + 0xb50) + 0x208))();
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8 FUN_140184400(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ALL_ENEMY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (((DAT_14060a120 == 1000) && (param_2 != 0)) &&
     (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if ((DAT_14060b7c4 & 1) == 0) {
        DAT_14060b7c4 = DAT_14060b7c4 | 1;
        FUN_140418590();
        atexit((_func_5014 *)&LAB_140448470);
      }
      if (DAT_14060a120 == 1000) {
        (**(code **)(**(longlong **)(lVar2 + 0xb50) + 0x210))(*(longlong **)(lVar2 + 0xb50),param_2)
        ;
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



void FUN_140184540(longlong param_1,longlong *param_2,int param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong lVar6;
  size_t sVar7;
  longlong *plVar8;
  ulonglong uVar9;
  longlong lVar10;
  wchar_t *pwVar11;
  void *pvVar12;
  longlong *plVar13;
  bool bVar14;
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  longlong *local_548;
  longlong *local_540;
  longlong *local_538;
  longlong *local_530;
  undefined4 local_528 [2];
  undefined4 local_520;
  undefined4 local_51c;
  undefined4 local_518 [2];
  undefined4 local_510;
  undefined4 local_50c;
  undefined4 local_508 [2];
  undefined4 local_500 [2];
  undefined4 local_4f8 [2];
  longlong *local_4f0;
  longlong *local_4e8;
  undefined4 local_4e0;
  undefined4 local_4dc;
  undefined4 local_4d8;
  undefined4 local_4d4;
  undefined4 local_4d0;
  undefined4 uStack_4cc;
  undefined4 local_4c8;
  undefined4 uStack_4c4;
  undefined4 local_4c0;
  undefined4 local_4bc;
  undefined4 local_4b8;
  undefined4 local_4b4;
  undefined4 local_4b0;
  undefined4 local_4ac;
  undefined4 local_4a8;
  undefined4 local_4a4;
  undefined4 local_4a0;
  undefined4 local_49c;
  undefined4 local_498;
  undefined4 local_494;
  undefined4 local_490;
  undefined4 local_48c;
  undefined4 local_488;
  undefined4 local_484;
  undefined4 local_480;
  undefined4 local_47c;
  undefined4 local_478;
  undefined4 local_474;
  undefined8 local_470;
  undefined1 local_468;
  undefined7 uStack_467;
  undefined8 local_458;
  ulonglong local_450;
  undefined8 local_440;
  wchar_t local_438;
  undefined6 uStack_436;
  undefined8 local_428;
  ulonglong local_420;
  undefined4 local_408;
  undefined4 local_404;
  undefined4 local_400;
  undefined4 local_3fc;
  undefined4 local_3f8;
  undefined4 local_3f4;
  undefined4 local_3f0;
  undefined4 local_3ec;
  undefined4 local_3e8;
  undefined4 local_3e4;
  wchar_t local_3e0 [50];
  undefined2 local_37c;
  wchar_t local_37a [16];
  undefined8 local_35a;
  undefined8 local_352;
  undefined4 local_34a;
  wchar_t local_346 [16];
  undefined8 local_326;
  undefined8 local_318;
  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;
  undefined4 local_2dc;
  undefined4 local_2d8;
  wchar_t local_2d4 [15];
  undefined2 local_2b6;
  wchar_t local_2b4 [49];
  undefined2 local_252;
  WCHAR local_248;
  undefined1 local_246 [526];
  
  if (param_3 < 1) {
    return;
  }
  local_318 = 0xfffffffffffffffe;
  FUN_140198570(param_2,&local_538);
  plVar13 = local_538;
  if (local_538 != (longlong *)0x0) {
    if (local_538 == local_530) {
      if (*local_538 != 0) {
        local_510 = FUN_1402f8580();
        uVar5 = FUN_140314400(DAT_140608098,param_3 + -1);
        lVar6 = (**(code **)(*(longlong *)*plVar13 + 0x270))();
        *(undefined8 *)(lVar6 + 0x60) = uVar5;
        FUN_1402f81e0(*plVar13,param_3);
        local_4f8[0] = 0;
        local_508[0] = 0;
        local_520 = *(undefined4 *)(lVar6 + 0x6c);
        local_470 = *(undefined8 *)(lVar6 + 0x60);
        local_50c = *(undefined4 *)(lVar6 + 0x5c);
        (**(code **)(*(longlong *)(param_1 + 0x78) + 0x90))
                  ((longlong *)(param_1 + 0x78),(int)param_2[1],&DAT_1405d85a0,param_2 + 1,
                   &local_50c,&local_470,&local_520,local_508,local_4f8);
        local_518[0] = *(undefined4 *)(lVar6 + 0x70);
        local_500[0] = *(undefined4 *)(lVar6 + 0x6c);
        local_440 = *(undefined8 *)(lVar6 + 0x60);
        local_528[0] = *(undefined4 *)(lVar6 + 0x5c);
        local_4b0 = (undefined4)param_2[0x2e];
        local_4ac = *(undefined4 *)((longlong)param_2 + 0x174);
        local_4a8 = (undefined4)param_2[0x2f];
        local_4a4 = *(undefined4 *)((longlong)param_2 + 0x17c);
        iVar3 = *(int *)((longlong)param_2 + 0x284);
        if (((-1 < iVar3) && (iVar3 < *(short *)(param_1 + 700))) &&
           (*(longlong *)(param_1 + 0x4c0) != 0)) {
          local_res18[0] = (undefined2)iVar3;
          plVar8 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                     (longlong)(int)param_2[0x51] * 8) + 0x70);
          (**(code **)(*plVar8 + 0x220))
                    (plVar8,1,&DAT_1405d85a0,local_res18,&local_4b0,local_528,&local_440,local_500,
                     local_518);
        }
        FUN_140057eb0(&local_308);
        local_308 = *(undefined4 *)(DAT_140608000 + 0x140);
        local_304 = (undefined4)param_2[0x2c];
        local_300 = *(undefined4 *)((longlong)param_2 + 0x164);
        local_2fc = (undefined4)param_2[0x2d];
        local_2f8 = *(undefined4 *)((longlong)param_2 + 0x16c);
        local_2f4 = (undefined4)param_2[0x2e];
        local_2f0 = *(undefined4 *)((longlong)param_2 + 0x174);
        local_2ec = (undefined4)param_2[0x2f];
        local_2e8 = *(undefined4 *)((longlong)param_2 + 0x17c);
        local_2dc = *(undefined4 *)(*plVar13 + 0x120);
        local_2d8 = FUN_1402f8580();
        local_450 = 0xf;
        local_458 = 0;
        local_468 = 0;
        uVar9 = 0xffffffffffffffff;
        plVar8 = param_2 + 0x66;
        do {
          if (uVar9 == 0) break;
          uVar9 = uVar9 - 1;
          lVar6 = *plVar8;
          plVar8 = (longlong *)((longlong)plVar8 + 1);
        } while ((char)lVar6 != '\0');
        FUN_140003e50(&local_468,param_2 + 0x66,~uVar9 - 1);
        FUN_140415310(&local_438,&local_468);
        if (0xf < local_450) {
          operator_delete((void *)CONCAT71(uStack_467,local_468));
        }
        local_450 = 0xf;
        local_458 = 0;
        local_468 = 0;
        pwVar11 = (wchar_t *)(*plVar13 + 0xd0);
        if (7 < *(ulonglong *)(*plVar13 + 0xe8)) {
          pwVar11 = *(wchar_t **)pwVar11;
        }
        wcscpy_s(local_2d4,0x10,pwVar11);
        pwVar11 = &local_438;
        if (7 < local_420) {
          pwVar11 = (wchar_t *)CONCAT62(uStack_436,local_438);
        }
        wcscpy_s(local_2b4,0x32,pwVar11);
        local_2b6 = 0;
        local_252 = 0;
        FUN_1401fe4a0(param_1,(int)param_2[0x51],*(undefined4 *)((longlong)param_2 + 0x284),
                      &local_308);
        if (7 < local_420) {
          operator_delete((void *)CONCAT62(uStack_436,local_438));
        }
        local_420 = 7;
        local_428 = 0;
        local_438 = L'\0';
        local_4d0 = *(undefined4 *)((longlong)param_2 + 0x194);
        uStack_4cc = (undefined4)param_2[0x33];
        local_4c8 = *(undefined4 *)((longlong)param_2 + 0x19c);
        uStack_4c4 = (undefined4)param_2[0x34];
        if ((*(longlong *)((longlong)param_2 + 0x194) == 0) &&
           (*(longlong *)((longlong)param_2 + 0x19c) == 0)) {
          bVar14 = false;
        }
        else {
          bVar14 = true;
        }
        if (!bVar14) goto LAB_140184bfb;
        if (*(int *)(param_1 + 0x528) == 0) {
          local_4dc = (undefined4)param_2[0x33];
          local_4d8 = *(undefined4 *)((longlong)param_2 + 0x19c);
          local_4d4 = (undefined4)param_2[0x34];
          local_4e0 = *(undefined4 *)((longlong)param_2 + 0x194);
          FUN_1401e6310(DAT_140608080,&local_548,&local_4e0);
          plVar8 = local_548;
          if (local_548 != (longlong *)0x0) {
            if (local_548 == local_540) {
              if ((*local_548 != 0) && (lVar6 = FUN_140188c00(param_1), lVar6 != 0)) {
                local_51c = FUN_1402f8580(*plVar13);
                local_480 = (undefined4)param_2[0x2e];
                local_47c = *(undefined4 *)((longlong)param_2 + 0x174);
                local_478 = (undefined4)param_2[0x2f];
                local_474 = *(undefined4 *)((longlong)param_2 + 0x17c);
                if (local_548 == (longlong *)0x0) {
LAB_140184b49:
                  lVar10 = 0;
                }
                else {
                  if (local_548 != local_540) {
                    iVar3 = DAT_140608088 + 1;
                    bVar14 = DAT_140608088 == 0;
                    DAT_140608088 = iVar3;
                    if (bVar14) {
                      FUN_140176d60();
                    }
                    goto LAB_140184b49;
                  }
                  lVar10 = *local_548;
                }
                local_490 = *(undefined4 *)(lVar10 + 0x28);
                local_48c = *(undefined4 *)(lVar10 + 0x2c);
                local_488 = *(undefined4 *)(lVar10 + 0x30);
                local_484 = *(undefined4 *)(lVar10 + 0x34);
                (**(code **)(*(longlong *)(lVar6 + 0x78) + 0x140))
                          ((longlong *)(lVar6 + 0x78),1,&DAT_1405d85a0,&local_490,&local_480,
                           &local_51c);
                plVar8 = local_548;
              }
            }
            else {
              iVar3 = DAT_140608088 + 1;
              bVar14 = DAT_140608088 == 0;
              DAT_140608088 = iVar3;
              if (bVar14) {
                FUN_140176d60(1);
                plVar8 = local_548;
              }
            }
          }
          if (plVar8 != (longlong *)0x0) {
            if (plVar8 == local_540) {
              if (plVar8 != (longlong *)0x0) {
                LOCK();
                plVar1 = plVar8 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                plVar13 = local_538;
                if ((int)*plVar1 == 0) {
                  local_548 = (longlong *)0x0;
                  pvVar12 = (void *)*plVar8;
                  if (pvVar12 != (void *)0x0) {
                    FUN_1402160c0(pvVar12);
                    goto LAB_140184be4;
                  }
                  goto LAB_140184bed;
                }
              }
            }
            else {
              iVar3 = DAT_14060808c + 1;
              bVar14 = DAT_14060808c == 0;
              DAT_14060808c = iVar3;
              if (bVar14) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else {
          local_4bc = (undefined4)param_2[0x33];
          local_4b8 = *(undefined4 *)((longlong)param_2 + 0x19c);
          local_4b4 = (undefined4)param_2[0x34];
          local_4c0 = *(undefined4 *)((longlong)param_2 + 0x194);
          FUN_1401e6200(DAT_1406080a0,&local_4f0,&local_4c0);
          if (local_4f0 != (longlong *)0x0) {
            if (local_4f0 == local_4e8) {
              if (*local_4f0 != 0) {
                local_4a0 = (undefined4)param_2[0x2e];
                local_49c = *(undefined4 *)((longlong)param_2 + 0x174);
                local_498 = (undefined4)param_2[0x2f];
                local_494 = *(undefined4 *)((longlong)param_2 + 0x17c);
                lVar6 = *local_4f0;
                uVar4 = FUN_1402f8580(*plVar13);
                FUN_140215e80(lVar6,&local_4a0,uVar4);
              }
            }
            else {
              iVar3 = DAT_140608090 + 1;
              bVar14 = DAT_140608090 == 0;
              DAT_140608090 = iVar3;
              if (bVar14) {
                FUN_140176d60(1);
              }
            }
          }
          plVar8 = local_4f0;
          if (local_4f0 != (longlong *)0x0) {
            if (local_4f0 == local_4e8) {
              if (local_4f0 != (longlong *)0x0) {
                LOCK();
                plVar1 = local_4f0 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                plVar13 = local_538;
                if ((int)*plVar1 == 0) {
                  local_4f0 = (longlong *)0x0;
                  pvVar12 = (void *)*plVar8;
                  if (pvVar12 != (void *)0x0) {
                    FUN_140215c80(pvVar12);
LAB_140184be4:
                    operator_delete(pvVar12);
                  }
LAB_140184bed:
                  operator_delete(plVar8);
                  plVar13 = local_538;
                }
              }
            }
            else {
              iVar3 = DAT_140608094 + 1;
              bVar14 = DAT_140608094 == 0;
              DAT_140608094 = iVar3;
              if (bVar14) {
                FUN_140176d60(1);
              }
            }
          }
        }
LAB_140184bfb:
        local_37c = 0;
        local_35a = 0;
        local_352 = 0;
        local_34a = 0;
        local_326 = 0;
        memset(local_3e0,0,100);
        local_37a[0] = L'\0';
        local_37a[1] = L'\0';
        local_37a[2] = L'\0';
        local_37a[3] = L'\0';
        local_37a[4] = L'\0';
        local_37a[5] = L'\0';
        local_37a[6] = L'\0';
        local_37a[7] = L'\0';
        local_37a[8] = L'\0';
        local_37a[9] = L'\0';
        local_37a[10] = L'\0';
        local_37a[0xb] = L'\0';
        local_37a[0xc] = L'\0';
        local_37a[0xd] = L'\0';
        local_37a[0xe] = L'\0';
        local_37a[0xf] = L'\0';
        local_346[0] = L'\0';
        local_346[1] = L'\0';
        local_346[2] = L'\0';
        local_346[3] = L'\0';
        local_346[4] = L'\0';
        local_346[5] = L'\0';
        local_346[6] = L'\0';
        local_346[7] = L'\0';
        local_346[8] = L'\0';
        local_346[9] = L'\0';
        local_346[10] = L'\0';
        local_346[0xb] = L'\0';
        local_346[0xc] = L'\0';
        local_346[0xd] = L'\0';
        local_346[0xe] = L'\0';
        local_346[0xf] = L'\0';
        local_408 = 0x1f6;
        local_404 = *(undefined4 *)(DAT_140608000 + 0x140);
        local_400 = (undefined4)param_2[0x2c];
        local_3fc = *(undefined4 *)((longlong)param_2 + 0x164);
        local_3f8 = (undefined4)param_2[0x2d];
        local_3f4 = *(undefined4 *)((longlong)param_2 + 0x16c);
        local_3f0 = (undefined4)param_2[0x2e];
        local_3ec = *(undefined4 *)((longlong)param_2 + 0x174);
        local_3e8 = (undefined4)param_2[0x2f];
        local_3e4 = *(undefined4 *)((longlong)param_2 + 0x17c);
        uVar4 = FUN_1401a64a0(param_2);
        local_35a = CONCAT44(local_35a._4_4_,uVar4);
        uVar4 = FUN_1401a6390(param_2);
        local_35a = CONCAT44(uVar4,(undefined4)local_35a);
        uVar4 = FUN_1401a6310(param_2);
        local_352 = CONCAT44(local_352._4_4_,uVar4);
        local_34a = FUN_1401978f0(param_2);
        uVar4 = FUN_1401a6390(param_2);
        local_326 = CONCAT44(local_510,uVar4);
        local_37c = (**(code **)(*param_2 + 0x18))(param_2);
        lVar6 = (**(code **)(*(longlong *)*plVar13 + 0x270))();
        local_352 = CONCAT44(*(undefined4 *)(lVar6 + 0xc4),(undefined4)local_352);
        pwVar11 = (wchar_t *)FUN_1401a6410(param_2);
        sVar7 = wcsnlen(pwVar11,0x10);
        if (sVar7 < 0x10) {
          pwVar11 = (wchar_t *)FUN_1401a6410(param_2);
          wcscpy_s(local_37a,0x10,pwVar11);
          pwVar11 = (wchar_t *)FUN_1401a6410(param_2);
          wcscpy_s(local_346,0x10,pwVar11);
        }
        local_248 = L'\0';
        memset(local_246,0,0x206);
        MultiByteToWideChar(0,1,(LPCSTR)(param_2 + 0x66),0x32,&local_248,0x32);
        sVar7 = wcsnlen(&local_248,0x32);
        if (sVar7 < 0x32) {
          wcscpy_s(local_3e0,0x32,&local_248);
        }
        iVar3 = *(int *)((longlong)param_2 + 0x284);
        if (((-1 < iVar3) && (iVar3 < *(short *)(param_1 + 700))) &&
           (*(longlong *)(param_1 + 0x4c8) != 0)) {
          local_res20[0] = (undefined2)iVar3;
          plVar8 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) +
                     (longlong)(int)param_2[0x51] * 8) + 0x70);
          (**(code **)(*plVar8 + 0xc70))(plVar8,1,&DAT_1405d85a0,local_res20,&local_408);
        }
        goto LAB_140184ecc;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar14 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar13 == (longlong *)0x0) {
    return;
  }
  if (plVar13 != local_530) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_140184ecc:
  LOCK();
  plVar13 = plVar13 + 1;
  *(int *)plVar13 = (int)*plVar13 + -1;
  UNLOCK();
  if ((int)*plVar13 == 0) {
    puVar2 = (undefined8 *)*local_538;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_538);
  }
  return;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_FIXLEVEL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_140184540(*(undefined8 *)(lVar2 + 0xb50),lVar2,*param_4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



void FUN_140184ff0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  void *pvVar2;
  int iVar3;
  longlong lVar4;
  int *piVar5;
  int *piVar6;
  longlong lVar7;
  bool bVar8;
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  int local_128 [8];
  longlong *local_108;
  longlong *local_100;
  undefined8 local_f8;
  longlong local_e8;
  longlong local_e0;
  int local_d0;
  undefined4 local_c4 [33];
  undefined4 local_40;
  
  local_f8 = 0xfffffffffffffffe;
  FUN_140197b70(param_2,&local_108);
  plVar1 = local_108;
  if (local_108 != (longlong *)0x0) {
    if (local_108 == local_100) {
      if (*local_108 != 0) {
        local_128[0] = 0;
        local_128[1] = 1;
        local_128[2] = 3;
        local_128[3] = 2;
        local_128[4] = 4;
        local_128[5] = 9;
        local_128[6] = 5;
        piVar6 = local_128;
        piVar5 = local_128;
        lVar7 = 7;
        do {
          FUN_14000a170(&local_e8);
          local_40 = 0;
          iVar3 = *piVar6;
          if ((-1 < iVar3) && (iVar3 < 0x18)) {
            lVar4 = (longlong)iVar3 * 0xac + *plVar1;
            *(undefined2 *)(lVar4 + 0x14) = 0;
            *(short *)(lVar4 + 0x16) = (short)*piVar6;
            FUN_140090020(&local_e8);
            if ((local_e8 == 0) && (local_e0 == 0)) {
              bVar8 = false;
            }
            else {
              bVar8 = true;
            }
            if ((bVar8) && (0 < local_d0)) {
              local_c4[0] = 0;
              FUN_1401ed220(*plVar1,&DAT_14047ba74,piVar5,&local_e8,6);
              local_res18[0] = (undefined2)*piVar6;
              local_res20[0] = 0;
              (**(code **)(*(longlong *)(param_1 + 0x78) + 0xf0))
                        ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                         local_res20,local_res18,&local_e8,local_c4);
            }
          }
          piVar5 = piVar5 + 1;
          piVar6 = piVar6 + 1;
          lVar7 = lVar7 + -1;
        } while (lVar7 != 0);
        goto LAB_1401851e4;
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_100) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401851e4:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar2 = (void *)*local_108;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_108);
  }
  return;
}



ulonglong FUN_140185230(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  uint uVar2;
  int iVar3;
  void *pvVar4;
  uint uVar5;
  ulonglong uVar6;
  undefined8 uVar7;
  ulonglong extraout_RAX;
  uint *puVar8;
  longlong *plVar9;
  longlong lVar10;
  ulonglong uVar11;
  bool bVar12;
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  undefined2 *in_stack_fffffffffffffeb8;
  undefined4 uVar13;
  undefined2 local_128 [2];
  uint local_124;
  longlong *local_120;
  longlong *local_118;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined8 local_f0;
  longlong local_e8;
  longlong local_e0;
  uint local_d0;
  int local_c4 [31];
  uint local_48;
  int local_44;
  undefined4 local_40;
  
  local_f0 = 0xfffffffffffffffe;
  FUN_140185870();
  uVar6 = FUN_140197b70(param_2,&local_120);
  plVar1 = local_120;
  if (local_120 != (longlong *)0x0) {
    if (local_120 == local_118) {
      if (*local_120 != 0) {
        local_124 = 0;
        uVar11 = 0;
        do {
          uVar6 = FUN_14000a170(&local_e8);
          local_40 = 0;
          uVar5 = (uint)uVar11;
          if (uVar5 < 0x18) {
            lVar10 = ((longlong)(int)uVar5 + 0x18) * 0xac + *plVar1;
            *(undefined2 *)(lVar10 + 0x14) = 1;
            *(short *)(lVar10 + 0x16) = (short)uVar11;
            FUN_140090020(&local_e8);
            uVar2 = local_d0;
            if ((local_e8 != 0) || (uVar6 = 0, local_e0 != 0)) {
              uVar6 = 1;
            }
            if (((int)uVar6 != 0) && (0 < (int)local_d0)) {
              lVar10 = FUN_140137690();
              uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20);
              uVar6 = (ulonglong)uVar2 / (ulonglong)*(uint *)(lVar10 + 0x98);
              if (*(longlong *)(lVar10 + 0x88) != 0) {
                for (puVar8 = *(uint **)(*(longlong *)(lVar10 + 0x88) +
                                        ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar10 + 0x98)) * 8
                                        ); puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 0xa6)
                    ) {
                  if ((puVar8[0xa8] == uVar2) && (*puVar8 == uVar2)) {
                    if (puVar8 != (uint *)0x0) {
                      uVar6 = (ulonglong)(puVar8 != (uint *)0x0);
                      if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                        FUN_14000d450(0x80004005);
                      }
                      if (puVar8 != (uint *)0xfffffffffffffff8) {
                        uVar2 = puVar8[0x36];
                        uVar6 = (ulonglong)uVar2;
                        if ((uVar2 == 1) || (uVar2 == 2)) {
                          uVar2 = local_48;
                          if (local_48 == 0) {
                            uVar2 = puVar8[0x52];
                          }
                          if (local_c4[0] != local_44 + uVar2) {
                            local_c4[0] = local_44 + uVar2;
                            uVar7 = FUN_140174f00(&local_120);
                            FUN_1401ed220(uVar7,&DAT_14047ba78,&local_124,&local_e8,
                                          CONCAT44(uVar13,6));
                            local_110 = *(undefined4 *)(param_2 + 0x160);
                            local_10c = *(undefined4 *)(param_2 + 0x164);
                            local_108 = *(undefined4 *)(param_2 + 0x168);
                            local_104 = *(undefined4 *)(param_2 + 0x16c);
                            local_100 = *(undefined4 *)(param_2 + 0x170);
                            local_fc = *(undefined4 *)(param_2 + 0x174);
                            local_f8 = *(undefined4 *)(param_2 + 0x178);
                            local_f4 = *(undefined4 *)(param_2 + 0x17c);
                            iVar3 = *(int *)(param_2 + 0x284);
                            if (((-1 < iVar3) && (iVar3 < *(short *)(param_1 + 700))) &&
                               (*(longlong *)(param_1 + 0x4c0) != 0)) {
                              local_res18[0] = (undefined2)iVar3;
                              plVar9 = (longlong *)
                                       (*(longlong *)
                                         (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                                         (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                              (**(code **)(*plVar9 + 0x140))
                                        (plVar9,1,&DAT_1405d85a0,local_res18,&local_100,&local_110,
                                         &local_e8);
                            }
                            local_128[0] = 1;
                            in_stack_fffffffffffffeb8 = local_res20;
                            local_res20[0] = (short)uVar11;
                            uVar6 = (**(code **)(*(longlong *)(param_1 + 0x78) + 0xf0))
                                              ((longlong *)(param_1 + 0x78),
                                               *(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_128
                                               ,in_stack_fffffffffffffeb8,&local_e8,local_c4);
                          }
                        }
                      }
                    }
                    break;
                  }
                }
              }
            }
          }
          local_124 = uVar5 + 1;
          uVar11 = (ulonglong)local_124;
        } while ((int)local_124 < 0x18);
        goto LAB_140185562;
      }
    }
    else {
      uVar5 = DAT_140608048 + 1;
      uVar6 = (ulonglong)uVar5;
      bVar12 = DAT_140608048 == 0;
      DAT_140608048 = uVar5;
      if (bVar12) {
        uVar6 = FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return uVar6;
  }
  if (plVar1 != local_118) {
    uVar5 = DAT_140608050 + 1;
    if (DAT_140608050 != 0) {
      DAT_140608050 = uVar5;
      return (ulonglong)uVar5;
    }
    DAT_140608050 = uVar5;
    uVar6 = FUN_140176d60(1);
    return uVar6;
  }
LAB_140185562:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar4 = (void *)*local_120;
    if (pvVar4 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar4 + 0xf630);
      operator_delete(pvVar4);
    }
    operator_delete(local_120);
    uVar6 = extraout_RAX;
  }
  return uVar6;
}



void FUN_1401855b0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  void *pvVar2;
  int iVar3;
  undefined8 uVar4;
  longlong *plVar5;
  bool bVar6;
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  undefined8 in_stack_fffffffffffffec8;
  undefined4 uVar7;
  undefined2 local_118 [4];
  longlong *local_110;
  longlong *local_108;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined8 local_d8;
  longlong local_c8;
  longlong local_c0;
  int local_b0;
  int local_a4 [31];
  int local_28;
  int local_24;
  undefined4 local_20;
  
  uVar7 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
  local_d8 = 0xfffffffffffffffe;
  FUN_140197b70(param_2,&local_110);
  plVar1 = local_110;
  if (local_110 != (longlong *)0x0) {
    if (local_110 == local_108) {
      if (*local_110 != 0) {
        local_100 = 0;
        FUN_14000a170(&local_c8);
        local_20 = 0;
        *(undefined4 *)(*plVar1 + 0x14) = 0;
        FUN_140090020(&local_c8);
        if ((local_c8 == 0) && (local_c0 == 0)) {
          bVar6 = false;
        }
        else {
          bVar6 = true;
        }
        if ((bVar6) && (0 < local_b0)) {
          if (local_28 == 0) {
            uVar4 = FUN_140137690();
            iVar3 = FUN_140136bb0(uVar4,local_b0);
            iVar3 = iVar3 + local_28 + local_24;
          }
          else {
            iVar3 = local_24 + local_28;
          }
          if (local_a4[0] != iVar3) {
            local_a4[0] = iVar3;
            uVar4 = FUN_140174f00(&local_110);
            FUN_1401ed220(uVar4,&DAT_14047ba74,&local_100,&local_c8,CONCAT44(uVar7,6));
            local_fc = *(undefined4 *)(param_2 + 0x160);
            local_f8 = *(undefined4 *)(param_2 + 0x164);
            local_f4 = *(undefined4 *)(param_2 + 0x168);
            local_f0 = *(undefined4 *)(param_2 + 0x16c);
            local_ec = *(undefined4 *)(param_2 + 0x170);
            local_e8 = *(undefined4 *)(param_2 + 0x174);
            local_e4 = *(undefined4 *)(param_2 + 0x178);
            local_e0 = *(undefined4 *)(param_2 + 0x17c);
            iVar3 = *(int *)(param_2 + 0x284);
            if (((-1 < iVar3) && (iVar3 < *(short *)(param_1 + 700))) &&
               (*(longlong *)(param_1 + 0x4c0) != 0)) {
              local_res18[0] = (undefined2)iVar3;
              plVar5 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                         (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
              (**(code **)(*plVar5 + 0x140))
                        (plVar5,1,&DAT_1405d85a0,local_res18,&local_ec,&local_fc,&local_c8);
            }
            local_res20[0] = 0;
            local_118[0] = 0;
            (**(code **)(*(longlong *)(param_1 + 0x78) + 0xf0))
                      ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                       local_118,local_res20,&local_c8,local_a4);
          }
        }
        goto LAB_140185820;
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar6 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_108) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_140185820:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar2 = (void *)*local_110;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_110);
  }
  return;
}



void FUN_140185870(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  void *pvVar2;
  int iVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  int *piVar7;
  int *piVar8;
  longlong lVar9;
  bool bVar10;
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  undefined2 *in_stack_fffffffffffffe98;
  undefined4 uVar11;
  undefined2 local_148 [4];
  longlong *local_140;
  longlong *local_138;
  int local_130 [8];
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined8 local_f0;
  longlong local_e8;
  longlong local_e0;
  int local_d0;
  int local_c4 [31];
  int local_48;
  int local_44;
  undefined4 local_40;
  
  local_f0 = 0xfffffffffffffffe;
  FUN_140197b70(param_2,&local_140);
  plVar1 = local_140;
  if (local_140 != (longlong *)0x0) {
    if (local_140 == local_138) {
      if (*local_140 != 0) {
        local_130[0] = 0;
        local_130[1] = 1;
        local_130[2] = 3;
        local_130[3] = 2;
        local_130[4] = 4;
        local_130[5] = 9;
        local_130[6] = 5;
        piVar7 = local_130;
        piVar8 = local_130;
        lVar9 = 7;
        do {
          FUN_14000a170(&local_e8);
          local_40 = 0;
          iVar3 = *piVar7;
          if ((-1 < iVar3) && (iVar3 < 0x18)) {
            lVar6 = (longlong)iVar3 * 0xac + *plVar1;
            *(undefined2 *)(lVar6 + 0x14) = 0;
            *(short *)(lVar6 + 0x16) = (short)*piVar7;
            FUN_140090020(&local_e8);
            if ((local_e8 == 0) && (local_e0 == 0)) {
              bVar10 = false;
            }
            else {
              bVar10 = true;
            }
            if ((bVar10) && (0 < local_d0)) {
              if (local_48 == 0) {
                uVar4 = FUN_140137690();
                iVar3 = FUN_140136bb0(uVar4,local_d0);
                iVar3 = iVar3 + local_48 + local_44;
              }
              else {
                iVar3 = local_44 + local_48;
              }
              uVar11 = (undefined4)((ulonglong)in_stack_fffffffffffffe98 >> 0x20);
              if (local_c4[0] != iVar3) {
                local_c4[0] = iVar3;
                uVar4 = FUN_140174f00(&local_140);
                FUN_1401ed220(uVar4,&DAT_14047ba74,piVar8,&local_e8,CONCAT44(uVar11,6));
                local_110 = *(undefined4 *)(param_2 + 0x160);
                local_10c = *(undefined4 *)(param_2 + 0x164);
                local_108 = *(undefined4 *)(param_2 + 0x168);
                local_104 = *(undefined4 *)(param_2 + 0x16c);
                local_100 = *(undefined4 *)(param_2 + 0x170);
                local_fc = *(undefined4 *)(param_2 + 0x174);
                local_f8 = *(undefined4 *)(param_2 + 0x178);
                local_f4 = *(undefined4 *)(param_2 + 0x17c);
                iVar3 = *(int *)(param_2 + 0x284);
                if (((-1 < iVar3) && (iVar3 < *(short *)(param_1 + 700))) &&
                   (*(longlong *)(param_1 + 0x4c0) != 0)) {
                  local_res18[0] = (undefined2)iVar3;
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                             (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                  (**(code **)(*plVar5 + 0x140))
                            (plVar5,1,&DAT_1405d85a0,local_res18,&local_100,&local_110,&local_e8);
                }
                local_res20[0] = (undefined2)*piVar7;
                local_148[0] = 0;
                in_stack_fffffffffffffe98 = local_res20;
                (**(code **)(*(longlong *)(param_1 + 0x78) + 0xf0))
                          ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                           local_148,in_stack_fffffffffffffe98,&local_e8,local_c4);
              }
            }
          }
          piVar8 = piVar8 + 1;
          piVar7 = piVar7 + 1;
          lVar9 = lVar9 + -1;
        } while (lVar9 != 0);
        goto LAB_140185b64;
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar10 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_138) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_140185b64:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar2 = (void *)*local_140;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_140);
  }
  return;
}



undefined8 FUN_140185bb0(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined4 uVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_BREAK_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        if (*(int *)(lVar3 + 0x298) < 100) {
          uVar2 = 1;
        }
        else {
          uVar4 = 1;
          if (*(longlong *)(lVar3 + 0xb58) != 0) {
            uVar4 = *(undefined4 *)(*(longlong *)(lVar3 + 0xb58) + 0x90);
          }
          FUN_140184ff0(*(undefined8 *)(lVar3 + 0xb50),lVar3);
          FUN_14019c070(lVar3,uVar4);
          uVar2 = 0;
        }
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140185ce0(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined4 uVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_REPAIR";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        uVar3 = 1;
        if (*(longlong *)(lVar2 + 0xb58) != 0) {
          uVar3 = *(undefined4 *)(*(longlong *)(lVar2 + 0xb58) + 0x90);
        }
        FUN_140185870(*(undefined8 *)(lVar2 + 0xb50),lVar2);
        FUN_14019c070(lVar2,uVar3);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8 FUN_140185de0(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_RESET_FATIGUE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_1401a9350(lVar2);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



void FUN_140185ea0(longlong param_1,longlong param_2,uint param_3,int param_4)

{
  longlong *plVar1;
  void *pvVar2;
  undefined2 uVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  uint uVar7;
  bool bVar8;
  uint local_res18 [2];
  undefined2 local_128;
  undefined2 local_126;
  undefined2 local_124 [2];
  uint local_120 [2];
  longlong *local_118;
  longlong *local_110;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined8 local_e8;
  longlong local_d8;
  longlong local_d0;
  int local_c0;
  short local_bc;
  undefined2 local_b0;
  undefined4 local_30;
  
  local_e8 = 0xfffffffffffffffe;
  uVar3 = (undefined2)param_4;
  local_res18[0] = param_3;
  uVar7 = param_3;
  FUN_140197b70(param_2,&local_118);
  plVar1 = local_118;
  if (local_118 != (longlong *)0x0) {
    if (local_118 == local_110) {
      if (*local_118 != 0) {
        if ((param_4 < 0x15) && ((uVar7 == 0 || (param_3 == 1)))) {
          local_120[0] = 0;
          do {
            uVar7 = local_120[0];
            FUN_14000a170(&local_d8);
            local_30 = 0;
            if ((param_3 < 5) && (uVar7 < 0x18)) {
              lVar6 = ((longlong)(int)uVar7 + (longlong)(int)param_3 * 0x18) * 0xac + *plVar1;
              *(short *)(lVar6 + 0x14) = (short)param_3;
              *(short *)(lVar6 + 0x16) = (short)uVar7;
              FUN_140090020(&local_d8);
              if ((local_d8 == 0) && (local_d0 == 0)) {
                bVar8 = false;
              }
              else {
                bVar8 = true;
              }
              if (((bVar8) || (local_c0 != 0)) || (0 < local_bc)) {
                local_b0 = uVar3;
                FUN_1401ed220(*plVar1,local_res18,local_120,&local_d8,6);
                local_f8 = *(undefined4 *)(param_2 + 0x160);
                local_f4 = *(undefined4 *)(param_2 + 0x164);
                local_f0 = *(undefined4 *)(param_2 + 0x168);
                local_ec = *(undefined4 *)(param_2 + 0x16c);
                local_108 = *(undefined4 *)(param_2 + 0x170);
                local_104 = *(undefined4 *)(param_2 + 0x174);
                local_100 = *(undefined4 *)(param_2 + 0x178);
                local_fc = *(undefined4 *)(param_2 + 0x17c);
                iVar4 = *(int *)(param_2 + 0x284);
                if (((-1 < iVar4) && (iVar4 < *(short *)(param_1 + 700))) &&
                   (*(longlong *)(param_1 + 0x4c0) != 0)) {
                  local_126 = (undefined2)iVar4;
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                             (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                  (**(code **)(*plVar5 + 0x140))
                            (plVar5,1,&DAT_1405d85a0,&local_126,&local_108,&local_f8,&local_d8);
                }
                local_128 = (short)uVar7;
                local_124[0] = (short)param_3;
                (**(code **)(*(longlong *)(param_1 + 0x78) + 0xe0))
                          ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                           local_124,&local_128,&local_d8);
              }
            }
            local_120[0] = uVar7 + 1;
          } while ((int)local_120[0] < 0x18);
        }
        goto LAB_14018613a;
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_110) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14018613a:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar2 = (void *)*local_118;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_118);
  }
  return;
}



undefined1
FUN_140186190(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ENCHANT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c5470(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



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

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar3 = 0xfffffffffffffffe;
  local_20 = "PT_CHEAT_ENCHANT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    lVar4 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      FUN_140185ea0(*(undefined8 *)(lVar2 + 0xb50),lVar2,*param_4,*param_5,uVar3,lVar4,1);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_ADD_ENEMY_CONTROL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if ((99 < *(int *)(lVar2 + 0x298)) && (*(longlong *)(lVar2 + 0xb58) != 0)) {
        FUN_140272f70(*(undefined8 *)(*(longlong *)(lVar2 + 0xb58) + 0x48),*param_4,*param_5,
                      *param_6,*param_7);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8 FUN_140186480(longlong param_1,int param_2,undefined8 param_3,undefined8 *param_4)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_SET_BATTLE_EXP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_1401c5ab0(lVar2,*param_4);
        FUN_1401fc880(*(undefined8 *)(lVar2 + 0xb50),lVar2);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_SET_BATTLE_LADDER_POINT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_1401c5b80(lVar2,*param_4);
        FUN_1401fca40(*(undefined8 *)(lVar2 + 0xb50),lVar2);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_SET_BATTLE_POINT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        FUN_1401c59e0(lVar2,*param_4);
        FUN_1401fcc40(*(undefined8 *)(lVar2 + 0xb50),lVar2);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140186750(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_CHECK_HPMP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c5c50(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140186840(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_CHEAT_REARING_SETLEVEL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c5e60(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140186950(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_REARING_DELETE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c6190(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140186a50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_REARING_SETENDING";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c62c0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140186b50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_REARING_TURNUPATE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c65f0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140186c50(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_REARING_ALLTURNUPATE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c66f0(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140186d40(longlong param_1,int param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined *puVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_RELOAD_TABLE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      puVar3 = (undefined *)*param_4;
      if ((undefined *)*param_4 == (undefined *)0x0) {
        puVar3 = PTR_DAT_1405d8010;
      }
      FUN_140174180(*(undefined8 *)(lVar2 + 0xb50),puVar3);
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140186e20(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_SET_FATIGUE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c6870(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140186f20(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
    local_20 = "PT_CHEAT_CHARACTER_ROB";
    local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
    local_18 = timeGetTime();
    if (param_2 != 0) {
      lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
      if (lVar3 == 0) {
        FUN_14004b970(&local_20);
        return 1;
      }
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        return 1;
      }
      uVar2 = FUN_1401c69f0(lVar3,param_4);
      FUN_14034edd0(lVar1);
      FUN_14004b970(&local_20);
      return uVar2;
    }
    FUN_14004b970(&local_20);
  }
  return 1;
}



undefined1 FUN_140187050(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_GUILD_EXP_UP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c6a80(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140187150(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_MYLOBBYINFO";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c71e0(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_140187240(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_HAIRCOLOR_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c73e0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_140187340(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_HAIRCOLOR_CHANGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c76b0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_140187440(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_PVP_START";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        (**(code **)(**(longlong **)(lVar2 + 0xb50) + 0x2e0))(*(longlong **)(lVar2 + 0xb50),param_2)
        ;
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8 FUN_140187520(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_PVP_END";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (99 < *(int *)(lVar2 + 0x298)) {
        (**(code **)(**(longlong **)(lVar2 + 0xb50) + 0x2e8))(*(longlong **)(lVar2 + 0xb50),param_2)
        ;
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_140187600(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_FORTUNE_COIN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
    if (param_2 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
      if (lVar3 == 0) {
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        lVar1 = lVar3 + 0x680;
        FUN_14034ed40(lVar1);
        if (*(char *)(lVar3 + 0x6b8) == '\0') {
          FUN_14034edd0(lVar1);
          FUN_14004b970(&local_20);
          uVar2 = 1;
        }
        else {
          uVar2 = FUN_1401c79d0(lVar3,param_2,param_4);
          FUN_14034edd0(lVar1);
          FUN_14004b970(&local_20);
        }
      }
    }
  }
  else {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  return uVar2;
}



undefined1 FUN_140187750(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_FORTUNE_PLAY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
    if (param_2 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
      if (lVar3 == 0) {
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        lVar1 = lVar3 + 0x680;
        FUN_14034ed40(lVar1);
        if (*(char *)(lVar3 + 0x6b8) == '\0') {
          FUN_14034edd0(lVar1);
          FUN_14004b970(&local_20);
          uVar2 = 1;
        }
        else {
          uVar2 = FUN_1401c7dd0(lVar3,param_2,param_4);
          FUN_14034edd0(lVar1);
          FUN_14004b970(&local_20);
        }
      }
    }
  }
  else {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  return uVar2;
}



undefined1 FUN_1401878a0(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_CHEAT_FORTUNE_CLEAR";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1e8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
    if (param_2 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar3 = FUN_14016e240(param_1 + -0x2e0,param_2);
      if (lVar3 == 0) {
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        lVar1 = lVar3 + 0x680;
        FUN_14034ed40(lVar1);
        if (*(char *)(lVar3 + 0x6b8) == '\0') {
          FUN_14034edd0(lVar1);
          FUN_14004b970(&local_20);
          uVar2 = 1;
        }
        else {
          uVar2 = FUN_1401c8060(lVar3,param_2);
          FUN_14034edd0(lVar1);
          FUN_14004b970(&local_20);
        }
      }
    }
  }
  else {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  return uVar2;
}



undefined8 FUN_1401879e0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined8 uVar4;
  longlong lVar5;
  
  uVar4 = 0xfffffffffffffffe;
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    lVar5 = lVar1;
    FUN_14034ed40(lVar1);
    if ((*(char *)(lVar2 + 0x6b8) != '\0') &&
       ((99 < *(int *)(lVar2 + 0x298) &&
        (lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4f0), lVar2 != 0)))) {
      plVar3 = (longlong *)(lVar2 + 0x70);
      (**(code **)(*plVar3 + 0x1a0))(plVar3,1,&DAT_1405d85a0,param_4,uVar4,lVar5,1);
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1 FUN_140187a90(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8470(lVar3,param_4);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1 FUN_140187b20(longlong param_1,int param_2,undefined8 param_3,char *param_4)

{
  longlong lVar1;
  
  if ((param_2 != 0) && (lVar1 = FUN_14016e240(param_1 + -0x2e0), lVar1 != 0)) {
    FUN_14034ed40(lVar1 + 0x680);
    if ((*(char *)(lVar1 + 0x6b8) != '\0') && (99 < *(int *)(lVar1 + 0x298))) {
      *(bool *)(lVar1 + 0x602) = *param_4 != '\0';
    }
    FUN_14034edd0(lVar1 + 0x680);
  }
  return 1;
}



undefined1 FUN_140187ba0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8540(lVar3,param_4);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140187c30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8630(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140187cc0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8700(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined8
FUN_140187d50(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0), lVar2 != 0)) {
    FUN_14034ed40(lVar2 + 0x680);
    if ((*(char *)(lVar2 + 0x6b8) != '\0') &&
       ((lVar1 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4f0), 99 < *(int *)(lVar2 + 0x298)
        && (lVar1 != 0)))) {
      plVar3 = (longlong *)(lVar1 + 0x70);
      (**(code **)(*plVar3 + 0x1c0))(plVar3,1,&DAT_1405d85a0,param_4,param_5);
    }
    FUN_14034edd0(lVar2 + 0x680);
  }
  return 1;
}



undefined1 FUN_140187e10(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c87d0(lVar3,param_2,param_4);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140187eb0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8b90(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1 FUN_140187f40(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8d20(lVar3,param_4);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



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

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    FUN_14034ed40(lVar3 + 0x680);
    lVar2 = DAT_1406080b8;
    if ((*(char *)(lVar3 + 0x6b8) != '\0') && (99 < *(int *)(lVar3 + 0x298))) {
      uVar1 = *param_4;
      *(undefined4 *)(DAT_1406080b8 + 8) = 0;
      if (*(int *)(lVar2 + 0x38) == 1) {
        *(undefined8 *)(lVar2 + 0x18) = 0;
      }
      *(undefined4 *)(lVar2 + 8) = uVar1;
    }
    FUN_14034edd0(lVar3 + 0x680);
  }
  return 1;
}



undefined1
FUN_140188060(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  
  uVar4 = 0xfffffffffffffffe;
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    lVar5 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8e00(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140188100(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8ec0(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140188190(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c8f70(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140188220(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  
  uVar4 = 0xfffffffffffffffe;
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    lVar5 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c9020(lVar3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,uVar4,
                            lVar5,1);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_1401882f0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             uint *param_6,undefined8 param_7)

{
  longlong lVar1;
  uint uVar2;
  undefined1 uVar3;
  longlong lVar4;
  uint *puVar5;
  
  uVar2 = *param_6;
  lVar4 = FUN_140165ea0();
  if (*(longlong *)(lVar4 + 0x40) != 0) {
    for (puVar5 = *(uint **)(*(longlong *)(lVar4 + 0x40) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar4 + 0x50)) * 8);
        puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0x1ee)) {
      if ((puVar5[0x1f0] == uVar2) && (*puVar5 == uVar2)) {
        if (puVar5 == (uint *)0x0) {
          return 1;
        }
        if (param_2 == 0) {
          return 1;
        }
        lVar4 = FUN_14016e240(param_1 + -0x2e0,param_2);
        if (lVar4 == 0) {
          return 1;
        }
        lVar1 = lVar4 + 0x680;
        FUN_14034ed40(lVar1);
        if (*(char *)(lVar4 + 0x6b8) == '\0') {
          FUN_14034edd0(lVar1);
          return 1;
        }
        uVar3 = FUN_1401c95d0(lVar4,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        return uVar3;
      }
    }
  }
  return 1;
}



undefined1 FUN_140188400(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401c9a10(lVar3);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140188480(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401d9ed0(lVar3,param_2,param_4,param_5,param_6);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140188530(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401db8b0(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_1401885c0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401dbcb0(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140188650(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401dc0d0(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_1401886e0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401dc230(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140188770(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401dc390(lVar3,param_4,param_5);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined1
FUN_140188800(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  
  uVar4 = 0xfffffffffffffffe;
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    lVar5 = lVar1;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401dc640(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined8 FUN_1401888a0(longlong param_1,int param_2)

{
  longlong lVar1;
  
  if ((param_2 != 0) && (lVar1 = FUN_14016e240(param_1 + -0x2e0), lVar1 != 0)) {
    FUN_14034ed40(lVar1 + 0x680);
    if ((*(char *)(lVar1 + 0x6b8) != '\0') &&
       ((99 < *(int *)(lVar1 + 0x298) && (*(longlong **)(lVar1 + 0xb58) != (longlong *)0x0)))) {
      (**(code **)(**(longlong **)(lVar1 + 0xb58) + 0x250))();
    }
    FUN_14034edd0(lVar1 + 0x680);
  }
  return 1;
}



undefined1 FUN_140188930(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x2e0), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401dc7f0(lVar3,param_4);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined8 FUN_1401889c0(longlong param_1,int param_2,undefined8 param_3,undefined1 *param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  longlong local_20;
  undefined1 local_18;
  
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x2e0), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    local_20 = lVar1;
    FUN_14034ed40(lVar1);
    local_18 = 1;
    if (*(char *)(lVar2 + 0x6b8) != '\0') {
      local_30 = *(undefined4 *)(lVar2 + 0x128);
      local_2c = *(undefined4 *)(lVar2 + 300);
      local_28 = *(undefined4 *)(lVar2 + 0x130);
      local_24 = *(undefined4 *)(lVar2 + 0x134);
      FUN_14020fc00(DAT_140608078,&local_30,*param_4);
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



undefined8 FUN_140188a70(longlong param_1,int param_2,undefined8 param_3,undefined1 *param_4)

{
  longlong lVar1;
  
  if ((param_2 != 0) && (lVar1 = FUN_14016e240(param_1 + -0x2e0), lVar1 != 0)) {
    FUN_14034ed40(lVar1 + 0x680);
    if (*(char *)(lVar1 + 0x6b8) != '\0') {
      *(undefined1 *)(lVar1 + 0xb48) = *param_4;
    }
    FUN_14034edd0(lVar1 + 0x680);
  }
  return 1;
}



void thunk_FUN_140188b00(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_140215c80(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608094 + 1;
      bVar5 = DAT_140608094 == 0;
      DAT_140608094 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_140188b00(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_140215c80(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608094 + 1;
      bVar5 = DAT_140608094 == 0;
      DAT_140608094 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



longlong FUN_140188c00(longlong param_1,int param_2)

{
  char cVar1;
  longlong lVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 **ppuVar6;
  undefined8 *local_res8 [2];
  undefined8 *local_res18 [2];
  
  puVar4 = (undefined8 *)(*(undefined8 **)(param_1 + 0x508))[1];
  cVar1 = *(char *)((longlong)puVar4 + 0x29);
  local_res8[0] = *(undefined8 **)(param_1 + 0x508);
  while (cVar1 == '\0') {
    if (*(int *)(puVar4 + 3) < param_2) {
      puVar5 = (undefined8 *)puVar4[2];
      puVar4 = local_res8[0];
    }
    else {
      puVar5 = (undefined8 *)*puVar4;
    }
    local_res8[0] = puVar4;
    puVar4 = puVar5;
    cVar1 = *(char *)((longlong)puVar5 + 0x29);
  }
  if ((local_res8[0] == *(undefined8 **)(param_1 + 0x508)) ||
     (param_2 < *(int *)(local_res8[0] + 3))) {
    local_res18[0] = *(undefined8 **)(param_1 + 0x508);
    ppuVar6 = local_res18;
  }
  else {
    ppuVar6 = local_res8;
  }
  if (*ppuVar6 == *(undefined8 **)(param_1 + 0x508)) {
    puVar4 = (undefined8 *)**(undefined8 **)(param_1 + 0x508);
    while( true ) {
      if (puVar4 == *(undefined8 **)(param_1 + 0x508)) {
        return 0;
      }
      lVar2 = puVar4[4];
      if ((lVar2 != 0) && (*(char *)(lVar2 + 0x1a) != '\0')) break;
      if (*(char *)((longlong)puVar4 + 0x29) == '\0') {
        puVar5 = (undefined8 *)puVar4[2];
        if (*(char *)((longlong)puVar5 + 0x29) == '\0') {
          cVar1 = *(char *)((longlong)*puVar5 + 0x29);
          puVar4 = puVar5;
          puVar5 = (undefined8 *)*puVar5;
          while (cVar1 == '\0') {
            cVar1 = *(char *)((longlong)*puVar5 + 0x29);
            puVar4 = puVar5;
            puVar5 = (undefined8 *)*puVar5;
          }
        }
        else {
          cVar1 = *(char *)((longlong)puVar4[1] + 0x29);
          puVar3 = (undefined8 *)puVar4[1];
          puVar5 = puVar4;
          while ((puVar4 = puVar3, cVar1 == '\0' && (puVar5 == (undefined8 *)puVar4[2]))) {
            cVar1 = *(char *)((longlong)puVar4[1] + 0x29);
            puVar3 = (undefined8 *)puVar4[1];
            puVar5 = puVar4;
          }
        }
      }
    }
    return lVar2;
  }
  return (*ppuVar6)[4];
}



undefined1 FUN_140188c70(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -0x300), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) != '\0') {
      uVar2 = FUN_1401bd280(lVar3,param_4);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    FUN_14034edd0(lVar1);
  }
  return 1;
}



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

{
  int *piVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong *plVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  longlong *plVar14;
  longlong *plVar15;
  bool bVar16;
  ushort local_res8 [4];
  ushort local_res10 [4];
  undefined8 local_res18;
  undefined2 local_108;
  char local_106;
  ushort local_104 [2];
  ushort local_100 [2];
  ushort local_fc [2];
  ushort local_f8 [4];
  longlong *local_f0;
  longlong *local_e8;
  longlong *local_e0;
  uint local_d8;
  uint local_d4;
  uint local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  uint local_c4;
  float local_c0;
  float local_bc;
  float local_b8;
  longlong *local_b0;
  longlong *local_a8;
  longlong *local_a0;
  longlong *local_98;
  char *local_90;
  DWORD local_88;
  longlong local_80;
  undefined1 local_78 [16];
  undefined8 local_68;
  
  local_68 = 0xfffffffffffffffe;
  local_90 = "PacketPT_ENEMY_STATE_SET_DAMAGE";
  local_80 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_res18 = param_3;
  local_88 = timeGetTime();
  local_108 = 0;
  local_106 = '\0';
  iVar12 = 4;
  iVar9 = 4;
  iVar10 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar10);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar10;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar10 = 2;
  iVar13 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar13);
    iVar11 = iVar11 + iVar13;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  iVar13 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar13);
    iVar11 = iVar11 + iVar13;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar9 = 4;
  iVar13 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(&local_c8,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar13);
    iVar11 = iVar11 + iVar13;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar12 = 0x100 - *(int *)(param_2 + 4), 0 < iVar12)) {
    iVar9 = *(int *)(param_2 + 4);
    memcpy(&local_cc,(void *)((longlong)iVar9 + 0xc + param_2),(longlong)iVar12);
    iVar9 = iVar9 + iVar12;
    *(int *)(param_2 + 4) = iVar9;
    *(int *)(param_2 + 8) = iVar9;
  }
  FUN_140122040(param_2,&local_108);
  FUN_140121f60(param_2,local_78);
  iVar9 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(local_f8,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  iVar9 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(local_100,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  iVar9 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(local_fc,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    iVar9 = *(int *)(param_2 + 4);
    memcpy(local_104,(void *)((longlong)iVar9 + 0xc + param_2),(longlong)iVar10);
    iVar9 = iVar9 + iVar10;
    *(int *)(param_2 + 4) = iVar9;
    *(int *)(param_2 + 8) = iVar9;
  }
  uVar6 = local_res18;
  local_d4 = (uint)local_res8[0];
  local_d8 = (uint)local_res10[0];
  local_d0 = (uint)local_fc[0];
  local_c4 = (uint)local_104[0];
  local_c0 = (float)(int)(char)local_108 / 125.0;
  local_bc = (float)(int)local_108._1_1_ / 125.0;
  local_b8 = (float)(int)local_106 / 125.0;
  FUN_14018fa30(local_res18,&local_e8,*param_4);
  if (local_e8 == (longlong *)0x0) {
    if (local_e0 != (longlong *)0x0) {
      LOCK();
      plVar14 = local_e0 + 1;
      lVar7 = *plVar14;
      *(int *)plVar14 = (int)*plVar14 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_e0 + 8))(local_e0);
        LOCK();
        piVar1 = (int *)((longlong)local_e0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_e0 + 0x10))(local_e0);
        }
      }
    }
    FUN_14004b970(&local_90);
    uVar6 = 0;
  }
  else {
    lVar7 = FUN_14018fbc0(uVar6,local_c8);
    plVar14 = (longlong *)0x0;
    if (lVar7 == 0) {
      (**(code **)(*local_e8 + 0x118))(local_e8,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_b0);
      plVar2 = local_b0;
      plVar15 = plVar14;
      if (local_b0 != (longlong *)0x0) {
        if (local_b0 == local_a8) {
          plVar15 = (longlong *)*local_b0;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      local_f0 = local_e8;
      plVar8 = plVar14;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_a8) {
          plVar8 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar8[0x25];
      lVar7 = *local_f0;
      uVar5 = (**(code **)(*plVar15 + 0xb0))(plVar15);
      (**(code **)(lVar7 + 0x118))(local_f0,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_a8) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_b0;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_b0);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    lVar7 = FUN_14018fbc0(local_res18,local_cc);
    if (lVar7 == 0) {
      (**(code **)(*local_e8 + 0x138))(local_e8,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_a0);
      plVar2 = local_a0;
      plVar15 = plVar14;
      if (local_a0 != (longlong *)0x0) {
        if (local_a0 == local_98) {
          plVar15 = (longlong *)*local_a0;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      local_f0 = local_e8;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_98) {
          plVar14 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar14[0x25];
      lVar7 = *local_f0;
      uVar5 = (**(code **)(*plVar15 + 0xb0))(plVar15);
      (**(code **)(lVar7 + 0x138))(local_f0,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_98) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_a0;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_a0);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    *(uint *)(local_e8 + 0x43c) = local_d0;
    *(uint *)(local_e8 + 0xa4) = local_c4;
    FUN_14022f150(local_e8,local_d4,local_d8,local_78,&local_c0,(float)local_f8[0],
                  (float)local_100[0]);
    if (local_e0 != (longlong *)0x0) {
      LOCK();
      plVar14 = local_e0 + 1;
      lVar7 = *plVar14;
      *(int *)plVar14 = (int)*plVar14 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_e0 + 8))(local_e0);
        LOCK();
        piVar1 = (int *)((longlong)local_e0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_e0 + 0x10))(local_e0);
        }
      }
    }
    FUN_14004b970(&local_90);
    uVar6 = 1;
  }
  return uVar6;
}



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

{
  int *piVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong *plVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  longlong *plVar14;
  longlong *plVar15;
  bool bVar16;
  ushort local_res8 [4];
  ushort local_res10 [4];
  undefined8 local_res18;
  undefined2 local_d8;
  char local_d6;
  ushort local_d4 [2];
  ushort local_d0 [4];
  longlong *local_c8;
  longlong *local_c0;
  longlong *local_b8;
  uint local_b0;
  undefined4 local_ac;
  uint local_a8;
  undefined4 local_a4;
  uint local_a0;
  uint local_9c;
  float local_98;
  float local_94;
  float local_90;
  longlong *local_88;
  longlong *local_80;
  longlong *local_78;
  longlong *local_70;
  char *local_68;
  DWORD local_60;
  longlong local_58;
  undefined1 local_50 [16];
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  local_68 = "PacketPT_ENEMY_STATE_SET_NO_RISING_DAMAGE";
  local_58 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_res18 = param_3;
  local_60 = timeGetTime();
  local_d8 = 0;
  local_d6 = '\0';
  iVar12 = 4;
  iVar9 = 4;
  iVar10 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar10);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar10;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar10 = 2;
  iVar13 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar13);
    iVar11 = iVar11 + iVar13;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  iVar13 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar13);
    iVar11 = iVar11 + iVar13;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar9 = 4;
  iVar13 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(&local_ac,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar13);
    iVar11 = iVar11 + iVar13;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar12 = 0x100 - *(int *)(param_2 + 4), 0 < iVar12)) {
    iVar9 = *(int *)(param_2 + 4);
    memcpy(&local_a4,(void *)((longlong)iVar9 + 0xc + param_2),(longlong)iVar12);
    iVar9 = iVar9 + iVar12;
    *(int *)(param_2 + 4) = iVar9;
    *(int *)(param_2 + 8) = iVar9;
  }
  FUN_140122040(param_2,&local_d8);
  FUN_140121f60(param_2,local_50);
  iVar9 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(local_d0,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    iVar9 = *(int *)(param_2 + 4);
    memcpy(local_d4,(void *)((longlong)iVar9 + 0xc + param_2),(longlong)iVar10);
    iVar9 = iVar9 + iVar10;
    *(int *)(param_2 + 4) = iVar9;
    *(int *)(param_2 + 8) = iVar9;
  }
  uVar6 = local_res18;
  local_b0 = (uint)local_res8[0];
  local_a0 = (uint)local_res10[0];
  local_a8 = (uint)local_d0[0];
  local_9c = (uint)local_d4[0];
  local_98 = (float)(int)(char)local_d8 / 125.0;
  local_94 = (float)(int)local_d8._1_1_ / 125.0;
  local_90 = (float)(int)local_d6 / 125.0;
  FUN_14018fa30(local_res18,&local_c0,*param_4);
  if (local_c0 == (longlong *)0x0) {
    if (local_b8 != (longlong *)0x0) {
      LOCK();
      plVar14 = local_b8 + 1;
      lVar7 = *plVar14;
      *(int *)plVar14 = (int)*plVar14 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_b8 + 8))(local_b8);
        LOCK();
        piVar1 = (int *)((longlong)local_b8 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_b8 + 0x10))(local_b8);
        }
      }
    }
    FUN_14004b970(&local_68);
    uVar6 = 0;
  }
  else {
    lVar7 = FUN_14018fbc0(uVar6,local_ac);
    plVar14 = (longlong *)0x0;
    if (lVar7 == 0) {
      (**(code **)(*local_c0 + 0x118))(local_c0,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_88);
      plVar2 = local_88;
      plVar15 = plVar14;
      if (local_88 != (longlong *)0x0) {
        if (local_88 == local_80) {
          plVar15 = (longlong *)*local_88;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      local_c8 = local_c0;
      plVar8 = plVar14;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_80) {
          plVar8 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar8[0x25];
      lVar7 = *local_c8;
      uVar5 = (**(code **)(*plVar15 + 0xb0))(plVar15);
      (**(code **)(lVar7 + 0x118))(local_c8,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_80) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_88;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_88);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    lVar7 = FUN_14018fbc0(local_res18,local_a4);
    if (lVar7 == 0) {
      (**(code **)(*local_c0 + 0x138))(local_c0,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_78);
      plVar2 = local_78;
      plVar15 = plVar14;
      if (local_78 != (longlong *)0x0) {
        if (local_78 == local_70) {
          plVar15 = (longlong *)*local_78;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      local_c8 = local_c0;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_70) {
          plVar14 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar14[0x25];
      lVar7 = *local_c8;
      uVar5 = (**(code **)(*plVar15 + 0xb0))(plVar15);
      (**(code **)(lVar7 + 0x138))(local_c8,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_70) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_78;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_78);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    *(uint *)(local_c0 + 0x43c) = local_a8;
    *(uint *)(local_c0 + 0xa4) = local_9c;
    FUN_14022f150(local_c0,local_b0,local_a0,local_50,&local_98,0,0);
    if (local_b8 != (longlong *)0x0) {
      LOCK();
      plVar14 = local_b8 + 1;
      lVar7 = *plVar14;
      *(int *)plVar14 = (int)*plVar14 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_b8 + 8))(local_b8);
        LOCK();
        piVar1 = (int *)((longlong)local_b8 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_b8 + 0x10))(local_b8);
        }
      }
    }
    FUN_14004b970(&local_68);
    uVar6 = 1;
  }
  return uVar6;
}



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

{
  int *piVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong *plVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  longlong *plVar13;
  longlong *plVar14;
  bool bVar15;
  ushort local_res8 [4];
  ushort local_res10 [4];
  undefined8 local_res18;
  undefined2 local_e8;
  char local_e6;
  longlong *local_e0;
  undefined4 local_d8;
  undefined4 local_d0 [2];
  longlong *local_c8;
  longlong *local_c0;
  uint local_b8;
  undefined4 local_b4;
  uint local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  float local_98;
  float local_94;
  float local_90;
  longlong *local_88;
  longlong *local_80;
  longlong *local_78;
  longlong *local_70;
  char *local_68;
  DWORD local_60;
  longlong local_58;
  undefined1 local_50 [16];
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  local_68 = "PacketPT_ENEMY_STATE_SET_GUARD";
  local_58 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_res18 = param_3;
  local_60 = timeGetTime();
  local_e8 = 0;
  local_e6 = '\0';
  iVar10 = 4;
  iVar9 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar9);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar9 = 2;
  iVar12 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar12 = 0x100 - *(int *)(param_2 + 4), 0 < iVar12)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar12);
    iVar11 = iVar11 + iVar12;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  iVar9 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(&local_ac,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  iVar9 = 4;
  iVar12 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar12 = 0x100 - *(int *)(param_2 + 4), 0 < iVar12)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_d0,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar12);
    iVar11 = iVar11 + iVar12;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    iVar9 = *(int *)(param_2 + 4);
    memcpy(&local_b4,(void *)((longlong)iVar9 + 0xc + param_2),(longlong)iVar10);
    iVar9 = iVar9 + iVar10;
    *(int *)(param_2 + 4) = iVar9;
    *(int *)(param_2 + 8) = iVar9;
  }
  FUN_140122040(param_2,&local_e8);
  FUN_140121f60(param_2,local_50);
  uVar6 = local_res18;
  local_b8 = (uint)local_res8[0];
  local_b0 = (uint)local_res10[0];
  local_98 = (float)(int)(char)local_e8 / 125.0;
  local_94 = (float)(int)local_e8._1_1_ / 125.0;
  local_90 = (float)(int)local_e6 / 125.0;
  FUN_14018fa30(local_res18,&local_c8,*param_4);
  if (local_c8 == (longlong *)0x0) {
    if (local_c0 != (longlong *)0x0) {
      LOCK();
      plVar13 = local_c0 + 1;
      lVar7 = *plVar13;
      *(int *)plVar13 = (int)*plVar13 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_c0 + 8))(local_c0);
        LOCK();
        piVar1 = (int *)((longlong)local_c0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_c0 + 0x10))(local_c0);
        }
      }
    }
    FUN_14004b970(&local_68);
    uVar6 = 0;
  }
  else {
    lVar7 = FUN_14018fbc0(uVar6,local_d0[0]);
    plVar13 = (longlong *)0x0;
    if (lVar7 == 0) {
      (**(code **)(*local_c8 + 0x118))(local_c8,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_78);
      plVar2 = local_78;
      plVar14 = plVar13;
      if (local_78 != (longlong *)0x0) {
        if (local_78 == local_70) {
          plVar14 = (longlong *)*local_78;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar15 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
      local_e0 = local_c8;
      plVar8 = plVar13;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_70) {
          plVar8 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar15 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar8[0x25];
      lVar7 = *local_e0;
      uVar5 = (**(code **)(*plVar14 + 0xb0))(plVar14);
      (**(code **)(lVar7 + 0x118))(local_e0,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_70) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_78;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_78);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar15 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
    }
    lVar7 = FUN_14018fbc0(local_res18,local_b4);
    if (lVar7 == 0) {
      (**(code **)(*local_c8 + 0x138))(local_c8,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_88);
      plVar2 = local_88;
      plVar14 = plVar13;
      if (local_88 != (longlong *)0x0) {
        if (local_88 == local_80) {
          plVar14 = (longlong *)*local_88;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar15 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
      local_e0 = local_c8;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_80) {
          plVar13 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar15 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar13[0x25];
      lVar7 = *local_e0;
      uVar5 = (**(code **)(*plVar14 + 0xb0))(plVar14);
      (**(code **)(lVar7 + 0x138))(local_e0,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_80) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_88;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_88);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar15 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
    }
    local_e0 = (longlong *)0x0;
    local_d8 = 0;
    local_a8 = 0;
    local_a4 = 0;
    local_a0 = 0;
    FUN_14022fa00(local_c8,local_b8,local_b0,0,local_ac,local_d0[0],local_50,&local_98,0,0,&local_a8
                 );
    if (local_c0 != (longlong *)0x0) {
      LOCK();
      plVar13 = local_c0 + 1;
      lVar7 = *plVar13;
      *(int *)plVar13 = (int)*plVar13 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_c0 + 8))(local_c0);
        LOCK();
        piVar1 = (int *)((longlong)local_c0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_c0 + 0x10))(local_c0);
        }
      }
    }
    FUN_14004b970(&local_68);
    uVar6 = 1;
  }
  return uVar6;
}



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

{
  int *piVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong *plVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  longlong *plVar13;
  longlong *plVar14;
  bool bVar15;
  ushort local_res8 [4];
  ushort local_res10 [4];
  undefined8 local_res18;
  undefined2 local_e8;
  char local_e6;
  longlong *local_e0;
  undefined4 local_d8;
  undefined4 local_d0 [2];
  longlong *local_c8;
  longlong *local_c0;
  uint local_b8;
  undefined4 local_b4;
  uint local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  float local_98;
  float local_94;
  float local_90;
  longlong *local_88;
  longlong *local_80;
  longlong *local_78;
  longlong *local_70;
  char *local_68;
  DWORD local_60;
  longlong local_58;
  undefined1 local_50 [16];
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  local_68 = "PacketPT_ENEMY_STATE_SET_JUST_GUARD_CRASH";
  local_58 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_res18 = param_3;
  local_60 = timeGetTime();
  local_e8 = 0;
  local_e6 = '\0';
  iVar10 = 4;
  iVar9 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar9);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar9 = 2;
  iVar12 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar12 = 0x100 - *(int *)(param_2 + 4), 0 < iVar12)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar12);
    iVar11 = iVar11 + iVar12;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  iVar9 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(&local_ac,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  iVar9 = 4;
  iVar12 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar12 = 0x100 - *(int *)(param_2 + 4), 0 < iVar12)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_d0,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar12);
    iVar11 = iVar11 + iVar12;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    iVar9 = *(int *)(param_2 + 4);
    memcpy(&local_b4,(void *)((longlong)iVar9 + 0xc + param_2),(longlong)iVar10);
    iVar9 = iVar9 + iVar10;
    *(int *)(param_2 + 4) = iVar9;
    *(int *)(param_2 + 8) = iVar9;
  }
  FUN_140122040(param_2,&local_e8);
  FUN_140121f60(param_2,local_50);
  uVar6 = local_res18;
  local_b8 = (uint)local_res8[0];
  local_b0 = (uint)local_res10[0];
  local_98 = (float)(int)(char)local_e8 / 125.0;
  local_94 = (float)(int)local_e8._1_1_ / 125.0;
  local_90 = (float)(int)local_e6 / 125.0;
  FUN_14018fa30(local_res18,&local_c8,*param_4);
  if (local_c8 == (longlong *)0x0) {
    if (local_c0 != (longlong *)0x0) {
      LOCK();
      plVar13 = local_c0 + 1;
      lVar7 = *plVar13;
      *(int *)plVar13 = (int)*plVar13 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_c0 + 8))(local_c0);
        LOCK();
        piVar1 = (int *)((longlong)local_c0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_c0 + 0x10))(local_c0);
        }
      }
    }
    FUN_14004b970(&local_68);
    uVar6 = 0;
  }
  else {
    lVar7 = FUN_14018fbc0(uVar6,local_d0[0]);
    plVar13 = (longlong *)0x0;
    if (lVar7 == 0) {
      (**(code **)(*local_c8 + 0x118))(local_c8,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_78);
      plVar2 = local_78;
      plVar14 = plVar13;
      if (local_78 != (longlong *)0x0) {
        if (local_78 == local_70) {
          plVar14 = (longlong *)*local_78;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar15 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
      local_e0 = local_c8;
      plVar8 = plVar13;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_70) {
          plVar8 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar15 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar8[0x25];
      lVar7 = *local_e0;
      uVar5 = (**(code **)(*plVar14 + 0xb0))(plVar14);
      (**(code **)(lVar7 + 0x118))(local_e0,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_70) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_78;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_78);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar15 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
    }
    lVar7 = FUN_14018fbc0(local_res18,local_b4);
    if (lVar7 == 0) {
      (**(code **)(*local_c8 + 0x138))(local_c8,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_88);
      plVar2 = local_88;
      plVar14 = plVar13;
      if (local_88 != (longlong *)0x0) {
        if (local_88 == local_80) {
          plVar14 = (longlong *)*local_88;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar15 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
      local_e0 = local_c8;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_80) {
          plVar13 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar15 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar13[0x25];
      lVar7 = *local_e0;
      uVar5 = (**(code **)(*plVar14 + 0xb0))(plVar14);
      (**(code **)(lVar7 + 0x138))(local_e0,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_80) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_88;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_88);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar15 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar15) {
            FUN_140176d60(1);
          }
        }
      }
    }
    (**(code **)(*local_c8 + 0xb88))(local_c8,1);
    local_e0 = (longlong *)0x0;
    local_d8 = 0;
    local_a8 = 0;
    local_a4 = 0;
    local_a0 = 0;
    FUN_14022fa00(local_c8,local_b8,local_b0,0,local_ac,local_d0[0],local_50,&local_98,0,0,&local_a8
                 );
    if (local_c0 != (longlong *)0x0) {
      LOCK();
      plVar13 = local_c0 + 1;
      lVar7 = *plVar13;
      *(int *)plVar13 = (int)*plVar13 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_c0 + 8))(local_c0);
        LOCK();
        piVar1 = (int *)((longlong)local_c0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_c0 + 0x10))(local_c0);
        }
      }
    }
    FUN_14004b970(&local_68);
    uVar6 = 1;
  }
  return uVar6;
}



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

{
  int *piVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong *plVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  longlong *plVar14;
  longlong *plVar15;
  bool bVar16;
  byte local_res8 [8];
  ushort local_res10 [4];
  undefined8 local_res18;
  undefined2 local_d8;
  char local_d6;
  ushort local_d4 [2];
  longlong *local_d0;
  longlong *local_c8;
  longlong *local_c0;
  undefined4 local_b8;
  uint local_b4;
  undefined4 local_b0;
  uint local_ac;
  uint local_a8;
  float local_a0;
  float local_9c;
  float local_98;
  longlong *local_90;
  longlong *local_88;
  longlong *local_80;
  longlong *local_78;
  char *local_70;
  DWORD local_68;
  longlong local_60;
  undefined1 local_58 [16];
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  local_70 = "PacketPT_ENEMY_STATE_SET_DOWN";
  local_60 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_res18 = param_3;
  local_68 = timeGetTime();
  local_d8 = 0;
  local_d6 = '\0';
  iVar11 = 4;
  iVar9 = 4;
  iVar10 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar10);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar10;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar10 = 2;
  iVar13 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar13);
    iVar12 = iVar12 + iVar13;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    iVar13 = *(int *)(param_2 + 4);
    memcpy(local_d4,(void *)((longlong)iVar13 + 0xc + param_2),(longlong)iVar10);
    iVar13 = iVar13 + iVar10;
    *(int *)(param_2 + 4) = iVar13;
    *(int *)(param_2 + 8) = iVar13;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar9 = 4;
  iVar10 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    iVar13 = *(int *)(param_2 + 4);
    memcpy(&local_b0,(void *)((longlong)iVar13 + 0xc + param_2),(longlong)iVar10);
    iVar13 = iVar13 + iVar10;
    *(int *)(param_2 + 4) = iVar13;
    *(int *)(param_2 + 8) = iVar13;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar11 = 0x100 - *(int *)(param_2 + 4), 0 < iVar11)) {
    iVar9 = *(int *)(param_2 + 4);
    memcpy(&local_b8,(void *)((longlong)iVar9 + 0xc + param_2),(longlong)iVar11);
    iVar9 = iVar9 + iVar11;
    *(int *)(param_2 + 4) = iVar9;
    *(int *)(param_2 + 8) = iVar9;
  }
  iVar9 = 1;
  if ((*(int *)(param_2 + 4) + 1 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar10 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar10 + 0xc + param_2),(longlong)iVar9);
    iVar10 = iVar10 + iVar9;
    *(int *)(param_2 + 4) = iVar10;
    *(int *)(param_2 + 8) = iVar10;
  }
  FUN_140122040(param_2,&local_d8);
  FUN_140121f60(param_2,local_58);
  uVar6 = local_res18;
  local_b4 = (uint)local_res10[0];
  local_a8 = (uint)local_d4[0];
  local_ac = (uint)local_res8[0];
  local_a0 = (float)(int)(char)local_d8 / 125.0;
  local_9c = (float)(int)local_d8._1_1_ / 125.0;
  local_98 = (float)(int)local_d6 / 125.0;
  FUN_14018fa30(local_res18,&local_c8,*param_4);
  if (local_c8 == (longlong *)0x0) {
    if (local_c0 != (longlong *)0x0) {
      LOCK();
      plVar14 = local_c0 + 1;
      lVar7 = *plVar14;
      *(int *)plVar14 = (int)*plVar14 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_c0 + 8))(local_c0);
        LOCK();
        piVar1 = (int *)((longlong)local_c0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_c0 + 0x10))(local_c0);
        }
      }
    }
    FUN_14004b970(&local_70);
    uVar6 = 0;
  }
  else {
    lVar7 = FUN_14018fbc0(uVar6,local_b0);
    plVar14 = (longlong *)0x0;
    if (lVar7 == 0) {
      (**(code **)(*local_c8 + 0x118))(local_c8,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_80);
      plVar2 = local_80;
      plVar15 = plVar14;
      if (local_80 != (longlong *)0x0) {
        if (local_80 == local_78) {
          plVar15 = (longlong *)*local_80;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      local_d0 = local_c8;
      plVar8 = plVar14;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_78) {
          plVar8 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar8[0x25];
      lVar7 = *local_d0;
      uVar5 = (**(code **)(*plVar15 + 0xb0))(plVar15);
      (**(code **)(lVar7 + 0x118))(local_d0,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_78) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_80;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_80);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    lVar7 = FUN_14018fbc0(local_res18,local_b8);
    if (lVar7 == 0) {
      (**(code **)(*local_c8 + 0x138))(local_c8,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_90);
      plVar2 = local_90;
      plVar15 = plVar14;
      if (local_90 != (longlong *)0x0) {
        if (local_90 == local_88) {
          plVar15 = (longlong *)*local_90;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      local_d0 = local_c8;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_88) {
          plVar14 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar14[0x25];
      lVar7 = *local_d0;
      uVar5 = (**(code **)(*plVar15 + 0xb0))(plVar15);
      (**(code **)(lVar7 + 0x138))(local_d0,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_88) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_90;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_90);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    *(uint *)(local_c8 + 0x30b) = local_ac;
    FUN_14022f150(local_c8,local_b4,local_a8,local_58,&local_a0,0,0);
    if (local_c0 != (longlong *)0x0) {
      LOCK();
      plVar14 = local_c0 + 1;
      lVar7 = *plVar14;
      *(int *)plVar14 = (int)*plVar14 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_c0 + 8))(local_c0);
        LOCK();
        piVar1 = (int *)((longlong)local_c0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_c0 + 0x10))(local_c0);
        }
      }
    }
    FUN_14004b970(&local_70);
    uVar6 = 1;
  }
  return uVar6;
}



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

{
  int *piVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong *plVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  longlong *plVar14;
  longlong *plVar15;
  bool bVar16;
  byte local_res8 [8];
  ushort local_res10 [4];
  undefined8 local_res18;
  undefined2 local_118;
  char local_116;
  ushort local_114 [2];
  longlong *local_110;
  undefined4 local_108;
  ushort local_100 [2];
  ushort local_fc [2];
  undefined4 local_f8 [2];
  longlong *local_f0;
  longlong *local_e8;
  uint local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  uint local_d4;
  uint local_d0;
  float local_c8;
  float local_c4;
  float local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  longlong *local_a8;
  longlong *local_a0;
  longlong *local_98;
  longlong *local_90;
  char *local_88;
  DWORD local_80;
  longlong local_78;
  undefined1 local_70 [16];
  undefined8 local_60;
  
  local_60 = 0xfffffffffffffffe;
  local_88 = "PacketPT_ENEMY_STATE_SET";
  local_78 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_res18 = param_3;
  local_80 = timeGetTime();
  local_118 = 0;
  local_116 = '\0';
  iVar12 = 4;
  iVar9 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar9);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar9;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar9 = 2;
  iVar13 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar10 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar10 + 0xc + param_2),(longlong)iVar13);
    iVar10 = iVar10 + iVar13;
    *(int *)(param_2 + 4) = iVar10;
    *(int *)(param_2 + 8) = iVar10;
  }
  iVar13 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar10 = *(int *)(param_2 + 4);
    memcpy(local_100,(void *)((longlong)iVar10 + 0xc + param_2),(longlong)iVar13);
    iVar10 = iVar10 + iVar13;
    *(int *)(param_2 + 4) = iVar10;
    *(int *)(param_2 + 8) = iVar10;
  }
  iVar13 = 1;
  if ((*(int *)(param_2 + 4) + 1 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar10 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar10 + 0xc + param_2),(longlong)iVar13);
    iVar10 = iVar10 + iVar13;
    *(int *)(param_2 + 4) = iVar10;
    *(int *)(param_2 + 8) = iVar10;
  }
  iVar13 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    iVar10 = *(int *)(param_2 + 4);
    memcpy(&local_d8,(void *)((longlong)iVar10 + 0xc + param_2),(longlong)iVar13);
    iVar10 = iVar10 + iVar13;
    *(int *)(param_2 + 4) = iVar10;
    *(int *)(param_2 + 8) = iVar10;
  }
  iVar13 = 4;
  iVar10 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar10 = 0x100 - *(int *)(param_2 + 4), 0 < iVar10)) {
    iVar11 = *(int *)(param_2 + 4);
    memcpy(local_f8,(void *)((longlong)iVar11 + 0xc + param_2),(longlong)iVar10);
    iVar11 = iVar11 + iVar10;
    *(int *)(param_2 + 4) = iVar11;
    *(int *)(param_2 + 8) = iVar11;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar13 = 0x100 - *(int *)(param_2 + 4), 0 < iVar13)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar13;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar12 = 0x100 - *(int *)(param_2 + 4), 0 < iVar12)) {
    iVar13 = *(int *)(param_2 + 4);
    memcpy(&local_dc,(void *)((longlong)iVar13 + 0xc + param_2),(longlong)iVar12);
    iVar13 = iVar13 + iVar12;
    *(int *)(param_2 + 4) = iVar13;
    *(int *)(param_2 + 8) = iVar13;
  }
  FUN_140122040(param_2,&local_118);
  FUN_140121f60(param_2,local_70);
  iVar12 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar12 = 0x100 - *(int *)(param_2 + 4), 0 < iVar12)) {
    iVar13 = *(int *)(param_2 + 4);
    memcpy(local_114,(void *)((longlong)iVar13 + 0xc + param_2),(longlong)iVar12);
    iVar13 = iVar13 + iVar12;
    *(int *)(param_2 + 4) = iVar13;
    *(int *)(param_2 + 8) = iVar13;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
    iVar12 = *(int *)(param_2 + 4);
    memcpy(local_fc,(void *)((longlong)iVar12 + 0xc + param_2),(longlong)iVar9);
    iVar12 = iVar12 + iVar9;
    *(int *)(param_2 + 4) = iVar12;
    *(int *)(param_2 + 8) = iVar12;
  }
  uVar6 = local_res18;
  local_e0 = (uint)local_res10[0];
  local_d0 = (uint)local_100[0];
  local_d4 = (uint)local_res8[0];
  local_c8 = (float)(int)(char)local_118 / 125.0;
  local_c4 = (float)(int)local_118._1_1_ / 125.0;
  local_c0 = (float)(int)local_116 / 125.0;
  FUN_14018fa30(local_res18,&local_f0,*param_4);
  if (local_f0 == (longlong *)0x0) {
    if (local_e8 != (longlong *)0x0) {
      LOCK();
      plVar14 = local_e8 + 1;
      lVar7 = *plVar14;
      *(int *)plVar14 = (int)*plVar14 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_e8 + 8))(local_e8);
        LOCK();
        piVar1 = (int *)((longlong)local_e8 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_e8 + 0x10))(local_e8);
        }
      }
    }
    FUN_14004b970(&local_88);
    uVar6 = 0;
  }
  else {
    lVar7 = FUN_14018fbc0(uVar6,local_f8[0]);
    plVar14 = (longlong *)0x0;
    if (lVar7 == 0) {
      (**(code **)(*local_f0 + 0x118))(local_f0,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_a8);
      plVar2 = local_a8;
      plVar15 = plVar14;
      if (local_a8 != (longlong *)0x0) {
        if (local_a8 == local_a0) {
          plVar15 = (longlong *)*local_a8;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      local_110 = local_f0;
      plVar8 = plVar14;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_a0) {
          plVar8 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar8[0x25];
      lVar7 = *local_110;
      uVar5 = (**(code **)(*plVar15 + 0xb0))(plVar15);
      (**(code **)(lVar7 + 0x118))(local_110,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_a0) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_a8;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_a8);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    lVar7 = FUN_14018fbc0(local_res18,local_dc);
    if (lVar7 == 0) {
      (**(code **)(*local_f0 + 0x138))(local_f0,0,0);
    }
    else {
      FUN_140198570(lVar7,&local_98);
      plVar2 = local_98;
      plVar15 = plVar14;
      if (local_98 != (longlong *)0x0) {
        if (local_98 == local_90) {
          plVar15 = (longlong *)*local_98;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      local_110 = local_f0;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_90) {
          plVar14 = (longlong *)*plVar2;
        }
        else {
          iVar9 = DAT_14060804c + 1;
          bVar16 = DAT_14060804c == 0;
          DAT_14060804c = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
      lVar4 = plVar14[0x25];
      lVar7 = *local_110;
      uVar5 = (**(code **)(*plVar15 + 0xb0))(plVar15);
      (**(code **)(lVar7 + 0x138))(local_110,uVar5,(int)lVar4);
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == local_90) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar3 = (undefined8 *)*local_98;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_98);
          }
        }
        else {
          iVar9 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar9;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    local_110 = (longlong *)0x0;
    local_108 = 0;
    local_b8 = 0;
    local_b4 = 0;
    local_b0 = 0;
    FUN_14022fa00(local_f0,local_e0,local_d0,local_d4,local_d8,local_f8[0],local_70,&local_c8,
                  (float)local_114[0],(float)local_fc[0],&local_b8);
    if (local_e8 != (longlong *)0x0) {
      LOCK();
      plVar14 = local_e8 + 1;
      lVar7 = *plVar14;
      *(int *)plVar14 = (int)*plVar14 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_e8 + 8))(local_e8);
        LOCK();
        piVar1 = (int *)((longlong)local_e8 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_e8 + 0x10))(local_e8);
        }
      }
    }
    FUN_14004b970(&local_88);
    uVar6 = 1;
  }
  return uVar6;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined2 local_res8 [4];
  undefined2 local_res10 [4];
  undefined2 local_98;
  char local_96;
  undefined8 local_90;
  float local_88;
  float local_84;
  float local_80;
  undefined1 local_78 [16];
  undefined1 local_68 [16];
  longlong local_58;
  longlong *local_50;
  char *local_48;
  DWORD local_40;
  longlong local_38;
  
  local_90 = 0xfffffffffffffffe;
  local_48 = "PacketPT_ENEMY_STATE_SET_MOVE";
  local_38 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_40 = timeGetTime();
  local_98 = 0;
  local_96 = '\0';
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar5);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar6 = 2;
  iVar5 = 2;
  iVar8 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar8 = 0x100 - *(int *)(param_2 + 4), 0 < iVar8)) {
    iVar7 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar7 + 0xc + param_2),(longlong)iVar8);
    iVar7 = iVar7 + iVar8;
    *(int *)(param_2 + 4) = iVar7;
    *(int *)(param_2 + 8) = iVar7;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  FUN_140121f60(param_2,local_68);
  FUN_140121f60(param_2,local_78);
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_2 + 4), 0 < iVar6)) {
    iVar5 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar5 + 0xc + param_2),(longlong)iVar6);
    iVar5 = iVar5 + iVar6;
    *(int *)(param_2 + 4) = iVar5;
    *(int *)(param_2 + 8) = iVar5;
  }
  FUN_140122040(param_2,&local_98);
  local_88 = (float)(int)(char)local_98 / 125.0;
  local_84 = (float)(int)local_98._1_1_ / 125.0;
  local_80 = (float)(int)local_96 / 125.0;
  FUN_14018fa30(param_3,&local_58,*param_4);
  if (local_58 == 0) {
    if (local_50 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_50 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_50 + 8))(local_50);
        LOCK();
        piVar2 = (int *)((longlong)local_50 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_50 + 0x10))(local_50);
        }
      }
    }
    FUN_14004b970(&local_48);
    uVar4 = 0;
  }
  else {
    FUN_14022f830(local_58,local_res8[0],0,local_68,local_78,local_res10[0],&local_88);
    if (local_50 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_50 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_50 + 8))(local_50);
        LOCK();
        piVar2 = (int *)((longlong)local_50 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_50 + 0x10))(local_50);
        }
      }
    }
    FUN_14004b970(&local_48);
    uVar4 = 1;
  }
  return uVar4;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  undefined2 local_res8;
  char local_resa;
  float local_50;
  float local_4c;
  float local_48;
  undefined1 local_40 [16];
  longlong local_30;
  longlong *local_28;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PacketPT_ENEMY_POSITION";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_18 = timeGetTime();
  local_res8 = 0;
  local_resa = '\0';
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar5);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  FUN_140121f60(param_2,local_40);
  FUN_140122040(param_2,&local_res8);
  iVar5 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  local_50 = (float)(int)(char)local_res8 / 125.0;
  local_4c = (float)(int)local_res8._1_1_ / 125.0;
  local_48 = (float)(int)local_resa / 125.0;
  FUN_14018fa30(param_3,&local_30,*param_4);
  if (local_30 == 0) {
    if (local_28 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_28 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_28 + 8))(local_28);
        LOCK();
        piVar2 = (int *)((longlong)local_28 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_28 + 0x10))(local_28);
        }
      }
    }
    FUN_14004b970(&local_20);
    uVar4 = 0;
  }
  else {
    FUN_14022f150(local_30,0x26,0,local_40,&local_50,0,0);
    if (local_28 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_28 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_28 + 8))(local_28);
        LOCK();
        piVar2 = (int *)((longlong)local_28 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_28 + 0x10))(local_28);
        }
      }
    }
    FUN_14004b970(&local_20);
    uVar4 = 1;
  }
  return uVar4;
}



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

{
  longlong *plVar1;
  int *piVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  undefined4 uVar6;
  longlong lVar7;
  int iVar8;
  longlong *plVar9;
  bool bVar10;
  undefined4 local_res8 [2];
  undefined1 *puVar11;
  undefined4 *puVar12;
  longlong *local_f8;
  longlong *local_f0;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8 [4];
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_a8;
  undefined1 local_a4 [4];
  undefined1 local_a0 [8];
  longlong *local_98;
  longlong *local_90;
  longlong *local_88;
  longlong *local_80;
  char *local_78;
  DWORD local_70;
  longlong local_68;
  undefined1 local_60 [16];
  undefined1 local_50 [16];
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  local_78 = "PacketPT_ENEMY_STATE_SET_ARMOR";
  local_68 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_70 = timeGetTime();
  puVar12 = local_res8;
  puVar11 = local_a4;
  FUN_1402b7790(param_2,param_4,&local_e4,&local_e8,puVar11,puVar12,local_a0,&local_dc,local_50,
                local_60,local_c8,&local_e0,&local_d8);
  FUN_14018fa30(param_3,&local_f8,*param_4);
  if (local_f8 == (longlong *)0x0) {
    if (local_f0 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_f0 + 1;
      lVar7 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*local_f0 + 8))(local_f0);
        LOCK();
        piVar2 = (int *)((longlong)local_f0 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_f0 + 0x10))(local_f0);
        }
      }
    }
    FUN_14004b970(&local_78);
    return 0;
  }
  lVar7 = FUN_14018fbc0(param_3,local_res8[0]);
  if (lVar7 == 0) {
    (**(code **)(*local_f8 + 0x118))(local_f8,0,0);
  }
  else {
    FUN_140198570(lVar7,&local_88);
    plVar1 = local_88;
    if (local_88 == (longlong *)0x0) {
LAB_14018b84a:
      plVar9 = (longlong *)0x0;
    }
    else {
      if (local_88 != local_80) {
        iVar8 = DAT_14060804c + 1;
        bVar10 = DAT_14060804c == 0;
        DAT_14060804c = iVar8;
        if (bVar10) {
          FUN_140176d60(1);
        }
        goto LAB_14018b84a;
      }
      plVar9 = (longlong *)*local_88;
    }
    plVar5 = local_f8;
    if (plVar1 == (longlong *)0x0) {
LAB_14018b879:
      lVar7 = 0;
    }
    else {
      if (plVar1 != local_80) {
        iVar8 = DAT_14060804c + 1;
        bVar10 = DAT_14060804c == 0;
        DAT_14060804c = iVar8;
        if (bVar10) {
          FUN_140176d60(1);
        }
        goto LAB_14018b879;
      }
      lVar7 = *plVar1;
    }
    uVar3 = *(undefined4 *)(lVar7 + 0x128);
    lVar7 = *plVar5;
    uVar6 = (**(code **)(*plVar9 + 0xb0))(plVar9);
    (**(code **)(lVar7 + 0x118))(plVar5,uVar6,uVar3);
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_80) {
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          puVar4 = (undefined8 *)*local_88;
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)(puVar4,1);
          }
          operator_delete(local_88);
        }
      }
      else {
        iVar8 = DAT_140608054 + 1;
        bVar10 = DAT_140608054 == 0;
        DAT_140608054 = iVar8;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
  }
  lVar7 = FUN_14018fbc0(param_3,local_dc);
  if (lVar7 == 0) {
    (**(code **)(*local_f8 + 0x138))(local_f8,0,0);
    goto LAB_14018ba1c;
  }
  FUN_140198570(lVar7,&local_98);
  plVar1 = local_98;
  if (local_98 == (longlong *)0x0) {
LAB_14018b963:
    plVar9 = (longlong *)0x0;
  }
  else {
    if (local_98 != local_90) {
      iVar8 = DAT_14060804c + 1;
      bVar10 = DAT_14060804c == 0;
      DAT_14060804c = iVar8;
      if (bVar10) {
        FUN_140176d60(1);
      }
      goto LAB_14018b963;
    }
    plVar9 = (longlong *)*local_98;
  }
  plVar5 = local_f8;
  if (plVar1 == (longlong *)0x0) {
LAB_14018b992:
    lVar7 = 0;
  }
  else {
    if (plVar1 != local_90) {
      iVar8 = DAT_14060804c + 1;
      bVar10 = DAT_14060804c == 0;
      DAT_14060804c = iVar8;
      if (bVar10) {
        FUN_140176d60(1);
      }
      goto LAB_14018b992;
    }
    lVar7 = *plVar1;
  }
  uVar3 = *(undefined4 *)(lVar7 + 0x128);
  lVar7 = *plVar5;
  uVar6 = (**(code **)(*plVar9 + 0xb0))(plVar9);
  (**(code **)(lVar7 + 0x138))(plVar5,uVar6,uVar3);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_90) {
      LOCK();
      plVar1 = plVar1 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        puVar4 = (undefined8 *)*local_98;
        if (puVar4 != (undefined8 *)0x0) {
          (**(code **)*puVar4)(puVar4,1);
        }
        operator_delete(local_98);
      }
    }
    else {
      iVar8 = DAT_140608054 + 1;
      bVar10 = DAT_140608054 == 0;
      DAT_140608054 = iVar8;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14018ba1c:
  *(undefined4 *)(local_f8 + 0x3c6) = local_d8;
  *(undefined4 *)((longlong)local_f8 + 0x1e2c) = local_d8;
  local_d4 = 0;
  local_d0 = 0;
  local_cc = 0;
  local_b8 = 0;
  local_b4 = 0;
  local_b0 = 0;
  FUN_14022fa00(local_f8,local_e4,local_e8,local_a8,(ulonglong)puVar11 & 0xffffffff00000000,
                (ulonglong)puVar12 & 0xffffffff00000000,local_60,local_50,local_c8[0],local_e0,
                &local_b8);
  if (local_f0 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_f0 + 1;
    lVar7 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar7 == 1) {
      (**(code **)(*local_f0 + 8))(local_f0);
      LOCK();
      piVar2 = (int *)((longlong)local_f0 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_f0 + 0x10))(local_f0);
      }
    }
  }
  FUN_14004b970(&local_78);
  return 1;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined1 local_res8 [8];
  undefined2 local_res10 [4];
  undefined2 local_a8 [2];
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94 [3];
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  longlong local_68;
  longlong *local_60;
  char *local_58;
  DWORD local_50;
  longlong local_48;
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  local_58 = "PacketPT_ENEMY_STATE_SET_CAUGHT";
  local_48 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_50 = timeGetTime();
  iVar6 = 4;
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar5);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar5 = 2;
  iVar8 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar8 = 0x100 - *(int *)(param_2 + 4), 0 < iVar8)) {
    iVar7 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar7 + 0xc + param_2),(longlong)iVar8);
    iVar7 = iVar7 + iVar8;
    *(int *)(param_2 + 4) = iVar7;
    *(int *)(param_2 + 8) = iVar7;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    iVar8 = *(int *)(param_2 + 4);
    memcpy(local_a8,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar5);
    iVar8 = iVar8 + iVar5;
    *(int *)(param_2 + 4) = iVar8;
    *(int *)(param_2 + 8) = iVar8;
  }
  iVar5 = 1;
  if ((*(int *)(param_2 + 4) + 1 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    iVar8 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar5);
    iVar8 = iVar8 + iVar5;
    *(int *)(param_2 + 4) = iVar8;
    *(int *)(param_2 + 8) = iVar8;
  }
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    iVar8 = *(int *)(param_2 + 4);
    memcpy(&local_98,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar5);
    iVar8 = iVar8 + iVar5;
    *(int *)(param_2 + 4) = iVar8;
    *(int *)(param_2 + 8) = iVar8;
  }
  iVar5 = 4;
  iVar8 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar8 = 0x100 - *(int *)(param_2 + 4), 0 < iVar8)) {
    iVar7 = *(int *)(param_2 + 4);
    memcpy(local_94,(void *)((longlong)iVar7 + 0xc + param_2),(longlong)iVar8);
    iVar7 = iVar7 + iVar8;
    *(int *)(param_2 + 4) = iVar7;
    *(int *)(param_2 + 8) = iVar7;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_2 + 4), 0 < iVar6)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar6;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  FUN_14018fa30(param_3,&local_68,*param_4);
  if (local_68 == 0) {
    if (local_60 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_60 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_60 + 8))(local_60);
        LOCK();
        piVar2 = (int *)((longlong)local_60 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_60 + 0x10))(local_60);
        }
      }
    }
    FUN_14004b970(&local_58);
    uVar4 = 0;
  }
  else {
    local_88 = 0;
    local_84 = 0;
    local_80 = 0;
    local_a4 = 0x3f800000;
    local_a0 = 0;
    local_9c = 0;
    local_78 = 0;
    local_74 = 0;
    local_70 = 0;
    FUN_14022fa00(local_68,local_res10[0],local_a8[0],local_res8[0],local_98,local_94[0],&local_78,
                  &local_a4,0,0,&local_88);
    if (local_60 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_60 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_60 + 8))(local_60);
        LOCK();
        piVar2 = (int *)((longlong)local_60 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_60 + 0x10))(local_60);
        }
      }
    }
    FUN_14004b970(&local_58);
    uVar4 = 1;
  }
  return uVar4;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  char cVar5;
  undefined4 uVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  int local_res8 [2];
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  longlong local_68;
  longlong *local_60;
  char *local_58;
  DWORD local_50;
  longlong local_48;
  undefined1 local_40 [16];
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  local_58 = "PacketPT_ENEMY_DAMAGE";
  local_48 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_50 = timeGetTime();
  cVar5 = FUN_1401956a0(param_3);
  if (cVar5 == '\x01') {
    FUN_140418da0(DAT_140607fd8,L"PT_ENEMY_DAMAGE == IsBadUser\n");
  }
  else {
    iVar9 = 4;
    iVar7 = 4;
    iVar8 = 4;
    if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar8 = 0x100 - *(int *)(param_2 + 4), 0 < iVar8)) {
      memcpy(param_5,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar8);
      *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar8;
      *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
    }
    iVar8 = 0xc;
    if ((*(int *)(param_2 + 4) + 0xc < 0x101) || (iVar8 = 0x100 - *(int *)(param_2 + 4), 0 < iVar8))
    {
      iVar10 = *(int *)(param_2 + 4);
      memcpy(local_40,(void *)((longlong)iVar10 + 0xc + param_2),(longlong)iVar8);
      iVar10 = iVar10 + iVar8;
      *(int *)(param_2 + 4) = iVar10;
      *(int *)(param_2 + 8) = iVar10;
    }
    if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_2 + 4), 0 < iVar7)) {
      *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar7;
      *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
    }
    iVar7 = 4;
    if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_2 + 4), 0 < iVar7)) {
      iVar8 = *(int *)(param_2 + 4);
      memcpy(&local_78,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar7);
      iVar8 = iVar8 + iVar7;
      *(int *)(param_2 + 4) = iVar8;
      *(int *)(param_2 + 8) = iVar8;
    }
    iVar7 = 4;
    if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_2 + 4), 0 < iVar7)) {
      iVar8 = *(int *)(param_2 + 4);
      memcpy(&local_6c,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar7);
      iVar8 = iVar8 + iVar7;
      *(int *)(param_2 + 4) = iVar8;
      *(int *)(param_2 + 8) = iVar8;
    }
    if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar9 = 0x100 - *(int *)(param_2 + 4), 0 < iVar9)) {
      iVar7 = *(int *)(param_2 + 4);
      memcpy(&local_70,(void *)((longlong)iVar7 + 0xc + param_2),(longlong)iVar9);
      iVar7 = iVar7 + iVar9;
      *(int *)(param_2 + 4) = iVar7;
      *(int *)(param_2 + 8) = iVar7;
    }
    FUN_14018fa30(param_3,&local_68,*param_5);
    if (local_68 == 0) {
      if (local_60 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_60 + 1;
        lVar3 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar3 == 1) {
          (**(code **)(*local_60 + 8))(local_60);
          LOCK();
          piVar2 = (int *)((longlong)local_60 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_60 + 0x10))(local_60);
          }
        }
      }
      FUN_14004b970(&local_58);
      return 0;
    }
    local_res8[0] = 0;
    local_74 = 0;
    uVar6 = (**(code **)(*param_4 + 0x1a8))(param_4);
    cVar5 = FUN_140314750(&local_74,local_res8,local_40,uVar6);
    uVar4 = DAT_140607fd8;
    if (cVar5 == '\0') {
      uVar6 = (**(code **)(*param_4 + 0x1a8))(param_4);
      FUN_140418da0(uVar4,L"PT_ENEMY_DAMAGE = %d, %d, %d, %d\n",local_78,local_6c,local_70,uVar6);
    }
    else {
      FUN_14022f4f0(local_68,-local_res8[0]);
    }
    if (local_60 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_60 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_60 + 8))(local_60);
        LOCK();
        piVar2 = (int *)((longlong)local_60 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_60 + 0x10))(local_60);
        }
      }
    }
  }
  FUN_14004b970(&local_58);
  return 1;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined1 local_res8 [8];
  undefined1 local_res10 [8];
  longlong *local_50;
  longlong *local_48;
  char *local_40;
  DWORD local_38;
  longlong local_30;
  
  local_40 = "PacketPT_ENEMY_STATUS";
  local_30 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_38 = timeGetTime();
  iVar6 = 4;
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar5);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    iVar7 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar7 + 0xc + param_2),(longlong)iVar5);
    iVar7 = iVar7 + iVar5;
    *(int *)(param_2 + 4) = iVar7;
    *(int *)(param_2 + 8) = iVar7;
  }
  iVar5 = 4;
  iVar7 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_2 + 4), 0 < iVar7)) {
    iVar8 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar7);
    iVar8 = iVar8 + iVar7;
    *(int *)(param_2 + 4) = iVar8;
    *(int *)(param_2 + 8) = iVar8;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_2 + 4), 0 < iVar6)) {
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar6;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  FUN_14018fa30(param_3,&local_50,*param_4);
  if (local_50 == (longlong *)0x0) {
    if (local_48 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_48 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_48 + 8))(local_48);
        LOCK();
        piVar2 = (int *)((longlong)local_48 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_48 + 0x10))(local_48);
        }
      }
    }
    FUN_14004b970(&local_40);
    uVar4 = 0;
  }
  else {
    FUN_1402f88a0();
    FUN_1402f8960(local_50);
    (**(code **)(*local_50 + 0xbc0))();
    if (local_48 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_48 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_48 + 8))(local_48);
        LOCK();
        piVar2 = (int *)((longlong)local_48 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_48 + 0x10))(local_48);
        }
      }
    }
    FUN_14004b970(&local_40);
    uVar4 = 1;
  }
  return uVar4;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  int iVar6;
  ushort local_res8 [4];
  undefined2 local_res10;
  char local_res12;
  float local_70;
  float local_6c;
  float local_68;
  undefined1 local_60 [16];
  longlong *local_50;
  longlong *local_48;
  char *local_40;
  DWORD local_38;
  longlong local_30;
  
  local_40 = "PacketPT_ENEMY_WEAK_HIT";
  local_30 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_38 = timeGetTime();
  local_res10 = 0;
  local_res12 = '\0';
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar5);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar5 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    iVar6 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar6 + 0xc + param_2),(longlong)iVar5);
    iVar6 = iVar6 + iVar5;
    *(int *)(param_2 + 4) = iVar6;
    *(int *)(param_2 + 8) = iVar6;
  }
  FUN_140122040(param_2,&local_res10);
  FUN_140121f60(param_2,local_60);
  local_70 = (float)(int)(char)local_res10 / 125.0;
  local_6c = (float)(int)local_res10._1_1_ / 125.0;
  local_68 = (float)(int)local_res12 / 125.0;
  FUN_14018fa30(param_3,&local_50,*param_4);
  if (local_50 == (longlong *)0x0) {
    if (local_48 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_48 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_48 + 8))(local_48);
        LOCK();
        piVar2 = (int *)((longlong)local_48 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_48 + 0x10))(local_48);
        }
      }
    }
    FUN_14004b970(&local_40);
    uVar4 = 0;
  }
  else {
    *(uint *)(local_50 + 0x43c) = (uint)local_res8[0];
    *(undefined1 *)(local_50 + 0x27f) = 1;
    (**(code **)(*local_50 + 0x100))(local_50,&local_70);
    FUN_14022ecd0(local_50,local_60);
    (**(code **)(*local_50 + 0xac8))(local_50,0);
    if (local_48 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_48 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_48 + 8))(local_48);
        LOCK();
        piVar2 = (int *)((longlong)local_48 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_48 + 0x10))(local_48);
        }
      }
    }
    FUN_14004b970(&local_40);
    uVar4 = 1;
  }
  return uVar4;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  longlong *local_30;
  longlong *local_28;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PacketPT_ENEMY_CATCH_COUNTER";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_18 = timeGetTime();
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar5);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  FUN_14018fa30(param_3,&local_30,*param_4);
  if (local_30 == (longlong *)0x0) {
    if (local_28 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_28 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_28 + 8))(local_28);
        LOCK();
        piVar2 = (int *)((longlong)local_28 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_28 + 0x10))(local_28);
        }
      }
    }
    FUN_14004b970(&local_20);
    uVar4 = 0;
  }
  else {
    if ((longlong *)local_30[0x44d] != (longlong *)0x0) {
      lVar3 = *local_30;
      uVar4 = (**(code **)(*(longlong *)local_30[0x44d] + 0xf8))();
      (**(code **)(lVar3 + 0x8f8))(local_30,uVar4,0,0x3f800000,1,0,0);
    }
    if (local_28 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_28 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_28 + 8))(local_28);
        LOCK();
        piVar2 = (int *)((longlong)local_28 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_28 + 0x10))(local_28);
        }
      }
    }
    FUN_14004b970(&local_20);
    uVar4 = 1;
  }
  return uVar4;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined1 local_res8 [8];
  undefined2 local_res10 [4];
  undefined2 local_b8;
  char local_b6;
  undefined2 local_b4 [2];
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0 [2];
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  float local_88;
  float local_84;
  float local_80;
  longlong local_78;
  longlong *local_70;
  char *local_68;
  DWORD local_60;
  longlong local_58;
  undefined1 local_50 [16];
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  local_68 = "PacketPT_ENEMY_STATE_SET_CATCH";
  local_58 = **(longlong **)(*(longlong *)(param_1 + 0x4c8) + 8) + 0x70;
  local_60 = timeGetTime();
  local_b8 = 0;
  local_b6 = '\0';
  iVar7 = 4;
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    memcpy(param_4,(void *)((longlong)*(int *)(param_2 + 4) + 0xc + param_2),(longlong)iVar5);
    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + iVar5;
    *(undefined4 *)(param_2 + 8) = *(undefined4 *)(param_2 + 4);
  }
  iVar5 = 2;
  iVar8 = 2;
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar8 = 0x100 - *(int *)(param_2 + 4), 0 < iVar8)) {
    iVar6 = *(int *)(param_2 + 4);
    memcpy(local_res10,(void *)((longlong)iVar6 + 0xc + param_2),(longlong)iVar8);
    iVar6 = iVar6 + iVar8;
    *(int *)(param_2 + 4) = iVar6;
    *(int *)(param_2 + 8) = iVar6;
  }
  if ((*(int *)(param_2 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    iVar8 = *(int *)(param_2 + 4);
    memcpy(local_b4,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar5);
    iVar8 = iVar8 + iVar5;
    *(int *)(param_2 + 4) = iVar8;
    *(int *)(param_2 + 8) = iVar8;
  }
  iVar5 = 1;
  if ((*(int *)(param_2 + 4) + 1 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    iVar8 = *(int *)(param_2 + 4);
    memcpy(local_res8,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar5);
    iVar8 = iVar8 + iVar5;
    *(int *)(param_2 + 4) = iVar8;
    *(int *)(param_2 + 8) = iVar8;
  }
  iVar5 = 4;
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_2 + 4), 0 < iVar5)) {
    iVar8 = *(int *)(param_2 + 4);
    memcpy(&local_a4,(void *)((longlong)iVar8 + 0xc + param_2),(longlong)iVar5);
    iVar8 = iVar8 + iVar5;
    *(int *)(param_2 + 4) = iVar8;
    *(int *)(param_2 + 8) = iVar8;
  }
  if ((*(int *)(param_2 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_2 + 4), 0 < iVar7)) {
    iVar5 = *(int *)(param_2 + 4);
    memcpy(local_a0,(void *)((longlong)iVar5 + 0xc + param_2),(longlong)iVar7);
    iVar5 = iVar5 + iVar7;
    *(int *)(param_2 + 4) = iVar5;
    *(int *)(param_2 + 8) = iVar5;
  }
  FUN_140122040(param_2,&local_b8);
  FUN_140121f60(param_2,local_50);
  local_88 = (float)(int)(char)local_b8 / 125.0;
  local_84 = (float)(int)local_b8._1_1_ / 125.0;
  local_80 = (float)(int)local_b6 / 125.0;
  FUN_14018fa30(param_3,&local_78,*param_4);
  if (local_78 == 0) {
    if (local_70 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_70 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_70 + 8))(local_70);
        LOCK();
        piVar2 = (int *)((longlong)local_70 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_70 + 0x10))(local_70);
        }
      }
    }
    FUN_14004b970(&local_68);
    uVar4 = 0;
  }
  else {
    local_b0 = 0;
    local_ac = 0;
    local_a8 = 0;
    local_98 = 0;
    local_94 = 0;
    local_90 = 0;
    FUN_14022fa00(local_78,local_res10[0],local_b4[0],local_res8[0],local_a4,local_a0[0],local_50,
                  &local_88,0,0,&local_98);
    if (local_70 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_70 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        (**(code **)(*local_70 + 8))(local_70);
        LOCK();
        piVar2 = (int *)((longlong)local_70 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_70 + 0x10))(local_70);
        }
      }
    }
    FUN_14004b970(&local_68);
    uVar4 = 1;
  }
  return uVar4;
}



undefined1
FUN_14018caa0(longlong param_1,int 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 param_14,undefined8 param_15,undefined8 param_16)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PET_STATE_ATTACK";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bd700(lVar3,param_4,param_5,param_6,param_7,param_9,param_11,param_12,
                              param_13,param_14,param_15,param_16,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018cc20(longlong param_1,int 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 param_14)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_STATE_JUMP_DOWN_ATTACK";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bd990(lVar3,param_4,param_5,param_6,param_7,param_9,param_10,param_11,
                              param_12,param_13,param_14);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018cd90(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_STATE_SET_DOWN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bdb50(lVar3,param_4,param_5,param_6,param_8,param_10,param_11,param_12,
                              param_13);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018cee0(longlong param_1,int 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 param_14,undefined8 param_15)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_STATE_SET";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bddc0(lVar3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,
                              param_11,param_12,param_13,param_14,param_15);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018d080(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_NEXT_MOVE_POINT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401be090(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018d1a0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_STATE_MENACE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401be120(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8
FUN_14018d2c0(longlong param_1,int param_2,undefined8 param_3,undefined4 *param_4,
             undefined2 *param_5)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_FOLLOW_OWNER";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -0x300,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if ((*(longlong *)(lVar2 + 0xb58) != 0) &&
         (lVar2 = FUN_14018fd10(*(undefined8 *)(*(longlong *)(lVar2 + 0xb58) + 0x48),*param_4),
         lVar2 != 0)) {
        FUN_14022f670(lVar2,*param_5);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1
FUN_14018d3b0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PET_JUMP_FOLLOW_OWNER";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401be1e0(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018d4c0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PET_PICKUP_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401be270(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018d5d0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PET_JUMP_PICKUP_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401be300(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018d6e0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_DAMAGE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401be390(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018d7e0(longlong param_1,int 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 param_14,undefined8 param_15,undefined8 param_16,undefined8 param_17,
             undefined8 param_18,undefined8 param_19,undefined8 param_20,undefined8 param_21,
             undefined8 param_22,undefined8 param_23,undefined8 param_24)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PET_CREATE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401be440(lVar3,param_2,param_5,param_6,param_7,param_8,param_9,param_10,
                              param_11,param_12,param_13,param_14,param_15,param_16,param_17,
                              param_18,param_19,param_20,param_21,param_22,param_23,param_24,uVar4,
                              lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018da00(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_SUMMON";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bea30(lVar3,param_2,param_4,param_5,param_6);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018db20(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PET_CLOSE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bef60(lVar3,param_2,param_4,param_5,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018dc30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_RECOVERY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bf170(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018dd30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PET_ADD_EXP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bf2e0(lVar3,param_5,param_6,param_4,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_14018de30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_REVIVAL_PET_INVENTORY_ITEM_LIST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bf400(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018df30(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PET_INVENTORY_ITEM_LIST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bf710(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_14018e030(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PET_LIST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bf910(lVar3);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018e120(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PET_REBIRTH";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401bfa40(lVar3,param_4,param_5,param_6,param_7);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018e240(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_MOVE_PET_INVENTORY_TO_INVENTORY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c0030(lVar3,param_4,param_5,param_6,param_7,param_8,param_10);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018e370(longlong param_1,int 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)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_MOVE_INVENTORY_TO_PET_INVENTORY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c01d0(lVar3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,uVar4,
                              lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018e4b0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_MOVE_PET_INVEN_TO_PET_INVENTORY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c0380(lVar3,param_4,param_5,param_6,param_8);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018e5d0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REMOVE_PET_INVENTORY_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c0510(lVar3,param_4,param_5,param_6,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018e6e0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REMOVE_PET_INVENTORY_ITEM_ALL";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c05a0(lVar3,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_14018e7d0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PET_ADD";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c06c0(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018e8d0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5,
             undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_PET_EAT_ITEM";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c0900(lVar3,param_4,param_5,param_6,param_7,param_8,param_9);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1 FUN_14018ea00(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PET_GRADE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c1430(lVar3,param_2,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018eb00(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_REQ_PET_HARVEST";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c18c0(lVar3,param_2,param_4,param_5,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018ec10(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  uVar4 = 0xfffffffffffffffe;
  local_20 = "PT_PET_DELETE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      lVar5 = lVar1;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c1c00(lVar3,param_2,param_4,param_5,uVar4,lVar5,1);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined1
FUN_14018ed20(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_PET_GHOST_REBIRTH";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1c8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -0x300,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401c5840(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_14018ee20(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_ACK_KEY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -800,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar2 = *(longlong **)(lVar3 + 0xb58);
      if (plVar2 != (longlong *)0x0) {
        (**(code **)(*plVar2 + 0x170))(plVar2,param_4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8 FUN_14018ef00(longlong param_1,int param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined *puVar4;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_EVENT_HIT_BOX_CHECK";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -800,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      plVar2 = *(longlong **)(lVar3 + 0xb58);
      if (plVar2 != (longlong *)0x0) {
        puVar4 = (undefined *)*param_4;
        if ((undefined *)*param_4 == (undefined *)0x0) {
          puVar4 = PTR_DAT_1405d8008;
        }
        (**(code **)(*plVar2 + 0x68))(plVar2,puVar4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined1 FUN_14018efe0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_EVENT_SCENE_STOP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -800,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d5e40(lVar3,param_4);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_14018f0e0(longlong param_1,int param_2)

{
  longlong lVar1;
  char *pcVar2;
  longlong lVar3;
  char *local_30;
  DWORD local_28;
  longlong local_20;
  
  local_30 = "PT_REQ_EVENT_SCENE_CONTINUE";
  local_20 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_28 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -800,param_2), lVar3 != 0)) {
    FUN_14034ed40(lVar3 + 0x680);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar3 + 0x680);
    }
    else {
      if ((*(longlong *)(lVar3 + 0xb58) != 0) &&
         (lVar1 = *(longlong *)(*(longlong *)(lVar3 + 0xb58) + 0x30), lVar1 != 0)) {
        pcVar2 = *(char **)(lVar1 + 0x2f8);
        if (*pcVar2 != '\0') {
          *(double *)(pcVar2 + 0x30) = *(double *)(pcVar2 + 0x38) + 20.0;
        }
        pcVar2 = *(char **)(lVar1 + 0x300);
        if (*pcVar2 != '\0') {
          *(double *)(pcVar2 + 8) = *(double *)(pcVar2 + 0x10) + 20.0;
        }
      }
      FUN_14034edd0(lVar3 + 0x680);
    }
  }
  FUN_14004b970(&local_30);
  return 1;
}



undefined1
FUN_14018f1f0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_EVENT_SCENE_PLAY_NEXT";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if (param_2 == 0) {
    FUN_14004b970(&local_20);
    uVar2 = 1;
  }
  else {
    lVar3 = FUN_14016e240(param_1 + -800,param_2);
    if (lVar3 == 0) {
      FUN_14004b970(&local_20);
      uVar2 = 1;
    }
    else {
      lVar1 = lVar3 + 0x680;
      FUN_14034ed40(lVar1);
      if (*(char *)(lVar3 + 0x6b8) == '\0') {
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
        uVar2 = 1;
      }
      else {
        uVar2 = FUN_1401d5ff0(lVar3,param_4,param_5);
        FUN_14034edd0(lVar1);
        FUN_14004b970(&local_20);
      }
    }
  }
  return uVar2;
}



undefined8 FUN_14018f2f0(longlong param_1,int param_2,undefined8 param_3,undefined1 *param_4)

{
  longlong lVar1;
  char *local_30;
  DWORD local_28;
  longlong local_20;
  
  local_30 = "PT_EVENT_SCENE_SET_IGNORE";
  local_20 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_28 = timeGetTime();
  if ((param_2 != 0) && (lVar1 = FUN_14016e240(param_1 + -800,param_2), lVar1 != 0)) {
    FUN_14034ed40(lVar1 + 0x680);
    if (*(char *)(lVar1 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1 + 0x680);
    }
    else {
      *(undefined1 *)(lVar1 + 0x670) = *param_4;
      FUN_14034edd0(lVar1 + 0x680);
    }
  }
  FUN_14004b970(&local_30);
  return 1;
}



undefined8 FUN_14018f3c0(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_FORCE_KILL_ENEMY";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -800,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (*(longlong *)(lVar2 + 0xb58) != 0) {
        FUN_140194b60(*(undefined8 *)(*(longlong *)(lVar2 + 0xb58) + 0x48));
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



undefined8
FUN_14018f490(longlong param_1,int param_2,undefined8 param_3,int *param_4,undefined1 *param_5)

{
  longlong lVar1;
  longlong lVar2;
  char *pcVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_UI_DIALOG";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 == 0) || (lVar2 = FUN_14016e240(param_1 + -800,param_2), lVar2 == 0))
  goto LAB_14018f582;
  lVar1 = lVar2 + 0x680;
  FUN_14034ed40(lVar1);
  if (*(char *)(lVar2 + 0x6b8) == '\0') {
    FUN_14034edd0(lVar1);
    goto LAB_14018f582;
  }
  lVar2 = *(longlong *)(lVar2 + 0xb58);
  if (lVar2 != 0) {
    if (*param_4 == 1) {
      lVar2 = *(longlong *)(lVar2 + 0x38);
      if (lVar2 != 0) {
        pcVar3 = "player_dialog";
        goto LAB_14018f567;
      }
    }
    else if ((*param_4 == 2) && (lVar2 = *(longlong *)(lVar2 + 0x38), lVar2 != 0)) {
      pcVar3 = "npc_dialog";
LAB_14018f567:
      FUN_1402727d0(lVar2,pcVar3,*param_5);
    }
  }
  FUN_14034edd0(lVar1);
LAB_14018f582:
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_SWF_OPEN";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -800,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (*(longlong *)(lVar2 + 0xb58) != 0) {
        FUN_140272aa0(*(undefined8 *)(*(longlong *)(lVar2 + 0xb58) + 0x40),*param_4,1);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_SWF_CLOSE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -800,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if ((*(longlong *)(lVar2 + 0xb58) != 0) &&
         (lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0xb58) + 0x40), lVar2 != 0)) {
        FUN_140272aa0(lVar2,*param_4,0);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_30;
  DWORD local_28;
  longlong local_20;
  
  local_30 = "PT_SET_SINGLE_QUESTION_BOX_RESULT";
  local_20 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_28 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -800,param_2), lVar2 != 0)) {
    FUN_14034ed40(lVar2 + 0x680);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar2 + 0x680);
    }
    else {
      if ((*(longlong *)(lVar2 + 0xb58) != 0) &&
         (lVar1 = *(longlong *)(*(longlong *)(lVar2 + 0xb58) + 0x38), lVar1 != 0)) {
        *(undefined4 *)(lVar1 + 0x4c) = *param_4;
      }
      FUN_14034edd0(lVar2 + 0x680);
    }
  }
  FUN_14004b970(&local_30);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_QUESTION_BOX_RESPONSE";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar3 = FUN_14016e240(param_1 + -800,param_2), lVar3 != 0)) {
    lVar1 = lVar3 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar3 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      lVar2 = *(longlong *)(lVar3 + 0xb58);
      if (lVar2 != 0) {
        if (*(longlong *)(lVar2 + 0x38) != 0) {
          FUN_140272910(*(longlong *)(lVar2 + 0x38),*param_4);
        }
        if ((*(char *)(lVar3 + 0x114) != '\0') && (*(longlong *)(lVar2 + 0x38) != 0)) {
          FUN_1402729e0(*(longlong *)(lVar2 + 0x38),*param_4);
        }
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong lVar1;
  longlong lVar2;
  char *local_20;
  DWORD local_18;
  longlong local_10;
  
  local_20 = "PT_REQ_ADD_ENEMY_PP";
  local_10 = **(longlong **)(*(longlong *)(param_1 + 0x1a8) + 8) + 0x70;
  local_18 = timeGetTime();
  if ((param_2 != 0) && (lVar2 = FUN_14016e240(param_1 + -800,param_2), lVar2 != 0)) {
    lVar1 = lVar2 + 0x680;
    FUN_14034ed40(lVar1);
    if (*(char *)(lVar2 + 0x6b8) == '\0') {
      FUN_14034edd0(lVar1);
    }
    else {
      if (*(longlong *)(lVar2 + 0xb58) != 0) {
        FUN_140272d90(*(undefined8 *)(*(longlong *)(lVar2 + 0xb58) + 0x48),*param_4);
      }
      FUN_14034edd0(lVar1);
    }
  }
  FUN_14004b970(&local_20);
  return 1;
}



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

{
  longlong *plVar1;
  longlong lVar2;
  bool bVar3;
  int iVar4;
  uint *puVar5;
  bool bVar6;
  bool bVar7;
  longlong local_50;
  
  local_50 = 0;
  bVar7 = false;
  bVar3 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      if (*plVar1 != 0) {
        local_50 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x200)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, local_50 = 0,
           DAT_1406080a8 = iVar4, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(local_50);
        bVar7 = true;
        bVar3 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x50) != 0) {
    for (puVar5 = *(uint **)(*(longlong *)(param_1 + 0x50) +
                            ((ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x60)) * 8);
        puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 6)) {
      if ((puVar5[8] == param_3) && (*puVar5 == param_3)) {
        if (puVar5 != (uint *)0x0) {
          if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          *param_2 = *(undefined8 *)(puVar5 + 2);
          lVar2 = *(longlong *)(puVar5 + 4);
          param_2[1] = lVar2;
          if (lVar2 != 0) {
            LOCK();
            *(int *)(lVar2 + 8) = *(int *)(lVar2 + 8) + 1;
            UNLOCK();
            bVar7 = bVar3;
          }
          if (!bVar7) {
            return param_2;
          }
          FUN_14034edd0(local_50);
          return param_2;
        }
        break;
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  if (bVar7) {
    FUN_14034edd0(local_50);
  }
  return param_2;
}



undefined8 FUN_14018fbc0(longlong param_1,uint param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  int iVar3;
  uint *puVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  
  lVar5 = 0;
  lVar6 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  lVar7 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar7 = lVar6;
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      if (*plVar1 != 0) {
        lVar7 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x200)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar7 = lVar5,
           DAT_1406080a8 = iVar3, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar7);
        bVar9 = true;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0xe0) != 0) {
    for (puVar4 = *(uint **)(*(longlong *)(param_1 + 0xe0) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xf0)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 4)) {
      if ((puVar4[6] == param_2) && (*puVar4 == param_2)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar2 = *(undefined8 *)(puVar4 + 2);
          if (!bVar9) {
            return uVar2;
          }
          FUN_14034edd0(lVar7);
          return uVar2;
        }
        break;
      }
    }
  }
  if (bVar9) {
    FUN_14034edd0(lVar7);
  }
  return 0;
}



undefined8 FUN_14018fd10(longlong param_1,uint param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  int iVar3;
  uint *puVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  
  lVar5 = 0;
  lVar6 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  lVar7 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar7 = lVar6;
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      if (*plVar1 != 0) {
        lVar7 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x200)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar7 = lVar5,
           DAT_1406080a8 = iVar3, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar7);
        bVar9 = true;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar4 = *(uint **)(*(longlong *)(param_1 + 8) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x18)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 6)) {
      if ((puVar4[8] == param_2) && (*puVar4 == param_2)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar2 = *(undefined8 *)(puVar4 + 2);
          if (!bVar9) {
            return uVar2;
          }
          FUN_14034edd0(lVar7);
          return uVar2;
        }
        break;
      }
    }
  }
  if (bVar9) {
    FUN_14034edd0(lVar7);
  }
  return 0;
}



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

void FUN_14018fe60(longlong param_1,ulonglong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  longlong local_res8;
  
  lVar9 = 0;
  bVar11 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      lVar8 = *plVar1;
      lVar9 = 0;
      if (lVar8 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x200)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar8 = 0;
        }
        FUN_14034ed40(lVar8);
        bVar11 = true;
        lVar9 = lVar8;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x58) != 0) {
    uVar5 = 0;
    if (*(uint *)(param_1 + 0x60) != 0) {
      plVar1 = *(longlong **)(param_1 + 0x50);
      plVar7 = plVar1;
      do {
        if (*plVar7 != 0) {
          lVar8 = plVar1[uVar5];
          goto LAB_14018ff70;
        }
        uVar4 = (int)uVar5 + 1;
        uVar5 = (ulonglong)uVar4;
        plVar7 = plVar7 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0x60));
    }
  }
  lVar8 = 0;
LAB_14018ff70:
  do {
    do {
      lVar6 = lVar8;
      if (lVar6 == 0) {
        if (bVar11) {
          FUN_14034edd0(lVar9);
        }
        return;
      }
      lVar8 = *(longlong *)(lVar6 + 8);
      if (*(char *)(lVar8 + 0x1868) == '\0') {
        plVar1 = (longlong *)param_2[1];
        local_res8 = lVar8;
        if ((&local_res8 < plVar1) && (plVar7 = (longlong *)*param_2, plVar7 <= &local_res8)) {
          if (plVar1 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_res8 - (longlong)plVar7 >> 3) * 8);
          }
        }
        else {
          if (plVar1 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((longlong *)param_2[1] != (longlong *)0x0) {
            *(longlong *)param_2[1] = lVar8;
          }
        }
        param_2[1] = param_2[1] + 8;
      }
      lVar8 = *(longlong *)(lVar6 + 0x18);
    } while (lVar8 != 0);
    uVar4 = *(uint *)(lVar6 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
    lVar6 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(param_1 + 0x60) <= uVar4) break;
      lVar2 = *(longlong *)(param_1 + 0x50);
      if (*(longlong *)(lVar6 + lVar2) != 0) {
        lVar8 = *(longlong *)(lVar6 + lVar2);
      }
      uVar4 = uVar4 + 1;
      lVar6 = lVar6 + 8;
    } while (lVar8 == 0);
  } while( true );
}



void FUN_140190080(longlong param_1,ulonglong *param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  int iVar5;
  uint uVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong *plVar9;
  bool bVar10;
  bool bVar11;
  longlong local_res8;
  longlong *local_58;
  longlong local_48;
  longlong *local_38;
  
  local_48 = 0;
  bVar11 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      lVar8 = *plVar1;
      if (lVar8 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x200)) {
          iVar5 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar5;
          if (bVar11) {
            FUN_140176d60();
          }
          lVar8 = 0;
        }
        FUN_14034ed40();
        bVar11 = true;
        local_48 = lVar8;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = (longlong *)(param_1 + 0xe0);
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    uVar7 = 0;
    if (*(uint *)(param_1 + 0xf0) != 0) {
      plVar9 = (longlong *)*plVar1;
      do {
        if (*plVar9 != 0) {
          local_38 = (longlong *)((longlong *)*plVar1)[uVar7];
          plVar9 = local_38;
          goto LAB_140190180;
        }
        uVar6 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar6;
        plVar9 = plVar9 + 1;
      } while (uVar6 < *(uint *)(param_1 + 0xf0));
    }
  }
  local_38 = (longlong *)0x0;
  plVar9 = local_38;
LAB_140190180:
  do {
    local_58 = plVar9;
    plVar9 = local_38;
    if (local_58 == (longlong *)0x0) {
      if (bVar11) {
        FUN_14034edd0(local_48);
      }
      return;
    }
    if (local_58 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    FUN_140198570(local_58[1]);
    if (local_38 == (longlong *)0x0) {
LAB_1401901e0:
      lVar8 = 0;
    }
    else {
      if (local_38 != plVar1) {
        iVar5 = DAT_14060804c + 1;
        bVar10 = DAT_14060804c == 0;
        DAT_14060804c = iVar5;
        if (bVar10) {
          FUN_140176d60(1);
        }
        goto LAB_1401901e0;
      }
      lVar8 = *local_38;
    }
    plVar2 = (longlong *)param_2[1];
    local_res8 = lVar8;
    if ((&local_res8 < plVar2) && (plVar3 = (longlong *)*param_2, plVar3 <= &local_res8)) {
      if (plVar2 == (longlong *)param_2[2]) {
        FUN_140195b20(param_2);
      }
      if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
        *(undefined8 *)param_2[1] =
             *(undefined8 *)(*param_2 + ((longlong)&local_res8 - (longlong)plVar3 >> 3) * 8);
      }
    }
    else {
      if (plVar2 == (longlong *)param_2[2]) {
        FUN_140195b20(param_2);
      }
      if ((longlong *)param_2[1] != (longlong *)0x0) {
        *(longlong *)param_2[1] = lVar8;
      }
    }
    param_2[1] = param_2[1] + 8;
    if (local_38 != (longlong *)0x0) {
      if (local_38 == plVar1) {
        if (local_38 != (longlong *)0x0) {
          LOCK();
          plVar2 = local_38 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            local_38 = (longlong *)0x0;
            puVar4 = (undefined8 *)*plVar9;
            if (puVar4 != (undefined8 *)0x0) {
              (**(code **)*puVar4)();
            }
            operator_delete(plVar9);
          }
        }
      }
      else {
        iVar5 = DAT_140608054 + 1;
        bVar10 = DAT_140608054 == 0;
        DAT_140608054 = iVar5;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
    plVar9 = local_58;
    if ((local_58 != (longlong *)0x0) &&
       (plVar9 = (longlong *)local_58[2], plVar9 == (longlong *)0x0)) {
      uVar6 = *(uint *)(local_58 + 3) % *(uint *)(param_1 + 0xf0) + 1;
      lVar8 = (longlong)(int)uVar6 << 3;
      do {
        if (*(uint *)(param_1 + 0xf0) <= uVar6) break;
        if (*(longlong *)(lVar8 + *plVar1) != 0) {
          plVar9 = *(longlong **)(lVar8 + *plVar1);
        }
        uVar6 = uVar6 + 1;
        lVar8 = lVar8 + 8;
      } while (plVar9 == (longlong *)0x0);
    }
  } while( true );
}



void FUN_140190340(longlong param_1,ulonglong *param_2,int param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  int iVar5;
  uint uVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong *plVar9;
  bool bVar10;
  bool bVar11;
  longlong local_res8;
  longlong *local_68;
  longlong local_58;
  longlong *local_48;
  
  local_58 = 0;
  bVar11 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      lVar8 = *plVar1;
      if (lVar8 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x200)) {
          iVar5 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar5;
          if (bVar11) {
            FUN_140176d60();
          }
          lVar8 = 0;
        }
        FUN_14034ed40();
        bVar11 = true;
        local_58 = lVar8;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = (longlong *)(param_1 + 0xe0);
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    uVar7 = 0;
    if (*(uint *)(param_1 + 0xf0) != 0) {
      plVar9 = (longlong *)*plVar1;
      do {
        if (*plVar9 != 0) {
          local_48 = (longlong *)((longlong *)*plVar1)[uVar7];
          plVar9 = local_48;
          goto LAB_140190443;
        }
        uVar6 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar6;
        plVar9 = plVar9 + 1;
      } while (uVar6 < *(uint *)(param_1 + 0xf0));
    }
  }
  local_48 = (longlong *)0x0;
  plVar9 = local_48;
LAB_140190443:
  do {
    local_68 = plVar9;
    plVar9 = local_48;
    if (local_68 == (longlong *)0x0) {
      if (bVar11) {
        FUN_14034edd0(local_58);
      }
      return;
    }
    if (local_68 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    FUN_140198570(local_68[1]);
    if (local_48 == (longlong *)0x0) {
LAB_1401904a9:
      lVar8 = 0;
    }
    else {
      if (local_48 != plVar1) {
        iVar5 = DAT_14060804c + 1;
        bVar10 = DAT_14060804c == 0;
        DAT_14060804c = iVar5;
        if (bVar10) {
          FUN_140176d60(1);
        }
        goto LAB_1401904a9;
      }
      lVar8 = *local_48;
    }
    if (*(int *)(lVar8 + 0x1a60) == param_3) {
      if (local_48 == (longlong *)0x0) {
LAB_1401904dd:
        lVar8 = 0;
      }
      else {
        if (local_48 != plVar1) {
          iVar5 = DAT_14060804c + 1;
          bVar10 = DAT_14060804c == 0;
          DAT_14060804c = iVar5;
          if (bVar10) {
            FUN_140176d60(1);
          }
          goto LAB_1401904dd;
        }
        lVar8 = *local_48;
      }
      plVar2 = (longlong *)param_2[1];
      local_res8 = lVar8;
      if ((&local_res8 < plVar2) && (plVar3 = (longlong *)*param_2, plVar3 <= &local_res8)) {
        if (plVar2 == (longlong *)param_2[2]) {
          FUN_140195b20(param_2);
        }
        if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
          *(undefined8 *)param_2[1] =
               *(undefined8 *)(*param_2 + ((longlong)&local_res8 - (longlong)plVar3 >> 3) * 8);
        }
      }
      else {
        if (plVar2 == (longlong *)param_2[2]) {
          FUN_140195b20(param_2);
        }
        if ((longlong *)param_2[1] != (longlong *)0x0) {
          *(longlong *)param_2[1] = lVar8;
        }
      }
      param_2[1] = param_2[1] + 8;
    }
    if (local_48 != (longlong *)0x0) {
      if (local_48 == plVar1) {
        if (local_48 != (longlong *)0x0) {
          LOCK();
          plVar2 = local_48 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            local_48 = (longlong *)0x0;
            puVar4 = (undefined8 *)*plVar9;
            if (puVar4 != (undefined8 *)0x0) {
              (**(code **)*puVar4)();
            }
            operator_delete(plVar9);
          }
        }
      }
      else {
        iVar5 = DAT_140608054 + 1;
        bVar10 = DAT_140608054 == 0;
        DAT_140608054 = iVar5;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
    plVar9 = local_68;
    if ((local_68 != (longlong *)0x0) &&
       (plVar9 = (longlong *)local_68[2], plVar9 == (longlong *)0x0)) {
      uVar6 = *(uint *)(local_68 + 3) % *(uint *)(param_1 + 0xf0) + 1;
      lVar8 = (longlong)(int)uVar6 << 3;
      do {
        if (*(uint *)(param_1 + 0xf0) <= uVar6) break;
        if (*(longlong *)(lVar8 + *plVar1) != 0) {
          plVar9 = *(longlong **)(lVar8 + *plVar1);
        }
        uVar6 = uVar6 + 1;
        lVar8 = lVar8 + 8;
      } while (plVar9 == (longlong *)0x0);
    }
  } while( true );
}



void FUN_140190630(longlong param_1,longlong *param_2,int param_3)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *_Src;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0x1f8);
  lVar5 = lVar3;
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x200)) {
      lVar4 = *plVar2;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0x200)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = (longlong *)*param_2;
  if (plVar2 != (longlong *)param_2[1]) {
    _Src = plVar2 + 1;
    do {
      if (*(int *)(*plVar2 + 0x1a60) == param_3) {
        plVar2 = plVar2 + 1;
        _Src = _Src + 1;
      }
      else {
        memmove(plVar2,_Src,param_2[1] - (longlong)_Src & 0xfffffffffffffff8);
        param_2[1] = param_2[1] + -8;
      }
    } while (plVar2 != (longlong *)param_2[1]);
  }
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



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

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0x1f8);
  lVar5 = lVar3;
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x200)) {
      lVar4 = *plVar2;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0x200)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = (longlong *)*param_2;
  do {
    if (plVar2 == (longlong *)param_2[1]) {
LAB_140190816:
      if (bVar7) {
        FUN_14034edd0(lVar5);
      }
      return;
    }
    if (*plVar2 == param_3) {
      memmove(plVar2,plVar2 + 1,(longlong)param_2[1] - (longlong)(plVar2 + 1) & 0xfffffffffffffff8);
      param_2[1] = param_2[1] + -8;
      goto LAB_140190816;
    }
    plVar2 = plVar2 + 1;
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x000140191644)
// WARNING: Removing unreachable block (ram,0x000140190e19)
// WARNING: Removing unreachable block (ram,0x000140190b17)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140190840(longlong param_1,ulonglong *param_2,longlong param_3,float param_4,uint param_5)

{
  int *piVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  void *_Dst;
  undefined8 uVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong lVar10;
  longlong *plVar11;
  int iVar12;
  uint uVar13;
  DWORD DVar14;
  ulonglong uVar15;
  longlong lVar16;
  longlong lVar17;
  ulonglong uVar18;
  HANDLE hObject;
  HANDLE pvVar19;
  float *pfVar20;
  longlong *plVar21;
  longlong *plVar22;
  longlong *plVar23;
  bool bVar24;
  bool bVar25;
  float fVar26;
  float fVar27;
  float fVar28;
  float fVar29;
  longlong local_res10;
  undefined8 local_res18;
  longlong *local_1f8;
  undefined4 uStack_1ec;
  longlong *local_1e8;
  longlong *local_1e0;
  longlong local_1d8;
  longlong local_1c8;
  longlong local_1b8;
  longlong local_198;
  longlong local_188;
  ulonglong local_178;
  longlong local_138;
  undefined8 local_130;
  longlong local_128;
  longlong local_120;
  longlong local_118;
  longlong local_110;
  longlong local_108;
  undefined8 uStack_100;
  longlong local_f8;
  longlong *local_f0;
  longlong local_e8;
  longlong *local_e0;
  longlong *local_d8;
  longlong *local_d0;
  longlong local_c8;
  undefined8 uStack_c0;
  longlong local_b8;
  longlong local_a8;
  undefined8 uStack_a0;
  undefined8 local_98;
  
  local_98 = 0xfffffffffffffffe;
  local_1d8 = 0;
  bVar25 = false;
  plVar22 = *(longlong **)(param_1 + 0x1f8);
  if (plVar22 != (longlong *)0x0) {
    if (plVar22 == *(longlong **)(param_1 + 0x200)) {
      lVar17 = *plVar22;
      if (lVar17 != 0) {
        if (plVar22 != *(longlong **)(param_1 + 0x200)) {
          iVar12 = DAT_1406080a8 + 1;
          bVar25 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar12;
          if (bVar25) {
            FUN_140176d60();
          }
          lVar17 = 0;
        }
        FUN_14034ed40();
        bVar25 = true;
        local_1d8 = lVar17;
      }
    }
    else {
      iVar12 = DAT_1406080a8 + 1;
      bVar24 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar12;
      if (bVar24) {
        FUN_140176d60(1);
      }
    }
  }
  if ((DAT_140609420 & 1) == 0) {
    DAT_140609420 = DAT_140609420 | 1;
    DAT_140609410 = 0;
    DAT_140609414 = 0;
    DAT_140609418 = 0;
    _DAT_14060941c = 0;
  }
  if (*(longlong *)(param_3 + 0x13d8) == 0) {
    pfVar20 = (float *)&DAT_140609410;
  }
  else {
    pfVar20 = (float *)(*(longlong *)(param_3 + 0x13d8) + 0x144);
  }
  fVar2 = *pfVar20;
  fVar3 = pfVar20[1];
  local_1f8 = *(longlong **)pfVar20;
  fVar4 = pfVar20[2];
  _Dst = (void *)*param_2;
  if (_Dst != (void *)param_2[1]) {
    memmove(_Dst,(void *)param_2[1],0);
    param_2[1] = (ulonglong)_Dst;
  }
  if ((param_5 & 4) != 0) {
    if (0.0 <= param_4) {
      if (*(longlong *)(param_1 + 0x58) != 0) {
        uVar15 = 0;
        if (*(uint *)(param_1 + 0x60) != 0) {
          plVar22 = *(longlong **)(param_1 + 0x50);
          plVar23 = plVar22;
          do {
            if (*plVar23 != 0) {
              lVar17 = plVar22[uVar15];
              goto LAB_140190b70;
            }
            uVar13 = (int)uVar15 + 1;
            uVar15 = (ulonglong)uVar13;
            plVar23 = plVar23 + 1;
          } while (uVar13 < *(uint *)(param_1 + 0x60));
        }
      }
      lVar17 = 0;
LAB_140190b70:
      local_188 = lVar17;
      if (local_188 != 0) {
        if (local_188 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        lVar17 = *(longlong *)(local_188 + 8);
        if (param_3 != lVar17) {
          lVar16 = *(longlong *)(lVar17 + 0x13d8);
          plVar22 = *(longlong **)(lVar17 + 0x13e0);
          if (plVar22 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar22 + 1) = (int)plVar22[1] + 1;
            UNLOCK();
          }
          if ((lVar16 != 0) &&
             (fVar29 = param_4 + *(float *)(lVar16 + 0x150),
             fVar28 = *(float *)(lVar16 + 0x14c) - fVar4,
             fVar26 = *(float *)(lVar16 + 0x148) - fVar3,
             fVar27 = *(float *)(lVar16 + 0x144) - fVar2,
             fVar27 * fVar27 + fVar26 * fVar26 + fVar28 * fVar28 <= fVar29 * fVar29)) {
            local_b8 = lVar17;
            FUN_1401959b0(param_2);
          }
          if (plVar22 != (longlong *)0x0) {
            LOCK();
            plVar23 = plVar22 + 1;
            *(int *)plVar23 = (int)*plVar23 + -1;
            UNLOCK();
            if ((int)*plVar23 == 0) {
              (**(code **)(*plVar22 + 8))(plVar22);
              LOCK();
              piVar1 = (int *)((longlong)plVar22 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar22 + 0x10))();
              }
            }
          }
        }
        lVar17 = local_188;
        if ((local_188 != 0) && (lVar17 = *(longlong *)(local_188 + 0x18), lVar17 == 0)) {
          uVar13 = *(uint *)(local_188 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
          lVar16 = (longlong)(int)uVar13 * 8;
          do {
            if (*(uint *)(param_1 + 0x60) <= uVar13) break;
            lVar10 = *(longlong *)(param_1 + 0x50);
            if (*(longlong *)(lVar16 + lVar10) != 0) {
              lVar17 = *(longlong *)(lVar16 + lVar10);
            }
            uVar13 = uVar13 + 1;
            lVar16 = lVar16 + 8;
          } while (lVar17 == 0);
        }
        goto LAB_140190b70;
      }
    }
    else {
      plVar22 = (longlong *)(param_1 + 0x50);
      uStack_c0 = plVar22;
      if (*(longlong *)(param_1 + 0x58) != 0) {
        uVar15 = 0;
        if (*(uint *)(param_1 + 0x60) != 0) {
          plVar23 = (longlong *)*plVar22;
          do {
            if (*plVar23 != 0) {
              local_c8 = ((longlong *)*plVar22)[uVar15];
              lVar17 = local_c8;
              goto LAB_140190a33;
            }
            uVar13 = (int)uVar15 + 1;
            uVar15 = (ulonglong)uVar13;
            plVar23 = plVar23 + 1;
          } while (uVar13 < *(uint *)(param_1 + 0x60));
        }
      }
      local_c8 = 0;
      lVar17 = local_c8;
LAB_140190a33:
      lVar16 = lVar17;
      if (lVar16 != 0) {
        lVar17 = *(longlong *)(lVar16 + 8);
        if (param_3 != lVar17) {
          plVar23 = (longlong *)param_2[1];
          local_res10 = lVar17;
          if ((&local_res10 < plVar23) && (plVar21 = (longlong *)*param_2, plVar21 <= &local_res10))
          {
            if (plVar23 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_res10 - (longlong)plVar21 >> 3) * 8)
              ;
            }
          }
          else {
            if (plVar23 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar17;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        lVar17 = *(longlong *)(lVar16 + 0x18);
        if (lVar17 == 0) {
          uVar13 = *(uint *)(lVar16 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
          lVar16 = (longlong)(int)uVar13 << 3;
          do {
            if (*(uint *)(param_1 + 0x60) <= uVar13) break;
            if (*(longlong *)(*plVar22 + lVar16) != 0) {
              lVar17 = *(longlong *)(*plVar22 + lVar16);
            }
            uVar13 = uVar13 + 1;
            lVar16 = lVar16 + 8;
          } while (lVar17 == 0);
        }
        goto LAB_140190a33;
      }
      local_c8 = 0;
    }
  }
  if ((param_5 & 8) != 0) {
    plVar22 = (longlong *)(param_1 + 0x128);
    if (0.0 <= param_4) {
      if (*(longlong *)(param_1 + 0x130) != 0) {
        uVar15 = 0;
        if (*(uint *)(param_1 + 0x138) != 0) {
          plVar23 = (longlong *)*plVar22;
          do {
            if (*plVar23 != 0) {
              lVar17 = ((longlong *)*plVar22)[uVar15];
              goto LAB_140190e72;
            }
            uVar13 = (int)uVar15 + 1;
            uVar15 = (ulonglong)uVar13;
            plVar23 = plVar23 + 1;
          } while (uVar13 < *(uint *)(param_1 + 0x138));
        }
      }
      lVar17 = 0;
LAB_140190e72:
      local_1b8 = lVar17;
      if (local_1b8 != 0) {
        if (local_1b8 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        lVar17 = *(longlong *)(local_1b8 + 8);
        local_f8 = *(longlong *)(lVar17 + 0x13d8);
        plVar23 = *(longlong **)(lVar17 + 0x13e0);
        if (plVar23 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar23 + 1) = (int)plVar23[1] + 1;
          UNLOCK();
        }
        local_f0 = plVar23;
        if ((local_f8 != 0) &&
           (fVar29 = param_4 + *(float *)(local_f8 + 0x150),
           fVar28 = *(float *)(local_f8 + 0x14c) - fVar4,
           fVar26 = *(float *)(local_f8 + 0x148) - fVar3,
           fVar27 = *(float *)(local_f8 + 0x144) - fVar2,
           fVar27 * fVar27 + fVar26 * fVar26 + fVar28 * fVar28 <= fVar29 * fVar29)) {
          plVar21 = (longlong *)param_2[1];
          local_120 = lVar17;
          if ((&local_120 < plVar21) && (plVar11 = (longlong *)*param_2, plVar11 <= &local_120)) {
            if (plVar21 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_120 - (longlong)plVar11 >> 3) * 8);
            }
          }
          else {
            if (plVar21 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar17;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        plVar21 = local_f0;
        if (plVar23 != (longlong *)0x0) {
          LOCK();
          plVar23 = plVar23 + 1;
          *(int *)plVar23 = (int)*plVar23 + -1;
          UNLOCK();
          if ((int)*plVar23 == 0) {
            (**(code **)(*local_f0 + 8))(local_f0);
            LOCK();
            piVar1 = (int *)((longlong)plVar21 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*local_f0 + 0x10))();
            }
          }
        }
        lVar17 = local_1b8;
        if ((local_1b8 != 0) && (lVar17 = *(longlong *)(local_1b8 + 0x18), lVar17 == 0)) {
          uVar13 = *(uint *)(local_1b8 + 0x20) % *(uint *)(param_1 + 0x138) + 1;
          lVar16 = (longlong)(int)uVar13 * 8;
          do {
            if (*(uint *)(param_1 + 0x138) <= uVar13) break;
            if (*(longlong *)(*plVar22 + lVar16) != 0) {
              lVar17 = *(longlong *)(*plVar22 + lVar16);
            }
            uVar13 = uVar13 + 1;
            lVar16 = lVar16 + 8;
          } while (lVar17 == 0);
        }
        goto LAB_140190e72;
      }
    }
    else {
      uStack_a0 = plVar22;
      if (*(longlong *)(param_1 + 0x130) != 0) {
        uVar15 = 0;
        if (*(uint *)(param_1 + 0x138) != 0) {
          plVar23 = (longlong *)*plVar22;
          do {
            if (*plVar23 != 0) {
              local_a8 = ((longlong *)*plVar22)[uVar15];
              lVar17 = local_a8;
              goto LAB_140190d40;
            }
            uVar13 = (int)uVar15 + 1;
            uVar15 = (ulonglong)uVar13;
            plVar23 = plVar23 + 1;
          } while (uVar13 < *(uint *)(param_1 + 0x138));
        }
      }
      local_a8 = 0;
      lVar17 = local_a8;
LAB_140190d40:
      lVar16 = lVar17;
      if (lVar16 != 0) {
        uVar5 = *(undefined8 *)(lVar16 + 8);
        puVar6 = (undefined8 *)param_2[1];
        local_res18 = uVar5;
        if ((&local_res18 < puVar6) && (puVar7 = (undefined8 *)*param_2, puVar7 <= &local_res18)) {
          if (puVar6 == (undefined8 *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_res18 - (longlong)puVar7 >> 3) * 8);
          }
        }
        else {
          if (puVar6 == (undefined8 *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] = uVar5;
          }
        }
        param_2[1] = param_2[1] + 8;
        lVar17 = *(longlong *)(lVar16 + 0x18);
        if (lVar17 == 0) {
          uVar13 = *(uint *)(lVar16 + 0x20) % *(uint *)(param_1 + 0x138) + 1;
          lVar16 = (longlong)(int)uVar13 << 3;
          do {
            if (*(uint *)(param_1 + 0x138) <= uVar13) break;
            if (*(longlong *)(lVar16 + *plVar22) != 0) {
              lVar17 = *(longlong *)(lVar16 + *plVar22);
            }
            uVar13 = uVar13 + 1;
            lVar16 = lVar16 + 8;
          } while (lVar17 == 0);
        }
        goto LAB_140190d40;
      }
      local_a8 = 0;
    }
  }
  if ((param_5 & 2) != 0) {
    if (param_4 < 0.0) {
      plVar23 = (longlong *)(param_1 + 0xe0);
      plVar22 = plVar23;
      uStack_100 = plVar23;
      if (*(longlong *)(param_1 + 0xe8) != 0) {
        uVar15 = 0;
        if (*(uint *)(param_1 + 0xf0) != 0) {
          plVar21 = (longlong *)*plVar23;
          do {
            if (*plVar21 != 0) {
              local_108 = ((longlong *)*plVar23)[uVar15];
              goto LAB_140191086;
            }
            uVar13 = (int)uVar15 + 1;
            uVar15 = (ulonglong)uVar13;
            plVar21 = plVar21 + 1;
          } while (uVar13 < *(uint *)(param_1 + 0xf0));
        }
      }
      local_108 = 0;
LAB_140191086:
      do {
        lVar17 = local_108;
        if ((local_108 == 0) && (plVar22 == plVar23)) goto LAB_14019150c;
        if (local_108 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        FUN_140198570(*(undefined8 *)(local_108 + 8));
        plVar11 = local_d0;
        plVar21 = local_d8;
        if (local_d8 == (longlong *)0x0) {
LAB_1401910e6:
          lVar16 = 0;
        }
        else {
          if (local_d8 != local_d0) {
            iVar12 = DAT_14060804c + 1;
            bVar24 = DAT_14060804c == 0;
            DAT_14060804c = iVar12;
            if (bVar24) {
              FUN_140176d60(1);
            }
            goto LAB_1401910e6;
          }
          lVar16 = *local_d8;
        }
        plVar8 = (longlong *)param_2[1];
        local_138 = lVar16;
        if ((&local_138 < plVar8) && (plVar9 = (longlong *)*param_2, plVar9 <= &local_138)) {
          if (plVar8 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_138 - (longlong)plVar9 >> 3) * 8);
          }
        }
        else {
          if (plVar8 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((longlong *)param_2[1] != (longlong *)0x0) {
            *(longlong *)param_2[1] = lVar16;
          }
        }
        param_2[1] = param_2[1] + 8;
        if (plVar21 != (longlong *)0x0) {
          if (plVar21 == plVar11) {
            if (plVar21 != (longlong *)0x0) {
              LOCK();
              plVar11 = plVar21 + 1;
              *(int *)plVar11 = (int)*plVar11 + -1;
              UNLOCK();
              lVar17 = local_108;
              plVar22 = uStack_100;
              if ((int)*plVar11 == 0) {
                local_d8 = (longlong *)0x0;
                if ((undefined8 *)*plVar21 != (undefined8 *)0x0) {
                  (*(code *)**(undefined8 **)*plVar21)();
                }
                operator_delete(plVar21);
                lVar17 = local_108;
                plVar22 = uStack_100;
              }
            }
          }
          else {
            iVar12 = DAT_140608054 + 1;
            bVar24 = DAT_140608054 == 0;
            DAT_140608054 = iVar12;
            if (bVar24) {
              FUN_140176d60(1);
            }
          }
        }
        local_108 = lVar17;
        if ((lVar17 != 0) && (local_108 = *(longlong *)(lVar17 + 0x10), local_108 == 0)) {
          uVar13 = *(uint *)(lVar17 + 0x18) % *(uint *)(plVar22 + 2) + 1;
          lVar17 = (longlong)(int)uVar13 << 3;
          do {
            if (*(uint *)(plVar22 + 2) <= uVar13) break;
            if (*(longlong *)(lVar17 + *plVar22) != 0) {
              local_108 = *(longlong *)(lVar17 + *plVar22);
            }
            uVar13 = uVar13 + 1;
            lVar17 = lVar17 + 8;
          } while (local_108 == 0);
        }
      } while( true );
    }
    if (*(longlong *)(param_1 + 0xe8) != 0) {
      uVar15 = 0;
      if (*(uint *)(param_1 + 0xf0) != 0) {
        plVar22 = *(longlong **)(param_1 + 0xe0);
        plVar23 = plVar22;
        do {
          if (*plVar23 != 0) {
            lVar17 = plVar22[uVar15];
            goto LAB_140191256;
          }
          uVar13 = (int)uVar15 + 1;
          uVar15 = (ulonglong)uVar13;
          plVar23 = plVar23 + 1;
        } while (uVar13 < *(uint *)(param_1 + 0xf0));
      }
    }
    lVar17 = 0;
LAB_140191256:
    local_198 = lVar17;
    plVar22 = local_1e8;
    if (local_198 != 0) {
      if (local_198 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_140198570(*(undefined8 *)(local_198 + 8));
      iVar12 = DAT_14060804c;
      if (local_1e8 == (longlong *)0x0) {
LAB_1401912b9:
        lVar17 = 0;
      }
      else {
        if (local_1e8 != local_1e0) {
          DAT_14060804c = DAT_14060804c + 1;
          if (iVar12 == 0) {
            FUN_140176d60(1);
          }
          goto LAB_1401912b9;
        }
        lVar17 = *local_1e8;
      }
      lVar16 = *(longlong *)(lVar17 + 0x13d8);
      plVar23 = *(longlong **)(lVar17 + 0x13e0);
      if (plVar23 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar23 + 1) = (int)plVar23[1] + 1;
        UNLOCK();
      }
      iVar12 = DAT_14060804c;
      if (lVar16 == 0) {
        if (plVar23 != (longlong *)0x0) {
          LOCK();
          plVar21 = plVar23 + 1;
          *(int *)plVar21 = (int)*plVar21 + -1;
          UNLOCK();
          if ((int)*plVar21 == 0) {
            (**(code **)(*plVar23 + 8))(plVar23);
            LOCK();
            piVar1 = (int *)((longlong)plVar23 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*plVar23 + 0x10))();
            }
          }
        }
      }
      else {
        fVar29 = param_4 + *(float *)(lVar16 + 0x150);
        fVar28 = *(float *)(lVar16 + 0x14c) - fVar4;
        fVar26 = *(float *)(lVar16 + 0x148) - fVar3;
        fVar27 = *(float *)(lVar16 + 0x144) - fVar2;
        if (fVar27 * fVar27 + fVar26 * fVar26 + fVar28 * fVar28 <= fVar29 * fVar29) {
          if (local_1e8 == (longlong *)0x0) {
LAB_14019139b:
            lVar17 = 0;
          }
          else {
            if (local_1e8 != local_1e0) {
              DAT_14060804c = DAT_14060804c + 1;
              if (iVar12 == 0) {
                FUN_140176d60(1);
              }
              goto LAB_14019139b;
            }
            lVar17 = *local_1e8;
          }
          plVar21 = (longlong *)param_2[1];
          local_128 = lVar17;
          if ((&local_128 < plVar21) && (plVar11 = (longlong *)*param_2, plVar11 <= &local_128)) {
            if (plVar21 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_128 - (longlong)plVar11 >> 3) * 8);
            }
          }
          else {
            if (plVar21 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar17;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        if (plVar23 != (longlong *)0x0) {
          LOCK();
          plVar21 = plVar23 + 1;
          *(int *)plVar21 = (int)*plVar21 + -1;
          UNLOCK();
          if ((int)*plVar21 == 0) {
            (**(code **)(*plVar23 + 8))(plVar23);
            LOCK();
            piVar1 = (int *)((longlong)plVar23 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*plVar23 + 0x10))();
            }
          }
        }
      }
      if (local_1e8 != (longlong *)0x0) {
        if (local_1e8 == local_1e0) {
          if (local_1e8 != (longlong *)0x0) {
            LOCK();
            plVar23 = local_1e8 + 1;
            *(int *)plVar23 = (int)*plVar23 + -1;
            UNLOCK();
            if ((int)*plVar23 == 0) {
              puVar6 = (undefined8 *)*local_1e8;
              local_1e8 = (longlong *)0x0;
              if (puVar6 != (undefined8 *)0x0) {
                (**(code **)*puVar6)();
              }
              operator_delete(plVar22);
            }
          }
        }
        else {
          iVar12 = DAT_140608054 + 1;
          bVar24 = DAT_140608054 == 0;
          DAT_140608054 = iVar12;
          if (bVar24) {
            FUN_140176d60(1);
          }
        }
      }
      if (local_198 == 0) {
        lVar17 = 0;
      }
      else {
        lVar17 = *(longlong *)(local_198 + 0x10);
        if (lVar17 == 0) {
          uVar13 = *(uint *)(local_198 + 0x18) % *(uint *)(param_1 + 0xf0) + 1;
          lVar16 = (longlong)(int)uVar13 * 8;
          do {
            if (*(uint *)(param_1 + 0xf0) <= uVar13) break;
            lVar10 = *(longlong *)(param_1 + 0xe0);
            if (*(longlong *)(lVar16 + lVar10) != 0) {
              lVar17 = *(longlong *)(lVar16 + lVar10);
            }
            uVar13 = uVar13 + 1;
            lVar16 = lVar16 + 8;
          } while (lVar17 == 0);
        }
      }
      goto LAB_140191256;
    }
  }
LAB_14019150c:
  if ((param_5 & 0x20) != 0) {
    plVar22 = (longlong *)(param_1 + 8);
    if (0.0 <= param_4) {
      if (*(longlong *)(param_1 + 0x10) != 0) {
        uVar15 = 0;
        if (*(uint *)(param_1 + 0x18) != 0) {
          plVar23 = (longlong *)*plVar22;
          do {
            if (*plVar23 != 0) {
              lVar17 = ((longlong *)*plVar22)[uVar15];
              goto LAB_1401916a0;
            }
            uVar13 = (int)uVar15 + 1;
            uVar15 = (ulonglong)uVar13;
            plVar23 = plVar23 + 1;
          } while (uVar13 < *(uint *)(param_1 + 0x18));
        }
      }
      lVar17 = 0;
LAB_1401916a0:
      local_1c8 = lVar17;
      if (local_1c8 != 0) {
        if (local_1c8 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        lVar17 = *(longlong *)(local_1c8 + 8);
        lVar16 = *(longlong *)(lVar17 + 0x13d8);
        plVar23 = *(longlong **)(lVar17 + 0x13e0);
        if (plVar23 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar23 + 1) = (int)plVar23[1] + 1;
          UNLOCK();
        }
        if ((lVar16 != 0) &&
           (fVar29 = param_4 + *(float *)(lVar16 + 0x150),
           fVar28 = *(float *)(lVar16 + 0x14c) - fVar4, fVar26 = *(float *)(lVar16 + 0x148) - fVar3,
           fVar27 = *(float *)(lVar16 + 0x144) - fVar2,
           fVar27 * fVar27 + fVar26 * fVar26 + fVar28 * fVar28 <= fVar29 * fVar29)) {
          plVar21 = (longlong *)param_2[1];
          local_118 = lVar17;
          if ((&local_118 < plVar21) && (plVar11 = (longlong *)*param_2, plVar11 <= &local_118)) {
            if (plVar21 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_118 - (longlong)plVar11 >> 3) * 8);
            }
          }
          else {
            if (plVar21 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar17;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        if (plVar23 != (longlong *)0x0) {
          LOCK();
          plVar21 = plVar23 + 1;
          *(int *)plVar21 = (int)*plVar21 + -1;
          UNLOCK();
          if ((int)*plVar21 == 0) {
            (**(code **)(*plVar23 + 8))(plVar23);
            LOCK();
            piVar1 = (int *)((longlong)plVar23 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*plVar23 + 0x10))();
            }
          }
        }
        lVar17 = local_1c8;
        if ((local_1c8 != 0) && (lVar17 = *(longlong *)(local_1c8 + 0x18), lVar17 == 0)) {
          uVar13 = *(uint *)(local_1c8 + 0x20) % *(uint *)(param_1 + 0x18) + 1;
          lVar16 = (longlong)(int)uVar13 * 8;
          do {
            if (*(uint *)(param_1 + 0x18) <= uVar13) break;
            if (*(longlong *)(lVar16 + *plVar22) != 0) {
              lVar17 = *(longlong *)(lVar16 + *plVar22);
            }
            uVar13 = uVar13 + 1;
            lVar16 = lVar16 + 8;
          } while (lVar17 == 0);
        }
        goto LAB_1401916a0;
      }
    }
    else {
      if (*(longlong *)(param_1 + 0x10) != 0) {
        uVar15 = 0;
        if (*(uint *)(param_1 + 0x18) != 0) {
          plVar23 = (longlong *)*plVar22;
          do {
            if (*plVar23 != 0) {
              lVar17 = ((longlong *)*plVar22)[uVar15];
              goto LAB_140191576;
            }
            uVar13 = (int)uVar15 + 1;
            uVar15 = (ulonglong)uVar13;
            plVar23 = plVar23 + 1;
          } while (uVar13 < *(uint *)(param_1 + 0x18));
        }
      }
      lVar17 = 0;
LAB_140191576:
      lVar16 = lVar17;
      if (lVar16 != 0) {
        uVar5 = *(undefined8 *)(lVar16 + 8);
        puVar6 = (undefined8 *)param_2[1];
        local_130 = uVar5;
        if ((&local_130 < puVar6) && (puVar7 = (undefined8 *)*param_2, puVar7 <= &local_130)) {
          if (puVar6 == (undefined8 *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_130 - (longlong)puVar7 >> 3) * 8);
          }
        }
        else {
          if (puVar6 == (undefined8 *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] = uVar5;
          }
        }
        param_2[1] = param_2[1] + 8;
        lVar17 = *(longlong *)(lVar16 + 0x18);
        if (lVar17 == 0) {
          uVar13 = *(uint *)(lVar16 + 0x20) % *(uint *)(param_1 + 0x18) + 1;
          lVar16 = (longlong)(int)uVar13 << 3;
          do {
            if (*(uint *)(param_1 + 0x18) <= uVar13) break;
            if (*(longlong *)(*plVar22 + lVar16) != 0) {
              lVar17 = *(longlong *)(*plVar22 + lVar16);
            }
            uVar13 = uVar13 + 1;
            lVar16 = lVar16 + 8;
          } while (lVar17 == 0);
        }
        goto LAB_140191576;
      }
    }
  }
  if ((((*(longlong *)(param_1 + 0x188) != 0) &&
       (lVar17 = *(longlong *)(*(longlong *)(param_1 + 0x188) + 0x30), lVar17 != 0)) &&
      (*(longlong *)(lVar17 + 0x2d0) != 0)) &&
     (*(int *)(*(longlong *)(lVar17 + 0x2d0) + 0x4bc) != 3)) {
    uVar15 = 0;
    if ((*(longlong *)(param_1 + 0xe8) != 0) && (*(uint *)(param_1 + 0xf0) != 0)) {
      plVar22 = *(longlong **)(param_1 + 0xe0);
      uVar18 = uVar15;
      plVar23 = plVar22;
      do {
        if (*plVar23 != 0) {
          uVar15 = plVar22[uVar18];
          break;
        }
        uVar13 = (int)uVar18 + 1;
        uVar18 = (ulonglong)uVar13;
        plVar23 = plVar23 + 1;
      } while (uVar13 < *(uint *)(param_1 + 0xf0));
    }
LAB_1401918e7:
    local_178 = uVar15;
    plVar22 = local_1f8;
    if (local_178 != 0) {
      if (local_178 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_140198570(*(undefined8 *)(local_178 + 8));
      if (local_1f8 == (longlong *)0x0) {
LAB_140191afc:
        if (local_1f8 != (longlong *)0x0) {
          if (local_1f8 == (longlong *)CONCAT44(uStack_1ec,fVar4)) {
            if (local_1f8 != (longlong *)0x0) goto LAB_140191b28;
          }
          else {
            iVar12 = DAT_140608054 + 1;
            bVar24 = DAT_140608054 == 0;
            DAT_140608054 = iVar12;
            if (bVar24) {
              FUN_140176d60(1);
            }
          }
        }
      }
      else {
        if (local_1f8 != (longlong *)CONCAT44(uStack_1ec,fVar4)) {
          iVar12 = DAT_14060804c + 1;
          bVar24 = DAT_14060804c == 0;
          DAT_14060804c = iVar12;
          if (bVar24) {
            hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                  (HANDLE)0x0);
            if (hObject != (HANDLE)0x0) {
              DVar14 = GetCurrentProcessId();
              pvVar19 = GetCurrentProcess();
              MiniDumpWriteDump(pvVar19,DVar14,hObject,2,0,0,0);
              CloseHandle(hObject);
            }
          }
          goto LAB_140191afc;
        }
        lVar17 = *local_1f8;
        if (lVar17 == 0) goto LAB_140191afc;
        local_e8 = *(longlong *)(lVar17 + 0x13d8);
        plVar23 = *(longlong **)(lVar17 + 0x13e0);
        if (plVar23 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar23 + 1) = (int)plVar23[1] + 1;
          UNLOCK();
        }
        local_e0 = plVar23;
        if (((local_e8 != 0) &&
            (fVar29 = param_4 + *(float *)(local_e8 + 0x150),
            fVar28 = *(float *)(local_e8 + 0x14c) - fVar4,
            fVar26 = *(float *)(local_e8 + 0x148) - fVar3,
            fVar27 = *(float *)(local_e8 + 0x144) - fVar2,
            fVar27 * fVar27 + fVar26 * fVar26 + fVar28 * fVar28 <= fVar29 * fVar29)) &&
           (lVar17 = *local_1f8, *(char *)(lVar17 + 0x2130) != '\0')) {
          plVar21 = (longlong *)param_2[1];
          local_110 = lVar17;
          if ((&local_110 < plVar21) && (plVar11 = (longlong *)*param_2, plVar11 <= &local_110)) {
            if (plVar21 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_110 - (longlong)plVar11 >> 3) * 8);
            }
          }
          else {
            if (plVar21 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar17;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        plVar21 = local_e0;
        if (plVar23 != (longlong *)0x0) {
          LOCK();
          plVar23 = plVar23 + 1;
          *(int *)plVar23 = (int)*plVar23 + -1;
          UNLOCK();
          if ((int)*plVar23 == 0) {
            (**(code **)(*local_e0 + 8))(local_e0);
            LOCK();
            piVar1 = (int *)((longlong)plVar21 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*local_e0 + 0x10))();
            }
          }
        }
LAB_140191b28:
        LOCK();
        plVar23 = local_1f8 + 1;
        *(int *)plVar23 = (int)*plVar23 + -1;
        UNLOCK();
        if ((int)*plVar23 == 0) {
          puVar6 = (undefined8 *)*local_1f8;
          local_1f8 = (longlong *)0x0;
          if (puVar6 != (undefined8 *)0x0) {
            (**(code **)*puVar6)();
          }
          operator_delete(plVar22);
        }
      }
      uVar18 = 0;
      uVar15 = uVar18;
      if ((local_178 != 0) &&
         (uVar15 = *(ulonglong *)(local_178 + 0x10), *(ulonglong *)(local_178 + 0x10) == 0)) {
        uVar13 = *(uint *)(local_178 + 0x18) % *(uint *)(param_1 + 0xf0) + 1;
        lVar17 = (longlong)(int)uVar13 << 3;
        do {
          uVar15 = uVar18;
          if (*(uint *)(param_1 + 0xf0) <= uVar13) break;
          lVar16 = *(longlong *)(param_1 + 0xe0);
          if (*(longlong *)(lVar17 + lVar16) != 0) {
            uVar18 = *(ulonglong *)(lVar17 + lVar16);
          }
          uVar13 = uVar13 + 1;
          lVar17 = lVar17 + 8;
          uVar15 = uVar18;
        } while (uVar18 == 0);
      }
      goto LAB_1401918e7;
    }
  }
  if (bVar25) {
    FUN_14034edd0(local_1d8);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401929aa)
// WARNING: Removing unreachable block (ram,0x000140192199)
// WARNING: Removing unreachable block (ram,0x000140191e9e)

void FUN_140191c10(longlong param_1,ulonglong *param_2,float *param_3,float param_4,uint param_5,
                  float *param_6)

{
  int *piVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  void *_Dst;
  float *pfVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  longlong lVar8;
  undefined8 uVar9;
  longlong *plVar10;
  longlong *plVar11;
  longlong *plVar12;
  int iVar13;
  uint uVar14;
  DWORD DVar15;
  ulonglong uVar16;
  longlong lVar17;
  longlong lVar18;
  ulonglong uVar19;
  ulonglong uVar20;
  HANDLE hObject;
  HANDLE pvVar21;
  longlong *plVar22;
  longlong *plVar23;
  longlong *plVar24;
  bool bVar25;
  bool bVar26;
  float fVar27;
  float fVar28;
  float fVar29;
  float fVar30;
  undefined8 local_res10;
  longlong *local_1f8;
  undefined4 uStack_1ec;
  longlong local_1e8;
  longlong *local_1d8;
  longlong *local_1d0;
  longlong local_1c8;
  longlong local_1b8;
  ulonglong local_198;
  longlong local_188;
  ulonglong local_178;
  longlong local_138;
  undefined8 local_130;
  longlong local_128;
  longlong local_120;
  longlong local_118;
  longlong local_110;
  longlong local_108;
  undefined8 uStack_100;
  longlong local_f8;
  longlong *local_f0;
  longlong local_e8;
  longlong *local_e0;
  longlong *local_d8;
  longlong *local_d0;
  longlong local_c8;
  undefined8 uStack_c0;
  float *local_b8;
  longlong local_a8;
  undefined8 uStack_a0;
  undefined8 local_98;
  
  local_98 = 0xfffffffffffffffe;
  local_1e8 = 0;
  bVar26 = false;
  plVar23 = *(longlong **)(param_1 + 0x1f8);
  if (plVar23 != (longlong *)0x0) {
    if (plVar23 == *(longlong **)(param_1 + 0x200)) {
      lVar18 = *plVar23;
      if (lVar18 != 0) {
        if (plVar23 != *(longlong **)(param_1 + 0x200)) {
          iVar13 = DAT_1406080a8 + 1;
          bVar26 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar13;
          if (bVar26) {
            FUN_140176d60();
          }
          lVar18 = 0;
        }
        FUN_14034ed40();
        bVar26 = true;
        local_1e8 = lVar18;
      }
    }
    else {
      iVar13 = DAT_1406080a8 + 1;
      bVar25 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar13;
      if (bVar25) {
        FUN_140176d60(1);
      }
    }
  }
  fVar2 = *param_6;
  fVar3 = param_6[1];
  local_1f8 = *(longlong **)param_6;
  fVar4 = param_6[2];
  _Dst = (void *)*param_2;
  if (_Dst != (void *)param_2[1]) {
    memmove(_Dst,(void *)param_2[1],0);
    param_2[1] = (ulonglong)_Dst;
  }
  if ((param_5 & 4) != 0) {
    if (0.0 <= param_4) {
      if (*(longlong *)(param_1 + 0x58) != 0) {
        uVar16 = 0;
        if (*(uint *)(param_1 + 0x60) != 0) {
          plVar23 = *(longlong **)(param_1 + 0x50);
          plVar24 = plVar23;
          do {
            if (*plVar24 != 0) {
              lVar18 = plVar23[uVar16];
              goto LAB_140191ef6;
            }
            uVar14 = (int)uVar16 + 1;
            uVar16 = (ulonglong)uVar14;
            plVar24 = plVar24 + 1;
          } while (uVar14 < *(uint *)(param_1 + 0x60));
        }
      }
      lVar18 = 0;
LAB_140191ef6:
      local_188 = lVar18;
      if (local_188 != 0) {
        if (local_188 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pfVar5 = *(float **)(local_188 + 8);
        if (param_3 != pfVar5) {
          lVar18 = *(longlong *)(pfVar5 + 0x4f6);
          plVar23 = *(longlong **)(pfVar5 + 0x4f8);
          if (plVar23 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar23 + 1) = (int)plVar23[1] + 1;
            UNLOCK();
          }
          if ((lVar18 != 0) &&
             (fVar30 = param_4 + *(float *)(lVar18 + 0x150),
             fVar29 = *(float *)(lVar18 + 0x14c) - fVar4,
             fVar27 = *(float *)(lVar18 + 0x148) - fVar3,
             fVar28 = *(float *)(lVar18 + 0x144) - fVar2,
             fVar28 * fVar28 + fVar27 * fVar27 + fVar29 * fVar29 <= fVar30 * fVar30)) {
            local_b8 = pfVar5;
            FUN_1401959b0(param_2);
          }
          if (plVar23 != (longlong *)0x0) {
            LOCK();
            plVar24 = plVar23 + 1;
            *(int *)plVar24 = (int)*plVar24 + -1;
            UNLOCK();
            if ((int)*plVar24 == 0) {
              (**(code **)(*plVar23 + 8))(plVar23);
              LOCK();
              piVar1 = (int *)((longlong)plVar23 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar23 + 0x10))();
              }
            }
          }
        }
        lVar18 = local_188;
        if ((local_188 != 0) && (lVar18 = *(longlong *)(local_188 + 0x18), lVar18 == 0)) {
          uVar14 = *(uint *)(local_188 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
          lVar17 = (longlong)(int)uVar14 * 8;
          do {
            if (*(uint *)(param_1 + 0x60) <= uVar14) break;
            lVar8 = *(longlong *)(param_1 + 0x50);
            if (*(longlong *)(lVar17 + lVar8) != 0) {
              lVar18 = *(longlong *)(lVar17 + lVar8);
            }
            uVar14 = uVar14 + 1;
            lVar17 = lVar17 + 8;
          } while (lVar18 == 0);
        }
        goto LAB_140191ef6;
      }
    }
    else {
      plVar23 = (longlong *)(param_1 + 0x50);
      uStack_c0 = plVar23;
      if (*(longlong *)(param_1 + 0x58) != 0) {
        uVar16 = 0;
        if (*(uint *)(param_1 + 0x60) != 0) {
          plVar24 = (longlong *)*plVar23;
          do {
            if (*plVar24 != 0) {
              local_c8 = ((longlong *)*plVar23)[uVar16];
              lVar18 = local_c8;
              goto LAB_140191dc0;
            }
            uVar14 = (int)uVar16 + 1;
            uVar16 = (ulonglong)uVar14;
            plVar24 = plVar24 + 1;
          } while (uVar14 < *(uint *)(param_1 + 0x60));
        }
      }
      local_c8 = 0;
      lVar18 = local_c8;
LAB_140191dc0:
      lVar17 = lVar18;
      if (lVar17 != 0) {
        pfVar5 = *(float **)(lVar17 + 8);
        if (param_3 != pfVar5) {
          puVar6 = (undefined8 *)param_2[1];
          param_6 = pfVar5;
          if ((&param_6 < puVar6) && (puVar7 = (undefined8 *)*param_2, puVar7 <= &param_6)) {
            if (puVar6 == (undefined8 *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&param_6 - (longlong)puVar7 >> 3) * 8);
            }
          }
          else {
            if (puVar6 == (undefined8 *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] = pfVar5;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        lVar18 = *(longlong *)(lVar17 + 0x18);
        if (lVar18 == 0) {
          uVar14 = *(uint *)(lVar17 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
          lVar17 = (longlong)(int)uVar14 << 3;
          do {
            if (*(uint *)(param_1 + 0x60) <= uVar14) break;
            if (*(longlong *)(lVar17 + *plVar23) != 0) {
              lVar18 = *(longlong *)(lVar17 + *plVar23);
            }
            uVar14 = uVar14 + 1;
            lVar17 = lVar17 + 8;
          } while (lVar18 == 0);
        }
        goto LAB_140191dc0;
      }
      local_c8 = 0;
    }
  }
  if ((param_5 & 8) != 0) {
    plVar23 = (longlong *)(param_1 + 0x128);
    if (0.0 <= param_4) {
      if (*(longlong *)(param_1 + 0x130) != 0) {
        uVar16 = 0;
        if (*(uint *)(param_1 + 0x138) != 0) {
          plVar24 = (longlong *)*plVar23;
          do {
            if (*plVar24 != 0) {
              lVar18 = ((longlong *)*plVar23)[uVar16];
              goto LAB_1401921f2;
            }
            uVar14 = (int)uVar16 + 1;
            uVar16 = (ulonglong)uVar14;
            plVar24 = plVar24 + 1;
          } while (uVar14 < *(uint *)(param_1 + 0x138));
        }
      }
      lVar18 = 0;
LAB_1401921f2:
      local_1b8 = lVar18;
      if (local_1b8 != 0) {
        if (local_1b8 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        lVar18 = *(longlong *)(local_1b8 + 8);
        local_f8 = *(longlong *)(lVar18 + 0x13d8);
        plVar24 = *(longlong **)(lVar18 + 0x13e0);
        if (plVar24 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar24 + 1) = (int)plVar24[1] + 1;
          UNLOCK();
        }
        local_f0 = plVar24;
        if ((local_f8 != 0) &&
           (fVar30 = param_4 + *(float *)(local_f8 + 0x150),
           fVar29 = *(float *)(local_f8 + 0x14c) - fVar4,
           fVar27 = *(float *)(local_f8 + 0x148) - fVar3,
           fVar28 = *(float *)(local_f8 + 0x144) - fVar2,
           fVar28 * fVar28 + fVar27 * fVar27 + fVar29 * fVar29 <= fVar30 * fVar30)) {
          plVar22 = (longlong *)param_2[1];
          local_120 = lVar18;
          if ((&local_120 < plVar22) && (plVar12 = (longlong *)*param_2, plVar12 <= &local_120)) {
            if (plVar22 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_120 - (longlong)plVar12 >> 3) * 8);
            }
          }
          else {
            if (plVar22 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar18;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        plVar22 = local_f0;
        if (plVar24 != (longlong *)0x0) {
          LOCK();
          plVar24 = plVar24 + 1;
          *(int *)plVar24 = (int)*plVar24 + -1;
          UNLOCK();
          if ((int)*plVar24 == 0) {
            (**(code **)(*local_f0 + 8))(local_f0);
            LOCK();
            piVar1 = (int *)((longlong)plVar22 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*local_f0 + 0x10))();
            }
          }
        }
        lVar18 = local_1b8;
        if ((local_1b8 != 0) && (lVar18 = *(longlong *)(local_1b8 + 0x18), lVar18 == 0)) {
          uVar14 = *(uint *)(local_1b8 + 0x20) % *(uint *)(param_1 + 0x138) + 1;
          lVar17 = (longlong)(int)uVar14 * 8;
          do {
            if (*(uint *)(param_1 + 0x138) <= uVar14) break;
            if (*(longlong *)(lVar17 + *plVar23) != 0) {
              lVar18 = *(longlong *)(lVar17 + *plVar23);
            }
            uVar14 = uVar14 + 1;
            lVar17 = lVar17 + 8;
          } while (lVar18 == 0);
        }
        goto LAB_1401921f2;
      }
    }
    else {
      uStack_a0 = plVar23;
      if (*(longlong *)(param_1 + 0x130) != 0) {
        uVar16 = 0;
        if (*(uint *)(param_1 + 0x138) != 0) {
          plVar24 = (longlong *)*plVar23;
          do {
            if (*plVar24 != 0) {
              local_a8 = ((longlong *)*plVar23)[uVar16];
              lVar18 = local_a8;
              goto LAB_1401920c0;
            }
            uVar14 = (int)uVar16 + 1;
            uVar16 = (ulonglong)uVar14;
            plVar24 = plVar24 + 1;
          } while (uVar14 < *(uint *)(param_1 + 0x138));
        }
      }
      local_a8 = 0;
      lVar18 = local_a8;
LAB_1401920c0:
      lVar17 = lVar18;
      if (lVar17 != 0) {
        uVar9 = *(undefined8 *)(lVar17 + 8);
        puVar6 = (undefined8 *)param_2[1];
        local_res10 = uVar9;
        if ((&local_res10 < puVar6) && (puVar7 = (undefined8 *)*param_2, puVar7 <= &local_res10)) {
          if (puVar6 == (undefined8 *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_res10 - (longlong)puVar7 >> 3) * 8);
          }
        }
        else {
          if (puVar6 == (undefined8 *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] = uVar9;
          }
        }
        param_2[1] = param_2[1] + 8;
        lVar18 = *(longlong *)(lVar17 + 0x18);
        if (lVar18 == 0) {
          uVar14 = *(uint *)(lVar17 + 0x20) % *(uint *)(param_1 + 0x138) + 1;
          lVar17 = (longlong)(int)uVar14 << 3;
          do {
            if (*(uint *)(param_1 + 0x138) <= uVar14) break;
            if (*(longlong *)(*plVar23 + lVar17) != 0) {
              lVar18 = *(longlong *)(*plVar23 + lVar17);
            }
            uVar14 = uVar14 + 1;
            lVar17 = lVar17 + 8;
          } while (lVar18 == 0);
        }
        goto LAB_1401920c0;
      }
      local_a8 = 0;
    }
  }
  if ((param_5 & 2) != 0) {
    if (param_4 < 0.0) {
      plVar24 = (longlong *)(param_1 + 0xe0);
      plVar23 = plVar24;
      uStack_100 = plVar24;
      if (*(longlong *)(param_1 + 0xe8) != 0) {
        uVar16 = 0;
        if (*(uint *)(param_1 + 0xf0) != 0) {
          plVar22 = (longlong *)*plVar24;
          do {
            if (*plVar22 != 0) {
              local_108 = ((longlong *)*plVar24)[uVar16];
              goto LAB_140192406;
            }
            uVar14 = (int)uVar16 + 1;
            uVar16 = (ulonglong)uVar14;
            plVar22 = plVar22 + 1;
          } while (uVar14 < *(uint *)(param_1 + 0xf0));
        }
      }
      local_108 = 0;
LAB_140192406:
      do {
        lVar18 = local_108;
        if ((local_108 == 0) && (plVar23 == plVar24)) goto LAB_140192878;
        if (local_108 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        FUN_140198570(*(undefined8 *)(local_108 + 8));
        plVar12 = local_d0;
        plVar22 = local_d8;
        if (local_d8 != (longlong *)0x0) {
          if (local_d8 == local_d0) {
            lVar17 = *local_d8;
            if (lVar17 != 0) {
              plVar10 = (longlong *)param_2[1];
              local_138 = lVar17;
              if ((&local_138 < plVar10) && (plVar11 = (longlong *)*param_2, plVar11 <= &local_138))
              {
                if (plVar10 == (longlong *)param_2[2]) {
                  FUN_140195b20(param_2);
                }
                if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
                  *(undefined8 *)param_2[1] =
                       *(undefined8 *)
                        (*param_2 + ((longlong)&local_138 - (longlong)plVar11 >> 3) * 8);
                }
              }
              else {
                if (plVar10 == (longlong *)param_2[2]) {
                  FUN_140195b20(param_2);
                }
                if ((longlong *)param_2[1] != (longlong *)0x0) {
                  *(longlong *)param_2[1] = lVar17;
                }
              }
              param_2[1] = param_2[1] + 8;
            }
          }
          else {
            iVar13 = DAT_14060804c + 1;
            bVar25 = DAT_14060804c == 0;
            DAT_14060804c = iVar13;
            if (bVar25) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar22 != (longlong *)0x0) {
          if (plVar22 == plVar12) {
            if (plVar22 != (longlong *)0x0) {
              LOCK();
              plVar12 = plVar22 + 1;
              *(int *)plVar12 = (int)*plVar12 + -1;
              UNLOCK();
              lVar18 = local_108;
              plVar23 = uStack_100;
              if ((int)*plVar12 == 0) {
                local_d8 = (longlong *)0x0;
                if ((undefined8 *)*plVar22 != (undefined8 *)0x0) {
                  (*(code *)**(undefined8 **)*plVar22)();
                }
                operator_delete(plVar22);
                lVar18 = local_108;
                plVar23 = uStack_100;
              }
            }
          }
          else {
            iVar13 = DAT_140608054 + 1;
            bVar25 = DAT_140608054 == 0;
            DAT_140608054 = iVar13;
            if (bVar25) {
              FUN_140176d60(1);
            }
          }
        }
        local_108 = lVar18;
        if ((lVar18 != 0) && (local_108 = *(longlong *)(lVar18 + 0x10), local_108 == 0)) {
          uVar14 = *(uint *)(lVar18 + 0x18) % *(uint *)(plVar23 + 2) + 1;
          lVar18 = (longlong)(int)uVar14 << 3;
          do {
            if (*(uint *)(plVar23 + 2) <= uVar14) break;
            if (*(longlong *)(lVar18 + *plVar23) != 0) {
              local_108 = *(longlong *)(lVar18 + *plVar23);
            }
            uVar14 = uVar14 + 1;
            lVar18 = lVar18 + 8;
          } while (local_108 == 0);
        }
      } while( true );
    }
    uVar20 = 0;
    uVar16 = uVar20;
    if ((*(longlong *)(param_1 + 0xe8) != 0) && (*(uint *)(param_1 + 0xf0) != 0)) {
      plVar23 = *(longlong **)(param_1 + 0xe0);
      uVar19 = uVar20;
      plVar24 = plVar23;
      do {
        if (*plVar24 != 0) {
          uVar16 = plVar23[uVar19];
          break;
        }
        uVar14 = (int)uVar19 + 1;
        uVar19 = (ulonglong)uVar14;
        plVar24 = plVar24 + 1;
      } while (uVar14 < *(uint *)(param_1 + 0xf0));
    }
LAB_1401925e2:
    local_198 = uVar16;
    plVar23 = local_1d8;
    if (local_198 != 0) {
      if (local_198 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_140198570(*(undefined8 *)(local_198 + 8));
      if (local_1d8 == (longlong *)0x0) {
LAB_1401927a7:
        if (local_1d8 != (longlong *)0x0) {
          if (local_1d8 == local_1d0) {
            if (local_1d8 != (longlong *)0x0) goto LAB_1401927d3;
          }
          else {
            iVar13 = DAT_140608054 + 1;
            bVar25 = DAT_140608054 == 0;
            DAT_140608054 = iVar13;
            if (bVar25) {
              FUN_140176d60(1);
            }
          }
        }
      }
      else {
        if (local_1d8 != local_1d0) {
          iVar13 = DAT_14060804c + 1;
          bVar25 = DAT_14060804c == 0;
          DAT_14060804c = iVar13;
          if (bVar25) {
            FUN_140176d60(1);
          }
          goto LAB_1401927a7;
        }
        lVar18 = *local_1d8;
        if (lVar18 == 0) goto LAB_1401927a7;
        lVar17 = *(longlong *)(lVar18 + 0x13d8);
        plVar24 = *(longlong **)(lVar18 + 0x13e0);
        if (plVar24 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar24 + 1) = (int)plVar24[1] + 1;
          UNLOCK();
        }
        if (lVar17 == 0) {
          if (plVar24 != (longlong *)0x0) {
            LOCK();
            plVar22 = plVar24 + 1;
            *(int *)plVar22 = (int)*plVar22 + -1;
            UNLOCK();
            if ((int)*plVar22 == 0) {
              (**(code **)(*plVar24 + 8))(plVar24);
              LOCK();
              piVar1 = (int *)((longlong)plVar24 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar24 + 0x10))();
              }
            }
          }
        }
        else {
          fVar30 = param_4 + *(float *)(lVar17 + 0x150);
          fVar29 = *(float *)(lVar17 + 0x14c) - fVar4;
          fVar27 = *(float *)(lVar17 + 0x148) - fVar3;
          fVar28 = *(float *)(lVar17 + 0x144) - fVar2;
          if (fVar28 * fVar28 + fVar27 * fVar27 + fVar29 * fVar29 <= fVar30 * fVar30) {
            lVar18 = *local_1d8;
            plVar22 = (longlong *)param_2[1];
            local_128 = lVar18;
            if ((&local_128 < plVar22) && (plVar12 = (longlong *)*param_2, plVar12 <= &local_128)) {
              if (plVar22 == (longlong *)param_2[2]) {
                FUN_140195b20(param_2);
              }
              if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
                *(undefined8 *)param_2[1] =
                     *(undefined8 *)(*param_2 + ((longlong)&local_128 - (longlong)plVar12 >> 3) * 8)
                ;
              }
            }
            else {
              if (plVar22 == (longlong *)param_2[2]) {
                FUN_140195b20(param_2);
              }
              if ((longlong *)param_2[1] != (longlong *)0x0) {
                *(longlong *)param_2[1] = lVar18;
              }
            }
            param_2[1] = param_2[1] + 8;
          }
          if (plVar24 != (longlong *)0x0) {
            LOCK();
            plVar22 = plVar24 + 1;
            *(int *)plVar22 = (int)*plVar22 + -1;
            UNLOCK();
            if ((int)*plVar22 == 0) {
              (**(code **)(*plVar24 + 8))(plVar24);
              LOCK();
              piVar1 = (int *)((longlong)plVar24 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar24 + 0x10))();
              }
            }
          }
        }
LAB_1401927d3:
        LOCK();
        plVar24 = local_1d8 + 1;
        *(int *)plVar24 = (int)*plVar24 + -1;
        UNLOCK();
        if ((int)*plVar24 == 0) {
          puVar6 = (undefined8 *)*local_1d8;
          local_1d8 = (longlong *)0x0;
          if (puVar6 != (undefined8 *)0x0) {
            (**(code **)*puVar6)();
          }
          operator_delete(plVar23);
        }
      }
      uVar16 = uVar20;
      if ((local_198 != 0) &&
         (uVar16 = *(ulonglong *)(local_198 + 0x10), *(ulonglong *)(local_198 + 0x10) == 0)) {
        uVar14 = *(uint *)(local_198 + 0x18) % *(uint *)(param_1 + 0xf0) + 1;
        lVar18 = (longlong)(int)uVar14 * 8;
        uVar16 = uVar20;
        do {
          if (*(uint *)(param_1 + 0xf0) <= uVar14) break;
          lVar17 = *(longlong *)(param_1 + 0xe0);
          if (*(longlong *)(lVar18 + lVar17) != 0) {
            uVar16 = *(ulonglong *)(lVar18 + lVar17);
          }
          uVar14 = uVar14 + 1;
          lVar18 = lVar18 + 8;
        } while (uVar16 == 0);
      }
      goto LAB_1401925e2;
    }
  }
LAB_140192878:
  if ((param_5 & 0x20) != 0) {
    plVar23 = (longlong *)(param_1 + 8);
    if (0.0 <= param_4) {
      if (*(longlong *)(param_1 + 0x10) != 0) {
        uVar16 = 0;
        if (*(uint *)(param_1 + 0x18) != 0) {
          plVar24 = (longlong *)*plVar23;
          do {
            if (*plVar24 != 0) {
              lVar18 = ((longlong *)*plVar23)[uVar16];
              goto LAB_140192a02;
            }
            uVar14 = (int)uVar16 + 1;
            uVar16 = (ulonglong)uVar14;
            plVar24 = plVar24 + 1;
          } while (uVar14 < *(uint *)(param_1 + 0x18));
        }
      }
      lVar18 = 0;
LAB_140192a02:
      local_1c8 = lVar18;
      if (local_1c8 != 0) {
        if (local_1c8 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        lVar18 = *(longlong *)(local_1c8 + 8);
        lVar17 = *(longlong *)(lVar18 + 0x13d8);
        plVar24 = *(longlong **)(lVar18 + 0x13e0);
        if (plVar24 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar24 + 1) = (int)plVar24[1] + 1;
          UNLOCK();
        }
        if ((lVar17 != 0) &&
           (fVar30 = param_4 + *(float *)(lVar17 + 0x150),
           fVar29 = *(float *)(lVar17 + 0x14c) - fVar4, fVar27 = *(float *)(lVar17 + 0x148) - fVar3,
           fVar28 = *(float *)(lVar17 + 0x144) - fVar2,
           fVar28 * fVar28 + fVar27 * fVar27 + fVar29 * fVar29 <= fVar30 * fVar30)) {
          plVar22 = (longlong *)param_2[1];
          local_118 = lVar18;
          if ((&local_118 < plVar22) && (plVar12 = (longlong *)*param_2, plVar12 <= &local_118)) {
            if (plVar22 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_118 - (longlong)plVar12 >> 3) * 8);
            }
          }
          else {
            if (plVar22 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar18;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        if (plVar24 != (longlong *)0x0) {
          LOCK();
          plVar22 = plVar24 + 1;
          *(int *)plVar22 = (int)*plVar22 + -1;
          UNLOCK();
          if ((int)*plVar22 == 0) {
            (**(code **)(*plVar24 + 8))(plVar24);
            LOCK();
            piVar1 = (int *)((longlong)plVar24 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*plVar24 + 0x10))();
            }
          }
        }
        lVar18 = local_1c8;
        if ((local_1c8 != 0) && (lVar18 = *(longlong *)(local_1c8 + 0x18), lVar18 == 0)) {
          uVar14 = *(uint *)(local_1c8 + 0x20) % *(uint *)(param_1 + 0x18) + 1;
          lVar17 = (longlong)(int)uVar14 * 8;
          do {
            if (*(uint *)(param_1 + 0x18) <= uVar14) break;
            if (*(longlong *)(lVar17 + *plVar23) != 0) {
              lVar18 = *(longlong *)(lVar17 + *plVar23);
            }
            uVar14 = uVar14 + 1;
            lVar17 = lVar17 + 8;
          } while (lVar18 == 0);
        }
        goto LAB_140192a02;
      }
    }
    else {
      if (*(longlong *)(param_1 + 0x10) != 0) {
        uVar16 = 0;
        if (*(uint *)(param_1 + 0x18) != 0) {
          plVar24 = (longlong *)*plVar23;
          do {
            if (*plVar24 != 0) {
              lVar18 = ((longlong *)*plVar23)[uVar16];
              goto LAB_1401928e0;
            }
            uVar14 = (int)uVar16 + 1;
            uVar16 = (ulonglong)uVar14;
            plVar24 = plVar24 + 1;
          } while (uVar14 < *(uint *)(param_1 + 0x18));
        }
      }
      lVar18 = 0;
LAB_1401928e0:
      lVar17 = lVar18;
      if (lVar17 != 0) {
        uVar9 = *(undefined8 *)(lVar17 + 8);
        puVar6 = (undefined8 *)param_2[1];
        local_130 = uVar9;
        if ((&local_130 < puVar6) && (puVar7 = (undefined8 *)*param_2, puVar7 <= &local_130)) {
          if (puVar6 == (undefined8 *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_130 - (longlong)puVar7 >> 3) * 8);
          }
        }
        else {
          if (puVar6 == (undefined8 *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] = uVar9;
          }
        }
        param_2[1] = param_2[1] + 8;
        lVar18 = *(longlong *)(lVar17 + 0x18);
        if (lVar18 == 0) {
          uVar14 = *(uint *)(lVar17 + 0x20) % *(uint *)(param_1 + 0x18) + 1;
          lVar17 = (longlong)(int)uVar14 << 3;
          do {
            if (*(uint *)(param_1 + 0x18) <= uVar14) break;
            if (*(longlong *)(lVar17 + *plVar23) != 0) {
              lVar18 = *(longlong *)(lVar17 + *plVar23);
            }
            uVar14 = uVar14 + 1;
            lVar17 = lVar17 + 8;
          } while (lVar18 == 0);
        }
        goto LAB_1401928e0;
      }
    }
  }
  if ((((*(longlong *)(param_1 + 0x188) != 0) &&
       (lVar18 = *(longlong *)(*(longlong *)(param_1 + 0x188) + 0x30), lVar18 != 0)) &&
      (*(longlong *)(lVar18 + 0x2d0) != 0)) &&
     (*(int *)(*(longlong *)(lVar18 + 0x2d0) + 0x4bc) != 3)) {
    uVar16 = 0;
    if ((*(longlong *)(param_1 + 0xe8) != 0) && (*(uint *)(param_1 + 0xf0) != 0)) {
      plVar23 = *(longlong **)(param_1 + 0xe0);
      uVar20 = uVar16;
      plVar24 = plVar23;
      do {
        if (*plVar24 != 0) {
          uVar16 = plVar23[uVar20];
          break;
        }
        uVar14 = (int)uVar20 + 1;
        uVar20 = (ulonglong)uVar14;
        plVar24 = plVar24 + 1;
      } while (uVar14 < *(uint *)(param_1 + 0xf0));
    }
LAB_140192c47:
    local_178 = uVar16;
    plVar23 = local_1f8;
    if (local_178 != 0) {
      if (local_178 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_140198570(*(undefined8 *)(local_178 + 8));
      if (local_1f8 == (longlong *)0x0) {
LAB_140192e5c:
        if (local_1f8 != (longlong *)0x0) {
          if (local_1f8 == (longlong *)CONCAT44(uStack_1ec,fVar4)) {
            if (local_1f8 != (longlong *)0x0) goto LAB_140192e88;
          }
          else {
            iVar13 = DAT_140608054 + 1;
            bVar25 = DAT_140608054 == 0;
            DAT_140608054 = iVar13;
            if (bVar25) {
              FUN_140176d60(1);
            }
          }
        }
      }
      else {
        if (local_1f8 != (longlong *)CONCAT44(uStack_1ec,fVar4)) {
          iVar13 = DAT_14060804c + 1;
          bVar25 = DAT_14060804c == 0;
          DAT_14060804c = iVar13;
          if (bVar25) {
            hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                  (HANDLE)0x0);
            if (hObject != (HANDLE)0x0) {
              DVar15 = GetCurrentProcessId();
              pvVar21 = GetCurrentProcess();
              MiniDumpWriteDump(pvVar21,DVar15,hObject,2,0,0,0);
              CloseHandle(hObject);
            }
          }
          goto LAB_140192e5c;
        }
        lVar18 = *local_1f8;
        if (lVar18 == 0) goto LAB_140192e5c;
        local_e8 = *(longlong *)(lVar18 + 0x13d8);
        plVar24 = *(longlong **)(lVar18 + 0x13e0);
        if (plVar24 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar24 + 1) = (int)plVar24[1] + 1;
          UNLOCK();
        }
        local_e0 = plVar24;
        if (((local_e8 != 0) &&
            (fVar30 = param_4 + *(float *)(local_e8 + 0x150),
            fVar29 = *(float *)(local_e8 + 0x14c) - fVar4,
            fVar27 = *(float *)(local_e8 + 0x148) - fVar3,
            fVar28 = *(float *)(local_e8 + 0x144) - fVar2,
            fVar28 * fVar28 + fVar27 * fVar27 + fVar29 * fVar29 <= fVar30 * fVar30)) &&
           (lVar18 = *local_1f8, *(char *)(lVar18 + 0x2130) != '\0')) {
          plVar22 = (longlong *)param_2[1];
          local_110 = lVar18;
          if ((&local_110 < plVar22) && (plVar12 = (longlong *)*param_2, plVar12 <= &local_110)) {
            if (plVar22 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_110 - (longlong)plVar12 >> 3) * 8);
            }
          }
          else {
            if (plVar22 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar18;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
        plVar22 = local_e0;
        if (plVar24 != (longlong *)0x0) {
          LOCK();
          plVar24 = plVar24 + 1;
          *(int *)plVar24 = (int)*plVar24 + -1;
          UNLOCK();
          if ((int)*plVar24 == 0) {
            (**(code **)(*local_e0 + 8))(local_e0);
            LOCK();
            piVar1 = (int *)((longlong)plVar22 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*local_e0 + 0x10))();
            }
          }
        }
LAB_140192e88:
        LOCK();
        plVar24 = local_1f8 + 1;
        *(int *)plVar24 = (int)*plVar24 + -1;
        UNLOCK();
        if ((int)*plVar24 == 0) {
          puVar6 = (undefined8 *)*local_1f8;
          local_1f8 = (longlong *)0x0;
          if (puVar6 != (undefined8 *)0x0) {
            (**(code **)*puVar6)();
          }
          operator_delete(plVar23);
        }
      }
      uVar20 = 0;
      uVar16 = uVar20;
      if ((local_178 != 0) &&
         (uVar16 = *(ulonglong *)(local_178 + 0x10), *(ulonglong *)(local_178 + 0x10) == 0)) {
        uVar14 = *(uint *)(local_178 + 0x18) % *(uint *)(param_1 + 0xf0) + 1;
        lVar18 = (longlong)(int)uVar14 << 3;
        do {
          uVar16 = uVar20;
          if (*(uint *)(param_1 + 0xf0) <= uVar14) break;
          lVar17 = *(longlong *)(param_1 + 0xe0);
          if (*(longlong *)(lVar18 + lVar17) != 0) {
            uVar20 = *(ulonglong *)(lVar18 + lVar17);
          }
          uVar14 = uVar14 + 1;
          lVar18 = lVar18 + 8;
          uVar16 = uVar20;
        } while (uVar20 == 0);
      }
      goto LAB_140192c47;
    }
  }
  if (bVar26) {
    FUN_14034edd0(local_1e8);
  }
  return;
}



undefined8 FUN_140192f70(longlong param_1,int param_2,undefined4 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  bool bVar7;
  bool bVar8;
  bool bVar9;
  undefined8 uVar10;
  longlong local_40;
  longlong *local_30;
  longlong *local_28;
  undefined8 local_20;
  longlong *local_18;
  
  uVar10 = 0xfffffffffffffffe;
  local_40 = 0;
  bVar8 = false;
  bVar9 = false;
  plVar6 = *(longlong **)(param_1 + 0x1f8);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0x200)) {
      lVar5 = *plVar6;
      if (lVar5 != 0) {
        if (plVar6 != *(longlong **)(param_1 + 0x200)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar8 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar8) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
        bVar9 = true;
        local_40 = lVar5;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_2 != 2) {
    if (param_2 != 4) {
      if (param_2 == 0x20) {
        uVar10 = FUN_14018fd10(param_1,param_3);
        if (bVar8) {
          FUN_14034edd0(local_40);
          return uVar10;
        }
        return uVar10;
      }
      if (!bVar8) {
        return 0;
      }
      FUN_14034edd0(local_40);
      return 0;
    }
    FUN_14018fa30(param_1,&local_20,param_3,param_4,uVar10);
    uVar10 = local_20;
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar6 = local_18 + 1;
      *(int *)plVar6 = (int)*plVar6 + -1;
      UNLOCK();
      bVar8 = bVar9;
      if ((int)*plVar6 == 0) {
        (**(code **)(*local_18 + 8))(local_18);
        LOCK();
        piVar1 = (int *)((longlong)local_18 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_18 + 0x10))(local_18);
        }
      }
    }
    goto LAB_14019318a;
  }
  lVar5 = FUN_14018fbc0(param_1,param_3);
  if (lVar5 == 0) {
    if (!bVar8) {
      return 0;
    }
    FUN_14034edd0(local_40);
    return 0;
  }
  plVar6 = (longlong *)FUN_140198570(lVar5,&local_30);
  puVar3 = (undefined8 *)*plVar6;
  if (puVar3 == (undefined8 *)0x0) {
LAB_140193121:
    uVar10 = 0;
  }
  else {
    if (puVar3 != (undefined8 *)plVar6[1]) {
      iVar4 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar7) {
        FUN_140176d60(1);
      }
      goto LAB_140193121;
    }
    uVar10 = *puVar3;
  }
  plVar6 = local_30;
  if (local_30 != (longlong *)0x0) {
    if (local_30 == local_28) {
      if (local_30 != (longlong *)0x0) {
        LOCK();
        plVar2 = local_30 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        bVar8 = bVar9;
        if ((int)*plVar2 == 0) {
          local_30 = (longlong *)0x0;
          puVar3 = (undefined8 *)*plVar6;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(plVar6);
        }
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar9 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14019318a:
  if (bVar8) {
    FUN_14034edd0(local_40);
  }
  return uVar10;
}



// WARNING: Removing unreachable block (ram,0x0001401937e2)
// WARNING: Removing unreachable block (ram,0x000140193962)
// WARNING: Removing unreachable block (ram,0x000140193660)

void FUN_1401931c0(longlong param_1,ulonglong *param_2,ulonglong param_3,float *param_4,
                  float param_5)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  int iVar5;
  uint uVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  longlong *plVar11;
  float *pfVar12;
  char cVar13;
  bool bVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  longlong *local_d8;
  longlong *local_c8;
  longlong local_b8;
  longlong local_b0;
  longlong local_a8;
  longlong local_a0;
  longlong local_98;
  char local_90;
  longlong local_88;
  longlong *plStack_80;
  undefined8 local_78;
  longlong *plStack_70;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined8 uStack_60;
  undefined8 local_58;
  
  local_58 = 0xfffffffffffffffe;
  lVar8 = 0;
  local_98 = 0;
  cVar13 = '\0';
  local_90 = '\0';
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      lVar10 = *plVar1;
      if (lVar10 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x200)) {
          iVar5 = DAT_1406080a8 + 1;
          bVar14 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar5;
          if (bVar14) {
            FUN_140176d60(1);
          }
          lVar10 = 0;
        }
        local_90 = 0;
        local_98 = lVar10;
        FUN_14034ed40(lVar10);
        cVar13 = '\x01';
        local_90 = '\x01';
        lVar8 = lVar10;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar14 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  if ((param_3 & 2) != 0) {
    plVar1 = (longlong *)(param_1 + 0xe0);
    if (*(longlong *)(param_1 + 0xe8) != 0) {
      uVar7 = 0;
      if (*(uint *)(param_1 + 0xf0) != 0) {
        plVar11 = (longlong *)*plVar1;
        do {
          if (*plVar11 != 0) {
            local_d8 = (longlong *)((longlong *)*plVar1)[uVar7];
            plVar11 = local_d8;
            goto LAB_1401932f5;
          }
          uVar6 = (int)uVar7 + 1;
          uVar7 = (ulonglong)uVar6;
          plVar11 = plVar11 + 1;
        } while (uVar6 < *(uint *)(param_1 + 0xf0));
      }
    }
    local_d8 = (longlong *)0x0;
    plVar11 = local_d8;
LAB_1401932f5:
    local_c8 = plVar11;
    plVar11 = local_d8;
    lVar8 = local_98;
    cVar13 = local_90;
    if (local_c8 != (longlong *)0x0) {
      if (local_c8 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      pfVar12 = param_4;
      FUN_140198570(local_c8[1]);
      if (local_d8 == (longlong *)0x0) {
LAB_140193421:
        if (local_d8 != (longlong *)0x0) {
          if (local_d8 == plVar1) {
            if (local_d8 != (longlong *)0x0) goto LAB_14019344d;
          }
          else {
            iVar5 = DAT_140608054 + 1;
            bVar14 = DAT_140608054 == 0;
            DAT_140608054 = iVar5;
            if (bVar14) {
              FUN_140176d60(1);
            }
          }
        }
      }
      else {
        if (local_d8 != plVar1) {
          iVar5 = DAT_14060804c + 1;
          bVar14 = DAT_14060804c == 0;
          DAT_14060804c = iVar5;
          if (bVar14) {
            FUN_140176d60(1);
          }
          goto LAB_140193421;
        }
        lVar8 = *local_d8;
        if (lVar8 == 0) goto LAB_140193421;
        fVar17 = *(float *)(lVar8 + 0x180) - pfVar12[2];
        fVar15 = *(float *)(lVar8 + 0x17c) - pfVar12[1];
        fVar16 = *(float *)(lVar8 + 0x178) - *pfVar12;
        if (fVar16 * fVar16 + fVar15 * fVar15 + fVar17 * fVar17 < param_5 * param_5) {
          plVar2 = (longlong *)param_2[1];
          local_b0 = lVar8;
          if ((&local_b0 < plVar2) && (plVar3 = (longlong *)*param_2, plVar3 <= &local_b0)) {
            if (plVar2 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
              *(undefined8 *)param_2[1] =
                   *(undefined8 *)(*param_2 + ((longlong)&local_b0 - (longlong)plVar3 >> 3) * 8);
            }
          }
          else {
            if (plVar2 == (longlong *)param_2[2]) {
              FUN_140195b20(param_2);
            }
            if ((longlong *)param_2[1] != (longlong *)0x0) {
              *(longlong *)param_2[1] = lVar8;
            }
          }
          param_2[1] = param_2[1] + 8;
        }
LAB_14019344d:
        LOCK();
        plVar2 = local_d8 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          puVar4 = (undefined8 *)*local_d8;
          local_d8 = (longlong *)0x0;
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)();
          }
          operator_delete(plVar11);
        }
      }
      plVar11 = local_c8;
      if ((local_c8 != (longlong *)0x0) &&
         (plVar11 = (longlong *)local_c8[2], plVar11 == (longlong *)0x0)) {
        uVar6 = *(uint *)(local_c8 + 3) % *(uint *)(param_1 + 0xf0) + 1;
        lVar8 = (longlong)(int)uVar6 << 3;
        do {
          if (*(uint *)(param_1 + 0xf0) <= uVar6) break;
          if (*(longlong *)(lVar8 + *plVar1) != 0) {
            plVar11 = *(longlong **)(lVar8 + *plVar1);
          }
          uVar6 = uVar6 + 1;
          lVar8 = lVar8 + 8;
        } while (plVar11 == (longlong *)0x0);
      }
      goto LAB_1401932f5;
    }
  }
  if ((param_3 & 4) != 0) {
    plVar1 = (longlong *)(param_1 + 0x50);
    plStack_80 = plVar1;
    if (*(longlong *)(param_1 + 0x58) != 0) {
      uVar7 = 0;
      if (*(uint *)(param_1 + 0x60) != 0) {
        plVar11 = (longlong *)*plVar1;
        do {
          if (*plVar11 != 0) {
            local_88 = ((longlong *)*plVar1)[uVar7];
            lVar10 = local_88;
            goto LAB_140193550;
          }
          uVar6 = (int)uVar7 + 1;
          uVar7 = (ulonglong)uVar6;
          plVar11 = plVar11 + 1;
        } while (uVar6 < *(uint *)(param_1 + 0x60));
      }
    }
    local_88 = 0;
    lVar10 = local_88;
LAB_140193550:
    lVar9 = lVar10;
    if (lVar9 != 0) {
      lVar10 = *(longlong *)(lVar9 + 8);
      fVar17 = *(float *)(lVar10 + 0x178) - *param_4;
      fVar15 = *(float *)(lVar10 + 0x17c) - param_4[1];
      fVar16 = *(float *)(lVar10 + 0x180) - param_4[2];
      if (fVar17 * fVar17 + fVar15 * fVar15 + fVar16 * fVar16 < param_5 * param_5) {
        plVar11 = (longlong *)param_2[1];
        local_a8 = lVar10;
        if ((&local_a8 < plVar11) && (plVar2 = (longlong *)*param_2, plVar2 <= &local_a8)) {
          if (plVar11 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_a8 - (longlong)plVar2 >> 3) * 8);
          }
        }
        else {
          if (plVar11 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((longlong *)param_2[1] != (longlong *)0x0) {
            *(longlong *)param_2[1] = lVar10;
          }
        }
        param_2[1] = param_2[1] + 8;
      }
      lVar10 = *(longlong *)(lVar9 + 0x18);
      if (lVar10 == 0) {
        uVar6 = *(uint *)(lVar9 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
        lVar9 = (longlong)(int)uVar6 << 3;
        do {
          if (*(uint *)(param_1 + 0x60) <= uVar6) break;
          if (*(longlong *)(*plVar1 + lVar9) != 0) {
            lVar10 = *(longlong *)(*plVar1 + lVar9);
          }
          uVar6 = uVar6 + 1;
          lVar9 = lVar9 + 8;
        } while (lVar10 == 0);
      }
      goto LAB_140193550;
    }
  }
  if ((param_3 & 8) != 0) {
    plVar1 = (longlong *)(param_1 + 0x128);
    plStack_80 = plVar1;
    plStack_70 = plVar1;
    if (*(longlong *)(param_1 + 0x130) != 0) {
      uVar7 = 0;
      if (*(uint *)(param_1 + 0x138) != 0) {
        plVar11 = (longlong *)*plVar1;
        do {
          if (*plVar11 != 0) {
            local_88 = ((longlong *)*plVar1)[uVar7];
            lVar10 = local_88;
            local_78 = local_88;
            goto LAB_1401936d3;
          }
          uVar6 = (int)uVar7 + 1;
          uVar7 = (ulonglong)uVar6;
          plVar11 = plVar11 + 1;
        } while (uVar6 < *(uint *)(param_1 + 0x138));
      }
    }
    local_88 = 0;
    lVar10 = local_88;
    local_78 = local_88;
LAB_1401936d3:
    lVar9 = lVar10;
    if (lVar9 != 0) {
      lVar10 = *(longlong *)(lVar9 + 8);
      fVar17 = *(float *)(lVar10 + 0x178) - *param_4;
      fVar15 = *(float *)(lVar10 + 0x17c) - param_4[1];
      fVar16 = *(float *)(lVar10 + 0x180) - param_4[2];
      if (fVar17 * fVar17 + fVar15 * fVar15 + fVar16 * fVar16 < param_5 * param_5) {
        plVar11 = (longlong *)param_2[1];
        local_a0 = lVar10;
        if ((&local_a0 < plVar11) && (plVar2 = (longlong *)*param_2, plVar2 <= &local_a0)) {
          if (plVar11 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_a0 - (longlong)plVar2 >> 3) * 8);
          }
        }
        else {
          if (plVar11 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((longlong *)param_2[1] != (longlong *)0x0) {
            *(longlong *)param_2[1] = lVar10;
          }
        }
        param_2[1] = param_2[1] + 8;
      }
      lVar10 = *(longlong *)(lVar9 + 0x18);
      if (lVar10 == 0) {
        uVar6 = *(uint *)(lVar9 + 0x20) % *(uint *)(param_1 + 0x138) + 1;
        lVar9 = (longlong)(int)uVar6 << 3;
        do {
          if (*(uint *)(param_1 + 0x138) <= uVar6) break;
          if (*(longlong *)(*plVar1 + lVar9) != 0) {
            lVar10 = *(longlong *)(*plVar1 + lVar9);
          }
          uVar6 = uVar6 + 1;
          lVar9 = lVar9 + 8;
        } while (lVar10 == 0);
      }
      goto LAB_1401936d3;
    }
  }
  if ((param_3 & 0x20) != 0) {
    plVar1 = (longlong *)(param_1 + 8);
    if (*(longlong *)(param_1 + 0x10) != 0) {
      uVar7 = 0;
      if (*(uint *)(param_1 + 0x18) != 0) {
        plVar11 = (longlong *)*plVar1;
        do {
          if (*plVar11 != 0) {
            lVar10 = ((longlong *)*plVar1)[uVar7];
            goto LAB_14019383a;
          }
          uVar6 = (int)uVar7 + 1;
          uVar7 = (ulonglong)uVar6;
          plVar11 = plVar11 + 1;
        } while (uVar6 < *(uint *)(param_1 + 0x18));
      }
    }
    lVar10 = 0;
LAB_14019383a:
    local_78._0_4_ = (undefined4)lVar10;
    local_78._4_4_ = (undefined4)((ulonglong)lVar10 >> 0x20);
    local_68 = (undefined4)local_78;
    uStack_64 = local_78._4_4_;
    local_78 = lVar10;
    plStack_70 = plVar1;
    uStack_60 = plVar1;
LAB_140193853:
    lVar9 = lVar10;
    if (lVar9 != 0) {
      lVar10 = *(longlong *)(lVar9 + 8);
      fVar17 = *(float *)(lVar10 + 0x178) - *param_4;
      fVar15 = *(float *)(lVar10 + 0x17c) - param_4[1];
      fVar16 = *(float *)(lVar10 + 0x180) - param_4[2];
      if (fVar17 * fVar17 + fVar15 * fVar15 + fVar16 * fVar16 < param_5 * param_5) {
        plVar11 = (longlong *)param_2[1];
        local_b8 = lVar10;
        if ((&local_b8 < plVar11) && (plVar2 = (longlong *)*param_2, plVar2 <= &local_b8)) {
          if (plVar11 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
            *(undefined8 *)param_2[1] =
                 *(undefined8 *)(*param_2 + ((longlong)&local_b8 - (longlong)plVar2 >> 3) * 8);
          }
        }
        else {
          if (plVar11 == (longlong *)param_2[2]) {
            FUN_140195b20(param_2);
          }
          if ((longlong *)param_2[1] != (longlong *)0x0) {
            *(longlong *)param_2[1] = lVar10;
          }
        }
        param_2[1] = param_2[1] + 8;
      }
      lVar10 = *(longlong *)(lVar9 + 0x18);
      if (lVar10 == 0) {
        uVar6 = *(uint *)(lVar9 + 0x20) % *(uint *)(param_1 + 0x18) + 1;
        lVar9 = (longlong)(int)uVar6 << 3;
        do {
          if (*(uint *)(param_1 + 0x18) <= uVar6) break;
          if (*(longlong *)(lVar9 + *plVar1) != 0) {
            lVar10 = *(longlong *)(lVar9 + *plVar1);
          }
          uVar6 = uVar6 + 1;
          lVar9 = lVar9 + 8;
        } while (lVar10 == 0);
      }
      goto LAB_140193853;
    }
  }
  FUN_140195fa0(*param_2,param_2[1],(longlong)(param_2[1] - *param_2) >> 3);
  if (cVar13 != '\0') {
    FUN_14034edd0(lVar8);
  }
  return;
}



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

{
  float *pfVar1;
  uint7 uVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  pfVar1 = (float *)*param_1;
  fVar8 = *(float *)(param_2 + 0x17c) - pfVar1[1];
  fVar7 = *(float *)(param_3 + 0x17c) - pfVar1[1];
  fVar6 = *(float *)(param_2 + 0x178) - *pfVar1;
  fVar5 = *(float *)(param_3 + 0x178) - *pfVar1;
  fVar4 = *(float *)(param_2 + 0x180) - pfVar1[2];
  fVar3 = *(float *)(param_3 + 0x180) - pfVar1[2];
  uVar2 = (uint7)((ulonglong)pfVar1 >> 8);
  if (fVar8 * fVar8 + fVar6 * fVar6 + fVar4 * fVar4 < fVar7 * fVar7 + fVar5 * fVar5 + fVar3 * fVar3)
  {
    return CONCAT71(uVar2,1);
  }
  return (ulonglong)uVar2 << 8;
}



undefined8 * FUN_140193a50(wchar_t *param_1,undefined8 param_2,undefined4 param_3)

{
  int iVar1;
  undefined8 *puVar2;
  void *pvVar3;
  
  if (*(int *)(DAT_1406080b8 + 0x38) == 0) {
    iVar1 = _wcsicmp(param_1,L"NORMAL");
    if (iVar1 == 0) {
      pvVar3 = operator_new(0x22a8);
      if (pvVar3 == (void *)0x0) {
        puVar2 = (undefined8 *)0x0;
      }
      else {
        puVar2 = (undefined8 *)FUN_14023c570(pvVar3,param_2,param_3);
      }
    }
    else {
      iVar1 = _wcsicmp(param_1,L"BOSS");
      if (iVar1 == 0) {
        puVar2 = operator_new(0x2398);
        if (puVar2 == (undefined8 *)0x0) {
          puVar2 = (undefined8 *)0x0;
        }
        else {
          FUN_14024add0(puVar2,param_2,param_3);
          *puVar2 = MGSCharacterEnemyBoss::vftable;
        }
      }
      else {
        iVar1 = _wcsicmp(param_1,L"FIX_BOSS");
        if (iVar1 == 0) {
          puVar2 = (undefined8 *)FUN_140193c30(param_2,param_3);
        }
        else {
          iVar1 = _wcsicmp(param_1,L"ONE_SIDE");
          if (iVar1 == 0) {
            puVar2 = (undefined8 *)FUN_140193cb0(param_2,param_3);
          }
          else {
            iVar1 = _wcsicmp(param_1,L"EX_ENEMY");
            if (iVar1 == 0) {
              pvVar3 = operator_new(0x2398);
              if (pvVar3 == (void *)0x0) {
                puVar2 = (undefined8 *)0x0;
              }
              else {
                puVar2 = (undefined8 *)FUN_14024add0(pvVar3,param_2,param_3);
              }
            }
            else {
              iVar1 = _wcsicmp(param_1,L"RANGE");
              if (iVar1 == 0) {
                pvVar3 = operator_new(0x22a8);
                if (pvVar3 == (void *)0x0) {
                  puVar2 = (undefined8 *)0x0;
                }
                else {
                  puVar2 = (undefined8 *)FUN_14023c570(pvVar3,param_2,param_3);
                }
                *(undefined1 *)(puVar2 + 0x453) = 1;
              }
              else {
                pvVar3 = operator_new(0x22a8);
                if (pvVar3 == (void *)0x0) {
                  puVar2 = (undefined8 *)0x0;
                }
                else {
                  puVar2 = (undefined8 *)FUN_14023c570(pvVar3,param_2,param_3);
                }
              }
            }
          }
        }
      }
    }
  }
  else {
    puVar2 = (undefined8 *)FUN_140193d30();
  }
  return puVar2;
}



undefined8 *
FUN_140193c30(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x23c8);
  if (puVar1 != (undefined8 *)0x0) {
    FUN_14024add0(puVar1,param_1,param_2,param_4,uVar2);
    *puVar1 = MGSCharacterEnemyFixBoss::vftable;
    *(undefined4 *)(puVar1 + 0x473) = 0;
    puVar1[0x475] = 0;
    puVar1[0x476] = 0;
    puVar1[0x477] = 0;
  }
  return puVar1;
}



undefined8 *
FUN_140193cb0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x23c0);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_14024add0(puVar1,param_1,param_2,param_4,uVar2);
    *puVar1 = MGSCharacterEnemyOneSideBoss::vftable;
    puVar1[0x473] = 0;
    puVar1[0x474] = 1;
  }
  return puVar1;
}



undefined8 *
FUN_140193d30(wchar_t *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  int iVar1;
  undefined8 *puVar2;
  void *pvVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  iVar1 = _wcsicmp(param_1,L"NORMAL");
  if (iVar1 == 0) {
    puVar2 = operator_new(0x22c8);
    if (puVar2 != (undefined8 *)0x0) {
      FUN_14023c570(puVar2,param_2,param_3,param_4,uVar4);
      puVar2[0x456] = 0;
      puVar2[0x457] = 0;
      *(undefined1 *)(puVar2 + 0x458) = 0;
      *puVar2 = MGSCharacterEnemyDebugAI::vftable;
      puVar2[0x455] = MGSCharacterEnemyDebugAI::vftable;
    }
  }
  else {
    iVar1 = _wcsicmp(param_1,L"BOSS");
    if (iVar1 == 0) {
      puVar2 = (undefined8 *)FUN_140193ec0(param_2,param_3);
    }
    else {
      iVar1 = _wcsicmp(param_1,L"FIX_BOSS");
      if (iVar1 == 0) {
        puVar2 = (undefined8 *)FUN_140193f50(param_2,param_3);
      }
      else {
        iVar1 = _wcsicmp(param_1,L"ONE_SIDE");
        if (iVar1 == 0) {
          puVar2 = (undefined8 *)FUN_140194000(param_2,param_3);
        }
        else {
          iVar1 = _wcsicmp(param_1,L"EX_ENEMY");
          if (iVar1 == 0) {
            puVar2 = (undefined8 *)FUN_1401940a0(param_2,param_3);
          }
          else {
            iVar1 = _wcsicmp(param_1,L"RANGE");
            if (iVar1 == 0) {
              pvVar3 = operator_new(0x22c8);
              puVar2 = (undefined8 *)0x0;
              if (pvVar3 != (void *)0x0) {
                puVar2 = (undefined8 *)FUN_14024fb70(pvVar3,param_2,param_3);
              }
              *(undefined1 *)(puVar2 + 0x453) = 1;
            }
            else {
              pvVar3 = operator_new(0x22c8);
              puVar2 = (undefined8 *)0x0;
              if (pvVar3 != (void *)0x0) {
                puVar2 = (undefined8 *)FUN_14024fb70(pvVar3,param_2,param_3);
              }
            }
          }
        }
      }
    }
  }
  return puVar2;
}



undefined8 *
FUN_140193ec0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x23b8);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_14024add0(puVar1,param_1,param_2,param_4,uVar2);
    puVar1[0x474] = 0;
    puVar1[0x475] = 0;
    *(undefined1 *)(puVar1 + 0x476) = 0;
    *puVar1 = MGSCharacterEnemyBossDebugAI::vftable;
    puVar1[0x473] = MGSCharacterEnemyBossDebugAI::vftable;
  }
  return puVar1;
}



undefined8 *
FUN_140193f50(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x23e8);
  if (puVar1 != (undefined8 *)0x0) {
    FUN_14024add0(puVar1,param_1,param_2,param_4,uVar2);
    *(undefined4 *)(puVar1 + 0x473) = 0;
    puVar1[0x475] = 0;
    puVar1[0x476] = 0;
    puVar1[0x477] = 0;
    puVar1[0x47a] = 0;
    puVar1[0x47b] = 0;
    *(undefined1 *)(puVar1 + 0x47c) = 0;
    *puVar1 = MGSCharacterEnemyFixBossDebugAI::vftable;
    puVar1[0x479] = MGSCharacterEnemyFixBossDebugAI::vftable;
  }
  return puVar1;
}



undefined8 *
FUN_140194000(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x23e0);
  if (puVar1 != (undefined8 *)0x0) {
    FUN_14024add0(puVar1,param_1,param_2,param_4,uVar2);
    puVar1[0x473] = 0;
    puVar1[0x474] = 1;
    puVar1[0x479] = 0;
    puVar1[0x47a] = 0;
    *(undefined1 *)(puVar1 + 0x47b) = 0;
    *puVar1 = MGSCharacterEnemyOneSideDebugAI::vftable;
    puVar1[0x478] = MGSCharacterEnemyOneSideDebugAI::vftable;
  }
  return puVar1;
}



undefined8 *
FUN_1401940a0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x23b8);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_14024add0(puVar1,param_1,param_2,param_4,uVar2);
    puVar1[0x474] = 0;
    puVar1[0x475] = 0;
    *(undefined1 *)(puVar1 + 0x476) = 0;
    *puVar1 = MGSCharacterExEnemyDebugAI::vftable;
    puVar1[0x473] = MGSCharacterExEnemyDebugAI::vftable;
  }
  return puVar1;
}



void FUN_140194130(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  
  lVar5 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  lVar7 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      lVar6 = *plVar1;
      lVar7 = 0;
      if (lVar6 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x200)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar6 = lVar5,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar6);
        bVar9 = true;
        lVar7 = lVar6;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  puVar4 = (undefined4 *)*param_2;
  if (puVar4 != (undefined4 *)param_2[1]) {
    do {
      if (*(ulonglong *)(puVar4 + 8) < 8) {
        puVar3 = puVar4 + 2;
      }
      else {
        puVar3 = *(undefined4 **)(puVar4 + 2);
      }
      FUN_140194280(param_1,puVar4,*puVar4,puVar4[1],puVar3,puVar4[0xc],puVar4 + 0xd,puVar4[0x10],
                    *(undefined8 *)(puVar4 + 0x12),*(undefined1 *)(puVar4 + 0x14),
                    *(undefined1 *)((longlong)puVar4 + 0x51));
      puVar4 = puVar4 + 0x1e;
    } while (puVar4 != (undefined4 *)param_2[1]);
  }
  if (bVar9) {
    FUN_14034edd0(lVar7);
  }
  return;
}



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

longlong *
FUN_140194280(longlong param_1,longlong param_2,int param_3,int param_4,uint *param_5,uint param_6,
             undefined8 param_7,uint param_8,float *param_9,undefined1 param_10,undefined1 param_11)

{
  longlong *plVar1;
  short sVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  undefined1 uVar6;
  undefined1 uVar7;
  int iVar8;
  int iVar9;
  longlong lVar10;
  longlong *plVar11;
  int *piVar12;
  uint *puVar13;
  void *pvVar14;
  uint *puVar15;
  undefined8 uVar16;
  uint *puVar17;
  uint *puVar18;
  ulonglong uVar19;
  short *psVar20;
  int *piVar21;
  short *psVar22;
  longlong *local_d8;
  longlong *local_d0;
  short local_c8;
  undefined6 uStack_c6;
  undefined8 local_b8;
  ulonglong local_b0;
  int local_a0 [2];
  float local_98;
  float local_94;
  float local_90;
  int local_88 [2];
  float local_80;
  undefined4 local_7c;
  float local_78;
  uint *local_70;
  undefined8 local_68;
  
  local_68 = 0xfffffffffffffffe;
  if ((DAT_140607be3 == '\0') || (*(longlong *)(param_1 + 0x58) == 0)) {
    lVar10 = FUN_140302f80();
    uVar5 = param_8;
    puVar15 = (uint *)0x0;
    puVar17 = puVar15;
    if (*(longlong *)(lVar10 + 0x90) != 0) {
      for (puVar13 = *(uint **)(*(longlong *)(lVar10 + 0x90) +
                               ((ulonglong)param_8 % (ulonglong)*(uint *)(lVar10 + 0xa0)) * 8);
          (puVar17 = puVar15, puVar13 != (uint *)0x0 &&
          ((puVar13[0x24a] != param_8 || (puVar17 = puVar13, *puVar13 != param_8))));
          puVar13 = *(uint **)(puVar13 + 0x248)) {
      }
    }
    if ((puVar17 == (uint *)0x0) || (local_70 = puVar17 + 2, local_70 == (uint *)0x0)) {
      FUN_140418da0(DAT_140607fd8,L"AddCharacterEnemy fail. %d",param_8);
    }
    else {
      if (param_9 == (float *)0x0) {
        iVar8 = rand();
        iVar9 = rand();
        local_90 = (float)iVar9 * 3.0517578e-05;
        local_7c = 0;
        local_94 = 0.0;
        local_98 = (float)iVar8 * 3.0517578e-05;
        local_80 = (float)iVar8 * 3.0517578e-05;
        local_78 = local_90;
      }
      else {
        local_98 = *param_9;
        local_94 = param_9[1];
        local_90 = param_9[2];
      }
      uVar4 = param_6;
      if (*(longlong *)(param_1 + 0x50) != 0) {
        for (puVar13 = *(uint **)(*(longlong *)(param_1 + 0x50) +
                                 ((ulonglong)param_6 % (ulonglong)*(uint *)(param_1 + 0x60)) * 8);
            puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 6)) {
          if ((puVar13[8] == param_6) && (*puVar13 == param_6)) {
            if (puVar13 != (uint *)0x0) {
              return *(longlong **)(puVar13 + 2);
            }
            break;
          }
        }
      }
      local_b0 = 7;
      local_b8 = 0;
      local_c8 = 0;
      puVar13 = puVar17 + 0xe;
      if (7 < *(ulonglong *)(puVar17 + 0x14)) {
        puVar13 = *(uint **)puVar13;
      }
      puVar18 = puVar17 + 0x18;
      if (7 < *(ulonglong *)(puVar17 + 0x1e)) {
        puVar18 = *(uint **)puVar18;
      }
      plVar11 = (longlong *)FUN_140193a50(puVar18,puVar13,uVar5);
      local_d8 = plVar11;
      FUN_1401960d0(&local_d0,plVar11);
      FUN_140178e90(&local_d8,plVar11,plVar11);
      FUN_140218400(local_d8,*(undefined8 *)(param_1 + 0x188));
      if (0.0 < *(float *)(param_2 + 0x6c)) {
        *(float *)(local_d8 + 0x454) = *(float *)(param_2 + 0x6c);
      }
      if (0.0 < *(float *)(param_2 + 0x68)) {
        *(float *)((longlong)local_d8 + 0x229c) = *(float *)(param_2 + 0x68) - 1.0;
      }
      (**(code **)(*local_d8 + 0xb8))();
      (**(code **)(*local_d8 + 0x600))(local_d8,param_7);
      if (param_5 == (uint *)0x0) {
        puVar17 = puVar15;
        if ((((param_4 != 0) &&
             (lVar10 = *(longlong *)(*(longlong *)(local_d8[0x27b] + 0x10) + 0xd8), lVar10 != 0)) &&
            (param_4 = param_4 + -1, -1 < param_4)) &&
           (param_4 < (int)(*(longlong *)(lVar10 + 0x30) - *(longlong *)(lVar10 + 0x28) >> 4))) {
          puVar17 = *(uint **)(*(longlong *)(lVar10 + 0x28) + (longlong)param_4 * 0x10);
        }
        param_5 = puVar17 + 0x6e;
        if (7 < *(ulonglong *)(puVar17 + 0x74)) {
          param_5 = *(uint **)param_5;
        }
      }
      uVar19 = 0xffffffffffffffff;
      puVar17 = param_5;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        uVar3 = *puVar17;
        puVar17 = (uint *)((longlong)puVar17 + 2);
      } while ((short)uVar3 != 0);
      FUN_140001710(&local_c8,param_5,~uVar19 - 1);
      plVar11 = local_d8;
      iVar8 = *(int *)(param_1 + 0x1ec);
      if (iVar8 != 0) {
        local_a0[0] = iVar8;
        local_88[0] = 100;
        local_88[1] = 1;
        piVar21 = local_88 + 1;
        if (0 < iVar8) {
          piVar21 = local_a0;
        }
        piVar12 = local_88;
        if (*piVar21 < 0x65) {
          piVar12 = piVar21;
        }
        local_a0[0] = *piVar12;
        FUN_1402f81e0(local_d8);
        (**(code **)(*plVar11 + 0xb0))(plVar11);
      }
      psVar20 = &local_c8;
      if (7 < local_b0) {
        psVar20 = (short *)CONCAT62(uStack_c6,local_c8);
      }
      uVar19 = 0xffffffffffffffff;
      psVar22 = psVar20;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_d8 + 0x294,psVar20,~uVar19 - 1);
      plVar11 = local_d8;
      *(uint *)(local_d8 + 0x25) = uVar4;
      puVar13 = operator_new(0xa0);
      puVar17 = puVar15;
      if (puVar13 != (uint *)0x0) {
        memset(puVar13 + 2,0,0x98);
        *(undefined ***)puVar13 = AIMelee::vftable;
        puVar17 = puVar13;
      }
      (**(code **)(*plVar11 + 0xaf8))(plVar11,puVar17);
      FUN_140195d70(param_1 + 0x50,&param_6,&local_d8);
      uVar7 = param_11;
      uVar6 = param_10;
      *(undefined1 *)((longlong)local_d8 + 0x2114) = param_10;
      *(undefined1 *)((longlong)local_d8 + 0x2115) = param_11;
      if (((param_3 != -1) &&
          (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0x188) + 0x50),
          param_3 < (int)(*(longlong *)(lVar10 + 0x48) - *(longlong *)(lVar10 + 0x40) >> 4))) &&
         ((lVar10 = *(longlong *)(*(longlong *)(lVar10 + 0x40) + (longlong)param_3 * 0x10),
          lVar10 != 0 && (*(char *)(lVar10 + 0x60) == '\0')))) {
        *(int *)(lVar10 + 0x68) = *(int *)(lVar10 + 0x68) + -1;
        iVar8 = *(int *)(lVar10 + 0x68);
        if (iVar8 < 1) {
          iVar8 = 0;
        }
        *(int *)(lVar10 + 0x68) = iVar8;
      }
      (**(code **)(*local_d8 + 0x8e8))(local_d8,&local_98);
      (**(code **)(*local_d8 + 0x100))(local_d8,&local_98);
      FUN_14023d310(local_d8);
      if (0 < *(int *)(param_2 + 0x54)) {
        (**(code **)(*local_d8 + 0x240))();
        (**(code **)(*local_d8 + 0x228))(local_d8,*(undefined4 *)(param_2 + 0x54));
      }
      if (0 < *(int *)(param_2 + 0x58)) {
        (**(code **)(*local_d8 + 0x248))();
        (**(code **)(*local_d8 + 0x230))(local_d8,*(undefined4 *)(param_2 + 0x58));
      }
      if (0 < *(int *)(param_2 + 0x5c)) {
        (**(code **)(*local_d8 + 0x250))();
        (**(code **)(*local_d8 + 0x238))(local_d8,*(undefined4 *)(param_2 + 0x5c));
      }
      if (0 < *(int *)(param_2 + 0x60)) {
        (**(code **)(*local_d8 + 0x570))(local_d8,*(int *)(param_2 + 0x60),0);
      }
      *(undefined1 *)((longlong)local_d8 + 0x22a4) = *(undefined1 *)(param_1 + 0x208);
      if (local_70[0x69] == 0) {
        if (((0.0 < *(float *)(param_2 + 0x70)) || (0.0 < *(float *)(param_2 + 0x6c))) ||
           (0.0 < *(float *)(param_2 + 0x68))) {
          psVar20 = &local_c8;
          if (7 < local_b0) {
            psVar20 = (short *)CONCAT62(uStack_c6,local_c8);
          }
          FUN_140254600(local_d8,param_3,uVar5,uVar6,uVar7,psVar20,*(undefined4 *)(param_2 + 0x68),
                        *(float *)(param_2 + 0x70),*(undefined4 *)(param_2 + 0x6c),
                        *(undefined4 *)(param_1 + 0x1ec));
        }
        else if (*(int *)(param_2 + 0x54) < 1) {
          if (*(int *)(param_2 + 100) < 1) {
            psVar20 = &local_c8;
            if (7 < local_b0) {
              psVar20 = (short *)CONCAT62(uStack_c6,local_c8);
            }
            FUN_140254280(local_d8,param_3,uVar5,uVar6,uVar7,psVar20,
                          *(undefined4 *)(param_1 + 0x1ec));
          }
          else {
            psVar20 = &local_c8;
            if (7 < local_b0) {
              psVar20 = (short *)CONCAT62(uStack_c6,local_c8);
            }
            FUN_140254750(local_d8,param_3,uVar5,psVar20,*(undefined4 *)(param_1 + 0x1ec),
                          *(int *)(param_2 + 100));
          }
        }
        else {
          psVar20 = &local_c8;
          if (7 < local_b0) {
            psVar20 = (short *)CONCAT62(uStack_c6,local_c8);
          }
          FUN_1402544c0(local_d8,param_3,uVar5,uVar6,uVar7,psVar20,*(int *)(param_2 + 0x54),
                        *(undefined4 *)(param_2 + 0x58),*(undefined4 *)(param_2 + 0x5c),
                        *(undefined4 *)(param_1 + 0x1ec));
        }
        if (DAT_140607be2 != '\0') {
          FUN_1402559f0(local_d8);
        }
        plVar11 = local_d8;
        if (local_d0 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_d0 + 1;
          lVar10 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar10 == 1) {
            (**(code **)(*local_d0 + 8))(local_d0);
            LOCK();
            piVar21 = (int *)((longlong)local_d0 + 0xc);
            iVar8 = *piVar21;
            *piVar21 = *piVar21 + -1;
            UNLOCK();
            if (iVar8 == 1) {
              (**(code **)(*local_d0 + 0x10))(local_d0);
            }
          }
        }
LAB_1401948e7:
        if (local_b0 < 8) {
          return plVar11;
        }
        operator_delete((void *)CONCAT62(uStack_c6,local_c8));
        return plVar11;
      }
      *(undefined1 *)(local_d8 + 0x450) = 1;
      if (*(longlong *)(param_1 + 0x188) == 0) {
        if (local_d0 != (longlong *)0x0) {
          LOCK();
          plVar11 = local_d0 + 1;
          lVar10 = *plVar11;
          *(int *)plVar11 = (int)*plVar11 + -1;
          UNLOCK();
          if ((int)lVar10 == 1) {
            (**(code **)(*local_d0 + 8))(local_d0);
            LOCK();
            piVar21 = (int *)((longlong)local_d0 + 0xc);
            iVar8 = *piVar21;
            *piVar21 = *piVar21 + -1;
            UNLOCK();
            if (iVar8 == 1) {
              (**(code **)(*local_d0 + 0x10))(local_d0);
            }
          }
        }
      }
      else {
        lVar10 = *(longlong *)(*(longlong *)(param_1 + 0x188) + 0x30);
        if (lVar10 == 0) {
          if (local_d0 != (longlong *)0x0) {
            LOCK();
            plVar11 = local_d0 + 1;
            lVar10 = *plVar11;
            *(int *)plVar11 = (int)*plVar11 + -1;
            UNLOCK();
            if ((int)lVar10 == 1) {
              (**(code **)(*local_d0 + 8))(local_d0);
              LOCK();
              piVar21 = (int *)((longlong)local_d0 + 0xc);
              iVar8 = *piVar21;
              *piVar21 = *piVar21 + -1;
              UNLOCK();
              if (iVar8 == 1) {
                (**(code **)(*local_d0 + 0x10))(local_d0);
              }
            }
          }
        }
        else {
          if (*(longlong *)(lVar10 + 0x2d0) != 0) {
            pvVar14 = operator_new(0x240);
            if (pvVar14 != (void *)0x0) {
              puVar15 = (uint *)FUN_140250b90(pvVar14);
            }
            FUN_140250f40(puVar15,*(undefined8 *)(param_1 + 0x188));
            *(undefined8 *)(puVar15 + 0x72) =
                 *(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x188) + 0x30) + 0x2d0);
            lVar10 = FUN_140197730(*(undefined8 *)(*(longlong *)(param_1 + 0x188) + 0x30));
            *(int *)(lVar10 + 0x20) = *(int *)(lVar10 + 0x20) + 1;
            FUN_140250fd0(puVar15,local_70[0x69],*(undefined4 *)(lVar10 + 0x20),local_d8,param_3,
                          uVar6,uVar7);
            uVar16 = FUN_140197730(*(undefined8 *)(*(longlong *)(param_1 + 0x188) + 0x30));
            FUN_140253400(uVar16,puVar15);
            plVar11 = local_d8;
            if (local_d0 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_d0 + 1;
              lVar10 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)lVar10 == 1) {
                (**(code **)(*local_d0 + 8))(local_d0);
                LOCK();
                piVar21 = (int *)((longlong)local_d0 + 0xc);
                iVar8 = *piVar21;
                *piVar21 = *piVar21 + -1;
                UNLOCK();
                if (iVar8 == 1) {
                  (**(code **)(*local_d0 + 0x10))(local_d0);
                }
              }
            }
            goto LAB_1401948e7;
          }
          if (local_d0 != (longlong *)0x0) {
            LOCK();
            plVar11 = local_d0 + 1;
            lVar10 = *plVar11;
            *(int *)plVar11 = (int)*plVar11 + -1;
            UNLOCK();
            if ((int)lVar10 == 1) {
              (**(code **)(*local_d0 + 8))(local_d0);
              LOCK();
              piVar21 = (int *)((longlong)local_d0 + 0xc);
              iVar8 = *piVar21;
              *piVar21 = *piVar21 + -1;
              UNLOCK();
              if (iVar8 == 1) {
                (**(code **)(*local_d0 + 0x10))(local_d0);
              }
            }
          }
        }
      }
      if (7 < local_b0) {
        operator_delete((void *)CONCAT62(uStack_c6,local_c8));
      }
    }
  }
  return (longlong *)0x0;
}



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

void FUN_140194b60(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  void *_Dst;
  char cVar3;
  int iVar4;
  uint uVar5;
  ulonglong uVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong lVar9;
  undefined8 *puVar10;
  longlong lVar11;
  bool bVar12;
  bool bVar13;
  
  lVar11 = 0;
  bVar13 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      lVar9 = *plVar1;
      lVar11 = 0;
      if (lVar9 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x200)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar13 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar13) {
            FUN_140176d60(1);
          }
          lVar9 = 0;
        }
        FUN_14034ed40(lVar9);
        bVar13 = true;
        lVar11 = lVar9;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x58) != 0) {
    uVar6 = 0;
    if (*(uint *)(param_1 + 0x60) != 0) {
      plVar1 = *(longlong **)(param_1 + 0x50);
      plVar8 = plVar1;
      do {
        if (*plVar8 != 0) {
          lVar9 = plVar1[uVar6];
          goto LAB_140194c70;
        }
        uVar5 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar5;
        plVar8 = plVar8 + 1;
      } while (uVar5 < *(uint *)(param_1 + 0x60));
    }
  }
  lVar9 = 0;
LAB_140194c70:
  do {
    do {
      lVar7 = lVar9;
      if (lVar7 == 0) {
        lVar9 = *(longlong *)(*(longlong *)(param_1 + 0x188) + 0x50);
        puVar10 = *(undefined8 **)(lVar9 + 0x40);
        if (puVar10 != *(undefined8 **)(lVar9 + 0x48)) {
          do {
            FUN_140250a20(*puVar10);
            puVar10 = puVar10 + 2;
          } while (puVar10 != *(undefined8 **)(lVar9 + 0x48));
        }
        _Dst = *(void **)(param_1 + 0x1c8);
        if (_Dst != *(void **)(param_1 + 0x1d0)) {
          memmove(_Dst,*(void **)(param_1 + 0x1d0),0);
          *(void **)(param_1 + 0x1d0) = _Dst;
        }
        if (bVar13) {
          FUN_14034edd0(lVar11);
        }
        return;
      }
      plVar1 = *(longlong **)(lVar7 + 8);
      cVar3 = (**(code **)(*plVar1 + 0xb68))(plVar1);
      if (cVar3 == '\0') {
        (**(code **)(*plVar1 + 0x960))(plVar1);
      }
      lVar9 = *(longlong *)(lVar7 + 0x18);
    } while (lVar9 != 0);
    uVar5 = *(uint *)(lVar7 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
    lVar7 = (longlong)(int)uVar5 << 3;
    do {
      if (*(uint *)(param_1 + 0x60) <= uVar5) break;
      lVar2 = *(longlong *)(param_1 + 0x50);
      if (*(longlong *)(lVar7 + lVar2) != 0) {
        lVar9 = *(longlong *)(lVar7 + lVar2);
      }
      uVar5 = uVar5 + 1;
      lVar7 = lVar7 + 8;
    } while (lVar9 == 0);
  } while( true );
}



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

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x200)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1400d4c80(param_1 + 0x1a0,param_2,param_3,param_4,uVar8,lVar9,uVar10);
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_140194e70(longlong param_1,longlong *param_2)

{
  int *piVar1;
  uint uVar2;
  longlong *plVar3;
  bool bVar4;
  int iVar5;
  longlong lVar6;
  uint *puVar7;
  ulonglong uVar8;
  bool bVar9;
  bool bVar10;
  undefined4 local_res8 [2];
  undefined8 uVar11;
  longlong local_40;
  undefined1 local_30 [16];
  longlong *local_20;
  
  uVar11 = 0xfffffffffffffffe;
  local_40 = 0;
  bVar10 = false;
  bVar4 = false;
  plVar3 = *(longlong **)(param_1 + 0x1f8);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x200)) {
      lVar6 = *plVar3;
      if (lVar6 != 0) {
        if (plVar3 != *(longlong **)(param_1 + 0x200)) {
          iVar5 = DAT_1406080a8 + 1;
          bVar10 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar5;
          if (bVar10) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        FUN_14034ed40(lVar6);
        bVar10 = true;
        bVar4 = true;
        local_40 = lVar6;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  lVar6 = *param_2;
  uVar2 = *(uint *)(lVar6 + 0x128);
  uVar8 = (ulonglong)uVar2;
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar7 = *(uint **)(*(longlong *)(param_1 + 8) +
                            (uVar8 % (ulonglong)*(uint *)(param_1 + 0x18)) * 8);
        puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 6)) {
      if ((puVar7[8] == uVar2) && (*puVar7 == uVar2)) {
        if (puVar7 != (uint *)0x0) {
          FUN_140218400(lVar6,*(undefined8 *)(param_1 + 0x188),uVar8,lVar6,uVar11);
          goto LAB_140194fe5;
        }
        break;
      }
    }
  }
  FUN_140218400(lVar6,*(undefined8 *)(param_1 + 0x188),uVar8,lVar6,uVar11);
  local_res8[0] = *(undefined4 *)(*param_2 + 0x128);
  lVar6 = FUN_140195ef0(local_30,local_res8,param_2);
  FUN_140195d70(param_1 + 8,lVar6,lVar6 + 8);
  if (local_20 != (longlong *)0x0) {
    LOCK();
    plVar3 = local_20 + 1;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    bVar10 = bVar4;
    if ((int)*plVar3 == 0) {
      (**(code **)(*local_20 + 8))(local_20);
      LOCK();
      piVar1 = (int *)((longlong)local_20 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_20 + 0x10))(local_20);
      }
    }
  }
LAB_140194fe5:
  if (bVar10) {
    FUN_14034edd0(local_40);
  }
  return;
}



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

void FUN_140195010(longlong param_1,ulonglong param_2,undefined4 param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  int iVar5;
  uint uVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong lVar9;
  longlong *plVar10;
  bool bVar11;
  bool bVar12;
  undefined8 uVar13;
  longlong *local_68;
  longlong local_58;
  longlong *local_48;
  
  uVar13 = 0xfffffffffffffffe;
  local_58 = 0;
  bVar12 = false;
  plVar2 = *(longlong **)(param_1 + 0x1f8);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x200)) {
      lVar8 = *plVar2;
      if (lVar8 != 0) {
        if (plVar2 != *(longlong **)(param_1 + 0x200)) {
          iVar5 = DAT_1406080a8 + 1;
          bVar12 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar5;
          if (bVar12) {
            FUN_140176d60();
          }
          lVar8 = 0;
        }
        FUN_14034ed40();
        bVar12 = true;
        local_58 = lVar8;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = (longlong *)(param_1 + 0xe0);
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    uVar7 = 0;
    if (*(uint *)(param_1 + 0xf0) != 0) {
      plVar10 = (longlong *)*plVar2;
      do {
        if (*plVar10 != 0) {
          local_48 = (longlong *)((longlong *)*plVar2)[uVar7];
          plVar10 = local_48;
          goto LAB_140195115;
        }
        uVar6 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar6;
        plVar10 = plVar10 + 1;
      } while (uVar6 < *(uint *)(param_1 + 0xf0));
    }
  }
  local_48 = (longlong *)0x0;
  plVar10 = local_48;
LAB_140195115:
  local_68 = plVar10;
  plVar10 = local_48;
  uVar7 = param_2 & 0xffffffff;
  if (local_68 != (longlong *)0x0) {
    if (local_68 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    FUN_140198570(local_68[1]);
    if (local_48 != (longlong *)0x0) {
      if (local_48 == plVar2) {
        if (*local_48 != 0) {
          FUN_140236470(*local_48,uVar7 & 0xffffffff,param_3);
        }
      }
      else {
        iVar5 = DAT_14060804c + 1;
        bVar11 = DAT_14060804c == 0;
        DAT_14060804c = iVar5;
        if (bVar11) {
          FUN_140176d60(1);
        }
      }
    }
    if (local_48 != (longlong *)0x0) {
      if (local_48 == plVar2) {
        if (local_48 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_48 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_48 = (longlong *)0x0;
            puVar3 = (undefined8 *)*plVar10;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)();
            }
            operator_delete(plVar10);
          }
        }
      }
      else {
        iVar5 = DAT_140608054 + 1;
        bVar11 = DAT_140608054 == 0;
        DAT_140608054 = iVar5;
        if (bVar11) {
          FUN_140176d60(1);
        }
      }
    }
    plVar10 = local_68;
    if ((local_68 != (longlong *)0x0) &&
       (plVar10 = (longlong *)local_68[2], plVar10 == (longlong *)0x0)) {
      uVar6 = *(uint *)(local_68 + 3) % *(uint *)(param_1 + 0xf0) + 1;
      lVar8 = (longlong)(int)uVar6 << 3;
      do {
        if (*(uint *)(param_1 + 0xf0) <= uVar6) break;
        if (*(longlong *)(*plVar2 + lVar8) != 0) {
          plVar10 = *(longlong **)(*plVar2 + lVar8);
        }
        uVar6 = uVar6 + 1;
        lVar8 = lVar8 + 8;
      } while (plVar10 == (longlong *)0x0);
    }
    goto LAB_140195115;
  }
  if (*(longlong *)(param_1 + 0x58) != 0) {
    uVar7 = 0;
    if (*(uint *)(param_1 + 0x60) != 0) {
      plVar2 = *(longlong **)(param_1 + 0x50);
      plVar10 = plVar2;
      do {
        if (*plVar10 != 0) {
          lVar8 = plVar2[uVar7];
          goto LAB_140195283;
        }
        uVar6 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar6;
        plVar10 = plVar10 + 1;
      } while (uVar6 < *(uint *)(param_1 + 0x60));
    }
  }
  lVar8 = 0;
LAB_140195283:
  do {
    do {
      lVar9 = lVar8;
      if (lVar9 == 0) {
        if (bVar12) {
          FUN_14034edd0(local_58);
        }
        return;
      }
      if (*(char *)(*(longlong *)(lVar9 + 8) + 0x1868) == '\0') {
        FUN_140236470(*(longlong *)(lVar9 + 8),param_2 & 0xffffffff,param_3,param_2 & 0xffffffff,
                      uVar13);
      }
      lVar8 = *(longlong *)(lVar9 + 0x18);
    } while (lVar8 != 0);
    uVar6 = *(uint *)(lVar9 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
    lVar9 = (longlong)(int)uVar6 << 3;
    do {
      if (*(uint *)(param_1 + 0x60) <= uVar6) break;
      lVar4 = *(longlong *)(param_1 + 0x50);
      if (*(longlong *)(lVar9 + lVar4) != 0) {
        lVar8 = *(longlong *)(lVar9 + lVar4);
      }
      uVar6 = uVar6 + 1;
      lVar9 = lVar9 + 8;
    } while (lVar8 == 0);
  } while( true );
}



void FUN_140195340(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined4 local_res10 [2];
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x1f8);
  lVar5 = lVar3;
  local_res10[0] = param_2;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x200)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x200)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140195cc0(param_1 + 8,local_res10,param_3,param_4,uVar8);
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_140195410(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined4 param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  longlong *local_30;
  longlong *local_28;
  longlong local_20;
  longlong *local_18;
  
  iVar4 = (int)param_3;
  if (iVar4 == 4) {
    FUN_14018fa30(param_1,&local_20,param_4);
    if (local_20 != 0) {
      FUN_140239120(local_20,param_2);
    }
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_18 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_18 + 8))(local_18);
        LOCK();
        piVar2 = (int *)((longlong)local_18 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_18 + 0x10))(local_18);
        }
      }
    }
  }
  else if ((iVar4 == 2) || (iVar4 == 1)) {
    lVar5 = FUN_14018fbc0(param_1,param_4,param_3,param_4,0xfffffffffffffffe);
    if (lVar5 != 0) {
      FUN_140198570(lVar5,&local_30);
      plVar1 = local_30;
      if (local_30 != (longlong *)0x0) {
        if (local_30 == local_28) {
          if (*local_30 != 0) {
            FUN_140239120(*local_30,param_2);
          }
        }
        else {
          iVar4 = DAT_14060804c + 1;
          bVar6 = DAT_14060804c == 0;
          DAT_14060804c = iVar4;
          if (bVar6) {
            FUN_140176d60(1);
          }
        }
      }
      if (plVar1 != (longlong *)0x0) {
        if (plVar1 == local_28) {
          LOCK();
          plVar1 = plVar1 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            puVar3 = (undefined8 *)*local_30;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_30);
          }
        }
        else {
          iVar4 = DAT_140608054 + 1;
          bVar6 = DAT_140608054 == 0;
          DAT_140608054 = iVar4;
          if (bVar6) {
            FUN_140176d60(1);
          }
        }
      }
    }
  }
  return;
}



undefined8 FUN_140195560(longlong param_1,int param_2,undefined4 param_3)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  longlong *local_10;
  
  if (*(longlong *)(param_1 + 0x188) == 0) {
    return 0;
  }
  if (param_2 == 2) {
    lVar6 = FUN_14018fbc0(param_1,param_3);
    if (lVar6 == 0) {
      return 0;
    }
    uVar5 = FUN_140198570(lVar6,&local_28);
    uVar5 = FUN_140174f50(uVar5);
    plVar1 = local_28;
    if (local_28 != (longlong *)0x0) {
      if (local_28 == local_20) {
        if (local_28 != (longlong *)0x0) {
          LOCK();
          local_28 = local_28 + 1;
          *(int *)local_28 = (int)*local_28 + -1;
          UNLOCK();
          if ((int)*local_28 == 0) {
            local_28 = (longlong *)0x0;
            puVar3 = (undefined8 *)*plVar1;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(plVar1);
          }
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar7 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
  }
  else if (param_2 == 4) {
    FUN_14018fa30(param_1,&local_18);
    uVar5 = local_18;
    if (local_10 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_10 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_10 + 8))(local_10);
        LOCK();
        piVar2 = (int *)((longlong)local_10 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_10 + 0x10))(local_10);
        }
      }
    }
  }
  else {
    uVar5 = 0;
    if (param_2 == 0x20) {
      uVar5 = FUN_14018fd10(param_1,param_3);
    }
  }
  return uVar5;
}



undefined8 FUN_1401956a0(longlong param_1)

{
  longlong *plVar1;
  ulonglong *puVar2;
  undefined8 *puVar3;
  int iVar4;
  uint uVar5;
  longlong lVar7;
  longlong *plVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  bool bVar11;
  bool bVar12;
  ulonglong local_50;
  longlong *local_40;
  longlong *local_38;
  ulonglong uVar6;
  
  uVar10 = 0;
  local_50 = 0;
  bVar12 = false;
  puVar2 = *(ulonglong **)(param_1 + 0x1f8);
  if (puVar2 != (ulonglong *)0x0) {
    if (puVar2 == *(ulonglong **)(param_1 + 0x200)) {
      if (*puVar2 != 0) {
        local_50 = *puVar2;
        if ((puVar2 != *(ulonglong **)(param_1 + 0x200)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, local_50 = uVar10,
           DAT_1406080a8 = iVar4, bVar12)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar12 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  uVar9 = uVar10;
  if ((*(longlong *)(param_1 + 0xe8) != 0) && (*(uint *)(param_1 + 0xf0) != 0)) {
    uVar6 = uVar10;
    plVar8 = *(longlong **)(param_1 + 0xe0);
    do {
      if (*plVar8 != 0) {
        uVar9 = (*(longlong **)(param_1 + 0xe0))[uVar6];
        break;
      }
      uVar5 = (int)uVar6 + 1;
      uVar6 = (ulonglong)uVar5;
      plVar8 = plVar8 + 1;
    } while (uVar5 < *(uint *)(param_1 + 0xf0));
  }
  do {
    uVar6 = uVar9;
    plVar8 = local_40;
    if (uVar6 == 0) {
      if (bVar12) {
        FUN_14034edd0(local_50);
      }
      return 0;
    }
    FUN_140198570(*(undefined8 *)(uVar6 + 8));
    if (local_40 == (longlong *)0x0) {
LAB_1401957f0:
      if (local_40 != (longlong *)0x0) {
        if (local_40 == local_38) {
          if (local_40 != (longlong *)0x0) goto LAB_14019581c;
        }
        else {
          iVar4 = DAT_140608054 + 1;
          bVar11 = DAT_140608054 == 0;
          DAT_140608054 = iVar4;
          if (bVar11) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      if (local_40 != local_38) {
        iVar4 = DAT_14060804c + 1;
        bVar11 = DAT_14060804c == 0;
        DAT_14060804c = iVar4;
        if (bVar11) {
          FUN_140176d60(1);
        }
        goto LAB_1401957f0;
      }
      if (*local_40 == 0) goto LAB_1401957f0;
      if (*(char *)(*local_40 + 0x20e8) != '\0') {
        LOCK();
        plVar8 = local_40 + 1;
        *(int *)plVar8 = (int)*plVar8 + -1;
        UNLOCK();
        if ((int)*plVar8 == 0) {
          puVar3 = (undefined8 *)*local_40;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(local_40);
        }
        if (bVar12) {
          FUN_14034edd0(local_50);
        }
        return 1;
      }
LAB_14019581c:
      LOCK();
      plVar1 = local_40 + 1;
      lVar7 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        puVar3 = (undefined8 *)*local_40;
        local_40 = (longlong *)0x0;
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)();
        }
        operator_delete(plVar8);
      }
    }
    uVar9 = *(ulonglong *)(uVar6 + 0x10);
    if (*(ulonglong *)(uVar6 + 0x10) == 0) {
      uVar5 = *(uint *)(uVar6 + 0x18) % *(uint *)(param_1 + 0xf0) + 1;
      lVar7 = (longlong)(int)uVar5 << 3;
      uVar9 = uVar10;
      do {
        if (*(uint *)(param_1 + 0xf0) <= uVar5) break;
        if (*(longlong *)(lVar7 + *(longlong *)(param_1 + 0xe0)) != 0) {
          uVar9 = *(ulonglong *)(lVar7 + *(longlong *)(param_1 + 0xe0));
        }
        uVar5 = uVar5 + 1;
        lVar7 = lVar7 + 8;
      } while (uVar9 == 0);
    }
  } while( true );
}



void thunk_FUN_140195a40(void)

{
  FUN_140195a40();
  return;
}



undefined8 FUN_140195920(longlong *param_1)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_1[1]) {
      return CONCAT71((int7)((ulonglong)*plVar1 >> 8),*plVar1 != 0);
    }
    iVar2 = DAT_1406080a8 + 1;
    bVar3 = DAT_1406080a8 == 0;
    DAT_1406080a8 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



undefined8 FUN_140195970(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_1406080a8 + 1;
    bVar3 = DAT_1406080a8 == 0;
    DAT_1406080a8 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void FUN_1401959b0(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_140195b20(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_140195b20(param_1);
    }
    if ((undefined8 *)param_1[1] != (undefined8 *)0x0) {
      *(undefined8 *)param_1[1] = *param_2;
    }
  }
  param_1[1] = param_1[1] + 8;
  return;
}



void FUN_140195a40(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_14034edf0(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080ac + 1;
      bVar5 = DAT_1406080ac == 0;
      DAT_1406080ac = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_140195ac0(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 + 0xb;
      puVar2 = puVar2 + 0xf;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_140195b20(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_140195bb0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140195bb0(param_1,uVar2);
  }
  return;
}



void FUN_140195bb0(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_1405d3608);
      }
    }
    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;
}



undefined8 FUN_140195cc0(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[8] == uVar1) && (*puVar3 == uVar1)) {
        if (puVar4 != (uint *)0x0) {
          *(undefined8 *)(puVar4 + 6) = *(undefined8 *)(puVar3 + 6);
          FUN_1402c6e80(param_1,puVar3);
          return 1;
        }
        *(undefined8 *)(lVar2 + ((ulonglong)puVar3[8] % (ulonglong)*(uint *)(param_1 + 2)) * 8) =
             *(undefined8 *)(puVar3 + 6);
        FUN_1402c6e80(param_1,puVar3);
        return 1;
      }
      puVar4 = puVar3;
      puVar5 = *(uint **)(puVar3 + 6);
    }
  }
  return 0;
}



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

{
  uint uVar1;
  char cVar2;
  uint *puVar3;
  ulonglong uVar4;
  
  uVar1 = *param_2;
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + ((ulonglong)uVar1 % uVar4) * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 6)) {
      if ((puVar3[8] == uVar1) && (*puVar3 == uVar1)) {
        FUN_140343ec0(puVar3 + 2,param_3);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140196200(param_1,param_2,(ulonglong)uVar1 % uVar4,uVar1);
  FUN_140343ec0(puVar3 + 2,param_3);
  return puVar3;
}



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

{
  uint uVar1;
  char cVar2;
  uint *puVar3;
  ulonglong uVar4;
  
  uVar1 = *param_2;
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + ((ulonglong)uVar1 % uVar4) * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 4)) {
      if ((puVar3[6] == uVar1) && (*puVar3 == uVar1)) {
        *(undefined8 *)(puVar3 + 2) = *param_3;
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140196360(param_1,param_2,(ulonglong)uVar1 % uVar4,uVar1);
  *(undefined8 *)(puVar3 + 2) = *param_3;
  return puVar3;
}



undefined4 * FUN_140195ef0(undefined4 *param_1,undefined4 *param_2,undefined8 *param_3)

{
  longlong *plVar1;
  int *piVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong *plVar5;
  
  uVar3 = *param_2;
  uVar4 = *param_3;
  plVar5 = (longlong *)param_3[1];
  if (plVar5 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar5 + 1) = (int)plVar5[1] + 1;
    UNLOCK();
  }
  *param_1 = uVar3;
  *(undefined8 *)(param_1 + 2) = uVar4;
  *(longlong **)(param_1 + 4) = plVar5;
  if (plVar5 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar5 + 1) = (int)plVar5[1] + 1;
    UNLOCK();
    LOCK();
    plVar1 = plVar5 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*plVar5 + 8))(plVar5);
      LOCK();
      piVar2 = (int *)((longlong)plVar5 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar5 + 0x10))();
      }
    }
  }
  return param_1;
}



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

{
  longlong lVar1;
  longlong local_18;
  longlong local_10;
  
  lVar1 = param_2 - param_1;
  do {
    lVar1 = lVar1 >> 3;
    if (lVar1 < 0x21) {
LAB_140196069:
      if (1 < lVar1) {
        FUN_140196e30(param_1,param_2,param_4);
      }
      return;
    }
    if (param_3 < 1) {
      if (0x20 < lVar1) {
        if (8 < (longlong)(param_2 - param_1 & 0xfffffffffffffff8U)) {
          FUN_140196c10(param_1,param_2,param_4);
        }
        FUN_140196d90(param_1,param_2,param_4);
        return;
      }
      goto LAB_140196069;
    }
    FUN_1401964c0(&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_140195fa0(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_140195fa0(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



undefined8 * FUN_1401960d0(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;
}



undefined8 * FUN_140196140(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;
}



void FUN_1401961b0(longlong param_1)

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



void FUN_1401961d0(longlong param_1)

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



undefined4 *
FUN_140196200(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_1401962b7;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401962b7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 6);
  *puVar2 = *param_2;
  *(undefined8 *)(puVar2 + 2) = 0;
  *(undefined8 *)(puVar2 + 4) = 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_1402cddb0(param_1);
    FUN_1401dfb50(param_1,uVar4);
  }
  return puVar2;
}



undefined4 *
FUN_140196360(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_140196427;
      lVar7 = uVar6 << 5;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_140196427:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 4);
  *puVar2 = *param_2;
  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_1402cddb0(param_1);
    FUN_140253ff0(param_1,uVar4);
  }
  return puVar2;
}



ulonglong * FUN_1401964c0(ulonglong *param_1,longlong *param_2,longlong *param_3,float *param_4)

{
  float fVar1;
  float fVar2;
  float fVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  
  plVar6 = param_2 + (((longlong)param_3 - (longlong)param_2 >> 3) -
                      ((longlong)param_3 - (longlong)param_2 >> 0x3f) >> 1);
  FUN_140196b30(param_2,plVar6,param_3 + -1);
  plVar7 = plVar6 + 1;
  if (param_2 < plVar6) {
    fVar1 = *param_4;
    fVar2 = param_4[1];
    fVar3 = param_4[2];
    do {
      lVar4 = plVar6[-1];
      lVar5 = *plVar6;
      plVar9 = plVar6 + -1;
      fVar16 = *(float *)(lVar4 + 0x17c) - fVar2;
      fVar15 = *(float *)(lVar5 + 0x17c) - fVar2;
      fVar14 = *(float *)(lVar4 + 0x178) - fVar1;
      fVar13 = *(float *)(lVar5 + 0x178) - fVar1;
      fVar12 = *(float *)(lVar4 + 0x180) - fVar3;
      fVar11 = *(float *)(lVar5 + 0x180) - fVar3;
      if ((fVar16 * fVar16 + fVar14 * fVar14 + fVar12 * fVar12 <
           fVar15 * fVar15 + fVar13 * fVar13 + fVar11 * fVar11) ||
         (fVar16 = *(float *)(lVar5 + 0x178) - fVar1, fVar15 = *(float *)(lVar4 + 0x178) - fVar1,
         fVar11 = *(float *)(lVar5 + 0x17c) - fVar2, fVar12 = *(float *)(lVar4 + 0x17c) - fVar2,
         fVar13 = *(float *)(lVar5 + 0x180) - fVar3, fVar14 = *(float *)(lVar4 + 0x180) - fVar3,
         fVar16 * fVar16 + fVar11 * fVar11 + fVar13 * fVar13 <
         fVar15 * fVar15 + fVar12 * fVar12 + fVar14 * fVar14)) break;
      plVar6 = plVar9;
    } while (param_2 < plVar9);
  }
  plVar9 = plVar7;
  plVar10 = plVar6;
  if (plVar7 < param_3) {
    lVar4 = *plVar6;
    fVar1 = *param_4;
    fVar2 = param_4[1];
    fVar3 = param_4[2];
    do {
      lVar5 = *plVar7;
      fVar16 = *(float *)(lVar5 + 0x178) - fVar1;
      fVar15 = *(float *)(lVar4 + 0x17c) - fVar2;
      fVar11 = *(float *)(lVar5 + 0x17c) - fVar2;
      fVar14 = *(float *)(lVar4 + 0x178) - fVar1;
      fVar12 = *(float *)(lVar5 + 0x180) - fVar3;
      fVar13 = *(float *)(lVar4 + 0x180) - fVar3;
      plVar9 = plVar7;
      if ((fVar16 * fVar16 + fVar11 * fVar11 + fVar12 * fVar12 <
           fVar15 * fVar15 + fVar14 * fVar14 + fVar13 * fVar13) ||
         (fVar16 = *(float *)(lVar4 + 0x17c) - fVar2, fVar15 = *(float *)(lVar5 + 0x17c) - fVar2,
         fVar13 = *(float *)(lVar4 + 0x178) - fVar1, fVar14 = *(float *)(lVar5 + 0x178) - fVar1,
         fVar11 = *(float *)(lVar4 + 0x180) - fVar3, fVar12 = *(float *)(lVar5 + 0x180) - fVar3,
         fVar16 * fVar16 + fVar13 * fVar13 + fVar11 * fVar11 <
         fVar15 * fVar15 + fVar14 * fVar14 + fVar12 * fVar12)) break;
      plVar7 = plVar7 + 1;
      plVar9 = plVar7;
    } while (plVar7 < param_3);
  }
  do {
    plVar8 = plVar7;
    if (plVar7 < param_3) {
      fVar1 = *param_4;
      fVar2 = param_4[1];
      fVar3 = param_4[2];
      plVar7 = plVar9;
      do {
        lVar4 = *plVar6;
        lVar5 = *plVar8;
        fVar16 = *(float *)(lVar4 + 0x17c) - fVar2;
        fVar15 = *(float *)(lVar5 + 0x17c) - fVar2;
        fVar14 = *(float *)(lVar4 + 0x178) - fVar1;
        fVar13 = *(float *)(lVar5 + 0x178) - fVar1;
        fVar12 = *(float *)(lVar4 + 0x180) - fVar3;
        fVar11 = *(float *)(lVar5 + 0x180) - fVar3;
        plVar9 = plVar7;
        if (fVar15 * fVar15 + fVar13 * fVar13 + fVar11 * fVar11 <=
            fVar16 * fVar16 + fVar14 * fVar14 + fVar12 * fVar12) {
          fVar16 = *(float *)(lVar5 + 0x17c) - fVar2;
          fVar15 = *(float *)(lVar4 + 0x17c) - fVar2;
          fVar13 = *(float *)(lVar5 + 0x178) - fVar1;
          fVar14 = *(float *)(lVar4 + 0x178) - fVar1;
          fVar11 = *(float *)(lVar5 + 0x180) - fVar3;
          fVar12 = *(float *)(lVar4 + 0x180) - fVar3;
          if (fVar16 * fVar16 + fVar13 * fVar13 + fVar11 * fVar11 <
              fVar15 * fVar15 + fVar14 * fVar14 + fVar12 * fVar12) break;
          plVar9 = plVar7 + 1;
          lVar4 = *plVar7;
          *plVar7 = lVar5;
          *plVar8 = lVar4;
        }
        plVar8 = plVar8 + 1;
        plVar7 = plVar9;
      } while (plVar8 < param_3);
    }
    if (param_2 < plVar10) {
      fVar1 = *param_4;
      fVar2 = param_4[1];
      fVar3 = param_4[2];
      do {
        lVar4 = plVar10[-1];
        lVar5 = *plVar6;
        plVar7 = plVar10 + -1;
        fVar16 = *(float *)(lVar4 + 0x17c) - fVar2;
        fVar15 = *(float *)(lVar5 + 0x17c) - fVar2;
        fVar14 = *(float *)(lVar4 + 0x178) - fVar1;
        fVar13 = *(float *)(lVar5 + 0x178) - fVar1;
        fVar12 = *(float *)(lVar4 + 0x180) - fVar3;
        fVar11 = *(float *)(lVar5 + 0x180) - fVar3;
        if (fVar15 * fVar15 + fVar13 * fVar13 + fVar11 * fVar11 <=
            fVar16 * fVar16 + fVar14 * fVar14 + fVar12 * fVar12) {
          fVar16 = *(float *)(lVar5 + 0x17c) - fVar2;
          fVar15 = *(float *)(lVar4 + 0x17c) - fVar2;
          fVar13 = *(float *)(lVar5 + 0x178) - fVar1;
          fVar14 = *(float *)(lVar4 + 0x178) - fVar1;
          fVar11 = *(float *)(lVar5 + 0x180) - fVar3;
          fVar12 = *(float *)(lVar4 + 0x180) - fVar3;
          if (fVar16 * fVar16 + fVar13 * fVar13 + fVar11 * fVar11 <
              fVar15 * fVar15 + fVar14 * fVar14 + fVar12 * fVar12) break;
          lVar5 = plVar6[-1];
          plVar6 = plVar6 + -1;
          *plVar6 = lVar4;
          *plVar7 = lVar5;
        }
        plVar10 = plVar7;
      } while (param_2 < plVar7);
    }
    if (plVar10 == param_2) {
      if (plVar8 == param_3) {
        *param_1 = (ulonglong)plVar6;
        param_1[1] = (ulonglong)plVar9;
        return param_1;
      }
      if (plVar9 != plVar8) {
        lVar4 = *plVar6;
        *plVar6 = *plVar9;
        *plVar9 = lVar4;
      }
      lVar4 = *plVar6;
      *plVar6 = *plVar8;
      *plVar8 = lVar4;
      plVar6 = plVar6 + 1;
      plVar7 = plVar8 + 1;
      plVar9 = plVar9 + 1;
    }
    else {
      plVar10 = plVar10 + -1;
      if (plVar8 == param_3) {
        plVar6 = plVar6 + -1;
        if (plVar10 != plVar6) {
          lVar4 = *plVar10;
          *plVar10 = *plVar6;
          *plVar6 = lVar4;
        }
        lVar4 = *plVar6;
        *plVar6 = plVar9[-1];
        plVar9[-1] = lVar4;
        plVar7 = plVar8;
        plVar9 = plVar9 + -1;
      }
      else {
        lVar4 = *plVar8;
        plVar7 = plVar8 + 1;
        *plVar8 = *plVar10;
        *plVar10 = lVar4;
      }
    }
  } while( true );
}



void FUN_140196aa0(undefined8 *param_1)

{
  if (7 < (ulonglong)param_1[0x16]) {
    operator_delete((void *)param_1[0x13]);
  }
  param_1[0x16] = 7;
  param_1[0x15] = 0;
  *(undefined2 *)(param_1 + 0x13) = 0;
  FUN_1401975d0(param_1 + 0x10);
  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_140196b30(longlong param_1,longlong param_2,longlong param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = param_3 - param_1 >> 3;
  if (0x28 < lVar1) {
    lVar1 = lVar1 + 1;
    lVar2 = (longlong)(lVar1 + (ulonglong)((uint)(lVar1 >> 0x3f) & 7)) >> 3;
    lVar1 = lVar2 * 8 + param_1;
    FUN_140197030(param_1,lVar1,param_1 + lVar2 * 0x10);
    FUN_140197030(param_2 + lVar2 * -8,param_2,lVar2 * 8 + param_2,param_4);
    lVar3 = param_3 + lVar2 * -8;
    FUN_140197030(param_3 + lVar2 * -0x10,lVar3,param_3,param_4);
    FUN_140197030(lVar1,param_2,lVar3,param_4);
    return;
  }
  FUN_140197030();
  return;
}



void FUN_140196c10(longlong param_1,longlong param_2,float *param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  undefined8 local_res8;
  
  lVar9 = param_2 - param_1 >> 3;
  lVar5 = lVar9 - (param_2 - param_1 >> 0x3f) >> 1;
  if (0 < lVar5) {
    lVar10 = lVar5 * 2 + 2;
    do {
      local_res8 = *(undefined8 *)(param_1 + -8 + lVar5 * 8);
      lVar5 = lVar5 + -1;
      lVar10 = lVar10 + -2;
      lVar7 = lVar10;
      lVar6 = lVar5;
      if (lVar10 < lVar9) {
        fVar1 = *param_3;
        fVar2 = param_3[1];
        fVar3 = param_3[2];
        lVar8 = lVar5;
        do {
          lVar6 = *(longlong *)(param_1 + lVar7 * 8);
          lVar4 = *(longlong *)(param_1 + -8 + lVar7 * 8);
          fVar15 = *(float *)(lVar4 + 0x178) - fVar1;
          fVar16 = *(float *)(lVar6 + 0x178) - fVar1;
          fVar11 = *(float *)(lVar4 + 0x17c) - fVar2;
          fVar13 = *(float *)(lVar6 + 0x17c) - fVar2;
          fVar14 = *(float *)(lVar6 + 0x180) - fVar3;
          fVar12 = *(float *)(lVar4 + 0x180) - fVar3;
          lVar6 = lVar7;
          if (fVar16 * fVar16 + fVar13 * fVar13 + fVar14 * fVar14 <
              fVar15 * fVar15 + fVar11 * fVar11 + fVar12 * fVar12) {
            lVar6 = lVar7 + -1;
          }
          *(undefined8 *)(param_1 + lVar8 * 8) = *(undefined8 *)(param_1 + lVar6 * 8);
          lVar7 = lVar6 * 2 + 2;
          lVar8 = lVar6;
        } while (lVar7 < lVar9);
      }
      if (lVar7 == lVar9) {
        *(undefined8 *)(param_1 + lVar6 * 8) = *(undefined8 *)(param_1 + -8 + lVar9 * 8);
        lVar6 = lVar9 + -1;
      }
      FUN_1401971f0(param_1,lVar6,lVar5,&local_res8,param_3);
    } while (0 < lVar5);
  }
  return;
}



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

{
  undefined8 *puVar1;
  undefined8 local_res8;
  
  if (8 < (longlong)(param_2 - (longlong)param_1 & 0xfffffffffffffff8U)) {
    puVar1 = (undefined8 *)(param_2 + -8);
    do {
      local_res8 = *puVar1;
      *puVar1 = *param_1;
      FUN_1401970d0(param_1,0,(longlong)puVar1 - (longlong)param_1 >> 3,&local_res8,param_3);
      puVar1 = puVar1 + -1;
    } while (8 < (longlong)((8 - (longlong)param_1) + (longlong)puVar1 & 0xfffffffffffffff8U));
  }
  return;
}



void FUN_140196e30(longlong *param_1,longlong *param_2,float *param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong lVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  
  if ((param_1 != param_2) && (plVar7 = param_1 + 1, plVar7 != param_2)) {
    lVar8 = (longlong)plVar7 - (longlong)param_1;
    do {
      lVar4 = *plVar7;
      lVar5 = *param_1;
      fVar1 = *param_3;
      fVar2 = param_3[1];
      fVar3 = param_3[2];
      fVar11 = *(float *)(lVar5 + 0x17c) - fVar2;
      fVar13 = *(float *)(lVar4 + 0x178) - fVar1;
      fVar12 = *(float *)(lVar4 + 0x17c) - fVar2;
      fVar14 = *(float *)(lVar4 + 0x180) - fVar3;
      fVar10 = *(float *)(lVar5 + 0x178) - fVar1;
      fVar9 = *(float *)(lVar5 + 0x180) - fVar3;
      if (fVar11 * fVar11 + fVar10 * fVar10 + fVar9 * fVar9 <=
          fVar12 * fVar12 + fVar13 * fVar13 + fVar14 * fVar14) {
        plVar6 = plVar7;
        while( true ) {
          lVar5 = plVar6[-1];
          fVar11 = *(float *)(lVar5 + 0x17c) - fVar2;
          fVar10 = *(float *)(lVar5 + 0x178) - fVar1;
          fVar9 = *(float *)(lVar5 + 0x180) - fVar3;
          if (fVar11 * fVar11 + fVar10 * fVar10 + fVar9 * fVar9 <=
              fVar12 * fVar12 + fVar13 * fVar13 + fVar14 * fVar14) break;
          *plVar6 = lVar5;
          plVar6 = plVar6 + -1;
        }
        *plVar6 = lVar4;
      }
      else {
        memmove(plVar7 + (1 - (lVar8 >> 3)),param_1,(lVar8 >> 3) * 8);
        *param_1 = lVar4;
      }
      plVar7 = plVar7 + 1;
      lVar8 = lVar8 + 8;
    } while (plVar7 != param_2);
  }
  return;
}



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

{
  undefined8 uVar1;
  undefined8 uVar2;
  char cVar3;
  undefined8 local_res20;
  
  uVar1 = *param_1;
  uVar2 = *param_2;
  local_res20 = param_4;
  cVar3 = FUN_1401939c0(&local_res20,uVar2,uVar1);
  if (cVar3 != '\0') {
    *param_2 = uVar1;
    *param_1 = uVar2;
  }
  uVar1 = *param_2;
  uVar2 = *param_3;
  cVar3 = FUN_1401939c0(&local_res20,uVar2,uVar1);
  if (cVar3 != '\0') {
    *param_3 = uVar1;
    *param_2 = uVar2;
  }
  uVar1 = *param_1;
  uVar2 = *param_2;
  cVar3 = FUN_1401939c0(&local_res20,uVar2,uVar1);
  if (cVar3 != '\0') {
    *param_2 = uVar1;
    *param_1 = uVar2;
  }
  return;
}



void FUN_1401970d0(longlong param_1,longlong param_2,longlong param_3,float param_4,float *param_5)

{
  float fVar1;
  float fVar2;
  float fVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  
  lVar6 = param_2 * 2 + 2;
  lVar7 = param_2;
  if (lVar6 < param_3) {
    fVar1 = *param_5;
    fVar2 = param_5[1];
    fVar3 = param_5[2];
    lVar5 = param_2;
    do {
      lVar7 = *(longlong *)(param_1 + lVar6 * 8);
      lVar4 = *(longlong *)(param_1 + -8 + lVar6 * 8);
      fVar11 = *(float *)(lVar4 + 0x17c) - fVar2;
      fVar12 = *(float *)(lVar7 + 0x17c) - fVar2;
      fVar10 = *(float *)(lVar4 + 0x178) - fVar1;
      param_4 = *(float *)(lVar7 + 0x178) - fVar1;
      fVar9 = *(float *)(lVar7 + 0x180) - fVar3;
      fVar8 = *(float *)(lVar4 + 0x180) - fVar3;
      param_4 = param_4 * param_4;
      lVar7 = lVar6;
      if (fVar12 * fVar12 + param_4 + fVar9 * fVar9 <
          fVar11 * fVar11 + fVar10 * fVar10 + fVar8 * fVar8) {
        lVar7 = lVar6 + -1;
      }
      *(undefined8 *)(param_1 + lVar5 * 8) = *(undefined8 *)(param_1 + lVar7 * 8);
      lVar6 = lVar7 * 2 + 2;
      lVar5 = lVar7;
    } while (lVar6 < param_3);
  }
  if (lVar6 == param_3) {
    *(undefined8 *)(param_1 + lVar7 * 8) = *(undefined8 *)(param_1 + -8 + param_3 * 8);
    lVar7 = param_3 + -1;
  }
  FUN_1401971f0(param_1,lVar7,param_2,param_4,param_5);
  return;
}



void FUN_1401971f0(longlong param_1,longlong param_2,longlong param_3,longlong *param_4,
                  float *param_5)

{
  float fVar1;
  float fVar2;
  float fVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  
  if (param_2 <= param_3) {
    *(longlong *)(param_1 + param_2 * 8) = *param_4;
    return;
  }
  fVar1 = *param_5;
  fVar2 = param_5[1];
  fVar3 = param_5[2];
  do {
    lVar6 = (param_2 + -1) / 2;
    lVar4 = *(longlong *)(param_1 + lVar6 * 8);
    lVar5 = *param_4;
    fVar12 = *(float *)(lVar4 + 0x17c) - fVar2;
    fVar11 = *(float *)(lVar5 + 0x17c) - fVar2;
    fVar10 = *(float *)(lVar4 + 0x178) - fVar1;
    fVar9 = *(float *)(lVar5 + 0x178) - fVar1;
    fVar8 = *(float *)(lVar4 + 0x180) - fVar3;
    fVar7 = *(float *)(lVar5 + 0x180) - fVar3;
    if (fVar11 * fVar11 + fVar9 * fVar9 + fVar7 * fVar7 <=
        fVar12 * fVar12 + fVar10 * fVar10 + fVar8 * fVar8) goto LAB_1401972e3;
    *(longlong *)(param_1 + param_2 * 8) = lVar4;
    param_2 = lVar6;
  } while (param_3 < lVar6);
  lVar5 = *param_4;
LAB_1401972e3:
  *(longlong *)(param_1 + param_2 * 8) = lVar5;
  return;
}



void FUN_140197310(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 800)) {
    operator_delete(*(void **)(param_1 + 0x308));
  }
  *(undefined8 *)(param_1 + 800) = 7;
  *(undefined8 *)(param_1 + 0x318) = 0;
  *(undefined2 *)(param_1 + 0x308) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2e0)) {
    operator_delete(*(void **)(param_1 + 0x2c8));
  }
  *(undefined8 *)(param_1 + 0x2e0) = 7;
  *(undefined8 *)(param_1 + 0x2d8) = 0;
  *(undefined2 *)(param_1 + 0x2c8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2b8)) {
    operator_delete(*(void **)(param_1 + 0x2a0));
  }
  *(undefined8 *)(param_1 + 0x2b8) = 7;
  *(undefined8 *)(param_1 + 0x2b0) = 0;
  *(undefined2 *)(param_1 + 0x2a0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x290)) {
    operator_delete(*(void **)(param_1 + 0x278));
  }
  *(undefined8 *)(param_1 + 0x290) = 7;
  *(undefined8 *)(param_1 + 0x288) = 0;
  *(undefined2 *)(param_1 + 0x278) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x268)) {
    operator_delete(*(void **)(param_1 + 0x250));
  }
  *(undefined8 *)(param_1 + 0x268) = 7;
  *(undefined8 *)(param_1 + 0x260) = 0;
  *(undefined2 *)(param_1 + 0x250) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x240)) {
    operator_delete(*(void **)(param_1 + 0x228));
  }
  *(undefined8 *)(param_1 + 0x240) = 7;
  *(undefined8 *)(param_1 + 0x238) = 0;
  *(undefined2 *)(param_1 + 0x228) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x200)) {
    operator_delete(*(void **)(param_1 + 0x1e8));
  }
  *(undefined8 *)(param_1 + 0x200) = 7;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined2 *)(param_1 + 0x1e8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1d0)) {
    operator_delete(*(void **)(param_1 + 0x1b8));
  }
  *(undefined8 *)(param_1 + 0x1d0) = 7;
  *(undefined8 *)(param_1 + 0x1c8) = 0;
  *(undefined2 *)(param_1 + 0x1b8) = 0;
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x168),0x28,2,FUN_14023be90);
  if (7 < *(ulonglong *)(param_1 + 0x158)) {
    operator_delete(*(void **)(param_1 + 0x140));
  }
  *(undefined8 *)(param_1 + 0x158) = 7;
  *(undefined8 *)(param_1 + 0x150) = 0;
  *(undefined2 *)(param_1 + 0x140) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x130)) {
    operator_delete(*(void **)(param_1 + 0x118));
  }
  *(undefined8 *)(param_1 + 0x130) = 7;
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined2 *)(param_1 + 0x118) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xa0)) {
    operator_delete(*(void **)(param_1 + 0x88));
  }
  *(undefined8 *)(param_1 + 0xa0) = 7;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined2 *)(param_1 + 0x88) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x78)) {
    operator_delete(*(void **)(param_1 + 0x60));
  }
  *(undefined8 *)(param_1 + 0x78) = 7;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined2 *)(param_1 + 0x60) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x50)) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x50) = 7;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined2 *)(param_1 + 0x38) = 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_1401975d0(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_140197310(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080b4 + 1;
      bVar5 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void thunk_FUN_1401975d0(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_140197310(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080b4 + 1;
      bVar5 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



undefined2 * FUN_140197660(undefined2 *param_1)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x24) = 0;
  *(undefined1 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x2a) = 0;
  *(undefined1 *)(param_1 + 0x2e) = 0;
  *(undefined8 *)(param_1 + 0x34) = 0;
  *(undefined4 *)(param_1 + 0x38) = 0;
  *(undefined1 *)(param_1 + 0x3a) = 0;
  *(undefined4 *)(param_1 + 0x3c) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0x3f800000;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x54) = 0;
  *(undefined8 *)(param_1 + 0x58) = 7;
  param_1[0x4c] = 0;
  *(undefined4 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 100) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x6c) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x74) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined8 *)(param_1 + 0x7c) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x84) = 0;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0x8c) = 0;
  return param_1;
}



undefined8 FUN_140197730(longlong param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = *(undefined8 **)(param_1 + 0x290);
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == *(undefined8 **)(param_1 + 0x298)) {
      return *puVar1;
    }
    iVar2 = DAT_1406080b0 + 1;
    bVar3 = DAT_1406080b0 == 0;
    DAT_1406080b0 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



undefined1 FUN_140197780(float *param_1,float param_2)

{
  if (*param_1 * *param_1 + param_1[1] * param_1[1] + param_1[2] * param_1[2] < param_2 * param_2) {
    return 1;
  }
  return 0;
}



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

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if ((DAT_14060a120 == 0xc9) || (DAT_14060a120 == 0x65)) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a0e4 != '\0') {
      (*DAT_140607bb8)(param_1 + 0x46a,*param_2,param_3,param_4,uVar1);
    }
  }
  return;
}



void FUN_140197860(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong lVar2;
  
  lVar2 = FUN_140137690();
  if (*(longlong *)(lVar2 + 0x88) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
      if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x24) = puVar1[0x52];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x24) = 1;
  return;
}



ulonglong FUN_1401978f0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  lVar3 = *(longlong *)(param_1 + 0xa58);
  lVar4 = *(longlong *)(param_1 + 0xa50);
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return lVar3 - lVar4 >> 8 & 0xffffffff;
}



longlong FUN_1401979d0(longlong param_1,ulonglong *param_2)

{
  longlong *plVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  longlong lVar5;
  ulonglong *puVar6;
  ulonglong uVar7;
  bool bVar8;
  bool bVar9;
  
  if ((*param_2 == 0) && (param_2[1] == 0)) {
    bVar9 = false;
  }
  else {
    bVar9 = true;
  }
  if (bVar9) {
    lVar5 = 0;
    bVar9 = false;
    plVar1 = *(longlong **)(param_1 + 0xb28);
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
        lVar4 = *plVar1;
        lVar5 = 0;
        if (lVar4 != 0) {
          if (plVar1 != *(longlong **)(param_1 + 0xb30)) {
            iVar2 = DAT_1406080a8 + 1;
            bVar9 = DAT_1406080a8 == 0;
            DAT_1406080a8 = iVar2;
            if (bVar9) {
              FUN_140176d60(1);
            }
            lVar4 = 0;
          }
          FUN_14034ed40();
          bVar9 = true;
          lVar5 = lVar4;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar8 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar8) {
          FUN_140176d60();
        }
      }
    }
    uVar3 = 0;
    uVar7 = *(longlong *)(param_1 + 0xa58) - *(longlong *)(param_1 + 0xa50) >> 8;
    if (uVar7 != 0) {
      puVar6 = (ulonglong *)(*(longlong *)(param_1 + 0xa50) + 4);
      do {
        bVar8 = *puVar6 < *param_2;
        if ((*puVar6 == *param_2) && (bVar8 = puVar6[1] < param_2[1], puVar6[1] == param_2[1])) {
          iVar2 = 0;
        }
        else {
          iVar2 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
        }
        if (iVar2 == 0) {
          lVar4 = (ulonglong)uVar3 * 0x100 + *(longlong *)(param_1 + 0xa50);
          if (!bVar9) {
            return lVar4;
          }
          FUN_14034edd0(lVar5);
          return lVar4;
        }
        uVar3 = uVar3 + 1;
        puVar6 = puVar6 + 0x20;
      } while (uVar3 < uVar7);
    }
    if (bVar9) {
      FUN_14034edd0(lVar5);
    }
  }
  return 0;
}



longlong * FUN_140197b70(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x6c0);
  *param_2 = lVar1;
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



void FUN_140197b90(longlong param_1,int param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  bool bVar12;
  longlong local_res8;
  int local_res10;
  int local_res18 [2];
  int local_res20 [2];
  longlong local_70;
  longlong *local_60;
  longlong *local_58;
  
  lVar9 = 0;
  local_70 = 0;
  bVar11 = false;
  bVar12 = false;
  plVar8 = *(longlong **)(param_1 + 0xb28);
  local_res8 = param_1;
  local_res10 = param_2;
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar8 != 0) {
        local_70 = *plVar8;
        if ((plVar8 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, local_70 = lVar9,
           DAT_1406080a8 = iVar3, bVar11)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(local_70);
        bVar11 = true;
        bVar12 = true;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar8 = (longlong *)(param_1 + 0x6c0);
  plVar1 = (longlong *)*plVar8;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar1 != 0) {
        FUN_140198570(param_1,&local_60);
        plVar1 = local_60;
        if (local_60 != (longlong *)0x0) {
          if (local_60 == local_58) {
            if (*local_60 != 0) {
              FUN_1402f8580(*local_60);
              uVar6 = DAT_140608098;
              uVar4 = FUN_1402f8580(*plVar1);
              local_res18[0] = FUN_140314470(uVar6,uVar4);
              plVar7 = (longlong *)*plVar8;
              lVar5 = lVar9;
              if (plVar7 != (longlong *)0x0) {
                if (plVar7 == *(longlong **)(param_1 + 0x6c8)) {
                  lVar5 = *plVar7;
                }
                else {
                  iVar3 = DAT_140608048 + 1;
                  bVar10 = DAT_140608048 == 0;
                  DAT_140608048 = iVar3;
                  if (bVar10) {
                    FUN_140176d60(1);
                  }
                }
              }
              if (local_res18[0] < *(int *)(lVar5 + 0x50a0) + param_2) {
                lVar5 = FUN_140174f00(plVar8);
                iVar3 = local_res18[0];
                local_res20[0] = (local_res18[0] - *(int *)(lVar5 + 0x50a0)) - local_res10;
                lVar5 = FUN_140174f00(plVar8);
                FUN_14034ed40(lVar5 + 0xf630);
                if (iVar3 < 0) {
                  iVar3 = 0;
                }
                *(int *)(lVar5 + 0x50a0) = iVar3;
                FUN_14034edd0(lVar5 + 0xf630);
                lVar5 = local_res8;
                plVar7 = (longlong *)(*(longlong *)(local_res8 + 0xb50) + 0x78);
                (**(code **)(*plVar7 + 0x970))
                          (plVar7,*(undefined4 *)(local_res8 + 8),&DAT_1405d85a0,local_res18,
                           local_res20);
              }
              else {
                uVar6 = FUN_140174f00(plVar8);
                FUN_1401e80d0(uVar6,param_2);
                lVar5 = param_1;
              }
              plVar8 = (longlong *)*plVar8;
              if (plVar8 != (longlong *)0x0) {
                if (plVar8 == *(longlong **)(param_1 + 0x6c8)) {
                  lVar9 = *plVar8;
                }
                else {
                  iVar3 = DAT_140608048 + 1;
                  bVar10 = DAT_140608048 == 0;
                  DAT_140608048 = iVar3;
                  if (bVar10) {
                    FUN_140176d60(1);
                  }
                }
              }
              local_res8 = CONCAT44(local_res8._4_4_,*(undefined4 *)(lVar9 + 0x50a0));
              plVar8 = (longlong *)(*(longlong *)(lVar5 + 0xb50) + 0x78);
              (**(code **)(*plVar8 + 0x100))
                        (plVar8,*(undefined4 *)(lVar5 + 8),&DAT_1405d85a0,&local_res8);
              *(undefined4 *)(lVar5 + 0x220) = 1;
            }
          }
          else {
            iVar3 = DAT_14060804c + 1;
            bVar10 = DAT_14060804c == 0;
            DAT_14060804c = iVar3;
            if (bVar10) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == local_58) {
            LOCK();
            plVar1 = plVar1 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            bVar11 = bVar12;
            if ((int)*plVar1 == 0) {
              puVar2 = (undefined8 *)*local_60;
              if (puVar2 != (undefined8 *)0x0) {
                (**(code **)*puVar2)(puVar2,1);
              }
              operator_delete(local_60);
            }
          }
          else {
            iVar3 = DAT_140608054 + 1;
            bVar12 = DAT_140608054 == 0;
            DAT_140608054 = iVar3;
            if (bVar12) {
              FUN_140176d60(1);
            }
          }
        }
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar12 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar11) {
    FUN_14034edd0(local_70);
  }
  return;
}



void FUN_140197ef0(longlong *param_1,int param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  longlong lVar4;
  wchar_t *pwVar5;
  size_t sVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  bool bVar11;
  undefined2 local_res8 [4];
  int local_res10 [2];
  int local_res18 [4];
  undefined4 local_378;
  undefined4 uStack_374;
  undefined4 local_370;
  undefined4 uStack_36c;
  undefined **local_368;
  longlong *local_360;
  longlong *local_358;
  ulonglong local_350;
  undefined8 local_348;
  undefined4 local_338;
  undefined4 local_334;
  undefined4 local_330;
  undefined4 local_32c;
  undefined4 local_328;
  undefined4 local_324;
  undefined4 local_320;
  undefined4 local_31c;
  undefined4 local_318;
  undefined4 local_314;
  wchar_t local_310 [50];
  undefined2 local_2ac;
  wchar_t local_2aa [16];
  undefined8 local_28a;
  undefined8 local_282;
  undefined4 local_27a;
  wchar_t local_276 [16];
  undefined8 local_256;
  undefined8 local_248;
  WCHAR local_238;
  undefined1 local_236 [526];
  
  local_248 = 0xfffffffffffffffe;
  plVar7 = (longlong *)param_1[0xdc];
  if (plVar7 != (longlong *)0x0) {
    local_res10[0] = param_2;
    if (plVar7 == (longlong *)param_1[0xdd]) {
      if ((longlong *)*plVar7 != (longlong *)0x0) {
        plVar10 = (longlong *)0x0;
        plVar8 = (longlong *)*plVar7;
        if ((plVar7 != (longlong *)param_1[0xdd]) &&
           (iVar1 = DAT_14060804c + 1, bVar11 = DAT_14060804c == 0, plVar8 = plVar10,
           DAT_14060804c = iVar1, bVar11)) {
          FUN_140176d60(1);
        }
        lVar4 = (**(code **)(*plVar8 + 0x270))();
        if (*(int *)(lVar4 + 0x58) != local_res10[0]) {
          plVar7 = (longlong *)param_1[0xdc];
          plVar8 = plVar10;
          if (plVar7 != (longlong *)0x0) {
            if (plVar7 == (longlong *)param_1[0xdd]) {
              plVar8 = (longlong *)*plVar7;
            }
            else {
              iVar1 = DAT_14060804c + 1;
              bVar11 = DAT_14060804c == 0;
              DAT_14060804c = iVar1;
              if (bVar11) {
                FUN_140176d60(1);
              }
            }
          }
          uVar2 = (**(code **)(*plVar8 + 0x200))();
          plVar7 = (longlong *)param_1[0xdc];
          plVar8 = plVar10;
          if (plVar7 != (longlong *)0x0) {
            if (plVar7 == (longlong *)param_1[0xdd]) {
              plVar8 = (longlong *)*plVar7;
            }
            else {
              iVar1 = DAT_14060804c + 1;
              bVar11 = DAT_14060804c == 0;
              DAT_14060804c = iVar1;
              if (bVar11) {
                FUN_140176d60(1);
              }
            }
          }
          (**(code **)(*plVar8 + 0x208))(plVar8,local_res10[0]);
          plVar7 = (longlong *)param_1[0xdc];
          plVar8 = plVar10;
          if (plVar7 != (longlong *)0x0) {
            if (plVar7 == (longlong *)param_1[0xdd]) {
              plVar8 = (longlong *)*plVar7;
            }
            else {
              iVar1 = DAT_14060804c + 1;
              bVar11 = DAT_14060804c == 0;
              DAT_14060804c = iVar1;
              if (bVar11) {
                FUN_140176d60(1);
              }
            }
          }
          iVar1 = local_res10[0];
          lVar4 = (**(code **)(*plVar8 + 0x270))();
          *(int *)(lVar4 + 0x58) = iVar1;
          local_378 = (undefined4)param_1[0x2e];
          uStack_374 = *(undefined4 *)((longlong)param_1 + 0x174);
          local_370 = (undefined4)param_1[0x2f];
          uStack_36c = *(undefined4 *)((longlong)param_1 + 0x17c);
          iVar1 = *(int *)((longlong)param_1 + 0x284);
          local_res18[0] = local_res10[0];
          bVar11 = false;
          if ((-1 < iVar1) && (iVar1 < *(short *)(param_1[0x16a] + 700))) {
            if ((param_1[0x2e] != 0) || (param_1[0x2f] != 0)) {
              bVar11 = true;
            }
            if ((bVar11) && (lVar4 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar4 != 0)) {
              local_res8[0] = (undefined2)iVar1;
              plVar7 = (longlong *)
                       (*(longlong *)(*(longlong *)(lVar4 + 8) + (longlong)(int)param_1[0x51] * 8) +
                       0x70);
              (**(code **)(*plVar7 + 0x250))
                        (plVar7,1,&DAT_1405d85a0,local_res8,&local_378,local_res18);
            }
          }
          local_378 = (undefined4)param_1[0x2e];
          uStack_374 = *(undefined4 *)((longlong)param_1 + 0x174);
          local_370 = (undefined4)param_1[0x2f];
          uStack_36c = *(undefined4 *)((longlong)param_1 + 0x17c);
          iVar1 = *(int *)((longlong)param_1 + 0x284);
          plVar7 = param_1 + 1;
          local_res18[0] = (int)*plVar7;
          if (((-1 < iVar1) && (iVar1 < *(short *)(param_1[0x16a] + 700))) &&
             (lVar4 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar4 != 0)) {
            local_res8[0] = (undefined2)iVar1;
            plVar8 = (longlong *)
                     (*(longlong *)(*(longlong *)(lVar4 + 8) + (longlong)(int)param_1[0x51] * 8) +
                     0x70);
            (**(code **)(*plVar8 + 0xe0))(plVar8,1,&DAT_1405d85a0,local_res8,local_res18,&local_378)
            ;
          }
          (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x570))
                    ((longlong *)(param_1[0x16a] + 0x78),(int)*plVar7,&DAT_1405d85a0,local_res10);
          local_2ac = 0;
          local_28a = 0;
          local_282 = 0;
          local_27a = 0;
          local_256 = 0;
          memset(local_310,0,100);
          local_2aa[0] = L'\0';
          local_2aa[1] = L'\0';
          local_2aa[2] = L'\0';
          local_2aa[3] = L'\0';
          local_2aa[4] = L'\0';
          local_2aa[5] = L'\0';
          local_2aa[6] = L'\0';
          local_2aa[7] = L'\0';
          local_2aa[8] = L'\0';
          local_2aa[9] = L'\0';
          local_2aa[10] = L'\0';
          local_2aa[0xb] = L'\0';
          local_2aa[0xc] = L'\0';
          local_2aa[0xd] = L'\0';
          local_2aa[0xe] = L'\0';
          local_2aa[0xf] = L'\0';
          local_276[0] = L'\0';
          local_276[1] = L'\0';
          local_276[2] = L'\0';
          local_276[3] = L'\0';
          local_276[4] = L'\0';
          local_276[5] = L'\0';
          local_276[6] = L'\0';
          local_276[7] = L'\0';
          local_276[8] = L'\0';
          local_276[9] = L'\0';
          local_276[10] = L'\0';
          local_276[0xb] = L'\0';
          local_276[0xc] = L'\0';
          local_276[0xd] = L'\0';
          local_276[0xe] = L'\0';
          local_276[0xf] = L'\0';
          local_338 = 0x1f7;
          local_334 = *(undefined4 *)(DAT_140608000 + 0x140);
          local_330 = (undefined4)param_1[0x2c];
          local_32c = *(undefined4 *)((longlong)param_1 + 0x164);
          local_328 = (undefined4)param_1[0x2d];
          local_324 = *(undefined4 *)((longlong)param_1 + 0x16c);
          local_320 = (undefined4)param_1[0x2e];
          local_31c = *(undefined4 *)((longlong)param_1 + 0x174);
          local_318 = (undefined4)param_1[0x2f];
          local_314 = *(undefined4 *)((longlong)param_1 + 0x17c);
          uVar3 = FUN_1401a64a0(param_1);
          local_28a = CONCAT44(local_28a._4_4_,uVar3);
          uVar3 = FUN_1401a6390(param_1);
          local_28a = CONCAT44(uVar3,(undefined4)local_28a);
          uVar3 = FUN_1401a6310(param_1);
          local_282 = CONCAT44(local_282._4_4_,uVar3);
          local_27a = FUN_1401978f0(param_1);
          local_256 = CONCAT44(local_256._4_4_,uVar2);
          uVar2 = FUN_1401a6310(param_1);
          local_256 = CONCAT44(uVar2,(undefined4)local_256);
          local_2ac = (**(code **)(*param_1 + 0x18))(param_1);
          plVar8 = (longlong *)param_1[0xdc];
          plVar9 = plVar10;
          if (plVar8 != (longlong *)0x0) {
            if (plVar8 == (longlong *)param_1[0xdd]) {
              plVar9 = (longlong *)*plVar8;
            }
            else {
              iVar1 = DAT_14060804c + 1;
              bVar11 = DAT_14060804c == 0;
              DAT_14060804c = iVar1;
              if (bVar11) {
                FUN_140176d60(1);
              }
            }
          }
          lVar4 = (**(code **)(*plVar9 + 0x270))();
          local_282 = CONCAT44(*(undefined4 *)(lVar4 + 0xc4),(undefined4)local_282);
          pwVar5 = (wchar_t *)FUN_1401a6410(param_1);
          sVar6 = wcsnlen(pwVar5,0x10);
          if (sVar6 < 0x10) {
            pwVar5 = (wchar_t *)FUN_1401a6410(param_1);
            wcscpy_s(local_2aa,0x10,pwVar5);
            pwVar5 = (wchar_t *)FUN_1401a6410(param_1);
            wcscpy_s(local_276,0x10,pwVar5);
          }
          local_238 = L'\0';
          memset(local_236,0,0x206);
          MultiByteToWideChar(0,1,(LPCSTR)(param_1 + 0x66),0x32,&local_238,0x32);
          sVar6 = wcsnlen(&local_238,0x10);
          if (sVar6 < 0x10) {
            wcscpy_s(local_310,0x32,&local_238);
          }
          iVar1 = *(int *)((longlong)param_1 + 0x284);
          if (((-1 < iVar1) && (iVar1 < *(short *)(param_1[0x16a] + 700))) &&
             (lVar4 = *(longlong *)(param_1[0x16a] + 0x4c8), lVar4 != 0)) {
            local_res8[0] = (undefined2)iVar1;
            plVar8 = (longlong *)
                     (*(longlong *)(*(longlong *)(lVar4 + 8) + (longlong)(int)param_1[0x51] * 8) +
                     0x70);
            (**(code **)(*plVar8 + 0xc70))(plVar8,1,&DAT_1405d85a0,local_res8,&local_338);
          }
          local_368 = Proud::CFastArray<>::vftable;
          local_360 = (longlong *)0x0;
          local_358 = (longlong *)0x0;
          local_350 = 0;
          local_348 = 0;
          plVar8 = (longlong *)param_1[0xdc];
          plVar9 = plVar10;
          if (plVar8 != (longlong *)0x0) {
            if (plVar8 == (longlong *)param_1[0xdd]) {
              plVar9 = (longlong *)*plVar8;
            }
            else {
              iVar1 = DAT_14060804c + 1;
              bVar11 = DAT_14060804c == 0;
              DAT_14060804c = iVar1;
              if (bVar11) {
                FUN_140176d60(1);
              }
            }
          }
          iVar1 = (**(code **)(*plVar9 + 0xae8))(plVar9,&local_368);
          if (0 < iVar1) {
            plVar8 = local_358;
            if ((int)local_350 == 0) {
              plVar8 = plVar10;
            }
            (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xca8))
                      ((longlong *)(param_1[0x16a] + 0x78),plVar8,local_350 & 0xffffffff,
                       &DAT_1405d85a0,plVar7,local_res10);
          }
          local_368 = Proud::CFastArray<>::vftable;
          if (local_358 != (longlong *)0x0) {
            if (local_360 == (longlong *)0x0) {
              FUN_14034ff60();
            }
            else {
              (**(code **)(*local_360 + 0x18))(local_360,local_358);
            }
          }
        }
      }
    }
    else {
      iVar1 = DAT_14060804c + 1;
      bVar11 = DAT_14060804c == 0;
      DAT_14060804c = iVar1;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



longlong * FUN_140198570(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x6e0);
  *param_2 = lVar1;
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  uVar11 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        uVar11 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar7 = DAT_140608048 == 0, lVar4 = lVar6,
           DAT_140608048 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_1401e9e80(lVar4,param_2,param_3,param_4,uVar9,lVar10,uVar11);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  uVar11 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        uVar11 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar7 = DAT_140608048 == 0, lVar4 = lVar6,
           DAT_140608048 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_1401ea2f0(lVar4,param_2,param_3,param_4,uVar9,lVar10,uVar11);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



undefined4 FUN_140198870(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  uVar11 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        uVar11 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar7 = DAT_140608048 == 0, lVar4 = lVar6,
           DAT_140608048 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_1401ebc50(lVar4,param_1,param_2,param_3,0xfffffffa,0x19e,7,param_4,uVar9,lVar10,
                              uVar11);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



undefined4 FUN_140198a10(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  lVar6 = 0;
  lVar4 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar7 = DAT_140608048 == 0, lVar4 = lVar6,
           DAT_140608048 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_1401ea470(lVar4,param_1,param_2,param_3,param_4);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



void FUN_140198b90(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9b0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9b8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9b8)) &&
           (iVar2 = DAT_1406080cc + 1, bVar6 = DAT_1406080cc == 0, lVar3 = lVar5,
           DAT_1406080cc = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_14025f3c0(lVar3,param_2,param_3,param_4,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080cc + 1;
      bVar6 = DAT_1406080cc == 0;
      DAT_1406080cc = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



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

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar5 = 0;
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9a0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9a8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9a8)) &&
           (iVar2 = DAT_1406080c8 + 1, bVar6 = DAT_1406080c8 == 0, lVar3 = lVar5,
           DAT_1406080c8 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_14025d3b0(lVar3,param_2,*(undefined8 *)(param_1 + 0xb50),param_1,param_1 + 0x170,param_3
                      ,param_4,param_5,param_6);
        goto LAB_140198e8f;
      }
    }
    else {
      iVar2 = DAT_1406080c8 + 1;
      bVar6 = DAT_1406080c8 == 0;
      DAT_1406080c8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
LAB_140198e8f:
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return param_2;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  uVar11 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        uVar11 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9a0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9a8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9a8)) &&
           (iVar2 = DAT_1406080c8 + 1, bVar7 = DAT_1406080c8 == 0, lVar4 = lVar6,
           DAT_1406080c8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_14025d5e0(lVar4,param_2,param_3,param_4,uVar9,lVar10,uVar11);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_1406080c8 + 1;
      bVar7 = DAT_1406080c8 == 0;
      DAT_1406080c8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



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

{
  undefined4 uVar1;
  longlong *plVar2;
  int iVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined4 local_res8 [2];
  undefined4 local_1b8 [2];
  longlong local_1b0;
  undefined1 local_1a8;
  undefined8 local_1a0;
  undefined1 local_198 [28];
  short local_17c;
  undefined4 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  local_1a0 = 0xfffffffffffffffe;
  lVar6 = 0;
  local_1b0 = 0;
  bVar9 = false;
  local_1a8 = 0;
  plVar5 = *(longlong **)(param_1 + 0xb28);
  if (plVar5 != (longlong *)0x0) {
    if (plVar5 == *(longlong **)(param_1 + 0xb30)) {
      lVar7 = *plVar5;
      lVar6 = 0;
      if (lVar7 != 0) {
        if (plVar5 != *(longlong **)(param_1 + 0xb30)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar9 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar9) {
            FUN_140176d60(1);
          }
          lVar7 = 0;
        }
        local_1a8 = 0;
        local_1b0 = lVar7;
        FUN_14034ed40(lVar7);
        bVar9 = true;
        local_1a8 = 1;
        lVar6 = lVar7;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar5 = *(longlong **)(param_1 + 0x6c0);
  if (plVar5 == (longlong *)0x0) goto LAB_14019939e;
  if (plVar5 == *(longlong **)(param_1 + 0x6c8)) {
    lVar7 = *plVar5;
    if ((lVar7 == 0) || (plVar2 = *(longlong **)(param_1 + 0x9b0), plVar2 == (longlong *)0x0))
    goto LAB_14019939e;
    if (plVar2 == *(longlong **)(param_1 + 0x9b8)) {
      if (*plVar2 != 0) {
        if (plVar5 != *(longlong **)(param_1 + 0x6c8)) {
          iVar3 = DAT_140608048 + 1;
          bVar8 = DAT_140608048 == 0;
          DAT_140608048 = iVar3;
          if (bVar8) {
            FUN_140176d60(1);
          }
          lVar7 = 0;
        }
        if ((*param_2 < 0) || (iVar3 = FUN_1401ed380(lVar7,param_4,param_2,param_3), iVar3 == 0)) {
          local_res8[0] = 0x17;
          local_1b8[0] = 0x2b11;
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar5 + 0x70))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1b8,local_res8);
        }
        else {
          FUN_14000a170(local_198);
          local_f0 = 0;
          uVar4 = FUN_140174f00(param_1 + 0x6c0);
          if ((*param_2 < 0) || (iVar3 = FUN_1401ecce0(uVar4,param_2,param_3,local_198), iVar3 == 0)
             ) {
            local_res8[0] = 0x15;
            local_1b8[0] = 0x2b11;
            plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar5 + 0x70))
                      (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1b8,local_res8);
          }
          else {
            if (*param_6 <= (int)local_17c) {
              FUN_14000a170(local_e8);
              local_40 = 0;
              iVar3 = *param_7;
              uVar4 = FUN_1401de990(param_1 + 0x9b0);
              if ((-1 < iVar3) &&
                 (iVar3 = FUN_140260310(uVar4,param_1,local_198,param_5,param_6,local_e8,iVar3),
                 iVar3 != 0)) {
                uVar1 = *param_5;
                uVar4 = FUN_140174f00(param_1 + 0x6c0);
                if (-1 < *param_2) {
                  FUN_1401eed30(uVar4,param_1,param_2,param_3,param_6,local_e8,uVar1);
                }
              }
              if (bVar9) {
                FUN_14034edd0(lVar6);
              }
              return 1;
            }
            local_res8[0] = 0x18;
            local_1b8[0] = 0x2b11;
            plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar5 + 0x70))
                      (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1b8,local_res8);
          }
        }
      }
      goto LAB_14019939e;
    }
    iVar3 = DAT_1406080cc;
    DAT_1406080cc = DAT_1406080cc + 1;
  }
  else {
    iVar3 = DAT_140608048;
    DAT_140608048 = DAT_140608048 + 1;
  }
  if (iVar3 == 0) {
    FUN_140176d60(1);
  }
LAB_14019939e:
  if (bVar9) {
    FUN_14034edd0(lVar6);
  }
  return 0;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  uVar11 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        uVar11 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9b0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9b8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9b8)) &&
           (iVar2 = DAT_1406080cc + 1, bVar7 = DAT_1406080cc == 0, lVar4 = lVar6,
           DAT_1406080cc = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_140261f20(lVar4,param_1,param_2,param_3,param_4,&param_5,param_6,param_7,uVar9,
                              lVar10,uVar11);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_1406080cc + 1;
      bVar7 = DAT_1406080cc == 0;
      DAT_1406080cc = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined4 local_res18 [2];
  
  lVar6 = 0;
  lVar4 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  local_res18[0] = param_3;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9b0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9b8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9b8)) &&
           (iVar2 = DAT_1406080cc + 1, bVar7 = DAT_1406080cc == 0, lVar4 = lVar6,
           DAT_1406080cc = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_140262100(lVar4,param_1,local_res18,param_2,param_4);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_1406080cc + 1;
      bVar7 = DAT_1406080cc == 0;
      DAT_1406080cc = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



bool FUN_140199700(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar5 = 0;
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar1 != 0) {
        lVar3 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar6 = DAT_140608048 == 0, lVar3 = lVar5,
           DAT_140608048 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        bVar6 = param_2 <= *(int *)(lVar3 + 0x50a0);
        if (!bVar7) {
          return bVar6;
        }
        FUN_14034edd0(lVar4);
        return bVar6;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar6 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return false;
}



// WARNING: Removing unreachable block (ram,0x000140199a26)
// WARNING: Removing unreachable block (ram,0x0001401999bd)

undefined8 FUN_140199850(longlong param_1,uint param_2)

{
  undefined8 *puVar1;
  int iVar2;
  longlong *plVar3;
  undefined8 uVar4;
  uint *puVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  undefined4 *puVar11;
  bool bVar12;
  bool bVar13;
  undefined4 local_res8 [2];
  undefined4 *local_80;
  undefined4 *local_78;
  undefined8 local_70;
  undefined4 *local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  puVar9 = (undefined4 *)0x0;
  puVar7 = (undefined4 *)0x0;
  bVar13 = false;
  puVar1 = *(undefined8 **)(param_1 + 0xb28);
  puVar8 = puVar9;
  if (puVar1 != (undefined8 *)0x0) {
    puVar8 = puVar7;
    if (puVar1 == *(undefined8 **)(param_1 + 0xb30)) {
      if ((undefined4 *)*puVar1 != (undefined4 *)0x0) {
        puVar8 = (undefined4 *)*puVar1;
        if ((puVar1 != *(undefined8 **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar13 = DAT_1406080a8 == 0, puVar8 = puVar9,
           DAT_1406080a8 = iVar2, bVar13)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(puVar8);
        bVar13 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  plVar3 = *(longlong **)(param_1 + 0x6c0);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar3 != 0) {
        local_80 = (undefined4 *)0x0;
        local_78 = (undefined4 *)0x0;
        local_70 = 0;
        local_60 = (undefined4 *)0x0;
        local_58 = 0;
        local_50 = 0;
        plVar3 = (longlong *)FUN_1402e8ff0();
        puVar7 = puVar9;
        puVar10 = puVar9;
        if (*plVar3 != 0) {
          for (puVar5 = *(uint **)(*plVar3 +
                                  ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
              puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0x24)) {
            if ((puVar5[0x26] == param_2) && (*puVar5 == param_2)) {
              puVar7 = (undefined4 *)0x0;
              puVar10 = (undefined4 *)0x0;
              if (puVar5 != (uint *)0x0) {
                FUN_14012bb70(&local_80);
                puVar7 = local_78;
                puVar10 = local_80;
              }
              break;
            }
          }
        }
        plVar3 = (longlong *)FUN_1402e8ff0();
        puVar11 = puVar9;
        if (*plVar3 != 0) {
          for (puVar5 = *(uint **)(*plVar3 +
                                  ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
              puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0x24)) {
            if ((puVar5[0x26] == param_2) && (*puVar5 == param_2)) {
              puVar11 = (undefined4 *)0x0;
              if (puVar5 != (uint *)0x0) {
                FUN_14012bb70(&local_60,puVar5 + 0x10);
                puVar11 = local_60;
              }
              break;
            }
          }
        }
        puVar7 = (undefined4 *)((longlong)puVar7 - (longlong)puVar10 >> 2);
        if (puVar7 != (undefined4 *)0x0) {
          puVar6 = puVar10;
          do {
            uVar4 = FUN_140137690();
            local_res8[0] = FUN_140136b30(uVar4,*puVar6);
            puVar1 = *(undefined8 **)(param_1 + 0x6c0);
            if (puVar1 == (undefined8 *)0x0) {
LAB_140199ab2:
              uVar4 = 0;
            }
            else {
              if (puVar1 != *(undefined8 **)(param_1 + 0x6c8)) {
                iVar2 = DAT_140608048 + 1;
                bVar12 = DAT_140608048 == 0;
                DAT_140608048 = iVar2;
                if (bVar12) {
                  FUN_140176d60(1);
                }
                goto LAB_140199ab2;
              }
              uVar4 = *puVar1;
            }
            iVar2 = FUN_1401eceb0(uVar4,local_res8,*puVar6);
            if (iVar2 < *(int *)((longlong)puVar6 + ((longlong)puVar11 - (longlong)puVar10))) {
              if (puVar11 != (undefined4 *)0x0) {
                operator_delete(puVar11);
              }
              if (puVar10 != (undefined4 *)0x0) {
                operator_delete(puVar10);
              }
              goto LAB_140199b2f;
            }
            puVar9 = (undefined4 *)(ulonglong)((int)puVar9 + 1);
            puVar6 = puVar6 + 1;
          } while (puVar9 < puVar7);
        }
        if (puVar11 != (undefined4 *)0x0) {
          operator_delete(puVar11);
        }
        if (puVar10 != (undefined4 *)0x0) {
          operator_delete(puVar10);
        }
        if (bVar13) {
          FUN_14034edd0(puVar8);
        }
        return 1;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar12 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
LAB_140199b2f:
  if (bVar13) {
    FUN_14034edd0(puVar8);
  }
  return 0;
}



bool FUN_140199b60(longlong param_1,uint param_2)

{
  uint *puVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *plVar6;
  uint uVar7;
  bool bVar8;
  
  plVar6 = *(longlong **)(param_1 + 0x6e0);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0x6e8)) {
      if (*plVar6 != 0) {
        plVar4 = (longlong *)FUN_1402e8ff0();
        plVar6 = (longlong *)0x0;
        if (*plVar4 != 0) {
          for (puVar1 = *(uint **)(*plVar4 +
                                  ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
              puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x24)) {
            if ((puVar1[0x26] == param_2) && (*puVar1 == param_2)) {
              if (puVar1 != (uint *)0x0) {
                uVar7 = puVar1[7];
                goto LAB_140199bfa;
              }
              break;
            }
          }
        }
        uVar7 = 0;
LAB_140199bfa:
        puVar2 = *(undefined8 **)(param_1 + 0x6e0);
        if (puVar2 != (undefined8 *)0x0) {
          if (puVar2 == *(undefined8 **)(param_1 + 0x6e8)) {
            plVar6 = (longlong *)*puVar2;
          }
          else {
            iVar3 = DAT_14060804c + 1;
            bVar8 = DAT_14060804c == 0;
            DAT_14060804c = iVar3;
            if (bVar8) {
              FUN_140176d60(1);
            }
          }
        }
        lVar5 = (**(code **)(*plVar6 + 0x270))();
        if (lVar5 == 0) {
          return false;
        }
        return (int)uVar7 <= *(int *)(lVar5 + 8);
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  return false;
}



bool FUN_140199c80(longlong param_1,uint param_2)

{
  uint *puVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *plVar6;
  uint uVar7;
  bool bVar8;
  
  plVar6 = *(longlong **)(param_1 + 0x6e0);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0x6e8)) {
      if (*plVar6 != 0) {
        plVar4 = (longlong *)FUN_1402e8ff0();
        plVar6 = (longlong *)0x0;
        if (*plVar4 != 0) {
          for (puVar1 = *(uint **)(*plVar4 +
                                  ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
              puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x24)) {
            if ((puVar1[0x26] == param_2) && (*puVar1 == param_2)) {
              if (puVar1 != (uint *)0x0) {
                uVar7 = puVar1[7];
                goto LAB_140199d1a;
              }
              break;
            }
          }
        }
        uVar7 = 0;
LAB_140199d1a:
        puVar2 = *(undefined8 **)(param_1 + 0x6e0);
        if (puVar2 != (undefined8 *)0x0) {
          if (puVar2 == *(undefined8 **)(param_1 + 0x6e8)) {
            plVar6 = (longlong *)*puVar2;
          }
          else {
            iVar3 = DAT_14060804c + 1;
            bVar8 = DAT_14060804c == 0;
            DAT_14060804c = iVar3;
            if (bVar8) {
              FUN_140176d60(1);
            }
          }
        }
        lVar5 = (**(code **)(*plVar6 + 0x270))();
        if (lVar5 == 0) {
          return false;
        }
        return (int)uVar7 <= *(int *)(lVar5 + 0x10);
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  return false;
}



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

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar6 = DAT_140608048 == 0, lVar3 = lVar5,
           DAT_140608048 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_1401e8ba0(lVar3,param_2,param_3,param_4,uVar8,lVar9,uVar10);
        goto LAB_140199efe;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar6 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
LAB_140199efe:
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return param_2;
}



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

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar6 = DAT_140608048 == 0, lVar3 = lVar5,
           DAT_140608048 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_1401e8710(lVar3,param_2,param_3,param_4,uVar8,lVar9,uVar10);
        goto LAB_14019a08e;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar6 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
LAB_14019a08e:
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return param_2;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      if ((*plVar1 != 0) && (plVar1 = *(longlong **)(param_1 + 0x9b0), plVar1 != (longlong *)0x0)) {
        if (plVar1 != *(longlong **)(param_1 + 0x9b8)) {
          iVar2 = DAT_1406080cc;
          DAT_1406080cc = DAT_1406080cc + 1;
          goto LAB_14019a2b2;
        }
        lVar4 = *plVar1;
        if (lVar4 != 0) {
          iVar2 = *param_3;
          if (((iVar2 == 0xb) || (iVar2 == 0xc)) || (iVar2 == 0xd)) {
            if ((plVar1 != *(longlong **)(param_1 + 0x9b8)) &&
               (iVar2 = DAT_1406080cc + 1, bVar7 = DAT_1406080cc == 0, lVar4 = lVar6,
               DAT_1406080cc = iVar2, bVar7)) {
              FUN_140176d60(1);
            }
            FUN_140262e60(lVar4,param_2,param_4,param_5,param_6,param_7,*param_3);
          }
          else {
            uVar3 = FUN_140174f00();
            FUN_1401e9160(uVar3,param_2,param_1,param_3,param_4,param_5,param_6,param_7,uVar9,lVar10
                         );
          }
          goto LAB_14019a2e0;
        }
      }
    }
    else {
      iVar2 = DAT_140608048;
      DAT_140608048 = DAT_140608048 + 1;
LAB_14019a2b2:
      if (iVar2 == 0) {
        FUN_140176d60(1);
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
LAB_14019a2e0:
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return param_2;
}



undefined4 FUN_14019a310(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  uVar11 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        uVar11 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar7 = DAT_140608048 == 0, lVar4 = lVar6,
           DAT_140608048 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_1401e95b0(lVar4,param_1,param_2,param_3,uVar9,lVar10,uVar11);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  lVar6 = 0;
  lVar4 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar2 = DAT_140608048 + 1, bVar7 = DAT_140608048 == 0, lVar4 = lVar6,
           DAT_140608048 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        uVar3 = FUN_1401e9d60(lVar4,param_1,param_2,param_3,param_4);
        if (!bVar8) {
          return uVar3;
        }
        FUN_14034edd0(lVar5);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



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

{
  bool bVar1;
  undefined4 *puVar2;
  int iVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  bool bVar9;
  bool bVar10;
  undefined4 local_res8 [2];
  int *local_res10;
  undefined4 *local_res18;
  undefined8 local_res20;
  undefined4 *puVar11;
  int *piVar13;
  undefined4 local_1c8 [2];
  longlong local_1c0;
  undefined1 local_1b8;
  undefined8 local_1b0;
  longlong local_1a8;
  longlong local_1a0;
  int local_190;
  short local_18c;
  undefined4 local_100;
  undefined1 local_f8 [28];
  short local_dc;
  undefined4 local_50;
  undefined4 uVar12;
  undefined4 uVar14;
  
  local_1b0 = 0xfffffffffffffffe;
  lVar8 = 0;
  bVar1 = false;
  lVar6 = 0;
  local_1c0 = 0;
  bVar10 = false;
  local_1b8 = 0;
  plVar5 = *(longlong **)(param_1 + 0xb28);
  lVar7 = lVar8;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  if (plVar5 != (longlong *)0x0) {
    lVar7 = lVar6;
    if (plVar5 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar5 != 0) {
        lVar7 = *plVar5;
        if ((plVar5 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar7 = lVar8,
           DAT_1406080a8 = iVar3, bVar10)) {
          FUN_140176d60(1);
        }
        local_1b8 = 0;
        local_1c0 = lVar7;
        FUN_14034ed40(lVar7);
        bVar10 = true;
        local_1b8 = 1;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  plVar5 = *(longlong **)(param_1 + 0x6c0);
  if (plVar5 == (longlong *)0x0) goto LAB_14019a9c4;
  if (plVar5 == *(longlong **)(param_1 + 0x6c8)) {
    if ((*plVar5 == 0) || (plVar5 = *(longlong **)(param_1 + 0x9b0), plVar5 == (longlong *)0x0))
    goto LAB_14019a9c4;
    if (plVar5 == *(longlong **)(param_1 + 0x9b8)) {
      if (*plVar5 != 0) {
        lVar6 = *plVar5;
        if ((plVar5 != *(longlong **)(param_1 + 0x9b8)) &&
           (iVar3 = DAT_1406080cc + 1, bVar9 = DAT_1406080cc == 0, lVar6 = lVar8,
           DAT_1406080cc = iVar3, bVar9)) {
          FUN_140176d60(1);
        }
        iVar3 = FUN_14025f890(lVar6,local_res20,param_5,*param_7);
        if (iVar3 == 0) {
          local_res8[0] = 0x17;
          local_1c8[0] = 0x2b0f;
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar5 + 0x70))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1c8,local_res8);
        }
        else {
          FUN_14000a170(local_f8);
          local_50 = 0;
          uVar4 = FUN_1401de990(param_1 + 0x9b0);
          iVar3 = FUN_14025f970(uVar4,param_5,local_f8,*param_7);
          if (iVar3 == 0) {
            local_res8[0] = 0x16;
            local_1c8[0] = 0x2b0f;
            plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar5 + 0x70))
                      (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1c8,local_res8);
          }
          else {
            if (*param_6 <= (int)local_dc) {
              FUN_14000a170(&local_1a8);
              local_100 = 0;
              uVar4 = FUN_140174f00(param_1 + 0x6c0);
              puVar2 = local_res18;
              if (-1 < *local_res10) {
                puVar11 = local_res18;
                piVar13 = param_6;
                iVar3 = FUN_1401efb60(uVar4,param_1,local_f8,local_res10,local_res18,param_6,
                                      &local_1a8);
                uVar12 = (undefined4)((ulonglong)puVar11 >> 0x20);
                uVar14 = (undefined4)((ulonglong)piVar13 >> 0x20);
                if (iVar3 != 0) {
                  if ((local_1a8 != 0) || (local_1a0 != 0)) {
                    bVar1 = true;
                  }
                  if (((bVar1) || (local_190 != 0)) || (0 < local_18c)) {
                    uVar4 = FUN_1401de990(param_1 + 0x9b0);
                    FUN_14025fcd0(uVar4,param_1,local_res20,&local_1a8,param_5,
                                  CONCAT44(uVar14,*param_7));
                  }
                  else {
                    uVar4 = FUN_1401de990(param_1 + 0x9b0);
                    FUN_140260090(uVar4,param_1,param_5,param_6,CONCAT44(uVar12,*puVar2),
                                  CONCAT44(uVar14,*param_7));
                  }
                }
              }
              if (bVar10) {
                FUN_14034edd0(lVar7);
              }
              return 1;
            }
            local_res8[0] = 0x18;
            local_1c8[0] = 0x2b0f;
            plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar5 + 0x70))
                      (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1c8,local_res8);
          }
        }
      }
      goto LAB_14019a9c4;
    }
    iVar3 = DAT_1406080cc;
    DAT_1406080cc = DAT_1406080cc + 1;
  }
  else {
    iVar3 = DAT_140608048;
    DAT_140608048 = DAT_140608048 + 1;
  }
  if (iVar3 == 0) {
    FUN_140176d60(1);
  }
LAB_14019a9c4:
  if (bVar10) {
    FUN_14034edd0(lVar7);
  }
  return 0;
}



// WARNING: Type propagation algorithm not settling

undefined8
FUN_14019a9f0(longlong param_1,uint *param_2,ulonglong *param_3,int *param_4,undefined4 *param_5,
             int *param_6)

{
  undefined4 uVar1;
  int iVar2;
  undefined8 uVar3;
  int *piVar4;
  longlong *plVar5;
  longlong lVar6;
  uint *puVar7;
  longlong *plVar8;
  longlong lVar9;
  undefined4 uVar10;
  int iVar11;
  bool bVar12;
  bool bVar13;
  uint local_res8 [2];
  uint *local_res10;
  undefined8 in_stack_fffffffffffffdd8;
  undefined4 uVar14;
  undefined8 in_stack_fffffffffffffde0;
  ulonglong *puVar15;
  undefined4 *puVar16;
  uint uVar17;
  longlong *in_stack_fffffffffffffde8;
  undefined4 uVar18;
  undefined4 *in_stack_fffffffffffffdf0;
  undefined4 uVar19;
  undefined8 in_stack_fffffffffffffdf8;
  uint uVar20;
  undefined4 local_1f8 [2];
  longlong local_1f0;
  undefined4 local_1e8;
  undefined4 local_1e4;
  undefined4 local_1e0;
  undefined4 local_1dc;
  undefined8 local_1d8;
  undefined4 local_1d0;
  undefined4 local_1cc;
  longlong local_1c8;
  undefined1 local_1c0;
  ulonglong local_1b8;
  ulonglong local_1b0;
  short local_1a4;
  undefined2 local_1a2;
  int local_1a0;
  short local_19c;
  int local_150;
  undefined4 local_110;
  undefined8 local_108;
  longlong local_f8;
  longlong local_f0;
  int local_e0;
  short local_dc;
  int local_90;
  undefined4 local_50;
  
  uVar20 = (uint)((ulonglong)in_stack_fffffffffffffdf8 >> 0x20);
  uVar17 = (uint)((ulonglong)in_stack_fffffffffffffde0 >> 0x20);
  uVar14 = (undefined4)((ulonglong)in_stack_fffffffffffffdd8 >> 0x20);
  local_108 = 0xfffffffffffffffe;
  lVar9 = 0;
  local_1c8 = 0;
  bVar13 = false;
  local_1c0 = 0;
  plVar5 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  if (plVar5 != (longlong *)0x0) {
    if (plVar5 == *(longlong **)(param_1 + 0xb30)) {
      lVar6 = *plVar5;
      lVar9 = 0;
      if (lVar6 != 0) {
        if (plVar5 != *(longlong **)(param_1 + 0xb30)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar13 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar13) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        local_1c0 = 0;
        local_1c8 = lVar6;
        FUN_14034ed40(lVar6);
        bVar13 = true;
        local_1c0 = 1;
        lVar9 = lVar6;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  plVar5 = *(longlong **)(param_1 + 0x6d0);
  if (plVar5 == (longlong *)0x0) goto LAB_14019b2a6;
  if (plVar5 == *(longlong **)(param_1 + 0x6d8)) {
    if ((*plVar5 == 0) || (plVar8 = *(longlong **)(param_1 + 0x6c0), plVar8 == (longlong *)0x0))
    goto LAB_14019b2a6;
    if (plVar8 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar8 != 0) {
        FUN_14000a170(&local_1b8);
        local_110 = 0;
        if (plVar5 == *(longlong **)(param_1 + 0x6d8)) {
          local_1f0 = *plVar5;
        }
        else {
          iVar2 = DAT_1406080c4 + 1;
          bVar12 = DAT_1406080c4 == 0;
          DAT_1406080c4 = iVar2;
          if (bVar12) {
            FUN_140176d60(1);
          }
          local_1f0 = 0;
        }
        local_res8[0] = *local_res10;
        lVar6 = local_1f0 + 0x818;
        FUN_14034ed40(lVar6);
        if (local_res8[0] < 0xc) {
          FUN_140090020(&local_1b8,(longlong)(int)local_res8[0] * 0xac + 8 + local_1f0);
          FUN_14034edd0(lVar6);
          bVar12 = local_1b8 < *param_3;
          if ((local_1b8 == *param_3) && (bVar12 = local_1b0 < param_3[1], local_1b0 == param_3[1]))
          {
            iVar2 = 0;
          }
          else {
            iVar2 = (1 - (uint)bVar12) - (uint)(bVar12 != 0);
          }
          if (iVar2 == 0) {
            *param_6 = local_1a0;
            FUN_14000a170(&local_f8);
            local_50 = 0;
            if (*param_4 == 5) {
              uVar3 = FUN_140174f00(param_1 + 0x6c0);
              iVar2 = FUN_1401ecc20(uVar3,param_5,&local_f8);
            }
            else {
              uVar3 = FUN_140174f00(param_1 + 0x6c0);
              if (*param_4 < 0) goto LAB_14019b2a6;
              iVar2 = FUN_1401ecce0(uVar3,param_4,param_5,&local_f8);
            }
            if (iVar2 != 0) {
              local_1f8[0] = 0;
              uVar10 = 0;
              piVar4 = (int *)FUN_1401de890(param_1 + 0x6d0);
              uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffdf0 >> 0x20);
              iVar2 = *piVar4;
              if (iVar2 == 1) {
                local_1f8[0] = 0x1b;
                uVar10 = 0x5b;
              }
              else if (iVar2 == 3) {
                local_1f8[0] = 0x1a;
                uVar10 = 0x29;
              }
              else if (iVar2 == 2) {
                local_1f8[0] = 0x19;
                uVar10 = 0x2a;
              }
              else if (iVar2 == 6) {
                local_1f8[0] = 0x1d;
                uVar10 = 0x26;
              }
              else if (iVar2 == 7) {
                local_1f8[0] = 0x1e;
                uVar10 = 0x56;
              }
              else if (iVar2 == 8) {
                local_1f8[0] = 0x20;
                uVar10 = 0x58;
              }
              if ((local_f8 == 0) && (local_f0 == 0)) {
                bVar12 = false;
              }
              else {
                bVar12 = true;
              }
              if (((bVar12) || (local_e0 != 0)) || (0 < local_dc)) {
                uVar3 = FUN_140137690();
                local_res8[0] = FUN_140136a70(uVar3,local_1a0);
                uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
                if (((int)local_res8[0] < 2) || (local_1a0 != local_e0)) {
                  lVar6 = FUN_140174f00(param_1 + 0x6c0);
                  uVar1 = *(undefined4 *)(lVar6 + 0x50a0);
                  lVar6 = FUN_140174f00(param_1 + 0x6c0);
                  FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_f8,0x191,
                                CONCAT44(uVar14,uVar10),(ulonglong)uVar17 << 0x20,
                                CONCAT44(uVar18,*(undefined4 *)(lVar6 + 0x50a0)),
                                CONCAT44(uVar19,uVar1),(ulonglong)uVar20 << 0x20,0);
                  goto LAB_14019b2a6;
                }
                local_1f0 = CONCAT44(local_1f0._4_4_,(int)(short)(local_dc + local_19c));
                puVar7 = local_res8;
                if ((int)(short)(local_dc + local_19c) <= (int)local_res8[0]) {
                  puVar7 = (uint *)&local_1f0;
                }
                local_dc = (short)*puVar7;
                if (*param_4 == 5) {
                  uVar3 = FUN_140174f00(param_1 + 0x6c0);
                  FUN_1401ed120(uVar3,param_5,&local_f8);
                }
                else {
                  uVar3 = FUN_140174f00(param_1 + 0x6c0);
                  if (-1 < *param_4) {
                    FUN_1401ed220(uVar3,param_4,param_5,&local_f8,CONCAT44(uVar14,6));
                  }
                  local_1e8 = *(undefined4 *)(param_1 + 0x160);
                  local_1e4 = *(undefined4 *)(param_1 + 0x164);
                  local_1e0 = *(undefined4 *)(param_1 + 0x168);
                  local_1dc = *(undefined4 *)(param_1 + 0x16c);
                  local_1d8._0_4_ = *(undefined4 *)(param_1 + 0x170);
                  local_1d8._4_4_ = *(undefined4 *)(param_1 + 0x174);
                  local_1d0 = *(undefined4 *)(param_1 + 0x178);
                  local_1cc = *(undefined4 *)(param_1 + 0x17c);
                  iVar2 = *(int *)(param_1 + 0x284);
                  if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                     && (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0))
                  {
                    local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                    plVar5 = (longlong *)
                             (*(longlong *)
                               (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                             + 0x70);
                    in_stack_fffffffffffffde8 = &local_f8;
                    (**(code **)(*plVar5 + 0x140))
                              (plVar5,1,&DAT_1405d85a0,local_res8,&local_1d8,&local_1e8,
                               in_stack_fffffffffffffde8);
                  }
                }
                iVar2 = (int)local_dc;
                uVar3 = FUN_140174f00(param_1 + 0x6c0);
                FUN_1401f3b10(uVar3,*param_4,iVar2 * local_90);
                local_1f0 = CONCAT62(local_1f0._2_6_,(short)*param_4);
                plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                plVar5 = &local_f8;
                local_res8[0]._0_2_ = *(undefined2 *)param_5;
                (**(code **)(*plVar8 + 0xe0))
                          (plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1f0,local_res8,
                           plVar5);
                uVar14 = (undefined4)((ulonglong)plVar5 >> 0x20);
                uVar3 = FUN_1401de890(param_1 + 0x6d0);
                FUN_1401e6630(uVar3,*local_res10,param_1);
                FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c8,0x34,param_1,&local_f8,
                              CONCAT44(uVar14,(int)local_19c),
                              (ulonglong)in_stack_fffffffffffffde8 & 0xffffffff00000000,
                              CONCAT44(uVar19,(int)local_dc - (int)local_19c),
                              CONCAT44(uVar20,(int)local_dc));
              }
              else {
                local_1a4 = (short)*param_4;
                local_1a2 = *(undefined2 *)param_5;
                if (*param_4 == 5) {
                  uVar3 = FUN_140174f00(param_1 + 0x6c0);
                  plVar5 = (longlong *)FUN_1401e8a50(uVar3,&local_1e8,&local_1b8,*param_5);
                  if ((*plVar5 == 0) && (plVar5[1] == 0)) {
                    bVar12 = false;
                  }
                  else {
                    bVar12 = true;
                  }
                  if (!bVar12) goto LAB_14019b2a6;
                }
                else {
                  uVar3 = FUN_140174f00(param_1 + 0x6c0);
                  FUN_1401e8cc0(uVar3,param_4,param_5,&local_1b8);
                }
                iVar11 = (int)local_19c;
                iVar2 = (int)local_1a4;
                uVar3 = FUN_140174f00(param_1 + 0x6c0);
                FUN_1401f3b10(uVar3,iVar2,iVar11 * local_150);
                local_1f0 = CONCAT62(local_1f0._2_6_,(short)*param_4);
                plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                puVar15 = &local_1b8;
                local_res8[0]._0_2_ = *(undefined2 *)param_5;
                (**(code **)(*plVar5 + 0xe0))
                          (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1f0,local_res8,
                           puVar15);
                uVar14 = (undefined4)((ulonglong)puVar15 >> 0x20);
                local_1d8._0_4_ = *(undefined4 *)(param_1 + 0x160);
                local_1d8._4_4_ = *(undefined4 *)(param_1 + 0x164);
                local_1d0 = *(undefined4 *)(param_1 + 0x168);
                local_1cc = *(undefined4 *)(param_1 + 0x16c);
                local_1e8 = *(undefined4 *)(param_1 + 0x170);
                local_1e4 = *(undefined4 *)(param_1 + 0x174);
                local_1e0 = *(undefined4 *)(param_1 + 0x178);
                local_1dc = *(undefined4 *)(param_1 + 0x17c);
                iVar2 = *(int *)(param_1 + 0x284);
                local_1f0 = CONCAT44(local_1f0._4_4_,*(undefined4 *)(param_1 + 8));
                if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                  if ((local_1b8 == 0) && (local_1b0 == 0)) {
                    bVar12 = false;
                  }
                  else {
                    bVar12 = true;
                  }
                  if (((bVar12) && (local_1a0 != 0)) &&
                     (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0)) {
                    local_res8[0]._0_2_ = (undefined2)iVar2;
                    plVar5 = (longlong *)
                             (*(longlong *)
                               (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                             + 0x70);
                    puVar15 = &local_1b8;
                    in_stack_fffffffffffffdf0 = local_1f8;
                    in_stack_fffffffffffffde8 = &local_1d8;
                    puVar16 = &local_1e8;
                    (**(code **)(*plVar5 + 0xb0))
                              (plVar5,1,&DAT_1405d85a0,local_res8,&local_1f0,puVar16,
                               in_stack_fffffffffffffde8,in_stack_fffffffffffffdf0,puVar15);
                    uVar14 = (undefined4)((ulonglong)puVar16 >> 0x20);
                    uVar20 = (uint)((ulonglong)puVar15 >> 0x20);
                  }
                }
                uVar3 = FUN_1401de890(param_1 + 0x6d0);
                FUN_1401e6630(uVar3,*local_res10,param_1);
                FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c8,0x34,param_1,&local_1b8,
                              CONCAT44(uVar14,(int)local_19c),
                              (ulonglong)in_stack_fffffffffffffde8 & 0xffffffff00000000,
                              (ulonglong)in_stack_fffffffffffffdf0 & 0xffffffff00000000,
                              CONCAT44(uVar20,(int)local_19c));
              }
              if (bVar13) {
                FUN_14034edd0(lVar9);
              }
              return 1;
            }
          }
        }
        else {
          FUN_14034edd0(lVar6);
        }
      }
      goto LAB_14019b2a6;
    }
    iVar2 = DAT_140608048;
    DAT_140608048 = DAT_140608048 + 1;
  }
  else {
    iVar2 = DAT_1406080c4;
    DAT_1406080c4 = DAT_1406080c4 + 1;
  }
  if (iVar2 == 0) {
    FUN_140176d60(1);
  }
LAB_14019b2a6:
  if (bVar13) {
    FUN_14034edd0(lVar9);
  }
  return 0;
}



undefined8
FUN_14019b2d0(longlong param_1,int *param_2,undefined8 param_3,undefined8 param_4,undefined8 param_5
             ,int *param_6)

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined4 local_res8 [2];
  undefined4 local_f8 [2];
  longlong local_f0;
  undefined1 local_e8;
  undefined8 local_e0;
  undefined1 local_d8 [28];
  short local_bc;
  undefined4 local_30;
  
  local_e0 = 0xfffffffffffffffe;
  lVar5 = 0;
  local_f0 = 0;
  bVar8 = false;
  local_e8 = 0;
  plVar4 = *(longlong **)(param_1 + 0xb28);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0xb30)) {
      lVar6 = *plVar4;
      lVar5 = 0;
      if (lVar6 != 0) {
        if (plVar4 != *(longlong **)(param_1 + 0xb30)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar8 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar8) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        local_e8 = 0;
        local_f0 = lVar6;
        FUN_14034ed40(lVar6);
        bVar8 = true;
        local_e8 = 1;
        lVar5 = lVar6;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar4 = *(longlong **)(param_1 + 0x9e0);
  if (plVar4 == (longlong *)0x0) goto LAB_14019b5e8;
  if (plVar4 == *(longlong **)(param_1 + 0x9e8)) {
    lVar6 = *plVar4;
    if ((lVar6 == 0) || (plVar1 = *(longlong **)(param_1 + 0x6c0), plVar1 == (longlong *)0x0))
    goto LAB_14019b5e8;
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar1 != 0) {
        if (plVar4 != *(longlong **)(param_1 + 0x9e8)) {
          iVar2 = DAT_1406080d8 + 1;
          bVar7 = DAT_1406080d8 == 0;
          DAT_1406080d8 = iVar2;
          if (bVar7) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        iVar2 = FUN_140263220(lVar6,param_4,param_5);
        if (iVar2 == 0) {
          local_res8[0] = 0x17;
          local_f8[0] = 0x2b0e;
          plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar4 + 0x70))
                    (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,local_res8);
        }
        else {
          FUN_14000a170(local_d8);
          local_30 = 0;
          uVar3 = FUN_1401dea70(param_1 + 0x9e0);
          iVar2 = FUN_140263160(uVar3,param_5,local_d8);
          if (iVar2 == 0) {
            local_res8[0] = 0x16;
            local_f8[0] = 0x2b0e;
            plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar4 + 0x70))
                      (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,local_res8);
          }
          else {
            if (*param_6 <= (int)local_bc) {
              uVar3 = FUN_140174f00(param_1 + 0x6c0);
              if ((-1 < *param_2) &&
                 (iVar2 = FUN_1401f0750(uVar3,param_1,local_d8,param_2,param_3,param_6,6,0),
                 iVar2 != 0)) {
                uVar3 = FUN_1401dea70(param_1 + 0x9e0);
                FUN_1402632f0(uVar3,param_1,param_5,param_6);
              }
              if (bVar8) {
                FUN_14034edd0(lVar5);
              }
              return 1;
            }
            local_res8[0] = 0x18;
            local_f8[0] = 0x2b0e;
            plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar4 + 0x70))
                      (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,local_res8);
          }
        }
      }
      goto LAB_14019b5e8;
    }
    iVar2 = DAT_140608048;
    DAT_140608048 = DAT_140608048 + 1;
  }
  else {
    iVar2 = DAT_1406080d8;
    DAT_1406080d8 = DAT_1406080d8 + 1;
  }
  if (iVar2 == 0) {
    FUN_140176d60(1);
  }
LAB_14019b5e8:
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return 0;
}



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

{
  undefined4 uVar1;
  int iVar2;
  void *pvVar3;
  undefined4 *puVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  undefined4 uVar8;
  undefined8 uVar9;
  longlong lVar10;
  longlong *plVar11;
  longlong *plVar12;
  longlong *plVar13;
  ulonglong uVar14;
  bool bVar15;
  bool bVar16;
  undefined4 local_res8 [2];
  int *local_res10;
  undefined4 *local_res18;
  undefined8 in_stack_fffffffffffffeb8;
  undefined4 *puVar17;
  undefined8 in_stack_fffffffffffffec0;
  undefined4 uVar19;
  int *piVar18;
  longlong local_128;
  longlong *local_118;
  longlong *local_110;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined8 local_f8;
  undefined1 local_e8 [24];
  uint local_d0;
  short local_cc;
  undefined4 local_40;
  
  uVar8 = (undefined4)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20);
  uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  local_f8 = 0xfffffffffffffffe;
  local_128 = 0;
  bVar16 = false;
  plVar12 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  local_res18 = param_3;
  if (plVar12 != (longlong *)0x0) {
    if (plVar12 == *(longlong **)(param_1 + 0xb30)) {
      lVar10 = *plVar12;
      if (lVar10 != 0) {
        if (plVar12 != *(longlong **)(param_1 + 0xb30)) {
          iVar6 = DAT_1406080a8 + 1;
          bVar16 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar6;
          if (bVar16) {
            FUN_140176d60();
          }
          lVar10 = 0;
        }
        FUN_14034ed40();
        bVar16 = true;
        local_128 = lVar10;
      }
    }
    else {
      iVar6 = DAT_1406080a8 + 1;
      bVar15 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar6;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  iVar6 = param_7;
  local_118 = (longlong *)0x0;
  if (param_7 == 1) {
    plVar12 = *(longlong **)(param_1 + 0x9f0);
  }
  else {
    plVar12 = *(longlong **)(param_1 + 0x9d0);
  }
  if (plVar12 != (longlong *)0x0) {
    plVar13 = plVar12 + 1;
    LOCK();
    *(int *)plVar13 = (int)*plVar13 + 1;
    UNLOCK();
    local_118 = plVar12;
    local_110 = plVar12;
    if ((*plVar12 != 0) && (plVar11 = *(longlong **)(param_1 + 0x6c0), plVar11 != (longlong *)0x0))
    {
      if (plVar11 == *(longlong **)(param_1 + 0x6c8)) {
        if (*plVar11 != 0) {
          iVar7 = FUN_140263770(*plVar12,param_4,param_5);
          if (iVar7 == 0) {
            param_7 = 0x17;
            local_res8[0] = 0x2b10;
            plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar11 + 0x70))
                      (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8,&param_7);
            LOCK();
            *(int *)plVar13 = (int)*plVar13 + -1;
            UNLOCK();
            if ((int)*plVar13 == 0) {
              pvVar3 = (void *)*plVar12;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0x9130);
                operator_delete(pvVar3);
              }
              operator_delete(plVar12);
            }
          }
          else {
            FUN_14000a170(local_e8);
            local_40 = 0;
            iVar7 = FUN_1402636e0(*plVar12,param_5,local_e8);
            if (iVar7 == 0) {
              local_100 = 0x16;
              local_104 = 0x2b10;
              plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar11 + 0x70))
                        (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_104,&local_100);
              LOCK();
              *(int *)plVar13 = (int)*plVar13 + -1;
              UNLOCK();
              if ((int)*plVar13 == 0) {
                pvVar3 = (void *)*plVar12;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0x9130);
                  operator_delete(pvVar3);
                }
                operator_delete(plVar12);
              }
            }
            else {
              iVar7 = *param_6;
              if (iVar7 <= local_cc) {
                if (iVar6 == 1) {
                  uVar1 = *local_res18;
                  iVar6 = *local_res10;
                  iVar2 = *param_5;
                  uVar9 = FUN_1401dea30(param_1 + 0x9f0);
                  if (-1 < iVar2) {
                    FUN_1402654c0(uVar9,param_1,iVar2,iVar6,CONCAT44(uVar8,uVar1),
                                  CONCAT44(uVar19,iVar7),1);
                  }
                  LOCK();
                  *(int *)plVar13 = (int)*plVar13 + -1;
                  UNLOCK();
                  if ((int)*plVar13 == 0) {
                    pvVar3 = (void *)*plVar12;
                    if (pvVar3 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar3 + 0x9130);
                      operator_delete(pvVar3);
                    }
                    operator_delete(plVar12);
                  }
                  if (!bVar16) {
                    return 1;
                  }
                  FUN_14034edd0(local_128);
                  return 1;
                }
                uVar9 = FUN_140174f00(param_1 + 0x6c0);
                puVar4 = local_res18;
                if (-1 < *local_res10) {
                  puVar17 = local_res18;
                  piVar18 = param_6;
                  iVar7 = FUN_1401f0750(uVar9,param_1,local_e8,local_res10,local_res18,param_6,3,
                                        iVar6);
                  uVar8 = (undefined4)((ulonglong)puVar17 >> 0x20);
                  uVar19 = (undefined4)((ulonglong)piVar18 >> 0x20);
                  if (iVar7 != 0) {
                    uVar9 = FUN_1401dea30(param_1 + 0x9d0);
                    FUN_140264730(uVar9,param_1,param_5,param_6,CONCAT44(uVar8,*puVar4),
                                  CONCAT44(uVar19,iVar6));
                    uVar9 = FUN_140137690();
                    uVar8 = FUN_1401374e0(uVar9,local_d0);
                    uVar9 = FUN_1402e0270();
                    uVar14 = (ulonglong)local_d0;
                    cVar5 = FUN_1402df630(uVar9,uVar14);
                    if (cVar5 == '\0') {
                      uVar9 = FUN_1402e0270();
                      cVar5 = FUN_1402df680(uVar9,uVar8);
                      if (cVar5 == '\0') goto LAB_14019ba6c;
                      uVar14 = (ulonglong)local_d0;
                    }
                    FUN_1401a8bb0(param_1,uVar14 & 0xffffffff);
                  }
                }
LAB_14019ba6c:
                LOCK();
                *(int *)plVar13 = (int)*plVar13 + -1;
                UNLOCK();
                if ((int)*plVar13 == 0) {
                  pvVar3 = (void *)*plVar12;
                  if (pvVar3 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar3 + 0x9130);
                    operator_delete(pvVar3);
                  }
                  operator_delete(plVar12);
                }
                if (!bVar16) {
                  return 1;
                }
                FUN_14034edd0(local_128);
                return 1;
              }
              local_fc = 0x18;
              local_108 = 0x2b10;
              plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar11 + 0x70))
                        (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_108,&local_fc);
              LOCK();
              *(int *)plVar13 = (int)*plVar13 + -1;
              UNLOCK();
              if ((int)*plVar13 == 0) {
                pvVar3 = (void *)*plVar12;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0x9130);
                  operator_delete(pvVar3);
                }
                operator_delete(plVar12);
              }
            }
          }
          goto LAB_14019bb14;
        }
      }
      else {
        iVar6 = DAT_140608048 + 1;
        bVar15 = DAT_140608048 == 0;
        DAT_140608048 = iVar6;
        if (bVar15) {
          FUN_140176d60(1);
        }
      }
    }
  }
  if (local_118 != (longlong *)0x0) {
    if (local_118 == local_110) {
      LOCK();
      plVar12 = local_118 + 1;
      *(int *)plVar12 = (int)*plVar12 + -1;
      UNLOCK();
      if ((int)*plVar12 == 0) {
        pvVar3 = (void *)*local_118;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0x9130);
          operator_delete(pvVar3);
        }
        operator_delete(local_118);
      }
    }
    else {
      iVar6 = DAT_1406080fc + 1;
      bVar15 = DAT_1406080fc == 0;
      DAT_1406080fc = iVar6;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14019bb14:
  if (bVar16) {
    FUN_14034edd0(local_128);
  }
  return 0;
}



void FUN_14019bb50(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong *plVar5;
  bool bVar6;
  float local_res10 [2];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_28;
  undefined4 local_24;
  undefined8 local_20;
  longlong *local_18;
  longlong *local_10;
  
  local_20 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_18);
  plVar1 = local_18;
  if (local_18 != (longlong *)0x0) {
    if (local_18 == local_10) {
      if ((longlong *)*local_18 != (longlong *)0x0) {
        local_24 = (**(code **)(*(longlong *)*local_18 + 0x2e0))();
        local_28 = (**(code **)(*(longlong *)*plVar1 + 0x2e8))();
        local_res20[0] = (**(code **)(*(longlong *)*plVar1 + 0x2f0))();
        local_res18[0] = (**(code **)(*(longlong *)*plVar1 + 0x2f8))();
        lVar2 = *plVar1;
        local_res10[0] =
             *(float *)(lVar2 + 0x5e0) + *(float *)(lVar2 + 0x5dc) + *(float *)(lVar2 + 0x5e4) +
             *(float *)(lVar2 + 0x908);
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0x220))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_1 + 8,&local_24,
                   &local_28,local_res20,local_res18,local_res10);
        goto LAB_14019bcb7;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_10) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14019bcb7:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar3 = (undefined8 *)*local_18;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_18);
  }
  return;
}



void FUN_14019bcf0(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong *plVar5;
  bool bVar6;
  undefined4 local_res10 [2];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_48;
  float local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined8 local_30;
  longlong *local_28;
  longlong *local_20;
  
  local_30 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_28);
  plVar1 = local_28;
  if (local_28 != (longlong *)0x0) {
    if (local_28 == local_20) {
      if (*local_28 != 0) {
        local_34 = *(undefined4 *)(*local_28 + 0x5cc);
        local_38 = *(undefined4 *)(*local_28 + 0x5d0);
        local_3c = *(undefined4 *)(*local_28 + 0x5d4);
        local_40 = *(undefined4 *)(*local_28 + 0x5d8);
        lVar2 = *local_28;
        local_44 = *(float *)(lVar2 + 0x5e0) + *(float *)(lVar2 + 0x5dc) + *(float *)(lVar2 + 0x5e4)
                   + *(float *)(lVar2 + 0x908);
        local_res10[0] = *(undefined4 *)(*local_28 + 0x5e8);
        local_48 = *(undefined4 *)(*local_28 + 0x5ec);
        local_res20[0] = *(undefined4 *)(*local_28 + 0x5f0);
        local_res18[0] = *(undefined4 *)(*local_28 + 0x5f4);
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0x200))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_1 + 8,&local_34,
                   &local_38,&local_3c,&local_40,&local_44,local_res10,&local_48,local_res20,
                   local_res18);
        if (*(int *)(param_1 + 0xc) != 0) {
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar5 + 0x1c0))
                    (plVar5,*(int *)(param_1 + 0xc),&DAT_1405d85a0,param_1 + 8,local_res10);
        }
        if (*(longlong *)(param_1 + 0xb58) != 0) {
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar5 + 0x210))
                    (plVar5,*(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 8),&DAT_1405d85a0,
                     param_1 + 8,&local_34,&local_38,&local_3c,&local_40,&local_44,local_res10,
                     &local_48,local_res20,local_res18);
        }
        goto LAB_14019bf42;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_20) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14019bf42:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar3 = (undefined8 *)*local_28;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_28);
  }
  return;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined4 local_res10 [6];
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if ((longlong *)*local_20 != (longlong *)0x0) {
        lVar4 = (**(code **)(*(longlong *)*local_20 + 0x278))();
        local_res10[0] = 0;
        if (lVar4 != 0) {
          local_res10[0] = *(undefined4 *)(lVar4 + 0x6c);
        }
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0x8d0))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10);
        goto LAB_14019c03c;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14019c03c:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return;
}



void FUN_14019c070(longlong param_1,undefined4 param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  int iVar12;
  int iVar13;
  int iVar14;
  uint uVar15;
  ulonglong *puVar16;
  code *pcVar17;
  undefined4 uVar18;
  DWORD DVar19;
  undefined4 *puVar20;
  HANDLE pvVar21;
  HANDLE pvVar22;
  int iVar23;
  int iVar24;
  int iVar25;
  int iVar26;
  uint uVar27;
  uint *puVar28;
  longlong *plVar29;
  longlong lVar30;
  ulonglong uVar31;
  ulonglong uVar32;
  ulonglong uVar33;
  undefined4 *puVar34;
  ulonglong uVar35;
  uint uVar36;
  undefined4 *puVar37;
  undefined4 *puVar38;
  ulonglong uVar39;
  bool bVar40;
  bool bVar41;
  float fVar42;
  undefined4 *local_1c8;
  undefined4 *local_1c0;
  undefined4 *local_1b8;
  undefined4 *local_1a8;
  undefined4 *local_1a0;
  undefined4 *local_198;
  undefined8 local_188;
  uint local_178;
  undefined1 local_174 [92];
  longlong local_118;
  longlong local_110;
  uint local_100;
  undefined4 local_70;
  
  local_188 = 0xfffffffffffffffe;
  plVar29 = *(longlong **)(param_1 + 0x6c0);
  if (plVar29 == (longlong *)0x0) {
    return;
  }
  if (plVar29 != *(longlong **)(param_1 + 0x6c8)) {
    if (DAT_140608048 != 0) {
      DAT_140608048 = DAT_140608048 + 1;
      return;
    }
    DAT_140608048 = DAT_140608048 + 1;
    FUN_140176d60(1);
    return;
  }
  if (*plVar29 == 0) {
    return;
  }
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  if (puVar16 == (ulonglong *)0x0) {
    return;
  }
  if (puVar16 != *(ulonglong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return;
  }
  if (*puVar16 == 0) {
    return;
  }
  uVar33 = 0;
  uVar39 = *puVar16;
  if ((puVar16 != *(ulonglong **)(param_1 + 0x6e8)) &&
     (iVar23 = DAT_14060804c + 1, bVar40 = DAT_14060804c == 0, uVar39 = uVar33,
     DAT_14060804c = iVar23, bVar40)) {
    FUN_140176d60(1);
  }
  iVar23 = *(int *)(uVar39 + 0x8b0);
  iVar9 = *(int *)(uVar39 + 0x618);
  fVar1 = *(float *)(uVar39 + 0x59c);
  fVar2 = *(float *)(uVar39 + 0x8ec);
  fVar3 = *(float *)(uVar39 + 0x734);
  iVar10 = *(int *)(uVar39 + 0x868);
  iVar11 = *(int *)(uVar39 + 0x88c);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar24 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar24;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  fVar4 = *(float *)(uVar39 + 0x598);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar24 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar24;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  iVar24 = *(int *)(uVar39 + 0x8b4);
  iVar12 = *(int *)(uVar39 + 0x61c);
  fVar5 = *(float *)(uVar39 + 0x5a4);
  fVar6 = *(float *)(uVar39 + 0x8f0);
  fVar7 = *(float *)(uVar39 + 0x738);
  iVar13 = *(int *)(uVar39 + 0x86c);
  iVar14 = *(int *)(uVar39 + 0x890);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  fVar8 = *(float *)(uVar39 + 0x5a0);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140237f20(uVar39,1);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140237f20(uVar39,8);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140237f20(uVar39,4);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140237f20(uVar39,2);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140237f20(uVar39);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar40) {
        FUN_140176d60(CONCAT71((int7)((ulonglong)puVar16 >> 8),1));
      }
    }
  }
  iVar25 = DAT_14060804c;
  FUN_1402f6f40(uVar39);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      DAT_14060804c = iVar25 + 1;
      if (iVar25 == 0) {
        FUN_140176d60(CONCAT71((int7)((ulonglong)puVar16 >> 8),1));
      }
    }
  }
  FUN_1402f7990(uVar39);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar40 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar40) {
        FUN_140176d60(1);
      }
    }
  }
  *(undefined8 *)(uVar39 + 0x5bc) = 0;
  *(undefined8 *)(uVar39 + 0x5c4) = 0;
  bVar40 = false;
  *(undefined4 *)(uVar39 + 0x5cc) = 0;
  *(undefined8 *)(uVar39 + 0x5d0) = 0;
  *(undefined4 *)(uVar39 + 0x5d8) = 0;
  *(undefined8 *)(uVar39 + 0x5dc) = 0;
  *(undefined4 *)(uVar39 + 0x5e4) = 0;
  *(undefined4 *)(uVar39 + 0x5e8) = 0x3f800000;
  *(undefined4 *)(uVar39 + 0x5f8) = 0;
  *(undefined4 *)(uVar39 + 0x5ec) = 0x3f800000;
  *(undefined8 *)(uVar39 + 0x5f0) = 0x3f800000;
  FUN_1401a9200(param_1);
  FUN_1401b45d0(param_1);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar41 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar41) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140204a90(uVar39);
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar41 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar41) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1402381b0(uVar39);
  plVar29 = *(longlong **)(param_1 + 0xa00);
  if (plVar29 != (longlong *)0x0) {
    if (plVar29 == *(longlong **)(param_1 + 0xa08)) {
      if ((*plVar29 != 0) && (lVar30 = FUN_1401deac0(), 0 < *(int *)(lVar30 + 0x30))) {
        FUN_1401d1230(param_1);
      }
    }
    else {
      iVar25 = DAT_1406080dc + 1;
      bVar41 = DAT_1406080dc == 0;
      DAT_1406080dc = iVar25;
      if (bVar41) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(int *)(param_1 + 0x204) == 0) {
    fVar42 = 0.0;
  }
  else {
    fVar42 = -0.2;
  }
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      iVar25 = DAT_14060804c + 1;
      bVar41 = DAT_14060804c == 0;
      DAT_14060804c = iVar25;
      if (bVar41) {
        FUN_140176d60(1);
      }
    }
  }
  iVar25 = DAT_14060804c;
  *(float *)(uVar39 + 0x7fc) = fVar42 + *(float *)(uVar39 + 0x7fc);
  *(undefined1 *)(uVar39 + 0x607) = 1;
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar39 = uVar33;
  iVar26 = iVar25;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar39 = *puVar16;
    }
    else {
      DAT_14060804c = iVar25 + 1;
      iVar26 = DAT_14060804c;
      if (iVar25 == 0) {
        FUN_140176d60(1);
        iVar26 = DAT_14060804c;
      }
    }
  }
  puVar16 = *(ulonglong **)(param_1 + 0x6e0);
  uVar35 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar35 = *puVar16;
    }
    else {
      DAT_14060804c = iVar26 + 1;
      if (iVar26 == 0) {
        FUN_140176d60(1);
      }
    }
  }
  fVar42 = *(float *)(uVar35 + 0x2298);
  iVar25 = FUN_1402f8580(uVar39);
  FUN_14000a170(&local_118);
  local_70 = 0;
  local_178 = 0;
  memset(local_174,0,0x5c);
  uVar39 = uVar33;
LAB_14019c751:
  iVar26 = DAT_140608048;
  puVar16 = *(ulonglong **)(param_1 + 0x6c0);
  uVar35 = uVar33;
  if (puVar16 != (ulonglong *)0x0) {
    if (puVar16 == *(ulonglong **)(param_1 + 0x6c8)) {
      uVar35 = *puVar16;
    }
    else {
      DAT_140608048 = DAT_140608048 + 1;
      if (iVar26 == 0) {
        FUN_140176d60(1);
      }
    }
  }
  uVar36 = (uint)uVar39;
  if (uVar36 < 0x18) {
    lVar30 = (longlong)(int)uVar36 * 0xac + uVar35;
    *(undefined2 *)(lVar30 + 0x14) = 0;
    *(short *)(lVar30 + 0x16) = (short)uVar39;
    FUN_140090020(&local_118);
    if ((local_118 != 0) || (bVar41 = bVar40, local_110 != 0)) {
      bVar41 = true;
    }
    if (!bVar41) goto LAB_14019c8a0;
    lVar30 = FUN_140137690();
    if (*(longlong *)(lVar30 + 0x88) != 0) {
      for (puVar28 = *(uint **)(*(longlong *)(lVar30 + 0x88) +
                               ((ulonglong)local_100 % (ulonglong)*(uint *)(lVar30 + 0x98)) * 8);
          puVar28 != (uint *)0x0; puVar28 = *(uint **)(puVar28 + 0xa6)) {
        if ((puVar28[0xa8] == local_100) && (*puVar28 == local_100)) {
          if (puVar28 != (uint *)0x0) {
            if (puVar28 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if ((puVar28 != (uint *)0xfffffffffffffff8) &&
               ((int)puVar28[0x44] <= (int)fVar42 + iVar25)) {
              if (uVar36 == 0) {
                FUN_14019e660(param_1,&local_118,param_2);
              }
              else {
                FUN_14019f2b0(param_1,&local_118);
              }
              uVar15 = puVar28[0x60];
              uVar39 = uVar33;
              uVar35 = uVar33;
              if (0 < (int)uVar15) goto LAB_14019c880;
            }
          }
          break;
        }
      }
    }
  }
  else {
LAB_14019c8a0:
    if (uVar36 == 0) {
      FUN_14019d5c0(param_1,&local_118,param_2);
    }
  }
  goto LAB_14019c8b4;
  while( true ) {
    if (*(uint *)(local_174 + uVar39 * 4 + -4) == 0) {
      *(uint *)(local_174 + uVar39 * 4 + -4) = uVar15;
      break;
    }
    uVar27 = (int)uVar35 + 1;
    uVar39 = uVar39 + 1;
    uVar35 = (ulonglong)uVar27;
    if (0x17 < (int)uVar27) break;
LAB_14019c880:
    if (*(uint *)(local_174 + uVar39 * 4 + -4) == uVar15) break;
  }
LAB_14019c8b4:
  uVar39 = (ulonglong)(uVar36 + 1);
  if (0x17 < (int)(uVar36 + 1)) goto LAB_14019c8cd;
  goto LAB_14019c751;
LAB_14019c8cd:
  puVar28 = &local_178;
  uVar39 = uVar33;
  do {
    if (*puVar28 == 0) break;
    FUN_14019f4e0(param_1);
    uVar36 = (int)uVar39 + 1;
    uVar39 = (ulonglong)uVar36;
    puVar28 = puVar28 + 1;
  } while ((int)uVar36 < 0x18);
  local_1c8 = *(undefined4 **)(param_1 + 0x128);
  local_1c0 = *(undefined4 **)(param_1 + 0x130);
  if ((local_1c8 != (undefined4 *)0x0) || (local_1c0 != (undefined4 *)0x0)) {
    bVar40 = true;
  }
  if (bVar40) {
    FUN_14020fd10(DAT_140608078,&local_1c8);
  }
  else {
    local_1a8 = (undefined4 *)0x0;
    local_1a0 = (undefined4 *)0x0;
    local_198 = (undefined4 *)0x0;
    local_1c8 = (undefined4 *)0x0;
    local_1c0 = (undefined4 *)0x0;
    local_1b8 = (undefined4 *)0x0;
    puVar16 = *(ulonglong **)(param_1 + 0x6e0);
    uVar39 = uVar33;
    if (puVar16 != (ulonglong *)0x0) {
      if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
        uVar39 = *puVar16;
      }
      else {
        iVar25 = DAT_14060804c + 1;
        bVar40 = DAT_14060804c == 0;
        DAT_14060804c = iVar25;
        if (bVar40) {
          FUN_140176d60(1);
        }
      }
    }
    puVar37 = (undefined4 *)(uVar39 + 0x93c);
    puVar16 = *(ulonglong **)(param_1 + 0x6e0);
    uVar39 = uVar33;
    if (puVar16 != (ulonglong *)0x0) {
      if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
        uVar39 = *puVar16;
      }
      else {
        iVar25 = DAT_14060804c + 1;
        bVar40 = DAT_14060804c == 0;
        DAT_14060804c = iVar25;
        if (bVar40) {
          FUN_140176d60(1);
        }
      }
    }
    puVar38 = (undefined4 *)(uVar39 + 0x978);
    puVar34 = local_1a8;
    uVar39 = uVar33;
    do {
      if ((puVar37 < local_1a0) && (puVar34 <= puVar37)) {
        lVar30 = (longlong)puVar37 - (longlong)puVar34;
        if (local_1a0 == local_198) {
          uVar35 = (longlong)local_1a0 - (longlong)puVar34 >> 2;
          if (0x3ffffffffffffffe < uVar35) {
            std::_Xlength_error("vector<T> too long");
            pcVar17 = (code *)swi(3);
            (*pcVar17)();
            return;
          }
          uVar35 = uVar35 + 1;
          uVar31 = (longlong)local_198 - (longlong)puVar34 >> 2;
          if (uVar31 < uVar35) {
            uVar32 = uVar33;
            if (uVar31 <= 0x3fffffffffffffff - (uVar31 >> 1)) {
              uVar32 = uVar31 + (uVar31 >> 1);
            }
            if (uVar32 < uVar35) {
              uVar32 = uVar35;
            }
            FUN_140051e60(&local_1a8,uVar32);
            puVar34 = local_1a8;
          }
        }
        if (local_1a0 != (undefined4 *)0x0) {
          uVar18 = puVar34[lVar30 >> 2];
LAB_14019cb19:
          *local_1a0 = uVar18;
          puVar34 = local_1a8;
        }
      }
      else {
        if (local_1a0 == local_198) {
          uVar35 = (longlong)local_1a0 - (longlong)puVar34 >> 2;
          if (0x3ffffffffffffffe < uVar35) {
            std::_Xlength_error("vector<T> too long");
            pcVar17 = (code *)swi(3);
            (*pcVar17)();
            return;
          }
          uVar35 = uVar35 + 1;
          uVar31 = (longlong)local_198 - (longlong)puVar34 >> 2;
          if (uVar31 < uVar35) {
            uVar32 = uVar33;
            if (uVar31 <= 0x3fffffffffffffff - (uVar31 >> 1)) {
              uVar32 = uVar31 + (uVar31 >> 1);
            }
            if (uVar32 < uVar35) {
              uVar32 = uVar35;
            }
            FUN_140051e60(&local_1a8,uVar32);
            puVar34 = local_1a8;
          }
        }
        if (local_1a0 != (undefined4 *)0x0) {
          uVar18 = *puVar37;
          goto LAB_14019cb19;
        }
      }
      local_1a0 = local_1a0 + 1;
      uVar39 = uVar39 + 1;
      puVar37 = puVar37 + 1;
      puVar20 = local_1c8;
      uVar35 = uVar33;
    } while ((longlong)uVar39 < 0xf);
    do {
      if ((puVar38 < local_1c0) && (puVar20 <= puVar38)) {
        lVar30 = (longlong)puVar38 - (longlong)puVar20;
        if (local_1c0 == local_1b8) {
          uVar39 = (longlong)local_1c0 - (longlong)puVar20 >> 2;
          if (0x3ffffffffffffffe < uVar39) {
            std::_Xlength_error("vector<T> too long");
            pcVar17 = (code *)swi(3);
            (*pcVar17)();
            return;
          }
          uVar39 = uVar39 + 1;
          uVar31 = (longlong)local_1b8 - (longlong)puVar20 >> 2;
          if (uVar31 < uVar39) {
            uVar32 = uVar33;
            if (uVar31 <= 0x3fffffffffffffff - (uVar31 >> 1)) {
              uVar32 = uVar31 + (uVar31 >> 1);
            }
            if (uVar32 < uVar39) {
              uVar32 = uVar39;
            }
            FUN_14030db30(&local_1c8,uVar32);
            puVar20 = local_1c8;
          }
        }
        if (local_1c0 != (undefined4 *)0x0) {
          uVar18 = puVar20[lVar30 >> 2];
LAB_14019cc57:
          *local_1c0 = uVar18;
          puVar20 = local_1c8;
        }
      }
      else {
        if (local_1c0 == local_1b8) {
          uVar39 = (longlong)local_1c0 - (longlong)puVar20 >> 2;
          if (0x3ffffffffffffffe < uVar39) {
            std::_Xlength_error("vector<T> too long");
            pcVar17 = (code *)swi(3);
            (*pcVar17)();
            return;
          }
          uVar39 = uVar39 + 1;
          uVar31 = (longlong)local_1b8 - (longlong)puVar20 >> 2;
          if (uVar31 < uVar39) {
            uVar32 = uVar33;
            if (uVar31 <= 0x3fffffffffffffff - (uVar31 >> 1)) {
              uVar32 = uVar31 + (uVar31 >> 1);
            }
            if (uVar32 < uVar39) {
              uVar32 = uVar39;
            }
            FUN_14030db30(&local_1c8,uVar32);
            puVar20 = local_1c8;
          }
        }
        if (local_1c0 != (undefined4 *)0x0) {
          uVar18 = *puVar38;
          goto LAB_14019cc57;
        }
      }
      local_1c0 = local_1c0 + 1;
      uVar35 = uVar35 + 1;
      puVar38 = puVar38 + 1;
    } while ((longlong)uVar35 < 0x14);
    plVar29 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x3c0);
    (**(code **)(*plVar29 + 0x850))
              (plVar29,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1a8,&local_1c8);
    if (local_1c8 != (undefined4 *)0x0) {
      operator_delete(local_1c8);
    }
    local_1c8 = (undefined4 *)0x0;
    local_1c0 = (undefined4 *)0x0;
    local_1b8 = (undefined4 *)0x0;
    if (local_1a8 != (undefined4 *)0x0) {
      operator_delete(local_1a8);
    }
  }
  FUN_14019bcf0(param_1);
  FUN_14019bb50(param_1);
  iVar25 = DAT_14060804c;
  if ((int)(((float)(iVar23 + iVar9) + fVar1) * (fVar2 + fVar3 + 1.0 + 0.0001) + (float)iVar10 +
           (float)iVar11) == (int)fVar4) {
    if ((((*(longlong *)(param_1 + 0x6e0) != 0) &&
         (*(longlong *)(param_1 + 0x6e0) != *(longlong *)(param_1 + 0x6e8))) &&
        (DAT_14060804c = DAT_14060804c + 1, iVar25 == 0)) &&
       (pvVar21 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,(HANDLE)0x0
                             ), pvVar21 != (HANDLE)0x0)) {
      DVar19 = GetCurrentProcessId();
      pvVar22 = GetCurrentProcess();
      MiniDumpWriteDump(pvVar22,DVar19,pvVar21,2,0,0,0);
      CloseHandle(pvVar21);
    }
    iVar23 = DAT_14060804c;
    puVar16 = *(ulonglong **)(param_1 + 0x6e0);
    uVar39 = uVar33;
    if (puVar16 != (ulonglong *)0x0) {
      if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
        uVar39 = *puVar16;
      }
      else {
        DAT_14060804c = DAT_14060804c + 1;
        if ((iVar23 == 0) &&
           (pvVar21 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                  (HANDLE)0x0), pvVar21 != (HANDLE)0x0)) {
          DVar19 = GetCurrentProcessId();
          pvVar22 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar22,DVar19,pvVar21,2,0,0,0);
          CloseHandle(pvVar21);
        }
      }
    }
    FUN_1402f88a0(uVar39);
  }
  iVar23 = DAT_14060804c;
  if ((int)(((float)(iVar24 + iVar12) + fVar5) * (fVar6 + fVar7 + 1.0 + 0.0001) + (float)iVar13 +
           (float)iVar14) == (int)fVar8) {
    if (((*(longlong *)(param_1 + 0x6e0) != 0) &&
        (*(longlong *)(param_1 + 0x6e0) != *(longlong *)(param_1 + 0x6e8))) &&
       ((DAT_14060804c = DAT_14060804c + 1, iVar23 == 0 &&
        (pvVar21 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                               (HANDLE)0x0), pvVar21 != (HANDLE)0x0)))) {
      DVar19 = GetCurrentProcessId();
      pvVar22 = GetCurrentProcess();
      MiniDumpWriteDump(pvVar22,DVar19,pvVar21,2,0,0,0);
      CloseHandle(pvVar21);
    }
    iVar23 = DAT_14060804c;
    puVar16 = *(ulonglong **)(param_1 + 0x6e0);
    if (puVar16 != (ulonglong *)0x0) {
      if (puVar16 == *(ulonglong **)(param_1 + 0x6e8)) {
        uVar33 = *puVar16;
      }
      else {
        DAT_14060804c = DAT_14060804c + 1;
        if ((iVar23 == 0) &&
           (pvVar21 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                  (HANDLE)0x0), pvVar21 != (HANDLE)0x0)) {
          DVar19 = GetCurrentProcessId();
          pvVar22 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar22,DVar19,pvVar21,2,0,0,0);
          CloseHandle(pvVar21);
          uVar33 = 0;
        }
      }
    }
    FUN_1402f8960(uVar33);
  }
  return;
}



void FUN_14019d0c0(uint param_1,int param_2,uint param_3,float *param_4,float *param_5,int param_6,
                  int param_7,int param_8)

{
  uint uVar1;
  uint uVar2;
  uint *puVar3;
  ulonglong *puVar4;
  longlong lVar5;
  longlong *plVar6;
  uint uVar7;
  int iVar8;
  ulonglong uVar9;
  uint uVar10;
  uint uVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  int local_78;
  
  lVar5 = FUN_140137690();
  uVar7 = 0;
  if (*(longlong *)(lVar5 + 0x88) == 0) {
    return;
  }
  puVar3 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                     ((ulonglong)param_1 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
  while( true ) {
    if (puVar3 == (uint *)0x0) {
      return;
    }
    if ((puVar3[0xa8] == param_1) && (*puVar3 == param_1)) break;
    puVar3 = *(uint **)(puVar3 + 0xa6);
  }
  if (puVar3 == (uint *)0x0) {
    return;
  }
  if (puVar3 == (uint *)0xfffffffffffffff8) {
    return;
  }
  if (*(int **)(puVar3 + 0x1a) == *(int **)(puVar3 + 0x1c)) {
    return;
  }
  if (param_2 == 0x65) {
    param_2 = 1;
  }
  else if (param_2 == 0xc9) {
    param_2 = 2;
  }
  else if (param_2 == 0x12d) {
    param_2 = 3;
  }
  else if (param_2 == 0x191) {
    param_2 = 4;
  }
  else if (param_2 == 0x66) {
    param_2 = 1;
  }
  else if (param_2 == 0xca) {
    param_2 = 2;
  }
  else if (param_2 == 0x12e) {
    param_2 = 3;
  }
  else if (param_2 == 0x192) {
    param_2 = 4;
  }
  iVar8 = **(int **)(puVar3 + 0x1a);
  uVar1 = puVar3[0x32];
  uVar2 = puVar3[0x33];
  local_78 = 0;
  plVar6 = (longlong *)FUN_1401319f0();
  uVar9 = ((longlong)param_2 << 0x20) + (longlong)iVar8;
  if (*plVar6 != 0) {
    for (puVar4 = *(ulonglong **)
                   (*plVar6 + ((uVar9 & 0xffffffff) % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
        puVar4 != (ulonglong *)0x0; puVar4 = (ulonglong *)puVar4[7]) {
      if (((int)puVar4[8] == (int)uVar9) && (*puVar4 == uVar9)) {
        if ((puVar4 != (ulonglong *)0x0) && (puVar4 + 1 != (ulonglong *)0x0)) {
          if (param_6 == 4) {
            uVar10 = param_7 + (int)puVar4[3];
            uVar11 = param_7 + *(int *)((longlong)puVar4 + 0x1c);
            iVar8 = param_8 + (int)puVar4[4];
            local_78 = *(int *)((longlong)puVar4 + 0x24) + param_8;
          }
          else {
            uVar10 = param_7 + (int)puVar4[1];
            uVar11 = param_7 + *(int *)((longlong)puVar4 + 0xc);
            iVar8 = param_8 + (int)puVar4[2];
            local_78 = *(int *)((longlong)puVar4 + 0x14) + param_8;
          }
          goto LAB_14019d236;
        }
        break;
      }
    }
  }
  iVar8 = 0;
  uVar11 = uVar7;
  uVar10 = uVar7;
LAB_14019d236:
  fVar13 = 0.0;
  *param_4 = 0.0;
  *param_5 = 0.0;
  fVar14 = 0.0;
  lVar5 = FUN_140130e80();
  if (*(longlong *)(lVar5 + 0x28) != 0) {
    for (puVar3 = *(uint **)(*(longlong *)(lVar5 + 0x28) +
                            ((ulonglong)param_3 % (ulonglong)*(uint *)(lVar5 + 0x38)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x38)) {
      if ((puVar3[0x3a] == param_3) && (*puVar3 == param_3)) {
        if (puVar3 != (uint *)0x0) {
          fVar12 = (float)puVar3[4];
          uVar7 = puVar3[5];
          goto LAB_14019d324;
        }
        break;
      }
    }
  }
  fVar12 = 0.0;
LAB_14019d324:
  plVar6 = (longlong *)FUN_1401310a0();
  uVar9 = ((longlong)(int)uVar1 << 0x20) + (longlong)(int)uVar2;
  if (*plVar6 != 0) {
    for (puVar4 = *(ulonglong **)
                   (*plVar6 + ((uVar9 & 0xffffffff) % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
        puVar4 != (ulonglong *)0x0; puVar4 = (ulonglong *)puVar4[3]) {
      if (((int)puVar4[4] == (int)uVar9) && (*puVar4 == uVar9)) {
        if (puVar4 != (ulonglong *)0x0) {
          fVar13 = *(float *)(puVar4 + 2);
          fVar14 = *(float *)((longlong)puVar4 + 0x14);
        }
        break;
      }
    }
  }
  *param_4 = (float)((int)(uVar11 + uVar10) / 2) * fVar12 * fVar13 + (float)(int)uVar7;
  *param_5 = (float)((local_78 + iVar8) / 2) * fVar12 * fVar14 + (float)(int)uVar7;
  return;
}



void FUN_14019d400(uint param_1,undefined4 param_2,float *param_3,float *param_4)

{
  uint uVar1;
  uint uVar2;
  uint *puVar3;
  ulonglong *puVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong *plVar7;
  ulonglong uVar8;
  float fVar9;
  float fVar10;
  float local_res8 [2];
  float local_48;
  float local_44 [11];
  
  lVar5 = FUN_140137690();
  if (*(longlong *)(lVar5 + 0x88) == 0) {
    return;
  }
  puVar3 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                     ((ulonglong)param_1 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
  while( true ) {
    if (puVar3 == (uint *)0x0) {
      return;
    }
    if ((puVar3[0xa8] == param_1) && (*puVar3 == param_1)) break;
    puVar3 = *(uint **)(puVar3 + 0xa6);
  }
  if (puVar3 == (uint *)0x0) {
    return;
  }
  if (puVar3 == (uint *)0xfffffffffffffff8) {
    return;
  }
  uVar1 = puVar3[0x32];
  uVar2 = puVar3[0x33];
  fVar9 = 0.0;
  local_44[0] = 0.0;
  local_res8[0] = 0.0;
  local_48 = 0.0;
  fVar10 = 0.0;
  *param_3 = 0.0;
  *param_4 = 0.0;
  uVar6 = FUN_140130e80();
  FUN_140130cf0(uVar6,param_2,puVar3[0x44],puVar3[0x35],&local_48,local_44,local_res8);
  plVar7 = (longlong *)FUN_1401310a0();
  uVar8 = ((longlong)(int)uVar1 << 0x20) + (longlong)(int)uVar2;
  if (*plVar7 != 0) {
    for (puVar4 = *(ulonglong **)
                   (*plVar7 + ((uVar8 & 0xffffffff) % (ulonglong)*(uint *)(plVar7 + 2)) * 8);
        puVar4 != (ulonglong *)0x0; puVar4 = (ulonglong *)puVar4[3]) {
      if (((int)puVar4[4] == (int)uVar8) && (*puVar4 == uVar8)) {
        if (puVar4 != (ulonglong *)0x0) {
          fVar9 = *(float *)(puVar4 + 2);
          fVar10 = *(float *)((longlong)puVar4 + 0x14);
        }
        break;
      }
    }
  }
  *param_3 = fVar9 * local_res8[0] * local_48 + local_44[0];
  *param_4 = fVar10 * local_res8[0] * local_48 + local_44[0];
  return;
}



undefined8 FUN_14019d5c0(longlong param_1,longlong param_2,int param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int *piVar7;
  ulonglong *puVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  int iVar14;
  longlong lVar15;
  longlong lVar16;
  uint *puVar17;
  longlong *plVar18;
  int iVar19;
  longlong *plVar20;
  uint uVar21;
  ulonglong uVar22;
  bool bVar23;
  
  plVar1 = (longlong *)(param_1 + 0x6e0);
  plVar18 = (longlong *)*plVar1;
  if (plVar18 == (longlong *)0x0) {
    return 0;
  }
  if (plVar18 != *(longlong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return 0;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return 0;
  }
  plVar20 = (longlong *)*plVar18;
  if (plVar20 == (longlong *)0x0) {
    return 0;
  }
  if (plVar18 != *(longlong **)(param_1 + 0x6e8)) {
    iVar14 = DAT_14060804c + 1;
    bVar23 = DAT_14060804c == 0;
    DAT_14060804c = iVar14;
    if (bVar23) {
      FUN_140176d60();
    }
    plVar20 = (longlong *)0x0;
  }
  lVar15 = (**(code **)(*plVar20 + 0x270))();
  uVar21 = *(uint *)(lVar15 + 0x58);
  lVar15 = (longlong)(int)uVar21;
  plVar18 = (longlong *)*plVar1;
  if (plVar18 == (longlong *)0x0) {
LAB_14019d67b:
    lVar16 = 0;
  }
  else {
    if (plVar18 != *(longlong **)(param_1 + 0x6e8)) {
      iVar14 = DAT_14060804c + 1;
      bVar23 = DAT_14060804c == 0;
      DAT_14060804c = iVar14;
      if (bVar23) {
        FUN_140176d60(1);
      }
      goto LAB_14019d67b;
    }
    lVar16 = *plVar18;
  }
  iVar14 = *(int *)(lVar16 + 0x120);
  lVar16 = FUN_14013ad30();
  if ((iVar14 - 1U < 4) && (uVar21 < 5)) {
    uVar21 = *(uint *)(((longlong)iVar14 * 5 + -5 + lVar15) * 0x54 + lVar16);
  }
  else {
    if (iVar14 == 0x65) {
      if (uVar21 < 5) {
        uVar21 = *(uint *)((lVar15 + 0x14) * 0x54 + lVar16);
        goto LAB_14019d79c;
      }
    }
    else if (iVar14 == 0xc9) {
      if (uVar21 < 5) {
        uVar21 = *(uint *)((lVar15 + 0x1e) * 0x54 + lVar16);
        goto LAB_14019d79c;
      }
    }
    else if (iVar14 == 0x12d) {
      if (uVar21 < 5) {
        uVar21 = *(uint *)((lVar15 + 0x28) * 0x54 + lVar16);
        goto LAB_14019d79c;
      }
    }
    else if (iVar14 == 0x191) {
      if (uVar21 < 5) {
        uVar21 = *(uint *)((lVar15 + 0x32) * 0x54 + lVar16);
        goto LAB_14019d79c;
      }
    }
    else if (iVar14 == 0x66) {
      if (uVar21 < 5) {
        uVar21 = *(uint *)((lVar15 + 0x19) * 0x54 + lVar16);
        goto LAB_14019d79c;
      }
    }
    else if (iVar14 == 0xca) {
      if (uVar21 < 5) {
        uVar21 = *(uint *)((lVar15 + 0x23) * 0x54 + lVar16);
        goto LAB_14019d79c;
      }
    }
    else if (iVar14 == 0x12e) {
      if (uVar21 < 5) {
        uVar21 = *(uint *)((lVar15 + 0x2d) * 0x54 + lVar16);
        goto LAB_14019d79c;
      }
    }
    else if ((iVar14 == 0x192) && (uVar21 < 5)) {
      uVar21 = *(uint *)((lVar15 + 0x37) * 0x54 + lVar16);
      goto LAB_14019d79c;
    }
    uVar21 = 0;
  }
LAB_14019d79c:
  lVar15 = FUN_140137690();
  if (*(longlong *)(lVar15 + 0x88) != 0) {
    for (puVar17 = *(uint **)(*(longlong *)(lVar15 + 0x88) +
                             ((ulonglong)uVar21 % (ulonglong)*(uint *)(lVar15 + 0x98)) * 8);
        puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0xa6)) {
      if ((puVar17[0xa8] == uVar21) && (*puVar17 == uVar21)) {
        if (puVar17 != (uint *)0x0) goto LAB_14019d7e5;
        break;
      }
    }
  }
  puVar17 = (uint *)0x0;
LAB_14019d7e5:
  if ((puVar17 == (uint *)0x0) || (puVar17 == (uint *)0xfffffffffffffff8)) {
    FUN_140418da0(DAT_140607fd8,&DAT_1404a8a90,uVar21);
  }
  else if (*(longlong *)(puVar17 + 0x1a) != *(longlong *)(puVar17 + 0x1c)) {
    piVar7 = *(int **)(puVar17 + 0x1a);
    lVar15 = FUN_140174f50(plVar1);
    iVar14 = *piVar7;
    iVar19 = *(int *)(lVar15 + 0x120);
    plVar18 = (longlong *)FUN_1401319f0();
    if (iVar19 == 0x65) {
      iVar19 = 1;
    }
    else if (iVar19 == 0xc9) {
      iVar19 = 2;
    }
    else if (iVar19 == 0x12d) {
      iVar19 = 3;
    }
    else if (iVar19 == 0x191) {
      iVar19 = 4;
    }
    else if (iVar19 == 0x66) {
      iVar19 = 1;
    }
    else if (iVar19 == 0xca) {
      iVar19 = 2;
    }
    else if (iVar19 == 0x12e) {
      iVar19 = 3;
    }
    else if (iVar19 == 0x192) {
      iVar19 = 4;
    }
    uVar22 = ((longlong)iVar19 << 0x20) + (longlong)iVar14;
    if (*plVar18 != 0) {
      for (puVar8 = *(ulonglong **)
                     (*plVar18 + ((uVar22 & 0xffffffff) % (ulonglong)*(uint *)(plVar18 + 2)) * 8);
          puVar8 != (ulonglong *)0x0; puVar8 = (ulonglong *)puVar8[7]) {
        if (((int)puVar8[8] == (int)uVar22) && (*puVar8 == uVar22)) {
          if (puVar8 != (ulonglong *)0x0) {
            uVar22 = puVar8[1];
            iVar19 = *(int *)((longlong)puVar8 + 0xc);
            uVar9 = puVar8[2];
            iVar14 = *(int *)((longlong)puVar8 + 0x14);
            uVar10 = puVar8[3];
            iVar4 = *(int *)((longlong)puVar8 + 0x1c);
            uVar11 = puVar8[4];
            uVar12 = puVar8[5];
            uVar2 = *(undefined4 *)((longlong)puVar8 + 0x2c);
            iVar5 = *(int *)((longlong)puVar8 + 0x24);
            uVar13 = puVar8[6];
            uVar3 = *(undefined4 *)((longlong)puVar8 + 0x34);
            iVar6 = *(int *)(param_2 + 0x98);
            if (param_3 == 4) {
              lVar15 = FUN_140174f50(plVar1);
              *(int *)(lVar15 + 0x5cc) = iVar6 + (int)uVar10;
              *(int *)(lVar15 + 0x5d0) = iVar6 + iVar4;
              iVar14 = *(int *)(param_2 + 0x9c) + iVar5;
              iVar19 = *(int *)(param_2 + 0x9c) + (int)uVar11;
            }
            else {
              lVar15 = FUN_140174f50(plVar1);
              *(int *)(lVar15 + 0x5cc) = iVar6 + (int)uVar22;
              *(int *)(lVar15 + 0x5d0) = iVar6 + iVar19;
              iVar14 = *(int *)(param_2 + 0x9c) + iVar14;
              iVar19 = *(int *)(param_2 + 0x9c) + (int)uVar9;
            }
            lVar15 = FUN_140174f50(plVar1);
            *(int *)(lVar15 + 0x5d8) = iVar14;
            *(int *)(lVar15 + 0x5d4) = iVar19;
            lVar15 = FUN_140174f50(plVar1);
            *(int *)(lVar15 + 0x5e0) = (int)uVar12;
            lVar15 = FUN_140174f50(plVar1);
            *(undefined4 *)(lVar15 + 0x5e8) = uVar2;
            lVar15 = FUN_140174f50(plVar1);
            *(int *)(lVar15 + 0x5ec) = (int)uVar13;
            lVar15 = FUN_140174f50(plVar1);
            *(undefined4 *)(lVar15 + 0x5f0) = uVar3;
            uVar2 = *(undefined4 *)(param_2 + 0x24);
            lVar15 = FUN_140174f50(plVar1);
            *(undefined4 *)(lVar15 + 0x5f4) = uVar2;
            return 1;
          }
          break;
        }
      }
    }
    FUN_140418da0(DAT_140607fd8,L"Invalid mcoWeaponDB::GetWeaponInfo");
    FUN_140418da0(DAT_140607fd8,&DAT_1404a8ae0,uVar21,**(undefined4 **)(puVar17 + 0x1a));
    return 0;
  }
  return 0;
}



void FUN_14019dab0(longlong param_1,longlong param_2,int param_3)

{
  uint uVar1;
  uint *puVar2;
  ulonglong *puVar3;
  undefined8 *puVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined8 uVar9;
  longlong *plVar10;
  longlong *plVar11;
  int iVar12;
  longlong *plVar13;
  int iVar14;
  ulonglong uVar15;
  int iVar16;
  int iVar17;
  int iVar18;
  bool bVar19;
  undefined4 uVar20;
  undefined4 uVar21;
  undefined4 uVar22;
  undefined4 uVar23;
  int local_res20;
  int local_90;
  
  uVar1 = *(uint *)(param_2 + 0x18);
  lVar7 = FUN_140137690();
  plVar10 = (longlong *)0x0;
  iVar6 = 0;
  if (*(longlong *)(lVar7 + 0x88) == 0) {
    return;
  }
  puVar2 = *(uint **)(*(longlong *)(lVar7 + 0x88) +
                     ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar7 + 0x98)) * 8);
  while( true ) {
    if (puVar2 == (uint *)0x0) {
      return;
    }
    if ((puVar2[0xa8] == uVar1) && (*puVar2 == uVar1)) break;
    puVar2 = *(uint **)(puVar2 + 0xa6);
  }
  if (puVar2 == (uint *)0x0) {
    return;
  }
  if (puVar2 == (uint *)0xfffffffffffffff8) {
    return;
  }
  iVar16 = iVar6;
  if (*(longlong *)(puVar2 + 0x1a) != *(longlong *)(puVar2 + 0x1c)) {
    iVar16 = **(int **)(puVar2 + 0x1a);
  }
  uVar21 = 0x3f800000;
  uVar20 = 0;
  plVar13 = (longlong *)(param_1 + 0x6e0);
  local_90 = 0;
  plVar8 = (longlong *)*plVar13;
  iVar14 = 0;
  iVar18 = 0;
  uVar22 = 0x3f800000;
  uVar23 = 0x3f800000;
  local_res20 = 0;
  if (plVar8 == (longlong *)0x0) {
    return;
  }
  if (plVar8 != *(longlong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c == 0) {
      DAT_14060804c = DAT_14060804c + 1;
      FUN_140176d60(1);
      return;
    }
    DAT_14060804c = DAT_14060804c + 1;
    return;
  }
  if ((longlong *)*plVar8 == (longlong *)0x0) {
    return;
  }
  plVar11 = (longlong *)*plVar8;
  if ((plVar8 != *(longlong **)(param_1 + 0x6e8)) &&
     (iVar5 = DAT_14060804c + 1, bVar19 = DAT_14060804c == 0, plVar11 = plVar10,
     DAT_14060804c = iVar5, bVar19)) {
    FUN_140176d60(1);
  }
  iVar5 = (int)plVar11[0x24];
  plVar8 = (longlong *)FUN_1401319f0();
  if (iVar5 == 0x65) {
    iVar5 = 1;
  }
  else if (iVar5 == 0xc9) {
    iVar5 = 2;
  }
  else if (iVar5 == 0x12d) {
    iVar5 = 3;
  }
  else if (iVar5 == 0x191) {
    iVar5 = 4;
  }
  else if (iVar5 == 0x66) {
    iVar5 = 1;
  }
  else if (iVar5 == 0xca) {
    iVar5 = 2;
  }
  else if (iVar5 == 0x12e) {
    iVar5 = 3;
  }
  else if (iVar5 == 0x192) {
    iVar5 = 4;
  }
  uVar15 = ((longlong)iVar5 << 0x20) + (longlong)iVar16;
  if (*plVar8 != 0) {
    for (puVar3 = *(ulonglong **)
                   (*plVar8 + ((uVar15 & 0xffffffff) % (ulonglong)*(uint *)(plVar8 + 2)) * 8);
        puVar3 != (ulonglong *)0x0; puVar3 = (ulonglong *)puVar3[7]) {
      if (((int)puVar3[8] == (int)uVar15) && (*puVar3 == uVar15)) {
        if (puVar3 != (ulonglong *)0x0) {
          local_res20 = (int)puVar3[4];
          iVar17 = (int)puVar3[1];
          iVar14 = *(int *)((longlong)puVar3 + 0xc);
          uVar20 = (undefined4)puVar3[5];
          uVar21 = *(undefined4 *)((longlong)puVar3 + 0x2c);
          uVar22 = (undefined4)puVar3[6];
          iVar5 = (int)puVar3[2];
          iVar18 = *(int *)((longlong)puVar3 + 0x14);
          iVar6 = (int)puVar3[3];
          uVar23 = *(undefined4 *)((longlong)puVar3 + 0x34);
          iVar12 = *(int *)((longlong)puVar3 + 0x1c);
          local_90 = *(int *)((longlong)puVar3 + 0x24);
          goto LAB_14019dcf3;
        }
        break;
      }
    }
  }
  FUN_140418da0(DAT_140607fd8,L"Invalid mcoWeaponDB::GetWeaponInfo");
  iVar12 = 0;
  iVar17 = iVar6;
  iVar5 = iVar6;
LAB_14019dcf3:
  if (param_3 == 4) {
    iVar14 = *(int *)(param_2 + 0x98);
    lVar7 = FUN_140174f50(plVar13);
    *(int *)(lVar7 + 0x5cc) = iVar14 + iVar6;
    *(int *)(lVar7 + 0x5d0) = iVar14 + iVar12;
    local_90 = *(int *)(param_2 + 0x9c) + local_90;
    iVar5 = *(int *)(param_2 + 0x9c) + local_res20;
  }
  else {
    iVar6 = *(int *)(param_2 + 0x98);
    lVar7 = FUN_140174f50(plVar13);
    *(int *)(lVar7 + 0x5cc) = iVar6 + iVar17;
    *(int *)(lVar7 + 0x5d0) = iVar14 + iVar6;
    local_90 = *(int *)(param_2 + 0x9c) + iVar18;
    iVar5 = *(int *)(param_2 + 0x9c) + iVar5;
  }
  lVar7 = FUN_140174f50(plVar13);
  iVar6 = DAT_14060804c;
  *(int *)(lVar7 + 0x5d8) = local_90;
  *(int *)(lVar7 + 0x5d4) = iVar5;
  puVar4 = (undefined8 *)*plVar13;
  plVar8 = plVar10;
  iVar14 = iVar6;
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
      plVar8 = (longlong *)*puVar4;
    }
    else {
      DAT_14060804c = iVar6 + 1;
      iVar14 = DAT_14060804c;
      if (iVar6 == 0) {
        FUN_140176d60(1);
        iVar14 = DAT_14060804c;
      }
    }
  }
  *(undefined4 *)(plVar8 + 0xbc) = uVar20;
  puVar4 = (undefined8 *)*plVar13;
  plVar8 = plVar10;
  iVar6 = iVar14;
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
      plVar8 = (longlong *)*puVar4;
    }
    else {
      DAT_14060804c = iVar14 + 1;
      iVar6 = DAT_14060804c;
      if (iVar14 == 0) {
        FUN_140176d60(1);
        iVar6 = DAT_14060804c;
      }
    }
  }
  *(undefined4 *)(plVar8 + 0xbd) = uVar21;
  puVar4 = (undefined8 *)*plVar13;
  plVar8 = plVar10;
  iVar14 = iVar6;
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
      plVar8 = (longlong *)*puVar4;
    }
    else {
      DAT_14060804c = iVar6 + 1;
      iVar14 = DAT_14060804c;
      if (iVar6 == 0) {
        FUN_140176d60(1);
        iVar14 = DAT_14060804c;
      }
    }
  }
  *(undefined4 *)((longlong)plVar8 + 0x5ec) = uVar22;
  puVar4 = (undefined8 *)*plVar13;
  plVar8 = plVar10;
  iVar6 = iVar14;
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
      plVar8 = (longlong *)*puVar4;
    }
    else {
      DAT_14060804c = iVar14 + 1;
      iVar6 = DAT_14060804c;
      if (iVar14 == 0) {
        FUN_140176d60(1);
        iVar6 = DAT_14060804c;
      }
    }
  }
  *(undefined4 *)(plVar8 + 0xbe) = uVar23;
  puVar4 = (undefined8 *)*plVar13;
  plVar8 = plVar10;
  iVar14 = iVar6;
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
      plVar8 = (longlong *)*puVar4;
    }
    else {
      DAT_14060804c = iVar6 + 1;
      iVar14 = DAT_14060804c;
      if (iVar6 == 0) {
        FUN_140176d60(1);
        iVar14 = DAT_14060804c;
      }
    }
  }
  *(undefined4 *)((longlong)plVar8 + 0x5f4) = *(undefined4 *)(param_2 + 0x24);
  puVar4 = (undefined8 *)*plVar13;
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
      plVar10 = (longlong *)*puVar4;
    }
    else {
      DAT_14060804c = iVar14 + 1;
      if (iVar14 == 0) {
        FUN_140176d60(1);
      }
    }
  }
  iVar6 = (**(code **)(*plVar10 + 0xb0))(plVar10);
  if (iVar6 == 2) {
    lVar7 = FUN_140174f50(plVar13);
    uVar20 = *(undefined4 *)(lVar7 + 0x120);
  }
  else {
    if (iVar6 != 4) {
      return;
    }
    uVar20 = 0;
  }
  lVar7 = FUN_140266970(DAT_140608118,uVar20,iVar16);
  if (lVar7 != 0) {
    uVar20 = *(undefined4 *)(lVar7 + 0x30);
    uVar9 = FUN_140174f50(plVar13);
    FUN_1402328d0(uVar9,uVar20);
    plVar10 = (longlong *)FUN_140174f50(plVar13);
    (**(code **)(*plVar10 + 0x548))(plVar10,*(undefined4 *)(lVar7 + 0x30));
  }
  return;
}



void FUN_14019e010(longlong param_1,longlong param_2)

{
  uint uVar1;
  int iVar2;
  uint *puVar3;
  longlong *plVar4;
  ulonglong uVar5;
  int iVar6;
  DWORD DVar7;
  longlong lVar8;
  HANDLE pvVar9;
  HANDLE pvVar10;
  int iVar11;
  int *piVar12;
  longlong lVar13;
  int iVar14;
  longlong lVar15;
  bool bVar16;
  uint local_res10 [6];
  undefined8 in_stack_ffffffffffffff88;
  undefined4 uVar17;
  undefined8 in_stack_ffffffffffffff90;
  undefined4 uVar18;
  
  uVar1 = *(uint *)(param_2 + 0x18);
  lVar8 = FUN_140137690();
  if (*(longlong *)(lVar8 + 0x88) != 0) {
    uVar5 = (ulonglong)uVar1 % (ulonglong)*(uint *)(lVar8 + 0x98);
    for (puVar3 = *(uint **)(*(longlong *)(lVar8 + 0x88) + uVar5 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0xa6)) {
      if ((puVar3[0xa8] == uVar1) && (*puVar3 == uVar1)) {
        if (puVar3 == (uint *)0x0) {
          return;
        }
        if (puVar3 == (uint *)0xfffffffffffffff8) {
          return;
        }
        iVar6 = FUN_1401ddee0(param_1,CONCAT71((int7)(uVar5 >> 8),4));
        local_res10[0] = puVar3[0x67];
        local_res10[1] = puVar3[0x68];
        local_res10[2] = puVar3[0x69];
        lVar8 = 0;
        local_res10[3] = puVar3[0x6a];
        iVar11 = DAT_14060804c;
        do {
          uVar17 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
          uVar18 = (undefined4)((ulonglong)in_stack_ffffffffffffff90 >> 0x20);
          iVar14 = *(int *)((longlong)local_res10 + lVar8);
          if (((0 < iVar14) && (iVar2 = *(int *)((longlong)local_res10 + lVar8 + 8), 0 < iVar2)) &&
             (plVar4 = *(longlong **)(param_1 + 0x6e0), plVar4 != (longlong *)0x0)) {
            if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
              lVar15 = *plVar4;
              if (lVar15 != 0) {
                if (plVar4 != *(longlong **)(param_1 + 0x6e8)) {
                  DAT_14060804c = iVar11 + 1;
                  if (iVar11 == 0) {
                    FUN_140176d60(1);
                  }
                  lVar15 = 0;
                }
                in_stack_ffffffffffffff90 = CONCAT44(uVar18,*(short *)(param_2 + 0x28) + iVar6);
                in_stack_ffffffffffffff88 = CONCAT44(uVar17,iVar2);
                FUN_140204bf0(lVar15,param_2,*(undefined4 *)(param_2 + 0x18),iVar14,
                              in_stack_ffffffffffffff88,in_stack_ffffffffffffff90);
                iVar11 = DAT_14060804c;
              }
            }
            else {
              DAT_14060804c = iVar11 + 1;
              bVar16 = iVar11 == 0;
              iVar11 = DAT_14060804c;
              if (bVar16) {
                FUN_140176d60(1);
                iVar11 = DAT_14060804c;
              }
            }
          }
          lVar8 = lVar8 + 4;
        } while (lVar8 < 8);
        lVar15 = 3;
        piVar12 = (int *)(param_2 + 0x30);
        lVar8 = 3;
        do {
          uVar17 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
          uVar18 = (undefined4)((ulonglong)in_stack_ffffffffffffff90 >> 0x20);
          if (((0 < *piVar12) && (0 < piVar12[3])) &&
             (plVar4 = *(longlong **)(param_1 + 0x6e0), plVar4 != (longlong *)0x0)) {
            if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
              lVar13 = *plVar4;
              if (lVar13 != 0) {
                if (plVar4 != *(longlong **)(param_1 + 0x6e8)) {
                  DAT_14060804c = iVar11 + 1;
                  if (iVar11 == 0) {
                    FUN_140176d60(1);
                  }
                  lVar13 = 0;
                }
                in_stack_ffffffffffffff90 = CONCAT44(uVar18,*(short *)(param_2 + 0x28) + iVar6);
                in_stack_ffffffffffffff88 = CONCAT44(uVar17,piVar12[3]);
                FUN_140204bf0(lVar13,param_2,*(undefined4 *)(param_2 + 0x18),*piVar12,
                              in_stack_ffffffffffffff88,in_stack_ffffffffffffff90);
                iVar11 = DAT_14060804c;
              }
            }
            else {
              DAT_14060804c = iVar11 + 1;
              bVar16 = iVar11 == 0;
              iVar11 = DAT_14060804c;
              if (bVar16) {
                FUN_140176d60(1);
                iVar11 = DAT_14060804c;
              }
            }
          }
          piVar12 = piVar12 + 1;
          lVar8 = lVar8 + -1;
        } while (lVar8 != 0);
        iVar14 = 0;
        piVar12 = (int *)(param_2 + 0x58);
        lVar8 = 3;
        do {
          if (((0 < piVar12[-3]) && (0 < *piVar12)) &&
             (plVar4 = *(longlong **)(param_1 + 0x6e0), plVar4 != (longlong *)0x0)) {
            if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
              if (*plVar4 != 0) {
                if ((plVar4 != *(longlong **)(param_1 + 0x6e8)) &&
                   (DAT_14060804c = iVar11 + 1, bVar16 = iVar11 == 0, iVar11 = DAT_14060804c, bVar16
                   )) {
                  FUN_140176d60(1);
                  iVar11 = DAT_14060804c;
                }
                if (piVar12[-3] == 0x641) {
                  iVar14 = iVar14 + *piVar12;
                }
              }
            }
            else {
              DAT_14060804c = iVar11 + 1;
              bVar16 = iVar11 == 0;
              iVar11 = DAT_14060804c;
              if (bVar16) {
                FUN_140176d60(1);
                iVar11 = DAT_14060804c;
              }
            }
          }
          piVar12 = piVar12 + 1;
          lVar8 = lVar8 + -1;
        } while (lVar8 != 0);
        piVar12 = (int *)(param_2 + 0x4c);
        do {
          uVar17 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
          uVar18 = (undefined4)((ulonglong)in_stack_ffffffffffffff90 >> 0x20);
          if (((0 < *piVar12) && (0 < piVar12[3])) &&
             (plVar4 = *(longlong **)(param_1 + 0x6e0), plVar4 != (longlong *)0x0)) {
            if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
              lVar8 = *plVar4;
              if (lVar8 != 0) {
                if (plVar4 != *(longlong **)(param_1 + 0x6e8)) {
                  DAT_14060804c = iVar11 + 1;
                  if ((iVar11 == 0) &&
                     (pvVar9 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,
                                           0x80,(HANDLE)0x0), pvVar9 != (HANDLE)0x0)) {
                    DVar7 = GetCurrentProcessId();
                    pvVar10 = GetCurrentProcess();
                    uVar18 = 0;
                    uVar17 = 0;
                    MiniDumpWriteDump(pvVar10,DVar7,pvVar9,2,0,0,0);
                    CloseHandle(pvVar9);
                  }
                  lVar8 = 0;
                }
                in_stack_ffffffffffffff90 = CONCAT44(uVar18,*(short *)(param_2 + 0x28) + iVar6);
                in_stack_ffffffffffffff88 =
                     CONCAT44(uVar17,(int)(((float)iVar14 / 10000.0 + 1.0) * (float)piVar12[3]));
                FUN_140204bf0(lVar8,param_2,*(undefined4 *)(param_2 + 0x18),*piVar12,
                              in_stack_ffffffffffffff88,in_stack_ffffffffffffff90);
                iVar11 = DAT_14060804c;
              }
            }
            else {
              DAT_14060804c = iVar11 + 1;
              bVar16 = iVar11 == 0;
              iVar11 = DAT_14060804c;
              if (bVar16) {
                in_stack_ffffffffffffff90 = CONCAT44(uVar18,0x80);
                in_stack_ffffffffffffff88 = CONCAT44(uVar17,2);
                pvVar9 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                     (HANDLE)0x0);
                iVar11 = DAT_14060804c;
                if (pvVar9 != (HANDLE)0x0) {
                  DVar7 = GetCurrentProcessId();
                  pvVar10 = GetCurrentProcess();
                  in_stack_ffffffffffffff90 = 0;
                  in_stack_ffffffffffffff88 = 0;
                  MiniDumpWriteDump(pvVar10,DVar7,pvVar9,2,0,0,0);
                  CloseHandle(pvVar9);
                  iVar11 = DAT_14060804c;
                }
              }
            }
          }
          piVar12 = piVar12 + 1;
          lVar15 = lVar15 + -1;
        } while (lVar15 != 0);
        return;
      }
    }
  }
  return;
}



void FUN_14019e4f0(longlong param_1,longlong param_2,undefined4 param_3)

{
  longlong *plVar1;
  float fVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  float local_res10 [4];
  float local_res20 [2];
  
  iVar3 = FUN_1401ddee0(param_1,4);
  if (0 < *(short *)(param_2 + 0x28) + iVar3) {
    plVar1 = *(longlong **)(param_1 + 0x6e0);
    local_res10[0] = 0.0;
    local_res20[0] = 0.0;
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
        lVar5 = *plVar1;
        if (lVar5 != 0) {
          if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
            iVar4 = DAT_14060804c + 1;
            bVar6 = DAT_14060804c == 0;
            DAT_14060804c = iVar4;
            if (bVar6) {
              FUN_140176d60(1);
            }
            lVar5 = 0;
          }
          FUN_14019d0c0(*(undefined4 *)(param_2 + 0x18),*(undefined4 *)(lVar5 + 0x120),
                        *(short *)(param_2 + 0x28) + iVar3,local_res10,local_res20,param_3,
                        *(undefined4 *)(param_2 + 0x98),*(undefined4 *)(param_2 + 0x9c));
          fVar2 = local_res10[0];
          if (0.0 < local_res10[0]) {
            lVar5 = FUN_140174f50(param_1 + 0x6e0);
            *(int *)(lVar5 + 0x64c) = *(int *)(lVar5 + 0x64c) + (int)fVar2;
            *(undefined1 *)(lVar5 + 0x606) = 1;
          }
          fVar2 = local_res20[0];
          if (0.0 < local_res20[0]) {
            lVar5 = FUN_140174f50(param_1 + 0x6e0);
            *(int *)(lVar5 + 0x650) = *(int *)(lVar5 + 0x650) + (int)fVar2;
            *(undefined1 *)(lVar5 + 0x606) = 1;
          }
        }
      }
      else {
        iVar3 = DAT_14060804c + 1;
        bVar6 = DAT_14060804c == 0;
        DAT_14060804c = iVar3;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return;
}



undefined8 FUN_14019e660(undefined8 param_1,longlong param_2,undefined4 param_3)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  
  if (*(int *)(param_2 + 0x24) < 1) {
    FUN_14019d5c0();
    return 1;
  }
  uVar1 = *(uint *)(param_2 + 0x18);
  lVar2 = FUN_140137690();
  if (*(longlong *)(lVar2 + 0x88) != 0) {
    for (puVar3 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                            ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0xa6)) {
      if ((puVar3[0xa8] == uVar1) && (*puVar3 == uVar1)) {
        if (puVar3 != (uint *)0x0) goto LAB_14019e6e6;
        break;
      }
    }
  }
  puVar3 = (uint *)0x0;
LAB_14019e6e6:
  if (((puVar3 != (uint *)0x0) && (puVar3 != (uint *)0xfffffffffffffff8)) &&
     (*(longlong *)(puVar3 + 0x1a) != *(longlong *)(puVar3 + 0x1c))) {
    FUN_14019dab0(param_1,param_2,param_3);
    FUN_14019e010(param_1,param_2);
    FUN_14019e4f0(param_1,param_2,param_3);
    FUN_14019e760(param_1,param_2);
    return 1;
  }
  return 0;
}



void FUN_14019e760(longlong param_1,longlong param_2)

{
  ushort uVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  longlong lVar10;
  bool bVar11;
  
  if ((*(short *)(param_2 + 0x7c) != 0) &&
     (plVar2 = *(longlong **)(param_1 + 0x6e0), plVar2 != (longlong *)0x0)) {
    if (plVar2 == *(longlong **)(param_1 + 0x6e8)) {
      lVar4 = *plVar2;
      if (lVar4 != 0) {
        lVar10 = 0;
        lVar5 = lVar4;
        if ((plVar2 != *(longlong **)(param_1 + 0x6e8)) &&
           (iVar3 = DAT_14060804c + 1, bVar11 = DAT_14060804c == 0, lVar5 = lVar10,
           DAT_14060804c = iVar3, bVar11)) {
          FUN_140176d60(CONCAT71((int7)((ulonglong)lVar4 >> 8),1));
        }
        plVar2 = *(longlong **)(param_1 + 0x6e0);
        iVar3 = *(int *)(lVar5 + 0x5cc);
        lVar4 = lVar10;
        if (plVar2 != (longlong *)0x0) {
          if (plVar2 == *(longlong **)(param_1 + 0x6e8)) {
            lVar4 = *plVar2;
          }
          else {
            iVar6 = DAT_14060804c + 1;
            bVar11 = DAT_14060804c == 0;
            DAT_14060804c = iVar6;
            if (bVar11) {
              FUN_140176d60(CONCAT71((int7)((ulonglong)lVar5 >> 8),1));
            }
          }
        }
        iVar6 = *(int *)(lVar4 + 0x5d0);
        plVar2 = *(longlong **)(param_1 + 0x6e0);
        lVar4 = lVar10;
        if (plVar2 != (longlong *)0x0) {
          if (plVar2 == *(longlong **)(param_1 + 0x6e8)) {
            lVar4 = *plVar2;
          }
          else {
            iVar7 = DAT_14060804c + 1;
            bVar11 = DAT_14060804c == 0;
            DAT_14060804c = iVar7;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
        iVar7 = *(int *)(lVar4 + 0x5d4);
        plVar2 = *(longlong **)(param_1 + 0x6e0);
        lVar4 = lVar10;
        if (plVar2 != (longlong *)0x0) {
          if (plVar2 == *(longlong **)(param_1 + 0x6e8)) {
            lVar4 = *plVar2;
          }
          else {
            iVar8 = DAT_14060804c + 1;
            bVar11 = DAT_14060804c == 0;
            DAT_14060804c = iVar8;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
        iVar8 = *(int *)(lVar4 + 0x5d8);
        plVar2 = *(longlong **)(param_1 + 0x6e0);
        lVar4 = lVar10;
        if (plVar2 != (longlong *)0x0) {
          if (plVar2 == *(longlong **)(param_1 + 0x6e8)) {
            lVar4 = *plVar2;
          }
          else {
            iVar9 = DAT_14060804c + 1;
            bVar11 = DAT_14060804c == 0;
            DAT_14060804c = iVar9;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
        iVar9 = DAT_14060804c;
        iVar6 = (uint)*(ushort *)(param_2 + 0x7c) + iVar6;
        *(uint *)(lVar4 + 0x5cc) = (uint)*(ushort *)(param_2 + 0x7c) + iVar3;
        *(int *)(lVar4 + 0x5d0) = iVar6;
        plVar2 = *(longlong **)(param_1 + 0x6e0);
        if (plVar2 != (longlong *)0x0) {
          if (plVar2 == *(longlong **)(param_1 + 0x6e8)) {
            lVar10 = *plVar2;
          }
          else {
            DAT_14060804c = iVar9 + 1;
            if (iVar9 == 0) {
              FUN_140176d60(CONCAT71((uint7)(uint3)((uint)iVar6 >> 8),1));
            }
          }
        }
        uVar1 = *(ushort *)(param_2 + 0x7c);
        *(uint *)(lVar10 + 0x5d4) = (uint)uVar1 + iVar7;
        *(uint *)(lVar10 + 0x5d8) = (uint)uVar1 + iVar8;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar11 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_14019e9a0(longlong param_1,longlong param_2)

{
  undefined8 *puVar1;
  int iVar2;
  int iVar3;
  longlong *plVar4;
  longlong *plVar5;
  int iVar6;
  longlong *plVar7;
  bool bVar8;
  
  if ((*(short *)(param_2 + 0x7c) != 0) &&
     (plVar5 = *(longlong **)(param_1 + 0x6e0), plVar5 != (longlong *)0x0)) {
    if (plVar5 == *(longlong **)(param_1 + 0x6e8)) {
      if ((longlong *)*plVar5 != (longlong *)0x0) {
        plVar7 = (longlong *)0x0;
        plVar4 = (longlong *)*plVar5;
        if ((plVar5 != *(longlong **)(param_1 + 0x6e8)) &&
           (iVar2 = DAT_14060804c + 1, bVar8 = DAT_14060804c == 0, plVar4 = plVar7,
           DAT_14060804c = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        iVar2 = (**(code **)(*plVar4 + 0x2e0))();
        plVar5 = *(longlong **)(param_1 + 0x6e0);
        plVar4 = plVar7;
        if (plVar5 != (longlong *)0x0) {
          if (plVar5 == *(longlong **)(param_1 + 0x6e8)) {
            plVar4 = (longlong *)*plVar5;
          }
          else {
            iVar3 = DAT_14060804c + 1;
            bVar8 = DAT_14060804c == 0;
            DAT_14060804c = iVar3;
            if (bVar8) {
              FUN_140176d60(1);
            }
          }
        }
        iVar3 = (**(code **)(*plVar4 + 0x2e8))();
        puVar1 = *(undefined8 **)(param_1 + 0x6e0);
        plVar5 = plVar7;
        if (puVar1 != (undefined8 *)0x0) {
          if (puVar1 == *(undefined8 **)(param_1 + 0x6e8)) {
            plVar5 = (longlong *)*puVar1;
          }
          else {
            iVar6 = DAT_14060804c + 1;
            bVar8 = DAT_14060804c == 0;
            DAT_14060804c = iVar6;
            if (bVar8) {
              FUN_140176d60(1);
            }
          }
        }
        iVar6 = DAT_14060804c;
        *(uint *)((longlong)plVar5 + 0x5bc) = (uint)*(ushort *)(param_2 + 0x7c) + iVar2;
        puVar1 = *(undefined8 **)(param_1 + 0x6e0);
        if (puVar1 != (undefined8 *)0x0) {
          if (puVar1 == *(undefined8 **)(param_1 + 0x6e8)) {
            plVar7 = (longlong *)*puVar1;
          }
          else {
            DAT_14060804c = iVar6 + 1;
            if (iVar6 == 0) {
              FUN_140176d60(CONCAT71((int7)((ulonglong)plVar5 >> 8),1));
            }
          }
        }
        *(uint *)(plVar7 + 0xb8) = (uint)*(ushort *)(param_2 + 0x7c) + iVar3;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_14019eb40(longlong param_1,longlong param_2)

{
  float fVar1;
  float fVar2;
  uint uVar3;
  uint uVar4;
  uint *puVar5;
  undefined8 *puVar6;
  int iVar7;
  longlong lVar8;
  uint *puVar9;
  int iVar10;
  uint *puVar11;
  bool bVar12;
  
  uVar3 = *(uint *)(param_2 + 0x18);
  lVar8 = FUN_140137690();
  puVar11 = (uint *)0x0;
  puVar9 = puVar11;
  if (*(longlong *)(lVar8 + 0x88) != 0) {
    for (puVar5 = *(uint **)(*(longlong *)(lVar8 + 0x88) +
                            ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar8 + 0x98)) * 8);
        (puVar9 = puVar11, puVar5 != (uint *)0x0 &&
        ((puVar5[0xa8] != uVar3 || (puVar9 = puVar5, *puVar5 != uVar3))));
        puVar5 = *(uint **)(puVar5 + 0xa6)) {
    }
  }
  if (puVar9 != (uint *)0x0) {
    uVar3 = puVar9[0x53];
    uVar4 = puVar9[0x54];
    fVar1 = (float)puVar9[0x5a];
    fVar2 = (float)puVar9[0x59];
    puVar6 = *(undefined8 **)(param_1 + 0x6e0);
    if (puVar6 != (undefined8 *)0x0) {
      if (puVar6 == *(undefined8 **)(param_1 + 0x6e8)) {
        if ((uint *)*puVar6 != (uint *)0x0) {
          puVar9 = (uint *)*puVar6;
          if ((puVar6 != *(undefined8 **)(param_1 + 0x6e8)) &&
             (iVar7 = DAT_14060804c + 1, bVar12 = DAT_14060804c == 0, puVar9 = puVar11,
             DAT_14060804c = iVar7, bVar12)) {
            FUN_140176d60(1);
          }
          iVar7 = DAT_14060804c;
          puVar9[0x16f] = puVar9[0x16f] + *(int *)(param_2 + 0x98) + uVar3;
          puVar6 = *(undefined8 **)(param_1 + 0x6e0);
          puVar9 = puVar11;
          iVar10 = iVar7;
          if (puVar6 != (undefined8 *)0x0) {
            if (puVar6 == *(undefined8 **)(param_1 + 0x6e8)) {
              puVar9 = (uint *)*puVar6;
            }
            else {
              DAT_14060804c = iVar7 + 1;
              iVar10 = DAT_14060804c;
              if (iVar7 == 0) {
                FUN_140176d60(1);
                iVar10 = DAT_14060804c;
              }
            }
          }
          puVar9[0x170] = puVar9[0x170] + *(int *)(param_2 + 0x9c) + uVar4;
          puVar6 = *(undefined8 **)(param_1 + 0x6e0);
          puVar9 = puVar11;
          iVar7 = iVar10;
          if (puVar6 != (undefined8 *)0x0) {
            if (puVar6 == *(undefined8 **)(param_1 + 0x6e8)) {
              puVar9 = (uint *)*puVar6;
            }
            else {
              DAT_14060804c = iVar10 + 1;
              iVar7 = DAT_14060804c;
              if (iVar10 == 0) {
                FUN_140176d60(1);
                iVar7 = DAT_14060804c;
              }
            }
          }
          puVar9[0x171] = (uint)(fVar2 + (float)puVar9[0x171]);
          puVar6 = *(undefined8 **)(param_1 + 0x6e0);
          if (puVar6 != (undefined8 *)0x0) {
            if (puVar6 == *(undefined8 **)(param_1 + 0x6e8)) {
              puVar11 = (uint *)*puVar6;
            }
            else {
              DAT_14060804c = iVar7 + 1;
              if (iVar7 == 0) {
                FUN_140176d60(1);
              }
            }
          }
          puVar11[0x172] = (uint)(fVar1 + (float)puVar11[0x172]);
        }
      }
      else {
        iVar7 = DAT_14060804c + 1;
        bVar12 = DAT_14060804c == 0;
        DAT_14060804c = iVar7;
        if (bVar12) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return;
}



void FUN_14019ed60(longlong param_1,longlong param_2)

{
  uint uVar1;
  int iVar2;
  uint *puVar3;
  longlong *plVar4;
  ulonglong *puVar5;
  undefined8 *puVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  DWORD DVar10;
  longlong lVar11;
  HANDLE hObject;
  HANDLE pvVar12;
  ulonglong uVar13;
  undefined8 uVar14;
  ulonglong uVar15;
  int *piVar16;
  ulonglong uVar17;
  longlong lVar18;
  bool bVar19;
  undefined8 local_res10;
  undefined8 local_res18 [2];
  undefined8 in_stack_ffffffffffffff88;
  undefined4 uVar20;
  undefined8 in_stack_ffffffffffffff90;
  undefined4 uVar21;
  
  uVar1 = *(uint *)(param_2 + 0x18);
  uVar17 = 0;
  local_res10 = 0;
  local_res18[0] = 0;
  lVar11 = FUN_140137690();
  if (*(longlong *)(lVar11 + 0x88) != 0) {
    for (puVar3 = *(uint **)(*(longlong *)(lVar11 + 0x88) +
                            ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar11 + 0x98)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0xa6)) {
      if ((puVar3[0xa8] == uVar1) && (*puVar3 == uVar1)) {
        if ((puVar3 != (uint *)0x0) && (puVar3 != (uint *)0xfffffffffffffff8)) {
          local_res10 = *(undefined8 *)(puVar3 + 0x67);
          local_res18[0] = *(undefined8 *)(puVar3 + 0x69);
        }
        break;
      }
    }
  }
  iVar7 = FUN_1401ddee0(param_1,5);
  plVar4 = *(longlong **)(param_1 + 0x6e0);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
      uVar15 = uVar17;
      if (*plVar4 != 0) {
        do {
          uVar20 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
          uVar21 = (undefined4)((ulonglong)in_stack_ffffffffffffff90 >> 0x20);
          iVar9 = *(int *)((longlong)local_res18 + (uVar15 - 8));
          if ((0 < iVar9) && (iVar2 = *(int *)((longlong)local_res18 + uVar15), 0 < iVar2)) {
            puVar5 = *(ulonglong **)(param_1 + 0x6e0);
            uVar13 = uVar17;
            if (puVar5 != (ulonglong *)0x0) {
              if (puVar5 == *(ulonglong **)(param_1 + 0x6e8)) {
                uVar13 = *puVar5;
              }
              else {
                iVar8 = DAT_14060804c + 1;
                bVar19 = DAT_14060804c == 0;
                DAT_14060804c = iVar8;
                if (bVar19) {
                  FUN_140176d60(1);
                }
              }
            }
            in_stack_ffffffffffffff90 = CONCAT44(uVar21,*(short *)(param_2 + 0x28) + iVar7);
            in_stack_ffffffffffffff88 = CONCAT44(uVar20,iVar2);
            FUN_140204bf0(uVar13,param_2,*(undefined4 *)(param_2 + 0x18),iVar9,
                          in_stack_ffffffffffffff88,in_stack_ffffffffffffff90);
          }
          uVar15 = uVar15 + 4;
        } while ((longlong)uVar15 < 8);
        lVar18 = 3;
        piVar16 = (int *)(param_2 + 0x30);
        lVar11 = 3;
        do {
          uVar20 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
          uVar21 = (undefined4)((ulonglong)in_stack_ffffffffffffff90 >> 0x20);
          if ((0 < *piVar16) && (0 < piVar16[3])) {
            puVar5 = *(ulonglong **)(param_1 + 0x6e0);
            uVar15 = uVar17;
            if (puVar5 != (ulonglong *)0x0) {
              if (puVar5 == *(ulonglong **)(param_1 + 0x6e8)) {
                uVar15 = *puVar5;
              }
              else {
                iVar9 = DAT_14060804c + 1;
                bVar19 = DAT_14060804c == 0;
                DAT_14060804c = iVar9;
                if (bVar19) {
                  FUN_140176d60(1);
                }
              }
            }
            in_stack_ffffffffffffff90 = CONCAT44(uVar21,*(short *)(param_2 + 0x28) + iVar7);
            in_stack_ffffffffffffff88 = CONCAT44(uVar20,piVar16[3]);
            FUN_140204bf0(uVar15,param_2,*(undefined4 *)(param_2 + 0x18),*piVar16,
                          in_stack_ffffffffffffff88,in_stack_ffffffffffffff90);
          }
          piVar16 = piVar16 + 1;
          lVar11 = lVar11 + -1;
        } while (lVar11 != 0);
        piVar16 = (int *)(param_2 + 0x58);
        lVar11 = 3;
        iVar9 = DAT_14060804c;
        do {
          if (((0 < piVar16[-3]) && (0 < *piVar16)) &&
             (plVar4 = *(longlong **)(param_1 + 0x6e0), plVar4 != (longlong *)0x0)) {
            if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
              if (*plVar4 != 0) {
                if ((plVar4 != *(longlong **)(param_1 + 0x6e8)) &&
                   (DAT_14060804c = iVar9 + 1, bVar19 = iVar9 == 0, iVar9 = DAT_14060804c, bVar19))
                {
                  FUN_140176d60(1);
                  iVar9 = DAT_14060804c;
                }
                if (piVar16[-3] == 0x641) {
                  uVar17 = (ulonglong)(uint)((int)uVar17 + *piVar16);
                }
              }
            }
            else {
              DAT_14060804c = iVar9 + 1;
              bVar19 = iVar9 == 0;
              iVar9 = DAT_14060804c;
              if (bVar19) {
                FUN_140176d60(1);
                iVar9 = DAT_14060804c;
              }
            }
          }
          piVar16 = piVar16 + 1;
          lVar11 = lVar11 + -1;
        } while (lVar11 != 0);
        piVar16 = (int *)(param_2 + 0x4c);
        do {
          uVar20 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
          uVar21 = (undefined4)((ulonglong)in_stack_ffffffffffffff90 >> 0x20);
          if ((0 < *piVar16) && (0 < piVar16[3])) {
            puVar6 = *(undefined8 **)(param_1 + 0x6e0);
            if (puVar6 == (undefined8 *)0x0) {
LAB_14019f0e8:
              uVar14 = 0;
            }
            else {
              if (puVar6 != *(undefined8 **)(param_1 + 0x6e8)) {
                DAT_14060804c = iVar9 + 1;
                if ((iVar9 == 0) &&
                   (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80
                                          ,(HANDLE)0x0), hObject != (HANDLE)0x0)) {
                  DVar10 = GetCurrentProcessId();
                  pvVar12 = GetCurrentProcess();
                  uVar21 = 0;
                  uVar20 = 0;
                  MiniDumpWriteDump(pvVar12,DVar10,hObject,2,0,0,0);
                  CloseHandle(hObject);
                }
                goto LAB_14019f0e8;
              }
              uVar14 = *puVar6;
            }
            in_stack_ffffffffffffff90 = CONCAT44(uVar21,*(short *)(param_2 + 0x28) + iVar7);
            in_stack_ffffffffffffff88 =
                 CONCAT44(uVar20,(int)(((float)(int)uVar17 / 10000.0 + 1.0) * (float)piVar16[3]));
            FUN_140204bf0(uVar14,param_2,*(undefined4 *)(param_2 + 0x18),*piVar16,
                          in_stack_ffffffffffffff88,in_stack_ffffffffffffff90);
            iVar9 = DAT_14060804c;
          }
          piVar16 = piVar16 + 1;
          lVar18 = lVar18 + -1;
        } while (lVar18 != 0);
      }
    }
    else {
      iVar7 = DAT_14060804c + 1;
      bVar19 = DAT_14060804c == 0;
      DAT_14060804c = iVar7;
      if (bVar19) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_14019f170(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  float fVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  float local_res10 [2];
  float local_res18 [2];
  
  iVar3 = FUN_1401ddee0(param_1,5);
  if (0 < *(short *)(param_2 + 0x28) + iVar3) {
    plVar1 = *(longlong **)(param_1 + 0x6e0);
    local_res10[0] = 0.0;
    local_res18[0] = 0.0;
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
        if (*plVar1 != 0) {
          if ((plVar1 != *(longlong **)(param_1 + 0x6e8)) &&
             (iVar4 = DAT_14060804c + 1, bVar6 = DAT_14060804c == 0, DAT_14060804c = iVar4, bVar6))
          {
            FUN_140176d60(1);
          }
          FUN_14019d400(*(undefined4 *)(param_2 + 0x18),*(short *)(param_2 + 0x28) + iVar3,
                        local_res10,local_res18);
          fVar2 = local_res10[0];
          if (0.0 < local_res10[0]) {
            lVar5 = FUN_140174f50(param_1 + 0x6e0);
            *(float *)(lVar5 + 0x770) = fVar2 + *(float *)(lVar5 + 0x770);
            *(undefined1 *)(lVar5 + 0x607) = 1;
          }
          fVar2 = local_res18[0];
          if (0.0 < local_res18[0]) {
            lVar5 = FUN_140174f50(param_1 + 0x6e0);
            *(float *)(lVar5 + 0x774) = fVar2 + *(float *)(lVar5 + 0x774);
            *(undefined1 *)(lVar5 + 0x607) = 1;
          }
        }
      }
      else {
        iVar3 = DAT_14060804c + 1;
        bVar6 = DAT_14060804c == 0;
        DAT_14060804c = iVar3;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return;
}



undefined8 FUN_14019f2b0(longlong param_1,longlong param_2)

{
  float fVar1;
  uint uVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  longlong lVar5;
  uint *puVar6;
  undefined8 uVar7;
  int iVar8;
  uint *puVar9;
  uint *puVar10;
  uint uVar11;
  bool bVar12;
  
  uVar11 = *(uint *)(param_2 + 0x18);
  lVar5 = FUN_140137690();
  puVar10 = (uint *)0x0;
  if (*(longlong *)(lVar5 + 0x88) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                            ((ulonglong)uVar11 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xa6)) {
      if ((puVar6[0xa8] == uVar11) && (*puVar6 == uVar11)) {
        if (puVar6 != (uint *)0x0) {
          uVar11 = puVar6[0x33];
          goto LAB_14019f324;
        }
        break;
      }
    }
  }
  uVar11 = 0;
LAB_14019f324:
  plVar3 = *(longlong **)(param_1 + 0x6e0);
  if (plVar3 == (longlong *)0x0) {
    return 0;
  }
  if (plVar3 != *(longlong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return 0;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return 0;
  }
  if (*plVar3 == 0) {
    return 0;
  }
  uVar2 = *(uint *)(param_2 + 0x18);
  lVar5 = FUN_140137690();
  if (*(longlong *)(lVar5 + 0x88) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xa6)) {
      if ((puVar6[0xa8] == uVar2) && (*puVar6 == uVar2)) {
        if (puVar6 != (uint *)0x0) goto LAB_14019f3b2;
        break;
      }
    }
  }
  puVar6 = puVar10;
LAB_14019f3b2:
  if ((puVar6 == (uint *)0x0) || (puVar6 == (uint *)0xfffffffffffffff8)) {
    return 0;
  }
  puVar4 = *(undefined8 **)(param_1 + 0x6e0);
  puVar9 = puVar10;
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
      puVar9 = (uint *)*puVar4;
    }
    else {
      iVar8 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar8;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  puVar4 = *(undefined8 **)(param_1 + 0x6e0);
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
      puVar10 = (uint *)*puVar4;
    }
    else {
      iVar8 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar8;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  fVar1 = (float)puVar10[0x8a6];
  iVar8 = FUN_1402f8580(puVar9);
  if ((int)puVar6[0x44] <= iVar8 + (int)fVar1) {
    if (((uVar11 != 7) && (uVar11 != 8)) && (uVar11 != 9)) {
      uVar7 = FUN_140137690();
      iVar8 = FUN_140136b30(uVar7,*(undefined4 *)(param_2 + 0x18));
      if ((iVar8 != 5) && (*(int *)(param_2 + 0x24) < 1)) {
        return 1;
      }
    }
    FUN_14019eb40(param_1,param_2);
    FUN_14019ed60(param_1,param_2);
    FUN_14019f170(param_1,param_2);
    FUN_14019e9a0(param_1,param_2);
    return 1;
  }
  return 0;
}



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

ulonglong FUN_14019f4e0(longlong param_1,uint param_2)

{
  undefined8 *puVar1;
  int iVar2;
  longlong *plVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  uint *puVar7;
  uint *puVar8;
  uint uVar9;
  uint *puVar10;
  uint *puVar11;
  bool bVar12;
  bool bVar13;
  undefined4 local_res10 [2];
  
  plVar3 = (longlong *)FUN_14013b410();
  uVar5 = (ulonglong)param_2 / (ulonglong)*(uint *)(plVar3 + 2);
  puVar10 = (uint *)0x0;
  puVar8 = puVar10;
  if (*plVar3 != 0) {
    for (puVar11 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8)
        ; (puVar8 = puVar10, puVar11 != (uint *)0x0 &&
          ((puVar11[0x20] != param_2 || (puVar8 = puVar11, *puVar11 != param_2))));
        puVar11 = *(uint **)(puVar11 + 0x1e)) {
    }
  }
  if ((puVar8 != (uint *)0x0) && (uVar5 = 1, puVar8 != (uint *)0xfffffffffffffff8)) {
    bVar13 = false;
    puVar1 = *(undefined8 **)(param_1 + 0xb28);
    puVar11 = puVar10;
    if (puVar1 != (undefined8 *)0x0) {
      if (puVar1 == *(undefined8 **)(param_1 + 0xb30)) {
        puVar11 = (uint *)0x0;
        if ((uint *)*puVar1 != (uint *)0x0) {
          puVar11 = (uint *)*puVar1;
          if ((puVar1 != *(undefined8 **)(param_1 + 0xb30)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar13 = DAT_1406080a8 == 0, puVar11 = puVar10,
             DAT_1406080a8 = iVar2, bVar13)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40(puVar11);
          bVar13 = true;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar12 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar12) {
          FUN_140176d60(1);
          puVar11 = (uint *)0x0;
        }
      }
    }
    local_res10[0] = 0;
    puVar1 = *(undefined8 **)(param_1 + 0x6c0);
    puVar7 = puVar10;
    if (puVar1 != (undefined8 *)0x0) {
      if (puVar1 == *(undefined8 **)(param_1 + 0x6c8)) {
        puVar7 = (uint *)*puVar1;
      }
      else {
        iVar2 = DAT_140608048 + 1;
        bVar12 = DAT_140608048 == 0;
        DAT_140608048 = iVar2;
        if (bVar12) {
          FUN_140176d60(1);
        }
      }
    }
    uVar4 = FUN_1401f5320(puVar7,puVar8 + 0xe,local_res10);
    puVar8 = puVar8 + 0x14;
    uVar5 = uVar4;
    do {
      if ((((0 < (int)*puVar8) && ((int)puVar10 + 2 <= (int)uVar4)) && (puVar8[5] != 0)) &&
         (uVar5 = FUN_140174f50(param_1 + 0x6e0), uVar5 != 0)) {
        uVar6 = FUN_140174f50(param_1 + 0x6e0);
        uVar5 = FUN_140204bf0(uVar6,&DAT_14044e480,0,*puVar8,puVar8[5],1);
      }
      uVar9 = (int)puVar10 + 1;
      puVar10 = (uint *)(ulonglong)uVar9;
      puVar8 = puVar8 + 1;
    } while ((int)uVar9 < 5);
    if (bVar13) {
      uVar5 = FUN_14034edd0(puVar11);
    }
  }
  return uVar5;
}



undefined8
FUN_14019f6f0(longlong param_1,ulonglong *param_2,int *param_3,int *param_4,undefined4 param_5)

{
  undefined4 uVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  int iVar4;
  uint uVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  longlong *plVar9;
  bool bVar10;
  bool bVar11;
  undefined2 local_res8 [4];
  undefined8 in_stack_fffffffffffffd78;
  undefined8 uVar12;
  undefined4 uVar14;
  ulonglong *puVar13;
  undefined8 in_stack_fffffffffffffd80;
  uint uVar15;
  undefined8 in_stack_fffffffffffffd88;
  undefined4 uVar17;
  ulonglong uVar16;
  undefined8 in_stack_fffffffffffffd90;
  undefined4 uVar18;
  undefined8 in_stack_fffffffffffffd98;
  uint uVar19;
  undefined8 in_stack_fffffffffffffda0;
  uint uVar20;
  longlong local_258;
  undefined2 local_248 [2];
  uint local_244;
  int local_240 [2];
  longlong *local_238;
  longlong *local_230;
  uint local_228 [2];
  uint local_220 [2];
  int local_218 [2];
  undefined4 local_210 [2];
  undefined4 local_208 [2];
  int local_200 [2];
  undefined4 local_1f8;
  undefined4 local_1f4;
  undefined4 local_1f0;
  undefined4 local_1ec;
  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;
  undefined8 local_1b8;
  ulonglong local_1a8;
  ulonglong local_1a0;
  undefined4 local_190;
  undefined4 local_100;
  undefined1 local_f8 [16];
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar14 = (undefined4)((ulonglong)in_stack_fffffffffffffd78 >> 0x20);
  uVar15 = (uint)((ulonglong)in_stack_fffffffffffffd80 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffd88 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffd90 >> 0x20);
  uVar19 = (uint)((ulonglong)in_stack_fffffffffffffd98 >> 0x20);
  uVar20 = (uint)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
  local_1b8 = 0xfffffffffffffffe;
  local_258 = 0;
  bVar11 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        local_258 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, local_258 = 0,
           DAT_1406080a8 = iVar4, bVar11)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar11 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140198570(param_1,&local_238);
  plVar2 = local_238;
  if (local_238 != (longlong *)0x0) {
    if (local_238 == local_230) {
      if (*local_238 != 0) {
        plVar9 = *(longlong **)(param_1 + 0x6c0);
        if (plVar9 != (longlong *)0x0) {
          if (plVar9 == *(longlong **)(param_1 + 0x6c8)) {
            if (*plVar9 != 0) {
              if ((*param_3 < 0) || (0x17 < *param_3)) {
                LOCK();
                plVar2 = local_238 + 1;
                *(int *)plVar2 = (int)*plVar2 + -1;
                UNLOCK();
                if ((int)*plVar2 == 0) {
                  puVar3 = (undefined8 *)*local_238;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  operator_delete(local_238);
                }
              }
              else {
                FUN_14000a170(&local_1a8);
                local_100 = 0;
                FUN_14000a170(local_e8);
                local_40 = 0;
                lVar6 = FUN_140174f00(param_1 + 0x6c0);
                iVar4 = *param_3;
                if ((iVar4 < 0) || (0x17 < iVar4)) {
                  LOCK();
                  plVar2 = plVar2 + 1;
                  *(int *)plVar2 = (int)*plVar2 + -1;
                  UNLOCK();
                  if ((int)*plVar2 == 0) {
                    puVar3 = (undefined8 *)*local_238;
                    if (puVar3 != (undefined8 *)0x0) {
                      (**(code **)*puVar3)(puVar3,1);
                    }
                    operator_delete(local_238);
                  }
                }
                else {
                  *(undefined2 *)((longlong)iVar4 * 0xac + 0x14 + lVar6) = 0;
                  *(short *)((longlong)*param_3 * 0xac + 0x16 + lVar6) = (short)*param_3;
                  FUN_140090020(&local_1a8,(longlong)*param_3 * 0xac + lVar6);
                  bVar10 = local_1a8 < *param_2;
                  if ((local_1a8 == *param_2) &&
                     (bVar10 = local_1a0 < param_2[1], local_1a0 == param_2[1])) {
                    iVar4 = 0;
                  }
                  else {
                    iVar4 = (1 - (uint)bVar10) - (uint)(bVar10 != 0);
                  }
                  if (iVar4 == 0) {
                    local_240[0] = -1;
                    uVar7 = FUN_140137690();
                    uVar5 = FUN_140136b30(uVar7,local_190);
                    lVar6 = param_1 + 0x6c0;
                    local_244 = uVar5;
                    if (uVar5 == 5) {
                      uVar7 = FUN_140174f00(lVar6);
                      FUN_1401e8ba0(uVar7,local_f8,&local_1a8,local_240);
                      *param_4 = local_240[0];
                      if (-1 < local_240[0]) {
LAB_14019fa71:
                        uVar7 = FUN_140174f00(param_1 + 0x6c0);
                        if (-1 < (int)uVar5) {
                          uVar12 = CONCAT44(uVar14,6);
                          FUN_1401ed220(uVar7,&local_244,param_4,&local_1a8,uVar12);
                          uVar14 = (undefined4)((ulonglong)uVar12 >> 0x20);
                        }
                        lVar6 = FUN_140174f00(param_1 + 0x6c0);
                        uVar1 = *(undefined4 *)(lVar6 + 0x50a0);
                        lVar6 = FUN_140174f00(param_1 + 0x6c0);
                        uVar16 = CONCAT44(uVar17,*(undefined4 *)(lVar6 + 0x50a0));
                        FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_1a8,400,
                                      CONCAT44(uVar14,0x13),(ulonglong)uVar15 << 0x20,uVar16,
                                      CONCAT44(uVar18,uVar1),(ulonglong)uVar19 << 0x20,
                                      (ulonglong)uVar20 << 0x20);
                        puVar13 = &local_1a8;
                        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c2,2,param_1,&local_1a8,1,
                                      uVar16 & 0xffffffff00000000,*param_3,*param_4);
                        uVar17 = (undefined4)((ulonglong)puVar13 >> 0x20);
                        uVar14 = *(undefined4 *)(param_1 + 0x160);
                        iVar4 = *(int *)(param_1 + 0x284);
                        lVar6 = *(longlong *)(param_1 + 0xb50);
                        if (uVar5 == 5) {
                          local_1f4 = *(undefined4 *)(param_1 + 0x164);
                          local_1f0 = *(undefined4 *)(param_1 + 0x168);
                          local_1ec = *(undefined4 *)(param_1 + 0x16c);
                          local_1e8 = *(undefined4 *)(param_1 + 0x170);
                          local_1e4 = *(undefined4 *)(param_1 + 0x174);
                          local_1e0 = *(undefined4 *)(param_1 + 0x178);
                          local_1dc = *(undefined4 *)(param_1 + 0x17c);
                          local_200[0] = *param_4;
                          local_210[0] = *(undefined4 *)(param_1 + 8);
                          local_220[0] = uVar5;
                          local_1f8 = uVar14;
                          if (((-1 < iVar4) && (iVar4 < *(short *)(lVar6 + 700))) &&
                             (*(longlong *)(lVar6 + 0x4c0) != 0)) {
                            plVar9 = (longlong *)
                                     (*(longlong *)
                                       (*(longlong *)(*(longlong *)(lVar6 + 0x4c0) + 8) +
                                       (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                            puVar8 = local_210;
                            local_res8[0] = (short)iVar4;
                            (**(code **)(*plVar9 + 0x120))
                                      (plVar9,1,&DAT_1405d85a0,local_res8,puVar8,&local_1e8,
                                       &local_1f8,&local_1a8,local_220,local_200);
                            uVar17 = (undefined4)((ulonglong)puVar8 >> 0x20);
                          }
                        }
                        else {
                          local_1c4 = *(undefined4 *)(param_1 + 0x164);
                          local_1c0 = *(undefined4 *)(param_1 + 0x168);
                          local_1bc = *(undefined4 *)(param_1 + 0x16c);
                          local_1d8 = *(undefined4 *)(param_1 + 0x170);
                          local_1d4 = *(undefined4 *)(param_1 + 0x174);
                          local_1d0 = *(undefined4 *)(param_1 + 0x178);
                          local_1cc = *(undefined4 *)(param_1 + 0x17c);
                          local_218[0] = *param_4;
                          local_208[0] = *(undefined4 *)(param_1 + 8);
                          local_228[0] = uVar5;
                          local_1c8 = uVar14;
                          if (((-1 < iVar4) && (iVar4 < *(short *)(lVar6 + 700))) &&
                             (*(longlong *)(lVar6 + 0x4c0) != 0)) {
                            plVar9 = (longlong *)
                                     (*(longlong *)
                                       (*(longlong *)(*(longlong *)(lVar6 + 0x4c0) + 8) +
                                       (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                            puVar8 = local_208;
                            local_248[0] = (short)iVar4;
                            (**(code **)(*plVar9 + 0x110))
                                      (plVar9,1,&DAT_1405d85a0,local_248,puVar8,&local_1d8,
                                       &local_1c8,&local_1a8,local_228,local_218);
                            uVar17 = (undefined4)((ulonglong)puVar8 >> 0x20);
                          }
                        }
                        uVar7 = FUN_140174f00(param_1 + 0x6c0);
                        FUN_1401ed220(uVar7,&DAT_14047ba28,param_3,local_e8,CONCAT44(uVar17,6));
                        FUN_1402f8580(*plVar2);
                        uVar7 = FUN_140137690();
                        FUN_140136770(uVar7,local_190);
                        puVar8 = (undefined4 *)FUN_1401de8d0(param_1 + 0x6f0,*param_3);
                        *puVar8 = 0;
                        puVar8 = (undefined4 *)FUN_1401de910(param_1 + 0x7b0,*param_3);
                        *puVar8 = 0;
                        puVar8[1] = 0;
                        puVar8[2] = 0;
                        puVar8[3] = 0;
                        FUN_14019c070(param_1,param_5);
                        LOCK();
                        plVar2 = plVar2 + 1;
                        *(int *)plVar2 = (int)*plVar2 + -1;
                        UNLOCK();
                        if ((int)*plVar2 == 0) {
                          puVar3 = (undefined8 *)*local_238;
                          if (puVar3 != (undefined8 *)0x0) {
                            (**(code **)*puVar3)(puVar3,1);
                          }
                          operator_delete(local_238);
                        }
                        if (bVar11) {
                          FUN_14034edd0(local_258);
                        }
                        return 1;
                      }
                      LOCK();
                      plVar2 = plVar2 + 1;
                      *(int *)plVar2 = (int)*plVar2 + -1;
                      UNLOCK();
                      if ((int)*plVar2 == 0) {
                        puVar3 = (undefined8 *)*local_238;
                        if (puVar3 != (undefined8 *)0x0) {
                          (**(code **)*puVar3)(puVar3,1);
                        }
                        operator_delete(local_238);
                      }
                    }
                    else if (*param_4 == -1) {
                      uVar7 = FUN_140174f00(lVar6);
                      if ((int)uVar5 < 0) {
                        iVar4 = -1;
                      }
                      else {
                        iVar4 = FUN_1401eea90(uVar7,&local_244);
                      }
                      *param_4 = iVar4;
                      if (-1 < iVar4) goto LAB_14019fa71;
                      LOCK();
                      plVar2 = plVar2 + 1;
                      *(int *)plVar2 = (int)*plVar2 + -1;
                      UNLOCK();
                      if ((int)*plVar2 == 0) {
                        puVar3 = (undefined8 *)*local_238;
                        if (puVar3 != (undefined8 *)0x0) {
                          (**(code **)*puVar3)(puVar3,1);
                        }
                        operator_delete(local_238);
                      }
                    }
                    else {
                      lVar6 = FUN_140174f00(lVar6);
                      if (((uVar5 < 5) && (-1 < *param_4)) && (*param_4 < 0x18)) {
                        FUN_14034ed40(lVar6 + 0xf630);
                        iVar4 = FUN_14011b180(((longlong)*param_4 + (longlong)(int)uVar5 * 0x18) *
                                              0xac + lVar6);
                        FUN_14034edd0(lVar6 + 0xf630);
                        if (iVar4 != 0) goto LAB_14019fa71;
                      }
                      LOCK();
                      plVar2 = plVar2 + 1;
                      *(int *)plVar2 = (int)*plVar2 + -1;
                      UNLOCK();
                      if ((int)*plVar2 == 0) {
                        puVar3 = (undefined8 *)*local_238;
                        if (puVar3 != (undefined8 *)0x0) {
                          (**(code **)*puVar3)(puVar3,1);
                        }
                        operator_delete(local_238);
                      }
                    }
                  }
                  else {
                    LOCK();
                    plVar2 = plVar2 + 1;
                    *(int *)plVar2 = (int)*plVar2 + -1;
                    UNLOCK();
                    if ((int)*plVar2 == 0) {
                      puVar3 = (undefined8 *)*local_238;
                      if (puVar3 != (undefined8 *)0x0) {
                        (**(code **)*puVar3)(puVar3,1);
                      }
                      operator_delete(local_238);
                    }
                  }
                }
              }
              goto LAB_14019ff0c;
            }
          }
          else {
            iVar4 = DAT_140608048 + 1;
            bVar10 = DAT_140608048 == 0;
            DAT_140608048 = iVar4;
            if (bVar10) {
              FUN_140176d60(1);
            }
          }
        }
        LOCK();
        plVar2 = plVar2 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          puVar3 = (undefined8 *)*local_238;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(local_238);
        }
        goto LAB_14019ff0c;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar10 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == local_230) {
      LOCK();
      plVar2 = plVar2 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        puVar3 = (undefined8 *)*local_238;
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        operator_delete(local_238);
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar10 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14019ff0c:
  if (bVar11) {
    FUN_14034edd0(local_258);
  }
  return 0;
}



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

undefined8
FUN_14019ff40(longlong param_1,ulonglong *param_2,ulonglong *param_3,int *param_4,int *param_5,
             int *param_6,undefined4 param_7)

{
  uint uVar1;
  ulonglong uVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  int iVar9;
  uint *puVar10;
  longlong *plVar11;
  char cVar12;
  longlong lVar13;
  bool bVar14;
  int local_res8 [2];
  undefined8 in_stack_fffffffffffffdd8;
  short *psVar15;
  undefined4 uVar18;
  ulonglong *puVar16;
  undefined8 uVar17;
  undefined8 in_stack_fffffffffffffde0;
  undefined4 uVar19;
  undefined4 *in_stack_fffffffffffffde8;
  ulonglong uVar20;
  ulonglong in_stack_fffffffffffffdf0;
  undefined4 uVar22;
  undefined8 uVar21;
  ulonglong in_stack_fffffffffffffdf8;
  undefined4 uVar24;
  int *piVar23;
  int *in_stack_fffffffffffffe00;
  int local_1f8 [2];
  int local_1f0 [2];
  int local_1e8 [2];
  undefined4 local_1e0;
  undefined4 uStack_1dc;
  undefined4 local_1d8;
  undefined4 uStack_1d4;
  undefined4 local_1d0;
  undefined4 local_1cc;
  undefined4 local_1c8;
  undefined4 local_1c4;
  longlong local_1c0;
  char local_1b8;
  ulonglong local_1a8;
  ulonglong local_1a0;
  undefined4 local_198;
  undefined4 local_190;
  undefined4 local_100;
  undefined8 local_f8;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffde0 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffdd8 >> 0x20);
  local_f8 = 0xfffffffffffffffe;
  local_1c0 = 0;
  cVar12 = '\0';
  local_1b8 = '\0';
  plVar11 = *(longlong **)(param_1 + 0xb28);
  lVar13 = 0;
  if (plVar11 != (longlong *)0x0) {
    lVar13 = 0;
    if (plVar11 == *(longlong **)(param_1 + 0xb30)) {
      lVar6 = *plVar11;
      if (lVar6 != 0) {
        if (plVar11 != *(longlong **)(param_1 + 0xb30)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar14 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar14) {
            FUN_140176d60();
          }
          lVar6 = 0;
        }
        local_1b8 = 0;
        local_1c0 = lVar6;
        FUN_14034ed40(lVar6);
        cVar12 = '\x01';
        local_1b8 = '\x01';
        lVar13 = lVar6;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar14 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar14) {
        FUN_140176d60(1);
        lVar13 = 0;
      }
    }
  }
  uVar22 = (undefined4)(in_stack_fffffffffffffdf0 >> 0x20);
  iVar3 = 0;
  plVar11 = *(longlong **)(param_1 + 0x6c0);
  if (plVar11 == (longlong *)0x0) {
LAB_1401a0d06:
    if (cVar12 != '\0') {
      FUN_14034edd0(lVar13);
    }
    return 0;
  }
  if (plVar11 != *(longlong **)(param_1 + 0x6c8)) {
    iVar3 = DAT_140608048 + 1;
    bVar14 = DAT_140608048 == 0;
    DAT_140608048 = iVar3;
    if (bVar14) {
      FUN_140176d60(1);
    }
    goto LAB_1401a0d06;
  }
  if (((*plVar11 == 0) || (*param_6 < 0)) || (0x17 < *param_6)) goto LAB_1401a0d06;
  bVar14 = *param_2 < *param_3;
  if ((*param_2 != *param_3) || (bVar14 = param_2[1] < param_3[1], param_2[1] != param_3[1])) {
    iVar3 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
  }
  if (iVar3 != 0) goto LAB_1401a0d06;
  psVar15 = (short *)((longlong)param_2 + 0x6e);
  if (*psVar15 == 0) {
    uVar1 = (uint)param_2[3];
    lVar6 = FUN_140137690();
    uVar22 = (undefined4)(in_stack_fffffffffffffdf0 >> 0x20);
    uVar24 = (undefined4)(in_stack_fffffffffffffdf8 >> 0x20);
    if (*(longlong *)(lVar6 + 0x88) != 0) {
      for (puVar10 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                               ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar6 + 0x98)) * 8);
          puVar10 != (uint *)0x0; puVar10 = *(uint **)(puVar10 + 0xa6)) {
        if ((puVar10[0xa8] == uVar1) && (*puVar10 == uVar1)) {
          if (puVar10 != (uint *)0x0) goto LAB_1401a00ee;
          break;
        }
      }
    }
    puVar10 = (uint *)0x0;
LAB_1401a00ee:
    if (((puVar10 != (uint *)0x0) && (puVar10 != (uint *)0xfffffffffffffff8)) &&
       (puVar10[0x3a] != 0)) {
      iVar3 = 1;
      if (puVar10[0x3a] != 1) {
        iVar3 = 0x5b;
      }
      *psVar15 = 1;
      if (iVar3 == 1) {
        local_1e0 = *(undefined4 *)(param_1 + 0x170);
        uStack_1dc = *(undefined4 *)(param_1 + 0x174);
        local_1d8 = *(undefined4 *)(param_1 + 0x178);
        uStack_1d4 = *(undefined4 *)(param_1 + 0x17c);
        FUN_1401fc060(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                      *(undefined4 *)(param_1 + 0x284),&local_1e0,param_2,CONCAT44(uVar19,1));
        in_stack_fffffffffffffdf8 = CONCAT44(uVar24,(int)*psVar15);
        uVar20 = in_stack_fffffffffffffdf0 & 0xffffffff00000000;
        in_stack_fffffffffffffde8 =
             (undefined4 *)((ulonglong)in_stack_fffffffffffffde8 & 0xffffffff00000000);
        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1cb,0x53,param_1,param_2,1,
                      in_stack_fffffffffffffde8,uVar20,in_stack_fffffffffffffdf8);
        uVar22 = (undefined4)(uVar20 >> 0x20);
      }
      plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      puVar8 = (undefined4 *)((longlong)param_2 + 0x6c);
      (**(code **)(*plVar11 + 0x1f0))
                (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2,psVar15,puVar8);
      uVar19 = (undefined4)((ulonglong)puVar8 >> 0x20);
      uVar18 = (undefined4)((ulonglong)psVar15 >> 0x20);
    }
  }
  FUN_14000a170(&local_1a8);
  local_100 = 0;
  FUN_14000a170(local_e8);
  uVar24 = (undefined4)(in_stack_fffffffffffffdf8 >> 0x20);
  local_40 = 0;
  if (*param_4 == 5) {
    lVar6 = FUN_140174f00(param_1 + 0x6c0);
    iVar3 = *param_6;
    if ((-1 < iVar3) && (iVar3 < 0x18)) {
      *(undefined2 *)((longlong)iVar3 * 0xac + 0x14 + lVar6) = 0;
      *(short *)((longlong)*param_6 * 0xac + 0x16 + lVar6) = (short)*param_6;
      FUN_140090020(&local_1a8,(longlong)*param_6 * 0xac + lVar6);
      if ((local_1a8 == 0) && (local_1a0 == 0)) {
        bVar14 = false;
      }
      else {
        bVar14 = true;
      }
      if (bVar14) {
        uVar7 = FUN_140137690();
        iVar3 = FUN_140136b30(uVar7,local_190);
        local_res8[0] = iVar3;
        if (iVar3 == 5) {
          uVar7 = FUN_140174f00(param_1 + 0x6c0);
          FUN_1401ed120(uVar7,param_5,&local_1a8);
          local_1e0 = *(undefined4 *)(param_1 + 0x160);
          uStack_1dc = *(undefined4 *)(param_1 + 0x164);
          local_1d8 = *(undefined4 *)(param_1 + 0x168);
          uStack_1d4 = *(undefined4 *)(param_1 + 0x16c);
          local_1d0 = *(undefined4 *)(param_1 + 0x170);
          local_1cc = *(undefined4 *)(param_1 + 0x174);
          local_1c8 = *(undefined4 *)(param_1 + 0x178);
          local_1c4 = *(undefined4 *)(param_1 + 0x17c);
          iVar4 = *(int *)(param_1 + 0x284);
          local_1e8[0] = *param_5;
          local_1f8[0] = *(int *)(param_1 + 8);
          local_1f0[0] = iVar3;
          if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0)) {
            local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar4);
            plVar11 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70)
            ;
            in_stack_fffffffffffffe00 = local_1e8;
            piVar23 = local_1f0;
            puVar16 = &local_1a8;
            in_stack_fffffffffffffde8 = &local_1e0;
            puVar8 = &local_1d0;
            (**(code **)(*plVar11 + 0x120))
                      (plVar11,1,&DAT_1405d85a0,local_res8,local_1f8,puVar8,
                       in_stack_fffffffffffffde8,puVar16,piVar23,in_stack_fffffffffffffe00);
            uVar19 = (undefined4)((ulonglong)puVar8 >> 0x20);
            uVar22 = (undefined4)((ulonglong)puVar16 >> 0x20);
            uVar24 = (undefined4)((ulonglong)piVar23 >> 0x20);
          }
        }
        else {
          uVar7 = FUN_140174f00(param_1 + 0x6c0);
          cVar12 = local_1b8;
          if ((iVar3 < 0) ||
             (iVar4 = FUN_1401eeb60(uVar7,local_res8,&local_1a8,local_1f8), cVar12 = local_1b8,
             iVar4 == 0)) goto LAB_1401a0d06;
          local_1e0 = 0;
          uStack_1dc = 0;
          local_1d8 = 0;
          uStack_1d4 = 0;
          uVar7 = FUN_140174f00(param_1 + 0x6c0);
          iVar4 = FUN_1401e8dc0(uVar7,param_1,local_res8,&local_1a8,&local_1e0);
          bVar14 = CONCAT44(uStack_1dc,local_1e0) < local_1a8;
          if ((CONCAT44(uStack_1dc,local_1e0) == local_1a8) &&
             (bVar14 = CONCAT44(uStack_1d4,local_1d8) < local_1a0,
             CONCAT44(uStack_1d4,local_1d8) == local_1a0)) {
            iVar9 = 0;
          }
          else {
            iVar9 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
          }
          if (iVar9 == 0) {
            local_1d0 = *(undefined4 *)(param_1 + 0x160);
            local_1cc = *(undefined4 *)(param_1 + 0x164);
            local_1c8 = *(undefined4 *)(param_1 + 0x168);
            local_1c4 = *(undefined4 *)(param_1 + 0x16c);
            local_1e0 = *(undefined4 *)(param_1 + 0x170);
            uStack_1dc = *(undefined4 *)(param_1 + 0x174);
            local_1d8 = *(undefined4 *)(param_1 + 0x178);
            uStack_1d4 = *(undefined4 *)(param_1 + 0x17c);
            iVar9 = *(int *)(param_1 + 0x284);
            local_1e8[0] = *(int *)(param_1 + 8);
            local_1f8[0] = iVar4;
            local_1f0[0] = iVar3;
            if (((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
               (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0)) {
              local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar9);
              plVar11 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                        0x70);
              in_stack_fffffffffffffe00 = local_1f8;
              piVar23 = local_1f0;
              puVar16 = &local_1a8;
              in_stack_fffffffffffffde8 = &local_1d0;
              puVar8 = &local_1e0;
              (**(code **)(*plVar11 + 0x110))
                        (plVar11,1,&DAT_1405d85a0,local_res8,local_1e8,puVar8,
                         in_stack_fffffffffffffde8,puVar16,piVar23,in_stack_fffffffffffffe00);
              uVar19 = (undefined4)((ulonglong)puVar8 >> 0x20);
              uVar22 = (undefined4)((ulonglong)puVar16 >> 0x20);
              uVar24 = (undefined4)((ulonglong)piVar23 >> 0x20);
            }
          }
        }
        in_stack_fffffffffffffdf8 = CONCAT44(uVar24,*param_5);
        uVar17 = CONCAT44(uVar22,*param_6);
        uVar20 = (ulonglong)in_stack_fffffffffffffde8 & 0xffffffff00000000;
        uVar7 = CONCAT44(uVar19,1);
        puVar16 = &local_1a8;
        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c2,2,param_1,puVar16,uVar7,uVar20,uVar17,
                      in_stack_fffffffffffffdf8);
        uVar18 = (undefined4)((ulonglong)puVar16 >> 0x20);
        uVar19 = (undefined4)((ulonglong)uVar7 >> 0x20);
        uVar24 = (undefined4)(uVar20 >> 0x20);
        uVar22 = (undefined4)((ulonglong)uVar17 >> 0x20);
        goto LAB_1401a0a03;
      }
    }
    uVar7 = FUN_140174f00(param_1 + 0x6c0);
    FUN_1401ed120(uVar7,param_5,local_e8);
  }
  else {
    lVar6 = FUN_140174f00(param_1 + 0x6c0);
    uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
    iVar3 = *param_6;
    if ((-1 < iVar3) && (iVar3 < 0x18)) {
      *(undefined2 *)((longlong)iVar3 * 0xac + 0x14 + lVar6) = 0;
      *(short *)((longlong)*param_6 * 0xac + 0x16 + lVar6) = (short)*param_6;
      FUN_140090020(&local_1a8,(longlong)*param_6 * 0xac + lVar6);
      uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
      if ((local_1a8 == 0) && (local_1a0 == 0)) {
        bVar14 = false;
      }
      else {
        bVar14 = true;
      }
      if (bVar14) {
        uVar7 = FUN_140137690();
        iVar3 = FUN_140136b30(uVar7,local_190);
        uVar24 = (undefined4)(in_stack_fffffffffffffdf8 >> 0x20);
        if (iVar3 == 5) {
          local_res8[0] = -1;
          uVar7 = FUN_140174f00(param_1 + 0x6c0);
          FUN_1401e8ba0(uVar7,&local_1d0,&local_1a8,local_res8);
          uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
          uVar5 = (undefined4)(in_stack_fffffffffffffdf8 >> 0x20);
          if (local_res8[0] != -1) {
            local_1d0 = *(undefined4 *)(param_1 + 0x160);
            local_1cc = *(undefined4 *)(param_1 + 0x164);
            local_1c8 = *(undefined4 *)(param_1 + 0x168);
            local_1c4 = *(undefined4 *)(param_1 + 0x16c);
            local_1e0 = *(undefined4 *)(param_1 + 0x170);
            uStack_1dc = *(undefined4 *)(param_1 + 0x174);
            local_1d8 = *(undefined4 *)(param_1 + 0x178);
            uStack_1d4 = *(undefined4 *)(param_1 + 0x17c);
            iVar3 = *(int *)(param_1 + 0x284);
            local_1f8[0] = local_res8[0];
            local_1f0[0] = 5;
            local_1e8[0] = *(int *)(param_1 + 8);
            if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
               (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0)) {
              local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar3);
              plVar11 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                        0x70);
              in_stack_fffffffffffffe00 = local_1f8;
              piVar23 = local_1f0;
              puVar16 = &local_1a8;
              in_stack_fffffffffffffde8 = &local_1d0;
              puVar8 = &local_1e0;
              (**(code **)(*plVar11 + 0x120))
                        (plVar11,1,&DAT_1405d85a0,local_res8,local_1e8,puVar8,
                         in_stack_fffffffffffffde8,puVar16,piVar23,in_stack_fffffffffffffe00);
              uVar19 = (undefined4)((ulonglong)puVar8 >> 0x20);
              uVar22 = (undefined4)((ulonglong)puVar16 >> 0x20);
              uVar5 = (undefined4)((ulonglong)piVar23 >> 0x20);
            }
            in_stack_fffffffffffffdf8 = CONCAT44(uVar5,*param_5);
            uVar17 = CONCAT44(uVar22,*param_6);
            uVar20 = (ulonglong)in_stack_fffffffffffffde8 & 0xffffffff00000000;
            uVar7 = CONCAT44(uVar19,1);
            puVar16 = &local_1a8;
            FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c2,2,param_1,puVar16,uVar7,uVar20,
                          uVar17,in_stack_fffffffffffffdf8);
            uVar18 = (undefined4)((ulonglong)puVar16 >> 0x20);
            uVar19 = (undefined4)((ulonglong)uVar7 >> 0x20);
            uVar24 = (undefined4)(uVar20 >> 0x20);
            uVar22 = (undefined4)((ulonglong)uVar17 >> 0x20);
          }
        }
        else {
          uVar7 = FUN_140174f00(param_1 + 0x6c0);
          if (-1 < *param_4) {
            FUN_1401ed220(uVar7,param_4,param_5,&local_1a8,CONCAT44(uVar18,6));
          }
          local_1d0 = *(undefined4 *)(param_1 + 0x160);
          local_1cc = *(undefined4 *)(param_1 + 0x164);
          local_1c8 = *(undefined4 *)(param_1 + 0x168);
          local_1c4 = *(undefined4 *)(param_1 + 0x16c);
          local_1e0 = *(undefined4 *)(param_1 + 0x170);
          uStack_1dc = *(undefined4 *)(param_1 + 0x174);
          local_1d8 = *(undefined4 *)(param_1 + 0x178);
          uStack_1d4 = *(undefined4 *)(param_1 + 0x17c);
          iVar3 = *(int *)(param_1 + 0x284);
          local_1f8[0] = *param_5;
          local_1f0[0] = *param_4;
          local_1e8[0] = *(int *)(param_1 + 8);
          if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0)) {
            local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar3);
            plVar11 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70)
            ;
            in_stack_fffffffffffffe00 = local_1f8;
            piVar23 = local_1f0;
            puVar16 = &local_1a8;
            in_stack_fffffffffffffde8 = &local_1d0;
            puVar8 = &local_1e0;
            (**(code **)(*plVar11 + 0x110))
                      (plVar11,1,&DAT_1405d85a0,local_res8,local_1e8,puVar8,
                       in_stack_fffffffffffffde8,puVar16,piVar23,in_stack_fffffffffffffe00);
            uVar19 = (undefined4)((ulonglong)puVar8 >> 0x20);
            uVar22 = (undefined4)((ulonglong)puVar16 >> 0x20);
            uVar24 = (undefined4)((ulonglong)piVar23 >> 0x20);
          }
          in_stack_fffffffffffffdf8 = CONCAT44(uVar24,*param_5);
          uVar17 = CONCAT44(uVar22,*param_6);
          uVar20 = (ulonglong)in_stack_fffffffffffffde8 & 0xffffffff00000000;
          uVar7 = CONCAT44(uVar19,1);
          puVar16 = &local_1a8;
          FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c2,2,param_1,puVar16,uVar7,uVar20,uVar17
                        ,in_stack_fffffffffffffdf8);
          uVar18 = (undefined4)((ulonglong)puVar16 >> 0x20);
          uVar19 = (undefined4)((ulonglong)uVar7 >> 0x20);
          uVar24 = (undefined4)(uVar20 >> 0x20);
          uVar22 = (undefined4)((ulonglong)uVar17 >> 0x20);
        }
        goto LAB_1401a0a03;
      }
    }
    uVar7 = FUN_140174f00(param_1 + 0x6c0);
    if (-1 < *param_4) {
      uVar17 = CONCAT44(uVar18,6);
      FUN_1401ed220(uVar7,param_4,param_5,local_e8,uVar17);
      uVar18 = (undefined4)((ulonglong)uVar17 >> 0x20);
    }
LAB_1401a0a03:
    lVar6 = FUN_140174f00(param_1 + 0x6c0);
    uVar5 = *(undefined4 *)(lVar6 + 0x50a0);
    lVar6 = FUN_140174f00(param_1 + 0x6c0);
    in_stack_fffffffffffffdf8 = in_stack_fffffffffffffdf8 & 0xffffffff00000000;
    uVar21 = CONCAT44(uVar22,uVar5);
    in_stack_fffffffffffffde8 = (undefined4 *)CONCAT44(uVar24,*(undefined4 *)(lVar6 + 0x50a0));
    uVar17 = CONCAT44(uVar19,local_198);
    uVar7 = CONCAT44(uVar18,0x12);
    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,param_2,400,uVar7,uVar17,
                  in_stack_fffffffffffffde8,uVar21,in_stack_fffffffffffffdf8,
                  (ulonglong)in_stack_fffffffffffffe00 & 0xffffffff00000000);
    uVar19 = (undefined4)((ulonglong)uVar17 >> 0x20);
    uVar22 = (undefined4)((ulonglong)uVar21 >> 0x20);
    uVar24 = (undefined4)(in_stack_fffffffffffffdf8 >> 0x20);
    uVar18 = (undefined4)((ulonglong)uVar7 >> 0x20);
  }
  if (((int)param_2[0xe] < 1) && (uVar20 = param_2[4], 0 < (int)uVar20)) {
    uVar7 = FUN_1401e0840();
    uVar5 = FUN_1401e2340(uVar7,(int)uVar20);
    *(undefined4 *)(param_2 + 0xe) = uVar5;
  }
  uVar7 = FUN_140174f00(param_1 + 0x6c0);
  FUN_1401ed220(uVar7,&DAT_14047ba28,param_6,param_2,CONCAT44(uVar18,6));
  local_1d0 = *(undefined4 *)(param_1 + 0x160);
  iVar3 = *(int *)(param_1 + 0x284);
  lVar6 = *(longlong *)(param_1 + 0xb50);
  local_1cc = *(undefined4 *)(param_1 + 0x164);
  local_1c8 = *(undefined4 *)(param_1 + 0x168);
  local_1c4 = *(undefined4 *)(param_1 + 0x16c);
  local_1e0 = *(undefined4 *)(param_1 + 0x170);
  uStack_1dc = *(undefined4 *)(param_1 + 0x174);
  local_1d8 = *(undefined4 *)(param_1 + 0x178);
  uStack_1d4 = *(undefined4 *)(param_1 + 0x17c);
  local_1f8[0] = *param_6;
  local_1f0[0] = 0;
  local_1e8[0] = *(int *)(param_1 + 8);
  if (*param_4 == 5) {
    if (((-1 < iVar3) && (iVar3 < *(short *)(lVar6 + 700))) && (*(longlong *)(lVar6 + 0x4c0) != 0))
    {
      local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar3);
      plVar11 = (longlong *)
                (*(longlong *)
                  (*(longlong *)(*(longlong *)(lVar6 + 0x4c0) + 8) +
                  (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
      piVar23 = local_1f0;
      in_stack_fffffffffffffde8 = &local_1d0;
      puVar8 = &local_1e0;
      puVar16 = param_2;
      (**(code **)(*plVar11 + 0x100))
                (plVar11,1,&DAT_1405d85a0,local_res8,local_1e8,puVar8,in_stack_fffffffffffffde8,
                 param_2,piVar23,local_1f8);
      uVar19 = (undefined4)((ulonglong)puVar8 >> 0x20);
      uVar22 = (undefined4)((ulonglong)puVar16 >> 0x20);
      uVar24 = (undefined4)((ulonglong)piVar23 >> 0x20);
    }
  }
  else if (((-1 < iVar3) && (iVar3 < *(short *)(lVar6 + 700))) &&
          (*(longlong *)(lVar6 + 0x4c0) != 0)) {
    local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar3);
    plVar11 = (longlong *)
              (*(longlong *)
                (*(longlong *)(*(longlong *)(lVar6 + 0x4c0) + 8) +
                (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
    piVar23 = local_1f0;
    in_stack_fffffffffffffde8 = &local_1d0;
    puVar8 = &local_1e0;
    puVar16 = param_2;
    (**(code **)(*plVar11 + 0xf0))
              (plVar11,1,&DAT_1405d85a0,local_res8,local_1e8,puVar8,in_stack_fffffffffffffde8,
               param_2,piVar23,local_1f8);
    uVar19 = (undefined4)((ulonglong)puVar8 >> 0x20);
    uVar22 = (undefined4)((ulonglong)puVar16 >> 0x20);
    uVar24 = (undefined4)((ulonglong)piVar23 >> 0x20);
  }
  FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c2,1,param_1,param_2,CONCAT44(uVar19,1),
                (ulonglong)in_stack_fffffffffffffde8 & 0xffffffff00000000,CONCAT44(uVar22,*param_5),
                CONCAT44(uVar24,*param_6));
  puVar8 = (undefined4 *)FUN_1401de8d0(param_1 + 0x6f0,*param_6);
  *puVar8 = (int)param_2[3];
  uVar20 = *param_2;
  uVar18 = *(undefined4 *)((longlong)param_2 + 4);
  uVar2 = param_2[1];
  uVar19 = *(undefined4 *)((longlong)param_2 + 0xc);
  puVar8 = (undefined4 *)FUN_1401de910(param_1 + 0x7b0,*param_6);
  *puVar8 = (int)uVar20;
  puVar8[1] = uVar18;
  puVar8[2] = (int)uVar2;
  puVar8[3] = uVar19;
  FUN_14019c070(param_1,param_7);
  if (local_1b8 != '\0') {
    FUN_14034edd0(lVar13);
  }
  return 1;
}



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

{
  float fVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  bool bVar10;
  longlong local_128;
  longlong *local_118;
  longlong *local_110;
  undefined8 local_108;
  undefined1 local_f8 [24];
  undefined4 local_e0;
  int local_88;
  undefined4 local_50;
  
  local_108 = 0xfffffffffffffffe;
  local_128 = 0;
  bVar9 = false;
  bVar10 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      lVar7 = *plVar2;
      if (lVar7 != 0) {
        if (plVar2 != *(longlong **)(param_1 + 0xb30)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar9 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar9) {
            FUN_140176d60(1);
          }
          lVar7 = 0;
        }
        FUN_14034ed40(lVar7);
        bVar9 = true;
        bVar10 = true;
        local_128 = lVar7;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x6c0);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x6c8)) {
      if (((*plVar2 != 0) && (-1 < *param_5)) && (*param_5 < 0x18)) {
        FUN_14000a170(local_f8);
        local_50 = 0;
        if (*param_3 == 5) {
          uVar6 = FUN_140174f00(param_1 + 0x6c0);
          iVar4 = FUN_1401ecc20(uVar6,param_4,local_f8);
          if (iVar4 != 0) {
            lVar7 = FUN_1401e0840();
            GetLocalTime((LPSYSTEMTIME)(lVar7 + 200));
            iVar4 = FUN_1401e2290((LPSYSTEMTIME)(lVar7 + 200));
            if ((local_88 < 1) || (iVar4 < local_88)) {
              uVar5 = FUN_14019ff40(param_1,local_f8,param_2,param_3,param_4,param_5,param_6);
              if (!bVar9) {
                return uVar5;
              }
              FUN_14034edd0(local_128);
              return uVar5;
            }
          }
        }
        else {
          uVar6 = FUN_140174f00(param_1 + 0x6c0);
          if ((-1 < *param_3) && (iVar4 = FUN_1401ecce0(uVar6,param_3,param_4,local_f8), iVar4 != 0)
             ) {
            FUN_140198570(param_1,&local_118);
            plVar2 = local_118;
            if (local_118 != (longlong *)0x0) {
              if (local_118 == local_110) {
                if (*local_118 != 0) {
                  fVar1 = *(float *)(*local_118 + 0x2298);
                  iVar4 = FUN_1402f8580();
                  uVar6 = FUN_140137690();
                  lVar7 = FUN_140136770(uVar6,local_e0);
                  if ((lVar7 != 0) && (iVar4 + (int)fVar1 < *(int *)(lVar7 + 0x108))) {
                    LOCK();
                    plVar2 = plVar2 + 1;
                    *(int *)plVar2 = (int)*plVar2 + -1;
                    UNLOCK();
                    bVar9 = bVar10;
                    if ((int)*plVar2 == 0) {
                      puVar3 = (undefined8 *)*local_118;
                      if (puVar3 != (undefined8 *)0x0) {
                        (**(code **)*puVar3)(puVar3,1);
                      }
                      operator_delete(local_118);
                    }
                    goto joined_r0x0001401a1097;
                  }
                }
              }
              else {
                iVar4 = DAT_14060804c + 1;
                bVar8 = DAT_14060804c == 0;
                DAT_14060804c = iVar4;
                if (bVar8) {
                  FUN_140176d60(1);
                }
              }
            }
            uVar5 = FUN_14019ff40(param_1,local_f8,param_2,param_3,param_4,param_5,param_6);
            if (plVar2 != (longlong *)0x0) {
              if (plVar2 == local_110) {
                LOCK();
                plVar2 = plVar2 + 1;
                *(int *)plVar2 = (int)*plVar2 + -1;
                UNLOCK();
                bVar9 = bVar10;
                if ((int)*plVar2 == 0) {
                  puVar3 = (undefined8 *)*local_118;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  operator_delete(local_118);
                }
              }
              else {
                iVar4 = DAT_140608054 + 1;
                bVar10 = DAT_140608054 == 0;
                DAT_140608054 = iVar4;
                if (bVar10) {
                  FUN_140176d60(1);
                }
              }
            }
            if (!bVar9) {
              return uVar5;
            }
            FUN_14034edd0(local_128);
            return uVar5;
          }
        }
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar10 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
joined_r0x0001401a1097:
  if (bVar9) {
    FUN_14034edd0(local_128);
  }
  return 0;
}



void FUN_1401a10d0(longlong param_1,int param_2)

{
  if ((((param_2 == 0x7549) || (param_2 == 0x754a)) || (param_2 == 0x754b)) ||
     (((param_2 == 0x75a7 || (param_2 == 0x75a8)) || ((param_2 == 0x75a9 || (param_2 == 0x75aa))))))
  {
    *(int *)(param_1 + 0x268) = *(int *)(param_1 + 0x268) + 1;
  }
  if ((((param_2 == 0x754c) || (param_2 == 0x754d)) ||
      ((param_2 == 0x754e || (((param_2 == 0x75af || (param_2 == 0x75b0)) || (param_2 == 0x75b1)))))
      ) || (param_2 == 0x75b2)) {
    *(int *)(param_1 + 0x26c) = *(int *)(param_1 + 0x26c) + 1;
  }
  return;
}



longlong * FUN_1401a1150(longlong param_1,uint param_2)

{
  uint uVar1;
  int iVar2;
  char cVar3;
  char cVar4;
  uint uVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined8 uVar8;
  longlong *plVar9;
  undefined8 uVar10;
  undefined8 *puVar11;
  uint *puVar12;
  bool bVar13;
  undefined4 local_res10 [2];
  undefined4 local_res18 [2];
  uint local_res20 [2];
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined4 local_a0;
  uint local_98 [2];
  undefined4 local_90 [2];
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 uStack_74;
  undefined4 local_70;
  undefined4 uStack_6c;
  uint local_68;
  uint local_64;
  undefined4 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  lVar6 = FUN_140137690();
  plVar9 = (longlong *)((ulonglong)param_2 / (ulonglong)*(uint *)(lVar6 + 0x98));
  if (*(longlong *)(lVar6 + 0x88) != 0) {
    for (puVar12 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                             ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar6 + 0x98)) * 8);
        puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0xa6)) {
      if ((puVar12[0xa8] == param_2) && (*puVar12 == param_2)) {
        if (puVar12 == (uint *)0x0) {
          return plVar9;
        }
        if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        uVar5 = puVar12[0x43];
        if ((int)uVar5 < 1) {
          return (longlong *)(ulonglong)(puVar12 != (uint *)0x0);
        }
        plVar7 = (longlong *)FUN_140317510();
        plVar9 = (longlong *)((ulonglong)uVar5 / (ulonglong)*(uint *)(plVar7 + 2));
        if (*plVar7 == 0) {
          return plVar9;
        }
        puVar12 = *(uint **)(*plVar7 + ((ulonglong)uVar5 % (ulonglong)*(uint *)(plVar7 + 2)) * 8);
        while( true ) {
          if (puVar12 == (uint *)0x0) {
            return plVar9;
          }
          if ((puVar12[0x2c] == uVar5) && (*puVar12 == uVar5)) break;
          puVar12 = *(uint **)(puVar12 + 0x2a);
        }
        if (puVar12 == (uint *)0x0) {
          return plVar9;
        }
        if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (puVar12 == (uint *)0xfffffffffffffff8) {
          return (longlong *)0x1;
        }
        uVar8 = 0;
        local_58 = 0;
        local_50 = 0;
        cVar3 = FUN_140195920(param_1 + 0xb28);
        if (cVar3 != '\0') {
          uVar8 = FUN_140195970(param_1 + 0xb28);
          local_50 = 0;
          local_58 = uVar8;
          FUN_14034ed40(uVar8);
          local_50 = 1;
        }
        plVar9 = *(longlong **)(param_1 + 0xa00);
        if (plVar9 != (longlong *)0x0) {
          if (plVar9 == *(longlong **)(param_1 + 0xa08)) {
            if (*plVar9 != 0) {
              local_res10[0] = 0;
              uVar1 = puVar12[0xb];
              if ((int)uVar1 < 1) {
                local_a0 = 0;
              }
              else {
                uVar10 = FUN_1401e0840();
                local_a0 = FUN_1401e2340(uVar10,uVar1);
              }
              uVar1 = puVar12[0xb];
              puVar11 = (undefined8 *)FUN_140357570(&local_88);
              local_78 = *(undefined4 *)puVar11;
              uStack_74 = *(undefined4 *)((longlong)puVar11 + 4);
              local_b8 = *puVar11;
              local_70 = *(undefined4 *)(puVar11 + 1);
              uStack_6c = *(undefined4 *)((longlong)puVar11 + 0xc);
              local_b0 = puVar11[1];
              local_68 = uVar5;
              local_64 = uVar1;
              local_60 = local_a0;
              local_a8._0_4_ = uVar5;
              local_a8._4_4_ = uVar1;
              plVar9 = (longlong *)FUN_1401deac0(param_1 + 0xa00);
              if ((ulonglong)(plVar9[1] - *plVar9 >> 3) < 0x32) {
                cVar4 = FUN_1402670e0(plVar9,&local_b8,1);
                if (cVar4 == '\x01') {
                  local_88 = *(undefined4 *)(param_1 + 0x170);
                  local_84 = *(undefined4 *)(param_1 + 0x174);
                  local_80 = *(undefined4 *)(param_1 + 0x178);
                  local_7c = *(undefined4 *)(param_1 + 0x17c);
                  iVar2 = *(int *)(param_1 + 0x284);
                  local_res18[0] = local_a0;
                  local_res20[0] = local_a8._4_4_;
                  local_98[0] = (uint)local_a8;
                  local_90[0] = *(undefined4 *)(param_1 + 8);
                  if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                     && (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0))
                  {
                    local_res10[0] = CONCAT22(local_res10[0]._2_2_,(short)iVar2);
                    plVar9 = (longlong *)
                             (*(longlong *)
                               (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                             + 0x70);
                    (**(code **)(*plVar9 + 0x450))
                              (plVar9,1,&DAT_1405d85a0,local_res10,local_90,&local_88,&local_b8,
                               local_98,local_res20,local_res18);
                  }
                  plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar9 + 0x630))
                            (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_78);
                }
              }
              else {
                FUN_1400050f0(L"ERROR >> MGSTitle::Add [Title is Full!!!]");
              }
              local_b8 = 0;
              local_b0 = 0;
              plVar9 = (longlong *)0x0;
              local_a8 = 0;
              local_a0 = 0;
            }
          }
          else {
            uVar5 = DAT_1406080dc + 1;
            plVar9 = (longlong *)(ulonglong)uVar5;
            bVar13 = DAT_1406080dc == 0;
            DAT_1406080dc = uVar5;
            if (bVar13) {
              plVar9 = (longlong *)FUN_140176d60(1);
            }
          }
        }
        if (cVar3 == '\0') {
          return plVar9;
        }
        plVar9 = (longlong *)FUN_14034edd0(uVar8);
        return plVar9;
      }
    }
  }
  return plVar9;
}



longlong * FUN_1401a1500(longlong param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  uint *puVar1;
  uint uVar2;
  uint uVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *extraout_RAX;
  longlong *extraout_RAX_00;
  longlong lVar6;
  uint *puVar7;
  longlong lVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  void *pvVar11;
  void *pvVar12;
  int iVar13;
  bool bVar14;
  undefined8 uVar15;
  void *local_70;
  longlong local_68;
  undefined8 local_60;
  void *local_50;
  longlong local_48;
  undefined8 local_40;
  
  uVar15 = 0xfffffffffffffffe;
  lVar4 = FUN_140137690();
  plVar5 = (longlong *)((ulonglong)param_2 / (ulonglong)*(uint *)(lVar4 + 0x98));
  if (*(longlong *)(lVar4 + 0x88) == 0) {
    return plVar5;
  }
  puVar7 = *(uint **)(*(longlong *)(lVar4 + 0x88) +
                     ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar4 + 0x98)) * 8);
  while( true ) {
    if (puVar7 == (uint *)0x0) {
      return plVar5;
    }
    if ((puVar7[0xa8] == param_2) && (*puVar7 == param_2)) break;
    puVar7 = *(uint **)(puVar7 + 0xa6);
  }
  if (puVar7 == (uint *)0x0) {
    return plVar5;
  }
  if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  puVar1 = puVar7 + 0x4e;
  if (puVar1 == (uint *)0x0) {
    return (longlong *)(ulonglong)(puVar7 != (uint *)0x0);
  }
  plVar5 = *(longlong **)(param_1 + 0x6e0);
  if (plVar5 == (longlong *)0x0) {
    return (longlong *)0x0;
  }
  if (plVar5 != *(longlong **)(param_1 + 0x6e8)) {
    uVar2 = DAT_14060804c + 1;
    if (DAT_14060804c != 0) {
      DAT_14060804c = uVar2;
      return (longlong *)(ulonglong)uVar2;
    }
    DAT_14060804c = uVar2;
    plVar5 = (longlong *)FUN_140176d60(1);
    return plVar5;
  }
  if (*plVar5 == 0) {
    return plVar5;
  }
  iVar13 = 0;
  lVar4 = 0;
  do {
    uVar2 = puVar1[lVar4];
    if (0 < (int)uVar2) {
      local_70 = (void *)0x0;
      local_68 = 0;
      local_60 = 0;
      plVar5 = (longlong *)FUN_1403161f0();
      if (*plVar5 != 0) {
        for (puVar7 = *(uint **)(*plVar5 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar5 + 2)) * 8
                                ); puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xe8)) {
          if ((puVar7[0xea] == uVar2) && (*puVar7 == uVar2)) {
            if (puVar7 != (uint *)0x0) {
              if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar2 = puVar7[0x4a];
              goto LAB_1401a1669;
            }
            break;
          }
        }
      }
      uVar2 = 1;
LAB_1401a1669:
      plVar5 = *(longlong **)(param_1 + 0x6e0);
      if (plVar5 == (longlong *)0x0) {
LAB_1401a16a0:
        lVar6 = 0;
      }
      else {
        if (plVar5 != *(longlong **)(param_1 + 0x6e8)) {
          uVar3 = DAT_14060804c + 1;
          bVar14 = DAT_14060804c == 0;
          DAT_14060804c = uVar3;
          if (bVar14) {
            FUN_140176d60();
          }
          goto LAB_1401a16a0;
        }
        lVar6 = *plVar5;
      }
      lVar8 = 0;
      pvVar12 = (void *)0x0;
      if (*(longlong *)(lVar6 + 0x1e80) != 0) {
        FUN_140239410(lVar6,&local_70,uVar2,param_4,uVar15);
        lVar8 = local_68;
        pvVar12 = local_70;
      }
      uVar9 = lVar8 - (longlong)pvVar12 >> 3;
      uVar10 = 0;
      if (uVar9 != 0) {
        do {
          if (*(int *)(*(longlong *)((longlong)pvVar12 + uVar10 * 8) + 300) != 0x25) {
            uVar2 = puVar1[lVar4];
            plVar5 = (longlong *)FUN_1403161f0();
            if (*plVar5 != 0) {
              for (puVar7 = *(uint **)(*plVar5 +
                                      ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar5 + 2)) * 8);
                  puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xe8)) {
                if ((puVar7[0xea] == uVar2) && (*puVar7 == uVar2)) {
                  if (puVar7 != (uint *)0x0) {
                    if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    uVar2 = puVar7[3];
                    goto LAB_1401a173d;
                  }
                  break;
                }
              }
            }
            uVar2 = 0;
LAB_1401a173d:
            plVar5 = (longlong *)FUN_140267710(uVar2);
            if (plVar5 != (longlong *)0x0) {
              (**(code **)(*plVar5 + 8))(plVar5,puVar1[lVar4]);
              *(undefined4 *)((longlong)plVar5 + 0x6c) = 1;
              FUN_140236f40(*(undefined8 *)((longlong)pvVar12 + uVar10 * 8),param_1,plVar5);
            }
          }
          uVar10 = uVar10 + 1;
        } while (uVar10 < uVar9);
      }
      uVar2 = puVar1[lVar4];
      plVar5 = (longlong *)FUN_1403161f0();
      if (*plVar5 != 0) {
        for (puVar7 = *(uint **)(*plVar5 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar5 + 2)) * 8
                                ); puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xe8)) {
          if ((puVar7[0xea] == uVar2) && (*puVar7 == uVar2)) {
            if (puVar7 != (uint *)0x0) {
              if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar2 = puVar7[0x27];
              plVar5 = (longlong *)(ulonglong)uVar2;
              if (uVar2 != 1) {
                if (uVar2 == 2) {
                  pvVar11 = (void *)0x0;
                  local_50 = (void *)0x0;
                  local_48 = 0;
                  local_40 = 0;
                  plVar5 = *(longlong **)(param_1 + 0xb58);
                  if ((plVar5 != (longlong *)0x0) && (plVar5[9] != 0)) {
                    plVar5 = (longlong *)FUN_140190080();
                    pvVar11 = local_50;
                    uVar10 = local_48 - (longlong)local_50 >> 3;
                    uVar9 = 0;
                    if (uVar10 != 0) {
                      do {
                        if (*(int *)(*(longlong *)((longlong)pvVar11 + uVar9 * 8) + 300) != 0x25) {
                          plVar5 = (longlong *)FUN_140207510();
                        }
                        uVar9 = uVar9 + 1;
                      } while (uVar9 < uVar10);
                    }
                  }
                  if (pvVar11 != (void *)0x0) {
                    operator_delete(pvVar11);
                    plVar5 = extraout_RAX;
                  }
                }
                goto LAB_1401a18d9;
              }
            }
            break;
          }
        }
      }
      plVar5 = *(longlong **)(param_1 + 0x6e0);
      if (plVar5 != (longlong *)0x0) {
        if (plVar5 == *(longlong **)(param_1 + 0x6e8)) {
          lVar6 = *plVar5;
          if (lVar6 != 0) {
            if (plVar5 != *(longlong **)(param_1 + 0x6e8)) {
              uVar2 = DAT_14060804c + 1;
              bVar14 = DAT_14060804c == 0;
              DAT_14060804c = uVar2;
              if (bVar14) {
                FUN_140176d60(1);
              }
              lVar6 = 0;
            }
            plVar5 = (longlong *)FUN_140207510(lVar6);
          }
        }
        else {
          uVar2 = DAT_14060804c + 1;
          plVar5 = (longlong *)(ulonglong)uVar2;
          bVar14 = DAT_14060804c == 0;
          DAT_14060804c = uVar2;
          if (bVar14) {
            plVar5 = (longlong *)FUN_140176d60(1);
          }
        }
      }
LAB_1401a18d9:
      if (pvVar12 != (void *)0x0) {
        operator_delete(pvVar12);
        plVar5 = extraout_RAX_00;
      }
    }
    iVar13 = iVar13 + 1;
    lVar4 = lVar4 + 1;
    if (1 < iVar13) {
      return plVar5;
    }
  } while( true );
}



longlong * FUN_1401a1940(longlong param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  uint uVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined4 *puVar7;
  uint *puVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  undefined4 extraout_XMM0_Da;
  undefined2 local_res8 [4];
  longlong local_res10;
  undefined4 local_res18 [2];
  undefined4 *in_stack_fffffffffffffe98;
  undefined8 in_stack_fffffffffffffea0;
  undefined4 uVar12;
  undefined8 in_stack_fffffffffffffea8;
  undefined4 uVar13;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  longlong local_138;
  undefined1 local_130;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined8 local_118;
  longlong local_110;
  undefined1 local_108;
  undefined4 local_f8;
  undefined4 uStack_f4;
  undefined4 uStack_f0;
  undefined4 uStack_ec;
  short local_e4;
  ushort local_e2;
  int local_e0;
  undefined2 local_dc;
  undefined4 local_50;
  undefined1 local_48 [16];
  
  uVar12 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffea8 >> 0x20);
  local_118 = 0xfffffffffffffffe;
  lVar9 = 0;
  local_138 = 0;
  bVar11 = false;
  local_130 = 0;
  plVar4 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar4;
      lVar9 = 0;
      if (lVar5 != 0) {
        if (plVar4 != *(longlong **)(param_1 + 0xb30)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        local_130 = 0;
        local_138 = lVar5;
        FUN_14034ed40(lVar5);
        bVar11 = true;
        local_130 = 1;
        lVar9 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar4 = *(longlong **)(param_1 + 0x6c0);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar4 != 0) {
        uVar3 = *(uint *)(param_2 + 0x18);
        lVar5 = FUN_140137690();
        plVar4 = (longlong *)((ulonglong)uVar3 / (ulonglong)*(uint *)(lVar5 + 0x98));
        if (*(longlong *)(lVar5 + 0x88) != 0) {
          for (puVar8 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                                  ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
              puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 0xa6)) {
            if ((puVar8[0xa8] == uVar3) && (*puVar8 == uVar3)) {
              if (puVar8 != (uint *)0x0) {
                plVar4 = (longlong *)(ulonglong)(puVar8 != (uint *)0x0);
                if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                if (puVar8[0x46] == 0x10) {
                  uVar6 = FUN_140137690();
                  iVar2 = FUN_140137640(uVar6,*(undefined4 *)(param_2 + 0x18));
                  FUN_14000a170(&local_f8);
                  local_50 = 0;
                  FUN_140090020(&local_f8,param_2);
                  puVar7 = (undefined4 *)FUN_140357570(local_48);
                  local_f8 = *puVar7;
                  uStack_f4 = puVar7[1];
                  uStack_f0 = puVar7[2];
                  uStack_ec = puVar7[3];
                  local_dc = 1;
                  plVar4 = *(longlong **)(param_1 + 0x6c0);
                  local_e0 = iVar2;
                  if (plVar4 == (longlong *)0x0) {
LAB_1401a1b4a:
                    lVar5 = 0;
                  }
                  else {
                    if (plVar4 != *(longlong **)(param_1 + 0x6c8)) {
                      uVar3 = DAT_140608048 + 1;
                      bVar10 = DAT_140608048 == 0;
                      DAT_140608048 = uVar3;
                      if (bVar10) {
                        FUN_140176d60(1);
                      }
                      goto LAB_1401a1b4a;
                    }
                    lVar5 = *plVar4;
                  }
                  lVar1 = lVar5 + 0xf630;
                  local_110 = lVar1;
                  FUN_14034ed40(lVar1);
                  local_108 = 1;
                  if (((uint)(int)local_e4 < 5) && (local_e2 < 0x18)) {
                    uVar6 = FUN_140137690();
                    uVar3 = FUN_140136b30(uVar6,local_e0);
                    if (((int)local_e4 == uVar3) &&
                       (iVar2 = FUN_14011b180(((longlong)(short)local_e2 + (longlong)local_e4 * 0x18
                                              ) * 0xac + lVar5), iVar2 != 0)) {
                      FUN_140090020(extraout_XMM0_Da,&local_f8);
                    }
                  }
                  FUN_14034edd0(lVar1);
                  local_128 = *(undefined4 *)(param_1 + 0x160);
                  local_124 = *(undefined4 *)(param_1 + 0x164);
                  local_120 = *(undefined4 *)(param_1 + 0x168);
                  local_11c = *(undefined4 *)(param_1 + 0x16c);
                  local_148 = *(undefined4 *)(param_1 + 0x170);
                  local_144 = *(undefined4 *)(param_1 + 0x174);
                  local_140 = *(undefined4 *)(param_1 + 0x178);
                  local_13c = *(undefined4 *)(param_1 + 0x17c);
                  iVar2 = *(int *)(param_1 + 0x284);
                  local_res18[0] = *(undefined4 *)(param_1 + 8);
                  if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                    if ((CONCAT44(uStack_f4,local_f8) == 0) && (CONCAT44(uStack_ec,uStack_f0) == 0))
                    {
                      bVar10 = false;
                    }
                    else {
                      bVar10 = true;
                    }
                    if (((bVar10) && (local_e0 != 0)) &&
                       (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0))
                    {
                      local_res8[0] = (undefined2)iVar2;
                      plVar4 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8
                                 ) + 0x70);
                      puVar7 = &local_f8;
                      uVar12 = 1;
                      in_stack_fffffffffffffe98 = &local_128;
                      (**(code **)(*plVar4 + 0xb0))
                                (plVar4,1,&DAT_1405d85a0,local_res8,local_res18,&local_148,
                                 in_stack_fffffffffffffe98,&DAT_14047ba50,puVar7);
                      uVar13 = (undefined4)((ulonglong)puVar7 >> 0x20);
                    }
                  }
                  plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar4 + 0xc0))
                            (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_e4,&local_e2,
                             &local_f8);
                  plVar4 = (longlong *)
                           FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1cd,0x66,param_1,
                                         local_res10,1,
                                         (ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000,
                                         CONCAT44(uVar12,*(short *)(local_res10 + 0x1c) + 1),
                                         CONCAT44(uVar13,(int)*(short *)(local_res10 + 0x1c)));
                }
              }
              break;
            }
          }
        }
      }
    }
    else {
      uVar3 = DAT_140608048 + 1;
      plVar4 = (longlong *)(ulonglong)uVar3;
      bVar10 = DAT_140608048 == 0;
      DAT_140608048 = uVar3;
      if (bVar10) {
        plVar4 = (longlong *)FUN_140176d60(1);
      }
    }
  }
  if (bVar11) {
    plVar4 = (longlong *)FUN_14034edd0(lVar9);
  }
  return plVar4;
}



// WARNING: Removing unreachable block (ram,0x0001401a2188)
// WARNING: Removing unreachable block (ram,0x0001401a21e6)
// WARNING: Removing unreachable block (ram,0x0001401a1e80)

undefined8 FUN_1401a1da0(longlong param_1,undefined4 *param_2)

{
  longlong *plVar1;
  void *pvVar2;
  int *piVar3;
  undefined8 *puVar4;
  char cVar5;
  undefined4 uVar6;
  int iVar7;
  int iVar8;
  longlong lVar9;
  undefined8 uVar10;
  longlong lVar11;
  longlong *plVar12;
  uint *puVar13;
  int *piVar14;
  uint *puVar15;
  uint *puVar16;
  uint uVar17;
  int *piVar18;
  uint uVar19;
  bool bVar20;
  void *local_res8;
  undefined4 *local_res10;
  uint local_res18;
  uint local_res20;
  ulonglong in_stack_fffffffffffffdf8;
  undefined4 *in_stack_fffffffffffffe00;
  undefined4 uVar21;
  undefined4 *in_stack_fffffffffffffe08;
  longlong local_1d8;
  longlong *local_1d0;
  uint local_1c8;
  undefined8 local_1c0;
  undefined8 local_1b8;
  undefined8 local_1b0;
  undefined4 local_1a8 [2];
  longlong *local_1a0;
  longlong *local_198;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined4 local_184;
  int local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined8 local_168;
  int local_160;
  undefined1 local_15c [44];
  undefined4 local_130;
  undefined1 local_12c [52];
  undefined1 local_f8 [32];
  int local_d8;
  undefined4 local_88;
  undefined4 local_50;
  
  local_168 = 0xfffffffffffffffe;
  plVar12 = (longlong *)(param_1 + 0x6e0);
  plVar1 = (longlong *)*plVar12;
  if (plVar1 == (longlong *)0x0) {
    return 0;
  }
  local_res10 = param_2;
  if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return 0;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return 0;
  }
  if (*plVar1 == 0) {
    return 0;
  }
  puVar15 = (uint *)0x0;
  uVar19 = 0;
  local_res18 = 0;
  uVar17 = param_2[6];
  lVar9 = FUN_140137690();
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffe00 >> 0x20);
  if (*(longlong *)(lVar9 + 0x88) != 0) {
    for (puVar13 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                             ((ulonglong)uVar17 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
        puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 0xa6)) {
      if ((puVar13[0xa8] == uVar17) && (*puVar13 == uVar17)) {
        if (puVar13 != (uint *)0x0) goto LAB_1401a1e67;
        break;
      }
    }
  }
  puVar13 = puVar15;
LAB_1401a1e67:
  if (puVar13 != (uint *)0x0) {
    uVar17 = puVar13[0x46];
    if ((uVar17 == 2) || (uVar17 == 0x37)) {
      uVar17 = param_2[6];
      lVar9 = FUN_140137690();
      puVar13 = puVar15;
      if (*(longlong *)(lVar9 + 0x88) != 0) {
        for (puVar16 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                                 ((ulonglong)uVar17 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
            puVar16 != (uint *)0x0; puVar16 = *(uint **)(puVar16 + 0xa6)) {
          if ((puVar16[0xa8] == uVar17) && (*puVar16 == uVar17)) {
            if (puVar16 != (uint *)0x0) {
              if (puVar16 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              puVar13 = (uint *)(ulonglong)puVar16[0x76];
            }
            break;
          }
        }
      }
      uVar17 = (uint)puVar13;
      local_1c8 = uVar17;
      plVar12 = (longlong *)FUN_14013ef40();
      if (*plVar12 != 0) {
        for (puVar16 = *(uint **)(*plVar12 +
                                 ((ulonglong)puVar13 % (ulonglong)*(uint *)(plVar12 + 2)) * 8);
            puVar16 != (uint *)0x0; puVar16 = *(uint **)(puVar16 + 0x50)) {
          if ((puVar16[0x52] == uVar17) && (*puVar16 == uVar17)) {
            if (puVar16 != (uint *)0x0) {
              uVar19 = puVar16[0x18];
            }
            break;
          }
        }
      }
      local_res20 = uVar19;
      plVar12 = (longlong *)FUN_14013ef40();
      if (*plVar12 != 0) {
        for (puVar16 = *(uint **)(*plVar12 +
                                 ((ulonglong)puVar13 % (ulonglong)*(uint *)(plVar12 + 2)) * 8);
            (puVar16 != (uint *)0x0 && ((puVar16[0x52] != uVar17 || (*puVar16 != uVar17))));
            puVar16 = *(uint **)(puVar16 + 0x50)) {
        }
      }
      local_160 = 0;
      memset(local_15c,0,0x2c);
      local_130 = 0;
      memset(local_12c,0,0x2c);
      if ((uVar19 == 0) || (uVar17 = uVar19, uVar19 == 2)) {
        uVar10 = FUN_14013ef40();
        FUN_14013ee00(uVar10,puVar13,&local_160,&local_130);
        local_1a0 = (longlong *)0x0;
        local_res8 = operator_new(0x850);
        puVar13 = puVar15;
        if (local_res8 != (void *)0x0) {
          puVar13 = (uint *)FUN_1401e64f0(local_res8);
        }
        if (puVar13 == (uint *)0x0) {
          local_1a0 = (longlong *)0x0;
        }
        else {
          local_1a0 = operator_new(0x10);
          *local_1a0 = (longlong)puVar13;
          *(undefined4 *)(local_1a0 + 1) = 1;
        }
        plVar12 = local_1a0;
        local_198 = local_1a0;
        if ((local_1a0 == (longlong *)0x0) || (*local_1a0 == 0)) {
          if (local_1a0 == (longlong *)0x0) {
            return 0;
          }
          LOCK();
          plVar1 = local_1a0 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 != 0) {
            return 0;
          }
          pvVar2 = (void *)*local_1a0;
          if (pvVar2 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar2 + 0x818);
            operator_delete(pvVar2);
          }
          operator_delete(plVar12);
          return 0;
        }
        if (*(longlong **)(param_1 + 0x6d0) != local_1a0) {
          FUN_1401dede0(param_1 + 0x6d0);
          *(longlong **)(param_1 + 0x6d0) = plVar12;
          *(longlong **)(param_1 + 0x6d8) = plVar12;
          LOCK();
          *(int *)(plVar12 + 1) = (int)plVar12[1] + 1;
          UNLOCK();
        }
        plVar12 = local_1a0;
        uVar10 = FUN_140137690();
        iVar7 = FUN_140137490(uVar10);
        lVar9 = 0;
        lVar11 = 0xc;
        do {
          iVar8 = *(int *)(local_15c + lVar9 + -4);
          if (0 < iVar8) {
            uVar10 = FUN_140137690();
            FUN_140136b30(uVar10,iVar8);
            FUN_14000a170(local_f8);
            local_50 = 0;
            in_stack_fffffffffffffe08 =
                 (undefined4 *)((ulonglong)in_stack_fffffffffffffe08 & 0xffffffff00000000);
            in_stack_fffffffffffffe00 =
                 (undefined4 *)((ulonglong)in_stack_fffffffffffffe00 & 0xffffffff00000000);
            in_stack_fffffffffffffdf8 = in_stack_fffffffffffffdf8 & 0xffffffff00000000;
            FUN_1401aac30(3,local_f8,iVar8,*(undefined4 *)(local_12c + lVar9 + -4),
                          in_stack_fffffffffffffdf8,in_stack_fffffffffffffe00,
                          in_stack_fffffffffffffe08,0,0,0);
            uVar21 = (undefined4)(in_stack_fffffffffffffdf8 >> 0x20);
            if (iVar7 != 0) {
              uVar10 = FUN_1401e0840();
              local_88 = FUN_1401e2340(uVar10,iVar7);
              local_d8 = iVar7;
            }
            in_stack_fffffffffffffdf8 = CONCAT44(uVar21,0x4d);
            FUN_1401e6560(*plVar12,local_f8,param_1,0x1ca,in_stack_fffffffffffffdf8);
            if ((int)puVar15 == 0) {
              puVar15 = (uint *)0x1;
            }
          }
          lVar9 = lVar9 + 4;
          lVar11 = lVar11 + -1;
        } while (lVar11 != 0);
        puVar13 = (uint *)(ulonglong)local_1c8;
        if ((int)puVar15 != 0) {
          FUN_1401e6700(*plVar12,5,param_1);
        }
        plVar1 = local_1a0;
        LOCK();
        plVar12 = plVar12 + 1;
        *(int *)plVar12 = (int)*plVar12 + -1;
        UNLOCK();
        param_2 = local_res10;
        uVar17 = local_res20;
        if ((int)*plVar12 == 0) {
          pvVar2 = (void *)*local_1a0;
          if (pvVar2 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar2 + 0x818);
            operator_delete(pvVar2);
          }
          operator_delete(plVar1);
          param_2 = local_res10;
          uVar17 = local_res20;
        }
      }
      uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffe00 >> 0x20);
      piVar18 = (int *)0x0;
      if ((uVar17 == 0) || (uVar19 = local_res18, uVar17 == 1)) {
        plVar12 = (longlong *)FUN_14013ef40();
        iVar7 = (int)puVar13;
        piVar14 = piVar18;
        if (*plVar12 != 0) {
          for (piVar3 = *(int **)(*plVar12 +
                                 ((ulonglong)puVar13 % (ulonglong)*(uint *)(plVar12 + 2)) * 8);
              (piVar14 = piVar18, piVar3 != (int *)0x0 &&
              ((piVar3[0x52] != iVar7 || (piVar14 = piVar3, *piVar3 != iVar7))));
              piVar3 = *(int **)(piVar3 + 0x50)) {
          }
        }
        iVar8 = 0;
        if (piVar14 != (int *)0x0) {
          if (piVar14 == (int *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          iVar8 = piVar14[0x1a];
        }
        local_17c = 0;
        local_190 = *param_2;
        local_18c = param_2[1];
        local_188 = param_2[2];
        local_184 = param_2[3];
        local_180 = iVar7;
        if (0 < iVar8) {
          piVar14 = DAT_140607cc0;
          if ((DAT_140607cc0 == (int *)0x0) &&
             (local_res8 = operator_new(0x130), piVar14 = piVar18, local_res8 != (void *)0x0)) {
            piVar14 = (int *)FUN_1401e04e0(local_res8);
          }
          DAT_140607cc0 = piVar14;
          local_17c = FUN_1401e2340(DAT_140607cc0,iVar8);
        }
        puVar4 = *(undefined8 **)(param_1 + 0x6e0);
        piVar14 = piVar18;
        if (puVar4 != (undefined8 *)0x0) {
          if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
            piVar14 = (int *)*puVar4;
          }
          else {
            iVar8 = DAT_14060804c + 1;
            bVar20 = DAT_14060804c == 0;
            DAT_14060804c = iVar8;
            if (bVar20) {
              FUN_140176d60(1);
            }
          }
        }
        FUN_14020a5a0(piVar14,&local_190,0);
        local_178 = *(undefined4 *)(param_1 + 0x170);
        local_174 = *(undefined4 *)(param_1 + 0x174);
        local_170 = *(undefined4 *)(param_1 + 0x178);
        local_16c = *(undefined4 *)(param_1 + 0x17c);
        iVar8 = *(int *)(param_1 + 0x284);
        local_1a8[0] = *(undefined4 *)(param_1 + 8);
        if (((-1 < iVar8) && (iVar8 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
           (lVar9 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar9 != 0)) {
          local_res8 = (void *)CONCAT62(local_res8._2_6_,(short)iVar8);
          plVar12 = (longlong *)
                    (*(longlong *)
                      (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
          in_stack_fffffffffffffe08 = &local_190;
          in_stack_fffffffffffffe00 = &local_178;
          (**(code **)(*plVar12 + 2000))
                    (plVar12,1,&DAT_1405d85a0,&local_res8,local_1a8,in_stack_fffffffffffffe00,
                     in_stack_fffffffffffffe08);
        }
        puVar4 = *(undefined8 **)(param_1 + 0x6e0);
        piVar14 = piVar18;
        if (puVar4 != (undefined8 *)0x0) {
          if (puVar4 == *(undefined8 **)(param_1 + 0x6e8)) {
            piVar14 = (int *)*puVar4;
          }
          else {
            iVar8 = DAT_14060804c + 1;
            bVar20 = DAT_14060804c == 0;
            DAT_14060804c = iVar8;
            if (bVar20) {
              FUN_140176d60(1);
            }
          }
        }
        FUN_14020a800(piVar14);
        local_1c0 = 0;
        local_1b8 = 0;
        local_1b0 = 0;
        plVar12 = (longlong *)FUN_14013ef40();
        piVar14 = piVar18;
        if (*plVar12 != 0) {
          for (piVar3 = *(int **)(*plVar12 +
                                 ((ulonglong)puVar13 % (ulonglong)*(uint *)(plVar12 + 2)) * 8);
              (piVar14 = piVar18, piVar3 != (int *)0x0 &&
              ((piVar3[0x52] != iVar7 || (piVar14 = piVar3, *piVar3 != iVar7))));
              piVar3 = *(int **)(piVar3 + 0x50)) {
          }
        }
        if (piVar14 != (int *)0x0) {
          local_1c0 = *(undefined8 *)(piVar14 + 0x26);
          local_1b8 = *(undefined8 *)(piVar14 + 0x28);
          local_1b0 = *(undefined8 *)(piVar14 + 0x2a);
        }
        piVar18 = (int *)&local_1c0;
        lVar9 = 6;
        do {
          if (0 < *piVar18) {
            FUN_1401d1430(param_1);
          }
          uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffe00 >> 0x20);
          piVar18 = piVar18 + 1;
          lVar9 = lVar9 + -1;
          uVar19 = local_res18;
        } while (lVar9 != 0);
      }
    }
    else {
      if (uVar17 == 6) {
        uVar19 = 0x48;
        uVar10 = FUN_140137690();
        uVar6 = FUN_140136ec0(uVar10,param_2[6]);
      }
      else {
        if (uVar17 != 7) {
          if (uVar17 == 8) {
            uVar10 = FUN_140137690();
            FUN_140136d30(uVar10,param_2[6]);
            iVar7 = FUN_1401ab3b0(param_1);
            bVar20 = iVar7 == 0;
LAB_1401a1f4e:
            if (bVar20) {
              uVar19 = 0;
              goto LAB_1401a1ed5;
            }
          }
          else if (uVar17 == 0x20) {
            uVar10 = FUN_140174f50(plVar12);
            lVar9 = FUN_140209770(uVar10,param_2 + 0x20,1);
            if (lVar9 == 0) {
              return 0;
            }
            FUN_140319940(DAT_140608110,&local_1d8);
            if ((local_1d8 == 0) ||
               (lVar11 = FUN_14031a410(local_1d8,*(undefined4 *)(lVar9 + 0x18)), lVar11 == 0)) {
              plVar12 = local_1d0;
              if (local_1d0 == (longlong *)0x0) {
                return 0;
              }
              LOCK();
              plVar1 = local_1d0 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 != 0) {
                return 0;
              }
              (**(code **)(*local_1d0 + 8))(local_1d0);
              LOCK();
              piVar18 = (int *)((longlong)plVar12 + 0xc);
              *piVar18 = *piVar18 + -1;
              UNLOCK();
              if (*piVar18 != 0) {
                return 0;
              }
              (**(code **)(*local_1d0 + 0x10))();
              return 0;
            }
            uVar10 = FUN_140174f50(plVar12);
            cVar5 = FUN_14020b8c0(uVar10,lVar9,lVar11);
            plVar12 = local_1d0;
            if (cVar5 == '\x01') {
              FUN_1401b1e70(param_1,lVar9 + 0x20,1);
              plVar12 = local_1d0;
              if (local_1d0 != (longlong *)0x0) {
                LOCK();
                plVar1 = local_1d0 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  (**(code **)(*local_1d0 + 8))(local_1d0);
                  LOCK();
                  piVar18 = (int *)((longlong)plVar12 + 0xc);
                  *piVar18 = *piVar18 + -1;
                  UNLOCK();
                  if (*piVar18 == 0) {
                    (**(code **)(*local_1d0 + 0x10))();
                  }
                }
              }
              return 1;
            }
            uVar19 = local_res18;
            if (local_1d0 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_1d0 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                (**(code **)(*local_1d0 + 8))(local_1d0);
                LOCK();
                piVar18 = (int *)((longlong)plVar12 + 0xc);
                *piVar18 = *piVar18 + -1;
                UNLOCK();
                uVar19 = local_res18;
                if (*piVar18 == 0) {
                  (**(code **)(*local_1d0 + 0x10))();
                  uVar19 = local_res18;
                }
              }
            }
          }
          else if ((uVar17 == 0x29) || (uVar17 == 0x2b)) {
            uVar10 = FUN_140137690();
            FUN_140137640(uVar10,param_2[6]);
            cVar5 = FUN_1401b8470(param_1);
            bVar20 = cVar5 == '\0';
            goto LAB_1401a1f4e;
          }
          goto LAB_1401a2703;
        }
        uVar19 = 0x4b;
        uVar10 = FUN_140137690();
        uVar6 = FUN_140136ec0(uVar10,param_2[6]);
      }
      iVar7 = FUN_1401ab190(param_1,uVar17,uVar6);
      if (iVar7 == 0) goto LAB_1401a1ed5;
    }
  }
LAB_1401a2703:
  uVar17 = param_2[6];
  lVar9 = FUN_140137690();
  puVar15 = (uint *)0x0;
  if (*(longlong *)(lVar9 + 0x88) != 0) {
    for (puVar13 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                             ((ulonglong)uVar17 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
        (puVar15 = (uint *)0x0, puVar13 != (uint *)0x0 &&
        ((puVar13[0xa8] != uVar17 || (puVar15 = puVar13, *puVar13 != uVar17))));
        puVar13 = *(uint **)(puVar13 + 0xa6)) {
    }
  }
  if (((puVar15 == (uint *)0x0) || ((int)puVar15[0x50] < 1)) ||
     (cVar5 = FUN_1401ac870(param_1,param_2), cVar5 != '\0')) {
    return 1;
  }
LAB_1401a1ed5:
  FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,uVar19,param_1,param_2,CONCAT44(uVar21,1),
                (ulonglong)in_stack_fffffffffffffe08 & 0xffffffff00000000,
                *(short *)(param_2 + 7) + 1,(int)*(short *)(param_2 + 7));
  return 0;
}



undefined8 FUN_1401a2790(longlong param_1,int *param_2,int *param_3,ulonglong *param_4)

{
  int iVar1;
  longlong *plVar2;
  int iVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined2 local_res8 [4];
  undefined4 *puVar10;
  ulonglong *puVar11;
  undefined2 *puVar13;
  undefined4 uVar16;
  undefined4 *puVar14;
  ulonglong uVar15;
  ulonglong uVar17;
  undefined8 in_stack_fffffffffffffeb0;
  undefined4 *puVar18;
  undefined4 uVar19;
  undefined8 in_stack_fffffffffffffeb8;
  undefined4 uVar21;
  ulonglong uVar20;
  undefined4 local_138 [2];
  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 [2];
  longlong local_108;
  undefined1 local_100;
  ulonglong local_f8;
  ulonglong local_f0;
  int local_e0;
  short local_dc [44];
  short local_84;
  undefined4 local_50;
  undefined8 local_48;
  undefined4 uVar12;
  
  uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20);
  local_48 = 0xfffffffffffffffe;
  lVar7 = 0;
  local_108 = 0;
  bVar9 = false;
  local_100 = 0;
  plVar6 = *(longlong **)(param_1 + 0xb28);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar6;
      lVar7 = 0;
      if (lVar5 != 0) {
        if (plVar6 != *(longlong **)(param_1 + 0xb30)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar9 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar9) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        local_100 = 0;
        local_108 = lVar5;
        FUN_14034ed40(lVar5);
        bVar9 = true;
        local_100 = 1;
        lVar7 = lVar5;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar6 = *(longlong **)(param_1 + 0x6c0);
  if (plVar6 != (longlong *)0x0) {
    plVar2 = *(longlong **)(param_1 + 0x6c8);
    if (plVar6 == plVar2) {
      if (*plVar6 != 0) {
        FUN_14000a170(&local_f8);
        local_50 = 0;
        if (plVar6 == plVar2) {
          lVar5 = *plVar6;
        }
        else {
          iVar3 = DAT_140608048 + 1;
          bVar8 = DAT_140608048 == 0;
          DAT_140608048 = iVar3;
          if (bVar8) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        iVar3 = *param_2;
        if ((-1 < iVar3) && (iVar3 < 5)) {
          iVar1 = *param_3;
          if ((-1 < iVar1) && (iVar1 < 0x18)) {
            *(short *)(((longlong)iVar1 + (longlong)iVar3 * 0x18) * 0xac + 0x14 + lVar5) =
                 (short)*param_2;
            *(short *)(((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + 0x16 + lVar5) =
                 (short)*param_3;
            FUN_140090020(&local_f8,((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + lVar5)
            ;
            bVar8 = local_f8 < *param_4;
            if ((local_f8 == *param_4) && (bVar8 = local_f0 < param_4[1], local_f0 == param_4[1])) {
              iVar3 = 0;
            }
            else {
              iVar3 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
            }
            if (iVar3 == 0) {
              if ((local_f8 == 0) && (local_f0 == 0)) {
                bVar8 = false;
              }
              else {
                bVar8 = true;
              }
              if ((((bVar8) || (local_e0 != 0)) || (0 < local_dc[0])) && (local_84 == 0)) {
                local_dc[0] = local_dc[0] + -1;
                iVar3 = FUN_1401a1da0(param_1,&local_f8);
                if (iVar3 != 0) {
                  local_res8[0] = (undefined2)*param_3;
                  local_138[0] = CONCAT22(local_138[0]._2_2_,(short)*param_2);
                  plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  puVar11 = (ulonglong *)local_dc;
                  puVar13 = local_res8;
                  puVar10 = local_138;
                  (**(code **)(*plVar6 + 0x290))
                            (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_f8,puVar10,
                             puVar13,puVar11);
                  uVar16 = (undefined4)((ulonglong)puVar13 >> 0x20);
                  uVar12 = (undefined4)((ulonglong)puVar10 >> 0x20);
                  if (local_dc[0] < 1) {
                    local_130 = *(undefined4 *)(param_1 + 0x160);
                    local_12c = *(undefined4 *)(param_1 + 0x164);
                    local_128 = *(undefined4 *)(param_1 + 0x168);
                    local_124 = *(undefined4 *)(param_1 + 0x16c);
                    local_120 = *(undefined4 *)(param_1 + 0x170);
                    local_11c = *(undefined4 *)(param_1 + 0x174);
                    local_118 = *(undefined4 *)(param_1 + 0x178);
                    local_114 = *(undefined4 *)(param_1 + 0x17c);
                    iVar3 = *(int *)(param_1 + 0x284);
                    local_138[0] = 0xffffffff;
                    local_110[0] = 0xfffffff6;
                    if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                       && (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0
                          )) {
                      local_res8[0] = (undefined2)iVar3;
                      plVar6 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8
                                 ) + 0x70);
                      puVar10 = local_138;
                      puVar18 = local_110;
                      puVar14 = &local_130;
                      puVar11 = param_4;
                      (**(code **)(*plVar6 + 0x130))
                                (plVar6,1,&DAT_1405d85a0,local_res8,&local_120,puVar14,param_4,
                                 puVar18,puVar10);
                      uVar16 = (undefined4)((ulonglong)puVar14 >> 0x20);
                      uVar19 = (undefined4)((ulonglong)puVar18 >> 0x20);
                      uVar21 = (undefined4)((ulonglong)puVar10 >> 0x20);
                    }
                    uVar4 = FUN_140174f00(param_1 + 0x6c0);
                    FUN_1401e9d60(uVar4,param_1,param_2,param_3,param_4);
                  }
                  else {
                    uVar4 = FUN_140174f00(param_1 + 0x6c0);
                    if (-1 < *param_2) {
                      FUN_1401ed220(uVar4,param_2,param_3,&local_f8,CONCAT44(uVar12,6));
                    }
                    local_120 = *(undefined4 *)(param_1 + 0x160);
                    local_11c = *(undefined4 *)(param_1 + 0x164);
                    local_118 = *(undefined4 *)(param_1 + 0x168);
                    local_114 = *(undefined4 *)(param_1 + 0x16c);
                    local_130 = *(undefined4 *)(param_1 + 0x170);
                    local_12c = *(undefined4 *)(param_1 + 0x174);
                    local_128 = *(undefined4 *)(param_1 + 0x178);
                    local_124 = *(undefined4 *)(param_1 + 0x17c);
                    iVar3 = *(int *)(param_1 + 0x284);
                    if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                       && (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0
                          )) {
                      local_res8[0] = (undefined2)iVar3;
                      plVar6 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8
                                 ) + 0x70);
                      puVar11 = &local_f8;
                      puVar10 = &local_120;
                      (**(code **)(*plVar6 + 0x140))
                                (plVar6,1,&DAT_1405d85a0,local_res8,&local_130,puVar10,puVar11);
                      uVar16 = (undefined4)((ulonglong)puVar10 >> 0x20);
                    }
                  }
                  uVar20 = CONCAT44(uVar21,(int)local_dc[0]);
                  uVar4 = CONCAT44(uVar19,local_dc[0] + 1);
                  uVar17 = (ulonglong)puVar11 & 0xffffffff00000000;
                  uVar15 = CONCAT44(uVar16,1);
                  puVar11 = &local_f8;
                  FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,puVar11,uVar15,
                                uVar17,uVar4,uVar20);
                  uVar21 = (undefined4)((ulonglong)puVar11 >> 0x20);
                  uVar12 = (undefined4)(uVar17 >> 0x20);
                  uVar16 = (undefined4)((ulonglong)uVar4 >> 0x20);
                  FUN_1401a1500(param_1,local_e0);
                  FUN_1401a1940(param_1,&local_f8);
                  lVar5 = FUN_140174f00(param_1 + 0x6c0);
                  uVar19 = *(undefined4 *)(lVar5 + 0x50a0);
                  lVar5 = FUN_140174f00(param_1 + 0x6c0);
                  FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_f8,0x192,
                                CONCAT44(uVar21,0x34),uVar15 & 0xffffffff00000000,
                                CONCAT44(uVar12,*(undefined4 *)(lVar5 + 0x50a0)),
                                CONCAT44(uVar16,uVar19),uVar20 & 0xffffffff00000000,0);
                  FUN_1401a10d0(param_1,local_e0);
                  FUN_1401a1150();
                  if (bVar9) {
                    FUN_14034edd0(lVar7);
                  }
                  return 1;
                }
                local_dc[0] = local_dc[0] + 1;
              }
            }
          }
        }
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar9) {
    FUN_14034edd0(lVar7);
  }
  return 0;
}



undefined8 FUN_1401a2d80(longlong param_1,undefined2 *param_2,ulonglong *param_3,undefined4 param_4)

{
  undefined2 *puVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined2 local_res8 [4];
  undefined2 *local_res10;
  undefined4 local_res20 [2];
  undefined2 *puVar9;
  undefined4 *puVar10;
  undefined4 uVar11;
  short *psVar12;
  undefined4 *puVar13;
  undefined4 *puVar14;
  undefined4 uVar15;
  ulonglong *puVar16;
  undefined8 in_stack_fffffffffffffeb0;
  undefined4 *puVar17;
  undefined4 uVar18;
  undefined8 in_stack_fffffffffffffeb8;
  undefined4 uVar19;
  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 [2];
  undefined4 local_110 [2];
  longlong local_108;
  undefined1 local_100;
  ulonglong local_f8;
  ulonglong local_f0;
  int local_e0;
  short local_dc [44];
  short local_84;
  undefined4 local_50;
  undefined8 local_48;
  
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20);
  local_48 = 0xfffffffffffffffe;
  lVar6 = 0;
  local_108 = 0;
  bVar8 = false;
  local_100 = 0;
  plVar5 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  local_res20[0] = param_4;
  if (plVar5 != (longlong *)0x0) {
    if (plVar5 == *(longlong **)(param_1 + 0xb30)) {
      lVar4 = *plVar5;
      lVar6 = 0;
      if (lVar4 != 0) {
        if (plVar5 != *(longlong **)(param_1 + 0xb30)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar8 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar8) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        local_100 = 0;
        local_108 = lVar4;
        FUN_14034ed40(lVar4);
        bVar8 = true;
        local_100 = 1;
        lVar6 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar5 = *(longlong **)(param_1 + 0x9b0);
  if (plVar5 != (longlong *)0x0) {
    if (plVar5 == *(longlong **)(param_1 + 0x9b8)) {
      if (*plVar5 != 0) {
        FUN_14000a170(&local_f8);
        local_50 = 0;
        if (plVar5 == *(longlong **)(param_1 + 0x9b8)) {
          lVar4 = *plVar5;
        }
        else {
          iVar2 = DAT_1406080cc + 1;
          bVar7 = DAT_1406080cc == 0;
          DAT_1406080cc = iVar2;
          if (bVar7) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        puVar1 = local_res10;
        iVar2 = FUN_14025f970(lVar4,local_res10,&local_f8,local_res20[0]);
        if (iVar2 != 0) {
          bVar7 = local_f8 < *param_3;
          if ((local_f8 == *param_3) && (bVar7 = local_f0 < param_3[1], local_f0 == param_3[1])) {
            iVar2 = 0;
          }
          else {
            iVar2 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
          }
          if (iVar2 == 0) {
            if ((local_f8 == 0) && (local_f0 == 0)) {
              bVar7 = false;
            }
            else {
              bVar7 = true;
            }
            if ((((bVar7) || (local_e0 != 0)) || (0 < local_dc[0])) &&
               ((local_84 == 0 && (iVar2 = FUN_1401a1da0(param_1,&local_f8), iVar2 != 0)))) {
              local_dc[0] = local_dc[0] + -1;
              local_res8[0] = *puVar1;
              plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              puVar16 = (ulonglong *)local_res20;
              psVar12 = local_dc;
              puVar9 = local_res8;
              (**(code **)(*plVar5 + 0x300))
                        (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_f8,puVar9,psVar12
                         ,puVar16);
              uVar15 = (undefined4)((ulonglong)psVar12 >> 0x20);
              uVar11 = (undefined4)((ulonglong)puVar9 >> 0x20);
              if (local_dc[0] < 1) {
                local_128 = *(undefined4 *)(param_1 + 0x160);
                local_124 = *(undefined4 *)(param_1 + 0x164);
                local_120 = *(undefined4 *)(param_1 + 0x168);
                local_11c = *(undefined4 *)(param_1 + 0x16c);
                local_138 = *(undefined4 *)(param_1 + 0x170);
                local_134 = *(undefined4 *)(param_1 + 0x174);
                local_130 = *(undefined4 *)(param_1 + 0x178);
                local_12c = *(undefined4 *)(param_1 + 0x17c);
                iVar2 = *(int *)(param_1 + 0x284);
                local_110[0] = 0xffffffff;
                local_118[0] = 0xfffffff6;
                if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
                  local_res8[0] = (undefined2)iVar2;
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  puVar13 = local_110;
                  puVar17 = local_118;
                  puVar16 = &local_f8;
                  puVar14 = &local_128;
                  puVar10 = &local_138;
                  (**(code **)(*plVar5 + 0x130))
                            (plVar5,1,&DAT_1405d85a0,local_res8,puVar10,puVar14,puVar16,puVar17,
                             puVar13);
                  uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
                  uVar18 = (undefined4)((ulonglong)puVar17 >> 0x20);
                  uVar19 = (undefined4)((ulonglong)puVar13 >> 0x20);
                  uVar11 = (undefined4)((ulonglong)puVar10 >> 0x20);
                }
                uVar3 = FUN_1401de990(param_1 + 0x9b0);
                FUN_14025fae0(uVar3,param_1,puVar1,&local_f8,CONCAT44(uVar11,local_res20[0]));
              }
              else {
                uVar3 = FUN_1401de990(param_1 + 0x9b0);
                FUN_14025fa20(uVar3,puVar1,&local_f8,local_res20[0]);
                local_138 = *(undefined4 *)(param_1 + 0x160);
                local_134 = *(undefined4 *)(param_1 + 0x164);
                local_130 = *(undefined4 *)(param_1 + 0x168);
                local_12c = *(undefined4 *)(param_1 + 0x16c);
                local_128 = *(undefined4 *)(param_1 + 0x170);
                local_124 = *(undefined4 *)(param_1 + 0x174);
                local_120 = *(undefined4 *)(param_1 + 0x178);
                local_11c = *(undefined4 *)(param_1 + 0x17c);
                iVar2 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
                  local_res8[0] = (undefined2)iVar2;
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  puVar16 = &local_f8;
                  puVar13 = &local_138;
                  (**(code **)(*plVar5 + 0x140))
                            (plVar5,1,&DAT_1405d85a0,local_res8,&local_128,puVar13,puVar16);
                  uVar15 = (undefined4)((ulonglong)puVar13 >> 0x20);
                }
              }
              FUN_1401a1500(param_1,local_e0);
              FUN_1401a10d0(param_1,local_e0);
              FUN_1401a1150();
              FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,&local_f8,
                            CONCAT44(uVar15,1),(ulonglong)puVar16 & 0xffffffff00000000,
                            CONCAT44(uVar18,local_dc[0] + 1),CONCAT44(uVar19,(int)local_dc[0]));
              if (bVar8) {
                FUN_14034edd0(lVar6);
              }
              return 1;
            }
          }
        }
      }
    }
    else {
      iVar2 = DAT_1406080cc + 1;
      bVar7 = DAT_1406080cc == 0;
      DAT_1406080cc = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar6);
  }
  return 0;
}



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

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined2 local_res8 [4];
  undefined4 local_res10;
  undefined2 local_58;
  undefined2 local_56 [3];
  undefined8 local_50;
  longlong local_48;
  undefined1 local_40;
  
  local_50 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  local_48 = 0;
  bVar7 = false;
  local_40 = 0;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  local_res10 = param_2;
  if (plVar2 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        lVar4 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        local_40 = 0;
        local_48 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        local_40 = 1;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x6c0);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x6c8)) {
      lVar3 = *plVar2;
      if (lVar3 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar1 = DAT_140608048 + 1, bVar6 = DAT_140608048 == 0, lVar3 = lVar5,
           DAT_140608048 = iVar1, bVar6)) {
          FUN_140176d60(1);
        }
        iVar1 = FUN_1401f2930(lVar3,param_1,local_res10,param_3,param_4,param_5,param_6,param_7);
        if (iVar1 != 0) {
          local_58 = (undefined2)param_3;
          local_56[0] = (undefined2)local_res10;
          plVar2 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          local_res8[0] = (short)param_4;
          (**(code **)(*plVar2 + 0x3a0))
                    (plVar2,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_56,&local_58,
                     local_res8,param_5,param_6);
        }
      }
    }
    else {
      iVar1 = DAT_140608048 + 1;
      bVar6 = DAT_140608048 == 0;
      DAT_140608048 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



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

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined2 local_res8 [4];
  undefined2 local_48 [4];
  undefined8 local_40;
  longlong local_38;
  undefined1 local_30;
  
  local_40 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  local_38 = 0;
  bVar7 = false;
  local_30 = 0;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar2 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        lVar4 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        local_30 = 0;
        local_38 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        local_30 = 1;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x9d0);
  if (plVar2 == (longlong *)0x0) goto LAB_1401a3651;
  if (plVar2 != *(longlong **)(param_1 + 0x9d8)) {
    iVar1 = DAT_1406080d4 + 1;
    bVar6 = DAT_1406080d4 == 0;
    DAT_1406080d4 = iVar1;
    if (bVar6) {
      FUN_140176d60(1);
    }
    goto LAB_1401a3651;
  }
  lVar3 = *plVar2;
  if (lVar3 == 0) goto LAB_1401a3651;
  if (param_6 == 0) {
    if (plVar2 != *(longlong **)(param_1 + 0x9d8)) {
LAB_1401a35a5:
      iVar1 = DAT_1406080d4 + 1;
      bVar6 = DAT_1406080d4 == 0;
      lVar3 = lVar5;
      DAT_1406080d4 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  else {
    plVar2 = *(longlong **)(param_1 + 0x9f0);
    lVar3 = 0;
    if (plVar2 != (longlong *)0x0) {
      if (plVar2 != *(longlong **)(param_1 + 0x9f8)) goto LAB_1401a35a5;
      lVar3 = *plVar2;
    }
  }
  iVar1 = FUN_140264990(lVar3,param_1,param_2,param_3,param_4,param_5,param_6);
  if (iVar1 == 1) {
    local_res8[0] = (undefined2)param_3;
    local_48[0] = (undefined2)param_2;
    plVar2 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    (**(code **)(*plVar2 + 0x3b0))
              (plVar2,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_48,local_res8,param_4,
               param_5,&param_6);
  }
LAB_1401a3651:
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



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

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined2 local_res8 [4];
  undefined2 local_48;
  undefined2 local_46;
  undefined2 local_44 [2];
  undefined8 local_40;
  longlong local_38;
  undefined1 local_30;
  
  local_40 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  local_38 = 0;
  bVar7 = false;
  local_30 = 0;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar2 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        lVar4 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        local_30 = 0;
        local_38 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        local_30 = 1;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x9b0);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x9b8)) {
      lVar3 = *plVar2;
      if (lVar3 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0x9b8)) &&
           (iVar1 = DAT_1406080cc + 1, bVar6 = DAT_1406080cc == 0, lVar3 = lVar5,
           DAT_1406080cc = iVar1, bVar6)) {
          FUN_140176d60(1);
        }
        iVar1 = FUN_140262270(lVar3,param_1,param_2,param_3,param_4,param_5,param_6);
        if (iVar1 != 0) {
          local_res8[0] = (undefined2)param_5;
          local_46 = (undefined2)param_3;
          local_44[0] = (undefined2)param_2;
          plVar2 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          local_48 = (short)param_4;
          (**(code **)(*plVar2 + 0x3c0))
                    (plVar2,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_44,&local_46,&local_48
                     ,local_res8,&param_6);
        }
      }
    }
    else {
      iVar1 = DAT_1406080cc + 1;
      bVar6 = DAT_1406080cc == 0;
      DAT_1406080cc = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



undefined8
FUN_1401a3880(longlong param_1,int *param_2,undefined8 param_3,undefined8 param_4,int *param_5,
             int *param_6,int param_7)

{
  int iVar1;
  longlong *plVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  ulonglong uVar10;
  bool bVar11;
  bool bVar12;
  undefined4 local_res8 [2];
  undefined8 in_stack_fffffffffffffe28;
  undefined8 in_stack_fffffffffffffe30;
  undefined4 uVar13;
  undefined4 local_1b8 [2];
  longlong local_1b0;
  undefined1 local_1a8;
  undefined8 local_1a0;
  undefined1 local_198 [24];
  uint local_180;
  short local_17c;
  undefined4 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar5 = (undefined4)((ulonglong)in_stack_fffffffffffffe28 >> 0x20);
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffe30 >> 0x20);
  local_1a0 = 0xfffffffffffffffe;
  lVar8 = 0;
  local_1b0 = 0;
  bVar12 = false;
  local_1a8 = 0;
  plVar7 = *(longlong **)(param_1 + 0xb28);
  if (plVar7 != (longlong *)0x0) {
    if (plVar7 == *(longlong **)(param_1 + 0xb30)) {
      lVar9 = *plVar7;
      lVar8 = 0;
      if (lVar9 != 0) {
        if (plVar7 != *(longlong **)(param_1 + 0xb30)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar12 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar12) {
            FUN_140176d60(1);
          }
          lVar9 = 0;
        }
        local_1a8 = 0;
        local_1b0 = lVar9;
        FUN_14034ed40(lVar9);
        bVar12 = true;
        local_1a8 = 1;
        lVar8 = lVar9;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  plVar7 = *(longlong **)(param_1 + 0x6c0);
  if (plVar7 == (longlong *)0x0) goto LAB_1401a3c77;
  if (plVar7 == *(longlong **)(param_1 + 0x6c8)) {
    lVar9 = *plVar7;
    if ((lVar9 == 0) || (plVar2 = *(longlong **)(param_1 + 0x9d0), plVar2 == (longlong *)0x0))
    goto LAB_1401a3c77;
    if (plVar2 == *(longlong **)(param_1 + 0x9d8)) {
      if (*plVar2 != 0) {
        if (plVar7 != *(longlong **)(param_1 + 0x6c8)) {
          iVar4 = DAT_140608048 + 1;
          bVar11 = DAT_140608048 == 0;
          DAT_140608048 = iVar4;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar9 = 0;
        }
        if ((*param_2 < 0) || (iVar4 = FUN_1401ed380(lVar9,param_4,param_2,param_3), iVar4 == 0)) {
          local_res8[0] = 0x17;
          local_1b8[0] = 0x2b0d;
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar7 + 0x70))
                    (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1b8,local_res8);
        }
        else {
          FUN_14000a170(local_198);
          local_f0 = 0;
          uVar6 = FUN_140174f00(param_1 + 0x6c0);
          if ((*param_2 < 0) || (iVar4 = FUN_1401ecce0(uVar6,param_2,param_3,local_198), iVar4 == 0)
             ) {
            local_res8[0] = 0x15;
            local_1b8[0] = 0x2b0d;
            plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar7 + 0x70))
                      (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1b8,local_res8);
          }
          else {
            iVar4 = *param_6;
            if ((iVar4 < 1) || (local_17c < iVar4)) {
              local_res8[0] = 0x18;
              local_1b8[0] = 0x2b0d;
              plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar7 + 0x70))
                        (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1b8,local_res8);
            }
            else {
              if (param_7 != 1) {
                FUN_14000a170(local_e8);
                local_40 = 0;
                uVar6 = FUN_1401dea30(param_1 + 0x9d0);
                iVar4 = FUN_140263810(uVar6,param_1,local_198,param_5,param_6,local_e8,param_7);
                if (iVar4 != 0) {
                  uVar6 = FUN_140174f00(param_1 + 0x6c0);
                  if (-1 < *param_2) {
                    FUN_1401ef490(uVar6,param_1,param_2,param_3,param_6,local_e8);
                  }
                  uVar6 = FUN_140137690();
                  uVar5 = FUN_1401374e0(uVar6,local_180);
                  uVar6 = FUN_1402e0270();
                  uVar10 = (ulonglong)local_180;
                  cVar3 = FUN_1402df630(uVar6,uVar10);
                  if (cVar3 == '\0') {
                    uVar6 = FUN_1402e0270();
                    cVar3 = FUN_1402df680(uVar6,uVar5);
                    if (cVar3 == '\0') goto LAB_1401a3b8e;
                    uVar10 = (ulonglong)local_180;
                  }
                  FUN_1401a8bb0(param_1,uVar10 & 0xffffffff);
                }
LAB_1401a3b8e:
                if (bVar12) {
                  FUN_14034edd0(lVar8);
                }
                return 1;
              }
              iVar1 = *param_5;
              uVar6 = FUN_1401dea30(param_1 + 0x9f0);
              if (-1 < iVar1) {
                FUN_140265de0(uVar6,param_1,local_198,iVar1,CONCAT44(uVar5,iVar4),CONCAT44(uVar13,1)
                             );
              }
            }
          }
        }
      }
      goto LAB_1401a3c77;
    }
    iVar4 = DAT_1406080d4;
    DAT_1406080d4 = DAT_1406080d4 + 1;
  }
  else {
    iVar4 = DAT_140608048;
    DAT_140608048 = DAT_140608048 + 1;
  }
  if (iVar4 == 0) {
    FUN_140176d60(1);
  }
LAB_1401a3c77:
  if (bVar12) {
    FUN_14034edd0(lVar8);
  }
  return 0;
}



void FUN_1401a3cb0(longlong param_1,uint param_2,int param_3)

{
  undefined4 uVar1;
  int iVar2;
  int iVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 uVar8;
  bool bVar9;
  bool bVar10;
  undefined2 local_res8 [8];
  int local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_78 [2];
  undefined4 local_70 [2];
  undefined4 local_68 [2];
  undefined8 local_60;
  longlong local_58;
  undefined1 local_50;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  
  local_60 = 0xfffffffffffffffe;
  lVar7 = 0;
  lVar5 = 0;
  local_58 = 0;
  bVar10 = false;
  local_50 = 0;
  plVar4 = *(longlong **)(param_1 + 0xb28);
  lVar6 = lVar7;
  local_res18[0] = param_3;
  if (plVar4 != (longlong *)0x0) {
    lVar6 = lVar5;
    if (plVar4 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar4 != 0) {
        lVar6 = *plVar4;
        if ((plVar4 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar6 = lVar7,
           DAT_1406080a8 = iVar2, bVar10)) {
          FUN_140176d60(1);
        }
        local_50 = 0;
        local_58 = lVar6;
        FUN_14034ed40(lVar6);
        bVar10 = true;
        local_50 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_res18[0] == 0) {
    plVar4 = *(longlong **)(param_1 + 0x9d0);
    if (plVar4 == (longlong *)0x0) goto LAB_1401a40c0;
    if (plVar4 != *(longlong **)(param_1 + 0x9d8)) {
      iVar2 = DAT_1406080d4 + 1;
      bVar9 = DAT_1406080d4 == 0;
      DAT_1406080d4 = iVar2;
      if (bVar9) {
        FUN_140176d60(1);
      }
      goto LAB_1401a40c0;
    }
    if (*plVar4 == 0) goto LAB_1401a40c0;
    lVar5 = *plVar4;
    if ((plVar4 != *(longlong **)(param_1 + 0x9d8)) &&
       (iVar2 = DAT_1406080d4 + 1, bVar9 = DAT_1406080d4 == 0, lVar5 = lVar7, DAT_1406080d4 = iVar2,
       bVar9)) {
      FUN_140176d60(1);
    }
    iVar2 = DAT_1406080d4;
    if (param_2 < 0xb5) {
      *(uint *)(lVar5 + 0x9124) = param_2;
    }
    plVar4 = *(longlong **)(param_1 + 0x9d0);
    if (plVar4 != (longlong *)0x0) {
      if (plVar4 == *(longlong **)(param_1 + 0x9d8)) {
        lVar7 = *plVar4;
      }
      else {
        DAT_1406080d4 = iVar2 + 1;
        if (iVar2 == 0) {
          FUN_140176d60(1);
        }
      }
    }
    uVar8 = *(undefined4 *)(lVar7 + 0x9124);
    local_48 = *(undefined4 *)(param_1 + 0x170);
    local_44 = *(undefined4 *)(param_1 + 0x174);
    local_40 = *(undefined4 *)(param_1 + 0x178);
    local_3c = *(undefined4 *)(param_1 + 0x17c);
    iVar2 = *(int *)(param_1 + 0x284);
    local_res20[0] = uVar8;
    if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
       (lVar7 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar7 != 0)) {
      local_res8[0] = (undefined2)iVar2;
      plVar4 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar4 + 0x2c0))(plVar4,1,&DAT_1405d85a0,local_res8,&local_48,local_res20);
    }
  }
  else {
    plVar4 = *(longlong **)(param_1 + 0x9f0);
    if (plVar4 == (longlong *)0x0) goto LAB_1401a40c0;
    if (plVar4 != *(longlong **)(param_1 + 0x9f8)) {
      iVar2 = DAT_1406080d4 + 1;
      bVar9 = DAT_1406080d4 == 0;
      DAT_1406080d4 = iVar2;
      if (bVar9) {
        FUN_140176d60(1);
      }
      goto LAB_1401a40c0;
    }
    if (*plVar4 == 0) goto LAB_1401a40c0;
    lVar5 = *plVar4;
    if ((plVar4 != *(longlong **)(param_1 + 0x9f8)) &&
       (iVar2 = DAT_1406080d4 + 1, bVar9 = DAT_1406080d4 == 0, lVar5 = lVar7, DAT_1406080d4 = iVar2,
       bVar9)) {
      FUN_140176d60(1);
    }
    iVar2 = DAT_1406080d4;
    if (param_2 < 0xb5) {
      *(uint *)(lVar5 + 0x9124) = param_2;
    }
    plVar4 = *(longlong **)(param_1 + 0x9f0);
    lVar5 = lVar7;
    iVar3 = iVar2;
    if (plVar4 != (longlong *)0x0) {
      if (plVar4 == *(longlong **)(param_1 + 0x9f8)) {
        lVar5 = *plVar4;
      }
      else {
        DAT_1406080d4 = iVar2 + 1;
        iVar3 = DAT_1406080d4;
        if (iVar2 == 0) {
          FUN_140176d60(1);
          iVar3 = DAT_1406080d4;
        }
      }
    }
    uVar8 = *(undefined4 *)(lVar5 + 0x9124);
    uVar1 = *(undefined4 *)(param_1 + 0x5f0);
    plVar4 = *(longlong **)(param_1 + 0x9f0);
    if (plVar4 != (longlong *)0x0) {
      if (plVar4 == *(longlong **)(param_1 + 0x9f8)) {
        lVar7 = *plVar4;
      }
      else {
        DAT_1406080d4 = iVar3 + 1;
        if (iVar3 == 0) {
          FUN_140176d60(1);
        }
      }
    }
    local_78[0] = *(undefined4 *)(lVar7 + 0x9120);
    local_48 = *(undefined4 *)(param_1 + 0x160);
    local_44 = *(undefined4 *)(param_1 + 0x164);
    local_40 = *(undefined4 *)(param_1 + 0x168);
    local_3c = *(undefined4 *)(param_1 + 0x16c);
    iVar2 = *(int *)(param_1 + 0x284);
    local_68[0] = *(undefined4 *)(param_1 + 8);
    local_res20[0] = uVar1;
    local_70[0] = uVar8;
    if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
       (lVar7 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar7 != 0)) {
      local_res8[0] = (undefined2)iVar2;
      plVar4 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar4 + 0xfe0))
                (plVar4,1,&DAT_1405d85a0,local_res8,local_68,&local_48,local_70,local_78,local_res20
                );
    }
  }
  local_res8[0] = (undefined2)uVar8;
  plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  (**(code **)(*plVar4 + 0x130))
            (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8,local_res18);
LAB_1401a40c0:
  if (bVar10) {
    FUN_14034edd0(lVar6);
  }
  return;
}



void FUN_1401a40e0(longlong param_1)

{
  int *piVar1;
  int *piVar2;
  short sVar3;
  uint uVar4;
  uint *puVar5;
  short sVar6;
  int iVar7;
  undefined8 uVar8;
  longlong lVar9;
  
  uVar8 = FUN_140137690();
  iVar7 = FUN_140136b30(uVar8);
  if (iVar7 == 1) {
    uVar4 = *(uint *)(param_1 + 0x18);
    lVar9 = FUN_140137690();
    if (*(longlong *)(lVar9 + 0x88) != 0) {
      for (puVar5 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                              ((ulonglong)uVar4 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
          puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xa6)) {
        if ((puVar5[0xa8] == uVar4) && (*puVar5 == uVar4)) {
          if (puVar5 == (uint *)0x0) {
            return;
          }
          if ((puVar5[0x36] != 1) && (puVar5[0x36] != 2)) {
            return;
          }
          sVar3 = *(short *)(param_1 + 0x96);
          uVar8 = FUN_140142e30();
          sVar6 = FUN_140142d40(uVar8,(int)sVar3);
          sVar3 = *(short *)(param_1 + 0x96);
          piVar1 = (int *)(param_1 + 0x68);
          *(short *)(param_1 + 0x94) = sVar6;
          piVar2 = (int *)(param_1 + 0xa0);
          uVar8 = FUN_140143650();
          FUN_140142f50(uVar8,(int)sVar3,(int)sVar6,*(undefined4 *)(param_1 + 0x18),param_1 + 0x98,
                        param_1 + 0x9c,piVar2,piVar1);
          if (*piVar2 == 0) {
            uVar8 = FUN_140137690();
            iVar7 = FUN_140136bb0(uVar8,*(undefined4 *)(param_1 + 0x18));
            *piVar2 = iVar7;
          }
          *(int *)(param_1 + 0x24) = *piVar2;
          if (*piVar1 != 0) {
            return;
          }
          uVar8 = FUN_140137690();
          iVar7 = FUN_140136ad0(uVar8,*(undefined4 *)(param_1 + 0x18));
          *piVar1 = iVar7;
          return;
        }
      }
    }
  }
  return;
}



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

longlong *
FUN_1401a4270(longlong param_1,uint param_2,int param_3,int param_4,int param_5,int param_6,
             longlong *param_7,longlong *param_8)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  undefined4 uVar4;
  uint uVar5;
  int iVar6;
  undefined4 uVar7;
  int iVar8;
  longlong *plVar9;
  longlong lVar10;
  size_t sVar11;
  undefined8 uVar12;
  undefined4 *puVar13;
  wchar_t *pwVar14;
  longlong *plVar15;
  uint *puVar16;
  longlong lVar17;
  undefined2 uVar18;
  undefined2 uVar19;
  longlong lVar20;
  bool bVar21;
  bool bVar22;
  bool bVar23;
  uint local_res8 [2];
  uint local_res10 [2];
  int local_res18;
  undefined4 uVar24;
  longlong *in_stack_fffffffffffffcc0;
  ulonglong uVar25;
  undefined4 *puVar26;
  longlong *in_stack_fffffffffffffcc8;
  undefined4 uVar28;
  ulonglong uVar27;
  undefined *in_stack_fffffffffffffcd0;
  ulonglong uVar29;
  longlong *in_stack_fffffffffffffcd8;
  uint uVar31;
  undefined4 uVar32;
  ulonglong uVar30;
  undefined4 local_318 [2];
  undefined4 local_310 [2];
  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;
  undefined4 uStack_2e4;
  undefined4 local_2e0;
  undefined4 uStack_2dc;
  int local_2d8 [2];
  undefined4 local_2d0;
  undefined4 uStack_2cc;
  undefined4 uStack_2c8;
  undefined4 uStack_2c4;
  int local_2c0;
  longlong local_2b8;
  ulonglong local_2b0;
  longlong local_2a8;
  char local_2a0;
  undefined4 local_298;
  undefined4 uStack_294;
  undefined4 uStack_290;
  undefined4 uStack_28c;
  undefined2 local_284;
  undefined2 local_282;
  int local_280;
  undefined2 local_27c;
  undefined4 local_278;
  undefined4 local_230;
  undefined2 local_22c;
  undefined2 local_202;
  undefined4 local_1f0;
  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;
  undefined4 local_1a4;
  undefined4 local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  longlong local_188;
  undefined1 local_180 [24];
  longlong local_168;
  undefined4 local_160;
  undefined4 uStack_15c;
  undefined4 local_158;
  undefined4 local_154;
  int local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  wchar_t local_140 [48];
  undefined4 local_e0;
  undefined4 local_dc;
  int local_d8;
  undefined4 local_d4;
  char local_d0 [16];
  undefined4 local_c0;
  undefined8 local_68;
  undefined1 local_60 [16];
  undefined1 local_50 [24];
  
  local_68 = 0xfffffffffffffffe;
  lVar17 = 0;
  bVar23 = false;
  lVar20 = 0;
  local_2b8 = 0;
  local_2a8 = 0;
  bVar21 = false;
  local_2a0 = '\0';
  plVar9 = *(longlong **)(param_1 + 0xb28);
  lVar10 = lVar17;
  local_res10[0] = param_2;
  local_res18 = param_3;
  if (plVar9 != (longlong *)0x0) {
    lVar10 = lVar20;
    if (plVar9 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar9 != 0) {
        lVar10 = *plVar9;
        if ((plVar9 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar21 = DAT_1406080a8 == 0, lVar10 = lVar17,
           DAT_1406080a8 = iVar2, bVar21)) {
          FUN_140176d60(1);
        }
        local_2a0 = 0;
        local_2b8 = lVar10;
        local_2a8 = lVar10;
        FUN_14034ed40(lVar10);
        bVar21 = true;
        local_2a0 = '\x01';
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar22 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar22) {
        FUN_140176d60(1);
      }
    }
  }
  plVar9 = *(longlong **)(param_1 + 0x6c0);
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == *(longlong **)(param_1 + 0x6c8)) {
      if ((*plVar9 != 0) && (plVar9 = *(longlong **)(param_1 + 0x6e0), plVar9 != (longlong *)0x0)) {
        if (plVar9 == *(longlong **)(param_1 + 0x6e8)) {
          if (*plVar9 != 0) {
            if (0 < param_4) {
              cVar1 = FUN_1401b18a0(param_1,param_4);
              uVar3 = (uint)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20);
              uVar4 = (undefined4)((ulonglong)in_stack_fffffffffffffcc8 >> 0x20);
              uVar5 = (uint)((ulonglong)in_stack_fffffffffffffcd0 >> 0x20);
              uVar31 = (uint)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20);
              if (cVar1 == '\0') {
                FUN_14011f210(&local_168);
                local_160 = *(undefined4 *)(param_1 + 0x160);
                uStack_15c = *(undefined4 *)(param_1 + 0x164);
                local_158 = *(undefined4 *)(param_1 + 0x168);
                local_154 = *(undefined4 *)(param_1 + 0x16c);
                local_150 = *(int *)(param_1 + 0x170);
                local_14c = *(undefined4 *)(param_1 + 0x174);
                local_148 = *(undefined4 *)(param_1 + 0x178);
                local_144 = *(undefined4 *)(param_1 + 0x17c);
                lVar10 = FUN_140174f50(param_1 + 0x6e0);
                pwVar14 = (wchar_t *)(lVar10 + 0xd0);
                if (7 < *(ulonglong *)(lVar10 + 0xe8)) {
                  pwVar14 = *(wchar_t **)pwVar14;
                }
                sVar11 = wcsnlen(pwVar14,0x10);
                if (sVar11 < 0x10) {
                  lVar10 = FUN_140174f50(param_1 + 0x6e0);
                  pwVar14 = (wchar_t *)(lVar10 + 0xd0);
                  if (7 < *(ulonglong *)(lVar10 + 0xe8)) {
                    pwVar14 = *(wchar_t **)pwVar14;
                  }
                  wcscpy_s(local_140,0x10,pwVar14);
                }
                strcpy_s(local_d0,0x32,(char *)(param_1 + 0x330));
                local_e0 = 0x10;
                lVar10 = FUN_140174f00(param_1 + 0x6c0);
                local_dc = *(undefined4 *)(lVar10 + 0x50a0);
                local_d8 = param_4;
                FUN_140197b90(param_1,param_4);
                lVar10 = FUN_140174f00(param_1 + 0x6c0);
                local_d4 = *(undefined4 *)(lVar10 + 0x50a0);
                FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                              *(undefined4 *)(param_1 + 0x284),&local_168);
                lVar20 = (ulonglong)uVar31 << 0x20;
                lVar10 = (ulonglong)uVar5 << 0x20;
                uVar12 = CONCAT44(uVar4,param_4);
                uVar25 = (ulonglong)uVar3 << 0x20;
                uVar24 = 0;
                FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x19d,6,param_1,0,uVar25,uVar12,
                              lVar10,lVar20);
                uVar28 = (undefined4)((ulonglong)uVar12 >> 0x20);
                uVar7 = (undefined4)((ulonglong)lVar10 >> 0x20);
                uVar32 = (undefined4)((ulonglong)lVar20 >> 0x20);
                lVar10 = FUN_140174f00(param_1 + 0x6c0);
                uVar4 = *(undefined4 *)(lVar10 + 0x50a0);
                lVar10 = FUN_140174f00(param_1 + 0x6c0);
                in_stack_fffffffffffffcd8 = (longlong *)CONCAT44(uVar32,param_4);
                in_stack_fffffffffffffcd0 = (undefined *)CONCAT44(uVar7,uVar4);
                in_stack_fffffffffffffcc8 =
                     (longlong *)CONCAT44(uVar28,*(int *)(lVar10 + 0x50a0) - param_4);
                in_stack_fffffffffffffcc0 = (longlong *)(uVar25 & 0xffffffff00000000);
                FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x195,CONCAT44(uVar24,0x2e)
                              ,in_stack_fffffffffffffcc0,in_stack_fffffffffffffcc8,
                              in_stack_fffffffffffffcd0,in_stack_fffffffffffffcd8,0);
              }
            }
            if (0 < param_6) {
              iVar2 = *(int *)(param_1 + 0x5d4) + param_6;
              *(int *)(param_1 + 0x5d4) = iVar2;
              in_stack_fffffffffffffcc8 =
                   (longlong *)CONCAT44((int)((ulonglong)in_stack_fffffffffffffcc8 >> 0x20),iVar2);
              in_stack_fffffffffffffcc0 =
                   (longlong *)
                   CONCAT44((int)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20),iVar2 - param_6);
              FUN_140203920(*(undefined8 *)(param_1 + 0xb50),param_1,0x12d,0,param_6,
                            in_stack_fffffffffffffcc0,in_stack_fffffffffffffcc8);
              local_res8[0] = *(uint *)(param_1 + 0x5d4);
              plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar9 + 0xbf0))
                        (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8);
              local_2d8[0] = *(int *)(param_1 + 0x5d4);
              local_2d0 = *(undefined4 *)(param_1 + 0x160);
              uStack_2cc = *(undefined4 *)(param_1 + 0x164);
              uStack_2c8 = *(undefined4 *)(param_1 + 0x168);
              uStack_2c4 = *(undefined4 *)(param_1 + 0x16c);
              iVar2 = *(int *)(param_1 + 0x284);
              if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                 (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)) {
                local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                plVar9 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                         0x70);
                in_stack_fffffffffffffcc0 = (longlong *)local_2d8;
                (**(code **)(*plVar9 + 0xe20))
                          (plVar9,1,&DAT_1405d85a0,local_res8,&local_2d0,in_stack_fffffffffffffcc0);
              }
            }
            if (0 < param_5) {
              if (*(longlong *)(param_1 + 0xb58) == 0) {
                uVar4 = 0;
              }
              else {
                uVar4 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 8);
              }
              FUN_1401fce00(*(undefined8 *)(param_1 + 0xb50),uVar4,param_1);
            }
            uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20);
            uVar4 = (undefined4)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20);
            local_2d8[0] = -1;
            iVar2 = 0;
            if ((*param_7 != param_7[1]) &&
               (uVar3 = (int)(param_7[1] - *param_7 >> 2) / 2, 0 < (int)uVar3)) {
              local_2b0 = (ulonglong)uVar3;
              local_188 = lVar17;
              do {
                iVar6 = *(int *)(local_188 + *param_7);
                local_318[0] = *(undefined4 *)(local_188 + 4 + *param_7);
                local_188 = local_188 + 8;
                local_2c0 = iVar6;
                uVar12 = FUN_140137690();
                uVar3 = FUN_140136b30(uVar12,iVar6);
                local_res8[0] = uVar3;
                uVar12 = FUN_140137690();
                uVar4 = FUN_140137490(uVar12,iVar6);
                local_2e8 = 0;
                uStack_2e4 = 0;
                local_2e0 = 0;
                uStack_2dc = 0;
                puVar13 = (undefined4 *)FUN_140357570(local_50);
                local_2d0 = *puVar13;
                uStack_2cc = puVar13[1];
                uStack_2c8 = puVar13[2];
                uStack_2c4 = puVar13[3];
                FUN_14000a170(&local_298);
                local_1f0 = 0;
                local_298 = local_2d0;
                uStack_294 = uStack_2cc;
                uStack_290 = uStack_2c8;
                uStack_28c = uStack_2c4;
                local_27c = (undefined2)local_318[0];
                local_280 = iVar6;
                local_278 = uVar4;
                uVar12 = FUN_140137690();
                local_230 = FUN_140136ad0(uVar12,iVar6);
                local_202 = 6;
                if (uVar3 == 1) {
                  FUN_140197860(&local_298,iVar6);
                }
                FUN_1401a40e0(&local_298);
                uVar12 = FUN_140137690();
                local_22c = FUN_140136c10(uVar12,iVar6);
                uVar4 = (undefined4)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20);
                uVar19 = (undefined2)uVar3;
                if (uVar3 == 5) {
                  local_res8[0] = 0xffffffff;
                  FUN_140199da0(param_1,local_60,&local_298,local_res8);
                  uVar5 = local_res8[0];
                  local_282 = (undefined2)local_res8[0];
                  local_1e8 = *(undefined4 *)(param_1 + 0x160);
                  local_1e4 = *(undefined4 *)(param_1 + 0x164);
                  local_1e0 = *(undefined4 *)(param_1 + 0x168);
                  local_1dc = *(undefined4 *)(param_1 + 0x16c);
                  local_1a8 = *(undefined4 *)(param_1 + 0x170);
                  local_1a4 = *(undefined4 *)(param_1 + 0x174);
                  local_1a0 = *(undefined4 *)(param_1 + 0x178);
                  local_19c = *(undefined4 *)(param_1 + 0x17c);
                  iVar6 = *(int *)(param_1 + 0x284);
                  local_310[0] = *(undefined4 *)(param_1 + 8);
                  local_284 = uVar19;
                  if ((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                    if ((CONCAT44(uStack_294,local_298) != 0) ||
                       (bVar21 = bVar23, CONCAT44(uStack_28c,uStack_290) != 0)) {
                      bVar21 = true;
                    }
                    if (((bVar21) && (local_280 != 0)) &&
                       (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)
                       ) {
                      local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar6);
                      plVar9 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar10 + 8) +
                                 (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                      in_stack_fffffffffffffcd8 = (longlong *)&local_298;
                      in_stack_fffffffffffffcd0 = &DAT_14047ba3c;
                      in_stack_fffffffffffffcc8 = (longlong *)&local_1e8;
                      puVar13 = &local_1a8;
                      (**(code **)(*plVar9 + 0xb0))
                                (plVar9,1,&DAT_1405d85a0,local_res8,local_310,puVar13,
                                 in_stack_fffffffffffffcc8,&DAT_14047ba3c,in_stack_fffffffffffffcd8)
                      ;
                      uVar4 = (undefined4)((ulonglong)puVar13 >> 0x20);
                    }
                  }
                  lVar10 = FUN_140174f50(param_1 + 0x6e0);
                  if (lVar10 != 0) {
                    uVar30 = CONCAT44((int)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20),
                                      local_318[0]);
                    uVar29 = (ulonglong)in_stack_fffffffffffffcd0 & 0xffffffff00000000;
                    uVar27 = (ulonglong)in_stack_fffffffffffffcc8 & 0xffffffff00000000;
                    uVar25 = CONCAT44(uVar4,local_318[0]);
                    puVar13 = &local_298;
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x19d,6,param_1,puVar13,uVar25,
                                  uVar27,uVar29,uVar30);
                    uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                    uVar28 = (undefined4)(uVar27 >> 0x20);
                    uVar7 = (undefined4)(uVar29 >> 0x20);
                    lVar10 = FUN_140174f00(param_1 + 0x6c0);
                    uVar4 = *(undefined4 *)(lVar10 + 0x50a0);
                    lVar10 = FUN_140174f00(param_1 + 0x6c0);
                    in_stack_fffffffffffffcd8 = (longlong *)(uVar30 & 0xffffffff00000000);
                    in_stack_fffffffffffffcd0 = (undefined *)CONCAT44(uVar7,uVar4);
                    in_stack_fffffffffffffcc8 =
                         (longlong *)CONCAT44(uVar28,*(undefined4 *)(lVar10 + 0x50a0));
                    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_298,0x191,
                                  CONCAT44(uVar24,0x23),uVar25 & 0xffffffff00000000,
                                  in_stack_fffffffffffffcc8,in_stack_fffffffffffffcd0,
                                  in_stack_fffffffffffffcd8,0);
                  }
                  local_318[0] = CONCAT22(local_318[0]._2_2_,5);
                  in_stack_fffffffffffffcc0 = (longlong *)&local_298;
LAB_1401a50ad:
                  plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)uVar5);
                  (**(code **)(*plVar9 + 0xc0))
                            (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_318,local_res8
                             ,in_stack_fffffffffffffcc0);
                  iVar6 = local_2c0;
                }
                else {
                  if (uVar3 != 6) {
                    uVar12 = FUN_140174f00(param_1 + 0x6c0);
                    if ((int)uVar3 < 0) {
                      uVar5 = 0xffffffff;
                    }
                    else {
                      uVar5 = FUN_1401e8dc0(uVar12,param_1,local_res8,&local_298,&local_2e8);
                    }
                    FUN_14000a170(&local_168);
                    local_c0 = 0;
                    lVar10 = FUN_140174f00(param_1 + 0x6c0);
                    if ((uVar3 < 5) && (uVar5 < 0x18)) {
                      lVar10 = ((longlong)(int)uVar5 + (longlong)(int)uVar3 * 0x18) * 0xac + lVar10;
                      *(undefined2 *)(lVar10 + 0x14) = uVar19;
                      *(short *)(lVar10 + 0x16) = (short)uVar5;
                      FUN_140090020(&local_168);
                    }
                    bVar21 = CONCAT44(uStack_2cc,local_2d0) < CONCAT44(uStack_2e4,local_2e8);
                    if ((CONCAT44(uStack_2cc,local_2d0) != CONCAT44(uStack_2e4,local_2e8)) ||
                       (bVar21 = CONCAT44(uStack_2c4,uStack_2c8) < CONCAT44(uStack_2dc,local_2e0),
                       iVar6 = iVar2,
                       CONCAT44(uStack_2c4,uStack_2c8) != CONCAT44(uStack_2dc,local_2e0))) {
                      iVar6 = (1 - (uint)bVar21) - (uint)(bVar21 != 0);
                    }
                    uVar24 = *(undefined4 *)(param_1 + 0x160);
                    if (iVar6 == 0) {
                      local_1c4 = *(undefined4 *)(param_1 + 0x164);
                      local_1c0 = *(undefined4 *)(param_1 + 0x168);
                      local_1bc = *(undefined4 *)(param_1 + 0x16c);
                      local_1d8 = *(undefined4 *)(param_1 + 0x170);
                      local_1d4 = *(undefined4 *)(param_1 + 0x174);
                      local_1d0 = *(undefined4 *)(param_1 + 0x178);
                      local_1cc = *(undefined4 *)(param_1 + 0x17c);
                      iVar6 = *(int *)(param_1 + 0x284);
                      local_310[0] = *(undefined4 *)(param_1 + 8);
                      local_1c8 = uVar24;
                      if ((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))
                         ) {
                        if ((local_168 != 0) || (iVar8 = iVar2, CONCAT44(uStack_15c,local_160) != 0)
                           ) {
                          iVar8 = 1;
                        }
                        if (((iVar8 != 0) && (local_150 != 0)) &&
                           (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                           lVar10 != 0)) {
                          local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar6);
                          plVar9 = (longlong *)
                                   (*(longlong *)
                                     (*(longlong *)(lVar10 + 8) +
                                     (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                          in_stack_fffffffffffffcd8 = &local_168;
                          in_stack_fffffffffffffcd0 = &DAT_14047ba3c;
                          in_stack_fffffffffffffcc8 = (longlong *)&local_1c8;
                          puVar13 = &local_1d8;
                          (**(code **)(*plVar9 + 0xb0))
                                    (plVar9,1,&DAT_1405d85a0,local_res8,local_310,puVar13,
                                     in_stack_fffffffffffffcc8,&DAT_14047ba3c,
                                     in_stack_fffffffffffffcd8);
                          uVar4 = (undefined4)((ulonglong)puVar13 >> 0x20);
                        }
                      }
                    }
                    else {
                      local_2f4 = *(undefined4 *)(param_1 + 0x164);
                      local_2f0 = *(undefined4 *)(param_1 + 0x168);
                      local_2ec = *(undefined4 *)(param_1 + 0x16c);
                      local_308 = *(undefined4 *)(param_1 + 0x170);
                      local_304 = *(undefined4 *)(param_1 + 0x174);
                      local_300 = *(undefined4 *)(param_1 + 0x178);
                      local_2fc = *(undefined4 *)(param_1 + 0x17c);
                      iVar6 = *(int *)(param_1 + 0x284);
                      local_2f8 = uVar24;
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar10 != 0)) {
                        local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar6);
                        plVar9 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar10 + 8) +
                                   (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffffcc8 = &local_168;
                        puVar13 = &local_2f8;
                        (**(code **)(*plVar9 + 0x140))
                                  (plVar9,1,&DAT_1405d85a0,local_res8,&local_308,puVar13,
                                   in_stack_fffffffffffffcc8);
                        uVar4 = (undefined4)((ulonglong)puVar13 >> 0x20);
                      }
                    }
                    lVar10 = FUN_140174f50(param_1 + 0x6e0);
                    if (lVar10 != 0) {
                      uVar30 = CONCAT44((int)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20),
                                        local_318[0]);
                      uVar29 = (ulonglong)in_stack_fffffffffffffcd0 & 0xffffffff00000000;
                      uVar27 = (ulonglong)in_stack_fffffffffffffcc8 & 0xffffffff00000000;
                      uVar25 = CONCAT44(uVar4,local_318[0]);
                      puVar13 = &local_298;
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x19d,6,param_1,puVar13,uVar25,
                                    uVar27,uVar29,uVar30);
                      uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                      uVar28 = (undefined4)(uVar27 >> 0x20);
                      uVar7 = (undefined4)(uVar29 >> 0x20);
                      lVar10 = FUN_140174f00(param_1 + 0x6c0);
                      uVar4 = *(undefined4 *)(lVar10 + 0x50a0);
                      lVar10 = FUN_140174f00(param_1 + 0x6c0);
                      in_stack_fffffffffffffcd8 = (longlong *)(uVar30 & 0xffffffff00000000);
                      in_stack_fffffffffffffcd0 = (undefined *)CONCAT44(uVar7,uVar4);
                      in_stack_fffffffffffffcc8 =
                           (longlong *)CONCAT44(uVar28,*(undefined4 *)(lVar10 + 0x50a0));
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_168,0x191,
                                    CONCAT44(uVar24,0x23),uVar25 & 0xffffffff00000000,
                                    in_stack_fffffffffffffcc8,in_stack_fffffffffffffcd0,
                                    in_stack_fffffffffffffcd8,0);
                    }
                    local_318[0] = CONCAT22(local_318[0]._2_2_,uVar19);
                    in_stack_fffffffffffffcc0 = &local_168;
                    goto LAB_1401a50ad;
                  }
                  local_res8[0] = 0xffffffff;
                  plVar9 = (longlong *)FUN_140199f30(param_1,local_180,&local_298,local_res8);
                  uVar4 = (undefined4)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20);
                  local_2e8 = (undefined4)*plVar9;
                  uStack_2e4 = *(undefined4 *)((longlong)plVar9 + 4);
                  local_2e0 = (undefined4)plVar9[1];
                  uStack_2dc = *(undefined4 *)((longlong)plVar9 + 0xc);
                  if ((*plVar9 != 0) || (iVar8 = iVar2, plVar9[1] != 0)) {
                    iVar8 = 1;
                  }
                  if (iVar8 != 0) {
                    uVar12 = FUN_140174f00(param_1 + 0x6c0);
                    FUN_1401ec880(uVar12,local_res8,&local_168);
                    uVar5 = local_res8[0];
                    local_284 = 6;
                    local_282 = (undefined2)local_res8[0];
                    bVar21 = CONCAT44(uStack_2cc,local_2d0) < CONCAT44(uStack_2e4,local_2e8);
                    if ((CONCAT44(uStack_2cc,local_2d0) != CONCAT44(uStack_2e4,local_2e8)) ||
                       (bVar21 = CONCAT44(uStack_2c4,uStack_2c8) < CONCAT44(uStack_2dc,local_2e0),
                       iVar6 = iVar2,
                       CONCAT44(uStack_2c4,uStack_2c8) != CONCAT44(uStack_2dc,local_2e0))) {
                      iVar6 = (1 - (uint)bVar21) - (uint)(bVar21 != 0);
                    }
                    if (iVar6 == 0) {
                      local_198 = *(undefined4 *)(param_1 + 0x160);
                      local_194 = *(undefined4 *)(param_1 + 0x164);
                      local_190 = *(undefined4 *)(param_1 + 0x168);
                      local_18c = *(undefined4 *)(param_1 + 0x16c);
                      local_1b8 = *(undefined4 *)(param_1 + 0x170);
                      local_1b4 = *(undefined4 *)(param_1 + 0x174);
                      local_1b0 = *(undefined4 *)(param_1 + 0x178);
                      local_1ac = *(undefined4 *)(param_1 + 0x17c);
                      iVar6 = *(int *)(param_1 + 0x284);
                      local_310[0] = *(undefined4 *)(param_1 + 8);
                      if ((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))
                         ) {
                        if ((CONCAT44(uStack_294,local_298) != 0) ||
                           (iVar8 = iVar2, CONCAT44(uStack_28c,uStack_290) != 0)) {
                          iVar8 = 1;
                        }
                        if (((iVar8 != 0) && (local_280 != 0)) &&
                           (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                           lVar10 != 0)) {
                          local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar6);
                          plVar9 = (longlong *)
                                   (*(longlong *)
                                     (*(longlong *)(lVar10 + 8) +
                                     (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                          in_stack_fffffffffffffcd8 = (longlong *)&local_298;
                          in_stack_fffffffffffffcd0 = &DAT_14047ba3c;
                          in_stack_fffffffffffffcc8 = (longlong *)&local_198;
                          puVar13 = &local_1b8;
                          (**(code **)(*plVar9 + 0xb0))
                                    (plVar9,1,&DAT_1405d85a0,local_res8,local_310,puVar13,
                                     in_stack_fffffffffffffcc8,&DAT_14047ba3c,
                                     in_stack_fffffffffffffcd8);
                          uVar4 = (undefined4)((ulonglong)puVar13 >> 0x20);
                        }
                      }
                    }
                    lVar10 = FUN_140174f50(param_1 + 0x6e0);
                    if (lVar10 != 0) {
                      uVar30 = CONCAT44((int)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20),
                                        local_318[0]);
                      uVar29 = (ulonglong)in_stack_fffffffffffffcd0 & 0xffffffff00000000;
                      uVar27 = (ulonglong)in_stack_fffffffffffffcc8 & 0xffffffff00000000;
                      uVar25 = CONCAT44(uVar4,local_318[0]);
                      puVar13 = &local_298;
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x19d,6,param_1,puVar13,uVar25,
                                    uVar27,uVar29,uVar30);
                      uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                      uVar28 = (undefined4)(uVar27 >> 0x20);
                      uVar7 = (undefined4)(uVar29 >> 0x20);
                      lVar10 = FUN_140174f00(param_1 + 0x6c0);
                      uVar4 = *(undefined4 *)(lVar10 + 0x50a0);
                      lVar10 = FUN_140174f00(param_1 + 0x6c0);
                      in_stack_fffffffffffffcd8 = (longlong *)(uVar30 & 0xffffffff00000000);
                      in_stack_fffffffffffffcd0 = (undefined *)CONCAT44(uVar7,uVar4);
                      in_stack_fffffffffffffcc8 =
                           (longlong *)CONCAT44(uVar28,*(undefined4 *)(lVar10 + 0x50a0));
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_298,0x191,
                                    CONCAT44(uVar24,0x23),uVar25 & 0xffffffff00000000,
                                    in_stack_fffffffffffffcc8,in_stack_fffffffffffffcd0,
                                    in_stack_fffffffffffffcd8,0);
                    }
                    local_318[0] = CONCAT22(local_318[0]._2_2_,6);
                    in_stack_fffffffffffffcc0 = (longlong *)&local_298;
                    goto LAB_1401a50ad;
                  }
                }
                uVar12 = FUN_140137690();
                uVar4 = FUN_1401374e0(uVar12,iVar6);
                uVar12 = FUN_1402e0270();
                cVar1 = FUN_1402df630(uVar12,iVar6);
                if (cVar1 == '\0') {
                  uVar12 = FUN_1402e0270();
                  cVar1 = FUN_1402df680(uVar12,uVar4);
                  if (cVar1 != '\0') goto LAB_1401a5126;
                }
                else {
LAB_1401a5126:
                  if ((((uVar3 == 1) || (uVar3 == 2)) || (uVar3 == 3)) ||
                     ((uVar3 == 4 || (uVar3 == 5)))) {
                    FUN_1401a8bb0(param_1,iVar6);
                  }
                }
                uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20);
                uVar4 = (undefined4)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20);
                local_2b0 = local_2b0 - 1;
              } while (local_2b0 != 0);
              local_2b0 = 0;
            }
            if (-1 < local_res18) {
              lVar10 = *param_8;
              if (((lVar10 != param_8[1]) &&
                  (iVar6 = (int)(param_8[1] - lVar10 >> 2) / 2, local_res18 < iVar6)) && (0 < iVar6)
                 ) {
                iVar6 = *(int *)(lVar10 + (longlong)(local_res18 * 2) * 4);
                uVar28 = *(undefined4 *)(lVar10 + (longlong)(local_res18 * 2 + 1) * 4);
                uVar12 = FUN_140137690();
                uVar3 = FUN_140136b30(uVar12,iVar6);
                local_res8[0] = uVar3;
                uVar12 = FUN_140137690();
                uVar7 = FUN_140137490(uVar12,iVar6);
                local_2e8 = 0;
                uStack_2e4 = 0;
                local_2e0 = 0;
                uStack_2dc = 0;
                puVar13 = (undefined4 *)FUN_140357570(local_180);
                local_2d0 = *puVar13;
                uStack_2cc = puVar13[1];
                uStack_2c8 = puVar13[2];
                uStack_2c4 = puVar13[3];
                FUN_14000a170(&local_298);
                local_1f0 = 0;
                local_298 = local_2d0;
                uStack_294 = uStack_2cc;
                uStack_290 = uStack_2c8;
                uStack_28c = uStack_2c4;
                local_27c = (undefined2)uVar28;
                local_202 = 6;
                local_280 = iVar6;
                local_278 = uVar7;
                uVar12 = FUN_140137690();
                local_230 = FUN_140136ad0(uVar12,iVar6);
                if (uVar3 == 1) {
                  FUN_140197860(&local_298,iVar6);
                }
                FUN_1401a40e0(&local_298);
                uVar12 = FUN_140137690();
                local_22c = FUN_140136c10(uVar12,iVar6);
                uVar19 = (undefined2)uVar3;
                if (uVar3 == 5) {
                  local_res8[0] = 0xffffffff;
                  FUN_140199da0(param_1,local_180,&local_298,local_res8);
                  uVar18 = (undefined2)local_res8[0];
                  local_308 = *(undefined4 *)(param_1 + 0x160);
                  local_304 = *(undefined4 *)(param_1 + 0x164);
                  local_300 = *(undefined4 *)(param_1 + 0x168);
                  local_2fc = *(undefined4 *)(param_1 + 0x16c);
                  local_2f8 = *(undefined4 *)(param_1 + 0x170);
                  local_2f4 = *(undefined4 *)(param_1 + 0x174);
                  local_2f0 = *(undefined4 *)(param_1 + 0x178);
                  local_2ec = *(undefined4 *)(param_1 + 0x17c);
                  iVar8 = *(int *)(param_1 + 0x284);
                  local_310[0] = *(undefined4 *)(param_1 + 8);
                  local_284 = uVar19;
                  local_282 = uVar18;
                  if ((-1 < iVar8) && (iVar8 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                    if ((CONCAT44(uStack_294,local_298) != 0) ||
                       (CONCAT44(uStack_28c,uStack_290) != 0)) {
                      iVar2 = 1;
                    }
                    if (((iVar2 != 0) && (local_280 != 0)) &&
                       (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)
                       ) {
                      local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar8);
                      plVar9 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar10 + 8) +
                                 (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                      puVar13 = &local_298;
                      in_stack_fffffffffffffcd0 = &DAT_14047ba40;
                      in_stack_fffffffffffffcc8 = (longlong *)&local_308;
                      puVar26 = &local_2f8;
                      (**(code **)(*plVar9 + 0xb0))
                                (plVar9,1,&DAT_1405d85a0,local_res8,local_310,puVar26,
                                 in_stack_fffffffffffffcc8,&DAT_14047ba40,puVar13);
                      uVar4 = (undefined4)((ulonglong)puVar26 >> 0x20);
                      uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                    }
                  }
                  lVar10 = FUN_140174f50(param_1 + 0x6e0);
                  if (lVar10 != 0) {
                    uVar30 = CONCAT44(uVar24,uVar28);
                    uVar29 = (ulonglong)in_stack_fffffffffffffcd0 & 0xffffffff00000000;
                    uVar27 = (ulonglong)in_stack_fffffffffffffcc8 & 0xffffffff00000000;
                    uVar25 = CONCAT44(uVar4,uVar28);
                    puVar13 = &local_298;
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x19d,6,param_1,puVar13,uVar25,
                                  uVar27,uVar29,uVar30);
                    uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                    uVar28 = (undefined4)(uVar27 >> 0x20);
                    uVar7 = (undefined4)(uVar29 >> 0x20);
                    lVar10 = FUN_140174f00(param_1 + 0x6c0);
                    uVar4 = *(undefined4 *)(lVar10 + 0x50a0);
                    lVar10 = FUN_140174f00(param_1 + 0x6c0);
                    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_298,0x191,
                                  CONCAT44(uVar24,0x24),uVar25 & 0xffffffff00000000,
                                  CONCAT44(uVar28,*(undefined4 *)(lVar10 + 0x50a0)),
                                  CONCAT44(uVar7,uVar4),uVar30 & 0xffffffff00000000,0);
                  }
                  local_res8[0] = CONCAT22(local_res8[0]._2_2_,uVar18);
                  local_318[0] = CONCAT22(local_318[0]._2_2_,5);
                  plVar9 = (longlong *)&local_298;
LAB_1401a5a99:
                  plVar15 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar15 + 0xc0))
                            (plVar15,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_318,
                             local_res8,plVar9);
                }
                else {
                  if (uVar3 != 6) {
                    uVar12 = FUN_140174f00(param_1 + 0x6c0);
                    if ((int)uVar3 < 0) {
                      iVar8 = -1;
                    }
                    else {
                      iVar8 = FUN_1401e8dc0(uVar12,param_1,local_res8,&local_298,&local_2e8);
                      local_2d8[0] = iVar8;
                    }
                    FUN_14000a170(&local_168);
                    local_c0 = 0;
                    lVar10 = FUN_140174f00(param_1 + 0x6c0);
                    if (((uVar3 < 5) && (-1 < iVar8)) && (iVar8 < 0x18)) {
                      lVar10 = ((longlong)iVar8 + (longlong)(int)uVar3 * 0x18) * 0xac + lVar10;
                      *(undefined2 *)(lVar10 + 0x14) = uVar19;
                      *(short *)(lVar10 + 0x16) = (short)iVar8;
                      FUN_140090020(&local_168);
                    }
                    bVar21 = CONCAT44(uStack_2cc,local_2d0) < CONCAT44(uStack_2e4,local_2e8);
                    if ((CONCAT44(uStack_2cc,local_2d0) != CONCAT44(uStack_2e4,local_2e8)) ||
                       (bVar21 = CONCAT44(uStack_2c4,uStack_2c8) < CONCAT44(uStack_2dc,local_2e0),
                       CONCAT44(uStack_2c4,uStack_2c8) != CONCAT44(uStack_2dc,local_2e0))) {
                      iVar2 = (1 - (uint)bVar21) - (uint)(bVar21 != 0);
                    }
                    local_308 = *(undefined4 *)(param_1 + 0x160);
                    local_304 = *(undefined4 *)(param_1 + 0x164);
                    local_300 = *(undefined4 *)(param_1 + 0x168);
                    local_2fc = *(undefined4 *)(param_1 + 0x16c);
                    local_2f8 = *(undefined4 *)(param_1 + 0x170);
                    local_2f4 = *(undefined4 *)(param_1 + 0x174);
                    local_2f0 = *(undefined4 *)(param_1 + 0x178);
                    local_2ec = *(undefined4 *)(param_1 + 0x17c);
                    if (iVar2 == 0) {
                      iVar2 = *(int *)(param_1 + 0x284);
                      local_310[0] = *(undefined4 *)(param_1 + 8);
                      if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))
                         ) {
                        if ((local_168 != 0) || (CONCAT44(uStack_15c,local_160) != 0)) {
                          bVar23 = true;
                        }
                        if (((bVar23) && (local_150 != 0)) &&
                           (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                           lVar10 != 0)) {
                          local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                          plVar15 = (longlong *)
                                    (*(longlong *)
                                      (*(longlong *)(lVar10 + 8) +
                                      (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                          plVar9 = &local_168;
                          in_stack_fffffffffffffcd0 = &DAT_14047ba40;
                          in_stack_fffffffffffffcc8 = (longlong *)&local_308;
                          puVar13 = &local_2f8;
                          (**(code **)(*plVar15 + 0xb0))
                                    (plVar15,1,&DAT_1405d85a0,local_res8,local_310,puVar13,
                                     in_stack_fffffffffffffcc8,&DAT_14047ba40,plVar9);
                          uVar4 = (undefined4)((ulonglong)puVar13 >> 0x20);
                          uVar24 = (undefined4)((ulonglong)plVar9 >> 0x20);
                        }
                      }
                    }
                    else {
                      iVar2 = *(int *)(param_1 + 0x284);
                      if (((-1 < iVar2) &&
                          (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar10 != 0)) {
                        local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                        plVar9 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar10 + 8) +
                                   (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffffcc8 = &local_168;
                        puVar13 = &local_308;
                        (**(code **)(*plVar9 + 0x140))
                                  (plVar9,1,&DAT_1405d85a0,local_res8,&local_2f8,puVar13,
                                   in_stack_fffffffffffffcc8);
                        uVar4 = (undefined4)((ulonglong)puVar13 >> 0x20);
                      }
                    }
                    lVar10 = FUN_140174f50(param_1 + 0x6e0);
                    if (lVar10 != 0) {
                      uVar30 = CONCAT44(uVar24,uVar28);
                      uVar29 = (ulonglong)in_stack_fffffffffffffcd0 & 0xffffffff00000000;
                      uVar27 = (ulonglong)in_stack_fffffffffffffcc8 & 0xffffffff00000000;
                      uVar25 = CONCAT44(uVar4,uVar28);
                      puVar13 = &local_298;
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x19d,6,param_1,puVar13,uVar25,
                                    uVar27,uVar29,uVar30);
                      uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                      uVar28 = (undefined4)(uVar27 >> 0x20);
                      uVar7 = (undefined4)(uVar29 >> 0x20);
                      lVar10 = FUN_140174f00(param_1 + 0x6c0);
                      uVar4 = *(undefined4 *)(lVar10 + 0x50a0);
                      lVar10 = FUN_140174f00(param_1 + 0x6c0);
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_168,0x191,
                                    CONCAT44(uVar24,0x23),uVar25 & 0xffffffff00000000,
                                    CONCAT44(uVar28,*(undefined4 *)(lVar10 + 0x50a0)),
                                    CONCAT44(uVar7,uVar4),uVar30 & 0xffffffff00000000,0);
                    }
                    local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)local_2d8[0]);
                    local_318[0] = CONCAT22(local_318[0]._2_2_,uVar19);
                    plVar9 = &local_168;
                    goto LAB_1401a5a99;
                  }
                  local_res8[0] = 0xffffffff;
                  plVar9 = (longlong *)FUN_140199f30(param_1,local_180,&local_298,local_res8);
                  local_2e8 = (undefined4)*plVar9;
                  uStack_2e4 = *(undefined4 *)((longlong)plVar9 + 4);
                  local_2e0 = (undefined4)plVar9[1];
                  uStack_2dc = *(undefined4 *)((longlong)plVar9 + 0xc);
                  if ((*plVar9 != 0) || (iVar8 = iVar2, plVar9[1] != 0)) {
                    iVar8 = 1;
                  }
                  if (iVar8 != 0) {
                    uVar12 = FUN_140174f00(param_1 + 0x6c0);
                    FUN_1401ec880(uVar12,local_res8,&local_168);
                    local_284 = 6;
                    uVar19 = (undefined2)local_res8[0];
                    bVar21 = CONCAT44(uStack_2cc,local_2d0) < CONCAT44(uStack_2e4,local_2e8);
                    if ((CONCAT44(uStack_2cc,local_2d0) != CONCAT44(uStack_2e4,local_2e8)) ||
                       (bVar21 = CONCAT44(uStack_2c4,uStack_2c8) < CONCAT44(uStack_2dc,local_2e0),
                       iVar8 = iVar2,
                       CONCAT44(uStack_2c4,uStack_2c8) != CONCAT44(uStack_2dc,local_2e0))) {
                      iVar8 = (1 - (uint)bVar21) - (uint)(bVar21 != 0);
                    }
                    local_282 = uVar19;
                    if (iVar8 == 0) {
                      local_308 = *(undefined4 *)(param_1 + 0x160);
                      local_304 = *(undefined4 *)(param_1 + 0x164);
                      local_300 = *(undefined4 *)(param_1 + 0x168);
                      local_2fc = *(undefined4 *)(param_1 + 0x16c);
                      local_2f8 = *(undefined4 *)(param_1 + 0x170);
                      local_2f4 = *(undefined4 *)(param_1 + 0x174);
                      local_2f0 = *(undefined4 *)(param_1 + 0x178);
                      local_2ec = *(undefined4 *)(param_1 + 0x17c);
                      iVar8 = *(int *)(param_1 + 0x284);
                      local_310[0] = *(undefined4 *)(param_1 + 8);
                      if ((-1 < iVar8) && (iVar8 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))
                         ) {
                        if ((CONCAT44(uStack_294,local_298) != 0) ||
                           (CONCAT44(uStack_28c,uStack_290) != 0)) {
                          iVar2 = 1;
                        }
                        if (((iVar2 != 0) && (local_280 != 0)) &&
                           (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                           lVar10 != 0)) {
                          local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar8);
                          plVar9 = (longlong *)
                                   (*(longlong *)
                                     (*(longlong *)(lVar10 + 8) +
                                     (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                          puVar13 = &local_298;
                          in_stack_fffffffffffffcd0 = &DAT_14047ba40;
                          in_stack_fffffffffffffcc8 = (longlong *)&local_308;
                          puVar26 = &local_2f8;
                          (**(code **)(*plVar9 + 0xb0))
                                    (plVar9,1,&DAT_1405d85a0,local_res8,local_310,puVar26,
                                     in_stack_fffffffffffffcc8,&DAT_14047ba40,puVar13);
                          uVar4 = (undefined4)((ulonglong)puVar26 >> 0x20);
                          uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                        }
                      }
                    }
                    lVar10 = FUN_140174f50(param_1 + 0x6e0);
                    if (lVar10 != 0) {
                      uVar30 = CONCAT44(uVar24,uVar28);
                      uVar29 = (ulonglong)in_stack_fffffffffffffcd0 & 0xffffffff00000000;
                      uVar27 = (ulonglong)in_stack_fffffffffffffcc8 & 0xffffffff00000000;
                      uVar25 = CONCAT44(uVar4,uVar28);
                      puVar13 = &local_298;
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x19d,6,param_1,puVar13,uVar25,
                                    uVar27,uVar29,uVar30);
                      uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                      uVar28 = (undefined4)(uVar27 >> 0x20);
                      uVar7 = (undefined4)(uVar29 >> 0x20);
                      lVar10 = FUN_140174f00(param_1 + 0x6c0);
                      uVar4 = *(undefined4 *)(lVar10 + 0x50a0);
                      lVar10 = FUN_140174f00(param_1 + 0x6c0);
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_298,0x191,
                                    CONCAT44(uVar24,0x23),uVar25 & 0xffffffff00000000,
                                    CONCAT44(uVar28,*(undefined4 *)(lVar10 + 0x50a0)),
                                    CONCAT44(uVar7,uVar4),uVar30 & 0xffffffff00000000,0);
                    }
                    local_res8[0] = CONCAT22(local_res8[0]._2_2_,uVar19);
                    local_318[0] = CONCAT22(local_318[0]._2_2_,6);
                    plVar9 = (longlong *)&local_298;
                    goto LAB_1401a5a99;
                  }
                }
                uVar12 = FUN_140137690();
                uVar4 = FUN_1401374e0(uVar12,iVar6);
                uVar12 = FUN_1402e0270();
                cVar1 = FUN_1402df630(uVar12,iVar6);
                if (cVar1 == '\0') {
                  uVar12 = FUN_1402e0270();
                  cVar1 = FUN_1402df680(uVar12,uVar4);
                  if (cVar1 == '\0') goto LAB_1401a5b36;
                }
                if ((((uVar3 == 1) || (uVar3 == 2)) || (uVar3 == 3)) ||
                   ((uVar3 == 4 || (uVar3 == 5)))) {
                  FUN_1401a8bb0(param_1,iVar6);
                }
              }
            }
LAB_1401a5b36:
            local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)local_res18);
            plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar9 + 0x380))
                      (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10,local_res8);
            uVar3 = local_res10[0];
            plVar15 = (longlong *)FUN_1402e0270();
            plVar9 = (longlong *)((ulonglong)uVar3 / (ulonglong)*(uint *)(plVar15 + 2));
            if (*plVar15 != 0) {
              for (puVar16 = *(uint **)(*plVar15 +
                                       ((ulonglong)uVar3 % (ulonglong)*(uint *)(plVar15 + 2)) * 8);
                  puVar16 != (uint *)0x0; puVar16 = *(uint **)(puVar16 + 0x90)) {
                if ((puVar16[0x92] == uVar3) && (*puVar16 == uVar3)) {
                  if ((puVar16 != (uint *)0x0) && (0 < (int)puVar16[0x2e])) {
                    plVar9 = (longlong *)FUN_140197ef0(param_1);
                  }
                  break;
                }
              }
            }
            lVar10 = local_2b8;
            if (local_2a0 == '\0') {
              return plVar9;
            }
            goto LAB_1401a5bec;
          }
        }
        else {
          uVar3 = DAT_14060804c + 1;
          plVar9 = (longlong *)(ulonglong)uVar3;
          bVar23 = DAT_14060804c == 0;
          DAT_14060804c = uVar3;
          if (bVar23) {
            plVar9 = (longlong *)FUN_140176d60(1);
          }
        }
      }
    }
    else {
      uVar3 = DAT_140608048 + 1;
      plVar9 = (longlong *)(ulonglong)uVar3;
      bVar23 = DAT_140608048 == 0;
      DAT_140608048 = uVar3;
      if (bVar23) {
        plVar9 = (longlong *)FUN_140176d60(1);
      }
    }
  }
  if (!bVar21) {
    return plVar9;
  }
LAB_1401a5bec:
  plVar9 = (longlong *)FUN_14034edd0(lVar10);
  return plVar9;
}



void FUN_1401a5c10(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
           (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
           DAT_1406080d0 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_14025bbf0(lVar3,param_1,param_2,param_4,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar6 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



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

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
           (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
           DAT_1406080d0 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_14025bd60(lVar3,param_1,param_3,param_4,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar6 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



undefined8 FUN_1401a5ec0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  bool bVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      plVar4 = (longlong *)*plVar1;
      if (plVar4 != (longlong *)0x0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar5 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar5) {
            FUN_140176d60();
          }
          plVar4 = (longlong *)0x0;
        }
        lVar3 = (**(code **)(*plVar4 + 0x270))();
        *(undefined4 *)(lVar3 + 0x84) = 600000;
        return 1;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



undefined4 FUN_1401a5f50(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  bool bVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      plVar4 = (longlong *)*plVar1;
      if (plVar4 != (longlong *)0x0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar5 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar5) {
            FUN_140176d60();
          }
          plVar4 = (longlong *)0x0;
        }
        lVar3 = (**(code **)(*plVar4 + 0x270))();
        return *(undefined4 *)(lVar3 + 0x7c);
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



undefined8 FUN_1401a5fd0(longlong param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  bool bVar7;
  undefined2 local_res8 [8];
  int local_res18 [2];
  int local_res20 [2];
  undefined4 local_28;
  undefined4 uStack_24;
  undefined4 local_20;
  undefined4 uStack_1c;
  
  plVar6 = *(longlong **)(param_1 + 0x6e0);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0x6e8)) {
      if ((longlong *)*plVar6 != (longlong *)0x0) {
        iVar2 = 0;
        plVar5 = (longlong *)*plVar6;
        if ((plVar6 != *(longlong **)(param_1 + 0x6e8)) &&
           (iVar3 = DAT_14060804c + 1, bVar7 = DAT_14060804c == 0, plVar5 = (longlong *)0x0,
           DAT_14060804c = iVar3, bVar7)) {
          FUN_140176d60(1);
        }
        lVar4 = (**(code **)(*plVar5 + 0x270))();
        if ((lVar4 != 0) && ((-1 < param_2 || (0 < *(int *)(lVar4 + 0x7c))))) {
          piVar1 = (int *)(lVar4 + 0x7c);
          *piVar1 = *piVar1 + param_2;
          local_res18[0] = *(int *)(lVar4 + 0x7c);
          if (*piVar1 < 0) {
            local_res18[0] = iVar2;
          }
          *(int *)(lVar4 + 0x7c) = local_res18[0];
          plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar6 + 0x390))
                    (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18);
          local_28 = *(undefined4 *)(param_1 + 0x170);
          iVar3 = *(int *)(param_1 + 0x284);
          uStack_24 = *(undefined4 *)(param_1 + 0x174);
          local_20 = *(undefined4 *)(param_1 + 0x178);
          uStack_1c = *(undefined4 *)(param_1 + 0x17c);
          local_res20[0] = local_res18[0];
          if ((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
            if ((*(longlong *)(param_1 + 0x170) != 0) || (*(longlong *)(param_1 + 0x178) != 0)) {
              iVar2 = 1;
            }
            if ((iVar2 != 0) &&
               (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
              local_res8[0] = (undefined2)iVar3;
              lVar4 = *(longlong *)
                       (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
              (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x200))
                        (lVar4 + 0x70,1,&DAT_1405d85a0,local_res8,&local_28,local_res20);
            }
          }
          return 1;
        }
        return 0;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



undefined4 FUN_1401a6190(longlong param_1,undefined4 param_2)

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined4 local_res8 [2];
  
  lVar7 = 0;
  lVar5 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar6 = lVar7;
  if (plVar1 != (longlong *)0x0) {
    lVar6 = lVar5;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar6 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar6 = lVar7,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar6);
        bVar9 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar1 != 0) {
        uVar4 = FUN_140137690();
        local_res8[0] = FUN_140136b30(uVar4,param_2);
        plVar1 = *(longlong **)(param_1 + 0x6c0);
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
            lVar7 = *plVar1;
          }
          else {
            iVar2 = DAT_140608048 + 1;
            bVar8 = DAT_140608048 == 0;
            DAT_140608048 = iVar2;
            if (bVar8) {
              FUN_140176d60(1);
            }
          }
        }
        uVar3 = FUN_1401eceb0(lVar7,local_res8,param_2);
        if (!bVar9) {
          return uVar3;
        }
        FUN_14034edd0(lVar6);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar9) {
    FUN_14034edd0(lVar6);
  }
  return 0;
}



undefined8 FUN_1401a6310(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  bool bVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar5 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar5) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        uVar3 = FUN_1402f8580(lVar4);
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return 0xffffffff;
}



undefined8 FUN_1401a6390(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong *plVar4;
  bool bVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      plVar4 = (longlong *)*plVar1;
      if (plVar4 != (longlong *)0x0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar5 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar5) {
            FUN_140176d60();
          }
          plVar4 = (longlong *)0x0;
        }
                    // WARNING: Could not recover jumptable at 0x0001401a6400. Too many branches
                    // WARNING: Treating indirect jump as call
        uVar3 = (**(code **)(*plVar4 + 0x200))();
        return uVar3;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return 0xffffffff;
}



wchar_t * FUN_1401a6410(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar4 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar4) {
            FUN_140176d60(1);
          }
          lVar3 = 0;
        }
        if (*(ulonglong *)(lVar3 + 0xe8) < 8) {
          return (wchar_t *)(lVar3 + 0xd0);
        }
        return *(wchar_t **)(lVar3 + 0xd0);
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar4 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar4) {
        FUN_140176d60(1);
      }
    }
  }
  return L"@##@";
}



undefined4 FUN_1401a64a0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar4 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar4) {
            FUN_140176d60(1);
          }
          lVar3 = 0;
        }
        return *(undefined4 *)(lVar3 + 0x120);
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar4 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar4) {
        FUN_140176d60(1);
      }
    }
  }
  return 0xffffffff;
}



void FUN_1401a6520(longlong param_1,uint param_2,undefined4 param_3)

{
  undefined8 *puVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  uint *puVar7;
  uint *puVar8;
  uint uVar9;
  uint *puVar10;
  bool bVar11;
  bool bVar12;
  uint local_res10 [2];
  undefined4 local_res18 [4];
  undefined8 uVar13;
  uint *puVar14;
  undefined1 uVar15;
  
  uVar13 = 0xfffffffffffffffe;
  puVar10 = (uint *)0x0;
  uVar9 = 0;
  puVar7 = (uint *)0x0;
  puVar14 = (uint *)0x0;
  bVar12 = false;
  uVar15 = 0;
  puVar1 = *(undefined8 **)(param_1 + 0xb28);
  puVar8 = puVar10;
  local_res10[0] = param_2;
  local_res18[0] = param_3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar8 = puVar7;
    if (puVar1 == *(undefined8 **)(param_1 + 0xb30)) {
      if ((uint *)*puVar1 != (uint *)0x0) {
        puVar8 = (uint *)*puVar1;
        if ((puVar1 != *(undefined8 **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, puVar8 = puVar10,
           DAT_1406080a8 = iVar4, bVar12)) {
          FUN_140176d60(1);
        }
        puVar14 = puVar8;
        FUN_14034ed40(puVar8);
        bVar12 = true;
        uVar15 = 1;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  puVar1 = *(undefined8 **)(param_1 + 0x6c0);
  if (puVar1 == (undefined8 *)0x0) goto LAB_1401a67f2;
  if (puVar1 != *(undefined8 **)(param_1 + 0x6c8)) {
    iVar4 = DAT_140608048 + 1;
    bVar11 = DAT_140608048 == 0;
    DAT_140608048 = iVar4;
    if (bVar11) {
      FUN_140176d60(1);
    }
    goto LAB_1401a67f2;
  }
  if ((uint *)*puVar1 == (uint *)0x0) goto LAB_1401a67f2;
  puVar7 = (uint *)*puVar1;
  if ((puVar1 != *(undefined8 **)(param_1 + 0x6c8)) &&
     (iVar4 = DAT_140608048 + 1, bVar11 = DAT_140608048 == 0, puVar7 = puVar10,
     DAT_140608048 = iVar4, bVar11)) {
    FUN_140176d60(1);
  }
  FUN_1401ebc50(puVar7,param_1,local_res10[0],local_res18[0],0xfffffff3,0x1af,0x70,0,uVar13,puVar14,
                uVar15);
  uVar2 = local_res10[0];
  lVar5 = FUN_140137690();
  uVar3 = local_res10[0];
  if (*(longlong *)(lVar5 + 0x88) != 0) {
    for (puVar14 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                             ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
        puVar14 != (uint *)0x0; puVar14 = *(uint **)(puVar14 + 0xa6)) {
      if ((puVar14[0xa8] == uVar2) && (*puVar14 == uVar2)) {
        if (puVar14 != (uint *)0x0) {
          if (puVar14 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar9 = puVar14[0x18];
        }
        break;
      }
    }
  }
  lVar5 = FUN_1402e0270();
  if ((int)uVar3 < 1) {
LAB_1401a673a:
    lVar5 = FUN_1402e0270();
    if (0 < (int)uVar9) {
      puVar14 = puVar10;
      if (*(longlong *)(lVar5 + 0x1f8) != 0) {
        for (puVar7 = *(uint **)(*(longlong *)(lVar5 + 0x1f8) +
                                ((ulonglong)uVar9 % (ulonglong)*(uint *)(lVar5 + 0x208)) * 8);
            (puVar14 = puVar10, puVar7 != (uint *)0x0 &&
            ((puVar7[4] != uVar9 || (puVar14 = puVar7, *puVar7 != uVar9))));
            puVar7 = *(uint **)(puVar7 + 2)) {
        }
      }
      if (puVar14 != (uint *)0x0) goto LAB_1401a677d;
    }
  }
  else {
    puVar14 = puVar10;
    if (*(longlong *)(lVar5 + 0x1b0) != 0) {
      for (puVar7 = *(uint **)(*(longlong *)(lVar5 + 0x1b0) +
                              ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar5 + 0x1c0)) * 8);
          (puVar14 = puVar10, puVar7 != (uint *)0x0 &&
          ((puVar7[4] != uVar3 || (puVar14 = puVar7, *puVar7 != uVar3))));
          puVar7 = *(uint **)(puVar7 + 2)) {
      }
    }
    if (puVar14 == (uint *)0x0) goto LAB_1401a673a;
LAB_1401a677d:
    uVar13 = FUN_140137690();
    iVar4 = FUN_140136b30(uVar13,local_res10[0]);
    if ((((iVar4 == 1) || (iVar4 == 2)) || (iVar4 == 3)) || ((iVar4 == 4 || (iVar4 == 5)))) {
      FUN_1401a8bb0(param_1,local_res10[0]);
    }
  }
  plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  (**(code **)(*plVar6 + 0x9e0))
            (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10,local_res18);
LAB_1401a67f2:
  if (bVar12) {
    FUN_14034edd0(puVar8);
  }
  return;
}



void FUN_1401a6820(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
           (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
           DAT_1406080d0 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_1402584f0(lVar3,param_1,param_2,param_4,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar6 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



void FUN_1401a6980(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
           (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
           DAT_1406080d0 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_1402585a0(lVar3,param_1,param_2,param_3,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar6 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



int FUN_1401a6ae0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
           (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
           DAT_1406080d0 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        iVar2 = FUN_14025b170(lVar3,param_2,param_3,param_4,uVar8,lVar9,uVar10);
        if (iVar2 == 0) {
          if (bVar7) {
            FUN_14034edd0(lVar4);
          }
          return 1;
        }
        if (!bVar7) {
          return iVar2;
        }
        FUN_14034edd0(lVar4);
        return iVar2;
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar6 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return -1;
}



void FUN_1401a6c60(longlong param_1,undefined4 param_2,uint param_3)

{
  undefined4 uVar1;
  undefined8 *puVar2;
  uint *puVar3;
  short sVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  longlong *plVar8;
  longlong lVar9;
  longlong lVar10;
  uint uVar11;
  uint uVar12;
  longlong lVar13;
  bool bVar14;
  longlong local_d8;
  longlong local_d0;
  int local_c0;
  short local_bc;
  short local_b0;
  undefined4 local_30;
  
  plVar8 = *(longlong **)(param_1 + 0x9c0);
  if (plVar8 == (longlong *)0x0) {
    return;
  }
  if (plVar8 != *(longlong **)(param_1 + 0x9c8)) {
    if (DAT_1406080d0 != 0) {
      DAT_1406080d0 = DAT_1406080d0 + 1;
      return;
    }
    DAT_1406080d0 = DAT_1406080d0 + 1;
    FUN_140176d60(1);
    return;
  }
  lVar13 = *plVar8;
  if (lVar13 == 0) {
    return;
  }
  if (plVar8 != *(longlong **)(param_1 + 0x9c8)) {
    iVar5 = DAT_1406080d0 + 1;
    bVar14 = DAT_1406080d0 == 0;
    DAT_1406080d0 = iVar5;
    if (bVar14) {
      FUN_140176d60(1);
    }
    lVar13 = 0;
  }
  iVar5 = FUN_1402566c0(lVar13,param_1,param_2,param_3);
  if (iVar5 == 0) {
    return;
  }
  puVar2 = *(undefined8 **)(param_1 + 0x9c0);
  if (puVar2 != (undefined8 *)0x0) {
    if (puVar2 == *(undefined8 **)(param_1 + 0x9c8)) {
      uVar7 = *puVar2;
      goto LAB_1401a6d36;
    }
    iVar5 = DAT_1406080d0 + 1;
    bVar14 = DAT_1406080d0 == 0;
    DAT_1406080d0 = iVar5;
    if (bVar14) {
      FUN_140176d60(1);
    }
  }
  uVar7 = 0;
LAB_1401a6d36:
  FUN_140259110(uVar7,param_1,param_2,param_3);
  plVar8 = *(longlong **)(param_1 + 0x6e0);
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == *(longlong **)(param_1 + 0x6e8)) {
      if (*plVar8 != 0) {
        plVar8 = (longlong *)FUN_140174f50();
        lVar13 = (**(code **)(*plVar8 + 0x270))(plVar8);
        uVar1 = *(undefined4 *)(lVar13 + 0x5c);
        uVar7 = FUN_1401de9e0(param_1 + 0x9c0);
        FUN_1402584f0(uVar7,param_1,uVar1);
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar14 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar14) {
        FUN_140176d60();
      }
    }
  }
  plVar8 = (longlong *)FUN_1402e0270();
  if (*plVar8 != 0) {
    for (puVar3 = *(uint **)(*plVar8 + ((ulonglong)param_3 % (ulonglong)*(uint *)(plVar8 + 2)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x90)) {
      if ((puVar3[0x92] == param_3) && (*puVar3 == param_3)) {
        if (puVar3 != (uint *)0x0) {
          uVar12 = puVar3[0x13];
          goto LAB_1401a6dec;
        }
        break;
      }
    }
  }
  uVar12 = 0;
LAB_1401a6dec:
  plVar8 = *(longlong **)(param_1 + 0x6c0);
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == *(longlong **)(param_1 + 0x6c8)) {
      if ((*plVar8 != 0) && (uVar12 == 0x3e)) {
        uVar12 = 0;
        lVar13 = 0;
        do {
          uVar11 = 0;
          lVar10 = 0;
          do {
            FUN_14000a170();
            iVar5 = DAT_140608048;
            plVar8 = *(longlong **)(param_1 + 0x6c0);
            local_30 = 0;
            if (plVar8 == (longlong *)0x0) {
LAB_1401a6ec7:
              lVar9 = 0;
            }
            else {
              if (plVar8 != *(longlong **)(param_1 + 0x6c8)) {
                DAT_140608048 = DAT_140608048 + 1;
                if (iVar5 == 0) {
                  FUN_140176d60();
                }
                goto LAB_1401a6ec7;
              }
              lVar9 = *plVar8;
            }
            if ((uVar12 < 5) && (uVar11 < 0x18)) {
              lVar9 = (lVar13 + lVar10) * 0xac + lVar9;
              *(short *)(lVar9 + 0x14) = (short)uVar12;
              *(short *)(lVar9 + 0x16) = (short)uVar11;
              FUN_140090020(&local_d8);
              sVar4 = local_b0;
              iVar5 = local_c0;
              if ((local_d8 == 0) && (local_d0 == 0)) {
                bVar14 = false;
              }
              else {
                bVar14 = true;
              }
              if ((((bVar14) || (local_c0 != 0)) || (0 < local_bc)) && (0 < local_b0)) {
                puVar2 = *(undefined8 **)(param_1 + 0x9c0);
                if (puVar2 == (undefined8 *)0x0) {
LAB_1401a6f78:
                  uVar7 = 0;
                }
                else {
                  if (puVar2 != *(undefined8 **)(param_1 + 0x9c8)) {
                    iVar6 = DAT_1406080d0 + 1;
                    bVar14 = DAT_1406080d0 == 0;
                    DAT_1406080d0 = iVar6;
                    if (bVar14) {
                      FUN_140176d60(1);
                    }
                    goto LAB_1401a6f78;
                  }
                  uVar7 = *puVar2;
                }
                FUN_140258150(uVar7,param_1,iVar5,(int)sVar4);
              }
            }
            uVar11 = uVar11 + 1;
            lVar10 = lVar10 + 1;
          } while ((int)uVar11 < 0x18);
          uVar12 = uVar12 + 1;
          lVar13 = lVar13 + 0x18;
        } while ((int)uVar12 < 2);
      }
    }
    else {
      iVar5 = DAT_140608048 + 1;
      bVar14 = DAT_140608048 == 0;
      DAT_140608048 = iVar5;
      if (bVar14) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



ulonglong FUN_1401a6fe0(longlong param_1,int param_2,undefined4 param_3,int param_4)

{
  byte bVar1;
  int iVar2;
  uint uVar3;
  longlong *plVar4;
  undefined8 uVar5;
  int *piVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  int local_res8 [2];
  int local_res20 [2];
  
  lVar9 = 0;
  lVar7 = 0;
  bVar11 = false;
  plVar4 = *(longlong **)(param_1 + 0xb28);
  lVar8 = lVar9;
  local_res20[0] = param_4;
  if (plVar4 != (longlong *)0x0) {
    lVar8 = lVar7;
    if (plVar4 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar4 != 0) {
        lVar8 = *plVar4;
        if ((plVar4 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, lVar8 = lVar9,
           DAT_1406080a8 = iVar2, bVar11)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar8);
        bVar11 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar4 = *(longlong **)(param_1 + 0x6c0);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar4 != 0) {
        uVar5 = FUN_140137690();
        local_res8[0] = FUN_140136b30(uVar5,param_3);
        plVar4 = *(longlong **)(param_1 + 0x6c0);
        if (plVar4 != (longlong *)0x0) {
          if (plVar4 == *(longlong **)(param_1 + 0x6c8)) {
            lVar9 = *plVar4;
          }
          else {
            uVar3 = DAT_140608048 + 1;
            bVar10 = DAT_140608048 == 0;
            DAT_140608048 = uVar3;
            if (bVar10) {
              FUN_140176d60(1);
            }
          }
        }
        plVar4 = (longlong *)FUN_1401eceb0(lVar9,local_res8,param_3);
        if ((int)plVar4 < param_2) {
          local_res8[0] = param_2 - (int)plVar4;
          piVar6 = local_res20;
          if (local_res8[0] <= param_4) {
            piVar6 = local_res8;
          }
          bVar1 = FUN_1401a71b0(param_1,param_3,*piVar6);
          if (bVar11) {
            FUN_14034edd0(lVar8);
          }
          return (ulonglong)bVar1;
        }
      }
    }
    else {
      uVar3 = DAT_140608048 + 1;
      plVar4 = (longlong *)(ulonglong)uVar3;
      bVar10 = DAT_140608048 == 0;
      DAT_140608048 = uVar3;
      if (bVar10) {
        plVar4 = (longlong *)FUN_140176d60(1);
      }
    }
  }
  if (bVar11) {
    plVar4 = (longlong *)FUN_14034edd0(lVar8);
  }
  return (ulonglong)plVar4 & 0xffffffffffffff00;
}



undefined8 FUN_1401a71b0(longlong param_1,uint param_2,undefined4 param_3)

{
  undefined8 *puVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  longlong *plVar9;
  longlong *plVar10;
  uint *puVar11;
  uint uVar12;
  undefined2 uVar13;
  undefined4 uVar14;
  uint *puVar15;
  uint *puVar16;
  uint *puVar17;
  bool bVar18;
  bool bVar19;
  bool bVar20;
  uint local_res8 [2];
  uint local_res10 [2];
  undefined4 local_res18;
  undefined4 local_res20 [2];
  undefined8 in_stack_fffffffffffffde8;
  undefined4 uVar21;
  undefined4 *in_stack_fffffffffffffdf0;
  undefined8 in_stack_fffffffffffffdf8;
  undefined4 uVar23;
  undefined4 *puVar22;
  undefined8 in_stack_fffffffffffffe00;
  undefined4 uVar24;
  longlong *in_stack_fffffffffffffe08;
  undefined4 local_1e8;
  undefined4 uStack_1e4;
  undefined4 local_1e0;
  undefined4 uStack_1dc;
  undefined4 local_1d8;
  undefined4 local_1d4;
  undefined4 local_1d0;
  undefined4 local_1cc;
  uint *local_1c8;
  char local_1c0;
  undefined4 local_1b8;
  undefined4 uStack_1b4;
  undefined4 uStack_1b0;
  undefined4 uStack_1ac;
  undefined2 local_1a4;
  undefined2 local_1a2;
  uint local_1a0;
  undefined2 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined2 local_14c;
  undefined4 local_110;
  undefined8 local_108;
  longlong local_f8;
  longlong local_f0;
  int local_e0;
  undefined4 local_50;
  
  uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffe00 >> 0x20);
  uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffdf8 >> 0x20);
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
  local_108 = 0xfffffffffffffffe;
  puVar15 = (uint *)0x0;
  bVar20 = false;
  puVar16 = (uint *)0x0;
  local_1c8 = (uint *)0x0;
  bVar18 = false;
  local_1c0 = '\0';
  puVar1 = *(undefined8 **)(param_1 + 0xb28);
  puVar17 = puVar15;
  local_res10[0] = param_2;
  local_res18 = param_3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar17 = puVar16;
    if (puVar1 == *(undefined8 **)(param_1 + 0xb30)) {
      if ((uint *)*puVar1 != (uint *)0x0) {
        puVar17 = (uint *)*puVar1;
        if ((puVar1 != *(undefined8 **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar18 = DAT_1406080a8 == 0, puVar17 = puVar15,
           DAT_1406080a8 = iVar2, bVar18)) {
          FUN_140176d60(1);
        }
        local_1c0 = 0;
        local_1c8 = puVar17;
        FUN_14034ed40(puVar17);
        bVar18 = true;
        local_1c0 = '\x01';
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar19 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar19) {
        FUN_140176d60(1);
      }
    }
  }
  uVar3 = local_res10[0];
  plVar9 = *(longlong **)(param_1 + 0x6c0);
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar9 != 0) {
        lVar6 = FUN_140137690();
        if (*(longlong *)(lVar6 + 0x88) != 0) {
          for (puVar16 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                                   ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar6 + 0x98)) * 8);
              puVar16 != (uint *)0x0; puVar16 = *(uint **)(puVar16 + 0xa6)) {
            if ((puVar16[0xa8] == uVar3) && (*puVar16 == uVar3)) {
              if (puVar16 != (uint *)0x0) {
                uVar7 = FUN_140137690();
                uVar3 = FUN_140136b30(uVar7,local_res10[0]);
                local_res8[0] = uVar3;
                uVar7 = FUN_140137690();
                iVar2 = FUN_140136960(uVar7,local_res10[0]);
                uVar14 = 1;
                if (iVar2 != 0) {
                  uVar14 = local_res18;
                }
                puVar8 = (undefined4 *)FUN_140357570(&local_1d8);
                FUN_14000a170(&local_1b8);
                local_110 = 0;
                local_1b8 = *puVar8;
                uStack_1b4 = puVar8[1];
                uStack_1b0 = puVar8[2];
                uStack_1ac = puVar8[3];
                local_1a0 = local_res10[0];
                local_19c = (undefined2)uVar14;
                local_198 = 0;
                uVar7 = FUN_140137690();
                local_14c = FUN_140136c10(uVar7,local_res10[0]);
                local_1e8 = 0;
                uStack_1e4 = 0;
                local_1e0 = 0;
                uStack_1dc = 0;
                uVar12 = 0;
                uVar13 = (undefined2)uVar3;
                if ((uVar3 == 1) || (uVar3 == 5)) {
                  uVar7 = FUN_140137690();
                  local_194 = FUN_140136bb0(uVar7,local_1a0);
                  if (uVar3 != 5) goto LAB_1401a75c8;
                  local_res8[0] = 0xffffffff;
                  FUN_140199da0(param_1,&local_1d8,&local_1b8,local_res8);
                  uVar4 = local_res8[0];
                  local_1a2 = (undefined2)local_res8[0];
                  local_1e8 = *(undefined4 *)(param_1 + 0x160);
                  uStack_1e4 = *(undefined4 *)(param_1 + 0x164);
                  local_1e0 = *(undefined4 *)(param_1 + 0x168);
                  uStack_1dc = *(undefined4 *)(param_1 + 0x16c);
                  local_1d8 = *(undefined4 *)(param_1 + 0x170);
                  local_1d4 = *(undefined4 *)(param_1 + 0x174);
                  local_1d0 = *(undefined4 *)(param_1 + 0x178);
                  local_1cc = *(undefined4 *)(param_1 + 0x17c);
                  iVar2 = *(int *)(param_1 + 0x284);
                  local_res20[0] = *(undefined4 *)(param_1 + 8);
                  local_1a4 = uVar13;
                  if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                    if ((CONCAT44(uStack_1b4,local_1b8) != 0) ||
                       (CONCAT44(uStack_1ac,uStack_1b0) != 0)) {
                      bVar20 = true;
                    }
                    if (((bVar20) && (local_1a0 != 0)) &&
                       (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0))
                    {
                      local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                      plVar9 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8
                                 ) + 0x70);
                      in_stack_fffffffffffffe08 = (longlong *)&local_1b8;
                      uVar24 = 1;
                      puVar22 = &local_1e8;
                      in_stack_fffffffffffffdf0 = &local_1d8;
                      puVar8 = local_res20;
                      (**(code **)(*plVar9 + 0xb0))
                                (plVar9,1,&DAT_1405d85a0,local_res8,puVar8,in_stack_fffffffffffffdf0
                                 ,puVar22,&DAT_14047ba44,in_stack_fffffffffffffe08);
                      uVar21 = (undefined4)((ulonglong)puVar8 >> 0x20);
                      uVar23 = (undefined4)((ulonglong)puVar22 >> 0x20);
                    }
                  }
                  lVar6 = FUN_140174f50(param_1 + 0x6e0);
                  if (lVar6 != 0) {
                    lVar6 = FUN_140174f00(param_1 + 0x6c0);
                    uVar14 = *(undefined4 *)(lVar6 + 0x50a0);
                    lVar6 = FUN_140174f00(param_1 + 0x6c0);
                    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_1b8,0x191,
                                  CONCAT44(uVar21,0x22),
                                  (ulonglong)in_stack_fffffffffffffdf0 & 0xffffffff00000000,
                                  CONCAT44(uVar23,*(undefined4 *)(lVar6 + 0x50a0)),
                                  CONCAT44(uVar24,uVar14),
                                  (ulonglong)in_stack_fffffffffffffe08 & 0xffffffff00000000,0);
                  }
                  local_res20[0] = CONCAT22(local_res20[0]._2_2_,5);
                  plVar9 = (longlong *)&local_1b8;
LAB_1401a7b5a:
                  plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)uVar4);
                  (**(code **)(*plVar10 + 0xc0))
                            (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,
                             local_res8,plVar9);
                  plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
                  (**(code **)(*plVar9 + 0x30))
                            (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10);
                }
                else {
LAB_1401a75c8:
                  if (uVar3 != 6) {
                    uVar7 = FUN_140174f00(param_1 + 0x6c0);
                    if ((int)uVar3 < 0) {
                      uVar4 = 0xffffffff;
                    }
                    else {
                      puVar8 = &local_1e8;
                      uVar4 = FUN_1401e8dc0(uVar7,param_1,local_res8,&local_1b8,puVar8);
                      uVar21 = (undefined4)((ulonglong)puVar8 >> 0x20);
                    }
                    FUN_14000a170(&local_f8);
                    local_50 = 0;
                    lVar6 = FUN_140174f00(param_1 + 0x6c0);
                    if (((uVar3 < 5) && (-1 < (int)uVar4)) && ((int)uVar4 < 0x18)) {
                      lVar6 = ((longlong)(int)uVar4 + (longlong)(int)uVar3 * 0x18) * 0xac + lVar6;
                      *(undefined2 *)(lVar6 + 0x14) = uVar13;
                      *(short *)(lVar6 + 0x16) = (short)uVar4;
                      FUN_140090020(&local_f8);
                    }
                    bVar18 = CONCAT44(uStack_1b4,local_1b8) < CONCAT44(uStack_1e4,local_1e8);
                    if ((CONCAT44(uStack_1b4,local_1b8) != CONCAT44(uStack_1e4,local_1e8)) ||
                       (bVar18 = CONCAT44(uStack_1ac,uStack_1b0) < CONCAT44(uStack_1dc,local_1e0),
                       uVar5 = uVar12,
                       CONCAT44(uStack_1ac,uStack_1b0) != CONCAT44(uStack_1dc,local_1e0))) {
                      uVar5 = (1 - (uint)bVar18) - (uint)(bVar18 != 0);
                    }
                    lVar6 = *(longlong *)(param_1 + 0xb50);
                    local_1d8 = *(undefined4 *)(param_1 + 0x160);
                    local_1d4 = *(undefined4 *)(param_1 + 0x164);
                    local_1d0 = *(undefined4 *)(param_1 + 0x168);
                    local_1cc = *(undefined4 *)(param_1 + 0x16c);
                    local_1e8 = *(undefined4 *)(param_1 + 0x170);
                    uStack_1e4 = *(undefined4 *)(param_1 + 0x174);
                    local_1e0 = *(undefined4 *)(param_1 + 0x178);
                    uStack_1dc = *(undefined4 *)(param_1 + 0x17c);
                    if (uVar5 == 0) {
                      iVar2 = *(int *)(param_1 + 0x284);
                      local_res20[0] = *(undefined4 *)(param_1 + 8);
                      if ((-1 < iVar2) && (iVar2 < *(short *)(lVar6 + 700))) {
                        if ((local_f8 != 0) || (uVar5 = uVar12, local_f0 != 0)) {
                          uVar5 = 1;
                        }
                        if (((uVar5 != 0) && (local_e0 != 0)) && (*(longlong *)(lVar6 + 0x4c0) != 0)
                           ) {
                          local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                          plVar9 = (longlong *)
                                   (*(longlong *)
                                     (*(longlong *)(*(longlong *)(lVar6 + 0x4c0) + 8) +
                                     (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                          in_stack_fffffffffffffe08 = &local_f8;
                          uVar24 = 1;
                          puVar22 = &local_1d8;
                          in_stack_fffffffffffffdf0 = &local_1e8;
                          puVar8 = local_res20;
                          (**(code **)(*plVar9 + 0xb0))
                                    (plVar9,1,&DAT_1405d85a0,local_res8,puVar8,
                                     in_stack_fffffffffffffdf0,puVar22,&DAT_14047ba44,
                                     in_stack_fffffffffffffe08);
                          uVar21 = (undefined4)((ulonglong)puVar8 >> 0x20);
                          uVar23 = (undefined4)((ulonglong)puVar22 >> 0x20);
                        }
                      }
                    }
                    else {
                      iVar2 = *(int *)(param_1 + 0x284);
                      if (((-1 < iVar2) && (iVar2 < *(short *)(lVar6 + 700))) &&
                         (*(longlong *)(lVar6 + 0x4c0) != 0)) {
                        local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                        plVar10 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(*(longlong *)(lVar6 + 0x4c0) + 8) +
                                    (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        plVar9 = &local_f8;
                        in_stack_fffffffffffffdf0 = &local_1d8;
                        puVar8 = &local_1e8;
                        (**(code **)(*plVar10 + 0x140))
                                  (plVar10,1,&DAT_1405d85a0,local_res8,puVar8,
                                   in_stack_fffffffffffffdf0,plVar9);
                        uVar21 = (undefined4)((ulonglong)puVar8 >> 0x20);
                        uVar23 = (undefined4)((ulonglong)plVar9 >> 0x20);
                      }
                    }
                    lVar6 = FUN_140174f50(param_1 + 0x6e0);
                    if (lVar6 != 0) {
                      lVar6 = FUN_140174f00(param_1 + 0x6c0);
                      uVar14 = *(undefined4 *)(lVar6 + 0x50a0);
                      lVar6 = FUN_140174f00(param_1 + 0x6c0);
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_f8,0x193,
                                    CONCAT44(uVar21,0x50),
                                    (ulonglong)in_stack_fffffffffffffdf0 & 0xffffffff00000000,
                                    CONCAT44(uVar23,*(undefined4 *)(lVar6 + 0x50a0)),
                                    CONCAT44(uVar24,uVar14),
                                    (ulonglong)in_stack_fffffffffffffe08 & 0xffffffff00000000,0);
                    }
                    local_res20[0] = CONCAT22(local_res20[0]._2_2_,uVar13);
                    plVar9 = &local_f8;
                    goto LAB_1401a7b5a;
                  }
                  local_res8[0] = 0xffffffff;
                  plVar9 = (longlong *)FUN_140199f30(param_1,&local_1d8,&local_1b8,local_res8);
                  local_1e8 = (undefined4)*plVar9;
                  uStack_1e4 = *(undefined4 *)((longlong)plVar9 + 4);
                  local_1e0 = (undefined4)plVar9[1];
                  uStack_1dc = *(undefined4 *)((longlong)plVar9 + 0xc);
                  if ((*plVar9 != 0) || (uVar4 = uVar12, plVar9[1] != 0)) {
                    uVar4 = 1;
                  }
                  if (uVar4 != 0) {
                    uVar7 = FUN_140174f00(param_1 + 0x6c0);
                    FUN_1401ec880(uVar7,local_res8,&local_f8);
                    local_1a4 = 6;
                    uVar13 = (undefined2)local_res8[0];
                    bVar18 = CONCAT44(uStack_1b4,local_1b8) < CONCAT44(uStack_1e4,local_1e8);
                    if ((CONCAT44(uStack_1b4,local_1b8) != CONCAT44(uStack_1e4,local_1e8)) ||
                       (bVar18 = CONCAT44(uStack_1ac,uStack_1b0) < CONCAT44(uStack_1dc,local_1e0),
                       uVar4 = uVar12,
                       CONCAT44(uStack_1ac,uStack_1b0) != CONCAT44(uStack_1dc,local_1e0))) {
                      uVar4 = (1 - (uint)bVar18) - (uint)(bVar18 != 0);
                    }
                    local_1a2 = uVar13;
                    if (uVar4 == 0) {
                      local_1d8 = *(undefined4 *)(param_1 + 0x160);
                      local_1d4 = *(undefined4 *)(param_1 + 0x164);
                      local_1d0 = *(undefined4 *)(param_1 + 0x168);
                      local_1cc = *(undefined4 *)(param_1 + 0x16c);
                      local_1e8 = *(undefined4 *)(param_1 + 0x170);
                      uStack_1e4 = *(undefined4 *)(param_1 + 0x174);
                      local_1e0 = *(undefined4 *)(param_1 + 0x178);
                      uStack_1dc = *(undefined4 *)(param_1 + 0x17c);
                      iVar2 = *(int *)(param_1 + 0x284);
                      local_res20[0] = *(undefined4 *)(param_1 + 8);
                      if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))
                         ) {
                        if ((CONCAT44(uStack_1b4,local_1b8) != 0) ||
                           (uVar4 = uVar12, CONCAT44(uStack_1ac,uStack_1b0) != 0)) {
                          uVar4 = 1;
                        }
                        if (((uVar4 != 0) && (local_1a0 != 0)) &&
                           (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                           lVar6 != 0)) {
                          local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                          plVar9 = (longlong *)
                                   (*(longlong *)
                                     (*(longlong *)(lVar6 + 8) +
                                     (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                          in_stack_fffffffffffffe08 = (longlong *)&local_1b8;
                          uVar24 = 1;
                          puVar22 = &local_1d8;
                          in_stack_fffffffffffffdf0 = &local_1e8;
                          puVar8 = local_res20;
                          (**(code **)(*plVar9 + 0xb0))
                                    (plVar9,1,&DAT_1405d85a0,local_res8,puVar8,
                                     in_stack_fffffffffffffdf0,puVar22,&DAT_14047ba44,
                                     in_stack_fffffffffffffe08);
                          uVar21 = (undefined4)((ulonglong)puVar8 >> 0x20);
                          uVar23 = (undefined4)((ulonglong)puVar22 >> 0x20);
                        }
                      }
                    }
                    lVar6 = FUN_140174f50(param_1 + 0x6e0);
                    if (lVar6 != 0) {
                      lVar6 = FUN_140174f00(param_1 + 0x6c0);
                      uVar14 = *(undefined4 *)(lVar6 + 0x50a0);
                      lVar6 = FUN_140174f00(param_1 + 0x6c0);
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_1b8,0x191,
                                    CONCAT44(uVar21,0x22),
                                    (ulonglong)in_stack_fffffffffffffdf0 & 0xffffffff00000000,
                                    CONCAT44(uVar23,*(undefined4 *)(lVar6 + 0x50a0)),
                                    CONCAT44(uVar24,uVar14),
                                    (ulonglong)in_stack_fffffffffffffe08 & 0xffffffff00000000,0);
                    }
                    local_res8[0] = CONCAT22(local_res8[0]._2_2_,uVar13);
                    local_res20[0] = CONCAT22(local_res20[0]._2_2_,6);
                    plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    (**(code **)(*plVar9 + 0xc0))
                              (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,
                               local_res8,&local_1b8);
                  }
                }
                uVar4 = local_res10[0];
                lVar6 = FUN_140137690();
                uVar5 = local_res10[0];
                if (*(longlong *)(lVar6 + 0x88) == 0) goto LAB_1401a7c2c;
                puVar16 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                                    ((ulonglong)uVar4 % (ulonglong)*(uint *)(lVar6 + 0x98)) * 8);
                goto LAB_1401a7be5;
              }
              break;
            }
          }
        }
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar20 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar18) {
    FUN_14034edd0(puVar17);
  }
  return 0;
LAB_1401a7be5:
  if (puVar16 == (uint *)0x0) goto LAB_1401a7c2c;
  if ((puVar16[0xa8] == uVar4) && (*puVar16 == uVar4)) {
    if (puVar16 != (uint *)0x0) {
      if (puVar16 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar12 = puVar16[0x18];
    }
    goto LAB_1401a7c2c;
  }
  puVar16 = *(uint **)(puVar16 + 0xa6);
  goto LAB_1401a7be5;
LAB_1401a7c2c:
  lVar6 = FUN_1402e0270();
  if ((int)uVar5 < 1) {
LAB_1401a7c7a:
    lVar6 = FUN_1402e0270();
    if ((int)uVar12 < 1) goto LAB_1401a7cec;
    puVar16 = puVar15;
    if (*(longlong *)(lVar6 + 0x1f8) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar6 + 0x1f8) +
                               ((ulonglong)uVar12 % (ulonglong)*(uint *)(lVar6 + 0x208)) * 8);
          (puVar16 = puVar15, puVar11 != (uint *)0x0 &&
          ((puVar11[4] != uVar12 || (puVar16 = puVar11, *puVar11 != uVar12))));
          puVar11 = *(uint **)(puVar11 + 2)) {
      }
    }
    if (puVar16 == (uint *)0x0) goto LAB_1401a7cec;
  }
  else {
    puVar16 = puVar15;
    if (*(longlong *)(lVar6 + 0x1b0) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar6 + 0x1b0) +
                               ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar6 + 0x1c0)) * 8);
          (puVar16 = puVar15, puVar11 != (uint *)0x0 &&
          ((puVar11[4] != uVar5 || (puVar16 = puVar11, *puVar11 != uVar5))));
          puVar11 = *(uint **)(puVar11 + 2)) {
      }
    }
    if (puVar16 == (uint *)0x0) goto LAB_1401a7c7a;
  }
  if ((((uVar3 == 1) || (uVar3 == 2)) || (uVar3 == 3)) || ((uVar3 == 4 || (uVar3 == 5)))) {
    FUN_1401a8bb0(param_1,local_res10[0]);
  }
LAB_1401a7cec:
  if (local_1c0 != '\0') {
    FUN_14034edd0(puVar17);
  }
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401a84bd)
// WARNING: Removing unreachable block (ram,0x0001401a8436)

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

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong lVar9;
  size_t sVar10;
  ulonglong *puVar11;
  uint *puVar12;
  wchar_t *pwVar13;
  uint uVar14;
  longlong lVar15;
  ulonglong uVar16;
  uint uVar17;
  uint uVar18;
  uint uVar19;
  bool bVar20;
  bool bVar21;
  uint local_res8 [2];
  int *local_res10;
  int *local_res18;
  int *piVar22;
  undefined8 in_stack_fffffffffffffdb8;
  undefined4 uVar23;
  undefined4 uVar24;
  undefined8 in_stack_fffffffffffffdc0;
  undefined4 uVar25;
  undefined4 uVar26;
  undefined8 in_stack_fffffffffffffdc8;
  undefined4 uVar27;
  int local_228;
  float local_224;
  int local_220;
  undefined4 local_21c;
  int local_218 [2];
  longlong local_210;
  undefined1 local_208;
  longlong local_1f8;
  undefined4 local_1f0;
  undefined4 uStack_1ec;
  undefined4 local_1e8;
  undefined4 local_1e4;
  uint local_1e0;
  undefined4 local_1dc;
  undefined4 local_1d8;
  undefined4 local_1d4;
  wchar_t local_1d0 [48];
  undefined4 local_170;
  undefined4 local_16c;
  int local_168;
  undefined4 local_164;
  char local_160 [16];
  undefined4 local_150;
  undefined8 local_f8;
  longlong local_e8;
  longlong local_e0;
  int local_d0;
  short local_cc;
  short local_c0;
  short local_74;
  undefined4 local_40;
  
  local_f8 = 0xfffffffffffffffe;
  lVar15 = 0;
  local_210 = 0;
  bVar21 = false;
  local_208 = 0;
  plVar8 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  local_res18 = param_3;
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == *(longlong **)(param_1 + 0xb30)) {
      lVar7 = *plVar8;
      lVar15 = 0;
      if (lVar7 != 0) {
        if (plVar8 != *(longlong **)(param_1 + 0xb30)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar21 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar21) {
            FUN_140176d60(1);
          }
          lVar7 = 0;
        }
        local_208 = 0;
        local_210 = lVar7;
        FUN_14034ed40(lVar7);
        bVar21 = true;
        local_208 = 1;
        lVar15 = lVar7;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar20 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  plVar8 = *(longlong **)(param_1 + 0x6c0);
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == *(longlong **)(param_1 + 0x6c8)) {
      if ((*plVar8 != 0) && (plVar8 = *(longlong **)(param_1 + 0x9c0), plVar8 != (longlong *)0x0)) {
        if (plVar8 == *(longlong **)(param_1 + 0x9c8)) {
          if ((*plVar8 != 0) &&
             (plVar8 = *(longlong **)(param_1 + 0x6e0), plVar8 != (longlong *)0x0)) {
            if (plVar8 == *(longlong **)(param_1 + 0x6e8)) {
              if (*plVar8 != 0) {
                FUN_14000a170(&local_e8);
                local_40 = 0;
                uVar6 = FUN_140174f00(param_1 + 0x6c0);
                if ((*param_2 < 0) ||
                   (iVar4 = FUN_1401ecce0(uVar6,param_2,param_3,&local_e8), iVar3 = local_d0,
                   iVar4 == 0)) {
                  *param_8 = 0x19;
                }
                else {
                  if ((local_e8 == 0) && (local_e0 == 0)) {
                    bVar20 = false;
                  }
                  else {
                    bVar20 = true;
                  }
                  if ((((bVar20) || (local_d0 != 0)) || (0 < local_cc)) && (local_74 == 0)) {
                    uVar6 = FUN_140137690();
                    lVar7 = FUN_140136770(uVar6,iVar3);
                    if (lVar7 != 0) {
                      local_21c = *(undefined4 *)(lVar7 + 0xd0);
                      iVar3 = *(int *)(lVar7 + 0xcc);
                      local_res8[0] = *(uint *)(lVar7 + 0xc4);
                      iVar4 = (int)local_c0;
                      uVar17 = iVar4 + 1;
                      if ((int)uVar17 < 0x15) {
                        uVar6 = FUN_140137690();
                        local_220 = FUN_1401373a0(uVar6,local_d0,iVar4);
                        if (local_220 < 0) {
                          *param_8 = 0x23;
                        }
                        else {
                          iVar5 = FUN_140199700(param_1);
                          if (iVar5 == 0) {
                            *param_8 = 0x23;
                          }
                          else {
                            plVar8 = (longlong *)FUN_14012f630();
                            uVar16 = (longlong)(int)local_res8[0] + ((longlong)iVar3 << 0x20);
                            if (*plVar8 != 0) {
                              for (puVar11 = *(ulonglong **)
                                              (*plVar8 +
                                              ((uVar16 & 0xffffffff) %
                                              (ulonglong)*(uint *)(plVar8 + 2)) * 8);
                                  puVar11 != (ulonglong *)0x0; puVar11 = (ulonglong *)puVar11[4]) {
                                if (((int)puVar11[5] == (int)uVar16) && (*puVar11 == uVar16)) {
                                  if (puVar11 != (ulonglong *)0x0) {
                                    if (puVar11 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
                                      FUN_14000d450(0x80004005);
                                    }
                                    if (puVar11 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
                                      FUN_14000d450(0x80004005);
                                    }
                                    if (puVar11 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
                                      FUN_14000d450(0x80004005);
                                    }
                                    if (puVar11 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
                                      FUN_14000d450(0x80004005);
                                    }
                                    local_228 = iVar4 * *(int *)((longlong)puVar11 + 0x14) +
                                                (int)puVar11[2];
                                    uVar6 = FUN_140174f00(param_1 + 0x6c0);
                                    iVar3 = FUN_1401eceb0(uVar6,&DAT_14047ba34,0xc367);
                                    if (iVar3 < local_228) {
                                      *param_8 = 0x33;
                                      goto LAB_1401a89cf;
                                    }
                                    local_224 = 1.0;
                                    if ((*param_4 == 0) && (param_4[1] == 0)) {
                                      bVar20 = false;
                                    }
                                    else {
                                      bVar20 = true;
                                    }
                                    if (bVar20) {
                                      FUN_14000a170(&local_1f8);
                                      local_150 = 0;
                                      lVar7 = FUN_140174f00(param_1 + 0x6c0);
                                      iVar3 = *param_5;
                                      if ((-1 < iVar3) && (iVar3 < 0x18)) {
                                        *(undefined2 *)((longlong)iVar3 * 0xac + 0x2054 + lVar7) = 2
                                        ;
                                        *(short *)((longlong)*param_5 * 0xac + 0x2056 + lVar7) =
                                             (short)*param_5;
                                        FUN_140090020(&local_1f8,
                                                      ((longlong)*param_5 + 0x30) * 0xac + lVar7);
                                      }
                                      uVar14 = local_1e0;
                                      if ((local_1f8 == 0) && (CONCAT44(uStack_1ec,local_1f0) == 0))
                                      {
                                        bVar20 = false;
                                      }
                                      else {
                                        bVar20 = true;
                                      }
                                      if (((bVar20) || (local_1e0 != 0)) || (0 < (short)local_1dc))
                                      {
                                        uVar6 = FUN_140137690();
                                        iVar3 = FUN_1401369d0(uVar6,uVar14);
                                        uVar6 = FUN_140137690();
                                        iVar4 = FUN_140137640(uVar6,local_1e0);
                                        uVar23 = (undefined4)
                                                 ((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
                                        uVar25 = (undefined4)
                                                 ((ulonglong)in_stack_fffffffffffffdc0 >> 0x20);
                                        if (iVar3 == 0x13) {
                                          local_res8[0] = 1;
                                          local_224 = (float)iVar4;
                                          uVar6 = FUN_140174f00(param_1 + 0x6c0);
                                          in_stack_fffffffffffffdc0 = CONCAT44(uVar25,0xf);
                                          in_stack_fffffffffffffdb8 = CONCAT44(uVar23,0x1a0);
                                          FUN_1401f1280(uVar6,param_1,&DAT_14047ba30,param_5,
                                                        &local_1e0,local_res8,
                                                        in_stack_fffffffffffffdb8,
                                                        in_stack_fffffffffffffdc0);
                                        }
                                      }
                                    }
                                    lVar7 = param_1 + 0x6c0;
                                    local_res8[0] = 0;
                                    if ((*param_6 == 0) && (param_6[1] == 0)) {
                                      bVar20 = false;
                                    }
                                    else {
                                      bVar20 = true;
                                    }
                                    if (!bVar20) goto LAB_1401a8559;
                                    FUN_14000a170(&local_1f8);
                                    local_150 = 0;
                                    lVar9 = FUN_140174f00(lVar7);
                                    iVar3 = *param_7;
                                    if ((-1 < iVar3) && (iVar3 < 0x18)) {
                                      *(undefined2 *)((longlong)iVar3 * 0xac + 0x2054 + lVar9) = 2;
                                      *(short *)((longlong)*param_7 * 0xac + 0x2056 + lVar9) =
                                           (short)*param_7;
                                      FUN_140090020(&local_1f8,
                                                    ((longlong)*param_7 + 0x30) * 0xac + lVar9);
                                    }
                                    uVar14 = local_1e0;
                                    if ((local_1f8 == 0) && (CONCAT44(uStack_1ec,local_1f0) == 0)) {
                                      bVar20 = false;
                                    }
                                    else {
                                      bVar20 = true;
                                    }
                                    if (((!bVar20) && (local_1e0 == 0)) && ((short)local_1dc < 1))
                                    goto LAB_1401a8559;
                                    uVar6 = FUN_140137690();
                                    iVar3 = FUN_1401369d0(uVar6,uVar14);
                                    uVar23 = (undefined4)
                                             ((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
                                    uVar25 = (undefined4)
                                             ((ulonglong)in_stack_fffffffffffffdc0 >> 0x20);
                                    local_res8[0] = 1;
                                    if (((iVar3 != 0x34) && (iVar3 != 0x14)) && (iVar3 != 0x1b))
                                    goto LAB_1401a8550;
                                    uVar18 = 0;
                                    uVar19 = 0;
                                    uVar14 = 0;
                                    uVar2 = local_res8[0];
                                    if (iVar3 != 0x34) goto LAB_1401a84fd;
                                    uVar6 = FUN_140137690();
                                    lVar9 = FUN_140136770(uVar6);
                                    if (lVar9 == 0) goto LAB_1401a89cf;
                                    if (*(int *)(lVar9 + 0xd0) == 1) {
                                      lVar9 = FUN_140130e80();
                                      uVar19 = uVar18;
                                      if (*(longlong *)(lVar9 + 0x28) == 0) goto LAB_1401a84ce;
                                      puVar12 = *(uint **)(*(longlong *)(lVar9 + 0x28) +
                                                          ((ulonglong)uVar17 %
                                                          (ulonglong)*(uint *)(lVar9 + 0x38)) * 8);
                                      goto LAB_1401a83e8;
                                    }
                                    if (*(int *)(lVar9 + 0xd0) != 2) goto LAB_1401a89cf;
                                    lVar9 = FUN_140130e80();
                                    if (*(longlong *)(lVar9 + 0x28) == 0) goto LAB_1401a84ce;
                                    puVar12 = *(uint **)(*(longlong *)(lVar9 + 0x28) +
                                                        ((ulonglong)uVar17 %
                                                        (ulonglong)*(uint *)(lVar9 + 0x38)) * 8);
                                    goto LAB_1401a8473;
                                  }
                                  break;
                                }
                              }
                            }
                            *param_8 = 0x33;
                          }
                        }
                      }
                      else {
                        *param_8 = 0x32;
                      }
                    }
                  }
                }
              }
            }
            else {
              iVar3 = DAT_14060804c + 1;
              bVar20 = DAT_14060804c == 0;
              DAT_14060804c = iVar3;
              if (bVar20) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else {
          iVar3 = DAT_1406080d0 + 1;
          bVar20 = DAT_1406080d0 == 0;
          DAT_1406080d0 = iVar3;
          if (bVar20) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar20 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401a89cf:
  if (bVar21) {
    FUN_14034edd0(lVar15);
  }
  return 0;
LAB_1401a83e8:
  if (puVar12 == (uint *)0x0) goto LAB_1401a84ce;
  if ((puVar12[0x3a] == uVar17) && (*puVar12 == uVar17)) {
    if (puVar12 != (uint *)0x0) {
      if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar14 = puVar12[0x35];
      uVar19 = puVar12[0x34];
    }
    goto LAB_1401a84ce;
  }
  puVar12 = *(uint **)(puVar12 + 0x38);
  goto LAB_1401a83e8;
LAB_1401a8473:
  if (puVar12 == (uint *)0x0) goto LAB_1401a84ce;
  if ((puVar12[0x3a] == uVar17) && (*puVar12 == uVar17)) {
    if (puVar12 != (uint *)0x0) {
      if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar14 = puVar12[0x37];
      uVar19 = puVar12[0x36];
    }
    goto LAB_1401a84ce;
  }
  puVar12 = *(uint **)(puVar12 + 0x38);
  goto LAB_1401a8473;
LAB_1401a84ce:
  uVar2 = uVar19;
  if ((param_9 == 1) || (uVar2 = uVar14, param_9 == 2)) {
LAB_1401a84fd:
    local_res8[0] = uVar2;
    if ((int)local_res8[0] <= (int)(short)local_1dc) {
      uVar6 = FUN_140174f00(lVar7);
      in_stack_fffffffffffffdc0 = CONCAT44(uVar25,0xf);
      in_stack_fffffffffffffdb8 = CONCAT44(uVar23,0x1a0);
      FUN_1401f1280(uVar6,param_1,&DAT_14047ba30,param_7,&local_1e0,local_res8,
                    in_stack_fffffffffffffdb8,in_stack_fffffffffffffdc0);
LAB_1401a8550:
      local_res8[0] = local_1e0;
LAB_1401a8559:
      uVar6 = FUN_140174f00(lVar7);
      local_218[0] = local_228;
      local_228 = 0;
      do {
        iVar3 = local_228;
        in_stack_fffffffffffffdc0 =
             CONCAT44((int)((ulonglong)in_stack_fffffffffffffdc0 >> 0x20),0xf);
        in_stack_fffffffffffffdb8 =
             CONCAT44((int)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20),0x1a0);
        piVar22 = local_218;
        uVar23 = 1;
        iVar5 = FUN_1401f1280(uVar6,param_1,&DAT_14047ba34,&local_228,&DAT_14047ba10,piVar22,
                              in_stack_fffffffffffffdb8,in_stack_fffffffffffffdc0);
        iVar4 = local_220;
        uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
        uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffdc0 >> 0x20);
        uVar25 = (undefined4)((ulonglong)piVar22 >> 0x20);
        uVar27 = (undefined4)((ulonglong)in_stack_fffffffffffffdc8 >> 0x20);
        if (iVar5 != 0) break;
        local_228 = iVar3 + 1;
      } while (local_228 < 0x18);
      if (0 < local_220) {
        FUN_14011f210(&local_1f8);
        local_1f0 = *(undefined4 *)(param_1 + 0x160);
        uStack_1ec = *(undefined4 *)(param_1 + 0x164);
        local_1e8 = *(undefined4 *)(param_1 + 0x168);
        local_1e4 = *(undefined4 *)(param_1 + 0x16c);
        local_1e0 = *(uint *)(param_1 + 0x170);
        local_1dc = *(undefined4 *)(param_1 + 0x174);
        local_1d8 = *(undefined4 *)(param_1 + 0x178);
        local_1d4 = *(undefined4 *)(param_1 + 0x17c);
        lVar7 = FUN_140174f50(param_1 + 0x6e0);
        pwVar13 = (wchar_t *)(lVar7 + 0xd0);
        if (7 < *(ulonglong *)(lVar7 + 0xe8)) {
          pwVar13 = *(wchar_t **)pwVar13;
        }
        sVar10 = wcsnlen(pwVar13,0x10);
        if (sVar10 < 0x10) {
          lVar7 = FUN_140174f50(param_1 + 0x6e0);
          pwVar13 = (wchar_t *)(lVar7 + 0xd0);
          if (7 < *(ulonglong *)(lVar7 + 0xe8)) {
            pwVar13 = *(wchar_t **)pwVar13;
          }
          wcscpy_s(local_1d0,0x10,pwVar13);
        }
        strcpy_s(local_160,0x32,(char *)(param_1 + 0x330));
        local_170 = 5;
        lVar7 = FUN_140174f00(param_1 + 0x6c0);
        local_16c = *(undefined4 *)(lVar7 + 0x50a0);
        local_168 = iVar4;
        FUN_140197b90(param_1,-iVar4);
        lVar7 = FUN_140174f00(param_1 + 0x6c0);
        local_164 = *(undefined4 *)(lVar7 + 0x50a0);
        FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                      *(undefined4 *)(param_1 + 0x284),&local_1f8);
        lVar7 = FUN_140174f00(param_1 + 0x6c0);
        uVar25 = *(undefined4 *)(lVar7 + 0x50a0);
        lVar7 = FUN_140174f00();
        uVar16 = (ulonglong)piVar22 & 0xffffffff00000000;
        uVar6 = CONCAT44(uVar23,0x3c);
        FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x196,uVar6,uVar16,
                      CONCAT44(uVar24,*(int *)(lVar7 + 0x50a0) + local_220),CONCAT44(uVar26,uVar25),
                      CONCAT44(uVar27,local_220),0);
        uVar23 = (undefined4)((ulonglong)uVar6 >> 0x20);
        uVar25 = (undefined4)(uVar16 >> 0x20);
      }
      piVar22 = local_res10;
      if (*local_res10 == 1) {
        uVar6 = FUN_140174f00(param_1 + 0x6c0);
        piVar22 = local_res18;
        iVar3 = FUN_1401f1af0(uVar6,param_1,&DAT_14047ba2c,local_res18,CONCAT44(uVar23,local_21c),
                              CONCAT44(uVar25,uVar17),&local_224,local_res8,param_8,param_9);
        if (iVar3 != 0) {
          FUN_14000a170(&local_1f8);
          local_150 = 0;
          lVar7 = FUN_140174f00(param_1 + 0x6c0);
          iVar3 = *piVar22;
          if ((-1 < iVar3) && (iVar3 < 0x18)) {
            *(undefined2 *)((longlong)iVar3 * 0xac + 0x1034 + lVar7) = 1;
            *(short *)((longlong)*piVar22 * 0xac + 0x1036 + lVar7) = (short)*piVar22;
            FUN_140090020(&local_1f8,((longlong)*piVar22 + 0x18) * 0xac + lVar7);
            if ((9 < (int)uVar17) && (lVar7 = FUN_140174f50(param_1 + 0x6e0), lVar7 != 0)) {
              lVar7 = FUN_140174f50(param_1 + 0x6e0);
              plVar8 = (longlong *)(lVar7 + 0xd0);
              if (7 < *(ulonglong *)(lVar7 + 0xe8)) {
                plVar8 = (longlong *)*plVar8;
              }
              if (*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4e0) != 0) {
                FUN_14026e890(*(longlong *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 8),plVar8,
                              &local_1f8);
              }
            }
            uVar6 = FUN_1401de9e0(param_1 + 0x9c0);
            FUN_140258150(uVar6,param_1,local_1e0,(int)local_1d0[0]);
          }
LAB_1401a8999:
          if (bVar21) {
            FUN_14034edd0(lVar15);
          }
          return 1;
        }
      }
      else {
        uVar6 = FUN_140174f00(param_1 + 0x6c0);
        piVar1 = local_res18;
        if ((-1 < *piVar22) &&
           (iVar3 = FUN_1401f1af0(uVar6,param_1,piVar22,local_res18,CONCAT44(uVar23,local_21c),
                                  CONCAT44(uVar25,uVar17),&local_224,local_res8,param_8,param_9),
           iVar3 != 0)) {
          FUN_14000a170(&local_1f8);
          uVar6 = FUN_140174f00(param_1 + 0x6c0);
          if ((-1 < *piVar22) &&
             (iVar3 = FUN_1401ecce0(uVar6,piVar22,piVar1,&local_1f8), iVar3 != 0)) {
            uVar6 = FUN_1401de9e0(param_1 + 0x9c0);
            FUN_140258150(uVar6,param_1,local_1e0,(int)local_1d0[0]);
          }
          goto LAB_1401a8999;
        }
      }
    }
  }
  goto LAB_1401a89cf;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      if ((*plVar1 != 0) && (plVar1 = *(longlong **)(param_1 + 0x6e0), plVar1 != (longlong *)0x0)) {
        if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
          lVar4 = *plVar1;
          if (lVar4 != 0) {
            if ((plVar1 != *(longlong **)(param_1 + 0x6e8)) &&
               (iVar2 = DAT_14060804c + 1, bVar7 = DAT_14060804c == 0, lVar4 = lVar6,
               DAT_14060804c = iVar2, bVar7)) {
              FUN_140176d60(1);
            }
            iVar2 = *(int *)(lVar4 + 0xfc0);
            if (0 < iVar2) {
              uVar3 = FUN_1401de9e0(param_1 + 0x9c0);
              FUN_140258220(uVar3,param_1,iVar2,param_4,uVar9,lVar10);
            }
          }
        }
        else {
          iVar2 = DAT_14060804c + 1;
          bVar7 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar7) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar7 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return;
}



longlong * FUN_1401a8bb0(longlong param_1,uint param_2)

{
  undefined8 *puVar1;
  int iVar2;
  uint uVar3;
  undefined4 uVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  longlong *plVar8;
  undefined8 uVar9;
  longlong lVar10;
  uint *puVar11;
  ulonglong uVar12;
  longlong lVar13;
  bool bVar14;
  bool bVar15;
  int local_res8 [2];
  
  uVar12 = (ulonglong)param_2;
  lVar13 = 0;
  bVar15 = false;
  plVar8 = *(longlong **)(param_1 + 0xb28);
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == *(longlong **)(param_1 + 0xb30)) {
      lVar10 = *plVar8;
      lVar13 = 0;
      if (lVar10 != 0) {
        if (plVar8 != *(longlong **)(param_1 + 0xb30)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar15 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar15) {
            FUN_140176d60(1);
          }
          lVar10 = 0;
        }
        FUN_14034ed40(lVar10);
        bVar15 = true;
        lVar13 = lVar10;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar14 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  plVar8 = *(longlong **)(param_1 + 0x6c0);
  if (plVar8 == (longlong *)0x0) goto LAB_1401a8f16;
  if (plVar8 != *(longlong **)(param_1 + 0x6c8)) {
    uVar3 = DAT_140608048 + 1;
    plVar8 = (longlong *)(ulonglong)uVar3;
    bVar14 = DAT_140608048 == 0;
    DAT_140608048 = uVar3;
    if (bVar14) {
      plVar8 = (longlong *)FUN_140176d60(1);
    }
    goto LAB_1401a8f16;
  }
  if (*plVar8 == 0) goto LAB_1401a8f16;
  uVar9 = FUN_140137690();
  local_res8[0] = FUN_140136b30(uVar9,uVar12);
  puVar1 = *(undefined8 **)(param_1 + 0x6c0);
  if (local_res8[0] != 5) {
    if (puVar1 == (undefined8 *)0x0) {
LAB_1401a8e11:
      uVar9 = 0;
    }
    else {
      if (puVar1 != *(undefined8 **)(param_1 + 0x6c8)) {
        uVar3 = DAT_140608048 + 1;
        bVar14 = DAT_140608048 == 0;
        DAT_140608048 = uVar3;
        if (bVar14) {
          FUN_140176d60(1);
        }
        goto LAB_1401a8e11;
      }
      uVar9 = *puVar1;
    }
    uVar4 = FUN_1401eceb0(uVar9,local_res8,param_2);
    FUN_1401a90a0(param_1,uVar12,uVar4);
    lVar10 = FUN_140137690();
    plVar8 = (longlong *)(uVar12 / *(uint *)(lVar10 + 0x98));
    if (*(longlong *)(lVar10 + 0x88) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar10 + 0x88) +
                               (uVar12 % (ulonglong)*(uint *)(lVar10 + 0x98)) * 8);
          puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
        if ((puVar11[0xa8] == param_2) && (*puVar11 == param_2)) {
          if (puVar11 != (uint *)0x0) {
            plVar8 = (longlong *)(ulonglong)(puVar11 != (uint *)0x0);
            if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar3 = puVar11[0x18];
            if (0 < (int)uVar3) {
              iVar2 = 0;
              iVar6 = 1;
              lVar10 = 4;
              goto LAB_1401a8eb0;
            }
          }
          break;
        }
      }
    }
    goto LAB_1401a8f16;
  }
  if (puVar1 == (undefined8 *)0x0) {
LAB_1401a8cfc:
    uVar9 = 0;
  }
  else {
    if (puVar1 != *(undefined8 **)(param_1 + 0x6c8)) {
      uVar3 = DAT_140608048 + 1;
      bVar14 = DAT_140608048 == 0;
      DAT_140608048 = uVar3;
      if (bVar14) {
        FUN_140176d60(1);
      }
      goto LAB_1401a8cfc;
    }
    uVar9 = *puVar1;
  }
  uVar4 = FUN_1401ecb10(uVar9,uVar12);
  FUN_1401a90a0(param_1,param_2,uVar4);
  lVar10 = FUN_140137690();
  plVar8 = (longlong *)((ulonglong)param_2 / (ulonglong)*(uint *)(lVar10 + 0x98));
  if (*(longlong *)(lVar10 + 0x88) != 0) {
    for (puVar11 = *(uint **)(*(longlong *)(lVar10 + 0x88) +
                             ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar10 + 0x98)) * 8);
        puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
      if ((puVar11[0xa8] == param_2) && (*puVar11 == param_2)) {
        if (puVar11 != (uint *)0x0) {
          plVar8 = (longlong *)(ulonglong)(puVar11 != (uint *)0x0);
          if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar3 = puVar11[0x18];
          if (0 < (int)uVar3) {
            iVar2 = 0;
            lVar10 = 3;
            goto LAB_1401a8d90;
          }
        }
        break;
      }
    }
  }
  goto LAB_1401a8f16;
  while( true ) {
    if (iVar6 < 0) {
      iVar7 = 0;
    }
    else {
      iVar7 = FUN_1401ecd70(uVar9,local_res8,uVar3);
    }
    iVar2 = iVar2 + iVar7;
    iVar6 = iVar6 + 1;
    lVar10 = lVar10 + -1;
    if (lVar10 == 0) break;
LAB_1401a8eb0:
    uVar5 = DAT_140608048;
    puVar1 = *(undefined8 **)(param_1 + 0x6c0);
    local_res8[0] = iVar6;
    if (puVar1 == (undefined8 *)0x0) {
LAB_1401a8ee7:
      uVar9 = 0;
    }
    else {
      if (puVar1 != *(undefined8 **)(param_1 + 0x6c8)) {
        DAT_140608048 = DAT_140608048 + 1;
        if (uVar5 == 0) {
          FUN_140176d60(1);
        }
        goto LAB_1401a8ee7;
      }
      uVar9 = *puVar1;
    }
  }
  goto LAB_1401a8f0d;
LAB_1401a8d90:
  do {
    puVar1 = *(undefined8 **)(param_1 + 0x6c0);
    if (puVar1 == (undefined8 *)0x0) {
LAB_1401a8dc7:
      uVar9 = 0;
    }
    else {
      if (puVar1 != *(undefined8 **)(param_1 + 0x6c8)) {
        uVar5 = DAT_140608048 + 1;
        bVar14 = DAT_140608048 == 0;
        DAT_140608048 = uVar5;
        if (bVar14) {
          FUN_140176d60(1);
        }
        goto LAB_1401a8dc7;
      }
      uVar9 = *puVar1;
    }
    iVar6 = FUN_1401ec940(uVar9,uVar3);
    iVar2 = iVar2 + iVar6;
    lVar10 = lVar10 + -1;
  } while (lVar10 != 0);
LAB_1401a8f0d:
  plVar8 = (longlong *)FUN_1401a8f40(param_1,uVar3,iVar2);
LAB_1401a8f16:
  if (bVar15) {
    plVar8 = (longlong *)FUN_14034edd0(lVar13);
  }
  return plVar8;
}



void FUN_1401a8f40(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
           (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
           DAT_1406080d0 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_1402582f0(lVar3,param_1,param_2,param_3,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar6 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



void FUN_1401a90a0(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
           (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
           DAT_1406080d0 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_1402583a0(lVar3,param_1,param_2,param_3,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar6 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



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

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9a0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9a8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9a8)) &&
           (iVar2 = DAT_1406080c8 + 1, bVar6 = DAT_1406080c8 == 0, lVar3 = lVar5,
           DAT_1406080c8 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_14025dee0(lVar3,param_1,param_3,param_4,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080c8 + 1;
      bVar6 = DAT_1406080c8 == 0;
      DAT_1406080c8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



void FUN_1401a9350(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  bool bVar5;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      plVar4 = (longlong *)*plVar1;
      if (plVar4 != (longlong *)0x0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar5 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar5) {
            FUN_140176d60();
          }
          plVar4 = (longlong *)0x0;
        }
        lVar3 = (**(code **)(*plVar4 + 0x270))();
        *(undefined4 *)(lVar3 + 0x78) = 1000;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  local_18 = *(undefined4 *)(param_1 + 0x170);
  local_14 = *(undefined4 *)(param_1 + 0x174);
  local_10 = *(undefined4 *)(param_1 + 0x178);
  local_c = *(undefined4 *)(param_1 + 0x17c);
  FUN_1401fc6e0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                *(undefined4 *)(param_1 + 0x284),&local_18,1000,0);
  return;
}



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

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  longlong *plVar8;
  longlong lVar9;
  undefined *puVar10;
  longlong lVar11;
  longlong lVar12;
  bool bVar13;
  bool bVar14;
  undefined *local_res8;
  undefined8 in_stack_ffffffffffffff78;
  undefined8 *puVar15;
  undefined4 uVar16;
  undefined8 local_50;
  undefined4 local_48;
  undefined4 local_44;
  
  uVar16 = (undefined4)((ulonglong)in_stack_ffffffffffffff78 >> 0x20);
  lVar9 = 0;
  lVar11 = 0;
  bVar14 = false;
  plVar8 = *(longlong **)(param_1 + 0xb28);
  lVar12 = lVar9;
  if (plVar8 != (longlong *)0x0) {
    lVar12 = lVar11;
    if (plVar8 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar8 != 0) {
        lVar12 = *plVar8;
        if ((plVar8 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar14 = DAT_1406080a8 == 0, lVar12 = lVar9,
           DAT_1406080a8 = iVar4, bVar14)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar12);
        bVar14 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar13 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  plVar8 = *(longlong **)(param_1 + 0xa20);
  if (plVar8 == (longlong *)0x0) goto LAB_1401a982d;
  if (plVar8 == *(longlong **)(param_1 + 0xa28)) {
    if ((*plVar8 == 0) || (plVar3 = *(longlong **)(param_1 + 0xa10), plVar3 == (longlong *)0x0))
    goto LAB_1401a982d;
    if (plVar3 == *(longlong **)(param_1 + 0xa18)) {
      if (*plVar3 != 0) {
        lVar11 = *plVar8;
        if ((plVar8 != *(longlong **)(param_1 + 0xa28)) &&
           (iVar4 = DAT_1406080e4 + 1, bVar13 = DAT_1406080e4 == 0, lVar11 = lVar9,
           DAT_1406080e4 = iVar4, bVar13)) {
          FUN_140176d60(1);
        }
        iVar4 = FUN_14026f660(lVar11,param_2);
        if (iVar4 != 0) {
          local_res8 = (undefined *)CONCAT44(local_res8._4_4_,1);
          plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x420);
          (**(code **)(*plVar8 + 0x80))
                    (plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_res8,param_2);
          local_50 = *(undefined8 *)(param_1 + 0x170);
          local_48 = *(undefined4 *)(param_1 + 0x178);
          local_44 = *(undefined4 *)(param_1 + 0x17c);
          puVar15 = &local_50;
          FUN_1401fde00(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                        *(undefined4 *)(param_1 + 0x284),*(undefined4 *)(param_1 + 8),puVar15,
                        param_2);
          uVar16 = (undefined4)((ulonglong)puVar15 >> 0x20);
        }
        plVar8 = *(longlong **)(param_1 + 0xa10);
        if (plVar8 != (longlong *)0x0) {
          if (plVar8 == *(longlong **)(param_1 + 0xa18)) {
            lVar9 = *plVar8;
          }
          else {
            iVar4 = DAT_1406080e0 + 1;
            bVar13 = DAT_1406080e0 == 0;
            DAT_1406080e0 = iVar4;
            if (bVar13) {
              FUN_140176d60(1);
            }
          }
        }
        iVar4 = FUN_14026ee30(lVar9,param_2,param_3,*param_4,CONCAT44(uVar16,*param_5));
        if (iVar4 == 0) goto LAB_1401a982d;
        FUN_14034fe70();
        local_res8 = PTR_DAT_1405d8010;
        iVar4 = FUN_14034fcf0(param_3);
        if (local_res8 == (undefined *)0x0) {
          iVar6 = 0;
        }
        else if (local_res8 == PTR_DAT_1405d8010) {
          iVar6 = 0;
        }
        else {
          iVar6 = *(int *)(local_res8 + -8);
        }
        iVar5 = iVar4;
        if (iVar4 <= iVar6) {
          if (local_res8 == (undefined *)0x0) {
            iVar5 = 0;
          }
          else if (local_res8 == PTR_DAT_1405d8010) {
            iVar5 = 0;
          }
          else {
            iVar5 = *(int *)(local_res8 + -8);
          }
        }
        iVar6 = 1;
        if (1 < iVar5) {
          iVar6 = iVar5;
        }
        if (local_res8 == (undefined *)0x0) {
          iVar5 = 0;
        }
        else if (local_res8 == PTR_DAT_1405d8010) {
          iVar5 = 0;
        }
        else {
          iVar5 = *(int *)(local_res8 + -8);
        }
        if (iVar5 < iVar6) {
          FUN_140002d30(&local_res8);
        }
        FUN_140002e10(&local_res8);
        puVar10 = local_res8;
        if (local_res8 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        FUN_14034fd20(puVar10,param_3,iVar4);
        puVar10 = local_res8;
        if (local_res8 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        iVar6 = FUN_14034fcf0(puVar10);
        iVar4 = 0;
        if (0 < iVar6) {
          iVar4 = iVar6;
        }
        iVar6 = 0;
        if ((local_res8 != (undefined *)0x0) && (iVar6 = 0, local_res8 != PTR_DAT_1405d8010)) {
          iVar6 = *(int *)(local_res8 + -8);
        }
        if ((iVar6 <= iVar4) && (iVar4 = 0, local_res8 != (undefined *)0x0)) {
          if (local_res8 == PTR_DAT_1405d8010) goto LAB_1401a9785;
          iVar4 = *(int *)(local_res8 + -8);
        }
        if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
           ((int *)(local_res8 + -8) != (int *)0x0)) {
          *(int *)(local_res8 + -8) = iVar4;
          *(undefined2 *)(local_res8 + (longlong)iVar4 * 2) = 0;
        }
LAB_1401a9785:
        plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x420);
        (**(code **)(*plVar8 + 0xd0))
                  (plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2,&local_res8,param_4,
                   param_5);
        puVar10 = local_res8;
        if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
          uVar7 = FUN_14034fe70();
          local_50 = uVar7;
          FUN_14034ed40(uVar7);
          local_48 = CONCAT31(local_48._1_3_,1);
          piVar2 = (int *)(puVar10 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(uVar7);
        }
        if (bVar14) {
          FUN_14034edd0(lVar12);
        }
        return 1;
      }
      goto LAB_1401a982d;
    }
    iVar4 = DAT_1406080e0;
    DAT_1406080e0 = DAT_1406080e0 + 1;
  }
  else {
    iVar4 = DAT_1406080e4;
    DAT_1406080e4 = DAT_1406080e4 + 1;
  }
  if (iVar4 == 0) {
    FUN_140176d60(1);
  }
LAB_1401a982d:
  if (bVar14) {
    FUN_14034edd0(lVar12);
  }
  return 0;
}



void FUN_1401a9860(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined4 local_res8 [2];
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  lVar5 = 0;
  lVar3 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar2 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        lVar4 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0xa10);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xa18)) {
      lVar3 = *plVar2;
      if (lVar3 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0xa18)) &&
           (iVar1 = DAT_1406080e0 + 1, bVar6 = DAT_1406080e0 == 0, lVar3 = lVar5,
           DAT_1406080e0 = iVar1, bVar6)) {
          FUN_140176d60(1);
        }
        iVar1 = FUN_14026eed0(lVar3,param_2);
        plVar2 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x420);
        if (iVar1 == 0) {
          local_res8[0] = 0x25;
          (**(code **)(*plVar2 + 0xf0))
                    (plVar2,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8,param_2);
        }
        else {
          local_res8[0] = 1;
          (**(code **)(*plVar2 + 0xf0))();
          local_30 = *(undefined4 *)(param_1 + 0x170);
          local_2c = *(undefined4 *)(param_1 + 0x174);
          local_28 = *(undefined4 *)(param_1 + 0x178);
          local_24 = *(undefined4 *)(param_1 + 0x17c);
          FUN_1401fe3c0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                        *(undefined4 *)(param_1 + 0x284),*(undefined4 *)(param_1 + 8),&local_30,
                        param_2);
        }
      }
    }
    else {
      iVar1 = DAT_1406080e0 + 1;
      bVar6 = DAT_1406080e0 == 0;
      DAT_1406080e0 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



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

{
  undefined *puVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  longlong lVar8;
  longlong *plVar9;
  undefined *puVar10;
  longlong lVar11;
  bool bVar12;
  bool bVar13;
  undefined *local_res8;
  undefined8 in_stack_ffffffffffffff88;
  undefined **ppuVar14;
  undefined4 uVar15;
  undefined *local_68;
  undefined4 local_60;
  undefined4 local_5c;
  undefined8 local_58;
  longlong local_50;
  undefined1 local_48;
  undefined8 local_40;
  undefined1 local_38;
  
  uVar15 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
  local_58 = 0xfffffffffffffffe;
  lVar11 = 0;
  local_50 = 0;
  bVar13 = false;
  local_48 = 0;
  plVar9 = *(longlong **)(param_1 + 0xb28);
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == *(longlong **)(param_1 + 0xb30)) {
      lVar8 = *plVar9;
      lVar11 = 0;
      if (lVar8 != 0) {
        if (plVar9 != *(longlong **)(param_1 + 0xb30)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar13 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar13) {
            FUN_140176d60(1);
          }
          lVar8 = 0;
        }
        local_48 = 0;
        local_50 = lVar8;
        FUN_14034ed40(lVar8);
        bVar13 = true;
        local_48 = 1;
        lVar11 = lVar8;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  plVar9 = *(longlong **)(param_1 + 0xa20);
  if (plVar9 == (longlong *)0x0) goto LAB_1401a9fa4;
  if (plVar9 != *(longlong **)(param_1 + 0xa28)) {
    iVar4 = DAT_1406080e4;
    DAT_1406080e4 = DAT_1406080e4 + 1;
LAB_1401a9f98:
    if (iVar4 == 0) {
      FUN_140176d60(1);
    }
    goto LAB_1401a9fa4;
  }
  if ((*plVar9 == 0) || (plVar9 = *(longlong **)(param_1 + 0xa10), plVar9 == (longlong *)0x0))
  goto LAB_1401a9fa4;
  if (plVar9 != *(longlong **)(param_1 + 0xa18)) {
    iVar4 = DAT_1406080e0;
    DAT_1406080e0 = DAT_1406080e0 + 1;
    goto LAB_1401a9f98;
  }
  lVar8 = *plVar9;
  if (lVar8 == 0) goto LAB_1401a9fa4;
  if (plVar9 != *(longlong **)(param_1 + 0xa18)) {
    iVar4 = DAT_1406080e0 + 1;
    bVar12 = DAT_1406080e0 == 0;
    DAT_1406080e0 = iVar4;
    if (bVar12) {
      FUN_140176d60(1);
    }
    lVar8 = 0;
  }
  iVar4 = FUN_14026eed0(lVar8,param_2);
  if (iVar4 != 0) {
    local_res8 = (undefined *)CONCAT44(local_res8._4_4_,1);
    plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x420);
    (**(code **)(*plVar9 + 0xf0))
              (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_res8,param_2);
    local_68 = *(undefined **)(param_1 + 0x170);
    local_60 = *(undefined4 *)(param_1 + 0x178);
    local_5c = *(undefined4 *)(param_1 + 0x17c);
    ppuVar14 = &local_68;
    FUN_1401fe3c0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                  *(undefined4 *)(param_1 + 0x284),*(undefined4 *)(param_1 + 8),ppuVar14,param_2);
    uVar15 = (undefined4)((ulonglong)ppuVar14 >> 0x20);
  }
  puVar3 = *(undefined8 **)(param_1 + 0xa20);
  if (puVar3 == (undefined8 *)0x0) {
LAB_1401a9c79:
    uVar7 = 0;
  }
  else {
    if (puVar3 != *(undefined8 **)(param_1 + 0xa28)) {
      iVar4 = DAT_1406080e4 + 1;
      bVar12 = DAT_1406080e4 == 0;
      DAT_1406080e4 = iVar4;
      if (bVar12) {
        FUN_140176d60(1);
      }
      goto LAB_1401a9c79;
    }
    uVar7 = *puVar3;
  }
  iVar4 = FUN_14026f4e0(uVar7,param_2,param_3,*param_4,CONCAT44(uVar15,*param_5),param_6);
  if (iVar4 == 0) {
LAB_1401a9fa4:
    if (bVar13) {
      FUN_14034edd0(lVar11);
    }
    return 0;
  }
  FUN_14034fe70();
  local_68 = PTR_DAT_1405d8010;
  iVar4 = FUN_14034fcf0(param_6);
  if (local_68 == (undefined *)0x0) {
    iVar6 = 0;
  }
  else if (local_68 == PTR_DAT_1405d8010) {
    iVar6 = 0;
  }
  else {
    iVar6 = *(int *)(local_68 + -8);
  }
  iVar5 = iVar4;
  if (iVar4 <= iVar6) {
    if (local_68 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (local_68 == PTR_DAT_1405d8010) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(local_68 + -8);
    }
  }
  iVar6 = 1;
  if (1 < iVar5) {
    iVar6 = iVar5;
  }
  if (local_68 == (undefined *)0x0) {
    iVar5 = 0;
  }
  else if (local_68 == PTR_DAT_1405d8010) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(local_68 + -8);
  }
  if (iVar5 < iVar6) {
    FUN_140002d30(&local_68);
  }
  FUN_140002e10(&local_68);
  puVar10 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,param_6,iVar4);
  puVar10 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar10);
  iVar4 = 0;
  if (0 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = 0;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_68 + -8);
  }
  if ((iVar4 < iVar6) || (iVar4 = 0, local_68 == (undefined *)0x0)) {
LAB_1401a9d94:
    if (((local_68 != PTR_DAT_1405d8010) && (local_68 != (undefined *)0x0)) &&
       ((int *)(local_68 + -8) != (int *)0x0)) {
      *(int *)(local_68 + -8) = iVar4;
      *(undefined2 *)(local_68 + (longlong)iVar4 * 2) = 0;
    }
  }
  else if (local_68 != PTR_DAT_1405d8010) {
    iVar4 = *(int *)(local_68 + -8);
    goto LAB_1401a9d94;
  }
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar6 = FUN_14034fcf0(param_3);
  iVar4 = 0;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  iVar5 = iVar6;
  if (iVar6 <= iVar4) {
    iVar5 = 0;
    if ((local_res8 != (undefined *)0x0) && (iVar5 = 0, local_res8 != PTR_DAT_1405d8010)) {
      iVar5 = *(int *)(local_res8 + -8);
    }
  }
  iVar4 = 1;
  if (1 < iVar5) {
    iVar4 = iVar5;
  }
  iVar5 = 0;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_res8 + -8);
  }
  if (iVar5 < iVar4) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar10 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,param_3,iVar6);
  puVar10 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar10);
  iVar4 = 0;
  if (0 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = 0;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_res8 + -8);
  }
  if ((iVar6 <= iVar4) && (iVar4 = 0, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_1401a9eae;
    iVar4 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar4;
    *(undefined2 *)(local_res8 + (longlong)iVar4 * 2) = 0;
  }
LAB_1401a9eae:
  plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x420);
  (**(code **)(*plVar9 + 0x90))
            (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2,&local_res8,&local_68);
  puVar10 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_40 = uVar7;
    FUN_14034ed40(uVar7);
    local_38 = 1;
    piVar2 = (int *)(puVar10 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  puVar10 = local_68;
  local_res8 = PTR_DAT_1405d8010;
  if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_68 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_40 = uVar7;
    FUN_14034ed40(uVar7);
    local_38 = 1;
    piVar2 = (int *)(puVar10 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  if (bVar13) {
    FUN_14034edd0(lVar11);
  }
  return 1;
}



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

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  longlong *plVar9;
  longlong lVar10;
  longlong lVar11;
  longlong lVar12;
  bool bVar13;
  bool bVar14;
  undefined *local_res8;
  
  lVar12 = 0;
  iVar4 = 0;
  lVar10 = 0;
  bVar14 = false;
  plVar9 = *(longlong **)(param_1 + 0xb28);
  lVar11 = lVar12;
  if (plVar9 != (longlong *)0x0) {
    lVar11 = lVar10;
    if (plVar9 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar9 != 0) {
        lVar11 = *plVar9;
        if ((plVar9 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar14 = DAT_1406080a8 == 0, lVar11 = lVar12,
           DAT_1406080a8 = iVar3, bVar14)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar11);
        bVar14 = true;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar13 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  plVar9 = *(longlong **)(param_1 + 0xa20);
  if (plVar9 == (longlong *)0x0) goto LAB_1401aa2b7;
  if (plVar9 != *(longlong **)(param_1 + 0xa28)) {
    iVar4 = DAT_1406080e4 + 1;
    bVar13 = DAT_1406080e4 == 0;
    DAT_1406080e4 = iVar4;
    if (bVar13) {
      FUN_140176d60(1);
    }
    goto LAB_1401aa2b7;
  }
  if (*plVar9 == 0) goto LAB_1401aa2b7;
  lVar10 = *plVar9;
  if ((plVar9 != *(longlong **)(param_1 + 0xa28)) &&
     (iVar3 = DAT_1406080e4 + 1, bVar13 = DAT_1406080e4 == 0, lVar10 = lVar12, DAT_1406080e4 = iVar3
     , bVar13)) {
    FUN_140176d60(1);
  }
  iVar3 = FUN_14026f590(lVar10,param_2,param_3);
  if (iVar3 == 0) goto LAB_1401aa2b7;
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar5 = FUN_14034fcf0(param_3);
  iVar3 = iVar4;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -8);
  }
  iVar6 = iVar5;
  if (((iVar5 <= iVar3) && (iVar6 = iVar4, local_res8 != (undefined *)0x0)) &&
     (local_res8 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_res8 + -8);
  }
  iVar3 = 1;
  if (1 < iVar6) {
    iVar3 = iVar6;
  }
  iVar6 = iVar4;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_res8 + -8);
  }
  if (iVar6 < iVar3) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar8 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,param_3,iVar5);
  puVar8 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar5 = FUN_14034fcf0(puVar8);
  iVar3 = 0;
  if (0 < iVar5) {
    iVar3 = iVar5;
  }
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  if ((iVar3 < iVar4) || (iVar3 = 0, local_res8 == (undefined *)0x0)) {
LAB_1401aa215:
    if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
       ((int *)(local_res8 + -8) != (int *)0x0)) {
      *(int *)(local_res8 + -8) = iVar3;
      *(undefined2 *)(local_res8 + (longlong)iVar3 * 2) = 0;
    }
  }
  else if (local_res8 != PTR_DAT_1405d8010) {
    iVar3 = *(int *)(local_res8 + -8);
    goto LAB_1401aa215;
  }
  plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x420);
  (**(code **)(*plVar9 + 0xa0))
            (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2,&local_res8);
  puVar8 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
LAB_1401aa2b7:
  if (bVar14) {
    FUN_14034edd0(lVar11);
  }
  return;
}



void FUN_1401aa2e0(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined4 local_res8 [2];
  
  lVar5 = 0;
  lVar3 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar2 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        lVar4 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0xa20);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xa28)) {
      lVar3 = *plVar2;
      if (lVar3 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0xa28)) &&
           (iVar1 = DAT_1406080e4 + 1, bVar6 = DAT_1406080e4 == 0, lVar3 = lVar5,
           DAT_1406080e4 = iVar1, bVar6)) {
          FUN_140176d60(1);
        }
        iVar1 = FUN_14026f660(lVar3,param_2);
        plVar2 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x420);
        local_res8[0] = 1;
        if (iVar1 == 0) {
          local_res8[0] = 0x2d;
        }
        (**(code **)(*plVar2 + 0x80))
                  (plVar2,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8,param_2);
      }
    }
    else {
      iVar1 = DAT_1406080e4 + 1;
      bVar6 = DAT_1406080e4 == 0;
      DAT_1406080e4 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



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

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined4 *puVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined2 local_res8 [4];
  undefined8 in_stack_fffffffffffffd18;
  undefined4 uVar10;
  undefined4 local_2a8 [2];
  undefined4 local_2a0 [2];
  int local_298 [2];
  undefined4 local_290;
  undefined4 local_28c;
  undefined4 local_288;
  undefined4 local_284;
  undefined4 local_280;
  undefined4 local_27c;
  undefined4 local_278;
  undefined4 local_274;
  undefined4 local_270 [2];
  longlong local_268;
  undefined1 local_260;
  undefined8 local_258;
  longlong local_248;
  longlong local_240;
  undefined4 local_230;
  undefined4 local_1a0;
  undefined4 local_198;
  undefined4 uStack_194;
  undefined4 uStack_190;
  undefined4 uStack_18c;
  int local_128;
  undefined4 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffd18 >> 0x20);
  local_258 = 0xfffffffffffffffe;
  lVar3 = 0;
  lVar6 = 0;
  local_268 = 0;
  bVar9 = false;
  local_260 = 0;
  plVar5 = *(longlong **)(param_1 + 0xb28);
  lVar7 = lVar3;
  if (plVar5 != (longlong *)0x0) {
    lVar7 = lVar6;
    if (plVar5 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar5 != 0) {
        lVar7 = *plVar5;
        if ((plVar5 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar7 = lVar3,
           DAT_1406080a8 = iVar1, bVar9)) {
          FUN_140176d60(1);
        }
        local_260 = 0;
        local_268 = lVar7;
        FUN_14034ed40(lVar7);
        bVar9 = true;
        local_260 = 1;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar5 = *(longlong **)(param_1 + 0x6c0);
  if (plVar5 == (longlong *)0x0) {
LAB_1401aa9a2:
    if (bVar9) {
      FUN_14034edd0(lVar7);
    }
    return 0;
  }
  if (plVar5 != *(longlong **)(param_1 + 0x6c8)) {
    iVar1 = DAT_140608048 + 1;
    bVar8 = DAT_140608048 == 0;
    DAT_140608048 = iVar1;
    if (bVar8) {
      FUN_140176d60(1);
    }
    goto LAB_1401aa9a2;
  }
  if (((*plVar5 == 0) || (*param_3 < 0)) || (0x17 < *param_3)) goto LAB_1401aa9a2;
  FUN_14000a170(&local_198);
  local_f0 = 0;
  FUN_14000a170(&local_248);
  local_1a0 = 0;
  FUN_14000a170(local_e8);
  local_40 = 0;
  uVar2 = FUN_140174f00(param_1 + 0x6c0);
  iVar1 = FUN_1401ecc20(uVar2,param_2,&local_198);
  if (iVar1 == 0) goto LAB_1401aa98c;
  lVar3 = FUN_1401e0840();
  GetLocalTime((LPSYSTEMTIME)(lVar3 + 200));
  iVar1 = FUN_1401e2290((LPSYSTEMTIME)(lVar3 + 200));
  if ((0 < local_128) && (local_128 <= iVar1)) goto LAB_1401aa9a2;
  lVar3 = FUN_140174f00(param_1 + 0x6c0);
  iVar1 = *param_3;
  if ((iVar1 < 0) || (0x17 < iVar1)) {
LAB_1401aa7ec:
    uVar2 = FUN_140174f00(param_1 + 0x6c0);
    FUN_1401ed120(uVar2,param_2,local_e8);
  }
  else {
    *(undefined2 *)((longlong)iVar1 * 0xac + 0x14 + lVar3) = 0;
    *(short *)((longlong)*param_3 * 0xac + 0x16 + lVar3) = (short)*param_3;
    FUN_140090020(&local_248,(longlong)*param_3 * 0xac + lVar3);
    if ((local_248 == 0) && (local_240 == 0)) {
      bVar8 = false;
    }
    else {
      bVar8 = true;
    }
    if (!bVar8) goto LAB_1401aa7ec;
    uVar2 = FUN_140137690();
    iVar1 = FUN_140136b30(uVar2,local_230);
    if (iVar1 == 5) {
      uVar2 = FUN_140174f00(param_1 + 0x6c0);
      FUN_1401ed120(uVar2,param_2,&local_248);
      local_280 = *(undefined4 *)(param_1 + 0x160);
      local_27c = *(undefined4 *)(param_1 + 0x164);
      local_278 = *(undefined4 *)(param_1 + 0x168);
      local_274 = *(undefined4 *)(param_1 + 0x16c);
      local_290 = *(undefined4 *)(param_1 + 0x170);
      local_28c = *(undefined4 *)(param_1 + 0x174);
      local_288 = *(undefined4 *)(param_1 + 0x178);
      local_284 = *(undefined4 *)(param_1 + 0x17c);
      iVar1 = *(int *)(param_1 + 0x284);
      local_2a0[0] = *param_2;
      local_298[0] = 5;
      local_2a8[0] = *(undefined4 *)(param_1 + 8);
      if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
         (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar3 != 0)) {
        local_res8[0] = (undefined2)iVar1;
        plVar5 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                 + 0x70);
        puVar4 = local_2a8;
        (**(code **)(*plVar5 + 0x120))
                  (plVar5,1,&DAT_1405d85a0,local_res8,puVar4,&local_290,&local_280,&local_248,
                   local_298,local_2a0);
        uVar10 = (undefined4)((ulonglong)puVar4 >> 0x20);
      }
    }
  }
  uVar2 = FUN_140174f00(param_1 + 0x6c0);
  FUN_1401ed220(uVar2,&DAT_14047ba28,param_3,&local_198,CONCAT44(uVar10,6));
  local_290 = *(undefined4 *)(param_1 + 0x160);
  local_28c = *(undefined4 *)(param_1 + 0x164);
  local_288 = *(undefined4 *)(param_1 + 0x168);
  local_284 = *(undefined4 *)(param_1 + 0x16c);
  local_280 = *(undefined4 *)(param_1 + 0x170);
  local_27c = *(undefined4 *)(param_1 + 0x174);
  local_278 = *(undefined4 *)(param_1 + 0x178);
  local_274 = *(undefined4 *)(param_1 + 0x17c);
  iVar1 = *(int *)(param_1 + 0x284);
  local_2a8[0] = *param_4;
  local_298[0] = *param_3;
  local_2a0[0] = 0;
  local_270[0] = *(undefined4 *)(param_1 + 8);
  if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
     (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar3 != 0)) {
    local_res8[0] = (undefined2)iVar1;
    plVar5 = (longlong *)
             (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
             0x70);
    (**(code **)(*plVar5 + 0x5c0))
              (plVar5,1,&DAT_1405d85a0,local_res8,local_270,&local_280,&local_290,&local_198,
               local_2a0,local_298,local_2a8);
  }
  puVar4 = (undefined4 *)FUN_1401de8d0(param_1 + 0x6f0,*param_3);
  *puVar4 = *param_4;
  puVar4 = (undefined4 *)FUN_1401de910(param_1 + 0x7b0,*param_3);
  *puVar4 = local_198;
  puVar4[1] = uStack_194;
  puVar4[2] = uStack_190;
  puVar4[3] = uStack_18c;
LAB_1401aa98c:
  if (bVar9) {
    FUN_14034edd0(lVar7);
  }
  return 1;
}



void FUN_1401aa9d0(longlong param_1,uint param_2,undefined4 param_3,undefined4 param_4)

{
  longlong *plVar1;
  int iVar2;
  undefined4 *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  undefined4 *puVar7;
  bool bVar8;
  bool bVar9;
  
  lVar4 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar6 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar1;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar9 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  puVar7 = &DAT_1406093bc;
  if (param_2 < 0x18) {
    puVar3 = (undefined4 *)(param_1 + 0x6f0 + (longlong)(int)param_2 * 4);
  }
  else {
    if (DAT_1406093c0 == 0) {
      FUN_140176d60(0);
    }
    DAT_1406093c0 = DAT_1406093c0 + 1;
    puVar3 = &DAT_1406093bc;
  }
  iVar2 = DAT_1406093c0;
  *puVar3 = param_3;
  if (param_2 < 0x18) {
    puVar7 = (undefined4 *)(param_1 + 0x750 + (longlong)(int)param_2 * 4);
  }
  else {
    if (iVar2 == 0) {
      FUN_140176d60(0);
      iVar2 = DAT_1406093c0;
    }
    DAT_1406093c0 = iVar2 + 1;
  }
  *puVar7 = param_4;
  if (bVar9) {
    FUN_14034edd0(lVar6);
  }
  return;
}



void FUN_1401aab20(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  *(undefined4 *)(param_1 + 0x930) = param_2;
  *(undefined4 *)(param_1 + 0x934) = param_3;
  *(undefined4 *)(param_1 + 0x938) = param_4;
  *(undefined4 *)(param_1 + 0x93c) = param_5;
  *(undefined4 *)(param_1 + 0x940) = param_6;
  *(undefined4 *)(param_1 + 0x944) = param_7;
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



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

void FUN_1401aac30(undefined2 param_1,undefined4 *param_2,undefined4 param_3,undefined2 param_4,
                  int param_5,int param_6,int param_7,int param_8,int param_9,int param_10)

{
  short sVar1;
  uint uVar2;
  bool bVar3;
  undefined2 uVar4;
  uint uVar5;
  undefined4 uVar6;
  undefined4 *puVar7;
  undefined8 uVar8;
  longlong lVar9;
  void *pvVar10;
  uint *puVar11;
  uint uVar12;
  undefined1 local_40 [24];
  
  puVar7 = (undefined4 *)FUN_140357570(local_40);
  *param_2 = *puVar7;
  param_2[1] = puVar7[1];
  param_2[2] = puVar7[2];
  param_2[3] = puVar7[3];
  param_2[6] = param_3;
  *(undefined2 *)(param_2 + 7) = param_4;
  uVar8 = FUN_140137690();
  uVar4 = FUN_140136b30(uVar8);
  *(undefined2 *)(param_2 + 5) = uVar4;
  uVar5 = param_2[6];
  lVar9 = FUN_140137690();
  if (*(longlong *)(lVar9 + 0x88) != 0) {
    for (puVar11 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                             ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
        puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
      if ((puVar11[0xa8] == uVar5) && (*puVar11 == uVar5)) {
        if (puVar11 != (uint *)0x0) goto LAB_1401aace3;
        break;
      }
    }
  }
  puVar11 = (uint *)0x0;
LAB_1401aace3:
  if (puVar11 == (uint *)0x0) {
    uVar5 = 1;
  }
  else {
    if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    uVar5 = puVar11[0x5b];
  }
  param_2[0x1a] = uVar5;
  uVar5 = param_2[6];
  lVar9 = FUN_140137690();
  if (*(longlong *)(lVar9 + 0x88) != 0) {
    for (puVar11 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                             ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
        puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
      if ((puVar11[0xa8] == uVar5) && (*puVar11 == uVar5)) goto LAB_1401aad5a;
    }
  }
  puVar11 = (uint *)0x0;
LAB_1401aad5a:
  uVar5 = 0;
  if (puVar11 != (uint *)0x0) {
    uVar5 = puVar11[0x51];
  }
  param_2[8] = uVar5;
  if ((*(short *)(param_2 + 5) == 1) || (*(short *)(param_2 + 5) == 5)) {
    uVar5 = param_2[6];
    lVar9 = FUN_140137690();
    if (*(longlong *)(lVar9 + 0x88) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                               ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
          puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
        if ((puVar11[0xa8] == uVar5) && (*puVar11 == uVar5)) {
          if (puVar11 != (uint *)0x0) {
            if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar4 = (undefined2)puVar11[0x3d];
            goto LAB_1401aadfe;
          }
          break;
        }
      }
    }
    uVar4 = 1;
LAB_1401aadfe:
    *(undefined2 *)(param_2 + 0x1b) = uVar4;
    uVar5 = param_2[6];
    lVar9 = FUN_140137690();
    if (*(longlong *)(lVar9 + 0x88) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                               ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
          puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
        if ((puVar11[0xa8] == uVar5) && (*puVar11 == uVar5)) {
          if (puVar11 != (uint *)0x0) {
            if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar5 = puVar11[0x52];
            goto LAB_1401aae70;
          }
          break;
        }
      }
    }
    uVar5 = 1;
LAB_1401aae70:
    param_2[9] = uVar5;
    uVar5 = param_2[6];
    lVar9 = FUN_140137690();
    if (*(longlong *)(lVar9 + 0x88) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                               ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
          puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
        if ((puVar11[0xa8] == uVar5) && (*puVar11 == uVar5)) {
          if (puVar11 != (uint *)0x0) {
            if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (puVar11[0x5c] != 0) goto LAB_1401aaef7;
          }
          break;
        }
      }
    }
    uVar8 = FUN_140137690();
    FUN_1401371c0(uVar8,param_2[6],param_2 + 0x12,param_2 + 0x19);
  }
LAB_1401aaef7:
  uVar5 = 0;
  uVar12 = 0;
  bVar3 = false;
  if (*(short *)(param_2 + 5) == 3) {
    uVar2 = param_2[6];
    lVar9 = FUN_140137690();
    if (*(longlong *)(lVar9 + 0x88) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                               ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
          puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
        if ((puVar11[0xa8] == uVar2) && (*puVar11 == uVar2)) {
          if (puVar11 != (uint *)0x0) {
            if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar5 = puVar11[0x32];
          }
          break;
        }
      }
    }
    uVar2 = param_2[6];
    lVar9 = FUN_140137690();
    if (*(longlong *)(lVar9 + 0x88) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                               ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
          puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
        if ((puVar11[0xa8] == uVar2) && (*puVar11 == uVar2)) {
          if (puVar11 != (uint *)0x0) {
            if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar12 = puVar11[0x33];
          }
          break;
        }
      }
    }
    bVar3 = false;
    if ((uVar5 == 0x3c) && (bVar3 = false, uVar12 == 100)) {
      bVar3 = true;
    }
  }
  sVar1 = *(short *)(param_2 + 5);
  if ((((sVar1 == 1) || (sVar1 == 2)) || (bVar3)) || (sVar1 == 5)) {
    uVar2 = param_2[6];
    lVar9 = FUN_140137690();
    if (*(longlong *)(lVar9 + 0x88) != 0) {
      for (puVar11 = *(uint **)(*(longlong *)(lVar9 + 0x88) +
                               ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar9 + 0x98)) * 8);
          puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
        if ((puVar11[0xa8] == uVar2) && (*puVar11 == uVar2)) {
          if (puVar11 != (uint *)0x0) {
            if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (((puVar11[0x46] != 0) && (puVar11[0x46] != 0x17)) &&
               ((uVar5 != 0x3c || (uVar12 != 100)))) goto LAB_1401ab112;
          }
          break;
        }
      }
    }
    if ((param_5 == 0) && (param_6 == 0)) {
      uVar8 = FUN_140137690();
      FUN_140136f10(uVar8,param_2[6],param_2 + 0xb,param_2 + 0xc,param_2 + 0xf,1,0);
    }
    else {
      param_2[0xc] = param_5;
      param_2[0xf] = param_6;
    }
    if ((0 < param_7) && (0 < param_8)) {
      param_2[0xd] = param_7;
      param_2[0x10] = param_8;
    }
    if ((0 < param_9) && (0 < param_10)) {
      param_2[0xe] = param_9;
      param_2[0x11] = param_10;
    }
  }
LAB_1401ab112:
  if (0 < (int)param_2[8]) {
    lVar9 = DAT_140607cc0;
    if (DAT_140607cc0 == 0) {
      pvVar10 = operator_new(0x130);
      lVar9 = 0;
      if (pvVar10 != (void *)0x0) {
        lVar9 = FUN_1401e04e0(pvVar10);
      }
    }
    DAT_140607cc0 = lVar9;
    uVar6 = FUN_1401e2340(DAT_140607cc0,param_2[8]);
    param_2[0x1c] = uVar6;
  }
  *(undefined2 *)((longlong)param_2 + 0x96) = param_1;
  FUN_1401a40e0(param_2);
  return;
}



undefined8 FUN_1401ab190(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  int iVar7;
  int local_res20 [2];
  undefined4 local_f8 [2];
  longlong *local_f0;
  longlong *local_e8;
  void *local_e0;
  undefined8 local_d8;
  undefined1 local_c8 [168];
  undefined4 local_20;
  
  local_d8 = 0xfffffffffffffffe;
  lVar6 = 0;
  local_res20[0] = 0;
  local_f8[0] = 0;
  uVar5 = FUN_140140d80();
  iVar4 = FUN_1401407f0(uVar5,param_3,local_f8,local_res20);
  iVar7 = local_res20[0];
  if ((iVar4 != 0) && (local_res20[0] != 0)) {
    local_f0 = (longlong *)0x0;
    local_e0 = operator_new(0x850);
    if (local_e0 != (void *)0x0) {
      lVar6 = FUN_1401e64f0(local_e0);
    }
    if (lVar6 == 0) {
      local_f0 = (longlong *)0x0;
    }
    else {
      local_f0 = operator_new(0x10);
      *local_f0 = lVar6;
      *(undefined4 *)(local_f0 + 1) = 1;
    }
    plVar1 = local_f0;
    local_e8 = local_f0;
    if ((local_f0 != (longlong *)0x0) && (*local_f0 != 0)) {
      if (*(longlong **)(param_1 + 0x6d0) != local_f0) {
        FUN_1401dede0(param_1 + 0x6d0);
        *(longlong **)(param_1 + 0x6d0) = plVar1;
        *(longlong **)(param_1 + 0x6d8) = plVar1;
        LOCK();
        *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
        UNLOCK();
        iVar7 = local_res20[0];
      }
      plVar1 = local_f0;
      FUN_14000a170(local_c8);
      local_20 = 0;
      FUN_1401aac30(3,local_c8,iVar7,1,0,0,0,0,0,0);
      FUN_1401e6560(*plVar1,local_c8,param_1,0x1ca,0x4d);
      FUN_1401e6a20(*plVar1,param_2,local_f8[0],param_1);
      plVar2 = local_f0;
      LOCK();
      plVar1 = plVar1 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        pvVar3 = (void *)*local_f0;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0x818);
          operator_delete(pvVar3);
        }
        operator_delete(plVar2);
      }
      return 1;
    }
    if (local_f0 != (longlong *)0x0) {
      LOCK();
      plVar2 = local_f0 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        pvVar3 = (void *)*local_f0;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0x818);
          operator_delete(pvVar3);
        }
        operator_delete(plVar1);
      }
    }
  }
  return 0;
}



undefined8 FUN_1401ab3b0(longlong param_1,uint param_2)

{
  uint *puVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  int *piVar5;
  longlong *plVar6;
  int iVar7;
  uint uVar8;
  bool bVar9;
  float fVar10;
  int local_res10 [2];
  int local_res18 [2];
  undefined4 local_res20 [2];
  undefined8 in_stack_ffffffffffffff48;
  undefined4 uVar11;
  undefined8 in_stack_ffffffffffffff50;
  undefined4 uVar12;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  
  uVar11 = (undefined4)((ulonglong)in_stack_ffffffffffffff48 >> 0x20);
  uVar12 = (undefined4)((ulonglong)in_stack_ffffffffffffff50 >> 0x20);
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar1 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar8 = puVar1[3];
          goto LAB_1401ab40f;
        }
        break;
      }
    }
  }
  uVar8 = 0;
LAB_1401ab40f:
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar1 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar10 = (float)puVar1[0x2a];
          goto LAB_1401ab44b;
        }
        break;
      }
    }
  }
  fVar10 = 0.0;
LAB_1401ab44b:
  plVar3 = *(longlong **)(param_1 + 0x6e0);
  iVar7 = (int)fVar10;
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x6e8)) {
      plVar6 = (longlong *)*plVar3;
      if (plVar6 != (longlong *)0x0) {
        if (plVar3 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar9 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar9) {
            FUN_140176d60();
          }
          plVar6 = (longlong *)0x0;
        }
        lVar4 = (**(code **)(*plVar6 + 0x270))();
        switch(uVar8) {
        case 0x97:
          iVar7 = iVar7 + *(int *)(lVar4 + 0x90);
          *(int *)(lVar4 + 0x90) = iVar7;
          lVar4 = FUN_140174f50(param_1 + 0x6e0);
          *(int *)(lVar4 + 0x88c) = iVar7;
          *(undefined1 *)(lVar4 + 0x888) = 1;
          local_98 = *(undefined4 *)(param_1 + 0x170);
          iVar2 = *(int *)(param_1 + 0x284);
          local_94 = *(undefined4 *)(param_1 + 0x174);
          local_90 = *(undefined4 *)(param_1 + 0x178);
          local_8c = *(undefined4 *)(param_1 + 0x17c);
          local_res20[0] = *(undefined4 *)(param_1 + 8);
          if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
            local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar2);
            local_res10[0] = CONCAT22(local_res10[0]._2_2_,(short)iVar7);
            lVar4 = *(longlong *)
                     (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
            (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x900))
                      (lVar4 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,&local_98,local_res10);
            return 1;
          }
          break;
        case 0x98:
          iVar7 = iVar7 + *(int *)(lVar4 + 0x94);
          *(int *)(lVar4 + 0x94) = iVar7;
          lVar4 = FUN_140174f50(param_1 + 0x6e0);
          *(int *)(lVar4 + 0x890) = iVar7;
          *(undefined1 *)(lVar4 + 0x888) = 1;
          local_88 = *(undefined4 *)(param_1 + 0x170);
          iVar2 = *(int *)(param_1 + 0x284);
          local_84 = *(undefined4 *)(param_1 + 0x174);
          local_80 = *(undefined4 *)(param_1 + 0x178);
          local_7c = *(undefined4 *)(param_1 + 0x17c);
          local_res20[0] = *(undefined4 *)(param_1 + 8);
          if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
            local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar2);
            local_res10[0] = CONCAT22(local_res10[0]._2_2_,(short)iVar7);
            lVar4 = *(longlong *)
                     (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
            (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x910))
                      (lVar4 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,&local_88,local_res10);
            return 1;
          }
          break;
        case 0x99:
          local_res10[0] = 0;
          iVar2 = iVar7 + *(int *)(lVar4 + 0x6c);
          iVar7 = iVar7 + *(int *)(lVar4 + 0x70);
          local_res18[0] = iVar2;
          piVar5 = local_res10;
          if (-1 < iVar2) {
            piVar5 = local_res18;
          }
          local_res18[0] = iVar7;
          local_res10[0] = 0;
          *(int *)(lVar4 + 0x6c) = *piVar5;
          piVar5 = local_res10;
          if (-1 < iVar7) {
            piVar5 = local_res18;
          }
          *(int *)(lVar4 + 0x70) = *piVar5;
          local_78 = *(undefined4 *)(param_1 + 0x170);
          local_74 = *(undefined4 *)(param_1 + 0x174);
          local_70 = *(undefined4 *)(param_1 + 0x178);
          local_6c = *(undefined4 *)(param_1 + 0x17c);
          FUN_1401fc7e0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                        *(undefined4 *)(param_1 + 0x284),&local_78,CONCAT44(uVar11,iVar2),
                        CONCAT44(uVar12,iVar7));
          FUN_14019bf80(param_1);
          return 1;
        case 0x9a:
          iVar7 = iVar7 + *(int *)(lVar4 + 0x98);
          *(int *)(lVar4 + 0x98) = iVar7;
          lVar4 = FUN_140174f50(param_1 + 0x6e0);
          *(int *)(lVar4 + 0x898) = iVar7;
          *(undefined1 *)(lVar4 + 0x888) = 1;
          local_68 = *(undefined4 *)(param_1 + 0x170);
          iVar2 = *(int *)(param_1 + 0x284);
          local_64 = *(undefined4 *)(param_1 + 0x174);
          local_60 = *(undefined4 *)(param_1 + 0x178);
          local_5c = *(undefined4 *)(param_1 + 0x17c);
          local_res20[0] = *(undefined4 *)(param_1 + 8);
          if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
            local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar2);
            local_res10[0] = CONCAT22(local_res10[0]._2_2_,(short)iVar7);
            lVar4 = *(longlong *)
                     (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
            (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x920))
                      (lVar4 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,&local_68,local_res10);
            return 1;
          }
          break;
        case 0x9b:
          iVar7 = iVar7 + *(int *)(lVar4 + 0x9c);
          *(int *)(lVar4 + 0x9c) = iVar7;
          lVar4 = FUN_140174f50(param_1 + 0x6e0);
          *(int *)(lVar4 + 0x89c) = iVar7;
          *(undefined1 *)(lVar4 + 0x888) = 1;
          local_58 = *(undefined4 *)(param_1 + 0x170);
          iVar2 = *(int *)(param_1 + 0x284);
          local_54 = *(undefined4 *)(param_1 + 0x174);
          local_50 = *(undefined4 *)(param_1 + 0x178);
          local_4c = *(undefined4 *)(param_1 + 0x17c);
          local_res20[0] = *(undefined4 *)(param_1 + 8);
          if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
            local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar2);
            local_res10[0] = CONCAT22(local_res10[0]._2_2_,(short)iVar7);
            lVar4 = *(longlong *)
                     (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
            (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x930))
                      (lVar4 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,&local_58,local_res10);
            return 1;
          }
          break;
        case 0x9c:
          iVar7 = iVar7 + *(int *)(lVar4 + 0xa0);
          *(int *)(lVar4 + 0xa0) = iVar7;
          lVar4 = FUN_140174f50(param_1 + 0x6e0);
          *(int *)(lVar4 + 0x8a0) = iVar7;
          *(undefined1 *)(lVar4 + 0x888) = 1;
          local_48 = *(undefined4 *)(param_1 + 0x170);
          iVar2 = *(int *)(param_1 + 0x284);
          local_44 = *(undefined4 *)(param_1 + 0x174);
          local_40 = *(undefined4 *)(param_1 + 0x178);
          local_3c = *(undefined4 *)(param_1 + 0x17c);
          local_res20[0] = *(undefined4 *)(param_1 + 8);
          if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
            local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar2);
            local_res10[0] = CONCAT22(local_res10[0]._2_2_,(short)iVar7);
            lVar4 = *(longlong *)
                     (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
            (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x940))
                      (lVar4 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,&local_48,local_res10);
            return 1;
          }
          break;
        case 0x9d:
          iVar7 = iVar7 + *(int *)(lVar4 + 0xa4);
          *(int *)(lVar4 + 0xa4) = iVar7;
          lVar4 = FUN_140174f50(param_1 + 0x6e0);
          *(int *)(lVar4 + 0x8a4) = iVar7;
          *(undefined1 *)(lVar4 + 0x888) = 1;
          local_38 = *(undefined4 *)(param_1 + 0x170);
          iVar2 = *(int *)(param_1 + 0x284);
          local_34 = *(undefined4 *)(param_1 + 0x174);
          local_30 = *(undefined4 *)(param_1 + 0x178);
          local_2c = *(undefined4 *)(param_1 + 0x17c);
          local_res20[0] = *(undefined4 *)(param_1 + 8);
          if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
            local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar2);
            local_res10[0] = CONCAT22(local_res10[0]._2_2_,(short)iVar7);
            lVar4 = *(longlong *)
                     (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
            (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x950))
                      (lVar4 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,&local_38,local_res10);
          }
        }
        return 1;
      }
    }
    else {
      iVar7 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar7;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001401abc96)
// WARNING: Removing unreachable block (ram,0x0001401abca0)

void FUN_1401abb50(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  int iVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong lVar6;
  bool bVar7;
  undefined1 local_res8 [8];
  void *local_a8;
  void *local_a0;
  undefined8 local_98;
  void *local_88;
  void *local_80;
  undefined8 local_78;
  undefined **local_68;
  longlong *local_60;
  longlong *local_58;
  ulonglong local_50;
  undefined8 local_48;
  void *local_40;
  void *local_38;
  undefined8 local_30;
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  plVar3 = *(longlong **)(param_1 + 0x6e0);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x6e8)) {
      if (*plVar3 != 0) {
        plVar5 = (longlong *)0x0;
        local_40 = (void *)0x0;
        local_38 = (void *)0x0;
        local_30 = 0;
        local_88 = (void *)0x0;
        local_80 = (void *)0x0;
        local_78 = 0;
        if (plVar3 == *(longlong **)(param_1 + 0x6e8)) {
          plVar3 = (longlong *)*plVar3;
        }
        else {
          iVar2 = DAT_14060804c + 1;
          bVar7 = DAT_14060804c == 0;
          plVar3 = plVar5;
          DAT_14060804c = iVar2;
          if (bVar7) {
            FUN_140176d60(1);
          }
        }
        FUN_140206d00(plVar3,&local_40,&local_88,param_2);
        lVar1 = *(longlong *)(param_1 + 0xac0);
        iVar2 = DAT_14060804c;
        for (lVar6 = *(longlong *)(param_1 + 0xab8); DAT_14060804c = iVar2, lVar6 != lVar1;
            lVar6 = lVar6 + 0x10) {
          plVar3 = *(longlong **)(param_1 + 0x6e0);
          plVar4 = plVar5;
          if (plVar3 != (longlong *)0x0) {
            if (plVar3 == *(longlong **)(param_1 + 0x6e8)) {
              plVar4 = (longlong *)*plVar3;
            }
            else {
              DAT_14060804c = iVar2 + 1;
              if (iVar2 == 0) {
                FUN_140176d60(1);
              }
            }
          }
          FUN_140207b70(plVar4,lVar6);
          iVar2 = DAT_14060804c;
        }
        if (*(longlong *)(param_1 + 0xab8) != *(longlong *)(param_1 + 0xac0)) {
          *(longlong *)(param_1 + 0xac0) = *(longlong *)(param_1 + 0xab8);
        }
        if (local_40 != local_38) {
          local_res8[0] = 1;
          plVar3 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar3 + 0x550))
                    (plVar3,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_40,local_res8);
        }
        if (local_88 != local_80) {
          plVar3 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar3 + 0x820))
                    (plVar3,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_88);
        }
        local_a8 = (void *)0x0;
        local_a0 = (void *)0x0;
        local_98 = 0;
        plVar3 = *(longlong **)(param_1 + 0x6e0);
        plVar4 = plVar5;
        if (plVar3 != (longlong *)0x0) {
          if (plVar3 == *(longlong **)(param_1 + 0x6e8)) {
            plVar4 = (longlong *)*plVar3;
          }
          else {
            iVar2 = DAT_14060804c + 1;
            bVar7 = DAT_14060804c == 0;
            DAT_14060804c = iVar2;
            if (bVar7) {
              FUN_140176d60(1);
            }
          }
        }
        FUN_140208460(plVar4,&local_a8);
        if (local_a8 != local_a0) {
          if (*(longlong *)(param_1 + 0xb58) == 0) {
            local_68 = Proud::CFastArray<>::vftable;
            local_60 = (longlong *)0x0;
            local_58 = (longlong *)0x0;
            local_50 = 0;
            local_48 = 0;
            plVar3 = *(longlong **)(param_1 + 0x6e0);
            plVar4 = plVar5;
            if (plVar3 != (longlong *)0x0) {
              if (plVar3 == *(longlong **)(param_1 + 0x6e8)) {
                plVar4 = (longlong *)*plVar3;
              }
              else {
                iVar2 = DAT_14060804c + 1;
                bVar7 = DAT_14060804c == 0;
                DAT_14060804c = iVar2;
                if (bVar7) {
                  FUN_140176d60(1);
                }
              }
            }
            iVar2 = (**(code **)(*plVar4 + 0xae8))(plVar4,&local_68);
            if (iVar2 < 1) {
              plVar3 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
              (**(code **)(*plVar3 + 0x570))
                        (plVar3,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_a8);
            }
            else {
              plVar3 = local_58;
              if ((int)local_50 == 0) {
                plVar3 = plVar5;
              }
              plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
              (**(code **)(*plVar4 + 0x568))
                        (plVar4,plVar3,local_50 & 0xffffffff,&DAT_1405d85a0,&local_a8);
            }
            local_68 = Proud::CFastArray<>::vftable;
            if (local_58 != (longlong *)0x0) {
              if (local_60 == (longlong *)0x0) {
                FUN_14034ff60();
              }
              else {
                (**(code **)(*local_60 + 0x18))(local_60,local_58);
              }
            }
          }
          else {
            plVar3 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar3 + 0x570))
                      (plVar3,*(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 8),&DAT_1405d85a0,
                       &local_a8);
          }
          plVar3 = *(longlong **)(param_1 + 0x6e0);
          if (plVar3 != (longlong *)0x0) {
            if (plVar3 == *(longlong **)(param_1 + 0x6e8)) {
              plVar5 = (longlong *)*plVar3;
            }
            else {
              iVar2 = DAT_14060804c + 1;
              bVar7 = DAT_14060804c == 0;
              DAT_14060804c = iVar2;
              if (bVar7) {
                FUN_140176d60(1);
              }
            }
          }
          FUN_14020d4d0(plVar5);
        }
        if (local_a8 != (void *)0x0) {
          operator_delete(local_a8);
        }
        local_a8 = (void *)0x0;
        local_a0 = (void *)0x0;
        local_98 = 0;
        if (local_88 != (void *)0x0) {
          operator_delete(local_88);
        }
        local_88 = (void *)0x0;
        local_80 = (void *)0x0;
        local_78 = 0;
        if (local_40 != (void *)0x0) {
          operator_delete(local_40);
        }
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



void FUN_1401abf50(longlong param_1,undefined8 param_2,undefined2 param_3,undefined8 param_4,
                  undefined2 param_5,undefined4 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,undefined4 param_16,
                  undefined4 param_17,undefined4 param_18,undefined4 param_19,undefined4 param_20,
                  undefined4 param_21,undefined4 param_22,undefined8 param_23,undefined4 param_24)

{
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  local_28 = *(undefined4 *)(param_1 + 0x160);
  local_24 = *(undefined4 *)(param_1 + 0x164);
  local_20 = *(undefined4 *)(param_1 + 0x168);
  local_1c = *(undefined4 *)(param_1 + 0x16c);
  local_18 = *(undefined4 *)(param_1 + 0x170);
  local_14 = *(undefined4 *)(param_1 + 0x174);
  local_10 = *(undefined4 *)(param_1 + 0x178);
  local_c = *(undefined4 *)(param_1 + 0x17c);
  FUN_1401fe800(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                *(undefined4 *)(param_1 + 0x284),param_2,&local_18,&local_28,
                *(undefined2 *)(DAT_140608000 + 0x140),param_4,param_3,param_5,param_24,param_6,
                param_7,param_8,param_9,param_10,param_11,param_12,param_13,param_14,param_15,
                param_16,param_17,param_18,param_19,param_20,param_21,param_22,param_23);
  return;
}



undefined8 FUN_1401ac110(longlong param_1,uint *param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  void *pvVar3;
  code *pcVar4;
  int iVar5;
  uint uVar6;
  longlong *plVar7;
  longlong lVar8;
  size_t sVar9;
  undefined8 uVar10;
  uint *puVar11;
  uint *puVar12;
  wchar_t *pwVar13;
  ulonglong uVar14;
  uint *puVar15;
  uint *puVar16;
  uint *puVar17;
  int iVar18;
  uint *puVar19;
  uint *puVar20;
  bool bVar21;
  uint local_res8 [2];
  uint *local_res10;
  void *local_res18;
  uint *local_188;
  uint *local_180;
  uint *local_178;
  longlong *local_168;
  longlong *local_160;
  longlong *local_158;
  longlong *local_150;
  undefined8 local_148;
  undefined1 local_138 [8];
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  wchar_t local_110 [48];
  undefined4 local_b0;
  undefined4 local_ac;
  int local_a8;
  undefined4 local_a4;
  char local_a0 [104];
  
  local_148 = 0xfffffffffffffffe;
  plVar7 = *(longlong **)(param_1 + 0x6e0);
  if (plVar7 != (longlong *)0x0) {
    local_res10 = param_2;
    if (plVar7 == *(longlong **)(param_1 + 0x6e8)) {
      if (*plVar7 != 0) {
        uVar6 = *param_2;
        plVar7 = (longlong *)FUN_1401417a0();
        puVar19 = (uint *)0x0;
        puVar12 = puVar19;
        if (*plVar7 != 0) {
          for (puVar11 = *(uint **)(*plVar7 +
                                   ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar7 + 2)) * 8);
              (puVar12 = puVar19, puVar11 != (uint *)0x0 &&
              ((puVar11[0x20] != uVar6 || (puVar12 = puVar11, *puVar11 != uVar6))));
              puVar11 = *(uint **)(puVar11 + 0x1e)) {
          }
        }
        puVar11 = puVar19;
        if (puVar12 != (uint *)0x0) {
          if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          puVar11 = (uint *)(ulonglong)puVar12[4];
        }
        iVar18 = (int)puVar11;
        iVar5 = FUN_140199700(param_1,puVar11);
        if (iVar5 == 0) {
          local_res18 = (void *)CONCAT44(local_res18._4_4_,0x23);
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar7 + 0x8b0))
                    (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_res18);
        }
        else {
          if (0 < iVar18) {
            FUN_14011f210(local_138);
            local_130 = *(undefined4 *)(param_1 + 0x160);
            local_12c = *(undefined4 *)(param_1 + 0x164);
            local_128 = *(undefined4 *)(param_1 + 0x168);
            local_124 = *(undefined4 *)(param_1 + 0x16c);
            local_120 = *(undefined4 *)(param_1 + 0x170);
            local_11c = *(undefined4 *)(param_1 + 0x174);
            local_118 = *(undefined4 *)(param_1 + 0x178);
            local_114 = *(undefined4 *)(param_1 + 0x17c);
            lVar8 = FUN_140174f50(param_1 + 0x6e0);
            pwVar13 = (wchar_t *)(lVar8 + 0xd0);
            if (7 < *(ulonglong *)(lVar8 + 0xe8)) {
              pwVar13 = *(wchar_t **)pwVar13;
            }
            sVar9 = wcsnlen(pwVar13,0x10);
            if (sVar9 < 0x10) {
              lVar8 = FUN_140174f50(param_1 + 0x6e0);
              pwVar13 = (wchar_t *)(lVar8 + 0xd0);
              if (7 < *(ulonglong *)(lVar8 + 0xe8)) {
                pwVar13 = *(wchar_t **)pwVar13;
              }
              wcscpy_s(local_110,0x10,pwVar13);
            }
            strcpy_s(local_a0,0x32,(char *)(param_1 + 0x330));
            local_b0 = 3;
            lVar8 = FUN_140174f00(param_1 + 0x6c0);
            local_ac = *(undefined4 *)(lVar8 + 0x50a0);
            local_a8 = iVar18;
            FUN_140197b90(param_1,-iVar18);
            lVar8 = FUN_140174f00(param_1 + 0x6c0);
            local_a4 = *(undefined4 *)(lVar8 + 0x50a0);
            FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                          *(undefined4 *)(param_1 + 0x284),local_138);
            lVar8 = FUN_140174f00(param_1 + 0x6c0);
            uVar2 = *(undefined4 *)(lVar8 + 0x50a0);
            lVar8 = FUN_140174f00(param_1 + 0x6c0);
            FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x196,0x58,0,
                          *(int *)(lVar8 + 0x50a0) + iVar18,uVar2,iVar18,0);
          }
          uVar10 = FUN_140141af0();
          iVar5 = FUN_1401419b0(uVar10);
          local_res18 = (void *)CONCAT44(local_res18._4_4_,iVar5);
          if (0 < iVar5) {
            local_188 = (uint *)0x0;
            local_180 = (uint *)0x0;
            local_178 = (uint *)0x0;
            puVar12 = puVar19;
            puVar11 = puVar19;
            puVar20 = puVar19;
            do {
              puVar17 = local_180;
              uVar10 = FUN_1401417a0();
              uVar6 = FUN_1401416c0(uVar10,*local_res10);
              local_res8[0] = uVar6;
              if ((local_res8 < puVar17) && (puVar12 <= local_res8)) {
                lVar8 = (longlong)local_res8 - (longlong)puVar12;
                if (puVar17 == puVar11) {
                  uVar14 = (longlong)puVar17 - (longlong)puVar12 >> 2;
                  if (0x3ffffffffffffffe < uVar14) {
                    std::_Xlength_error("vector<T> too long");
                    pcVar4 = (code *)swi(3);
                    uVar10 = (*pcVar4)();
                    return uVar10;
                  }
                  puVar15 = (uint *)(uVar14 + 1);
                  puVar16 = (uint *)((longlong)puVar11 - (longlong)puVar12 >> 2);
                  if (puVar16 < puVar15) {
                    puVar12 = puVar19;
                    if (puVar16 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar16 >> 1))) {
                      puVar12 = (uint *)((longlong)puVar16 + ((ulonglong)puVar16 >> 1));
                    }
                    if (puVar12 < puVar15) {
                      puVar12 = puVar15;
                    }
                    FUN_140051e60(&local_188,puVar12);
                    puVar17 = local_180;
                    puVar12 = local_188;
                    puVar11 = local_178;
                  }
                }
                if (puVar17 != (uint *)0x0) {
                  *puVar17 = puVar12[lVar8 >> 2];
                }
              }
              else {
                if (puVar17 == puVar11) {
                  uVar14 = (longlong)puVar17 - (longlong)puVar12 >> 2;
                  if (0x3ffffffffffffffe < uVar14) {
                    std::_Xlength_error("vector<T> too long");
                    pcVar4 = (code *)swi(3);
                    uVar10 = (*pcVar4)();
                    return uVar10;
                  }
                  puVar15 = (uint *)(uVar14 + 1);
                  puVar16 = (uint *)((longlong)puVar11 - (longlong)puVar12 >> 2);
                  if (puVar16 < puVar15) {
                    puVar12 = puVar19;
                    if (puVar16 <= (uint *)(0x3fffffffffffffff - ((ulonglong)puVar16 >> 1))) {
                      puVar12 = (uint *)((longlong)puVar16 + ((ulonglong)puVar16 >> 1));
                    }
                    if (puVar12 < puVar15) {
                      puVar12 = puVar15;
                    }
                    FUN_140051e60(&local_188,puVar12);
                    puVar17 = local_180;
                    puVar12 = local_188;
                    puVar11 = local_178;
                  }
                }
                if (puVar17 != (uint *)0x0) {
                  *puVar17 = uVar6;
                }
              }
              puVar17 = puVar17 + 1;
              uVar6 = (int)puVar20 + 1;
              puVar20 = (uint *)(ulonglong)uVar6;
              local_180 = puVar17;
            } while ((int)uVar6 < (int)local_res18);
            local_168 = (longlong *)0x0;
            local_res18 = operator_new(0x850);
            puVar11 = puVar19;
            if (local_res18 != (void *)0x0) {
              puVar11 = (uint *)FUN_1401e64f0(local_res18);
            }
            if (puVar11 == (uint *)0x0) {
              local_168 = (longlong *)0x0;
            }
            else {
              local_168 = operator_new(0x10);
              *local_168 = (longlong)puVar11;
              *(undefined4 *)(local_168 + 1) = 1;
            }
            plVar7 = local_168;
            local_160 = local_168;
            if ((local_168 != (longlong *)0x0) && (*local_168 != 0)) {
              if (*(longlong **)(param_1 + 0x6d0) != local_168) {
                FUN_1401dede0(param_1 + 0x6d0);
                *(longlong **)(param_1 + 0x6d0) = plVar7;
                *(longlong **)(param_1 + 0x6d8) = plVar7;
                LOCK();
                *(int *)(plVar7 + 1) = (int)plVar7[1] + 1;
                UNLOCK();
                puVar17 = local_180;
                puVar12 = local_188;
              }
              puVar11 = (uint *)((longlong)puVar17 - (longlong)puVar12 >> 2);
              if (puVar11 != (uint *)0x0) {
                plVar7 = local_168 + 1;
                do {
                  LOCK();
                  *(int *)plVar7 = (int)*plVar7 + 1;
                  UNLOCK();
                  local_158 = local_168;
                  local_150 = local_168;
                  FUN_1401ac730(param_1,&local_158,*puVar12);
                  puVar19 = (uint *)(ulonglong)((int)puVar19 + 1);
                  puVar12 = puVar12 + 1;
                } while (puVar19 < puVar11);
              }
              plVar7 = local_168;
              FUN_1401e6d90(*local_168,*local_res10,param_1);
              plVar1 = local_168;
              LOCK();
              plVar7 = plVar7 + 1;
              *(int *)plVar7 = (int)*plVar7 + -1;
              UNLOCK();
              if ((int)*plVar7 == 0) {
                pvVar3 = (void *)*local_168;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0x818);
                  operator_delete(pvVar3);
                }
                operator_delete(plVar1);
              }
              if (local_188 != (uint *)0x0) {
                operator_delete(local_188);
              }
              return 1;
            }
            if (local_168 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_168 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              puVar12 = local_188;
              if ((int)*plVar1 == 0) {
                pvVar3 = (void *)*local_168;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0x818);
                  operator_delete(pvVar3);
                }
                operator_delete(plVar7);
                puVar12 = local_188;
              }
            }
            if (puVar12 != (uint *)0x0) {
              operator_delete(puVar12);
            }
          }
        }
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar21 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



void FUN_1401ac730(undefined8 param_1,longlong *param_2,undefined4 param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined4 *puVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  bool bVar7;
  undefined1 local_d0 [24];
  undefined4 local_b8;
  undefined4 uStack_b4;
  undefined4 uStack_b0;
  undefined4 uStack_ac;
  undefined4 local_a0;
  undefined2 local_9c;
  undefined4 local_94;
  undefined4 local_10;
  
  plVar1 = (longlong *)*param_2;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_2[1]) {
      if (*plVar1 != 0) {
        FUN_14000a170(&local_b8);
        uVar6 = 0;
        local_10 = 0;
        puVar4 = (undefined4 *)FUN_140357570(local_d0);
        local_b8 = *puVar4;
        uStack_b4 = puVar4[1];
        uStack_b0 = puVar4[2];
        uStack_ac = puVar4[3];
        local_9c = 1;
        local_a0 = param_3;
        uVar5 = FUN_140137690();
        iVar3 = FUN_140136b30(uVar5,param_3);
        if (iVar3 == 1) {
          uVar5 = FUN_140137690();
          local_94 = FUN_140136bb0(uVar5,param_3);
        }
        puVar2 = (undefined8 *)*param_2;
        if (puVar2 != (undefined8 *)0x0) {
          if (puVar2 == (undefined8 *)param_2[1]) {
            uVar6 = *puVar2;
          }
          else {
            iVar3 = DAT_1406080c4 + 1;
            bVar7 = DAT_1406080c4 == 0;
            DAT_1406080c4 = iVar3;
            if (bVar7) {
              FUN_140176d60(1);
            }
          }
        }
        FUN_1401e6560(uVar6,&local_b8,param_1,0x19a,0x84);
      }
    }
    else {
      iVar3 = DAT_1406080c4 + 1;
      bVar7 = DAT_1406080c4 == 0;
      DAT_1406080c4 = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1401dede0(param_2);
  return;
}



// WARNING: Type propagation algorithm not settling

undefined1 FUN_1401ac870(longlong param_1,longlong param_2)

{
  int *piVar1;
  ulonglong *puVar2;
  void *pvVar3;
  undefined8 *puVar4;
  short sVar5;
  char cVar6;
  undefined1 uVar7;
  int iVar8;
  int iVar9;
  undefined4 uVar10;
  uint uVar11;
  undefined4 uVar12;
  undefined4 uVar13;
  longlong lVar14;
  undefined8 uVar15;
  undefined4 *puVar16;
  longlong *plVar17;
  longlong *plVar18;
  longlong lVar19;
  ulonglong uVar20;
  ulonglong uVar21;
  longlong lVar22;
  bool bVar23;
  bool bVar24;
  bool bVar25;
  undefined4 extraout_XMM0_Da;
  uint local_res8 [2];
  longlong local_res18;
  undefined2 local_res20 [4];
  ulonglong in_stack_fffffffffffffd98;
  undefined4 uVar26;
  undefined8 in_stack_fffffffffffffda0;
  undefined4 *in_stack_fffffffffffffda8;
  undefined8 in_stack_fffffffffffffdb0;
  undefined4 *puVar27;
  undefined8 in_stack_fffffffffffffdb8;
  undefined4 uVar28;
  ulonglong local_238;
  longlong *local_228;
  longlong *local_220;
  undefined2 local_218 [2];
  undefined4 local_214;
  undefined2 local_210 [4];
  undefined4 local_208 [2];
  undefined4 local_200 [2];
  undefined4 local_1f8 [2];
  int local_1f0 [2];
  undefined4 local_1e8 [2];
  undefined4 local_1e0 [2];
  undefined4 local_1d8 [2];
  int local_1d0 [4];
  longlong *local_1c0;
  longlong *local_1b8;
  undefined4 local_1b0;
  undefined4 uStack_1ac;
  undefined4 local_1a8;
  undefined4 uStack_1a4;
  undefined4 local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_128;
  undefined4 uStack_124;
  undefined4 uStack_120;
  undefined4 uStack_11c;
  undefined1 local_118 [4];
  short local_114;
  short local_112;
  int local_110;
  short local_10c [8];
  undefined1 local_fc [4];
  undefined1 local_f8 [12];
  undefined1 local_ec [90];
  undefined2 local_92;
  undefined4 local_80;
  longlong local_78;
  undefined1 local_70;
  undefined8 local_68;
  undefined1 local_60 [16];
  undefined1 local_50 [24];
  
  uVar12 = (undefined4)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffdb0 >> 0x20);
  uVar28 = (undefined4)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
  local_68 = 0xfffffffffffffffe;
  uVar20 = 0;
  iVar9 = 0;
  local_238 = 0;
  bVar24 = false;
  bVar25 = false;
  puVar2 = *(ulonglong **)(param_1 + 0xb28);
  if (puVar2 != (ulonglong *)0x0) {
    if (puVar2 == *(ulonglong **)(param_1 + 0xb30)) {
      if (*puVar2 != 0) {
        local_238 = *puVar2;
        if ((puVar2 != *(ulonglong **)(param_1 + 0xb30)) &&
           (iVar8 = DAT_1406080a8 + 1, bVar25 = DAT_1406080a8 == 0, local_238 = uVar20,
           DAT_1406080a8 = iVar8, bVar25)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(local_238);
        bVar24 = true;
        bVar25 = true;
      }
    }
    else {
      iVar8 = DAT_1406080a8 + 1;
      bVar23 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar8;
      if (bVar23) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0xb50) == 0) {
LAB_1401ad95e:
    if (!bVar24) {
      return 0;
    }
    goto LAB_1401ad966;
  }
  FUN_140198570(param_1,&local_228);
  plVar17 = local_228;
  if (local_228 == (longlong *)0x0) {
LAB_1401ad901:
    if (plVar17 != (longlong *)0x0) {
      if (plVar17 == local_220) {
        LOCK();
        plVar17 = plVar17 + 1;
        lVar14 = *plVar17;
        *(int *)plVar17 = (int)*plVar17 + -1;
        UNLOCK();
        bVar24 = bVar25;
        if ((int)lVar14 == 1) {
          puVar4 = (undefined8 *)*local_228;
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)(puVar4,1);
          }
          operator_delete(local_228);
        }
      }
      else {
        iVar9 = DAT_140608054 + 1;
        bVar25 = DAT_140608054 == 0;
        DAT_140608054 = iVar9;
        if (bVar25) {
          FUN_140176d60(1);
        }
      }
    }
    goto LAB_1401ad95e;
  }
  if (local_228 != local_220) {
    iVar9 = DAT_14060804c + 1;
    bVar23 = DAT_14060804c == 0;
    DAT_14060804c = iVar9;
    if (bVar23) {
      FUN_140176d60(1);
    }
    goto LAB_1401ad901;
  }
  if ((longlong *)*local_228 == (longlong *)0x0) goto LAB_1401ad901;
  lVar14 = (**(code **)(*(longlong *)*local_228 + 0x270))();
  if (lVar14 == 0) {
    LOCK();
    plVar17 = plVar17 + 1;
    *(int *)plVar17 = (int)*plVar17 + -1;
    UNLOCK();
    if ((int)*plVar17 == 0) {
      puVar4 = (undefined8 *)*local_228;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      operator_delete(local_228);
    }
    goto joined_r0x0001401ac9da;
  }
  uVar15 = FUN_140137690();
  uVar10 = FUN_1401369d0(uVar15,*(undefined4 *)(param_2 + 0x18));
  uVar26 = (undefined4)(in_stack_fffffffffffffd98 >> 0x20);
  switch(uVar10) {
  case 0xc:
    local_180 = *(undefined4 *)(param_1 + 0x170);
    local_17c = *(undefined4 *)(param_1 + 0x174);
    local_178 = *(undefined4 *)(param_1 + 0x178);
    local_174 = *(undefined4 *)(param_1 + 0x17c);
    iVar9 = *(int *)(param_1 + 0x284);
    local_1d0[2] = *(undefined4 *)(param_1 + 8);
    if (((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
       (lVar14 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar14 != 0)) {
      local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar9);
      plVar18 = (longlong *)
                (*(longlong *)(*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                + 0x70);
      (**(code **)(*plVar18 + 0xe0))(plVar18,1,&DAT_1405d85a0,local_res8,local_1d0 + 2,&local_180);
    }
    break;
  case 0xf:
    *(undefined8 *)(lVar14 + 0x20) = 0;
    *(undefined8 *)(lVar14 + 0x30) = 0;
    *(undefined8 *)(lVar14 + 0x38) = 0;
    *(undefined8 *)(lVar14 + 0x40) = 0;
    *(undefined8 *)(lVar14 + 0x48) = 0;
    *(undefined8 *)(lVar14 + 0x28) = 0;
    local_1b0 = *(undefined4 *)(param_1 + 0x170);
    uStack_1ac = *(undefined4 *)(param_1 + 0x174);
    local_1a8 = *(undefined4 *)(param_1 + 0x178);
    uStack_1a4 = *(undefined4 *)(param_1 + 0x17c);
    iVar8 = *(int *)(param_1 + 0x284);
    if ((-1 < iVar8) && (iVar8 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
      if ((*(longlong *)(param_1 + 0x170) != 0) || (*(longlong *)(param_1 + 0x178) != 0)) {
        iVar9 = 1;
      }
      if ((iVar9 != 0) &&
         (lVar22 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar22 != 0)) {
        local_res18 = CONCAT62(local_res18._2_6_,(short)iVar8);
        plVar18 = (longlong *)
                  (*(longlong *)
                    (*(longlong *)(lVar22 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
        (**(code **)(*plVar18 + 0xbf0))(plVar18,1,&DAT_1405d85a0,&local_res18,&local_1b0);
      }
    }
    plVar18 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
    (**(code **)(*plVar18 + 0x410))
              (plVar18,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,(undefined4 *)(param_1 + 8),
               lVar14);
    break;
  case 0x10:
    uVar15 = FUN_140137690();
    uVar12 = FUN_140137640(uVar15,*(undefined4 *)(param_2 + 0x18));
    uVar15 = FUN_140137690();
    iVar8 = FUN_140137640(uVar15,uVar12);
    if (iVar8 <= *(int *)(lVar14 + 0x78)) {
      iVar8 = *(int *)(lVar14 + 0x78) - iVar8;
      if (iVar8 < 0) {
        iVar8 = iVar9;
      }
      *(int *)(lVar14 + 0x78) = iVar8;
      local_150 = *(undefined4 *)(param_1 + 0x170);
      local_14c = *(undefined4 *)(param_1 + 0x174);
      local_148 = *(undefined4 *)(param_1 + 0x178);
      local_144 = *(undefined4 *)(param_1 + 0x17c);
      FUN_1401fc6e0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                    *(undefined4 *)(param_1 + 0x284),&local_150,CONCAT44(uVar26,iVar8),1);
      plVar18 = (longlong *)FUN_140174f50(param_1 + 0x6e0);
      lVar14 = (**(code **)(*plVar18 + 0x270))(plVar18);
      FUN_140173b60(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 8),
                    *(undefined4 *)(param_1 + 8),*(undefined4 *)(lVar14 + 0x78));
      break;
    }
    LOCK();
    plVar17 = plVar17 + 1;
    *(int *)plVar17 = (int)*plVar17 + -1;
    UNLOCK();
    if ((int)*plVar17 == 0) {
      puVar4 = (undefined8 *)*local_228;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      operator_delete(local_228);
    }
    goto joined_r0x0001401ac9da;
  case 0x12:
  case 0x40:
    uVar21 = 0;
    uVar15 = FUN_140137690();
    iVar9 = FUN_1401369d0(uVar15,*(undefined4 *)(param_2 + 0x18));
    if (iVar9 == 0x12) {
      lVar14 = FUN_1401dea30(param_1 + 0x9d0);
      uVar21 = uVar20;
      if (lVar14 != 0) {
        lVar14 = FUN_1401dea30(param_1 + 0x9d0);
        iVar9 = *(int *)(lVar14 + 0x9124);
        uVar15 = FUN_140137690();
        iVar8 = FUN_140137640(uVar15,*(undefined4 *)(param_2 + 0x18));
LAB_1401acc69:
        uVar21 = (ulonglong)(uint)(iVar9 + iVar8);
        if (0xb4 < iVar9 + iVar8) {
          LOCK();
          plVar17 = plVar17 + 1;
          *(int *)plVar17 = (int)*plVar17 + -1;
          UNLOCK();
          if ((int)*plVar17 == 0) {
            puVar4 = (undefined8 *)*local_228;
            if (puVar4 != (undefined8 *)0x0) {
              (**(code **)*puVar4)(puVar4,1);
            }
            operator_delete(local_228);
          }
          goto joined_r0x0001401ac9da;
        }
      }
    }
    else {
      lVar14 = FUN_1401dea30(param_1 + 0x9f0);
      if (lVar14 != 0) {
        lVar14 = FUN_1401dea30(param_1 + 0x9f0);
        iVar9 = *(int *)(lVar14 + 0x9124);
        uVar15 = FUN_140137690();
        iVar8 = FUN_140137640(uVar15,*(undefined4 *)(param_2 + 0x18));
        uVar20 = 1;
        goto LAB_1401acc69;
      }
    }
    FUN_1401a3cb0(param_1,uVar21,uVar20);
    break;
  case 0x15:
    uVar15 = FUN_140137690();
    iVar9 = FUN_140137640(uVar15,*(undefined4 *)(param_2 + 0x18));
    if (*(int *)(lVar14 + 0x7c) + iVar9 < 1000) {
      FUN_1401a5fd0(param_1,iVar9);
      break;
    }
    LOCK();
    plVar17 = plVar17 + 1;
    *(int *)plVar17 = (int)*plVar17 + -1;
    UNLOCK();
    if ((int)*plVar17 == 0) {
      puVar4 = (undefined8 *)*local_228;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      operator_delete(local_228);
    }
    goto joined_r0x0001401ac9da;
  case 0x18:
    uVar15 = FUN_140137690();
    iVar9 = FUN_140137640(uVar15,*(undefined4 *)(param_2 + 0x18));
    piVar1 = (int *)(lVar14 + 0x78);
    *piVar1 = *piVar1 + iVar9;
    if (*piVar1 < 0) {
      *(undefined4 *)(lVar14 + 0x78) = 0;
    }
    iVar9 = *(int *)(lVar14 + 0x78);
    if (1000 < iVar9) {
      iVar9 = 1000;
    }
    *(int *)(lVar14 + 0x78) = iVar9;
    local_160 = *(undefined4 *)(param_1 + 0x170);
    local_15c = *(undefined4 *)(param_1 + 0x174);
    local_158 = *(undefined4 *)(param_1 + 0x178);
    local_154 = *(undefined4 *)(param_1 + 0x17c);
    FUN_1401fc6e0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                  *(undefined4 *)(param_1 + 0x284),&local_160,CONCAT44(uVar26,iVar9),1);
    plVar18 = (longlong *)FUN_140174f50(param_1 + 0x6e0);
    lVar14 = (**(code **)(*plVar18 + 0x270))(plVar18);
    FUN_140173b60(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 8),
                  *(undefined4 *)(param_1 + 8),*(undefined4 *)(lVar14 + 0x78));
    break;
  case 0x1e:
  case 0x2c:
    FUN_140197b70(param_1,&local_1c0);
    plVar18 = local_1c0;
    if (local_1c0 != (longlong *)0x0) {
      if (local_1c0 == local_1b8) {
        if (*local_1c0 != 0) {
          FUN_14000a170(&local_128);
          local_80 = 0;
          cVar6 = FUN_1401f61c0(*(undefined4 *)(param_2 + 0x18),local_118,&local_110,local_10c,
                                in_stack_fffffffffffffd98 & 0xffffffff00000000);
          if (cVar6 != '\0') {
            uVar15 = FUN_140137690();
            uVar10 = FUN_140136d80(uVar15,*(undefined4 *)(param_2 + 0x18));
            puVar16 = (undefined4 *)FUN_140357570(local_50);
            local_128 = *puVar16;
            uStack_124 = puVar16[1];
            uStack_120 = puVar16[2];
            uStack_11c = puVar16[3];
            uVar15 = FUN_140137690();
            local_114 = FUN_140136b30(uVar15,local_110);
            if (local_114 == 1) {
              local_92 = 3;
              FUN_1401a40e0(&local_128);
            }
            if (((local_114 == 5) || (local_114 == 1)) || (local_114 == 2)) {
              uVar15 = FUN_140137690();
              iVar8 = FUN_1401369d0(uVar15,local_110);
              if ((iVar8 == 0) || (iVar8 == 0x17)) {
                uVar15 = FUN_140137690();
                in_stack_fffffffffffffda8 =
                     (undefined4 *)((ulonglong)in_stack_fffffffffffffda8 & 0xffffffff00000000);
                FUN_140136f10(uVar15,local_110,local_fc,local_f8,local_ec,CONCAT44(uVar12,uVar10),
                              in_stack_fffffffffffffda8);
              }
            }
            if (local_114 == 5) {
              local_1d0[1] = 0xffffffff;
              uVar15 = FUN_140174f00(param_1 + 0x6c0);
              FUN_1401e8ba0(uVar15,local_60,&local_128,local_1d0 + 1);
            }
            else {
              local_1d0[0] = (int)local_114;
              if ((local_114 < 0) ||
                 (iVar8 = FUN_1401eea90(*plVar18,local_1d0), sVar5 = local_114, iVar8 < 0)) {
                LOCK();
                plVar18 = plVar18 + 1;
                *(int *)plVar18 = (int)*plVar18 + -1;
                UNLOCK();
                if ((int)*plVar18 == 0) {
                  pvVar3 = (void *)*local_1c0;
                  if (pvVar3 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar3 + 0xf630);
                    operator_delete(pvVar3);
                  }
                  operator_delete(local_1c0);
                }
                LOCK();
                plVar17 = local_228 + 1;
                *(int *)plVar17 = (int)*plVar17 + -1;
                UNLOCK();
                if ((int)*plVar17 == 0) {
                  puVar4 = (undefined8 *)*local_228;
                  if (puVar4 != (undefined8 *)0x0) {
                    (**(code **)*puVar4)(puVar4,1);
                  }
                  operator_delete(local_228);
                }
                goto joined_r0x0001401ac9da;
              }
              local_112 = (short)iVar8;
              local_res8[0] = (uint)local_112;
              lVar22 = (longlong)local_114;
              local_res18 = FUN_140174f00(param_1 + 0x6c0);
              lVar14 = local_res18 + 0xf630;
              local_78 = lVar14;
              FUN_14034ed40(lVar14);
              local_70 = 1;
              if (((uint)(int)sVar5 < 5) && (local_res8[0] < 0x18)) {
                uVar15 = FUN_140137690();
                uVar11 = FUN_140136b30(uVar15,local_110);
                if ((int)sVar5 == uVar11) {
                  lVar19 = (longlong)(int)local_res8[0];
                  iVar8 = FUN_14011b180((lVar19 + lVar22 * 0x18) * 0xac + local_res18);
                  if (iVar8 != 0) {
                    local_112 = (short)lVar19;
                    local_114 = sVar5;
                    FUN_140090020(extraout_XMM0_Da,&local_128);
                  }
                }
              }
              FUN_14034edd0(lVar14);
            }
            local_214 = 0x23;
            uVar15 = FUN_140137690();
            iVar8 = FUN_1401369d0(uVar15,*(undefined4 *)(param_2 + 0x18));
            if (iVar8 == 0x2c) {
              plVar17 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar17 + 0xb40))
                        (plVar17,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_128);
              local_214 = 0x28;
            }
            else {
              uVar15 = FUN_140137690();
              iVar8 = FUN_1401369d0(uVar15,*(undefined4 *)(param_2 + 0x18));
              if (iVar8 == 0x1e) {
                plVar17 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                (**(code **)(*plVar17 + 0xd0))
                          (plVar17,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_128);
                local_214 = 0x27;
              }
            }
            local_140 = *(undefined4 *)(param_1 + 0x160);
            local_13c = *(undefined4 *)(param_1 + 0x164);
            local_138 = *(undefined4 *)(param_1 + 0x168);
            local_134 = *(undefined4 *)(param_1 + 0x16c);
            local_1a0 = *(undefined4 *)(param_1 + 0x170);
            local_19c = *(undefined4 *)(param_1 + 0x174);
            local_198 = *(undefined4 *)(param_1 + 0x178);
            local_194 = *(undefined4 *)(param_1 + 0x17c);
            iVar8 = *(int *)(param_1 + 0x284);
            local_1f8[0] = *(undefined4 *)(param_1 + 8);
            if ((-1 < iVar8) && (iVar8 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
              if ((CONCAT44(uStack_124,local_128) != 0) || (CONCAT44(uStack_11c,uStack_120) != 0)) {
                iVar9 = 1;
              }
              if (((iVar9 != 0) && (local_110 != 0)) &&
                 (lVar14 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar14 != 0)) {
                local_res20[0] = (undefined2)iVar8;
                plVar17 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                          0x70);
                puVar16 = &local_128;
                puVar27 = &local_214;
                in_stack_fffffffffffffda8 = &local_140;
                (**(code **)(*plVar17 + 0xb0))
                          (plVar17,1,&DAT_1405d85a0,local_res20,local_1f8,&local_1a0,
                           in_stack_fffffffffffffda8,puVar27,puVar16);
                uVar13 = (undefined4)((ulonglong)puVar27 >> 0x20);
                uVar28 = (undefined4)((ulonglong)puVar16 >> 0x20);
              }
            }
            plVar17 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar17 + 0xc0))
                      (plVar17,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_114,&local_112,
                       &local_128);
            FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c8,0x34,param_1,&local_128,1,
                          (ulonglong)in_stack_fffffffffffffda8 & 0xffffffff00000000,
                          CONCAT44(uVar13,local_10c[0] + -1),CONCAT44(uVar28,(int)local_10c[0]));
            LOCK();
            plVar18 = plVar18 + 1;
            lVar14 = *plVar18;
            *(int *)plVar18 = (int)*plVar18 + -1;
            UNLOCK();
            plVar17 = local_228;
            if ((int)lVar14 == 1) {
              pvVar3 = (void *)*local_1c0;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0xf630);
                operator_delete(pvVar3);
              }
              operator_delete(local_1c0);
              plVar17 = local_228;
            }
            break;
          }
          printf("ItemRule::c_nRandomRune Invalid - Use Item [ %d ], Item [ %d ]\n");
          LOCK();
          plVar18 = plVar18 + 1;
          *(int *)plVar18 = (int)*plVar18 + -1;
          UNLOCK();
          if ((int)*plVar18 == 0) {
            pvVar3 = (void *)*local_1c0;
            if (pvVar3 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar3 + 0xf630);
              operator_delete(pvVar3);
            }
            operator_delete(local_1c0);
          }
          LOCK();
          plVar17 = local_228 + 1;
          *(int *)plVar17 = (int)*plVar17 + -1;
          UNLOCK();
          if ((int)*plVar17 == 0) {
            puVar4 = (undefined8 *)*local_228;
            if (puVar4 != (undefined8 *)0x0) {
              (**(code **)*puVar4)(puVar4,1);
            }
            operator_delete(local_228);
          }
          goto joined_r0x0001401ac9da;
        }
      }
      else {
        iVar9 = DAT_140608048 + 1;
        bVar24 = DAT_140608048 == 0;
        DAT_140608048 = iVar9;
        if (bVar24) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar18 != (longlong *)0x0) {
      if (plVar18 == local_1b8) {
        LOCK();
        plVar18 = plVar18 + 1;
        lVar14 = *plVar18;
        *(int *)plVar18 = (int)*plVar18 + -1;
        UNLOCK();
        plVar17 = local_228;
        if ((int)lVar14 == 1) {
          pvVar3 = (void *)*local_1c0;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_1c0);
          plVar17 = local_228;
        }
      }
      else {
        iVar9 = DAT_140608050 + 1;
        bVar24 = DAT_140608050 == 0;
        DAT_140608050 = iVar9;
        if (bVar24) {
          FUN_140176d60(1);
        }
      }
    }
    LOCK();
    plVar17 = plVar17 + 1;
    *(int *)plVar17 = (int)*plVar17 + -1;
    UNLOCK();
    if ((int)*plVar17 == 0) {
      puVar4 = (undefined8 *)*local_228;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      operator_delete(local_228);
    }
    goto joined_r0x0001401ac9da;
  case 0x26:
    uVar15 = FUN_140137690();
    uVar12 = FUN_140137640(uVar15,*(undefined4 *)(param_2 + 0x18));
    uVar15 = FUN_140137690();
    uVar13 = FUN_140137490(uVar15,*(undefined4 *)(param_2 + 0x18));
    uVar7 = FUN_14020c100(*plVar17,uVar12,uVar13);
    LOCK();
    plVar17 = plVar17 + 1;
    *(int *)plVar17 = (int)*plVar17 + -1;
    UNLOCK();
    if ((int)*plVar17 == 0) {
      puVar4 = (undefined8 *)*local_228;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      operator_delete(local_228);
    }
    if (bVar25) {
      FUN_14034edd0(local_238);
      return uVar7;
    }
    return uVar7;
  case 0x27:
    uVar12 = 1;
    if (*(longlong *)(param_1 + 0xb58) != 0) {
      uVar12 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
    }
    FUN_140185230(*(undefined8 *)(param_1 + 0xb50),param_1);
    FUN_14019c070(param_1,uVar12);
    break;
  case 0x28:
    uVar12 = 1;
    if (*(longlong *)(param_1 + 0xb58) != 0) {
      uVar12 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
    }
    FUN_140185870(*(undefined8 *)(param_1 + 0xb50),param_1);
    FUN_14019c070(param_1,uVar12);
    break;
  case 0x2a:
    uVar12 = 1;
    if (*(longlong *)(param_1 + 0xb58) != 0) {
      uVar12 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
    }
    FUN_1401855b0(*(undefined8 *)(param_1 + 0xb50),param_1);
    FUN_14019c070(param_1,uVar12);
    break;
  case 0x2d:
    uVar7 = FUN_1401db560(param_1,*(undefined4 *)(param_2 + 0x18));
    LOCK();
    plVar17 = plVar17 + 1;
    *(int *)plVar17 = (int)*plVar17 + -1;
    UNLOCK();
    if ((int)*plVar17 == 0) {
      puVar4 = (undefined8 *)*local_228;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      operator_delete(local_228);
    }
    if (bVar25) {
      FUN_14034edd0(local_238);
      return uVar7;
    }
    return uVar7;
  case 0x3e:
    if (*(int *)(lVar14 + 0x150) == 1) {
      *(undefined4 *)(lVar14 + 0x150) = 2;
      FUN_14020faa0(DAT_140608078,param_1);
      local_190 = *(undefined4 *)(param_1 + 0x170);
      local_18c = *(undefined4 *)(param_1 + 0x174);
      local_188 = *(undefined4 *)(param_1 + 0x178);
      local_184 = *(undefined4 *)(param_1 + 0x17c);
      iVar9 = *(int *)(param_1 + 0x284);
      local_1d8[0] = 2;
      if (((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
         (lVar14 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar14 != 0)) {
        local_218[0] = (undefined2)iVar9;
        plVar18 = (longlong *)
                  (*(longlong *)
                    (*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
        (**(code **)(*plVar18 + 0xf80))(plVar18,1,&DAT_1405d85a0,local_218,&local_190,local_1d8);
      }
      local_1e8[0] = 2;
      plVar18 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar18 + 0xdb0))
                (plVar18,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,(undefined4 *)(param_1 + 8),
                 local_1e8);
      break;
    }
    LOCK();
    plVar17 = plVar17 + 1;
    *(int *)plVar17 = (int)*plVar17 + -1;
    UNLOCK();
    if ((int)*plVar17 == 0) {
      puVar4 = (undefined8 *)*local_228;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      operator_delete(local_228);
    }
joined_r0x0001401ac9da:
    if (bVar25) {
LAB_1401ad966:
      FUN_14034edd0(local_238);
    }
    return 0;
  case 0x41:
    uVar15 = FUN_140137690();
    iVar8 = FUN_140137640(uVar15,*(undefined4 *)(param_2 + 0x18));
    uVar12 = 0;
    *(int *)(param_1 + 0x5f0) = iVar8 + *(int *)(param_1 + 0x5f0);
    lVar14 = FUN_1401dea30(param_1 + 0x9f0);
    if (lVar14 != 0) {
      lVar14 = FUN_1401dea30(param_1 + 0x9f0);
      iVar9 = *(int *)(lVar14 + 0x9124);
      lVar14 = FUN_1401dea30(param_1 + 0x9f0);
      uVar12 = *(undefined4 *)(lVar14 + 0x9120);
    }
    local_208[0] = *(undefined4 *)(param_1 + 0x5f0);
    local_170 = *(undefined4 *)(param_1 + 0x160);
    local_16c = *(undefined4 *)(param_1 + 0x164);
    local_168 = *(undefined4 *)(param_1 + 0x168);
    local_164 = *(undefined4 *)(param_1 + 0x16c);
    iVar8 = *(int *)(param_1 + 0x284);
    local_1e0[0] = *(undefined4 *)(param_1 + 8);
    local_200[0] = uVar12;
    local_1f0[0] = iVar9;
    if (((-1 < iVar8) && (iVar8 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
       (lVar14 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar14 != 0)) {
      local_210[0] = (undefined2)iVar8;
      plVar18 = (longlong *)
                (*(longlong *)(*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                + 0x70);
      (**(code **)(*plVar18 + 0xfe0))
                (plVar18,1,&DAT_1405d85a0,local_210,local_1e0,&local_170,local_1f0,local_200,
                 local_208);
    }
  }
  LOCK();
  plVar17 = plVar17 + 1;
  *(int *)plVar17 = (int)*plVar17 + -1;
  UNLOCK();
  if ((int)*plVar17 == 0) {
    puVar4 = (undefined8 *)*local_228;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_228);
  }
  if (bVar25) {
    FUN_14034edd0(local_238);
  }
  return 1;
}



void FUN_1401ada00(longlong param_1,short *param_2,int param_3)

{
  short *psVar1;
  short sVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  bool bVar11;
  bool bVar12;
  int local_res8 [2];
  int local_res20 [2];
  short *psVar13;
  short *psVar15;
  undefined4 *puVar16;
  undefined4 uVar18;
  ulonglong uVar17;
  short *psVar19;
  undefined8 in_stack_ffffffffffffff70;
  undefined4 *puVar20;
  undefined4 uVar21;
  undefined8 in_stack_ffffffffffffff78;
  int *piVar22;
  undefined4 uVar23;
  undefined4 local_78 [2];
  undefined8 local_70;
  longlong *local_68;
  undefined1 local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 uVar14;
  
  uVar21 = (undefined4)((ulonglong)in_stack_ffffffffffffff70 >> 0x20);
  uVar23 = (undefined4)((ulonglong)in_stack_ffffffffffffff78 >> 0x20);
  local_70 = 0xfffffffffffffffe;
  plVar7 = (longlong *)0x0;
  plVar9 = (longlong *)0x0;
  local_68 = (longlong *)0x0;
  bVar12 = false;
  local_60 = 0;
  plVar8 = *(longlong **)(param_1 + 0xb28);
  plVar10 = plVar7;
  if (plVar8 != (longlong *)0x0) {
    plVar10 = plVar9;
    if (plVar8 == *(longlong **)(param_1 + 0xb30)) {
      if ((longlong *)*plVar8 != (longlong *)0x0) {
        plVar10 = (longlong *)*plVar8;
        if ((plVar8 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, plVar10 = plVar7,
           DAT_1406080a8 = iVar3, bVar12)) {
          FUN_140176d60(1);
        }
        local_60 = 0;
        local_68 = plVar10;
        FUN_14034ed40(plVar10);
        bVar12 = true;
        local_60 = 1;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  plVar8 = *(longlong **)(param_1 + 0x6c0);
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar8 != 0) {
        plVar8 = *(longlong **)(param_1 + 0x6e0);
        if (plVar8 != (longlong *)0x0) {
          if (plVar8 == *(longlong **)(param_1 + 0x6e8)) {
            plVar7 = (longlong *)*plVar8;
          }
          else {
            iVar3 = DAT_14060804c + 1;
            bVar11 = DAT_14060804c == 0;
            DAT_14060804c = iVar3;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
        lVar4 = (**(code **)(*plVar7 + 0x270))();
        if ((lVar4 != 0) && (param_3 < 0xc9)) {
          lVar5 = FUN_140174f50(param_1 + 0x6e0);
          if (lVar5 != 0) {
            if (*(int *)(lVar4 + 0x78) < param_3) goto LAB_1401ade54;
            *(int *)(lVar4 + 0xb8) = *(int *)(lVar4 + 0xb8) + param_3;
            param_3 = *(int *)(lVar4 + 0x78) - param_3;
            if (param_3 < 0) {
              param_3 = 0;
            }
            *(int *)(lVar4 + 0x78) = param_3;
          }
          psVar19 = param_2 + 0xe;
          *psVar19 = *psVar19 + -1;
          plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          psVar1 = param_2 + 0xb;
          psVar13 = param_2 + 10;
          psVar15 = psVar1;
          (**(code **)(*plVar8 + 0x290))
                    (plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2,psVar13,psVar1,
                     psVar19);
          uVar18 = (undefined4)((ulonglong)psVar15 >> 0x20);
          uVar14 = (undefined4)((ulonglong)psVar13 >> 0x20);
          if (param_2[0xe] < 1) {
            local_58 = *(undefined4 *)(param_1 + 0x160);
            local_54 = *(undefined4 *)(param_1 + 0x164);
            local_50 = *(undefined4 *)(param_1 + 0x168);
            local_4c = *(undefined4 *)(param_1 + 0x16c);
            local_48 = *(undefined4 *)(param_1 + 0x170);
            local_44 = *(undefined4 *)(param_1 + 0x174);
            local_40 = *(undefined4 *)(param_1 + 0x178);
            local_3c = *(undefined4 *)(param_1 + 0x17c);
            iVar3 = *(int *)(param_1 + 0x284);
            local_res20[0] = -1;
            local_78[0] = 0xfffffff6;
            if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
               (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
              local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar3);
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                       );
              piVar22 = local_res20;
              puVar20 = local_78;
              puVar16 = &local_58;
              psVar19 = param_2;
              (**(code **)(*plVar8 + 0x130))
                        (plVar8,1,&DAT_1405d85a0,local_res8,&local_48,puVar16,param_2,puVar20,
                         piVar22);
              uVar18 = (undefined4)((ulonglong)puVar16 >> 0x20);
              uVar21 = (undefined4)((ulonglong)puVar20 >> 0x20);
              uVar23 = (undefined4)((ulonglong)piVar22 >> 0x20);
            }
            local_res8[0] = (int)*psVar1;
            local_res20[0] = (int)param_2[10];
            uVar6 = FUN_140174f00(param_1 + 0x6c0);
            FUN_1401e9d60(uVar6,param_1,local_res20,local_res8,param_2);
          }
          else {
            local_res8[0] = (int)*psVar1;
            sVar2 = param_2[10];
            local_res20[0] = (int)sVar2;
            uVar6 = FUN_140174f00(param_1 + 0x6c0);
            if (-1 < sVar2) {
              FUN_1401ed220(uVar6,local_res20,local_res8,param_2,CONCAT44(uVar14,6));
            }
          }
          uVar17 = CONCAT44(uVar18,1);
          FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,param_2,uVar17,
                        (ulonglong)psVar19 & 0xffffffff00000000,CONCAT44(uVar21,param_2[0xe] + 1),
                        CONCAT44(uVar23,(int)param_2[0xe]));
          uVar21 = (undefined4)((ulonglong)param_2 >> 0x20);
          lVar5 = FUN_140174f50(param_1 + 0x6e0);
          if (lVar5 != 0) {
            local_48 = *(undefined4 *)(param_1 + 0x170);
            local_44 = *(undefined4 *)(param_1 + 0x174);
            local_40 = *(undefined4 *)(param_1 + 0x178);
            local_3c = *(undefined4 *)(param_1 + 0x17c);
            FUN_1401fc6e0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                          *(undefined4 *)(param_1 + 0x284),&local_48,
                          CONCAT44(uVar21,*(undefined4 *)(lVar4 + 0x78)),uVar17 & 0xffffffffffffff00
                         );
            local_48 = *(undefined4 *)(param_1 + 0x170);
            local_44 = *(undefined4 *)(param_1 + 0x174);
            local_40 = *(undefined4 *)(param_1 + 0x178);
            local_3c = *(undefined4 *)(param_1 + 0x17c);
            FUN_1401ff7a0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                          *(undefined4 *)(param_1 + 0x284),&local_48,*(undefined4 *)(lVar4 + 0xb8));
          }
          local_res8[0] = 1;
          local_res20[0] = 0x2b41;
          plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar8 + 0x70))
                    (plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,local_res8);
        }
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar11 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401ade54:
  if (bVar12) {
    FUN_14034edd0(plVar10);
  }
  return;
}



void FUN_1401ade80(longlong param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  bool bVar7;
  undefined4 local_res8 [2];
  undefined4 local_res18 [4];
  undefined8 in_stack_ffffffffffffffc8;
  undefined4 uVar8;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  
  uVar8 = (undefined4)((ulonglong)in_stack_ffffffffffffffc8 >> 0x20);
  plVar6 = *(longlong **)(param_1 + 0x6e0);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0x6e8)) {
      plVar5 = (longlong *)*plVar6;
      if (plVar5 != (longlong *)0x0) {
        if (plVar6 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar7 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar7) {
            FUN_140176d60();
          }
          plVar5 = (longlong *)0x0;
        }
        lVar3 = (**(code **)(*plVar5 + 0x270))();
        if (lVar3 == 0) {
          return;
        }
        if (*(int *)(lVar3 + 0xb8) < param_2) {
          return;
        }
        plVar6 = (longlong *)FUN_140174f50(param_1 + 0x6e0);
        lVar4 = (**(code **)(*plVar6 + 0x270))(plVar6);
        iVar2 = *(int *)(lVar4 + 0xb8);
        piVar1 = (int *)(lVar3 + 0x78);
        *piVar1 = *piVar1 + param_2;
        *(int *)(lVar3 + 0xb8) = iVar2 - param_2;
        if (*piVar1 < 0) {
          *(undefined4 *)(lVar3 + 0x78) = 0;
        }
        local_28 = *(undefined4 *)(param_1 + 0x170);
        local_24 = *(undefined4 *)(param_1 + 0x174);
        local_20 = *(undefined4 *)(param_1 + 0x178);
        local_1c = *(undefined4 *)(param_1 + 0x17c);
        FUN_1401fc6e0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                      *(undefined4 *)(param_1 + 0x284),&local_28,
                      CONCAT44(uVar8,*(undefined4 *)(lVar3 + 0x78)),0);
        local_28 = *(undefined4 *)(param_1 + 0x170);
        local_24 = *(undefined4 *)(param_1 + 0x174);
        local_20 = *(undefined4 *)(param_1 + 0x178);
        local_1c = *(undefined4 *)(param_1 + 0x17c);
        FUN_1401ff7a0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                      *(undefined4 *)(param_1 + 0x284),&local_28,*(undefined4 *)(lVar3 + 0xb8));
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  local_res8[0] = 1;
  plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  local_res18[0] = 0x2b42;
  (**(code **)(*plVar6 + 0x70))
            (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18,local_res8);
  return;
}



void FUN_1401ae040(longlong param_1,int *param_2,int *param_3,int *param_4,int *param_5)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  undefined4 local_res8 [2];
  int *local_res10;
  int *local_res18;
  undefined8 *puVar12;
  undefined4 *puVar13;
  undefined8 in_stack_fffffffffffffdf0;
  undefined4 uVar15;
  undefined4 *puVar14;
  undefined4 uVar16;
  ulonglong in_stack_fffffffffffffdf8;
  undefined8 in_stack_fffffffffffffe00;
  undefined4 uVar17;
  undefined8 in_stack_fffffffffffffe08;
  undefined4 uVar18;
  undefined4 local_1e8 [2];
  undefined8 local_1e0;
  undefined4 local_1d8;
  undefined4 local_1d4;
  undefined8 local_1d0;
  undefined4 local_1c8;
  undefined4 local_1c4;
  undefined4 local_1c0 [2];
  longlong local_1b8;
  undefined1 local_1b0;
  undefined8 local_1a8;
  longlong local_198;
  longlong local_190;
  int local_180;
  short local_17c [44];
  short local_124;
  undefined4 local_f0;
  longlong local_e8;
  longlong local_e0;
  short local_d4;
  int local_d0;
  short local_cc;
  undefined4 local_bc;
  undefined4 auStack_b8 [17];
  short local_74;
  undefined4 local_40;
  
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffe00 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffe08 >> 0x20);
  uVar15 = (undefined4)((ulonglong)in_stack_fffffffffffffdf0 >> 0x20);
  local_1a8 = 0xfffffffffffffffe;
  lVar9 = 0;
  local_1b8 = 0;
  bVar11 = false;
  local_1b0 = 0;
  plVar7 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  local_res18 = param_3;
  if (plVar7 != (longlong *)0x0) {
    if (plVar7 == *(longlong **)(param_1 + 0xb30)) {
      lVar6 = *plVar7;
      lVar9 = 0;
      if (lVar6 != 0) {
        if (plVar7 != *(longlong **)(param_1 + 0xb30)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        local_1b0 = 0;
        local_1b8 = lVar6;
        FUN_14034ed40(lVar6);
        bVar11 = true;
        local_1b0 = 1;
        lVar9 = lVar6;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar7 = *(longlong **)(param_1 + 0x6c0);
  if (plVar7 == (longlong *)0x0) goto LAB_1401ae862;
  plVar8 = *(longlong **)(param_1 + 0x6c8);
  if (plVar7 != plVar8) {
    iVar4 = DAT_140608048 + 1;
    bVar10 = DAT_140608048 == 0;
    DAT_140608048 = iVar4;
    if (bVar10) {
      FUN_140176d60(1);
    }
    goto LAB_1401ae862;
  }
  if (*plVar7 == 0) goto LAB_1401ae862;
  FUN_14000a170(&local_e8);
  local_40 = 0;
  FUN_14000a170(&local_198);
  local_f0 = 0;
  if (plVar7 == plVar8) {
    lVar6 = *plVar7;
  }
  else {
    iVar4 = DAT_140608048 + 1;
    bVar10 = DAT_140608048 == 0;
    DAT_140608048 = iVar4;
    if (bVar10) {
      FUN_140176d60(1);
    }
    lVar6 = 0;
  }
  piVar3 = local_res10;
  iVar2 = DAT_140608048;
  iVar4 = *local_res10;
  if ((-1 < iVar4) && (iVar4 < 5)) {
    iVar1 = *local_res18;
    if ((-1 < iVar1) && (iVar1 < 0x18)) {
      *(short *)(((longlong)iVar1 + (longlong)iVar4 * 0x18) * 0xac + 0x14 + lVar6) =
           (short)*local_res10;
      *(short *)(((longlong)*local_res18 + (longlong)*local_res10 * 0x18) * 0xac + 0x16 + lVar6) =
           (short)*local_res18;
      FUN_140090020(&local_e8,
                    ((longlong)*local_res18 + (longlong)*local_res10 * 0x18) * 0xac + lVar6);
    }
  }
  plVar7 = *(longlong **)(param_1 + 0x6c0);
  if (plVar7 == (longlong *)0x0) {
LAB_1401ae24f:
    lVar6 = 0;
  }
  else {
    if (plVar7 != *(longlong **)(param_1 + 0x6c8)) {
      DAT_140608048 = iVar2 + 1;
      if (iVar2 == 0) {
        FUN_140176d60(1);
      }
      goto LAB_1401ae24f;
    }
    lVar6 = *plVar7;
  }
  iVar4 = *param_4;
  if ((-1 < iVar4) && (iVar4 < 5)) {
    iVar2 = *param_5;
    if ((-1 < iVar2) && (iVar2 < 0x18)) {
      *(short *)(((longlong)iVar2 + (longlong)iVar4 * 0x18) * 0xac + 0x14 + lVar6) = (short)*param_4
      ;
      *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x16 + lVar6) =
           (short)*param_5;
      FUN_140090020(&local_198,((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + lVar6);
    }
  }
  if ((local_e8 == 0) && (local_e0 == 0)) {
    bVar10 = false;
  }
  else {
    bVar10 = true;
  }
  if (((bVar10) || (local_d0 != 0)) || (0 < local_cc)) {
    if ((local_198 == 0) && (local_190 == 0)) {
      bVar10 = false;
    }
    else {
      bVar10 = true;
    }
    if ((((bVar10) || (local_180 != 0)) || (0 < local_17c[0])) &&
       ((local_74 == 0 && (local_124 == 0)))) {
      uVar5 = FUN_140137690();
      iVar4 = FUN_1401369d0(uVar5,local_180);
      if (iVar4 == 0xd) {
        uVar5 = FUN_140137690();
        iVar4 = FUN_140136d80(uVar5,local_d0);
        if ((iVar4 != 1) && (local_d4 == 1)) {
          local_1e0 = 0;
          local_1d8 = 0;
          local_1d0 = 0;
          local_1c8 = 0;
          local_res8[0] = 0;
          uVar5 = FUN_140137690();
          puVar12 = &local_1d0;
          FUN_140136f10(uVar5,local_d0,local_res8,&local_1e0,puVar12,CONCAT44(uVar15,1),
                        in_stack_fffffffffffffdf8 & 0xffffffff00000000);
          uVar15 = (undefined4)((ulonglong)puVar12 >> 0x20);
          local_bc = local_res8[0];
          lVar6 = 0;
          do {
            *(undefined4 *)((longlong)auStack_b8 + lVar6) =
                 *(undefined4 *)((longlong)&local_1e0 + lVar6);
            *(undefined4 *)((longlong)auStack_b8 + lVar6 + 0xc) =
                 *(undefined4 *)((longlong)&local_1d0 + lVar6);
            lVar6 = lVar6 + 4;
          } while (lVar6 < 0xc);
          uVar5 = FUN_140174f00(param_1 + 0x6c0);
          if (-1 < *piVar3) {
            FUN_1401ed220(uVar5,piVar3,local_res18,&local_e8,CONCAT44(uVar15,6));
          }
          local_1e8[0] = CONCAT22(local_1e8[0]._2_2_,(short)*piVar3);
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          local_res8[0]._0_2_ = (short)*local_res18;
          (**(code **)(*plVar7 + 0xe0))
                    (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1e8,local_res8,
                     &local_e8);
          local_1d0 = *(undefined8 *)(param_1 + 0x160);
          local_1c8 = *(undefined4 *)(param_1 + 0x168);
          local_1c4 = *(undefined4 *)(param_1 + 0x16c);
          local_1e0 = *(undefined8 *)(param_1 + 0x170);
          local_1d8 = *(undefined4 *)(param_1 + 0x178);
          local_1d4 = *(undefined4 *)(param_1 + 0x17c);
          iVar4 = *(int *)(param_1 + 0x284);
          if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0)) {
            local_res8[0]._0_2_ = (undefined2)iVar4;
            plVar7 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar7 + 0x140))
                      (plVar7,1,&DAT_1405d85a0,local_res8,&local_1e0,&local_1d0,&local_e8);
          }
          local_17c[0] = local_17c[0] + -1;
          local_res8[0]._0_2_ = (undefined2)*param_5;
          local_1e8[0] = CONCAT22(local_1e8[0]._2_2_,(short)*param_4);
          plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          plVar7 = (longlong *)local_17c;
          puVar14 = local_res8;
          puVar13 = local_1e8;
          (**(code **)(*plVar8 + 0x290))
                    (plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_198,puVar13,puVar14,
                     plVar7);
          uVar16 = (undefined4)((ulonglong)puVar14 >> 0x20);
          uVar15 = (undefined4)((ulonglong)puVar13 >> 0x20);
          if (local_17c[0] < 1) {
            local_1d0 = *(undefined8 *)(param_1 + 0x160);
            local_1c8 = *(undefined4 *)(param_1 + 0x168);
            local_1c4 = *(undefined4 *)(param_1 + 0x16c);
            local_1e0 = *(undefined8 *)(param_1 + 0x170);
            local_1d8 = *(undefined4 *)(param_1 + 0x178);
            local_1d4 = *(undefined4 *)(param_1 + 0x17c);
            iVar4 = *(int *)(param_1 + 0x284);
            local_1e8[0] = 0xffffffff;
            local_1c0[0] = 0xfffffff6;
            if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
               (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0)) {
              local_res8[0]._0_2_ = (undefined2)iVar4;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                       );
              puVar14 = local_1e8;
              puVar13 = local_1c0;
              plVar7 = &local_198;
              puVar12 = &local_1d0;
              (**(code **)(*plVar8 + 0x130))
                        (plVar8,1,&DAT_1405d85a0,local_res8,&local_1e0,puVar12,plVar7,puVar13,
                         puVar14);
              uVar16 = (undefined4)((ulonglong)puVar12 >> 0x20);
              uVar17 = (undefined4)((ulonglong)puVar13 >> 0x20);
              uVar18 = (undefined4)((ulonglong)puVar14 >> 0x20);
            }
            uVar5 = FUN_140174f00(param_1 + 0x6c0);
            FUN_1401e9d60(uVar5,param_1,param_4,param_5,&local_198);
          }
          else {
            uVar5 = FUN_140174f00(param_1 + 0x6c0);
            if (-1 < *param_4) {
              FUN_1401ed220(uVar5,param_4,param_5,&local_198,CONCAT44(uVar15,6));
            }
            local_1d0 = *(undefined8 *)(param_1 + 0x160);
            local_1c8 = *(undefined4 *)(param_1 + 0x168);
            local_1c4 = *(undefined4 *)(param_1 + 0x16c);
            local_1e0 = *(undefined8 *)(param_1 + 0x170);
            local_1d8 = *(undefined4 *)(param_1 + 0x178);
            local_1d4 = *(undefined4 *)(param_1 + 0x17c);
            iVar4 = *(int *)(param_1 + 0x284);
            if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
               (lVar6 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar6 != 0)) {
              local_res8[0]._0_2_ = (undefined2)iVar4;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                       );
              plVar7 = &local_198;
              puVar12 = &local_1d0;
              (**(code **)(*plVar8 + 0x140))
                        (plVar8,1,&DAT_1405d85a0,local_res8,&local_1e0,puVar12,plVar7);
              uVar16 = (undefined4)((ulonglong)puVar12 >> 0x20);
            }
          }
          FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,&local_198,
                        CONCAT44(uVar16,1),(ulonglong)plVar7 & 0xffffffff00000000,
                        CONCAT44(uVar17,local_17c[0] + 1),CONCAT44(uVar18,(int)local_17c[0]));
          local_res8[0] = 1;
          local_1c0[0] = 0x2b40;
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar7 + 0x70))
                    (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1c0,local_res8);
        }
      }
    }
  }
LAB_1401ae862:
  if (bVar11) {
    FUN_14034edd0(lVar9);
  }
  return;
}



void FUN_1401ae890(longlong param_1,longlong *param_2,int *param_3,int *param_4)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  ulonglong uVar10;
  uint uVar11;
  bool bVar12;
  bool bVar13;
  int local_res8 [2];
  undefined4 *puVar14;
  int *piVar16;
  undefined4 uVar18;
  undefined4 *puVar17;
  undefined8 in_stack_fffffffffffffe00;
  undefined4 *puVar19;
  undefined4 uVar20;
  undefined8 in_stack_fffffffffffffe08;
  undefined4 uVar21;
  undefined4 local_1e8 [2];
  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 [2];
  longlong local_1b8;
  undefined1 local_1b0;
  undefined8 local_1a8;
  longlong local_198;
  longlong local_190;
  int local_180;
  short local_17c [44];
  short local_124;
  undefined4 local_f0;
  longlong local_e8;
  longlong local_e0;
  undefined1 local_d4 [2];
  short local_d2;
  int local_d0;
  short local_cc;
  undefined4 local_c8;
  undefined4 local_78;
  short local_74;
  undefined4 local_58;
  undefined4 local_40;
  undefined4 uVar15;
  
  local_1a8 = 0xfffffffffffffffe;
  lVar9 = 0;
  local_1b8 = 0;
  bVar13 = false;
  local_1b0 = 0;
  plVar6 = *(longlong **)(param_1 + 0xb28);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0xb30)) {
      lVar8 = *plVar6;
      lVar9 = 0;
      if (lVar8 != 0) {
        if (plVar6 != *(longlong **)(param_1 + 0xb30)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar13 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar13) {
            FUN_140176d60(1);
          }
          lVar8 = 0;
        }
        local_1b0 = 0;
        local_1b8 = lVar8;
        FUN_14034ed40(lVar8);
        bVar13 = true;
        local_1b0 = 1;
        lVar9 = lVar8;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  plVar6 = *(longlong **)(param_1 + 0x6c0);
  if (plVar6 != (longlong *)0x0) {
    plVar7 = *(longlong **)(param_1 + 0x6c8);
    if (plVar6 == plVar7) {
      if (*plVar6 != 0) {
        FUN_14000a170(&local_198);
        local_f0 = 0;
        FUN_14000a170(&local_e8);
        local_40 = 0;
        if (plVar6 == plVar7) {
          lVar8 = *plVar6;
        }
        else {
          iVar2 = DAT_140608048 + 1;
          bVar12 = DAT_140608048 == 0;
          DAT_140608048 = iVar2;
          if (bVar12) {
            FUN_140176d60(1);
          }
          lVar8 = 0;
        }
        iVar2 = *param_3;
        if ((-1 < iVar2) && (iVar2 < 5)) {
          iVar3 = *param_4;
          if ((-1 < iVar3) && (iVar3 < 0x18)) {
            *(short *)(((longlong)iVar3 + (longlong)iVar2 * 0x18) * 0xac + 0x14 + lVar8) =
                 (short)*param_3;
            *(short *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x16 + lVar8) =
                 (short)*param_4;
            FUN_140090020(&local_198,((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + lVar8
                         );
          }
        }
        if ((local_198 == 0) && (local_190 == 0)) {
          bVar12 = false;
        }
        else {
          bVar12 = true;
        }
        if ((((bVar12) || (local_180 != 0)) || (0 < local_17c[0])) && (local_124 == 0)) {
          uVar4 = FUN_140137690();
          iVar2 = FUN_1401369d0(uVar4,local_180);
          uVar4 = FUN_140137690();
          iVar3 = FUN_140137640(uVar4,local_180);
          uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffe00 >> 0x20);
          uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffe08 >> 0x20);
          if ((0x21 < iVar2) && (iVar2 < 0x25)) {
            lVar8 = *param_2;
            lVar5 = param_2[1] - lVar8 >> 4;
            if ((int)lVar5 <= iVar3) {
              local_1e8[0] = 0xffffffff;
              uVar11 = 0;
              if (lVar5 != 0) {
                uVar10 = 0;
                do {
                  uVar4 = FUN_140174f00(param_1 + 0x6c0);
                  cVar1 = FUN_1401f2840(uVar4,uVar10 * 0x10 + lVar8,local_1e8);
                  if (cVar1 == '\0') goto LAB_1401af01e;
                  uVar4 = FUN_140174f00(param_1 + 0x6c0);
                  FUN_1401ecc20(uVar4,local_1e8,&local_e8);
                  if ((local_e8 == 0) && (local_e0 == 0)) {
                    bVar12 = false;
                  }
                  else {
                    bVar12 = true;
                  }
                  if ((((!bVar12) && (local_d0 == 0)) && (local_cc < 1)) || (local_74 != 0))
                  goto LAB_1401af01e;
                  uVar4 = FUN_1401e0840();
                  local_78 = FUN_1401e2340(uVar4,0x1e);
                  local_c8 = 0x1e;
                  local_58 = 0;
                  local_res8[0] = (int)local_d2;
                  uVar4 = FUN_140174f00(param_1 + 0x6c0);
                  FUN_1401ed120(uVar4,local_res8,&local_e8);
                  plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar6 + 0xe0))
                            (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_d4,&local_d2,
                             &local_e8);
                  local_1d0 = *(undefined4 *)(param_1 + 0x160);
                  local_1cc = *(undefined4 *)(param_1 + 0x164);
                  local_1c8 = *(undefined4 *)(param_1 + 0x168);
                  local_1c4 = *(undefined4 *)(param_1 + 0x16c);
                  local_1e0 = *(undefined4 *)(param_1 + 0x170);
                  local_1dc = *(undefined4 *)(param_1 + 0x174);
                  local_1d8 = *(undefined4 *)(param_1 + 0x178);
                  local_1d4 = *(undefined4 *)(param_1 + 0x17c);
                  iVar2 = *(int *)(param_1 + 0x284);
                  if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                     && (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0))
                  {
                    local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                    plVar6 = (longlong *)
                             (*(longlong *)
                               (*(longlong *)(lVar8 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                             + 0x70);
                    (**(code **)(*plVar6 + 0x140))
                              (plVar6,1,&DAT_1405d85a0,local_res8,&local_1e0,&local_1d0,&local_e8);
                  }
                  uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffe00 >> 0x20);
                  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffe08 >> 0x20);
                  uVar11 = uVar11 + 1;
                  lVar8 = *param_2;
                  uVar10 = (ulonglong)uVar11;
                } while (uVar10 < (ulonglong)(param_2[1] - lVar8 >> 4));
              }
              local_res8[0] = 1;
              plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar6 + 0xab0))
                        (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8);
              local_17c[0] = local_17c[0] + -1;
              local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)*param_4);
              local_1e8[0] = CONCAT22(local_1e8[0]._2_2_,(short)*param_3);
              plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              plVar6 = (longlong *)local_17c;
              piVar16 = local_res8;
              puVar14 = local_1e8;
              (**(code **)(*plVar7 + 0x290))
                        (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_198,puVar14,
                         piVar16,plVar6);
              uVar18 = (undefined4)((ulonglong)piVar16 >> 0x20);
              uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
              if (local_17c[0] < 1) {
                local_1e0 = *(undefined4 *)(param_1 + 0x160);
                local_1dc = *(undefined4 *)(param_1 + 0x164);
                local_1d8 = *(undefined4 *)(param_1 + 0x168);
                local_1d4 = *(undefined4 *)(param_1 + 0x16c);
                local_1d0 = *(undefined4 *)(param_1 + 0x170);
                local_1cc = *(undefined4 *)(param_1 + 0x174);
                local_1c8 = *(undefined4 *)(param_1 + 0x178);
                local_1c4 = *(undefined4 *)(param_1 + 0x17c);
                iVar2 = *(int *)(param_1 + 0x284);
                local_1e8[0] = 0xffffffff;
                local_1c0[0] = 0xfffffff6;
                if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0)) {
                  local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                  plVar7 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar8 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  puVar14 = local_1e8;
                  puVar19 = local_1c0;
                  plVar6 = &local_198;
                  puVar17 = &local_1e0;
                  (**(code **)(*plVar7 + 0x130))
                            (plVar7,1,&DAT_1405d85a0,local_res8,&local_1d0,puVar17,plVar6,puVar19,
                             puVar14);
                  uVar18 = (undefined4)((ulonglong)puVar17 >> 0x20);
                  uVar20 = (undefined4)((ulonglong)puVar19 >> 0x20);
                  uVar21 = (undefined4)((ulonglong)puVar14 >> 0x20);
                }
                uVar4 = FUN_140174f00(param_1 + 0x6c0);
                FUN_1401e9d60(uVar4,param_1,param_3,param_4,&local_198);
              }
              else {
                uVar4 = FUN_140174f00(param_1 + 0x6c0);
                if (-1 < *param_3) {
                  FUN_1401ed220(uVar4,param_3,param_4,&local_198,CONCAT44(uVar15,6));
                }
                local_1e0 = *(undefined4 *)(param_1 + 0x160);
                local_1dc = *(undefined4 *)(param_1 + 0x164);
                local_1d8 = *(undefined4 *)(param_1 + 0x168);
                local_1d4 = *(undefined4 *)(param_1 + 0x16c);
                local_1d0 = *(undefined4 *)(param_1 + 0x170);
                local_1cc = *(undefined4 *)(param_1 + 0x174);
                local_1c8 = *(undefined4 *)(param_1 + 0x178);
                local_1c4 = *(undefined4 *)(param_1 + 0x17c);
                iVar2 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0)) {
                  local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar2);
                  plVar7 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar8 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  plVar6 = &local_198;
                  puVar14 = &local_1e0;
                  (**(code **)(*plVar7 + 0x140))
                            (plVar7,1,&DAT_1405d85a0,local_res8,&local_1d0,puVar14,plVar6);
                  uVar18 = (undefined4)((ulonglong)puVar14 >> 0x20);
                }
              }
              FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,&local_198,
                            CONCAT44(uVar18,1),(ulonglong)plVar6 & 0xffffffff00000000,
                            CONCAT44(uVar20,local_17c[0] + 1),CONCAT44(uVar21,(int)local_17c[0]));
            }
          }
        }
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar12 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401af01e:
  if (bVar13) {
    FUN_14034edd0(lVar9);
  }
  return;
}



void FUN_1401af050(longlong param_1,undefined4 param_2,int *param_3,undefined2 *param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  bool bVar3;
  int iVar4;
  undefined4 uVar5;
  longlong *plVar6;
  undefined8 uVar7;
  longlong lVar8;
  longlong *plVar9;
  bool bVar10;
  bool bVar11;
  undefined4 local_res8 [2];
  undefined4 local_res10 [2];
  undefined2 *puVar12;
  undefined4 *puVar13;
  undefined4 uVar15;
  undefined4 *puVar14;
  undefined8 in_stack_fffffffffffffe70;
  undefined4 *puVar16;
  undefined4 uVar17;
  undefined8 in_stack_fffffffffffffe78;
  undefined4 uVar18;
  longlong local_178;
  undefined2 local_168;
  undefined2 local_166;
  undefined2 local_164 [2];
  undefined4 local_160 [2];
  longlong *local_158;
  longlong *local_150;
  undefined4 local_148 [2];
  undefined4 local_140 [2];
  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;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined8 local_f8;
  longlong local_e8;
  longlong local_e0;
  int local_d0;
  short local_cc [44];
  short local_74;
  undefined4 local_40;
  
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffe70 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffe78 >> 0x20);
  local_f8 = 0xfffffffffffffffe;
  local_178 = 0;
  bVar3 = false;
  bVar11 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  local_res10[0] = param_2;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar8 = *plVar1;
      if (lVar8 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0xb30)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar8 = 0;
        }
        FUN_14034ed40(lVar8);
        bVar3 = true;
        bVar11 = true;
        local_178 = lVar8;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar1 != 0) {
        FUN_140198570(param_1,&local_158);
        plVar1 = local_158;
        if (local_158 != (longlong *)0x0) {
          if (local_158 == local_150) {
            if (*local_158 != 0) {
              plVar6 = (longlong *)FUN_140208860(*local_158,local_res10[0]);
              if (plVar6 == (longlong *)0x0) {
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                bVar3 = bVar11;
                if ((int)*plVar1 == 0) {
                  puVar2 = (undefined8 *)*local_158;
                  if (puVar2 != (undefined8 *)0x0) {
                    (**(code **)*puVar2)(puVar2,1);
                  }
                  operator_delete(local_158);
                }
              }
              else {
                FUN_14000a170(&local_e8);
                local_40 = 0;
                uVar7 = FUN_140174f00(param_1 + 0x6c0);
                if (-1 < *param_3) {
                  FUN_1401ecce0(uVar7,param_3,param_4,&local_e8);
                }
                if ((local_e8 == 0) && (local_e0 == 0)) {
                  bVar3 = false;
                }
                else {
                  bVar3 = true;
                }
                if ((((bVar3) || (local_d0 != 0)) || (0 < local_cc[0])) && (local_74 == 0)) {
                  uVar7 = FUN_140137690();
                  iVar4 = FUN_1401369d0(uVar7,local_d0);
                  uVar7 = FUN_140137690();
                  local_res8[0] = FUN_140137640(uVar7,local_d0);
                  if (iVar4 == 0x35) {
                    uVar7 = FUN_1401e0840();
                    uVar5 = FUN_1401e2340(uVar7,local_res8[0]);
                    lVar8 = (**(code **)(*plVar6 + 0x280))(plVar6);
                    *(undefined4 *)(lVar8 + 0x78) = uVar5;
                    FUN_1401b74c0(param_1,local_res10[0],4,0);
                    local_148[0] = 1;
                    plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    (**(code **)(*plVar6 + 0xc90))
                              (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10,
                               local_148);
                    local_cc[0] = local_cc[0] + -1;
                    local_res8[0] = CONCAT22(local_res8[0]._2_2_,*param_4);
                    local_164[0] = (undefined2)*param_3;
                    plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    plVar6 = (longlong *)local_cc;
                    puVar13 = local_res8;
                    puVar12 = local_164;
                    (**(code **)(*plVar9 + 0x290))
                              (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_e8,puVar12,
                               puVar13,plVar6);
                    uVar15 = (undefined4)((ulonglong)puVar13 >> 0x20);
                    uVar5 = (undefined4)((ulonglong)puVar12 >> 0x20);
                    if (local_cc[0] < 1) {
                      local_108 = *(undefined4 *)(param_1 + 0x160);
                      local_104 = *(undefined4 *)(param_1 + 0x164);
                      local_100 = *(undefined4 *)(param_1 + 0x168);
                      local_fc = *(undefined4 *)(param_1 + 0x16c);
                      local_138 = *(undefined4 *)(param_1 + 0x170);
                      local_134 = *(undefined4 *)(param_1 + 0x174);
                      local_130 = *(undefined4 *)(param_1 + 0x178);
                      local_12c = *(undefined4 *)(param_1 + 0x17c);
                      iVar4 = *(int *)(param_1 + 0x284);
                      local_140[0] = 0xffffffff;
                      local_160[0] = 0xfffffff6;
                      if (((-1 < iVar4) &&
                          (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0)
                         ) {
                        local_166 = (undefined2)iVar4;
                        plVar9 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar8 + 8) +
                                   (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        puVar13 = local_140;
                        puVar16 = local_160;
                        plVar6 = &local_e8;
                        puVar14 = &local_108;
                        (**(code **)(*plVar9 + 0x130))
                                  (plVar9,1,&DAT_1405d85a0,&local_166,&local_138,puVar14,plVar6,
                                   puVar16,puVar13);
                        uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
                        uVar17 = (undefined4)((ulonglong)puVar16 >> 0x20);
                        uVar18 = (undefined4)((ulonglong)puVar13 >> 0x20);
                      }
                      uVar7 = FUN_140174f00(param_1 + 0x6c0);
                      FUN_1401e9d60(uVar7,param_1,param_3,param_4,&local_e8);
                    }
                    else {
                      uVar7 = FUN_140174f00(param_1 + 0x6c0);
                      if (-1 < *param_3) {
                        FUN_1401ed220(uVar7,param_3,param_4,&local_e8,CONCAT44(uVar5,6));
                      }
                      local_118 = *(undefined4 *)(param_1 + 0x160);
                      local_114 = *(undefined4 *)(param_1 + 0x164);
                      local_110 = *(undefined4 *)(param_1 + 0x168);
                      local_10c = *(undefined4 *)(param_1 + 0x16c);
                      local_128 = *(undefined4 *)(param_1 + 0x170);
                      local_124 = *(undefined4 *)(param_1 + 0x174);
                      local_120 = *(undefined4 *)(param_1 + 0x178);
                      local_11c = *(undefined4 *)(param_1 + 0x17c);
                      iVar4 = *(int *)(param_1 + 0x284);
                      if (((-1 < iVar4) &&
                          (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0)
                         ) {
                        local_168 = (undefined2)iVar4;
                        plVar9 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar8 + 8) +
                                   (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        plVar6 = &local_e8;
                        puVar13 = &local_118;
                        (**(code **)(*plVar9 + 0x140))
                                  (plVar9,1,&DAT_1405d85a0,&local_168,&local_128,puVar13,plVar6);
                        uVar15 = (undefined4)((ulonglong)puVar13 >> 0x20);
                      }
                    }
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,&local_e8,
                                  CONCAT44(uVar15,1),(ulonglong)plVar6 & 0xffffffff00000000,
                                  CONCAT44(uVar17,local_cc[0] + 1),CONCAT44(uVar18,(int)local_cc[0])
                                 );
                    LOCK();
                    plVar1 = plVar1 + 1;
                    *(int *)plVar1 = (int)*plVar1 + -1;
                    UNLOCK();
                    bVar3 = bVar11;
                    if ((int)*plVar1 == 0) {
                      puVar2 = (undefined8 *)*local_158;
                      if (puVar2 != (undefined8 *)0x0) {
                        (**(code **)*puVar2)(puVar2,1);
                      }
                      operator_delete(local_158);
                    }
                  }
                  else {
                    LOCK();
                    plVar1 = plVar1 + 1;
                    *(int *)plVar1 = (int)*plVar1 + -1;
                    UNLOCK();
                    bVar3 = bVar11;
                    if ((int)*plVar1 == 0) {
                      puVar2 = (undefined8 *)*local_158;
                      if (puVar2 != (undefined8 *)0x0) {
                        (**(code **)*puVar2)(puVar2,1);
                      }
                      operator_delete(local_158);
                    }
                  }
                }
                else {
                  LOCK();
                  plVar1 = plVar1 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  bVar3 = bVar11;
                  if ((int)*plVar1 == 0) {
                    puVar2 = (undefined8 *)*local_158;
                    if (puVar2 != (undefined8 *)0x0) {
                      (**(code **)*puVar2)(puVar2,1);
                    }
                    operator_delete(local_158);
                  }
                }
              }
              goto joined_r0x0001401af6c9;
            }
          }
          else {
            iVar4 = DAT_14060804c + 1;
            bVar10 = DAT_14060804c == 0;
            DAT_14060804c = iVar4;
            if (bVar10) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == local_150) {
            LOCK();
            plVar1 = plVar1 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            bVar3 = bVar11;
            if ((int)*plVar1 == 0) {
              puVar2 = (undefined8 *)*local_158;
              if (puVar2 != (undefined8 *)0x0) {
                (**(code **)*puVar2)(puVar2,1);
              }
              operator_delete(local_158);
            }
          }
          else {
            iVar4 = DAT_140608054 + 1;
            bVar11 = DAT_140608054 == 0;
            DAT_140608054 = iVar4;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar11 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
joined_r0x0001401af6c9:
  if (bVar3) {
    FUN_14034edd0(local_178);
  }
  return;
}



void FUN_1401af6f0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  int iVar2;
  longlong *plVar3;
  longlong *plVar4;
  bool bVar5;
  bool bVar6;
  undefined8 uVar7;
  longlong *local_30;
  longlong *local_28;
  longlong local_20;
  
  uVar7 = 0xfffffffffffffffe;
  local_20 = 0;
  bVar6 = false;
  plVar3 = *(longlong **)(param_1 + 0xb28);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar3 != 0) {
        local_20 = *plVar3;
        if ((plVar3 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar6 = DAT_1406080a8 == 0, local_20 = 0,
           DAT_1406080a8 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar6 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar5 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  local_30 = (longlong *)0x0;
  if (param_2 == 1) {
    plVar3 = *(longlong **)(param_1 + 0x9f0);
  }
  else {
    plVar3 = *(longlong **)(param_1 + 0x9d0);
  }
  if (plVar3 != (longlong *)0x0) {
    plVar4 = plVar3 + 1;
    LOCK();
    *(int *)plVar4 = (int)*plVar4 + 1;
    UNLOCK();
    local_30 = plVar3;
    local_28 = plVar3;
    if (*plVar3 != 0) {
      FUN_140264ec0(*plVar3,param_1,param_2,param_4,uVar7);
      LOCK();
      *(int *)plVar4 = (int)*plVar4 + -1;
      UNLOCK();
      if ((int)*plVar4 == 0) {
        pvVar1 = (void *)*plVar3;
        if (pvVar1 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar1 + 0x9130);
          operator_delete(pvVar1);
        }
        operator_delete(plVar3);
      }
      goto LAB_1401af869;
    }
  }
  if (local_30 != (longlong *)0x0) {
    if (local_30 == local_28) {
      LOCK();
      plVar3 = local_30 + 1;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)*plVar3 == 0) {
        pvVar1 = (void *)*local_30;
        if (pvVar1 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar1 + 0x9130);
          operator_delete(pvVar1);
        }
        operator_delete(local_30);
      }
    }
    else {
      iVar2 = DAT_1406080fc + 1;
      bVar5 = DAT_1406080fc == 0;
      DAT_1406080fc = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401af869:
  if (bVar6) {
    FUN_14034edd0(local_20);
  }
  return;
}



void FUN_1401af890(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  DWORD DVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined8 uVar10;
  longlong lVar11;
  
  uVar10 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar11 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar7 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar6 = *plVar1;
      lVar7 = 0;
      if (lVar6 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar6 = lVar5,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        lVar11 = lVar6;
        FUN_14034ed40(lVar6);
        bVar9 = true;
        lVar7 = lVar6;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      if ((*plVar1 != 0) && (DVar3 = timeGetTime(), 4999 < DVar3 - *(int *)(param_1 + 0x148))) {
        *(DWORD *)(param_1 + 0x148) = DVar3;
        uVar4 = FUN_140174f00(param_1 + 0x6c0);
        if (param_2 == 5) {
          FUN_1401f5400(uVar4,param_1,5);
        }
        else {
          FUN_1401f5ba0(uVar4,param_1,param_2,param_4,uVar10,lVar11);
        }
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar9) {
    FUN_14034edd0(lVar7);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401b0562)
// WARNING: Removing unreachable block (ram,0x0001401aff6d)
// WARNING: Removing unreachable block (ram,0x0001401aff57)
// WARNING: Removing unreachable block (ram,0x0001401aff62)
// WARNING: Removing unreachable block (ram,0x0001401b04f9)
// WARNING: Removing unreachable block (ram,0x0001401b0662)
// WARNING: Removing unreachable block (ram,0x0001401aff4c)
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1401af9f0(longlong param_1,short *param_2,ushort *param_3)

{
  int iVar1;
  short sVar2;
  ushort uVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined4 *puVar9;
  longlong *plVar10;
  uint *puVar11;
  uint *puVar12;
  uint uVar13;
  uint *puVar14;
  uint uVar15;
  uint *puVar16;
  undefined8 uVar17;
  uint uVar18;
  longlong lVar19;
  bool bVar20;
  bool bVar21;
  undefined4 extraout_XMM0_Da;
  uint local_res8 [2];
  undefined8 in_stack_fffffffffffffe68;
  undefined8 *puVar22;
  undefined4 uVar23;
  ulonglong in_stack_fffffffffffffe70;
  undefined4 uVar26;
  ulonglong uVar24;
  undefined8 uVar25;
  ulonglong in_stack_fffffffffffffe78;
  undefined4 uVar29;
  ulonglong uVar27;
  uint **ppuVar28;
  undefined8 in_stack_fffffffffffffe80;
  undefined4 uVar31;
  undefined *puVar30;
  undefined8 in_stack_fffffffffffffe88;
  uint uVar33;
  ulonglong uVar32;
  undefined4 local_168 [2];
  uint *local_160;
  undefined4 local_158;
  undefined4 uStack_154;
  int local_150 [2];
  longlong local_148;
  int local_140;
  uint local_13c [3];
  undefined8 local_130;
  undefined4 local_128;
  undefined4 local_124;
  uint *local_120;
  undefined8 local_118;
  undefined4 local_110;
  undefined8 local_108;
  undefined4 local_100;
  uint *local_f8;
  char local_f0;
  undefined4 local_e8;
  undefined4 uStack_e4;
  undefined4 uStack_e0;
  undefined4 uStack_dc;
  short local_d4;
  ushort local_d2;
  uint local_d0;
  short local_cc;
  int local_c8;
  undefined4 local_c4;
  undefined2 local_c0;
  undefined4 local_bc;
  undefined4 local_b8 [6];
  undefined2 local_a0;
  undefined4 auStack_9c [6];
  undefined1 auStack_84 [4];
  uint local_80;
  undefined2 local_7c;
  int local_78;
  undefined8 local_54;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_40;
  longlong local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  puVar16 = (uint *)0x0;
  uVar18 = 0;
  uVar15 = 0;
  puVar14 = (uint *)0x0;
  local_120 = (uint *)0x0;
  local_f8 = (uint *)0x0;
  bVar21 = false;
  local_f0 = '\0';
  puVar22 = *(undefined8 **)(param_1 + 0xb28);
  puVar11 = puVar16;
  if (puVar22 != (undefined8 *)0x0) {
    puVar11 = puVar14;
    if (puVar22 == *(undefined8 **)(param_1 + 0xb30)) {
      if ((uint *)*puVar22 != (uint *)0x0) {
        puVar11 = (uint *)*puVar22;
        if ((puVar22 != *(undefined8 **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar21 = DAT_1406080a8 == 0, puVar11 = puVar16,
           DAT_1406080a8 = iVar4, bVar21)) {
          FUN_140176d60(1);
        }
        local_f0 = 0;
        local_120 = puVar11;
        local_f8 = puVar11;
        FUN_14034ed40(puVar11);
        bVar21 = true;
        local_f0 = '\x01';
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar20 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  plVar10 = *(longlong **)(param_1 + 0x6c0);
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == *(longlong **)(param_1 + 0x6c8)) {
      if ((*plVar10 != 0) &&
         (puVar22 = *(undefined8 **)(param_1 + 0x6e0), puVar22 != (undefined8 *)0x0)) {
        if (puVar22 != *(undefined8 **)(param_1 + 0x6e8)) {
          iVar4 = DAT_14060804c;
          DAT_14060804c = DAT_14060804c + 1;
          goto LAB_1401b0a17;
        }
        if ((uint *)*puVar22 == (uint *)0x0) goto LAB_1401b0a23;
        puVar14 = (uint *)*puVar22;
        if ((puVar22 != *(undefined8 **)(param_1 + 0x6e8)) &&
           (iVar4 = DAT_14060804c + 1, bVar21 = DAT_14060804c == 0, puVar14 = puVar16,
           DAT_14060804c = iVar4, bVar21)) {
          FUN_140176d60(1);
        }
        lVar7 = FUN_14020b2a0(puVar14);
        local_148 = lVar7;
        if (lVar7 == 0) {
          local_res8[0] = 0x17;
          local_150[0] = 0x2b10;
          plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar10 + 0x70))
                    (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_150,local_res8);
          bVar21 = local_f0 == '\0';
          goto LAB_1401b0a26;
        }
        uVar6 = *(uint *)(lVar7 + 0x20);
        plVar10 = (longlong *)FUN_14013c310();
        puVar11 = puVar16;
        if (*plVar10 != 0) {
          for (puVar14 = *(uint **)(*plVar10 +
                                   ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
              (puVar11 = puVar16, puVar14 != (uint *)0x0 &&
              ((puVar14[0x3a] != uVar6 || (puVar11 = puVar14, *puVar14 != uVar6))));
              puVar14 = *(uint **)(puVar14 + 0x38)) {
          }
        }
        uVar6 = 0;
        local_13c[0] = uVar6;
        if (puVar11 != (uint *)0x0) {
          if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          local_13c[0] = puVar11[3];
        }
        uVar8 = FUN_140137690();
        local_150[0] = FUN_140136b30(uVar8);
        local_140 = 0;
        uVar5 = *(uint *)(lVar7 + 0x20);
        plVar10 = (longlong *)FUN_14013c310();
        puVar11 = puVar16;
        if (*plVar10 != 0) {
          for (puVar14 = *(uint **)(*plVar10 +
                                   ((ulonglong)uVar5 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
              (puVar11 = puVar16, puVar14 != (uint *)0x0 &&
              ((puVar14[0x3a] != uVar5 || (puVar11 = puVar14, *puVar14 != uVar5))));
              puVar14 = *(uint **)(puVar14 + 0x38)) {
          }
        }
        if (puVar11 == (uint *)0x0) {
LAB_1401afca8:
          uVar8 = FUN_14013c310();
          uVar5 = FUN_14013c2c0(uVar8,*(undefined4 *)(local_148 + 0x20));
        }
        else {
          if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar18 = puVar11[0x2e];
          if (uVar18 == 0) goto LAB_1401afca8;
          uVar5 = uVar6;
          if ((uVar18 == 1) || (uVar18 == 4)) {
            uVar8 = FUN_14013c310();
            local_140 = FUN_14013c2c0(uVar8,*(undefined4 *)(local_148 + 0x20));
          }
        }
        puVar9 = (undefined4 *)FUN_140357570(&local_160);
        FUN_14000a170(&local_e8);
        uVar13 = local_13c[0];
        local_40 = 0;
        local_e8 = *puVar9;
        uStack_e4 = puVar9[1];
        uStack_e0 = puVar9[2];
        uStack_dc = puVar9[3];
        local_d0 = local_13c[0];
        local_cc = 1;
        local_c8 = local_140;
        uVar8 = FUN_140137690();
        local_7c = FUN_140136c10(uVar8,uVar13);
        uVar8 = FUN_140137690();
        local_80 = FUN_140136ad0(uVar8);
        uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffe68 >> 0x20);
        uVar29 = (undefined4)(in_stack_fffffffffffffe78 >> 0x20);
        uVar31 = (undefined4)((ulonglong)in_stack_fffffffffffffe80 >> 0x20);
        uVar33 = (uint)((ulonglong)in_stack_fffffffffffffe88 >> 0x20);
        local_d4 = *param_2;
        local_d2 = *param_3;
        if (1 < (int)uVar5) {
          local_cc = (short)uVar5;
        }
        if ((local_150[0] == 1) || (local_150[0] == 5)) {
          local_108 = 0;
          local_100 = 0;
          local_118 = 0;
          local_110 = 0;
          local_13c[1] = 0;
          local_130 = 0;
          local_128 = 0;
          local_160 = (uint *)0x0;
          local_158 = 0;
          local_res8[0] = local_res8[0] & 0xff000000;
          uVar8 = FUN_140137690();
          local_168[0] = FUN_140136bb0(uVar8,local_d0);
          uVar8 = FUN_140137690();
          local_7c = FUN_140136c10(uVar8);
          lVar7 = local_148;
          puVar11 = (uint *)(local_148 + 0x24);
          local_38 = (longlong)&local_108 - local_148;
          puVar14 = puVar16;
          do {
            uVar5 = *puVar11;
            if (uVar5 != 0) {
              plVar10 = (longlong *)FUN_14013c310();
              uVar13 = uVar15;
              if (*plVar10 != 0) {
                for (puVar12 = *(uint **)(*plVar10 +
                                         ((ulonglong)uVar5 % (ulonglong)*(uint *)(plVar10 + 2)) * 8)
                    ; puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x38)) {
                  if ((puVar12[0x3a] == uVar5) && (*puVar12 == uVar5)) {
                    if (puVar12 != (uint *)0x0) {
                      uVar13 = puVar12[0x2f];
                    }
                    break;
                  }
                }
              }
              plVar10 = (longlong *)FUN_14013f360();
              uVar5 = uVar15;
              if (*plVar10 != 0) {
                for (puVar12 = *(uint **)(*plVar10 +
                                         ((ulonglong)uVar13 % (ulonglong)*(uint *)(plVar10 + 2)) * 8
                                         ); puVar12 != (uint *)0x0;
                    puVar12 = *(uint **)(puVar12 + 6)) {
                  if ((puVar12[8] == uVar13) && (*puVar12 == uVar13)) {
                    if (puVar12 != (uint *)0x0) {
                      uVar5 = puVar12[3];
                    }
                    break;
                  }
                }
              }
              *(uint *)(local_38 + -0x24 + (longlong)puVar11) = uVar5;
              uVar5 = *puVar11;
              plVar10 = (longlong *)FUN_14013c310();
              uVar13 = uVar15;
              if (*plVar10 != 0) {
                for (puVar12 = *(uint **)(*plVar10 +
                                         ((ulonglong)uVar5 % (ulonglong)*(uint *)(plVar10 + 2)) * 8)
                    ; puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x38)) {
                  if ((puVar12[0x3a] == uVar5) && (*puVar12 == uVar5)) {
                    if (puVar12 != (uint *)0x0) {
                      uVar13 = puVar12[0x2f];
                    }
                    break;
                  }
                }
              }
              plVar10 = (longlong *)FUN_14013f360();
              uVar5 = uVar15;
              if (*plVar10 != 0) {
                for (puVar12 = *(uint **)(*plVar10 +
                                         ((ulonglong)uVar13 % (ulonglong)*(uint *)(plVar10 + 2)) * 8
                                         ); puVar12 != (uint *)0x0;
                    puVar12 = *(uint **)(puVar12 + 6)) {
                  if ((puVar12[8] == uVar13) && (*puVar12 == uVar13)) {
                    if (puVar12 != (uint *)0x0) {
                      uVar5 = puVar12[4];
                    }
                    break;
                  }
                }
              }
              *(uint *)(((longlong)local_13c - lVar7) + (longlong)puVar11) = uVar5;
            }
            uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffe68 >> 0x20);
            uVar29 = (undefined4)(in_stack_fffffffffffffe78 >> 0x20);
            uVar26 = (undefined4)(in_stack_fffffffffffffe70 >> 0x20);
            uVar31 = (undefined4)((ulonglong)in_stack_fffffffffffffe80 >> 0x20);
            uVar33 = (uint)((ulonglong)in_stack_fffffffffffffe88 >> 0x20);
            uVar5 = (int)puVar14 + 1;
            puVar14 = (uint *)(ulonglong)uVar5;
            puVar11 = puVar11 + 1;
          } while ((int)uVar5 < 3);
          if (uVar18 == 4) {
            uVar8 = FUN_140137690();
            in_stack_fffffffffffffe78 = in_stack_fffffffffffffe78 & 0xffffffff00000000;
            in_stack_fffffffffffffe70 = CONCAT44(uVar26,1);
            puVar22 = &local_118;
            FUN_140136f10(uVar8,local_d0,local_13c + 1,&local_108,puVar22,in_stack_fffffffffffffe70,
                          in_stack_fffffffffffffe78);
            uVar23 = (undefined4)((ulonglong)puVar22 >> 0x20);
            uVar29 = (undefined4)(in_stack_fffffffffffffe78 >> 0x20);
          }
          uVar18 = local_d0;
          lVar7 = FUN_140137690();
          if (*(longlong *)(lVar7 + 0x88) != 0) {
            for (puVar11 = *(uint **)(*(longlong *)(lVar7 + 0x88) +
                                     ((ulonglong)uVar18 % (ulonglong)*(uint *)(lVar7 + 0x98)) * 8);
                puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
              if ((puVar11[0xa8] == uVar18) && (*puVar11 == uVar18)) {
                if (puVar11 != (uint *)0x0) {
                  if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                    FUN_14000d450(0x80004005);
                  }
                  local_80 = puVar11[0x5b];
                  goto LAB_1401b001a;
                }
                break;
              }
            }
          }
          local_80 = 1;
LAB_1401b001a:
          local_c4 = local_168[0];
          local_c0 = 0;
          puVar11 = puVar16;
          do {
            local_b8[(longlong)puVar11] =
                 *(undefined4 *)((longlong)&local_108 + (longlong)puVar11 * 4);
            local_b8[(longlong)puVar11 + 3] =
                 *(undefined4 *)((longlong)&local_118 + (longlong)puVar11 * 4);
            auStack_84[(longlong)puVar11] =
                 *(undefined1 *)((longlong)local_res8 + (longlong)puVar11);
            auStack_9c[(longlong)puVar11] =
                 *(undefined4 *)((longlong)&local_130 + (longlong)puVar11 * 4);
            auStack_9c[(longlong)puVar11 + 3] =
                 *(undefined4 *)((longlong)&local_160 + (longlong)puVar11 * 4);
            puVar11 = (uint *)((longlong)puVar11 + 1);
          } while ((longlong)puVar11 < 3);
          local_bc = local_13c[1];
          local_a0 = 0;
          local_54 = 0;
          local_4c = 0;
          local_48 = local_168[0];
          uVar13 = local_13c[0];
        }
        iVar4 = local_150[0];
        lVar7 = FUN_140137690();
        iVar1 = local_140;
        uVar18 = uVar6;
        if (*(longlong *)(lVar7 + 0x88) != 0) {
          for (puVar11 = *(uint **)(*(longlong *)(lVar7 + 0x88) +
                                   ((ulonglong)uVar13 % (ulonglong)*(uint *)(lVar7 + 0x98)) * 8);
              puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xa6)) {
            if ((puVar11[0xa8] == uVar13) && (*puVar11 == uVar13)) {
              if (puVar11 != (uint *)0x0) {
                if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar18 = puVar11[0x46];
              }
              break;
            }
          }
        }
        if ((0 < local_140) && (uVar18 != 2)) {
          uVar8 = FUN_1401e0840();
          local_78 = FUN_1401e2340(uVar8,iVar1);
        }
        uVar3 = local_d2;
        sVar2 = local_d4;
        if (iVar4 == 5) {
          local_res8[0] = 0xffffffff;
          puVar22 = *(undefined8 **)(param_1 + 0x6c0);
          puVar11 = puVar16;
          if (puVar22 != (undefined8 *)0x0) {
            if (puVar22 == *(undefined8 **)(param_1 + 0x6c8)) {
              puVar11 = (uint *)*puVar22;
            }
            else {
              iVar4 = DAT_140608048 + 1;
              bVar21 = DAT_140608048 == 0;
              DAT_140608048 = iVar4;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          FUN_1401e8ba0(puVar11,&local_160,&local_e8,local_res8);
          local_d2 = (ushort)local_res8[0];
          puVar22 = *(undefined8 **)(param_1 + 0x6c0);
          puVar11 = puVar16;
          if (puVar22 != (undefined8 *)0x0) {
            if (puVar22 == *(undefined8 **)(param_1 + 0x6c8)) {
              puVar11 = (uint *)*puVar22;
            }
            else {
              iVar4 = DAT_140608048 + 1;
              bVar21 = DAT_140608048 == 0;
              DAT_140608048 = iVar4;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          uVar18 = puVar11[0x1428];
          puVar22 = *(undefined8 **)(param_1 + 0x6c0);
          puVar11 = puVar16;
          if (puVar22 != (undefined8 *)0x0) {
            if (puVar22 == *(undefined8 **)(param_1 + 0x6c8)) {
              puVar11 = (uint *)*puVar22;
            }
            else {
              iVar4 = DAT_140608048 + 1;
              bVar21 = DAT_140608048 == 0;
              DAT_140608048 = iVar4;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          lVar7 = (ulonglong)uVar33 << 0x20;
          uVar24 = CONCAT44(uVar31,uVar18);
          uVar27 = CONCAT44(uVar29,puVar11[0x1428]);
          in_stack_fffffffffffffe70 = in_stack_fffffffffffffe70 & 0xffffffff00000000;
          FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_e8,400,CONCAT44(uVar23,0x1b)
                        ,in_stack_fffffffffffffe70,uVar27,uVar24,lVar7,0);
          uVar32 = CONCAT44((int)((ulonglong)lVar7 >> 0x20),(int)(short)local_d2);
          puVar30 = (undefined *)(uVar24 & 0xffffffff00000000);
          ppuVar28 = (uint **)(uVar27 & 0xffffffff00000000);
          uVar24 = CONCAT44((int)(in_stack_fffffffffffffe70 >> 0x20),(int)local_cc);
          puVar9 = &local_e8;
          FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c7,0x65,param_1,puVar9,uVar24,ppuVar28,
                        puVar30,uVar32);
          uVar29 = (undefined4)(uVar24 >> 0x20);
          uVar23 = (undefined4)((ulonglong)puVar9 >> 0x20);
          uVar31 = (undefined4)((ulonglong)ppuVar28 >> 0x20);
          uVar26 = (undefined4)((ulonglong)puVar30 >> 0x20);
          if (local_78 < 1) goto LAB_1401b04a7;
          lVar7 = FUN_140174f00(param_1 + 0x6c0);
          uVar29 = *(undefined4 *)(lVar7 + 0x50a0);
          lVar7 = FUN_140174f00(param_1 + 0x6c0);
          uVar32 = uVar32 & 0xffffffff00000000;
          uVar8 = CONCAT44(uVar26,uVar29);
          uVar27 = CONCAT44(uVar31,*(undefined4 *)(lVar7 + 0x50a0));
          uVar24 = uVar24 & 0xffffffff00000000;
          FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_e8,0x193,CONCAT44(uVar23,99)
                        ,uVar24,uVar27,uVar8,uVar32,0);
          uVar32 = CONCAT44((int)(uVar32 >> 0x20),(int)(short)local_d2);
          puVar30 = (undefined *)CONCAT44((int)((ulonglong)uVar8 >> 0x20),(int)(short)local_d2);
          uVar25 = CONCAT44((int)(uVar24 >> 0x20),(int)local_cc);
          uVar8 = 0x1ca;
          uVar17 = 0x4a;
        }
        else {
          lVar19 = (longlong)(short)local_d2;
          lVar7 = (longlong)local_d4;
          puVar22 = *(undefined8 **)(param_1 + 0x6c0);
          puVar11 = puVar16;
          if (puVar22 != (undefined8 *)0x0) {
            if (puVar22 == *(undefined8 **)(param_1 + 0x6c8)) {
              puVar11 = (uint *)*puVar22;
            }
            else {
              iVar4 = DAT_140608048 + 1;
              bVar21 = DAT_140608048 == 0;
              DAT_140608048 = iVar4;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          puVar14 = puVar11 + 0x3d8c;
          local_160 = puVar14;
          FUN_14034ed40(puVar14);
          local_158 = CONCAT31(local_158._1_3_,1);
          if (((uint)(int)sVar2 < 5) && (uVar3 < 0x18)) {
            uVar8 = FUN_140137690();
            uVar18 = FUN_140136b30(uVar8,local_d0);
            if (((int)sVar2 == uVar18) &&
               (iVar4 = FUN_14011b180(puVar11 + (lVar19 + lVar7 * 0x18) * 0x2b), iVar4 != 0)) {
              local_d4 = sVar2;
              local_d2 = uVar3;
              FUN_140090020(extraout_XMM0_Da,&local_e8);
            }
          }
          FUN_14034edd0(puVar14);
          puVar22 = *(undefined8 **)(param_1 + 0x6c0);
          puVar11 = puVar16;
          if (puVar22 != (undefined8 *)0x0) {
            if (puVar22 == *(undefined8 **)(param_1 + 0x6c8)) {
              puVar11 = (uint *)*puVar22;
            }
            else {
              iVar4 = DAT_140608048 + 1;
              bVar21 = DAT_140608048 == 0;
              DAT_140608048 = iVar4;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          uVar18 = puVar11[0x1428];
          puVar22 = *(undefined8 **)(param_1 + 0x6c0);
          puVar11 = puVar16;
          if (puVar22 != (undefined8 *)0x0) {
            if (puVar22 == *(undefined8 **)(param_1 + 0x6c8)) {
              puVar11 = (uint *)*puVar22;
            }
            else {
              iVar4 = DAT_140608048 + 1;
              bVar21 = DAT_140608048 == 0;
              DAT_140608048 = iVar4;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          uVar32 = (ulonglong)uVar33 << 0x20;
          uVar8 = CONCAT44(uVar31,uVar18);
          uVar27 = CONCAT44(uVar29,puVar11[0x1428]);
          in_stack_fffffffffffffe70 = in_stack_fffffffffffffe70 & 0xffffffff00000000;
          FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_e8,400,CONCAT44(uVar23,0x1b)
                        ,in_stack_fffffffffffffe70,uVar27,uVar8,uVar32,0);
          uVar32 = uVar32 & 0xffffffff00000000;
          puVar30 = (undefined *)CONCAT44((int)((ulonglong)uVar8 >> 0x20),(int)local_cc);
          uVar25 = CONCAT44((int)(in_stack_fffffffffffffe70 >> 0x20),(int)local_cc);
          uVar8 = 0x1c7;
          uVar17 = 0x65;
        }
        ppuVar28 = (uint **)(uVar27 & 0xffffffff00000000);
        puVar9 = &local_e8;
        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),uVar8,uVar17,param_1,puVar9,uVar25,ppuVar28,
                      puVar30,uVar32);
        uVar23 = (undefined4)((ulonglong)puVar9 >> 0x20);
        uVar29 = (undefined4)((ulonglong)uVar25 >> 0x20);
LAB_1401b04a7:
        lVar7 = local_148;
        uVar18 = *(uint *)(local_148 + 0x20);
        plVar10 = (longlong *)FUN_14013c310();
        uVar31 = (undefined4)(uVar32 >> 0x20);
        puVar11 = puVar16;
        if (*plVar10 != 0) {
          for (puVar14 = *(uint **)(*plVar10 +
                                   ((ulonglong)uVar18 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
              (puVar11 = puVar16, puVar14 != (uint *)0x0 &&
              ((puVar14[0x3a] != uVar18 || (puVar11 = puVar14, *puVar14 != uVar18))));
              puVar14 = *(uint **)(puVar14 + 0x38)) {
          }
        }
        if ((puVar11 == (uint *)0x0) || (puVar11[0x34] == 0)) {
          uVar18 = *(uint *)(lVar7 + 0x20);
          plVar10 = (longlong *)FUN_14013c310();
          uVar31 = (undefined4)(uVar32 >> 0x20);
          puVar11 = puVar16;
          if (*plVar10 != 0) {
            for (puVar14 = *(uint **)(*plVar10 +
                                     ((ulonglong)uVar18 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
                (puVar11 = puVar16, puVar14 != (uint *)0x0 &&
                ((puVar14[0x3a] != uVar18 || (puVar11 = puVar14, *puVar14 != uVar18))));
                puVar14 = *(uint **)(puVar14 + 0x38)) {
            }
          }
          if ((puVar11 != (uint *)0x0) && (uVar18 = puVar11[0x35], uVar18 != 0)) {
            iVar4 = *(int *)(param_1 + 0x5d4) + uVar18;
            *(int *)(param_1 + 0x5d4) = iVar4;
            ppuVar28 = (uint **)CONCAT44((int)((ulonglong)ppuVar28 >> 0x20),iVar4);
            uVar17 = CONCAT44(uVar29,iVar4 - uVar18);
            uVar8 = CONCAT44(uVar23,uVar18);
            FUN_140203920(*(undefined8 *)(param_1 + 0xb50),param_1,0x12d,0,uVar8,uVar17,ppuVar28);
            puVar14 = (uint *)(lVar7 + 0x24);
            puVar11 = puVar16;
            do {
              uVar23 = (undefined4)((ulonglong)uVar8 >> 0x20);
              uVar29 = (undefined4)((ulonglong)uVar17 >> 0x20);
              uVar31 = (undefined4)((ulonglong)ppuVar28 >> 0x20);
              uVar18 = *puVar14;
              if (uVar18 != 0) {
                plVar10 = (longlong *)FUN_14013c310();
                uVar5 = uVar15;
                if (*plVar10 != 0) {
                  for (puVar12 = *(uint **)(*plVar10 +
                                           ((ulonglong)uVar18 % (ulonglong)*(uint *)(plVar10 + 2)) *
                                           8); puVar12 != (uint *)0x0;
                      puVar12 = *(uint **)(puVar12 + 0x38)) {
                    if ((puVar12[0x3a] == uVar18) && (*puVar12 == uVar18)) {
                      if (puVar12 != (uint *)0x0) {
                        uVar5 = puVar12[0x35];
                      }
                      break;
                    }
                  }
                }
                iVar4 = *(int *)(param_1 + 0x5d4) + uVar5;
                *(int *)(param_1 + 0x5d4) = iVar4;
                ppuVar28 = (uint **)CONCAT44(uVar31,iVar4);
                uVar17 = CONCAT44(uVar29,iVar4 - uVar5);
                uVar8 = CONCAT44(uVar23,uVar5);
                FUN_140203920(*(undefined8 *)(param_1 + 0xb50),param_1,0x12d,0,uVar8,uVar17,ppuVar28
                             );
              }
              uVar31 = (undefined4)(uVar32 >> 0x20);
              uVar18 = (int)puVar11 + 1;
              puVar11 = (uint *)(ulonglong)uVar18;
              puVar14 = puVar14 + 1;
            } while ((int)uVar18 < 3);
            local_res8[0] = *(uint *)(param_1 + 0x5d4);
            plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar10 + 0xbf0))
                      (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8);
            local_168[0] = *(undefined4 *)(param_1 + 0x5d4);
            local_160 = *(uint **)(param_1 + 0x160);
            local_158 = *(undefined4 *)(param_1 + 0x168);
            uStack_154 = *(undefined4 *)(param_1 + 0x16c);
            iVar4 = *(int *)(param_1 + 0x284);
            lVar7 = local_148;
            if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
               (lVar19 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar19 != 0)) {
              local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar4);
              plVar10 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(lVar19 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                        0x70);
              (**(code **)(*plVar10 + 0xe20))
                        (plVar10,1,&DAT_1405d85a0,local_res8,&local_160,local_168);
              lVar7 = local_148;
            }
          }
        }
        local_160 = *(uint **)(param_1 + 0x160);
        local_158 = *(undefined4 *)(param_1 + 0x168);
        uStack_154 = *(undefined4 *)(param_1 + 0x16c);
        local_130 = *(undefined8 *)(param_1 + 0x170);
        local_128 = *(undefined4 *)(param_1 + 0x178);
        local_124 = *(undefined4 *)(param_1 + 0x17c);
        iVar4 = *(int *)(param_1 + 0x284);
        local_168[0] = *(undefined4 *)(param_1 + 8);
        if ((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
          if ((CONCAT44(uStack_e4,local_e8) != 0) ||
             (uVar18 = uVar6, CONCAT44(uStack_dc,uStack_e0) != 0)) {
            uVar18 = 1;
          }
          if (((uVar18 != 0) && (local_d0 != 0)) &&
             (lVar19 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar19 != 0)) {
            local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar4);
            plVar10 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar19 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                      );
            puVar9 = &local_e8;
            puVar30 = &DAT_14047ba54;
            ppuVar28 = &local_160;
            (**(code **)(*plVar10 + 0xb0))
                      (plVar10,1,&DAT_1405d85a0,local_res8,local_168,&local_130,ppuVar28,
                       &DAT_14047ba54,puVar9);
            uVar31 = (undefined4)((ulonglong)puVar9 >> 0x20);
          }
        }
        plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        (**(code **)(*plVar10 + 0xc0))
                  (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_d4,&local_d2,&local_e8
                  );
        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c3,0xb,param_1,&local_e8,(int)local_cc,
                      (ulonglong)ppuVar28 & 0xffffffff00000000,
                      (ulonglong)puVar30 & 0xffffffff00000000,CONCAT44(uVar31,(int)local_cc));
        local_160 = *(uint **)(param_1 + 0x170);
        local_158 = *(undefined4 *)(param_1 + 0x178);
        uStack_154 = *(undefined4 *)(param_1 + 0x17c);
        iVar4 = *(int *)(param_1 + 0x284);
        local_168[0] = *(undefined4 *)(param_1 + 8);
        if ((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
          if ((local_160 != (uint *)0x0) || (*(longlong *)(param_1 + 0x178) != 0)) {
            uVar6 = 1;
          }
          if ((uVar6 != 0) &&
             (lVar19 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar19 != 0)) {
            local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar4);
            plVar10 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar19 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                      );
            (**(code **)(*plVar10 + 0xa70))
                      (plVar10,1,&DAT_1405d85a0,local_res8,local_168,&local_160,lVar7);
          }
        }
        puVar22 = *(undefined8 **)(param_1 + 0x6e0);
        if (puVar22 != (undefined8 *)0x0) {
          if (puVar22 == *(undefined8 **)(param_1 + 0x6e8)) {
            puVar16 = (uint *)*puVar22;
          }
          else {
            iVar4 = DAT_14060804c + 1;
            bVar21 = DAT_14060804c == 0;
            DAT_14060804c = iVar4;
            if (bVar21) {
              FUN_140176d60(1);
            }
          }
        }
        FUN_14020b1c0(puVar16,lVar7);
        if (local_f0 != '\0') {
          FUN_14034edd0(local_120);
        }
        return 1;
      }
    }
    else {
      iVar4 = DAT_140608048;
      DAT_140608048 = DAT_140608048 + 1;
LAB_1401b0a17:
      if (iVar4 == 0) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401b0a23:
  bVar21 = !bVar21;
LAB_1401b0a26:
  if (!bVar21) {
    FUN_14034edd0(puVar11);
  }
  return 0;
}



void FUN_1401b0a60(longlong param_1,int *param_2,int *param_3,undefined8 param_4,wchar_t *param_5,
                  char param_6)

{
  wchar_t wVar1;
  wchar_t wVar2;
  int iVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  bool bVar9;
  bool bVar10;
  undefined4 local_res8 [2];
  undefined4 local_f8 [2];
  longlong local_f0;
  undefined1 local_e8;
  undefined8 local_e0;
  undefined1 local_d8 [116];
  ulonglong local_64 [6];
  undefined4 local_30;
  
  local_e0 = 0xfffffffffffffffe;
  lVar8 = 0;
  lVar6 = 0;
  local_f0 = 0;
  bVar10 = false;
  local_e8 = 0;
  plVar5 = *(longlong **)(param_1 + 0xb28);
  lVar7 = lVar8;
  if (plVar5 != (longlong *)0x0) {
    lVar7 = lVar6;
    if (plVar5 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar5 != 0) {
        lVar7 = *plVar5;
        if ((plVar5 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar7 = lVar8,
           DAT_1406080a8 = iVar4, bVar10)) {
          FUN_140176d60(1);
        }
        local_e8 = 0;
        local_f0 = lVar7;
        FUN_14034ed40(lVar7);
        bVar10 = true;
        local_e8 = 1;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  plVar5 = *(longlong **)(param_1 + 0x6c0);
  if (plVar5 != (longlong *)0x0) {
    if (plVar5 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar5 != 0) {
        lVar6 = *plVar5;
        if ((plVar5 != *(longlong **)(param_1 + 0x6c8)) &&
           (iVar4 = DAT_140608048 + 1, bVar9 = DAT_140608048 == 0, lVar6 = lVar8,
           DAT_140608048 = iVar4, bVar9)) {
          FUN_140176d60(1);
        }
        if ((*param_2 < 0) || (iVar4 = FUN_1401ed380(lVar6,param_4,param_2,param_3), iVar4 == 0)) {
          local_res8[0] = 0x17;
          local_f8[0] = 0x2b4a;
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar5 + 0x70))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,local_res8);
        }
        else {
          FUN_14000a170(local_d8);
          local_30 = 0;
          plVar5 = *(longlong **)(param_1 + 0x6c0);
          if (plVar5 != (longlong *)0x0) {
            if (plVar5 == *(longlong **)(param_1 + 0x6c8)) {
              lVar8 = *plVar5;
            }
            else {
              iVar4 = DAT_140608048 + 1;
              bVar9 = DAT_140608048 == 0;
              DAT_140608048 = iVar4;
              if (bVar9) {
                FUN_140176d60(1);
              }
            }
          }
          iVar4 = *param_2;
          if ((-1 < iVar4) && (iVar4 < 5)) {
            iVar3 = *param_3;
            if ((-1 < iVar3) && (iVar3 < 0x18)) {
              *(short *)(((longlong)iVar3 + (longlong)iVar4 * 0x18) * 0xac + 0x14 + lVar8) =
                   (short)*param_2;
              *(short *)(((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + 0x16 + lVar8) =
                   (short)*param_3;
              iVar4 = *param_2;
              FUN_140090020(local_d8,((longlong)*param_3 + (longlong)iVar4 * 0x18) * 0xac + lVar8);
              if (param_6 == '\x01') {
                if ((wchar_t)local_64[0] != L'\0') {
                  lVar8 = (longlong)local_64 - (longlong)param_5;
                  do {
                    wVar1 = *param_5;
                    wVar2 = *(wchar_t *)((longlong)param_5 + lVar8);
                    if (wVar1 != wVar2) break;
                    param_5 = param_5 + 1;
                  } while (wVar2 != L'\0');
                  if (wVar1 == wVar2) {
                    local_64[0] = 0;
                  }
                  else {
                    local_res8[0] = 0x1a;
                    local_f8[0] = 0x2b4a;
                    plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    (**(code **)(*plVar5 + 0x70))
                              (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,
                               local_res8);
                  }
                }
              }
              else if (iVar4 == 0) {
                local_res8[0] = 0x17;
                local_f8[0] = 0x2b4a;
                plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                (**(code **)(*plVar5 + 0x70))
                          (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,local_res8);
              }
              else if ((wchar_t)local_64[0] == L'\0') {
                if (param_5[3] == L'\0') {
                  wcsncpy_s((wchar_t *)local_64,4,param_5,3);
                  local_64[0] = local_64[0] & 0xffffffffffff;
                  local_res8[0] = 1;
                  local_f8[0] = 0x2b4a;
                  plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar5 + 0x70))
                            (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,local_res8)
                  ;
                  FUN_1401ffe20(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                                *(undefined4 *)(param_1 + 0x284),local_d8,param_5);
                }
              }
              else {
                local_res8[0] = 1;
                local_f8[0] = 0x2b4a;
                plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                (**(code **)(*plVar5 + 0x70))
                          (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,local_res8);
              }
              goto LAB_1401b0e8a;
            }
          }
          local_res8[0] = 0x15;
          local_f8[0] = 0x2b4a;
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar5 + 0x70))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_f8,local_res8);
        }
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar9 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401b0e8a:
  if (bVar10) {
    FUN_14034edd0(lVar7);
  }
  return;
}



undefined8 FUN_1401b0ec0(longlong param_1,longlong *param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  undefined8 uVar8;
  int *piVar9;
  uint *puVar10;
  longlong *plVar11;
  longlong *plVar12;
  longlong *plVar13;
  longlong *plVar14;
  byte bVar15;
  uint uVar16;
  longlong lVar17;
  bool bVar18;
  bool bVar19;
  int local_res8 [2];
  longlong *local_res10;
  uint local_res18 [2];
  int local_res20 [2];
  undefined8 in_stack_ffffffffffffff38;
  undefined4 uVar22;
  int *piVar20;
  undefined8 uVar21;
  int *in_stack_ffffffffffffff40;
  undefined4 uVar23;
  uint local_a8 [2];
  uint local_a0;
  int local_9c;
  longlong *local_98;
  longlong local_90;
  undefined4 local_88;
  undefined4 uStack_84;
  int local_80;
  longlong local_78;
  longlong *local_70;
  char local_68;
  int local_60 [4];
  undefined8 local_50;
  
  local_50 = 0xfffffffffffffffe;
  plVar13 = (longlong *)0x0;
  iVar5 = 0;
  plVar14 = (longlong *)0x0;
  local_98 = (longlong *)0x0;
  local_70 = (longlong *)0x0;
  bVar19 = false;
  local_68 = '\0';
  plVar12 = *(longlong **)(param_1 + 0xb28);
  plVar11 = plVar13;
  local_res10 = param_2;
  if (plVar12 != (longlong *)0x0) {
    plVar11 = plVar14;
    if (plVar12 == *(longlong **)(param_1 + 0xb30)) {
      if ((longlong *)*plVar12 != (longlong *)0x0) {
        plVar11 = (longlong *)*plVar12;
        if ((plVar12 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar19 = DAT_1406080a8 == 0, plVar11 = plVar13,
           DAT_1406080a8 = iVar4, bVar19)) {
          FUN_140176d60(1);
        }
        local_68 = 0;
        local_98 = plVar11;
        local_70 = plVar11;
        FUN_14034ed40(plVar11);
        bVar19 = true;
        local_68 = '\x01';
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar18 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  plVar12 = *(longlong **)(param_1 + 0x6e0);
  if (plVar12 != (longlong *)0x0) {
    if (plVar12 == *(longlong **)(param_1 + 0x6e8)) {
      if (((longlong *)*plVar12 != (longlong *)0x0) &&
         (plVar14 = *(longlong **)(param_1 + 0x9a0), plVar14 != (longlong *)0x0)) {
        if (plVar14 == *(longlong **)(param_1 + 0x9a8)) {
          if (*plVar14 != 0) {
            plVar14 = (longlong *)*plVar12;
            if ((plVar12 != *(longlong **)(param_1 + 0x6e8)) &&
               (iVar4 = DAT_14060804c + 1, bVar18 = DAT_14060804c == 0, plVar14 = plVar13,
               DAT_14060804c = iVar4, bVar18)) {
              FUN_140176d60(1);
            }
            local_90 = (**(code **)(*plVar14 + 0x270))();
            if (local_90 != 0) {
              local_80 = *(int *)(local_90 + 0x6c);
              local_a0 = 0;
              lVar7 = *param_2;
              lVar2 = param_2[1] - lVar7 >> 0x3f;
              lVar17 = local_90;
              if ((param_2[1] - lVar7) / 5 + lVar2 != lVar2) {
                local_78 = 0;
                local_9c = local_res8[0];
                iVar4 = local_res8[0];
                while( true ) {
                  lVar17 = local_90;
                  uVar22 = (undefined4)((ulonglong)in_stack_ffffffffffffff38 >> 0x20);
                  uVar23 = (undefined4)((ulonglong)in_stack_ffffffffffffff40 >> 0x20);
                  bVar15 = *(byte *)(lVar7 + local_78);
                  local_res8[0] = CONCAT31(local_res8[0]._1_3_,bVar15);
                  local_res20[0] = *(int *)(lVar7 + 1 + local_78);
                  plVar12 = *(longlong **)(param_1 + 0x9a0);
                  plVar11 = plVar13;
                  if (plVar12 != (longlong *)0x0) {
                    if (plVar12 == *(longlong **)(param_1 + 0x9a8)) {
                      plVar11 = (longlong *)*plVar12;
                    }
                    else {
                      iVar6 = DAT_1406080c8 + 1;
                      bVar19 = DAT_1406080c8 == 0;
                      DAT_1406080c8 = iVar6;
                      if (bVar19) {
                        FUN_140176d60(1);
                        bVar15 = (byte)local_res8[0];
                      }
                    }
                  }
                  iVar6 = FUN_14025caa0(plVar11,local_res20[0],bVar15);
                  if (iVar6 != 0) break;
                  plVar12 = *(longlong **)(param_1 + 0x6e0);
                  plVar11 = plVar13;
                  if (plVar12 != (longlong *)0x0) {
                    if (plVar12 == *(longlong **)(param_1 + 0x6e8)) {
                      plVar11 = (longlong *)*plVar12;
                    }
                    else {
                      iVar6 = DAT_14060804c + 1;
                      bVar19 = DAT_14060804c == 0;
                      DAT_14060804c = iVar6;
                      if (bVar19) {
                        FUN_140176d60(1);
                      }
                    }
                  }
                  lVar7 = FUN_1402d6230(plVar11,local_res20[0],bVar15);
                  if (lVar7 != 0) {
                    local_9c = *(int *)(lVar7 + 0x2c);
                    iVar4 = *(int *)(lVar7 + 0x54);
                  }
                  iVar6 = FUN_1402f8580(plVar11);
                  if (iVar6 < local_9c) break;
                  lVar7 = (**(code **)(*plVar11 + 0x278))(plVar11);
                  iVar6 = iVar5;
                  if (lVar7 != 0) {
                    iVar6 = *(int *)(lVar7 + 0x6c);
                  }
                  if (iVar6 < iVar4) break;
                  uVar16 = (uint)bVar15;
                  cVar3 = FUN_1401b1510(param_1,local_res20[0],bVar15);
                  if (cVar3 == '\0') break;
                  uVar8 = FUN_140174f50(param_1 + 0x6e0);
                  piVar9 = (int *)FUN_1402d63a0(uVar8,local_res20[0],uVar16);
                  if ((piVar9 == (int *)0x0) || (*(int *)(lVar17 + 0x6c) < iVar4)) break;
                  if (0 < iVar4) {
                    local_a8[0] = *(int *)(lVar17 + 0x6c) - iVar4;
                    local_res18[0] = 0;
                    puVar10 = local_res18;
                    if (-1 < (int)local_a8[0]) {
                      puVar10 = local_a8;
                    }
                    *(uint *)(lVar17 + 0x6c) = *puVar10;
                  }
                  FUN_140198d00(param_1,local_60,0,piVar9[0x1c] + -1,CONCAT44(uVar22,local_res20[0])
                                ,CONCAT44(uVar23,uVar16));
                  local_res18[0] = CONCAT31(local_res18[0]._1_3_,1);
                  local_a8[0] = *(uint *)(lVar17 + 0x6c);
                  local_res8[0] = CONCAT22(local_res8[0]._2_2_,(ushort)(byte)local_res8[0]);
                  plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  in_stack_ffffffffffffff40 = local_res8;
                  piVar20 = local_res20;
                  (**(code **)(*plVar12 + 800))
                            (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_60,piVar20,
                             in_stack_ffffffffffffff40,local_a8,local_res18);
                  uVar22 = (undefined4)((ulonglong)piVar20 >> 0x20);
                  lVar7 = FUN_1401de990(param_1 + 0x9b0);
                  if (lVar7 != 0) {
                    uVar8 = FUN_1401de990(param_1 + 0x9b0);
                    uVar21 = CONCAT44(uVar22,uVar16);
                    in_stack_ffffffffffffff40 = piVar9;
                    FUN_140261a10(uVar8,param_1,local_60,local_res20[0],uVar21,piVar9);
                    uVar22 = (undefined4)((ulonglong)uVar21 >> 0x20);
                  }
                  if ((0 < piVar9[0x1c]) &&
                     (iVar6 = FUN_140198ec0(param_1,0,piVar9[0x1c] + -1,local_60), iVar6 != 0)) {
                    local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)piVar9[0x1c] + -1);
                    local_res18[0] = local_res18[0] & 0xffff0000;
                    plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    in_stack_ffffffffffffff40 = local_60;
                    piVar9 = local_res8;
                    (**(code **)(*plVar12 + 0x330))
                              (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18,
                               piVar9,in_stack_ffffffffffffff40);
                    uVar22 = (undefined4)((ulonglong)piVar9 >> 0x20);
                  }
                  in_stack_ffffffffffffff38 = CONCAT44(uVar22,iVar4);
                  FUN_140202c10(*(undefined8 *)(param_1 + 0xb50),param_1,local_res20[0],bVar15,
                                in_stack_ffffffffffffff38);
                  local_a0 = local_a0 + 1;
                  local_78 = local_78 + 5;
                  lVar7 = *local_res10;
                  lVar17 = local_90;
                  if ((ulonglong)((local_res10[1] - lVar7) / 5) <= (ulonglong)local_a0) break;
                }
              }
              iVar4 = local_80;
              puVar1 = *(undefined8 **)(param_1 + 0x9c0);
              if (puVar1 != (undefined8 *)0x0) {
                if (puVar1 == *(undefined8 **)(param_1 + 0x9c8)) {
                  if ((longlong *)*puVar1 != (longlong *)0x0) {
                    plVar12 = (longlong *)*puVar1;
                    if ((puVar1 != *(undefined8 **)(param_1 + 0x9c8)) &&
                       (iVar6 = DAT_1406080d0 + 1, bVar19 = DAT_1406080d0 == 0, plVar12 = plVar13,
                       DAT_1406080d0 = iVar6, bVar19)) {
                      FUN_140176d60(1);
                    }
                    FUN_140258450(plVar12,param_1);
                  }
                }
                else {
                  iVar6 = DAT_1406080d0 + 1;
                  bVar19 = DAT_1406080d0 == 0;
                  DAT_1406080d0 = iVar6;
                  if (bVar19) {
                    FUN_140176d60(1);
                  }
                }
              }
              iVar6 = *(int *)(lVar17 + 0x6c);
              if (iVar4 != iVar6) {
                local_res18[0] = *(uint *)(lVar17 + 0x70);
                local_90 = *(longlong *)(param_1 + 0x170);
                local_88 = *(undefined4 *)(param_1 + 0x178);
                uStack_84 = *(undefined4 *)(param_1 + 0x17c);
                iVar4 = *(int *)(param_1 + 0x284);
                local_res20[0] = iVar6;
                if ((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                  if ((local_90 != 0) || (*(longlong *)(param_1 + 0x178) != 0)) {
                    iVar5 = 1;
                  }
                  if ((iVar5 != 0) &&
                     (lVar7 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar7 != 0)) {
                    local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar4);
                    plVar12 = (longlong *)
                              (*(longlong *)
                                (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                              + 0x70);
                    (**(code **)(*plVar12 + 0x240))
                              (plVar12,1,&DAT_1405d85a0,local_res8,&local_90,local_res20,local_res18
                              );
                  }
                }
              }
              FUN_14019c070(param_1,1);
              if (local_68 != '\0') {
                FUN_14034edd0(local_98);
              }
              return 1;
            }
            local_90 = 0;
          }
        }
        else {
          iVar5 = DAT_1406080c8 + 1;
          bVar18 = DAT_1406080c8 == 0;
          DAT_1406080c8 = iVar5;
          if (bVar18) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar18 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar19) {
    FUN_14034edd0(plVar11);
  }
  return 0;
}



undefined8 FUN_1401b1510(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  undefined4 uVar1;
  ulonglong *puVar2;
  longlong lVar3;
  undefined8 *puVar4;
  void *pvVar5;
  void *pvVar6;
  int iVar7;
  DWORD DVar8;
  int iVar9;
  undefined8 uVar10;
  ulonglong uVar11;
  HANDLE pvVar12;
  HANDLE pvVar13;
  longlong lVar14;
  longlong lVar15;
  undefined4 *puVar16;
  int *piVar17;
  longlong lVar18;
  ulonglong uVar19;
  uint uVar20;
  bool bVar21;
  void *local_70;
  void *local_68;
  undefined8 local_60;
  
  uVar19 = 0;
  local_70 = (void *)0x0;
  local_68 = (void *)0x0;
  local_60 = 0;
  puVar2 = *(ulonglong **)(param_1 + 0x6e0);
  uVar11 = uVar19;
  if (puVar2 != (ulonglong *)0x0) {
    if (puVar2 == *(ulonglong **)(param_1 + 0x6e8)) {
      uVar11 = *puVar2;
    }
    else {
      iVar7 = DAT_14060804c + 1;
      bVar21 = DAT_14060804c == 0;
      DAT_14060804c = iVar7;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
  uVar1 = *(undefined4 *)(uVar11 + 0x120);
  uVar10 = FUN_1402ec2c0();
  FUN_1402eb6e0(uVar10,uVar1,param_2,param_3,&local_70);
  pvVar6 = local_68;
  pvVar5 = local_70;
  if (local_70 == local_68) {
    if (local_70 != (void *)0x0) {
      operator_delete(local_70);
    }
LAB_1401b15c7:
    uVar10 = 1;
  }
  else {
    puVar2 = *(ulonglong **)(param_1 + 0x6e0);
    uVar11 = uVar19;
    if (puVar2 != (ulonglong *)0x0) {
      if (puVar2 == *(ulonglong **)(param_1 + 0x6e8)) {
        uVar11 = *puVar2;
      }
      else {
        iVar7 = DAT_14060804c + 1;
        bVar21 = DAT_14060804c == 0;
        DAT_14060804c = iVar7;
        if (bVar21) {
          FUN_140176d60(1);
        }
      }
    }
    lVar3 = *(longlong *)(uVar11 + 0x11b0);
    if ((lVar3 != 0) &&
       (lVar18 = ((longlong)pvVar6 - (longlong)pvVar5) / 6 +
                 ((longlong)pvVar6 - (longlong)pvVar5 >> 0x3f), lVar15 = lVar18 >> 2,
       lVar18 = lVar18 >> 0x3f, lVar15 != lVar18)) {
LAB_1401b1660:
      uVar20 = 0;
      do {
        if (uVar20 < 3) {
          puVar16 = (undefined4 *)((longlong)pvVar5 + (longlong)(int)uVar20 * 8 + uVar19 * 0x18);
        }
        else {
          if ((DAT_1406080c0 == 0) &&
             (pvVar12 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), pvVar12 != (HANDLE)0x0)) {
            DVar8 = GetCurrentProcessId();
            pvVar13 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar13,DVar8,pvVar12,0x2000,0,0,0);
            CloseHandle(pvVar12);
          }
          DAT_1406080c0 = DAT_1406080c0 + 1;
          puVar16 = &DAT_14060cfc0;
        }
        iVar7 = puVar16[1];
        if (uVar20 < 3) {
          piVar17 = (int *)((longlong)pvVar5 + (longlong)(int)uVar20 * 8 + uVar19 * 0x18);
        }
        else {
          if ((DAT_1406080c0 == 0) &&
             (pvVar12 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), pvVar12 != (HANDLE)0x0)) {
            DVar8 = GetCurrentProcessId();
            pvVar13 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar13,DVar8,pvVar12,0x2000,0,0,0);
            CloseHandle(pvVar12);
          }
          DAT_1406080c0 = DAT_1406080c0 + 1;
          piVar17 = &DAT_14060cfc0;
        }
        if ((iVar7 != 0) || (*piVar17 != 0)) {
          lVar14 = FUN_14030d840(lVar3,param_2,param_3);
          if (lVar14 == 0) {
            if (pvVar5 != (void *)0x0) {
              operator_delete(pvVar5);
              return 1;
            }
            goto LAB_1401b15c7;
          }
          puVar4 = *(undefined8 **)(param_1 + 0x9a0);
          if (puVar4 == (undefined8 *)0x0) {
LAB_1401b180f:
            uVar10 = 0;
          }
          else {
            if (puVar4 != *(undefined8 **)(param_1 + 0x9a8)) {
              iVar9 = DAT_1406080c8 + 1;
              bVar21 = DAT_1406080c8 == 0;
              DAT_1406080c8 = iVar9;
              if (bVar21) {
                FUN_140176d60(1);
              }
              goto LAB_1401b180f;
            }
            uVar10 = *puVar4;
          }
          iVar7 = FUN_14025e1b0(uVar10,iVar7);
          if (iVar7 == 0) goto LAB_1401b182d;
        }
        uVar20 = uVar20 + 1;
        if (2 < (int)uVar20) {
          if (pvVar5 != (void *)0x0) {
            operator_delete(pvVar5);
            return 1;
          }
          goto LAB_1401b15c7;
        }
      } while( true );
    }
LAB_1401b1870:
    if (pvVar5 != (void *)0x0) {
      operator_delete(pvVar5);
    }
    uVar10 = 0;
  }
  return uVar10;
LAB_1401b182d:
  uVar19 = (ulonglong)((int)uVar19 + 1);
  if ((ulonglong)(lVar15 - lVar18) <= uVar19) goto LAB_1401b1870;
  goto LAB_1401b1660;
}



undefined8 FUN_1401b18a0(longlong param_1,int param_2)

{
  longlong *plVar1;
  void *pvVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  int iVar5;
  undefined4 uVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong *plVar9;
  undefined8 uVar10;
  bool bVar11;
  int local_res18 [2];
  int local_res20 [2];
  longlong *local_60;
  longlong *local_58;
  longlong local_50;
  char local_48;
  longlong *local_40;
  longlong *local_38;
  
  FUN_140198570(param_1,&local_60);
  plVar9 = local_60;
  if (local_60 != (longlong *)0x0) {
    if (local_60 == local_58) {
      if (*local_60 != 0) {
        uVar10 = 0;
        local_50 = 0;
        local_48 = '\0';
        plVar1 = *(longlong **)(param_1 + 0xb28);
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
            lVar7 = *plVar1;
            if (lVar7 != 0) {
              if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
                 (iVar5 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, lVar7 = 0,
                 DAT_1406080a8 = iVar5, bVar11)) {
                FUN_140176d60(1);
              }
              local_48 = 0;
              local_50 = lVar7;
              FUN_14034ed40(lVar7);
              local_48 = '\x01';
            }
          }
          else {
            iVar5 = DAT_1406080a8 + 1;
            bVar11 = DAT_1406080a8 == 0;
            DAT_1406080a8 = iVar5;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
        plVar1 = *(longlong **)(param_1 + 0x9d0);
        if (plVar1 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
          UNLOCK();
          plVar9 = local_60;
        }
        uVar4 = DAT_140608098;
        local_40 = plVar1;
        local_38 = plVar1;
        uVar6 = FUN_1402f8580(*plVar9);
        local_res18[0] = FUN_140314470(uVar4,uVar6);
        plVar8 = local_40;
        if (local_res18[0] == -1) {
          if (plVar1 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar7 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            plVar9 = local_60;
            if ((int)lVar7 == 1) {
              pvVar2 = (void *)*local_40;
              if (pvVar2 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar2 + 0x9130);
                operator_delete(pvVar2);
              }
              operator_delete(plVar8);
              plVar9 = local_60;
            }
          }
          if (local_48 != '\0') {
            FUN_14034edd0(local_50);
          }
          LOCK();
          plVar9 = plVar9 + 1;
          *(int *)plVar9 = (int)*plVar9 + -1;
          UNLOCK();
          if ((int)*plVar9 == 0) {
            puVar3 = (undefined8 *)*local_60;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(local_60);
          }
          return 0;
        }
        if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
          lVar7 = FUN_140174f00(param_1 + 0x6c0);
          param_2 = *(int *)(lVar7 + 0x50a0) + *(int *)(*plVar1 + 0x9120) + param_2;
          if (local_res18[0] < param_2) {
            uVar10 = 1;
            local_res20[0] = param_2 - local_res18[0];
            plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar8 + 0x970))
                      (plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18,local_res20);
          }
        }
        plVar8 = local_40;
        if (plVar1 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar1 + 1;
          lVar7 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          plVar9 = local_60;
          if ((int)lVar7 == 1) {
            pvVar2 = (void *)*local_40;
            if (pvVar2 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar2 + 0x9130);
              operator_delete(pvVar2);
            }
            operator_delete(plVar8);
            plVar9 = local_60;
          }
        }
        if (local_48 != '\0') {
          FUN_14034edd0(local_50);
        }
        LOCK();
        plVar9 = plVar9 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 != 0) {
          return uVar10;
        }
        puVar3 = (undefined8 *)*local_60;
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        operator_delete(local_60);
        return uVar10;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar11 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == local_58) {
      LOCK();
      plVar9 = plVar9 + 1;
      *(int *)plVar9 = (int)*plVar9 + -1;
      UNLOCK();
      if ((int)*plVar9 == 0) {
        puVar3 = (undefined8 *)*local_60;
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        operator_delete(local_60);
      }
    }
    else {
      iVar5 = DAT_140608054 + 1;
      bVar11 = DAT_140608054 == 0;
      DAT_140608054 = iVar5;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  wchar_t *_Src;
  bool bVar6;
  undefined2 local_d8;
  undefined2 uStack_d6;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  wchar_t local_b0 [17];
  undefined8 local_8e;
  undefined8 local_86;
  undefined8 local_7e;
  undefined4 local_76;
  undefined2 local_72;
  undefined4 local_70;
  undefined4 uStack_6c;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 local_60;
  undefined4 uStack_5c;
  undefined4 local_58;
  undefined4 uStack_54;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 local_40;
  undefined8 local_3c;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_28,param_3,param_2,0);
  plVar1 = local_28;
  if (local_28 != (longlong *)0x0) {
    if (local_28 == local_20) {
      if (*local_28 != 0) {
        lVar4 = FUN_140209770(*local_28,param_2,0);
        if (lVar4 != 0) {
          local_b0[0x10] = 0;
          local_8e = 0;
          local_86 = 0;
          local_7e = 0;
          local_76 = 0;
          local_72 = 0;
          local_70 = 0;
          uStack_6c = 0;
          local_68 = 0;
          uStack_64 = 0;
          local_60 = 0;
          uStack_5c = 0;
          local_58 = 0;
          uStack_54 = 0;
          local_50 = 0;
          uStack_4c = 0;
          local_48 = 0;
          uStack_44 = 0;
          local_40 = 0;
          local_3c = 0;
          local_b0[0] = L'\0';
          local_b0[1] = L'\0';
          local_b0[2] = L'\0';
          local_b0[3] = L'\0';
          local_b0[4] = L'\0';
          local_b0[5] = L'\0';
          local_b0[6] = L'\0';
          local_b0[7] = L'\0';
          local_b0[8] = L'\0';
          local_b0[9] = L'\0';
          local_b0[10] = L'\0';
          local_b0[0xb] = L'\0';
          local_b0[0xc] = L'\0';
          local_b0[0xd] = L'\0';
          local_b0[0xe] = L'\0';
          local_b0[0xf] = L'\0';
          _local_d8 = CONCAT22(*(undefined2 *)(lVar4 + 0x1c),*(undefined2 *)(lVar4 + 0x18));
          local_d4 = *(undefined4 *)(lVar4 + 0x20);
          local_d0 = *(undefined4 *)(lVar4 + 0x24);
          local_cc = *(undefined4 *)(lVar4 + 0x28);
          local_c8 = *(undefined4 *)(lVar4 + 0x2c);
          local_c4 = *(undefined4 *)(lVar4 + 0x30);
          local_c0 = *(undefined4 *)(lVar4 + 0x34);
          local_bc = *(undefined4 *)(lVar4 + 0x38);
          local_b8 = *(undefined4 *)(lVar4 + 0x3c);
          local_b4 = *(undefined4 *)(lVar4 + 0x40);
          _Src = (wchar_t *)(lVar4 + 0x48);
          if (7 < *(ulonglong *)(lVar4 + 0x60)) {
            _Src = *(wchar_t **)_Src;
          }
          wcscpy_s(local_b0,0x10,_Src);
          local_b0[0x10] = *(undefined2 *)(lVar4 + 0x70);
          local_8e = *(undefined8 *)(lVar4 + 0x74);
          local_86 = *(undefined8 *)(lVar4 + 0x80);
          local_7e = *(undefined8 *)(lVar4 + 0x88);
          local_76 = *(undefined4 *)(lVar4 + 0x90);
          local_72 = *(undefined2 *)(lVar4 + 0x9c);
          local_70 = *(undefined4 *)(lVar4 + 0xa0);
          uStack_6c = (undefined4)*(undefined8 *)(lVar4 + 0xa4);
          local_68 = (undefined4)((ulonglong)*(undefined8 *)(lVar4 + 0xa4) >> 0x20);
          uStack_64 = (undefined4)*(undefined8 *)(lVar4 + 0xac);
          local_60 = (undefined4)((ulonglong)*(undefined8 *)(lVar4 + 0xac) >> 0x20);
          uStack_5c = (undefined4)*(undefined8 *)(lVar4 + 0xb4);
          local_58 = (undefined4)((ulonglong)*(undefined8 *)(lVar4 + 0xb4) >> 0x20);
          uStack_54 = (undefined4)*(undefined8 *)(lVar4 + 0xbc);
          local_50 = (undefined4)((ulonglong)*(undefined8 *)(lVar4 + 0xbc) >> 0x20);
          uStack_4c = (undefined4)*(undefined8 *)(lVar4 + 0xc4);
          local_48 = (undefined4)((ulonglong)*(undefined8 *)(lVar4 + 0xc4) >> 0x20);
          uStack_44 = (undefined4)*(undefined8 *)(lVar4 + 0xcc);
          local_40 = (undefined4)((ulonglong)*(undefined8 *)(lVar4 + 0xcc) >> 0x20);
          local_3c = *(undefined8 *)(lVar4 + 0xd4);
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x3c0);
          (**(code **)(*plVar5 + 0x620))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_d8);
        }
        goto LAB_1401b1e2f;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_20) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401b1e2f:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar2 = (undefined8 *)*local_28;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_28);
  }
  return;
}



ulonglong FUN_1401b1e70(longlong param_1,undefined8 param_2,undefined1 param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  undefined8 *puVar4;
  uint uVar5;
  ulonglong uVar6;
  longlong lVar7;
  ulonglong extraout_RAX;
  longlong *plVar8;
  bool bVar9;
  undefined2 local_res20 [4];
  undefined8 uVar10;
  undefined4 local_a0;
  undefined4 uStack_9c;
  undefined4 local_98;
  undefined4 uStack_94;
  longlong *local_90;
  longlong *local_88;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined8 local_54;
  undefined8 local_4c;
  undefined8 local_44;
  undefined8 local_3c;
  
  uVar10 = 0xfffffffffffffffe;
  uVar6 = FUN_140198570(param_1,&local_90);
  plVar1 = local_90;
  if (local_90 == (longlong *)0x0) {
LAB_1401b205e:
    if (plVar1 == (longlong *)0x0) goto LAB_1401b20b0;
    if (plVar1 != local_88) {
      uVar5 = DAT_140608054 + 1;
      uVar6 = (ulonglong)uVar5;
      bVar9 = DAT_140608054 == 0;
      DAT_140608054 = uVar5;
      if (bVar9) {
        uVar6 = FUN_140176d60(1);
      }
      goto LAB_1401b20b0;
    }
  }
  else {
    if (local_90 != local_88) {
      uVar5 = DAT_14060804c + 1;
      uVar6 = (ulonglong)uVar5;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = uVar5;
      if (bVar9) {
        uVar6 = FUN_140176d60(1);
      }
      goto LAB_1401b205e;
    }
    if (*local_90 == 0) goto LAB_1401b205e;
    lVar7 = FUN_140209770(*local_90,param_2,param_3);
    if (lVar7 != 0) {
      bVar9 = false;
      if (*(longlong *)(param_1 + 0xb50) != 0) {
        local_78 = 0;
        local_70 = 0;
        local_68 = 0;
        local_60 = 0;
        local_5c = 0;
        local_58 = 0;
        local_54 = 0;
        local_4c = 0;
        local_44 = 0;
        local_3c = 0;
        FUN_140203af0(*(longlong *)(param_1 + 0xb50),param_1,lVar7,&local_78);
      }
      uVar5 = *(uint *)(lVar7 + 0x88);
      local_a0 = *(undefined4 *)(param_1 + 0x170);
      uStack_9c = *(undefined4 *)(param_1 + 0x174);
      local_98 = *(undefined4 *)(param_1 + 0x178);
      uStack_94 = *(undefined4 *)(param_1 + 0x17c);
      iVar2 = *(int *)(param_1 + 0x284);
      if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
        if ((*(longlong *)(param_1 + 0x170) != 0) || (*(longlong *)(param_1 + 0x178) != 0)) {
          bVar9 = true;
        }
        if ((bVar9) && (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar3 != 0))
        {
          local_res20[0] = (undefined2)iVar2;
          plVar8 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar8 + 0xa00))
                    (plVar8,1,&DAT_1405d85a0,local_res20,&local_a0,lVar7 + 0x20,uVar10);
        }
      }
      FUN_140209a80(*plVar1,param_2,param_3);
      LOCK();
      plVar1 = plVar1 + 1;
      lVar7 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        puVar4 = (undefined8 *)*local_90;
        if (puVar4 != (undefined8 *)0x0) {
          (**(code **)*puVar4)(puVar4,1);
        }
        operator_delete(local_90);
      }
      return (ulonglong)(uVar5 & 0xff);
    }
  }
  LOCK();
  plVar1 = plVar1 + 1;
  lVar7 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  uVar5 = (int)lVar7 - 1;
  uVar6 = (ulonglong)uVar5;
  if (uVar5 == 0) {
    puVar4 = (undefined8 *)*local_90;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_90);
    uVar6 = extraout_RAX;
  }
LAB_1401b20b0:
  return uVar6 & 0xffffffffffffff00;
}



undefined8
FUN_1401b20e0(longlong param_1,longlong param_2,uint param_3,uint param_4,uint param_5,uint param_6)

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 uVar8;
  bool bVar9;
  bool bVar10;
  undefined2 local_res8 [4];
  uint local_res18 [2];
  uint local_res20 [2];
  undefined8 in_stack_fffffffffffffde8;
  undefined1 *puVar11;
  undefined4 *puVar12;
  undefined4 *puVar13;
  undefined1 *in_stack_fffffffffffffdf8;
  ulonglong uVar15;
  undefined4 uVar16;
  undefined8 in_stack_fffffffffffffe00;
  undefined4 uVar18;
  undefined8 uVar17;
  undefined4 uVar19;
  undefined8 in_stack_fffffffffffffe08;
  uint *puVar20;
  ulonglong uVar21;
  uint local_1e8 [2];
  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 [2];
  longlong local_1b8;
  undefined1 local_1b0;
  undefined8 local_1a8;
  undefined1 local_198 [16];
  undefined4 local_188;
  undefined4 local_180;
  short local_17c;
  short local_170;
  undefined4 local_f0;
  undefined1 local_e8 [24];
  undefined4 local_d0;
  short local_cc;
  undefined4 local_40;
  undefined4 uVar14;
  undefined4 uVar22;
  
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffe00 >> 0x20);
  uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffe08 >> 0x20);
  uVar8 = (undefined4)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
  local_1a8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar6 = 0;
  local_1b8 = 0;
  bVar10 = false;
  local_1b0 = 0;
  plVar4 = *(longlong **)(param_1 + 0xb28);
  lVar7 = lVar5;
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  if (plVar4 != (longlong *)0x0) {
    lVar7 = lVar6;
    if (plVar4 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar4 != 0) {
        lVar7 = *plVar4;
        if ((plVar4 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar7 = lVar5,
           DAT_1406080a8 = iVar2, bVar10)) {
          FUN_140176d60(1);
        }
        local_1b0 = 0;
        local_1b8 = lVar7;
        FUN_14034ed40(lVar7);
        bVar10 = true;
        local_1b0 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_14000a170(local_e8);
  local_40 = 0;
  FUN_14000a170(local_198);
  local_f0 = 0;
  plVar4 = *(longlong **)(param_1 + 0x6c0);
  if (plVar4 == (longlong *)0x0) goto LAB_1401b272d;
  plVar1 = *(longlong **)(param_1 + 0x6c8);
  if (plVar4 != plVar1) {
    iVar2 = DAT_140608048 + 1;
    bVar9 = DAT_140608048 == 0;
    DAT_140608048 = iVar2;
    if (bVar9) {
      FUN_140176d60(1);
    }
    goto LAB_1401b272d;
  }
  lVar5 = *plVar4;
  if (lVar5 == 0) goto LAB_1401b272d;
  if (plVar4 != plVar1) {
    iVar2 = DAT_140608048 + 1;
    bVar9 = DAT_140608048 == 0;
    DAT_140608048 = iVar2;
    if (bVar9) {
      FUN_140176d60(CONCAT71((int7)((ulonglong)plVar1 >> 8),1));
    }
    lVar5 = 0;
  }
  iVar2 = DAT_140608048;
  if ((4 < param_5) || (0x17 < param_6)) goto LAB_1401b272d;
  lVar5 = ((longlong)(int)param_6 + (longlong)(int)param_5 * 0x18) * 0xac + lVar5;
  *(short *)(lVar5 + 0x14) = (short)param_5;
  *(short *)(lVar5 + 0x16) = (short)param_6;
  FUN_140090020(local_198);
  plVar4 = *(longlong **)(param_1 + 0x6c0);
  if (plVar4 == (longlong *)0x0) {
LAB_1401b22b3:
    lVar5 = 0;
  }
  else {
    if (plVar4 != *(longlong **)(param_1 + 0x6c8)) {
      DAT_140608048 = iVar2 + 1;
      if (iVar2 == 0) {
        FUN_140176d60(1);
      }
      goto LAB_1401b22b3;
    }
    lVar5 = *plVar4;
  }
  if ((param_3 < 5) && (local_res20[0] < 0x18)) {
    lVar5 = ((longlong)(int)local_res20[0] + (longlong)(int)param_3 * 0x18) * 0xac + lVar5;
    *(short *)(lVar5 + 0x14) = (short)param_3;
    *(short *)(lVar5 + 0x16) = (short)local_res20[0];
    FUN_140090020(local_e8);
    uVar3 = FUN_140137690();
    lVar5 = FUN_140136770(uVar3,local_d0);
    if ((lVar5 != 0) && (0.0 < *(float *)(lVar5 + 0x1e0))) {
      uVar3 = FUN_140137690();
      lVar6 = FUN_140136770(uVar3,local_180);
      if (lVar6 != 0) {
        if (*(int *)(lVar5 + 0xd0) == 4) {
          if (*(int *)(lVar6 + 0xd0) != 1) goto LAB_1401b272d;
        }
        else if ((*(int *)(lVar5 + 0xd0) != 5) || (*(int *)(lVar6 + 0xd0) != 2)) goto LAB_1401b272d;
        if ((float)(int)local_170 < *(float *)(lVar5 + 0x1e0)) {
          local_170 = (short)(int)*(float *)(lVar5 + 0x1e0);
          uVar3 = FUN_140174f00(param_1 + 0x6c0);
          FUN_1401ed220(uVar3,&param_5,&param_6,local_198,CONCAT44(uVar8,6));
          local_res8[0] = (undefined2)param_6;
          local_1e8[0] = CONCAT22(local_1e8[0]._2_2_,(short)param_5);
          plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          puVar11 = local_198;
          (**(code **)(*plVar4 + 0xe0))
                    (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_1e8,local_res8,puVar11
                    );
          uVar14 = (undefined4)((ulonglong)puVar11 >> 0x20);
          local_1d0 = *(undefined4 *)(param_2 + 0x160);
          local_1cc = *(undefined4 *)(param_2 + 0x164);
          local_1c8 = *(undefined4 *)(param_2 + 0x168);
          local_1c4 = *(undefined4 *)(param_2 + 0x16c);
          local_1e0 = *(undefined4 *)(param_2 + 0x170);
          local_1dc = *(undefined4 *)(param_2 + 0x174);
          local_1d8 = *(undefined4 *)(param_2 + 0x178);
          local_1d4 = *(undefined4 *)(param_2 + 0x17c);
          iVar2 = *(int *)(param_2 + 0x284);
          uVar8 = 1;
          if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
            local_res8[0] = (undefined2)iVar2;
            plVar4 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            in_stack_fffffffffffffdf8 = local_198;
            puVar12 = &local_1d0;
            (**(code **)(*plVar4 + 0x140))
                      (plVar4,1,&DAT_1405d85a0,local_res8,&local_1e0,puVar12,
                       in_stack_fffffffffffffdf8);
            uVar14 = (undefined4)((ulonglong)puVar12 >> 0x20);
          }
          local_1e0 = *(undefined4 *)(param_2 + 0x160);
          local_1dc = *(undefined4 *)(param_2 + 0x164);
          local_1d8 = *(undefined4 *)(param_2 + 0x168);
          local_1d4 = *(undefined4 *)(param_2 + 0x16c);
          local_1d0 = *(undefined4 *)(param_2 + 0x170);
          local_1cc = *(undefined4 *)(param_2 + 0x174);
          local_1c8 = *(undefined4 *)(param_2 + 0x178);
          local_1c4 = *(undefined4 *)(param_2 + 0x17c);
          iVar2 = *(int *)(param_2 + 0x284);
          local_1e8[0] = local_res20[0];
          local_1c0[0] = 0xffffffe2;
          if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
            local_res8[0] = (undefined2)iVar2;
            plVar4 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            puVar20 = local_1e8;
            puVar12 = local_1c0;
            in_stack_fffffffffffffdf8 = local_e8;
            puVar13 = &local_1e0;
            (**(code **)(*plVar4 + 0x130))
                      (plVar4,1,&DAT_1405d85a0,local_res8,&local_1d0,puVar13,
                       in_stack_fffffffffffffdf8,puVar12,puVar20);
            uVar14 = (undefined4)((ulonglong)puVar13 >> 0x20);
            uVar18 = (undefined4)((ulonglong)puVar12 >> 0x20);
            uVar22 = (undefined4)((ulonglong)puVar20 >> 0x20);
          }
          uVar21 = CONCAT44(uVar22,(int)local_170);
          uVar17 = CONCAT44(uVar18,(int)local_17c);
          uVar15 = (ulonglong)in_stack_fffffffffffffdf8 & 0xffffffff00000000;
          uVar3 = CONCAT44(uVar14,(int)local_17c);
          FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ae,0x65,param_2,local_198,uVar3,uVar15,
                        uVar17,uVar21);
          uVar21 = uVar21 & 0xffffffff00000000;
          uVar17 = CONCAT44((int)((ulonglong)uVar17 >> 0x20),(int)local_cc);
          uVar15 = uVar15 & 0xffffffff00000000;
          uVar3 = CONCAT44((int)((ulonglong)uVar3 >> 0x20),(int)local_cc);
          FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ae,0x66,param_2,local_e8,uVar3,uVar15,
                        uVar17,uVar21);
          uVar14 = (undefined4)((ulonglong)uVar3 >> 0x20);
          uVar16 = (undefined4)(uVar15 >> 0x20);
          uVar19 = (undefined4)((ulonglong)uVar17 >> 0x20);
          uVar3 = FUN_140174f00(param_1 + 0x6c0);
          puVar11 = local_e8;
          FUN_1401e9d60(uVar3,param_2,local_res18,local_res20,puVar11);
          uVar22 = (undefined4)((ulonglong)puVar11 >> 0x20);
          lVar5 = FUN_140174f00(param_1 + 0x6c0);
          uVar18 = *(undefined4 *)(lVar5 + 0x50a0);
          lVar5 = FUN_140174f00(param_1 + 0x6c0);
          FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_2,local_e8,0x192,
                        CONCAT44(uVar22,0x49),CONCAT44(uVar14,local_188),
                        CONCAT44(uVar16,*(undefined4 *)(lVar5 + 0x50a0)),CONCAT44(uVar19,uVar18),
                        uVar21 & 0xffffffff00000000,0);
          if (param_5 == 0) {
            if (*(longlong *)(param_1 + 0xb58) != 0) {
              uVar8 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
            }
            FUN_14019c070(param_1,uVar8);
          }
          if (bVar10) {
            FUN_14034edd0(lVar7);
          }
          return 1;
        }
      }
    }
  }
LAB_1401b272d:
  if (bVar10) {
    FUN_14034edd0(lVar7);
  }
  return 0;
}



undefined8
FUN_1401b2760(longlong param_1,longlong param_2,uint param_3,uint param_4,uint param_5,uint param_6)

{
  longlong *plVar1;
  void *pvVar2;
  byte bVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  undefined8 uVar8;
  int *piVar9;
  int *piVar10;
  uint uVar11;
  undefined4 uVar12;
  longlong *plVar13;
  longlong *plVar14;
  longlong lVar15;
  ushort uVar16;
  int iVar17;
  undefined4 uVar18;
  longlong lVar19;
  undefined2 uVar20;
  bool bVar21;
  float fVar22;
  undefined2 local_res8;
  uint local_res18 [2];
  uint local_res20 [2];
  undefined8 in_stack_fffffffffffffca8;
  ushort *puVar23;
  undefined1 *puVar24;
  undefined8 in_stack_fffffffffffffcb0;
  undefined4 *puVar25;
  undefined1 *puVar26;
  undefined2 *puVar27;
  undefined4 *puVar28;
  undefined1 *in_stack_fffffffffffffcb8;
  ulonglong uVar29;
  undefined4 uVar30;
  undefined8 in_stack_fffffffffffffcc0;
  undefined4 uVar32;
  undefined8 uVar31;
  undefined4 uVar33;
  undefined4 uVar34;
  uint *in_stack_fffffffffffffcc8;
  ulonglong uVar35;
  uint *puVar36;
  ushort local_328 [4];
  longlong local_320;
  char local_318;
  ushort local_310;
  undefined2 local_30e;
  undefined2 local_30c;
  undefined2 local_30a;
  undefined2 local_308;
  undefined2 local_306;
  undefined2 local_304;
  undefined2 local_302;
  undefined2 local_300;
  undefined2 local_2fe;
  undefined4 local_2fc;
  undefined2 local_2f8;
  undefined2 local_2f6;
  undefined2 local_2f4;
  undefined2 local_2f2;
  int local_2f0 [2];
  longlong *local_2e8;
  longlong *local_2e0;
  undefined4 local_2d8 [2];
  undefined4 local_2d0 [2];
  undefined4 local_2c8 [2];
  uint local_2c0 [2];
  int local_2b8 [2];
  longlong local_2b0;
  uint local_2a8 [2];
  int local_2a0 [2];
  uint local_298 [2];
  uint local_290 [2];
  undefined4 local_288;
  undefined4 local_284;
  undefined4 local_280;
  undefined4 local_27c;
  undefined4 local_278;
  undefined4 local_274;
  undefined4 local_270;
  undefined4 local_26c;
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined4 local_258;
  undefined4 local_254;
  undefined4 local_250;
  undefined4 local_24c;
  undefined4 local_248;
  undefined4 local_244;
  undefined4 local_240;
  undefined4 local_23c;
  undefined4 local_238;
  undefined4 local_234;
  undefined4 local_230;
  undefined4 local_22c;
  undefined4 local_228;
  undefined4 local_224;
  undefined4 local_220;
  undefined4 local_21c;
  undefined4 local_218;
  undefined4 local_214;
  undefined4 local_210;
  undefined4 local_20c;
  undefined4 local_208;
  undefined4 local_204;
  undefined4 local_200;
  undefined4 local_1fc;
  undefined4 local_1f8;
  undefined4 local_1f4;
  undefined4 local_1f0;
  undefined4 local_1ec;
  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;
  undefined1 local_1a8 [16];
  undefined4 local_198;
  undefined4 local_190;
  short local_18c;
  ushort local_12c;
  undefined4 local_100;
  undefined1 local_f8 [24];
  undefined4 local_e0;
  short local_dc;
  ushort local_7c;
  undefined4 local_50;
  undefined8 local_48;
  
  uVar32 = (undefined4)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20);
  uVar12 = (undefined4)((ulonglong)in_stack_fffffffffffffcb0 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffca8 >> 0x20);
  local_48 = 0xfffffffffffffffe;
  local_320 = 0;
  local_318 = '\0';
  plVar1 = *(longlong **)(param_1 + 0xb28);
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar15 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar6 = DAT_1406080a8 + 1, bVar21 = DAT_1406080a8 == 0, lVar15 = 0,
           DAT_1406080a8 = iVar6, bVar21)) {
          FUN_140176d60(1);
        }
        local_318 = 0;
        local_320 = lVar15;
        FUN_14034ed40();
        local_318 = '\x01';
      }
    }
    else {
      iVar6 = DAT_1406080a8 + 1;
      bVar21 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar6;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
  local_2fc = 0;
  FUN_14000a170(local_f8);
  local_50 = 0;
  FUN_14000a170(local_1a8);
  local_100 = 0;
  FUN_140197b70(param_1,&local_2e8);
  plVar1 = local_2e8;
  uVar5 = param_6;
  if (local_2e8 != (longlong *)0x0) {
    if (local_2e8 == local_2e0) {
      if (*local_2e8 != 0) {
        if ((param_5 < 5) && (param_6 < 0x18)) {
          lVar15 = ((longlong)(int)param_6 + (longlong)(int)param_5 * 0x18) * 0xac + *local_2e8;
          *(short *)(lVar15 + 0x14) = (short)param_5;
          uVar20 = (undefined2)param_6;
          *(undefined2 *)(lVar15 + 0x16) = uVar20;
          FUN_140090020(local_1a8);
          if ((param_3 < 5) && (param_4 < 0x18)) {
            lVar15 = ((longlong)(int)param_4 + (longlong)(int)param_3 * 0x18) * 0xac + *plVar1;
            *(short *)(lVar15 + 0x14) = (short)param_3;
            *(short *)(lVar15 + 0x16) = (short)param_4;
            FUN_140090020(local_f8);
            uVar8 = FUN_140137690();
            local_2b0 = FUN_140136770(uVar8,local_e0);
            if (local_2b0 == 0) {
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                pvVar2 = (void *)*local_2e8;
                if (pvVar2 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar2 + 0xf630);
                  operator_delete(pvVar2);
                }
                operator_delete(local_2e8);
              }
            }
            else if (*(int *)(local_2b0 + 0xd0) == 3) {
              uVar8 = FUN_140137690();
              lVar15 = FUN_140136770(uVar8,local_190);
              if (lVar15 == 0) {
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  pvVar2 = (void *)*local_2e8;
                  if (pvVar2 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar2 + 0xf630);
                    operator_delete(pvVar2);
                  }
                  operator_delete(local_2e8);
                }
              }
              else {
                if ((*(int *)(lVar15 + 0xd0) == 3) && (local_12c == 0)) {
                  uVar8 = FUN_140137690();
                  fVar22 = (float)FUN_140137590(uVar8,local_190);
                  local_12c = (ushort)(longlong)fVar22;
                }
                iVar6 = 0;
                uVar8 = FUN_140137690();
                iVar7 = FUN_140136a20(uVar8,local_e0);
                local_2b8[0] = iVar7;
                uVar8 = FUN_140137690();
                local_2f0[0] = FUN_140136a20(uVar8,local_190);
                uVar11 = (uint)local_7c;
                if (local_7c == 0) {
                  uVar8 = FUN_140137690();
                  fVar22 = (float)FUN_140137590(uVar8,local_e0);
                  uVar11 = (uint)(longlong)fVar22;
                  local_7c = (ushort)(longlong)fVar22;
                }
                bVar3 = local_res8._1_1_;
                local_res8 = (ushort)local_res8._1_1_ << 8;
                if (*(int *)(local_2b0 + 0xd0) == 3) {
                  if (*(int *)(lVar15 + 0xd0) == 3) {
                    piVar9 = local_2f0;
                    if (iVar7 <= local_2f0[0]) {
                      piVar9 = local_2b8;
                    }
                    iVar6 = *piVar9;
                    if (iVar6 == iVar7) {
                      local_res8 = CONCAT11(bVar3,1);
                    }
                  }
                  else if (*(int *)(lVar15 + 0xd0) != 3) {
                    iVar6 = local_2f0[0];
                  }
                }
                else {
                  iVar6 = 0;
                  if (*(int *)(lVar15 + 0xd0) == 3) {
                    iVar6 = iVar7;
                  }
                }
                local_328[0] = local_12c;
                iVar7 = (uVar11 & 0xffff) + (uint)local_12c;
                local_2a0[0] = iVar7;
                uVar8 = FUN_140141e20();
                lVar15 = FUN_140141de0(uVar8,iVar6);
                if (lVar15 != 0) {
                  iVar6 = 3;
                  lVar19 = 3;
                  piVar9 = (int *)(lVar15 + 0x10);
                  do {
                    piVar10 = local_2a0;
                    if (*piVar9 <= iVar7) {
                      piVar10 = piVar9;
                    }
                    iVar17 = iVar6;
                    if (*piVar10 == *piVar9) break;
                    iVar6 = iVar6 + -1;
                    piVar9 = piVar9 + -1;
                    lVar19 = lVar19 + -1;
                    iVar17 = 0;
                  } while (-1 < lVar19);
                  iVar6 = rand();
                  uVar30 = (undefined4)((ulonglong)in_stack_fffffffffffffcc8 >> 0x20);
                  if (((float)iVar6 * 3.0517578e-05 <
                       *(float *)(lVar15 + 0x14 + (longlong)iVar17 * 4)) ||
                     ((int)((uint)local_7c + (uint)local_12c) <= *(int *)(lVar15 + 4))) {
                    if ((char)local_res8 == '\0') {
                      local_12c = local_12c + local_7c;
                      FUN_1401ed220(*plVar1,&param_5,&param_6,local_1a8,CONCAT44(uVar18,6));
                      local_308 = (undefined2)param_5;
                      plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                      puVar24 = local_1a8;
                      local_30c = uVar20;
                      (**(code **)(*plVar13 + 0xe0))
                                (plVar13,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_308,
                                 &local_30c,puVar24);
                      uVar18 = (undefined4)((ulonglong)puVar24 >> 0x20);
                      local_228 = *(undefined4 *)(param_2 + 0x160);
                      local_224 = *(undefined4 *)(param_2 + 0x164);
                      local_220 = *(undefined4 *)(param_2 + 0x168);
                      local_21c = *(undefined4 *)(param_2 + 0x16c);
                      local_208 = *(undefined4 *)(param_2 + 0x170);
                      local_204 = *(undefined4 *)(param_2 + 0x174);
                      local_200 = *(undefined4 *)(param_2 + 0x178);
                      local_1fc = *(undefined4 *)(param_2 + 0x17c);
                      iVar6 = *(int *)(param_2 + 0x284);
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar15 != 0)) {
                        local_304 = (undefined2)iVar6;
                        plVar13 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar15 + 8) +
                                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffffcb8 = local_1a8;
                        puVar28 = &local_228;
                        (**(code **)(*plVar13 + 0x140))
                                  (plVar13,1,&DAT_1405d85a0,&local_304,&local_208,puVar28,
                                   in_stack_fffffffffffffcb8);
                        uVar18 = (undefined4)((ulonglong)puVar28 >> 0x20);
                      }
                      local_1e8 = *(undefined4 *)(param_2 + 0x160);
                      local_1e4 = *(undefined4 *)(param_2 + 0x164);
                      local_1e0 = *(undefined4 *)(param_2 + 0x168);
                      local_1dc = *(undefined4 *)(param_2 + 0x16c);
                      local_1c8 = *(undefined4 *)(param_2 + 0x170);
                      local_1c4 = *(undefined4 *)(param_2 + 0x174);
                      local_1c0 = *(undefined4 *)(param_2 + 0x178);
                      local_1bc = *(undefined4 *)(param_2 + 0x17c);
                      iVar6 = *(int *)(param_2 + 0x284);
                      local_2c0[0] = local_res20[0];
                      local_2b0 = CONCAT44(local_2b0._4_4_,0xffffffff);
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar15 != 0)) {
                        local_300 = (undefined2)iVar6;
                        plVar14 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar15 + 8) +
                                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        puVar36 = local_2c0;
                        plVar13 = &local_2b0;
                        in_stack_fffffffffffffcb8 = local_f8;
                        puVar28 = &local_1e8;
                        (**(code **)(*plVar14 + 0x130))
                                  (plVar14,1,&DAT_1405d85a0,&local_300,&local_1c8,puVar28,
                                   in_stack_fffffffffffffcb8,plVar13,puVar36);
                        uVar18 = (undefined4)((ulonglong)puVar28 >> 0x20);
                        uVar32 = (undefined4)((ulonglong)plVar13 >> 0x20);
                        uVar30 = (undefined4)((ulonglong)puVar36 >> 0x20);
                      }
                      uVar35 = CONCAT44(uVar30,(uint)local_12c);
                      uVar31 = CONCAT44(uVar32,(uint)local_12c - (uint)local_7c);
                      uVar29 = (ulonglong)in_stack_fffffffffffffcb8 & 0xffffffff00000000;
                      uVar8 = CONCAT44(uVar18,(uint)local_7c);
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x15,param_2,local_1a8,
                                    uVar8,uVar29,uVar31,uVar35);
                      uVar35 = uVar35 & 0xffffffff00000000;
                      uVar31 = CONCAT44((int)((ulonglong)uVar31 >> 0x20),(int)local_dc);
                      uVar29 = uVar29 & 0xffffffff00000000;
                      uVar8 = CONCAT44((int)((ulonglong)uVar8 >> 0x20),(int)local_dc);
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x17,param_2,local_f8,
                                    uVar8,uVar29,uVar31,uVar35);
                      uVar30 = (undefined4)((ulonglong)uVar8 >> 0x20);
                      uVar33 = (undefined4)(uVar29 >> 0x20);
                      uVar34 = (undefined4)((ulonglong)uVar31 >> 0x20);
                      puVar24 = local_f8;
                      FUN_1401e9d60(*plVar1,param_2,local_res18,local_res20,puVar24);
                      uVar32 = (undefined4)((ulonglong)puVar24 >> 0x20);
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      uVar18 = *(undefined4 *)(lVar15 + 0x50a0);
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      uVar12 = *(undefined4 *)(lVar15 + 0x50a0);
                    }
                    else {
                      local_7c = local_7c + local_12c;
                      FUN_1401ed220(*plVar1,local_res18,local_res20,local_f8,CONCAT44(uVar18,6));
                      uVar11 = local_res20[0];
                      uVar16 = (ushort)local_res20[0];
                      local_2f6 = (undefined2)local_res18[0];
                      plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                      puVar24 = local_f8;
                      local_328[0] = uVar16;
                      (**(code **)(*plVar13 + 0xe0))
                                (plVar13,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_2f6,
                                 local_328,puVar24);
                      uVar18 = (undefined4)((ulonglong)puVar24 >> 0x20);
                      local_1b8 = *(undefined4 *)(param_2 + 0x160);
                      local_1b4 = *(undefined4 *)(param_2 + 0x164);
                      local_1b0 = *(undefined4 *)(param_2 + 0x168);
                      local_1ac = *(undefined4 *)(param_2 + 0x16c);
                      local_278 = *(undefined4 *)(param_2 + 0x170);
                      local_274 = *(undefined4 *)(param_2 + 0x174);
                      local_270 = *(undefined4 *)(param_2 + 0x178);
                      local_26c = *(undefined4 *)(param_2 + 0x17c);
                      iVar6 = *(int *)(param_2 + 0x284);
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar15 != 0)) {
                        local_306 = (undefined2)iVar6;
                        plVar13 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar15 + 8) +
                                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffffcb8 = local_f8;
                        puVar28 = &local_1b8;
                        (**(code **)(*plVar13 + 0x140))
                                  (plVar13,1,&DAT_1405d85a0,&local_306,&local_278,puVar28,
                                   in_stack_fffffffffffffcb8);
                        uVar18 = (undefined4)((ulonglong)puVar28 >> 0x20);
                      }
                      local_268 = *(undefined4 *)(param_2 + 0x160);
                      local_264 = *(undefined4 *)(param_2 + 0x164);
                      local_260 = *(undefined4 *)(param_2 + 0x168);
                      local_25c = *(undefined4 *)(param_2 + 0x16c);
                      local_248 = *(undefined4 *)(param_2 + 0x170);
                      local_244 = *(undefined4 *)(param_2 + 0x174);
                      local_240 = *(undefined4 *)(param_2 + 0x178);
                      local_23c = *(undefined4 *)(param_2 + 0x17c);
                      iVar6 = *(int *)(param_2 + 0x284);
                      local_298[0] = uVar5;
                      local_2d0[0] = 0xffffffff;
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar15 != 0)) {
                        local_2f8 = (undefined2)iVar6;
                        plVar13 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar15 + 8) +
                                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffffcc8 = local_298;
                        puVar28 = local_2d0;
                        in_stack_fffffffffffffcb8 = local_1a8;
                        puVar25 = &local_268;
                        (**(code **)(*plVar13 + 0x130))
                                  (plVar13,1,&DAT_1405d85a0,&local_2f8,&local_248,puVar25,
                                   in_stack_fffffffffffffcb8,puVar28,in_stack_fffffffffffffcc8);
                        uVar18 = (undefined4)((ulonglong)puVar25 >> 0x20);
                        uVar32 = (undefined4)((ulonglong)puVar28 >> 0x20);
                      }
                      uVar35 = (ulonglong)in_stack_fffffffffffffcc8 & 0xffffffff00000000;
                      uVar8 = CONCAT44(uVar32,(int)local_18c);
                      uVar29 = (ulonglong)in_stack_fffffffffffffcb8 & 0xffffffff00000000;
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x17,param_2,local_1a8,
                                    CONCAT44(uVar18,(int)local_18c),uVar29,uVar8,uVar35);
                      uVar35 = CONCAT44((int)(uVar35 >> 0x20),(uint)local_7c);
                      uVar8 = CONCAT44((int)((ulonglong)uVar8 >> 0x20),
                                       (uint)local_7c - (uint)local_12c);
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x15,param_2,local_f8,
                                    (uint)local_12c,uVar29 & 0xffffffff00000000,uVar8,uVar35);
                      uVar18 = (undefined4)((ulonglong)uVar8 >> 0x20);
                      puVar24 = local_1a8;
                      FUN_1401e9d60(*plVar1,param_2,&param_5,&param_6,puVar24);
                      uVar4 = param_5;
                      uVar31 = CONCAT44(uVar18,1);
                      uVar33 = 1;
                      puVar26 = local_f8;
                      uVar8 = CONCAT44((int)((ulonglong)puVar24 >> 0x20),uVar5);
                      iVar6 = FUN_1401f2930(*plVar1,param_2,param_5,uVar11,uVar8,puVar26,
                                            &DAT_14044e480,uVar31);
                      uVar32 = (undefined4)((ulonglong)uVar8 >> 0x20);
                      uVar30 = (undefined4)((ulonglong)puVar26 >> 0x20);
                      uVar34 = (undefined4)((ulonglong)uVar31 >> 0x20);
                      if (iVar6 != 0) {
                        local_30e = (undefined2)uVar4;
                        plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                        uVar34 = 1;
                        puVar24 = local_f8;
                        puVar27 = &local_302;
                        puVar23 = &local_310;
                        local_310 = uVar16;
                        local_302 = uVar20;
                        (**(code **)(*plVar13 + 0x3a0))
                                  (plVar13,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_30e,
                                   puVar23,puVar27,puVar24,&DAT_14044e480);
                        uVar32 = (undefined4)((ulonglong)puVar23 >> 0x20);
                        uVar30 = (undefined4)((ulonglong)puVar27 >> 0x20);
                        uVar33 = (undefined4)((ulonglong)puVar24 >> 0x20);
                      }
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      uVar18 = *(undefined4 *)(lVar15 + 0x50a0);
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      uVar12 = *(undefined4 *)(lVar15 + 0x50a0);
                    }
                    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_2,local_f8,0x192,
                                  CONCAT44(uVar32,0x44),CONCAT44(uVar30,local_198),
                                  CONCAT44(uVar33,uVar12),CONCAT44(uVar34,uVar18),
                                  uVar35 & 0xffffffff00000000,0);
                    local_2fc = 1;
                  }
                  else {
                    uVar8 = FUN_140137690();
                    lVar15 = FUN_140136770(uVar8,local_190);
                    if (lVar15 == 0) {
                      LOCK();
                      plVar1 = plVar1 + 1;
                      *(int *)plVar1 = (int)*plVar1 + -1;
                      UNLOCK();
                      if ((int)*plVar1 == 0) {
                        pvVar2 = (void *)*local_2e8;
                        if (pvVar2 != (void *)0x0) {
                          FUN_14034edf0((longlong)pvVar2 + 0xf630);
                          operator_delete(pvVar2);
                        }
                        operator_delete(local_2e8);
                      }
                      goto LAB_1401b3904;
                    }
                    if (*(int *)(lVar15 + 0xd0) == 3) {
                      local_1f8 = *(undefined4 *)(param_2 + 0x160);
                      local_1f4 = *(undefined4 *)(param_2 + 0x164);
                      local_1f0 = *(undefined4 *)(param_2 + 0x168);
                      local_1ec = *(undefined4 *)(param_2 + 0x16c);
                      local_258 = *(undefined4 *)(param_2 + 0x170);
                      local_254 = *(undefined4 *)(param_2 + 0x174);
                      local_250 = *(undefined4 *)(param_2 + 0x178);
                      local_24c = *(undefined4 *)(param_2 + 0x17c);
                      iVar6 = *(int *)(param_2 + 0x284);
                      local_290[0] = uVar5;
                      local_2c8[0] = 0xffffffff;
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar15 != 0)) {
                        local_res8 = (short)iVar6;
                        plVar13 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar15 + 8) +
                                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffffcc8 = local_290;
                        puVar28 = local_2c8;
                        in_stack_fffffffffffffcb8 = local_1a8;
                        puVar25 = &local_1f8;
                        (**(code **)(*plVar13 + 0x130))
                                  (plVar13,1,&DAT_1405d85a0,&local_res8,&local_258,puVar25,
                                   in_stack_fffffffffffffcb8,puVar28,in_stack_fffffffffffffcc8);
                        uVar12 = (undefined4)((ulonglong)puVar25 >> 0x20);
                        uVar32 = (undefined4)((ulonglong)puVar28 >> 0x20);
                      }
                      FUN_1401e9d60(*plVar1,param_2,&param_5,&param_6,local_1a8);
                    }
                    else {
                      local_12c = 0;
                      FUN_1401ed220(*plVar1,&param_5,&param_6,local_1a8,CONCAT44(uVar18,6));
                      local_30a = (undefined2)param_5;
                      plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                      puVar24 = local_1a8;
                      local_2f2 = uVar20;
                      (**(code **)(*plVar13 + 0xe0))
                                (plVar13,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_30a,
                                 &local_2f2,puVar24);
                      uVar12 = (undefined4)((ulonglong)puVar24 >> 0x20);
                      local_288 = *(undefined4 *)(param_2 + 0x160);
                      local_284 = *(undefined4 *)(param_2 + 0x164);
                      local_280 = *(undefined4 *)(param_2 + 0x168);
                      local_27c = *(undefined4 *)(param_2 + 0x16c);
                      local_238 = *(undefined4 *)(param_2 + 0x170);
                      local_234 = *(undefined4 *)(param_2 + 0x174);
                      local_230 = *(undefined4 *)(param_2 + 0x178);
                      local_22c = *(undefined4 *)(param_2 + 0x17c);
                      iVar6 = *(int *)(param_2 + 0x284);
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar15 != 0)) {
                        local_2f4 = (undefined2)iVar6;
                        plVar13 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar15 + 8) +
                                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffffcb8 = local_1a8;
                        puVar28 = &local_288;
                        (**(code **)(*plVar13 + 0x140))
                                  (plVar13,1,&DAT_1405d85a0,&local_2f4,&local_238,puVar28,
                                   in_stack_fffffffffffffcb8);
                        uVar12 = (undefined4)((ulonglong)puVar28 >> 0x20);
                      }
                    }
                    local_1d8 = *(undefined4 *)(param_2 + 0x160);
                    local_1d4 = *(undefined4 *)(param_2 + 0x164);
                    local_1d0 = *(undefined4 *)(param_2 + 0x168);
                    local_1cc = *(undefined4 *)(param_2 + 0x16c);
                    local_218 = *(undefined4 *)(param_2 + 0x170);
                    local_214 = *(undefined4 *)(param_2 + 0x174);
                    local_210 = *(undefined4 *)(param_2 + 0x178);
                    local_20c = *(undefined4 *)(param_2 + 0x17c);
                    iVar6 = *(int *)(param_2 + 0x284);
                    local_2a8[0] = local_res20[0];
                    local_2d8[0] = 0xffffffff;
                    if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                       && (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                          lVar15 != 0)) {
                      local_2fe = (undefined2)iVar6;
                      plVar13 = (longlong *)
                                (*(longlong *)
                                  (*(longlong *)(lVar15 + 8) +
                                  (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                      in_stack_fffffffffffffcc8 = local_2a8;
                      puVar28 = local_2d8;
                      in_stack_fffffffffffffcb8 = local_f8;
                      puVar25 = &local_1d8;
                      (**(code **)(*plVar13 + 0x130))
                                (plVar13,1,&DAT_1405d85a0,&local_2fe,&local_218,puVar25,
                                 in_stack_fffffffffffffcb8,puVar28,in_stack_fffffffffffffcc8);
                      uVar12 = (undefined4)((ulonglong)puVar25 >> 0x20);
                      uVar32 = (undefined4)((ulonglong)puVar28 >> 0x20);
                    }
                    uVar35 = (ulonglong)in_stack_fffffffffffffcc8 & 0xffffffff00000000;
                    uVar31 = CONCAT44(uVar32,(uint)local_328[0]);
                    uVar29 = (ulonglong)in_stack_fffffffffffffcb8 & 0xffffffff00000000;
                    uVar8 = CONCAT44(uVar12,(int)local_18c);
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x16,param_2,local_1a8,
                                  uVar8,uVar29,uVar31,uVar35);
                    uVar35 = uVar35 & 0xffffffff00000000;
                    uVar31 = CONCAT44((int)((ulonglong)uVar31 >> 0x20),(int)local_dc);
                    uVar29 = uVar29 & 0xffffffff00000000;
                    uVar8 = CONCAT44((int)((ulonglong)uVar8 >> 0x20),(int)local_dc);
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x17,param_2,local_f8,uVar8
                                  ,uVar29,uVar31,uVar35);
                    uVar32 = (undefined4)((ulonglong)uVar8 >> 0x20);
                    uVar30 = (undefined4)(uVar29 >> 0x20);
                    uVar33 = (undefined4)((ulonglong)uVar31 >> 0x20);
                    puVar24 = local_f8;
                    FUN_1401e9d60(*plVar1,param_2,local_res18,local_res20,puVar24);
                    uVar12 = (undefined4)((ulonglong)puVar24 >> 0x20);
                    lVar15 = FUN_140174f00(param_1 + 0x6c0);
                    uVar18 = *(undefined4 *)(lVar15 + 0x50a0);
                    lVar15 = FUN_140174f00(param_1 + 0x6c0);
                    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_2,local_f8,0x192,
                                  CONCAT44(uVar12,0x45),CONCAT44(uVar32,local_198),
                                  CONCAT44(uVar30,*(undefined4 *)(lVar15 + 0x50a0)),
                                  CONCAT44(uVar33,uVar18),uVar35 & 0xffffffff00000000,0);
                    local_2fc = 0;
                  }
                  plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar13 + 0x9b0))
                            (plVar13,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_2fc);
                  LOCK();
                  plVar1 = plVar1 + 1;
                  lVar15 = *plVar1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)lVar15 == 1) {
                    pvVar2 = (void *)*local_2e8;
                    if (pvVar2 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar2 + 0xf630);
                      operator_delete(pvVar2);
                    }
                    operator_delete(local_2e8);
                  }
                  if (local_318 != '\0') {
                    FUN_14034edd0(local_320);
                  }
                  return 1;
                }
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  pvVar2 = (void *)*local_2e8;
                  if (pvVar2 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar2 + 0xf630);
                    operator_delete(pvVar2);
                  }
                  operator_delete(local_2e8);
                }
              }
            }
            else {
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                pvVar2 = (void *)*local_2e8;
                if (pvVar2 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar2 + 0xf630);
                  operator_delete(pvVar2);
                }
                operator_delete(local_2e8);
              }
            }
          }
          else {
            LOCK();
            plVar1 = plVar1 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              pvVar2 = (void *)*local_2e8;
              if (pvVar2 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar2 + 0xf630);
                operator_delete(pvVar2);
              }
              operator_delete(local_2e8);
            }
          }
        }
        else {
          LOCK();
          plVar1 = local_2e8 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar2 = (void *)*local_2e8;
            if (pvVar2 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar2 + 0xf630);
              operator_delete(pvVar2);
            }
            operator_delete(local_2e8);
          }
        }
        goto LAB_1401b3904;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar21 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_2e0) {
      LOCK();
      plVar1 = plVar1 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        pvVar2 = (void *)*local_2e8;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0xf630);
          operator_delete(pvVar2);
        }
        operator_delete(local_2e8);
      }
    }
    else {
      iVar6 = DAT_140608050 + 1;
      bVar21 = DAT_140608050 == 0;
      DAT_140608050 = iVar6;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401b3904:
  if (local_318 != '\0') {
    FUN_14034edd0(local_320);
  }
  return 0;
}



// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401b3940(longlong param_1,longlong param_2,undefined4 param_3,int param_4,int param_5,
             int param_6,int param_7)

{
  int iVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  undefined8 uVar5;
  longlong lVar6;
  int *piVar7;
  uint uVar8;
  longlong *plVar9;
  uint uVar10;
  int iVar11;
  longlong lVar12;
  longlong lVar13;
  ulonglong *puVar14;
  int iVar15;
  longlong lVar16;
  bool bVar17;
  bool bVar18;
  float fVar19;
  int local_res8 [2];
  undefined4 local_res18 [2];
  int local_res20;
  undefined4 *puVar20;
  undefined8 in_stack_fffffffffffffd30;
  undefined4 uVar22;
  undefined4 uVar23;
  undefined4 *puVar21;
  ulonglong *in_stack_fffffffffffffd38;
  ulonglong uVar24;
  undefined4 uVar25;
  undefined8 in_stack_fffffffffffffd40;
  undefined4 uVar28;
  ulonglong uVar26;
  undefined8 uVar27;
  undefined4 uVar29;
  int local_2a8 [2];
  longlong local_2a0;
  undefined4 local_298;
  undefined4 local_294;
  undefined4 local_290;
  undefined4 uStack_28c;
  undefined4 local_288;
  undefined4 uStack_284;
  uint local_280;
  ulonglong local_278;
  undefined4 local_270;
  undefined4 local_26c;
  longlong local_268;
  undefined1 local_260;
  ulonglong local_258 [2];
  undefined4 local_248;
  undefined4 local_240;
  short local_23c;
  ushort local_1dc;
  undefined4 local_1b0;
  ulonglong local_1a8;
  ulonglong local_1a0;
  undefined4 local_198;
  undefined4 local_190;
  short local_18c;
  ushort local_12c;
  undefined4 local_100;
  undefined8 local_f8;
  undefined1 local_f0 [168];
  undefined4 local_48;
  
  uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffd30 >> 0x20);
  uVar28 = (undefined4)((ulonglong)in_stack_fffffffffffffd40 >> 0x20);
  local_f8 = 0xfffffffffffffffe;
  lVar16 = 0;
  lVar12 = 0;
  local_268 = 0;
  bVar18 = false;
  local_260 = 0;
  plVar4 = *(longlong **)(param_1 + 0xb28);
  lVar13 = lVar16;
  local_res18[0] = param_3;
  local_res20 = param_4;
  if (plVar4 != (longlong *)0x0) {
    lVar13 = lVar12;
    if (plVar4 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar4 != 0) {
        lVar13 = *plVar4;
        if ((plVar4 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar18 = DAT_1406080a8 == 0, lVar13 = lVar16,
           DAT_1406080a8 = iVar3, bVar18)) {
          FUN_140176d60(1);
        }
        local_260 = 0;
        local_268 = lVar13;
        FUN_14034ed40(lVar13);
        bVar18 = true;
        local_260 = 1;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar17 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  if ((param_7 != 0) && (plVar4 = *(longlong **)(param_1 + 0x6e0), plVar4 != (longlong *)0x0)) {
    if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
      if (*plVar4 != 0) {
        lVar12 = *plVar4;
        if ((plVar4 != *(longlong **)(param_1 + 0x6e8)) &&
           (iVar3 = DAT_14060804c + 1, bVar17 = DAT_14060804c == 0, lVar12 = lVar16,
           DAT_14060804c = iVar3, bVar17)) {
          FUN_140176d60(1);
        }
        plVar4 = (longlong *)FUN_140208860(lVar12,param_7);
        if (((plVar4 != (longlong *)0x0) &&
            (lVar12 = (**(code **)(*plVar4 + 0x280))(plVar4), lVar12 != 0)) &&
           (lVar12 = FUN_1401b5430(param_1,param_7), lVar12 != 0)) {
          plVar4 = (longlong *)(**(code **)(*plVar4 + 0x280))(plVar4);
          local_290 = (undefined4)*plVar4;
          uStack_28c = *(undefined4 *)((longlong)plVar4 + 4);
          local_288 = (undefined4)plVar4[1];
          uStack_284 = *(undefined4 *)((longlong)plVar4 + 0xc);
          if ((*plVar4 != 0) || (plVar4[1] != 0)) {
            lVar16 = 1;
          }
          if ((int)lVar16 != 0) {
            local_2a8[1] = 0;
            FUN_14000a170(local_258);
            local_1b0 = 0;
            FUN_14000a170(&local_1a8);
            iVar3 = param_6;
            local_100 = 0;
            lVar16 = (longlong)param_6;
            if (((-1 < param_6) &&
                (cVar2 = FUN_1401f6eb0(lVar12,param_5,param_6,&local_1a8), cVar2 != '\0')) &&
               ((-1 < local_res20 &&
                (cVar2 = FUN_1401f6eb0(lVar12,local_res18[0],local_res20,local_258), cVar2 != '\0'))
               )) {
              uVar5 = FUN_140137690();
              lVar6 = FUN_140136770(uVar5,local_190);
              if ((lVar6 != 0) && (*(int *)(lVar6 + 0xd0) == 3)) {
                uVar5 = FUN_140137690();
                local_2a0 = FUN_140136770(uVar5,local_240);
                if (local_2a0 == 0) {
                  local_2a0 = 0;
                }
                else {
                  if ((*(int *)(local_2a0 + 0xd0) == 3) && (local_1dc == 0)) {
                    uVar5 = FUN_140137690();
                    fVar19 = (float)FUN_140137590(uVar5,local_240);
                    local_1dc = (ushort)(longlong)fVar19;
                  }
                  local_278 = local_278 & 0xffffffff00000000;
                  uVar5 = FUN_140137690();
                  local_2a8[0] = FUN_140136a20(uVar5,local_190);
                  uVar5 = FUN_140137690();
                  local_res8[0] = FUN_140136a20(uVar5,local_240);
                  uVar8 = (uint)uVar5;
                  uVar10 = (uint)local_12c;
                  if (local_12c == 0) {
                    uVar5 = FUN_140137690();
                    fVar19 = (float)FUN_140137590(uVar5,local_190);
                    uVar8 = (uint)uVar5;
                    uVar10 = (uint)(longlong)fVar19;
                    local_12c = (ushort)(longlong)fVar19;
                  }
                  local_280 = uVar8 & 0xffffff00;
                  if ((*(int *)(lVar6 + 0xd0) == 3) && (*(int *)(local_2a0 + 0xd0) == 3)) {
                    piVar7 = local_res8;
                    if (local_2a8[0] <= local_res8[0]) {
                      piVar7 = local_2a8;
                    }
                    local_278 = CONCAT44(local_278._4_4_,*piVar7);
                    local_280 = (uint)(*piVar7 == local_2a8[0]);
                  }
                  local_2a8[0] = CONCAT22(local_2a8[0]._2_2_,local_1dc);
                  iVar11 = (uVar10 & 0xffff) + (uint)local_1dc;
                  local_2a0 = CONCAT44(local_2a0._4_4_,iVar11);
                  uVar5 = FUN_140141e20();
                  local_278 = FUN_140141de0(uVar5,local_278 & 0xffffffff);
                  if (local_278 != 0) {
                    local_res8[0] = 0;
                    iVar15 = 3;
                    lVar6 = 3;
                    plVar4 = (longlong *)(local_278 + 0x10);
                    do {
                      plVar9 = &local_2a0;
                      if ((int)*plVar4 <= iVar11) {
                        plVar9 = plVar4;
                      }
                      iVar1 = iVar15;
                      if ((int)*plVar9 == (int)*plVar4) break;
                      iVar15 = iVar15 + -1;
                      plVar4 = (longlong *)((longlong)plVar4 + -4);
                      lVar6 = lVar6 + -1;
                      iVar1 = local_res8[0];
                    } while (-1 < lVar6);
                    local_res8[0] = iVar1;
                    iVar11 = rand();
                    if (((float)iVar11 * 3.0517578e-05 <
                         *(float *)(local_278 + 0x14 + (longlong)local_res8[0] * 4)) ||
                       ((int)((uint)local_12c + (uint)local_1dc) <= *(int *)(local_278 + 4))) {
                      if ((char)local_280 != '\0') {
                        local_12c = local_12c + local_1dc;
                        if ((iVar3 < 0x18) && (iVar3 < (int)(uint)*(byte *)(lVar12 + 0x2041))) {
                          puVar14 = (ulonglong *)
                                    ((lVar16 + (longlong)param_5 * 0x18) * 0xac + lVar12);
                          bVar17 = *puVar14 < local_1a8;
                          if ((*puVar14 == local_1a8) &&
                             (bVar17 = puVar14[1] < local_1a0, puVar14[1] == local_1a0)) {
                            iVar11 = 0;
                          }
                          else {
                            iVar11 = (1 - (uint)bVar17) - (uint)(bVar17 != 0);
                          }
                          if (iVar11 == 0) {
                            FUN_140090020(puVar14,&local_1a8);
                          }
                        }
                        plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                        puVar14 = &local_1a8;
                        piVar7 = local_res8;
                        puVar21 = &param_7;
                        puVar20 = &local_290;
                        local_res8[0]._0_2_ = (short)iVar3;
                        (**(code **)(*plVar4 + 0xa70))
                                  (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,
                                   puVar20,puVar21,piVar7,puVar14);
                        uVar22 = (undefined4)((ulonglong)puVar20 >> 0x20);
                        uVar28 = (undefined4)((ulonglong)puVar21 >> 0x20);
                        uVar23 = (undefined4)((ulonglong)piVar7 >> 0x20);
                        uVar25 = (undefined4)((ulonglong)puVar14 >> 0x20);
                        iVar3 = *(int *)(param_2 + 0x284);
                        local_2a0 = CONCAT44(local_2a0._4_4_,*(undefined4 *)(param_2 + 8));
                        if (((-1 < iVar3) &&
                            (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                           (lVar16 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                           lVar16 != 0)) {
                          local_res8[0]._0_2_ = (undefined2)iVar3;
                          plVar9 = (longlong *)
                                   (*(longlong *)
                                     (*(longlong *)(lVar16 + 8) +
                                     (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                          puVar14 = local_258;
                          puVar21 = &local_290;
                          plVar4 = &local_2a0;
                          (**(code **)(*plVar9 + 0xbb0))
                                    (plVar9,1,&DAT_1405d85a0,local_res8,plVar4,puVar21,puVar14);
                          uVar22 = (undefined4)((ulonglong)plVar4 >> 0x20);
                          uVar28 = (undefined4)((ulonglong)puVar21 >> 0x20);
                          uVar23 = (undefined4)((ulonglong)puVar14 >> 0x20);
                        }
                        iVar11 = local_res20;
                        FUN_1401f6df0(lVar12,local_res18[0],local_res20,local_258);
                        lVar16 = FUN_140174f00(param_1 + 0x6c0);
                        uVar29 = *(undefined4 *)(lVar16 + 0x50a0);
                        lVar16 = FUN_140174f00(param_1 + 0x6c0);
                        uVar27 = CONCAT44(uVar25,uVar29);
                        puVar14 = (ulonglong *)CONCAT44(uVar23,*(undefined4 *)(lVar16 + 0x50a0));
                        uVar5 = CONCAT44(uVar28,local_248);
                        FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_2,local_258,0x192,
                                      CONCAT44(uVar22,0x44),uVar5,puVar14,uVar27,0,0);
                        uVar22 = (undefined4)((ulonglong)uVar5 >> 0x20);
                        uVar28 = (undefined4)((ulonglong)uVar27 >> 0x20);
                        local_2a0 = *(longlong *)(param_2 + 0x160);
                        local_298 = *(undefined4 *)(param_2 + 0x168);
                        local_294 = *(undefined4 *)(param_2 + 0x16c);
                        local_278 = *(ulonglong *)(param_2 + 0x170);
                        local_270 = *(undefined4 *)(param_2 + 0x178);
                        local_26c = *(undefined4 *)(param_2 + 0x17c);
                        iVar3 = *(int *)(param_2 + 0x284);
                        if (((-1 < iVar3) &&
                            (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                           (lVar16 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                           lVar16 != 0)) {
                          local_res8[0]._0_2_ = (undefined2)iVar3;
                          plVar9 = (longlong *)
                                   (*(longlong *)
                                     (*(longlong *)(lVar16 + 8) +
                                     (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                          puVar14 = &local_1a8;
                          plVar4 = &local_2a0;
                          (**(code **)(*plVar9 + 0xc00))
                                    (plVar9,1,&DAT_1405d85a0,local_res8,&local_278,plVar4,puVar14);
                          uVar22 = (undefined4)((ulonglong)plVar4 >> 0x20);
                        }
                        uVar24 = (ulonglong)puVar14 & 0xffffffff00000000;
                        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x17,param_2,local_258,
                                      CONCAT44(uVar22,(int)local_23c),uVar24,
                                      CONCAT44(uVar28,(int)local_23c),0);
                        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x15,param_2,&local_1a8
                                      ,(uint)local_1dc,uVar24 & 0xffffffff00000000,
                                      (uint)local_12c - (uint)local_1dc,local_12c);
                        FUN_14000a170(local_f0);
                        local_48 = 0;
                        FUN_140090020(local_258,local_f0);
                        local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar11);
                        plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                        (**(code **)(*plVar4 + 0xa70))
                                  (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&param_5,
                                   &local_290,&param_7,local_res8,local_258);
                      }
                      local_2a8[1] = 1;
                    }
                    else {
                      uVar5 = FUN_140137690();
                      lVar16 = FUN_140136770(uVar5,local_190);
                      if (lVar16 == 0) goto LAB_1401b4485;
                      if (*(int *)(lVar16 + 0xd0) == 3) {
                        iVar11 = *(int *)(param_2 + 0x284);
                        local_2a0 = CONCAT44(local_2a0._4_4_,*(undefined4 *)(param_2 + 8));
                        if (((-1 < iVar11) &&
                            (iVar11 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                           (lVar16 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                           lVar16 != 0)) {
                          local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar11);
                          plVar4 = (longlong *)
                                   (*(longlong *)
                                     (*(longlong *)(lVar16 + 8) +
                                     (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                          in_stack_fffffffffffffd38 = &local_1a8;
                          puVar21 = &local_290;
                          (**(code **)(*plVar4 + 0xbb0))
                                    (plVar4,1,&DAT_1405d85a0,local_res8,&local_2a0,puVar21,
                                     in_stack_fffffffffffffd38);
                          uVar22 = (undefined4)((ulonglong)puVar21 >> 0x20);
                        }
                        FUN_1401f6df0(lVar12,param_5,iVar3,&local_1a8);
                      }
                      iVar11 = *(int *)(param_2 + 0x284);
                      local_2a0 = CONCAT44(local_2a0._4_4_,*(undefined4 *)(param_2 + 8));
                      if (((-1 < iVar11) &&
                          (iVar11 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar16 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar16 != 0)) {
                        local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar11);
                        plVar4 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar16 + 8) +
                                   (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffffd38 = local_258;
                        puVar21 = &local_290;
                        (**(code **)(*plVar4 + 0xbb0))
                                  (plVar4,1,&DAT_1405d85a0,local_res8,&local_2a0,puVar21,
                                   in_stack_fffffffffffffd38);
                        uVar22 = (undefined4)((ulonglong)puVar21 >> 0x20);
                      }
                      uVar26 = CONCAT44(uVar28,local_2a8[0]) & 0xffffffff0000ffff;
                      uVar24 = (ulonglong)in_stack_fffffffffffffd38 & 0xffffffff00000000;
                      uVar5 = CONCAT44(uVar22,(int)local_18c);
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x16,param_2,&local_1a8,
                                    uVar5,uVar24,uVar26,0);
                      uVar27 = CONCAT44((int)(uVar26 >> 0x20),(int)local_23c);
                      uVar24 = uVar24 & 0xffffffff00000000;
                      uVar5 = CONCAT44((int)((ulonglong)uVar5 >> 0x20),(int)local_23c);
                      puVar14 = local_258;
                      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a5,0x17,param_2,puVar14,
                                    uVar5,uVar24,uVar27,0);
                      uVar28 = (undefined4)((ulonglong)puVar14 >> 0x20);
                      uVar23 = (undefined4)((ulonglong)uVar5 >> 0x20);
                      uVar25 = (undefined4)(uVar24 >> 0x20);
                      uVar29 = (undefined4)((ulonglong)uVar27 >> 0x20);
                      FUN_1401f6df0(lVar12,local_res18[0],local_res20,local_258);
                      lVar16 = FUN_140174f00(param_1 + 0x6c0);
                      uVar22 = *(undefined4 *)(lVar16 + 0x50a0);
                      lVar16 = FUN_140174f00(param_1 + 0x6c0);
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_2,local_258,0x192,
                                    CONCAT44(uVar28,0x45),CONCAT44(uVar23,local_198),
                                    CONCAT44(uVar25,*(undefined4 *)(lVar16 + 0x50a0)),
                                    CONCAT44(uVar29,uVar22),0,0);
                      FUN_14000a170(local_f0);
                      local_48 = 0;
                      FUN_140090020(local_258,local_f0);
                      FUN_14000a170(local_f0);
                      local_48 = 0;
                      FUN_140090020(&local_1a8,local_f0);
                      plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                      local_res8[0]._0_2_ = (short)local_res20;
                      (**(code **)(*plVar4 + 0xa70))
                                (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,
                                 &local_290,&param_7,local_res8,local_258);
                      local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar3);
                      plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                      (**(code **)(*plVar4 + 0xa70))
                                (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&param_5,
                                 &local_290,&param_7,local_res8,&local_1a8);
                      local_2a8[1] = 0;
                    }
                    plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    (**(code **)(*plVar4 + 0x9b0))
                              (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_2a8 + 1);
                    if (bVar18) {
                      FUN_14034edd0(lVar13);
                    }
                    return 1;
                  }
                }
              }
            }
          }
        }
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar17 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401b4485:
  if (bVar18) {
    FUN_14034edd0(lVar13);
  }
  return 0;
}



void FUN_1401b44b0(longlong param_1)

{
  undefined8 *puVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  bool bVar5;
  
  plVar4 = *(longlong **)(param_1 + 0x6e0);
  if (plVar4 == (longlong *)0x0) {
    return;
  }
  if (plVar4 != *(longlong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return;
  }
  lVar3 = *plVar4;
  if (lVar3 == 0) {
    return;
  }
  if (plVar4 != *(longlong **)(param_1 + 0x6e8)) {
    iVar2 = DAT_14060804c + 1;
    bVar5 = DAT_14060804c == 0;
    DAT_14060804c = iVar2;
    if (bVar5) {
      FUN_140176d60(1);
    }
    lVar3 = 0;
  }
  FUN_140237f20(lVar3,8);
  puVar1 = *(undefined8 **)(param_1 + 0x6e0);
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == *(undefined8 **)(param_1 + 0x6e8)) {
      plVar4 = (longlong *)*puVar1;
      goto LAB_1401b4567;
    }
    iVar2 = DAT_14060804c + 1;
    bVar5 = DAT_14060804c == 0;
    DAT_14060804c = iVar2;
    if (bVar5) {
      FUN_140176d60();
    }
  }
  plVar4 = (longlong *)0x0;
LAB_1401b4567:
  lVar3 = (**(code **)(*plVar4 + 0x270))();
  if (lVar3 != 0) {
    *(undefined4 *)(lVar3 + 0x80) = 0;
    *(undefined1 *)(lVar3 + 0xb4) = 0;
    *(undefined8 *)(lVar3 + 0xa8) = 0;
    *(undefined4 *)(lVar3 + 0xb0) = 0;
  }
  plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x3c0);
  (**(code **)(*plVar4 + 0x720))(plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0);
  return;
}



longlong * FUN_1401b45d0(longlong param_1)

{
  undefined8 *puVar1;
  uint uVar2;
  uint uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *extraout_RAX;
  uint *puVar7;
  undefined8 uVar8;
  uint *puVar9;
  longlong *plVar10;
  uint *puVar11;
  uint *puVar12;
  bool bVar13;
  uint *local_50;
  longlong local_48;
  undefined8 local_40;
  
  plVar4 = *(longlong **)(param_1 + 0x6e0);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
      plVar6 = (longlong *)*plVar4;
      if (plVar6 != (longlong *)0x0) {
        if (plVar4 != *(longlong **)(param_1 + 0x6e8)) {
          uVar2 = DAT_14060804c + 1;
          bVar13 = DAT_14060804c == 0;
          DAT_14060804c = uVar2;
          if (bVar13) {
            FUN_140176d60();
          }
          plVar6 = (longlong *)0x0;
        }
        lVar5 = (**(code **)(*plVar6 + 0x270))();
        plVar4 = (longlong *)0x0;
        if (lVar5 != 0) {
          puVar12 = (uint *)(lVar5 + 0xa8);
          uVar2 = 0;
          do {
            puVar11 = (uint *)0x0;
            local_50 = (uint *)0x0;
            lVar5 = 0;
            local_48 = 0;
            local_40 = 0;
            uVar3 = *puVar12;
            plVar6 = (longlong *)FUN_14031c370();
            plVar4 = (longlong *)((ulonglong)uVar3 / (ulonglong)*(uint *)(plVar6 + 2));
            if (*plVar6 != 0) {
              for (puVar9 = *(uint **)(*plVar6 +
                                      ((ulonglong)uVar3 % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
                  puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0x34)) {
                if ((puVar9[0x36] == uVar3) && (*puVar9 == uVar3)) {
                  if (puVar9 != (uint *)0x0) {
                    if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    plVar4 = (longlong *)FUN_14012bb70(&local_50);
                    lVar5 = local_48;
                    puVar11 = local_50;
                  }
                  break;
                }
              }
            }
            plVar6 = (longlong *)0x0;
            plVar10 = (longlong *)(lVar5 - (longlong)puVar11 >> 2);
            puVar9 = puVar11;
            if (plVar10 != (longlong *)0x0) {
              do {
                uVar3 = *puVar9;
                plVar4 = (longlong *)FUN_1403161f0();
                if (*plVar4 != 0) {
                  for (puVar7 = *(uint **)(*plVar4 +
                                          ((ulonglong)uVar3 % (ulonglong)*(uint *)(plVar4 + 2)) * 8)
                      ; puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xe8)) {
                    if ((puVar7[0xea] == uVar3) && (*puVar7 == uVar3)) {
                      if (puVar7 != (uint *)0x0) {
                        if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        uVar3 = puVar7[3];
                        goto LAB_1401b4775;
                      }
                      break;
                    }
                  }
                }
                uVar3 = 0;
LAB_1401b4775:
                plVar4 = (longlong *)FUN_140267710(uVar3);
                if (plVar4 != (longlong *)0x0) {
                  (**(code **)(*plVar4 + 8))(plVar4,*puVar9);
                  puVar1 = *(undefined8 **)(param_1 + 0x6e0);
                  if (puVar1 == (undefined8 *)0x0) {
LAB_1401b47c7:
                    uVar8 = 0;
                  }
                  else {
                    if (puVar1 != *(undefined8 **)(param_1 + 0x6e8)) {
                      uVar3 = DAT_14060804c + 1;
                      bVar13 = DAT_14060804c == 0;
                      DAT_14060804c = uVar3;
                      if (bVar13) {
                        FUN_140176d60(1);
                      }
                      goto LAB_1401b47c7;
                    }
                    uVar8 = *puVar1;
                  }
                  FUN_140235f90(uVar8,param_1,plVar4);
                }
                plVar4 = (longlong *)(ulonglong)((int)plVar6 + 1);
                plVar6 = plVar4;
                puVar9 = puVar9 + 1;
              } while (plVar4 < plVar10);
            }
            if (puVar11 != (uint *)0x0) {
              operator_delete(puVar11);
              plVar4 = extraout_RAX;
            }
            uVar2 = uVar2 + 1;
            puVar12 = puVar12 + 1;
          } while (uVar2 < 3);
        }
      }
    }
    else {
      uVar2 = DAT_14060804c + 1;
      plVar4 = (longlong *)(ulonglong)uVar2;
      bVar13 = DAT_14060804c == 0;
      DAT_14060804c = uVar2;
      if (bVar13) {
        plVar4 = (longlong *)FUN_140176d60(1);
      }
    }
  }
  return plVar4;
}



// WARNING: Removing unreachable block (ram,0x0001401b49bd)
// WARNING: Removing unreachable block (ram,0x0001401b48f9)

undefined8 FUN_1401b4840(longlong param_1,byte param_2,longlong param_3,undefined8 param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  longlong *plVar4;
  ulonglong uVar5;
  uint *puVar6;
  uint *puVar7;
  uint *puVar8;
  uint *puVar9;
  undefined8 uVar10;
  undefined2 local_40;
  undefined6 uStack_3e;
  undefined8 local_30;
  ulonglong local_28;
  
  uVar10 = 0xfffffffffffffffe;
  puVar7 = (uint *)0x0;
  local_28 = 7;
  local_30 = 0;
  local_40 = 0;
  FUN_140001710(&local_40,&DAT_140477960,0,param_4,0xfffffffffffffffe);
  uVar1 = *(uint *)(param_3 + 1);
  plVar4 = (longlong *)FUN_14030d8e0();
  puVar6 = puVar7;
  if (*plVar4 != 0) {
    for (puVar8 = *(uint **)(*plVar4 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
        (puVar6 = puVar7, puVar8 != (uint *)0x0 &&
        ((puVar8[0x14] != uVar1 || (puVar6 = puVar8, *puVar8 != uVar1))));
        puVar8 = *(uint **)(puVar8 + 0x12)) {
    }
  }
  if (puVar6 != (uint *)0x0) {
    puVar8 = puVar6 + 8;
    if (7 < *(ulonglong *)(puVar6 + 0xe)) {
      puVar8 = *(uint **)puVar8;
    }
    uVar1 = puVar6[6];
    uVar2 = puVar6[2];
    uVar5 = 0xffffffffffffffff;
    puVar9 = puVar8;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      uVar3 = *puVar9;
      puVar9 = (uint *)((longlong)puVar9 + 2);
    } while ((short)uVar3 != 0);
    FUN_140001710(&local_40,puVar8,~uVar5 - 1,puVar6[5],uVar10);
    if (param_2 == ((byte)uVar2 & param_2)) {
      plVar4 = (longlong *)FUN_1403161f0();
      if (*plVar4 != 0) {
        for (puVar6 = *(uint **)(*plVar4 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar4 + 2)) * 8
                                ); puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xe8)) {
          if ((puVar6[0xea] == uVar1) && (*puVar6 == uVar1)) {
            if (puVar6 != (uint *)0x0) {
              puVar7 = (uint *)(ulonglong)puVar6[3];
            }
            break;
          }
        }
      }
      plVar4 = (longlong *)FUN_140267710(puVar7);
      if (plVar4 != (longlong *)0x0) {
        (**(code **)(*plVar4 + 0x70))(plVar4,*(undefined4 *)(param_3 + 5));
        (**(code **)(*plVar4 + 8))(plVar4,uVar1);
        uVar10 = FUN_140174f50(param_1 + 0x6e0);
        FUN_1402361f0(uVar10,param_1,plVar4,param_3);
        if (7 < local_28) {
          operator_delete((void *)CONCAT62(uStack_3e,local_40));
        }
        return 1;
      }
    }
  }
  if (7 < local_28) {
    operator_delete((void *)CONCAT62(uStack_3e,local_40));
  }
  return 0;
}



ulonglong FUN_1401b4a60(longlong param_1,undefined4 *param_2,undefined4 param_3,undefined8 param_4)

{
  char cVar1;
  longlong lVar2;
  ulonglong *puVar3;
  int iVar4;
  undefined8 *puVar5;
  undefined8 **ppuVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined8 *puVar9;
  bool bVar10;
  undefined8 *local_res10 [2];
  undefined8 *local_res20;
  undefined8 uVar11;
  
  uVar11 = 0xfffffffffffffffe;
  uVar8 = 0;
  *param_2 = 0;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  cVar1 = *(char *)((longlong)DAT_140609ca0[1] + 0x21);
  puVar5 = (undefined8 *)DAT_140609ca0[1];
  local_res10[0] = DAT_140609ca0;
  while (puVar9 = puVar5, cVar1 == '\0') {
    if (*(int *)(puVar9 + 3) < 7) {
      puVar5 = (undefined8 *)puVar9[2];
      puVar9 = local_res10[0];
    }
    else {
      puVar5 = (undefined8 *)*puVar9;
    }
    cVar1 = *(char *)((longlong)puVar5 + 0x21);
    local_res10[0] = puVar9;
  }
  if ((local_res10[0] == DAT_140609ca0) || (7 < *(int *)(local_res10[0] + 3))) {
    local_res20 = DAT_140609ca0;
    ppuVar6 = &local_res20;
  }
  else {
    ppuVar6 = local_res10;
  }
  puVar5 = *ppuVar6;
  if ((DAT_140609ca0 == puVar5) ||
     (bVar10 = *(char *)((longlong)puVar5 + 0x1c) == '\x01',
     uVar7 = CONCAT71((int7)((ulonglong)puVar5 >> 8),bVar10), bVar10)) {
    lVar2 = *(longlong *)(param_1 + 0x194);
    if ((*(longlong *)(param_1 + 0x194) != 0) ||
       (uVar7 = uVar8, lVar2 = *(longlong *)(param_1 + 0x19c), *(longlong *)(param_1 + 0x19c) != 0))
    {
      uVar7 = (ulonglong)((1 - (uint)(lVar2 != 0)) - (uint)((lVar2 != 0) != 0));
    }
    if ((int)uVar7 != 0) {
      puVar3 = *(ulonglong **)(param_1 + 0x6e0);
      if (puVar3 != (ulonglong *)0x0) {
        if (puVar3 == *(ulonglong **)(param_1 + 0x6e8)) {
          uVar8 = *puVar3;
        }
        else {
          iVar4 = DAT_14060804c + 1;
          bVar10 = DAT_14060804c == 0;
          DAT_14060804c = iVar4;
          if (bVar10) {
            FUN_140176d60(1);
          }
        }
      }
      uVar8 = FUN_1402363a0(uVar8,param_2,param_3,param_4,uVar11);
      return uVar8;
    }
  }
  return uVar7 & 0xffffffffffffff00;
}



void FUN_1401b4bc0(longlong param_1,float param_2,int param_3,undefined4 param_4)

{
  longlong *plVar1;
  void *pvVar2;
  bool bVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined8 uVar9;
  longlong *plVar10;
  uint *puVar11;
  longlong lVar12;
  int *piVar13;
  bool bVar14;
  bool bVar15;
  undefined2 *in_stack_fffffffffffffdb8;
  undefined4 uVar16;
  undefined2 local_228;
  undefined2 local_226;
  undefined2 local_224;
  undefined2 local_222;
  undefined2 local_220;
  undefined2 local_21e;
  uint local_21c;
  longlong *local_218;
  longlong *local_210;
  int local_208 [8];
  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;
  undefined8 local_1a8;
  longlong local_198;
  longlong local_190;
  int local_180;
  int local_174 [31];
  int local_f8;
  int local_f4;
  undefined4 local_f0;
  longlong local_e8;
  longlong local_e0;
  uint local_d0;
  int local_c4 [31];
  int local_48;
  int local_44;
  undefined4 local_40;
  
  local_1a8 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_218);
  plVar1 = local_218;
  if (local_218 != (longlong *)0x0) {
    if (local_218 == local_210) {
      if (*local_218 != 0) {
        local_208[0] = 0;
        local_208[1] = 1;
        local_208[2] = 3;
        local_208[3] = 2;
        local_208[4] = 4;
        local_208[5] = 9;
        local_208[6] = 5;
        bVar14 = false;
        bVar3 = false;
        iVar6 = 0;
        piVar13 = local_208;
        do {
          FUN_14000a170(&local_198);
          local_f0 = 0;
          iVar7 = *piVar13;
          if ((-1 < iVar7) && (iVar7 < 0x18)) {
            lVar12 = (longlong)iVar7 * 0xac + *plVar1;
            *(undefined2 *)(lVar12 + 0x14) = 0;
            *(short *)(lVar12 + 0x16) = (short)*piVar13;
            FUN_140090020(&local_198);
            if ((local_198 == 0) && (local_190 == 0)) {
              bVar15 = false;
            }
            else {
              bVar15 = true;
            }
            if ((bVar15) && (0 < local_180)) {
              if (local_f8 == 0) {
                uVar9 = FUN_140137690();
                iVar7 = FUN_140136bb0(uVar9,local_180);
                iVar7 = local_f8 + local_f4 + iVar7;
              }
              else {
                iVar7 = local_f4 + local_f8;
              }
              uVar16 = (undefined4)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
              if (local_174[0] != iVar7) {
                iVar8 = (int)((float)iVar7 * param_2) + local_174[0];
                if (iVar7 < iVar8) {
                  iVar8 = iVar7;
                }
                bVar15 = local_174[0] == 0;
                local_174[0] = iVar8;
                if (bVar15) {
                  if (iVar6 == 0) {
                    FUN_14019e660(param_1,&local_198,param_4);
                    bVar3 = true;
                  }
                  else {
                    FUN_14019f2b0(param_1,&local_198);
                    bVar14 = true;
                  }
                }
                uVar9 = FUN_140174f00(&local_218);
                FUN_1401ed220(uVar9,&DAT_14047ba28,local_208 + iVar6,&local_198,CONCAT44(uVar16,6));
                local_1e8 = *(undefined4 *)(param_1 + 0x160);
                local_1e4 = *(undefined4 *)(param_1 + 0x164);
                local_1e0 = *(undefined4 *)(param_1 + 0x168);
                local_1dc = *(undefined4 *)(param_1 + 0x16c);
                local_1c8 = *(undefined4 *)(param_1 + 0x170);
                local_1c4 = *(undefined4 *)(param_1 + 0x174);
                local_1c0 = *(undefined4 *)(param_1 + 0x178);
                local_1bc = *(undefined4 *)(param_1 + 0x17c);
                iVar7 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar12 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar12 != 0)) {
                  local_220 = (undefined2)iVar7;
                  plVar10 = (longlong *)
                            (*(longlong *)
                              (*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                            + 0x70);
                  (**(code **)(*plVar10 + 0x140))
                            (plVar10,1,&DAT_1405d85a0,&local_220,&local_1c8,&local_1e8,&local_198);
                }
                local_224 = (undefined2)*piVar13;
                local_228 = 0;
                plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                in_stack_fffffffffffffdb8 = &local_224;
                (**(code **)(*plVar10 + 0xf0))
                          (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_228,
                           in_stack_fffffffffffffdb8,&local_198,local_174);
              }
            }
          }
          iVar6 = iVar6 + 1;
          piVar13 = piVar13 + 1;
        } while (iVar6 < 7);
        if (bVar3) {
          FUN_14019bcf0(param_1);
        }
        if (bVar14) {
          FUN_14019bb50(param_1);
        }
        if (param_3 < 1) {
          local_21c = 0;
          do {
            uVar4 = local_21c;
            FUN_14000a170(&local_e8);
            local_40 = 0;
            if (uVar4 < 0x18) {
              lVar12 = ((longlong)(int)uVar4 + 0x18) * 0xac + *plVar1;
              *(undefined2 *)(lVar12 + 0x14) = 1;
              *(short *)(lVar12 + 0x16) = (short)uVar4;
              FUN_140090020(&local_e8);
              uVar5 = local_d0;
              if ((local_e8 != 0) || (bVar14 = false, local_e0 != 0)) {
                bVar14 = true;
              }
              if ((bVar14) && (0 < (int)local_d0)) {
                lVar12 = FUN_140137690();
                if (*(longlong *)(lVar12 + 0x88) != 0) {
                  for (puVar11 = *(uint **)(*(longlong *)(lVar12 + 0x88) +
                                           ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar12 + 0x98))
                                           * 8); puVar11 != (uint *)0x0;
                      puVar11 = *(uint **)(puVar11 + 0xa6)) {
                    if ((puVar11[0xa8] == uVar5) && (*puVar11 == uVar5)) {
                      if (puVar11 != (uint *)0x0) {
                        if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        if (puVar11 != (uint *)0xfffffffffffffff8) {
                          if ((puVar11[0x36] != 1) && (puVar11[0x36] != 2)) goto LAB_1401b5193;
                          iVar6 = local_48;
                          if (local_c4[0] == 0) {
                            iVar6 = puVar11[0x52] + local_48;
                          }
                          iVar6 = iVar6 + local_44;
                          if (local_c4[0] == iVar6) goto LAB_1401b5193;
                          local_c4[0] = (int)((float)iVar6 * param_2) + local_c4[0];
                          if (iVar6 < local_c4[0]) {
                            local_c4[0] = iVar6;
                          }
                        }
                      }
                      break;
                    }
                  }
                }
                FUN_1401ed220(*plVar1,&DAT_14047ba2c,&local_21c,&local_e8,6);
                local_1d8 = *(undefined4 *)(param_1 + 0x160);
                local_1d4 = *(undefined4 *)(param_1 + 0x164);
                local_1d0 = *(undefined4 *)(param_1 + 0x168);
                local_1cc = *(undefined4 *)(param_1 + 0x16c);
                local_1b8 = *(undefined4 *)(param_1 + 0x170);
                local_1b4 = *(undefined4 *)(param_1 + 0x174);
                local_1b0 = *(undefined4 *)(param_1 + 0x178);
                local_1ac = *(undefined4 *)(param_1 + 0x17c);
                iVar6 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar12 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar12 != 0)) {
                  local_226 = (undefined2)iVar6;
                  plVar10 = (longlong *)
                            (*(longlong *)
                              (*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                            + 0x70);
                  (**(code **)(*plVar10 + 0x140))
                            (plVar10,1,&DAT_1405d85a0,&local_226,&local_1b8,&local_1d8,&local_e8);
                }
                local_21e = 1;
                plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                local_222 = (short)uVar4;
                (**(code **)(*plVar10 + 0xf0))
                          (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_21e,&local_222
                           ,&local_e8,local_c4);
              }
            }
LAB_1401b5193:
            local_21c = uVar4 + 1;
          } while ((int)local_21c < 0x18);
        }
        goto LAB_1401b51d7;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar14 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_210) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401b51d7:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar2 = (void *)*local_218;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_218);
  }
  return;
}



undefined8 FUN_1401b5230(longlong param_1,undefined4 param_2,undefined1 param_3)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 *puVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined4 local_30 [2];
  longlong local_28;
  
  lVar3 = 0;
  lVar6 = 0;
  bVar9 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  lVar7 = lVar3;
  if (plVar2 != (longlong *)0x0) {
    lVar7 = lVar6;
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        lVar7 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar7 = lVar3,
           DAT_1406080a8 = iVar1, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar7);
        bVar9 = true;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x6e0);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x6e8)) {
      lVar3 = *plVar2;
    }
    else {
      iVar1 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar1;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = (longlong *)FUN_140208860(lVar3,param_2);
  if (((plVar2 == (longlong *)0x0) || (lVar3 = FUN_1401b5430(param_1,param_2), lVar3 != 0)) ||
     (lVar3 = FUN_1401deb80(param_1 + 0xad8), lVar3 == 0)) {
    if (bVar9) {
      FUN_14034edd0(lVar7);
    }
    uVar5 = 0;
  }
  else {
    FUN_1401f6900(lVar3);
    *(undefined1 *)(lVar3 + 0x2041) = param_3;
    *(undefined1 *)(lVar3 + 0x2040) = param_3;
    lVar6 = (**(code **)(*plVar2 + 0x280))(plVar2);
    if (lVar6 != 0) {
      puVar4 = (undefined4 *)(**(code **)(*plVar2 + 0x280))(plVar2);
      *(undefined4 *)(lVar3 + 0x2044) = *puVar4;
      *(undefined4 *)(lVar3 + 0x2048) = puVar4[1];
      *(undefined4 *)(lVar3 + 0x204c) = puVar4[2];
      *(undefined4 *)(lVar3 + 0x2050) = puVar4[3];
    }
    local_30[0] = param_2;
    local_28 = lVar3;
    uVar5 = FUN_1401e2630(param_1 + 0xb08,local_30);
    FUN_1401df5d0(param_1 + 0xb08,local_30,uVar5);
    if (bVar9) {
      FUN_14034edd0(lVar7);
    }
    uVar5 = 1;
  }
  return uVar5;
}



undefined8 FUN_1401b5430(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  int iVar4;
  int iVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  ulonglong *puVar8;
  undefined8 *puVar9;
  longlong lVar10;
  undefined8 **ppuVar11;
  longlong lVar12;
  longlong lVar13;
  bool bVar14;
  bool bVar15;
  undefined8 *local_res8;
  undefined8 *local_res18 [2];
  undefined8 uVar16;
  longlong lVar17;
  undefined4 uVar18;
  
  uVar16 = 0xfffffffffffffffe;
  lVar10 = 0;
  iVar5 = 0;
  lVar12 = 0;
  lVar17 = 0;
  bVar15 = false;
  uVar18 = 0;
  plVar7 = *(longlong **)(param_1 + 0xb28);
  lVar13 = lVar10;
  if (plVar7 != (longlong *)0x0) {
    lVar13 = lVar12;
    if (plVar7 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar7 != 0) {
        lVar13 = *plVar7;
        if ((plVar7 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar15 = DAT_1406080a8 == 0, lVar13 = lVar10,
           DAT_1406080a8 = iVar4, bVar15)) {
          FUN_140176d60(1);
        }
        lVar17 = lVar13;
        FUN_14034ed40(lVar13);
        bVar15 = true;
        uVar18 = 1;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar14 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  puVar9 = (undefined8 *)(*(undefined8 **)(param_1 + 0xb10))[1];
  cVar1 = *(char *)((longlong)puVar9 + 0x29);
  local_res8 = *(undefined8 **)(param_1 + 0xb10);
  while (cVar1 == '\0') {
    if (*(int *)(puVar9 + 3) < param_2) {
      puVar6 = (undefined8 *)puVar9[2];
      puVar9 = local_res8;
    }
    else {
      puVar6 = (undefined8 *)*puVar9;
    }
    local_res8 = puVar9;
    puVar9 = puVar6;
    cVar1 = *(char *)((longlong)puVar6 + 0x29);
  }
  puVar9 = *(undefined8 **)(param_1 + 0xb10);
  if ((local_res8 == puVar9) || (param_2 < *(int *)(local_res8 + 3))) {
    local_res18[0] = puVar9;
    ppuVar11 = local_res18;
  }
  else {
    ppuVar11 = &local_res8;
  }
  puVar6 = *ppuVar11;
  if (puVar6 == puVar9) {
    if (bVar15) {
      FUN_14034edd0(lVar13);
    }
  }
  else {
    plVar7 = *(longlong **)(param_1 + 0x6e0);
    if (plVar7 != (longlong *)0x0) {
      if (plVar7 == *(longlong **)(param_1 + 0x6e8)) {
        lVar10 = *plVar7;
      }
      else {
        iVar4 = DAT_14060804c + 1;
        bVar14 = DAT_14060804c == 0;
        DAT_14060804c = iVar4;
        if (bVar14) {
          FUN_140176d60(1);
        }
      }
    }
    plVar7 = (longlong *)FUN_140208860(lVar10,param_2,param_3,param_4,uVar16,lVar17,uVar18);
    if (plVar7 == (longlong *)0x0) {
      if (bVar15) {
        FUN_14034edd0(lVar13);
        return 0;
      }
    }
    else {
      puVar8 = (ulonglong *)(**(code **)(*plVar7 + 0x280))(plVar7);
      uVar2 = *(ulonglong *)(puVar6[4] + 0x2044);
      uVar3 = *(ulonglong *)(puVar6[4] + 0x204c);
      bVar14 = uVar2 < *puVar8;
      if ((uVar2 != *puVar8) || (bVar14 = uVar3 < puVar8[1], uVar3 != puVar8[1])) {
        iVar5 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
      }
      if (iVar5 == 0) {
        uVar16 = puVar6[4];
        if (!bVar15) {
          return uVar16;
        }
        FUN_14034edd0(lVar13);
        return uVar16;
      }
      if (bVar15) {
        FUN_14034edd0(lVar13);
        return 0;
      }
    }
  }
  return 0;
}



undefined8 FUN_1401b5650(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 **ppuVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  undefined8 *local_res8;
  undefined8 *local_res18;
  undefined8 uVar12;
  longlong lVar13;
  
  uVar12 = 0xfffffffffffffffe;
  lVar7 = 0;
  lVar13 = 0;
  bVar11 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar9 = lVar7;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar8 = *plVar1;
      lVar9 = 0;
      if (lVar8 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, lVar8 = lVar7,
           DAT_1406080a8 = iVar3, bVar11)) {
          FUN_140176d60(1);
        }
        lVar13 = lVar8;
        FUN_14034ed40(lVar8);
        bVar11 = true;
        lVar9 = lVar8;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  puVar5 = (undefined8 *)(*(undefined8 **)(param_1 + 0xb10))[1];
  cVar2 = *(char *)((longlong)puVar5 + 0x29);
  local_res8 = *(undefined8 **)(param_1 + 0xb10);
  while (cVar2 == '\0') {
    if (*(int *)(puVar5 + 3) < param_2) {
      puVar4 = (undefined8 *)puVar5[2];
      puVar5 = local_res8;
    }
    else {
      puVar4 = (undefined8 *)*puVar5;
    }
    local_res8 = puVar5;
    puVar5 = puVar4;
    cVar2 = *(char *)((longlong)puVar4 + 0x29);
  }
  if ((local_res8 == *(undefined8 **)(param_1 + 0xb10)) || (param_2 < *(int *)(local_res8 + 3))) {
    local_res18 = *(undefined8 **)(param_1 + 0xb10);
    ppuVar6 = &local_res18;
  }
  else {
    ppuVar6 = &local_res8;
  }
  puVar5 = *ppuVar6;
  if (((puVar5 != *(undefined8 **)(param_1 + 0xb10)) && (puVar5[4] != 0)) &&
     (cVar2 = FUN_1401deb20(param_1 + 0xad8,puVar5[4]), cVar2 != '\0')) {
    FUN_1401debd0(param_1 + 0xad8,puVar5[4]);
    FUN_140175db0(param_1 + 0xb08,&local_res8,puVar5,param_4,uVar12,lVar13);
  }
  if (bVar11) {
    FUN_14034edd0(lVar9);
  }
  return 1;
}



undefined4 *
FUN_1401b57c0(longlong param_1,undefined4 *param_2,ulonglong *param_3,undefined4 param_4,
             longlong param_5)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  undefined1 local_b8 [168];
  undefined4 local_10;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar4 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar4) {
            FUN_140176d60(1);
          }
          lVar3 = 0;
        }
        iVar2 = FUN_140208e30(lVar3,param_3);
        if ((iVar2 != 0) && (lVar3 = FUN_1401b5430(param_1,iVar2), lVar3 != 0)) {
          bVar4 = *(ulonglong *)(lVar3 + 0x2044) < *param_3;
          if ((*(ulonglong *)(lVar3 + 0x2044) == *param_3) &&
             (bVar4 = *(ulonglong *)(lVar3 + 0x204c) < param_3[1],
             *(ulonglong *)(lVar3 + 0x204c) == param_3[1])) {
            iVar2 = 0;
          }
          else {
            iVar2 = (1 - (uint)bVar4) - (uint)(bVar4 != 0);
          }
          if (iVar2 == 0) {
            FUN_14000a170(local_b8);
            local_10 = 0;
            FUN_1401e0370(local_b8,param_5);
            FUN_1401f6cd0(lVar3,param_2,param_4,(int)*(short *)(param_5 + 0x12),local_b8);
            return param_2;
          }
        }
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar4 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar4) {
        FUN_140176d60(1);
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
  return param_2;
}



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

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  ulonglong *puVar6;
  bool bVar7;
  
  plVar4 = *(longlong **)(param_1 + 0x6e0);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
      if (*plVar4 != 0) {
        if (param_3 == 0) {
          *param_2 = 0;
          param_2[1] = 0;
          param_2[2] = 0;
          param_2[3] = 0;
          return param_2;
        }
        lVar2 = FUN_1401b5430(param_1,param_3);
        if (lVar2 != 0) {
          uVar3 = FUN_140174f50((longlong *)(param_1 + 0x6e0));
          plVar4 = (longlong *)FUN_140208860(uVar3,param_3);
          if ((plVar4 != (longlong *)0x0) &&
             (lVar5 = (**(code **)(*plVar4 + 0x280))(plVar4), lVar5 != 0)) {
            puVar6 = (ulonglong *)(**(code **)(*plVar4 + 0x280))(plVar4);
            bVar7 = *(ulonglong *)(lVar2 + 0x2044) < *puVar6;
            if ((*(ulonglong *)(lVar2 + 0x2044) == *puVar6) &&
               (bVar7 = *(ulonglong *)(lVar2 + 0x204c) < puVar6[1],
               *(ulonglong *)(lVar2 + 0x204c) == puVar6[1])) {
              iVar1 = 0;
            }
            else {
              iVar1 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
            }
            if (iVar1 == 0) {
              FUN_1401f6ad0(lVar2,param_2,param_4,param_5);
              return param_2;
            }
          }
        }
        *param_2 = 0;
        param_2[1] = 0;
        param_2[2] = 0;
        param_2[3] = 0;
        return param_2;
      }
    }
    else {
      iVar1 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar1;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
  return param_2;
}



undefined8
FUN_1401b5ae0(longlong param_1,int param_2,int param_3,undefined4 param_4,undefined4 param_5)

{
  int iVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  int local_res10 [4];
  undefined4 local_res20 [2];
  undefined8 in_stack_ffffffffffffff78;
  undefined4 uVar5;
  undefined8 in_stack_ffffffffffffff88;
  undefined4 uVar6;
  undefined4 local_68;
  undefined4 local_64;
  undefined8 local_60;
  undefined **local_58;
  longlong *local_50;
  longlong local_48;
  ulonglong local_40;
  undefined8 local_38;
  
  uVar5 = (undefined4)((ulonglong)in_stack_ffffffffffffff78 >> 0x20);
  uVar6 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
  local_60 = 0xfffffffffffffffe;
  if (param_2 == 0) {
    return 0;
  }
  plVar3 = *(longlong **)(param_1 + 0x6e0);
  if (plVar3 == (longlong *)0x0) {
    return 0;
  }
  local_res10[0] = param_2;
  local_res20[0] = param_4;
  if (plVar3 == *(longlong **)(param_1 + 0x6e8)) {
    if (*plVar3 == 0) {
      return 0;
    }
    plVar3 = *(longlong **)(param_1 + 0x6c0);
    if (plVar3 == (longlong *)0x0) {
      return 0;
    }
    if (plVar3 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar3 == 0) {
        return 0;
      }
      lVar2 = FUN_1401b5430();
      if (lVar2 == 0) {
        return 0;
      }
      iVar1 = FUN_1401f7220(lVar2,param_1,param_3,local_res20,CONCAT44(uVar5,param_5),
                            &stack0x00000030,CONCAT44(uVar6,local_res10[0]),&stack0x00000038);
      if ((iVar1 != 0) && (param_3 == 0)) {
        local_58 = Proud::CFastArray<>::vftable;
        local_50 = (longlong *)0x0;
        local_48 = 0;
        local_40 = 0;
        local_38 = 0;
        plVar3 = (longlong *)FUN_140174f50(param_1 + 0x6e0);
        iVar1 = (**(code **)(*plVar3 + 0xae8))(plVar3,&local_58);
        lVar2 = *(longlong *)(param_1 + 0xb58);
        if ((lVar2 == 0) ||
           ((*(longlong *)(lVar2 + 0x30) == 0 ||
            (lVar4 = *(longlong *)(*(longlong *)(lVar2 + 0x30) + 0x2d0), lVar4 == 0)))) {
          local_64 = 0;
          if (iVar1 < 1) {
            lVar2 = FUN_140174f50(param_1 + 0x6e0);
            local_68 = *(undefined4 *)(lVar2 + 0x128);
            plVar3 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar3 + 0xbe0))
                      (plVar3,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_68,local_res10,
                       local_res20,&local_64);
          }
          else {
            lVar2 = FUN_140174f50(param_1 + 0x6e0);
            local_68 = *(undefined4 *)(lVar2 + 0x128);
            lVar2 = local_48;
            if ((int)local_40 == 0) {
              lVar2 = 0;
            }
            plVar3 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar3 + 0xbd8))
                      (plVar3,lVar2,local_40 & 0xffffffff,&DAT_1405d85a0,&local_68,local_res10,
                       local_res20,&local_64);
          }
        }
        else {
          iVar1 = *(int *)(lVar4 + 0x4bc);
          if ((iVar1 == 3) || (iVar1 == 6)) {
            local_68 = 0;
            lVar4 = FUN_140174f50(param_1 + 0x6e0);
            local_64 = *(undefined4 *)(lVar4 + 0x128);
            plVar3 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar3 + 0xbe0))
                      (plVar3,*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,&local_64,local_res10,
                       local_res20,&local_68);
          }
        }
        local_58 = Proud::CFastArray<>::vftable;
        if (local_48 != 0) {
          if (local_50 == (longlong *)0x0) {
            FUN_14034ff60();
          }
          else {
            (**(code **)(*local_50 + 0x18))(local_50,local_48);
          }
        }
      }
      return 1;
    }
    iVar1 = DAT_140608048;
    DAT_140608048 = DAT_140608048 + 1;
  }
  else {
    iVar1 = DAT_14060804c;
    DAT_14060804c = DAT_14060804c + 1;
  }
  if (iVar1 == 0) {
    FUN_140176d60(1);
  }
  return 0;
}



undefined8
FUN_1401b5dc0(longlong param_1,int param_2,int param_3,int param_4,uint param_5,undefined8 param_6,
             undefined8 param_7,int param_8)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  bool bVar8;
  int local_res10 [4];
  int local_res20 [2];
  undefined4 local_138;
  undefined4 local_134;
  undefined **local_130;
  longlong *local_128;
  longlong local_120;
  ulonglong local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined1 local_100;
  undefined8 local_f8;
  undefined1 local_e8 [24];
  undefined4 local_d0;
  short local_cc;
  int local_78;
  undefined4 local_40;
  
  local_f8 = 0xfffffffffffffffe;
  if (param_2 == 0) {
    return 0;
  }
  plVar7 = *(longlong **)(param_1 + 0x6c0);
  if (plVar7 == (longlong *)0x0) {
    return 0;
  }
  local_res10[0] = param_2;
  local_res20[0] = param_4;
  if (plVar7 != *(longlong **)(param_1 + 0x6c8)) {
    if (DAT_140608048 != 0) {
      DAT_140608048 = DAT_140608048 + 1;
      return 0;
    }
    DAT_140608048 = DAT_140608048 + 1;
    FUN_140176d60(1);
    return 0;
  }
  if (*plVar7 == 0) {
    return 0;
  }
  uVar3 = 0;
  local_108 = 0;
  local_100 = 0;
  cVar1 = FUN_140195920(param_1 + 0xb28);
  bVar8 = cVar1 != '\0';
  if (bVar8) {
    uVar3 = FUN_140195970(param_1 + 0xb28);
    local_100 = 0;
    local_108 = uVar3;
    FUN_14034ed40(uVar3);
    local_100 = 1;
  }
  FUN_14000a170(local_e8);
  local_40 = 0;
  uVar4 = FUN_140174f00(param_1 + 0x6c0);
  if (param_4 == 5) {
    iVar2 = FUN_1401ecc20(uVar4,&param_5,local_e8);
    if (iVar2 == 0) {
      local_134 = 0x17;
      local_138 = 0x2b0d;
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar7 + 0x70))
                (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_138,&local_134);
      goto LAB_1401b63a3;
    }
    uVar4 = FUN_140137690();
    iVar2 = FUN_140136910(uVar4,local_d0);
    if (3 < iVar2 - 0x38U) {
      local_138 = 0x17;
      local_134 = 0x2b0d;
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar7 + 0x70))
                (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_134,&local_138);
      goto LAB_1401b63a3;
    }
    lVar5 = FUN_1401e0840();
    GetLocalTime((LPSYSTEMTIME)(lVar5 + 200));
    iVar2 = FUN_1401e2290((LPSYSTEMTIME)(lVar5 + 200));
    if ((0 < local_78) && (local_78 <= iVar2)) {
      local_138 = 0x17;
      local_134 = 0x2b0d;
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar7 + 0x70))
                (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_134,&local_138);
      goto LAB_1401b63a3;
    }
  }
  else {
    if ((param_4 < 0) || (iVar2 = FUN_1401ed380(uVar4,param_7,local_res20,&param_5), iVar2 == 0)) {
      local_138 = 0x17;
      local_134 = 0x2b0d;
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar7 + 0x70))
                (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_134,&local_138);
      goto LAB_1401b63a3;
    }
    lVar5 = FUN_140174f00(param_1 + 0x6c0);
    if ((4 < param_4) || (0x17 < param_5)) {
      local_138 = 0x15;
      local_134 = 0x2b0d;
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar7 + 0x70))
                (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_134,&local_138);
      goto LAB_1401b63a3;
    }
    lVar5 = ((longlong)(int)param_5 + (longlong)param_4 * 0x18) * 0xac + lVar5;
    *(short *)(lVar5 + 0x14) = (short)param_4;
    *(short *)(lVar5 + 0x16) = (short)param_5;
    FUN_140090020(local_e8);
    if (local_cc < param_8) {
      local_138 = 0x18;
      local_134 = 0x2b0d;
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar7 + 0x70))
                (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_134,&local_138);
      goto LAB_1401b63a3;
    }
  }
  lVar5 = FUN_1401b5430(param_1,local_res10[0]);
  if ((lVar5 != 0) &&
     ((-1 < param_3 &&
      (cVar1 = FUN_1401f7cc0(lVar5,param_1,param_3,local_res10[0],local_e8,&param_6,&param_8),
      cVar1 != '\0')))) {
    if (param_3 == 0) {
      lVar5 = FUN_140174f50(param_1 + 0x6e0);
      if (lVar5 == 0) goto LAB_1401b63a3;
      local_130 = Proud::CFastArray<>::vftable;
      local_128 = (longlong *)0x0;
      local_120 = 0;
      local_118 = 0;
      local_110 = 0;
      plVar7 = (longlong *)FUN_140174f50(param_1 + 0x6e0);
      iVar2 = (**(code **)(*plVar7 + 0xae8))(plVar7,&local_130);
      lVar5 = *(longlong *)(param_1 + 0xb58);
      if (((lVar5 == 0) || (*(longlong *)(lVar5 + 0x30) == 0)) ||
         (lVar6 = *(longlong *)(*(longlong *)(lVar5 + 0x30) + 0x2d0), lVar6 == 0)) {
        if (iVar2 < 1) {
          lVar5 = FUN_140174f50(param_1 + 0x6e0);
          local_138 = *(undefined4 *)(lVar5 + 0x128);
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar7 + 0xbe0))
                    (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_138,local_res10,
                     &param_6,&local_d0);
        }
        else {
          lVar5 = FUN_140174f50(param_1 + 0x6e0);
          local_138 = *(undefined4 *)(lVar5 + 0x128);
          lVar5 = local_120;
          if ((int)local_118 == 0) {
            lVar5 = 0;
          }
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar7 + 0xbd8))
                    (plVar7,lVar5,local_118 & 0xffffffff,&DAT_1405d85a0,&local_138,local_res10,
                     &param_6,&local_d0);
        }
        local_130 = Proud::CFastArray<>::vftable;
        if (local_120 != 0) {
          if (local_128 == (longlong *)0x0) {
            FUN_14034ff60();
          }
          else {
            (**(code **)(*local_128 + 0x18))(local_128,local_120);
          }
        }
      }
      else {
        iVar2 = *(int *)(lVar6 + 0x4bc);
        if ((iVar2 == 3) || (iVar2 == 6)) {
          lVar6 = FUN_140174f50(param_1 + 0x6e0);
          local_138 = *(undefined4 *)(lVar6 + 0x128);
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar7 + 0xbe0))
                    (plVar7,*(undefined4 *)(lVar5 + 8),&DAT_1405d85a0,&local_138,local_res10,
                     &param_6,&local_d0);
        }
        local_130 = Proud::CFastArray<>::vftable;
        if (local_120 != 0) {
          if (local_128 == (longlong *)0x0) {
            FUN_14034ff60();
          }
          else {
            (**(code **)(*local_128 + 0x18))(local_128,local_120);
          }
        }
      }
    }
    if (bVar8) {
      FUN_14034edd0(uVar3);
    }
    return 1;
  }
LAB_1401b63a3:
  if (bVar8) {
    FUN_14034edd0(uVar3);
  }
  return 0;
}



void FUN_1401b63d0(longlong param_1,longlong *param_2,int *param_3,undefined4 param_4,
                  undefined8 param_5)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  
  if ((*param_2 == 0) && (param_2[1] == 0)) {
    bVar5 = false;
  }
  else {
    bVar5 = true;
  }
  if (bVar5) {
    if (*param_3 == 0) {
      plVar1 = *(longlong **)(param_1 + 0x6e0);
      if (plVar1 == (longlong *)0x0) {
        return;
      }
      if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
        if (DAT_14060804c != 0) {
          DAT_14060804c = DAT_14060804c + 1;
          return;
        }
        DAT_14060804c = DAT_14060804c + 1;
        FUN_140176d60(1);
        return;
      }
      lVar4 = *plVar1;
      if (lVar4 == 0) {
        return;
      }
      if ((plVar1 != *(longlong **)(param_1 + 0x6e8)) &&
         (iVar2 = DAT_14060804c + 1, bVar5 = DAT_14060804c == 0, lVar4 = 0, DAT_14060804c = iVar2,
         bVar5)) {
        FUN_140176d60(1);
      }
      lVar4 = FUN_1402089c0(lVar4,param_2);
      if (lVar4 == 0) {
        return;
      }
      lVar3 = FUN_1401b5430(param_1,*(undefined4 *)(lVar4 + 0x128));
      *param_3 = *(int *)(lVar4 + 0x128);
    }
    else {
      lVar3 = FUN_1401b5430();
    }
  }
  else {
    if (*param_3 == 0) {
      return;
    }
    lVar3 = FUN_1401b5430();
  }
  if (lVar3 != 0) {
    FUN_1401f7030(lVar3,param_4,param_5);
  }
  return;
}



undefined8 FUN_1401b6510(longlong param_1,undefined4 param_2)

{
  short sVar1;
  ulonglong *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  ulonglong uVar7;
  undefined8 uVar8;
  ulonglong uVar9;
  uint uVar10;
  ulonglong uVar11;
  bool bVar12;
  longlong local_d8;
  longlong local_d0;
  undefined4 local_30;
  
  lVar4 = FUN_1401b5430();
  if (lVar4 != 0) {
    puVar2 = *(ulonglong **)(param_1 + 0x6e0);
    uVar11 = 0;
    uVar9 = uVar11;
    if (puVar2 != (ulonglong *)0x0) {
      if (puVar2 == *(ulonglong **)(param_1 + 0x6e8)) {
        uVar9 = *puVar2;
      }
      else {
        iVar3 = DAT_14060804c + 1;
        bVar12 = DAT_14060804c == 0;
        DAT_14060804c = iVar3;
        if (bVar12) {
          FUN_140176d60(1);
        }
      }
    }
    plVar5 = (longlong *)FUN_140208860(uVar9,param_2);
    if ((plVar5 == (longlong *)0x0) || (lVar6 = (**(code **)(*plVar5 + 0x280))(plVar5), lVar6 == 0))
    {
      uVar8 = 0;
    }
    else {
      lVar6 = (**(code **)(*plVar5 + 0x280))(plVar5);
      sVar1 = *(short *)(lVar6 + 0x68);
      if (0 < sVar1) {
        lVar6 = lVar4 + 0x1020;
        uVar9 = uVar11;
        do {
          FUN_14000a170(&local_d8);
          local_30 = 0;
          uVar10 = (uint)uVar9;
          if (((uVar10 < 0x18) && ((int)uVar10 < (int)(uint)*(byte *)(lVar4 + 0x2041))) &&
             (iVar3 = FUN_14011b180(lVar6), iVar3 == 0)) {
            FUN_140090020(&local_d8,lVar6);
            if ((local_d8 != 0) || (uVar7 = uVar11, local_d0 != 0)) {
              uVar7 = 1;
            }
            if ((int)uVar7 != 0) {
              FUN_1401b66c0(param_1,param_2,uVar9,&local_d8);
            }
          }
          uVar9 = (ulonglong)(uVar10 + 1);
          lVar6 = lVar6 + 0xac;
        } while ((int)(uVar10 + 1) < (int)sVar1);
      }
      uVar8 = 1;
    }
    return uVar8;
  }
  return 0;
}



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

{
  undefined8 *puVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  undefined4 *puVar7;
  undefined8 uVar8;
  bool bVar9;
  undefined2 local_res8 [4];
  undefined4 local_res10 [2];
  undefined4 local_108 [2];
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0 [2];
  longlong local_e8;
  longlong local_e0;
  undefined1 local_d8 [168];
  undefined4 local_30;
  
  plVar5 = *(longlong **)(param_1 + 0x6e0);
  local_108[0] = 1;
  if (plVar5 == (longlong *)0x0) {
    return 0;
  }
  local_res10[0] = param_2;
  if (plVar5 != *(longlong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return 0;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return 0;
  }
  if (*plVar5 == 0) {
    return 0;
  }
  lVar4 = FUN_1401b5430();
  if (lVar4 == 0) {
    return 0;
  }
  puVar1 = *(undefined8 **)(param_1 + 0x6e0);
  local_100 = 0;
  local_fc = 0;
  local_f8 = 0;
  local_f4 = 0;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == *(undefined8 **)(param_1 + 0x6e8)) {
      uVar8 = *puVar1;
      goto LAB_1401b67ae;
    }
    iVar3 = DAT_14060804c + 1;
    bVar9 = DAT_14060804c == 0;
    DAT_14060804c = iVar3;
    if (bVar9) {
      FUN_140176d60(1);
    }
  }
  uVar8 = 0;
LAB_1401b67ae:
  plVar5 = (longlong *)FUN_140208860(uVar8,local_res10[0]);
  if ((plVar5 == (longlong *)0x0) || (lVar6 = (**(code **)(*plVar5 + 0x280))(plVar5), lVar6 == 0)) {
    uVar8 = 0;
  }
  else {
    puVar7 = (undefined4 *)(**(code **)(*plVar5 + 0x280))(plVar5);
    local_100 = *puVar7;
    local_fc = puVar7[1];
    local_f8 = puVar7[2];
    local_f4 = puVar7[3];
    cVar2 = FUN_1401f6df0(lVar4,local_108[0],param_3,param_4);
    if (cVar2 != '\0') {
      uVar8 = FUN_140174f50(param_1 + 0x6e0);
      FUN_140209090(uVar8,&local_e8,local_res10[0]);
      if ((local_e8 == 0) && (local_e0 == 0)) {
        bVar9 = false;
      }
      else {
        bVar9 = true;
      }
      if (bVar9) {
        iVar3 = *(int *)(param_1 + 0x284);
        local_f0[0] = *(undefined4 *)(param_1 + 8);
        if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
           (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
          local_res8[0] = (undefined2)iVar3;
          lVar4 = *(longlong *)(*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
          (**(code **)(*(longlong *)(lVar4 + 0x70) + 0xbb0))
                    (lVar4 + 0x70,1,&DAT_1405d85a0,local_res8,local_f0,&local_100,param_4);
        }
        local_res8[0] = (undefined2)param_3;
        FUN_14000a170(local_d8);
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        local_30 = 0;
        (**(code **)(*plVar5 + 0xa70))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_108,&local_e8,
                   local_res10,local_res8,local_d8);
      }
    }
    uVar8 = 1;
  }
  return uVar8;
}



undefined8 FUN_1401b6970(ulonglong param_1,undefined8 param_2,longlong *param_3,byte *param_4)

{
  void *pvVar1;
  ulonglong uVar2;
  byte *pbVar3;
  char cVar4;
  byte bVar5;
  int iVar6;
  int iVar7;
  undefined8 uVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined4 *puVar11;
  longlong lVar12;
  longlong *plVar13;
  longlong *plVar14;
  undefined8 *puVar15;
  bool bVar16;
  ulonglong local_res8;
  undefined8 local_res10;
  longlong *local_res18;
  byte *local_res20;
  undefined8 in_stack_fffffffffffffc70;
  undefined4 uVar17;
  undefined8 in_stack_fffffffffffffc80;
  undefined4 uVar18;
  undefined1 local_2d8 [2];
  undefined2 local_2d6;
  undefined4 local_2d4;
  int local_2d0;
  undefined4 local_2cc;
  longlong *local_2c8;
  undefined8 *local_2c0;
  undefined8 *local_2b8;
  undefined8 *local_2b0;
  undefined8 *local_2a0;
  undefined8 *local_298;
  undefined8 *local_290;
  longlong local_280;
  undefined4 local_278 [2];
  undefined4 local_270;
  undefined4 local_26c;
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined4 local_258;
  undefined4 local_254;
  undefined4 local_250;
  undefined4 local_24c;
  undefined4 local_248;
  undefined4 local_244;
  undefined8 local_238;
  undefined8 local_230;
  undefined8 local_228;
  undefined4 local_220;
  undefined4 local_21c;
  undefined4 local_218;
  undefined8 local_214;
  undefined8 local_20c;
  undefined8 local_204;
  undefined8 local_1fc;
  undefined8 local_1e8;
  undefined4 local_1e0;
  undefined4 local_1dc;
  undefined4 local_1d8;
  undefined4 local_1d4;
  undefined8 local_1d0;
  undefined8 local_1c8;
  undefined8 local_1c0;
  undefined8 local_1b8;
  undefined4 local_1b0;
  undefined1 local_1ac;
  undefined8 local_1ab;
  undefined2 local_1a3;
  undefined8 local_1a1;
  undefined8 local_199;
  undefined8 local_191;
  undefined8 local_189;
  undefined8 local_181;
  undefined4 local_179;
  undefined4 local_175;
  undefined1 local_171;
  undefined8 local_170;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined8 local_148;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  undefined8 local_130;
  undefined8 local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined4 local_110;
  undefined1 local_10c;
  undefined8 local_10b;
  undefined2 local_103;
  undefined8 local_101;
  undefined8 local_f9;
  undefined8 local_f1;
  undefined8 local_e9;
  undefined8 local_e1;
  undefined4 local_d9;
  undefined4 local_d5;
  undefined1 local_d1;
  undefined8 local_d0;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  longlong *local_a8;
  longlong *local_a0;
  undefined8 local_98;
  undefined1 local_90 [80];
  
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffc70 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffc80 >> 0x20);
  local_98 = 0xfffffffffffffffe;
  plVar9 = *(longlong **)(param_1 + 0x6e0);
  if (plVar9 == (longlong *)0x0) {
    return 0;
  }
  local_res8 = param_1;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  if (plVar9 != *(longlong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return 0;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return 0;
  }
  if (*plVar9 == 0) {
    return 0;
  }
  lVar10 = 0;
  lVar12 = *plVar9;
  if ((plVar9 != *(longlong **)(param_1 + 0x6e8)) &&
     (iVar6 = DAT_14060804c + 1, bVar16 = DAT_14060804c == 0, lVar12 = lVar10, DAT_14060804c = iVar6
     , bVar16)) {
    FUN_140176d60(1);
  }
  cVar4 = FUN_14020c880(lVar12);
  if (cVar4 == '\0') {
    return 0;
  }
  plVar9 = *(longlong **)(param_1 + 0x6e0);
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == *(longlong **)(param_1 + 0x6e8)) {
      lVar10 = *plVar9;
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar16 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar16) {
        FUN_140176d60(1);
      }
    }
  }
  iVar6 = FUN_140208e30(lVar10,param_2);
  if (iVar6 == 0) {
    return 0;
  }
  uVar8 = FUN_140174f50(param_1 + 0x6e0);
  plVar9 = (longlong *)FUN_140208860(uVar8,iVar6);
  if (plVar9 == (longlong *)0x0) {
    return 0;
  }
  local_2c8 = plVar9;
  lVar10 = (**(code **)(*plVar9 + 0x280))(plVar9);
  if (lVar10 == 0) {
    return 0;
  }
  (**(code **)(*plVar9 + 0x280))(plVar9);
  lVar10 = (**(code **)(*plVar9 + 0x280))(plVar9);
  if (*(char *)(lVar10 + 0x80) != '\x01') {
    return 0;
  }
  local_2cc = 0;
  bVar5 = FUN_140214f00(plVar9,&local_2cc);
  *local_res20 = bVar5;
  if (bVar5 == 1) {
    uVar8 = FUN_140137690();
    uVar17 = local_2cc;
    lVar10 = FUN_140136770(uVar8,local_2cc);
    if (lVar10 == 0) {
      return 0;
    }
    puVar11 = (undefined4 *)FUN_140357570(local_90);
    *(undefined4 *)param_3 = *puVar11;
    *(undefined4 *)((longlong)param_3 + 4) = puVar11[1];
    *(undefined4 *)(param_3 + 1) = puVar11[2];
    *(undefined4 *)((longlong)param_3 + 0xc) = puVar11[3];
    *(undefined4 *)(param_3 + 3) = uVar17;
    *(undefined2 *)((longlong)param_3 + 0x1c) = 1;
    FUN_140197b70(param_1,&local_a8);
    plVar14 = local_a8;
    if (local_a8 != (longlong *)0x0) {
      if (local_a8 == local_a0) {
        if (*local_a8 != 0) {
          iVar6 = *(int *)(lVar10 + 0xdc);
          local_2d4 = 0;
          local_2d0 = iVar6;
          if ((-1 < iVar6) && (iVar7 = FUN_1401ed430(*local_a8,&local_2d0,&local_2d4), iVar7 != 0))
          {
            *(short *)((longlong)param_3 + 0x14) = (short)iVar6;
            *(undefined2 *)((longlong)param_3 + 0x16) = (undefined2)local_2d4;
            FUN_1401e8cc0(*plVar14,&local_2d0,&local_2d4,param_3);
            local_270 = *(undefined4 *)(param_1 + 0x160);
            local_26c = *(undefined4 *)(param_1 + 0x164);
            local_268 = *(undefined4 *)(param_1 + 0x168);
            local_264 = *(undefined4 *)(param_1 + 0x16c);
            local_250 = *(undefined4 *)(param_1 + 0x170);
            local_24c = *(undefined4 *)(param_1 + 0x174);
            local_248 = *(undefined4 *)(param_1 + 0x178);
            local_244 = *(undefined4 *)(param_1 + 0x17c);
            iVar6 = *(int *)(param_1 + 0x284);
            local_278[0] = *(undefined4 *)(param_1 + 8);
            if ((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
              if ((*param_3 == 0) && (param_3[1] == 0)) {
                bVar16 = false;
              }
              else {
                bVar16 = true;
              }
              if (((bVar16) && ((int)param_3[3] != 0)) &&
                 (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)) {
                local_2d6 = (undefined2)iVar6;
                plVar13 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                          0x70);
                (**(code **)(*plVar13 + 0xb0))
                          (plVar13,1,&DAT_1405d85a0,&local_2d6,local_278,&local_250,&local_270,
                           &DAT_14047ba38,param_3);
              }
            }
            plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar13 + 0xc0))
                      (plVar13,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,
                       (undefined4 *)((longlong)param_3 + 0x14),
                       (undefined2 *)((longlong)param_3 + 0x16),param_3);
          }
        }
      }
      else {
        iVar6 = DAT_140608048 + 1;
        bVar16 = DAT_140608048 == 0;
        DAT_140608048 = iVar6;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar14 != (longlong *)0x0) {
      if (plVar14 == local_a0) {
        LOCK();
        plVar14 = plVar14 + 1;
        *(int *)plVar14 = (int)*plVar14 + -1;
        UNLOCK();
        if ((int)*plVar14 == 0) {
          pvVar1 = (void *)*local_a8;
          if (pvVar1 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar1 + 0xf630);
            operator_delete(pvVar1);
          }
          operator_delete(local_a8);
        }
      }
      else {
        iVar6 = DAT_140608050 + 1;
        bVar16 = DAT_140608050 == 0;
        DAT_140608050 = iVar6;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    goto LAB_1401b7394;
  }
  if (bVar5 != 3) {
    if (bVar5 != 2) goto LAB_1401b7394;
    local_1e8 = 0;
    local_1e0 = 0;
    local_1dc = 0;
    local_1d8 = 0;
    local_1d4 = 0;
    local_1b0 = 0;
    local_1ac = 0;
    local_1ab = 0;
    local_1a3 = 0;
    local_1a1 = 0;
    local_199 = 0;
    local_191 = 0;
    local_189 = 0;
    local_181 = 0;
    local_179 = 0;
    local_175 = 0;
    local_171 = 0;
    local_170 = 0;
    local_168 = 0;
    local_164 = 0;
    local_160 = 0;
    local_15c = 0;
    local_158 = 0;
    local_1d0 = 0;
    local_1c8 = 0;
    local_1c0 = 0;
    local_1b8 = 0;
    uVar8 = FUN_140174f50(param_1 + 0x6e0);
    FUN_14020c710(uVar8,&local_1e8,plVar9);
    local_2c0 = (undefined8 *)0x0;
    local_2b8 = (undefined8 *)0x0;
    local_2b0 = (undefined8 *)0x0;
    FUN_1401dec50(&local_2c0);
    if ((&local_1e8 < local_2b8) && (local_2c0 <= &local_1e8)) {
      lVar10 = (longlong)&local_1e8 - (longlong)local_2c0;
      if (local_2b8 == local_2b0) {
        FUN_1400d55e0(&local_2c0,1);
      }
      puVar15 = (undefined8 *)((lVar10 / 0x94) * 0x94 + (longlong)local_2c0);
      if (local_2b8 != (undefined8 *)0x0) {
LAB_1401b7330:
        memcpy(local_2b8,puVar15,0x94);
      }
    }
    else {
      if (local_2b8 == local_2b0) {
        FUN_1400d55e0(&local_2c0,1);
      }
      if (local_2b8 != (undefined8 *)0x0) {
        puVar15 = &local_1e8;
        goto LAB_1401b7330;
      }
    }
    local_2b8 = (undefined8 *)((longlong)local_2b8 + 0x94);
    local_2d8[0] = 0;
    plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
    (**(code **)(*plVar14 + 0x550))
              (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_2c0,local_2d8);
    if (local_2c0 != (undefined8 *)0x0) {
      operator_delete(local_2c0);
    }
    goto LAB_1401b7394;
  }
  local_280 = (**(code **)(*plVar9 + 0x280))(plVar9);
  uVar2 = local_res8;
  if (local_280 == 0) goto LAB_1401b7394;
  local_260 = *(undefined4 *)(local_res8 + 0x170);
  local_25c = *(undefined4 *)(local_res8 + 0x174);
  local_258 = *(undefined4 *)(local_res8 + 0x178);
  local_254 = *(undefined4 *)(local_res8 + 0x17c);
  FUN_1401feb20(*(undefined8 *)(local_res8 + 0xb50),*(undefined4 *)(local_res8 + 0x288),
                *(undefined4 *)(local_res8 + 0x284),local_2c8 + 0x1f6,&local_260,
                CONCAT44(uVar17,*(undefined4 *)(local_280 + 0x4c)),*(undefined8 *)(local_280 + 0x50)
                ,CONCAT44(uVar18,(int)*(short *)(local_280 + 0x68)),
                *(undefined8 *)(local_280 + 0x70),*(undefined4 *)(local_280 + 0x78),
                (int)plVar9[0x24],*(undefined4 *)(local_280 + 0x84),
                *(undefined4 *)(local_280 + 0x88),*(undefined4 *)(local_280 + 0x8c),
                *(undefined4 *)(local_280 + 0x90),*(undefined4 *)(local_280 + 0x94),
                *(undefined4 *)(local_280 + 0x98),*(undefined4 *)(local_280 + 0x9c),
                *(undefined4 *)(local_280 + 0xa0),*(undefined4 *)(local_280 + 0xa4),
                *(undefined4 *)(local_280 + 0xa8),*(undefined4 *)(local_280 + 0xac),
                *(undefined4 *)(local_280 + 0xb0),*(undefined4 *)(local_280 + 0xb4),
                *(undefined4 *)(local_280 + 0xb8),*(undefined4 *)(local_280 + 0xbc),
                *(undefined4 *)(local_280 + 0xc0));
  local_148 = 0;
  local_140 = 0;
  local_13c = 0;
  local_138 = 0;
  local_134 = 0;
  local_110 = 0;
  local_10c = 0;
  local_10b = 0;
  local_103 = 0;
  local_101 = 0;
  local_f9 = 0;
  local_f1 = 0;
  local_e9 = 0;
  local_e1 = 0;
  local_d9 = 0;
  local_d5 = 0;
  local_d1 = 0;
  local_d0 = 0;
  local_c8 = 0;
  local_c4 = 0;
  local_c0 = 0;
  local_bc = 0;
  local_b8 = 0;
  local_130 = 0;
  local_128 = 0;
  local_120 = 0;
  local_118 = 0;
  uVar8 = FUN_140174f50(uVar2 + 0x6e0);
  plVar9 = local_2c8;
  FUN_14020c710(uVar8,&local_148,local_2c8);
  local_2a0 = (undefined8 *)0x0;
  local_298 = (undefined8 *)0x0;
  local_290 = (undefined8 *)0x0;
  FUN_1401dec50(&local_2a0);
  if ((&local_148 < local_298) && (local_2a0 <= &local_148)) {
    lVar10 = (longlong)&local_148 - (longlong)local_2a0;
    if (local_298 == local_290) {
      FUN_1400d55e0(&local_2a0,1);
    }
    puVar15 = (undefined8 *)((lVar10 / 0x94) * 0x94 + (longlong)local_2a0);
    if (local_298 != (undefined8 *)0x0) {
LAB_1401b711c:
      memcpy(local_298,puVar15,0x94);
    }
  }
  else {
    if (local_298 == local_290) {
      FUN_1400d55e0(&local_2a0,1);
    }
    if (local_298 != (undefined8 *)0x0) {
      puVar15 = &local_148;
      goto LAB_1401b711c;
    }
  }
  local_298 = (undefined8 *)((longlong)local_298 + 0x94);
  local_res8 = local_res8 & 0xffffffffffffff00;
  plVar14 = (longlong *)(*(longlong *)(uVar2 + 0xb50) + 0x380);
  (**(code **)(*plVar14 + 0x550))
            (plVar14,*(undefined4 *)(uVar2 + 8),&DAT_1405d85a0,&local_2a0,&local_res8);
  param_1 = uVar2;
  if (local_2a0 != (undefined8 *)0x0) {
    operator_delete(local_2a0);
  }
LAB_1401b7394:
  pbVar3 = local_res20;
  local_280 = CONCAT44(local_280._4_4_,(int)plVar9[0x24]);
  local_2c8 = (longlong *)CONCAT44(local_2c8._4_4_,(uint)*local_res20);
  plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
  (**(code **)(*plVar14 + 0x720))
            (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10,&local_2c8,local_res18,
             &local_280);
  uVar8 = (**(code **)(*plVar9 + 0x280))(plVar9);
  FUN_140201920(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                *(undefined4 *)(param_1 + 0x284),*(undefined4 *)(param_1 + 8),uVar8,*pbVar3);
  local_238 = 0;
  local_230 = 0;
  local_228 = 0;
  local_220 = 0;
  local_21c = 0;
  local_218 = 0;
  local_214 = 0;
  local_20c = 0;
  local_204 = 0;
  local_1fc = 0;
  FUN_140203e10(*(undefined8 *)(param_1 + 0xb50),0x1fb,param_1,plVar9,&local_238);
  return 1;
}



void FUN_1401b74c0(longlong param_1,ulonglong param_2,char param_3,undefined4 param_4)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong *plVar4;
  bool bVar5;
  undefined4 local_res8 [2];
  uint local_res10 [4];
  undefined4 local_res20 [2];
  undefined8 in_stack_fffffffffffffec0;
  undefined4 *puVar6;
  undefined8 in_stack_fffffffffffffed0;
  undefined4 *puVar8;
  undefined8 in_stack_fffffffffffffee0;
  undefined4 *puVar10;
  undefined8 in_stack_fffffffffffffee8;
  undefined4 *puVar12;
  undefined8 in_stack_fffffffffffffef0;
  undefined4 *puVar14;
  undefined8 in_stack_fffffffffffffef8;
  undefined4 *puVar16;
  undefined8 in_stack_ffffffffffffff00;
  undefined4 *puVar18;
  undefined8 in_stack_ffffffffffffff08;
  undefined4 *puVar20;
  undefined8 in_stack_ffffffffffffff10;
  undefined4 *puVar22;
  undefined8 in_stack_ffffffffffffff18;
  undefined4 *puVar24;
  undefined8 in_stack_ffffffffffffff20;
  undefined4 *puVar26;
  undefined8 in_stack_ffffffffffffff28;
  undefined4 *puVar28;
  undefined8 in_stack_ffffffffffffff30;
  undefined4 *puVar30;
  undefined8 in_stack_ffffffffffffff38;
  undefined4 *puVar32;
  undefined8 in_stack_ffffffffffffff40;
  undefined4 *puVar34;
  undefined8 in_stack_ffffffffffffff48;
  undefined4 *puVar36;
  undefined4 local_88 [2];
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 uVar7;
  undefined4 uVar9;
  undefined4 uVar11;
  undefined4 uVar13;
  undefined4 uVar15;
  undefined4 uVar17;
  undefined4 uVar19;
  undefined4 uVar21;
  undefined4 uVar23;
  undefined4 uVar25;
  undefined4 uVar27;
  undefined4 uVar29;
  undefined4 uVar31;
  undefined4 uVar33;
  undefined4 uVar35;
  undefined4 uVar37;
  
  uVar7 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  uVar9 = (undefined4)((ulonglong)in_stack_fffffffffffffed0 >> 0x20);
  uVar11 = (undefined4)((ulonglong)in_stack_fffffffffffffee0 >> 0x20);
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffee8 >> 0x20);
  uVar15 = (undefined4)((ulonglong)in_stack_fffffffffffffef0 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffef8 >> 0x20);
  uVar19 = (undefined4)((ulonglong)in_stack_ffffffffffffff00 >> 0x20);
  uVar21 = (undefined4)((ulonglong)in_stack_ffffffffffffff08 >> 0x20);
  uVar23 = (undefined4)((ulonglong)in_stack_ffffffffffffff10 >> 0x20);
  uVar25 = (undefined4)((ulonglong)in_stack_ffffffffffffff18 >> 0x20);
  uVar27 = (undefined4)((ulonglong)in_stack_ffffffffffffff20 >> 0x20);
  uVar29 = (undefined4)((ulonglong)in_stack_ffffffffffffff28 >> 0x20);
  uVar31 = (undefined4)((ulonglong)in_stack_ffffffffffffff30 >> 0x20);
  uVar33 = (undefined4)((ulonglong)in_stack_ffffffffffffff38 >> 0x20);
  uVar35 = (undefined4)((ulonglong)in_stack_ffffffffffffff40 >> 0x20);
  uVar37 = (undefined4)((ulonglong)in_stack_ffffffffffffff48 >> 0x20);
  local_res10[0] = (uint)param_2;
  plVar2 = *(longlong **)(param_1 + 0x6e0);
  local_88[0] = 0;
  if (plVar2 == (longlong *)0x0) {
    return;
  }
  local_res20[0] = param_4;
  if (plVar2 != *(longlong **)(param_1 + 0x6e8)) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return;
  }
  lVar3 = *plVar2;
  if (lVar3 == 0) {
    return;
  }
  if ((plVar2 != *(longlong **)(param_1 + 0x6e8)) &&
     (iVar1 = DAT_14060804c + 1, bVar5 = DAT_14060804c == 0, lVar3 = 0, DAT_14060804c = iVar1, bVar5
     )) {
    FUN_140176d60(1);
    param_2 = (ulonglong)local_res10[0];
  }
  plVar2 = (longlong *)FUN_140208860(lVar3,param_2);
  if (plVar2 == (longlong *)0x0) {
    return;
  }
  lVar3 = (**(code **)(*plVar2 + 0x280))(plVar2);
  if (lVar3 == 0) {
    return;
  }
  local_48 = *(undefined4 *)(lVar3 + 0x84);
  local_50 = *(undefined4 *)(lVar3 + 0x88);
  local_58 = *(undefined4 *)(lVar3 + 0x8c);
  local_60 = *(undefined4 *)(lVar3 + 0x90);
  local_68 = *(undefined4 *)(lVar3 + 0x94);
  local_70 = *(undefined4 *)(lVar3 + 0x98);
  local_78 = *(undefined4 *)(lVar3 + 0x9c);
  local_7c = *(undefined4 *)(lVar3 + 0xa0);
  local_80 = *(undefined4 *)(lVar3 + 0xa4);
  local_64 = *(undefined4 *)(lVar3 + 0xa8);
  local_54 = *(undefined4 *)(lVar3 + 0xac);
  local_6c = *(undefined4 *)(lVar3 + 0xb0);
  local_4c = *(undefined4 *)(lVar3 + 0xb4);
  local_74 = *(undefined4 *)(lVar3 + 0xb8);
  local_5c = *(undefined4 *)(lVar3 + 0xbc);
  local_44 = *(undefined4 *)(lVar3 + 0xc0);
  local_res8[0] = *(undefined4 *)(lVar3 + 0x78);
  FUN_140215140(plVar2);
  if (param_3 != '\x01') {
    if ((param_3 == '\x02') || (param_3 == '\x03')) {
      if (*(int *)(param_1 + 0xc) != 0) {
        plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
        (**(code **)(*plVar4 + 0x7e0))
                  (plVar4,*(int *)(param_1 + 0xc),&DAT_1405d85a0,param_1 + 8,local_res10,local_res20
                   ,local_88);
      }
    }
    else if (param_3 != '\x04') goto LAB_1401b7796;
  }
  puVar36 = local_res8;
  puVar34 = &local_44;
  plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
  puVar32 = &local_5c;
  puVar30 = &local_74;
  puVar28 = &local_4c;
  puVar26 = &local_6c;
  puVar24 = &local_54;
  puVar22 = &local_64;
  puVar20 = local_88;
  puVar18 = local_res20;
  puVar16 = &local_80;
  puVar14 = &local_7c;
  puVar12 = &local_78;
  puVar10 = &local_70;
  puVar8 = &local_60;
  puVar6 = &local_50;
  (**(code **)(*plVar4 + 0x780))
            (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10,&local_48,puVar6,
             &local_58,puVar8,&local_68,puVar10,puVar12,puVar14,puVar16,puVar18,puVar20,puVar22,
             puVar24,puVar26,puVar28,puVar30,puVar32,puVar34,puVar36);
  uVar7 = (undefined4)((ulonglong)puVar6 >> 0x20);
  uVar9 = (undefined4)((ulonglong)puVar8 >> 0x20);
  uVar11 = (undefined4)((ulonglong)puVar10 >> 0x20);
  uVar13 = (undefined4)((ulonglong)puVar12 >> 0x20);
  uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
  uVar17 = (undefined4)((ulonglong)puVar16 >> 0x20);
  uVar19 = (undefined4)((ulonglong)puVar18 >> 0x20);
  uVar21 = (undefined4)((ulonglong)puVar20 >> 0x20);
  uVar23 = (undefined4)((ulonglong)puVar22 >> 0x20);
  uVar25 = (undefined4)((ulonglong)puVar24 >> 0x20);
  uVar27 = (undefined4)((ulonglong)puVar26 >> 0x20);
  uVar29 = (undefined4)((ulonglong)puVar28 >> 0x20);
  uVar31 = (undefined4)((ulonglong)puVar30 >> 0x20);
  uVar33 = (undefined4)((ulonglong)puVar32 >> 0x20);
  uVar35 = (undefined4)((ulonglong)puVar34 >> 0x20);
  uVar37 = (undefined4)((ulonglong)puVar36 >> 0x20);
LAB_1401b7796:
  local_40 = *(undefined4 *)(param_1 + 0x170);
  local_3c = *(undefined4 *)(param_1 + 0x174);
  local_38 = *(undefined4 *)(param_1 + 0x178);
  local_34 = *(undefined4 *)(param_1 + 0x17c);
  FUN_1401feb20(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                *(undefined4 *)(param_1 + 0x284),plVar2 + 0x1f6,&local_40,
                CONCAT44(uVar7,*(undefined4 *)(lVar3 + 0x4c)),*(undefined8 *)(lVar3 + 0x50),
                CONCAT44(uVar9,(int)*(short *)(lVar3 + 0x68)),*(undefined8 *)(lVar3 + 0x70),
                CONCAT44(uVar11,*(undefined4 *)(lVar3 + 0x78)),CONCAT44(uVar13,(int)plVar2[0x24]),
                CONCAT44(uVar15,*(undefined4 *)(lVar3 + 0x84)),
                CONCAT44(uVar17,*(undefined4 *)(lVar3 + 0x88)),
                CONCAT44(uVar19,*(undefined4 *)(lVar3 + 0x8c)),
                CONCAT44(uVar21,*(undefined4 *)(lVar3 + 0x90)),
                CONCAT44(uVar23,*(undefined4 *)(lVar3 + 0x94)),
                CONCAT44(uVar25,*(undefined4 *)(lVar3 + 0x98)),
                CONCAT44(uVar27,*(undefined4 *)(lVar3 + 0x9c)),
                CONCAT44(uVar29,*(undefined4 *)(lVar3 + 0xa0)),
                CONCAT44(uVar31,*(undefined4 *)(lVar3 + 0xa4)),
                CONCAT44(uVar33,*(undefined4 *)(lVar3 + 0xa8)),
                CONCAT44(uVar35,*(undefined4 *)(lVar3 + 0xac)),
                CONCAT44(uVar37,*(undefined4 *)(lVar3 + 0xb0)),*(undefined4 *)(lVar3 + 0xb4),
                *(undefined4 *)(lVar3 + 0xb8),*(undefined4 *)(lVar3 + 0xbc),
                *(undefined4 *)(lVar3 + 0xc0));
  return;
}



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

{
  longlong *plVar1;
  void *pvVar2;
  char cVar3;
  undefined2 uVar4;
  int iVar5;
  int iVar6;
  undefined4 uVar7;
  undefined8 uVar8;
  longlong lVar9;
  size_t sVar10;
  longlong *plVar11;
  wchar_t *pwVar12;
  undefined2 *puVar13;
  longlong lVar14;
  undefined2 *puVar15;
  ulonglong uVar16;
  undefined2 uVar17;
  bool bVar18;
  undefined2 local_res8 [4];
  undefined4 local_res10;
  undefined2 local_res18 [4];
  undefined4 *local_res20;
  undefined8 in_stack_fffffffffffffc58;
  uint uVar20;
  undefined4 *puVar19;
  undefined8 in_stack_fffffffffffffc60;
  uint uVar23;
  undefined4 *puVar21;
  undefined4 *puVar22;
  undefined8 in_stack_fffffffffffffc68;
  uint uVar25;
  undefined4 *puVar24;
  undefined4 uVar26;
  undefined8 in_stack_fffffffffffffc70;
  uint uVar27;
  undefined4 uVar28;
  undefined8 in_stack_fffffffffffffc78;
  uint uVar30;
  ulonglong uVar29;
  undefined4 uVar31;
  undefined8 in_stack_fffffffffffffc80;
  uint uVar32;
  undefined2 local_368 [2];
  int local_364;
  undefined2 local_360 [2];
  int local_35c;
  undefined2 local_358 [4];
  longlong local_350;
  char local_348;
  longlong *local_340;
  longlong *local_338;
  undefined4 local_330 [2];
  undefined4 local_328;
  undefined4 local_324;
  undefined4 local_320;
  undefined4 local_31c;
  undefined4 local_318;
  undefined4 local_314;
  undefined4 local_310;
  undefined4 local_30c;
  undefined4 local_308;
  undefined4 local_304;
  undefined4 local_300;
  undefined4 local_2fc;
  undefined4 local_2f8;
  undefined4 uStack_2f4;
  undefined4 uStack_2f0;
  undefined4 uStack_2ec;
  short local_2e8;
  void *local_2e0;
  undefined8 local_2d8;
  undefined8 local_2d0;
  undefined8 local_2c0;
  undefined4 local_2b8;
  undefined4 uStack_2b4;
  undefined4 uStack_2b0;
  undefined4 uStack_2ac;
  uint local_2a0;
  short local_29c;
  undefined4 local_238;
  undefined4 uStack_234;
  undefined4 uStack_230;
  undefined4 uStack_22c;
  undefined4 local_210;
  undefined1 local_208 [16];
  undefined1 local_1f8 [8];
  undefined4 local_1f0;
  undefined4 local_1ec;
  undefined4 local_1e8;
  undefined4 local_1e4;
  undefined4 local_1e0;
  undefined4 local_1dc;
  undefined4 local_1d8;
  undefined4 local_1d4;
  wchar_t local_1d0 [48];
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_164;
  char local_160 [104];
  undefined4 local_f8 [42];
  undefined4 local_50;
  
  uVar20 = (uint)((ulonglong)in_stack_fffffffffffffc58 >> 0x20);
  uVar23 = (uint)((ulonglong)in_stack_fffffffffffffc60 >> 0x20);
  uVar25 = (uint)((ulonglong)in_stack_fffffffffffffc68 >> 0x20);
  uVar27 = (uint)((ulonglong)in_stack_fffffffffffffc70 >> 0x20);
  uVar30 = (uint)((ulonglong)in_stack_fffffffffffffc78 >> 0x20);
  uVar32 = (uint)((ulonglong)in_stack_fffffffffffffc80 >> 0x20);
  local_2c0 = 0xfffffffffffffffe;
  lVar9 = 0;
  local_350 = 0;
  cVar3 = '\0';
  local_348 = '\0';
  plVar1 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  local_res20 = param_4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar14 = *plVar1;
      lVar9 = 0;
      if (lVar14 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0xb30)) {
          iVar5 = DAT_1406080a8 + 1;
          bVar18 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar5;
          if (bVar18) {
            FUN_140176d60(1);
          }
          lVar14 = 0;
        }
        local_348 = 0;
        local_350 = lVar14;
        FUN_14034ed40(lVar14);
        cVar3 = '\x01';
        local_348 = '\x01';
        lVar9 = lVar14;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar18 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_3 == 0) goto LAB_1401b81c4;
  uVar8 = FUN_140137690();
  iVar5 = FUN_140136b30(uVar8,param_3);
  local_35c = iVar5;
  FUN_140197b70(param_1,&local_340);
  plVar1 = local_340;
  if (local_340 != (longlong *)0x0) {
    if (local_340 == local_338) {
      if (*local_340 != 0) {
        FUN_14000a170(&local_2b8);
        local_210 = 0;
        uVar16 = (ulonglong)uVar32 << 0x20;
        puVar22 = (undefined4 *)((ulonglong)uVar30 << 0x20);
        lVar14 = (ulonglong)uVar27 << 0x20;
        puVar24 = (undefined4 *)((ulonglong)uVar25 << 0x20);
        puVar21 = (undefined4 *)((ulonglong)uVar23 << 0x20);
        lVar9 = (ulonglong)uVar20 << 0x20;
        FUN_1401aac30(local_res10,&local_2b8,param_3,1,lVar9,puVar21,puVar24,lVar14,puVar22,uVar16);
        uVar7 = (undefined4)((ulonglong)lVar9 >> 0x20);
        uVar28 = (undefined4)((ulonglong)lVar14 >> 0x20);
        uVar26 = (undefined4)((ulonglong)puVar22 >> 0x20);
        local_238 = *local_res20;
        uStack_234 = local_res20[1];
        uStack_230 = local_res20[2];
        uStack_22c = local_res20[3];
        local_364 = -1;
        if (iVar5 < 0) {
LAB_1401b7e62:
          lVar9 = FUN_140174f50(param_1 + 0x6e0);
          if (lVar9 != 0) {
            if (local_29c < 1) {
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                pvVar2 = (void *)*local_340;
                if (pvVar2 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar2 + 0xf630);
                  operator_delete(pvVar2);
                }
                operator_delete(local_340);
              }
              if (local_348 == '\0') {
                return 0;
              }
              FUN_14034edd0(local_350);
              return 0;
            }
            local_2e0 = (void *)0x0;
            local_2d8 = 0;
            local_2d0 = 0;
            local_2f8 = local_2b8;
            uStack_2f4 = uStack_2b4;
            uStack_2f0 = uStack_2b0;
            uStack_2ec = uStack_2ac;
            local_2e8 = local_29c;
            FUN_140055000(&local_2e0,&local_2f8);
            lVar9 = FUN_140174f50(param_1 + 0x6e0);
            plVar11 = (longlong *)(lVar9 + 0xd0);
            if (7 < *(ulonglong *)(lVar9 + 0xe8)) {
              plVar11 = (longlong *)*plVar11;
            }
            local_318 = *(undefined4 *)(param_1 + 0x170);
            local_314 = *(undefined4 *)(param_1 + 0x174);
            local_310 = *(undefined4 *)(param_1 + 0x178);
            local_30c = *(undefined4 *)(param_1 + 0x17c);
            FUN_1401ff8e0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                          *(undefined4 *)(param_1 + 0x284),*(undefined4 *)(param_1 + 8),&local_318,
                          plVar11,L"Inventory Full.",CONCAT44(uVar28,10),CONCAT44(uVar26,0xe),
                          &DAT_14047ba4c,&local_2b8);
            FUN_14011f210(local_1f8);
            local_1f0 = *(undefined4 *)(param_1 + 0x160);
            local_1ec = *(undefined4 *)(param_1 + 0x164);
            local_1e8 = *(undefined4 *)(param_1 + 0x168);
            local_1e4 = *(undefined4 *)(param_1 + 0x16c);
            local_1e0 = *(undefined4 *)(param_1 + 0x170);
            local_1dc = *(undefined4 *)(param_1 + 0x174);
            local_1d8 = *(undefined4 *)(param_1 + 0x178);
            local_1d4 = *(undefined4 *)(param_1 + 0x17c);
            lVar9 = FUN_140174f50(param_1 + 0x6e0);
            pwVar12 = (wchar_t *)(lVar9 + 0xd0);
            if (7 < *(ulonglong *)(lVar9 + 0xe8)) {
              pwVar12 = *(wchar_t **)pwVar12;
            }
            sVar10 = wcsnlen(pwVar12,0x10);
            if (sVar10 < 0x10) {
              lVar9 = FUN_140174f50(param_1 + 0x6e0);
              pwVar12 = (wchar_t *)(lVar9 + 0xd0);
              if (7 < *(ulonglong *)(lVar9 + 0xe8)) {
                pwVar12 = *(wchar_t **)pwVar12;
              }
              wcscpy_s(local_1d0,0x10,pwVar12);
            }
            strcpy_s(local_160,0x32,(char *)(param_1 + 0x330));
            local_170 = 0xe;
            lVar9 = FUN_140174f00(&local_340);
            local_16c = *(undefined4 *)(lVar9 + 0x50a0);
            lVar9 = FUN_140174f00(&local_340);
            local_164 = *(undefined4 *)(lVar9 + 0x50a0);
            FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                          *(undefined4 *)(param_1 + 0x284),local_1f8);
            plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar11 + 0x940))(plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0);
            if (local_2e0 != (void *)0x0) {
              operator_delete(local_2e0);
            }
          }
          LOCK();
          plVar1 = plVar1 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar2 = (void *)*local_340;
            if (pvVar2 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar2 + 0xf630);
              operator_delete(pvVar2);
            }
            operator_delete(local_340);
          }
          if (local_348 == '\0') {
            return 0;
          }
          FUN_14034edd0(local_350);
          return 0;
        }
        iVar6 = FUN_1401eeb60(*plVar1,&local_35c,&local_2b8,&local_364);
        uVar26 = (undefined4)((ulonglong)puVar22 >> 0x20);
        if (iVar6 == 0) goto LAB_1401b7e62;
        uVar8 = FUN_140174f00(&local_340);
        uVar31 = (undefined4)((ulonglong)puVar22 >> 0x20);
        uVar26 = (undefined4)((ulonglong)puVar21 >> 0x20);
        uVar17 = (undefined2)iVar5;
        if (local_364 == -1) {
          uVar4 = FUN_1401e8350(uVar8,&local_35c,&local_2b8,local_208);
          local_308 = *(undefined4 *)(param_1 + 0x160);
          local_304 = *(undefined4 *)(param_1 + 0x164);
          local_300 = *(undefined4 *)(param_1 + 0x168);
          local_2fc = *(undefined4 *)(param_1 + 0x16c);
          local_328 = *(undefined4 *)(param_1 + 0x170);
          local_324 = *(undefined4 *)(param_1 + 0x174);
          local_320 = *(undefined4 *)(param_1 + 0x178);
          local_31c = *(undefined4 *)(param_1 + 0x17c);
          iVar6 = *(int *)(param_1 + 0x284);
          local_330[0] = *(undefined4 *)(param_1 + 8);
          if ((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
            if ((CONCAT44(uStack_2b4,local_2b8) == 0) && (CONCAT44(uStack_2ac,uStack_2b0) == 0)) {
              bVar18 = false;
            }
            else {
              bVar18 = true;
            }
            if (((bVar18) && (local_2a0 != 0)) &&
               (lVar9 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar9 != 0)) {
              local_res18[0] = (undefined2)iVar6;
              plVar11 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                        0x70);
              puVar22 = &local_2b8;
              uVar28 = 1;
              puVar24 = &local_308;
              puVar21 = &local_328;
              puVar19 = local_330;
              (**(code **)(*plVar11 + 0xb0))
                        (plVar11,1,&DAT_1405d85a0,local_res18,puVar19,puVar21,puVar24,&DAT_14047ba48
                         ,puVar22);
              uVar7 = (undefined4)((ulonglong)puVar19 >> 0x20);
            }
          }
          lVar9 = FUN_140174f50(param_1 + 0x6e0);
          uVar31 = (undefined4)((ulonglong)puVar22 >> 0x20);
          uVar26 = (undefined4)((ulonglong)puVar24 >> 0x20);
          if (lVar9 != 0) {
            lVar9 = FUN_140174f00(param_1 + 0x6c0);
            uVar31 = *(undefined4 *)(lVar9 + 0x50a0);
            lVar9 = FUN_140174f00(param_1 + 0x6c0);
            uVar29 = (ulonglong)puVar22 & 0xffffffff00000000;
            uVar8 = CONCAT44(uVar28,uVar31);
            puVar24 = (undefined4 *)CONCAT44(uVar26,*(undefined4 *)(lVar9 + 0x50a0));
            FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_2b8,0x191,
                          CONCAT44(uVar7,0x25),(ulonglong)puVar21 & 0xffffffff00000000,puVar24,uVar8
                          ,uVar29,uVar16 & 0xffffffff00000000);
            uVar28 = (undefined4)((ulonglong)uVar8 >> 0x20);
            uVar31 = (undefined4)(uVar29 >> 0x20);
          }
          puVar22 = &local_2b8;
          puVar13 = local_res8;
          puVar15 = local_358;
          local_res8[0] = uVar4;
          local_358[0] = uVar17;
LAB_1401b7d49:
          plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar11 + 0xe0))
                    (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,puVar15,puVar13,puVar22);
          uVar26 = (undefined4)((ulonglong)puVar22 >> 0x20);
        }
        else {
          iVar6 = FUN_1401e8130(uVar8,param_1,&local_35c,&local_364,&local_2b8);
          if (-1 < iVar6) {
            FUN_14000a170(local_f8);
            local_50 = 0;
            lVar9 = FUN_140174f00(&local_340);
            if ((iVar5 < 5) && (iVar6 < 0x18)) {
              lVar9 = ((longlong)iVar6 + (longlong)iVar5 * 0x18) * 0xac + lVar9;
              *(undefined2 *)(lVar9 + 0x14) = uVar17;
              *(short *)(lVar9 + 0x16) = (short)iVar6;
              FUN_140090020(local_f8);
              puVar22 = local_f8;
              puVar13 = local_360;
              puVar15 = local_368;
              local_368[0] = uVar17;
              local_360[0] = (short)iVar6;
              goto LAB_1401b7d49;
            }
          }
        }
        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c6,0x2f,param_1,&local_2b8,
                      CONCAT44(uVar26,1),(ulonglong)puVar24 & 0xffffffff00000000,
                      CONCAT44(uVar28,local_29c + -1),CONCAT44(uVar31,(int)local_29c));
        uVar8 = FUN_140137690();
        uVar7 = FUN_1401374e0(uVar8,local_2a0);
        uVar8 = FUN_1402e0270();
        uVar16 = (ulonglong)local_2a0;
        cVar3 = FUN_1402df630(uVar8,uVar16);
        if (cVar3 == '\0') {
          uVar8 = FUN_1402e0270();
          cVar3 = FUN_1402df680(uVar8,uVar7);
          if (cVar3 == '\0') goto LAB_1401b7e19;
          uVar16 = (ulonglong)local_2a0;
        }
        if (((iVar5 == 1) || (iVar5 == 2)) || ((iVar5 == 3 || ((iVar5 == 4 || (iVar5 == 5)))))) {
          FUN_1401a8bb0(param_1,uVar16 & 0xffffffff);
        }
LAB_1401b7e19:
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          pvVar2 = (void *)*local_340;
          if (pvVar2 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar2 + 0xf630);
            operator_delete(pvVar2);
          }
          operator_delete(local_340);
        }
        if (local_348 != '\0') {
          FUN_14034edd0(local_350);
        }
        return 1;
      }
    }
    else {
      iVar5 = DAT_140608048 + 1;
      bVar18 = DAT_140608048 == 0;
      DAT_140608048 = iVar5;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_338) {
      LOCK();
      plVar1 = plVar1 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      lVar9 = local_350;
      cVar3 = local_348;
      if ((int)*plVar1 == 0) {
        pvVar2 = (void *)*local_340;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0xf630);
          operator_delete(pvVar2);
        }
        operator_delete(local_340);
        lVar9 = local_350;
        cVar3 = local_348;
      }
    }
    else {
      iVar5 = DAT_140608050 + 1;
      bVar18 = DAT_140608050 == 0;
      DAT_140608050 = iVar5;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401b81c4:
  if (cVar3 != '\0') {
    FUN_14034edd0(lVar9);
  }
  return 0xff;
}



void FUN_1401b81f0(longlong param_1,undefined4 *param_2,undefined1 *param_3,undefined1 *param_4,
                  undefined2 *param_5,undefined1 *param_6)

{
  ulonglong *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  undefined8 *puVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  bool bVar9;
  bool bVar10;
  longlong local_30;
  undefined4 local_28;
  undefined1 uStack_24;
  undefined1 uStack_23;
  undefined2 uStack_22;
  undefined1 local_20;
  undefined7 uStack_1f;
  
  lVar6 = 0;
  bVar10 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  lVar8 = lVar6;
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      lVar7 = *plVar2;
      lVar8 = 0;
      if (lVar7 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar7 = lVar6,
           DAT_1406080a8 = iVar5, bVar10)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar7);
        bVar10 = true;
        lVar8 = lVar7;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  local_28 = *param_2;
  uStack_24 = *param_3;
  uStack_23 = *param_4;
  uStack_22 = *param_5;
  local_20 = *param_6;
  puVar1 = (ulonglong *)(param_1 + 0x608);
  plVar2 = *(longlong **)(param_1 + 0x610);
  local_30 = param_1;
  if ((&local_30 < plVar2) && ((longlong *)*puVar1 <= &local_30)) {
    lVar6 = (longlong)&local_30 - (longlong)*puVar1;
    lVar6 = lVar6 / 6 + (lVar6 >> 0x3f);
    lVar6 = (lVar6 >> 2) - (lVar6 >> 0x3f);
    if (plVar2 == *(longlong **)(param_1 + 0x618)) {
      FUN_1401ded20(puVar1);
    }
    uVar3 = *puVar1;
    puVar4 = *(undefined8 **)(param_1 + 0x610);
    if (puVar4 != (undefined8 *)0x0) {
      *puVar4 = *(undefined8 *)(uVar3 + lVar6 * 0x18);
      puVar4[1] = *(undefined8 *)(uVar3 + 8 + lVar6 * 0x18);
      puVar4[2] = *(undefined8 *)(uVar3 + 0x10 + lVar6 * 0x18);
    }
  }
  else {
    if (plVar2 == *(longlong **)(param_1 + 0x618)) {
      FUN_1401ded20(puVar1);
    }
    plVar2 = *(longlong **)(param_1 + 0x610);
    if (plVar2 != (longlong *)0x0) {
      *plVar2 = param_1;
      plVar2[1] = CONCAT26(uStack_22,CONCAT15(uStack_23,CONCAT14(uStack_24,local_28)));
      plVar2[2] = CONCAT71(uStack_1f,local_20);
    }
  }
  *(longlong *)(param_1 + 0x610) = *(longlong *)(param_1 + 0x610) + 0x18;
  if (bVar10) {
    FUN_14034edd0(lVar8);
  }
  return;
}



void FUN_1401b83c0(longlong param_1,undefined1 param_2)

{
  longlong *plVar1;
  undefined1 local_res8 [8];
  undefined1 local_res10 [24];
  undefined8 uVar2;
  _SYSTEMTIME local_20;
  
  uVar2 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  GetLocalTime(&local_20);
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  local_res8[0] = DAT_140609434;
  plVar1 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  (**(code **)(*plVar1 + 0xaa0))
            (plVar1,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_20,&local_20.wMonth,
             &local_20.wDay,local_res10,local_res8,uVar2);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401b8561)
// WARNING: Removing unreachable block (ram,0x0001401b854d)
// WARNING: Removing unreachable block (ram,0x0001401b8575)
// WARNING: Removing unreachable block (ram,0x0001401b853b)

undefined8 FUN_1401b8470(undefined8 param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  uint *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  int iVar8;
  longlong *plVar9;
  uint *puVar10;
  int iVar11;
  int iVar12;
  uint *puVar13;
  bool bVar14;
  float fVar15;
  longlong *local_50;
  longlong *local_48;
  
  FUN_140198570(param_1,&local_50,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_50;
  if (local_50 != (longlong *)0x0) {
    if (local_50 == local_48) {
      if (*local_50 != 0) {
        plVar9 = (longlong *)FUN_140142aa0();
        puVar13 = (uint *)0x0;
        iVar8 = 0;
        puVar10 = puVar13;
        if (*plVar9 != 0) {
          for (puVar5 = *(uint **)(*plVar9 +
                                  ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar9 + 2)) * 8);
              (puVar10 = puVar13, puVar5 != (uint *)0x0 &&
              ((puVar5[8] != param_2 || (puVar10 = puVar5, *puVar5 != param_2))));
              puVar5 = *(uint **)(puVar5 + 6)) {
          }
        }
        if (puVar10 == (uint *)0x0) goto LAB_1401b8837;
        fVar15 = (float)puVar10[3];
        fVar2 = (float)puVar10[4];
        fVar3 = (float)puVar10[5];
        lVar7 = *plVar1;
        iVar12 = (int)(((float)(*(int *)(lVar7 + 0x8b4) + *(int *)(lVar7 + 0x61c)) +
                       *(float *)(lVar7 + 0x5a4)) *
                       (*(float *)(lVar7 + 0x8f0) + *(float *)(lVar7 + 0x738) + 1.0 + 0.0001) +
                       (float)*(int *)(lVar7 + 0x86c) + (float)*(int *)(lVar7 + 0x890));
        iVar4 = *(int *)(lVar7 + 0x5ac);
        if ((0.0001 < fVar15) &&
           (iVar8 = 1,
           (int)(((float)(*(int *)(lVar7 + 0x8b0) + *(int *)(lVar7 + 0x618)) +
                 *(float *)(lVar7 + 0x59c)) *
                 (*(float *)(lVar7 + 0x8ec) + *(float *)(lVar7 + 0x734) + 1.0 + 0.0001) +
                 (float)*(int *)(lVar7 + 0x868) + (float)*(int *)(lVar7 + 0x88c)) ==
           (int)*(float *)(lVar7 + 0x598))) {
          iVar8 = 0;
        }
        iVar11 = iVar8;
        if ((0.0001 < fVar2) && (iVar11 = iVar8 + 1, iVar12 == (int)*(float *)(lVar7 + 0x5a0))) {
          iVar11 = iVar8;
        }
        if (0.0001 < fVar3) {
          iVar11 = iVar11 + 1;
        }
        if (iVar11 == 0) goto LAB_1401b8837;
        if (puVar10[2] == 0) {
          if (0.0 < fVar15) {
            FUN_1402f85f0(lVar7);
            FUN_1402f88a0();
            FUN_1402f8a20(*plVar1);
          }
          if (0.0 < fVar2) {
            FUN_1402f8630(*plVar1);
            FUN_1402f8960(*plVar1);
            FUN_1402f8b30(*plVar1);
          }
          if (fVar3 <= 0.0) goto LAB_1401b87c4;
          iVar8 = *(int *)(*plVar1 + 0x5a8);
          if (*(int *)(*plVar1 + 0x5a8) < 0) {
            iVar8 = 0;
          }
          puVar13 = (uint *)(ulonglong)(uint)((int)fVar3 + iVar8);
        }
        else {
          if (puVar10[2] == 1) {
            if (0.0 < fVar15) {
              FUN_1402f85f0(lVar7);
              FUN_1402f88a0();
              FUN_1402f8a20(*plVar1);
            }
            if (0.0 < fVar2) {
              fVar15 = (float)FUN_1402f8630(*plVar1);
              if (fVar15 < 0.0) {
                fVar15 = 0.0;
              }
              FUN_1402f8960(*plVar1,(float)iVar12 * fVar2 + fVar15);
              FUN_1402f8b30(*plVar1);
            }
            if (0.0 < fVar3) {
              iVar8 = *(int *)(*plVar1 + 0x5a8);
              if (*(int *)(*plVar1 + 0x5a8) < 0) {
                iVar8 = 0;
              }
              puVar13 = (uint *)(ulonglong)(uint)((int)((float)iVar4 * fVar3) + iVar8);
              goto LAB_1401b87c9;
            }
          }
LAB_1401b87c4:
          if (0.0001 >= fVar3) {
            FUN_1402489f0(*plVar1);
            goto LAB_1401b87de;
          }
        }
LAB_1401b87c9:
        FUN_140248dd0(*plVar1,puVar13);
LAB_1401b87de:
        LOCK();
        plVar1 = plVar1 + 1;
        lVar7 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar7 == 1) {
          puVar6 = (undefined8 *)*local_50;
          if (puVar6 != (undefined8 *)0x0) {
            (**(code **)*puVar6)(puVar6,1);
          }
          operator_delete(local_50);
        }
        return 1;
      }
    }
    else {
      iVar8 = DAT_14060804c + 1;
      bVar14 = DAT_14060804c == 0;
      DAT_14060804c = iVar8;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 0;
  }
  if (plVar1 != local_48) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 0;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_1401b8837:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar7 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar7 == 1) {
    puVar6 = (undefined8 *)*local_50;
    if (puVar6 != (undefined8 *)0x0) {
      (**(code **)*puVar6)(puVar6,1);
    }
    operator_delete(local_50);
  }
  return 0;
}



undefined8 FUN_1401b8890(longlong param_1,int *param_2,longlong *param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  errno_t eVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong *plVar7;
  undefined *puVar8;
  undefined8 local_res20;
  short local_b8;
  short local_b6;
  undefined2 local_b4;
  short local_b2;
  short local_b0;
  short local_ae;
  short local_ac;
  undefined2 local_aa;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined4 local_98 [2];
  undefined8 local_90;
  undefined4 local_88;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  tm local_60;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_140609442 == '\0') {
    local_res20 = (ulonglong)local_res20._4_4_ << 0x20;
    local_98[0] = 0;
    plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    (**(code **)(*plVar7 + 0xc80))
              (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&DAT_14047ba70,local_98,
               &local_res20);
    printf("Coupon System : Off\n");
    return 1;
  }
  iVar4 = *param_2;
  if (iVar4 == 1) {
    if (*(byte *)(param_1 + 0x5d2) < 2) {
      lVar5 = FUN_1404186a0();
      if ((*(int *)(lVar5 + 0x250) != 1000) &&
         (lVar5 = FUN_1404186a0(), *(int *)(lVar5 + 0x250) != 200)) {
        return 1;
      }
      printf("Not PC Room : %d\n");
      return 1;
    }
  }
  else if (((((iVar4 != 2) && (iVar4 != 3)) && (iVar4 != 4)) &&
           (((iVar4 != 5 && (iVar4 != 6)) && ((iVar4 != 7 && ((iVar4 != 8 && (iVar4 != 9)))))))) &&
          (iVar4 != 10)) {
    return 1;
  }
  local_res20 = _time64((__time64_t *)0x0);
  local_90 = 0;
  local_88 = 0;
  eVar3 = _localtime64_s(&local_60,&local_res20);
  if (eVar3 == 0) {
    local_b8 = (short)local_60.tm_year + 0x76c;
    local_b6 = (short)local_60.tm_mon + 1;
    local_b4 = (undefined2)local_60.tm_wday;
    local_b2 = (short)local_60.tm_mday;
    local_b0 = (short)local_60.tm_hour;
    local_ae = (short)local_60.tm_min;
    local_ac = (short)local_60.tm_sec;
    local_aa = 0;
    iVar4 = Ordinal_184(&local_b8,&local_90);
    local_a8 = 0;
    local_a0 = 0;
    if (((((iVar4 != 0) && (iVar4 = Ordinal_185(local_90,&local_a8), iVar4 != 0)) &&
         (local_b8 == (short)local_a8)) &&
        ((local_b6 == local_a8._2_2_ && (local_b2 == local_a8._6_2_)))) &&
       ((local_b0 == (short)local_a0 && (local_ae == local_a0._2_2_)))) {
      local_88 = 0;
      if (local_ac == local_a0._4_2_) goto LAB_1401b8a5e;
    }
  }
  local_88 = 1;
LAB_1401b8a5e:
  puVar8 = (undefined *)*param_3;
  if ((undefined *)*param_3 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  plVar7 = (longlong *)(param_1 + 0x28);
  if (7 < *(ulonglong *)(param_1 + 0x40)) {
    plVar7 = (longlong *)*plVar7;
  }
  local_80 = *(undefined4 *)(param_1 + 0x170);
  local_7c = *(undefined4 *)(param_1 + 0x174);
  local_78 = *(undefined4 *)(param_1 + 0x178);
  local_74 = *(undefined4 *)(param_1 + 0x17c);
  local_70 = *(undefined4 *)(param_1 + 0x160);
  local_6c = *(undefined4 *)(param_1 + 0x164);
  local_68 = *(undefined4 *)(param_1 + 0x168);
  local_64 = *(undefined4 *)(param_1 + 0x16c);
  uVar1 = *(undefined4 *)(param_1 + 0x284);
  uVar2 = *(undefined4 *)(param_1 + 0x288);
  uVar6 = FUN_1401a6410(param_1);
  FUN_140201c00(*(undefined8 *)(param_1 + 0xb50),uVar2,uVar1,*(undefined4 *)(param_1 + 8),&local_70,
                &local_80,param_1 + 0x330,plVar7,uVar6,*param_2,puVar8,local_90);
  return 1;
}



undefined8 FUN_1401b8ba0(longlong param_1,uint *param_2)

{
  undefined *puVar1;
  int *piVar2;
  uint uVar3;
  longlong lVar4;
  int iVar5;
  int iVar6;
  longlong *plVar7;
  undefined8 uVar8;
  uint *puVar9;
  undefined *puVar10;
  int iVar11;
  int iVar12;
  uint local_res18 [2];
  undefined *local_res20;
  
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_14060943b == '\0') {
    printf("PcRoomService System : Off\n");
    return 1;
  }
  uVar3 = *param_2;
  plVar7 = (longlong *)FUN_1402e8ff0();
  if (*plVar7 != 0) {
    for (puVar9 = *(uint **)(*plVar7 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(plVar7 + 2)) * 8);
        puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0x24)) {
      if ((puVar9[0x26] == uVar3) && (*puVar9 == uVar3)) {
        if (puVar9 != (uint *)0x0) {
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          local_res18[0] = puVar9[7];
          goto LAB_1401b8c56;
        }
        break;
      }
    }
  }
  local_res18[0] = 0;
LAB_1401b8c56:
  iVar12 = 0;
  lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4f0);
  if (lVar4 == 0) {
    return 1;
  }
  if (*(char *)(lVar4 + 0x1a) == '\0') {
    return 1;
  }
  uVar8 = FUN_1401a6410(param_1);
  FUN_14034fe70();
  local_res20 = PTR_DAT_1405d8010;
  iVar5 = FUN_14034fcf0(uVar8);
  iVar11 = iVar12;
  if ((local_res20 != (undefined *)0x0) && (iVar11 = 0, local_res20 != PTR_DAT_1405d8010)) {
    iVar11 = *(int *)(local_res20 + -8);
  }
  iVar6 = iVar5;
  if (((iVar5 <= iVar11) && (iVar6 = iVar12, local_res20 != (undefined *)0x0)) &&
     (iVar6 = 0, local_res20 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_res20 + -8);
  }
  iVar11 = 1;
  if (1 < iVar6) {
    iVar11 = iVar6;
  }
  iVar6 = iVar12;
  if ((local_res20 != (undefined *)0x0) && (iVar6 = 0, local_res20 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_res20 + -8);
  }
  if (iVar6 < iVar11) {
    FUN_140002d30(&local_res20);
  }
  FUN_140002e10(&local_res20);
  puVar10 = local_res20;
  if (local_res20 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,uVar8,iVar5);
  puVar10 = local_res20;
  if (local_res20 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  iVar5 = FUN_14034fcf0(puVar10);
  iVar11 = iVar12;
  if (0 < iVar5) {
    iVar11 = iVar5;
  }
  if ((local_res20 != (undefined *)0x0) && (iVar12 = 0, local_res20 != PTR_DAT_1405d8010)) {
    iVar12 = *(int *)(local_res20 + -8);
  }
  if ((iVar12 <= iVar11) && (iVar11 = 0, local_res20 != (undefined *)0x0)) {
    if (local_res20 == PTR_DAT_1405d8010) goto LAB_1401b8d9c;
    iVar11 = *(int *)(local_res20 + -8);
  }
  if (((local_res20 != PTR_DAT_1405d8010) && (local_res20 != (undefined *)0x0)) &&
     ((int *)(local_res20 + -8) != (int *)0x0)) {
    *(int *)(local_res20 + -8) = iVar11;
    *(undefined2 *)(local_res20 + (longlong)iVar11 * 2) = 0;
  }
LAB_1401b8d9c:
  (**(code **)(*(longlong *)(lVar4 + 0x70) + 0x230))
            ((longlong *)(lVar4 + 0x70),1,&DAT_1405d85a0,param_1 + 8,&local_res20,param_2,
             local_res18);
  puVar10 = local_res20;
  if (((local_res20 != (undefined *)0x0) && (local_res20 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res20 + -8, puVar1 != (undefined *)0x0)) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    piVar2 = (int *)(puVar10 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar8);
  }
  return 1;
}



undefined8 FUN_1401b8e50(longlong param_1,uint *param_2,short *param_3)

{
  char cVar1;
  longlong lVar2;
  uint *puVar3;
  uint uVar4;
  uint uVar5;
  float local_res10 [2];
  uint local_res20 [2];
  uint local_28 [2];
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  uVar4 = *param_2;
  lVar2 = FUN_140137690();
  if (*(longlong *)(lVar2 + 0x88) != 0) {
    for (puVar3 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                            ((ulonglong)uVar4 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0xa6)) {
      if ((puVar3[0xa8] == uVar4) && (*puVar3 == uVar4)) {
        if (puVar3 != (uint *)0x0) {
          if (puVar3 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar4 = puVar3[0x5d];
          goto LAB_1401b8ee4;
        }
        break;
      }
    }
  }
  uVar4 = 1;
LAB_1401b8ee4:
  local_res10[0] = 0.0;
  cVar1 = FUN_1401b4a60(param_1,local_res10,0x65);
  uVar5 = uVar4;
  if (cVar1 == '\x01') {
    local_28[0] = uVar4 - (int)((float)(int)uVar4 * local_res10[0]);
    local_res20[0] = 1;
    puVar3 = local_res20;
    if (0 < (int)local_28[0]) {
      puVar3 = local_28;
    }
    uVar5 = *puVar3;
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 != 1000) {
      if ((DAT_14060b7c4 & 1) == 0) {
        DAT_14060b7c4 = DAT_14060b7c4 | 1;
        FUN_140418590();
        atexit((_func_5014 *)&LAB_140448470);
      }
      if (DAT_14060a0e5 != '\x01') goto LAB_1401b9004;
    }
    if ((DAT_14060b7f4 & 1) == 0) {
      DAT_14060b7f4 = DAT_14060b7f4 | 1;
      FUN_14015b4b0();
      atexit((_func_5014 *)&LAB_140448930);
    }
    if ((DAT_1406094c0 - 1U < 5) && (2 < DAT_1406094c0)) {
      FUN_140005370(0xd,L"INFO >> GUILD SKILL | ITEM BUY %d = (%d - (%d * %.2f))",uVar5,uVar4,uVar4,
                    (double)local_res10[0]);
    }
  }
LAB_1401b9004:
  FUN_140170fc0(*(undefined8 *)(param_1 + 0xb50),param_1,*param_2,(int)*param_3,uVar5);
  return 1;
}



// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401b9040(longlong param_1,ushort *param_2,ushort *param_3,ulonglong *param_4,
             undefined4 *param_5,short *param_6)

{
  ushort uVar1;
  ushort uVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  void *pvVar6;
  char cVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  undefined8 uVar11;
  int *piVar12;
  longlong *plVar13;
  longlong lVar14;
  int *piVar15;
  ushort *puVar16;
  wchar_t *_Src;
  ulonglong *puVar17;
  longlong *plVar18;
  bool bVar19;
  int local_res8 [2];
  ushort *local_res10;
  ushort *local_res18;
  undefined8 in_stack_fffffffffffffc48;
  undefined4 uVar23;
  undefined4 *puVar20;
  undefined4 *puVar21;
  undefined4 *puVar22;
  ulonglong uVar24;
  undefined8 in_stack_fffffffffffffc58;
  undefined4 uVar25;
  undefined8 in_stack_fffffffffffffc60;
  undefined4 uVar27;
  undefined8 uVar26;
  undefined8 in_stack_fffffffffffffc68;
  undefined4 uVar29;
  undefined8 uVar28;
  undefined2 local_388 [2];
  float local_384;
  undefined2 local_380 [4];
  longlong *local_378;
  longlong *local_370;
  int local_368;
  int local_364 [3];
  undefined4 local_358 [2];
  int local_350 [2];
  undefined4 local_348 [2];
  int local_340 [3];
  int local_334;
  int local_330 [2];
  undefined4 local_328 [2];
  longlong *local_320;
  longlong *local_318;
  undefined4 local_310;
  undefined4 local_30c;
  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;
  undefined4 local_2e4;
  undefined4 local_2e0;
  undefined4 local_2dc;
  undefined4 local_2d8;
  undefined4 local_2d4;
  undefined4 local_2d0;
  undefined4 local_2cc;
  undefined4 local_2c8;
  undefined4 local_2c4;
  undefined4 local_2c0;
  undefined4 local_2bc;
  undefined4 local_2b8;
  undefined4 local_2b4;
  undefined4 local_2b0;
  undefined4 local_2ac;
  undefined4 local_2a8;
  undefined4 local_2a4;
  undefined8 local_2a0;
  ulonglong local_298;
  ulonglong local_290;
  short local_27c;
  int local_274;
  short local_224;
  int local_1f8;
  undefined4 local_1f0;
  undefined1 local_1e8 [8];
  undefined4 local_1e0;
  undefined4 local_1dc;
  undefined4 local_1d8;
  undefined4 local_1d4;
  undefined4 local_1d0;
  undefined4 local_1cc;
  undefined4 local_1c8;
  undefined4 local_1c4;
  wchar_t local_1c0 [48];
  undefined4 local_160;
  undefined4 local_15c;
  int local_158;
  undefined4 local_154;
  char local_150 [104];
  ulonglong local_e8 [21];
  undefined4 local_40;
  
  uVar27 = (undefined4)((ulonglong)in_stack_fffffffffffffc60 >> 0x20);
  uVar29 = (undefined4)((ulonglong)in_stack_fffffffffffffc68 >> 0x20);
  uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffffc58 >> 0x20);
  uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffc48 >> 0x20);
  local_2a0 = 0xfffffffffffffffe;
  local_res10 = param_2;
  local_res18 = param_3;
  if (*(char *)(param_1 + 0x5d8) == '\x03') {
    if ((DAT_14060b7f4 & 1) == 0) {
      DAT_14060b7f4 = DAT_14060b7f4 | 1;
      FUN_14015b4b0();
      atexit((_func_5014 *)&LAB_140448930);
    }
    if (DAT_140609457 == '\0') {
      return 1;
    }
  }
  FUN_140197b70(param_1,&local_378);
  plVar18 = local_378;
  if (local_378 != (longlong *)0x0) {
    if (local_378 == local_370) {
      if (*local_378 != 0) {
        FUN_14000a170(&local_298);
        local_1f0 = 0;
        FUN_14000a170(local_e8);
        local_40 = 0;
        uVar1 = *param_3;
        uVar2 = *param_2;
        if ((4 < uVar2) || (0x17 < uVar1)) goto LAB_1401b9a0e;
        lVar14 = ((longlong)(short)uVar1 + (longlong)(short)uVar2 * 0x18) * 0xac + *plVar18;
        *(ushort *)(lVar14 + 0x14) = uVar2;
        *(ushort *)(lVar14 + 0x16) = uVar1;
        FUN_140090020(&local_298);
        bVar19 = local_298 < *param_4;
        if ((local_298 == *param_4) && (bVar19 = local_290 < param_4[1], local_290 == param_4[1])) {
          iVar8 = 0;
        }
        else {
          iVar8 = (1 - (uint)bVar19) - (uint)(bVar19 != 0);
        }
        if (((iVar8 != 0) || (local_27c < *param_6)) || (local_224 != 0)) goto LAB_1401b9a0e;
        uVar11 = FUN_140137690();
        iVar9 = FUN_140136dd0(uVar11,*param_5);
        uVar11 = FUN_140137690();
        iVar10 = FUN_140136c70(uVar11,*param_5);
        uVar11 = FUN_140137690();
        local_res8[0] = FUN_140136cd0(uVar11,*param_5);
        local_384 = 0.0;
        cVar7 = FUN_1401b4a60(param_1,&local_384,0x66);
        iVar8 = iVar10;
        if (cVar7 == '\x01') {
          iVar8 = (int)((float)iVar10 * local_384) + iVar10;
          lVar14 = FUN_1404186a0();
          if ((*(int *)(lVar14 + 0x250) == 1000) ||
             (lVar14 = FUN_1404186a0(), *(char *)(lVar14 + 0x215) == '\x01')) {
            lVar14 = FUN_14015f0c0();
            iVar3 = *(int *)(lVar14 + 0x90);
            if ((0 < iVar3) && ((iVar3 < 6 && (2 < iVar3)))) {
              FUN_140005370(0xd,L"INFO >> GUILD SKILL | ITEM SELL %d = (%d + (%d * %.2f))",iVar8,
                            iVar10,CONCAT44(uVar23,iVar10),(double)local_384);
            }
          }
        }
        if ((iVar9 == 1) || (iVar9 == 2)) {
          if (local_1f8 == 0) {
            uVar11 = FUN_140137690();
            local_1f8 = FUN_140136bb0(uVar11,*param_5);
          }
          local_364[0] = (int)((float)iVar8 -
                              ((float)(local_1f8 - local_274) * (float)local_res8[0] * 0.25) /
                              (float)local_1f8);
          local_340[1] = 1;
          piVar12 = local_340 + 1;
          if (0 < local_364[0]) {
            piVar12 = local_364;
          }
          iVar8 = (int)*param_6 * *piVar12;
        }
        else {
          iVar8 = *param_6 * iVar8;
        }
        cVar7 = FUN_1401b18a0(param_1,iVar8);
        if (cVar7 != '\0') goto LAB_1401b9a0e;
        local_2d0 = *(undefined4 *)(param_1 + 0x170);
        local_2cc = *(undefined4 *)(param_1 + 0x174);
        local_2c8 = *(undefined4 *)(param_1 + 0x178);
        local_2c4 = *(undefined4 *)(param_1 + 0x17c);
        lVar14 = param_1;
        iVar9 = FUN_140174650(*(undefined8 *)(param_1 + 0xb50),&local_2d0,&local_298,*param_6,
                              param_1);
        uVar23 = (undefined4)((ulonglong)lVar14 >> 0x20);
        if (iVar9 == 0) goto LAB_1401b9a0e;
        uVar11 = FUN_140137690();
        iVar9 = FUN_140136a70(uVar11,*param_5);
        if (iVar9 < 2) {
          local_2b0 = *(undefined4 *)(param_1 + 0x160);
          local_2ac = *(undefined4 *)(param_1 + 0x164);
          local_2a8 = *(undefined4 *)(param_1 + 0x168);
          local_2a4 = *(undefined4 *)(param_1 + 0x16c);
          local_2c0 = *(undefined4 *)(param_1 + 0x170);
          local_2bc = *(undefined4 *)(param_1 + 0x174);
          local_2b8 = *(undefined4 *)(param_1 + 0x178);
          local_2b4 = *(undefined4 *)(param_1 + 0x17c);
          iVar9 = *(int *)(param_1 + 0x284);
          local_358[0] = 0xffffffff;
          local_348[0] = 0xfffffffb;
          if (((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar14 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar14 != 0)) {
            local_388[0] = (undefined2)iVar9;
            plVar13 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                      );
            puVar21 = local_358;
            puVar20 = local_348;
            puVar17 = &local_298;
            puVar22 = &local_2c0;
            (**(code **)(*plVar13 + 0x130))
                      (plVar13,1,&DAT_1405d85a0,local_388,puVar22,&local_2b0,puVar17,puVar20,puVar21
                      );
            uVar25 = (undefined4)((ulonglong)puVar17 >> 0x20);
            uVar27 = (undefined4)((ulonglong)puVar20 >> 0x20);
            uVar29 = (undefined4)((ulonglong)puVar21 >> 0x20);
            uVar23 = (undefined4)((ulonglong)puVar22 >> 0x20);
          }
          puVar16 = local_res18;
          local_368 = (int)(short)*local_res18;
          uVar1 = *local_res10;
          local_334 = (int)(short)uVar1;
          uVar11 = FUN_140174f00(&local_378);
          if (-1 < (short)uVar1) {
            piVar12 = &local_368;
            piVar15 = &local_334;
LAB_1401b9721:
            puVar17 = local_e8;
LAB_1401b9728:
            FUN_1401ed220(uVar11,piVar15,piVar12,puVar17,CONCAT44(uVar23,6));
          }
        }
        else if (local_27c == *param_6) {
          local_2e0 = *(undefined4 *)(param_1 + 0x160);
          local_2dc = *(undefined4 *)(param_1 + 0x164);
          local_2d8 = *(undefined4 *)(param_1 + 0x168);
          local_2d4 = *(undefined4 *)(param_1 + 0x16c);
          local_300 = *(undefined4 *)(param_1 + 0x170);
          local_2fc = *(undefined4 *)(param_1 + 0x174);
          local_2f8 = *(undefined4 *)(param_1 + 0x178);
          local_2f4 = *(undefined4 *)(param_1 + 0x17c);
          iVar9 = *(int *)(param_1 + 0x284);
          local_364[1] = 0xffffffff;
          local_328[0] = 0xfffffffb;
          if (((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar14 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar14 != 0)) {
            local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar9);
            plVar13 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                      );
            piVar12 = local_364 + 1;
            puVar21 = local_328;
            puVar17 = &local_298;
            puVar20 = &local_300;
            (**(code **)(*plVar13 + 0x130))
                      (plVar13,1,&DAT_1405d85a0,local_res8,puVar20,&local_2e0,puVar17,puVar21,
                       piVar12);
            uVar25 = (undefined4)((ulonglong)puVar17 >> 0x20);
            uVar27 = (undefined4)((ulonglong)puVar21 >> 0x20);
            uVar29 = (undefined4)((ulonglong)piVar12 >> 0x20);
            uVar23 = (undefined4)((ulonglong)puVar20 >> 0x20);
          }
          puVar16 = local_res18;
          local_350[0] = (int)(short)*local_res18;
          uVar1 = *local_res10;
          local_340[2] = (int)(short)uVar1;
          uVar11 = FUN_140174f00(&local_378);
          if (-1 < (short)uVar1) {
            piVar12 = local_350;
            piVar15 = local_340 + 2;
            goto LAB_1401b9721;
          }
        }
        else {
          local_27c = local_27c - *param_6;
          FUN_140090020(local_e8,&local_298);
          local_2f0 = *(undefined4 *)(param_1 + 0x160);
          local_2ec = *(undefined4 *)(param_1 + 0x164);
          local_2e8 = *(undefined4 *)(param_1 + 0x168);
          local_2e4 = *(undefined4 *)(param_1 + 0x16c);
          local_310 = *(undefined4 *)(param_1 + 0x170);
          local_30c = *(undefined4 *)(param_1 + 0x174);
          local_308 = *(undefined4 *)(param_1 + 0x178);
          local_304 = *(undefined4 *)(param_1 + 0x17c);
          iVar9 = *(int *)(param_1 + 0x284);
          if (((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar14 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar14 != 0)) {
            local_380[0] = (undefined2)iVar9;
            plVar13 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                      );
            puVar17 = &local_298;
            puVar21 = &local_310;
            (**(code **)(*plVar13 + 0x140))
                      (plVar13,1,&DAT_1405d85a0,local_380,puVar21,&local_2f0,puVar17);
            uVar25 = (undefined4)((ulonglong)puVar17 >> 0x20);
            uVar23 = (undefined4)((ulonglong)puVar21 >> 0x20);
          }
          puVar16 = local_res18;
          local_340[0] = (int)(short)*local_res18;
          uVar1 = *local_res10;
          local_330[0] = (int)(short)uVar1;
          uVar11 = FUN_140174f00(&local_378);
          if (-1 < (short)uVar1) {
            puVar17 = &local_298;
            piVar12 = local_340;
            piVar15 = local_330;
            goto LAB_1401b9728;
          }
        }
        plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        puVar17 = local_e8;
        (**(code **)(*plVar13 + 0xe0))
                  (plVar13,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10,puVar16,puVar17);
        uVar28 = CONCAT44(uVar29,(int)local_27c - (int)*param_6);
        uVar26 = CONCAT44(uVar27,(int)local_27c);
        uVar11 = CONCAT44(uVar25,iVar8);
        uVar24 = CONCAT44((int)((ulonglong)puVar17 >> 0x20),(int)*param_6);
        puVar17 = &local_298;
        FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x19c,1,param_1,puVar17,uVar24,uVar11,uVar26,
                      uVar28);
        uVar23 = (undefined4)((ulonglong)puVar17 >> 0x20);
        uVar25 = (undefined4)((ulonglong)uVar11 >> 0x20);
        uVar27 = (undefined4)((ulonglong)uVar26 >> 0x20);
        uVar29 = (undefined4)((ulonglong)uVar28 >> 0x20);
        FUN_140198570(param_1,&local_320);
        plVar13 = local_320;
        if (local_320 != (longlong *)0x0) {
          if (local_320 == local_318) {
            if (*local_320 != 0) {
              if (0 < iVar8) {
                FUN_14011f210(local_1e8);
                local_1e0 = *(undefined4 *)(param_1 + 0x160);
                local_1dc = *(undefined4 *)(param_1 + 0x164);
                local_1d8 = *(undefined4 *)(param_1 + 0x168);
                local_1d4 = *(undefined4 *)(param_1 + 0x16c);
                local_1d0 = *(undefined4 *)(param_1 + 0x170);
                local_1cc = *(undefined4 *)(param_1 + 0x174);
                local_1c8 = *(undefined4 *)(param_1 + 0x178);
                local_1c4 = *(undefined4 *)(param_1 + 0x17c);
                _Src = (wchar_t *)(*plVar13 + 0xd0);
                if (7 < *(ulonglong *)(*plVar13 + 0xe8)) {
                  _Src = *(wchar_t **)_Src;
                }
                wcscpy_s(local_1c0,0x10,_Src);
                strcpy_s(local_150,0x32,(char *)(param_1 + 0x330));
                local_160 = 4;
                lVar14 = FUN_140174f00(param_1 + 0x6c0);
                local_15c = *(undefined4 *)(lVar14 + 0x50a0);
                local_158 = iVar8;
                FUN_140197b90(param_1,iVar8);
                lVar14 = FUN_140174f00(param_1 + 0x6c0);
                local_154 = *(undefined4 *)(lVar14 + 0x50a0);
                FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                              *(undefined4 *)(param_1 + 0x284),local_1e8);
              }
              lVar14 = FUN_140174f00(param_1 + 0x6c0);
              uVar4 = *(undefined4 *)(lVar14 + 0x50a0);
              lVar14 = FUN_140174f00(param_1 + 0x6c0);
              FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_298,0x192,
                            CONCAT44(uVar23,0x32),uVar24 & 0xffffffff00000000,
                            CONCAT44(uVar25,*(int *)(lVar14 + 0x50a0) - iVar8),
                            CONCAT44(uVar27,uVar4),CONCAT44(uVar29,iVar8),0);
            }
          }
          else {
            iVar8 = DAT_14060804c + 1;
            bVar19 = DAT_14060804c == 0;
            DAT_14060804c = iVar8;
            if (bVar19) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar13 != (longlong *)0x0) {
          if (plVar13 == local_318) {
            LOCK();
            plVar13 = plVar13 + 1;
            lVar14 = *plVar13;
            *(int *)plVar13 = (int)*plVar13 + -1;
            UNLOCK();
            plVar18 = local_378;
            if ((int)lVar14 == 1) {
              puVar5 = (undefined8 *)*local_320;
              if (puVar5 != (undefined8 *)0x0) {
                (**(code **)*puVar5)(puVar5,1);
              }
              operator_delete(local_320);
              plVar18 = local_378;
            }
          }
          else {
            iVar8 = DAT_140608054 + 1;
            bVar19 = DAT_140608054 == 0;
            DAT_140608054 = iVar8;
            if (bVar19) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_1401b9a0e;
      }
    }
    else {
      iVar8 = DAT_140608048 + 1;
      bVar19 = DAT_140608048 == 0;
      DAT_140608048 = iVar8;
      if (bVar19) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar18 == (longlong *)0x0) {
    return 1;
  }
  if (plVar18 != local_370) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401b9a0e:
  LOCK();
  plVar18 = plVar18 + 1;
  *(int *)plVar18 = (int)*plVar18 + -1;
  UNLOCK();
  if ((int)*plVar18 == 0) {
    pvVar6 = (void *)*local_378;
    if (pvVar6 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar6 + 0xf630);
      operator_delete(pvVar6);
    }
    operator_delete(local_378);
  }
  return 1;
}



undefined8 FUN_1401b9a60(longlong param_1,undefined2 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  undefined8 uVar6;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  longlong *local_20;
  longlong *local_18;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        local_30 = *(undefined4 *)(param_1 + 0x170);
        local_2c = *(undefined4 *)(param_1 + 0x174);
        local_28 = *(undefined4 *)(param_1 + 0x178);
        local_24 = *(undefined4 *)(param_1 + 0x17c);
        FUN_140174950(*(undefined8 *)(param_1 + 0xb50),&local_30,*param_2,*param_3,*local_20,param_1
                      ,uVar6);
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_18) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        puVar2 = (undefined8 *)*local_20;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        operator_delete(local_20);
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar5 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  longlong lVar4;
  int iVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong local_50;
  undefined2 local_30;
  undefined8 local_2e;
  undefined8 local_26;
  undefined8 local_1e;
  undefined4 local_16;
  undefined2 local_12;
  
  uVar8 = 0xfffffffffffffffe;
  local_50 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        local_50 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, local_50 = 0,
           DAT_1406080a8 = iVar5, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar7 = true;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0xa10);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
    if (*plVar2 != 0) {
      local_30 = 0;
      local_2e = 0;
      local_26 = 0;
      local_1e = 0;
      local_16 = 0;
      local_12 = 0;
      FUN_14026f150(*plVar2,param_2,&local_30,param_4,uVar8);
      FUN_1401a9860(param_1,param_2);
      LOCK();
      plVar1 = plVar2 + 1;
      lVar4 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        pvVar3 = (void *)*plVar2;
        if (pvVar3 != (void *)0x0) {
          FUN_14026ec20(pvVar3);
          operator_delete(pvVar3);
        }
        operator_delete(plVar2);
      }
      goto LAB_1401b9ce5;
    }
  }
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar2 + 1;
    lVar4 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar4 == 1) {
      pvVar3 = (void *)*plVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_14026ec20(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar2);
    }
  }
LAB_1401b9ce5:
  if (bVar7) {
    FUN_14034edd0(local_50);
  }
  return 1;
}



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

{
  int iVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  undefined *puVar5;
  bool bVar6;
  undefined4 local_res8 [2];
  undefined4 local_38 [2];
  undefined8 local_30;
  longlong *local_28;
  longlong *local_20;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  local_30 = 0xfffffffffffffffe;
  lVar2 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),*param_3);
  if (lVar2 != 0) {
    FUN_140198570(lVar2,&local_28);
    plVar4 = local_28;
    if (local_28 != (longlong *)0x0) {
      if (local_28 == local_20) {
        if (*local_28 != 0) {
          puVar5 = (undefined *)*param_4;
          if ((undefined *)*param_4 == (undefined *)0x0) {
            puVar5 = PTR_DAT_1405d8010;
          }
          puVar3 = (undefined8 *)(*local_28 + 0xd0);
          if (7 < *(ulonglong *)(*local_28 + 0xe8)) {
            puVar3 = (undefined8 *)*puVar3;
          }
          local_18 = *(undefined4 *)(param_1 + 0x170);
          local_14 = *(undefined4 *)(param_1 + 0x174);
          local_10 = *(undefined4 *)(param_1 + 0x178);
          local_c = *(undefined4 *)(param_1 + 0x17c);
          FUN_1401fda70(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                        *(undefined4 *)(param_1 + 0x284),param_2,&local_18,puVar3,puVar5);
          LOCK();
          plVar4 = plVar4 + 1;
          lVar2 = *plVar4;
          *(int *)plVar4 = (int)*plVar4 + -1;
          UNLOCK();
          if ((int)lVar2 != 1) {
            return 1;
          }
          puVar3 = (undefined8 *)*local_28;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(local_28);
          return 1;
        }
      }
      else {
        iVar1 = DAT_14060804c + 1;
        bVar6 = DAT_14060804c == 0;
        DAT_14060804c = iVar1;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar4 != (longlong *)0x0) {
      if (plVar4 == local_20) {
        LOCK();
        plVar4 = plVar4 + 1;
        *(int *)plVar4 = (int)*plVar4 + -1;
        UNLOCK();
        if ((int)*plVar4 == 0) {
          puVar3 = (undefined8 *)*local_28;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(local_28);
        }
      }
      else {
        iVar1 = DAT_140608054 + 1;
        bVar6 = DAT_140608054 == 0;
        DAT_140608054 = iVar1;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
  }
  local_res8[0] = 0xe;
  local_38[0] = 0x1b59;
  plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  (**(code **)(*plVar4 + 0x70))
            (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_38,local_res8);
  return 1;
}



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

{
  longlong *plVar1;
  void *pvVar2;
  char cVar3;
  int iVar4;
  undefined *puVar5;
  longlong *plVar6;
  undefined *puVar7;
  longlong lVar8;
  bool bVar9;
  undefined4 local_res8 [2];
  undefined4 local_68 [2];
  undefined8 local_60;
  longlong *local_58;
  longlong *local_50;
  longlong local_48;
  char local_40;
  longlong *local_38;
  longlong *local_30;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  
  local_60 = 0xfffffffffffffffe;
  local_48 = 0;
  local_40 = '\0';
  plVar1 = *(longlong **)(param_1 + 0xb28);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar8 = *plVar1;
      if (lVar8 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar8 = 0, DAT_1406080a8 = iVar4,
           bVar9)) {
          FUN_140176d60(1);
        }
        local_40 = 0;
        local_48 = lVar8;
        FUN_14034ed40(lVar8);
        local_40 = '\x01';
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  local_58 = *(longlong **)(param_1 + 0xa10);
  if (local_58 != (longlong *)0x0) {
    LOCK();
    *(int *)(local_58 + 1) = (int)local_58[1] + 1;
    UNLOCK();
  }
  plVar1 = *(longlong **)(param_1 + 0xa20);
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
    UNLOCK();
  }
  local_50 = local_58;
  local_38 = plVar1;
  local_30 = plVar1;
  if ((((local_58 == (longlong *)0x0) || (*local_58 == 0)) || (plVar1 == (longlong *)0x0)) ||
     (*plVar1 == 0)) {
    if (plVar1 != (longlong *)0x0) {
      LOCK();
      plVar6 = plVar1 + 1;
      *(int *)plVar6 = (int)*plVar6 + -1;
      UNLOCK();
      if ((int)*plVar6 == 0) {
        pvVar2 = (void *)*plVar1;
        if (pvVar2 != (void *)0x0) {
          FUN_14026f2b0(pvVar2);
          operator_delete(pvVar2);
        }
        operator_delete(plVar1);
      }
    }
    plVar1 = local_58;
    if (local_58 != (longlong *)0x0) {
      LOCK();
      plVar6 = local_58 + 1;
      *(int *)plVar6 = (int)*plVar6 + -1;
      UNLOCK();
      if ((int)*plVar6 == 0) {
        pvVar2 = (void *)*local_58;
        if (pvVar2 != (void *)0x0) {
          FUN_14026ec20(pvVar2);
          operator_delete(pvVar2);
        }
        operator_delete(plVar1);
      }
    }
  }
  else {
    puVar7 = (undefined *)*param_3;
    if ((undefined *)*param_3 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1405d8010;
    }
    cVar3 = FUN_14026f210(*local_58,puVar7);
    if (cVar3 == '\0') {
      puVar7 = (undefined *)*param_3;
      if ((undefined *)*param_3 == (undefined *)0x0) {
        puVar7 = PTR_DAT_1405d8010;
      }
      cVar3 = FUN_14026f720(*plVar1,puVar7);
      if (cVar3 == '\0') {
        puVar7 = (undefined *)*param_4;
        if ((undefined *)*param_4 == (undefined *)0x0) {
          puVar7 = PTR_DAT_1405d8010;
        }
        puVar5 = (undefined *)*param_3;
        if ((undefined *)*param_3 == (undefined *)0x0) {
          puVar5 = PTR_DAT_1405d8010;
        }
        local_28 = *(undefined4 *)(param_1 + 0x170);
        local_24 = *(undefined4 *)(param_1 + 0x174);
        local_20 = *(undefined4 *)(param_1 + 0x178);
        local_1c = *(undefined4 *)(param_1 + 0x17c);
        FUN_1401fda70(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                      *(undefined4 *)(param_1 + 0x284),param_2,&local_28,puVar5,puVar7);
        plVar6 = local_38;
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          pvVar2 = (void *)*local_38;
          if (pvVar2 != (void *)0x0) {
            FUN_14026f2b0(pvVar2);
            operator_delete(pvVar2);
          }
          operator_delete(plVar6);
        }
        plVar6 = local_58;
        LOCK();
        plVar1 = local_58 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          pvVar2 = (void *)*local_58;
          if (pvVar2 != (void *)0x0) {
            FUN_14026ec20(pvVar2);
            operator_delete(pvVar2);
          }
          operator_delete(plVar6);
        }
        goto LAB_1401ba221;
      }
    }
    local_res8[0] = 0x25;
    local_68[0] = 0x1b5a;
    plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    (**(code **)(*plVar6 + 0x70))
              (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_68,local_res8);
    plVar6 = local_38;
    LOCK();
    plVar1 = plVar1 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      pvVar2 = (void *)*local_38;
      if (pvVar2 != (void *)0x0) {
        FUN_14026f2b0(pvVar2);
        operator_delete(pvVar2);
      }
      operator_delete(plVar6);
    }
    plVar6 = local_58;
    LOCK();
    plVar1 = local_58 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      pvVar2 = (void *)*local_58;
      if (pvVar2 != (void *)0x0) {
        FUN_14026ec20(pvVar2);
        operator_delete(pvVar2);
      }
      operator_delete(plVar6);
    }
  }
LAB_1401ba221:
  if (local_40 != '\0') {
    FUN_14034edd0(local_48);
  }
  return 1;
}



undefined8 FUN_1401ba250(longlong param_1,undefined4 param_2,undefined4 *param_3)

{
  int iVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  bool bVar5;
  undefined4 local_res8 [2];
  undefined4 local_res20 [2];
  undefined8 uVar6;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  longlong *local_20;
  longlong *local_18;
  
  uVar6 = 0xfffffffffffffffe;
  lVar2 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),*param_3);
  if (lVar2 != 0) {
    FUN_140198570(lVar2,&local_20);
    plVar4 = local_20;
    if (local_20 != (longlong *)0x0) {
      if (local_20 == local_18) {
        if (*local_20 != 0) {
          puVar3 = (undefined8 *)(*local_20 + 0xd0);
          if (7 < *(ulonglong *)(*local_20 + 0xe8)) {
            puVar3 = (undefined8 *)*puVar3;
          }
          local_30 = *(undefined4 *)(param_1 + 0x170);
          local_2c = *(undefined4 *)(param_1 + 0x174);
          local_28 = *(undefined4 *)(param_1 + 0x178);
          local_24 = *(undefined4 *)(param_1 + 0x17c);
          FUN_1401fe170(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                        *(undefined4 *)(param_1 + 0x284),param_2,&local_30,puVar3,uVar6);
        }
      }
      else {
        iVar1 = DAT_14060804c + 1;
        bVar5 = DAT_14060804c == 0;
        DAT_14060804c = iVar1;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar4 != (longlong *)0x0) {
      if (plVar4 == local_18) {
        LOCK();
        plVar4 = plVar4 + 1;
        *(int *)plVar4 = (int)*plVar4 + -1;
        UNLOCK();
        if ((int)*plVar4 == 0) {
          puVar3 = (undefined8 *)*local_20;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(local_20);
        }
      }
      else {
        iVar1 = DAT_140608054 + 1;
        bVar5 = DAT_140608054 == 0;
        DAT_140608054 = iVar1;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
    }
  }
  local_res8[0] = 0xe;
  local_res20[0] = 0x1b5b;
  plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  (**(code **)(*plVar4 + 0x70))
            (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,local_res8);
  return 1;
}



undefined8 FUN_1401ba3e0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  bool bVar3;
  undefined2 local_res8 [4];
  uint local_res10 [6];
  undefined4 local_18;
  undefined4 uStack_14;
  undefined4 local_10;
  undefined4 uStack_c;
  
  local_18 = *(undefined4 *)(param_1 + 0x170);
  iVar1 = *(int *)(param_1 + 0x284);
  uStack_14 = *(undefined4 *)(param_1 + 0x174);
  local_10 = *(undefined4 *)(param_1 + 0x178);
  uStack_c = *(undefined4 *)(param_1 + 0x17c);
  local_res10[0] = *(uint *)(param_1 + 8);
  if ((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
    if ((*(longlong *)(param_1 + 0x170) == 0) && (*(longlong *)(param_1 + 0x178) == 0)) {
      bVar3 = false;
    }
    else {
      bVar3 = true;
    }
    if ((bVar3) && (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
      local_res8[0] = (undefined2)iVar1;
      lVar2 = *(longlong *)(*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
      (**(code **)(*(longlong *)(lVar2 + 0x70) + 0x3e0))
                (lVar2 + 0x70,1,&DAT_1405d85a0,local_res8,local_res10,&local_18);
    }
  }
  return 1;
}



undefined8 FUN_1401ba4c0(longlong param_1,undefined4 param_2,longlong *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  char cVar4;
  int iVar5;
  undefined *puVar6;
  longlong *plVar7;
  longlong lVar8;
  bool bVar9;
  bool bVar10;
  undefined4 local_res8 [2];
  undefined4 local_res20 [2];
  longlong local_50;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  local_50 = 0;
  bVar10 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar8 = *plVar1;
      if (lVar8 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar8 = 0, DAT_1406080a8 = iVar5
           , bVar10)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar8);
        bVar10 = true;
        local_50 = lVar8;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0xa10);
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
    UNLOCK();
  }
  plVar2 = *(longlong **)(param_1 + 0xa20);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
  }
  if ((((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) || (plVar2 == (longlong *)0x0)) ||
     (*plVar2 == 0)) {
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      plVar7 = plVar2 + 1;
      *(int *)plVar7 = (int)*plVar7 + -1;
      UNLOCK();
      if ((int)*plVar7 == 0) {
        pvVar3 = (void *)*plVar2;
        if (pvVar3 != (void *)0x0) {
          FUN_14026f2b0(pvVar3);
          operator_delete(pvVar3);
        }
        operator_delete(plVar2);
      }
    }
    if (plVar1 != (longlong *)0x0) {
      LOCK();
      plVar2 = plVar1 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        pvVar3 = (void *)*plVar1;
        if (pvVar3 != (void *)0x0) {
          FUN_14026ec20(pvVar3);
          operator_delete(pvVar3);
        }
        operator_delete(plVar1);
      }
    }
  }
  else {
    puVar6 = (undefined *)*param_3;
    if ((undefined *)*param_3 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1405d8010;
    }
    cVar4 = FUN_14026f210(*plVar1,puVar6);
    if (cVar4 == '\0') {
      puVar6 = (undefined *)*param_3;
      if ((undefined *)*param_3 == (undefined *)0x0) {
        puVar6 = PTR_DAT_1405d8010;
      }
      cVar4 = FUN_14026f720(*plVar2,puVar6);
      if (cVar4 == '\0') {
        puVar6 = (undefined *)*param_3;
        if ((undefined *)*param_3 == (undefined *)0x0) {
          puVar6 = PTR_DAT_1405d8010;
        }
        local_30 = *(undefined4 *)(param_1 + 0x170);
        local_2c = *(undefined4 *)(param_1 + 0x174);
        local_28 = *(undefined4 *)(param_1 + 0x178);
        local_24 = *(undefined4 *)(param_1 + 0x17c);
        FUN_1401fe170(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                      *(undefined4 *)(param_1 + 0x284),param_2,&local_30,puVar6);
        LOCK();
        plVar7 = plVar2 + 1;
        *(int *)plVar7 = (int)*plVar7 + -1;
        UNLOCK();
        if ((int)*plVar7 == 0) {
          pvVar3 = (void *)*plVar2;
          if (pvVar3 != (void *)0x0) {
            FUN_14026f2b0(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(plVar2);
        }
        LOCK();
        plVar2 = plVar1 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          pvVar3 = (void *)*plVar1;
          if (pvVar3 != (void *)0x0) {
            FUN_14026ec20(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(plVar1);
        }
        goto LAB_1401ba7c5;
      }
    }
    local_res8[0] = 0x25;
    local_res20[0] = 0x1b5c;
    plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    (**(code **)(*plVar7 + 0x70))
              (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,local_res8);
    LOCK();
    plVar7 = plVar2 + 1;
    *(int *)plVar7 = (int)*plVar7 + -1;
    UNLOCK();
    if ((int)*plVar7 == 0) {
      pvVar3 = (void *)*plVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_14026f2b0(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar2);
    }
    LOCK();
    plVar2 = plVar1 + 1;
    *(int *)plVar2 = (int)*plVar2 + -1;
    UNLOCK();
    if ((int)*plVar2 == 0) {
      pvVar3 = (void *)*plVar1;
      if (pvVar3 != (void *)0x0) {
        FUN_14026ec20(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar1);
    }
  }
LAB_1401ba7c5:
  if (bVar10) {
    FUN_14034edd0(local_50);
  }
  return 1;
}



undefined8 FUN_1401ba7f0(longlong param_1,undefined4 param_2,longlong *param_3)

{
  bool bVar1;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  FUN_1401aa2e0(param_1,param_3);
  if ((*param_3 == 0) && (param_3[1] == 0)) {
    bVar1 = false;
  }
  else {
    bVar1 = true;
  }
  if (bVar1) {
    local_18 = *(undefined4 *)(param_1 + 0x170);
    local_14 = *(undefined4 *)(param_1 + 0x174);
    local_10 = *(undefined4 *)(param_1 + 0x178);
    local_c = *(undefined4 *)(param_1 + 0x17c);
    FUN_1401fde00(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                  *(undefined4 *)(param_1 + 0x284),param_2,&local_18,param_3);
  }
  return 1;
}



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

{
  bool bVar1;
  undefined *puVar2;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  puVar2 = (undefined *)*param_4;
  if ((undefined *)*param_4 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1405d8010;
  }
  FUN_1401a9fe0(param_1,param_3,puVar2);
  if ((*param_3 == 0) && (param_3[1] == 0)) {
    bVar1 = false;
  }
  else {
    bVar1 = true;
  }
  if (bVar1) {
    local_18 = *(undefined4 *)(param_1 + 0x170);
    local_14 = *(undefined4 *)(param_1 + 0x174);
    local_10 = *(undefined4 *)(param_1 + 0x178);
    puVar2 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1405d8010;
    }
    local_c = *(undefined4 *)(param_1 + 0x17c);
    FUN_1401fdee0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                  *(undefined4 *)(param_1 + 0x284),param_2,&local_18,param_3,puVar2);
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  bool bVar7;
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        if (*(longlong **)(param_1 + 0xb58) != (longlong *)0x0) {
          local_res18[0] = 0;
          local_res20[0] = 0;
          uVar6 = (**(code **)(**(longlong **)(param_1 + 0xb58) + 0x1a8))();
          if (((param_2[1] - *param_2 == 0xc) &&
              (cVar4 = FUN_1403145b0(local_res20,local_res18,param_2,uVar6), cVar4 != '\0')) &&
             (*(int *)(*plVar1 + 300) != 0x25)) {
            (**(code **)(*(longlong *)*plVar1 + 0x290))();
          }
        }
        goto LAB_1401baa6e;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401baa6e:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401baab0(undefined8 param_1,undefined4 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  int iVar5;
  bool bVar6;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_2,param_3,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      plVar2 = (longlong *)*local_20;
      if (plVar2 != (longlong *)0x0) {
        (**(code **)(*plVar2 + 0x140))(plVar2,*param_3,*param_2);
        *(undefined1 *)(*plVar1 + 0x2330) = 1;
        goto LAB_1401bab4b;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bab4b:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar3 = (undefined8 *)*local_20;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  undefined *puVar5;
  bool bVar6;
  undefined8 uVar7;
  longlong *local_20;
  longlong *local_18;
  
  uVar7 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0xb58) == 0) {
    return 1;
  }
  lVar4 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),*param_2);
  if (lVar4 == 0) {
    return 1;
  }
  FUN_140198570(lVar4,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        puVar5 = (undefined *)*param_3;
        if ((undefined *)*param_3 == (undefined *)0x0) {
          puVar5 = PTR_DAT_1405d8010;
        }
        FUN_14020ce70(*local_20,puVar5,*param_4,*param_5,*param_6,*param_7,uVar7);
        goto LAB_1401bac78;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bac78:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



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

{
  undefined8 *puVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  bool bVar5;
  undefined4 local_res8 [2];
  undefined4 local_28 [2];
  undefined8 local_20;
  longlong *local_18;
  longlong *local_10;
  
  local_20 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0xb58) == 0) {
    return 1;
  }
  if (*(int *)(*(longlong *)(param_1 + 0xb58) + 0x98) != 1) {
    local_res8[0] = 0x15a;
    local_28[0] = 0x9c45;
    plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    (**(code **)(*plVar4 + 0x70))
              (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_28,local_res8);
    return 1;
  }
  lVar3 = FUN_14016e240(*(longlong *)(param_1 + 0xb50),*param_2);
  if (lVar3 == 0) {
    return 1;
  }
  FUN_140198570(lVar3,&local_18);
  plVar4 = local_18;
  if (local_18 != (longlong *)0x0) {
    if (local_18 == local_10) {
      if (*local_18 != 0) {
        FUN_14020d020(*local_18,*param_3,*param_4);
        goto LAB_1401badc6;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar4 == (longlong *)0x0) {
    return 1;
  }
  if (plVar4 != local_10) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401badc6:
  LOCK();
  plVar4 = plVar4 + 1;
  lVar3 = *plVar4;
  *(int *)plVar4 = (int)*plVar4 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar1 = (undefined8 *)*local_18;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    operator_delete(local_18);
  }
  return 1;
}



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

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  longlong lVar7;
  longlong *plVar8;
  bool bVar9;
  float fVar10;
  float fVar11;
  int local_res8 [2];
  undefined4 local_48 [2];
  undefined8 local_40;
  longlong *local_38;
  longlong *local_30;
  
  local_40 = 0xfffffffffffffffe;
  plVar2 = *(longlong **)(param_1 + 0xb58);
  if (plVar2 == (longlong *)0x0) {
    return 1;
  }
  local_res8[0] = 0;
  local_48[0] = 0;
  lVar7 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),*param_3);
  if (lVar7 == 0) {
    return 1;
  }
  FUN_140198570(lVar7,&local_38);
  plVar1 = local_38;
  if (local_38 != (longlong *)0x0) {
    if (local_38 == local_30) {
      plVar8 = (longlong *)*local_38;
      if (plVar8 != (longlong *)0x0) {
        (**(code **)(*plVar8 + 0x138))(plVar8,*param_4,*param_5);
        uVar6 = (**(code **)(*plVar2 + 0x1a8))(plVar2);
        if (((param_2[1] - *param_2 == 0xc) &&
            (cVar4 = FUN_1403145b0(local_48,local_res8,param_2,uVar6), cVar4 != '\0')) &&
           (plVar8 = (longlong *)*plVar1, *(int *)((longlong)plVar8 + 300) != 0x25)) {
          fVar10 = (float)FUN_1402f85f0();
          iVar5 = local_res8[0];
          fVar11 = (float)local_res8[0];
          (**(code **)(*plVar8 + 0x290))();
          (**(code **)(*plVar2 + 0x248))(plVar2,*param_5,*param_3,iVar5,fVar10 - fVar11 < 1.0);
        }
        goto LAB_1401bafa7;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_30) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bafa7:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar7 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar7 == 1) {
    puVar3 = (undefined8 *)*local_38;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_38);
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  bool bVar6;
  undefined4 local_res10 [6];
  undefined8 uVar7;
  longlong *local_20;
  longlong *local_18;
  
  uVar7 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        if (*(longlong *)(param_1 + 0xb58) != 0) {
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar5 + 0x7c0))
                    (plVar5,*(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 8),&DAT_1405d85a0,
                     local_res10,param_3,param_4,param_5,param_6,uVar7);
        }
        goto LAB_1401bb0ca;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bb0ca:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401bb100(undefined8 param_1,undefined4 *param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_18;
  longlong *local_10;
  
  FUN_140198570(param_1,&local_18);
  plVar1 = local_18;
  if (local_18 != (longlong *)0x0) {
    if (local_18 == local_10) {
      lVar3 = *local_18;
      if (lVar3 != 0) {
        *(undefined4 *)(lVar3 + 0x178) = *param_2;
        *(undefined4 *)(lVar3 + 0x17c) = param_2[1];
        *(undefined4 *)(lVar3 + 0x180) = param_2[2];
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
    if (plVar1 == local_10) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        puVar2 = (undefined8 *)*local_18;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        operator_delete(local_18);
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar5 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return 1;
      }
    }
  }
  return 1;
}



undefined8 FUN_1401bb1d0(undefined8 param_1,undefined4 *param_2,char *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  float local_30;
  float local_2c;
  float local_28;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_2,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      lVar3 = *local_20;
      if (lVar3 != 0) {
        *(undefined4 *)(lVar3 + 0x178) = *param_2;
        *(undefined4 *)(lVar3 + 0x17c) = param_2[1];
        *(undefined4 *)(lVar3 + 0x180) = param_2[2];
        local_28 = (float)(int)param_3[2] / 125.0;
        local_2c = (float)(int)param_3[1] / 125.0;
        local_30 = (float)(int)*param_3 / 125.0;
        (**(code **)(*(longlong *)*local_20 + 0x100))((longlong *)*local_20,&local_30);
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_18) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        puVar2 = (undefined8 *)*local_20;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        operator_delete(local_20);
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar5 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401bb310(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  undefined1 uVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 *puVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  undefined8 uVar9;
  longlong *plVar10;
  undefined *puVar11;
  bool bVar12;
  uint local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_58 [2];
  undefined8 local_50;
  longlong *local_48;
  longlong *local_40;
  
  local_50 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_48);
  plVar1 = local_48;
  if (local_48 != (longlong *)0x0) {
    if (local_48 == local_40) {
      if (*local_48 != 0) {
        plVar10 = *(longlong **)(param_1 + 0x6c0);
        if (plVar10 != (longlong *)0x0) {
          if (plVar10 == *(longlong **)(param_1 + 0x6c8)) {
            if ((((*plVar10 != 0) && (*(longlong *)(param_1 + 0xb58) != 0)) &&
                (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb58) + 0x30), lVar8 != 0)) &&
               (*(longlong *)(lVar8 + 0x2d0) != 0)) {
              puVar11 = (undefined *)*param_2;
              if ((undefined *)*param_2 == (undefined *)0x0) {
                puVar11 = PTR_DAT_1405d8008;
              }
              lVar8 = FUN_1402bbf40(*(undefined8 *)(lVar8 + 0x2d0),puVar11);
              if (lVar8 != 0) {
                iVar6 = *(int *)(lVar8 + 0x358);
                if (((iVar6 == 0) && (*(int *)(lVar8 + 0x35c) == 0)) &&
                   (*(int *)(lVar8 + 0x368) == 0)) {
                  FUN_140226550(*plVar1,lVar8);
                }
                else if (((*(int *)(param_1 + 0xa90) == 0) && (*(int *)(param_1 + 0xa94) == 0)) &&
                        (*(int *)(param_1 + 0xa98) == 0)) {
                  iVar3 = *(int *)(lVar8 + 0x35c);
                  uVar4 = *(undefined4 *)(lVar8 + 0x368);
                  uVar2 = *(undefined1 *)(lVar8 + 0x36c);
                  local_res18[0] = *(uint *)(lVar8 + 0x360);
                  local_res20[0] = *(undefined4 *)(lVar8 + 0x364);
                  uVar9 = FUN_140137690();
                  local_58[0] = FUN_140136b30(uVar9,iVar6);
                  uVar9 = FUN_140174f00(param_1 + 0x6c0);
                  iVar7 = FUN_1401eceb0(uVar9,local_58,iVar6);
                  if (iVar7 < iVar3) {
                    local_res18[0] = local_res18[0] & 0xffffff00;
                    plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
                    (**(code **)(*plVar10 + 0x850))
                              (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18,
                               local_res20);
                  }
                  else {
                    *(int *)(param_1 + 0xa90) = iVar6;
                    *(int *)(param_1 + 0xa94) = iVar3;
                    *(undefined4 *)(param_1 + 0xa98) = uVar4;
                    *(undefined1 *)(param_1 + 0xa9c) = uVar2;
                    *(uint *)(param_1 + 0xaa0) = local_res18[0];
                    *(undefined4 *)(param_1 + 0xaa4) = local_res20[0];
                    *(undefined4 *)(param_1 + 0xaa8) = *(undefined4 *)(lVar8 + 0x68);
                    *(undefined4 *)(param_1 + 0xaac) = *(undefined4 *)(lVar8 + 0x6c);
                    *(undefined4 *)(param_1 + 0xab0) = *(undefined4 *)(lVar8 + 0x70);
                    FUN_140226550(*plVar1,lVar8);
                  }
                }
              }
            }
          }
          else {
            iVar6 = DAT_140608048 + 1;
            bVar12 = DAT_140608048 == 0;
            DAT_140608048 = iVar6;
            if (bVar12) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_1401bb5aa;
      }
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_40) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bb5aa:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar8 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar8 == 1) {
    puVar5 = (undefined8 *)*local_48;
    if (puVar5 != (undefined8 *)0x0) {
      (**(code **)*puVar5)(puVar5,1);
    }
    operator_delete(local_48);
  }
  return 1;
}



undefined8
FUN_1401bb5f0(undefined8 param_1,undefined2 *param_2,undefined2 *param_3,undefined8 param_4,
             char *param_5)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  float local_30;
  float local_2c;
  float local_28;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        local_28 = (float)(int)param_5[2] / 125.0;
        local_2c = (float)(int)param_5[1] / 125.0;
        local_30 = (float)(int)*param_5 / 125.0;
        FUN_14022f150(*local_20,*param_2,*param_3,local_28,&local_30,0,0);
        goto LAB_1401bb6f1;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bb6f1:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401bb730(undefined8 param_1,undefined2 *param_2,undefined8 param_3,char *param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  float local_30;
  float local_2c;
  float local_28;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        local_28 = (float)(int)param_4[2] / 125.0;
        local_2c = (float)(int)param_4[1] / 125.0;
        local_30 = (float)(int)*param_4 / 125.0;
        FUN_14022f150(*local_20,2,*param_2,param_3,&local_30,0,0);
        goto LAB_1401bb82d;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bb82d:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



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

{
  int *piVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong lVar5;
  int iVar6;
  undefined4 uVar7;
  longlong *plVar8;
  bool bVar9;
  float local_50;
  float local_4c;
  float local_48;
  longlong *local_40;
  longlong *local_38;
  longlong *local_30;
  longlong *local_28;
  
  FUN_140198570(param_1,&local_40);
  plVar8 = local_40;
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if (*local_40 != 0) {
        if (*(longlong *)(param_1 + 0xb58) != 0) {
          FUN_14018fa30(*(undefined8 *)(*(longlong *)(param_1 + 0xb58) + 0x48),&local_30,*param_4);
          if (local_30 == (longlong *)0x0) {
            (**(code **)(*(longlong *)*plVar8 + 0x118))((longlong *)*plVar8,0,0);
          }
          else {
            plVar2 = (longlong *)*plVar8;
            lVar5 = local_30[0x25];
            lVar3 = *plVar2;
            uVar7 = (**(code **)(*local_30 + 0xb0))();
            (**(code **)(lVar3 + 0x118))(plVar2,uVar7,(int)lVar5);
          }
          *(int *)(*plVar8 + 0x1858) = (int)*param_5;
          local_48 = (float)(int)param_7[2] / 125.0;
          local_4c = (float)(int)param_7[1] / 125.0;
          local_50 = (float)(int)*param_7 / 125.0;
          FUN_14022f150(*plVar8,*param_2,*param_3,param_6,&local_50,0,0);
          if (local_28 != (longlong *)0x0) {
            LOCK();
            plVar8 = local_28 + 1;
            lVar3 = *plVar8;
            *(int *)plVar8 = (int)*plVar8 + -1;
            UNLOCK();
            plVar8 = local_40;
            if ((int)lVar3 == 1) {
              (**(code **)(*local_28 + 8))(local_28);
              LOCK();
              piVar1 = (int *)((longlong)local_28 + 0xc);
              iVar6 = *piVar1;
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              plVar8 = local_40;
              if (iVar6 == 1) {
                (**(code **)(*local_28 + 0x10))(local_28);
                plVar8 = local_40;
              }
            }
          }
        }
        goto LAB_1401bba4b;
      }
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar8 == (longlong *)0x0) {
    return 1;
  }
  if (plVar8 != local_38) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bba4b:
  LOCK();
  plVar8 = plVar8 + 1;
  *(int *)plVar8 = (int)*plVar8 + -1;
  UNLOCK();
  if ((int)*plVar8 == 0) {
    puVar4 = (undefined8 *)*local_40;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_40);
  }
  return 1;
}



undefined8
FUN_1401bba90(undefined8 param_1,undefined2 *param_2,undefined2 *param_3,undefined8 param_4,
             char *param_5,undefined8 param_6)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  undefined8 uVar6;
  float local_30;
  float local_2c;
  float local_28;
  longlong *local_20;
  longlong *local_18;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        local_28 = (float)(int)param_5[2] / 125.0;
        local_2c = (float)(int)param_5[1] / 125.0;
        local_30 = (float)(int)*param_5 / 125.0;
        FUN_14022f330(*local_20,*param_2,*param_3,local_28,&local_30,param_6,uVar6);
        goto LAB_1401bbb89;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bbb89:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8
FUN_1401bbbc0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_2,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        FUN_140230050(*local_20,param_2);
        goto LAB_1401bbc47;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bbc47:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401bbc80(undefined8 param_1,undefined4 *param_2,undefined2 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_2,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar3 = *(longlong *)(*local_20 + 0x11b0);
        if (lVar3 != 0) {
          FUN_14030d840(lVar3,*param_2,*param_3);
        }
        goto LAB_1401bbd27;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bbd27:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



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

{
  int *piVar1;
  longlong *plVar2;
  char cVar3;
  undefined8 *puVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *plVar8;
  bool bVar9;
  undefined8 uVar10;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  longlong *local_48;
  longlong *local_40;
  longlong local_38;
  longlong *local_30;
  longlong *local_28;
  longlong *local_20;
  
  uVar10 = 0xfffffffffffffffe;
  lVar7 = *(longlong *)(param_1 + 0xb58);
  if (lVar7 == 0) {
    return 1;
  }
  if (*(int *)(lVar7 + 0x98) != 1) {
    return 1;
  }
  lVar7 = *(longlong *)(lVar7 + 0x48);
  if (lVar7 == 0) {
    return 1;
  }
  FUN_140198570(param_1,&local_48);
  plVar8 = local_48;
  if (local_48 != (longlong *)0x0) {
    if (local_48 == local_40) {
      if (*local_48 != 0) {
        lVar6 = *(longlong *)(*local_48 + 0x11b0);
        if ((lVar6 == 0) || (lVar6 = FUN_14030d840(lVar6,*param_2,*param_3), lVar6 == 0))
        goto LAB_1401bc09b;
        cVar3 = *param_5;
        if (cVar3 == '\x04') {
          FUN_14018fa30(lVar7,&local_38,*param_4);
          if (local_38 == 0) {
            if (local_30 != (longlong *)0x0) {
              LOCK();
              plVar8 = local_30 + 1;
              lVar7 = *plVar8;
              *(int *)plVar8 = (int)*plVar8 + -1;
              UNLOCK();
              plVar8 = local_48;
              if ((int)lVar7 == 1) {
                (**(code **)(*local_30 + 8))(local_30);
                LOCK();
                piVar1 = (int *)((longlong)local_30 + 0xc);
                iVar5 = *piVar1;
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                plVar8 = local_48;
                if (iVar5 == 1) {
                  (**(code **)(*local_30 + 0x10))(local_30);
                  plVar8 = local_48;
                }
              }
            }
          }
          else {
            local_88 = *param_7;
            local_84 = param_7[1];
            local_80 = param_7[2];
            local_78 = *param_6;
            local_74 = param_6[1];
            local_70 = param_6[2];
            FUN_140234510(*plVar8,lVar6,local_38,*(undefined8 *)(*plVar8 + 0x20e0),&local_78,
                          &local_88,uVar10);
            if (local_30 != (longlong *)0x0) {
              LOCK();
              plVar8 = local_30 + 1;
              lVar7 = *plVar8;
              *(int *)plVar8 = (int)*plVar8 + -1;
              UNLOCK();
              plVar8 = local_48;
              if ((int)lVar7 == 1) {
                (**(code **)(*local_30 + 8))(local_30);
                LOCK();
                piVar1 = (int *)((longlong)local_30 + 0xc);
                iVar5 = *piVar1;
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                plVar8 = local_48;
                if (iVar5 == 1) {
                  (**(code **)(*local_30 + 0x10))(local_30);
                  plVar8 = local_48;
                }
              }
            }
          }
          goto LAB_1401bc09b;
        }
        if (((cVar3 != '\x02') && (cVar3 != '\x01')) ||
           (lVar7 = FUN_14018fbc0(lVar7,*param_4), lVar7 == 0)) goto LAB_1401bc09b;
        FUN_140198570(lVar7,&local_28);
        plVar2 = local_28;
        if (local_28 == (longlong *)0x0) {
LAB_1401bbf9f:
          local_68 = *param_7;
          local_64 = param_7[1];
          local_60 = param_7[2];
          local_58 = *param_6;
          local_54 = param_6[1];
          local_50 = param_6[2];
          uVar10 = *(undefined8 *)(*plVar8 + 0x20e0);
          if (plVar2 == (longlong *)0x0) {
LAB_1401bbff9:
            lVar7 = 0;
          }
          else {
            if (plVar2 != local_20) {
              iVar5 = DAT_14060804c + 1;
              bVar9 = DAT_14060804c == 0;
              DAT_14060804c = iVar5;
              if (bVar9) {
                FUN_140176d60(1);
              }
              goto LAB_1401bbff9;
            }
            lVar7 = *plVar2;
          }
          FUN_140234510(*plVar8,lVar6,lVar7,uVar10,&local_58,&local_68);
        }
        else {
          if (local_28 != local_20) {
            iVar5 = DAT_14060804c + 1;
            bVar9 = DAT_14060804c == 0;
            DAT_14060804c = iVar5;
            if (bVar9) {
              FUN_140176d60(1);
            }
            goto LAB_1401bbf9f;
          }
          if (*local_28 == 0) goto LAB_1401bbf9f;
        }
        if (plVar2 != (longlong *)0x0) {
          if (plVar2 == local_20) {
            LOCK();
            plVar2 = plVar2 + 1;
            lVar7 = *plVar2;
            *(int *)plVar2 = (int)*plVar2 + -1;
            UNLOCK();
            plVar8 = local_48;
            if ((int)lVar7 == 1) {
              puVar4 = (undefined8 *)*local_28;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              operator_delete(local_28);
              plVar8 = local_48;
            }
          }
          else {
            iVar5 = DAT_140608054 + 1;
            bVar9 = DAT_140608054 == 0;
            DAT_140608054 = iVar5;
            if (bVar9) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_1401bc09b;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar8 == (longlong *)0x0) {
    return 1;
  }
  if (plVar8 != local_40) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bc09b:
  LOCK();
  plVar8 = plVar8 + 1;
  *(int *)plVar8 = (int)*plVar8 + -1;
  UNLOCK();
  if ((int)*plVar8 == 0) {
    puVar4 = (undefined8 *)*local_48;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_48);
  }
  return 1;
}



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

{
  longlong *plVar1;
  int *piVar2;
  char cVar3;
  undefined8 *puVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *plVar8;
  bool bVar9;
  longlong *local_1c8;
  longlong *local_1c0;
  longlong local_1b8;
  longlong *local_1b0;
  undefined4 local_1a8;
  undefined4 local_1a4;
  undefined4 local_1a0;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  longlong *local_88;
  longlong *local_80;
  longlong *local_78;
  longlong *local_70;
  longlong *local_68;
  longlong *local_60;
  longlong local_58;
  longlong *local_50;
  longlong local_48;
  longlong *local_40;
  longlong local_38;
  longlong *local_30;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  lVar6 = *(longlong *)(param_1 + 0xb58);
  if (lVar6 == 0) {
    return 1;
  }
  if (*(int *)(lVar6 + 0x98) != 1) {
    return 1;
  }
  lVar6 = *(longlong *)(lVar6 + 0x48);
  if (lVar6 == 0) {
    return 1;
  }
  cVar3 = *param_4;
  if (cVar3 == '\x04') {
    FUN_14018fa30(lVar6,&local_1b8,*param_3);
    plVar8 = local_1b0;
    if (local_1b8 != 0) {
      cVar3 = *param_8;
      if (cVar3 == '\x04') {
        FUN_14018fa30(lVar6,&local_58,*param_7);
        if (local_58 == 0) {
          plVar8 = local_1b0;
          if (local_50 != (longlong *)0x0) {
            LOCK();
            plVar1 = local_50 + 1;
            lVar6 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar6 == 1) {
              (**(code **)(*local_50 + 8))(local_50);
              LOCK();
              piVar2 = (int *)((longlong)local_50 + 0xc);
              iVar5 = *piVar2;
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              plVar8 = local_1b0;
              if (iVar5 == 1) {
                (**(code **)(*local_50 + 0x10))(local_50);
                plVar8 = local_1b0;
              }
            }
          }
        }
        else {
          local_108 = *param_10;
          local_104 = param_10[1];
          local_100 = param_10[2];
          local_e8 = *param_9;
          local_e4 = param_9[1];
          local_e0 = param_9[2];
          FUN_1402343b0(local_1b8,*param_2,*param_5,*param_6,local_58,0,&local_e8,&local_108);
          plVar8 = local_1b0;
          if (local_50 != (longlong *)0x0) {
            LOCK();
            plVar1 = local_50 + 1;
            lVar6 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar6 == 1) {
              (**(code **)(*local_50 + 8))(local_50);
              LOCK();
              piVar2 = (int *)((longlong)local_50 + 0xc);
              iVar5 = *piVar2;
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              plVar8 = local_1b0;
              if (iVar5 == 1) {
                (**(code **)(*local_50 + 0x10))(local_50);
                plVar8 = local_1b0;
              }
            }
          }
        }
      }
      else if ((cVar3 == '\x02') || (cVar3 == '\x01')) {
        lVar6 = FUN_14018fbc0(lVar6,*param_7);
        plVar8 = local_1b0;
        if (lVar6 != 0) {
          FUN_140198570(lVar6,&local_88);
          plVar1 = local_88;
          if (local_88 != (longlong *)0x0) {
            if (local_88 == local_80) {
              if (*local_88 != 0) {
                local_98 = *param_10;
                local_94 = param_10[1];
                local_90 = param_10[2];
                local_158 = *param_9;
                local_154 = param_9[1];
                local_150 = param_9[2];
                FUN_1402343b0(local_1b8,*param_2,*param_5,*param_6,*local_88,0,&local_158,&local_98)
                ;
                LOCK();
                plVar1 = plVar1 + 1;
                lVar6 = *plVar1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                plVar8 = local_1b0;
                if ((int)lVar6 == 1) {
                  puVar4 = (undefined8 *)*local_88;
                  if (puVar4 != (undefined8 *)0x0) {
                    (**(code **)*puVar4)(puVar4,1);
                  }
                  operator_delete(local_88);
                  plVar8 = local_1b0;
                }
                goto joined_r0x0001401bc179;
              }
            }
            else {
              iVar5 = DAT_14060804c + 1;
              bVar9 = DAT_14060804c == 0;
              DAT_14060804c = iVar5;
              if (bVar9) {
                FUN_140176d60(1);
              }
            }
          }
          plVar8 = local_1b0;
          if (plVar1 != (longlong *)0x0) {
            if (plVar1 == local_80) {
              LOCK();
              plVar1 = plVar1 + 1;
              lVar6 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)lVar6 == 1) {
                puVar4 = (undefined8 *)*local_88;
                if (puVar4 != (undefined8 *)0x0) {
                  (**(code **)*puVar4)(puVar4,1);
                }
                operator_delete(local_88);
                plVar8 = local_1b0;
              }
            }
            else {
              iVar5 = DAT_140608054 + 1;
              bVar9 = DAT_140608054 == 0;
              DAT_140608054 = iVar5;
              if (bVar9) {
                FUN_140176d60(1);
                plVar8 = local_1b0;
              }
            }
          }
        }
      }
      else {
        local_d8 = *param_10;
        local_d4 = param_10[1];
        local_d0 = param_10[2];
        local_178 = *param_9;
        local_174 = param_9[1];
        local_170 = param_9[2];
        FUN_1402343b0(local_1b8,*param_2,0,0,0,0,&local_178,&local_d8);
        plVar8 = local_1b0;
      }
    }
joined_r0x0001401bc179:
    if (plVar8 == (longlong *)0x0) {
      return 1;
    }
    LOCK();
    plVar1 = plVar8 + 1;
    lVar6 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar6 != 1) {
      return 1;
    }
    (**(code **)(*plVar8 + 8))(plVar8);
    LOCK();
    piVar2 = (int *)((longlong)plVar8 + 0xc);
    *piVar2 = *piVar2 + -1;
    UNLOCK();
    if (*piVar2 != 0) {
      return 1;
    }
    (**(code **)(*plVar8 + 0x10))(plVar8);
    return 1;
  }
  if ((cVar3 != '\x02') && (cVar3 != '\x01')) {
    if ((cVar3 != ' ') && (cVar3 != '\x10')) {
      return 1;
    }
    lVar7 = FUN_14018fd10(lVar6,*param_3);
    if (lVar7 == 0) {
      return 1;
    }
    cVar3 = *param_8;
    if (cVar3 == '\x04') {
      FUN_14018fa30(lVar6,&local_48,*param_7);
      plVar8 = local_40;
      if (local_48 != 0) {
        local_a8 = *param_10;
        local_a4 = param_10[1];
        local_a0 = param_10[2];
        local_138 = *param_9;
        local_134 = param_9[1];
        local_130 = param_9[2];
        FUN_1402343b0(lVar7,*param_2,*param_5,*param_6,local_48,0,&local_138,&local_a8);
        plVar8 = local_40;
      }
      goto joined_r0x0001401bc179;
    }
    if ((cVar3 != '\x02') && (cVar3 != '\x01')) {
      local_c8 = *param_10;
      local_c4 = param_10[1];
      local_c0 = param_10[2];
      local_118 = *param_9;
      local_114 = param_9[1];
      local_110 = param_9[2];
      FUN_1402343b0(lVar7,*param_2,0,0,0,0,&local_118,&local_c8);
      return 1;
    }
    lVar6 = FUN_14018fbc0(lVar6,*param_7);
    if (lVar6 == 0) {
      return 1;
    }
    FUN_140198570(lVar6,&local_68);
    plVar8 = local_68;
    if (local_68 == (longlong *)0x0) {
LAB_1401bc736:
      if (plVar8 == (longlong *)0x0) {
        return 1;
      }
      if (plVar8 != local_60) goto LAB_1401bc744;
    }
    else {
      if (local_68 != local_60) {
        iVar5 = DAT_14060804c + 1;
        bVar9 = DAT_14060804c == 0;
        DAT_14060804c = iVar5;
        if (bVar9) {
          FUN_140176d60(1);
        }
        goto LAB_1401bc736;
      }
      if (*local_68 == 0) goto LAB_1401bc736;
      local_b8 = *param_10;
      local_b4 = param_10[1];
      local_b0 = param_10[2];
      local_f8 = *param_9;
      local_f4 = param_9[1];
      local_f0 = param_9[2];
      FUN_1402343b0(lVar7,*param_2,*param_5,*param_6,*local_68,0,&local_f8,&local_b8);
    }
    LOCK();
    plVar8 = plVar8 + 1;
    *(int *)plVar8 = (int)*plVar8 + -1;
    iVar5 = (int)*plVar8;
    UNLOCK();
    plVar8 = local_68;
    goto joined_r0x0001401bcb16;
  }
  lVar7 = FUN_14018fbc0(lVar6,*param_3);
  if (lVar7 == 0) {
    return 1;
  }
  FUN_140198570(lVar7,&local_1c8);
  plVar8 = local_1c8;
  if (local_1c8 == (longlong *)0x0) {
LAB_1401bcb04:
    if (plVar8 == (longlong *)0x0) {
      return 1;
    }
    if (plVar8 != local_1c0) {
LAB_1401bc744:
      if (DAT_140608054 != 0) {
        DAT_140608054 = DAT_140608054 + 1;
        return 1;
      }
      DAT_140608054 = DAT_140608054 + 1;
      FUN_140176d60(1);
      return 1;
    }
  }
  else {
    if (local_1c8 != local_1c0) {
      iVar5 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar9) {
        FUN_140176d60(1);
      }
      goto LAB_1401bcb04;
    }
    lVar7 = *local_1c8;
    if (lVar7 == 0) goto LAB_1401bcb04;
    cVar3 = *param_8;
    if (cVar3 == '\x04') {
      FUN_14018fa30(lVar6,&local_38,*param_7);
      if (local_38 == 0) {
        if (local_30 != (longlong *)0x0) {
          LOCK();
          plVar8 = local_30 + 1;
          lVar6 = *plVar8;
          *(int *)plVar8 = (int)*plVar8 + -1;
          UNLOCK();
          plVar8 = local_1c8;
          if ((int)lVar6 == 1) {
            (**(code **)(*local_30 + 8))(local_30);
            LOCK();
            piVar2 = (int *)((longlong)local_30 + 0xc);
            iVar5 = *piVar2;
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            plVar8 = local_1c8;
            if (iVar5 == 1) {
              (**(code **)(*local_30 + 0x10))(local_30);
              plVar8 = local_1c8;
            }
          }
        }
      }
      else {
        local_1a8 = *param_10;
        local_1a4 = param_10[1];
        local_1a0 = param_10[2];
        local_198 = *param_9;
        local_194 = param_9[1];
        local_190 = param_9[2];
        FUN_1402343b0(*plVar8,*param_2,*param_5,*param_6,local_38,*(undefined8 *)(*plVar8 + 0x20e0),
                      &local_198,&local_1a8);
        if (local_30 != (longlong *)0x0) {
          LOCK();
          plVar8 = local_30 + 1;
          lVar6 = *plVar8;
          *(int *)plVar8 = (int)*plVar8 + -1;
          UNLOCK();
          plVar8 = local_1c8;
          if ((int)lVar6 == 1) {
            (**(code **)(*local_30 + 8))(local_30);
            LOCK();
            piVar2 = (int *)((longlong)local_30 + 0xc);
            iVar5 = *piVar2;
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            plVar8 = local_1c8;
            if (iVar5 == 1) {
              (**(code **)(*local_30 + 0x10))(local_30);
              plVar8 = local_1c8;
            }
          }
        }
      }
    }
    else if ((cVar3 == '\x02') || (cVar3 == '\x01')) {
      lVar6 = FUN_14018fbc0(lVar6,*param_7);
      if (lVar6 != 0) {
        FUN_140198570(lVar6,&local_78);
        plVar1 = local_78;
        if (local_78 != (longlong *)0x0) {
          if (local_78 == local_70) {
            if (*local_78 != 0) {
              local_148 = *param_10;
              local_144 = param_10[1];
              local_140 = param_10[2];
              local_128 = *param_9;
              local_124 = param_9[1];
              local_120 = param_9[2];
              FUN_1402343b0(*plVar8,*param_2,*param_5,*param_6,*local_78,
                            *(undefined8 *)(*plVar8 + 0x20e0),&local_128,&local_148);
              LOCK();
              plVar1 = plVar1 + 1;
              lVar6 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              plVar8 = local_1c8;
              if ((int)lVar6 == 1) {
                puVar4 = (undefined8 *)*local_78;
                if (puVar4 != (undefined8 *)0x0) {
                  (**(code **)*puVar4)(puVar4,1);
                }
                operator_delete(local_78);
                plVar8 = local_1c8;
              }
              goto LAB_1401bcb12;
            }
          }
          else {
            iVar5 = DAT_14060804c + 1;
            bVar9 = DAT_14060804c == 0;
            DAT_14060804c = iVar5;
            if (bVar9) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == local_70) {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar6 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            plVar8 = local_1c8;
            if ((int)lVar6 == 1) {
              puVar4 = (undefined8 *)*local_78;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              operator_delete(local_78);
              plVar8 = local_1c8;
            }
          }
          else {
            iVar5 = DAT_140608054 + 1;
            bVar9 = DAT_140608054 == 0;
            DAT_140608054 = iVar5;
            if (bVar9) {
              FUN_140176d60(1);
            }
          }
        }
      }
    }
    else {
      local_188 = *param_10;
      local_184 = param_10[1];
      local_180 = param_10[2];
      local_168 = *param_9;
      local_164 = param_9[1];
      local_160 = param_9[2];
      FUN_1402343b0(lVar7,*param_2,0,0,0,*(undefined8 *)(lVar7 + 0x20e0),&local_168,&local_188);
    }
  }
LAB_1401bcb12:
  LOCK();
  plVar8 = plVar8 + 1;
  *(int *)plVar8 = (int)*plVar8 + -1;
  iVar5 = (int)*plVar8;
  UNLOCK();
  plVar8 = local_1c8;
joined_r0x0001401bcb16:
  if (iVar5 == 0) {
    puVar4 = (undefined8 *)*plVar8;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(plVar8);
  }
  return 1;
}



undefined8 FUN_1401bcb60(undefined8 param_1,undefined4 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_2,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar3 = *(longlong *)(*local_20 + 0x11b0);
        if (lVar3 != 0) {
          FUN_14030d840(lVar3,*param_2,*param_3);
        }
        goto LAB_1401bcc06;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bcc06:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



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

{
  int *piVar1;
  char cVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  longlong lVar7;
  int iVar8;
  undefined4 uVar9;
  longlong lVar10;
  longlong *plVar11;
  bool bVar12;
  longlong *local_50;
  longlong *local_48;
  longlong *local_40;
  longlong *local_38;
  longlong *local_30;
  longlong *local_28;
  
  FUN_140198570(param_1,&local_50,param_3,param_4,0xfffffffffffffffe);
  plVar11 = local_50;
  if (local_50 != (longlong *)0x0) {
    if (local_50 == local_48) {
      if (*local_50 != 0) {
        if (*(longlong *)(param_1 + 0xb58) != 0) {
          uVar3 = *(undefined8 *)(*(longlong *)(param_1 + 0xb58) + 0x48);
          cVar2 = *(char *)(param_2 + 0xd);
          if ('\0' < cVar2) {
            if (cVar2 < '\x03') {
              lVar10 = FUN_14018fbc0(uVar3,*(undefined4 *)(param_2 + 0x10));
              if (lVar10 == 0) goto LAB_1401bce78;
              FUN_140198570(lVar10,&local_40);
              plVar4 = local_40;
              if (local_40 != (longlong *)0x0) {
                if (local_40 == local_38) {
                  plVar5 = (longlong *)*local_40;
                  if (plVar5 != (longlong *)0x0) {
                    lVar7 = plVar5[0x25];
                    lVar10 = *plVar5;
                    uVar9 = (**(code **)(lVar10 + 0xb0))(plVar5);
                    (**(code **)(lVar10 + 0x118))(plVar5,uVar9,(int)lVar7);
                  }
                }
                else {
                  iVar8 = DAT_14060804c + 1;
                  bVar12 = DAT_14060804c == 0;
                  DAT_14060804c = iVar8;
                  if (bVar12) {
                    FUN_140176d60(1);
                  }
                }
              }
              if (plVar4 != (longlong *)0x0) {
                if (plVar4 == local_38) {
                  LOCK();
                  plVar4 = plVar4 + 1;
                  lVar10 = *plVar4;
                  *(int *)plVar4 = (int)*plVar4 + -1;
                  UNLOCK();
                  plVar11 = local_50;
                  if ((int)lVar10 == 1) {
                    puVar6 = (undefined8 *)*local_40;
                    if (puVar6 != (undefined8 *)0x0) {
                      (**(code **)*puVar6)(puVar6,1);
                    }
                    operator_delete(local_40);
                    plVar11 = local_50;
                  }
                }
                else {
                  iVar8 = DAT_140608054 + 1;
                  bVar12 = DAT_140608054 == 0;
                  DAT_140608054 = iVar8;
                  if (bVar12) {
                    FUN_140176d60(1);
                  }
                }
              }
            }
            else if (cVar2 == '\x04') {
              FUN_14018fa30(uVar3,&local_30,*(undefined4 *)(param_2 + 0x10));
              if (local_30 != (longlong *)0x0) {
                plVar4 = (longlong *)*plVar11;
                lVar7 = local_30[0x25];
                lVar10 = *plVar4;
                uVar9 = (**(code **)(*local_30 + 0xb0))();
                (**(code **)(lVar10 + 0x118))(plVar4,uVar9,(int)lVar7);
              }
              if (local_28 != (longlong *)0x0) {
                LOCK();
                plVar11 = local_28 + 1;
                lVar10 = *plVar11;
                *(int *)plVar11 = (int)*plVar11 + -1;
                UNLOCK();
                plVar11 = local_50;
                if ((int)lVar10 == 1) {
                  (**(code **)(*local_28 + 8))(local_28);
                  LOCK();
                  piVar1 = (int *)((longlong)local_28 + 0xc);
                  iVar8 = *piVar1;
                  *piVar1 = *piVar1 + -1;
                  UNLOCK();
                  plVar11 = local_50;
                  if (iVar8 == 1) {
                    (**(code **)(*local_28 + 0x10))(local_28);
                    plVar11 = local_50;
                  }
                }
              }
            }
          }
          FUN_14022fc10(*plVar11,param_2);
        }
        goto LAB_1401bce78;
      }
    }
    else {
      iVar8 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar8;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar11 == (longlong *)0x0) {
    return 1;
  }
  if (plVar11 != local_48) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bce78:
  LOCK();
  plVar11 = plVar11 + 1;
  *(int *)plVar11 = (int)*plVar11 + -1;
  UNLOCK();
  if ((int)*plVar11 == 0) {
    puVar6 = (undefined8 *)*local_50;
    if (puVar6 != (undefined8 *)0x0) {
      (**(code **)*puVar6)(puVar6,1);
    }
    operator_delete(local_50);
  }
  return 1;
}



undefined8 FUN_1401bced0(undefined8 param_1,undefined4 *param_2,undefined2 *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  int iVar5;
  bool bVar6;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_2,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      plVar2 = (longlong *)*local_20;
      if (plVar2 != (longlong *)0x0) {
        (**(code **)(*plVar2 + 0x348))(plVar2,*param_2,*param_3);
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_18) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar4 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        puVar3 = (undefined8 *)*local_20;
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        operator_delete(local_20);
      }
    }
    else {
      iVar5 = DAT_140608054 + 1;
      bVar6 = DAT_140608054 == 0;
      DAT_140608054 = iVar5;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401bcfa0(longlong param_1,undefined4 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  longlong *plVar6;
  undefined4 *puVar7;
  bool bVar8;
  undefined4 local_res10 [2];
  longlong *local_20;
  longlong *local_18;
  
  puVar7 = param_3;
  local_res10[0] = param_2;
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      plVar6 = (longlong *)*local_20;
      if (plVar6 != (longlong *)0x0) {
        cVar4 = (**(code **)(*plVar6 + 0x350))(plVar6,*puVar7);
        if ((cVar4 != '\0') && (*(longlong *)(param_1 + 0xb58) != 0)) {
          plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar6 + 0x610))
                    (plVar6,*(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 8),&DAT_1405d85a0,
                     local_res10,param_3);
        }
        goto LAB_1401bd078;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bd078:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401bd0c0(longlong param_1,undefined4 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined8 local_res8;
  longlong *local_20;
  longlong *local_18;
  
  lVar4 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),*param_3);
  if (lVar4 == 0) {
    return 1;
  }
  FUN_140198570(lVar4,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if ((longlong *)*local_20 != (longlong *)0x0) {
        lVar4 = (**(code **)(*(longlong *)*local_20 + 0x270))();
        if (lVar4 != 0) {
          local_res8 = *(undefined8 *)(lVar4 + 0x60);
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar5 + 0x430))(plVar5,param_2,&DAT_1405d85a0,&local_res8,lVar4);
        }
        goto LAB_1401bd1ac;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bd1ac:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401bd1f0(longlong param_1,undefined4 param_2,ushort *param_3)

{
  int iVar1;
  longlong lVar2;
  uint local_res8 [2];
  undefined2 local_res10 [4];
  undefined4 local_res18 [4];
  
  iVar1 = *(int *)(param_1 + 0x284);
  local_res8[0] = (uint)*param_3;
  if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
     (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
    local_res10[0] = (undefined2)iVar1;
    lVar2 = *(longlong *)(*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
    local_res18[0] = param_2;
    (**(code **)(*(longlong *)(lVar2 + 0x70) + 0x3d0))
              (lVar2 + 0x70,1,&DAT_1405d85a0,local_res10,local_res18,local_res8);
  }
  return 1;
}



undefined8 FUN_1401bd280(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  char cVar4;
  longlong *plVar5;
  undefined1 *puVar6;
  undefined1 *puVar7;
  undefined4 local_res8 [2];
  undefined1 *local_168;
  undefined1 *local_160;
  undefined1 *local_158;
  undefined8 local_148;
  undefined1 local_138 [4];
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_12c;
  
  local_148 = 0xfffffffffffffffe;
  lVar1 = *(longlong *)(param_1 + 0xb58);
  if ((lVar1 != 0) && (lVar2 = *(longlong *)(lVar1 + 0x48), lVar2 != 0)) {
    puVar7 = (undefined1 *)0x0;
    local_168 = (undefined1 *)0x0;
    local_160 = (undefined1 *)0x0;
    local_158 = (undefined1 *)0x0;
    puVar6 = (undefined1 *)*param_2;
    if (puVar6 != (undefined1 *)param_2[1]) {
      do {
        local_res8[0] = 0;
        switch(*puVar6) {
        case 3:
          goto switchD_1401bd33c_caseD_3;
        case 4:
          cVar4 = FUN_140188d00(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 5:
          cVar4 = FUN_1401899e0(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 6:
          cVar4 = FUN_14018a590(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 7:
          cVar4 = FUN_14018ab50(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 8:
          cVar4 = FUN_14018b230(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        default:
          FUN_140418da0(DAT_140607fd8,L" Packet.GetCategory() = %d error.",*puVar6);
          puVar7 = local_160;
          goto switchD_1401bd33c_caseD_3;
        case 10:
          cVar4 = FUN_14018b4b0(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 0xb:
          cVar4 = FUN_14018b6d0(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 0xc:
          cVar4 = FUN_14018bb00(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 0x14:
          cVar4 = FUN_14018be60(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,lVar1,local_res8);
          break;
        case 0x15:
          cVar4 = FUN_14018c170(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 0x16:
          cVar4 = FUN_14018c3b0(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 0x17:
          cVar4 = FUN_14018c5d0(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 0x1f:
          cVar4 = FUN_14018c750(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 0x26:
          cVar4 = FUN_1401893d0(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
          break;
        case 0x28:
          cVar4 = FUN_140189fb0(*(undefined8 *)(param_1 + 0xb50),puVar6,lVar2,local_res8);
        }
        puVar7 = local_160;
        if (cVar4 == '\0') {
          local_138[0] = 0x2a;
          local_12c = local_res8[0];
          local_134 = 4;
          local_130 = 4;
          if ((local_138 < local_160) && (local_168 <= local_138)) {
            lVar3 = -(longlong)local_168;
            if (local_160 == local_158) {
              FUN_1400d5530(&local_168,1);
            }
            if (local_160 != (undefined1 *)0x0) {
              memcpy(local_160,local_168 + ((longlong)(local_138 + lVar3) / 0x10c) * 0x10c,0x10c);
            }
            puVar7 = local_160 + 0x10c;
            local_160 = puVar7;
          }
          else {
            if (local_160 == local_158) {
              FUN_1400d5530(&local_168,1);
            }
            if (local_160 != (undefined1 *)0x0) {
              memcpy(local_160,local_138,0x10c);
            }
            puVar7 = local_160 + 0x10c;
            local_160 = puVar7;
          }
        }
switchD_1401bd33c_caseD_3:
        puVar6 = puVar6 + 0x10c;
      } while (puVar6 != (undefined1 *)param_2[1]);
      if (local_168 != puVar7) {
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
        (**(code **)(*plVar5 + 0x40))(plVar5,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,&local_168);
      }
    }
    if (local_168 != (undefined1 *)0x0) {
      operator_delete(local_168);
    }
  }
  return 1;
}



undefined8
FUN_1401bd700(longlong param_1,undefined4 *param_2,undefined2 *param_3,undefined2 *param_4,
             char *param_5,undefined4 *param_6,undefined4 *param_7,char *param_8,undefined8 param_9,
             short *param_10,ushort *param_11,char *param_12)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined4 uVar8;
  longlong *plVar9;
  undefined8 *puVar10;
  undefined8 uVar11;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  float local_44;
  float local_40;
  float local_3c;
  longlong *local_38;
  longlong *local_30;
  longlong *local_28;
  longlong *local_20;
  undefined1 local_18 [8];
  longlong *local_10;
  
  uVar11 = 0xfffffffffffffffe;
  lVar4 = *(longlong *)(param_1 + 0xb58);
  if ((lVar4 != 0) &&
     (plVar9 = (longlong *)FUN_14018fd10(*(undefined8 *)(lVar4 + 0x48),*param_2),
     plVar9 != (longlong *)0x0)) {
    local_50 = 0;
    local_4c = 0;
    local_48 = 0;
    local_3c = (float)(int)param_8[2] / 125.0;
    local_40 = (float)(int)param_8[1] / 125.0;
    local_44 = (float)(int)*param_8 / 125.0;
    FUN_14022fe70(plVar9,*param_3,*param_4,(int)*param_5,param_9,&local_44,(float)(int)*param_10,
                  (float)*param_11,&local_50,(int)*param_12,uVar11);
    FUN_14018fa30(*(undefined8 *)(lVar4 + 0x48),&local_38,*param_6);
    if (local_38 == (longlong *)0x0) {
      (**(code **)(*plVar9 + 0x118))(plVar9,0,0);
    }
    else {
      lVar6 = local_38[0x25];
      lVar5 = *plVar9;
      uVar8 = (**(code **)(*local_38 + 0xb0))();
      (**(code **)(lVar5 + 0x118))(plVar9,uVar8,(int)lVar6);
    }
    puVar10 = (undefined8 *)FUN_14018fa30(*(undefined8 *)(lVar4 + 0x48),local_18,*param_7);
    plVar3 = local_30;
    local_38 = (longlong *)*puVar10;
    local_20 = (longlong *)puVar10[1];
    if (local_20 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_20 + 1) = (int)local_20[1] + 1;
      UNLOCK();
    }
    plVar7 = local_20;
    local_28 = local_38;
    if (local_30 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_30 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        lVar4 = *local_30;
        local_30 = local_20;
        (**(code **)(lVar4 + 8))(plVar3);
        LOCK();
        piVar2 = (int *)((longlong)plVar3 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        plVar7 = local_30;
        if (*piVar2 == 0) {
          (**(code **)(*plVar3 + 0x10))(plVar3);
          plVar7 = local_30;
        }
      }
    }
    local_30 = plVar7;
    if (local_10 != (longlong *)0x0) {
      LOCK();
      plVar3 = local_10 + 1;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)*plVar3 == 0) {
        (**(code **)(*local_10 + 8))(local_10);
        LOCK();
        piVar2 = (int *)((longlong)local_10 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_10 + 0x10))(local_10);
        }
      }
    }
    if (local_38 == (longlong *)0x0) {
      (**(code **)(*plVar9 + 0x138))(plVar9,0,0);
    }
    else {
      lVar5 = local_38[0x25];
      lVar4 = *plVar9;
      uVar8 = (**(code **)(*local_38 + 0xb0))();
      (**(code **)(lVar4 + 0x138))(plVar9,uVar8,(int)lVar5);
    }
    plVar9 = local_30;
    if (local_30 != (longlong *)0x0) {
      LOCK();
      plVar3 = local_30 + 1;
      lVar4 = *plVar3;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        (**(code **)(*local_30 + 8))(local_30);
        LOCK();
        piVar2 = (int *)((longlong)plVar9 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar9 + 0x10))(plVar9);
        }
      }
    }
  }
  return 1;
}



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

{
  int *piVar1;
  longlong lVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *plVar5;
  undefined8 uVar6;
  float local_30;
  float local_2c;
  float local_28;
  longlong *local_20;
  longlong *local_18;
  
  uVar6 = 0xfffffffffffffffe;
  lVar2 = *(longlong *)(param_1 + 0xb58);
  if (lVar2 != 0) {
    plVar5 = (longlong *)FUN_14018fd10(*(undefined8 *)(lVar2 + 0x48),*param_2);
    if (plVar5 != (longlong *)0x0) {
      local_28 = (float)(int)param_7[2] / 125.0;
      local_2c = (float)(int)param_7[1] / 125.0;
      local_30 = (float)(int)*param_7 / 125.0;
      FUN_14022fe70(plVar5,*param_3,*param_4,(int)*param_5,param_8,&local_30,(float)(int)*param_10,
                    (float)*param_11,param_9,0,uVar6);
      FUN_14018fa30(*(undefined8 *)(lVar2 + 0x48),&local_20,*param_6);
      if (local_20 == (longlong *)0x0) {
        (**(code **)(*plVar5 + 0x118))(plVar5,0,0);
      }
      else {
        lVar3 = local_20[0x25];
        lVar2 = *plVar5;
        uVar4 = (**(code **)(*local_20 + 0xb0))();
        (**(code **)(lVar2 + 0x118))(plVar5,uVar4,(int)lVar3);
      }
      if (local_18 != (longlong *)0x0) {
        LOCK();
        plVar5 = local_18 + 1;
        lVar2 = *plVar5;
        *(int *)plVar5 = (int)*plVar5 + -1;
        UNLOCK();
        if ((int)lVar2 == 1) {
          (**(code **)(*local_18 + 8))(local_18);
          LOCK();
          piVar1 = (int *)((longlong)local_18 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_18 + 0x10))(local_18);
          }
        }
      }
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined4 uVar8;
  longlong *plVar9;
  undefined8 *puVar10;
  float local_60;
  float local_5c;
  float local_58;
  longlong *local_50;
  longlong *local_48;
  longlong *local_40;
  longlong *local_38;
  undefined1 local_30 [8];
  longlong *local_28;
  
  lVar4 = *(longlong *)(param_1 + 0xb58);
  if ((lVar4 != 0) &&
     (plVar9 = (longlong *)FUN_14018fd10(*(undefined8 *)(lVar4 + 0x48),*param_2),
     plVar9 != (longlong *)0x0)) {
    FUN_14018fa30(*(undefined8 *)(lVar4 + 0x48),&local_50,*param_5);
    if (local_50 == (longlong *)0x0) {
      (**(code **)(*plVar9 + 0x118))(plVar9,0,0);
    }
    else {
      lVar6 = local_50[0x25];
      lVar5 = *plVar9;
      uVar8 = (**(code **)(*local_50 + 0xb0))();
      (**(code **)(lVar5 + 0x118))(plVar9,uVar8,(int)lVar6);
    }
    puVar10 = (undefined8 *)FUN_14018fa30(*(undefined8 *)(lVar4 + 0x48),local_30,*param_6);
    plVar3 = local_48;
    local_50 = (longlong *)*puVar10;
    local_38 = (longlong *)puVar10[1];
    if (local_38 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_38 + 1) = (int)local_38[1] + 1;
      UNLOCK();
    }
    plVar7 = local_38;
    local_40 = local_50;
    if (local_48 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_48 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        lVar4 = *local_48;
        local_48 = local_38;
        (**(code **)(lVar4 + 8))(plVar3);
        LOCK();
        piVar2 = (int *)((longlong)plVar3 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        plVar7 = local_48;
        if (*piVar2 == 0) {
          (**(code **)(*plVar3 + 0x10))(plVar3);
          plVar7 = local_48;
        }
      }
    }
    local_48 = plVar7;
    if (local_28 != (longlong *)0x0) {
      LOCK();
      plVar3 = local_28 + 1;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)*plVar3 == 0) {
        (**(code **)(*local_28 + 8))(local_28);
        LOCK();
        piVar2 = (int *)((longlong)local_28 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_28 + 0x10))(local_28);
        }
      }
    }
    if (local_50 == (longlong *)0x0) {
      (**(code **)(*plVar9 + 0x138))(plVar9,0,0);
    }
    else {
      lVar5 = local_50[0x25];
      lVar4 = *plVar9;
      uVar8 = (**(code **)(*local_50 + 0xb0))();
      (**(code **)(lVar4 + 0x138))(plVar9,uVar8,(int)lVar5);
    }
    *(int *)(plVar9 + 0x30b) = (int)*param_7;
    local_58 = (float)(int)param_8[2] / 125.0;
    local_5c = (float)(int)param_8[1] / 125.0;
    local_60 = (float)(int)*param_8 / 125.0;
    FUN_14022f150(plVar9,*param_3,*param_4,param_9,&local_60,0,0);
    plVar9 = local_48;
    if (local_48 != (longlong *)0x0) {
      LOCK();
      plVar3 = local_48 + 1;
      lVar4 = *plVar3;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        (**(code **)(*local_48 + 8))(local_48);
        LOCK();
        piVar2 = (int *)((longlong)plVar9 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar9 + 0x10))(plVar9);
        }
      }
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined4 uVar8;
  longlong *plVar9;
  undefined8 *puVar10;
  undefined2 local_res8;
  longlong *local_a0;
  longlong *local_98;
  longlong *local_90;
  longlong *local_88;
  undefined1 local_80 [8];
  longlong *local_78;
  undefined4 local_70;
  undefined4 local_6c;
  undefined2 local_68;
  undefined2 local_66;
  undefined1 local_64;
  undefined1 local_63;
  undefined4 local_60;
  undefined1 local_5c;
  undefined4 local_58;
  undefined2 local_54;
  undefined1 local_52;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined2 local_44;
  undefined2 local_42;
  undefined4 local_40;
  undefined2 local_3c;
  
  lVar4 = *(longlong *)(param_1 + 0xb58);
  if ((lVar4 != 0) &&
     (plVar9 = (longlong *)
               FUN_14018fd10(*(undefined8 *)(lVar4 + 0x48),*param_2,param_3,param_4,
                             0xfffffffffffffffe), plVar9 != (longlong *)0x0)) {
    FUN_14018fa30(*(undefined8 *)(lVar4 + 0x48),&local_a0,*param_7);
    if (local_a0 == (longlong *)0x0) {
      (**(code **)(*plVar9 + 0x118))(plVar9,0,0);
    }
    else {
      lVar6 = local_a0[0x25];
      lVar5 = *plVar9;
      uVar8 = (**(code **)(*local_a0 + 0xb0))();
      (**(code **)(lVar5 + 0x118))(plVar9,uVar8,(int)lVar6);
    }
    puVar10 = (undefined8 *)FUN_14018fa30(*(undefined8 *)(lVar4 + 0x48),local_80);
    plVar3 = local_98;
    local_a0 = (longlong *)*puVar10;
    local_88 = (longlong *)puVar10[1];
    if (local_88 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_88 + 1) = (int)local_88[1] + 1;
      UNLOCK();
    }
    plVar7 = local_88;
    local_90 = local_a0;
    if (local_98 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_98 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        lVar4 = *local_98;
        local_98 = local_88;
        (**(code **)(lVar4 + 8))(plVar3);
        LOCK();
        piVar2 = (int *)((longlong)plVar3 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        plVar7 = local_98;
        if (*piVar2 == 0) {
          (**(code **)(*plVar3 + 0x10))(plVar3);
          plVar7 = local_98;
        }
      }
    }
    local_98 = plVar7;
    if (local_78 != (longlong *)0x0) {
      LOCK();
      plVar3 = local_78 + 1;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)*plVar3 == 0) {
        (**(code **)(*local_78 + 8))(local_78);
        LOCK();
        piVar2 = (int *)((longlong)local_78 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_78 + 0x10))(local_78);
        }
      }
    }
    if (local_a0 == (longlong *)0x0) {
      (**(code **)(*plVar9 + 0x138))(plVar9,0);
    }
    else {
      lVar4 = *plVar9;
      uVar8 = (**(code **)(*local_a0 + 0xb0))();
      (**(code **)(lVar4 + 0x138))(plVar9,uVar8);
    }
    local_6c = 0;
    local_3c = 0;
    local_68 = *param_3;
    local_66 = *param_4;
    local_64 = *param_5;
    local_63 = *param_6;
    local_60 = *param_7;
    local_5c = *param_8;
    local_58 = *param_9;
    local_res8 = CONCAT11((char)(int)(((float)(int)param_10[1] / 125.0) * 125.0),
                          (char)(int)(((float)(int)*param_10 / 125.0) * 125.0));
    local_54 = local_res8;
    local_52 = (undefined1)(int)(((float)(int)param_10[2] / 125.0) * 125.0);
    local_50 = *param_11;
    local_4c = param_11[1];
    local_48 = param_11[2];
    local_40 = 0;
    local_44 = *param_12;
    local_42 = *param_13;
    local_70 = *param_2;
    FUN_14022fc10(plVar9,&local_70);
    plVar9 = local_98;
    if (local_98 != (longlong *)0x0) {
      LOCK();
      plVar3 = local_98 + 1;
      lVar4 = *plVar3;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        (**(code **)(*local_98 + 8))(local_98);
        LOCK();
        piVar2 = (int *)((longlong)plVar9 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar9 + 0x10))(plVar9);
        }
      }
    }
  }
  return 1;
}



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

{
  longlong lVar1;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    lVar1 = FUN_14018fd10(*(undefined8 *)(*(longlong *)(param_1 + 0xb58) + 0x48),*param_2);
    if (lVar1 != 0) {
      local_18 = 0;
      local_14 = 0;
      local_10 = 0;
      FUN_14022f830(lVar1,0x27,*param_3,param_4,param_5,0,&local_18);
    }
  }
  return 1;
}



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

{
  longlong lVar1;
  float local_18;
  float local_14;
  float local_10;
  
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    lVar1 = FUN_14018fd10(*(undefined8 *)(*(longlong *)(param_1 + 0xb58) + 0x48),*param_2);
    if (lVar1 != 0) {
      local_18 = (float)(int)*param_4 / 125.0;
      local_14 = (float)(int)param_4[1] / 125.0;
      local_10 = (float)(int)param_4[2] / 125.0;
      FUN_14022f150(lVar1,0x50,*param_3,param_5,&local_18,0,0);
    }
  }
  return 1;
}



undefined1
FUN_1401be1e0(longlong param_1,undefined4 *param_2,undefined2 *param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    lVar1 = FUN_14018fd10(*(undefined8 *)(*(longlong *)(param_1 + 0xb58) + 0x48),*param_2);
    if (lVar1 != 0) {
      local_28 = 0;
      local_24 = 0;
      local_20 = 0;
      local_1c = 0;
      local_18 = 0;
      local_14 = 0;
      FUN_14022f830(lVar1,0x53,*param_3,&local_1c,param_4,0,&local_28);
    }
  }
  return 1;
}



undefined1
FUN_1401be270(longlong param_1,undefined4 *param_2,undefined2 *param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    lVar1 = FUN_14018fd10(*(undefined8 *)(*(longlong *)(param_1 + 0xb58) + 0x48),*param_2);
    if (lVar1 != 0) {
      local_28 = 0;
      local_24 = 0;
      local_20 = 0;
      local_1c = 0;
      local_18 = 0;
      local_14 = 0;
      FUN_14022f830(lVar1,0x51,*param_3,&local_1c,param_4,0,&local_28);
    }
  }
  return 1;
}



undefined1
FUN_1401be300(longlong param_1,undefined4 *param_2,undefined2 *param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    lVar1 = FUN_14018fd10(*(undefined8 *)(*(longlong *)(param_1 + 0xb58) + 0x48),*param_2);
    if (lVar1 != 0) {
      local_28 = 0;
      local_24 = 0;
      local_20 = 0;
      local_1c = 0;
      local_18 = 0;
      local_14 = 0;
      FUN_14022f830(lVar1,0x54,*param_3,&local_1c,param_4,0,&local_28);
    }
  }
  return 1;
}



undefined8 FUN_1401be390(longlong param_1,undefined4 *param_2,longlong *param_3)

{
  longlong *plVar1;
  char cVar2;
  undefined4 uVar3;
  longlong *plVar4;
  undefined4 local_res8 [2];
  undefined4 local_res20 [2];
  
  plVar1 = *(longlong **)(param_1 + 0xb58);
  if ((plVar1 != (longlong *)0x0) &&
     (plVar4 = (longlong *)FUN_14018fd10(plVar1[9],*param_2), plVar4 != (longlong *)0x0)) {
    local_res8[0] = 0;
    local_res20[0] = 0;
    uVar3 = (**(code **)(*plVar1 + 0x1a8))(plVar1);
    if ((param_3[1] - *param_3 == 0xc) &&
       ((cVar2 = FUN_1403145b0(local_res20,local_res8,param_3,uVar3), cVar2 != '\0' &&
        (*(int *)((longlong)plVar4 + 300) != 0x25)))) {
      (**(code **)(*plVar4 + 0x290))(plVar4);
      FUN_140214be0(plVar4);
    }
  }
  return 1;
}



undefined8
FUN_1401be440(longlong param_1,undefined4 param_2,int *param_3,longlong *param_4,undefined4 *param_5
             ,undefined4 *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,undefined4 *param_16,undefined4 *param_17,
             undefined4 *param_18,undefined4 *param_19,undefined4 *param_20,undefined4 *param_21,
             undefined8 *param_22)

{
  longlong *plVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  size_t sVar5;
  longlong *plVar6;
  longlong lVar7;
  wchar_t *_Src;
  undefined8 *puVar8;
  undefined *puVar9;
  bool bVar10;
  undefined8 in_stack_fffffffffffffe08;
  undefined4 uVar12;
  undefined8 uVar11;
  undefined1 local_158 [8];
  longlong *local_150;
  longlong *local_148;
  undefined8 local_138;
  undefined8 local_130;
  undefined8 local_128;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined8 local_114;
  undefined8 local_10c;
  undefined8 local_104;
  undefined8 local_fc;
  undefined8 local_e8;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined8 local_c0;
  undefined8 local_b8;
  undefined4 local_b0;
  undefined1 local_ac;
  undefined8 local_ab;
  undefined2 local_a3;
  undefined8 local_a1;
  undefined8 local_99;
  undefined8 local_91;
  undefined8 local_89;
  undefined8 local_81;
  undefined4 local_79;
  undefined4 local_75;
  undefined1 local_71;
  undefined8 local_70;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined8 local_48;
  
  uVar12 = (undefined4)((ulonglong)in_stack_fffffffffffffe08 >> 0x20);
  local_48 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_150);
  plVar1 = local_150;
  if (local_150 != (longlong *)0x0) {
    if (local_150 == local_148) {
      if (*local_150 != 0) {
        cVar3 = FUN_14020c880();
        if ((cVar3 == '\0') || (*param_3 < 1)) goto LAB_1401be9d2;
        _Src = (wchar_t *)*param_4;
        if ((wchar_t *)*param_4 == (wchar_t *)0x0) {
          _Src = (wchar_t *)PTR_DAT_1405d8010;
        }
        sVar5 = wcsnlen(_Src,0x10);
        if (0xf < sVar5) {
          LOCK();
          plVar1 = plVar1 + 1;
          lVar7 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar7 == 1) {
            puVar8 = (undefined8 *)*local_150;
            if (puVar8 != (undefined8 *)0x0) {
              (**(code **)*puVar8)(puVar8,1);
            }
            operator_delete(local_150);
          }
          return 0;
        }
        puVar9 = (undefined *)*param_4;
        if ((undefined *)*param_4 == (undefined *)0x0) {
          puVar9 = PTR_DAT_1405d8010;
        }
        uVar11 = CONCAT44(uVar12,*param_6);
        plVar6 = (longlong *)
                 FUN_140207f20(*plVar1,*param_3,puVar9,*param_5,uVar11,*param_7,*param_8,*param_9,
                               *param_10,*param_11,*param_12,*param_13,0);
        uVar12 = (undefined4)((ulonglong)uVar11 >> 0x20);
        if (plVar6 == (longlong *)0x0) goto LAB_1401be9d2;
        uVar2 = *(undefined4 *)(plVar6[0x26] + 0x274);
        lVar7 = (**(code **)(*plVar6 + 0x280))(plVar6);
        *(short *)(lVar7 + 0x68) = (short)uVar2;
        puVar9 = (undefined *)*param_4;
        if ((undefined *)*param_4 == (undefined *)0x0) {
          puVar9 = PTR_DAT_1405d8010;
        }
        FUN_1401abf50(param_1,plVar6 + 0x1f6,(int)plVar6[0x24],puVar9,CONCAT44(uVar12,uVar2),
                      *param_5,*param_6,*param_7,*param_8,*param_9,*param_10,*param_11,*param_12,
                      *param_13,*param_14,*param_15,*param_16,*param_17,*param_18,*param_19,
                      *param_20,*param_21,*param_22,0);
        if (*(longlong *)(param_1 + 0xb50) != 0) {
          local_138 = 0;
          local_130 = 0;
          local_128 = 0;
          local_120 = 0;
          local_11c = 0;
          local_118 = 0;
          local_114 = 0;
          local_10c = 0;
          local_104 = 0;
          local_fc = 0;
          FUN_140203e10(*(longlong *)(param_1 + 0xb50),0x1f5,param_1,plVar6,&local_138);
        }
        cVar3 = FUN_1401b5230(param_1,(int)plVar6[0x25],uVar2);
        if (cVar3 == '\0') goto LAB_1401be9d2;
        local_e8 = 0;
        local_e0 = 0;
        local_dc = 0;
        local_d8 = 0;
        local_d4 = 0;
        local_b0 = 0;
        local_ac = 0;
        local_ab = 0;
        local_a3 = 0;
        local_a1 = 0;
        local_99 = 0;
        local_91 = 0;
        local_89 = 0;
        local_81 = 0;
        local_79 = 0;
        local_75 = 0;
        local_71 = 0;
        local_70 = 0;
        local_68 = 0;
        local_64 = 0;
        local_60 = 0;
        local_5c = 0;
        local_58 = 0;
        local_d0 = 0;
        local_c8 = 0;
        local_c0 = 0;
        local_b8 = 0;
        FUN_14020c710(*plVar1,&local_e8,plVar6);
        if ((DAT_14060cf78 & 1) == 0) {
          DAT_14060cf78 = DAT_14060cf78 | 1;
          DAT_14060cf58 = (undefined8 *)0x0;
          DAT_14060cf60 = (undefined8 *)0x0;
          DAT_14060cf68 = (undefined8 *)0x0;
          atexit(FUN_140448b80);
        }
        FUN_1401dec50(&DAT_14060cf58);
        if ((&local_e8 < DAT_14060cf60) && (DAT_14060cf58 <= &local_e8)) {
          lVar7 = (longlong)&local_e8 - (longlong)DAT_14060cf58;
          if (DAT_14060cf60 == DAT_14060cf68) {
            FUN_1400d55e0(&DAT_14060cf58,1);
          }
          puVar8 = (undefined8 *)((lVar7 / 0x94) * 0x94 + (longlong)DAT_14060cf58);
          if (DAT_14060cf60 != (undefined8 *)0x0) {
LAB_1401be950:
            memcpy(DAT_14060cf60,puVar8,0x94);
          }
        }
        else {
          if (DAT_14060cf60 == DAT_14060cf68) {
            FUN_1400d55e0(&DAT_14060cf58,1);
          }
          if (DAT_14060cf60 != (undefined8 *)0x0) {
            puVar8 = &local_e8;
            goto LAB_1401be950;
          }
        }
        DAT_14060cf60 = (undefined8 *)((longlong)DAT_14060cf60 + 0x94);
        local_158[0] = 0;
        plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
        (**(code **)(*plVar6 + 0x550))(plVar6,param_2,&DAT_1405d85a0,&DAT_14060cf58,local_158);
        goto LAB_1401be9d2;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar10 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_148) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401be9d2:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar7 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar7 == 1) {
    puVar8 = (undefined8 *)*local_150;
    if (puVar8 != (undefined8 *)0x0) {
      (**(code **)*puVar8)(puVar8,1);
    }
    operator_delete(local_150);
  }
  return 1;
}



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

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  size_t sVar8;
  undefined8 uVar9;
  wchar_t *_Src;
  longlong *plVar10;
  longlong lVar11;
  wchar_t *_Src_00;
  longlong *plVar12;
  undefined4 *puVar13;
  bool bVar14;
  longlong *local_118;
  longlong *local_110;
  longlong *local_108;
  longlong *local_100;
  void *local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined2 local_c0;
  wchar_t local_be [16];
  undefined2 local_9e;
  undefined **local_98;
  longlong *local_90;
  longlong local_88;
  ulonglong local_80;
  undefined8 local_78;
  longlong *local_70;
  longlong *local_68;
  longlong local_60;
  undefined8 local_58;
  undefined1 local_50 [8];
  longlong *local_48;
  
  local_58 = 0xfffffffffffffffe;
  puVar13 = param_4;
  FUN_140198570(param_1,&local_118);
  plVar12 = local_118;
  if (local_118 != (longlong *)0x0) {
    if (local_118 == local_110) {
      if (*local_118 != 0) {
        local_70 = (longlong *)0x0;
        local_68 = (longlong *)0x0;
        local_f8 = (void *)0x0;
        local_f0 = 0;
        local_e8 = 0;
        lVar11 = *(longlong *)(param_1 + 0xb58);
        local_60 = lVar11;
        puVar6 = (undefined8 *)FUN_1402076d0(*local_118,local_50,*puVar13);
        local_108 = (longlong *)*puVar6;
        local_100 = (longlong *)puVar6[1];
        if (local_100 != (longlong *)0x0) {
          LOCK();
          *(int *)(local_100 + 1) = (int)local_100[1] + 1;
          UNLOCK();
          plVar12 = local_118;
        }
        local_70 = local_108;
        local_68 = local_100;
        if (local_48 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_48 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          plVar12 = local_118;
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_48 + 8))(local_48);
            LOCK();
            piVar2 = (int *)((longlong)local_48 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            plVar12 = local_118;
            if (*piVar2 == 0) {
              (**(code **)(*local_48 + 0x10))(local_48);
              plVar12 = local_118;
            }
          }
        }
        plVar1 = local_100;
        plVar10 = local_108;
        if (local_108 == (longlong *)0x0) {
          if (local_f8 != (void *)0x0) {
            operator_delete(local_f8);
          }
          plVar10 = local_100;
          local_f8 = (void *)0x0;
          local_f0 = 0;
          local_e8 = 0;
          if (plVar1 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar11 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            plVar12 = local_118;
            if ((int)lVar11 == 1) {
              (**(code **)(*local_100 + 8))(local_100);
              LOCK();
              piVar2 = (int *)((longlong)plVar10 + 0xc);
              iVar3 = *piVar2;
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              plVar12 = local_118;
              if (iVar3 == 1) {
                (**(code **)(*local_100 + 0x10))();
                plVar12 = local_118;
              }
            }
          }
        }
        else {
          local_9e = 0;
          local_be[0] = L'\0';
          local_be[1] = L'\0';
          local_be[2] = L'\0';
          local_be[3] = L'\0';
          local_be[4] = L'\0';
          local_be[5] = L'\0';
          local_be[6] = L'\0';
          local_be[7] = L'\0';
          local_be[8] = L'\0';
          local_be[9] = L'\0';
          local_be[10] = L'\0';
          local_be[0xb] = L'\0';
          local_be[0xc] = L'\0';
          local_be[0xd] = L'\0';
          local_be[0xe] = L'\0';
          local_be[0xf] = L'\0';
          local_d8 = *param_3;
          local_d4 = *param_4;
          local_c0 = (undefined2)(int)local_108[0x24];
          local_d0 = (undefined4)local_108[0x1f6];
          local_cc = *(undefined4 *)((longlong)local_108 + 0xfb4);
          local_c8 = (undefined4)local_108[0x1f7];
          local_c4 = *(undefined4 *)((longlong)local_108 + 0xfbc);
          lVar7 = (**(code **)(*local_108 + 0x280))(local_108);
          uVar4 = *(undefined4 *)(lVar7 + 0x7c);
          *(undefined1 *)((longlong)plVar10 + 0x20d4) = *param_5;
          local_9e = CONCAT11(*param_5,(char)uVar4);
          _Src_00 = (wchar_t *)(plVar10 + 0x1a);
          _Src = _Src_00;
          if (7 < (ulonglong)plVar10[0x1d]) {
            _Src = *(wchar_t **)_Src_00;
          }
          sVar8 = wcsnlen(_Src,0x10);
          if (0xf < sVar8) {
            if (local_f8 != (void *)0x0) {
              operator_delete(local_f8);
            }
            plVar10 = local_100;
            local_f8 = (void *)0x0;
            local_f0 = 0;
            local_e8 = 0;
            if (plVar1 != (longlong *)0x0) {
              LOCK();
              plVar1 = plVar1 + 1;
              lVar11 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              plVar12 = local_118;
              if ((int)lVar11 == 1) {
                (**(code **)(*local_100 + 8))(local_100);
                LOCK();
                piVar2 = (int *)((longlong)plVar10 + 0xc);
                iVar3 = *piVar2;
                *piVar2 = *piVar2 + -1;
                UNLOCK();
                plVar12 = local_118;
                if (iVar3 == 1) {
                  (**(code **)(*local_100 + 0x10))();
                  plVar12 = local_118;
                }
              }
            }
            LOCK();
            plVar12 = plVar12 + 1;
            *(int *)plVar12 = (int)*plVar12 + -1;
            UNLOCK();
            if ((int)*plVar12 == 0) {
              puVar6 = (undefined8 *)*local_118;
              if (puVar6 != (undefined8 *)0x0) {
                (**(code **)*puVar6)(puVar6,1);
              }
              operator_delete(local_118);
            }
            return 0;
          }
          if (7 < (ulonglong)plVar10[0x1d]) {
            _Src_00 = *(wchar_t **)_Src_00;
          }
          wcscpy_s(local_be,0x10,_Src_00);
          FUN_1400d5170(&local_f8,&local_d8);
          lVar7 = FUN_1401de9e0(param_1 + 0x9c0);
          if (lVar7 != 0) {
            if (plVar10[0x26] == 0) {
              uVar4 = 0;
            }
            else {
              uVar4 = *(undefined4 *)(plVar10[0x26] + 0x200);
            }
            uVar5 = FUN_1402f8580(plVar10);
            uVar9 = FUN_1401de9e0(param_1 + 0x9c0);
            FUN_1402585a0(uVar9,param_1,uVar4,uVar5);
            lVar11 = local_60;
          }
          if (lVar11 == 0) {
            local_98 = Proud::CFastArray<>::vftable;
            local_90 = (longlong *)0x0;
            local_88 = 0;
            local_80 = 0;
            local_78 = 0;
            iVar3 = (**(code **)(*(longlong *)*plVar12 + 0xae8))((longlong *)*plVar12,&local_98);
            if (iVar3 < 1) {
              plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
              (**(code **)(*plVar10 + 0x570))(plVar10,param_2,&DAT_1405d85a0);
            }
            else {
              lVar11 = local_88;
              if ((int)local_80 == 0) {
                lVar11 = 0;
              }
              plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
              (**(code **)(*plVar10 + 0x568))
                        (plVar10,lVar11,local_80 & 0xffffffff,&DAT_1405d85a0,&local_f8);
            }
            local_98 = Proud::CFastArray<>::vftable;
            if (local_88 != 0) {
              if (local_90 == (longlong *)0x0) {
                FUN_14034ff60();
              }
              else {
                (**(code **)(*local_90 + 0x18))(local_90,local_88);
              }
            }
          }
          else {
            plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar10 + 0x570))
                      (plVar10,*(undefined4 *)(lVar11 + 8),&DAT_1405d85a0,&local_f8);
          }
          FUN_14020d4d0(*plVar12);
          if (local_f8 != (void *)0x0) {
            operator_delete(local_f8);
          }
          plVar10 = local_100;
          local_f8 = (void *)0x0;
          local_f0 = 0;
          local_e8 = 0;
          if (plVar1 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar11 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            plVar12 = local_118;
            if ((int)lVar11 == 1) {
              (**(code **)(*local_100 + 8))(local_100);
              LOCK();
              piVar2 = (int *)((longlong)plVar10 + 0xc);
              iVar3 = *piVar2;
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              plVar12 = local_118;
              if (iVar3 == 1) {
                (**(code **)(*local_100 + 0x10))();
                plVar12 = local_118;
              }
            }
          }
        }
        goto LAB_1401bef0e;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar14 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar12 == (longlong *)0x0) {
    return 1;
  }
  if (plVar12 != local_110) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bef0e:
  LOCK();
  plVar12 = plVar12 + 1;
  *(int *)plVar12 = (int)*plVar12 + -1;
  UNLOCK();
  if ((int)*plVar12 == 0) {
    puVar6 = (undefined8 *)*local_118;
    if (puVar6 != (undefined8 *)0x0) {
      (**(code **)*puVar6)(puVar6,1);
    }
    operator_delete(local_118);
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined4 *puVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong *local_50;
  longlong *local_48;
  undefined **local_40;
  longlong *local_38;
  longlong local_30;
  ulonglong local_28;
  undefined8 local_20;
  
  uVar8 = 0xfffffffffffffffe;
  puVar6 = param_4;
  FUN_140198570(param_1,&local_50);
  plVar1 = local_50;
  if (local_50 != (longlong *)0x0) {
    if (local_50 == local_48) {
      if (*local_50 != 0) {
        lVar5 = *(longlong *)(param_1 + 0xb58);
        FUN_1402082d0(*local_50,*puVar6,0);
        if (lVar5 == 0) {
          local_40 = Proud::CFastArray<>::vftable;
          local_38 = (longlong *)0x0;
          local_30 = 0;
          local_28 = 0;
          local_20 = 0;
          iVar3 = (**(code **)(*(longlong *)*plVar1 + 0xae8))((longlong *)*plVar1,&local_40);
          if (iVar3 < 1) {
            plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar4 + 0x590))(plVar4,param_2,&DAT_1405d85a0,param_3,param_4);
          }
          else {
            lVar5 = local_30;
            if ((int)local_28 == 0) {
              lVar5 = 0;
            }
            plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar4 + 0x588))
                      (plVar4,lVar5,local_28 & 0xffffffff,&DAT_1405d85a0,param_3,param_4,uVar8);
          }
          local_40 = Proud::CFastArray<>::vftable;
          if (local_30 != 0) {
            if (local_38 == (longlong *)0x0) {
              FUN_14034ff60();
            }
            else {
              (**(code **)(*local_38 + 0x18))(local_38,local_30);
            }
          }
        }
        else {
          plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar4 + 0x590))
                    (plVar4,*(undefined4 *)(lVar5 + 8),&DAT_1405d85a0,param_3,param_4);
        }
        goto LAB_1401bf115;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_48) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bf115:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar2 = (undefined8 *)*local_50;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_50);
  }
  return 1;
}



undefined8 FUN_1401bf170(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  undefined4 uVar5;
  undefined4 *puVar6;
  bool bVar7;
  longlong *local_20;
  longlong *local_18;
  
  puVar6 = param_3;
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar3 = param_1[0x16b];
        FUN_140208680(*local_20,*puVar6);
        if (lVar3 == 0) {
          lVar3 = *(longlong *)(param_1[0x16a] + 0x380);
          uVar5 = (**(code **)(*param_1 + 0x38))(param_1);
          (**(code **)(lVar3 + 0x5a0))(param_1[0x16a] + 0x380,uVar5,&DAT_1405d85a0,param_2,param_3);
        }
        else {
          (**(code **)(*(longlong *)(param_1[0x16a] + 0x380) + 0x5a0))
                    ((longlong *)(param_1[0x16a] + 0x380),*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,
                     param_2,param_3);
        }
        goto LAB_1401bf290;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bf290:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401bf2e0(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_2,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      lVar4 = *local_20;
      if (lVar4 != 0) {
        if (param_1[0x16b] == 0) {
          lVar4 = FUN_140208860(lVar4,*param_2);
          if (lVar4 == 0) goto LAB_1401bf3bd;
          (**(code **)(*param_1 + 0x38))(param_1);
        }
        else {
          lVar4 = FUN_140208860(lVar4,*param_2);
          if (lVar4 == 0) goto LAB_1401bf3bd;
        }
        FUN_1401fec90(param_1[0x16a],param_1,lVar4,*param_3);
        goto LAB_1401bf3bd;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bf3bd:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401bf400(longlong param_1,undefined8 param_2)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  undefined8 uVar9;
  undefined *puVar10;
  longlong *plVar11;
  int iVar12;
  bool bVar13;
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined *local_78;
  undefined8 local_70;
  longlong *local_68;
  longlong *local_60;
  undefined8 local_58;
  undefined1 local_50;
  void *local_48;
  undefined8 local_40;
  undefined8 local_38;
  
  local_70 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_68);
  plVar3 = local_68;
  if (local_68 != (longlong *)0x0) {
    if (local_68 == local_60) {
      if (*local_68 != 0) {
        local_48 = (void *)0x0;
        local_40 = 0;
        local_38 = 0;
        iVar5 = 0;
        local_res18[0] = 0;
        lVar8 = FUN_1402089c0(*local_68,param_2);
        if (lVar8 != 0) {
          local_res20[0] = *(undefined4 *)(*(longlong *)(lVar8 + 0x130) + 0x274);
          plVar11 = (longlong *)(lVar8 + 0xd0);
          if (7 < *(ulonglong *)(lVar8 + 0xe8)) {
            plVar11 = (longlong *)*plVar11;
          }
          FUN_1401b63d0(param_1,param_2,local_res18,1,&local_48);
          FUN_14034fe70();
          local_78 = PTR_DAT_1405d8010;
          iVar6 = FUN_14034fcf0(plVar11);
          iVar12 = iVar5;
          if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
            iVar12 = *(int *)(local_78 + -8);
          }
          iVar7 = iVar6;
          if (((iVar6 <= iVar12) && (iVar7 = iVar5, local_78 != (undefined *)0x0)) &&
             (local_78 != PTR_DAT_1405d8010)) {
            iVar7 = *(int *)(local_78 + -8);
          }
          iVar12 = 1;
          if (1 < iVar7) {
            iVar12 = iVar7;
          }
          iVar7 = iVar5;
          if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
            iVar7 = *(int *)(local_78 + -8);
          }
          if (iVar7 < iVar12) {
            FUN_140002d30(&local_78);
          }
          FUN_140002e10(&local_78);
          puVar10 = local_78;
          if (local_78 == (undefined *)0x0) {
            puVar10 = PTR_DAT_1405d8010;
          }
          FUN_14034fd20(puVar10,plVar11,iVar6);
          puVar10 = local_78;
          if (local_78 == (undefined *)0x0) {
            puVar10 = PTR_DAT_1405d8010;
          }
          iVar6 = FUN_14034fcf0(puVar10);
          iVar12 = 0;
          if (0 < iVar6) {
            iVar12 = iVar6;
          }
          if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) {
            iVar5 = *(int *)(local_78 + -8);
          }
          if ((iVar12 < iVar5) || (iVar12 = 0, local_78 == (undefined *)0x0)) {
LAB_1401bf5be:
            if (((local_78 != PTR_DAT_1405d8010) && (local_78 != (undefined *)0x0)) &&
               ((int *)(local_78 + -8) != (int *)0x0)) {
              *(int *)(local_78 + -8) = iVar12;
              *(undefined2 *)(local_78 + (longlong)iVar12 * 2) = 0;
            }
          }
          else if (local_78 != PTR_DAT_1405d8010) {
            iVar12 = *(int *)(local_78 + -8);
            goto LAB_1401bf5be;
          }
          plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar11 + 0x6d0))
                    (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&DAT_14047ba60,param_2,
                     local_res18,&local_48,local_res20,&local_78);
          puVar10 = local_78;
          if (((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) &&
             (puVar1 = local_78 + -8, puVar1 != (undefined *)0x0)) {
            uVar9 = FUN_14034fe70();
            local_58 = uVar9;
            FUN_14034ed40(uVar9);
            local_50 = 1;
            piVar2 = (int *)(puVar10 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(uVar9);
          }
        }
        if (local_48 != (void *)0x0) {
          operator_delete(local_48);
        }
        local_48 = (void *)0x0;
        local_40 = 0;
        local_38 = 0;
        goto LAB_1401bf6bf;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar13 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar3 == (longlong *)0x0) {
    return 1;
  }
  if (plVar3 != local_60) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bf6bf:
  LOCK();
  plVar3 = plVar3 + 1;
  lVar8 = *plVar3;
  *(int *)plVar3 = (int)*plVar3 + -1;
  UNLOCK();
  if ((int)lVar8 == 1) {
    puVar4 = (undefined8 *)*local_68;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_68);
  }
  return 1;
}



undefined8 FUN_1401bf710(longlong param_1,undefined4 *param_2,undefined8 param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  bool bVar6;
  undefined4 local_res20 [2];
  longlong *local_70;
  longlong *local_68;
  void *local_60;
  undefined8 local_58;
  undefined8 local_50;
  void *local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  FUN_140198570(param_1,&local_70);
  plVar1 = local_70;
  if (local_70 != (longlong *)0x0) {
    if (local_70 == local_68) {
      if (*local_70 != 0) {
        local_40 = (void *)0x0;
        local_38 = 0;
        local_30 = 0;
        local_60 = (void *)0x0;
        local_58 = 0;
        local_50 = 0;
        local_res20[0] = *param_2;
        FUN_1401b63d0(param_1,param_3,local_res20,0,&local_40);
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
        (**(code **)(*plVar5 + 0x6c0))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&DAT_14047ba5c,param_2,param_3
                   ,&local_40);
        FUN_1401b63d0(param_1,param_3,local_res20,1,&local_60);
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
        (**(code **)(*plVar5 + 0x6c0))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&DAT_14047ba60,param_2,param_3
                   ,&local_60);
        if (local_60 != (void *)0x0) {
          operator_delete(local_60);
        }
        local_60 = (void *)0x0;
        local_58 = 0;
        local_50 = 0;
        if (local_40 != (void *)0x0) {
          operator_delete(local_40);
        }
        local_40 = (void *)0x0;
        local_38 = 0;
        local_30 = 0;
        goto LAB_1401bf8bc;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_68) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bf8bc:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_70;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_70);
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  bool bVar6;
  longlong *local_40;
  longlong *local_38;
  void *local_30;
  undefined8 local_28;
  undefined8 local_20;
  
  FUN_140198570(param_1,&local_40,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_40;
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if (*local_40 != 0) {
        local_30 = (void *)0x0;
        local_28 = 0;
        local_20 = 0;
        FUN_140209240(*local_40,&local_30);
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
        (**(code **)(*plVar5 + 0x680))(plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_30)
        ;
        if (local_30 != (void *)0x0) {
          operator_delete(local_30);
        }
        local_30 = (void *)0x0;
        local_28 = 0;
        local_20 = 0;
        goto LAB_1401bf9ff;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_38) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401bf9ff:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_40;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_40);
  }
  return 1;
}



undefined8
FUN_1401bfa40(longlong param_1,int *param_2,undefined8 param_3,ulonglong *param_4,ulonglong *param_5
             )

{
  longlong *plVar1;
  longlong lVar2;
  void *pvVar3;
  undefined8 *puVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  longlong *plVar9;
  bool bVar10;
  undefined8 in_stack_fffffffffffffdb8;
  undefined4 uVar11;
  undefined8 in_stack_fffffffffffffdc0;
  undefined4 *puVar12;
  ulonglong *in_stack_fffffffffffffdc8;
  undefined8 in_stack_fffffffffffffdd0;
  undefined4 *puVar14;
  undefined8 in_stack_fffffffffffffdd8;
  undefined4 *puVar16;
  char local_218 [2];
  undefined2 local_216 [3];
  longlong *local_210;
  longlong *local_208;
  int local_200;
  undefined4 local_1fc;
  undefined4 local_1f8 [2];
  undefined4 local_1f0 [2];
  undefined4 local_1e8 [2];
  longlong *local_1e0;
  longlong *local_1d8;
  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;
  undefined4 local_1a4;
  undefined8 local_1a0;
  ulonglong local_198;
  ulonglong local_190;
  short local_17c;
  ulonglong local_118;
  ulonglong local_110;
  undefined4 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  undefined4 uVar13;
  undefined4 uVar15;
  undefined4 uVar17;
  
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffdc0 >> 0x20);
  uVar15 = (undefined4)((ulonglong)in_stack_fffffffffffffdd0 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffdd8 >> 0x20);
  uVar11 = (undefined4)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
  local_1a0 = 0xfffffffffffffffe;
  FUN_14000a170(local_e8);
  local_40 = 0;
  FUN_140198570(param_1,&local_210);
  plVar9 = local_210;
  if (local_210 == (longlong *)0x0) {
LAB_1401bffc4:
    if (plVar9 == (longlong *)0x0) {
      return 1;
    }
    if (plVar9 != local_208) {
      if (DAT_140608054 != 0) {
        DAT_140608054 = DAT_140608054 + 1;
        return 1;
      }
      DAT_140608054 = DAT_140608054 + 1;
      FUN_140176d60(1);
      return 1;
    }
  }
  else {
    if (local_210 != local_208) {
      iVar6 = DAT_14060804c + 1;
      bVar10 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar10) {
        FUN_140176d60(1);
      }
      goto LAB_1401bffc4;
    }
    if (*local_210 == 0) goto LAB_1401bffc4;
    FUN_140197b70(param_1,&local_1e0);
    plVar1 = local_1e0;
    if (local_1e0 != (longlong *)0x0) {
      if (local_1e0 == local_1d8) {
        if (*local_1e0 != 0) {
          lVar8 = FUN_1402089c0(*plVar9,param_5);
          if (lVar8 == 0) {
            LOCK();
            plVar1 = plVar1 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              pvVar3 = (void *)*local_1e0;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0xf630);
                operator_delete(pvVar3);
              }
              operator_delete(local_1e0);
            }
            LOCK();
            plVar9 = local_210 + 1;
            *(int *)plVar9 = (int)*plVar9 + -1;
            bVar10 = (int)*plVar9 == 0;
            UNLOCK();
          }
          else {
            if ((*(longlong *)(lVar8 + 0x130) == 0) ||
               (lVar2 = *(longlong *)(*(longlong *)(lVar8 + 0x130) + 0x930), lVar2 == 0)) {
              iVar6 = 0;
            }
            else {
              iVar6 = *(int *)(lVar2 + 0x48);
            }
            iVar7 = FUN_1401a5f50(param_1);
            if (iVar7 < iVar6) {
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                pvVar3 = (void *)*local_1e0;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0xf630);
                  operator_delete(pvVar3);
                }
                operator_delete(local_1e0);
              }
              LOCK();
              plVar9 = local_210 + 1;
              *(int *)plVar9 = (int)*plVar9 + -1;
              bVar10 = (int)*plVar9 == 0;
              UNLOCK();
            }
            else {
              FUN_14000a170(&local_198);
              iVar6 = 0;
              local_f0 = 0;
              if (-1 < *param_2) {
                FUN_1401ecce0(*plVar1,param_2,param_3,&local_198);
              }
              bVar10 = local_198 < *param_4;
              if ((local_198 != *param_4) ||
                 (bVar10 = local_190 < param_4[1], iVar7 = iVar6, local_190 != param_4[1])) {
                iVar7 = (1 - (uint)bVar10) - (uint)(bVar10 != 0);
              }
              if (iVar7 == 0) {
                bVar10 = local_118 < *param_5;
                if ((local_118 != *param_5) ||
                   (bVar10 = local_110 < param_5[1], iVar7 = iVar6, local_110 != param_5[1])) {
                  iVar7 = (1 - (uint)bVar10) - (uint)(bVar10 != 0);
                }
                if (iVar7 == 0) {
                  local_218[0] = '\0';
                  cVar5 = FUN_1401b6970(param_1,param_5,local_e8,local_218);
                  if (cVar5 == '\0') {
                    local_1fc = *(undefined4 *)(lVar8 + 0x120);
                    local_1e8[0] = 0;
                    plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
                    (**(code **)(*plVar9 + 0x720))
                              (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_5,local_1e8,
                               local_e8,&local_1fc);
                  }
                  else {
                    if ((*(longlong *)(lVar8 + 0x130) != 0) &&
                       (lVar8 = *(longlong *)(*(longlong *)(lVar8 + 0x130) + 0x930), lVar8 != 0)) {
                      iVar6 = *(int *)(lVar8 + 0x48);
                    }
                    iVar7 = FUN_1401a5f50(param_1);
                    iVar7 = iVar7 - iVar6;
                    if (iVar7 < 0) {
                      iVar7 = 0;
                    }
                    local_200 = iVar7;
                    lVar8 = (**(code **)(*(longlong *)*plVar9 + 0x270))();
                    *(int *)(lVar8 + 0x7c) = iVar7;
                    plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    (**(code **)(*plVar9 + 0x390))
                              (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_200);
                    local_1c0 = *(undefined4 *)(param_1 + 0x170);
                    local_1bc = *(undefined4 *)(param_1 + 0x174);
                    local_1b8 = *(undefined4 *)(param_1 + 0x178);
                    local_1b4 = *(undefined4 *)(param_1 + 0x17c);
                    FUN_1401fc2c0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                                  *(undefined4 *)(param_1 + 0x284),&local_1c0,
                                  CONCAT44(uVar11,local_200));
                    if ((local_218[0] == '\x02') || (local_218[0] == '\x03')) {
                      FUN_1401f6100(*plVar1,param_2,param_3);
                    }
                    FUN_14019a480(param_1,param_2,param_3,param_4);
                    local_1b0 = *(undefined4 *)(param_1 + 0x160);
                    local_1ac = *(undefined4 *)(param_1 + 0x164);
                    local_1a8 = *(undefined4 *)(param_1 + 0x168);
                    local_1a4 = *(undefined4 *)(param_1 + 0x16c);
                    local_1d0 = *(undefined4 *)(param_1 + 0x170);
                    local_1cc = *(undefined4 *)(param_1 + 0x174);
                    local_1c8 = *(undefined4 *)(param_1 + 0x178);
                    local_1c4 = *(undefined4 *)(param_1 + 0x17c);
                    iVar6 = *(int *)(param_1 + 0x284);
                    local_1f0[0] = 0xffffffff;
                    local_1f8[0] = 0xfffffff6;
                    if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                       && (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0
                          )) {
                      local_216[0] = (undefined2)iVar6;
                      plVar9 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar8 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8
                                 ) + 0x70);
                      puVar16 = local_1f0;
                      puVar14 = local_1f8;
                      puVar12 = &local_1b0;
                      (**(code **)(*plVar9 + 0x130))
                                (plVar9,1,&DAT_1405d85a0,local_216,&local_1d0,puVar12,param_4,
                                 puVar14,puVar16);
                      uVar13 = (undefined4)((ulonglong)puVar12 >> 0x20);
                      uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
                      uVar17 = (undefined4)((ulonglong)puVar16 >> 0x20);
                      in_stack_fffffffffffffdc8 = param_4;
                    }
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c6,0x2e,param_1,&local_198,
                                  CONCAT44(uVar13,1),
                                  (ulonglong)in_stack_fffffffffffffdc8 & 0xffffffff00000000,
                                  CONCAT44(uVar15,(int)local_17c),CONCAT44(uVar17,local_17c + -1));
                  }
                }
              }
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                pvVar3 = (void *)*local_1e0;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0xf630);
                  operator_delete(pvVar3);
                }
                operator_delete(local_1e0);
              }
              LOCK();
              plVar9 = local_210 + 1;
              *(int *)plVar9 = (int)*plVar9 + -1;
              bVar10 = (int)*plVar9 == 0;
              UNLOCK();
            }
          }
          goto LAB_1401bfff1;
        }
      }
      else {
        iVar6 = DAT_140608048 + 1;
        bVar10 = DAT_140608048 == 0;
        DAT_140608048 = iVar6;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_1d8) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar8 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        plVar9 = local_210;
        if ((int)lVar8 == 1) {
          pvVar3 = (void *)*local_1e0;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_1e0);
          plVar9 = local_210;
        }
      }
      else {
        iVar6 = DAT_140608050 + 1;
        bVar10 = DAT_140608050 == 0;
        DAT_140608050 = iVar6;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
  }
  LOCK();
  plVar9 = plVar9 + 1;
  *(int *)plVar9 = (int)*plVar9 + -1;
  bVar10 = (int)*plVar9 == 0;
  UNLOCK();
LAB_1401bfff1:
  if (bVar10) {
    puVar4 = (undefined8 *)*local_210;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_210);
  }
  return 1;
}



undefined8
FUN_1401c0030(undefined8 param_1,undefined8 param_2,undefined1 *param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  undefined4 uVar5;
  bool bVar6;
  longlong *local_20;
  longlong *local_18;
  
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_14060944c != '\0') {
    FUN_140198570(param_1,&local_20);
    plVar1 = local_20;
    if (local_20 != (longlong *)0x0) {
      if (local_20 == local_18) {
        if (*local_20 != 0) {
          uVar5 = FUN_140208e30(*local_20,param_2);
          FUN_1401b5ae0(param_1,uVar5,*param_3,*param_4,*param_5,*param_6,*param_7);
          LOCK();
          plVar1 = plVar1 + 1;
          lVar3 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar3 == 1) {
            puVar2 = (undefined8 *)*local_20;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
            }
            operator_delete(local_20);
          }
          return 1;
        }
      }
      else {
        iVar4 = DAT_14060804c + 1;
        bVar6 = DAT_14060804c == 0;
        DAT_14060804c = iVar4;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_18) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar3 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar3 == 1) {
          puVar2 = (undefined8 *)*local_20;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          operator_delete(local_20);
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar6 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return 0;
}



undefined8
FUN_1401c01d0(undefined8 param_1,undefined8 param_2,undefined1 *param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined8 param_7,undefined4 *param_8)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  undefined4 uVar5;
  bool bVar6;
  undefined8 uVar7;
  longlong *local_20;
  longlong *local_18;
  
  uVar7 = 0xfffffffffffffffe;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_14060944c != '\0') {
    FUN_140198570(param_1,&local_20);
    plVar1 = local_20;
    if (local_20 != (longlong *)0x0) {
      if (local_20 == local_18) {
        if (*local_20 != 0) {
          uVar5 = FUN_14020d180(*local_20,param_2);
          FUN_1401b5dc0(param_1,uVar5,*param_3,*param_4,*param_5,*param_6,param_7,*param_8,uVar7);
          LOCK();
          plVar1 = plVar1 + 1;
          lVar3 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar3 == 1) {
            puVar2 = (undefined8 *)*local_20;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
            }
            operator_delete(local_20);
          }
          return 1;
        }
      }
      else {
        iVar4 = DAT_14060804c + 1;
        bVar6 = DAT_14060804c == 0;
        DAT_14060804c = iVar4;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_18) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar3 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar3 == 1) {
          puVar2 = (undefined8 *)*local_20;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          operator_delete(local_20);
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar6 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return 0;
}



undefined8
FUN_1401c0380(undefined8 param_1,undefined8 param_2,int *param_3,int *param_4,undefined4 *param_5)

{
  longlong *plVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 *puVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong *local_30;
  longlong *local_28;
  
  uVar9 = 0xfffffffffffffffe;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_14060944c == '\0') {
    return 0;
  }
  FUN_140198570(param_1,&local_30);
  plVar1 = local_30;
  if (local_30 != (longlong *)0x0) {
    if (local_30 == local_28) {
      if (*local_30 != 0) {
        iVar6 = FUN_140208e30(*local_30,param_2);
        uVar2 = *param_5;
        iVar5 = *param_4;
        iVar3 = *param_3;
        if ((((iVar6 != 0) && (lVar7 = FUN_1401b5430(param_1,iVar6), lVar7 != 0)) &&
            (iVar3 <= (int)(uint)*(byte *)(lVar7 + 0x2041))) &&
           (iVar5 <= (int)(uint)*(byte *)(lVar7 + 0x2041))) {
          FUN_1401f8d10(lVar7,param_1,iVar6,iVar3,iVar5,uVar2,uVar9);
        }
        goto LAB_1401c04b7;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_28) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c04b7:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar7 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar7 == 1) {
    puVar4 = (undefined8 *)*local_30;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_30);
  }
  return 1;
}



bool FUN_1401c0510(undefined8 param_1,undefined4 *param_2,undefined4 *param_3,undefined8 param_4)

{
  bool bVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  bVar1 = DAT_14060944c != '\0';
  if (bVar1) {
    FUN_1401b66c0(param_1,*param_2,*param_3,param_4,uVar2);
  }
  return bVar1;
}



undefined8
FUN_1401c05a0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  undefined4 uVar5;
  bool bVar6;
  undefined8 uVar7;
  longlong *local_20;
  longlong *local_18;
  
  uVar7 = 0xfffffffffffffffe;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_14060944c == '\0') {
    return 0;
  }
  FUN_140198570(param_1,&local_20,param_3,param_4,uVar7);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        uVar5 = FUN_140208e30(*local_20,param_2);
        FUN_1401b6510(param_1,uVar5);
        goto LAB_1401c0676;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c0676:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401c06c0(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined1 local_res18 [8];
  longlong *local_e8;
  longlong *local_e0;
  void *local_d8;
  void *local_d0;
  undefined8 local_c8;
  undefined8 local_b8;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined4 local_80;
  undefined1 local_7c;
  undefined8 local_7b;
  undefined2 local_73;
  undefined8 local_71;
  undefined8 local_69;
  undefined8 local_61;
  undefined8 local_59;
  undefined8 local_51;
  undefined4 local_49;
  undefined4 local_45;
  undefined1 local_41;
  undefined8 local_40;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_e8,param_2);
  plVar1 = local_e8;
  if (local_e8 != (longlong *)0x0) {
    if (local_e8 == local_e0) {
      if (*local_e8 != 0) {
        lVar4 = FUN_1402089c0(*local_e8,param_2);
        if (lVar4 != 0) {
          local_b8 = 0;
          local_b0 = 0;
          local_ac = 0;
          local_a8 = 0;
          local_a4 = 0;
          local_80 = 0;
          local_7c = 0;
          local_7b = 0;
          local_73 = 0;
          local_71 = 0;
          local_69 = 0;
          local_61 = 0;
          local_59 = 0;
          local_51 = 0;
          local_49 = 0;
          local_45 = 0;
          local_41 = 0;
          local_40 = 0;
          local_38 = 0;
          local_34 = 0;
          local_30 = 0;
          local_2c = 0;
          local_28 = 0;
          local_a0 = 0;
          local_98 = 0;
          local_90 = 0;
          local_88 = 0;
          FUN_14020c710(*plVar1,&local_b8,lVar4);
          local_d8 = (void *)0x0;
          local_d0 = (void *)0x0;
          local_c8 = 0;
          FUN_1400d55e0(&local_d8,1);
          if (local_d0 != (void *)0x0) {
            memcpy(local_d0,&local_b8,0x94);
          }
          local_d0 = (void *)((longlong)local_d0 + 0x94);
          local_res18[0] = 1;
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar5 + 0x550))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_d8,local_res18);
          if (local_d8 != (void *)0x0) {
            operator_delete(local_d8);
          }
        }
        goto LAB_1401c08ad;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_e0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c08ad:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_e8;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_e8);
  }
  return 1;
}



// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401c0900(longlong param_1,undefined4 *param_2,ulonglong *param_3,byte *param_4,short *param_5,
             ushort *param_6,char *param_7)

{
  ushort uVar1;
  short sVar2;
  void *pvVar3;
  undefined8 *puVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  undefined4 uVar8;
  int iVar9;
  undefined4 uVar10;
  longlong *plVar11;
  longlong lVar12;
  undefined8 uVar13;
  longlong *plVar14;
  longlong lVar15;
  undefined1 *puVar16;
  undefined4 *puVar17;
  ulonglong *puVar18;
  longlong *plVar19;
  bool bVar20;
  short *psVar21;
  ushort *puVar22;
  undefined4 uVar24;
  undefined4 *puVar23;
  undefined8 in_stack_fffffffffffffd20;
  int *piVar25;
  undefined8 in_stack_fffffffffffffd28;
  undefined4 uVar26;
  longlong *local_2c8;
  longlong *local_2c0;
  uint local_2b8 [2];
  undefined8 *local_2b0;
  undefined8 *local_2a8;
  undefined2 local_2a0;
  undefined2 local_29e;
  undefined2 local_29c;
  undefined2 local_29a;
  int local_298 [2];
  undefined4 local_290 [2];
  int local_288;
  int local_284;
  int local_280;
  int local_27c [3];
  undefined4 local_270 [2];
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined4 local_258;
  undefined4 local_254;
  undefined4 local_250;
  undefined4 local_24c;
  undefined4 local_248;
  undefined4 local_244;
  undefined4 local_240;
  undefined4 local_23c;
  undefined4 local_238;
  undefined4 local_234;
  undefined4 local_230;
  undefined4 local_22c;
  undefined4 local_228;
  undefined4 local_224;
  undefined4 local_220;
  undefined4 local_21c;
  undefined8 local_218;
  undefined8 local_210;
  undefined8 local_208;
  undefined4 local_200;
  undefined4 local_1fc;
  undefined4 local_1f8;
  undefined8 local_1f4;
  undefined8 local_1ec;
  undefined8 local_1e4;
  undefined8 local_1dc;
  ulonglong local_1c8;
  ulonglong local_1c0;
  undefined4 local_1b0;
  short local_1ac [70];
  undefined4 local_120;
  undefined1 local_118 [16];
  undefined1 local_108 [16];
  undefined8 local_f8;
  ulonglong local_f0 [21];
  undefined4 local_48;
  
  uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffd20 >> 0x20);
  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffd28 >> 0x20);
  local_f8 = 0xfffffffffffffffe;
  puVar17 = param_2;
  FUN_140198570(param_1,&local_2c8);
  plVar19 = local_2c8;
  if (local_2c8 != (longlong *)0x0) {
    if (local_2c8 == local_2c0) {
      if (*local_2c8 != 0) {
        local_218 = 0;
        local_210 = 0;
        local_208 = 0;
        iVar6 = 0;
        local_200 = 0;
        local_1fc = 0;
        local_1f8 = 0;
        local_1f4 = 0;
        local_1ec = 0;
        local_1e4 = 0;
        local_1dc = 0;
        plVar11 = (longlong *)FUN_140208860(*local_2c8,*puVar17);
        if (plVar11 != (longlong *)0x0) {
          FUN_140204160(&local_218,plVar11);
          if ((plVar11[0x26] != 0) && (lVar12 = *(longlong *)(plVar11[0x26] + 0x930), lVar12 != 0))
          {
            if ((*(char *)(lVar12 + 0x15) != '\0') &&
               (lVar12 = (**(code **)(*plVar11 + 0x280))(plVar11), *(int *)(lVar12 + 0x78) != 0)) {
              lVar12 = (**(code **)(*plVar11 + 0x280))(plVar11);
              iVar9 = *(int *)(lVar12 + 0x78);
              lVar12 = FUN_1401e0840();
              GetLocalTime((LPSYSTEMTIME)(lVar12 + 200));
              iVar7 = FUN_1401e2290((LPSYSTEMTIME)(lVar12 + 200));
              if (iVar9 < iVar7) goto LAB_1401c13e9;
            }
            FUN_14000a170(&local_1c8);
            local_120 = 0;
            if (*param_7 == '\0') {
              FUN_140197b70(param_1,&local_2b0);
              lVar12 = FUN_140174f00(&local_2b0);
              if (lVar12 == 0) {
                if (local_2b0 != (undefined8 *)0x0) {
                  if (local_2b0 == local_2a8) {
                    LOCK();
                    piVar25 = (int *)(local_2b0 + 1);
                    iVar6 = *piVar25;
                    *piVar25 = *piVar25 + -1;
                    UNLOCK();
                    plVar19 = local_2c8;
                    if (iVar6 == 1) {
                      pvVar3 = (void *)*local_2b0;
                      if (pvVar3 != (void *)0x0) {
                        FUN_14034edf0((longlong)pvVar3 + 0xf630);
                        operator_delete(pvVar3);
                      }
                      operator_delete(local_2b0);
                      plVar19 = local_2c8;
                    }
                  }
                  else {
                    iVar6 = DAT_140608050 + 1;
                    bVar20 = DAT_140608050 == 0;
                    DAT_140608050 = iVar6;
                    if (bVar20) {
                      FUN_140176d60(1);
                    }
                  }
                }
              }
              else {
                uVar1 = *param_6;
                local_2b8[0] = (uint)*param_5;
                lVar12 = FUN_140174f00(&local_2b0);
                if ((local_2b8[0] < 5) && (uVar1 < 0x18)) {
                  lVar12 = ((longlong)(short)uVar1 + (longlong)(int)local_2b8[0] * 0x18) * 0xac +
                           lVar12;
                  *(short *)(lVar12 + 0x14) = (short)local_2b8[0];
                  *(ushort *)(lVar12 + 0x16) = uVar1;
                  FUN_140090020(&local_1c8);
                }
                uVar13 = FUN_140137690();
                uVar8 = FUN_1401375f0(uVar13,local_1b0);
                bVar20 = local_1c8 < *param_3;
                if ((local_1c8 != *param_3) ||
                   (bVar20 = local_1c0 < param_3[1], local_1c0 != param_3[1])) {
                  iVar6 = (1 - (uint)bVar20) - (uint)(bVar20 != 0);
                }
                if ((iVar6 == 0) && ((short)(ushort)*param_4 <= local_1ac[0])) {
                  local_298[0] = 0;
                  cVar5 = FUN_1402107d0(plVar11,uVar8,*param_4,local_298);
                  if (cVar5 == '\0') {
                    if (local_2b0 != (undefined8 *)0x0) {
                      if (local_2b0 == local_2a8) {
                        LOCK();
                        piVar25 = (int *)(local_2b0 + 1);
                        iVar6 = *piVar25;
                        *piVar25 = *piVar25 + -1;
                        UNLOCK();
                        plVar19 = local_2c8;
                        if (iVar6 == 1) {
                          pvVar3 = (void *)*local_2b0;
                          if (pvVar3 != (void *)0x0) {
                            FUN_14034edf0((longlong)pvVar3 + 0xf630);
                            operator_delete(pvVar3);
                          }
                          operator_delete(local_2b0);
                          plVar19 = local_2c8;
                        }
                      }
                      else {
                        iVar6 = DAT_140608050 + 1;
                        bVar20 = DAT_140608050 == 0;
                        DAT_140608050 = iVar6;
                        if (bVar20) {
                          FUN_140176d60(1);
                        }
                      }
                    }
                  }
                  else {
                    FUN_1401b74c0(param_1,*param_2,1,local_1b0);
                    if (*(longlong *)(param_1 + 0xb50) != 0) {
                      FUN_140203e10(*(longlong *)(param_1 + 0xb50),0x1f9,param_1,plVar11,&local_218)
                      ;
                    }
                    local_1ac[0] = local_1ac[0] - (ushort)*param_4;
                    plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    puVar18 = (ulonglong *)local_1ac;
                    psVar21 = param_5;
                    puVar22 = param_6;
                    (**(code **)(*plVar14 + 0x290))
                              (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1c8,
                               param_5,param_6,puVar18);
                    uVar24 = (undefined4)((ulonglong)puVar22 >> 0x20);
                    uVar8 = (undefined4)((ulonglong)psVar21 >> 0x20);
                    if (local_1ac[0] < 1) {
                      local_238 = *(undefined4 *)(param_1 + 0x160);
                      local_234 = *(undefined4 *)(param_1 + 0x164);
                      local_230 = *(undefined4 *)(param_1 + 0x168);
                      local_22c = *(undefined4 *)(param_1 + 0x16c);
                      local_248 = *(undefined4 *)(param_1 + 0x170);
                      local_244 = *(undefined4 *)(param_1 + 0x174);
                      local_240 = *(undefined4 *)(param_1 + 0x178);
                      local_23c = *(undefined4 *)(param_1 + 0x17c);
                      iVar6 = *(int *)(param_1 + 0x284);
                      local_270[0] = 0xffffffff;
                      local_27c[1] = 0xfffffff6;
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar12 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar12 != 0)) {
                        local_29a = (undefined2)iVar6;
                        plVar14 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar12 + 8) +
                                    (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        puVar17 = local_270;
                        piVar25 = local_27c + 1;
                        puVar18 = &local_1c8;
                        puVar23 = &local_238;
                        (**(code **)(*plVar14 + 0x130))
                                  (plVar14,1,&DAT_1405d85a0,&local_29a,&local_248,puVar23,puVar18,
                                   piVar25,puVar17);
                        uVar24 = (undefined4)((ulonglong)puVar23 >> 0x20);
                        uVar10 = (undefined4)((ulonglong)piVar25 >> 0x20);
                        uVar26 = (undefined4)((ulonglong)puVar17 >> 0x20);
                      }
                      local_280 = (int)(short)*param_6;
                      local_288 = (int)*param_5;
                      uVar13 = FUN_140174f00(&local_2b0);
                      FUN_1401e9d60(uVar13,param_1,&local_288,&local_280,&local_1c8);
                    }
                    else {
                      local_284 = (int)(short)*param_6;
                      sVar2 = *param_5;
                      local_27c[0] = (int)sVar2;
                      uVar13 = FUN_140174f00(&local_2b0);
                      if (-1 < sVar2) {
                        FUN_1401ed220(uVar13,local_27c,&local_284,&local_1c8,CONCAT44(uVar8,6));
                      }
                      local_228 = *(undefined4 *)(param_1 + 0x160);
                      local_224 = *(undefined4 *)(param_1 + 0x164);
                      local_220 = *(undefined4 *)(param_1 + 0x168);
                      local_21c = *(undefined4 *)(param_1 + 0x16c);
                      local_268 = *(undefined4 *)(param_1 + 0x170);
                      local_264 = *(undefined4 *)(param_1 + 0x174);
                      local_260 = *(undefined4 *)(param_1 + 0x178);
                      local_25c = *(undefined4 *)(param_1 + 0x17c);
                      iVar6 = *(int *)(param_1 + 0x284);
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar12 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar12 != 0)) {
                        local_29c = (undefined2)iVar6;
                        plVar14 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar12 + 8) +
                                    (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        puVar18 = &local_1c8;
                        puVar17 = &local_228;
                        (**(code **)(*plVar14 + 0x140))
                                  (plVar14,1,&DAT_1405d85a0,&local_29c,&local_268,puVar17,puVar18);
                        uVar24 = (undefined4)((ulonglong)puVar17 >> 0x20);
                      }
                    }
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c6,0x2d,param_1,&local_1c8,
                                  CONCAT44(uVar24,(uint)*param_4),
                                  (ulonglong)puVar18 & 0xffffffff00000000,
                                  CONCAT44(uVar10,(int)local_1ac[0] + (uint)*param_4),
                                  CONCAT44(uVar26,(int)local_1ac[0]));
                    if (local_298[0] != 0) {
                      FUN_1401fec90(*(undefined8 *)(param_1 + 0xb50),param_1,plVar11);
                    }
                    if (local_2b0 != (undefined8 *)0x0) {
                      if (local_2b0 == local_2a8) {
                        LOCK();
                        piVar25 = (int *)(local_2b0 + 1);
                        iVar6 = *piVar25;
                        *piVar25 = *piVar25 + -1;
                        UNLOCK();
                        plVar19 = local_2c8;
                        if (iVar6 == 1) {
                          pvVar3 = (void *)*local_2b0;
                          if (pvVar3 != (void *)0x0) {
                            FUN_14034edf0((longlong)pvVar3 + 0xf630);
                            operator_delete(pvVar3);
                          }
                          operator_delete(local_2b0);
                          plVar19 = local_2c8;
                        }
                      }
                      else {
                        iVar6 = DAT_140608050 + 1;
                        bVar20 = DAT_140608050 == 0;
                        DAT_140608050 = iVar6;
                        if (bVar20) {
                          FUN_140176d60(1);
                        }
                      }
                    }
                  }
                }
                else if (local_2b0 != (undefined8 *)0x0) {
                  if (local_2b0 == local_2a8) {
                    LOCK();
                    piVar25 = (int *)(local_2b0 + 1);
                    iVar6 = *piVar25;
                    *piVar25 = *piVar25 + -1;
                    UNLOCK();
                    plVar19 = local_2c8;
                    if (iVar6 == 1) {
                      pvVar3 = (void *)*local_2b0;
                      if (pvVar3 != (void *)0x0) {
                        FUN_14034edf0((longlong)pvVar3 + 0xf630);
                        operator_delete(pvVar3);
                      }
                      operator_delete(local_2b0);
                      plVar19 = local_2c8;
                    }
                  }
                  else {
                    iVar6 = DAT_140608050 + 1;
                    bVar20 = DAT_140608050 == 0;
                    DAT_140608050 = iVar6;
                    if (bVar20) {
                      FUN_140176d60(1);
                    }
                  }
                }
              }
            }
            else {
              lVar12 = FUN_1401b5430(param_1,*param_2);
              if (lVar12 != 0) {
                uVar1 = *param_6;
                if ((uVar1 < 0x18) && ((short)uVar1 < (short)(ushort)*(byte *)(lVar12 + 0x2041))) {
                  lVar15 = ((longlong)(short)uVar1 + 0x18) * 0xac + lVar12;
                  iVar9 = FUN_14011b180(lVar15);
                  if (iVar9 == 0) {
                    FUN_140090020(&local_1c8,lVar15);
                  }
                }
                uVar13 = FUN_140137690();
                uVar10 = FUN_1401375f0(uVar13,local_1b0);
                bVar20 = local_1c8 < *param_3;
                if ((local_1c8 == *param_3) &&
                   (bVar20 = local_1c0 < param_3[1], local_1c0 == param_3[1])) {
                  iVar9 = 0;
                }
                else {
                  iVar9 = (1 - (uint)bVar20) - (uint)(bVar20 != 0);
                }
                if ((iVar9 == 0) && ((short)(ushort)*param_4 <= local_1ac[0])) {
                  local_2b8[0] = 0;
                  cVar5 = FUN_1402107d0(plVar11,uVar10,*param_4,local_2b8);
                  if (cVar5 != '\0') {
                    FUN_1401b74c0(param_1,*param_2,1,0);
                    if (*(longlong *)(param_1 + 0xb50) != 0) {
                      FUN_140203e10(*(longlong *)(param_1 + 0xb50),0x1f9,param_1,plVar11,&local_218)
                      ;
                    }
                    local_1ac[0] = local_1ac[0] - (ushort)*param_4;
                    if (local_1ac[0] < 1) {
                      iVar6 = *(int *)(param_1 + 0x284);
                      local_290[0] = *(undefined4 *)(param_1 + 8);
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar15 != 0)) {
                        local_2a0 = (undefined2)iVar6;
                        plVar14 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar15 + 8) +
                                    (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        (**(code **)(*plVar14 + 0xbb0))
                                  (plVar14,1,&DAT_1405d85a0,&local_2a0,local_290,plVar11 + 0x1f6,
                                   &local_1c8);
                      }
                      FUN_1401f6df0(lVar12,1,(int)(short)*param_6,&local_1c8);
                      FUN_140209090(*plVar19,local_108,*param_2);
                      FUN_14000a170(local_f0);
                      local_48 = 0;
                      puVar18 = local_f0;
                      puVar16 = local_108;
                    }
                    else {
                      uVar1 = *param_6;
                      if ((uVar1 < 0x18) &&
                         ((short)uVar1 < (short)(ushort)*(byte *)(lVar12 + 0x2041))) {
                        puVar18 = (ulonglong *)(((longlong)(short)uVar1 + 0x18) * 0xac + lVar12);
                        bVar20 = *puVar18 < local_1c8;
                        if ((*puVar18 != local_1c8) ||
                           (bVar20 = puVar18[1] < local_1c0, puVar18[1] != local_1c0)) {
                          iVar6 = (1 - (uint)bVar20) - (uint)(bVar20 != 0);
                        }
                        if (iVar6 == 0) {
                          FUN_140090020(puVar18,&local_1c8);
                        }
                      }
                      local_258 = *(undefined4 *)(param_1 + 0x160);
                      local_254 = *(undefined4 *)(param_1 + 0x164);
                      local_250 = *(undefined4 *)(param_1 + 0x168);
                      local_24c = *(undefined4 *)(param_1 + 0x16c);
                      iVar6 = *(int *)(param_1 + 0x284);
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar12 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar12 != 0)) {
                        local_29e = (undefined2)iVar6;
                        plVar14 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar12 + 8) +
                                    (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        (**(code **)(*plVar14 + 0xc00))
                                  (plVar14,1,&DAT_1405d85a0,&local_29e,plVar11 + 0x1f6,&local_258,
                                   &local_1c8);
                      }
                      FUN_140209090(*plVar19,local_118,*param_2);
                      puVar18 = &local_1c8;
                      puVar16 = local_118;
                    }
                    plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    (**(code **)(*plVar14 + 0xa70))
                              (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&DAT_14047ba60,
                               puVar16,param_2,param_6,puVar18);
                    if (local_2b8[0] != 0) {
                      FUN_1401fec90(*(undefined8 *)(param_1 + 0xb50),param_1,plVar11);
                    }
                  }
                }
              }
            }
          }
        }
        goto LAB_1401c13e9;
      }
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar20 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar19 == (longlong *)0x0) {
    return 1;
  }
  if (plVar19 != local_2c0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c13e9:
  LOCK();
  plVar19 = plVar19 + 1;
  *(int *)plVar19 = (int)*plVar19 + -1;
  UNLOCK();
  if ((int)*plVar19 == 0) {
    puVar4 = (undefined8 *)*local_2c8;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_2c8);
  }
  return 1;
}



undefined8 FUN_1401c1430(longlong param_1,undefined4 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  undefined1 uVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  size_t sVar7;
  wchar_t *_Src;
  wchar_t *_Src_00;
  bool bVar8;
  undefined1 local_res20 [8];
  undefined1 local_118;
  undefined1 local_117 [15];
  undefined4 local_108;
  undefined4 uStack_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  wchar_t local_f0 [16];
  undefined4 local_d0;
  undefined1 local_cc;
  undefined8 local_cb;
  undefined2 local_c3;
  undefined8 local_c1;
  undefined8 local_b9;
  undefined8 local_b1;
  undefined8 local_a9;
  undefined8 local_a1;
  undefined4 local_99;
  undefined4 local_95;
  undefined1 local_91;
  undefined8 local_90;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  longlong *local_68;
  longlong *local_60;
  undefined **local_58;
  longlong *local_50;
  longlong local_48;
  ulonglong local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_68);
  plVar1 = local_68;
  if (local_68 != (longlong *)0x0) {
    if (local_68 == local_60) {
      if (*local_68 != 0) {
        plVar5 = (longlong *)FUN_140208860(*local_68,*param_3);
        if (plVar5 != (longlong *)0x0) {
          lVar6 = (**(code **)(*plVar5 + 0x280))(plVar5);
          local_d0 = 0;
          local_cc = 0;
          local_cb = 0;
          local_c3 = 0;
          local_c1 = 0;
          local_b9 = 0;
          local_b1 = 0;
          local_a9 = 0;
          local_a1 = 0;
          local_99 = 0;
          local_95 = 0;
          local_91 = 0;
          local_90 = 0;
          local_88 = 0;
          local_84 = 0;
          local_80 = 0;
          local_7c = 0;
          local_78 = 0;
          local_f0[0] = L'\0';
          local_f0[1] = L'\0';
          local_f0[2] = L'\0';
          local_f0[3] = L'\0';
          local_f0[4] = L'\0';
          local_f0[5] = L'\0';
          local_f0[6] = L'\0';
          local_f0[7] = L'\0';
          local_f0[8] = L'\0';
          local_f0[9] = L'\0';
          local_f0[10] = L'\0';
          local_f0[0xb] = L'\0';
          local_f0[0xc] = L'\0';
          local_f0[0xd] = L'\0';
          local_f0[0xe] = L'\0';
          local_f0[0xf] = L'\0';
          _local_108 = CONCAT44((int)plVar5[0x25],*(undefined4 *)(*plVar1 + 0x128));
          local_100 = (undefined4)plVar5[0x1f6];
          local_fc = *(undefined4 *)((longlong)plVar5 + 0xfb4);
          local_f8 = (undefined4)plVar5[0x1f7];
          local_f4 = *(undefined4 *)((longlong)plVar5 + 0xfbc);
          _Src_00 = (wchar_t *)(plVar5 + 0x1a);
          _Src = _Src_00;
          if (7 < (ulonglong)plVar5[0x1d]) {
            _Src = *(wchar_t **)_Src_00;
          }
          sVar7 = wcsnlen(_Src,0x10);
          if (0xf < sVar7) {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar6 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar6 == 1) {
              puVar2 = (undefined8 *)*local_68;
              if (puVar2 != (undefined8 *)0x0) {
                (**(code **)*puVar2)(puVar2,1);
              }
              operator_delete(local_68);
            }
            return 0;
          }
          if (7 < (ulonglong)plVar5[0x1d]) {
            _Src_00 = *(wchar_t **)_Src_00;
          }
          wcscpy_s(local_f0,0x10,_Src_00);
          local_d0 = (undefined4)plVar5[0x24];
          local_cc = FUN_1402f8580(plVar5);
          local_cb = *(undefined8 *)(lVar6 + 0x50);
          local_c3 = *(undefined2 *)(lVar6 + 0x68);
          local_c1 = *(undefined8 *)(lVar6 + 0x70);
          local_b9 = CONCAT44(*(undefined4 *)(lVar6 + 0x84),*(undefined4 *)(lVar6 + 0x78));
          local_b1 = *(undefined8 *)(lVar6 + 0x88);
          local_a9 = *(undefined8 *)(lVar6 + 0x90);
          local_a1 = *(undefined8 *)(lVar6 + 0x98);
          local_99 = *(undefined4 *)(lVar6 + 0xa0);
          local_95 = *(undefined4 *)(lVar6 + 0xa4);
          local_91 = *(undefined1 *)(lVar6 + 0x80);
          local_90 = *(undefined8 *)(lVar6 + 0xa8);
          local_88 = *(undefined4 *)(lVar6 + 0xb0);
          local_84 = *(undefined4 *)(lVar6 + 0xb4);
          local_80 = *(undefined4 *)(lVar6 + 0xb8);
          local_7c = *(undefined4 *)(lVar6 + 0xbc);
          local_78 = *(undefined4 *)(lVar6 + 0xc0);
          if (*(longlong *)(param_1 + 0xb58) == 0) {
            local_58 = Proud::CFastArray<>::vftable;
            local_50 = (longlong *)0x0;
            local_48 = 0;
            local_40 = 0;
            local_38 = 0;
            iVar4 = (**(code **)(*(longlong *)*plVar1 + 0xae8))((longlong *)*plVar1,&local_58);
            uVar3 = (undefined1)*(undefined4 *)(lVar6 + 0x7c);
            if (iVar4 < 1) {
              plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
              local_117[0] = uVar3;
              (**(code **)(*plVar5 + 0x7a0))(plVar5,param_2,&DAT_1405d85a0,&local_108,local_117);
            }
            else {
              lVar6 = local_48;
              if ((int)local_40 == 0) {
                lVar6 = 0;
              }
              plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
              local_118 = uVar3;
              (**(code **)(*plVar5 + 0x798))
                        (plVar5,lVar6,local_40 & 0xffffffff,&DAT_1405d85a0,&local_108,&local_118);
            }
            local_58 = Proud::CFastArray<>::vftable;
            if (local_48 != 0) {
              if (local_50 == (longlong *)0x0) {
                FUN_14034ff60();
              }
              else {
                (**(code **)(*local_50 + 0x18))(local_50,local_48);
              }
            }
          }
          else {
            local_res20[0] = (undefined1)*(undefined4 *)(lVar6 + 0x7c);
            plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar5 + 0x7a0))
                      (plVar5,*(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 8),&DAT_1405d85a0,
                       &local_108,local_res20);
          }
        }
        goto LAB_1401c1872;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_60) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c1872:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    puVar2 = (undefined8 *)*local_68;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_68);
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined4 *puVar8;
  bool bVar9;
  undefined2 local_88 [4];
  undefined8 local_80;
  longlong *local_78;
  longlong *local_70;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined **local_58;
  longlong *local_50;
  longlong local_48;
  ulonglong local_40;
  undefined8 local_38;
  
  local_80 = 0xfffffffffffffffe;
  puVar8 = param_4;
  FUN_140198570(param_1,&local_78);
  plVar1 = local_78;
  if (local_78 != (longlong *)0x0) {
    if (local_78 == local_70) {
      if (*local_78 != 0) {
        plVar4 = (longlong *)FUN_140208860(*local_78,*puVar8);
        if ((((plVar4 != (longlong *)0x0) &&
             (lVar5 = (**(code **)(*plVar4 + 0x280))(plVar4), *(char *)(lVar5 + 0x80) != '\x01')) &&
            (lVar5 = *(longlong *)(plVar4[0x26] + 0x930), lVar5 != 0)) &&
           (*(char *)(lVar5 + 0x14) != '\0')) {
          if (*(longlong *)(param_1 + 0xb58) == 0) {
            local_58 = Proud::CFastArray<>::vftable;
            local_50 = (longlong *)0x0;
            local_48 = 0;
            local_40 = 0;
            local_38 = 0;
            iVar3 = (**(code **)(*(longlong *)*plVar1 + 0xae8))((longlong *)*plVar1,&local_58);
            if (iVar3 < 1) {
              plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
              (**(code **)(*plVar7 + 0x800))
                        (plVar7,param_2,&DAT_1405d85a0,param_3,param_4,plVar4 + 0x1f6);
            }
            else {
              lVar6 = local_48;
              if ((int)local_40 == 0) {
                lVar6 = 0;
              }
              plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
              (**(code **)(*plVar7 + 0x7f8))
                        (plVar7,lVar6,local_40 & 0xffffffff,&DAT_1405d85a0,param_3,param_4,
                         plVar4 + 0x1f6);
            }
            local_58 = Proud::CFastArray<>::vftable;
            if (local_48 != 0) {
              if (local_50 == (longlong *)0x0) {
                FUN_14034ff60();
              }
              else {
                (**(code **)(*local_50 + 0x18))(local_50,local_48);
              }
            }
          }
          else {
            plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar7 + 0x800))
                      (plVar7,*(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 8),&DAT_1405d85a0,
                       param_3,param_4,plVar4 + 0x1f6);
          }
          lVar6 = (**(code **)(*plVar4 + 0x280))(plVar4);
          *(undefined1 *)(lVar6 + 0x80) = 1;
          FUN_140248ab0(*plVar1,plVar4 + 0x1f6,(int)plVar4[0x25],*(undefined4 *)(lVar5 + 0x34),1);
          if (*(int *)(lVar5 + 0x260) == 1) {
            local_68 = (undefined4)plVar4[0x1f6];
            local_64 = *(undefined4 *)((longlong)plVar4 + 0xfb4);
            local_60 = (undefined4)plVar4[0x1f7];
            local_5c = *(undefined4 *)((longlong)plVar4 + 0xfbc);
            FUN_140208c20(*plVar1,*param_4);
            iVar3 = *(int *)(param_1 + 0x284);
            if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
               (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
              local_88[0] = (undefined2)iVar3;
              plVar4 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                       );
              (**(code **)(*plVar4 + 0x700))(plVar4,1,&DAT_1405d85a0,local_88,&local_68);
            }
          }
        }
        goto LAB_1401c1bab;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_70) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c1bab:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar2 = (undefined8 *)*local_78;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_78);
  }
  return 1;
}



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

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  longlong lVar10;
  undefined8 uVar11;
  longlong *plVar12;
  undefined *puVar13;
  int iVar14;
  longlong lVar15;
  undefined4 *puVar16;
  bool bVar17;
  undefined1 local_f8;
  undefined1 local_f7 [7];
  undefined *local_f0;
  undefined2 local_e8 [4];
  longlong *local_e0;
  longlong *local_d8;
  undefined **local_d0;
  longlong *local_c8;
  longlong local_c0;
  ulonglong local_b8;
  undefined8 local_b0;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined8 local_74;
  undefined8 local_6c;
  undefined8 local_64;
  undefined8 local_5c;
  undefined8 local_48;
  undefined8 local_40;
  undefined1 local_38;
  
  local_48 = 0xfffffffffffffffe;
  puVar16 = param_4;
  FUN_140198570(param_1,&local_e0);
  plVar3 = local_e0;
  if (local_e0 != (longlong *)0x0) {
    if (local_e0 == local_d8) {
      if (*local_e0 != 0) {
        lVar10 = FUN_140208860(*local_e0,*puVar16);
        if ((lVar10 == 0) || (cVar5 = FUN_1401b5650(param_1,*param_4), cVar5 == '\0'))
        goto LAB_1401c20cf;
        lVar15 = *(longlong *)(param_1 + 0xb58);
        FUN_1402082d0(*plVar3,*param_4,0);
        if (lVar15 == 0) {
          local_d0 = Proud::CFastArray<>::vftable;
          local_c8 = (longlong *)0x0;
          local_c0 = 0;
          local_b8 = 0;
          local_b0 = 0;
          iVar6 = (**(code **)(*(longlong *)*plVar3 + 0xae8))((longlong *)*plVar3,&local_d0);
          if (iVar6 < 1) {
            plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar12 + 0x800))
                      (plVar12,param_2,&DAT_1405d85a0,param_3,param_4,lVar10 + 0xfb0);
          }
          else {
            lVar15 = local_c0;
            if ((int)local_b8 == 0) {
              lVar15 = 0;
            }
            plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar12 + 0x7f8))
                      (plVar12,lVar15,local_b8 & 0xffffffff,&DAT_1405d85a0,param_3,param_4,
                       lVar10 + 0xfb0);
          }
          local_d0 = Proud::CFastArray<>::vftable;
          if (local_c0 != 0) {
            if (local_c8 == (longlong *)0x0) {
              FUN_14034ff60();
            }
            else {
              (**(code **)(*local_c8 + 0x18))(local_c8,local_c0);
            }
          }
        }
        else {
          plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar12 + 0x800))
                    (plVar12,*(undefined4 *)(lVar15 + 8),&DAT_1405d85a0,param_3,param_4,
                     lVar10 + 0xfb0);
        }
        if (*(longlong *)(*(longlong *)(lVar10 + 0x130) + 0x930) != 0) {
          local_f8 = 100;
          local_f7[0] = 1;
          plVar12 = (longlong *)(lVar10 + 0xd0);
          if (7 < *(ulonglong *)(lVar10 + 0xe8)) {
            plVar12 = (longlong *)*plVar12;
          }
          FUN_14034fe70();
          local_f0 = PTR_DAT_1405d8010;
          iVar7 = FUN_14034fcf0(plVar12);
          iVar14 = 0;
          iVar6 = iVar14;
          if ((local_f0 != (undefined *)0x0) && (local_f0 != PTR_DAT_1405d8010)) {
            iVar6 = *(int *)(local_f0 + -8);
          }
          iVar9 = 0;
          iVar8 = iVar7;
          if (((iVar7 <= iVar6) && (iVar8 = iVar14, local_f0 != (undefined *)0x0)) &&
             (iVar8 = iVar9, local_f0 != PTR_DAT_1405d8010)) {
            iVar8 = *(int *)(local_f0 + -8);
          }
          iVar6 = 1;
          if (1 < iVar8) {
            iVar6 = iVar8;
          }
          if ((local_f0 != (undefined *)0x0) && (local_f0 != PTR_DAT_1405d8010)) {
            iVar9 = *(int *)(local_f0 + -8);
          }
          if (iVar9 < iVar6) {
            FUN_140002d30(&local_f0);
          }
          FUN_140002e10(&local_f0);
          puVar13 = local_f0;
          if (local_f0 == (undefined *)0x0) {
            puVar13 = PTR_DAT_1405d8010;
          }
          FUN_14034fd20(puVar13,plVar12,iVar7);
          puVar13 = local_f0;
          if (local_f0 == (undefined *)0x0) {
            puVar13 = PTR_DAT_1405d8010;
          }
          iVar7 = FUN_14034fcf0(puVar13);
          iVar6 = 0;
          if (0 < iVar7) {
            iVar6 = iVar7;
          }
          iVar7 = 0;
          if ((local_f0 != (undefined *)0x0) && (iVar7 = 0, local_f0 != PTR_DAT_1405d8010)) {
            iVar7 = *(int *)(local_f0 + -8);
          }
          if ((iVar6 < iVar7) || (iVar6 = 0, local_f0 == (undefined *)0x0)) {
LAB_1401c1f08:
            if (((local_f0 != PTR_DAT_1405d8010) && (local_f0 != (undefined *)0x0)) &&
               ((int *)(local_f0 + -8) != (int *)0x0)) {
              *(int *)(local_f0 + -8) = iVar6;
              *(undefined2 *)(local_f0 + (longlong)iVar6 * 2) = 0;
            }
          }
          else if (local_f0 != PTR_DAT_1405d8010) {
            iVar6 = *(int *)(local_f0 + -8);
            goto LAB_1401c1f08;
          }
          plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar12 + 2000))
                    (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_f0,local_f7,
                     &local_f8);
          puVar13 = local_f0;
          if (((local_f0 != (undefined *)0x0) && (local_f0 != PTR_DAT_1405d8010)) &&
             (puVar1 = local_f0 + -8, puVar1 != (undefined *)0x0)) {
            uVar11 = FUN_14034fe70();
            local_40 = uVar11;
            FUN_14034ed40(uVar11);
            local_38 = 1;
            piVar2 = (int *)(puVar13 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(uVar11);
          }
        }
        local_a8 = *(undefined4 *)(lVar10 + 0xfb0);
        local_a4 = *(undefined4 *)(lVar10 + 0xfb4);
        local_a0 = *(undefined4 *)(lVar10 + 0xfb8);
        local_9c = *(undefined4 *)(lVar10 + 0xfbc);
        local_98 = 0;
        local_90 = 0;
        local_88 = 0;
        local_80 = 0;
        local_7c = 0;
        local_78 = 0;
        local_74 = 0;
        local_6c = 0;
        local_64 = 0;
        local_5c = 0;
        FUN_140203e10(*(undefined8 *)(param_1 + 0xb50),0x1fc,param_1,lVar10,&local_98);
        FUN_140208c20(*plVar3,*param_4);
        iVar6 = *(int *)(param_1 + 0x284);
        if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
           (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)) {
          local_e8[0] = (undefined2)iVar6;
          plVar12 = (longlong *)
                    (*(longlong *)
                      (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar12 + 0x700))(plVar12,1,&DAT_1405d85a0,local_e8,&local_a8);
        }
        goto LAB_1401c20cf;
      }
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar17 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar3 == (longlong *)0x0) {
    return 1;
  }
  if (plVar3 != local_d8) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c20cf:
  LOCK();
  plVar3 = plVar3 + 1;
  lVar10 = *plVar3;
  *(int *)plVar3 = (int)*plVar3 + -1;
  UNLOCK();
  if ((int)lVar10 == 1) {
    puVar4 = (undefined8 *)*local_e0;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_e0);
  }
  return 1;
}



undefined8 FUN_1401c2120(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  longlong lVar7;
  int *piVar8;
  byte bVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  bool bVar13;
  uint local_res18 [2];
  int local_res20 [2];
  int local_58;
  int local_54 [3];
  byte local_48 [9];
  uint local_3f;
  undefined2 local_3b;
  byte local_39;
  longlong *local_38;
  longlong *local_30;
  
  local_54[1] = -2;
  local_54[2] = -1;
  FUN_140198570(param_1,&local_38);
  plVar1 = local_38;
  if (local_38 != (longlong *)0x0) {
    if (local_38 == local_30) {
      if (*local_38 != 0) {
        if (*(longlong **)(param_1 + 0xb58) != (longlong *)0x0) {
          uVar5 = (**(code **)(**(longlong **)(param_1 + 0xb58) + 0x1a8))();
          lVar3 = *param_2;
          uVar12 = local_res18[0];
          uVar11 = local_res18[0];
          uVar10 = local_res18[0];
          uVar6 = local_res18[0];
          if (param_2[1] - lVar3 == 0x10) {
            local_48[0] = 0;
            local_48[1] = 0;
            local_48[2] = 0;
            local_48[3] = 0;
            local_48[4] = 0;
            local_48[5] = 0;
            local_48[6] = 0;
            local_48[7] = 0;
            local_48[8] = 0;
            local_3f = 0;
            local_3b = 0;
            local_39 = 0;
            lVar7 = 0;
            piVar8 = (int *)(&DAT_140477f34 + (longlong)(int)(uVar5 % 6) * 0x40);
            do {
              bVar9 = (byte)uVar5;
              local_48[piVar8[-1]] = *(byte *)(lVar3 + lVar7) ^ bVar9;
              local_48[*piVar8] = *(byte *)(lVar3 + 1 + lVar7) ^ bVar9;
              local_48[piVar8[1]] = *(byte *)(lVar3 + 2 + lVar7) ^ bVar9;
              local_48[piVar8[2]] = *(byte *)(lVar3 + 3 + lVar7) ^ bVar9;
              lVar7 = lVar7 + 4;
              piVar8 = piVar8 + 4;
            } while (lVar7 < 0x10);
            uVar12 = (((uint)local_48[3] * 0x100 + (uint)local_48[2]) * 0x100 + (uint)local_48[1]) *
                     0x100 + (uint)local_48[0] ^ 0xcba7312;
            uVar11 = (((uint)local_48[7] * 0x100 + (uint)local_48[6]) * 0x100 + (uint)local_48[5]) *
                     0x100 + (uint)local_48[4] ^ 0x8ab7a47;
            uVar10 = (((local_3f >> 0x10 & 0xff) * 0x100 + (local_3f >> 8 & 0xff)) * 0x100 +
                     (local_3f & 0xff)) * 0x100 + (uint)local_48[8] ^ 0xe08ca63;
            uVar6 = (((uint)local_39 * 0x100 + (uint)local_3b._1_1_) * 0x100 + (uint)(byte)local_3b)
                    * 0x100 + (local_3f >> 0x18) ^ 0x801f751;
          }
          FUN_1402fc480(*plVar1,local_res18,local_res20,&local_58,local_54);
          if (((((0x14 < (int)(uVar12 - local_res18[0])) || (0x14 < (int)(uVar11 - local_res20[0])))
               || (0x14 < (int)(uVar10 - local_58))) || (0x14 < (int)(uVar6 - local_54[0]))) &&
             ((*(int *)(param_1 + 0x58) = *(int *)(param_1 + 0x58) + 1, 3 < *(int *)(param_1 + 0x58)
              && (FUN_14019c070(param_1,1), 10 < *(int *)(param_1 + 0x58))))) {
            *(undefined1 *)(*plVar1 + 0x20e8) = 1;
          }
        }
        goto LAB_1401c23af;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar13 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_30) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c23af:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_38;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_38);
  }
  return 1;
}



undefined8 FUN_1401c2400(longlong param_1,int *param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined2 local_res8 [8];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_88 [2];
  undefined4 local_80 [2];
  undefined4 local_78 [2];
  undefined4 local_70 [2];
  longlong *local_68;
  longlong *local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  if (*param_2 < 1) {
    return 1;
  }
  FUN_140198570(param_1,&local_68);
  plVar1 = local_68;
  if (local_68 != (longlong *)0x0) {
    if (local_68 == local_60) {
      if ((longlong *)*local_68 != (longlong *)0x0) {
        lVar4 = (**(code **)(*(longlong *)*local_68 + 0x270))();
        if (lVar4 != 0) {
          iVar3 = *param_2;
          *(int *)(lVar4 + 0x6c) = *(int *)(lVar4 + 0x6c) + iVar3;
          local_70[0] = *(undefined4 *)(lVar4 + 0x6c);
          *(int *)(lVar4 + 0x70) = *(int *)(lVar4 + 0x70) + iVar3;
          local_res18[0] = 0;
          local_res20[0] = 0;
          local_48 = *(undefined8 *)(lVar4 + 0x60);
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar5 + 0xa0))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_1 + 8,&local_48,
                     local_70,local_res20,local_res18);
          local_78[0] = *(undefined4 *)(lVar4 + 0x70);
          local_88[0] = *(undefined4 *)(lVar4 + 0x6c);
          local_40 = *(undefined8 *)(lVar4 + 0x60);
          local_80[0] = *(undefined4 *)(lVar4 + 0x5c);
          local_58 = *(undefined4 *)(param_1 + 0x170);
          local_54 = *(undefined4 *)(param_1 + 0x174);
          local_50 = *(undefined4 *)(param_1 + 0x178);
          local_4c = *(undefined4 *)(param_1 + 0x17c);
          iVar3 = *(int *)(param_1 + 0x284);
          if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
            local_res8[0] = (undefined2)iVar3;
            plVar5 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar5 + 0x220))
                      (plVar5,1,&DAT_1405d85a0,local_res8,&local_58,local_80,&local_40,local_88,
                       local_78);
          }
        }
        goto LAB_1401c25f8;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_60) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c25f8:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_68;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_68);
  }
  return 1;
}



undefined8 FUN_1401c2640(longlong param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  void *pvVar3;
  longlong lVar4;
  void *pvVar5;
  void *pvVar6;
  int iVar7;
  undefined4 uVar8;
  longlong lVar9;
  undefined8 uVar10;
  longlong lVar11;
  longlong *plVar12;
  undefined4 *puVar13;
  ulonglong uVar14;
  bool bVar15;
  undefined1 local_res10 [8];
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  longlong *local_80;
  longlong *local_78;
  undefined1 local_70 [16];
  void *local_60;
  void *local_58;
  undefined8 local_50;
  
  FUN_140198570(param_1,&local_80);
  plVar1 = local_80;
  if (local_80 == (longlong *)0x0) {
LAB_1401c283f:
    if (plVar1 == (longlong *)0x0) {
      return 1;
    }
    if (plVar1 != local_78) {
      if (DAT_140608054 != 0) {
        DAT_140608054 = DAT_140608054 + 1;
        return 1;
      }
      DAT_140608054 = DAT_140608054 + 1;
      FUN_140176d60(1);
      return 1;
    }
  }
  else {
    if (local_80 != local_78) {
      iVar7 = DAT_14060804c + 1;
      bVar15 = DAT_14060804c == 0;
      DAT_14060804c = iVar7;
      if (bVar15) {
        FUN_140176d60(1);
      }
      goto LAB_1401c283f;
    }
    if ((longlong *)*local_80 == (longlong *)0x0) goto LAB_1401c283f;
    lVar9 = (**(code **)(*(longlong *)*local_80 + 0x270))();
    if (lVar9 != 0) {
      uVar14 = 0;
      local_60 = (void *)0x0;
      local_58 = (void *)0x0;
      local_50 = 0;
      lVar4 = ((longlong *)*plVar1)[0x24];
      uVar8 = (**(code **)(*(longlong *)*plVar1 + 0x200))();
      uVar10 = FUN_1402ec2c0();
      FUN_1402ebf60(uVar10,(int)lVar4,uVar8,&local_60);
      pvVar5 = local_60;
      lVar4 = (longlong)local_58 - (longlong)local_60 >> 0x3f;
      lVar11 = ((longlong)local_58 - (longlong)local_60) / 0x410 + lVar4;
      if (lVar11 != lVar4) {
        puVar13 = (undefined4 *)((longlong)local_60 + 0x18);
        do {
          FUN_140198d00(param_1,local_70,0,puVar13[0x16] + -1,*puVar13,1);
          local_res10[0] = 0;
          local_res20[0] = *(undefined4 *)(lVar9 + 0x6c);
          local_res18[0] = 1;
          plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar12 + 800))
                    (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_70,puVar13,
                     local_res18,local_res20,local_res10);
          uVar14 = (ulonglong)((int)uVar14 + 1);
          puVar13 = puVar13 + 0x104;
        } while (uVar14 < (ulonglong)(lVar11 - lVar4));
      }
      pvVar6 = local_58;
      pvVar3 = pvVar5;
      if (pvVar5 != (void *)0x0) {
        for (; pvVar3 != pvVar6; pvVar3 = (void *)((longlong)pvVar3 + 0x410)) {
          FUN_1401dfef0(pvVar3);
        }
        operator_delete(pvVar5);
      }
      LOCK();
      plVar1 = plVar1 + 1;
      lVar9 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar9 != 1) {
        return 1;
      }
      puVar2 = (undefined8 *)*local_80;
      plVar1 = local_80;
      goto joined_r0x0001401c287d;
    }
  }
  LOCK();
  plVar1 = plVar1 + 1;
  lVar9 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar9 != 1) {
    return 1;
  }
  puVar2 = (undefined8 *)*local_80;
  plVar1 = local_80;
joined_r0x0001401c287d:
  if (puVar2 != (undefined8 *)0x0) {
    (**(code **)*puVar2)(puVar2,1);
  }
  operator_delete(plVar1);
  return 1;
}



undefined8 FUN_1401c28b0(longlong param_1)

{
  longlong *plVar1;
  void *pvVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  bool bVar9;
  undefined2 local_res8 [4];
  undefined4 local_res10 [2];
  undefined4 local_res18 [2];
  void *local_res20;
  undefined8 uVar10;
  longlong *local_80;
  longlong *local_78;
  longlong local_70;
  char local_68;
  longlong *local_60;
  longlong *local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  longlong *local_40;
  longlong *local_38;
  
  uVar10 = 0xfffffffffffffffe;
  local_70 = 0;
  local_68 = '\0';
  plVar6 = *(longlong **)(param_1 + 0xb28);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar6;
      if (lVar5 != 0) {
        if ((plVar6 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar5 = 0, DAT_1406080a8 = iVar4,
           bVar9)) {
          FUN_140176d60(1);
        }
        local_68 = 0;
        local_70 = lVar5;
        FUN_14034ed40(lVar5);
        local_68 = '\x01';
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (99 < *(int *)(param_1 + 0x298)) {
    local_50 = *(undefined4 *)(param_1 + 0x170);
    local_4c = *(undefined4 *)(param_1 + 0x174);
    local_48 = *(undefined4 *)(param_1 + 0x178);
    local_44 = *(undefined4 *)(param_1 + 0x17c);
    iVar4 = *(int *)(param_1 + 0x284);
    local_res10[0] = *(undefined4 *)(param_1 + 8);
    if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
       (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
      local_res8[0] = (undefined2)iVar4;
      plVar6 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar6 + 0x1080))
                (plVar6,1,&DAT_1405d85a0,local_res8,local_res10,&local_50,uVar10);
    }
    FUN_140198570(param_1,&local_80);
    plVar6 = *(longlong **)(param_1 + 0x9a0);
    local_60 = plVar6;
    local_58 = plVar6;
    if (plVar6 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar6 + 1) = (int)plVar6[1] + 1;
      UNLOCK();
      if (*plVar6 != 0) {
        FUN_14025d2b0();
      }
    }
    plVar1 = *(longlong **)(param_1 + 0x9b0);
    local_40 = plVar1;
    local_38 = plVar1;
    if (plVar1 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
      UNLOCK();
      plVar6 = local_60;
      if (*plVar1 != 0) {
        FUN_14025f0a0(*plVar1,param_1);
      }
    }
    plVar8 = local_80;
    if (local_80 != (longlong *)0x0) {
      if (local_80 == local_78) {
        if (*local_80 != 0) {
          FUN_1402d6b80();
          lVar5 = (**(code **)(*(longlong *)*plVar8 + 0x270))();
          local_res18[0] = *(undefined4 *)(lVar5 + 0x6c);
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar7 + 0x580))
                    (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18);
        }
      }
      else {
        iVar4 = DAT_14060804c + 1;
        bVar9 = DAT_14060804c == 0;
        DAT_14060804c = iVar4;
        if (bVar9) {
          FUN_140176d60(1);
        }
      }
    }
    plVar7 = local_40;
    if (plVar1 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar5 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      plVar6 = local_60;
      plVar8 = local_80;
      if ((int)lVar5 == 1) {
        pvVar2 = (void *)*local_40;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0x4b18);
          operator_delete(pvVar2);
        }
        operator_delete(plVar7);
        plVar6 = local_60;
        plVar8 = local_80;
      }
    }
    plVar1 = local_60;
    if (plVar6 != (longlong *)0x0) {
      LOCK();
      plVar6 = plVar6 + 1;
      lVar5 = *plVar6;
      *(int *)plVar6 = (int)*plVar6 + -1;
      UNLOCK();
      plVar8 = local_80;
      if ((int)lVar5 == 1) {
        pvVar2 = (void *)*local_60;
        local_res20 = pvVar2;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0x90);
          FUN_14025e6b0((longlong)pvVar2 + 0x48);
          FUN_14025e600(pvVar2);
          operator_delete(pvVar2);
        }
        operator_delete(plVar1);
        plVar8 = local_80;
      }
    }
    if (plVar8 != (longlong *)0x0) {
      if (plVar8 == local_78) {
        LOCK();
        plVar8 = plVar8 + 1;
        *(int *)plVar8 = (int)*plVar8 + -1;
        UNLOCK();
        if ((int)*plVar8 == 0) {
          puVar3 = (undefined8 *)*local_80;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(local_80);
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar9 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar9) {
          FUN_140176d60(1);
        }
      }
    }
  }
  if (local_68 != '\0') {
    FUN_14034edd0(local_70);
  }
  return 1;
}



undefined8 FUN_1401c2be0(longlong param_1,uint *param_2,undefined4 *param_3,undefined4 *param_4)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    uVar1 = *param_2;
    lVar2 = FUN_140137690();
    if (*(longlong *)(lVar2 + 0x88) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0xa6)) {
        if ((puVar3[0xa8] == uVar1) && (*puVar3 == uVar1)) {
          if (puVar3 != (uint *)0x0) goto LAB_1401c2c62;
          break;
        }
      }
    }
    puVar3 = (uint *)0x0;
LAB_1401c2c62:
    if (puVar3 == (uint *)0x0) {
      uVar1 = 1;
    }
    else {
      uVar1 = puVar3[0x4c];
    }
    FUN_14016f730(*(undefined8 *)(param_1 + 0xb50),param_1,*param_3,*param_4,*param_2,uVar1,0x10,0,0
                  ,0,0,0,0);
  }
  return 1;
}



undefined8 FUN_1401c2ce0(longlong param_1,undefined4 *param_2,uint *param_3)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    uVar1 = *param_3;
    lVar2 = FUN_140137690();
    if (*(longlong *)(lVar2 + 0x88) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0xa6)) {
        if ((puVar3[0xa8] == uVar1) && (*puVar3 == uVar1)) {
          if (puVar3 != (uint *)0x0) goto LAB_1401c2d56;
          break;
        }
      }
    }
    puVar3 = (uint *)0x0;
LAB_1401c2d56:
    if (puVar3 == (uint *)0x0) {
      uVar1 = 1;
    }
    else {
      uVar1 = puVar3[0x4c];
    }
    FUN_14016ff80(*(undefined8 *)(param_1 + 0xb50),param_1,*param_2,*param_3,uVar1);
  }
  return 1;
}



undefined8 FUN_1401c2da0(void)

{
  undefined8 uVar1;
  
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
    _chdir("c:\\GameClient\\table");
    system("svn update");
    system("x.bat");
    _chdir("C:\\work\\GameServer\\Trunk");
    FUN_140291e90(DAT_140607ff0);
    uVar1 = FUN_1402ec2c0();
    FUN_1402eb4c0(uVar1);
    uVar1 = FUN_1402e0270();
    FUN_1402db960(uVar1);
    uVar1 = FUN_1402e07c0();
    FUN_1402e0310(uVar1);
    uVar1 = FUN_140137690();
    FUN_140135080(uVar1);
    uVar1 = FUN_14012f630();
    FUN_14012f440(uVar1);
    uVar1 = FUN_140131520();
    FUN_140131150(uVar1);
    uVar1 = FUN_1401319f0();
    FUN_1401315d0(uVar1);
  }
  return 1;
}



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

{
  char cVar1;
  int iVar2;
  longlong *plVar3;
  
  if (0 < *param_5) {
    iVar2 = FUN_1401a6ae0(param_1,*param_2);
    if ((iVar2 == 0) || (iVar2 == 1)) {
      cVar1 = FUN_1401a6fe0(param_1,*param_3,*param_4,*param_5);
      if (cVar1 != '\0') {
        plVar3 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
        (**(code **)(*plVar3 + 0x30))(plVar3,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_4);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401c2f20(longlong param_1,longlong *param_2,int *param_3)

{
  int *piVar1;
  void *pvVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined *puVar8;
  bool bVar9;
  int local_res8 [2];
  int local_res20 [2];
  undefined4 local_28 [2];
  undefined8 local_20;
  undefined8 *local_18;
  undefined8 *local_10;
  
  local_20 = 0xfffffffffffffffe;
  if ((99 < *(int *)(param_1 + 0x298)) && (0 < *param_3)) {
    puVar8 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1405d8010;
    }
    uVar5 = FUN_140137690();
    local_res8[0] = FUN_140132390(uVar5,puVar8);
    if (0 < local_res8[0]) {
      FUN_140197b70(param_1,&local_18);
      lVar6 = FUN_140174f00(&local_18);
      if (lVar6 != 0) {
        uVar5 = FUN_140137690();
        iVar3 = FUN_140136b30(uVar5,local_res8[0]);
        local_res20[0] = iVar3;
        uVar5 = FUN_140174f00(&local_18);
        if (-1 < iVar3) {
          iVar4 = FUN_1401ed430(uVar5,local_res20,local_28);
          if (iVar4 != 0) {
            FUN_14016f730(*(undefined8 *)(param_1 + 0xb50),param_1,iVar3,local_28[0],local_res8[0],
                          *param_3,0x12,0,0,0,0,0,0);
            plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
            (**(code **)(*plVar7 + 0x30))
                      (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8);
          }
        }
      }
      if (local_18 != (undefined8 *)0x0) {
        if (local_18 == local_10) {
          LOCK();
          piVar1 = (int *)(local_18 + 1);
          iVar3 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (iVar3 == 1) {
            pvVar2 = (void *)*local_18;
            if (pvVar2 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar2 + 0xf630);
              operator_delete(pvVar2);
            }
            operator_delete(local_18);
          }
        }
        else {
          iVar3 = DAT_140608050 + 1;
          bVar9 = DAT_140608050 == 0;
          DAT_140608050 = iVar3;
          if (bVar9) {
            FUN_140176d60(1);
          }
        }
      }
    }
  }
  return 1;
}



undefined8
FUN_1401c30f0(longlong param_1,uint *param_2,int *param_3,undefined4 *param_4,undefined4 *param_5)

{
  uint uVar1;
  uint *puVar2;
  longlong lVar3;
  longlong *plVar4;
  
  uVar1 = *param_2;
  lVar3 = FUN_140137690();
  if (*(longlong *)(lVar3 + 0x88) == 0) {
    return 1;
  }
  puVar2 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                     ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
  while( true ) {
    if (puVar2 == (uint *)0x0) {
      return 1;
    }
    if ((puVar2[0xa8] == uVar1) && (*puVar2 == uVar1)) break;
    puVar2 = *(uint **)(puVar2 + 0xa6);
  }
  if (puVar2 == (uint *)0x0) {
    return 1;
  }
  uVar1 = *param_2;
  lVar3 = FUN_140137690();
  if (uVar1 != 0) {
    if (*(longlong *)(lVar3 + 0x88) != 0) {
      for (puVar2 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xa6)) {
        if ((puVar2[0xa8] == uVar1) && (*puVar2 == uVar1)) {
          if (puVar2 != (uint *)0x0) {
            if (puVar2[0x39] == 6) goto LAB_1401c31ee;
            goto LAB_1401c31e5;
          }
          break;
        }
      }
    }
    if (uVar1 != 1) {
      FUN_1400050f0(L"GetInventoryType Miss : %d",uVar1);
    }
  }
LAB_1401c31e5:
  if (99 < *(int *)(param_1 + 0x298)) {
LAB_1401c31ee:
    if (0 < *param_3) {
      FUN_14016f730(*(undefined8 *)(param_1 + 0xb50),param_1,*param_4,*param_5,*param_2,*param_3,
                    0x12,0,0,0,0,0,0);
      plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
      (**(code **)(*plVar4 + 0x30))(plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2);
    }
  }
  return 1;
}



undefined8 FUN_1401c3280(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  if (99 < *(int *)(param_1 + 0x298)) {
    lVar5 = 0;
    lVar3 = 0;
    lVar9 = 0;
    bVar7 = false;
    uVar10 = 0;
    plVar1 = *(longlong **)(param_1 + 0xb28);
    lVar4 = lVar5;
    if (plVar1 != (longlong *)0x0) {
      lVar4 = lVar3;
      if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
        if (*plVar1 != 0) {
          lVar4 = *plVar1;
          if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
             DAT_1406080a8 = iVar2, bVar7)) {
            FUN_140176d60(1);
          }
          lVar9 = lVar4;
          FUN_14034ed40(lVar4);
          bVar7 = true;
          uVar10 = 1;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar6 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    plVar1 = *(longlong **)(param_1 + 0x9c0);
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
        if (*plVar1 != 0) {
          lVar3 = *plVar1;
          if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
             (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
             DAT_1406080d0 = iVar2, bVar6)) {
            FUN_140176d60(1);
          }
          FUN_14025b870(lVar3,param_1,*param_3,lVar3,uVar8,lVar9,uVar10);
          FUN_1401a6c60(param_1,*param_2,*param_3);
          plVar1 = *(longlong **)(param_1 + 0x9c0);
          if (plVar1 != (longlong *)0x0) {
            if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
              lVar5 = *plVar1;
            }
            else {
              iVar2 = DAT_1406080d0 + 1;
              bVar6 = DAT_1406080d0 == 0;
              DAT_1406080d0 = iVar2;
              if (bVar6) {
                FUN_140176d60(1);
              }
            }
          }
          FUN_14025aa30(lVar5,param_1,*param_3);
        }
      }
      else {
        iVar2 = DAT_1406080d0 + 1;
        bVar6 = DAT_1406080d0 == 0;
        DAT_1406080d0 = iVar2;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    if (bVar7) {
      FUN_14034edd0(lVar4);
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  if (99 < *(int *)(param_1 + 0x298)) {
    lVar5 = 0;
    lVar3 = 0;
    lVar9 = 0;
    bVar7 = false;
    uVar10 = 0;
    plVar1 = *(longlong **)(param_1 + 0xb28);
    lVar4 = lVar5;
    if (plVar1 != (longlong *)0x0) {
      lVar4 = lVar3;
      if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
        if (*plVar1 != 0) {
          lVar4 = *plVar1;
          if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
             DAT_1406080a8 = iVar2, bVar7)) {
            FUN_140176d60(1);
          }
          lVar9 = lVar4;
          FUN_14034ed40(lVar4);
          bVar7 = true;
          uVar10 = 1;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar6 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    plVar1 = *(longlong **)(param_1 + 0x9c0);
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
        lVar3 = *plVar1;
        if (lVar3 != 0) {
          if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
             (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
             DAT_1406080d0 = iVar2, bVar6)) {
            FUN_140176d60(1);
          }
          FUN_14025b870(lVar3,param_1,*param_3,param_4,uVar8,lVar9,uVar10);
          FUN_1401a6c60(param_1,*param_2,*param_3);
        }
      }
      else {
        iVar2 = DAT_1406080d0 + 1;
        bVar6 = DAT_1406080d0 == 0;
        DAT_1406080d0 = iVar2;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    if (bVar7) {
      FUN_14034edd0(lVar4);
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong local_30;
  
  uVar8 = 0xfffffffffffffffe;
  if (99 < *(int *)(param_1 + 0x298)) {
    local_30 = 0;
    bVar7 = false;
    plVar2 = *(longlong **)(param_1 + 0xb28);
    if (plVar2 != (longlong *)0x0) {
      if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
        lVar5 = *plVar2;
        if (lVar5 != 0) {
          if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
             (iVar4 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar5 = 0,
             DAT_1406080a8 = iVar4, bVar7)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40(lVar5);
          bVar7 = true;
          local_30 = lVar5;
        }
      }
      else {
        iVar4 = DAT_1406080a8 + 1;
        bVar6 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar4;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    plVar2 = *(longlong **)(param_1 + 0x9c0);
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
      UNLOCK();
      if (*plVar2 != 0) {
        FUN_14025b510(*plVar2,param_1,param_3,param_4,uVar8);
      }
    }
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar2 + 1;
      lVar5 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar5 == 1) {
        pvVar3 = (void *)*plVar2;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0x48);
          FUN_14025c370((longlong)pvVar3 + 0x20);
          FUN_14025c370(pvVar3);
          operator_delete(pvVar3);
        }
        operator_delete(plVar2);
      }
    }
    if (bVar7) {
      FUN_14034edd0(local_30);
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong local_30;
  
  uVar8 = 0xfffffffffffffffe;
  if (99 < *(int *)(param_1 + 0x298)) {
    local_30 = 0;
    bVar7 = false;
    plVar2 = *(longlong **)(param_1 + 0xb28);
    if (plVar2 != (longlong *)0x0) {
      if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
        lVar5 = *plVar2;
        if (lVar5 != 0) {
          if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
             (iVar4 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar5 = 0,
             DAT_1406080a8 = iVar4, bVar7)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40(lVar5);
          bVar7 = true;
          local_30 = lVar5;
        }
      }
      else {
        iVar4 = DAT_1406080a8 + 1;
        bVar6 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar4;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    plVar2 = *(longlong **)(param_1 + 0x9c0);
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
      UNLOCK();
      if (*plVar2 != 0) {
        FUN_14025b870(*plVar2,param_1,*param_2,param_4,uVar8);
      }
    }
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar2 + 1;
      lVar5 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar5 == 1) {
        pvVar3 = (void *)*plVar2;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0x48);
          FUN_14025c370((longlong)pvVar3 + 0x20);
          FUN_14025c370(pvVar3);
          operator_delete(pvVar3);
        }
        operator_delete(plVar2);
      }
    }
    if (bVar7) {
      FUN_14034edd0(local_30);
    }
  }
  return 1;
}



undefined8 FUN_1401c3880(longlong param_1,undefined4 *param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *plVar3;
  void *pvVar4;
  undefined8 *puVar5;
  longlong lVar6;
  int iVar7;
  undefined8 uVar8;
  ulonglong uVar9;
  longlong *plVar10;
  uint uVar11;
  bool bVar13;
  longlong *local_e8;
  longlong *local_e0;
  longlong *local_d8;
  longlong *local_d0;
  int local_c8 [10];
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined4 local_78;
  undefined8 local_74;
  undefined8 local_6c;
  undefined8 local_64;
  undefined8 local_5c;
  undefined4 local_54;
  undefined4 local_50;
  undefined8 local_4c;
  undefined8 local_44;
  undefined8 local_3c;
  undefined8 local_34;
  undefined4 local_2c;
  undefined8 local_28;
  ulonglong uVar12;
  
  local_28 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_e8);
  plVar10 = local_e8;
  if (local_e8 == (longlong *)0x0) {
LAB_1401c3a87:
    if (plVar10 == (longlong *)0x0) {
      return 1;
    }
    if (plVar10 != local_e0) {
      if (DAT_140608054 != 0) {
        DAT_140608054 = DAT_140608054 + 1;
        return 1;
      }
      DAT_140608054 = DAT_140608054 + 1;
      FUN_140176d60(1);
      return 1;
    }
  }
  else {
    if (local_e8 != local_e0) {
      iVar7 = DAT_14060804c + 1;
      bVar13 = DAT_14060804c == 0;
      DAT_14060804c = iVar7;
      if (bVar13) {
        FUN_140176d60(1);
      }
      goto LAB_1401c3a87;
    }
    if (*local_e8 == 0) goto LAB_1401c3a87;
    plVar3 = *(longlong **)(param_1 + 0x9b0);
    local_d8 = plVar3;
    local_d0 = plVar3;
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
      UNLOCK();
      if (*plVar3 != 0) {
        uVar9 = 0;
        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_50 = 0xffffffff;
        local_4c = 0;
        local_44 = 0;
        local_3c = 0;
        local_34 = 0;
        local_2c = 0;
        local_78 = 0xffffffff;
        local_74 = 0;
        local_6c = 0;
        local_64 = 0;
        local_5c = 0;
        local_54 = 0;
        local_a0 = 0;
        local_98 = 0;
        local_90 = 0;
        local_88 = 0;
        local_80 = 0;
        uVar2 = *(undefined4 *)(*local_e8 + 0x120);
        uVar8 = FUN_1401396f0();
        FUN_140139540(uVar8,uVar2,local_c8,&local_50,&local_78,&local_a0,*param_2);
        uVar12 = uVar9;
        do {
          if (*(int *)((longlong)local_c8 + uVar9) < 1) break;
          FUN_1401a71b0(param_1,*(int *)((longlong)local_c8 + uVar9),
                        *(undefined4 *)((longlong)&local_a0 + uVar9));
          uVar11 = (int)uVar12 + 1;
          uVar12 = (ulonglong)uVar11;
          uVar9 = uVar9 + 4;
        } while ((int)uVar11 < 10);
        plVar10 = local_d8;
        LOCK();
        plVar3 = plVar3 + 1;
        *(int *)plVar3 = (int)*plVar3 + -1;
        UNLOCK();
        if ((int)*plVar3 == 0) {
          pvVar4 = (void *)*local_d8;
          if (pvVar4 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar4 + 0x4b18);
            operator_delete(pvVar4);
          }
          operator_delete(plVar10);
        }
        LOCK();
        plVar10 = local_e8 + 1;
        *(int *)plVar10 = (int)*plVar10 + -1;
        iVar7 = (int)*plVar10;
        UNLOCK();
        goto LAB_1401c3ab2;
      }
    }
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar3 + 1;
      lVar6 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar6 == 1) {
        pvVar4 = (void *)*plVar3;
        if (pvVar4 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar4 + 0x4b18);
          operator_delete(pvVar4);
        }
        operator_delete(plVar3);
        plVar10 = local_e8;
      }
    }
  }
  LOCK();
  plVar10 = plVar10 + 1;
  *(int *)plVar10 = (int)*plVar10 + -1;
  iVar7 = (int)*plVar10;
  UNLOCK();
LAB_1401c3ab2:
  if (iVar7 == 0) {
    puVar5 = (undefined8 *)*local_e8;
    if (puVar5 != (undefined8 *)0x0) {
      (**(code **)*puVar5)(puVar5,1);
    }
    operator_delete(local_e8);
  }
  return 1;
}



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

{
  int iVar1;
  undefined8 uVar2;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    uVar2 = FUN_140137690();
    iVar1 = FUN_140137420(uVar2,*param_6,*param_7);
    if (iVar1 != 0) {
      FUN_14016f730(*(undefined8 *)(param_1 + 0xb50),param_1,*param_4,*param_5,*param_2,*param_3,
                    0x14,*param_6,*param_7,0,0,0,0);
    }
  }
  return 1;
}



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

{
  int iVar1;
  undefined8 uVar2;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    uVar2 = FUN_140137690();
    iVar1 = FUN_140137420(uVar2,*param_6,*param_7);
    if (iVar1 != 0) {
      FUN_14016f730(*(undefined8 *)(param_1 + 0xb50),param_1,*param_4,*param_5,*param_2,*param_3,
                    0x15,*param_6,*param_7,0,0,0,0);
    }
  }
  return 1;
}



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

{
  int iVar1;
  undefined8 uVar2;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    uVar2 = FUN_140137690();
    iVar1 = FUN_140137420(uVar2,*param_6,*param_7);
    if (iVar1 != 0) {
      uVar2 = FUN_140137690();
      iVar1 = FUN_140137420(uVar2,*param_8,*param_9);
      if (iVar1 != 0) {
        FUN_14016f730(*(undefined8 *)(param_1 + 0xb50),param_1,*param_4,*param_5,*param_2,*param_3,
                      0x15,*param_6,*param_7,*param_8,*param_9,0,0);
      }
    }
  }
  return 1;
}



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

{
  int iVar1;
  undefined8 uVar2;
  
  uVar2 = FUN_140137690();
  iVar1 = FUN_140137420(uVar2,*param_4,*param_5);
  if (iVar1 != 0) {
    uVar2 = FUN_140137690();
    iVar1 = FUN_140137420(uVar2,*param_6,*param_7);
    if (iVar1 != 0) {
      uVar2 = FUN_140137690();
      iVar1 = FUN_140137420(uVar2,*param_8,*param_9);
      if (iVar1 != 0) {
        uVar2 = FUN_140174f00(param_1 + 0x6c0);
        FUN_1401f3d90(uVar2,param_1,*param_3,*param_2,*param_4,*param_5,*param_6,*param_7,*param_8,
                      *param_9);
      }
    }
  }
  return 1;
}



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

{
  int iVar1;
  undefined8 uVar2;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    uVar2 = FUN_140137690();
    iVar1 = FUN_140137420(uVar2,*param_6,*param_7);
    if (iVar1 != 0) {
      uVar2 = FUN_140137690();
      iVar1 = FUN_140137420(uVar2,*param_8,*param_9);
      if (iVar1 != 0) {
        uVar2 = FUN_140137690();
        iVar1 = FUN_140137420(uVar2,*param_10,*param_11);
        if (iVar1 != 0) {
          FUN_14016f730(*(undefined8 *)(param_1 + 0xb50),param_1,*param_4,*param_5,*param_2,*param_3
                        ,0x15,*param_6,*param_7,*param_8,*param_9,*param_10,*param_11);
        }
      }
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  undefined8 uVar6;
  longlong *local_20;
  longlong *local_18;
  
  uVar6 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if ((DAT_14060a120 == 1000) && (99 < *(int *)(param_1 + 0x298))) {
    FUN_140198570(param_1,&local_20,param_3,param_4,uVar6);
    plVar1 = local_20;
    if (local_20 != (longlong *)0x0) {
      if (local_20 == local_18) {
        if (*local_20 != 0) {
          FUN_1402f88a0();
        }
      }
      else {
        iVar4 = DAT_14060804c + 1;
        bVar5 = DAT_14060804c == 0;
        DAT_14060804c = iVar4;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
      if (plVar1 == local_18) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar3 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar3 == 1) {
          puVar2 = (undefined8 *)*local_20;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          operator_delete(local_20);
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar5 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return 1;
}



undefined8 FUN_1401c4160(longlong param_1,int *param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  longlong lVar4;
  int iVar5;
  int *piVar6;
  bool bVar7;
  int local_res18 [2];
  int local_res20 [2];
  longlong *local_20;
  longlong *local_18;
  
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if ((DAT_14060a120 == 1000) && (99 < *(int *)(param_1 + 0x298))) {
    FUN_140198570(param_1,&local_20);
    plVar1 = local_20;
    if (local_20 != (longlong *)0x0) {
      if (local_20 == local_18) {
        lVar4 = *local_20;
        if (((lVar4 != 0) && (*(int *)(lVar4 + 0xfd8) != 1)) && (*(int *)(lVar4 + 0xfd8) != 2)) {
          piVar2 = (int *)(lVar4 + 0x5a8);
          iVar5 = *param_2;
          *piVar2 = iVar5;
          local_res18[0] = *(int *)(lVar4 + 0x5ac);
          piVar6 = local_res18;
          if (iVar5 < *(int *)(lVar4 + 0x5ac)) {
            piVar6 = piVar2;
          }
          iVar5 = *piVar6;
          *piVar2 = iVar5;
          local_res20[0] = 0;
          piVar6 = local_res20;
          if (-1 < iVar5) {
            piVar6 = piVar2;
          }
          *piVar2 = *piVar6;
          *(undefined1 *)(lVar4 + 0x10c8) = 1;
        }
      }
      else {
        iVar5 = DAT_14060804c + 1;
        bVar7 = DAT_14060804c == 0;
        DAT_14060804c = iVar5;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
      if (plVar1 == local_18) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar4 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar4 == 1) {
          puVar3 = (undefined8 *)*local_20;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(local_20);
        }
      }
      else {
        iVar5 = DAT_140608054 + 1;
        bVar7 = DAT_140608054 == 0;
        DAT_140608054 = iVar5;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  undefined8 uVar6;
  longlong *local_20;
  longlong *local_18;
  
  uVar6 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if ((DAT_14060a120 == 1000) && (99 < *(int *)(param_1 + 0x298))) {
    FUN_140198570(param_1,&local_20,param_3,param_4,uVar6);
    plVar1 = local_20;
    if (local_20 != (longlong *)0x0) {
      if (local_20 == local_18) {
        lVar3 = *local_20;
        if (lVar3 != 0) {
          FUN_1402f88a0(lVar3,*(uint *)(lVar3 + 0x598) ^ 0x80000000);
        }
      }
      else {
        iVar4 = DAT_14060804c + 1;
        bVar5 = DAT_14060804c == 0;
        DAT_14060804c = iVar4;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
      if (plVar1 == local_18) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar3 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar3 == 1) {
          puVar2 = (undefined8 *)*local_20;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          operator_delete(local_20);
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar5 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return 1;
}



undefined8 FUN_1401c43d0(longlong param_1,uint *param_2)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    uVar1 = *param_2;
    lVar2 = FUN_140302f80();
    if (*(longlong *)(lVar2 + 0x90) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(lVar2 + 0x90) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar2 + 0xa0)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x248)) {
        if ((puVar3[0x24a] == uVar1) && (*puVar3 == uVar1)) {
          if (puVar3 != (uint *)0x0) goto LAB_1401c4439;
          break;
        }
      }
    }
    puVar3 = (uint *)0x0;
LAB_1401c4439:
    if ((puVar3 != (uint *)0x0) && (*(longlong *)(param_1 + 0xb58) != 0)) {
      FUN_140272d90(*(undefined8 *)(*(longlong *)(param_1 + 0xb58) + 0x48),*param_2);
    }
  }
  return 1;
}



undefined8 FUN_1401c4470(longlong param_1)

{
  undefined4 *puVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  undefined4 *puVar5;
  undefined8 uVar6;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 *local_30;
  longlong local_28;
  undefined8 local_20;
  
  uVar6 = 0xfffffffffffffffe;
  if (99 < *(int *)(param_1 + 0x298)) {
    uVar4 = 0;
    local_30 = (undefined4 *)0x0;
    local_28 = 0;
    local_20 = 0;
    uVar2 = FUN_140165ea0();
    FUN_1401654c0(uVar2,&local_30);
    puVar1 = local_30;
    uVar3 = local_28 - (longlong)local_30 >> 2;
    puVar5 = local_30;
    if (uVar3 != 0) {
      do {
        local_40 = *(undefined4 *)(param_1 + 0x170);
        local_3c = *(undefined4 *)(param_1 + 0x174);
        local_38 = *(undefined4 *)(param_1 + 0x178);
        local_34 = *(undefined4 *)(param_1 + 0x17c);
        FUN_1401fd990(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                      *(undefined4 *)(param_1 + 0x284),*(undefined4 *)(param_1 + 8),&local_40,
                      *puVar5,uVar6);
        uVar4 = (ulonglong)((int)uVar4 + 1);
        puVar5 = puVar5 + 1;
      } while (uVar4 < uVar3);
    }
    if (puVar1 != (undefined4 *)0x0) {
      operator_delete(puVar1);
    }
  }
  return 1;
}



undefined8 FUN_1401c4570(longlong param_1,int *param_2)

{
  int iVar1;
  undefined4 *puVar2;
  code *pcVar3;
  bool bVar4;
  undefined4 uVar5;
  uint uVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined4 *puVar9;
  longlong *plVar10;
  uint *puVar11;
  uint *puVar12;
  longlong lVar13;
  undefined4 *puVar14;
  ulonglong uVar15;
  ulonglong uVar16;
  void *pvVar17;
  undefined2 local_res8 [4];
  uint local_res18;
  undefined4 local_res20 [2];
  undefined4 *local_f8;
  undefined4 *local_f0;
  undefined4 *local_e8;
  ulonglong local_d8;
  undefined4 local_d0;
  undefined4 uStack_cc;
  uint local_c8;
  undefined4 local_c4;
  longlong local_c0;
  undefined4 local_b8;
  undefined4 uStack_b4;
  undefined4 local_b0;
  undefined4 uStack_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  void *local_98;
  longlong local_90;
  undefined8 local_88;
  ulonglong local_78;
  uint *local_70;
  ulonglong local_68;
  undefined8 local_60;
  undefined8 local_50;
  undefined1 local_48 [16];
  
  local_50 = 0xfffffffffffffffe;
  if (99 < *(int *)(param_1 + 0x298)) {
    local_98 = (void *)0x0;
    local_90 = 0;
    local_88 = 0;
    uVar7 = FUN_1402e8780();
    FUN_1402e86d0(uVar7);
    local_d8 = *(ulonglong *)(param_1 + 0x170);
    local_d0 = *(undefined4 *)(param_1 + 0x178);
    uStack_cc = *(undefined4 *)(param_1 + 0x17c);
    iVar1 = *(int *)(param_1 + 0x284);
    bVar4 = false;
    if ((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
      if ((local_d8 != 0) || (*(longlong *)(param_1 + 0x178) != 0)) {
        bVar4 = true;
      }
      if ((bVar4) && (lVar13 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar13 != 0))
      {
        local_res8[0] = (undefined2)iVar1;
        plVar10 = (longlong *)
                  (*(longlong *)
                    (*(longlong *)(lVar13 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
        (**(code **)(*plVar10 + 0x5b0))(plVar10,1,&DAT_1405d85a0,local_res8,&local_d8);
      }
    }
    local_res18 = 0;
    local_d8 = local_90 - (longlong)local_98 >> 2;
    local_c0 = 0;
    pvVar17 = local_98;
    if (local_d8 != 0) {
      do {
        lVar13 = local_c0;
        uVar16 = 0;
        local_70 = (uint *)0x0;
        local_68 = 0;
        local_60 = 0;
        uVar6 = *(uint *)((longlong)pvVar17 + local_c0 * 4);
        lVar8 = FUN_1402e8780();
        uVar15 = uVar16;
        if (*(longlong *)(lVar8 + 0x48) != 0) {
          for (puVar12 = *(uint **)(*(longlong *)(lVar8 + 0x48) +
                                   ((ulonglong)uVar6 % (ulonglong)*(uint *)(lVar8 + 0x58)) * 8);
              puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0xc4)) {
            if ((puVar12[0xc6] == uVar6) && (*puVar12 == uVar6)) {
              if (puVar12 != (uint *)0x0) {
                if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                FUN_14012bb70(&local_70);
                uVar15 = local_68;
              }
              break;
            }
          }
        }
        local_78 = (longlong)(uVar15 - (longlong)local_70) >> 2;
        puVar12 = local_70;
        if (local_78 != 0) {
          do {
            local_f8 = (undefined4 *)0x0;
            local_f0 = (undefined4 *)0x0;
            local_e8 = (undefined4 *)0x0;
            uVar6 = *puVar12;
            plVar10 = (longlong *)FUN_1402e07c0();
            puVar9 = local_f8;
            if (*plVar10 != 0) {
              for (puVar11 = *(uint **)(*plVar10 +
                                       ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
                  puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0x16)) {
                if ((puVar11[0x18] == uVar6) && (*puVar11 == uVar6)) {
                  if (puVar11 != (uint *)0x0) {
                    if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    puVar2 = *(undefined4 **)(puVar11 + 6);
                    if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    puVar14 = *(undefined4 **)(puVar11 + 4);
                    goto joined_r0x0001401c47ea;
                  }
                  break;
                }
              }
            }
LAB_1401c4940:
            uVar15 = 0;
            if ((longlong)local_f0 - (longlong)puVar9 >> 2 != 0) {
              lVar13 = 0;
              do {
                local_c4 = *(undefined4 *)((longlong)local_98 + local_c0 * 4);
                uVar6 = *(uint *)(lVar13 + (longlong)puVar9);
                local_c8 = uVar6;
                plVar10 = (longlong *)FUN_1402e0270();
                if (*plVar10 != 0) {
                  for (puVar11 = *(uint **)(*plVar10 +
                                           ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar10 + 2)) *
                                           8); puVar11 != (uint *)0x0;
                      puVar11 = *(uint **)(puVar11 + 0x90)) {
                    if ((puVar11[0x92] == uVar6) && (*puVar11 == uVar6)) {
                      if (puVar11 != (uint *)0x0) {
                        if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        uVar6 = puVar11[0x1a];
                        goto LAB_1401c49c7;
                      }
                      break;
                    }
                  }
                }
                uVar6 = 0;
LAB_1401c49c7:
                if ((int)uVar6 < *param_2) {
                  puVar9 = (undefined4 *)FUN_140357570(local_48);
                  local_a8 = *puVar9;
                  local_a4 = puVar9[1];
                  local_a0 = puVar9[2];
                  local_9c = puVar9[3];
                  local_b8 = *(undefined4 *)(param_1 + 0x170);
                  uStack_b4 = *(undefined4 *)(param_1 + 0x174);
                  local_b0 = *(undefined4 *)(param_1 + 0x178);
                  uStack_ac = *(undefined4 *)(param_1 + 0x17c);
                  iVar1 = *(int *)(param_1 + 0x284);
                  local_res20[0] = 0xff;
                  if ((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                    if ((*(longlong *)(param_1 + 0x170) == 0) &&
                       (*(longlong *)(param_1 + 0x178) == 0)) {
                      bVar4 = false;
                    }
                    else {
                      bVar4 = true;
                    }
                    if ((bVar4) &&
                       (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0))
                    {
                      local_res8[0] = (undefined2)iVar1;
                      plVar10 = (longlong *)
                                (*(longlong *)
                                  (*(longlong *)(lVar8 + 8) +
                                  (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                      (**(code **)(*plVar10 + 0x1a0))
                                (plVar10,1,&DAT_1405d85a0,local_res8,&local_b8,&local_a8,&local_c4,
                                 &local_c8,local_res20);
                    }
                  }
                }
                uVar15 = (ulonglong)((int)uVar15 + 1);
                lVar13 = lVar13 + 4;
                puVar9 = local_f8;
              } while (uVar15 < (ulonglong)((longlong)local_f0 - (longlong)local_f8 >> 2));
            }
            if (puVar9 != (undefined4 *)0x0) {
              operator_delete(puVar9);
            }
            uVar16 = (ulonglong)((int)uVar16 + 1);
            lVar13 = local_c0;
            pvVar17 = local_98;
            puVar12 = puVar12 + 1;
          } while (uVar16 < local_78);
        }
        if (local_70 != (uint *)0x0) {
          operator_delete(local_70);
        }
        local_res18 = local_res18 + 1;
        local_c0 = lVar13 + 1;
      } while (local_res18 < local_d8);
    }
    if (pvVar17 != (void *)0x0) {
      operator_delete(pvVar17);
    }
  }
  return 1;
joined_r0x0001401c47ea:
  if (puVar14 == puVar2) goto LAB_1401c4940;
  if ((puVar14 < local_f0) && (puVar9 <= puVar14)) {
    lVar13 = (longlong)puVar14 - (longlong)puVar9;
    if (local_f0 == local_e8) {
      uVar15 = (longlong)local_f0 - (longlong)puVar9 >> 2;
      if (0x3ffffffffffffffe < uVar15) {
        std::_Xlength_error("vector<T> too long");
        pcVar3 = (code *)swi(3);
        uVar7 = (*pcVar3)();
        return uVar7;
      }
      if ((ulonglong)((longlong)local_e8 - (longlong)puVar9 >> 2) < uVar15 + 1) {
        FUN_140051e60(&local_f8);
        puVar9 = local_f8;
      }
    }
    if (local_f0 != (undefined4 *)0x0) {
      uVar5 = puVar9[lVar13 >> 2];
LAB_1401c4912:
      *local_f0 = uVar5;
      puVar9 = local_f8;
    }
  }
  else {
    if (local_f0 == local_e8) {
      uVar15 = (longlong)local_f0 - (longlong)puVar9 >> 2;
      if (0x3ffffffffffffffe < uVar15) {
        std::_Xlength_error("vector<T> too long");
        pcVar3 = (code *)swi(3);
        uVar7 = (*pcVar3)();
        return uVar7;
      }
      if ((ulonglong)((longlong)local_e8 - (longlong)puVar9 >> 2) < uVar15 + 1) {
        FUN_140051e60(&local_f8);
        puVar9 = local_f8;
      }
    }
    if (local_f0 != (undefined4 *)0x0) {
      uVar5 = *puVar14;
      goto LAB_1401c4912;
    }
  }
  local_f0 = local_f0 + 1;
  puVar14 = puVar14 + 1;
  goto joined_r0x0001401c47ea;
}



undefined8 FUN_1401c4be0(longlong param_1,undefined4 *param_2)

{
  int iVar1;
  longlong lVar2;
  bool bVar3;
  void *pvVar4;
  undefined8 uVar5;
  undefined4 *puVar6;
  ulonglong uVar7;
  longlong *plVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  undefined2 local_res8 [4];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_b0;
  undefined4 uStack_ac;
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined1 local_90 [16];
  void *local_80;
  longlong local_78;
  undefined8 local_70;
  void *local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    local_60 = (void *)0x0;
    local_58 = 0;
    local_50 = 0;
    uVar5 = FUN_1402e8780();
    FUN_1402e86d0(uVar5,&local_60);
    local_b0 = *(undefined4 *)(param_1 + 0x170);
    uStack_ac = *(undefined4 *)(param_1 + 0x174);
    local_a8 = *(undefined4 *)(param_1 + 0x178);
    uStack_a4 = *(undefined4 *)(param_1 + 0x17c);
    iVar1 = *(int *)(param_1 + 0x284);
    if ((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
      if ((*(longlong *)(param_1 + 0x170) == 0) && (*(longlong *)(param_1 + 0x178) == 0)) {
        bVar3 = false;
      }
      else {
        bVar3 = true;
      }
      if ((bVar3) && (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
        local_res8[0] = (undefined2)iVar1;
        plVar8 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                 + 0x70);
        (**(code **)(*plVar8 + 0x5b0))(plVar8,1,&DAT_1405d85a0,local_res8,&local_b0);
      }
    }
    local_80 = (void *)0x0;
    local_78 = 0;
    local_70 = 0;
    FUN_1402e0270();
    FUN_1402dfdf0(*param_2,&local_80);
    pvVar4 = local_80;
    local_res20[0] = 0x66;
    uVar9 = local_78 - (longlong)local_80 >> 2;
    uVar10 = 0;
    if (uVar9 != 0) {
      do {
        puVar6 = (undefined4 *)FUN_140357570(local_90);
        local_a0 = *puVar6;
        local_9c = puVar6[1];
        local_98 = puVar6[2];
        local_94 = puVar6[3];
        local_b0 = *(undefined4 *)(param_1 + 0x170);
        uStack_ac = *(undefined4 *)(param_1 + 0x174);
        local_a8 = *(undefined4 *)(param_1 + 0x178);
        uStack_a4 = *(undefined4 *)(param_1 + 0x17c);
        iVar1 = *(int *)(param_1 + 0x284);
        local_res18[0] = 0xff;
        if ((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
          if ((*(longlong *)(param_1 + 0x170) != 0) ||
             (uVar7 = 0, *(longlong *)(param_1 + 0x178) != 0)) {
            uVar7 = 1;
          }
          if (((int)uVar7 != 0) &&
             (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
            local_res8[0] = (undefined2)iVar1;
            plVar8 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar8 + 0x1a0))
                      (plVar8,1,&DAT_1405d85a0,local_res8,&local_b0,&local_a0,local_res20,
                       (void *)((longlong)pvVar4 + uVar10 * 4),local_res18);
          }
        }
        uVar10 = (ulonglong)((int)uVar10 + 1);
      } while (uVar10 < uVar9);
    }
    if (pvVar4 != (void *)0x0) {
      operator_delete(pvVar4);
    }
    if (local_60 != (void *)0x0) {
      operator_delete(local_60);
    }
  }
  return 1;
}



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

undefined8 FUN_1401c4ea0(longlong param_1)

{
  int iVar1;
  undefined4 *puVar2;
  longlong lVar3;
  code *pcVar4;
  bool bVar5;
  undefined4 uVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined4 *puVar9;
  longlong *plVar10;
  uint *puVar11;
  uint uVar12;
  ulonglong uVar13;
  uint *puVar14;
  uint *puVar15;
  undefined4 *puVar16;
  ulonglong uVar17;
  uint uVar18;
  uint *puVar19;
  ulonglong uVar20;
  undefined2 local_res8 [4];
  uint local_res10;
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 *local_108;
  undefined4 *local_100;
  undefined4 *local_f8;
  ulonglong local_e8;
  undefined4 local_e0;
  undefined4 uStack_dc;
  uint local_d8;
  undefined4 local_d4;
  undefined4 uStack_d0;
  undefined4 local_cc;
  undefined4 uStack_c8;
  uint *local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  uint *local_a8;
  longlong local_a0;
  undefined8 local_98;
  uint *local_88;
  uint *local_80;
  undefined8 local_78;
  undefined8 local_68;
  undefined1 local_60 [32];
  
  local_68 = 0xfffffffffffffffe;
  if (99 < *(int *)(param_1 + 0x298)) {
    local_a8 = (uint *)0x0;
    local_a0 = 0;
    local_98 = 0;
    uVar7 = FUN_1402e8780();
    FUN_1402e86d0(uVar7);
    local_e8 = *(ulonglong *)(param_1 + 0x170);
    local_e0 = *(undefined4 *)(param_1 + 0x178);
    uStack_dc = *(undefined4 *)(param_1 + 0x17c);
    iVar1 = *(int *)(param_1 + 0x284);
    bVar5 = false;
    if ((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
      if ((local_e8 != 0) || (*(longlong *)(param_1 + 0x178) != 0)) {
        bVar5 = true;
      }
      if ((bVar5) && (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0)) {
        local_res8[0] = (undefined2)iVar1;
        plVar10 = (longlong *)
                  (*(longlong *)(*(longlong *)(lVar8 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                  + 0x70);
        (**(code **)(*plVar10 + 0x5b0))(plVar10,1,&DAT_1405d85a0,local_res8,&local_e8);
      }
    }
    local_res10 = 0;
    local_e8 = local_a0 - (longlong)local_a8 >> 2;
    puVar14 = local_a8;
    if (local_e8 != 0) {
      do {
        uVar18 = local_res10;
        local_88 = (uint *)0x0;
        local_80 = (uint *)0x0;
        local_78 = 0;
        uVar12 = *puVar14;
        local_c0 = puVar14;
        lVar8 = FUN_1402e8780();
        if (*(longlong *)(lVar8 + 0x48) != 0) {
          for (puVar11 = *(uint **)(*(longlong *)(lVar8 + 0x48) +
                                   ((ulonglong)uVar12 % (ulonglong)*(uint *)(lVar8 + 0x58)) * 8);
              puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xc4)) {
            if ((puVar11[0xc6] == uVar12) && (*puVar11 == uVar12)) {
              if (puVar11 != (uint *)0x0) goto LAB_1401c503a;
              break;
            }
          }
        }
        puVar11 = (uint *)0x0;
LAB_1401c503a:
        uVar13 = 0;
        puVar15 = (uint *)0x0;
        puVar19 = (uint *)0x0;
        if (puVar11 != (uint *)0x0) {
          FUN_14012bb70(&local_88);
          puVar15 = local_88;
          puVar19 = local_80;
        }
        uVar20 = (longlong)puVar19 - (longlong)puVar15 >> 2;
        puVar11 = puVar15;
        if (uVar20 != 0) {
          do {
            local_108 = (undefined4 *)0x0;
            local_100 = (undefined4 *)0x0;
            local_f8 = (undefined4 *)0x0;
            uVar12 = *puVar15;
            plVar10 = (longlong *)FUN_1402e07c0();
            puVar9 = local_108;
            if (*plVar10 != 0) {
              for (puVar11 = *(uint **)(*plVar10 +
                                       ((ulonglong)uVar12 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
                  puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0x16)) {
                if ((puVar11[0x18] == uVar12) && (*puVar11 == uVar12)) {
                  if (puVar11 != (uint *)0x0) {
                    if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    puVar2 = *(undefined4 **)(puVar11 + 6);
                    if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    puVar16 = *(undefined4 **)(puVar11 + 4);
                    goto joined_r0x0001401c50ff;
                  }
                  break;
                }
              }
            }
LAB_1401c5254:
            uVar12 = 0;
            if ((longlong)local_100 - (longlong)puVar9 >> 2 != 0) {
              lVar8 = 0;
              do {
                local_d8 = *puVar14;
                local_res20[0] = *(undefined4 *)((longlong)puVar9 + lVar8);
                puVar9 = (undefined4 *)FUN_140357570(local_60);
                local_b8 = *puVar9;
                local_b4 = puVar9[1];
                local_b0 = puVar9[2];
                local_ac = puVar9[3];
                local_d4 = *(undefined4 *)(param_1 + 0x170);
                uStack_d0 = *(undefined4 *)(param_1 + 0x174);
                local_cc = *(undefined4 *)(param_1 + 0x178);
                uStack_c8 = *(undefined4 *)(param_1 + 0x17c);
                iVar1 = *(int *)(param_1 + 0x284);
                local_res18[0] = 0xff;
                if ((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                  if ((*(longlong *)(param_1 + 0x170) == 0) && (*(longlong *)(param_1 + 0x178) == 0)
                     ) {
                    bVar5 = false;
                  }
                  else {
                    bVar5 = true;
                  }
                  if ((bVar5) &&
                     (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar3 != 0)) {
                    local_res8[0] = (undefined2)iVar1;
                    plVar10 = (longlong *)
                              (*(longlong *)
                                (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                              + 0x70);
                    (**(code **)(*plVar10 + 0x1a0))
                              (plVar10,1,&DAT_1405d85a0,local_res8,&local_d4,&local_b8,&local_d8,
                               local_res20,local_res18);
                  }
                }
                uVar12 = uVar12 + 1;
                lVar8 = lVar8 + 4;
                puVar9 = local_108;
              } while ((ulonglong)uVar12 <
                       (ulonglong)((longlong)local_100 - (longlong)local_108 >> 2));
            }
            if (puVar9 != (undefined4 *)0x0) {
              operator_delete(puVar9);
            }
            uVar13 = (ulonglong)((int)uVar13 + 1);
            puVar15 = puVar15 + 1;
            puVar11 = local_88;
            uVar18 = local_res10;
          } while (uVar13 < uVar20);
        }
        if (puVar11 != (uint *)0x0) {
          operator_delete(puVar11);
        }
        local_res10 = uVar18 + 1;
        puVar14 = puVar14 + 1;
        local_c0 = puVar14;
      } while (local_res10 < local_e8);
    }
    if (local_a8 != (uint *)0x0) {
      operator_delete(local_a8);
    }
  }
  return 1;
joined_r0x0001401c50ff:
  if (puVar16 == puVar2) goto LAB_1401c5254;
  if ((puVar16 < local_100) && (puVar9 <= puVar16)) {
    lVar8 = (longlong)puVar16 - (longlong)puVar9;
    if (local_100 == local_f8) {
      uVar17 = (longlong)local_100 - (longlong)puVar9 >> 2;
      if (0x3ffffffffffffffe < uVar17) {
        std::_Xlength_error("vector<T> too long");
        pcVar4 = (code *)swi(3);
        uVar7 = (*pcVar4)();
        return uVar7;
      }
      if ((ulonglong)((longlong)local_f8 - (longlong)puVar9 >> 2) < uVar17 + 1) {
        FUN_140051e60(&local_108);
        puVar9 = local_108;
      }
    }
    if (local_100 != (undefined4 *)0x0) {
      uVar6 = puVar9[lVar8 >> 2];
LAB_1401c5222:
      *local_100 = uVar6;
      puVar9 = local_108;
    }
  }
  else {
    if (local_100 == local_f8) {
      uVar17 = (longlong)local_100 - (longlong)puVar9 >> 2;
      if (0x3ffffffffffffffe < uVar17) {
        std::_Xlength_error("vector<T> too long");
        pcVar4 = (code *)swi(3);
        uVar7 = (*pcVar4)();
        return uVar7;
      }
      if ((ulonglong)((longlong)local_f8 - (longlong)puVar9 >> 2) < uVar17 + 1) {
        FUN_140051e60(&local_108);
        puVar9 = local_108;
      }
    }
    if (local_100 != (undefined4 *)0x0) {
      uVar6 = *puVar16;
      goto LAB_1401c5222;
    }
  }
  local_100 = local_100 + 1;
  puVar16 = puVar16 + 1;
  puVar14 = local_c0;
  goto joined_r0x0001401c50ff;
}



// WARNING: Type propagation algorithm not settling

undefined8 FUN_1401c5470(longlong param_1,int *param_2,int *param_3)

{
  longlong *plVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  void *pvVar5;
  int iVar6;
  int *piVar7;
  longlong *plVar8;
  int iVar9;
  bool bVar10;
  int local_res20 [2];
  undefined4 uVar11;
  int local_288 [4];
  longlong *local_278;
  longlong *local_270;
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined4 local_258;
  undefined4 local_254;
  undefined4 local_250;
  undefined4 local_24c;
  undefined8 local_248;
  longlong local_238;
  longlong local_230;
  int local_220;
  short local_21c;
  short local_210;
  undefined4 local_190;
  longlong local_188;
  longlong local_180;
  int local_170;
  short local_16c;
  undefined4 local_e0;
  undefined1 local_d8 [168];
  undefined4 local_30;
  
  local_248 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_278);
  plVar1 = local_278;
  if (local_278 != (longlong *)0x0) {
    if (local_278 == local_270) {
      lVar4 = *local_278;
      if (lVar4 != 0) {
        local_288[1] = 0xffffffff;
        local_288[2] = 0xffffffff;
        FUN_14000a170(&local_188);
        iVar9 = 0;
        local_e0 = 0;
        iVar6 = *param_2;
        if ((-1 < iVar6) && (iVar6 < 5)) {
          iVar2 = *param_3;
          if ((-1 < iVar2) && (iVar2 < 0x18)) {
            *(short *)(((longlong)iVar2 + (longlong)iVar6 * 0x18) * 0xac + 0x14 + lVar4) =
                 (short)*param_2;
            *(short *)(((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + 0x16 + lVar4) =
                 (short)*param_3;
            FUN_140090020(&local_188,((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + lVar4
                         );
          }
        }
        if ((local_188 == 0) && (local_180 == 0)) {
          bVar10 = false;
        }
        else {
          bVar10 = true;
        }
        if (((bVar10) || (local_170 != 0)) || (0 < local_16c)) {
          local_268 = 0;
          local_264 = 0;
          local_260 = 0;
          local_25c = 0;
          local_258 = 0;
          local_254 = 0;
          local_250 = 0;
          local_24c = 0;
          FUN_14000a170(&local_238);
          local_190 = 0;
          iVar6 = -1;
          local_288[0] = -1;
          do {
            FUN_14000a170(local_d8);
            local_30 = 0;
            FUN_140090020(&local_238,local_d8);
            local_res20[0] = -1;
            piVar7 = local_288 + 2;
            FUN_1401a7d30(param_1,param_2,param_3,&local_268,piVar7,&local_258,local_288 + 1,
                          local_res20,0);
            uVar11 = (undefined4)((ulonglong)piVar7 >> 0x20);
            lVar4 = *plVar1;
            iVar2 = *param_2;
            if ((-1 < iVar2) && (iVar2 < 5)) {
              iVar3 = *param_3;
              if ((-1 < iVar3) && (iVar3 < 0x18)) {
                *(short *)(((longlong)iVar3 + (longlong)iVar2 * 0x18) * 0xac + 0x14 + lVar4) =
                     (short)*param_2;
                *(short *)(((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + 0x16 + lVar4) =
                     (short)*param_3;
                FUN_140090020(&local_238,
                              ((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + lVar4);
              }
            }
            local_288[3] = (int)local_210;
            piVar7 = local_288 + 3;
            if (local_210 <= iVar6) {
              piVar7 = local_288;
            }
            iVar6 = *piVar7;
            plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            local_288[0] = iVar6;
            (**(code **)(*plVar8 + 0x550))
                      (plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20);
            iVar9 = iVar9 + 1;
            if ((local_238 == 0) && (local_230 == 0)) {
              bVar10 = false;
            }
            else {
              bVar10 = true;
            }
          } while ((((bVar10) || (local_220 != 0)) || (0 < local_21c)) &&
                  (((local_res20[0] == 0 || (local_res20[0] == 2)) ||
                   ((local_res20[0] == 3 || (local_res20[0] == 4))))));
          FUN_140418da0(DAT_140607fd8,L"!!!Count [ %d ] Enchant Max : %d - ErrorCode : %d",iVar9,
                        iVar6,CONCAT44(uVar11,local_res20[0]));
        }
        goto LAB_1401c57ea;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar10 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_270) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c57ea:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar5 = (void *)*local_278;
    if (pvVar5 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar5 + 0xf630);
      operator_delete(pvVar5);
    }
    operator_delete(local_278);
  }
  return 1;
}



undefined8 FUN_1401c5840(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined4 *puVar6;
  bool bVar7;
  longlong *local_20;
  longlong *local_18;
  
  puVar6 = param_3;
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar5 = FUN_140208860(*local_20,*puVar6);
        if (lVar5 != 0) {
          *(undefined1 *)(lVar5 + 0x20d4) = 0;
          FUN_140218710(lVar5);
          if (param_1[0x16b] == 0) {
            FUN_140208680(*plVar1,*param_3);
            lVar5 = *(longlong *)(param_1[0x16a] + 0x380);
            uVar4 = (**(code **)(*param_1 + 0x38))(param_1);
            (**(code **)(lVar5 + 0x910))
                      (param_1[0x16a] + 0x380,uVar4,&DAT_1405d85a0,param_2,param_3);
          }
          else {
            (**(code **)(*(longlong *)(param_1[0x16a] + 0x380) + 0x910))
                      ((longlong *)(param_1[0x16a] + 0x380),*(undefined4 *)(param_1[0x16b] + 8),
                       &DAT_1405d85a0,param_2,param_3);
          }
        }
        goto LAB_1401c5988;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c5988:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



void FUN_1401c59e0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if ((longlong *)*local_20 != (longlong *)0x0) {
        lVar4 = (**(code **)(*(longlong *)*local_20 + 0x270))();
        if (lVar4 != 0) {
          *(undefined4 *)(lVar4 + 8) = param_2;
        }
        goto LAB_1401c5a75;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401c5a75:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  bool bVar4;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if ((longlong *)*local_20 != (longlong *)0x0) {
        puVar3 = (undefined8 *)(**(code **)(*(longlong *)*local_20 + 0x270))();
        if (puVar3 != (undefined8 *)0x0) {
          *puVar3 = param_2;
        }
        goto LAB_1401c5b46;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar4 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar4) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401c5b46:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar3 = (undefined8 *)*local_20;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_20);
  }
  return;
}



void FUN_1401c5b80(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if ((longlong *)*local_20 != (longlong *)0x0) {
        lVar4 = (**(code **)(*(longlong *)*local_20 + 0x270))();
        if (lVar4 != 0) {
          *(undefined4 *)(lVar4 + 0x10) = param_2;
        }
        goto LAB_1401c5c15;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401c5c15:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return;
}



undefined8 FUN_1401c5c50(longlong param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  bool bVar6;
  int local_res8 [2];
  int local_res10 [2];
  int local_res18 [2];
  int local_res20 [2];
  longlong *local_20;
  longlong *local_18;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar3 = *local_20;
        local_res8[0] =
             (int)(((float)(*(int *)(lVar3 + 0x8b4) + *(int *)(lVar3 + 0x61c)) +
                   *(float *)(lVar3 + 0x5a4)) *
                   (*(float *)(lVar3 + 0x738) + *(float *)(lVar3 + 0x8f0) + 1.0 + 0.0001) +
                   (float)*(int *)(lVar3 + 0x86c) + (float)*(int *)(lVar3 + 0x890));
        lVar3 = *local_20;
        local_res10[0] =
             (int)(((float)(*(int *)(lVar3 + 0x8b0) + *(int *)(lVar3 + 0x618)) +
                   *(float *)(lVar3 + 0x59c)) *
                   (*(float *)(lVar3 + 0x8ec) + *(float *)(lVar3 + 0x734) + 1.0 + 0.0001) +
                   (float)*(int *)(lVar3 + 0x868) + (float)*(int *)(lVar3 + 0x88c));
        local_res18[0] = (int)*(float *)(*local_20 + 0x5a0);
        local_res20[0] = (int)*(float *)(*local_20 + 0x598);
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
        (**(code **)(*plVar5 + 0x40))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,local_res18,
                   local_res10,local_res8);
        goto LAB_1401c5e25;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c5e25:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



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

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  wchar_t *_Src;
  bool bVar7;
  undefined2 local_res8 [4];
  undefined4 local_f8;
  undefined4 uStack_f4;
  undefined4 local_f0;
  undefined4 uStack_ec;
  longlong *local_e8;
  longlong *local_e0;
  undefined2 local_d8;
  undefined2 local_d6;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  wchar_t local_b0 [16];
  undefined2 local_90;
  undefined4 local_8e;
  undefined4 local_8a;
  undefined8 local_86;
  undefined4 local_7e;
  undefined4 local_7a;
  undefined4 local_76;
  undefined2 local_72;
  undefined4 local_70;
  undefined8 local_6c;
  undefined8 local_64;
  undefined8 local_5c;
  undefined8 local_54;
  undefined8 local_4c;
  undefined8 local_44;
  undefined8 local_3c;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_e8);
  plVar1 = local_e8;
  if (local_e8 != (longlong *)0x0) {
    if (local_e8 == local_e0) {
      if (*local_e8 != 0) {
        lVar5 = FUN_140209940();
        if (lVar5 != 0) {
          *(undefined4 *)(lVar5 + 0x74) = *param_3;
          *(undefined4 *)(lVar5 + 0x18) = *param_4;
          memset(&local_d8,0,0xa4);
          local_d8 = *(undefined2 *)(lVar5 + 0x18);
          local_d6 = *(undefined2 *)(lVar5 + 0x1c);
          local_d4 = *(undefined4 *)(lVar5 + 0x20);
          local_d0 = *(undefined4 *)(lVar5 + 0x24);
          local_cc = *(undefined4 *)(lVar5 + 0x28);
          local_c8 = *(undefined4 *)(lVar5 + 0x2c);
          local_c4 = *(undefined4 *)(lVar5 + 0x30);
          local_c0 = *(undefined4 *)(lVar5 + 0x34);
          local_bc = *(undefined4 *)(lVar5 + 0x38);
          local_b8 = *(undefined4 *)(lVar5 + 0x3c);
          local_b4 = *(undefined4 *)(lVar5 + 0x40);
          _Src = (wchar_t *)(lVar5 + 0x48);
          if (7 < *(ulonglong *)(lVar5 + 0x60)) {
            _Src = *(wchar_t **)_Src;
          }
          wcscpy_s(local_b0,0x10,_Src);
          local_90 = *(undefined2 *)(lVar5 + 0x70);
          local_8e = *(undefined4 *)(lVar5 + 0x74);
          local_8a = *(undefined4 *)(lVar5 + 0x78);
          local_86 = *(undefined8 *)(lVar5 + 0x80);
          local_7e = *(undefined4 *)(lVar5 + 0x88);
          local_7a = *(undefined4 *)(lVar5 + 0x8c);
          local_76 = *(undefined4 *)(lVar5 + 0x90);
          local_72 = *(undefined2 *)(lVar5 + 0x9c);
          local_70 = *(undefined4 *)(lVar5 + 0xa0);
          local_6c = *(undefined8 *)(lVar5 + 0xa4);
          local_64 = *(undefined8 *)(lVar5 + 0xac);
          local_5c = *(undefined8 *)(lVar5 + 0xb4);
          local_54 = *(undefined8 *)(lVar5 + 0xbc);
          local_4c = *(undefined8 *)(lVar5 + 0xc4);
          local_44 = *(undefined8 *)(lVar5 + 0xcc);
          local_3c = *(undefined8 *)(lVar5 + 0xd4);
          local_f8 = *(undefined4 *)(param_1 + 0x170);
          uStack_f4 = *(undefined4 *)(param_1 + 0x174);
          local_f0 = *(undefined4 *)(param_1 + 0x178);
          uStack_ec = *(undefined4 *)(param_1 + 0x17c);
          iVar4 = *(int *)(param_1 + 0x284);
          if ((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
            if ((*(longlong *)(param_1 + 0x170) == 0) && (*(longlong *)(param_1 + 0x178) == 0)) {
              bVar7 = false;
            }
            else {
              bVar7 = true;
            }
            if ((bVar7) &&
               (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
              local_res8[0] = (undefined2)iVar4;
              plVar6 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                       );
              (**(code **)(*plVar6 + 0x9f0))(plVar6,1,&DAT_1405d85a0,local_res8,&local_f8,&local_d8)
              ;
            }
          }
          FUN_1401b1bb0(param_1,lVar5 + 0x20);
        }
        goto LAB_1401c6136;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_e0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c6136:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar3 = (undefined8 *)*local_e8;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_e8);
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined1 local_res8 [8];
  longlong *local_20;
  longlong *local_18;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_20,param_2,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar4 = FUN_140209940(*local_20,*param_2);
        if (lVar4 != 0) {
          local_res8[0] = (undefined1)*(undefined4 *)(lVar4 + 0x88);
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x3c0);
          (**(code **)(*plVar5 + 0x650))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8);
          FUN_1401b1e70(param_1,lVar4 + 0x20,0);
        }
        goto LAB_1401c627b;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c627b:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401c62c0(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong *plVar6;
  wchar_t *_Src;
  bool bVar7;
  undefined2 local_res8 [4];
  undefined4 local_f8;
  undefined4 uStack_f4;
  undefined4 local_f0;
  undefined4 uStack_ec;
  longlong *local_e8;
  longlong *local_e0;
  undefined2 local_d8;
  undefined2 local_d6;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  wchar_t local_b0 [16];
  undefined2 local_90;
  undefined4 local_8e;
  undefined4 local_8a;
  undefined8 local_86;
  undefined4 local_7e;
  undefined4 local_7a;
  undefined4 local_76;
  undefined2 local_72;
  undefined4 local_70;
  undefined8 local_6c;
  undefined8 local_64;
  undefined8 local_5c;
  undefined8 local_54;
  undefined8 local_4c;
  undefined8 local_44;
  undefined8 local_3c;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_e8);
  plVar1 = local_e8;
  if (local_e8 != (longlong *)0x0) {
    if (local_e8 == local_e0) {
      if (*local_e8 != 0) {
        lVar5 = FUN_140209940(*local_e8,*param_2);
        if (lVar5 != 0) {
          *(undefined4 *)(lVar5 + 0x9c) = *param_3;
          FUN_14031ab40(lVar5,*param_3);
          uVar4 = FUN_1402701a0(*(undefined8 *)(param_1 + 0xb50));
          *(undefined4 *)(lVar5 + 0xa0) = uVar4;
          memset(&local_d8,0,0xa4);
          local_d8 = *(undefined2 *)(lVar5 + 0x18);
          local_d6 = *(undefined2 *)(lVar5 + 0x1c);
          local_d4 = *(undefined4 *)(lVar5 + 0x20);
          local_d0 = *(undefined4 *)(lVar5 + 0x24);
          local_cc = *(undefined4 *)(lVar5 + 0x28);
          local_c8 = *(undefined4 *)(lVar5 + 0x2c);
          local_c4 = *(undefined4 *)(lVar5 + 0x30);
          local_c0 = *(undefined4 *)(lVar5 + 0x34);
          local_bc = *(undefined4 *)(lVar5 + 0x38);
          local_b8 = *(undefined4 *)(lVar5 + 0x3c);
          local_b4 = *(undefined4 *)(lVar5 + 0x40);
          _Src = (wchar_t *)(lVar5 + 0x48);
          if (7 < *(ulonglong *)(lVar5 + 0x60)) {
            _Src = *(wchar_t **)_Src;
          }
          wcscpy_s(local_b0,0x10,_Src);
          local_90 = *(undefined2 *)(lVar5 + 0x70);
          local_8e = *(undefined4 *)(lVar5 + 0x74);
          local_8a = *(undefined4 *)(lVar5 + 0x78);
          local_86 = *(undefined8 *)(lVar5 + 0x80);
          local_7e = *(undefined4 *)(lVar5 + 0x88);
          local_7a = *(undefined4 *)(lVar5 + 0x8c);
          local_76 = *(undefined4 *)(lVar5 + 0x90);
          local_72 = *(undefined2 *)(lVar5 + 0x9c);
          local_70 = *(undefined4 *)(lVar5 + 0xa0);
          local_6c = *(undefined8 *)(lVar5 + 0xa4);
          local_64 = *(undefined8 *)(lVar5 + 0xac);
          local_5c = *(undefined8 *)(lVar5 + 0xb4);
          local_54 = *(undefined8 *)(lVar5 + 0xbc);
          local_4c = *(undefined8 *)(lVar5 + 0xc4);
          local_44 = *(undefined8 *)(lVar5 + 0xcc);
          local_3c = *(undefined8 *)(lVar5 + 0xd4);
          local_f8 = *(undefined4 *)(param_1 + 0x170);
          uStack_f4 = *(undefined4 *)(param_1 + 0x174);
          local_f0 = *(undefined4 *)(param_1 + 0x178);
          uStack_ec = *(undefined4 *)(param_1 + 0x17c);
          iVar3 = *(int *)(param_1 + 0x284);
          if ((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
            if ((*(longlong *)(param_1 + 0x170) == 0) && (*(longlong *)(param_1 + 0x178) == 0)) {
              bVar7 = false;
            }
            else {
              bVar7 = true;
            }
            if ((bVar7) &&
               (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
              local_res8[0] = (undefined2)iVar3;
              plVar6 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                       );
              (**(code **)(*plVar6 + 0x9f0))(plVar6,1,&DAT_1405d85a0,local_res8,&local_f8,&local_d8)
              ;
            }
          }
        }
        goto LAB_1401c659e;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_e0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c659e:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar2 = (undefined8 *)*local_e8;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_e8);
  }
  return 1;
}



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

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_20,param_2,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar4 = FUN_140209940(*local_20,*param_2);
        if (lVar4 != 0) {
          FUN_140209f10(*plVar1);
          FUN_1401b1bb0(param_1,lVar4 + 0x20);
        }
        goto LAB_1401c66b0;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c66b0:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401c66f0(longlong param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  int iVar5;
  bool bVar6;
  longlong *local_20;
  longlong *local_18;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        iVar3 = 0;
        do {
          iVar3 = iVar3 + 1;
          lVar4 = FUN_140209940(*plVar1,iVar3);
          if (lVar4 == 0) break;
          iVar5 = *(int *)(lVar4 + 0x90) + 1;
          if (iVar5 < 0) {
            iVar5 = 0;
          }
          *(int *)(lVar4 + 0x90) = iVar5;
          iVar5 = *(int *)(lVar4 + 0x94);
          if (iVar5 < 0) {
            iVar5 = 0;
          }
          *(int *)(lVar4 + 0x8c) = iVar5;
          FUN_140200070(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                        *(undefined4 *)(param_1 + 0x284),lVar4 + 0x20,*(undefined4 *)(lVar4 + 0x90))
          ;
          FUN_1401b1bb0(param_1,lVar4 + 0x20);
        } while (iVar3 < 3);
        goto LAB_1401c681b;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c681b:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401c6870(longlong param_1,int *param_2)

{
  int *piVar1;
  longlong *plVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  int iVar5;
  longlong lVar6;
  bool bVar7;
  undefined8 uVar8;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  longlong *local_20;
  longlong *local_18;
  
  uVar8 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_20);
  plVar2 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if ((longlong *)*local_20 != (longlong *)0x0) {
        iVar5 = *param_2;
        lVar6 = (**(code **)(*(longlong *)*local_20 + 0x270))();
        piVar1 = (int *)(lVar6 + 0x78);
        *piVar1 = *piVar1 + iVar5;
        if (*piVar1 < 0) {
          *(undefined4 *)(lVar6 + 0x78) = 0;
        }
        lVar6 = (**(code **)(*(longlong *)*plVar2 + 0x270))();
        uVar3 = *(undefined4 *)(lVar6 + 0x78);
        FUN_140173b60(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 8),
                      *(undefined4 *)(param_1 + 8),uVar3);
        local_30 = *(undefined4 *)(param_1 + 0x170);
        local_2c = *(undefined4 *)(param_1 + 0x174);
        local_28 = *(undefined4 *)(param_1 + 0x178);
        local_24 = *(undefined4 *)(param_1 + 0x17c);
        FUN_1401fc6e0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                      *(undefined4 *)(param_1 + 0x284),&local_30,uVar3,1,uVar8);
        goto LAB_1401c69a4;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar2 == (longlong *)0x0) {
    return 1;
  }
  if (plVar2 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c69a4:
  LOCK();
  plVar2 = plVar2 + 1;
  lVar6 = *plVar2;
  *(int *)plVar2 = (int)*plVar2 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    puVar4 = (undefined8 *)*local_20;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401c69f0(longlong param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  if (99 < *(int *)(param_1 + 0x298)) {
    local_18 = *(undefined4 *)(param_1 + 0x160);
    local_14 = *(undefined4 *)(param_1 + 0x164);
    local_10 = *(undefined4 *)(param_1 + 0x168);
    puVar1 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar1 = PTR_DAT_1405d8010;
    }
    local_c = *(undefined4 *)(param_1 + 0x16c);
    FUN_1401fc350(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                  *(undefined4 *)(param_1 + 0x284),&local_18,puVar1,param_1 + 0x330);
  }
  return 1;
}



undefined8 FUN_1401c6a80(longlong *param_1,undefined4 *param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong *plVar6;
  wchar_t *pwVar7;
  size_t sVar8;
  int iVar9;
  longlong *plVar10;
  longlong *plVar11;
  bool bVar12;
  undefined2 local_res8 [8];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_348;
  undefined4 uStack_344;
  undefined4 local_340;
  undefined4 uStack_33c;
  undefined4 local_338 [2];
  undefined4 local_330 [2];
  undefined4 local_328;
  undefined4 local_324;
  undefined4 local_320;
  undefined4 local_31c;
  undefined4 local_318;
  undefined4 local_314;
  undefined4 local_310;
  undefined4 local_30c;
  undefined4 local_308;
  undefined4 local_304;
  wchar_t local_300 [50];
  undefined2 local_29c;
  wchar_t local_29a [16];
  undefined8 local_27a;
  undefined8 local_272;
  undefined4 local_26a;
  wchar_t local_266 [16];
  undefined8 local_246;
  WCHAR local_238;
  undefined1 local_236 [526];
  
  if ((int)param_1[0x53] < 100) {
    return 1;
  }
  local_348 = *(undefined4 *)((longlong)param_1 + 0x194);
  plVar11 = (longlong *)0x0;
  uStack_344 = (undefined4)param_1[0x33];
  lVar5 = *(longlong *)((longlong)param_1 + 0x194);
  local_340 = *(undefined4 *)((longlong)param_1 + 0x19c);
  uStack_33c = (undefined4)param_1[0x34];
  lVar2 = *(longlong *)((longlong)param_1 + 0x19c);
  if ((lVar5 != 0) || (plVar6 = plVar11, lVar5 = lVar2, lVar2 != 0)) {
    plVar6 = (longlong *)(ulonglong)((1 - (uint)(lVar5 != 0)) - (uint)((lVar5 != 0) != 0));
  }
  if ((int)plVar6 == 0) {
    return 1;
  }
  plVar6 = (longlong *)param_1[0xdc];
  if (plVar6 == (longlong *)0x0) {
    return 1;
  }
  if (plVar6 != (longlong *)param_1[0xdd]) {
    if (DAT_14060804c != 0) {
      DAT_14060804c = DAT_14060804c + 1;
      return 1;
    }
    DAT_14060804c = DAT_14060804c + 1;
    FUN_140176d60(1);
    return 1;
  }
  if ((longlong *)*plVar6 == (longlong *)0x0) {
    return 1;
  }
  plVar10 = (longlong *)*plVar6;
  if ((plVar6 != (longlong *)param_1[0xdd]) &&
     (iVar3 = DAT_14060804c + 1, bVar12 = DAT_14060804c == 0, plVar10 = plVar11,
     DAT_14060804c = iVar3, bVar12)) {
    FUN_140176d60(1);
  }
  uVar4 = *param_2;
  lVar5 = (**(code **)(*plVar10 + 0x270))();
  *(undefined4 *)(lVar5 + 0xc4) = uVar4;
  plVar6 = (longlong *)param_1[0xdc];
  plVar10 = plVar11;
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == (longlong *)param_1[0xdd]) {
      plVar10 = (longlong *)*plVar6;
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  lVar5 = (**(code **)(*plVar10 + 0x270))();
  local_res20[0] = 0;
  local_res18[0] = *(undefined4 *)(lVar5 + 0xc4);
  local_338[0] = 0;
  (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xb20))
            (param_1[0x16a] + 0x78,(int)param_1[1],&DAT_1405d85a0,local_res18,local_338,local_res20)
  ;
  local_348 = (undefined4)param_1[0x2e];
  uStack_344 = *(undefined4 *)((longlong)param_1 + 0x174);
  local_340 = (undefined4)param_1[0x2f];
  uStack_33c = *(undefined4 *)((longlong)param_1 + 0x17c);
  local_330[0] = local_res18[0];
  if (*(longlong *)(param_1[0x16a] + 0x4c0) != 0) {
    local_res8[0] = *(undefined2 *)((longlong)param_1 + 0x284);
    lVar5 = *(longlong *)
             (*(longlong *)(*(longlong *)(param_1[0x16a] + 0x4c0) + 8) +
             (longlong)(int)param_1[0x51] * 8);
    (**(code **)(*(longlong *)(lVar5 + 0x70) + 0x9b0))
              (lVar5 + 0x70,1,&DAT_1405d85a0,local_res8,&local_348,local_330);
  }
  local_29c = 0;
  local_27a = 0;
  local_272 = 0;
  local_26a = 0;
  local_246 = 0;
  memset(local_300,0,100);
  local_266[0] = L'\0';
  local_266[1] = L'\0';
  local_266[2] = L'\0';
  local_266[3] = L'\0';
  local_266[4] = L'\0';
  local_266[5] = L'\0';
  local_266[6] = L'\0';
  local_266[7] = L'\0';
  local_266[8] = L'\0';
  local_266[9] = L'\0';
  local_266[10] = L'\0';
  local_266[0xb] = L'\0';
  local_266[0xc] = L'\0';
  local_266[0xd] = L'\0';
  local_266[0xe] = L'\0';
  local_266[0xf] = L'\0';
  local_29a[0] = L'\0';
  local_29a[1] = L'\0';
  local_29a[2] = L'\0';
  local_29a[3] = L'\0';
  local_324 = *(undefined4 *)(DAT_140608000 + 0x140);
  local_320 = (undefined4)param_1[0x2c];
  local_29a[4] = L'\0';
  local_29a[5] = L'\0';
  local_29a[6] = L'\0';
  local_29a[7] = L'\0';
  local_31c = *(undefined4 *)((longlong)param_1 + 0x164);
  puVar1 = (undefined8 *)param_1[0xdc];
  local_318 = (undefined4)param_1[0x2d];
  local_314 = *(undefined4 *)((longlong)param_1 + 0x16c);
  local_29a[8] = L'\0';
  local_29a[9] = L'\0';
  local_29a[10] = L'\0';
  local_29a[0xb] = L'\0';
  local_310 = (undefined4)param_1[0x2e];
  local_29a[0xc] = L'\0';
  local_29a[0xd] = L'\0';
  local_29a[0xe] = L'\0';
  local_29a[0xf] = L'\0';
  local_30c = *(undefined4 *)((longlong)param_1 + 0x174);
  local_328 = 0x1f9;
  local_308 = (undefined4)param_1[0x2f];
  local_304 = *(undefined4 *)((longlong)param_1 + 0x17c);
  iVar3 = -1;
  if (puVar1 == (undefined8 *)0x0) {
LAB_1401c6daf:
    uVar4 = 0xffffffff;
  }
  else {
    if (puVar1 != (undefined8 *)param_1[0xdd]) {
      iVar9 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar9;
      if (bVar12) {
        FUN_140176d60(1);
      }
      goto LAB_1401c6daf;
    }
    if ((longlong *)*puVar1 == (longlong *)0x0) goto LAB_1401c6daf;
    plVar6 = (longlong *)*puVar1;
    if ((puVar1 != (undefined8 *)param_1[0xdd]) &&
       (iVar9 = DAT_14060804c + 1, bVar12 = DAT_14060804c == 0, plVar6 = plVar11,
       DAT_14060804c = iVar9, bVar12)) {
      FUN_140176d60(1);
    }
    uVar4 = (undefined4)plVar6[0x24];
  }
  puVar1 = (undefined8 *)param_1[0xdc];
  local_27a = CONCAT44(local_27a._4_4_,uVar4);
  if (puVar1 == (undefined8 *)0x0) {
LAB_1401c6deb:
    uVar4 = 0xffffffff;
  }
  else {
    if (puVar1 != (undefined8 *)param_1[0xdd]) {
      iVar9 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar9;
      if (bVar12) {
        FUN_140176d60(1);
      }
      goto LAB_1401c6deb;
    }
    if ((longlong *)*puVar1 == (longlong *)0x0) goto LAB_1401c6deb;
    plVar6 = (longlong *)*puVar1;
    if ((puVar1 != (undefined8 *)param_1[0xdd]) &&
       (iVar9 = DAT_14060804c + 1, bVar12 = DAT_14060804c == 0, plVar6 = plVar11,
       DAT_14060804c = iVar9, bVar12)) {
      FUN_140176d60(1);
    }
    uVar4 = (**(code **)(*plVar6 + 0x200))(plVar6);
  }
  local_27a = CONCAT44(uVar4,(undefined4)local_27a);
  puVar1 = (undefined8 *)param_1[0xdc];
  if (puVar1 == (undefined8 *)0x0) {
LAB_1401c6e21:
    iVar9 = -1;
  }
  else {
    if (puVar1 != (undefined8 *)param_1[0xdd]) {
      iVar9 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar9;
      if (bVar12) {
        FUN_140176d60(1);
      }
      goto LAB_1401c6e21;
    }
    if ((longlong *)*puVar1 == (longlong *)0x0) goto LAB_1401c6e21;
    plVar6 = (longlong *)*puVar1;
    if ((puVar1 != (undefined8 *)param_1[0xdd]) &&
       (iVar9 = DAT_14060804c + 1, bVar12 = DAT_14060804c == 0, plVar6 = plVar11,
       DAT_14060804c = iVar9, bVar12)) {
      FUN_140176d60(1);
    }
    lVar5 = (**(code **)(*plVar6 + 0x278))(plVar6);
    if (lVar5 == 0) {
      lVar5 = (**(code **)(*plVar6 + 0x288))(plVar6);
      if (lVar5 == 0) {
        iVar9 = *(int *)((longlong)plVar6 + 0x124c);
        if (iVar9 == 0) {
          iVar9 = *(int *)(plVar6[0x26] + 0x1f0);
        }
      }
      else {
        lVar5 = (**(code **)(*plVar6 + 0x288))(plVar6);
        iVar9 = *(int *)(lVar5 + 0x4c);
      }
    }
    else {
      lVar5 = (**(code **)(*plVar6 + 0x278))();
      iVar9 = *(int *)(lVar5 + 0x5c);
    }
  }
  local_272 = CONCAT44(local_272._4_4_,iVar9);
  local_26a = FUN_1401978f0(param_1);
  puVar1 = (undefined8 *)param_1[0xdc];
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[0xdd]) {
      if ((longlong *)*puVar1 != (longlong *)0x0) {
        plVar6 = (longlong *)*puVar1;
        if ((puVar1 != (undefined8 *)param_1[0xdd]) &&
           (iVar9 = DAT_14060804c + 1, bVar12 = DAT_14060804c == 0, plVar6 = plVar11,
           DAT_14060804c = iVar9, bVar12)) {
          FUN_140176d60(1);
        }
        uVar4 = (**(code **)(*plVar6 + 0x200))();
        goto LAB_1401c6e70;
      }
    }
    else {
      iVar9 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar9;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  uVar4 = 0xffffffff;
LAB_1401c6e70:
  local_246 = CONCAT44(local_246._4_4_,uVar4);
  puVar1 = (undefined8 *)param_1[0xdc];
  iVar9 = -1;
  if (puVar1 != (undefined8 *)0x0) {
    iVar9 = iVar3;
    if (puVar1 == (undefined8 *)param_1[0xdd]) {
      if ((longlong *)*puVar1 != (longlong *)0x0) {
        plVar6 = (longlong *)*puVar1;
        if ((puVar1 != (undefined8 *)param_1[0xdd]) &&
           (iVar3 = DAT_14060804c + 1, bVar12 = DAT_14060804c == 0, plVar6 = plVar11,
           DAT_14060804c = iVar3, bVar12)) {
          FUN_140176d60(1);
        }
        lVar5 = (**(code **)(*plVar6 + 0x278))(plVar6);
        if (lVar5 == 0) {
          lVar5 = (**(code **)(*plVar6 + 0x288))(plVar6);
          if (lVar5 == 0) {
            iVar9 = *(int *)((longlong)plVar6 + 0x124c);
            if (iVar9 == 0) {
              iVar9 = *(int *)(plVar6[0x26] + 0x1f0);
            }
          }
          else {
            lVar5 = (**(code **)(*plVar6 + 0x288))(plVar6);
            iVar9 = *(int *)(lVar5 + 0x4c);
          }
        }
        else {
          lVar5 = (**(code **)(*plVar6 + 0x278))();
          iVar9 = *(int *)(lVar5 + 0x5c);
        }
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  local_246 = CONCAT44(iVar9,(undefined4)local_246);
  local_29c = (**(code **)(*param_1 + 0x18))(param_1);
  local_272 = CONCAT44(local_res18[0],(undefined4)local_272);
  pwVar7 = (wchar_t *)FUN_1401a6410(param_1);
  sVar8 = wcsnlen(pwVar7,0x10);
  if (sVar8 < 0x10) {
    pwVar7 = (wchar_t *)FUN_1401a6410(param_1);
    wcscpy_s(local_29a,0x10,pwVar7);
    pwVar7 = (wchar_t *)FUN_1401a6410(param_1);
    wcscpy_s(local_266,0x10,pwVar7);
  }
  local_238 = L'\0';
  memset(local_236,0,0x206);
  MultiByteToWideChar(0,1,(LPCSTR)(param_1 + 0x66),0x32,&local_238,0x32);
  sVar8 = wcsnlen(&local_238,0x32);
  if (sVar8 < 0x32) {
    wcscpy_s(local_300,0x32,&local_238);
  }
  iVar3 = *(int *)((longlong)param_1 + 0x284);
  if (((-1 < iVar3) && (iVar3 < *(short *)(param_1[0x16a] + 700))) &&
     (lVar5 = *(longlong *)(param_1[0x16a] + 0x4c8), lVar5 != 0)) {
    local_res8[0] = (undefined2)iVar3;
    lVar5 = *(longlong *)(*(longlong *)(lVar5 + 8) + (longlong)(int)param_1[0x51] * 8);
    (**(code **)(*(longlong *)(lVar5 + 0x70) + 0xc70))
              (lVar5 + 0x70,1,&DAT_1405d85a0,local_res8,&local_328);
  }
  return 1;
}



undefined8 FUN_1401c71e0(longlong param_1)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  longlong *plVar7;
  int iVar8;
  undefined4 local_res8 [2];
  undefined4 local_res10 [2];
  undefined *local_res18;
  
  local_res8[0] = *(undefined4 *)(*(longlong *)(param_1 + 0xb50) + 0x21c);
  local_res10[0] = *(undefined4 *)(DAT_140608000 + 0x84);
  plVar7 = (longlong *)(DAT_140608000 + 0x58);
  if (7 < *(ulonglong *)(DAT_140608000 + 0x70)) {
    plVar7 = (longlong *)*plVar7;
  }
  FUN_14034fe70();
  local_res18 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(plVar7);
  iVar8 = 0;
  if ((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_res18 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_res18 != (undefined *)0x0)) &&
     (local_res18 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res18 + -8);
  }
  iVar8 = 1;
  if (1 < iVar4) {
    iVar8 = iVar4;
  }
  iVar4 = 0;
  if ((local_res18 != (undefined *)0x0) && (iVar4 = 0, local_res18 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res18 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_res18);
  }
  FUN_140002e10(&local_res18);
  puVar6 = local_res18;
  if (local_res18 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,plVar7,iVar3);
  puVar6 = local_res18;
  if (local_res18 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_res18 != (undefined *)0x0) && (iVar3 = 0, local_res18 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res18 + -8);
  }
  if ((iVar3 <= iVar8) && (iVar8 = 0, local_res18 != (undefined *)0x0)) {
    if (local_res18 == PTR_DAT_1405d8010) goto LAB_1401c733f;
    iVar8 = *(int *)(local_res18 + -8);
  }
  if (((local_res18 != PTR_DAT_1405d8010) && (local_res18 != (undefined *)0x0)) &&
     ((int *)(local_res18 + -8) != (int *)0x0)) {
    *(int *)(local_res18 + -8) = iVar8;
    *(undefined2 *)(local_res18 + (longlong)iVar8 * 2) = 0;
  }
LAB_1401c733f:
  plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
  (**(code **)(*plVar7 + 0x50))
            (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_res18,local_res10,local_res8)
  ;
  puVar6 = local_res18;
  if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    FUN_14034ed40(uVar5);
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return 1;
}



undefined8 FUN_1401c73e0(longlong param_1,int *param_2)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  undefined8 uVar6;
  longlong *plVar7;
  bool bVar8;
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  undefined8 in_stack_fffffffffffffec8;
  undefined4 uVar9;
  undefined2 local_118 [2];
  undefined4 local_114;
  longlong *local_110;
  longlong *local_108;
  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;
  longlong local_d8;
  longlong local_d0;
  int local_c0;
  short local_bc;
  undefined4 local_30;
  
  uVar9 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
  local_e0 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_110);
  plVar1 = local_110;
  if (local_110 != (longlong *)0x0) {
    if (local_110 == local_108) {
      if (*local_110 != 0) {
        FUN_14000a170(&local_d8);
        local_30 = 0;
        *(undefined4 *)(*plVar1 + 0xd84) = 0x140000;
        FUN_140090020(&local_d8);
        if ((local_d8 == 0) && (local_d0 == 0)) {
          bVar8 = false;
        }
        else {
          bVar8 = true;
        }
        if (((bVar8) || (local_c0 != 0)) || (0 < local_bc)) {
          uVar6 = FUN_140137690();
          cVar4 = FUN_140136720(uVar6,*param_2);
          if (cVar4 != '\0') {
            uVar6 = FUN_140137690();
            iVar5 = FUN_140136910(uVar6,*param_2);
            if (iVar5 == 0x30) {
              local_c0 = *param_2;
              local_114 = 0x14;
              uVar6 = FUN_140174f00(&local_110);
              FUN_1401ed220(uVar6,&DAT_14047ba28,&local_114,&local_d8,CONCAT44(uVar9,4));
              local_100 = *(undefined4 *)(param_1 + 0x160);
              local_fc = *(undefined4 *)(param_1 + 0x164);
              local_f8 = *(undefined4 *)(param_1 + 0x168);
              local_f4 = *(undefined4 *)(param_1 + 0x16c);
              local_f0 = *(undefined4 *)(param_1 + 0x170);
              local_ec = *(undefined4 *)(param_1 + 0x174);
              local_e8 = *(undefined4 *)(param_1 + 0x178);
              local_e4 = *(undefined4 *)(param_1 + 0x17c);
              iVar5 = *(int *)(param_1 + 0x284);
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                 (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar3 != 0)) {
                local_res18[0] = (undefined2)iVar5;
                plVar7 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                         0x70);
                (**(code **)(*plVar7 + 0x140))
                          (plVar7,1,&DAT_1405d85a0,local_res18,&local_f0,&local_100,&local_d8);
              }
              local_res20[0] = 0x14;
              local_118[0] = 0;
              plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar7 + 0xe0))
                        (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_118,local_res20,
                         &local_d8);
            }
          }
        }
        goto LAB_1401c7658;
      }
    }
    else {
      iVar5 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar5;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_108) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c7658:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    pvVar2 = (void *)*local_110;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_110);
  }
  return 1;
}



undefined8 FUN_1401c76b0(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  int iVar4;
  undefined8 uVar5;
  longlong *plVar6;
  bool bVar7;
  undefined2 local_res20 [4];
  undefined8 in_stack_fffffffffffffec8;
  undefined4 uVar8;
  undefined2 local_118;
  undefined2 local_116;
  undefined4 local_114;
  longlong *local_110;
  longlong *local_108;
  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;
  longlong local_d8;
  longlong local_d0;
  int local_c0;
  short local_bc;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_30;
  
  uVar8 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
  local_e0 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_110);
  plVar1 = local_110;
  if (local_110 != (longlong *)0x0) {
    if (local_110 == local_108) {
      if (*local_110 != 0) {
        FUN_14000a170(&local_d8);
        local_30 = 0;
        *(undefined4 *)(*plVar1 + 0xd84) = 0x140000;
        FUN_140090020(&local_d8);
        if ((local_d8 == 0) && (local_d0 == 0)) {
          bVar7 = false;
        }
        else {
          bVar7 = true;
        }
        if (((bVar7) || (local_c0 != 0)) || (0 < local_bc)) {
          switch(*param_2) {
          case 0:
            local_a8 = *param_3;
            break;
          case 1:
            local_a4 = *param_3;
            break;
          case 2:
            local_a0 = *param_3;
            break;
          case 3:
            local_9c = *param_3;
            break;
          case 4:
            local_98 = *param_3;
            break;
          case 5:
            local_94 = *param_3;
            break;
          default:
            goto switchD_1401c77b4_default;
          }
          local_114 = 0x14;
          uVar5 = FUN_140174f00(&local_110);
          FUN_1401ed220(uVar5,&DAT_14047ba28,&local_114,&local_d8,CONCAT44(uVar8,4));
          local_f0 = *(undefined4 *)(param_1 + 0x160);
          local_ec = *(undefined4 *)(param_1 + 0x164);
          local_e8 = *(undefined4 *)(param_1 + 0x168);
          local_e4 = *(undefined4 *)(param_1 + 0x16c);
          local_100 = *(undefined4 *)(param_1 + 0x170);
          local_fc = *(undefined4 *)(param_1 + 0x174);
          local_f8 = *(undefined4 *)(param_1 + 0x178);
          local_f4 = *(undefined4 *)(param_1 + 0x17c);
          iVar4 = *(int *)(param_1 + 0x284);
          if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar3 != 0)) {
            local_res20[0] = (undefined2)iVar4;
            plVar6 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar6 + 0x140))
                      (plVar6,1,&DAT_1405d85a0,local_res20,&local_100,&local_f0,&local_d8);
          }
          local_118 = 0x14;
          local_116 = 0;
          plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar6 + 0xe0))
                    (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_116,&local_118,
                     &local_d8);
        }
        goto switchD_1401c77b4_default;
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_108) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
switchD_1401c77b4_default:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    pvVar2 = (void *)*local_110;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_110);
  }
  return 1;
}



undefined8 FUN_1401c79d0(longlong param_1,undefined4 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined1 uVar2;
  undefined8 *puVar3;
  code *pcVar4;
  int iVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined4 *puVar8;
  undefined8 uVar9;
  longlong *plVar10;
  ulonglong uVar11;
  longlong lVar12;
  undefined4 *puVar13;
  ulonglong uVar14;
  undefined4 *puVar15;
  uint uVar16;
  bool bVar17;
  undefined1 local_res20 [8];
  undefined1 local_98 [2];
  undefined2 local_96 [3];
  undefined4 *local_90;
  undefined4 *local_88;
  undefined4 *local_80;
  undefined4 local_70 [2];
  undefined4 local_68 [2];
  longlong *local_60;
  longlong *local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 != 1000) {
    return 1;
  }
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_60);
  plVar1 = local_60;
  if (local_60 != (longlong *)0x0) {
    if (local_60 == local_58) {
      if ((longlong *)*local_60 != (longlong *)0x0) {
        lVar7 = (**(code **)(*(longlong *)*local_60 + 0x270))();
        if (lVar7 != 0) {
          *(undefined4 *)(lVar7 + 0x80) = *param_3;
          puVar13 = (undefined4 *)(lVar7 + 0xa8);
          uVar2 = *(undefined1 *)(lVar7 + 0xb4);
          puVar8 = (undefined4 *)0x0;
          local_90 = (undefined4 *)0x0;
          local_88 = (undefined4 *)0x0;
          puVar15 = (undefined4 *)0x0;
          local_80 = (undefined4 *)0x0;
          uVar16 = 0;
          do {
            if ((puVar13 < local_88) && (puVar8 <= puVar13)) {
              lVar12 = (longlong)puVar13 - (longlong)puVar8;
              if (local_88 == puVar15) {
                uVar14 = (longlong)local_88 - (longlong)puVar8 >> 2;
                if (0x3ffffffffffffffe < uVar14) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar4 = (code *)swi(3);
                  uVar9 = (*pcVar4)();
                  return uVar9;
                }
                uVar14 = uVar14 + 1;
                uVar11 = (longlong)puVar15 - (longlong)puVar8 >> 2;
                if (uVar11 < uVar14) {
                  if (0x3fffffffffffffff - (uVar11 >> 1) < uVar11) {
                    uVar11 = 0;
                  }
                  else {
                    uVar11 = uVar11 + (uVar11 >> 1);
                  }
                  if (uVar11 < uVar14) {
                    uVar11 = uVar14;
                  }
                  FUN_140051e60(&local_90,uVar11);
                  puVar8 = local_90;
                  puVar15 = local_80;
                }
              }
              if (local_88 != (undefined4 *)0x0) {
                uVar6 = puVar8[lVar12 >> 2];
LAB_1401c7c05:
                *local_88 = uVar6;
                puVar8 = local_90;
                puVar15 = local_80;
              }
            }
            else {
              if (local_88 == puVar15) {
                uVar14 = (longlong)local_88 - (longlong)puVar8 >> 2;
                if (0x3ffffffffffffffe < uVar14) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar4 = (code *)swi(3);
                  uVar9 = (*pcVar4)();
                  return uVar9;
                }
                uVar14 = uVar14 + 1;
                uVar11 = (longlong)puVar15 - (longlong)puVar8 >> 2;
                if (uVar11 < uVar14) {
                  if (0x3fffffffffffffff - (uVar11 >> 1) < uVar11) {
                    uVar11 = 0;
                  }
                  else {
                    uVar11 = uVar11 + (uVar11 >> 1);
                  }
                  if (uVar11 < uVar14) {
                    uVar11 = uVar14;
                  }
                  FUN_140051e60(&local_90,uVar11);
                  puVar8 = local_90;
                  puVar15 = local_80;
                }
              }
              if (local_88 != (undefined4 *)0x0) {
                uVar6 = *puVar13;
                goto LAB_1401c7c05;
              }
            }
            local_88 = local_88 + 1;
            uVar16 = uVar16 + 1;
            puVar13 = puVar13 + 1;
          } while (uVar16 < 3);
          local_68[0] = *(undefined4 *)(lVar7 + 0x80);
          local_50 = *(undefined4 *)(param_1 + 0x170);
          local_4c = *(undefined4 *)(param_1 + 0x174);
          local_48 = *(undefined4 *)(param_1 + 0x178);
          local_44 = *(undefined4 *)(param_1 + 0x17c);
          iVar5 = *(int *)(param_1 + 0x284);
          local_res20[0] = uVar2;
          if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar12 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar12 != 0)) {
            local_96[0] = (undefined2)iVar5;
            plVar10 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                      );
            (**(code **)(*plVar10 + 0xad0))
                      (plVar10,1,&DAT_1405d85a0,local_96,&local_50,local_68,&local_90,local_res20);
          }
          local_70[0] = *(undefined4 *)(lVar7 + 0x80);
          plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x3c0);
          local_98[0] = uVar2;
          (**(code **)(*plVar10 + 0x710))
                    (plVar10,param_2,&DAT_1405d85a0,local_70,&local_90,local_98);
          if (local_90 != (undefined4 *)0x0) {
            operator_delete(local_90);
          }
          local_90 = (undefined4 *)0x0;
          local_88 = (undefined4 *)0x0;
          local_80 = (undefined4 *)0x0;
        }
        goto LAB_1401c7d88;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar17 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_58) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c7d88:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar7 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar7 == 1) {
    puVar3 = (undefined8 *)*local_60;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_60);
  }
  return 1;
}



undefined8 FUN_1401c7dd0(longlong param_1,undefined4 param_2,longlong *param_3)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  char cVar7;
  bool bVar8;
  char local_res20 [8];
  char local_58 [2];
  undefined2 local_56 [3];
  undefined4 local_50 [2];
  undefined4 local_48 [2];
  undefined8 local_40;
  longlong *local_38;
  longlong *local_30;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  
  local_40 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 != 1000) {
    return 1;
  }
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_38);
  plVar1 = local_38;
  if (local_38 != (longlong *)0x0) {
    if (local_38 == local_30) {
      if ((longlong *)*local_38 != (longlong *)0x0) {
        lVar5 = (**(code **)(*(longlong *)*local_38 + 0x270))();
        if (lVar5 != 0) {
          *(undefined4 *)(lVar5 + 0xa8) = *(undefined4 *)*param_3;
          *(undefined4 *)(lVar5 + 0xac) = *(undefined4 *)(*param_3 + 4);
          *(undefined4 *)(lVar5 + 0xb0) = *(undefined4 *)(*param_3 + 8);
          cVar7 = *(char *)(lVar5 + 0xb4) + '\x01';
          *(char *)(lVar5 + 0xb4) = cVar7;
          local_50[0] = *(undefined4 *)(lVar5 + 0x80);
          local_28 = *(undefined4 *)(param_1 + 0x170);
          local_24 = *(undefined4 *)(param_1 + 0x174);
          local_20 = *(undefined4 *)(param_1 + 0x178);
          local_1c = *(undefined4 *)(param_1 + 0x17c);
          iVar4 = *(int *)(param_1 + 0x284);
          local_res20[0] = cVar7;
          if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
            local_56[0] = (undefined2)iVar4;
            plVar6 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar6 + 0xad0))
                      (plVar6,1,&DAT_1405d85a0,local_56,&local_28,local_50,param_3,local_res20);
          }
          local_48[0] = *(undefined4 *)(lVar5 + 0x80);
          plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x3c0);
          local_58[0] = cVar7;
          (**(code **)(*plVar6 + 0x710))(plVar6,param_2,&DAT_1405d85a0,local_48,param_3,local_58);
          FUN_1401b45d0(param_1);
        }
        goto LAB_1401c8013;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_30) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c8013:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar3 = (undefined8 *)*local_38;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_38);
  }
  return 1;
}



undefined8 FUN_1401c8060(longlong param_1,undefined4 param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  code *pcVar3;
  int iVar4;
  longlong lVar5;
  undefined4 *puVar6;
  undefined8 uVar7;
  longlong *plVar8;
  undefined4 *puVar9;
  uint uVar10;
  ulonglong uVar12;
  undefined4 *puVar13;
  undefined4 *puVar14;
  undefined4 *puVar15;
  bool bVar16;
  undefined1 local_res18 [8];
  undefined1 local_res20 [8];
  undefined4 local_98;
  undefined2 local_94 [2];
  undefined4 *local_90;
  undefined4 *local_88;
  undefined4 *local_80;
  undefined4 local_70 [2];
  undefined4 local_68 [2];
  longlong *local_60;
  longlong *local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined8 local_40;
  undefined4 *puVar11;
  
  local_40 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 != 1000) {
    return 1;
  }
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_60);
  plVar1 = local_60;
  if (local_60 != (longlong *)0x0) {
    if (local_60 == local_58) {
      if ((longlong *)*local_60 != (longlong *)0x0) {
        lVar5 = (**(code **)(*(longlong *)*local_60 + 0x270))();
        if (lVar5 != 0) {
          FUN_1401b44b0(param_1);
          *(undefined1 *)(lVar5 + 0xb4) = 0;
          *(undefined4 *)(lVar5 + 0x80) = 1;
          puVar15 = (undefined4 *)0x0;
          local_90 = (undefined4 *)0x0;
          local_88 = (undefined4 *)0x0;
          local_80 = (undefined4 *)0x0;
          local_98 = 0;
          puVar6 = puVar15;
          puVar11 = puVar15;
          puVar14 = puVar15;
          do {
            if ((&local_98 < local_88) && (puVar6 <= &local_98)) {
              lVar5 = -4 - (longlong)puVar6;
              if (local_88 == puVar14) {
                uVar12 = (longlong)local_88 - (longlong)puVar6 >> 2;
                if (0x3ffffffffffffffe < uVar12) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  uVar7 = (*pcVar3)();
                  return uVar7;
                }
                puVar13 = (undefined4 *)(uVar12 + 1);
                puVar9 = (undefined4 *)((longlong)puVar14 - (longlong)puVar6 >> 2);
                if (puVar9 < puVar13) {
                  puVar6 = puVar15;
                  if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
                    puVar6 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
                  }
                  if (puVar6 < puVar13) {
                    puVar6 = puVar13;
                  }
                  FUN_140051e60(&local_90,puVar6);
                  puVar6 = local_90;
                  puVar14 = local_80;
                }
              }
              if (local_88 != (undefined4 *)0x0) {
                *local_88 = puVar6[(longlong)local_94 + lVar5 >> 2];
                puVar6 = local_90;
                puVar14 = local_80;
              }
            }
            else {
              if (local_88 == puVar14) {
                uVar12 = (longlong)local_88 - (longlong)puVar6 >> 2;
                if (0x3ffffffffffffffe < uVar12) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  uVar7 = (*pcVar3)();
                  return uVar7;
                }
                puVar13 = (undefined4 *)(uVar12 + 1);
                puVar9 = (undefined4 *)((longlong)puVar14 - (longlong)puVar6 >> 2);
                if (puVar9 < puVar13) {
                  puVar6 = puVar15;
                  if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
                    puVar6 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
                  }
                  if (puVar6 < puVar13) {
                    puVar6 = puVar13;
                  }
                  FUN_140051e60(&local_90,puVar6);
                  puVar6 = local_90;
                  puVar14 = local_80;
                }
              }
              if (local_88 != (undefined4 *)0x0) {
                *local_88 = 0;
                puVar6 = local_90;
                puVar14 = local_80;
              }
            }
            local_88 = local_88 + 1;
            uVar10 = (int)puVar11 + 1;
            puVar11 = (undefined4 *)(ulonglong)uVar10;
          } while (uVar10 < 3);
          local_50 = *(undefined4 *)(param_1 + 0x170);
          local_4c = *(undefined4 *)(param_1 + 0x174);
          local_48 = *(undefined4 *)(param_1 + 0x178);
          local_44 = *(undefined4 *)(param_1 + 0x17c);
          iVar4 = *(int *)(param_1 + 0x284);
          local_res18[0] = 0;
          local_68[0] = 1;
          if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
            local_94[0] = (undefined2)iVar4;
            plVar8 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar8 + 0xad0))
                      (plVar8,1,&DAT_1405d85a0,local_94,&local_50,local_68,&local_90,local_res18);
          }
          local_res20[0] = 0;
          local_70[0] = 1;
          plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x3c0);
          (**(code **)(*plVar8 + 0x710))
                    (plVar8,param_2,&DAT_1405d85a0,local_70,&local_90,local_res20);
          if (local_90 != (undefined4 *)0x0) {
            operator_delete(local_90);
          }
          local_90 = (undefined4 *)0x0;
          local_88 = (undefined4 *)0x0;
          local_80 = (undefined4 *)0x0;
        }
        goto LAB_1401c841a;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar16 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar16) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_58) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c841a:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar2 = (undefined8 *)*local_60;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_60);
  }
  return 1;
}



undefined8 FUN_1401c8470(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  undefined4 uVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined *puVar5;
  undefined1 local_res8 [8];
  
  plVar4 = *(longlong **)(param_1 + 0xb50);
  lVar1 = plVar4[0x9e];
  if (99 < *(int *)(param_1 + 0x298)) {
    puVar5 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8010;
    }
    uVar2 = (**(code **)(*plVar4 + 0x168))(plVar4,puVar5);
    lVar3 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),uVar2);
    if (lVar3 != 0) {
      local_res8[0] = 0;
      plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
      (**(code **)(*plVar4 + 0x60))(plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,local_res8);
      return 1;
    }
    if (lVar1 != 0) {
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1b0))(lVar1 + 0x70,1,&DAT_1405d85a0,param_2);
    }
  }
  return 1;
}



undefined8 FUN_1401c8540(longlong param_1,byte *param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_18;
  longlong *local_10;
  
  if (((99 < *(int *)(param_1 + 0x298)) && (*param_2 != 0)) &&
     (FUN_140198570(param_1,&local_18), plVar1 = local_18, local_18 != (longlong *)0x0)) {
    if (local_18 == local_10) {
      lVar3 = *local_18;
      if (lVar3 != 0) {
        *(float *)(lVar3 + 0x7fc) = (float)*param_2 + *(float *)(lVar3 + 0x7fc);
        *(undefined1 *)(lVar3 + 0x607) = 1;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
    if (plVar1 == local_10) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        puVar2 = (undefined8 *)*local_18;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        operator_delete(local_18);
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar5 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return 1;
      }
    }
  }
  return 1;
}



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

{
  longlong lVar1;
  undefined4 uVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined *puVar5;
  
  plVar4 = *(longlong **)(param_1 + 0xb50);
  lVar1 = plVar4[0x9e];
  if (99 < *(int *)(param_1 + 0x298)) {
    puVar5 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8010;
    }
    uVar2 = (**(code **)(*plVar4 + 0x168))(plVar4,puVar5);
    lVar3 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),uVar2);
    if (lVar3 == 0) {
      if (lVar1 != 0) {
        (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1d0))
                  (lVar1 + 0x70,1,&DAT_1405d85a0,param_2,param_3);
      }
    }
    else {
      plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
      (**(code **)(*plVar4 + 0x90))(plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,param_3);
    }
  }
  return 1;
}



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

{
  longlong lVar1;
  undefined4 uVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined *puVar5;
  
  plVar4 = *(longlong **)(param_1 + 0xb50);
  lVar1 = plVar4[0x9e];
  if (99 < *(int *)(param_1 + 0x298)) {
    puVar5 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8010;
    }
    uVar2 = (**(code **)(*plVar4 + 0x168))(plVar4,puVar5);
    lVar3 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),uVar2);
    if (lVar3 == 0) {
      if (lVar1 != 0) {
        (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1e0))
                  (lVar1 + 0x70,1,&DAT_1405d85a0,param_2,param_3);
      }
    }
    else {
      plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
      (**(code **)(*plVar4 + 0xa0))(plVar4,*(undefined4 *)(lVar3 + 8),&DAT_1405d85a0,param_3);
    }
  }
  return 1;
}



undefined8 FUN_1401c87d0(longlong param_1,undefined4 param_2,longlong *param_3)

{
  longlong *plVar1;
  longlong lVar2;
  void *pvVar3;
  code *pcVar4;
  char cVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined4 *puVar8;
  undefined8 uVar9;
  longlong *plVar10;
  undefined *puVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  longlong lVar14;
  ulonglong uVar15;
  undefined4 *puVar16;
  undefined4 local_res10 [2];
  undefined8 local_b0;
  undefined4 *local_80;
  undefined4 *local_78;
  undefined4 *local_70;
  void *local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  plVar1 = *(longlong **)(param_1 + 0xb50);
  lVar2 = plVar1[0x9e];
  if (99 < *(int *)(param_1 + 0x298)) {
    puVar11 = (undefined *)*param_3;
    if ((undefined *)*param_3 == (undefined *)0x0) {
      puVar11 = PTR_DAT_1405d8010;
    }
    local_res10[0] = param_2;
    uVar6 = (**(code **)(*plVar1 + 0x168))(plVar1,puVar11);
    lVar7 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),uVar6);
    if (lVar7 == 0) {
      if (lVar2 != 0) {
        plVar1 = (longlong *)(lVar2 + 0x70);
        (**(code **)(*plVar1 + 0x1f0))(plVar1,1,&DAT_1405d85a0,local_res10,param_3);
      }
    }
    else {
      local_b0 = 0;
      cVar5 = FUN_140195920(param_1 + 0xb28);
      if (cVar5 != '\0') {
        local_b0 = FUN_140195970(param_1 + 0xb28);
        FUN_14034ed40(local_b0);
      }
      plVar1 = *(longlong **)(param_1 + 0x9c0);
      if (plVar1 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
        UNLOCK();
        if (*plVar1 != 0) {
          local_60 = (void *)0x0;
          local_58 = 0;
          local_50 = 0;
          local_80 = (undefined4 *)0x0;
          local_78 = (undefined4 *)0x0;
          local_70 = (undefined4 *)0x0;
          FUN_14025be10(*plVar1,&local_60);
          lVar2 = *plVar1;
          FUN_14034ed40(lVar2 + 0x48);
          lVar7 = *(longlong *)(lVar2 + 0x20);
          if (lVar7 != *(longlong *)(lVar2 + 0x28)) {
            puVar16 = (undefined4 *)(lVar7 + 0x14);
            puVar8 = local_80;
            do {
              uVar15 = 0;
              if ((puVar16 < local_78) && (puVar8 <= puVar16)) {
                lVar14 = (longlong)puVar16 - (longlong)puVar8;
                if (local_78 == local_70) {
                  uVar15 = (longlong)local_78 - (longlong)puVar8 >> 2;
                  if (0x3ffffffffffffffe < uVar15) {
                    std::_Xlength_error("vector<T> too long");
                    pcVar4 = (code *)swi(3);
                    uVar9 = (*pcVar4)();
                    return uVar9;
                  }
                  uVar15 = uVar15 + 1;
                  uVar12 = (longlong)local_70 - (longlong)puVar8 >> 2;
                  if (uVar12 < uVar15) {
                    if (0x3fffffffffffffff - (uVar12 >> 1) < uVar12) {
                      uVar12 = 0;
                    }
                    else {
                      uVar12 = uVar12 + (uVar12 >> 1);
                    }
                    if (uVar12 < uVar15) {
                      uVar12 = uVar15;
                    }
                    FUN_140051e60(&local_80,uVar12);
                    puVar8 = local_80;
                  }
                }
                if (local_78 != (undefined4 *)0x0) {
                  *local_78 = puVar8[lVar14 >> 2];
                  puVar8 = local_80;
                }
              }
              else {
                if (local_78 == local_70) {
                  uVar12 = (longlong)local_78 - (longlong)puVar8 >> 2;
                  if (0x3ffffffffffffffe < uVar12) {
                    std::_Xlength_error("vector<T> too long");
                    break;
                  }
                  uVar12 = uVar12 + 1;
                  uVar13 = (longlong)local_70 - (longlong)puVar8 >> 2;
                  if (uVar13 < uVar12) {
                    if (uVar13 <= 0x3fffffffffffffff - (uVar13 >> 1)) {
                      uVar15 = uVar13 + (uVar13 >> 1);
                    }
                    if (uVar15 < uVar12) {
                      uVar15 = uVar12;
                    }
                    FUN_140051e60(&local_80,uVar15);
                    puVar8 = local_80;
                  }
                }
                if (local_78 != (undefined4 *)0x0) {
                  *local_78 = *puVar16;
                  puVar8 = local_80;
                }
              }
              local_78 = local_78 + 1;
              lVar7 = lVar7 + 0x150;
              puVar16 = puVar16 + 0x54;
            } while (lVar7 != *(longlong *)(lVar2 + 0x28));
          }
          FUN_14034edd0(lVar2 + 0x48);
          plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
          (**(code **)(*plVar10 + 0x70))
                    (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_60,&local_80);
          if (local_80 != (undefined4 *)0x0) {
            operator_delete(local_80);
          }
          local_80 = (undefined4 *)0x0;
          local_78 = (undefined4 *)0x0;
          local_70 = (undefined4 *)0x0;
          if (local_60 != (void *)0x0) {
            operator_delete(local_60);
          }
        }
      }
      if (plVar1 != (longlong *)0x0) {
        LOCK();
        plVar10 = plVar1 + 1;
        lVar2 = *plVar10;
        *(int *)plVar10 = (int)*plVar10 + -1;
        UNLOCK();
        if ((int)lVar2 == 1) {
          pvVar3 = (void *)*plVar1;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0x48);
            FUN_14025c370((longlong)pvVar3 + 0x20);
            FUN_14025c370(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(plVar1);
        }
      }
      if (cVar5 != '\0') {
        FUN_14034edd0(local_b0);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401c8b90(longlong param_1,longlong *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong lVar3;
  void *pvVar4;
  char cVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined *puVar8;
  undefined8 local_40;
  
  plVar2 = *(longlong **)(param_1 + 0xb50);
  lVar3 = plVar2[0x9e];
  if (99 < *(int *)(param_1 + 0x298)) {
    puVar8 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1405d8010;
    }
    uVar6 = (**(code **)(*plVar2 + 0x168))(plVar2,puVar8);
    lVar7 = FUN_14016e240(*(undefined8 *)(param_1 + 0xb50),uVar6);
    if (lVar7 == 0) {
      if (lVar3 != 0) {
        plVar2 = (longlong *)(lVar3 + 0x70);
        (**(code **)(*plVar2 + 0x210))(plVar2,1,&DAT_1405d85a0,param_2,param_3);
      }
    }
    else {
      local_40 = 0;
      cVar5 = FUN_140195920(param_1 + 0xb28);
      if (cVar5 != '\0') {
        local_40 = FUN_140195970(param_1 + 0xb28);
        FUN_14034ed40(local_40);
      }
      plVar2 = *(longlong **)(param_1 + 0x9c0);
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
        UNLOCK();
        if (*plVar2 != 0) {
          FUN_14025bea0(*plVar2,lVar7,*param_3);
        }
      }
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar2 + 1;
        lVar3 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar3 == 1) {
          pvVar4 = (void *)*plVar2;
          if (pvVar4 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar4 + 0x48);
            FUN_14025c370((longlong)pvVar4 + 0x20);
            FUN_14025c370(pvVar4);
            operator_delete(pvVar4);
          }
          operator_delete(plVar2);
        }
      }
      if (cVar5 != '\0') {
        FUN_14034edd0(local_40);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401c8d20(longlong param_1,char *param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_18;
  longlong *local_10;
  
  if (((99 < *(int *)(param_1 + 0x298)) && (*param_2 != '\0')) &&
     (FUN_140198570(param_1,&local_18), plVar1 = local_18, local_18 != (longlong *)0x0)) {
    if (local_18 == local_10) {
      if (*local_18 != 0) {
        FUN_140314970();
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
    if (plVar1 == local_10) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        puVar2 = (undefined8 *)*local_18;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        operator_delete(local_18);
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar5 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return 1;
      }
    }
  }
  return 1;
}



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

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  bool bVar5;
  
  if (*(int *)(param_1 + 0x298) < 100) {
LAB_1401c8eb6:
    uVar3 = 1;
  }
  else {
    plVar1 = *(longlong **)(param_1 + 0x6c0);
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
        lVar4 = *plVar1;
        if (lVar4 != 0) {
          if (plVar1 != *(longlong **)(param_1 + 0x6c8)) {
            iVar2 = DAT_140608048 + 1;
            bVar5 = DAT_140608048 == 0;
            DAT_140608048 = iVar2;
            if (bVar5) {
              FUN_140176d60(1);
            }
            lVar4 = 0;
          }
          FUN_1401f4030(lVar4,param_1,*param_2,*param_3,*param_4);
          goto LAB_1401c8eb6;
        }
      }
      else {
        iVar2 = DAT_140608048 + 1;
        bVar5 = DAT_140608048 == 0;
        DAT_140608048 = iVar2;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
    }
    uVar3 = 0;
  }
  return uVar3;
}



undefined8 FUN_1401c8ec0(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6c8)) {
          iVar2 = DAT_140608048 + 1;
          bVar4 = DAT_140608048 == 0;
          DAT_140608048 = iVar2;
          if (bVar4) {
            FUN_140176d60(1);
          }
          lVar3 = 0;
        }
        FUN_1401f3b70(lVar3,param_1,*param_2,*param_3);
        return 1;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar4 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar4) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



undefined8 FUN_1401c8f70(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  plVar1 = *(longlong **)(param_1 + 0x6c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6c8)) {
          iVar2 = DAT_140608048 + 1;
          bVar4 = DAT_140608048 == 0;
          DAT_140608048 = iVar2;
          if (bVar4) {
            FUN_140176d60(1);
          }
          lVar3 = 0;
        }
        FUN_1401f42b0(lVar3,param_1,*param_2,*param_3);
        return 1;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar4 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar4) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



undefined8
FUN_1401c9020(longlong param_1,undefined4 *param_2,int *param_3,float *param_4,float *param_5,
             float *param_6,float *param_7,float *param_8)

{
  int *piVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  longlong *plVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong lVar10;
  bool bVar11;
  float fVar12;
  float fVar13;
  undefined2 local_res8 [4];
  longlong *local_118;
  longlong *local_110;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100 [2];
  undefined4 local_f8 [2];
  undefined4 local_f0 [2];
  undefined4 local_e8 [2];
  undefined4 local_e0 [2];
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8 [2];
  undefined4 local_b0 [2];
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98 [2];
  undefined4 local_90 [2];
  undefined4 local_88 [2];
  undefined4 local_80 [2];
  undefined4 local_78 [2];
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined8 local_58;
  undefined1 local_50 [8];
  longlong *local_48;
  
  local_58 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_118);
  plVar9 = local_118;
  if (local_118 != (longlong *)0x0) {
    if (local_118 == local_110) {
      if (*local_118 != 0) {
        plVar6 = (longlong *)FUN_140208860(*local_118,*param_2);
        if (plVar6 != (longlong *)0x0) {
          lVar7 = (**(code **)(*plVar6 + 0x280))(plVar6);
          plVar8 = (longlong *)FUN_1401e0340(plVar6,local_50);
          iVar4 = *(int *)(lVar7 + 0x4c);
          if ((iVar4 < 1) || (*(int *)(*plVar8 + 0x38) <= iVar4)) {
            lVar10 = 0;
          }
          else {
            lVar10 = (longlong)(iVar4 + -1) * 0x80 + *(longlong *)(*plVar8 + 0x40);
          }
          if (local_48 != (longlong *)0x0) {
            LOCK();
            plVar9 = local_48 + 1;
            lVar3 = *plVar9;
            *(int *)plVar9 = (int)*plVar9 + -1;
            UNLOCK();
            plVar9 = local_118;
            if ((int)lVar3 == 1) {
              (**(code **)(*local_48 + 8))(local_48);
              LOCK();
              piVar1 = (int *)((longlong)local_48 + 0xc);
              iVar4 = *piVar1;
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              plVar9 = local_118;
              if (iVar4 == 1) {
                (**(code **)(*local_48 + 0x10))(local_48);
                plVar9 = local_118;
              }
            }
          }
          if (lVar10 != 0) {
            iVar4 = *(int *)(lVar10 + 0x3c);
            *(int *)(lVar7 + 0xa8) = *(int *)(lVar7 + 0xa8) + *param_3;
            iVar5 = *(int *)(lVar7 + 0xa8);
            if (iVar4 < *(int *)(lVar7 + 0xa8)) {
              iVar5 = iVar4;
            }
            *(int *)(lVar7 + 0xa8) = iVar5;
            iVar4 = *(int *)(lVar10 + 0x44);
            fVar12 = *param_4 + *(float *)(lVar7 + 0xb0);
            *(float *)(lVar7 + 0xb0) = fVar12;
            if ((float)iVar4 < fVar12) {
              *(float *)(lVar7 + 0xb0) = (float)iVar4;
            }
            iVar4 = *(int *)(lVar10 + 0x48);
            fVar12 = *param_5 + *(float *)(lVar7 + 0xb4);
            *(float *)(lVar7 + 0xb4) = fVar12;
            if ((float)iVar4 < fVar12) {
              *(float *)(lVar7 + 0xb4) = (float)iVar4;
            }
            iVar4 = *(int *)(lVar10 + 0x4c);
            fVar12 = *param_6 + *(float *)(lVar7 + 0xb8);
            *(float *)(lVar7 + 0xb8) = fVar12;
            if ((float)iVar4 < fVar12) {
              *(float *)(lVar7 + 0xb8) = (float)iVar4;
            }
            iVar4 = *(int *)(lVar10 + 0x50);
            fVar12 = *param_7 + *(float *)(lVar7 + 0xbc);
            *(float *)(lVar7 + 0xbc) = fVar12;
            if ((float)iVar4 < fVar12) {
              *(float *)(lVar7 + 0xbc) = (float)iVar4;
            }
            fVar12 = *(float *)(lVar10 + 0x54);
            fVar13 = *param_8 + *(float *)(lVar7 + 0xc0);
            *(float *)(lVar7 + 0xc0) = fVar13;
            if (fVar12 < fVar13) {
              *(float *)(lVar7 + 0xc0) = fVar12;
            }
            local_90[0] = *(undefined4 *)(lVar7 + 0xc0);
            local_78[0] = *(undefined4 *)(lVar7 + 0xbc);
            local_100[0] = *(undefined4 *)(lVar7 + 0xb8);
            local_b0[0] = *(undefined4 *)(lVar7 + 0xb4);
            local_f0[0] = *(undefined4 *)(lVar7 + 0xb0);
            local_88[0] = *(undefined4 *)(lVar7 + 0xac);
            local_e0[0] = *(undefined4 *)(lVar7 + 0xa8);
            local_6c = *(undefined4 *)(param_1 + 0x170);
            local_68 = *(undefined4 *)(param_1 + 0x174);
            local_64 = *(undefined4 *)(param_1 + 0x178);
            local_60 = *(undefined4 *)(param_1 + 0x17c);
            iVar4 = *(int *)(param_1 + 0x284);
            if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
               (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)) {
              local_res8[0] = (undefined2)iVar4;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                       0x70);
              (**(code **)(*plVar8 + 0xc20))
                        (plVar8,1,&DAT_1405d85a0,local_res8,plVar6 + 0x1f6,&local_6c,local_e0,
                         local_88,local_f0,local_b0,local_100,local_78,local_90);
            }
            local_a0 = *(undefined4 *)(lVar7 + 0x84);
            local_a8 = *(undefined4 *)(lVar7 + 0x88);
            local_b8[0] = *(undefined4 *)(lVar7 + 0x8c);
            local_c0 = *(undefined4 *)(lVar7 + 0x90);
            local_c8 = *(undefined4 *)(lVar7 + 0x94);
            local_d0 = *(undefined4 *)(lVar7 + 0x98);
            local_d8 = *(undefined4 *)(lVar7 + 0x9c);
            local_e8[0] = *(undefined4 *)(lVar7 + 0xa0);
            local_f8[0] = *(undefined4 *)(lVar7 + 0xa4);
            local_bc = *(undefined4 *)(lVar7 + 0xa8);
            local_80[0] = *(undefined4 *)(lVar7 + 0xac);
            local_c4 = *(undefined4 *)(lVar7 + 0xb0);
            local_9c = *(undefined4 *)(lVar7 + 0xb4);
            local_cc = *(undefined4 *)(lVar7 + 0xb8);
            local_70 = *(undefined4 *)(lVar7 + 0xbc);
            local_d4 = *(undefined4 *)(lVar7 + 0xc0);
            local_a4 = *(undefined4 *)(lVar7 + 0x78);
            FUN_140215140(plVar6);
            local_108 = 0;
            local_104 = 0;
            local_98[0] = (undefined4)plVar6[0x25];
            plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
            (**(code **)(*plVar6 + 0x780))
                      (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_98,&local_a0,
                       &local_a8,local_b8,&local_c0,&local_c8,&local_d0,&local_d8,local_e8,local_f8,
                       &local_104,&local_108,&local_bc,local_80,&local_c4,&local_9c,&local_cc,
                       &local_70,&local_d4,&local_a4);
          }
        }
        goto LAB_1401c9585;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar11 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar9 == (longlong *)0x0) {
    return 1;
  }
  if (plVar9 != local_110) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401c9585:
  LOCK();
  plVar9 = plVar9 + 1;
  *(int *)plVar9 = (int)*plVar9 + -1;
  UNLOCK();
  if ((int)*plVar9 == 0) {
    puVar2 = (undefined8 *)*local_118;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_118);
  }
  return 1;
}



undefined8 FUN_1401c95d0(longlong param_1,int *param_2,int *param_3,uint *param_4,int *param_5)

{
  short sVar1;
  int iVar2;
  int iVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong lVar8;
  uint *puVar9;
  int *piVar10;
  int iVar11;
  ulonglong uVar12;
  short *psVar13;
  uint uVar14;
  undefined4 uVar15;
  int iVar16;
  short *psVar17;
  ulonglong uVar18;
  short *psVar19;
  longlong lVar20;
  undefined4 uVar21;
  ulonglong local_res20;
  short *local_58;
  short *local_50;
  undefined8 local_48;
  
  uVar14 = *param_4;
  lVar5 = FUN_140165ea0();
  if (*(longlong *)(lVar5 + 0x40) != 0) {
    for (puVar9 = *(uint **)(*(longlong *)(lVar5 + 0x40) +
                            ((ulonglong)uVar14 % (ulonglong)*(uint *)(lVar5 + 0x50)) * 8);
        puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0x1ee)) {
      if ((puVar9[0x1f0] == uVar14) && (*puVar9 == uVar14)) {
        if (puVar9 == (uint *)0x0) {
          return 1;
        }
        if (*(int *)(param_1 + 0x298) < 100) {
          return 1;
        }
        uVar6 = FUN_140165ea0();
        uVar21 = FUN_140165b60(uVar6,*param_4,*param_5);
        local_58 = (short *)0x0;
        local_50 = (short *)0x0;
        local_48 = 0;
        iVar2 = *param_5;
        uVar14 = *param_4;
        uVar6 = FUN_140165ea0();
        psVar13 = (short *)0x0;
        psVar19 = (short *)0x0;
        if (-1 < iVar2) {
          FUN_140165d80(uVar6,&local_58,uVar14,iVar2);
          psVar13 = local_50;
          psVar19 = local_58;
        }
        iVar2 = *param_2;
        local_res20 = CONCAT44(local_res20._4_4_,iVar2);
        iVar3 = *param_3;
        printf("------------------------------------------------------------------------\n");
        printf("Player01 Lv.[%d] Player02 Lv.[%d] : DUNGEON [%d] Difficult [%d]\n");
        printf("------------------------------------------------------------------------\n");
        uVar4 = local_res20;
        uVar14 = 0;
        lVar5 = (longlong)psVar13 - (longlong)psVar19 >> 0x3f;
        lVar20 = ((longlong)psVar13 - (longlong)psVar19) / 0x28 + lVar5;
        psVar17 = psVar19;
        if (lVar20 == lVar5) goto LAB_1401c9994;
        goto LAB_1401c9740;
      }
    }
  }
  return 1;
LAB_1401c9740:
  uVar12 = 0;
  psVar13 = psVar19;
  if (7 < *(ulonglong *)(psVar19 + 0xc)) {
    psVar13 = *(short **)psVar19;
  }
  lVar7 = FUN_140302f80();
  lVar8 = (**(code **)(PTR_PTR_1405d8520 + 0x18))();
  uVar18 = lVar8 + 0x18;
  iVar16 = 0;
  iVar11 = iVar16;
  local_res20 = uVar18;
  if (psVar13 == (short *)0x0) {
LAB_1401c97bf:
    FUN_140306fd0(&local_res20,psVar13,iVar11);
    uVar18 = local_res20;
  }
  else {
    if (((ulonglong)psVar13 & 0xffffffffffff0000) != 0) {
      lVar8 = -1;
      psVar17 = psVar13;
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      iVar11 = ~(uint)lVar8 - 1;
      goto LAB_1401c97bf;
    }
    lVar8 = FUN_140306ad0((ulonglong)psVar13 & 0xffff,0);
    if (lVar8 != 0) {
      FUN_140306d00(&local_res20,lVar8,(ulonglong)psVar13 & 0xffff);
      uVar18 = local_res20;
    }
  }
  lVar7 = FUN_14033da60(lVar7 + 0xd8,uVar18);
  LOCK();
  piVar10 = (int *)(uVar18 - 8);
  iVar11 = *piVar10;
  *piVar10 = *piVar10 + -1;
  UNLOCK();
  if (iVar11 + -1 < 1) {
    (**(code **)(**(longlong **)(uVar18 - 0x18) + 8))();
  }
  if (lVar7 != 0) {
    if (lVar7 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    uVar12 = (ulonglong)*(uint *)(lVar7 + 8);
  }
  lVar7 = FUN_140302f80();
  iVar11 = (int)uVar12;
  if (*(longlong *)(lVar7 + 0x90) != 0) {
    for (piVar10 = *(int **)(*(longlong *)(lVar7 + 0x90) +
                            (uVar12 % (ulonglong)*(uint *)(lVar7 + 0xa0)) * 8);
        piVar10 != (int *)0x0; piVar10 = *(int **)(piVar10 + 0x248)) {
      if ((piVar10[0x24a] == iVar11) && (*piVar10 == iVar11)) {
        if (piVar10 != (int *)0x0) {
          lVar8 = FUN_140302f80();
          lVar7 = DAT_140608098;
          if (*(longlong *)(lVar8 + 0x90) == 0) goto LAB_1401c98d3;
          piVar10 = *(int **)(*(longlong *)(lVar8 + 0x90) +
                             (uVar12 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
          goto LAB_1401c9892;
        }
        break;
      }
    }
  }
  goto LAB_1401c995e;
LAB_1401c9892:
  if (piVar10 == (int *)0x0) goto LAB_1401c98d3;
  if ((piVar10[0x24a] == iVar11) && (*piVar10 == iVar11)) {
    if (piVar10 != (int *)0x0) {
      if (piVar10 == (int *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      iVar16 = piVar10[0x78];
    }
    goto LAB_1401c98d3;
  }
  piVar10 = *(int **)(piVar10 + 0x248);
  goto LAB_1401c9892;
LAB_1401c98d3:
  if ((iVar16 < 1) || (*(int *)(DAT_140608098 + 8) < iVar16)) {
    uVar15 = 0xffffffff;
  }
  else {
    lVar8 = DAT_140608098 + 0x1c0;
    FUN_14034ed40(lVar8);
    uVar15 = *(undefined4 *)(*(longlong *)(lVar7 + 0x20) + -4 + (longlong)iVar16 * 4);
    FUN_14034edd0(lVar8);
  }
  FUN_140167570(uVar4 & 0xffffffff,iVar16,uVar15,iVar3 + iVar2,uVar21);
  FUN_140167570(iVar3,iVar16);
  printf("EnemyID [%d] EnemyExp [%d] - Player01 EXP [%d]\t");
  printf("Player02 EXP [%d]\n");
LAB_1401c995e:
  uVar14 = uVar14 + 1;
  psVar19 = psVar19 + 0x14;
  psVar13 = local_50;
  psVar17 = local_58;
  if ((ulonglong)(lVar20 - lVar5) <= (ulonglong)uVar14) {
LAB_1401c9994:
    printf("------------------------------------------------------------------------\n");
    psVar19 = psVar17;
    if (psVar17 == (short *)0x0) {
      return 1;
    }
    for (; psVar19 != psVar13; psVar19 = psVar19 + 0x14) {
      if (7 < *(ulonglong *)(psVar19 + 0xc)) {
        operator_delete(*(void **)psVar19);
      }
      psVar19[0xc] = 7;
      psVar19[0xd] = 0;
      psVar19[0xe] = 0;
      psVar19[0xf] = 0;
      psVar19[8] = 0;
      psVar19[9] = 0;
      psVar19[10] = 0;
      psVar19[0xb] = 0;
      *psVar19 = 0;
    }
    operator_delete(psVar17);
    return 1;
  }
  goto LAB_1401c9740;
}



undefined8
FUN_1401c9a10(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  code *pcVar3;
  int iVar4;
  uint uVar5;
  undefined4 uVar6;
  longlong *plVar7;
  undefined8 uVar8;
  longlong *plVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  longlong lVar12;
  undefined4 *puVar13;
  undefined4 *puVar14;
  undefined4 *puVar15;
  undefined4 *puVar16;
  undefined4 *puVar17;
  undefined4 *puVar18;
  undefined4 *puVar19;
  bool bVar20;
  longlong *local_90;
  longlong *local_88;
  undefined4 *local_80;
  undefined4 *local_78;
  undefined4 *local_70;
  undefined4 *local_60;
  undefined4 *local_58;
  undefined4 *local_50;
  
  FUN_140198570(param_1,&local_90,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_90;
  if (local_90 != (longlong *)0x0) {
    if (local_90 == local_88) {
      if (*local_90 != 0) {
        puVar18 = (undefined4 *)0x0;
        local_80 = (undefined4 *)0x0;
        puVar13 = (undefined4 *)0x0;
        local_78 = (undefined4 *)0x0;
        puVar19 = (undefined4 *)0x0;
        local_70 = (undefined4 *)0x0;
        puVar17 = (undefined4 *)0x0;
        local_60 = (undefined4 *)0x0;
        puVar14 = (undefined4 *)0x0;
        local_58 = (undefined4 *)0x0;
        local_50 = (undefined4 *)0x0;
        plVar7 = (longlong *)FUN_1403161f0();
        if (plVar7[1] != 0) {
          uVar10 = 0;
          if (*(uint *)(plVar7 + 2) != 0) {
            plVar9 = (longlong *)*plVar7;
            do {
              if (*plVar9 != 0) {
                puVar15 = (undefined4 *)((longlong *)*plVar7)[uVar10];
                goto LAB_1401c9aee;
              }
              uVar5 = (int)uVar10 + 1;
              uVar10 = (ulonglong)uVar5;
              plVar9 = plVar9 + 1;
            } while (uVar5 < *(uint *)(plVar7 + 2));
          }
        }
        puVar15 = (undefined4 *)0x0;
LAB_1401c9aee:
        puVar16 = puVar15;
        puVar15 = puVar18;
        if (puVar16 != (undefined4 *)0x0) {
          if ((puVar16 < puVar13) && (puVar18 <= puVar16)) {
            lVar12 = (longlong)puVar16 - (longlong)puVar18;
            if (puVar13 == puVar19) {
              uVar10 = (longlong)puVar13 - (longlong)puVar18 >> 2;
              if (0x3ffffffffffffffe < uVar10) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                uVar8 = (*pcVar3)();
                return uVar8;
              }
              uVar10 = uVar10 + 1;
              uVar11 = (longlong)puVar19 - (longlong)puVar18 >> 2;
              if (uVar11 < uVar10) {
                if (0x3fffffffffffffff - (uVar11 >> 1) < uVar11) {
                  uVar11 = 0;
                }
                else {
                  uVar11 = uVar11 + (uVar11 >> 1);
                }
                if (uVar11 < uVar10) {
                  uVar11 = uVar10;
                }
                FUN_140051e60(&local_80,uVar11);
                puVar13 = local_78;
                puVar18 = local_80;
                puVar19 = local_70;
              }
            }
            if (puVar13 != (undefined4 *)0x0) {
              uVar6 = puVar18[lVar12 >> 2];
LAB_1401c9c23:
              *puVar13 = uVar6;
            }
          }
          else {
            if (puVar13 == puVar19) {
              uVar10 = (longlong)puVar13 - (longlong)puVar18 >> 2;
              if (0x3ffffffffffffffe < uVar10) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                uVar8 = (*pcVar3)();
                return uVar8;
              }
              uVar10 = uVar10 + 1;
              uVar11 = (longlong)puVar19 - (longlong)puVar18 >> 2;
              if (uVar11 < uVar10) {
                if (0x3fffffffffffffff - (uVar11 >> 1) < uVar11) {
                  uVar11 = 0;
                }
                else {
                  uVar11 = uVar11 + (uVar11 >> 1);
                }
                if (uVar11 < uVar10) {
                  uVar11 = uVar10;
                }
                FUN_140051e60(&local_80,uVar11);
                puVar13 = local_78;
                puVar18 = local_80;
                puVar19 = local_70;
              }
            }
            if (puVar13 != (undefined4 *)0x0) {
              uVar6 = *puVar16;
              goto LAB_1401c9c23;
            }
          }
          puVar13 = puVar13 + 1;
          puVar15 = puVar16 + 3;
          local_78 = puVar13;
          if ((puVar15 < puVar14) && (puVar17 <= puVar15)) {
            lVar12 = (longlong)puVar15 - (longlong)puVar17;
            if (puVar14 == local_50) {
              uVar10 = (longlong)puVar14 - (longlong)puVar17 >> 2;
              if (0x3ffffffffffffffe < uVar10) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                uVar8 = (*pcVar3)();
                return uVar8;
              }
              if ((ulonglong)((longlong)local_50 - (longlong)puVar17 >> 2) < uVar10 + 1) {
                FUN_140051e60(&local_60);
                puVar14 = local_58;
                puVar17 = local_60;
              }
            }
            if (puVar14 != (undefined4 *)0x0) {
              uVar6 = puVar17[lVar12 >> 2];
LAB_1401c9d12:
              *puVar14 = uVar6;
            }
          }
          else {
            if (puVar14 == local_50) {
              uVar10 = (longlong)puVar14 - (longlong)puVar17 >> 2;
              if (0x3ffffffffffffffe < uVar10) {
                std::_Xlength_error("vector<T> too long");
                pcVar3 = (code *)swi(3);
                uVar8 = (*pcVar3)();
                return uVar8;
              }
              if ((ulonglong)((longlong)local_50 - (longlong)puVar17 >> 2) < uVar10 + 1) {
                FUN_140051e60(&local_60);
                puVar14 = local_58;
                puVar17 = local_60;
              }
            }
            if (puVar14 != (undefined4 *)0x0) {
              uVar6 = *puVar15;
              goto LAB_1401c9d12;
            }
          }
          puVar14 = puVar14 + 1;
          puVar15 = *(undefined4 **)(puVar16 + 0xe8);
          local_58 = puVar14;
          if (puVar15 == (undefined4 *)0x0) {
            uVar5 = (uint)puVar16[0xea] % *(uint *)(plVar7 + 2) + 1;
            lVar12 = (longlong)(int)uVar5 << 3;
            do {
              if (*(uint *)(plVar7 + 2) <= uVar5) break;
              if (*(longlong *)(lVar12 + *plVar7) != 0) {
                puVar15 = *(undefined4 **)(lVar12 + *plVar7);
              }
              uVar5 = uVar5 + 1;
              lVar12 = lVar12 + 8;
            } while (puVar15 == (undefined4 *)0x0);
          }
          goto LAB_1401c9aee;
        }
        for (; puVar15 != puVar13; puVar15 = puVar15 + 1) {
          plVar7 = (longlong *)FUN_140267710(*puVar17);
          if (plVar7 != (longlong *)0x0) {
            (**(code **)(*plVar7 + 8))(plVar7,*puVar15);
            *(undefined4 *)((longlong)plVar7 + 0x6c) = 5;
            FUN_140236f40(*plVar1,param_1,plVar7);
          }
        }
        if (puVar17 != (undefined4 *)0x0) {
          operator_delete(puVar17);
        }
        if (puVar18 != (undefined4 *)0x0) {
          operator_delete(puVar18);
        }
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar20 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_88) {
      LOCK();
      plVar1 = plVar1 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        puVar2 = (undefined8 *)*local_90;
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        operator_delete(local_90);
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar20 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401c9e80(longlong param_1,ushort *param_2,ushort *param_3,ulonglong param_4)

{
  longlong lVar1;
  longlong *plVar2;
  ushort uVar3;
  ushort uVar4;
  void *pvVar5;
  int iVar6;
  longlong lVar7;
  longlong *plVar8;
  bool bVar9;
  undefined1 *puVar10;
  undefined8 in_stack_fffffffffffffe90;
  undefined4 *puVar11;
  ulonglong uVar12;
  ulonglong in_stack_fffffffffffffe98;
  undefined4 uVar14;
  undefined8 in_stack_fffffffffffffea0;
  undefined4 *puVar15;
  undefined8 uVar16;
  undefined4 uVar18;
  undefined4 *in_stack_fffffffffffffea8;
  ulonglong uVar19;
  undefined2 local_148 [4];
  undefined4 local_140 [2];
  int local_138 [2];
  undefined4 local_130 [2];
  int local_128;
  int local_124;
  longlong *local_120;
  longlong *local_118;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined8 local_f0;
  longlong local_e8;
  undefined1 local_d8 [28];
  short local_bc;
  short local_64;
  undefined4 local_30;
  undefined4 uVar13;
  undefined4 uVar17;
  
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffe90 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
  local_f0 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_120);
  plVar2 = local_120;
  if (local_120 != (longlong *)0x0) {
    if (local_120 == local_118) {
      lVar7 = *local_120;
      if (lVar7 != 0) {
        FUN_14000a170(local_d8);
        local_30 = 0;
        uVar3 = *param_2;
        if (uVar3 == 5) {
          uVar3 = *param_3;
          lVar1 = lVar7 + 0xf630;
          local_e8 = lVar1;
          FUN_14034ed40(lVar1);
          if (uVar3 < 0x78) {
            FUN_140090020(local_d8,(longlong)(short)uVar3 * 0xac + 0x50a8 + lVar7);
          }
          FUN_14034edd0(lVar1);
          if (local_64 != 0) goto LAB_1401ca1a0;
          local_138[0] = (int)(short)*param_3;
          iVar6 = FUN_14019a310(param_1,local_138,param_4);
        }
        else {
          uVar4 = *param_3;
          if ((uVar3 < 5) && (uVar4 < 0x18)) {
            lVar7 = ((longlong)(short)uVar4 + (longlong)(short)uVar3 * 0x18) * 0xac + lVar7;
            *(ushort *)(lVar7 + 0x14) = uVar3;
            *(ushort *)(lVar7 + 0x16) = uVar4;
            FUN_140090020(local_d8);
          }
          if (local_64 != 0) goto LAB_1401ca1a0;
          local_124 = (int)(short)*param_3;
          local_128 = (int)(short)*param_2;
          iVar6 = FUN_14019a480(param_1,&local_128,&local_124,param_4);
        }
        if (iVar6 != 0) {
          local_100 = *(undefined4 *)(param_1 + 0x160);
          local_fc = *(undefined4 *)(param_1 + 0x164);
          local_f8 = *(undefined4 *)(param_1 + 0x168);
          local_f4 = *(undefined4 *)(param_1 + 0x16c);
          local_110 = *(undefined4 *)(param_1 + 0x170);
          local_10c = *(undefined4 *)(param_1 + 0x174);
          local_108 = *(undefined4 *)(param_1 + 0x178);
          local_104 = *(undefined4 *)(param_1 + 0x17c);
          iVar6 = *(int *)(param_1 + 0x284);
          local_130[0] = 0xffffffff;
          local_140[0] = 0xfffffffc;
          if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar7 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar7 != 0)) {
            local_148[0] = (undefined2)iVar6;
            plVar8 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
            in_stack_fffffffffffffea8 = local_130;
            puVar15 = local_140;
            puVar11 = &local_100;
            (**(code **)(*plVar8 + 0x130))
                      (plVar8,1,&DAT_1405d85a0,local_148,&local_110,puVar11,param_4,puVar15,
                       in_stack_fffffffffffffea8);
            uVar13 = (undefined4)((ulonglong)puVar11 >> 0x20);
            uVar17 = (undefined4)((ulonglong)puVar15 >> 0x20);
            in_stack_fffffffffffffe98 = param_4;
          }
          uVar19 = (ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000;
          uVar16 = CONCAT44(uVar17,(int)local_bc);
          in_stack_fffffffffffffe98 = in_stack_fffffffffffffe98 & 0xffffffff00000000;
          uVar12 = CONCAT44(uVar13,(int)local_bc);
          puVar10 = local_d8;
          FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1c9,0x3d,param_1,puVar10,uVar12,
                        in_stack_fffffffffffffe98,uVar16,uVar19);
          uVar17 = (undefined4)((ulonglong)puVar10 >> 0x20);
          uVar14 = (undefined4)(in_stack_fffffffffffffe98 >> 0x20);
          uVar18 = (undefined4)((ulonglong)uVar16 >> 0x20);
          lVar7 = FUN_140174f00(param_1 + 0x6c0);
          uVar13 = *(undefined4 *)(lVar7 + 0x50a0);
          lVar7 = FUN_140174f00(param_1 + 0x6c0);
          FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,local_d8,0x192,
                        CONCAT44(uVar17,0x33),uVar12 & 0xffffffff00000000,
                        CONCAT44(uVar14,*(undefined4 *)(lVar7 + 0x50a0)),CONCAT44(uVar18,uVar13),
                        uVar19 & 0xffffffff00000000,0);
        }
        goto LAB_1401ca1a0;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar9 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar2 == (longlong *)0x0) {
    return 1;
  }
  if (plVar2 != local_118) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401ca1a0:
  LOCK();
  plVar2 = plVar2 + 1;
  *(int *)plVar2 = (int)*plVar2 + -1;
  UNLOCK();
  if ((int)*plVar2 == 0) {
    pvVar5 = (void *)*local_120;
    if (pvVar5 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar5 + 0xf630);
      operator_delete(pvVar5);
    }
    operator_delete(local_120);
  }
  return 1;
}



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

{
  longlong lVar1;
  undefined4 *puVar2;
  int iVar3;
  longlong *plVar4;
  int local_res10 [2];
  int local_res18 [4];
  undefined8 uVar5;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  void *local_60;
  undefined8 local_58;
  undefined8 local_50;
  void *local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  puVar2 = param_7;
  uVar5 = 0xfffffffffffffffe;
  param_6._0_2_ = *param_6;
  param_6._2_2_ = (short)param_6 >> 0xf;
  param_5._0_4_ = (int)*param_5;
  local_res10[0] = (int)*param_3;
  local_res18[0] = (int)*param_2;
  iVar3 = FUN_14019a600(param_1,local_res18,local_res10,param_4,&param_5,&param_6,param_7);
  if (iVar3 != 0) {
    local_40 = (void *)0x0;
    local_38 = 0;
    local_30 = 0;
    local_60 = (void *)0x0;
    local_58 = 0;
    local_50 = 0;
    FUN_140198b90(param_1,&local_40,&local_60,*puVar2);
    local_70 = *(undefined4 *)(param_1 + 0x170);
    local_6c = *(undefined4 *)(param_1 + 0x174);
    local_68 = *(undefined4 *)(param_1 + 0x178);
    local_64 = *(undefined4 *)(param_1 + 0x17c);
    iVar3 = *(int *)(param_1 + 0x284);
    param_5._0_4_ = *puVar2;
    if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
       (lVar1 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar1 != 0)) {
      param_6._0_2_ = (short)iVar3;
      plVar4 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar1 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar4 + 0x290))
                (plVar4,1,&DAT_1405d85a0,&param_6,&local_70,&local_40,&local_60,&param_5,uVar5);
    }
    if (local_60 != (void *)0x0) {
      operator_delete(local_60);
    }
    local_60 = (void *)0x0;
    local_58 = 0;
    local_50 = 0;
    if (local_40 != (void *)0x0) {
      operator_delete(local_40);
    }
  }
  return 1;
}



undefined8 FUN_1401ca390(longlong param_1,undefined8 param_2,short *param_3,uint *param_4)

{
  longlong *plVar1;
  uint uVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined4 uVar5;
  longlong lVar6;
  undefined8 uVar7;
  uint *puVar8;
  longlong *plVar9;
  undefined2 *puVar10;
  int *piVar11;
  bool bVar12;
  undefined2 *puVar13;
  undefined2 local_48;
  undefined2 local_46;
  undefined2 local_44;
  undefined2 local_42;
  undefined4 local_40;
  int local_3c;
  int local_38 [2];
  longlong *local_30;
  longlong *local_28;
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  puVar8 = param_4;
  FUN_140198570();
  plVar1 = local_30;
  if (local_30 != (longlong *)0x0) {
    if (local_30 == local_28) {
      if (*local_30 != 0) {
        uVar2 = *puVar8;
        lVar6 = FUN_140137690();
        if (*(longlong *)(lVar6 + 0x88) != 0) {
          for (puVar8 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                                  ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar6 + 0x98)) * 8);
              puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 0xa6)) {
            if ((puVar8[0xa8] == uVar2) && (*puVar8 == uVar2)) {
              if (puVar8 != (uint *)0x0) {
                if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                if ((puVar8 != (uint *)0xfffffffffffffff8) &&
                   (*(uint *)(*plVar1 + 0x120) == puVar8[0x42])) {
                  uVar2 = puVar8[0x25];
                  uVar5 = *(undefined4 *)(*plVar1 + 0x120);
                  uVar7 = FUN_140131520();
                  uVar5 = FUN_140131450(uVar7,uVar5,uVar2);
                  local_38[0] = (int)*param_3;
                  local_40 = uVar5;
                  iVar4 = FUN_1401aa470(param_1,local_38,&local_40,param_4);
                  plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  if (iVar4 == 0) {
                    local_42 = 5;
                    local_3c = 0x19;
                    puVar13 = &local_46;
                    puVar10 = &local_42;
                    piVar11 = &local_3c;
                    local_46 = (short)uVar5;
                  }
                  else {
                    local_48 = 5;
                    local_38[1] = 1;
                    puVar13 = &local_44;
                    puVar10 = &local_48;
                    piVar11 = local_38 + 1;
                    local_44 = (short)uVar5;
                  }
                  (**(code **)(*plVar9 + 0x800))
                            (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,piVar11,param_2,
                             puVar10,param_3,puVar13,param_4);
                }
              }
              break;
            }
          }
        }
        goto LAB_1401ca594;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_28) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401ca594:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    puVar3 = (undefined8 *)*local_30;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_30);
  }
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401ca6bd)
// WARNING: Removing unreachable block (ram,0x0001401ca6c9)
// WARNING: Removing unreachable block (ram,0x0001401ca6db)
// WARNING: Removing unreachable block (ram,0x0001401ca6e0)
// WARNING: Removing unreachable block (ram,0x0001401ca6e5)
// WARNING: Removing unreachable block (ram,0x0001401ca6e9)
// WARNING: Removing unreachable block (ram,0x0001401ca6f2)
// WARNING: Removing unreachable block (ram,0x0001401ca6f5)
// WARNING: Removing unreachable block (ram,0x0001401ca768)

undefined8 FUN_1401ca5f0(void)

{
  uint *puVar1;
  int iVar2;
  longlong lVar3;
  int *piVar4;
  uint uVar5;
  
  uVar5 = 0;
  iVar2 = FUN_14019a9f0();
  if (iVar2 == 0) {
    return 1;
  }
  lVar3 = FUN_140137690();
  if (*(longlong *)(lVar3 + 0x88) != 0) {
    for (piVar4 = *(int **)(*(longlong *)(lVar3 + 0x88) +
                           (0U % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8); piVar4 != (int *)0x0;
        piVar4 = *(int **)(piVar4 + 0xa6)) {
      if ((piVar4[0xa8] == 0) && (*piVar4 == 0)) {
        if (piVar4 != (int *)0x0) goto LAB_1401ca6a2;
        break;
      }
    }
  }
  piVar4 = (int *)0x0;
LAB_1401ca6a2:
  if (piVar4 != (int *)0x0) {
    uVar5 = piVar4[0x18];
  }
  FUN_1402e0270();
  lVar3 = FUN_1402e0270();
  if ((0 < (int)uVar5) && (*(longlong *)(lVar3 + 0x1f8) != 0)) {
    for (puVar1 = *(uint **)(*(longlong *)(lVar3 + 0x1f8) +
                            ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar3 + 0x208)) * 8);
        (puVar1 != (uint *)0x0 && ((puVar1[4] != uVar5 || (*puVar1 != uVar5))));
        puVar1 = *(uint **)(puVar1 + 2)) {
    }
  }
  return 1;
}



undefined8 FUN_1401ca7a0(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x9c8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x9c8)) &&
           (iVar2 = DAT_1406080d0 + 1, bVar6 = DAT_1406080d0 == 0, lVar3 = lVar5,
           DAT_1406080d0 = iVar2, bVar6)) {
          FUN_140176d60(1);
        }
        FUN_14025aad0(lVar3,param_1,param_2,*param_3,uVar8,lVar9,uVar10);
      }
    }
    else {
      iVar2 = DAT_1406080d0 + 1;
      bVar6 = DAT_1406080d0 == 0;
      DAT_1406080d0 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return 1;
}



undefined8 FUN_1401ca900(longlong param_1,undefined4 *param_2,uint *param_3)

{
  undefined8 *puVar1;
  undefined4 uVar2;
  ulonglong *puVar3;
  void *pvVar4;
  int iVar5;
  longlong *plVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined8 uVar9;
  ulonglong uVar10;
  uint *puVar11;
  int iVar12;
  uint uVar13;
  ulonglong uVar14;
  ulonglong uVar15;
  ulonglong uVar16;
  ulonglong uVar17;
  ulonglong uVar18;
  bool bVar19;
  bool bVar20;
  ulonglong local_118;
  longlong local_e8;
  longlong local_e0;
  int local_d0;
  short local_cc;
  short local_c0;
  undefined4 local_40;
  
  uVar13 = *param_3;
  plVar6 = (longlong *)FUN_1402e0270();
  if (*plVar6 != 0) {
    for (puVar11 = *(uint **)(*plVar6 + ((ulonglong)uVar13 % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
        puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0x90)) {
      if ((puVar11[0x92] == uVar13) && (*puVar11 == uVar13)) {
        if (puVar11 != (uint *)0x0) {
          if (puVar11 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar13 = puVar11[0x1a];
          goto LAB_1401ca994;
        }
        break;
      }
    }
  }
  uVar13 = 0;
LAB_1401ca994:
  uVar15 = 0;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if ((DAT_140609430 == 0) || ((int)uVar13 <= DAT_140609430)) {
    local_118 = 0;
    bVar20 = false;
    puVar3 = *(ulonglong **)(param_1 + 0xb28);
    if (puVar3 != (ulonglong *)0x0) {
      if (puVar3 == *(ulonglong **)(param_1 + 0xb30)) {
        if (*puVar3 != 0) {
          local_118 = *puVar3;
          if ((puVar3 != *(ulonglong **)(param_1 + 0xb30)) &&
             (iVar5 = DAT_1406080a8 + 1, bVar20 = DAT_1406080a8 == 0, local_118 = uVar15,
             DAT_1406080a8 = iVar5, bVar20)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40();
          bVar20 = true;
        }
      }
      else {
        iVar5 = DAT_1406080a8 + 1;
        bVar19 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar5;
        if (bVar19) {
          FUN_140176d60(1);
        }
      }
    }
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (((DAT_14060a120 != 0xcc) && (DAT_14060a120 != 0x68)) || (*(byte *)(param_1 + 0x600) < 2)) {
      puVar1 = (undefined8 *)(param_1 + 0x9c0);
      plVar6 = (longlong *)*puVar1;
      if (plVar6 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar6 + 1) = (int)plVar6[1] + 1;
        UNLOCK();
        if ((*plVar6 != 0) && (iVar5 = FUN_1402566c0(*plVar6,param_1,*param_2,*param_3), iVar5 != 0)
           ) {
          FUN_140259110(*plVar6,param_1,*param_2,*param_3);
          lVar7 = FUN_140174f50(param_1 + 0x6e0);
          if (lVar7 != 0) {
            plVar8 = (longlong *)FUN_140174f50(param_1 + 0x6e0);
            lVar7 = (**(code **)(*plVar8 + 0x270))(plVar8);
            uVar2 = *(undefined4 *)(lVar7 + 0x5c);
            uVar9 = FUN_1401de9e0(puVar1);
            FUN_1402584f0(uVar9,param_1,uVar2);
          }
          uVar9 = FUN_1402e0270();
          iVar5 = FUN_1402e0090(uVar9,*param_3);
          lVar7 = FUN_140174f00((longlong *)(param_1 + 0x6c0));
          if ((lVar7 != 0) &&
             (uVar14 = uVar15, uVar16 = uVar15, uVar18 = uVar15, uVar17 = uVar15, iVar5 == 0x3e)) {
            do {
              do {
                FUN_14000a170(&local_e8);
                iVar5 = DAT_140608048;
                local_40 = 0;
                puVar3 = *(ulonglong **)(param_1 + 0x6c0);
                uVar10 = uVar15;
                if (puVar3 != (ulonglong *)0x0) {
                  if (puVar3 == *(ulonglong **)(param_1 + 0x6c8)) {
                    uVar10 = *puVar3;
                  }
                  else {
                    DAT_140608048 = DAT_140608048 + 1;
                    if (iVar5 == 0) {
                      FUN_140176d60(1);
                    }
                  }
                }
                if (((uint)uVar17 < 5) && ((uint)uVar14 < 0x18)) {
                  lVar7 = (uVar18 + uVar16) * 0xac + uVar10;
                  *(short *)(lVar7 + 0x14) = (short)uVar17;
                  *(short *)(lVar7 + 0x16) = (short)uVar14;
                  FUN_140090020(&local_e8);
                  iVar5 = local_d0;
                  if ((local_e8 != 0) || (uVar10 = uVar15, local_e0 != 0)) {
                    uVar10 = 1;
                  }
                  if (((((int)uVar10 != 0) || (local_d0 != 0)) || ((short)uVar10 < local_cc)) &&
                     (0 < local_c0)) {
                    iVar12 = (int)local_c0;
                    uVar9 = FUN_1401de9e0(puVar1);
                    FUN_140258150(uVar9,param_1,iVar5,iVar12);
                  }
                }
                uVar13 = (uint)uVar14 + 1;
                uVar14 = (ulonglong)uVar13;
                uVar16 = uVar16 + 1;
              } while ((int)uVar13 < 0x18);
              uVar13 = (uint)uVar17 + 1;
              uVar14 = uVar15;
              uVar16 = uVar15;
              uVar18 = uVar18 + 0x18;
              uVar17 = (ulonglong)uVar13;
            } while ((int)uVar13 < 2);
          }
        }
      }
      if (plVar6 != (longlong *)0x0) {
        LOCK();
        plVar8 = plVar6 + 1;
        lVar7 = *plVar8;
        *(int *)plVar8 = (int)*plVar8 + -1;
        UNLOCK();
        if ((int)lVar7 == 1) {
          pvVar4 = (void *)*plVar6;
          if (pvVar4 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar4 + 0x48);
            FUN_14025c370((longlong)pvVar4 + 0x20);
            FUN_14025c370(pvVar4);
            operator_delete(pvVar4);
          }
          operator_delete(plVar6);
        }
      }
    }
    if (bVar20) {
      FUN_14034edd0(local_118);
    }
  }
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401caeda)

undefined8 FUN_1401cad20(longlong param_1,undefined8 param_2,uint *param_3,short *param_4)

{
  uint uVar1;
  uint uVar2;
  longlong *plVar3;
  longlong lVar4;
  int iVar5;
  longlong *plVar6;
  uint *puVar7;
  uint uVar8;
  void *pvVar9;
  void *pvVar10;
  bool bVar11;
  bool bVar12;
  uint local_a8;
  void *local_98;
  void *local_78;
  undefined8 local_70;
  undefined8 local_68;
  void *local_58;
  undefined8 local_50;
  undefined8 local_48;
  
  pvVar9 = (void *)0x0;
  local_98 = (void *)0x0;
  bVar12 = false;
  plVar3 = *(longlong **)(param_1 + 0xb28);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0xb30)) {
      if ((void *)*plVar3 != (void *)0x0) {
        local_98 = (void *)*plVar3;
        if ((plVar3 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, local_98 = pvVar9,
           DAT_1406080a8 = iVar5, bVar12)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar12 = true;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (((DAT_14060a120 != 0xcc) && (DAT_14060a120 != 0x68)) || (*(byte *)(param_1 + 0x600) < 2)) {
    plVar3 = *(longlong **)(param_1 + 0x9c0);
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
      UNLOCK();
      if ((*plVar3 != 0) && (iVar5 = FUN_140258720(*plVar3,param_1,param_2,*param_3), iVar5 != 0)) {
        uVar8 = 0;
        local_a8 = 0;
        uVar2 = 0;
        local_58 = (void *)0x0;
        local_50 = 0;
        local_48 = 0;
        local_78 = (void *)0x0;
        local_70 = 0;
        local_68 = 0;
        uVar1 = *param_3;
        plVar6 = (longlong *)FUN_1402e0270();
        pvVar10 = pvVar9;
        if (*plVar6 != 0) {
          for (puVar7 = *(uint **)(*plVar6 +
                                  ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
              puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0x90)) {
            if ((puVar7[0x92] == uVar1) && (*puVar7 == uVar1)) {
              pvVar10 = (void *)0x0;
              if (puVar7 != (uint *)0x0) {
                local_a8 = puVar7[0x58];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar2 = puVar7[0x59];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar8 = puVar7[0x5a];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                FUN_14012bb70(&local_58,puVar7 + 0x5c);
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                FUN_14012bb70(&local_78,puVar7 + 100);
                pvVar9 = local_58;
                pvVar10 = local_78;
              }
              break;
            }
          }
        }
        FUN_1401a4270(param_1,*param_3,(int)*param_4,local_a8,uVar2,uVar8,&local_58,&local_78);
        if (pvVar10 != (void *)0x0) {
          operator_delete(pvVar10);
        }
        if (pvVar9 != (void *)0x0) {
          operator_delete(pvVar9);
        }
      }
    }
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      plVar6 = plVar3 + 1;
      lVar4 = *plVar6;
      *(int *)plVar6 = (int)*plVar6 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        pvVar9 = (void *)*plVar3;
        if (pvVar9 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar9 + 0x48);
          FUN_14025c370((longlong)pvVar9 + 0x20);
          FUN_14025c370(pvVar9);
          operator_delete(pvVar9);
        }
        operator_delete(plVar3);
      }
    }
  }
  if (bVar12) {
    FUN_14034edd0(local_98);
  }
  return 1;
}



undefined8 FUN_1401cb060(longlong param_1,undefined8 param_2,char *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  longlong lVar4;
  int iVar5;
  bool bVar6;
  bool bVar7;
  longlong local_40;
  
  local_40 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        local_40 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, local_40 = 0,
           DAT_1406080a8 = iVar5, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar7 = true;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x9c0);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
    if ((*plVar2 != 0) && (iVar5 = FUN_140258670(*plVar2,param_2,*param_3), iVar5 != 0)) {
      FUN_1401fc1a0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                    *(undefined4 *)(param_1 + 0x284),param_2,*param_3 == '\x01');
    }
  }
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar2 + 1;
    lVar4 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar4 == 1) {
      pvVar3 = (void *)*plVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0x48);
        FUN_14025c370((longlong)pvVar3 + 0x20);
        FUN_14025c370(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar2);
    }
  }
  if (bVar7) {
    FUN_14034edd0(local_40);
  }
  return 1;
}



undefined8 FUN_1401cb1f0(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  longlong lVar2;
  void *pvVar3;
  bool bVar4;
  int iVar5;
  longlong *plVar6;
  bool bVar7;
  bool bVar8;
  void *local_res8;
  longlong local_50;
  undefined4 local_40;
  undefined4 uStack_3c;
  undefined4 local_38;
  undefined4 uStack_34;
  longlong *local_30;
  longlong *local_28;
  
  bVar4 = false;
  local_50 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        local_50 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, local_50 = 0,
           DAT_1406080a8 = iVar5, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar8 = true;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x9c0);
  local_30 = plVar1;
  local_28 = plVar1;
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
    UNLOCK();
    if ((*plVar1 != 0) && (iVar5 = FUN_140257470(*plVar1,param_1,*param_3), iVar5 != 0)) {
      FUN_14025ab80(*plVar1,param_1,param_2,*param_3);
      local_40 = *(undefined4 *)(param_1 + 0x170);
      uStack_3c = *(undefined4 *)(param_1 + 0x174);
      local_38 = *(undefined4 *)(param_1 + 0x178);
      uStack_34 = *(undefined4 *)(param_1 + 0x17c);
      iVar5 = *(int *)(param_1 + 0x284);
      if ((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
        if ((*(longlong *)(param_1 + 0x170) != 0) || (*(longlong *)(param_1 + 0x178) != 0)) {
          bVar4 = true;
        }
        if ((bVar4) && (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0))
        {
          local_res8 = (void *)CONCAT62(local_res8._2_6_,(short)iVar5);
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar6 + 0x1c0))(plVar6,1,&DAT_1405d85a0,&local_res8,&local_40,param_2);
        }
      }
    }
  }
  plVar6 = local_30;
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar1 + 1;
    lVar2 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar2 == 1) {
      pvVar3 = (void *)*local_30;
      local_res8 = pvVar3;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0x48);
        FUN_14025c370((longlong)pvVar3 + 0x20);
        FUN_14025c370(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar6);
    }
  }
  if (bVar8) {
    FUN_14034edd0(local_50);
  }
  return 1;
}



undefined8 FUN_1401cb440(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong local_30;
  
  uVar8 = 0xfffffffffffffffe;
  local_30 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar2;
      if (lVar5 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar5 = 0, DAT_1406080a8 = iVar4,
           bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar7 = true;
        local_30 = lVar5;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x9c0);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
    if (*plVar2 != 0) {
      FUN_1402575f0(*plVar2,param_1,param_2,*param_3,uVar8);
    }
  }
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar2 + 1;
    lVar5 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar5 == 1) {
      pvVar3 = (void *)*plVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0x48);
        FUN_14025c370((longlong)pvVar3 + 0x20);
        FUN_14025c370(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar2);
    }
  }
  if (bVar7) {
    FUN_14034edd0(local_30);
  }
  return 1;
}



undefined8 FUN_1401cb5a0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  bool bVar7;
  longlong *local_50;
  longlong *local_48;
  undefined **local_40;
  longlong *local_38;
  longlong local_30;
  ulonglong local_28;
  undefined8 local_20;
  
  uVar6 = param_3;
  FUN_140198570(param_1,&local_50);
  plVar1 = local_50;
  if (local_50 != (longlong *)0x0) {
    if (local_50 == local_48) {
      if (*local_50 != 0) {
        if (param_1[0x16b] == 0) {
          local_40 = Proud::CFastArray<>::vftable;
          local_38 = (longlong *)0x0;
          local_30 = 0;
          local_28 = 0;
          local_20 = 0;
          iVar3 = (**(code **)(*(longlong *)*local_50 + 0xae8))((longlong *)*local_50,&local_40);
          if (iVar3 < 1) {
            iVar3 = (**(code **)(*param_1 + 0x38))(param_1);
            if (iVar3 != 0) {
              lVar5 = *(longlong *)(param_1[0x16a] + 0x78);
              uVar4 = (**(code **)(*param_1 + 0x38))(param_1);
              (**(code **)(lVar5 + 0x1a0))
                        (param_1[0x16a] + 0x78,uVar4,&DAT_1405d85a0,param_1 + 1,param_2,param_3);
            }
          }
          else {
            lVar5 = local_30;
            if ((int)local_28 == 0) {
              lVar5 = 0;
            }
            (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x198))
                      ((longlong *)(param_1[0x16a] + 0x78),lVar5,local_28 & 0xffffffff,
                       &DAT_1405d85a0,param_1 + 1,param_2,param_3);
          }
          local_40 = Proud::CFastArray<>::vftable;
          if (local_30 != 0) {
            if (local_38 == (longlong *)0x0) {
              FUN_14034ff60();
            }
            else {
              (**(code **)(*local_38 + 0x18))(local_38,local_30);
            }
          }
        }
        else {
          (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x1a0))
                    ((longlong *)(param_1[0x16a] + 0x78),*(undefined4 *)(param_1[0x16b] + 8),
                     &DAT_1405d85a0,param_1 + 1,param_2,uVar6);
        }
        goto LAB_1401cb77b;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_48) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401cb77b:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar2 = (undefined8 *)*local_50;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_50);
  }
  return 1;
}



undefined8
FUN_1401cb7d0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  bool bVar7;
  longlong *local_60;
  longlong *local_58;
  undefined **local_50;
  longlong *local_48;
  longlong local_40;
  ulonglong local_38;
  undefined8 local_30;
  
  uVar6 = param_3;
  FUN_140198570(param_1,&local_60);
  plVar1 = local_60;
  if (local_60 != (longlong *)0x0) {
    if (local_60 == local_58) {
      if (*local_60 != 0) {
        if (param_1[0x16b] == 0) {
          local_50 = Proud::CFastArray<>::vftable;
          local_48 = (longlong *)0x0;
          local_40 = 0;
          local_38 = 0;
          local_30 = 0;
          iVar3 = (**(code **)(*(longlong *)*local_60 + 0xae8))((longlong *)*local_60,&local_50);
          if (iVar3 < 1) {
            iVar3 = (**(code **)(*param_1 + 0x38))(param_1);
            if (iVar3 != 0) {
              lVar5 = *(longlong *)(param_1[0x16a] + 0x78);
              uVar4 = (**(code **)(*param_1 + 0x38))(param_1);
              (**(code **)(lVar5 + 0x1b0))
                        (param_1[0x16a] + 0x78,uVar4,&DAT_1405d85a0,param_1 + 1,param_2,param_3,
                         param_4,param_5);
            }
          }
          else {
            lVar5 = local_40;
            if ((int)local_38 == 0) {
              lVar5 = 0;
            }
            (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x1a8))
                      ((longlong *)(param_1[0x16a] + 0x78),lVar5,local_38 & 0xffffffff,
                       &DAT_1405d85a0,param_1 + 1,param_2,param_3,param_4,param_5);
          }
          local_50 = Proud::CFastArray<>::vftable;
          if (local_40 != 0) {
            if (local_48 == (longlong *)0x0) {
              FUN_14034ff60();
            }
            else {
              (**(code **)(*local_48 + 0x18))(local_48,local_40);
            }
          }
        }
        else {
          (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x1b0))
                    ((longlong *)(param_1[0x16a] + 0x78),*(undefined4 *)(param_1[0x16b] + 8),
                     &DAT_1405d85a0,param_1 + 1,param_2,uVar6,param_4,param_5);
        }
        goto LAB_1401cb9ed;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_58) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401cb9ed:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar2 = (undefined8 *)*local_60;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_60);
  }
  return 1;
}



undefined8 FUN_1401cba40(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  undefined4 uVar4;
  bool bVar5;
  
  uVar4 = 1;
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    uVar4 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
  }
  FUN_14019c070(param_1,uVar4);
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar5 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar5) {
            FUN_140176d60(1);
          }
          lVar3 = 0;
        }
        FUN_140218710(lVar3);
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
        return 1;
      }
    }
  }
  return 1;
}



undefined8
FUN_1401cbae0(longlong param_1,undefined8 param_2,short *param_3,short *param_4,short *param_5)

{
  DWORD DVar1;
  int iVar2;
  undefined4 uVar3;
  longlong *plVar4;
  int local_res8 [2];
  undefined8 in_stack_ffffffffffffffc0;
  undefined4 uVar5;
  int local_28;
  int local_24 [3];
  
  uVar5 = (undefined4)((ulonglong)in_stack_ffffffffffffffc0 >> 0x20);
  DVar1 = timeGetTime();
  if (999 < DVar1 - *(int *)(param_1 + 0x14c)) {
    *(DWORD *)(param_1 + 0x14c) = DVar1;
    uVar3 = 1;
    if (*(longlong *)(param_1 + 0xb58) != 0) {
      uVar3 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
    }
    local_res8[0] = (int)*param_5;
    local_28 = (int)*param_4;
    local_24[0] = (int)*param_3;
    iVar2 = FUN_1401a0d30(param_1,param_2,local_24,&local_28,local_res8,CONCAT44(uVar5,uVar3));
    plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    local_res8[0] = 1;
    if (iVar2 == 0) {
      local_res8[0] = 0x19;
    }
    (**(code **)(*plVar4 + 0x1d0))
              (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8,param_2,param_3,param_4
               ,param_5);
  }
  return 1;
}



undefined8 FUN_1401cbbe0(longlong param_1,undefined8 param_2,short *param_3,short *param_4)

{
  DWORD DVar1;
  int iVar2;
  undefined4 uVar3;
  longlong *plVar4;
  int local_res8 [2];
  undefined8 in_stack_ffffffffffffffc8;
  undefined4 uVar5;
  int local_18 [4];
  
  uVar5 = (undefined4)((ulonglong)in_stack_ffffffffffffffc8 >> 0x20);
  DVar1 = timeGetTime();
  if (999 < DVar1 - *(int *)(param_1 + 0x14c)) {
    *(DWORD *)(param_1 + 0x14c) = DVar1;
    uVar3 = 1;
    if (*(longlong *)(param_1 + 0xb58) != 0) {
      uVar3 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
    }
    local_res8[0] = (int)*param_4;
    local_18[0] = (int)*param_3;
    iVar2 = FUN_14019f6f0(param_1,param_2,local_18,local_res8,CONCAT44(uVar5,uVar3));
    plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    local_18[0] = 1;
    if (iVar2 == 0) {
      local_18[0] = 0x19;
    }
    (**(code **)(*plVar4 + 0x1e0))
              (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_18,param_2,local_res8,
               param_3);
  }
  return 1;
}



// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401cbcd0(longlong param_1,ulonglong *param_2,short *param_3,short *param_4,ulonglong *param_5,
             short *param_6,short *param_7)

{
  short *psVar1;
  short *psVar2;
  longlong *plVar3;
  short sVar4;
  void *pvVar5;
  int iVar6;
  ulonglong *puVar7;
  ulonglong *puVar8;
  undefined8 uVar9;
  longlong lVar10;
  longlong *plVar11;
  int iVar12;
  bool bVar13;
  undefined4 *in_stack_ffffffffffffff70;
  undefined4 local_68;
  int local_64;
  int local_60;
  int local_5c [3];
  undefined8 local_50;
  longlong *local_48;
  longlong *local_40;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  
  local_50 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_48);
  plVar3 = local_48;
  if (local_48 != (longlong *)0x0) {
    if (local_48 == local_40) {
      if (*local_48 != 0) {
        puVar7 = (ulonglong *)FUN_1401ed5a0(*local_48,(int)*param_3,(int)*param_4);
        if ((puVar7 == (ulonglong *)0x0) ||
           (puVar8 = (ulonglong *)FUN_1401ed5a0(*plVar3,(int)*param_6,(int)*param_7),
           puVar8 == (ulonglong *)0x0)) goto LAB_1401cc02c;
        bVar13 = *puVar7 < *param_2;
        if ((*puVar7 == *param_2) && (bVar13 = puVar7[1] < param_2[1], puVar7[1] == param_2[1])) {
          iVar6 = 0;
        }
        else {
          iVar6 = (1 - (uint)bVar13) - (uint)(bVar13 != 0);
        }
        iVar12 = 1;
        if (iVar6 != 0) {
          iVar12 = 0x58;
        }
        uVar9 = FUN_140137690();
        lVar10 = FUN_140136770(uVar9,(int)puVar7[3]);
        if (lVar10 == 0) {
          iVar12 = 0x58;
        }
        bVar13 = *puVar8 < *param_5;
        if ((*puVar8 == *param_5) && (bVar13 = puVar8[1] < param_5[1], puVar8[1] == param_5[1])) {
          iVar6 = 0;
        }
        else {
          iVar6 = (1 - (uint)bVar13) - (uint)(bVar13 != 0);
        }
        if (iVar6 == 0) {
          if (iVar12 == 1) {
            if (*(int *)(lVar10 + 0xe0) == 1) {
              psVar1 = (short *)((longlong)puVar7 + 0x6e);
              if (*psVar1 == 1) {
                iVar6 = (int)puVar8[3];
                if (iVar6 == 80000000) {
                  bVar13 = *(int *)(lVar10 + 0xcc) == 6;
LAB_1401cbe88:
                  if ((bVar13) &&
                     ((int)*(short *)((longlong)puVar8 + 0x1c) < *(int *)(lVar10 + 0xe8))) {
                    iVar12 = 0x5f;
                    goto LAB_1401cbfcd;
                  }
                }
                else {
                  if (iVar6 == 0x4c4b401) {
                    bVar13 = *(int *)(lVar10 + 0xcc) == 5;
                    goto LAB_1401cbe88;
                  }
                  if (iVar6 == 0x4c4b402) {
                    bVar13 = *(int *)(lVar10 + 0xcc) == 4;
                    goto LAB_1401cbe88;
                  }
                  if (iVar6 == 0x4c4b403) {
                    bVar13 = *(int *)(lVar10 + 0xcc) == 2;
                    goto LAB_1401cbe88;
                  }
                  if (iVar6 == 0x4c4b404) {
                    bVar13 = *(int *)(lVar10 + 0xcc) == 1;
                    goto LAB_1401cbe88;
                  }
                }
                local_68 = *(undefined4 *)(lVar10 + 0xe8);
                local_64 = (int)*param_7;
                sVar4 = *param_6;
                local_60 = (int)sVar4;
                uVar9 = FUN_140174f00(&local_48);
                if (-1 < sVar4) {
                  in_stack_ffffffffffffff70 = &local_68;
                  FUN_1401f1280(uVar9,param_1,&local_60,&local_64,puVar8 + 3,
                                in_stack_ffffffffffffff70,0x1ca,0x4c);
                }
                *psVar1 = 0;
                psVar2 = (short *)((longlong)puVar7 + 0x6c);
                *psVar2 = *psVar2 + -1;
                local_38 = *(undefined4 *)(param_1 + 0x170);
                local_34 = *(undefined4 *)(param_1 + 0x174);
                local_30 = *(undefined4 *)(param_1 + 0x178);
                local_2c = *(undefined4 *)(param_1 + 0x17c);
                FUN_1401fc060(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                              *(undefined4 *)(param_1 + 0x284),&local_38,puVar7,
                              (ulonglong)in_stack_ffffffffffffff70 & 0xffffffff00000000);
                plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                (**(code **)(*plVar11 + 0x1f0))
                          (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,puVar7,psVar1,psVar2)
                ;
                FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1cb,0x53,param_1,puVar7,
                              (int)*(short *)((longlong)puVar7 + 0x1c),0,*psVar2 + 1,(int)*psVar2);
                goto LAB_1401cc02c;
              }
              iVar12 = 0x59;
            }
            else {
              iVar12 = 0x5b;
            }
          }
        }
        else {
          iVar12 = 0x5d;
        }
LAB_1401cbfcd:
        local_5c[1] = 0x2b08;
        plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        local_5c[0] = iVar12;
        (**(code **)(*plVar11 + 0x70))
                  (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_5c + 1,local_5c);
        goto LAB_1401cc02c;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar13 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar3 == (longlong *)0x0) {
    return 1;
  }
  if (plVar3 != local_40) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401cc02c:
  LOCK();
  plVar3 = plVar3 + 1;
  lVar10 = *plVar3;
  *(int *)plVar3 = (int)*plVar3 + -1;
  UNLOCK();
  if ((int)lVar10 == 1) {
    pvVar5 = (void *)*local_48;
    if (pvVar5 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar5 + 0xf630);
      operator_delete(pvVar5);
    }
    operator_delete(local_48);
  }
  return 1;
}



undefined8
FUN_1401cc090(longlong param_1,short *param_2,short *param_3,undefined8 param_4,short *param_5,
             short *param_6,undefined4 *param_7)

{
  longlong lVar1;
  undefined4 *puVar2;
  int iVar3;
  longlong *plVar4;
  int local_res10 [2];
  int local_res18 [4];
  undefined8 uVar5;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  void *local_60;
  undefined8 local_58;
  undefined8 local_50;
  void *local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  puVar2 = param_7;
  uVar5 = 0xfffffffffffffffe;
  param_6._0_2_ = *param_6;
  param_6._2_2_ = (short)param_6 >> 0xf;
  param_5._0_4_ = (int)*param_5;
  local_res10[0] = (int)*param_3;
  local_res18[0] = (int)*param_2;
  iVar3 = FUN_140199040(param_1,local_res18,local_res10,param_4,&param_5,&param_6,param_7);
  if (iVar3 != 0) {
    local_40 = (void *)0x0;
    local_38 = 0;
    local_30 = 0;
    local_60 = (void *)0x0;
    local_58 = 0;
    local_50 = 0;
    FUN_140198b90(param_1,&local_40,&local_60,*puVar2);
    local_70 = *(undefined4 *)(param_1 + 0x170);
    local_6c = *(undefined4 *)(param_1 + 0x174);
    local_68 = *(undefined4 *)(param_1 + 0x178);
    local_64 = *(undefined4 *)(param_1 + 0x17c);
    iVar3 = *(int *)(param_1 + 0x284);
    param_5._0_4_ = *puVar2;
    if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
       (lVar1 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar1 != 0)) {
      param_6._0_2_ = (short)iVar3;
      plVar4 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar1 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar4 + 0x290))
                (plVar4,1,&DAT_1405d85a0,&param_6,&local_70,&local_40,&local_60,&param_5,uVar5);
    }
    if (local_60 != (void *)0x0) {
      operator_delete(local_60);
    }
    local_60 = (void *)0x0;
    local_58 = 0;
    local_50 = 0;
    if (local_40 != (void *)0x0) {
      operator_delete(local_40);
    }
  }
  return 1;
}



undefined8 FUN_1401cc220(undefined8 param_1,int *param_2,ushort *param_3)

{
  longlong *plVar1;
  ushort uVar2;
  void *pvVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  int local_res20 [2];
  uint local_e8 [2];
  longlong *local_e0;
  longlong *local_d8;
  undefined8 local_d0;
  undefined1 local_c8 [24];
  int local_b0;
  
  local_d0 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_e0);
  plVar1 = local_e0;
  if (local_e0 != (longlong *)0x0) {
    if (local_e0 == local_d8) {
      if (*local_e0 != 0) {
        FUN_14000a170(local_c8);
        uVar5 = FUN_140137690();
        local_e8[0] = FUN_140136b30(uVar5,*param_2);
        if ((((local_e8[0] == 1) || (local_e8[0] == 2)) || (local_e8[0] == 3)) || (local_e8[0] == 4)
           ) {
          uVar2 = *param_3;
          if ((4 < local_e8[0]) || (0x17 < uVar2)) goto LAB_1401cc3a5;
          lVar6 = ((longlong)(short)uVar2 + (longlong)(int)local_e8[0] * 0x18) * 0xac + *plVar1;
          *(short *)(lVar6 + 0x14) = (short)local_e8[0];
          *(ushort *)(lVar6 + 0x16) = uVar2;
          FUN_140090020(local_c8);
          FUN_1401eceb0(*plVar1,local_e8,*param_2);
        }
        else {
          if (local_e8[0] != 5) goto LAB_1401cc3a5;
          local_res20[0] = (int)(short)*param_3;
          uVar5 = FUN_140174f00(&local_e0);
          iVar4 = FUN_1401ecc20(uVar5,local_res20,local_c8);
          if (iVar4 == 0) goto LAB_1401cc3a5;
          uVar5 = FUN_140174f00(&local_e0);
          FUN_1401ecb10(uVar5,*param_2);
        }
        if (*param_2 == local_b0) {
          FUN_1401a8bb0(param_1);
        }
        goto LAB_1401cc3a5;
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_d8) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401cc3a5:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    pvVar3 = (void *)*local_e0;
    if (pvVar3 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar3 + 0xf630);
      operator_delete(pvVar3);
    }
    operator_delete(local_e0);
  }
  return 1;
}



undefined8
FUN_1401cc400(longlong *param_1,undefined4 param_2,longlong *param_3,undefined4 *param_4,
             short *param_5,longlong *param_6,undefined8 param_7,ulonglong *param_8,ushort *param_9,
             ushort *param_10)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  ushort uVar4;
  ushort uVar5;
  undefined8 *puVar6;
  int iVar7;
  DWORD DVar8;
  int iVar9;
  int iVar10;
  longlong lVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  undefined8 uVar14;
  longlong *plVar15;
  undefined *puVar16;
  undefined *puVar17;
  void *pvVar18;
  longlong *plVar19;
  bool bVar20;
  undefined8 in_stack_fffffffffffffdb8;
  undefined4 uVar22;
  ushort *puVar21;
  undefined8 in_stack_fffffffffffffdc0;
  undefined4 uVar26;
  ushort *puVar23;
  undefined4 *puVar24;
  undefined4 *puVar25;
  ulonglong *puVar27;
  undefined8 in_stack_fffffffffffffdd0;
  undefined4 *puVar28;
  undefined4 uVar29;
  undefined8 in_stack_fffffffffffffdd8;
  undefined4 uVar30;
  undefined4 local_208 [2];
  longlong *local_200;
  longlong *local_1f8;
  undefined8 *local_1f0;
  undefined8 *local_1e8;
  undefined2 local_1e0;
  undefined2 local_1de;
  undefined4 local_1dc;
  int local_1d8;
  int local_1d4;
  undefined4 local_1d0;
  undefined4 uStack_1cc;
  undefined4 local_1c8;
  undefined4 uStack_1c4;
  undefined4 local_1c0 [2];
  undefined4 local_1b8;
  undefined4 local_1b4;
  undefined4 local_1b0 [2];
  undefined4 local_1a8 [2];
  int local_1a0;
  int local_19c;
  longlong *local_198;
  longlong *local_190;
  longlong *local_188;
  longlong *local_180;
  undefined4 local_178;
  undefined4 uStack_174;
  undefined4 local_170;
  undefined4 uStack_16c;
  undefined **local_168;
  longlong *local_160;
  ulonglong local_158;
  ulonglong local_150;
  undefined8 local_148;
  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;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined8 local_f0;
  ulonglong local_e8;
  ulonglong local_e0;
  int local_d0;
  short local_cc [70];
  undefined4 local_40;
  
  uVar29 = (undefined4)((ulonglong)in_stack_fffffffffffffdd0 >> 0x20);
  uVar30 = (undefined4)((ulonglong)in_stack_fffffffffffffdd8 >> 0x20);
  uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffdc0 >> 0x20);
  local_f0 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_200);
  plVar19 = local_200;
  if (local_200 != (longlong *)0x0) {
    if (local_200 == local_1f8) {
      if (*local_200 != 0) {
        local_208[0] = (**(code **)(*param_1 + 0x18))(param_1);
        uVar13 = 0;
        iVar7 = 0;
        sVar3 = *param_5;
        if ((sVar3 == 0x12) || (sVar3 == 0x10)) {
          DVar8 = timeGetTime();
          if (4999 < DVar8 - *(int *)((longlong)param_1 + 0x144)) {
            *(DWORD *)((longlong)param_1 + 0x144) = DVar8;
            puVar16 = (undefined *)*param_6;
            if ((undefined *)*param_6 == (undefined *)0x0) {
              puVar16 = PTR_DAT_1405d8010;
            }
            puVar17 = (undefined *)*param_3;
            if ((undefined *)*param_3 == (undefined *)0x0) {
              puVar17 = PTR_DAT_1405d8010;
            }
            FUN_14026e550(param_1[0x16a],puVar17,(undefined2)local_208[0],*param_4,puVar16,param_7,
                          DAT_140607cb8);
            iVar7 = 0x325;
          }
        }
        else {
          iVar10 = 0;
          if (sVar3 == 0x14) {
            DVar8 = timeGetTime();
            if (DVar8 - (int)param_1[0x27] < 500) goto LAB_1401cd3da;
            *(DWORD *)(param_1 + 0x27) = DVar8;
            local_1d0 = *(undefined4 *)((longlong)param_1 + 0x194);
            uStack_1cc = (undefined4)param_1[0x33];
            local_1c8 = *(undefined4 *)((longlong)param_1 + 0x19c);
            uStack_1c4 = (undefined4)param_1[0x34];
            if ((*(longlong *)((longlong)param_1 + 0x194) != 0) ||
               (iVar9 = iVar10, *(longlong *)((longlong)param_1 + 0x19c) != 0)) {
              iVar9 = 1;
            }
            if (iVar9 != 0) {
              iVar7 = 0;
              if (*(int *)(param_1[0x16a] + 0x528) == 0) {
                if (DAT_140608080 != 0) {
                  FUN_1401e6310(DAT_140608080,&local_188,&local_1d0);
                  if (local_188 != (longlong *)0x0) {
                    if (local_188 == local_180) {
                      iVar10 = iVar7;
                      if (*local_188 != 0) {
                        iVar10 = *(int *)(*local_188 + 0x140);
                      }
                    }
                    else {
                      iVar9 = DAT_140608088 + 1;
                      bVar20 = DAT_140608088 == 0;
                      iVar10 = 0;
                      DAT_140608088 = iVar9;
                      if (bVar20) {
                        FUN_140176d60(1);
                        iVar10 = iVar7;
                      }
                    }
                    plVar15 = local_188;
                    if (local_188 != (longlong *)0x0) {
                      if (local_188 == local_180) {
                        if (local_188 != (longlong *)0x0) {
                          LOCK();
                          plVar1 = local_188 + 1;
                          *(int *)plVar1 = (int)*plVar1 + -1;
                          UNLOCK();
                          plVar19 = local_200;
                          if ((int)*plVar1 == 0) {
                            local_188 = (longlong *)0x0;
                            pvVar18 = (void *)*plVar15;
                            if (pvVar18 != (void *)0x0) {
                              FUN_1402160c0(pvVar18);
                              goto LAB_1401cc6d0;
                            }
                            goto LAB_1401cc6d9;
                          }
                        }
                      }
                      else {
                        iVar7 = DAT_14060808c + 1;
                        bVar20 = DAT_14060808c == 0;
                        DAT_14060808c = iVar7;
                        if (bVar20) {
                          FUN_140176d60(1);
                        }
                      }
                    }
                  }
                  goto LAB_1401cc6e7;
                }
              }
              else if (DAT_1406080a0 != 0) {
                FUN_1401e6200(DAT_1406080a0,&local_198,&local_1d0);
                if (local_198 != (longlong *)0x0) {
                  if (local_198 == local_190) {
                    iVar10 = iVar7;
                    if ((int *)*local_198 != (int *)0x0) {
                      iVar10 = *(int *)*local_198;
                    }
                  }
                  else {
                    iVar9 = DAT_140608090 + 1;
                    bVar20 = DAT_140608090 == 0;
                    iVar10 = 0;
                    DAT_140608090 = iVar9;
                    if (bVar20) {
                      FUN_140176d60(1);
                      iVar10 = iVar7;
                    }
                  }
                  plVar15 = local_198;
                  if (local_198 != (longlong *)0x0) {
                    if (local_198 == local_190) {
                      if (local_198 != (longlong *)0x0) {
                        LOCK();
                        plVar1 = local_198 + 1;
                        *(int *)plVar1 = (int)*plVar1 + -1;
                        UNLOCK();
                        plVar19 = local_200;
                        if ((int)*plVar1 == 0) {
                          local_198 = (longlong *)0x0;
                          pvVar18 = (void *)*plVar15;
                          if (pvVar18 != (void *)0x0) {
                            FUN_140215c80(pvVar18);
LAB_1401cc6d0:
                            operator_delete(pvVar18);
                          }
LAB_1401cc6d9:
                          operator_delete(plVar15);
                          plVar19 = local_200;
                        }
                      }
                    }
                    else {
                      iVar7 = DAT_140608094 + 1;
                      bVar20 = DAT_140608094 == 0;
                      DAT_140608094 = iVar7;
                      if (bVar20) {
                        FUN_140176d60(1);
                      }
                    }
                  }
                }
LAB_1401cc6e7:
                if (iVar10 != 0) {
                  local_1b8 = 0;
                  (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x400))
                            ((longlong *)(param_1[0x16a] + 0x78),iVar10,&DAT_1405d85a0,param_1 + 1,
                             param_3,&local_1b8,local_208,param_4,param_5,param_6,param_7);
                }
              }
              puVar16 = (undefined *)*param_6;
              if ((undefined *)*param_6 == (undefined *)0x0) {
                puVar16 = PTR_DAT_1405d8010;
              }
              puVar17 = (undefined *)*param_3;
              if ((undefined *)*param_3 == (undefined *)0x0) {
                puVar17 = PTR_DAT_1405d8010;
              }
              if (*(longlong *)(param_1[0x16a] + 0x4e0) != 0) {
                FUN_14026ded0(param_1[0x16a],&local_1d0,puVar17,(undefined2)local_208[0],*param_4,
                              puVar16,param_7);
              }
              iVar7 = 0x322;
            }
          }
          else if (sVar3 == 0x13) {
            local_178 = (undefined4)param_1[0x25];
            uStack_174 = *(undefined4 *)((longlong)param_1 + 300);
            local_170 = (undefined4)param_1[0x26];
            uStack_16c = *(undefined4 *)((longlong)param_1 + 0x134);
            if ((param_1[0x25] != 0) || (param_1[0x26] != 0)) {
              iVar10 = 1;
            }
            if (iVar10 != 0) {
              iVar7 = *(int *)((longlong)param_1 + 0xc);
              if ((iVar7 != 0) || (iVar7 = FUN_14020f960(DAT_140608078,&local_178), iVar7 != 0)) {
                local_1b4 = 0;
                (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x400))
                          ((longlong *)(param_1[0x16a] + 0x78),iVar7,&DAT_1405d85a0,param_1 + 1,
                           param_3,&local_1b4,local_208,param_4,param_5,param_6,param_7);
              }
              iVar7 = 0x323;
            }
          }
          else if (sVar3 == 0x16) {
            (**(code **)(*(longlong *)param_1[0x16a] + 400))
                      ((longlong *)param_1[0x16a],param_2,param_3,local_208[0],
                       CONCAT44(uVar22,*param_4),CONCAT44(uVar26,0x16),param_6,param_7);
            iVar7 = 0;
          }
          else {
            if (sVar3 == 0x18) {
              DVar8 = timeGetTime();
              if (DVar8 - (int)param_1[0x27] < 500) goto LAB_1401cd3da;
              *(DWORD *)(param_1 + 0x27) = DVar8;
              FUN_140197b70(param_1,&local_1f0);
              lVar11 = FUN_140174f00(&local_1f0);
              if (lVar11 == 0) {
                if (local_1f0 != (undefined8 *)0x0) {
                  if (local_1f0 == local_1e8) {
                    LOCK();
                    piVar2 = (int *)(local_1f0 + 1);
                    iVar7 = *piVar2;
                    *piVar2 = *piVar2 + -1;
                    UNLOCK();
                    plVar19 = local_200;
                    if (iVar7 == 1) {
                      pvVar18 = (void *)*local_1f0;
                      if (pvVar18 != (void *)0x0) {
                        FUN_14034edf0((longlong)pvVar18 + 0xf630);
                        operator_delete(pvVar18);
                      }
                      operator_delete(local_1f0);
                      plVar19 = local_200;
                    }
                  }
                  else {
                    iVar7 = DAT_140608050 + 1;
                    bVar20 = DAT_140608050 == 0;
                    DAT_140608050 = iVar7;
                    if (bVar20) {
                      FUN_140176d60(1);
                    }
                  }
                }
                LOCK();
                plVar19 = plVar19 + 1;
                *(int *)plVar19 = (int)*plVar19 + -1;
                UNLOCK();
                if ((int)*plVar19 != 0) {
                  return 0;
                }
                puVar6 = (undefined8 *)*local_200;
                if (puVar6 != (undefined8 *)0x0) {
                  (**(code **)*puVar6)(puVar6,1);
                }
                goto LAB_1401cca04;
              }
              FUN_14000a170(&local_e8);
              local_40 = 0;
              uVar4 = *param_10;
              uVar5 = *param_9;
              lVar11 = FUN_140174f00(&local_1f0);
              if ((4 < uVar5) || (0x17 < uVar4)) {
                if (local_1f0 != (undefined8 *)0x0) {
                  if (local_1f0 == local_1e8) {
                    LOCK();
                    piVar2 = (int *)(local_1f0 + 1);
                    iVar7 = *piVar2;
                    *piVar2 = *piVar2 + -1;
                    UNLOCK();
                    plVar19 = local_200;
                    if (iVar7 == 1) {
                      pvVar18 = (void *)*local_1f0;
                      if (pvVar18 != (void *)0x0) {
                        FUN_14034edf0((longlong)pvVar18 + 0xf630);
                        operator_delete(pvVar18);
                      }
                      operator_delete(local_1f0);
                      plVar19 = local_200;
                    }
                  }
                  else {
                    iVar7 = DAT_140608050 + 1;
                    bVar20 = DAT_140608050 == 0;
                    DAT_140608050 = iVar7;
                    if (bVar20) {
                      FUN_140176d60(1);
                    }
                  }
                }
                LOCK();
                plVar19 = plVar19 + 1;
                *(int *)plVar19 = (int)*plVar19 + -1;
                UNLOCK();
                if ((int)*plVar19 != 0) {
                  return 0;
                }
                puVar6 = (undefined8 *)*local_200;
                if (puVar6 != (undefined8 *)0x0) {
                  (**(code **)*puVar6)(puVar6,1);
                  operator_delete(local_200);
                  return 0;
                }
                goto LAB_1401cca04;
              }
              lVar11 = ((longlong)(short)uVar4 + (longlong)(short)uVar5 * 0x18) * 0xac + lVar11;
              *(ushort *)(lVar11 + 0x14) = uVar5;
              *(ushort *)(lVar11 + 0x16) = uVar4;
              FUN_140090020(&local_e8);
              bVar20 = local_e8 < *param_8;
              if ((local_e8 != *param_8) ||
                 (bVar20 = local_e0 < param_8[1], uVar12 = uVar13, local_e0 != param_8[1])) {
                uVar12 = (ulonglong)((1 - (uint)bVar20) - (uint)(bVar20 != 0));
              }
              if ((int)uVar12 == 0) {
                if ((local_e8 != 0) || (local_e0 != 0)) {
                  uVar13 = 1;
                }
                if ((((int)uVar13 != 0) || (local_d0 != 0)) || ((short)uVar13 < local_cc[0])) {
                  uVar14 = FUN_140137690();
                  iVar10 = FUN_1401369d0(uVar14,local_d0);
                  iVar7 = 0;
                  if (iVar10 == 10) {
                    local_cc[0] = local_cc[0] + -1;
                    puVar27 = (ulonglong *)local_cc;
                    puVar21 = param_9;
                    puVar23 = param_10;
                    (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x290))
                              ((longlong *)(param_1[0x16a] + 0x78),(int)param_1[1],&DAT_1405d85a0,
                               &local_e8,param_9,param_10,puVar27);
                    uVar26 = (undefined4)((ulonglong)puVar23 >> 0x20);
                    uVar22 = (undefined4)((ulonglong)puVar21 >> 0x20);
                    if (local_cc[0] < 1) {
                      local_130 = (undefined4)param_1[0x2c];
                      local_12c = *(undefined4 *)((longlong)param_1 + 0x164);
                      local_128 = (undefined4)param_1[0x2d];
                      local_124 = *(undefined4 *)((longlong)param_1 + 0x16c);
                      local_120 = (undefined4)param_1[0x2e];
                      local_11c = *(undefined4 *)((longlong)param_1 + 0x174);
                      local_118 = (undefined4)param_1[0x2f];
                      local_114 = *(undefined4 *)((longlong)param_1 + 0x17c);
                      iVar7 = *(int *)((longlong)param_1 + 0x284);
                      local_1a8[0] = 0xffffffff;
                      local_1c0[0] = 0xfffffff6;
                      if (((-1 < iVar7) && (iVar7 < *(short *)(param_1[0x16a] + 700))) &&
                         (lVar11 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar11 != 0)) {
                        local_1de = (undefined2)iVar7;
                        plVar15 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar11 + 8) + (longlong)(int)param_1[0x51] * 8) +
                                  0x70);
                        puVar24 = local_1a8;
                        puVar28 = local_1c0;
                        puVar27 = &local_e8;
                        puVar25 = &local_130;
                        (**(code **)(*plVar15 + 0x130))
                                  (plVar15,1,&DAT_1405d85a0,&local_1de,&local_120,puVar25,puVar27,
                                   puVar28,puVar24);
                        uVar26 = (undefined4)((ulonglong)puVar25 >> 0x20);
                        uVar29 = (undefined4)((ulonglong)puVar28 >> 0x20);
                        uVar30 = (undefined4)((ulonglong)puVar24 >> 0x20);
                      }
                      local_19c = (int)(short)*param_10;
                      local_1a0 = (int)(short)*param_9;
                      uVar14 = FUN_140174f00(&local_1f0);
                      FUN_1401e9d60(uVar14,param_1,&local_1a0,&local_19c,&local_e8);
                    }
                    else {
                      local_1d8 = (int)(short)*param_10;
                      uVar4 = *param_9;
                      local_1d4 = (int)(short)uVar4;
                      uVar14 = FUN_140174f00(&local_1f0);
                      if (-1 < (short)uVar4) {
                        FUN_1401ed220(uVar14,&local_1d4,&local_1d8,&local_e8,CONCAT44(uVar22,6));
                      }
                      local_140 = (undefined4)param_1[0x2c];
                      local_13c = *(undefined4 *)((longlong)param_1 + 0x164);
                      local_138 = (undefined4)param_1[0x2d];
                      local_134 = *(undefined4 *)((longlong)param_1 + 0x16c);
                      local_110 = (undefined4)param_1[0x2e];
                      local_10c = *(undefined4 *)((longlong)param_1 + 0x174);
                      local_108 = (undefined4)param_1[0x2f];
                      local_104 = *(undefined4 *)((longlong)param_1 + 0x17c);
                      iVar7 = *(int *)((longlong)param_1 + 0x284);
                      if (((-1 < iVar7) && (iVar7 < *(short *)(param_1[0x16a] + 700))) &&
                         (lVar11 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar11 != 0)) {
                        local_1e0 = (undefined2)iVar7;
                        plVar15 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar11 + 8) + (longlong)(int)param_1[0x51] * 8) +
                                  0x70);
                        puVar27 = &local_e8;
                        puVar24 = &local_140;
                        (**(code **)(*plVar15 + 0x140))
                                  (plVar15,1,&DAT_1405d85a0,&local_1e0,&local_110,puVar24,puVar27);
                        uVar26 = (undefined4)((ulonglong)puVar24 >> 0x20);
                      }
                    }
                    FUN_140203700(param_1[0x16a],0x1ca,0x47,param_1,&local_e8,CONCAT44(uVar26,1),
                                  (ulonglong)puVar27 & 0xffffffff00000000,
                                  CONCAT44(uVar29,local_cc[0] + 1),CONCAT44(uVar30,(int)local_cc[0])
                                 );
                    puVar16 = (undefined *)*param_6;
                    if ((undefined *)*param_6 == (undefined *)0x0) {
                      puVar16 = PTR_DAT_1405d8010;
                    }
                    puVar17 = (undefined *)*param_3;
                    if ((undefined *)*param_3 == (undefined *)0x0) {
                      puVar17 = PTR_DAT_1405d8010;
                    }
                    FUN_14026e210(param_1[0x16a],(int)param_1[1],puVar17,(undefined2)local_208[0],
                                  *param_4,puVar16,param_7);
                    iVar7 = 0x326;
                  }
                  if (local_1f0 != (undefined8 *)0x0) {
                    if (local_1f0 == local_1e8) {
                      LOCK();
                      piVar2 = (int *)(local_1f0 + 1);
                      *piVar2 = *piVar2 + -1;
                      UNLOCK();
                      plVar19 = local_200;
                      if (*piVar2 == 0) {
                        pvVar18 = (void *)*local_1f0;
                        if (pvVar18 != (void *)0x0) {
                          FUN_14034edf0((longlong)pvVar18 + 0xf630);
                          operator_delete(pvVar18);
                        }
                        operator_delete(local_1f0);
                        plVar19 = local_200;
                      }
                    }
                    else {
                      iVar10 = DAT_140608050 + 1;
                      bVar20 = DAT_140608050 == 0;
                      DAT_140608050 = iVar10;
                      if (bVar20) {
                        FUN_140176d60(1);
                      }
                    }
                  }
                  goto LAB_1401cd361;
                }
              }
              if (local_1f0 != (undefined8 *)0x0) {
                if (local_1f0 == local_1e8) {
                  LOCK();
                  piVar2 = (int *)(local_1f0 + 1);
                  iVar7 = *piVar2;
                  *piVar2 = *piVar2 + -1;
                  UNLOCK();
                  plVar19 = local_200;
                  if (iVar7 == 1) {
                    pvVar18 = (void *)*local_1f0;
                    if (pvVar18 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar18 + 0xf630);
                      operator_delete(pvVar18);
                    }
                    operator_delete(local_1f0);
                    plVar19 = local_200;
                  }
                }
                else {
                  iVar7 = DAT_140608050 + 1;
                  bVar20 = DAT_140608050 == 0;
                  DAT_140608050 = iVar7;
                  if (bVar20) {
                    FUN_140176d60(1);
                  }
                }
              }
              LOCK();
              plVar19 = plVar19 + 1;
              *(int *)plVar19 = (int)*plVar19 + -1;
              UNLOCK();
              if ((int)*plVar19 != 0) {
                return 0;
              }
              puVar6 = (undefined8 *)*local_200;
              if (puVar6 != (undefined8 *)0x0) {
                (**(code **)*puVar6)(puVar6,1);
                operator_delete(local_200);
                return 0;
              }
LAB_1401cca04:
              operator_delete(local_200);
              return 0;
            }
            DVar8 = timeGetTime();
            if (DVar8 - (int)param_1[0x27] < 500) goto LAB_1401cd3da;
            *(DWORD *)(param_1 + 0x27) = DVar8;
            iVar7 = (int)param_1[0x30];
            if (iVar7 == 0) {
              if (*(int *)((longlong)param_1 + 0xc) != 0) {
                local_1dc = 0;
                (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x400))
                          ((longlong *)(param_1[0x16a] + 0x78),*(int *)((longlong)param_1 + 0xc),
                           &DAT_1405d85a0,param_1 + 1,param_3,&local_1dc,local_208,param_4,param_5,
                           param_6,param_7);
              }
            }
            else if (iVar7 == 2) {
              local_168 = Proud::CFastArray<>::vftable;
              local_160 = (longlong *)0x0;
              local_158 = 0;
              local_150 = 0;
              local_148 = 0;
              (**(code **)(*(longlong *)*plVar19 + 0xae8))((longlong *)*plVar19,&local_168);
              local_1b0[0] = 0;
              uVar12 = local_158;
              if ((int)local_150 == 0) {
                uVar12 = uVar13;
              }
              (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x3f8))
                        ((longlong *)(param_1[0x16a] + 0x78),uVar12,local_150 & 0xffffffff,
                         &DAT_1405d85a0,param_1 + 1,param_3,local_1b0,local_208,param_4,param_5,
                         param_6,param_7);
              local_168 = Proud::CFastArray<>::vftable;
              if (local_158 != 0) {
                if (local_160 == (longlong *)0x0) {
                  FUN_14034ff60(local_158);
                }
                else {
                  (**(code **)(*local_160 + 0x18))();
                }
              }
            }
            else if (2 < iVar7) {
              if (iVar7 < 5) {
                (**(code **)(*(longlong *)param_1[0x16a] + 400))
                          ((longlong *)param_1[0x16a],param_2,param_3,local_208[0],*param_4,
                           (int)*param_5,param_6,param_7);
              }
              else if (iVar7 == 5) {
                puVar16 = (undefined *)*param_6;
                if ((undefined *)*param_6 == (undefined *)0x0) {
                  puVar16 = PTR_DAT_1405d8010;
                }
                puVar17 = (undefined *)*param_3;
                if ((undefined *)*param_3 == (undefined *)0x0) {
                  puVar17 = PTR_DAT_1405d8010;
                }
                local_100 = *(undefined4 *)((longlong)param_1 + 0x194);
                local_fc = (undefined4)param_1[0x33];
                local_f8 = *(undefined4 *)((longlong)param_1 + 0x19c);
                local_f4 = (undefined4)param_1[0x34];
                (**(code **)(*(longlong *)param_1[0x16a] + 0x198))
                          ((longlong *)param_1[0x16a],&local_100,(int)param_1[1],puVar17,
                           local_208[0],*param_4,(int)*param_5,puVar16,param_7);
              }
            }
            iVar7 = 800;
          }
        }
LAB_1401cd361:
        puVar16 = (undefined *)*param_6;
        if ((((puVar16 == (undefined *)0x0) || (puVar16 == PTR_DAT_1405d8010)) ||
            (*(int *)(puVar16 + -8) < 0x15e)) && (iVar7 != 0)) {
          if (puVar16 == (undefined *)0x0) {
            puVar16 = PTR_DAT_1405d8010;
          }
          puVar17 = (undefined *)*param_3;
          if ((undefined *)*param_3 == (undefined *)0x0) {
            puVar17 = PTR_DAT_1405d8010;
          }
          FUN_140202ea0(param_1[0x16a],param_1,puVar17,puVar16);
        }
        goto LAB_1401cd3da;
      }
    }
    else {
      iVar7 = DAT_14060804c + 1;
      bVar20 = DAT_14060804c == 0;
      DAT_14060804c = iVar7;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar19 == (longlong *)0x0) {
    return 1;
  }
  if (plVar19 != local_1f8) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401cd3da:
  LOCK();
  plVar19 = plVar19 + 1;
  *(int *)plVar19 = (int)*plVar19 + -1;
  UNLOCK();
  if ((int)*plVar19 == 0) {
    puVar6 = (undefined8 *)*local_200;
    if (puVar6 != (undefined8 *)0x0) {
      (**(code **)*puVar6)(puVar6,1);
    }
    operator_delete(local_200);
  }
  return 1;
}



undefined8
FUN_1401cd420(longlong *param_1,longlong *param_2,longlong *param_3,undefined8 param_4,
             longlong *param_5,undefined8 param_6)

{
  DWORD DVar1;
  int iVar2;
  longlong lVar3;
  undefined *puVar4;
  undefined *puVar5;
  undefined4 local_res8 [2];
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30 [2];
  
  lVar3 = *(longlong *)(param_1[0x16a] + 0x4f0);
  DVar1 = timeGetTime();
  if (DVar1 - (int)param_1[0x28] < 500) {
    local_res8[0] = 0x31;
    local_30[0] = 0x2b00;
    (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x70))
              ((longlong *)(param_1[0x16a] + 0x78),(int)param_1[1],&DAT_1405d85a0,local_30,
               local_res8);
    return 1;
  }
  *(DWORD *)(param_1 + 0x28) = DVar1;
  local_34 = (**(code **)(*param_1 + 0x18))(param_1);
  puVar4 = (undefined *)*param_3;
  if ((undefined *)*param_3 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  iVar2 = (**(code **)(*(longlong *)param_1[0x16a] + 0x168))((longlong *)param_1[0x16a],puVar4);
  if (iVar2 == 0) {
    if (lVar3 != 0) {
      local_38 = CONCAT22(local_38._2_2_,(undefined2)local_34);
      (**(code **)(*(longlong *)(lVar3 + 0x70) + 0xf0))
                (lVar3 + 0x70,1,&DAT_1405d85a0,param_1 + 1,param_2,&local_38,param_4,param_3,param_5
                 ,param_6);
    }
  }
  else {
    lVar3 = FUN_14016e240(param_1[0x16a],iVar2);
    if ((lVar3 != 0) && (*(char *)(lVar3 + 0x602) == '\0')) {
      local_res8[0] = 299;
      local_38 = 0x2b00;
      (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x70))
                ((longlong *)(param_1[0x16a] + 0x78),(int)param_1[1],&DAT_1405d85a0,&local_38,
                 local_res8);
      return 1;
    }
    local_res8[0]._0_2_ = 0x11;
    local_38 = 0;
    (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x400))
              ((longlong *)(param_1[0x16a] + 0x78),iVar2,&DAT_1405d85a0,param_1 + 1,param_2,
               &local_38,&local_34,param_4,local_res8,param_5,param_6);
    local_res8[0] = CONCAT22(local_res8[0]._2_2_,0x11);
    local_30[0] = 0;
    (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x400))
              ((longlong *)(param_1[0x16a] + 0x78),(int)param_1[1],&DAT_1405d85a0,param_1 + 1,
               param_2,local_30,&local_34,param_4,local_res8,param_5,param_6);
  }
  puVar4 = (undefined *)*param_5;
  puVar5 = PTR_DAT_1405d8010;
  if (((puVar4 == (undefined *)0x0) || (puVar5 = puVar4, puVar4 == PTR_DAT_1405d8010)) ||
     (*(int *)(puVar4 + -8) < 0x15e)) {
    puVar4 = (undefined *)*param_2;
    if ((undefined *)*param_2 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1405d8010;
    }
    FUN_140202ea0(param_1[0x16a],param_1,puVar4,puVar5);
  }
  return 1;
}



undefined8 FUN_1401cd710(longlong param_1,undefined4 param_2,int *param_3,int *param_4)

{
  short sVar1;
  void *pvVar2;
  int iVar3;
  longlong lVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  longlong *plVar7;
  undefined2 *puVar8;
  short *psVar9;
  longlong *plVar10;
  bool bVar11;
  undefined2 local_res8 [4];
  undefined4 local_res10;
  longlong *local_128;
  longlong *local_120;
  undefined2 local_118;
  undefined2 local_116 [3];
  longlong *local_110;
  longlong *local_108;
  undefined4 local_100 [2];
  undefined4 local_f8 [2];
  undefined4 local_f0 [2];
  undefined4 local_e8 [2];
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8 [2];
  undefined4 local_d0 [2];
  undefined4 local_c8 [2];
  longlong local_c0;
  char local_b8;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined2 local_70;
  undefined6 uStack_6e;
  undefined8 local_60;
  ulonglong local_58;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  local_c0 = 0;
  local_b8 = '\0';
  plVar10 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar10 != 0) {
        lVar4 = *plVar10;
        if ((plVar10 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, lVar4 = 0, DAT_1406080a8 = iVar3
           , bVar11)) {
          FUN_140176d60(1);
        }
        local_b8 = 0;
        local_c0 = lVar4;
        FUN_14034ed40();
        local_b8 = '\x01';
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140197b70(param_1,&local_110);
  plVar10 = local_110;
  local_128 = (longlong *)0x0;
  if (*param_4 == 0) {
    plVar7 = *(longlong **)(param_1 + 0x9d0);
  }
  else {
    plVar7 = *(longlong **)(param_1 + 0x9f0);
  }
  if (plVar7 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar7 + 1) = (int)plVar7[1] + 1;
    UNLOCK();
    local_128 = plVar7;
    local_120 = plVar7;
  }
  if (local_110 != (longlong *)0x0) {
    if (local_110 == local_108) {
      if ((*local_110 != 0) && (local_128 != (longlong *)0x0)) {
        if (local_128 == local_120) {
          if (*local_128 != 0) {
            lVar4 = FUN_140174f00(&local_110);
            iVar3 = *param_3;
            if (((iVar3 <= *(int *)(lVar4 + 0x50a0)) && (0 < iVar3)) && (iVar3 < 0x5f5e101)) {
              uVar5 = FUN_140174f00(&local_110);
              FUN_1401e80d0(uVar5,-iVar3);
              FUN_1402635b0(*local_128,*param_3);
              lVar4 = FUN_140174f50(param_1 + 0x6e0);
              if (lVar4 != 0) {
                local_90 = *(undefined4 *)(param_1 + 0x170);
                local_8c = *(undefined4 *)(param_1 + 0x174);
                local_88 = *(undefined4 *)(param_1 + 0x178);
                local_84 = *(undefined4 *)(param_1 + 0x17c);
                lVar4 = FUN_140174f50(param_1 + 0x6e0);
                plVar7 = (longlong *)(lVar4 + 0xd0);
                if (7 < *(ulonglong *)(lVar4 + 0xe8)) {
                  plVar7 = (longlong *)*plVar7;
                }
                lVar4 = *(longlong *)(param_1 + 0xb50);
                if (*(longlong *)(lVar4 + 0x4f8) != 0) {
                  local_58 = 7;
                  local_60 = 0;
                  local_70 = 0;
                  uVar6 = 0xffffffffffffffff;
                  psVar9 = (short *)plVar7;
                  do {
                    if (uVar6 == 0) break;
                    uVar6 = uVar6 - 1;
                    sVar1 = *psVar9;
                    psVar9 = psVar9 + 1;
                  } while (sVar1 != 0);
                  FUN_140001710(&local_70,plVar7,~uVar6 - 1);
                  puVar8 = &local_70;
                  if (7 < local_58) {
                    puVar8 = (undefined2 *)CONCAT62(uStack_6e,local_70);
                  }
                  FUN_14012b8a0(*(undefined8 *)(lVar4 + 0x4f8),puVar8,&local_90,param_3);
                  if (7 < local_58) {
                    operator_delete((void *)CONCAT62(uStack_6e,local_70));
                  }
                }
              }
              lVar4 = *local_128;
              if (*param_4 == 1) {
                local_d0[0] = *(undefined4 *)(param_1 + 0x5f0);
                local_f8[0] = *(undefined4 *)(lVar4 + 0x9120);
                local_e8[0] = *(undefined4 *)(lVar4 + 0x9124);
                local_b0 = *(undefined4 *)(param_1 + 0x160);
                local_ac = *(undefined4 *)(param_1 + 0x164);
                local_a8 = *(undefined4 *)(param_1 + 0x168);
                local_a4 = *(undefined4 *)(param_1 + 0x16c);
                iVar3 = *(int *)(param_1 + 0x284);
                local_f0[0] = *(undefined4 *)(param_1 + 8);
                if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
                  local_res8[0] = (undefined2)iVar3;
                  plVar7 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar7 + 0xfe0))
                            (plVar7,1,&DAT_1405d85a0,local_res8,local_f0,&local_b0,local_e8,local_f8
                             ,local_d0);
                }
                lVar4 = FUN_140174f00(&local_110);
                local_d8[0] = *(undefined4 *)(lVar4 + 0x50a0);
                local_a0 = *(undefined4 *)(param_1 + 0x170);
                local_9c = *(undefined4 *)(param_1 + 0x174);
                local_98 = *(undefined4 *)(param_1 + 0x178);
                local_94 = *(undefined4 *)(param_1 + 0x17c);
                iVar3 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
                  local_116[0] = (undefined2)iVar3;
                  plVar7 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar7 + 0x260))
                            (plVar7,1,&DAT_1405d85a0,local_116,&local_a0,local_d8);
                }
              }
              else {
                local_e0 = *(undefined4 *)(lVar4 + 0x9120);
                lVar4 = FUN_140174f00(&local_110);
                local_c8[0] = *(undefined4 *)(lVar4 + 0x50a0);
                local_80 = *(undefined4 *)(param_1 + 0x170);
                local_7c = *(undefined4 *)(param_1 + 0x174);
                local_78 = *(undefined4 *)(param_1 + 0x178);
                local_74 = *(undefined4 *)(param_1 + 0x17c);
                iVar3 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
                  local_118 = (undefined2)iVar3;
                  plVar7 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar7 + 0x4a0))
                            (plVar7,1,&DAT_1405d85a0,&local_118,&local_80,local_c8,&local_e0);
                }
              }
              local_100[0] = *(undefined4 *)(*local_128 + 0x9120);
              lVar4 = FUN_140174f00(&local_110);
              local_dc = *(undefined4 *)(lVar4 + 0x50a0);
              plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar7 + 0x680))
                        (plVar7,local_res10,&DAT_1405d85a0,&local_dc,local_100,param_4);
            }
          }
        }
        else {
          iVar3 = DAT_1406080d4 + 1;
          bVar11 = DAT_1406080d4 == 0;
          DAT_1406080d4 = iVar3;
          if (bVar11) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar11 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_128 != (longlong *)0x0) {
    if (local_128 == local_120) {
      LOCK();
      plVar10 = local_128 + 1;
      lVar4 = *plVar10;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      plVar10 = local_110;
      if ((int)lVar4 == 1) {
        pvVar2 = (void *)*local_128;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0x9130);
          operator_delete(pvVar2);
        }
        operator_delete(local_128);
        plVar10 = local_110;
      }
    }
    else {
      iVar3 = DAT_1406080fc + 1;
      bVar11 = DAT_1406080fc == 0;
      DAT_1406080fc = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == local_108) {
      LOCK();
      plVar10 = plVar10 + 1;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      if ((int)*plVar10 == 0) {
        pvVar2 = (void *)*local_110;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0xf630);
          operator_delete(pvVar2);
        }
        operator_delete(local_110);
      }
    }
    else {
      iVar3 = DAT_140608050 + 1;
      bVar11 = DAT_140608050 == 0;
      DAT_140608050 = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_b8 != '\0') {
    FUN_14034edd0(local_c0);
  }
  return 1;
}



undefined8 FUN_1401cdd40(longlong param_1,undefined4 param_2,int *param_3,int *param_4)

{
  longlong *plVar1;
  short sVar2;
  undefined8 *puVar3;
  void *pvVar4;
  int *piVar5;
  int iVar6;
  undefined4 uVar7;
  longlong *plVar8;
  undefined8 uVar9;
  longlong lVar10;
  longlong *plVar11;
  ulonglong uVar12;
  longlong *plVar13;
  undefined2 *puVar14;
  short *psVar15;
  bool bVar16;
  undefined2 local_res8 [4];
  undefined4 local_res10;
  int *local_res18;
  int *local_res20;
  undefined2 local_158;
  undefined2 local_156 [3];
  longlong *local_150;
  longlong *local_148;
  longlong *local_140;
  longlong *local_138;
  int local_130 [2];
  longlong local_128;
  char local_120;
  undefined4 local_118 [2];
  undefined4 local_110 [2];
  undefined4 local_108 [2];
  undefined4 local_100 [2];
  undefined4 local_f8 [2];
  undefined4 local_f0 [2];
  undefined4 local_e8 [2];
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8 [2];
  longlong *local_d0;
  longlong *local_c8;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined2 local_80;
  undefined6 uStack_7e;
  undefined8 local_70;
  ulonglong local_68;
  undefined8 local_58;
  
  local_58 = 0xfffffffffffffffe;
  local_128 = 0;
  local_120 = '\0';
  plVar11 = *(longlong **)(param_1 + 0xb28);
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  if (plVar11 != (longlong *)0x0) {
    if (plVar11 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar11 != 0) {
        lVar10 = *plVar11;
        if ((plVar11 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar6 = DAT_1406080a8 + 1, bVar16 = DAT_1406080a8 == 0, lVar10 = 0,
           DAT_1406080a8 = iVar6, bVar16)) {
          FUN_140176d60(1);
        }
        local_120 = 0;
        local_128 = lVar10;
        FUN_14034ed40();
        local_120 = '\x01';
      }
    }
    else {
      iVar6 = DAT_1406080a8 + 1;
      bVar16 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar6;
      if (bVar16) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140197b70(param_1,&local_150);
  plVar11 = local_150;
  local_140 = (longlong *)0x0;
  if (*param_4 == 0) {
    plVar8 = *(longlong **)(param_1 + 0x9d0);
  }
  else {
    plVar8 = *(longlong **)(param_1 + 0x9f0);
  }
  if (plVar8 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar8 + 1) = (int)plVar8[1] + 1;
    UNLOCK();
    local_140 = plVar8;
    local_138 = plVar8;
  }
  plVar8 = local_140;
  if (local_150 != (longlong *)0x0) {
    if (local_150 == local_148) {
      if ((*local_150 != 0) && (local_140 != (longlong *)0x0)) {
        if (local_140 == local_138) {
          if (*local_140 != 0) {
            FUN_140198570(param_1,&local_d0);
            plVar1 = local_d0;
            if (local_d0 != (longlong *)0x0) {
              if (local_d0 == local_c8) {
                if (*local_d0 != 0) {
                  FUN_1402f8580(*local_d0);
                  uVar9 = DAT_140608098;
                  uVar7 = FUN_1402f8580(*plVar1);
                  local_130[0] = FUN_140314470(uVar9,uVar7);
                  lVar10 = FUN_140174f00(&local_150);
                  if (local_130[0] < *(int *)(lVar10 + 0x50a0) + *param_3) {
                    local_d8[0] = 0;
                    plVar11 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    (**(code **)(*plVar11 + 0x970))
                              (plVar11,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_130,
                               local_d8);
                    LOCK();
                    plVar1 = plVar1 + 1;
                    *(int *)plVar1 = (int)*plVar1 + -1;
                    UNLOCK();
                    if ((int)*plVar1 == 0) {
                      puVar3 = (undefined8 *)*local_d0;
                      if (puVar3 != (undefined8 *)0x0) {
                        (**(code **)*puVar3)(puVar3,1);
                      }
                      operator_delete(local_d0);
                    }
                    plVar8 = local_140;
                    LOCK();
                    plVar11 = local_140 + 1;
                    *(int *)plVar11 = (int)*plVar11 + -1;
                    UNLOCK();
                    if ((int)*plVar11 == 0) {
                      pvVar4 = (void *)*local_140;
                      if (pvVar4 != (void *)0x0) {
                        FUN_14034edf0((longlong)pvVar4 + 0x9130);
                        operator_delete(pvVar4);
                      }
                      operator_delete(plVar8);
                    }
                    LOCK();
                    plVar11 = local_150 + 1;
                    *(int *)plVar11 = (int)*plVar11 + -1;
                    UNLOCK();
                    if ((int)*plVar11 == 0) {
                      pvVar4 = (void *)*local_150;
                      if (pvVar4 != (void *)0x0) {
                        FUN_14034edf0((longlong)pvVar4 + 0xf630);
                        operator_delete(pvVar4);
                      }
                      operator_delete(local_150);
                    }
                    goto LAB_1401ce4e5;
                  }
                }
              }
              else {
                iVar6 = DAT_14060804c + 1;
                bVar16 = DAT_14060804c == 0;
                DAT_14060804c = iVar6;
                if (bVar16) {
                  FUN_140176d60(1);
                }
              }
            }
            iVar6 = *param_3;
            if (((iVar6 <= *(int *)(*plVar8 + 0x9120)) && (0 < iVar6)) && (iVar6 < 0x5f5e101)) {
              FUN_1402635b0(*plVar8,-iVar6);
              uVar9 = FUN_140174f00(&local_150);
              FUN_1401e80d0(uVar9,*param_3);
              lVar10 = FUN_140174f50(param_1 + 0x6e0);
              if (lVar10 != 0) {
                local_a0 = *(undefined4 *)(param_1 + 0x170);
                local_9c = *(undefined4 *)(param_1 + 0x174);
                local_98 = *(undefined4 *)(param_1 + 0x178);
                local_94 = *(undefined4 *)(param_1 + 0x17c);
                lVar10 = FUN_140174f50(param_1 + 0x6e0);
                plVar13 = (longlong *)(lVar10 + 0xd0);
                if (7 < *(ulonglong *)(lVar10 + 0xe8)) {
                  plVar13 = (longlong *)*plVar13;
                }
                lVar10 = *(longlong *)(param_1 + 0xb50);
                if (*(longlong *)(lVar10 + 0x4f8) != 0) {
                  local_68 = 7;
                  local_70 = 0;
                  local_80 = 0;
                  uVar12 = 0xffffffffffffffff;
                  psVar15 = (short *)plVar13;
                  do {
                    if (uVar12 == 0) break;
                    uVar12 = uVar12 - 1;
                    sVar2 = *psVar15;
                    psVar15 = psVar15 + 1;
                  } while (sVar2 != 0);
                  FUN_140001710(&local_80,plVar13,~uVar12 - 1);
                  puVar14 = &local_80;
                  if (7 < local_68) {
                    puVar14 = (undefined2 *)CONCAT62(uStack_7e,local_80);
                  }
                  FUN_14012b8a0(*(undefined8 *)(lVar10 + 0x4f8),puVar14,&local_a0,local_res18);
                  if (7 < local_68) {
                    operator_delete((void *)CONCAT62(uStack_7e,local_80));
                  }
                }
              }
              piVar5 = local_res20;
              lVar10 = *plVar8;
              if (*local_res20 == 1) {
                local_110[0] = *(undefined4 *)(param_1 + 0x5f0);
                local_108[0] = *(undefined4 *)(lVar10 + 0x9120);
                local_f8[0] = *(undefined4 *)(lVar10 + 0x9124);
                local_c0 = *(undefined4 *)(param_1 + 0x160);
                local_bc = *(undefined4 *)(param_1 + 0x164);
                local_b8 = *(undefined4 *)(param_1 + 0x168);
                local_b4 = *(undefined4 *)(param_1 + 0x16c);
                iVar6 = *(int *)(param_1 + 0x284);
                local_e8[0] = *(undefined4 *)(param_1 + 8);
                if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)) {
                  local_res8[0] = (undefined2)iVar6;
                  plVar13 = (longlong *)
                            (*(longlong *)
                              (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                            + 0x70);
                  (**(code **)(*plVar13 + 0xfe0))
                            (plVar13,1,&DAT_1405d85a0,local_res8,local_e8,&local_c0,local_f8,
                             local_108,local_110);
                }
                lVar10 = FUN_140174f00(&local_150);
                local_100[0] = *(undefined4 *)(lVar10 + 0x50a0);
                local_b0 = *(undefined4 *)(param_1 + 0x170);
                local_ac = *(undefined4 *)(param_1 + 0x174);
                local_a8 = *(undefined4 *)(param_1 + 0x178);
                local_a4 = *(undefined4 *)(param_1 + 0x17c);
                iVar6 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)) {
                  local_156[0] = (undefined2)iVar6;
                  plVar13 = (longlong *)
                            (*(longlong *)
                              (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                            + 0x70);
                  (**(code **)(*plVar13 + 0x260))
                            (plVar13,1,&DAT_1405d85a0,local_156,&local_b0,local_100);
                }
              }
              else {
                local_e0 = *(undefined4 *)(lVar10 + 0x9120);
                lVar10 = FUN_140174f00(&local_150);
                local_f0[0] = *(undefined4 *)(lVar10 + 0x50a0);
                local_90 = *(undefined4 *)(param_1 + 0x170);
                local_8c = *(undefined4 *)(param_1 + 0x174);
                local_88 = *(undefined4 *)(param_1 + 0x178);
                local_84 = *(undefined4 *)(param_1 + 0x17c);
                iVar6 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar10 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar10 != 0)) {
                  local_158 = (undefined2)iVar6;
                  plVar13 = (longlong *)
                            (*(longlong *)
                              (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                            + 0x70);
                  (**(code **)(*plVar13 + 0x4a0))
                            (plVar13,1,&DAT_1405d85a0,&local_158,&local_90,local_f0,&local_e0);
                }
              }
              local_118[0] = *(undefined4 *)(*plVar8 + 0x9120);
              lVar10 = FUN_140174f00(&local_150);
              local_dc = *(undefined4 *)(lVar10 + 0x50a0);
              plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar13 + 0x680))
                        (plVar13,local_res10,&DAT_1405d85a0,&local_dc,local_118,piVar5);
            }
            if (plVar1 != (longlong *)0x0) {
              if (plVar1 == local_c8) {
                LOCK();
                plVar1 = plVar1 + 1;
                lVar10 = *plVar1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                plVar8 = local_140;
                plVar11 = local_150;
                if ((int)lVar10 == 1) {
                  puVar3 = (undefined8 *)*local_d0;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  operator_delete(local_d0);
                  plVar8 = local_140;
                  plVar11 = local_150;
                }
              }
              else {
                iVar6 = DAT_140608054 + 1;
                bVar16 = DAT_140608054 == 0;
                DAT_140608054 = iVar6;
                if (bVar16) {
                  FUN_140176d60(1);
                }
              }
            }
          }
        }
        else {
          iVar6 = DAT_1406080d4 + 1;
          bVar16 = DAT_1406080d4 == 0;
          DAT_1406080d4 = iVar6;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar16 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar16) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = local_140;
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == local_138) {
      LOCK();
      plVar8 = plVar8 + 1;
      lVar10 = *plVar8;
      *(int *)plVar8 = (int)*plVar8 + -1;
      UNLOCK();
      plVar11 = local_150;
      if ((int)lVar10 == 1) {
        pvVar4 = (void *)*local_140;
        if (pvVar4 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar4 + 0x9130);
          operator_delete(pvVar4);
        }
        operator_delete(plVar1);
        plVar11 = local_150;
      }
    }
    else {
      iVar6 = DAT_1406080fc + 1;
      bVar16 = DAT_1406080fc == 0;
      DAT_1406080fc = iVar6;
      if (bVar16) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar11 != (longlong *)0x0) {
    if (plVar11 == local_148) {
      LOCK();
      plVar11 = plVar11 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      if ((int)*plVar11 == 0) {
        pvVar4 = (void *)*local_150;
        if (pvVar4 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar4 + 0xf630);
          operator_delete(pvVar4);
        }
        operator_delete(local_150);
      }
    }
    else {
      iVar6 = DAT_140608050 + 1;
      bVar16 = DAT_140608050 == 0;
      DAT_140608050 = iVar6;
      if (bVar16) {
        FUN_140176d60(1);
      }
    }
  }
LAB_1401ce4e5:
  if (local_120 != '\0') {
    FUN_14034edd0(local_128);
  }
  return 1;
}



undefined8 FUN_1401ce510(longlong param_1,ulonglong *param_2,ushort *param_3,ushort *param_4)

{
  longlong *plVar1;
  float fVar2;
  ushort uVar3;
  ushort uVar4;
  undefined4 uVar5;
  void *pvVar6;
  undefined8 *puVar7;
  int iVar8;
  int iVar9;
  undefined8 uVar10;
  size_t sVar11;
  wchar_t *pwVar12;
  int *piVar13;
  longlong *plVar14;
  longlong lVar15;
  int iVar16;
  bool bVar17;
  bool bVar18;
  float fVar19;
  int local_res8 [2];
  ulonglong *puVar20;
  undefined8 in_stack_fffffffffffffc50;
  undefined4 uVar22;
  ulonglong uVar21;
  undefined8 in_stack_fffffffffffffc58;
  undefined4 uVar24;
  undefined8 uVar23;
  undefined4 local_388;
  int local_384;
  int local_380;
  int local_37c;
  int local_378 [2];
  longlong *local_370;
  longlong *local_368;
  int local_360 [2];
  longlong *local_358;
  longlong *local_350;
  int local_348;
  int local_344;
  int local_340;
  undefined4 local_33c;
  undefined4 local_338;
  undefined4 local_334;
  undefined4 local_330;
  undefined4 local_32c;
  undefined4 local_328;
  undefined4 local_324;
  undefined4 local_320;
  ulonglong local_318;
  ulonglong local_310;
  undefined4 local_300;
  short local_2fc;
  int local_2f4 [31];
  int local_278;
  int local_274;
  undefined4 local_270;
  undefined8 local_268;
  undefined1 local_258 [8];
  undefined4 local_250;
  undefined4 local_24c;
  undefined4 local_248;
  undefined4 local_244;
  undefined4 local_240;
  undefined4 local_23c;
  undefined4 local_238;
  undefined4 local_234;
  wchar_t local_230 [48];
  undefined4 local_1d0;
  undefined4 local_1cc;
  int local_1c8;
  undefined4 local_1c4;
  char local_1c0 [104];
  undefined1 local_158 [8];
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  wchar_t local_130 [48];
  undefined4 local_d0;
  undefined4 local_cc;
  int local_c8;
  undefined4 local_c4;
  char local_c0 [136];
  
  uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffc50 >> 0x20);
  uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffc58 >> 0x20);
  local_268 = 0xfffffffffffffffe;
  local_388 = 1;
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    local_388 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
  }
  FUN_140198570(param_1,&local_370);
  plVar14 = local_370;
  if (local_370 == (longlong *)0x0) {
LAB_1401cefe4:
    if (plVar14 == (longlong *)0x0) {
      return 1;
    }
    if (plVar14 != local_368) {
      if (DAT_140608054 != 0) {
        DAT_140608054 = DAT_140608054 + 1;
        return 1;
      }
      DAT_140608054 = DAT_140608054 + 1;
      FUN_140176d60(1);
      return 1;
    }
  }
  else {
    if (local_370 != local_368) {
      iVar8 = DAT_14060804c + 1;
      bVar18 = DAT_14060804c == 0;
      DAT_14060804c = iVar8;
      if (bVar18) {
        FUN_140176d60(1);
      }
      goto LAB_1401cefe4;
    }
    if (*local_370 == 0) goto LAB_1401cefe4;
    FUN_140197b70(param_1,&local_358);
    plVar1 = local_358;
    if (local_358 != (longlong *)0x0) {
      if (local_358 == local_350) {
        if (*local_358 != 0) {
          bVar18 = false;
          local_384 = 0;
          FUN_14000a170(&local_318);
          local_270 = 0;
          uVar3 = *param_4;
          uVar4 = *param_3;
          if ((uVar4 < 5) && (uVar3 < 0x18)) {
            lVar15 = ((longlong)(short)uVar3 + (longlong)(short)uVar4 * 0x18) * 0xac + *plVar1;
            *(ushort *)(lVar15 + 0x14) = uVar4;
            *(ushort *)(lVar15 + 0x16) = uVar3;
            FUN_140090020(&local_318);
            bVar17 = *param_2 < local_318;
            if ((*param_2 == local_318) &&
               (bVar17 = param_2[1] < local_310, param_2[1] == local_310)) {
              iVar8 = 0;
            }
            else {
              iVar8 = (1 - (uint)bVar17) - (uint)(bVar17 != 0);
            }
            if (iVar8 == 0) {
              fVar2 = *(float *)(*plVar14 + 0x22a4);
              uVar10 = FUN_140137690();
              lVar15 = FUN_140136770(uVar10,local_300);
              if (lVar15 == 0) {
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  pvVar6 = (void *)*local_358;
                  if (pvVar6 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar6 + 0xf630);
                    operator_delete(pvVar6);
                  }
                  operator_delete(local_358);
                }
              }
              else {
                iVar8 = *(int *)(lVar15 + 0xd0);
                local_378[0] = iVar8;
                if ((iVar8 == 1) || (iVar8 == 2)) {
                  if (local_278 < 1) {
                    local_274 = *(int *)(lVar15 + 0x140) + local_274;
                  }
                  iVar16 = local_274 + local_278;
                  local_360[0] = iVar16;
                  if (local_2f4[0] != iVar16) {
                    iVar9 = *(int *)(lVar15 + 0x16c);
                    uVar10 = CONCAT44(uVar24,iVar9);
                    uVar21 = CONCAT44(uVar22,(int)local_2fc);
                    puVar20 = &local_318;
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a9,0x52,param_1,puVar20,uVar21
                                  ,uVar10,local_2f4[0],iVar16);
                    uVar22 = (undefined4)((ulonglong)puVar20 >> 0x20);
                    uVar24 = (undefined4)((ulonglong)uVar10 >> 0x20);
                    local_380 = local_2f4[0];
                    local_37c = iVar16 / 100;
                    fVar19 = (float)iVar9 * 0.25;
                    local_344 = (int)(((float)(local_37c - local_2f4[0] / 100) * fVar19) /
                                     (float)local_37c);
                    local_340 = 1;
                    piVar13 = &local_340;
                    if (0 < local_344) {
                      piVar13 = &local_344;
                    }
                    iVar9 = *piVar13;
                    local_res8[0] = iVar9;
                    lVar15 = FUN_140174f00(&local_358);
                    if (iVar9 < *(int *)(lVar15 + 0x50a0)) {
                      if (fVar2 != 0.0) {
                        local_res8[0] = (int)((float)iVar9 * fVar2);
                      }
                      local_2f4[0] = iVar16;
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      uVar5 = *(undefined4 *)(lVar15 + 0x50a0);
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      uVar23 = CONCAT44(uVar24,*(undefined4 *)(lVar15 + 0x50a0));
                      uVar21 = uVar21 & 0xffffffff00000000;
                      uVar10 = CONCAT44(uVar22,0x59);
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_318,0x193,uVar10
                                    ,uVar21,uVar23,uVar5,0,0);
                      uVar22 = (undefined4)((ulonglong)uVar10 >> 0x20);
                      uVar24 = (undefined4)((ulonglong)uVar23 >> 0x20);
                      FUN_14011f210(local_258);
                      local_250 = *(undefined4 *)(param_1 + 0x160);
                      local_24c = *(undefined4 *)(param_1 + 0x164);
                      local_248 = *(undefined4 *)(param_1 + 0x168);
                      local_244 = *(undefined4 *)(param_1 + 0x16c);
                      local_240 = *(undefined4 *)(param_1 + 0x170);
                      local_23c = *(undefined4 *)(param_1 + 0x174);
                      local_238 = *(undefined4 *)(param_1 + 0x178);
                      local_234 = *(undefined4 *)(param_1 + 0x17c);
                      pwVar12 = (wchar_t *)(*plVar14 + 0xd0);
                      if (7 < *(ulonglong *)(*plVar14 + 0xe8)) {
                        pwVar12 = *(wchar_t **)pwVar12;
                      }
                      sVar11 = wcsnlen(pwVar12,0x10);
                      if (sVar11 < 0x10) {
                        pwVar12 = (wchar_t *)(*plVar14 + 0xd0);
                        if (7 < *(ulonglong *)(*plVar14 + 0xe8)) {
                          pwVar12 = *(wchar_t **)pwVar12;
                        }
                        wcscpy_s(local_230,0x10,pwVar12);
                      }
                      strcpy_s(local_1c0,0x32,(char *)(param_1 + 0x330));
                      local_1d0 = 0x11;
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      iVar16 = local_res8[0];
                      local_1cc = *(undefined4 *)(lVar15 + 0x50a0);
                      local_1c8 = local_res8[0];
                      FUN_140197b90(param_1,-local_res8[0]);
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      local_1c4 = *(undefined4 *)(lVar15 + 0x50a0);
                      FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),
                                    *(undefined4 *)(param_1 + 0x288),
                                    *(undefined4 *)(param_1 + 0x284),local_258);
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      uVar5 = *(undefined4 *)(lVar15 + 0x50a0);
                      lVar15 = FUN_140174f00(param_1 + 0x6c0);
                      uVar10 = CONCAT44(uVar22,0x40);
                      FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x192,uVar10,
                                    uVar21 & 0xffffffff00000000,
                                    CONCAT44(uVar24,*(int *)(lVar15 + 0x50a0) + iVar16),uVar5,iVar16
                                    ,0);
                      uVar22 = (undefined4)((ulonglong)uVar10 >> 0x20);
                      local_378[0] = iVar8;
LAB_1401ced5a:
                      if (local_380 == 0) {
                        iVar8 = 1;
                        bVar18 = false;
                        if (local_378[0] != 1) {
                          bVar18 = local_378[0] == 2;
                          iVar8 = local_384;
                        }
                      }
                      else {
                        iVar8 = 0;
                      }
                      local_380 = (int)(short)*param_4;
                      uVar3 = *param_3;
                      local_378[0] = (int)(short)uVar3;
                      uVar10 = FUN_140174f00(&local_358);
                      if (-1 < (short)uVar3) {
                        FUN_1401ed220(uVar10,local_378,&local_380,&local_318,CONCAT44(uVar22,6));
                      }
                      local_32c = *(undefined4 *)(param_1 + 0x160);
                      local_328 = *(undefined4 *)(param_1 + 0x164);
                      local_324 = *(undefined4 *)(param_1 + 0x168);
                      local_320 = *(undefined4 *)(param_1 + 0x16c);
                      local_33c = *(undefined4 *)(param_1 + 0x170);
                      local_338 = *(undefined4 *)(param_1 + 0x174);
                      local_334 = *(undefined4 *)(param_1 + 0x178);
                      local_330 = *(undefined4 *)(param_1 + 0x17c);
                      iVar16 = *(int *)(param_1 + 0x284);
                      if (((-1 < iVar16) &&
                          (iVar16 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                         (lVar15 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0),
                         lVar15 != 0)) {
                        local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar16);
                        plVar14 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar15 + 8) +
                                    (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                        (**(code **)(*plVar14 + 0x140))
                                  (plVar14,1,&DAT_1405d85a0,local_res8,&local_33c,&local_32c,
                                   &local_318);
                      }
                      plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                      (**(code **)(*plVar14 + 0xf0))
                                (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_3,param_4
                                 ,&local_318,local_2f4);
                      if ((*param_3 == 0) && ((iVar8 != 0 || (bVar18)))) {
                        FUN_14019c070(param_1,local_388);
                      }
                    }
                    else {
                      local_348 = (int)(fVar19 / (float)local_37c);
                      local_37c = 1;
                      piVar13 = &local_37c;
                      if (0 < local_348) {
                        piVar13 = &local_348;
                      }
                      iVar8 = *piVar13;
                      lVar15 = FUN_140174f00(&local_358);
                      iVar9 = *(int *)(lVar15 + 0x50a0) / iVar8;
                      if (0 < iVar9) {
                        iVar8 = iVar9 * iVar8;
                        if (fVar2 != 0.0) {
                          iVar8 = (int)((float)iVar8 * fVar2);
                        }
                        local_2f4[0] = local_2f4[0] + iVar9 * 100;
                        piVar13 = local_360;
                        if (local_2f4[0] <= iVar16) {
                          piVar13 = local_2f4;
                        }
                        local_2f4[0] = *piVar13;
                        lVar15 = FUN_140174f00(param_1 + 0x6c0);
                        uVar5 = *(undefined4 *)(lVar15 + 0x50a0);
                        lVar15 = FUN_140174f00(param_1 + 0x6c0);
                        uVar23 = CONCAT44(uVar24,*(undefined4 *)(lVar15 + 0x50a0));
                        uVar21 = uVar21 & 0xffffffff00000000;
                        uVar10 = CONCAT44(uVar22,0x59);
                        FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_318,0x193,
                                      uVar10,uVar21,uVar23,uVar5,0,0);
                        uVar22 = (undefined4)((ulonglong)uVar10 >> 0x20);
                        uVar24 = (undefined4)((ulonglong)uVar23 >> 0x20);
                        FUN_14011f210(local_158);
                        local_150 = *(undefined4 *)(param_1 + 0x160);
                        local_14c = *(undefined4 *)(param_1 + 0x164);
                        local_148 = *(undefined4 *)(param_1 + 0x168);
                        local_144 = *(undefined4 *)(param_1 + 0x16c);
                        local_140 = *(undefined4 *)(param_1 + 0x170);
                        local_13c = *(undefined4 *)(param_1 + 0x174);
                        local_138 = *(undefined4 *)(param_1 + 0x178);
                        local_134 = *(undefined4 *)(param_1 + 0x17c);
                        pwVar12 = (wchar_t *)(*plVar14 + 0xd0);
                        if (7 < *(ulonglong *)(*plVar14 + 0xe8)) {
                          pwVar12 = *(wchar_t **)pwVar12;
                        }
                        sVar11 = wcsnlen(pwVar12,0x10);
                        if (sVar11 < 0x10) {
                          pwVar12 = (wchar_t *)(*plVar14 + 0xd0);
                          if (7 < *(ulonglong *)(*plVar14 + 0xe8)) {
                            pwVar12 = *(wchar_t **)pwVar12;
                          }
                          wcscpy_s(local_130,0x10,pwVar12);
                        }
                        strcpy_s(local_c0,0x32,(char *)(param_1 + 0x330));
                        local_d0 = 0x11;
                        lVar15 = FUN_140174f00(param_1 + 0x6c0);
                        local_cc = *(undefined4 *)(lVar15 + 0x50a0);
                        local_c8 = iVar8;
                        FUN_140197b90(param_1,-iVar8);
                        lVar15 = FUN_140174f00(param_1 + 0x6c0);
                        local_c4 = *(undefined4 *)(lVar15 + 0x50a0);
                        FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),
                                      *(undefined4 *)(param_1 + 0x288),
                                      *(undefined4 *)(param_1 + 0x284),local_158);
                        lVar15 = FUN_140174f00(param_1 + 0x6c0);
                        uVar5 = *(undefined4 *)(lVar15 + 0x50a0);
                        lVar15 = FUN_140174f00(param_1 + 0x6c0);
                        uVar10 = CONCAT44(uVar22,0x40);
                        FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x192,uVar10,
                                      uVar21 & 0xffffffff00000000,
                                      CONCAT44(uVar24,*(int *)(lVar15 + 0x50a0) + local_res8[0]),
                                      uVar5,local_res8[0],0);
                        uVar22 = (undefined4)((ulonglong)uVar10 >> 0x20);
                        goto LAB_1401ced5a;
                      }
                    }
                    local_388 = 1;
                    local_384 = 0x2afa;
                    plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                    (**(code **)(*plVar14 + 0x70))
                              (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_384,
                               &local_388);
                    goto LAB_1401cef25;
                  }
                  LOCK();
                  plVar1 = plVar1 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    pvVar6 = (void *)*local_358;
                    if (pvVar6 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar6 + 0xf630);
                      operator_delete(pvVar6);
                    }
                    operator_delete(local_358);
                  }
                }
                else {
                  LOCK();
                  plVar1 = plVar1 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    pvVar6 = (void *)*local_358;
                    if (pvVar6 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar6 + 0xf630);
                      operator_delete(pvVar6);
                    }
                    operator_delete(local_358);
                  }
                }
              }
              LOCK();
              plVar14 = local_370 + 1;
              *(int *)plVar14 = (int)*plVar14 + -1;
              UNLOCK();
              if ((int)*plVar14 != 0) {
                return 1;
              }
              puVar7 = (undefined8 *)*local_370;
              plVar14 = local_370;
              goto joined_r0x0001401cef70;
            }
          }
LAB_1401cef25:
          LOCK();
          plVar1 = plVar1 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar6 = (void *)*local_358;
            if (pvVar6 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar6 + 0xf630);
              operator_delete(pvVar6);
            }
            operator_delete(local_358);
          }
          LOCK();
          plVar14 = local_370 + 1;
          *(int *)plVar14 = (int)*plVar14 + -1;
          UNLOCK();
          if ((int)*plVar14 != 0) {
            return 1;
          }
          puVar7 = (undefined8 *)*local_370;
          plVar14 = local_370;
          goto joined_r0x0001401cef70;
        }
      }
      else {
        iVar8 = DAT_140608048 + 1;
        bVar18 = DAT_140608048 == 0;
        DAT_140608048 = iVar8;
        if (bVar18) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_350) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar15 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        plVar14 = local_370;
        if ((int)lVar15 == 1) {
          pvVar6 = (void *)*local_358;
          if (pvVar6 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar6 + 0xf630);
            operator_delete(pvVar6);
          }
          operator_delete(local_358);
          plVar14 = local_370;
        }
      }
      else {
        iVar8 = DAT_140608050 + 1;
        bVar18 = DAT_140608050 == 0;
        DAT_140608050 = iVar8;
        if (bVar18) {
          FUN_140176d60(1);
        }
      }
    }
  }
  LOCK();
  plVar14 = plVar14 + 1;
  *(int *)plVar14 = (int)*plVar14 + -1;
  UNLOCK();
  if ((int)*plVar14 != 0) {
    return 1;
  }
  puVar7 = (undefined8 *)*local_370;
  plVar14 = local_370;
joined_r0x0001401cef70:
  if (puVar7 != (undefined8 *)0x0) {
    (**(code **)*puVar7)(puVar7,1);
  }
  operator_delete(plVar14);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401cff66)
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1401cf060(longlong param_1)

{
  longlong *plVar1;
  float fVar2;
  void *pvVar3;
  undefined8 *puVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  uint uVar8;
  undefined8 uVar9;
  size_t sVar10;
  uint *puVar11;
  wchar_t *pwVar12;
  longlong *plVar13;
  int *piVar14;
  longlong *plVar15;
  longlong lVar16;
  uint uVar17;
  int iVar18;
  undefined1 *puVar19;
  uint uVar20;
  int iVar21;
  bool bVar22;
  undefined2 local_res8 [4];
  undefined2 local_res10 [4];
  undefined2 local_res18 [4];
  int local_res20 [2];
  int *in_stack_fffffffffffff908;
  longlong *in_stack_fffffffffffff910;
  undefined4 uVar24;
  ulonglong uVar23;
  uint *in_stack_fffffffffffff918;
  undefined4 uVar25;
  undefined4 uVar26;
  uint local_6c8;
  int local_6c4;
  uint local_6c0;
  int local_6bc;
  uint local_6b8 [2];
  int *local_6b0;
  longlong *local_6a8;
  longlong *local_6a0;
  longlong *local_698;
  longlong *local_690;
  int local_688 [3];
  undefined4 local_67c;
  undefined4 local_678;
  undefined4 local_674;
  int local_670;
  int local_66c;
  int local_668 [2];
  int local_660 [8];
  undefined4 local_640;
  undefined4 local_63c;
  undefined4 local_638;
  undefined4 local_634;
  undefined4 local_630;
  undefined4 local_62c;
  undefined4 local_628;
  undefined4 local_624;
  undefined4 local_620;
  undefined4 local_61c;
  undefined4 local_618;
  undefined4 local_614;
  undefined4 local_610;
  undefined4 local_60c;
  undefined4 local_608;
  undefined4 local_604;
  longlong local_5f8;
  longlong local_5f0;
  int local_5e0;
  short local_5dc;
  uint local_5d4 [31];
  int local_558;
  int local_554;
  undefined4 local_550;
  undefined8 local_548;
  longlong local_538;
  longlong local_530;
  uint local_520;
  uint local_514 [31];
  int local_498;
  int local_494;
  undefined4 local_490;
  undefined1 local_488 [8];
  undefined4 local_480;
  undefined4 local_47c;
  undefined4 local_478;
  undefined4 local_474;
  undefined4 local_470;
  undefined4 local_46c;
  undefined4 local_468;
  undefined4 local_464;
  wchar_t local_460 [48];
  undefined4 local_400;
  undefined4 local_3fc;
  int local_3f8;
  undefined4 local_3f4;
  char local_3f0 [104];
  undefined1 local_388 [8];
  undefined4 local_380;
  undefined4 local_37c;
  undefined4 local_378;
  undefined4 local_374;
  undefined4 local_370;
  undefined4 local_36c;
  undefined4 local_368;
  undefined4 local_364;
  wchar_t local_360 [48];
  undefined4 local_300;
  undefined4 local_2fc;
  int local_2f8;
  undefined4 local_2f4;
  char local_2f0 [104];
  undefined1 local_288 [8];
  undefined4 local_280;
  undefined4 local_27c;
  undefined4 local_278;
  undefined4 local_274;
  undefined4 local_270;
  undefined4 local_26c;
  undefined4 local_268;
  undefined4 local_264;
  wchar_t local_260 [48];
  undefined4 local_200;
  undefined4 local_1fc;
  int local_1f8;
  undefined4 local_1f4;
  char local_1f0 [104];
  undefined1 local_188 [8];
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  wchar_t local_160 [48];
  undefined4 local_100;
  undefined4 local_fc;
  int local_f8;
  undefined4 local_f4;
  char local_f0 [176];
  
  local_548 = 0xfffffffffffffffe;
  local_6c0 = 1;
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    local_6c0 = *(uint *)(*(longlong *)(param_1 + 0xb58) + 0x90);
  }
  FUN_140198570(param_1,&local_698);
  plVar15 = local_698;
  if (local_698 == (longlong *)0x0) {
LAB_1401d0059:
    if (plVar15 == (longlong *)0x0) {
      return 1;
    }
    if (plVar15 != local_690) {
      if (DAT_140608054 != 0) {
        DAT_140608054 = DAT_140608054 + 1;
        return 1;
      }
      DAT_140608054 = DAT_140608054 + 1;
      FUN_140176d60(1);
      return 1;
    }
  }
  else {
    if (local_698 != local_690) {
      iVar6 = DAT_14060804c + 1;
      bVar22 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar22) {
        FUN_140176d60(1);
      }
      goto LAB_1401d0059;
    }
    if (*local_698 == 0) goto LAB_1401d0059;
    FUN_140197b70(param_1,&local_6a8);
    plVar1 = local_6a8;
    if (local_6a8 != (longlong *)0x0) {
      if (local_6a8 == local_6a0) {
        if (*local_6a8 != 0) {
          local_660[0] = 0;
          local_660[1] = 1;
          local_660[2] = 3;
          local_660[3] = 2;
          local_660[4] = 4;
          local_660[5] = 9;
          local_660[6] = 5;
          fVar2 = *(float *)(*plVar15 + 0x22a4);
          iVar6 = 0;
          local_6bc = 0;
          local_res20[0] = 0;
          local_6c4 = 0;
          piVar14 = local_660;
          do {
            iVar18 = local_6c4;
            local_6b0 = piVar14;
            FUN_14000a170(&local_5f8);
            local_550 = 0;
            iVar7 = *piVar14;
            iVar21 = local_res20[0];
            if ((-1 < iVar7) && (iVar7 < 0x18)) {
              lVar16 = (longlong)iVar7 * 0xac + *plVar1;
              *(undefined2 *)(lVar16 + 0x14) = 0;
              *(short *)(lVar16 + 0x16) = (short)*piVar14;
              FUN_140090020(&local_5f8);
              if ((local_5f8 == 0) && (local_5f0 == 0)) {
                bVar22 = false;
              }
              else {
                bVar22 = true;
              }
              iVar21 = local_res20[0];
              if ((bVar22) && (0 < local_5e0)) {
                if (local_558 < 1) {
                  uVar9 = FUN_140137690();
                  iVar7 = FUN_140136bb0(uVar9,local_5e0);
                  uVar20 = local_558 + local_554 + iVar7;
                }
                else {
                  uVar20 = local_558 + local_554;
                }
                uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffff910 >> 0x20);
                uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffff918 >> 0x20);
                local_6c8 = local_5d4[0];
                iVar21 = local_res20[0];
                local_6b8[0] = uVar20;
                if (local_5d4[0] != uVar20) {
                  uVar9 = FUN_140137690();
                  iVar7 = FUN_140136cd0(uVar9,local_5e0);
                  iVar6 = (int)uVar20 / 100;
                  local_66c = (int)(((float)(iVar6 - (int)local_5d4[0] / 100) * (float)iVar7 * 0.25)
                                   / (float)iVar6);
                  local_67c = 1;
                  piVar14 = local_688 + 3;
                  if (0 < local_66c) {
                    piVar14 = &local_66c;
                  }
                  iVar21 = *piVar14;
                  if (fVar2 != 0.0) {
                    iVar21 = (int)((float)iVar21 * fVar2);
                  }
                  lVar16 = FUN_140174f00(&local_6a8);
                  if (iVar21 < *(int *)(lVar16 + 0x50a0)) {
                    local_5d4[0] = uVar20;
                    FUN_14011f210(local_488);
                    local_480 = *(undefined4 *)(param_1 + 0x160);
                    local_47c = *(undefined4 *)(param_1 + 0x164);
                    local_478 = *(undefined4 *)(param_1 + 0x168);
                    local_474 = *(undefined4 *)(param_1 + 0x16c);
                    local_470 = *(undefined4 *)(param_1 + 0x170);
                    local_46c = *(undefined4 *)(param_1 + 0x174);
                    local_468 = *(undefined4 *)(param_1 + 0x178);
                    local_464 = *(undefined4 *)(param_1 + 0x17c);
                    pwVar12 = (wchar_t *)(*plVar15 + 0xd0);
                    if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                      pwVar12 = *(wchar_t **)pwVar12;
                    }
                    sVar10 = wcsnlen(pwVar12,0x10);
                    if (sVar10 < 0x10) {
                      pwVar12 = (wchar_t *)(*plVar15 + 0xd0);
                      if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                        pwVar12 = *(wchar_t **)pwVar12;
                      }
                      wcscpy_s(local_460,0x10,pwVar12);
                    }
                    strcpy_s(local_3f0,0x32,(char *)(param_1 + 0x330));
                    local_400 = 0x11;
                    lVar16 = FUN_140174f00(param_1 + 0x6c0);
                    local_3fc = *(undefined4 *)(lVar16 + 0x50a0);
                    local_3f8 = iVar21;
                    FUN_140197b90(param_1,-iVar21);
                    lVar16 = FUN_140174f00(param_1 + 0x6c0);
                    local_3f4 = *(undefined4 *)(lVar16 + 0x50a0);
                    FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                                  *(undefined4 *)(param_1 + 0x284),local_488);
                    uVar20 = local_6c8;
                    uVar9 = CONCAT44(uVar25,iVar21);
                    uVar23 = CONCAT44(uVar24,(int)local_5dc);
                    plVar13 = &local_5f8;
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a9,0x51,param_1,plVar13,uVar23
                                  ,uVar9,local_6c8,local_5d4[0]);
                    uVar25 = (undefined4)((ulonglong)plVar13 >> 0x20);
                    uVar26 = (undefined4)((ulonglong)uVar9 >> 0x20);
                    lVar16 = FUN_140174f00(param_1 + 0x6c0);
                    uVar24 = *(undefined4 *)(lVar16 + 0x50a0);
                    lVar16 = FUN_140174f00(param_1 + 0x6c0);
                    uVar9 = CONCAT44(uVar25,0x40);
                    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x192,uVar9,
                                  uVar23 & 0xffffffff00000000,
                                  CONCAT44(uVar26,*(int *)(lVar16 + 0x50a0) + iVar21),uVar24,iVar21,
                                  0);
                    uVar24 = (undefined4)((ulonglong)uVar9 >> 0x20);
                  }
                  else {
                    local_668[0] = (int)(((float)iVar7 * 0.25) / (float)iVar6);
                    local_674 = 1;
                    piVar14 = local_688 + 5;
                    if (0 < local_668[0]) {
                      piVar14 = local_668;
                    }
                    iVar6 = *piVar14;
                    lVar16 = FUN_140174f00(&local_6a8);
                    iVar7 = *(int *)(lVar16 + 0x50a0) / iVar6;
                    iVar6 = iVar7 * iVar6;
                    if (fVar2 != 0.0) {
                      iVar6 = (int)((float)iVar6 * fVar2);
                    }
                    if (iVar7 < 1) goto LAB_1401cff7c;
                    local_5d4[0] = local_5d4[0] + iVar7 * 100;
                    puVar11 = local_6b8;
                    if ((int)local_5d4[0] <= (int)uVar20) {
                      puVar11 = local_5d4;
                    }
                    local_5d4[0] = *puVar11;
                    FUN_14011f210(local_288);
                    local_280 = *(undefined4 *)(param_1 + 0x160);
                    local_27c = *(undefined4 *)(param_1 + 0x164);
                    local_278 = *(undefined4 *)(param_1 + 0x168);
                    local_274 = *(undefined4 *)(param_1 + 0x16c);
                    local_270 = *(undefined4 *)(param_1 + 0x170);
                    local_26c = *(undefined4 *)(param_1 + 0x174);
                    local_268 = *(undefined4 *)(param_1 + 0x178);
                    local_264 = *(undefined4 *)(param_1 + 0x17c);
                    pwVar12 = (wchar_t *)(*plVar15 + 0xd0);
                    if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                      pwVar12 = *(wchar_t **)pwVar12;
                    }
                    sVar10 = wcsnlen(pwVar12,0x10);
                    if (sVar10 < 0x10) {
                      pwVar12 = (wchar_t *)(*plVar15 + 0xd0);
                      if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                        pwVar12 = *(wchar_t **)pwVar12;
                      }
                      wcscpy_s(local_260,0x10,pwVar12);
                    }
                    strcpy_s(local_1f0,0x32,(char *)(param_1 + 0x330));
                    local_200 = 0x11;
                    lVar16 = FUN_140174f00(param_1 + 0x6c0);
                    local_1fc = *(undefined4 *)(lVar16 + 0x50a0);
                    local_1f8 = iVar6;
                    FUN_140197b90(param_1,-iVar6);
                    lVar16 = FUN_140174f00(param_1 + 0x6c0);
                    local_1f4 = *(undefined4 *)(lVar16 + 0x50a0);
                    FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                                  *(undefined4 *)(param_1 + 0x284),local_288);
                    uVar9 = CONCAT44(uVar25,iVar6);
                    uVar23 = CONCAT44(uVar24,(int)local_5dc);
                    plVar13 = &local_5f8;
                    FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a9,0x51,param_1,plVar13,uVar23
                                  ,uVar9,local_5d4[0],uVar20);
                    uVar25 = (undefined4)((ulonglong)plVar13 >> 0x20);
                    uVar26 = (undefined4)((ulonglong)uVar9 >> 0x20);
                    lVar16 = FUN_140174f00(param_1 + 0x6c0);
                    uVar24 = *(undefined4 *)(lVar16 + 0x50a0);
                    lVar16 = FUN_140174f00();
                    uVar9 = CONCAT44(uVar25,0x40);
                    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x192,uVar9,
                                  uVar23 & 0xffffffff00000000,
                                  CONCAT44(uVar26,*(int *)(lVar16 + 0x50a0) + iVar6),uVar24,iVar6,0)
                    ;
                    uVar24 = (undefined4)((ulonglong)uVar9 >> 0x20);
                    uVar20 = local_6c8;
                  }
                  iVar18 = local_6c4;
                  if (uVar20 == 0) {
                    if (local_6c4 == 0) {
                      local_res20[0] = 1;
                    }
                    else {
                      local_6bc = 1;
                    }
                  }
                  iVar6 = local_6bc;
                  iVar21 = local_res20[0];
                  uVar9 = FUN_140174f00(&local_6a8);
                  FUN_1401ed220(uVar9,&DAT_14047ba28,local_660 + iVar18,&local_5f8,
                                CONCAT44(uVar24,6));
                  local_640 = *(undefined4 *)(param_1 + 0x160);
                  local_63c = *(undefined4 *)(param_1 + 0x164);
                  local_638 = *(undefined4 *)(param_1 + 0x168);
                  local_634 = *(undefined4 *)(param_1 + 0x16c);
                  local_620 = *(undefined4 *)(param_1 + 0x170);
                  local_61c = *(undefined4 *)(param_1 + 0x174);
                  local_618 = *(undefined4 *)(param_1 + 0x178);
                  local_614 = *(undefined4 *)(param_1 + 0x17c);
                  iVar7 = *(int *)(param_1 + 0x284);
                  if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                     && (lVar16 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar16 != 0
                        )) {
                    local_res8[0] = (undefined2)iVar7;
                    plVar13 = (longlong *)
                              (*(longlong *)
                                (*(longlong *)(lVar16 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8
                                ) + 0x70);
                    (**(code **)(*plVar13 + 0x140))
                              (plVar13,1,&DAT_1405d85a0,local_res8,&local_620,&local_640,&local_5f8)
                    ;
                  }
                  piVar14 = local_6b0;
                  local_res10[0] = (undefined2)*local_6b0;
                  local_res18[0] = 0;
                  plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  in_stack_fffffffffffff918 = local_5d4;
                  in_stack_fffffffffffff910 = &local_5f8;
                  in_stack_fffffffffffff908 = (int *)local_res10;
                  (**(code **)(*plVar13 + 0xf0))
                            (plVar13,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18,
                             in_stack_fffffffffffff908,in_stack_fffffffffffff910,
                             in_stack_fffffffffffff918);
                }
              }
            }
            local_6c4 = iVar18 + 1;
            piVar14 = piVar14 + 1;
          } while (local_6c4 < 7);
          local_6b0 = piVar14;
          if ((iVar21 != 0) || (iVar6 != 0)) {
            FUN_14019c070(param_1,local_6c0);
          }
          local_6c0 = 0;
          do {
            uVar5 = local_6c0;
            uVar20 = 0;
            FUN_14000a170(&local_538);
            local_490 = 0;
            if (uVar5 < 0x18) {
              lVar16 = ((longlong)(int)uVar5 + 0x18) * 0xac + *plVar1;
              *(undefined2 *)(lVar16 + 0x14) = 1;
              *(short *)(lVar16 + 0x16) = (short)uVar5;
              FUN_140090020(&local_538);
              uVar17 = local_520;
              if ((local_538 != 0) || (uVar8 = uVar20, local_530 != 0)) {
                uVar8 = 1;
              }
              if ((uVar8 != 0) && (0 < (int)local_520)) {
                local_6c8 = 0;
                lVar16 = FUN_140137690();
                uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffff908 >> 0x20);
                if (*(longlong *)(lVar16 + 0x88) != 0) {
                  for (puVar11 = *(uint **)(*(longlong *)(lVar16 + 0x88) +
                                           ((ulonglong)uVar17 % (ulonglong)*(uint *)(lVar16 + 0x98))
                                           * 8); puVar11 != (uint *)0x0;
                      puVar11 = *(uint **)(puVar11 + 0xa6)) {
                    if ((puVar11[0xa8] == uVar17) && (*puVar11 == uVar17)) {
                      if (puVar11 != (uint *)0x0) goto LAB_1401cfa3c;
                      break;
                    }
                  }
                }
                puVar11 = (uint *)0x0;
LAB_1401cfa3c:
                uVar17 = uVar20;
                if ((puVar11 == (uint *)0x0) || (puVar11 == (uint *)0xfffffffffffffff8)) {
LAB_1401cfaa4:
                  iVar6 = (int)uVar17 / 100;
                  local_670 = (int)(((float)(iVar6 - (int)local_514[0] / 100) *
                                    (float)(int)uVar20 * 0.25) / (float)iVar6);
                  local_688[2] = 1;
                  piVar14 = local_688 + 2;
                  if (0 < local_670) {
                    piVar14 = local_688 + 6;
                  }
                  iVar7 = *piVar14;
                  if (fVar2 != 0.0) {
                    iVar7 = (int)((float)iVar7 * fVar2);
                  }
                  if (iVar7 < *(int *)(*plVar1 + 0x50a0)) {
                    local_514[0] = uVar17;
                    FUN_14011f210(local_388);
                    local_380 = *(undefined4 *)(param_1 + 0x160);
                    local_37c = *(undefined4 *)(param_1 + 0x164);
                    local_378 = *(undefined4 *)(param_1 + 0x168);
                    local_374 = *(undefined4 *)(param_1 + 0x16c);
                    local_370 = *(undefined4 *)(param_1 + 0x170);
                    local_36c = *(undefined4 *)(param_1 + 0x174);
                    local_368 = *(undefined4 *)(param_1 + 0x178);
                    local_364 = *(undefined4 *)(param_1 + 0x17c);
                    pwVar12 = (wchar_t *)(*plVar15 + 0xd0);
                    if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                      pwVar12 = *(wchar_t **)pwVar12;
                    }
                    sVar10 = wcsnlen(pwVar12,0x10);
                    if (sVar10 < 0x10) {
                      pwVar12 = (wchar_t *)(*plVar15 + 0xd0);
                      if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                        pwVar12 = *(wchar_t **)pwVar12;
                      }
                      wcscpy_s(local_360,0x10,pwVar12);
                    }
                    strcpy_s(local_2f0,0x32,(char *)(param_1 + 0x330));
                    local_300 = 0x11;
                    local_2fc = *(undefined4 *)(*plVar1 + 0x50a0);
                    local_2f8 = iVar7;
                    FUN_140197b90(param_1,-iVar7);
                    local_2f4 = *(undefined4 *)(*plVar1 + 0x50a0);
                    puVar19 = local_388;
                  }
                  else {
                    local_688[0] = (int)(((float)(int)uVar20 * 0.25) / (float)iVar6);
                    local_678 = 1;
                    piVar14 = local_688 + 4;
                    if (0 < local_688[0]) {
                      piVar14 = local_688;
                    }
                    iVar6 = *piVar14;
                    iVar7 = *(int *)(*plVar1 + 0x50a0) / iVar6;
                    iVar21 = iVar7 * iVar6;
                    if (fVar2 != 0.0) {
                      iVar21 = (int)((float)iVar21 * fVar2);
                    }
                    if (iVar7 < 1) break;
                    local_514[0] = local_514[0] + iVar7 * 100;
                    puVar11 = &local_6c8;
                    if ((int)local_514[0] <= (int)uVar17) {
                      puVar11 = local_514;
                    }
                    local_514[0] = *puVar11;
                    FUN_14011f210(local_188,
                                  (longlong)*(int *)(*plVar1 + 0x50a0) % (longlong)iVar6 &
                                  0xffffffff);
                    local_180 = *(undefined4 *)(param_1 + 0x160);
                    local_17c = *(undefined4 *)(param_1 + 0x164);
                    local_178 = *(undefined4 *)(param_1 + 0x168);
                    local_174 = *(undefined4 *)(param_1 + 0x16c);
                    local_170 = *(undefined4 *)(param_1 + 0x170);
                    local_16c = *(undefined4 *)(param_1 + 0x174);
                    local_168 = *(undefined4 *)(param_1 + 0x178);
                    local_164 = *(undefined4 *)(param_1 + 0x17c);
                    pwVar12 = (wchar_t *)(*plVar15 + 0xd0);
                    if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                      pwVar12 = *(wchar_t **)pwVar12;
                    }
                    sVar10 = wcsnlen(pwVar12,0x10);
                    if (sVar10 < 0x10) {
                      pwVar12 = (wchar_t *)(*plVar15 + 0xd0);
                      if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                        pwVar12 = *(wchar_t **)pwVar12;
                      }
                      wcscpy_s(local_160,0x10,pwVar12);
                    }
                    strcpy_s(local_f0,0x32,(char *)(param_1 + 0x330));
                    local_100 = 0x11;
                    lVar16 = FUN_140174f00(&local_6a8);
                    local_fc = *(undefined4 *)(lVar16 + 0x50a0);
                    local_f8 = iVar21;
                    FUN_140197b90(param_1,-iVar21);
                    lVar16 = FUN_140174f00(&local_6a8);
                    local_f4 = *(undefined4 *)(lVar16 + 0x50a0);
                    puVar19 = local_188;
                  }
                  FUN_1401fe560(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                                *(undefined4 *)(param_1 + 0x284),puVar19);
                  FUN_1401ed220(*plVar1,&DAT_14047ba2c,&local_6c0,&local_538,CONCAT44(uVar24,6));
                  local_630 = *(undefined4 *)(param_1 + 0x160);
                  local_62c = *(undefined4 *)(param_1 + 0x164);
                  local_628 = *(undefined4 *)(param_1 + 0x168);
                  local_624 = *(undefined4 *)(param_1 + 0x16c);
                  local_610 = *(undefined4 *)(param_1 + 0x170);
                  local_60c = *(undefined4 *)(param_1 + 0x174);
                  local_608 = *(undefined4 *)(param_1 + 0x178);
                  local_604 = *(undefined4 *)(param_1 + 0x17c);
                  iVar6 = *(int *)(param_1 + 0x284);
                  if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700)))
                     && (lVar16 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar16 != 0
                        )) {
                    local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)iVar6);
                    plVar13 = (longlong *)
                              (*(longlong *)
                                (*(longlong *)(lVar16 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8
                                ) + 0x70);
                    (**(code **)(*plVar13 + 0x140))
                              (plVar13,1,&DAT_1405d85a0,local_res20,&local_610,&local_630,&local_538
                              );
                  }
                  local_6c4 = CONCAT22(local_6c4._2_2_,(short)uVar5);
                  local_6bc = CONCAT22(local_6bc._2_2_,1);
                  plVar13 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  in_stack_fffffffffffff908 = &local_6c4;
                  (**(code **)(*plVar13 + 0xf0))
                            (plVar13,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_6bc,
                             in_stack_fffffffffffff908,&local_538,local_514);
                }
                else if ((puVar11[0x36] == 1) || (puVar11[0x36] == 2)) {
                  iVar6 = local_498;
                  if (local_498 < 1) {
                    iVar6 = puVar11[0x52] + local_498;
                  }
                  uVar17 = iVar6 + local_494;
                  local_6c8 = uVar17;
                  if (local_514[0] != uVar17) {
                    uVar20 = puVar11[0x5d];
                    goto LAB_1401cfaa4;
                  }
                }
              }
            }
            local_6c0 = uVar5 + 1;
          } while ((int)local_6c0 < 0x18);
LAB_1401cff7c:
          local_688[1] = 1;
          local_6b0 = (int *)CONCAT44(local_6b0._4_4_,0x2afb);
          plVar15 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar15 + 0x70))
                    (plVar15,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_6b0,local_688 + 1);
          LOCK();
          plVar1 = plVar1 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar3 = (void *)*local_6a8;
            if (pvVar3 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar3 + 0xf630);
              operator_delete(pvVar3);
            }
            operator_delete(local_6a8);
          }
          LOCK();
          plVar15 = local_698 + 1;
          *(int *)plVar15 = (int)*plVar15 + -1;
          iVar6 = (int)*plVar15;
          UNLOCK();
          goto LAB_1401d0085;
        }
      }
      else {
        iVar6 = DAT_140608048 + 1;
        bVar22 = DAT_140608048 == 0;
        DAT_140608048 = iVar6;
        if (bVar22) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_6a0) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar16 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        plVar15 = local_698;
        if ((int)lVar16 == 1) {
          pvVar3 = (void *)*local_6a8;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_6a8);
          plVar15 = local_698;
        }
      }
      else {
        iVar6 = DAT_140608050 + 1;
        bVar22 = DAT_140608050 == 0;
        DAT_140608050 = iVar6;
        if (bVar22) {
          FUN_140176d60(1);
        }
      }
    }
  }
  LOCK();
  plVar15 = plVar15 + 1;
  *(int *)plVar15 = (int)*plVar15 + -1;
  iVar6 = (int)*plVar15;
  UNLOCK();
LAB_1401d0085:
  if (iVar6 == 0) {
    puVar4 = (undefined8 *)*local_698;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_698);
  }
  return 1;
}



undefined8
FUN_1401d00e0(longlong param_1,longlong *param_2,short *param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  longlong lVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined8 uVar4;
  undefined *puVar5;
  bool bVar6;
  
  if (*(longlong *)(param_1 + 0xb58) == 0) {
    return 1;
  }
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0xb58) + 0x30);
  puVar2 = *(undefined8 **)(lVar1 + 0x290);
  puVar5 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar5 = PTR_DAT_1405d8008;
  }
  if (puVar2 != (undefined8 *)0x0) {
    if (puVar2 == *(undefined8 **)(lVar1 + 0x298)) {
      uVar4 = *puVar2;
      goto LAB_1401d0145;
    }
    iVar3 = DAT_1406080b0 + 1;
    bVar6 = DAT_1406080b0 == 0;
    DAT_1406080b0 = iVar3;
    if (bVar6) {
      FUN_140176d60(1);
    }
  }
  uVar4 = 0;
LAB_1401d0145:
  FUN_140253930(uVar4,puVar5,(int)*param_3,*param_4,*param_5);
  return 1;
}



undefined8
FUN_1401d0180(longlong param_1,undefined4 *param_2,short *param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  longlong lVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined8 uVar4;
  bool bVar5;
  
  if (*(longlong *)(param_1 + 0xb58) == 0) {
    return 1;
  }
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0xb58) + 0x30);
  puVar2 = *(undefined8 **)(lVar1 + 0x290);
  if (puVar2 != (undefined8 *)0x0) {
    if (puVar2 == *(undefined8 **)(lVar1 + 0x298)) {
      uVar4 = *puVar2;
      goto LAB_1401d01da;
    }
    iVar3 = DAT_1406080b0 + 1;
    bVar5 = DAT_1406080b0 == 0;
    DAT_1406080b0 = iVar3;
    if (bVar5) {
      FUN_140176d60(1);
    }
  }
  uVar4 = 0;
LAB_1401d01da:
  FUN_140253b30(uVar4,*param_2,(int)*param_3,*param_4,*param_5);
  return 1;
}



// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401d0210(longlong param_1,undefined8 param_2,longlong *param_3,longlong *param_4,
             undefined1 *param_5)

{
  longlong *plVar1;
  longlong lVar2;
  void *pvVar3;
  bool bVar4;
  char cVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  bool bVar9;
  undefined4 local_68;
  undefined4 local_64;
  uint local_60 [4];
  longlong *local_50;
  longlong *local_48;
  undefined1 local_40 [4];
  undefined1 local_3c [4];
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  plVar7 = param_3;
  FUN_140197b70(param_1,&local_50);
  plVar1 = local_50;
  if (local_50 != (longlong *)0x0) {
    if (local_50 == local_48) {
      if (*local_50 != 0) {
        local_64 = 0xffffffff;
        local_60[1] = 0xffffffff;
        bVar9 = false;
        if ((*plVar7 == 0) && (plVar7[1] == 0)) {
          bVar4 = false;
        }
        else {
          bVar4 = true;
        }
        if ((!bVar4) ||
           (cVar5 = FUN_1401f2760(*local_50,param_3,local_40,local_60 + 1), cVar5 != '\0')) {
          if ((*param_4 != 0) || (param_4[1] != 0)) {
            bVar9 = true;
          }
          if ((!bVar9) || (cVar5 = FUN_1401f2760(*plVar1,param_4,local_3c,&local_64), cVar5 != '\0')
             ) {
            FUN_1401f2760(*plVar1,param_2,local_60 + 2,local_60);
            local_68 = 0xffffffff;
            FUN_1401a7d30(param_1,local_60 + 2,local_60,param_3,local_60 + 1,param_4,&local_64,
                          &local_68,*param_5);
            lVar2 = *plVar1;
            if ((local_60[2] < 5) && (local_60[0] < 0x18)) {
              lVar8 = ((longlong)(int)local_60[0] + (longlong)(int)local_60[2] * 0x18) * 0xac;
              *(short *)(lVar8 + 0x14 + lVar2) = (short)local_60[2];
              *(short *)(lVar8 + 0x16 + lVar2) = (short)local_60[0];
            }
            plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar7 + 0x550))
                      (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_68);
          }
        }
        goto LAB_1401d03f4;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar9 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_48) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d03f4:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar3 = (void *)*local_50;
    if (pvVar3 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar3 + 0xf630);
      operator_delete(pvVar3);
    }
    operator_delete(local_50);
  }
  return 1;
}



// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401d0450(longlong param_1,undefined4 *param_2,undefined8 *param_3,int *param_4,
             undefined4 *param_5)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  int *piVar4;
  undefined4 *puVar5;
  undefined1 local_res18 [16];
  int local_48;
  int local_44 [3];
  undefined4 local_38 [12];
  
  puVar5 = (undefined4 *)*param_3;
  if ((ulonglong)(param_3[1] - (longlong)puVar5 >> 2) < 10) {
    lVar2 = *(longlong *)(param_1 + 0xb50);
    local_res18[0] = 0;
    piVar4 = (int *)&DAT_14047ba64;
  }
  else {
    local_48 = 0;
    local_44[1] = 0;
    lVar2 = 0;
    do {
      uVar1 = *puVar5;
      lVar3 = lVar2 + 4;
      puVar5 = puVar5 + 2;
      *(undefined4 *)((longlong)local_38 + lVar2) = uVar1;
      lVar2 = lVar3;
    } while (lVar3 < 0x14);
    local_44[0] = 0;
    if (*param_4 == 0) {
      local_44[0] = FUN_140270210(param_1,*param_2,local_38,*param_5,&local_48,local_44 + 1);
    }
    else {
      if (*param_4 != 1) {
        return 1;
      }
      local_44[0] = FUN_1402709e0(param_1,*param_2,local_38,*param_5,&local_48,local_44 + 1);
    }
    if (((local_44[0] != 0x53) ||
        ((**(code **)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78) + 0x990))
                   (*(longlong *)(param_1 + 0xb50) + 0x78,*(undefined4 *)(param_1 + 8),
                    &DAT_1405d85a0,local_44 + 1,&local_48), local_44[0] != 0x53)) ||
       (local_res18[0] = 1, local_48 < 1)) {
      local_res18[0] = 0;
    }
    lVar2 = *(longlong *)(param_1 + 0xb50);
    piVar4 = local_44;
  }
  (**(code **)(*(longlong *)(lVar2 + 0x78) + 0x560))
            (lVar2 + 0x78,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,piVar4,local_res18);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401d089c)

undefined8 FUN_1401d05b0(longlong param_1,undefined8 param_2,uint *param_3,short *param_4)

{
  short sVar1;
  void *pvVar2;
  longlong *plVar3;
  char cVar4;
  int iVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  undefined8 uVar9;
  longlong *plVar10;
  undefined8 *puVar11;
  longlong lVar12;
  longlong lVar13;
  uint *puVar14;
  longlong *plVar15;
  bool bVar16;
  float fVar17;
  undefined8 in_stack_fffffffffffffd88;
  undefined4 uVar18;
  ulonglong in_stack_fffffffffffffd90;
  uint uVar20;
  undefined4 *puVar19;
  undefined1 *in_stack_fffffffffffffd98;
  undefined4 uVar21;
  undefined8 in_stack_fffffffffffffda0;
  undefined4 uVar23;
  undefined4 *puVar22;
  undefined4 *in_stack_fffffffffffffda8;
  uint uVar24;
  uint local_248 [2];
  longlong *local_240;
  longlong *local_238;
  uint local_230;
  undefined2 local_22c [2];
  undefined8 *local_228;
  undefined8 *local_220;
  undefined8 *local_218;
  undefined4 local_208 [2];
  undefined4 local_200 [2];
  undefined4 local_1f8 [2];
  void *local_1f0;
  longlong *local_1e8;
  longlong *local_1e0;
  undefined4 local_1d8;
  undefined4 local_1d4;
  undefined4 local_1d0;
  undefined4 local_1cc;
  undefined4 local_1c8;
  undefined4 local_1c4;
  undefined4 local_1c0;
  undefined4 local_1bc;
  undefined8 local_1b8;
  undefined1 local_1a8 [24];
  uint local_190;
  short local_18c;
  short local_12c;
  undefined4 local_100;
  undefined8 local_f8;
  undefined8 uStack_f0;
  undefined4 local_e0;
  undefined2 local_dc;
  undefined4 local_90;
  short local_7c;
  undefined4 local_50;
  undefined1 local_48 [32];
  
  local_1b8 = 0xfffffffffffffffe;
  puVar14 = param_3;
  FUN_140197b70();
  plVar15 = local_240;
  if (local_240 != (longlong *)0x0) {
    if (local_240 == local_238) {
      if (*local_240 != 0) {
        uVar6 = *puVar14;
        lVar8 = FUN_140137690();
        lVar12 = 0;
        if (*(longlong *)(lVar8 + 0x88) != 0) {
          for (puVar14 = *(uint **)(*(longlong *)(lVar8 + 0x88) +
                                   ((ulonglong)uVar6 % (ulonglong)*(uint *)(lVar8 + 0x98)) * 8);
              puVar14 != (uint *)0x0; puVar14 = *(uint **)(puVar14 + 0xa6)) {
            if ((puVar14[0xa8] == uVar6) && (*puVar14 == uVar6)) {
              if (puVar14 == (uint *)0x0) break;
              if (puVar14 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              if ((puVar14 == (uint *)0xfffffffffffffff8) || (puVar14[0x37] != 1)) break;
              FUN_14000a170(local_1a8);
              local_100 = 0;
              FUN_14000a170(&local_f8);
              local_50 = 0;
              local_248[0] = 0;
              sVar1 = *param_4;
              if (sVar1 == 5) {
                uVar9 = FUN_140174f00(&local_240);
                cVar4 = FUN_1401f2840(uVar9,param_2,local_248);
                if (cVar4 == '\0') break;
                uVar9 = FUN_140174f00(&local_240);
                iVar5 = FUN_1401ecc20(uVar9,local_248,local_1a8);
                if (iVar5 == 0) break;
              }
              else {
                if ((((sVar1 != 1) && (sVar1 != 2)) && (sVar1 != 3)) && (sVar1 != 4)) break;
                uVar9 = FUN_140174f00(&local_240);
                cVar4 = FUN_1401f2760(uVar9,param_2,&local_230,local_248);
                if (cVar4 == '\0') break;
                lVar8 = FUN_140174f00(&local_240);
                if ((4 < local_230) || (0x17 < local_248[0])) break;
                lVar8 = ((longlong)(int)local_248[0] + (longlong)(int)local_230 * 0x18) * 0xac +
                        lVar8;
                *(short *)(lVar8 + 0x14) = (short)local_230;
                *(short *)(lVar8 + 0x16) = (short)local_248[0];
                FUN_140090020(local_1a8);
              }
              if (local_190 == *param_3) {
                local_228 = (undefined8 *)0x0;
                local_220 = (undefined8 *)0x0;
                local_218 = (undefined8 *)0x0;
                iVar5 = FUN_140266ab0(*param_3,puVar14[0x38],&local_228);
                if (iVar5 != 0) {
                  if (local_12c == 0) goto LAB_1401d0a41;
                  uVar9 = FUN_140137690();
                  uVar6 = FUN_140136a20(uVar9);
                  plVar10 = (longlong *)FUN_1401420a0();
                  if (*plVar10 == 0) goto LAB_1401d08b4;
                  puVar14 = *(uint **)(*plVar10 +
                                      ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
                  goto LAB_1401d0879;
                }
                if (local_228 != (undefined8 *)0x0) {
                  operator_delete(local_228);
                }
                local_228 = (undefined8 *)0x0;
                local_220 = (undefined8 *)0x0;
                local_218 = (undefined8 *)0x0;
              }
              break;
            }
          }
        }
        goto LAB_1401d0e62;
      }
    }
    else {
      iVar5 = DAT_140608048 + 1;
      bVar16 = DAT_140608048 == 0;
      DAT_140608048 = iVar5;
      if (bVar16) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar15 == (longlong *)0x0) {
    return 1;
  }
  if (plVar15 != local_238) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
  goto LAB_1401d0e62;
LAB_1401d0879:
  if (puVar14 == (uint *)0x0) goto LAB_1401d08b4;
  if ((puVar14[8] == uVar6) && (*puVar14 == uVar6)) {
    if ((puVar14 != (uint *)0x0) && (puVar14 != (uint *)0xfffffffffffffffc)) {
      fVar17 = (float)puVar14[2];
      goto LAB_1401d08bc;
    }
    goto LAB_1401d08b4;
  }
  puVar14 = *(uint **)(puVar14 + 6);
  goto LAB_1401d0879;
LAB_1401d08b4:
  fVar17 = -1.0;
LAB_1401d08bc:
  iVar5 = rand();
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffd88 >> 0x20);
  uVar20 = (uint)(in_stack_fffffffffffffd90 >> 0x20);
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffd98 >> 0x20);
  uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
  uVar24 = (uint)((ulonglong)in_stack_fffffffffffffda8 >> 0x20);
  if ((float)iVar5 * 3.0517578e-05 < fVar17) {
    puVar11 = (undefined8 *)FUN_140357570(local_48);
    local_f8 = *puVar11;
    uStack_f0 = puVar11[1];
    uVar9 = FUN_1401420a0();
    local_e0 = FUN_140142060(uVar9,uVar6);
    local_dc = 1;
    local_7c = local_12c;
    uVar9 = FUN_140137690();
    local_90 = FUN_140136ad0(uVar9,0xc72f);
    if ((&local_f8 < local_220) && (local_228 <= &local_f8)) {
      lVar8 = ((longlong)&local_f8 - (longlong)local_228) / 0x56 +
              ((longlong)&local_f8 - (longlong)local_228 >> 0x3f);
      if (local_220 == local_218) {
        FUN_14008f210(&local_228,1);
      }
      puVar11 = (undefined8 *)(((lVar8 >> 1) - (lVar8 >> 0x3f)) * 0xac + (longlong)local_228);
      if (local_220 != (undefined8 *)0x0) {
LAB_1401d09c7:
        memcpy(local_220,puVar11,0xac);
      }
    }
    else {
      if (local_220 == local_218) {
        FUN_14008f210(&local_228,1);
      }
      if (local_220 != (undefined8 *)0x0) {
        puVar11 = &local_f8;
        goto LAB_1401d09c7;
      }
    }
    local_220 = (undefined8 *)((longlong)local_220 + 0xac);
    lVar8 = FUN_140174f00(&local_240);
    uVar7 = *(undefined4 *)(lVar8 + 0x50a0);
    lVar8 = FUN_140174f00(&local_240);
    in_stack_fffffffffffffda8 = (undefined4 *)((ulonglong)uVar24 << 0x20);
    in_stack_fffffffffffffda0 = CONCAT44(uVar23,uVar7);
    in_stack_fffffffffffffd98 = (undefined1 *)CONCAT44(uVar21,*(undefined4 *)(lVar8 + 0x50a0));
    in_stack_fffffffffffffd90 = (ulonglong)uVar20 << 0x20;
    in_stack_fffffffffffffd88 = CONCAT44(uVar18,0x29);
    FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_f8,0x191,in_stack_fffffffffffffd88
                  ,in_stack_fffffffffffffd90,in_stack_fffffffffffffd98,in_stack_fffffffffffffda0,
                  in_stack_fffffffffffffda8,0);
  }
LAB_1401d0a41:
  uVar18 = (undefined4)(in_stack_fffffffffffffd90 >> 0x20);
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
  lVar8 = ((longlong)local_220 - (longlong)local_228) / 0x56 +
          ((longlong)local_220 - (longlong)local_228 >> 0x3f);
  iVar5 = (int)(lVar8 >> 1) - (int)(lVar8 >> 0x3f);
  if (0 < iVar5) {
    local_1e8 = (longlong *)0x0;
    local_1f0 = operator_new(0x850);
    if (local_1f0 != (void *)0x0) {
      lVar12 = FUN_1401e64f0(local_1f0);
    }
    if (lVar12 == 0) {
      local_1e8 = (longlong *)0x0;
    }
    else {
      local_1e8 = operator_new(0x10);
      *local_1e8 = lVar12;
      *(undefined4 *)(local_1e8 + 1) = 1;
    }
    plVar10 = local_1e8;
    local_1e0 = local_1e8;
    if (*(longlong **)(param_1 + 0x6d0) != local_1e8) {
      FUN_1401dede0(param_1 + 0x6d0);
      *(longlong **)(param_1 + 0x6d0) = plVar10;
      *(longlong **)(param_1 + 0x6d8) = plVar10;
      if (plVar10 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar10 + 1) = (int)plVar10[1] + 1;
        UNLOCK();
        plVar15 = local_240;
        plVar10 = local_1e8;
      }
    }
    uVar18 = (undefined4)(in_stack_fffffffffffffd90 >> 0x20);
    uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
    local_1f0 = (void *)(longlong)iVar5;
    if (0 < iVar5) {
      lVar8 = 0;
      do {
        uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffd98 >> 0x20);
        uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
        uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffd88 >> 0x20);
        lVar12 = lVar8 + (longlong)local_228;
        uVar9 = FUN_140137690();
        iVar5 = FUN_140136b30(uVar9,*(undefined4 *)(lVar12 + 0x18));
        if (iVar5 == 1) {
          uVar9 = FUN_140137690();
          uVar7 = FUN_140136bb0(uVar9,*(undefined4 *)(lVar12 + 0x18));
          *(undefined4 *)(lVar12 + 0x24) = uVar7;
        }
        if (plVar10 == (longlong *)0x0) {
          lVar13 = 0;
        }
        else {
          lVar13 = *plVar10;
        }
        uVar9 = CONCAT44(uVar18,0x1f);
        FUN_1401e6560(lVar13,lVar12,param_1,0x1a3,uVar9);
        uVar7 = (undefined4)((ulonglong)uVar9 >> 0x20);
        lVar13 = FUN_140174f00(&local_240);
        uVar18 = *(undefined4 *)(lVar13 + 0x50a0);
        lVar13 = FUN_140174f00(&local_240);
        in_stack_fffffffffffffda8 =
             (undefined4 *)((ulonglong)in_stack_fffffffffffffda8 & 0xffffffff00000000);
        in_stack_fffffffffffffda0 = CONCAT44(uVar23,uVar18);
        in_stack_fffffffffffffd98 = (undefined1 *)CONCAT44(uVar21,*(undefined4 *)(lVar13 + 0x50a0));
        in_stack_fffffffffffffd90 = in_stack_fffffffffffffd90 & 0xffffffff00000000;
        in_stack_fffffffffffffd88 = CONCAT44(uVar7,0x29);
        FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,lVar12,0x191,
                      in_stack_fffffffffffffd88,in_stack_fffffffffffffd90,in_stack_fffffffffffffd98,
                      in_stack_fffffffffffffda0,in_stack_fffffffffffffda8,0);
        uVar18 = (undefined4)(in_stack_fffffffffffffd90 >> 0x20);
        uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
        lVar8 = lVar8 + 0xac;
        local_1f0 = (void *)((longlong)local_1f0 + -1);
      } while (local_1f0 != (void *)0x0);
      local_1f0 = (void *)0x0;
    }
    lVar8 = 0;
    if (plVar10 != (longlong *)0x0) {
      lVar8 = *plVar10;
    }
    FUN_1401e6700(lVar8,3,param_1);
    plVar3 = local_1e8;
    if (plVar10 != (longlong *)0x0) {
      LOCK();
      plVar10 = plVar10 + 1;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      plVar15 = local_240;
      if ((int)*plVar10 == 0) {
        pvVar2 = (void *)*local_1e8;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0x818);
          operator_delete(pvVar2);
        }
        operator_delete(plVar3);
        plVar15 = local_240;
      }
    }
  }
  plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  (**(code **)(*plVar10 + 0x5c0))(plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_228);
  uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffd98 >> 0x20);
  sVar1 = *param_4;
  if (sVar1 == 5) {
    uVar9 = FUN_140174f00(&local_240);
    iVar5 = FUN_1401e95b0(uVar9,param_1,local_248,local_1a8);
    if (iVar5 != 0) {
      local_1d8 = *(undefined4 *)(param_1 + 0x160);
      local_1d4 = *(undefined4 *)(param_1 + 0x164);
      local_1d0 = *(undefined4 *)(param_1 + 0x168);
      local_1cc = *(undefined4 *)(param_1 + 0x16c);
      local_1c8 = *(undefined4 *)(param_1 + 0x170);
      local_1c4 = *(undefined4 *)(param_1 + 0x174);
      local_1c0 = *(undefined4 *)(param_1 + 0x178);
      local_1bc = *(undefined4 *)(param_1 + 0x17c);
      iVar5 = *(int *)(param_1 + 0x284);
      local_200[0] = 0xffffffff;
      local_1f8[0] = 0xffffffe1;
      if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
         (lVar8 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar8 != 0)) {
        local_22c[0] = (undefined2)iVar5;
        plVar10 = (longlong *)
                  (*(longlong *)(*(longlong *)(lVar8 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                  + 0x70);
        in_stack_fffffffffffffda8 = local_200;
        puVar22 = local_1f8;
        in_stack_fffffffffffffd98 = local_1a8;
        puVar19 = &local_1d8;
        (**(code **)(*plVar10 + 0x130))
                  (plVar10,1,&DAT_1405d85a0,local_22c,&local_1c8,puVar19,in_stack_fffffffffffffd98,
                   puVar22,in_stack_fffffffffffffda8);
        uVar18 = (undefined4)((ulonglong)puVar19 >> 0x20);
        uVar21 = (undefined4)((ulonglong)puVar22 >> 0x20);
      }
      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a4,0x21,param_1,local_1a8,CONCAT44(uVar18,1)
                    ,(ulonglong)in_stack_fffffffffffffd98 & 0xffffffff00000000,
                    CONCAT44(uVar21,(int)local_18c),
                    (ulonglong)in_stack_fffffffffffffda8 & 0xffffffff00000000);
    }
  }
  else if ((((sVar1 == 1) || (sVar1 == 2)) || (sVar1 == 3)) || (sVar1 == 4)) {
    local_208[0] = 1;
    uVar9 = FUN_140174f00(&local_240);
    if (-1 < (int)local_230) {
      FUN_1401f1280(uVar9,param_1,&local_230,local_248,&local_190,local_208,CONCAT44(uVar23,0x1a4),
                    CONCAT44(uVar21,0x21));
    }
  }
  if (local_228 != (undefined8 *)0x0) {
    operator_delete(local_228);
  }
  local_228 = (undefined8 *)0x0;
  local_220 = (undefined8 *)0x0;
  local_218 = (undefined8 *)0x0;
LAB_1401d0e62:
  LOCK();
  plVar15 = plVar15 + 1;
  *(int *)plVar15 = (int)*plVar15 + -1;
  UNLOCK();
  if ((int)*plVar15 == 0) {
    pvVar2 = (void *)*local_240;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_240);
  }
  return 1;
}



undefined8 FUN_1401d0ec0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  void *pvVar9;
  undefined4 uVar10;
  undefined8 uVar11;
  bool bVar12;
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  longlong *local_70;
  longlong *local_68;
  longlong local_60;
  undefined1 local_58;
  void *local_50;
  void *local_48;
  undefined8 local_40;
  
  uVar10 = 0xc9;
  if (DAT_140608080 == 0) goto LAB_1401d11da;
  FUN_1401e6310(DAT_140608080,&local_70,param_2);
  if (local_70 == (longlong *)0x0) {
LAB_1401d1198:
    if (local_70 == (longlong *)0x0) goto LAB_1401d11da;
    uVar4 = 0xc9;
    if (local_70 != local_68) {
LAB_1401d108a:
      uVar10 = uVar4;
      iVar5 = DAT_14060808c + 1;
      bVar12 = DAT_14060808c == 0;
      DAT_14060808c = iVar5;
      if (bVar12) {
        FUN_140176d60(1);
      }
      goto LAB_1401d11da;
    }
    if (local_70 == (longlong *)0x0) goto LAB_1401d11da;
    LOCK();
    plVar7 = local_70 + 1;
    *(int *)plVar7 = (int)*plVar7 + -1;
    iVar5 = (int)*plVar7;
    UNLOCK();
    plVar7 = local_70;
  }
  else {
    if (local_70 != local_68) {
      iVar5 = DAT_140608088 + 1;
      bVar12 = DAT_140608088 == 0;
      DAT_140608088 = iVar5;
      if (bVar12) {
        FUN_140176d60(1);
      }
      goto LAB_1401d1198;
    }
    if (*local_70 == 0) goto LAB_1401d1198;
    local_50 = (void *)0x0;
    local_48 = (void *)0x0;
    local_40 = 0;
    lVar3 = *local_70;
    lVar1 = lVar3 + 0x68;
    local_60 = lVar1;
    FUN_14034ed40(lVar1);
    local_58 = 1;
    if (*(longlong *)(lVar3 + 0x48) == *(longlong *)(lVar3 + 0x50)) {
      FUN_14034edd0(lVar1);
      uVar10 = 0x167;
      if (local_50 != (void *)0x0) {
        operator_delete(local_50);
      }
    }
    else {
      if (local_50 != local_48) {
        local_48 = local_50;
      }
      lVar8 = *(longlong *)(lVar3 + 0x48);
      if (*(longlong *)(lVar3 + 0x50) != lVar8) {
        do {
          FUN_140054e10(&local_50,lVar8);
          lVar8 = lVar8 + 9;
        } while (*(longlong *)(lVar3 + 0x50) != lVar8);
      }
      FUN_14034edd0(lVar1);
      iVar5 = DAT_140607cb8;
      if (((local_70 != (longlong *)0x0) && (local_70 != local_68)) &&
         (iVar6 = DAT_140608088 + 1, bVar12 = DAT_140608088 == 0, DAT_140608088 = iVar6, bVar12)) {
        FUN_140176d60(1);
      }
      if (iVar5 == 1) {
        uVar11 = 2;
LAB_1401d10b6:
        pvVar9 = local_50;
        if (local_48 != local_50) {
          do {
            FUN_1401b4840(param_1,uVar11,pvVar9);
            pvVar9 = (void *)((longlong)pvVar9 + 9);
          } while (local_48 != pvVar9);
        }
        plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        (**(code **)(*plVar7 + 0xdd0))
                  (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2,&local_50);
        if (local_50 != (void *)0x0) {
          operator_delete(local_50);
        }
        plVar7 = local_70;
        local_50 = (void *)0x0;
        local_48 = (void *)0x0;
        local_40 = 0;
        if (local_70 == (longlong *)0x0) {
          return 1;
        }
        if (local_70 != local_68) {
          if (DAT_14060808c == 0) {
            DAT_14060808c = DAT_14060808c + 1;
            FUN_140176d60(1);
            return 1;
          }
          DAT_14060808c = DAT_14060808c + 1;
          return 1;
        }
        if (local_70 != (longlong *)0x0) {
          LOCK();
          plVar2 = local_70 + 1;
          lVar1 = *plVar2;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)lVar1 == 1) {
            local_70 = (longlong *)0x0;
            pvVar9 = (void *)*plVar7;
            if (pvVar9 != (void *)0x0) {
              FUN_1402160c0(pvVar9);
              operator_delete(pvVar9);
            }
            operator_delete(plVar7);
            return 1;
          }
          return 1;
        }
        return 1;
      }
      if (iVar5 == 2) {
        uVar11 = 4;
        goto LAB_1401d10b6;
      }
      if (iVar5 == 3) {
        uVar11 = 8;
        goto LAB_1401d10b6;
      }
      uVar10 = 0xed;
      if (local_50 != (void *)0x0) {
        operator_delete(local_50);
      }
    }
    local_40 = 0;
    local_48 = (void *)0x0;
    local_50 = (void *)0x0;
    if (local_70 == (longlong *)0x0) goto LAB_1401d11da;
    uVar4 = uVar10;
    if (local_70 != local_68) goto LAB_1401d108a;
    if (local_70 == (longlong *)0x0) goto LAB_1401d11da;
    LOCK();
    plVar7 = local_70 + 1;
    *(int *)plVar7 = (int)*plVar7 + -1;
    iVar5 = (int)*plVar7;
    UNLOCK();
    plVar7 = local_70;
  }
  local_70 = plVar7;
  if (iVar5 == 0) {
    local_70 = (longlong *)0x0;
    pvVar9 = (void *)*plVar7;
    if (pvVar9 != (void *)0x0) {
      FUN_1402160c0(pvVar9);
      operator_delete(pvVar9);
    }
    operator_delete(plVar7);
  }
LAB_1401d11da:
  local_res20[0] = 0x2b78;
  plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  local_res18[0] = uVar10;
  (**(code **)(*plVar7 + 0x70))
            (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,local_res18);
  return 1;
}



void FUN_1401d1230(longlong param_1,uint param_2)

{
  uint *puVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong *plVar4;
  uint *puVar5;
  uint uVar6;
  undefined8 uVar7;
  longlong lVar8;
  bool bVar9;
  
  plVar4 = *(longlong **)(param_1 + 0x6e0);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0x6e8)) {
      lVar8 = *plVar4;
      if (lVar8 != 0) {
        if (plVar4 != *(longlong **)(param_1 + 0x6e8)) {
          iVar3 = DAT_14060804c + 1;
          bVar9 = DAT_14060804c == 0;
          DAT_14060804c = iVar3;
          if (bVar9) {
            FUN_140176d60(1);
          }
          lVar8 = 0;
        }
        FUN_140237f20(lVar8);
        plVar4 = (longlong *)FUN_140317510();
        if ((*plVar4 != 0) &&
           (puVar5 = *(uint **)(*plVar4 +
                               ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar4 + 2)) * 8),
           puVar5 != (uint *)0x0)) {
          while ((puVar5[0x2c] != param_2 || (*puVar5 != param_2))) {
            puVar5 = *(uint **)(puVar5 + 0x2a);
            if (puVar5 == (uint *)0x0) {
              return;
            }
          }
          if ((puVar5 != (uint *)0x0) && (puVar5 != (uint *)0xfffffffffffffff8)) {
            lVar8 = 0;
            puVar5 = puVar5 + 3;
            do {
              uVar6 = *puVar5;
              if (0 < (int)uVar6) {
                plVar4 = (longlong *)FUN_1403161f0();
                if (*plVar4 != 0) {
                  for (puVar1 = *(uint **)(*plVar4 +
                                          ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar4 + 2)) * 8)
                      ; puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
                    if ((puVar1[0xea] == uVar6) && (*puVar1 == uVar6)) {
                      if (puVar1 != (uint *)0x0) {
                        uVar6 = puVar1[3];
                        goto LAB_1401d137e;
                      }
                      break;
                    }
                  }
                }
                uVar6 = 0;
LAB_1401d137e:
                plVar4 = (longlong *)FUN_140267710(uVar6);
                if (plVar4 != (longlong *)0x0) {
                  (**(code **)(*plVar4 + 8))(plVar4,*puVar5);
                  puVar2 = *(undefined8 **)(param_1 + 0x6e0);
                  if (puVar2 == (undefined8 *)0x0) {
LAB_1401d13c7:
                    uVar7 = 0;
                  }
                  else {
                    if (puVar2 != *(undefined8 **)(param_1 + 0x6e8)) {
                      iVar3 = DAT_14060804c + 1;
                      bVar9 = DAT_14060804c == 0;
                      DAT_14060804c = iVar3;
                      if (bVar9) {
                        FUN_140176d60(1);
                      }
                      goto LAB_1401d13c7;
                    }
                    uVar7 = *puVar2;
                  }
                  FUN_140235e60(uVar7,param_1,plVar4);
                  (**(code **)(*plVar4 + 0x10))(plVar4,0,0);
                }
              }
              lVar8 = lVar8 + 1;
              puVar5 = puVar5 + 1;
            } while (lVar8 < 6);
          }
        }
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar9) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401d1430(longlong param_1,int param_2)

{
  void *pvVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  int *piVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  bool bVar9;
  int local_res8 [2];
  undefined2 local_res10 [4];
  int local_res18 [2];
  int local_res20 [2];
  undefined8 in_stack_ffffffffffffff20;
  uint uVar10;
  longlong *local_d8;
  longlong *local_d0;
  longlong local_c8;
  char local_c0;
  longlong *local_b8;
  longlong *local_b0;
  int local_a8 [2];
  void *local_a0;
  int local_98 [2];
  undefined4 local_90 [2];
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  longlong *local_58;
  longlong *local_50;
  undefined8 local_48;
  
  uVar10 = (uint)((ulonglong)in_stack_ffffffffffffff20 >> 0x20);
  local_48 = 0xfffffffffffffffe;
  local_c8 = 0;
  local_c0 = '\0';
  plVar7 = *(longlong **)(param_1 + 0xb28);
  if (plVar7 != (longlong *)0x0) {
    if (plVar7 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar7 != 0) {
        lVar4 = *plVar7;
        if ((plVar7 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar4 = 0, DAT_1406080a8 = iVar3,
           bVar9)) {
          FUN_140176d60(1);
        }
        local_c0 = 0;
        local_c8 = lVar4;
        FUN_14034ed40();
        local_c0 = '\x01';
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_2 == 0x11) {
    FUN_140198570(param_1,&local_d8);
    plVar7 = local_d8;
    if (local_d8 != (longlong *)0x0) {
      if (local_d8 == local_d0) {
        if (*local_d8 != 0) {
          plVar8 = *(longlong **)(param_1 + 0x9a0);
          local_b8 = plVar8;
          local_b0 = plVar8;
          if (plVar8 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar8 + 1) = (int)plVar8[1] + 1;
            UNLOCK();
            if (*plVar8 != 0) {
              lVar4 = (**(code **)(*(longlong *)*local_d8 + 0x270))();
              plVar6 = local_b8;
              if (lVar4 == 0) {
                LOCK();
                plVar8 = plVar8 + 1;
                *(int *)plVar8 = (int)*plVar8 + -1;
                UNLOCK();
                if ((int)*plVar8 == 0) {
                  pvVar1 = (void *)*local_b8;
                  local_a0 = pvVar1;
                  if (pvVar1 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar1 + 0x90);
                    FUN_14025e6b0((longlong)pvVar1 + 0x48);
                    FUN_14025e600(pvVar1);
                    operator_delete(pvVar1);
                  }
                  operator_delete(plVar6);
                }
                LOCK();
                plVar7 = local_d8 + 1;
                *(int *)plVar7 = (int)*plVar7 + -1;
                UNLOCK();
                if ((int)*plVar7 == 0) {
                  puVar2 = (undefined8 *)*local_d8;
                  if (puVar2 != (undefined8 *)0x0) {
                    (**(code **)*puVar2)(puVar2,1);
                  }
                  operator_delete(local_d8);
                }
              }
              else if (*(float *)(*plVar7 + 0x22c4) == 0.0) {
                local_78 = *(undefined4 *)(param_1 + 0x170);
                local_74 = *(undefined4 *)(param_1 + 0x174);
                local_70 = *(undefined4 *)(param_1 + 0x178);
                local_6c = *(undefined4 *)(param_1 + 0x17c);
                FUN_1401ff830(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                              *(undefined4 *)(param_1 + 0x284),*(undefined4 *)(param_1 + 8),
                              &local_78,CONCAT44(uVar10,1));
                local_res18[0] = *(int *)(lVar4 + 0x74);
                local_res8[0] = 0;
                piVar5 = local_res8;
                if (-1 < *(int *)(lVar4 + 0x74)) {
                  piVar5 = local_res18;
                }
                local_res20[0] = *piVar5;
                *(int *)(lVar4 + 0x6c) = local_res20[0];
                *(undefined4 *)(lVar4 + 0x74) = 0;
                plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                (**(code **)(*plVar6 + 0x580))
                          (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20);
                plVar6 = *(longlong **)(param_1 + 0x9b0);
                local_58 = plVar6;
                local_50 = plVar6;
                if (plVar6 != (longlong *)0x0) {
                  LOCK();
                  *(int *)(plVar6 + 1) = (int)plVar6[1] + 1;
                  UNLOCK();
                  plVar7 = local_d8;
                  plVar8 = local_b8;
                  if (*plVar6 != 0) {
                    FUN_14025f0a0(*plVar6,param_1);
                  }
                }
                FUN_1402d6b80(*plVar7);
                FUN_14025d2b0(*plVar8);
                plVar7 = local_58;
                if (plVar6 != (longlong *)0x0) {
                  LOCK();
                  plVar6 = plVar6 + 1;
                  *(int *)plVar6 = (int)*plVar6 + -1;
                  UNLOCK();
                  plVar8 = local_b8;
                  if ((int)*plVar6 == 0) {
                    pvVar1 = (void *)*local_58;
                    if (pvVar1 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar1 + 0x4b18);
                      operator_delete(pvVar1);
                    }
                    operator_delete(plVar7);
                    plVar8 = local_b8;
                  }
                }
                plVar7 = local_b8;
                LOCK();
                plVar8 = plVar8 + 1;
                *(int *)plVar8 = (int)*plVar8 + -1;
                UNLOCK();
                if ((int)*plVar8 == 0) {
                  pvVar1 = (void *)*local_b8;
                  local_a0 = pvVar1;
                  if (pvVar1 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar1 + 0x90);
                    FUN_14025e6b0((longlong)pvVar1 + 0x48);
                    FUN_14025e600(pvVar1);
                    operator_delete(pvVar1);
                  }
                  operator_delete(plVar7);
                }
                LOCK();
                plVar7 = local_d8 + 1;
                *(int *)plVar7 = (int)*plVar7 + -1;
                UNLOCK();
                if ((int)*plVar7 == 0) {
                  puVar2 = (undefined8 *)*local_d8;
                  if (puVar2 != (undefined8 *)0x0) {
                    (**(code **)*puVar2)(puVar2,1);
                  }
                  operator_delete(local_d8);
                }
              }
              else {
                local_a8[0] = *(int *)(lVar4 + 0x6c);
                local_98[0] = 0;
                piVar5 = local_98;
                if (-1 < *(int *)(lVar4 + 0x6c)) {
                  piVar5 = local_a8;
                }
                *(int *)(lVar4 + 0x74) = *piVar5;
                local_68 = *(undefined4 *)(param_1 + 0x170);
                local_64 = *(undefined4 *)(param_1 + 0x174);
                local_60 = *(undefined4 *)(param_1 + 0x178);
                local_5c = *(undefined4 *)(param_1 + 0x17c);
                FUN_1401ff830(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                              *(undefined4 *)(param_1 + 0x284),*(undefined4 *)(param_1 + 8),
                              &local_68,(ulonglong)uVar10 << 0x20);
                local_88 = *(undefined4 *)(param_1 + 0x170);
                local_84 = *(undefined4 *)(param_1 + 0x174);
                local_80 = *(undefined4 *)(param_1 + 0x178);
                local_7c = *(undefined4 *)(param_1 + 0x17c);
                iVar3 = *(int *)(param_1 + 0x284);
                local_90[0] = *(undefined4 *)(param_1 + 8);
                if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar4 != 0)) {
                  local_res10[0] = (undefined2)iVar3;
                  plVar7 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar7 + 0xe0))
                            (plVar7,1,&DAT_1405d85a0,local_res10,local_90,&local_88);
                }
                plVar7 = local_b8;
                LOCK();
                plVar8 = plVar8 + 1;
                *(int *)plVar8 = (int)*plVar8 + -1;
                UNLOCK();
                if ((int)*plVar8 == 0) {
                  pvVar1 = (void *)*local_b8;
                  local_a0 = pvVar1;
                  if (pvVar1 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar1 + 0x90);
                    FUN_14025e6b0((longlong)pvVar1 + 0x48);
                    FUN_14025e600(pvVar1);
                    operator_delete(pvVar1);
                  }
                  operator_delete(plVar7);
                }
                LOCK();
                plVar7 = local_d8 + 1;
                *(int *)plVar7 = (int)*plVar7 + -1;
                UNLOCK();
                if ((int)*plVar7 == 0) {
                  puVar2 = (undefined8 *)*local_d8;
                  if (puVar2 != (undefined8 *)0x0) {
                    (**(code **)*puVar2)(puVar2,1);
                  }
                  operator_delete(local_d8);
                }
              }
              goto LAB_1401d19e6;
            }
          }
          if (plVar8 != (longlong *)0x0) {
            LOCK();
            plVar7 = plVar8 + 1;
            *(int *)plVar7 = (int)*plVar7 + -1;
            UNLOCK();
            if ((int)*plVar7 == 0) {
              pvVar1 = (void *)*plVar8;
              local_a0 = pvVar1;
              if (pvVar1 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar1 + 0x90);
                FUN_14025e6b0((longlong)pvVar1 + 0x48);
                FUN_14025e600(pvVar1);
                operator_delete(pvVar1);
              }
              operator_delete(plVar8);
            }
          }
          LOCK();
          plVar7 = local_d8 + 1;
          *(int *)plVar7 = (int)*plVar7 + -1;
          UNLOCK();
          if ((int)*plVar7 == 0) {
            puVar2 = (undefined8 *)*local_d8;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
            }
            operator_delete(local_d8);
          }
          goto LAB_1401d19e6;
        }
      }
      else {
        iVar3 = DAT_14060804c + 1;
        bVar9 = DAT_14060804c == 0;
        DAT_14060804c = iVar3;
        if (bVar9) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar7 != (longlong *)0x0) {
      if (plVar7 == local_d0) {
        LOCK();
        plVar7 = plVar7 + 1;
        *(int *)plVar7 = (int)*plVar7 + -1;
        UNLOCK();
        if ((int)*plVar7 == 0) {
          puVar2 = (undefined8 *)*local_d8;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          operator_delete(local_d8);
        }
      }
      else {
        iVar3 = DAT_140608054 + 1;
        bVar9 = DAT_140608054 == 0;
        DAT_140608054 = iVar3;
        if (bVar9) {
          FUN_140176d60(1);
        }
      }
    }
  }
LAB_1401d19e6:
  if (local_c0 != '\0') {
    FUN_14034edd0(local_c8);
  }
  return;
}



// WARNING: Type propagation algorithm not settling

undefined8 FUN_1401d1a10(longlong *param_1,undefined4 param_2,longlong *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  longlong *plVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong lVar9;
  char cVar10;
  bool bVar11;
  undefined4 local_res10 [4];
  undefined2 local_res20 [4];
  undefined4 local_c8;
  undefined4 local_c4;
  int local_c0 [4];
  undefined4 local_b0 [2];
  longlong *local_a8;
  longlong *local_a0;
  longlong local_98;
  char local_90;
  longlong *local_88;
  longlong *local_80;
  undefined **local_78;
  longlong *local_70;
  longlong local_68;
  ulonglong local_60;
  undefined8 local_58;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  FUN_140198570(param_1,&local_a8);
  plVar6 = local_a8;
  if (local_a8 != (longlong *)0x0) {
    if (local_a8 == local_a0) {
      if (*local_a8 != 0) {
        lVar7 = 0;
        local_98 = 0;
        cVar10 = '\0';
        local_90 = '\0';
        plVar8 = (longlong *)param_1[0x165];
        if (plVar8 != (longlong *)0x0) {
          if (plVar8 == (longlong *)param_1[0x166]) {
            lVar9 = *plVar8;
            lVar7 = 0;
            if (lVar9 != 0) {
              if (plVar8 != (longlong *)param_1[0x166]) {
                iVar4 = DAT_1406080a8 + 1;
                bVar11 = DAT_1406080a8 == 0;
                DAT_1406080a8 = iVar4;
                if (bVar11) {
                  FUN_140176d60(1);
                }
                lVar9 = 0;
              }
              local_90 = 0;
              local_98 = lVar9;
              FUN_14034ed40(lVar9);
              cVar10 = '\x01';
              local_90 = '\x01';
              lVar7 = lVar9;
            }
          }
          else {
            iVar4 = DAT_1406080a8 + 1;
            bVar11 = DAT_1406080a8 == 0;
            DAT_1406080a8 = iVar4;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
        cVar3 = local_90;
        lVar9 = local_98;
        plVar8 = local_a8;
        plVar1 = (longlong *)param_1[0x140];
        local_88 = plVar1;
        local_80 = plVar1;
        if (plVar1 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
          UNLOCK();
          plVar6 = local_a8;
          lVar7 = local_98;
          cVar10 = local_90;
          if (*plVar1 != 0) {
            local_c8 = 0xffffffff;
            iVar4 = FUN_140267230(*plVar1,&local_c8,param_3);
            if (iVar4 == 1) {
              FUN_1401d1230(param_1,local_c8);
              local_50 = (undefined4)param_1[0x2e];
              local_4c = *(undefined4 *)((longlong)param_1 + 0x174);
              local_48 = (undefined4)param_1[0x2f];
              local_44 = *(undefined4 *)((longlong)param_1 + 0x17c);
              iVar4 = *(int *)((longlong)param_1 + 0x284);
              local_c0[2] = local_res10[0];
              if ((-1 < iVar4) && (iVar4 < *(short *)(param_1[0x16a] + 700))) {
                if ((*param_3 == 0) && (param_3[1] == 0)) {
                  bVar11 = false;
                }
                else {
                  bVar11 = true;
                }
                if ((bVar11) && (lVar7 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar7 != 0)) {
                  local_res20[0] = (undefined2)iVar4;
                  plVar6 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar7 + 8) + (longlong)(int)param_1[0x51] * 8) + 0x70);
                  (**(code **)(*plVar6 + 0x460))
                            (plVar6,1,&DAT_1405d85a0,local_res20,local_c0 + 2,&local_50,param_3);
                }
              }
              local_b0[0] = *(undefined4 *)(*plVar1 + 0x38);
              local_c4 = 1;
              (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x5f0))
                        ((longlong *)(param_1[0x16a] + 0x78),local_res10[0],&DAT_1405d85a0,&local_c4
                         ,param_3,local_b0);
              local_78 = Proud::CFastArray<>::vftable;
              local_70 = (longlong *)0x0;
              local_68 = 0;
              local_60 = 0;
              local_58 = 0;
              iVar4 = (**(code **)(*(longlong *)*plVar8 + 0xae8))((longlong *)*plVar8,&local_78);
              if (iVar4 < 1) {
                iVar4 = (**(code **)(*param_1 + 0x38))(param_1);
                if (iVar4 != 0) {
                  lVar7 = *(longlong *)(param_1[0x16a] + 0x78);
                  uVar5 = (**(code **)(*param_1 + 0x38))(param_1);
                  (**(code **)(lVar7 + 0x620))
                            (param_1[0x16a] + 0x78,uVar5,&DAT_1405d85a0,local_res10,&local_c8);
                }
              }
              else {
                lVar7 = local_68;
                if ((int)local_60 == 0) {
                  lVar7 = 0;
                }
                (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x618))
                          ((longlong *)(param_1[0x16a] + 0x78),lVar7,local_60 & 0xffffffff,
                           &DAT_1405d85a0,local_res10,&local_c8);
              }
              local_78 = Proud::CFastArray<>::vftable;
              if (local_68 != 0) {
                if (local_70 == (longlong *)0x0) {
                  FUN_14034ff60();
                }
                else {
                  (**(code **)(*local_70 + 0x18))(local_70,local_68);
                }
              }
              FUN_1401df150(&local_88);
              if (cVar3 != '\0') {
                FUN_14034edd0(lVar9);
              }
            }
            else {
              local_c0[1] = 0;
              local_c0[0] = iVar4;
              (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x5f0))
                        ((longlong *)(param_1[0x16a] + 0x78),local_res10[0],&DAT_1405d85a0,local_c0,
                         param_3,local_c0 + 1);
              FUN_1401df150(&local_88);
              if (cVar3 != '\0') {
                FUN_14034edd0(lVar9);
              }
            }
            goto LAB_1401d1e32;
          }
        }
        plVar8 = plVar6;
        FUN_1401df150(&local_88);
        if (cVar10 != '\0') {
          FUN_14034edd0(lVar7);
        }
        goto LAB_1401d1e32;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar11 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar6 == (longlong *)0x0) {
    return 1;
  }
  plVar8 = plVar6;
  if (plVar6 != local_a0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d1e32:
  LOCK();
  plVar8 = plVar8 + 1;
  *(int *)plVar8 = (int)*plVar8 + -1;
  UNLOCK();
  if ((int)*plVar8 == 0) {
    puVar2 = (undefined8 *)*local_a8;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_a8);
  }
  return 1;
}



undefined8 FUN_1401d1e80(longlong param_1,undefined8 param_2,undefined8 param_3,short *param_4)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  bool bVar8;
  undefined8 in_stack_ffffffffffffffb8;
  undefined4 uVar9;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined8 local_28;
  longlong *local_20;
  longlong *local_18;
  
  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffb8 >> 0x20);
  local_28 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        iVar4 = FUN_1401f4560(*local_20,param_1,param_2,param_3,CONCAT44(uVar9,(int)*param_4));
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        if (iVar4 == 0) {
          local_30 = 0;
          local_2c = 0x2b37;
          puVar6 = &local_30;
          puVar7 = &local_2c;
        }
        else {
          local_38 = 1;
          local_34 = 0x2b37;
          puVar6 = &local_38;
          puVar7 = &local_34;
        }
        (**(code **)(*plVar5 + 0x70))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,puVar7,puVar6);
        goto LAB_1401d1f85;
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d1f85:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    pvVar2 = (void *)*local_20;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401d1fd0(longlong param_1,undefined8 param_2,undefined8 param_3,short *param_4)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  bool bVar8;
  undefined8 in_stack_ffffffffffffffb8;
  undefined4 uVar9;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined8 local_28;
  longlong *local_20;
  longlong *local_18;
  
  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffb8 >> 0x20);
  local_28 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        iVar4 = FUN_1401f4c50(*local_20,param_1,param_2,param_3,CONCAT44(uVar9,(int)*param_4));
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        if (iVar4 == 0) {
          local_30 = 0;
          local_2c = 0x2b38;
          puVar6 = &local_30;
          puVar7 = &local_2c;
        }
        else {
          local_38 = 1;
          local_34 = 0x2b38;
          puVar6 = &local_38;
          puVar7 = &local_34;
        }
        (**(code **)(*plVar5 + 0x70))
                  (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,puVar7,puVar6);
        goto LAB_1401d20d5;
      }
    }
    else {
      iVar4 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d20d5:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    pvVar2 = (void *)*local_20;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401d2120(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  undefined2 local_res8 [16];
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  local_18 = *(undefined4 *)(param_1 + 0x160);
  iVar1 = *(int *)(param_1 + 0x284);
  local_14 = *(undefined4 *)(param_1 + 0x164);
  local_10 = *(undefined4 *)(param_1 + 0x168);
  local_c = *(undefined4 *)(param_1 + 0x16c);
  if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
     (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
    local_res8[0] = (undefined2)iVar1;
    lVar2 = *(longlong *)(*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
    (**(code **)(*(longlong *)(lVar2 + 0x70) + 0x6b0))
              (lVar2 + 0x70,1,&DAT_1405d85a0,local_res8,&local_18,param_2);
  }
  return 1;
}



undefined8
FUN_1401d21d0(undefined8 param_1,ulonglong *param_2,ushort *param_3,ushort *param_4,
             ulonglong *param_5,ushort *param_6,ushort *param_7)

{
  longlong *plVar1;
  ushort uVar2;
  ushort uVar3;
  ulonglong uVar4;
  void *pvVar5;
  longlong lVar6;
  int iVar7;
  int iVar8;
  longlong lVar9;
  ushort *puVar10;
  ushort *puVar11;
  bool bVar12;
  int local_68;
  int local_64;
  int local_60;
  int local_5c [3];
  longlong *local_50;
  longlong *local_48;
  
  local_5c[1] = -2;
  local_5c[2] = -1;
  puVar10 = param_3;
  puVar11 = param_4;
  FUN_140197b70(param_1,&local_50);
  plVar1 = local_50;
  if (local_50 != (longlong *)0x0) {
    if (local_50 == local_48) {
      lVar6 = *local_50;
      if (lVar6 != 0) {
        uVar2 = *puVar11;
        uVar3 = *puVar10;
        if ((uVar3 < 5) && (uVar2 < 0x18)) {
          FUN_14034ed40(lVar6 + 0xf630);
          lVar9 = ((longlong)(short)uVar2 + (longlong)(short)uVar3 * 0x18) * 0xac;
          uVar4 = *(ulonglong *)(lVar9 + lVar6);
          bVar12 = uVar4 < *param_2;
          iVar7 = 0;
          if ((uVar4 != *param_2) ||
             (uVar4 = *(ulonglong *)(lVar9 + 8 + lVar6), bVar12 = uVar4 < param_2[1], iVar8 = iVar7,
             uVar4 != param_2[1])) {
            iVar8 = (1 - (uint)bVar12) - (uint)(bVar12 != 0);
          }
          FUN_14034edd0(lVar6 + 0xf630);
          if (iVar8 == 0) {
            uVar2 = *param_7;
            uVar3 = *param_6;
            lVar6 = *plVar1;
            if ((uVar3 < 5) && (uVar2 < 0x18)) {
              FUN_14034ed40(lVar6 + 0xf630);
              lVar9 = ((longlong)(short)uVar2 + (longlong)(short)uVar3 * 0x18) * 0xac;
              uVar4 = *(ulonglong *)(lVar9 + lVar6);
              bVar12 = uVar4 < *param_5;
              if ((uVar4 != *param_5) ||
                 (uVar4 = *(ulonglong *)(lVar9 + 8 + lVar6), bVar12 = uVar4 < param_5[1],
                 uVar4 != param_5[1])) {
                iVar7 = (1 - (uint)bVar12) - (uint)(bVar12 != 0);
              }
              FUN_14034edd0(lVar6 + 0xf630);
              if (iVar7 == 0) {
                local_68 = (int)(short)*param_7;
                local_64 = (int)(short)*param_6;
                local_60 = (int)(short)*param_4;
                local_5c[0] = (int)(short)*param_3;
                FUN_1401ae040(param_1,local_5c,&local_60,&local_64,&local_68);
              }
            }
          }
        }
        goto LAB_1401d23cd;
      }
    }
    else {
      iVar7 = DAT_140608048 + 1;
      bVar12 = DAT_140608048 == 0;
      DAT_140608048 = iVar7;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_48) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d23cd:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    pvVar5 = (void *)*local_50;
    if (pvVar5 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar5 + 0xf630);
      operator_delete(pvVar5);
    }
    operator_delete(local_50);
  }
  return 1;
}



undefined8
FUN_1401d2420(undefined8 param_1,ulonglong *param_2,ushort *param_3,ushort *param_4,
             undefined4 *param_5)

{
  longlong *plVar1;
  ushort uVar2;
  ushort uVar3;
  void *pvVar4;
  int iVar5;
  undefined8 uVar6;
  longlong lVar7;
  bool bVar8;
  longlong *local_e8;
  longlong *local_e0;
  undefined8 local_d8;
  ulonglong local_c8;
  ulonglong local_c0;
  undefined4 local_b0;
  undefined4 local_20;
  
  local_d8 = 0xfffffffffffffffe;
  FUN_140197b70(param_1,&local_e8);
  plVar1 = local_e8;
  if (local_e8 != (longlong *)0x0) {
    if (local_e8 == local_e0) {
      if (*local_e8 != 0) {
        FUN_14000a170(&local_c8);
        iVar5 = 0;
        local_20 = 0;
        uVar2 = *param_4;
        uVar3 = *param_3;
        if ((uVar3 < 5) && (uVar2 < 0x18)) {
          lVar7 = ((longlong)(short)uVar2 + (longlong)(short)uVar3 * 0x18) * 0xac + *plVar1;
          *(ushort *)(lVar7 + 0x14) = uVar3;
          *(ushort *)(lVar7 + 0x16) = uVar2;
          FUN_140090020(&local_c8);
        }
        if ((local_c8 == 0) && (local_c0 == 0)) {
          bVar8 = false;
        }
        else {
          bVar8 = true;
        }
        if (bVar8) {
          bVar8 = local_c8 < *param_2;
          if ((local_c8 != *param_2) || (bVar8 = local_c0 < param_2[1], local_c0 != param_2[1])) {
            iVar5 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
          }
          if (iVar5 == 0) {
            uVar6 = FUN_140137690();
            iVar5 = FUN_1401369d0(uVar6,local_b0);
            if (iVar5 == 0x10) {
              FUN_1401ada00(param_1,&local_c8,*param_5);
              goto LAB_1401d2613;
            }
            LOCK();
            plVar1 = plVar1 + 1;
            lVar7 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar7 != 1) {
              return 0;
            }
            pvVar4 = (void *)*local_e8;
            if (pvVar4 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar4 + 0xf630);
              operator_delete(pvVar4);
              operator_delete(local_e8);
              return 0;
            }
          }
          else {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar7 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar7 != 1) {
              return 0;
            }
            pvVar4 = (void *)*local_e8;
            if (pvVar4 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar4 + 0xf630);
              operator_delete(pvVar4);
            }
          }
          operator_delete(local_e8);
          return 0;
        }
        goto LAB_1401d2613;
      }
    }
    else {
      iVar5 = DAT_140608048 + 1;
      bVar8 = DAT_140608048 == 0;
      DAT_140608048 = iVar5;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_e0) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d2613:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar7 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar7 == 1) {
    pvVar4 = (void *)*local_e8;
    if (pvVar4 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar4 + 0xf630);
      operator_delete(pvVar4);
    }
    operator_delete(local_e8);
  }
  return 1;
}



undefined8 FUN_1401d2670(longlong param_1)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined *puVar8;
  longlong *plVar9;
  undefined8 *puVar10;
  bool bVar11;
  undefined2 local_res8 [4];
  undefined *local_res10;
  undefined8 uVar12;
  longlong *local_70;
  longlong *local_68;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined8 local_40;
  undefined1 local_38;
  
  uVar12 = 0xfffffffffffffffe;
  lVar4 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4f0);
  FUN_140198570(param_1,&local_70);
  plVar3 = local_70;
  if (local_70 != (longlong *)0x0) {
    if (local_70 == local_68) {
      if (*local_70 != 0) {
        if ((DAT_14060b7c4 & 1) == 0) {
          DAT_14060b7c4 = DAT_14060b7c4 | 1;
          FUN_140418590();
          atexit((_func_5014 *)&LAB_140448470);
        }
        if ((DAT_14060a120 != 0xca) && (DAT_14060a120 != 0x66)) {
          if ((DAT_14060b7c4 & 1) == 0) {
            DAT_14060b7c4 = DAT_14060b7c4 | 1;
            FUN_140418590();
            atexit((_func_5014 *)&LAB_140448470);
          }
          if (DAT_14060a120 != 0xca) {
            if (lVar4 == 0) goto LAB_1401d29e0;
            puVar10 = (undefined8 *)(*plVar3 + 0xd0);
            if (7 < *(ulonglong *)(*plVar3 + 0xe8)) {
              puVar10 = (undefined8 *)*puVar10;
            }
            FUN_14034fe70();
            local_res10 = PTR_DAT_1405d8010;
            iVar6 = FUN_14034fcf0(puVar10);
            iVar5 = 0;
            if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) {
              iVar5 = *(int *)(local_res10 + -8);
            }
            iVar7 = iVar6;
            if (((iVar6 <= iVar5) && (iVar7 = 0, local_res10 != (undefined *)0x0)) &&
               (local_res10 != PTR_DAT_1405d8010)) {
              iVar7 = *(int *)(local_res10 + -8);
            }
            iVar5 = 1;
            if (1 < iVar7) {
              iVar5 = iVar7;
            }
            iVar7 = 0;
            if ((local_res10 != (undefined *)0x0) && (iVar7 = 0, local_res10 != PTR_DAT_1405d8010))
            {
              iVar7 = *(int *)(local_res10 + -8);
            }
            if (iVar7 < iVar5) {
              FUN_140002d30(&local_res10);
            }
            FUN_140002e10(&local_res10);
            puVar8 = local_res10;
            if (local_res10 == (undefined *)0x0) {
              puVar8 = PTR_DAT_1405d8010;
            }
            FUN_14034fd20(puVar8,puVar10,iVar6);
            puVar8 = local_res10;
            if (local_res10 == (undefined *)0x0) {
              puVar8 = PTR_DAT_1405d8010;
            }
            iVar6 = FUN_14034fcf0(puVar8);
            iVar5 = 0;
            if (0 < iVar6) {
              iVar5 = iVar6;
            }
            iVar6 = 0;
            if ((local_res10 != (undefined *)0x0) && (iVar6 = 0, local_res10 != PTR_DAT_1405d8010))
            {
              iVar6 = *(int *)(local_res10 + -8);
            }
            if ((iVar5 < iVar6) || (iVar5 = 0, local_res10 == (undefined *)0x0)) {
LAB_1401d286a:
              if (((local_res10 != PTR_DAT_1405d8010) && (local_res10 != (undefined *)0x0)) &&
                 ((int *)(local_res10 + -8) != (int *)0x0)) {
                *(int *)(local_res10 + -8) = iVar5;
                *(undefined2 *)(local_res10 + (longlong)iVar5 * 2) = 0;
              }
            }
            else if (local_res10 != PTR_DAT_1405d8010) {
              iVar5 = *(int *)(local_res10 + -8);
              goto LAB_1401d286a;
            }
            local_60 = *(undefined4 *)(param_1 + 0x160);
            local_5c = *(undefined4 *)(param_1 + 0x164);
            local_58 = *(undefined4 *)(param_1 + 0x168);
            local_54 = *(undefined4 *)(param_1 + 0x16c);
            plVar9 = (longlong *)(lVar4 + 0x70);
            (**(code **)(*plVar9 + 0xb0))
                      (plVar9,1,&DAT_1405d85a0,param_1 + 8,&local_60,&local_res10);
            puVar8 = local_res10;
            if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) &&
               (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
              uVar12 = FUN_14034fe70();
              local_40 = uVar12;
              FUN_14034ed40(uVar12);
              local_38 = 1;
              piVar2 = (int *)(puVar8 + -4);
              *piVar2 = *piVar2 + -1;
              if (*piVar2 == 0) {
                FUN_14034ff60(puVar1);
              }
              FUN_14034edd0(uVar12);
            }
            goto LAB_1401d29e0;
          }
        }
        if (*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0) != 0) {
          local_res8[0] = (undefined2)*(undefined4 *)(param_1 + 0x284);
          plVar9 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0) + 8) +
                     (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
          local_50 = *(undefined4 *)(param_1 + 0x160);
          local_4c = *(undefined4 *)(param_1 + 0x164);
          local_48 = *(undefined4 *)(param_1 + 0x168);
          local_44 = *(undefined4 *)(param_1 + 0x16c);
          (**(code **)(*plVar9 + 0xf70))
                    (plVar9,1,&DAT_1405d85a0,local_res8,param_1 + 8,&local_50,uVar12);
          *(undefined1 *)(param_1 + 0x5ec) = 0;
        }
        goto LAB_1401d29e0;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar11 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar3 == (longlong *)0x0) {
    return 1;
  }
  if (plVar3 != local_68) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d29e0:
  LOCK();
  plVar3 = plVar3 + 1;
  lVar4 = *plVar3;
  *(int *)plVar3 = (int)*plVar3 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar10 = (undefined8 *)*local_70;
    if (puVar10 != (undefined8 *)0x0) {
      (**(code **)*puVar10)(puVar10,1);
    }
    operator_delete(local_70);
  }
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401d30b2)
// WARNING: Removing unreachable block (ram,0x0001401d30bd)

undefined8 FUN_1401d2a30(longlong param_1,longlong *param_2,char *param_3)

{
  int *piVar1;
  char cVar2;
  char *pcVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  int iVar8;
  int iVar9;
  int iVar10;
  undefined4 *puVar11;
  longlong *plVar12;
  int iVar13;
  longlong *plVar14;
  ulonglong uVar15;
  uint *puVar16;
  uint *puVar17;
  undefined *puVar18;
  ulonglong uVar19;
  undefined *puVar20;
  undefined8 *puVar21;
  uint uVar22;
  longlong lVar23;
  undefined8 uVar24;
  ulonglong uVar25;
  bool bVar26;
  ulonglong local_res8;
  longlong *local_res10;
  char *local_res18;
  undefined2 local_res20 [4];
  longlong *local_158;
  undefined *local_150;
  undefined *local_148;
  undefined2 local_140 [2];
  undefined4 local_13c;
  int local_138 [2];
  longlong *local_130;
  longlong *local_128;
  undefined *local_120;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  int local_108 [2];
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined1 local_88;
  undefined8 local_80;
  undefined1 local_78;
  undefined8 local_70;
  undefined1 local_68;
  undefined1 local_60 [32];
  
  local_98 = 0xfffffffffffffffe;
  uVar19 = *(ulonglong *)(*(longlong *)(param_1 + 0xb50) + 0x4f0);
  local_res8 = uVar19;
  local_res10 = param_2;
  local_res18 = param_3;
  FUN_140198570(param_1,&local_130);
  plVar12 = local_130;
  local_158 = local_130;
  if (local_130 == (longlong *)0x0) {
LAB_1401d370f:
    if (plVar12 == (longlong *)0x0) {
      return 1;
    }
    if (plVar12 != local_128) {
      if (DAT_140608054 != 0) {
        DAT_140608054 = DAT_140608054 + 1;
        return 1;
      }
      DAT_140608054 = DAT_140608054 + 1;
      FUN_140176d60(1);
      return 1;
    }
  }
  else {
    if (local_130 != local_128) {
      iVar4 = DAT_14060804c + 1;
      bVar26 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar26) {
        FUN_140176d60(1);
      }
      goto LAB_1401d370f;
    }
    if (*local_130 == 0) goto LAB_1401d370f;
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 != 0xca) {
      if ((DAT_14060b7c4 & 1) == 0) {
        DAT_14060b7c4 = DAT_14060b7c4 | 1;
        FUN_140418590();
        atexit((_func_5014 *)&LAB_140448470);
      }
      if ((DAT_14060a120 == 0xca) || (DAT_14060a120 == 0x66)) goto LAB_1401d2b89;
      if (*param_3 == '\x02') {
        local_f0 = 0;
        local_e4 = 0;
        local_114 = 0x119;
        plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        (**(code **)(*plVar14 + 0x910))
                  (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_114,&local_e4,
                   &local_f0);
        goto LAB_1401d3736;
      }
LAB_1401d2ba0:
      pcVar3 = local_res18;
      uVar25 = 0;
      lVar23 = *local_res10;
      uVar15 = uVar25;
      if ((local_res10[1] - lVar23) / 0x44 != 0) {
        do {
          puVar11 = (undefined4 *)FUN_140357570(local_60);
          *(undefined4 *)(uVar25 + lVar23) = *puVar11;
          *(undefined4 *)(uVar25 + 4 + lVar23) = puVar11[1];
          *(undefined4 *)(uVar25 + 8 + lVar23) = puVar11[2];
          *(undefined4 *)(uVar25 + 0xc + lVar23) = puVar11[3];
          if (*(short *)(uVar25 + 0x24 + *local_res10) == 0) {
            if (*pcVar3 == '\x01') {
              uVar24 = 0x34;
            }
            else {
              uVar24 = 0x32;
            }
          }
          else {
            uVar24 = 0x33;
            if (*pcVar3 == '\x01') {
              uVar24 = 0x35;
            }
          }
          FUN_140202940(*(undefined8 *)(param_1 + 0xb50),param_1,uVar24,*local_res10 + uVar15 * 0x44
                       );
          uVar15 = (ulonglong)((int)uVar15 + 1);
          uVar25 = uVar25 + 0x44;
          lVar23 = *local_res10;
          plVar12 = local_158;
          uVar19 = local_res8;
        } while (uVar15 < (ulonglong)((local_res10[1] - lVar23) / 0x44));
      }
      uVar15 = 0;
      cVar2 = *local_res18;
      uVar7 = 0;
      iVar13 = 0;
      iVar4 = 0;
      if (cVar2 == '\0') {
        if (uVar19 == 0) {
          local_10c = 0;
          local_100 = 0;
          local_f8 = 0x119;
          plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar14 + 0x910))
                    (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_f8,&local_100,
                     &local_10c);
          LOCK();
          plVar12 = plVar12 + 1;
          iVar4 = (int)*plVar12;
          *(int *)plVar12 = (int)*plVar12 + -1;
          UNLOCK();
          goto LAB_1401d2f0d;
        }
        puVar21 = (undefined8 *)(*plVar12 + 0xd0);
        if (7 < *(ulonglong *)(*plVar12 + 0xe8)) {
          puVar21 = (undefined8 *)*puVar21;
        }
        FUN_14034fe70();
        local_148 = PTR_DAT_1405d8010;
        uVar5 = FUN_14034fcf0(puVar21);
        uVar22 = uVar7;
        if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) {
          uVar22 = *(uint *)(local_148 + -8);
        }
        uVar6 = uVar5;
        if ((((int)uVar5 <= (int)uVar22) && (uVar6 = uVar7, local_148 != (undefined *)0x0)) &&
           (local_148 != PTR_DAT_1405d8010)) {
          uVar6 = *(uint *)(local_148 + -8);
        }
        uVar7 = 1;
        if (1 < (int)uVar6) {
          uVar7 = uVar6;
        }
        iVar10 = iVar4;
        if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) {
          iVar10 = *(int *)(local_148 + -8);
        }
        if (iVar10 < (int)uVar7) {
          FUN_140002d30(&local_148);
        }
        FUN_140002e10(&local_148);
        puVar18 = local_148;
        if (local_148 == (undefined *)0x0) {
          puVar18 = PTR_DAT_1405d8010;
        }
        FUN_14034fd20(puVar18,puVar21,uVar5);
        puVar18 = local_148;
        if (local_148 == (undefined *)0x0) {
          puVar18 = PTR_DAT_1405d8010;
        }
        uVar7 = FUN_14034fcf0(puVar18);
        if (0 < (int)uVar7) {
          uVar15 = (ulonglong)uVar7;
        }
        if ((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) {
          iVar4 = *(int *)(local_148 + -8);
        }
        iVar10 = (int)uVar15;
        if (((int)uVar15 < iVar4) || (iVar10 = iVar13, local_148 == (undefined *)0x0)) {
LAB_1401d2dc8:
          if (((local_148 != PTR_DAT_1405d8010) && (local_148 != (undefined *)0x0)) &&
             ((int *)(local_148 + -8) != (int *)0x0)) {
            *(int *)(local_148 + -8) = iVar10;
            *(undefined2 *)(local_148 + (longlong)iVar10 * 2) = 0;
          }
        }
        else if (local_148 != PTR_DAT_1405d8010) {
          iVar10 = *(int *)(local_148 + -8);
          goto LAB_1401d2dc8;
        }
        local_res8 = CONCAT62(local_res8._2_6_,(short)*(undefined4 *)(param_1 + 0x284));
        local_bc = *(undefined4 *)(param_1 + 0x160);
        local_b8 = *(undefined4 *)(param_1 + 0x164);
        local_b4 = *(undefined4 *)(param_1 + 0x168);
        local_b0 = *(undefined4 *)(param_1 + 0x16c);
        (**(code **)(*(longlong *)(uVar19 + 0x70) + 0xc0))
                  ((longlong *)(uVar19 + 0x70),1,&DAT_1405d85a0,&local_res8,param_1 + 8,&local_bc,
                   &local_148,local_res10);
        puVar18 = local_148;
        plVar12 = local_158;
        if (((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) &&
           (puVar20 = local_148 + -8, puVar20 != (undefined *)0x0)) {
          uVar24 = FUN_14034fe70();
          local_70 = uVar24;
          FUN_14034ed40(uVar24);
          local_68 = 1;
          piVar1 = (int *)(puVar18 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar20);
          }
          FUN_14034edd0(uVar24);
          plVar12 = local_158;
        }
      }
      else if ((cVar2 == '\x01') || (plVar12 = local_158, cVar2 == '\x02')) {
        local_138[0] = 0;
        local_res8 = local_res8 & 0xffffffff00000000;
        lVar23 = *local_res10;
        uVar19 = uVar15;
        uVar25 = uVar15;
        if ((local_res10[1] - lVar23) / 0x44 != 0) {
          do {
            uVar22 = *(uint *)(lVar23 + 0x10 + uVar25);
            plVar12 = (longlong *)FUN_14013c310();
            if (*plVar12 == 0) {
LAB_1401d30c8:
              local_d4 = 0;
              local_110 = 0;
              local_d8 = 0x119;
              plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar12 + 0x910))
                        (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_d8,&local_110,
                         &local_d4);
              LOCK();
              plVar12 = local_158 + 1;
              iVar4 = (int)*plVar12;
              *(int *)plVar12 = (int)*plVar12 + -1;
              UNLOCK();
              goto LAB_1401d2f0d;
            }
            puVar16 = *(uint **)(*plVar12 +
                                ((ulonglong)uVar22 % (ulonglong)*(uint *)(plVar12 + 2)) * 8);
            while( true ) {
              if (puVar16 == (uint *)0x0) goto LAB_1401d30c8;
              if ((puVar16[0x3a] == uVar22) && (*puVar16 == uVar22)) break;
              puVar16 = *(uint **)(puVar16 + 0x38);
            }
            if ((puVar16 == (uint *)0x0) || (puVar16 == (uint *)0xfffffffffffffff8))
            goto LAB_1401d30c8;
            lVar23 = 0x18;
            plVar12 = local_res10;
            do {
              if (*(int *)(*plVar12 + uVar25 + lVar23) != 0) {
                uVar22 = *(uint *)(*plVar12 + uVar25 + lVar23);
                plVar12 = (longlong *)FUN_14013c310();
                uVar5 = uVar7;
                if (*plVar12 != 0) {
                  for (puVar17 = *(uint **)(*plVar12 +
                                           ((ulonglong)uVar22 % (ulonglong)*(uint *)(plVar12 + 2)) *
                                           8); puVar17 != (uint *)0x0;
                      puVar17 = *(uint **)(puVar17 + 0x38)) {
                    if ((puVar17[0x3a] == uVar22) && (*puVar17 == uVar22)) {
                      if (puVar17 != (uint *)0x0) {
                        uVar5 = puVar17[0x30];
                      }
                      break;
                    }
                  }
                }
                uVar19 = (ulonglong)((int)uVar19 + uVar5);
                plVar12 = local_res10;
              }
              lVar23 = lVar23 + 4;
            } while (lVar23 < 0x24);
            uVar19 = (ulonglong)((int)uVar19 + puVar16[0x30]);
            uVar22 = (int)local_res8 + 1;
            local_res8 = CONCAT44(local_res8._4_4_,uVar22);
            uVar25 = uVar25 + 0x44;
            lVar23 = *plVar12;
          } while ((ulonglong)uVar22 < (ulonglong)((plVar12[1] - lVar23) / 0x44));
        }
        iVar10 = (int)uVar19;
        if (*local_res18 == '\x01') {
          uVar7 = *(uint *)(param_1 + 0x5d4);
          local_108[0] = uVar7 - iVar10;
          if ((int)(uVar7 - iVar10) < 1) {
            local_108[0] = iVar13;
          }
          *(int *)(param_1 + 0x5d4) = local_108[0];
          local_ac = *(undefined4 *)(param_1 + 0x160);
          local_a8 = *(undefined4 *)(param_1 + 0x164);
          local_a4 = *(undefined4 *)(param_1 + 0x168);
          local_a0 = *(undefined4 *)(param_1 + 0x16c);
          iVar8 = *(int *)(param_1 + 0x284);
          if (((-1 < iVar8) && (iVar8 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar23 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar23 != 0)) {
            local_res20[0] = (undefined2)iVar8;
            plVar12 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar23 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70
                      );
            (**(code **)(*plVar12 + 0xe20))
                      (plVar12,1,&DAT_1405d85a0,local_res20,&local_ac,local_108);
          }
          local_13c = *(undefined4 *)(param_1 + 0x5d4);
          plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar12 + 0xbf0))
                    (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_13c);
          iVar8 = 0x12d;
        }
        else {
          iVar8 = iVar13;
          if (*local_res18 == '\x02') {
            uVar7 = *(uint *)(param_1 + 0x5e8);
            *(undefined1 *)(param_1 + 0x5ec) = 0;
            *(uint *)(param_1 + 0x5e8) = uVar7 - iVar10;
            iVar8 = 0x12f;
            local_138[0] = iVar10;
          }
        }
        if ((int)uVar7 < iVar10) {
          local_fc = 0;
          local_ec = 0;
          local_f4 = 0x119;
          plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar12 + 0x910))
                    (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_f4,&local_ec,
                     &local_fc);
          LOCK();
          plVar12 = local_158 + 1;
          iVar4 = (int)*plVar12;
          *(int *)plVar12 = (int)*plVar12 + -1;
          UNLOCK();
LAB_1401d2f0d:
          if (iVar4 == 1) {
            puVar21 = (undefined8 *)*local_130;
            if (puVar21 != (undefined8 *)0x0) {
              (**(code **)*puVar21)(puVar21,1);
            }
            operator_delete(local_130);
          }
          return 0;
        }
        FUN_140203920(*(longlong *)(param_1 + 0xb50),param_1,iVar8,1,uVar19,uVar7,uVar7 - iVar10);
        plVar12 = local_158;
        if (*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0) == 0) {
          *(undefined1 *)(param_1 + 0x5ec) = 1;
          local_118 = 0;
          local_dc = 0;
          local_e8 = 0x119;
          plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar12 + 0x910))
                    (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_e8,&local_dc,
                     &local_118);
          LOCK();
          plVar12 = local_158 + 1;
          iVar4 = (int)*plVar12;
          *(int *)plVar12 = (int)*plVar12 + -1;
          UNLOCK();
          goto LAB_1401d2f0d;
        }
        puVar21 = (undefined8 *)(*local_158 + 0xd0);
        if (7 < *(ulonglong *)(*local_158 + 0xe8)) {
          puVar21 = (undefined8 *)*puVar21;
        }
        FUN_14034fe70();
        local_150 = PTR_DAT_1405d8010;
        iVar8 = FUN_14034fcf0(puVar21);
        iVar10 = iVar13;
        if ((local_150 != (undefined *)0x0) && (local_150 != PTR_DAT_1405d8010)) {
          iVar10 = *(int *)(local_150 + -8);
        }
        iVar9 = iVar8;
        if (((iVar8 <= iVar10) && (iVar9 = iVar4, local_150 != (undefined *)0x0)) &&
           (local_150 != PTR_DAT_1405d8010)) {
          iVar9 = *(int *)(local_150 + -8);
        }
        iVar10 = 1;
        if (1 < iVar9) {
          iVar10 = iVar9;
        }
        iVar9 = iVar4;
        if ((local_150 != (undefined *)0x0) && (local_150 != PTR_DAT_1405d8010)) {
          iVar9 = *(int *)(local_150 + -8);
        }
        if (iVar9 < iVar10) {
          FUN_140002d30(&local_150);
        }
        FUN_140002e10(&local_150);
        puVar18 = local_150;
        if (local_150 == (undefined *)0x0) {
          puVar18 = PTR_DAT_1405d8010;
        }
        FUN_14034fd20(puVar18,puVar21,iVar8);
        puVar18 = local_150;
        if (local_150 == (undefined *)0x0) {
          puVar18 = PTR_DAT_1405d8010;
        }
        uVar7 = FUN_14034fcf0(puVar18);
        uVar19 = uVar15;
        if (0 < (int)uVar7) {
          uVar19 = (ulonglong)uVar7;
        }
        iVar10 = iVar4;
        if ((local_150 != (undefined *)0x0) && (local_150 != PTR_DAT_1405d8010)) {
          iVar10 = *(int *)(local_150 + -8);
        }
        iVar8 = (int)uVar19;
        if (((int)uVar19 < iVar10) || (iVar8 = iVar13, local_150 == (undefined *)0x0)) {
LAB_1401d33d6:
          if (((local_150 != PTR_DAT_1405d8010) && (local_150 != (undefined *)0x0)) &&
             ((int *)(local_150 + -8) != (int *)0x0)) {
            *(int *)(local_150 + -8) = iVar8;
            *(undefined2 *)(local_150 + (longlong)iVar8 * 2) = 0;
          }
        }
        else if (local_150 != PTR_DAT_1405d8010) {
          iVar8 = *(int *)(local_150 + -8);
          goto LAB_1401d33d6;
        }
        local_140[0] = (undefined2)*(undefined4 *)(param_1 + 0x284);
        plVar14 = (longlong *)
                  (*(longlong *)
                    (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0) + 8) +
                    (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
        local_cc = *(undefined4 *)(param_1 + 0x160);
        local_c8 = *(undefined4 *)(param_1 + 0x164);
        local_c4 = *(undefined4 *)(param_1 + 0x168);
        local_c0 = *(undefined4 *)(param_1 + 0x16c);
        (**(code **)(*plVar14 + 0xa60))
                  (plVar14,1,&DAT_1405d85a0,local_140,(undefined4 *)(param_1 + 8),&local_cc,
                   &local_150,local_res10,local_138);
        puVar18 = local_150;
        if (((local_150 != (undefined *)0x0) && (local_150 != PTR_DAT_1405d8010)) &&
           (puVar20 = local_150 + -8, puVar20 != (undefined *)0x0)) {
          uVar24 = FUN_14034fe70();
          local_90 = uVar24;
          FUN_14034ed40(uVar24);
          local_88 = 1;
          piVar1 = (int *)(puVar18 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar20);
          }
          FUN_14034edd0(uVar24);
        }
        if (*local_res18 == '\x01') {
          puVar21 = (undefined8 *)(*plVar12 + 0xd0);
          if (7 < *(ulonglong *)(*plVar12 + 0xe8)) {
            puVar21 = (undefined8 *)*puVar21;
          }
          FUN_14034fe70();
          puVar18 = PTR_DAT_1405d8010;
          local_120 = PTR_DAT_1405d8010;
          iVar10 = FUN_14034fcf0(puVar21);
          if ((puVar18 != (undefined *)0x0) && (puVar18 != PTR_DAT_1405d8010)) {
            iVar13 = *(int *)(puVar18 + -8);
          }
          iVar8 = iVar10;
          if (((iVar10 <= iVar13) && (iVar8 = iVar4, puVar18 != (undefined *)0x0)) &&
             (puVar18 != PTR_DAT_1405d8010)) {
            iVar8 = *(int *)(puVar18 + -8);
          }
          iVar13 = 1;
          if (1 < iVar8) {
            iVar13 = iVar8;
          }
          iVar8 = iVar4;
          if ((puVar18 != (undefined *)0x0) && (puVar18 != PTR_DAT_1405d8010)) {
            iVar8 = *(int *)(puVar18 + -8);
          }
          if (iVar8 < iVar13) {
            FUN_140002d30(&local_120);
          }
          FUN_140002e10(&local_120);
          puVar18 = local_120;
          puVar20 = local_120;
          if (local_120 == (undefined *)0x0) {
            puVar20 = PTR_DAT_1405d8010;
          }
          FUN_14034fd20(puVar20,puVar21,iVar10);
          puVar20 = puVar18;
          if (puVar18 == (undefined *)0x0) {
            puVar20 = PTR_DAT_1405d8010;
          }
          uVar7 = FUN_14034fcf0(puVar20);
          if (0 < (int)uVar7) {
            uVar15 = (ulonglong)uVar7;
          }
          iVar13 = iVar4;
          if ((puVar18 != (undefined *)0x0) && (puVar18 != PTR_DAT_1405d8010)) {
            iVar13 = *(int *)(puVar18 + -8);
          }
          iVar10 = (int)uVar15;
          if (((int)uVar15 < iVar13) || (iVar10 = iVar4, puVar18 == (undefined *)0x0)) {
LAB_1401d35d6:
            if (((puVar18 != PTR_DAT_1405d8010) && (puVar18 != (undefined *)0x0)) &&
               ((int *)(puVar18 + -8) != (int *)0x0)) {
              *(int *)(puVar18 + -8) = iVar10;
              *(undefined2 *)(puVar18 + (longlong)iVar10 * 2) = 0;
            }
          }
          else if (puVar18 != PTR_DAT_1405d8010) {
            iVar10 = *(int *)(puVar18 + -8);
            goto LAB_1401d35d6;
          }
          FUN_140173ee0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 8),0x13c,0,
                        &local_120);
          if (((puVar18 != (undefined *)0x0) && (puVar18 != PTR_DAT_1405d8010)) &&
             (puVar18 + -8 != (undefined *)0x0)) {
            uVar24 = FUN_14034fe70();
            local_80 = uVar24;
            FUN_14034ed40(uVar24);
            local_78 = 1;
            piVar1 = (int *)(puVar18 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar18 + -8);
            }
            FUN_14034edd0(uVar24);
          }
        }
      }
      LOCK();
      plVar12 = plVar12 + 1;
      iVar4 = (int)*plVar12;
      *(int *)plVar12 = (int)*plVar12 + -1;
      UNLOCK();
      goto LAB_1401d3740;
    }
LAB_1401d2b89:
    if ((*param_3 != '\0') && (*(char *)(param_1 + 0x5ec) != '\0')) goto LAB_1401d2ba0;
    local_d0 = 0;
    local_e0 = 0;
    local_158 = (longlong *)CONCAT44(local_158._4_4_,0x119);
    plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    (**(code **)(*plVar14 + 0x910))
              (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_158,&local_e0,&local_d0);
  }
LAB_1401d3736:
  LOCK();
  plVar12 = plVar12 + 1;
  iVar4 = (int)*plVar12;
  *(int *)plVar12 = (int)*plVar12 + -1;
  UNLOCK();
LAB_1401d3740:
  if (iVar4 == 1) {
    puVar21 = (undefined8 *)*local_130;
    if (puVar21 != (undefined8 *)0x0) {
      (**(code **)*puVar21)(puVar21,1);
    }
    operator_delete(local_130);
  }
  return 1;
}



undefined8 FUN_1401d3780(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar4 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar4) {
            FUN_140176d60(1);
          }
          lVar3 = 0;
        }
        FUN_14020b420(lVar3);
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar4 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar4) {
        FUN_140176d60(1);
        return 1;
      }
    }
  }
  return 1;
}



undefined8
FUN_1401d3800(undefined8 param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  bool bVar7;
  longlong *local_20;
  longlong *local_18;
  
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_14060944c != '\0') {
    FUN_140198570(param_1,&local_20);
    plVar1 = local_20;
    if (local_20 != (longlong *)0x0) {
      if (local_20 == local_18) {
        if (*local_20 != 0) {
          uVar6 = FUN_140208e30(*local_20,param_6);
          cVar4 = FUN_1401b3940(param_1,param_1,*param_2,*param_3,*param_4,*param_5,uVar6);
          if (cVar4 == '\0') {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar3 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar3 != 1) {
              return 1;
            }
            puVar2 = (undefined8 *)*local_20;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
            }
          }
          else {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar3 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar3 != 1) {
              return 1;
            }
            puVar2 = (undefined8 *)*local_20;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
              operator_delete(local_20);
              return 1;
            }
          }
          operator_delete(local_20);
          return 1;
        }
      }
      else {
        iVar5 = DAT_14060804c + 1;
        bVar7 = DAT_14060804c == 0;
        DAT_14060804c = iVar5;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_18) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar3 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar3 == 1) {
          puVar2 = (undefined8 *)*local_20;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          operator_delete(local_20);
        }
      }
      else {
        iVar5 = DAT_140608054 + 1;
        bVar7 = DAT_140608054 == 0;
        DAT_140608054 = iVar5;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return 0;
}



undefined8 FUN_1401d39d0(undefined8 param_1,undefined8 param_2)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if ((DAT_14060a120 == 0xc9) || (DAT_14060a120 == 0x65)) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a0e4 != '\0') {
      pcVar4 = "PT_XTRAP_CS_STEP2";
      DVar1 = timeGetTime();
      DVar5 = DVar1;
      FUN_1401977c0(param_1,param_2);
      DVar2 = timeGetTime();
      if (0x32 < DVar2 - DVar1) {
        FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"PT_XTRAP_CS_STEP2",uVar3,
                      pcVar4,DVar5);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401d3ac0(longlong *param_1,undefined4 param_2,uint *param_3)

{
  longlong *plVar1;
  uint uVar2;
  void *pvVar3;
  longlong lVar4;
  undefined8 *puVar5;
  int iVar6;
  int iVar7;
  uint uVar8;
  undefined4 uVar9;
  longlong *plVar10;
  longlong lVar11;
  undefined8 uVar12;
  uint *puVar13;
  longlong *plVar14;
  longlong *plVar15;
  undefined4 *puVar16;
  uint *puVar17;
  longlong *plVar18;
  longlong *plVar19;
  bool bVar20;
  uint *local_res18;
  undefined2 local_res20 [4];
  uint *puVar21;
  ulonglong in_stack_fffffffffffffe60;
  undefined8 in_stack_fffffffffffffe68;
  undefined4 uVar22;
  uint local_178 [2];
  longlong *local_170;
  longlong *local_168;
  undefined4 local_160;
  undefined2 local_15c [2];
  longlong *local_158;
  longlong *local_150;
  longlong *local_148;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130 [2];
  undefined **local_128;
  longlong *local_120;
  longlong *local_118;
  longlong *local_110;
  longlong *local_108;
  longlong *local_100;
  longlong *local_f8;
  undefined8 local_f0;
  longlong local_e8;
  longlong local_e0;
  uint local_d0;
  short local_cc;
  undefined8 local_b8;
  undefined8 uStack_b0;
  undefined4 local_a8;
  undefined4 local_a4 [25];
  undefined4 local_40;
  
  local_f0 = 0xfffffffffffffffe;
  local_160 = 0x125;
  uVar2 = *param_3;
  local_res18 = param_3;
  plVar10 = (longlong *)FUN_14013cde0();
  if (*plVar10 != 0) {
    for (puVar13 = *(uint **)(*plVar10 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar10 + 2)) * 8)
        ; puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 0x2a)) {
      if ((puVar13[0x2c] == uVar2) && (*puVar13 == uVar2)) goto LAB_1401d3b3b;
    }
  }
  puVar13 = (uint *)0x0;
LAB_1401d3b3b:
  if (puVar13 != (uint *)0x0) {
    if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    if (puVar13 != (uint *)0xfffffffffffffff8) {
      if ((int)puVar13[0x16] < 0) {
        return 1;
      }
      iVar6 = FUN_140199700(param_1);
      if (iVar6 == 0) {
        puVar16 = (undefined4 *)&DAT_14047ba68;
        goto LAB_1401d4351;
      }
      FUN_140197b70(param_1,&local_170);
      lVar11 = FUN_140174f00(&local_170);
      plVar10 = local_158;
      plVar15 = local_150;
      plVar19 = local_148;
      if (lVar11 == 0) {
LAB_1401d3ba9:
        local_148 = plVar19;
        local_150 = plVar15;
        local_158 = plVar10;
        if (local_170 == (longlong *)0x0) {
          return 1;
        }
        if (local_170 == local_168) {
LAB_1401d3be2:
          LOCK();
          plVar10 = local_170 + 1;
          *(int *)plVar10 = (int)*plVar10 + -1;
          iVar6 = (int)*plVar10;
          UNLOCK();
LAB_1401d3be6:
          if (iVar6 != 0) {
            return 1;
          }
          pvVar3 = (void *)*local_170;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_170);
          return 1;
        }
      }
      else {
        iVar6 = 0;
        puVar17 = puVar13 + 0x1b;
        puVar21 = puVar17;
        do {
          uVar2 = puVar21[-3];
          if ((0 < (int)uVar2) && (0 < (int)*puVar21)) {
            uVar12 = FUN_140137690();
            local_130[0] = FUN_140136b30(uVar12,uVar2);
            uVar12 = FUN_140174f00(&local_170);
            iVar7 = FUN_1401eceb0(uVar12,local_130,puVar21[-3]);
            if (iVar7 < (int)*puVar21) {
              (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa40))
                        ((longlong *)(param_1[0x16a] + 0x78),param_2,&DAT_1405d85a0,&DAT_14047ba6c);
              if (local_170 == (longlong *)0x0) {
                return 1;
              }
              if (local_170 != local_168) goto LAB_1401d3bbe;
              goto LAB_1401d3be2;
            }
          }
          uVar9 = (undefined4)((ulonglong)in_stack_fffffffffffffe68 >> 0x20);
          iVar6 = iVar6 + 1;
          puVar21 = puVar21 + 1;
        } while (iVar6 < 3);
        FUN_140197b90(param_1,-puVar13[0x16]);
        uVar12 = CONCAT44(uVar9,puVar13[0x16]);
        in_stack_fffffffffffffe60 = in_stack_fffffffffffffe60 & 0xffffffff00000000;
        puVar21 = (uint *)0x0;
        FUN_140203700(param_1[0x16a],0x1ac,0x48,param_1,0,in_stack_fffffffffffffe60,uVar12,0,0);
        plVar19 = local_168;
        plVar15 = local_170;
        puVar13 = puVar13 + 0x18;
        plVar18 = (longlong *)0x3;
        do {
          uVar9 = (undefined4)(in_stack_fffffffffffffe60 >> 0x20);
          uVar22 = (undefined4)((ulonglong)uVar12 >> 0x20);
          uVar2 = puVar17[-3];
          if ((0 < (int)uVar2) && (0 < (int)*puVar17)) {
            uVar12 = FUN_140137690();
            local_134 = FUN_140136b30(uVar12,uVar2);
            if (plVar15 == (longlong *)0x0) {
LAB_1401d3d60:
              lVar11 = 0;
            }
            else {
              if (plVar15 != plVar19) {
                iVar6 = DAT_140608048 + 1;
                bVar20 = DAT_140608048 == 0;
                DAT_140608048 = iVar6;
                if (bVar20) {
                  FUN_140176d60(1);
                }
                goto LAB_1401d3d60;
              }
              lVar11 = *plVar15;
            }
            puVar21 = puVar13 + 3;
            uVar12 = CONCAT44(uVar22,0x48);
            in_stack_fffffffffffffe60 = CONCAT44(uVar9,0x1ac);
            FUN_1401f11c0(lVar11,param_1,&local_134,puVar13,puVar21,in_stack_fffffffffffffe60,uVar12
                         );
          }
          puVar13 = puVar13 + 1;
          puVar17 = puVar17 + 1;
          plVar18 = (longlong *)((longlong)plVar18 + -1);
        } while (plVar18 != (longlong *)0x0);
        uVar8 = 0;
        local_178[0] = uVar8;
        uVar12 = FUN_14013cde0();
        local_160 = FUN_14013cb10(uVar12,*local_res18,local_178);
        local_158 = plVar18;
        local_150 = plVar18;
        local_148 = plVar18;
        FUN_14000a170(&local_e8);
        uVar2 = local_178[0];
        local_40 = 0;
        lVar11 = FUN_140137690();
        if (*(longlong *)(lVar11 + 0x88) != 0) {
          for (puVar13 = *(uint **)(*(longlong *)(lVar11 + 0x88) +
                                   ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar11 + 0x98)) * 8);
              puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 0xa6)) {
            if ((puVar13[0xa8] == uVar2) && (*puVar13 == uVar2)) {
              if ((puVar13 != (uint *)0x0) && (plVar15 != (longlong *)0x0)) {
                if (plVar15 == plVar19) {
                  if (*plVar15 != 0) {
                    *(undefined4 *)(*plVar15 + 0xd84) = 0x140000;
                    FUN_140090020(&local_e8);
                    if ((local_e8 != 0) || (local_e0 != 0)) {
                      uVar8 = 1;
                    }
                    if (((uVar8 != 0) || (local_d0 != 0)) || (0 < local_cc)) {
                      local_d0 = local_178[0];
                      local_b8 = 0xff000000ff00;
                      uStack_b0 = 0xff000000ff00;
                      local_a8 = 0xff00;
                      local_a4[0] = 0xff00;
                      FUN_14012e5c0(&local_158,&local_b8);
                      FUN_14012e5c0(&local_158,(longlong)&local_b8 + 4);
                      FUN_14012e5c0(&local_158,&uStack_b0);
                      FUN_14012e5c0(&local_158,(longlong)&uStack_b0 + 4);
                      FUN_14012e5c0(&local_158,&local_a8);
                      FUN_14012e5c0(&local_158,local_a4);
                      local_138 = 0x14;
                      uVar12 = FUN_140174f00(&local_170);
                      FUN_1401ed220(uVar12,&DAT_14047ba28,&local_138,&local_e8,
                                    (ulonglong)puVar21 & 0xffffffff00000000);
                      local_res18 = (uint *)CONCAT62(local_res18._2_6_,0x14);
                      local_res20[0] = 0;
                      (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xe0))
                                ((longlong *)(param_1[0x16a] + 0x78),(int)param_1[1],&DAT_1405d85a0,
                                 local_res20,&local_res18,&local_e8);
                      iVar6 = *(int *)((longlong)param_1 + 0x284);
                      if (((-1 < iVar6) && (iVar6 < *(short *)(param_1[0x16a] + 700))) &&
                         (lVar11 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar11 != 0)) {
                        local_15c[0] = (undefined2)iVar6;
                        plVar10 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar11 + 8) + (longlong)(int)param_1[0x51] * 8) +
                                  0x70);
                        (**(code **)(*plVar10 + 0xae0))
                                  (plVar10,1,&DAT_1405d85a0,local_15c,&local_e8);
                      }
                    }
                  }
                }
                else {
                  iVar6 = DAT_140608048 + 1;
                  bVar20 = DAT_140608048 == 0;
                  DAT_140608048 = iVar6;
                  if (bVar20) {
                    FUN_140176d60(1);
                  }
                }
              }
              break;
            }
          }
        }
        (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa40))
                  ((longlong *)(param_1[0x16a] + 0x78),param_2,&DAT_1405d85a0,&local_160);
        FUN_140198570(param_1,&local_100);
        plVar1 = local_100;
        plVar10 = (longlong *)0x0;
        if (local_100 != (longlong *)0x0) {
          if (local_100 == local_f8) {
            if (*local_100 != 0) {
              local_128 = Proud::CFastArray<>::vftable;
              local_120 = plVar18;
              local_118 = plVar18;
              local_110 = plVar18;
              local_108 = plVar18;
              iVar6 = (**(code **)(*(longlong *)*local_100 + 0xae8))
                                ((longlong *)*local_100,&local_128);
              lVar11 = param_1[0x16b];
              plVar15 = plVar10;
              plVar19 = plVar10;
              if (((lVar11 == 0) || (*(longlong *)(lVar11 + 0x30) == 0)) ||
                 (lVar4 = *(longlong *)(*(longlong *)(lVar11 + 0x30) + 0x2d0), lVar4 == 0)) {
                if (iVar6 < 1) {
                  iVar6 = (**(code **)(*param_1 + 0x38))(param_1);
                  if (iVar6 != 0) {
                    lVar11 = *(longlong *)(param_1[0x16a] + 0x78);
                    uVar9 = (**(code **)(*param_1 + 0x38))(param_1);
                    (**(code **)(lVar11 + 0xa60))
                              (param_1[0x16a] + 0x78,uVar9,&DAT_1405d85a0,param_1 + 1,local_178,
                               &local_158);
                  }
                }
                else {
                  plVar14 = local_118;
                  if ((int)local_110 == 0) {
                    plVar14 = plVar18;
                  }
                  (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa58))
                            ((longlong *)(param_1[0x16a] + 0x78),plVar14,
                             (ulonglong)local_110 & 0xffffffff,&DAT_1405d85a0,param_1 + 1,local_178,
                             &local_158);
                }
                local_128 = Proud::CFastArray<>::vftable;
                if (local_118 != (longlong *)0x0) {
                  if (local_120 == (longlong *)0x0) {
                    FUN_14034ff60();
                  }
                  else {
                    (**(code **)(*local_120 + 0x18))(local_120,local_118);
                  }
                }
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  puVar5 = (undefined8 *)*local_100;
                  if (puVar5 != (undefined8 *)0x0) {
                    (**(code **)*puVar5)(puVar5,1);
                  }
                  operator_delete(local_100);
                }
                if (local_158 != (longlong *)0x0) {
                  operator_delete(local_158);
                }
              }
              else {
                iVar6 = *(int *)(lVar4 + 0x4bc);
                if ((iVar6 == 3) || (iVar6 == 6)) {
                  (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa60))
                            ((longlong *)(param_1[0x16a] + 0x78),*(undefined4 *)(lVar11 + 8),
                             &DAT_1405d85a0,param_1 + 1,local_178,&local_158);
                }
                local_128 = Proud::CFastArray<>::vftable;
                if (local_118 != (longlong *)0x0) {
                  if (local_120 == (longlong *)0x0) {
                    FUN_14034ff60();
                  }
                  else {
                    (**(code **)(*local_120 + 0x18))(local_120,local_118);
                  }
                }
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  puVar5 = (undefined8 *)*local_100;
                  if (puVar5 != (undefined8 *)0x0) {
                    (**(code **)*puVar5)(puVar5,1);
                  }
                  operator_delete(local_100);
                }
                if (local_158 != (longlong *)0x0) {
                  operator_delete(local_158);
                }
              }
              goto LAB_1401d3ba9;
            }
          }
          else {
            iVar6 = DAT_14060804c + 1;
            bVar20 = DAT_14060804c == 0;
            DAT_14060804c = iVar6;
            if (bVar20) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == local_f8) {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar11 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            plVar15 = local_170;
            plVar19 = local_168;
            if ((int)lVar11 == 1) {
              puVar5 = (undefined8 *)*local_100;
              if (puVar5 != (undefined8 *)0x0) {
                (**(code **)*puVar5)(puVar5,1);
              }
              operator_delete(local_100);
              plVar15 = local_170;
              plVar19 = local_168;
            }
          }
          else {
            iVar6 = DAT_140608054 + 1;
            bVar20 = DAT_140608054 == 0;
            DAT_140608054 = iVar6;
            if (bVar20) {
              FUN_140176d60(1);
            }
          }
        }
        if (local_158 != (longlong *)0x0) {
          operator_delete(local_158);
        }
        if (plVar15 == (longlong *)0x0) {
          return 1;
        }
        local_158 = plVar10;
        local_150 = plVar10;
        local_148 = plVar10;
        if (plVar15 == plVar19) {
          LOCK();
          plVar15 = plVar15 + 1;
          *(int *)plVar15 = (int)*plVar15 + -1;
          iVar6 = (int)*plVar15;
          UNLOCK();
          goto LAB_1401d3be6;
        }
      }
LAB_1401d3bbe:
      if (DAT_140608050 != 0) {
        DAT_140608050 = DAT_140608050 + 1;
        return 1;
      }
      DAT_140608050 = DAT_140608050 + 1;
      FUN_140176d60(1);
      return 1;
    }
  }
  puVar16 = &local_160;
LAB_1401d4351:
  (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa40))
            ((longlong *)(param_1[0x16a] + 0x78),param_2,&DAT_1405d85a0,puVar16);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401d4710)
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1401d4390(longlong *param_1,undefined4 param_2,uint *param_3)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  undefined8 *puVar4;
  int iVar5;
  int iVar6;
  uint uVar7;
  undefined4 uVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined8 uVar11;
  uint *puVar12;
  longlong *plVar13;
  longlong *plVar14;
  undefined4 *puVar15;
  uint *puVar16;
  longlong *plVar17;
  longlong *plVar18;
  bool bVar19;
  uint *local_res18;
  undefined2 local_res20 [4];
  uint *puVar20;
  ulonglong in_stack_fffffffffffffe60;
  undefined8 in_stack_fffffffffffffe68;
  undefined4 uVar21;
  longlong *local_178;
  longlong *local_170;
  undefined4 local_168;
  undefined2 local_164 [2];
  longlong *local_160;
  longlong *local_158;
  longlong *local_150;
  uint local_140 [3];
  undefined4 local_134;
  undefined **local_130;
  longlong *local_128;
  longlong *local_120;
  longlong *local_118;
  longlong *local_110;
  longlong *local_108;
  longlong *local_100;
  longlong local_f8;
  longlong local_f0;
  int local_e0;
  short local_dc;
  int local_c8;
  int local_c4;
  int local_c0;
  int local_bc;
  int local_b8;
  int local_b4 [25];
  undefined4 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  local_168 = 0x121;
  uVar7 = *param_3;
  local_res18 = param_3;
  plVar9 = (longlong *)FUN_14013e1c0();
  if (*plVar9 != 0) {
    for (puVar12 = *(uint **)(*plVar9 + ((ulonglong)uVar7 % (ulonglong)*(uint *)(plVar9 + 2)) * 8);
        puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x46)) {
      if ((puVar12[0x48] == uVar7) && (*puVar12 == uVar7)) goto LAB_1401d440e;
    }
  }
  puVar12 = (uint *)0x0;
LAB_1401d440e:
  if (puVar12 != (uint *)0x0) {
    if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    if (puVar12 != (uint *)0xfffffffffffffff8) {
      if ((int)puVar12[0x30] < 0) {
        return 1;
      }
      iVar5 = FUN_140199700(param_1);
      if (iVar5 == 0) {
        puVar15 = (undefined4 *)&DAT_14047ba68;
        goto LAB_1401d4ebd;
      }
      FUN_140197b70(param_1,&local_178);
      lVar10 = FUN_140174f00(&local_178);
      plVar9 = local_160;
      plVar14 = local_158;
      plVar17 = local_150;
      if (lVar10 == 0) {
LAB_1401d447f:
        local_150 = plVar17;
        local_158 = plVar14;
        local_160 = plVar9;
        if (local_178 == (longlong *)0x0) {
          return 1;
        }
        if (local_178 != local_170) {
LAB_1401d4494:
          if (DAT_140608050 != 0) {
            DAT_140608050 = DAT_140608050 + 1;
            return 1;
          }
          DAT_140608050 = DAT_140608050 + 1;
          FUN_140176d60(1);
          return 1;
        }
LAB_1401d44b8:
        LOCK();
        plVar9 = local_178 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        iVar5 = (int)*plVar9;
        UNLOCK();
      }
      else {
        iVar5 = 0;
        puVar16 = puVar12 + 0x37;
        puVar20 = puVar16;
        do {
          uVar7 = puVar20[-3];
          if ((0 < (int)uVar7) && (0 < (int)*puVar20)) {
            uVar11 = FUN_140137690();
            local_134 = FUN_140136b30(uVar11,uVar7);
            uVar11 = FUN_140174f00(&local_178);
            iVar6 = FUN_1401eceb0(uVar11,&local_134,puVar20[-3]);
            if (iVar6 < (int)*puVar20) {
              (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa30))
                        ((longlong *)(param_1[0x16a] + 0x78),param_2,&DAT_1405d85a0,&DAT_14047ba6c);
              if (local_178 == (longlong *)0x0) {
                return 1;
              }
              if (local_178 != local_170) goto LAB_1401d4494;
              goto LAB_1401d44b8;
            }
          }
          uVar8 = (undefined4)((ulonglong)in_stack_fffffffffffffe68 >> 0x20);
          iVar5 = iVar5 + 1;
          puVar20 = puVar20 + 1;
        } while (iVar5 < 3);
        FUN_140197b90(param_1,-puVar12[0x30]);
        uVar11 = CONCAT44(uVar8,puVar12[0x30]);
        in_stack_fffffffffffffe60 = in_stack_fffffffffffffe60 & 0xffffffff00000000;
        puVar20 = (uint *)0x0;
        FUN_140203700(param_1[0x16a],0x1ad,0x4a,param_1,0,in_stack_fffffffffffffe60,uVar11,0,0);
        plVar17 = local_170;
        plVar14 = local_178;
        puVar12 = puVar12 + 0x34;
        plVar18 = (longlong *)0x3;
        do {
          uVar8 = (undefined4)(in_stack_fffffffffffffe60 >> 0x20);
          uVar21 = (undefined4)((ulonglong)uVar11 >> 0x20);
          uVar7 = puVar16[-3];
          if ((0 < (int)uVar7) && (0 < (int)*puVar16)) {
            uVar11 = FUN_140137690();
            local_140[2] = FUN_140136b30(uVar11,uVar7);
            if (plVar14 == (longlong *)0x0) {
LAB_1401d4640:
              lVar10 = 0;
            }
            else {
              if (plVar14 != plVar17) {
                iVar5 = DAT_140608048 + 1;
                bVar19 = DAT_140608048 == 0;
                DAT_140608048 = iVar5;
                if (bVar19) {
                  FUN_140176d60(1);
                }
                goto LAB_1401d4640;
              }
              lVar10 = *plVar14;
            }
            puVar20 = puVar12 + 3;
            uVar11 = CONCAT44(uVar21,0x4a);
            in_stack_fffffffffffffe60 = CONCAT44(uVar8,0x1ad);
            FUN_1401f11c0(lVar10,param_1,local_140 + 2,puVar12,puVar20,in_stack_fffffffffffffe60,
                          uVar11);
          }
          puVar12 = puVar12 + 1;
          puVar16 = puVar16 + 1;
          plVar18 = (longlong *)((longlong)plVar18 + -1);
        } while (plVar18 != (longlong *)0x0);
        uVar7 = 0;
        local_140[0] = uVar7;
        uVar11 = FUN_14013e1c0();
        local_168 = FUN_14013de60(uVar11,*local_res18,local_140);
        local_160 = plVar18;
        local_158 = plVar18;
        local_150 = plVar18;
        FUN_14000a170(&local_f8);
        local_50 = 0;
        plVar9 = (longlong *)FUN_14013e1c0();
        if (*plVar9 != 0) {
          for (puVar12 = *(uint **)(*plVar9 +
                                   ((ulonglong)local_140[0] % (ulonglong)*(uint *)(plVar9 + 2)) * 8)
              ; puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x46)) {
            if ((puVar12[0x48] == local_140[0]) && (*puVar12 == local_140[0])) goto LAB_1401d46fd;
          }
        }
        puVar12 = (uint *)0x0;
LAB_1401d46fd:
        if ((puVar12 != (uint *)0x0) && (puVar12 != (uint *)0xfffffffffffffff8)) {
          if (plVar14 == (longlong *)0x0) {
LAB_1401d4754:
            lVar10 = 0;
          }
          else {
            if (plVar14 != plVar17) {
              iVar5 = DAT_140608048 + 1;
              bVar19 = DAT_140608048 == 0;
              DAT_140608048 = iVar5;
              if (bVar19) {
                FUN_140176d60(1);
              }
              goto LAB_1401d4754;
            }
            lVar10 = *plVar14;
          }
          *(undefined4 *)(lVar10 + 0xd84) = 0x140000;
          FUN_140090020(&local_f8);
          if ((local_f8 != 0) || (local_f0 != 0)) {
            uVar7 = 1;
          }
          if (((uVar7 != 0) || (local_e0 != 0)) || (0 < local_dc)) {
            local_c8 = (int)(longlong)((float)puVar12[0x1b] * 255.0) * 0x1000000 +
                       ((uint)(longlong)((float)puVar12[0x19] * 255.0) & 0xff) * 0x100 +
                       ((uint)(longlong)((float)puVar12[0x18] * 255.0) & 0xff) * 0x10000 +
                       ((uint)(longlong)((float)puVar12[0x1a] * 255.0) & 0xff);
            local_c4 = (int)(longlong)((float)puVar12[0x1f] * 255.0) * 0x1000000 +
                       ((uint)(longlong)((float)puVar12[0x1d] * 255.0) & 0xff) * 0x100 +
                       ((uint)(longlong)((float)puVar12[0x1c] * 255.0) & 0xff) * 0x10000 +
                       ((uint)(longlong)((float)puVar12[0x1e] * 255.0) & 0xff);
            local_c0 = (int)(longlong)((float)puVar12[0x23] * 255.0) * 0x1000000 +
                       ((uint)(longlong)((float)puVar12[0x21] * 255.0) & 0xff) * 0x100 +
                       ((uint)(longlong)((float)puVar12[0x20] * 255.0) & 0xff) * 0x10000 +
                       ((uint)(longlong)((float)puVar12[0x22] * 255.0) & 0xff);
            local_bc = (int)(longlong)((float)puVar12[0x27] * 255.0) * 0x1000000 +
                       ((uint)(longlong)((float)puVar12[0x25] * 255.0) & 0xff) * 0x100 +
                       ((uint)(longlong)((float)puVar12[0x24] * 255.0) & 0xff) * 0x10000 +
                       ((uint)(longlong)((float)puVar12[0x26] * 255.0) & 0xff);
            local_b8 = (int)(longlong)((float)puVar12[0x2b] * 255.0) * 0x1000000 +
                       ((uint)(longlong)((float)puVar12[0x29] * 255.0) & 0xff) * 0x100 +
                       ((uint)(longlong)((float)puVar12[0x28] * 255.0) & 0xff) * 0x10000 +
                       ((uint)(longlong)((float)puVar12[0x2a] * 255.0) & 0xff);
            local_b4[0] = (int)(longlong)((float)puVar12[0x2f] * 255.0) * 0x1000000 +
                          ((uint)(longlong)((float)puVar12[0x2d] * 255.0) & 0xff) * 0x100 +
                          ((uint)(longlong)((float)puVar12[0x2c] * 255.0) & 0xff) * 0x10000 +
                          ((uint)(longlong)((float)puVar12[0x2e] * 255.0) & 0xff);
            FUN_14012e5c0(&local_160,&local_c8);
            FUN_14012e5c0(&local_160,&local_c4);
            FUN_14012e5c0(&local_160,&local_c0);
            FUN_14012e5c0(&local_160,&local_bc);
            FUN_14012e5c0(&local_160,&local_b8);
            FUN_14012e5c0(&local_160,local_b4);
            local_140[1] = 0x14;
            if (plVar14 == (longlong *)0x0) {
LAB_1401d4a74:
              lVar10 = 0;
            }
            else {
              if (plVar14 != plVar17) {
                iVar5 = DAT_140608048 + 1;
                bVar19 = DAT_140608048 == 0;
                DAT_140608048 = iVar5;
                if (bVar19) {
                  FUN_140176d60(1);
                }
                goto LAB_1401d4a74;
              }
              lVar10 = *plVar14;
            }
            FUN_1401ed220(lVar10,&DAT_14047ba28,local_140 + 1,&local_f8,
                          (ulonglong)puVar20 & 0xffffffff00000000);
            local_res18 = (uint *)CONCAT62(local_res18._2_6_,0x14);
            local_res20[0] = 0;
            (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xe0))
                      ((longlong *)(param_1[0x16a] + 0x78),(int)param_1[1],&DAT_1405d85a0,
                       local_res20,&local_res18,&local_f8);
            iVar5 = *(int *)((longlong)param_1 + 0x284);
            if (((-1 < iVar5) && (iVar5 < *(short *)(param_1[0x16a] + 700))) &&
               (lVar10 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar10 != 0)) {
              local_164[0] = (undefined2)iVar5;
              plVar9 = (longlong *)
                       (*(longlong *)(*(longlong *)(lVar10 + 8) + (longlong)(int)param_1[0x51] * 8)
                       + 0x70);
              (**(code **)(*plVar9 + 0xae0))(plVar9,1,&DAT_1405d85a0,local_164,&local_f8);
            }
          }
        }
        (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa30))
                  ((longlong *)(param_1[0x16a] + 0x78),param_2,&DAT_1405d85a0,&local_168);
        plVar9 = (longlong *)0x0;
        if (local_160 == local_158) {
          if (local_160 != (longlong *)0x0) {
            operator_delete(local_160);
          }
          if (plVar14 == (longlong *)0x0) {
            return 1;
          }
          local_160 = plVar9;
          local_158 = plVar9;
          local_150 = plVar9;
          if (plVar14 != plVar17) goto LAB_1401d4494;
        }
        else {
          FUN_140198570(param_1,&local_108);
          plVar1 = local_108;
          if (local_108 != (longlong *)0x0) {
            if (local_108 == local_100) {
              if (*local_108 != 0) {
                local_130 = Proud::CFastArray<>::vftable;
                local_128 = plVar18;
                local_120 = plVar18;
                local_118 = plVar18;
                local_110 = plVar18;
                iVar5 = (**(code **)(*(longlong *)*local_108 + 0xae8))
                                  ((longlong *)*local_108,&local_130);
                lVar10 = param_1[0x16b];
                plVar14 = plVar9;
                plVar17 = plVar9;
                if (((lVar10 == 0) || (*(longlong *)(lVar10 + 0x30) == 0)) ||
                   (lVar3 = *(longlong *)(*(longlong *)(lVar10 + 0x30) + 0x2d0), lVar3 == 0)) {
                  if (iVar5 < 1) {
                    iVar5 = (**(code **)(*param_1 + 0x38))(param_1);
                    if (iVar5 != 0) {
                      lVar10 = *(longlong *)(param_1[0x16a] + 0x78);
                      uVar8 = (**(code **)(*param_1 + 0x38))(param_1);
                      (**(code **)(lVar10 + 0xa50))
                                (param_1[0x16a] + 0x78,uVar8,&DAT_1405d85a0,param_1 + 1,&local_e0,
                                 &local_160);
                    }
                  }
                  else {
                    plVar13 = local_120;
                    if ((int)local_118 == 0) {
                      plVar13 = plVar18;
                    }
                    (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa48))
                              ((longlong *)(param_1[0x16a] + 0x78),plVar13,
                               (ulonglong)local_118 & 0xffffffff,&DAT_1405d85a0,param_1 + 1,
                               &local_e0,&local_160);
                  }
                  local_130 = Proud::CFastArray<>::vftable;
                  if (local_120 != (longlong *)0x0) {
                    if (local_128 == (longlong *)0x0) {
                      FUN_14034ff60();
                    }
                    else {
                      (**(code **)(*local_128 + 0x18))(local_128,local_120);
                    }
                  }
                  LOCK();
                  plVar1 = plVar1 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    puVar4 = (undefined8 *)*local_108;
                    if (puVar4 != (undefined8 *)0x0) {
                      (**(code **)*puVar4)(puVar4,1);
                    }
                    operator_delete(local_108);
                  }
                  if (local_160 != (longlong *)0x0) {
                    operator_delete(local_160);
                  }
                }
                else {
                  iVar5 = *(int *)(lVar3 + 0x4bc);
                  if ((iVar5 == 3) || (iVar5 == 6)) {
                    (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa50))
                              ((longlong *)(param_1[0x16a] + 0x78),*(undefined4 *)(lVar10 + 8),
                               &DAT_1405d85a0,param_1 + 1,&local_e0,&local_160);
                  }
                  local_130 = Proud::CFastArray<>::vftable;
                  if (local_120 != (longlong *)0x0) {
                    if (local_128 == (longlong *)0x0) {
                      FUN_14034ff60();
                    }
                    else {
                      (**(code **)(*local_128 + 0x18))(local_128,local_120);
                    }
                  }
                  LOCK();
                  plVar1 = plVar1 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    puVar4 = (undefined8 *)*local_108;
                    if (puVar4 != (undefined8 *)0x0) {
                      (**(code **)*puVar4)(puVar4,1);
                    }
                    operator_delete(local_108);
                  }
                  if (local_160 != (longlong *)0x0) {
                    operator_delete(local_160);
                  }
                }
                goto LAB_1401d447f;
              }
            }
            else {
              iVar5 = DAT_14060804c + 1;
              bVar19 = DAT_14060804c == 0;
              DAT_14060804c = iVar5;
              if (bVar19) {
                FUN_140176d60(1);
              }
            }
          }
          if (plVar1 != (longlong *)0x0) {
            if (plVar1 == local_100) {
              LOCK();
              plVar1 = plVar1 + 1;
              lVar10 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              plVar14 = local_178;
              plVar17 = local_170;
              if ((int)lVar10 == 1) {
                puVar4 = (undefined8 *)*local_108;
                if (puVar4 != (undefined8 *)0x0) {
                  (**(code **)*puVar4)(puVar4,1);
                }
                operator_delete(local_108);
                plVar14 = local_178;
                plVar17 = local_170;
              }
            }
            else {
              iVar5 = DAT_140608054 + 1;
              bVar19 = DAT_140608054 == 0;
              DAT_140608054 = iVar5;
              if (bVar19) {
                FUN_140176d60(1);
              }
            }
          }
          if (local_160 != (longlong *)0x0) {
            operator_delete(local_160);
          }
          if (plVar14 == (longlong *)0x0) {
            return 1;
          }
          local_160 = plVar9;
          local_158 = plVar9;
          local_150 = plVar9;
          if (plVar14 != plVar17) goto LAB_1401d4494;
        }
        LOCK();
        plVar14 = plVar14 + 1;
        *(int *)plVar14 = (int)*plVar14 + -1;
        iVar5 = (int)*plVar14;
        UNLOCK();
        local_160 = plVar9;
        local_158 = plVar9;
        local_150 = plVar9;
      }
      if (iVar5 != 0) {
        return 1;
      }
      pvVar2 = (void *)*local_178;
      if (pvVar2 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar2 + 0xf630);
        operator_delete(pvVar2);
      }
      operator_delete(local_178);
      return 1;
    }
  }
  puVar15 = &local_168;
LAB_1401d4ebd:
  (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0xa30))
            ((longlong *)(param_1[0x16a] + 0x78),param_2,&DAT_1405d85a0,puVar15);
  return 1;
}



undefined8 FUN_1401d4f00(longlong param_1,byte *param_2,longlong *param_3)

{
  longlong *plVar1;
  char cVar2;
  longlong lVar3;
  undefined8 *puVar4;
  int iVar5;
  undefined4 uVar6;
  size_t sVar7;
  wchar_t *pwVar8;
  ulonglong uVar9;
  longlong *plVar10;
  char *pcVar11;
  wchar_t ******_Src;
  bool bVar12;
  char local_res8 [8];
  char local_res18 [8];
  undefined2 local_res20 [4];
  undefined2 local_388 [2];
  undefined4 local_384;
  undefined4 local_380;
  undefined4 local_37c;
  undefined4 local_378;
  undefined4 local_374;
  undefined4 local_370;
  longlong *local_368;
  longlong *local_360;
  undefined1 local_358;
  undefined7 uStack_357;
  undefined8 local_348;
  ulonglong local_340;
  wchar_t *****local_330 [3];
  ulonglong local_318;
  undefined8 local_308;
  uint local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  undefined4 local_2ec;
  undefined4 local_2e8;
  undefined4 local_2e4;
  undefined4 local_2e0;
  undefined4 local_2dc;
  undefined4 local_2d8;
  undefined4 local_2d4;
  undefined8 local_2d0;
  undefined4 local_2c8;
  wchar_t local_2c4 [66];
  wchar_t local_240 [254];
  undefined2 local_44;
  
  local_308 = 0xfffffffffffffffe;
  pwVar8 = (wchar_t *)*param_3;
  if ((wchar_t *)*param_3 == (wchar_t *)0x0) {
    pwVar8 = (wchar_t *)PTR_DAT_1405d8010;
  }
  sVar7 = wcsnlen(pwVar8,0xff);
  if (0xfe < sVar7) {
    return 1;
  }
  FUN_140198570(param_1);
  plVar1 = local_368;
  if (local_368 != (longlong *)0x0) {
    if (local_368 == local_360) {
      if (*local_368 != 0) {
        local_res8[0] = *(char *)(param_1 + 0x5d1);
        if (local_res8[0] == '\0') {
          local_384 = 0x12d;
          local_380 = 0x2b51;
          plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar10 + 0x70))
                    (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_380,&local_384);
        }
        else {
          local_res8[0] = local_res8[0] + -1;
          local_2d0 = 0;
          local_2c8 = 0;
          memset(local_2c4 + 0x10,0,100);
          local_2c4[0] = L'\0';
          local_2c4[1] = L'\0';
          local_2c4[2] = L'\0';
          local_2c4[3] = L'\0';
          local_2c4[4] = L'\0';
          local_2c4[5] = L'\0';
          local_2c4[6] = L'\0';
          local_2c4[7] = L'\0';
          local_2c4[8] = L'\0';
          local_2c4[9] = L'\0';
          local_2c4[10] = L'\0';
          local_2c4[0xb] = L'\0';
          local_2c4[0xc] = L'\0';
          local_2c4[0xd] = L'\0';
          local_2c4[0xe] = L'\0';
          local_2c4[0xf] = L'\0';
          memset(local_240,0,0x1fe);
          local_2f8 = (uint)*param_2;
          local_2f4 = *(undefined4 *)(DAT_140608000 + 0x140);
          local_2f0 = *(undefined4 *)(param_1 + 0x160);
          local_2ec = *(undefined4 *)(param_1 + 0x164);
          local_2e8 = *(undefined4 *)(param_1 + 0x168);
          local_2e4 = *(undefined4 *)(param_1 + 0x16c);
          local_2e0 = *(undefined4 *)(param_1 + 0x170);
          local_2dc = *(undefined4 *)(param_1 + 0x174);
          local_2d8 = *(undefined4 *)(param_1 + 0x178);
          local_2d4 = *(undefined4 *)(param_1 + 0x17c);
          uVar6 = FUN_1402f8580(*plVar1);
          local_2d0 = CONCAT44(*(undefined4 *)(*plVar1 + 0x120),uVar6);
          local_2c8 = (**(code **)(*(longlong *)*plVar1 + 0x200))();
          local_340 = 0xf;
          local_348 = 0;
          local_358 = 0;
          uVar9 = 0xffffffffffffffff;
          pcVar11 = (char *)(param_1 + 0x330);
          do {
            if (uVar9 == 0) break;
            uVar9 = uVar9 - 1;
            cVar2 = *pcVar11;
            pcVar11 = pcVar11 + 1;
          } while (cVar2 != '\0');
          FUN_140003e50(&local_358,(char *)(param_1 + 0x330),~uVar9 - 1);
          FUN_140415310(local_330,&local_358);
          if (0xf < local_340) {
            operator_delete((void *)CONCAT71(uStack_357,local_358));
          }
          local_340 = 0xf;
          local_348 = 0;
          local_358 = 0;
          pwVar8 = (wchar_t *)FUN_1401a6410(param_1);
          wcscpy_s(local_2c4,0x10,pwVar8);
          _Src = local_330;
          if (7 < local_318) {
            _Src = (wchar_t ******)local_330[0];
          }
          wcscpy_s(local_2c4 + 0x10,0x32,(wchar_t *)_Src);
          pwVar8 = (wchar_t *)*param_3;
          if ((wchar_t *)*param_3 == (wchar_t *)0x0) {
            pwVar8 = (wchar_t *)PTR_DAT_1405d8010;
          }
          wcscpy_s(local_240,0xff,pwVar8);
          local_44 = 0;
          local_37c = *(undefined4 *)(param_1 + 0x160);
          local_378 = *(undefined4 *)(param_1 + 0x164);
          local_374 = *(undefined4 *)(param_1 + 0x168);
          local_370 = *(undefined4 *)(param_1 + 0x16c);
          iVar5 = *(int *)(param_1 + 0x284);
          local_res18[0] = local_res8[0];
          if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar3 != 0)) {
            local_res20[0] = (undefined2)iVar5;
            plVar10 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70)
            ;
            (**(code **)(*plVar10 + 0xc50))
                      (plVar10,1,&DAT_1405d85a0,local_res20,&local_37c,local_res18);
          }
          iVar5 = *(int *)(param_1 + 0x284);
          if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
             (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c8), lVar3 != 0)) {
            local_388[0] = (undefined2)iVar5;
            plVar10 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70)
            ;
            (**(code **)(*plVar10 + 0xf20))(plVar10,1,&DAT_1405d85a0,local_388,&local_2f8);
          }
          plVar10 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar10 + 0xaf0))
                    (plVar10,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8);
          *(char *)(param_1 + 0x5d1) = local_res8[0];
          if (7 < local_318) {
            operator_delete(local_330[0]);
          }
        }
        goto LAB_1401d530f;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_360) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d530f:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar4 = (undefined8 *)*local_368;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_368);
  }
  return 1;
}



undefined8 FUN_1401d5360(longlong param_1,undefined1 *param_2,longlong *param_3)

{
  undefined1 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined *puVar4;
  undefined4 local_18;
  undefined4 uStack_14;
  undefined4 uStack_10;
  undefined4 uStack_c;
  
  local_18 = *(undefined4 *)(param_1 + 0x170);
  uStack_14 = *(undefined4 *)(param_1 + 0x174);
  uStack_10 = *(undefined4 *)(param_1 + 0x178);
  uStack_c = *(undefined4 *)(param_1 + 0x17c);
  puVar4 = (undefined *)*param_3;
  if ((undefined *)*param_3 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_14020f790(*(undefined8 *)(*(longlong *)(param_1 + 0xb50) + 0x4e8),&local_18,*param_2,puVar4);
  local_18 = *(undefined4 *)(param_1 + 0x170);
  uStack_14 = *(undefined4 *)(param_1 + 0x174);
  puVar4 = (undefined *)*param_3;
  if ((undefined *)*param_3 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  uStack_10 = *(undefined4 *)(param_1 + 0x178);
  uStack_c = *(undefined4 *)(param_1 + 0x17c);
  FUN_1402016f0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 0x288),
                *(undefined4 *)(param_1 + 0x284),&local_18,*param_2,puVar4);
  uVar2 = DAT_140607fd8;
  if (*(char *)(DAT_140608000 + 0x164) != '\0') {
    uVar1 = *param_2;
    uVar3 = FUN_1401a6410(param_1);
    FUN_140418da0(uVar2,&DAT_1404a8f60,uVar3,uVar1,*param_3);
  }
  return 1;
}



undefined8 FUN_1401d5470(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  longlong *plVar5;
  byte local_res8 [8];
  undefined4 local_res10 [2];
  undefined4 local_res18 [4];
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 uStack_24;
  undefined4 uStack_20;
  undefined4 uStack_1c;
  
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4e8);
  local_28 = *(undefined4 *)(param_1 + 0x170);
  uStack_24 = *(undefined4 *)(param_1 + 0x174);
  uStack_20 = *(undefined4 *)(param_1 + 0x178);
  uStack_1c = *(undefined4 *)(param_1 + 0x17c);
  (**(code **)(*(longlong *)(lVar2 + 0x70) + 0x170))(lVar2 + 0x70,1,&DAT_1405d85a0,&local_28);
  local_38 = *(undefined4 *)(param_1 + 0x170);
  local_34 = *(undefined4 *)(param_1 + 0x174);
  local_30 = *(undefined4 *)(param_1 + 0x178);
  local_2c = *(undefined4 *)(param_1 + 0x17c);
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0);
  if (lVar2 != 0) {
    lVar2 = *(longlong *)(*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
    (**(code **)(*(longlong *)(lVar2 + 0x70) + 0xb50))(lVar2 + 0x70,1,&DAT_1405d85a0,&local_38);
  }
  local_res8[0] = *(byte *)(param_1 + 0x5d1);
  if (local_res8[0] < 5) {
    local_28 = *(undefined4 *)(param_1 + 0x160);
    iVar1 = *(int *)(param_1 + 0x284);
    local_res8[0] = local_res8[0] + 1;
    uStack_24 = *(undefined4 *)(param_1 + 0x164);
    uStack_20 = *(undefined4 *)(param_1 + 0x168);
    *(byte *)(param_1 + 0x5d1) = local_res8[0];
    uStack_1c = *(undefined4 *)(param_1 + 0x16c);
    local_res10[0] = CONCAT31(local_res10[0]._1_3_,local_res8[0]);
    if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
       (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
      local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar1);
      lVar2 = *(longlong *)(*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
      (**(code **)(*(longlong *)(lVar2 + 0x70) + 0xc50))
                (lVar2 + 0x70,1,&DAT_1405d85a0,local_res18,&local_28,local_res10);
    }
    (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78) + 0xaf0))
              (*(longlong *)(param_1 + 0xb50) + 0x78,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,
               local_res8);
    plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    local_res10[0] = 1;
    local_res18[0] = 0x2b53;
    (**(code **)(*plVar5 + 0x70))
              (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18,local_res10);
  }
  uVar3 = DAT_140607fd8;
  if (*(char *)(DAT_140608000 + 0x164) != '\0') {
    uVar4 = FUN_1401a6410(param_1);
    FUN_140418da0(uVar3,&DAT_1404a8fb0,uVar4);
  }
  return 1;
}



undefined8 FUN_1401d5670(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined1 local_res18 [16];
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_2,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        iVar3 = FUN_140208e30(*local_20,param_2);
        if ((iVar3 != 0) && (lVar4 = FUN_140208860(*plVar1,iVar3), lVar4 != 0)) {
          if ((*(longlong *)(lVar4 + 0x130) == 0) ||
             (lVar4 = *(longlong *)(*(longlong *)(lVar4 + 0x130) + 0x930), lVar4 == 0)) {
            local_res18[0] = 0;
          }
          else {
            local_res18[0] = (undefined1)*(undefined4 *)(lVar4 + 0x48);
          }
          plVar5 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar5 + 0xa80))
                    (plVar5,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res18);
        }
        goto LAB_1401d5763;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d5763:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401d57a0(longlong param_1)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined1 local_res8 [8];
  undefined1 local_res10 [8];
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  undefined2 local_28 [4];
  undefined8 local_20;
  
  local_20 = 0xfffffffffffffffe;
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4f0);
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_140609435 == '\0') {
    uVar3 = 3;
  }
  else {
    if ((lVar1 == 0) || (*(char *)(lVar1 + 0x1a) == '\0')) {
      if ((DAT_14060b7f4 & 1) == 0) {
        DAT_14060b7f4 = DAT_14060b7f4 | 1;
        FUN_14015b4b0();
        atexit((_func_5014 *)&LAB_140448930);
      }
      local_res8[0] = DAT_140609434;
      local_res10[0] = 0;
      local_res18[0] = 0;
      local_res20[0] = 0;
      local_28[0] = 0;
      plVar2 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar2 + 0xaa0))
                (plVar2,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_28,local_res20,local_res18
                 ,local_res10,local_res8);
      return 1;
    }
    uVar3 = 1;
  }
  FUN_1401b83c0(param_1,uVar3);
  return 1;
}



undefined8
FUN_1401d58c0(undefined8 param_1,longlong *param_2,ulonglong *param_3,ushort *param_4,
             ushort *param_5)

{
  longlong *plVar1;
  ushort uVar2;
  ushort uVar3;
  ulonglong uVar4;
  void *pvVar5;
  longlong lVar6;
  int iVar7;
  longlong lVar8;
  ushort *puVar9;
  bool bVar10;
  int local_48;
  int local_44 [3];
  longlong *local_38;
  longlong *local_30;
  
  local_44[1] = -2;
  local_44[2] = -1;
  puVar9 = param_4;
  FUN_140197b70(param_1,&local_38);
  plVar1 = local_38;
  if (local_38 != (longlong *)0x0) {
    if (local_38 == local_30) {
      lVar6 = *local_38;
      if (lVar6 != 0) {
        uVar2 = *param_5;
        uVar3 = *puVar9;
        if ((uVar3 < 5) && (uVar2 < 0x18)) {
          FUN_14034ed40(lVar6 + 0xf630);
          lVar8 = ((longlong)(short)uVar2 + (longlong)(short)uVar3 * 0x18) * 0xac;
          uVar4 = *(ulonglong *)(lVar8 + lVar6);
          bVar10 = uVar4 < *param_3;
          if ((uVar4 == *param_3) &&
             (uVar4 = *(ulonglong *)(lVar8 + 8 + lVar6), bVar10 = uVar4 < param_3[1],
             uVar4 == param_3[1])) {
            iVar7 = 0;
          }
          else {
            iVar7 = (1 - (uint)bVar10) - (uint)(bVar10 != 0);
          }
          FUN_14034edd0(lVar6 + 0xf630);
          if ((iVar7 == 0) && ((param_2[1] - *param_2 & 0xfffffffffffffff0U) != 0)) {
            local_48 = (int)(short)*param_5;
            local_44[0] = (int)(short)*param_4;
            FUN_1401ae890(param_1,param_2,local_44,&local_48);
          }
        }
        goto LAB_1401d5a22;
      }
    }
    else {
      iVar7 = DAT_140608048 + 1;
      bVar10 = DAT_140608048 == 0;
      DAT_140608048 = iVar7;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_30) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d5a22:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    pvVar5 = (void *)*local_38;
    if (pvVar5 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar5 + 0xf630);
      operator_delete(pvVar5);
    }
    operator_delete(local_38);
  }
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001401d5cbc)

undefined8 FUN_1401d5a80(longlong param_1,undefined8 param_2,uint *param_3,short *param_4)

{
  uint uVar1;
  longlong lVar2;
  int iVar3;
  longlong *plVar4;
  longlong *plVar5;
  uint *puVar6;
  void *pvVar7;
  void *pvVar8;
  uint uVar9;
  bool bVar10;
  bool bVar11;
  uint local_a8;
  uint local_a4;
  void *local_a0;
  void *local_80;
  undefined8 local_78;
  undefined8 local_70;
  void *local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  uVar1 = *param_3;
  plVar4 = (longlong *)FUN_1402e0270();
  if (*plVar4 != 0) {
    for (puVar6 = *(uint **)(*plVar4 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0x90)) {
      if ((puVar6[0x92] == uVar1) && (*puVar6 == uVar1)) {
        if (puVar6 == (uint *)0x0) {
          return 1;
        }
        pvVar7 = (void *)0x0;
        if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if ((char)puVar6[0x71] == '\0') {
          return 1;
        }
        local_a0 = (void *)0x0;
        bVar11 = false;
        plVar4 = *(longlong **)(param_1 + 0xb28);
        if (plVar4 != (longlong *)0x0) {
          if (plVar4 == *(longlong **)(param_1 + 0xb30)) {
            if ((void *)*plVar4 != (void *)0x0) {
              local_a0 = (void *)*plVar4;
              if ((plVar4 != *(longlong **)(param_1 + 0xb30)) &&
                 (iVar3 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, local_a0 = pvVar7,
                 DAT_1406080a8 = iVar3, bVar11)) {
                FUN_140176d60(1);
              }
              FUN_14034ed40();
              bVar11 = true;
            }
          }
          else {
            iVar3 = DAT_1406080a8 + 1;
            bVar10 = DAT_1406080a8 == 0;
            DAT_1406080a8 = iVar3;
            if (bVar10) {
              FUN_140176d60(1);
            }
          }
        }
        if ((DAT_14060b7c4 & 1) == 0) {
          DAT_14060b7c4 = DAT_14060b7c4 | 1;
          FUN_140418590();
          atexit((_func_5014 *)&LAB_140448470);
        }
        if (((DAT_14060a120 == 0xcc) || (DAT_14060a120 == 0x68)) && (1 < *(byte *)(param_1 + 0x600))
           ) goto LAB_1401d5e0a;
        plVar4 = *(longlong **)(param_1 + 0x9c0);
        if (plVar4 == (longlong *)0x0) goto LAB_1401d5dba;
        LOCK();
        *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
        UNLOCK();
        if (*plVar4 == 0) goto LAB_1401d5dba;
        FUN_14025bcb0(*plVar4,param_1,*param_3);
        iVar3 = FUN_140258720(*plVar4,param_1,param_2,*param_3);
        if (iVar3 == 0) goto LAB_1401d5dba;
        local_a4 = 0;
        local_a8 = 0;
        local_60 = (void *)0x0;
        local_58 = 0;
        local_50 = 0;
        local_80 = (void *)0x0;
        local_78 = 0;
        local_70 = 0;
        uVar1 = *param_3;
        plVar5 = (longlong *)FUN_1402e0270();
        pvVar8 = pvVar7;
        uVar9 = 0;
        if (*plVar5 == 0) goto LAB_1401d5d63;
        puVar6 = *(uint **)(*plVar5 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar5 + 2)) * 8);
        goto LAB_1401d5c8a;
      }
    }
  }
  return 1;
LAB_1401d5c8a:
  uVar9 = 0;
  if (puVar6 == (uint *)0x0) {
LAB_1401d5d63:
    FUN_1401a4270(param_1,*param_3,(int)*param_4,local_a4,local_a8,uVar9,&local_60,&local_80);
    if (pvVar8 != (void *)0x0) {
      operator_delete(pvVar8);
    }
    if (pvVar7 != (void *)0x0) {
      operator_delete(pvVar7);
    }
LAB_1401d5dba:
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar5 = plVar4 + 1;
      lVar2 = *plVar5;
      *(int *)plVar5 = (int)*plVar5 + -1;
      UNLOCK();
      if ((int)lVar2 == 1) {
        pvVar7 = (void *)*plVar4;
        if (pvVar7 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar7 + 0x48);
          FUN_14025c370((longlong)pvVar7 + 0x20);
          FUN_14025c370(pvVar7);
          operator_delete(pvVar7);
        }
        operator_delete(plVar4);
      }
    }
LAB_1401d5e0a:
    if (!bVar11) {
      return 1;
    }
    FUN_14034edd0(local_a0);
    return 1;
  }
  if ((puVar6[0x92] == uVar1) && (*puVar6 == uVar1)) {
    pvVar8 = (void *)0x0;
    if (puVar6 != (uint *)0x0) {
      local_a4 = puVar6[0x58];
      if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      local_a8 = puVar6[0x59];
      if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar9 = puVar6[0x5a];
      if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_14012bb70(&local_60,puVar6 + 0x5c);
      if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_14012bb70(&local_80,puVar6 + 100);
      pvVar7 = local_60;
      pvVar8 = local_80;
    }
    goto LAB_1401d5d63;
  }
  puVar6 = *(uint **)(puVar6 + 0x90);
  goto LAB_1401d5c8a;
}



undefined8 FUN_1401d5e40(longlong param_1,int *param_2)

{
  short sVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  ulonglong uVar5;
  short *psVar6;
  longlong *plVar7;
  short *psVar8;
  undefined2 local_88;
  undefined6 uStack_86;
  undefined8 local_78;
  ulonglong local_70;
  undefined2 local_60;
  undefined6 uStack_5e;
  undefined8 local_50;
  ulonglong local_48;
  void *local_38 [3];
  ulonglong local_20;
  undefined8 local_10;
  
  local_10 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0xb58) != 0) &&
     (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0xb58) + 0x30), lVar3 != 0)) {
    lVar4 = *(longlong *)(lVar3 + 0x2f8);
    iVar2 = *param_2;
    if (iVar2 != 0) {
      if (iVar2 != 1) {
        if (iVar2 == 2) {
          plVar7 = (longlong *)(lVar4 + 8);
          if (7 < *(ulonglong *)(lVar4 + 0x20)) {
            plVar7 = (longlong *)*plVar7;
          }
          local_48 = 7;
          local_50 = 0;
          local_60 = 0;
          uVar5 = 0xffffffffffffffff;
          psVar6 = (short *)plVar7;
          do {
            if (uVar5 == 0) break;
            uVar5 = uVar5 - 1;
            sVar1 = *psVar6;
            psVar6 = psVar6 + 1;
          } while (sVar1 != 0);
          FUN_140001710(&local_60,plVar7,~uVar5 - 1);
          FUN_140415220(local_38,&local_60);
          if (7 < local_48) {
            operator_delete((void *)CONCAT62(uStack_5e,local_60));
          }
          local_48 = 7;
          local_50 = 0;
          local_60 = 0;
          FUN_140272770(lVar4);
        }
        else {
          if (iVar2 != 3) {
            return 1;
          }
          psVar6 = (short *)(*(longlong *)(lVar3 + 0x300) + 0x18);
          if (7 < *(ulonglong *)(*(longlong *)(lVar3 + 0x300) + 0x30)) {
            psVar6 = *(short **)psVar6;
          }
          local_70 = 7;
          local_78 = 0;
          local_88 = 0;
          uVar5 = 0xffffffffffffffff;
          psVar8 = psVar6;
          do {
            if (uVar5 == 0) break;
            uVar5 = uVar5 - 1;
            sVar1 = *psVar8;
            psVar8 = psVar8 + 1;
          } while (sVar1 != 0);
          FUN_140001710(&local_88,psVar6,~uVar5 - 1);
          FUN_140415220(local_38,&local_88);
          if (7 < local_70) {
            operator_delete((void *)CONCAT62(uStack_86,local_88));
          }
          local_70 = 7;
          local_78 = 0;
          local_88 = 0;
          FUN_1402727a0(*(undefined8 *)(lVar3 + 0x300));
        }
        if (local_20 < 0x10) {
          return 1;
        }
        operator_delete(local_38[0]);
        return 1;
      }
      FUN_1402727a0(*(undefined8 *)(lVar3 + 0x300));
    }
    FUN_140272770(lVar4);
  }
  return 1;
}



undefined8 FUN_1401d5ff0(longlong param_1,int *param_2,undefined8 *param_3,undefined8 param_4)

{
  char cVar1;
  longlong lVar2;
  ulonglong uVar3;
  char *pcVar4;
  undefined8 ***pppuVar5;
  char *pcVar6;
  undefined1 local_60;
  undefined7 uStack_5f;
  undefined8 local_50;
  ulonglong local_48;
  undefined8 **local_38 [3];
  ulonglong local_20;
  
  if (((*(longlong *)(param_1 + 0xb58) != 0) &&
      (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb58) + 0x30), lVar2 != 0)) && (*param_2 == 0)
     ) {
    pcVar4 = (char *)*param_3;
    if ((char *)*param_3 == (char *)0x0) {
      pcVar4 = PTR_DAT_1405d8008;
    }
    local_48 = 0xf;
    local_50 = 0;
    local_60 = 0;
    uVar3 = 0xffffffffffffffff;
    pcVar6 = pcVar4;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      cVar1 = *pcVar6;
      pcVar6 = pcVar6 + 1;
    } while (cVar1 != '\0');
    FUN_140003e50(&local_60,pcVar4,~uVar3 - 1,param_4,0xfffffffffffffffe);
    FUN_140415310(local_38,&local_60);
    if (0xf < local_48) {
      operator_delete((void *)CONCAT71(uStack_5f,local_60));
    }
    local_48 = 0xf;
    local_50 = 0;
    local_60 = 0;
    pppuVar5 = local_38;
    if (7 < local_20) {
      pppuVar5 = (undefined8 ***)local_38[0];
    }
    FUN_140272720(*(undefined8 *)(lVar2 + 0x2f8),pppuVar5);
    if (7 < local_20) {
      operator_delete(local_38[0]);
    }
  }
  return 1;
}



undefined8 FUN_1401d60f0(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  errno_t eVar4;
  undefined8 *puVar5;
  longlong *plVar6;
  bool bVar7;
  double dVar8;
  __time64_t local_res18;
  short local_90;
  short local_8e;
  undefined2 local_8c;
  undefined2 local_8a;
  undefined2 local_88;
  undefined2 local_86;
  undefined2 local_84;
  undefined2 local_82;
  longlong *local_80;
  longlong *local_78;
  double local_70;
  undefined4 local_68;
  undefined8 local_60;
  undefined8 local_58;
  tm local_50;
  
  FUN_140198570(param_1,&local_80);
  plVar1 = local_80;
  if (local_80 != (longlong *)0x0) {
    if (local_80 == local_78) {
      if ((longlong *)*local_80 != (longlong *)0x0) {
        puVar5 = (undefined8 *)(**(code **)(*(longlong *)*local_80 + 0x270))();
        if (puVar5 != (undefined8 *)0x0) {
          local_res18 = _time64((__time64_t *)0x0);
          local_70 = 0.0;
          local_68 = 0;
          eVar4 = _localtime64_s(&local_50,&local_res18);
          if (eVar4 == 0) {
            local_90 = (short)local_50.tm_year + 0x76c;
            local_8e = (short)local_50.tm_mon + 1;
            local_8c = (undefined2)local_50.tm_wday;
            local_8a = (undefined2)local_50.tm_mday;
            local_88 = (undefined2)local_50.tm_hour;
            local_86 = (undefined2)local_50.tm_min;
            local_84 = (undefined2)local_50.tm_sec;
            local_82 = 0;
            iVar3 = Ordinal_184(&local_90,&local_70);
            local_60 = 0;
            local_58 = 0;
            if (iVar3 != 0) {
              Ordinal_185(local_70,&local_60);
            }
          }
          dVar8 = (double)param_2[3] - local_70;
          if (dVar8 < 0.0) {
            dVar8 = 0.0;
          }
          *(undefined4 *)(puVar5 + 1) = *(undefined4 *)(param_2 + 1);
          *puVar5 = *param_2;
          *(undefined4 *)(puVar5 + 1) = *(undefined4 *)(param_2 + 1);
          *(undefined4 *)((longlong)puVar5 + 0xc) = *(undefined4 *)((longlong)param_2 + 0xc);
          *(undefined4 *)(puVar5 + 2) = *(undefined4 *)(param_2 + 2);
          *(undefined4 *)((longlong)puVar5 + 0x14) = *(undefined4 *)((longlong)param_2 + 0x14);
          puVar5[3] = dVar8;
          *(undefined4 *)(puVar5 + 4) = *(undefined4 *)((longlong)param_2 + 0x24);
          *(undefined4 *)((longlong)puVar5 + 0x24) = *(undefined4 *)(param_2 + 4);
          *(undefined4 *)(puVar5 + 5) = *(undefined4 *)((longlong)param_2 + 0x2c);
          *(undefined4 *)((longlong)puVar5 + 0x2c) = *(undefined4 *)(param_2 + 5);
          *(undefined4 *)(puVar5 + 6) = *(undefined4 *)((longlong)param_2 + 0x34);
          *(undefined4 *)((longlong)puVar5 + 0x34) = *(undefined4 *)(param_2 + 6);
          *(undefined4 *)(puVar5 + 7) = *(undefined4 *)((longlong)param_2 + 0x3c);
          *(undefined4 *)((longlong)puVar5 + 0x3c) = *(undefined4 *)(param_2 + 7);
          *(undefined4 *)(puVar5 + 8) = *(undefined4 *)((longlong)param_2 + 0x44);
          *(undefined4 *)((longlong)puVar5 + 0x44) = *(undefined4 *)(param_2 + 8);
          *(undefined4 *)(puVar5 + 9) = *(undefined4 *)((longlong)param_2 + 0x4c);
          *(undefined4 *)((longlong)puVar5 + 0x4c) = *(undefined4 *)(param_2 + 9);
          *(undefined4 *)(puVar5 + 10) = *(undefined4 *)((longlong)param_2 + 0x54);
          *(undefined4 *)((longlong)puVar5 + 0x54) = *(undefined4 *)(param_2 + 10);
          plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x380);
          (**(code **)(*plVar6 + 0x410))
                    (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_1 + 8,puVar5);
          (**(code **)(**(longlong **)(param_1 + 0xb50) + 600))
                    (*(longlong **)(param_1 + 0xb50),*(undefined4 *)(param_1 + 8));
        }
        goto LAB_1401d6348;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_78) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d6348:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar2 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar2 == 1) {
    puVar5 = (undefined8 *)*local_80;
    if (puVar5 != (undefined8 *)0x0) {
      (**(code **)*puVar5)(puVar5,1);
    }
    operator_delete(local_80);
  }
  return 1;
}



undefined8 FUN_1401d63a0(longlong param_1,longlong *param_2)

{
  int *piVar1;
  short sVar2;
  undefined8 *puVar3;
  void *pvVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  int iVar7;
  longlong lVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong lVar11;
  ulonglong uVar12;
  uint uVar13;
  ulonglong uVar14;
  ulonglong uVar15;
  longlong *plVar16;
  ulonglong uVar17;
  bool bVar18;
  uint local_res8;
  longlong *local_80;
  longlong *local_78;
  longlong *local_70;
  longlong *local_68;
  longlong local_60;
  char local_58;
  undefined8 *local_50;
  undefined8 *local_48;
  
  local_60 = 0;
  local_58 = '\0';
  plVar10 = *(longlong **)(param_1 + 0xb28);
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == *(longlong **)(param_1 + 0xb30)) {
      lVar11 = *plVar10;
      if (lVar11 != 0) {
        if (plVar10 != *(longlong **)(param_1 + 0xb30)) {
          iVar7 = DAT_1406080a8 + 1;
          bVar18 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar7;
          if (bVar18) {
            FUN_140176d60(1);
          }
          lVar11 = 0;
        }
        local_58 = 0;
        local_60 = lVar11;
        FUN_14034ed40();
        local_58 = '\x01';
      }
    }
    else {
      iVar7 = DAT_1406080a8 + 1;
      bVar18 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar7;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  uVar12 = 0;
  FUN_140197b70(param_1,&local_80);
  plVar16 = local_78;
  plVar9 = local_80;
  plVar10 = *(longlong **)(param_1 + 0x9d0);
  if (plVar10 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar10 + 1) = (int)plVar10[1] + 1;
    UNLOCK();
  }
  puVar3 = *(undefined8 **)(param_1 + 0x9f0);
  if (puVar3 != (undefined8 *)0x0) {
    LOCK();
    *(int *)(puVar3 + 1) = *(int *)(puVar3 + 1) + 1;
    UNLOCK();
  }
  local_res8 = (uint)uVar12;
  uVar14 = uVar12 & 0xffffffff;
  lVar11 = *param_2;
  uVar15 = uVar12;
  uVar17 = uVar12;
  local_70 = plVar10;
  local_68 = plVar10;
  local_50 = puVar3;
  local_48 = puVar3;
  if ((param_2[1] - lVar11) / 0x97 != 0) {
    do {
      iVar7 = DAT_140608048;
      uVar13 = (uint)uVar14;
      sVar2 = *(short *)(lVar11 + 0x10 + uVar17);
      if (sVar2 == 0) {
        sVar2 = *(short *)(lVar11 + 0x12 + uVar17);
        if (((short)uVar15 <= sVar2) && (sVar2 < 0x18)) {
          FUN_1401aa9d0(param_1,(int)sVar2,*(undefined4 *)(lVar11 + 0x14 + uVar17),
                        (int)*(short *)(lVar11 + 0x22 + uVar17));
          lVar11 = *param_2;
          uVar13 = local_res8;
          if (*(short *)(lVar11 + 0x12 + uVar17) == 0x14) {
            FUN_1401aab20(param_1,*(undefined4 *)(lVar11 + 0x24 + uVar17),
                          *(undefined4 *)(lVar11 + 0x2c + uVar17),
                          *(undefined4 *)(lVar11 + 0x34 + uVar17),
                          *(undefined4 *)(lVar11 + 0x28 + uVar17),
                          *(undefined4 *)(lVar11 + 0x30 + uVar17),
                          *(undefined4 *)(lVar11 + 0x38 + uVar17));
          }
        }
        iVar7 = DAT_140608048;
        if (plVar9 != (longlong *)0x0) {
          if (plVar9 == plVar16) {
            lVar8 = *plVar9;
            if (lVar8 != 0) {
              lVar11 = uVar12 * 0x97 + *param_2;
LAB_1401d6683:
              FUN_1401e7d60(lVar8,lVar11);
              uVar13 = local_res8;
            }
          }
          else {
            DAT_140608048 = DAT_140608048 + 1;
            if (iVar7 == 0) {
              FUN_140176d60(1);
              uVar13 = local_res8;
            }
          }
        }
      }
      else if ((sVar2 == 1) || (sVar2 == 2)) {
        if (plVar9 != (longlong *)0x0) {
          if (plVar9 == plVar16) {
            lVar8 = *plVar9;
            if (lVar8 != 0) {
              lVar11 = lVar11 + uVar12 * 0x97;
              goto LAB_1401d6683;
            }
          }
          else {
            DAT_140608048 = DAT_140608048 + 1;
            if (iVar7 == 0) {
              FUN_140176d60(1);
              uVar13 = local_res8;
            }
          }
        }
      }
      else if (sVar2 == 5) {
        if (plVar9 != (longlong *)0x0) {
          if (plVar9 == plVar16) {
            if (*plVar9 != 0) {
              FUN_1401e7fb0(*plVar9,lVar11 + uVar12 * 0x97);
              uVar13 = local_res8;
            }
          }
          else {
            DAT_140608048 = DAT_140608048 + 1;
            if (iVar7 == 0) {
              FUN_140176d60(1);
              uVar13 = local_res8;
            }
          }
        }
      }
      else if (((sVar2 == 0x15) && (plVar10 != (longlong *)0x0)) && (*plVar10 != 0)) {
        FUN_140263610(*plVar10,lVar11 + uVar12 * 0x97);
        uVar13 = local_res8;
      }
      local_res8 = uVar13 + 1;
      uVar14 = (ulonglong)local_res8;
      lVar11 = *param_2;
      uVar12 = (ulonglong)local_res8;
      uVar15 = 0;
      uVar17 = uVar17 + 0x97;
    } while (uVar12 < (ulonglong)((param_2[1] - lVar11) / 0x97));
  }
  puVar6 = local_50;
  if (puVar3 != (undefined8 *)0x0) {
    LOCK();
    piVar1 = (int *)(puVar3 + 1);
    iVar7 = *piVar1;
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    plVar9 = local_80;
    plVar10 = local_70;
    plVar16 = local_78;
    if (iVar7 == 1) {
      pvVar4 = (void *)*local_50;
      if (pvVar4 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar4 + 0x9130);
        operator_delete(pvVar4);
      }
      operator_delete(puVar6);
      plVar9 = local_80;
      plVar10 = local_70;
      plVar16 = local_78;
    }
  }
  plVar5 = local_70;
  if (plVar10 != (longlong *)0x0) {
    LOCK();
    plVar10 = plVar10 + 1;
    lVar11 = *plVar10;
    *(int *)plVar10 = (int)*plVar10 + -1;
    UNLOCK();
    plVar9 = local_80;
    plVar16 = local_78;
    if ((int)lVar11 == 1) {
      pvVar4 = (void *)*local_70;
      if (pvVar4 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar4 + 0x9130);
        operator_delete(pvVar4);
      }
      operator_delete(plVar5);
      plVar9 = local_80;
      plVar16 = local_78;
    }
  }
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == plVar16) {
      LOCK();
      plVar9 = plVar9 + 1;
      *(int *)plVar9 = (int)*plVar9 + -1;
      UNLOCK();
      if ((int)*plVar9 == 0) {
        pvVar4 = (void *)*local_80;
        if (pvVar4 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar4 + 0xf630);
          operator_delete(pvVar4);
        }
        operator_delete(local_80);
      }
    }
    else {
      iVar7 = DAT_140608050 + 1;
      bVar18 = DAT_140608050 == 0;
      DAT_140608050 = iVar7;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_58 != '\0') {
    FUN_14034edd0(local_60);
  }
  return 1;
}



undefined8 FUN_1401d67f0(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  ulonglong *puVar2;
  undefined8 *puVar3;
  void *pvVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  int iVar7;
  int iVar8;
  ulonglong uVar9;
  longlong *plVar10;
  ulonglong uVar11;
  longlong *plVar12;
  longlong lVar13;
  longlong *plVar14;
  bool bVar15;
  undefined8 uVar16;
  longlong *local_70;
  longlong *local_68;
  longlong *local_60;
  longlong *local_58;
  ulonglong local_50;
  char local_48;
  undefined8 *local_40;
  undefined8 *local_38;
  
  uVar16 = 0xfffffffffffffffe;
  uVar11 = 0;
  local_50 = 0;
  local_48 = '\0';
  puVar2 = *(ulonglong **)(param_1 + 0xb28);
  if (puVar2 != (ulonglong *)0x0) {
    if (puVar2 == *(ulonglong **)(param_1 + 0xb30)) {
      if (*puVar2 != 0) {
        uVar9 = *puVar2;
        if ((puVar2 != *(ulonglong **)(param_1 + 0xb30)) &&
           (iVar7 = DAT_1406080a8 + 1, bVar15 = DAT_1406080a8 == 0, uVar9 = uVar11,
           DAT_1406080a8 = iVar7, bVar15)) {
          FUN_140176d60(1);
        }
        local_48 = 0;
        local_50 = uVar9;
        FUN_14034ed40();
        local_48 = '\x01';
      }
    }
    else {
      iVar7 = DAT_1406080a8 + 1;
      bVar15 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar7;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140197b70(param_1,&local_70);
  plVar14 = local_68;
  plVar10 = local_70;
  plVar12 = *(longlong **)(param_1 + 0x9b0);
  if (plVar12 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar12 + 1) = (int)plVar12[1] + 1;
    UNLOCK();
  }
  puVar3 = *(undefined8 **)(param_1 + 0x9d0);
  if (puVar3 != (undefined8 *)0x0) {
    LOCK();
    *(int *)(puVar3 + 1) = *(int *)(puVar3 + 1) + 1;
    UNLOCK();
  }
  lVar13 = *param_2;
  uVar9 = uVar11;
  local_60 = plVar12;
  local_58 = plVar12;
  local_40 = puVar3;
  local_38 = puVar3;
  if (param_2[1] - lVar13 >> 5 != 0) {
    do {
      iVar7 = DAT_140608048;
      iVar8 = (int)*(short *)(uVar9 + 0x10 + lVar13);
      if (2 < iVar8) {
        if (iVar8 < 5) {
          if (plVar10 != (longlong *)0x0) {
            if (plVar10 == plVar14) {
              if (*plVar10 != 0) {
                FUN_1401e79a0(*plVar10,uVar11 * 0x20 + lVar13,lVar13,param_4,uVar16);
              }
            }
            else {
              DAT_140608048 = DAT_140608048 + 1;
              if (iVar7 == 0) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else if (iVar8 == 6) {
          if (plVar10 != (longlong *)0x0) {
            if (plVar10 == plVar14) {
              if (*plVar10 != 0) {
                FUN_1401e7c00(*plVar10,uVar11 * 0x20 + lVar13);
              }
            }
            else {
              DAT_140608048 = DAT_140608048 + 1;
              if (iVar7 == 0) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else if (((iVar8 - 0xbU < 3) && (plVar12 != (longlong *)0x0)) && (*plVar12 != 0)) {
          FUN_14025f270(*plVar12,uVar11 * 0x20 + lVar13,(int)*(short *)(uVar9 + 0x10 + lVar13));
        }
      }
      uVar11 = (ulonglong)((int)uVar11 + 1);
      lVar13 = *param_2;
      uVar9 = uVar9 + 0x20;
    } while (uVar11 < (ulonglong)(param_2[1] - lVar13 >> 5));
  }
  puVar6 = local_40;
  if (puVar3 != (undefined8 *)0x0) {
    LOCK();
    piVar1 = (int *)(puVar3 + 1);
    iVar7 = *piVar1;
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    plVar10 = local_70;
    plVar12 = local_60;
    plVar14 = local_68;
    if (iVar7 == 1) {
      pvVar4 = (void *)*local_40;
      if (pvVar4 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar4 + 0x9130);
        operator_delete(pvVar4);
      }
      operator_delete(puVar6);
      plVar10 = local_70;
      plVar12 = local_60;
      plVar14 = local_68;
    }
  }
  plVar5 = local_60;
  if (plVar12 != (longlong *)0x0) {
    LOCK();
    plVar12 = plVar12 + 1;
    lVar13 = *plVar12;
    *(int *)plVar12 = (int)*plVar12 + -1;
    UNLOCK();
    plVar10 = local_70;
    plVar14 = local_68;
    if ((int)lVar13 == 1) {
      pvVar4 = (void *)*local_60;
      if (pvVar4 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar4 + 0x4b18);
        operator_delete(pvVar4);
      }
      operator_delete(plVar5);
      plVar10 = local_70;
      plVar14 = local_68;
    }
  }
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == plVar14) {
      LOCK();
      plVar10 = plVar10 + 1;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      if ((int)*plVar10 == 0) {
        pvVar4 = (void *)*local_70;
        if (pvVar4 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar4 + 0xf630);
          operator_delete(pvVar4);
        }
        operator_delete(local_70);
      }
    }
    else {
      iVar7 = DAT_140608050 + 1;
      bVar15 = DAT_140608050 == 0;
      DAT_140608050 = iVar7;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_48 != '\0') {
    FUN_14034edd0(local_50);
  }
  return 1;
}



undefined8 FUN_1401d6b00(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  longlong *plVar4;
  int iVar5;
  longlong lVar6;
  undefined4 uVar7;
  bool bVar8;
  bool bVar9;
  longlong local_40;
  longlong *local_30;
  longlong *local_28;
  
  local_40 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      lVar6 = *plVar1;
      if (lVar6 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar6 = 0, DAT_1406080a8 = iVar5,
           bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar6);
        bVar9 = true;
        local_40 = lVar6;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  uVar7 = 1;
  if (*(longlong *)(param_1 + 0xb58) != 0) {
    uVar7 = *(undefined4 *)(*(longlong *)(param_1 + 0xb58) + 0x90);
  }
  plVar1 = *(longlong **)(param_1 + 0x9a0);
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
    UNLOCK();
    if (*plVar1 != 0) {
      FUN_14025cba0(*plVar1,param_2);
      plVar2 = *(longlong **)(param_1 + 0x9b0);
      local_30 = plVar2;
      local_28 = plVar2;
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
        UNLOCK();
        if (*plVar2 != 0) {
          FUN_14025cd10(*plVar1,&local_30);
        }
      }
      FUN_14025d710(*plVar1,param_1);
      FUN_14019c070(param_1,uVar7);
      plVar4 = local_30;
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        plVar2 = plVar2 + 1;
        lVar6 = *plVar2;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)lVar6 == 1) {
          pvVar3 = (void *)*local_30;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0x4b18);
            operator_delete(pvVar3);
          }
          operator_delete(plVar4);
        }
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    plVar2 = plVar1 + 1;
    *(int *)plVar2 = (int)*plVar2 + -1;
    UNLOCK();
    if ((int)*plVar2 == 0) {
      pvVar3 = (void *)*plVar1;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0x90);
        FUN_14025e6b0((longlong)pvVar3 + 0x48);
        FUN_14025e600(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar1);
    }
  }
  if (bVar9) {
    FUN_14034edd0(local_40);
  }
  return 1;
}



undefined8 FUN_1401d6d10(longlong *param_1)

{
  void *pvVar1;
  undefined8 *puVar2;
  code *pcVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined8 uVar8;
  int *piVar9;
  longlong *plVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  longlong *plVar13;
  longlong *plVar14;
  longlong lVar15;
  undefined4 *puVar16;
  int iVar17;
  longlong *plVar18;
  uint uVar19;
  void *pvVar20;
  undefined4 *puVar21;
  longlong *plVar22;
  uint uVar23;
  bool bVar25;
  undefined2 local_res10 [4];
  undefined2 local_res18 [4];
  int local_res20 [2];
  undefined4 *local_1b8;
  undefined4 *local_1b0;
  undefined4 *local_1a8;
  longlong *local_198;
  uint local_190;
  undefined4 local_18c;
  int *local_188;
  int *local_180;
  int *local_178;
  longlong *local_168;
  longlong *local_160;
  void *local_158;
  int local_150 [2];
  int local_148 [2];
  longlong *local_140;
  int local_138 [2];
  uint local_130 [2];
  int local_128 [2];
  longlong *local_120;
  char local_118;
  longlong *local_110;
  longlong *local_108;
  undefined4 local_100;
  undefined4 uStack_fc;
  undefined4 local_f8;
  undefined4 uStack_f4;
  longlong *local_f0;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined8 local_d4;
  undefined8 local_cc;
  undefined8 local_c4;
  undefined8 local_bc;
  undefined4 local_b4;
  int local_b0 [10];
  longlong local_88;
  undefined1 local_80;
  longlong *local_78;
  longlong *local_70;
  undefined8 local_68;
  longlong local_60;
  undefined1 local_58;
  longlong *plVar24;
  
  local_68 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_168);
  plVar10 = local_168;
  local_198 = local_168;
  if (local_168 != (longlong *)0x0) {
    if (local_168 == local_160) {
      if (*local_168 != 0) {
        plVar18 = (longlong *)0x0;
        local_120 = (longlong *)0x0;
        local_118 = '\0';
        plVar13 = (longlong *)param_1[0x165];
        if (plVar13 != (longlong *)0x0) {
          if (plVar13 == (longlong *)param_1[0x166]) {
            if ((longlong *)*plVar13 != (longlong *)0x0) {
              plVar22 = (longlong *)*plVar13;
              if ((plVar13 != (longlong *)param_1[0x166]) &&
                 (iVar4 = DAT_1406080a8 + 1, bVar25 = DAT_1406080a8 == 0, plVar22 = plVar18,
                 DAT_1406080a8 = iVar4, bVar25)) {
                FUN_140176d60(1);
              }
              local_118 = 0;
              local_120 = plVar22;
              FUN_14034ed40();
              local_118 = '\x01';
            }
          }
          else {
            iVar4 = DAT_1406080a8 + 1;
            bVar25 = DAT_1406080a8 == 0;
            DAT_1406080a8 = iVar4;
            if (bVar25) {
              FUN_140176d60(1);
            }
          }
        }
        local_18c = 1;
        if (param_1[0x16b] != 0) {
          local_18c = *(undefined4 *)(param_1[0x16b] + 0x90);
        }
        iVar17 = 0;
        local_res20[0] = 0;
        lVar7 = (**(code **)(*(longlong *)*plVar10 + 0x270))();
        iVar4 = *(int *)(lVar7 + 0x70);
        local_res20[0] = iVar4;
        local_150[0] = iVar4;
        lVar7 = (**(code **)(*(longlong *)*plVar10 + 0x270))();
        local_138[0] = 0;
        piVar9 = local_138;
        if (-1 < iVar4) {
          piVar9 = local_150;
        }
        *(int *)(lVar7 + 0x6c) = *piVar9;
        FUN_1402d6b80(*plVar10);
        plVar10 = (longlong *)param_1[0x134];
        plVar13 = local_198;
        plVar22 = param_1;
        local_140 = plVar10;
        local_110 = plVar10;
        local_108 = plVar10;
        if (plVar10 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar10 + 1) = (int)plVar10[1] + 1;
          UNLOCK();
          local_198 = local_168;
          plVar13 = local_168;
          if (*plVar10 != 0) {
            FUN_14025d2b0();
            local_100 = (undefined4)param_1[0x2e];
            uStack_fc = *(undefined4 *)((longlong)param_1 + 0x174);
            local_f8 = (undefined4)param_1[0x2f];
            uStack_f4 = *(undefined4 *)((longlong)param_1 + 0x17c);
            iVar4 = *(int *)((longlong)param_1 + 0x284);
            local_148[0] = local_res20[0];
            local_128[0] = local_res20[0];
            if ((-1 < iVar4) && (iVar4 < *(short *)(param_1[0x16a] + 700))) {
              if ((param_1[0x2e] != 0) || (iVar5 = iVar17, param_1[0x2f] != 0)) {
                iVar5 = 1;
              }
              if ((iVar5 != 0) && (lVar7 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar7 != 0)) {
                local_res10[0] = (undefined2)iVar4;
                plVar10 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar7 + 8) + (longlong)(int)param_1[0x51] * 8) + 0x70);
                (**(code **)(*plVar10 + 0x240))
                          (plVar10,1,&DAT_1405d85a0,local_res10,&local_100,local_128,local_148);
              }
            }
            plVar10 = local_168;
            plVar24 = (longlong *)param_1[0x136];
            local_f0 = plVar24;
            local_78 = plVar24;
            local_70 = plVar24;
            if (plVar24 != (longlong *)0x0) {
              LOCK();
              *(int *)(plVar24 + 1) = (int)plVar24[1] + 1;
              UNLOCK();
              local_198 = local_168;
              local_140 = local_110;
              if (*plVar24 != 0) {
                FUN_14025f0a0(*plVar24,param_1);
                (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x580))
                          ((longlong *)(param_1[0x16a] + 0x78),(int)param_1[1],&DAT_1405d85a0,
                           local_res20);
                local_b0[0] = 0;
                local_b0[1] = 0;
                local_b0[2] = 0;
                local_b0[3] = 0;
                local_b0[4] = 0;
                local_b0[5] = 0;
                local_b0[6] = 0;
                local_b0[7] = 0;
                local_b0[8] = 0;
                local_b0[9] = 0;
                local_d8 = 0xffffffff;
                local_d4 = 0;
                local_cc = 0;
                local_c4 = 0;
                local_bc = 0;
                local_b4 = 0;
                lVar7 = (**(code **)(*(longlong *)*plVar10 + 0x270))();
                uVar6 = *(undefined4 *)(lVar7 + 0x58);
                lVar7 = *(longlong *)(*plVar10 + 0x130);
                if (lVar7 != 0) {
                  iVar17 = *(int *)(lVar7 + 0x200);
                }
                uVar8 = FUN_1402ecb70();
                FUN_1402ec700(uVar8,iVar17,uVar6,local_b0,&local_d8);
                plVar10 = plVar18;
                plVar13 = plVar18;
                do {
                  if (*(int *)((longlong)local_b0 + (longlong)plVar10) < 1) break;
                  FUN_14016f4e0(param_1[0x16a],param_1,
                                *(int *)((longlong)local_b0 + (longlong)plVar10),
                                *(undefined4 *)((longlong)&local_d8 + (longlong)plVar10));
                  uVar19 = (int)plVar13 + 1;
                  plVar13 = (longlong *)(ulonglong)uVar19;
                  plVar10 = (longlong *)((longlong)plVar10 + 4);
                } while ((int)uVar19 < 10);
                local_190 = 0;
                local_158 = (void *)0x0;
                plVar10 = plVar18;
                plVar13 = plVar24;
                do {
                  pvVar1 = local_158;
                  local_188 = (int *)0x0;
                  local_180 = (int *)0x0;
                  local_178 = (int *)0x0;
                  local_1b8 = (undefined4 *)0x0;
                  local_1b0 = (undefined4 *)0x0;
                  local_1a8 = (undefined4 *)0x0;
                  lVar7 = *plVar13;
                  local_88 = lVar7 + 0x4b18;
                  FUN_14034ed40(local_88);
                  local_80 = 1;
                  pvVar20 = pvVar1;
                  uVar19 = (uint)plVar10;
                  if ((uint)plVar10 < 3) {
                    puVar21 = local_1b8;
                    plVar22 = plVar18;
                    plVar24 = plVar18;
                    do {
                      piVar9 = (int *)(lVar7 + ((longlong)pvVar1 * 0x20 + 2 + (longlong)plVar22) * 4
                                      );
                      if ((piVar9 < local_180) && (local_188 <= piVar9)) {
                        lVar15 = (longlong)piVar9 - (longlong)local_188;
                        if (local_180 == local_178) {
                          uVar11 = (longlong)local_180 - (longlong)local_188 >> 2;
                          if (0x3ffffffffffffffe < uVar11) {
                            std::_Xlength_error("vector<T> too long");
                            pcVar3 = (code *)swi(3);
                            uVar8 = (*pcVar3)();
                            return uVar8;
                          }
                          plVar10 = (longlong *)(uVar11 + 1);
                          plVar13 = (longlong *)((longlong)local_178 - (longlong)local_188 >> 2);
                          if (plVar13 < plVar10) {
                            plVar14 = plVar18;
                            if (plVar13 <=
                                (longlong *)(0x3fffffffffffffff - ((ulonglong)plVar13 >> 1))) {
                              plVar14 = (longlong *)((longlong)plVar13 + ((ulonglong)plVar13 >> 1));
                            }
                            if (plVar14 < plVar10) {
                              plVar14 = plVar10;
                            }
                            FUN_140051e60(&local_188,plVar14);
                            puVar21 = local_1b8;
                          }
                        }
                        if (local_180 != (int *)0x0) {
                          iVar4 = local_188[lVar15 >> 2];
LAB_1401d728a:
                          *local_180 = iVar4;
                          puVar21 = local_1b8;
                        }
                      }
                      else {
                        if (local_180 == local_178) {
                          uVar11 = (longlong)local_180 - (longlong)local_188 >> 2;
                          if (0x3ffffffffffffffe < uVar11) {
                            std::_Xlength_error("vector<T> too long");
                            pcVar3 = (code *)swi(3);
                            uVar8 = (*pcVar3)();
                            return uVar8;
                          }
                          plVar10 = (longlong *)(uVar11 + 1);
                          plVar13 = (longlong *)((longlong)local_178 - (longlong)local_188 >> 2);
                          if (plVar13 < plVar10) {
                            plVar14 = plVar18;
                            if (plVar13 <=
                                (longlong *)(0x3fffffffffffffff - ((ulonglong)plVar13 >> 1))) {
                              plVar14 = (longlong *)((longlong)plVar13 + ((ulonglong)plVar13 >> 1));
                            }
                            if (plVar14 < plVar10) {
                              plVar14 = plVar10;
                            }
                            FUN_140051e60(&local_188,plVar14);
                            puVar21 = local_1b8;
                          }
                        }
                        if (local_180 != (int *)0x0) {
                          iVar4 = *piVar9;
                          goto LAB_1401d728a;
                        }
                      }
                      local_180 = local_180 + 1;
                      if (*piVar9 == 1) {
                        puVar16 = (undefined4 *)
                                  ((longlong)(plVar22 + (longlong)pvVar1 * 4) * 0xac + 0xa88 + lVar7
                                  );
                        if ((puVar16 < local_1b0) && (puVar21 <= puVar16)) {
                          uVar11 = (longlong)puVar16 - (longlong)puVar21;
                          if (local_1b0 == local_1a8) {
                            uVar12 = (longlong)local_1b0 - (longlong)puVar21 >> 4;
                            if (0xffffffffffffffe < uVar12) {
                              std::_Xlength_error("vector<T> too long");
                              pcVar3 = (code *)swi(3);
                              uVar8 = (*pcVar3)();
                              return uVar8;
                            }
                            goto LAB_1401d72f7;
                          }
                          goto LAB_1401d7341;
                        }
                        if (local_1b0 == local_1a8) {
                          uVar11 = (longlong)local_1b0 - (longlong)puVar21 >> 4;
                          if (0xffffffffffffffe < uVar11) {
                            std::_Xlength_error("vector<T> too long");
                            pcVar3 = (code *)swi(3);
                            uVar8 = (*pcVar3)();
                            return uVar8;
                          }
LAB_1401d7393:
                          plVar10 = (longlong *)(uVar11 + 1);
                          plVar13 = (longlong *)((longlong)local_1a8 - (longlong)puVar21 >> 4);
                          if (plVar13 < plVar10) {
                            plVar14 = plVar18;
                            if (plVar13 <=
                                (longlong *)(0xfffffffffffffff - ((ulonglong)plVar13 >> 1))) {
                              plVar14 = (longlong *)((longlong)plVar13 + ((ulonglong)plVar13 >> 1));
                            }
                            if (plVar14 < plVar10) {
                              plVar14 = plVar10;
                            }
                            FUN_1402d2250(&local_1b8,plVar14);
                            puVar21 = local_1b8;
                          }
                        }
LAB_1401d7348:
                        if (local_1b0 != (undefined4 *)0x0) {
                          *local_1b0 = *puVar16;
                          local_1b0[1] = puVar16[1];
                          local_1b0[2] = puVar16[2];
                          uVar6 = puVar16[3];
LAB_1401d7545:
                          local_1b0[3] = uVar6;
                          puVar21 = local_1b8;
                        }
                      }
                      else {
                        if (*piVar9 == 2) {
                          puVar16 = (undefined4 *)
                                    (lVar7 + 0x188 +
                                    (longlong)(plVar22 + (longlong)pvVar1 * 4) * 0x18);
                          if ((local_1b0 <= puVar16) || (puVar16 < puVar21)) {
                            if (local_1b0 == local_1a8) {
                              uVar11 = (longlong)local_1b0 - (longlong)puVar21 >> 4;
                              if (0xffffffffffffffe < uVar11) {
                                std::_Xlength_error("vector<T> too long");
                                pcVar3 = (code *)swi(3);
                                uVar8 = (*pcVar3)();
                                return uVar8;
                              }
                              goto LAB_1401d7393;
                            }
                            goto LAB_1401d7348;
                          }
                          uVar11 = (longlong)puVar16 - (longlong)puVar21;
                          if (local_1b0 == local_1a8) {
                            uVar12 = (longlong)local_1b0 - (longlong)puVar21 >> 4;
                            if (0xffffffffffffffe < uVar12) {
                              std::_Xlength_error("vector<T> too long");
                              pcVar3 = (code *)swi(3);
                              uVar8 = (*pcVar3)();
                              return uVar8;
                            }
                            goto LAB_1401d72f7;
                          }
LAB_1401d7341:
                          puVar16 = (undefined4 *)
                                    ((uVar11 & 0xfffffffffffffff0) + (longlong)puVar21);
                          goto LAB_1401d7348;
                        }
                        if ((&DAT_14044e480 < local_1b0) &&
                           (puVar21 < (undefined4 *)((longlong)&DAT_14044e480 + 1))) {
                          uVar11 = (longlong)&DAT_14044e480 - (longlong)puVar21;
                          if (local_1b0 == local_1a8) {
                            uVar12 = (longlong)local_1b0 - (longlong)puVar21 >> 4;
                            if (0xffffffffffffffe < uVar12) {
                              std::_Xlength_error("vector<T> too long");
                              pcVar3 = (code *)swi(3);
                              uVar8 = (*pcVar3)();
                              return uVar8;
                            }
LAB_1401d72f7:
                            plVar10 = (longlong *)(uVar12 + 1);
                            plVar13 = (longlong *)((longlong)local_1a8 - (longlong)puVar21 >> 4);
                            if (plVar13 < plVar10) {
                              plVar14 = plVar18;
                              if (plVar13 <=
                                  (longlong *)(0xfffffffffffffff - ((ulonglong)plVar13 >> 1))) {
                                plVar14 = (longlong *)
                                          ((longlong)plVar13 + ((ulonglong)plVar13 >> 1));
                              }
                              if (plVar14 < plVar10) {
                                plVar14 = plVar10;
                              }
                              FUN_1402d2250(&local_1b8,plVar14);
                              puVar21 = local_1b8;
                            }
                          }
                          goto LAB_1401d7341;
                        }
                        if (local_1b0 == local_1a8) {
                          uVar11 = (longlong)local_1b0 - (longlong)puVar21 >> 4;
                          if (0xffffffffffffffe < uVar11) {
                            std::_Xlength_error("vector<T> too long");
                            goto LAB_1401d7725;
                          }
                          plVar10 = (longlong *)(uVar11 + 1);
                          plVar13 = (longlong *)((longlong)local_1a8 - (longlong)puVar21 >> 4);
                          if (plVar13 < plVar10) {
                            plVar14 = plVar18;
                            if (plVar13 <=
                                (longlong *)(0xfffffffffffffff - ((ulonglong)plVar13 >> 1))) {
                              plVar14 = (longlong *)((longlong)plVar13 + ((ulonglong)plVar13 >> 1));
                            }
                            if (plVar14 < plVar10) {
                              plVar14 = plVar10;
                            }
                            FUN_1402d2250(&local_1b8,plVar14);
                            puVar21 = local_1b8;
                          }
                        }
                        if (local_1b0 != (undefined4 *)0x0) {
                          *local_1b0 = 0;
                          local_1b0[1] = 0;
                          local_1b0[2] = 0;
                          uVar6 = 0;
                          goto LAB_1401d7545;
                        }
                      }
                      local_1b0 = local_1b0 + 4;
                      uVar23 = (int)plVar24 + 1;
                      plVar24 = (longlong *)(ulonglong)uVar23;
                      plVar22 = (longlong *)((longlong)plVar22 + 1);
                      pvVar20 = local_158;
                      plVar13 = local_f0;
                      uVar19 = local_190;
                    } while ((int)uVar23 < 0x20);
                  }
                  FUN_14034edd0(local_88);
                  local_80 = 0;
                  if ((local_188 != local_180) || (local_1b8 != local_1b0)) {
                    local_e8 = (undefined4)param_1[0x2e];
                    local_e4 = *(undefined4 *)((longlong)param_1 + 0x174);
                    local_e0 = (undefined4)param_1[0x2f];
                    local_dc = *(undefined4 *)((longlong)param_1 + 0x17c);
                    iVar4 = *(int *)((longlong)param_1 + 0x284);
                    local_130[0] = uVar19;
                    if ((-1 < iVar4) &&
                       ((iVar4 < *(short *)(param_1[0x16a] + 700) &&
                        (lVar7 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar7 != 0)))) {
                      local_res18[0] = (undefined2)iVar4;
                      plVar10 = (longlong *)
                                (*(longlong *)
                                  (*(longlong *)(lVar7 + 8) + (longlong)(int)param_1[0x51] * 8) +
                                0x70);
                      (**(code **)(*plVar10 + 0x290))
                                (plVar10,1,&DAT_1405d85a0,local_res18,&local_e8,&local_188,
                                 &local_1b8,local_130);
                    }
                  }
                  if (local_1b8 != (undefined4 *)0x0) {
                    operator_delete(local_1b8);
                  }
                  local_1b8 = (undefined4 *)0x0;
                  local_1b0 = (undefined4 *)0x0;
                  local_1a8 = (undefined4 *)0x0;
                  if (local_188 != (int *)0x0) {
                    operator_delete(local_188);
                  }
                  local_190 = uVar19 + 1;
                  plVar10 = (longlong *)(ulonglong)local_190;
                  local_158 = (void *)((longlong)pvVar20 + 1);
                  plVar22 = param_1;
                  plVar24 = plVar13;
                } while ((int)local_190 < 3);
LAB_1401d7725:
                lVar15 = *plVar24;
                lVar7 = lVar15 + 0x4b18;
                local_60 = lVar7;
                FUN_14034ed40(lVar7);
                local_58 = 1;
                do {
                  FUN_14025f4c0(lVar15,plVar18,plVar22);
                  uVar19 = (int)plVar18 + 1;
                  plVar18 = (longlong *)(ulonglong)uVar19;
                } while ((int)uVar19 < 3);
                FUN_14034edd0(lVar7);
              }
            }
            plVar18 = local_78;
            plVar13 = local_198;
            plVar10 = local_140;
            if (plVar24 != (longlong *)0x0) {
              LOCK();
              plVar24 = plVar24 + 1;
              lVar7 = *plVar24;
              *(int *)plVar24 = (int)*plVar24 + -1;
              UNLOCK();
              plVar13 = local_168;
              plVar10 = local_110;
              if ((int)lVar7 == 1) {
                pvVar1 = (void *)*local_78;
                if (pvVar1 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar1 + 0x4b18);
                  operator_delete(pvVar1);
                }
                operator_delete(plVar18);
                plVar13 = local_168;
                plVar10 = local_110;
              }
            }
          }
        }
        FUN_14019c070(plVar22,local_18c);
        plVar18 = local_110;
        if (plVar10 != (longlong *)0x0) {
          LOCK();
          plVar10 = plVar10 + 1;
          lVar7 = *plVar10;
          *(int *)plVar10 = (int)*plVar10 + -1;
          UNLOCK();
          plVar13 = local_168;
          if ((int)lVar7 == 1) {
            pvVar1 = (void *)*local_110;
            local_158 = pvVar1;
            if (pvVar1 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar1 + 0x90);
              FUN_14025e6b0((longlong)pvVar1 + 0x48);
              FUN_14025e600(pvVar1);
              operator_delete(pvVar1);
            }
            operator_delete(plVar18);
            plVar13 = local_168;
          }
        }
        if (local_118 != '\0') {
          FUN_14034edd0(local_120);
        }
        LOCK();
        plVar13 = plVar13 + 1;
        iVar4 = (int)*plVar13;
        *(int *)plVar13 = (int)*plVar13 + -1;
        UNLOCK();
        goto LAB_1401d7872;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar25 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar25) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar10 == (longlong *)0x0) {
    return 1;
  }
  if (plVar10 != local_160) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
  LOCK();
  plVar10 = plVar10 + 1;
  iVar4 = (int)*plVar10;
  *(int *)plVar10 = (int)*plVar10 + -1;
  UNLOCK();
LAB_1401d7872:
  if (iVar4 == 1) {
    puVar2 = (undefined8 *)*local_168;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_168);
  }
  return 1;
}



undefined8 FUN_1401d78b0(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  longlong local_30;
  
  local_30 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar2;
      if (lVar5 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar5 = 0, DAT_1406080a8 = iVar4,
           bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar7 = true;
        local_30 = lVar5;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x9b0);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
    if (*plVar2 != 0) {
      FUN_14025f180(*plVar2,param_2,*param_3);
    }
  }
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar2 + 1;
    lVar5 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar5 == 1) {
      pvVar3 = (void *)*plVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0x4b18);
        operator_delete(pvVar3);
      }
      operator_delete(plVar2);
    }
  }
  if (bVar7) {
    FUN_14034edd0(local_30);
  }
  return 1;
}



undefined8 FUN_1401d7a00(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  longlong local_30;
  
  local_30 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar2;
      if (lVar5 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar5 = 0, DAT_1406080a8 = iVar4,
           bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar7 = true;
        local_30 = lVar5;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x9c0);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
    if (*plVar2 != 0) {
      FUN_140256510(*plVar2,param_2);
    }
  }
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar2 + 1;
    lVar5 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar5 == 1) {
      pvVar3 = (void *)*plVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0x48);
        FUN_14025c370((longlong)pvVar3 + 0x20);
        FUN_14025c370(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar2);
    }
  }
  if (bVar7) {
    FUN_14034edd0(local_30);
  }
  return 1;
}



undefined8 FUN_1401d7b50(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  longlong local_30;
  
  local_30 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar2;
      if (lVar5 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar5 = 0, DAT_1406080a8 = iVar4,
           bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar7 = true;
        local_30 = lVar5;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x9c0);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
    if (*plVar2 != 0) {
      FUN_140256390(*plVar2,param_2);
    }
  }
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar2 + 1;
    lVar5 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar5 == 1) {
      pvVar3 = (void *)*plVar2;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0x48);
        FUN_14025c370((longlong)pvVar3 + 0x20);
        FUN_14025c370(pvVar3);
        operator_delete(pvVar3);
      }
      operator_delete(plVar2);
    }
  }
  if (bVar7) {
    FUN_14034edd0(local_30);
  }
  return 1;
}



undefined8 FUN_1401d7ca0(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong lVar4;
  void *pvVar5;
  int iVar6;
  longlong lVar7;
  longlong lVar8;
  ulonglong uVar9;
  bool bVar10;
  bool bVar11;
  longlong local_50;
  
  lVar7 = 0;
  local_50 = 0;
  bVar11 = false;
  plVar2 = *(longlong **)(param_1 + 0xb28);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar2 != 0) {
        local_50 = *plVar2;
        if ((plVar2 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar6 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, local_50 = lVar7,
           DAT_1406080a8 = iVar6, bVar11)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar11 = true;
      }
    }
    else {
      iVar6 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar6;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0xa10);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
  }
  plVar3 = *(longlong **)(param_1 + 0xa20);
  if (plVar3 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
    UNLOCK();
  }
  if ((((plVar2 == (longlong *)0x0) || (*plVar2 == 0)) || (plVar3 == (longlong *)0x0)) ||
     (*plVar3 == 0)) {
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar3 + 1;
      lVar7 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        pvVar5 = (void *)*plVar3;
        if (pvVar5 != (void *)0x0) {
          FUN_14026f2b0(pvVar5);
          operator_delete(pvVar5);
        }
        operator_delete(plVar3);
      }
    }
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      plVar3 = plVar2 + 1;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)*plVar3 == 0) {
        pvVar5 = (void *)*plVar2;
        if (pvVar5 != (void *)0x0) {
          FUN_14026ec20(pvVar5);
          operator_delete(pvVar5);
        }
        operator_delete(plVar2);
      }
    }
  }
  else {
    uVar9 = (param_2[1] - *param_2) / 0x88;
    if ((int)uVar9 != 0) {
      uVar9 = uVar9 & 0xffffffff;
      lVar8 = lVar7;
      do {
        lVar4 = *param_2;
        if (*(short *)(lVar8 + 0x22 + lVar4) < 1) {
          FUN_14026ee30(*plVar2,lVar4 + 0x10 + lVar7,lVar4 + 0x24 + lVar7,
                        (int)*(short *)(lVar8 + 0x20 + lVar4),*(undefined4 *)(lVar8 + 0x84 + lVar4))
          ;
        }
        else {
          FUN_14026f4e0(*plVar3);
        }
        lVar7 = lVar7 + 0x88;
        lVar8 = lVar8 + 0x88;
        uVar9 = uVar9 - 1;
      } while (uVar9 != 0);
    }
    if (*param_2 == param_2[1]) {
      FUN_1401d7f70(param_1);
    }
    LOCK();
    plVar1 = plVar3 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      pvVar5 = (void *)*plVar3;
      if (pvVar5 != (void *)0x0) {
        FUN_14026f2b0(pvVar5);
        operator_delete(pvVar5);
      }
      operator_delete(plVar3);
    }
    LOCK();
    plVar3 = plVar2 + 1;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    if ((int)*plVar3 == 0) {
      pvVar5 = (void *)*plVar2;
      if (pvVar5 != (void *)0x0) {
        FUN_14026ec20(pvVar5);
        operator_delete(pvVar5);
      }
      operator_delete(plVar2);
    }
  }
  if (bVar11) {
    FUN_14034edd0(local_50);
  }
  return 1;
}



void FUN_1401d7f70(longlong param_1)

{
  undefined *puVar1;
  int *piVar2;
  longlong *plVar3;
  void *pvVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  undefined8 uVar9;
  undefined *puVar10;
  longlong *plVar11;
  int iVar12;
  bool bVar13;
  bool bVar14;
  undefined *local_res8;
  longlong local_80;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  longlong *local_60;
  longlong *local_58;
  undefined8 local_50;
  undefined1 local_48;
  void *local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  local_80 = 0;
  bVar14 = false;
  plVar3 = *(longlong **)(param_1 + 0xb28);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar3 != 0) {
        local_80 = *plVar3;
        if ((plVar3 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar14 = DAT_1406080a8 == 0, local_80 = 0,
           DAT_1406080a8 = iVar5, bVar14)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar14 = true;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar13 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  plVar3 = *(longlong **)(param_1 + 0xa10);
  local_60 = plVar3;
  local_58 = plVar3;
  if (plVar3 == (longlong *)0x0) goto LAB_1401d8246;
  LOCK();
  *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
  UNLOCK();
  if (*plVar3 == 0) goto LAB_1401d8246;
  local_40 = (void *)0x0;
  local_38 = 0;
  local_30 = 0;
  FUN_14026ef90(*plVar3,&local_40);
  if (*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4f0) != 0) {
    local_70 = *(undefined4 *)(param_1 + 0x170);
    local_6c = *(undefined4 *)(param_1 + 0x174);
    local_68 = *(undefined4 *)(param_1 + 0x178);
    local_64 = *(undefined4 *)(param_1 + 0x17c);
    lVar8 = FUN_1401979d0(param_1,&local_70);
    if (lVar8 != 0) {
      plVar11 = (longlong *)(lVar8 + 0x28);
      if (7 < *(ulonglong *)(lVar8 + 0x40)) {
        plVar11 = (longlong *)*plVar11;
      }
      FUN_14034fe70();
      local_res8 = PTR_DAT_1405d8010;
      iVar6 = FUN_14034fcf0(plVar11);
      iVar12 = 0;
      iVar5 = iVar12;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar5 = *(int *)(local_res8 + -8);
      }
      iVar7 = iVar6;
      if (((iVar6 <= iVar5) && (iVar7 = iVar12, local_res8 != (undefined *)0x0)) &&
         (local_res8 != PTR_DAT_1405d8010)) {
        iVar7 = *(int *)(local_res8 + -8);
      }
      iVar5 = 1;
      if (1 < iVar7) {
        iVar5 = iVar7;
      }
      iVar7 = iVar12;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar7 = *(int *)(local_res8 + -8);
      }
      if (iVar7 < iVar5) {
        FUN_140002d30(&local_res8);
      }
      FUN_140002e10(&local_res8);
      puVar10 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1405d8010;
      }
      FUN_14034fd20(puVar10,plVar11,iVar6);
      puVar10 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1405d8010;
      }
      iVar6 = FUN_14034fcf0(puVar10);
      iVar5 = 0;
      if (0 < iVar6) {
        iVar5 = iVar6;
      }
      iVar6 = iVar12;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar6 = *(int *)(local_res8 + -8);
      }
      if ((iVar5 < iVar6) || (iVar5 = iVar12, local_res8 == (undefined *)0x0)) {
LAB_1401d8198:
        if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
           ((int *)(local_res8 + -8) != (int *)0x0)) {
          *(int *)(local_res8 + -8) = iVar5;
          *(undefined2 *)(local_res8 + (longlong)iVar5 * 2) = 0;
        }
      }
      else if (local_res8 != PTR_DAT_1405d8010) {
        iVar5 = *(int *)(local_res8 + -8);
        goto LAB_1401d8198;
      }
      plVar11 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4f0) + 0x70);
      (**(code **)(*plVar11 + 0x80))(plVar11,1,&DAT_1405d85a0,&local_res8,&local_40);
      puVar10 = local_res8;
      if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
         (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_50 = uVar9;
        FUN_14034ed40(uVar9);
        local_48 = 1;
        piVar2 = (int *)(puVar10 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar9);
      }
    }
  }
  if (local_40 != (void *)0x0) {
    operator_delete(local_40);
  }
LAB_1401d8246:
  plVar11 = local_60;
  if (plVar3 != (longlong *)0x0) {
    LOCK();
    plVar3 = plVar3 + 1;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    if ((int)*plVar3 == 0) {
      pvVar4 = (void *)*local_60;
      if (pvVar4 != (void *)0x0) {
        FUN_14026ec20(pvVar4);
        operator_delete(pvVar4);
      }
      operator_delete(plVar11);
    }
  }
  if (bVar14) {
    FUN_14034edd0(local_80);
  }
  return;
}



undefined8 FUN_1401d82b0(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  undefined8 uVar7;
  longlong *plVar8;
  longlong *plVar9;
  
  uVar7 = 0xfffffffffffffffe;
  plVar1 = *(longlong **)(param_1 + 0xb38);
  plVar8 = plVar1;
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
    UNLOCK();
    if (*plVar1 != 0) {
      uVar4 = 0;
      lVar6 = *param_2;
      lVar3 = SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(param_2[1] - lVar6),8) +
              (param_2[1] - lVar6);
      if (lVar3 >> 9 != lVar3 >> 0x3f) {
        uVar5 = 0;
        plVar9 = plVar1;
        do {
          FUN_140273710(*plVar1,lVar6 + uVar5 * 0x336,uVar5 * 0x336,lVar6,uVar7,plVar8,plVar9);
          uVar4 = uVar4 + 1;
          lVar6 = *param_2;
          uVar5 = (ulonglong)uVar4;
          lVar3 = SUB168(SEXT816(-0x608b85ead287c92f) * SEXT816(param_2[1] - lVar6),8) +
                  (param_2[1] - lVar6);
        } while (uVar5 < (ulonglong)((lVar3 >> 9) - (lVar3 >> 0x3f)));
      }
      FUN_1402745e0(*plVar1,param_1);
      FUN_140273960(*plVar1,param_1);
      goto LAB_1401d839c;
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
LAB_1401d839c:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    pvVar2 = (void *)*plVar8;
    if (pvVar2 != (void *)0x0) {
      FUN_140273290(pvVar2);
      operator_delete(pvVar2);
    }
    operator_delete(plVar8);
  }
  return 1;
}



undefined8 FUN_1401d83f0(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  undefined8 uVar7;
  longlong *plVar8;
  longlong *plVar9;
  
  uVar7 = 0xfffffffffffffffe;
  plVar1 = *(longlong **)(param_1 + 0xb38);
  plVar8 = plVar1;
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
    UNLOCK();
    if (*plVar1 != 0) {
      uVar4 = 0;
      lVar6 = *param_2;
      lVar3 = param_2[1] - lVar6 >> 0x3f;
      if ((param_2[1] - lVar6) / 0x9f + lVar3 != lVar3) {
        uVar5 = 0;
        plVar9 = plVar1;
        do {
          FUN_1402733b0(*plVar1,param_1,uVar5 * 0x9f + lVar6,lVar6,uVar7,plVar8,plVar9);
          uVar4 = uVar4 + 1;
          lVar6 = *param_2;
          uVar5 = (ulonglong)uVar4;
        } while (uVar5 < (ulonglong)((param_2[1] - lVar6) / 0x9f));
      }
      if (*param_2 != param_2[1]) {
        FUN_1402745e0(*plVar1,param_1);
      }
      goto LAB_1401d84d9;
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
LAB_1401d84d9:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    pvVar2 = (void *)*plVar8;
    if (pvVar2 != (void *)0x0) {
      FUN_140273290(pvVar2);
      operator_delete(pvVar2);
    }
    operator_delete(plVar8);
  }
  return 1;
}



undefined8 FUN_1401d8530(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  bool bVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  ulonglong uVar9;
  bool bVar10;
  bool bVar11;
  undefined8 uVar12;
  longlong local_70;
  longlong *local_60;
  longlong *local_58;
  longlong local_50;
  undefined1 local_48;
  undefined4 local_40;
  int local_3c;
  int local_38;
  int local_34;
  int local_30;
  
  uVar12 = 0xfffffffffffffffe;
  lVar8 = 0;
  local_70 = 0;
  bVar5 = false;
  bVar11 = false;
  plVar1 = *(longlong **)(param_1 + 0xb28);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        local_70 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar6 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, local_70 = lVar8,
           DAT_1406080a8 = iVar6, bVar11)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(local_70);
        bVar5 = true;
        bVar11 = true;
      }
    }
    else {
      iVar6 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar6;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x990);
  local_60 = plVar1;
  local_58 = plVar1;
  if (plVar1 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
    UNLOCK();
    bVar5 = bVar11;
    if (*plVar1 != 0) {
      uVar9 = (param_2[1] - *param_2) / 0xc;
      if ((int)uVar9 != 0) {
        uVar9 = uVar9 & 0xffffffff;
        do {
          lVar2 = *param_2;
          lVar3 = *plVar1;
          local_30 = (int)*(short *)(lVar8 + 10 + lVar2);
          local_34 = (int)*(short *)(lVar8 + 8 + lVar2);
          local_38 = (int)*(short *)(lVar8 + 6 + lVar2);
          local_3c = (int)*(short *)(lVar8 + 4 + lVar2);
          local_40 = *(undefined4 *)(lVar8 + lVar2);
          lVar2 = lVar3 + 0x20;
          local_50 = lVar2;
          FUN_14034ed40(lVar2);
          local_48 = 1;
          FUN_14025bf50(lVar3,&local_40);
          FUN_14034edd0(lVar2);
          local_48 = 0;
          lVar8 = lVar8 + 0xc;
          uVar9 = uVar9 - 1;
        } while (uVar9 != 0);
      }
      plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar7 + 0x5a0))
                (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2,uVar12);
      plVar7 = local_60;
      LOCK();
      plVar1 = plVar1 + 1;
      lVar8 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar8 == 1) {
        puVar4 = (undefined8 *)*local_60;
        if (puVar4 != (undefined8 *)0x0) {
          FUN_14034edf0(puVar4 + 4);
          if ((void *)*puVar4 != (void *)0x0) {
            operator_delete((void *)*puVar4);
          }
          *puVar4 = 0;
          puVar4[1] = 0;
          puVar4[2] = 0;
          operator_delete(puVar4);
        }
        operator_delete(plVar7);
      }
      goto joined_r0x0001401d8739;
    }
  }
  FUN_1401dee60(&local_60);
  bVar11 = bVar5;
joined_r0x0001401d8739:
  if (bVar11) {
    FUN_14034edd0(local_70);
  }
  return 1;
}



undefined8 FUN_1401d8780(longlong param_1,longlong *param_2)

{
  LPSYSTEMTIME lpSystemTime;
  ulonglong *puVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  uint uVar5;
  void *pvVar6;
  ulonglong uVar7;
  longlong *plVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  bool bVar11;
  bool bVar12;
  ulonglong local_50;
  longlong *local_40;
  longlong *local_38;
  longlong *local_30;
  longlong *local_28;
  
  uVar9 = 0;
  uVar7 = DAT_140607cc0;
  if ((DAT_140607cc0 == 0) && (pvVar6 = operator_new(0x130), uVar7 = uVar9, pvVar6 != (void *)0x0))
  {
    uVar7 = FUN_1401e04e0(pvVar6);
  }
  DAT_140607cc0 = uVar7;
  lpSystemTime = (LPSYSTEMTIME)(DAT_140607cc0 + 200);
  GetLocalTime(lpSystemTime);
  FUN_1401e2290(lpSystemTime);
  local_50 = 0;
  bVar12 = false;
  puVar1 = *(ulonglong **)(param_1 + 0xb28);
  if (puVar1 != (ulonglong *)0x0) {
    if (puVar1 == *(ulonglong **)(param_1 + 0xb30)) {
      if (*puVar1 != 0) {
        local_50 = *puVar1;
        if ((puVar1 != *(ulonglong **)(param_1 + 0xb30)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, local_50 = uVar9,
           DAT_1406080a8 = iVar4, bVar12)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar12 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  plVar8 = *(longlong **)(param_1 + 0xa00);
  local_40 = plVar8;
  local_38 = plVar8;
  if (plVar8 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar8 + 1) = (int)plVar8[1] + 1;
    UNLOCK();
    if (*plVar8 != 0) {
      uVar7 = (param_2[1] - *param_2) / 0x1c;
      uVar10 = uVar9;
      if ((int)uVar7 != 0) {
        uVar7 = uVar7 & 0xffffffff;
        do {
          uVar5 = FUN_140266fd0(*plVar8,*param_2 + uVar9);
          if (0 < (int)uVar5) {
            uVar10 = (ulonglong)uVar5;
          }
          uVar9 = uVar9 + 0x1c;
          uVar7 = uVar7 - 1;
        } while (uVar7 != 0);
      }
      plVar8 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar8 + 0x5e0))(plVar8,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,param_2);
      FUN_140198570(param_1,&local_30);
      plVar8 = local_30;
      if (local_30 != (longlong *)0x0) {
        if (local_30 == local_28) {
          if (*local_30 != 0) {
            FUN_1401d1230(param_1,uVar10);
          }
        }
        else {
          iVar4 = DAT_14060804c + 1;
          bVar11 = DAT_14060804c == 0;
          DAT_14060804c = iVar4;
          if (bVar11) {
            FUN_140176d60(1);
          }
        }
      }
      if (plVar8 != (longlong *)0x0) {
        if (plVar8 == local_28) {
          LOCK();
          plVar8 = plVar8 + 1;
          lVar3 = *plVar8;
          *(int *)plVar8 = (int)*plVar8 + -1;
          UNLOCK();
          if ((int)lVar3 == 1) {
            puVar2 = (undefined8 *)*local_30;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
            }
            operator_delete(local_30);
          }
        }
        else {
          iVar4 = DAT_140608054 + 1;
          bVar11 = DAT_140608054 == 0;
          DAT_140608054 = iVar4;
          if (bVar11) {
            FUN_140176d60(1);
          }
        }
      }
      FUN_1401df150(&local_40);
      goto LAB_1401d89da;
    }
  }
  FUN_1401df150(&local_40);
LAB_1401d89da:
  if (bVar12) {
    FUN_14034edd0(local_50);
  }
  return 1;
}



undefined8 FUN_1401d8a10(longlong param_1,longlong *param_2)

{
  int iVar1;
  longlong lVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined2 local_res10 [4];
  undefined4 local_res18 [4];
  
  FUN_1401abb50();
  lVar5 = *param_2;
  uVar3 = 0;
  lVar2 = param_2[1] - lVar5 >> 0x3f;
  if ((param_2[1] - lVar5) / 0xaf + lVar2 != lVar2) {
    uVar4 = 0;
    do {
      iVar1 = *(int *)(param_1 + 0x284);
      local_res18[0] = *(undefined4 *)(param_1 + 8);
      if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
         (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
        local_res10[0] = (undefined2)iVar1;
        lVar2 = *(longlong *)(*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
        (**(code **)(*(longlong *)(lVar2 + 0x70) + 0xb90))
                  (lVar2 + 0x70,1,&DAT_1405d85a0,local_res10,local_res18,uVar4 * 0xaf + lVar5);
      }
      lVar5 = *param_2;
      uVar3 = uVar3 + 1;
      uVar4 = (ulonglong)uVar3;
      lVar2 = param_2[1] - lVar5 >> 0x3f;
    } while (uVar4 < (ulonglong)((param_2[1] - lVar5) / 0xaf));
  }
  return CONCAT71((int7)((ulonglong)-lVar2 >> 8),1);
}



undefined8 FUN_1401d8b20(longlong param_1,ulonglong *param_2,longlong *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  longlong *local_20;
  longlong *local_18;
  
  lVar6 = param_3[1] - *param_3;
  lVar7 = 0x2aaaaaaaaaaaaaab;
  if (lVar6 / 0x18 + (lVar6 >> 0x3f) == lVar6 >> 0x3f) {
    return 1;
  }
  uVar5 = 0;
  bVar8 = *(ulonglong *)(param_1 + 0x170) < *param_2;
  if ((*(ulonglong *)(param_1 + 0x170) != *param_2) ||
     (bVar8 = *(ulonglong *)(param_1 + 0x178) < param_2[1], uVar4 = uVar5,
     *(ulonglong *)(param_1 + 0x178) != param_2[1])) {
    uVar4 = (ulonglong)((1 - (uint)bVar8) - (uint)(bVar8 != 0));
  }
  if ((int)uVar4 != 0) {
    return 1;
  }
  FUN_140198570(param_1,&local_20,param_1,lVar6,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar6 = SUB168(SEXT816(lVar7) * SEXT816(param_3[1] - *param_3),8);
        uVar4 = (lVar6 >> 2) - (lVar6 >> 0x3f);
        if ((int)uVar4 != 0) {
          uVar4 = uVar4 & 0xffffffff;
          do {
            FUN_14020a5a0(*plVar1,uVar5 + *param_3,1);
            uVar5 = uVar5 + 0x18;
            uVar4 = uVar4 - 1;
          } while (uVar4 != 0);
        }
        FUN_14020a800(*plVar1);
        goto LAB_1401d8c7e;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d8c7e:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8
FUN_1401d8cd0(longlong param_1,int *param_2,undefined4 *param_3,longlong *param_4,int *param_5,
             int *param_6)

{
  undefined *puVar1;
  int *piVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  size_t sVar7;
  longlong lVar8;
  undefined8 uVar9;
  wchar_t *pwVar10;
  undefined *puVar11;
  int iVar12;
  longlong *plVar13;
  undefined *local_res8;
  undefined4 local_res10 [2];
  undefined8 local_a0;
  undefined4 local_98;
  undefined4 local_94;
  void *local_90;
  void *local_88;
  undefined8 local_80;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  wchar_t local_60 [17];
  undefined1 local_3e;
  undefined1 local_3d;
  undefined4 local_3c;
  
  lVar8 = *(longlong *)(param_1 + 0xb50);
  lVar3 = *(longlong *)(lVar8 + 0x4f0);
  if ((*param_2 != 0xa6) || ((*param_6 < 1 && (*param_5 < 1)))) goto LAB_1401d8ff6;
  puVar11 = (undefined *)*param_4;
  if ((undefined *)*param_4 == (undefined *)0x0) {
    puVar11 = PTR_DAT_1405d8010;
  }
  iVar4 = FUN_1401a9430(param_1,param_3,puVar11,param_5,param_6);
  if (iVar4 != 0) {
    local_3d = 0;
    local_3c = 0;
    local_60[0] = L'\0';
    local_60[1] = L'\0';
    local_60[2] = L'\0';
    local_60[3] = L'\0';
    local_60[4] = L'\0';
    local_60[5] = L'\0';
    local_60[6] = L'\0';
    local_60[7] = L'\0';
    local_60[8] = L'\0';
    local_60[9] = L'\0';
    local_60[10] = L'\0';
    local_60[0xb] = L'\0';
    local_60[0xc] = L'\0';
    local_60[0xd] = L'\0';
    local_60[0xe] = L'\0';
    local_60[0xf] = L'\0';
    local_70 = *param_3;
    local_6c = param_3[1];
    local_68 = param_3[2];
    local_64 = param_3[3];
    local_60[0x10] = (wchar_t)*param_5;
    local_3e = (undefined1)*param_6;
    pwVar10 = (wchar_t *)*param_4;
    if ((wchar_t *)*param_4 == (wchar_t *)0x0) {
      pwVar10 = (wchar_t *)PTR_DAT_1405d8010;
    }
    sVar7 = wcsnlen(pwVar10,0x10);
    if (sVar7 < 0x10) {
      pwVar10 = (wchar_t *)*param_4;
      if ((wchar_t *)*param_4 == (wchar_t *)0x0) {
        pwVar10 = (wchar_t *)PTR_DAT_1405d8010;
      }
      wcscpy_s(local_60,0x10,pwVar10);
      local_90 = (void *)0x0;
      local_88 = (void *)0x0;
      local_80 = 0;
      FUN_140117a90(&local_90,1);
      if (local_88 != (void *)0x0) {
        memcpy(local_88,&local_70,0x38);
      }
      local_88 = (void *)((longlong)local_88 + 0x38);
      if (lVar3 == 0) goto LAB_1401d8fe1;
      local_a0 = *(undefined8 *)(param_1 + 0x170);
      local_98 = *(undefined4 *)(param_1 + 0x178);
      local_94 = *(undefined4 *)(param_1 + 0x17c);
      lVar8 = FUN_1401979d0(param_1,&local_a0);
      if (lVar8 == 0) goto LAB_1401d8fe1;
      plVar13 = (longlong *)(lVar8 + 0x28);
      if (7 < *(ulonglong *)(lVar8 + 0x40)) {
        plVar13 = (longlong *)*plVar13;
      }
      FUN_14034fe70();
      local_res8 = PTR_DAT_1405d8010;
      iVar5 = FUN_14034fcf0(plVar13);
      iVar12 = 0;
      iVar4 = iVar12;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar4 = *(int *)(local_res8 + -8);
      }
      iVar6 = iVar5;
      if (((iVar5 <= iVar4) && (iVar6 = iVar12, local_res8 != (undefined *)0x0)) &&
         (local_res8 != PTR_DAT_1405d8010)) {
        iVar6 = *(int *)(local_res8 + -8);
      }
      iVar4 = 1;
      if (1 < iVar6) {
        iVar4 = iVar6;
      }
      iVar6 = iVar12;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar6 = *(int *)(local_res8 + -8);
      }
      if (iVar6 < iVar4) {
        FUN_140002d30(&local_res8);
      }
      FUN_140002e10(&local_res8);
      puVar11 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      FUN_14034fd20(puVar11,plVar13,iVar5);
      puVar11 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      iVar5 = FUN_14034fcf0(puVar11);
      iVar4 = 0;
      if (0 < iVar5) {
        iVar4 = iVar5;
      }
      iVar5 = iVar12;
      if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
        iVar5 = *(int *)(local_res8 + -8);
      }
      if ((iVar4 < iVar5) || (iVar4 = iVar12, local_res8 == (undefined *)0x0)) {
LAB_1401d8f51:
        if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
           ((int *)(local_res8 + -8) != (int *)0x0)) {
          *(int *)(local_res8 + -8) = iVar4;
          *(undefined2 *)(local_res8 + (longlong)iVar4 * 2) = 0;
        }
      }
      else if (local_res8 != PTR_DAT_1405d8010) {
        iVar4 = *(int *)(local_res8 + -8);
        goto LAB_1401d8f51;
      }
      plVar13 = (longlong *)(lVar3 + 0x70);
      (**(code **)(*plVar13 + 0x80))(plVar13,1,&DAT_1405d85a0,&local_res8,&local_90);
      puVar11 = local_res8;
      if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
         (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_a0 = uVar9;
        FUN_14034ed40(uVar9);
        local_98 = CONCAT31(local_98._1_3_,1);
        piVar2 = (int *)(puVar11 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar9);
      }
LAB_1401d8fe1:
      if (local_90 == (void *)0x0) {
        return 1;
      }
      operator_delete(local_90);
      return 1;
    }
  }
  lVar8 = *(longlong *)(param_1 + 0xb50);
LAB_1401d8ff6:
  local_res8 = (undefined *)CONCAT44(local_res8._4_4_,0x26);
  local_res10[0] = 0x1b5c;
  (**(code **)(*(longlong *)(lVar8 + 0x78) + 0x70))
            ((longlong *)(lVar8 + 0x78),*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10,
             &local_res8);
  return 1;
}



undefined8
FUN_1401d9040(longlong param_1,int *param_2,undefined8 param_3,longlong *param_4,int *param_5,
             int *param_6,longlong *param_7)

{
  int iVar1;
  undefined *puVar2;
  longlong lVar3;
  undefined *puVar4;
  undefined4 local_res10 [6];
  undefined4 local_18 [4];
  
  if ((*param_2 == 0xa6) && ((0 < *param_6 || (0 < *param_5)))) {
    puVar2 = (undefined *)*param_7;
    if ((undefined *)*param_7 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1405d8010;
    }
    puVar4 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1405d8010;
    }
    iVar1 = FUN_1401a9a60(param_1,param_3,puVar4,param_5,param_6,puVar2);
    if (iVar1 != 0) {
      return 1;
    }
    lVar3 = *(longlong *)(param_1 + 0xb50);
  }
  else {
    lVar3 = *(longlong *)(param_1 + 0xb50);
  }
  local_res10[0] = 0x26;
  local_18[0] = 0x1b5a;
  (**(code **)(*(longlong *)(lVar3 + 0x78) + 0x70))
            ((longlong *)(lVar3 + 0x78),*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_18,
             local_res10);
  return 1;
}



undefined8 FUN_1401d9100(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  ulonglong uVar4;
  longlong lVar5;
  bool bVar6;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        uVar4 = (param_2[1] - *param_2) / 0xa4;
        if ((int)uVar4 != 0) {
          lVar5 = 0;
          uVar4 = uVar4 & 0xffffffff;
          do {
            FUN_1402095a0(*plVar1,lVar5 + *param_2);
            lVar5 = lVar5 + 0xa4;
            uVar4 = uVar4 - 1;
          } while (uVar4 != 0);
        }
        goto LAB_1401d91d5;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d91d5:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar5 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar5 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401d9220(undefined8 param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  FUN_140198570(param_1,&local_20,param_2,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        lVar3 = param_2[1] - *param_2 >> 0x3f;
        if ((param_2[1] - *param_2) / 0x50 + lVar3 != lVar3) {
          FUN_14020afe0(*local_20,param_2);
        }
        goto LAB_1401d92cb;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d92cb:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar3 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar3 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



undefined8 FUN_1401d9300(longlong param_1,undefined8 param_2,char *param_3)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  
  DVar1 = timeGetTime();
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 != 1000) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if (DAT_14060a120 != 0xca) goto LAB_1401d93dd;
  }
  uVar3 = 0;
  if (*param_3 != '\0') {
    uVar3 = 0x11a;
  }
  FUN_140173ee0(*(undefined8 *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 8),uVar3,
                *(undefined4 *)(param_1 + 0x5e8),param_2);
LAB_1401d93dd:
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,
                  "DBCSession-RESP_INSERT_CASH_PRODUCT");
  }
  return 1;
}



undefined8 FUN_1401d9420(undefined8 param_1,undefined8 param_2,longlong *param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined1 local_c8 [16];
  undefined1 local_b8 [160];
  
  lVar5 = *param_3;
  uVar3 = 0;
  lVar1 = param_3[1] - lVar5 >> 0x3f;
  uVar2 = -lVar1;
  uVar4 = uVar3;
  if ((param_3[1] - lVar5) / 0x97 + lVar1 != lVar1) {
    do {
      memcpy(local_b8,(void *)(lVar5 + uVar3),0x97);
      FUN_1401b57c0(param_1,local_c8,param_2,(int)*(short *)((longlong)(lVar5 + uVar3) + 0x10),
                    local_b8);
      lVar5 = *param_3;
      uVar2 = (ulonglong)((int)uVar4 + 1);
      uVar3 = uVar3 + 0x97;
      uVar4 = uVar2;
    } while (uVar2 < (ulonglong)((param_3[1] - lVar5) / 0x97));
  }
  return CONCAT71((int7)(uVar2 >> 8),1);
}



undefined8 FUN_1401d9510(longlong param_1,longlong *param_2,undefined1 *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong lVar9;
  bool bVar10;
  undefined4 local_res20 [2];
  undefined8 uVar11;
  longlong *local_20;
  longlong *local_18;
  
  uVar11 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_20);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if ((longlong *)*local_20 != (longlong *)0x0) {
        lVar4 = (**(code **)(*(longlong *)*local_20 + 0x270))();
        if (lVar4 != 0) {
          lVar9 = *param_2;
          uVar5 = param_2[1] - lVar9 >> 2;
          if (uVar5 < 4) {
            uVar7 = 0;
            uVar8 = uVar7;
            if (uVar5 != 0) {
              do {
                *(undefined4 *)(uVar7 + 0xa8 + lVar4) = *(undefined4 *)(uVar7 + lVar9);
                uVar8 = (ulonglong)((int)uVar8 + 1);
                uVar7 = uVar7 + 4;
                lVar9 = *param_2;
              } while (uVar8 < (ulonglong)(param_2[1] - lVar9 >> 2));
            }
            *(undefined1 *)(lVar4 + 0xb4) = *param_3;
            local_res20[0] = *(undefined4 *)(lVar4 + 0x80);
            plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x3c0);
            (**(code **)(*plVar6 + 0x710))
                      (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,param_2,
                       param_3,uVar11);
            FUN_1401b45d0(param_1);
          }
        }
        goto LAB_1401d9665;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar10 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_18) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 1;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401d9665:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar4 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar4 == 1) {
    puVar2 = (undefined8 *)*local_20;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_20);
  }
  return 1;
}



// WARNING: Type propagation algorithm not settling

undefined8 FUN_1401d96b0(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  longlong *plVar1;
  undefined1 local_res20 [8];
  int local_28;
  int local_24 [3];
  undefined8 local_18;
  
  local_18 = 0xfffffffffffffffe;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (DAT_14060943d != '\0') {
    local_28 = 0;
    local_24[0] = 0;
    local_24[1] = 0;
    local_28 = FUN_1402711e0(param_1,*param_3,param_2);
    if (((local_28 != 0x53) ||
        (plVar1 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78),
        (**(code **)(*plVar1 + 0x990))
                  (plVar1,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_24 + 1,local_24),
        local_28 != 0x53)) || (local_res20[0] = 1, local_24[0] < 1)) {
      local_res20[0] = 0;
    }
    plVar1 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
    (**(code **)(*plVar1 + 0x560))
              (plVar1,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_28,local_res20);
    return 1;
  }
  return 1;
}



undefined8 FUN_1401d97b0(longlong *param_1)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined4 uVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong lVar8;
  bool bVar9;
  undefined2 local_res10 [4];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_88;
  undefined4 uStack_84;
  undefined4 local_80;
  undefined4 uStack_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70 [2];
  longlong *local_68;
  longlong *local_60;
  undefined **local_58;
  longlong *local_50;
  longlong local_48;
  ulonglong local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  FUN_140198570(param_1,&local_68);
  plVar1 = local_68;
  if (local_68 != (longlong *)0x0) {
    if (local_68 == local_60) {
      if (*local_68 != 0) {
        plVar2 = (longlong *)param_1[0x140];
        if (plVar2 != (longlong *)0x0) {
          if (plVar2 == (longlong *)param_1[0x141]) {
            if (*plVar2 != 0) {
              local_88 = 0;
              uStack_84 = 0;
              local_80 = 0;
              uStack_7c = 0;
              lVar8 = 0;
              if (plVar2 == (longlong *)param_1[0x141]) {
                lVar6 = *plVar2;
              }
              else {
                iVar4 = DAT_1406080dc + 1;
                bVar9 = DAT_1406080dc == 0;
                lVar6 = lVar8;
                DAT_1406080dc = iVar4;
                if (bVar9) {
                  FUN_140176d60(1);
                }
              }
              local_88 = *(undefined4 *)(lVar6 + 0x20);
              uStack_84 = *(undefined4 *)(lVar6 + 0x24);
              local_80 = *(undefined4 *)(lVar6 + 0x28);
              uStack_7c = *(undefined4 *)(lVar6 + 0x2c);
              *(undefined4 *)(lVar6 + 0x20) = 0;
              *(undefined4 *)(lVar6 + 0x24) = 0;
              *(undefined4 *)(lVar6 + 0x28) = 0;
              *(undefined4 *)(lVar6 + 0x2c) = 0;
              *(undefined8 *)(lVar6 + 0x30) = 0;
              iVar4 = 0;
              *(undefined4 *)(lVar6 + 0x38) = 0;
              FUN_140237f20(*plVar1,4);
              lVar6 = CONCAT44(uStack_84,local_88);
              if ((lVar6 != 0) || (lVar6 = CONCAT44(uStack_7c,local_80), lVar6 != 0)) {
                iVar4 = (1 - (uint)(lVar6 != 0)) - (uint)((lVar6 != 0) != 0);
              }
              if (iVar4 != 0) {
                iVar4 = *(int *)((longlong)param_1 + 0x284);
                plVar2 = param_1 + 1;
                local_res20[0] = (undefined4)*plVar2;
                if ((-1 < iVar4) && (iVar4 < *(short *)(param_1[0x16a] + 700))) {
                  if ((CONCAT44(uStack_84,local_88) == 0) && (CONCAT44(uStack_7c,local_80) == 0)) {
                    bVar9 = false;
                  }
                  else {
                    bVar9 = true;
                  }
                  if ((bVar9) && (lVar6 = *(longlong *)(param_1[0x16a] + 0x4c0), lVar6 != 0)) {
                    local_res10[0] = (undefined2)iVar4;
                    plVar7 = (longlong *)
                             (*(longlong *)
                               (*(longlong *)(lVar6 + 8) + (longlong)(int)param_1[0x51] * 8) + 0x70)
                    ;
                    (**(code **)(*plVar7 + 0x470))
                              (plVar7,1,&DAT_1405d85a0,local_res10,local_res20,&local_88);
                  }
                }
                local_74 = 1;
                (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x600))
                          ((longlong *)(param_1[0x16a] + 0x78),(int)*plVar2,&DAT_1405d85a0,&local_74
                           ,&local_88);
                local_58 = Proud::CFastArray<>::vftable;
                local_50 = (longlong *)0x0;
                local_48 = 0;
                local_40 = 0;
                local_38 = 0;
                iVar4 = (**(code **)(*(longlong *)*plVar1 + 0xae8))((longlong *)*plVar1,&local_58);
                if (iVar4 < 1) {
                  iVar4 = (**(code **)(*param_1 + 0x38))(param_1);
                  if (iVar4 != 0) {
                    local_78 = 0;
                    lVar8 = *(longlong *)(param_1[0x16a] + 0x78);
                    uVar5 = (**(code **)(*param_1 + 0x38))(param_1);
                    (**(code **)(lVar8 + 0x620))
                              (param_1[0x16a] + 0x78,uVar5,&DAT_1405d85a0,plVar2,&local_78);
                  }
                }
                else {
                  local_70[0] = 0;
                  lVar6 = local_48;
                  if ((int)local_40 == 0) {
                    lVar6 = lVar8;
                  }
                  (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x618))
                            ((longlong *)(param_1[0x16a] + 0x78),lVar6,local_40 & 0xffffffff,
                             &DAT_1405d85a0,plVar2,local_70);
                }
                local_58 = Proud::CFastArray<>::vftable;
                if (local_48 != 0) {
                  if (local_50 == (longlong *)0x0) {
                    FUN_14034ff60();
                  }
                  else {
                    (**(code **)(*local_50 + 0x18))(local_50,local_48);
                  }
                }
                LOCK();
                plVar1 = plVar1 + 1;
                lVar8 = *plVar1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)lVar8 == 1) {
                  puVar3 = (undefined8 *)*local_68;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  operator_delete(local_68);
                }
                return 1;
              }
              local_res18[0] = 0x35;
              (**(code **)(*(longlong *)(param_1[0x16a] + 0x78) + 0x600))
                        ((longlong *)(param_1[0x16a] + 0x78),(int)param_1[1],&DAT_1405d85a0,
                         local_res18,&local_88);
            }
          }
          else {
            iVar4 = DAT_1406080dc + 1;
            bVar9 = DAT_1406080dc == 0;
            DAT_1406080dc = iVar4;
            if (bVar9) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_1401d9b78;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 0;
  }
  if (plVar1 != local_60) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 0;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_1401d9b78:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar8 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar8 == 1) {
    puVar3 = (undefined8 *)*local_68;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_68);
  }
  return 0;
}



ulonglong FUN_1401d9bc0(longlong param_1,longlong *param_2)

{
  uint *puVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  uint uVar4;
  longlong *plVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong *plVar8;
  int *piVar9;
  undefined8 uVar10;
  longlong lVar11;
  longlong lVar12;
  longlong lVar13;
  bool bVar14;
  
  plVar5 = *(longlong **)(param_1 + 0x6e0);
  if (plVar5 != (longlong *)0x0) {
    if (plVar5 == *(longlong **)(param_1 + 0x6e8)) {
      plVar8 = (longlong *)*plVar5;
      if (plVar8 != (longlong *)0x0) {
        if (plVar5 != *(longlong **)(param_1 + 0x6e8)) {
          uVar4 = DAT_14060804c + 1;
          bVar14 = DAT_14060804c == 0;
          DAT_14060804c = uVar4;
          if (bVar14) {
            FUN_140176d60();
          }
          plVar8 = (longlong *)0x0;
        }
        lVar6 = (**(code **)(*plVar8 + 0x270))();
        if (lVar6 == 0) {
          return 0;
        }
        lVar12 = *param_2;
        uVar3 = (param_2[1] - lVar12) / 0xc;
        uVar7 = -(param_2[1] - lVar12 >> 0x3f);
        if (10 < uVar3) {
          return 0;
        }
        if (uVar3 != 0) {
          lVar11 = 0;
          uVar7 = 0;
          do {
            uVar4 = *(uint *)(lVar11 + lVar12);
            plVar5 = (longlong *)FUN_1403161f0();
            if (*plVar5 != 0) {
              for (puVar1 = *(uint **)(*plVar5 +
                                      ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar5 + 2)) * 8);
                  puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
                if ((puVar1[0xea] == uVar4) && (*puVar1 == uVar4)) {
                  if (puVar1 != (uint *)0x0) {
                    uVar4 = puVar1[3];
                    goto LAB_1401d9cfa;
                  }
                  break;
                }
              }
            }
            uVar4 = 0;
LAB_1401d9cfa:
            plVar5 = (longlong *)FUN_140267710(uVar4);
            if (plVar5 != (longlong *)0x0) {
              lVar12 = *param_2;
              uVar4 = 0;
              piVar9 = (int *)(lVar6 + 0xd4);
              lVar13 = 0;
              do {
                if (*piVar9 == 0) {
                  *(undefined4 *)(lVar6 + 0xd4 + lVar13 * 0xc) = *(undefined4 *)(lVar11 + lVar12);
                  *(undefined4 *)(lVar6 + 0xd8 + lVar13 * 0xc) =
                       *(undefined4 *)(lVar11 + 4 + lVar12);
                  *(undefined4 *)(lVar6 + 0xdc + lVar13 * 0xc) =
                       *(undefined4 *)(lVar11 + 8 + lVar12);
                  break;
                }
                uVar4 = uVar4 + 1;
                lVar13 = lVar13 + 1;
                piVar9 = piVar9 + 3;
              } while (uVar4 < 10);
              (**(code **)(*plVar5 + 8))(plVar5,*(undefined4 *)(lVar11 + *param_2));
              *(undefined4 *)(plVar5 + 0xc) = *(undefined4 *)(lVar11 + 8 + *param_2);
              puVar2 = *(undefined8 **)(param_1 + 0x6e0);
              if (puVar2 == (undefined8 *)0x0) {
LAB_1401d9db8:
                uVar10 = 0;
              }
              else {
                if (puVar2 != *(undefined8 **)(param_1 + 0x6e8)) {
                  uVar4 = DAT_14060804c + 1;
                  bVar14 = DAT_14060804c == 0;
                  DAT_14060804c = uVar4;
                  if (bVar14) {
                    FUN_140176d60(1);
                  }
                  goto LAB_1401d9db8;
                }
                uVar10 = *puVar2;
              }
              FUN_14023a030(uVar10,param_1,plVar5);
              (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78) + 0xbb0))
                        (*(longlong *)(param_1 + 0xb50) + 0x78,*(undefined4 *)(param_1 + 8),
                         &DAT_1405d85a0,*param_2 + uVar7 * 0xc);
            }
            lVar12 = *param_2;
            uVar7 = (ulonglong)((int)uVar7 + 1);
            lVar11 = lVar11 + 0xc;
          } while (uVar7 < (ulonglong)((param_2[1] - lVar12) / 0xc));
        }
        return CONCAT71((int7)(uVar7 >> 8),1);
      }
    }
    else {
      uVar4 = DAT_14060804c + 1;
      plVar5 = (longlong *)(ulonglong)uVar4;
      bVar14 = DAT_14060804c == 0;
      DAT_14060804c = uVar4;
      if (bVar14) {
        plVar5 = (longlong *)FUN_140176d60(1);
      }
    }
  }
  return (ulonglong)plVar5 & 0xffffffffffffff00;
}



undefined8 FUN_1401d9e50(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      lVar3 = *plVar1;
      if (lVar3 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar4 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar4) {
            FUN_140176d60(1);
          }
          lVar3 = 0;
        }
        FUN_140204890(lVar3,param_2);
        return 1;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar4 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar4) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



undefined8
FUN_1401d9ed0(longlong *param_1,undefined4 param_2,undefined4 *param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  int *piVar1;
  void *pvVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  undefined8 uVar7;
  bool bVar8;
  undefined4 local_70;
  undefined4 local_6c;
  float local_68;
  undefined8 *local_60;
  undefined8 *local_58;
  undefined8 *local_50;
  undefined8 *local_48;
  undefined8 *local_40;
  undefined8 *local_38;
  undefined8 *local_30;
  undefined8 *local_28;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  
  switch(*param_3) {
  case 1:
    FUN_140197b70(param_1,&local_60);
    lVar5 = FUN_140174f00(&local_60);
    if (lVar5 == 0) {
      if (local_60 == (undefined8 *)0x0) {
        return 0;
      }
      if (local_60 == local_58) {
        LOCK();
        piVar1 = (int *)(local_60 + 1);
        iVar4 = *piVar1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        puVar3 = local_60;
joined_r0x0001401da111:
        if (iVar4 != 1) {
          return 0;
        }
        pvVar2 = (void *)*puVar3;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0xf630);
          operator_delete(pvVar2);
        }
        operator_delete(puVar3);
        return 0;
      }
LAB_1401d9f4c:
      iVar4 = DAT_140608050 + 1;
      bVar8 = DAT_140608050 == 0;
      DAT_140608050 = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
      return 0;
    }
    uVar7 = FUN_140174f00(&local_60);
    FUN_1401f9ca0(uVar7,param_1,*param_4,*param_5);
    if (local_60 == (undefined8 *)0x0) {
      return 1;
    }
    if (local_60 == local_58) {
      LOCK();
      piVar1 = (int *)(local_60 + 1);
      iVar4 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      puVar3 = local_60;
joined_r0x0001401da160:
      if (iVar4 != 1) {
        return 1;
      }
      pvVar2 = (void *)*puVar3;
      if (pvVar2 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar2 + 0xf630);
        operator_delete(pvVar2);
      }
      operator_delete(puVar3);
      return 1;
    }
    goto LAB_1401d9fd8;
  case 2:
    FUN_140197b70(param_1,&local_50);
    lVar5 = FUN_140174f00(&local_50);
    if (lVar5 == 0) {
      if (local_50 == (undefined8 *)0x0) {
        return 0;
      }
      if (local_50 == local_48) {
        LOCK();
        piVar1 = (int *)(local_50 + 1);
        iVar4 = *piVar1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        puVar3 = local_50;
        goto joined_r0x0001401da111;
      }
      goto LAB_1401d9f4c;
    }
    uVar7 = FUN_140174f00(&local_50);
    FUN_1401fa340(uVar7,param_1,*param_4,*param_5);
    if (local_50 == (undefined8 *)0x0) {
      return 1;
    }
    if (local_50 == local_48) {
      LOCK();
      piVar1 = (int *)(local_50 + 1);
      iVar4 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      puVar3 = local_50;
      goto joined_r0x0001401da160;
    }
    goto LAB_1401d9fd8;
  case 3:
    FUN_140197b70(param_1,&local_30);
    lVar5 = FUN_140174f00(&local_30);
    if (lVar5 == 0) {
      if (local_30 == (undefined8 *)0x0) {
        return 0;
      }
      if (local_30 == local_28) {
        LOCK();
        piVar1 = (int *)(local_30 + 1);
        iVar4 = *piVar1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        puVar3 = local_30;
        goto joined_r0x0001401da111;
      }
      goto LAB_1401d9f4c;
    }
    uVar7 = FUN_140174f00(&local_30);
    FUN_1401f9fc0(uVar7,param_1,*param_4,*param_5);
    if (local_30 == (undefined8 *)0x0) {
      return 1;
    }
    if (local_30 == local_28) {
      LOCK();
      piVar1 = (int *)(local_30 + 1);
      iVar4 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      puVar3 = local_30;
      goto joined_r0x0001401da160;
    }
    goto LAB_1401d9fd8;
  case 4:
    FUN_140197b70(param_1,&local_40);
    lVar5 = FUN_140174f00(&local_40);
    if (lVar5 == 0) {
      if (local_40 == (undefined8 *)0x0) {
        return 0;
      }
      if (local_40 == local_38) {
        LOCK();
        piVar1 = (int *)(local_40 + 1);
        iVar4 = *piVar1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        puVar3 = local_40;
        goto joined_r0x0001401da111;
      }
      goto LAB_1401d9f4c;
    }
    uVar7 = FUN_140174f00(&local_40);
    FUN_1401fa5b0(uVar7,param_1,*param_4,*param_5);
    if (local_40 == (undefined8 *)0x0) {
      return 1;
    }
    if (local_40 == local_38) {
      LOCK();
      piVar1 = (int *)(local_40 + 1);
      iVar4 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      puVar3 = local_40;
      goto joined_r0x0001401da160;
    }
LAB_1401d9fd8:
    iVar4 = DAT_140608050 + 1;
    bVar8 = DAT_140608050 == 0;
    DAT_140608050 = iVar4;
    if (bVar8) {
      FUN_140176d60(1);
    }
    break;
  case 0xb:
    param_1 = param_1 + 0xdc;
    lVar5 = FUN_140174f50(param_1);
    if (lVar5 != 0) {
      plVar6 = (longlong *)FUN_140174f50(param_1);
      lVar5 = (**(code **)(*plVar6 + 0x270))(plVar6);
      if (lVar5 != 0) {
        uVar7 = FUN_140137690();
        FUN_140137640(uVar7,*param_4);
        uVar7 = FUN_140137690();
        iVar4 = FUN_140137490(uVar7,*param_4);
        local_68 = (float)iVar4;
        local_70 = *param_4;
        local_6c = 0;
        uVar7 = FUN_140174f50(param_1);
        FUN_140204470(uVar7,&local_70);
      }
    }
    break;
  case 0xc:
    FUN_1401dcdd0(param_1,*param_4,*param_5);
    break;
  case 0x15:
    local_20 = (undefined4)param_1[0x2e];
    local_1c = *(undefined4 *)((longlong)param_1 + 0x174);
    local_18 = (undefined4)param_1[0x2f];
    local_14 = *(undefined4 *)((longlong)param_1 + 0x17c);
    FUN_1402019b0(param_1[0x16a],(int)param_1[0x51],*(undefined4 *)((longlong)param_1 + 0x284),
                  param_2,&local_20);
    break;
  case 0x1f:
    (**(code **)(*param_1 + 0x28))(param_1,*param_4);
    break;
  case 0x20:
    (**(code **)(*param_1 + 0x30))(param_1,*param_4);
    break;
  case 0x33:
    FUN_1401de470(param_1);
  }
  return 1;
}



undefined8
FUN_1401da390(undefined8 param_1,undefined4 *param_2,ulonglong *param_3,ushort *param_4,
             ushort *param_5)

{
  longlong *plVar1;
  ushort uVar2;
  ushort uVar3;
  ulonglong uVar4;
  void *pvVar5;
  longlong lVar6;
  int iVar7;
  longlong lVar8;
  ushort *puVar9;
  bool bVar10;
  int local_48;
  int local_44 [3];
  longlong *local_38;
  longlong *local_30;
  
  local_44[1] = -2;
  local_44[2] = -1;
  puVar9 = param_4;
  FUN_140197b70(param_1,&local_38);
  plVar1 = local_38;
  if (local_38 != (longlong *)0x0) {
    if (local_38 == local_30) {
      lVar6 = *local_38;
      if (lVar6 != 0) {
        uVar2 = *param_5;
        uVar3 = *puVar9;
        if ((uVar3 < 5) && (uVar2 < 0x18)) {
          FUN_14034ed40(lVar6 + 0xf630);
          lVar8 = ((longlong)(short)uVar2 + (longlong)(short)uVar3 * 0x18) * 0xac;
          uVar4 = *(ulonglong *)(lVar8 + lVar6);
          bVar10 = uVar4 < *param_3;
          if ((uVar4 == *param_3) &&
             (uVar4 = *(ulonglong *)(lVar8 + 8 + lVar6), bVar10 = uVar4 < param_3[1],
             uVar4 == param_3[1])) {
            iVar7 = 0;
          }
          else {
            iVar7 = (1 - (uint)bVar10) - (uint)(bVar10 != 0);
          }
          FUN_14034edd0(lVar6 + 0xf630);
          if (iVar7 == 0) {
            local_48 = (int)(short)*param_5;
            local_44[0] = (int)(short)*param_4;
            FUN_1401af050(param_1,*param_2,local_44,&local_48);
          }
        }
        goto LAB_1401da4db;
      }
    }
    else {
      iVar7 = DAT_140608048 + 1;
      bVar10 = DAT_140608048 == 0;
      DAT_140608048 = iVar7;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 1;
  }
  if (plVar1 != local_30) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
LAB_1401da4db:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar6 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar6 == 1) {
    pvVar5 = (void *)*local_38;
    if (pvVar5 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar5 + 0xf630);
      operator_delete(pvVar5);
    }
    operator_delete(local_38);
  }
  return 1;
}



undefined8
FUN_1401da540(longlong param_1,undefined4 *param_2,int *param_3,undefined2 *param_4,
             longlong *param_5)

{
  short sVar1;
  undefined4 uVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined *puVar10;
  ulonglong uVar11;
  longlong *plVar12;
  short *psVar13;
  short *psVar14;
  bool bVar15;
  longlong *local_res8;
  undefined4 *local_res10;
  undefined2 *puVar16;
  undefined4 *puVar17;
  undefined4 uVar18;
  longlong **pplVar19;
  undefined4 *puVar20;
  undefined4 uVar21;
  undefined8 in_stack_fffffffffffffe50;
  undefined4 *puVar22;
  undefined4 uVar23;
  undefined8 in_stack_fffffffffffffe58;
  undefined4 uVar24;
  undefined2 local_198;
  undefined2 local_196;
  undefined2 local_194;
  undefined2 local_192;
  undefined2 local_190 [2];
  undefined4 local_18c;
  undefined4 local_188 [2];
  undefined4 local_180 [2];
  undefined4 local_178 [2];
  undefined4 local_170 [2];
  longlong *local_168;
  longlong *local_160;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  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;
  undefined4 local_11c;
  undefined2 local_118;
  undefined6 uStack_116;
  undefined8 local_108;
  ulonglong local_100;
  undefined8 local_f0;
  short local_e8 [12];
  undefined4 local_d0;
  short local_cc [70];
  undefined4 local_40;
  
  uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffe50 >> 0x20);
  uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffe58 >> 0x20);
  local_f0 = 0xfffffffffffffffe;
  plVar3 = *(longlong **)(param_1 + 0x6c0);
  if (plVar3 == (longlong *)0x0) {
    return 0;
  }
  local_res10 = param_2;
  if (plVar3 != *(longlong **)(param_1 + 0x6c8)) {
    if (DAT_140608048 != 0) {
      DAT_140608048 = DAT_140608048 + 1;
      return 0;
    }
    DAT_140608048 = DAT_140608048 + 1;
    FUN_140176d60(1);
    return 0;
  }
  if (*plVar3 == 0) {
    return 0;
  }
  FUN_140198570(param_1,&local_168);
  plVar3 = local_168;
  if (local_168 != (longlong *)0x0) {
    if (local_168 == local_160) {
      if (*local_168 != 0) {
        local_res8 = (longlong *)FUN_140208860(*local_168,*param_2);
        if (local_res8 != (longlong *)0x0) {
          FUN_14000a170(local_e8);
          iVar6 = 0;
          local_40 = 0;
          uVar8 = FUN_140174f00(param_1 + 0x6c0);
          if ((-1 < *param_3) && (iVar7 = FUN_1401ecce0(uVar8,param_3,param_4,local_e8), iVar7 != 0)
             ) {
            uVar8 = FUN_140137690();
            iVar7 = FUN_1401369d0(uVar8,local_d0);
            if (iVar7 == 0x36) {
              local_100 = 7;
              local_108 = 0;
              local_118 = 0;
              puVar10 = (undefined *)*param_5;
              if ((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) {
                iVar6 = *(int *)(puVar10 + -8);
              }
              if (puVar10 == (undefined *)0x0) {
                puVar10 = PTR_DAT_1405d8010;
              }
              if ((iVar6 == 0) || (cVar5 = FUN_140419350(puVar10,iVar6,&local_118), cVar5 == '\0'))
              {
                puVar10 = (undefined *)*param_5;
                if ((undefined *)*param_5 == (undefined *)0x0) {
                  puVar10 = PTR_DAT_1405d8010;
                }
                cVar5 = FUN_140167760(puVar10,&local_118);
                plVar12 = local_res8;
                if (cVar5 != '\0') {
                  psVar13 = (short *)*param_5;
                  if ((short *)*param_5 == (short *)0x0) {
                    psVar13 = (short *)PTR_DAT_1405d8010;
                  }
                  uVar11 = 0xffffffffffffffff;
                  psVar14 = psVar13;
                  do {
                    if (uVar11 == 0) break;
                    uVar11 = uVar11 - 1;
                    sVar1 = *psVar14;
                    psVar14 = psVar14 + 1;
                  } while (sVar1 != 0);
                  FUN_140001710(local_res8 + 0x1a,psVar13,~uVar11 - 1);
                  psVar13 = (short *)*param_5;
                  if ((short *)*param_5 == (short *)0x0) {
                    psVar13 = (short *)PTR_DAT_1405d8010;
                  }
                  lVar9 = (**(code **)(*plVar12 + 0x280))(plVar12);
                  uVar11 = 0xffffffffffffffff;
                  psVar14 = psVar13;
                  do {
                    if (uVar11 == 0) break;
                    uVar11 = uVar11 - 1;
                    sVar1 = *psVar14;
                    psVar14 = psVar14 + 1;
                  } while (sVar1 != 0);
                  FUN_140001710(lVar9 + 0x20,psVar13,~uVar11 - 1);
                  FUN_1401ff500(*(undefined8 *)(param_1 + 0xb50),param_1,local_res8);
                  local_180[0] = 1;
                  plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar12 + 0xca0))
                            (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res10,param_5
                             ,local_180);
                  local_cc[0] = local_cc[0] + -1;
                  local_res8 = (longlong *)CONCAT62(local_res8._2_6_,*param_4);
                  local_196 = (undefined2)*param_3;
                  plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  psVar13 = local_cc;
                  pplVar19 = &local_res8;
                  puVar16 = &local_196;
                  (**(code **)(*plVar12 + 0x290))
                            (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_e8,puVar16,
                             pplVar19,psVar13);
                  uVar21 = (undefined4)((ulonglong)pplVar19 >> 0x20);
                  uVar18 = (undefined4)((ulonglong)puVar16 >> 0x20);
                  uVar2 = *(undefined4 *)(param_1 + 0x160);
                  iVar6 = *(int *)(param_1 + 0x284);
                  lVar9 = *(longlong *)(param_1 + 0xb50);
                  if (local_cc[0] < 1) {
                    local_154 = *(undefined4 *)(param_1 + 0x164);
                    local_150 = *(undefined4 *)(param_1 + 0x168);
                    local_14c = *(undefined4 *)(param_1 + 0x16c);
                    local_128 = *(undefined4 *)(param_1 + 0x170);
                    local_124 = *(undefined4 *)(param_1 + 0x174);
                    local_120 = *(undefined4 *)(param_1 + 0x178);
                    local_11c = *(undefined4 *)(param_1 + 0x17c);
                    local_178[0] = 0xffffffff;
                    local_188[0] = 0xfffffff6;
                    local_158 = uVar2;
                    if (((-1 < iVar6) && (iVar6 < *(short *)(lVar9 + 700))) &&
                       (*(longlong *)(lVar9 + 0x4c0) != 0)) {
                      plVar12 = (longlong *)
                                (*(longlong *)
                                  (*(longlong *)(*(longlong *)(lVar9 + 0x4c0) + 8) +
                                  (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                      puVar17 = local_178;
                      puVar22 = local_188;
                      puVar20 = &local_158;
                      psVar13 = local_e8;
                      local_198 = (short)iVar6;
                      (**(code **)(*plVar12 + 0x130))
                                (plVar12,1,&DAT_1405d85a0,&local_198,&local_128,puVar20,local_e8,
                                 puVar22,puVar17);
                      uVar21 = (undefined4)((ulonglong)puVar20 >> 0x20);
                      uVar23 = (undefined4)((ulonglong)puVar22 >> 0x20);
                      uVar24 = (undefined4)((ulonglong)puVar17 >> 0x20);
                    }
                    uVar8 = FUN_140174f00(param_1 + 0x6c0);
                    FUN_1401e9d60(uVar8,param_1,param_3,param_4,local_e8);
                  }
                  else {
                    local_134 = *(undefined4 *)(param_1 + 0x164);
                    local_130 = *(undefined4 *)(param_1 + 0x168);
                    local_12c = *(undefined4 *)(param_1 + 0x16c);
                    local_148 = *(undefined4 *)(param_1 + 0x170);
                    local_144 = *(undefined4 *)(param_1 + 0x174);
                    local_140 = *(undefined4 *)(param_1 + 0x178);
                    local_13c = *(undefined4 *)(param_1 + 0x17c);
                    local_138 = uVar2;
                    if (((-1 < iVar6) && (iVar6 < *(short *)(lVar9 + 700))) &&
                       (*(longlong *)(lVar9 + 0x4c0) != 0)) {
                      plVar12 = (longlong *)
                                (*(longlong *)
                                  (*(longlong *)(*(longlong *)(lVar9 + 0x4c0) + 8) +
                                  (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
                      puVar20 = &local_138;
                      puVar17 = &local_148;
                      psVar13 = local_e8;
                      local_192 = (short)iVar6;
                      (**(code **)(*plVar12 + 0x140))
                                (plVar12,1,&DAT_1405d85a0,&local_192,puVar17,puVar20,local_e8);
                      uVar21 = (undefined4)((ulonglong)puVar20 >> 0x20);
                      uVar18 = (undefined4)((ulonglong)puVar17 >> 0x20);
                    }
                    uVar8 = FUN_140174f00(param_1 + 0x6c0);
                    if (-1 < *param_3) {
                      FUN_1401ed220(uVar8,param_3,param_4,local_e8,CONCAT44(uVar18,6));
                    }
                  }
                  FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,local_e8,
                                CONCAT44(uVar21,1),(ulonglong)psVar13 & 0xffffffff00000000,
                                CONCAT44(uVar23,local_cc[0] + 1),CONCAT44(uVar24,(int)local_cc[0]));
                  local_194 = *param_4;
                  local_190[0] = (undefined2)*param_3;
                  plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar12 + 0xe0))
                            (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_190,
                             &local_194,local_e8);
                  if (7 < local_100) {
                    operator_delete((void *)CONCAT62(uStack_116,local_118));
                  }
                  local_100 = 7;
                  local_108 = 0;
                  local_118 = 0;
                  goto LAB_1401daab7;
                }
              }
              if (7 < local_100) {
                operator_delete((void *)CONCAT62(uStack_116,local_118));
              }
            }
          }
          local_18c = 0;
          local_170[0] = 0x2b66;
          plVar12 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar12 + 0x70))
                    (plVar12,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_170,&local_18c);
LAB_1401daab7:
          LOCK();
          plVar3 = plVar3 + 1;
          *(int *)plVar3 = (int)*plVar3 + -1;
          UNLOCK();
          if ((int)*plVar3 == 0) {
            puVar4 = (undefined8 *)*local_168;
            if (puVar4 != (undefined8 *)0x0) {
              (**(code **)*puVar4)(puVar4,1);
            }
            operator_delete(local_168);
          }
          return 1;
        }
        local_res8 = (longlong *)0x0;
        goto LAB_1401dab56;
      }
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar15 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar3 == (longlong *)0x0) {
    return 0;
  }
  if (plVar3 != local_160) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 0;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_1401dab56:
  LOCK();
  plVar3 = plVar3 + 1;
  *(int *)plVar3 = (int)*plVar3 + -1;
  UNLOCK();
  if ((int)*plVar3 == 0) {
    puVar4 = (undefined8 *)*local_168;
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    operator_delete(local_168);
  }
  return 0;
}



undefined8
FUN_1401daba0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  LPSYSTEMTIME lpSystemTime;
  float fVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong lVar7;
  bool bVar8;
  longlong *local_30;
  longlong *local_28;
  
  FUN_140198570(param_1,&local_30,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_30;
  if (local_30 != (longlong *)0x0) {
    if (local_30 == local_28) {
      if (*local_30 != 0) {
        fVar2 = *(float *)(*local_30 + 0x22c4);
        lVar7 = DAT_140607cc0;
        if (DAT_140607cc0 == 0) {
          pvVar6 = operator_new(0x130);
          lVar7 = 0;
          if (pvVar6 != (void *)0x0) {
            lVar7 = FUN_1401e04e0(pvVar6);
          }
        }
        DAT_140607cc0 = lVar7;
        lpSystemTime = (LPSYSTEMTIME)(DAT_140607cc0 + 200);
        GetLocalTime(lpSystemTime);
        uVar5 = FUN_1401e2290(lpSystemTime);
        FUN_14020ac80(*plVar1,uVar5,param_2);
        if ((fVar2 != 0.0) && (*(float *)(*plVar1 + 0x22c4) == 0.0)) {
          FUN_1401d1430(param_1,0x11);
        }
        LOCK();
        plVar1 = plVar1 + 1;
        lVar7 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar7 == 1) {
          puVar3 = (undefined8 *)*local_30;
          if (puVar3 != (undefined8 *)0x0) {
            (**(code **)*puVar3)(puVar3,1);
          }
          operator_delete(local_30);
        }
        return 1;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_28) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar7 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        puVar3 = (undefined8 *)*local_30;
        if (puVar3 != (undefined8 *)0x0) {
          (**(code **)*puVar3)(puVar3,1);
        }
        operator_delete(local_30);
      }
    }
    else {
      iVar4 = DAT_140608054 + 1;
      bVar8 = DAT_140608054 == 0;
      DAT_140608054 = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



undefined8 FUN_1401dad50(longlong *param_1,longlong *param_2,char *param_3)

{
  void *pvVar1;
  undefined8 *puVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  wchar_t *pwVar6;
  size_t sVar7;
  longlong *plVar8;
  longlong *plVar9;
  bool bVar10;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  longlong *local_388;
  longlong *local_380;
  undefined4 local_378 [2];
  undefined4 local_370;
  undefined4 uStack_36c;
  undefined4 local_368;
  undefined4 uStack_364;
  undefined4 local_360;
  undefined4 local_35c;
  undefined4 local_358;
  undefined4 local_354;
  longlong *local_350;
  longlong *local_348;
  undefined4 local_338;
  undefined4 local_334;
  undefined4 local_330;
  undefined4 local_32c;
  undefined4 local_328;
  undefined4 local_324;
  undefined4 local_320;
  undefined4 local_31c;
  undefined4 local_318;
  undefined4 local_314;
  wchar_t local_310 [50];
  undefined2 local_2ac;
  wchar_t local_2aa [16];
  undefined8 local_28a;
  undefined8 local_282;
  undefined4 local_27a;
  wchar_t local_276 [16];
  undefined8 local_256;
  undefined8 local_248;
  WCHAR local_238;
  undefined1 local_236 [526];
  
  local_248 = 0xfffffffffffffffe;
  plVar8 = (longlong *)(param_1[0x16a] + 0x78);
  if (*param_3 == '\0') {
    local_res20[0] = 0;
    local_378[0] = 0x2b5f;
    (**(code **)(*plVar8 + 0x70))(plVar8,(int)param_1[1],&DAT_1405d85a0,local_378,local_res20);
    return 1;
  }
  (**(code **)(*plVar8 + 0xc00))(plVar8,(int)param_1[1],&DAT_1405d85a0,param_2);
  local_370 = *(undefined4 *)((longlong)param_1 + 0x194);
  uStack_36c = (undefined4)param_1[0x33];
  local_368 = *(undefined4 *)((longlong)param_1 + 0x19c);
  uStack_364 = (undefined4)param_1[0x34];
  bVar10 = false;
  if ((*(longlong *)((longlong)param_1 + 0x194) != 0) ||
     (*(longlong *)((longlong)param_1 + 0x19c) != 0)) {
    bVar10 = true;
  }
  if (bVar10) {
    FUN_1401e6310(DAT_140608080,&local_388,&local_370);
    plVar8 = local_388;
    if (local_388 != (longlong *)0x0) {
      if (local_388 == local_380) {
        if (*local_388 != 0) {
          lVar5 = FUN_140188c00(param_1[0x16a],*(undefined4 *)(*local_388 + 0x3c));
          if (lVar5 != 0) {
            local_360 = (undefined4)param_1[0x2e];
            local_35c = *(undefined4 *)((longlong)param_1 + 0x174);
            local_358 = (undefined4)param_1[0x2f];
            local_354 = *(undefined4 *)((longlong)param_1 + 0x17c);
            (**(code **)(*(longlong *)(lVar5 + 0x78) + 0x150))
                      ((longlong *)(lVar5 + 0x78),1,&DAT_1405d85a0,&local_370,&local_360,param_2);
            plVar8 = local_388;
          }
          if (plVar8 != (longlong *)0x0) {
            if (plVar8 == local_380) {
              if (plVar8 != (longlong *)0x0) {
                LOCK();
                plVar9 = plVar8 + 1;
                lVar5 = *plVar9;
                *(int *)plVar9 = (int)*plVar9 + -1;
                UNLOCK();
                if ((int)lVar5 == 1) {
                  local_388 = (longlong *)0x0;
                  pvVar1 = (void *)*plVar8;
                  if (pvVar1 != (void *)0x0) {
                    FUN_1402160c0(pvVar1);
                    operator_delete(pvVar1);
                  }
                  operator_delete(plVar8);
                }
              }
            }
            else {
              iVar3 = DAT_14060808c + 1;
              bVar10 = DAT_14060808c == 0;
              DAT_14060808c = iVar3;
              if (bVar10) {
                FUN_140176d60(1);
              }
            }
          }
          goto LAB_1401dafbf;
        }
      }
      else {
        iVar3 = DAT_140608088 + 1;
        bVar10 = DAT_140608088 == 0;
        DAT_140608088 = iVar3;
        if (bVar10) {
          FUN_140176d60(1);
          plVar8 = local_388;
        }
      }
    }
    if (plVar8 != (longlong *)0x0) {
      if (plVar8 == local_380) {
        if (plVar8 != (longlong *)0x0) {
          LOCK();
          plVar9 = plVar8 + 1;
          *(int *)plVar9 = (int)*plVar9 + -1;
          UNLOCK();
          if ((int)*plVar9 == 0) {
            local_388 = (longlong *)0x0;
            pvVar1 = (void *)*plVar8;
            if (pvVar1 != (void *)0x0) {
              FUN_1402160c0(pvVar1);
              operator_delete(pvVar1);
            }
            operator_delete(plVar8);
          }
        }
      }
      else {
        iVar3 = DAT_14060808c + 1;
        bVar10 = DAT_14060808c == 0;
        DAT_14060808c = iVar3;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
  }
  else {
LAB_1401dafbf:
    FUN_140198570(param_1);
    plVar8 = local_350;
    if (local_350 != (longlong *)0x0) {
      if (local_350 == local_348) {
        if (*local_350 != 0) {
          local_2ac = 0;
          local_28a = 0;
          local_282 = 0;
          local_27a = 0;
          local_256 = 0;
          memset(local_310,0,100);
          local_2aa[0] = L'\0';
          local_2aa[1] = L'\0';
          local_2aa[2] = L'\0';
          local_2aa[3] = L'\0';
          local_2aa[4] = L'\0';
          local_2aa[5] = L'\0';
          local_2aa[6] = L'\0';
          local_2aa[7] = L'\0';
          local_2aa[8] = L'\0';
          local_2aa[9] = L'\0';
          local_2aa[10] = L'\0';
          local_2aa[0xb] = L'\0';
          local_2aa[0xc] = L'\0';
          local_2aa[0xd] = L'\0';
          local_2aa[0xe] = L'\0';
          local_2aa[0xf] = L'\0';
          local_276[0] = L'\0';
          local_276[1] = L'\0';
          local_276[2] = L'\0';
          local_276[3] = L'\0';
          local_276[4] = L'\0';
          local_276[5] = L'\0';
          local_276[6] = L'\0';
          local_276[7] = L'\0';
          local_276[8] = L'\0';
          local_276[9] = L'\0';
          local_276[10] = L'\0';
          local_276[0xb] = L'\0';
          local_276[0xc] = L'\0';
          local_276[0xd] = L'\0';
          local_276[0xe] = L'\0';
          local_276[0xf] = L'\0';
          local_338 = 0x1f8;
          local_334 = *(undefined4 *)(DAT_140608000 + 0x140);
          local_330 = (undefined4)param_1[0x2c];
          local_32c = *(undefined4 *)((longlong)param_1 + 0x164);
          local_328 = (undefined4)param_1[0x2d];
          local_324 = *(undefined4 *)((longlong)param_1 + 0x16c);
          local_320 = (undefined4)param_1[0x2e];
          local_31c = *(undefined4 *)((longlong)param_1 + 0x174);
          local_318 = (undefined4)param_1[0x2f];
          local_314 = *(undefined4 *)((longlong)param_1 + 0x17c);
          uVar4 = FUN_1401a64a0(param_1);
          local_28a = CONCAT44(local_28a._4_4_,uVar4);
          uVar4 = FUN_1401a6390(param_1);
          local_28a = CONCAT44(uVar4,(undefined4)local_28a);
          uVar4 = FUN_1401a6310(param_1);
          local_282 = CONCAT44(local_282._4_4_,uVar4);
          local_27a = FUN_1401978f0(param_1);
          uVar4 = FUN_1401a6390(param_1);
          local_256 = CONCAT44(local_256._4_4_,uVar4);
          uVar4 = FUN_1401a6310(param_1);
          local_256 = CONCAT44(uVar4,(undefined4)local_256);
          local_2ac = (**(code **)(*param_1 + 0x18))(param_1);
          lVar5 = (**(code **)(*(longlong *)*plVar8 + 0x270))();
          local_282 = CONCAT44(*(undefined4 *)(lVar5 + 0xc4),(undefined4)local_282);
          pwVar6 = (wchar_t *)FUN_1401a6410(param_1);
          sVar7 = wcsnlen(pwVar6,0x10);
          if (sVar7 < 0x10) {
            pwVar6 = (wchar_t *)*param_2;
            if ((wchar_t *)*param_2 == (wchar_t *)0x0) {
              pwVar6 = (wchar_t *)PTR_DAT_1405d8010;
            }
            wcscpy_s(local_2aa,0x10,pwVar6);
            pwVar6 = (wchar_t *)FUN_1401a6410(param_1);
            wcscpy_s(local_276,0x10,pwVar6);
          }
          local_238 = L'\0';
          memset(local_236,0,0x206);
          MultiByteToWideChar(0,1,(LPCSTR)(param_1 + 0x66),0x32,&local_238,0x32);
          sVar7 = wcsnlen(&local_238,0x32);
          if (sVar7 < 0x32) {
            wcscpy_s(local_310,0x32,&local_238);
          }
          iVar3 = *(int *)((longlong)param_1 + 0x284);
          if (((-1 < iVar3) && (iVar3 < *(short *)(param_1[0x16a] + 700))) &&
             (lVar5 = *(longlong *)(param_1[0x16a] + 0x4c8), lVar5 != 0)) {
            local_res18[0] = (undefined2)iVar3;
            plVar9 = (longlong *)
                     (*(longlong *)(*(longlong *)(lVar5 + 8) + (longlong)(int)param_1[0x51] * 8) +
                     0x70);
            (**(code **)(*plVar9 + 0xc70))(plVar9,1,&DAT_1405d85a0,local_res18,&local_338);
          }
        }
      }
      else {
        iVar3 = DAT_14060804c + 1;
        bVar10 = DAT_14060804c == 0;
        DAT_14060804c = iVar3;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar8 != (longlong *)0x0) {
      if (plVar8 == local_348) {
        LOCK();
        plVar8 = plVar8 + 1;
        *(int *)plVar8 = (int)*plVar8 + -1;
        UNLOCK();
        if ((int)*plVar8 == 0) {
          puVar2 = (undefined8 *)*local_350;
          if (puVar2 != (undefined8 *)0x0) {
            (**(code **)*puVar2)(puVar2,1);
          }
          operator_delete(local_350);
        }
      }
      else {
        iVar3 = DAT_140608054 + 1;
        bVar10 = DAT_140608054 == 0;
        DAT_140608054 = iVar3;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return 1;
}



undefined8 FUN_1401db2f0(longlong param_1,int *param_2,uint *param_3,undefined2 *param_4)

{
  int iVar1;
  uint uVar2;
  undefined4 *puVar3;
  longlong lVar4;
  uint *puVar5;
  undefined1 local_c8 [16];
  undefined4 local_b8;
  undefined4 uStack_b4;
  undefined4 uStack_b0;
  undefined4 uStack_ac;
  uint local_a0;
  undefined2 local_9c;
  uint local_94;
  undefined4 local_10;
  
  iVar1 = *param_2;
  if (iVar1 == 1) {
    FUN_14000a170(&local_b8);
    local_10 = 0;
    puVar3 = (undefined4 *)FUN_140357570(local_c8);
    uVar2 = *param_3;
    local_b8 = *puVar3;
    uStack_b4 = puVar3[1];
    uStack_b0 = puVar3[2];
    uStack_ac = puVar3[3];
    local_9c = *param_4;
    local_a0 = uVar2;
    lVar4 = FUN_140137690();
    if (*(longlong *)(lVar4 + 0x88) != 0) {
      for (puVar5 = *(uint **)(*(longlong *)(lVar4 + 0x88) +
                              ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar4 + 0x98)) * 8);
          puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xa6)) {
        if ((puVar5[0xa8] == uVar2) && (*puVar5 == uVar2)) {
          if (puVar5 != (uint *)0x0) goto LAB_1401db3a4;
          break;
        }
      }
    }
    puVar5 = (uint *)0x0;
LAB_1401db3a4:
    if (puVar5 == (uint *)0x0) {
      local_94 = 1;
    }
    else {
      local_94 = puVar5[0x52];
    }
    FUN_1401db460(param_1,&local_b8);
  }
  else if (iVar1 == 0x146) {
    printf("RESULT_CODE == GAME_DEF_ERROR::EX_DB_ERROR_COUPON_NOT_EXISTENCE \n");
  }
  else if (iVar1 == 0x147) {
    printf("RESULT_CODE == GAME_DEF_ERROR::EX_DB_ERROR_COUPON_USED \n");
  }
  else {
    printf("RESULT_CODE [ %d ] \n");
  }
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78) + 0xc80))
            (*(longlong *)(param_1 + 0xb50) + 0x78,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,
             param_2,param_3,param_4);
  return 1;
}



void FUN_1401db460(longlong param_1,undefined8 param_2)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined4 *puVar3;
  undefined4 uVar4;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  local_18 = *(undefined4 *)(param_1 + 0x170);
  uVar4 = *(undefined4 *)(param_1 + 0x284);
  uVar1 = *(undefined4 *)(param_1 + 0x288);
  local_14 = *(undefined4 *)(param_1 + 0x174);
  local_10 = *(undefined4 *)(param_1 + 0x178);
  local_c = *(undefined4 *)(param_1 + 0x17c);
  uVar2 = FUN_1401a6410();
  puVar3 = &local_18;
  FUN_1401ff8e0(*(undefined8 *)(param_1 + 0xb50),uVar1,uVar4,*(undefined4 *)(param_1 + 8),puVar3,
                uVar2,&DAT_140477960,0,0x13,&DAT_14047ba14,param_2);
  uVar4 = (undefined4)((ulonglong)puVar3 >> 0x20);
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78) + 0x940))
            (*(longlong *)(param_1 + 0xb50) + 0x78,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0);
  uVar2 = FUN_1401a6410(param_1);
  FUN_1402031e0(*(undefined8 *)(param_1 + 0xb50),param_1,param_2,uVar2,CONCAT44(uVar4,0x13));
  return;
}



undefined8 FUN_1401db560(longlong param_1,uint param_2)

{
  longlong *plVar1;
  uint uVar2;
  uint *puVar3;
  int *piVar4;
  undefined8 *puVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  uint *puVar9;
  longlong *plVar10;
  uint *puVar11;
  undefined8 uVar12;
  uint uVar13;
  uint uVar14;
  uint *puVar15;
  bool bVar16;
  float fVar17;
  int local_38 [2];
  float local_30;
  
  plVar1 = (longlong *)(param_1 + 0x6e0);
  plVar10 = (longlong *)*plVar1;
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == *(longlong **)(param_1 + 0x6e8)) {
      if (*plVar10 != 0) {
        lVar8 = FUN_140137690();
        puVar15 = (uint *)0x0;
        uVar14 = 0;
        puVar11 = puVar15;
        if (*(longlong *)(lVar8 + 0x88) != 0) {
          for (puVar9 = *(uint **)(*(longlong *)(lVar8 + 0x88) +
                                  ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar8 + 0x98)) * 8);
              puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0xa6)) {
            if ((puVar9[0xa8] == param_2) && (*puVar9 == param_2)) {
              if (puVar9 != (uint *)0x0) {
                puVar11 = (uint *)(ulonglong)puVar9[0x80];
              }
              break;
            }
          }
        }
        lVar8 = FUN_140137690();
        puVar9 = puVar15;
        if (*(longlong *)(lVar8 + 0x88) != 0) {
          for (puVar3 = *(uint **)(*(longlong *)(lVar8 + 0x88) +
                                  ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar8 + 0x98)) * 8);
              (puVar9 = puVar15, puVar3 != (uint *)0x0 &&
              ((puVar3[0xa8] != param_2 || (puVar9 = puVar3, *puVar3 != param_2))));
              puVar3 = *(uint **)(puVar3 + 0xa6)) {
          }
        }
        if (puVar9 != (uint *)0x0) {
          uVar14 = puVar9[0x51];
        }
        fVar17 = (float)(int)uVar14;
        plVar10 = (longlong *)FUN_1403161f0();
        iVar6 = (int)puVar11;
        uVar14 = 0xffffffff;
        if (*plVar10 != 0) {
          for (piVar4 = *(int **)(*plVar10 +
                                 ((ulonglong)puVar11 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
              (piVar4 != (int *)0x0 && ((piVar4[0xea] != iVar6 || (*piVar4 != iVar6))));
              piVar4 = *(int **)(piVar4 + 0xe8)) {
          }
        }
        plVar10 = (longlong *)FUN_1403161f0();
        if (*plVar10 != 0) {
          for (piVar4 = *(int **)(*plVar10 +
                                 ((ulonglong)puVar11 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
              piVar4 != (int *)0x0; piVar4 = *(int **)(piVar4 + 0xe8)) {
            if ((piVar4[0xea] == iVar6) && (*piVar4 == iVar6)) {
              if (piVar4 != (int *)0x0) {
                uVar13 = piVar4[6];
                goto LAB_1401db704;
              }
              break;
            }
          }
        }
        uVar13 = 0xffffffff;
LAB_1401db704:
        puVar5 = (undefined8 *)*plVar1;
        puVar11 = puVar15;
        if (puVar5 != (undefined8 *)0x0) {
          if (puVar5 == *(undefined8 **)(param_1 + 0x6e8)) {
            puVar11 = (uint *)*puVar5;
          }
          else {
            iVar7 = DAT_14060804c + 1;
            bVar16 = DAT_14060804c == 0;
            DAT_14060804c = iVar7;
            if (bVar16) {
              FUN_140176d60(1);
            }
          }
        }
        puVar11 = (uint *)FUN_140204370(puVar11);
        local_38[1] = 0;
        local_38[0] = iVar6;
        local_30 = fVar17;
        if (puVar11 == (uint *)0x0) {
          puVar5 = (undefined8 *)*plVar1;
          if (puVar5 != (undefined8 *)0x0) {
            if (puVar5 == *(undefined8 **)(param_1 + 0x6e8)) {
              puVar15 = (uint *)*puVar5;
            }
            else {
              iVar6 = DAT_14060804c + 1;
              bVar16 = DAT_14060804c == 0;
              DAT_14060804c = iVar6;
              if (bVar16) {
                FUN_140176d60(1);
                FUN_140204470(0,local_38);
                return 1;
              }
            }
          }
          FUN_140204470(puVar15,local_38);
          uVar12 = 1;
        }
        else {
          uVar2 = *puVar11;
          plVar10 = (longlong *)FUN_1403161f0();
          if (*plVar10 != 0) {
            for (puVar15 = *(uint **)(*plVar10 +
                                     ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
                puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0xe8)) {
              if ((puVar15[0xea] == uVar2) && (*puVar15 == uVar2)) {
                if (puVar15 != (uint *)0x0) {
                  uVar14 = puVar15[6];
                }
                break;
              }
            }
          }
          if ((int)uVar14 < (int)uVar13) {
            uVar12 = FUN_140174f50(plVar1);
            FUN_140204890(uVar12,puVar11);
            uVar12 = FUN_140174f50(plVar1);
            FUN_140204470(uVar12,local_38);
            uVar12 = 1;
          }
          else if (uVar14 == uVar13) {
            puVar11[2] = (uint)(fVar17 + (float)puVar11[2]);
            uVar12 = FUN_140174f50(plVar1);
            FUN_1402046b0(uVar12,puVar11);
            uVar12 = FUN_140174f50(plVar1);
            FUN_14023a2b0(uVar12,*puVar11,fVar17);
            uVar12 = 1;
          }
          else {
            uVar12 = 0;
          }
        }
        return uVar12;
      }
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar16 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar16) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001401db9b1)
// WARNING: Removing unreachable block (ram,0x0001401db9ba)
// WARNING: Removing unreachable block (ram,0x0001401db9d8)
// WARNING: Removing unreachable block (ram,0x0001401db9e1)

undefined8 FUN_1401db8b0(longlong param_1,undefined4 *param_2,int *param_3)

{
  longlong *plVar1;
  void *pvVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  ulonglong uVar6;
  undefined8 uVar7;
  uint *puVar8;
  longlong *plVar9;
  longlong lVar10;
  uint uVar11;
  ulonglong uVar12;
  int *piVar13;
  longlong lVar14;
  longlong *plVar15;
  bool bVar16;
  short local_res8 [4];
  undefined8 local_c8;
  int local_c0;
  undefined4 local_bc;
  longlong *local_b8;
  longlong *local_b0;
  uint local_a8;
  undefined4 local_a4;
  uint local_a0;
  int local_9c;
  undefined4 local_98;
  longlong *local_88;
  longlong local_80;
  uint local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined8 local_68;
  undefined8 local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x298) < 100) {
LAB_1401dbc0c:
    uVar7 = 1;
  }
  else {
    piVar13 = param_3;
    FUN_140197b70(param_1,&local_b8);
    plVar1 = local_b8;
    if (local_b8 != (longlong *)0x0) {
      if (local_b8 == local_b0) {
        if (*local_b8 != 0) {
          plVar9 = (longlong *)0x0;
          local_88 = (longlong *)0x0;
          local_80 = 0;
          uVar12 = 0x11;
          local_78 = 0x11;
          local_58 = 0;
          local_54 = 10;
          local_50 = 0;
          local_48 = 0;
          local_74 = 0x3f400000;
          local_70 = 0x3e800000;
          local_6c = 0x40100000;
          local_68 = 0x26;
          local_60 = 0;
          plVar15 = plVar9;
          if (0 < *piVar13) {
            do {
              local_c8 = 0;
              local_c0 = 0;
              local_bc = 1;
              cVar3 = FUN_1401f61c0(*param_2,&local_c8,(longlong)&local_c8 + 4,local_res8,0);
              if (cVar3 != '\0') {
                local_c0 = local_c0 + local_res8[0];
                if (plVar15 != (longlong *)0x0) {
                  for (puVar8 = (uint *)plVar15[(ulonglong)local_c8._4_4_ % uVar12];
                      puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 6)) {
                    if ((puVar8[8] == local_c8._4_4_) && (*puVar8 == local_c8._4_4_)) {
                      if (puVar8 != (uint *)0x0) {
                        if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        puVar8[3] = puVar8[3] + local_c0;
                        if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        puVar8[4] = puVar8[4] + 1;
                        goto LAB_1401dbad6;
                      }
                      break;
                    }
                  }
                }
                local_bc = 1;
                local_a8 = local_c8._4_4_;
                local_a4 = (undefined4)local_c8;
                local_a0 = local_c8._4_4_;
                local_98 = 1;
                local_9c = local_c0;
                FUN_1401df4e0(&local_88,local_c8._4_4_,&local_a4);
                uVar12 = (ulonglong)local_78;
                plVar15 = local_88;
              }
LAB_1401dbad6:
              uVar11 = (int)plVar9 + 1;
              plVar9 = (longlong *)(ulonglong)uVar11;
            } while ((int)uVar11 < *param_3);
          }
          lVar14 = local_80;
          printf("ITEM RAND BOX-----------------\n");
          printf("--                            \n");
          uVar11 = (uint)uVar12;
          if ((lVar14 != 0) && (uVar6 = 0, plVar9 = plVar15, uVar11 != 0)) {
            do {
              if (*plVar9 != 0) {
                lVar14 = plVar15[uVar6];
                goto LAB_1401dbb40;
              }
              uVar5 = (int)uVar6 + 1;
              uVar6 = (ulonglong)uVar5;
              plVar9 = plVar9 + 1;
            } while (uVar5 < uVar11);
          }
          lVar14 = 0;
LAB_1401dbb40:
          lVar10 = lVar14;
          if (lVar10 != 0) {
            printf("ID : %d\tITEM : %d\tCOUNT AVG: %d\tCOUNT %d / %d\n");
            lVar14 = *(longlong *)(lVar10 + 0x18);
            if (lVar14 == 0) {
              uVar5 = (int)((ulonglong)*(uint *)(lVar10 + 0x20) % uVar12) + 1;
              plVar9 = plVar15 + (int)uVar5;
              do {
                if (uVar11 <= uVar5) break;
                if (*plVar9 != 0) {
                  lVar14 = *plVar9;
                }
                uVar5 = uVar5 + 1;
                plVar9 = plVar9 + 1;
              } while (lVar14 == 0);
            }
            goto LAB_1401dbb40;
          }
          printf("--                            \n");
          printf("TEST COUNT : %d---------------\n");
          FUN_1401df5b0(&local_88);
          LOCK();
          plVar1 = plVar1 + 1;
          lVar14 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar14 == 1) {
            pvVar2 = (void *)*local_b8;
            if (pvVar2 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar2 + 0xf630);
              operator_delete(pvVar2);
            }
            operator_delete(local_b8);
          }
          goto LAB_1401dbc0c;
        }
      }
      else {
        iVar4 = DAT_140608048 + 1;
        bVar16 = DAT_140608048 == 0;
        DAT_140608048 = iVar4;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_b0) {
        LOCK();
        plVar1 = plVar1 + 1;
        lVar14 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar14 == 1) {
          pvVar2 = (void *)*local_b8;
          if (pvVar2 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar2 + 0xf630);
            operator_delete(pvVar2);
          }
          operator_delete(local_b8);
        }
      }
      else {
        iVar4 = DAT_140608050 + 1;
        bVar16 = DAT_140608050 == 0;
        DAT_140608050 = iVar4;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    uVar7 = 0;
  }
  return uVar7;
}



void thunk_FUN_1401df5b0(void)

{
  FUN_1401df5b0();
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401dbd62)
// WARNING: Removing unreachable block (ram,0x0001401dbd6b)
// WARNING: Removing unreachable block (ram,0x0001401dbd89)
// WARNING: Removing unreachable block (ram,0x0001401dbd92)

undefined8 FUN_1401dbcb0(longlong param_1,uint *param_2,int *param_3)

{
  void *pvVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  uint *puVar7;
  uint *puVar8;
  longlong *plVar9;
  ulonglong *puVar10;
  uint uVar11;
  ulonglong uVar12;
  longlong *plVar13;
  ulonglong uVar14;
  longlong *plVar15;
  undefined4 extraout_XMM0_Da;
  undefined4 uVar16;
  undefined4 extraout_XMM0_Da_00;
  undefined4 local_c4;
  uint local_c0;
  int local_bc;
  undefined4 local_b8;
  longlong *local_a8;
  longlong *local_a0;
  uint local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined8 local_88;
  undefined8 local_80;
  undefined4 local_78;
  undefined4 local_74;
  undefined8 local_70;
  undefined8 local_68;
  void *local_58;
  longlong local_50;
  undefined8 local_48;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (99 < *(int *)(param_1 + 0x298)) {
    plVar9 = (longlong *)0x0;
    local_a8 = (longlong *)0x0;
    local_a0 = (longlong *)0x0;
    uVar14 = 0x11;
    local_98 = 0x11;
    local_78 = 0;
    local_74 = 10;
    local_70 = 0;
    local_68 = 0;
    local_94 = 0x3f400000;
    local_90 = 0x3e800000;
    local_8c = 0x40100000;
    local_88 = 0x26;
    local_80 = 0;
    uVar11 = *param_2;
    lVar4 = FUN_140137690();
    if (*(longlong *)(lVar4 + 0x88) != 0) {
      puVar7 = *(uint **)(*(longlong *)(lVar4 + 0x88) +
                         ((ulonglong)uVar11 % (ulonglong)*(uint *)(lVar4 + 0x98)) * 8);
LAB_1401dbdd0:
      if (puVar7 == (uint *)0x0) goto LAB_1401dc0a4;
      if ((puVar7[0xa8] != uVar11) || (*puVar7 != uVar11)) goto LAB_1401dbde1;
      if (puVar7 == (uint *)0x0) goto LAB_1401dc0a4;
      if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      if (puVar7 == (uint *)0xfffffffffffffff8) goto LAB_1401dc0a4;
      if (puVar7[0x37] != 1) {
        printf("Don\'t DECOMPOSITIONITEM!!! [ %d ] -----------\n");
        goto LAB_1401dc0a4;
      }
      plVar13 = plVar9;
      plVar15 = plVar9;
      if (0 < *param_3) {
        do {
          uVar11 = (uint)plVar9;
          local_58 = (void *)0x0;
          local_50 = 0;
          local_48 = 0;
          iVar2 = FUN_140266ab0(*param_2,puVar7[0x38],&local_58);
          pvVar1 = local_58;
          if (iVar2 == 0) {
            if (local_58 != (void *)0x0) {
              operator_delete(local_58);
            }
          }
          else {
            lVar4 = (local_50 - (longlong)local_58) / 0x56 + (local_50 - (longlong)local_58 >> 0x3f)
            ;
            uVar3 = local_c0;
            iVar2 = local_bc;
            while (local_c0 = uVar3, local_bc = iVar2,
                  (int)uVar11 < (int)(lVar4 >> 1) - (int)(lVar4 >> 0x3f)) {
              local_bc = (int)*(short *)((longlong)pvVar1 + 0x1c);
              local_c0 = *(uint *)((longlong)pvVar1 + 0x18);
              if (plVar15 != (longlong *)0x0) {
                for (puVar8 = (uint *)plVar15[(ulonglong)local_c0 % uVar14]; puVar8 != (uint *)0x0;
                    puVar8 = *(uint **)(puVar8 + 6)) {
                  if ((puVar8[8] == local_c0) && (*puVar8 == local_c0)) {
                    if (puVar8 != (uint *)0x0) {
                      if (puVar8 == (uint *)0x0) {
                        local_c0 = uVar3;
                        local_bc = iVar2;
                    // WARNING: Subroutine does not return
                        FUN_14000d450(0x80004005);
                      }
                      puVar8[3] = puVar8[3] + local_bc;
                      if (puVar8 == (uint *)0x0) {
                        local_c0 = uVar3;
                        local_bc = iVar2;
                    // WARNING: Subroutine does not return
                        FUN_14000d450(0x80004005);
                      }
                      puVar8[4] = puVar8[4] + 1;
                      local_c0 = uVar3;
                      local_bc = iVar2;
                      goto LAB_1401dbf5c;
                    }
                    break;
                  }
                }
              }
              local_c4 = 0;
              local_b8 = 1;
              FUN_1401df4e0(&local_a8,local_c0,&local_c4);
              uVar14 = (ulonglong)local_98;
              plVar15 = local_a8;
LAB_1401dbf5c:
              uVar11 = (int)plVar9 + 1;
              plVar9 = (longlong *)(ulonglong)uVar11;
              uVar3 = local_c0;
              iVar2 = local_bc;
            }
            if (pvVar1 != (void *)0x0) {
              operator_delete(pvVar1);
            }
          }
          plVar9 = (longlong *)(ulonglong)(uVar11 + 1);
          plVar13 = local_a0;
        } while ((int)(uVar11 + 1) < *param_3);
      }
      uVar12 = 0;
      printf("DECOMPOSITIONITEM-- %d -----------\n");
      printf("--                                \n");
      uVar11 = (uint)uVar14;
      uVar16 = extraout_XMM0_Da;
      if ((plVar13 != (longlong *)0x0) && (uVar5 = uVar12, plVar9 = plVar15, uVar11 != 0)) {
        do {
          if (*plVar9 != 0) {
            uVar12 = plVar15[uVar5];
            break;
          }
          uVar3 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar3;
          plVar9 = plVar9 + 1;
        } while (uVar3 < uVar11);
      }
      do {
        uVar5 = uVar12;
        if (uVar5 == 0) {
          printf("--                                \n");
          printf("TEST COUNT : %d-------------------\n");
          break;
        }
        uVar6 = FUN_140137690(uVar16,(longlong)*(int *)(uVar5 + 0xc) %
                                     (longlong)*(int *)(uVar5 + 0x10) & 0xffffffff);
        FUN_1401367c0(uVar6,*(undefined4 *)(uVar5 + 8));
        wprintf(L"ITEM : %d(%s)\tCOUNT AVG: %d\tCOUNT %d / %d\n");
        uVar12 = *(ulonglong *)(uVar5 + 0x18);
        uVar16 = extraout_XMM0_Da_00;
        if (uVar12 == 0) {
          uVar3 = (int)((ulonglong)*(uint *)(uVar5 + 0x20) % uVar14) + 1;
          puVar10 = (ulonglong *)(plVar15 + (int)uVar3);
          do {
            if (uVar11 <= uVar3) break;
            if (*puVar10 != 0) {
              uVar12 = *puVar10;
            }
            uVar3 = uVar3 + 1;
            puVar10 = puVar10 + 1;
          } while (uVar12 == 0);
        }
      } while( true );
    }
LAB_1401dc0a4:
    FUN_1401df5b0(&local_a8);
  }
  return 1;
LAB_1401dbde1:
  puVar7 = *(uint **)(puVar7 + 0xa6);
  goto LAB_1401dbdd0;
}



undefined8 FUN_1401dc0d0(longlong param_1,int *param_2,int *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_18;
  longlong *local_10;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_18);
  plVar1 = local_18;
  if (local_18 == (longlong *)0x0) {
    return 1;
  }
  if (local_18 == local_10) {
    lVar3 = *local_18;
    if (lVar3 != 0) {
      iVar4 = *param_2;
      if (iVar4 == 1) {
        *(int *)(lVar3 + 0x6c8) = *(int *)(lVar3 + 0x6c8) + *param_3;
      }
      else if (iVar4 == 2) {
        *(int *)(lVar3 + 0x6cc) = *(int *)(lVar3 + 0x6cc) + *param_3;
      }
      else if (iVar4 == 3) {
        *(int *)(lVar3 + 0x6d0) = *(int *)(lVar3 + 0x6d0) + *param_3;
      }
      else if (iVar4 == 4) {
        *(int *)(lVar3 + 0x6d4) = *(int *)(lVar3 + 0x6d4) + *param_3;
      }
      else if (iVar4 == 5) {
        *(int *)(lVar3 + 0x6d8) = *(int *)(lVar3 + 0x6d8) + *param_3;
      }
      else if (iVar4 == 6) {
        *(int *)(lVar3 + 0x6dc) = *(int *)(lVar3 + 0x6dc) + *param_3;
      }
      else if (iVar4 == 7) {
        *(int *)(lVar3 + 0x6e0) = *(int *)(lVar3 + 0x6e0) + *param_3;
      }
      else {
        if (iVar4 != 8) goto LAB_1401dc1c0;
        *(int *)(lVar3 + 0x6e4) = *(int *)(lVar3 + 0x6e4) + *param_3;
      }
      *(undefined1 *)(lVar3 + 0x606) = 1;
    }
  }
  else {
    iVar4 = DAT_14060804c + 1;
    bVar5 = DAT_14060804c == 0;
    DAT_14060804c = iVar4;
    if (bVar5) {
      FUN_140176d60(1);
    }
  }
LAB_1401dc1c0:
  if (plVar1 == local_10) {
    LOCK();
    plVar1 = plVar1 + 1;
    lVar3 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar3 == 1) {
      puVar2 = (undefined8 *)*local_18;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      operator_delete(local_18);
    }
  }
  else {
    iVar4 = DAT_140608054 + 1;
    bVar5 = DAT_140608054 == 0;
    DAT_140608054 = iVar4;
    if (bVar5) {
      FUN_140176d60(1);
      return 1;
    }
  }
  return 1;
}



undefined8 FUN_1401dc230(longlong param_1,int *param_2,int *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_18;
  longlong *local_10;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_18);
  plVar1 = local_18;
  if (local_18 == (longlong *)0x0) {
    return 1;
  }
  if (local_18 == local_10) {
    lVar3 = *local_18;
    if (lVar3 != 0) {
      iVar4 = *param_2;
      if (iVar4 == 1) {
        *(int *)(lVar3 + 0x668) = *(int *)(lVar3 + 0x668) + *param_3;
      }
      else if (iVar4 == 2) {
        *(int *)(lVar3 + 0x66c) = *(int *)(lVar3 + 0x66c) + *param_3;
      }
      else if (iVar4 == 3) {
        *(int *)(lVar3 + 0x670) = *(int *)(lVar3 + 0x670) + *param_3;
      }
      else if (iVar4 == 4) {
        *(int *)(lVar3 + 0x674) = *(int *)(lVar3 + 0x674) + *param_3;
      }
      else if (iVar4 == 5) {
        *(int *)(lVar3 + 0x678) = *(int *)(lVar3 + 0x678) + *param_3;
      }
      else if (iVar4 == 6) {
        *(int *)(lVar3 + 0x67c) = *(int *)(lVar3 + 0x67c) + *param_3;
      }
      else if (iVar4 == 7) {
        *(int *)(lVar3 + 0x680) = *(int *)(lVar3 + 0x680) + *param_3;
      }
      else {
        if (iVar4 != 8) goto LAB_1401dc320;
        *(int *)(lVar3 + 0x684) = *(int *)(lVar3 + 0x684) + *param_3;
      }
      *(undefined1 *)(lVar3 + 0x606) = 1;
    }
  }
  else {
    iVar4 = DAT_14060804c + 1;
    bVar5 = DAT_14060804c == 0;
    DAT_14060804c = iVar4;
    if (bVar5) {
      FUN_140176d60(1);
    }
  }
LAB_1401dc320:
  if (plVar1 == local_10) {
    LOCK();
    plVar1 = plVar1 + 1;
    lVar3 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar3 == 1) {
      puVar2 = (undefined8 *)*local_18;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      operator_delete(local_18);
    }
  }
  else {
    iVar4 = DAT_140608054 + 1;
    bVar5 = DAT_140608054 == 0;
    DAT_140608054 = iVar4;
    if (bVar5) {
      FUN_140176d60(1);
      return 1;
    }
  }
  return 1;
}



undefined8 FUN_1401dc390(longlong param_1,int *param_2,int *param_3)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_18;
  longlong *local_10;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_18);
  plVar1 = local_18;
  if (local_18 == (longlong *)0x0) {
    return 1;
  }
  if (local_18 == local_10) {
    lVar3 = *local_18;
    if (lVar3 != 0) {
      iVar4 = *param_2;
      if (iVar4 == 1) {
        *(float *)(lVar3 + 0x7b8) = (float)*param_3 + *(float *)(lVar3 + 0x7b8);
      }
      else if (iVar4 == 2) {
        *(float *)(lVar3 + 0x7bc) = (float)*param_3 + *(float *)(lVar3 + 0x7bc);
      }
      else if (iVar4 == 3) {
        *(float *)(lVar3 + 0x7c0) = (float)*param_3 + *(float *)(lVar3 + 0x7c0);
      }
      else if (iVar4 == 4) {
        *(float *)(lVar3 + 0x7c4) = (float)*param_3 + *(float *)(lVar3 + 0x7c4);
      }
      else if (iVar4 == 5) {
        *(float *)(lVar3 + 0x7c8) = (float)*param_3 + *(float *)(lVar3 + 0x7c8);
      }
      else if (iVar4 == 6) {
        *(float *)(lVar3 + 0x7cc) = (float)*param_3 + *(float *)(lVar3 + 0x7cc);
      }
      else if (iVar4 == 7) {
        *(float *)(lVar3 + 2000) = (float)*param_3 + *(float *)(lVar3 + 2000);
      }
      else if (iVar4 == 8) {
        *(float *)(lVar3 + 0x7d4) = (float)*param_3 + *(float *)(lVar3 + 0x7d4);
      }
      else if (iVar4 == 9) {
        *(float *)(lVar3 + 0x7d8) = (float)*param_3 + *(float *)(lVar3 + 0x7d8);
      }
      else if (iVar4 == 10) {
        *(float *)(lVar3 + 0x7dc) = (float)*param_3 + *(float *)(lVar3 + 0x7dc);
      }
      else if (iVar4 == 0xb) {
        *(float *)(lVar3 + 0x7e0) = (float)*param_3 + *(float *)(lVar3 + 0x7e0);
      }
      else if (iVar4 == 0xc) {
        *(float *)(lVar3 + 0x7e4) = (float)*param_3 + *(float *)(lVar3 + 0x7e4);
      }
      else if (iVar4 == 0xd) {
        *(float *)(lVar3 + 0x7e8) = (float)*param_3 + *(float *)(lVar3 + 0x7e8);
      }
      else {
        if (iVar4 != 0xe) goto LAB_1401dc5cd;
        *(float *)(lVar3 + 0x7ec) = (float)*param_3 + *(float *)(lVar3 + 0x7ec);
      }
      *(undefined1 *)(lVar3 + 0x607) = 1;
    }
  }
  else {
    iVar4 = DAT_14060804c + 1;
    bVar5 = DAT_14060804c == 0;
    DAT_14060804c = iVar4;
    if (bVar5) {
      FUN_140176d60(1);
    }
  }
LAB_1401dc5cd:
  if (plVar1 == local_10) {
    LOCK();
    plVar1 = plVar1 + 1;
    lVar3 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar3 == 1) {
      puVar2 = (undefined8 *)*local_18;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      operator_delete(local_18);
    }
  }
  else {
    iVar4 = DAT_140608054 + 1;
    bVar5 = DAT_140608054 == 0;
    DAT_140608054 = iVar4;
    if (bVar5) {
      FUN_140176d60(1);
      return 1;
    }
  }
  return 1;
}



undefined8 FUN_1401dc640(longlong param_1,int *param_2,int *param_3,int *param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_18;
  longlong *local_10;
  
  if (*(int *)(param_1 + 0x298) < 100) {
    return 1;
  }
  FUN_140198570(param_1,&local_18);
  plVar1 = local_18;
  if (local_18 == (longlong *)0x0) {
    return 1;
  }
  if (local_18 == local_10) {
    lVar3 = *local_18;
    if (lVar3 != 0) {
      iVar4 = *param_2;
      if (iVar4 == 1) {
        iVar4 = *param_4;
        *(int *)(lVar3 + 0x688) = *(int *)(lVar3 + 0x688) + *param_3;
        *(int *)(lVar3 + 0x6a8) = *(int *)(lVar3 + 0x6a8) + iVar4;
      }
      else if (iVar4 == 2) {
        iVar4 = *param_4;
        *(int *)(lVar3 + 0x68c) = *(int *)(lVar3 + 0x68c) + *param_3;
        *(int *)(lVar3 + 0x6ac) = *(int *)(lVar3 + 0x6ac) + iVar4;
      }
      else if (iVar4 == 3) {
        iVar4 = *param_4;
        *(int *)(lVar3 + 0x690) = *(int *)(lVar3 + 0x690) + *param_3;
        *(int *)(lVar3 + 0x6b0) = *(int *)(lVar3 + 0x6b0) + iVar4;
      }
      else if (iVar4 == 4) {
        iVar4 = *param_4;
        *(int *)(lVar3 + 0x694) = *(int *)(lVar3 + 0x694) + *param_3;
        *(int *)(lVar3 + 0x6b4) = *(int *)(lVar3 + 0x6b4) + iVar4;
      }
      else if (iVar4 == 5) {
        iVar4 = *param_4;
        *(int *)(lVar3 + 0x698) = *(int *)(lVar3 + 0x698) + *param_3;
        *(int *)(lVar3 + 0x6b8) = *(int *)(lVar3 + 0x6b8) + iVar4;
      }
      else if (iVar4 == 6) {
        iVar4 = *param_4;
        *(int *)(lVar3 + 0x69c) = *(int *)(lVar3 + 0x69c) + *param_3;
        *(int *)(lVar3 + 0x6bc) = *(int *)(lVar3 + 0x6bc) + iVar4;
      }
      else if (iVar4 == 7) {
        iVar4 = *param_4;
        *(int *)(lVar3 + 0x6a0) = *(int *)(lVar3 + 0x6a0) + *param_3;
        *(int *)(lVar3 + 0x6c0) = *(int *)(lVar3 + 0x6c0) + iVar4;
      }
      else {
        if (iVar4 != 8) goto LAB_1401dc77e;
        iVar4 = *param_4;
        *(int *)(lVar3 + 0x6a4) = *(int *)(lVar3 + 0x6a4) + *param_3;
        *(int *)(lVar3 + 0x6c4) = *(int *)(lVar3 + 0x6c4) + iVar4;
      }
      *(undefined1 *)(lVar3 + 0x606) = 1;
    }
  }
  else {
    iVar4 = DAT_14060804c + 1;
    bVar5 = DAT_14060804c == 0;
    DAT_14060804c = iVar4;
    if (bVar5) {
      FUN_140176d60(1);
    }
  }
LAB_1401dc77e:
  if (plVar1 == local_10) {
    LOCK();
    plVar1 = plVar1 + 1;
    lVar3 = *plVar1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)lVar3 == 1) {
      puVar2 = (undefined8 *)*local_18;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      operator_delete(local_18);
    }
  }
  else {
    iVar4 = DAT_140608054 + 1;
    bVar5 = DAT_140608054 == 0;
    DAT_140608054 = iVar4;
    if (bVar5) {
      FUN_140176d60(1);
      return 1;
    }
  }
  return 1;
}



undefined8 FUN_1401dc7f0(longlong param_1,undefined4 *param_2)

{
  longlong *plVar1;
  int iVar2;
  undefined4 *puVar3;
  longlong lVar4;
  bool bVar5;
  undefined4 local_res8 [8];
  
  if ((99 < *(int *)(param_1 + 0x298)) &&
     (plVar1 = *(longlong **)(param_1 + 0x6e0), plVar1 != (longlong *)0x0)) {
    if (plVar1 == *(longlong **)(param_1 + 0x6e8)) {
      lVar4 = *plVar1;
      if (lVar4 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x6e8)) {
          iVar2 = DAT_14060804c + 1;
          bVar5 = DAT_14060804c == 0;
          DAT_14060804c = iVar2;
          if (bVar5) {
            FUN_140176d60();
          }
          lVar4 = 0;
        }
        *(undefined4 *)(lVar4 + 0x7f8) = *param_2;
        local_res8[0] = 0x3e4ccccd;
        puVar3 = local_res8;
        if (*(float *)(lVar4 + 0x7f8) <= 0.2) {
          puVar3 = (undefined4 *)(lVar4 + 0x7f8);
        }
        *(undefined4 *)(lVar4 + 0x7f8) = *puVar3;
        *(undefined1 *)(lVar4 + 0x607) = 1;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
        return 1;
      }
    }
  }
  return 1;
}



undefined8 FUN_1401dc8c0(longlong param_1,uint param_2,uint param_3,undefined4 param_4)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined2 local_res8 [4];
  uint local_res10 [2];
  uint local_res18 [2];
  undefined4 local_res20;
  undefined4 *puVar9;
  undefined2 *puVar11;
  undefined4 uVar13;
  undefined4 *puVar12;
  longlong *plVar14;
  undefined8 in_stack_fffffffffffffea0;
  undefined4 *puVar15;
  undefined4 uVar16;
  undefined8 in_stack_fffffffffffffea8;
  undefined4 uVar17;
  undefined4 local_148 [2];
  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 [2];
  longlong local_118;
  undefined1 local_110;
  undefined8 local_108;
  longlong local_f8;
  longlong local_f0;
  int local_e0;
  short local_dc [44];
  short local_84;
  undefined4 local_50;
  undefined4 uVar10;
  
  uVar16 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffea8 >> 0x20);
  local_108 = 0xfffffffffffffffe;
  lVar6 = 0;
  local_118 = 0;
  bVar8 = false;
  local_110 = 0;
  plVar14 = *(longlong **)(param_1 + 0xb28);
  local_res10[0] = param_2;
  local_res18[0] = param_3;
  local_res20 = param_4;
  if (plVar14 != (longlong *)0x0) {
    if (plVar14 == *(longlong **)(param_1 + 0xb30)) {
      lVar5 = *plVar14;
      lVar6 = 0;
      if (lVar5 != 0) {
        if (plVar14 != *(longlong **)(param_1 + 0xb30)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar8 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar8) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        local_110 = 0;
        local_118 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        local_110 = 1;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar14 = *(longlong **)(param_1 + 0x6c0);
  if (plVar14 != (longlong *)0x0) {
    plVar4 = *(longlong **)(param_1 + 0x6c8);
    if (plVar14 == plVar4) {
      if (*plVar14 != 0) {
        FUN_14000a170(&local_f8);
        local_50 = 0;
        if (plVar14 == plVar4) {
          lVar5 = *plVar14;
        }
        else {
          iVar2 = DAT_140608048 + 1;
          bVar7 = DAT_140608048 == 0;
          DAT_140608048 = iVar2;
          if (bVar7) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        if ((4 < param_2) || (0x17 < param_3)) {
LAB_1401dcd98:
          if (bVar8) {
            FUN_14034edd0(lVar6);
          }
          return 1;
        }
        lVar5 = ((longlong)(int)param_3 + (longlong)(int)param_2 * 0x18) * 0xac + lVar5;
        *(short *)(lVar5 + 0x14) = (short)param_2;
        *(short *)(lVar5 + 0x16) = (short)param_3;
        FUN_140090020(&local_f8);
        if ((local_f8 == 0) && (local_f0 == 0)) {
          bVar7 = false;
        }
        else {
          bVar7 = true;
        }
        if ((((bVar7) || (local_e0 != 0)) || (0 < local_dc[0])) && (local_84 == 0)) {
          local_dc[0] = local_dc[0] + -1;
          uVar3 = FUN_140137690();
          iVar2 = FUN_1401369d0(uVar3,local_e0);
          if (iVar2 == 0x39) {
            cVar1 = FUN_1401dcdd0(param_1,local_e0,local_res20);
            if (cVar1 != '\0') {
              local_148[0] = CONCAT22(local_148[0]._2_2_,(short)param_2);
              plVar4 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              plVar14 = (longlong *)local_dc;
              puVar11 = local_res8;
              puVar9 = local_148;
              local_res8[0] = (short)param_3;
              (**(code **)(*plVar4 + 0x290))
                        (plVar4,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_f8,puVar9,puVar11
                         ,plVar14);
              uVar13 = (undefined4)((ulonglong)puVar11 >> 0x20);
              uVar10 = (undefined4)((ulonglong)puVar9 >> 0x20);
              if (local_dc[0] < 1) {
                local_140 = *(undefined4 *)(param_1 + 0x160);
                local_13c = *(undefined4 *)(param_1 + 0x164);
                local_138 = *(undefined4 *)(param_1 + 0x168);
                local_134 = *(undefined4 *)(param_1 + 0x16c);
                local_130 = *(undefined4 *)(param_1 + 0x170);
                local_12c = *(undefined4 *)(param_1 + 0x174);
                local_128 = *(undefined4 *)(param_1 + 0x178);
                local_124 = *(undefined4 *)(param_1 + 0x17c);
                iVar2 = *(int *)(param_1 + 0x284);
                local_148[0] = 0xffffffff;
                local_120[0] = 0xfffffff6;
                if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
                  local_res8[0] = (undefined2)iVar2;
                  plVar4 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  puVar9 = local_148;
                  puVar15 = local_120;
                  plVar14 = &local_f8;
                  puVar12 = &local_140;
                  (**(code **)(*plVar4 + 0x130))
                            (plVar4,1,&DAT_1405d85a0,local_res8,&local_130,puVar12,plVar14,puVar15,
                             puVar9);
                  uVar13 = (undefined4)((ulonglong)puVar12 >> 0x20);
                  uVar16 = (undefined4)((ulonglong)puVar15 >> 0x20);
                  uVar17 = (undefined4)((ulonglong)puVar9 >> 0x20);
                }
                uVar3 = FUN_140174f00(param_1 + 0x6c0);
                FUN_1401e9d60(uVar3,param_1,local_res10,local_res18,&local_f8);
              }
              else {
                uVar3 = FUN_140174f00(param_1 + 0x6c0);
                FUN_1401ed220(uVar3,local_res10,local_res18,&local_f8,CONCAT44(uVar10,6));
                local_130 = *(undefined4 *)(param_1 + 0x160);
                local_12c = *(undefined4 *)(param_1 + 0x164);
                local_128 = *(undefined4 *)(param_1 + 0x168);
                local_124 = *(undefined4 *)(param_1 + 0x16c);
                local_140 = *(undefined4 *)(param_1 + 0x170);
                local_13c = *(undefined4 *)(param_1 + 0x174);
                local_138 = *(undefined4 *)(param_1 + 0x178);
                local_134 = *(undefined4 *)(param_1 + 0x17c);
                iVar2 = *(int *)(param_1 + 0x284);
                if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
                   (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar5 != 0)) {
                  local_res8[0] = (undefined2)iVar2;
                  plVar4 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
                           0x70);
                  plVar14 = &local_f8;
                  puVar9 = &local_130;
                  (**(code **)(*plVar4 + 0x140))
                            (plVar4,1,&DAT_1405d85a0,local_res8,&local_140,puVar9,plVar14);
                  uVar13 = (undefined4)((ulonglong)puVar9 >> 0x20);
                }
              }
              FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,&local_f8,
                            CONCAT44(uVar13,1),(ulonglong)plVar14 & 0xffffffff00000000,
                            CONCAT44(uVar16,local_dc[0] + 1),CONCAT44(uVar17,(int)local_dc[0]));
              goto LAB_1401dcd98;
            }
            local_dc[0] = local_dc[0] + 1;
          }
          else {
            printf("Use Item Select Error. \n");
          }
        }
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar7 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar6);
  }
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001401dd0fa)
// WARNING: Removing unreachable block (ram,0x0001401dd090)
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1401dcdd0(longlong param_1,uint param_2,int param_3)

{
  longlong *plVar1;
  uint *puVar2;
  void *pvVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  uint uVar9;
  undefined4 uVar10;
  int iVar11;
  longlong lVar12;
  undefined8 uVar13;
  longlong *plVar14;
  uint *puVar15;
  longlong *plVar16;
  undefined4 *puVar17;
  short sVar18;
  bool bVar19;
  short local_res20 [4];
  undefined8 in_stack_fffffffffffffdb8;
  ulonglong uVar20;
  int *piVar21;
  int *piVar22;
  ulonglong in_stack_fffffffffffffdc8;
  ulonglong in_stack_fffffffffffffdd0;
  undefined *puVar23;
  ulonglong in_stack_fffffffffffffdd8;
  undefined4 local_218;
  undefined2 local_214 [2];
  longlong *local_210;
  longlong *local_208;
  int local_200;
  int local_1fc [5];
  int local_1e8 [2];
  undefined4 local_1e0 [2];
  int local_1d8 [5];
  undefined4 local_1c4;
  undefined4 local_1c0;
  undefined4 local_1bc;
  undefined4 local_1b8;
  undefined4 local_1b4;
  undefined4 local_1b0;
  undefined4 local_1ac;
  undefined4 local_1a8;
  undefined4 local_1a4;
  undefined4 local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  int local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined1 local_178 [8];
  void *local_170;
  undefined8 local_168;
  undefined8 local_160;
  undefined4 *local_150;
  longlong local_148;
  undefined8 local_140;
  short *local_130;
  undefined8 local_128;
  undefined8 local_120;
  undefined4 *local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f0;
  longlong local_e8;
  longlong local_e0;
  short local_d4;
  undefined1 local_d2 [2];
  int local_d0;
  short local_cc;
  int local_80;
  undefined4 local_40;
  undefined1 local_38 [16];
  
  uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
  local_f0 = 0xfffffffffffffffe;
  FUN_140197b70();
  plVar1 = local_210;
  if (local_210 != (longlong *)0x0) {
    if (local_210 == local_208) {
      if (*local_210 != 0) {
        lVar12 = FUN_140137690();
        uVar9 = 0;
        if (*(longlong *)(lVar12 + 0x88) != 0) {
          for (puVar15 = *(uint **)(*(longlong *)(lVar12 + 0x88) +
                                   ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar12 + 0x98)) * 8);
              puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0xa6)) {
            if ((puVar15[0xa8] == param_2) && (*puVar15 == param_2)) {
              if (puVar15 != (uint *)0x0) {
                if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar9 = puVar15[0x80];
              }
              break;
            }
          }
        }
        uVar13 = FUN_140146aa0();
        cVar4 = FUN_140146070(uVar13,uVar9);
        if (cVar4 == '\0') {
          local_1b8 = 0x14d;
          local_1a0 = 0x2b0c;
          plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar14 + 0x70))
                    (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1a0,&local_1b8);
          goto LAB_1401dd75e;
        }
        local_200 = 0;
        uVar6 = FUN_1401a6390(param_1);
        uVar7 = FUN_1401a64a0(param_1);
        uVar8 = FUN_1401a6310(param_1);
        uVar13 = FUN_140146aa0();
        piVar21 = &local_200;
        uVar20 = CONCAT44(uVar10,uVar6);
        uVar9 = FUN_140146140(uVar13,uVar9,uVar8,uVar7,uVar20,piVar21);
        if (local_200 == 0x14d) {
          local_1fc[3] = 0x14e;
          local_1c0 = 0x2b0c;
          plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar14 + 0x70))
                    (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1c0,local_1fc + 3);
          goto LAB_1401dd75e;
        }
        if (local_200 == 0x14f) {
          local_1e8[0] = local_200;
          local_1c4 = 0x2b0c;
          plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar14 + 0x70))
                    (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1c4,local_1e8);
          goto LAB_1401dd75e;
        }
        if (local_200 == 0x150) {
          local_1d8[0] = local_200;
          local_1b4 = 0x2b0c;
          plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar14 + 0x70))
                    (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1b4,local_1d8);
          goto LAB_1401dd75e;
        }
        uVar10 = 0;
        local_218 = 0;
        sVar18 = 0;
        local_res20[0] = 0;
        plVar14 = (longlong *)FUN_140146aa0();
        if (*plVar14 != 0) {
          for (puVar15 = *(uint **)(*plVar14 +
                                   ((ulonglong)uVar9 % (ulonglong)*(uint *)(plVar14 + 2)) * 8);
              puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x34)) {
            if ((puVar15[0x36] == uVar9) && (*puVar15 == uVar9)) goto LAB_1401dd07b;
          }
        }
        puVar15 = (uint *)0x0;
LAB_1401dd07b:
        if (puVar15 != (uint *)0x0) {
          if (puVar15[6] == 0) {
            plVar14 = (longlong *)FUN_140146aa0();
            uVar6 = (undefined4)(uVar20 >> 0x20);
            if (*plVar14 != 0) {
              for (puVar15 = *(uint **)(*plVar14 +
                                       ((ulonglong)uVar9 % (ulonglong)*(uint *)(plVar14 + 2)) * 8);
                  puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x34)) {
                if ((puVar15[0x36] == uVar9) && (*puVar15 == uVar9)) goto LAB_1401dd0e7;
              }
            }
            puVar15 = (uint *)0x0;
LAB_1401dd0e7:
            if (puVar15 != (uint *)0x0) {
              if (puVar15[7] == 0) {
                local_110 = (undefined4 *)0x0;
                local_108 = 0;
                local_100 = 0;
                local_130 = (short *)0x0;
                local_128 = 0;
                local_120 = 0;
                uVar13 = FUN_140146aa0();
                FUN_140145e80(uVar13,uVar9,&local_110,&local_130);
                puVar17 = local_110;
                uVar10 = *local_110;
                sVar18 = *local_130;
                local_218 = uVar10;
                operator_delete(local_130);
LAB_1401dd2de:
                operator_delete(puVar17);
              }
              else if (puVar15[7] == 1) {
                plVar14 = (longlong *)FUN_140146aa0();
                puVar15 = (uint *)0x0;
                if (*plVar14 != 0) {
                  for (puVar2 = *(uint **)(*plVar14 +
                                          ((ulonglong)uVar9 % (ulonglong)*(uint *)(plVar14 + 2)) * 8
                                          );
                      (puVar15 = (uint *)0x0, puVar2 != (uint *)0x0 &&
                      ((puVar2[0x36] != uVar9 || (puVar15 = puVar2, *puVar2 != uVar9))));
                      puVar2 = *(uint **)(puVar2 + 0x34)) {
                  }
                }
                if (puVar15 == (uint *)0x0) {
                  uVar9 = 0xffffffff;
                }
                else {
                  if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                    FUN_14000d450(0x80004005);
                  }
                  uVar9 = puVar15[8];
                }
                uVar20 = CONCAT44(uVar6,uVar9);
                cVar4 = FUN_1401f61c0(0,local_178,&local_218,local_res20,uVar20);
                uVar10 = local_218;
                sVar18 = local_res20[0];
                if (cVar4 == '\0') {
                  printf("Select Condition Item - Rand Group Error. \n");
                  local_1d8[2] = 0x151;
                  local_1ac = 0x2b0c;
                  plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
                  (**(code **)(*plVar14 + 0x70))
                            (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1ac,
                             local_1d8 + 2);
                  goto LAB_1401dd75e;
                }
              }
            }
          }
          else {
            uVar10 = 0;
            sVar18 = 0;
            if (puVar15[6] == 1) {
              local_150 = (undefined4 *)0x0;
              local_148 = 0;
              local_140 = 0;
              local_170 = (void *)0x0;
              local_168 = 0;
              local_160 = 0;
              uVar13 = FUN_140146aa0();
              FUN_140145e80(uVar13,uVar9,&local_150,&local_170);
              puVar17 = local_150;
              if ((int)(local_148 - (longlong)local_150 >> 2) < param_3) {
                printf("Select Condition Item - Table Error. \n");
                if (local_170 != (void *)0x0) {
                  operator_delete(local_170);
                }
                if (puVar17 != (undefined4 *)0x0) {
                  operator_delete(puVar17);
                }
                goto LAB_1401dd75e;
              }
              uVar10 = local_150[param_3];
              sVar18 = *(short *)((longlong)local_170 + (longlong)param_3 * 4);
              local_218 = uVar10;
              if (local_170 != (void *)0x0) {
                operator_delete(local_170);
              }
              if (puVar17 != (undefined4 *)0x0) goto LAB_1401dd2de;
            }
          }
        }
        uVar13 = FUN_140137690();
        iVar5 = FUN_140136a70(uVar13,uVar10);
        if (iVar5 < sVar18) {
          sVar18 = (short)iVar5;
        }
        local_res20[0] = sVar18;
        if (sVar18 < 1) {
          local_1d8[1] = 0x15b;
          local_1d8[3] = 0x2b0c;
          plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
          (**(code **)(*plVar14 + 0x70))
                    (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1d8 + 3,local_1d8 + 1
                    );
        }
        else {
          FUN_14000a170(&local_e8);
          local_40 = 0;
          in_stack_fffffffffffffdd8 = in_stack_fffffffffffffdd8 & 0xffffffff00000000;
          puVar23 = (undefined *)(in_stack_fffffffffffffdd0 & 0xffffffff00000000);
          FUN_1401aac30(3,&local_e8,uVar10,(int)sVar18,uVar20 & 0xffffffff00000000,
                        (ulonglong)piVar21 & 0xffffffff00000000,
                        in_stack_fffffffffffffdc8 & 0xffffffff00000000,puVar23,
                        in_stack_fffffffffffffdd8,0);
          uVar6 = (undefined4)(in_stack_fffffffffffffdd8 >> 0x20);
          uVar13 = FUN_140137690();
          iVar5 = FUN_140136b30(uVar13,uVar10);
          local_1d8[4] = iVar5;
          if (iVar5 == 5) {
            local_1fc[0] = 0;
            uVar13 = FUN_140174f00(param_1 + 0x6c0);
            FUN_1401e8ba0(uVar13,local_38,&local_e8,local_1fc);
            if (-1 < local_1fc[0]) {
              iVar5 = (int)local_cc;
              uVar13 = FUN_140174f00(param_1 + 0x6c0);
              FUN_1401f3b10(uVar13,(int)local_d4,iVar5 * local_80);
              plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar14 + 0xe0))
                        (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_d4,local_d2,
                         &local_e8);
              bVar19 = false;
              local_1fc[2] = 0;
              plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              piVar21 = local_1fc + 2;
              piVar22 = local_1fc + 4;
              local_1fc[4] = (int)sVar18;
              (**(code **)(*plVar14 + 0xcc0))
                        (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_d4,local_d2,
                         piVar22,piVar21);
              uVar10 = (undefined4)((ulonglong)piVar22 >> 0x20);
              local_188 = *(int *)(param_1 + 0x160);
              local_184 = *(undefined4 *)(param_1 + 0x164);
              local_180 = *(undefined4 *)(param_1 + 0x168);
              local_17c = *(undefined4 *)(param_1 + 0x16c);
              local_198 = *(undefined4 *)(param_1 + 0x170);
              local_194 = *(undefined4 *)(param_1 + 0x174);
              local_190 = *(undefined4 *)(param_1 + 0x178);
              local_18c = *(undefined4 *)(param_1 + 0x17c);
              iVar5 = *(int *)(param_1 + 0x284);
              local_1e0[0] = *(undefined4 *)(param_1 + 8);
              if ((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
                if ((local_e8 != 0) || (local_e0 != 0)) {
                  bVar19 = true;
                }
                if (((bVar19) && (local_d0 != 0)) &&
                   (lVar12 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar12 != 0)) {
                  local_214[0] = (undefined2)iVar5;
                  plVar16 = (longlong *)
                            (*(longlong *)
                              (*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8)
                            + 0x70);
                  plVar14 = &local_e8;
                  puVar23 = &DAT_14047ba58;
                  piVar21 = &local_188;
                  lVar12 = (longlong)&local_198;
                  (**(code **)(*plVar16 + 0xb0))
                            (plVar16,1,&DAT_1405d85a0,local_214,local_1e0,lVar12,piVar21,
                             &DAT_14047ba58,plVar14);
                  uVar10 = (undefined4)((ulonglong)lVar12 >> 0x20);
                  uVar6 = (undefined4)((ulonglong)plVar14 >> 0x20);
                }
              }
              FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ce,0x67,param_1,&local_e8,
                            CONCAT44(uVar10,(int)local_cc),(ulonglong)piVar21 & 0xffffffff00000000,
                            (ulonglong)puVar23 & 0xffffffff00000000,CONCAT44(uVar6,(int)local_cc));
LAB_1401dd6c3:
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                pvVar3 = (void *)*local_210;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0xf630);
                  operator_delete(pvVar3);
                }
                operator_delete(local_210);
              }
              return 1;
            }
            local_1a8 = 0x15b;
            local_1b0 = 0x2b0c;
            plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
            (**(code **)(*plVar14 + 0x70))
                      (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_1b0,&local_1a8);
          }
          else {
            uVar13 = FUN_140174f00(param_1 + 0x6c0);
            if ((iVar5 < 0) || (iVar11 = FUN_1401eea90(uVar13,local_1d8 + 4), iVar11 < 0)) {
              local_1bc = 0x15b;
              local_1fc[1] = 0x2b0c;
              plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar14 + 0x70))
                        (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_1fc + 1,
                         &local_1bc);
            }
            else {
              uVar13 = FUN_140174f00(param_1 + 0x6c0);
              cVar4 = FUN_1401fb2c0(uVar13,param_1,iVar5,&local_e8);
              if (cVar4 != '\0') goto LAB_1401dd6c3;
              local_1a4 = 0x15b;
              local_19c = 0x2b0c;
              plVar14 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
              (**(code **)(*plVar14 + 0x70))
                        (plVar14,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_19c,&local_1a4);
            }
          }
        }
        goto LAB_1401dd75e;
      }
    }
    else {
      iVar5 = DAT_140608048 + 1;
      bVar19 = DAT_140608048 == 0;
      DAT_140608048 = iVar5;
      if (bVar19) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 0;
  }
  if (plVar1 != local_208) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 0;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_1401dd75e:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar3 = (void *)*local_210;
    if (pvVar3 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar3 + 0xf630);
      operator_delete(pvVar3);
    }
    operator_delete(local_210);
  }
  return 0;
}



undefined8
FUN_1401dd7c0(longlong param_1,uint param_2,uint param_3,undefined4 param_4,undefined4 param_5)

{
  longlong *plVar1;
  void *pvVar2;
  int iVar3;
  undefined8 uVar4;
  uint *puVar5;
  longlong *plVar6;
  longlong lVar7;
  undefined2 *puVar8;
  undefined4 uVar9;
  uint uVar10;
  undefined2 *puVar11;
  undefined2 uVar12;
  undefined2 uVar13;
  bool bVar14;
  undefined4 local_res8 [2];
  uint local_res10 [2];
  uint local_res18 [2];
  undefined8 in_stack_fffffffffffffd98;
  undefined4 uVar16;
  undefined4 *puVar15;
  undefined8 in_stack_fffffffffffffda0;
  undefined4 uVar18;
  short *psVar17;
  short *psVar19;
  undefined8 in_stack_fffffffffffffdb0;
  undefined4 *puVar20;
  undefined4 uVar21;
  undefined8 in_stack_fffffffffffffdb8;
  undefined4 uVar22;
  undefined2 local_238;
  undefined2 local_236;
  undefined2 local_234;
  undefined2 local_232;
  undefined2 local_230;
  undefined2 local_22e;
  undefined2 local_22c [2];
  longlong *local_228;
  longlong *local_220;
  longlong local_218;
  char local_210;
  undefined4 local_208 [2];
  undefined4 local_200 [2];
  undefined4 local_1f8 [2];
  undefined4 local_1f0;
  undefined4 local_1ec;
  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;
  undefined8 local_1a8;
  short local_198 [12];
  uint local_180;
  short local_17c [70];
  undefined4 local_f0;
  short local_e8 [84];
  undefined4 local_40;
  
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffdb0 >> 0x20);
  uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffda0 >> 0x20);
  uVar16 = (undefined4)((ulonglong)in_stack_fffffffffffffd98 >> 0x20);
  local_1a8 = 0xfffffffffffffffe;
  uVar9 = 0;
  local_218 = 0;
  local_210 = '\0';
  plVar1 = *(longlong **)(param_1 + 0xb28);
  local_res10[0] = param_2;
  local_res18[0] = param_3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0xb30)) {
      if (*plVar1 != 0) {
        lVar7 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xb30)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar14 = DAT_1406080a8 == 0, lVar7 = 0, DAT_1406080a8 = iVar3
           , bVar14)) {
          FUN_140176d60(1);
        }
        local_210 = 0;
        local_218 = lVar7;
        FUN_14034ed40();
        local_210 = '\x01';
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar14 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140197b70(param_1,&local_228);
  plVar1 = local_228;
  if (local_228 == (longlong *)0x0) {
LAB_1401dde4a:
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == local_220) {
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          pvVar2 = (void *)*local_228;
          if (pvVar2 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar2 + 0xf630);
            operator_delete(pvVar2);
          }
          operator_delete(local_228);
        }
      }
      else {
        iVar3 = DAT_140608050 + 1;
        bVar14 = DAT_140608050 == 0;
        DAT_140608050 = iVar3;
        if (bVar14) {
          FUN_140176d60(1);
        }
      }
    }
    if (local_210 != '\0') {
      FUN_14034edd0(local_218);
    }
    return 0;
  }
  if (local_228 != local_220) {
    iVar3 = DAT_140608048 + 1;
    bVar14 = DAT_140608048 == 0;
    DAT_140608048 = iVar3;
    if (bVar14) {
      FUN_140176d60(1);
    }
    goto LAB_1401dde4a;
  }
  if (*local_228 == 0) goto LAB_1401dde4a;
  FUN_14000a170(local_198);
  uVar10 = 0;
  local_f0 = 0;
  if ((4 < param_2) || (0x17 < param_3)) goto LAB_1401dde01;
  lVar7 = ((longlong)(int)param_3 + (longlong)(int)param_2 * 0x18) * 0xac + *plVar1;
  *(short *)(lVar7 + 0x14) = (short)param_2;
  uVar13 = (undefined2)param_3;
  *(undefined2 *)(lVar7 + 0x16) = uVar13;
  FUN_140090020(local_198);
  uVar4 = FUN_140137690();
  iVar3 = FUN_1401369d0(uVar4,local_180);
  uVar4 = FUN_140137690();
  local_res8[0] = FUN_140137640(uVar4);
  if (iVar3 == 0x2e) {
    uVar4 = FUN_140174f00(&local_228);
    iVar3 = FUN_1401f9ca0(uVar4,param_1,param_4,param_5);
    if (iVar3 != 0) goto LAB_1401ddb07;
    uVar9 = 0x13d;
  }
  else if (iVar3 == 0x2f) {
    uVar4 = FUN_140174f00(&local_228);
    iVar3 = FUN_1401fa340(uVar4,param_1,param_4,param_5);
    if (iVar3 != 0) goto LAB_1401ddb07;
    uVar9 = 0x13e;
  }
  else {
    if (iVar3 == 0x30) {
      uVar4 = FUN_140174f00(&local_228);
      iVar3 = FUN_1401f9fc0(uVar4,param_1,param_4,param_5);
    }
    else if (iVar3 == 0x38) {
      uVar4 = FUN_140174f00(&local_228);
      iVar3 = FUN_1401fa5b0(uVar4,param_1,param_4,param_5);
    }
    else {
      if (iVar3 != 0x3d) goto LAB_1401ddad0;
      lVar7 = FUN_140137690();
      if (*(longlong *)(lVar7 + 0x88) != 0) {
        for (puVar5 = *(uint **)(*(longlong *)(lVar7 + 0x88) +
                                ((ulonglong)local_180 % (ulonglong)*(uint *)(lVar7 + 0x98)) * 8);
            puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xa6)) {
          if ((puVar5[0xa8] == local_180) && (*puVar5 == local_180)) {
            if (puVar5 != (uint *)0x0) {
              if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar10 = puVar5[0x81];
            }
            break;
          }
        }
      }
      uVar4 = FUN_140174f00(&local_228);
      iVar3 = FUN_1401fa9a0(uVar4,param_1,param_4,param_5,CONCAT44(uVar16,local_res8[0]),
                            CONCAT44(uVar18,uVar10));
    }
    if (iVar3 != 0) {
LAB_1401ddb07:
      local_17c[0] = local_17c[0] + -1;
      local_res8[0] = CONCAT22(local_res8[0]._2_2_,uVar13);
      uVar12 = (undefined2)local_res10[0];
      plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      psVar19 = local_17c;
      puVar8 = &local_232;
      local_232 = uVar12;
      (**(code **)(*plVar6 + 0x290))
                (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_198,puVar8,local_res8,
                 psVar19);
      uVar16 = (undefined4)((ulonglong)puVar8 >> 0x20);
      uVar9 = *(undefined4 *)(param_1 + 0x160);
      iVar3 = *(int *)(param_1 + 0x284);
      lVar7 = *(longlong *)(param_1 + 0xb50);
      if (local_17c[0] < 1) {
        local_1d8 = *(undefined4 *)(param_1 + 0x164);
        local_1d4 = *(undefined4 *)(param_1 + 0x168);
        local_1d0 = *(undefined4 *)(param_1 + 0x16c);
        local_1cc = *(undefined4 *)(param_1 + 0x170);
        local_1c8 = *(undefined4 *)(param_1 + 0x174);
        local_1c4 = *(undefined4 *)(param_1 + 0x178);
        local_1c0 = *(undefined4 *)(param_1 + 0x17c);
        local_208[0] = 0xffffffff;
        local_1f8[0] = 0xfffffff6;
        local_1dc = uVar9;
        if (((-1 < iVar3) && (iVar3 < *(short *)(lVar7 + 700))) &&
           (*(longlong *)(lVar7 + 0x4c0) != 0)) {
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(*(longlong *)(lVar7 + 0x4c0) + 8) +
                     (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
          puVar15 = local_208;
          puVar20 = local_1f8;
          psVar19 = local_198;
          local_238 = (short)iVar3;
          (**(code **)(*plVar6 + 0x130))
                    (plVar6,1,&DAT_1405d85a0,&local_238,&local_1cc,&local_1dc,psVar19,puVar20,
                     puVar15);
          uVar21 = (undefined4)((ulonglong)puVar20 >> 0x20);
          uVar22 = (undefined4)((ulonglong)puVar15 >> 0x20);
        }
        uVar4 = FUN_140174f00(&local_228);
        FUN_1401e9d60(uVar4,param_1,local_res10,local_res18,local_198);
        local_230 = uVar13;
        local_22c[0] = uVar12;
        FUN_14000a170(local_e8);
        local_40 = 0;
        psVar17 = local_e8;
        puVar8 = &local_230;
        puVar11 = local_22c;
      }
      else {
        local_1e8 = *(undefined4 *)(param_1 + 0x164);
        local_1e4 = *(undefined4 *)(param_1 + 0x168);
        local_1e0 = *(undefined4 *)(param_1 + 0x16c);
        local_1bc = *(undefined4 *)(param_1 + 0x170);
        local_1b8 = *(undefined4 *)(param_1 + 0x174);
        local_1b4 = *(undefined4 *)(param_1 + 0x178);
        local_1b0 = *(undefined4 *)(param_1 + 0x17c);
        local_1ec = uVar9;
        if (((-1 < iVar3) && (iVar3 < *(short *)(lVar7 + 700))) &&
           (*(longlong *)(lVar7 + 0x4c0) != 0)) {
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(*(longlong *)(lVar7 + 0x4c0) + 8) +
                     (longlong)*(int *)(param_1 + 0x288) * 8) + 0x70);
          psVar19 = local_198;
          puVar15 = &local_1bc;
          local_236 = (short)iVar3;
          (**(code **)(*plVar6 + 0x140))
                    (plVar6,1,&DAT_1405d85a0,&local_236,puVar15,&local_1ec,psVar19);
          uVar16 = (undefined4)((ulonglong)puVar15 >> 0x20);
        }
        uVar4 = FUN_140174f00(&local_228);
        FUN_1401ed220(uVar4,local_res10,local_res18,local_198,CONCAT44(uVar16,6));
        psVar17 = local_198;
        puVar8 = &local_234;
        puVar11 = &local_22e;
        local_234 = uVar13;
        local_22e = uVar12;
      }
      plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
      (**(code **)(*plVar6 + 0xe0))
                (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,puVar11,puVar8,psVar17);
      FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1ca,0x47,param_1,local_198,1,
                    (ulonglong)psVar19 & 0xffffffff00000000,CONCAT44(uVar21,local_17c[0] + 1),
                    CONCAT44(uVar22,(int)local_17c[0]));
      goto LAB_1401dde01;
    }
    uVar9 = 0x13f;
  }
LAB_1401ddad0:
  local_200[0] = 0x2b60;
  plVar6 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  local_1f0 = uVar9;
  (**(code **)(*plVar6 + 0x70))
            (plVar6,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_200,&local_1f0);
LAB_1401dde01:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar2 = (void *)*local_228;
    if (pvVar2 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar2 + 0xf630);
      operator_delete(pvVar2);
    }
    operator_delete(local_228);
  }
  if (local_210 != '\0') {
    FUN_14034edd0(local_218);
  }
  return 1;
}



uint FUN_1401ddee0(longlong param_1,char param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  uint uVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  bVar6 = 1 < *(byte *)(param_1 + 0x5d2);
  plVar1 = *(longlong **)(param_1 + 0x6e0);
  uVar4 = (uint)bVar6;
  if (plVar1 != (longlong *)0x0) {
    plVar2 = *(longlong **)(param_1 + 0x6e8);
    if (plVar1 == plVar2) {
      lVar5 = *plVar1;
      if (lVar5 != 0) {
        if (param_2 != '\x04') {
          if ((plVar1 != plVar2) &&
             (iVar3 = DAT_14060804c + 1, bVar6 = DAT_14060804c == 0, lVar5 = 0,
             DAT_14060804c = iVar3, bVar6)) {
            FUN_140176d60(1);
            return (int)fRam00000000000022c0 + uVar4;
          }
          return (int)*(float *)(lVar5 + 0x22c0) + uVar4;
        }
        if ((plVar1 != plVar2) &&
           (iVar3 = DAT_14060804c + 1, bVar6 = DAT_14060804c == 0, lVar5 = 0, DAT_14060804c = iVar3,
           bVar6)) {
          FUN_140176d60(1);
          return (int)fRam00000000000022b8 + uVar4;
        }
        return (int)*(float *)(lVar5 + 0x22b8) + uVar4;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar7 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  return (uint)bVar6;
}



undefined8 FUN_1401ddff0(longlong param_1,ulonglong *param_2,undefined4 *param_3)

{
  undefined4 uVar1;
  int iVar2;
  bool bVar3;
  
  bVar3 = *(ulonglong *)(param_1 + 0x160) < *param_2;
  if ((*(ulonglong *)(param_1 + 0x160) == *param_2) &&
     (bVar3 = *(ulonglong *)(param_1 + 0x168) < param_2[1],
     *(ulonglong *)(param_1 + 0x168) == param_2[1])) {
    iVar2 = 0;
  }
  else {
    iVar2 = (1 - (uint)bVar3) - (uint)(bVar3 != 0);
  }
  if (iVar2 == 0) {
    uVar1 = *param_3;
    *(undefined1 *)(param_1 + 0x5ec) = 1;
    *(undefined4 *)(param_1 + 0x5e8) = uVar1;
    if (*(longlong *)(param_1 + 0xb50) != 0) {
      FUN_140173e40(*(longlong *)(param_1 + 0xb50),*(undefined4 *)(param_1 + 8),*param_3);
    }
  }
  return 1;
}



undefined8 FUN_1401de080(longlong param_1,ulonglong *param_2,longlong *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  void *pvVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  longlong lVar6;
  bool bVar7;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  uVar5 = 0;
  bVar7 = *(ulonglong *)(param_1 + 0x160) < *param_2;
  if ((*(ulonglong *)(param_1 + 0x160) != *param_2) ||
     (bVar7 = *(ulonglong *)(param_1 + 0x168) < param_2[1], uVar4 = uVar5,
     *(ulonglong *)(param_1 + 0x168) != param_2[1])) {
    uVar4 = (ulonglong)((1 - (uint)bVar7) - (uint)(bVar7 != 0));
  }
  if ((int)uVar4 == 0) {
    plVar2 = *(longlong **)(param_1 + 0x9f0);
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
      UNLOCK();
    }
    lVar6 = *param_3;
    if ((param_3[1] - lVar6) / 0x97 != 0) {
      do {
        if ((plVar2 != (longlong *)0x0) && (*plVar2 != 0)) {
          FUN_140263610(*plVar2,lVar6 + uVar5 * 0x97,uVar5 * 0x97,lVar6,uVar8);
        }
        lVar6 = *param_3;
        uVar5 = (ulonglong)((int)uVar5 + 1);
      } while (uVar5 < (ulonglong)((param_3[1] - lVar6) / 0x97));
    }
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar2 + 1;
      lVar6 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar6 == 1) {
        pvVar3 = (void *)*plVar2;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0x9130);
          operator_delete(pvVar3);
        }
        operator_delete(plVar2);
      }
    }
  }
  return 1;
}



undefined8
FUN_1401de1e0(longlong param_1,ulonglong *param_2,uint *param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  longlong *plVar1;
  void *pvVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  longlong lVar5;
  int iVar6;
  longlong *plVar7;
  bool bVar8;
  undefined2 local_res8 [4];
  undefined4 local_38;
  undefined4 local_34;
  undefined8 local_30;
  undefined4 local_28;
  undefined4 uStack_24;
  undefined4 local_20;
  undefined4 uStack_1c;
  longlong *local_18;
  longlong *local_10;
  
  local_30 = 0xfffffffffffffffe;
  local_28 = *(undefined4 *)(param_1 + 0x160);
  uStack_24 = *(undefined4 *)(param_1 + 0x164);
  uVar3 = *(ulonglong *)(param_1 + 0x160);
  local_20 = *(undefined4 *)(param_1 + 0x168);
  uStack_1c = *(undefined4 *)(param_1 + 0x16c);
  uVar4 = *(ulonglong *)(param_1 + 0x168);
  bVar8 = uVar3 < *param_2;
  if ((uVar3 == *param_2) && (bVar8 = uVar4 < param_2[1], uVar4 == param_2[1])) {
    iVar6 = 0;
  }
  else {
    iVar6 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
  }
  if (iVar6 == 0) {
    plVar1 = *(longlong **)(param_1 + 0x9f0);
    local_18 = plVar1;
    local_10 = plVar1;
    if (plVar1 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
      UNLOCK();
      if (*plVar1 != 0) {
        FUN_1402635b0(*plVar1,*param_4);
        if (*param_3 < 0xb5) {
          *(uint *)(*plVar1 + 0x9124) = *param_3;
        }
        local_38 = 1;
        local_34 = *(undefined4 *)(*plVar1 + 0x9120);
        local_res8[0] = (undefined2)*(undefined4 *)(*plVar1 + 0x9124);
        plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
        (**(code **)(*plVar7 + 0x120))
                  (plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res8,&local_34,&local_38
                  );
      }
    }
    *(undefined4 *)(param_1 + 0x5f0) = *param_5;
    *(undefined4 *)(param_1 + 0x5f8) = *param_6;
    FUN_1401de740(param_1,*param_6);
    plVar7 = local_18;
    if (plVar1 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar5 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar5 == 1) {
        pvVar2 = (void *)*local_18;
        if (pvVar2 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar2 + 0x9130);
          operator_delete(pvVar2);
        }
        operator_delete(plVar7);
      }
    }
  }
  return 1;
}



undefined8 FUN_1401de370(longlong param_1,undefined4 *param_2)

{
  int iVar1;
  longlong lVar2;
  undefined2 local_res8 [4];
  undefined4 local_res10 [2];
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  local_18 = *(undefined4 *)(param_1 + 0x170);
  iVar1 = *(int *)(param_1 + 0x284);
  local_14 = *(undefined4 *)(param_1 + 0x174);
  local_10 = *(undefined4 *)(param_1 + 0x178);
  local_c = *(undefined4 *)(param_1 + 0x17c);
  local_res10[0] = *param_2;
  if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) &&
     (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar2 != 0)) {
    local_res8[0] = (undefined2)iVar1;
    lVar2 = *(longlong *)(*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8);
    (**(code **)(*(longlong *)(lVar2 + 0x70) + 0xf10))
              (lVar2 + 0x70,1,&DAT_1405d85a0,local_res8,&local_18,local_res10);
  }
  local_18 = *(undefined4 *)(param_1 + 0x170);
  local_14 = *(undefined4 *)(param_1 + 0x174);
  local_10 = *(undefined4 *)(param_1 + 0x178);
  local_c = *(undefined4 *)(param_1 + 0x17c);
  lVar2 = FUN_1401979d0(param_1,&local_18);
  if (lVar2 != 0) {
    *(undefined4 *)(lVar2 + 0xec) = *param_2;
  }
  return 1;
}



void FUN_1401de470(longlong param_1)

{
  ulonglong *puVar1;
  code *pcVar2;
  int iVar3;
  ulonglong uVar4;
  undefined4 *puVar5;
  undefined4 *puVar6;
  longlong *plVar7;
  undefined4 *puVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  uint uVar11;
  undefined4 *puVar12;
  bool bVar13;
  undefined4 *local_108;
  undefined4 *local_100;
  undefined4 *local_f8;
  undefined8 local_e8;
  undefined1 local_d8 [24];
  undefined4 local_c0 [36];
  undefined4 local_30;
  
  local_e8 = 0xfffffffffffffffe;
  plVar7 = *(longlong **)(param_1 + 0x6c0);
  if (plVar7 != (longlong *)0x0) {
    if (plVar7 == *(longlong **)(param_1 + 0x6c8)) {
      if (*plVar7 != 0) {
        puVar12 = (undefined4 *)0x0;
        local_108 = (undefined4 *)0x0;
        local_100 = (undefined4 *)0x0;
        local_f8 = (undefined4 *)0x0;
        puVar6 = puVar12;
        puVar5 = puVar12;
        do {
          puVar9 = local_100;
          FUN_14000a170(local_d8);
          iVar3 = DAT_140608048;
          local_30 = 0;
          puVar1 = *(ulonglong **)(param_1 + 0x6c0);
          puVar8 = puVar12;
          if (puVar1 != (ulonglong *)0x0) {
            if (puVar1 == *(ulonglong **)(param_1 + 0x6c8)) {
              puVar8 = (undefined4 *)*puVar1;
            }
            else {
              DAT_140608048 = DAT_140608048 + 1;
              if (iVar3 == 0) {
                FUN_140176d60(1);
                puVar9 = local_100;
                puVar6 = local_108;
              }
            }
          }
          uVar11 = (uint)puVar5;
          puVar10 = puVar6;
          if (uVar11 < 0x18) {
            *(undefined2 *)(puVar8 + (longlong)(int)uVar11 * 0x2b + 5) = 0;
            *(short *)((longlong)puVar8 + (longlong)(int)uVar11 * 0xac + 0x16) = (short)puVar5;
            FUN_140090020(local_d8);
            puVar9 = local_100;
            puVar10 = local_108;
          }
          if ((local_c0 < puVar9) && (puVar10 <= local_c0)) {
            puVar6 = puVar10;
            if (puVar9 == local_f8) {
              uVar4 = (longlong)puVar9 - (longlong)puVar10 >> 2;
              if (0x3ffffffffffffffe < uVar4) {
                std::_Xlength_error("vector<T> too long");
                pcVar2 = (code *)swi(3);
                (*pcVar2)();
                return;
              }
              puVar5 = (undefined4 *)(uVar4 + 1);
              puVar8 = (undefined4 *)((longlong)local_f8 - (longlong)puVar10 >> 2);
              if (puVar8 < puVar5) {
                puVar6 = puVar12;
                if (puVar8 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar8 >> 1))) {
                  puVar6 = (undefined4 *)((longlong)puVar8 + ((ulonglong)puVar8 >> 1));
                }
                if (puVar6 < puVar5) {
                  puVar6 = puVar5;
                }
                FUN_140051e60(&local_108,puVar6);
                puVar9 = local_100;
                puVar6 = local_108;
              }
            }
            puVar5 = (undefined4 *)0x0;
            if (puVar9 != (undefined4 *)0x0) {
              *puVar9 = puVar6[(longlong)local_c0 - (longlong)puVar10 >> 2];
              puVar5 = local_100;
              puVar6 = local_108;
            }
          }
          else {
            if (puVar9 == local_f8) {
              uVar4 = (longlong)puVar9 - (longlong)puVar10 >> 2;
              if (0x3ffffffffffffffe < uVar4) {
                std::_Xlength_error("vector<T> too long");
                pcVar2 = (code *)swi(3);
                (*pcVar2)();
                return;
              }
              puVar6 = (undefined4 *)(uVar4 + 1);
              puVar5 = (undefined4 *)((longlong)local_f8 - (longlong)puVar10 >> 2);
              if (puVar5 < puVar6) {
                puVar9 = puVar12;
                if (puVar5 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar5 >> 1))) {
                  puVar9 = (undefined4 *)((longlong)puVar5 + ((ulonglong)puVar5 >> 1));
                }
                if (puVar9 < puVar6) {
                  puVar9 = puVar6;
                }
                FUN_140051e60(&local_108,puVar9);
                puVar9 = local_100;
                puVar10 = local_108;
              }
            }
            puVar5 = (undefined4 *)0x0;
            puVar6 = puVar10;
            if (puVar9 != (undefined4 *)0x0) {
              *puVar9 = local_c0[0];
              puVar5 = local_100;
              puVar6 = local_108;
            }
          }
          local_100 = puVar5 + 1;
          puVar5 = (undefined4 *)(ulonglong)(uVar11 + 1);
        } while ((int)(uVar11 + 1) < 10);
        plVar7 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x360);
        (**(code **)(*plVar7 + 0xb0))(plVar7,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_108)
        ;
        if (local_108 != (undefined4 *)0x0) {
          operator_delete(local_108);
        }
      }
    }
    else {
      iVar3 = DAT_140608048 + 1;
      bVar13 = DAT_140608048 == 0;
      DAT_140608048 = iVar3;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



void FUN_1401de740(longlong param_1,int param_2)

{
  longlong *plVar1;
  undefined1 local_res18 [8];
  int local_res20 [2];
  
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 != 1000) {
    if ((DAT_14060b7c4 & 1) == 0) {
      DAT_14060b7c4 = DAT_14060b7c4 | 1;
      FUN_140418590();
      atexit((_func_5014 *)&LAB_140448470);
    }
    if ((DAT_14060a120 != 0xcc) && (DAT_14060a120 != 0x68)) {
      if ((DAT_14060b7c4 & 1) == 0) {
        DAT_14060b7c4 = DAT_14060b7c4 | 1;
        FUN_140418590();
        atexit((_func_5014 *)&LAB_140448470);
      }
      if (DAT_14060a120 != 0xcc) {
        return;
      }
    }
  }
  local_res18[0] = 1;
  if (param_2 < 0x2a30) {
    if (param_2 < 18000) goto LAB_1401de81f;
  }
  else if (param_2 < 18000) {
    local_res18[0] = 2;
    goto LAB_1401de81f;
  }
  local_res18[0] = 3;
LAB_1401de81f:
  *(undefined1 *)(param_1 + 0x600) = local_res18[0];
  local_res20[0] = param_2 / 0x3c;
  plVar1 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  (**(code **)(*plVar1 + 0xdc0))
            (plVar1,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,local_res20,local_res18);
  return;
}



void thunk_FUN_1401dede0(void)

{
  FUN_1401dede0();
  return;
}



undefined8 FUN_1401de890(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_1406080c4 + 1;
    bVar3 = DAT_1406080c4 == 0;
    DAT_1406080c4 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



undefined4 * FUN_1401de8d0(longlong param_1,uint param_2)

{
  if (param_2 < 0x18) {
    return (undefined4 *)(param_1 + (longlong)(int)param_2 * 4);
  }
  if (DAT_1406093c0 == 0) {
    FUN_140176d60(0);
  }
  DAT_1406093c0 = DAT_1406093c0 + 1;
  return &DAT_1406093bc;
}



undefined * FUN_1401de910(longlong param_1,uint param_2)

{
  if (param_2 < 0x18) {
    return (undefined *)((longlong)(int)param_2 * 0x10 + param_1);
  }
  if (DAT_1406093b8 == 0) {
    FUN_140176d60(0);
  }
  DAT_1406093b8 = DAT_1406093b8 + 1;
  return &DAT_1406093a8;
}



void thunk_FUN_1401dee60(void)

{
  FUN_1401dee60();
  return;
}



void thunk_FUN_1401def10(void)

{
  FUN_1401def10();
  return;
}



void thunk_FUN_1401defb0(void)

{
  FUN_1401defb0();
  return;
}



undefined8 FUN_1401de990(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_1406080cc + 1;
    bVar3 = DAT_1406080cc == 0;
    DAT_1406080cc = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void thunk_FUN_1401df030(void)

{
  FUN_1401df030();
  return;
}



undefined8 FUN_1401de9e0(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_1406080d0 + 1;
    bVar3 = DAT_1406080d0 == 0;
    DAT_1406080d0 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void thunk_FUN_1401df0d0(void)

{
  FUN_1401df0d0();
  return;
}



undefined8 FUN_1401dea30(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_1406080d4 + 1;
    bVar3 = DAT_1406080d4 == 0;
    DAT_1406080d4 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



undefined8 FUN_1401dea70(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_1406080d8 + 1;
    bVar3 = DAT_1406080d8 == 0;
    DAT_1406080d8 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void thunk_FUN_1401df150(void)

{
  FUN_1401df150();
  return;
}



undefined8 FUN_1401deac0(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_1406080dc + 1;
    bVar3 = DAT_1406080dc == 0;
    DAT_1406080dc = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void thunk_FUN_1401df220(void)

{
  FUN_1401df220();
  return;
}



void thunk_FUN_1401df2a0(void)

{
  FUN_1401df2a0();
  return;
}



bool FUN_1401deb20(longlong param_1,ulonglong param_2)

{
  ulonglong uVar1;
  ulonglong uVar2;
  bool bVar3;
  undefined8 uStack_20;
  
  uStack_20 = *(longlong *)(param_1 + 0x10);
  bVar3 = *(ulonglong *)(param_1 + 8) == 0;
  uVar1 = *(ulonglong *)(param_1 + 8);
  if (!bVar3) {
    do {
      if ((uVar1 <= param_2) && (uVar2 = uVar1, param_2 < (uVar1 - 0x10) + uStack_20)) break;
      uVar2 = *(ulonglong *)((uVar1 - 0x10) + uStack_20);
      uStack_20 = *(longlong *)((uVar1 - 8) + uStack_20);
      uVar1 = uVar2;
    } while (uVar2 != 0);
    bVar3 = uVar2 == 0;
  }
  return !bVar3;
}



longlong * FUN_1401deb80(longlong *param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    plVar1 = (longlong *)FUN_14012e1e0();
  }
  else {
    *param_1 = *plVar1;
  }
  if (plVar1 == (longlong *)0x0) {
    plVar1 = (longlong *)0x0;
  }
  else {
    FUN_1401f6870(plVar1);
  }
  return plVar1;
}



void FUN_1401debd0(undefined8 *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  FUN_1401f6900(param_2);
  puVar1 = (ulonglong *)*param_1;
  if ((puVar1 != (ulonglong *)0x0) && (puVar1 <= param_2)) {
    for (puVar2 = (ulonglong *)*puVar1; (puVar2 != (ulonglong *)0x0 && (puVar2 <= param_2));
        puVar2 = (ulonglong *)*puVar2) {
      puVar1 = puVar2;
    }
    *param_2 = *puVar1;
    *puVar1 = (ulonglong)param_2;
    return;
  }
  *param_2 = (ulonglong)puVar1;
  *param_1 = param_2;
  return;
}



void thunk_FUN_1401df320(void)

{
  FUN_1401df320();
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401dec7b)
// WARNING: Removing unreachable block (ram,0x0001401dec80)

void FUN_1401dec50(longlong *param_1)

{
  if (*param_1 != param_1[1]) {
    param_1[1] = *param_1;
  }
  return;
}



void FUN_1401decc0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0x410) {
      FUN_1401dfef0(lVar2);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1401ded20(longlong *param_1)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = param_1[1] - *param_1;
  lVar2 = lVar2 / 6 + (lVar2 >> 0x3f);
  uVar4 = (lVar2 >> 2) - (lVar2 >> 0x3f);
  if (0xaaaaaaaaaaaaaa9 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  uVar3 = (param_1[2] - *param_1) / 0x18;
  if (uVar3 < uVar4) {
    if (0xaaaaaaaaaaaaaaa - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
      if (uVar4 != 0) {
        uVar3 = uVar4;
      }
      FUN_1401df3a0(param_1,uVar3);
      return;
    }
    uVar3 = uVar3 + (uVar3 >> 1);
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_1401df3a0(param_1,uVar3);
  }
  return;
}



void FUN_1401dede0(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_14034edf0((longlong)pvVar3 + 0x818);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080e8 + 1;
      bVar5 = DAT_1406080e8 == 0;
      DAT_1406080e8 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401dee60(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  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;
          puVar3 = (undefined8 *)*puVar2;
          if (puVar3 != (undefined8 *)0x0) {
            FUN_14034edf0(puVar3 + 4);
            if ((void *)*puVar3 != (void *)0x0) {
              operator_delete((void *)*puVar3);
            }
            *puVar3 = 0;
            puVar3[1] = 0;
            puVar3[2] = 0;
            operator_delete(puVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080ec + 1;
      bVar5 = DAT_1406080ec == 0;
      DAT_1406080ec = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



void FUN_1401def10(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_14034edf0((longlong)pvVar3 + 0x90);
            FUN_14025e6b0((longlong)pvVar3 + 0x48);
            FUN_14025e600(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080f0 + 1;
      bVar5 = DAT_1406080f0 == 0;
      DAT_1406080f0 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



void FUN_1401defb0(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_14034edf0((longlong)pvVar3 + 0x4b18);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080f4 + 1;
      bVar5 = DAT_1406080f4 == 0;
      DAT_1406080f4 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401df030(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_14034edf0((longlong)pvVar3 + 0x48);
            FUN_14025c370((longlong)pvVar3 + 0x20);
            FUN_14025c370(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080f8 + 1;
      bVar5 = DAT_1406080f8 == 0;
      DAT_1406080f8 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



void FUN_1401df0d0(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_14034edf0((longlong)pvVar3 + 0x9130);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406080fc + 1;
      bVar5 = DAT_1406080fc == 0;
      DAT_1406080fc = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401df150(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  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;
          puVar3 = (undefined8 *)*puVar2;
          if (puVar3 != (undefined8 *)0x0) {
            FUN_140267470(puVar3);
            *(undefined4 *)(puVar3 + 4) = 0;
            *(undefined4 *)((longlong)puVar3 + 0x24) = 0;
            *(undefined4 *)(puVar3 + 5) = 0;
            puVar3[6] = 0;
            *(undefined4 *)((longlong)puVar3 + 0x2c) = 0;
            *(undefined4 *)(puVar3 + 7) = 0;
            if ((void *)*puVar3 != (void *)0x0) {
              operator_delete((void *)*puVar3);
            }
            *puVar3 = 0;
            puVar3[1] = 0;
            puVar3[2] = 0;
            operator_delete(puVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608100 + 1;
      bVar5 = DAT_140608100 == 0;
      DAT_140608100 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401df220(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_14026ec20(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608104 + 1;
      bVar5 = DAT_140608104 == 0;
      DAT_140608104 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401df2a0(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_14026f2b0(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608108 + 1;
      bVar5 = DAT_140608108 == 0;
      DAT_140608108 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401df320(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_140273290(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14060810c + 1;
      bVar5 = DAT_14060810c == 0;
      DAT_14060810c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401df3a0(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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_1400573a0(*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;
}



uint * FUN_1401df4e0(longlong *param_1,uint param_2,uint *param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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[1] = *param_3;
        puVar2[2] = param_3[1];
        puVar2[3] = param_3[2];
        puVar2[4] = param_3[3];
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1401dfd00(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  puVar2[1] = *param_3;
  puVar2[2] = param_3[1];
  puVar2[3] = param_3[2];
  puVar2[4] = param_3[3];
  return puVar2;
}



void FUN_1401df5b0(void)

{
  FUN_1401df990();
  return;
}



undefined8 * FUN_1401df5d0(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] + 0x29) == '\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 + 0x29) == '\0');
  }
  puVar4 = puVar5;
  if (bVar6 != false) {
    if (puVar5 == (undefined8 *)**(undefined8 **)(param_1 + 8)) {
      bVar6 = true;
      goto LAB_1401df637;
    }
    if (*(char *)((longlong)puVar5 + 0x29) == '\0') {
      puVar4 = (undefined8 *)*puVar5;
      if (*(char *)((longlong)puVar4 + 0x29) == '\0') {
        cVar1 = *(char *)((longlong)puVar4[2] + 0x29);
        puVar3 = (undefined8 *)puVar4[2];
        while (cVar1 == '\0') {
          cVar1 = *(char *)((longlong)puVar3[2] + 0x29);
          puVar4 = puVar3;
          puVar3 = (undefined8 *)puVar3[2];
        }
      }
      else {
        cVar1 = *(char *)((longlong)puVar5[1] + 0x29);
        puVar3 = (undefined8 *)puVar5[1];
        puVar4 = puVar5;
        while ((puVar2 = puVar3, cVar1 == '\0' && (puVar4 == (undefined8 *)*puVar2))) {
          cVar1 = *(char *)((longlong)puVar2[1] + 0x29);
          puVar3 = (undefined8 *)puVar2[1];
          puVar4 = puVar2;
        }
        if (*(char *)((longlong)puVar4 + 0x29) == '\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_1401df637:
  puVar5 = (undefined8 *)FUN_1401df6f0(param_1,local_res8,bVar6,puVar5,param_3);
  *(undefined1 *)(param_2 + 1) = 1;
  *param_2 = *puVar5;
  return param_2;
}



undefined8 *
FUN_1401df6f0(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 (0xffffffffffffffd < *(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_1401df77a;
    }
    param_4[2] = param_5;
    lVar5 = *(longlong *)(param_1 + 8);
    if (param_4 != *(undefined8 **)(lVar5 + 0x10)) goto LAB_1401df77a;
  }
  *(longlong **)(lVar5 + 0x10) = param_5;
LAB_1401df77a:
  cVar1 = *(char *)(param_5[1] + 0x28);
  plVar7 = param_5;
  do {
    if (cVar1 != '\0') {
      lVar5 = *(longlong *)(param_1 + 8);
      *param_2 = param_5;
      *(undefined1 *)(*(longlong *)(lVar5 + 8) + 0x28) = 1;
      return param_2;
    }
    plVar6 = (longlong *)plVar7[1];
    plVar8 = (longlong *)plVar6[1];
    if (plVar6 == (longlong *)*plVar8) {
      lVar5 = plVar8[2];
      if (*(char *)(lVar5 + 0x28) != '\0') {
        if (plVar7 == (longlong *)plVar6[2]) {
          plVar7 = (longlong *)plVar6[2];
          plVar6[2] = *plVar7;
          if (*(char *)(*plVar7 + 0x29) == '\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] + 0x28) = 1;
        *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x28) = 0;
        plVar6 = *(longlong **)(plVar7[1] + 8);
        plVar8 = (longlong *)*plVar6;
        *plVar6 = plVar8[2];
        if (*(char *)(plVar8[2] + 0x29) == '\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_1401df958;
      }
LAB_1401df882:
      *(undefined1 *)(plVar6 + 5) = 1;
      *(undefined1 *)(lVar5 + 0x28) = 1;
      *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x28) = 0;
      plVar7 = *(longlong **)(plVar7[1] + 8);
    }
    else {
      lVar5 = *plVar8;
      if (*(char *)(lVar5 + 0x28) == '\0') goto LAB_1401df882;
      if (plVar7 == (longlong *)*plVar6) {
        lVar5 = *plVar6;
        *plVar6 = *(longlong *)(lVar5 + 0x10);
        if (*(char *)(*(longlong *)(lVar5 + 0x10) + 0x29) == '\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] + 0x28) = 1;
      *(undefined1 *)(*(longlong *)(plVar7[1] + 8) + 0x28) = 0;
      plVar6 = *(longlong **)(plVar7[1] + 8);
      plVar8 = (longlong *)plVar6[2];
      plVar6[2] = *plVar8;
      if (*(char *)(*plVar8 + 0x29) == '\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_1401df958:
      plVar6[1] = (longlong)plVar8;
    }
    cVar1 = *(char *)(plVar7[1] + 0x28);
  } while( true );
}



void FUN_1401df990(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar7 = 0;
  if ((*param_1 != 0) && (uVar8 = uVar7, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(uVar8 + *param_1);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x18);
        *(longlong *)(lVar3 + 0x18) = param_1[8];
        param_1[1] = param_1[1] + -1;
        param_1[8] = lVar3;
        if (((ulonglong)param_1[1] < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          uVar4 = FUN_1402cddb0(param_1);
          FUN_1401dfb50(param_1,uVar4);
        }
        lVar3 = lVar1;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar5 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar5;
              free(plVar5);
              plVar5 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      uVar8 = uVar8 + 8;
    } 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_1402cddb0(param_1,0);
    FUN_1402c6d50(param_1,uVar4,0);
  }
  param_1[8] = 0;
  plVar5 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar5;
      free(plVar5);
      plVar5 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_1401dfad0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1401dfe60(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x18);
  FUN_1401dfe60(param_1,param_2);
  return;
}



void FUN_1401dfb50(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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;
}



undefined4 *
FUN_1401dfd00(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_1401dfdb7;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401dfdb7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 6);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 1) = 0;
  puVar2[3] = 0;
  puVar2[4] = 1;
  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_1402cddb0(param_1);
    FUN_1401dfb50(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1401dfe60(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_1402cddb0();
      FUN_1401dfb50(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_14000d450(0x80004005);
}



void FUN_1401dfef0(longlong param_1)

{
  FUN_1401e0230(param_1 + 0x3a8);
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x308),0x28,4,FUN_14023be90);
  if (*(void **)(param_1 + 0x2e8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x2e8));
  }
  *(undefined8 *)(param_1 + 0x2e8) = 0;
  *(undefined8 *)(param_1 + 0x2f0) = 0;
  *(undefined8 *)(param_1 + 0x2f8) = 0;
  if (*(void **)(param_1 + 0x2c8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x2c8));
  }
  *(undefined8 *)(param_1 + 0x2c8) = 0;
  *(undefined8 *)(param_1 + 0x2d0) = 0;
  *(undefined8 *)(param_1 + 0x2d8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2b8)) {
    operator_delete(*(void **)(param_1 + 0x2a0));
  }
  *(undefined8 *)(param_1 + 0x2b8) = 7;
  *(undefined8 *)(param_1 + 0x2b0) = 0;
  *(undefined2 *)(param_1 + 0x2a0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x290)) {
    operator_delete(*(void **)(param_1 + 0x278));
  }
  *(undefined8 *)(param_1 + 0x290) = 7;
  *(undefined8 *)(param_1 + 0x288) = 0;
  *(undefined2 *)(param_1 + 0x278) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x268)) {
    operator_delete(*(void **)(param_1 + 0x250));
  }
  *(undefined8 *)(param_1 + 0x268) = 7;
  *(undefined8 *)(param_1 + 0x260) = 0;
  *(undefined2 *)(param_1 + 0x250) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x240)) {
    operator_delete(*(void **)(param_1 + 0x228));
  }
  *(undefined8 *)(param_1 + 0x240) = 7;
  *(undefined8 *)(param_1 + 0x238) = 0;
  *(undefined2 *)(param_1 + 0x228) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x218)) {
    operator_delete(*(void **)(param_1 + 0x200));
  }
  *(undefined8 *)(param_1 + 0x218) = 7;
  *(undefined8 *)(param_1 + 0x210) = 0;
  *(undefined2 *)(param_1 + 0x200) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1f0)) {
    operator_delete(*(void **)(param_1 + 0x1d8));
  }
  *(undefined8 *)(param_1 + 0x1f0) = 7;
  *(undefined8 *)(param_1 + 0x1e8) = 0;
  *(undefined2 *)(param_1 + 0x1d8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1c8)) {
    operator_delete(*(void **)(param_1 + 0x1b0));
  }
  *(undefined8 *)(param_1 + 0x1c8) = 7;
  *(undefined8 *)(param_1 + 0x1c0) = 0;
  *(undefined2 *)(param_1 + 0x1b0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1a0)) {
    operator_delete(*(void **)(param_1 + 0x188));
  }
  *(undefined8 *)(param_1 + 0x1a0) = 7;
  *(undefined8 *)(param_1 + 0x198) = 0;
  *(undefined2 *)(param_1 + 0x188) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x178)) {
    operator_delete(*(void **)(param_1 + 0x160));
  }
  *(undefined8 *)(param_1 + 0x178) = 7;
  *(undefined8 *)(param_1 + 0x170) = 0;
  *(undefined2 *)(param_1 + 0x160) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x150)) {
    operator_delete(*(void **)(param_1 + 0x138));
  }
  *(undefined8 *)(param_1 + 0x150) = 7;
  *(undefined8 *)(param_1 + 0x148) = 0;
  *(undefined2 *)(param_1 + 0x138) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x128)) {
    operator_delete(*(void **)(param_1 + 0x110));
  }
  *(undefined8 *)(param_1 + 0x128) = 7;
  *(undefined8 *)(param_1 + 0x120) = 0;
  *(undefined2 *)(param_1 + 0x110) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x100)) {
    operator_delete(*(void **)(param_1 + 0xe8));
  }
  *(undefined8 *)(param_1 + 0x100) = 7;
  *(undefined8 *)(param_1 + 0xf8) = 0;
  *(undefined2 *)(param_1 + 0xe8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xd8)) {
    operator_delete(*(void **)(param_1 + 0xc0));
  }
  *(undefined8 *)(param_1 + 0xd8) = 7;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  *(undefined2 *)(param_1 + 0xc0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xb0)) {
    operator_delete(*(void **)(param_1 + 0x98));
  }
  *(undefined8 *)(param_1 + 0xb0) = 7;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined2 *)(param_1 + 0x98) = 0;
  return;
}



void FUN_1401e0230(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  plVar3 = *(longlong **)(param_1 + 0x60);
  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);
      }
    }
  }
  plVar3 = *(longlong **)(param_1 + 0x50);
  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_1401e02b0(void *param_1)

{
  _eh_vector_destructor_iterator_(param_1,0x28,4,FUN_14023be90);
  return;
}



void * FUN_1401e02d0(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x2000000000000000) && (pvVar1 = operator_new(param_1 << 3), 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_1405d3608);
}



undefined8 * FUN_1401e0340(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0x2158);
  lVar1 = *(longlong *)(param_1 + 0x2160);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



undefined8 * FUN_1401e0370(undefined8 *param_1,undefined8 *param_2)

{
  *(undefined2 *)((longlong)param_1 + 0x14) = *(undefined2 *)(param_2 + 2);
  *(undefined2 *)((longlong)param_1 + 0x16) = *(undefined2 *)((longlong)param_2 + 0x12);
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  *(undefined4 *)(param_1 + 3) = *(undefined4 *)((longlong)param_2 + 0x14);
  *(undefined2 *)((longlong)param_1 + 0x1c) = *(undefined2 *)(param_2 + 3);
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)((longlong)param_2 + 0x1a);
  *(undefined4 *)((longlong)param_1 + 0x24) = *(undefined4 *)((longlong)param_2 + 0x1e);
  *(undefined2 *)(param_1 + 5) = *(undefined2 *)((longlong)param_2 + 0x22);
  *(undefined4 *)(param_1 + 6) = *(undefined4 *)((longlong)param_2 + 0x24);
  *(undefined4 *)((longlong)param_1 + 0x34) = *(undefined4 *)((longlong)param_2 + 0x2c);
  *(undefined4 *)(param_1 + 7) = *(undefined4 *)((longlong)param_2 + 0x34);
  *(undefined4 *)((longlong)param_1 + 0x3c) = *(undefined4 *)(param_2 + 5);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_2 + 6);
  *(undefined4 *)((longlong)param_1 + 0x44) = *(undefined4 *)(param_2 + 7);
  *(undefined4 *)((longlong)param_1 + 0x2c) = *(undefined4 *)((longlong)param_2 + 0x3c);
  *(undefined2 *)(param_1 + 9) = *(undefined2 *)(param_2 + 8);
  *(undefined4 *)((longlong)param_1 + 0x4c) = *(undefined4 *)((longlong)param_2 + 0x42);
  *(undefined4 *)(param_1 + 10) = *(undefined4 *)((longlong)param_2 + 0x4a);
  *(undefined4 *)((longlong)param_1 + 0x54) = *(undefined4 *)((longlong)param_2 + 0x52);
  *(undefined4 *)(param_1 + 0xb) = *(undefined4 *)((longlong)param_2 + 0x46);
  *(undefined4 *)((longlong)param_1 + 0x5c) = *(undefined4 *)((longlong)param_2 + 0x4e);
  *(undefined4 *)(param_1 + 0xc) = *(undefined4 *)((longlong)param_2 + 0x56);
  *(undefined1 *)((longlong)param_1 + 100) = *(undefined1 *)((longlong)param_2 + 0x5a);
  *(undefined1 *)((longlong)param_1 + 0x65) = *(undefined1 *)((longlong)param_2 + 0x5b);
  *(undefined1 *)((longlong)param_1 + 0x66) = *(undefined1 *)((longlong)param_2 + 0x5c);
  *(undefined2 *)((longlong)param_1 + 0x6c) = *(undefined2 *)((longlong)param_2 + 0x5d);
  *(undefined2 *)((longlong)param_1 + 0x6e) = *(undefined2 *)((longlong)param_2 + 0x5f);
  *(undefined4 *)(param_1 + 0xe) = *(undefined4 *)((longlong)param_2 + 0x61);
  *(undefined2 *)((longlong)param_1 + 0x7c) = *(undefined2 *)((longlong)param_2 + 0x6d);
  param_1[0x10] = *(undefined8 *)((longlong)param_2 + 0x6f);
  param_1[0x11] = *(undefined8 *)((longlong)param_2 + 0x77);
  *(undefined4 *)(param_1 + 0x12) = *(undefined4 *)((longlong)param_2 + 0x7f);
  *(undefined2 *)((longlong)param_1 + 0x94) = *(undefined2 *)((longlong)param_2 + 0x83);
  *(undefined2 *)((longlong)param_1 + 0x96) = *(undefined2 *)((longlong)param_2 + 0x85);
  *(undefined4 *)(param_1 + 0x13) = *(undefined4 *)((longlong)param_2 + 0x87);
  *(undefined4 *)((longlong)param_1 + 0x9c) = *(undefined4 *)((longlong)param_2 + 0x8b);
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)((longlong)param_2 + 0x8f);
  *(undefined4 *)(param_1 + 0xd) = *(undefined4 *)((longlong)param_2 + 0x93);
  return param_1;
}



void FUN_1401e04b0(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  param_1[6] = 0;
  return;
}



undefined8 *
FUN_1401e04e0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0xd4;
  param_1[5] = 0x20;
  param_1[6] = 0x20;
  *param_1 = CPool<>::vftable;
  param_1[7] = CMap<>::vftable;
  FUN_1401755e0(param_1 + 8);
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  param_1[0xf] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x1f,uVar1,1,param_4,uVar2);
  FUN_1401e05f0(param_1);
  *(undefined4 *)(param_1 + 0x1b) = 2;
  *(undefined4 *)((longlong)param_1 + 0xdc) = 4;
  *(undefined4 *)(param_1 + 0x1c) = 8;
  *(undefined4 *)((longlong)param_1 + 0xe4) = 0x10;
  *(undefined4 *)(param_1 + 0x1d) = 0x20;
  *(undefined4 *)((longlong)param_1 + 0xec) = 0x40;
  *(undefined4 *)(param_1 + 0x1e) = 0x80;
  return param_1;
}



void FUN_1401e05f0(longlong param_1)

{
  char cVar1;
  ulonglong *puVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  ulonglong *puVar5;
  longlong *plVar6;
  void *pvVar7;
  longlong lVar8;
  ulonglong *puVar9;
  longlong *plVar10;
  longlong *plVar11;
  undefined4 uStack_20;
  undefined4 uStack_1c;
  
  FUN_14034ed40(param_1 + 0xf8);
  plVar11 = (longlong *)**(longlong **)(param_1 + 0x48);
  if (plVar11 != *(longlong **)(param_1 + 0x48)) {
    do {
      puVar2 = (ulonglong *)plVar11[4];
      if (puVar2 != (ulonglong *)0x0) {
        uVar4 = *(ulonglong *)(param_1 + 0x10);
        uStack_20 = *(undefined4 *)(param_1 + 0x18);
        uStack_1c = *(undefined4 *)(param_1 + 0x1c);
        while (uVar4 != 0) {
          lVar8 = CONCAT44(uStack_1c,uStack_20);
          if ((uVar4 <= puVar2) && (puVar2 < (uVar4 - 0x10) + lVar8)) {
            if (uVar4 != 0) {
              puVar5 = *(ulonglong **)(param_1 + 8);
              if ((puVar5 == (ulonglong *)0x0) || (puVar2 < puVar5)) {
                *puVar2 = (ulonglong)puVar5;
                *(ulonglong **)(param_1 + 8) = puVar2;
              }
              else {
                for (puVar9 = (ulonglong *)*puVar5;
                    (puVar9 != (ulonglong *)0x0 && (puVar9 <= puVar2));
                    puVar9 = (ulonglong *)*puVar9) {
                  puVar5 = puVar9;
                }
                *puVar2 = *puVar5;
                *puVar5 = (ulonglong)puVar2;
              }
            }
            break;
          }
          uVar3 = *(undefined8 *)(lVar8 + -8 + uVar4);
          uVar4 = *(ulonglong *)(lVar8 + -0x10 + uVar4);
          uStack_20 = (undefined4)uVar3;
          uStack_1c = (undefined4)((ulonglong)uVar3 >> 0x20);
        }
      }
      if (*(char *)((longlong)plVar11 + 0x29) == '\0') {
        plVar6 = (longlong *)plVar11[2];
        if (*(char *)((longlong)plVar6 + 0x29) == '\0') {
          cVar1 = *(char *)(*plVar6 + 0x29);
          plVar11 = plVar6;
          plVar6 = (longlong *)*plVar6;
          while (cVar1 == '\0') {
            cVar1 = *(char *)(*plVar6 + 0x29);
            plVar11 = plVar6;
            plVar6 = (longlong *)*plVar6;
          }
        }
        else {
          cVar1 = *(char *)(plVar11[1] + 0x29);
          plVar10 = (longlong *)plVar11[1];
          plVar6 = plVar11;
          while ((plVar11 = plVar10, cVar1 == '\0' && (plVar6 == (longlong *)plVar11[2]))) {
            cVar1 = *(char *)(plVar11[1] + 0x29);
            plVar10 = (longlong *)plVar11[1];
            plVar6 = plVar11;
          }
        }
      }
    } while (plVar11 != *(longlong **)(param_1 + 0x48));
  }
  plVar11 = *(longlong **)(*(longlong *)(param_1 + 0x48) + 8);
  cVar1 = *(char *)((longlong)plVar11 + 0x29);
  while (cVar1 == '\0') {
    FUN_14012f260(param_1 + 0x40,plVar11[2]);
    plVar6 = (longlong *)*plVar11;
    operator_delete(plVar11);
    plVar11 = plVar6;
    cVar1 = *(char *)((longlong)plVar6 + 0x29);
  }
  *(longlong *)(*(longlong *)(param_1 + 0x48) + 8) = *(longlong *)(param_1 + 0x48);
  *(undefined8 *)*(undefined8 *)(param_1 + 0x48) = *(undefined8 *)(param_1 + 0x48);
  *(longlong *)(*(longlong *)(param_1 + 0x48) + 0x10) = *(longlong *)(param_1 + 0x48);
  *(undefined8 *)(param_1 + 0x50) = 0;
  pvVar7 = *(void **)(param_1 + 0x68);
  if (pvVar7 != *(void **)(param_1 + 0x70)) {
    memmove(pvVar7,*(void **)(param_1 + 0x70),0);
    *(void **)(param_1 + 0x70) = pvVar7;
  }
  pvVar7 = *(void **)(param_1 + 0x88);
  if (pvVar7 != *(void **)(param_1 + 0x90)) {
    memmove(pvVar7,*(void **)(param_1 + 0x90),0);
    *(void **)(param_1 + 0x90) = pvVar7;
  }
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  FUN_14034edd0(param_1 + 0xf8);
  return;
}



void FUN_1401e0840(void)

{
  void *pvVar1;
  longlong lVar2;
  
  lVar2 = DAT_140607cc0;
  if (DAT_140607cc0 == 0) {
    pvVar1 = operator_new(0x130);
    lVar2 = 0;
    if (pvVar1 != (void *)0x0) {
      lVar2 = FUN_1401e04e0(pvVar1);
    }
  }
  DAT_140607cc0 = lVar2;
  return;
}



undefined8 FUN_1401e0890(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0xf8;
  lVar3 = lVar1;
  FUN_14034ed40(lVar1);
  uVar2 = (**(code **)(*(longlong *)(param_1 + 0x38) + 0x10))
                    ((longlong *)(param_1 + 0x38),param_2,param_3,param_4,uVar2,lVar3,1);
  FUN_14034edd0(lVar1);
  return uVar2;
}



void FUN_1401e0900(longlong param_1,int param_2)

{
  int *piVar1;
  int *_Dst;
  
  FUN_14034ed40(param_1 + 0xf8);
  if (*(longlong *)(param_1 + 0x70) - *(longlong *)(param_1 + 0x68) >> 2 != 0) {
    piVar1 = *(int **)(param_1 + 0x70);
    _Dst = *(int **)(param_1 + 0x68);
    if (_Dst != piVar1) {
      do {
        if (*_Dst == param_2) break;
        _Dst = _Dst + 1;
      } while (_Dst != piVar1);
      if (_Dst != piVar1) {
        memmove(_Dst,_Dst + 1,(longlong)piVar1 - (longlong)(_Dst + 1) & 0xfffffffffffffffc);
        *(longlong *)(param_1 + 0x70) = *(longlong *)(param_1 + 0x70) + -4;
      }
    }
  }
  FUN_14034edd0(param_1 + 0xf8);
  return;
}



void FUN_1401e09a0(longlong param_1,int param_2)

{
  int *piVar1;
  int *_Dst;
  
  FUN_14034ed40(param_1 + 0xf8);
  if (*(longlong *)(param_1 + 0x90) - *(longlong *)(param_1 + 0x88) >> 2 != 0) {
    piVar1 = *(int **)(param_1 + 0x90);
    _Dst = *(int **)(param_1 + 0x88);
    if (_Dst != piVar1) {
      do {
        if (*_Dst == param_2) break;
        _Dst = _Dst + 1;
      } while (_Dst != piVar1);
      if (_Dst != piVar1) {
        memmove(_Dst,_Dst + 1,(longlong)piVar1 - (longlong)(_Dst + 1) & 0xfffffffffffffffc);
        *(longlong *)(param_1 + 0x90) = *(longlong *)(param_1 + 0x90) + -4;
      }
    }
  }
  FUN_14034edd0(param_1 + 0xf8);
  return;
}



undefined8 FUN_1401e0a40(longlong param_1,int param_2,char param_3)

{
  longlong lVar1;
  int *piVar2;
  int iVar3;
  longlong lVar4;
  int *piVar5;
  int local_res10 [2];
  int local_138 [2];
  undefined1 local_130 [280];
  
  lVar1 = param_1 + 0xf8;
  local_res10[0] = param_2;
  FUN_14034ed40(lVar1);
  FUN_14034ed40(lVar1);
  lVar4 = (**(code **)(*(longlong *)(param_1 + 0x38) + 0x10))((longlong *)(param_1 + 0x38),param_2);
  FUN_14034edd0(lVar1);
  if (lVar4 == 0) {
    FUN_14034edd0(lVar1);
    return 0;
  }
  if (*(char *)(lVar4 + 0xcc) == param_3) {
    FUN_14034edd0(lVar1);
    return 0;
  }
  *(char *)(lVar4 + 0xcc) = param_3;
  if (param_3 != '\x01') {
    if (param_3 == '\x02') {
      FUN_14012cfa0(DAT_140608030,param_2);
      FUN_14012e5c0(param_1 + 0x88,local_res10);
      iVar3 = local_res10[0];
      FUN_1401e0900(param_1,local_res10[0]);
      if (*(longlong *)(param_1 + 0xb0) - *(longlong *)(param_1 + 0xa8) >> 2 != 0) {
        FUN_14034ed40(lVar1);
        if (*(longlong *)(param_1 + 0x70) - *(longlong *)(param_1 + 0x68) >> 2 != 0) {
          piVar2 = *(int **)(param_1 + 0xb0);
          piVar5 = *(int **)(param_1 + 0xa8);
          if (piVar5 != piVar2) {
            do {
              if (*piVar5 == iVar3) break;
              piVar5 = piVar5 + 1;
            } while (piVar5 != piVar2);
            if (piVar5 != piVar2) {
              memmove(piVar5,piVar5 + 1,
                      (longlong)piVar2 - (longlong)(piVar5 + 1) & 0xfffffffffffffffc);
              *(longlong *)(param_1 + 0xb0) = *(longlong *)(param_1 + 0xb0) + -4;
            }
          }
        }
        FUN_14034edd0(lVar1);
      }
    }
    goto LAB_1401e0c47;
  }
  piVar2 = *(int **)(param_1 + 0x70);
  piVar5 = *(int **)(param_1 + 0x68);
  if (piVar5 == piVar2) {
LAB_1401e0b12:
    FUN_14012e5c0((undefined8 *)(param_1 + 0x68),local_res10);
    param_2 = local_res10[0];
  }
  else {
    do {
      if (*piVar5 == param_2) break;
      piVar5 = piVar5 + 1;
    } while (piVar5 != piVar2);
    if (piVar5 == piVar2) goto LAB_1401e0b12;
  }
  FUN_1401e09a0(param_1);
  if (*(char *)(lVar4 + 6) == '\x05') {
    FUN_14012e5c0(param_1 + 0xa8);
    param_2 = local_res10[0];
  }
  local_138[1] = 0;
  memset(local_130,0,0x100);
  local_138[0] = param_2;
  FUN_14012cee0(DAT_140608030,local_138);
LAB_1401e0c47:
  FUN_14034edd0(lVar1);
  return 1;
}



undefined8 FUN_1401e0c70(longlong param_1,undefined4 param_2,int *param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = param_1 + 0xf8;
  FUN_14034ed40(lVar1);
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
    if ((DAT_14060b7f4 & 1) == 0) {
      DAT_14060b7f4 = DAT_14060b7f4 | 1;
      FUN_14015b4b0();
      atexit((_func_5014 *)&LAB_140448930);
    }
    *param_3 = DAT_14060948c;
  }
  else {
    lVar2 = FUN_1401e0890(param_1,param_2);
    if (lVar2 == 0) {
      FUN_14034edd0(lVar1);
      return 0;
    }
    if (*(char *)(lVar2 + 0xcc) != '\x01') {
      FUN_14034edd0(lVar1);
      return 0;
    }
    if (*(char *)(lVar2 + 6) != '\f') {
      FUN_14034edd0(lVar1);
      return 0;
    }
    *param_3 = (int)*(float *)(lVar2 + 8);
  }
  FUN_14034edd0(lVar1);
  return 1;
}



undefined8 FUN_1401e0d80(longlong param_1,undefined4 param_2,longlong param_3)

{
  void *pvVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined4 *puVar9;
  longlong *plVar10;
  undefined2 uVar11;
  wchar_t *_Src;
  undefined8 *puVar12;
  undefined2 uVar13;
  int *piVar14;
  longlong *plVar15;
  bool bVar16;
  undefined4 extraout_XMM0_Da;
  undefined2 local_res8 [4];
  undefined2 local_res20 [4];
  undefined4 *in_stack_fffffffffffffca8;
  undefined4 uVar17;
  undefined *in_stack_fffffffffffffcc0;
  undefined4 uVar18;
  undefined4 *in_stack_fffffffffffffcc8;
  undefined4 uVar19;
  undefined8 *local_318;
  undefined8 *local_310;
  longlong local_308;
  longlong *local_300;
  longlong *local_2f8;
  longlong local_2f0;
  undefined2 local_2e8 [2];
  uint local_2e4;
  uint local_2e0;
  int local_2dc;
  undefined4 local_2d8 [2];
  longlong local_2d0;
  undefined1 local_2c8;
  longlong local_2c0;
  undefined1 local_2b8;
  undefined4 *local_2b0;
  undefined4 local_2a8;
  undefined4 local_2a4;
  undefined4 local_2a0;
  undefined4 local_29c;
  undefined4 local_298;
  undefined4 local_294;
  undefined4 local_290;
  undefined4 local_28c;
  undefined4 local_288;
  undefined4 local_284;
  undefined4 local_280;
  undefined4 local_27c;
  ulonglong local_278;
  undefined4 *local_270;
  longlong local_268;
  undefined8 local_260;
  undefined4 local_250;
  undefined4 uStack_24c;
  undefined4 uStack_248;
  undefined4 uStack_244;
  undefined2 local_240;
  void *local_238;
  undefined8 local_230;
  undefined8 local_228;
  longlong local_218;
  undefined1 local_210;
  undefined8 local_208;
  undefined4 local_1f8;
  undefined4 uStack_1f4;
  undefined4 uStack_1f0;
  undefined4 uStack_1ec;
  undefined2 local_1e4;
  undefined2 local_1e2;
  int local_1e0;
  undefined2 local_1dc;
  undefined4 local_150;
  undefined1 local_148 [16];
  undefined1 local_138 [8];
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  wchar_t local_110 [48];
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a4;
  char local_a0 [104];
  
  local_208 = 0xfffffffffffffffe;
  lVar6 = param_1 + 0xf8;
  local_2d0 = lVar6;
  FUN_14034ed40(lVar6);
  local_2c8 = 1;
  local_218 = lVar6;
  FUN_14034ed40(lVar6);
  local_210 = 1;
  lVar5 = (**(code **)(*(longlong *)(param_1 + 0x38) + 0x10))((longlong *)(param_1 + 0x38),param_2);
  FUN_14034edd0(lVar6);
  if (((lVar5 != 0) && (*(char *)(lVar5 + 0xcc) == '\x01')) && (*(char *)(lVar5 + 6) == '\v')) {
    FUN_140198570(param_3,&local_300);
    plVar15 = local_300;
    if (local_300 != (longlong *)0x0) {
      if (local_300 == local_2f8) {
        if (*local_300 != 0) {
          FUN_140197b70(param_3,&local_318);
          lVar6 = FUN_140174f00(&local_318);
          if (lVar6 == 0) {
            if (local_318 != (undefined8 *)0x0) {
              if (local_318 == local_310) {
                LOCK();
                piVar14 = (int *)(local_318 + 1);
                iVar3 = *piVar14;
                *piVar14 = *piVar14 + -1;
                UNLOCK();
                plVar15 = local_300;
                if (iVar3 == 1) {
                  pvVar1 = (void *)*local_318;
                  if (pvVar1 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar1 + 0xf630);
                    operator_delete(pvVar1);
                  }
                  operator_delete(local_318);
                  plVar15 = local_300;
                }
              }
              else {
                iVar3 = DAT_140608050 + 1;
                bVar16 = DAT_140608050 == 0;
                DAT_140608050 = iVar3;
                if (bVar16) {
                  FUN_140176d60(1);
                }
              }
            }
            LOCK();
            plVar15 = plVar15 + 1;
            *(int *)plVar15 = (int)*plVar15 + -1;
            UNLOCK();
            lVar6 = local_2d0;
            if ((int)*plVar15 == 0) {
              puVar12 = (undefined8 *)*local_300;
              if (puVar12 != (undefined8 *)0x0) {
                (**(code **)*puVar12)(puVar12,1);
              }
              operator_delete(local_300);
              lVar6 = local_2d0;
            }
          }
          else {
            local_270 = (undefined4 *)0x0;
            local_268 = 0;
            local_260 = 0;
            uVar7 = FUN_14031c960();
            FUN_14031c7e0(uVar7,&local_270);
            local_278 = local_268 - (longlong)local_270 >> 2;
            if (local_278 != 0) {
              local_2e0 = 0;
              puVar9 = local_270;
              if (local_278 != 0) {
                do {
                  local_2b0 = puVar9;
                  uVar7 = FUN_14031c960();
                  lVar6 = FUN_14031c7a0(uVar7,*puVar9);
                  local_308 = lVar6;
                  if (lVar6 == 0) {
                    if (local_270 != (undefined4 *)0x0) {
                      operator_delete(local_270);
                    }
                    if (local_318 != (undefined8 *)0x0) {
                      if (local_318 == local_310) {
                        LOCK();
                        piVar14 = (int *)(local_318 + 1);
                        iVar3 = *piVar14;
                        *piVar14 = *piVar14 + -1;
                        UNLOCK();
                        plVar15 = local_300;
                        if (iVar3 == 1) {
                          pvVar1 = (void *)*local_318;
                          if (pvVar1 != (void *)0x0) {
                            FUN_14034edf0((longlong)pvVar1 + 0xf630);
                            operator_delete(pvVar1);
                          }
                          operator_delete(local_318);
                          plVar15 = local_300;
                        }
                      }
                      else {
                        iVar3 = DAT_140608050 + 1;
                        bVar16 = DAT_140608050 == 0;
                        DAT_140608050 = iVar3;
                        if (bVar16) {
                          FUN_140176d60(1);
                        }
                      }
                    }
                    LOCK();
                    plVar15 = plVar15 + 1;
                    lVar5 = *plVar15;
                    *(int *)plVar15 = (int)*plVar15 + -1;
                    UNLOCK();
                    lVar6 = local_2d0;
                    if ((int)lVar5 == 1) {
                      puVar12 = (undefined8 *)*local_300;
                      if (puVar12 != (undefined8 *)0x0) {
                        (**(code **)*puVar12)(puVar12,1);
                      }
                      operator_delete(local_300);
                      lVar6 = local_2d0;
                    }
                    goto LAB_1401e17c0;
                  }
                  iVar4 = FUN_1402f8580(*plVar15);
                  lVar5 = (**(code **)(*(longlong *)*plVar15 + 0x270))();
                  iVar3 = *(int *)(lVar6 + 8);
                  if (iVar3 == 0) {
                    if ((*(int *)(lVar6 + 0x14) <= iVar4) && (iVar4 <= *(int *)(lVar6 + 0x18))) {
LAB_1401e10c4:
                      piVar14 = (int *)(lVar6 + 0x2c);
                      local_2f0 = 3;
                      do {
                        lVar5 = local_2f0;
                        if ((0 < *piVar14) && (iVar3 = piVar14[-3], 0 < iVar3)) {
                          uVar7 = FUN_140137690();
                          lVar8 = FUN_140136770(uVar7,iVar3);
                          if (lVar8 != 0) {
                            FUN_14000a170(&local_1f8);
                            local_150 = 0;
                            puVar9 = (undefined4 *)FUN_140357570(local_148);
                            uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20);
                            uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffcc8 >> 0x20);
                            uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffca8 >> 0x20);
                            local_1f8 = *puVar9;
                            uStack_1f4 = puVar9[1];
                            uStack_1f0 = puVar9[2];
                            uStack_1ec = puVar9[3];
                            local_1e0 = piVar14[-3];
                            local_1dc = (undefined2)*piVar14;
                            if (*(int *)(lVar6 + 0x1c) == 1) {
                              iVar3 = *(int *)(lVar8 + 0xdc);
                              local_2e4 = 0xffffffff;
                              local_2dc = iVar3;
                              uVar7 = FUN_140174f00(&local_318);
                              lVar6 = local_308;
                              if ((-1 < iVar3) &&
                                 (iVar4 = FUN_1401ed430(uVar7,&local_2dc,&local_2e4),
                                 uVar2 = local_2e4, lVar6 = local_308, iVar4 != 0)) {
                                uVar11 = (undefined2)iVar3;
                                lVar8 = (longlong)(int)local_2e4;
                                uVar13 = (undefined2)local_2e4;
                                local_1e4 = uVar11;
                                local_1e2 = uVar13;
                                lVar5 = FUN_140174f00(&local_318);
                                lVar6 = lVar5 + 0xf630;
                                local_2c0 = lVar6;
                                FUN_14034ed40(lVar6);
                                local_2b8 = 1;
                                if ((iVar3 < 5) && (uVar2 < 0x18)) {
                                  uVar7 = FUN_140137690();
                                  iVar4 = FUN_140136b30(uVar7,local_1e0);
                                  if ((iVar3 == iVar4) &&
                                     (iVar3 = FUN_14011b180((lVar8 + (longlong)iVar3 * 0x18) * 0xac
                                                            + lVar5), iVar3 != 0)) {
                                    local_1e4 = uVar11;
                                    local_1e2 = uVar13;
                                    FUN_140090020(extraout_XMM0_Da,&local_1f8);
                                  }
                                }
                                FUN_14034edd0(lVar6);
                                local_2b8 = 0;
                                plVar10 = (longlong *)(*(longlong *)(param_3 + 0xb50) + 0x78);
                                in_stack_fffffffffffffca8 = (undefined4 *)local_res8;
                                local_res8[0] = uVar13;
                                local_res20[0] = uVar11;
                                (**(code **)(*plVar10 + 0xe0))
                                          (plVar10,*(undefined4 *)(param_3 + 8),&DAT_1405d85a0,
                                           local_res20,in_stack_fffffffffffffca8,&local_1f8);
                                local_288 = *(undefined4 *)(param_3 + 0x160);
                                local_284 = *(undefined4 *)(param_3 + 0x164);
                                local_280 = *(undefined4 *)(param_3 + 0x168);
                                local_27c = *(undefined4 *)(param_3 + 0x16c);
                                local_2a8 = *(undefined4 *)(param_3 + 0x170);
                                local_2a4 = *(undefined4 *)(param_3 + 0x174);
                                local_2a0 = *(undefined4 *)(param_3 + 0x178);
                                local_29c = *(undefined4 *)(param_3 + 0x17c);
                                iVar3 = *(int *)(param_3 + 0x284);
                                local_2d8[0] = *(undefined4 *)(param_3 + 8);
                                lVar6 = local_308;
                                lVar5 = local_2f0;
                                if ((-1 < iVar3) &&
                                   (iVar3 < *(short *)(*(longlong *)(param_3 + 0xb50) + 700))) {
                                  if ((CONCAT44(uStack_1f4,local_1f8) == 0) &&
                                     (CONCAT44(uStack_1ec,uStack_1f0) == 0)) {
                                    bVar16 = false;
                                  }
                                  else {
                                    bVar16 = true;
                                  }
                                  if (((bVar16) && (local_1e0 != 0)) &&
                                     (lVar8 = *(longlong *)(*(longlong *)(param_3 + 0xb50) + 0x4c0),
                                     lVar8 != 0)) {
                                    local_2e8[0] = (undefined2)iVar3;
                                    plVar10 = (longlong *)
                                              (*(longlong *)
                                                (*(longlong *)(lVar8 + 8) +
                                                (longlong)*(int *)(param_3 + 0x288) * 8) + 0x70);
                                    in_stack_fffffffffffffcc8 = &local_1f8;
                                    in_stack_fffffffffffffcc0 = &DAT_14047ba08;
                                    in_stack_fffffffffffffca8 = local_2d8;
                                    (**(code **)(*plVar10 + 0xb0))
                                              (plVar10,1,&DAT_1405d85a0,local_2e8,
                                               in_stack_fffffffffffffca8,&local_2a8,&local_288,
                                               &DAT_14047ba08,in_stack_fffffffffffffcc8);
                                    lVar6 = local_308;
                                    lVar5 = local_2f0;
                                  }
                                }
                              }
                            }
                            else if (*(int *)(lVar6 + 0x1c) == 3) {
                              local_238 = (void *)0x0;
                              local_230 = 0;
                              local_228 = 0;
                              local_250 = local_1f8;
                              uStack_24c = uStack_1f4;
                              uStack_248 = uStack_1f0;
                              uStack_244 = uStack_1ec;
                              local_240 = local_1dc;
                              FUN_140055000(&local_238,&local_250);
                              FUN_1402031e0(*(undefined8 *)(param_3 + 0xb50),param_3,&local_1f8,
                                            L"Event",CONCAT44(uVar17,2));
                              puVar12 = (undefined8 *)(*plVar15 + 0xd0);
                              if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                                puVar12 = (undefined8 *)*puVar12;
                              }
                              local_298 = *(undefined4 *)(param_3 + 0x170);
                              local_294 = *(undefined4 *)(param_3 + 0x174);
                              local_290 = *(undefined4 *)(param_3 + 0x178);
                              local_28c = *(undefined4 *)(param_3 + 0x17c);
                              in_stack_fffffffffffffcc8 = (undefined4 *)CONCAT44(uVar19,2);
                              in_stack_fffffffffffffcc0 = (undefined *)CONCAT44(uVar18,10);
                              in_stack_fffffffffffffca8 = &local_298;
                              FUN_1401ff8e0(*(undefined8 *)(param_3 + 0xb50),
                                            *(undefined4 *)(param_3 + 0x288),
                                            *(undefined4 *)(param_3 + 0x284),
                                            *(undefined4 *)(param_3 + 8),in_stack_fffffffffffffca8,
                                            puVar12,&DAT_1404a92e0,in_stack_fffffffffffffcc0,
                                            in_stack_fffffffffffffcc8,&DAT_14047ba04,&local_1f8);
                              FUN_14011f210(local_138);
                              local_130 = *(undefined4 *)(param_3 + 0x160);
                              local_12c = *(undefined4 *)(param_3 + 0x164);
                              local_128 = *(undefined4 *)(param_3 + 0x168);
                              local_124 = *(undefined4 *)(param_3 + 0x16c);
                              local_120 = *(undefined4 *)(param_3 + 0x170);
                              local_11c = *(undefined4 *)(param_3 + 0x174);
                              local_118 = *(undefined4 *)(param_3 + 0x178);
                              local_114 = *(undefined4 *)(param_3 + 0x17c);
                              local_b0 = 0xe;
                              lVar8 = FUN_140174f00(&local_318);
                              local_ac = *(undefined4 *)(lVar8 + 0x50a0);
                              lVar8 = FUN_140174f00(&local_318);
                              local_a4 = *(undefined4 *)(lVar8 + 0x50a0);
                              _Src = (wchar_t *)(*plVar15 + 0xd0);
                              if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
                                _Src = *(wchar_t **)_Src;
                              }
                              wcscpy_s(local_110,0x10,_Src);
                              strcpy_s(local_a0,0x32,(char *)(param_3 + 0x330));
                              FUN_1401fe560(*(undefined8 *)(param_3 + 0xb50),
                                            *(undefined4 *)(param_3 + 0x288),
                                            *(undefined4 *)(param_3 + 0x284),local_138);
                              plVar10 = (longlong *)(*(longlong *)(param_3 + 0xb50) + 0x78);
                              (**(code **)(*plVar10 + 0x940))
                                        (plVar10,*(undefined4 *)(param_3 + 8),&DAT_1405d85a0);
                              if (local_238 != (void *)0x0) {
                                operator_delete(local_238);
                              }
                            }
                          }
                        }
                        piVar14 = piVar14 + 1;
                        local_2f0 = lVar5 + -1;
                      } while (local_2f0 != 0);
                    }
                  }
                  else if (iVar3 == 2) {
                    if ((ulonglong)(longlong)*(int *)(lVar6 + 0xc) <=
                        (ulonglong)(*(longlong *)(lVar5 + 0x60) - *(longlong *)(param_3 + 0x630))) {
                      *(longlong *)(param_3 + 0x630) =
                           (longlong)*(int *)(lVar6 + 0xc) + *(longlong *)(param_3 + 0x630);
                      goto LAB_1401e10c4;
                    }
                  }
                  else if (iVar3 == 3) {
                    if (iVar4 - *(int *)(param_3 + 0x628) == *(int *)(lVar6 + 0xc)) {
                      *(int *)(param_3 + 0x628) = *(int *)(lVar6 + 0xc) + *(int *)(param_3 + 0x628);
                      goto LAB_1401e10c4;
                    }
                  }
                  local_2e0 = local_2e0 + 1;
                  local_2b0 = local_2b0 + 1;
                  puVar9 = local_2b0;
                } while (local_2e0 < local_278);
              }
              if (local_270 != (undefined4 *)0x0) {
                operator_delete(local_270);
              }
              if (local_318 != (undefined8 *)0x0) {
                if (local_318 == local_310) {
                  LOCK();
                  piVar14 = (int *)(local_318 + 1);
                  iVar3 = *piVar14;
                  *piVar14 = *piVar14 + -1;
                  UNLOCK();
                  plVar15 = local_300;
                  if (iVar3 == 1) {
                    pvVar1 = (void *)*local_318;
                    if (pvVar1 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar1 + 0xf630);
                      operator_delete(pvVar1);
                    }
                    operator_delete(local_318);
                    plVar15 = local_300;
                  }
                }
                else {
                  iVar3 = DAT_140608050 + 1;
                  bVar16 = DAT_140608050 == 0;
                  DAT_140608050 = iVar3;
                  if (bVar16) {
                    FUN_140176d60(1);
                  }
                }
              }
              LOCK();
              plVar15 = plVar15 + 1;
              lVar6 = *plVar15;
              *(int *)plVar15 = (int)*plVar15 + -1;
              UNLOCK();
              if ((int)lVar6 == 1) {
                puVar12 = (undefined8 *)*local_300;
                if (puVar12 != (undefined8 *)0x0) {
                  (**(code **)*puVar12)(puVar12,1);
                }
                operator_delete(local_300);
              }
              FUN_14034edd0(local_2d0);
              return 1;
            }
            if (local_270 != (undefined4 *)0x0) {
              operator_delete(local_270);
            }
            if (local_318 != (undefined8 *)0x0) {
              if (local_318 == local_310) {
                LOCK();
                piVar14 = (int *)(local_318 + 1);
                iVar3 = *piVar14;
                *piVar14 = *piVar14 + -1;
                UNLOCK();
                plVar15 = local_300;
                if (iVar3 == 1) {
                  pvVar1 = (void *)*local_318;
                  if (pvVar1 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar1 + 0xf630);
                    operator_delete(pvVar1);
                  }
                  operator_delete(local_318);
                  plVar15 = local_300;
                }
              }
              else {
                iVar3 = DAT_140608050 + 1;
                bVar16 = DAT_140608050 == 0;
                DAT_140608050 = iVar3;
                if (bVar16) {
                  FUN_140176d60(1);
                }
              }
            }
            LOCK();
            plVar15 = plVar15 + 1;
            *(int *)plVar15 = (int)*plVar15 + -1;
            UNLOCK();
            lVar6 = local_2d0;
            if ((int)*plVar15 == 0) {
              puVar12 = (undefined8 *)*local_300;
              if (puVar12 != (undefined8 *)0x0) {
                (**(code **)*puVar12)(puVar12,1);
              }
              operator_delete(local_300);
              lVar6 = local_2d0;
            }
          }
          goto LAB_1401e17c0;
        }
      }
      else {
        iVar3 = DAT_14060804c + 1;
        bVar16 = DAT_14060804c == 0;
        DAT_14060804c = iVar3;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar15 != (longlong *)0x0) {
      if (plVar15 == local_2f8) {
        LOCK();
        plVar15 = plVar15 + 1;
        *(int *)plVar15 = (int)*plVar15 + -1;
        UNLOCK();
        lVar6 = local_2d0;
        if ((int)*plVar15 == 0) {
          puVar12 = (undefined8 *)*local_300;
          if (puVar12 != (undefined8 *)0x0) {
            (**(code **)*puVar12)(puVar12,1);
          }
          operator_delete(local_300);
          lVar6 = local_2d0;
        }
      }
      else {
        iVar3 = DAT_140608054 + 1;
        bVar16 = DAT_140608054 == 0;
        DAT_140608054 = iVar3;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
  }
LAB_1401e17c0:
  FUN_14034edd0(lVar6);
  return 0;
}



undefined8 FUN_1401e17f0(longlong param_1,undefined4 param_2,longlong param_3)

{
  void *pvVar1;
  int iVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined4 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  uint uVar10;
  undefined2 uVar11;
  wchar_t *_Src;
  undefined8 *puVar12;
  undefined2 uVar13;
  longlong lVar14;
  int *piVar15;
  longlong *plVar16;
  bool bVar17;
  undefined4 extraout_XMM0_Da;
  undefined2 local_res8 [4];
  undefined2 local_res20 [4];
  undefined4 *in_stack_fffffffffffffca8;
  undefined4 uVar18;
  undefined *in_stack_fffffffffffffcc0;
  undefined4 uVar19;
  undefined4 *in_stack_fffffffffffffcc8;
  undefined4 uVar20;
  longlong local_310;
  undefined2 local_308 [4];
  undefined8 *local_300;
  undefined8 *local_2f8;
  longlong *local_2f0;
  longlong *local_2e8;
  uint local_2e0;
  uint local_2dc;
  int local_2d8 [2];
  undefined4 local_2d0 [2];
  longlong local_2c8;
  undefined1 local_2c0;
  longlong local_2b8;
  undefined1 local_2b0;
  undefined4 *local_2a8;
  undefined4 local_2a0;
  undefined4 local_29c;
  undefined4 local_298;
  undefined4 local_294;
  undefined4 local_290;
  undefined4 local_28c;
  undefined4 local_288;
  undefined4 local_284;
  undefined4 local_280;
  undefined4 local_27c;
  undefined4 local_278;
  undefined4 local_274;
  ulonglong local_270;
  undefined4 *local_268;
  longlong local_260;
  undefined8 local_258;
  undefined4 local_248;
  undefined4 uStack_244;
  undefined4 uStack_240;
  undefined4 uStack_23c;
  undefined2 local_238;
  void *local_230;
  undefined8 local_228;
  undefined8 local_220;
  longlong local_210;
  undefined1 local_208;
  undefined8 local_200;
  undefined4 local_1f8;
  undefined4 uStack_1f4;
  undefined4 uStack_1f0;
  undefined4 uStack_1ec;
  undefined2 local_1e4;
  undefined2 local_1e2;
  int local_1e0;
  undefined2 local_1dc;
  undefined4 local_150;
  undefined1 local_148 [16];
  undefined1 local_138 [8];
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  wchar_t local_110 [48];
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a4;
  char local_a0 [104];
  
  local_200 = 0xfffffffffffffffe;
  lVar5 = param_1 + 0xf8;
  local_2b8 = lVar5;
  FUN_14034ed40(lVar5);
  local_2b0 = 1;
  local_210 = lVar5;
  FUN_14034ed40(lVar5);
  local_208 = 1;
  lVar4 = (**(code **)(*(longlong *)(param_1 + 0x38) + 0x10))((longlong *)(param_1 + 0x38),param_2);
  FUN_14034edd0(lVar5);
  if (((lVar4 != 0) && (*(char *)(lVar4 + 0xcc) == '\x01')) && (*(char *)(lVar4 + 6) == '\v')) {
    FUN_140198570(param_3,&local_2f0);
    plVar16 = local_2f0;
    if (local_2f0 != (longlong *)0x0) {
      if (local_2f0 == local_2e8) {
        if (*local_2f0 != 0) {
          FUN_140197b70(param_3,&local_300);
          lVar5 = FUN_140174f00(&local_300);
          if (lVar5 == 0) {
            if (local_300 != (undefined8 *)0x0) {
              if (local_300 == local_2f8) {
                LOCK();
                piVar15 = (int *)(local_300 + 1);
                iVar2 = *piVar15;
                *piVar15 = *piVar15 + -1;
                UNLOCK();
                plVar16 = local_2f0;
                if (iVar2 == 1) {
                  pvVar1 = (void *)*local_300;
                  if (pvVar1 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar1 + 0xf630);
                    operator_delete(pvVar1);
                  }
                  operator_delete(local_300);
                  plVar16 = local_2f0;
                }
              }
              else {
                iVar2 = DAT_140608050 + 1;
                bVar17 = DAT_140608050 == 0;
                DAT_140608050 = iVar2;
                if (bVar17) {
                  FUN_140176d60(1);
                }
              }
            }
            LOCK();
            plVar16 = plVar16 + 1;
            *(int *)plVar16 = (int)*plVar16 + -1;
            UNLOCK();
            lVar5 = local_2b8;
            if ((int)*plVar16 == 0) {
              puVar12 = (undefined8 *)*local_2f0;
              if (puVar12 != (undefined8 *)0x0) {
                (**(code **)*puVar12)(puVar12,1);
              }
              operator_delete(local_2f0);
              lVar5 = local_2b8;
            }
          }
          else {
            local_268 = (undefined4 *)0x0;
            local_260 = 0;
            local_258 = 0;
            uVar6 = FUN_14031c960();
            FUN_14031c8a0(uVar6,&local_268);
            local_270 = local_260 - (longlong)local_268 >> 2;
            if (local_270 != 0) {
              local_2dc = 0;
              puVar7 = local_268;
              if (local_270 != 0) {
                do {
                  uVar10 = local_2dc;
                  local_2a8 = puVar7;
                  uVar6 = FUN_14031c960();
                  lVar5 = FUN_14031c7a0(uVar6,*puVar7);
                  if (((lVar5 != 0) && (*(int *)(lVar5 + 8) == 1)) &&
                     (iVar2 = FUN_1402f8580(*plVar16), iVar2 == *(int *)(lVar5 + 0xc))) {
                    piVar15 = (int *)(lVar5 + 0x2c);
                    local_310 = 3;
                    do {
                      if ((0 < *piVar15) && (iVar2 = piVar15[-3], 0 < iVar2)) {
                        uVar6 = FUN_140137690();
                        lVar4 = FUN_140136770(uVar6,iVar2);
                        if (lVar4 != 0) {
                          FUN_14000a170(&local_1f8);
                          local_150 = 0;
                          puVar7 = (undefined4 *)FUN_140357570(local_148);
                          uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffcc0 >> 0x20);
                          uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffcc8 >> 0x20);
                          uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffca8 >> 0x20);
                          local_1f8 = *puVar7;
                          uStack_1f4 = puVar7[1];
                          uStack_1f0 = puVar7[2];
                          uStack_1ec = puVar7[3];
                          local_1e0 = piVar15[-3];
                          local_1dc = (undefined2)*piVar15;
                          if (*(int *)(lVar5 + 0x1c) == 1) {
                            iVar2 = *(int *)(lVar4 + 0xdc);
                            local_2e0 = 0xffffffff;
                            local_2d8[0] = iVar2;
                            uVar6 = FUN_140174f00(&local_300);
                            if ((-1 < iVar2) &&
                               (iVar3 = FUN_1401ed430(uVar6,local_2d8,&local_2e0),
                               uVar10 = local_2e0, iVar3 != 0)) {
                              uVar11 = (undefined2)iVar2;
                              lVar14 = (longlong)(int)local_2e0;
                              uVar13 = (undefined2)local_2e0;
                              local_1e4 = uVar11;
                              local_1e2 = uVar13;
                              lVar8 = FUN_140174f00(&local_300);
                              lVar4 = lVar8 + 0xf630;
                              local_2c8 = lVar4;
                              FUN_14034ed40(lVar4);
                              local_2c0 = 1;
                              if ((iVar2 < 5) && (uVar10 < 0x18)) {
                                uVar6 = FUN_140137690();
                                iVar3 = FUN_140136b30(uVar6,local_1e0);
                                if ((iVar2 == iVar3) &&
                                   (iVar2 = FUN_14011b180((lVar14 + (longlong)iVar2 * 0x18) * 0xac +
                                                          lVar8), iVar2 != 0)) {
                                  local_1e4 = uVar11;
                                  local_1e2 = uVar13;
                                  FUN_140090020(extraout_XMM0_Da,&local_1f8);
                                }
                              }
                              FUN_14034edd0(lVar4);
                              local_2c0 = 0;
                              plVar9 = (longlong *)(*(longlong *)(param_3 + 0xb50) + 0x78);
                              in_stack_fffffffffffffca8 = (undefined4 *)local_res8;
                              local_res8[0] = uVar13;
                              local_res20[0] = uVar11;
                              (**(code **)(*plVar9 + 0xe0))
                                        (plVar9,*(undefined4 *)(param_3 + 8),&DAT_1405d85a0,
                                         local_res20,in_stack_fffffffffffffca8,&local_1f8);
                              local_2a0 = *(undefined4 *)(param_3 + 0x160);
                              local_29c = *(undefined4 *)(param_3 + 0x164);
                              local_298 = *(undefined4 *)(param_3 + 0x168);
                              local_294 = *(undefined4 *)(param_3 + 0x16c);
                              local_290 = *(undefined4 *)(param_3 + 0x170);
                              local_28c = *(undefined4 *)(param_3 + 0x174);
                              local_288 = *(undefined4 *)(param_3 + 0x178);
                              local_284 = *(undefined4 *)(param_3 + 0x17c);
                              iVar2 = *(int *)(param_3 + 0x284);
                              local_2d0[0] = *(undefined4 *)(param_3 + 8);
                              if ((-1 < iVar2) &&
                                 (iVar2 < *(short *)(*(longlong *)(param_3 + 0xb50) + 700))) {
                                if ((CONCAT44(uStack_1f4,local_1f8) == 0) &&
                                   (CONCAT44(uStack_1ec,uStack_1f0) == 0)) {
                                  bVar17 = false;
                                }
                                else {
                                  bVar17 = true;
                                }
                                if (((bVar17) && (local_1e0 != 0)) &&
                                   (lVar4 = *(longlong *)(*(longlong *)(param_3 + 0xb50) + 0x4c0),
                                   lVar4 != 0)) {
                                  local_308[0] = (undefined2)iVar2;
                                  plVar9 = (longlong *)
                                           (*(longlong *)
                                             (*(longlong *)(lVar4 + 8) +
                                             (longlong)*(int *)(param_3 + 0x288) * 8) + 0x70);
                                  in_stack_fffffffffffffcc8 = &local_1f8;
                                  in_stack_fffffffffffffcc0 = &DAT_14047ba08;
                                  in_stack_fffffffffffffca8 = local_2d0;
                                  (**(code **)(*plVar9 + 0xb0))
                                            (plVar9,1,&DAT_1405d85a0,local_308,
                                             in_stack_fffffffffffffca8,&local_290,&local_2a0,
                                             &DAT_14047ba08,in_stack_fffffffffffffcc8);
                                }
                              }
                            }
                          }
                          else if (*(int *)(lVar5 + 0x1c) == 3) {
                            local_230 = (void *)0x0;
                            local_228 = 0;
                            local_220 = 0;
                            local_248 = local_1f8;
                            uStack_244 = uStack_1f4;
                            uStack_240 = uStack_1f0;
                            uStack_23c = uStack_1ec;
                            local_238 = local_1dc;
                            FUN_140055000(&local_230,&local_248);
                            FUN_1402031e0(*(undefined8 *)(param_3 + 0xb50),param_3,&local_1f8,
                                          L"Event",CONCAT44(uVar18,2));
                            puVar12 = (undefined8 *)(*plVar16 + 0xd0);
                            if (7 < *(ulonglong *)(*plVar16 + 0xe8)) {
                              puVar12 = (undefined8 *)*puVar12;
                            }
                            local_280 = *(undefined4 *)(param_3 + 0x170);
                            local_27c = *(undefined4 *)(param_3 + 0x174);
                            local_278 = *(undefined4 *)(param_3 + 0x178);
                            local_274 = *(undefined4 *)(param_3 + 0x17c);
                            in_stack_fffffffffffffcc8 = (undefined4 *)CONCAT44(uVar20,2);
                            in_stack_fffffffffffffcc0 = (undefined *)CONCAT44(uVar19,10);
                            in_stack_fffffffffffffca8 = &local_280;
                            FUN_1401ff8e0(*(undefined8 *)(param_3 + 0xb50),
                                          *(undefined4 *)(param_3 + 0x288),
                                          *(undefined4 *)(param_3 + 0x284),
                                          *(undefined4 *)(param_3 + 8),in_stack_fffffffffffffca8,
                                          puVar12,&DAT_1404a92e0,in_stack_fffffffffffffcc0,
                                          in_stack_fffffffffffffcc8,&DAT_14047ba04,&local_1f8);
                            FUN_14011f210(local_138);
                            local_130 = *(undefined4 *)(param_3 + 0x160);
                            local_12c = *(undefined4 *)(param_3 + 0x164);
                            local_128 = *(undefined4 *)(param_3 + 0x168);
                            local_124 = *(undefined4 *)(param_3 + 0x16c);
                            local_120 = *(undefined4 *)(param_3 + 0x170);
                            local_11c = *(undefined4 *)(param_3 + 0x174);
                            local_118 = *(undefined4 *)(param_3 + 0x178);
                            local_114 = *(undefined4 *)(param_3 + 0x17c);
                            local_b0 = 0xe;
                            lVar4 = FUN_140174f00(&local_300);
                            local_ac = *(undefined4 *)(lVar4 + 0x50a0);
                            lVar4 = FUN_140174f00(&local_300);
                            local_a4 = *(undefined4 *)(lVar4 + 0x50a0);
                            _Src = (wchar_t *)(*plVar16 + 0xd0);
                            if (7 < *(ulonglong *)(*plVar16 + 0xe8)) {
                              _Src = *(wchar_t **)_Src;
                            }
                            wcscpy_s(local_110,0x10,_Src);
                            strcpy_s(local_a0,0x32,(char *)(param_3 + 0x330));
                            FUN_1401fe560(*(undefined8 *)(param_3 + 0xb50),
                                          *(undefined4 *)(param_3 + 0x288),
                                          *(undefined4 *)(param_3 + 0x284),local_138);
                            plVar9 = (longlong *)(*(longlong *)(param_3 + 0xb50) + 0x78);
                            (**(code **)(*plVar9 + 0x940))
                                      (plVar9,*(undefined4 *)(param_3 + 8),&DAT_1405d85a0);
                            if (local_230 != (void *)0x0) {
                              operator_delete(local_230);
                            }
                          }
                        }
                      }
                      piVar15 = piVar15 + 1;
                      local_310 = local_310 + -1;
                      uVar10 = local_2dc;
                    } while (local_310 != 0);
                  }
                  local_2dc = uVar10 + 1;
                  local_2a8 = local_2a8 + 1;
                  puVar7 = local_2a8;
                } while (local_2dc < local_270);
              }
              if (local_268 != (undefined4 *)0x0) {
                operator_delete(local_268);
              }
              if (local_300 != (undefined8 *)0x0) {
                if (local_300 == local_2f8) {
                  LOCK();
                  piVar15 = (int *)(local_300 + 1);
                  iVar2 = *piVar15;
                  *piVar15 = *piVar15 + -1;
                  UNLOCK();
                  plVar16 = local_2f0;
                  if (iVar2 == 1) {
                    pvVar1 = (void *)*local_300;
                    if (pvVar1 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar1 + 0xf630);
                      operator_delete(pvVar1);
                    }
                    operator_delete(local_300);
                    plVar16 = local_2f0;
                  }
                }
                else {
                  iVar2 = DAT_140608050 + 1;
                  bVar17 = DAT_140608050 == 0;
                  DAT_140608050 = iVar2;
                  if (bVar17) {
                    FUN_140176d60(1);
                  }
                }
              }
              LOCK();
              plVar16 = plVar16 + 1;
              lVar5 = *plVar16;
              *(int *)plVar16 = (int)*plVar16 + -1;
              UNLOCK();
              if ((int)lVar5 == 1) {
                puVar12 = (undefined8 *)*local_2f0;
                if (puVar12 != (undefined8 *)0x0) {
                  (**(code **)*puVar12)(puVar12,1);
                }
                operator_delete(local_2f0);
              }
              FUN_14034edd0(local_2b8);
              return 1;
            }
            if (local_268 != (undefined4 *)0x0) {
              operator_delete(local_268);
            }
            if (local_300 != (undefined8 *)0x0) {
              if (local_300 == local_2f8) {
                LOCK();
                piVar15 = (int *)(local_300 + 1);
                iVar2 = *piVar15;
                *piVar15 = *piVar15 + -1;
                UNLOCK();
                plVar16 = local_2f0;
                if (iVar2 == 1) {
                  pvVar1 = (void *)*local_300;
                  if (pvVar1 != (void *)0x0) {
                    FUN_14034edf0((longlong)pvVar1 + 0xf630);
                    operator_delete(pvVar1);
                  }
                  operator_delete(local_300);
                  plVar16 = local_2f0;
                }
              }
              else {
                iVar2 = DAT_140608050 + 1;
                bVar17 = DAT_140608050 == 0;
                DAT_140608050 = iVar2;
                if (bVar17) {
                  FUN_140176d60(1);
                }
              }
            }
            LOCK();
            plVar16 = plVar16 + 1;
            *(int *)plVar16 = (int)*plVar16 + -1;
            UNLOCK();
            lVar5 = local_2b8;
            if ((int)*plVar16 == 0) {
              puVar12 = (undefined8 *)*local_2f0;
              if (puVar12 != (undefined8 *)0x0) {
                (**(code **)*puVar12)(puVar12,1);
              }
              operator_delete(local_2f0);
              lVar5 = local_2b8;
            }
          }
          goto LAB_1401e2106;
        }
      }
      else {
        iVar2 = DAT_14060804c + 1;
        bVar17 = DAT_14060804c == 0;
        DAT_14060804c = iVar2;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar16 != (longlong *)0x0) {
      if (plVar16 == local_2e8) {
        LOCK();
        plVar16 = plVar16 + 1;
        *(int *)plVar16 = (int)*plVar16 + -1;
        UNLOCK();
        lVar5 = local_2b8;
        if ((int)*plVar16 == 0) {
          puVar12 = (undefined8 *)*local_2f0;
          if (puVar12 != (undefined8 *)0x0) {
            (**(code **)*puVar12)(puVar12,1);
          }
          operator_delete(local_2f0);
          lVar5 = local_2b8;
        }
      }
      else {
        iVar2 = DAT_140608054 + 1;
        bVar17 = DAT_140608054 == 0;
        DAT_140608054 = iVar2;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
  }
LAB_1401e2106:
  FUN_14034edd0(lVar5);
  return 0;
}



void FUN_1401e2130(wchar_t *param_1)

{
  wchar_t wVar1;
  int iVar2;
  ulonglong uVar3;
  wchar_t *pwVar4;
  wchar_t local_res10 [4];
  wchar_t local_res18 [4];
  wchar_t local_res20 [4];
  wchar_t local_68 [4];
  wchar_t local_60 [4];
  wchar_t local_58 [8];
  tm local_48;
  
  local_58[0] = L'\0';
  local_res10[0] = L'\0';
  local_res18[0] = L'\0';
  local_res20[0] = L'\0';
  local_68[0] = L'\0';
  local_60[0] = L'\0';
  uVar3 = 0xffffffffffffffff;
  local_58[1] = L'\0';
  local_58[2] = L'\0';
  local_58[3] = L'\0';
  local_58[4] = L'\0';
  pwVar4 = param_1;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    wVar1 = *pwVar4;
    pwVar4 = pwVar4 + 1;
  } while (wVar1 != L'\0');
  local_res10[1] = L'\0';
  local_res10[2] = L'\0';
  local_res18[1] = L'\0';
  local_res18[2] = L'\0';
  local_res20[1] = L'\0';
  local_res20[2] = L'\0';
  local_68[1] = L'\0';
  local_68[2] = L'\0';
  local_60[1] = L'\0';
  local_60[2] = L'\0';
  if (0x11 < ~uVar3 - 1) {
    wcsncpy_s(local_58,5,param_1,4);
    wcsncpy_s(local_res10,3,param_1 + 5,2);
    wcsncpy_s(local_res18,3,param_1 + 8,2);
    wcsncpy_s(local_res20,3,param_1 + 0xb,2);
    wcsncpy_s(local_68,3,param_1 + 0xe,2);
    wcsncpy_s(local_60,3,param_1 + 0x11,2);
    local_48.tm_sec = 0;
    local_48.tm_min = 0;
    local_48.tm_hour = 0;
    local_48.tm_mday = 0;
    local_48.tm_mon = 0;
    local_48.tm_year = 0;
    local_48.tm_wday = 0;
    local_48.tm_yday = 0;
    local_48.tm_isdst = 0;
    iVar2 = _wtoi(local_58);
    local_48.tm_year = iVar2 + -0x76c;
    iVar2 = _wtoi(local_res10);
    local_48.tm_mon = iVar2 + -1;
    iVar2 = _wtoi(local_res18);
    local_48.tm_mday = iVar2;
    local_48.tm_hour = _wtoi(local_res20);
    iVar2 = _wtoi(local_68);
    local_48.tm_min = iVar2;
    local_48.tm_sec = _wtoi(local_60);
    _mktime64(&local_48);
  }
  return;
}



void FUN_1401e2290(ushort *param_1)

{
  tm local_138;
  wchar_t local_108;
  undefined1 local_106 [254];
  
  local_108 = L'\0';
  memset(local_106,0,0xfe);
  if (param_1 != (ushort *)0x0) {
    local_138.tm_wday = 0;
    local_138.tm_yday = 0;
    local_138.tm_isdst = 0;
    local_138.tm_year = *param_1 - 0x76c;
    local_138.tm_mon = param_1[1] - 1;
    local_138.tm_mday._0_2_ = param_1[3];
    local_138.tm_hour = (uint)param_1[4];
    local_138.tm_mday._2_2_ = 0;
    local_138.tm_min._0_2_ = param_1[5];
    local_138.tm_sec = (uint)param_1[6];
    local_138.tm_min._2_2_ = 0;
    wcsftime(&local_108,0x80,L"%Y/%m/%d %H:%M:%S",&local_138);
  }
  FUN_1401e2130(&local_108);
  return;
}



int FUN_1401e2340(longlong param_1,int param_2)

{
  LPSYSTEMTIME lpSystemTime;
  int iVar1;
  void *pvVar2;
  longlong lVar3;
  
  GetLocalTime((LPSYSTEMTIME)(param_1 + 200));
  lVar3 = DAT_140607cc0;
  if (DAT_140607cc0 == 0) {
    pvVar2 = operator_new(0x130);
    lVar3 = 0;
    if (pvVar2 != (void *)0x0) {
      lVar3 = FUN_1401e04e0(pvVar2);
    }
  }
  DAT_140607cc0 = lVar3;
  lpSystemTime = (LPSYSTEMTIME)(DAT_140607cc0 + 200);
  GetLocalTime(lpSystemTime);
  iVar1 = FUN_1401e2290(lpSystemTime);
  return iVar1 + param_2 * 0x3c;
}



undefined8 * FUN_1401e23c0(undefined8 *param_1,ulonglong param_2)

{
  undefined1 local_res18 [8];
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  *param_1 = CMap<>::vftable;
  FUN_1401e28e0(param_1 + 1);
  FUN_1401e27c0(param_1 + 1,local_res18,*(undefined8 *)param_1[2],(undefined8 *)param_1[2],uVar1);
  operator_delete((void *)param_1[2]);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



longlong FUN_1401e2450(longlong param_1,int *param_2)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  longlong lVar5;
  undefined8 *puVar6;
  
  puVar3 = *(undefined8 **)(param_1 + 8);
  puVar6 = puVar3;
  if (*(char *)((longlong)puVar3[1] + 0x29) == '\0') {
    puVar2 = puVar3;
    puVar4 = (undefined8 *)puVar3[1];
    do {
      puVar3 = puVar4;
      if (*(int *)(puVar3 + 3) < *param_2) {
        puVar4 = (undefined8 *)puVar3[2];
        puVar3 = puVar2;
      }
      else {
        if ((*(char *)((longlong)puVar6 + 0x29) != '\0') && (*param_2 < *(int *)(puVar3 + 3))) {
          puVar6 = puVar3;
        }
        puVar4 = (undefined8 *)*puVar3;
      }
      puVar2 = puVar3;
    } while (*(char *)((longlong)puVar4 + 0x29) == '\0');
  }
  if (*(char *)((longlong)puVar6 + 0x29) == '\0') {
    puVar4 = (undefined8 *)*puVar6;
  }
  else {
    puVar4 = *(undefined8 **)(*(longlong *)(param_1 + 8) + 8);
  }
  if (*(char *)((longlong)puVar4 + 0x29) == '\0') {
    do {
      if (*param_2 < *(int *)(puVar4 + 3)) {
        puVar2 = (undefined8 *)*puVar4;
        puVar6 = puVar4;
      }
      else {
        puVar2 = (undefined8 *)puVar4[2];
      }
      puVar4 = puVar2;
    } while (*(char *)((longlong)puVar2 + 0x29) == '\0');
  }
  lVar5 = 0;
  while (puVar3 != puVar6) {
    lVar5 = lVar5 + 1;
    if (*(char *)((longlong)puVar3 + 0x29) == '\0') {
      puVar4 = (undefined8 *)puVar3[2];
      if (*(char *)((longlong)puVar4 + 0x29) == '\0') {
        cVar1 = *(char *)((longlong)*puVar4 + 0x29);
        puVar3 = puVar4;
        puVar4 = (undefined8 *)*puVar4;
        while (cVar1 == '\0') {
          cVar1 = *(char *)((longlong)*puVar4 + 0x29);
          puVar3 = puVar4;
          puVar4 = (undefined8 *)*puVar4;
        }
      }
      else {
        cVar1 = *(char *)((longlong)puVar3[1] + 0x29);
        puVar2 = (undefined8 *)puVar3[1];
        puVar4 = puVar3;
        while ((puVar3 = puVar2, cVar1 == '\0' && (puVar4 == (undefined8 *)puVar3[2]))) {
          cVar1 = *(char *)((longlong)puVar3[1] + 0x29);
          puVar2 = (undefined8 *)puVar3[1];
          puVar4 = puVar3;
        }
      }
    }
  }
  return lVar5;
}



void FUN_1401e2530(longlong param_1,undefined4 param_2)

{
  undefined4 local_res10 [6];
  
  local_res10[0] = param_2;
  FUN_1401e2450(param_1 + 8,local_res10);
  return;
}



undefined8 FUN_1401e2550(longlong param_1,int param_2)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 **ppuVar3;
  undefined8 *puVar4;
  undefined8 *local_res8 [2];
  undefined8 *local_res18 [2];
  
  puVar4 = (undefined8 *)(*(undefined8 **)(param_1 + 0x10))[1];
  cVar1 = *(char *)((longlong)puVar4 + 0x29);
  local_res8[0] = *(undefined8 **)(param_1 + 0x10);
  while (cVar1 == '\0') {
    if (*(int *)(puVar4 + 3) < param_2) {
      puVar2 = (undefined8 *)puVar4[2];
      puVar4 = local_res8[0];
    }
    else {
      puVar2 = (undefined8 *)*puVar4;
    }
    local_res8[0] = puVar4;
    puVar4 = puVar2;
    cVar1 = *(char *)((longlong)puVar2 + 0x29);
  }
  if ((local_res8[0] == *(undefined8 **)(param_1 + 0x10)) || (param_2 < *(int *)(local_res8[0] + 3))
     ) {
    local_res18[0] = *(undefined8 **)(param_1 + 0x10);
    ppuVar3 = local_res18;
  }
  else {
    ppuVar3 = local_res8;
  }
  if (*ppuVar3 != *(undefined8 **)(param_1 + 0x10)) {
    return (*ppuVar3)[4];
  }
  return 0;
}



void FUN_1401e25b0(longlong param_1)

{
  undefined8 uVar1;
  undefined8 *puVar2;
  char *local_res10 [3];
  undefined **local_28 [4];
  
  puVar2 = operator_new(0x30);
  if (puVar2 != (undefined8 *)0x0) {
    *puVar2 = *(undefined8 *)(param_1 + 8);
    puVar2[1] = *(undefined8 *)(param_1 + 8);
    uVar1 = *(undefined8 *)(param_1 + 8);
    *(undefined2 *)(puVar2 + 5) = 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_1405d3608);
}



void FUN_1401e2630(undefined8 param_1,undefined4 *param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_1401e25b0();
  if ((undefined4 *)(lVar1 + 0x18) != (undefined4 *)0x0) {
    *(undefined4 *)(lVar1 + 0x18) = *param_2;
    *(undefined8 *)(lVar1 + 0x20) = *(undefined8 *)(param_2 + 2);
  }
  return;
}



ulonglong FUN_1401e2670(longlong param_1,undefined4 param_2,ulonglong param_3)

{
  undefined8 uVar1;
  undefined4 local_18 [2];
  ulonglong local_10;
  
  local_18[0] = param_2;
  local_10 = param_3;
  uVar1 = FUN_1401e2630(param_1 + 8,local_18);
  FUN_1401df5d0(param_1 + 8,local_18,uVar1);
  return local_10 & 0xff;
}



undefined8 FUN_1401e26b0(longlong param_1,undefined8 param_2)

{
  FUN_140175db0(param_1 + 8);
  return param_2;
}



undefined8 FUN_1401e26d0(longlong param_1,int param_2)

{
  char cVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 **ppuVar5;
  undefined8 *local_res8 [2];
  undefined8 *local_res18 [2];
  
  puVar4 = (undefined8 *)(*(undefined8 **)(param_1 + 0x10))[1];
  cVar1 = *(char *)((longlong)puVar4 + 0x29);
  local_res8[0] = *(undefined8 **)(param_1 + 0x10);
  while (cVar1 == '\0') {
    if (*(int *)(puVar4 + 3) < param_2) {
      puVar3 = (undefined8 *)puVar4[2];
      puVar4 = local_res8[0];
    }
    else {
      puVar3 = (undefined8 *)*puVar4;
    }
    local_res8[0] = puVar4;
    puVar4 = puVar3;
    cVar1 = *(char *)((longlong)puVar3 + 0x29);
  }
  if ((local_res8[0] == *(undefined8 **)(param_1 + 0x10)) || (param_2 < *(int *)(local_res8[0] + 3))
     ) {
    local_res18[0] = *(undefined8 **)(param_1 + 0x10);
    ppuVar5 = local_res18;
  }
  else {
    ppuVar5 = local_res8;
  }
  if (*ppuVar5 != *(undefined8 **)(param_1 + 0x10)) {
    uVar2 = (*ppuVar5)[4];
    FUN_140175db0(param_1 + 8,local_res8);
    return uVar2;
  }
  return 0;
}



void FUN_1401e2760(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  
  plVar1 = *(longlong **)(param_2 + 0x10);
  *(longlong *)(param_2 + 0x10) = *plVar1;
  if (*(char *)(*plVar1 + 0x29) == '\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;
}



undefined8 * FUN_1401e27c0(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_1401e28e0();
    *param_2 = **(undefined8 **)(param_1 + 8);
    return param_2;
  }
  while (param_3 != param_4) {
    local_res18 = param_3;
    if (*(char *)((longlong)param_3 + 0x29) == '\0') {
      local_res18 = (longlong *)param_3[2];
      if (*(char *)((longlong)local_res18 + 0x29) == '\0') {
        cVar1 = *(char *)(*local_res18 + 0x29);
        plVar2 = (longlong *)*local_res18;
        while (cVar1 == '\0') {
          cVar1 = *(char *)(*plVar2 + 0x29);
          local_res18 = plVar2;
          plVar2 = (longlong *)*plVar2;
        }
      }
      else {
        cVar1 = *(char *)(param_3[1] + 0x29);
        plVar3 = (longlong *)param_3[1];
        plVar2 = param_3;
        while ((local_res18 = plVar3, cVar1 == '\0' && (plVar2 == (longlong *)local_res18[2]))) {
          cVar1 = *(char *)(local_res18[1] + 0x29);
          plVar3 = (longlong *)local_res18[1];
          plVar2 = local_res18;
        }
      }
    }
    FUN_140175db0(param_1,local_res8,param_3);
    param_3 = local_res18;
  }
  *param_2 = param_3;
  return param_2;
}



void FUN_1401e28a0(longlong param_1)

{
  undefined1 local_res10 [24];
  
  FUN_1401e27c0(param_1,local_res10,**(undefined8 **)(param_1 + 8),*(undefined8 **)(param_1 + 8),
                0xfffffffffffffffe);
                    // WARNING: Could not recover jumptable at 0x0001401e28d4. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_1 + 8));
  return;
}



void FUN_1401e28e0(longlong param_1)

{
  char cVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  plVar2 = *(longlong **)(*(longlong *)(param_1 + 8) + 8);
  cVar1 = *(char *)((longlong)plVar2 + 0x29);
  while (cVar1 == '\0') {
    FUN_14012f260(param_1,plVar2[2]);
    plVar3 = (longlong *)*plVar2;
    operator_delete(plVar2);
    plVar2 = plVar3;
    cVar1 = *(char *)((longlong)plVar3 + 0x29);
  }
  *(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;
}



void FUN_1401e2960(undefined8 *param_1)

{
  undefined1 local_res10 [24];
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  *param_1 = CMap<>::vftable;
  FUN_1401e28e0(param_1 + 1);
  FUN_1401e27c0(param_1 + 1,local_res10,*(undefined8 *)param_1[2],(undefined8 *)param_1[2],uVar1);
                    // WARNING: Could not recover jumptable at 0x0001401e29b0. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete((void *)param_1[2]);
  return;
}



undefined8 * FUN_1401e29c0(undefined8 *param_1,uint param_2)

{
  *param_1 = CPool<>::vftable;
  FUN_1401e2a00();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1401e2a00(undefined8 *param_1)

{
  ulonglong uVar1;
  undefined8 *puVar2;
  longlong lVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  undefined8 *local_38;
  longlong lStack_30;
  
  if (param_1[1] != 0) {
    uVar1 = param_1[3];
    puVar8 = (undefined8 *)*param_1;
    uVar4 = uVar1;
    uVar6 = 8;
    do {
      uVar5 = uVar6;
      uVar6 = uVar4 % uVar5;
      uVar4 = uVar5;
    } while (uVar6 != 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 (puVar7 = local_38; puVar7 != (undefined8 *)(lStack_30 + -0x10 + (longlong)local_38);
          puVar7 = puVar7 + uVar1 / uVar5) {
        if (puVar7 == puVar8) {
          puVar8 = (undefined8 *)*puVar8;
        }
      }
      operator_delete__(local_38);
      local_38 = puVar2;
      lStack_30 = lVar3;
    } while (puVar2 != (undefined8 *)0x0);
    param_1[1] = 0;
  }
  FUN_14012e360(param_1);
  return;
}



void FUN_1401e2af0(undefined8 *param_1)

{
  *param_1 = CPool<>::vftable;
  FUN_1401e2a00();
  return;
}



// WARNING: Removing unreachable block (ram,0x0001401e2b8b)
// WARNING: Removing unreachable block (ram,0x0001401e2b94)
// WARNING: Removing unreachable block (ram,0x0001401e2bb2)
// WARNING: Removing unreachable block (ram,0x0001401e2bbb)

undefined8 *
FUN_1401e2b10(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *param_1 = MGSItemManager::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;
  *(undefined4 *)(param_1 + 0x15) = 0x11;
  *(undefined4 *)(param_1 + 0x19) = 0;
  *(undefined4 *)((longlong)param_1 + 0xcc) = 10;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x16) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xb4) = 0x40100000;
  param_1[0x17] = 0x26;
  param_1[0x18] = 0;
  param_1[0x1c] = 0;
  param_1[0x1d] = 0;
  *(undefined4 *)(param_1 + 0x1e) = 0x11;
  *(undefined4 *)(param_1 + 0x22) = 0;
  *(undefined4 *)((longlong)param_1 + 0x114) = 10;
  param_1[0x23] = 0;
  param_1[0x24] = 0;
  *(undefined4 *)((longlong)param_1 + 0xf4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x1f) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xfc) = 0x40100000;
  param_1[0x20] = 0x26;
  param_1[0x21] = 0;
  param_1[0x25] = 0;
  param_1[0x26] = 0;
  *(undefined4 *)(param_1 + 0x27) = 0x11;
  *(undefined4 *)(param_1 + 0x2b) = 0;
  *(undefined4 *)((longlong)param_1 + 0x15c) = 10;
  param_1[0x2c] = 0;
  param_1[0x2d] = 0;
  *(undefined4 *)((longlong)param_1 + 0x13c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x28) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x144) = 0x40100000;
  param_1[0x29] = 0x26;
  param_1[0x2a] = 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;
  *(undefined4 *)(param_1 + 0x39) = 0x11;
  *(undefined4 *)(param_1 + 0x3d) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1ec) = 10;
  param_1[0x3e] = 0;
  param_1[0x3f] = 0;
  *(undefined4 *)((longlong)param_1 + 0x1cc) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x3a) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1d4) = 0x40100000;
  param_1[0x3b] = 0x26;
  param_1[0x3c] = 0;
  param_1[0x40] = 0;
  param_1[0x41] = 0;
  *(undefined4 *)(param_1 + 0x42) = 0x11;
  *(undefined4 *)(param_1 + 0x46) = 0;
  *(undefined4 *)((longlong)param_1 + 0x234) = 10;
  param_1[0x47] = 0;
  param_1[0x48] = 0;
  *(undefined4 *)((longlong)param_1 + 0x214) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x43) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x21c) = 0x40100000;
  param_1[0x44] = 0x26;
  param_1[0x45] = 0;
  param_1[0x49] = 0;
  param_1[0x4a] = 0;
  *(undefined4 *)(param_1 + 0x4b) = 0x11;
  *(undefined4 *)(param_1 + 0x4f) = 0;
  *(undefined4 *)((longlong)param_1 + 0x27c) = 10;
  param_1[0x50] = 0;
  param_1[0x51] = 0;
  *(undefined4 *)((longlong)param_1 + 0x25c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x4c) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x264) = 0x40100000;
  param_1[0x4d] = 0x26;
  param_1[0x4e] = 0;
  param_1[0x52] = 0;
  param_1[0x53] = 0;
  *(undefined4 *)(param_1 + 0x54) = 0x11;
  *(undefined4 *)(param_1 + 0x58) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2c4) = 10;
  param_1[0x59] = 0;
  param_1[0x5a] = 0;
  *(undefined4 *)((longlong)param_1 + 0x2a4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x55) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x2ac) = 0x40100000;
  param_1[0x56] = 0x26;
  param_1[0x57] = 0;
  param_1[0x5b] = 0;
  param_1[0x5c] = 0;
  param_1[0x5d] = 0;
  param_1[0x5e] = 0;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x60,uVar1,1,param_4,uVar2);
  return param_1;
}



void * FUN_1401e2fb0(void *param_1,uint param_2)

{
  FUN_1401e3000();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void thunk_FUN_1401e4f20(void)

{
  FUN_1401e4f20();
  return;
}



void thunk_FUN_1401e50e0(void)

{
  FUN_1401e50e0();
  return;
}



void FUN_1401e3000(undefined8 *param_1)

{
  *param_1 = MGSItemManager::vftable;
  FUN_14034edf0(param_1 + 0x60);
  FUN_1401e50e0(param_1 + 0x52);
  FUN_1401e50e0(param_1 + 0x49);
  FUN_1401e50e0(param_1 + 0x40);
  FUN_1401e4f20(param_1 + 0x37);
  FUN_1401e4f20(param_1 + 0x2e);
  FUN_1401e4f20(param_1 + 0x25);
  FUN_1401e4f20(param_1 + 0x1c);
  FUN_1401e4d60(param_1 + 0x13);
  FUN_1401e4c50(param_1 + 10);
  FUN_1401e4c30(param_1 + 1);
  return;
}



void FUN_1401e30b0(undefined8 param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"CHAMPION_ITEM_DROP_GROUP_LIST");
  FUN_140294650(uVar1,L"CHAMPION_ITEM_DROP_GROUP_LIST");
  FUN_140292e80(uVar1,L"CHAMPION_ITEM_DROP_GROUP_LIST",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"QUEST_ITEM_DROP_GROUP_LIST");
  FUN_140294650(uVar1,L"QUEST_ITEM_DROP_GROUP_LIST");
  FUN_140292e80(uVar1,L"QUEST_ITEM_DROP_GROUP_LIST",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"WORLD_ITEM_DROP_GROUP_LIST");
  FUN_140294650(uVar1,L"WORLD_ITEM_DROP_GROUP_LIST");
  FUN_140292e80(uVar1,L"WORLD_ITEM_DROP_GROUP_LIST",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"RARE_CARD_DROP_GROUP_LIST");
  FUN_140294650(uVar1,L"RARE_CARD_DROP_GROUP_LIST");
  FUN_140292e80(uVar1,L"RARE_CARD_DROP_GROUP_LIST",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"RARE_CARD_REWARD_ITEM_LIST");
  FUN_140294650(uVar1,L"RARE_CARD_REWARD_ITEM_LIST");
  FUN_140292e80(uVar1,L"RARE_CARD_REWARD_ITEM_LIST",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"INSTANCE_ITEM_DROP_GROUP_LIST");
  FUN_140294650(uVar1,L"INSTANCE_ITEM_DROP_GROUP_LIST");
  FUN_140292e80(uVar1,L"INSTANCE_ITEM_DROP_GROUP_LIST",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"WORLD_INSTANCE_ITEM_DROP_GROUP_LIST");
  FUN_140294650(uVar1,L"WORLD_INSTANCE_ITEM_DROP_GROUP_LIST");
  FUN_140292e80(uVar1,L"WORLD_INSTANCE_ITEM_DROP_GROUP_LIST",uVar2);
  FUN_1401e3460(param_1);
  return;
}



void FUN_1401e3270(longlong param_1,undefined8 param_2)

{
  undefined4 uVar1;
  undefined *puVar2;
  uint uVar3;
  undefined4 uVar4;
  ulonglong uVar5;
  float *pfVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  undefined **ppuVar11;
  float *pfVar12;
  undefined1 local_224 [252];
  float local_128 [30];
  float local_b0 [34];
  
  FUN_1401e4e50(param_2);
  if (param_1 != 0) {
    if (*(longlong *)(param_1 + 0x70) != 0) {
      uVar5 = 0;
      if (*(uint *)(param_1 + 0x78) != 0) {
        plVar8 = *(longlong **)(param_1 + 0x68);
        do {
          if (*plVar8 != 0) {
            puVar10 = (undefined4 *)(*(longlong **)(param_1 + 0x68))[uVar5];
            goto LAB_1401e32ff;
          }
          uVar3 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar3;
          plVar8 = plVar8 + 1;
        } while (uVar3 < *(uint *)(param_1 + 0x78));
      }
    }
    puVar10 = (undefined4 *)0x0;
LAB_1401e32ff:
    puVar9 = puVar10;
    if (puVar9 != (undefined4 *)0x0) {
      uVar1 = *puVar9;
      ppuVar11 = &PTR_u_fDropItemCount01_1405e03f8;
      pfVar12 = local_b0;
      do {
        puVar2 = ppuVar11[-1];
        uVar4 = FUN_1402970c0(param_1,puVar2);
        pfVar6 = (float *)FUN_140296600(param_1,uVar1,uVar4,puVar2,1);
        puVar2 = *ppuVar11;
        pfVar12[-0x1e] = *pfVar6;
        uVar4 = FUN_1402970c0(param_1,puVar2);
        pfVar6 = (float *)FUN_1402967b0(param_1,uVar1,uVar4,puVar2,1);
        ppuVar11 = ppuVar11 + 2;
        *pfVar12 = *pfVar6 * 100.0;
        pfVar12 = pfVar12 + 1;
      } while ((longlong)ppuVar11 < 0x1405e05d8);
      memcpy(local_224,local_128,0xf0);
      FUN_1401e4d80(param_2,uVar1,local_224);
      puVar10 = *(undefined4 **)(puVar9 + 6);
      if (puVar10 == (undefined4 *)0x0) {
        uVar3 = (uint)puVar9[8] % *(uint *)(param_1 + 0x78) + 1;
        lVar7 = (longlong)(int)uVar3 << 3;
        do {
          if (*(uint *)(param_1 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar7 + *(longlong *)(param_1 + 0x68)) != 0) {
            puVar10 = *(undefined4 **)(lVar7 + *(longlong *)(param_1 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar7 = lVar7 + 8;
        } while (puVar10 == (undefined4 *)0x0);
      }
      goto LAB_1401e32ff;
    }
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Removing unreachable block (ram,0x0001401e4248)

void FUN_1401e3460(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  int iVar3;
  undefined *puVar4;
  longlong lVar5;
  void *pvVar6;
  uint uVar7;
  undefined4 uVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  undefined4 *puVar12;
  undefined8 uVar13;
  int *piVar14;
  undefined4 *puVar15;
  float *pfVar16;
  longlong lVar17;
  ulonglong uVar18;
  undefined8 *puVar19;
  longlong lVar20;
  undefined4 *puVar21;
  uint *puVar22;
  float *pfVar23;
  float *pfVar24;
  uint *puVar25;
  uint *puVar26;
  longlong *plVar27;
  longlong lVar28;
  uint *puVar29;
  int iVar30;
  int iVar31;
  undefined **ppuVar32;
  int iVar33;
  float fVar34;
  longlong local_res20;
  undefined8 local_1848;
  int local_1840;
  longlong *local_1838;
  longlong *local_1830;
  undefined4 *local_1828;
  longlong *local_1820;
  undefined8 local_1818;
  undefined4 *local_1810;
  longlong *local_1808;
  undefined4 *local_1800;
  longlong *local_17f8;
  undefined4 *local_17f0;
  longlong *local_17e8;
  longlong local_17e0;
  undefined1 local_17d8;
  undefined2 local_17d0;
  undefined6 uStack_17ce;
  undefined8 local_17c0;
  ulonglong local_17b8;
  undefined2 local_17a8;
  undefined6 uStack_17a6;
  undefined8 local_1798;
  ulonglong local_1790;
  undefined2 local_1780;
  undefined6 uStack_177e;
  undefined8 local_1770;
  ulonglong local_1768;
  undefined2 local_1758;
  undefined6 uStack_1756;
  undefined8 local_1748;
  ulonglong local_1740;
  undefined8 local_1730;
  int local_1728;
  undefined4 local_1724 [60];
  undefined4 local_1634 [60];
  int local_1544 [60];
  float local_1454 [63];
  int local_1358;
  undefined4 local_1354 [60];
  undefined4 local_1264 [60];
  int local_1174 [60];
  float local_1084 [63];
  int local_f88;
  undefined4 local_f84 [60];
  undefined4 local_e94 [60];
  int local_da4 [60];
  float local_cb4 [63];
  undefined4 local_bb8;
  undefined1 local_bb4 [964];
  undefined4 local_7f0;
  undefined1 local_7ec [964];
  undefined4 local_428;
  undefined1 local_424 [988];
  undefined8 uStack_48;
  
  uStack_48 = 0x1401e3483;
  local_1730 = 0xfffffffffffffffe;
  local_17e0 = param_1 + 0x300;
  FUN_14034ed40(local_17e0);
  local_17d8 = 1;
  uVar9 = FUN_1402933b0(DAT_140607ff0,L"CHAMPION_ITEM_DROP_GROUP_LIST");
  uVar10 = FUN_1402933b0(DAT_140607ff0,L"QUEST_ITEM_DROP_GROUP_LIST");
  uVar11 = FUN_1402933b0(DAT_140607ff0,L"INSTANCE_ITEM_DROP_GROUP_LIST");
  local_1818 = uVar11;
  puVar12 = (undefined4 *)FUN_1402933b0(DAT_140607ff0,L"WORLD_INSTANCE_ITEM_DROP_GROUP_LIST");
  local_1828 = puVar12;
  uVar13 = FUN_1402933b0(DAT_140607ff0,L"WORLD_ITEM_DROP_GROUP_LIST");
  *(undefined8 *)(param_1 + 0x2e0) = uVar13;
  uVar13 = FUN_1402933b0(DAT_140607ff0,L"WORLD_ITEM_DROP_GROUP_LIST_NOFATIGUE");
  *(undefined8 *)(param_1 + 0x2d8) = uVar13;
  uVar13 = FUN_1402933b0(DAT_140607ff0,L"RARE_CARD_DROP_GROUP_LIST");
  *(undefined8 *)(param_1 + 0x2e8) = uVar13;
  uVar13 = FUN_1402933b0(DAT_140607ff0,L"RARE_CARD_REWARD_ITEM_LIST");
  *(undefined8 *)(param_1 + 0x2f0) = uVar13;
  uVar13 = FUN_1402933b0(DAT_140607ff0,L"EventWorldItemDropGroupList");
  *(undefined8 *)(param_1 + 0x2f8) = uVar13;
  local_1838 = (longlong *)(param_1 + 0x200);
  FUN_1401e5010(local_1838);
  local_1848 = *(float **)(param_1 + 0x2e0);
  puVar21 = (undefined4 *)0x0;
  if (local_1848 != (float *)0x0) {
    local_1808 = (longlong *)((longlong)local_1848 + 0x68);
    if ((*(longlong *)((longlong)local_1848 + 0x70) != 0) &&
       (*(uint *)((longlong)local_1848 + 0x78) != 0)) {
      puVar12 = puVar21;
      plVar27 = (longlong *)*local_1808;
      do {
        if (*plVar27 != 0) {
          puVar21 = (undefined4 *)((longlong *)*local_1808)[(longlong)puVar12];
          break;
        }
        uVar7 = (int)puVar12 + 1;
        puVar12 = (undefined4 *)(ulonglong)uVar7;
        plVar27 = plVar27 + 1;
      } while (uVar7 < *(uint *)((longlong)local_1848 + 0x78));
    }
LAB_1401e3610:
    puVar12 = puVar21;
    iVar33 = 0;
    if (puVar12 != (undefined4 *)0x0) {
      uVar2 = *puVar12;
      uVar11 = *(undefined8 *)(param_1 + 0x2e0);
      local_1810 = puVar12;
      uVar8 = FUN_1402970c0(uVar11,L"nMaxRange");
      piVar14 = (int *)FUN_140296600(uVar11,uVar2,uVar8,L"nMaxRange",1);
      local_1728 = *piVar14;
      iVar30 = 0;
      puVar21 = local_1724;
      ppuVar32 = &PTR_u_nEnd01_1405dfc88;
      do {
        puVar4 = ppuVar32[-1];
        uVar11 = *(undefined8 *)(param_1 + 0x2e0);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0x3c] = *puVar15;
        puVar4 = *ppuVar32;
        uVar11 = *(undefined8 *)(param_1 + 0x2e0);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0x78] = *puVar15;
        puVar4 = ppuVar32[-3];
        uVar11 = *(undefined8 *)(param_1 + 0x2e0);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        *puVar21 = *puVar15;
        puVar4 = ppuVar32[-2];
        uVar11 = *(undefined8 *)(param_1 + 0x2e0);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        pfVar16 = (float *)FUN_1402967b0(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0xb4] = *pfVar16 * 100.0;
        if ((local_1728 <= (int)puVar21[0x78]) && (iVar33 = iVar33 + 1, 1 < iVar33)) {
          FUN_140418da0(DAT_140607fd8,
                        L"WORLD_ITEM_DROP_GROUP_LIST - RANGE DUPLICATE : %d - Range Index [ %d ][ %d ]"
                        ,uVar2,iVar30,puVar21[0x78]);
        }
        iVar30 = iVar30 + 1;
        ppuVar32 = ppuVar32 + 4;
        puVar21 = puVar21 + 1;
      } while (iVar30 < 0x3c);
      local_bb8 = uVar2;
      memcpy(local_bb4,&local_1728,0x3c4);
      FUN_1401e4f40(local_1838,uVar2,local_bb4);
      puVar15 = (undefined4 *)0x0;
      puVar21 = *(undefined4 **)(puVar12 + 6);
      if (*(undefined4 **)(puVar12 + 6) == (undefined4 *)0x0) {
        uVar7 = (uint)puVar12[8] % *(uint *)((longlong)local_1848 + 0x78) + 1;
        lVar17 = (longlong)(int)uVar7 << 3;
        do {
          puVar21 = puVar15;
          if (*(uint *)((longlong)local_1848 + 0x78) <= uVar7) break;
          if (*(longlong *)(*(longlong *)((longlong)local_1848 + 0x68) + lVar17) != 0) {
            puVar15 = *(undefined4 **)(*(longlong *)((longlong)local_1848 + 0x68) + lVar17);
          }
          uVar7 = uVar7 + 1;
          lVar17 = lVar17 + 8;
          puVar21 = puVar15;
        } while (puVar15 == (undefined4 *)0x0);
      }
      goto LAB_1401e3610;
    }
    local_1810 = (undefined4 *)0x0;
    uVar11 = local_1818;
    puVar12 = local_1828;
  }
  puVar21 = (undefined4 *)0x0;
  local_1848 = (float *)(param_1 + 0x248);
  FUN_1401e5010(local_1848);
  local_1838 = *(longlong **)(param_1 + 0x2d8);
  if (local_1838 != (longlong *)0x0) {
    local_17e8 = local_1838 + 0xd;
    if (local_1838[0xe] != 0) {
      uVar18 = 0;
      if (*(uint *)(local_1838 + 0xf) != 0) {
        plVar27 = (longlong *)*local_17e8;
        do {
          if (*plVar27 != 0) {
            puVar21 = (undefined4 *)((longlong *)*local_17e8)[uVar18];
            break;
          }
          uVar7 = (int)uVar18 + 1;
          uVar18 = (ulonglong)uVar7;
          plVar27 = plVar27 + 1;
        } while (uVar7 < *(uint *)(local_1838 + 0xf));
      }
    }
LAB_1401e38bf:
    puVar12 = puVar21;
    if (puVar12 != (undefined4 *)0x0) {
      uVar2 = *puVar12;
      uVar11 = *(undefined8 *)(param_1 + 0x2d8);
      local_17f0 = puVar12;
      uVar8 = FUN_1402970c0(uVar11,L"nMaxRange");
      piVar14 = (int *)FUN_140296600(uVar11,uVar2,uVar8,L"nMaxRange",1);
      local_1358 = *piVar14;
      iVar30 = 0;
      iVar33 = 0;
      puVar21 = local_1354;
      ppuVar32 = &PTR_u_nEnd01_1405dfc88;
      do {
        puVar4 = ppuVar32[-1];
        uVar11 = *(undefined8 *)(param_1 + 0x2d8);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0x3c] = *puVar15;
        puVar4 = *ppuVar32;
        uVar11 = *(undefined8 *)(param_1 + 0x2d8);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0x78] = *puVar15;
        puVar4 = ppuVar32[-3];
        uVar11 = *(undefined8 *)(param_1 + 0x2d8);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        *puVar21 = *puVar15;
        puVar4 = ppuVar32[-2];
        uVar11 = *(undefined8 *)(param_1 + 0x2d8);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        pfVar16 = (float *)FUN_1402967b0(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0xb4] = *pfVar16 * 100.0;
        if ((local_1358 <= (int)puVar21[0x78]) && (iVar30 = iVar30 + 1, 1 < iVar30)) {
          FUN_140418da0(DAT_140607fd8,
                        L"WORLD_ITEM_DROP_GROUP_LIST_NOFATIGUE - RANGE DUPLICATE : %d - Range Index [ %d ][ %d ]"
                        ,uVar2,iVar33,puVar21[0x78]);
        }
        iVar33 = iVar33 + 1;
        ppuVar32 = ppuVar32 + 4;
        puVar21 = puVar21 + 1;
      } while (iVar33 < 0x3c);
      local_7f0 = uVar2;
      memcpy(local_7ec,&local_1358,0x3c4);
      FUN_1401e4f40(local_1848,uVar2,local_7ec);
      puVar15 = (undefined4 *)0x0;
      puVar21 = *(undefined4 **)(puVar12 + 6);
      if (*(undefined4 **)(puVar12 + 6) == (undefined4 *)0x0) {
        uVar7 = (uint)puVar12[8] % *(uint *)(local_1838 + 0xf) + 1;
        lVar17 = (longlong)(int)uVar7 << 3;
        do {
          puVar21 = puVar15;
          if (*(uint *)(local_1838 + 0xf) <= uVar7) break;
          if (*(longlong *)(lVar17 + local_1838[0xd]) != 0) {
            puVar15 = *(undefined4 **)(lVar17 + local_1838[0xd]);
          }
          uVar7 = uVar7 + 1;
          lVar17 = lVar17 + 8;
          puVar21 = puVar15;
        } while (puVar15 == (undefined4 *)0x0);
      }
      goto LAB_1401e38bf;
    }
    local_17f0 = (undefined4 *)0x0;
    uVar11 = local_1818;
    puVar12 = local_1828;
  }
  puVar21 = (undefined4 *)0x0;
  local_1848 = (float *)(param_1 + 0x290);
  FUN_1401e5010(local_1848);
  local_1838 = *(longlong **)(param_1 + 0x2f8);
  if (local_1838 != (longlong *)0x0) {
    local_17f8 = local_1838 + 0xd;
    if ((local_1838[0xe] != 0) && (*(uint *)(local_1838 + 0xf) != 0)) {
      puVar12 = puVar21;
      plVar27 = (longlong *)*local_17f8;
      do {
        if (*plVar27 != 0) {
          puVar21 = (undefined4 *)((longlong *)*local_17f8)[(longlong)puVar12];
          break;
        }
        uVar7 = (int)puVar12 + 1;
        puVar12 = (undefined4 *)(ulonglong)uVar7;
        plVar27 = plVar27 + 1;
      } while (uVar7 < *(uint *)(local_1838 + 0xf));
    }
LAB_1401e3b7f:
    puVar12 = puVar21;
    if (puVar12 != (undefined4 *)0x0) {
      uVar2 = *puVar12;
      uVar11 = *(undefined8 *)(param_1 + 0x2f8);
      local_1800 = puVar12;
      uVar8 = FUN_1402970c0(uVar11,L"nMaxRange");
      piVar14 = (int *)FUN_140296600(uVar11,uVar2,uVar8,L"nMaxRange",1);
      local_f88 = *piVar14;
      iVar30 = 0;
      iVar33 = 0;
      puVar21 = local_f84;
      ppuVar32 = &PTR_u_nEnd01_1405dfc88;
      do {
        puVar4 = ppuVar32[-1];
        uVar11 = *(undefined8 *)(param_1 + 0x2f8);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0x3c] = *puVar15;
        puVar4 = *ppuVar32;
        uVar11 = *(undefined8 *)(param_1 + 0x2f8);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0x78] = *puVar15;
        puVar4 = ppuVar32[-3];
        uVar11 = *(undefined8 *)(param_1 + 0x2f8);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        puVar15 = (undefined4 *)FUN_140296600(uVar11,uVar2,uVar8,puVar4,1);
        *puVar21 = *puVar15;
        puVar4 = ppuVar32[-2];
        uVar11 = *(undefined8 *)(param_1 + 0x2f8);
        uVar8 = FUN_1402970c0(uVar11,puVar4);
        pfVar16 = (float *)FUN_1402967b0(uVar11,uVar2,uVar8,puVar4,1);
        puVar21[0xb4] = *pfVar16 * 100.0;
        if ((local_f88 <= (int)puVar21[0x78]) && (iVar30 = iVar30 + 1, 1 < iVar30)) {
          FUN_140418da0(DAT_140607fd8,
                        L"EventWorldItemDropGroupList - RANGE DUPLICATE : %d - Range Index [ %d ][ %d ]"
                        ,uVar2,iVar33,puVar21[0x78]);
        }
        iVar33 = iVar33 + 1;
        ppuVar32 = ppuVar32 + 4;
        puVar21 = puVar21 + 1;
      } while (iVar33 < 0x3c);
      local_428 = uVar2;
      memcpy(local_424,&local_f88,0x3c4);
      FUN_1401e4f40(local_1848,uVar2,local_424);
      puVar15 = (undefined4 *)0x0;
      puVar21 = *(undefined4 **)(puVar12 + 6);
      if (*(undefined4 **)(puVar12 + 6) == (undefined4 *)0x0) {
        uVar7 = (uint)puVar12[8] % *(uint *)(local_1838 + 0xf) + 1;
        lVar17 = (longlong)(int)uVar7 << 3;
        do {
          puVar21 = puVar15;
          if (*(uint *)(local_1838 + 0xf) <= uVar7) break;
          if (*(longlong *)(lVar17 + local_1838[0xd]) != 0) {
            puVar15 = *(undefined4 **)(lVar17 + local_1838[0xd]);
          }
          uVar7 = uVar7 + 1;
          lVar17 = lVar17 + 8;
          puVar21 = puVar15;
        } while (puVar15 == (undefined4 *)0x0);
      }
      goto LAB_1401e3b7f;
    }
    local_1800 = (undefined4 *)0x0;
    uVar11 = local_1818;
    puVar12 = local_1828;
  }
  puVar21 = (undefined4 *)0x0;
  FUN_1401e3270(uVar10,param_1 + 0x1b8);
  FUN_1401e3270(uVar11,param_1 + 0xe0);
  FUN_1401e3270(puVar12,param_1 + 0x128);
  FUN_1401e3270(uVar9,param_1 + 0x170);
  lVar17 = FUN_1402933b0(DAT_140607ff0,L"ItemDropGroupList_F");
  if (lVar17 != 0) {
    local_1820 = (longlong *)(lVar17 + 0x68);
    if ((*(longlong *)(lVar17 + 0x70) != 0) && (*(uint *)(lVar17 + 0x78) != 0)) {
      puVar12 = puVar21;
      plVar27 = (longlong *)*local_1820;
      do {
        if (*plVar27 != 0) {
          puVar21 = (undefined4 *)((longlong *)*local_1820)[(longlong)puVar12];
          break;
        }
        uVar7 = (int)puVar12 + 1;
        puVar12 = (undefined4 *)(ulonglong)uVar7;
        plVar27 = plVar27 + 1;
      } while (uVar7 < *(uint *)(lVar17 + 0x78));
    }
LAB_1401e3e7a:
    puVar12 = (undefined4 *)0x0;
    local_1828 = puVar21;
    if (puVar21 != (undefined4 *)0x0) {
      uVar2 = *puVar21;
      local_1838 = (longlong *)0x0;
      puVar15 = operator_new(0x28);
      if (puVar15 == (undefined4 *)0x0) {
        local_1838 = (longlong *)0x0;
      }
      else {
        *puVar15 = 0;
        puVar15[1] = 0x28;
        *(undefined8 *)(puVar15 + 2) = 0;
        *(undefined8 *)(puVar15 + 4) = 0;
        *(undefined8 *)(puVar15 + 6) = 0;
        local_1838 = operator_new(0x10);
        *local_1838 = (longlong)puVar15;
        *(undefined4 *)(local_1838 + 1) = 1;
      }
      plVar27 = local_1838;
      puVar15 = puVar12;
      if (local_1838 != (longlong *)0x0) {
        puVar15 = (undefined4 *)*local_1838;
      }
      *puVar15 = uVar2;
      local_1830 = local_1838;
      uVar8 = FUN_1402970c0(lVar17,L"nMaxCount");
      puVar15 = (undefined4 *)FUN_140296600(lVar17,uVar2,uVar8,L"nMaxCount",1);
      if (plVar27 != (longlong *)0x0) {
        puVar12 = (undefined4 *)*plVar27;
      }
      puVar12[1] = *puVar15;
      iVar33 = 1;
      local_res20 = 0x28;
      do {
        puVar19 = (undefined8 *)FUN_1404154c0(&local_17d0,L"nDropItemCode%02d",iVar33);
        if (7 < (ulonglong)puVar19[3]) {
          puVar19 = (undefined8 *)*puVar19;
        }
        uVar8 = FUN_1402970c0(lVar17,puVar19);
        piVar14 = (int *)FUN_140296600(lVar17,uVar2,uVar8,puVar19,1);
        iVar30 = *piVar14;
        if (7 < local_17b8) {
          operator_delete((void *)CONCAT62(uStack_17ce,local_17d0));
        }
        local_17b8 = 7;
        local_17c0 = 0;
        local_17d0 = 0;
        puVar19 = (undefined8 *)FUN_1404154c0(&local_17a8,L"fDropItemCount%02d",iVar33);
        if (7 < (ulonglong)puVar19[3]) {
          puVar19 = (undefined8 *)*puVar19;
        }
        uVar8 = FUN_1402970c0(lVar17,puVar19);
        pfVar16 = (float *)FUN_1402967b0(lVar17,uVar2,uVar8,puVar19,1);
        iVar31 = (int)(*pfVar16 * 10000.0);
        if (7 < local_1790) {
          operator_delete((void *)CONCAT62(uStack_17a6,local_17a8));
        }
        local_1790 = 7;
        local_1798 = 0;
        local_17a8 = 0;
        puVar19 = (undefined8 *)FUN_1404154c0(&local_1780,L"nDropItemLink%02d",iVar33);
        if (7 < (ulonglong)puVar19[3]) {
          puVar19 = (undefined8 *)*puVar19;
        }
        uVar8 = FUN_1402970c0(lVar17,puVar19);
        piVar14 = (int *)FUN_140296600(lVar17,uVar2,uVar8,puVar19,1);
        iVar3 = *piVar14;
        if (7 < local_1768) {
          operator_delete((void *)CONCAT62(uStack_177e,local_1780));
        }
        local_1768 = 7;
        lVar20 = 0;
        local_1770 = 0;
        local_1780 = 0;
        if (plVar27 != (longlong *)0x0) {
          lVar20 = *plVar27;
        }
        if ((0 < iVar30) && (0 < iVar31)) {
          local_1848 = (float *)CONCAT44(iVar31,iVar30);
          local_1840 = CONCAT31(local_1840._1_3_,0 < iVar3);
          puVar19 = *(undefined8 **)(lVar20 + 0x10);
          if ((&local_1848 < puVar19) && (*(undefined8 **)(lVar20 + 8) <= &local_1848)) {
            lVar28 = (longlong)&local_1848 - (longlong)*(undefined8 **)(lVar20 + 8);
            lVar28 = lVar28 / 6 + (lVar28 >> 0x3f);
            lVar28 = (lVar28 >> 1) - (lVar28 >> 0x3f);
            if (puVar19 == *(undefined8 **)(lVar20 + 0x18)) {
              FUN_140275840(lVar20 + 8);
            }
            lVar5 = *(longlong *)(lVar20 + 8);
            piVar14 = *(int **)(lVar20 + 0x10);
            if (piVar14 != (int *)0x0) {
              *piVar14 = *(int *)(lVar5 + lVar28 * 0xc);
              piVar14[1] = *(int *)(lVar5 + 4 + lVar28 * 0xc);
              iVar30 = *(int *)(lVar5 + 8 + lVar28 * 0xc);
LAB_1401e4171:
              piVar14[2] = iVar30;
            }
          }
          else {
            if (puVar19 == *(undefined8 **)(lVar20 + 0x18)) {
              FUN_140275840(lVar20 + 8);
            }
            piVar14 = *(int **)(lVar20 + 0x10);
            if (piVar14 != (int *)0x0) {
              *piVar14 = iVar30;
              piVar14[1] = iVar31;
              iVar30 = local_1840;
              goto LAB_1401e4171;
            }
          }
          *(longlong *)(lVar20 + 0x10) = *(longlong *)(lVar20 + 0x10) + 0xc;
        }
        iVar33 = iVar33 + 1;
        local_res20 = local_res20 + -1;
      } while (local_res20 != 0);
      FUN_1401e4c70(param_1 + 0x98,uVar2,&local_1838);
      puVar12 = puVar21;
      if (plVar27 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar27 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar12 = local_1828;
        if ((int)*plVar1 == 0) {
          local_1838 = (longlong *)0x0;
          pvVar6 = (void *)*plVar27;
          if (pvVar6 != (void *)0x0) {
            if (*(void **)((longlong)pvVar6 + 8) != (void *)0x0) {
              operator_delete(*(void **)((longlong)pvVar6 + 8));
            }
            *(undefined8 *)((longlong)pvVar6 + 8) = 0;
            *(undefined8 *)((longlong)pvVar6 + 0x10) = 0;
            *(undefined8 *)((longlong)pvVar6 + 0x18) = 0;
            operator_delete(pvVar6);
          }
          operator_delete(plVar27);
          puVar12 = local_1828;
        }
      }
      puVar21 = *(undefined4 **)(puVar12 + 6);
      if (puVar21 == (undefined4 *)0x0) {
        uVar7 = (uint)puVar12[8] % *(uint *)(lVar17 + 0x78) + 1;
        lVar20 = (longlong)(int)uVar7 << 3;
        puVar21 = (undefined4 *)0x0;
        do {
          if (*(uint *)(lVar17 + 0x78) <= uVar7) break;
          if (*(longlong *)(*(longlong *)(lVar17 + 0x68) + lVar20) != 0) {
            puVar21 = *(undefined4 **)(*(longlong *)(lVar17 + 0x68) + lVar20);
          }
          uVar7 = uVar7 + 1;
          lVar20 = lVar20 + 8;
        } while (puVar21 == (undefined4 *)0x0);
      }
      goto LAB_1401e3e7a;
    }
  }
  puVar21 = (undefined4 *)0x0;
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  if (DAT_14060a120 == 1000) {
    lVar17 = *(longlong *)(param_1 + 0x2f0);
    if (lVar17 != 0) {
      if ((*(longlong *)(lVar17 + 0x70) != 0) && (*(uint *)(lVar17 + 0x78) != 0)) {
        plVar27 = *(longlong **)(lVar17 + 0x68);
        do {
          if (*plVar27 != 0) {
            puVar21 = (undefined4 *)(*(longlong **)(lVar17 + 0x68))[(longlong)puVar21];
            goto LAB_1401e42d1;
          }
          uVar7 = (int)puVar21 + 1;
          puVar21 = (undefined4 *)(ulonglong)uVar7;
          plVar27 = plVar27 + 1;
        } while (uVar7 < *(uint *)(lVar17 + 0x78));
        puVar21 = (undefined4 *)0x0;
      }
LAB_1401e42d1:
      puVar12 = puVar21;
      if (puVar12 != (undefined4 *)0x0) {
        uVar2 = *puVar12;
        iVar33 = 1;
        lVar20 = 0x28;
        do {
          puVar19 = (undefined8 *)FUN_1404154c0(&local_1758,L"nRewardItem%02d",iVar33);
          if (7 < (ulonglong)puVar19[3]) {
            puVar19 = (undefined8 *)*puVar19;
          }
          uVar11 = *(undefined8 *)(param_1 + 0x2f0);
          uVar8 = FUN_1402970c0(uVar11,puVar19);
          puVar22 = (uint *)FUN_140296600(uVar11,uVar2,uVar8,puVar19,1);
          if (7 < local_1740) {
            operator_delete((void *)CONCAT62(uStack_1756,local_1758));
          }
          local_1740 = 7;
          local_1748 = 0;
          local_1758 = 0;
          if (puVar22 != (uint *)0x0) {
            uVar7 = *puVar22;
            if (uVar7 == 0) {
              FUN_140418da0(DAT_140607fd8,
                            L"!!! Error RareCardReward No Setting: [ %d ] - Index [ %d ]\n",uVar2,
                            iVar33);
            }
            else if (uVar7 != 1) {
              lVar28 = FUN_140137690();
              if (*(longlong *)(lVar28 + 0x88) != 0) {
                for (puVar25 = *(uint **)(*(longlong *)(lVar28 + 0x88) +
                                         ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar28 + 0x98)) *
                                         8); puVar25 != (uint *)0x0;
                    puVar25 = *(uint **)(puVar25 + 0xa6)) {
                  if ((puVar25[0xa8] == uVar7) && (*puVar25 == uVar7)) {
                    if (puVar25 != (uint *)0x0) goto LAB_1401e43fe;
                    break;
                  }
                }
              }
              FUN_140418da0(DAT_140607fd8,
                            L"!!! Error RareCardReward Invalid Item: [ %d ] - Index [ %d ] Item [ %d ]\n"
                            ,uVar2,iVar33,*puVar22);
            }
          }
LAB_1401e43fe:
          iVar33 = iVar33 + 1;
          lVar20 = lVar20 + -1;
        } while (lVar20 != 0);
        puVar21 = *(undefined4 **)(puVar12 + 6);
        if (*(undefined4 **)(puVar12 + 6) == (undefined4 *)0x0) {
          puVar21 = (undefined4 *)0x0;
          uVar7 = (uint)puVar12[8] % *(uint *)(lVar17 + 0x78) + 1;
          lVar20 = (longlong)(int)uVar7 << 3;
          do {
            if (*(uint *)(lVar17 + 0x78) <= uVar7) break;
            if (*(longlong *)(*(longlong *)(lVar17 + 0x68) + lVar20) != 0) {
              puVar21 = *(undefined4 **)(*(longlong *)(lVar17 + 0x68) + lVar20);
            }
            uVar7 = uVar7 + 1;
            lVar20 = lVar20 + 8;
          } while (puVar21 == (undefined4 *)0x0);
        }
        goto LAB_1401e42d1;
      }
    }
    puVar21 = (undefined4 *)0x0;
    lVar17 = *(longlong *)(param_1 + 0x2e8);
    if (lVar17 != 0) {
      if ((*(longlong *)(lVar17 + 0x70) != 0) && (*(uint *)(lVar17 + 0x78) != 0)) {
        puVar12 = puVar21;
        plVar27 = *(longlong **)(lVar17 + 0x68);
        do {
          if (*plVar27 != 0) {
            puVar21 = (undefined4 *)(*(longlong **)(lVar17 + 0x68))[(longlong)puVar12];
            break;
          }
          uVar7 = (int)puVar12 + 1;
          puVar12 = (undefined4 *)(ulonglong)uVar7;
          plVar27 = plVar27 + 1;
        } while (uVar7 < *(uint *)(lVar17 + 0x78));
      }
LAB_1401e44b3:
      puVar12 = puVar21;
      if (puVar12 != (undefined4 *)0x0) {
        uVar2 = *puVar12;
        uVar11 = *(undefined8 *)(param_1 + 0x2e8);
        uVar8 = FUN_1402970c0(uVar11,L"fNil");
        pfVar16 = (float *)FUN_1402967b0(uVar11,uVar2,uVar8,L"fNil",1);
        uVar11 = *(undefined8 *)(param_1 + 0x2e8);
        uVar8 = FUN_1402970c0(uVar11,L"fBronzeCard");
        pfVar23 = (float *)FUN_1402967b0(uVar11,uVar2,uVar8,L"fBronzeCard",1);
        uVar11 = *(undefined8 *)(param_1 + 0x2e8);
        uVar8 = FUN_1402970c0(uVar11,L"fSilverCard");
        pfVar24 = (float *)FUN_1402967b0(uVar11,uVar2,uVar8,L"fSilverCard",1);
        uVar11 = *(undefined8 *)(param_1 + 0x2e8);
        uVar8 = FUN_1402970c0(uVar11,L"fGoldCard");
        local_1848 = (float *)FUN_1402967b0(uVar11,uVar2,uVar8,L"fGoldCard",1);
        uVar11 = *(undefined8 *)(param_1 + 0x2e8);
        uVar8 = FUN_1402970c0(uVar11,L"nBronzeCardID");
        puVar22 = (uint *)FUN_140296600(uVar11,uVar2,uVar8,L"nBronzeCardID",1);
        uVar11 = *(undefined8 *)(param_1 + 0x2e8);
        uVar8 = FUN_1402970c0(uVar11,L"nSilverCardID");
        puVar25 = (uint *)FUN_140296600(uVar11,uVar2,uVar8,L"nSilverCardID",1);
        uVar11 = *(undefined8 *)(param_1 + 0x2e8);
        uVar8 = FUN_1402970c0(uVar11,L"nGoldCardID");
        puVar26 = (uint *)FUN_140296600(uVar11,uVar2,uVar8,L"nGoldCardID",1);
        uVar7 = *puVar22;
        lVar20 = FUN_140137690();
        if (*(longlong *)(lVar20 + 0x88) != 0) {
          for (puVar29 = *(uint **)(*(longlong *)(lVar20 + 0x88) +
                                   ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar20 + 0x98)) * 8);
              puVar29 != (uint *)0x0; puVar29 = *(uint **)(puVar29 + 0xa6)) {
            if ((puVar29[0xa8] == uVar7) && (*puVar29 == uVar7)) {
              if (puVar29 != (uint *)0x0) goto LAB_1401e469e;
              break;
            }
          }
        }
        FUN_140418da0(DAT_140607fd8,
                      L"!!! Error RareCardDropGroupList Invalid Item : [ %d ] - nBronzeCardID [ %d ]\n"
                      ,uVar2,*puVar22);
LAB_1401e469e:
        uVar7 = *puVar25;
        lVar20 = FUN_140137690();
        if (*(longlong *)(lVar20 + 0x88) != 0) {
          for (puVar22 = *(uint **)(*(longlong *)(lVar20 + 0x88) +
                                   ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar20 + 0x98)) * 8);
              puVar22 != (uint *)0x0; puVar22 = *(uint **)(puVar22 + 0xa6)) {
            if ((puVar22[0xa8] == uVar7) && (*puVar22 == uVar7)) {
              if (puVar22 != (uint *)0x0) goto LAB_1401e4705;
              break;
            }
          }
        }
        FUN_140418da0(DAT_140607fd8,
                      L"!!! Error RareCardDropGroupList Invalid Item : [ %d ] - nSilverCardID [ %d ]\n"
                      ,uVar2,*puVar25);
LAB_1401e4705:
        uVar7 = *puVar26;
        lVar20 = FUN_140137690();
        if (*(longlong *)(lVar20 + 0x88) != 0) {
          for (puVar22 = *(uint **)(*(longlong *)(lVar20 + 0x88) +
                                   ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar20 + 0x98)) * 8);
              puVar22 != (uint *)0x0; puVar22 = *(uint **)(puVar22 + 0xa6)) {
            if ((puVar22[0xa8] == uVar7) && (*puVar22 == uVar7)) {
              if (puVar22 != (uint *)0x0) goto LAB_1401e4756;
              break;
            }
          }
        }
        puVar22 = (uint *)0x0;
LAB_1401e4756:
        puVar15 = (undefined4 *)0x0;
        if (puVar22 == (uint *)0x0) {
          FUN_140418da0(DAT_140607fd8,
                        L"!!! Error RareCardDropGroupList Invalid Item : [ %d ] - nGoldCardID [ %d ]\n"
                        ,uVar2,*puVar26);
        }
        fVar34 = *pfVar16 + *pfVar23 + *pfVar24 + *local_1848;
        if (fVar34 != 1.0) {
          FUN_140418da0(DAT_140607fd8,
                        L"!!! Error RareCardDropGroupList Invalid Value : [ %d ] - Value [ %f ]\n",
                        uVar2,(double)fVar34);
        }
        puVar21 = *(undefined4 **)(puVar12 + 6);
        if (*(undefined4 **)(puVar12 + 6) == (undefined4 *)0x0) {
          uVar7 = (uint)puVar12[8] % *(uint *)(lVar17 + 0x78) + 1;
          lVar20 = (longlong)(int)uVar7 << 3;
          do {
            puVar21 = puVar15;
            if (*(uint *)(lVar17 + 0x78) <= uVar7) break;
            if (*(longlong *)(*(longlong *)(lVar17 + 0x68) + lVar20) != 0) {
              puVar15 = *(undefined4 **)(*(longlong *)(lVar17 + 0x68) + lVar20);
            }
            uVar7 = uVar7 + 1;
            lVar20 = lVar20 + 8;
            puVar21 = puVar15;
          } while (puVar15 == (undefined4 *)0x0);
        }
        goto LAB_1401e44b3;
      }
    }
  }
  FUN_14034edd0(local_17e0);
  return;
}



void * FUN_1401e4840(longlong param_1,longlong *param_2,uint param_3)

{
  char cVar1;
  int iVar2;
  undefined8 *puVar3;
  HANDLE hObject;
  int *piVar4;
  void *_ArgList;
  void *pvVar5;
  uint uVar6;
  void *pvVar8;
  char cVar9;
  uint local_res18 [4];
  undefined8 uVar10;
  longlong lVar11;
  undefined1 uVar12;
  void *pvVar7;
  
  uVar10 = 0xfffffffffffffffe;
  pvVar5 = (void *)(ulonglong)param_3;
  param_1 = param_1 + 0x300;
  lVar11 = param_1;
  FUN_14034ed40(param_1);
  uVar12 = 1;
  cVar9 = '\0';
  pvVar8 = (void *)0x0;
  pvVar7 = pvVar8;
  do {
    iVar2 = DAT_140608124;
    if (*param_2 == 0) {
LAB_1401e499d:
      if ((DAT_14060b7c4 & 1) == 0) {
        DAT_14060b7c4 = DAT_14060b7c4 | 1;
        FUN_140418590();
        atexit((_func_5014 *)&LAB_140448470);
      }
      if (DAT_14060a120 == 1000) {
        FUN_140418da0(DAT_140607fd8,
                      L"ItemDrop Link Invalid : DropGroupID[%d], ItemCode[%d], Link[%d], Loop[%d]",
                      param_3,pvVar5,cVar9 != '\0',pvVar7,uVar10,lVar11,uVar12);
      }
      break;
    }
    piVar4 = *(int **)(*param_2 + ((ulonglong)pvVar5 % (ulonglong)*(uint *)(param_2 + 2)) * 8);
    while( true ) {
      if (piVar4 == (int *)0x0) goto LAB_1401e499d;
      if ((piVar4[8] == (int)pvVar5) && (*piVar4 == (int)pvVar5)) break;
      piVar4 = *(int **)(piVar4 + 6);
    }
    if (piVar4 == (int *)0x0) goto LAB_1401e499d;
    puVar3 = *(undefined8 **)(piVar4 + 2);
    _ArgList = pvVar8;
    if (puVar3 != (undefined8 *)0x0) {
      if (puVar3 == *(undefined8 **)(piVar4 + 4)) {
        _ArgList = (void *)*puVar3;
      }
      else {
        DAT_140608124 = DAT_140608124 + 1;
        if (iVar2 == 0) {
          FUN_140176d60(CONCAT71((int7)((ulonglong)piVar4 >> 8),1));
        }
      }
    }
    pvVar5 = pvVar8;
    if (*(longlong *)((longlong)_ArgList + 8) == *(longlong *)((longlong)_ArgList + 0x10)) {
LAB_1401e4991:
      FUN_14034edd0(param_1);
      return pvVar5;
    }
    iVar2 = *(int *)((longlong)_ArgList + 0x38);
    if ((iVar2 < 0) || (*(int *)((longlong)_ArgList + 4) <= iVar2)) goto LAB_1401e4991;
    cVar1 = *(char *)(*(longlong *)((longlong)_ArgList + 0x30) + (longlong)iVar2);
    *(int *)((longlong)_ArgList + 0x38) = iVar2 + 1;
    if (*(int *)((longlong)_ArgList + 4) <= iVar2 + 1) {
      *(undefined4 *)((longlong)_ArgList + 0x38) = 0xffffffff;
      local_res18[0] = 0;
      hObject = (HANDLE)_beginthreadex((void *)0x0,0,FUN_1402755d0,_ArgList,0,local_res18);
      CloseHandle(hObject);
    }
    if (cVar1 < '\0') goto LAB_1401e4991;
    cVar9 = *(char *)(*(longlong *)((longlong)_ArgList + 8) + 8 + (longlong)cVar1 * 0xc);
    pvVar5 = (void *)(ulonglong)
                     *(uint *)(*(longlong *)((longlong)_ArgList + 8) + (longlong)cVar1 * 0xc);
    if (cVar9 == '\0') goto LAB_1401e4991;
    uVar6 = (int)pvVar7 + 1;
    pvVar7 = (void *)(ulonglong)uVar6;
  } while ((int)uVar6 < 3);
  FUN_14034edd0(param_1);
  return (void *)0x0;
}



void thunk_FUN_1401e4a30(void)

{
  FUN_1401e4a30();
  return;
}



void FUN_1401e4a30(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) {
            if (*(void **)((longlong)pvVar3 + 8) != (void *)0x0) {
              operator_delete(*(void **)((longlong)pvVar3 + 8));
            }
            *(undefined8 *)((longlong)pvVar3 + 8) = 0;
            *(undefined8 *)((longlong)pvVar3 + 0x10) = 0;
            *(undefined8 *)((longlong)pvVar3 + 0x18) = 0;
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608120 + 1;
      bVar5 = DAT_140608120 == 0;
      DAT_140608120 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401e4ad0(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) {
            if (*(void **)((longlong)pvVar3 + 0x30) != (void *)0x0) {
              operator_delete__(*(void **)((longlong)pvVar3 + 0x30));
            }
            *(undefined8 *)((longlong)pvVar3 + 0x30) = 0;
            if (*(void **)((longlong)pvVar3 + 8) != (void *)0x0) {
              operator_delete(*(void **)((longlong)pvVar3 + 8));
            }
            *(undefined8 *)((longlong)pvVar3 + 8) = 0;
            *(undefined8 *)((longlong)pvVar3 + 0x10) = 0;
            *(undefined8 *)((longlong)pvVar3 + 0x18) = 0;
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608128 + 1;
      bVar5 = DAT_140608128 == 0;
      DAT_140608128 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401e4b80(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) {
            if (*(void **)((longlong)pvVar3 + 0x40) != (void *)0x0) {
              operator_delete__(*(void **)((longlong)pvVar3 + 0x40));
            }
            *(undefined8 *)((longlong)pvVar3 + 0x40) = 0;
            if (*(void **)((longlong)pvVar3 + 0x18) != (void *)0x0) {
              operator_delete(*(void **)((longlong)pvVar3 + 0x18));
            }
            *(undefined8 *)((longlong)pvVar3 + 0x18) = 0;
            *(undefined8 *)((longlong)pvVar3 + 0x20) = 0;
            *(undefined8 *)((longlong)pvVar3 + 0x28) = 0;
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14060812c + 1;
      bVar5 = DAT_14060812c == 0;
      DAT_14060812c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1401e4c30(void)

{
  FUN_1401e5100();
  return;
}



void FUN_1401e4c50(void)

{
  FUN_1401e51d0();
  return;
}



uint * FUN_1401e4c70(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_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_1401e4a30(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_1401e59d0(param_1,param_2,(ulonglong)param_2 % uVar4,param_2);
  if (*(longlong *)(puVar3 + 2) != *param_3) {
    FUN_1401e4a30(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;
}



void FUN_1401e4d60(void)

{
  FUN_1401e52a0();
  return;
}



uint * FUN_1401e4d80(longlong *param_1,uint param_2,void *param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x3e)) {
      if ((puVar2[0x40] == param_2) && (*puVar2 == param_2)) {
        memcpy(puVar2 + 1,param_3,0xf0);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1401e5d70(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  memcpy(puVar2 + 1,param_3,0xf0);
  return puVar2;
}



void FUN_1401e4e50(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 + 0xf8);
        FUN_1401e5480(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1401e4f20(void)

{
  FUN_1401e4e50();
  return;
}



uint * FUN_1401e4f40(longlong *param_1,uint param_2,void *param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0xf2)) {
      if ((puVar2[0xf4] == param_2) && (*puVar2 == param_2)) {
        memcpy(puVar2 + 1,param_3,0x3c4);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1401e6090(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  memcpy(puVar2 + 1,param_3,0x3c4);
  return puVar2;
}



void FUN_1401e5010(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 + 0x3c8);
        FUN_1401e55a0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1401e50e0(void)

{
  FUN_1401e5010();
  return;
}



void FUN_1401e5100(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 + 0x18);
        FUN_1401e5890(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_1402cddb0(param_1,0);
    FUN_1401e5630(param_1,uVar4);
  }
  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_1401e51d0(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 + 0x18);
        FUN_1401e5930(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_1402cddb0(param_1,0);
    FUN_1401e5630(param_1,uVar4);
  }
  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_1401e52a0(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 + 0x18);
        FUN_1401e5b20(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1401e5370(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1401e5b20(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x18);
  FUN_1401e5b20(param_1,param_2);
  return;
}



void FUN_1401e53f0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x100) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0xf8); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0xf8))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0xf8) = *(undefined8 *)(param_2 + 0xf8);
      FUN_1401e5480(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0xf8);
  FUN_1401e5480(param_1,param_2);
  return;
}



void FUN_1401e5480(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0xf8) = *(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_1402cddb0();
      FUN_1401e5bc0(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_14000d450(0x80004005);
}



void FUN_1401e5510(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x3d0) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x3c8); lVar4 != param_2;
        lVar4 = *(longlong *)(lVar4 + 0x3c8)) {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x3c8) = *(undefined8 *)(param_2 + 0x3c8);
      FUN_1401e55a0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x3c8);
  FUN_1401e55a0(param_1,param_2);
  return;
}



void FUN_1401e55a0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0x3c8) = *(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_1402cddb0();
      FUN_1401e5ee0(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_14000d450(0x80004005);
}



undefined8 FUN_1401e5630(undefined8 *param_1,uint param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if ((void *)*param_1 != (void *)0x0) {
    operator_delete__((void *)*param_1);
    *param_1 = 0;
  }
  lVar2 = 0;
  *(uint *)(param_1 + 2) = param_2;
  fVar5 = (float)param_2 * *(float *)((longlong)param_1 + 0x1c);
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar4 = (float)param_2 * *(float *)(param_1 + 3);
  lVar3 = 0;
  param_1[4] = (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;
  }
  param_1[5] = uVar1;
  return CONCAT71((int7)(uVar1 >> 8),1);
}



void FUN_1401e56e0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1401e5630(param_1,param_2);
    }
    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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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_1401e5890(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1401e4b80(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_1402cddb0(param_1);
    FUN_1401e56e0(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_1401e5930(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1401e4ad0(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_1402cddb0(param_1);
    FUN_1401e56e0(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;
}



undefined4 *
FUN_1401e59d0(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_1401e5a87;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401e5a87:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(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_1402cddb0(param_1);
    FUN_1401dfb50(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1401e5b20(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1401e4a30(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_1402cddb0(param_1);
    FUN_1401dfb50(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_1401e5bc0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0xf8);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x100) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0xf8) = *(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_1401e5d70(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) < 0x108)
      goto LAB_1401e5e3d;
      lVar7 = uVar6 * 0x108;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401e5e3d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x21 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x1f] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x21;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x3e);
  *puVar2 = param_2;
  puVar2[0x40] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x3e) = *(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_1402cddb0(param_1);
    FUN_1401e5bc0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1401e5ee0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x3c8);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x3d0) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x3c8) = *(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_1401e6090(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) < 0x3d8)
      goto LAB_1401e615d;
      lVar7 = uVar6 * 0x3d8;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1401e615d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x7b + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x79] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x7b;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0xf2);
  *puVar2 = param_2;
  puVar2[0xf4] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0xf2) = *(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_1402cddb0(param_1);
    FUN_1401e5ee0(param_1,uVar4);
  }
  return puVar2;
}



ulonglong * FUN_1401e6200(longlong param_1,ulonglong *param_2,ulonglong *param_3)

{
  ulonglong uVar1;
  ulonglong *puVar2;
  int iVar3;
  uint uVar4;
  bool bVar5;
  
  FUN_14034ed40(param_1 + 0x98);
  uVar1 = param_3[1];
  uVar4 = (uint)*param_3 ^ *(uint *)((longlong)param_3 + 4) ^ (uint)param_3[1] ^
          *(uint *)((longlong)param_3 + 0xc);
  if (*(longlong *)(param_1 + 8) != 0) {
    for (puVar2 = *(ulonglong **)
                   (*(longlong *)(param_1 + 8) +
                   ((ulonglong)uVar4 % (ulonglong)*(uint *)(param_1 + 0x18)) * 8);
        puVar2 != (ulonglong *)0x0; puVar2 = (ulonglong *)puVar2[4]) {
      if ((uint)puVar2[5] == uVar4) {
        bVar5 = *puVar2 < *param_3;
        if ((*puVar2 == *param_3) && (bVar5 = puVar2[1] < uVar1, puVar2[1] == uVar1)) {
          iVar3 = 0;
        }
        else {
          iVar3 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
        }
        if (iVar3 == 0) {
          if (puVar2 != (ulonglong *)0x0) {
            uVar1 = puVar2[2];
            *param_2 = uVar1;
            param_2[1] = uVar1;
            if (uVar1 != 0) {
              LOCK();
              *(int *)(uVar1 + 8) = *(int *)(uVar1 + 8) + 1;
              UNLOCK();
            }
            goto LAB_1401e62f4;
          }
          break;
        }
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
LAB_1401e62f4:
  FUN_14034edd0(param_1 + 0x98);
  return param_2;
}



ulonglong * FUN_1401e6310(longlong param_1,ulonglong *param_2,ulonglong *param_3)

{
  ulonglong uVar1;
  ulonglong *puVar2;
  int iVar3;
  uint uVar4;
  bool bVar5;
  
  FUN_14034ed40(param_1 + 0x98);
  if (*(longlong *)(param_1 + 0x10) == 0) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    uVar1 = param_3[1];
    uVar4 = (uint)*param_3 ^ *(uint *)((longlong)param_3 + 4) ^ (uint)param_3[1] ^
            *(uint *)((longlong)param_3 + 0xc);
    if (*(longlong *)(param_1 + 8) != 0) {
      for (puVar2 = *(ulonglong **)
                     (*(longlong *)(param_1 + 8) +
                     ((ulonglong)uVar4 % (ulonglong)*(uint *)(param_1 + 0x18)) * 8);
          puVar2 != (ulonglong *)0x0; puVar2 = (ulonglong *)puVar2[4]) {
        if ((uint)puVar2[5] == uVar4) {
          bVar5 = *puVar2 < *param_3;
          if ((*puVar2 != *param_3) || (bVar5 = puVar2[1] < uVar1, iVar3 = 0, puVar2[1] != uVar1)) {
            iVar3 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
          }
          if (iVar3 == 0) {
            if (puVar2 != (ulonglong *)0x0) {
              uVar1 = puVar2[2];
              *param_2 = uVar1;
              param_2[1] = uVar1;
              if (uVar1 != 0) {
                LOCK();
                *(int *)(uVar1 + 8) = *(int *)(uVar1 + 8) + 1;
                UNLOCK();
              }
              goto LAB_1401e6420;
            }
            break;
          }
        }
      }
    }
    *param_2 = 0;
    param_2[1] = 0;
  }
LAB_1401e6420:
  FUN_14034edd0(param_1 + 0x98);
  return param_2;
}



undefined8 * FUN_1401e6450(undefined8 *param_1,longlong param_2)

{
  undefined4 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  bool bVar5;
  
  bVar5 = DAT_1405d8848 != 5;
  *param_1 = Proud::CFastArray<>::vftable;
  if (bVar5) {
    FUN_14035b550();
  }
  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_1400179d0(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_14000d3f0(uVar4,uVar3,(longlong)iVar2);
    return param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



undefined8 * FUN_1401e64f0(undefined8 *param_1)

{
  undefined4 uVar1;
  undefined8 *puVar2;
  int iVar3;
  
  puVar2 = param_1 + 1;
  iVar3 = 0xb;
  *param_1 = 0;
  do {
    FUN_14000a170(puVar2);
    *(undefined4 *)(puVar2 + 0x15) = 0;
    puVar2 = (undefined8 *)((longlong)puVar2 + 0xac);
    iVar3 = iVar3 + -1;
  } while (-1 < iVar3);
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x103,uVar1,1);
  return param_1;
}



void FUN_1401e6560(longlong param_1,longlong param_2,longlong param_3,undefined4 param_4,
                  undefined4 param_5)

{
  int iVar1;
  
  FUN_14034ed40(param_1 + 0x818);
  iVar1 = *(int *)(param_1 + 4);
  if ((-1 < iVar1) && (iVar1 < 0xc)) {
    FUN_140090020((longlong)iVar1 * 0xac + 8 + param_1,param_2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 1;
    FUN_140203700(*(undefined8 *)(param_3 + 0xb50),param_4,param_5,param_3,param_2,
                  (int)*(short *)(param_2 + 0x1c),0,0,(int)*(short *)(param_2 + 0x1c));
  }
  FUN_14034edd0(param_1 + 0x818);
  return;
}



void FUN_1401e6630(longlong param_1,uint param_2,longlong param_3)

{
  longlong lVar1;
  longlong *plVar2;
  undefined2 local_res10 [4];
  longlong lVar3;
  undefined1 uVar4;
  undefined8 uVar5;
  undefined1 local_c0 [168];
  undefined4 local_18;
  
  uVar5 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x818;
  lVar3 = lVar1;
  FUN_14034ed40(lVar1);
  uVar4 = 1;
  if (param_2 < 0xc) {
    FUN_14000a170(local_c0);
    local_18 = 0;
    FUN_140090020((longlong)(int)param_2 * 0xac + 8 + param_1,local_c0);
    local_res10[0] = (undefined2)param_2;
    plVar2 = (longlong *)(*(longlong *)(param_3 + 0xb50) + 0x78);
    (**(code **)(*plVar2 + 0x7f0))
              (plVar2,*(undefined4 *)(param_3 + 8),&DAT_1405d85a0,local_res10,lVar3,uVar4,uVar5);
  }
  FUN_14034edd0(lVar1);
  return;
}



void FUN_1401e6700(undefined4 *param_1,undefined4 param_2,longlong param_3)

{
  code *pcVar1;
  bool bVar2;
  longlong lVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong *_Src;
  longlong lVar6;
  longlong *plVar7;
  longlong *plVar9;
  ulonglong uVar10;
  longlong *plVar11;
  undefined4 local_res10 [2];
  longlong *local_50;
  longlong *local_48;
  longlong *local_40;
  longlong *plVar8;
  
  *param_1 = param_2;
  local_res10[0] = param_2;
  FUN_14034ed40(param_1 + 0x206);
  plVar9 = (longlong *)0x0;
  local_50 = (longlong *)0x0;
  plVar7 = (longlong *)0x0;
  local_48 = (longlong *)0x0;
  plVar11 = (longlong *)0x0;
  local_40 = (longlong *)0x0;
  lVar6 = 0;
  _Src = (longlong *)(param_1 + 2);
  do {
    if ((*_Src == 0) && (_Src[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if (((bVar2) || ((int)_Src[3] != 0)) || (0 < *(short *)((longlong)_Src + 0x1c))) {
      if ((_Src < plVar7) && (plVar9 <= _Src)) {
        lVar3 = ((longlong)_Src - (longlong)plVar9) / 0x56 +
                ((longlong)_Src - (longlong)plVar9 >> 0x3f);
        if (plVar7 == plVar11) {
          lVar4 = ((longlong)plVar7 - (longlong)plVar9) / 0x56 +
                  ((longlong)plVar7 - (longlong)plVar9 >> 0x3f);
          uVar10 = (lVar4 >> 1) - (lVar4 >> 0x3f);
          if (0x17d05f417d05f40 < uVar10) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar10 = uVar10 + 1;
          uVar5 = ((longlong)plVar11 - (longlong)plVar9) / 0xac;
          if (uVar5 < uVar10) {
            if (0x17d05f417d05f41 - (uVar5 >> 1) < uVar5) {
              uVar5 = 0;
            }
            else {
              uVar5 = uVar5 + (uVar5 >> 1);
            }
            if (uVar5 < uVar10) {
              uVar5 = uVar10;
            }
            FUN_14008e560(&local_50,uVar5);
            plVar7 = local_48;
            plVar9 = local_50;
            plVar11 = local_40;
          }
        }
        plVar8 = (longlong *)0x0;
        if (plVar7 != (longlong *)0x0) {
          memcpy(plVar7,(void *)(((lVar3 >> 1) - (lVar3 >> 0x3f)) * 0xac + (longlong)plVar9),0xac);
          plVar8 = local_48;
          plVar9 = local_50;
          plVar11 = local_40;
        }
      }
      else {
        if (plVar7 == plVar11) {
          lVar3 = ((longlong)plVar7 - (longlong)plVar9) / 0x56 +
                  ((longlong)plVar7 - (longlong)plVar9 >> 0x3f);
          uVar10 = (lVar3 >> 1) - (lVar3 >> 0x3f);
          if (0x17d05f417d05f40 < uVar10) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar10 = uVar10 + 1;
          uVar5 = ((longlong)plVar11 - (longlong)plVar9) / 0xac;
          if (uVar5 < uVar10) {
            if (0x17d05f417d05f41 - (uVar5 >> 1) < uVar5) {
              uVar5 = 0;
            }
            else {
              uVar5 = uVar5 + (uVar5 >> 1);
            }
            if (uVar5 < uVar10) {
              uVar5 = uVar10;
            }
            FUN_14008e560(&local_50,uVar5);
            plVar7 = local_48;
            plVar9 = local_50;
            plVar11 = local_40;
          }
        }
        plVar8 = (longlong *)0x0;
        if (plVar7 != (longlong *)0x0) {
          memcpy(plVar7,_Src,0xac);
          plVar8 = local_48;
          plVar9 = local_50;
          plVar11 = local_40;
        }
      }
      plVar7 = (longlong *)((longlong)plVar8 + 0xac);
      local_48 = plVar7;
    }
    lVar6 = lVar6 + 1;
    _Src = (longlong *)((longlong)_Src + 0xac);
  } while (lVar6 < 0xc);
  if (plVar9 != plVar7) {
    plVar7 = (longlong *)(*(longlong *)(param_3 + 0xb50) + 0x78);
    (**(code **)(*plVar7 + 0x7e0))
              (plVar7,*(undefined4 *)(param_3 + 8),&DAT_1405d85a0,local_res10,&local_50);
    plVar9 = local_50;
  }
  if (plVar9 != (longlong *)0x0) {
    operator_delete(plVar9);
  }
  local_50 = (longlong *)0x0;
  local_48 = (longlong *)0x0;
  local_40 = (longlong *)0x0;
  FUN_14034edd0(param_1 + 0x206);
  return;
}



void FUN_1401e6a20(int *param_1,int param_2,undefined4 param_3,longlong param_4)

{
  int *piVar1;
  code *pcVar2;
  bool bVar3;
  longlong lVar4;
  longlong lVar5;
  ulonglong uVar6;
  longlong *_Src;
  longlong lVar7;
  longlong *plVar8;
  longlong *plVar10;
  ulonglong uVar11;
  longlong *plVar12;
  int local_res10 [2];
  undefined4 local_res18 [2];
  undefined8 uVar13;
  int *piVar14;
  undefined1 uVar15;
  longlong *local_50;
  longlong *local_48;
  longlong *local_40;
  longlong *plVar9;
  
  uVar13 = 0xfffffffffffffffe;
  *param_1 = param_2;
  piVar1 = param_1 + 0x206;
  local_res10[0] = param_2;
  local_res18[0] = param_3;
  piVar14 = piVar1;
  FUN_14034ed40(piVar1);
  uVar15 = 1;
  plVar10 = (longlong *)0x0;
  local_50 = (longlong *)0x0;
  plVar8 = (longlong *)0x0;
  local_48 = (longlong *)0x0;
  plVar12 = (longlong *)0x0;
  local_40 = (longlong *)0x0;
  lVar7 = 0;
  _Src = (longlong *)(param_1 + 2);
  do {
    if ((*_Src == 0) && (_Src[1] == 0)) {
      bVar3 = false;
    }
    else {
      bVar3 = true;
    }
    if (((bVar3) || ((int)_Src[3] != 0)) || (0 < *(short *)((longlong)_Src + 0x1c))) {
      if ((_Src < plVar8) && (plVar10 <= _Src)) {
        lVar4 = ((longlong)_Src - (longlong)plVar10) / 0x56 +
                ((longlong)_Src - (longlong)plVar10 >> 0x3f);
        if (plVar8 == plVar12) {
          lVar5 = ((longlong)plVar8 - (longlong)plVar10) / 0x56 +
                  ((longlong)plVar8 - (longlong)plVar10 >> 0x3f);
          uVar11 = (lVar5 >> 1) - (lVar5 >> 0x3f);
          if (0x17d05f417d05f40 < uVar11) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          uVar11 = uVar11 + 1;
          uVar6 = ((longlong)plVar12 - (longlong)plVar10) / 0xac;
          if (uVar6 < uVar11) {
            if (0x17d05f417d05f41 - (uVar6 >> 1) < uVar6) {
              uVar6 = 0;
            }
            else {
              uVar6 = uVar6 + (uVar6 >> 1);
            }
            if (uVar6 < uVar11) {
              uVar6 = uVar11;
            }
            FUN_14008e560(&local_50,uVar6);
            plVar8 = local_48;
            plVar10 = local_50;
            plVar12 = local_40;
          }
        }
        plVar9 = (longlong *)0x0;
        if (plVar8 != (longlong *)0x0) {
          memcpy(plVar8,(void *)(((lVar4 >> 1) - (lVar4 >> 0x3f)) * 0xac + (longlong)plVar10),0xac);
          plVar9 = local_48;
          plVar10 = local_50;
          plVar12 = local_40;
        }
      }
      else {
        if (plVar8 == plVar12) {
          lVar4 = ((longlong)plVar8 - (longlong)plVar10) / 0x56 +
                  ((longlong)plVar8 - (longlong)plVar10 >> 0x3f);
          uVar11 = (lVar4 >> 1) - (lVar4 >> 0x3f);
          if (0x17d05f417d05f40 < uVar11) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          uVar11 = uVar11 + 1;
          uVar6 = ((longlong)plVar12 - (longlong)plVar10) / 0xac;
          if (uVar6 < uVar11) {
            if (0x17d05f417d05f41 - (uVar6 >> 1) < uVar6) {
              uVar6 = 0;
            }
            else {
              uVar6 = uVar6 + (uVar6 >> 1);
            }
            if (uVar6 < uVar11) {
              uVar6 = uVar11;
            }
            FUN_14008e560(&local_50,uVar6);
            plVar8 = local_48;
            plVar10 = local_50;
            plVar12 = local_40;
          }
        }
        plVar9 = (longlong *)0x0;
        if (plVar8 != (longlong *)0x0) {
          memcpy(plVar8,_Src,0xac);
          plVar9 = local_48;
          plVar10 = local_50;
          plVar12 = local_40;
        }
      }
      plVar8 = (longlong *)((longlong)plVar9 + 0xac);
      local_48 = plVar8;
    }
    lVar7 = lVar7 + 1;
    _Src = (longlong *)((longlong)_Src + 0xac);
  } while (lVar7 < 0xc);
  if (plVar10 != plVar8) {
    if (local_res10[0] == 6) {
      plVar8 = (longlong *)(*(longlong *)(param_4 + 0xb50) + 0x78);
      (**(code **)(*plVar8 + 0x850))
                (plVar8,*(undefined4 *)(param_4 + 8),&DAT_1405d85a0,local_res10,local_res18,
                 &local_50);
      plVar10 = local_50;
    }
    else if (local_res10[0] == 7) {
      plVar8 = (longlong *)(*(longlong *)(param_4 + 0xb50) + 0x78);
      (**(code **)(*plVar8 + 0x860))
                (plVar8,*(undefined4 *)(param_4 + 8),&DAT_1405d85a0,local_res10,local_res18,
                 &local_50,uVar13,piVar14,uVar15);
      plVar10 = local_50;
    }
  }
  if (plVar10 != (longlong *)0x0) {
    operator_delete(plVar10);
  }
  local_50 = (longlong *)0x0;
  local_48 = (longlong *)0x0;
  local_40 = (longlong *)0x0;
  FUN_14034edd0(piVar1);
  return;
}



void FUN_1401e6d90(longlong param_1,undefined4 param_2,longlong param_3)

{
  code *pcVar1;
  bool bVar2;
  longlong lVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong *_Src;
  longlong lVar6;
  longlong *plVar7;
  longlong *plVar9;
  ulonglong uVar10;
  longlong *plVar11;
  undefined4 local_res10 [2];
  longlong *local_50;
  longlong *local_48;
  longlong *local_40;
  longlong *plVar8;
  
  local_res10[0] = param_2;
  FUN_14034ed40(param_1 + 0x818);
  plVar9 = (longlong *)0x0;
  local_50 = (longlong *)0x0;
  plVar7 = (longlong *)0x0;
  local_48 = (longlong *)0x0;
  plVar11 = (longlong *)0x0;
  local_40 = (longlong *)0x0;
  lVar6 = 0;
  _Src = (longlong *)(param_1 + 8);
  do {
    if ((*_Src == 0) && (_Src[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if (((bVar2) || ((int)_Src[3] != 0)) || (0 < *(short *)((longlong)_Src + 0x1c))) {
      if ((_Src < plVar7) && (plVar9 <= _Src)) {
        lVar3 = ((longlong)_Src - (longlong)plVar9) / 0x56 +
                ((longlong)_Src - (longlong)plVar9 >> 0x3f);
        if (plVar7 == plVar11) {
          lVar4 = ((longlong)plVar7 - (longlong)plVar9) / 0x56 +
                  ((longlong)plVar7 - (longlong)plVar9 >> 0x3f);
          uVar10 = (lVar4 >> 1) - (lVar4 >> 0x3f);
          if (0x17d05f417d05f40 < uVar10) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar10 = uVar10 + 1;
          uVar5 = ((longlong)plVar11 - (longlong)plVar9) / 0xac;
          if (uVar5 < uVar10) {
            if (0x17d05f417d05f41 - (uVar5 >> 1) < uVar5) {
              uVar5 = 0;
            }
            else {
              uVar5 = uVar5 + (uVar5 >> 1);
            }
            if (uVar5 < uVar10) {
              uVar5 = uVar10;
            }
            FUN_14008e560(&local_50,uVar5);
            plVar7 = local_48;
            plVar9 = local_50;
            plVar11 = local_40;
          }
        }
        plVar8 = (longlong *)0x0;
        if (plVar7 != (longlong *)0x0) {
          memcpy(plVar7,(void *)(((lVar3 >> 1) - (lVar3 >> 0x3f)) * 0xac + (longlong)plVar9),0xac);
          plVar8 = local_48;
          plVar9 = local_50;
          plVar11 = local_40;
        }
      }
      else {
        if (plVar7 == plVar11) {
          lVar3 = ((longlong)plVar7 - (longlong)plVar9) / 0x56 +
                  ((longlong)plVar7 - (longlong)plVar9 >> 0x3f);
          uVar10 = (lVar3 >> 1) - (lVar3 >> 0x3f);
          if (0x17d05f417d05f40 < uVar10) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar10 = uVar10 + 1;
          uVar5 = ((longlong)plVar11 - (longlong)plVar9) / 0xac;
          if (uVar5 < uVar10) {
            if (0x17d05f417d05f41 - (uVar5 >> 1) < uVar5) {
              uVar5 = 0;
            }
            else {
              uVar5 = uVar5 + (uVar5 >> 1);
            }
            if (uVar5 < uVar10) {
              uVar5 = uVar10;
            }
            FUN_14008e560(&local_50,uVar5);
            plVar7 = local_48;
            plVar9 = local_50;
            plVar11 = local_40;
          }
        }
        plVar8 = (longlong *)0x0;
        if (plVar7 != (longlong *)0x0) {
          memcpy(plVar7,_Src,0xac);
          plVar8 = local_48;
          plVar9 = local_50;
          plVar11 = local_40;
        }
      }
      plVar7 = (longlong *)((longlong)plVar8 + 0xac);
      local_48 = plVar7;
    }
    lVar6 = lVar6 + 1;
    _Src = (longlong *)((longlong)_Src + 0xac);
  } while (lVar6 < 0xc);
  if (plVar9 != plVar7) {
    plVar7 = (longlong *)(*(longlong *)(param_3 + 0xb50) + 0x78);
    (**(code **)(*plVar7 + 0x8a0))
              (plVar7,*(undefined4 *)(param_3 + 8),&DAT_1405d85a0,local_res10,&local_50);
    plVar9 = local_50;
  }
  if (plVar9 != (longlong *)0x0) {
    operator_delete(plVar9);
  }
  local_50 = (longlong *)0x0;
  local_48 = (longlong *)0x0;
  local_40 = (longlong *)0x0;
  FUN_14034edd0(param_1 + 0x818);
  return;
}



int FUN_1401e70a0(int *param_1)

{
  bool bVar1;
  int *piVar2;
  int iVar3;
  longlong lVar4;
  
  FUN_14034ed40(param_1 + 0x40a);
  iVar3 = 0;
  lVar4 = 0;
  piVar2 = param_1 + 8;
  do {
    if ((*(longlong *)(piVar2 + -7) == 0) && (*(longlong *)(piVar2 + -5) == 0)) {
      bVar1 = false;
    }
    else {
      bVar1 = true;
    }
    if (((!bVar1) && (piVar2[-1] == 0)) && ((short)*piVar2 < 1)) goto LAB_1401e7132;
    iVar3 = iVar3 + 1;
    lVar4 = lVar4 + 1;
    piVar2 = piVar2 + 0x2b;
  } while (lVar4 < 0x18);
  *param_1 = *param_1 + 1;
  iVar3 = *param_1;
  if (0x17 < iVar3) {
    iVar3 = 0;
  }
  *param_1 = iVar3;
LAB_1401e7132:
  FUN_14034edd0(param_1 + 0x40a);
  return iVar3;
}



void FUN_1401e7150(longlong param_1,longlong param_2,uint param_3)

{
  longlong lVar1;
  longlong *plVar2;
  undefined2 local_res18 [4];
  undefined1 local_c0 [168];
  undefined4 local_18;
  
  if (param_3 < 0x18) {
    FUN_14034ed40(param_1 + 0x1028);
    FUN_14000a170(local_c0);
    local_18 = 0;
    lVar1 = (longlong)(int)param_3 * 0xac + 4 + param_1;
    FUN_140090020(lVar1,local_c0);
    local_res18[0] = (undefined2)param_3;
    plVar2 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar2 + 0x590))
              (plVar2,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,lVar1);
    FUN_14034edd0(param_1 + 0x1028);
  }
  return;
}



undefined8 FUN_1401e7230(longlong param_1,uint param_2,int param_3,undefined8 param_4)

{
  longlong *plVar1;
  bool bVar2;
  
  FUN_14034ed40(param_1 + 0x1028);
  if (param_2 < 0x18) {
    plVar1 = (longlong *)((longlong)(int)param_2 * 0xac + 4 + param_1);
    if ((*plVar1 == 0) && (plVar1[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(int *)((longlong)(int)param_2 * 0xac + 0x1c + param_1) == param_3)) {
      FUN_140090020(param_4,plVar1);
      FUN_14034edd0(param_1 + 0x1028);
      return 1;
    }
  }
  FUN_14034edd0(param_1 + 0x1028);
  return 0;
}



void FUN_1401e7300(longlong param_1,longlong param_2)

{
  code *pcVar1;
  bool bVar2;
  longlong *plVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong *_Src;
  undefined2 uVar9;
  uint uVar10;
  undefined2 *puVar12;
  undefined2 *puVar13;
  longlong *plVar14;
  ulonglong uVar15;
  undefined2 local_res8 [4];
  longlong *local_70;
  longlong *local_68;
  longlong *local_60;
  undefined2 *local_50;
  undefined2 *local_48;
  undefined2 *local_40;
  ulonglong uVar11;
  
  uVar15 = 0;
  local_50 = (undefined2 *)0x0;
  local_48 = (undefined2 *)0x0;
  local_40 = (undefined2 *)0x0;
  local_70 = (longlong *)0x0;
  local_68 = (longlong *)0x0;
  local_60 = (longlong *)0x0;
  FUN_14034ed40(param_1 + 0x1028);
  uVar11 = uVar15;
  puVar12 = local_48;
  plVar14 = local_68;
  do {
    _Src = (longlong *)((longlong)(int)uVar11 * 0xac + 4 + param_1);
    if ((*_Src == 0) && (_Src[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if (bVar2) {
      uVar9 = (undefined2)uVar11;
      local_res8[0] = uVar9;
      if ((local_res8 < puVar12) && (local_50 <= local_res8)) {
        lVar6 = (longlong)local_res8 - (longlong)local_50;
        if (puVar12 == local_40) {
          uVar4 = (longlong)puVar12 - (longlong)local_50 >> 1;
          if (0x7ffffffffffffffe < uVar4) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar4 = uVar4 + 1;
          uVar5 = (longlong)local_40 - (longlong)local_50 >> 1;
          if (uVar5 < uVar4) {
            uVar8 = uVar15;
            if (uVar5 <= 0x7fffffffffffffff - (uVar5 >> 1)) {
              uVar8 = uVar5 + (uVar5 >> 1);
            }
            if (uVar8 < uVar4) {
              uVar8 = uVar4;
            }
            FUN_14008de90(&local_50,uVar8);
            puVar12 = local_48;
            plVar14 = local_68;
          }
        }
        puVar13 = (undefined2 *)0x0;
        if (puVar12 != (undefined2 *)0x0) {
          *puVar12 = local_50[lVar6 >> 1];
          puVar13 = local_48;
          plVar14 = local_68;
        }
      }
      else {
        if (puVar12 == local_40) {
          uVar4 = (longlong)puVar12 - (longlong)local_50 >> 1;
          if (0x7ffffffffffffffe < uVar4) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar4 = uVar4 + 1;
          uVar5 = (longlong)local_40 - (longlong)local_50 >> 1;
          if (uVar5 < uVar4) {
            uVar8 = uVar15;
            if (uVar5 <= 0x7fffffffffffffff - (uVar5 >> 1)) {
              uVar8 = uVar5 + (uVar5 >> 1);
            }
            if (uVar8 < uVar4) {
              uVar8 = uVar4;
            }
            FUN_14008de90(&local_50,uVar8);
            puVar12 = local_48;
            plVar14 = local_68;
          }
        }
        puVar13 = (undefined2 *)0x0;
        if (puVar12 != (undefined2 *)0x0) {
          *puVar12 = uVar9;
          puVar13 = local_48;
          plVar14 = local_68;
        }
      }
      local_48 = puVar13 + 1;
      if ((_Src < plVar14) && (local_70 <= _Src)) {
        lVar6 = ((longlong)_Src - (longlong)local_70) / 0x56 +
                ((longlong)_Src - (longlong)local_70 >> 0x3f);
        if (plVar14 == local_60) {
          lVar7 = ((longlong)plVar14 - (longlong)local_70) / 0x56 +
                  ((longlong)plVar14 - (longlong)local_70 >> 0x3f);
          uVar4 = (lVar7 >> 1) - (lVar7 >> 0x3f);
          if (0x17d05f417d05f40 < uVar4) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar4 = uVar4 + 1;
          uVar5 = ((longlong)local_60 - (longlong)local_70) / 0xac;
          if (uVar5 < uVar4) {
            uVar8 = uVar15;
            if (uVar5 <= 0x17d05f417d05f41 - (uVar5 >> 1)) {
              uVar8 = uVar5 + (uVar5 >> 1);
            }
            if (uVar8 < uVar4) {
              uVar8 = uVar4;
            }
            FUN_14008e560(&local_70,uVar8);
            plVar14 = local_68;
          }
        }
        _Src = (longlong *)(((lVar6 >> 1) - (lVar6 >> 0x3f)) * 0xac + (longlong)local_70);
        plVar3 = local_68;
      }
      else {
        plVar3 = local_68;
        if (plVar14 == local_60) {
          lVar6 = ((longlong)plVar14 - (longlong)local_70) / 0x56 +
                  ((longlong)plVar14 - (longlong)local_70 >> 0x3f);
          uVar4 = (lVar6 >> 1) - (lVar6 >> 0x3f);
          if (0x17d05f417d05f40 < uVar4) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar4 = uVar4 + 1;
          uVar5 = ((longlong)local_60 - (longlong)local_70) / 0xac;
          if (uVar5 < uVar4) {
            uVar8 = uVar15;
            if (uVar5 <= 0x17d05f417d05f41 - (uVar5 >> 1)) {
              uVar8 = uVar5 + (uVar5 >> 1);
            }
            if (uVar8 < uVar4) {
              uVar8 = uVar4;
            }
            FUN_14008e560(&local_70,uVar8);
            plVar14 = local_68;
            plVar3 = local_68;
          }
        }
      }
      local_68 = (longlong *)0x0;
      if (plVar14 != (longlong *)0x0) {
        local_68 = plVar3;
        memcpy(plVar14,_Src,0xac);
      }
      plVar14 = (longlong *)((longlong)local_68 + 0xac);
      puVar12 = local_48;
      local_68 = plVar14;
    }
    uVar10 = (int)uVar11 + 1;
    uVar11 = (ulonglong)uVar10;
  } while ((int)uVar10 < 0x18);
  if (local_50 != puVar12) {
    plVar14 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar14 + 0x6c0))
              (plVar14,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_50,&local_70);
  }
  FUN_14034edd0(param_1 + 0x1028);
  if (local_70 != (longlong *)0x0) {
    operator_delete(local_70);
  }
  local_70 = (longlong *)0x0;
  local_68 = (longlong *)0x0;
  local_60 = (longlong *)0x0;
  if (local_50 != (undefined2 *)0x0) {
    operator_delete(local_50);
  }
  return;
}



void FUN_1401e7790(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  short *psVar1;
  bool bVar2;
  longlong lVar3;
  uint *puVar4;
  longlong *plVar5;
  uint uVar6;
  int iVar7;
  undefined2 local_res18 [4];
  
  uVar6 = *(uint *)(param_3 + 0x18);
  lVar3 = FUN_140137690();
  if (*(longlong *)(lVar3 + 0x88) != 0) {
    for (puVar4 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                            ((ulonglong)uVar6 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0xa6)) {
      if ((puVar4[0xa8] == uVar6) && (*puVar4 == uVar6)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar6 = puVar4[0x4c];
          goto LAB_1401e7830;
        }
        break;
      }
    }
  }
  uVar6 = 1;
LAB_1401e7830:
  FUN_14034ed40(param_1 + 0x1028);
  if (1 < (int)uVar6) {
    iVar7 = 0;
    do {
      lVar3 = (longlong)iVar7 * 0xac;
      plVar5 = (longlong *)(lVar3 + 4 + param_1);
      if ((*plVar5 == 0) && (plVar5[1] == 0)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
      if ((((bVar2) || ((int)plVar5[3] != 0)) || (0 < *(short *)((longlong)plVar5 + 0x1c))) &&
         ((*(int *)(lVar3 + 0x1c + param_1) == *(int *)(param_3 + 0x18) &&
          (*(short *)(lVar3 + 0x20 + param_1) + param_4 <= (int)uVar6)))) {
        psVar1 = (short *)((longlong)iVar7 * 0xac + 0x20 + param_1);
        *psVar1 = *psVar1 + (short)param_4;
        local_res18[0] = (undefined2)iVar7;
        plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0x590))
                  (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,
                   (longlong)iVar7 * 0xac + 4 + param_1);
        goto LAB_1401e7971;
      }
      iVar7 = iVar7 + 1;
    } while (iVar7 < 0x18);
  }
  uVar6 = FUN_1401e70a0(param_1);
  if (uVar6 < 0x18) {
    lVar3 = (longlong)(int)uVar6 * 0xac + 4 + param_1;
    FUN_140090020(lVar3,param_3);
    *(short *)((longlong)(int)uVar6 * 0xac + 0x20 + param_1) = (short)param_4;
    local_res18[0] = (undefined2)uVar6;
    plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar5 + 0x590))
              (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,lVar3);
  }
LAB_1401e7971:
  FUN_14034edd0(param_1 + 0x1028);
  return;
}



void FUN_1401e79a0(longlong param_1,undefined8 *param_2)

{
  uint uVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  uint *puVar5;
  undefined8 *puVar6;
  short sVar7;
  short sVar8;
  
  FUN_14034ed40(param_1 + 0xf630);
  if ((*(short *)(param_2 + 2) == 3) || (*(short *)(param_2 + 2) == 4)) {
    uVar1 = *(uint *)((longlong)param_2 + 0x14);
    lVar3 = FUN_140137690();
    if (*(longlong *)(lVar3 + 0x88) != 0) {
      for (puVar5 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
          puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xa6)) {
        if ((puVar5[0xa8] == uVar1) && (*puVar5 == uVar1)) {
          if (puVar5 != (uint *)0x0) {
            sVar7 = *(short *)(param_2 + 2);
            if ((sVar7 < 0) || (4 < sVar7)) {
              FUN_140418da0(DAT_140607fd8,&DAT_1404ab720,*(undefined4 *)((longlong)param_2 + 0x14),
                            (int)sVar7,(int)*(short *)((longlong)param_2 + 0x12));
            }
            else {
              sVar8 = *(short *)((longlong)param_2 + 0x12);
              if ((sVar8 < 0) || (0x17 < sVar8)) {
                FUN_140418da0(DAT_140607fd8,&DAT_1404ab720,*(undefined4 *)((longlong)param_2 + 0x14)
                              ,(int)sVar7,(int)sVar8);
              }
              else {
                iVar2 = FUN_14011b180(((longlong)sVar8 + (longlong)sVar7 * 0x18) * 0xac + param_1);
                if (iVar2 == 0) {
                  FUN_140418da0(DAT_140607fd8,&DAT_1404ab760,
                                *(undefined4 *)((longlong)param_2 + 0x14),(int)sVar7,(int)sVar8);
                }
                else {
                  puVar6 = (undefined8 *)
                           (((longlong)sVar8 + (longlong)sVar7 * 0x18) * 0xac + param_1);
                  *(short *)((longlong)puVar6 + 0x14) = sVar7;
                  *(undefined2 *)((longlong)puVar6 + 0x16) =
                       *(undefined2 *)((longlong)param_2 + 0x12);
                  *puVar6 = *param_2;
                  puVar6[1] = param_2[1];
                  *(undefined4 *)(puVar6 + 3) = *(undefined4 *)((longlong)param_2 + 0x14);
                  *(undefined2 *)((longlong)puVar6 + 0x1c) = *(undefined2 *)(param_2 + 3);
                  *(undefined4 *)(puVar6 + 4) = *(undefined4 *)((longlong)param_2 + 0x1a);
                  *(undefined2 *)(puVar6 + 5) = *(undefined2 *)((longlong)param_2 + 0x1e);
                  if (*(int *)(((longlong)*(short *)((longlong)param_2 + 0x12) +
                               (longlong)*(short *)(param_2 + 2) * 0x18) * 0xac + 0x68 + param_1) ==
                      0) {
                    uVar4 = FUN_140137690();
                    lVar3 = FUN_140136770(uVar4,*(undefined4 *)((longlong)param_2 + 0x14));
                    if (lVar3 != 0) {
                      *(undefined4 *)
                       (((longlong)*(short *)((longlong)param_2 + 0x12) +
                        (longlong)*(short *)(param_2 + 2) * 0x18) * 0xac + 0x68 + param_1) =
                           *(undefined4 *)(lVar3 + 0x164);
                    }
                  }
                }
              }
            }
            goto LAB_1401e7be3;
          }
          break;
        }
      }
    }
    FUN_140418da0(DAT_140607fd8,&DAT_1404ab6d0,*(undefined4 *)((longlong)param_2 + 0x14),
                  (int)*(short *)(param_2 + 2),(int)*(short *)((longlong)param_2 + 0x12));
  }
LAB_1401e7be3:
  FUN_14034edd0(param_1 + 0xf630);
  return;
}



void FUN_1401e7c00(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  ushort uVar2;
  bool bVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  undefined8 uVar6;
  longlong lVar7;
  
  uVar6 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0xf630;
  lVar7 = lVar1;
  FUN_14034ed40(lVar1);
  uVar2 = *(ushort *)((longlong)param_2 + 0x12);
  if (((short)uVar2 < 0) || (0x77 < (short)uVar2)) {
    FUN_140418da0(DAT_140607fd8,&DAT_1404ab798,*(undefined4 *)((longlong)param_2 + 0x14),
                  (int)(short)uVar2,uVar6,lVar7,1);
    goto LAB_1401e7d3e;
  }
  if (uVar2 < 0x78) {
    plVar5 = (longlong *)((longlong)(short)uVar2 * 0xac + 0xa14c + param_1);
  }
  else {
    if (DAT_1406093a4 == 0) {
      FUN_140176d60(0);
    }
    DAT_1406093a4 = DAT_1406093a4 + 1;
    plVar5 = &DAT_14060d080;
  }
  if (*plVar5 == 0) {
    if (plVar5[1] != 0) goto LAB_1401e7caf;
    bVar3 = false;
  }
  else {
LAB_1401e7caf:
    bVar3 = true;
  }
  if (((!bVar3) && ((int)plVar5[3] == 0)) && (*(short *)((longlong)plVar5 + 0x1c) < 1)) {
    puVar4 = (undefined8 *)FUN_1401fbad0(param_1 + 0xa14c,(int)*(short *)((longlong)param_2 + 0x12))
    ;
    *(undefined2 *)((longlong)puVar4 + 0x14) = *(undefined2 *)(param_2 + 2);
    *(undefined2 *)((longlong)puVar4 + 0x16) = *(undefined2 *)((longlong)param_2 + 0x12);
    *puVar4 = *param_2;
    puVar4[1] = param_2[1];
    *(undefined4 *)(puVar4 + 3) = *(undefined4 *)((longlong)param_2 + 0x14);
    *(undefined2 *)((longlong)puVar4 + 0x1c) = *(undefined2 *)(param_2 + 3);
    *(undefined4 *)(puVar4 + 4) = *(undefined4 *)((longlong)param_2 + 0x1a);
    *(undefined2 *)(puVar4 + 5) = *(undefined2 *)((longlong)param_2 + 0x1e);
    *(int *)(param_1 + 0xa148) = (int)*(short *)((longlong)param_2 + 0x12);
  }
LAB_1401e7d3e:
  FUN_14034edd0(lVar1);
  return;
}



void FUN_1401e7d60(longlong param_1,longlong param_2)

{
  uint uVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  uint *puVar5;
  short sVar6;
  short sVar7;
  
  FUN_14034ed40(param_1 + 0xf630);
  sVar6 = *(short *)(param_2 + 0x10);
  if (((sVar6 == 0) || (sVar6 == 1)) || (sVar6 == 2)) {
    uVar1 = *(uint *)(param_2 + 0x14);
    lVar3 = FUN_140137690();
    if (*(longlong *)(lVar3 + 0x88) != 0) {
      for (puVar5 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
          puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xa6)) {
        if ((puVar5[0xa8] == uVar1) && (*puVar5 == uVar1)) {
          if (puVar5 != (uint *)0x0) {
            sVar6 = *(short *)(param_2 + 0x10);
            if ((sVar6 < 0) || (4 < sVar6)) {
              FUN_140418da0(DAT_140607fd8,&DAT_1404ab720,*(undefined4 *)(param_2 + 0x14),(int)sVar6,
                            (int)*(short *)(param_2 + 0x12));
            }
            else {
              sVar7 = *(short *)(param_2 + 0x12);
              if ((sVar7 < 0) || (0x17 < sVar7)) {
                FUN_140418da0(DAT_140607fd8,&DAT_1404ab720,*(undefined4 *)(param_2 + 0x14),
                              (int)sVar6,(int)sVar7);
              }
              else {
                iVar2 = FUN_14011b180(((longlong)sVar7 + (longlong)sVar6 * 0x18) * 0xac + param_1);
                if (iVar2 == 0) {
                  FUN_140418da0(DAT_140607fd8,&DAT_1404ab7c8,*(undefined4 *)(param_2 + 0x14),
                                (int)sVar6,(int)sVar7);
                }
                else {
                  FUN_1401e0370();
                  sVar6 = *(short *)(param_2 + 0x10);
                  if ((sVar6 == 0) || (sVar6 == 1)) {
                    FUN_140174ea0(((longlong)*(short *)(param_2 + 0x12) + (longlong)sVar6 * 0x18) *
                                  0xac + param_1);
                  }
                  if (*(int *)(((longlong)*(short *)(param_2 + 0x12) +
                               (longlong)*(short *)(param_2 + 0x10) * 0x18) * 0xac + 0x68 + param_1)
                      == 0) {
                    uVar4 = FUN_140137690();
                    lVar3 = FUN_140136770(uVar4,*(undefined4 *)(param_2 + 0x14));
                    if (lVar3 != 0) {
                      *(undefined4 *)
                       (((longlong)*(short *)(param_2 + 0x12) +
                        (longlong)*(short *)(param_2 + 0x10) * 0x18) * 0xac + 0x68 + param_1) =
                           *(undefined4 *)(lVar3 + 0x164);
                    }
                  }
                }
              }
            }
            goto LAB_1401e7f8c;
          }
          break;
        }
      }
    }
    FUN_140418da0(DAT_140607fd8,&DAT_1404ab6d0,*(undefined4 *)(param_2 + 0x14),
                  (int)*(short *)(param_2 + 0x10),(int)*(short *)(param_2 + 0x12));
  }
LAB_1401e7f8c:
  FUN_14034edd0(param_1 + 0xf630);
  return;
}



void FUN_1401e7fb0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  ushort uVar2;
  bool bVar3;
  longlong *plVar4;
  undefined8 uVar5;
  longlong lVar6;
  
  uVar5 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0xf630;
  lVar6 = lVar1;
  FUN_14034ed40(lVar1);
  uVar2 = *(ushort *)(param_2 + 0x12);
  if (((short)uVar2 < 0) || (0x77 < (short)uVar2)) {
    FUN_140418da0(DAT_140607fd8,&DAT_1404ab800,*(undefined4 *)(param_2 + 0x14),(int)(short)uVar2,
                  uVar5,lVar6,1);
    goto LAB_1401e80b8;
  }
  if (uVar2 < 0x78) {
    plVar4 = (longlong *)((longlong)(short)uVar2 * 0xac + 0x50a8 + param_1);
  }
  else {
    if (DAT_1406093a4 == 0) {
      FUN_140176d60(0);
    }
    DAT_1406093a4 = DAT_1406093a4 + 1;
    plVar4 = &DAT_14060d080;
  }
  if (*plVar4 == 0) {
    if (plVar4[1] != 0) goto LAB_1401e805f;
    bVar3 = false;
  }
  else {
LAB_1401e805f:
    bVar3 = true;
  }
  if (((!bVar3) && ((int)plVar4[3] == 0)) && (*(short *)((longlong)plVar4 + 0x1c) < 1)) {
    uVar5 = FUN_1401fbad0(param_1 + 0x50a8,(int)*(short *)(param_2 + 0x12));
    FUN_1401e0370(uVar5,param_2);
    *(int *)(param_1 + 0x50a4) = (int)*(short *)(param_2 + 0x12);
  }
LAB_1401e80b8:
  FUN_14034edd0(lVar1);
  return;
}



void FUN_1401e80d0(longlong param_1,int param_2)

{
  int *piVar1;
  undefined4 uVar2;
  
  FUN_14034ed40(param_1 + 0xf630);
  piVar1 = (int *)(param_1 + 0x50a0);
  *piVar1 = *piVar1 + param_2;
  uVar2 = *(undefined4 *)(param_1 + 0x50a0);
  if (*piVar1 < 0) {
    uVar2 = 0;
  }
  *(undefined4 *)(param_1 + 0x50a0) = uVar2;
  FUN_14034edd0(param_1 + 0xf630);
  return;
}



int FUN_1401e8130(longlong param_1,longlong param_2,int *param_3,int *param_4,longlong param_5)

{
  longlong lVar1;
  short *psVar2;
  int iVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  undefined2 local_res18 [4];
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  longlong local_30;
  undefined1 local_28;
  
  if (((*param_3 < 5) && (-1 < *param_4)) && (*param_4 < 0x18)) {
    uVar4 = FUN_140137690();
    FUN_140136a70(uVar4,*(undefined4 *)(param_5 + 0x18));
    lVar1 = param_1 + 0xf630;
    local_30 = lVar1;
    FUN_14034ed40(lVar1);
    local_28 = 1;
    lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
    if (*(int *)(lVar6 + 0x18 + param_1) == *(int *)(param_5 + 0x18)) {
      psVar2 = (short *)(lVar6 + 0x1c + param_1);
      *psVar2 = *psVar2 + *(short *)(param_5 + 0x1c);
      FUN_1401f3b10(param_1,(longlong)*param_3,
                    *(int *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x68 +
                            param_1) * (int)*(short *)(param_5 + 0x1c));
      FUN_140090020(param_5,((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
      local_50 = *(undefined4 *)(param_2 + 0x160);
      local_4c = *(undefined4 *)(param_2 + 0x164);
      local_48 = *(undefined4 *)(param_2 + 0x168);
      local_44 = *(undefined4 *)(param_2 + 0x16c);
      local_40 = *(undefined4 *)(param_2 + 0x170);
      local_3c = *(undefined4 *)(param_2 + 0x174);
      local_38 = *(undefined4 *)(param_2 + 0x178);
      local_34 = *(undefined4 *)(param_2 + 0x17c);
      iVar3 = *(int *)(param_2 + 0x284);
      if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)) {
        local_res18[0] = (undefined2)iVar3;
        plVar5 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        (**(code **)(*plVar5 + 0x140))
                  (plVar5,1,&DAT_1405d85a0,local_res18,&local_40,&local_50,
                   ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
      }
      iVar3 = *param_4;
      FUN_14034edd0(lVar1);
      return iVar3;
    }
    FUN_14034edd0(lVar1);
  }
  return -1;
}



int FUN_1401e8350(longlong param_1,uint *param_2,longlong param_3,undefined4 *param_4)

{
  longlong lVar1;
  int *piVar2;
  uint uVar3;
  bool bVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  int iVar8;
  longlong lVar9;
  undefined8 uVar10;
  
  uVar10 = 0xfffffffffffffffe;
  if ((int)*param_2 < 5) {
    lVar1 = param_1 + 0xf630;
    lVar6 = lVar1;
    FUN_14034ed40();
    iVar8 = 0;
    uVar3 = *param_2;
    do {
      plVar5 = (longlong *)(((longlong)iVar8 + (longlong)(int)uVar3 * 0x18) * 0xac + param_1);
      lVar9 = *plVar5;
      if ((lVar9 == 0) && (lVar9 = plVar5[1], lVar9 == 0)) {
        bVar4 = false;
      }
      else {
        bVar4 = true;
      }
      if (((!bVar4) && ((int)plVar5[3] == 0)) && (*(short *)((longlong)plVar5 + 0x1c) < 1)) {
        *(short *)(param_3 + 0x14) = (short)*param_2;
        *(short *)(param_3 + 0x16) = (short)iVar8;
        lVar7 = (longlong)iVar8;
        FUN_140090020((lVar7 + (longlong)(int)*param_2 * 0x18) * 0xac + param_1,param_3,lVar9,
                      (longlong)(int)uVar3 * 0x18,uVar10,lVar6,1);
        lVar6 = (lVar7 + (longlong)(int)*param_2 * 0x18) * 0xac;
        *param_4 = *(undefined4 *)(lVar6 + param_1);
        param_4[1] = *(undefined4 *)(lVar6 + 4 + param_1);
        param_4[2] = *(undefined4 *)(lVar6 + 8 + param_1);
        param_4[3] = *(undefined4 *)(lVar6 + 0xc + param_1);
        uVar3 = *param_2;
        lVar6 = (lVar7 + (longlong)(int)uVar3 * 0x18) * 0xac;
        if ((uVar3 < 5) &&
           (piVar2 = (int *)(param_1 + 0xf5f8 + (longlong)(int)uVar3 * 4),
           *piVar2 = *piVar2 + (int)*(short *)(lVar6 + 0x1c + param_1) *
                               *(int *)(lVar6 + 0x68 + param_1),
           *(longlong *)(param_1 + 0xf610) != 0)) {
          (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
                    (*(longlong **)(param_1 + 0xf610),
                     *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                     *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                     *(int *)(param_1 + 0xf5f8));
        }
        FUN_14034edd0(lVar1);
        return iVar8;
      }
      iVar8 = iVar8 + 1;
    } while (iVar8 < 0x18);
    *param_4 = 0;
    param_4[1] = 0;
    param_4[2] = 0;
    param_4[3] = 0;
    FUN_14034edd0(lVar1);
  }
  else {
    *param_4 = 0;
    param_4[1] = 0;
    param_4[2] = 0;
    param_4[3] = 0;
  }
  return -1;
}



uint FUN_1401e8550(longlong param_1)

{
  bool bVar1;
  longlong *plVar2;
  int iVar3;
  uint uVar4;
  
  uVar4 = 0;
  iVar3 = DAT_1406093a4;
  while( true ) {
    if (uVar4 < 0x78) {
      plVar2 = (longlong *)((longlong)(int)uVar4 * 0xac + 0xa14c + param_1);
    }
    else {
      if (iVar3 == 0) {
        FUN_140176d60(0);
        iVar3 = DAT_1406093a4;
      }
      DAT_1406093a4 = iVar3 + 1;
      plVar2 = &DAT_14060d080;
      iVar3 = DAT_1406093a4;
    }
    if ((*plVar2 == 0) && (plVar2[1] == 0)) {
      bVar1 = false;
    }
    else {
      bVar1 = true;
    }
    if (((!bVar1) && ((int)plVar2[3] == 0)) && (*(short *)((longlong)plVar2 + 0x1c) < 1)) break;
    uVar4 = uVar4 + 1;
    if (0x77 < (int)uVar4) {
      return 0xffffffff;
    }
  }
  return uVar4;
}



uint FUN_1401e8610(longlong param_1)

{
  bool bVar1;
  longlong *plVar2;
  int iVar3;
  uint uVar4;
  
  FUN_14034ed40(param_1 + 0xf630);
  uVar4 = 0;
  iVar3 = DAT_1406093a4;
  while( true ) {
    if (uVar4 < 0x78) {
      plVar2 = (longlong *)((longlong)(int)uVar4 * 0xac + 0x50a8 + param_1);
    }
    else {
      if (iVar3 == 0) {
        FUN_140176d60(0);
        iVar3 = DAT_1406093a4;
      }
      DAT_1406093a4 = iVar3 + 1;
      plVar2 = &DAT_14060d080;
      iVar3 = DAT_1406093a4;
    }
    if ((*plVar2 == 0) && (plVar2[1] == 0)) {
      bVar1 = false;
    }
    else {
      bVar1 = true;
    }
    if (((!bVar1) && ((int)plVar2[3] == 0)) && (*(short *)((longlong)plVar2 + 0x1c) < 1)) break;
    uVar4 = uVar4 + 1;
    if (0x77 < (int)uVar4) {
      FUN_14034edd0(param_1 + 0xf630);
      return 0xffffffff;
    }
  }
  FUN_14034edd0(param_1 + 0xf630);
  return uVar4;
}



undefined4 * FUN_1401e8710(longlong param_1,undefined4 *param_2,undefined4 *param_3,uint *param_4)

{
  bool bVar1;
  longlong lVar2;
  undefined4 *puVar3;
  uint *puVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  int iVar7;
  undefined8 *puVar8;
  uint uVar9;
  uint uVar10;
  
  uVar10 = param_3[6];
  lVar2 = FUN_140137690();
  if (*(longlong *)(lVar2 + 0x88) != 0) {
    for (puVar4 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                            ((ulonglong)uVar10 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0xa6)) {
      if ((puVar4[0xa8] == uVar10) && (*puVar4 == uVar10)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar10 = puVar4[0x4c];
          goto LAB_1401e87b6;
        }
        break;
      }
    }
  }
  uVar10 = 1;
LAB_1401e87b6:
  FUN_14034ed40(param_1 + 0xf630);
  puVar8 = &DAT_14060d080;
  if (1 < (int)uVar10) {
    uVar9 = 0;
    iVar7 = DAT_1406093a4;
    do {
      if (uVar9 < 0x78) {
        plVar5 = (longlong *)((longlong)(int)uVar9 * 0xac + 0xa14c + param_1);
      }
      else {
        if (iVar7 == 0) {
          FUN_140176d60(0);
          iVar7 = DAT_1406093a4;
        }
        DAT_1406093a4 = iVar7 + 1;
        plVar5 = &DAT_14060d080;
        iVar7 = DAT_1406093a4;
      }
      if ((*plVar5 == 0) && (plVar5[1] == 0)) {
        bVar1 = false;
      }
      else {
        bVar1 = true;
      }
      if (((bVar1) || ((int)plVar5[3] != 0)) || (0 < *(short *)((longlong)plVar5 + 0x1c))) {
        if (uVar9 < 0x78) {
          puVar6 = (undefined8 *)((longlong)(int)uVar9 * 0xac + 0xa14c + param_1);
        }
        else {
          if (iVar7 == 0) {
            FUN_140176d60(0);
            iVar7 = DAT_1406093a4;
          }
          DAT_1406093a4 = iVar7 + 1;
          puVar6 = &DAT_14060d080;
          iVar7 = DAT_1406093a4;
        }
        if (*(int *)(puVar6 + 3) == param_3[6]) {
          if (uVar9 < 0x78) {
            puVar6 = (undefined8 *)((longlong)(int)uVar9 * 0xac + 0xa14c + param_1);
          }
          else {
            if (iVar7 == 0) {
              FUN_140176d60(0);
              iVar7 = DAT_1406093a4;
            }
            DAT_1406093a4 = iVar7 + 1;
            puVar6 = &DAT_14060d080;
            iVar7 = DAT_1406093a4;
          }
          if ((int)*(short *)((longlong)puVar6 + 0x1c) < (int)uVar10) {
            if (uVar9 < 0x78) {
              puVar6 = (undefined8 *)((longlong)(int)uVar9 * 0xac + 0xa14c + param_1);
            }
            else {
              if (iVar7 == 0) {
                FUN_140176d60(0);
                iVar7 = DAT_1406093a4;
              }
              DAT_1406093a4 = iVar7 + 1;
              puVar6 = &DAT_14060d080;
              iVar7 = DAT_1406093a4;
            }
            if ((int)*(short *)((longlong)puVar6 + 0x1c) + (int)*(short *)(param_3 + 7) <
                (int)uVar10) {
              lVar2 = FUN_1401fbad0(param_1 + 0xa14c,uVar9);
              *(short *)(lVar2 + 0x1c) = *(short *)(lVar2 + 0x1c) + *(short *)(param_3 + 7);
              lVar2 = FUN_1401fbad0(param_1 + 0xa14c,uVar9);
              *(undefined4 *)(lVar2 + 0xa8) = 6;
              *param_4 = uVar9;
              puVar3 = (undefined4 *)FUN_1401fbad0(param_1 + 0xa14c,uVar9);
              *param_2 = *puVar3;
              param_2[1] = puVar3[1];
              param_2[2] = puVar3[2];
              param_2[3] = puVar3[3];
              goto LAB_1401e8a1c;
            }
          }
        }
      }
      uVar9 = uVar9 + 1;
    } while ((int)uVar9 < 0x78);
  }
  uVar10 = FUN_1401e8550(param_1);
  *(uint *)(param_1 + 0xa148) = uVar10;
  *param_4 = uVar10;
  uVar10 = *(uint *)(param_1 + 0xa148);
  if ((int)uVar10 < 0) {
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
  }
  else {
    if (uVar10 < 0x78) {
      puVar8 = (undefined8 *)((longlong)(int)uVar10 * 0xac + 0xa14c + param_1);
    }
    else {
      if (DAT_1406093a4 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a4 = DAT_1406093a4 + 1;
    }
    FUN_140090020(puVar8,param_3);
    *param_2 = *param_3;
    param_2[1] = param_3[1];
    param_2[2] = param_3[2];
    param_2[3] = param_3[3];
  }
LAB_1401e8a1c:
  FUN_14034edd0(param_1 + 0xf630);
  return param_2;
}



undefined4 * FUN_1401e8a50(longlong param_1,undefined4 *param_2,undefined4 *param_3,uint param_4)

{
  longlong *plVar1;
  bool bVar2;
  undefined8 uVar3;
  
  FUN_14034ed40(param_1 + 0xf630);
  if (param_4 < 0x78) {
    plVar1 = (longlong *)((longlong)(int)param_4 * 0xac + 0x50a8 + param_1);
    if ((*plVar1 == 0) && (plVar1[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if (((bVar2) || ((int)plVar1[3] != 0)) || (0 < *(short *)((longlong)plVar1 + 0x1c))) {
      *param_2 = 0;
      param_2[1] = 0;
      param_2[2] = 0;
      param_2[3] = 0;
    }
    else {
      *(short *)((longlong)param_3 + 0x16) = (short)param_4;
      *(undefined2 *)(param_3 + 5) = 5;
      uVar3 = FUN_1401fbad0(param_1 + 0x50a8,param_4);
      FUN_140090020(uVar3,param_3);
      *param_2 = *param_3;
      param_2[1] = param_3[1];
      param_2[2] = param_3[2];
      param_2[3] = param_3[3];
    }
  }
  else {
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
  }
  FUN_14034edd0(param_1 + 0xf630);
  return param_2;
}



undefined4 *
FUN_1401e8ba0(longlong param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)

{
  undefined4 uVar1;
  undefined8 *puVar2;
  
  FUN_14034ed40(param_1 + 0xf630);
  uVar1 = FUN_1401e8610(param_1);
  *(undefined4 *)(param_1 + 0x50a4) = uVar1;
  *param_4 = uVar1;
  if (*(int *)(param_1 + 0x50a4) < 0) {
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
  }
  else {
    *(short *)((longlong)param_3 + 0x16) = (short)uVar1;
    *(undefined2 *)(param_3 + 5) = 5;
    if (*(uint *)(param_1 + 0x50a4) < 0x78) {
      puVar2 = (undefined8 *)((longlong)(int)*(uint *)(param_1 + 0x50a4) * 0xac + 0x50a8 + param_1);
    }
    else {
      if (DAT_1406093a4 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a4 = DAT_1406093a4 + 1;
      puVar2 = &DAT_14060d080;
    }
    FUN_140090020(puVar2,param_3);
    *param_2 = *param_3;
    param_2[1] = param_3[1];
    param_2[2] = param_3[2];
    param_2[3] = param_3[3];
  }
  FUN_14034edd0(param_1 + 0xf630);
  return param_2;
}



void FUN_1401e8cc0(longlong param_1,int *param_2,int *param_3,longlong param_4)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  
  FUN_14034ed40(param_1 + 0xf630);
  if ((((-1 < *param_2) && (*param_2 < 5)) && (-1 < *param_3)) && (*param_3 < 0x18)) {
    iVar2 = *param_2;
    uVar3 = FUN_140137690();
    iVar1 = FUN_140136b30(uVar3,*(undefined4 *)(param_4 + 0x18));
    if ((iVar2 == iVar1) &&
       (iVar2 = FUN_14011b180(((longlong)*param_3 + (longlong)iVar2 * 0x18) * 0xac + param_1),
       iVar2 != 0)) {
      *(short *)(param_4 + 0x14) = (short)*param_2;
      *(short *)(param_4 + 0x16) = (short)*param_3;
      FUN_140090020(((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + param_1,param_4);
    }
  }
  FUN_14034edd0(param_1 + 0xf630);
  return;
}



int FUN_1401e8dc0(longlong param_1,longlong param_2,uint *param_3,undefined4 *param_4,
                 undefined4 *param_5)

{
  int *piVar1;
  bool bVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  uint *puVar6;
  short *psVar7;
  uint uVar8;
  longlong lVar9;
  int iVar10;
  int iVar11;
  
  if ((int)*param_3 < 5) {
    uVar8 = param_4[6];
    lVar4 = FUN_140137690();
    if (*(longlong *)(lVar4 + 0x88) != 0) {
      for (puVar6 = *(uint **)(*(longlong *)(lVar4 + 0x88) +
                              ((ulonglong)uVar8 % (ulonglong)*(uint *)(lVar4 + 0x98)) * 8);
          puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xa6)) {
        if ((puVar6[0xa8] == uVar8) && (*puVar6 == uVar8)) {
          if (puVar6 != (uint *)0x0) {
            if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar8 = puVar6[0x4c];
            goto LAB_1401e8e6f;
          }
          break;
        }
      }
    }
    uVar8 = 1;
LAB_1401e8e6f:
    iVar3 = -1;
    iVar11 = -1;
    lVar4 = param_1 + 0xf630;
    FUN_14034ed40(lVar4);
    if (1 < (int)uVar8) {
      iVar10 = 0;
      psVar7 = (short *)((longlong)(int)*param_3 * 0x1020 + 0x1c + param_1);
      do {
        if ((*(longlong *)(psVar7 + -0xe) == 0) && (*(longlong *)(psVar7 + -10) == 0)) {
          bVar2 = false;
        }
        else {
          bVar2 = true;
        }
        if (((bVar2) || (*(int *)(psVar7 + -2) != 0)) || (0 < *psVar7)) {
          if (((*(int *)(psVar7 + -2) == param_4[6]) && ((int)*psVar7 < (int)uVar8)) &&
             ((int)*(short *)(param_4 + 7) + (int)*psVar7 < (int)uVar8)) {
            lVar9 = (longlong)iVar10;
            psVar7 = (short *)((lVar9 + (longlong)(int)*param_3 * 0x18) * 0xac + 0x1c + param_1);
            *psVar7 = *psVar7 + *(short *)(param_4 + 7);
            *(undefined4 *)((lVar9 + (longlong)(int)*param_3 * 0x18) * 0xac + 0xa8 + param_1) = 6;
            FUN_1401f3b10(param_1,(longlong)(int)*param_3,
                          *(int *)((lVar9 + (longlong)(int)*param_3 * 0x18) * 0xac + 0x68 + param_1)
                          * (int)*(short *)(param_4 + 7));
            lVar5 = (lVar9 + (longlong)(int)*param_3 * 0x18) * 0xac;
            *param_5 = *(undefined4 *)(lVar5 + param_1);
            param_5[1] = *(undefined4 *)(lVar5 + 4 + param_1);
            param_5[2] = *(undefined4 *)(lVar5 + 8 + param_1);
            param_5[3] = *(undefined4 *)(lVar5 + 0xc + param_1);
            param_1 = (lVar9 + (longlong)(int)*param_3 * 0x18) * 0xac + param_1;
            iVar3 = (int)*(short *)(param_1 + 0x1c);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c8,0x33,param_2,param_1,
                          (int)*(short *)(param_4 + 7),0,iVar3 - *(short *)(param_4 + 7),iVar3);
            FUN_14034edd0(lVar4);
            return iVar10;
          }
        }
        else if (iVar11 == -1) {
          iVar11 = iVar10;
        }
        iVar10 = iVar10 + 1;
        psVar7 = psVar7 + 0x56;
      } while (iVar10 < 0x18);
      if (-1 < iVar11) {
        *(short *)(param_4 + 5) = (short)*param_3;
        *(short *)((longlong)param_4 + 0x16) = (short)iVar11;
        FUN_140090020(((longlong)iVar11 + (longlong)(int)*param_3 * 0x18) * 0xac + param_1,param_4);
        uVar8 = *param_3;
        lVar5 = ((longlong)iVar11 + (longlong)(int)uVar8 * 0x18) * 0xac;
        if ((uVar8 < 5) &&
           (piVar1 = (int *)(param_1 + 0xf5f8 + (longlong)(int)uVar8 * 4),
           *piVar1 = *piVar1 + (int)*(short *)(lVar5 + 0x1c + param_1) *
                               *(int *)(lVar5 + 0x68 + param_1),
           *(longlong *)(param_1 + 0xf610) != 0)) {
          (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
                    (*(longlong **)(param_1 + 0xf610),
                     *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                     *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                     *(int *)(param_1 + 0xf5f8));
        }
        *param_5 = *param_4;
        param_5[1] = param_4[1];
        param_5[2] = param_4[2];
        param_5[3] = param_4[3];
        FUN_14034edd0(lVar4);
        return iVar11;
      }
    }
    if ((int)*param_3 < 0) {
      *param_5 = 0;
      param_5[1] = 0;
      param_5[2] = 0;
      param_5[3] = 0;
    }
    else {
      iVar3 = FUN_1401e8350(param_1,param_3,param_4,param_5);
    }
    FUN_14034edd0(lVar4);
  }
  else {
    iVar3 = -1;
  }
  return iVar3;
}



undefined4 *
FUN_1401e9160(longlong param_1,undefined4 *param_2,longlong param_3,int *param_4,int *param_5,
             undefined4 *param_6,int *param_7,int *param_8)

{
  short sVar1;
  short sVar2;
  bool bVar3;
  int iVar4;
  undefined8 uVar5;
  int iVar6;
  short *psVar7;
  ulonglong uVar8;
  longlong lVar9;
  longlong lVar10;
  short sVar11;
  ulonglong uVar12;
  
  if ((((*param_4 < 0) || (4 < *param_4)) || (*param_5 < 0)) || (0x17 < *param_5)) {
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
  }
  else {
    uVar5 = FUN_140137690();
    iVar4 = FUN_140136a70(uVar5,param_6[6]);
    FUN_14034ed40(param_1 + 0xf630);
    uVar8 = 0;
    bVar3 = false;
    if (1 < iVar4) {
      psVar7 = (short *)((longlong)*param_4 * 0x1020 + 0x1c + param_1);
      uVar12 = uVar8;
      do {
        iVar6 = (int)uVar12;
        if ((*(int *)(psVar7 + -2) == param_6[6]) && (*psVar7 < iVar4)) {
          sVar1 = *(short *)(param_6 + 7);
          lVar10 = (longlong)iVar6;
          psVar7 = (short *)((lVar10 + (longlong)*param_4 * 0x18) * 0xac + 0x1c + param_1);
          *psVar7 = *psVar7 + sVar1;
          *(undefined4 *)((lVar10 + (longlong)*param_4 * 0x18) * 0xac + 0xa8 + param_1) = 6;
          if (iVar4 < *(short *)((lVar10 + (longlong)*param_4 * 0x18) * 0xac + 0x1c + param_1)) {
            *param_8 = iVar6;
            lVar9 = (lVar10 + (longlong)*param_4 * 0x18) * 0xac;
            sVar2 = *(short *)(lVar9 + 0x1c + param_1);
            iVar4 = sVar2 - iVar4;
            sVar11 = (short)iVar4;
            *(short *)(lVar9 + 0x1c + param_1) = sVar2 - sVar11;
            *(short *)(param_6 + 7) = sVar11;
            *(short *)(param_6 + 5) = (short)*param_4;
            *(short *)((longlong)param_6 + 0x16) = (short)*param_5;
            FUN_140090020(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,param_6)
            ;
            *(undefined4 *)
             (((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0xa8 + param_1) = 6;
            lVar10 = (lVar10 + (longlong)*param_4 * 0x18) * 0xac + param_1;
            iVar6 = (int)*(short *)(lVar10 + 0x1c);
            FUN_140203700(*(undefined8 *)(param_3 + 0xb50),0x1c8,0x33,param_3,lVar10,
                          (int)*(short *)(param_6 + 7),0,(iVar6 - sVar1) + iVar4,iVar6);
            *param_2 = *param_6;
            param_2[1] = param_6[1];
            param_2[2] = param_6[2];
            param_2[3] = param_6[3];
            FUN_14034edd0(param_1 + 0xf630);
            return param_2;
          }
          *param_7 = iVar6;
          FUN_140090020(param_6,(lVar10 + (longlong)*param_4 * 0x18) * 0xac + param_1);
          lVar9 = (lVar10 + (longlong)*param_4 * 0x18) * 0xac + param_1;
          iVar4 = (int)*(short *)(lVar9 + 0x1c);
          FUN_140203700(*(undefined8 *)(param_3 + 0xb50),0x1c8,0x33,param_3,lVar9,
                        (int)*(short *)(param_6 + 7),0,iVar4 - sVar1,iVar4);
          lVar10 = (lVar10 + (longlong)*param_4 * 0x18) * 0xac;
          *param_2 = *(undefined4 *)(lVar10 + param_1);
          param_2[1] = *(undefined4 *)(lVar10 + 4 + param_1);
          param_2[2] = *(undefined4 *)(lVar10 + 8 + param_1);
          param_2[3] = *(undefined4 *)(lVar10 + 0xc + param_1);
          FUN_14034edd0(param_1 + 0xf630);
          return param_2;
        }
        uVar12 = (ulonglong)(iVar6 + 1);
        uVar8 = uVar8 + 1;
        psVar7 = psVar7 + 0x56;
      } while ((longlong)uVar8 < 0x18);
    }
    lVar10 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac;
    if ((*(longlong *)(lVar10 + param_1) != 0) || (*(longlong *)(lVar10 + 8 + param_1) != 0)) {
      bVar3 = true;
    }
    if (!bVar3) {
      *(short *)(param_6 + 5) = (short)*param_4;
      *(short *)((longlong)param_6 + 0x16) = (short)*param_5;
      FUN_140090020(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,param_6);
      *(undefined4 *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0xa8 + param_1) = 6;
    }
    lVar10 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac;
    FUN_1401f3b10(param_1,(longlong)*param_4,
                  (int)*(short *)(lVar10 + 0x1c + param_1) * *(int *)(lVar10 + 0x68 + param_1));
    *param_2 = *param_6;
    param_2[1] = param_6[1];
    param_2[2] = param_6[2];
    param_2[3] = param_6[3];
    FUN_14034edd0(param_1 + 0xf630);
  }
  return param_2;
}



undefined8 FUN_1401e95b0(longlong param_1,longlong param_2,uint *param_3,ulonglong *param_4)

{
  longlong lVar1;
  uint uVar2;
  int iVar3;
  undefined8 uVar4;
  ulonglong *puVar5;
  longlong *plVar6;
  bool bVar7;
  undefined2 local_res18 [8];
  undefined2 local_e8 [2];
  undefined4 local_e4;
  undefined8 local_e0;
  longlong local_d8;
  undefined1 local_d0;
  undefined1 local_c8 [168];
  undefined4 local_20;
  
  local_e0 = 0xfffffffffffffffe;
  uVar2 = *param_3;
  if (((int)uVar2 < 0) || (0x77 < (int)uVar2)) {
    local_res18[0] = (undefined2)uVar2;
    local_e8[0] = 5;
    local_e4 = 0x16;
    plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar6 + 0xb0))
              (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_e4,local_e8,local_res18,
               param_4);
  }
  else {
    lVar1 = param_1 + 0xf630;
    local_d8 = lVar1;
    FUN_14034ed40(lVar1);
    local_d0 = 1;
    if (*param_3 < 0x78) {
      puVar5 = (ulonglong *)((longlong)(int)*param_3 * 0xac + 0x50a8 + param_1);
    }
    else {
      if (DAT_1406093a4 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a4 = DAT_1406093a4 + 1;
      puVar5 = &DAT_14060d080;
    }
    bVar7 = *puVar5 < *param_4;
    if ((*puVar5 == *param_4) && (bVar7 = puVar5[1] < param_4[1], puVar5[1] == param_4[1])) {
      iVar3 = 0;
    }
    else {
      iVar3 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
    }
    if (iVar3 == 0) {
      FUN_14000a170(local_c8);
      local_20 = 0;
      uVar4 = FUN_1401fbad0(param_1 + 0x50a8,*param_3);
      FUN_140090020(uVar4,local_c8);
      local_res18[0] = (undefined2)*param_3;
      local_e8[0] = 5;
      local_e4 = 1;
      plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar6 + 0xb0))
                (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_e4,local_e8,local_res18,
                 param_4);
      FUN_14034edd0(lVar1);
      return 1;
    }
    local_res18[0] = (undefined2)*param_3;
    local_e8[0] = 5;
    local_e4 = 0x17;
    plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar6 + 0xb0))
              (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_e4,local_e8,local_res18,
               param_4);
    FUN_14034edd0(lVar1);
  }
  return 0;
}



undefined8
FUN_1401e97f0(longlong param_1,longlong param_2,uint *param_3,int *param_4,ulonglong *param_5,
             uint *param_6)

{
  int *piVar1;
  uint uVar2;
  uint *puVar3;
  undefined8 *puVar4;
  int iVar5;
  int iVar6;
  uint *puVar7;
  uint *puVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong lVar11;
  uint uVar12;
  ulonglong *puVar13;
  bool bVar14;
  undefined2 local_res8 [4];
  undefined2 local_res18 [4];
  int *local_res20;
  undefined2 local_128;
  undefined2 local_126 [3];
  undefined4 local_120;
  undefined4 uStack_11c;
  undefined4 local_118;
  undefined4 uStack_114;
  undefined4 local_110;
  undefined4 local_10c;
  longlong *local_108;
  longlong *local_100;
  undefined8 local_f8;
  undefined1 local_f0 [168];
  undefined4 local_48;
  
  local_f8 = 0xfffffffffffffffe;
  uVar2 = *param_3;
  puVar13 = (ulonglong *)(((longlong)*param_4 + (longlong)(int)uVar2 * 0x18) * 0xac + param_1);
  puVar8 = (uint *)0x0;
  bVar14 = *puVar13 < *param_5;
  iVar5 = 0;
  if ((*puVar13 != *param_5) ||
     (bVar14 = puVar13[1] < param_5[1], iVar6 = iVar5, puVar13[1] != param_5[1])) {
    iVar6 = (1 - (uint)bVar14) - (uint)(bVar14 != 0);
  }
  local_res20 = param_4;
  if (iVar6 != 0) {
    local_126[0] = (undefined2)*param_4;
    local_128 = (undefined2)*param_3;
    local_110 = 0x17;
    plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar10 + 0xb0))
              (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_110,&local_128,local_126,
               param_5);
    return 0;
  }
  if (uVar2 < 5) {
    piVar1 = (int *)(param_1 + 0xf5f8 + (longlong)(int)uVar2 * 4);
    *piVar1 = *piVar1 - (int)*(short *)((longlong)puVar13 + 0x1c) * (int)puVar13[0xd];
    plVar10 = *(longlong **)(param_1 + 0xf610);
    if (plVar10 != (longlong *)0x0) {
      (**(code **)(*plVar10 + 8))
                (plVar10,*(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                         *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                         *(int *)(param_1 + 0xf5f8));
    }
  }
  lVar11 = ((longlong)*param_4 + (longlong)(int)*param_3 * 0x18) * 0xac;
  local_120 = *(undefined4 *)(lVar11 + 0x80 + param_1);
  uStack_11c = *(undefined4 *)(lVar11 + 0x84 + param_1);
  local_118 = *(undefined4 *)(lVar11 + 0x88 + param_1);
  uStack_114 = *(undefined4 *)(lVar11 + 0x8c + param_1);
  uVar2 = *(uint *)(lVar11 + 0x18 + param_1);
  *param_6 = uVar2;
  FUN_14000a170(local_f0);
  local_48 = 0;
  FUN_140090020(((longlong)*param_4 + (longlong)(int)*param_3 * 0x18) * 0xac + param_1);
  lVar11 = FUN_140137690();
  if (*(longlong *)(lVar11 + 0x88) != 0) {
    for (puVar7 = *(uint **)(*(longlong *)(lVar11 + 0x88) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar11 + 0x98)) * 8);
        puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xa6)) {
      if ((puVar7[0xa8] == uVar2) && (*puVar7 == uVar2)) {
        if (puVar7 != (uint *)0x0) {
          if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar12 = puVar7[0x18];
          goto LAB_1401e999e;
        }
        break;
      }
    }
  }
  uVar12 = 0;
LAB_1401e999e:
  lVar11 = FUN_1402e0270();
  if ((int)uVar2 < 1) {
LAB_1401e99ea:
    lVar11 = FUN_1402e0270();
    if ((int)uVar12 < 1) goto LAB_1401e9ad4;
    puVar7 = puVar8;
    if (*(longlong *)(lVar11 + 0x1f8) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(lVar11 + 0x1f8) +
                              ((ulonglong)uVar12 % (ulonglong)*(uint *)(lVar11 + 0x208)) * 8);
          (puVar7 = puVar8, puVar3 != (uint *)0x0 &&
          ((puVar3[4] != uVar12 || (puVar7 = puVar3, *puVar3 != uVar12))));
          puVar3 = *(uint **)(puVar3 + 2)) {
      }
    }
    if (puVar7 == (uint *)0x0) goto LAB_1401e9ad4;
  }
  else {
    puVar7 = puVar8;
    if (*(longlong *)(lVar11 + 0x1b0) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(lVar11 + 0x1b0) +
                              ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar11 + 0x1c0)) * 8);
          (puVar7 = puVar8, puVar3 != (uint *)0x0 &&
          ((puVar3[4] != uVar2 || (puVar7 = puVar3, *puVar3 != uVar2))));
          puVar3 = *(uint **)(puVar3 + 2)) {
      }
    }
    if (puVar7 == (uint *)0x0) goto LAB_1401e99ea;
  }
  uVar12 = *param_3;
  if ((((uVar12 == 1) || (uVar12 == 2)) || (uVar12 == 3)) || ((uVar12 == 4 || (uVar12 == 5)))) {
    lVar11 = FUN_140137690();
    if (*(longlong *)(lVar11 + 0x88) != 0) {
      for (puVar8 = *(uint **)(*(longlong *)(lVar11 + 0x88) +
                              ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar11 + 0x98)) * 8);
          puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 0xa6)) {
        if ((puVar8[0xa8] == uVar2) && (*puVar8 == uVar2)) {
          if (puVar8 != (uint *)0x0) {
            if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if ((puVar8 != (uint *)0xfffffffffffffff8) && (puVar8[0x36] != 3)) {
              FUN_1401a8bb0(param_2,uVar2);
            }
          }
          break;
        }
      }
    }
  }
LAB_1401e9ad4:
  if ((CONCAT44(uStack_11c,local_120) != 0) || (CONCAT44(uStack_114,local_118) != 0)) {
    iVar5 = 1;
  }
  if (iVar5 != 0) {
    FUN_140198570(param_2,&local_108);
    plVar10 = local_108;
    if (local_108 != (longlong *)0x0) {
      if (local_108 == local_100) {
        if (*local_108 != 0) {
          iVar5 = FUN_140208e30(*local_108,&local_120);
          FUN_1401b5650(param_2,iVar5);
          plVar9 = (longlong *)*plVar10;
          iVar6 = FUN_140208e30(plVar9,&local_120);
          if (iVar6 != 0) {
            (**(code **)(*plVar9 + 0x4c8))(plVar9,&local_120);
            FUN_140208c20(plVar9,iVar6);
          }
          iVar6 = *(int *)(param_2 + 0x284);
          if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
             (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
            local_res8[0] = (undefined2)iVar6;
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70)
            ;
            (**(code **)(*plVar9 + 0x700))(plVar9,1,&DAT_1405d85a0,local_res8,&local_120);
          }
          param_4 = local_res20;
          if (iVar5 != 0) {
            FUN_1401b1e70(param_2,&local_120,1);
            param_4 = local_res20;
          }
        }
      }
      else {
        iVar5 = DAT_14060804c + 1;
        bVar14 = DAT_14060804c == 0;
        DAT_14060804c = iVar5;
        if (bVar14) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar10 != (longlong *)0x0) {
      if (plVar10 == local_100) {
        LOCK();
        plVar10 = plVar10 + 1;
        *(int *)plVar10 = (int)*plVar10 + -1;
        UNLOCK();
        if ((int)*plVar10 == 0) {
          puVar4 = (undefined8 *)*local_108;
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)(puVar4,1);
          }
          operator_delete(local_108);
        }
      }
      else {
        iVar5 = DAT_140608054 + 1;
        bVar14 = DAT_140608054 == 0;
        DAT_140608054 = iVar5;
        if (bVar14) {
          FUN_140176d60(1);
        }
      }
    }
  }
  local_res20 = (int *)CONCAT62(local_res20._2_6_,(short)*param_4);
  local_res18[0] = (undefined2)*param_3;
  local_10c = 1;
  plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
  (**(code **)(*plVar10 + 0xb0))
            (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_10c,local_res18,&local_res20
             ,param_5);
  return 1;
}



undefined4
FUN_1401e9d60(longlong param_1,longlong param_2,int *param_3,uint *param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined4 uVar2;
  uint uVar3;
  longlong *plVar4;
  undefined2 local_res18 [8];
  undefined2 local_38 [2];
  undefined4 local_34;
  undefined8 local_30;
  longlong local_28;
  undefined1 local_20;
  
  local_30 = 0xfffffffffffffffe;
  if ((*param_3 < 1) || (4 < *param_3)) {
    uVar3 = (uint)(ushort)*param_4;
    local_34 = 0x15;
  }
  else {
    uVar3 = *param_4;
    if ((-1 < (int)uVar3) && ((int)uVar3 < 0x18)) {
      lVar1 = param_1 + 0xf630;
      local_28 = lVar1;
      FUN_14034ed40(lVar1);
      local_20 = 1;
      uVar2 = FUN_1401e97f0(param_1,param_2,param_3,param_4,param_5,local_res18);
      FUN_14034edd0(lVar1);
      return uVar2;
    }
    local_34 = 0x16;
  }
  local_res18[0] = (undefined2)uVar3;
  local_38[0] = (undefined2)*param_3;
  plVar4 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
  (**(code **)(*plVar4 + 0xb0))
            (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_34,local_38,local_res18,
             param_5);
  return 0;
}



bool FUN_1401e9e80(longlong param_1,uint param_2,int param_3)

{
  longlong lVar1;
  uint uVar2;
  bool bVar3;
  DWORD DVar4;
  longlong lVar5;
  HANDLE pvVar6;
  HANDLE pvVar7;
  longlong *plVar8;
  uint *puVar9;
  undefined8 *puVar10;
  int iVar11;
  longlong lVar12;
  uint uVar13;
  short *psVar14;
  short *psVar15;
  int iVar16;
  
  iVar16 = 0;
  lVar1 = param_1 + 0xf630;
  FUN_14034ed40(lVar1);
  iVar11 = 0;
  psVar15 = (short *)(param_1 + 0x1c);
  do {
    lVar12 = 0;
    psVar14 = psVar15;
    do {
      uVar13 = *(uint *)(psVar14 + -2);
      if ((0 < (int)uVar13) && (0 < *psVar14)) {
        lVar5 = FUN_140137690();
        if (*(longlong *)(lVar5 + 0x88) != 0) {
          for (puVar9 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                                  ((ulonglong)uVar13 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
              puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0xa6)) {
            if ((puVar9[0xa8] == uVar13) && (*puVar9 == uVar13)) {
              if (puVar9 != (uint *)0x0) {
                if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                if ((0 < (int)puVar9[0x18]) && (puVar9[0x18] == param_2)) {
                  iVar16 = iVar16 + *psVar14;
                }
              }
              break;
            }
          }
        }
      }
      lVar12 = lVar12 + 1;
      psVar14 = psVar14 + 0x56;
    } while (lVar12 < 0x18);
    iVar11 = iVar11 + 1;
    psVar15 = psVar15 + 0x810;
  } while (iVar11 < 5);
  uVar13 = 0;
  do {
    if (uVar13 < 0x78) {
      plVar8 = (longlong *)((longlong)(int)uVar13 * 0xac + 0x50a8 + param_1);
    }
    else {
      if ((DAT_1406093a4 == 0) &&
         (pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                               (HANDLE)0x0), pvVar6 != (HANDLE)0x0)) {
        DVar4 = GetCurrentProcessId();
        pvVar7 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar7,DVar4,pvVar6,0x2000,0,0,0);
        CloseHandle(pvVar6);
      }
      DAT_1406093a4 = DAT_1406093a4 + 1;
      plVar8 = &DAT_14060d080;
    }
    if ((*plVar8 == 0) && (plVar8[1] == 0)) {
      bVar3 = false;
    }
    else {
      bVar3 = true;
    }
    if (((bVar3) || ((int)plVar8[3] != 0)) || (0 < *(short *)((longlong)plVar8 + 0x1c))) {
      if (uVar13 < 0x78) {
        puVar10 = (undefined8 *)((longlong)(int)uVar13 * 0xac + 0x50a8 + param_1);
      }
      else {
        if ((DAT_1406093a4 == 0) &&
           (pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0), pvVar6 != (HANDLE)0x0)) {
          GetCurrentProcessId();
          pvVar7 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar7);
          CloseHandle(pvVar6);
        }
        DAT_1406093a4 = DAT_1406093a4 + 1;
        puVar10 = &DAT_14060d080;
      }
      if (0 < *(int *)(puVar10 + 3)) {
        if (uVar13 < 0x78) {
          puVar10 = (undefined8 *)((longlong)(int)uVar13 * 0xac + 0x50a8 + param_1);
        }
        else {
          if ((DAT_1406093a4 == 0) &&
             (pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                   (HANDLE)0x0), pvVar6 != (HANDLE)0x0)) {
            GetCurrentProcessId();
            pvVar7 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar7);
            CloseHandle(pvVar6);
          }
          DAT_1406093a4 = DAT_1406093a4 + 1;
          puVar10 = &DAT_14060d080;
        }
        if (0 < *(short *)((longlong)puVar10 + 0x1c)) {
          if (uVar13 < 0x78) {
            puVar10 = (undefined8 *)((longlong)(int)uVar13 * 0xac + 0x50a8 + param_1);
          }
          else {
            if (DAT_1406093a4 == 0) {
              FUN_140176d60(0);
            }
            DAT_1406093a4 = DAT_1406093a4 + 1;
            puVar10 = &DAT_14060d080;
          }
          uVar2 = *(uint *)(puVar10 + 3);
          lVar12 = FUN_140137690();
          if (*(longlong *)(lVar12 + 0x88) != 0) {
            for (puVar9 = *(uint **)(*(longlong *)(lVar12 + 0x88) +
                                    ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar12 + 0x98)) * 8);
                puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0xa6)) {
              if ((puVar9[0xa8] == uVar2) && (*puVar9 == uVar2)) {
                if (puVar9 != (uint *)0x0) {
                  if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                    FUN_14000d450(0x80004005);
                  }
                  if ((0 < (int)puVar9[0x18]) && (puVar9[0x18] == param_2)) {
                    if (uVar13 < 0x78) {
                      puVar10 = (undefined8 *)((longlong)(int)uVar13 * 0xac + 0x50a8 + param_1);
                    }
                    else {
                      if (DAT_1406093a4 == 0) {
                        FUN_140176d60(0);
                      }
                      DAT_1406093a4 = DAT_1406093a4 + 1;
                      puVar10 = &DAT_14060d080;
                    }
                    iVar16 = iVar16 + *(short *)((longlong)puVar10 + 0x1c);
                  }
                }
                break;
              }
            }
          }
        }
      }
    }
    uVar13 = uVar13 + 1;
    if (0x77 < (int)uVar13) {
      if (iVar16 < param_3) {
        FUN_14034edd0(lVar1);
      }
      else {
        FUN_14034edd0(lVar1);
      }
      return iVar16 >= param_3;
    }
  } while( true );
}



undefined8 FUN_1401ea2f0(longlong param_1,int param_2,int param_3)

{
  longlong lVar1;
  bool bVar2;
  int iVar3;
  undefined8 uVar4;
  longlong *plVar5;
  longlong lVar6;
  short *psVar7;
  int iVar8;
  
  uVar4 = FUN_140137690();
  iVar3 = FUN_140136b30(uVar4,param_2);
  lVar1 = param_1 + 0xf630;
  FUN_14034ed40(lVar1);
  iVar8 = 0;
  if ((((iVar3 == 1) || (iVar3 == 2)) || (iVar3 == 3)) || (iVar3 == 4)) {
    psVar7 = (short *)((longlong)iVar3 * 0x1020 + 0x1c + param_1);
    lVar6 = 0x18;
    do {
      if ((*(int *)(psVar7 + -2) == param_2) && (0 < *psVar7)) {
        iVar8 = iVar8 + *psVar7;
      }
      psVar7 = psVar7 + 0x56;
      lVar6 = lVar6 + -1;
    } while (lVar6 != 0);
    if (param_3 <= iVar8) {
      FUN_14034edd0(lVar1);
      return 1;
    }
  }
  else if (iVar3 == 5) {
    iVar3 = 0;
    param_1 = param_1 + 0x50a8;
    do {
      plVar5 = (longlong *)FUN_1401fbad0(param_1,iVar3);
      if ((*plVar5 == 0) && (plVar5[1] == 0)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
      if ((((bVar2) || ((int)plVar5[3] != 0)) || (0 < *(short *)((longlong)plVar5 + 0x1c))) &&
         ((lVar6 = FUN_1401fbad0(param_1,iVar3), *(int *)(lVar6 + 0x18) == param_2 &&
          (lVar6 = FUN_1401fbad0(param_1,iVar3), 0 < *(short *)(lVar6 + 0x1c))))) {
        lVar6 = FUN_1401fbad0(param_1,iVar3);
        iVar8 = iVar8 + *(short *)(lVar6 + 0x1c);
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < 0x78);
    if (param_3 <= iVar8) {
      FUN_14034edd0(lVar1);
      return 1;
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001401eb687)
// WARNING: Removing unreachable block (ram,0x0001401eaa8f)

bool FUN_1401ea470(longlong param_1,longlong param_2,uint param_3,int param_4,int param_5)

{
  int *piVar1;
  longlong lVar2;
  int iVar3;
  DWORD DVar4;
  longlong lVar5;
  HANDLE pvVar6;
  HANDLE pvVar7;
  uint *puVar8;
  longlong *plVar9;
  undefined8 *puVar10;
  undefined8 *puVar11;
  int iVar12;
  undefined8 *puVar13;
  undefined4 *puVar14;
  undefined2 uVar15;
  int iVar16;
  undefined8 *puVar17;
  undefined2 uVar18;
  uint uVar19;
  bool bVar20;
  undefined4 local_res8 [2];
  longlong local_res10;
  uint local_res18;
  undefined4 local_res20 [2];
  undefined4 *in_stack_fffffffffffffe80;
  undefined4 *in_stack_fffffffffffffe88;
  uint uVar21;
  undefined4 *in_stack_fffffffffffffe90;
  undefined4 uVar22;
  undefined4 uVar23;
  undefined4 *in_stack_fffffffffffffe98;
  uint uVar24;
  undefined4 uVar25;
  undefined4 local_158 [2];
  int local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  longlong local_118;
  undefined1 local_110;
  undefined8 local_108;
  undefined1 local_100 [168];
  undefined4 local_58;
  
  local_108 = 0xfffffffffffffffe;
  if (param_5 != 0) {
    param_4 = 200;
  }
  local_118 = param_1 + 0xf630;
  local_res10 = param_2;
  local_res18 = param_3;
  local_150 = param_4;
  FUN_14034ed40(local_118);
  local_110 = 1;
  uVar19 = 1;
  do {
    iVar16 = 0;
    do {
      puVar14 = (undefined4 *)(((longlong)iVar16 + (longlong)(int)uVar19 * 0x18) * 0xac + param_1);
      uVar21 = puVar14[6];
      if (0 < (int)uVar21) {
        lVar5 = FUN_140137690();
        iVar12 = local_150;
        lVar2 = local_res10;
        if (*(longlong *)(lVar5 + 0x88) != 0) {
          for (puVar8 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                                  ((ulonglong)uVar21 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
              puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 0xa6)) {
            if ((puVar8[0xa8] == uVar21) && (*puVar8 == uVar21)) {
              if (puVar8 != (uint *)0x0) goto LAB_1401ea558;
              break;
            }
          }
        }
        puVar8 = (uint *)0x0;
LAB_1401ea558:
        if (((puVar8 != (uint *)0x0) && (0 < (int)puVar8[0x18])) && (puVar8[0x18] == local_res18)) {
          iVar3 = (int)*(short *)(puVar14 + 7);
          uVar18 = (undefined2)uVar19;
          uVar15 = (undefined2)iVar16;
          uVar24 = (uint)((ulonglong)in_stack_fffffffffffffe98 >> 0x20);
          uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffe90 >> 0x20);
          uVar21 = (uint)((ulonglong)in_stack_fffffffffffffe88 >> 0x20);
          if (local_150 <= iVar3) {
            puVar14 = (undefined4 *)
                      (((longlong)iVar16 + (longlong)(int)uVar19 * 0x18) * 0xac + param_1);
            FUN_140203700(*(undefined8 *)(local_res10 + 0xb50),0x19e,7,local_res10,puVar14,local_150
                          ,(ulonglong)uVar21 << 0x20,CONCAT44(uVar22,(int)*(short *)(puVar14 + 7)),
                          CONCAT44(uVar24,*(short *)(puVar14 + 7) - local_150));
            *(short *)(puVar14 + 7) = *(short *)(puVar14 + 7) - (short)iVar12;
            if ((uVar19 < 5) &&
               (piVar1 = (int *)(param_1 + 0xf5f8 + (longlong)(int)uVar19 * 4),
               *piVar1 = *piVar1 - puVar14[0x1a] * iVar12, *(longlong *)(param_1 + 0xf610) != 0)) {
              (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
                        (*(longlong **)(param_1 + 0xf610),
                         *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                         *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                         *(int *)(param_1 + 0xf5f8));
            }
            param_5._0_2_ = uVar15;
            if (*(short *)(puVar14 + 7) < 1) {
              local_128 = *puVar14;
              local_124 = puVar14[1];
              local_120 = puVar14[2];
              local_11c = puVar14[3];
              FUN_14000a170(local_100);
              local_58 = 0;
              FUN_140090020(puVar14,local_100);
              local_res20[0] = CONCAT22(local_res20[0]._2_2_,uVar18);
              local_res8[0] = 1;
              plVar9 = (longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x78);
              (**(code **)(*plVar9 + 0xb0))
                        (plVar9,*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_res8,local_res20,
                         &param_5,&local_128);
              local_14c = *(undefined4 *)(lVar2 + 0x160);
              local_148 = *(undefined4 *)(lVar2 + 0x164);
              local_144 = *(undefined4 *)(lVar2 + 0x168);
              local_140 = *(undefined4 *)(lVar2 + 0x16c);
              local_13c = *(undefined4 *)(lVar2 + 0x170);
              local_138 = *(undefined4 *)(lVar2 + 0x174);
              local_134 = *(undefined4 *)(lVar2 + 0x178);
              local_130 = *(undefined4 *)(lVar2 + 0x17c);
              iVar16 = *(int *)(lVar2 + 0x284);
              local_res20[0] = 0xffffffff;
              local_res8[0] = 0xfffffffa;
              if (((-1 < iVar16) && (iVar16 < *(short *)(*(longlong *)(lVar2 + 0xb50) + 700))) &&
                 (lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4c0), lVar5 != 0)) {
                param_5._0_2_ = (undefined2)iVar16;
                plVar9 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(lVar2 + 0x288) * 8) + 0x70
                         );
                (**(code **)(*plVar9 + 0x130))
                          (plVar9,1,&DAT_1405d85a0,&param_5,&local_13c,&local_14c,&local_128,
                           local_res8,local_res20);
              }
            }
            else {
              puVar14[0x2a] = 6;
              local_res20[0] = CONCAT22(local_res20[0]._2_2_,uVar18);
              plVar9 = (longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x78);
              (**(code **)(*plVar9 + 0xe0))
                        (plVar9,*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_res20,&param_5,
                         puVar14);
            }
            FUN_14034edd0(param_1 + 0xf630);
            return true;
          }
          in_stack_fffffffffffffe98 = (undefined4 *)((ulonglong)uVar24 << 0x20);
          in_stack_fffffffffffffe90 = (undefined4 *)CONCAT44(uVar22,iVar3);
          FUN_140203700(*(undefined8 *)(local_res10 + 0xb50),0x19e,7,local_res10,puVar14,iVar3,
                        (ulonglong)uVar21 << 0x20,in_stack_fffffffffffffe90,
                        in_stack_fffffffffffffe98);
          if (param_5 == 0) {
            local_150 = local_150 - *(short *)(puVar14 + 7);
          }
          if ((uVar19 < 5) &&
             (piVar1 = (int *)(param_1 + 0xf5f8 + (longlong)(int)uVar19 * 4),
             *piVar1 = *piVar1 - puVar14[0x1a] * (int)*(short *)(puVar14 + 7),
             *(longlong *)(param_1 + 0xf610) != 0)) {
            (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
                      (*(longlong **)(param_1 + 0xf610),
                       *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                       *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                       *(int *)(param_1 + 0xf5f8));
          }
          *(undefined2 *)(puVar14 + 7) = 0;
          local_128 = *puVar14;
          local_124 = puVar14[1];
          local_120 = puVar14[2];
          local_11c = puVar14[3];
          FUN_14000a170(local_100);
          local_58 = 0;
          FUN_140090020(puVar14,local_100);
          local_res20[0] = CONCAT22(local_res20[0]._2_2_,uVar15);
          local_res8[0] = CONCAT22(local_res8[0]._2_2_,uVar18);
          local_158[0] = 1;
          plVar9 = (longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x78);
          in_stack_fffffffffffffe88 = &local_128;
          in_stack_fffffffffffffe80 = local_res20;
          (**(code **)(*plVar9 + 0xb0))
                    (plVar9,*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_158,local_res8,
                     in_stack_fffffffffffffe80,in_stack_fffffffffffffe88);
          local_13c = *(undefined4 *)(lVar2 + 0x160);
          local_138 = *(undefined4 *)(lVar2 + 0x164);
          local_134 = *(undefined4 *)(lVar2 + 0x168);
          local_130 = *(undefined4 *)(lVar2 + 0x16c);
          local_14c = *(undefined4 *)(lVar2 + 0x170);
          local_148 = *(undefined4 *)(lVar2 + 0x174);
          local_144 = *(undefined4 *)(lVar2 + 0x178);
          local_140 = *(undefined4 *)(lVar2 + 0x17c);
          iVar12 = *(int *)(lVar2 + 0x284);
          local_res8[0] = 0xffffffff;
          local_158[0] = 0xfffffffa;
          if (((-1 < iVar12) && (iVar12 < *(short *)(*(longlong *)(lVar2 + 0xb50) + 700))) &&
             (lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4c0), lVar5 != 0)) {
            local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)iVar12);
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(lVar2 + 0x288) * 8) + 0x70);
            in_stack_fffffffffffffe98 = local_res8;
            in_stack_fffffffffffffe90 = local_158;
            in_stack_fffffffffffffe88 = &local_128;
            in_stack_fffffffffffffe80 = &local_13c;
            (**(code **)(*plVar9 + 0x130))
                      (plVar9,1,&DAT_1405d85a0,local_res20,&local_14c,in_stack_fffffffffffffe80,
                       in_stack_fffffffffffffe88,in_stack_fffffffffffffe90,in_stack_fffffffffffffe98
                      );
          }
        }
      }
      lVar2 = local_res10;
      iVar16 = iVar16 + 1;
    } while (iVar16 < 0x18);
    uVar19 = uVar19 + 1;
  } while ((int)uVar19 < 5);
  uVar19 = 0;
  puVar17 = &DAT_14060d080;
  iVar16 = DAT_1406093a4;
  do {
    if (uVar19 < 0x78) {
      plVar9 = (longlong *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
    }
    else {
      if (iVar16 == 0) {
        in_stack_fffffffffffffe88 = (undefined4 *)0x0;
        in_stack_fffffffffffffe80 =
             (undefined4 *)CONCAT44((int)((ulonglong)in_stack_fffffffffffffe80 >> 0x20),0x80);
        pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,(HANDLE)0x0)
        ;
        iVar16 = DAT_1406093a4;
        if (pvVar6 != (HANDLE)0x0) {
          DVar4 = GetCurrentProcessId();
          pvVar7 = GetCurrentProcess();
          in_stack_fffffffffffffe88 = (undefined4 *)0x0;
          in_stack_fffffffffffffe80 = (undefined4 *)0x0;
          MiniDumpWriteDump(pvVar7,DVar4,pvVar6,0x2000,0,0,0);
          CloseHandle(pvVar6);
          iVar16 = DAT_1406093a4;
        }
      }
      iVar16 = iVar16 + 1;
      plVar9 = &DAT_14060d080;
      DAT_1406093a4 = iVar16;
    }
    bVar20 = false;
    if ((*plVar9 != 0) || (plVar9[1] != 0)) {
      bVar20 = true;
    }
    if (((bVar20) || ((int)plVar9[3] != 0)) || (0 < *(short *)((longlong)plVar9 + 0x1c))) {
      if (uVar19 < 0x78) {
        puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
      }
      else {
        if (iVar16 == 0) {
          in_stack_fffffffffffffe88 = (undefined4 *)0x0;
          in_stack_fffffffffffffe80 =
               (undefined4 *)CONCAT44((int)((ulonglong)in_stack_fffffffffffffe80 >> 0x20),0x80);
          pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                               (HANDLE)0x0);
          iVar16 = DAT_1406093a4;
          if (pvVar6 != (HANDLE)0x0) {
            GetCurrentProcessId();
            pvVar7 = GetCurrentProcess();
            in_stack_fffffffffffffe88 = (undefined4 *)0x0;
            in_stack_fffffffffffffe80 = (undefined4 *)0x0;
            MiniDumpWriteDump(pvVar7);
            CloseHandle(pvVar6);
            iVar16 = DAT_1406093a4;
          }
        }
        iVar16 = iVar16 + 1;
        puVar10 = &DAT_14060d080;
        DAT_1406093a4 = iVar16;
      }
      if (0 < *(int *)(puVar10 + 3)) {
        if (uVar19 < 0x78) {
          puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
        }
        else {
          if (iVar16 == 0) {
            in_stack_fffffffffffffe88 = (undefined4 *)0x0;
            in_stack_fffffffffffffe80 =
                 (undefined4 *)CONCAT44((int)((ulonglong)in_stack_fffffffffffffe80 >> 0x20),0x80);
            pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0);
            iVar16 = DAT_1406093a4;
            if (pvVar6 != (HANDLE)0x0) {
              GetCurrentProcessId();
              pvVar7 = GetCurrentProcess();
              in_stack_fffffffffffffe88 = (undefined4 *)0x0;
              in_stack_fffffffffffffe80 = (undefined4 *)0x0;
              MiniDumpWriteDump(pvVar7);
              CloseHandle(pvVar6);
              iVar16 = DAT_1406093a4;
            }
          }
          iVar16 = iVar16 + 1;
          puVar10 = &DAT_14060d080;
          DAT_1406093a4 = iVar16;
        }
        if (0 < *(short *)((longlong)puVar10 + 0x1c)) {
          if (uVar19 < 0x78) {
            puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
          }
          else {
            if (iVar16 == 0) {
              FUN_140176d60(0);
              iVar16 = DAT_1406093a4;
            }
            DAT_1406093a4 = iVar16 + 1;
            puVar10 = &DAT_14060d080;
          }
          uVar21 = *(uint *)(puVar10 + 3);
          lVar5 = FUN_140137690();
          uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffe80 >> 0x20);
          uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffe90 >> 0x20);
          if (*(longlong *)(lVar5 + 0x88) != 0) {
            for (puVar8 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                                    ((ulonglong)uVar21 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
                puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 0xa6)) {
              if ((puVar8[0xa8] == uVar21) && (*puVar8 == uVar21)) {
                if (puVar8 != (uint *)0x0) goto LAB_1401ead68;
                break;
              }
            }
          }
          puVar8 = (uint *)0x0;
LAB_1401ead68:
          iVar16 = DAT_1406093a4;
          if (((puVar8 != (uint *)0x0) && (0 < (int)puVar8[0x18])) && (puVar8[0x18] == local_res18))
          {
            if (uVar19 < 0x78) {
              puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
            }
            else {
              if (DAT_1406093a4 == 0) {
                FUN_140176d60();
              }
              DAT_1406093a4 = DAT_1406093a4 + 1;
              puVar10 = &DAT_14060d080;
            }
            iVar16 = local_150;
            uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffffe98 >> 0x20);
            uVar15 = (undefined2)uVar19;
            if (local_150 <= *(short *)((longlong)puVar10 + 0x1c)) {
              if (uVar19 < 0x78) {
                puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
              }
              else {
                if (DAT_1406093a4 == 0) {
                  FUN_140176d60();
                }
                DAT_1406093a4 = DAT_1406093a4 + 1;
                puVar10 = &DAT_14060d080;
              }
              if (uVar19 < 0x78) {
                puVar13 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
              }
              else {
                if (DAT_1406093a4 == 0) {
                  FUN_140176d60();
                }
                DAT_1406093a4 = DAT_1406093a4 + 1;
                puVar13 = &DAT_14060d080;
              }
              if (uVar19 < 0x78) {
                puVar11 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
              }
              else {
                if (DAT_1406093a4 == 0) {
                  FUN_140176d60();
                }
                DAT_1406093a4 = DAT_1406093a4 + 1;
                puVar11 = &DAT_14060d080;
              }
              FUN_140203700(*(undefined8 *)(lVar2 + 0xb50),0x19e,7,lVar2,puVar11,
                            CONCAT44(uVar22,iVar16),
                            (ulonglong)in_stack_fffffffffffffe88 & 0xffffffff00000000,
                            CONCAT44(uVar23,(int)*(short *)((longlong)puVar13 + 0x1c)),
                            CONCAT44(uVar25,*(short *)((longlong)puVar10 + 0x1c) - iVar16));
              if (uVar19 < 0x78) {
                puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
              }
              else {
                if (DAT_1406093a4 == 0) {
                  FUN_140176d60(0);
                }
                DAT_1406093a4 = DAT_1406093a4 + 1;
                puVar10 = &DAT_14060d080;
              }
              iVar12 = DAT_1406093a4;
              *(short *)((longlong)puVar10 + 0x1c) =
                   *(short *)((longlong)puVar10 + 0x1c) - (short)iVar16;
              if (uVar19 < 0x78) {
                puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
              }
              else {
                if (iVar12 == 0) {
                  FUN_140176d60(0);
                  iVar12 = DAT_1406093a4;
                }
                iVar12 = iVar12 + 1;
                puVar10 = &DAT_14060d080;
                DAT_1406093a4 = iVar12;
              }
              param_5._0_2_ = uVar15;
              if (*(short *)((longlong)puVar10 + 0x1c) < 1) {
                if (uVar19 < 0x78) {
                  puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
                }
                else {
                  if (iVar12 == 0) {
                    FUN_140176d60(0);
                    iVar12 = DAT_1406093a4;
                  }
                  iVar12 = iVar12 + 1;
                  puVar10 = &DAT_14060d080;
                  DAT_1406093a4 = iVar12;
                }
                local_128 = *(undefined4 *)puVar10;
                local_124 = *(undefined4 *)((longlong)puVar10 + 4);
                local_120 = *(undefined4 *)(puVar10 + 1);
                local_11c = *(undefined4 *)((longlong)puVar10 + 0xc);
                FUN_14000a170(local_100);
                local_58 = 0;
                if (uVar19 < 0x78) {
                  puVar17 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
                }
                else {
                  if (iVar12 == 0) {
                    FUN_140176d60(0);
                    iVar12 = DAT_1406093a4;
                  }
                  DAT_1406093a4 = iVar12 + 1;
                }
                FUN_140090020(puVar17,local_100);
                local_res20[0] = CONCAT22(local_res20[0]._2_2_,5);
                local_res8[0] = 1;
                plVar9 = (longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x78);
                (**(code **)(*plVar9 + 0xb0))
                          (plVar9,*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_res8,local_res20,
                           &param_5,&local_128);
                local_14c = *(undefined4 *)(lVar2 + 0x160);
                local_148 = *(undefined4 *)(lVar2 + 0x164);
                local_144 = *(undefined4 *)(lVar2 + 0x168);
                local_140 = *(undefined4 *)(lVar2 + 0x16c);
                local_13c = *(undefined4 *)(lVar2 + 0x170);
                local_138 = *(undefined4 *)(lVar2 + 0x174);
                local_134 = *(undefined4 *)(lVar2 + 0x178);
                local_130 = *(undefined4 *)(lVar2 + 0x17c);
                iVar16 = *(int *)(lVar2 + 0x284);
                local_res20[0] = 0xffffffff;
                local_res8[0] = 0xfffffffa;
                if (((-1 < iVar16) && (iVar16 < *(short *)(*(longlong *)(lVar2 + 0xb50) + 700))) &&
                   (lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4c0), lVar5 != 0)) {
                  param_5._0_2_ = (undefined2)iVar16;
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(lVar2 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar9 + 0x130))
                            (plVar9,1,&DAT_1405d85a0,&param_5,&local_13c,&local_14c,&local_128,
                             local_res8,local_res20);
                }
              }
              else {
                local_res20[0] = CONCAT22(local_res20[0]._2_2_,5);
                if (uVar19 < 0x78) {
                  puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
                }
                else {
                  if (iVar12 == 0) {
                    FUN_140176d60(0);
                    iVar12 = DAT_1406093a4;
                  }
                  DAT_1406093a4 = iVar12 + 1;
                  puVar10 = &DAT_14060d080;
                }
                plVar9 = (longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x78);
                (**(code **)(*plVar9 + 0xe0))
                          (plVar9,*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_res20,&param_5,
                           puVar10);
                if (uVar19 < 0x78) {
                  puVar17 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
                }
                else {
                  if (DAT_1406093a4 == 0) {
                    FUN_140176d60(0);
                  }
                  DAT_1406093a4 = DAT_1406093a4 + 1;
                }
                local_14c = *(undefined4 *)(lVar2 + 0x160);
                local_148 = *(undefined4 *)(lVar2 + 0x164);
                local_144 = *(undefined4 *)(lVar2 + 0x168);
                local_140 = *(undefined4 *)(lVar2 + 0x16c);
                local_13c = *(undefined4 *)(lVar2 + 0x170);
                local_138 = *(undefined4 *)(lVar2 + 0x174);
                local_134 = *(undefined4 *)(lVar2 + 0x178);
                local_130 = *(undefined4 *)(lVar2 + 0x17c);
                iVar16 = *(int *)(lVar2 + 0x284);
                if (((-1 < iVar16) && (iVar16 < *(short *)(*(longlong *)(lVar2 + 0xb50) + 700))) &&
                   (lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4c0), lVar5 != 0)) {
                  param_5._0_2_ = (undefined2)iVar16;
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(lVar2 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar9 + 0x140))
                            (plVar9,1,&DAT_1405d85a0,&param_5,&local_13c,&local_14c,puVar17);
                }
              }
              FUN_14034edd0(local_118);
              return true;
            }
            if (uVar19 < 0x78) {
              puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
            }
            else {
              if (DAT_1406093a4 == 0) {
                FUN_140176d60();
              }
              DAT_1406093a4 = DAT_1406093a4 + 1;
              puVar10 = &DAT_14060d080;
            }
            if (uVar19 < 0x78) {
              puVar13 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
            }
            else {
              if (DAT_1406093a4 == 0) {
                FUN_140176d60();
              }
              DAT_1406093a4 = DAT_1406093a4 + 1;
              puVar13 = &DAT_14060d080;
            }
            if (uVar19 < 0x78) {
              puVar11 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
            }
            else {
              if (DAT_1406093a4 == 0) {
                FUN_140176d60();
              }
              DAT_1406093a4 = DAT_1406093a4 + 1;
              puVar11 = &DAT_14060d080;
            }
            in_stack_fffffffffffffe98 =
                 (undefined4 *)((ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000);
            in_stack_fffffffffffffe90 =
                 (undefined4 *)CONCAT44(uVar23,(int)*(short *)((longlong)puVar10 + 0x1c));
            in_stack_fffffffffffffe88 =
                 (undefined4 *)((ulonglong)in_stack_fffffffffffffe88 & 0xffffffff00000000);
            in_stack_fffffffffffffe80 =
                 (undefined4 *)CONCAT44(uVar22,(int)*(short *)((longlong)puVar13 + 0x1c));
            FUN_140203700(*(undefined8 *)(lVar2 + 0xb50),0x19e,7,lVar2,puVar11,
                          in_stack_fffffffffffffe80,in_stack_fffffffffffffe88,
                          in_stack_fffffffffffffe90,in_stack_fffffffffffffe98);
            if (param_5 == 0) {
              if (uVar19 < 0x78) {
                puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
              }
              else {
                if (DAT_1406093a4 == 0) {
                  FUN_140176d60(0);
                }
                DAT_1406093a4 = DAT_1406093a4 + 1;
                puVar10 = &DAT_14060d080;
              }
              local_150 = iVar16 - *(short *)((longlong)puVar10 + 0x1c);
            }
            if (uVar19 < 0x78) {
              puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
            }
            else {
              if (DAT_1406093a4 == 0) {
                FUN_140176d60(0);
              }
              DAT_1406093a4 = DAT_1406093a4 + 1;
              puVar10 = &DAT_14060d080;
            }
            iVar16 = DAT_1406093a4;
            *(undefined2 *)((longlong)puVar10 + 0x1c) = 0;
            if (uVar19 < 0x78) {
              puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
            }
            else {
              if (iVar16 == 0) {
                FUN_140176d60(0);
                iVar16 = DAT_1406093a4;
              }
              iVar16 = iVar16 + 1;
              puVar10 = &DAT_14060d080;
              DAT_1406093a4 = iVar16;
            }
            if (*(short *)((longlong)puVar10 + 0x1c) < 1) {
              if (uVar19 < 0x78) {
                puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
              }
              else {
                if (iVar16 == 0) {
                  FUN_140176d60(0);
                  iVar16 = DAT_1406093a4;
                }
                iVar16 = iVar16 + 1;
                puVar10 = &DAT_14060d080;
                DAT_1406093a4 = iVar16;
              }
              local_128 = *(undefined4 *)puVar10;
              local_124 = *(undefined4 *)((longlong)puVar10 + 4);
              local_120 = *(undefined4 *)(puVar10 + 1);
              local_11c = *(undefined4 *)((longlong)puVar10 + 0xc);
              FUN_14000a170(local_100);
              local_58 = 0;
              if (uVar19 < 0x78) {
                puVar10 = (undefined8 *)((longlong)(int)uVar19 * 0xac + 0x50a8 + param_1);
              }
              else {
                if (iVar16 == 0) {
                  FUN_140176d60(0);
                  iVar16 = DAT_1406093a4;
                }
                DAT_1406093a4 = iVar16 + 1;
                puVar10 = &DAT_14060d080;
              }
              FUN_140090020(puVar10,local_100);
              local_res20[0] = CONCAT22(local_res20[0]._2_2_,uVar15);
              local_res8[0] = CONCAT22(local_res8[0]._2_2_,5);
              local_158[0] = 1;
              plVar9 = (longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x78);
              in_stack_fffffffffffffe88 = &local_128;
              in_stack_fffffffffffffe80 = local_res20;
              (**(code **)(*plVar9 + 0xb0))
                        (plVar9,*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_158,local_res8,
                         in_stack_fffffffffffffe80,in_stack_fffffffffffffe88);
              local_14c = *(undefined4 *)(lVar2 + 0x160);
              local_148 = *(undefined4 *)(lVar2 + 0x164);
              local_144 = *(undefined4 *)(lVar2 + 0x168);
              local_140 = *(undefined4 *)(lVar2 + 0x16c);
              local_13c = *(undefined4 *)(lVar2 + 0x170);
              local_138 = *(undefined4 *)(lVar2 + 0x174);
              local_134 = *(undefined4 *)(lVar2 + 0x178);
              local_130 = *(undefined4 *)(lVar2 + 0x17c);
              iVar12 = *(int *)(lVar2 + 0x284);
              local_res8[0] = 0xffffffff;
              local_158[0] = 0xfffffffa;
              iVar16 = DAT_1406093a4;
              if (((-1 < iVar12) && (iVar12 < *(short *)(*(longlong *)(lVar2 + 0xb50) + 700))) &&
                 (lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4c0), lVar5 != 0)) {
                local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)iVar12);
                plVar9 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(lVar2 + 0x288) * 8) + 0x70
                         );
                in_stack_fffffffffffffe98 = local_res8;
                in_stack_fffffffffffffe90 = local_158;
                in_stack_fffffffffffffe88 = &local_128;
                in_stack_fffffffffffffe80 = &local_14c;
                (**(code **)(*plVar9 + 0x130))
                          (plVar9,1,&DAT_1405d85a0,local_res20,&local_13c,in_stack_fffffffffffffe80,
                           in_stack_fffffffffffffe88,in_stack_fffffffffffffe90,
                           in_stack_fffffffffffffe98);
                iVar16 = DAT_1406093a4;
              }
            }
          }
        }
      }
    }
    uVar19 = uVar19 + 1;
    if (0x77 < (int)uVar19) {
      bVar20 = param_5 == 0;
      if (bVar20) {
        FUN_14034edd0(local_118);
      }
      else {
        FUN_14034edd0(local_118);
      }
      return !bVar20;
    }
  } while( true );
}



undefined8 FUN_1401eb6d0(longlong param_1,longlong param_2,int param_3,undefined4 param_4)

{
  short *psVar1;
  int *piVar2;
  short sVar3;
  short sVar4;
  int iVar5;
  bool bVar6;
  uint uVar7;
  undefined8 uVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined4 *puVar11;
  short *psVar12;
  int iVar13;
  undefined4 local_res8 [2];
  undefined4 *in_stack_fffffffffffffe90;
  undefined4 uVar14;
  undefined4 *in_stack_fffffffffffffe98;
  undefined4 *in_stack_fffffffffffffea0;
  undefined4 uVar15;
  undefined4 *in_stack_fffffffffffffea8;
  undefined4 local_148 [2];
  undefined4 local_140 [2];
  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;
  undefined4 local_10c;
  longlong local_108;
  undefined1 local_100;
  undefined8 local_f8;
  undefined1 local_f0 [168];
  undefined4 local_48;
  
  local_f8 = 0xfffffffffffffffe;
  local_108 = param_1 + 0xf630;
  FUN_14034ed40(local_108);
  local_100 = 1;
  uVar8 = FUN_140137690();
  uVar7 = FUN_140136b30(uVar8,param_3);
  if ((((uVar7 == 1) || (uVar7 == 2)) || (uVar7 == 3)) || (uVar7 == 4)) {
    iVar13 = 0;
    psVar12 = (short *)((longlong)(int)uVar7 * 0x1020 + 0x1c + param_1);
    do {
      if (*(int *)(psVar12 + -2) == param_3) {
        psVar1 = psVar12 + -0xe;
        in_stack_fffffffffffffea8 =
             (undefined4 *)((ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000);
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1af,0x70,param_2,psVar1,(int)*psVar12,
                      (ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000,(int)*psVar12,
                      in_stack_fffffffffffffea8);
        if ((uVar7 < 5) &&
           (piVar2 = (int *)(param_1 + 0xf5f8 + (longlong)(int)uVar7 * 4),
           *piVar2 = *piVar2 - *(int *)(psVar12 + 0x26) * (int)*psVar12,
           *(longlong *)(param_1 + 0xf610) != 0)) {
          (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
                    (*(longlong **)(param_1 + 0xf610),
                     *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                     *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                     *(int *)(param_1 + 0xf5f8));
        }
        local_138 = *(undefined4 *)psVar1;
        local_134 = *(undefined4 *)(psVar12 + -0xc);
        local_130 = *(undefined4 *)(psVar12 + -10);
        local_12c = *(undefined4 *)(psVar12 + -8);
        FUN_14000a170(local_f0);
        local_48 = 0;
        FUN_140090020(psVar1,local_f0);
        local_res8[0]._0_2_ = (undefined2)iVar13;
        local_148[0] = CONCAT22(local_148[0]._2_2_,(short)uVar7);
        local_140[0] = 1;
        plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        in_stack_fffffffffffffe98 = &local_138;
        (**(code **)(*plVar9 + 0xb0))
                  (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_140,local_148,local_res8
                   ,in_stack_fffffffffffffe98);
        local_128 = *(undefined4 *)(param_2 + 0x160);
        local_124 = *(undefined4 *)(param_2 + 0x164);
        local_120 = *(undefined4 *)(param_2 + 0x168);
        local_11c = *(undefined4 *)(param_2 + 0x16c);
        local_118 = *(undefined4 *)(param_2 + 0x170);
        local_114 = *(undefined4 *)(param_2 + 0x174);
        local_110 = *(undefined4 *)(param_2 + 0x178);
        local_10c = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        local_140[0] = 0xffffffff;
        local_148[0] = param_4;
        if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar10 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar10 != 0)) {
          local_res8[0]._0_2_ = (undefined2)iVar5;
          plVar9 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          in_stack_fffffffffffffea8 = local_140;
          in_stack_fffffffffffffe98 = &local_138;
          (**(code **)(*plVar9 + 0x130))
                    (plVar9,1,&DAT_1405d85a0,local_res8,&local_118,&local_128,
                     in_stack_fffffffffffffe98,local_148,in_stack_fffffffffffffea8);
        }
      }
      iVar13 = iVar13 + 1;
      psVar12 = psVar12 + 0x56;
    } while (iVar13 < 0x18);
  }
  else if (uVar7 == 6) {
    iVar13 = 0;
    param_1 = param_1 + 0xa14c;
    do {
      plVar9 = (longlong *)FUN_1401fbad0(param_1,iVar13);
      if ((*plVar9 == 0) && (plVar9[1] == 0)) {
        bVar6 = false;
      }
      else {
        bVar6 = true;
      }
      if (((bVar6) || ((int)plVar9[3] != 0)) || (0 < *(short *)((longlong)plVar9 + 0x1c))) {
        lVar10 = FUN_1401fbad0(param_1,iVar13);
        uVar14 = (undefined4)((ulonglong)in_stack_fffffffffffffe90 >> 0x20);
        uVar15 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
        if (*(int *)(lVar10 + 0x18) == param_3) {
          lVar10 = FUN_1401fbad0(param_1,iVar13);
          sVar3 = *(short *)(lVar10 + 0x1c);
          lVar10 = FUN_1401fbad0(param_1,iVar13);
          sVar4 = *(short *)(lVar10 + 0x1c);
          uVar8 = FUN_1401fbad0(param_1,iVar13);
          in_stack_fffffffffffffea8 =
               (undefined4 *)((ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000);
          in_stack_fffffffffffffea0 = (undefined4 *)CONCAT44(uVar15,(int)sVar3);
          FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1af,0x70,param_2,uVar8,
                        CONCAT44(uVar14,(int)sVar4),
                        (ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000,
                        in_stack_fffffffffffffea0,in_stack_fffffffffffffea8);
          puVar11 = (undefined4 *)FUN_1401fbad0(param_1,iVar13);
          local_138 = *puVar11;
          local_134 = puVar11[1];
          local_130 = puVar11[2];
          local_12c = puVar11[3];
          FUN_14000a170(local_f0);
          local_48 = 0;
          uVar8 = FUN_1401fbad0(param_1,iVar13);
          FUN_140090020(uVar8,local_f0);
          local_res8[0]._0_2_ = (undefined2)iVar13;
          local_148[0] = CONCAT22(local_148[0]._2_2_,6);
          local_140[0] = 1;
          plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
          in_stack_fffffffffffffe98 = &local_138;
          in_stack_fffffffffffffe90 = local_res8;
          (**(code **)(*plVar9 + 0xb0))
                    (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_140,local_148,
                     in_stack_fffffffffffffe90,in_stack_fffffffffffffe98);
          local_118 = *(undefined4 *)(param_2 + 0x160);
          local_114 = *(undefined4 *)(param_2 + 0x164);
          local_110 = *(undefined4 *)(param_2 + 0x168);
          local_10c = *(undefined4 *)(param_2 + 0x16c);
          local_128 = *(undefined4 *)(param_2 + 0x170);
          local_124 = *(undefined4 *)(param_2 + 0x174);
          local_120 = *(undefined4 *)(param_2 + 0x178);
          local_11c = *(undefined4 *)(param_2 + 0x17c);
          iVar5 = *(int *)(param_2 + 0x284);
          local_140[0] = 0xffffffff;
          local_148[0] = param_4;
          if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
             (lVar10 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar10 != 0)) {
            local_res8[0]._0_2_ = (undefined2)iVar5;
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70)
            ;
            in_stack_fffffffffffffea8 = local_140;
            in_stack_fffffffffffffea0 = local_148;
            in_stack_fffffffffffffe98 = &local_138;
            in_stack_fffffffffffffe90 = &local_118;
            (**(code **)(*plVar9 + 0x130))
                      (plVar9,1,&DAT_1405d85a0,local_res8,&local_128,in_stack_fffffffffffffe90,
                       in_stack_fffffffffffffe98,in_stack_fffffffffffffea0,in_stack_fffffffffffffea8
                      );
          }
        }
      }
      iVar13 = iVar13 + 1;
    } while (iVar13 < 0x78);
  }
  FUN_14034edd0(local_108);
  return 1;
}



undefined8
FUN_1401ebc50(longlong param_1,longlong param_2,int param_3,int param_4,undefined4 param_5,
             undefined4 param_6,undefined4 param_7,int param_8)

{
  int *piVar1;
  short sVar2;
  short sVar3;
  undefined4 uVar4;
  longlong lVar5;
  uint uVar6;
  int iVar7;
  undefined8 uVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined4 *puVar11;
  undefined2 uVar12;
  int iVar13;
  undefined2 uVar14;
  longlong lVar15;
  undefined8 *in_stack_fffffffffffffe90;
  undefined4 uVar17;
  ulonglong uVar16;
  longlong *in_stack_fffffffffffffe98;
  ulonglong uVar18;
  uint uVar19;
  undefined4 *in_stack_fffffffffffffea0;
  undefined4 uVar21;
  undefined4 uVar22;
  undefined8 uVar20;
  undefined4 *in_stack_fffffffffffffea8;
  ulonglong uVar23;
  uint uVar24;
  undefined4 local_148 [2];
  undefined4 local_140 [2];
  undefined8 local_138;
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  longlong local_118;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  longlong local_f8;
  undefined1 local_f0;
  undefined8 local_e8;
  undefined1 local_e0 [168];
  undefined4 local_38;
  
  local_e8 = 0xfffffffffffffffe;
  if (param_8 == 0) {
    uVar8 = FUN_140137690();
    uVar6 = FUN_140136b30(uVar8,param_3);
    lVar15 = (longlong)(int)uVar6;
    local_f8 = param_1 + 0xf630;
    FUN_14034ed40(local_f8);
    local_f0 = 1;
    if ((((uVar6 == 1) || (uVar6 == 2)) || (uVar6 == 3)) || (uVar6 == 4)) {
      iVar13 = 0;
      lVar10 = lVar15 * 0x18;
      local_118 = lVar10;
      do {
        puVar11 = (undefined4 *)((iVar13 + lVar10) * 0xac + param_1);
        if (puVar11[6] == param_3) {
          iVar7 = (int)*(short *)(puVar11 + 7);
          uVar14 = (undefined2)uVar6;
          uVar12 = (undefined2)iVar13;
          uVar24 = (uint)((ulonglong)in_stack_fffffffffffffea8 >> 0x20);
          uVar19 = (uint)((ulonglong)in_stack_fffffffffffffe98 >> 0x20);
          if (param_4 <= iVar7) {
            puVar11 = (undefined4 *)((iVar13 + lVar10) * 0xac + param_1);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),param_6,param_7,param_2,puVar11,param_4,
                          (ulonglong)uVar19 << 0x20,(int)*(short *)(puVar11 + 7),
                          CONCAT44(uVar24,*(short *)(puVar11 + 7) - param_4));
            *(short *)(puVar11 + 7) = *(short *)(puVar11 + 7) - (short)param_4;
            if ((uVar6 < 5) &&
               (piVar1 = (int *)(param_1 + 0xf5f8 + lVar15 * 4),
               *piVar1 = *piVar1 - puVar11[0x1a] * param_4, *(longlong *)(param_1 + 0xf610) != 0)) {
              (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
                        (*(longlong **)(param_1 + 0xf610),
                         *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                         *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                         *(int *)(param_1 + 0xf5f8));
            }
            param_8._0_2_ = uVar12;
            if (*(short *)(puVar11 + 7) < 1) {
              local_138._0_4_ = *puVar11;
              local_138._4_4_ = puVar11[1];
              local_130 = puVar11[2];
              local_12c = puVar11[3];
              FUN_14000a170(local_e0);
              local_38 = 0;
              FUN_140090020(puVar11,local_e0);
              local_148[0] = CONCAT22(local_148[0]._2_2_,uVar14);
              local_140[0] = 1;
              plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              (**(code **)(*plVar9 + 0xb0))
                        (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_140,local_148,
                         &param_8,&local_138);
              local_108 = *(undefined4 *)(param_2 + 0x160);
              local_104 = *(undefined4 *)(param_2 + 0x164);
              local_100 = *(undefined4 *)(param_2 + 0x168);
              local_fc = *(undefined4 *)(param_2 + 0x16c);
              local_128 = *(undefined4 *)(param_2 + 0x170);
              local_124 = *(undefined4 *)(param_2 + 0x174);
              local_120 = *(undefined4 *)(param_2 + 0x178);
              local_11c = *(undefined4 *)(param_2 + 0x17c);
              iVar13 = *(int *)(param_2 + 0x284);
              local_140[0] = 0xffffffff;
              local_148[0] = param_5;
              if (((-1 < iVar13) && (iVar13 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar15 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar15 != 0)) {
                param_8._0_2_ = (undefined2)iVar13;
                plVar9 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar15 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                (**(code **)(*plVar9 + 0x130))
                          (plVar9,1,&DAT_1405d85a0,&param_8,&local_128,&local_108,&local_138,
                           local_148,local_140);
              }
            }
            else {
              puVar11[0x2a] = 6;
              local_148[0] = CONCAT22(local_148[0]._2_2_,uVar14);
              plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              (**(code **)(*plVar9 + 0xe0))
                        (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_148,&param_8,
                         puVar11);
            }
            goto LAB_1401ec837;
          }
          in_stack_fffffffffffffea8 = (undefined4 *)((ulonglong)uVar24 << 0x20);
          FUN_140203700(*(undefined8 *)(param_2 + 0xb50),param_6,param_7,param_2,puVar11,iVar7,
                        (ulonglong)uVar19 << 0x20,iVar7,in_stack_fffffffffffffea8);
          param_4 = param_4 - *(short *)(puVar11 + 7);
          if ((uVar6 < 5) &&
             (piVar1 = (int *)(param_1 + 0xf5f8 + lVar15 * 4),
             *piVar1 = *piVar1 - puVar11[0x1a] * (int)*(short *)(puVar11 + 7),
             *(longlong *)(param_1 + 0xf610) != 0)) {
            (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
                      (*(longlong **)(param_1 + 0xf610),
                       *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                       *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                       *(int *)(param_1 + 0xf5f8));
          }
          *(undefined2 *)(puVar11 + 7) = 0;
          local_138._0_4_ = *puVar11;
          local_138._4_4_ = puVar11[1];
          local_130 = puVar11[2];
          local_12c = puVar11[3];
          FUN_14000a170(local_e0);
          local_38 = 0;
          FUN_140090020(puVar11,local_e0);
          param_8 = CONCAT22(param_8._2_2_,uVar12);
          local_148[0] = CONCAT22(local_148[0]._2_2_,uVar14);
          local_140[0] = 1;
          plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
          in_stack_fffffffffffffe98 = &local_138;
          (**(code **)(*plVar9 + 0xb0))
                    (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_140,local_148,&param_8
                     ,in_stack_fffffffffffffe98);
          local_128 = *(undefined4 *)(param_2 + 0x160);
          local_124 = *(undefined4 *)(param_2 + 0x164);
          local_120 = *(undefined4 *)(param_2 + 0x168);
          local_11c = *(undefined4 *)(param_2 + 0x16c);
          local_108 = *(undefined4 *)(param_2 + 0x170);
          local_104 = *(undefined4 *)(param_2 + 0x174);
          local_100 = *(undefined4 *)(param_2 + 0x178);
          local_fc = *(undefined4 *)(param_2 + 0x17c);
          iVar7 = *(int *)(param_2 + 0x284);
          local_140[0] = 0xffffffff;
          local_148[0] = param_5;
          lVar10 = local_118;
          if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
             (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0)) {
            param_8 = CONCAT22(param_8._2_2_,(short)iVar7);
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            in_stack_fffffffffffffea8 = local_140;
            in_stack_fffffffffffffe98 = &local_138;
            (**(code **)(*plVar9 + 0x130))
                      (plVar9,1,&DAT_1405d85a0,&param_8,&local_108,&local_128,
                       in_stack_fffffffffffffe98,local_148,in_stack_fffffffffffffea8);
            lVar10 = local_118;
          }
        }
        iVar13 = iVar13 + 1;
      } while (iVar13 < 0x18);
    }
    else if (uVar6 == 6) {
      iVar13 = 0;
      do {
        uVar8 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
        iVar7 = FUN_14011b180(uVar8);
        if (iVar7 == 0) {
          lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
          uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffe90 >> 0x20);
          uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
          if (*(int *)(lVar15 + 0x18) == param_3) {
            lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
            uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffea8 >> 0x20);
            uVar12 = (undefined2)iVar13;
            if (param_4 <= *(short *)(lVar15 + 0x1c)) {
              lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
              sVar2 = *(short *)(lVar15 + 0x1c);
              lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
              sVar3 = *(short *)(lVar15 + 0x1c);
              uVar8 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
              uVar23 = CONCAT44(uVar22,sVar2 - param_4);
              uVar20 = CONCAT44(uVar21,(int)sVar3);
              uVar18 = (ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000;
              uVar16 = CONCAT44(uVar17,param_4);
              FUN_140203700(*(undefined8 *)(param_2 + 0xb50),param_6,param_7,param_2,uVar8,uVar16,
                            uVar18,uVar20,uVar23);
              uVar17 = (undefined4)((ulonglong)uVar8 >> 0x20);
              uVar21 = (undefined4)(uVar18 >> 0x20);
              uVar22 = (undefined4)((ulonglong)uVar20 >> 0x20);
              lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
              *(short *)(lVar15 + 0x1c) = *(short *)(lVar15 + 0x1c) - (short)param_4;
              lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
              param_8._0_2_ = uVar12;
              if (*(short *)(lVar15 + 0x1c) < 1) {
                uVar4 = *(undefined4 *)(param_1 + 0x50a0);
                uVar8 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
                FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,uVar8,0x193,
                              CONCAT44(uVar17,0x46),uVar16 & 0xffffffff00000000,
                              CONCAT44(uVar21,uVar4),CONCAT44(uVar22,uVar4),
                              uVar23 & 0xffffffff00000000,0);
                plVar9 = (longlong *)FUN_1401fbad0(param_1 + 0xa14c,iVar13);
                local_118 = *plVar9;
                local_110 = (undefined4)plVar9[1];
                local_10c = *(undefined4 *)((longlong)plVar9 + 0xc);
                FUN_14000a170(local_e0);
                local_38 = 0;
                uVar8 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
                FUN_140090020(uVar8,local_e0);
                local_148[0] = CONCAT22(local_148[0]._2_2_,6);
                local_140[0] = 1;
                plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                (**(code **)(*plVar9 + 0xb0))
                          (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_140,local_148,
                           &param_8,&local_118);
                local_128 = *(undefined4 *)(param_2 + 0x160);
                local_124 = *(undefined4 *)(param_2 + 0x164);
                local_120 = *(undefined4 *)(param_2 + 0x168);
                local_11c = *(undefined4 *)(param_2 + 0x16c);
                local_138._0_4_ = *(undefined4 *)(param_2 + 0x170);
                local_138._4_4_ = *(undefined4 *)(param_2 + 0x174);
                local_130 = *(undefined4 *)(param_2 + 0x178);
                local_12c = *(undefined4 *)(param_2 + 0x17c);
                iVar13 = *(int *)(param_2 + 0x284);
                local_140[0] = 0xffffffff;
                local_148[0] = param_5;
                if (((-1 < iVar13) && (iVar13 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                   && (lVar15 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar15 != 0))
                {
                  param_8._0_2_ = (undefined2)iVar13;
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar15 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar9 + 0x130))
                            (plVar9,1,&DAT_1405d85a0,&param_8,&local_138,&local_128,&local_118,
                             local_148,local_140);
                }
              }
              else {
                lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
                *(undefined4 *)(lVar15 + 0xa8) = 6;
                local_148[0] = CONCAT22(local_148[0]._2_2_,6);
                lVar15 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                uVar8 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
                (**(code **)(lVar15 + 0xe0))
                          (*(longlong *)(param_2 + 0xb50) + 0x78,*(undefined4 *)(param_2 + 8),
                           &DAT_1405d85a0,local_148,&param_8,uVar8);
              }
LAB_1401ec837:
              FUN_14034edd0(param_1 + 0xf630);
              return 1;
            }
            lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
            sVar2 = *(short *)(lVar15 + 0x1c);
            lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
            sVar3 = *(short *)(lVar15 + 0x1c);
            uVar8 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
            in_stack_fffffffffffffea8 =
                 (undefined4 *)((ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000);
            in_stack_fffffffffffffea0 = (undefined4 *)CONCAT44(uVar21,(int)sVar2);
            in_stack_fffffffffffffe98 =
                 (longlong *)((ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000);
            in_stack_fffffffffffffe90 = (undefined8 *)CONCAT44(uVar17,(int)sVar3);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),param_6,param_7,param_2,uVar8,
                          in_stack_fffffffffffffe90,in_stack_fffffffffffffe98,
                          in_stack_fffffffffffffea0,in_stack_fffffffffffffea8);
            uVar17 = (undefined4)((ulonglong)uVar8 >> 0x20);
            lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
            param_4 = param_4 - *(short *)(lVar15 + 0x1c);
            lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
            *(undefined2 *)(lVar15 + 0x1c) = 0;
            lVar15 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
            uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffe98 >> 0x20);
            uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
            if (*(short *)(lVar15 + 0x1c) < 1) {
              uVar4 = *(undefined4 *)(param_1 + 0x50a0);
              uVar8 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
              in_stack_fffffffffffffea8 =
                   (undefined4 *)((ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000);
              in_stack_fffffffffffffea0 = (undefined4 *)CONCAT44(uVar22,uVar4);
              FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,uVar8,0x193,
                            CONCAT44(uVar17,0x46),
                            (ulonglong)in_stack_fffffffffffffe90 & 0xffffffff00000000,
                            CONCAT44(uVar21,uVar4),in_stack_fffffffffffffea0,
                            in_stack_fffffffffffffea8,0);
              plVar9 = (longlong *)FUN_1401fbad0(param_1 + 0xa14c,iVar13);
              local_118 = *plVar9;
              local_110 = (undefined4)plVar9[1];
              local_10c = *(undefined4 *)((longlong)plVar9 + 0xc);
              FUN_14000a170(local_e0);
              local_38 = 0;
              uVar8 = FUN_1401fbad0(param_1 + 0xa14c,iVar13);
              FUN_140090020(uVar8,local_e0);
              param_8 = CONCAT22(param_8._2_2_,uVar12);
              local_148[0] = CONCAT22(local_148[0]._2_2_,6);
              local_140[0] = 1;
              plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              in_stack_fffffffffffffe98 = &local_118;
              in_stack_fffffffffffffe90 = (undefined8 *)&param_8;
              (**(code **)(*plVar9 + 0xb0))
                        (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_140,local_148,
                         in_stack_fffffffffffffe90,in_stack_fffffffffffffe98);
              local_138._0_4_ = *(undefined4 *)(param_2 + 0x160);
              local_138._4_4_ = *(undefined4 *)(param_2 + 0x164);
              local_130 = *(undefined4 *)(param_2 + 0x168);
              local_12c = *(undefined4 *)(param_2 + 0x16c);
              local_128 = *(undefined4 *)(param_2 + 0x170);
              local_124 = *(undefined4 *)(param_2 + 0x174);
              local_120 = *(undefined4 *)(param_2 + 0x178);
              local_11c = *(undefined4 *)(param_2 + 0x17c);
              iVar7 = *(int *)(param_2 + 0x284);
              local_140[0] = 0xffffffff;
              local_148[0] = param_5;
              if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar15 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar15 != 0)) {
                param_8 = CONCAT22(param_8._2_2_,(short)iVar7);
                plVar9 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar15 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                in_stack_fffffffffffffea8 = local_140;
                in_stack_fffffffffffffea0 = local_148;
                in_stack_fffffffffffffe98 = &local_118;
                in_stack_fffffffffffffe90 = &local_138;
                (**(code **)(*plVar9 + 0x130))
                          (plVar9,1,&DAT_1405d85a0,&param_8,&local_128,in_stack_fffffffffffffe90,
                           in_stack_fffffffffffffe98,in_stack_fffffffffffffea0,
                           in_stack_fffffffffffffea8);
              }
            }
          }
        }
        iVar13 = iVar13 + 1;
      } while (iVar13 < 0x78);
    }
    FUN_14034edd0(local_f8);
    uVar8 = 0;
  }
  else {
    uVar8 = FUN_1401eb6d0();
  }
  return uVar8;
}



undefined8 FUN_1401ec880(longlong param_1,uint *param_2,undefined8 param_3)

{
  uint uVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  
  FUN_14034ed40(param_1 + 0xf630);
  uVar1 = *param_2;
  if (((int)uVar1 < 0) || (0x77 < (int)uVar1)) {
    FUN_14034edd0(param_1 + 0xf630);
    uVar2 = 0;
  }
  else {
    if (uVar1 < 0x78) {
      puVar3 = (undefined8 *)((longlong)(int)uVar1 * 0xac + 0xa14c + param_1);
    }
    else {
      if (DAT_1406093a4 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a4 = DAT_1406093a4 + 1;
      puVar3 = &DAT_14060d080;
    }
    FUN_140090020(param_3,puVar3);
    FUN_14034edd0(param_1 + 0xf630);
    uVar2 = 1;
  }
  return uVar2;
}



int FUN_1401ec940(longlong param_1,uint param_2)

{
  uint uVar1;
  bool bVar2;
  longlong lVar3;
  longlong *plVar4;
  uint *puVar5;
  undefined8 *puVar6;
  int iVar7;
  uint uVar8;
  
  iVar7 = 0;
  FUN_14034ed40(param_1 + 0xf630);
  uVar8 = 0;
  do {
    if (uVar8 < 0x78) {
      plVar4 = (longlong *)((longlong)(int)uVar8 * 0xac + 0x50a8 + param_1);
    }
    else {
      if (DAT_1406093a4 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a4 = DAT_1406093a4 + 1;
      plVar4 = &DAT_14060d080;
    }
    if ((*plVar4 == 0) && (plVar4[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if (((bVar2) || ((int)plVar4[3] != 0)) || (0 < *(short *)((longlong)plVar4 + 0x1c))) {
      if (uVar8 < 0x78) {
        puVar6 = (undefined8 *)((longlong)(int)uVar8 * 0xac + 0x50a8 + param_1);
      }
      else {
        if (DAT_1406093a4 == 0) {
          FUN_140176d60(0);
        }
        DAT_1406093a4 = DAT_1406093a4 + 1;
        puVar6 = &DAT_14060d080;
      }
      uVar1 = *(uint *)(puVar6 + 3);
      lVar3 = FUN_140137690();
      if (*(longlong *)(lVar3 + 0x88) != 0) {
        for (puVar5 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                                ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
            puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xa6)) {
          if ((puVar5[0xa8] == uVar1) && (*puVar5 == uVar1)) {
            if (puVar5 != (uint *)0x0) {
              if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              if ((0 < (int)puVar5[0x18]) && (puVar5[0x18] == param_2)) {
                if (uVar8 < 0x78) {
                  puVar6 = (undefined8 *)((longlong)(int)uVar8 * 0xac + 0x50a8 + param_1);
                }
                else {
                  if (DAT_1406093a4 == 0) {
                    FUN_140176d60(0);
                  }
                  DAT_1406093a4 = DAT_1406093a4 + 1;
                  puVar6 = &DAT_14060d080;
                }
                iVar7 = iVar7 + *(short *)((longlong)puVar6 + 0x1c);
              }
            }
            break;
          }
        }
      }
    }
    uVar8 = uVar8 + 1;
    if (0x77 < (int)uVar8) {
      FUN_14034edd0(param_1 + 0xf630);
      return iVar7;
    }
  } while( true );
}



int FUN_1401ecb10(longlong param_1,int param_2)

{
  bool bVar1;
  int iVar2;
  longlong *plVar3;
  longlong *plVar4;
  int iVar5;
  uint uVar6;
  
  FUN_14034ed40();
  iVar5 = 0;
  uVar6 = 0;
  plVar4 = (longlong *)(param_1 + 0x50a8);
  iVar2 = DAT_1406093a4;
  do {
    plVar3 = plVar4;
    if (0x77 < uVar6) {
      if (iVar2 == 0) {
        FUN_140176d60();
        iVar2 = DAT_1406093a4;
      }
      iVar2 = iVar2 + 1;
      plVar3 = &DAT_14060d080;
      DAT_1406093a4 = iVar2;
    }
    if ((*plVar3 == 0) && (plVar3[1] == 0)) {
      bVar1 = false;
    }
    else {
      bVar1 = true;
    }
    if (((bVar1) || ((int)plVar3[3] != 0)) || (0 < *(short *)((longlong)plVar3 + 0x1c))) {
      plVar3 = plVar4;
      if (0x77 < uVar6) {
        if (iVar2 == 0) {
          FUN_140176d60(0);
          iVar2 = DAT_1406093a4;
        }
        iVar2 = iVar2 + 1;
        plVar3 = &DAT_14060d080;
        DAT_1406093a4 = iVar2;
      }
      if ((int)plVar3[3] == param_2) {
        iVar5 = iVar5 + 1;
      }
    }
    uVar6 = uVar6 + 1;
    plVar4 = (longlong *)((longlong)plVar4 + 0xac);
  } while ((int)uVar6 < 0x78);
  FUN_14034edd0(param_1 + 0xf630);
  return iVar5;
}



undefined8 FUN_1401ecc20(longlong param_1,uint *param_2,undefined8 param_3)

{
  uint uVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  
  FUN_14034ed40(param_1 + 0xf630);
  uVar1 = *param_2;
  if (((int)uVar1 < 0) || (0x77 < (int)uVar1)) {
    FUN_14034edd0(param_1 + 0xf630);
    uVar2 = 0;
  }
  else {
    if (uVar1 < 0x78) {
      puVar3 = (undefined8 *)((longlong)(int)uVar1 * 0xac + 0x50a8 + param_1);
    }
    else {
      if (DAT_1406093a4 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a4 = DAT_1406093a4 + 1;
      puVar3 = &DAT_14060d080;
    }
    FUN_140090020(param_3,puVar3);
    FUN_14034edd0(param_1 + 0xf630);
    uVar2 = 1;
  }
  return uVar2;
}



undefined8 FUN_1401ecce0(longlong param_1,int *param_2,int *param_3,undefined8 param_4)

{
  int iVar1;
  
  if (*param_2 < 5) {
    iVar1 = *param_3;
    if ((-1 < iVar1) && (iVar1 < 0x18)) {
      *(short *)(((longlong)iVar1 + (longlong)*param_2 * 0x18) * 0xac + 0x14 + param_1) =
           (short)*param_2;
      *(short *)(((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + 0x16 + param_1) =
           (short)*param_3;
      FUN_140090020(param_4,((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + param_1);
      return 1;
    }
  }
  return 0;
}



int FUN_1401ecd70(longlong param_1,int *param_2,uint param_3)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  longlong lVar4;
  int iVar5;
  
  if (*param_2 < 5) {
    iVar5 = 0;
    FUN_14034ed40(param_1 + 0xf630);
    lVar4 = 0;
    do {
      uVar1 = *(uint *)((lVar4 + (longlong)*param_2 * 0x18) * 0xac + 0x18 + param_1);
      if (0 < (int)uVar1) {
        lVar2 = FUN_140137690();
        if (*(longlong *)(lVar2 + 0x88) != 0) {
          for (puVar3 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                                  ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
              puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0xa6)) {
            if ((puVar3[0xa8] == uVar1) && (*puVar3 == uVar1)) {
              if (puVar3 != (uint *)0x0) {
                if (puVar3 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                if ((0 < (int)puVar3[0x18]) && (puVar3[0x18] == param_3)) {
                  iVar5 = iVar5 + *(short *)((lVar4 + (longlong)*param_2 * 0x18) * 0xac + 0x1c +
                                            param_1);
                }
              }
              break;
            }
          }
        }
      }
      lVar4 = lVar4 + 1;
    } while (lVar4 < 0x18);
    FUN_14034edd0(param_1 + 0xf630);
  }
  else {
    iVar5 = 0;
  }
  return iVar5;
}



int FUN_1401eceb0(longlong param_1,int *param_2,int param_3)

{
  bool bVar1;
  int iVar2;
  longlong *plVar3;
  short *psVar4;
  longlong lVar5;
  uint uVar6;
  int iVar7;
  longlong *plVar8;
  
  iVar7 = 0;
  FUN_14034ed40();
  iVar2 = *param_2;
  if ((iVar2 < 0) || (4 < iVar2)) {
    if (iVar2 == 5) {
      uVar6 = 0;
      plVar8 = (longlong *)(param_1 + 0x50a8);
      iVar2 = DAT_1406093a4;
      do {
        plVar3 = plVar8;
        if (0x77 < uVar6) {
          if (iVar2 == 0) {
            FUN_140176d60();
            iVar2 = DAT_1406093a4;
          }
          DAT_1406093a4 = iVar2 + 1;
          plVar3 = &DAT_14060d080;
          iVar2 = DAT_1406093a4;
        }
        if ((*plVar3 == 0) && (plVar3[1] == 0)) {
          bVar1 = false;
        }
        else {
          bVar1 = true;
        }
        if (((bVar1) || ((int)plVar3[3] != 0)) || (0 < *(short *)((longlong)plVar3 + 0x1c))) {
          plVar3 = plVar8;
          if (0x77 < uVar6) {
            if (iVar2 == 0) {
              FUN_140176d60();
              iVar2 = DAT_1406093a4;
            }
            DAT_1406093a4 = iVar2 + 1;
            plVar3 = &DAT_14060d080;
            iVar2 = DAT_1406093a4;
          }
          if ((int)plVar3[3] == param_3) {
            plVar3 = plVar8;
            if (0x77 < uVar6) {
              if (iVar2 == 0) {
                FUN_140176d60();
                iVar2 = DAT_1406093a4;
              }
              DAT_1406093a4 = iVar2 + 1;
              plVar3 = &DAT_14060d080;
              iVar2 = DAT_1406093a4;
            }
            iVar7 = iVar7 + *(short *)((longlong)plVar3 + 0x1c);
          }
        }
        uVar6 = uVar6 + 1;
        plVar8 = (longlong *)((longlong)plVar8 + 0xac);
      } while ((int)uVar6 < 0x78);
    }
    else if (iVar2 == 6) {
      uVar6 = 0;
      plVar8 = (longlong *)(param_1 + 0xa14c);
      iVar2 = DAT_1406093a4;
      do {
        plVar3 = plVar8;
        if (0x77 < uVar6) {
          if (iVar2 == 0) {
            FUN_140176d60();
            iVar2 = DAT_1406093a4;
          }
          iVar2 = iVar2 + 1;
          plVar3 = &DAT_14060d080;
          DAT_1406093a4 = iVar2;
        }
        if ((*plVar3 == 0) && (plVar3[1] == 0)) {
          bVar1 = false;
        }
        else {
          bVar1 = true;
        }
        if (((bVar1) || ((int)plVar3[3] != 0)) || (0 < *(short *)((longlong)plVar3 + 0x1c))) {
          plVar3 = plVar8;
          if (0x77 < uVar6) {
            if (iVar2 == 0) {
              FUN_140176d60(0);
              iVar2 = DAT_1406093a4;
            }
            iVar2 = iVar2 + 1;
            plVar3 = &DAT_14060d080;
            DAT_1406093a4 = iVar2;
          }
          if ((int)plVar3[3] == param_3) {
            plVar3 = plVar8;
            if (0x77 < uVar6) {
              if (iVar2 == 0) {
                FUN_140176d60(0);
                iVar2 = DAT_1406093a4;
              }
              iVar2 = iVar2 + 1;
              plVar3 = &DAT_14060d080;
              DAT_1406093a4 = iVar2;
            }
            iVar7 = iVar7 + *(short *)((longlong)plVar3 + 0x1c);
          }
        }
        uVar6 = uVar6 + 1;
        plVar8 = (longlong *)((longlong)plVar8 + 0xac);
      } while ((int)uVar6 < 0x78);
    }
  }
  else {
    lVar5 = 0x18;
    psVar4 = (short *)((longlong)iVar2 * 0x1020 + 0x1c + param_1);
    do {
      if (*(int *)(psVar4 + -2) == param_3) {
        iVar7 = iVar7 + *psVar4;
      }
      psVar4 = psVar4 + 0x56;
      lVar5 = lVar5 + -1;
    } while (lVar5 != 0);
  }
  FUN_14034edd0(param_1 + 0xf630);
  return iVar7;
}



undefined8 FUN_1401ed120(longlong param_1,uint *param_2,longlong *param_3)

{
  bool bVar1;
  undefined8 *puVar2;
  
  FUN_14034ed40(param_1 + 0xf630);
  if ((-1 < (int)*param_2) && ((int)*param_2 < 0x78)) {
    if ((*param_3 == 0) && (param_3[1] == 0)) {
      bVar1 = false;
    }
    else {
      bVar1 = true;
    }
    if (bVar1) {
      *(undefined2 *)((longlong)param_3 + 0x14) = 5;
      *(short *)((longlong)param_3 + 0x16) = (short)*param_2;
    }
    if (*param_2 < 0x78) {
      puVar2 = (undefined8 *)((longlong)(int)*param_2 * 0xac + 0x50a8 + param_1);
    }
    else {
      if (DAT_1406093a4 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a4 = DAT_1406093a4 + 1;
      puVar2 = &DAT_14060d080;
    }
    FUN_140090020(puVar2,param_3);
    FUN_14034edd0(param_1 + 0xf630);
    return 1;
  }
  FUN_14034edd0(param_1 + 0xf630);
  return 0;
}



undefined8
FUN_1401ed220(longlong param_1,int *param_2,int *param_3,longlong *param_4,undefined4 param_5)

{
  bool bVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  
  if (((*param_2 < 5) && (-1 < *param_3)) && (*param_3 < 0x18)) {
    FUN_14034ed40(param_1 + 0xf630);
    uVar5 = (ulonglong)*param_2;
    lVar4 = ((longlong)*param_3 + uVar5 * 0x18) * 0xac + param_1;
    iVar2 = FUN_14011b180();
    if (iVar2 == 0) {
      FUN_1401f3b10(param_1,uVar5 & 0xffffffff,
                    -((int)*(short *)(lVar4 + 0x1c) * *(int *)(lVar4 + 0x68)));
    }
    *(short *)((longlong)param_4 + 0x14) = (short)*param_2;
    *(short *)((longlong)param_4 + 0x16) = (short)*param_3;
    FUN_140090020(((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + param_1,param_4);
    *(undefined4 *)(((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac + 0xa8 + param_1) =
         param_5;
    if ((*param_4 == 0) && (param_4[1] == 0)) {
      bVar1 = false;
    }
    else {
      bVar1 = true;
    }
    if ((bVar1) && (0 < (int)param_4[3])) {
      FUN_1401f3b10(param_1,*param_2,(int)*(short *)((longlong)param_4 + 0x1c) * (int)param_4[0xd]);
    }
    FUN_14034edd0(param_1 + 0xf630);
    uVar3 = 1;
  }
  else {
    uVar3 = 0;
  }
  return uVar3;
}



bool FUN_1401ed380(longlong param_1,ulonglong *param_2,int *param_3,int *param_4)

{
  ulonglong uVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  
  if (((*param_3 < 5) && (-1 < *param_4)) && (*param_4 < 0x18)) {
    FUN_14034ed40(param_1 + 0xf630);
    lVar3 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
    uVar1 = *(ulonglong *)(lVar3 + param_1);
    bVar4 = uVar1 < *param_2;
    if ((uVar1 == *param_2) &&
       (uVar1 = *(ulonglong *)(lVar3 + 8 + param_1), bVar4 = uVar1 < param_2[1], uVar1 == param_2[1]
       )) {
      iVar2 = 0;
    }
    else {
      iVar2 = (1 - (uint)bVar4) - (uint)(bVar4 != 0);
    }
    bVar4 = iVar2 == 0;
    FUN_14034edd0(param_1 + 0xf630);
  }
  else {
    bVar4 = false;
  }
  return bVar4;
}



undefined8 FUN_1401ed430(longlong param_1,int *param_2,int *param_3)

{
  bool bVar1;
  short *psVar2;
  longlong lVar3;
  int iVar4;
  
  if (*param_2 < 5) {
    FUN_14034ed40(param_1 + 0xf630);
    iVar4 = 0;
    lVar3 = 0;
    psVar2 = (short *)((longlong)*param_2 * 0x1020 + 0x1c + param_1);
    do {
      if ((*(longlong *)(psVar2 + -0xe) == 0) && (*(longlong *)(psVar2 + -10) == 0)) {
        bVar1 = false;
      }
      else {
        bVar1 = true;
      }
      if (((!bVar1) && (*(int *)(psVar2 + -2) == 0)) && (*psVar2 < 1)) {
        *param_3 = iVar4;
        FUN_14034edd0(param_1 + 0xf630);
        return 1;
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar3 + 1;
      psVar2 = psVar2 + 0x56;
    } while (lVar3 < 0x18);
    *param_3 = -1;
    FUN_14034edd0(param_1 + 0xf630);
  }
  else {
    *param_3 = -1;
  }
  return 0;
}



int FUN_1401ed510(longlong param_1)

{
  bool bVar1;
  short *psVar2;
  int iVar3;
  longlong lVar4;
  
  iVar3 = 0;
  FUN_14034ed40(param_1 + 0xf630);
  psVar2 = (short *)(param_1 + 0x205c);
  lVar4 = 0x18;
  do {
    if (*(longlong *)(psVar2 + -0xe) == 0) {
      if (*(longlong *)(psVar2 + -10) != 0) goto LAB_1401ed55c;
      bVar1 = false;
    }
    else {
LAB_1401ed55c:
      bVar1 = true;
    }
    if (((!bVar1) && (*(int *)(psVar2 + -2) == 0)) && (*psVar2 < 1)) {
      iVar3 = iVar3 + 1;
    }
    psVar2 = psVar2 + 0x56;
    lVar4 = lVar4 + -1;
    if (lVar4 == 0) {
      FUN_14034edd0(param_1 + 0xf630);
      return iVar3;
    }
  } while( true );
}



longlong FUN_1401ed5a0(longlong param_1,uint param_2,uint param_3)

{
  if ((param_2 < 5) && (param_3 < 0x18)) {
    FUN_14034ed40(param_1 + 0xf630);
    FUN_14034edd0(param_1 + 0xf630);
    return ((longlong)(int)param_3 + (longlong)(int)param_2 * 0x18) * 0xac + param_1;
  }
  return 0;
}



ulonglong FUN_1401ed620(longlong param_1,longlong *param_2,longlong *param_3,longlong *param_4)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  code *pcVar4;
  bool bVar5;
  uint uVar6;
  DWORD DVar7;
  HANDLE pvVar8;
  HANDLE pvVar9;
  uint *puVar10;
  longlong lVar11;
  uint *puVar12;
  uint *puVar13;
  undefined8 *puVar14;
  uint *puVar15;
  longlong *plVar16;
  ulonglong uVar17;
  longlong lVar18;
  uint *puVar19;
  ulonglong uVar20;
  int iVar21;
  longlong lVar22;
  uint local_res8 [2];
  longlong *local_res10;
  longlong *local_res18;
  longlong *local_res20;
  uint local_c8 [2];
  uint *local_c0;
  uint *local_b8;
  uint *local_b0;
  uint *local_a0;
  uint *local_98;
  uint *local_90;
  longlong local_80;
  longlong local_78;
  uint local_70;
  longlong local_68;
  undefined1 local_60;
  undefined8 local_58;
  
  local_58 = 0xfffffffffffffffe;
  local_a0 = (uint *)0x0;
  local_98 = (uint *)0x0;
  local_90 = (uint *)0x0;
  local_c0 = (uint *)0x0;
  local_b8 = (uint *)0x0;
  local_b0 = (uint *)0x0;
  lVar18 = param_2[1] - *param_2 >> 2;
  local_68 = param_1 + 0xf630;
  local_res10 = param_2;
  local_res18 = param_3;
  local_res20 = param_4;
  local_80 = lVar18;
  FUN_14034ed40(local_68);
  local_60 = 1;
  local_70 = 0;
  local_78 = 0;
  puVar19 = local_b8;
  if ((int)lVar18 == 0) {
LAB_1401ee9fa:
    uVar20 = (longlong)puVar19 - (longlong)local_c0;
    lVar18 = param_2[1];
    lVar22 = *param_2;
    FUN_14034edd0(local_68);
    if (local_c0 != (uint *)0x0) {
      std::_Container_base0::_Orphan_all((_Container_base0 *)&local_c0);
      operator_delete(local_c0);
    }
    local_c0 = (uint *)0x0;
    local_b8 = (uint *)0x0;
    local_b0 = (uint *)0x0;
    if (local_a0 != (uint *)0x0) {
      std::_Container_base0::_Orphan_all((_Container_base0 *)&local_a0);
      operator_delete(local_a0);
    }
    return (ulonglong)(((uVar20 ^ lVar18 - lVar22) & 0xfffffffffffffffc) == 0);
  }
LAB_1401ed6d0:
  lVar22 = local_78;
  uVar1 = *(uint *)(*param_2 + local_78 * 4);
  uVar2 = *(uint *)(*param_3 + local_78 * 4);
  iVar3 = *(int *)(*param_4 + local_78 * 4);
  local_res8[0] = uVar1;
  if (uVar1 == 5) {
    lVar18 = FUN_140137690();
    puVar19 = local_b8;
    if (*(longlong *)(lVar18 + 0x88) != 0) {
      for (puVar13 = *(uint **)(*(longlong *)(lVar18 + 0x88) +
                               ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar18 + 0x98)) * 8);
          puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 0xa6)) {
        if ((puVar13[0xa8] == uVar2) && (*puVar13 == uVar2)) {
          if (puVar13 != (uint *)0x0) {
            if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar1 = puVar13[0x4c];
            lVar22 = local_78;
            if (1 < (int)uVar1) {
              local_c8[0] = 0;
              puVar13 = local_a0;
              puVar12 = local_98;
              iVar21 = DAT_1406093a4;
              goto LAB_1401ed780;
            }
          }
          break;
        }
      }
    }
    local_c8[0] = 0;
    puVar13 = local_98;
    puVar12 = local_a0;
    do {
      uVar1 = local_c8[0];
      if (local_c8[0] < 0x78) {
        plVar16 = (longlong *)((longlong)(int)local_c8[0] * 0xac + 0x50a8 + param_1);
      }
      else {
        if ((DAT_1406093a4 == 0) &&
           (pvVar8 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0), puVar19 = local_b8, puVar13 = local_98,
           puVar12 = local_a0, pvVar8 != (HANDLE)0x0)) {
          DVar7 = GetCurrentProcessId();
          pvVar9 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar9,DVar7,pvVar8,0x2000,0,0,0);
          CloseHandle(pvVar8);
          puVar19 = local_b8;
          puVar13 = local_98;
          puVar12 = local_a0;
        }
        DAT_1406093a4 = DAT_1406093a4 + 1;
        plVar16 = &DAT_14060d080;
      }
      if ((*plVar16 == 0) && (plVar16[1] == 0)) {
        bVar5 = false;
      }
      else {
        bVar5 = true;
      }
      if (((!bVar5) && ((int)plVar16[3] == 0)) &&
         (puVar10 = local_c0, puVar15 = puVar12, *(short *)((longlong)plVar16 + 0x1c) < 1)) {
        for (; puVar15 != puVar13; puVar15 = puVar15 + 1) {
          if (puVar10 != puVar19) {
            do {
              if ((*puVar15 == 5) && (*puVar10 == uVar1)) goto LAB_1401eded2;
              puVar10 = puVar10 + 1;
            } while (puVar10 != puVar19);
          }
        }
        if ((local_res8 < puVar13) && (puVar12 <= local_res8)) {
          puVar15 = puVar12;
          if (puVar13 == local_90) {
            uVar20 = (longlong)puVar13 - (longlong)puVar12 >> 2;
            if (0x3ffffffffffffffe < uVar20) {
              std::_Xlength_error("vector<T> too long");
              pcVar4 = (code *)swi(3);
              uVar20 = (*pcVar4)();
              return uVar20;
            }
            uVar20 = uVar20 + 1;
            uVar17 = (longlong)local_90 - (longlong)puVar12 >> 2;
            if (uVar17 < uVar20) {
              if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                uVar17 = 0;
              }
              else {
                uVar17 = uVar17 + (uVar17 >> 1);
              }
              if (uVar17 < uVar20) {
                uVar17 = uVar20;
              }
              FUN_140051e60(&local_a0,uVar17);
              puVar19 = local_b8;
              puVar13 = local_98;
              puVar15 = local_a0;
            }
          }
          puVar10 = (uint *)0x0;
          if (puVar13 != (uint *)0x0) {
            *puVar13 = puVar15[(longlong)local_res8 - (longlong)puVar12 >> 2];
            puVar19 = local_b8;
            puVar10 = local_98;
          }
        }
        else {
          if (puVar13 == local_90) {
            uVar20 = (longlong)puVar13 - (longlong)puVar12 >> 2;
            if (0x3ffffffffffffffe < uVar20) {
              std::_Xlength_error("vector<T> too long");
              pcVar4 = (code *)swi(3);
              uVar20 = (*pcVar4)();
              return uVar20;
            }
            uVar20 = uVar20 + 1;
            uVar17 = (longlong)local_90 - (longlong)puVar12 >> 2;
            if (uVar17 < uVar20) {
              if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                uVar17 = 0;
              }
              else {
                uVar17 = uVar17 + (uVar17 >> 1);
              }
              if (uVar17 < uVar20) {
                uVar17 = uVar20;
              }
              FUN_140051e60(&local_a0,uVar17);
              puVar19 = local_b8;
              puVar13 = local_98;
            }
          }
          puVar10 = (uint *)0x0;
          if (puVar13 != (uint *)0x0) {
            *puVar13 = 5;
            puVar19 = local_b8;
            puVar10 = local_98;
          }
        }
        local_98 = puVar10 + 1;
        if ((local_c8 < puVar19) && (local_c0 <= local_c8)) {
          lVar18 = (longlong)local_c8 - (longlong)local_c0 >> 2;
          if (puVar19 == local_b0) {
            uVar20 = (longlong)puVar19 - (longlong)local_c0 >> 2;
            if (0x3ffffffffffffffe < uVar20) {
              std::_Xlength_error("vector<T> too long");
              pcVar4 = (code *)swi(3);
              uVar20 = (*pcVar4)();
              return uVar20;
            }
            if ((ulonglong)((longlong)local_b0 - (longlong)local_c0 >> 2) < uVar20 + 1) {
              FUN_140051e60(&local_c0);
              puVar19 = local_b8;
            }
          }
          goto LAB_1401ee0a5;
        }
        if (puVar19 == local_b0) {
          uVar20 = (longlong)puVar19 - (longlong)local_c0 >> 2;
          if (0x3ffffffffffffffe < uVar20) {
            std::_Xlength_error("vector<T> too long");
            pcVar4 = (code *)swi(3);
            uVar20 = (*pcVar4)();
            return uVar20;
          }
          if ((ulonglong)((longlong)local_b0 - (longlong)local_c0 >> 2) < uVar20 + 1) {
            FUN_140051e60(&local_c0);
            puVar19 = local_b8;
          }
        }
        puVar13 = (uint *)0x0;
        if (puVar19 != (uint *)0x0) {
          *puVar19 = uVar1;
          puVar13 = local_b8;
        }
        local_b8 = puVar13 + 1;
        lVar18 = local_80;
        param_2 = local_res10;
        param_4 = local_res20;
        puVar19 = local_b8;
        break;
      }
LAB_1401eded2:
      local_c8[0] = uVar1 + 1;
      lVar18 = local_80;
      param_2 = local_res10;
      param_4 = local_res20;
    } while ((int)local_c8[0] < 0x78);
  }
  else if (uVar1 < 5) {
    lVar11 = FUN_140137690();
    lVar18 = local_80;
    param_2 = local_res10;
    param_4 = local_res20;
    puVar19 = local_b8;
    if (*(longlong *)(lVar11 + 0x88) != 0) {
      for (puVar13 = *(uint **)(*(longlong *)(lVar11 + 0x88) +
                               ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar11 + 0x98)) * 8);
          puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 0xa6)) {
        if ((puVar13[0xa8] == uVar2) && (*puVar13 == uVar2)) {
          if (puVar13 != (uint *)0x0) {
            if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (1 < (int)puVar13[0x4c]) {
              local_c8[0] = 0;
              goto LAB_1401ee1e0;
            }
          }
          break;
        }
      }
    }
    local_c8[0] = 0;
LAB_1401ee670:
    uVar2 = local_c8[0];
    plVar16 = (longlong *)
              (((longlong)(int)local_c8[0] + (longlong)(int)uVar1 * 0x18) * 0xac + param_1);
    if ((*plVar16 == 0) && (plVar16[1] == 0)) {
      bVar5 = false;
    }
    else {
      bVar5 = true;
    }
    if (((bVar5) || ((int)plVar16[3] != 0)) ||
       (puVar13 = local_c0, puVar12 = local_a0, 0 < *(short *)((longlong)plVar16 + 0x1c)))
    goto LAB_1401ee6de;
    for (; puVar12 != local_98; puVar12 = puVar12 + 1) {
      if (puVar13 != local_b8) {
        do {
          if ((*puVar12 == uVar1) && (*puVar13 == local_c8[0])) goto LAB_1401ee6de;
          puVar13 = puVar13 + 1;
        } while (puVar13 != local_b8);
      }
    }
    if ((local_res8 < local_98) && (local_a0 <= local_res8)) {
      lVar18 = (longlong)local_res8 - (longlong)local_a0;
      if (local_98 == local_90) {
        uVar20 = (longlong)local_98 - (longlong)local_a0 >> 2;
        if (0x3ffffffffffffffe < uVar20) {
          std::_Xlength_error("vector<T> too long");
          pcVar4 = (code *)swi(3);
          uVar20 = (*pcVar4)();
          return uVar20;
        }
        if ((ulonglong)((longlong)local_90 - (longlong)local_a0 >> 2) < uVar20 + 1) {
          FUN_140051e60(&local_a0);
        }
      }
      if (local_98 != (uint *)0x0) {
        *local_98 = local_a0[lVar18 >> 2];
      }
    }
    else {
      if (local_98 == local_90) {
        uVar20 = (longlong)local_98 - (longlong)local_a0 >> 2;
        if (0x3ffffffffffffffe < uVar20) {
          std::_Xlength_error("vector<T> too long");
          pcVar4 = (code *)swi(3);
          uVar20 = (*pcVar4)();
          return uVar20;
        }
        if ((ulonglong)((longlong)local_90 - (longlong)local_a0 >> 2) < uVar20 + 1) {
          FUN_140051e60(&local_a0);
        }
      }
      if (local_98 != (uint *)0x0) {
        *local_98 = uVar1;
      }
    }
    local_98 = local_98 + 1;
    if ((local_c8 < local_b8) && (local_c0 <= local_c8)) {
      lVar18 = (longlong)local_c8 - (longlong)local_c0 >> 2;
      puVar19 = local_b8;
      if (local_b8 == local_b0) {
        FUN_1400556a0(&local_c0);
        puVar19 = local_b8;
      }
LAB_1401ee0a5:
      puVar13 = (uint *)0x0;
      if (puVar19 != (uint *)0x0) {
        *puVar19 = local_c0[lVar18];
        puVar13 = local_b8;
      }
    }
    else {
      if (local_b8 == local_b0) {
        FUN_1400556a0(&local_c0);
      }
      puVar13 = local_b8;
      if (local_b8 != (uint *)0x0) {
        *local_b8 = uVar2;
      }
    }
    local_b8 = puVar13 + 1;
    lVar18 = local_80;
    param_2 = local_res10;
    param_4 = local_res20;
    puVar19 = local_b8;
  }
  goto LAB_1401ee890;
LAB_1401ed780:
  do {
    uVar6 = local_c8[0];
    if (local_c8[0] < 0x78) {
      plVar16 = (longlong *)((longlong)(int)local_c8[0] * 0xac + 0x50a8 + param_1);
    }
    else {
      if ((iVar21 == 0) &&
         (pvVar8 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                               (HANDLE)0x0), puVar13 = local_a0, puVar19 = local_b8,
         puVar12 = local_98, iVar21 = DAT_1406093a4, pvVar8 != (HANDLE)0x0)) {
        DVar7 = GetCurrentProcessId();
        pvVar9 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar9,DVar7,pvVar8,0x2000,0,0,0);
        CloseHandle(pvVar8);
        puVar13 = local_a0;
        puVar19 = local_b8;
        puVar12 = local_98;
        iVar21 = DAT_1406093a4;
      }
      iVar21 = iVar21 + 1;
      plVar16 = &DAT_14060d080;
      DAT_1406093a4 = iVar21;
    }
    if ((*plVar16 == 0) && (plVar16[1] == 0)) {
      bVar5 = false;
    }
    else {
      bVar5 = true;
    }
    if (((!bVar5) && ((int)plVar16[3] == 0)) &&
       (puVar10 = local_c0, puVar15 = puVar13, *(short *)((longlong)plVar16 + 0x1c) < 1)) {
      for (; puVar15 != puVar12; puVar15 = puVar15 + 1) {
        if (puVar10 != puVar19) {
          do {
            if ((*puVar15 == 5) && (*puVar10 == uVar6)) goto LAB_1401ed981;
            puVar10 = puVar10 + 1;
          } while (puVar10 != puVar19);
        }
      }
      if ((local_res8 < puVar12) && (puVar13 <= local_res8)) {
        puVar15 = puVar13;
        if (puVar12 == local_90) {
          uVar20 = (longlong)puVar12 - (longlong)puVar13 >> 2;
          if (0x3ffffffffffffffe < uVar20) {
            std::_Xlength_error("vector<T> too long");
            pcVar4 = (code *)swi(3);
            uVar20 = (*pcVar4)();
            return uVar20;
          }
          uVar20 = uVar20 + 1;
          uVar17 = (longlong)local_90 - (longlong)puVar13 >> 2;
          if (uVar17 < uVar20) {
            if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
              uVar17 = 0;
            }
            else {
              uVar17 = uVar17 + (uVar17 >> 1);
            }
            if (uVar17 < uVar20) {
              uVar17 = uVar20;
            }
            FUN_140051e60(&local_a0,uVar17);
            puVar15 = local_a0;
            puVar19 = local_b8;
            puVar12 = local_98;
          }
        }
        puVar10 = (uint *)0x0;
        if (puVar12 != (uint *)0x0) {
          *puVar12 = puVar15[(longlong)local_res8 - (longlong)puVar13 >> 2];
          puVar19 = local_b8;
          puVar10 = local_98;
        }
      }
      else {
        if (puVar12 == local_90) {
          uVar20 = (longlong)puVar12 - (longlong)puVar13 >> 2;
          if (0x3ffffffffffffffe < uVar20) {
            std::_Xlength_error("vector<T> too long");
            pcVar4 = (code *)swi(3);
            uVar20 = (*pcVar4)();
            return uVar20;
          }
          uVar20 = uVar20 + 1;
          uVar17 = (longlong)local_90 - (longlong)puVar13 >> 2;
          if (uVar17 < uVar20) {
            if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
              uVar17 = 0;
            }
            else {
              uVar17 = uVar17 + (uVar17 >> 1);
            }
            if (uVar17 < uVar20) {
              uVar17 = uVar20;
            }
            FUN_140051e60(&local_a0,uVar17);
            puVar19 = local_b8;
            puVar12 = local_98;
          }
        }
        puVar10 = (uint *)0x0;
        if (puVar12 != (uint *)0x0) {
          *puVar12 = 5;
          puVar19 = local_b8;
          puVar10 = local_98;
        }
      }
      local_98 = puVar10 + 1;
      if ((local_c8 < puVar19) && (local_c0 <= local_c8)) {
        lVar18 = (longlong)local_c8 - (longlong)local_c0 >> 2;
        if (puVar19 != local_b0) goto LAB_1401edb53;
        uVar20 = (longlong)puVar19 - (longlong)local_c0 >> 2;
        if (0x3ffffffffffffffe < uVar20) {
          std::_Xlength_error("vector<T> too long");
          pcVar4 = (code *)swi(3);
          uVar20 = (*pcVar4)();
          return uVar20;
        }
        goto LAB_1401edb11;
      }
      if (puVar19 == local_b0) {
        uVar20 = (longlong)puVar19 - (longlong)local_c0 >> 2;
        if (0x3ffffffffffffffe < uVar20) {
          std::_Xlength_error("vector<T> too long");
          pcVar4 = (code *)swi(3);
          uVar20 = (*pcVar4)();
          return uVar20;
        }
LAB_1401edb9d:
        if ((ulonglong)((longlong)local_b0 - (longlong)local_c0 >> 2) < uVar20 + 1) {
          FUN_140051e60(&local_c0);
          puVar19 = local_b8;
        }
      }
LAB_1401edbdf:
      puVar13 = (uint *)0x0;
      if (puVar19 != (uint *)0x0) {
        *puVar19 = uVar6;
        puVar13 = local_b8;
      }
      goto LAB_1401edb66;
    }
    if (uVar6 < 0x78) {
      puVar14 = (undefined8 *)((longlong)(int)uVar6 * 0xac + 0x50a8 + param_1);
    }
    else {
      if (iVar21 == 0) {
        FUN_140176d60(0);
        puVar13 = local_a0;
        puVar19 = local_b8;
        puVar12 = local_98;
        iVar21 = DAT_1406093a4;
      }
      iVar21 = iVar21 + 1;
      puVar14 = &DAT_14060d080;
      DAT_1406093a4 = iVar21;
    }
    if (*(uint *)(puVar14 + 3) == uVar2) {
      if (uVar6 < 0x78) {
        puVar14 = (undefined8 *)((longlong)(int)uVar6 * 0xac + 0x50a8 + param_1);
      }
      else {
        if (iVar21 == 0) {
          FUN_140176d60(0);
          puVar13 = local_a0;
          puVar19 = local_b8;
          puVar12 = local_98;
          iVar21 = DAT_1406093a4;
        }
        iVar21 = iVar21 + 1;
        puVar14 = &DAT_14060d080;
        DAT_1406093a4 = iVar21;
      }
      puVar10 = local_c0;
      puVar15 = puVar13;
      if (*(short *)((longlong)puVar14 + 0x1c) + iVar3 <= (int)uVar1) {
        for (; puVar15 != puVar12; puVar15 = puVar15 + 1) {
          if (puVar10 != puVar19) {
            do {
              if ((*puVar15 == 5) && (*puVar10 == uVar6)) goto LAB_1401ed981;
              puVar10 = puVar10 + 1;
            } while (puVar10 != puVar19);
          }
        }
        if ((local_res8 < puVar12) && (puVar13 <= local_res8)) {
          puVar15 = puVar13;
          if (puVar12 == local_90) {
            uVar20 = (longlong)puVar12 - (longlong)puVar13 >> 2;
            if (0x3ffffffffffffffe < uVar20) {
              std::_Xlength_error("vector<T> too long");
              pcVar4 = (code *)swi(3);
              uVar20 = (*pcVar4)();
              return uVar20;
            }
            uVar20 = uVar20 + 1;
            uVar17 = (longlong)local_90 - (longlong)puVar13 >> 2;
            if (uVar17 < uVar20) {
              if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                uVar17 = 0;
              }
              else {
                uVar17 = uVar17 + (uVar17 >> 1);
              }
              if (uVar17 < uVar20) {
                uVar17 = uVar20;
              }
              FUN_140051e60(&local_a0,uVar17);
              puVar15 = local_a0;
              puVar19 = local_b8;
              puVar12 = local_98;
            }
          }
          puVar10 = (uint *)0x0;
          if (puVar12 != (uint *)0x0) {
            *puVar12 = puVar15[(longlong)local_res8 - (longlong)puVar13 >> 2];
            puVar19 = local_b8;
            puVar10 = local_98;
          }
        }
        else {
          if (puVar12 == local_90) {
            uVar20 = (longlong)puVar12 - (longlong)puVar13 >> 2;
            if (0x3ffffffffffffffe < uVar20) {
              std::_Xlength_error("vector<T> too long");
              pcVar4 = (code *)swi(3);
              uVar20 = (*pcVar4)();
              return uVar20;
            }
            uVar20 = uVar20 + 1;
            uVar17 = (longlong)local_90 - (longlong)puVar13 >> 2;
            if (uVar17 < uVar20) {
              if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                uVar17 = 0;
              }
              else {
                uVar17 = uVar17 + (uVar17 >> 1);
              }
              if (uVar17 < uVar20) {
                uVar17 = uVar20;
              }
              FUN_140051e60(&local_a0,uVar17);
              puVar19 = local_b8;
              puVar12 = local_98;
            }
          }
          puVar10 = (uint *)0x0;
          if (puVar12 != (uint *)0x0) {
            *puVar12 = 5;
            puVar19 = local_b8;
            puVar10 = local_98;
          }
        }
        local_98 = puVar10 + 1;
        if ((puVar19 <= local_c8) || (local_c8 < local_c0)) {
          if (puVar19 == local_b0) {
            uVar20 = (longlong)puVar19 - (longlong)local_c0 >> 2;
            if (0x3ffffffffffffffe < uVar20) {
              std::_Xlength_error("vector<T> too long");
              pcVar4 = (code *)swi(3);
              uVar20 = (*pcVar4)();
              return uVar20;
            }
            goto LAB_1401edb9d;
          }
          goto LAB_1401edbdf;
        }
        lVar18 = (longlong)local_c8 - (longlong)local_c0 >> 2;
        if (puVar19 != local_b0) goto LAB_1401edb53;
        uVar20 = (longlong)puVar19 - (longlong)local_c0 >> 2;
        if (0x3ffffffffffffffe < uVar20) {
          std::_Xlength_error("vector<T> too long");
          pcVar4 = (code *)swi(3);
          uVar20 = (*pcVar4)();
          return uVar20;
        }
        goto LAB_1401edb11;
      }
    }
LAB_1401ed981:
    local_c8[0] = uVar6 + 1;
    lVar18 = local_80;
    param_2 = local_res10;
    param_4 = local_res20;
    lVar22 = local_78;
  } while ((int)local_c8[0] < 0x78);
  goto LAB_1401ee890;
LAB_1401ee1e0:
  do {
    uVar6 = local_c8[0];
    plVar16 = (longlong *)
              (((longlong)(int)local_c8[0] + (longlong)(int)uVar1 * 0x18) * 0xac + param_1);
    if ((*plVar16 == 0) && (plVar16[1] == 0)) {
      bVar5 = false;
    }
    else {
      bVar5 = true;
    }
    if (((!bVar5) && ((int)plVar16[3] == 0)) &&
       (puVar12 = local_c0, puVar10 = local_a0, *(short *)((longlong)plVar16 + 0x1c) < 1)) {
      for (; puVar10 != local_98; puVar10 = puVar10 + 1) {
        if (puVar12 != local_b8) {
          do {
            if ((*puVar10 == uVar1) && (*puVar12 == local_c8[0])) goto LAB_1401ee290;
            puVar12 = puVar12 + 1;
          } while (puVar12 != local_b8);
        }
      }
      if ((local_res8 < local_98) && (local_a0 <= local_res8)) {
        lVar18 = (longlong)local_res8 - (longlong)local_a0;
        if (local_98 == local_90) {
          uVar20 = (longlong)local_98 - (longlong)local_a0 >> 2;
          if (0x3ffffffffffffffe < uVar20) {
            std::_Xlength_error("vector<T> too long");
            pcVar4 = (code *)swi(3);
            uVar20 = (*pcVar4)();
            return uVar20;
          }
          uVar20 = uVar20 + 1;
          uVar17 = (longlong)local_90 - (longlong)local_a0 >> 2;
          if (uVar17 < uVar20) {
            if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
              uVar17 = 0;
            }
            else {
              uVar17 = uVar17 + (uVar17 >> 1);
            }
            if (uVar17 < uVar20) {
              uVar17 = uVar20;
            }
            FUN_140051e60(&local_a0,uVar17);
          }
        }
        if (local_98 != (uint *)0x0) {
          *local_98 = local_a0[lVar18 >> 2];
        }
      }
      else {
        if (local_98 == local_90) {
          uVar20 = (longlong)local_98 - (longlong)local_a0 >> 2;
          if (0x3ffffffffffffffe < uVar20) {
            std::_Xlength_error("vector<T> too long");
            pcVar4 = (code *)swi(3);
            uVar20 = (*pcVar4)();
            return uVar20;
          }
          uVar20 = uVar20 + 1;
          uVar17 = (longlong)local_90 - (longlong)local_a0 >> 2;
          if (uVar17 < uVar20) {
            if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
              uVar17 = 0;
            }
            else {
              uVar17 = uVar17 + (uVar17 >> 1);
            }
            if (uVar17 < uVar20) {
              uVar17 = uVar20;
            }
            FUN_140051e60(&local_a0,uVar17);
          }
        }
        if (local_98 != (uint *)0x0) {
          *local_98 = uVar1;
        }
      }
      local_98 = local_98 + 1;
      if ((local_c8 < local_b8) && (local_c0 <= local_c8)) {
        lVar18 = (longlong)local_c8 - (longlong)local_c0 >> 2;
        puVar19 = local_b8;
        if (local_b8 != local_b0) goto LAB_1401edb53;
        uVar20 = (longlong)local_b8 - (longlong)local_c0 >> 2;
        if (0x3ffffffffffffffe < uVar20) {
          std::_Xlength_error("vector<T> too long");
          pcVar4 = (code *)swi(3);
          uVar20 = (*pcVar4)();
          return uVar20;
        }
        goto LAB_1401edb11;
      }
      if (local_b8 == local_b0) {
        uVar20 = (longlong)local_b8 - (longlong)local_c0 >> 2;
        if (0x3ffffffffffffffe < uVar20) {
          std::_Xlength_error("vector<T> too long");
          pcVar4 = (code *)swi(3);
          uVar20 = (*pcVar4)();
          return uVar20;
        }
LAB_1401ee448:
        if ((ulonglong)((longlong)local_b0 - (longlong)local_c0 >> 2) < uVar20 + 1) {
          FUN_140051e60(&local_c0);
        }
      }
LAB_1401ee48a:
      puVar13 = local_b8;
      if (local_b8 != (uint *)0x0) {
        *local_b8 = uVar6;
      }
      goto LAB_1401edb66;
    }
    if ((*(uint *)(plVar16 + 3) == uVar2) &&
       (puVar12 = local_c0, puVar10 = local_a0,
       *(short *)((longlong)plVar16 + 0x1c) + iVar3 <= (int)puVar13[0x4c])) goto LAB_1401ee269;
LAB_1401ee290:
    local_c8[0] = local_c8[0] + 1;
    lVar22 = local_78;
  } while ((int)local_c8[0] < 0x18);
LAB_1401ee890:
  local_70 = local_70 + 1;
  local_78 = lVar22 + 1;
  param_3 = local_res18;
  if ((uint)lVar18 <= local_70) goto LAB_1401ee9fa;
  goto LAB_1401ed6d0;
LAB_1401ee269:
  for (; puVar10 != local_98; puVar10 = puVar10 + 1) {
    if (puVar12 != local_b8) {
      do {
        if ((*puVar10 == uVar1) && (*puVar12 == local_c8[0])) goto LAB_1401ee290;
        puVar12 = puVar12 + 1;
      } while (puVar12 != local_b8);
    }
  }
  if ((local_res8 < local_98) && (local_a0 <= local_res8)) {
    lVar18 = (longlong)local_res8 - (longlong)local_a0;
    if (local_98 == local_90) {
      uVar20 = (longlong)local_98 - (longlong)local_a0 >> 2;
      if (0x3ffffffffffffffe < uVar20) {
        std::_Xlength_error("vector<T> too long");
        pcVar4 = (code *)swi(3);
        uVar20 = (*pcVar4)();
        return uVar20;
      }
      uVar20 = uVar20 + 1;
      uVar17 = (longlong)local_90 - (longlong)local_a0 >> 2;
      if (uVar17 < uVar20) {
        if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
          uVar17 = 0;
        }
        else {
          uVar17 = uVar17 + (uVar17 >> 1);
        }
        if (uVar17 < uVar20) {
          uVar17 = uVar20;
        }
        FUN_140051e60(&local_a0,uVar17);
      }
    }
    if (local_98 != (uint *)0x0) {
      *local_98 = local_a0[lVar18 >> 2];
    }
  }
  else {
    if (local_98 == local_90) {
      uVar20 = (longlong)local_98 - (longlong)local_a0 >> 2;
      if (0x3ffffffffffffffe < uVar20) {
        std::_Xlength_error("vector<T> too long");
        pcVar4 = (code *)swi(3);
        uVar20 = (*pcVar4)();
        return uVar20;
      }
      uVar20 = uVar20 + 1;
      uVar17 = (longlong)local_90 - (longlong)local_a0 >> 2;
      if (uVar17 < uVar20) {
        if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
          uVar17 = 0;
        }
        else {
          uVar17 = uVar17 + (uVar17 >> 1);
        }
        if (uVar17 < uVar20) {
          uVar17 = uVar20;
        }
        FUN_140051e60(&local_a0,uVar17);
      }
    }
    if (local_98 != (uint *)0x0) {
      *local_98 = uVar1;
    }
  }
  local_98 = local_98 + 1;
  if ((local_b8 <= local_c8) || (local_c8 < local_c0)) {
    if (local_b8 == local_b0) {
      uVar20 = (longlong)local_b8 - (longlong)local_c0 >> 2;
      if (0x3ffffffffffffffe < uVar20) {
        std::_Xlength_error("vector<T> too long");
        pcVar4 = (code *)swi(3);
        uVar20 = (*pcVar4)();
        return uVar20;
      }
      goto LAB_1401ee448;
    }
    goto LAB_1401ee48a;
  }
  lVar18 = (longlong)local_c8 - (longlong)local_c0 >> 2;
  puVar19 = local_b8;
  if (local_b8 != local_b0) goto LAB_1401edb53;
  uVar20 = (longlong)local_b8 - (longlong)local_c0 >> 2;
  if (0x3ffffffffffffffe < uVar20) {
    std::_Xlength_error("vector<T> too long");
    pcVar4 = (code *)swi(3);
    uVar20 = (*pcVar4)();
    return uVar20;
  }
LAB_1401edb11:
  if ((ulonglong)((longlong)local_b0 - (longlong)local_c0 >> 2) < uVar20 + 1) {
    FUN_140051e60(&local_c0);
    puVar19 = local_b8;
  }
LAB_1401edb53:
  puVar13 = (uint *)0x0;
  if (puVar19 != (uint *)0x0) {
    *puVar19 = local_c0[lVar18];
    puVar13 = local_b8;
  }
LAB_1401edb66:
  local_b8 = puVar13 + 1;
  lVar18 = local_80;
  param_2 = local_res10;
  param_4 = local_res20;
  puVar19 = local_b8;
  lVar22 = local_78;
  goto LAB_1401ee890;
LAB_1401ee6de:
  local_c8[0] = local_c8[0] + 1;
  if (0x17 < (int)local_c8[0]) goto LAB_1401ee890;
  goto LAB_1401ee670;
}



int FUN_1401eea90(longlong param_1,int *param_2)

{
  bool bVar1;
  short *psVar2;
  int iVar3;
  longlong lVar4;
  
  if (*param_2 < 5) {
    FUN_14034ed40(param_1 + 0xf630);
    iVar3 = 0;
    lVar4 = 0;
    psVar2 = (short *)((longlong)*param_2 * 0x1020 + 0x1c + param_1);
    do {
      if ((*(longlong *)(psVar2 + -0xe) == 0) && (*(longlong *)(psVar2 + -10) == 0)) {
        bVar1 = false;
      }
      else {
        bVar1 = true;
      }
      if (((!bVar1) && (*(int *)(psVar2 + -2) == 0)) && (*psVar2 < 1)) {
        FUN_14034edd0(param_1 + 0xf630);
        return iVar3;
      }
      iVar3 = iVar3 + 1;
      lVar4 = lVar4 + 1;
      psVar2 = psVar2 + 0x56;
    } while (lVar4 < 0x18);
    FUN_14034edd0(param_1 + 0xf630);
  }
  return -1;
}



undefined8 FUN_1401eeb60(longlong param_1,int *param_2,longlong param_3,int *param_4)

{
  bool bVar1;
  longlong lVar2;
  uint *puVar3;
  short *psVar4;
  uint uVar5;
  int iVar6;
  
  if (*param_2 < 5) {
    uVar5 = *(uint *)(param_3 + 0x18);
    lVar2 = FUN_140137690();
    if (*(longlong *)(lVar2 + 0x88) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                              ((ulonglong)uVar5 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0xa6)) {
        if ((puVar3[0xa8] == uVar5) && (*puVar3 == uVar5)) {
          if (puVar3 != (uint *)0x0) {
            if (puVar3 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar5 = puVar3[0x4c];
            goto LAB_1401eec06;
          }
          break;
        }
      }
    }
    uVar5 = 1;
LAB_1401eec06:
    FUN_14034ed40(param_1 + 0xf630);
    lVar2 = 0;
    if ((int)uVar5 < 2) {
      psVar4 = (short *)((longlong)*param_2 * 0x1020 + 0x1c + param_1);
      do {
        if ((*(longlong *)(psVar4 + -0xe) == 0) && (*(longlong *)(psVar4 + -10) == 0)) {
          bVar1 = false;
        }
        else {
          bVar1 = true;
        }
        if (((!bVar1) && (*(int *)(psVar4 + -2) == 0)) && (*psVar4 < 1)) {
LAB_1401eec98:
          FUN_14034edd0(param_1 + 0xf630);
          return 1;
        }
        lVar2 = lVar2 + 1;
        psVar4 = psVar4 + 0x56;
      } while (lVar2 < 0x18);
    }
    else {
      iVar6 = 0;
      psVar4 = (short *)((longlong)*param_2 * 0x1020 + 0x1c + param_1);
      do {
        if ((*(longlong *)(psVar4 + -0xe) == 0) && (*(longlong *)(psVar4 + -10) == 0)) {
          bVar1 = false;
        }
        else {
          bVar1 = true;
        }
        if (((!bVar1) && (*(int *)(psVar4 + -2) == 0)) && (*psVar4 < 1)) goto LAB_1401eec98;
        if ((*(int *)(psVar4 + -2) == *(int *)(param_3 + 0x18)) &&
           ((int)*(short *)(param_3 + 0x1c) + (int)*psVar4 <= (int)uVar5)) {
          *param_4 = iVar6;
          goto LAB_1401eec98;
        }
        iVar6 = iVar6 + 1;
        lVar2 = lVar2 + 1;
        psVar4 = psVar4 + 0x56;
      } while (lVar2 < 0x18);
    }
    FUN_14034edd0(param_1 + 0xf630);
  }
  return 0;
}



void FUN_1401eed30(longlong param_1,longlong param_2,int *param_3,int *param_4,int *param_5,
                  ulonglong *param_6,undefined4 param_7)

{
  longlong lVar1;
  short *psVar2;
  int iVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong lVar6;
  ulonglong *puVar7;
  bool bVar8;
  undefined2 local_res18 [4];
  undefined4 uVar10;
  undefined4 *puVar9;
  undefined8 in_stack_fffffffffffffeb0;
  undefined4 *puVar11;
  undefined8 uVar12;
  ulonglong in_stack_fffffffffffffeb8;
  uint uVar14;
  longlong lVar13;
  undefined8 in_stack_fffffffffffffec0;
  undefined4 uVar17;
  undefined8 uVar15;
  int *piVar16;
  undefined8 in_stack_fffffffffffffec8;
  undefined4 uVar20;
  int *piVar18;
  undefined8 uVar19;
  int local_128 [2];
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  int local_100 [2];
  undefined8 local_f8;
  longlong local_f0;
  undefined1 local_e8;
  undefined1 local_e0 [168];
  undefined4 local_38;
  
  uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
  local_f8 = 0xfffffffffffffffe;
  if (((*param_3 < 5) && (-1 < *param_4)) && (*param_4 < 0x18)) {
    lVar1 = param_1 + 0xf630;
    local_f0 = lVar1;
    FUN_14034ed40(lVar1);
    local_e8 = 1;
    iVar3 = FUN_14011b180(param_6);
    uVar14 = (uint)(in_stack_fffffffffffffeb8 >> 0x20);
    if (iVar3 == 0) {
      puVar7 = (ulonglong *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
      bVar8 = *puVar7 < *param_6;
      if ((*puVar7 == *param_6) && (bVar8 = puVar7[1] < param_6[1], puVar7[1] == param_6[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
      }
      if (iVar3 == 0) {
        FUN_1401f3b10(param_1,*param_3,
                      -(((int)*(short *)((longlong)puVar7 + 0x1c) -
                        (int)*(short *)((longlong)param_6 + 0x1c)) * (int)puVar7[0xd]));
        lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
        local_128[0] = (int)*(short *)(lVar6 + 0x1c + param_1) -
                       (int)*(short *)((longlong)param_6 + 0x1c);
        *(short *)(lVar6 + 0x1c + param_1) = *(short *)((longlong)param_6 + 0x1c);
        local_110 = *(undefined4 *)(param_2 + 0x160);
        local_10c = *(undefined4 *)(param_2 + 0x164);
        local_108 = *(undefined4 *)(param_2 + 0x168);
        local_104 = *(undefined4 *)(param_2 + 0x16c);
        local_120 = *(undefined4 *)(param_2 + 0x170);
        local_11c = *(undefined4 *)(param_2 + 0x174);
        local_118 = *(undefined4 *)(param_2 + 0x178);
        local_114 = *(undefined4 *)(param_2 + 0x17c);
        iVar3 = *(int *)(param_2 + 0x284);
        uVar5 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)) {
          local_res18[0] = (undefined2)iVar3;
          plVar4 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar11 = &local_110;
          (**(code **)(*plVar4 + 0x140))
                    (plVar4,1,&DAT_1405d85a0,local_res18,&local_120,puVar11,uVar5);
          uVar10 = (undefined4)((ulonglong)puVar11 >> 0x20);
          in_stack_fffffffffffffeb8 = uVar5;
        }
        piVar18 = (int *)CONCAT44(uVar20,(int)*(short *)((longlong)param_6 + 0x16));
        uVar12 = CONCAT44(uVar17,*param_4);
        in_stack_fffffffffffffeb8 = in_stack_fffffffffffffeb8 & 0xffffffff00000000;
        puVar11 = (undefined4 *)CONCAT44(uVar10,local_128[0]);
        puVar7 = param_6;
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xc,param_2,param_6,puVar11,
                      in_stack_fffffffffffffeb8,uVar12,piVar18);
        uVar10 = (undefined4)((ulonglong)puVar7 >> 0x20);
        uVar17 = (undefined4)(in_stack_fffffffffffffeb8 >> 0x20);
        uVar20 = (undefined4)((ulonglong)uVar12 >> 0x20);
      }
      else {
        uVar19 = CONCAT44(uVar20,*param_4);
        uVar15 = CONCAT44(uVar17,(int)*(short *)((longlong)param_6 + 0x16));
        uVar5 = (ulonglong)uVar14 << 0x20;
        uVar12 = CONCAT44(uVar10,(int)*(short *)((longlong)param_6 + 0x1c));
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xb,param_2,param_6,uVar12,uVar5,uVar15
                      ,uVar19);
        lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        piVar18 = (int *)CONCAT44((int)((ulonglong)uVar19 >> 0x20),param_7);
        uVar15 = CONCAT44((int)((ulonglong)uVar15 >> 0x20),*param_4);
        uVar5 = uVar5 & 0xffffffff00000000;
        puVar11 = (undefined4 *)
                  CONCAT44((int)((ulonglong)uVar12 >> 0x20),(int)*(short *)(lVar6 + 0x1c));
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xc,param_2,lVar6,puVar11,uVar5,uVar15,
                      piVar18);
        uVar10 = (undefined4)((ulonglong)lVar6 >> 0x20);
        uVar17 = (undefined4)(uVar5 >> 0x20);
        uVar20 = (undefined4)((ulonglong)uVar15 >> 0x20);
        lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      -((int)*(short *)(lVar6 + 0x1c + param_1) * *(int *)(lVar6 + 0x68 + param_1)))
        ;
        FUN_140090020(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,param_6);
        local_110 = *(undefined4 *)(param_2 + 0x160);
        local_10c = *(undefined4 *)(param_2 + 0x164);
        local_108 = *(undefined4 *)(param_2 + 0x168);
        local_104 = *(undefined4 *)(param_2 + 0x16c);
        local_120 = *(undefined4 *)(param_2 + 0x170);
        local_11c = *(undefined4 *)(param_2 + 0x174);
        local_118 = *(undefined4 *)(param_2 + 0x178);
        local_114 = *(undefined4 *)(param_2 + 0x17c);
        iVar3 = *(int *)(param_2 + 0x284);
        local_100[0] = *param_3;
        local_128[0] = *param_4;
        lVar6 = ((longlong)local_128[0] + (longlong)local_100[0] * 0x18) * 0xac + param_1;
        if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar13 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar13 != 0)) {
          local_res18[0] = (undefined2)iVar3;
          plVar4 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar13 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          piVar18 = local_128;
          piVar16 = local_100;
          puVar11 = &local_110;
          puVar9 = &local_120;
          (**(code **)(*plVar4 + 0x130))
                    (plVar4,1,&DAT_1405d85a0,local_res18,puVar9,puVar11,lVar6,piVar16,piVar18);
          uVar10 = (undefined4)((ulonglong)puVar9 >> 0x20);
          uVar17 = (undefined4)((ulonglong)lVar6 >> 0x20);
          uVar20 = (undefined4)((ulonglong)piVar16 >> 0x20);
        }
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      *(int *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x68 +
                              param_1) * (int)*(short *)((longlong)param_6 + 0x1c));
      }
      FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_6,400,CONCAT44(uVar10,9),
                    (ulonglong)puVar11 & 0xffffffff00000000,
                    CONCAT44(uVar17,*(undefined4 *)(param_1 + 0x50a0)),
                    CONCAT44(uVar20,*(undefined4 *)(param_1 + 0x50a0)),
                    (ulonglong)piVar18 & 0xffffffff00000000,0);
      local_res18[0] = (undefined2)*param_4;
      local_128[0] = CONCAT22(local_128[0]._2_2_,(short)*param_3);
      lVar6 = (longlong)*param_4 + (longlong)*param_3 * 0x18;
    }
    else {
      lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
      uVar5 = CONCAT44(uVar20,param_7);
      uVar12 = CONCAT44(uVar17,*param_4);
      lVar13 = (ulonglong)uVar14 << 0x20;
      puVar11 = (undefined4 *)CONCAT44(uVar10,*param_5);
      FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xc,param_2,lVar6,puVar11,lVar13,uVar12,
                    uVar5);
      uVar20 = (undefined4)((ulonglong)uVar12 >> 0x20);
      uVar10 = (undefined4)((ulonglong)lVar6 >> 0x20);
      uVar17 = (undefined4)((ulonglong)lVar13 >> 0x20);
      lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
      iVar3 = *param_5;
      if (*(short *)(lVar6 + 0x1c + param_1) == iVar3) {
        FUN_1401f3b10(param_1,(longlong)*param_3,-(*(int *)(lVar6 + 0x68 + param_1) * iVar3));
        FUN_14000a170(local_e0);
        local_38 = 0;
        FUN_140090020(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,local_e0);
      }
      else {
        psVar2 = (short *)(lVar6 + 0x1c + param_1);
        *psVar2 = *psVar2 - (short)iVar3;
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      -(*(int *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x68 +
                                param_1) * *param_5));
        local_120 = *(undefined4 *)(param_2 + 0x160);
        local_11c = *(undefined4 *)(param_2 + 0x164);
        local_118 = *(undefined4 *)(param_2 + 0x168);
        local_114 = *(undefined4 *)(param_2 + 0x16c);
        local_110 = *(undefined4 *)(param_2 + 0x170);
        local_10c = *(undefined4 *)(param_2 + 0x174);
        local_108 = *(undefined4 *)(param_2 + 0x178);
        local_104 = *(undefined4 *)(param_2 + 0x17c);
        iVar3 = *(int *)(param_2 + 0x284);
        lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar13 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar13 != 0)) {
          local_res18[0] = (undefined2)iVar3;
          plVar4 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar13 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar11 = &local_120;
          puVar9 = &local_110;
          (**(code **)(*plVar4 + 0x140))(plVar4,1,&DAT_1405d85a0,local_res18,puVar9,puVar11,lVar6);
          uVar10 = (undefined4)((ulonglong)puVar9 >> 0x20);
          uVar17 = (undefined4)((ulonglong)lVar6 >> 0x20);
        }
      }
      FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_6,400,CONCAT44(uVar10,9),
                    (ulonglong)puVar11 & 0xffffffff00000000,
                    CONCAT44(uVar17,*(undefined4 *)(param_1 + 0x50a0)),
                    CONCAT44(uVar20,*(undefined4 *)(param_1 + 0x50a0)),uVar5 & 0xffffffff00000000,0)
      ;
      local_res18[0] = (undefined2)*param_4;
      local_128[0] = CONCAT22(local_128[0]._2_2_,(short)*param_3);
      lVar6 = (longlong)*param_4 + (longlong)*param_3 * 0x18;
    }
    plVar4 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar4 + 0xe0))
              (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_128,local_res18,
               lVar6 * 0xac + param_1);
    FUN_14034edd0(lVar1);
  }
  return;
}



void FUN_1401ef490(longlong param_1,longlong param_2,int *param_3,int *param_4,int *param_5,
                  ulonglong *param_6)

{
  longlong lVar1;
  short *psVar2;
  int iVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong lVar6;
  ulonglong *puVar7;
  bool bVar8;
  undefined2 local_res18 [4];
  undefined8 in_stack_fffffffffffffeb0;
  undefined4 *puVar9;
  ulonglong in_stack_fffffffffffffeb8;
  uint uVar11;
  undefined8 in_stack_fffffffffffffec0;
  undefined4 uVar12;
  undefined8 in_stack_fffffffffffffec8;
  undefined4 uVar13;
  int local_128 [2];
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  int local_100 [2];
  undefined8 local_f8;
  longlong local_f0;
  undefined1 local_e8;
  undefined1 local_e0 [168];
  undefined4 local_38;
  undefined4 uVar10;
  
  uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar12 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
  local_f8 = 0xfffffffffffffffe;
  if (((*param_3 < 5) && (-1 < *param_4)) && (*param_4 < 0x18)) {
    lVar1 = param_1 + 0xf630;
    local_f0 = lVar1;
    FUN_14034ed40(lVar1);
    local_e8 = 1;
    iVar3 = FUN_14011b180(param_6);
    uVar11 = (uint)(in_stack_fffffffffffffeb8 >> 0x20);
    if (iVar3 == 0) {
      puVar7 = (ulonglong *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
      bVar8 = *puVar7 < *param_6;
      if ((*puVar7 == *param_6) && (bVar8 = puVar7[1] < param_6[1], puVar7[1] == param_6[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
      }
      if (iVar3 == 0) {
        local_128[0] = (int)*(short *)((longlong)puVar7 + 0x1c) -
                       (int)*(short *)((longlong)param_6 + 0x1c);
        FUN_1401f3b10(param_1,*param_3,-((int)puVar7[0xd] * local_128[0]));
        *(undefined2 *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x1c + param_1) =
             *(undefined2 *)((longlong)param_6 + 0x1c);
        local_110 = *(undefined4 *)(param_2 + 0x160);
        local_10c = *(undefined4 *)(param_2 + 0x164);
        local_108 = *(undefined4 *)(param_2 + 0x168);
        local_104 = *(undefined4 *)(param_2 + 0x16c);
        local_120 = *(undefined4 *)(param_2 + 0x170);
        local_11c = *(undefined4 *)(param_2 + 0x174);
        local_118 = *(undefined4 *)(param_2 + 0x178);
        local_114 = *(undefined4 *)(param_2 + 0x17c);
        iVar3 = *(int *)(param_2 + 0x284);
        uVar5 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)) {
          local_res18[0] = (undefined2)iVar3;
          plVar4 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar9 = &local_110;
          (**(code **)(*plVar4 + 0x140))
                    (plVar4,1,&DAT_1405d85a0,local_res18,&local_120,puVar9,uVar5);
          uVar10 = (undefined4)((ulonglong)puVar9 >> 0x20);
          in_stack_fffffffffffffeb8 = uVar5;
        }
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xc,param_2,
                      ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,
                      CONCAT44(uVar10,local_128[0]),in_stack_fffffffffffffeb8 & 0xffffffff00000000,
                      CONCAT44(uVar12,*param_4),
                      CONCAT44(uVar13,(int)*(short *)((longlong)param_6 + 0x16)));
      }
      else {
        uVar5 = (ulonglong)uVar11 << 0x20;
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xc,param_2,puVar7,
                      CONCAT44(uVar10,(int)*(short *)((longlong)puVar7 + 0x1c)),uVar5,
                      CONCAT44(uVar12,*param_4),
                      CONCAT44(uVar13,(int)*(short *)((longlong)param_6 + 0x16)));
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xb,param_2,param_6,
                      (int)*(short *)((longlong)param_6 + 0x1c),uVar5 & 0xffffffff00000000,
                      (int)*(short *)((longlong)param_6 + 0x16),*param_4);
        lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      -((int)*(short *)(lVar6 + 0x1c + param_1) * *(int *)(lVar6 + 0x68 + param_1)))
        ;
        FUN_140090020(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,param_6);
        local_110 = *(undefined4 *)(param_2 + 0x160);
        local_10c = *(undefined4 *)(param_2 + 0x164);
        local_108 = *(undefined4 *)(param_2 + 0x168);
        local_104 = *(undefined4 *)(param_2 + 0x16c);
        local_120 = *(undefined4 *)(param_2 + 0x170);
        local_11c = *(undefined4 *)(param_2 + 0x174);
        local_118 = *(undefined4 *)(param_2 + 0x178);
        local_114 = *(undefined4 *)(param_2 + 0x17c);
        iVar3 = *(int *)(param_2 + 0x284);
        local_100[0] = *param_3;
        local_128[0] = *param_4;
        if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)) {
          local_res18[0] = (undefined2)iVar3;
          plVar4 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar4 + 0x130))
                    (plVar4,1,&DAT_1405d85a0,local_res18,&local_120,&local_110,
                     ((longlong)local_128[0] + (longlong)local_100[0] * 0x18) * 0xac + param_1,
                     local_100,local_128);
        }
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      *(int *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x68 +
                              param_1) * (int)*(short *)((longlong)param_6 + 0x1c));
      }
      local_res18[0] = (undefined2)*param_4;
      local_128[0] = CONCAT22(local_128[0]._2_2_,(short)*param_3);
      lVar6 = (longlong)*param_4 + (longlong)*param_3 * 0x18;
    }
    else {
      FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xc,param_2,
                    ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,
                    CONCAT44(uVar10,*param_5),(ulonglong)uVar11 << 0x20,CONCAT44(uVar12,*param_4),
                    CONCAT44(uVar13,(int)*(short *)((longlong)param_6 + 0x16)));
      lVar6 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
      iVar3 = *param_5;
      if (*(short *)(lVar6 + 0x1c + param_1) == iVar3) {
        FUN_1401f3b10(param_1,(longlong)*param_3,-(*(int *)(lVar6 + 0x68 + param_1) * iVar3));
        FUN_14000a170(local_e0);
        local_38 = 0;
        FUN_140090020(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,local_e0);
      }
      else {
        psVar2 = (short *)(lVar6 + 0x1c + param_1);
        *psVar2 = *psVar2 - (short)iVar3;
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      -(*(int *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x68 +
                                param_1) * *param_5));
        local_120 = *(undefined4 *)(param_2 + 0x160);
        local_11c = *(undefined4 *)(param_2 + 0x164);
        local_118 = *(undefined4 *)(param_2 + 0x168);
        local_114 = *(undefined4 *)(param_2 + 0x16c);
        local_110 = *(undefined4 *)(param_2 + 0x170);
        local_10c = *(undefined4 *)(param_2 + 0x174);
        local_108 = *(undefined4 *)(param_2 + 0x178);
        local_104 = *(undefined4 *)(param_2 + 0x17c);
        iVar3 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)) {
          local_res18[0] = (undefined2)iVar3;
          plVar4 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar4 + 0x140))
                    (plVar4,1,&DAT_1405d85a0,local_res18,&local_110,&local_120,
                     ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
        }
      }
      local_res18[0] = (undefined2)*param_4;
      local_128[0] = CONCAT22(local_128[0]._2_2_,(short)*param_3);
      lVar6 = (longlong)*param_4 + (longlong)*param_3 * 0x18;
    }
    plVar4 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar4 + 0xe0))
              (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_128,local_res18,
               lVar6 * 0xac + param_1);
    FUN_14034edd0(lVar1);
  }
  return;
}



undefined8
FUN_1401efb60(longlong param_1,longlong param_2,undefined4 *param_3,int *param_4,int *param_5,
             int *param_6,longlong param_7)

{
  short *psVar1;
  short sVar2;
  longlong lVar3;
  undefined8 *puVar4;
  int iVar5;
  int iVar6;
  undefined4 *puVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined8 uVar11;
  longlong lVar12;
  bool bVar13;
  undefined2 local_res20 [4];
  undefined8 in_stack_fffffffffffffe88;
  undefined4 uVar15;
  undefined4 *puVar14;
  undefined8 in_stack_fffffffffffffe90;
  undefined4 uVar16;
  undefined4 *in_stack_fffffffffffffe98;
  undefined4 uVar18;
  ulonglong uVar17;
  undefined8 in_stack_fffffffffffffea0;
  undefined4 uVar22;
  undefined4 *puVar19;
  undefined8 uVar20;
  int *piVar21;
  longlong *in_stack_fffffffffffffea8;
  undefined4 uVar24;
  undefined8 uVar23;
  undefined2 local_148;
  undefined2 local_146;
  undefined2 local_144;
  undefined2 local_142;
  undefined2 local_140;
  undefined2 local_13e [3];
  int local_138 [2];
  undefined4 local_130 [2];
  undefined4 local_128 [2];
  undefined4 local_120 [2];
  int local_118 [2];
  int local_110 [2];
  int local_108 [2];
  longlong local_100;
  undefined1 local_f8;
  longlong *local_f0;
  longlong *local_e8;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined8 local_40;
  undefined1 local_38 [16];
  
  uVar15 = (undefined4)((ulonglong)in_stack_fffffffffffffe88 >> 0x20);
  uVar16 = (undefined4)((ulonglong)in_stack_fffffffffffffe90 >> 0x20);
  uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
  local_40 = 0xfffffffffffffffe;
  if (((4 < *param_4) || (*param_5 < 0)) || (0x17 < *param_5)) {
    return 0;
  }
  lVar10 = param_1 + 0xf630;
  local_100 = lVar10;
  FUN_14034ed40(lVar10);
  local_f8 = 1;
  iVar5 = FUN_14011b180(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
  if (iVar5 == 0) {
    uVar11 = FUN_140137690();
    iVar5 = FUN_140136a70(uVar11,param_3[6]);
    uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffe98 >> 0x20);
    uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffea8 >> 0x20);
    lVar12 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac;
    if (*(int *)(lVar12 + 0x18 + param_1) == param_3[6]) {
      if ((iVar5 < 2) || (iVar5 < (int)*(short *)(lVar12 + 0x1c + param_1) + *param_6)) {
        FUN_14034edd0(lVar10);
        return 0;
      }
      psVar1 = (short *)(lVar12 + 0x1c + param_1);
      *psVar1 = *psVar1 + (short)*param_6;
      FUN_1401f3b10(param_1,(longlong)*param_4,
                    *(int *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x68 +
                            param_1) * *param_6);
      local_d0 = *(undefined4 *)(param_2 + 0x160);
      local_cc = *(undefined4 *)(param_2 + 0x164);
      local_c8 = *(undefined4 *)(param_2 + 0x168);
      local_c4 = *(undefined4 *)(param_2 + 0x16c);
      local_b0 = *(undefined4 *)(param_2 + 0x170);
      local_ac = *(undefined4 *)(param_2 + 0x174);
      local_a8 = *(undefined4 *)(param_2 + 0x178);
      local_a4 = *(undefined4 *)(param_2 + 0x17c);
      iVar5 = *(int *)(param_2 + 0x284);
      puVar7 = (undefined4 *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
      if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar12 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar12 != 0)) {
        local_144 = (undefined2)iVar5;
        plVar8 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        puVar14 = &local_d0;
        (**(code **)(*plVar8 + 0x140))(plVar8,1,&DAT_1405d85a0,&local_144,&local_b0,puVar14,puVar7);
        uVar16 = (undefined4)((ulonglong)puVar14 >> 0x20);
        in_stack_fffffffffffffe98 = puVar7;
      }
      if ((int)*(short *)(param_3 + 7) == *param_6) {
        local_90 = *(undefined4 *)(param_2 + 0x160);
        local_8c = *(undefined4 *)(param_2 + 0x164);
        local_88 = *(undefined4 *)(param_2 + 0x168);
        local_84 = *(undefined4 *)(param_2 + 0x16c);
        local_70 = *(undefined4 *)(param_2 + 0x170);
        local_6c = *(undefined4 *)(param_2 + 0x174);
        local_68 = *(undefined4 *)(param_2 + 0x178);
        local_64 = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        local_130[0] = 0xffffffff;
        local_128[0] = 0xfffffff4;
        if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar12 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar12 != 0)) {
          local_148 = (undefined2)iVar5;
          plVar8 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar14 = local_130;
          puVar19 = local_128;
          puVar7 = &local_90;
          in_stack_fffffffffffffe98 = param_3;
          (**(code **)(*plVar8 + 0x130))
                    (plVar8,1,&DAT_1405d85a0,&local_148,&local_70,puVar7,param_3,puVar19,puVar14);
          uVar16 = (undefined4)((ulonglong)puVar7 >> 0x20);
          uVar22 = (undefined4)((ulonglong)puVar19 >> 0x20);
          uVar24 = (undefined4)((ulonglong)puVar14 >> 0x20);
        }
        uVar23 = CONCAT44(uVar24,*param_5);
        uVar20 = CONCAT44(uVar22,(int)*(short *)((longlong)param_3 + 0x16));
        in_stack_fffffffffffffe98 =
             (undefined4 *)((ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000);
        uVar11 = CONCAT44(uVar16,(int)*(short *)(param_3 + 7));
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c5,0x20,param_2,param_3,uVar11,
                      in_stack_fffffffffffffe98,uVar20,uVar23);
        uVar16 = (undefined4)((ulonglong)uVar11 >> 0x20);
        uVar22 = (undefined4)((ulonglong)uVar20 >> 0x20);
        uVar24 = (undefined4)((ulonglong)uVar23 >> 0x20);
      }
      uVar17 = CONCAT44(uVar24,*param_5);
      FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xb,param_2,
                    ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,
                    CONCAT44(uVar16,*param_6),
                    (ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000,
                    CONCAT44(uVar22,(int)*(short *)((longlong)param_3 + 0x16)),uVar17);
      FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,400,8,
                    *(undefined4 *)
                     (((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x10 + param_1),
                    *(undefined4 *)(param_1 + 0x50a0),*(undefined4 *)(param_1 + 0x50a0),
                    uVar17 & 0xffffffff00000000,0);
      goto LAB_1401f06a9;
    }
    FUN_1401f3b10(param_1,*param_4,
                  -((int)*(short *)(lVar12 + 0x1c + param_1) * *(int *)(lVar12 + 0x68 + param_1)));
    FUN_140090020(param_7,((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
    FUN_140090020(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,param_3);
    local_50 = *(undefined4 *)(param_2 + 0x160);
    local_4c = *(undefined4 *)(param_2 + 0x164);
    local_48 = *(undefined4 *)(param_2 + 0x168);
    local_44 = *(undefined4 *)(param_2 + 0x16c);
    local_60 = *(undefined4 *)(param_2 + 0x170);
    local_5c = *(undefined4 *)(param_2 + 0x174);
    local_58 = *(undefined4 *)(param_2 + 0x178);
    local_54 = *(undefined4 *)(param_2 + 0x17c);
    iVar5 = *(int *)(param_2 + 0x284);
    local_138[0] = *param_4;
    local_118[0] = *param_5;
    lVar12 = ((longlong)local_118[0] + (longlong)local_138[0] * 0x18) * 0xac + param_1;
    if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
       (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
      local_146 = (undefined2)iVar5;
      plVar8 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
               0x70);
      in_stack_fffffffffffffea8 = (longlong *)local_118;
      piVar21 = local_138;
      puVar7 = &local_50;
      puVar14 = &local_60;
      (**(code **)(*plVar8 + 0x130))
                (plVar8,1,&DAT_1405d85a0,&local_146,puVar14,puVar7,lVar12,piVar21,
                 in_stack_fffffffffffffea8);
      uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
      uVar16 = (undefined4)((ulonglong)puVar7 >> 0x20);
      uVar18 = (undefined4)((ulonglong)lVar12 >> 0x20);
      uVar22 = (undefined4)((ulonglong)piVar21 >> 0x20);
    }
    FUN_1401f3b10(param_1,(longlong)*param_4,
                  *(int *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x68 + param_1)
                  * (int)*(short *)(param_3 + 7));
    uVar17 = CONCAT44(uVar18,*(undefined4 *)(param_1 + 0x50a0));
    FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,400,CONCAT44(uVar15,8),
                  CONCAT44(uVar16,*(undefined4 *)
                                   (((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x10 +
                                   param_1)),uVar17,
                  CONCAT44(uVar22,*(undefined4 *)(param_1 + 0x50a0)),
                  (ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000,0);
    lVar12 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1;
    in_stack_fffffffffffffe98 = (undefined4 *)(uVar17 & 0xffffffff00000000);
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xb,param_2,lVar12,
                  (int)*(short *)(lVar12 + 0x1c),in_stack_fffffffffffffe98,
                  (int)*(short *)((longlong)param_3 + 0x16),*param_5);
    iVar5 = (int)*(short *)((longlong)param_3 + 0x16);
    sVar2 = *(short *)(param_7 + 0x1c);
    iVar6 = *param_5;
    uVar11 = 0xc;
  }
  else {
    FUN_140090020();
    uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffe98 >> 0x20);
    *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x14 + param_1) =
         (short)*param_4;
    *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x16 + param_1) =
         (short)*param_5;
    if ((int)*(short *)(param_3 + 7) == *param_6) {
      FUN_1401f3b10(param_1,(longlong)*param_4,
                    *(int *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x68 +
                            param_1) * *param_6);
      local_c0 = *(undefined4 *)(param_2 + 0x160);
      local_bc = *(undefined4 *)(param_2 + 0x164);
      local_b8 = *(undefined4 *)(param_2 + 0x168);
      local_b4 = *(undefined4 *)(param_2 + 0x16c);
      local_80 = *(undefined4 *)(param_2 + 0x170);
      local_7c = *(undefined4 *)(param_2 + 0x174);
      local_78 = *(undefined4 *)(param_2 + 0x178);
      local_74 = *(undefined4 *)(param_2 + 0x17c);
      iVar5 = *(int *)(param_2 + 0x284);
      local_110[0] = *param_4;
      local_108[0] = *param_5;
      lVar12 = ((longlong)local_108[0] + (longlong)local_110[0] * 0x18) * 0xac + param_1;
      if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
        local_res20[0] = (undefined2)iVar5;
        plVar8 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        in_stack_fffffffffffffea8 = (longlong *)local_108;
        piVar21 = local_110;
        puVar7 = &local_c0;
        puVar14 = &local_80;
        (**(code **)(*plVar8 + 0x130))
                  (plVar8,1,&DAT_1405d85a0,local_res20,puVar14,puVar7,lVar12,piVar21,
                   in_stack_fffffffffffffea8);
        uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
        uVar16 = (undefined4)((ulonglong)puVar7 >> 0x20);
        uVar18 = (undefined4)((ulonglong)lVar12 >> 0x20);
        uVar22 = (undefined4)((ulonglong)piVar21 >> 0x20);
      }
      in_stack_fffffffffffffe98 = (undefined4 *)CONCAT44(uVar18,*(undefined4 *)(param_1 + 0x50a0));
      FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,400,CONCAT44(uVar15,8),
                    CONCAT44(uVar16,*(undefined4 *)
                                     (((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x10
                                     + param_1)),in_stack_fffffffffffffe98,
                    CONCAT44(uVar22,*(undefined4 *)(param_1 + 0x50a0)),
                    (ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000,0);
    }
    else {
      puVar7 = (undefined4 *)FUN_140357570(local_38);
      lVar10 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac;
      *(undefined4 *)(lVar10 + param_1) = *puVar7;
      *(undefined4 *)(lVar10 + 4 + param_1) = puVar7[1];
      *(undefined4 *)(lVar10 + 8 + param_1) = puVar7[2];
      *(undefined4 *)(lVar10 + 0xc + param_1) = puVar7[3];
      *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x1c + param_1) =
           (short)*param_6;
      *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x14 + param_1) =
           (short)*param_4;
      *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x16 + param_1) =
           (short)*param_5;
      FUN_1401f3b10(param_1,(longlong)*param_4,
                    *(int *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x68 +
                            param_1) * *param_6);
      local_a0 = *(undefined4 *)(param_2 + 0x160);
      local_9c = *(undefined4 *)(param_2 + 0x164);
      local_98 = *(undefined4 *)(param_2 + 0x168);
      local_94 = *(undefined4 *)(param_2 + 0x16c);
      local_e0 = *(undefined4 *)(param_2 + 0x170);
      local_dc = *(undefined4 *)(param_2 + 0x174);
      local_d8 = *(undefined4 *)(param_2 + 0x178);
      local_d4 = *(undefined4 *)(param_2 + 0x17c);
      iVar5 = *(int *)(param_2 + 0x284);
      plVar8 = (longlong *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
      local_120[0] = *(undefined4 *)(param_2 + 8);
      if ((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
        if ((*plVar8 == 0) && (plVar8[1] == 0)) {
          bVar13 = false;
        }
        else {
          bVar13 = true;
        }
        if (((bVar13) && ((int)plVar8[3] != 0)) &&
           (lVar10 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar10 != 0)) {
          local_140 = (undefined2)iVar5;
          plVar9 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          uVar22 = 1;
          in_stack_fffffffffffffe98 = &local_a0;
          puVar7 = &local_e0;
          puVar14 = local_120;
          (**(code **)(*plVar9 + 0xb0))
                    (plVar9,1,&DAT_1405d85a0,&local_140,puVar14,puVar7,in_stack_fffffffffffffe98,
                     &DAT_14047b9ec,plVar8);
          uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
          uVar16 = (undefined4)((ulonglong)puVar7 >> 0x20);
          in_stack_fffffffffffffea8 = plVar8;
        }
      }
      FUN_140198570(param_2,&local_f0);
      plVar8 = local_f0;
      if (local_f0 != (longlong *)0x0) {
        if (local_f0 == local_e8) {
          if (*local_f0 != 0) {
            in_stack_fffffffffffffe98 =
                 (undefined4 *)
                 CONCAT44((int)((ulonglong)in_stack_fffffffffffffe98 >> 0x20),
                          *(undefined4 *)(param_1 + 0x50a0));
            FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,400,CONCAT44(uVar15,8),
                          CONCAT44(uVar16,*(undefined4 *)
                                           (((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac
                                            + 0x10 + param_1)),in_stack_fffffffffffffe98,
                          CONCAT44(uVar22,*(undefined4 *)(param_1 + 0x50a0)),
                          (ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000,0);
          }
        }
        else {
          iVar5 = DAT_14060804c + 1;
          bVar13 = DAT_14060804c == 0;
          DAT_14060804c = iVar5;
          if (bVar13) {
            FUN_140176d60(1);
          }
        }
      }
      lVar10 = local_100;
      if (plVar8 != (longlong *)0x0) {
        if (plVar8 == local_e8) {
          LOCK();
          plVar8 = plVar8 + 1;
          *(int *)plVar8 = (int)*plVar8 + -1;
          UNLOCK();
          if ((int)*plVar8 == 0) {
            puVar4 = (undefined8 *)*local_f0;
            if (puVar4 != (undefined8 *)0x0) {
              (**(code **)*puVar4)(puVar4,1);
            }
            operator_delete(local_f0);
            lVar10 = local_100;
          }
        }
        else {
          iVar5 = DAT_140608054 + 1;
          bVar13 = DAT_140608054 == 0;
          DAT_140608054 = iVar5;
          if (bVar13) {
            FUN_140176d60(1);
            lVar10 = local_100;
          }
        }
      }
    }
    iVar5 = *param_5;
    param_7 = ((longlong)iVar5 + (longlong)*param_4 * 0x18) * 0xac + param_1;
    iVar6 = (int)*(short *)((longlong)param_3 + 0x16);
    sVar2 = *(short *)(param_7 + 0x1c);
    uVar11 = 0xb;
  }
  FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,uVar11,param_2,param_7,(int)sVar2,
                (ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000,iVar6,iVar5);
LAB_1401f06a9:
  local_142 = (undefined2)*param_5;
  local_13e[0] = (undefined2)*param_4;
  plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
  (**(code **)(*plVar8 + 0xe0))
            (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_13e,&local_142,
             ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
  FUN_14034edd0(lVar10);
  return 1;
}



undefined8
FUN_1401f0750(longlong param_1,longlong param_2,ulonglong param_3,int *param_4,int *param_5,
             int *param_6,undefined4 param_7,int param_8)

{
  short *psVar1;
  short sVar2;
  longlong lVar3;
  undefined8 *puVar4;
  int iVar5;
  undefined8 uVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong lVar9;
  undefined4 *puVar10;
  bool bVar11;
  undefined2 local_res20 [4];
  undefined8 in_stack_fffffffffffffea8;
  undefined4 *puVar12;
  undefined8 in_stack_fffffffffffffeb0;
  undefined4 uVar13;
  undefined4 uVar14;
  undefined4 *in_stack_fffffffffffffeb8;
  ulonglong uVar15;
  undefined8 in_stack_fffffffffffffec0;
  undefined4 uVar18;
  undefined8 uVar16;
  undefined4 *puVar17;
  longlong *in_stack_fffffffffffffec8;
  undefined4 uVar20;
  ulonglong uVar19;
  undefined2 local_128;
  undefined2 local_126;
  undefined2 local_124;
  undefined2 local_122;
  undefined2 local_120;
  undefined2 local_11e;
  int local_11c;
  undefined4 local_118 [2];
  undefined4 local_110 [2];
  int local_108 [2];
  int local_100 [2];
  undefined4 local_f8 [2];
  longlong *local_f0;
  longlong *local_e8;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  longlong local_50;
  undefined1 local_48;
  undefined8 local_40;
  undefined1 local_38 [16];
  
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  uVar14 = (undefined4)((ulonglong)in_stack_fffffffffffffea8 >> 0x20);
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  local_40 = 0xfffffffffffffffe;
  if (((*param_4 < 5) && (-1 < *param_5)) && (*param_5 < 0x18)) {
    local_50 = param_1 + 0xf630;
    FUN_14034ed40(local_50);
    local_48 = 1;
    sVar2 = *(short *)(param_3 + 0x16);
    local_11c = (int)sVar2;
    iVar5 = FUN_14011b180(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
    uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
    if (iVar5 == 0) {
      uVar6 = FUN_140137690();
      iVar5 = FUN_140136a70(uVar6,*(undefined4 *)(param_3 + 0x18));
      lVar9 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac;
      if ((*(int *)(lVar9 + 0x18 + param_1) == *(int *)(param_3 + 0x18)) && (1 < iVar5)) {
        if (iVar5 < (int)*(short *)(lVar9 + 0x1c + param_1) + *param_6) {
          FUN_14034edd0(local_50);
          goto LAB_1401f1195;
        }
        psVar1 = (short *)(lVar9 + 0x1c + param_1);
        *psVar1 = *psVar1 + (short)*param_6;
        FUN_1401f3b10(param_1,(longlong)*param_4,
                      *(int *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x68 +
                              param_1) * *param_6);
        local_b0 = *(undefined4 *)(param_2 + 0x160);
        local_ac = *(undefined4 *)(param_2 + 0x164);
        local_a8 = *(undefined4 *)(param_2 + 0x168);
        local_a4 = *(undefined4 *)(param_2 + 0x16c);
        local_90 = *(undefined4 *)(param_2 + 0x170);
        local_8c = *(undefined4 *)(param_2 + 0x174);
        local_88 = *(undefined4 *)(param_2 + 0x178);
        local_84 = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        puVar10 = (undefined4 *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
        if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
          local_122 = (undefined2)iVar5;
          plVar7 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar12 = &local_b0;
          (**(code **)(*plVar7 + 0x140))
                    (plVar7,1,&DAT_1405d85a0,&local_122,&local_90,puVar12,puVar10);
          uVar13 = (undefined4)((ulonglong)puVar12 >> 0x20);
          in_stack_fffffffffffffeb8 = puVar10;
        }
        uVar19 = CONCAT44(uVar20,*param_5);
        uVar16 = CONCAT44(uVar18,(int)sVar2);
        uVar15 = (ulonglong)in_stack_fffffffffffffeb8 & 0xffffffff00000000;
        uVar6 = CONCAT44(uVar13,*param_6);
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xb,param_2,
                      ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,uVar6,uVar15
                      ,uVar16,uVar19);
        iVar5 = *param_6;
        uVar19 = uVar19 & 0xffffffff00000000;
        uVar16 = CONCAT44((int)((ulonglong)uVar16 >> 0x20),*(undefined4 *)(param_1 + 0x50a0));
        uVar15 = CONCAT44((int)(uVar15 >> 0x20),*(undefined4 *)(param_1 + 0x50a0));
        lVar9 = (longlong)*param_5 + (longlong)*param_4 * 0x18;
        uVar14 = (undefined4)((ulonglong)uVar6 >> 0x20);
        if (*(short *)(param_3 + 0x1c) == iVar5) {
          lVar9 = lVar9 * 0xac + param_1;
          uVar6 = CONCAT44(uVar14,*(undefined4 *)(lVar9 + 0x18));
          FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,lVar9,0x199,param_7,uVar6,uVar15,
                        uVar16,uVar19,iVar5);
          uVar14 = (undefined4)((ulonglong)uVar6 >> 0x20);
          uVar13 = (undefined4)((ulonglong)uVar16 >> 0x20);
          uVar18 = (undefined4)(uVar19 >> 0x20);
          local_60 = *(undefined4 *)(param_2 + 0x160);
          local_5c = *(undefined4 *)(param_2 + 0x164);
          local_58 = *(undefined4 *)(param_2 + 0x168);
          local_54 = *(undefined4 *)(param_2 + 0x16c);
          local_70 = *(undefined4 *)(param_2 + 0x170);
          local_6c = *(undefined4 *)(param_2 + 0x174);
          local_68 = *(undefined4 *)(param_2 + 0x178);
          local_64 = *(undefined4 *)(param_2 + 0x17c);
          iVar5 = *(int *)(param_2 + 0x284);
          local_110[0] = 0xffffffff;
          local_118[0] = 0xfffffff4;
          if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
             (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
            local_128 = (undefined2)iVar5;
            plVar7 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            puVar12 = local_110;
            puVar17 = local_118;
            puVar10 = &local_60;
            (**(code **)(*plVar7 + 0x130))
                      (plVar7,1,&DAT_1405d85a0,&local_128,&local_70,puVar10,param_3,puVar17,puVar12)
            ;
            uVar14 = (undefined4)((ulonglong)puVar10 >> 0x20);
            uVar13 = (undefined4)((ulonglong)puVar17 >> 0x20);
            uVar18 = (undefined4)((ulonglong)puVar12 >> 0x20);
            uVar15 = param_3;
          }
          FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x16,param_2,
                        ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,
                        CONCAT44(uVar14,*param_6),uVar15 & 0xffffffff00000000,
                        CONCAT44(uVar13,local_11c),CONCAT44(uVar18,*param_5));
        }
        else {
          lVar9 = lVar9 * 0xac + param_1;
          FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,lVar9,0x198,param_7,
                        CONCAT44(uVar14,*(undefined4 *)(lVar9 + 0x18)),uVar15,uVar16,uVar19,iVar5);
        }
      }
    }
    else {
      *(short *)(param_3 + 0x14) = (short)*param_4;
      *(short *)(param_3 + 0x16) = (short)*param_5;
      FUN_140090020(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,param_3);
      *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x16 + param_1) =
           (short)*param_5;
      FUN_1401f3b10(param_1,(longlong)*param_4,
                    *(int *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x68 +
                            param_1) * *param_6);
      if ((int)*(short *)(param_3 + 0x1c) == *param_6) {
        in_stack_fffffffffffffeb8 =
             (undefined4 *)
             CONCAT44((int)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20),
                      *(undefined4 *)(param_1 + 0x50a0));
        FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,
                      ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,400,
                      CONCAT44(uVar14,param_7),CONCAT44(uVar13,*(undefined4 *)(param_3 + 0x18)),
                      in_stack_fffffffffffffeb8,CONCAT44(uVar18,*(undefined4 *)(param_1 + 0x50a0)),
                      (ulonglong)in_stack_fffffffffffffec8 & 0xffffffff00000000,0);
        local_c0 = *(undefined4 *)(param_2 + 0x160);
        local_bc = *(undefined4 *)(param_2 + 0x164);
        local_b8 = *(undefined4 *)(param_2 + 0x168);
        local_b4 = *(undefined4 *)(param_2 + 0x16c);
        local_e0 = *(undefined4 *)(param_2 + 0x170);
        local_dc = *(undefined4 *)(param_2 + 0x174);
        local_d8 = *(undefined4 *)(param_2 + 0x178);
        local_d4 = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        local_108[0] = *param_4;
        local_100[0] = *param_5;
        puVar10 = (undefined4 *)
                  (((longlong)local_100[0] + (longlong)local_108[0] * 0x18) * 0xac + param_1);
        if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
          local_res20[0] = (undefined2)iVar5;
          plVar7 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar7 + 0x130))
                    (plVar7,1,&DAT_1405d85a0,local_res20,&local_e0,&local_c0,puVar10,local_108,
                     local_100);
          in_stack_fffffffffffffeb8 = puVar10;
        }
      }
      else {
        puVar10 = (undefined4 *)FUN_140357570(local_38);
        lVar9 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac;
        *(undefined4 *)(lVar9 + param_1) = *puVar10;
        *(undefined4 *)(lVar9 + 4 + param_1) = puVar10[1];
        *(undefined4 *)(lVar9 + 8 + param_1) = puVar10[2];
        *(undefined4 *)(lVar9 + 0xc + param_1) = puVar10[3];
        *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x1c + param_1) =
             (short)*param_6;
        *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x14 + param_1) =
             (short)*param_4;
        *(short *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + 0x16 + param_1) =
             (short)*param_5;
        local_a0 = *(undefined4 *)(param_2 + 0x160);
        local_9c = *(undefined4 *)(param_2 + 0x164);
        local_98 = *(undefined4 *)(param_2 + 0x168);
        local_94 = *(undefined4 *)(param_2 + 0x16c);
        local_80 = *(undefined4 *)(param_2 + 0x170);
        local_7c = *(undefined4 *)(param_2 + 0x174);
        local_78 = *(undefined4 *)(param_2 + 0x178);
        local_74 = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        plVar7 = (longlong *)(((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
        local_f8[0] = *(undefined4 *)(param_2 + 8);
        bVar11 = false;
        if ((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
          if ((*plVar7 != 0) || (plVar7[1] != 0)) {
            bVar11 = true;
          }
          if (((bVar11) && ((int)plVar7[3] != 0)) &&
             (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
            local_126 = (undefined2)iVar5;
            plVar8 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            uVar18 = 1;
            in_stack_fffffffffffffeb8 = &local_a0;
            puVar10 = &local_80;
            puVar12 = local_f8;
            (**(code **)(*plVar8 + 0xb0))
                      (plVar8,1,&DAT_1405d85a0,&local_126,puVar12,puVar10,in_stack_fffffffffffffeb8,
                       &DAT_14047b9e4,plVar7);
            uVar14 = (undefined4)((ulonglong)puVar12 >> 0x20);
            uVar13 = (undefined4)((ulonglong)puVar10 >> 0x20);
            in_stack_fffffffffffffec8 = plVar7;
          }
        }
        if (param_8 == 1) {
          local_d0 = *(undefined4 *)(param_2 + 0x160);
          local_cc = *(undefined4 *)(param_2 + 0x164);
          local_c8 = *(undefined4 *)(param_2 + 0x168);
          local_c4 = *(undefined4 *)(param_2 + 0x16c);
          iVar5 = *(int *)(param_2 + 0x284);
          lVar9 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1;
          if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
             (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
            local_11e = (undefined2)iVar5;
            plVar7 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            puVar10 = &local_d0;
            (**(code **)(*plVar7 + 4000))(plVar7,1,&DAT_1405d85a0,&local_11e,puVar10,lVar9);
            uVar14 = (undefined4)((ulonglong)puVar10 >> 0x20);
            uVar13 = (undefined4)((ulonglong)lVar9 >> 0x20);
          }
        }
        FUN_140198570(param_2,&local_f0);
        plVar7 = local_f0;
        if (local_f0 != (longlong *)0x0) {
          if (local_f0 == local_e8) {
            if (*local_f0 != 0) {
              in_stack_fffffffffffffeb8 =
                   (undefined4 *)
                   CONCAT44((int)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20),
                            *(undefined4 *)(param_1 + 0x50a0));
              FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,
                            ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1,0x197,
                            CONCAT44(uVar14,param_7),
                            CONCAT44(uVar13,*(undefined4 *)(param_3 + 0x18)),
                            in_stack_fffffffffffffeb8,
                            CONCAT44(uVar18,*(undefined4 *)(param_1 + 0x50a0)),
                            (ulonglong)in_stack_fffffffffffffec8 & 0xffffffff00000000,0);
            }
          }
          else {
            iVar5 = DAT_14060804c + 1;
            bVar11 = DAT_14060804c == 0;
            DAT_14060804c = iVar5;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar7 != (longlong *)0x0) {
          if (plVar7 == local_e8) {
            LOCK();
            plVar7 = plVar7 + 1;
            *(int *)plVar7 = (int)*plVar7 + -1;
            UNLOCK();
            if ((int)*plVar7 == 0) {
              puVar4 = (undefined8 *)*local_f0;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              operator_delete(local_f0);
            }
          }
          else {
            iVar5 = DAT_140608054 + 1;
            bVar11 = DAT_140608054 == 0;
            DAT_140608054 = iVar5;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
      }
      lVar9 = ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1;
      FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xb,param_2,lVar9,
                    (int)*(short *)(lVar9 + 0x1c),
                    (ulonglong)in_stack_fffffffffffffeb8 & 0xffffffff00000000,local_11c,*param_5);
    }
    local_124 = (undefined2)*param_5;
    local_120 = (undefined2)*param_4;
    plVar7 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar7 + 0xe0))
              (plVar7,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_120,&local_124,
               ((longlong)*param_5 + (longlong)*param_4 * 0x18) * 0xac + param_1);
    FUN_14034edd0(local_50);
    uVar6 = 1;
  }
  else {
LAB_1401f1195:
    uVar6 = 0;
  }
  return uVar6;
}



undefined8
FUN_1401f11c0(undefined8 param_1,undefined8 param_2,int *param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 param_6,undefined4 param_7)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  int iVar4;
  undefined4 local_28 [4];
  
  uVar3 = param_7;
  uVar2 = param_6;
  local_28[0] = *param_5;
  param_5._0_4_ = 0;
  while ((iVar1 = (int)param_5, *param_3 < 0 ||
         (iVar4 = FUN_1401f1280(param_1,param_2,param_3,&param_5,param_4,local_28,uVar2,uVar3),
         iVar4 == 0))) {
    param_5._0_4_ = iVar1 + 1;
    if (0x17 < (int)param_5) {
      return 0;
    }
  }
  return 1;
}



undefined8
FUN_1401f1280(longlong param_1,longlong param_2,int *param_3,int *param_4,int *param_5,int *param_6,
             undefined4 param_7,undefined4 param_8)

{
  longlong lVar1;
  short *psVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  longlong *plVar6;
  longlong lVar7;
  ulonglong uVar8;
  undefined2 local_res18 [4];
  undefined4 *puVar9;
  undefined8 in_stack_fffffffffffffeb0;
  undefined4 uVar11;
  undefined4 *puVar10;
  ulonglong in_stack_fffffffffffffeb8;
  undefined8 in_stack_fffffffffffffec0;
  undefined4 uVar14;
  undefined8 uVar12;
  undefined4 *puVar13;
  undefined8 in_stack_fffffffffffffec8;
  undefined4 uVar17;
  ulonglong uVar15;
  undefined4 *puVar16;
  undefined4 local_128 [2];
  undefined4 local_120 [2];
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  longlong local_f8;
  undefined1 local_f0;
  undefined8 local_e8;
  undefined1 local_e0 [168];
  undefined4 local_38;
  
  uVar11 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar14 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
  local_e8 = 0xfffffffffffffffe;
  if (((*param_3 < 5) && (-1 < *param_4)) && (*param_4 < 0x18)) {
    lVar1 = param_1 + 0xf630;
    local_f8 = lVar1;
    FUN_14034ed40(lVar1);
    local_f0 = 1;
    lVar7 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
    if (*(int *)(lVar7 + 0x18 + param_1) == *param_5) {
      iVar4 = (int)*(short *)(lVar7 + 0x1c + param_1);
      iVar5 = *param_6;
      if (iVar5 < iVar4) {
        psVar2 = (short *)(lVar7 + 0x1c + param_1);
        *psVar2 = *psVar2 - (short)iVar5;
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      -(*(int *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x68 +
                                param_1) * *param_6));
        lVar7 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        iVar5 = (int)*(short *)(lVar7 + 0x1c);
        uVar15 = CONCAT44(uVar17,iVar5);
        uVar12 = CONCAT44(uVar14,iVar5 + *param_6);
        in_stack_fffffffffffffeb8 = in_stack_fffffffffffffeb8 & 0xffffffff00000000;
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),param_7,param_8,param_2,lVar7,
                      CONCAT44(uVar11,*param_6),in_stack_fffffffffffffeb8,uVar12,uVar15);
        uVar11 = (undefined4)(in_stack_fffffffffffffeb8 >> 0x20);
        uVar14 = (undefined4)((ulonglong)uVar12 >> 0x20);
        *param_6 = 0;
        local_118 = *(undefined4 *)(param_2 + 0x160);
        local_114 = *(undefined4 *)(param_2 + 0x164);
        local_110 = *(undefined4 *)(param_2 + 0x168);
        local_10c = *(undefined4 *)(param_2 + 0x16c);
        local_108 = *(undefined4 *)(param_2 + 0x170);
        local_104 = *(undefined4 *)(param_2 + 0x174);
        local_100 = *(undefined4 *)(param_2 + 0x178);
        local_fc = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        lVar7 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
          local_res18[0] = (undefined2)iVar5;
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar6 + 0x140))
                    (plVar6,1,&DAT_1405d85a0,local_res18,&local_108,&local_118,lVar7);
          uVar11 = (undefined4)((ulonglong)lVar7 >> 0x20);
        }
        local_res18[0] = (undefined2)*param_4;
        local_128[0] = CONCAT22(local_128[0]._2_2_,(short)*param_3);
        plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        uVar8 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        (**(code **)(*plVar6 + 0xe0))
                  (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_128,local_res18,uVar8);
        FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,
                      ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,0x192,
                      param_8,uVar8 & 0xffffffff00000000,
                      CONCAT44(uVar11,*(undefined4 *)(param_1 + 0x50a0)),
                      CONCAT44(uVar14,*(undefined4 *)(param_1 + 0x50a0)),uVar15 & 0xffffffff00000000
                      ,0);
        FUN_14034edd0(lVar1);
        return 1;
      }
      if (iVar4 == iVar5) {
        psVar2 = (short *)(lVar7 + 0x1c + param_1);
        *psVar2 = *psVar2 - (short)iVar5;
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      -(*(int *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x68 +
                                param_1) * *param_6));
        lVar7 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        puVar16 = (undefined4 *)CONCAT44(uVar17,(int)*(short *)(lVar7 + 0x1c));
        uVar12 = CONCAT44(uVar14,(int)*(short *)(lVar7 + 0x1c) + *param_6);
        in_stack_fffffffffffffeb8 = in_stack_fffffffffffffeb8 & 0xffffffff00000000;
        puVar10 = (undefined4 *)CONCAT44(uVar11,*param_6);
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),param_7,param_8,param_2,lVar7,puVar10,
                      in_stack_fffffffffffffeb8,uVar12,puVar16);
        uVar11 = (undefined4)((ulonglong)lVar7 >> 0x20);
        uVar14 = (undefined4)(in_stack_fffffffffffffeb8 >> 0x20);
        uVar17 = (undefined4)((ulonglong)uVar12 >> 0x20);
        *param_6 = 0;
        local_108 = *(undefined4 *)(param_2 + 0x160);
        local_104 = *(undefined4 *)(param_2 + 0x164);
        local_100 = *(undefined4 *)(param_2 + 0x168);
        local_fc = *(undefined4 *)(param_2 + 0x16c);
        local_118 = *(undefined4 *)(param_2 + 0x170);
        local_114 = *(undefined4 *)(param_2 + 0x174);
        local_110 = *(undefined4 *)(param_2 + 0x178);
        local_10c = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        lVar7 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        local_128[0] = 0xffffffff;
        local_120[0] = 0xfffffff8;
        if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
          local_res18[0] = (undefined2)iVar5;
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar16 = local_128;
          puVar13 = local_120;
          puVar10 = &local_108;
          puVar9 = &local_118;
          (**(code **)(*plVar6 + 0x130))
                    (plVar6,1,&DAT_1405d85a0,local_res18,puVar9,puVar10,lVar7,puVar13,puVar16);
          uVar11 = (undefined4)((ulonglong)puVar9 >> 0x20);
          uVar14 = (undefined4)((ulonglong)lVar7 >> 0x20);
          uVar17 = (undefined4)((ulonglong)puVar13 >> 0x20);
        }
        FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,
                      ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,0x192,
                      CONCAT44(uVar11,param_8),(ulonglong)puVar10 & 0xffffffff00000000,
                      CONCAT44(uVar14,*(undefined4 *)(param_1 + 0x50a0)),
                      CONCAT44(uVar17,*(undefined4 *)(param_1 + 0x50a0)),
                      (ulonglong)puVar16 & 0xffffffff00000000,0);
        FUN_14000a170(local_e0);
        local_38 = 0;
        FUN_140090020(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,local_e0);
        local_res18[0] = (undefined2)*param_4;
        local_128[0] = CONCAT22(local_128[0]._2_2_,(short)*param_3);
        plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar6 + 0xe0))
                  (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_128,local_res18,
                   ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
        FUN_14034edd0(lVar1);
        return 1;
      }
      if (iVar4 < iVar5) {
        iVar5 = iVar5 - iVar4;
        *param_6 = iVar5;
        lVar7 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        puVar16 = (undefined4 *)CONCAT44(uVar17,(int)*(short *)(lVar7 + 0x1c));
        uVar12 = CONCAT44(uVar14,*(short *)(lVar7 + 0x1c) + iVar5);
        in_stack_fffffffffffffeb8 = in_stack_fffffffffffffeb8 & 0xffffffff00000000;
        puVar10 = (undefined4 *)CONCAT44(uVar11,iVar5);
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),param_7,param_8,param_2,lVar7,puVar10,
                      in_stack_fffffffffffffeb8,uVar12,puVar16);
        uVar11 = (undefined4)((ulonglong)lVar7 >> 0x20);
        uVar14 = (undefined4)(in_stack_fffffffffffffeb8 >> 0x20);
        uVar17 = (undefined4)((ulonglong)uVar12 >> 0x20);
        lVar7 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
        FUN_1401f3b10(param_1,(longlong)*param_3,
                      -((int)*(short *)(lVar7 + 0x1c + param_1) * *(int *)(lVar7 + 0x68 + param_1)))
        ;
        local_108 = *(undefined4 *)(param_2 + 0x160);
        local_104 = *(undefined4 *)(param_2 + 0x164);
        local_100 = *(undefined4 *)(param_2 + 0x168);
        local_fc = *(undefined4 *)(param_2 + 0x16c);
        local_118 = *(undefined4 *)(param_2 + 0x170);
        local_114 = *(undefined4 *)(param_2 + 0x174);
        local_110 = *(undefined4 *)(param_2 + 0x178);
        local_10c = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        lVar7 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        local_120[0] = 0xffffffff;
        local_128[0] = 0xfffffff8;
        if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
          local_res18[0] = (undefined2)iVar5;
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar16 = local_120;
          puVar13 = local_128;
          puVar10 = &local_108;
          puVar9 = &local_118;
          (**(code **)(*plVar6 + 0x130))
                    (plVar6,1,&DAT_1405d85a0,local_res18,puVar9,puVar10,lVar7,puVar13,puVar16);
          uVar11 = (undefined4)((ulonglong)puVar9 >> 0x20);
          uVar14 = (undefined4)((ulonglong)lVar7 >> 0x20);
          uVar17 = (undefined4)((ulonglong)puVar13 >> 0x20);
        }
        FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,
                      ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,0x192,
                      CONCAT44(uVar11,param_8),(ulonglong)puVar10 & 0xffffffff00000000,
                      CONCAT44(uVar14,*(undefined4 *)(param_1 + 0x50a0)),
                      CONCAT44(uVar17,*(undefined4 *)(param_1 + 0x50a0)),
                      (ulonglong)puVar16 & 0xffffffff00000000,0);
        *(undefined2 *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x1c + param_1) =
             0;
        FUN_14000a170(local_e0);
        local_38 = 0;
        FUN_140090020(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,local_e0);
        local_res18[0] = (undefined2)*param_4;
        local_128[0] = CONCAT22(local_128[0]._2_2_,(short)*param_3);
        plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar6 + 0xe0))
                  (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_128,local_res18,
                   ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
      }
    }
    FUN_14034edd0(lVar1);
  }
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001401f1e30)

undefined4
FUN_1401f1af0(longlong param_1,longlong param_2,int *param_3,int *param_4,undefined4 param_5,
             int param_6,float *param_7,undefined4 *param_8,int *param_9,int param_10)

{
  char cVar1;
  void *pvVar2;
  longlong *plVar3;
  short sVar4;
  int iVar5;
  int iVar6;
  undefined4 uVar7;
  int iVar8;
  uint uVar9;
  undefined4 uVar10;
  undefined8 uVar11;
  undefined8 *puVar12;
  longlong lVar13;
  size_t sVar14;
  longlong *plVar15;
  wchar_t *pwVar16;
  ulonglong uVar17;
  uint *puVar18;
  longlong lVar19;
  char *pcVar20;
  wchar_t *******_Src;
  undefined8 uVar21;
  bool bVar22;
  float fVar23;
  float fVar24;
  void *local_res18;
  undefined8 in_stack_fffffffffffffc58;
  undefined4 uVar26;
  undefined4 *puVar25;
  undefined8 in_stack_fffffffffffffc60;
  undefined4 uVar28;
  undefined4 *puVar27;
  undefined8 in_stack_fffffffffffffc68;
  undefined4 uVar29;
  undefined8 in_stack_fffffffffffffc70;
  undefined4 uVar30;
  undefined8 in_stack_fffffffffffffc78;
  ulonglong uVar31;
  undefined4 uVar33;
  int *piVar32;
  undefined2 local_370;
  undefined2 local_36e;
  undefined2 local_36c [2];
  undefined4 local_368;
  undefined4 local_360 [2];
  int local_358 [2];
  longlong *local_350;
  longlong *local_348;
  undefined4 local_340;
  undefined4 local_33c;
  undefined4 local_338;
  undefined4 local_334;
  undefined4 local_330;
  undefined4 local_32c;
  undefined4 local_328;
  undefined4 local_324;
  undefined4 local_320;
  undefined4 uStack_31c;
  undefined4 uStack_318;
  undefined4 uStack_314;
  undefined4 local_310;
  undefined4 local_30c;
  undefined4 local_308;
  undefined4 local_304;
  undefined4 local_300;
  undefined4 local_2fc;
  undefined4 local_2f8;
  undefined4 local_2f4;
  longlong *local_2f0;
  longlong *local_2e8;
  undefined1 local_2e0;
  undefined7 uStack_2df;
  undefined8 local_2d0;
  ulonglong local_2c8;
  longlong local_2b8;
  undefined1 local_2b0;
  wchar_t ******local_2a8 [2];
  ulonglong local_298;
  ulonglong local_290;
  undefined8 local_280;
  undefined1 local_278 [8];
  int local_270;
  undefined4 local_26c;
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined4 local_258;
  undefined4 local_254;
  undefined4 local_250;
  wchar_t local_24c [16];
  wchar_t local_22c [50];
  undefined8 local_1c8;
  undefined8 uStack_1c0;
  undefined2 local_1b8;
  undefined1 local_1b6;
  int local_1b5;
  undefined1 local_1a8 [16];
  undefined8 local_198;
  undefined8 uStack_190;
  undefined4 local_180;
  undefined2 local_17c;
  undefined4 local_174;
  undefined4 local_130;
  short local_11c;
  undefined4 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar29 = (undefined4)((ulonglong)in_stack_fffffffffffffc68 >> 0x20);
  uVar30 = (undefined4)((ulonglong)in_stack_fffffffffffffc70 >> 0x20);
  uVar33 = (undefined4)((ulonglong)in_stack_fffffffffffffc78 >> 0x20);
  uVar28 = (undefined4)((ulonglong)in_stack_fffffffffffffc60 >> 0x20);
  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffc58 >> 0x20);
  local_280 = 0xfffffffffffffffe;
  if (((4 < *param_3) || (*param_4 < 0)) || (0x17 < *param_4)) {
    return 0;
  }
  local_368 = 0;
  uVar11 = FUN_140130e80();
  fVar23 = (float)FUN_140130af0(uVar11,param_6,param_5);
  fVar24 = *param_7;
  iVar5 = rand();
  local_2b8 = param_1 + 0xf630;
  FUN_14034ed40();
  local_2b0 = 1;
  lVar19 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac;
  local_320 = *(undefined4 *)(lVar19 + param_1);
  uStack_31c = *(undefined4 *)(lVar19 + 4 + param_1);
  uStack_318 = *(undefined4 *)(lVar19 + 8 + param_1);
  uStack_314 = *(undefined4 *)(lVar19 + 0xc + param_1);
  iVar6 = (int)*(short *)(lVar19 + 0x28 + param_1);
  uVar11 = FUN_140137690();
  uVar7 = FUN_1401373a0(uVar11,*(undefined4 *)(lVar19 + 0x18 + param_1),param_6 + -1);
  if (fVar23 * fVar24 < (float)(int)((float)iVar5 * 3.0517578e-05 * 100.0)) {
    uVar11 = FUN_140137690();
    iVar5 = FUN_1401369d0(uVar11,*param_8);
    if (iVar5 == 0x14) goto LAB_1401f2391;
    uVar11 = FUN_140130e80();
    iVar5 = FUN_140130bb0(uVar11,param_6,param_5);
    sVar4 = 0;
    uVar11 = FUN_140137690();
    iVar8 = FUN_1401369d0(uVar11,*param_8);
    if (iVar8 == 0x1b) {
      iVar5 = 3;
      uVar11 = FUN_140137690();
      sVar4 = FUN_140137640(uVar11,*param_8);
    }
    else {
      uVar11 = FUN_140137690();
      iVar8 = FUN_1401369d0(uVar11,*param_8);
      if (iVar8 == 0x34) {
        if (param_10 == 1) {
          iVar5 = 3;
          sVar4 = 1;
        }
        else {
          iVar5 = 4;
        }
      }
      else {
        uVar11 = FUN_140130e80();
        sVar4 = FUN_140130c50(uVar11,param_6,param_5);
      }
    }
    *param_9 = iVar5;
    if (iVar5 != 1) {
      if (iVar5 == 3) {
        *(short *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x28 + param_1) =
             ((short)param_6 - sVar4) + -1;
        *(undefined4 *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0xa8 + param_1) =
             0;
        lVar19 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        uVar31 = CONCAT44(uVar33,(int)*(short *)(lVar19 + 0x28));
        uVar17 = CONCAT44(uVar28,(int)*(short *)(lVar19 + 0x1c));
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x19f,0xd,param_2,lVar19,uVar17,
                      CONCAT44(uVar29,uVar7),CONCAT44(uVar30,iVar6),uVar31);
        uVar26 = *(undefined4 *)(param_1 + 0x50a0);
        uVar31 = uVar31 & 0xffffffff00000000;
        uVar17 = uVar17 & 0xffffffff00000000;
        uVar11 = 0x5c;
      }
      else {
        if (iVar5 != 2) goto LAB_1401f2391;
        *(undefined2 *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x28 + param_1) =
             0;
        *(undefined4 *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0xa8 + param_1) =
             0;
        lVar19 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
        uVar31 = CONCAT44(uVar33,(int)*(short *)(lVar19 + 0x28));
        uVar17 = CONCAT44(uVar28,(int)*(short *)(lVar19 + 0x1c));
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x19f,0xc,param_2,lVar19,uVar17,
                      CONCAT44(uVar29,uVar7),CONCAT44(uVar30,iVar6),uVar31);
        uVar26 = *(undefined4 *)(param_1 + 0x50a0);
        uVar31 = uVar31 & 0xffffffff00000000;
        uVar17 = uVar17 & 0xffffffff00000000;
        uVar11 = 0x5b;
      }
      goto LAB_1401f2363;
    }
    sVar4 = *(short *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x7c + param_1);
    if (sVar4 != 0) {
      uVar11 = FUN_140137690();
      uVar9 = FUN_140136a20(uVar11);
      plVar15 = (longlong *)FUN_1401420a0();
      if (*plVar15 != 0) {
        for (puVar18 = *(uint **)(*plVar15 +
                                 ((ulonglong)uVar9 % (ulonglong)*(uint *)(plVar15 + 2)) * 8);
            puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 6)) {
          if ((puVar18[8] == uVar9) && (*puVar18 == uVar9)) {
            if ((puVar18 != (uint *)0x0) && (puVar18 != (uint *)0xfffffffffffffffc)) {
              fVar24 = (float)puVar18[3];
              goto LAB_1401f1e52;
            }
            break;
          }
        }
      }
      fVar24 = -1.0;
LAB_1401f1e52:
      iVar5 = rand();
      if ((float)iVar5 * 3.0517578e-05 < fVar24) {
        FUN_14000a170(&local_198);
        local_f0 = 0;
        uVar11 = FUN_140137690();
        iVar5 = FUN_140136b30(uVar11,local_180);
        if (iVar5 == 1) {
          uVar11 = FUN_140137690();
          local_174 = FUN_140136bb0(uVar11,local_180);
        }
        puVar12 = (undefined8 *)FUN_140357570(local_1a8);
        local_198 = *puVar12;
        uStack_190 = puVar12[1];
        uVar11 = FUN_1401420a0();
        uVar10 = FUN_140142060(uVar11,uVar9);
        local_17c = 1;
        local_180 = uVar10;
        local_11c = sVar4;
        uVar11 = FUN_140137690();
        local_130 = FUN_140136ad0(uVar11,uVar10);
        lVar19 = 0;
        local_350 = (longlong *)0x0;
        local_res18 = operator_new(0x850);
        lVar13 = lVar19;
        if (local_res18 != (void *)0x0) {
          lVar13 = FUN_1401e64f0(local_res18);
        }
        if (lVar13 == 0) {
          local_350 = (longlong *)0x0;
        }
        else {
          local_350 = operator_new(0x10);
          *local_350 = lVar13;
          *(undefined4 *)(local_350 + 1) = 1;
        }
        plVar15 = local_350;
        local_348 = local_350;
        lVar13 = lVar19;
        if (*(longlong **)(param_2 + 0x6d0) == local_350) {
LAB_1401f1f9a:
          plVar15 = local_350;
          if (local_350 != (longlong *)0x0) {
            lVar13 = *local_350;
          }
        }
        else {
          FUN_1401dede0(param_2 + 0x6d0);
          *(longlong **)(param_2 + 0x6d0) = plVar15;
          *(longlong **)(param_2 + 0x6d8) = plVar15;
          if (plVar15 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar15 + 1) = (int)plVar15[1] + 1;
            UNLOCK();
            goto LAB_1401f1f9a;
          }
        }
        FUN_1401e6560(lVar13,&local_198,param_2,0x19f,CONCAT44(uVar26,0x10));
        if (plVar15 != (longlong *)0x0) {
          lVar19 = *plVar15;
        }
        FUN_1401e6700(lVar19,3,param_2);
        plVar3 = local_350;
        if (plVar15 != (longlong *)0x0) {
          LOCK();
          plVar15 = plVar15 + 1;
          *(int *)plVar15 = (int)*plVar15 + -1;
          UNLOCK();
          if ((int)*plVar15 == 0) {
            pvVar2 = (void *)*local_350;
            if (pvVar2 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar2 + 0x818);
              operator_delete(pvVar2);
            }
            operator_delete(plVar3);
          }
        }
      }
    }
    lVar19 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
    piVar32 = (int *)CONCAT44(uVar33,(int)*(short *)(lVar19 + 0x28));
    puVar27 = (undefined4 *)CONCAT44(uVar28,(int)*(short *)(lVar19 + 0x1c));
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x19f,0xe,param_2,lVar19,puVar27,
                  CONCAT44(uVar29,uVar7),CONCAT44(uVar30,iVar6),piVar32);
    uVar26 = (undefined4)((ulonglong)lVar19 >> 0x20);
    FUN_14000a170(local_e8);
    local_40 = 0;
    local_300 = *(undefined4 *)(param_2 + 0x160);
    local_2fc = *(undefined4 *)(param_2 + 0x164);
    local_2f8 = *(undefined4 *)(param_2 + 0x168);
    local_2f4 = *(undefined4 *)(param_2 + 0x16c);
    local_340 = *(undefined4 *)(param_2 + 0x170);
    local_33c = *(undefined4 *)(param_2 + 0x174);
    local_338 = *(undefined4 *)(param_2 + 0x178);
    local_334 = *(undefined4 *)(param_2 + 0x17c);
    iVar5 = *(int *)(param_2 + 0x284);
    local_358[0] = *param_4;
    local_360[0] = 0xffffffec;
    if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
       (lVar19 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar19 != 0)) {
      local_res18 = (void *)CONCAT62(local_res18._2_6_,(short)iVar5);
      plVar15 = (longlong *)
                (*(longlong *)(*(longlong *)(lVar19 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                + 0x70);
      piVar32 = local_358;
      puVar27 = &local_300;
      puVar25 = &local_340;
      (**(code **)(*plVar15 + 0x130))
                (plVar15,1,&DAT_1405d85a0,&local_res18,puVar25,puVar27,
                 ((longlong)local_358[0] + (longlong)*param_3 * 0x18) * 0xac + param_1,local_360,
                 piVar32);
      uVar26 = (undefined4)((ulonglong)puVar25 >> 0x20);
    }
    if (-1 < *param_3) {
      FUN_1401ed220(param_1,param_3,param_4,local_e8,CONCAT44(uVar26,6));
    }
    uVar26 = *(undefined4 *)(param_1 + 0x50a0);
    uVar31 = (ulonglong)piVar32 & 0xffffffff00000000;
    uVar17 = (ulonglong)puVar27 & 0xffffffff00000000;
    uVar11 = 0x47;
    uVar21 = 0x192;
  }
  else {
    *(short *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0x28 + param_1) =
         (short)param_6;
    *(undefined4 *)(((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + 0xa8 + param_1) = 0;
    *param_9 = 0;
    local_368 = 1;
    lVar19 = ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1;
    uVar31 = CONCAT44(uVar33,(int)*(short *)(lVar19 + 0x28));
    uVar17 = CONCAT44(uVar28,(int)*(short *)(lVar19 + 0x1c));
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x19f,0xb,param_2,lVar19,uVar17,
                  CONCAT44(uVar29,uVar7),CONCAT44(uVar30,iVar6),uVar31);
    uVar26 = *(undefined4 *)(param_1 + 0x50a0);
    uVar31 = uVar31 & 0xffffffff00000000;
    uVar17 = uVar17 & 0xffffffff00000000;
    uVar11 = 0x5a;
LAB_1401f2363:
    uVar21 = 0x193;
  }
  FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,
                ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1,uVar21,uVar11,
                uVar17,uVar26,uVar26,uVar31,0);
LAB_1401f2391:
  local_36c[0] = (undefined2)*param_4;
  local_370 = (undefined2)*param_3;
  plVar15 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
  (**(code **)(*plVar15 + 0xe0))
            (plVar15,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_370,local_36c,
             ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
  local_310 = *(undefined4 *)(param_2 + 0x160);
  local_30c = *(undefined4 *)(param_2 + 0x164);
  local_308 = *(undefined4 *)(param_2 + 0x168);
  local_304 = *(undefined4 *)(param_2 + 0x16c);
  local_330 = *(undefined4 *)(param_2 + 0x170);
  local_32c = *(undefined4 *)(param_2 + 0x174);
  local_328 = *(undefined4 *)(param_2 + 0x178);
  local_324 = *(undefined4 *)(param_2 + 0x17c);
  iVar5 = *(int *)(param_2 + 0x284);
  if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
     (lVar19 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar19 != 0)) {
    local_36e = (undefined2)iVar5;
    plVar15 = (longlong *)
              (*(longlong *)(*(longlong *)(lVar19 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
              0x70);
    (**(code **)(*plVar15 + 0x140))
              (plVar15,1,&DAT_1405d85a0,&local_36e,&local_330,&local_310,
               ((longlong)*param_4 + (longlong)*param_3 * 0x18) * 0xac + param_1);
  }
  FUN_140198570(param_2,&local_2f0);
  plVar15 = local_2f0;
  if (local_2f0 != (longlong *)0x0) {
    if (local_2f0 == local_2e8) {
      if (*local_2f0 != 0) {
        FUN_14011f090(local_278);
        local_26c = *(undefined4 *)(param_2 + 0x160);
        local_268 = *(undefined4 *)(param_2 + 0x164);
        local_264 = *(undefined4 *)(param_2 + 0x168);
        local_260 = *(undefined4 *)(param_2 + 0x16c);
        local_25c = *(undefined4 *)(param_2 + 0x170);
        local_258 = *(undefined4 *)(param_2 + 0x174);
        local_254 = *(undefined4 *)(param_2 + 0x178);
        local_250 = *(undefined4 *)(param_2 + 0x17c);
        local_1c8 = CONCAT44(uStack_31c,local_320);
        uStack_1c0 = CONCAT44(uStack_314,uStack_318);
        pwVar16 = (wchar_t *)(*plVar15 + 0xd0);
        if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
          pwVar16 = *(wchar_t **)pwVar16;
        }
        sVar14 = wcsnlen(pwVar16,0x10);
        if (sVar14 < 0x10) {
          pwVar16 = (wchar_t *)(*plVar15 + 0xd0);
          if (7 < *(ulonglong *)(*plVar15 + 0xe8)) {
            pwVar16 = *(wchar_t **)pwVar16;
          }
          wcscpy_s(local_24c,0x10,pwVar16);
        }
        local_2c8 = 0xf;
        local_2d0 = 0;
        local_2e0 = 0;
        uVar17 = 0xffffffffffffffff;
        pcVar20 = (char *)(param_2 + 0x330);
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          cVar1 = *pcVar20;
          pcVar20 = pcVar20 + 1;
        } while (cVar1 != '\0');
        FUN_140003e50(&local_2e0,(char *)(param_2 + 0x330),~uVar17 - 1);
        FUN_140415310(local_2a8,&local_2e0);
        if (0xf < local_2c8) {
          operator_delete((void *)CONCAT71(uStack_2df,local_2e0));
        }
        local_2c8 = 0xf;
        local_2d0 = 0;
        local_2e0 = 0;
        if (local_298 < 0x32) {
          _Src = local_2a8;
          if (7 < local_290) {
            _Src = (wchar_t *******)local_2a8[0];
          }
          wcscpy_s(local_22c,0x32,(wchar_t *)_Src);
        }
        local_270 = *param_9;
        local_1b8 = (undefined2)param_5;
        local_1b6 = (undefined1)param_6;
        local_1b5 = local_270;
        FUN_1401fe640(*(undefined8 *)(param_2 + 0xb50),*(undefined4 *)(param_2 + 0x288),
                      *(undefined4 *)(param_2 + 0x284),local_278);
        if (7 < local_290) {
          operator_delete(local_2a8[0]);
        }
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar22 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar22) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar15 != (longlong *)0x0) {
    if (plVar15 == local_2e8) {
      LOCK();
      plVar15 = plVar15 + 1;
      lVar19 = *plVar15;
      *(int *)plVar15 = (int)*plVar15 + -1;
      UNLOCK();
      if ((int)lVar19 == 1) {
        puVar12 = (undefined8 *)*local_2f0;
        if (puVar12 != (undefined8 *)0x0) {
          (**(code **)*puVar12)(puVar12,1);
        }
        operator_delete(local_2f0);
      }
    }
    else {
      iVar5 = DAT_140608054 + 1;
      bVar22 = DAT_140608054 == 0;
      DAT_140608054 = iVar5;
      if (bVar22) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_14034edd0(local_2b8);
  return local_368;
}



undefined8 FUN_1401f2760(longlong param_1,ulonglong *param_2,int *param_3,int *param_4)

{
  ulonglong uVar1;
  int iVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  bool bVar6;
  
  *param_3 = -1;
  *param_4 = -1;
  FUN_14034ed40();
  iVar5 = 1;
  do {
    iVar4 = 0;
    do {
      lVar3 = ((longlong)iVar4 + (longlong)iVar5 * 0x18) * 0xac;
      uVar1 = *(ulonglong *)(lVar3 + param_1);
      bVar6 = uVar1 < *param_2;
      if ((uVar1 == *param_2) &&
         (uVar1 = *(ulonglong *)(lVar3 + 8 + param_1), bVar6 = uVar1 < param_2[1],
         uVar1 == param_2[1])) {
        iVar2 = 0;
      }
      else {
        iVar2 = (1 - (uint)bVar6) - (uint)(bVar6 != 0);
      }
      if (iVar2 == 0) {
        *param_3 = iVar5;
        *param_4 = iVar4;
        FUN_14034edd0(param_1 + 0xf630);
        return 1;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 < 0x18);
    iVar5 = iVar5 + 1;
    if (4 < iVar5) {
      FUN_14034edd0(param_1 + 0xf630);
      return 0;
    }
  } while( true );
}



undefined8 FUN_1401f2840(longlong param_1,ulonglong *param_2,uint *param_3)

{
  int iVar1;
  ulonglong *puVar2;
  uint uVar3;
  int iVar4;
  bool bVar5;
  
  FUN_14034ed40(param_1 + 0xf630);
  *param_3 = 0xffffffff;
  uVar3 = 0;
  iVar4 = DAT_1406093a4;
  while( true ) {
    if (uVar3 < 0x78) {
      puVar2 = (ulonglong *)((longlong)(int)uVar3 * 0xac + 0x50a8 + param_1);
    }
    else {
      if (iVar4 == 0) {
        FUN_140176d60(0);
        iVar4 = DAT_1406093a4;
      }
      DAT_1406093a4 = iVar4 + 1;
      puVar2 = &DAT_14060d080;
      iVar4 = DAT_1406093a4;
    }
    bVar5 = *puVar2 < *param_2;
    if ((*puVar2 == *param_2) && (bVar5 = puVar2[1] < param_2[1], puVar2[1] == param_2[1])) {
      iVar1 = 0;
    }
    else {
      iVar1 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
    }
    if (iVar1 == 0) break;
    uVar3 = uVar3 + 1;
    if (0x77 < (int)uVar3) {
      FUN_14034edd0(param_1 + 0xf630);
      return 0;
    }
  }
  *param_3 = uVar3;
  FUN_14034edd0(param_1 + 0xf630);
  return 1;
}



undefined8
FUN_1401f2930(longlong param_1,longlong param_2,uint param_3,uint param_4,uint param_5,
             ulonglong *param_6,ulonglong *param_7,int param_8)

{
  longlong lVar1;
  uint uVar2;
  uint uVar3;
  undefined2 uVar4;
  int iVar5;
  ulonglong *puVar6;
  void *_Src;
  undefined8 uVar7;
  undefined8 uVar8;
  longlong lVar9;
  longlong *plVar10;
  undefined4 *puVar11;
  int iVar12;
  short sVar13;
  short sVar14;
  ulonglong *puVar15;
  undefined2 uVar16;
  longlong lVar17;
  bool bVar18;
  bool bVar19;
  uint local_res20 [2];
  undefined8 in_stack_fffffffffffffea0;
  undefined4 *puVar20;
  undefined4 uVar21;
  ulonglong *in_stack_fffffffffffffea8;
  undefined8 in_stack_fffffffffffffeb0;
  uint *puVar22;
  undefined8 uVar23;
  uint *puVar24;
  undefined4 uVar25;
  undefined8 in_stack_fffffffffffffeb8;
  undefined8 uVar26;
  undefined4 uVar27;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  uint local_118 [2];
  uint local_110 [2];
  uint local_108 [2];
  undefined8 local_100;
  longlong local_f8;
  undefined1 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar3 = param_5;
  uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar27 = (undefined4)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20);
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
  local_100 = 0xfffffffffffffffe;
  lVar17 = (longlong)(int)param_5;
  if (param_4 == param_5) {
    return 0;
  }
  lVar1 = param_1 + 0xf630;
  local_res20[0] = param_4;
  local_f8 = lVar1;
  FUN_14034ed40(lVar1);
  local_f0 = 1;
  uVar16 = (undefined2)uVar3;
  if (param_3 == 5) {
    if ((param_4 < 0x78) && (uVar3 < 0x78)) {
      lVar17 = param_1 + 0x50a8;
      puVar6 = (ulonglong *)FUN_1401fbad0(lVar17,param_4);
      bVar18 = *puVar6 < *param_6;
      if ((*puVar6 == *param_6) && (bVar18 = puVar6[1] < param_6[1], puVar6[1] == param_6[1])) {
        iVar5 = 0;
      }
      else {
        iVar5 = (1 - (uint)bVar18) - (uint)(bVar18 != 0);
      }
      if (iVar5 == 0) {
        puVar6 = (ulonglong *)FUN_1401fbad0(lVar17,uVar3);
        bVar18 = *puVar6 < *param_7;
        if ((*puVar6 == *param_7) && (bVar18 = puVar6[1] < param_7[1], puVar6[1] == param_7[1])) {
          iVar5 = 0;
        }
        else {
          iVar5 = (1 - (uint)bVar18) - (uint)(bVar18 != 0);
        }
        if (iVar5 == 0) {
          _Src = (void *)FUN_1401fbad0(lVar17,param_4);
          memcpy(local_e8,_Src,0xac);
          uVar7 = FUN_1401fbad0(lVar17,uVar3);
          uVar8 = FUN_1401fbad0(lVar17,param_4);
          FUN_140090020(uVar8,uVar7);
          lVar9 = FUN_1401fbad0(lVar17,param_4);
          *(undefined2 *)(lVar9 + 0x14) = 5;
          lVar9 = FUN_1401fbad0(lVar17,param_4);
          *(short *)(lVar9 + 0x16) = (short)param_4;
          uVar7 = FUN_1401fbad0(lVar17,uVar3);
          FUN_140090020(uVar7,local_e8);
          lVar9 = FUN_1401fbad0(lVar17,uVar3);
          *(undefined2 *)(lVar9 + 0x14) = 5;
          lVar9 = FUN_1401fbad0(lVar17,uVar3);
          *(undefined2 *)(lVar9 + 0x16) = uVar16;
          plVar10 = (longlong *)FUN_1401fbad0(lVar17,uVar3);
          if ((*plVar10 == 0) && (plVar10[1] == 0)) {
            bVar18 = false;
          }
          else {
            bVar18 = true;
          }
          if (bVar18) {
            local_128 = *(undefined4 *)(param_2 + 0x160);
            local_124 = *(undefined4 *)(param_2 + 0x164);
            local_120 = *(undefined4 *)(param_2 + 0x168);
            local_11c = *(undefined4 *)(param_2 + 0x16c);
            local_138 = *(undefined4 *)(param_2 + 0x170);
            local_134 = *(undefined4 *)(param_2 + 0x174);
            local_130 = *(undefined4 *)(param_2 + 0x178);
            local_12c = *(undefined4 *)(param_2 + 0x17c);
            local_res20[0] = *(uint *)(param_2 + 0x284);
            param_5 = *(uint *)(param_2 + 0x288);
            puVar6 = (ulonglong *)FUN_1401fbad0(param_1 + 0x50a8,uVar3);
            local_118[0] = uVar3;
            local_108[0] = 5;
            if (((-1 < (int)local_res20[0]) &&
                ((int)local_res20[0] < (int)*(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
              plVar10 = (longlong *)
                        (*(longlong *)(*(longlong *)(lVar17 + 8) + (longlong)(int)param_5 * 8) +
                        0x70);
              puVar24 = local_118;
              puVar22 = local_108;
              puVar20 = &local_128;
              (**(code **)(*plVar10 + 0x130))
                        (plVar10,1,&DAT_1405d85a0,local_res20,&local_138,puVar20,puVar6,puVar22,
                         puVar24);
              uVar21 = (undefined4)((ulonglong)puVar20 >> 0x20);
              uVar25 = (undefined4)((ulonglong)puVar22 >> 0x20);
              uVar27 = (undefined4)((ulonglong)puVar24 >> 0x20);
              in_stack_fffffffffffffea8 = puVar6;
            }
            lVar17 = FUN_1401fbad0(param_1 + 0x50a8,uVar3);
            sVar14 = *(short *)(lVar17 + 0x1c);
            uVar7 = FUN_1401fbad0(param_1 + 0x50a8,uVar3);
            uVar26 = CONCAT44(uVar27,uVar3);
            uVar23 = CONCAT44(uVar25,param_4);
            in_stack_fffffffffffffea8 =
                 (ulonglong *)((ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000);
            uVar8 = CONCAT44(uVar21,(int)sVar14);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,uVar7,uVar8,
                          in_stack_fffffffffffffea8,uVar23,uVar26);
            uVar21 = (undefined4)((ulonglong)uVar8 >> 0x20);
            uVar25 = (undefined4)((ulonglong)uVar23 >> 0x20);
            uVar27 = (undefined4)((ulonglong)uVar26 >> 0x20);
          }
          lVar17 = param_1 + 0x50a8;
          plVar10 = (longlong *)FUN_1401fbad0(lVar17,param_4);
          if ((*plVar10 == 0) && (plVar10[1] == 0)) {
            bVar18 = false;
          }
          else {
            bVar18 = true;
          }
          if (bVar18) {
            local_138 = *(undefined4 *)(param_2 + 0x160);
            local_134 = *(undefined4 *)(param_2 + 0x164);
            local_130 = *(undefined4 *)(param_2 + 0x168);
            local_12c = *(undefined4 *)(param_2 + 0x16c);
            local_128 = *(undefined4 *)(param_2 + 0x170);
            local_124 = *(undefined4 *)(param_2 + 0x174);
            local_120 = *(undefined4 *)(param_2 + 0x178);
            local_11c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            param_5 = *(uint *)(param_2 + 0x288);
            puVar6 = (ulonglong *)FUN_1401fbad0(lVar17,param_4);
            local_118[0] = 5;
            local_108[0] = param_4;
            if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
              local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)iVar5);
              plVar10 = (longlong *)
                        (*(longlong *)(*(longlong *)(lVar9 + 8) + (longlong)(int)param_5 * 8) + 0x70
                        );
              puVar22 = local_108;
              puVar24 = local_118;
              puVar20 = &local_138;
              (**(code **)(*plVar10 + 0x130))
                        (plVar10,1,&DAT_1405d85a0,local_res20,&local_128,puVar20,puVar6,puVar24,
                         puVar22);
              uVar21 = (undefined4)((ulonglong)puVar20 >> 0x20);
              uVar25 = (undefined4)((ulonglong)puVar24 >> 0x20);
              uVar27 = (undefined4)((ulonglong)puVar22 >> 0x20);
              in_stack_fffffffffffffea8 = puVar6;
            }
            lVar17 = FUN_1401fbad0(lVar17,param_4);
            sVar14 = *(short *)(lVar17 + 0x1c);
            uVar7 = FUN_1401fbad0(param_1 + 0x50a8,param_4);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,uVar7,
                          CONCAT44(uVar21,(int)sVar14),
                          (ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000,
                          CONCAT44(uVar25,uVar3),CONCAT44(uVar27,param_4));
          }
          FUN_14034edd0(lVar1);
          return 1;
        }
      }
    }
  }
  else if (((param_3 < 5) && (param_4 < 0x18)) && (uVar3 < 0x18)) {
    puVar6 = (ulonglong *)(((longlong)(int)param_3 * 0x18 + lVar17) * 0xac + param_1);
    puVar15 = (ulonglong *)
              (((longlong)(int)param_4 + (longlong)(int)param_3 * 0x18) * 0xac + param_1);
    bVar18 = false;
    bVar19 = *puVar15 < *puVar6;
    if ((*puVar15 == *puVar6) && (bVar19 = puVar15[1] < puVar6[1], puVar15[1] == puVar6[1])) {
      iVar5 = 0;
    }
    else {
      iVar5 = (1 - (uint)bVar19) - (uint)(bVar19 != 0);
    }
    if (iVar5 != 0) {
      bVar19 = *puVar15 < *param_6;
      if ((*puVar15 == *param_6) && (bVar19 = puVar15[1] < param_6[1], puVar15[1] == param_6[1])) {
        iVar5 = 0;
      }
      else {
        iVar5 = (1 - (uint)bVar19) - (uint)(bVar19 != 0);
      }
      if (iVar5 == 0) {
        bVar19 = *puVar6 < *param_7;
        if ((*puVar6 == *param_7) && (bVar19 = puVar6[1] < param_7[1], puVar6[1] == param_7[1])) {
          iVar5 = 0;
        }
        else {
          iVar5 = (1 - (uint)bVar19) - (uint)(bVar19 != 0);
        }
        if (iVar5 == 0) {
          uVar7 = FUN_140137690();
          iVar5 = FUN_140136a70(uVar7,(int)puVar15[3]);
          uVar4 = (undefined2)param_3;
          if (((int)puVar15[3] == (int)puVar6[3]) && (1 < iVar5)) {
            local_110[0] = (uint)*(short *)((longlong)puVar15 + 0x1c);
            sVar14 = *(short *)((longlong)puVar6 + 0x1c);
            iVar12 = (int)sVar14;
            param_5._0_2_ = uVar16;
            if ((int)(local_110[0] + iVar12) <= iVar5) {
              *(short *)((longlong)puVar6 + 0x1c) = sVar14 + *(short *)((longlong)puVar15 + 0x1c);
              local_138 = *(undefined4 *)(param_2 + 0x160);
              local_134 = *(undefined4 *)(param_2 + 0x164);
              local_130 = *(undefined4 *)(param_2 + 0x168);
              local_12c = *(undefined4 *)(param_2 + 0x16c);
              local_128 = *(undefined4 *)(param_2 + 0x170);
              local_124 = *(undefined4 *)(param_2 + 0x174);
              local_120 = *(undefined4 *)(param_2 + 0x178);
              local_11c = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
                plVar10 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                          0x70);
                in_stack_fffffffffffffea8 = puVar6;
                (**(code **)(*plVar10 + 0x140))
                          (plVar10,1,&DAT_1405d85a0,&param_5,&local_128,&local_138,puVar6);
              }
              local_138 = *(undefined4 *)(param_2 + 0x160);
              local_134 = *(undefined4 *)(param_2 + 0x164);
              local_130 = *(undefined4 *)(param_2 + 0x168);
              local_12c = *(undefined4 *)(param_2 + 0x16c);
              local_128 = *(undefined4 *)(param_2 + 0x170);
              local_124 = *(undefined4 *)(param_2 + 0x174);
              local_120 = *(undefined4 *)(param_2 + 0x178);
              local_11c = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              local_108[0] = 0xffffffff;
              local_118[0] = 0xfffffff0;
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
                plVar10 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                          0x70);
                puVar22 = local_108;
                puVar24 = local_118;
                in_stack_fffffffffffffea8 = puVar15;
                (**(code **)(*plVar10 + 0x130))
                          (plVar10,1,&DAT_1405d85a0,&param_5,&local_128,&local_138,puVar15,puVar24,
                           puVar22);
                uVar25 = (undefined4)((ulonglong)puVar24 >> 0x20);
                uVar27 = (undefined4)((ulonglong)puVar22 >> 0x20);
              }
              FUN_14000a170(local_e8);
              local_40 = 0;
              FUN_140090020(puVar15,local_e8);
              local_118[0] = CONCAT22(local_118[0]._2_2_,uVar4);
              plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              (**(code **)(*plVar10 + 0xe0))
                        (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_118,&param_5,
                         puVar6);
              uVar2 = local_res20[0];
              param_5 = CONCAT22(param_5._2_2_,uVar4);
              plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              (**(code **)(*plVar10 + 0xe0))
                        (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&param_5,local_res20,
                         puVar15);
              FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,puVar6,local_110[0],
                            (ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000,
                            CONCAT44(uVar25,uVar2),CONCAT44(uVar27,uVar3));
              goto LAB_1401f3ade;
            }
            if (iVar5 != iVar12) {
              local_110[0] = iVar5 - iVar12;
              *(short *)((longlong)puVar6 + 0x1c) = sVar14 + (short)local_110[0];
              *(short *)((longlong)puVar15 + 0x1c) =
                   *(short *)((longlong)puVar15 + 0x1c) - (short)local_110[0];
              local_138 = *(undefined4 *)(param_2 + 0x160);
              local_134 = *(undefined4 *)(param_2 + 0x164);
              local_130 = *(undefined4 *)(param_2 + 0x168);
              local_12c = *(undefined4 *)(param_2 + 0x16c);
              local_128 = *(undefined4 *)(param_2 + 0x170);
              local_124 = *(undefined4 *)(param_2 + 0x174);
              local_120 = *(undefined4 *)(param_2 + 0x178);
              local_11c = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
                plVar10 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                          0x70);
                in_stack_fffffffffffffea8 = puVar6;
                (**(code **)(*plVar10 + 0x140))
                          (plVar10,1,&DAT_1405d85a0,&param_5,&local_128,&local_138,puVar6);
              }
              local_138 = *(undefined4 *)(param_2 + 0x160);
              local_134 = *(undefined4 *)(param_2 + 0x164);
              local_130 = *(undefined4 *)(param_2 + 0x168);
              local_12c = *(undefined4 *)(param_2 + 0x16c);
              local_128 = *(undefined4 *)(param_2 + 0x170);
              local_124 = *(undefined4 *)(param_2 + 0x174);
              local_120 = *(undefined4 *)(param_2 + 0x178);
              local_11c = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
                plVar10 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                          0x70);
                in_stack_fffffffffffffea8 = puVar15;
                (**(code **)(*plVar10 + 0x140))
                          (plVar10,1,&DAT_1405d85a0,&param_5,&local_128,&local_138,puVar15);
              }
              local_118[0] = CONCAT22(local_118[0]._2_2_,uVar4);
              plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              (**(code **)(*plVar10 + 0xe0))
                        (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_118,&param_5,
                         puVar6);
              uVar2 = local_res20[0];
              param_5 = CONCAT22(param_5._2_2_,uVar4);
              plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              (**(code **)(*plVar10 + 0xe0))
                        (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&param_5,local_res20,
                         puVar15);
              FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,puVar6,local_110[0],
                            (ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000,
                            CONCAT44(uVar25,uVar2),CONCAT44(uVar27,uVar3));
              goto LAB_1401f3ade;
            }
          }
          sVar14 = *(short *)((longlong)puVar15 + 0x1c);
          sVar13 = (short)param_8;
          if (sVar14 == param_8) {
            memcpy(local_e8,puVar15,0xac);
            FUN_140090020(puVar15,puVar6);
            FUN_140090020(puVar6,local_e8);
            *(short *)((longlong)puVar15 + 0x16) = (short)local_res20[0];
            *(undefined2 *)((longlong)puVar6 + 0x16) = uVar16;
            if ((*puVar15 == 0) && (puVar15[1] == 0)) {
              bVar19 = false;
            }
            else {
              bVar19 = true;
            }
            if (bVar19) {
              uVar23 = CONCAT44(uVar27,local_res20[0]);
              uVar8 = CONCAT44(uVar25,uVar3);
              in_stack_fffffffffffffea8 =
                   (ulonglong *)((ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000);
              uVar7 = CONCAT44(uVar21,(int)*(short *)((longlong)puVar6 + 0x1c));
              FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,puVar15,uVar7,
                            in_stack_fffffffffffffea8,uVar8,uVar23);
              uVar21 = (undefined4)((ulonglong)uVar7 >> 0x20);
              uVar25 = (undefined4)((ulonglong)uVar8 >> 0x20);
              uVar27 = (undefined4)((ulonglong)uVar23 >> 0x20);
            }
            if ((*puVar6 == 0) && (puVar6[1] == 0)) {
              bVar19 = false;
            }
            else {
              bVar19 = true;
            }
            if (bVar19) {
              FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,puVar6,
                            CONCAT44(uVar21,(int)*(short *)((longlong)puVar6 + 0x1c)),
                            (ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000,
                            CONCAT44(uVar25,local_res20[0]),CONCAT44(uVar27,uVar3));
            }
            if ((*puVar6 == 0) && (puVar6[1] == 0)) {
              bVar19 = false;
            }
            else {
              bVar19 = true;
            }
            if (bVar19) {
              local_138 = *(undefined4 *)(param_2 + 0x160);
              local_134 = *(undefined4 *)(param_2 + 0x164);
              local_130 = *(undefined4 *)(param_2 + 0x168);
              local_12c = *(undefined4 *)(param_2 + 0x16c);
              local_128 = *(undefined4 *)(param_2 + 0x170);
              local_124 = *(undefined4 *)(param_2 + 0x174);
              local_120 = *(undefined4 *)(param_2 + 0x178);
              local_11c = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              local_110[0] = uVar3;
              local_108[0] = param_3;
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
                plVar10 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                          0x70);
                (**(code **)(*plVar10 + 0x130))
                          (plVar10,1,&DAT_1405d85a0,&param_5,&local_128,&local_138,puVar6,local_108,
                           local_110);
              }
            }
            if ((*puVar15 != 0) || (puVar15[1] != 0)) {
              bVar18 = true;
            }
            if (bVar18) {
              local_138 = *(undefined4 *)(param_2 + 0x160);
              local_134 = *(undefined4 *)(param_2 + 0x164);
              local_130 = *(undefined4 *)(param_2 + 0x168);
              local_12c = *(undefined4 *)(param_2 + 0x16c);
              local_128 = *(undefined4 *)(param_2 + 0x170);
              local_124 = *(undefined4 *)(param_2 + 0x174);
              local_120 = *(undefined4 *)(param_2 + 0x178);
              local_11c = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              param_5 = local_res20[0];
              local_110[0] = param_3;
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)iVar5);
                plVar10 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                          0x70);
                (**(code **)(*plVar10 + 0x130))
                          (plVar10,1,&DAT_1405d85a0,local_res20,&local_128,&local_138,puVar15,
                           local_110,&param_5);
              }
            }
            FUN_14034edd0(lVar1);
            return 1;
          }
          if ((param_8 <= sVar14) && (iVar5 = FUN_14011b180(puVar6), iVar5 != 0)) {
            *(short *)((longlong)puVar15 + 0x1c) = sVar14 - sVar13;
            local_138 = *(undefined4 *)(param_2 + 0x160);
            local_134 = *(undefined4 *)(param_2 + 0x164);
            local_130 = *(undefined4 *)(param_2 + 0x168);
            local_12c = *(undefined4 *)(param_2 + 0x16c);
            local_128 = *(undefined4 *)(param_2 + 0x170);
            local_124 = *(undefined4 *)(param_2 + 0x174);
            local_120 = *(undefined4 *)(param_2 + 0x178);
            local_11c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            if ((-1 < iVar5) &&
               ((iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700) &&
                (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)))) {
              param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
              plVar10 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                        0x70);
              in_stack_fffffffffffffea8 = puVar15;
              (**(code **)(*plVar10 + 0x140))
                        (plVar10,1,&DAT_1405d85a0,&param_5,&local_128,&local_138,puVar15);
            }
            uVar2 = local_res20[0];
            param_5 = CONCAT22(param_5._2_2_,uVar4);
            plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            (**(code **)(*plVar10 + 0xe0))
                      (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&param_5,local_res20,
                       puVar15);
            iVar5 = param_8;
            uVar8 = CONCAT44(uVar27,uVar3);
            uVar7 = CONCAT44(uVar25,uVar2);
            puVar20 = (undefined4 *)((ulonglong)in_stack_fffffffffffffea8 & 0xffffffff00000000);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,puVar15,param_8,puVar20
                          ,uVar7,uVar8);
            uVar21 = (undefined4)((ulonglong)uVar7 >> 0x20);
            uVar25 = (undefined4)((ulonglong)uVar8 >> 0x20);
            FUN_140090020(puVar6,puVar15);
            puVar11 = (undefined4 *)FUN_140357570(&local_138);
            *(undefined4 *)puVar6 = *puVar11;
            *(undefined4 *)((longlong)puVar6 + 4) = puVar11[1];
            *(undefined4 *)(puVar6 + 1) = puVar11[2];
            *(undefined4 *)((longlong)puVar6 + 0xc) = puVar11[3];
            *(short *)((longlong)puVar6 + 0x1c) = (short)iVar5;
            *(undefined2 *)((longlong)puVar6 + 0x14) = uVar4;
            *(undefined2 *)((longlong)puVar6 + 0x16) = uVar16;
            local_138 = *(undefined4 *)(param_2 + 0x160);
            local_134 = *(undefined4 *)(param_2 + 0x164);
            local_130 = *(undefined4 *)(param_2 + 0x168);
            local_12c = *(undefined4 *)(param_2 + 0x16c);
            local_128 = *(undefined4 *)(param_2 + 0x170);
            local_124 = *(undefined4 *)(param_2 + 0x174);
            local_120 = *(undefined4 *)(param_2 + 0x178);
            local_11c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            param_5 = *(undefined4 *)(param_2 + 8);
            if ((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
              if ((*puVar6 == 0) && (puVar6[1] == 0)) {
                bVar18 = false;
              }
              else {
                bVar18 = true;
              }
              if (((bVar18) && ((int)puVar6[3] != 0)) &&
                 (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)iVar5);
                plVar10 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                          0x70);
                uVar21 = 1;
                puVar20 = &local_138;
                puVar15 = puVar6;
                (**(code **)(*plVar10 + 0xb0))
                          (plVar10,1,&DAT_1405d85a0,local_res20,&param_5,&local_128,puVar20,
                           &DAT_14047b9e4,puVar6);
                uVar25 = (undefined4)((ulonglong)puVar15 >> 0x20);
              }
            }
            local_res20[0] = CONCAT22(local_res20[0]._2_2_,uVar16);
            param_5 = CONCAT22(param_5._2_2_,uVar4);
            plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            (**(code **)(*plVar10 + 0xc0))
                      (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&param_5,local_res20,
                       puVar6);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xb,param_2,puVar6,param_8,
                          (ulonglong)puVar20 & 0xffffffff00000000,CONCAT44(uVar21,param_3),
                          CONCAT44(uVar25,uVar3));
          }
        }
      }
    }
  }
LAB_1401f3ade:
  FUN_14034edd0(lVar1);
  return 0;
}



void FUN_1401f3b10(longlong param_1,uint param_2,int param_3)

{
  int *piVar1;
  
  if ((param_2 < 5) &&
     (piVar1 = (int *)(param_1 + 0xf5f8 + (longlong)(int)param_2 * 4), *piVar1 = *piVar1 + param_3,
     *(longlong *)(param_1 + 0xf610) != 0)) {
    (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
              (*(longlong **)(param_1 + 0xf610),
               *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) + *(int *)(param_1 + 0xf600)
               + *(int *)(param_1 + 0xf5fc) + *(int *)(param_1 + 0xf5f8));
  }
  return;
}



void FUN_1401f3b70(longlong param_1,longlong param_2,int param_3,uint param_4)

{
  longlong *plVar1;
  longlong lVar2;
  uint uVar3;
  longlong lVar4;
  uint *puVar5;
  longlong lVar6;
  short *psVar7;
  longlong *plVar8;
  short *psVar9;
  int iVar10;
  uint local_res18 [2];
  uint local_res20 [2];
  undefined2 local_78 [4];
  undefined8 local_70;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  longlong local_48;
  undefined1 local_40;
  
  local_70 = 0xfffffffffffffffe;
  if ((param_3 == 0) || (param_3 == 1)) {
    lVar2 = param_1 + 0xf630;
    local_res20[0] = param_4;
    local_48 = lVar2;
    FUN_14034ed40(lVar2);
    local_40 = 1;
    iVar10 = 0;
    psVar9 = (short *)((longlong)param_3 * 0x1020 + 0x1c + param_1);
    do {
      lVar6 = 0;
      plVar1 = (longlong *)(psVar9 + -0xe);
      if ((*plVar1 != 0) || (lVar4 = lVar6, *(longlong *)(psVar9 + -10) != 0)) {
        lVar4 = 1;
      }
      if ((((int)lVar4 != 0) || (*(int *)(psVar9 + -2) != 0)) || ((short)lVar4 < *psVar9)) {
        local_res18[0] = 3;
        puVar5 = local_res20;
        if (2 < (int)param_4) {
          puVar5 = local_res18;
        }
        psVar9[0x16] = (short)*puVar5;
        psVar7 = psVar9 + 0x1e;
        do {
          *(undefined1 *)((longlong)psVar9 + lVar6 + 0x48) = 0;
          psVar7[-6] = 0;
          psVar7[-5] = 0;
          psVar7[0] = 0;
          psVar7[1] = 0;
          lVar6 = lVar6 + 1;
          psVar7 = psVar7 + 2;
        } while (lVar6 < 3);
        local_68 = *(undefined4 *)(param_2 + 0x160);
        local_64 = *(undefined4 *)(param_2 + 0x164);
        local_60 = *(undefined4 *)(param_2 + 0x168);
        local_5c = *(undefined4 *)(param_2 + 0x16c);
        local_58 = *(undefined4 *)(param_2 + 0x170);
        local_54 = *(undefined4 *)(param_2 + 0x174);
        local_50 = *(undefined4 *)(param_2 + 0x178);
        local_4c = *(undefined4 *)(param_2 + 0x17c);
        uVar3 = *(uint *)(param_2 + 0x284);
        if (((-1 < (int)uVar3) &&
            ((int)uVar3 < (int)*(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)) {
          local_res18[0] = uVar3 & 0xffff;
          plVar8 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar8 + 0x140))
                    (plVar8,1,&DAT_1405d85a0,local_res18,&local_58,&local_68,plVar1);
        }
        local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar10);
        local_78[0] = (undefined2)param_3;
        plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar8 + 0xe0))
                  (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_78,local_res18,plVar1);
      }
      iVar10 = iVar10 + 1;
      psVar9 = psVar9 + 0x56;
    } while (iVar10 < 0x18);
    FUN_14034edd0(lVar2);
  }
  return;
}



void FUN_1401f3d90(longlong param_1,longlong param_2,int param_3,int param_4,int param_5,int param_6
                  ,int param_7,int param_8,int param_9,int param_10)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  short sVar4;
  int *piVar5;
  longlong *plVar6;
  longlong lVar7;
  int *piVar8;
  int iVar9;
  undefined2 local_78;
  undefined2 local_76 [3];
  undefined8 local_70;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  longlong local_48;
  undefined1 local_40;
  
  local_70 = 0xfffffffffffffffe;
  if ((param_3 == 0) || (param_3 == 1)) {
    local_48 = param_1 + 0xf630;
    FUN_14034ed40(local_48);
    local_40 = 1;
    iVar9 = 0;
    piVar8 = (int *)((longlong)param_3 * 0x1020 + 0x18 + param_1);
    do {
      plVar1 = (longlong *)(piVar8 + -6);
      if ((*plVar1 == 0) && (*(longlong *)(piVar8 + -4) == 0)) {
        bVar3 = false;
      }
      else {
        bVar3 = true;
      }
      if ((((bVar3) || (*piVar8 != 0)) || (0 < (short)piVar8[1])) && (*piVar8 == param_4)) {
        sVar4 = 0;
        if ((0 < param_5) && (0 < param_6)) {
          piVar8[0xd] = param_5;
          piVar8[0x10] = param_6;
          sVar4 = 1;
        }
        if ((0 < param_7) && (0 < param_8)) {
          piVar8[0xe] = param_7;
          piVar8[0x11] = param_8;
          sVar4 = sVar4 + 1;
        }
        if ((0 < param_9) && (0 < param_10)) {
          piVar8[0xf] = param_9;
          piVar8[0x12] = param_10;
          sVar4 = sVar4 + 1;
        }
        if (sVar4 != 0) {
          *(short *)(piVar8 + 0xc) = sVar4;
        }
        piVar5 = piVar8 + 0x10;
        lVar7 = 3;
        do {
          if ((piVar5[-3] == 0x642) && (0 < *piVar5)) {
            piVar8[0x23] = piVar8[0x23] + *piVar5 * 100;
          }
          piVar5 = piVar5 + 1;
          lVar7 = lVar7 + -1;
        } while (lVar7 != 0);
        local_68 = *(undefined4 *)(param_2 + 0x160);
        local_64 = *(undefined4 *)(param_2 + 0x164);
        local_60 = *(undefined4 *)(param_2 + 0x168);
        local_5c = *(undefined4 *)(param_2 + 0x16c);
        local_58 = *(undefined4 *)(param_2 + 0x170);
        local_54 = *(undefined4 *)(param_2 + 0x174);
        local_50 = *(undefined4 *)(param_2 + 0x178);
        local_4c = *(undefined4 *)(param_2 + 0x17c);
        iVar2 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)) {
          local_78 = (undefined2)iVar2;
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar6 + 0x140))
                    (plVar6,1,&DAT_1405d85a0,&local_78,&local_58,&local_68,plVar1);
        }
        local_78 = (undefined2)iVar9;
        local_76[0] = (undefined2)param_3;
        plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar6 + 0xe0))
                  (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_76,&local_78,plVar1);
      }
      iVar9 = iVar9 + 1;
      piVar8 = piVar8 + 0x2b;
    } while (iVar9 < 0x18);
    FUN_14034edd0(local_48);
  }
  return;
}



void FUN_1401f4030(longlong param_1,longlong param_2,int param_3,undefined4 param_4,
                  undefined4 param_5)

{
  longlong *plVar1;
  bool bVar2;
  longlong lVar3;
  int *piVar4;
  longlong *plVar5;
  int iVar6;
  short *psVar7;
  longlong lVar8;
  int iVar9;
  undefined2 local_68;
  undefined2 local_66 [3];
  undefined8 local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  longlong local_38;
  undefined1 local_30;
  
  local_60 = 0xfffffffffffffffe;
  if ((param_3 == 0) || (param_3 == 1)) {
    local_38 = param_1 + 0xf630;
    FUN_14034ed40(local_38);
    local_30 = 1;
    iVar9 = 0;
    lVar8 = (longlong)param_3 * 0x408;
    psVar7 = (short *)((longlong)param_3 * 0x1020 + 0x48 + param_1);
    do {
      plVar1 = (longlong *)(psVar7 + -0x24);
      if ((*plVar1 == 0) && (*(longlong *)(psVar7 + -0x20) == 0)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
      if (((bVar2) || (*(int *)(psVar7 + -0x18) != 0)) || (0 < psVar7[-0x16])) {
        iVar6 = 0;
        lVar3 = 0;
        if (0 < *psVar7) {
          do {
            if (*(char *)(lVar3 + 0x1c + (longlong)psVar7) != '\0') {
              *(undefined4 *)(param_1 + 0x4c + (lVar8 + lVar3) * 4) = param_4;
              *(undefined4 *)(param_1 + 0x58 + (lVar8 + lVar3) * 4) = param_5;
            }
            iVar6 = iVar6 + 1;
            lVar3 = lVar3 + 1;
          } while (iVar6 < *psVar7);
        }
        piVar4 = (int *)(psVar7 + 8);
        lVar3 = 3;
        do {
          if ((piVar4[-3] == 0x642) && (0 < *piVar4)) {
            *(int *)(psVar7 + 0x2e) = *(int *)(psVar7 + 0x2e) + *piVar4 * 100;
          }
          piVar4 = piVar4 + 1;
          lVar3 = lVar3 + -1;
        } while (lVar3 != 0);
        local_58 = *(undefined4 *)(param_2 + 0x160);
        local_54 = *(undefined4 *)(param_2 + 0x164);
        local_50 = *(undefined4 *)(param_2 + 0x168);
        local_4c = *(undefined4 *)(param_2 + 0x16c);
        local_48 = *(undefined4 *)(param_2 + 0x170);
        local_44 = *(undefined4 *)(param_2 + 0x174);
        local_40 = *(undefined4 *)(param_2 + 0x178);
        local_3c = *(undefined4 *)(param_2 + 0x17c);
        iVar6 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
          local_68 = (undefined2)iVar6;
          plVar5 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar5 + 0x140))
                    (plVar5,1,&DAT_1405d85a0,&local_68,&local_48,&local_58,plVar1);
        }
        local_68 = (undefined2)iVar9;
        local_66[0] = (undefined2)param_3;
        plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0xe0))
                  (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_66,&local_68,plVar1);
      }
      iVar9 = iVar9 + 1;
      lVar8 = lVar8 + 0x2b;
      psVar7 = psVar7 + 0x56;
    } while (iVar9 < 0x18);
    FUN_14034edd0(local_38);
  }
  return;
}



void FUN_1401f42b0(longlong param_1,longlong param_2,int param_3,undefined4 param_4)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  ulonglong uVar4;
  longlong *plVar5;
  ulonglong uVar6;
  longlong *plVar7;
  int iVar8;
  longlong lVar9;
  uint uVar10;
  undefined2 local_res18 [4];
  undefined2 local_68 [4];
  undefined8 local_60;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  longlong local_38;
  undefined1 local_30;
  
  local_60 = 0xfffffffffffffffe;
  if ((param_3 == 0) || (param_3 == 1)) {
    lVar1 = param_1 + 0xf630;
    local_38 = lVar1;
    FUN_14034ed40(lVar1);
    local_30 = 1;
    iVar8 = 0;
    plVar7 = (longlong *)((longlong)param_3 * 0x1020 + param_1);
    lVar9 = (longlong)param_3 * 0x408;
    do {
      uVar6 = 0;
      if ((*plVar7 != 0) || (uVar4 = uVar6, plVar7[1] != 0)) {
        uVar4 = 1;
      }
      if ((((int)uVar4 != 0) || ((int)plVar7[3] != 0)) ||
         ((short)uVar4 < *(short *)((longlong)plVar7 + 0x1c))) {
        uVar4 = uVar6;
        if (0 < (short)plVar7[9]) {
          do {
            switch(param_4) {
            case 1:
              *(undefined1 *)(uVar6 + 100 + (longlong)plVar7) = 1;
              break;
            case 2:
              *(undefined1 *)(uVar6 + 100 + (longlong)plVar7) = 2;
              break;
            case 3:
              *(undefined1 *)(uVar6 + 100 + (longlong)plVar7) = 3;
              break;
            case 4:
              *(undefined1 *)(uVar6 + 100 + (longlong)plVar7) = 4;
              break;
            case 5:
              *(undefined1 *)(uVar6 + 100 + (longlong)plVar7) = 5;
              break;
            case 6:
              *(undefined1 *)(uVar6 + 100 + (longlong)plVar7) = 6;
              break;
            default:
              goto switchD_1401f438b_default;
            }
            *(undefined4 *)(param_1 + 0x4c + (uVar6 + lVar9) * 4) = 0;
            *(undefined4 *)(param_1 + 0x58 + (uVar6 + lVar9) * 4) = 0;
switchD_1401f438b_default:
            uVar10 = (int)uVar4 + 1;
            uVar6 = uVar6 + 1;
            uVar4 = (ulonglong)uVar10;
          } while ((int)uVar10 < (int)(short)plVar7[9]);
        }
        local_58 = *(undefined4 *)(param_2 + 0x160);
        local_54 = *(undefined4 *)(param_2 + 0x164);
        local_50 = *(undefined4 *)(param_2 + 0x168);
        local_4c = *(undefined4 *)(param_2 + 0x16c);
        local_48 = *(undefined4 *)(param_2 + 0x170);
        local_44 = *(undefined4 *)(param_2 + 0x174);
        local_40 = *(undefined4 *)(param_2 + 0x178);
        local_3c = *(undefined4 *)(param_2 + 0x17c);
        iVar2 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
          local_res18[0] = (undefined2)iVar2;
          plVar5 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar5 + 0x140))
                    (plVar5,1,&DAT_1405d85a0,local_res18,&local_48,&local_58,plVar7);
        }
        local_res18[0] = (undefined2)iVar8;
        local_68[0] = (undefined2)param_3;
        plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0xe0))
                  (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_68,local_res18,plVar7);
      }
      iVar8 = iVar8 + 1;
      lVar9 = lVar9 + 0x2b;
      plVar7 = (longlong *)((longlong)plVar7 + 0xac);
    } while (iVar8 < 0x18);
    FUN_14034edd0(lVar1);
  }
  return;
}



undefined8
FUN_1401f4560(longlong param_1,longlong param_2,ulonglong *param_3,ulonglong *param_4,uint param_5)

{
  longlong lVar1;
  longlong lVar2;
  short *psVar3;
  byte bVar4;
  int iVar5;
  ulonglong *puVar6;
  longlong *plVar7;
  int iVar8;
  int iVar9;
  longlong lVar10;
  longlong lVar11;
  int iVar12;
  bool bVar13;
  undefined8 in_stack_fffffffffffffeb0;
  undefined4 uVar14;
  undefined8 in_stack_fffffffffffffeb8;
  uint uVar16;
  ulonglong uVar15;
  undefined8 in_stack_fffffffffffffec0;
  undefined4 uVar17;
  undefined8 in_stack_fffffffffffffec8;
  undefined4 uVar18;
  undefined4 local_128 [2];
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100 [2];
  longlong local_f8;
  undefined1 local_f0;
  undefined8 local_e8;
  undefined1 local_e0 [168];
  undefined4 local_38;
  
  uVar14 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar16 = (uint)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
  local_e8 = 0xfffffffffffffffe;
  if (2 < param_5) {
    return 0;
  }
  lVar11 = param_1 + 0xf630;
  local_f8 = lVar11;
  FUN_14034ed40(lVar11);
  local_f0 = 1;
  iVar12 = 0;
  do {
    iVar8 = 0;
    do {
      puVar6 = (ulonglong *)(((longlong)iVar8 + (longlong)iVar12 * 0x18) * 0xac + param_1);
      if ((*puVar6 == 0) && (puVar6[1] == 0)) {
        bVar13 = false;
      }
      else {
        bVar13 = true;
      }
      if (((bVar13) || ((int)puVar6[3] != 0)) || (0 < *(short *)((longlong)puVar6 + 0x1c))) {
        bVar13 = *puVar6 < *param_3;
        if ((*puVar6 == *param_3) && (bVar13 = puVar6[1] < param_3[1], puVar6[1] == param_3[1])) {
          iVar9 = 0;
        }
        else {
          iVar9 = (1 - (uint)bVar13) - (uint)(bVar13 != 0);
        }
        if (iVar9 == 0) {
          lVar1 = (longlong)iVar8 + (longlong)iVar12 * 0x18;
          lVar10 = lVar1 * 0xac;
          lVar2 = lVar10 + param_1;
          if ((int)*(short *)(lVar2 + 0x48) <= (int)param_5) goto LAB_1401f4b82;
          iVar9 = 0;
          goto LAB_1401f46a1;
        }
      }
      iVar8 = iVar8 + 1;
    } while (iVar8 < 0x18);
    iVar12 = iVar12 + 1;
  } while (iVar12 < 5);
  goto LAB_1401f4b82;
LAB_1401f46a1:
  do {
    puVar6 = (ulonglong *)(((longlong)iVar9 + 0x30) * 0xac + param_1);
    if ((*puVar6 == 0) && (puVar6[1] == 0)) {
      bVar13 = false;
    }
    else {
      bVar13 = true;
    }
    if (((bVar13) || ((int)puVar6[3] != 0)) || (0 < *(short *)((longlong)puVar6 + 0x1c))) {
      bVar13 = *puVar6 < *param_4;
      if ((*puVar6 == *param_4) && (bVar13 = puVar6[1] < param_4[1], puVar6[1] == param_4[1])) {
        iVar5 = 0;
      }
      else {
        iVar5 = (1 - (uint)bVar13) - (uint)(bVar13 != 0);
      }
      if (iVar5 == 0) {
        lVar10 = (int)param_5 + lVar10;
        bVar4 = *(byte *)(lVar10 + 100 + param_1);
        lVar11 = (longlong)iVar9 * 0xac;
        switch(*(undefined4 *)(lVar11 + 0x2058 + param_1)) {
        case 0xc47d:
          *(undefined1 *)(lVar10 + 100 + param_1) = 1;
          break;
        case 0xc47e:
          *(undefined1 *)(lVar10 + 100 + param_1) = 2;
          break;
        case 0xc47f:
          *(undefined1 *)(lVar10 + 100 + param_1) = 3;
          break;
        case 0xc480:
          *(undefined1 *)(lVar10 + 100 + param_1) = 4;
          break;
        default:
          lVar11 = local_f8;
          goto LAB_1401f4b82;
        case 0xc4f9:
          *(undefined1 *)(lVar10 + 100 + param_1) = 5;
          break;
        case 0xc4fa:
          *(undefined1 *)(lVar10 + 100 + param_1) = 6;
        }
        lVar1 = lVar1 * 0x2b + (longlong)(int)param_5;
        *(undefined4 *)(param_1 + 0x4c + lVar1 * 4) = 0;
        *(undefined4 *)(param_1 + 0x58 + lVar1 * 4) = 0;
        uVar15 = (ulonglong)uVar16 << 0x20;
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1a7,0x5b,param_2,lVar2,
                      CONCAT44(uVar14,(int)*(short *)(lVar2 + 0x1c)),uVar15,
                      CONCAT44(uVar17,(uint)bVar4),
                      CONCAT44(uVar18,(uint)*(byte *)(lVar10 + 100 + param_1)));
        psVar3 = (short *)(lVar11 + 0x205c + param_1);
        *psVar3 = *psVar3 + -1;
        iVar5 = (int)*(short *)(lVar11 + 0x205c + param_1);
        lVar10 = ((longlong)iVar9 + 0x30) * 0xac + param_1;
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1a8,0x5c,param_2,lVar10,iVar5,
                      uVar15 & 0xffffffff00000000,iVar5 + 1,iVar5);
        local_110 = *(undefined4 *)(param_2 + 0x160);
        iVar5 = *(int *)(param_2 + 0x284);
        lVar1 = *(longlong *)(param_2 + 0xb50);
        if (*(short *)(lVar11 + 0x205c + param_1) < 1) {
          local_11c = *(undefined4 *)(param_2 + 0x164);
          local_118 = *(undefined4 *)(param_2 + 0x168);
          local_114 = *(undefined4 *)(param_2 + 0x16c);
          uVar14 = *(undefined4 *)(param_2 + 0x170);
          local_10c = *(undefined4 *)(param_2 + 0x174);
          local_108 = *(undefined4 *)(param_2 + 0x178);
          local_104 = *(undefined4 *)(param_2 + 0x17c);
          local_128[0] = 0xffffffff;
          local_100[0] = 0xffffffef;
          local_120 = local_110;
          if (((-1 < iVar5) && (iVar5 < *(short *)(lVar1 + 700))) &&
             (*(longlong *)(lVar1 + 0x4c0) != 0)) {
            param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
            plVar7 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(lVar1 + 0x4c0) + 8) +
                       (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            local_110 = uVar14;
            (**(code **)(*plVar7 + 0x130))
                      (plVar7,1,&DAT_1405d85a0,&param_5,&local_110,&local_120,lVar10,local_100,
                       local_128);
            uVar14 = local_110;
          }
          local_110 = uVar14;
          FUN_14000a170(local_e0);
          local_38 = 0;
          FUN_140090020(lVar10,local_e0);
        }
        else {
          local_10c = *(undefined4 *)(param_2 + 0x164);
          local_108 = *(undefined4 *)(param_2 + 0x168);
          local_104 = *(undefined4 *)(param_2 + 0x16c);
          local_120 = *(undefined4 *)(param_2 + 0x170);
          local_11c = *(undefined4 *)(param_2 + 0x174);
          local_118 = *(undefined4 *)(param_2 + 0x178);
          local_114 = *(undefined4 *)(param_2 + 0x17c);
          if (((-1 < iVar5) && (iVar5 < *(short *)(lVar1 + 700))) &&
             (*(longlong *)(lVar1 + 0x4c0) != 0)) {
            param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
            plVar7 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(lVar1 + 0x4c0) + 8) +
                       (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar7 + 0x140))
                      (plVar7,1,&DAT_1405d85a0,&param_5,&local_120,&local_110,lVar10);
          }
        }
        local_110 = *(undefined4 *)(param_2 + 0x160);
        local_10c = *(undefined4 *)(param_2 + 0x164);
        local_108 = *(undefined4 *)(param_2 + 0x168);
        local_104 = *(undefined4 *)(param_2 + 0x16c);
        local_120 = *(undefined4 *)(param_2 + 0x170);
        local_11c = *(undefined4 *)(param_2 + 0x174);
        local_118 = *(undefined4 *)(param_2 + 0x178);
        local_114 = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
          param_5 = CONCAT22(param_5._2_2_,(short)iVar5);
          plVar7 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar7 + 0x140))
                    (plVar7,1,&DAT_1405d85a0,&param_5,&local_120,&local_110,lVar2);
        }
        local_128[0]._0_2_ = 2;
        plVar7 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        param_5._0_2_ = (short)iVar9;
        (**(code **)(*plVar7 + 0xe0))
                  (plVar7,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_128,&param_5,lVar10);
        param_5 = CONCAT22(param_5._2_2_,(short)iVar8);
        local_128[0] = CONCAT22(local_128[0]._2_2_,(short)iVar12);
        plVar7 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar7 + 0xe0))
                  (plVar7,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_128,&param_5,lVar2);
        FUN_14034edd0(local_f8);
        return 1;
      }
    }
    iVar9 = iVar9 + 1;
  } while (iVar9 < 0x18);
LAB_1401f4b82:
  FUN_14034edd0(lVar11);
  return 0;
}



undefined8
FUN_1401f4c50(longlong param_1,longlong param_2,ulonglong *param_3,ulonglong *param_4,uint param_5)

{
  int *piVar1;
  undefined1 uVar2;
  longlong lVar3;
  int *piVar4;
  uint uVar5;
  ulonglong *puVar6;
  uint *puVar7;
  longlong *plVar8;
  int iVar9;
  int iVar10;
  longlong lVar11;
  uint uVar12;
  longlong lVar13;
  undefined4 uVar14;
  longlong lVar15;
  int iVar16;
  longlong lVar17;
  bool bVar18;
  undefined8 in_stack_fffffffffffffe90;
  undefined4 *puVar19;
  undefined4 *puVar20;
  ulonglong in_stack_fffffffffffffe98;
  undefined8 in_stack_fffffffffffffea0;
  undefined4 uVar22;
  undefined8 in_stack_fffffffffffffea8;
  undefined4 *puVar23;
  ulonglong uVar24;
  undefined2 local_148 [2];
  int 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 [2];
  undefined4 local_118 [2];
  longlong local_110;
  longlong local_108;
  undefined1 local_100;
  undefined8 local_f8;
  undefined1 local_f0 [168];
  undefined4 local_48;
  undefined4 uVar21;
  undefined4 uVar25;
  
  uVar12 = param_5;
  local_f8 = 0xfffffffffffffffe;
  if (2 < param_5) {
    return 0;
  }
  local_108 = param_1 + 0xf630;
  FUN_14034ed40(local_108);
  local_100 = 1;
  local_144 = 0;
  do {
    iVar10 = 0;
    do {
      puVar6 = (ulonglong *)(((longlong)iVar10 + (longlong)local_144 * 0x18) * 0xac + param_1);
      if ((*puVar6 == 0) && (puVar6[1] == 0)) {
        bVar18 = false;
      }
      else {
        bVar18 = true;
      }
      if (((bVar18) || ((int)puVar6[3] != 0)) || (0 < *(short *)((longlong)puVar6 + 0x1c))) {
        bVar18 = *puVar6 < *param_3;
        if ((*puVar6 == *param_3) && (bVar18 = puVar6[1] < param_3[1], puVar6[1] == param_3[1])) {
          iVar16 = 0;
        }
        else {
          iVar16 = (1 - (uint)bVar18) - (uint)(bVar18 != 0);
        }
        if (iVar16 == 0) {
          iVar16 = 0;
          local_110 = (longlong)iVar10 + (longlong)local_144 * 0x18;
          lVar17 = local_110 * 0xac;
          goto LAB_1401f4d70;
        }
      }
      iVar10 = iVar10 + 1;
    } while (iVar10 < 0x18);
    local_144 = local_144 + 1;
  } while (local_144 < 5);
  goto LAB_1401f52fd;
LAB_1401f4f20:
  if (0 < *piVar4) {
    lVar11 = local_110 * 0x2b + (longlong)(int)param_5;
    uVar14 = *(undefined4 *)(param_1 + 0x58 + lVar11 * 4);
    lVar15 = lVar13 * 0x2b + (longlong)iVar9;
    *(undefined4 *)(param_1 + 0x4c + lVar11 * 4) = *(undefined4 *)(param_1 + 0x2070 + lVar15 * 4);
    *(undefined4 *)(param_1 + 0x58 + lVar11 * 4) = *(undefined4 *)(param_1 + 0x207c + lVar15 * 4);
    piVar4 = (int *)(lVar17 + 0x58 + param_1);
    lVar15 = 3;
    do {
      if ((piVar4[-3] == 0x642) && (0 < *piVar4)) {
        piVar1 = (int *)(lVar17 + 0xa4 + param_1);
        *piVar1 = *piVar1 + *piVar4 * 100;
      }
      piVar4 = piVar4 + 1;
      lVar15 = lVar15 + -1;
    } while (lVar15 != 0);
LAB_1401f4fa3:
    local_130 = *(undefined4 *)(param_2 + 0x160);
    local_12c = *(undefined4 *)(param_2 + 0x164);
    local_128 = *(undefined4 *)(param_2 + 0x168);
    local_124 = *(undefined4 *)(param_2 + 0x16c);
    local_140 = *(undefined4 *)(param_2 + 0x170);
    local_13c = *(undefined4 *)(param_2 + 0x174);
    local_138 = *(undefined4 *)(param_2 + 0x178);
    local_134 = *(undefined4 *)(param_2 + 0x17c);
    iVar9 = *(int *)(param_2 + 0x284);
    if (((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
       (lVar15 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar15 != 0)) {
      local_148[0] = (undefined2)iVar9;
      plVar8 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar15 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
               0x70);
      in_stack_fffffffffffffe98 = lVar17 + param_1;
      puVar19 = &local_130;
      (**(code **)(*plVar8 + 0x140))
                (plVar8,1,&DAT_1405d85a0,local_148,&local_140,puVar19,in_stack_fffffffffffffe98);
      uVar21 = (undefined4)((ulonglong)puVar19 >> 0x20);
    }
    local_140 = *(undefined4 *)(param_2 + 0x160);
    local_13c = *(undefined4 *)(param_2 + 0x164);
    local_138 = *(undefined4 *)(param_2 + 0x168);
    local_134 = *(undefined4 *)(param_2 + 0x16c);
    local_130 = *(undefined4 *)(param_2 + 0x170);
    local_12c = *(undefined4 *)(param_2 + 0x174);
    local_128 = *(undefined4 *)(param_2 + 0x178);
    local_124 = *(undefined4 *)(param_2 + 0x17c);
    iVar9 = *(int *)(param_2 + 0x284);
    local_120[0] = 0xffffffff;
    local_118[0] = 0xffffffee;
    if (((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
       (lVar15 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar15 != 0)) {
      local_148[0] = (undefined2)iVar9;
      plVar8 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar15 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
               0x70);
      in_stack_fffffffffffffe98 = (lVar13 + 0x30) * 0xac + param_1;
      puVar23 = local_120;
      puVar19 = local_118;
      puVar20 = &local_140;
      (**(code **)(*plVar8 + 0x130))
                (plVar8,1,&DAT_1405d85a0,local_148,&local_130,puVar20,in_stack_fffffffffffffe98,
                 puVar19,puVar23);
      uVar21 = (undefined4)((ulonglong)puVar20 >> 0x20);
      uVar22 = (undefined4)((ulonglong)puVar19 >> 0x20);
      uVar25 = (undefined4)((ulonglong)puVar23 >> 0x20);
    }
    lVar15 = (lVar13 + 0x30) * 0xac + param_1;
    uVar24 = CONCAT44(uVar25,*(undefined4 *)
                              (param_1 + 0x58 + (local_110 * 0x2b + (longlong)(int)param_5) * 4));
    in_stack_fffffffffffffe98 = in_stack_fffffffffffffe98 & 0xffffffff00000000;
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1a7,0x5b,param_2,lVar15,
                  CONCAT44(uVar21,(int)*(short *)(lVar3 + 0x205c + param_1)),
                  in_stack_fffffffffffffe98,CONCAT44(uVar22,uVar14),uVar24);
    iVar9 = (int)*(short *)(lVar3 + 0x205c + param_1);
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1a8,0x5c,param_2,lVar15,iVar9,
                  in_stack_fffffffffffffe98 & 0xffffffff00000000,iVar9,uVar24 & 0xffffffff00000000);
    FUN_14000a170(local_f0);
    local_48 = 0;
    FUN_140090020(lVar15,local_f0);
    local_148[0] = 2;
    plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    param_5._0_2_ = (short)iVar16;
    (**(code **)(*plVar8 + 0xe0))
              (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_148,&param_5,lVar15);
    param_5 = CONCAT22(param_5._2_2_,(short)iVar10);
    local_148[0] = (undefined2)local_144;
    plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar8 + 0xe0))
              (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_148,&param_5,
               lVar17 + param_1);
    FUN_14034edd0(param_1 + 0xf630);
    return 1;
  }
  iVar9 = iVar9 + 1;
  lVar15 = lVar15 + 1;
  piVar4 = piVar4 + 1;
  if (2 < lVar15) goto LAB_1401f4fa3;
  goto LAB_1401f4f20;
LAB_1401f4d70:
  do {
    lVar15 = (longlong)iVar16;
    puVar6 = (ulonglong *)((lVar15 + 0x30) * 0xac + param_1);
    if ((*puVar6 == 0) && (puVar6[1] == 0)) {
      bVar18 = false;
    }
    else {
      bVar18 = true;
    }
    if (((bVar18) || ((int)puVar6[3] != 0)) || (0 < *(short *)((longlong)puVar6 + 0x1c))) {
      bVar18 = *puVar6 < *param_4;
      if ((*puVar6 == *param_4) && (bVar18 = puVar6[1] < param_4[1], puVar6[1] == param_4[1])) {
        iVar9 = 0;
      }
      else {
        iVar9 = (1 - (uint)bVar18) - (uint)(bVar18 != 0);
      }
      if (iVar9 == 0) {
        lVar13 = (int)uVar12 + lVar17;
        if (*(char *)(lVar13 + 100 + param_1) == '\x05') {
          uVar12 = *(uint *)(lVar15 * 0xac + 0x2058 + param_1);
          lVar3 = FUN_140137690();
          if (*(longlong *)(lVar3 + 0x88) != 0) {
            for (puVar7 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                                    ((ulonglong)uVar12 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
                puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xa6)) {
              if ((puVar7[0xa8] == uVar12) && (*puVar7 == uVar12)) {
                if (puVar7 != (uint *)0x0) {
                  if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                    FUN_14000d450(0x80004005);
                  }
                  uVar2 = (undefined1)puVar7[0x5c];
                  goto LAB_1401f4e5b;
                }
                break;
              }
            }
          }
          uVar2 = 0;
LAB_1401f4e5b:
          *(undefined1 *)(lVar13 + 100 + param_1) = uVar2;
        }
        uVar12 = *(uint *)(lVar15 * 0xac + 0x2058 + param_1);
        lVar15 = FUN_140137690();
        uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffe90 >> 0x20);
        uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
        uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffffea8 >> 0x20);
        if (*(longlong *)(lVar15 + 0x88) != 0) {
          for (puVar7 = *(uint **)(*(longlong *)(lVar15 + 0x88) +
                                  ((ulonglong)uVar12 % (ulonglong)*(uint *)(lVar15 + 0x98)) * 8);
              puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xa6)) {
            if ((puVar7[0xa8] == uVar12) && (*puVar7 == uVar12)) {
              if (puVar7 != (uint *)0x0) {
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar5 = puVar7[0x5c];
                goto LAB_1401f4ece;
              }
              break;
            }
          }
        }
        uVar5 = 0;
LAB_1401f4ece:
        uVar12 = param_5;
        if (*(byte *)(lVar13 + 100 + param_1) == uVar5) {
          uVar14 = 0;
          iVar9 = 0;
          lVar15 = 0;
          lVar13 = (longlong)iVar16;
          lVar3 = lVar13 * 0xac;
          piVar4 = (int *)(lVar3 + 0x2070 + param_1);
          goto LAB_1401f4f20;
        }
      }
    }
    iVar16 = iVar16 + 1;
  } while (iVar16 < 0x18);
LAB_1401f52fd:
  FUN_14034edd0(param_1 + 0xf630);
  return 0;
}



int FUN_1401f5320(longlong param_1,int *param_2,int *param_3)

{
  bool bVar1;
  int *piVar2;
  int iVar3;
  ulonglong uVar4;
  longlong lVar5;
  
  FUN_14034ed40(param_1 + 0xf630);
  iVar3 = 0;
  *param_3 = 0;
  lVar5 = 6;
  do {
    if (0 < *param_2) {
      *param_3 = *param_3 + 1;
    }
    uVar4 = 0;
    piVar2 = (int *)(param_1 + 0x18);
    do {
      if ((*(longlong *)(piVar2 + -6) == 0) && (*(longlong *)(piVar2 + -4) == 0)) {
        bVar1 = false;
      }
      else {
        bVar1 = true;
      }
      if ((((bVar1) || (*piVar2 != 0)) || (0 < (short)piVar2[1])) &&
         (((5 < uVar4 || (0 < piVar2[3])) && (*piVar2 == *param_2)))) {
        iVar3 = iVar3 + 1;
        break;
      }
      uVar4 = uVar4 + 1;
      piVar2 = piVar2 + 0x2b;
    } while ((longlong)uVar4 < 0x18);
    param_2 = param_2 + 1;
    lVar5 = lVar5 + -1;
    if (lVar5 == 0) {
      FUN_14034edd0(param_1 + 0xf630);
      return iVar3;
    }
  } while( true );
}



void FUN_1401f5400(longlong param_1,longlong param_2,int param_3)

{
  int iVar1;
  code *pcVar2;
  bool bVar3;
  DWORD DVar4;
  HANDLE pvVar5;
  HANDLE pvVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  ulonglong uVar10;
  uint uVar11;
  undefined8 *puVar12;
  undefined8 *puVar13;
  undefined8 *puVar14;
  ulonglong uVar15;
  undefined8 *puVar16;
  undefined2 local_res18 [4];
  uint local_res20 [2];
  undefined8 *in_stack_fffffffffffffe98;
  undefined4 local_148 [2];
  undefined8 *local_140;
  undefined8 *local_138;
  undefined8 *local_130;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  longlong local_100;
  undefined1 local_f8;
  undefined8 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  if (param_3 == 5) {
    local_f0 = 0xfffffffffffffffe;
    lVar8 = param_1 + 0xf630;
    local_100 = lVar8;
    FUN_14034ed40(lVar8);
    local_f8 = 1;
    uVar11 = 0;
    do {
      if (uVar11 < 0x78) {
        puVar14 = (undefined8 *)((longlong)(int)uVar11 * 0xac + 0x50a8 + param_1);
      }
      else {
        if (DAT_1406093a4 == 0) {
          FUN_140176d60(0);
        }
        DAT_1406093a4 = DAT_1406093a4 + 1;
        puVar14 = &DAT_14060d080;
      }
      if (*(short *)((longlong)puVar14 + 0x74) != 0) goto LAB_1401f5b7e;
      uVar11 = uVar11 + 1;
    } while ((int)uVar11 < 0x78);
    puVar16 = (undefined8 *)0x0;
    local_140 = (undefined8 *)0x0;
    puVar14 = (undefined8 *)0x0;
    local_138 = (undefined8 *)0x0;
    puVar13 = (undefined8 *)0x0;
    local_130 = (undefined8 *)0x0;
    uVar11 = 0;
    do {
      if (uVar11 < 0x78) {
        plVar7 = (longlong *)((longlong)(int)uVar11 * 0xac + 0x50a8 + param_1);
      }
      else {
        if (DAT_1406093a4 == 0) {
          in_stack_fffffffffffffe98 = (undefined8 *)0x0;
          pvVar5 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                               (HANDLE)0x0);
          if (pvVar5 != (HANDLE)0x0) {
            DVar4 = GetCurrentProcessId();
            pvVar6 = GetCurrentProcess();
            in_stack_fffffffffffffe98 = (undefined8 *)0x0;
            MiniDumpWriteDump(pvVar6,DVar4,pvVar5,0x2000,0,0,0);
            CloseHandle(pvVar5);
          }
        }
        DAT_1406093a4 = DAT_1406093a4 + 1;
        plVar7 = &DAT_14060d080;
      }
      if ((*plVar7 == 0) && (plVar7[1] == 0)) {
        bVar3 = false;
      }
      else {
        bVar3 = true;
      }
      if (((bVar3) || ((int)plVar7[3] != 0)) || (0 < *(short *)((longlong)plVar7 + 0x1c))) {
        if (uVar11 < 0x78) {
          puVar12 = (undefined8 *)((longlong)(int)uVar11 * 0xac + 0x50a8 + param_1);
        }
        else {
          if (DAT_1406093a4 == 0) {
            in_stack_fffffffffffffe98 = (undefined8 *)0x0;
            pvVar5 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0);
            if (pvVar5 != (HANDLE)0x0) {
              DVar4 = GetCurrentProcessId();
              pvVar6 = GetCurrentProcess();
              in_stack_fffffffffffffe98 = (undefined8 *)0x0;
              MiniDumpWriteDump(pvVar6,DVar4,pvVar5,0x2000,0,0,0);
              CloseHandle(pvVar5);
            }
          }
          DAT_1406093a4 = DAT_1406093a4 + 1;
          puVar12 = &DAT_14060d080;
        }
        if ((puVar12 < puVar14) && (puVar16 <= puVar12)) {
          lVar8 = ((longlong)puVar12 - (longlong)puVar16) / 0x56 +
                  ((longlong)puVar12 - (longlong)puVar16 >> 0x3f);
          if (puVar14 == puVar13) {
            lVar9 = ((longlong)puVar14 - (longlong)puVar16) / 0x56 +
                    ((longlong)puVar14 - (longlong)puVar16 >> 0x3f);
            uVar15 = (lVar9 >> 1) - (lVar9 >> 0x3f);
            if (0x17d05f417d05f40 < uVar15) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar15 = uVar15 + 1;
            uVar10 = ((longlong)puVar13 - (longlong)puVar16) / 0xac;
            if (uVar10 < uVar15) {
              if (0x17d05f417d05f41 - (uVar10 >> 1) < uVar10) {
                uVar10 = 0;
              }
              else {
                uVar10 = uVar10 + (uVar10 >> 1);
              }
              if (uVar10 < uVar15) {
                uVar10 = uVar15;
              }
              FUN_14008e560(&local_140,uVar10);
              puVar14 = local_138;
              puVar13 = local_130;
              puVar16 = local_140;
            }
          }
          puVar12 = (undefined8 *)(((lVar8 >> 1) - (lVar8 >> 0x3f)) * 0xac + (longlong)puVar16);
        }
        else if (puVar14 == puVar13) {
          lVar8 = ((longlong)puVar14 - (longlong)puVar16) / 0x56 +
                  ((longlong)puVar14 - (longlong)puVar16 >> 0x3f);
          uVar15 = (lVar8 >> 1) - (lVar8 >> 0x3f);
          if (0x17d05f417d05f40 < uVar15) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          uVar15 = uVar15 + 1;
          uVar10 = ((longlong)puVar13 - (longlong)puVar16) / 0xac;
          if (uVar10 < uVar15) {
            if (0x17d05f417d05f41 - (uVar10 >> 1) < uVar10) {
              uVar10 = 0;
            }
            else {
              uVar10 = uVar10 + (uVar10 >> 1);
            }
            if (uVar10 < uVar15) {
              uVar10 = uVar15;
            }
            FUN_14008e560(&local_140,uVar10);
            puVar14 = local_138;
            puVar13 = local_130;
            puVar16 = local_140;
          }
        }
        if (puVar14 != (undefined8 *)0x0) {
          memcpy(puVar14,puVar12,0xac);
        }
        puVar14 = (undefined8 *)((longlong)puVar14 + 0xac);
        local_138 = puVar14;
        FUN_14000a170(local_e8);
        local_40 = 0;
        if (uVar11 < 0x78) {
          puVar12 = (undefined8 *)((longlong)(int)uVar11 * 0xac + 0x50a8 + param_1);
        }
        else {
          if (DAT_1406093a4 == 0) {
            in_stack_fffffffffffffe98 = (undefined8 *)0x0;
            pvVar5 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0);
            if (pvVar5 != (HANDLE)0x0) {
              DVar4 = GetCurrentProcessId();
              pvVar6 = GetCurrentProcess();
              in_stack_fffffffffffffe98 = (undefined8 *)0x0;
              MiniDumpWriteDump(pvVar6,DVar4,pvVar5,0x2000,0,0,0);
              CloseHandle(pvVar5);
            }
          }
          DAT_1406093a4 = DAT_1406093a4 + 1;
          puVar12 = &DAT_14060d080;
        }
        FUN_140090020(puVar12,local_e8);
      }
      uVar11 = uVar11 + 1;
    } while ((int)uVar11 < 0x78);
    if (puVar16 != puVar14) {
      local_res18[0] = 5;
      plVar7 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar7 + 0xb00))(plVar7,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18)
      ;
      uVar11 = 0;
      puVar13 = puVar16;
      do {
        if ((int)*(short *)((longlong)puVar13 + 0x16) != uVar11) {
          in_stack_fffffffffffffe98 =
               (undefined8 *)((ulonglong)in_stack_fffffffffffffe98 & 0xffffffff00000000);
          FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,puVar13,
                        (int)*(short *)((longlong)puVar13 + 0x1c),in_stack_fffffffffffffe98,
                        (int)*(short *)((longlong)puVar13 + 0x16),uVar11);
          *(short *)((longlong)puVar13 + 0x16) = (short)uVar11;
          local_110 = *(undefined4 *)(param_2 + 0x160);
          local_10c = *(undefined4 *)(param_2 + 0x164);
          local_108 = *(undefined4 *)(param_2 + 0x168);
          local_104 = *(undefined4 *)(param_2 + 0x16c);
          local_120 = *(undefined4 *)(param_2 + 0x170);
          local_11c = *(undefined4 *)(param_2 + 0x174);
          local_118 = *(undefined4 *)(param_2 + 0x178);
          local_114 = *(undefined4 *)(param_2 + 0x17c);
          iVar1 = *(int *)(param_2 + 0x284);
          local_148[0] = 5;
          local_res20[0] = uVar11;
          if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
             (lVar8 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar8 != 0)) {
            local_res18[0] = (undefined2)iVar1;
            plVar7 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar8 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            in_stack_fffffffffffffe98 = puVar13;
            (**(code **)(*plVar7 + 0x130))
                      (plVar7,1,&DAT_1405d85a0,local_res18,&local_120,&local_110,puVar13,local_148,
                       local_res20);
          }
        }
        if (uVar11 < 0x78) {
          puVar12 = (undefined8 *)((longlong)(int)uVar11 * 0xac + 0x50a8 + param_1);
        }
        else {
          if (DAT_1406093a4 == 0) {
            in_stack_fffffffffffffe98 = (undefined8 *)0x0;
            pvVar5 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0);
            if (pvVar5 != (HANDLE)0x0) {
              DVar4 = GetCurrentProcessId();
              pvVar6 = GetCurrentProcess();
              in_stack_fffffffffffffe98 = (undefined8 *)0x0;
              MiniDumpWriteDump(pvVar6,DVar4,pvVar5,0x2000,0,0,0);
              CloseHandle(pvVar5);
            }
          }
          DAT_1406093a4 = DAT_1406093a4 + 1;
          puVar12 = &DAT_14060d080;
        }
        FUN_140090020(puVar12,puVar13);
        local_res20[0] = CONCAT22(local_res20[0]._2_2_,5);
        plVar7 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        local_res18[0] = (short)uVar11;
        (**(code **)(*plVar7 + 0xe0))
                  (plVar7,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res20,local_res18,
                   puVar13);
        puVar13 = (undefined8 *)((longlong)puVar13 + 0xac);
        uVar11 = uVar11 + 1;
      } while (puVar13 != puVar14);
    }
    lVar8 = local_100;
    if (puVar16 != (undefined8 *)0x0) {
      operator_delete(puVar16);
      lVar8 = local_100;
    }
LAB_1401f5b7e:
    FUN_14034edd0(lVar8);
  }
  return;
}



void FUN_1401f5ba0(longlong param_1,longlong param_2,uint param_3)

{
  code *pcVar1;
  bool bVar2;
  longlong *_Src;
  uint uVar3;
  short *psVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong *plVar9;
  uint uVar10;
  longlong *plVar11;
  longlong *plVar12;
  ulonglong uVar13;
  longlong *plVar14;
  int iVar15;
  uint local_res18 [2];
  uint local_res20 [2];
  longlong *in_stack_fffffffffffffe88;
  uint local_158 [2];
  longlong *local_150;
  longlong *local_148;
  longlong *local_140;
  longlong local_130;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  longlong local_108;
  undefined1 local_100;
  undefined8 local_f8;
  undefined1 local_f0 [168];
  undefined4 local_48;
  
  local_f8 = 0xfffffffffffffffe;
  lVar8 = (longlong)(int)param_3;
  if (param_3 < 5) {
    lVar6 = param_1 + 0xf630;
    local_res18[0] = param_3;
    local_108 = lVar6;
    FUN_14034ed40(lVar6);
    local_100 = 1;
    lVar5 = 0;
    psVar4 = (short *)(lVar8 * 0x1020 + 0x74 + param_1);
    do {
      if (*psVar4 != 0) goto LAB_1401f60e0;
      lVar5 = lVar5 + 1;
      psVar4 = psVar4 + 0x56;
    } while (lVar5 < 0x18);
    plVar9 = (longlong *)0x0;
    local_150 = (longlong *)0x0;
    plVar12 = (longlong *)0x0;
    local_148 = (longlong *)0x0;
    plVar14 = (longlong *)0x0;
    local_140 = (longlong *)0x0;
    iVar15 = 0;
    local_130 = lVar8 * 0x18;
    plVar11 = (longlong *)(lVar8 * 0x1020 + param_1);
    do {
      if ((*plVar11 == 0) && (plVar11[1] == 0)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
      if (((bVar2) || ((int)plVar11[3] != 0)) || (0 < *(short *)((longlong)plVar11 + 0x1c))) {
        if ((plVar11 < plVar12) && (plVar9 <= plVar11)) {
          lVar8 = ((longlong)plVar11 - (longlong)plVar9) / 0x56 +
                  ((longlong)plVar11 - (longlong)plVar9 >> 0x3f);
          if (plVar12 == plVar14) {
            lVar6 = ((longlong)plVar12 - (longlong)plVar9) / 0x56 +
                    ((longlong)plVar12 - (longlong)plVar9 >> 0x3f);
            uVar13 = (lVar6 >> 1) - (lVar6 >> 0x3f);
            if (0x17d05f417d05f40 < uVar13) {
              std::_Xlength_error("vector<T> too long");
              pcVar1 = (code *)swi(3);
              (*pcVar1)();
              return;
            }
            uVar13 = uVar13 + 1;
            uVar7 = ((longlong)plVar14 - (longlong)plVar9) / 0xac;
            if (uVar7 < uVar13) {
              if (0x17d05f417d05f41 - (uVar7 >> 1) < uVar7) {
                uVar7 = 0;
              }
              else {
                uVar7 = uVar7 + (uVar7 >> 1);
              }
              if (uVar7 < uVar13) {
                uVar7 = uVar13;
              }
              FUN_14008e560(&local_150,uVar7);
              plVar12 = local_148;
              plVar9 = local_150;
              plVar14 = local_140;
            }
          }
          _Src = (longlong *)(((lVar8 >> 1) - (lVar8 >> 0x3f)) * 0xac + (longlong)plVar9);
        }
        else {
          _Src = plVar11;
          if (plVar12 == plVar14) {
            lVar8 = ((longlong)plVar12 - (longlong)plVar9) / 0x56 +
                    ((longlong)plVar12 - (longlong)plVar9 >> 0x3f);
            uVar13 = (lVar8 >> 1) - (lVar8 >> 0x3f);
            if (0x17d05f417d05f40 < uVar13) {
              std::_Xlength_error("vector<T> too long");
              pcVar1 = (code *)swi(3);
              (*pcVar1)();
              return;
            }
            uVar13 = uVar13 + 1;
            uVar7 = ((longlong)plVar14 - (longlong)plVar9) / 0xac;
            if (uVar7 < uVar13) {
              if (0x17d05f417d05f41 - (uVar7 >> 1) < uVar7) {
                uVar7 = 0;
              }
              else {
                uVar7 = uVar7 + (uVar7 >> 1);
              }
              if (uVar7 < uVar13) {
                uVar7 = uVar13;
              }
              FUN_14008e560(&local_150,uVar7);
              plVar12 = local_148;
              plVar9 = local_150;
              plVar14 = local_140;
            }
          }
        }
        if (plVar12 != (longlong *)0x0) {
          memcpy(plVar12,_Src,0xac);
        }
        plVar12 = (longlong *)((longlong)plVar12 + 0xac);
        local_148 = plVar12;
        FUN_14000a170(local_f0);
        local_48 = 0;
        FUN_140090020((iVar15 + local_130) * 0xac + param_1,local_f0);
      }
      iVar15 = iVar15 + 1;
      plVar11 = (longlong *)((longlong)plVar11 + 0xac);
    } while (iVar15 < 0x18);
    plVar14 = plVar9;
    if (plVar9 != plVar12) {
      local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)local_res18[0]);
      plVar11 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar11 + 0xb00))
                (plVar11,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res20);
      uVar3 = local_res18[0];
      uVar10 = 0;
      lVar8 = ((longlong)plVar12 - (longlong)plVar9) / 0x56 +
              ((longlong)plVar12 - (longlong)plVar9 >> 0x3f);
      lVar6 = lVar8 >> 1;
      lVar8 = lVar8 >> 0x3f;
      if (lVar6 != lVar8) {
        uVar13 = 0;
        do {
          if ((int)*(short *)((longlong)plVar9 + 0x16) != uVar10) {
            in_stack_fffffffffffffe88 =
                 (longlong *)((ulonglong)in_stack_fffffffffffffe88 & 0xffffffff00000000);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xd,param_2,plVar9,
                          (int)*(short *)((longlong)plVar9 + 0x1c),in_stack_fffffffffffffe88,
                          (int)*(short *)((longlong)plVar9 + 0x16),uVar10);
            *(short *)((longlong)plVar9 + 0x16) = (short)uVar10;
            local_128 = *(undefined4 *)(param_2 + 0x160);
            local_124 = *(undefined4 *)(param_2 + 0x164);
            local_120 = *(undefined4 *)(param_2 + 0x168);
            local_11c = *(undefined4 *)(param_2 + 0x16c);
            local_118 = *(undefined4 *)(param_2 + 0x170);
            local_114 = *(undefined4 *)(param_2 + 0x174);
            local_110 = *(undefined4 *)(param_2 + 0x178);
            local_10c = *(undefined4 *)(param_2 + 0x17c);
            iVar15 = *(int *)(param_2 + 0x284);
            local_158[0] = uVar3;
            local_res20[0] = uVar10;
            if (((-1 < iVar15) && (iVar15 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0)) {
              local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar15);
              plVar12 = (longlong *)
                        (*(longlong *)
                          (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                        0x70);
              in_stack_fffffffffffffe88 = plVar9;
              (**(code **)(*plVar12 + 0x130))
                        (plVar12,1,&DAT_1405d85a0,local_res18,&local_118,&local_128,plVar9,local_158
                         ,local_res20);
            }
          }
          FUN_140090020((uVar13 + local_130) * 0xac + param_1,plVar9);
          local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)uVar10);
          local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)uVar3);
          plVar12 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
          (**(code **)(*plVar12 + 0xe0))
                    (plVar12,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res20,local_res18,
                     plVar9);
          uVar10 = uVar10 + 1;
          plVar9 = (longlong *)((longlong)plVar9 + 0xac);
          uVar13 = (ulonglong)uVar10;
          plVar14 = local_150;
        } while (uVar13 < (ulonglong)(lVar6 - lVar8));
      }
    }
    lVar6 = local_108;
    if (plVar14 != (longlong *)0x0) {
      operator_delete(plVar14);
      lVar6 = local_108;
    }
LAB_1401f60e0:
    FUN_14034edd0(lVar6);
  }
  return;
}



void FUN_1401f6100(longlong param_1,int *param_2,int *param_3)

{
  longlong lVar1;
  
  if ((((-1 < *param_2) && (*param_2 < 5)) && (-1 < *param_3)) && (*param_3 < 0x18)) {
    FUN_14034ed40(param_1 + 0xf630);
    lVar1 = ((longlong)*param_3 + (longlong)*param_2 * 0x18) * 0xac;
    *(undefined4 *)(lVar1 + 0x80 + param_1) = 0;
    *(undefined4 *)(lVar1 + 0x84 + param_1) = 0;
    *(undefined4 *)(lVar1 + 0x88 + param_1) = 0;
    *(undefined4 *)(lVar1 + 0x8c + param_1) = 0;
    FUN_14034edd0(param_1 + 0xf630);
  }
  return;
}



undefined8 FUN_1401f61c0(uint param_1,uint *param_2,uint *param_3,undefined2 *param_4,uint param_5)

{
  code *pcVar1;
  uint extraout_EAX;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  uint *puVar6;
  uint *puVar7;
  ulonglong uVar8;
  uint *puVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  longlong lVar12;
  uint *puVar13;
  uint uVar14;
  int iVar15;
  uint *puVar16;
  double dVar17;
  undefined8 local_b8;
  uint *local_b0;
  uint *local_a8;
  uint *local_a0;
  uint *local_98;
  uint *local_88;
  uint *local_80;
  uint *local_78;
  uint *local_68;
  uint *local_60;
  undefined8 local_58;
  undefined8 local_48;
  __time64_t _Var5;
  
  local_48 = 0xfffffffffffffffe;
  puVar13 = (uint *)0x0;
  *param_2 = 0;
  *param_3 = 0;
  *param_4 = 0;
  uVar14 = param_5;
  if (param_5 == 0) {
    lVar2 = FUN_140137690();
    puVar7 = puVar13;
    if (*(longlong *)(lVar2 + 0x88) != 0) {
      for (puVar16 = *(uint **)(*(longlong *)(lVar2 + 0x88) +
                               ((ulonglong)param_1 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8);
          (puVar7 = puVar13, puVar16 != (uint *)0x0 &&
          ((puVar16[0xa8] != param_1 || (puVar7 = puVar16, *puVar16 != param_1))));
          puVar16 = *(uint **)(puVar16 + 0xa6)) {
      }
    }
    uVar14 = 0;
    if (puVar7 != (uint *)0x0) {
      if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar14 = puVar7[0x7c];
    }
  }
  local_68 = (uint *)0x0;
  local_60 = (uint *)0x0;
  local_58 = 0;
  uVar3 = FUN_1401427f0();
  FUN_140142720(uVar3,uVar14,&local_68);
  puVar7 = local_68;
  if (local_68 == local_60) goto joined_r0x0001401f6825;
  local_a8 = (uint *)0x0;
  local_a0 = (uint *)0x0;
  local_98 = (uint *)0x0;
  local_88 = (uint *)0x0;
  local_80 = (uint *)0x0;
  local_78 = (uint *)0x0;
  param_5 = 0;
  local_b0 = (uint *)((longlong)local_60 - (longlong)local_68 >> 2);
  puVar6 = puVar13;
  puVar9 = puVar13;
  puVar16 = puVar13;
  if (local_b0 != (uint *)0x0) {
LAB_1401f62e7:
    uVar14 = *puVar7;
    local_b8 = puVar7;
    plVar4 = (longlong *)FUN_1401427f0();
    if (*plVar4 != 0) {
      for (puVar7 = *(uint **)(*plVar4 + ((ulonglong)uVar14 % (ulonglong)*(uint *)(plVar4 + 2)) * 8)
          ; puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0x24)) {
        if ((puVar7[0x26] == uVar14) && (*puVar7 == uVar14)) {
          if (puVar7 != (uint *)0x0) {
            iVar15 = 0;
            if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            puVar16 = puVar7 + 1;
            if ((puVar16 != (uint *)0x0) && (0 < (int)puVar7[4])) goto LAB_1401f6360;
          }
          break;
        }
      }
    }
    goto LAB_1401f648d;
  }
LAB_1401f64eb:
  puVar7 = local_68;
  _Var5 = _time64((__time64_t *)0x0);
  extraout_EAX = (uint)_Var5;
  param_5 = extraout_EAX;
  if (-1 < (int)extraout_EAX) {
    param_5 = -extraout_EAX;
  }
  dVar17 = (double)FUN_140414e80(&param_5);
  uVar14 = puVar16[(int)(dVar17 * (double)(int)((longlong)puVar6 - (longlong)puVar16 >> 2))];
  plVar4 = (longlong *)FUN_1401427f0();
  if (*plVar4 != 0) {
    for (puVar9 = *(uint **)(*plVar4 + ((ulonglong)uVar14 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
        puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0x24)) {
      if ((puVar9[0x26] == uVar14) && (*puVar9 == uVar14)) {
        if (puVar9 != (uint *)0x0) {
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          local_b0 = puVar9 + 1;
          if (local_b0 != (uint *)0x0) {
            if (puVar16 != puVar6) {
              memmove(puVar16,puVar6,0);
              local_a0 = puVar16;
            }
            lVar2 = 0;
            puVar9 = puVar9 + 6;
            puVar7 = puVar13;
            do {
              iVar15 = 0;
              if ((*puVar9 != 0) && (0 < (int)puVar9[10])) {
                do {
                  uVar8 = 0;
                  local_b8 = (uint *)CONCAT44(puVar9[0x14],*puVar9);
                  if ((&local_b8 < puVar13) && (puVar7 <= &local_b8)) {
                    lVar12 = (longlong)&local_b8 - (longlong)puVar7;
                    if (puVar13 == local_78) {
                      uVar10 = (longlong)puVar13 - (longlong)puVar7 >> 3;
                      if (0x1ffffffffffffffe < uVar10) {
                        std::_Xlength_error("vector<T> too long");
                        pcVar1 = (code *)swi(3);
                        uVar3 = (*pcVar1)();
                        return uVar3;
                      }
                      uVar10 = uVar10 + 1;
                      uVar11 = (longlong)local_78 - (longlong)puVar7 >> 3;
                      if (uVar11 < uVar10) {
                        if (uVar11 <= 0x1fffffffffffffff - (uVar11 >> 1)) {
                          uVar8 = uVar11 + (uVar11 >> 1);
                        }
                        if (uVar8 < uVar10) {
                          uVar8 = uVar10;
                        }
                        FUN_1401fbb20(&local_88,uVar8);
                        puVar13 = local_80;
                        puVar7 = local_88;
                      }
                    }
                    if (puVar13 != (uint *)0x0) {
                      puVar6 = *(uint **)(puVar7 + (lVar12 >> 3) * 2);
LAB_1401f6724:
                      *(uint **)puVar13 = puVar6;
                    }
                  }
                  else {
                    if (puVar13 == local_78) {
                      uVar10 = (longlong)puVar13 - (longlong)puVar7 >> 3;
                      if (0x1ffffffffffffffe < uVar10) {
                        std::_Xlength_error("vector<T> too long");
                        pcVar1 = (code *)swi(3);
                        uVar3 = (*pcVar1)();
                        return uVar3;
                      }
                      uVar10 = uVar10 + 1;
                      uVar11 = (longlong)local_78 - (longlong)puVar7 >> 3;
                      if (uVar11 < uVar10) {
                        if (uVar11 <= 0x1fffffffffffffff - (uVar11 >> 1)) {
                          uVar8 = uVar11 + (uVar11 >> 1);
                        }
                        if (uVar8 < uVar10) {
                          uVar8 = uVar10;
                        }
                        FUN_1401fbb20(&local_88,uVar8);
                        puVar13 = local_80;
                        puVar7 = local_88;
                      }
                    }
                    puVar6 = local_b8;
                    if (puVar13 != (uint *)0x0) goto LAB_1401f6724;
                  }
                  puVar13 = puVar13 + 2;
                  iVar15 = iVar15 + 1;
                  local_80 = puVar13;
                } while (iVar15 < (int)puVar9[10]);
              }
              lVar2 = lVar2 + 1;
              puVar9 = puVar9 + 1;
            } while (lVar2 < 10);
            if (puVar7 != puVar13) {
              FUN_1401fbce0(puVar7,puVar13);
            }
            puVar6 = local_b0;
            uVar14 = local_b0[4];
            dVar17 = (double)FUN_140414e80(&param_5);
            iVar15 = (int)(dVar17 * (double)(int)uVar14);
            if ((-1 < iVar15) && (iVar15 < (int)((longlong)puVar13 - (longlong)puVar7 >> 3))) {
              *param_2 = *puVar6;
              *param_3 = puVar7[(longlong)iVar15 * 2];
              *param_4 = (short)puVar7[(longlong)iVar15 * 2 + 1];
              if (puVar7 != (uint *)0x0) {
                operator_delete(puVar7);
              }
              if (puVar16 != (uint *)0x0) {
                operator_delete(puVar16);
              }
              if (local_68 != (uint *)0x0) {
                operator_delete(local_68);
              }
              return 1;
            }
            if (puVar7 != (uint *)0x0) {
              operator_delete(puVar7);
            }
            puVar7 = local_68;
            if (puVar16 != (uint *)0x0) {
              operator_delete(puVar16);
              puVar7 = local_68;
            }
            goto joined_r0x0001401f6825;
          }
        }
        break;
      }
    }
  }
  if (puVar16 != (uint *)0x0) {
    operator_delete(puVar16);
  }
joined_r0x0001401f6825:
  if (puVar7 != (uint *)0x0) {
    operator_delete(puVar7);
  }
  return 0;
LAB_1401f6360:
  do {
    if ((puVar16 < puVar6) && (local_a8 <= puVar16)) {
      lVar2 = (longlong)puVar16 - (longlong)local_a8;
      if (puVar6 == puVar9) {
        uVar8 = (longlong)puVar6 - (longlong)local_a8 >> 2;
        if (0x3ffffffffffffffe < uVar8) {
          std::_Xlength_error("vector<T> too long");
          pcVar1 = (code *)swi(3);
          uVar3 = (*pcVar1)();
          return uVar3;
        }
        if ((ulonglong)((longlong)puVar9 - (longlong)local_a8 >> 2) < uVar8 + 1) {
          FUN_140051e60(&local_a8);
          puVar6 = local_a0;
          puVar9 = local_98;
        }
      }
      if (puVar6 != (uint *)0x0) {
        uVar14 = local_a8[lVar2 >> 2];
LAB_1401f6475:
        *puVar6 = uVar14;
      }
    }
    else {
      if (puVar6 == puVar9) {
        uVar8 = (longlong)puVar6 - (longlong)local_a8 >> 2;
        if (0x3ffffffffffffffe < uVar8) {
          std::_Xlength_error("vector<T> too long");
          pcVar1 = (code *)swi(3);
          uVar3 = (*pcVar1)();
          return uVar3;
        }
        if ((ulonglong)((longlong)puVar9 - (longlong)local_a8 >> 2) < uVar8 + 1) {
          FUN_140051e60(&local_a8);
          puVar6 = local_a0;
          puVar9 = local_98;
        }
      }
      if (puVar6 != (uint *)0x0) {
        uVar14 = *puVar16;
        goto LAB_1401f6475;
      }
    }
    puVar6 = puVar6 + 1;
    iVar15 = iVar15 + 1;
    local_a0 = puVar6;
  } while (iVar15 < (int)puVar7[4]);
LAB_1401f648d:
  puVar16 = local_a8;
  param_5 = param_5 + 1;
  puVar7 = local_b8 + 1;
  if (local_b0 <= (uint *)(ulonglong)param_5) goto LAB_1401f64d3;
  goto LAB_1401f62e7;
LAB_1401f64d3:
  local_b8 = puVar7;
  if (local_a8 != puVar6) {
    FUN_1401fbc30(local_a8);
  }
  goto LAB_1401f64eb;
}



longlong FUN_1401f6870(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  
  iVar2 = 0x2f;
  lVar1 = param_1;
  do {
    FUN_14000a170(lVar1);
    *(undefined4 *)(lVar1 + 0xa8) = 0;
    lVar1 = lVar1 + 0xac;
    iVar2 = iVar2 + -1;
  } while (-1 < iVar2);
  *(undefined4 *)(param_1 + 0x2044) = 0;
  *(undefined4 *)(param_1 + 0x2048) = 0;
  *(undefined4 *)(param_1 + 0x204c) = 0;
  *(undefined4 *)(param_1 + 0x2050) = 0;
  FUN_1401f6900(param_1);
  return param_1;
}



void FUN_1401f6900(longlong param_1)

{
  undefined2 *puVar1;
  longlong lVar2;
  undefined2 *puVar3;
  longlong lVar4;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined2 local_b4;
  undefined2 local_b2;
  undefined4 local_b0;
  undefined2 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined2 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined2 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined1 local_64;
  undefined1 local_63;
  undefined1 local_62;
  undefined4 local_60;
  undefined2 local_5c;
  undefined2 local_5a;
  undefined4 local_58;
  undefined2 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined2 local_34;
  undefined2 local_32;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  *(undefined2 *)(param_1 + 0x2040) = 0;
  puVar3 = (undefined2 *)(param_1 + 0x16);
  lVar2 = 0x18;
  do {
    lVar4 = 2;
    puVar1 = puVar3;
    do {
      FUN_14000a170(&local_c8);
      *puVar1 = local_b2;
      puVar1[-1] = local_b4;
      *(undefined4 *)(puVar1 + -0xb) = local_c8;
      *(undefined4 *)(puVar1 + -9) = local_c4;
      *(undefined4 *)(puVar1 + -7) = local_c0;
      *(undefined4 *)(puVar1 + -5) = local_bc;
      *(undefined4 *)(puVar1 + 1) = local_b0;
      puVar1[3] = local_ac;
      *(undefined4 *)(puVar1 + 5) = local_a8;
      *(undefined4 *)(puVar1 + 7) = local_a4;
      puVar1[9] = local_a0;
      *(undefined4 *)(puVar1 + 0xd) = local_98;
      *(undefined4 *)(puVar1 + 0xf) = local_94;
      *(undefined4 *)(puVar1 + 0x11) = local_90;
      *(undefined4 *)(puVar1 + 0x13) = local_8c;
      *(undefined4 *)(puVar1 + 0x15) = local_88;
      *(undefined4 *)(puVar1 + 0x17) = local_84;
      *(undefined4 *)(puVar1 + 0xb) = local_9c;
      puVar1[0x19] = local_80;
      *(undefined4 *)(puVar1 + 0x1b) = local_7c;
      *(undefined4 *)(puVar1 + 0x1d) = local_78;
      *(undefined4 *)(puVar1 + 0x1f) = local_74;
      *(undefined4 *)(puVar1 + 0x21) = local_70;
      *(undefined4 *)(puVar1 + 0x23) = local_6c;
      *(undefined4 *)(puVar1 + 0x25) = local_68;
      *(undefined1 *)(puVar1 + 0x27) = local_64;
      *(undefined1 *)((longlong)puVar1 + 0x4f) = local_63;
      *(undefined1 *)(puVar1 + 0x28) = local_62;
      puVar1[0x2b] = local_5c;
      puVar1[0x2c] = local_5a;
      *(undefined4 *)(puVar1 + 0x2d) = local_58;
      puVar1[0x33] = local_4c;
      *(undefined4 *)(puVar1 + 0x35) = local_48;
      *(undefined4 *)(puVar1 + 0x37) = local_44;
      *(undefined4 *)(puVar1 + 0x39) = local_40;
      *(undefined4 *)(puVar1 + 0x3b) = local_3c;
      *(undefined4 *)(puVar1 + 0x3d) = local_38;
      puVar1[0x3f] = local_34;
      puVar1[0x40] = local_32;
      *(undefined4 *)(puVar1 + 0x41) = local_30;
      *(undefined4 *)(puVar1 + 0x49) = 0;
      *(undefined4 *)(puVar1 + 0x43) = local_2c;
      lVar4 = lVar4 + -1;
      *(undefined4 *)(puVar1 + 0x45) = local_28;
      *(undefined4 *)(puVar1 + 0x47) = local_24;
      *(undefined4 *)(puVar1 + 0x29) = local_60;
      puVar1 = puVar1 + 0x810;
    } while (lVar4 != 0);
    puVar3 = puVar3 + 0x56;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  return;
}



undefined4 * FUN_1401f6ad0(longlong param_1,undefined4 *param_2,longlong param_3,int *param_4)

{
  byte bVar1;
  uint uVar2;
  bool bVar3;
  int iVar4;
  longlong lVar5;
  uint *puVar6;
  short *psVar7;
  
  uVar2 = *(uint *)(param_3 + 0x18);
  lVar5 = FUN_140137690();
  if (*(longlong *)(lVar5 + 0x88) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xa6)) {
      if ((puVar6[0xa8] == uVar2) && (*puVar6 == uVar2)) {
        if (puVar6 != (uint *)0x0) {
          uVar2 = *(uint *)(param_3 + 0x18);
          lVar5 = FUN_140137690();
          if ((*(longlong *)(lVar5 + 0x88) == 0) ||
             (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                                 ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8),
             puVar6 == (uint *)0x0)) goto LAB_1401f6c32;
          goto LAB_1401f6ba0;
        }
        break;
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
  return param_2;
  while (puVar6 = *(uint **)(puVar6 + 0xa6), puVar6 != (uint *)0x0) {
LAB_1401f6ba0:
    if ((puVar6[0xa8] == uVar2) && (*puVar6 == uVar2)) {
      if ((puVar6 != (uint *)0x0) && (uVar2 = puVar6[0x4c], 1 < (int)uVar2)) {
        iVar4 = FUN_1401f6f30(param_1,*(undefined4 *)(param_3 + 0x18));
        if ((-1 < iVar4) &&
           ((iVar4 < (int)(uint)*(byte *)(param_1 + 0x2041) &&
            (lVar5 = ((longlong)iVar4 + 0x18) * 0xac,
            (int)*(short *)(lVar5 + 0x1c + param_1) + (int)*(short *)(param_3 + 0x1c) <= (int)uVar2)
            ))) {
          *param_4 = iVar4;
          psVar7 = (short *)(lVar5 + 0x1c + param_1);
          *psVar7 = *psVar7 + *(short *)(param_3 + 0x1c);
          *param_2 = *(undefined4 *)(lVar5 + param_1);
          param_2[1] = *(undefined4 *)(lVar5 + 4 + param_1);
          param_2[2] = *(undefined4 *)(lVar5 + 8 + param_1);
          param_2[3] = *(undefined4 *)(lVar5 + 0xc + param_1);
          return param_2;
        }
      }
      break;
    }
  }
LAB_1401f6c32:
  bVar1 = *(byte *)(param_1 + 0x2041);
  if ((bVar1 < 0x19) && (iVar4 = 0, bVar1 != 0)) {
    psVar7 = (short *)(param_1 + 0x103c);
    do {
      if ((*(longlong *)(psVar7 + -0xe) == 0) && (*(longlong *)(psVar7 + -10) == 0)) {
        bVar3 = false;
      }
      else {
        bVar3 = true;
      }
      if (((!bVar3) && (*(int *)(psVar7 + -2) == 0)) && (*psVar7 < 1)) goto LAB_1401f6c94;
      iVar4 = iVar4 + 1;
      psVar7 = psVar7 + 0x56;
    } while (iVar4 < (int)(uint)bVar1);
  }
  iVar4 = -1;
LAB_1401f6c94:
  *param_4 = iVar4;
  FUN_1401f6cd0(param_1,param_2,1,iVar4,param_3);
  return param_2;
}



undefined4 *
FUN_1401f6cd0(longlong param_1,undefined4 *param_2,int param_3,int param_4,longlong param_5)

{
  char *pcVar1;
  bool bVar2;
  undefined4 uVar3;
  longlong *plVar4;
  
  if ((-1 < param_4) && (param_4 < (int)(uint)*(byte *)(param_1 + 0x2041))) {
    plVar4 = (longlong *)(((longlong)param_4 + (longlong)param_3 * 0x18) * 0xac + param_1);
    if ((*plVar4 == 0) && (plVar4[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if (((bVar2) || ((int)plVar4[3] != 0)) || (0 < *(short *)((longlong)plVar4 + 0x1c))) {
      *param_2 = 0;
      param_2[1] = 0;
      param_2[2] = 0;
      uVar3 = 0;
    }
    else {
      *(short *)(param_5 + 0x14) = (short)param_3;
      *(short *)(param_5 + 0x16) = (short)param_4;
      FUN_140090020(plVar4);
      pcVar1 = (char *)(param_1 + 0x2040);
      *pcVar1 = *pcVar1 + -1;
      if (*pcVar1 == '\0') {
        *(undefined1 *)(param_1 + 0x2040) = 0;
      }
      *param_2 = (int)*plVar4;
      param_2[1] = *(undefined4 *)((longlong)plVar4 + 4);
      param_2[2] = (int)plVar4[1];
      uVar3 = *(undefined4 *)((longlong)plVar4 + 0xc);
    }
    param_2[3] = uVar3;
    return param_2;
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  param_2[3] = 0;
  return param_2;
}



undefined8 FUN_1401f6df0(longlong param_1,int param_2,uint param_3,ulonglong *param_4)

{
  int iVar1;
  ulonglong *puVar2;
  bool bVar3;
  undefined1 local_b8 [168];
  undefined4 local_10;
  
  if ((0x17 < param_3) || ((int)(uint)*(byte *)(param_1 + 0x2041) <= (int)param_3)) {
    return 0;
  }
  puVar2 = (ulonglong *)(((longlong)(int)param_3 + (longlong)param_2 * 0x18) * 0xac + param_1);
  bVar3 = *puVar2 < *param_4;
  if ((*puVar2 == *param_4) && (bVar3 = puVar2[1] < param_4[1], puVar2[1] == param_4[1])) {
    iVar1 = 0;
  }
  else {
    iVar1 = (1 - (uint)bVar3) - (uint)(bVar3 != 0);
  }
  if (iVar1 != 0) {
    return 0;
  }
  FUN_14000a170(local_b8);
  local_10 = 0;
  FUN_140090020(puVar2,local_b8);
  *(char *)(param_1 + 0x2040) = *(char *)(param_1 + 0x2040) + '\x01';
  return 1;
}



undefined8 FUN_1401f6eb0(longlong param_1,int param_2,int param_3,undefined8 param_4)

{
  bool bVar1;
  longlong *plVar2;
  
  if (0x17 < param_3) {
    return 0;
  }
  if (param_3 < (int)(uint)*(byte *)(param_1 + 0x2041)) {
    plVar2 = (longlong *)(((longlong)param_3 + (longlong)param_2 * 0x18) * 0xac + param_1);
    if ((*plVar2 == 0) && (plVar2[1] == 0)) {
      bVar1 = false;
    }
    else {
      bVar1 = true;
    }
    if (((!bVar1) && ((int)plVar2[3] == 0)) && (*(short *)((longlong)plVar2 + 0x1c) < 1)) {
      return 0;
    }
    FUN_140090020(param_4);
    return 1;
  }
  return 0;
}



int FUN_1401f6f30(longlong param_1,uint param_2)

{
  uint *puVar1;
  bool bVar2;
  longlong lVar3;
  short *psVar4;
  int iVar5;
  uint uVar6;
  
  if (*(byte *)(param_1 + 0x2041) < 0x19) {
    lVar3 = FUN_140137690();
    if (*(longlong *)(lVar3 + 0x88) != 0) {
      for (puVar1 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
          puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xa6)) {
        if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) {
          if (puVar1 != (uint *)0x0) {
            uVar6 = puVar1[0x4c];
            goto LAB_1401f6fa5;
          }
          break;
        }
      }
    }
    uVar6 = 1;
LAB_1401f6fa5:
    iVar5 = 0;
    if (*(byte *)(param_1 + 0x2041) != 0) {
      psVar4 = (short *)(param_1 + 0x103c);
      do {
        if ((*(longlong *)(psVar4 + -0xe) == 0) && (*(longlong *)(psVar4 + -10) == 0)) {
          bVar2 = false;
        }
        else {
          bVar2 = true;
        }
        if ((((bVar2) || (*(int *)(psVar4 + -2) != 0)) || (0 < *psVar4)) &&
           ((*(uint *)(psVar4 + -2) == param_2 && ((int)*psVar4 < (int)uVar6)))) {
          return iVar5;
        }
        iVar5 = iVar5 + 1;
        psVar4 = psVar4 + 0x56;
      } while (iVar5 < (int)(uint)*(byte *)(param_1 + 0x2041));
    }
  }
  return -1;
}



void FUN_1401f7030(longlong param_1,int param_2,undefined8 param_3)

{
  bool bVar1;
  short *psVar2;
  int iVar3;
  
  if ((*(byte *)(param_1 + 0x2041) < 0x19) && (iVar3 = 0, *(byte *)(param_1 + 0x2041) != 0)) {
    psVar2 = (short *)((longlong)param_2 * 0x1020 + 0x1c + param_1);
    do {
      if ((*(longlong *)(psVar2 + -0xe) == 0) && (*(longlong *)(psVar2 + -10) == 0)) {
        bVar1 = false;
      }
      else {
        bVar1 = true;
      }
      if (((bVar1) || (*(int *)(psVar2 + -2) != 0)) || (0 < *psVar2)) {
        FUN_14008e650(param_3,((longlong)iVar3 + (longlong)param_2 * 0x18) * 0xac + param_1);
      }
      iVar3 = iVar3 + 1;
      psVar2 = psVar2 + 0x56;
    } while (iVar3 < (int)(uint)*(byte *)(param_1 + 0x2041));
  }
  return;
}



int FUN_1401f7110(longlong param_1)

{
  int *piVar1;
  bool bVar2;
  longlong lVar3;
  short *psVar4;
  int iVar5;
  ulonglong uVar6;
  int iVar7;
  
  iVar5 = 0;
  lVar3 = FUN_140137690();
  if (*(longlong *)(lVar3 + 0x88) != 0) {
    for (piVar1 = *(int **)(*(longlong *)(lVar3 + 0x88) +
                           (0U % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8); piVar1 != (int *)0x0;
        piVar1 = *(int **)(piVar1 + 0xa6)) {
      if ((piVar1[0xa8] == 0) && (*piVar1 == 0)) {
        if (piVar1 != (int *)0x0) {
          iVar7 = piVar1[0x4c];
          goto LAB_1401f7178;
        }
        break;
      }
    }
  }
  iVar7 = 1;
LAB_1401f7178:
  if (*(byte *)(param_1 + 0x2041) != 0) {
    psVar4 = (short *)(param_1 + 0x103c);
    uVar6 = (ulonglong)*(byte *)(param_1 + 0x2041);
    do {
      if ((*(longlong *)(psVar4 + -0xe) == 0) && (*(longlong *)(psVar4 + -10) == 0)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
      if ((((!bVar2) && (*(int *)(psVar4 + -2) == 0)) && (*psVar4 < 1)) ||
         (*(int *)(psVar4 + -2) == 0)) {
        if ((*(longlong *)(psVar4 + -0xe) == 0) && (*(longlong *)(psVar4 + -10) == 0)) {
          bVar2 = false;
        }
        else {
          bVar2 = true;
        }
        if (((!bVar2) && (*psVar4 < 1)) || (*psVar4 + 1 <= iVar7)) {
          iVar5 = iVar5 + 1;
        }
      }
      psVar4 = psVar4 + 0x56;
      uVar6 = uVar6 - 1;
    } while (uVar6 != 0);
  }
  return iVar5;
}



undefined8
FUN_1401f7220(longlong param_1,longlong param_2,uint param_3,int *param_4,uint param_5,int *param_6,
             undefined4 param_7,int *param_8)

{
  int *piVar1;
  longlong *plVar2;
  void *pvVar3;
  undefined8 *puVar4;
  uint uVar5;
  char cVar6;
  int iVar7;
  uint uVar8;
  longlong lVar9;
  longlong *plVar10;
  undefined4 *puVar11;
  undefined8 uVar12;
  undefined2 *puVar13;
  longlong lVar14;
  longlong *plVar15;
  longlong *plVar16;
  undefined2 uVar17;
  int *piVar18;
  bool bVar19;
  uint local_res18 [2];
  short *psVar20;
  undefined4 uVar21;
  undefined4 *puVar22;
  undefined8 uVar23;
  undefined4 uVar24;
  undefined8 in_stack_fffffffffffffcd8;
  undefined4 uVar26;
  undefined8 uVar25;
  undefined4 uVar27;
  undefined8 *local_318;
  undefined8 *local_310;
  undefined2 local_308;
  undefined2 local_306;
  undefined2 local_304;
  undefined2 local_302;
  undefined2 local_300;
  undefined2 local_2fe;
  undefined2 local_2fc;
  undefined2 local_2fa;
  undefined4 local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  undefined4 local_2ec;
  undefined4 local_2e8;
  int local_2e4;
  undefined4 local_2e0 [2];
  int local_2d8 [2];
  undefined4 local_2d0 [2];
  longlong *local_2c8;
  longlong *local_2c0;
  undefined4 local_2b8;
  undefined4 local_2b4;
  undefined4 local_2b0;
  undefined4 local_2ac;
  undefined4 local_2a8;
  undefined4 local_2a4;
  undefined4 local_2a0;
  undefined4 local_29c;
  undefined4 local_298;
  undefined4 local_294;
  undefined4 local_290;
  undefined4 local_28c;
  undefined4 local_288;
  undefined4 local_284;
  undefined4 local_280;
  undefined4 local_27c;
  undefined4 local_278;
  undefined4 local_274;
  undefined4 local_270;
  undefined4 local_26c;
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined8 local_258;
  longlong local_248;
  longlong local_240;
  short local_234;
  short local_232;
  int local_230;
  short local_22c;
  undefined4 local_1a0;
  undefined4 local_198;
  undefined4 uStack_194;
  undefined4 uStack_190;
  undefined4 uStack_18c;
  undefined2 local_184;
  undefined2 local_182;
  int local_180;
  short local_17c;
  undefined4 local_f0;
  undefined1 local_e8 [24];
  int local_d0;
  short local_cc;
  undefined4 local_40;
  undefined1 local_38 [16];
  
  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20);
  puVar22 = &local_268;
  local_258 = 0xfffffffffffffffe;
  if (1 < param_3) {
    return 0;
  }
  iVar7 = *param_4;
  if (iVar7 < 0) {
    return 0;
  }
  if (0x17 < iVar7) {
    return 0;
  }
  if (((int)(uint)*(byte *)(param_1 + 0x2041) <= iVar7) && (param_3 == 1)) {
    return 0;
  }
  local_res18[0] = param_3;
  FUN_140197b70(param_2,&local_318);
  lVar9 = FUN_140174f00(&local_318);
  if (lVar9 == 0) {
    if (local_318 != (undefined8 *)0x0) {
      if (local_318 == local_310) {
        LOCK();
        piVar1 = (int *)(local_318 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          pvVar3 = (void *)*local_318;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_318);
        }
      }
      else {
        iVar7 = DAT_140608050 + 1;
        bVar19 = DAT_140608050 == 0;
        DAT_140608050 = iVar7;
        if (bVar19) {
          FUN_140176d60(1);
        }
      }
    }
    return 1;
  }
  FUN_140198570(param_2,&local_2c8);
  plVar2 = local_2c8;
  if (local_2c8 == (longlong *)0x0) {
LAB_1401f7c06:
    if (plVar2 != (longlong *)0x0) {
      if (plVar2 == local_2c0) {
        LOCK();
        plVar2 = plVar2 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          puVar4 = (undefined8 *)*local_2c8;
          if (puVar4 != (undefined8 *)0x0) {
            (**(code **)*puVar4)(puVar4,1);
          }
          operator_delete(local_2c8);
        }
      }
      else {
        iVar7 = DAT_140608054 + 1;
        bVar19 = DAT_140608054 == 0;
        DAT_140608054 = iVar7;
        if (bVar19) {
          FUN_140176d60(1);
        }
      }
    }
  }
  else {
    if (local_2c8 != local_2c0) {
      iVar7 = DAT_14060804c + 1;
      bVar19 = DAT_14060804c == 0;
      DAT_14060804c = iVar7;
      if (bVar19) {
        FUN_140176d60(1);
      }
      goto LAB_1401f7c06;
    }
    if (*local_2c8 == 0) goto LAB_1401f7c06;
    local_2f8 = 0;
    local_2f4 = 0;
    local_2f0 = 0;
    local_2ec = 0;
    plVar10 = (longlong *)FUN_140208860(*local_2c8,param_7);
    if (plVar10 != (longlong *)0x0) {
      puVar11 = (undefined4 *)(**(code **)(*plVar10 + 0x280))(plVar10);
      local_2f8 = *puVar11;
      local_2f4 = puVar11[1];
      local_2f0 = puVar11[2];
      local_2ec = puVar11[3];
    }
    FUN_14000a170(&local_248);
    local_1a0 = 0;
    FUN_14000a170(local_e8);
    local_40 = 0;
    FUN_14000a170(&local_198);
    local_f0 = 0;
    if ((*param_4 < 0) ||
       (cVar6 = FUN_1401f6eb0(param_1,local_res18[0],*param_4,local_e8), cVar6 == '\0')) {
      LOCK();
      plVar2 = plVar2 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        puVar4 = (undefined8 *)*local_2c8;
        if (puVar4 != (undefined8 *)0x0) {
          (**(code **)*puVar4)(puVar4,1);
        }
        operator_delete(local_2c8);
      }
LAB_1401f746e:
      if (local_318 == (undefined8 *)0x0) {
        return 0;
      }
      if (local_318 != local_310) goto LAB_1401f7487;
      goto LAB_1401f7c68;
    }
    uVar12 = FUN_140137690();
    uVar8 = FUN_140136b30(uVar12,local_d0);
    piVar1 = param_8;
    uVar5 = param_5;
    lVar9 = (longlong)(int)param_5;
    if (uVar8 != param_5) {
      LOCK();
      plVar2 = plVar2 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        puVar4 = (undefined8 *)*local_2c8;
        if (puVar4 != (undefined8 *)0x0) {
          (**(code **)*puVar4)(puVar4,1);
        }
        operator_delete(local_2c8);
      }
      goto LAB_1401f746e;
    }
    uVar17 = (undefined2)param_5;
    local_184 = uVar17;
    if (*param_8 < (int)local_cc) {
      FUN_140090020(&local_198,local_e8);
      puVar11 = (undefined4 *)FUN_140357570(local_38);
      piVar18 = param_6;
      local_198 = *puVar11;
      uStack_194 = puVar11[1];
      uStack_190 = puVar11[2];
      uStack_18c = puVar11[3];
      local_17c = (short)*piVar1;
      local_182 = (undefined2)*param_6;
      psVar20 = (short *)(((longlong)*param_4 + (longlong)(int)local_res18[0] * 0x18) * 0xac + 0x1c
                         + param_1);
      *psVar20 = *psVar20 - local_17c;
      local_cc = local_cc - (short)*piVar1;
      local_298 = *(undefined4 *)(param_2 + 0x160);
      local_294 = *(undefined4 *)(param_2 + 0x164);
      local_290 = *(undefined4 *)(param_2 + 0x168);
      local_28c = *(undefined4 *)(param_2 + 0x16c);
      local_2b8 = *(undefined4 *)(param_2 + 0x170);
      local_2b4 = *(undefined4 *)(param_2 + 0x174);
      local_2b0 = *(undefined4 *)(param_2 + 0x178);
      local_2ac = *(undefined4 *)(param_2 + 0x17c);
      iVar7 = *(int *)(param_2 + 0x284);
      if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar14 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar14 != 0)) {
        local_2fc = (undefined2)iVar7;
        plVar10 = (longlong *)
                  (*(longlong *)
                    (*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
        (**(code **)(*plVar10 + 0xc00))
                  (plVar10,1,&DAT_1405d85a0,&local_2fc,&local_2b8,&local_298,
                   ((longlong)*param_4 + (longlong)(int)local_res18[0] * 0x18) * 0xac + param_1);
      }
      local_2fa = (undefined2)*param_4;
      lVar14 = (longlong)*param_4 + (longlong)(int)local_res18[0] * 0x18;
      puVar13 = &local_2fa;
    }
    else {
      FUN_140090020(&local_198,local_e8);
      piVar18 = param_6;
      local_182 = (undefined2)*param_6;
      FUN_140090020(((longlong)*param_4 + (longlong)(int)local_res18[0] * 0x18) * 0xac + param_1,
                    &local_248);
      iVar7 = *(int *)(param_2 + 0x284);
      local_2e0[0] = *(undefined4 *)(param_2 + 8);
      if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar14 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar14 != 0)) {
        local_2fe = (undefined2)iVar7;
        plVar10 = (longlong *)
                  (*(longlong *)
                    (*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
        (**(code **)(*plVar10 + 0xbb0))
                  (plVar10,1,&DAT_1405d85a0,&local_2fe,local_2e0,&local_2f8,local_e8);
      }
      local_302 = (undefined2)*param_4;
      lVar14 = (longlong)*param_4 + (longlong)(int)local_res18[0] * 0x18;
      puVar13 = &local_302;
    }
    param_1 = lVar14 * 0xac + param_1;
    puVar11 = &param_7;
    plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar10 + 0xa70))
              (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,&local_2f8,puVar11,
               puVar13,param_1);
    uVar25 = CONCAT44(uVar26,*param_4);
    uVar23 = CONCAT44((int)((ulonglong)param_1 >> 0x20),local_res18[0]);
    plVar10 = (longlong *)((ulonglong)puVar13 & 0xffffffff00000000);
    uVar12 = CONCAT44((int)((ulonglong)puVar11 >> 0x20),*piVar1);
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c9,0x2a,param_2,local_e8,uVar12,plVar10,uVar23
                  ,uVar25);
    uVar24 = (undefined4)((ulonglong)uVar23 >> 0x20);
    uVar27 = (undefined4)((ulonglong)uVar25 >> 0x20);
    uVar26 = (undefined4)((ulonglong)uVar12 >> 0x20);
    lVar14 = FUN_140174f00(&local_318);
    if (uVar5 < 5) {
      iVar7 = *piVar18;
      if ((-1 < iVar7) && (iVar7 < 0x18)) {
        lVar9 = lVar9 * 0x18;
        *(undefined2 *)((lVar9 + iVar7) * 0xac + 0x14 + lVar14) = uVar17;
        *(short *)((*piVar18 + lVar9) * 0xac + 0x16 + lVar14) = (short)*piVar18;
        FUN_140090020(&local_248,(*piVar18 + lVar9) * 0xac + lVar14);
      }
    }
    if ((local_248 == 0) && (local_240 == 0)) {
      bVar19 = false;
    }
    else {
      bVar19 = true;
    }
    if (((bVar19) || (local_230 != 0)) || (0 < local_22c)) {
      uVar12 = FUN_140137690();
      iVar7 = FUN_140136a70(uVar12,local_230);
      if (((local_d0 == local_230) && (1 < iVar7)) && ((int)local_22c + *piVar1 <= iVar7)) {
        local_22c = local_22c + (short)*piVar1;
        plVar16 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        plVar15 = &local_248;
        psVar20 = &local_232;
        (**(code **)(*plVar16 + 0xe0))
                  (plVar16,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_234,psVar20,plVar15);
        uVar26 = (undefined4)((ulonglong)plVar15 >> 0x20);
        uVar21 = (undefined4)((ulonglong)psVar20 >> 0x20);
        local_268 = *(undefined4 *)(param_2 + 0x160);
        local_264 = *(undefined4 *)(param_2 + 0x164);
        local_260 = *(undefined4 *)(param_2 + 0x168);
        local_25c = *(undefined4 *)(param_2 + 0x16c);
        local_278 = *(undefined4 *)(param_2 + 0x170);
        local_274 = *(undefined4 *)(param_2 + 0x174);
        local_270 = *(undefined4 *)(param_2 + 0x178);
        local_26c = *(undefined4 *)(param_2 + 0x17c);
        iVar7 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
          local_300 = (undefined2)iVar7;
          plVar15 = (longlong *)
                    (*(longlong *)
                      (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          plVar10 = &local_248;
          puVar11 = &local_278;
          (**(code **)(*plVar15 + 0x140))
                    (plVar15,1,&DAT_1405d85a0,&local_300,puVar11,puVar22,plVar10);
          uVar26 = (undefined4)((ulonglong)puVar22 >> 0x20);
          uVar21 = (undefined4)((ulonglong)puVar11 >> 0x20);
        }
        if (local_234 == 5) {
          local_2e8 = 5;
          uVar12 = FUN_140174f00(&local_318);
          FUN_1401ed120(uVar12,&local_2e8,&local_248);
        }
        else {
          local_2d8[0] = (int)local_232;
          local_2e4 = (int)local_234;
          uVar12 = FUN_140174f00(&local_318);
          if (-1 < local_234) {
            FUN_1401ed220(uVar12,&local_2e4,local_2d8,&local_248,CONCAT44(uVar21,6));
          }
        }
      }
    }
    else {
      uVar12 = FUN_140174f00(&local_318);
      FUN_1401e8cc0(uVar12,&param_5,piVar18,&local_198);
      local_2a8 = *(undefined4 *)(param_2 + 0x160);
      local_2a4 = *(undefined4 *)(param_2 + 0x164);
      local_2a0 = *(undefined4 *)(param_2 + 0x168);
      local_29c = *(undefined4 *)(param_2 + 0x16c);
      local_288 = *(undefined4 *)(param_2 + 0x170);
      local_284 = *(undefined4 *)(param_2 + 0x174);
      local_280 = *(undefined4 *)(param_2 + 0x178);
      local_27c = *(undefined4 *)(param_2 + 0x17c);
      iVar7 = *(int *)(param_2 + 0x284);
      local_2d0[0] = *(undefined4 *)(param_2 + 8);
      if ((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
        if ((CONCAT44(uStack_194,local_198) == 0) && (CONCAT44(uStack_18c,uStack_190) == 0)) {
          bVar19 = false;
        }
        else {
          bVar19 = true;
        }
        if (((bVar19) && (local_180 != 0)) &&
           (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
          local_308 = (undefined2)iVar7;
          plVar15 = (longlong *)
                    (*(longlong *)
                      (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar22 = &local_198;
          uVar24 = 1;
          plVar10 = (longlong *)&local_2a8;
          (**(code **)(*plVar15 + 0xb0))
                    (plVar15,1,&DAT_1405d85a0,&local_308,local_2d0,&local_288,plVar10,&DAT_14047b9fc
                     ,puVar22);
          uVar27 = (undefined4)((ulonglong)puVar22 >> 0x20);
        }
      }
      local_306 = (undefined2)*piVar18;
      plVar15 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      puVar22 = &local_198;
      local_304 = uVar17;
      (**(code **)(*plVar15 + 0xc0))
                (plVar15,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_304,&local_306,puVar22);
      uVar26 = (undefined4)((ulonglong)puVar22 >> 0x20);
    }
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c3,0xb,param_2,local_e8,
                  CONCAT44(uVar26,*piVar1),(ulonglong)plVar10 & 0xffffffff00000000,
                  CONCAT44(uVar24,uVar5),CONCAT44(uVar27,*piVar18));
    LOCK();
    plVar2 = plVar2 + 1;
    *(int *)plVar2 = (int)*plVar2 + -1;
    UNLOCK();
    if ((int)*plVar2 == 0) {
      puVar4 = (undefined8 *)*local_2c8;
      if (puVar4 != (undefined8 *)0x0) {
        (**(code **)*puVar4)(puVar4,1);
      }
      operator_delete(local_2c8);
    }
  }
  if (local_318 == (undefined8 *)0x0) {
    return 0;
  }
  if (local_318 != local_310) {
LAB_1401f7487:
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 0;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_1401f7c68:
  LOCK();
  piVar1 = (int *)(local_318 + 1);
  *piVar1 = *piVar1 + -1;
  UNLOCK();
  if (*piVar1 == 0) {
    pvVar3 = (void *)*local_318;
    if (pvVar3 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar3 + 0xf630);
      operator_delete(pvVar3);
    }
    operator_delete(local_318);
  }
  return 0;
}



// WARNING: Type propagation algorithm not settling

undefined8
FUN_1401f7cc0(longlong param_1,longlong param_2,int param_3,undefined4 param_4,undefined2 *param_5,
             int *param_6,int *param_7)

{
  int *piVar1;
  longlong *plVar2;
  short sVar3;
  void *pvVar4;
  undefined8 *puVar5;
  int iVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined4 *puVar9;
  undefined8 uVar10;
  short *psVar11;
  bool bVar12;
  int local_res18 [2];
  undefined4 local_res20 [2];
  undefined8 in_stack_fffffffffffffd68;
  undefined4 uVar16;
  short *psVar13;
  undefined4 uVar17;
  undefined2 *puVar14;
  undefined4 *puVar15;
  undefined1 *puVar18;
  undefined2 *puVar19;
  undefined4 uVar21;
  ulonglong uVar20;
  undefined4 uVar23;
  short **ppsVar22;
  undefined4 *in_stack_fffffffffffffd88;
  undefined8 *local_268;
  undefined8 *local_260;
  int local_258;
  undefined2 local_254;
  undefined2 local_252;
  undefined2 local_250;
  undefined2 local_24e;
  undefined2 local_24c;
  undefined2 local_24a;
  undefined2 local_248;
  undefined2 local_246;
  undefined2 local_244;
  undefined2 local_242;
  undefined2 local_240;
  undefined2 local_23e [3];
  undefined4 local_238;
  undefined4 local_234;
  undefined4 local_230;
  undefined4 local_22c;
  int local_228 [2];
  longlong *local_220;
  longlong *local_218;
  undefined4 local_210;
  int local_20c;
  int local_208 [2];
  undefined4 local_200 [2];
  undefined4 local_1f8 [2];
  short *local_1f0;
  int local_1e8 [2];
  undefined4 local_1e0 [2];
  undefined4 local_1d8 [2];
  undefined4 local_1d0 [2];
  int local_1c8 [3];
  undefined4 local_1bc;
  undefined4 local_1b8;
  undefined4 local_1b4;
  undefined4 local_1b0;
  undefined4 local_1ac;
  undefined4 local_1a8;
  undefined4 local_1a4;
  undefined4 local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  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;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined8 local_100;
  undefined1 local_f8 [16];
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar16 = (undefined4)((ulonglong)in_stack_fffffffffffffd68 >> 0x20);
  local_100 = 0xfffffffffffffffe;
  if (1 < param_3) {
    return 0;
  }
  iVar6 = *param_6;
  if (iVar6 < 0) {
    return 0;
  }
  if (0x17 < iVar6) {
    return 0;
  }
  if (((int)(uint)*(byte *)(param_1 + 0x2041) <= iVar6) && (param_3 == 1)) {
    return 0;
  }
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  FUN_140197b70(param_2,&local_268);
  lVar7 = FUN_140174f00(&local_268);
  if (lVar7 == 0) goto LAB_1401f7d51;
  FUN_140198570(param_2,&local_220);
  plVar2 = local_220;
  if (local_220 != (longlong *)0x0) {
    if (local_220 == local_218) {
      if (*local_220 != 0) {
        local_238 = 0;
        local_234 = 0;
        local_230 = 0;
        local_22c = 0;
        plVar8 = (longlong *)FUN_140208860(*local_220,local_res20[0]);
        if (plVar8 != (longlong *)0x0) {
          puVar9 = (undefined4 *)(**(code **)(*plVar8 + 0x280))(plVar8);
          local_238 = *puVar9;
          local_234 = puVar9[1];
          local_230 = puVar9[2];
          local_22c = puVar9[3];
        }
        FUN_14000a170(local_e8);
        local_40 = 0;
        iVar6 = FUN_14011b180(((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac +
                              param_1);
        uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffd88 >> 0x20);
        if (iVar6 != 0) {
          FUN_140090020();
          *(short *)(((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + 0x14 + param_1)
               = (short)local_res18[0];
          *(short *)(((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + 0x16 + param_1)
               = (short)*param_6;
          sVar3 = param_5[0xe];
          if ((int)sVar3 == *param_7) {
            param_5[0xe] = sVar3 - (short)*param_7;
            local_1c8[2] = *(undefined4 *)(param_2 + 0x160);
            local_1bc = *(undefined4 *)(param_2 + 0x164);
            local_1b8 = *(undefined4 *)(param_2 + 0x168);
            local_1b4 = *(undefined4 *)(param_2 + 0x16c);
            iVar6 = *(int *)(param_2 + 0x284);
            puVar9 = (undefined4 *)
                     (((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1);
            local_1d8[0] = *(undefined4 *)(param_2 + 8);
            if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)) {
              local_23e[0] = (undefined2)iVar6;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              puVar15 = local_1d8;
              (**(code **)(*plVar8 + 0xb80))
                        (plVar8,1,&DAT_1405d85a0,local_23e,puVar15,&local_238,local_1c8 + 2,
                         &DAT_14047b9f8,puVar9);
              uVar16 = (undefined4)((ulonglong)puVar15 >> 0x20);
              in_stack_fffffffffffffd88 = puVar9;
            }
            local_190 = *(undefined4 *)(param_2 + 0x160);
            local_18c = *(undefined4 *)(param_2 + 0x164);
            local_188 = *(undefined4 *)(param_2 + 0x168);
            local_184 = *(undefined4 *)(param_2 + 0x16c);
            local_130 = *(undefined4 *)(param_2 + 0x170);
            local_12c = *(undefined4 *)(param_2 + 0x174);
            local_128 = *(undefined4 *)(param_2 + 0x178);
            local_124 = *(undefined4 *)(param_2 + 0x17c);
            iVar6 = *(int *)(param_2 + 0x284);
            local_1e0[0] = 0xffffffff;
            local_1d0[0] = 0xffffffe4;
            if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)) {
              local_248 = (undefined2)iVar6;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              in_stack_fffffffffffffd88 = local_1e0;
              puVar9 = &local_130;
              (**(code **)(*plVar8 + 0x130))
                        (plVar8,1,&DAT_1405d85a0,&local_248,puVar9,&local_190,param_5,local_1d0,
                         in_stack_fffffffffffffd88);
              uVar16 = (undefined4)((ulonglong)puVar9 >> 0x20);
            }
            local_1f0 = param_5 + 10;
            sVar3 = *local_1f0;
            if (sVar3 == 5) {
              local_1c8[1] = 5;
              uVar10 = FUN_140174f00(&local_268);
              FUN_1401ed120(uVar10,local_1c8 + 1,local_e8);
            }
            else {
              local_208[0] = (int)(short)param_5[0xb];
              local_1c8[0] = (int)sVar3;
              uVar10 = FUN_140174f00(&local_268);
              if (-1 < sVar3) {
                FUN_1401ed220(uVar10,local_1c8,local_208,local_e8,CONCAT44(uVar16,6));
              }
            }
            local_240 = (undefined2)*param_6;
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            lVar7 = ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1;
            puVar14 = &local_240;
            (**(code **)(*plVar8 + 0xa70))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,&local_238,
                       local_res20,puVar14,lVar7);
            uVar21 = (undefined4)((ulonglong)puVar14 >> 0x20);
            uVar23 = (undefined4)((ulonglong)lVar7 >> 0x20);
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            psVar11 = param_5 + 0xb;
            puVar18 = local_e8;
            psVar13 = psVar11;
            (**(code **)(*plVar8 + 0xe0))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_1f0,psVar11,puVar18)
            ;
            uVar17 = (undefined4)((ulonglong)psVar13 >> 0x20);
            lVar7 = FUN_140174f00(&local_268);
            uVar16 = *(undefined4 *)(lVar7 + 0x50a0);
            lVar7 = FUN_140174f00(&local_268);
            uVar20 = CONCAT44(uVar21,*(undefined4 *)(lVar7 + 0x50a0));
            FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,
                          ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1,
                          400,CONCAT44(uVar17,10),(ulonglong)puVar18 & 0xffffffff00000000,uVar20,
                          CONCAT44(uVar23,uVar16),
                          (ulonglong)in_stack_fffffffffffffd88 & 0xffffffff00000000,0);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c6,0x29,param_2,
                          ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1,
                          *param_7,uVar20 & 0xffffffff00000000,(int)*psVar11,*param_6);
            LOCK();
            plVar2 = plVar2 + 1;
            *(int *)plVar2 = (int)*plVar2 + -1;
            UNLOCK();
            if ((int)*plVar2 == 0) {
              puVar5 = (undefined8 *)*local_220;
              if (puVar5 != (undefined8 *)0x0) {
                (**(code **)*puVar5)(puVar5,1);
              }
              operator_delete(local_220);
            }
          }
          else {
            param_5[0xe] = sVar3 - (short)*param_7;
            puVar9 = (undefined4 *)FUN_140357570(local_f8);
            lVar7 = ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac;
            *(undefined4 *)(lVar7 + param_1) = *puVar9;
            *(undefined4 *)(lVar7 + 4 + param_1) = puVar9[1];
            *(undefined4 *)(lVar7 + 8 + param_1) = puVar9[2];
            *(undefined4 *)(lVar7 + 0xc + param_1) = puVar9[3];
            *(short *)(((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + 0x1c +
                      param_1) = (short)*param_7;
            *(short *)(((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + 0x14 +
                      param_1) = (short)local_res18[0];
            *(short *)(((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + 0x16 +
                      param_1) = (short)*param_6;
            local_170 = *(undefined4 *)(param_2 + 0x160);
            local_16c = *(undefined4 *)(param_2 + 0x164);
            local_168 = *(undefined4 *)(param_2 + 0x168);
            local_164 = *(undefined4 *)(param_2 + 0x16c);
            iVar6 = *(int *)(param_2 + 0x284);
            puVar9 = (undefined4 *)
                     (((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1);
            local_1f8[0] = *(undefined4 *)(param_2 + 8);
            if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)) {
              local_246 = (undefined2)iVar6;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              puVar15 = local_1f8;
              (**(code **)(*plVar8 + 0xb80))
                        (plVar8,1,&DAT_1405d85a0,&local_246,puVar15,&local_238,&local_170,
                         &DAT_14047b9f8,puVar9);
              uVar16 = (undefined4)((ulonglong)puVar15 >> 0x20);
              in_stack_fffffffffffffd88 = puVar9;
            }
            local_110 = *(undefined4 *)(param_2 + 0x160);
            local_10c = *(undefined4 *)(param_2 + 0x164);
            local_108 = *(undefined4 *)(param_2 + 0x168);
            local_104 = *(undefined4 *)(param_2 + 0x16c);
            local_150 = *(undefined4 *)(param_2 + 0x170);
            local_14c = *(undefined4 *)(param_2 + 0x174);
            local_148 = *(undefined4 *)(param_2 + 0x178);
            local_144 = *(undefined4 *)(param_2 + 0x17c);
            iVar6 = *(int *)(param_2 + 0x284);
            if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)) {
              local_24e = (undefined2)iVar6;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              puVar9 = &local_150;
              (**(code **)(*plVar8 + 0x140))
                        (plVar8,1,&DAT_1405d85a0,&local_24e,puVar9,&local_110,param_5);
              uVar16 = (undefined4)((ulonglong)puVar9 >> 0x20);
            }
            sVar3 = param_5[10];
            if (sVar3 == 5) {
              local_210 = 5;
              uVar10 = FUN_140174f00(&local_268);
              FUN_1401ed120(uVar10,&local_210,param_5);
            }
            else {
              local_1e8[0] = (int)(short)param_5[0xb];
              local_20c = (int)sVar3;
              uVar10 = FUN_140174f00(&local_268);
              if (-1 < sVar3) {
                FUN_1401ed220(uVar10,&local_20c,local_1e8,param_5,CONCAT44(uVar16,6));
              }
            }
            local_242 = (undefined2)*param_6;
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            lVar7 = ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1;
            puVar14 = &local_242;
            (**(code **)(*plVar8 + 0xa70))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,&local_238,
                       local_res20,puVar14,lVar7);
            uVar17 = (undefined4)((ulonglong)puVar14 >> 0x20);
            uVar21 = (undefined4)((ulonglong)lVar7 >> 0x20);
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            puVar14 = param_5 + 0xb;
            puVar19 = param_5;
            (**(code **)(*plVar8 + 0xe0))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,param_5 + 10,puVar14,
                       param_5);
            uVar16 = (undefined4)((ulonglong)puVar14 >> 0x20);
            if (*plVar2 != 0) {
              lVar7 = FUN_140174f00(&local_268);
              uVar23 = *(undefined4 *)(lVar7 + 0x50a0);
              lVar7 = FUN_140174f00(&local_268);
              uVar20 = CONCAT44(uVar17,*(undefined4 *)(lVar7 + 0x50a0));
              FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,
                            ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1,
                            400,CONCAT44(uVar16,10),(ulonglong)puVar19 & 0xffffffff00000000,uVar20,
                            CONCAT44(uVar21,uVar23),
                            (ulonglong)in_stack_fffffffffffffd88 & 0xffffffff00000000,0);
              FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c6,0x29,param_2,
                            ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1,
                            *param_7,uVar20 & 0xffffffff00000000,(int)(short)param_5[0xb],*param_6);
            }
            LOCK();
            plVar2 = plVar2 + 1;
            *(int *)plVar2 = (int)*plVar2 + -1;
            UNLOCK();
            if ((int)*plVar2 == 0) {
              puVar5 = (undefined8 *)*local_220;
              if (puVar5 != (undefined8 *)0x0) {
                (**(code **)*puVar5)(puVar5,1);
              }
              operator_delete(local_220);
            }
          }
LAB_1401f7d51:
          if (local_268 != (undefined8 *)0x0) {
            if (local_268 == local_260) {
              LOCK();
              piVar1 = (int *)(local_268 + 1);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                pvVar4 = (void *)*local_268;
                if (pvVar4 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar4 + 0xf630);
                  operator_delete(pvVar4);
                }
                operator_delete(local_268);
              }
            }
            else {
              iVar6 = DAT_140608050 + 1;
              bVar12 = DAT_140608050 == 0;
              DAT_140608050 = iVar6;
              if (bVar12) {
                FUN_140176d60(1);
              }
            }
          }
          return 1;
        }
        uVar10 = FUN_140137690();
        iVar6 = FUN_140136a70(uVar10,*(undefined4 *)(param_5 + 0xc));
        local_258 = (int)(short)param_5[10];
        local_228[0] = (int)(short)param_5[0xb];
        lVar7 = ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac;
        if ((*(int *)(lVar7 + 0x18 + param_1) == *(int *)(param_5 + 0xc)) && (1 < iVar6)) {
          if (iVar6 < (int)*(short *)(lVar7 + 0x1c + param_1) + *param_7) {
            LOCK();
            plVar2 = plVar2 + 1;
            *(int *)plVar2 = (int)*plVar2 + -1;
            UNLOCK();
            if ((int)*plVar2 == 0) {
              puVar5 = (undefined8 *)*local_220;
              if (puVar5 != (undefined8 *)0x0) {
                (**(code **)*puVar5)(puVar5,1);
              }
              operator_delete(local_220);
            }
          }
          else {
            psVar13 = (short *)(lVar7 + 0x1c + param_1);
            *psVar13 = *psVar13 + (short)*param_7;
            local_1b0 = *(undefined4 *)(param_2 + 0x160);
            local_1ac = *(undefined4 *)(param_2 + 0x164);
            local_1a8 = *(undefined4 *)(param_2 + 0x168);
            local_1a4 = *(undefined4 *)(param_2 + 0x16c);
            local_1a0 = *(undefined4 *)(param_2 + 0x170);
            local_19c = *(undefined4 *)(param_2 + 0x174);
            local_198 = *(undefined4 *)(param_2 + 0x178);
            local_194 = *(undefined4 *)(param_2 + 0x17c);
            iVar6 = *(int *)(param_2 + 0x284);
            if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)) {
              local_24a = (undefined2)iVar6;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              (**(code **)(*plVar8 + 0xc00))
                        (plVar8,1,&DAT_1405d85a0,&local_24a,&local_1a0,&local_1b0,
                         ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1);
            }
            local_244 = (undefined2)*param_6;
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            lVar7 = ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1;
            puVar14 = &local_244;
            puVar9 = &local_238;
            (**(code **)(*plVar8 + 0xa70))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,puVar9,
                       local_res20,puVar14,lVar7);
            uVar21 = (undefined4)((ulonglong)lVar7 >> 0x20);
            uVar16 = (undefined4)((ulonglong)puVar9 >> 0x20);
            sVar3 = param_5[0xe];
            if ((int)sVar3 == *param_7) {
              param_5[0xe] = sVar3 - (short)*param_7;
              local_180 = *(undefined4 *)(param_2 + 0x160);
              local_17c = *(undefined4 *)(param_2 + 0x164);
              local_178 = *(undefined4 *)(param_2 + 0x168);
              local_174 = *(undefined4 *)(param_2 + 0x16c);
              local_160 = *(undefined4 *)(param_2 + 0x170);
              local_15c = *(undefined4 *)(param_2 + 0x174);
              local_158 = *(undefined4 *)(param_2 + 0x178);
              local_154 = *(undefined4 *)(param_2 + 0x17c);
              iVar6 = *(int *)(param_2 + 0x284);
              local_200[0] = 0xffffffff;
              local_1f0 = (short *)CONCAT44(local_1f0._4_4_,0xffffffe4);
              if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)) {
                local_254 = (undefined2)iVar6;
                plVar8 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                puVar9 = local_200;
                ppsVar22 = &local_1f0;
                puVar15 = &local_160;
                puVar14 = param_5;
                (**(code **)(*plVar8 + 0x130))
                          (plVar8,1,&DAT_1405d85a0,&local_254,puVar15,&local_180,param_5,ppsVar22,
                           puVar9);
                uVar21 = (undefined4)((ulonglong)ppsVar22 >> 0x20);
                uVar17 = (undefined4)((ulonglong)puVar9 >> 0x20);
                uVar16 = (undefined4)((ulonglong)puVar15 >> 0x20);
              }
              FUN_140090020(param_5,local_e8);
            }
            else {
              param_5[0xe] = sVar3 - (short)*param_7;
              local_140 = *(undefined4 *)(param_2 + 0x160);
              local_13c = *(undefined4 *)(param_2 + 0x164);
              local_138 = *(undefined4 *)(param_2 + 0x168);
              local_134 = *(undefined4 *)(param_2 + 0x16c);
              local_120 = *(undefined4 *)(param_2 + 0x170);
              local_11c = *(undefined4 *)(param_2 + 0x174);
              local_118 = *(undefined4 *)(param_2 + 0x178);
              local_114 = *(undefined4 *)(param_2 + 0x17c);
              iVar6 = *(int *)(param_2 + 0x284);
              if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)) {
                local_252 = (undefined2)iVar6;
                plVar8 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                puVar9 = &local_120;
                puVar14 = param_5;
                (**(code **)(*plVar8 + 0x140))
                          (plVar8,1,&DAT_1405d85a0,&local_252,puVar9,&local_140,param_5);
                uVar16 = (undefined4)((ulonglong)puVar9 >> 0x20);
              }
            }
            if (param_5[10] == 5) {
              uVar10 = FUN_140174f00(&local_268);
              FUN_1401ed120(uVar10,&local_258,param_5);
            }
            else {
              uVar10 = FUN_140174f00(&local_268);
              if (-1 < local_258) {
                FUN_1401ed220(uVar10,&local_258,local_228,param_5,CONCAT44(uVar16,6));
              }
            }
            local_250 = (undefined2)local_228[0];
            local_24c = (undefined2)local_258;
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            (**(code **)(*plVar8 + 0xe0))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_24c,&local_250,
                       param_5);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c6,0x29,param_2,
                          ((longlong)*param_6 + (longlong)local_res18[0] * 0x18) * 0xac + param_1,
                          *param_7,(ulonglong)puVar14 & 0xffffffff00000000,
                          CONCAT44(uVar21,(int)(short)param_5[0xb]),CONCAT44(uVar17,*param_6));
            LOCK();
            plVar2 = plVar2 + 1;
            *(int *)plVar2 = (int)*plVar2 + -1;
            UNLOCK();
            if ((int)*plVar2 == 0) {
              puVar5 = (undefined8 *)*local_220;
              if (puVar5 != (undefined8 *)0x0) {
                (**(code **)*puVar5)(puVar5,1);
              }
              operator_delete(local_220);
            }
          }
          goto LAB_1401f7d51;
        }
        LOCK();
        plVar2 = plVar2 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          puVar5 = (undefined8 *)*local_220;
          if (puVar5 != (undefined8 *)0x0) {
            (**(code **)*puVar5)(puVar5,1);
          }
          operator_delete(local_220);
        }
        if (local_268 == (undefined8 *)0x0) {
          return 0;
        }
        if (local_268 != local_260) goto LAB_1401f8c33;
        goto LAB_1401f8cba;
      }
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == local_218) {
      LOCK();
      plVar2 = plVar2 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        puVar5 = (undefined8 *)*local_220;
        if (puVar5 != (undefined8 *)0x0) {
          (**(code **)*puVar5)(puVar5,1);
        }
        operator_delete(local_220);
      }
    }
    else {
      iVar6 = DAT_140608054 + 1;
      bVar12 = DAT_140608054 == 0;
      DAT_140608054 = iVar6;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_268 == (undefined8 *)0x0) {
    return 0;
  }
  if (local_268 != local_260) {
LAB_1401f8c33:
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 0;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_1401f8cba:
  LOCK();
  piVar1 = (int *)(local_268 + 1);
  *piVar1 = *piVar1 + -1;
  UNLOCK();
  if (*piVar1 == 0) {
    pvVar4 = (void *)*local_268;
    if (pvVar4 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar4 + 0xf630);
      operator_delete(pvVar4);
    }
    operator_delete(local_268);
  }
  return 0;
}



undefined8
FUN_1401f8d10(longlong param_1,longlong param_2,undefined4 param_3,uint param_4,uint param_5,
             int param_6)

{
  longlong *plVar1;
  short *psVar2;
  undefined8 *puVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  undefined2 uVar9;
  longlong lVar10;
  undefined2 uVar11;
  longlong lVar12;
  bool bVar13;
  undefined4 local_res18 [2];
  int local_res20 [2];
  undefined2 *puVar14;
  ulonglong uVar15;
  int local_328 [2];
  undefined4 local_320;
  undefined4 uStack_31c;
  undefined4 local_318;
  undefined4 uStack_314;
  undefined2 local_310;
  undefined2 local_30e;
  undefined2 local_30c;
  undefined2 local_30a;
  undefined2 local_308;
  undefined2 local_306;
  undefined2 local_304;
  undefined2 local_302;
  undefined2 local_300;
  undefined2 local_2fe;
  undefined2 local_2fc;
  undefined2 local_2fa;
  undefined2 local_2f8;
  undefined2 local_2f6;
  undefined2 local_2f4 [2];
  longlong local_2f0;
  longlong *local_2e8;
  longlong *local_2e0;
  undefined4 local_2d8;
  undefined4 local_2d4;
  undefined4 local_2d0;
  undefined4 local_2cc;
  undefined4 local_2c8;
  undefined4 local_2c4;
  undefined4 local_2c0;
  undefined4 local_2bc;
  undefined4 local_2b8;
  undefined4 local_2b4;
  undefined4 local_2b0;
  undefined4 local_2ac;
  undefined4 local_2a8;
  undefined4 local_2a4;
  undefined4 local_2a0;
  undefined4 local_29c;
  undefined4 local_298;
  undefined4 local_294;
  undefined4 local_290;
  undefined4 local_28c;
  undefined4 local_288;
  undefined4 local_284;
  undefined4 local_280;
  undefined4 local_27c;
  undefined4 local_278;
  undefined4 local_274;
  undefined4 local_270;
  undefined4 local_26c;
  undefined4 local_268;
  undefined4 local_264;
  undefined4 local_260;
  undefined4 local_25c;
  undefined8 local_258;
  undefined1 local_248 [168];
  undefined4 local_1a0;
  undefined1 local_198 [168];
  undefined4 local_f0;
  undefined1 local_ec [168];
  undefined4 local_44;
  
  local_258 = 0xfffffffffffffffe;
  lVar12 = (longlong)(int)param_4;
  local_328[0] = 1;
  if (0x17 < param_4) {
    return 0;
  }
  lVar10 = (longlong)(int)param_5;
  if (0x17 < param_5) {
    return 0;
  }
  if ((int)(uint)*(byte *)(param_1 + 0x2041) <= (int)param_4) {
    return 0;
  }
  if ((int)(uint)*(byte *)(param_1 + 0x2041) <= (int)param_5) {
    return 0;
  }
  if (param_4 == param_5) {
    return 0;
  }
  local_res18[0] = param_3;
  FUN_140198570(param_2,&local_2e8);
  plVar1 = local_2e8;
  if (local_2e8 != (longlong *)0x0) {
    if (local_2e8 == local_2e0) {
      if (*local_2e8 != 0) {
        plVar5 = (longlong *)FUN_140208860(*local_2e8,local_res18[0]);
        if ((plVar5 != (longlong *)0x0) &&
           (lVar6 = (**(code **)(*plVar5 + 0x280))(plVar5), lVar6 != 0)) {
          plVar5 = (longlong *)(**(code **)(*plVar5 + 0x280))(plVar5);
          local_320 = (undefined4)*plVar5;
          uStack_31c = *(undefined4 *)((longlong)plVar5 + 4);
          local_318 = (undefined4)plVar5[1];
          uStack_314 = *(undefined4 *)((longlong)plVar5 + 0xc);
          if ((*plVar5 == 0) && (plVar5[1] == 0)) {
            bVar13 = false;
          }
          else {
            bVar13 = true;
          }
          if (bVar13) {
            lVar6 = (longlong)local_328[0] * 3;
            iVar4 = FUN_14011b180((lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
            uVar11 = (undefined2)param_4;
            uVar9 = (undefined2)param_5;
            if (iVar4 == 0) {
              uVar7 = FUN_140137690();
              iVar4 = FUN_140136a70(uVar7,*(undefined4 *)
                                           ((lVar12 + lVar6 * 8) * 0xac + 0x18 + param_1));
              local_2f0 = (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1;
              lVar6 = (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1;
              if ((*(int *)(lVar6 + 0x18) == *(int *)(local_2f0 + 0x18)) && (1 < iVar4)) {
                if (*(short *)(lVar6 + 0x1c) < iVar4) {
                  if (iVar4 < *(short *)(lVar6 + 0x1c) + param_6) {
                    local_res20[0] = iVar4 - *(short *)(lVar6 + 0x1c);
                    *(short *)(lVar6 + 0x1c) = *(short *)(lVar6 + 0x1c) + (short)local_res20[0];
                    local_2d8 = *(undefined4 *)(param_2 + 0x160);
                    local_2d4 = *(undefined4 *)(param_2 + 0x164);
                    local_2d0 = *(undefined4 *)(param_2 + 0x168);
                    local_2cc = *(undefined4 *)(param_2 + 0x16c);
                    iVar4 = *(int *)(param_2 + 0x284);
                    if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                       && (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0
                          )) {
                      local_2f6 = (undefined2)iVar4;
                      plVar5 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8
                                 ) + 0x70);
                      (**(code **)(*plVar5 + 0xc00))
                                (plVar5,1,&DAT_1405d85a0,&local_2f6,&local_320,&local_2d8,
                                 (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                    }
                    local_302 = uVar9;
                    (**(code **)(*(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78) + 0xa70))
                              (*(longlong *)(param_2 + 0xb50) + 0x78,*(undefined4 *)(param_2 + 8),
                               &DAT_1405d85a0,&DAT_14047ba00,&local_320,local_res18,&local_302,
                               (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                    psVar2 = (short *)((lVar12 + (longlong)local_328[0] * 0x18) * 0xac + 0x1c +
                                      param_1);
                    *psVar2 = *psVar2 - (short)local_res20[0];
                    local_2c8 = *(undefined4 *)(param_2 + 0x160);
                    local_2c4 = *(undefined4 *)(param_2 + 0x164);
                    local_2c0 = *(undefined4 *)(param_2 + 0x168);
                    local_2bc = *(undefined4 *)(param_2 + 0x16c);
                    iVar4 = *(int *)(param_2 + 0x284);
                    if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                       && (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0
                          )) {
                      local_30e = (undefined2)iVar4;
                      plVar5 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8
                                 ) + 0x70);
                      (**(code **)(*plVar5 + 0xc00))
                                (plVar5,1,&DAT_1405d85a0,&local_30e,&local_320,&local_2c8,
                                 (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                    }
                    plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                    puVar14 = &local_30c;
                    local_30c = uVar11;
                    (**(code **)(*plVar5 + 0xa70))
                              (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&DAT_14047ba00,
                               &local_320,local_res18,puVar14,
                               (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c6,0x2b,param_2,
                                  (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1,param_6,
                                  (ulonglong)puVar14 & 0xffffffff00000000,param_4,param_5);
                    LOCK();
                    plVar1 = plVar1 + 1;
                    lVar12 = *plVar1;
                    *(int *)plVar1 = (int)*plVar1 + -1;
                    UNLOCK();
                    if ((int)lVar12 != 1) {
                      return 1;
                    }
                    puVar3 = (undefined8 *)*local_2e8;
                    if (puVar3 != (undefined8 *)0x0) {
                      (**(code **)*puVar3)(puVar3,1);
                      operator_delete(local_2e8);
                      return 1;
                    }
                  }
                  else {
                    *(short *)(lVar6 + 0x1c) = *(short *)(lVar6 + 0x1c) + (short)param_6;
                    local_278 = *(undefined4 *)(param_2 + 0x160);
                    local_274 = *(undefined4 *)(param_2 + 0x164);
                    local_270 = *(undefined4 *)(param_2 + 0x168);
                    local_26c = *(undefined4 *)(param_2 + 0x16c);
                    iVar4 = *(int *)(param_2 + 0x284);
                    if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                       && (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0
                          )) {
                      local_2fa = (undefined2)iVar4;
                      plVar5 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8
                                 ) + 0x70);
                      (**(code **)(*plVar5 + 0xc00))
                                (plVar5,1,&DAT_1405d85a0,&local_2fa,&local_320,&local_278,
                                 (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                    }
                    local_2f4[0] = uVar9;
                    (**(code **)(*(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78) + 0xa70))
                              (*(longlong *)(param_2 + 0xb50) + 0x78,*(undefined4 *)(param_2 + 8),
                               &DAT_1405d85a0,&DAT_14047ba00,&local_320,local_res18,local_2f4,
                               (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                    puVar8 = (undefined4 *)
                             ((lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                    if (*(short *)(puVar8 + 7) == param_6) {
                      local_298 = *puVar8;
                      local_294 = puVar8[1];
                      local_290 = puVar8[2];
                      local_28c = puVar8[3];
                      FUN_14000a170(local_ec);
                      local_44 = 0;
                      FUN_140090020(puVar8,local_ec);
                      iVar4 = *(int *)(param_2 + 0x284);
                      local_2f0 = CONCAT44(local_2f0._4_4_,*(undefined4 *)(param_2 + 8));
                      if (((-1 < iVar4) &&
                          (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                         (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)
                         ) {
                        local_30a = (undefined2)iVar4;
                        plVar5 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar6 + 8) +
                                   (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        (**(code **)(*plVar5 + 0xbb0))
                                  (plVar5,1,&DAT_1405d85a0,&local_30a,&local_2f0,&local_320,
                                   &local_298);
                      }
                    }
                    else if (param_6 < *(short *)(puVar8 + 7)) {
                      *(short *)(puVar8 + 7) = *(short *)(puVar8 + 7) - (short)param_6;
                      local_268 = *(undefined4 *)(param_2 + 0x160);
                      local_264 = *(undefined4 *)(param_2 + 0x164);
                      local_260 = *(undefined4 *)(param_2 + 0x168);
                      local_25c = *(undefined4 *)(param_2 + 0x16c);
                      iVar4 = *(int *)(param_2 + 0x284);
                      if (((-1 < iVar4) &&
                          (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                         (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)
                         ) {
                        local_2fe = (undefined2)iVar4;
                        plVar5 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar6 + 8) +
                                   (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        (**(code **)(*plVar5 + 0xc00))
                                  (plVar5,1,&DAT_1405d85a0,&local_2fe,&local_320,&local_268,
                                   (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                      }
                    }
                    plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                    puVar14 = &local_306;
                    local_306 = uVar11;
                    (**(code **)(*plVar5 + 0xa70))
                              (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&DAT_14047ba00,
                               &local_320,local_res18,puVar14,
                               (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c6,0x2b,param_2,
                                  (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1,param_6,
                                  (ulonglong)puVar14 & 0xffffffff00000000,param_4,param_5);
                    LOCK();
                    plVar1 = plVar1 + 1;
                    lVar12 = *plVar1;
                    *(int *)plVar1 = (int)*plVar1 + -1;
                    UNLOCK();
                    if ((int)lVar12 != 1) {
                      return 1;
                    }
                    puVar3 = (undefined8 *)*local_2e8;
                    if (puVar3 != (undefined8 *)0x0) {
                      (**(code **)*puVar3)(puVar3,1);
                      operator_delete(local_2e8);
                      return 1;
                    }
                  }
                }
                else {
                  LOCK();
                  plVar1 = plVar1 + 1;
                  lVar12 = *plVar1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)lVar12 != 1) {
                    return 1;
                  }
                  puVar3 = (undefined8 *)*local_2e8;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                    operator_delete(local_2e8);
                    return 1;
                  }
                }
              }
              else {
                FUN_14000a170(local_248);
                local_1a0 = 0;
                FUN_140090020(local_248,lVar6);
                FUN_140090020(lVar6,local_2f0);
                *(undefined2 *)((lVar10 + (longlong)local_328[0] * 0x18) * 0xac + 0x16 + param_1) =
                     uVar9;
                FUN_140090020((lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1,local_248);
                *(undefined2 *)((lVar12 + (longlong)local_328[0] * 0x18) * 0xac + 0x16 + param_1) =
                     uVar11;
                local_2a8 = *(undefined4 *)(param_2 + 0x160);
                local_2a4 = *(undefined4 *)(param_2 + 0x164);
                local_2a0 = *(undefined4 *)(param_2 + 0x168);
                local_29c = *(undefined4 *)(param_2 + 0x16c);
                iVar4 = *(int *)(param_2 + 0x284);
                if ((-1 < iVar4) &&
                   ((iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700) &&
                    (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)))) {
                  local_308 = (undefined2)iVar4;
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar5 + 0xc00))
                            (plVar5,1,&DAT_1405d85a0,&local_308,&local_320,&local_2a8,
                             (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                }
                local_288 = *(undefined4 *)(param_2 + 0x160);
                local_284 = *(undefined4 *)(param_2 + 0x164);
                local_280 = *(undefined4 *)(param_2 + 0x168);
                local_27c = *(undefined4 *)(param_2 + 0x16c);
                iVar4 = *(int *)(param_2 + 0x284);
                if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)) {
                  local_304 = (undefined2)iVar4;
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar5 + 0xc00))
                            (plVar5,1,&DAT_1405d85a0,&local_304,&local_320,&local_288,
                             (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                }
                local_300 = uVar9;
                (**(code **)(*(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78) + 0xa70))
                          (*(longlong *)(param_2 + 0xb50) + 0x78,*(undefined4 *)(param_2 + 8),
                           &DAT_1405d85a0,&DAT_14047ba00,&local_320,local_res18,&local_300,
                           (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                puVar14 = &local_2fc;
                local_2fc = uVar11;
                (**(code **)(*plVar5 + 0xa70))
                          (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&DAT_14047ba00,
                           &local_320,local_res18,puVar14,
                           (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
                uVar15 = (ulonglong)puVar14 & 0xffffffff00000000;
                FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c6,0x2b,param_2,
                              (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1,param_6,
                              uVar15,param_5,param_4);
                FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c6,0x2b,param_2,
                              (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1,param_6,
                              uVar15 & 0xffffffff00000000,param_4,param_5);
                LOCK();
                plVar1 = plVar1 + 1;
                lVar12 = *plVar1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)lVar12 != 1) {
                  return 1;
                }
                puVar3 = (undefined8 *)*local_2e8;
                if (puVar3 != (undefined8 *)0x0) {
                  (**(code **)*puVar3)(puVar3,1);
                  operator_delete(local_2e8);
                  return 1;
                }
              }
            }
            else {
              FUN_140090020();
              *(short *)((lVar10 + (longlong)local_328[0] * 0x18) * 0xac + 0x14 + param_1) =
                   (short)local_328[0];
              *(undefined2 *)((lVar10 + (longlong)local_328[0] * 0x18) * 0xac + 0x16 + param_1) =
                   uVar9;
              local_2f0 = (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1;
              if (*(short *)(local_2f0 + 0x1c) != param_6) goto LAB_1401f9c4c;
              FUN_14000a170(local_198);
              local_f0 = 0;
              FUN_140090020(local_2f0,local_198);
              local_2b8 = *(undefined4 *)(param_2 + 0x160);
              local_2b4 = *(undefined4 *)(param_2 + 0x164);
              local_2b0 = *(undefined4 *)(param_2 + 0x168);
              local_2ac = *(undefined4 *)(param_2 + 0x16c);
              iVar4 = *(int *)(param_2 + 0x284);
              if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar6 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar6 != 0)) {
                local_res20[0] = CONCAT22(local_res20[0]._2_2_,(short)iVar4);
                plVar5 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar6 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                (**(code **)(*plVar5 + 0xc00))
                          (plVar5,1,&DAT_1405d85a0,local_res20,&local_320,&local_2b8,
                           (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
              }
              plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              local_310 = uVar11;
              (**(code **)(*plVar5 + 0xa70))
                        (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_328,&local_320,
                         local_res18,&local_310,
                         (lVar12 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
              plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              puVar14 = &local_2f8;
              local_2f8 = uVar9;
              (**(code **)(*plVar5 + 0xa70))
                        (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_328,&local_320,
                         local_res18,puVar14,
                         (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1);
              FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c6,0x2b,param_2,
                            (lVar10 + (longlong)local_328[0] * 0x18) * 0xac + param_1,param_6,
                            (ulonglong)puVar14 & 0xffffffff00000000,param_4,param_5);
              LOCK();
              plVar1 = plVar1 + 1;
              lVar12 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)lVar12 != 1) {
                return 1;
              }
              puVar3 = (undefined8 *)*local_2e8;
              if (puVar3 != (undefined8 *)0x0) {
                (**(code **)*puVar3)(puVar3,1);
              }
            }
            operator_delete(local_2e8);
            return 1;
          }
        }
        goto LAB_1401f9c4c;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar13 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return 0;
  }
  if (plVar1 != local_2e0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return 0;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_1401f9c4c:
  LOCK();
  plVar1 = plVar1 + 1;
  lVar12 = *plVar1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)lVar12 == 1) {
    puVar3 = (undefined8 *)*local_2e8;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_2e8);
  }
  return 0;
}



undefined8 FUN_1401f9ca0(longlong param_1,longlong param_2,int param_3,uint param_4)

{
  longlong lVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  undefined1 *puVar7;
  uint uVar8;
  undefined1 *puVar9;
  longlong *plVar10;
  undefined4 *puVar11;
  ulonglong uVar12;
  longlong lVar13;
  undefined1 *puVar14;
  ulonglong uVar15;
  int local_res8 [2];
  undefined2 local_res18 [4];
  uint local_res20;
  undefined8 in_stack_ffffffffffffff40;
  undefined4 uVar16;
  ulonglong in_stack_ffffffffffffff48;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  longlong local_70;
  undefined1 local_68;
  undefined1 *local_60;
  longlong local_58;
  undefined8 local_50;
  
  uVar16 = (undefined4)((ulonglong)in_stack_ffffffffffffff40 >> 0x20);
  lVar1 = param_1 + 0xf630;
  local_res20 = param_4;
  local_70 = lVar1;
  FUN_14034ed40(lVar1);
  local_68 = 1;
  if ((param_3 == 1) && (param_4 < 0x18)) {
    uVar15 = ((longlong)(int)param_4 + 0x18) * 0xac + param_1;
    iVar2 = FUN_14011b180(uVar15);
    if (iVar2 == 0) {
      uVar6 = FUN_140137690();
      iVar2 = FUN_140136e20(uVar6,*(undefined4 *)(uVar15 + 0x18));
      if (iVar2 != 0) {
        local_res8[0] = (int)*(short *)(uVar15 + 0x48);
        uVar8 = 0;
        lVar13 = (longlong)(int)param_4 * 0xac;
        puVar14 = (undefined1 *)(lVar13 + 0x1084 + param_1);
        puVar11 = (undefined4 *)(lVar13 + 0x1078 + param_1);
        puVar7 = puVar14;
        do {
          puVar11[-3] = 0;
          *puVar11 = 0;
          *puVar7 = 0;
          if ((short)uVar8 < *(short *)(uVar15 + 0x48)) {
            *puVar7 = 6;
          }
          uVar8 = uVar8 + 1;
          puVar11 = puVar11 + 1;
          puVar7 = puVar7 + 1;
        } while (uVar8 < 3);
        uVar6 = FUN_140137690();
        uVar3 = FUN_140136d80(uVar6,*(undefined4 *)(uVar15 + 0x18));
        uVar6 = FUN_140137690();
        uVar4 = FUN_140136dd0(uVar6,*(undefined4 *)(uVar15 + 0x18));
        uVar6 = FUN_140137690();
        uVar5 = FUN_140136a20(uVar6,*(undefined4 *)(uVar15 + 0x18));
        local_60 = (undefined1 *)0x0;
        local_58 = 0;
        local_50 = 0;
        uVar6 = FUN_140143d50();
        FUN_140143a70(uVar6,uVar4,uVar5,uVar3,&local_60);
        puVar7 = local_60;
        uVar8 = 0;
        uVar12 = local_58 - (longlong)local_60 >> 2;
        puVar9 = local_60;
        if (uVar12 != 0) {
          do {
            *puVar14 = *puVar9;
            uVar8 = uVar8 + 1;
            puVar14 = puVar14 + 1;
            puVar9 = puVar9 + 4;
          } while (uVar8 < uVar12);
        }
        if ((ulonglong)(longlong)*(short *)(uVar15 + 0x48) < uVar12) {
          *(short *)(uVar15 + 0x48) = (short)uVar12;
        }
        local_90 = *(undefined4 *)(param_2 + 0x160);
        local_8c = *(undefined4 *)(param_2 + 0x164);
        local_88 = *(undefined4 *)(param_2 + 0x168);
        local_84 = *(undefined4 *)(param_2 + 0x16c);
        local_80 = *(undefined4 *)(param_2 + 0x170);
        local_7c = *(undefined4 *)(param_2 + 0x174);
        local_78 = *(undefined4 *)(param_2 + 0x178);
        local_74 = *(undefined4 *)(param_2 + 0x17c);
        iVar2 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar13 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar13 != 0)) {
          local_res18[0] = (undefined2)iVar2;
          plVar10 = (longlong *)
                    (*(longlong *)
                      (*(longlong *)(lVar13 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar11 = &local_90;
          in_stack_ffffffffffffff48 = uVar15;
          (**(code **)(*plVar10 + 0x140))
                    (plVar10,1,&DAT_1405d85a0,local_res18,&local_80,puVar11,uVar15);
          uVar16 = (undefined4)((ulonglong)puVar11 >> 0x20);
        }
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1cb,0x55,param_2,uVar15,CONCAT44(uVar16,1),
                      in_stack_ffffffffffffff48 & 0xffffffff00000000,local_res8[0],
                      (int)*(short *)(uVar15 + 0x48));
        local_res18[0] = (undefined2)local_res20;
        local_res8[0] = CONCAT22(local_res8[0]._2_2_,1);
        plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar10 + 0xe0))
                  (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res8,local_res18,uVar15
                  );
        if (puVar7 != (undefined1 *)0x0) {
          operator_delete(puVar7);
        }
        FUN_14034edd0(lVar1);
        return 1;
      }
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001401fa092)

undefined8 FUN_1401f9fc0(longlong param_1,longlong param_2,int param_3,uint param_4)

{
  longlong lVar1;
  uint uVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined8 uVar8;
  uint *puVar9;
  int *piVar10;
  longlong *plVar11;
  int *piVar12;
  longlong lVar13;
  int iVar14;
  longlong lVar15;
  int local_res8 [2];
  longlong local_res10;
  uint local_res18 [2];
  uint local_res20;
  undefined8 in_stack_ffffffffffffff68;
  undefined4 uVar16;
  undefined8 in_stack_ffffffffffffff70;
  undefined4 uVar18;
  undefined8 uVar17;
  
  uVar16 = (undefined4)((ulonglong)in_stack_ffffffffffffff68 >> 0x20);
  uVar18 = (undefined4)((ulonglong)in_stack_ffffffffffffff70 >> 0x20);
  lVar1 = param_1 + 0xf630;
  local_res10 = param_2;
  local_res20 = param_4;
  FUN_14034ed40(lVar1);
  if ((param_3 == 1) && (param_4 < 0x18)) {
    lVar15 = ((longlong)(int)param_4 + 0x18) * 0xac + param_1;
    iVar3 = FUN_14011b180(lVar15);
    if (iVar3 == 0) {
      uVar2 = *(uint *)(lVar15 + 0x18);
      lVar7 = FUN_140137690();
      if (*(longlong *)(lVar7 + 0x88) != 0) {
        for (puVar9 = *(uint **)(*(longlong *)(lVar7 + 0x88) +
                                ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar7 + 0x98)) * 8);
            puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0xa6)) {
          if ((puVar9[0xa8] == uVar2) && (*puVar9 == uVar2)) goto LAB_1401fa080;
        }
      }
      puVar9 = (uint *)0x0;
LAB_1401fa080:
      if ((puVar9 != (uint *)0x0) && (0 < (int)puVar9[0x66])) {
        uVar8 = FUN_140137690();
        iVar3 = FUN_140136e70(uVar8,*(undefined4 *)(lVar15 + 0x18));
        if ((iVar3 == 1) || ((iVar3 == 2 || (iVar3 == 3)))) {
          uVar8 = FUN_140137690();
          iVar3 = FUN_140136d80(uVar8,*(undefined4 *)(lVar15 + 0x18));
          if (1 < iVar3) {
            iVar14 = 0;
            *(undefined4 *)(lVar15 + 0x2c) = 0;
            piVar12 = (int *)((longlong)(int)param_4 * 0xac + 0x1050 + param_1);
            lVar13 = 3;
            lVar7 = 3;
            piVar10 = piVar12;
            do {
              if (0 < *piVar10) {
                iVar14 = iVar14 + 1;
              }
              *piVar10 = 0;
              piVar10[3] = 0;
              piVar10 = piVar10 + 1;
              lVar7 = lVar7 + -1;
            } while (lVar7 != 0);
            uVar2 = *(uint *)(lVar15 + 0x18);
            lVar7 = FUN_140137690();
            if (*(longlong *)(lVar7 + 0x88) != 0) {
              for (puVar9 = *(uint **)(*(longlong *)(lVar7 + 0x88) +
                                      ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar7 + 0x98)) * 8);
                  puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 0xa6)) {
                if ((puVar9[0xa8] == uVar2) && (*puVar9 == uVar2)) {
                  if (puVar9 != (uint *)0x0) {
                    if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    local_res18[0] = puVar9[0x62];
                    goto LAB_1401fa1a3;
                  }
                  break;
                }
              }
            }
            local_res18[0] = 0;
LAB_1401fa1a3:
            uVar8 = FUN_140137690();
            uVar4 = FUN_140136a20(uVar8,*(undefined4 *)(lVar15 + 0x18));
            uVar8 = FUN_140137690();
            uVar5 = FUN_1401368c0(uVar8,*(undefined4 *)(lVar15 + 0x18));
            uVar8 = FUN_140137690();
            uVar6 = FUN_140136910(uVar8,*(undefined4 *)(lVar15 + 0x18));
            local_res8[0] = 0;
            uVar8 = FUN_140145140();
            uVar17 = CONCAT44(uVar18,uVar5);
            FUN_140144ef0(uVar8,local_res8,local_res18[0],uVar4,CONCAT44(uVar16,iVar3),uVar17,uVar6)
            ;
            uVar16 = (undefined4)((ulonglong)uVar17 >> 0x20);
            uVar8 = FUN_140137690();
            iVar3 = local_res8[0];
            uVar17 = CONCAT44(uVar16,1);
            FUN_140136f10(uVar8,*(undefined4 *)(lVar15 + 0x18),lVar15 + 0x2c,lVar15 + 0x30,
                          lVar15 + 0x3c,uVar17,local_res8[0]);
            lVar7 = local_res10;
            uVar16 = (undefined4)((ulonglong)uVar17 >> 0x20);
            FUN_1401fc000(*(undefined8 *)(local_res10 + 0xb50),*(undefined4 *)(local_res10 + 0x288),
                          *(undefined4 *)(local_res10 + 0x284),lVar15);
            do {
              if (0 < *piVar12) {
                iVar3 = iVar3 + 1;
              }
              piVar12 = piVar12 + 1;
              lVar13 = lVar13 + -1;
            } while (lVar13 != 0);
            FUN_140203700(*(undefined8 *)(lVar7 + 0xb50),0x1cb,0x54,lVar7,lVar15,CONCAT44(uVar16,1),
                          0,iVar14,iVar3);
            local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)local_res20);
            local_res8[0] = CONCAT22(local_res8[0]._2_2_,1);
            plVar11 = (longlong *)(*(longlong *)(lVar7 + 0xb50) + 0x78);
            (**(code **)(*plVar11 + 0xe0))
                      (plVar11,*(undefined4 *)(lVar7 + 8),&DAT_1405d85a0,local_res8,local_res18,
                       lVar15);
          }
          FUN_14034edd0(lVar1);
          return 1;
        }
      }
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



undefined8 FUN_1401fa340(longlong param_1,longlong param_2,int param_3,uint param_4)

{
  longlong lVar1;
  short sVar2;
  undefined2 uVar3;
  longlong lVar4;
  int iVar5;
  undefined8 uVar6;
  longlong *plVar7;
  ulonglong uVar8;
  undefined2 local_res8 [4];
  undefined2 local_res18 [8];
  undefined8 in_stack_ffffffffffffff70;
  undefined4 *puVar9;
  ulonglong in_stack_ffffffffffffff78;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  longlong local_40;
  undefined1 local_38;
  undefined4 uVar10;
  
  uVar10 = (undefined4)((ulonglong)in_stack_ffffffffffffff70 >> 0x20);
  lVar1 = param_1 + 0xf630;
  local_40 = lVar1;
  FUN_14034ed40(lVar1);
  local_38 = 1;
  if ((param_3 == 1) && (param_4 < 0x18)) {
    uVar8 = param_1 + ((longlong)(int)param_4 + 0x18) * 0xac;
    iVar5 = FUN_14011b180(uVar8);
    if (iVar5 == 0) {
      sVar2 = *(short *)(uVar8 + 0x94);
      uVar6 = FUN_140137690();
      iVar5 = FUN_140136e70(uVar6,*(undefined4 *)(uVar8 + 0x18));
      if ((iVar5 == 1) || (iVar5 == 2)) {
        uVar3 = *(undefined2 *)(uVar8 + 0x96);
        *(undefined2 *)(uVar8 + 0x96) = 8;
        FUN_1401a40e0(uVar8);
        *(undefined2 *)(uVar8 + 0x96) = uVar3;
        local_60 = *(undefined4 *)(param_2 + 0x160);
        local_5c = *(undefined4 *)(param_2 + 0x164);
        local_58 = *(undefined4 *)(param_2 + 0x168);
        local_54 = *(undefined4 *)(param_2 + 0x16c);
        local_50 = *(undefined4 *)(param_2 + 0x170);
        local_4c = *(undefined4 *)(param_2 + 0x174);
        local_48 = *(undefined4 *)(param_2 + 0x178);
        local_44 = *(undefined4 *)(param_2 + 0x17c);
        iVar5 = *(int *)(param_2 + 0x284);
        if ((-1 < iVar5) &&
           ((iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700) &&
            (lVar4 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar4 != 0)))) {
          local_res18[0] = (undefined2)iVar5;
          plVar7 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          puVar9 = &local_60;
          in_stack_ffffffffffffff78 = uVar8;
          (**(code **)(*plVar7 + 0x140))(plVar7,1,&DAT_1405d85a0,local_res18,&local_50,puVar9,uVar8)
          ;
          uVar10 = (undefined4)((ulonglong)puVar9 >> 0x20);
        }
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1cb,0x56,param_2,uVar8,CONCAT44(uVar10,1),
                      in_stack_ffffffffffffff78 & 0xffffffff00000000,6 - sVar2,
                      6 - *(short *)(uVar8 + 0x94));
        local_res18[0] = (undefined2)param_4;
        local_res8[0] = 1;
        plVar7 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar7 + 0xe0))
                  (plVar7,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res8,local_res18,uVar8);
        FUN_14034edd0(lVar1);
        return 1;
      }
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



undefined8 FUN_1401fa5b0(longlong param_1,longlong param_2,int param_3,uint param_4)

{
  longlong lVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined8 uVar9;
  longlong lVar10;
  longlong lVar11;
  longlong lVar12;
  longlong lVar13;
  longlong lVar14;
  int iVar15;
  int local_res18 [2];
  uint local_res20 [2];
  undefined8 in_stack_ffffffffffffff58;
  undefined4 uVar16;
  undefined8 in_stack_ffffffffffffff60;
  undefined4 uVar18;
  undefined8 uVar17;
  
  lVar1 = param_1 + 0xf630;
  local_res20[0] = param_4;
  FUN_14034ed40(lVar1);
  if ((param_3 == 5) && (param_4 < 0x78)) {
    lVar2 = param_1 + 0x50a8;
    uVar9 = FUN_1401fbad0(lVar2,param_4);
    iVar4 = FUN_14011b180(uVar9);
    if (iVar4 == 0) {
      lVar10 = FUN_1401fbad0(lVar2,param_4);
      uVar9 = FUN_140137690();
      uVar5 = FUN_140136d80(uVar9,*(undefined4 *)(lVar10 + 0x18));
      lVar10 = FUN_1401fbad0(lVar2,param_4);
      uVar9 = FUN_140137690();
      iVar4 = FUN_1401368c0(uVar9,*(undefined4 *)(lVar10 + 0x18));
      lVar10 = FUN_1401fbad0(lVar2,param_4);
      uVar9 = FUN_140137690();
      uVar6 = FUN_140136910(uVar9,*(undefined4 *)(lVar10 + 0x18));
      lVar10 = FUN_1401fbad0(lVar2,param_4);
      uVar9 = FUN_140137690();
      uVar7 = FUN_140136d80(uVar9,*(undefined4 *)(lVar10 + 0x18));
      lVar10 = FUN_1401fbad0(lVar2,param_4);
      uVar9 = FUN_140137690();
      uVar8 = FUN_140136a20(uVar9,*(undefined4 *)(lVar10 + 0x18));
      lVar10 = FUN_1401fbad0(lVar2,param_4);
      uVar9 = FUN_140137690();
      cVar3 = FUN_140137530(uVar9,*(undefined4 *)(lVar10 + 0x18));
      if (((iVar4 == 0x12) && (cVar3 != '\0')) &&
         (lVar10 = FUN_1401fbad0(lVar2,param_4), *(int *)(lVar10 + 0x70) == 0)) {
        iVar4 = 0;
        lVar10 = FUN_1401fbad0(lVar2,param_4);
        *(undefined4 *)(lVar10 + 0x2c) = 0;
        lVar14 = 0x30;
        lVar10 = 0x30;
        do {
          lVar11 = FUN_1401fbad0(lVar2,param_4);
          if (0 < *(int *)(lVar11 + lVar10)) {
            iVar4 = iVar4 + 1;
          }
          lVar11 = FUN_1401fbad0(lVar2,param_4);
          *(undefined4 *)(lVar11 + lVar10) = 0;
          lVar11 = FUN_1401fbad0(lVar2,param_4);
          uVar16 = (undefined4)((ulonglong)in_stack_ffffffffffffff58 >> 0x20);
          uVar18 = (undefined4)((ulonglong)in_stack_ffffffffffffff60 >> 0x20);
          *(undefined4 *)(lVar11 + 0xc + lVar10) = 0;
          lVar10 = lVar10 + 4;
        } while (lVar10 < 0x3c);
        local_res18[0] = 0;
        uVar9 = FUN_140145140();
        uVar17 = CONCAT44(uVar18,0x12);
        FUN_140144ef0(uVar9,local_res18,uVar7,uVar8,CONCAT44(uVar16,uVar5),uVar17,uVar6);
        uVar5 = (undefined4)((ulonglong)uVar17 >> 0x20);
        lVar10 = FUN_1401fbad0(lVar2,param_4);
        lVar11 = FUN_1401fbad0(lVar2,param_4);
        lVar12 = FUN_1401fbad0(lVar2,param_4);
        lVar13 = FUN_1401fbad0(lVar2,param_4);
        uVar9 = FUN_140137690();
        iVar15 = local_res18[0];
        FUN_140136f10(uVar9,*(undefined4 *)(lVar13 + 0x18),lVar12 + 0x2c,lVar11 + 0x30,lVar10 + 0x3c
                      ,CONCAT44(uVar5,1),local_res18[0]);
        lVar10 = FUN_1401fbad0(lVar2,param_4);
        *(undefined4 *)(lVar10 + 0x2c) = 0;
        uVar9 = FUN_1401fbad0(lVar2,param_4);
        FUN_1401ed120(param_1,local_res20,uVar9);
        lVar10 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        uVar9 = FUN_1401fbad0(lVar2,param_4);
        lVar11 = FUN_1401fbad0(lVar2,param_4);
        lVar12 = FUN_1401fbad0(lVar2,param_4);
        (**(code **)(lVar10 + 0xe0))
                  (*(longlong *)(param_2 + 0xb50) + 0x78,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0
                   ,lVar12 + 0x14,lVar11 + 0x16,uVar9);
        uVar7 = (undefined4)((ulonglong)uVar9 >> 0x20);
        uVar5 = *(undefined4 *)(param_2 + 0x284);
        uVar6 = *(undefined4 *)(param_2 + 0x288);
        uVar9 = FUN_1401fbad0(lVar2,param_4);
        FUN_1401fc000(*(undefined8 *)(param_2 + 0xb50),uVar6,uVar5,uVar9);
        param_1 = (longlong)(int)param_4 * 0xac + 0x50a8 + param_1;
        do {
          if (0 < *(int *)(lVar14 + param_1)) {
            iVar15 = iVar15 + 1;
          }
          lVar14 = lVar14 + 4;
        } while (lVar14 < 0x3c);
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1cb,0x57,param_2,param_1,
                      CONCAT44(uVar7,(int)*(short *)(param_1 + 0x1c)),0,iVar4,iVar15);
        FUN_14034edd0(lVar1);
        return 1;
      }
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



undefined8
FUN_1401fa9a0(longlong param_1,longlong param_2,int param_3,uint param_4,int param_5,
             undefined4 param_6)

{
  longlong *plVar1;
  undefined1 uVar2;
  void *pvVar3;
  bool bVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  undefined8 uVar8;
  int *piVar9;
  longlong lVar10;
  longlong *plVar11;
  longlong lVar12;
  uint uVar13;
  void *local_res8;
  int local_res18 [2];
  uint local_res20 [2];
  undefined4 *in_stack_fffffffffffffd48;
  undefined4 uVar17;
  undefined1 *puVar14;
  longlong lVar15;
  undefined4 *puVar16;
  ulonglong in_stack_fffffffffffffd50;
  undefined4 uVar18;
  ulonglong in_stack_fffffffffffffd58;
  ulonglong in_stack_fffffffffffffd60;
  ulonglong in_stack_fffffffffffffd68;
  undefined4 local_288;
  undefined2 local_284 [2];
  uint local_280;
  undefined2 local_27c;
  undefined2 local_27a;
  longlong local_278;
  longlong *local_270;
  longlong *local_268;
  longlong local_260;
  longlong local_258;
  undefined1 local_250;
  undefined4 local_248 [2];
  undefined4 local_240;
  undefined4 local_23c;
  uint local_238 [2];
  undefined4 local_230;
  undefined4 local_22c;
  undefined4 local_228;
  undefined4 local_224;
  undefined4 local_220;
  undefined4 local_21c;
  undefined4 local_218;
  undefined4 local_214;
  undefined4 local_210;
  undefined4 local_20c;
  undefined4 local_208;
  undefined4 local_204;
  undefined4 local_200;
  undefined4 local_1fc;
  undefined4 local_1f8;
  undefined4 local_1f4;
  undefined1 *local_1f0;
  undefined1 *local_1e8;
  longlong local_1d8;
  longlong lStack_1d0;
  undefined1 local_1c8 [4];
  short local_1c4;
  undefined4 local_1c0;
  undefined1 local_1bc [16];
  undefined1 local_1ac [4];
  undefined1 local_1a8 [12];
  undefined1 local_19c [90];
  undefined2 local_142;
  undefined4 local_130;
  undefined8 local_128;
  undefined1 local_120 [24];
  undefined1 local_108 [168];
  undefined4 local_60;
  
  local_128 = 0xfffffffffffffffe;
  lVar10 = param_1 + 0xf630;
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  local_280 = param_4;
  local_258 = lVar10;
  FUN_14034ed40(lVar10);
  local_250 = 1;
  if ((param_3 == 1) && (param_4 < 0x18)) {
    lVar15 = (longlong)(int)param_4 + 0x18;
    lVar12 = lVar15 * 0xac + param_1;
    local_278 = lVar12;
    iVar6 = FUN_14011b180(lVar12);
    if (iVar6 == 0) {
      uVar8 = FUN_140137690();
      iVar6 = FUN_140136e20(uVar8,*(undefined4 *)(lVar12 + 0x18));
      if (0 < iVar6) {
        local_270 = (longlong *)0x0;
        local_res8 = operator_new(0x850);
        if (local_res8 == (void *)0x0) {
          lVar12 = 0;
        }
        else {
          lVar12 = FUN_1401e64f0(local_res8);
        }
        if (lVar12 == 0) {
          local_270 = (longlong *)0x0;
        }
        else {
          local_270 = operator_new(0x10);
          *local_270 = lVar12;
          *(undefined4 *)(local_270 + 1) = 1;
        }
        plVar1 = local_270;
        local_268 = local_270;
        if ((local_270 == (longlong *)0x0) || (*local_270 == 0)) {
          if (local_270 != (longlong *)0x0) {
            LOCK();
            plVar11 = local_270 + 1;
            *(int *)plVar11 = (int)*plVar11 + -1;
            UNLOCK();
            lVar10 = local_258;
            if ((int)*plVar11 == 0) {
              pvVar3 = (void *)*local_270;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0x818);
                operator_delete(pvVar3);
              }
              operator_delete(plVar1);
              lVar10 = local_258;
            }
          }
        }
        else {
          if (*(longlong **)(param_2 + 0x6d0) != local_270) {
            FUN_1401dede0(param_2 + 0x6d0);
            *(longlong **)(param_2 + 0x6d0) = plVar1;
            *(longlong **)(param_2 + 0x6d8) = plVar1;
            LOCK();
            *(int *)(plVar1 + 1) = (int)plVar1[1] + 1;
            UNLOCK();
            local_280 = local_res20[0];
          }
          plVar1 = local_270;
          iVar6 = 0;
          piVar9 = (int *)((longlong)(int)param_4 * 0xac + 0x106c + param_1);
          lVar10 = 3;
          do {
            if (*piVar9 != 0) {
              iVar6 = iVar6 + 1;
            }
            piVar9 = piVar9 + 1;
            lVar10 = lVar10 + -1;
          } while (lVar10 != 0);
          if ((iVar6 < 1) || (iVar7 = FUN_1401ed510(param_1), iVar7 < iVar6)) {
            plVar11 = local_270;
            LOCK();
            plVar1 = plVar1 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            lVar10 = local_258;
            if ((int)*plVar1 == 0) {
              pvVar3 = (void *)*local_270;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0x818);
                operator_delete(pvVar3);
              }
              operator_delete(plVar11);
              lVar10 = local_258;
            }
          }
          else {
            FUN_14000a170(&local_1d8);
            local_130 = 0;
            uVar8 = FUN_140137690();
            lVar10 = local_278;
            iVar6 = FUN_140136e70(uVar8,*(undefined4 *)(local_278 + 0x18));
            plVar11 = local_270;
            if (((iVar6 == 1) || (iVar6 == 2)) || (iVar6 == 3)) {
              iVar6 = 0;
              lVar12 = 0;
              local_260 = lVar15 * 0x2b;
              lVar15 = lVar15 * 0xac + 0x4c;
              piVar9 = (int *)(lVar15 + param_1);
              local_1f0 = local_1a8 + (-param_1 - lVar15);
              local_1e8 = local_19c + (-param_1 - lVar15);
              do {
                if (0 < *piVar9) {
                  uVar2 = *(undefined1 *)(lVar10 + 100 + lVar12);
                  uVar8 = FUN_140146ee0();
                  lVar10 = FUN_140146df0(uVar8,param_6,uVar2);
                  plVar11 = local_270;
                  if (lVar10 == 0) {
                    LOCK();
                    plVar1 = plVar1 + 1;
                    *(int *)plVar1 = (int)*plVar1 + -1;
                    UNLOCK();
                    lVar10 = local_258;
                    if ((int)*plVar1 == 0) {
                      pvVar3 = (void *)*local_270;
                      if (pvVar3 != (void *)0x0) {
                        FUN_14034edf0((longlong)pvVar3 + 0x818);
                        operator_delete(pvVar3);
                      }
                      operator_delete(plVar11);
                      lVar10 = local_258;
                    }
                    goto LAB_1401fb286;
                  }
                  iVar7 = rand();
                  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffd48 >> 0x20);
                  if ((int)((float)iVar7 * 3.0517578e-05 * 100.0) < 100 - *(int *)(lVar10 + 0xc)) {
                    uVar2 = *(undefined1 *)(local_278 + 100 + lVar12);
                    uVar8 = FUN_140146ee0();
                    lVar10 = FUN_140146df0(uVar8,param_6,uVar2);
                    plVar11 = local_270;
                    if (lVar10 == 0) {
                      LOCK();
                      plVar1 = plVar1 + 1;
                      *(int *)plVar1 = (int)*plVar1 + -1;
                      UNLOCK();
                      lVar10 = local_258;
                      if ((int)*plVar1 == 0) {
                        pvVar3 = (void *)*local_270;
                        if (pvVar3 != (void *)0x0) {
                          FUN_14034edf0((longlong)pvVar3 + 0x818);
                          operator_delete(pvVar3);
                        }
                        operator_delete(plVar11);
                        lVar10 = local_258;
                      }
                      goto LAB_1401fb286;
                    }
                    iVar7 = rand();
                    if ((int)((float)iVar7 * 3.0517578e-05 * 100.0) < 100 - *(int *)(lVar10 + 0x10))
                    {
                      local_23c = 0;
                      lVar10 = param_1 + 0x30 + (iVar6 + local_260) * 4;
                      in_stack_fffffffffffffd48 = &local_23c;
                    }
                    else {
                      in_stack_fffffffffffffd48 =
                           (undefined4 *)CONCAT44(uVar17,*(undefined4 *)(lVar10 + 0x18));
                      cVar5 = FUN_1401f61c0(local_1c0,local_1c8,&local_1c0,local_1bc,
                                            in_stack_fffffffffffffd48);
                      uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffd48 >> 0x20);
                      lVar10 = local_278;
                      if (cVar5 == '\0') goto LAB_1401fae8c;
                      uVar8 = FUN_140137690();
                      uVar18 = local_1c0;
                      local_288 = FUN_140136d80(uVar8,local_1c0);
                      plVar11 = (longlong *)FUN_140357570(local_120);
                      local_1d8 = *plVar11;
                      lStack_1d0 = plVar11[1];
                      uVar8 = FUN_140137690();
                      local_1c4 = FUN_140136b30(uVar8,uVar18);
                      if (local_1c4 == 1) {
                        local_142 = 3;
                        FUN_1401a40e0(&local_1d8);
                      }
                      if (((local_1c4 == 5) || (local_1c4 == 1)) || (local_1c4 == 2)) {
                        uVar8 = FUN_140137690();
                        iVar7 = FUN_1401369d0(uVar8,local_1c0);
                        uVar18 = (undefined4)(in_stack_fffffffffffffd50 >> 0x20);
                        if ((iVar7 == 0) || (iVar7 == 0x17)) {
                          uVar8 = FUN_140137690();
                          in_stack_fffffffffffffd58 = in_stack_fffffffffffffd58 & 0xffffffff00000000
                          ;
                          in_stack_fffffffffffffd50 = CONCAT44(uVar18,local_288);
                          puVar14 = local_19c;
                          FUN_140136f10(uVar8,local_1c0,local_1ac,local_1a8,puVar14,
                                        in_stack_fffffffffffffd50,in_stack_fffffffffffffd58);
                          uVar17 = (undefined4)((ulonglong)puVar14 >> 0x20);
                        }
                      }
                      FUN_1401e6560(*plVar1,&local_1d8,param_2,0x1cf,CONCAT44(uVar17,0x68));
                      local_288 = 2;
                      lVar10 = param_1 + 0x30 + (iVar6 + local_260) * 4;
                      in_stack_fffffffffffffd48 = &local_288;
                    }
                  }
                  else {
                    in_stack_fffffffffffffd68 = in_stack_fffffffffffffd68 & 0xffffffff00000000;
                    in_stack_fffffffffffffd60 = in_stack_fffffffffffffd60 & 0xffffffff00000000;
                    in_stack_fffffffffffffd58 = in_stack_fffffffffffffd58 & 0xffffffff00000000;
                    in_stack_fffffffffffffd50 = in_stack_fffffffffffffd50 & 0xffffffff00000000;
                    FUN_1401aac30(3,&local_1d8,*(undefined4 *)(lVar10 + 0x14),1,
                                  (ulonglong)in_stack_fffffffffffffd48 & 0xffffffff00000000,
                                  in_stack_fffffffffffffd50,in_stack_fffffffffffffd58,
                                  in_stack_fffffffffffffd60,in_stack_fffffffffffffd68,0);
                    lVar10 = local_260;
                    *(int *)(local_1f0 + (longlong)piVar9) = *piVar9;
                    *(undefined4 *)(local_1e8 + (longlong)piVar9) =
                         *(undefined4 *)(param_1 + 0x58 + (local_260 + lVar12) * 4);
                    FUN_1401e6560(*plVar1,&local_1d8,param_2,0x1cf,0x68);
                    local_240 = 1;
                    lVar10 = param_1 + 0x30 + (iVar6 + lVar10) * 4;
                    in_stack_fffffffffffffd48 = &local_240;
                  }
                  plVar11 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                  (**(code **)(*plVar11 + 0xda0))
                            (plVar11,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,lVar10,
                             in_stack_fffffffffffffd48);
                  lVar10 = local_278;
                }
LAB_1401fae8c:
                uVar17 = (undefined4)(in_stack_fffffffffffffd50 >> 0x20);
                *piVar9 = 0;
                *(undefined4 *)(param_1 + 0x58 + (local_260 + lVar12) * 4) = 0;
                iVar6 = iVar6 + 1;
                lVar12 = lVar12 + 1;
                piVar9 = piVar9 + 1;
                if (2 < iVar6) {
                  if ((local_1d8 == 0) && (lStack_1d0 == 0)) {
                    bVar4 = false;
                  }
                  else {
                    bVar4 = true;
                  }
                  if (bVar4) {
                    FUN_1401e6700(*plVar1,0xc,param_2);
                  }
                  uVar13 = local_280;
                  if (param_5 == 0) {
                    lVar15 = lVar10;
                    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1cf,0x69,param_2,lVar10,
                                  CONCAT44(uVar17,(int)*(short *)(lVar10 + 0x1c)),
                                  in_stack_fffffffffffffd58 & 0xffffffff00000000,
                                  in_stack_fffffffffffffd60 & 0xffffffff00000000,
                                  in_stack_fffffffffffffd68 & 0xffffffff00000000);
                    uVar17 = (undefined4)((ulonglong)lVar15 >> 0x20);
                    FUN_14000a170(local_108);
                    uVar13 = local_280;
                    local_60 = 0;
                    local_230 = *(undefined4 *)(param_2 + 0x160);
                    local_22c = *(undefined4 *)(param_2 + 0x164);
                    local_228 = *(undefined4 *)(param_2 + 0x168);
                    local_224 = *(undefined4 *)(param_2 + 0x16c);
                    local_220 = *(undefined4 *)(param_2 + 0x170);
                    local_21c = *(undefined4 *)(param_2 + 0x174);
                    local_218 = *(undefined4 *)(param_2 + 0x178);
                    local_214 = *(undefined4 *)(param_2 + 0x17c);
                    iVar6 = *(int *)(param_2 + 0x284);
                    local_238[0] = local_280;
                    local_248[0] = 0xffffffe0;
                    if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                       && (lVar15 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0),
                          lVar15 != 0)) {
                      local_res8 = (void *)CONCAT62(local_res8._2_6_,(short)iVar6);
                      plVar11 = (longlong *)
                                (*(longlong *)
                                  (*(longlong *)(lVar15 + 8) +
                                  (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                      puVar16 = &local_220;
                      (**(code **)(*plVar11 + 0x130))
                                (plVar11,1,&DAT_1405d85a0,&local_res8,puVar16,&local_230,lVar10,
                                 local_248,local_238);
                      uVar17 = (undefined4)((ulonglong)puVar16 >> 0x20);
                    }
                    FUN_1401ed220(param_1,local_res18,local_res20,local_108,CONCAT44(uVar17,6));
                  }
                  local_200 = *(undefined4 *)(param_2 + 0x160);
                  local_1fc = *(undefined4 *)(param_2 + 0x164);
                  local_1f8 = *(undefined4 *)(param_2 + 0x168);
                  local_1f4 = *(undefined4 *)(param_2 + 0x16c);
                  local_210 = *(undefined4 *)(param_2 + 0x170);
                  local_20c = *(undefined4 *)(param_2 + 0x174);
                  local_208 = *(undefined4 *)(param_2 + 0x178);
                  local_204 = *(undefined4 *)(param_2 + 0x17c);
                  iVar6 = *(int *)(param_2 + 0x284);
                  if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                     && (lVar15 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar15 != 0
                        )) {
                    local_27a = (undefined2)iVar6;
                    plVar11 = (longlong *)
                              (*(longlong *)
                                (*(longlong *)(lVar15 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8
                                ) + 0x70);
                    (**(code **)(*plVar11 + 0x140))
                              (plVar11,1,&DAT_1405d85a0,&local_27a,&local_210,&local_200,lVar10);
                  }
                  local_284[0] = (undefined2)uVar13;
                  local_27c = 1;
                  plVar11 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                  (**(code **)(*plVar11 + 0xe0))
                            (plVar11,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_27c,
                             local_284,lVar10);
                  plVar11 = local_270;
                  LOCK();
                  plVar1 = plVar1 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    pvVar3 = (void *)*local_270;
                    if (pvVar3 != (void *)0x0) {
                      FUN_14034edf0((longlong)pvVar3 + 0x818);
                      operator_delete(pvVar3);
                    }
                    operator_delete(plVar11);
                  }
                  FUN_14034edd0(local_258);
                  return 1;
                }
              } while( true );
            }
            LOCK();
            plVar1 = plVar1 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            lVar10 = local_258;
            if ((int)*plVar1 == 0) {
              pvVar3 = (void *)*local_270;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0x818);
                operator_delete(pvVar3);
              }
              operator_delete(plVar11);
              lVar10 = local_258;
            }
          }
        }
      }
    }
  }
LAB_1401fb286:
  FUN_14034edd0(lVar10);
  return 0;
}



undefined8 FUN_1401fb2c0(longlong param_1,longlong param_2,uint param_3,longlong param_4)

{
  int iVar1;
  bool bVar2;
  longlong lVar3;
  uint *puVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong *plVar7;
  undefined2 uVar8;
  int iVar9;
  ulonglong uVar10;
  undefined2 uVar11;
  uint uVar12;
  uint local_res18 [2];
  int *piVar13;
  undefined4 *puVar14;
  undefined *in_stack_ffffffffffffff60;
  undefined4 uVar15;
  undefined8 in_stack_ffffffffffffff68;
  undefined4 uVar17;
  undefined8 uVar16;
  undefined2 local_88;
  undefined2 local_86;
  int local_84;
  undefined4 local_80 [2];
  int local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  longlong local_50;
  ulonglong local_48;
  longlong local_40;
  undefined1 local_38;
  undefined8 local_30;
  
  local_30 = 0xfffffffffffffffe;
  if (4 < (int)param_3) {
    return 0;
  }
  uVar12 = *(uint *)(param_4 + 0x18);
  local_res18[0] = param_3;
  lVar3 = FUN_140137690();
  if (*(longlong *)(lVar3 + 0x88) != 0) {
    for (puVar4 = *(uint **)(*(longlong *)(lVar3 + 0x88) +
                            ((ulonglong)uVar12 % (ulonglong)*(uint *)(lVar3 + 0x98)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0xa6)) {
      if ((puVar4[0xa8] == uVar12) && (*puVar4 == uVar12)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar12 = puVar4[0x4c];
          goto LAB_1401fb376;
        }
        break;
      }
    }
  }
  uVar12 = 1;
LAB_1401fb376:
  local_84 = -1;
  lVar3 = param_1 + 0xf630;
  local_40 = lVar3;
  FUN_14034ed40(lVar3);
  uVar15 = (undefined4)((ulonglong)in_stack_ffffffffffffff68 >> 0x20);
  local_38 = 1;
  if ((int)uVar12 < 2) {
    local_84 = 0;
    iVar9 = FUN_1401ed430(param_1,local_res18,&local_84);
    uVar12 = local_res18[0];
    if (iVar9 == 0) {
      printf("SelectItem - Empty Inventory Error \n");
      FUN_14034edd0(lVar3);
      return 0;
    }
    uVar11 = (undefined2)local_res18[0];
    *(undefined2 *)(param_4 + 0x14) = uVar11;
    uVar8 = (undefined2)local_84;
    *(undefined2 *)(param_4 + 0x16) = uVar8;
    plVar7 = (longlong *)
             (((longlong)local_84 + (longlong)(int)local_res18[0] * 0x18) * 0xac + param_1);
    FUN_140090020(plVar7,param_4);
    FUN_1401f3b10(param_1,uVar12,(int)plVar7[0xd] * (int)*(short *)((longlong)plVar7 + 0x1c));
    local_74 = *(undefined4 *)(param_2 + 0x160);
    local_70 = *(undefined4 *)(param_2 + 0x164);
    local_6c = *(undefined4 *)(param_2 + 0x168);
    local_68 = *(undefined4 *)(param_2 + 0x16c);
    local_64 = *(undefined4 *)(param_2 + 0x170);
    local_60 = *(undefined4 *)(param_2 + 0x174);
    local_5c = *(undefined4 *)(param_2 + 0x178);
    local_58 = *(undefined4 *)(param_2 + 0x17c);
    iVar9 = *(int *)(param_2 + 0x284);
    local_80[0] = *(undefined4 *)(param_2 + 8);
    if ((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
      if ((*plVar7 == 0) && (plVar7[1] == 0)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
      if (((bVar2) && ((int)plVar7[3] != 0)) &&
         (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
        local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar9);
        plVar5 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        in_stack_ffffffffffffff60 = &DAT_14047b9f4;
        plVar6 = plVar7;
        (**(code **)(*plVar5 + 0xb0))
                  (plVar5,1,&DAT_1405d85a0,local_res18,local_80,&local_64,&local_74,&DAT_14047b9f4,
                   plVar7);
        uVar15 = (undefined4)((ulonglong)plVar6 >> 0x20);
      }
    }
    plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    local_88 = uVar11;
    local_res18[0]._0_2_ = uVar8;
    (**(code **)(*plVar6 + 0xe0))
              (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_88,local_res18,plVar7);
    local_80[0] = 0;
    local_84 = (int)*(short *)(param_4 + 0x1c);
    local_res18[0] = CONCAT22(local_res18[0]._2_2_,uVar8);
    plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    puVar14 = local_80;
    piVar13 = &local_84;
    local_88 = uVar11;
    (**(code **)(*plVar6 + 0xcc0))
              (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_88,local_res18,piVar13,
               puVar14);
    uVar17 = (undefined4)((ulonglong)piVar13 >> 0x20);
    iVar9 = (int)*(short *)((longlong)plVar7 + 0x1c);
    uVar16 = CONCAT44(uVar15,iVar9);
  }
  else {
    iVar9 = 0;
    uVar10 = (ulonglong)(int)local_res18[0];
    lVar3 = uVar10 * 0x18;
    local_50 = lVar3;
    local_48 = uVar10;
    do {
      uVar15 = (undefined4)((ulonglong)in_stack_ffffffffffffff60 >> 0x20);
      uVar17 = (undefined4)((ulonglong)in_stack_ffffffffffffff68 >> 0x20);
      plVar7 = (longlong *)((iVar9 + lVar3) * 0xac + param_1);
      if ((*plVar7 == 0) && (plVar7[1] == 0)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
      if (((bVar2) || ((int)plVar7[3] != 0)) || (0 < *(short *)((longlong)plVar7 + 0x1c))) {
        if (((int)plVar7[3] == *(int *)(param_4 + 0x18)) &&
           ((int)*(short *)((longlong)plVar7 + 0x1c) < (int)uVar12)) {
          local_78 = (int)*(short *)(param_4 + 0x1c);
          if ((int)uVar12 < *(short *)((longlong)plVar7 + 0x1c) + local_78) {
            local_78 = uVar12 - (int)*(short *)((longlong)plVar7 + 0x1c);
          }
          *(short *)((longlong)plVar7 + 0x1c) =
               *(short *)((longlong)plVar7 + 0x1c) + (short)local_78;
          *(undefined4 *)(plVar7 + 0x15) = 6;
          *(short *)(param_4 + 0x1c) = *(short *)(param_4 + 0x1c) - (short)local_78;
          FUN_1401f3b10(param_1,uVar10 & 0xffffffff,(int)plVar7[0xd] * local_78);
          local_64 = *(undefined4 *)(param_2 + 0x160);
          local_60 = *(undefined4 *)(param_2 + 0x164);
          local_5c = *(undefined4 *)(param_2 + 0x168);
          local_58 = *(undefined4 *)(param_2 + 0x16c);
          local_74 = *(undefined4 *)(param_2 + 0x170);
          local_70 = *(undefined4 *)(param_2 + 0x174);
          local_6c = *(undefined4 *)(param_2 + 0x178);
          local_68 = *(undefined4 *)(param_2 + 0x17c);
          iVar1 = *(int *)(param_2 + 0x284);
          if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
             (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
            local_86 = (undefined2)iVar1;
            plVar6 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar6 + 0x140))
                      (plVar6,1,&DAT_1405d85a0,&local_86,&local_74,&local_64,plVar7);
          }
          local_88 = (undefined2)local_res18[0];
          plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
          local_86 = (short)iVar9;
          (**(code **)(*plVar6 + 0xe0))
                    (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_88,&local_86,plVar7);
          local_80[0] = 0;
          local_86 = (undefined2)local_res18[0];
          plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
          puVar14 = local_80;
          local_88 = (short)iVar9;
          (**(code **)(*plVar6 + 0xcc0))
                    (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_86,&local_88,
                     &local_78,puVar14);
          in_stack_ffffffffffffff68 = CONCAT44(uVar17,(int)*(short *)((longlong)plVar7 + 0x1c));
          in_stack_ffffffffffffff60 =
               (undefined *)CONCAT44(uVar15,*(short *)((longlong)plVar7 + 0x1c) - local_78);
          FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1ce,0x67,param_2,plVar7,local_78,
                        (ulonglong)puVar14 & 0xffffffff00000000,in_stack_ffffffffffffff60,
                        in_stack_ffffffffffffff68);
          uVar10 = (ulonglong)local_res18[0];
          lVar3 = local_50;
        }
        uVar15 = (undefined4)((ulonglong)in_stack_ffffffffffffff68 >> 0x20);
        if (*(short *)(param_4 + 0x1c) < 1) break;
      }
      else if (local_84 == -1) {
        local_84 = iVar9;
      }
      uVar15 = (undefined4)((ulonglong)in_stack_ffffffffffffff68 >> 0x20);
      iVar9 = iVar9 + 1;
    } while (iVar9 < 0x18);
    if ((local_84 < 0) || (*(short *)(param_4 + 0x1c) < 1)) goto LAB_1401fba7f;
    *(short *)(param_4 + 0x14) = (short)uVar10;
    uVar8 = (undefined2)local_84;
    *(undefined2 *)(param_4 + 0x16) = uVar8;
    plVar7 = (longlong *)((lVar3 + local_84) * 0xac + param_1);
    FUN_140090020(plVar7,param_4);
    piVar13 = (int *)(param_1 + 0xf5f8 + local_48 * 4);
    *piVar13 = *piVar13 + (int)plVar7[0xd] * (int)*(short *)((longlong)plVar7 + 0x1c);
    if (*(longlong *)(param_1 + 0xf610) != 0) {
      (**(code **)(**(longlong **)(param_1 + 0xf610) + 8))
                (*(longlong **)(param_1 + 0xf610),
                 *(int *)(param_1 + 0xf608) + *(int *)(param_1 + 0xf604) +
                 *(int *)(param_1 + 0xf600) + *(int *)(param_1 + 0xf5fc) +
                 *(int *)(param_1 + 0xf5f8));
    }
    local_74 = *(undefined4 *)(param_2 + 0x160);
    local_70 = *(undefined4 *)(param_2 + 0x164);
    local_6c = *(undefined4 *)(param_2 + 0x168);
    local_68 = *(undefined4 *)(param_2 + 0x16c);
    local_64 = *(undefined4 *)(param_2 + 0x170);
    local_60 = *(undefined4 *)(param_2 + 0x174);
    local_5c = *(undefined4 *)(param_2 + 0x178);
    local_58 = *(undefined4 *)(param_2 + 0x17c);
    iVar9 = *(int *)(param_2 + 0x284);
    local_80[0] = *(undefined4 *)(param_2 + 8);
    if ((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
      if ((*plVar7 == 0) && (plVar7[1] == 0)) {
        bVar2 = false;
      }
      else {
        bVar2 = true;
      }
      if (((bVar2) && ((int)plVar7[3] != 0)) &&
         (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
        local_88 = (undefined2)iVar9;
        plVar5 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        in_stack_ffffffffffffff60 = &DAT_14047b9f4;
        plVar6 = plVar7;
        (**(code **)(*plVar5 + 0xb0))
                  (plVar5,1,&DAT_1405d85a0,&local_88,local_80,&local_64,&local_74,&DAT_14047b9f4,
                   plVar7);
        uVar15 = (undefined4)((ulonglong)plVar6 >> 0x20);
      }
    }
    uVar11 = (undefined2)local_res18[0];
    plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    local_88 = uVar8;
    (**(code **)(*plVar6 + 0xe0))
              (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,&local_88,plVar7);
    local_80[0] = 0;
    local_84 = (int)*(short *)(param_4 + 0x1c);
    local_res18[0] = CONCAT22(local_res18[0]._2_2_,uVar8);
    plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    puVar14 = local_80;
    piVar13 = &local_84;
    local_88 = uVar11;
    (**(code **)(*plVar6 + 0xcc0))
              (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_88,local_res18,piVar13,
               puVar14);
    uVar17 = (undefined4)((ulonglong)piVar13 >> 0x20);
    iVar9 = (int)*(short *)((longlong)plVar7 + 0x1c);
    uVar16 = CONCAT44(uVar15,iVar9);
  }
  FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1ce,0x67,param_2,plVar7,CONCAT44(uVar17,iVar9),
                (ulonglong)puVar14 & 0xffffffff00000000,
                (ulonglong)in_stack_ffffffffffffff60 & 0xffffffff00000000,uVar16);
LAB_1401fba7f:
  FUN_14034edd0(local_40);
  return 1;
}



undefined8 * FUN_1401fbad0(longlong param_1,uint param_2)

{
  if (param_2 < 0x78) {
    return (undefined8 *)((longlong)(int)param_2 * 0xac + param_1);
  }
  if (DAT_1406093a4 == 0) {
    FUN_140176d60(0);
  }
  DAT_1406093a4 = DAT_1406093a4 + 1;
  return &DAT_14060d080;
}



void FUN_1401fbb20(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 (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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1401fbd90(*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 * 8);
    param_1[1] = (longlong)(pcVar4 + (lVar2 - (longlong)pvVar1 >> 3) * 8);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_1401fbc30(longlong param_1,undefined4 *param_2)

{
  undefined4 uVar1;
  ulonglong uVar2;
  undefined4 *puVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  
  uVar7 = 2;
  puVar3 = (undefined4 *)(param_1 + 4);
  do {
    if (puVar3 == param_2) {
      return;
    }
    uVar6 = 0x7fff;
    uVar4 = rand();
    uVar4 = uVar4 & 0x7fff;
    if (0x7fff < uVar7) {
      do {
        if (uVar6 == 0xffffffff) break;
        uVar5 = rand();
        uVar6 = uVar6 << 0xf | 0x7fff;
        uVar4 = uVar5 & 0x7fff | uVar4 << 0xf;
      } while (uVar6 < uVar7);
    }
    uVar1 = *puVar3;
    uVar2 = (ulonglong)uVar7;
    uVar7 = uVar7 + 1;
    *puVar3 = *(undefined4 *)(param_1 + ((ulonglong)uVar4 % uVar2) * 4);
    *(undefined4 *)(param_1 + ((ulonglong)uVar4 % uVar2) * 4) = uVar1;
    puVar3 = puVar3 + 1;
  } while( true );
}



void FUN_1401fbce0(longlong param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  ulonglong uVar2;
  undefined8 *puVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  
  uVar7 = 2;
  puVar3 = (undefined8 *)(param_1 + 8);
  do {
    if (puVar3 == param_2) {
      return;
    }
    uVar6 = 0x7fff;
    uVar4 = rand();
    uVar4 = uVar4 & 0x7fff;
    if (0x7fff < uVar7) {
      do {
        if (uVar6 == 0xffffffff) break;
        uVar5 = rand();
        uVar6 = uVar6 << 0xf | 0x7fff;
        uVar4 = uVar5 & 0x7fff | uVar4 << 0xf;
      } while (uVar6 < uVar7);
    }
    uVar2 = (ulonglong)uVar7;
    uVar1 = *puVar3;
    uVar7 = uVar7 + 1;
    *puVar3 = *(undefined8 *)(param_1 + ((ulonglong)uVar4 % uVar2) * 8);
    *(undefined8 *)(param_1 + ((ulonglong)uVar4 % uVar2) * 8) = uVar1;
    puVar3 = puVar3 + 1;
  } while( true );
}



undefined8 * FUN_1401fbd90(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 1) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
    }
    param_3 = param_3 + 1;
  }
  return param_3;
}



void FUN_1401fbdd0(longlong param_1,int param_2,int param_3,undefined4 param_4,undefined8 param_5,
                  undefined8 param_6)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined8 uVar6;
  undefined *puVar7;
  longlong *plVar8;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined *local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined1 local_20;
  
  if (-1 < param_3) {
    local_30 = 0xfffffffffffffffe;
    if ((param_3 < *(short *)(param_1 + 700)) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res20[0] = param_4;
      FUN_14034fe70();
      local_38 = PTR_DAT_1405d8008;
      iVar3 = FUN_14034fd90(param_6);
      if (local_38 == (undefined *)0x0) {
        iVar5 = 0;
      }
      else if (local_38 == PTR_DAT_1405d8008) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(local_38 + -8);
      }
      iVar4 = iVar3;
      if (iVar3 <= iVar5) {
        if (local_38 == (undefined *)0x0) {
          iVar4 = 0;
        }
        else if (local_38 == PTR_DAT_1405d8008) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(local_38 + -8);
        }
      }
      iVar5 = 1;
      if (1 < iVar4) {
        iVar5 = iVar4;
      }
      if (local_38 == (undefined *)0x0) {
        iVar4 = 0;
      }
      else if (local_38 == PTR_DAT_1405d8008) {
        iVar4 = 0;
      }
      else {
        iVar4 = *(int *)(local_38 + -8);
      }
      if (iVar4 < iVar5) {
        FUN_140057890(&local_38);
      }
      FUN_140057970(&local_38);
      puVar7 = local_38;
      if (local_38 == (undefined *)0x0) {
        puVar7 = PTR_DAT_1405d8008;
      }
      FUN_14034fdc0(puVar7,param_6,iVar3);
      iVar5 = FUN_14034fd90();
      iVar3 = 0;
      if (0 < iVar5) {
        iVar3 = iVar5;
      }
      if (local_38 == (undefined *)0x0) {
        iVar5 = 0;
      }
      else if (local_38 == PTR_DAT_1405d8008) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(local_38 + -8);
      }
      if (iVar5 <= iVar3) {
        if (local_38 == (undefined *)0x0) {
          iVar3 = 0;
        }
        else if (local_38 == PTR_DAT_1405d8008) {
          iVar3 = 0;
        }
        else {
          iVar3 = *(int *)(local_38 + -8);
        }
      }
      if (((local_38 != PTR_DAT_1405d8008) && (local_38 != (undefined *)0x0)) &&
         (piVar1 = (int *)(local_38 + -8), piVar1 != (int *)0x0)) {
        *piVar1 = iVar3;
        *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
      }
      plVar8 = (longlong *)
               (*(longlong *)
                 (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8) + 0x70)
      ;
      local_res18[0] = (short)param_3;
      (**(code **)(*plVar8 + 0x1040))
                (plVar8,1,&DAT_1405d85a0,local_res18,local_res20,param_5,&local_38);
      puVar7 = local_38;
      if (((local_38 != (undefined *)0x0) && (local_38 != PTR_DAT_1405d8008)) &&
         (puVar2 = local_38 + -8, puVar2 != (undefined *)0x0)) {
        uVar6 = FUN_14034fe70();
        local_28 = uVar6;
        FUN_14034ed40(uVar6);
        local_20 = 1;
        piVar1 = (int *)(puVar7 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar2);
        }
        FUN_14034edd0(uVar6);
      }
    }
  }
  return;
}



void FUN_1401fc000(longlong param_1,int param_2,int param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined2 local_res18 [8];
  
  if (((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) &&
     (*(longlong *)(param_1 + 0x4c0) != 0)) {
    local_res18[0] = (undefined2)param_3;
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
    ;
    (**(code **)(*(longlong *)(lVar1 + 0x70) + 0xae0))
              (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,param_4);
  }
  return;
}



void FUN_1401fc060(longlong param_1,int param_2,int param_3,undefined8 param_4,longlong *param_5)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [8];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_5 == 0) && (param_5[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 400))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,param_4,param_5,&stack0x00000030);
    }
  }
  return;
}



void FUN_1401fc100(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_5 == 0) && (param_5[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      local_res20[0] = param_4;
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x3b0))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,param_5);
    }
  }
  return;
}



void FUN_1401fc1a0(longlong param_1,int param_2,int param_3,longlong *param_4)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [8];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_4 == 0) && (param_4[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1d0))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,param_4,&stack0x00000028);
    }
  }
  return;
}



void FUN_1401fc230(longlong param_1,int param_2,int param_3,longlong *param_4,undefined8 param_5)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [8];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_4 == 0) && (param_4[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1c0))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,param_4,param_5);
    }
  }
  return;
}



void FUN_1401fc2c0(longlong param_1,int param_2,int param_3,longlong *param_4)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [8];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_4 == 0) && (param_4[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x200))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,param_4,&stack0x00000028);
    }
  }
  return;
}



void FUN_1401fc350(longlong param_1,int param_2,int param_3,longlong *param_4,undefined8 param_5,
                  undefined8 param_6)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  longlong *plVar9;
  int iVar10;
  undefined2 local_res18 [4];
  undefined *local_58;
  undefined *local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined1 local_38;
  
  if (param_3 < 0) {
    return;
  }
  local_48 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  iVar6 = 0;
  iVar10 = 0;
  if ((*param_4 != 0) || (iVar3 = iVar10, param_4[1] != 0)) {
    iVar3 = 1;
  }
  if (iVar3 == 0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  FUN_14034fe70();
  local_50 = PTR_DAT_1405d8008;
  iVar4 = FUN_14034fd90(param_6);
  iVar3 = iVar10;
  if ((local_50 != (undefined *)0x0) && (local_50 != PTR_DAT_1405d8008)) {
    iVar3 = *(int *)(local_50 + -8);
  }
  iVar5 = iVar4;
  if (((iVar4 <= iVar3) && (iVar5 = iVar10, local_50 != (undefined *)0x0)) &&
     (local_50 != PTR_DAT_1405d8008)) {
    iVar5 = *(int *)(local_50 + -8);
  }
  iVar3 = 1;
  if (1 < iVar5) {
    iVar3 = iVar5;
  }
  iVar5 = iVar10;
  if ((local_50 != (undefined *)0x0) && (local_50 != PTR_DAT_1405d8008)) {
    iVar5 = *(int *)(local_50 + -8);
  }
  if (iVar5 < iVar3) {
    FUN_140057890(&local_50);
  }
  FUN_140057970(&local_50);
  puVar8 = local_50;
  if (local_50 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar8,param_6,iVar4);
  puVar8 = local_50;
  if (local_50 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8008;
  }
  iVar4 = FUN_14034fd90(puVar8);
  iVar3 = iVar6;
  if (0 < iVar4) {
    iVar3 = iVar4;
  }
  iVar4 = iVar6;
  if ((local_50 != (undefined *)0x0) && (iVar4 = 0, local_50 != PTR_DAT_1405d8008)) {
    iVar4 = *(int *)(local_50 + -8);
  }
  if ((iVar3 < iVar4) || (iVar3 = iVar6, local_50 == (undefined *)0x0)) {
LAB_1401fc4b9:
    if (((local_50 != PTR_DAT_1405d8008) && (local_50 != (undefined *)0x0)) &&
       (piVar1 = (int *)(local_50 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar3;
      *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
    }
  }
  else if (local_50 != PTR_DAT_1405d8008) {
    iVar3 = *(int *)(local_50 + -8);
    goto LAB_1401fc4b9;
  }
  FUN_14034fe70();
  local_58 = PTR_DAT_1405d8010;
  iVar6 = FUN_14034fcf0(param_5);
  if ((local_58 != (undefined *)0x0) && (local_58 != PTR_DAT_1405d8010)) {
    iVar10 = *(int *)(local_58 + -8);
  }
  iVar4 = 0;
  iVar3 = iVar6;
  if (((iVar6 <= iVar10) && (iVar3 = iVar4, local_58 != (undefined *)0x0)) &&
     (local_58 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_58 + -8);
  }
  iVar10 = 1;
  if (1 < iVar3) {
    iVar10 = iVar3;
  }
  iVar3 = iVar4;
  if ((local_58 != (undefined *)0x0) && (local_58 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_58 + -8);
  }
  if (iVar3 < iVar10) {
    FUN_140002d30(&local_58);
  }
  FUN_140002e10(&local_58);
  puVar8 = local_58;
  if (local_58 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,param_5,iVar6);
  puVar8 = local_58;
  if (local_58 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar8);
  iVar10 = 0;
  if (0 < iVar6) {
    iVar10 = iVar6;
  }
  iVar6 = iVar4;
  if ((local_58 != (undefined *)0x0) && (local_58 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_58 + -8);
  }
  if ((iVar6 <= iVar10) && (iVar10 = iVar4, local_58 != (undefined *)0x0)) {
    if (local_58 == PTR_DAT_1405d8010) goto LAB_1401fc5d6;
    iVar10 = *(int *)(local_58 + -8);
  }
  if (((local_58 != PTR_DAT_1405d8010) && (local_58 != (undefined *)0x0)) &&
     ((int *)(local_58 + -8) != (int *)0x0)) {
    *(int *)(local_58 + -8) = iVar10;
    *(undefined2 *)(local_58 + (longlong)iVar10 * 2) = 0;
  }
LAB_1401fc5d6:
  plVar9 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  local_res18[0] = (short)param_3;
  (**(code **)(*plVar9 + 0xa80))(plVar9,1,&DAT_1405d85a0,local_res18,param_4,&local_58,&local_50);
  puVar8 = local_58;
  if (((local_58 != (undefined *)0x0) && (local_58 != PTR_DAT_1405d8010)) &&
     (puVar2 = local_58 + -8, puVar2 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_40 = uVar7;
    FUN_14034ed40(uVar7);
    local_38 = 1;
    piVar1 = (int *)(puVar8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar7);
  }
  puVar8 = local_50;
  local_58 = PTR_DAT_1405d8010;
  if (((local_50 != (undefined *)0x0) && (local_50 != PTR_DAT_1405d8008)) &&
     (puVar2 = local_50 + -8, puVar2 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_40 = uVar7;
    FUN_14034ed40(uVar7);
    local_38 = 1;
    piVar1 = (int *)(puVar8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar7);
  }
  return;
}



void FUN_1401fc6e0(longlong param_1,int param_2,int param_3,longlong *param_4)

{
  bool bVar1;
  longlong *plVar2;
  undefined2 local_18 [4];
  undefined8 local_10;
  
  local_10 = 0xfffffffffffffffe;
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if (((DAT_140609440 != '\0') && (-1 < param_3)) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_4 == 0) && (param_4[1] == 0)) {
      bVar1 = false;
    }
    else {
      bVar1 = true;
    }
    if ((bVar1) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      plVar2 = (longlong *)
               (*(longlong *)
                 (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8) + 0x70)
      ;
      local_18[0] = (short)param_3;
      (**(code **)(*plVar2 + 0x210))
                (plVar2,1,&DAT_1405d85a0,local_18,param_4,&stack0x00000028,&stack0x00000030);
    }
  }
  return;
}



void FUN_1401fc7e0(longlong param_1,int param_2,int param_3,longlong *param_4)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [8];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_4 == 0) && (param_4[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x240))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,param_4,&stack0x00000028,&stack0x00000030
                );
    }
  }
  return;
}



void FUN_1401fc880(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  bool bVar5;
  undefined2 local_res10 [4];
  undefined8 local_res18;
  undefined8 local_res20;
  undefined8 uVar6;
  longlong *local_40;
  longlong *local_38;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  uVar6 = 0xfffffffffffffffe;
  if (*(int *)(param_2 + 0x284) < 0) {
    return;
  }
  if ((int)*(short *)(param_1 + 700) <= *(int *)(param_2 + 0x284)) {
    return;
  }
  FUN_140198570(param_2,&local_40);
  plVar1 = local_40;
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if (*local_40 != 0) {
        if (*(longlong *)(param_1 + 0x4c0) != 0) {
          puVar3 = (undefined8 *)(**(code **)(*(longlong *)*local_40 + 0x270))();
          local_res18 = *puVar3;
          local_res10[0] = (undefined2)*(undefined4 *)(param_2 + 0x284);
          plVar4 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                     (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          local_30 = *(undefined4 *)(param_2 + 0x170);
          local_2c = *(undefined4 *)(param_2 + 0x174);
          local_28 = *(undefined4 *)(param_2 + 0x178);
          local_24 = *(undefined4 *)(param_2 + 0x17c);
          (**(code **)(*plVar4 + 0x7a0))
                    (plVar4,1,&DAT_1405d85a0,local_res10,&local_30,&local_res18,uVar6);
        }
        puVar3 = (undefined8 *)(**(code **)(*(longlong *)*plVar1 + 0x270))();
        local_res20 = *puVar3;
        (**(code **)(*(longlong *)(param_1 + 0x78) + 0x880))
                  ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                   &local_res20);
        goto LAB_1401fca10;
      }
    }
    else {
      iVar2 = DAT_14060804c + 1;
      bVar5 = DAT_14060804c == 0;
      DAT_14060804c = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_38) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401fca10:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar3 = (undefined8 *)*local_40;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_40);
  }
  return;
}



void FUN_1401fca40(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined2 local_res10 [4];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  longlong local_58;
  longlong local_50 [2];
  longlong *local_40;
  longlong *local_38;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  local_50[1] = 0xfffffffffffffffe;
  if (*(int *)(param_2 + 0x284) < 0) {
    return;
  }
  if ((int)*(short *)(param_1 + 700) <= *(int *)(param_2 + 0x284)) {
    return;
  }
  FUN_140198570(param_2,&local_40);
  plVar1 = local_40;
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if ((longlong *)*local_40 != (longlong *)0x0) {
        lVar4 = (**(code **)(*(longlong *)*local_40 + 0x270))();
        if (lVar4 != 0) {
          if (*(longlong *)(param_1 + 0x4c0) != 0) {
            local_res18[0] = *(undefined4 *)(lVar4 + 0x10);
            local_res20[0] = *(undefined4 *)(lVar4 + 0xc);
            local_res10[0] = (undefined2)*(undefined4 *)(param_2 + 0x284);
            plVar5 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                       (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            local_30 = *(undefined4 *)(param_2 + 0x170);
            local_2c = *(undefined4 *)(param_2 + 0x174);
            local_28 = *(undefined4 *)(param_2 + 0x178);
            local_24 = *(undefined4 *)(param_2 + 0x17c);
            (**(code **)(*plVar5 + 0x7b0))
                      (plVar5,1,&DAT_1405d85a0,local_res10,&local_30,local_res20,local_res18);
          }
          local_58 = (longlong)*(int *)(lVar4 + 0x10);
          local_50[0] = (longlong)*(int *)(lVar4 + 0xc);
          (**(code **)(*(longlong *)(param_1 + 0x78) + 0x890))
                    ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                     local_50,&local_58);
        }
        goto LAB_1401fcbfb;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_38) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401fcbfb:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar2 = (undefined8 *)*local_40;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_40);
  }
  return;
}



void FUN_1401fcc40(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined2 local_res10 [4];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined8 uVar7;
  longlong *local_40;
  longlong *local_38;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  uVar7 = 0xfffffffffffffffe;
  if (*(int *)(param_2 + 0x284) < 0) {
    return;
  }
  if ((int)*(short *)(param_1 + 700) <= *(int *)(param_2 + 0x284)) {
    return;
  }
  FUN_140198570(param_2,&local_40);
  plVar1 = local_40;
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if (*local_40 != 0) {
        if (*(longlong *)(param_1 + 0x4c0) != 0) {
          lVar4 = (**(code **)(*(longlong *)*local_40 + 0x270))();
          local_res18[0] = *(undefined4 *)(lVar4 + 8);
          local_res10[0] = (undefined2)*(undefined4 *)(param_2 + 0x284);
          plVar5 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                     (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          local_30 = *(undefined4 *)(param_2 + 0x170);
          local_2c = *(undefined4 *)(param_2 + 0x174);
          local_28 = *(undefined4 *)(param_2 + 0x178);
          local_24 = *(undefined4 *)(param_2 + 0x17c);
          (**(code **)(*plVar5 + 0x790))
                    (plVar5,1,&DAT_1405d85a0,local_res10,&local_30,local_res18,uVar7);
        }
        lVar4 = (**(code **)(*(longlong *)*plVar1 + 0x270))();
        local_res20[0] = *(undefined4 *)(lVar4 + 8);
        (**(code **)(*(longlong *)(param_1 + 0x78) + 0x870))
                  ((longlong *)(param_1 + 0x78),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                   local_res20);
        goto LAB_1401fcdce;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_38) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401fcdce:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar2 = (undefined8 *)*local_40;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_40);
  }
  return;
}



void FUN_1401fce00(longlong param_1,int param_2,longlong *param_3,int param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  longlong lVar6;
  longlong lVar7;
  size_t sVar8;
  longlong *plVar9;
  ulonglong uVar10;
  longlong lVar11;
  uint uVar12;
  undefined4 *puVar13;
  wchar_t *pwVar14;
  wchar_t *******_Src;
  void *pvVar15;
  longlong *plVar16;
  ulonglong uVar17;
  bool bVar18;
  char local_res18 [8];
  undefined2 local_588 [4];
  int local_580 [2];
  undefined2 local_578 [4];
  int local_570 [2];
  longlong *local_568;
  longlong *local_560;
  undefined4 local_558;
  undefined4 local_554;
  void *local_550;
  undefined4 local_548 [2];
  undefined4 local_540 [2];
  undefined4 local_538 [2];
  undefined4 local_530 [2];
  undefined4 local_528 [2];
  longlong *local_520;
  longlong *local_518;
  longlong *local_510;
  longlong *local_508;
  undefined4 local_500;
  undefined4 local_4fc;
  undefined4 local_4f8;
  undefined4 local_4f4;
  undefined4 local_4f0;
  undefined4 local_4ec;
  undefined4 local_4e8;
  undefined4 local_4e4;
  undefined4 local_4e0;
  undefined4 uStack_4dc;
  undefined4 local_4d8;
  undefined4 uStack_4d4;
  undefined4 local_4d0;
  undefined4 local_4cc;
  undefined4 local_4c8;
  undefined4 local_4c4;
  undefined4 local_4c0;
  undefined4 local_4bc;
  undefined4 local_4b8;
  undefined4 local_4b4;
  undefined4 local_4b0;
  undefined4 local_4ac;
  undefined4 local_4a8;
  undefined4 local_4a4;
  undefined4 local_4a0;
  undefined4 local_49c;
  undefined4 local_498;
  undefined4 local_494;
  undefined4 *local_490;
  longlong local_488;
  undefined8 local_480;
  undefined8 local_470;
  undefined1 local_468;
  undefined7 uStack_467;
  undefined8 local_458;
  ulonglong local_450;
  undefined8 local_440;
  undefined8 local_438;
  wchar_t ******local_430 [3];
  ulonglong local_418;
  longlong local_408;
  undefined1 local_400;
  undefined8 local_3f8;
  undefined4 local_3e8;
  undefined4 local_3e4;
  undefined4 local_3e0;
  undefined4 local_3dc;
  undefined4 local_3d8;
  undefined4 local_3d4;
  undefined4 local_3d0;
  undefined4 local_3cc;
  undefined4 local_3c8;
  undefined4 local_3c4;
  wchar_t local_3c0 [50];
  undefined2 local_35c;
  wchar_t local_35a [16];
  undefined4 local_33a;
  undefined4 local_336;
  undefined4 local_332;
  undefined4 local_32e;
  undefined4 local_32a;
  wchar_t local_326 [16];
  undefined4 local_306;
  undefined4 local_302;
  undefined4 local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  undefined4 local_2ec;
  undefined4 local_2e8;
  undefined4 local_2e4;
  undefined4 local_2e0;
  undefined4 local_2dc;
  undefined4 local_2d8;
  undefined4 local_2cc;
  undefined4 local_2c8;
  wchar_t local_2c4 [15];
  undefined2 local_2a6;
  wchar_t local_2a4 [49];
  undefined2 local_242;
  WCHAR local_238;
  undefined1 local_236 [526];
  
  local_3f8 = 0xfffffffffffffffe;
  local_580[0] = 0;
  local_570[0] = 0;
  if (*(int *)((longlong)param_3 + 0x284) < 0) {
    return;
  }
  if ((int)*(short *)(param_1 + 700) <= *(int *)((longlong)param_3 + 0x284)) {
    return;
  }
  if (param_4 < 1) {
    return;
  }
  FUN_140198570(param_3,&local_520);
  plVar16 = local_520;
  if (local_520 != (longlong *)0x0) {
    if (local_520 == local_518) {
      if (*local_520 != 0) {
        uVar5 = FUN_1402f8580();
        local_550 = (void *)CONCAT44(local_550._4_4_,uVar5);
        local_490 = (undefined4 *)0x0;
        local_488 = 0;
        local_480 = 0;
        lVar6 = FUN_1401e0840();
        lVar7 = lVar6 + 0xf8;
        local_408 = lVar7;
        FUN_14034ed40(lVar7);
        local_400 = 1;
        FUN_14012bb70(&local_490,lVar6 + 0x68);
        FUN_14034edd0(lVar7);
        local_res18[0] = '\0';
        lVar7 = (**(code **)(*(longlong *)*plVar16 + 0x270))();
        cVar3 = FUN_14031aba0(lVar7,param_4 + local_570[0] + local_580[0],local_res18,
                              (char)param_3[0xbb]);
        if (cVar3 == '\0') {
          *(undefined4 *)(*plVar16 + 0x2140) = 1;
          if (local_res18[0] != '\0') {
            *(undefined4 *)(*plVar16 + 0x2160) = 1;
          }
          local_540[0] = *(undefined4 *)(lVar7 + 0x6c);
          local_438 = *(undefined8 *)(lVar7 + 0x60);
          (**(code **)(*(longlong *)(param_1 + 0x78) + 0xa0))
                    ((longlong *)(param_1 + 0x78),(int)param_3[1],&DAT_1405d85a0,param_3 + 1,
                     &local_438,local_570,local_540,local_580);
          lVar7 = local_488;
        }
        else {
          FUN_1402f81e0(*plVar16,*(undefined4 *)(lVar7 + 0x5c));
          local_530[0] = *(undefined4 *)(lVar7 + 0x6c);
          local_470 = *(undefined8 *)(lVar7 + 0x60);
          local_554 = *(undefined4 *)(lVar7 + 0x5c);
          if (param_2 == 0) {
            param_2 = (int)param_3[1];
          }
          (**(code **)(*(longlong *)(param_1 + 0x78) + 0x90))
                    ((longlong *)(param_1 + 0x78),param_2,&DAT_1405d85a0,param_3 + 1,&local_554,
                     &local_470,local_530,local_570,local_580);
          local_538[0] = *(undefined4 *)(lVar7 + 0x70);
          local_548[0] = *(undefined4 *)(lVar7 + 0x6c);
          local_440 = *(undefined8 *)(lVar7 + 0x60);
          local_528[0] = *(undefined4 *)(lVar7 + 0x5c);
          local_4c0 = (undefined4)param_3[0x2e];
          local_4bc = *(undefined4 *)((longlong)param_3 + 0x174);
          local_4b8 = (undefined4)param_3[0x2f];
          local_4b4 = *(undefined4 *)((longlong)param_3 + 0x17c);
          iVar4 = *(int *)((longlong)param_3 + 0x284);
          if (((-1 < iVar4) && (iVar4 < *(short *)(param_1 + 700))) &&
             (*(longlong *)(param_1 + 0x4c0) != 0)) {
            local_578[0] = (undefined2)iVar4;
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                       (longlong)(int)param_3[0x51] * 8) + 0x70);
            (**(code **)(*plVar9 + 0x220))
                      (plVar9,1,&DAT_1405d85a0,local_578,&local_4c0,local_528,&local_440,local_548,
                       local_538);
          }
          FUN_140057eb0(&local_2f8);
          local_2f8 = *(undefined4 *)(DAT_140608000 + 0x140);
          local_2f4 = (undefined4)param_3[0x2c];
          local_2f0 = *(undefined4 *)((longlong)param_3 + 0x164);
          local_2ec = (undefined4)param_3[0x2d];
          local_2e8 = *(undefined4 *)((longlong)param_3 + 0x16c);
          local_2e4 = (undefined4)param_3[0x2e];
          local_2e0 = *(undefined4 *)((longlong)param_3 + 0x174);
          local_2dc = (undefined4)param_3[0x2f];
          local_2d8 = *(undefined4 *)((longlong)param_3 + 0x17c);
          local_2cc = *(undefined4 *)(*plVar16 + 0x120);
          local_2c8 = FUN_1402f8580();
          local_450 = 0xf;
          local_458 = 0;
          local_468 = 0;
          uVar10 = 0xffffffffffffffff;
          plVar9 = param_3 + 0x66;
          do {
            if (uVar10 == 0) break;
            uVar10 = uVar10 - 1;
            lVar6 = *plVar9;
            plVar9 = (longlong *)((longlong)plVar9 + 1);
          } while ((char)lVar6 != '\0');
          FUN_140003e50(&local_468,param_3 + 0x66,~uVar10 - 1);
          FUN_140415310(local_430,&local_468);
          if (0xf < local_450) {
            operator_delete((void *)CONCAT71(uStack_467,local_468));
          }
          local_450 = 0xf;
          bVar18 = false;
          local_458 = 0;
          local_468 = 0;
          pwVar14 = (wchar_t *)(*plVar16 + 0xd0);
          if (7 < *(ulonglong *)(*plVar16 + 0xe8)) {
            pwVar14 = *(wchar_t **)pwVar14;
          }
          wcscpy_s(local_2c4,0x10,pwVar14);
          _Src = local_430;
          if (7 < local_418) {
            _Src = (wchar_t *******)local_430[0];
          }
          wcscpy_s(local_2a4,0x32,(wchar_t *)_Src);
          local_2a6 = 0;
          local_242 = 0;
          FUN_1401fe4a0(param_1,(int)param_3[0x51],*(undefined4 *)((longlong)param_3 + 0x284),
                        &local_2f8);
          if (7 < local_418) {
            operator_delete(local_430[0]);
          }
          *(undefined4 *)(*plVar16 + 0x2140) = 0;
          FUN_1401a6820(param_3,*(undefined4 *)(lVar7 + 0x5c));
          local_4e0 = *(undefined4 *)((longlong)param_3 + 0x194);
          uStack_4dc = (undefined4)param_3[0x33];
          local_4d8 = *(undefined4 *)((longlong)param_3 + 0x19c);
          uStack_4d4 = (undefined4)param_3[0x34];
          if ((*(longlong *)((longlong)param_3 + 0x194) != 0) ||
             (*(longlong *)((longlong)param_3 + 0x19c) != 0)) {
            bVar18 = true;
          }
          if (!bVar18) goto LAB_1401fd57c;
          if (*(int *)(param_1 + 0x528) == 0) {
            local_4fc = (undefined4)param_3[0x33];
            local_4f8 = *(undefined4 *)((longlong)param_3 + 0x19c);
            local_4f4 = (undefined4)param_3[0x34];
            local_500 = *(undefined4 *)((longlong)param_3 + 0x194);
            FUN_1401e6310(DAT_140608080,&local_568,&local_500);
            plVar9 = local_568;
            if (local_568 != (longlong *)0x0) {
              if (local_568 == local_560) {
                if ((*local_568 != 0) &&
                   (lVar6 = FUN_140188c00(param_1,*(undefined4 *)(*local_568 + 0x3c)), lVar6 != 0))
                {
                  local_558 = FUN_1402f8580(*plVar16);
                  local_4f0 = (undefined4)param_3[0x2e];
                  local_4ec = *(undefined4 *)((longlong)param_3 + 0x174);
                  local_4e8 = (undefined4)param_3[0x2f];
                  local_4e4 = *(undefined4 *)((longlong)param_3 + 0x17c);
                  if (local_568 == (longlong *)0x0) {
LAB_1401fd4cd:
                    lVar11 = 0;
                  }
                  else {
                    if (local_568 != local_560) {
                      iVar4 = DAT_140608088 + 1;
                      bVar18 = DAT_140608088 == 0;
                      DAT_140608088 = iVar4;
                      if (bVar18) {
                        FUN_140176d60();
                      }
                      goto LAB_1401fd4cd;
                    }
                    lVar11 = *local_568;
                  }
                  local_4a0 = *(undefined4 *)(lVar11 + 0x28);
                  local_49c = *(undefined4 *)(lVar11 + 0x2c);
                  local_498 = *(undefined4 *)(lVar11 + 0x30);
                  local_494 = *(undefined4 *)(lVar11 + 0x34);
                  (**(code **)(*(longlong *)(lVar6 + 0x78) + 0x140))
                            ((longlong *)(lVar6 + 0x78),1,&DAT_1405d85a0,&local_4a0,&local_4f0,
                             &local_558);
                  plVar9 = local_568;
                }
              }
              else {
                iVar4 = DAT_140608088 + 1;
                bVar18 = DAT_140608088 == 0;
                DAT_140608088 = iVar4;
                if (bVar18) {
                  FUN_140176d60(1);
                  plVar9 = local_568;
                }
              }
            }
            if (plVar9 != (longlong *)0x0) {
              if (plVar9 == local_560) {
                if (plVar9 != (longlong *)0x0) {
                  LOCK();
                  plVar1 = plVar9 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  plVar16 = local_520;
                  if ((int)*plVar1 == 0) {
                    local_568 = (longlong *)0x0;
                    pvVar15 = (void *)*plVar9;
                    if (pvVar15 != (void *)0x0) {
                      FUN_1402160c0(pvVar15);
                      goto LAB_1401fd3be;
                    }
                    goto LAB_1401fd3c7;
                  }
                }
              }
              else {
                iVar4 = DAT_14060808c + 1;
                bVar18 = DAT_14060808c == 0;
                DAT_14060808c = iVar4;
                if (bVar18) {
                  FUN_140176d60(1);
                }
              }
            }
          }
          else {
            local_4cc = (undefined4)param_3[0x33];
            local_4c8 = *(undefined4 *)((longlong)param_3 + 0x19c);
            local_4c4 = (undefined4)param_3[0x34];
            local_4d0 = *(undefined4 *)((longlong)param_3 + 0x194);
            FUN_1401e6200(DAT_1406080a0,&local_510,&local_4d0);
            if (local_510 != (longlong *)0x0) {
              if (local_510 == local_508) {
                if (*local_510 != 0) {
                  local_4b0 = (undefined4)param_3[0x2e];
                  local_4ac = *(undefined4 *)((longlong)param_3 + 0x174);
                  local_4a8 = (undefined4)param_3[0x2f];
                  local_4a4 = *(undefined4 *)((longlong)param_3 + 0x17c);
                  lVar6 = *local_510;
                  uVar5 = FUN_1402f8580(*plVar16);
                  FUN_140215e80(lVar6,&local_4b0,uVar5);
                }
              }
              else {
                iVar4 = DAT_140608090 + 1;
                bVar18 = DAT_140608090 == 0;
                DAT_140608090 = iVar4;
                if (bVar18) {
                  FUN_140176d60();
                }
              }
            }
            plVar9 = local_510;
            if (local_510 != (longlong *)0x0) {
              if (local_510 == local_508) {
                if (local_510 != (longlong *)0x0) {
                  LOCK();
                  plVar1 = local_510 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  plVar16 = local_520;
                  if ((int)*plVar1 == 0) {
                    local_510 = (longlong *)0x0;
                    pvVar15 = (void *)*plVar9;
                    if (pvVar15 != (void *)0x0) {
                      FUN_140215c80(pvVar15);
LAB_1401fd3be:
                      operator_delete(pvVar15);
                    }
LAB_1401fd3c7:
                    operator_delete(plVar9);
                    plVar16 = local_520;
                  }
                }
              }
              else {
                iVar4 = DAT_140608094 + 1;
                bVar18 = DAT_140608094 == 0;
                DAT_140608094 = iVar4;
                if (bVar18) {
                  FUN_140176d60(1);
                }
              }
            }
          }
LAB_1401fd57c:
          FUN_140057d80(&local_3e8);
          local_3e8 = 0x1f6;
          local_3e4 = *(undefined4 *)(DAT_140608000 + 0x140);
          local_3e0 = (undefined4)param_3[0x2c];
          local_3dc = *(undefined4 *)((longlong)param_3 + 0x164);
          local_3d8 = (undefined4)param_3[0x2d];
          local_3d4 = *(undefined4 *)((longlong)param_3 + 0x16c);
          local_3d0 = (undefined4)param_3[0x2e];
          local_3cc = *(undefined4 *)((longlong)param_3 + 0x174);
          local_3c8 = (undefined4)param_3[0x2f];
          local_3c4 = *(undefined4 *)((longlong)param_3 + 0x17c);
          local_33a = FUN_1401a64a0(param_3);
          local_336 = FUN_1401a6390(param_3);
          local_332 = FUN_1401a6310(param_3);
          local_32a = FUN_1401978f0(param_3);
          local_306 = FUN_1401a6390(param_3);
          local_302 = local_550._0_4_;
          local_35c = (**(code **)(*param_3 + 0x18))(param_3);
          local_32e = *(undefined4 *)(lVar7 + 0xc4);
          pwVar14 = (wchar_t *)FUN_1401a6410(param_3);
          sVar8 = wcsnlen(pwVar14,0x10);
          if (sVar8 < 0x10) {
            pwVar14 = (wchar_t *)FUN_1401a6410(param_3);
            wcscpy_s(local_35a,0x10,pwVar14);
            pwVar14 = (wchar_t *)FUN_1401a6410(param_3);
            wcscpy_s(local_326,0x10,pwVar14);
          }
          local_238 = L'\0';
          memset(local_236,0,0x206);
          MultiByteToWideChar(0,1,(LPCSTR)(param_3 + 0x66),0x32,&local_238,0x32);
          sVar8 = wcsnlen(&local_238,0x10);
          if (sVar8 < 0x10) {
            wcscpy_s(local_3c0,0x32,&local_238);
          }
          iVar4 = *(int *)((longlong)param_3 + 0x284);
          if (((-1 < iVar4) && (iVar4 < *(short *)(param_1 + 700))) &&
             (*(longlong *)(param_1 + 0x4c8) != 0)) {
            local_588[0] = (undefined2)iVar4;
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) +
                       (longlong)(int)param_3[0x51] * 8) + 0x70);
            (**(code **)(*plVar9 + 0xc70))(plVar9,1,&DAT_1405d85a0,local_588,&local_3e8);
          }
          lVar7 = local_488;
          uVar10 = 0;
          uVar17 = local_488 - (longlong)local_490 >> 2;
          if (uVar17 != 0) {
            puVar13 = local_490;
            do {
              lVar6 = DAT_140607cc0;
              if ((DAT_140607cc0 == 0) &&
                 (local_550 = operator_new(0x130), lVar6 = 0, local_550 != (void *)0x0)) {
                lVar6 = FUN_1401e04e0(local_550);
              }
              DAT_140607cc0 = lVar6;
              FUN_1401e17f0(DAT_140607cc0,*puVar13,param_3);
              uVar10 = (ulonglong)((int)uVar10 + 1);
              puVar13 = puVar13 + 1;
            } while (uVar10 < uVar17);
          }
        }
        uVar12 = 0;
        uVar10 = lVar7 - (longlong)local_490 >> 2;
        if (uVar10 != 0) {
          puVar13 = local_490;
          do {
            lVar7 = DAT_140607cc0;
            if ((DAT_140607cc0 == 0) &&
               (local_550 = operator_new(0x130), lVar7 = 0, local_550 != (void *)0x0)) {
              lVar7 = FUN_1401e04e0(local_550);
            }
            DAT_140607cc0 = lVar7;
            FUN_1401e0d80(DAT_140607cc0,*puVar13,param_3);
            uVar12 = uVar12 + 1;
            puVar13 = puVar13 + 1;
          } while (uVar12 < uVar10);
        }
        if (local_490 != (undefined4 *)0x0) {
          operator_delete(local_490);
        }
        LOCK();
        plVar16 = plVar16 + 1;
        lVar7 = *plVar16;
        *(int *)plVar16 = (int)*plVar16 + -1;
        UNLOCK();
        iVar4 = (int)lVar7 + -1;
        goto LAB_1401fd94a;
      }
    }
    else {
      iVar4 = DAT_14060804c + 1;
      bVar18 = DAT_14060804c == 0;
      DAT_14060804c = iVar4;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar16 == (longlong *)0x0) {
    return;
  }
  if (plVar16 != local_518) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
  LOCK();
  plVar16 = plVar16 + 1;
  *(int *)plVar16 = (int)*plVar16 + -1;
  iVar4 = (int)*plVar16;
  UNLOCK();
LAB_1401fd94a:
  if (iVar4 == 0) {
    puVar2 = (undefined8 *)*local_520;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_520);
  }
  return;
}



void FUN_1401fd990(longlong param_1,int param_2,int param_3,undefined4 param_4,undefined8 param_5)

{
  longlong lVar1;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined2 local_18;
  undefined2 local_16;
  undefined2 local_14;
  undefined2 local_12 [9];
  
  if (((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) &&
     (*(longlong *)(param_1 + 0x4c0) != 0)) {
    local_12[0] = (undefined2)param_3;
    local_14 = 0xe;
    local_res18[0] = 1;
    local_18 = 1;
    local_16 = 1;
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
    ;
    local_res20[0] = param_4;
    (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x440))
              (lVar1 + 0x70,1,&DAT_1405d85a0,local_12,local_res20,param_5,&stack0x00000030,&local_14
               ,&local_16,&local_18,local_res18);
  }
  return;
}



void FUN_1401fda70(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5,
                  undefined8 param_6,undefined8 param_7)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined8 uVar8;
  undefined *puVar9;
  longlong *plVar10;
  int iVar11;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined *local_68;
  undefined *local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined1 local_48;
  
  if (param_3 < 0) {
    return;
  }
  local_58 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  iVar11 = 0;
  iVar7 = 0;
  if ((*param_5 != 0) || (iVar6 = iVar7, param_5[1] != 0)) {
    iVar6 = 1;
  }
  if (iVar6 == 0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  local_res20[0] = param_4;
  FUN_14034fe70();
  local_60 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_7);
  iVar6 = iVar7;
  if ((local_60 != (undefined *)0x0) && (local_60 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_60 + -8);
  }
  iVar4 = 0;
  iVar5 = iVar3;
  if (((iVar3 <= iVar6) && (iVar5 = iVar7, local_60 != (undefined *)0x0)) &&
     (iVar5 = iVar4, local_60 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_60 + -8);
  }
  iVar7 = 1;
  if (1 < iVar5) {
    iVar7 = iVar5;
  }
  iVar6 = iVar4;
  if ((local_60 != (undefined *)0x0) && (local_60 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_60 + -8);
  }
  if (iVar6 < iVar7) {
    FUN_140002d30(&local_60);
  }
  FUN_140002e10(&local_60);
  puVar9 = local_60;
  if (local_60 == (undefined *)0x0) {
    puVar9 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar9,param_7,iVar3);
  puVar9 = local_60;
  if (local_60 == (undefined *)0x0) {
    puVar9 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar9);
  iVar7 = iVar11;
  if (0 < iVar6) {
    iVar7 = iVar6;
  }
  iVar6 = iVar11;
  if ((local_60 != (undefined *)0x0) && (iVar6 = 0, local_60 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_60 + -8);
  }
  if ((iVar7 < iVar6) || (iVar7 = iVar11, local_60 == (undefined *)0x0)) {
LAB_1401fdbdb:
    if (((local_60 != PTR_DAT_1405d8010) && (local_60 != (undefined *)0x0)) &&
       ((int *)(local_60 + -8) != (int *)0x0)) {
      *(int *)(local_60 + -8) = iVar7;
      *(undefined2 *)(local_60 + (longlong)iVar7 * 2) = 0;
    }
  }
  else if (local_60 != PTR_DAT_1405d8010) {
    iVar7 = *(int *)(local_60 + -8);
    goto LAB_1401fdbdb;
  }
  FUN_14034fe70();
  local_68 = PTR_DAT_1405d8010;
  iVar7 = FUN_14034fcf0(param_6);
  iVar11 = iVar4;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar11 = *(int *)(local_68 + -8);
  }
  iVar6 = iVar7;
  if (((iVar7 <= iVar11) && (iVar6 = iVar4, local_68 != (undefined *)0x0)) &&
     (local_68 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_68 + -8);
  }
  iVar11 = 1;
  if (1 < iVar6) {
    iVar11 = iVar6;
  }
  iVar3 = 0;
  iVar6 = iVar3;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_68 + -8);
  }
  if (iVar6 < iVar11) {
    FUN_140002d30(&local_68);
  }
  FUN_140002e10(&local_68);
  puVar9 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar9 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar9,param_6,iVar7);
  puVar9 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar9 = PTR_DAT_1405d8010;
  }
  iVar7 = FUN_14034fcf0(puVar9);
  iVar11 = 0;
  if (0 < iVar7) {
    iVar11 = iVar7;
  }
  iVar7 = iVar3;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_68 + -8);
  }
  if ((iVar7 <= iVar11) && (iVar11 = iVar3, local_68 != (undefined *)0x0)) {
    if (local_68 == PTR_DAT_1405d8010) goto LAB_1401fdcf9;
    iVar11 = *(int *)(local_68 + -8);
  }
  if (((local_68 != PTR_DAT_1405d8010) && (local_68 != (undefined *)0x0)) &&
     ((int *)(local_68 + -8) != (int *)0x0)) {
    *(int *)(local_68 + -8) = iVar11;
    *(undefined2 *)(local_68 + (longlong)iVar11 * 2) = 0;
  }
LAB_1401fdcf9:
  local_res18[0] = (undefined2)param_3;
  plVar10 = (longlong *)
            (*(longlong *)
              (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8) + 0x70);
  (**(code **)(*plVar10 + 0x410))
            (plVar10,1,&DAT_1405d85a0,local_res18,local_res20,param_5,&local_68,&local_60);
  puVar9 = local_68;
  if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_68 + -8, puVar1 != (undefined *)0x0)) {
    uVar8 = FUN_14034fe70();
    local_50 = uVar8;
    FUN_14034ed40(uVar8);
    local_48 = 1;
    piVar2 = (int *)(puVar9 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar8);
  }
  puVar9 = local_60;
  if (((local_60 != (undefined *)0x0) && (local_60 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_60 + -8, puVar1 != (undefined *)0x0)) {
    local_68 = PTR_DAT_1405d8010;
    uVar8 = FUN_14034fe70();
    local_50 = uVar8;
    FUN_14034ed40(uVar8);
    local_48 = 1;
    piVar2 = (int *)(puVar9 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar8);
  }
  return;
}



void FUN_1401fde00(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5,
                  longlong *param_6)

{
  longlong lVar1;
  bool bVar2;
  bool bVar3;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    bVar3 = false;
    if ((*param_5 != 0) || (bVar2 = bVar3, param_5[1] != 0)) {
      bVar2 = true;
    }
    if (bVar2) {
      if ((*param_6 != 0) || (param_6[1] != 0)) {
        bVar3 = true;
      }
      if ((bVar3) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
        local_res18[0] = (undefined2)param_3;
        lVar1 = *(longlong *)
                 (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
        local_res20[0] = param_4;
        (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x420))
                  (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,param_5,param_6);
      }
    }
  }
  return;
}



void FUN_1401fdee0(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5,
                  longlong *param_6,undefined8 param_7)

{
  undefined *puVar1;
  int *piVar2;
  bool bVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  longlong *plVar9;
  int iVar10;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  
  if (param_3 < 0) {
    return;
  }
  local_40 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  bVar3 = false;
  iVar10 = 0;
  if ((*param_5 != 0) || (param_5[1] != 0)) {
    bVar3 = true;
  }
  if (!bVar3) {
    return;
  }
  if ((*param_6 != 0) || (iVar6 = iVar10, param_6[1] != 0)) {
    iVar6 = 1;
  }
  if (iVar6 == 0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  local_res20[0] = param_4;
  FUN_14034fe70();
  local_48 = PTR_DAT_1405d8010;
  iVar4 = FUN_14034fcf0(param_7);
  iVar6 = iVar10;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  iVar5 = iVar4;
  if (((iVar4 <= iVar6) && (iVar5 = iVar10, local_48 != (undefined *)0x0)) &&
     (local_48 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_48 + -8);
  }
  iVar10 = 1;
  if (1 < iVar5) {
    iVar10 = iVar5;
  }
  iVar5 = 0;
  iVar6 = iVar5;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  if (iVar6 < iVar10) {
    FUN_140002d30(&local_48);
  }
  FUN_140002e10(&local_48);
  puVar8 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,param_7,iVar4);
  puVar8 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar8);
  iVar10 = 0;
  if (0 < iVar6) {
    iVar10 = iVar6;
  }
  iVar6 = iVar5;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  if ((iVar6 <= iVar10) && (iVar10 = iVar5, local_48 != (undefined *)0x0)) {
    if (local_48 == PTR_DAT_1405d8010) goto LAB_1401fe0a6;
    iVar10 = *(int *)(local_48 + -8);
  }
  if (((local_48 != PTR_DAT_1405d8010) && (local_48 != (undefined *)0x0)) &&
     ((int *)(local_48 + -8) != (int *)0x0)) {
    *(int *)(local_48 + -8) = iVar10;
    *(undefined2 *)(local_48 + (longlong)iVar10 * 2) = 0;
  }
LAB_1401fe0a6:
  local_res18[0] = (undefined2)param_3;
  plVar9 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  (**(code **)(*plVar9 + 0x430))
            (plVar9,1,&DAT_1405d85a0,local_res18,local_res20,param_5,param_6,&local_48);
  puVar8 = local_48;
  if (((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_48 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_38 = uVar7;
    FUN_14034ed40(uVar7);
    local_30 = 1;
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  return;
}



void FUN_1401fe170(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5,
                  undefined8 param_6)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  longlong *plVar9;
  int iVar10;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  
  if (param_3 < 0) {
    return;
  }
  local_40 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  iVar10 = 0;
  if ((*param_5 != 0) || (iVar6 = iVar10, param_5[1] != 0)) {
    iVar6 = 1;
  }
  if (iVar6 == 0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  local_res20[0] = param_4;
  FUN_14034fe70();
  local_48 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_6);
  iVar6 = iVar10;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  iVar4 = 0;
  iVar5 = iVar3;
  if (((iVar3 <= iVar6) && (iVar5 = iVar10, local_48 != (undefined *)0x0)) &&
     (iVar5 = iVar4, local_48 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_48 + -8);
  }
  iVar10 = 1;
  if (1 < iVar5) {
    iVar10 = iVar5;
  }
  iVar6 = iVar4;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  if (iVar6 < iVar10) {
    FUN_140002d30(&local_48);
  }
  FUN_140002e10(&local_48);
  puVar8 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,param_6,iVar3);
  puVar8 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar8);
  iVar10 = 0;
  if (0 < iVar6) {
    iVar10 = iVar6;
  }
  iVar6 = iVar4;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  if ((iVar6 <= iVar10) && (iVar10 = iVar4, local_48 != (undefined *)0x0)) {
    if (local_48 == PTR_DAT_1405d8010) goto LAB_1401fe306;
    iVar10 = *(int *)(local_48 + -8);
  }
  if (((local_48 != PTR_DAT_1405d8010) && (local_48 != (undefined *)0x0)) &&
     ((int *)(local_48 + -8) != (int *)0x0)) {
    *(int *)(local_48 + -8) = iVar10;
    *(undefined2 *)(local_48 + (longlong)iVar10 * 2) = 0;
  }
LAB_1401fe306:
  plVar9 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  local_res18[0] = (short)param_3;
  (**(code **)(*plVar9 + 0x3f0))(plVar9,1,&DAT_1405d85a0,local_res18,local_res20,param_5,&local_48);
  puVar8 = local_48;
  if (((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_48 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_38 = uVar7;
    FUN_14034ed40(uVar7);
    local_30 = 1;
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  return;
}



void FUN_1401fe3c0(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5,
                  longlong *param_6)

{
  longlong lVar1;
  bool bVar2;
  bool bVar3;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    bVar3 = false;
    if ((*param_5 != 0) || (bVar2 = bVar3, param_5[1] != 0)) {
      bVar2 = true;
    }
    if (bVar2) {
      if ((*param_6 != 0) || (param_6[1] != 0)) {
        bVar3 = true;
      }
      if ((bVar3) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
        local_res18[0] = (undefined2)param_3;
        lVar1 = *(longlong *)
                 (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
        local_res20[0] = param_4;
        (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x400))
                  (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,param_5,param_6);
      }
    }
  }
  return;
}



void FUN_1401fe4a0(longlong param_1,int param_2,int param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined2 local_res18 [4];
  
  if (-1 < param_3) {
    if (param_3 < *(short *)(param_1 + 700)) {
      if ((DAT_14060b7cc & 1) == 0) {
        DAT_14060b7cc = DAT_14060b7cc | 1;
        FUN_1402d5c80();
        atexit((_func_5014 *)&DAT_140448e50);
      }
      if ((DAT_140608718 != 0) && (*(longlong *)(param_1 + 0x4c8) != 0)) {
        plVar1 = (longlong *)
                 (*(longlong *)
                   (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)param_2 * 8) +
                 0x70);
        local_res18[0] = (short)param_3;
        (**(code **)(*plVar1 + 0x610))(plVar1,1,&DAT_1405d85a0,local_res18,param_4);
      }
    }
  }
  return;
}



void FUN_1401fe560(longlong param_1,int param_2,int param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined2 local_res18 [4];
  undefined2 local_18 [4];
  undefined8 local_10;
  
  if (-1 < param_3) {
    local_10 = 0xfffffffffffffffe;
    if (param_3 < *(short *)(param_1 + 700)) {
      if ((DAT_14060b7cc & 1) == 0) {
        DAT_14060b7cc = DAT_14060b7cc | 1;
        FUN_1402d5c80();
        atexit((_func_5014 *)&DAT_140448e50);
      }
      if ((DAT_14060872c != 0) && (*(longlong *)(param_1 + 0x4c8) != 0)) {
        local_res18[0] = *(undefined2 *)(DAT_140608000 + 0x140);
        plVar1 = (longlong *)
                 (*(longlong *)
                   (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)param_2 * 8) +
                 0x70);
        local_18[0] = (short)param_3;
        (**(code **)(*plVar1 + 0x640))(plVar1,1,&DAT_1405d85a0,local_18,local_res18,param_4);
      }
    }
  }
  return;
}



void FUN_1401fe640(longlong param_1,int param_2,int param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined2 local_res18 [4];
  undefined2 local_18 [4];
  undefined8 local_10;
  
  if (-1 < param_3) {
    local_10 = 0xfffffffffffffffe;
    if (param_3 < *(short *)(param_1 + 700)) {
      if ((DAT_14060b7cc & 1) == 0) {
        DAT_14060b7cc = DAT_14060b7cc | 1;
        FUN_1402d5c80();
        atexit((_func_5014 *)&DAT_140448e50);
      }
      if ((DAT_140608734 != 0) && (*(longlong *)(param_1 + 0x4c8) != 0)) {
        local_res18[0] = *(undefined2 *)(DAT_140608000 + 0x140);
        plVar1 = (longlong *)
                 (*(longlong *)
                   (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)param_2 * 8) +
                 0x70);
        local_18[0] = (short)param_3;
        (**(code **)(*plVar1 + 0xa40))(plVar1,1,&DAT_1405d85a0,local_18,local_res18,param_4);
      }
    }
  }
  return;
}



void FUN_1401fe720(longlong param_1,int param_2,int param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined2 local_res18 [4];
  undefined2 local_18 [4];
  undefined8 local_10;
  
  if (-1 < param_3) {
    local_10 = 0xfffffffffffffffe;
    if (param_3 < *(short *)(param_1 + 700)) {
      if ((DAT_14060b7cc & 1) == 0) {
        DAT_14060b7cc = DAT_14060b7cc | 1;
        FUN_1402d5c80();
        atexit((_func_5014 *)&DAT_140448e50);
      }
      if ((DAT_140608730 != 0) && (*(longlong *)(param_1 + 0x4c8) != 0)) {
        local_res18[0] = *(undefined2 *)(DAT_140608000 + 0x140);
        plVar1 = (longlong *)
                 (*(longlong *)
                   (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)param_2 * 8) +
                 0x70);
        local_18[0] = (short)param_3;
        (**(code **)(*plVar1 + 0x650))(plVar1,1,&DAT_1405d85a0,local_18,local_res18,param_4);
      }
    }
  }
  return;
}



void FUN_1401fe800(longlong param_1,int param_2,int param_3,undefined8 param_4,undefined8 param_5,
                  undefined8 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  longlong *plVar7;
  int iVar8;
  undefined2 local_res18 [8];
  undefined *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  
  if (param_3 < 0) {
    return;
  }
  local_40 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  FUN_14034fe70();
  local_48 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_8);
  iVar8 = 0;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_48 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_48 != (undefined *)0x0)) &&
     (local_48 != PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar4 = *(int *)(local_48 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_48);
  }
  FUN_140002e10(&local_48);
  puVar6 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_8,iVar3);
  puVar6 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_48 != (undefined *)0x0) && (iVar3 = 0, local_48 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_48 + -8);
  }
  if ((iVar3 <= iVar8) && (iVar8 = 0, local_48 != (undefined *)0x0)) {
    if (local_48 == PTR_DAT_1405d8010) goto LAB_1401fe95a;
    iVar8 = *(int *)(local_48 + -8);
  }
  if (((local_48 != PTR_DAT_1405d8010) && (local_48 != (undefined *)0x0)) &&
     ((int *)(local_48 + -8) != (int *)0x0)) {
    *(int *)(local_48 + -8) = iVar8;
    *(undefined2 *)(local_48 + (longlong)iVar8 * 2) = 0;
  }
LAB_1401fe95a:
  plVar7 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  local_res18[0] = (short)param_3;
  (**(code **)(*plVar7 + 0x710))
            (plVar7,1,&DAT_1405d85a0,local_res18,param_4,param_5,param_6,&param_7,&local_48,
             &stack0x00000048,&stack0x00000050,&stack0x00000058,&stack0x00000060,&stack0x00000068,
             &stack0x00000070,&stack0x00000078,&stack0x00000080,&stack0x00000088,&stack0x00000090,
             &stack0x00000098,&stack0x000000a0,&stack0x000000a8,&stack0x000000b0,&stack0x000000b8,
             &stack0x000000c0,&stack0x000000c8,&stack0x000000d0,&stack0x000000d8,&stack0x000000e0,
             &stack0x000000e8);
  puVar6 = local_48;
  if (((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_48 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    local_38 = uVar5;
    FUN_14034ed40(uVar5);
    local_30 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_1401feb20(longlong param_1,int param_2,int param_3,undefined8 param_4,undefined8 param_5,
                  undefined8 param_6,undefined8 param_7,undefined2 param_8)

{
  longlong lVar1;
  undefined2 local_res18 [8];
  undefined2 local_18 [4];
  undefined8 local_10;
  
  if (((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) &&
     (*(longlong *)(param_1 + 0x4c0) != 0)) {
    local_18[0] = (undefined2)param_3;
    local_res18[0] = param_8;
    local_10 = param_7;
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
    ;
    (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x720))
              (lVar1 + 0x70,1,&DAT_1405d85a0,local_18,param_4,param_5,&param_6,&local_10,local_res18
               ,&stack0x00000048,&stack0x00000050,&stack0x00000058,&stack0x00000060,&stack0x00000068
               ,&stack0x00000070,&stack0x00000078,&stack0x00000080,&stack0x00000088,&stack0x00000090
               ,&stack0x00000098,&stack0x000000a0,&stack0x000000a8,&stack0x000000b0,&stack0x000000b8
               ,&stack0x000000c0,&stack0x000000c8,&stack0x000000d0,&stack0x000000d8);
  }
  return;
}



void FUN_1401fec90(longlong param_1,longlong param_2,longlong *param_3,int param_4)

{
  char cVar1;
  int iVar2;
  float fVar3;
  char cVar4;
  char cVar5;
  int iVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  longlong lVar9;
  longlong lVar10;
  undefined8 uVar11;
  longlong *plVar12;
  longlong *plVar13;
  longlong *plVar14;
  bool bVar15;
  longlong local_res10;
  longlong *local_res18;
  undefined8 in_stack_fffffffffffffdb8;
  undefined4 *puVar16;
  undefined2 *puVar17;
  ulonglong in_stack_fffffffffffffdc8;
  undefined8 *puVar18;
  int *piVar19;
  undefined8 in_stack_fffffffffffffde0;
  undefined4 uVar20;
  int local_188;
  undefined2 local_184;
  undefined2 local_182;
  undefined2 local_180 [2];
  float local_17c;
  int local_178 [2];
  longlong *local_170;
  longlong *local_168;
  longlong *local_160;
  longlong local_158;
  undefined4 local_150 [2];
  longlong local_148;
  undefined4 local_140;
  int local_13c;
  int local_138;
  int local_134;
  undefined4 local_130 [2];
  undefined1 *local_128;
  undefined **local_120;
  longlong *local_118;
  longlong local_110;
  ulonglong local_108;
  undefined8 local_100;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined8 local_b4;
  undefined8 local_ac;
  undefined8 local_a4;
  undefined8 local_9c;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined1 local_70 [16];
  undefined8 local_60;
  
  uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffde0 >> 0x20);
  uVar7 = (undefined4)((ulonglong)in_stack_fffffffffffffdb8 >> 0x20);
  local_60 = 0xfffffffffffffffe;
  if (*(int *)(param_2 + 0x284) < 0) {
    return;
  }
  if ((int)*(short *)(param_1 + 700) <= *(int *)(param_2 + 0x284)) {
    return;
  }
  if (param_4 == 0) {
    return;
  }
  if (param_3 == (longlong *)0x0) {
    return;
  }
  plVar12 = param_3;
  local_res10 = param_2;
  local_res18 = param_3;
  FUN_140198570(param_2,&local_170);
  plVar14 = local_170;
  local_160 = local_170;
  if (local_170 != (longlong *)0x0) {
    if (local_170 == local_168) {
      if (*local_170 != 0) {
        lVar9 = (**(code **)(*plVar12 + 0x280))(plVar12);
        local_148 = lVar9;
        if ((((*(char *)(lVar9 + 0x80) == '\0') || (*(char *)(lVar9 + 0x80) == '\x02')) &&
            (param_3[0x26] != 0)) &&
           ((local_158 = *(longlong *)(param_3[0x26] + 0x930), local_158 != 0 &&
            (*(char *)(local_158 + 0x16) != '\x01')))) {
          local_d8 = 0;
          local_d0 = 0;
          local_c8 = 0;
          local_c0 = 0;
          local_bc = 0;
          local_b8 = 0;
          local_b4 = 0;
          local_ac = 0;
          local_a4 = 0;
          local_9c = 0;
          FUN_140204160(&local_d8,param_3);
          iVar6 = param_4;
          if (0 < param_4) {
            local_17c = 0.0;
            cVar4 = FUN_1401b4a60(param_2,&local_17c,0xc9);
            fVar3 = local_17c;
            if (cVar4 != '\0') {
              iVar6 = (int)((float)param_4 * local_17c) + param_4;
              lVar10 = FUN_1404186a0();
              if ((*(int *)(lVar10 + 0x250) == 1000) ||
                 (lVar10 = FUN_1404186a0(), *(char *)(lVar10 + 0x215) == '\x01')) {
                lVar10 = FUN_14015f0c0();
                iVar2 = *(int *)(lVar10 + 0x90);
                if ((0 < iVar2) && ((iVar2 < 6 && (2 < iVar2)))) {
                  FUN_140005370(0xd,
                                L"INFO >> GUILD SKILL | EXP PET EAT %d = (%d + (%d * %.2f)) [EXP:%d]"
                                ,iVar6,param_4,CONCAT44(uVar7,param_4),(double)fVar3,
                                in_stack_fffffffffffffdc8 & 0xffffffff00000000);
                }
              }
            }
          }
          local_178[0] = iVar6 - (int)(*(float *)(local_158 + 0x20) * -0.0);
          local_128 = local_70;
          uVar11 = FUN_1401e0340(param_3,local_70);
          uVar7 = FUN_1402f8580(*plVar14);
          cVar4 = FUN_1402e5190(lVar9,local_178[0],uVar11,uVar7);
          if (cVar4 == '\x01') {
            local_188 = FUN_1402150c0(param_3);
            FUN_1402f81e0(param_3,*(undefined4 *)(lVar9 + 0x4c));
            lVar10 = FUN_1401b5430(param_2,(int)param_3[0x25]);
            if (lVar10 != 0) {
              cVar4 = *(char *)(lVar10 + 0x2041);
              cVar1 = *(char *)(lVar9 + 0x68);
              *(char *)(lVar10 + 0x2041) = cVar1;
              cVar5 = FUN_1401f7110(lVar10);
              *(char *)(lVar10 + 0x2040) = cVar5 + (cVar1 - cVar4);
            }
            if (param_3[0x26] == 0) {
              uVar7 = 0;
            }
            else {
              uVar7 = *(undefined4 *)(param_3[0x26] + 0x200);
            }
            uVar8 = FUN_1402f8580(param_3);
            FUN_1401a6980(param_2,uVar7,uVar8);
            if (*(longlong *)(param_2 + 0xb58) == 0) {
              local_120 = Proud::CFastArray<>::vftable;
              local_118 = (longlong *)0x0;
              local_110 = 0;
              local_108 = 0;
              local_100 = 0;
              iVar6 = (**(code **)(*(longlong *)*plVar14 + 0xae8))((longlong *)*plVar14,&local_120);
              plVar12 = (longlong *)(param_1 + 0x380);
              if (iVar6 < 1) {
                local_78 = *(undefined8 *)(lVar9 + 0x50);
                local_180[0] = (undefined2)*(undefined4 *)(lVar9 + 0x4c);
                local_130[0] = (undefined4)param_3[0x25];
                piVar19 = &local_188;
                puVar17 = local_180;
                local_13c = (int)*(short *)(lVar9 + 0x68);
                (**(code **)(*plVar12 + 0x5b0))
                          (plVar12,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,param_2 + 8,local_130
                           ,puVar17,&local_78,piVar19,&local_13c);
                uVar7 = (undefined4)((ulonglong)puVar17 >> 0x20);
                uVar8 = (undefined4)((ulonglong)piVar19 >> 0x20);
              }
              else {
                local_88 = *(undefined8 *)(lVar9 + 0x50);
                local_184 = (undefined2)*(undefined4 *)(lVar9 + 0x4c);
                local_150[0] = (undefined4)param_3[0x25];
                lVar10 = local_110;
                if ((int)local_108 == 0) {
                  lVar10 = 0;
                }
                piVar19 = &local_134;
                puVar18 = &local_88;
                puVar16 = local_150;
                local_134 = (int)*(short *)(lVar9 + 0x68);
                (**(code **)(*plVar12 + 0x5a8))
                          (plVar12,lVar10,local_108 & 0xffffffff,&DAT_1405d85a0,param_2 + 8,puVar16,
                           &local_184,puVar18,&local_188,piVar19);
                uVar7 = (undefined4)((ulonglong)puVar16 >> 0x20);
                uVar8 = (undefined4)((ulonglong)puVar18 >> 0x20);
                uVar20 = (undefined4)((ulonglong)piVar19 >> 0x20);
              }
              local_120 = Proud::CFastArray<>::vftable;
              if (local_110 != 0) {
                if (local_118 == (longlong *)0x0) {
                  FUN_14034ff60();
                }
                else {
                  (**(code **)(*local_118 + 0x18))(local_118,local_110);
                }
              }
            }
            else {
              local_138 = (int)*(short *)(lVar9 + 0x68);
              local_80 = *(undefined8 *)(lVar9 + 0x50);
              local_182 = (undefined2)*(undefined4 *)(lVar9 + 0x4c);
              local_140 = (undefined4)param_3[0x25];
              piVar19 = &local_188;
              puVar17 = &local_182;
              (**(code **)(*(longlong *)(param_1 + 0x380) + 0x5b0))
                        ((longlong *)(param_1 + 0x380),
                         *(undefined4 *)(*(longlong *)(param_2 + 0xb58) + 8),&DAT_1405d85a0,
                         param_2 + 8,&local_140,puVar17,&local_80,piVar19,&local_138);
              uVar7 = (undefined4)((ulonglong)puVar17 >> 0x20);
              uVar8 = (undefined4)((ulonglong)piVar19 >> 0x20);
            }
            lVar10 = local_res10;
            if (local_188 < 1) {
              local_e8 = *(undefined4 *)(param_2 + 0x170);
              local_e4 = *(undefined4 *)(param_2 + 0x174);
              local_e0 = *(undefined4 *)(param_2 + 0x178);
              local_dc = *(undefined4 *)(param_2 + 0x17c);
              iVar6 = *(int *)(param_2 + 0x284);
              local_160 = (longlong *)CONCAT44(local_160._4_4_,(int)*(short *)(lVar9 + 0x68));
              local_148 = CONCAT44(local_148._4_4_,*(undefined4 *)(lVar9 + 0x4c));
              if (((-1 < iVar6) && (iVar6 < *(short *)(param_1 + 700))) &&
                 (*(longlong *)(param_1 + 0x4c0) != 0)) {
                local_res10 = CONCAT62(local_res10._2_6_,(short)iVar6);
                plVar12 = (longlong *)
                          (*(longlong *)
                            (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
                            (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                local_128 = *(undefined1 **)(lVar9 + 0x50);
                (**(code **)(*plVar12 + 0x740))
                          (plVar12,1,&DAT_1405d85a0,&local_res10,param_3 + 0x1f6,&local_e8,
                           &local_148,&local_128,&local_160);
              }
            }
            else {
              local_f8 = *(undefined4 *)(local_res10 + 0x170);
              local_f4 = *(undefined4 *)(local_res10 + 0x174);
              local_f0 = *(undefined4 *)(local_res10 + 0x178);
              local_ec = *(undefined4 *)(local_res10 + 0x17c);
              FUN_1401feb20(param_1,*(undefined4 *)(local_res10 + 0x288),
                            *(undefined4 *)(local_res10 + 0x284),local_res18 + 0x1f6,&local_f8,
                            CONCAT44(uVar7,*(undefined4 *)(local_148 + 0x4c)),
                            *(undefined8 *)(local_148 + 0x50),
                            CONCAT44(uVar8,(int)*(short *)(lVar9 + 0x68)),
                            *(undefined8 *)(lVar9 + 0x70),
                            CONCAT44(uVar20,*(undefined4 *)(lVar9 + 0x78)),(int)param_3[0x24],
                            *(undefined4 *)(lVar9 + 0x84),*(undefined4 *)(lVar9 + 0x88),
                            *(undefined4 *)(lVar9 + 0x8c),*(undefined4 *)(lVar9 + 0x90),
                            *(undefined4 *)(lVar9 + 0x94),*(undefined4 *)(lVar9 + 0x98),
                            *(undefined4 *)(lVar9 + 0x9c),*(undefined4 *)(lVar9 + 0xa0),
                            *(undefined4 *)(lVar9 + 0xa4),*(undefined4 *)(lVar9 + 0xa8),
                            *(undefined4 *)(lVar9 + 0xac),*(undefined4 *)(lVar9 + 0xb0),
                            *(undefined4 *)(lVar9 + 0xb4),*(undefined4 *)(lVar9 + 0xb8),
                            *(undefined4 *)(lVar9 + 0xbc),*(undefined4 *)(lVar9 + 0xc0));
              plVar14 = local_160;
              param_2 = lVar10;
              param_3 = local_res18;
            }
            *(undefined1 *)(param_3 + 0x426) = 0;
            lVar9 = param_3[0x25];
            plVar12 = *(longlong **)(*plVar14 + 0x21c0);
            for (plVar13 = *(longlong **)(*plVar14 + 0x21b8); plVar13 != plVar12;
                plVar13 = plVar13 + 2) {
              if (*(int *)(*plVar13 + 0x128) == (int)lVar9) {
                FUN_140215770();
              }
            }
            FUN_140203e10(param_1,0x1f8,param_2,param_3,&local_d8);
          }
          else if (cVar4 == '\0') {
            *(undefined1 *)(param_3 + 0x426) = 1;
            local_158 = CONCAT44(local_158._4_4_,(int)param_3[0x25]);
            (**(code **)(*(longlong *)(param_1 + 0x380) + 0x5d0))
                      ((longlong *)(param_1 + 0x380),*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                       param_2 + 8,&local_158,local_178);
          }
        }
        goto LAB_1401ff4ac;
      }
    }
    else {
      iVar6 = DAT_14060804c + 1;
      bVar15 = DAT_14060804c == 0;
      DAT_14060804c = iVar6;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar14 == (longlong *)0x0) {
    return;
  }
  if (plVar14 != local_168) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1401ff4ac:
  LOCK();
  plVar14 = plVar14 + 1;
  *(int *)plVar14 = (int)*plVar14 + -1;
  UNLOCK();
  if ((int)*plVar14 == 0) {
    puVar18 = (undefined8 *)*local_170;
    if (puVar18 != (undefined8 *)0x0) {
      (**(code **)*puVar18)(puVar18,1);
    }
    operator_delete(local_170);
  }
  return;
}



void FUN_1401ff500(longlong param_1,longlong param_2,longlong *param_3)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined *puVar7;
  longlong *plVar8;
  int iVar9;
  undefined2 local_res10 [8];
  undefined *local_res20;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined8 local_40;
  undefined1 local_38;
  
  if (*(int *)(param_2 + 0x284) < 0) {
    return;
  }
  if ((int)*(short *)(param_1 + 700) <= *(int *)(param_2 + 0x284)) {
    return;
  }
  if (param_3 == (longlong *)0x0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  lVar5 = (**(code **)(*param_3 + 0x280))(param_3);
  plVar8 = (longlong *)(lVar5 + 0x20);
  if (7 < *(ulonglong *)(lVar5 + 0x38)) {
    plVar8 = (longlong *)*plVar8;
  }
  FUN_14034fe70();
  local_res20 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(plVar8);
  iVar9 = 0;
  if ((local_res20 != (undefined *)0x0) && (local_res20 != PTR_DAT_1405d8010)) {
    iVar9 = *(int *)(local_res20 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar9) && (iVar4 = 0, local_res20 != (undefined *)0x0)) &&
     (local_res20 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res20 + -8);
  }
  iVar9 = 1;
  if (1 < iVar4) {
    iVar9 = iVar4;
  }
  iVar4 = 0;
  if ((local_res20 != (undefined *)0x0) && (iVar4 = 0, local_res20 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res20 + -8);
  }
  if (iVar4 < iVar9) {
    FUN_140002d30(&local_res20);
  }
  FUN_140002e10(&local_res20);
  puVar7 = local_res20;
  if (local_res20 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,plVar8,iVar3);
  puVar7 = local_res20;
  if (local_res20 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar7);
  iVar9 = 0;
  if (0 < iVar3) {
    iVar9 = iVar3;
  }
  iVar3 = 0;
  if ((local_res20 != (undefined *)0x0) && (iVar3 = 0, local_res20 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res20 + -8);
  }
  if ((iVar3 <= iVar9) && (iVar9 = 0, local_res20 != (undefined *)0x0)) {
    if (local_res20 == PTR_DAT_1405d8010) goto LAB_1401ff692;
    iVar9 = *(int *)(local_res20 + -8);
  }
  if (((local_res20 != PTR_DAT_1405d8010) && (local_res20 != (undefined *)0x0)) &&
     ((int *)(local_res20 + -8) != (int *)0x0)) {
    *(int *)(local_res20 + -8) = iVar9;
    *(undefined2 *)(local_res20 + (longlong)iVar9 * 2) = 0;
  }
LAB_1401ff692:
  local_res10[0] = (undefined2)*(undefined4 *)(param_2 + 0x284);
  plVar8 = (longlong *)
           (*(longlong *)
             (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) +
             (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
  local_50 = *(undefined4 *)(param_2 + 0x170);
  local_4c = *(undefined4 *)(param_2 + 0x174);
  local_48 = *(undefined4 *)(param_2 + 0x178);
  local_44 = *(undefined4 *)(param_2 + 0x17c);
  (**(code **)(*plVar8 + 0x760))
            (plVar8,1,&DAT_1405d85a0,local_res10,param_3 + 0x1f6,&local_50,&local_res20);
  puVar7 = local_res20;
  if (((local_res20 != (undefined *)0x0) && (local_res20 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res20 + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_14034fe70();
    local_40 = uVar6;
    FUN_14034ed40(uVar6);
    local_38 = 1;
    piVar2 = (int *)(puVar7 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar6);
  }
  return;
}



void FUN_1401ff7a0(longlong param_1,int param_2,int param_3,longlong *param_4)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [8];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_4 == 0) && (param_4[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x970))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,param_4,&stack0x00000028);
    }
  }
  return;
}



void FUN_1401ff830(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_5 == 0) && (param_5[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      local_res20[0] = param_4;
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1070))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,param_5,&stack0x00000030);
    }
  }
  return;
}



void FUN_1401ff8e0(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5,
                  undefined8 param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9,
                  undefined8 param_10,undefined8 param_11)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  longlong *plVar9;
  int iVar10;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined4 local_78 [2];
  undefined4 local_70 [2];
  undefined *local_68;
  undefined *local_60;
  undefined *local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined1 local_40;
  
  if (param_3 < 0) {
    return;
  }
  local_50 = 0xfffffffffffffffe;
  iVar6 = 0;
  iVar10 = 0;
  local_78[0] = 0;
  local_70[0] = 0;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  if ((*param_5 != 0) || (iVar5 = iVar10, param_5[1] != 0)) {
    iVar5 = 1;
  }
  if (iVar5 == 0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  local_res20[0] = param_4;
  FUN_14034fe70();
  local_58 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_7);
  iVar5 = iVar10;
  if ((local_58 != (undefined *)0x0) && (local_58 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_58 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar5) && (iVar4 = iVar10, local_58 != (undefined *)0x0)) &&
     (local_58 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_58 + -8);
  }
  iVar5 = 1;
  if (1 < iVar4) {
    iVar5 = iVar4;
  }
  if ((local_58 != (undefined *)0x0) && (local_58 != PTR_DAT_1405d8010)) {
    iVar10 = *(int *)(local_58 + -8);
  }
  if (iVar10 < iVar5) {
    FUN_140002d30(&local_58);
  }
  FUN_140002e10(&local_58);
  puVar8 = local_58;
  if (local_58 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,param_7,iVar3);
  puVar8 = local_58;
  if (local_58 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar5 = FUN_14034fcf0(puVar8);
  iVar10 = iVar6;
  if (0 < iVar5) {
    iVar10 = iVar5;
  }
  iVar5 = iVar6;
  if ((local_58 != (undefined *)0x0) && (iVar5 = 0, local_58 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_58 + -8);
  }
  if ((iVar10 < iVar5) || (iVar10 = iVar6, local_58 == (undefined *)0x0)) {
LAB_1401ffa58:
    if (((local_58 != PTR_DAT_1405d8010) && (local_58 != (undefined *)0x0)) &&
       ((int *)(local_58 + -8) != (int *)0x0)) {
      *(int *)(local_58 + -8) = iVar10;
      *(undefined2 *)(local_58 + (longlong)iVar10 * 2) = 0;
    }
  }
  else if (local_58 != PTR_DAT_1405d8010) {
    iVar10 = *(int *)(local_58 + -8);
    goto LAB_1401ffa58;
  }
  FUN_14034fe70();
  local_60 = PTR_DAT_1405d8010;
  iVar5 = FUN_14034fcf0(param_6);
  iVar3 = 0;
  iVar10 = iVar3;
  if ((local_60 != (undefined *)0x0) && (local_60 != PTR_DAT_1405d8010)) {
    iVar10 = *(int *)(local_60 + -8);
  }
  iVar4 = iVar5;
  if (((iVar5 <= iVar10) && (iVar4 = iVar3, local_60 != (undefined *)0x0)) &&
     (local_60 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_60 + -8);
  }
  iVar10 = 1;
  if (1 < iVar4) {
    iVar10 = iVar4;
  }
  iVar4 = iVar3;
  if ((local_60 != (undefined *)0x0) && (local_60 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_60 + -8);
  }
  if (iVar4 < iVar10) {
    FUN_140002d30(&local_60);
  }
  FUN_140002e10(&local_60);
  puVar8 = local_60;
  if (local_60 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,param_6,iVar5);
  puVar8 = local_60;
  if (local_60 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar5 = FUN_14034fcf0(puVar8);
  iVar10 = iVar6;
  if (0 < iVar5) {
    iVar10 = iVar5;
  }
  iVar5 = iVar6;
  if ((local_60 != (undefined *)0x0) && (iVar5 = 0, local_60 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_60 + -8);
  }
  if ((iVar10 < iVar5) || (iVar10 = iVar6, local_60 == (undefined *)0x0)) {
LAB_1401ffb58:
    if (((local_60 != PTR_DAT_1405d8010) && (local_60 != (undefined *)0x0)) &&
       ((int *)(local_60 + -8) != (int *)0x0)) {
      *(int *)(local_60 + -8) = iVar10;
      *(undefined2 *)(local_60 + (longlong)iVar10 * 2) = 0;
    }
  }
  else if (local_60 != PTR_DAT_1405d8010) {
    iVar10 = *(int *)(local_60 + -8);
    goto LAB_1401ffb58;
  }
  FUN_14034fe70();
  local_68 = PTR_DAT_1405d8010;
  iVar6 = FUN_14034fcf0(L"System");
  iVar10 = iVar3;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar10 = *(int *)(local_68 + -8);
  }
  iVar5 = iVar6;
  if (((iVar6 <= iVar10) && (iVar5 = iVar3, local_68 != (undefined *)0x0)) &&
     (local_68 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_68 + -8);
  }
  iVar10 = 1;
  if (1 < iVar5) {
    iVar10 = iVar5;
  }
  iVar5 = iVar3;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_68 + -8);
  }
  if (iVar5 < iVar10) {
    FUN_140002d30(&local_68);
  }
  FUN_140002e10(&local_68);
  puVar8 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,L"System",iVar6);
  puVar8 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar8);
  iVar10 = 0;
  if (0 < iVar6) {
    iVar10 = iVar6;
  }
  iVar6 = iVar3;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_68 + -8);
  }
  if ((iVar6 <= iVar10) && (iVar10 = iVar3, local_68 != (undefined *)0x0)) {
    if (local_68 == PTR_DAT_1405d8010) goto LAB_1401ffc7a;
    iVar10 = *(int *)(local_68 + -8);
  }
  if (((local_68 != PTR_DAT_1405d8010) && (local_68 != (undefined *)0x0)) &&
     ((int *)(local_68 + -8) != (int *)0x0)) {
    *(int *)(local_68 + -8) = iVar10;
    *(undefined2 *)(local_68 + (longlong)iVar10 * 2) = 0;
  }
LAB_1401ffc7a:
  plVar9 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  local_res18[0] = (short)param_3;
  (**(code **)(*plVar9 + 0x980))
            (plVar9,1,&DAT_1405d85a0,local_res18,local_res20,param_5,&local_68,&local_60,&local_58,
             local_70,&param_8,local_78,&param_9,param_10,param_11);
  puVar8 = local_68;
  if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_68 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_48 = uVar7;
    FUN_14034ed40(uVar7);
    local_40 = 1;
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  puVar8 = local_60;
  local_68 = PTR_DAT_1405d8010;
  if (((local_60 != (undefined *)0x0) && (local_60 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_60 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_48 = uVar7;
    FUN_14034ed40(uVar7);
    local_40 = 1;
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  puVar8 = local_58;
  if (((local_58 != (undefined *)0x0) && (local_58 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_58 + -8, puVar1 != (undefined *)0x0)) {
    local_60 = PTR_DAT_1405d8010;
    uVar7 = FUN_14034fe70();
    local_48 = uVar7;
    FUN_14034ed40(uVar7);
    local_40 = 1;
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  return;
}



void FUN_1401ffe20(longlong param_1,int param_2,int param_3,longlong *param_4,undefined8 param_5)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  longlong *plVar9;
  int iVar10;
  undefined2 local_res18 [4];
  undefined *local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined1 local_20;
  
  if (param_3 < 0) {
    return;
  }
  local_30 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  iVar10 = 0;
  if ((*param_4 != 0) || (iVar6 = iVar10, param_4[1] != 0)) {
    iVar6 = 1;
  }
  if (iVar6 == 0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  FUN_14034fe70();
  local_38 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_5);
  iVar6 = iVar10;
  if ((local_38 != (undefined *)0x0) && (local_38 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_38 + -8);
  }
  iVar4 = 0;
  iVar5 = iVar3;
  if (((iVar3 <= iVar6) && (iVar5 = iVar10, local_38 != (undefined *)0x0)) &&
     (iVar5 = iVar4, local_38 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_38 + -8);
  }
  iVar10 = 1;
  if (1 < iVar5) {
    iVar10 = iVar5;
  }
  iVar6 = iVar4;
  if ((local_38 != (undefined *)0x0) && (local_38 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_38 + -8);
  }
  if (iVar6 < iVar10) {
    FUN_140002d30(&local_38);
  }
  FUN_140002e10(&local_38);
  puVar8 = local_38;
  if (local_38 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,param_5,iVar3);
  puVar8 = local_38;
  if (local_38 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar8);
  iVar10 = 0;
  if (0 < iVar6) {
    iVar10 = iVar6;
  }
  iVar6 = iVar4;
  if ((local_38 != (undefined *)0x0) && (local_38 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_38 + -8);
  }
  if ((iVar6 <= iVar10) && (iVar10 = iVar4, local_38 != (undefined *)0x0)) {
    if (local_38 == PTR_DAT_1405d8010) goto LAB_1401fffb2;
    iVar10 = *(int *)(local_38 + -8);
  }
  if (((local_38 != PTR_DAT_1405d8010) && (local_38 != (undefined *)0x0)) &&
     ((int *)(local_38 + -8) != (int *)0x0)) {
    *(int *)(local_38 + -8) = iVar10;
    *(undefined2 *)(local_38 + (longlong)iVar10 * 2) = 0;
  }
LAB_1401fffb2:
  plVar9 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  local_res18[0] = (short)param_3;
  (**(code **)(*plVar9 + 0x9a0))(plVar9,1,&DAT_1405d85a0,local_res18,param_4,&local_38);
  puVar8 = local_38;
  if (((local_38 != (undefined *)0x0) && (local_38 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_38 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_28 = uVar7;
    FUN_14034ed40(uVar7);
    local_20 = 1;
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  return;
}



void FUN_140200070(longlong param_1,int param_2,int param_3,longlong *param_4)

{
  longlong lVar1;
  bool bVar2;
  undefined2 local_res18 [8];
  
  if ((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) {
    if ((*param_4 == 0) && (param_4[1] == 0)) {
      bVar2 = false;
    }
    else {
      bVar2 = true;
    }
    if ((bVar2) && (*(longlong *)(param_1 + 0x4c0) != 0)) {
      local_res18[0] = (undefined2)param_3;
      lVar1 = *(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8);
      (**(code **)(*(longlong *)(lVar1 + 0x70) + 0xa10))
                (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,param_4,&stack0x00000028);
    }
  }
  return;
}



void FUN_140200100(longlong param_1,int param_2,int param_3,undefined4 param_4,undefined8 param_5)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  longlong *plVar7;
  int iVar8;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined2 local_48 [4];
  undefined *local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined1 local_28;
  
  if (param_3 < 0) {
    return;
  }
  local_38 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  local_res18[0] = (undefined2)*(undefined4 *)(DAT_140608000 + 0x140);
  local_res20[0] = param_4;
  FUN_14034fe70();
  local_40 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_5);
  iVar8 = 0;
  if ((local_40 != (undefined *)0x0) && (local_40 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_40 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_40 != (undefined *)0x0)) &&
     (local_40 != PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar4 = *(int *)(local_40 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_40);
  }
  FUN_140002e10(&local_40);
  puVar6 = local_40;
  if (local_40 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_5,iVar3);
  puVar6 = local_40;
  if (local_40 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_40 != (undefined *)0x0) && (iVar3 = 0, local_40 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_40 + -8);
  }
  if ((iVar3 <= iVar8) && (iVar8 = 0, local_40 != (undefined *)0x0)) {
    if (local_40 == PTR_DAT_1405d8010) goto LAB_140200273;
    iVar8 = *(int *)(local_40 + -8);
  }
  if (((local_40 != PTR_DAT_1405d8010) && (local_40 != (undefined *)0x0)) &&
     ((int *)(local_40 + -8) != (int *)0x0)) {
    *(int *)(local_40 + -8) = iVar8;
    *(undefined2 *)(local_40 + (longlong)iVar8 * 2) = 0;
  }
LAB_140200273:
  plVar7 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  local_48[0] = (short)param_3;
  (**(code **)(*plVar7 + 800))(plVar7,1,&DAT_1405d85a0,local_48,local_res20,&local_40,local_res18);
  puVar6 = local_40;
  if (((local_40 != (undefined *)0x0) && (local_40 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_40 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    local_30 = uVar5;
    FUN_14034ed40(uVar5);
    local_28 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_140200330(longlong param_1,int param_2,int param_3,int *param_4)

{
  short sVar1;
  int iVar2;
  undefined8 uVar3;
  short *psVar4;
  longlong *plVar5;
  ulonglong uVar6;
  undefined *puVar7;
  short *psVar8;
  int *piVar9;
  longlong lVar10;
  undefined2 local_res18 [8];
  undefined2 local_30;
  undefined6 uStack_2e;
  undefined8 local_20;
  ulonglong local_18;
  
  if (param_3 < 0) {
    return;
  }
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c8) != 0) {
    local_res18[0] = (undefined2)param_3;
    plVar5 = (longlong *)
             (*(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)param_2 * 8) + 0x70);
    (**(code **)(*plVar5 + 0xd90))(plVar5,1,&DAT_1405d85a0,local_res18,param_4);
  }
  if (*(char *)(DAT_140607fe0 + 0x40) == '\0') {
    return;
  }
  local_18 = 7;
  local_20 = 0;
  local_30 = 0;
  switch(*param_4) {
  case 0x19a:
    uVar3 = 8;
    puVar7 = &DAT_1404ab8e8;
    break;
  case 0x19b:
    uVar3 = 8;
    puVar7 = &DAT_1404ab900;
    break;
  case 0x19c:
    uVar3 = 5;
    puVar7 = &DAT_1404ab918;
    break;
  case 0x19d:
    uVar3 = 6;
    puVar7 = &DAT_1404ab928;
    break;
  case 0x19e:
    uVar3 = 6;
    puVar7 = &DAT_1404ab938;
    break;
  case 0x19f:
    uVar3 = 2;
    puVar7 = &DAT_1404ab948;
    break;
  case 0x1a0:
    uVar3 = 8;
    puVar7 = &DAT_1404ab950;
    break;
  case 0x1a1:
    uVar3 = 2;
    puVar7 = &DAT_1404ab964;
    break;
  case 0x1a2:
    uVar3 = 8;
    puVar7 = &DAT_1404ab970;
    break;
  case 0x1a3:
    uVar3 = 2;
    puVar7 = &DAT_1404ab984;
    break;
  case 0x1a4:
    uVar3 = 8;
    puVar7 = &DAT_1404ab990;
    break;
  case 0x1a5:
    uVar3 = 2;
    puVar7 = &DAT_1404ab9a4;
    break;
  case 0x1a6:
    uVar3 = 5;
    puVar7 = &DAT_1404ab9b0;
    break;
  case 0x1a7:
    uVar3 = 1;
    puVar7 = &DAT_1404ab9bc;
    break;
  case 0x1a8:
    uVar3 = 4;
    puVar7 = &DAT_1404ab9c0;
    break;
  case 0x1a9:
    uVar3 = 2;
    puVar7 = &DAT_1404ab9cc;
    break;
  case 0x1aa:
    uVar3 = 5;
    puVar7 = &DAT_1404ab9d8;
    break;
  case 0x1ab:
    uVar3 = 2;
    puVar7 = &DAT_1404ab9e4;
    break;
  case 0x1ac:
    uVar3 = 2;
    puVar7 = &DAT_1404ab9ec;
    break;
  case 0x1ad:
    uVar3 = 2;
    puVar7 = &DAT_1404ab9f4;
    break;
  case 0x1ae:
    uVar3 = 5;
    puVar7 = &DAT_1404aba00;
    break;
  case 0x1af:
    uVar3 = 4;
    puVar7 = &DAT_1404aba10;
    break;
  case 0x1b0:
    uVar3 = 2;
    puVar7 = &DAT_1404aba1c;
    break;
  default:
    goto switchD_1402003ea_caseD_1b1;
  case 0x1c2:
    uVar3 = 2;
    puVar7 = &DAT_1404aba24;
    break;
  case 0x1c3:
    uVar3 = 4;
    puVar7 = &DAT_1404aba30;
    break;
  case 0x1c4:
    uVar3 = 2;
    puVar7 = &DAT_1404aba3c;
    break;
  case 0x1c5:
    uVar3 = 3;
    puVar7 = &DAT_1404aba48;
    break;
  case 0x1c6:
    uVar3 = 1;
    puVar7 = &DAT_1404aba50;
    break;
  case 0x1c7:
    uVar3 = 5;
    puVar7 = &DAT_1404aba58;
    break;
  case 0x1c8:
    uVar3 = 2;
    puVar7 = &DAT_1404aba64;
    break;
  case 0x1c9:
    uVar3 = 2;
    puVar7 = &DAT_1404aba6c;
    break;
  case 0x1ca:
    uVar3 = 2;
    puVar7 = &DAT_1404aba74;
    break;
  case 0x1cb:
    uVar3 = 2;
    puVar7 = &DAT_1404aba7c;
    break;
  case 0x1cc:
    uVar3 = 3;
    puVar7 = &DAT_1404aba88;
    break;
  case 0x1cd:
    puVar7 = &DAT_1404aba90;
    goto LAB_140200648;
  case 0x1ce:
    puVar7 = &DAT_1404abaa0;
LAB_140200648:
    uVar3 = 7;
  }
  FUN_140002aa0(&local_30,puVar7,uVar3);
switchD_1402003ea_caseD_1b1:
  FUN_140002aa0(&local_30,&DAT_1404abab0,1);
  iVar2 = *(int *)((longlong)param_4 + 0xc6) + -1;
  if (*param_4 < 0x1c2) {
    switch(iVar2) {
    case 0:
      uVar3 = 6;
      puVar7 = &DAT_1404abab8;
      break;
    case 1:
      uVar3 = 6;
      puVar7 = &DAT_1404abac8;
      break;
    case 2:
      uVar3 = 6;
      puVar7 = &DAT_1404abad8;
      break;
    case 3:
      uVar3 = 6;
      puVar7 = &DAT_1404abae8;
      break;
    case 4:
      uVar3 = 6;
      puVar7 = &DAT_1404abaf8;
      break;
    case 5:
      uVar3 = 7;
      puVar7 = &DAT_1404abb20;
      break;
    case 6:
      uVar3 = 7;
      puVar7 = &DAT_1404abb30;
      break;
    default:
      goto switchD_1402006a0_caseD_7;
    case 10:
      uVar3 = 6;
      puVar7 = &DAT_1404abb40;
      break;
    case 0xb:
      uVar3 = 7;
      puVar7 = &DAT_1404abb50;
      break;
    case 0xc:
      uVar3 = 6;
      puVar7 = &DAT_1404abb60;
      break;
    case 0xd:
      uVar3 = 6;
      puVar7 = &DAT_1404abb70;
      break;
    case 0xe:
      uVar3 = 9;
      puVar7 = &DAT_1404abb80;
      break;
    case 0xf:
      uVar3 = 9;
      puVar7 = &DAT_1404abb98;
      break;
    case 0x14:
      uVar3 = 6;
      puVar7 = &DAT_1404abbb0;
      break;
    case 0x15:
      uVar3 = 6;
      puVar7 = &DAT_1404abbc0;
      break;
    case 0x16:
      uVar3 = 9;
      puVar7 = &DAT_1404abbd0;
      break;
    case 0x1e:
      uVar3 = 6;
      puVar7 = &DAT_1404abbe8;
      break;
    case 0x1f:
      uVar3 = 6;
      puVar7 = &DAT_1404abbf8;
      break;
    case 0x20:
      uVar3 = 9;
      puVar7 = &DAT_1404abc08;
      break;
    case 0x28:
      uVar3 = 6;
      puVar7 = &DAT_1404abc20;
      break;
    case 0x29:
      uVar3 = 6;
      puVar7 = &DAT_1404abc30;
      break;
    case 0x2a:
      uVar3 = 9;
      puVar7 = &DAT_1404abc40;
      break;
    case 0x32:
      uVar3 = 6;
      puVar7 = &DAT_1404abc58;
      break;
    case 0x33:
      uVar3 = 7;
      puVar7 = &DAT_1404abc68;
      break;
    case 0x3c:
      uVar3 = 6;
      puVar7 = &DAT_1404abc78;
      break;
    case 0x3d:
      puVar7 = &DAT_1404abc88;
      goto LAB_140200d1f;
    case 0x3e:
      uVar3 = 9;
      puVar7 = &DAT_1404abca0;
      break;
    case 0x3f:
      uVar3 = 0xe;
      puVar7 = &DAT_1404abcb8;
      break;
    case 0x40:
      uVar3 = 0xe;
      puVar7 = &DAT_1404abcd8;
      break;
    case 0x41:
      uVar3 = 0xd;
      puVar7 = &DAT_1404abcf8;
      break;
    case 0x46:
      uVar3 = 2;
      puVar7 = &DAT_1404ab9ec;
      break;
    case 0x47:
      uVar3 = 9;
      puVar7 = &DAT_1404abd18;
      break;
    case 0x48:
      uVar3 = 2;
      puVar7 = &DAT_1404ab9f4;
      break;
    case 0x49:
      uVar3 = 9;
      puVar7 = &DAT_1404abd30;
      break;
    case 0x50:
      uVar3 = 6;
      puVar7 = &DAT_1404abd48;
      break;
    case 0x51:
      uVar3 = 6;
      puVar7 = &DAT_1404abd58;
      break;
    case 0x5a:
      uVar3 = 1;
      puVar7 = &DAT_1404ab9bc;
      break;
    case 0x5b:
      puVar7 = &DAT_1404abd68;
      goto LAB_140200d1f;
    case 100:
      puVar7 = &DAT_1404abd80;
      goto LAB_140200d1f;
    case 0x65:
      uVar3 = 0xf;
      puVar7 = &DAT_1404abd98;
      break;
    case 0x6e:
      uVar3 = 0xb;
      puVar7 = &DAT_1404abdb8;
      break;
    case 0x6f:
      uVar3 = 0xb;
      puVar7 = &DAT_1404abdd0;
      break;
    case 0x78:
      uVar3 = 9;
      puVar7 = &DAT_1404abde8;
      break;
    case 0x79:
      uVar3 = 9;
      puVar7 = &DAT_1404abe00;
      break;
    case 0x82:
      uVar3 = 0xb;
      puVar7 = &DAT_1404abb08;
      break;
    case 0x83:
      uVar3 = 0xd;
      puVar7 = &DAT_1404abe18;
    }
    goto LAB_140200d25;
  }
  switch(iVar2) {
  case 0:
    uVar3 = 2;
    puVar7 = &DAT_1404aba24;
    break;
  case 1:
    uVar3 = 6;
    puVar7 = &DAT_1404abe38;
    break;
  default:
    goto switchD_1402006a0_caseD_7;
  case 10:
    puVar7 = &DAT_1404abe48;
    goto LAB_140200d1f;
  case 0xb:
    uVar3 = 9;
    puVar7 = &DAT_1404abe60;
    break;
  case 0xc:
    puVar7 = &DAT_1404abe78;
    goto LAB_140200d1f;
  case 0x14:
    uVar3 = 6;
    puVar7 = &DAT_1404abe90;
    break;
  case 0x15:
    uVar3 = 7;
    puVar7 = &DAT_1404abea0;
    break;
  case 0x16:
    uVar3 = 6;
    puVar7 = &DAT_1404abeb0;
    break;
  case 0x17:
    puVar7 = &DAT_1404abec0;
    goto LAB_140200d1f;
  case 0x18:
    uVar3 = 9;
    puVar7 = &DAT_1404abed8;
    break;
  case 0x19:
    puVar7 = &DAT_1404abef0;
    goto LAB_140200d1f;
  case 0x1e:
    puVar7 = &DAT_1404abf08;
    goto LAB_140200d1f;
  case 0x1f:
    uVar3 = 9;
    puVar7 = &DAT_1404abf20;
    break;
  case 0x20:
    puVar7 = &DAT_1404abf38;
    goto LAB_140200d1f;
  case 0x21:
    puVar7 = &DAT_1404abf50;
    goto LAB_140200d1f;
  case 0x28:
    puVar7 = &DAT_1404abf68;
    goto LAB_140200d1f;
  case 0x29:
    uVar3 = 9;
    puVar7 = &DAT_1404abf80;
    break;
  case 0x2a:
    uVar3 = 10;
    puVar7 = &DAT_1404abf98;
    break;
  case 0x2b:
    uVar3 = 6;
    puVar7 = &DAT_1404abfb0;
    break;
  case 0x2c:
    uVar3 = 6;
    puVar7 = &DAT_1404abfc0;
    break;
  case 0x2d:
    uVar3 = 6;
    puVar7 = &DAT_1404abfd0;
    break;
  case 0x2e:
    uVar3 = 0xb;
    puVar7 = &DAT_1404abfe0;
    break;
  case 0x2f:
    uVar3 = 0xb;
    puVar7 = &DAT_1404abff8;
    break;
  case 0x30:
    uVar3 = 9;
    puVar7 = &DAT_1404ac010;
    break;
  case 0x32:
    uVar3 = 6;
    puVar7 = &DAT_1404ac028;
    break;
  case 0x33:
    uVar3 = 6;
    puVar7 = &DAT_1404ac038;
    break;
  case 0x34:
    puVar7 = &DAT_1404ac048;
    goto LAB_140200d1f;
  case 0x35:
    uVar3 = 6;
    puVar7 = &DAT_1404ac060;
    break;
  case 0x3c:
    uVar3 = 6;
    puVar7 = &DAT_1404ac070;
    break;
  case 0x3d:
    uVar3 = 6;
    puVar7 = &DAT_1404ac080;
    break;
  case 0x3e:
    uVar3 = 9;
    puVar7 = &DAT_1404ac090;
    break;
  case 0x3f:
    puVar7 = &DAT_1404ac0a8;
    goto LAB_140200d1f;
  case 0x46:
    uVar3 = 7;
    puVar7 = &DAT_1404ac0c0;
    break;
  case 0x47:
    uVar3 = 6;
    puVar7 = &DAT_1404ac0d0;
    break;
  case 0x48:
    puVar7 = &DAT_1404ac0e0;
    goto LAB_140200d1f;
  case 0x49:
    uVar3 = 7;
    puVar7 = &DAT_1404ac0f8;
    break;
  case 0x4a:
    uVar3 = 9;
    puVar7 = &DAT_1404ac108;
    break;
  case 0x4b:
    uVar3 = 9;
    puVar7 = &DAT_1404ac120;
    break;
  case 0x4c:
    uVar3 = 0xd;
    puVar7 = &DAT_1404ac138;
    break;
  case 0x50:
    uVar3 = 7;
    puVar7 = &DAT_1404ac158;
    break;
  case 0x51:
    uVar3 = 6;
    puVar7 = &DAT_1404ac168;
    break;
  case 0x52:
    uVar3 = 6;
    puVar7 = &DAT_1404ac178;
    break;
  case 0x53:
    uVar3 = 10;
    puVar7 = &DAT_1404ac188;
    break;
  case 0x54:
    uVar3 = 9;
    puVar7 = &DAT_1404ac1a0;
    break;
  case 0x55:
    uVar3 = 9;
    puVar7 = &DAT_1404ac1b8;
    break;
  case 0x56:
    uVar3 = 10;
    puVar7 = &DAT_1404ac1d0;
    break;
  case 0x5a:
    uVar3 = 7;
    puVar7 = &DAT_1404ac1e8;
    break;
  case 0x5b:
    puVar7 = &DAT_1404ac1f8;
    goto LAB_140200d1f;
  case 99:
    uVar3 = 9;
    puVar7 = &DAT_1404ac210;
    break;
  case 100:
    uVar3 = 10;
    puVar7 = &DAT_1404ac228;
    break;
  case 0x65:
    puVar7 = &DAT_1404ac240;
    goto LAB_140200d1f;
  case 0x66:
    puVar7 = &DAT_1404ac258;
LAB_140200d1f:
    uVar3 = 8;
  }
LAB_140200d25:
  FUN_140002aa0(&local_30,puVar7,uVar3);
switchD_1402006a0_caseD_7:
  FUN_140002aa0(&local_30,&DAT_1404ac26c,1);
  iVar2 = param_4[0x16];
  if (iVar2 < 1) {
    lVar10 = 2;
    psVar4 = (short *)&DAT_1404ac270;
  }
  else {
    uVar3 = FUN_140137690();
    psVar4 = (short *)FUN_1401367c0(uVar3,iVar2);
    uVar6 = 0xffffffffffffffff;
    psVar8 = psVar4;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    lVar10 = ~uVar6 - 1;
  }
  FUN_140002aa0(&local_30,psVar4,lVar10);
  FUN_140002aa0(&local_30,&DAT_1404ac26c,1);
  uVar6 = 0xffffffffffffffff;
  piVar9 = param_4 + 10;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    iVar2 = *piVar9;
    piVar9 = (int *)((longlong)piVar9 + 2);
  } while ((short)iVar2 != 0);
  FUN_140002aa0(&local_30,param_4 + 10,~uVar6 - 1);
  wprintf(L"%s %d -> %d \n");
  if (7 < local_18) {
    operator_delete((void *)CONCAT62(uStack_2e,local_30));
  }
  return;
}



void FUN_140201160(longlong param_1,int param_2,int param_3,undefined4 *param_4)

{
  short sVar1;
  longlong *plVar2;
  ulonglong uVar3;
  undefined *puVar4;
  short *psVar5;
  undefined2 local_res18 [8];
  undefined2 local_30;
  undefined6 uStack_2e;
  undefined8 local_20;
  ulonglong local_18;
  
  if (param_3 < 0) {
    return;
  }
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c8) != 0) {
    local_res18[0] = (undefined2)param_3;
    plVar2 = (longlong *)
             (*(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)param_2 * 8) + 0x70);
    (**(code **)(*plVar2 + 0xe90))(plVar2,1,&DAT_1405d85a0,local_res18,param_4);
  }
  if (*(char *)(DAT_140607fe0 + 0x42) == '\0') {
    return;
  }
  local_18 = 7;
  local_20 = 0;
  local_30 = 0;
  uVar3 = 0xffffffffffffffff;
  psVar5 = (short *)(param_4 + 0x2f);
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
  } while (sVar1 != 0);
  FUN_140002aa0(&local_30,param_4 + 0x2f,~uVar3 - 1);
  FUN_140002aa0(&local_30,&DAT_1404ac294,1);
  uVar3 = 0xffffffffffffffff;
  psVar5 = (short *)(param_4 + 0x23);
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
  } while (sVar1 != 0);
  FUN_140002aa0(&local_30,param_4 + 0x23,~uVar3 - 1);
  FUN_140002aa0(&local_30,&DAT_1404ac298,1);
  FUN_140002aa0(&local_30,&DAT_1404ac26c,1);
  switch(*param_4) {
  case 0x1f5:
    puVar4 = &DAT_1404ac2a0;
    break;
  case 0x1f6:
    puVar4 = &DAT_1404ac2b0;
    break;
  case 0x1f7:
    puVar4 = &DAT_1404ac2c0;
    break;
  case 0x1f8:
    puVar4 = &DAT_1404ac2d0;
    break;
  case 0x1f9:
    puVar4 = &DAT_1404ac2e0;
    break;
  case 0x1fa:
    puVar4 = &DAT_1404ac2f0;
    break;
  case 0x1fb:
    puVar4 = &DAT_1404ac300;
    break;
  case 0x1fc:
    puVar4 = &DAT_1404ac310;
    break;
  default:
    goto switchD_1402012bf_default;
  }
  FUN_140002aa0(&local_30,puVar4,5);
switchD_1402012bf_default:
  wprintf(L"//////////////////////////////////////////////////////////////////////////\n");
  wprintf(L"%s Level:%d Slot:%d  \n");
  wprintf(
         L"체 힘 말 성품 지 맷집 매  키 kg  HP MP 물공 물방 마공 마방 크리 충성 \n"
         );
  wprintf(L"%d %d %d  %d %d  %d  %d  %f %f  %d %d  %d  %d   %d   %d   %d   %d \n");
  wprintf(L"%d %d %d  %d %d  %d  %d  %f %f  %d %d  %d  %d   %d   %d   %d   %d \n");
  wprintf(L"//////////////////////////////////////////////////////////////////////////\n");
  if (7 < local_18) {
    operator_delete((void *)CONCAT62(uStack_2e,local_30));
  }
  return;
}



void FUN_140201550(longlong param_1,int param_2,int param_3,int *param_4)

{
  int iVar1;
  longlong *plVar2;
  ulonglong uVar3;
  undefined *puVar4;
  int *piVar5;
  undefined8 uVar6;
  undefined2 local_res18 [8];
  undefined2 local_30;
  undefined6 uStack_2e;
  undefined8 local_20;
  ulonglong local_18;
  
  if (param_3 < 0) {
    return;
  }
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c8) != 0) {
    local_res18[0] = (undefined2)param_3;
    plVar2 = (longlong *)
             (*(longlong *)
               (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)param_2 * 8) + 0x70);
    (**(code **)(*plVar2 + 0xea0))(plVar2,1,&DAT_1405d85a0,local_res18,param_4);
  }
  if (*(char *)(DAT_140607fe0 + 0x41) == '\0') {
    return;
  }
  local_18 = 7;
  local_20 = 0;
  local_30 = 0;
  if (*param_4 == 0x12d) {
    uVar6 = 4;
    puVar4 = &DAT_1404ac4e8;
LAB_14020160c:
    FUN_140002aa0(&local_30,puVar4,uVar6);
  }
  else if (*param_4 == 0x12e) {
    uVar6 = 7;
    puVar4 = &DAT_1404ac4f8;
    goto LAB_14020160c;
  }
  FUN_140002aa0(&local_30,&DAT_1404abab0,1);
  if (param_4[1] == 0) {
    puVar4 = &DAT_1404ac508;
  }
  else {
    if (param_4[1] != 1) goto LAB_140201658;
    puVar4 = &DAT_1404aba6c;
  }
  FUN_140002aa0(&local_30,puVar4,2);
LAB_140201658:
  uVar3 = 0xffffffffffffffff;
  piVar5 = param_4 + 0xb;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    iVar1 = *piVar5;
    piVar5 = (int *)((longlong)piVar5 + 2);
  } while ((short)iVar1 != 0);
  FUN_140002aa0(&local_30,param_4 + 0xb,~uVar3 - 1);
  uVar3 = 0xffffffffffffffff;
  piVar5 = param_4 + 0x24;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    iVar1 = *piVar5;
    piVar5 = (int *)((longlong)piVar5 + 2);
  } while ((short)iVar1 != 0);
  FUN_140002aa0(&local_30,param_4 + 0x24,~uVar3 - 1);
  wprintf(L"%s %d -> %d \n");
  if (7 < local_18) {
    operator_delete((void *)CONCAT62(uStack_2e,local_30));
  }
  return;
}



void FUN_1402016f0(longlong param_1,int param_2,int 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_res18 [4];
  undefined *local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined1 local_20;
  
  if (param_3 < 0) {
    return;
  }
  local_30 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  FUN_14034fe70();
  local_38 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_6);
  iVar8 = 0;
  if ((local_38 != (undefined *)0x0) && (local_38 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_38 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_38 != (undefined *)0x0)) &&
     (local_38 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_38 + -8);
  }
  iVar8 = 1;
  if (1 < iVar4) {
    iVar8 = iVar4;
  }
  iVar4 = 0;
  if ((local_38 != (undefined *)0x0) && (iVar4 = 0, local_38 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_38 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_38);
  }
  FUN_140002e10(&local_38);
  puVar6 = local_38;
  if (local_38 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_6,iVar3);
  puVar6 = local_38;
  if (local_38 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_38 != (undefined *)0x0) && (iVar3 = 0, local_38 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_38 + -8);
  }
  if ((iVar3 <= iVar8) && (iVar8 = 0, local_38 != (undefined *)0x0)) {
    if (local_38 == PTR_DAT_1405d8010) goto LAB_140201855;
    iVar8 = *(int *)(local_38 + -8);
  }
  if (((local_38 != PTR_DAT_1405d8010) && (local_38 != (undefined *)0x0)) &&
     ((int *)(local_38 + -8) != (int *)0x0)) {
    *(int *)(local_38 + -8) = iVar8;
    *(undefined2 *)(local_38 + (longlong)iVar8 * 2) = 0;
  }
LAB_140201855:
  plVar7 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  local_res18[0] = (short)param_3;
  (**(code **)(*plVar7 + 0xb20))(plVar7,1,&DAT_1405d85a0,local_res18,param_4,&param_5,&local_38);
  puVar6 = local_38;
  if (((local_38 != (undefined *)0x0) && (local_38 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_38 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    local_28 = uVar5;
    FUN_14034ed40(uVar5);
    local_20 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_140201920(longlong param_1,int param_2,int param_3,undefined4 param_4,undefined8 param_5,
                  byte param_6)

{
  longlong lVar1;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  uint local_18 [6];
  
  if (((-1 < param_3) && (param_3 < *(short *)(param_1 + 700))) &&
     (*(longlong *)(param_1 + 0x4c0) != 0)) {
    local_res18[0] = (undefined2)param_3;
    local_18[0] = (uint)param_6;
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
    ;
    local_res20[0] = param_4;
    (**(code **)(*(longlong *)(lVar1 + 0x70) + 0xbc0))
              (lVar1 + 0x70,1,&DAT_1405d85a0,local_res18,local_res20,param_5,local_18);
  }
  return;
}



void FUN_1402019b0(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined8 uVar7;
  undefined *puVar8;
  longlong *plVar9;
  int iVar10;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  
  if (param_3 < 0) {
    return;
  }
  local_40 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  iVar10 = 0;
  if ((*param_5 != 0) || (iVar6 = iVar10, param_5[1] != 0)) {
    iVar6 = 1;
  }
  if (iVar6 == 0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  local_res20[0] = param_4;
  FUN_14034fe70();
  local_48 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(&DAT_1404a8ff8);
  iVar6 = iVar10;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  iVar4 = 0;
  iVar5 = iVar3;
  if (((iVar3 <= iVar6) && (iVar5 = iVar10, local_48 != (undefined *)0x0)) &&
     (iVar5 = iVar4, local_48 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_48 + -8);
  }
  iVar10 = 1;
  if (1 < iVar5) {
    iVar10 = iVar5;
  }
  iVar6 = iVar4;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  if (iVar6 < iVar10) {
    FUN_140002d30(&local_48);
  }
  FUN_140002e10(&local_48);
  puVar8 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,&DAT_1404a8ff8,iVar3);
  puVar8 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar8);
  iVar10 = 0;
  if (0 < iVar6) {
    iVar10 = iVar6;
  }
  iVar6 = iVar4;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  if ((iVar6 <= iVar10) && (iVar10 = iVar4, local_48 != (undefined *)0x0)) {
    if (local_48 == PTR_DAT_1405d8010) goto LAB_140201b42;
    iVar10 = *(int *)(local_48 + -8);
  }
  if (((local_48 != PTR_DAT_1405d8010) && (local_48 != (undefined *)0x0)) &&
     ((int *)(local_48 + -8) != (int *)0x0)) {
    *(int *)(local_48 + -8) = iVar10;
    *(undefined2 *)(local_48 + (longlong)iVar10 * 2) = 0;
  }
LAB_140201b42:
  plVar9 = (longlong *)
           (*(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8)
           + 0x70);
  local_res18[0] = (short)param_3;
  (**(code **)(*plVar9 + 0xe40))(plVar9,1,&DAT_1405d85a0,local_res18,local_res20,param_5,&local_48);
  puVar8 = local_48;
  if (((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_48 + -8, puVar1 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_38 = uVar7;
    FUN_14034ed40(uVar7);
    local_30 = 1;
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar7);
  }
  return;
}



void FUN_140201c00(longlong param_1,int param_2,int param_3,undefined4 param_4,longlong *param_5,
                  longlong *param_6,undefined8 param_7,undefined8 param_8,undefined8 param_9,
                  undefined8 param_10,undefined8 param_11)

{
  int *piVar1;
  undefined *puVar2;
  bool bVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined8 uVar9;
  undefined *puVar10;
  longlong *plVar11;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined *local_78;
  undefined *local_70;
  undefined *local_68;
  undefined *local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined1 local_48;
  
  if (param_3 < 0) {
    return;
  }
  local_58 = 0xfffffffffffffffe;
  if (*(short *)(param_1 + 700) <= param_3) {
    return;
  }
  if ((*param_5 == 0) && (param_5[1] == 0)) {
    bVar3 = false;
  }
  else {
    bVar3 = true;
  }
  if (!bVar3) {
    return;
  }
  if ((*param_6 == 0) && (param_6[1] == 0)) {
    bVar3 = false;
  }
  else {
    bVar3 = true;
  }
  if (!bVar3) {
    return;
  }
  if (*(longlong *)(param_1 + 0x4c0) == 0) {
    return;
  }
  local_res20[0] = param_4;
  FUN_14034fe70();
  uVar9 = param_11;
  local_60 = PTR_DAT_1405d8010;
  iVar4 = FUN_14034fcf0(param_11);
  if (local_60 == (undefined *)0x0) {
    iVar6 = 0;
  }
  else if (local_60 == PTR_DAT_1405d8010) {
    iVar6 = 0;
  }
  else {
    iVar6 = *(int *)(local_60 + -8);
  }
  iVar5 = iVar4;
  if (iVar4 <= iVar6) {
    if (local_60 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (local_60 == PTR_DAT_1405d8010) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(local_60 + -8);
    }
  }
  iVar6 = 1;
  if (1 < iVar5) {
    iVar6 = iVar5;
  }
  if (local_60 == (undefined *)0x0) {
    iVar5 = 0;
  }
  else if (local_60 == PTR_DAT_1405d8010) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(local_60 + -8);
  }
  if (iVar5 < iVar6) {
    FUN_140002d30(&local_60);
  }
  FUN_140002e10(&local_60);
  puVar10 = local_60;
  if (local_60 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,uVar9,iVar4);
  puVar10 = local_60;
  if (local_60 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar10);
  iVar5 = 0;
  iVar4 = iVar5;
  if (0 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = iVar5;
  if ((local_60 != (undefined *)0x0) && (iVar6 = 0, local_60 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_60 + -8);
  }
  if ((iVar4 < iVar6) || (iVar4 = iVar5, local_60 == (undefined *)0x0)) {
LAB_140201da9:
    if (((local_60 != PTR_DAT_1405d8010) && (local_60 != (undefined *)0x0)) &&
       ((int *)(local_60 + -8) != (int *)0x0)) {
      *(int *)(local_60 + -8) = iVar4;
      *(undefined2 *)(local_60 + (longlong)iVar4 * 2) = 0;
    }
  }
  else if (local_60 != PTR_DAT_1405d8010) {
    iVar4 = *(int *)(local_60 + -8);
    goto LAB_140201da9;
  }
  FUN_14034fe70();
  local_68 = PTR_DAT_1405d8010;
  iVar6 = FUN_14034fcf0(param_9);
  iVar5 = 0;
  iVar4 = iVar5;
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_68 + -8);
  }
  iVar8 = 0;
  iVar7 = iVar6;
  if (((iVar6 <= iVar4) && (iVar7 = iVar5, local_68 != (undefined *)0x0)) &&
     (iVar7 = iVar8, local_68 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_68 + -8);
  }
  iVar4 = 1;
  if (1 < iVar7) {
    iVar4 = iVar7;
  }
  if ((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_68 + -8);
  }
  if (iVar8 < iVar4) {
    FUN_140002d30(&local_68);
  }
  FUN_140002e10(&local_68);
  puVar10 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,param_9,iVar6);
  puVar10 = local_68;
  if (local_68 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar10);
  iVar5 = 0;
  iVar4 = iVar5;
  if (0 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = iVar5;
  if ((local_68 != (undefined *)0x0) && (iVar6 = 0, local_68 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_68 + -8);
  }
  if ((iVar4 < iVar6) || (iVar4 = iVar5, local_68 == (undefined *)0x0)) {
LAB_140201eb2:
    if (((local_68 != PTR_DAT_1405d8010) && (local_68 != (undefined *)0x0)) &&
       ((int *)(local_68 + -8) != (int *)0x0)) {
      *(int *)(local_68 + -8) = iVar4;
      *(undefined2 *)(local_68 + (longlong)iVar4 * 2) = 0;
    }
  }
  else if (local_68 != PTR_DAT_1405d8010) {
    iVar4 = *(int *)(local_68 + -8);
    goto LAB_140201eb2;
  }
  FUN_14034fe70();
  local_70 = PTR_DAT_1405d8010;
  iVar6 = FUN_14034fcf0(param_8);
  iVar5 = 0;
  iVar4 = iVar5;
  if ((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_70 + -8);
  }
  iVar8 = 0;
  iVar7 = iVar6;
  if (((iVar6 <= iVar4) && (iVar7 = iVar5, local_70 != (undefined *)0x0)) &&
     (iVar7 = iVar8, local_70 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_70 + -8);
  }
  iVar4 = 1;
  if (1 < iVar7) {
    iVar4 = iVar7;
  }
  if ((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_70 + -8);
  }
  if (iVar8 < iVar4) {
    FUN_140002d30(&local_70);
  }
  FUN_140002e10(&local_70);
  puVar10 = local_70;
  if (local_70 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,param_8,iVar6);
  puVar10 = local_70;
  if (local_70 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar10);
  iVar5 = 0;
  iVar4 = iVar5;
  if (0 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = iVar5;
  if ((local_70 != (undefined *)0x0) && (iVar6 = 0, local_70 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_70 + -8);
  }
  if ((iVar4 < iVar6) || (iVar4 = iVar5, local_70 == (undefined *)0x0)) {
LAB_140201fb8:
    if (((local_70 != PTR_DAT_1405d8010) && (local_70 != (undefined *)0x0)) &&
       ((int *)(local_70 + -8) != (int *)0x0)) {
      *(int *)(local_70 + -8) = iVar4;
      *(undefined2 *)(local_70 + (longlong)iVar4 * 2) = 0;
    }
  }
  else if (local_70 != PTR_DAT_1405d8010) {
    iVar4 = *(int *)(local_70 + -8);
    goto LAB_140201fb8;
  }
  FUN_14034fe70();
  local_78 = PTR_DAT_1405d8008;
  iVar6 = FUN_14034fd90(param_7);
  iVar5 = 0;
  iVar4 = iVar5;
  if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8008)) {
    iVar4 = *(int *)(local_78 + -8);
  }
  iVar8 = 0;
  iVar7 = iVar6;
  if (((iVar6 <= iVar4) && (iVar7 = iVar5, local_78 != (undefined *)0x0)) &&
     (iVar7 = iVar8, local_78 != PTR_DAT_1405d8008)) {
    iVar7 = *(int *)(local_78 + -8);
  }
  iVar4 = 1;
  if (1 < iVar7) {
    iVar4 = iVar7;
  }
  if ((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8008)) {
    iVar8 = *(int *)(local_78 + -8);
  }
  if (iVar8 < iVar4) {
    FUN_140057890(&local_78);
  }
  FUN_140057970(&local_78);
  puVar10 = local_78;
  if (local_78 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar10,param_7,iVar6);
  puVar10 = local_78;
  if (local_78 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8008;
  }
  iVar6 = FUN_14034fd90(puVar10);
  iVar4 = 0;
  if (0 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = 0;
  if ((local_78 != (undefined *)0x0) && (iVar6 = 0, local_78 != PTR_DAT_1405d8008)) {
    iVar6 = *(int *)(local_78 + -8);
  }
  if ((iVar6 <= iVar4) && (iVar4 = 0, local_78 != (undefined *)0x0)) {
    if (local_78 == PTR_DAT_1405d8008) goto LAB_1402020db;
    iVar4 = *(int *)(local_78 + -8);
  }
  if (((local_78 != PTR_DAT_1405d8008) && (local_78 != (undefined *)0x0)) &&
     (piVar1 = (int *)(local_78 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar4;
    *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
  }
LAB_1402020db:
  plVar11 = (longlong *)
            (*(longlong *)
              (*(longlong *)(*(longlong *)(param_1 + 0x4c0) + 8) + (longlong)param_2 * 8) + 0x70);
  local_res18[0] = (short)param_3;
  (**(code **)(*plVar11 + 0xe60))
            (plVar11,1,&DAT_1405d85a0,local_res18,local_res20,param_5,param_6,&local_78,&local_70,
             &local_68,&param_10,&local_60,&stack0x00000060);
  puVar10 = local_78;
  if (((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8008)) &&
     (puVar2 = local_78 + -8, puVar2 != (undefined *)0x0)) {
    uVar9 = FUN_14034fe70();
    local_50 = uVar9;
    FUN_14034ed40(uVar9);
    local_48 = 1;
    piVar1 = (int *)(puVar10 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar9);
  }
  puVar10 = local_70;
  local_78 = PTR_DAT_1405d8008;
  if (((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1405d8010)) &&
     (puVar2 = local_70 + -8, puVar2 != (undefined *)0x0)) {
    uVar9 = FUN_14034fe70();
    local_50 = uVar9;
    FUN_14034ed40(uVar9);
    local_48 = 1;
    piVar1 = (int *)(puVar10 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar9);
  }
  puVar10 = local_68;
  local_70 = PTR_DAT_1405d8010;
  if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) &&
     (puVar2 = local_68 + -8, puVar2 != (undefined *)0x0)) {
    uVar9 = FUN_14034fe70();
    local_50 = uVar9;
    FUN_14034ed40(uVar9);
    local_48 = 1;
    piVar1 = (int *)(puVar10 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar9);
  }
  puVar10 = local_60;
  if (((local_60 != (undefined *)0x0) && (local_60 != PTR_DAT_1405d8010)) &&
     (puVar2 = local_60 + -8, puVar2 != (undefined *)0x0)) {
    local_68 = PTR_DAT_1405d8010;
    uVar9 = FUN_14034fe70();
    local_50 = uVar9;
    FUN_14034ed40(uVar9);
    local_48 = 1;
    piVar1 = (int *)(puVar10 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar9);
  }
  return;
}



void FUN_1402022c0(undefined8 param_1,undefined4 *param_2,undefined4 *param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,int param_10)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  longlong lVar3;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  wchar_t local_170 [50];
  undefined8 local_10c;
  undefined8 local_104;
  wchar_t local_fc;
  undefined4 uStack_f9;
  undefined1 local_f4 [8];
  undefined8 local_ec;
  undefined8 local_e4;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  ulonglong local_cc;
  undefined1 local_c4;
  uint local_c3;
  undefined2 local_bf;
  undefined8 local_bd;
  undefined4 local_b5;
  undefined8 local_a5;
  undefined4 local_9d;
  undefined4 local_99;
  undefined4 local_95;
  undefined4 local_91;
  WCHAR local_88;
  undefined1 local_86 [110];
  
  local_dc = 0;
  local_d8 = 0;
  local_d4 = 0;
  local_d0 = 0;
  local_cc = 0;
  local_c4 = 0;
  local_c3 = 0;
  local_bf = 0;
  local_a5 = 0;
  local_bd = 0;
  local_b5 = 0;
  memset(local_170,0,100);
  local_184 = *(undefined4 *)(DAT_140608000 + 0x140);
  local_180 = *param_2;
  _local_fc = 0;
  local_17c = param_2[1];
  local_f4 = (undefined1  [8])0x0;
  local_178 = param_2[2];
  local_ec = 0;
  local_174 = param_2[3];
  local_e4 = 0;
  local_10c = *(undefined8 *)(param_2 + 4);
  local_104 = *(undefined8 *)(param_2 + 6);
  if (param_3 != (undefined4 *)0x0) {
    local_dc = *param_3;
    local_d8 = param_3[1];
    local_d4 = param_3[2];
    local_d0 = param_3[3];
    local_cc = (ulonglong)(uint)param_3[6];
    local_c4 = *(undefined1 *)(param_3 + 10);
    local_c3 = (uint)*(ushort *)(param_3 + 0x1f);
    local_bf = CONCAT11(*(undefined1 *)(param_3 + 0x1b),*(undefined1 *)(param_3 + 0x12));
    if (param_10 < 1) {
      param_10 = (int)*(short *)(param_3 + 7);
    }
    local_a5 = CONCAT44(param_6,param_10);
    lVar3 = 3;
    puVar1 = param_3 + 0xf;
    do {
      puVar2 = puVar1 + 1;
      lVar3 = lVar3 + -1;
      *(undefined4 *)((longlong)&local_104 + (7 - (longlong)param_3) + (longlong)puVar2) =
           puVar1[-3];
      *(undefined4 *)(local_f4 + (3 - (longlong)param_3) + (longlong)puVar2) = *puVar1;
      puVar1 = puVar2;
    } while (lVar3 != 0);
  }
  local_9d = param_7;
  local_99 = param_8;
  local_88 = L'\0';
  local_95 = param_9;
  local_91 = param_5;
  local_188 = param_4;
  memset(local_86,0,0x62);
  MultiByteToWideChar(0,1,(LPCSTR)(param_2 + 0x10),0x32,&local_88,0x32);
  wcsncpy_s(local_170,0x32,&local_88,0x31);
  wcsncpy_s(&local_fc,0x10,(wchar_t *)(param_2 + 8),0xf);
  FUN_1401fe720(param_1,*(undefined4 *)((longlong)param_2 + 0x72),
                *(undefined4 *)((longlong)param_2 + 0x76),&local_188);
  return;
}



void FUN_1402024f0(undefined8 param_1,longlong param_2,undefined8 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,undefined4 param_10)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  wchar_t *_Src;
  undefined8 local_98;
  undefined8 uStack_90;
  undefined4 local_88;
  undefined4 uStack_84;
  undefined4 uStack_80;
  undefined4 uStack_7c;
  wchar_t local_78 [16];
  char local_58 [50];
  undefined4 local_26;
  undefined4 local_22;
  
  if (param_2 != 0) {
    uVar1 = *(undefined4 *)(param_2 + 0x288);
    uVar2 = *(undefined4 *)(param_2 + 0x170);
    uVar3 = *(undefined4 *)(param_2 + 0x284);
    uVar4 = *(undefined4 *)(param_2 + 0x174);
    uVar5 = *(undefined4 *)(param_2 + 0x178);
    uVar6 = *(undefined4 *)(param_2 + 0x17c);
    uVar7 = *(undefined8 *)(param_2 + 0x160);
    uVar8 = *(undefined8 *)(param_2 + 0x168);
    _Src = (wchar_t *)FUN_1401a6410(param_2);
    local_98 = uVar7;
    uStack_90 = uVar8;
    local_88 = uVar2;
    uStack_84 = uVar4;
    uStack_80 = uVar5;
    uStack_7c = uVar6;
    local_26 = uVar1;
    local_22 = uVar3;
    if (_Src != (wchar_t *)0x0) {
      wcsncpy_s(local_78,0x10,_Src,0xf);
    }
    if ((char *)(param_2 + 0x330) != (char *)0x0) {
      strncpy_s(local_58,0x32,(char *)(param_2 + 0x330),0x31);
    }
    FUN_1402022c0(param_1,&local_98,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10
                 );
  }
  return;
}



void FUN_140202650(longlong param_1,longlong *param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  size_t sVar5;
  wchar_t *pwVar6;
  longlong *plVar7;
  bool bVar8;
  undefined2 local_res10 [4];
  longlong *local_d8;
  longlong *local_d0;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined2 local_c0;
  longlong local_be;
  longlong local_b6;
  longlong local_ae;
  longlong local_a6;
  undefined8 local_9e;
  undefined8 local_96;
  undefined8 local_8e;
  char local_86 [50];
  wchar_t local_54 [22];
  undefined8 local_28;
  
  if (param_2 == (longlong *)0x0) {
    return;
  }
  local_28 = 0xfffffffffffffffe;
  FUN_140198570(param_2,&local_d8);
  plVar1 = local_d8;
  if (local_d8 != (longlong *)0x0) {
    if (local_d8 == local_d0) {
      if (*local_d8 != 0) {
        local_c0 = 0;
        local_be = 0;
        local_b6 = 0;
        local_ae = 0;
        local_a6 = 0;
        local_9e = 0;
        local_96 = 0;
        local_8e = 0;
        local_86[0] = '\0';
        local_86[1] = '\0';
        local_86[2] = '\0';
        local_86[3] = '\0';
        local_86[4] = '\0';
        local_86[5] = '\0';
        local_86[6] = '\0';
        local_86[7] = '\0';
        local_86[8] = '\0';
        local_86[9] = '\0';
        local_86[10] = '\0';
        local_86[0xb] = '\0';
        local_86[0xc] = '\0';
        local_86[0xd] = '\0';
        local_86[0xe] = '\0';
        local_86[0xf] = '\0';
        local_86[0x10] = '\0';
        local_86[0x11] = '\0';
        local_86[0x12] = '\0';
        local_86[0x13] = '\0';
        local_86[0x14] = '\0';
        local_86[0x15] = '\0';
        local_86[0x16] = '\0';
        local_86[0x17] = '\0';
        local_86[0x18] = '\0';
        local_86[0x19] = '\0';
        local_86[0x1a] = '\0';
        local_86[0x1b] = '\0';
        local_86[0x1c] = '\0';
        local_86[0x1d] = '\0';
        local_86[0x1e] = '\0';
        local_86[0x1f] = '\0';
        local_86[0x20] = '\0';
        local_86[0x21] = '\0';
        local_86[0x22] = '\0';
        local_86[0x23] = '\0';
        local_86[0x24] = '\0';
        local_86[0x25] = '\0';
        local_86[0x26] = '\0';
        local_86[0x27] = '\0';
        local_86[0x28] = '\0';
        local_86[0x29] = '\0';
        local_86[0x2a] = '\0';
        local_86[0x2b] = '\0';
        local_86[0x2c] = '\0';
        local_86[0x2d] = '\0';
        local_86[0x2e] = '\0';
        local_86[0x2f] = '\0';
        local_86[0x30] = '\0';
        local_86[0x31] = '\0';
        local_54[0] = L'\0';
        local_54[1] = L'\0';
        local_54[2] = L'\0';
        local_54[3] = L'\0';
        local_54[4] = L'\0';
        local_54[5] = L'\0';
        local_54[6] = L'\0';
        local_54[7] = L'\0';
        local_54[8] = L'\0';
        local_54[9] = L'\0';
        local_54[10] = L'\0';
        local_54[0xb] = L'\0';
        local_54[0xc] = L'\0';
        local_54[0xd] = L'\0';
        local_54[0xe] = L'\0';
        local_54[0xf] = L'\0';
        local_c4 = *(undefined4 *)(DAT_140608000 + 0x140);
        local_c8 = param_3;
        local_c0 = (**(code **)(*param_2 + 0x18))(param_2);
        local_be = param_2[0x2c];
        local_b6 = param_2[0x2d];
        local_ae = param_2[0x2e];
        local_a6 = param_2[0x2f];
        local_9e = CONCAT44(local_9e._4_4_,*(undefined4 *)(*plVar1 + 0x120));
        lVar4 = (**(code **)(*(longlong *)*plVar1 + 0x270))();
        local_9e = CONCAT44(*(undefined4 *)(lVar4 + 0x58),(undefined4)local_9e);
        lVar4 = (**(code **)(*(longlong *)*plVar1 + 0x270))();
        local_96 = CONCAT44(param_4,*(undefined4 *)(lVar4 + 0x5c));
        local_8e = CONCAT44(param_6,param_5);
        sVar5 = strnlen((char *)(param_2 + 0x66),0x32);
        if (sVar5 < 0x32) {
          strcpy_s(local_86,0x32,(char *)(param_2 + 0x66));
        }
        pwVar6 = (wchar_t *)(*plVar1 + 0xd0);
        if (7 < *(ulonglong *)(*plVar1 + 0xe8)) {
          pwVar6 = *(wchar_t **)pwVar6;
        }
        sVar5 = wcsnlen(pwVar6,0x10);
        if (sVar5 < 0x10) {
          pwVar6 = (wchar_t *)(*plVar1 + 0xd0);
          if (7 < *(ulonglong *)(*plVar1 + 0xe8)) {
            pwVar6 = *(wchar_t **)pwVar6;
          }
          wcscpy_s(local_54,0x10,pwVar6);
        }
        iVar3 = *(int *)((longlong)param_2 + 0x284);
        lVar4 = param_2[0x51];
        if ((-1 < iVar3) && (iVar3 < *(short *)(param_1 + 700))) {
          if ((DAT_14060b7cc & 1) == 0) {
            DAT_14060b7cc = DAT_14060b7cc | 1;
            FUN_1402d5c80();
            atexit((_func_5014 *)&DAT_140448e50);
          }
          if ((DAT_140608744 != 0) && (*(longlong *)(param_1 + 0x4c8) != 0)) {
            local_res10[0] = (undefined2)iVar3;
            plVar7 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)(int)lVar4 * 8
                       ) + 0x70);
            (**(code **)(*plVar7 + 0xc60))(plVar7,1,&DAT_1405d85a0,local_res10,&local_c8);
          }
        }
        goto LAB_1402028f9;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_d0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1402028f9:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar2 = (undefined8 *)*local_d8;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_d8);
  }
  return;
}



void FUN_140202940(longlong param_1,longlong param_2,undefined4 param_3,undefined8 *param_4)

{
  longlong *plVar1;
  int iVar2;
  int iVar3;
  size_t sVar4;
  wchar_t *pwVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  bool bVar8;
  undefined2 local_res10 [4];
  longlong *local_e8;
  longlong *local_e0;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined8 local_c4;
  undefined8 local_bc;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined8 local_ac;
  undefined4 local_a4;
  char local_a0 [50];
  wchar_t local_6e [35];
  undefined8 local_28;
  
  if (param_2 == 0) {
    return;
  }
  local_28 = 0xfffffffffffffffe;
  puVar7 = param_4;
  FUN_140198570(param_2,&local_e8);
  plVar1 = local_e8;
  if (local_e8 != (longlong *)0x0) {
    if (local_e8 == local_e0) {
      if (*local_e8 != 0) {
        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_6e[0] = L'\0';
        local_6e[1] = L'\0';
        local_6e[2] = L'\0';
        local_6e[3] = L'\0';
        local_6e[4] = L'\0';
        local_6e[5] = L'\0';
        local_6e[6] = L'\0';
        local_6e[7] = L'\0';
        local_6e[8] = L'\0';
        local_6e[9] = L'\0';
        local_6e[10] = L'\0';
        local_6e[0xb] = L'\0';
        local_6e[0xc] = L'\0';
        local_6e[0xd] = L'\0';
        local_6e[0xe] = L'\0';
        local_6e[0xf] = L'\0';
        local_6e[0x10] = L'\0';
        local_6e[0x11] = L'\0';
        local_6e[0x12] = L'\0';
        local_6e[0x13] = L'\0';
        local_6e[0x14] = L'\0';
        local_6e[0x15] = L'\0';
        local_6e[0x16] = L'\0';
        local_6e[0x17] = L'\0';
        local_6e[0x18] = L'\0';
        local_6e[0x19] = L'\0';
        local_6e[0x1a] = L'\0';
        local_6e[0x1b] = L'\0';
        local_6e[0x1c] = L'\0';
        local_6e[0x1d] = L'\0';
        local_6e[0x1e] = L'\0';
        local_6e[0x1f] = L'\0';
        local_d4 = *(undefined4 *)(param_2 + 0x160);
        local_d0 = *(undefined4 *)(param_2 + 0x164);
        local_cc = *(undefined4 *)(param_2 + 0x168);
        local_c8 = *(undefined4 *)(param_2 + 0x16c);
        local_c4 = *puVar7;
        local_bc = puVar7[1];
        local_b4 = *(undefined4 *)(puVar7 + 2);
        local_b0 = 1;
        local_ac = puVar7[3];
        local_a4 = *(undefined4 *)(puVar7 + 4);
        local_d8 = param_3;
        sVar4 = strnlen((char *)(param_2 + 0x330),0x32);
        if (sVar4 < 0x32) {
          strcpy_s(local_a0,0x32,(char *)(param_2 + 0x330));
        }
        pwVar5 = (wchar_t *)(*plVar1 + 0xd0);
        if (7 < *(ulonglong *)(*plVar1 + 0xe8)) {
          pwVar5 = *(wchar_t **)pwVar5;
        }
        sVar4 = wcsnlen(pwVar5,0x10);
        if (sVar4 < 0x10) {
          pwVar5 = (wchar_t *)(*plVar1 + 0xd0);
          if (7 < *(ulonglong *)(*plVar1 + 0xe8)) {
            pwVar5 = *(wchar_t **)pwVar5;
          }
          wcscpy_s(local_6e,0x10,pwVar5);
        }
        sVar4 = wcsnlen((wchar_t *)((longlong)param_4 + 0x24),0x10);
        if (sVar4 < 0x10) {
          wcscpy_s(local_6e + 0x10,0x10,(wchar_t *)((longlong)param_4 + 0x24));
        }
        iVar3 = *(int *)(param_2 + 0x284);
        iVar2 = *(int *)(param_2 + 0x288);
        if ((-1 < iVar3) && (iVar3 < *(short *)(param_1 + 700))) {
          if ((DAT_14060b7cc & 1) == 0) {
            DAT_14060b7cc = DAT_14060b7cc | 1;
            FUN_1402d5c80();
            atexit((_func_5014 *)&DAT_140448e50);
          }
          if ((DAT_140608740 != 0) && (*(longlong *)(param_1 + 0x4c8) != 0)) {
            local_res10[0] = (undefined2)iVar3;
            plVar6 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)iVar2 * 8) +
                     0x70);
            (**(code **)(*plVar6 + 0xcf0))(plVar6,1,&DAT_1405d85a0,local_res10,&local_d8);
          }
        }
        goto LAB_140202bbf;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_e0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_140202bbf:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar7 = (undefined8 *)*local_e8;
    if (puVar7 != (undefined8 *)0x0) {
      (**(code **)*puVar7)(puVar7,1);
    }
    operator_delete(local_e8);
  }
  return;
}



void FUN_140202c10(longlong param_1,longlong param_2,undefined4 param_3,undefined4 param_4,
                  undefined1 param_5)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  undefined1 uVar4;
  int iVar5;
  size_t sVar6;
  wchar_t *pwVar7;
  longlong *plVar8;
  bool bVar9;
  undefined2 local_res10 [4];
  longlong *local_c8;
  longlong *local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined8 local_a4;
  undefined2 local_9c;
  undefined1 local_9a;
  char local_99 [50];
  wchar_t local_67 [23];
  undefined8 local_38;
  
  if (param_2 == 0) {
    return;
  }
  local_38 = 0xfffffffffffffffe;
  FUN_140198570(param_2,&local_c8);
  plVar1 = local_c8;
  if (local_c8 != (longlong *)0x0) {
    if (local_c8 == local_c0) {
      if (*local_c8 != 0) {
        local_b8 = 0;
        local_a4 = 0;
        local_9a = 0;
        local_99[0] = '\0';
        local_99[1] = '\0';
        local_99[2] = '\0';
        local_99[3] = '\0';
        local_99[4] = '\0';
        local_99[5] = '\0';
        local_99[6] = '\0';
        local_99[7] = '\0';
        local_99[8] = '\0';
        local_99[9] = '\0';
        local_99[10] = '\0';
        local_99[0xb] = '\0';
        local_99[0xc] = '\0';
        local_99[0xd] = '\0';
        local_99[0xe] = '\0';
        local_99[0xf] = '\0';
        local_99[0x10] = '\0';
        local_99[0x11] = '\0';
        local_99[0x12] = '\0';
        local_99[0x13] = '\0';
        local_99[0x14] = '\0';
        local_99[0x15] = '\0';
        local_99[0x16] = '\0';
        local_99[0x17] = '\0';
        local_99[0x18] = '\0';
        local_99[0x19] = '\0';
        local_99[0x1a] = '\0';
        local_99[0x1b] = '\0';
        local_99[0x1c] = '\0';
        local_99[0x1d] = '\0';
        local_99[0x1e] = '\0';
        local_99[0x1f] = '\0';
        local_99[0x20] = '\0';
        local_99[0x21] = '\0';
        local_99[0x22] = '\0';
        local_99[0x23] = '\0';
        local_99[0x24] = '\0';
        local_99[0x25] = '\0';
        local_99[0x26] = '\0';
        local_99[0x27] = '\0';
        local_99[0x28] = '\0';
        local_99[0x29] = '\0';
        local_99[0x2a] = '\0';
        local_99[0x2b] = '\0';
        local_99[0x2c] = '\0';
        local_99[0x2d] = '\0';
        local_99[0x2e] = '\0';
        local_99[0x2f] = '\0';
        local_99[0x30] = '\0';
        local_99[0x31] = '\0';
        local_67[0] = L'\0';
        local_67[1] = L'\0';
        local_67[2] = L'\0';
        local_67[3] = L'\0';
        local_67[4] = L'\0';
        local_67[5] = L'\0';
        local_67[6] = L'\0';
        local_67[7] = L'\0';
        local_67[8] = L'\0';
        local_67[9] = L'\0';
        local_67[10] = L'\0';
        local_67[0xb] = L'\0';
        local_67[0xc] = L'\0';
        local_67[0xd] = L'\0';
        local_67[0xe] = L'\0';
        local_67[0xf] = L'\0';
        local_b4 = *(undefined4 *)(param_2 + 0x170);
        local_b0 = *(undefined4 *)(param_2 + 0x174);
        local_ac = *(undefined4 *)(param_2 + 0x178);
        local_a8 = *(undefined4 *)(param_2 + 0x17c);
        local_9c = (ushort)(byte)*(undefined4 *)(*local_c8 + 0x120);
        uVar4 = FUN_1402f8580(*local_c8);
        local_9c = CONCAT11(uVar4,(undefined1)local_9c);
        local_9a = param_5;
        local_a4 = CONCAT44(param_4,param_3);
        local_b8 = 300;
        sVar6 = strnlen((char *)(param_2 + 0x330),0x32);
        if (sVar6 < 0x32) {
          strcpy_s(local_99,0x32,(char *)(param_2 + 0x330));
        }
        pwVar7 = (wchar_t *)(*plVar1 + 0xd0);
        if (7 < *(ulonglong *)(*plVar1 + 0xe8)) {
          pwVar7 = *(wchar_t **)pwVar7;
        }
        sVar6 = wcsnlen(pwVar7,0x10);
        if (sVar6 < 0x10) {
          pwVar7 = (wchar_t *)(*plVar1 + 0xd0);
          if (7 < *(ulonglong *)(*plVar1 + 0xe8)) {
            pwVar7 = *(wchar_t **)pwVar7;
          }
          wcscpy_s(local_67,0x10,pwVar7);
        }
        iVar5 = *(int *)(param_2 + 0x284);
        iVar2 = *(int *)(param_2 + 0x288);
        if ((-1 < iVar5) && (iVar5 < *(short *)(param_1 + 700))) {
          if ((DAT_14060b7cc & 1) == 0) {
            DAT_14060b7cc = DAT_14060b7cc | 1;
            FUN_1402d5c80();
            atexit((_func_5014 *)&DAT_140448e50);
          }
          if ((DAT_140608728 != 0) && (*(longlong *)(param_1 + 0x4c8) != 0)) {
            local_res10[0] = (undefined2)iVar5;
            plVar8 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) + (longlong)iVar2 * 8) +
                     0x70);
            (**(code **)(*plVar8 + 0xd20))(plVar8,1,&DAT_1405d85a0,local_res10,&local_b8);
          }
        }
        goto LAB_140202e54;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar9 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_c0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_140202e54:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar3 = (undefined8 *)*local_c8;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_c8);
  }
  return;
}



void FUN_140202ea0(longlong param_1,longlong *param_2,wchar_t *param_3,wchar_t *param_4)

{
  undefined8 *puVar1;
  longlong lVar2;
  int iVar3;
  undefined4 uVar4;
  size_t sVar5;
  wchar_t *pwVar6;
  longlong *plVar7;
  bool bVar8;
  undefined2 local_res10 [4];
  longlong *local_3a8;
  longlong *local_3a0;
  undefined8 local_388;
  undefined4 local_380;
  undefined4 local_37c;
  undefined4 local_378;
  undefined4 local_374;
  undefined8 local_370;
  longlong local_368;
  longlong lStack_360;
  char local_358 [50];
  wchar_t local_326 [383];
  
  if (param_2 == (longlong *)0x0) {
    return;
  }
  FUN_140198570();
  if (local_3a8 != (longlong *)0x0) {
    if (local_3a8 == local_3a0) {
      if (*local_3a8 != 0) {
        local_388 = 0;
        local_380 = 0;
        local_37c = 0;
        local_378 = 0;
        local_374 = 0;
        local_370 = 0;
        local_368 = 0;
        lStack_360 = 0;
        local_358[0] = '\0';
        local_358[1] = '\0';
        local_358[2] = '\0';
        local_358[3] = '\0';
        local_358[4] = '\0';
        local_358[5] = '\0';
        local_358[6] = '\0';
        local_358[7] = '\0';
        local_358[8] = '\0';
        local_358[9] = '\0';
        local_358[10] = '\0';
        local_358[0xb] = '\0';
        local_358[0xc] = '\0';
        local_358[0xd] = '\0';
        local_358[0xe] = '\0';
        local_358[0xf] = '\0';
        local_358[0x10] = '\0';
        local_358[0x11] = '\0';
        local_358[0x12] = '\0';
        local_358[0x13] = '\0';
        local_358[0x14] = '\0';
        local_358[0x15] = '\0';
        local_358[0x16] = '\0';
        local_358[0x17] = '\0';
        local_358[0x18] = '\0';
        local_358[0x19] = '\0';
        local_358[0x1a] = '\0';
        local_358[0x1b] = '\0';
        local_358[0x1c] = '\0';
        local_358[0x1d] = '\0';
        local_358[0x1e] = '\0';
        local_358[0x1f] = '\0';
        local_358[0x20] = '\0';
        local_358[0x21] = '\0';
        local_358[0x22] = '\0';
        local_358[0x23] = '\0';
        local_358[0x24] = '\0';
        local_358[0x25] = '\0';
        local_358[0x26] = '\0';
        local_358[0x27] = '\0';
        local_358[0x28] = '\0';
        local_358[0x29] = '\0';
        local_358[0x2a] = '\0';
        local_358[0x2b] = '\0';
        local_358[0x2c] = '\0';
        local_358[0x2d] = '\0';
        local_358[0x2e] = '\0';
        local_358[0x2f] = '\0';
        local_358[0x30] = '\0';
        local_358[0x31] = '\0';
        local_326[0] = L'\0';
        local_326[1] = L'\0';
        local_326[2] = L'\0';
        local_326[3] = L'\0';
        local_326[4] = L'\0';
        local_326[5] = L'\0';
        local_326[6] = L'\0';
        local_326[7] = L'\0';
        local_326[8] = L'\0';
        local_326[9] = L'\0';
        local_326[10] = L'\0';
        local_326[0xb] = L'\0';
        local_326[0xc] = L'\0';
        local_326[0xd] = L'\0';
        local_326[0xe] = L'\0';
        local_326[0xf] = L'\0';
        local_326[0x10] = L'\0';
        local_326[0x11] = L'\0';
        local_326[0x12] = L'\0';
        local_326[0x13] = L'\0';
        local_326[0x14] = L'\0';
        local_326[0x15] = L'\0';
        local_326[0x16] = L'\0';
        local_326[0x17] = L'\0';
        local_326[0x18] = L'\0';
        local_326[0x19] = L'\0';
        local_326[0x1a] = L'\0';
        local_326[0x1b] = L'\0';
        local_326[0x1c] = L'\0';
        local_326[0x1d] = L'\0';
        local_326[0x1e] = L'\0';
        local_326[0x1f] = L'\0';
        memset(local_326 + 0x20,0,700);
        local_388 = CONCAT44(*(undefined4 *)(DAT_140608000 + 0x140),(undefined4)local_388);
        local_380 = (undefined4)param_2[0x2c];
        local_37c = *(undefined4 *)((longlong)param_2 + 0x164);
        local_378 = (undefined4)param_2[0x2d];
        local_374 = *(undefined4 *)((longlong)param_2 + 0x16c);
        local_368 = param_2[0x2e];
        lStack_360 = param_2[0x2f];
        uVar4 = (**(code **)(*param_2 + 0x18))(param_2);
        local_370 = CONCAT44(uVar4,(undefined4)local_370);
        sVar5 = strnlen((char *)(param_2 + 0x66),0x32);
        if (sVar5 < 0x32) {
          strcpy_s(local_358,0x32,(char *)(param_2 + 0x66));
        }
        pwVar6 = (wchar_t *)(*local_3a8 + 0xd0);
        if (7 < *(ulonglong *)(*local_3a8 + 0xe8)) {
          pwVar6 = *(wchar_t **)pwVar6;
        }
        sVar5 = wcsnlen(pwVar6,0x10);
        if (sVar5 < 0x10) {
          pwVar6 = (wchar_t *)(*local_3a8 + 0xd0);
          if (7 < *(ulonglong *)(*local_3a8 + 0xe8)) {
            pwVar6 = *(wchar_t **)pwVar6;
          }
          wcscpy_s(local_326,0x10,pwVar6);
        }
        sVar5 = wcsnlen(param_3,0x10);
        if (sVar5 < 0x10) {
          wcscpy_s(local_326 + 0x10,0x10,param_3);
        }
        sVar5 = wcsnlen(param_4,0x15e);
        if (sVar5 < 0x15e) {
          wcscpy_s(local_326 + 0x20,0x15e,param_4);
        }
        iVar3 = *(int *)((longlong)param_2 + 0x284);
        lVar2 = param_2[0x51];
        if ((-1 < iVar3) && (iVar3 < *(short *)(param_1 + 700))) {
          if ((DAT_14060b7cc & 1) == 0) {
            DAT_14060b7cc = DAT_14060b7cc | 1;
            FUN_1402d5c80();
            atexit((_func_5014 *)&DAT_140448e50);
          }
          if ((DAT_140608738 != 0) && (*(longlong *)(param_1 + 0x4d0) != 0)) {
            local_res10[0] = (undefined2)iVar3;
            plVar7 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(*(longlong *)(param_1 + 0x4d0) + 8) + (longlong)(int)lVar2 * 8
                       ) + 0x70);
            (**(code **)(*plVar7 + 0xd40))(plVar7,1,&DAT_1405d85a0,local_res10,&local_388);
          }
        }
        goto LAB_140203197;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar8 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_3a8 == (longlong *)0x0) {
    return;
  }
  if (local_3a8 != local_3a0) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_140203197:
  LOCK();
  plVar7 = local_3a8 + 1;
  *(int *)plVar7 = (int)*plVar7 + -1;
  UNLOCK();
  if ((int)*plVar7 == 0) {
    puVar1 = (undefined8 *)*local_3a8;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
    }
    operator_delete(local_3a8);
  }
  return;
}



void FUN_1402031e0(longlong param_1,longlong param_2,undefined4 *param_3,wchar_t *param_4,
                  undefined4 param_5)

{
  void *pvVar1;
  int iVar2;
  wchar_t *_Src;
  undefined4 *puVar3;
  longlong *plVar4;
  longlong lVar5;
  bool bVar6;
  undefined2 local_res10 [4];
  longlong *local_128;
  longlong *local_120;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  wchar_t local_f0 [5];
  undefined4 local_e6 [5];
  undefined1 local_d0 [4];
  undefined4 local_cc;
  undefined4 local_c8;
  undefined1 local_c4 [4];
  undefined4 local_c0;
  undefined4 local_bc;
  undefined1 local_b8 [4];
  uint local_b4;
  undefined1 local_b0;
  undefined1 local_af;
  undefined4 local_ae;
  int local_6e;
  undefined4 local_6a;
  undefined4 local_66;
  undefined4 local_62;
  wchar_t local_5e [16];
  undefined4 local_3e;
  undefined8 local_38;
  
  if (param_2 == 0) {
    return;
  }
  local_38 = 0xfffffffffffffffe;
  FUN_140197b70(param_2);
  if (local_128 != (longlong *)0x0) {
    if (local_128 == local_120) {
      if (*local_128 != 0) {
        memset(&local_118,0,0xde);
        local_118 = 0x192;
        local_114 = *(undefined4 *)(DAT_140608000 + 0x140);
        local_110 = *(undefined4 *)(param_2 + 0x160);
        local_10c = *(undefined4 *)(param_2 + 0x164);
        local_108 = *(undefined4 *)(param_2 + 0x168);
        local_104 = *(undefined4 *)(param_2 + 0x16c);
        local_100 = *(undefined4 *)(param_2 + 0x170);
        local_fc = *(undefined4 *)(param_2 + 0x174);
        local_f8 = *(undefined4 *)(param_2 + 0x178);
        local_f4 = *(undefined4 *)(param_2 + 0x17c);
        if (param_3 != (undefined4 *)0x0) {
          local_d0 = (undefined1  [4])*param_3;
          local_cc = param_3[1];
          local_c8 = param_3[2];
          local_c4 = (undefined1  [4])param_3[3];
          local_c0 = param_3[6];
          local_bc = param_3[0xb];
          local_b8 = (undefined1  [4])(int)*(short *)(param_3 + 10);
          local_b4 = (uint)*(ushort *)(param_3 + 0x1f);
          local_b0 = *(undefined1 *)(param_3 + 0x12);
          local_af = *(undefined1 *)(param_3 + 0x1b);
          local_6e = (int)*(short *)(param_3 + 7);
          local_ae = param_3[9];
          lVar5 = 0;
          puVar3 = param_3 + 0xf;
          do {
            *(undefined4 *)(((longlong)local_e6 - (longlong)param_3) + (longlong)puVar3) =
                 puVar3[-3];
            *(undefined4 *)((longlong)local_e6 + (0xc - (longlong)param_3) + (longlong)puVar3) =
                 *puVar3;
            *(undefined4 *)(local_d0 + (2 - (longlong)param_3) + (longlong)puVar3) = puVar3[4];
            *(undefined4 *)(local_c4 + (2 - (longlong)param_3) + (longlong)puVar3) = puVar3[7];
            *(uint *)(local_b8 + (2 - (longlong)param_3) + (longlong)puVar3) =
                 (uint)*(byte *)((longlong)param_3 + lVar5 + 100);
            lVar5 = lVar5 + 1;
            puVar3 = puVar3 + 1;
          } while (lVar5 < 3);
        }
        local_6a = *(undefined4 *)(*local_128 + 0x50a0);
        local_62 = 0;
        local_3e = param_5;
        local_66 = *(undefined4 *)(*local_128 + 0x50a0);
        lVar5 = FUN_1401a6410(param_2);
        if (lVar5 != 0) {
          _Src = (wchar_t *)FUN_1401a6410(param_2);
          wcscpy_s(local_f0,0x10,_Src);
        }
        if (param_4 != (wchar_t *)0x0) {
          wcscpy_s(local_5e,0x10,param_4);
        }
        iVar2 = *(int *)(param_2 + 0x284);
        if (((-1 < iVar2) && (iVar2 < *(short *)(param_1 + 700))) &&
           (*(longlong *)(param_1 + 0x4c8) != 0)) {
          local_res10[0] = (undefined2)iVar2;
          plVar4 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(*(longlong *)(param_1 + 0x4c8) + 8) +
                     (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar4 + 0xd80))(plVar4,1,&DAT_1405d85a0,local_res10,&local_118);
        }
        goto LAB_14020348e;
      }
    }
    else {
      iVar2 = DAT_140608048 + 1;
      bVar6 = DAT_140608048 == 0;
      DAT_140608048 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_128 == (longlong *)0x0) {
    return;
  }
  if (local_128 != local_120) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14020348e:
  LOCK();
  plVar4 = local_128 + 1;
  *(int *)plVar4 = (int)*plVar4 + -1;
  UNLOCK();
  if ((int)*plVar4 == 0) {
    pvVar1 = (void *)*local_128;
    if (pvVar1 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar1 + 0xf630);
      operator_delete(pvVar1);
    }
    operator_delete(local_128);
  }
  return;
}



void FUN_1402034e0(undefined8 param_1,int param_2,undefined4 param_3,undefined4 *param_4,
                  undefined4 *param_5,undefined4 param_6,int param_7,undefined4 param_8,
                  undefined4 param_9,int param_10)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  longlong lVar3;
  longlong lVar4;
  int local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined8 local_d0;
  undefined8 local_c8;
  wchar_t local_c0 [7];
  undefined4 local_b2 [4];
  undefined4 local_a0;
  undefined1 local_9c [4];
  undefined4 local_98;
  undefined4 local_94;
  undefined1 local_90 [4];
  undefined4 local_8c;
  int local_88;
  undefined1 local_84 [4];
  undefined1 local_80;
  undefined1 local_7f;
  undefined4 local_7e;
  int local_7a;
  undefined4 local_3a;
  int local_36;
  int local_32;
  int local_2e;
  undefined4 local_2a;
  undefined4 local_26;
  undefined4 local_22;
  
  memset(&local_e8,0,0xca);
  local_e4 = *(undefined4 *)(DAT_140608000 + 0x140);
  local_e0 = *param_4;
  local_dc = param_4[1];
  local_d8 = param_4[2];
  local_d4 = param_4[3];
  local_d0 = *(undefined8 *)(param_4 + 4);
  local_c8 = *(undefined8 *)(param_4 + 6);
  local_22 = param_3;
  if (param_5 != (undefined4 *)0x0) {
    local_a0 = *param_5;
    local_9c = (undefined1  [4])param_5[1];
    local_98 = param_5[2];
    local_94 = param_5[3];
    local_90 = (undefined1  [4])param_5[6];
    local_8c = param_5[0xb];
    local_88 = (int)*(short *)(param_5 + 10);
    local_84 = (undefined1  [4])(uint)*(ushort *)(param_5 + 0x1f);
    local_80 = *(undefined1 *)(param_5 + 0x12);
    local_7f = *(undefined1 *)(param_5 + 0x1b);
    local_7e = param_5[9];
    local_7a = 6 - *(short *)(param_5 + 0x25);
    puVar1 = param_5 + 0xf;
    lVar3 = 0;
    do {
      lVar4 = lVar3 + 1;
      puVar2 = puVar1 + 1;
      *(undefined4 *)((longlong)local_c0 + (10 - (longlong)param_5) + (longlong)puVar2) = puVar1[-3]
      ;
      *(undefined4 *)((longlong)local_b2 + (8 - (longlong)param_5) + (longlong)puVar2) = *puVar1;
      *(undefined4 *)((longlong)&local_a0 + (2 - (longlong)param_5) + (longlong)puVar2) = puVar1[4];
      *(undefined4 *)((longlong)&local_94 + (2 - (longlong)param_5) + (longlong)puVar2) = puVar1[7];
      *(uint *)((longlong)&local_88 + (2 - (longlong)param_5) + (longlong)puVar2) =
           (uint)*(byte *)((longlong)param_5 + lVar3 + 100);
      puVar1 = puVar2;
      lVar3 = lVar4;
    } while (lVar4 < 3);
  }
  local_3a = param_6;
  local_2a = param_8;
  local_32 = param_10;
  local_2e = param_7;
  local_26 = param_9;
  if (((((param_2 != 0x19a) && (param_2 != 0x1a0)) && (param_2 != 0x1a1)) &&
      ((param_2 != 0x1a9 && (param_2 != 0x1ac)))) &&
     ((param_2 != 0x1ad && ((param_2 != 0x1ab && (param_2 != 0x1cc)))))) {
    param_7 = -param_7;
  }
  local_36 = param_10 + param_7;
  local_e8 = param_2;
  if ((wchar_t *)(param_4 + 8) != (wchar_t *)0x0) {
    wcsncpy_s(local_c0,0x10,(wchar_t *)(param_4 + 8),0xf);
  }
  FUN_140200330(param_1,*(undefined4 *)((longlong)param_4 + 0x72),
                *(undefined4 *)((longlong)param_4 + 0x76),&local_e8);
  return;
}



void FUN_140203700(undefined8 param_1,undefined4 param_2,undefined4 param_3,longlong param_4,
                  undefined8 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  void *pvVar8;
  int iVar9;
  wchar_t *_Src;
  bool bVar10;
  longlong *local_d8;
  longlong *local_d0;
  undefined4 local_c8;
  undefined4 uStack_c4;
  undefined4 uStack_c0;
  undefined4 uStack_bc;
  undefined8 local_b8;
  undefined8 local_a8;
  undefined8 uStack_a0;
  undefined4 local_98;
  undefined4 uStack_94;
  undefined4 uStack_90;
  undefined4 uStack_8c;
  wchar_t local_88 [16];
  char local_68 [50];
  undefined4 local_36;
  undefined4 local_32;
  
  if (param_4 == 0) {
    return;
  }
  local_b8 = 0xfffffffffffffffe;
  FUN_140197b70(param_4,&local_d8);
  plVar1 = local_d8;
  if (local_d8 != (longlong *)0x0) {
    if (local_d8 == local_d0) {
      if (*local_d8 != 0) {
        uVar2 = *(undefined4 *)(param_4 + 0x284);
        uVar3 = *(undefined4 *)(param_4 + 0x288);
        uVar4 = *(undefined4 *)(param_4 + 0x170);
        uVar5 = *(undefined4 *)(param_4 + 0x174);
        uVar6 = *(undefined4 *)(param_4 + 0x178);
        uVar7 = *(undefined4 *)(param_4 + 0x17c);
        local_c8 = *(undefined4 *)(param_4 + 0x160);
        uStack_c4 = *(undefined4 *)(param_4 + 0x164);
        uStack_c0 = *(undefined4 *)(param_4 + 0x168);
        uStack_bc = *(undefined4 *)(param_4 + 0x16c);
        _Src = (wchar_t *)FUN_1401a6410(param_4);
        local_a8 = CONCAT44(uStack_c4,local_c8);
        uStack_a0 = CONCAT44(uStack_bc,uStack_c0);
        local_98 = uVar4;
        uStack_94 = uVar5;
        uStack_90 = uVar6;
        uStack_8c = uVar7;
        local_36 = uVar3;
        local_32 = uVar2;
        if (_Src != (wchar_t *)0x0) {
          wcsncpy_s(local_88,0x10,_Src,0xf);
        }
        if ((char *)(param_4 + 0x330) != (char *)0x0) {
          strncpy_s(local_68,0x32,(char *)(param_4 + 0x330),0x31);
        }
        FUN_1402034e0(param_1,param_2,param_3,&local_a8,param_5,param_6,param_7,param_8,param_9,
                      *(undefined4 *)(*plVar1 + 0x50a0));
        goto LAB_1402038c7;
      }
    }
    else {
      iVar9 = DAT_140608048 + 1;
      bVar10 = DAT_140608048 == 0;
      DAT_140608048 = iVar9;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_d0) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_1402038c7:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar8 = (void *)*local_d8;
    if (pvVar8 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar8 + 0xf630);
      operator_delete(pvVar8);
    }
    operator_delete(local_d8);
  }
  return;
}



void FUN_140203920(undefined8 param_1,longlong param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,int param_7)

{
  undefined4 uVar1;
  wchar_t *_Src;
  size_t sVar2;
  undefined4 local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  undefined4 local_2ec;
  undefined4 local_2e8;
  undefined4 local_2e4;
  undefined4 local_2e0;
  undefined4 local_2dc;
  undefined4 local_2d8;
  undefined4 local_2d4;
  undefined4 local_2d0;
  wchar_t local_2cc [50];
  wchar_t local_268 [16];
  undefined8 local_248;
  undefined8 local_240;
  undefined8 local_238;
  wchar_t local_228;
  undefined1 local_226 [526];
  
  local_248 = 0;
  local_240 = 0;
  local_238 = 0;
  memset(local_2cc,0,100);
  local_2f0 = *(undefined4 *)(DAT_140608000 + 0x140);
  local_2ec = *(undefined4 *)(param_2 + 0x160);
  local_268[0] = L'\0';
  local_268[1] = L'\0';
  local_268[2] = L'\0';
  local_268[3] = L'\0';
  local_2e8 = *(undefined4 *)(param_2 + 0x164);
  local_2e4 = *(undefined4 *)(param_2 + 0x168);
  local_2e0 = *(undefined4 *)(param_2 + 0x16c);
  local_268[4] = L'\0';
  local_268[5] = L'\0';
  local_268[6] = L'\0';
  local_268[7] = L'\0';
  local_2dc = *(undefined4 *)(param_2 + 0x170);
  local_268[8] = L'\0';
  local_268[9] = L'\0';
  local_268[10] = L'\0';
  local_268[0xb] = L'\0';
  local_2d8 = *(undefined4 *)(param_2 + 0x174);
  local_268[0xc] = L'\0';
  local_268[0xd] = L'\0';
  local_268[0xe] = L'\0';
  local_268[0xf] = L'\0';
  local_2d4 = *(undefined4 *)(param_2 + 0x178);
  local_2d0 = *(undefined4 *)(param_2 + 0x17c);
  local_2f8 = param_3;
  local_2f4 = param_4;
  uVar1 = FUN_1401a64a0(param_2);
  local_248 = CONCAT44(local_248._4_4_,uVar1);
  uVar1 = FUN_1401a6390(param_2);
  local_248 = CONCAT44(uVar1,(undefined4)local_248);
  uVar1 = FUN_1401a6310(param_2);
  local_240 = CONCAT44(param_6,uVar1);
  if (param_7 < 0) {
    param_7 = 0;
  }
  local_238 = CONCAT44(param_5,param_7);
  _Src = (wchar_t *)FUN_1401a6410(param_2);
  wcscpy_s(local_268,0x10,_Src);
  local_228 = L'\0';
  memset(local_226,0,0x206);
  MultiByteToWideChar(0,1,(LPCSTR)(param_2 + 0x330),0x32,&local_228,0x32);
  sVar2 = wcsnlen(&local_228,0x32);
  if (sVar2 < 0x32) {
    wcscpy_s(local_2cc,0x32,&local_228);
  }
  FUN_140201550(param_1,*(undefined4 *)(param_2 + 0x288),*(undefined4 *)(param_2 + 0x284),&local_2f8
               );
  return;
}



void FUN_140203af0(undefined8 param_1,longlong param_2,longlong param_3,int *param_4)

{
  undefined8 uVar1;
  wchar_t *pwVar2;
  size_t sVar3;
  undefined4 local_3e8;
  undefined4 local_3e4;
  undefined4 local_3e0;
  undefined4 local_3dc;
  undefined4 local_3d8;
  undefined4 local_3d4;
  undefined4 local_3d0;
  undefined4 local_3cc;
  undefined4 local_3c8;
  undefined4 local_3c4;
  wchar_t local_3c0 [50];
  wchar_t local_35c [16];
  undefined4 local_33c;
  undefined4 local_338;
  undefined4 local_334;
  undefined4 local_330;
  wchar_t local_32c [16];
  undefined4 local_30c;
  undefined4 local_308;
  longlong local_304;
  int local_2fc;
  int local_2f8;
  int iStack_2f4;
  int iStack_2f0;
  int iStack_2ec;
  int local_2e8;
  int iStack_2e4;
  int iStack_2e0;
  float fStack_2dc;
  float local_2d8;
  int iStack_2d4;
  undefined8 uStack_2d0;
  undefined8 local_2c8;
  undefined8 uStack_2c0;
  int local_2b8;
  int local_2b4;
  int iStack_2b0;
  int iStack_2ac;
  int iStack_2a8;
  int local_2a4;
  int iStack_2a0;
  int iStack_29c;
  float fStack_298;
  float local_294;
  int iStack_290;
  int iStack_28c;
  int iStack_288;
  int local_284;
  int iStack_280;
  int iStack_27c;
  int iStack_278;
  int local_274;
  undefined8 local_238;
  undefined8 local_230;
  undefined8 local_228;
  WCHAR local_218;
  undefined1 local_216 [526];
  
  if (param_3 != 0) {
    FUN_140057c10(&local_3e8);
    local_3e8 = 0x1fc;
    local_3e4 = *(undefined4 *)(DAT_140608000 + 0x140);
    local_3e0 = *(undefined4 *)(param_2 + 0x160);
    local_3dc = *(undefined4 *)(param_2 + 0x164);
    local_3d8 = *(undefined4 *)(param_2 + 0x168);
    local_3d4 = *(undefined4 *)(param_2 + 0x16c);
    local_3d0 = *(undefined4 *)(param_2 + 0x170);
    local_3cc = *(undefined4 *)(param_2 + 0x174);
    local_3c8 = *(undefined4 *)(param_2 + 0x178);
    local_3c4 = *(undefined4 *)(param_2 + 0x17c);
    pwVar2 = (wchar_t *)FUN_1401a6410(param_2);
    wcscpy_s(local_35c,0x10,pwVar2);
    local_218 = L'\0';
    memset(local_216,0,0x206);
    MultiByteToWideChar(0,1,(LPCSTR)(param_2 + 0x330),0x32,&local_218,0x32);
    sVar3 = wcsnlen(&local_218,0x32);
    if (sVar3 < 0x32) {
      wcscpy_s(local_3c0,0x32,&local_218);
    }
    pwVar2 = (wchar_t *)(param_3 + 0x48);
    if (7 < *(ulonglong *)(param_3 + 0x60)) {
      pwVar2 = *(wchar_t **)pwVar2;
    }
    wcscpy_s(local_32c,0x10,pwVar2);
    local_33c = *(undefined4 *)(param_3 + 0x20);
    local_2fc = *(int *)(param_3 + 0x90);
    local_338 = *(undefined4 *)(param_3 + 0x24);
    local_334 = *(undefined4 *)(param_3 + 0x28);
    iStack_2f4 = (int)*(undefined8 *)(param_3 + 0xac);
    local_330 = *(undefined4 *)(param_3 + 0x2c);
    local_30c = *(undefined4 *)(param_3 + 0x18);
    local_2f8 = (int)*(undefined8 *)(param_3 + 0xa4);
    local_308 = *(undefined4 *)(param_3 + 0x74);
    iStack_2ec = (int)((ulonglong)*(undefined8 *)(param_3 + 0xac) >> 0x20);
    local_304 = (longlong)(local_2fc * 0x3c);
    iStack_2f0 = (int)*(undefined8 *)(param_3 + 0xbc);
    local_238 = *(undefined8 *)(param_3 + 0xc4);
    local_230 = *(undefined8 *)(param_3 + 0xcc);
    iStack_2e0 = (int)*(undefined8 *)(param_3 + 0xb4);
    uVar1 = *(undefined8 *)(param_3 + 0xd4);
    local_228._0_4_ = (float)uVar1;
    local_228._4_4_ = (float)((ulonglong)uVar1 >> 0x20);
    local_2e8 = (int)((ulonglong)*(undefined8 *)(param_3 + 0xa4) >> 0x20);
    fStack_2dc = (float)local_228;
    local_2d8 = local_228._4_4_;
    iStack_2e4 = (int)((ulonglong)*(undefined8 *)(param_3 + 0xb4) >> 0x20);
    _local_2b4 = CONCAT44(iStack_2f4 - param_4[1],local_2f8 - *param_4);
    _iStack_2ac = CONCAT44(iStack_2ec - param_4[3],iStack_2f0 - param_4[2]);
    _local_2a4 = CONCAT44(iStack_2e4 - param_4[5],local_2e8 - param_4[4]);
    _iStack_29c = CONCAT44((float)local_228 - (float)param_4[7],iStack_2e0 - param_4[6]);
    _local_294 = CONCAT44(iStack_2d4 - param_4[9],local_228._4_4_ - (float)param_4[8]);
    iStack_28c = (int)uStack_2d0;
    iStack_288 = (int)((ulonglong)uStack_2d0 >> 0x20);
    _iStack_28c = CONCAT44(iStack_288 - param_4[0xb],iStack_28c - param_4[10]);
    local_274 = local_2b8 - param_4[0x10];
    local_284 = (int)local_2c8;
    iStack_280 = (int)((ulonglong)local_2c8 >> 0x20);
    _local_284 = CONCAT44(iStack_280 - param_4[0xd],local_284 - param_4[0xc]);
    iStack_27c = (int)uStack_2c0;
    iStack_278 = (int)((ulonglong)uStack_2c0 >> 0x20);
    _iStack_27c = CONCAT44(iStack_278 - param_4[0xf],iStack_27c - param_4[0xe]);
    local_228 = uVar1;
    FUN_140201160(param_1,*(undefined4 *)(param_2 + 0x288),*(undefined4 *)(param_2 + 0x284),
                  &local_3e8);
  }
  return;
}



void FUN_140203e10(undefined8 param_1,undefined4 param_2,longlong param_3,longlong *param_4,
                  int *param_5)

{
  longlong lVar1;
  longlong lVar2;
  wchar_t *pwVar3;
  size_t sVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined4 local_3b8;
  undefined4 local_3b4;
  undefined4 local_3b0;
  undefined4 local_3ac;
  undefined4 local_3a8;
  undefined4 local_3a4;
  undefined4 local_3a0;
  undefined4 local_39c;
  undefined4 local_398;
  undefined4 local_394;
  wchar_t local_390 [50];
  wchar_t local_32c [16];
  undefined4 local_30c;
  undefined4 local_308;
  undefined4 local_304;
  undefined4 local_300;
  wchar_t local_2fc [16];
  undefined4 local_2dc;
  undefined4 local_2d8;
  undefined8 local_2d4;
  undefined4 local_2cc;
  int local_2c8;
  int iStack_2c4;
  undefined8 uStack_2c0;
  undefined8 local_2b8;
  undefined8 uStack_2b0;
  undefined8 local_2a8;
  undefined8 uStack_2a0;
  undefined8 local_298;
  undefined8 uStack_290;
  int local_288;
  int local_284;
  int iStack_280;
  int iStack_27c;
  int iStack_278;
  int local_274;
  int iStack_270;
  int iStack_26c;
  float fStack_268;
  float local_264;
  int iStack_260;
  int iStack_25c;
  int iStack_258;
  int local_254;
  int iStack_250;
  int iStack_24c;
  int iStack_248;
  int local_244;
  undefined4 local_240;
  undefined1 local_23c;
  undefined4 local_23b;
  WCHAR local_228;
  undefined1 local_226 [526];
  
  if ((((param_4 != (longlong *)0x0) &&
       (lVar1 = (**(code **)(*param_4 + 0x280))(param_4), lVar1 != 0)) &&
      (lVar2 = FUN_1402f38a0(DAT_140608068,(int)param_4[0x24]), lVar2 != 0)) &&
     (lVar2 = *(longlong *)(lVar2 + 0x930), lVar2 != 0)) {
    FUN_140057c10(&local_3b8);
    local_3b4 = *(undefined4 *)(DAT_140608000 + 0x140);
    local_3b0 = *(undefined4 *)(param_3 + 0x160);
    local_3ac = *(undefined4 *)(param_3 + 0x164);
    local_3a8 = *(undefined4 *)(param_3 + 0x168);
    local_3a4 = *(undefined4 *)(param_3 + 0x16c);
    local_3a0 = *(undefined4 *)(param_3 + 0x170);
    local_39c = *(undefined4 *)(param_3 + 0x174);
    local_398 = *(undefined4 *)(param_3 + 0x178);
    local_394 = *(undefined4 *)(param_3 + 0x17c);
    local_3b8 = param_2;
    pwVar3 = (wchar_t *)FUN_1401a6410(param_3);
    wcscpy_s(local_32c,0x10,pwVar3);
    uVar6 = 0;
    local_228 = L'\0';
    memset(local_226,0,0x206);
    MultiByteToWideChar(0,1,(LPCSTR)(param_3 + 0x330),0x32,&local_228,0x32);
    sVar4 = wcsnlen(&local_228,0x32);
    if (sVar4 < 0x32) {
      wcscpy_s(local_390,0x32,&local_228);
    }
    pwVar3 = (wchar_t *)(param_4 + 0x1a);
    if (7 < (ulonglong)param_4[0x1d]) {
      pwVar3 = *(wchar_t **)pwVar3;
    }
    wcscpy_s(local_2fc,0x10,pwVar3);
    local_30c = (undefined4)param_4[0x1f6];
    local_308 = *(undefined4 *)((longlong)param_4 + 0xfb4);
    local_304 = (undefined4)param_4[0x1f7];
    local_300 = *(undefined4 *)((longlong)param_4 + 0xfbc);
    local_2dc = (undefined4)param_4[0x24];
    local_2d8 = FUN_1402f8580(param_4);
    lVar5 = (**(code **)(*param_4 + 0x278))(param_4);
    if (lVar5 != 0) {
      uVar6 = *(undefined8 *)(lVar5 + 0x60);
    }
    local_2cc = *(undefined4 *)(lVar2 + 0xc);
    local_23c = *(int *)(lVar2 + 0x40) != 0;
    local_23b = *(undefined4 *)(lVar1 + 0x78);
    local_2d4 = uVar6;
    FUN_140204160(&local_2c8,param_4);
    fStack_268 = (float)((ulonglong)uStack_2b0 >> 0x20);
    local_244 = local_288 - param_5[0x10];
    local_264 = (float)local_2a8;
    iStack_26c = (int)uStack_2b0;
    _local_284 = CONCAT44(iStack_2c4 - param_5[1],local_2c8 - *param_5);
    iStack_260 = (int)((ulonglong)local_2a8 >> 0x20);
    iStack_27c = (int)uStack_2c0;
    iStack_278 = (int)((ulonglong)uStack_2c0 >> 0x20);
    _iStack_27c = CONCAT44(iStack_278 - param_5[3],iStack_27c - param_5[2]);
    local_274 = (int)local_2b8;
    iStack_270 = (int)((ulonglong)local_2b8 >> 0x20);
    _local_274 = CONCAT44(iStack_270 - param_5[5],local_274 - param_5[4]);
    _iStack_26c = CONCAT44(fStack_268 - (float)param_5[7],iStack_26c - param_5[6]);
    _local_264 = CONCAT44(iStack_260 - param_5[9],local_264 - (float)param_5[8]);
    iStack_25c = (int)uStack_2a0;
    iStack_258 = (int)((ulonglong)uStack_2a0 >> 0x20);
    _iStack_25c = CONCAT44(iStack_258 - param_5[0xb],iStack_25c - param_5[10]);
    local_254 = (int)local_298;
    iStack_250 = (int)((ulonglong)local_298 >> 0x20);
    _local_254 = CONCAT44(iStack_250 - param_5[0xd],local_254 - param_5[0xc]);
    iStack_24c = (int)uStack_290;
    iStack_248 = (int)((ulonglong)uStack_290 >> 0x20);
    _iStack_24c = CONCAT44(iStack_248 - param_5[0xf],iStack_24c - param_5[0xe]);
    if (param_4[0x26] != 0) {
      local_240 = *(undefined4 *)(param_4[0x26] + 0x274);
    }
    FUN_140201160(param_1,*(undefined4 *)(param_3 + 0x288),*(undefined4 *)(param_3 + 0x284),
                  &local_3b8);
  }
  return;
}



void FUN_140204160(undefined4 *param_1,longlong *param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  float fVar3;
  
  lVar2 = (**(code **)(*param_2 + 0x280))(param_2);
  if (lVar2 != 0) {
    *param_1 = *(undefined4 *)(lVar2 + 0x84);
    param_1[1] = *(undefined4 *)(lVar2 + 0x8c);
    param_1[2] = *(undefined4 *)(lVar2 + 0x94);
    param_1[3] = *(undefined4 *)(lVar2 + 0x9c);
    param_1[4] = *(undefined4 *)(lVar2 + 0x88);
    param_1[5] = *(undefined4 *)(lVar2 + 0x90);
    param_1[6] = *(undefined4 *)(lVar2 + 0x98);
    param_1[7] = *(undefined4 *)(lVar2 + 0xa0);
    param_1[8] = *(undefined4 *)(lVar2 + 0xa4);
    param_1[9] = (int)*(float *)((longlong)param_2 + 0x59c);
    param_1[10] = (int)*(float *)((longlong)param_2 + 0x5a4);
    fVar3 = (float)FUN_1402f9360(param_2);
    param_1[0xb] = (int)fVar3;
    uVar1 = (**(code **)(*param_2 + 0x2e0))(param_2);
    param_1[0xc] = uVar1;
    fVar3 = (float)FUN_1402f93f0(param_2);
    param_1[0xd] = (int)fVar3;
    uVar1 = (**(code **)(*param_2 + 0x2e8))(param_2);
    param_1[0xe] = uVar1;
    param_1[0xf] = (int)(*(float *)(param_2 + 0xbc) + *(float *)((longlong)param_2 + 0x5dc) +
                         *(float *)((longlong)param_2 + 0x5e4) + *(float *)(param_2 + 0x121));
    fVar3 = (float)FUN_140215260(param_2);
    param_1[0x10] = (int)fVar3;
  }
  return;
}



void FUN_140204280(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x20d0) != 0) {
    lVar3 = 0;
    lVar9 = 0;
    bVar7 = false;
    uVar10 = 0;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar5 = lVar3;
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
        lVar4 = *plVar1;
        lVar5 = 0;
        if (lVar4 != 0) {
          if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
             DAT_1406080a8 = iVar2, bVar7)) {
            FUN_140176d60(1);
          }
          lVar9 = lVar4;
          FUN_14034ed40(lVar4);
          bVar7 = true;
          uVar10 = 1;
          lVar5 = lVar4;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar6 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    FUN_14031adc0(*(undefined8 *)(param_1 + 0x20d0),param_2,param_3,param_4,uVar8,lVar9,uVar10);
    if (bVar7) {
      FUN_14034edd0(lVar5);
    }
  }
  return;
}



undefined8 FUN_140204370(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x20d0) == 0) {
    uVar8 = 0;
  }
  else {
    lVar3 = 0;
    lVar9 = 0;
    bVar7 = false;
    uVar10 = 0;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar5 = lVar3;
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
        lVar4 = *plVar1;
        lVar5 = 0;
        if (lVar4 != 0) {
          if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
             DAT_1406080a8 = iVar2, bVar7)) {
            FUN_140176d60(1);
          }
          lVar9 = lVar4;
          FUN_14034ed40(lVar4);
          bVar7 = true;
          uVar10 = 1;
          lVar5 = lVar4;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar6 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    uVar8 = FUN_14031aec0(*(undefined8 *)(param_1 + 0x20d0),param_2,param_3,param_4,uVar8,lVar9,
                          uVar10);
    if (bVar7) {
      FUN_14034edd0(lVar5);
    }
  }
  return uVar8;
}



void FUN_140204470(longlong param_1,uint *param_2)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  char cVar4;
  longlong *plVar5;
  ulonglong uVar6;
  uint *puVar7;
  int *piVar8;
  uint uVar9;
  undefined2 local_res8 [4];
  ulonglong local_40;
  uint local_38;
  undefined4 local_34;
  ulonglong uVar10;
  
  if (*(longlong *)(param_1 + 0x20d0) != 0) {
    uVar9 = *param_2;
    plVar5 = (longlong *)FUN_1403161f0();
    if (*plVar5 != 0) {
      for (puVar7 = *(uint **)(*plVar5 + ((ulonglong)uVar9 % (ulonglong)*(uint *)(plVar5 + 2)) * 8);
          puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xe8)) {
        if ((puVar7[0xea] == uVar9) && (*puVar7 == uVar9)) {
          if (puVar7 != (uint *)0x0) {
            if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar9 = puVar7[3];
            goto LAB_140204503;
          }
          break;
        }
      }
    }
    uVar9 = 0;
LAB_140204503:
    uVar10 = 0;
    plVar5 = (longlong *)FUN_140267710(uVar9);
    if (plVar5 != (longlong *)0x0) {
      cVar4 = FUN_140195920(param_1 + 0x12e8);
      uVar6 = uVar10;
      if (cVar4 != '\0') {
        uVar6 = FUN_140195970(param_1 + 0x12e8);
        local_38 = local_38 & 0xffffff00;
        local_40 = uVar6;
        FUN_14034ed40(uVar6);
      }
      lVar2 = *(longlong *)(param_1 + 0x20d0);
      piVar8 = (int *)(lVar2 + 0xd4);
      do {
        if (*piVar8 == 0) {
          *(uint *)(lVar2 + 0xd4 + uVar10 * 0xc) = *param_2;
          *(uint *)(lVar2 + 0xd8 + uVar10 * 0xc) = param_2[1];
          *(uint *)(lVar2 + 0xdc + uVar10 * 0xc) = param_2[2];
          break;
        }
        uVar9 = (int)uVar10 + 1;
        uVar10 = (ulonglong)uVar9;
        piVar8 = piVar8 + 3;
      } while (uVar9 < 10);
      if (cVar4 != '\0') {
        FUN_14034edd0(uVar6);
      }
      (**(code **)(*plVar5 + 8))(plVar5,*param_2);
      *(uint *)(plVar5 + 0xc) = param_2[2];
      FUN_14023a030(param_1,*(undefined8 *)(param_1 + 0x20e0),plVar5);
      lVar2 = *(longlong *)(param_1 + 0x20e0);
      local_40 = *(ulonglong *)(lVar2 + 0x170);
      local_38 = *(undefined4 *)(lVar2 + 0x178);
      local_34 = *(undefined4 *)(lVar2 + 0x17c);
      iVar1 = *(int *)(lVar2 + 0x284);
      if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(lVar2 + 0xb50) + 700))) &&
         (lVar3 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4c0), lVar3 != 0)) {
        local_res8[0] = (undefined2)iVar1;
        plVar5 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(lVar2 + 0x288) * 8) +
                 0x70);
        (**(code **)(*plVar5 + 0xdd0))(plVar5,1,&DAT_1405d85a0,local_res8,&local_40,param_2);
      }
      plVar5 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x78);
      (**(code **)(*plVar5 + 0xbb0))
                (plVar5,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),&DAT_1405d85a0,param_2)
      ;
    }
  }
  return;
}



void FUN_1402046b0(longlong param_1,int *param_2)

{
  ulonglong *puVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  int *piVar5;
  longlong *plVar6;
  uint uVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  bool bVar11;
  bool bVar12;
  undefined2 local_res8 [4];
  undefined8 uVar13;
  ulonglong local_30;
  uint local_28;
  undefined4 local_24;
  
  uVar13 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x20d0) != 0) {
    uVar8 = 0;
    uVar9 = 0;
    bVar12 = false;
    puVar1 = *(ulonglong **)(param_1 + 0x12e8);
    uVar10 = uVar8;
    if (puVar1 != (ulonglong *)0x0) {
      uVar10 = uVar9;
      if (puVar1 == *(ulonglong **)(param_1 + 0x12f0)) {
        if (*puVar1 != 0) {
          uVar10 = *puVar1;
          if ((puVar1 != *(ulonglong **)(param_1 + 0x12f0)) &&
             (iVar4 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, uVar10 = uVar8,
             DAT_1406080a8 = iVar4, bVar12)) {
            FUN_140176d60(1);
          }
          local_28 = local_28 & 0xffffff00;
          local_30 = uVar10;
          FUN_14034ed40(uVar10);
          bVar12 = true;
        }
      }
      else {
        iVar4 = DAT_1406080a8 + 1;
        bVar11 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar4;
        if (bVar11) {
          FUN_140176d60(1);
        }
      }
    }
    piVar5 = (int *)(*(longlong *)(param_1 + 0x20d0) + 0xd8);
    do {
      if ((piVar5[-1] == *param_2) && (*piVar5 == param_2[1])) {
        *(int *)(*(longlong *)(param_1 + 0x20d0) + 0xdc + uVar8 * 0xc) = param_2[2];
        break;
      }
      uVar7 = (int)uVar8 + 1;
      uVar8 = (ulonglong)uVar7;
      piVar5 = piVar5 + 3;
    } while (uVar7 < 10);
    if (bVar12) {
      FUN_14034edd0(uVar10);
    }
    lVar2 = *(longlong *)(param_1 + 0x20e0);
    local_30 = *(ulonglong *)(lVar2 + 0x170);
    local_28 = *(undefined4 *)(lVar2 + 0x178);
    local_24 = *(undefined4 *)(lVar2 + 0x17c);
    iVar4 = *(int *)(lVar2 + 0x284);
    if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(lVar2 + 0xb50) + 700))) &&
       (lVar3 = *(longlong *)(*(longlong *)(lVar2 + 0xb50) + 0x4c0), lVar3 != 0)) {
      local_res8[0] = (undefined2)iVar4;
      plVar6 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(lVar2 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar6 + 0xde0))(plVar6,1,&DAT_1405d85a0,local_res8,&local_30,param_2,uVar13);
    }
    plVar6 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x78);
    (**(code **)(*plVar6 + 0xbc0))
              (plVar6,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),&DAT_1405d85a0,param_2);
  }
  return;
}



void FUN_140204890(longlong param_1,int *param_2)

{
  int iVar1;
  int *piVar2;
  longlong *plVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined2 local_res8 [4];
  undefined8 uVar10;
  longlong local_20;
  uint local_18;
  undefined4 local_14;
  
  uVar10 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x20d0) != 0) {
    lVar6 = 0;
    bVar9 = false;
    plVar3 = *(longlong **)(param_1 + 0x12e8);
    if (plVar3 != (longlong *)0x0) {
      if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
        lVar7 = *plVar3;
        lVar6 = 0;
        if (lVar7 != 0) {
          if (plVar3 != *(longlong **)(param_1 + 0x12f0)) {
            iVar1 = DAT_1406080a8 + 1;
            bVar9 = DAT_1406080a8 == 0;
            DAT_1406080a8 = iVar1;
            if (bVar9) {
              FUN_140176d60(1);
            }
            lVar7 = 0;
          }
          local_18 = local_18 & 0xffffff00;
          local_20 = lVar7;
          FUN_14034ed40(lVar7);
          bVar9 = true;
          lVar6 = lVar7;
        }
      }
      else {
        iVar1 = DAT_1406080a8 + 1;
        bVar8 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar1;
        if (bVar8) {
          FUN_140176d60(1);
        }
      }
    }
    lVar7 = *(longlong *)(param_1 + 0x20d0);
    uVar5 = 0;
    piVar2 = (int *)(lVar7 + 0xd8);
    do {
      if ((piVar2[-1] == *param_2) && (*piVar2 == param_2[1])) {
        *(undefined4 *)(lVar7 + 0xd4 + uVar5 * 0xc) = 0;
        *(undefined4 *)(lVar7 + (uVar5 * 3 + 0x36) * 4) = 0;
        *(undefined4 *)(lVar7 + 0xdc + uVar5 * 0xc) = 0;
        break;
      }
      uVar4 = (int)uVar5 + 1;
      uVar5 = (ulonglong)uVar4;
      piVar2 = piVar2 + 3;
    } while (uVar4 < 10);
    if (bVar9) {
      FUN_14034edd0(lVar6);
    }
    FUN_14023a160(param_1,*param_2);
    lVar6 = *(longlong *)(param_1 + 0x20e0);
    local_20 = *(longlong *)(lVar6 + 0x170);
    local_18 = *(undefined4 *)(lVar6 + 0x178);
    local_14 = *(undefined4 *)(lVar6 + 0x17c);
    iVar1 = *(int *)(lVar6 + 0x284);
    if (((-1 < iVar1) && (iVar1 < *(short *)(*(longlong *)(lVar6 + 0xb50) + 700))) &&
       (lVar7 = *(longlong *)(*(longlong *)(lVar6 + 0xb50) + 0x4c0), lVar7 != 0)) {
      local_res8[0] = (undefined2)iVar1;
      plVar3 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar7 + 8) + (longlong)*(int *)(lVar6 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar3 + 0xdf0))(plVar3,1,&DAT_1405d85a0,local_res8,&local_20,param_2,uVar10);
    }
    plVar3 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x78);
    (**(code **)(*plVar3 + 0xbd0))
              (plVar3,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),&DAT_1405d85a0,param_2);
  }
  return;
}



void FUN_140204a90(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  uint *puVar4;
  longlong lVar5;
  longlong lVar6;
  uint uVar7;
  uint *puVar8;
  uint *local_40;
  longlong local_38;
  undefined8 local_30;
  
  if (*(longlong *)(param_1 + 0x20d0) != 0) {
    local_40 = (uint *)0x0;
    local_38 = 0;
    local_30 = 0;
    FUN_140204280(param_1,&local_40,param_3,param_4,0xfffffffffffffffe);
    puVar1 = local_40;
    uVar7 = 0;
    lVar5 = (local_38 - (longlong)local_40) / 6 + (local_38 - (longlong)local_40 >> 0x3f);
    lVar6 = lVar5 >> 1;
    lVar5 = lVar5 >> 0x3f;
    puVar8 = local_40;
    if (lVar6 != lVar5) {
      do {
        uVar3 = *puVar8;
        plVar2 = (longlong *)FUN_1403161f0();
        if (*plVar2 != 0) {
          for (puVar4 = *(uint **)(*plVar2 +
                                  ((ulonglong)uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
              puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0xe8)) {
            if ((puVar4[0xea] == uVar3) && (*puVar4 == uVar3)) {
              if (puVar4 != (uint *)0x0) {
                if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar3 = puVar4[3];
                goto LAB_140204b68;
              }
              break;
            }
          }
        }
        uVar3 = 0;
LAB_140204b68:
        plVar2 = (longlong *)FUN_140267710(uVar3);
        if (plVar2 != (longlong *)0x0) {
          (**(code **)(*plVar2 + 8))(plVar2,*puVar8);
          *(uint *)(plVar2 + 0xc) = puVar8[2];
          FUN_14023a030(param_1,*(undefined8 *)(param_1 + 0x20e0),plVar2);
        }
        uVar7 = uVar7 + 1;
        puVar8 = puVar8 + 3;
      } while ((ulonglong)uVar7 < (ulonglong)(lVar6 - lVar5));
    }
    if (puVar1 != (uint *)0x0) {
      operator_delete(puVar1);
    }
  }
  return;
}



void FUN_140204bf0(longlong *param_1,undefined8 *param_2,undefined4 param_3,int param_4,int param_5,
                  int param_6)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  undefined4 *puVar4;
  undefined8 uVar5;
  longlong *plVar6;
  bool bVar7;
  undefined4 uVar8;
  float fVar9;
  undefined4 local_res20 [2];
  undefined8 local_58;
  undefined8 uStack_50;
  
  if (param_4 < 0x5de) {
    if (param_4 == 0x5dd) {
      *(float *)((longlong)param_1 + 0x734) =
           *(float *)((longlong)param_1 + 0x734) - (float)param_5 / 10000.0;
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    }
    switch(param_4) {
    case 0x3e9:
      goto LAB_140204c53;
    case 0x3ea:
      *(float *)(param_1 + 0xe7) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0xe7);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3eb:
      *(float *)((longlong)param_1 + 0x744) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x744);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3ec:
      *(float *)(param_1 + 0xe9) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0xe9);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3ed:
      *(float *)((longlong)param_1 + 0x74c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x74c);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3ee:
      *(float *)(param_1 + 0xea) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0xea);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3ef:
      *(float *)(param_1 + 0xeb) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0xeb);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3f0:
      *(float *)((longlong)param_1 + 0x75c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x75c);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3f1:
      puVar4 = local_res20;
      local_res20[0] = 0x3e4ccccd;
      fVar9 = (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x844);
      *(float *)((longlong)param_1 + 0x844) = fVar9;
      if (fVar9 <= 0.2) {
        puVar4 = (undefined4 *)((longlong)param_1 + 0x844);
      }
      *(undefined4 *)((longlong)param_1 + 0x844) = *puVar4;
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3f2:
      goto LAB_140204e43;
    case 0x3f3:
      *(float *)(param_1 + 0xb9) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0xb9);
      return;
    case 0x3f4:
      *(float *)((longlong)param_1 + 0x73c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x73c);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3f5:
      *(float *)(param_1 + 0xe8) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0xe8);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3f6:
      *(float *)((longlong)param_1 + 0x754) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x754);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3f7:
      *(float *)((longlong)param_1 + 0x80c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x80c);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3f8:
      *(float *)(param_1 + 0xee) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0xee);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3f9:
      *(float *)((longlong)param_1 + 0x774) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x774);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3fa:
      *(float *)(param_1 + 0x102) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x102);
      *(undefined1 *)((longlong)param_1 + 0x607) = 1;
      return;
    case 0x3fb:
      if (param_6 < 2) {
        return;
      }
      param_5 = param_5 * param_6;
LAB_140204c53:
      *(float *)((longlong)param_1 + 0x734) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x734);
      break;
    case 0x3fc:
      if (param_6 < 2) {
        return;
      }
      *(float *)(param_1 + 0xe7) = (float)(param_5 * param_6) / 10000.0 + *(float *)(param_1 + 0xe7)
      ;
      break;
    case 0x3fd:
      if (param_6 < 2) {
        return;
      }
      *(float *)((longlong)param_1 + 0x744) =
           (float)(param_5 * param_6) / 10000.0 + *(float *)((longlong)param_1 + 0x744);
      break;
    case 0x3fe:
      if (param_6 < 2) {
        return;
      }
      *(float *)((longlong)param_1 + 0x74c) =
           (float)(param_5 * param_6) / 10000.0 + *(float *)((longlong)param_1 + 0x74c);
      break;
    case 0x3ff:
      if (param_6 < 2) {
        return;
      }
      *(float *)(param_1 + 0xe9) = (float)(param_5 * param_6) / 10000.0 + *(float *)(param_1 + 0xe9)
      ;
      break;
    case 0x400:
      if (param_6 < 2) {
        return;
      }
      *(float *)(param_1 + 0xea) = (float)(param_5 * param_6) / 10000.0 + *(float *)(param_1 + 0xea)
      ;
      break;
    case 0x401:
      if (param_6 < 2) {
        return;
      }
      param_5 = param_5 * param_6;
LAB_140204e43:
      *(float *)((longlong)param_1 + 0x5dc) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x5dc);
LAB_140204e5e:
      *(undefined1 *)((longlong)param_1 + 0x605) = 1;
      return;
    case 0x402:
      if (param_6 < 2) {
        return;
      }
      *(float *)((longlong)param_1 + 0x80c) =
           (float)(param_5 * param_6) / 10000.0 + *(float *)((longlong)param_1 + 0x80c);
      break;
    case 0x403:
      if (param_6 < 2) {
        return;
      }
      *(float *)(param_1 + 0x102) =
           (float)(param_5 * param_6) / 10000.0 + *(float *)(param_1 + 0x102);
      break;
    case 0x404:
      *(float *)(param_1 + 0x103) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x103);
      break;
    case 0x405:
      *(float *)((longlong)param_1 + 0x81c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x81c);
      break;
    case 0x406:
      *(float *)(param_1 + 0x104) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x104);
      break;
    case 0x407:
      *(float *)((longlong)param_1 + 0x824) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x824);
      break;
    case 0x408:
      *(float *)(param_1 + 0x105) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x105);
      break;
    case 0x409:
      *(float *)((longlong)param_1 + 0x82c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x82c);
      break;
    case 0x40a:
      *(float *)(param_1 + 0x106) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x106);
      break;
    case 0x40b:
      *(float *)((longlong)param_1 + 0x834) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x834);
      break;
    case 0x40c:
      *(float *)(param_1 + 0x107) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x107);
      break;
    case 0x40d:
      plVar6 = (longlong *)local_res20;
      local_res20[0] = 0x3e4ccccd;
      fVar9 = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x108);
      *(float *)(param_1 + 0x108) = fVar9;
      if (fVar9 <= 0.2) {
        plVar6 = param_1 + 0x108;
      }
      *(int *)(param_1 + 0x108) = (int)*plVar6;
      break;
    case 0x40e:
      puVar4 = local_res20;
      local_res20[0] = 0x3e99999a;
      fVar9 = (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x5e4);
      *(float *)((longlong)param_1 + 0x5e4) = fVar9;
      if (fVar9 <= 0.3) {
        puVar4 = (undefined4 *)((longlong)param_1 + 0x5e4);
      }
      *(undefined4 *)((longlong)param_1 + 0x5e4) = *puVar4;
      goto LAB_140204e5e;
    default:
      goto switchD_140204c4c_caseD_40f;
    case 0x4b1:
      *(float *)(param_1 + 0x12f) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x12f);
      return;
    case 0x4b2:
      *(float *)((longlong)param_1 + 0x97c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x97c);
      return;
    case 0x4b3:
      *(float *)(param_1 + 0x130) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x130);
      return;
    case 0x4b4:
      *(float *)((longlong)param_1 + 0x984) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x984);
      return;
    case 0x4b5:
      *(float *)(param_1 + 0x131) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x131);
      return;
    case 0x4b6:
      *(float *)((longlong)param_1 + 0x98c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x98c);
      return;
    case 0x4b9:
      *(float *)(param_1 + 0x132) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x132);
      return;
    case 0x4ba:
      *(float *)((longlong)param_1 + 0x994) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x994);
      return;
    case 0x4bf:
      *(float *)(param_1 + 0x133) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x133);
      return;
    case 0x4c2:
      *(float *)((longlong)param_1 + 0x99c) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x99c);
      return;
    case 0x4cc:
      *(float *)(param_1 + 0x134) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x134);
      return;
    case 0x4cd:
      *(float *)((longlong)param_1 + 0x9a4) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x9a4);
      return;
    case 0x4ce:
      *(float *)(param_1 + 0x135) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x135);
      return;
    case 0x4cf:
      *(float *)((longlong)param_1 + 0x9ac) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x9ac);
      return;
    case 0x4d0:
      *(float *)(param_1 + 0x136) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x136);
      return;
    case 0x4d1:
      *(float *)((longlong)param_1 + 0x9b4) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x9b4);
      return;
    case 0x4d2:
      *(float *)(param_1 + 0x137) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x137);
      return;
    case 0x4d3:
      *(float *)((longlong)param_1 + 0x9bc) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x9bc);
      return;
    case 0x4d4:
      *(float *)(param_1 + 0x138) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x138);
      return;
    case 0x4d5:
      *(float *)((longlong)param_1 + 0x9c4) =
           (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x9c4);
      return;
    }
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    return;
  }
  if (0x7d1 < param_4) {
    if (param_4 < 0x9c6) {
      if (param_4 == 0x9c5) {
        *(int *)(param_1 + 0xc3) = (int)param_1[0xc3] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
      }
      else {
        switch(param_4) {
        case 0x7d2:
switchD_140205a29_caseD_7d2:
          *(int *)((longlong)param_1 + 0x61c) = *(int *)((longlong)param_1 + 0x61c) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7d3:
switchD_140205a29_caseD_7d3:
          *(int *)(param_1 + 0xc5) = (int)param_1[0xc5] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7d4:
switchD_140205a29_caseD_7d4:
          *(int *)((longlong)param_1 + 0x62c) = *(int *)((longlong)param_1 + 0x62c) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7d5:
          *(int *)(param_1 + 0xc4) = (int)param_1[0xc4] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7d6:
          *(int *)((longlong)param_1 + 0x624) = *(int *)((longlong)param_1 + 0x624) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7d7:
switchD_140205a29_caseD_7d7:
          *(int *)(param_1 + 199) = (int)param_1[199] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7d8:
switchD_140205a29_caseD_7d8:
          *(int *)((longlong)param_1 + 0x63c) = *(int *)((longlong)param_1 + 0x63c) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7d9:
          *(int *)(param_1 + 0xcd) = (int)param_1[0xcd] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7da:
          *(int *)((longlong)param_1 + 0x66c) = *(int *)((longlong)param_1 + 0x66c) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7db:
          *(int *)(param_1 + 0xce) = (int)param_1[0xce] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7dc:
          *(int *)((longlong)param_1 + 0x674) = *(int *)((longlong)param_1 + 0x674) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7dd:
          *(int *)(param_1 + 0xd9) = (int)param_1[0xd9] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7de:
          *(int *)((longlong)param_1 + 0x6cc) = *(int *)((longlong)param_1 + 0x6cc) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7df:
          *(int *)(param_1 + 0xda) = (int)param_1[0xda] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e0:
          *(int *)((longlong)param_1 + 0x6d4) = *(int *)((longlong)param_1 + 0x6d4) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e1:
          *(int *)(param_1 + 0xdd) = (int)param_1[0xdd] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e2:
          *(int *)((longlong)param_1 + 0x6ec) = *(int *)((longlong)param_1 + 0x6ec) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e3:
          *(int *)((longlong)param_1 + 0x65c) = *(int *)((longlong)param_1 + 0x65c) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e4:
          *(int *)(param_1 + 0xcc) = (int)param_1[0xcc] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e5:
          *(int *)((longlong)param_1 + 0x664) = *(int *)((longlong)param_1 + 0x664) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e6:
          *(int *)(param_1 + 200) = (int)param_1[200] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e7:
          *(int *)((longlong)param_1 + 0x644) = *(int *)((longlong)param_1 + 0x644) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e8:
          *(int *)(param_1 + 0xc9) = (int)param_1[0xc9] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7e9:
          *(int *)((longlong)param_1 + 0x64c) = *(int *)((longlong)param_1 + 0x64c) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7ea:
          *(int *)(param_1 + 0xca) = (int)param_1[0xca] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7eb:
          *(int *)((longlong)param_1 + 0x654) = *(int *)((longlong)param_1 + 0x654) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7ec:
          *(int *)(param_1 + 0xcb) = (int)param_1[0xcb] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7ed:
          *(int *)(param_1 + 0xdb) = (int)param_1[0xdb] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7ee:
          *(int *)((longlong)param_1 + 0x6dc) = *(int *)((longlong)param_1 + 0x6dc) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7ef:
          *(int *)(param_1 + 0xcf) = (int)param_1[0xcf] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7f0:
          *(int *)((longlong)param_1 + 0x67c) = *(int *)((longlong)param_1 + 0x67c) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7f1:
          *(int *)(param_1 + 0xdc) = (int)param_1[0xdc] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7f2:
          *(int *)((longlong)param_1 + 0x6e4) = *(int *)((longlong)param_1 + 0x6e4) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7f3:
          *(int *)(param_1 + 0xd0) = (int)param_1[0xd0] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7f4:
          *(int *)((longlong)param_1 + 0x684) = *(int *)((longlong)param_1 + 0x684) + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          break;
        case 0x7f5:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) {
            *(int *)(param_1 + 0xc3) = (int)param_1[0xc3] + param_5;
            *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          }
          break;
        case 0x7f6:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) goto switchD_140205a29_caseD_7d2;
          break;
        case 0x7f7:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) goto switchD_140205a29_caseD_7d3;
          break;
        case 0x7f8:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) goto switchD_140205a29_caseD_7d7;
          break;
        case 0x7f9:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) goto switchD_140205a29_caseD_7d4;
          break;
        case 0x7fa:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) goto switchD_140205a29_caseD_7d8;
          break;
        case 0x7fb:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) {
            *(undefined1 *)((longlong)param_1 + 0x605) = 1;
            *(float *)((longlong)param_1 + 0x5dc) =
                 (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x5dc);
          }
          break;
        case 0x7fc:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) {
            *(float *)((longlong)param_1 + 0x80c) =
                 (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x80c);
            *(undefined1 *)((longlong)param_1 + 0x607) = 1;
          }
          break;
        case 0x7fd:
          uVar5 = FUN_140137690();
          iVar2 = FUN_140137300(uVar5,param_4);
          if (iVar2 <= param_6) {
            *(float *)(param_1 + 0x102) = (float)param_5 / 10000.0 + *(float *)(param_1 + 0x102);
            *(undefined1 *)((longlong)param_1 + 0x607) = 1;
          }
          break;
        case 0x899:
          *(int *)((longlong)param_1 + 0x93c) = *(int *)((longlong)param_1 + 0x93c) + param_5;
          break;
        case 0x89a:
          *(int *)(param_1 + 0x128) = (int)param_1[0x128] + param_5;
          break;
        case 0x89b:
          *(int *)((longlong)param_1 + 0x944) = *(int *)((longlong)param_1 + 0x944) + param_5;
          break;
        case 0x89c:
          *(int *)(param_1 + 0x129) = (int)param_1[0x129] + param_5;
          break;
        case 0x89f:
          *(int *)((longlong)param_1 + 0x94c) = *(int *)((longlong)param_1 + 0x94c) + param_5;
          break;
        case 0x8a0:
          *(int *)(param_1 + 0x12a) = (int)param_1[0x12a] + param_5;
          break;
        case 0x8a1:
          *(int *)((longlong)param_1 + 0x954) = *(int *)((longlong)param_1 + 0x954) + param_5;
          break;
        case 0x8a2:
          *(int *)(param_1 + 299) = (int)param_1[299] + param_5;
          break;
        case 0x8a3:
          *(int *)((longlong)param_1 + 0x95c) = *(int *)((longlong)param_1 + 0x95c) + param_5;
          break;
        case 0x8a4:
          *(int *)(param_1 + 300) = (int)param_1[300] + param_5;
          break;
        case 0x8ab:
          *(int *)((longlong)param_1 + 0x974) = *(int *)((longlong)param_1 + 0x974) + param_5;
          break;
        case 0x8b7:
          *(int *)((longlong)param_1 + 0x964) = *(int *)((longlong)param_1 + 0x964) + param_5;
          break;
        case 0x8b8:
          *(int *)(param_1 + 0x12d) = (int)param_1[0x12d] + param_5;
          break;
        case 0x8bb:
          *(int *)((longlong)param_1 + 0x96c) = *(int *)((longlong)param_1 + 0x96c) + param_5;
          break;
        case 0x8bc:
          *(int *)(param_1 + 0x12e) = (int)param_1[0x12e] + param_5;
        }
      }
      goto switchD_140205782_caseD_5e8;
    }
    if (param_4 < 0xbba) {
      if (param_4 == 0xbb9) {
        iVar2 = 0x58;
        goto LAB_140206496;
      }
      switch(param_4) {
      case 0x9c6:
        *(int *)((longlong)param_1 + 0x61c) = *(int *)((longlong)param_1 + 0x61c) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9c7:
        *(int *)(param_1 + 0xc5) = (int)param_1[0xc5] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9c8:
        *(int *)((longlong)param_1 + 0x62c) = *(int *)((longlong)param_1 + 0x62c) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9c9:
        *(int *)(param_1 + 0xc4) = (int)param_1[0xc4] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9ca:
        *(int *)((longlong)param_1 + 0x624) = *(int *)((longlong)param_1 + 0x624) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9cb:
        *(int *)(param_1 + 199) = (int)param_1[199] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9cc:
        *(int *)((longlong)param_1 + 0x63c) = *(int *)((longlong)param_1 + 0x63c) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9cd:
        *(int *)(param_1 + 0xcd) = (int)param_1[0xcd] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9ce:
        *(int *)((longlong)param_1 + 0x66c) = *(int *)((longlong)param_1 + 0x66c) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9cf:
        *(int *)(param_1 + 0xce) = (int)param_1[0xce] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d0:
        *(int *)((longlong)param_1 + 0x674) = *(int *)((longlong)param_1 + 0x674) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d1:
        *(int *)(param_1 + 0xd9) = (int)param_1[0xd9] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d2:
        *(int *)((longlong)param_1 + 0x6cc) = *(int *)((longlong)param_1 + 0x6cc) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d3:
        *(int *)(param_1 + 0xda) = (int)param_1[0xda] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d4:
        *(int *)((longlong)param_1 + 0x6d4) = *(int *)((longlong)param_1 + 0x6d4) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d5:
        *(int *)((longlong)param_1 + 0x65c) = *(int *)((longlong)param_1 + 0x65c) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d6:
        *(int *)(param_1 + 0xcc) = (int)param_1[0xcc] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d7:
        *(int *)((longlong)param_1 + 0x664) = *(int *)((longlong)param_1 + 0x664) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d8:
        *(int *)(param_1 + 0xcf) = (int)param_1[0xcf] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9d9:
        *(int *)((longlong)param_1 + 0x67c) = *(int *)((longlong)param_1 + 0x67c) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9da:
        *(int *)(param_1 + 0xdb) = (int)param_1[0xdb] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9db:
        *(int *)((longlong)param_1 + 0x6dc) = *(int *)((longlong)param_1 + 0x6dc) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9dc:
        *(int *)(param_1 + 0xdc) = (int)param_1[0xdc] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9dd:
        *(int *)((longlong)param_1 + 0x6e4) = *(int *)((longlong)param_1 + 0x6e4) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9de:
        *(int *)(param_1 + 0xd0) = (int)param_1[0xd0] - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        break;
      case 0x9df:
        *(int *)((longlong)param_1 + 0x684) = *(int *)((longlong)param_1 + 0x684) - param_5;
        *(undefined1 *)((longlong)param_1 + 0x606) = 1;
      }
      goto switchD_140205782_caseD_5e8;
    }
    if (0xfa1 < param_4) {
      if (0x1398 < param_4) {
        if (param_4 < 0x232a) {
          if (param_4 != 0x2329) {
            if (param_4 < 0x13b9) {
              if (param_4 != 0x13b8) {
                switch(param_4) {
                case 0x1399:
                case 0x139a:
                case 0x139b:
                case 0x139c:
                case 0x139d:
                case 0x139e:
                case 0x139f:
                case 0x13a0:
                case 0x13a1:
                case 0x13a2:
                case 0x13a3:
                case 0x13a4:
                case 0x13a5:
                case 0x13a6:
                case 0x13a7:
                case 0x13b3:
                case 0x13b4:
                case 0x13b5:
                case 0x13b6:
                case 0x13b7:
                  iVar2 = 0xbd;
                  goto LAB_140206496;
                case 0x13a8:
                case 0x13a9:
                case 0x13aa:
                  break;
                case 0x13ab:
                case 0x13ac:
                case 0x13ad:
switchD_14020645a_caseD_13ab:
                  iVar2 = 0xbf;
                  goto LAB_140206496;
                case 0x13ae:
                case 0x13af:
                case 0x13b0:
                case 0x13b1:
                case 0x13b2:
                  goto switchD_14020645a_caseD_13ae;
                default:
                  goto switchD_140205782_caseD_5e8;
                }
              }
              iVar2 = 0xbe;
              goto LAB_140206496;
            }
            if (0x1f41 < param_4) {
              param_4 = param_4 + -0x1f42;
              bVar7 = param_4 == 0;
              goto LAB_140206633;
            }
            if (param_4 != 0x1f41) {
              if (param_4 == 0x13b9) goto switchD_14020645a_caseD_13ab;
              goto switchD_140205782_caseD_5e8;
            }
          }
LAB_1402065f6:
          *(int *)(param_1 + 0xc3) = (int)param_1[0xc3] + param_5;
          *(undefined1 *)((longlong)param_1 + 0x606) = 1;
        }
        else {
          if (param_4 < 0x2712) {
            if (param_4 == 0x2711) goto LAB_1402065f6;
            param_4 = param_4 + -0x232a;
            bVar7 = param_4 == 0;
          }
          else if (param_4 < 0x4e22) {
            if (param_4 == 0x4e21) {
              *(int *)(param_1 + 0xc3) = (int)param_1[0xc3] + param_5;
              *(undefined1 *)((longlong)param_1 + 0x606) = 1;
              goto switchD_140205782_caseD_5e8;
            }
            param_4 = param_4 + -0x2712;
            bVar7 = param_4 == 0;
          }
          else {
            param_4 = param_4 + -0x4e22;
            bVar7 = param_4 == 0;
          }
LAB_140206633:
          if (bVar7) {
            *(int *)((longlong)param_1 + 0x61c) = *(int *)((longlong)param_1 + 0x61c) + param_5;
            *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          }
          else if (param_4 == 1) {
            *(int *)(param_1 + 0xc5) = (int)param_1[0xc5] + param_5;
            *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          }
          else if (param_4 == 2) {
            *(int *)((longlong)param_1 + 0x62c) = *(int *)((longlong)param_1 + 0x62c) + param_5;
            *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          }
          else if (param_4 == 3) {
            *(int *)(param_1 + 199) = (int)param_1[199] + param_5;
            *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          }
          else if (param_4 == 4) {
            *(int *)((longlong)param_1 + 0x63c) = *(int *)((longlong)param_1 + 0x63c) + param_5;
            *(undefined1 *)((longlong)param_1 + 0x606) = 1;
          }
        }
        goto switchD_140205782_caseD_5e8;
      }
      if (0x1389 < param_4) {
switchD_14020645a_caseD_13ae:
        iVar2 = 0xab;
        goto LAB_140206496;
      }
      switch(param_4) {
      case 0xfa2:
        iVar2 = 0x6b;
        break;
      default:
        goto switchD_140205782_caseD_5e8;
      case 0xfa6:
        iVar2 = 0x6c;
        break;
      case 0xfa7:
        iVar2 = 0x6d;
        break;
      case 0xfa8:
        iVar2 = 0x6e;
        break;
      case 0xfa9:
        iVar2 = 0x6f;
        break;
      case 0xfaa:
        iVar2 = 0x70;
        break;
      case 0xfab:
        iVar2 = 0x71;
        break;
      case 0xfac:
        iVar2 = 0x72;
        break;
      case 0xfad:
        iVar2 = 0x73;
        break;
      case 0xfae:
        iVar2 = 0x74;
        break;
      case 0xfaf:
        iVar2 = 0x75;
        break;
      case 0xfb0:
        iVar2 = 0x76;
        break;
      case 0xfb1:
        iVar2 = 0x77;
        break;
      case 0xfb2:
        iVar2 = 0x78;
        break;
      case 0xfb3:
switchD_14020631b_caseD_fb3:
        iVar2 = 0xad;
        break;
      case 0xfb4:
        uVar5 = FUN_140137690();
        iVar2 = FUN_140137300(uVar5,param_4);
        if (iVar2 <= param_6) goto switchD_14020631b_caseD_fb3;
        goto switchD_140205782_caseD_5e8;
      case 0xfb5:
        iVar2 = 0xd2;
        break;
      case 0xfb6:
        iVar2 = 0xd3;
        break;
      case 0xfb7:
        iVar2 = 0xd4;
        break;
      case 0xfb8:
        iVar2 = 0xd5;
        break;
      case 0xfb9:
        iVar2 = 0xd6;
        break;
      case 0xfba:
        iVar2 = 0xd7;
        break;
      case 0xfbb:
        iVar2 = 0xd8;
      }
      goto LAB_140206496;
    }
    if (param_4 == 0xfa1) {
      iVar2 = 0x6a;
      goto LAB_140206496;
    }
    switch(param_4) {
    case 0xbba:
      iVar2 = 0x59;
      break;
    default:
      goto switchD_140205782_caseD_5e8;
    case 0xbbd:
      iVar2 = 0x5a;
      break;
    case 0xbbe:
      iVar2 = 0x5b;
      break;
    case 0xbbf:
      iVar2 = 0xca;
      break;
    case 0xbc0:
      iVar2 = 0xcb;
      break;
    case 0xbc1:
      iVar2 = 0xcc;
      break;
    case 0xbc3:
      iVar2 = 0x5e;
      break;
    case 0xbc4:
      iVar2 = 0x5f;
      break;
    case 0xbc5:
      iVar2 = 0x60;
      break;
    case 0xbc6:
      iVar2 = 0x61;
      break;
    case 0xbc7:
      iVar2 = 0x62;
      break;
    case 0xbc8:
      iVar2 = 99;
      break;
    case 0xbc9:
      iVar2 = 100;
      break;
    case 0xbca:
      iVar2 = 0x65;
      break;
    case 0xbcb:
      iVar2 = 0x66;
      break;
    case 0xbcc:
      iVar2 = 0x67;
      break;
    case 0xbcd:
      iVar2 = 0x68;
      break;
    case 0xbce:
      iVar2 = 0x69;
      break;
    case 0xbcf:
switchD_1402061fc_caseD_bcf:
      iVar2 = 0xac;
      break;
    case 0xbd0:
      uVar5 = FUN_140137690();
      iVar2 = FUN_140137300(uVar5,param_4);
      if (iVar2 <= param_6) goto switchD_1402061fc_caseD_bcf;
      goto switchD_140205782_caseD_5e8;
    }
    goto LAB_140206496;
  }
  if (param_4 == 0x7d1) goto LAB_1402065f6;
  switch(param_4) {
  case 0x5de:
    *(float *)(param_1 + 0xe7) = *(float *)(param_1 + 0xe7) - (float)param_5 / 10000.0;
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x5df:
    *(float *)((longlong)param_1 + 0x744) =
         *(float *)((longlong)param_1 + 0x744) - (float)param_5 / 10000.0;
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x5e0:
    *(float *)(param_1 + 0xe9) = *(float *)(param_1 + 0xe9) - (float)param_5 / 10000.0;
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x5e1:
    *(float *)((longlong)param_1 + 0x74c) =
         *(float *)((longlong)param_1 + 0x74c) - (float)param_5 / 10000.0;
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x5e2:
    *(float *)(param_1 + 0xea) = *(float *)(param_1 + 0xea) - (float)param_5 / 10000.0;
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x5e3:
    *(float *)((longlong)param_1 + 0x7fc) =
         *(float *)((longlong)param_1 + 0x7fc) - (float)param_5 / 10000.0;
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x5e4:
    *(undefined1 *)((longlong)param_1 + 0x605) = 1;
    *(float *)((longlong)param_1 + 0x5dc) =
         *(float *)((longlong)param_1 + 0x5dc) - (float)param_5 / 10000.0;
    break;
  case 0x5e5:
    *(float *)(param_1 + 0xb9) = *(float *)(param_1 + 0xb9) - (float)param_5 / 10000.0;
    break;
  case 0x5e6:
    *(float *)((longlong)param_1 + 0x73c) =
         *(float *)((longlong)param_1 + 0x73c) - (float)param_5 / 10000.0;
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x5e7:
    *(float *)(param_1 + 0xe8) = *(float *)(param_1 + 0xe8) - (float)param_5 / 10000.0;
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x643:
    fVar9 = (float)param_5 / 10000.0 + *(float *)((longlong)param_1 + 0x83c);
    *(float *)((longlong)param_1 + 0x83c) = fVar9;
    if (fVar9 < 0.0) {
      *(undefined4 *)((longlong)param_1 + 0x83c) = 0;
    }
    *(undefined1 *)((longlong)param_1 + 0x607) = 1;
    break;
  case 0x6a5:
  case 0x6ad:
  case 0x6b5:
  case 0x6bd:
    iVar2 = 0xae;
    goto LAB_140206496;
  case 0x6a6:
  case 0x6ae:
  case 0x6b6:
  case 0x6be:
    iVar2 = 0xaf;
    goto LAB_140206496;
  case 0x6a7:
  case 0x6af:
  case 0x6b7:
  case 0x6bf:
    iVar2 = 0xb3;
    goto LAB_140206496;
  case 0x6a8:
  case 0x6b0:
  case 0x6b8:
  case 0x6c0:
    iVar2 = 0xb5;
    goto LAB_140206496;
  case 0x6a9:
  case 0x6b1:
  case 0x6b9:
  case 0x6c1:
    iVar2 = 0xb2;
    goto LAB_140206496;
  case 0x6aa:
  case 0x6b2:
  case 0x6ba:
  case 0x6c2:
    iVar2 = 0xb0;
    goto LAB_140206496;
  case 0x6ab:
  case 0x6b3:
  case 0x6bb:
  case 0x6c3:
    iVar2 = 0xb1;
    goto LAB_140206496;
  case 0x6ac:
  case 0x6b4:
  case 0x6bc:
  case 0x6c4:
    iVar2 = 0xb4;
LAB_140206496:
    if (param_5 < 1) {
      FUN_140237de0(param_1,param_2);
    }
    else {
      uVar5 = FUN_140137690();
      uVar8 = FUN_140137350(uVar5,param_4);
      uVar5 = FUN_140137690();
      iVar3 = FUN_140137300(uVar5,param_4);
      plVar6 = (longlong *)FUN_140267710(iVar2);
      if (plVar6 != (longlong *)0x0) {
        local_58 = *param_2;
        uStack_50 = param_2[1];
        (**(code **)(*plVar6 + 0x50))(plVar6,param_3,param_4,&local_58,param_5,uVar8,(float)iVar3);
        if ((((iVar2 == 0xab) || (iVar2 == 0xbd)) || (iVar2 == 0xbe)) || (iVar2 == 0xbf)) {
          *(undefined4 *)((longlong)plVar6 + 0x6c) = 1;
          *(int *)(plVar6 + 1) = param_4;
          *(int *)((longlong)plVar6 + 0xc) = iVar2;
          lVar1 = param_1[0x25];
          uVar8 = (**(code **)(*param_1 + 0xb0))(param_1);
          FUN_14026bc90(plVar6,param_1[0x41c],(int)lVar1,uVar8,0,0,param_5);
        }
        FUN_140237380(param_1,param_1[0x41c],plVar6);
      }
    }
  }
switchD_140205782_caseD_5e8:
switchD_140204c4c_caseD_40f:
  return;
}



void FUN_140206d00(longlong *param_1,undefined8 param_2,undefined8 param_3,longlong *param_4)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  size_t sVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  wchar_t *pwVar8;
  longlong lVar9;
  longlong lVar10;
  char cVar11;
  bool bVar12;
  int local_res8 [2];
  undefined8 local_res10;
  undefined8 local_res18;
  void *local_res20;
  longlong *local_1a8;
  longlong *local_1a0;
  longlong local_198;
  char local_190;
  undefined4 local_188;
  int local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined8 local_170;
  undefined8 local_168;
  undefined8 local_160;
  undefined8 local_158;
  undefined4 local_150;
  undefined1 local_14c;
  undefined8 local_14b;
  short local_143;
  undefined8 local_141;
  undefined8 local_139;
  undefined8 local_131;
  undefined8 local_129;
  undefined8 local_121;
  undefined4 local_119;
  undefined4 local_115;
  char local_111;
  undefined8 local_110;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined1 local_d4;
  undefined4 local_d3;
  undefined8 local_cf;
  undefined8 local_c7;
  undefined8 local_bf;
  undefined8 local_b7;
  undefined8 local_a8;
  undefined1 local_a0 [16];
  longlong *local_90;
  
  local_a8 = 0xfffffffffffffffe;
  lVar9 = 0;
  lVar10 = 0;
  local_198 = 0;
  cVar11 = '\0';
  local_190 = '\0';
  plVar5 = (longlong *)param_1[0x25d];
  lVar6 = lVar9;
  local_res10 = param_2;
  local_res18 = param_3;
  if (plVar5 != (longlong *)0x0) {
    lVar6 = lVar10;
    if (plVar5 == (longlong *)param_1[0x25e]) {
      if (*plVar5 != 0) {
        lVar6 = *plVar5;
        if ((plVar5 != (longlong *)param_1[0x25e]) &&
           (iVar3 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, lVar6 = lVar9,
           DAT_1406080a8 = iVar3, bVar12)) {
          FUN_140176d60(1);
        }
        local_190 = 0;
        local_198 = lVar6;
        FUN_14034ed40(lVar6);
        cVar11 = '\x01';
        local_190 = '\x01';
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1401dec50(param_2);
  lVar10 = param_4[1];
  lVar9 = *param_4;
  do {
    if (lVar9 == lVar10) {
joined_r0x0001402074b5:
      if (cVar11 != '\0') {
        FUN_14034edd0(lVar6);
      }
      return;
    }
    plVar5 = (longlong *)0x0;
    if (param_1[0x3d0] == 0) {
      LOCK();
      DAT_140607cbc = DAT_140607cbc + 1;
      UNLOCK();
      iVar3 = DAT_140607cbc;
    }
    else {
      lVar6 = *(longlong *)(param_1[0x3d0] + 0x48);
      piVar2 = (int *)(lVar6 + 0x17c);
      *piVar2 = *piVar2 + 1;
      iVar3 = *(int *)(lVar6 + 0x17c);
    }
    local_res8[0] = iVar3;
    sVar4 = wcsnlen((wchar_t *)(lVar9 + 0x32),0x10);
    if (sVar4 < 0x10) {
      local_res20 = operator_new(0x2180);
      if (local_res20 != (void *)0x0) {
        plVar5 = (longlong *)FUN_14020fff0(local_res20,lVar9 + 0x32,(int)*(short *)(lVar9 + 0x52));
      }
      local_1a8 = plVar5;
      FUN_140178e10(&local_1a0,plVar5);
      FUN_140178e90(&local_1a8,plVar5,plVar5);
      if (local_1a8 == (longlong *)0x0) {
        lVar6 = local_198;
        cVar11 = local_190;
        if (local_1a0 != (longlong *)0x0) {
          LOCK();
          plVar5 = local_1a0 + 1;
          *(int *)plVar5 = (int)*plVar5 + -1;
          UNLOCK();
          if ((int)*plVar5 == 0) {
            (**(code **)(*local_1a0 + 8))(local_1a0);
            LOCK();
            piVar2 = (int *)((longlong)local_1a0 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            lVar6 = local_198;
            cVar11 = local_190;
            if (*piVar2 == 0) {
              (**(code **)(*local_1a0 + 0x10))(local_1a0);
              lVar6 = local_198;
              cVar11 = local_190;
            }
          }
        }
        goto joined_r0x0001402074b5;
      }
      (**(code **)(*local_1a8 + 0xb8))();
      *(int *)(local_1a8 + 0x41a) = (int)param_1[0x25];
      lVar6 = (**(code **)(*local_1a8 + 0x280))();
      *(undefined4 *)(lVar6 + 0x84) = *(undefined4 *)(lVar9 + 0x6e);
      *(undefined4 *)(lVar6 + 0x88) = *(undefined4 *)(lVar9 + 0x72);
      *(undefined4 *)(lVar6 + 0x8c) = *(undefined4 *)(lVar9 + 0x76);
      *(undefined4 *)(lVar6 + 0x90) = *(undefined4 *)(lVar9 + 0x7a);
      *(undefined4 *)(lVar6 + 0x94) = *(undefined4 *)(lVar9 + 0x7e);
      *(undefined4 *)(lVar6 + 0x98) = *(undefined4 *)(lVar9 + 0x82);
      *(undefined4 *)(lVar6 + 0x9c) = *(undefined4 *)(lVar9 + 0x86);
      *(undefined4 *)(lVar6 + 0xa0) = *(undefined4 *)(lVar9 + 0x8a);
      *(undefined4 *)(lVar6 + 0xa4) = *(undefined4 *)(lVar9 + 0x8e);
      *(undefined4 *)(lVar6 + 0xa8) = *(undefined4 *)(lVar9 + 0x93);
      *(undefined4 *)(lVar6 + 0xac) = *(undefined4 *)(lVar9 + 0x97);
      *(undefined4 *)(lVar6 + 0xb0) = *(undefined4 *)(lVar9 + 0x9b);
      *(undefined4 *)(lVar6 + 0xb4) = *(undefined4 *)(lVar9 + 0x9f);
      *(undefined4 *)(lVar6 + 0xb8) = *(undefined4 *)(lVar9 + 0xa3);
      *(undefined4 *)(lVar6 + 0xbc) = *(undefined4 *)(lVar9 + 0xa7);
      *(undefined4 *)(lVar6 + 0xc0) = *(undefined4 *)(lVar9 + 0xab);
      (**(code **)(*local_1a8 + 0x508))(local_1a8,lVar9);
      *(int *)(local_1a8 + 0x25) = iVar3;
      FUN_140218400(local_1a8,param_1[0x3d0]);
      FUN_1402f81e0(local_1a8,*(undefined4 *)(lVar9 + 0x54));
      FUN_1402f88a0(local_1a8,
                    ((float)((int)local_1a8[0x116] + (int)local_1a8[0xc3]) +
                    *(float *)((longlong)local_1a8 + 0x59c)) *
                    (*(float *)((longlong)local_1a8 + 0x8ec) +
                     *(float *)((longlong)local_1a8 + 0x734) + 1.0 + 0.0001) +
                    (float)(int)local_1a8[0x10d] + (float)*(int *)((longlong)local_1a8 + 0x88c));
      FUN_1402f8960(local_1a8,
                    ((float)(*(int *)((longlong)local_1a8 + 0x8b4) +
                            *(int *)((longlong)local_1a8 + 0x61c)) +
                    *(float *)((longlong)local_1a8 + 0x5a4)) *
                    (*(float *)(local_1a8 + 0x11e) + *(float *)(local_1a8 + 0xe7) + 1.0 + 0.0001) +
                    (float)*(int *)((longlong)local_1a8 + 0x86c) + (float)(int)local_1a8[0x112]);
      *(undefined8 *)(lVar6 + 0x50) = *(undefined8 *)(lVar9 + 0x58);
      *(undefined2 *)(lVar6 + 0x68) = *(undefined2 *)(lVar9 + 0x60);
      *(undefined8 *)(lVar6 + 0x70) = *(undefined8 *)(lVar9 + 0x62);
      *(undefined4 *)(lVar6 + 0x78) = *(undefined4 *)(lVar9 + 0x6a);
      *(int *)(lVar6 + 0x7c) = (int)param_1[0x42f];
      *(undefined1 *)(lVar6 + 0x80) = *(undefined1 *)(lVar9 + 0x92);
      lVar7 = FUN_140342d30(local_a0,local_res8,&local_1a8);
      FUN_140195d70(param_1 + 0x42e,lVar7,lVar7 + 8);
      plVar5 = local_90;
      if (local_90 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_90 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        iVar3 = local_res8[0];
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_90 + 8))(local_90);
          LOCK();
          piVar2 = (int *)((longlong)plVar5 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          iVar3 = local_res8[0];
          if (*piVar2 == 0) {
            (**(code **)(*plVar5 + 0x10))(plVar5);
            iVar3 = local_res8[0];
          }
        }
      }
      (**(code **)(*param_1 + 0x4c0))(param_1,lVar9);
      local_150 = 0;
      local_14c = 0;
      local_14b = 0;
      local_143 = 0;
      local_141 = 0;
      local_139 = 0;
      local_131 = 0;
      local_129 = 0;
      local_121 = 0;
      local_119 = 0;
      local_115 = 0;
      local_111 = 0;
      local_110 = 0;
      local_108 = 0;
      local_104 = 0;
      local_100 = 0;
      local_fc = 0;
      local_f8 = 0;
      local_170 = 0;
      local_168 = 0;
      local_160 = 0;
      local_158 = 0;
      local_188 = (undefined4)param_1[0x25];
      local_180 = (undefined4)local_1a8[0x1f6];
      local_17c = *(undefined4 *)((longlong)local_1a8 + 0xfb4);
      local_178 = (undefined4)local_1a8[0x1f7];
      local_174 = *(undefined4 *)((longlong)local_1a8 + 0xfbc);
      local_184 = iVar3;
      wcscpy_s((wchar_t *)&local_170,0x10,(wchar_t *)(lVar9 + 0x32));
      local_150 = (undefined4)local_1a8[0x24];
      local_14c = FUN_1402f8580();
      local_14b = *(undefined8 *)(lVar6 + 0x50);
      local_143 = *(short *)(lVar6 + 0x68);
      local_141 = *(undefined8 *)(lVar6 + 0x70);
      local_139 = CONCAT44(*(undefined4 *)(lVar6 + 0x84),*(undefined4 *)(lVar6 + 0x78));
      local_131 = *(undefined8 *)(lVar6 + 0x88);
      local_129 = *(undefined8 *)(lVar6 + 0x90);
      local_121 = *(undefined8 *)(lVar6 + 0x98);
      local_119 = *(undefined4 *)(lVar6 + 0xa0);
      local_115 = *(undefined4 *)(lVar6 + 0xa4);
      local_111 = *(char *)(lVar6 + 0x80);
      local_110 = *(undefined8 *)(lVar6 + 0xa8);
      local_108 = *(undefined4 *)(lVar6 + 0xb0);
      local_104 = *(undefined4 *)(lVar6 + 0xb4);
      local_100 = *(undefined4 *)(lVar6 + 0xb8);
      local_fc = *(undefined4 *)(lVar6 + 0xbc);
      local_f8 = *(undefined4 *)(lVar6 + 0xc0);
      if ((iVar3 != 0) && (param_1[0x41c] != 0)) {
        FUN_1401b5230(param_1[0x41c],iVar3,(int)local_143);
      }
      if (local_111 == '\x01') {
        local_d4 = 0;
        local_d3 = 0;
        local_cf = 0;
        local_c7 = 0;
        local_bf = 0;
        local_b7 = 0;
        local_e8 = (undefined4)local_1a8[0x25];
        local_e4 = (undefined4)local_1a8[0x1f6];
        local_e0 = *(undefined4 *)((longlong)local_1a8 + 0xfb4);
        local_dc = (undefined4)local_1a8[0x1f7];
        local_d8 = *(undefined4 *)((longlong)local_1a8 + 0xfbc);
        local_d4 = FUN_1402f8580();
        local_d3 = (undefined4)local_1a8[0x24];
        pwVar8 = (wchar_t *)(local_1a8 + 0x1a);
        if (7 < (ulonglong)local_1a8[0x1d]) {
          pwVar8 = *(wchar_t **)pwVar8;
        }
        sVar4 = wcsnlen(pwVar8,0x10);
        if (sVar4 < 0x10) {
          pwVar8 = (wchar_t *)(local_1a8 + 0x1a);
          if (7 < (ulonglong)local_1a8[0x1d]) {
            pwVar8 = *(wchar_t **)pwVar8;
          }
          wcscpy_s((wchar_t *)&local_cf,0x10,pwVar8);
          FUN_1400d5470(local_res18,&local_e8);
        }
      }
      else {
        FUN_1400d4ef0(local_res10,&local_188);
      }
      plVar5 = local_1a0;
      if (local_1a0 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_1a0 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_1a0 + 8))(local_1a0);
          LOCK();
          piVar2 = (int *)((longlong)plVar5 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar5 + 0x10))(plVar5);
          }
        }
      }
    }
    lVar9 = lVar9 + 0xaf;
    lVar6 = local_198;
    cVar11 = local_190;
  } while( true );
}



void FUN_140207510(longlong param_1,uint param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  uint uVar6;
  uint *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  
  lVar9 = 0;
  bVar11 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar9 = 0;
      if (lVar4 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        FUN_14034ed40(lVar4);
        bVar11 = true;
        lVar9 = lVar4;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  puVar2 = *(undefined8 **)(param_1 + 0x21c0);
  puVar8 = *(undefined8 **)(param_1 + 0x21b8);
  do {
    if (puVar8 == puVar2) {
      if (bVar11) {
        FUN_14034edd0(lVar9);
      }
      return;
    }
    plVar1 = (longlong *)*puVar8;
    lVar4 = (**(code **)(*plVar1 + 0x280))(plVar1);
    if ((*(char *)(lVar4 + 0x80) != '\x01') && (0 < (int)param_2)) {
      plVar5 = (longlong *)FUN_1403161f0();
      if (*plVar5 != 0) {
        for (puVar7 = *(uint **)(*plVar5 +
                                ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar5 + 2)) * 8);
            puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xe8)) {
          if ((puVar7[0xea] == param_2) && (*puVar7 == param_2)) {
            if (puVar7 != (uint *)0x0) {
              if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar6 = puVar7[3];
              goto LAB_140207651;
            }
            break;
          }
        }
      }
      uVar6 = 0;
LAB_140207651:
      plVar5 = (longlong *)FUN_140267710(uVar6);
      if (plVar5 != (longlong *)0x0) {
        (**(code **)(*plVar5 + 8))(plVar5,param_2);
        *(undefined4 *)((longlong)plVar5 + 0x6c) = 1;
        FUN_140236f40(plVar1,*(undefined8 *)(param_1 + 0x20e0),plVar5);
      }
    }
    puVar8 = puVar8 + 2;
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x000140207aea)
// WARNING: Removing unreachable block (ram,0x000140207b06)

undefined8 * FUN_1402076d0(longlong param_1,undefined8 *param_2,int param_3)

{
  ulonglong *puVar1;
  longlong lVar2;
  bool bVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar9;
  longlong *plVar10;
  undefined8 *puVar11;
  undefined8 *puVar12;
  undefined8 *puVar13;
  ulonglong uVar14;
  ulonglong uVar15;
  bool bVar16;
  bool bVar17;
  ulonglong local_80;
  ulonglong uVar8;
  
  uVar15 = 0;
  local_80 = 0;
  bVar17 = false;
  bVar3 = false;
  puVar1 = *(ulonglong **)(param_1 + 0x12e8);
  if (puVar1 != (ulonglong *)0x0) {
    if (puVar1 == *(ulonglong **)(param_1 + 0x12f0)) {
      if (*puVar1 != 0) {
        local_80 = *puVar1;
        if ((puVar1 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar17 = DAT_1406080a8 == 0, local_80 = uVar15,
           DAT_1406080a8 = iVar4, bVar17)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(local_80);
        bVar17 = true;
        bVar3 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar16 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar16) {
        FUN_140176d60(1);
        bVar17 = false;
      }
    }
  }
  uVar5 = 1;
  if (*(float *)(param_1 + 0x22bc) != 0.0) {
    uVar5 = (uint)(longlong)*(float *)(param_1 + 0x22bc);
  }
  puVar1 = (ulonglong *)(param_1 + 0x21b8);
  if ((ulonglong)((longlong)(*(longlong *)(param_1 + 0x21c0) - *puVar1) >> 4) < (ulonglong)uVar5) {
    for (plVar7 = (longlong *)*puVar1; plVar7 != *(longlong **)(param_1 + 0x21c0);
        plVar7 = plVar7 + 2) {
      if (*(int *)(*plVar7 + 0x128) == param_3) {
        *param_2 = 0;
        param_2[1] = 0;
        if (!bVar17) {
          return param_2;
        }
        FUN_14034edd0(local_80);
        return param_2;
      }
    }
    uVar14 = uVar15;
    if ((*(longlong *)(param_1 + 0x2178) != 0) && (*(uint *)(param_1 + 0x2180) != 0)) {
      plVar7 = *(longlong **)(param_1 + 0x2170);
      uVar8 = uVar15;
      plVar10 = plVar7;
      do {
        if (*plVar10 != 0) {
          uVar14 = plVar7[uVar8];
          break;
        }
        uVar5 = (int)uVar8 + 1;
        uVar8 = (ulonglong)uVar5;
        plVar10 = plVar10 + 1;
      } while (uVar5 < *(uint *)(param_1 + 0x2180));
    }
LAB_1402078a4:
    uVar8 = uVar14;
    if (uVar8 != 0) {
      if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      plVar7 = *(longlong **)(uVar8 + 8);
      lVar9 = (**(code **)(*plVar7 + 0x280))(plVar7);
      if ((*(char *)(lVar9 + 0x80) != '\x01') && ((int)plVar7[0x25] == param_3)) {
        if ((plVar7[0x26] != 0) &&
           (((lVar9 = *(longlong *)(plVar7[0x26] + 0x930), lVar9 != 0 &&
             (*(char *)(lVar9 + 0x15) != '\0')) &&
            (lVar9 = (**(code **)(*plVar7 + 0x280))(plVar7), *(int *)(lVar9 + 0x78) != 0)))) {
          lVar9 = (**(code **)(*plVar7 + 0x280))(plVar7);
          iVar4 = *(int *)(lVar9 + 0x78);
          lVar9 = FUN_1401e0840();
          GetLocalTime((LPSYSTEMTIME)(lVar9 + 200));
          iVar6 = FUN_1401e2290((LPSYSTEMTIME)(lVar9 + 200));
          if (iVar4 < iVar6) {
            *param_2 = 0;
            param_2[1] = 0;
            if (!bVar3) {
              return param_2;
            }
            FUN_14034edd0(local_80);
            return param_2;
          }
        }
        (**(code **)(*plVar7 + 0x4e0))
                  (plVar7,(longlong)(*(longlong *)(param_1 + 0x21c0) - *puVar1) >> 4);
        FUN_140218400(plVar7,*(undefined8 *)(param_1 + 0x1e80));
        (**(code **)(*plVar7 + 0x600))(plVar7,param_1 + 0x178);
        plVar7[0x42f] = *(longlong *)(param_1 + 0x20e0);
        FUN_140215300(plVar7);
        if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        puVar13 = (undefined8 *)(uVar8 + 8);
        puVar11 = *(undefined8 **)(param_1 + 0x21c0);
        if ((puVar13 < puVar11) && (puVar12 = (undefined8 *)*puVar1, puVar12 <= puVar13)) {
          if (puVar11 == *(undefined8 **)(param_1 + 0x21c8)) {
            FUN_1403435d0(puVar1);
          }
          puVar12 = (undefined8 *)
                    (((longlong)puVar13 - (longlong)puVar12 & 0xfffffffffffffff0U) + *puVar1);
          puVar11 = *(undefined8 **)(param_1 + 0x21c0);
          if (puVar11 == (undefined8 *)0x0) goto LAB_140207ad4;
          *puVar11 = *puVar12;
          lVar9 = puVar12[1];
        }
        else {
          if (puVar11 == *(undefined8 **)(param_1 + 0x21c8)) {
            FUN_1403435d0(puVar1);
          }
          puVar11 = *(undefined8 **)(param_1 + 0x21c0);
          if (puVar11 == (undefined8 *)0x0) goto LAB_140207ad4;
          *puVar11 = *puVar13;
          lVar9 = *(longlong *)(uVar8 + 0x10);
        }
        puVar11[1] = lVar9;
        if (lVar9 != 0) {
          LOCK();
          *(int *)(lVar9 + 8) = *(int *)(lVar9 + 8) + 1;
          UNLOCK();
        }
LAB_140207ad4:
        *(longlong *)(param_1 + 0x21c0) = *(longlong *)(param_1 + 0x21c0) + 0x10;
        if (*(longlong *)(param_1 + 0x1e80) != 0) {
          FUN_140194e70(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),puVar13);
        }
        *param_2 = *puVar13;
        lVar9 = *(longlong *)(uVar8 + 0x10);
        param_2[1] = lVar9;
        if (lVar9 != 0) {
          LOCK();
          *(int *)(lVar9 + 8) = *(int *)(lVar9 + 8) + 1;
          UNLOCK();
        }
        if (!bVar3) {
          return param_2;
        }
        FUN_14034edd0(local_80);
        return param_2;
      }
      uVar14 = uVar15;
      if ((uVar8 != 0) && (uVar14 = *(ulonglong *)(uVar8 + 0x18), *(ulonglong *)(uVar8 + 0x18) == 0)
         ) {
        uVar5 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
        lVar9 = (longlong)(int)uVar5 << 3;
        uVar14 = uVar15;
        do {
          if (*(uint *)(param_1 + 0x2180) <= uVar5) break;
          lVar2 = *(longlong *)(param_1 + 0x2170);
          if (*(longlong *)(lVar9 + lVar2) != 0) {
            uVar14 = *(ulonglong *)(lVar9 + lVar2);
          }
          uVar5 = uVar5 + 1;
          lVar9 = lVar9 + 8;
        } while (uVar14 == 0);
      }
      goto LAB_1402078a4;
    }
    *param_2 = 0;
    param_2[1] = 0;
    if (bVar3) {
      FUN_14034edd0(local_80);
    }
  }
  else {
    *param_2 = 0;
    param_2[1] = 0;
    if (bVar17) {
      FUN_14034edd0(local_80);
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x000140207eda)

void FUN_140207b70(longlong param_1,ulonglong *param_2)

{
  undefined8 *puVar1;
  ulonglong *puVar2;
  longlong lVar3;
  bool bVar4;
  int iVar5;
  uint uVar6;
  longlong *plVar7;
  longlong lVar9;
  longlong *plVar10;
  undefined8 *puVar11;
  undefined8 *puVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  bool bVar15;
  bool bVar16;
  ulonglong local_60;
  ulonglong uVar8;
  
  uVar13 = 0;
  local_60 = 0;
  bVar16 = false;
  bVar4 = false;
  puVar2 = *(ulonglong **)(param_1 + 0x12e8);
  if (puVar2 != (ulonglong *)0x0) {
    if (puVar2 == *(ulonglong **)(param_1 + 0x12f0)) {
      if (*puVar2 != 0) {
        local_60 = *puVar2;
        if ((puVar2 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar16 = DAT_1406080a8 == 0, local_60 = uVar13,
           DAT_1406080a8 = iVar5, bVar16)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(local_60);
        bVar16 = true;
        bVar4 = true;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar15 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  uVar6 = 1;
  if (*(float *)(param_1 + 0x22bc) != 0.0) {
    uVar6 = (uint)(longlong)*(float *)(param_1 + 0x22bc);
  }
  puVar2 = (ulonglong *)(param_1 + 0x21b8);
  if ((ulonglong)((longlong)(*(longlong *)(param_1 + 0x21c0) - *puVar2) >> 4) < (ulonglong)uVar6) {
    for (plVar7 = (longlong *)*puVar2; plVar7 != *(longlong **)(param_1 + 0x21c0);
        plVar7 = plVar7 + 2) {
      uVar14 = *(ulonglong *)(*plVar7 + 0xfb0);
      bVar15 = uVar14 < *param_2;
      if ((uVar14 != *param_2) ||
         (uVar14 = *(ulonglong *)(*plVar7 + 0xfb8), bVar15 = uVar14 < param_2[1], uVar8 = uVar13,
         uVar14 != param_2[1])) {
        uVar8 = (ulonglong)((1 - (uint)bVar15) - (uint)(bVar15 != 0));
      }
      if ((int)uVar8 == 0) goto LAB_140207c6c;
    }
    uVar14 = uVar13;
    if ((*(longlong *)(param_1 + 0x2178) != 0) && (*(uint *)(param_1 + 0x2180) != 0)) {
      plVar7 = *(longlong **)(param_1 + 0x2170);
      uVar8 = uVar13;
      plVar10 = plVar7;
      do {
        if (*plVar10 != 0) {
          uVar14 = plVar7[uVar8];
          break;
        }
        uVar6 = (int)uVar8 + 1;
        uVar8 = (ulonglong)uVar6;
        plVar10 = plVar10 + 1;
      } while (uVar6 < *(uint *)(param_1 + 0x2180));
    }
LAB_140207d30:
    uVar8 = uVar14;
    if (uVar8 != 0) {
      if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      plVar7 = *(longlong **)(uVar8 + 8);
      lVar9 = (**(code **)(*plVar7 + 0x280))(plVar7);
      if (*(char *)(lVar9 + 0x80) != '\x01') {
        bVar15 = (ulonglong)plVar7[0x1f6] < *param_2;
        if ((plVar7[0x1f6] != *param_2) ||
           (bVar15 = (ulonglong)plVar7[0x1f7] < param_2[1], iVar5 = 0, plVar7[0x1f7] != param_2[1]))
        {
          iVar5 = (1 - (uint)bVar15) - (uint)(bVar15 != 0);
        }
        if (iVar5 == 0) {
          (**(code **)(*plVar7 + 0x4e0))
                    (plVar7,(longlong)(*(longlong *)(param_1 + 0x21c0) - *puVar2) >> 4);
          plVar7[0x42f] = *(longlong *)(param_1 + 0x20e0);
          FUN_140215300(plVar7);
          if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          puVar1 = (undefined8 *)(uVar8 + 8);
          puVar11 = *(undefined8 **)(param_1 + 0x21c0);
          if ((puVar1 < puVar11) && (puVar12 = (undefined8 *)*puVar2, puVar12 <= puVar1)) {
            if (puVar11 == *(undefined8 **)(param_1 + 0x21c8)) {
              FUN_1403435d0(puVar2);
            }
            puVar12 = (undefined8 *)
                      (((longlong)puVar1 - (longlong)puVar12 & 0xfffffffffffffff0U) + *puVar2);
            puVar11 = *(undefined8 **)(param_1 + 0x21c0);
            if (puVar11 != (undefined8 *)0x0) {
              *puVar11 = *puVar12;
              lVar9 = puVar12[1];
LAB_140207eac:
              puVar11[1] = lVar9;
              if (lVar9 != 0) {
                LOCK();
                *(int *)(lVar9 + 8) = *(int *)(lVar9 + 8) + 1;
                UNLOCK();
                bVar16 = bVar4;
              }
            }
          }
          else {
            if (puVar11 == *(undefined8 **)(param_1 + 0x21c8)) {
              FUN_1403435d0(puVar2);
            }
            puVar11 = *(undefined8 **)(param_1 + 0x21c0);
            if (puVar11 != (undefined8 *)0x0) {
              *puVar11 = *puVar1;
              lVar9 = *(longlong *)(uVar8 + 0x10);
              goto LAB_140207eac;
            }
          }
          *(longlong *)(param_1 + 0x21c0) = *(longlong *)(param_1 + 0x21c0) + 0x10;
          if (*(longlong *)(param_1 + 0x1e80) != 0) {
            FUN_140194e70(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),puVar1);
          }
          goto LAB_140207c6c;
        }
      }
      uVar14 = uVar13;
      if ((uVar8 != 0) && (uVar14 = *(ulonglong *)(uVar8 + 0x18), *(ulonglong *)(uVar8 + 0x18) == 0)
         ) {
        uVar6 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
        lVar9 = (longlong)(int)uVar6 << 3;
        uVar14 = uVar13;
        do {
          if (*(uint *)(param_1 + 0x2180) <= uVar6) break;
          lVar3 = *(longlong *)(param_1 + 0x2170);
          if (*(longlong *)(lVar3 + lVar9) != 0) {
            uVar14 = *(ulonglong *)(lVar3 + lVar9);
          }
          uVar6 = uVar6 + 1;
          lVar9 = lVar9 + 8;
        } while (uVar14 == 0);
      }
      goto LAB_140207d30;
    }
  }
LAB_140207c6c:
  if (bVar16) {
    FUN_14034edd0(local_60);
  }
  return;
}



longlong *
FUN_140207f20(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined4 param_4,
             undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
             undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12,
             undefined4 param_13)

{
  int *piVar1;
  longlong *plVar2;
  longlong *plVar3;
  int iVar4;
  void *pvVar5;
  longlong *plVar6;
  longlong lVar7;
  undefined8 uVar8;
  longlong lVar9;
  longlong *plVar10;
  bool bVar11;
  int local_res8 [2];
  longlong *local_78;
  longlong *local_70;
  longlong *local_68;
  char local_60;
  undefined1 local_58 [16];
  undefined1 local_48 [16];
  longlong *local_38;
  
  plVar6 = (longlong *)0x0;
  local_68 = (longlong *)0x0;
  local_60 = '\0';
  plVar2 = (longlong *)param_1[0x25d];
  if (plVar2 != (longlong *)0x0) {
    plVar3 = (longlong *)param_1[0x25e];
    if (plVar2 == plVar3) {
      if ((longlong *)*plVar2 != (longlong *)0x0) {
        plVar10 = (longlong *)*plVar2;
        if ((plVar2 != plVar3) &&
           (iVar4 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, plVar10 = plVar6,
           DAT_1406080a8 = iVar4, bVar11)) {
          FUN_140176d60(1,param_2,plVar3,param_4,0xfffffffffffffffe);
        }
        local_60 = 0;
        local_68 = plVar10;
        FUN_14034ed40();
        local_60 = '\x01';
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar11) {
        FUN_140176d60(1,param_2,plVar3,param_4,0xfffffffffffffffe);
      }
    }
  }
  if (param_1[0x3d0] == 0) {
    LOCK();
    DAT_140607cbc = DAT_140607cbc + 1;
    UNLOCK();
    iVar4 = DAT_140607cbc;
  }
  else {
    lVar9 = *(longlong *)(param_1[0x3d0] + 0x48);
    piVar1 = (int *)(lVar9 + 0x17c);
    *piVar1 = *piVar1 + 1;
    iVar4 = *(int *)(lVar9 + 0x17c);
  }
  local_res8[0] = iVar4;
  pvVar5 = operator_new(0x2180);
  if (pvVar5 != (void *)0x0) {
    plVar6 = (longlong *)FUN_14020fff0(pvVar5,param_3,param_2 & 0xffffffff);
  }
  local_78 = plVar6;
  FUN_140178e10(&local_70,plVar6);
  FUN_140178e90(&local_78,plVar6,plVar6);
  if (local_78 != (longlong *)0x0) {
    (**(code **)(*local_78 + 0xb8))();
    if (param_1[0x41c] != 0) {
      *(int *)(local_78 + 0x41a) = (int)param_1[0x25];
    }
    lVar7 = (**(code **)(*local_78 + 0x280))();
    plVar2 = local_78;
    *(undefined4 *)(lVar7 + 0x84) = param_4;
    *(undefined4 *)(lVar7 + 0x88) = param_5;
    *(undefined4 *)(lVar7 + 0x8c) = param_6;
    *(undefined4 *)(lVar7 + 0x90) = param_7;
    *(undefined4 *)(lVar7 + 0x94) = param_8;
    *(undefined4 *)(lVar7 + 0x98) = param_9;
    *(undefined4 *)(lVar7 + 0x9c) = param_10;
    *(undefined4 *)(lVar7 + 0xa0) = param_11;
    *(undefined4 *)(lVar7 + 0xa4) = param_12;
    *(undefined4 *)(lVar7 + 0x78) = param_13;
    lVar9 = *local_78;
    uVar8 = FUN_140357570(local_58);
    (**(code **)(lVar9 + 0x508))(plVar2,uVar8);
    *(int *)(local_78 + 0x25) = iVar4;
    FUN_140218400(local_78,param_1[0x3d0]);
    FUN_1402f88a0(local_78,((float)((int)local_78[0x116] + (int)local_78[0xc3]) +
                           *(float *)((longlong)local_78 + 0x59c)) *
                           (*(float *)((longlong)local_78 + 0x8ec) +
                            *(float *)((longlong)local_78 + 0x734) + 1.0 + 0.0001) +
                           (float)(int)local_78[0x10d] + (float)*(int *)((longlong)local_78 + 0x88c)
                 );
    FUN_1402f8960(local_78,((float)(*(int *)((longlong)local_78 + 0x8b4) +
                                   *(int *)((longlong)local_78 + 0x61c)) +
                           *(float *)((longlong)local_78 + 0x5a4)) *
                           (*(float *)(local_78 + 0xe7) + *(float *)(local_78 + 0x11e) + 1.0 +
                           0.0001) + (float)*(int *)((longlong)local_78 + 0x86c) +
                           (float)(int)local_78[0x112]);
    FUN_1402f81e0(local_78,1);
    *(int *)(lVar7 + 0x7c) = (int)param_1[0x42f];
  }
  lVar9 = FUN_140342d30(local_48,local_res8,&local_78);
  FUN_140195d70(param_1 + 0x42e,lVar9,lVar9 + 8);
  if (local_38 != (longlong *)0x0) {
    LOCK();
    plVar2 = local_38 + 1;
    *(int *)plVar2 = (int)*plVar2 + -1;
    UNLOCK();
    if ((int)*plVar2 == 0) {
      (**(code **)(*local_38 + 8))(local_38);
      LOCK();
      piVar1 = (int *)((longlong)local_38 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_38 + 0x10))(local_38);
      }
    }
  }
  (**(code **)(*param_1 + 0x4c0))(param_1,local_78 + 0x1f6);
  plVar2 = local_78;
  if (local_70 != (longlong *)0x0) {
    LOCK();
    plVar6 = local_70 + 1;
    *(int *)plVar6 = (int)*plVar6 + -1;
    UNLOCK();
    if ((int)*plVar6 == 0) {
      (**(code **)(*local_70 + 8))(local_70);
      LOCK();
      piVar1 = (int *)((longlong)local_70 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_70 + 0x10))(local_70);
      }
    }
  }
  if (local_60 != '\0') {
    FUN_14034edd0(local_68);
  }
  return plVar2;
}



void FUN_1402082d0(longlong param_1,int param_2,char param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar4 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar1;
      lVar4 = 0;
      if (lVar5 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar7 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar7) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        FUN_14034ed40(lVar5);
        bVar7 = true;
        lVar4 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x21c0);
  plVar3 = *(longlong **)(param_1 + 0x21b8);
  if (plVar3 != plVar1) {
    do {
      if (*(int *)(*plVar3 + 0x128) == param_2) break;
      plVar3 = plVar3 + 2;
    } while (plVar3 != plVar1);
    if (plVar3 != plVar1) {
      (**(code **)(*(longlong *)*plVar3 + 0x4e0))((longlong *)*plVar3,0);
      FUN_1402154c0(*plVar3,0);
      FUN_14020d4d0(param_1);
      *(undefined8 *)(*plVar3 + 0x2178) = 0;
      FUN_140333a10(plVar3 + 2,*(undefined8 *)(param_1 + 0x21c0),plVar3);
      FUN_1402ce6b0(*(longlong *)(param_1 + 0x21c0) + -0x10);
      *(longlong *)(param_1 + 0x21c0) = *(longlong *)(param_1 + 0x21c0) + -0x10;
      if ((*(longlong *)(param_1 + 0x1e80) != 0) && (param_3 == '\0')) {
        FUN_140195340(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),param_2);
      }
    }
  }
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



void FUN_140208460(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  size_t sVar5;
  wchar_t *pwVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined2 local_58;
  undefined8 local_56;
  undefined8 local_4e;
  undefined8 local_46;
  undefined8 local_3e;
  undefined2 local_36;
  
  lVar4 = 0;
  lVar8 = 0;
  bVar11 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar9 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    lVar9 = lVar8;
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      if (*plVar1 != 0) {
        lVar9 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, lVar9 = lVar4,
           DAT_1406080a8 = iVar3, bVar11)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar9);
        bVar11 = true;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x21c0);
  for (plVar7 = *(longlong **)(param_1 + 0x21b8); plVar7 != plVar1; plVar7 = plVar7 + 2) {
    local_36 = 0;
    local_56 = 0;
    local_4e = 0;
    local_46 = 0;
    local_3e = 0;
    local_70 = *(undefined4 *)(param_1 + 0x128);
    plVar2 = (longlong *)*plVar7;
    local_6c = (undefined4)plVar2[0x25];
    local_58 = (undefined2)(int)plVar2[0x24];
    local_68 = (undefined4)plVar2[0x1f6];
    local_64 = *(undefined4 *)((longlong)plVar2 + 0xfb4);
    local_60 = (undefined4)plVar2[0x1f7];
    local_5c = *(undefined4 *)((longlong)plVar2 + 0xfbc);
    lVar4 = (**(code **)(*plVar2 + 0x280))();
    lVar8 = *plVar7;
    local_36 = CONCAT11(*(undefined1 *)(lVar8 + 0x20d4),(char)*(undefined4 *)(lVar4 + 0x7c));
    pwVar6 = (wchar_t *)(lVar8 + 0xd0);
    if (7 < *(ulonglong *)(lVar8 + 0xe8)) {
      pwVar6 = *(wchar_t **)pwVar6;
    }
    sVar5 = wcsnlen(pwVar6,0x10);
    if (sVar5 < 0x10) {
      pwVar6 = (wchar_t *)(*plVar7 + 0xd0);
      if (7 < *(ulonglong *)(*plVar7 + 0xe8)) {
        pwVar6 = *(wchar_t **)pwVar6;
      }
      wcscpy_s((wchar_t *)&local_56,0x10,pwVar6);
      FUN_1400d5170(param_2,&local_70);
    }
  }
  if (bVar11) {
    FUN_14034edd0(lVar9);
  }
  return;
}



void FUN_140208680(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  longlong lVar11;
  
  uVar10 = 0xfffffffffffffffe;
  lVar4 = 0;
  lVar11 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    plVar3 = *(longlong **)(param_1 + 0x12f0);
    if (plVar1 == plVar3) {
      lVar5 = *plVar1;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar1 != plVar3) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1,plVar3,param_3,param_4,0xfffffffffffffffe,0,0);
        }
        lVar11 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1,plVar3,param_3,param_4,0xfffffffffffffffe,0,0);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x21c0);
  plVar3 = *(longlong **)(param_1 + 0x21b8);
  if (plVar3 != plVar1) {
    do {
      if (*(int *)(*plVar3 + 0x128) == param_2) break;
      plVar3 = plVar3 + 2;
    } while (plVar3 != plVar1);
    if (plVar3 != plVar1) {
      plVar3 = (longlong *)*plVar3;
      FUN_1402f88a0(plVar3,((float)((int)plVar3[0xc3] + (int)plVar3[0x116]) +
                           *(float *)((longlong)plVar3 + 0x59c)) *
                           (*(float *)((longlong)plVar3 + 0x8ec) +
                            *(float *)((longlong)plVar3 + 0x734) + 1.0 + 0.0001) +
                           (float)(int)plVar3[0x10d] + (float)*(int *)((longlong)plVar3 + 0x88c));
      uVar9 = FUN_1402f8960();
      (**(code **)(*plVar3 + 200))(uVar9,0,0,*plVar3,uVar10,lVar11);
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar6);
  }
  return;
}



undefined8 FUN_140208860(longlong param_1,uint param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  int iVar3;
  uint *puVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  
  if (param_2 != 0) {
    lVar5 = 0;
    lVar6 = 0;
    bVar9 = false;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar7 = lVar5;
    if (plVar1 != (longlong *)0x0) {
      lVar7 = lVar6;
      if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
        if (*plVar1 != 0) {
          lVar7 = *plVar1;
          if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar3 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar7 = lVar5,
             DAT_1406080a8 = iVar3, bVar9)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40(lVar7);
          bVar9 = true;
        }
      }
      else {
        iVar3 = DAT_1406080a8 + 1;
        bVar8 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar3;
        if (bVar8) {
          FUN_140176d60(1);
        }
      }
    }
    if (*(longlong *)(param_1 + 0x2170) != 0) {
      for (puVar4 = *(uint **)(*(longlong *)(param_1 + 0x2170) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x2180)) * 8);
          puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 6)) {
        if ((puVar4[8] == param_2) && (*puVar4 == param_2)) {
          if (puVar4 != (uint *)0x0) {
            if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar2 = *(undefined8 *)(puVar4 + 2);
            if (!bVar9) {
              return uVar2;
            }
            FUN_14034edd0(lVar7);
            return uVar2;
          }
          break;
        }
      }
    }
    if (bVar9) {
      FUN_14034edd0(lVar7);
    }
  }
  return 0;
}



longlong FUN_1402089c0(longlong param_1,ulonglong *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *plVar8;
  bool bVar9;
  bool bVar10;
  longlong local_20;
  
  local_20 = 0;
  bVar10 = false;
  plVar8 = *(longlong **)(param_1 + 0x12e8);
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == *(longlong **)(param_1 + 0x12f0)) {
      lVar7 = *plVar8;
      if (lVar7 != 0) {
        if (plVar8 != *(longlong **)(param_1 + 0x12f0)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar10 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar10) {
            FUN_140176d60();
          }
          lVar7 = 0;
        }
        FUN_14034ed40();
        bVar10 = true;
        local_20 = lVar7;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2178) != 0) {
    uVar5 = 0;
    if (*(uint *)(param_1 + 0x2180) != 0) {
      plVar8 = *(longlong **)(param_1 + 0x2170);
      do {
        if (*plVar8 != 0) {
          lVar7 = (*(longlong **)(param_1 + 0x2170))[uVar5];
          goto LAB_140208ab0;
        }
        uVar4 = (int)uVar5 + 1;
        uVar5 = (ulonglong)uVar4;
        plVar8 = plVar8 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0x2180));
    }
  }
  do {
    lVar7 = 0;
LAB_140208ab0:
    lVar6 = lVar7;
    if (lVar6 == 0) {
      if (bVar10) {
        FUN_14034edd0(local_20);
      }
      return 0;
    }
    if (lVar6 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    lVar7 = *(longlong *)(lVar6 + 8);
    plVar8 = *(longlong **)(lVar6 + 0x10);
    if (plVar8 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar8 + 1) = (int)plVar8[1] + 1;
      UNLOCK();
    }
    if (lVar7 != 0) {
      bVar9 = *(ulonglong *)(lVar7 + 0xfb0) < *param_2;
      if ((*(ulonglong *)(lVar7 + 0xfb0) == *param_2) &&
         (bVar9 = *(ulonglong *)(lVar7 + 0xfb8) < param_2[1],
         *(ulonglong *)(lVar7 + 0xfb8) == param_2[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar9) - (uint)(bVar9 != 0);
      }
      if (iVar3 == 0) {
        if (plVar8 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar8 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar8 + 8))(plVar8);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))();
            }
          }
        }
        if (!bVar10) {
          return lVar7;
        }
        FUN_14034edd0(local_20);
        return lVar7;
      }
    }
    if (plVar8 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar8 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar8 + 8))(plVar8);
        LOCK();
        piVar2 = (int *)((longlong)plVar8 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar8 + 0x10))();
        }
      }
    }
  } while (lVar6 == 0);
  lVar7 = *(longlong *)(lVar6 + 0x18);
  if (lVar7 == 0) {
    uVar4 = *(uint *)(lVar6 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
    lVar6 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(param_1 + 0x2180) <= uVar4) break;
      if (*(longlong *)(lVar6 + *(longlong *)(param_1 + 0x2170)) != 0) {
        lVar7 = *(longlong *)(lVar6 + *(longlong *)(param_1 + 0x2170));
      }
      uVar4 = uVar4 + 1;
      lVar6 = lVar6 + 8;
    } while (lVar7 == 0);
  }
  goto LAB_140208ab0;
}



// WARNING: Removing unreachable block (ram,0x000140208d8a)
// WARNING: Removing unreachable block (ram,0x000140208dd0)
// WARNING: Removing unreachable block (ram,0x000140208d28)

ulonglong FUN_140208c20(longlong param_1,uint param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  ulonglong uVar5;
  uint uVar6;
  uint *puVar7;
  uint *puVar8;
  uint *puVar9;
  uint *puVar10;
  bool bVar11;
  bool bVar12;
  
  puVar9 = (uint *)0x0;
  puVar7 = (uint *)0x0;
  bVar12 = false;
  puVar2 = *(undefined8 **)(param_1 + 0x12e8);
  puVar8 = puVar9;
  if (puVar2 != (undefined8 *)0x0) {
    puVar8 = puVar7;
    if (puVar2 == *(undefined8 **)(param_1 + 0x12f0)) {
      if ((uint *)*puVar2 != (uint *)0x0) {
        puVar8 = (uint *)*puVar2;
        if ((puVar2 != *(undefined8 **)(param_1 + 0x12f0)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, puVar8 = puVar9,
           DAT_1406080a8 = iVar3, bVar12)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(puVar8);
        bVar12 = true;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = (longlong *)(param_1 + 0x2170);
  uVar5 = (ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 0x2180);
  puVar7 = puVar9;
  if (*plVar1 != 0) {
    for (puVar10 = *(uint **)(*plVar1 +
                             ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x2180)) * 8);
        (puVar7 = puVar9, puVar10 != (uint *)0x0 &&
        ((puVar10[8] != param_2 || (puVar7 = puVar10, *puVar10 != param_2))));
        puVar10 = *(uint **)(puVar10 + 6)) {
    }
  }
  if (puVar7 != (uint *)0x0) {
    (**(code **)(**(longlong **)(puVar7 + 2) + 0xc0))();
    if ((puVar7 != (uint *)0x0) && (*(longlong *)(puVar7 + 6) == 0)) {
      uVar6 = puVar7[8] % *(uint *)(param_1 + 0x2180) + 1;
      lVar4 = (longlong)(int)uVar6 << 3;
      puVar10 = puVar9;
      do {
        if (*(uint *)(param_1 + 0x2180) <= uVar6) break;
        if (*(longlong *)(lVar4 + *plVar1) != 0) {
          puVar10 = *(uint **)(lVar4 + *plVar1);
        }
        uVar6 = uVar6 + 1;
        lVar4 = lVar4 + 8;
      } while (puVar10 == (uint *)0x0);
    }
    uVar5 = (ulonglong)puVar7[8] % (ulonglong)*(uint *)(param_1 + 0x2180);
    lVar4 = *plVar1;
    if (puVar7 != *(uint **)(lVar4 + uVar5 * 8)) {
      puVar9 = *(uint **)(lVar4 + uVar5 * 8);
      for (puVar10 = *(uint **)(puVar9 + 6); puVar10 != puVar7; puVar10 = *(uint **)(puVar10 + 6)) {
        puVar9 = puVar10;
      }
    }
    if (puVar9 == (uint *)0x0) {
      *(undefined8 *)(lVar4 + ((ulonglong)puVar7[8] % (ulonglong)*(uint *)(param_1 + 0x2180)) * 8) =
           *(undefined8 *)(puVar7 + 6);
    }
    else {
      *(undefined8 *)(puVar9 + 6) = *(undefined8 *)(puVar7 + 6);
    }
    uVar5 = FUN_1402c6e80(plVar1,puVar7);
  }
  if (bVar12) {
    uVar5 = FUN_14034edd0(puVar8);
  }
  return uVar5;
}



undefined4 FUN_140208e30(longlong param_1,ulonglong *param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined4 uVar3;
  int iVar4;
  uint uVar5;
  ulonglong uVar6;
  longlong lVar7;
  longlong lVar8;
  longlong *plVar9;
  bool bVar10;
  bool bVar11;
  longlong local_30;
  
  local_30 = 0;
  bVar11 = false;
  plVar9 = *(longlong **)(param_1 + 0x12e8);
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == *(longlong **)(param_1 + 0x12f0)) {
      lVar8 = *plVar9;
      if (lVar8 != 0) {
        if (plVar9 != *(longlong **)(param_1 + 0x12f0)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar11) {
            FUN_140176d60();
          }
          lVar8 = 0;
        }
        FUN_14034ed40();
        bVar11 = true;
        local_30 = lVar8;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2178) != 0) {
    uVar6 = 0;
    if (*(uint *)(param_1 + 0x2180) != 0) {
      plVar9 = *(longlong **)(param_1 + 0x2170);
      do {
        if (*plVar9 != 0) {
          lVar8 = (*(longlong **)(param_1 + 0x2170))[uVar6];
          goto LAB_140208f20;
        }
        uVar5 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar5;
        plVar9 = plVar9 + 1;
      } while (uVar5 < *(uint *)(param_1 + 0x2180));
    }
  }
  do {
    lVar8 = 0;
LAB_140208f20:
    lVar7 = lVar8;
    if (lVar7 == 0) {
      if (bVar11) {
        FUN_14034edd0(local_30);
      }
      return 0;
    }
    if (lVar7 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    lVar8 = *(longlong *)(lVar7 + 8);
    plVar9 = *(longlong **)(lVar7 + 0x10);
    if (plVar9 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar9 + 1) = (int)plVar9[1] + 1;
      UNLOCK();
    }
    if (lVar8 != 0) {
      bVar10 = *(ulonglong *)(lVar8 + 0xfb0) < *param_2;
      if ((*(ulonglong *)(lVar8 + 0xfb0) == *param_2) &&
         (bVar10 = *(ulonglong *)(lVar8 + 0xfb8) < param_2[1],
         *(ulonglong *)(lVar8 + 0xfb8) == param_2[1])) {
        iVar4 = 0;
      }
      else {
        iVar4 = (1 - (uint)bVar10) - (uint)(bVar10 != 0);
      }
      if (iVar4 == 0) {
        uVar3 = *(undefined4 *)(lVar8 + 0x128);
        if (plVar9 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar9 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar9 + 8))(plVar9);
            LOCK();
            piVar2 = (int *)((longlong)plVar9 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar9 + 0x10))();
            }
          }
        }
        if (!bVar11) {
          return uVar3;
        }
        FUN_14034edd0(local_30);
        return uVar3;
      }
    }
    if (plVar9 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar9 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar9 + 8))(plVar9);
        LOCK();
        piVar2 = (int *)((longlong)plVar9 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar9 + 0x10))();
        }
      }
    }
  } while (lVar7 == 0);
  lVar8 = *(longlong *)(lVar7 + 0x18);
  if (lVar8 == 0) {
    uVar5 = *(uint *)(lVar7 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
    lVar7 = (longlong)(int)uVar5 << 3;
    do {
      if (*(uint *)(param_1 + 0x2180) <= uVar5) break;
      if (*(longlong *)(lVar7 + *(longlong *)(param_1 + 0x2170)) != 0) {
        lVar8 = *(longlong *)(lVar7 + *(longlong *)(param_1 + 0x2170));
      }
      uVar5 = uVar5 + 1;
      lVar7 = lVar7 + 8;
    } while (lVar8 == 0);
  }
  goto LAB_140208f20;
}



undefined4 * FUN_140209090(longlong param_1,undefined4 *param_2,uint param_3)

{
  longlong *plVar1;
  int iVar2;
  uint *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  if (param_3 == 0) {
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
  }
  else {
    lVar4 = 0;
    lVar5 = 0;
    bVar8 = false;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar6 = lVar4;
    if (plVar1 != (longlong *)0x0) {
      lVar6 = lVar5;
      if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
        if (*plVar1 != 0) {
          lVar6 = *plVar1;
          if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar6 = lVar4,
             DAT_1406080a8 = iVar2, bVar8)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40(lVar6);
          bVar8 = true;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar7 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
    if (*(longlong *)(param_1 + 0x2170) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(param_1 + 0x2170) +
                              ((ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x2180)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 6)) {
        if ((puVar3[8] == param_3) && (*puVar3 == param_3)) {
          if (puVar3 != (uint *)0x0) {
            if (puVar3 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            lVar4 = *(longlong *)(puVar3 + 2);
            *param_2 = *(undefined4 *)(lVar4 + 0xfb0);
            param_2[1] = *(undefined4 *)(lVar4 + 0xfb4);
            param_2[2] = *(undefined4 *)(lVar4 + 0xfb8);
            param_2[3] = *(undefined4 *)(lVar4 + 0xfbc);
            goto LAB_140209215;
          }
          break;
        }
      }
    }
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
LAB_140209215:
    if (bVar8) {
      FUN_14034edd0(lVar6);
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x00014020947c)

void FUN_140209240(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  size_t sVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *_Src;
  wchar_t *_Src_00;
  longlong lVar10;
  bool bVar11;
  bool bVar12;
  wchar_t local_4f [19];
  
  lVar10 = 0;
  bVar12 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar6 = *plVar1;
      lVar10 = 0;
      if (lVar6 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar12 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar12) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        FUN_14034ed40(lVar6);
        bVar12 = true;
        lVar10 = lVar6;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2178) != 0) {
    uVar5 = 0;
    if (*(uint *)(param_1 + 0x2180) != 0) {
      plVar1 = *(longlong **)(param_1 + 0x2170);
      plVar9 = plVar1;
      do {
        if (*plVar9 != 0) {
          lVar6 = plVar1[uVar5];
          goto LAB_140209353;
        }
        uVar4 = (int)uVar5 + 1;
        uVar5 = (ulonglong)uVar4;
        plVar9 = plVar9 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0x2180));
    }
  }
  lVar6 = 0;
LAB_140209353:
  do {
    do {
      lVar8 = lVar6;
      if (lVar8 == 0) {
        if (bVar12) {
          FUN_14034edd0(lVar10);
        }
        return;
      }
      plVar1 = *(longlong **)(lVar8 + 8);
      lVar6 = (**(code **)(*plVar1 + 0x280))(plVar1);
      if ((*(char *)(lVar6 + 0x80) != '\x01') && ((char)plVar1[0x30d] == '\0')) {
        local_4f[0] = L'\0';
        local_4f[1] = L'\0';
        local_4f[2] = L'\0';
        local_4f[3] = L'\0';
        local_4f[4] = L'\0';
        local_4f[5] = L'\0';
        local_4f[6] = L'\0';
        local_4f[7] = L'\0';
        local_4f[8] = L'\0';
        local_4f[9] = L'\0';
        local_4f[10] = L'\0';
        local_4f[0xb] = L'\0';
        local_4f[0xc] = L'\0';
        local_4f[0xd] = L'\0';
        local_4f[0xe] = L'\0';
        local_4f[0xf] = L'\0';
        FUN_1402f8580(plVar1);
        _Src_00 = (wchar_t *)(plVar1 + 0x1a);
        _Src = _Src_00;
        if (7 < (ulonglong)plVar1[0x1d]) {
          _Src = *(wchar_t **)_Src_00;
        }
        sVar7 = wcsnlen(_Src,0x10);
        if (sVar7 < 0x10) {
          if (7 < (ulonglong)plVar1[0x1d]) {
            _Src_00 = *(wchar_t **)_Src_00;
          }
          wcscpy_s(local_4f,0x10,_Src_00);
          FUN_1400d5470(param_2);
        }
      }
      lVar6 = *(longlong *)(lVar8 + 0x18);
    } while (lVar6 != 0);
    uVar4 = *(uint *)(lVar8 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
    lVar8 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(param_1 + 0x2180) <= uVar4) break;
      lVar2 = *(longlong *)(param_1 + 0x2170);
      if (*(longlong *)(lVar8 + lVar2) != 0) {
        lVar6 = *(longlong *)(lVar8 + lVar2);
      }
      uVar4 = uVar4 + 1;
      lVar8 = lVar8 + 8;
    } while (lVar6 == 0);
  } while( true );
}



void FUN_1402094c0(int param_1,longlong *param_2,float *param_3)

{
  uint uVar1;
  uint *puVar2;
  int iVar3;
  longlong *plVar4;
  longlong *plVar5;
  float fVar6;
  
  plVar5 = (longlong *)*param_2;
  if (plVar5 != (longlong *)param_2[1]) {
    do {
      uVar1 = *(uint *)(*plVar5 + 8);
      plVar4 = (longlong *)FUN_1403161f0();
      if (*plVar4 != 0) {
        for (puVar2 = *(uint **)(*plVar4 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar4 + 2)) * 8
                                ); puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
          if ((puVar2[0xea] == uVar1) && (*puVar2 == uVar1)) {
            if ((puVar2 != (uint *)0x0) &&
               (((puVar2[3] == 0x83 || (puVar2[3] == 0x84)) &&
                (iVar3 = (**(code **)(*(longlong *)*plVar5 + 0x90))(), param_1 == iVar3)))) {
              fVar6 = (float)(**(code **)(*(longlong *)*plVar5 + 0x98))();
              *param_3 = fVar6 + *param_3;
            }
            break;
          }
        }
      }
      plVar5 = plVar5 + 1;
    } while (plVar5 != (longlong *)param_2[1]);
  }
  return;
}



void FUN_1402095a0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  longlong lVar8;
  undefined1 uVar9;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 uStack_e0;
  undefined8 local_d8;
  undefined8 uStack_d0;
  undefined4 local_c8;
  undefined2 local_c0;
  undefined6 uStack_be;
  undefined8 local_b0;
  ulonglong local_a8;
  undefined2 local_98;
  undefined8 local_94;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar3 = 0;
  lVar8 = 0;
  bVar7 = false;
  uVar9 = 0;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar4 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar4 = lVar3;
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      if (*plVar1 != 0) {
        lVar4 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar8 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar9 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  local_108 = 0;
  local_100 = 0;
  local_f8 = 0;
  local_f0 = 0;
  local_e8 = 0;
  uStack_e0 = 0;
  local_d8 = 0;
  uStack_d0 = 0;
  local_c8 = 0;
  local_a8 = 7;
  local_b0 = 0;
  local_c0 = 0;
  local_98 = 0;
  local_94 = 0;
  local_88 = 0;
  local_80 = 0;
  local_78 = 0;
  local_70 = 0;
  local_68 = 0;
  local_60 = 0;
  local_58 = 0;
  local_50 = 0;
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_34 = 0;
  local_30 = 0;
  FUN_14031a6a0(&local_108,param_2,0,param_4,lVar8,uVar9);
  lVar8 = param_1 + 0x21f8;
  if ((int)local_80 != 0xff) {
    lVar8 = param_1 + 0x21d8;
  }
  FUN_14020d900(lVar8,&local_108);
  if (7 < local_a8) {
    operator_delete((void *)CONCAT62(uStack_be,local_c0));
  }
  local_a8 = 7;
  local_b0 = 0;
  local_c0 = 0;
  if (bVar7) {
    FUN_14034edd0(lVar4);
  }
  return;
}



ulonglong FUN_140209770(longlong param_1,ulonglong *param_2,char param_3)

{
  ulonglong *puVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  int iVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  longlong lVar8;
  bool bVar9;
  bool bVar10;
  
  uVar5 = 0;
  uVar6 = 0;
  bVar10 = false;
  puVar1 = *(ulonglong **)(param_1 + 0x12e8);
  uVar7 = uVar5;
  if (puVar1 != (ulonglong *)0x0) {
    uVar7 = uVar6;
    if (puVar1 == *(ulonglong **)(param_1 + 0x12f0)) {
      if (*puVar1 != 0) {
        uVar7 = *puVar1;
        if ((puVar1 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, uVar7 = uVar5,
           DAT_1406080a8 = iVar4, bVar10)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(uVar7);
        bVar10 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  uVar6 = uVar5;
  if (param_3 == '\0') {
    uVar3 = (*(longlong *)(param_1 + 0x21e0) - *(longlong *)(param_1 + 0x21d8)) / 0xe0;
    if (uVar3 != 0) {
      lVar8 = *(longlong *)(param_1 + 0x21d8);
      do {
        puVar1 = (ulonglong *)(uVar6 * 0xe0 + 0x20 + lVar8);
        uVar2 = *puVar1;
        bVar9 = uVar2 < *param_2;
        if ((uVar2 != *param_2) ||
           (uVar2 = puVar1[1], bVar9 = uVar2 < param_2[1], iVar4 = 0, uVar2 != param_2[1])) {
          iVar4 = (1 - (uint)bVar9) - (uint)(bVar9 != 0);
        }
        if (iVar4 == 0) goto LAB_14020990a;
        uVar6 = (ulonglong)((int)uVar6 + 1);
      } while (uVar6 < uVar3);
    }
  }
  else {
    uVar3 = (*(longlong *)(param_1 + 0x2200) - *(longlong *)(param_1 + 0x21f8)) / 0xe0;
    if (uVar3 != 0) {
      lVar8 = *(longlong *)(param_1 + 0x21f8);
      do {
        puVar1 = (ulonglong *)(uVar6 * 0xe0 + 0x20 + lVar8);
        uVar5 = *puVar1;
        bVar9 = uVar5 < *param_2;
        if ((uVar5 != *param_2) ||
           (uVar5 = puVar1[1], bVar9 = uVar5 < param_2[1], iVar4 = 0, uVar5 != param_2[1])) {
          iVar4 = (1 - (uint)bVar9) - (uint)(bVar9 != 0);
        }
        if (iVar4 == 0) goto LAB_14020990a;
        uVar6 = (ulonglong)((int)uVar6 + 1);
        uVar5 = 0;
      } while (uVar6 < uVar3);
    }
  }
LAB_140209917:
  if (bVar10) {
    FUN_14034edd0(uVar7);
  }
  return uVar5;
LAB_14020990a:
  uVar5 = uVar6 * 0xe0 + lVar8;
  goto LAB_140209917;
}



ulonglong FUN_140209940(longlong param_1,int param_2)

{
  ulonglong *puVar1;
  int iVar2;
  int *piVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  bool bVar8;
  bool bVar9;
  
  uVar4 = 0;
  uVar5 = 0;
  bVar9 = false;
  puVar1 = *(ulonglong **)(param_1 + 0x12e8);
  uVar6 = uVar4;
  if (puVar1 != (ulonglong *)0x0) {
    uVar6 = uVar5;
    if (puVar1 == *(ulonglong **)(param_1 + 0x12f0)) {
      if (*puVar1 != 0) {
        uVar6 = *puVar1;
        if ((puVar1 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, uVar6 = uVar4,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(uVar6);
        bVar9 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  uVar5 = (*(longlong *)(param_1 + 0x21e0) - *(longlong *)(param_1 + 0x21d8)) / 0xe0;
  if (uVar5 != 0) {
    piVar3 = (int *)(*(longlong *)(param_1 + 0x21d8) + 0x88);
    uVar7 = uVar4;
    do {
      if (*piVar3 == param_2) {
        uVar4 = uVar7 * 0xe0 + *(longlong *)(param_1 + 0x21d8);
        break;
      }
      uVar7 = (ulonglong)((int)uVar7 + 1);
      piVar3 = piVar3 + 0x38;
    } while (uVar7 < uVar5);
  }
  if (bVar9) {
    FUN_14034edd0(uVar6);
  }
  return uVar4;
}



void FUN_140209a80(longlong param_1,ulonglong *param_2,char param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  ulonglong *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  longlong lVar9;
  undefined1 local_108 [32];
  ulonglong local_e8;
  ulonglong local_e0;
  undefined2 local_c0;
  undefined6 uStack_be;
  undefined8 local_b0;
  ulonglong local_a8;
  
  lVar6 = 0;
  lVar4 = 0;
  lVar9 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_3 == '\0') {
    lVar4 = *(longlong *)(param_1 + 0x21d8);
    if (lVar4 != *(longlong *)(param_1 + 0x21e0)) {
      do {
        FUN_140209d90(local_108,lVar4);
        bVar7 = local_e8 < *param_2;
        if ((local_e8 != *param_2) ||
           (bVar7 = local_e0 < param_2[1], iVar2 = 0, local_e0 != param_2[1])) {
          iVar2 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
        }
        if (iVar2 == 0) {
          FUN_14020def0(lVar4 + 0xe0,*(undefined8 *)(param_1 + 0x21e0),lVar4,param_4,lVar9);
          lVar4 = *(longlong *)(param_1 + 0x21e0);
          lVar9 = lVar4 + -0xe0;
          if (lVar9 != lVar4) {
            puVar3 = (ulonglong *)(lVar4 + -0x80);
            do {
              if (7 < *puVar3) {
                operator_delete((void *)puVar3[-3]);
              }
              *puVar3 = 7;
              puVar3[-1] = 0;
              *(undefined2 *)(puVar3 + -3) = 0;
              lVar9 = lVar9 + 0xe0;
              puVar3 = puVar3 + 0x1c;
            } while (lVar9 != lVar4);
          }
          *(longlong *)(param_1 + 0x21e0) = *(longlong *)(param_1 + 0x21e0) + -0xe0;
          if (7 < local_a8) {
            operator_delete((void *)CONCAT62(uStack_be,local_c0));
          }
          local_a8 = 7;
          local_b0 = 0;
          local_c0 = 0;
          break;
        }
        if (7 < local_a8) {
          operator_delete((void *)CONCAT62(uStack_be,local_c0));
        }
        lVar4 = lVar4 + 0xe0;
      } while (lVar4 != *(longlong *)(param_1 + 0x21e0));
    }
  }
  else {
    lVar4 = *(longlong *)(param_1 + 0x21f8);
    if (lVar4 != *(longlong *)(param_1 + 0x2200)) {
      do {
        FUN_140209d90(local_108,lVar4);
        bVar7 = local_e8 < *param_2;
        if ((local_e8 != *param_2) ||
           (bVar7 = local_e0 < param_2[1], iVar2 = 0, local_e0 != param_2[1])) {
          iVar2 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
        }
        if (iVar2 == 0) {
          FUN_14020def0(lVar4 + 0xe0,*(undefined8 *)(param_1 + 0x2200),lVar4,param_4,lVar9);
          lVar4 = *(longlong *)(param_1 + 0x2200);
          lVar9 = lVar4 + -0xe0;
          if (lVar9 != lVar4) {
            puVar3 = (ulonglong *)(lVar4 + -0x80);
            do {
              if (7 < *puVar3) {
                operator_delete((void *)puVar3[-3]);
              }
              *puVar3 = 7;
              puVar3[-1] = 0;
              *(undefined2 *)(puVar3 + -3) = 0;
              lVar9 = lVar9 + 0xe0;
              puVar3 = puVar3 + 0x1c;
            } while (lVar9 != lVar4);
          }
          *(longlong *)(param_1 + 0x2200) = *(longlong *)(param_1 + 0x2200) + -0xe0;
          if (7 < local_a8) {
            operator_delete((void *)CONCAT62(uStack_be,local_c0));
          }
          local_a8 = 7;
          local_b0 = 0;
          local_c0 = 0;
          break;
        }
        if (7 < local_a8) {
          operator_delete((void *)CONCAT62(uStack_be,local_c0));
        }
        lVar4 = lVar4 + 0xe0;
      } while (lVar4 != *(longlong *)(param_1 + 0x2200));
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return;
}



undefined8 * FUN_140209d90(undefined8 *param_1,undefined8 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined4 *)(param_1 + 3) = *(undefined4 *)(param_2 + 3);
  *(undefined4 *)((longlong)param_1 + 0x1c) = *(undefined4 *)((longlong)param_2 + 0x1c);
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)((longlong)param_1 + 0x24) = *(undefined4 *)((longlong)param_2 + 0x24);
  *(undefined4 *)(param_1 + 5) = *(undefined4 *)(param_2 + 5);
  *(undefined4 *)((longlong)param_1 + 0x2c) = *(undefined4 *)((longlong)param_2 + 0x2c);
  *(undefined4 *)(param_1 + 6) = *(undefined4 *)(param_2 + 6);
  *(undefined4 *)((longlong)param_1 + 0x34) = *(undefined4 *)((longlong)param_2 + 0x34);
  *(undefined4 *)(param_1 + 7) = *(undefined4 *)(param_2 + 7);
  *(undefined4 *)((longlong)param_1 + 0x3c) = *(undefined4 *)((longlong)param_2 + 0x3c);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_2 + 8);
  param_1[0xc] = 7;
  param_1[0xb] = 0;
  *(undefined2 *)(param_1 + 9) = 0;
  FUN_1400015e0(param_1 + 9,param_2 + 9,0,0xffffffffffffffff);
  *(undefined2 *)(param_1 + 0xe) = *(undefined2 *)(param_2 + 0xe);
  *(undefined4 *)((longlong)param_1 + 0x74) = *(undefined4 *)((longlong)param_2 + 0x74);
  *(undefined4 *)(param_1 + 0xf) = *(undefined4 *)(param_2 + 0xf);
  param_1[0x10] = param_2[0x10];
  *(undefined4 *)(param_1 + 0x11) = *(undefined4 *)(param_2 + 0x11);
  *(undefined4 *)((longlong)param_1 + 0x8c) = *(undefined4 *)((longlong)param_2 + 0x8c);
  *(undefined4 *)(param_1 + 0x12) = *(undefined4 *)(param_2 + 0x12);
  *(undefined4 *)((longlong)param_1 + 0x94) = *(undefined4 *)((longlong)param_2 + 0x94);
  *(undefined4 *)(param_1 + 0x13) = *(undefined4 *)(param_2 + 0x13);
  *(undefined4 *)((longlong)param_1 + 0x9c) = *(undefined4 *)((longlong)param_2 + 0x9c);
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_2 + 0x14);
  *(undefined8 *)((longlong)param_1 + 0xa4) = *(undefined8 *)((longlong)param_2 + 0xa4);
  *(undefined8 *)((longlong)param_1 + 0xac) = *(undefined8 *)((longlong)param_2 + 0xac);
  *(undefined8 *)((longlong)param_1 + 0xb4) = *(undefined8 *)((longlong)param_2 + 0xb4);
  *(undefined8 *)((longlong)param_1 + 0xbc) = *(undefined8 *)((longlong)param_2 + 0xbc);
  *(undefined8 *)((longlong)param_1 + 0xc4) = *(undefined8 *)((longlong)param_2 + 0xc4);
  *(undefined8 *)((longlong)param_1 + 0xcc) = *(undefined8 *)((longlong)param_2 + 0xcc);
  *(undefined8 *)((longlong)param_1 + 0xd4) = *(undefined8 *)((longlong)param_2 + 0xd4);
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014020a522)

void FUN_140209f10(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  uint uVar3;
  undefined8 uVar4;
  bool bVar5;
  char cVar6;
  int iVar7;
  undefined4 uVar8;
  uint *puVar9;
  longlong *plVar10;
  ulonglong uVar11;
  wchar_t *_Src;
  longlong lVar12;
  longlong lVar13;
  int iVar14;
  ulonglong uVar15;
  undefined1 local_res10 [8];
  undefined2 local_res18 [4];
  undefined2 local_res20 [4];
  undefined2 local_158 [4];
  longlong *local_150;
  longlong *local_148;
  undefined8 local_140;
  char local_138;
  undefined2 local_128;
  undefined2 uStack_126;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  wchar_t local_100 [17];
  undefined8 local_de;
  undefined8 local_d6;
  undefined8 local_ce;
  undefined4 local_c6;
  undefined2 local_c2;
  undefined4 local_c0;
  undefined4 uStack_bc;
  undefined4 local_b8;
  undefined4 uStack_b4;
  undefined4 local_b0;
  undefined4 uStack_ac;
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined4 local_a0;
  undefined4 uStack_9c;
  undefined4 local_98;
  undefined4 uStack_94;
  undefined4 local_90;
  undefined8 local_8c;
  undefined4 local_78;
  undefined4 uStack_74;
  undefined4 local_70;
  undefined4 uStack_6c;
  undefined8 local_68;
  
  local_68 = 0xfffffffffffffffe;
  FUN_140319940(DAT_140608110,&local_150);
  if (((local_150 != (longlong *)0x0) && (*(longlong *)(param_1 + 0x20e0) != 0)) &&
     (*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) != 0)) {
    uVar11 = 0;
    local_140 = 0;
    local_138 = '\0';
    cVar6 = FUN_140195920(param_1 + 0x12e8);
    if (cVar6 != '\0') {
      local_140 = FUN_140195970(param_1 + 0x12e8);
      local_138 = 0;
      FUN_14034ed40(local_140);
      local_138 = '\x01';
    }
    lVar12 = *(longlong *)(param_1 + 0x21d8);
    uVar15 = uVar11;
    if (0 < (int)((*(longlong *)(param_1 + 0x21e0) - lVar12) / 0xe0)) {
      do {
        uVar3 = *(uint *)(lVar12 + 0x18 + uVar11);
        iVar14 = (int)uVar15;
        if (*local_150 != 0) {
          for (puVar9 = *(uint **)(*local_150 +
                                  ((ulonglong)uVar3 % (ulonglong)*(uint *)(local_150 + 2)) * 8);
              puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 6)) {
            if ((puVar9[8] == uVar3) && (*puVar9 == uVar3)) {
              if (puVar9 != (uint *)0x0) {
                lVar13 = *(longlong *)(puVar9 + 2);
                if (((lVar13 != 0) && (*(int *)(lVar12 + 0x9c + uVar11) == 0)) &&
                   ((*(int *)(lVar13 + 0x20) == 1 &&
                    (*(int *)(lVar12 + 0x8c + uVar11) < *(int *)(lVar13 + 0x2c))))) {
                  iVar7 = *(int *)(lVar12 + 0x90 + uVar11) + 1;
                  if (iVar7 < 0) {
                    iVar7 = 0;
                  }
                  *(int *)(lVar12 + 0x90 + uVar11) = iVar7;
                  iVar7 = *(int *)(lVar12 + 0x94 + uVar11);
                  if (iVar7 < 0) {
                    iVar7 = 0;
                  }
                  *(int *)(lVar12 + 0x8c + uVar11) = iVar7;
                  local_res18[0] =
                       (undefined2)*(undefined4 *)(*(longlong *)(param_1 + 0x21d8) + 0x18 + uVar11);
                  plVar10 = (longlong *)
                            (*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x3e0);
                  (**(code **)(*plVar10 + 0xb60))
                            (plVar10,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),
                             &DAT_1405d85a0,local_res18);
                  lVar12 = *(longlong *)(param_1 + 0x21d8);
                  if (*(int *)(lVar13 + 0x24) <= *(int *)(lVar12 + 0x90 + uVar11)) {
                    if (*(int *)(lVar13 + 0x1c) == 1) {
                      lVar13 = (longlong)*(int *)(lVar12 + 0xbc + uVar11) +
                               (longlong)*(int *)(lVar12 + 0xb8 + uVar11) +
                               (longlong)*(int *)(lVar12 + 0xb4 + uVar11) +
                               (longlong)*(int *)(lVar12 + 0xb0 + uVar11) +
                               (longlong)*(int *)(lVar12 + 0xac + uVar11) +
                               (longlong)*(int *)(lVar12 + 0xa8 + uVar11) +
                               (longlong)*(int *)(lVar12 + 0xa4 + uVar11);
                      uVar8 = FUN_14031aa70((longlong)iVar14 * 0xe0 + lVar12);
                      uVar8 = FUN_14031b5e0(*(undefined8 *)(lVar12 + uVar11),lVar13,uVar8);
                      *(undefined4 *)(lVar12 + 0x9c + uVar11) = uVar8;
                      lVar12 = *(longlong *)(param_1 + 0x21d8);
                      uVar8 = FUN_14031ab40((longlong)iVar14 * 0xe0 + lVar12,
                                            *(undefined4 *)(lVar12 + 0x9c + uVar11));
                      uVar8 = FUN_1402701a0(*(undefined8 *)(*(longlong *)(param_1 + 0x20e0) + 0xb50)
                                            ,uVar8);
                      *(undefined4 *)(lVar12 + 0xa0 + uVar11) = uVar8;
                    }
                    else {
                      iVar7 = FUN_14031a980((longlong)iVar14 * 0xe0 + lVar12,&local_150);
                      if (iVar7 != 0) {
                        local_res10[0] =
                             (undefined1)
                             *(undefined4 *)(*(longlong *)(param_1 + 0x21d8) + 0x74 + uVar11);
                        local_res20[0] =
                             (undefined2)
                             *(undefined4 *)(*(longlong *)(param_1 + 0x21d8) + 0x18 + uVar11);
                        plVar10 = (longlong *)
                                  (*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x3e0);
                        (**(code **)(*plVar10 + 0xb70))
                                  (plVar10,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),
                                   &DAT_1405d85a0,local_res20,local_res10);
                      }
                    }
                  }
                  bVar5 = false;
                  local_100[0x10] = 0;
                  local_de = 0;
                  local_d6 = 0;
                  local_ce = 0;
                  local_c6 = 0;
                  local_c2 = 0;
                  local_c0 = 0;
                  uStack_bc = 0;
                  local_b8 = 0;
                  uStack_b4 = 0;
                  local_b0 = 0;
                  uStack_ac = 0;
                  local_a8 = 0;
                  uStack_a4 = 0;
                  local_a0 = 0;
                  uStack_9c = 0;
                  local_98 = 0;
                  uStack_94 = 0;
                  local_90 = 0;
                  local_8c = 0;
                  local_100[0] = L'\0';
                  local_100[1] = L'\0';
                  local_100[2] = L'\0';
                  local_100[3] = L'\0';
                  local_100[4] = L'\0';
                  local_100[5] = L'\0';
                  local_100[6] = L'\0';
                  local_100[7] = L'\0';
                  local_100[8] = L'\0';
                  local_100[9] = L'\0';
                  local_100[10] = L'\0';
                  local_100[0xb] = L'\0';
                  local_100[0xc] = L'\0';
                  local_100[0xd] = L'\0';
                  local_100[0xe] = L'\0';
                  local_100[0xf] = L'\0';
                  lVar12 = *(longlong *)(param_1 + 0x21d8);
                  _local_128 = CONCAT22(*(undefined2 *)(uVar11 + 0x1c + lVar12),
                                        *(undefined2 *)(uVar11 + 0x18 + lVar12));
                  local_124 = *(undefined4 *)(uVar11 + 0x20 + lVar12);
                  local_120 = *(undefined4 *)(uVar11 + 0x24 + lVar12);
                  local_11c = *(undefined4 *)(uVar11 + 0x28 + lVar12);
                  local_118 = *(undefined4 *)(uVar11 + 0x2c + lVar12);
                  local_114 = *(undefined4 *)(uVar11 + 0x30 + lVar12);
                  local_110 = *(undefined4 *)(uVar11 + 0x34 + lVar12);
                  local_10c = *(undefined4 *)(uVar11 + 0x38 + lVar12);
                  local_108 = *(undefined4 *)(uVar11 + 0x3c + lVar12);
                  local_104 = *(undefined4 *)(uVar11 + 0x40 + lVar12);
                  _Src = (wchar_t *)(uVar11 + 0x48 + lVar12);
                  if (7 < *(ulonglong *)(_Src + 0xc)) {
                    _Src = *(wchar_t **)_Src;
                  }
                  wcscpy_s(local_100,0x10,_Src);
                  local_100[0x10] = *(undefined2 *)(uVar11 + 0x70 + lVar12);
                  local_de = CONCAT44(*(undefined4 *)(uVar11 + 0x78 + lVar12),
                                      *(undefined4 *)(uVar11 + 0x74 + lVar12));
                  local_d6 = *(undefined8 *)(uVar11 + 0x80 + lVar12);
                  local_ce = CONCAT44(*(undefined4 *)(uVar11 + 0x8c + lVar12),
                                      *(undefined4 *)(uVar11 + 0x88 + lVar12));
                  local_c6 = *(undefined4 *)(uVar11 + 0x90 + lVar12);
                  local_c2 = *(undefined2 *)(uVar11 + 0x9c + lVar12);
                  local_c0 = *(undefined4 *)(uVar11 + 0xa0 + lVar12);
                  uVar4 = *(undefined8 *)(uVar11 + 0xa4 + lVar12);
                  uStack_bc = (undefined4)uVar4;
                  local_b8 = (undefined4)((ulonglong)uVar4 >> 0x20);
                  uVar4 = *(undefined8 *)(uVar11 + 0xac + lVar12);
                  uStack_b4 = (undefined4)uVar4;
                  local_b0 = (undefined4)((ulonglong)uVar4 >> 0x20);
                  uVar4 = *(undefined8 *)(uVar11 + 0xb4 + lVar12);
                  uStack_ac = (undefined4)uVar4;
                  local_a8 = (undefined4)((ulonglong)uVar4 >> 0x20);
                  uVar4 = *(undefined8 *)(uVar11 + 0xbc + lVar12);
                  uStack_a4 = (undefined4)uVar4;
                  local_a0 = (undefined4)((ulonglong)uVar4 >> 0x20);
                  uVar4 = *(undefined8 *)(uVar11 + 0xc4 + lVar12);
                  uStack_9c = (undefined4)uVar4;
                  local_98 = (undefined4)((ulonglong)uVar4 >> 0x20);
                  uVar4 = *(undefined8 *)(uVar11 + 0xcc + lVar12);
                  uStack_94 = (undefined4)uVar4;
                  local_90 = (undefined4)((ulonglong)uVar4 >> 0x20);
                  local_8c = *(undefined8 *)(uVar11 + 0xd4 + lVar12);
                  lVar12 = *(longlong *)(param_1 + 0x20e0);
                  local_78 = *(undefined4 *)(lVar12 + 0x170);
                  uStack_74 = *(undefined4 *)(lVar12 + 0x174);
                  local_70 = *(undefined4 *)(lVar12 + 0x178);
                  uStack_6c = *(undefined4 *)(lVar12 + 0x17c);
                  iVar7 = *(int *)(lVar12 + 0x284);
                  if ((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(lVar12 + 0xb50) + 700))) {
                    if ((*(longlong *)(lVar12 + 0x170) != 0) || (*(longlong *)(lVar12 + 0x178) != 0)
                       ) {
                      bVar5 = true;
                    }
                    if ((bVar5) &&
                       (lVar13 = *(longlong *)(*(longlong *)(lVar12 + 0xb50) + 0x4c0), lVar13 != 0))
                    {
                      local_158[0] = (undefined2)iVar7;
                      plVar10 = (longlong *)
                                (*(longlong *)
                                  (*(longlong *)(lVar13 + 8) +
                                  (longlong)*(int *)(lVar12 + 0x288) * 8) + 0x70);
                      (**(code **)(*plVar10 + 0x9f0))
                                (plVar10,1,&DAT_1405d85a0,local_158,&local_78,&local_128);
                    }
                  }
                }
              }
              break;
            }
          }
        }
        uVar15 = (ulonglong)(iVar14 + 1U);
        uVar11 = uVar11 + 0xe0;
        lVar12 = *(longlong *)(param_1 + 0x21d8);
      } while ((int)(iVar14 + 1U) < (int)((*(longlong *)(param_1 + 0x21e0) - lVar12) / 0xe0));
    }
    if (local_138 != '\0') {
      FUN_14034edd0(local_140);
    }
  }
  plVar10 = local_148;
  if (local_148 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_148 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_148 + 8))(local_148);
      LOCK();
      piVar2 = (int *)((longlong)plVar10 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_148 + 0x10))();
      }
    }
  }
  return;
}



void FUN_14020a5a0(longlong param_1,undefined8 *param_2,char param_3)

{
  int iVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  uint *puVar5;
  uint uVar6;
  ulonglong uVar7;
  uint uVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  lVar9 = 0;
  bVar11 = false;
  plVar3 = *(longlong **)(param_1 + 0x12e8);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar3;
      lVar9 = 0;
      if (lVar4 != 0) {
        if (plVar3 != *(longlong **)(param_1 + 0x12f0)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        FUN_14034ed40(lVar4);
        bVar11 = true;
        lVar9 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_3 == '\0') {
    lVar4 = *(longlong *)(param_1 + 0x2268) - *(longlong *)(param_1 + 0x2260);
    lVar4 = lVar4 / 6 + (lVar4 >> 0x3f);
    iVar2 = (int)(lVar4 >> 2);
    iVar1 = (int)(lVar4 >> 0x3f);
    uVar8 = *(uint *)(param_2 + 2);
    plVar3 = (longlong *)FUN_14013ef40();
    if (*plVar3 != 0) {
      for (puVar5 = *(uint **)(*plVar3 + ((ulonglong)uVar8 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
          puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0x50)) {
        if ((puVar5[0x52] == uVar8) && (*puVar5 == uVar8)) {
          if (puVar5 != (uint *)0x0) {
            if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar8 = puVar5[0x19];
            goto LAB_14020a6f2;
          }
          break;
        }
      }
    }
    uVar8 = 0;
LAB_14020a6f2:
    uVar7 = 0;
    if (iVar2 != iVar1) {
      lVar4 = 0;
      do {
        if (*(int *)(lVar4 + 0x10 + *(longlong *)(param_1 + 0x2260)) != 0) {
          uVar6 = *(uint *)(lVar4 + 0x10 + *(longlong *)(param_1 + 0x2260));
          plVar3 = (longlong *)FUN_14013ef40();
          if (*plVar3 != 0) {
            for (puVar5 = *(uint **)(*plVar3 +
                                    ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
                puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0x50)) {
              if ((puVar5[0x52] == uVar6) && (*puVar5 == uVar6)) {
                if (puVar5 != (uint *)0x0) {
                  if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                    FUN_14000d450(0x80004005);
                  }
                  uVar6 = puVar5[0x19];
                  goto LAB_14020a760;
                }
                break;
              }
            }
          }
          uVar6 = 0;
LAB_14020a760:
          if (uVar8 == uVar6) {
            FUN_14020ac80(param_1,0xffffffff,*(longlong *)(param_1 + 0x2260) + uVar7 * 0x18);
          }
        }
        uVar6 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar6;
        lVar4 = lVar4 + 0x18;
      } while (uVar6 < (uint)(iVar2 - iVar1));
    }
  }
  local_40 = *param_2;
  local_38 = param_2[1];
  local_30 = param_2[2];
  FUN_140053920(param_1 + 0x2260,&local_40);
  if (bVar11) {
    FUN_14034edd0(lVar9);
  }
  return;
}



void FUN_14020a800(longlong param_1)

{
  uint uVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  uint *puVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  uint uVar11;
  longlong lVar12;
  bool bVar13;
  bool bVar14;
  float fVar15;
  undefined8 uVar16;
  longlong lVar17;
  undefined1 uVar18;
  float local_70;
  undefined8 local_6c;
  undefined8 local_64;
  uint local_5c;
  uint local_58 [12];
  
  uVar16 = 0xfffffffffffffffe;
  lVar12 = 0;
  lVar17 = 0;
  bVar14 = false;
  uVar18 = 0;
  plVar5 = *(longlong **)(param_1 + 0x12e8);
  if (plVar5 != (longlong *)0x0) {
    if (plVar5 == *(longlong **)(param_1 + 0x12f0)) {
      lVar6 = *plVar5;
      lVar12 = 0;
      if (lVar6 != 0) {
        if (plVar5 != *(longlong **)(param_1 + 0x12f0)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar14 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar14) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        lVar17 = lVar6;
        FUN_14034ed40(lVar6);
        bVar14 = true;
        uVar18 = 1;
        lVar12 = lVar6;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar13 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  lVar6 = *(longlong *)(param_1 + 0x2268) - *(longlong *)(param_1 + 0x2260);
  lVar6 = lVar6 / 6 + (lVar6 >> 0x3f);
  iVar3 = (int)(lVar6 >> 0x3f);
  iVar4 = (int)(lVar6 >> 2);
  local_58[0] = 0;
  local_58[1] = 0;
  local_58[2] = 0;
  local_58[3] = 0;
  local_58[4] = 0;
  local_58[5] = 0;
  local_70 = 0.0;
  local_6c = 0;
  local_64 = 0;
  local_5c = 0;
  memset((void *)(param_1 + 0x2280),0,0x50);
  uVar11 = 0;
  if (iVar4 != iVar3) {
    lVar6 = 0;
    do {
      if (*(int *)(*(longlong *)(param_1 + 0x2260) + 0x10 + lVar6) != 0) {
        uVar1 = *(uint *)(*(longlong *)(param_1 + 0x2260) + 0x10 + lVar6);
        plVar5 = (longlong *)FUN_14013ef40();
        if (*plVar5 != 0) {
          for (puVar7 = *(uint **)(*plVar5 +
                                  ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar5 + 2)) * 8);
              puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0x50)) {
            if ((puVar7[0x52] == uVar1) && (*puVar7 == uVar1)) {
              if (puVar7 != (uint *)0x0) {
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_58[0] = puVar7[0x26];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_58[1] = puVar7[0x27];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_58[2] = puVar7[0x28];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_58[3] = puVar7[0x29];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_58[4] = puVar7[0x2a];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_58[5] = puVar7[0x2b];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_70 = (float)puVar7[0x2c];
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_6c = CONCAT44(local_6c._4_4_,puVar7[0x2d]);
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_6c = CONCAT44(puVar7[0x2e],puVar7[0x2d]);
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_64 = CONCAT44(local_64._4_4_,puVar7[0x2f]);
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_64 = CONCAT44(puVar7[0x30],puVar7[0x2f]);
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_5c = puVar7[0x31];
              }
              break;
            }
          }
        }
        lVar9 = 0;
        lVar10 = 6;
        do {
          iVar2 = *(int *)((longlong)local_58 + lVar9);
          lVar8 = (longlong)iVar2;
          if ((0 < iVar2) && (*(longlong *)(param_1 + 0x20e0) != 0)) {
            if ((iVar2 - 1U < 0x13) && (*(float *)(param_1 + 0x2280 + lVar8 * 4) != 0.0)) {
              if (iVar2 - 1U < 0x13) {
                fVar15 = *(float *)((longlong)&local_70 + lVar9) +
                         *(float *)(param_1 + 0x2280 + lVar8 * 4);
LAB_14020ab29:
                *(float *)(param_1 + 0x2280 + lVar8 * 4) = fVar15;
              }
            }
            else {
              fVar15 = *(float *)((longlong)&local_70 + lVar9);
              if (iVar2 - 1U < 0x13) goto LAB_14020ab29;
            }
          }
          lVar9 = lVar9 + 4;
          lVar10 = lVar10 + -1;
        } while (lVar10 != 0);
      }
      uVar11 = uVar11 + 1;
      lVar6 = lVar6 + 0x18;
    } while (uVar11 < (uint)(iVar4 - iVar3));
  }
  lVar9 = *(longlong *)(param_1 + 0x2268) - *(longlong *)(param_1 + 0x2260);
  lVar6 = lVar9 >> 0x3f;
  if (((lVar9 / 0x18 + lVar6 != lVar6) && (lVar6 = *(longlong *)(param_1 + 0x20e0), lVar6 != 0)) &&
     (*(longlong *)(lVar6 + 0xb50) != 0)) {
    plVar5 = (longlong *)(*(longlong *)(lVar6 + 0xb50) + 0x78);
    (**(code **)(*plVar5 + 0x8e0))
              (plVar5,*(undefined4 *)(lVar6 + 8),&DAT_1405d85a0,param_1 + 0x2260,uVar16,lVar17,
               uVar18);
  }
  if (bVar14) {
    FUN_14034edd0(lVar12);
  }
  return;
}



void FUN_14020ac80(longlong param_1,int param_2,ulonglong *param_3)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong *puVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong lVar7;
  ulonglong *puVar8;
  ulonglong *puVar9;
  longlong lVar10;
  bool bVar11;
  bool bVar12;
  bool bVar13;
  undefined2 local_res8 [4];
  undefined4 local_res20 [2];
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  ulonglong local_58;
  ulonglong local_50;
  ulonglong local_48;
  
  lVar10 = 0;
  bVar13 = false;
  plVar6 = *(longlong **)(param_1 + 0x12e8);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar6;
      lVar10 = 0;
      if (lVar5 != 0) {
        if (plVar6 != *(longlong **)(param_1 + 0x12f0)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar13 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar13) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        FUN_14034ed40(lVar5);
        bVar13 = true;
        lVar10 = lVar5;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  puVar9 = *(ulonglong **)(param_1 + 0x2260);
  lVar5 = *(longlong *)(param_1 + 0x2268) - (longlong)puVar9;
  lVar5 = lVar5 / 6 + (lVar5 >> 0x3f);
  bVar12 = false;
  if (puVar9 != *(ulonglong **)(param_1 + 0x2268)) {
    do {
      local_58 = *puVar9;
      local_50 = puVar9[1];
      local_48 = puVar9[2];
      bVar11 = local_58 < *param_3;
      if ((local_58 == *param_3) && (bVar11 = local_50 < param_3[1], local_50 == param_3[1])) {
        iVar4 = 0;
      }
      else {
        iVar4 = (1 - (uint)bVar11) - (uint)(bVar11 != 0);
      }
      if (iVar4 == 0) {
        bVar12 = true;
LAB_14020adf1:
        lVar1 = *(longlong *)(param_1 + 0x20e0);
        if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0xb50) != 0)) {
          local_68 = *(undefined4 *)(lVar1 + 0x170);
          local_64 = *(undefined4 *)(lVar1 + 0x174);
          local_60 = *(undefined4 *)(lVar1 + 0x178);
          local_5c = *(undefined4 *)(lVar1 + 0x17c);
          iVar4 = *(int *)(lVar1 + 0x284);
          local_res20[0] = *(undefined4 *)(lVar1 + 8);
          if ((-1 < iVar4) &&
             ((iVar4 < *(short *)(*(longlong *)(lVar1 + 0xb50) + 700) &&
              (lVar7 = *(longlong *)(*(longlong *)(lVar1 + 0xb50) + 0x4c0), lVar7 != 0)))) {
            local_res8[0] = (undefined2)iVar4;
            plVar6 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(lVar1 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar6 + 0x7f0))
                      (plVar6,1,&DAT_1405d85a0,local_res8,local_res20,&local_58,&local_68);
          }
          lVar1 = *(longlong *)(param_1 + 0x20e0);
          if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0xb50) != 0)) {
            plVar6 = (longlong *)(*(longlong *)(lVar1 + 0xb50) + 0x78);
            (**(code **)(*plVar6 + 0xae0))
                      (plVar6,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,&local_58);
          }
        }
        puVar2 = *(ulonglong **)(param_1 + 0x2268);
        puVar8 = puVar9;
        puVar3 = puVar9;
        while (puVar3 = puVar3 + 3, puVar3 != puVar2) {
          *puVar8 = *puVar3;
          puVar8[1] = puVar3[1];
          puVar8[2] = puVar3[2];
          puVar8 = puVar8 + 3;
        }
        *(longlong *)(param_1 + 0x2268) = *(longlong *)(param_1 + 0x2268) + -0x18;
        lVar7 = *(longlong *)(param_1 + 0x2268) - *(longlong *)(param_1 + 0x2260);
        lVar1 = lVar7 >> 0x3f;
        if ((lVar7 / 0x18 + lVar1 == lVar1) || (bVar12)) break;
      }
      else {
        if ((bVar12) || ((iVar4 = (int)(local_48 >> 0x20), 0 < iVar4 && (iVar4 <= param_2))))
        goto LAB_14020adf1;
        puVar9 = puVar9 + 3;
      }
    } while (puVar9 != *(ulonglong **)(param_1 + 0x2268));
  }
  if ((int)(lVar5 >> 2) - (int)(lVar5 >> 0x3f) !=
      (int)((*(longlong *)(param_1 + 0x2268) - *(longlong *)(param_1 + 0x2260)) / 0x18)) {
    FUN_14020a800(param_1);
  }
  if (bVar13) {
    FUN_14034edd0(lVar10);
  }
  return;
}



void FUN_14020afe0(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 *_Src;
  ulonglong *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  int iVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong lVar9;
  longlong lVar10;
  bool bVar11;
  bool bVar12;
  longlong lVar13;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined1 local_70 [88];
  
  lVar9 = 0;
  lVar13 = 0;
  bVar12 = false;
  plVar2 = *(longlong **)(param_1 + 0x12e8);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x12f0)) {
      lVar7 = *plVar2;
      lVar9 = 0;
      if (lVar7 != 0) {
        if (plVar2 != *(longlong **)(param_1 + 0x12f0)) {
          iVar6 = DAT_1406080a8 + 1;
          bVar12 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar6;
          if (bVar12) {
            FUN_140176d60(1);
          }
          lVar7 = 0;
        }
        lVar13 = lVar7;
        FUN_14034ed40(lVar7);
        bVar12 = true;
        lVar9 = lVar7;
      }
    }
    else {
      iVar6 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar6;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(longlong *)(param_1 + 0x20e0) != 0) &&
     (uVar8 = (param_2[1] - *param_2) / 0x50, (int)uVar8 != 0)) {
    lVar10 = 0;
    lVar7 = 0;
    uVar8 = uVar8 & 0xffffffff;
    do {
      uVar4 = *(ulonglong *)(*(longlong *)(param_1 + 0x20e0) + 0x160);
      uVar5 = *(ulonglong *)(*(longlong *)(param_1 + 0x20e0) + 0x168);
      puVar1 = (ulonglong *)(lVar7 + 0x10 + *param_2);
      uVar3 = *puVar1;
      bVar11 = uVar4 < uVar3;
      if ((uVar4 == uVar3) && (uVar3 = puVar1[1], bVar11 = uVar5 < uVar3, uVar5 == uVar3)) {
        iVar6 = 0;
      }
      else {
        iVar6 = (1 - (uint)bVar11) - (uint)(bVar11 != 0);
      }
      if (iVar6 == 0) {
        _Src = (undefined4 *)(lVar10 + *param_2);
        local_80 = *_Src;
        local_7c = _Src[1];
        local_78 = _Src[2];
        local_74 = _Src[3];
        memcpy(local_70,_Src,0x50);
        FUN_14020dc30(param_1 + 0x2218,&local_80,local_70,param_4,lVar13);
      }
      lVar7 = lVar7 + 0x50;
      lVar10 = lVar10 + 0x50;
      uVar8 = uVar8 - 1;
    } while (uVar8 != 0);
  }
  if (bVar12) {
    FUN_14034edd0(lVar9);
  }
  return;
}



void FUN_14020b1c0(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_14020dd20(param_1 + 0x2218,param_2);
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



ulonglong * FUN_14020b2a0(longlong param_1,ulonglong *param_2)

{
  int iVar1;
  ulonglong *puVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  uint uVar6;
  bool bVar7;
  bool bVar8;
  
  uVar3 = 0;
  uVar4 = 0;
  bVar8 = false;
  puVar2 = *(ulonglong **)(param_1 + 0x12e8);
  uVar5 = uVar3;
  if (puVar2 != (ulonglong *)0x0) {
    uVar5 = uVar4;
    if (puVar2 == *(ulonglong **)(param_1 + 0x12f0)) {
      if (*puVar2 != 0) {
        uVar5 = *puVar2;
        if ((puVar2 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, uVar5 = uVar3,
           DAT_1406080a8 = iVar1, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(uVar5);
        bVar8 = true;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  uVar6 = *(uint *)((longlong)param_2 + 0xc) ^ (uint)param_2[1] ^ *(uint *)((longlong)param_2 + 4) ^
          (uint)*param_2;
  if (*(longlong *)(param_1 + 0x2218) != 0) {
    for (puVar2 = *(ulonglong **)
                   (*(longlong *)(param_1 + 0x2218) +
                   ((ulonglong)uVar6 % (ulonglong)*(uint *)(param_1 + 0x2228)) * 8);
        puVar2 != (ulonglong *)0x0; puVar2 = (ulonglong *)puVar2[0xc]) {
      if ((uint)puVar2[0xd] == uVar6) {
        bVar7 = *puVar2 < *param_2;
        if ((*puVar2 != *param_2) ||
           (bVar7 = puVar2[1] < param_2[1], uVar4 = uVar3, puVar2[1] != param_2[1])) {
          uVar4 = (ulonglong)((1 - (uint)bVar7) - (uint)(bVar7 != 0));
        }
        if ((int)uVar4 == 0) {
          if (puVar2 != (ulonglong *)0x0) {
            if (puVar2 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (!bVar8) {
              return puVar2 + 2;
            }
            FUN_14034edd0(uVar5);
            return puVar2 + 2;
          }
          break;
        }
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(uVar5);
  }
  return (ulonglong *)0x0;
}



void FUN_14020b420(longlong param_1)

{
  ulonglong *puVar1;
  code *pcVar2;
  ulonglong uVar3;
  int iVar4;
  uint uVar5;
  longlong lVar7;
  undefined4 *puVar8;
  longlong *plVar9;
  undefined4 *puVar10;
  undefined4 *puVar11;
  undefined4 *puVar12;
  undefined4 *puVar13;
  bool bVar14;
  bool bVar15;
  undefined4 *local_b8;
  undefined4 *local_b0;
  undefined4 *local_a8;
  undefined4 *local_98;
  undefined1 local_90;
  undefined4 local_88;
  undefined4 uStack_84;
  undefined4 uStack_80;
  undefined4 uStack_7c;
  undefined4 local_78;
  undefined4 uStack_74;
  undefined4 uStack_70;
  undefined4 uStack_6c;
  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;
  undefined8 local_38;
  undefined4 *puVar6;
  
  local_38 = 0xfffffffffffffffe;
  puVar11 = (undefined4 *)0x0;
  puVar12 = (undefined4 *)0x0;
  local_98 = (undefined4 *)0x0;
  bVar15 = false;
  local_90 = 0;
  puVar1 = *(ulonglong **)(param_1 + 0x12e8);
  puVar13 = puVar11;
  if (puVar1 != (ulonglong *)0x0) {
    puVar13 = puVar12;
    if (puVar1 == *(ulonglong **)(param_1 + 0x12f0)) {
      if ((undefined4 *)*puVar1 != (undefined4 *)0x0) {
        puVar13 = (undefined4 *)*puVar1;
        if ((puVar1 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar15 = DAT_1406080a8 == 0, puVar13 = puVar11,
           DAT_1406080a8 = iVar4, bVar15)) {
          FUN_140176d60(1);
        }
        local_90 = 0;
        local_98 = puVar13;
        FUN_14034ed40(puVar13);
        bVar15 = true;
        local_90 = 1;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar14 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  local_b8 = (undefined4 *)0x0;
  local_b0 = (undefined4 *)0x0;
  local_a8 = (undefined4 *)0x0;
  if (*(longlong *)(param_1 + 0x2220) != 0) {
    puVar12 = puVar11;
    puVar10 = puVar11;
    if (*(uint *)(param_1 + 0x2228) != 0) {
      puVar6 = puVar11;
      plVar9 = *(longlong **)(param_1 + 0x2218);
      do {
        if (*plVar9 != 0) {
          puVar12 = (undefined4 *)(*(longlong **)(param_1 + 0x2218))[(longlong)puVar6];
          break;
        }
        uVar5 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar5;
        plVar9 = plVar9 + 1;
      } while (uVar5 < *(uint *)(param_1 + 0x2228));
    }
LAB_14020b541:
    puVar6 = puVar12;
    if (puVar6 != (undefined4 *)0x0) {
      local_88 = puVar6[4];
      uStack_84 = puVar6[5];
      uStack_80 = puVar6[6];
      uStack_7c = puVar6[7];
      local_78 = puVar6[8];
      uStack_74 = puVar6[9];
      uStack_70 = puVar6[10];
      uStack_6c = puVar6[0xb];
      local_68 = puVar6[0xc];
      uStack_64 = puVar6[0xd];
      uStack_60 = puVar6[0xe];
      uStack_5c = puVar6[0xf];
      local_58 = puVar6[0x10];
      uStack_54 = puVar6[0x11];
      uStack_50 = puVar6[0x12];
      uStack_4c = puVar6[0x13];
      local_48 = puVar6[0x14];
      uStack_44 = puVar6[0x15];
      uStack_40 = puVar6[0x16];
      uStack_3c = puVar6[0x17];
      if ((&local_88 < local_b0) && (puVar10 <= &local_88)) {
        lVar7 = (longlong)&local_88 - (longlong)puVar10;
        if (local_b0 == local_a8) {
          uVar3 = ((longlong)local_b0 - (longlong)puVar10) / 0x50;
          if (0x333333333333332 < uVar3) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          puVar8 = (undefined4 *)(uVar3 + 1);
          puVar12 = (undefined4 *)(((longlong)local_a8 - (longlong)puVar10) / 0x50);
          if (puVar12 < puVar8) {
            puVar10 = puVar11;
            if (puVar12 <= (undefined4 *)(0x333333333333333 - ((ulonglong)puVar12 >> 1))) {
              puVar10 = (undefined4 *)((longlong)puVar12 + ((ulonglong)puVar12 >> 1));
            }
            if (puVar10 < puVar8) {
              puVar10 = puVar8;
            }
            FUN_140053f90(&local_b8,puVar10);
            puVar10 = local_b8;
          }
        }
        if (local_b0 != (undefined4 *)0x0) {
          memcpy(local_b0,puVar10 + (lVar7 / 0x50) * 0x14,0x50);
          puVar10 = local_b8;
        }
      }
      else {
        if (local_b0 == local_a8) {
          uVar3 = ((longlong)local_b0 - (longlong)puVar10) / 0x50;
          if (0x333333333333332 < uVar3) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          puVar8 = (undefined4 *)(uVar3 + 1);
          puVar12 = (undefined4 *)(((longlong)local_a8 - (longlong)puVar10) / 0x50);
          if (puVar12 < puVar8) {
            puVar10 = puVar11;
            if (puVar12 <= (undefined4 *)(0x333333333333333 - ((ulonglong)puVar12 >> 1))) {
              puVar10 = (undefined4 *)((longlong)puVar12 + ((ulonglong)puVar12 >> 1));
            }
            if (puVar10 < puVar8) {
              puVar10 = puVar8;
            }
            FUN_140053f90(&local_b8,puVar10);
            puVar10 = local_b8;
          }
        }
        if (local_b0 != (undefined4 *)0x0) {
          *local_b0 = local_88;
          local_b0[1] = uStack_84;
          local_b0[2] = uStack_80;
          local_b0[3] = uStack_7c;
          local_b0[4] = local_78;
          local_b0[5] = uStack_74;
          local_b0[6] = uStack_70;
          local_b0[7] = uStack_6c;
          local_b0[8] = local_68;
          local_b0[9] = uStack_64;
          local_b0[10] = uStack_60;
          local_b0[0xb] = uStack_5c;
          local_b0[0xc] = local_58;
          local_b0[0xd] = uStack_54;
          local_b0[0xe] = uStack_50;
          local_b0[0xf] = uStack_4c;
          local_b0[0x10] = local_48;
          local_b0[0x11] = uStack_44;
          local_b0[0x12] = uStack_40;
          local_b0[0x13] = uStack_3c;
          puVar10 = local_b8;
        }
      }
      local_b0 = local_b0 + 0x14;
      if (0x32 < (ulonglong)(((longlong)local_b0 - (longlong)puVar10) / 0x50)) {
        lVar7 = *(longlong *)(param_1 + 0x20e0);
        if ((lVar7 != 0) && (*(longlong *)(lVar7 + 0xb50) != 0)) {
          plVar9 = (longlong *)(*(longlong *)(lVar7 + 0xb50) + 0x78);
          (**(code **)(*plVar9 + 0x920))(plVar9,*(undefined4 *)(lVar7 + 8),&DAT_1405d85a0,&local_b8)
          ;
          puVar10 = local_b8;
        }
        if (puVar10 != local_b0) {
          local_b0 = puVar10;
        }
      }
      puVar12 = *(undefined4 **)(puVar6 + 0x18);
      if (*(undefined4 **)(puVar6 + 0x18) == (undefined4 *)0x0) {
        uVar5 = (uint)puVar6[0x1a] % *(uint *)(param_1 + 0x2228) + 1;
        lVar7 = (longlong)(int)uVar5 << 3;
        puVar12 = puVar11;
        do {
          if (*(uint *)(param_1 + 0x2228) <= uVar5) break;
          if (*(longlong *)(*(longlong *)(param_1 + 0x2218) + lVar7) != 0) {
            puVar12 = *(undefined4 **)(*(longlong *)(param_1 + 0x2218) + lVar7);
          }
          uVar5 = uVar5 + 1;
          lVar7 = lVar7 + 8;
        } while (puVar12 == (undefined4 *)0x0);
      }
      goto LAB_14020b541;
    }
    lVar7 = (longlong)local_b0 - (longlong)puVar10 >> 0x3f;
    puVar11 = puVar10;
    if (((((longlong)local_b0 - (longlong)puVar10) / 0x50 + lVar7 != lVar7) &&
        (lVar7 = *(longlong *)(param_1 + 0x20e0), lVar7 != 0)) &&
       (*(longlong *)(lVar7 + 0xb50) != 0)) {
      plVar9 = (longlong *)(*(longlong *)(lVar7 + 0xb50) + 0x78);
      (**(code **)(*plVar9 + 0x920))(plVar9,*(undefined4 *)(lVar7 + 8),&DAT_1405d85a0,&local_b8);
      puVar11 = local_b8;
    }
  }
  if (puVar11 != (undefined4 *)0x0) {
    operator_delete(puVar11);
  }
  local_b8 = (undefined4 *)0x0;
  local_b0 = (undefined4 *)0x0;
  local_a8 = (undefined4 *)0x0;
  if (bVar15) {
    FUN_14034edd0(puVar13);
  }
  return;
}



undefined8 FUN_14020b8c0(longlong param_1,longlong param_2,longlong param_3)

{
  int *piVar1;
  uint uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  char cVar5;
  int iVar6;
  undefined4 uVar7;
  longlong *plVar8;
  size_t sVar9;
  longlong lVar10;
  longlong *plVar11;
  undefined8 uVar12;
  uint *puVar13;
  wchar_t *pwVar14;
  longlong lVar15;
  undefined8 *_Src;
  wchar_t *pwVar16;
  bool bVar17;
  float fVar18;
  float fVar19;
  undefined1 local_res20 [8];
  undefined8 in_stack_fffffffffffffd68;
  undefined4 uVar20;
  int local_1f8;
  int local_1f4;
  int local_1f0;
  int local_1ec;
  int local_1e8;
  int local_1e4;
  int local_1e0;
  undefined8 local_1d8;
  undefined8 *local_1c8;
  undefined8 *local_1c0;
  undefined8 *local_1b8;
  undefined8 local_1a8;
  undefined8 local_1a0;
  undefined8 local_198;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined8 local_184;
  undefined8 local_17c;
  undefined8 local_174;
  undefined8 local_16c;
  undefined8 local_158;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  undefined8 local_140;
  undefined8 local_138;
  undefined8 local_130;
  undefined8 local_128;
  undefined4 local_120;
  undefined1 local_11c;
  undefined8 local_11b;
  undefined2 local_113;
  undefined8 local_111;
  undefined8 local_109;
  undefined8 local_101;
  undefined8 local_f9;
  undefined8 local_f1;
  undefined4 local_e9;
  undefined4 local_e5;
  undefined1 local_e1;
  undefined8 local_e0;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined8 local_b8;
  longlong *local_a8;
  undefined1 local_a0 [8];
  longlong *local_98;
  undefined1 local_90 [8];
  longlong *local_88;
  undefined1 local_80 [8];
  longlong *local_78;
  
  uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffd68 >> 0x20);
  local_b8 = 0xfffffffffffffffe;
  cVar5 = FUN_14020c880();
  if (cVar5 == '\0') {
    return 0;
  }
  if (*(longlong *)(param_1 + 0x20e0) == 0) {
    return 0;
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) == 0) {
    return 0;
  }
  local_1d8 = 0;
  cVar5 = FUN_140195920(param_1 + 0x12e8);
  bVar17 = cVar5 != '\0';
  if (bVar17) {
    local_1d8 = FUN_140195970(param_1 + 0x12e8);
    FUN_14034ed40(local_1d8);
  }
  plVar8 = (longlong *)FUN_14020e690(DAT_140608068);
  uVar2 = *(uint *)(param_3 + 8);
  lVar10 = *(longlong *)*plVar8;
  if (lVar10 != 0) {
    for (puVar13 = *(uint **)(lVar10 + ((ulonglong)uVar2 %
                                       (ulonglong)*(uint *)((longlong *)*plVar8 + 2)) * 8);
        puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 6)) {
      if ((puVar13[8] == uVar2) && (*puVar13 == uVar2)) {
        if (puVar13 != (uint *)0x0) {
          if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          lVar10 = *(longlong *)(puVar13 + 2);
          goto LAB_14020b9d8;
        }
        break;
      }
    }
  }
  lVar10 = 0;
LAB_14020b9d8:
  if (local_a8 != (longlong *)0x0) {
    LOCK();
    plVar8 = local_a8 + 1;
    lVar15 = *plVar8;
    *(int *)plVar8 = (int)*plVar8 + -1;
    UNLOCK();
    if ((int)lVar15 == 1) {
      (**(code **)(*local_a8 + 8))(local_a8);
      LOCK();
      piVar1 = (int *)((longlong)local_a8 + 0xc);
      iVar6 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (iVar6 == 1) {
        (**(code **)(*local_a8 + 0x10))(local_a8);
      }
    }
  }
  if (lVar10 == 0) {
LAB_14020c0b8:
    if (bVar17) {
      FUN_14034edd0(local_1d8);
    }
    return 0;
  }
  local_1f0 = *(int *)(param_2 + 0xb0);
  fVar18 = *(float *)(param_2 + 0xd4);
  fVar19 = *(float *)(param_2 + 0xd8);
  local_1e0 = 1;
  if (0 < *(int *)(param_2 + 0xa4)) {
    local_1e0 = *(int *)(param_2 + 0xa4);
  }
  local_1e8 = 1;
  if (0 < *(int *)(param_2 + 0xa8)) {
    local_1e8 = *(int *)(param_2 + 0xa8);
  }
  local_1e4 = 1;
  if (0 < *(int *)(param_2 + 0xac)) {
    local_1e4 = *(int *)(param_2 + 0xac);
  }
  local_1ec = 1;
  if (0 < *(int *)(param_2 + 0xb8)) {
    local_1ec = *(int *)(param_2 + 0xb8);
  }
  local_1f4 = 1;
  if (0 < *(int *)(param_2 + 0xbc)) {
    local_1f4 = *(int *)(param_2 + 0xbc);
  }
  local_1f8 = 1;
  if (0 < *(int *)(param_2 + 0xb4)) {
    local_1f8 = *(int *)(param_2 + 0xb4);
  }
  pwVar16 = (wchar_t *)(param_2 + 0x48);
  pwVar14 = pwVar16;
  if (7 < *(ulonglong *)(param_2 + 0x60)) {
    pwVar14 = *(wchar_t **)pwVar16;
  }
  sVar9 = wcsnlen(pwVar14,0x10);
  if (0xf < sVar9) goto LAB_14020c0b8;
  pwVar14 = pwVar16;
  if (7 < *(ulonglong *)(param_2 + 0x60)) {
    pwVar14 = *(wchar_t **)pwVar16;
  }
  uVar12 = CONCAT44(uVar20,local_1e8);
  plVar8 = (longlong *)
           FUN_140207f20(param_1,*(undefined4 *)(param_3 + 4),pwVar14,local_1e0,uVar12,local_1e4,
                         local_1ec,local_1f4,local_1f8,local_1f0,fVar18,fVar19,0);
  uVar20 = (undefined4)((ulonglong)uVar12 >> 0x20);
  if (plVar8 == (longlong *)0x0) goto LAB_14020c0b8;
  lVar10 = (**(code **)(*plVar8 + 0x280))(plVar8);
  if (1 < *(int *)(param_3 + 0xc)) {
    plVar11 = (longlong *)FUN_1401e0340(plVar8,local_a0);
    lVar15 = *plVar11;
    if (local_98 != (longlong *)0x0) {
      LOCK();
      plVar11 = local_98 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      if ((int)*plVar11 == 0) {
        (**(code **)(*local_98 + 8))(local_98);
        LOCK();
        piVar1 = (int *)((longlong)local_98 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_98 + 0x10))(local_98);
        }
      }
    }
    if (lVar15 != 0) {
      plVar11 = (longlong *)FUN_1401e0340(plVar8,local_80);
      iVar6 = *(int *)(param_3 + 0xc);
      if ((iVar6 < 1) || (*(int *)(*plVar11 + 0x38) <= iVar6)) {
        lVar15 = 0;
      }
      else {
        lVar15 = (longlong)(iVar6 + -1) * 0x80 + *(longlong *)(*plVar11 + 0x40);
      }
      if (local_78 != (longlong *)0x0) {
        LOCK();
        plVar11 = local_78 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          (**(code **)(*local_78 + 8))(local_78);
          LOCK();
          piVar1 = (int *)((longlong)local_78 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_78 + 0x10))(local_78);
          }
        }
      }
      if (lVar15 != 0) {
        local_1e0 = local_1e0 + *(int *)(lVar15 + 0x5c);
        local_1e8 = local_1e8 + *(int *)(lVar15 + 0x60);
        local_1e4 = local_1e4 + *(int *)(lVar15 + 100);
        local_1ec = local_1ec + *(int *)(lVar15 + 0x68);
        local_1f4 = local_1f4 + *(int *)(lVar15 + 0x6c);
        local_1f8 = local_1f8 + *(int *)(lVar15 + 0x70);
        local_1f0 = local_1f0 + *(int *)(lVar15 + 0x74);
        fVar18 = fVar18 + *(float *)(lVar15 + 0x78);
        fVar19 = fVar19 + *(float *)(lVar15 + 0x7c);
        *(int *)(lVar10 + 0x84) = local_1e0;
        *(int *)(lVar10 + 0x88) = local_1e8;
        *(int *)(lVar10 + 0x8c) = local_1e4;
        *(int *)(lVar10 + 0x90) = local_1ec;
        *(int *)(lVar10 + 0x94) = local_1f4;
        *(int *)(lVar10 + 0x98) = local_1f8;
        *(int *)(lVar10 + 0x9c) = local_1f0;
        *(float *)(lVar10 + 0xa0) = fVar18;
        *(float *)(lVar10 + 0xa4) = fVar19;
        FUN_1402f81e0(plVar8,*(undefined4 *)(param_3 + 0xc));
        plVar11 = (longlong *)FUN_1401e0340(plVar8,local_90);
        iVar6 = *(int *)(param_3 + 0xc) + -1;
        if (iVar6 < 1) {
          uVar12 = 0;
        }
        else if (iVar6 < *(int *)(*plVar11 + 0x38)) {
          uVar12 = *(undefined8 *)((longlong)iVar6 * 0x80 + -0x78 + *(longlong *)(*plVar11 + 0x40));
        }
        else {
          uVar12 = 0xffffffffffffffff;
        }
        *(undefined8 *)(lVar10 + 0x50) = uVar12;
        if (local_88 != (longlong *)0x0) {
          LOCK();
          plVar11 = local_88 + 1;
          *(int *)plVar11 = (int)*plVar11 + -1;
          UNLOCK();
          if ((int)*plVar11 == 0) {
            (**(code **)(*local_88 + 8))(local_88);
            LOCK();
            piVar1 = (int *)((longlong)local_88 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*local_88 + 0x10))(local_88);
            }
          }
        }
      }
    }
  }
  uVar3 = *(undefined4 *)(plVar8[0x26] + 0x274);
  *(short *)(lVar10 + 0x68) = (short)uVar3;
  if (*(longlong *)(param_1 + 0x20e0) != 0) {
    uVar4 = *(undefined4 *)(lVar10 + 0x78);
    uVar12 = *(undefined8 *)(lVar10 + 0x50);
    if (7 < *(ulonglong *)(param_2 + 0x60)) {
      pwVar16 = *(wchar_t **)pwVar16;
    }
    lVar10 = plVar8[0x24];
    uVar7 = FUN_1402f8580(plVar8);
    FUN_1401abf50(*(undefined8 *)(param_1 + 0x20e0),plVar8 + 0x1f6,(int)lVar10,pwVar16,
                  CONCAT44(uVar20,uVar3),local_1e0,local_1e8,local_1e4,local_1ec,local_1f4,local_1f8
                  ,local_1f0,fVar18,fVar19,0,0,0,0,0,0,0,uVar7,uVar12,uVar4);
    local_1a8 = 0;
    local_1a0 = 0;
    local_198 = 0;
    local_190 = 0;
    local_18c = 0;
    local_188 = 0;
    local_184 = 0;
    local_17c = 0;
    local_174 = 0;
    local_16c = 0;
    lVar10 = *(longlong *)(param_1 + 0x20e0);
    if (lVar10 != 0) {
      FUN_140203e10(*(undefined8 *)(lVar10 + 0xb50),0x1f5,lVar10,plVar8,&local_1a8);
    }
    cVar5 = FUN_1401b5230(*(undefined8 *)(param_1 + 0x20e0),(int)plVar8[0x25],uVar3);
    if (cVar5 == '\0') {
      if (!bVar17) {
        return 1;
      }
      FUN_14034edd0(local_1d8);
      return 1;
    }
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) == 0) goto LAB_14020c0a1;
  local_158 = 0;
  local_150 = 0;
  local_14c = 0;
  local_148 = 0;
  local_144 = 0;
  local_120 = 0;
  local_11c = 0;
  local_11b = 0;
  local_113 = 0;
  local_111 = 0;
  local_109 = 0;
  local_101 = 0;
  local_f9 = 0;
  local_f1 = 0;
  local_e9 = 0;
  local_e5 = 0;
  local_e1 = 0;
  local_e0 = 0;
  local_d8 = 0;
  local_d4 = 0;
  local_d0 = 0;
  local_cc = 0;
  local_c8 = 0;
  local_140 = 0;
  local_138 = 0;
  local_130 = 0;
  local_128 = 0;
  FUN_14020c710(param_1,&local_158,plVar8);
  local_1c8 = (undefined8 *)0x0;
  local_1c0 = (undefined8 *)0x0;
  local_1b8 = (undefined8 *)0x0;
  FUN_1401dec50(&local_1c8);
  if ((&local_158 < local_1c0) && (local_1c8 <= &local_158)) {
    lVar10 = (longlong)&local_158 - (longlong)local_1c8;
    if (local_1c0 == local_1b8) {
      FUN_1400d55e0(&local_1c8,1);
    }
    _Src = (undefined8 *)((lVar10 / 0x94) * 0x94 + (longlong)local_1c8);
    if (local_1c0 != (undefined8 *)0x0) {
LAB_14020c034:
      memcpy(local_1c0,_Src,0x94);
    }
  }
  else {
    if (local_1c0 == local_1b8) {
      FUN_1400d55e0(&local_1c8,1);
    }
    if (local_1c0 != (undefined8 *)0x0) {
      _Src = &local_158;
      goto LAB_14020c034;
    }
  }
  local_1c0 = (undefined8 *)((longlong)local_1c0 + 0x94);
  local_res20[0] = 0;
  plVar8 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x380);
  (**(code **)(*plVar8 + 0x550))
            (plVar8,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),&DAT_1405d85a0,&local_1c8,
             local_res20);
  if (local_1c8 != (undefined8 *)0x0) {
    operator_delete(local_1c8);
  }
LAB_14020c0a1:
  if (!bVar17) {
    return 1;
  }
  FUN_14034edd0(local_1d8);
  return 1;
}



undefined8 FUN_14020c100(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  longlong lVar5;
  uint uVar6;
  char cVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  undefined4 uVar10;
  undefined4 uVar11;
  undefined8 uVar12;
  wchar_t *pwVar13;
  size_t sVar14;
  undefined8 uVar15;
  longlong *plVar16;
  longlong lVar17;
  wchar_t *pwVar18;
  longlong lVar19;
  undefined8 *_Src;
  bool bVar20;
  uint local_res20 [2];
  undefined8 in_stack_fffffffffffffd88;
  undefined4 uVar21;
  undefined8 *local_1d0;
  undefined8 *local_1c8;
  undefined8 *local_1c0;
  undefined4 local_1b0;
  undefined8 local_1a8;
  undefined1 local_1a0;
  undefined8 local_198;
  undefined8 local_190;
  undefined8 local_188;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined8 local_174;
  undefined8 local_16c;
  undefined8 local_164;
  undefined8 local_15c;
  undefined8 local_148;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  undefined8 local_130;
  undefined8 local_128;
  undefined8 local_120;
  undefined8 local_118;
  undefined4 local_110;
  undefined1 local_10c;
  undefined8 local_10b;
  undefined2 local_103;
  undefined8 local_101;
  undefined8 local_f9;
  undefined8 local_f1;
  undefined8 local_e9;
  undefined8 local_e1;
  undefined4 local_d9;
  undefined4 local_d5;
  undefined1 local_d1;
  undefined8 local_d0;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined8 local_a8;
  undefined8 local_a0;
  
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffd88 >> 0x20);
  local_a0 = 0xfffffffffffffffe;
  cVar7 = FUN_14020c880();
  if (cVar7 == '\0') {
    return 0;
  }
  if (*(longlong *)(param_1 + 0x20e0) == 0) {
    return 0;
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) == 0) {
    return 0;
  }
  uVar12 = 0;
  local_1a8 = 0;
  local_1a0 = 0;
  cVar7 = FUN_140195920(param_1 + 0x12e8);
  bVar20 = cVar7 != '\0';
  if (bVar20) {
    uVar12 = FUN_140195970(param_1 + 0x12e8);
    local_1a0 = 0;
    local_1a8 = uVar12;
    FUN_14034ed40(uVar12);
    local_1a0 = 1;
  }
  pwVar13 = (wchar_t *)FUN_1402f38a0(DAT_140608068,param_2);
  if (((pwVar13 == (wchar_t *)0x0) || (lVar19 = *(longlong *)(pwVar13 + 0x498), lVar19 == 0)) ||
     (cVar7 = FUN_14020d650(param_1,(int)*(short *)(lVar19 + 0x268)), cVar7 == '\0')) {
LAB_14020c1dc:
    if (bVar20) {
      FUN_14034edd0(uVar12);
    }
    return 0;
  }
  pwVar18 = pwVar13;
  if (7 < *(ulonglong *)(pwVar13 + 0xc)) {
    pwVar18 = *(wchar_t **)pwVar13;
  }
  sVar14 = wcsnlen(pwVar18,0x10);
  if (0xf < sVar14) goto LAB_14020c1dc;
  uVar15 = FUN_1401e0840();
  uVar8 = FUN_1401e2340(uVar15,param_3);
  pwVar18 = pwVar13;
  if (7 < *(ulonglong *)(pwVar13 + 0xc)) {
    pwVar18 = *(wchar_t **)pwVar13;
  }
  uVar15 = CONCAT44(uVar21,*(undefined4 *)(lVar19 + 0x50));
  plVar16 = (longlong *)
            FUN_140207f20(param_1,param_2,pwVar18,*(undefined4 *)(lVar19 + 0x4c),uVar15,
                          *(undefined4 *)(lVar19 + 0x54),*(undefined4 *)(lVar19 + 0x58),
                          *(undefined4 *)(lVar19 + 0x5c),*(undefined4 *)(lVar19 + 0x60),
                          *(undefined4 *)(lVar19 + 100),*(undefined4 *)(lVar19 + 0x68),
                          *(undefined4 *)(lVar19 + 0x6c),uVar8);
  uVar21 = (undefined4)((ulonglong)uVar15 >> 0x20);
  if (plVar16 == (longlong *)0x0) goto LAB_14020c1dc;
  local_res20[0] = *(uint *)(plVar16[0x26] + 0x274);
  lVar17 = (**(code **)(*plVar16 + 0x280))(plVar16);
  *(short *)(lVar17 + 0x68) = (short)local_res20[0];
  if (*(longlong *)(param_1 + 0x20e0) != 0) {
    local_1b0 = *(undefined4 *)(lVar17 + 0x78);
    local_a8 = *(undefined8 *)(lVar17 + 0x50);
    uVar8 = *(undefined4 *)(lVar17 + 0xc0);
    uVar1 = *(undefined4 *)(lVar17 + 0xbc);
    uVar2 = *(undefined4 *)(lVar17 + 0xb8);
    uVar3 = *(undefined4 *)(lVar17 + 0xb4);
    uVar4 = *(undefined4 *)(lVar17 + 0xb0);
    if (7 < *(ulonglong *)(pwVar13 + 0xc)) {
      pwVar13 = *(wchar_t **)pwVar13;
    }
    lVar5 = plVar16[0x24];
    uVar9 = FUN_1402f8580(plVar16);
    uVar10 = FUN_1402e53a0(lVar17);
    uVar11 = FUN_1402e5360();
    uVar6 = local_res20[0];
    FUN_1401abf50(*(undefined8 *)(param_1 + 0x20e0),plVar16 + 0x1f6,(int)lVar5,pwVar13,
                  CONCAT44(uVar21,local_res20[0]),*(undefined4 *)(lVar19 + 0x4c),
                  *(undefined4 *)(lVar19 + 0x50),*(undefined4 *)(lVar19 + 0x54),
                  *(undefined4 *)(lVar19 + 0x58),*(undefined4 *)(lVar19 + 0x5c),
                  *(undefined4 *)(lVar19 + 0x60),*(undefined4 *)(lVar19 + 100),
                  *(undefined4 *)(lVar19 + 0x68),*(undefined4 *)(lVar19 + 0x6c),uVar11,uVar10,uVar4,
                  uVar3,uVar2,uVar1,uVar8,uVar9,local_a8,local_1b0);
    local_198 = 0;
    local_190 = 0;
    local_188 = 0;
    local_180 = 0;
    local_17c = 0;
    local_178 = 0;
    local_174 = 0;
    local_16c = 0;
    local_164 = 0;
    local_15c = 0;
    lVar19 = *(longlong *)(param_1 + 0x20e0);
    if (lVar19 != 0) {
      FUN_140203e10(*(undefined8 *)(lVar19 + 0xb50),0x1f5,lVar19,plVar16,&local_198);
    }
    cVar7 = FUN_1401b5230(*(undefined8 *)(param_1 + 0x20e0),(int)plVar16[0x25],uVar6);
    if (cVar7 == '\0') goto LAB_14020c4bc;
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) == 0) goto LAB_14020c4bc;
  local_148 = 0;
  local_140 = 0;
  local_13c = 0;
  local_138 = 0;
  local_134 = 0;
  local_110 = 0;
  local_10c = 0;
  local_10b = 0;
  local_103 = 0;
  local_101 = 0;
  local_f9 = 0;
  local_f1 = 0;
  local_e9 = 0;
  local_e1 = 0;
  local_d9 = 0;
  local_d5 = 0;
  local_d1 = 0;
  local_d0 = 0;
  local_c8 = 0;
  local_c4 = 0;
  local_c0 = 0;
  local_bc = 0;
  local_b8 = 0;
  local_130 = 0;
  local_128 = 0;
  local_120 = 0;
  local_118 = 0;
  FUN_14020c710(param_1,&local_148,plVar16);
  local_1d0 = (undefined8 *)0x0;
  local_1c8 = (undefined8 *)0x0;
  local_1c0 = (undefined8 *)0x0;
  FUN_1401dec50(&local_1d0);
  if ((&local_148 < local_1c8) && (local_1d0 <= &local_148)) {
    lVar19 = (longlong)&local_148 - (longlong)local_1d0;
    if (local_1c8 == local_1c0) {
      FUN_1400d55e0(&local_1d0,1);
    }
    _Src = (undefined8 *)((lVar19 / 0x94) * 0x94 + (longlong)local_1d0);
    if (local_1c8 != (undefined8 *)0x0) {
LAB_14020c65b:
      memcpy(local_1c8,_Src,0x94);
    }
  }
  else {
    if (local_1c8 == local_1c0) {
      FUN_1400d55e0(&local_1d0,1);
    }
    if (local_1c8 != (undefined8 *)0x0) {
      _Src = &local_148;
      goto LAB_14020c65b;
    }
  }
  local_1c8 = (undefined8 *)((longlong)local_1c8 + 0x94);
  local_res20[0] = local_res20[0] & 0xffffff00;
  plVar16 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x380);
  (**(code **)(*plVar16 + 0x550))
            (plVar16,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),&DAT_1405d85a0,&local_1d0,
             local_res20);
  if (local_1d0 != (undefined8 *)0x0) {
    operator_delete(local_1d0);
  }
LAB_14020c4bc:
  if (bVar20) {
    FUN_14034edd0(uVar12);
  }
  return 1;
}



void FUN_14020c710(longlong param_1,undefined4 *param_2,longlong *param_3)

{
  undefined1 uVar1;
  longlong lVar2;
  wchar_t *_Src;
  
  lVar2 = (**(code **)(*param_3 + 0x280))(param_3);
  _Src = (wchar_t *)(param_3 + 0x1a);
  *param_2 = *(undefined4 *)(param_1 + 0x128);
  param_2[1] = (int)param_3[0x25];
  *(longlong *)(param_2 + 2) = param_3[0x1f6];
  *(longlong *)(param_2 + 4) = param_3[0x1f7];
  if (7 < (ulonglong)param_3[0x1d]) {
    _Src = *(wchar_t **)_Src;
  }
  wcscpy_s((wchar_t *)(param_2 + 6),0x10,_Src);
  param_2[0xe] = (int)param_3[0x24];
  uVar1 = FUN_1402f8580(param_3);
  *(undefined1 *)(param_2 + 0xf) = uVar1;
  *(undefined8 *)((longlong)param_2 + 0x3d) = *(undefined8 *)(lVar2 + 0x50);
  *(undefined2 *)((longlong)param_2 + 0x45) = *(undefined2 *)(lVar2 + 0x68);
  *(undefined8 *)((longlong)param_2 + 0x47) = *(undefined8 *)(lVar2 + 0x70);
  *(undefined4 *)((longlong)param_2 + 0x4f) = *(undefined4 *)(lVar2 + 0x78);
  *(undefined4 *)((longlong)param_2 + 0x53) = *(undefined4 *)(lVar2 + 0x84);
  *(undefined4 *)((longlong)param_2 + 0x57) = *(undefined4 *)(lVar2 + 0x88);
  *(undefined4 *)((longlong)param_2 + 0x5b) = *(undefined4 *)(lVar2 + 0x8c);
  *(undefined4 *)((longlong)param_2 + 0x5f) = *(undefined4 *)(lVar2 + 0x90);
  *(undefined4 *)((longlong)param_2 + 99) = *(undefined4 *)(lVar2 + 0x94);
  *(undefined4 *)((longlong)param_2 + 0x67) = *(undefined4 *)(lVar2 + 0x98);
  *(undefined4 *)((longlong)param_2 + 0x6b) = *(undefined4 *)(lVar2 + 0x9c);
  *(undefined4 *)((longlong)param_2 + 0x6f) = *(undefined4 *)(lVar2 + 0xa0);
  *(undefined4 *)((longlong)param_2 + 0x73) = *(undefined4 *)(lVar2 + 0xa4);
  *(undefined1 *)((longlong)param_2 + 0x77) = *(undefined1 *)(lVar2 + 0x80);
  param_2[0x1e] = *(undefined4 *)(lVar2 + 0xa8);
  param_2[0x1f] = *(undefined4 *)(lVar2 + 0xac);
  param_2[0x20] = *(undefined4 *)(lVar2 + 0xb0);
  param_2[0x21] = *(undefined4 *)(lVar2 + 0xb4);
  param_2[0x22] = *(undefined4 *)(lVar2 + 0xb8);
  param_2[0x23] = *(undefined4 *)(lVar2 + 0xbc);
  param_2[0x24] = *(undefined4 *)(lVar2 + 0xc0);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014020ca0b)

ulonglong FUN_14020c880(longlong param_1)

{
  longlong lVar1;
  uint uVar2;
  longlong *plVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong lVar8;
  int iVar9;
  bool bVar10;
  bool bVar11;
  
  lVar8 = 0;
  bVar11 = false;
  plVar3 = *(longlong **)(param_1 + 0x12e8);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar3;
      lVar8 = 0;
      if (lVar5 != 0) {
        if (plVar3 != *(longlong **)(param_1 + 0x12f0)) {
          uVar2 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = uVar2;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        plVar3 = (longlong *)FUN_14034ed40(lVar5);
        bVar11 = true;
        lVar8 = lVar5;
      }
    }
    else {
      uVar2 = DAT_1406080a8 + 1;
      plVar3 = (longlong *)(ulonglong)uVar2;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = uVar2;
      if (bVar10) {
        plVar3 = (longlong *)FUN_140176d60(1);
      }
    }
  }
  if (*(ulonglong *)(param_1 + 0x2178) < 0x14) {
    iVar9 = 0;
    if (*(longlong *)(param_1 + 0x2178) != 0) {
      uVar4 = 0;
      if (*(uint *)(param_1 + 0x2180) != 0) {
        plVar3 = *(longlong **)(param_1 + 0x2170);
        plVar7 = plVar3;
        do {
          if (*plVar7 != 0) {
            lVar5 = plVar3[uVar4];
            goto LAB_14020c9a8;
          }
          uVar2 = (int)uVar4 + 1;
          uVar4 = (ulonglong)uVar2;
          plVar7 = plVar7 + 1;
        } while (uVar2 < *(uint *)(param_1 + 0x2180));
      }
    }
    lVar5 = 0;
LAB_14020c9a8:
    lVar6 = lVar5;
    if (lVar6 != 0) {
      lVar5 = (**(code **)(**(longlong **)(lVar6 + 8) + 0x280))();
      if (*(char *)(lVar5 + 0x80) != '\x01') {
        iVar9 = iVar9 + 1;
      }
      lVar5 = *(longlong *)(lVar6 + 0x18);
      if (lVar5 == 0) {
        uVar2 = *(uint *)(lVar6 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
        lVar6 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(param_1 + 0x2180) <= uVar2) break;
          lVar1 = *(longlong *)(param_1 + 0x2170);
          if (*(longlong *)(lVar6 + lVar1) != 0) {
            lVar5 = *(longlong *)(lVar6 + lVar1);
          }
          uVar2 = uVar2 + 1;
          lVar6 = lVar6 + 8;
        } while (lVar5 == 0);
      }
      goto LAB_14020c9a8;
    }
    if (bVar11) {
      FUN_14034edd0(lVar8);
    }
    uVar4 = (ulonglong)(iVar9 < 0xc);
  }
  else {
    if (bVar11) {
      plVar3 = (longlong *)FUN_14034edd0(lVar8);
    }
    uVar4 = (ulonglong)plVar3 & 0xffffffffffffff00;
  }
  return uVar4;
}



// WARNING: Removing unreachable block (ram,0x00014020cc9b)

void FUN_14020ca50(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  size_t sVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *_Src;
  wchar_t *_Src_00;
  longlong lVar10;
  bool bVar11;
  bool bVar12;
  wchar_t local_4f [19];
  
  lVar10 = 0;
  bVar12 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar6 = *plVar1;
      lVar10 = 0;
      if (lVar6 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar12 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar12) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        FUN_14034ed40(lVar6);
        bVar12 = true;
        lVar10 = lVar6;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2178) != 0) {
    uVar5 = 0;
    if (*(uint *)(param_1 + 0x2180) != 0) {
      plVar1 = *(longlong **)(param_1 + 0x2170);
      plVar9 = plVar1;
      do {
        if (*plVar9 != 0) {
          lVar6 = plVar1[uVar5];
          goto LAB_14020cb63;
        }
        uVar4 = (int)uVar5 + 1;
        uVar5 = (ulonglong)uVar4;
        plVar9 = plVar9 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0x2180));
    }
  }
  lVar6 = 0;
LAB_14020cb63:
  do {
    do {
      lVar8 = lVar6;
      if (lVar8 == 0) {
        if (bVar12) {
          FUN_14034edd0(lVar10);
        }
        return;
      }
      plVar1 = *(longlong **)(lVar8 + 8);
      if (((plVar1 != (longlong *)0x0) &&
          (lVar6 = (**(code **)(*plVar1 + 0x280))(plVar1), *(char *)(lVar6 + 0x80) == '\x01')) &&
         ((char)plVar1[0x30d] == '\0')) {
        local_4f[0] = L'\0';
        local_4f[1] = L'\0';
        local_4f[2] = L'\0';
        local_4f[3] = L'\0';
        local_4f[4] = L'\0';
        local_4f[5] = L'\0';
        local_4f[6] = L'\0';
        local_4f[7] = L'\0';
        local_4f[8] = L'\0';
        local_4f[9] = L'\0';
        local_4f[10] = L'\0';
        local_4f[0xb] = L'\0';
        local_4f[0xc] = L'\0';
        local_4f[0xd] = L'\0';
        local_4f[0xe] = L'\0';
        local_4f[0xf] = L'\0';
        FUN_1402f8580(plVar1);
        _Src_00 = (wchar_t *)(plVar1 + 0x1a);
        _Src = _Src_00;
        if (7 < (ulonglong)plVar1[0x1d]) {
          _Src = *(wchar_t **)_Src_00;
        }
        sVar7 = wcsnlen(_Src,0x10);
        if (sVar7 < 0x10) {
          if (7 < (ulonglong)plVar1[0x1d]) {
            _Src_00 = *(wchar_t **)_Src_00;
          }
          wcscpy_s(local_4f,0x10,_Src_00);
          FUN_1400d5470(param_2);
        }
      }
      lVar6 = *(longlong *)(lVar8 + 0x18);
    } while (lVar6 != 0);
    uVar4 = *(uint *)(lVar8 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
    lVar8 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(param_1 + 0x2180) <= uVar4) break;
      lVar2 = *(longlong *)(param_1 + 0x2170);
      if (*(longlong *)(lVar8 + lVar2) != 0) {
        lVar6 = *(longlong *)(lVar8 + lVar2);
      }
      uVar4 = uVar4 + 1;
      lVar8 = lVar8 + 8;
    } while (lVar6 == 0);
  } while( true );
}



undefined4 FUN_14020cce0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined4 local_res10 [2];
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  local_res10[0] = 0;
  if (param_2 != 0) {
    local_res10[0] = 0;
    lVar3 = 0;
    lVar9 = 0;
    bVar7 = false;
    uVar10 = 0;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar5 = lVar3;
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
        lVar4 = *plVar1;
        lVar5 = 0;
        if (lVar4 != 0) {
          if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
             DAT_1406080a8 = iVar2, bVar7)) {
            FUN_140176d60(1);
          }
          lVar9 = lVar4;
          FUN_14034ed40(lVar4);
          bVar7 = true;
          uVar10 = 1;
          lVar5 = lVar4;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar6 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    FUN_1402094c0(param_2,param_1 + 0x1f08,local_res10,param_4,uVar8,lVar9,uVar10);
    FUN_1402094c0(param_2,param_1 + 0x1f28,local_res10);
    FUN_1402094c0(param_2,param_1 + 0x1f48,local_res10);
    FUN_1402094c0(param_2,param_1 + 0x1fa8,local_res10);
    FUN_1402094c0(param_2,param_1 + 0x1f68,local_res10);
    FUN_1402094c0(param_2,param_1 + 0x1fc8,local_res10);
    if (bVar7) {
      FUN_14034edd0(lVar5);
    }
    lVar5 = param_1 + 0x12f8;
    lVar9 = lVar5;
    FUN_14034ed40(lVar5);
    FUN_1402094c0(param_2,param_1 + 0x1fe8,local_res10,param_4,uVar8,lVar9,1);
    FUN_14034edd0(lVar5);
  }
  return local_res10[0];
}



void FUN_14020ce70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4,
                  undefined1 param_5,undefined1 param_6)

{
  longlong *plVar1;
  undefined8 *puVar2;
  void *pvVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong *plVar7;
  bool bVar8;
  longlong *local_20;
  longlong *local_18;
  
  puVar2 = (undefined8 *)param_1[0x391];
  if (puVar2 == (undefined8 *)0x0) {
LAB_14020ced6:
    uVar5 = 0;
  }
  else {
    if (puVar2 != (undefined8 *)param_1[0x392]) {
      iVar4 = DAT_140608150 + 1;
      bVar8 = DAT_140608150 == 0;
      DAT_140608150 = iVar4;
      if (bVar8) {
        FUN_140176d60(CONCAT71((int7)((ulonglong)puVar2 >> 8),1));
      }
      goto LAB_14020ced6;
    }
    uVar5 = *puVar2;
  }
  FUN_140278700(uVar5,&local_20,param_2,param_3,param_4,param_5,param_6);
  plVar7 = local_20;
  if (local_20 == (longlong *)0x0) goto LAB_14020cfa8;
  if (local_20 != local_18) {
    iVar4 = DAT_140608154 + 1;
    bVar8 = DAT_140608154 == 0;
    DAT_140608154 = iVar4;
    if (bVar8) {
      FUN_140176d60(1);
      plVar7 = local_20;
    }
    goto LAB_14020cfa8;
  }
  if (*local_20 == 0) goto LAB_14020cfa8;
  (**(code **)(*param_1 + 0x298))(param_1);
  if (local_20 == (longlong *)0x0) {
LAB_14020cf8d:
    lVar6 = 0;
  }
  else {
    if (local_20 != local_18) {
      iVar4 = DAT_140608154 + 1;
      bVar8 = DAT_140608154 == 0;
      DAT_140608154 = iVar4;
      if (bVar8) {
        FUN_140176d60();
      }
      goto LAB_14020cf8d;
    }
    lVar6 = *local_20;
  }
  (**(code **)(*param_1 + 0x2a0))(param_1,-*(int *)(lVar6 + 0xd0));
  plVar7 = local_20;
LAB_14020cfa8:
  if (plVar7 != (longlong *)0x0) {
    if (plVar7 == local_18) {
      if (plVar7 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar7 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          local_20 = (longlong *)0x0;
          pvVar3 = (void *)*plVar7;
          if (pvVar3 != (void *)0x0) {
            FUN_140197310(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(plVar7);
        }
      }
    }
    else {
      iVar4 = DAT_1406080b4 + 1;
      bVar8 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



void FUN_14020d020(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = FUN_1402d6230();
  if (lVar1 != 0) {
    FUN_14020d0d0(param_1,lVar1);
    (**(code **)(*param_1 + 0x290))(param_1);
    (**(code **)(*param_1 + 0x2a0))(param_1,-*(int *)(lVar1 + 0x80));
    if (*(float *)(lVar1 + 0x3b0) <= 1e-06 && *(float *)(lVar1 + 0x3b0) != 1e-06) {
      (**(code **)(*param_1 + 0x290))(param_1);
      (**(code **)(*param_1 + 0x298))(param_1);
    }
  }
  return;
}



void FUN_14020d0d0(longlong *param_1,longlong param_2)

{
  float fVar1;
  
  fVar1 = 0.0;
  if (*(int *)(param_2 + 0x30) != 0) {
    fVar1 = (float)FUN_14020cce0();
    fVar1 = fVar1 + 0.0;
  }
  fVar1 = *(float *)(param_2 + 0x84) - *(float *)(param_2 + 0x84) * fVar1;
  if (fVar1 < 0.0) {
    fVar1 = 0.0;
  }
                    // WARNING: Could not recover jumptable at 0x00014020d16c. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x298))
            (param_1,-((1.0 - ((float)(int)param_1[0x10b] / 10000.0 +
                              *(float *)((longlong)param_1 + 0x754))) *
                      (fVar1 - (float)(int)param_1[200])));
  return;
}



undefined4 FUN_14020d180(longlong param_1,ulonglong *param_2)

{
  int *piVar1;
  longlong *plVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  ulonglong uVar6;
  longlong lVar7;
  longlong lVar8;
  longlong *plVar9;
  bool bVar10;
  bool bVar11;
  longlong local_50;
  
  local_50 = 0;
  bVar11 = false;
  plVar9 = *(longlong **)(param_1 + 0x12e8);
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == *(longlong **)(param_1 + 0x12f0)) {
      lVar8 = *plVar9;
      if (lVar8 != 0) {
        if (plVar9 != *(longlong **)(param_1 + 0x12f0)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar11) {
            FUN_140176d60();
          }
          lVar8 = 0;
        }
        FUN_14034ed40();
        bVar11 = true;
        local_50 = lVar8;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2178) != 0) {
    uVar6 = 0;
    if (*(uint *)(param_1 + 0x2180) != 0) {
      plVar9 = *(longlong **)(param_1 + 0x2170);
      do {
        if (*plVar9 != 0) {
          lVar8 = (*(longlong **)(param_1 + 0x2170))[uVar6];
          goto LAB_14020d270;
        }
        uVar4 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar4;
        plVar9 = plVar9 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0x2180));
    }
  }
  do {
    lVar8 = 0;
LAB_14020d270:
    lVar7 = lVar8;
    if (lVar7 == 0) goto LAB_14020d493;
    if (lVar7 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    plVar9 = *(longlong **)(lVar7 + 8);
    plVar2 = *(longlong **)(lVar7 + 0x10);
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
      UNLOCK();
    }
    if (plVar9 != (longlong *)0x0) {
      bVar10 = (ulonglong)plVar9[0x1f6] < *param_2;
      if ((plVar9[0x1f6] == *param_2) &&
         (bVar10 = (ulonglong)plVar9[0x1f7] < param_2[1], plVar9[0x1f7] == param_2[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar10) - (uint)(bVar10 != 0);
      }
      if (iVar3 == 0) {
        if (plVar9[0x26] == 0) {
          if (plVar2 != (longlong *)0x0) {
            LOCK();
            plVar9 = plVar2 + 1;
            *(int *)plVar9 = (int)*plVar9 + -1;
            UNLOCK();
            if ((int)*plVar9 == 0) {
              (**(code **)(*plVar2 + 8))(plVar2);
              LOCK();
              piVar1 = (int *)((longlong)plVar2 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar2 + 0x10))();
              }
            }
          }
        }
        else {
          lVar8 = *(longlong *)(plVar9[0x26] + 0x930);
          if (lVar8 != 0) {
            if ((*(char *)(lVar8 + 0x15) != '\0') &&
               (lVar8 = (**(code **)(*plVar9 + 0x280))(plVar9), *(int *)(lVar8 + 0x78) != 0)) {
              lVar8 = (**(code **)(*plVar9 + 0x280))(plVar9);
              iVar3 = *(int *)(lVar8 + 0x78);
              lVar8 = FUN_1401e0840();
              GetLocalTime((LPSYSTEMTIME)(lVar8 + 200));
              iVar5 = FUN_1401e2290((LPSYSTEMTIME)(lVar8 + 200));
              if (iVar3 < iVar5) {
                if (plVar2 != (longlong *)0x0) {
                  LOCK();
                  plVar9 = plVar2 + 1;
                  *(int *)plVar9 = (int)*plVar9 + -1;
                  UNLOCK();
                  if ((int)*plVar9 == 0) {
                    (**(code **)(*plVar2 + 8))(plVar2);
                    LOCK();
                    piVar1 = (int *)((longlong)plVar2 + 0xc);
                    *piVar1 = *piVar1 + -1;
                    UNLOCK();
                    if (*piVar1 == 0) {
                      (**(code **)(*plVar2 + 0x10))();
                    }
                  }
                }
                goto LAB_14020d493;
              }
            }
            lVar8 = plVar9[0x25];
            if (plVar2 != (longlong *)0x0) {
              LOCK();
              plVar9 = plVar2 + 1;
              *(int *)plVar9 = (int)*plVar9 + -1;
              UNLOCK();
              if ((int)*plVar9 == 0) {
                (**(code **)(*plVar2 + 8))(plVar2);
                LOCK();
                piVar1 = (int *)((longlong)plVar2 + 0xc);
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                if (*piVar1 == 0) {
                  (**(code **)(*plVar2 + 0x10))();
                }
              }
            }
            if (!bVar11) {
              return (int)lVar8;
            }
            FUN_14034edd0(local_50);
            return (int)lVar8;
          }
          if (plVar2 != (longlong *)0x0) {
            LOCK();
            plVar9 = plVar2 + 1;
            *(int *)plVar9 = (int)*plVar9 + -1;
            UNLOCK();
            if ((int)*plVar9 == 0) {
              (**(code **)(*plVar2 + 8))(plVar2);
              LOCK();
              piVar1 = (int *)((longlong)plVar2 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar2 + 0x10))();
              }
            }
          }
        }
LAB_14020d493:
        if (bVar11) {
          FUN_14034edd0(local_50);
        }
        return 0;
      }
    }
    if (plVar2 != (longlong *)0x0) {
      LOCK();
      plVar9 = plVar2 + 1;
      *(int *)plVar9 = (int)*plVar9 + -1;
      UNLOCK();
      if ((int)*plVar9 == 0) {
        (**(code **)(*plVar2 + 8))(plVar2);
        LOCK();
        piVar1 = (int *)((longlong)plVar2 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*plVar2 + 0x10))();
        }
      }
    }
  } while (lVar7 == 0);
  lVar8 = *(longlong *)(lVar7 + 0x18);
  if (lVar8 == 0) {
    uVar4 = *(uint *)(lVar7 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
    lVar7 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(param_1 + 0x2180) <= uVar4) break;
      if (*(longlong *)(*(longlong *)(param_1 + 0x2170) + lVar7) != 0) {
        lVar8 = *(longlong *)(*(longlong *)(param_1 + 0x2170) + lVar7);
      }
      uVar4 = uVar4 + 1;
      lVar7 = lVar7 + 8;
    } while (lVar8 == 0);
  }
  goto LAB_14020d270;
}



void FUN_14020d4d0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  lVar6 = 0;
  lVar4 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  plVar1 = *(longlong **)(param_1 + 0x21c0);
  for (plVar3 = *(longlong **)(param_1 + 0x21b8); plVar3 != plVar1; plVar3 = plVar3 + 2) {
    lVar4 = *plVar3;
    if ((DAT_1405dfc58 <= 0.0 - *(double *)(lVar4 + 0x2138)) ||
       (*(char *)(lVar4 + 0x2140) == '\x01')) {
      *(undefined8 *)(lVar4 + 0x2138) = 0;
      *(undefined1 *)(lVar4 + 0x2140) = 0;
      if (*(char *)(lVar4 + 0x607) != '\0') {
        FUN_140214a00(lVar4);
      }
      if (*(char *)(lVar4 + 0x605) != '\0') {
        FUN_140214b00(lVar4);
      }
      if (*(char *)(lVar4 + 0x10c8) != '\0') {
        FUN_140214be0(lVar4);
        *(undefined1 *)(lVar4 + 0x10c8) = 0;
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return;
}



bool FUN_14020d650(longlong param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  longlong *plVar3;
  int iVar4;
  uint uVar5;
  ulonglong uVar6;
  longlong lVar7;
  longlong lVar8;
  longlong *plVar9;
  bool bVar10;
  bool bVar11;
  longlong local_40;
  
  local_40 = 0;
  bVar11 = false;
  plVar9 = *(longlong **)(param_1 + 0x12e8);
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == *(longlong **)(param_1 + 0x12f0)) {
      lVar7 = *plVar9;
      if (lVar7 != 0) {
        if (plVar9 != *(longlong **)(param_1 + 0x12f0)) {
          iVar4 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar11) {
            FUN_140176d60();
          }
          lVar7 = 0;
        }
        FUN_14034ed40();
        bVar11 = true;
        local_40 = lVar7;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2178) != 0) {
    uVar6 = 0;
    if (*(uint *)(param_1 + 0x2180) != 0) {
      plVar9 = *(longlong **)(param_1 + 0x2170);
      do {
        if (*plVar9 != 0) {
          lVar7 = (*(longlong **)(param_1 + 0x2170))[uVar6];
          goto LAB_14020d730;
        }
        uVar5 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar5;
        plVar9 = plVar9 + 1;
      } while (uVar5 < *(uint *)(param_1 + 0x2180));
    }
  }
  lVar7 = 0;
LAB_14020d730:
  iVar4 = 0;
  do {
    do {
      lVar8 = lVar7;
      if (lVar8 == 0) {
        if (param_2 == 0) {
          bVar10 = iVar4 < 4;
        }
        else {
          bVar10 = iVar4 < 8;
        }
        if (bVar11) {
          FUN_14034edd0(local_40);
        }
        return bVar10;
      }
      if (lVar8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      plVar9 = *(longlong **)(lVar8 + 8);
      plVar3 = *(longlong **)(lVar8 + 0x10);
      if (plVar3 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
        UNLOCK();
      }
      if (((plVar9 != (longlong *)0x0) &&
          (lVar7 = (**(code **)(*plVar9 + 0x280))(plVar9), *(char *)(lVar7 + 0x80) != '\x01')) &&
         (param_2 == *(short *)((longlong)plVar9 + 0x2142))) {
        iVar4 = iVar4 + 1;
      }
      if (plVar3 != (longlong *)0x0) {
        LOCK();
        plVar9 = plVar3 + 1;
        lVar7 = *plVar9;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)lVar7 == 1) {
          (**(code **)(*plVar3 + 8))(plVar3);
          LOCK();
          piVar1 = (int *)((longlong)plVar3 + 0xc);
          iVar2 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (iVar2 == 1) {
            (**(code **)(*plVar3 + 0x10))();
          }
        }
      }
      lVar7 = lVar8;
    } while ((lVar8 == 0) || (lVar7 = *(longlong *)(lVar8 + 0x18), lVar7 != 0));
    uVar5 = *(uint *)(lVar8 + 0x20) % *(uint *)(param_1 + 0x2180) + 1;
    lVar8 = (longlong)(int)uVar5 << 3;
    do {
      if (*(uint *)(param_1 + 0x2180) <= uVar5) break;
      if (*(longlong *)(lVar8 + *(longlong *)(param_1 + 0x2170)) != 0) {
        lVar7 = *(longlong *)(lVar8 + *(longlong *)(param_1 + 0x2170));
      }
      uVar5 = uVar5 + 1;
      lVar8 = lVar8 + 8;
    } while (lVar7 == 0);
  } while( true );
}



undefined8 * FUN_14020d880(longlong param_1,uint param_2)

{
  if (param_2 < 2) {
    return (undefined8 *)(param_1 + (longlong)(int)param_2 * 8);
  }
  if (DAT_140608140 == 0) {
    FUN_140176d60(0);
  }
  DAT_140608140 = DAT_140608140 + 1;
  return &DAT_140608148;
}



undefined8 FUN_14020d8c0(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_140608150 + 1;
    bVar3 = DAT_140608150 == 0;
    DAT_140608150 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void FUN_14020d900(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_14020da20(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140209d90(param_1[1],((longlong)(param_2 - uVar2) / 0xe0) * 0xe0 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14020da20(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140209d90(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0xe0;
  return;
}



void FUN_14020d9c0(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0xc;
    do {
      if (7 < *puVar2) {
        operator_delete((void *)puVar2[-3]);
      }
      *puVar2 = 7;
      puVar2[-1] = 0;
      *(undefined2 *)(puVar2 + -3) = 0;
      puVar1 = puVar2 + 0x10;
      puVar2 = puVar2 + 0x1c;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_14020da20(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0xe0;
  if (0x124924924924923 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0xe0;
  if (uVar2 < uVar3) {
    if (0x124924924924924 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14020dae0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14020dae0(param_1,uVar2);
  }
  return;
}



void FUN_14020dae0(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 (0x124924924924924 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0xe0) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0xe0);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14020e440(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_14020d9c0(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0xe0);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0xe0) * 0xe0);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



ulonglong * FUN_14020dc30(longlong *param_1,ulonglong *param_2,void *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_1402c6d50(param_1,uVar5,1,uVar5,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + ((ulonglong)uVar4 % uVar5) * 8);
        puVar3 != (ulonglong *)0x0; puVar3 = (ulonglong *)puVar3[0xc]) {
      if ((uint)puVar3[0xd] == 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) {
          memcpy(puVar3 + 2,param_3,0x50);
          return puVar3;
        }
      }
    }
  }
  puVar3 = (ulonglong *)FUN_14020e250(param_1,param_2,(ulonglong)uVar4 % uVar5,uVar4);
  memcpy(puVar3 + 2,param_3,0x50);
  return puVar3;
}



undefined8 FUN_14020dd20(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[0xd] == 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[0xc] = puVar2[0xc];
            FUN_14020de60(param_1,puVar2);
            return 1;
          }
          *(ulonglong *)
           (lVar1 + ((ulonglong)(uint)puVar2[0xd] % (ulonglong)*(uint *)(param_1 + 2)) * 8) =
               puVar2[0xc];
          FUN_14020de60(param_1,puVar2);
          return 1;
        }
      }
      puVar3 = puVar2;
      puVar4 = (ulonglong *)puVar2[0xc];
    }
  }
  return 0;
}



void FUN_14020dde0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_14020de60(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x60);
  FUN_14020de60(param_1,param_2);
  return;
}



void FUN_14020de60(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_1402cddb0();
      FUN_14020e0a0(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_14000d450(0x80004005);
}



undefined8 * FUN_14020def0(undefined4 *param_1,undefined4 *param_2,undefined8 *param_3)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  
  if (param_1 != param_2) {
    puVar3 = (undefined4 *)((longlong)param_3 + 0xac);
    puVar2 = param_1 + 0x2b;
    do {
      *param_3 = *(undefined8 *)(puVar2 + -0x2b);
      *(undefined8 *)(puVar3 + -0x29) = *(undefined8 *)(puVar2 + -0x29);
      *(undefined8 *)(puVar3 + -0x27) = *(undefined8 *)(puVar2 + -0x27);
      puVar3[-0x25] = puVar2[-0x25];
      puVar3[-0x24] = puVar2[-0x24];
      puVar3[-0x23] = puVar2[-0x23];
      puVar3[-0x22] = puVar2[-0x22];
      puVar3[-0x21] = puVar2[-0x21];
      puVar3[-0x20] = puVar2[-0x20];
      puVar3[-0x1f] = puVar2[-0x1f];
      puVar3[-0x1e] = puVar2[-0x1e];
      puVar3[-0x1d] = puVar2[-0x1d];
      puVar3[-0x1c] = puVar2[-0x1c];
      puVar3[-0x1b] = puVar2[-0x1b];
      FUN_1400015e0(puVar3 + -0x19,puVar2 + -0x19,0,0xffffffffffffffff);
      *(undefined2 *)(puVar3 + -0xf) = *(undefined2 *)(puVar2 + -0xf);
      puVar3[-0xe] = puVar2[-0xe];
      puVar3[-0xd] = puVar2[-0xd];
      *(undefined8 *)(puVar3 + -0xb) = *(undefined8 *)(puVar2 + -0xb);
      puVar3[-9] = puVar2[-9];
      puVar3[-8] = puVar2[-8];
      puVar3[-7] = puVar2[-7];
      puVar3[-6] = puVar2[-6];
      puVar3[-5] = puVar2[-5];
      puVar3[-4] = puVar2[-4];
      puVar3[-3] = puVar2[-3];
      puVar3[-2] = puVar2[-2];
      puVar3[-1] = puVar2[-1];
      *puVar3 = *puVar2;
      puVar3[1] = puVar2[1];
      puVar3[2] = puVar2[2];
      puVar3[3] = puVar2[3];
      puVar3[4] = puVar2[4];
      puVar3[5] = puVar2[5];
      puVar3[6] = puVar2[6];
      puVar3[7] = puVar2[7];
      puVar3[8] = puVar2[8];
      puVar3[9] = puVar2[9];
      puVar3[10] = puVar2[10];
      param_3 = param_3 + 0x1c;
      puVar3[0xb] = puVar2[0xb];
      puVar1 = puVar2 + 0xd;
      puVar3 = puVar3 + 0x38;
      puVar2 = puVar2 + 0x38;
    } while (puVar1 != param_2);
  }
  return param_3;
}



void FUN_14020e0a0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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_14020e250(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_14020e307;
      lVar7 = uVar6 * 0x70;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14020e307:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x18);
  *puVar2 = *param_2;
  puVar2[1] = param_2[1];
  puVar2[2] = param_2[2];
  puVar2[3] = param_2[3];
  *(undefined8 *)(puVar2 + 4) = 0;
  *(undefined8 *)(puVar2 + 6) = 0;
  *(undefined8 *)(puVar2 + 8) = 0;
  *(undefined8 *)(puVar2 + 10) = 0;
  *(undefined8 *)(puVar2 + 0xc) = 0;
  *(undefined8 *)(puVar2 + 0xe) = 0;
  *(undefined8 *)(puVar2 + 0x10) = 0;
  *(undefined8 *)(puVar2 + 0x12) = 0;
  *(undefined8 *)(puVar2 + 0x14) = 0;
  *(undefined8 *)(puVar2 + 0x16) = 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_1402cddb0(param_1);
    FUN_14020e0a0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_14020e400(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x60)) {
    operator_delete(*(void **)(param_1 + 0x48));
  }
  *(undefined8 *)(param_1 + 0x60) = 7;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  return;
}



longlong FUN_14020e440(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0xe0) {
    if (param_3 != 0) {
      FUN_140209d90(param_3,param_1);
    }
    param_3 = param_3 + 0xe0;
  }
  return param_3;
}



undefined4 FUN_14020e4a0(undefined8 param_1,longlong *param_2)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  
  plVar1 = (longlong *)*param_2;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_2[1]) {
      return *(undefined4 *)(*plVar1 + 0x214);
    }
    iVar2 = DAT_140608154 + 1;
    bVar3 = DAT_140608154 == 0;
    DAT_140608154 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return uRam0000000000000214;
}



undefined4 FUN_14020e4f0(undefined8 param_1,longlong *param_2)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  
  plVar1 = (longlong *)*param_2;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_2[1]) {
      return *(undefined4 *)(*plVar1 + 0x218);
    }
    iVar2 = DAT_140608154 + 1;
    bVar3 = DAT_140608154 == 0;
    DAT_140608154 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return uRam0000000000000218;
}



undefined4 FUN_14020e540(undefined8 param_1,longlong *param_2)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  
  plVar1 = (longlong *)*param_2;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_2[1]) {
      return *(undefined4 *)(*plVar1 + 0xfc);
    }
    iVar2 = DAT_140608154 + 1;
    bVar3 = DAT_140608154 == 0;
    DAT_140608154 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return uRam00000000000000fc;
}



longlong FUN_14020e590(longlong param_1)

{
  return param_1 + 0x1cb0;
}



undefined1 FUN_14020e5a0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x50);
}



undefined8 FUN_14020e5b0(void)

{
  return 0x40a00000;
}



undefined8 FUN_14020e5c0(void)

{
  return 0x3f800000;
}



undefined4 FUN_14020e5d0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x1e54);
}



longlong * FUN_14020e5e0(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 0x14c8);
  if (7 < *(ulonglong *)(param_1 + 0x14e0)) {
    plVar1 = (longlong *)*plVar1;
  }
  return plVar1;
}



undefined4 FUN_14020e600(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x54c);
}



void FUN_14020e610(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x8ab) = param_2;
  *(undefined1 *)(param_1 + 0x60a) = 1;
  return;
}



void FUN_14020e620(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x8ac) = param_2;
  *(undefined1 *)(param_1 + 0x60a) = 1;
  return;
}



void FUN_14020e630(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x8aa) = param_2;
  *(undefined1 *)(param_1 + 0x60a) = 1;
  return;
}



void FUN_14020e640(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x8a9) = param_2;
  *(undefined1 *)(param_1 + 0x60a) = 1;
  return;
}



undefined8 FUN_14020e650(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_140608154 + 1;
    bVar3 = DAT_140608154 == 0;
    DAT_140608154 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



undefined8 * FUN_14020e690(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0x478);
  lVar1 = *(longlong *)(param_1 + 0x480);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



void FUN_14020e6c0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x124) = param_2;
  return;
}



// WARNING: Removing unreachable block (ram,0x00014020e8ce)
// WARNING: Removing unreachable block (ram,0x00014020e890)

longlong * FUN_14020e6d0(longlong param_1,longlong *param_2,undefined8 *param_3,wchar_t *param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  void *pvVar5;
  uint uVar6;
  int iVar7;
  longlong lVar9;
  undefined2 *puVar10;
  wchar_t *pwVar11;
  longlong lVar12;
  longlong *plVar13;
  wchar_t *pwVar14;
  bool bVar15;
  undefined8 *local_70;
  undefined8 *local_48;
  undefined8 *local_40;
  wchar_t *pwVar8;
  
  pwVar14 = (wchar_t *)0x0;
  bVar15 = param_4 == (wchar_t *)0x0;
  if (bVar15) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar12 = 1;
    pwVar11 = param_4;
    pwVar8 = L"";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar15 = *pwVar11 == *pwVar8;
      pwVar11 = pwVar11 + 1;
      pwVar8 = pwVar8 + 1;
    } while (bVar15);
    if (bVar15) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      lVar12 = param_1 + 0xa8;
      FUN_14034ed40(lVar12);
      plVar1 = (longlong *)(param_1 + 8);
      pwVar11 = pwVar14;
      if ((*(longlong *)(param_1 + 0x10) != 0) && (*(uint *)(param_1 + 0x18) != 0)) {
        pwVar8 = pwVar14;
        plVar13 = (longlong *)*plVar1;
        do {
          if (*plVar13 != 0) {
            pwVar11 = (wchar_t *)((longlong *)*plVar1)[(longlong)pwVar8];
            break;
          }
          uVar6 = (int)pwVar8 + 1;
          pwVar8 = (wchar_t *)(ulonglong)uVar6;
          plVar13 = plVar13 + 1;
        } while (uVar6 < *(uint *)(param_1 + 0x18));
      }
LAB_14020e790:
      pwVar8 = pwVar11;
      if (pwVar8 != (wchar_t *)0x0) {
        puVar3 = *(undefined8 **)(pwVar8 + 4);
        pwVar11 = pwVar14;
        if (puVar3 != (undefined8 *)0x0) {
          if (puVar3 == *(undefined8 **)(pwVar8 + 8)) {
            pwVar11 = (wchar_t *)*puVar3;
          }
          else {
            iVar7 = DAT_140608150 + 1;
            bVar15 = DAT_140608150 == 0;
            DAT_140608150 = iVar7;
            if (bVar15) {
              FUN_140176d60(1);
            }
          }
        }
        if (7 < *(ulonglong *)(pwVar11 + 0xc)) {
          pwVar11 = *(wchar_t **)pwVar11;
        }
        iVar7 = _wcsicmp(param_4,pwVar11);
        if (iVar7 == 0) {
          if (pwVar8 != (wchar_t *)0x0) {
            puVar3 = *(undefined8 **)(pwVar8 + 4);
            if (puVar3 != (undefined8 *)0x0) {
              if (puVar3 == *(undefined8 **)(pwVar8 + 8)) {
                pwVar14 = (wchar_t *)*puVar3;
              }
              else {
                iVar7 = DAT_140608150 + 1;
                bVar15 = DAT_140608150 == 0;
                DAT_140608150 = iVar7;
                if (bVar15) {
                  FUN_140176d60(1);
                }
              }
            }
            *(int *)(pwVar14 + 0x44) = *(int *)(pwVar14 + 0x44) + 1;
            lVar9 = *(longlong *)(pwVar8 + 4);
            *param_2 = lVar9;
            param_2[1] = lVar9;
            if (lVar9 != 0) {
              LOCK();
              *(int *)(lVar9 + 8) = *(int *)(lVar9 + 8) + 1;
              UNLOCK();
            }
            FUN_14034edd0(lVar12);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar11 = pwVar14;
        if ((pwVar8 != (wchar_t *)0x0) &&
           (pwVar11 = *(wchar_t **)(pwVar8 + 0xc), *(wchar_t **)(pwVar8 + 0xc) == (wchar_t *)0x0)) {
          uVar6 = *(uint *)(pwVar8 + 0x10) % *(uint *)(param_1 + 0x18) + 1;
          lVar9 = (longlong)(int)uVar6 << 3;
          pwVar11 = pwVar14;
          do {
            if (*(uint *)(param_1 + 0x18) <= uVar6) break;
            if (*(longlong *)(lVar9 + *plVar1) != 0) {
              pwVar11 = *(wchar_t **)(lVar9 + *plVar1);
            }
            uVar6 = uVar6 + 1;
            lVar9 = lVar9 + 8;
          } while (pwVar11 == (wchar_t *)0x0);
        }
        goto LAB_14020e790;
      }
      *(longlong *)(param_1 + 0x98) = *(longlong *)(param_1 + 0x98) + 1;
      *param_3 = *(undefined8 *)(param_1 + 0x98);
      puVar10 = operator_new(0x90);
      if (puVar10 == (undefined2 *)0x0) {
        local_70 = (undefined8 *)0x0;
      }
      else {
        *(undefined8 *)(puVar10 + 0xc) = 7;
        *(undefined8 *)(puVar10 + 8) = 0;
        *puVar10 = 0;
        *(undefined8 *)(puVar10 + 0x14) = 0;
        *(undefined8 *)(puVar10 + 0x18) = 0;
        *(undefined8 *)(puVar10 + 0x1c) = 0;
        FUN_1402ca220(puVar10 + 0x24);
        *(undefined4 *)(puVar10 + 0x44) = 0;
        local_70 = operator_new(0x10);
        *local_70 = puVar10;
        *(undefined4 *)(local_70 + 1) = 1;
      }
      pwVar11 = pwVar14;
      if (local_70 != (undefined8 *)0x0) {
        pwVar11 = (wchar_t *)*local_70;
      }
      FUN_1402761b0(pwVar11,param_4);
      pwVar11 = pwVar14;
      if (local_70 != (undefined8 *)0x0) {
        pwVar11 = (wchar_t *)*local_70;
      }
      *(int *)(pwVar11 + 0x44) = *(int *)(pwVar11 + 0x44) + 1;
      if (local_70 != (undefined8 *)0x0) {
        pwVar14 = (wchar_t *)*local_70;
      }
      *(int *)(pwVar14 + 0x44) = *(int *)(pwVar14 + 0x44) + 1;
      uVar4 = *param_3;
      if (local_70 != (undefined8 *)0x0) {
        LOCK();
        *(int *)(local_70 + 1) = *(int *)(local_70 + 1) + 1;
        UNLOCK();
      }
      local_48 = local_70;
      local_40 = local_70;
      FUN_14020f0b0(plVar1,uVar4,&local_48);
      FUN_14020f700(&local_48);
      *param_2 = (longlong)local_70;
      param_2[1] = (longlong)local_70;
      if (local_70 != (undefined8 *)0x0) {
        LOCK();
        *(int *)(local_70 + 1) = *(int *)(local_70 + 1) + 1;
        UNLOCK();
      }
      FUN_14034edd0(lVar12);
      if (local_70 != (undefined8 *)0x0) {
        LOCK();
        piVar2 = (int *)(local_70 + 1);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          pvVar5 = (void *)*local_70;
          if (pvVar5 != (void *)0x0) {
            FUN_140276130(pvVar5);
            operator_delete(pvVar5);
          }
          operator_delete(local_70);
        }
      }
    }
  }
  return param_2;
}



void FUN_14020ea50(longlong param_1)

{
  FUN_14020f700(param_1 + 8);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014020ec56)
// WARNING: Removing unreachable block (ram,0x00014020ec1c)

longlong * FUN_14020ea60(longlong param_1,longlong *param_2,undefined8 *param_3,wchar_t *param_4)

{
  undefined8 *puVar1;
  uint uVar2;
  int iVar3;
  longlong lVar4;
  wchar_t *pwVar5;
  wchar_t *pwVar6;
  longlong lVar7;
  longlong *plVar8;
  wchar_t *pwVar9;
  undefined8 *puVar10;
  bool bVar11;
  undefined8 *local_80;
  undefined8 *local_78;
  longlong local_70;
  undefined1 local_68;
  undefined8 local_60;
  undefined8 *local_58;
  undefined8 *local_50;
  
  pwVar9 = (wchar_t *)0x0;
  local_80 = (undefined8 *)0x0;
  bVar11 = param_4 == (wchar_t *)0x0;
  if (bVar11) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar7 = 1;
    pwVar6 = param_4;
    pwVar5 = L"";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar11 = *pwVar6 == *pwVar5;
      pwVar6 = pwVar6 + 1;
      pwVar5 = pwVar5 + 1;
    } while (bVar11);
    if (bVar11) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      lVar7 = param_1 + 0xa8;
      local_70 = lVar7;
      FUN_14034ed40(lVar7);
      local_68 = 1;
      pwVar6 = pwVar9;
      if ((*(longlong *)(param_1 + 0x58) != 0) && (*(uint *)(param_1 + 0x60) != 0)) {
        pwVar5 = pwVar9;
        plVar8 = *(longlong **)(param_1 + 0x50);
        do {
          if (*plVar8 != 0) {
            pwVar6 = (wchar_t *)(*(longlong **)(param_1 + 0x50))[(longlong)pwVar5];
            break;
          }
          uVar2 = (int)pwVar5 + 1;
          pwVar5 = (wchar_t *)(ulonglong)uVar2;
          plVar8 = plVar8 + 1;
        } while (uVar2 < *(uint *)(param_1 + 0x60));
      }
LAB_14020eb20:
      pwVar5 = pwVar6;
      if (pwVar5 != (wchar_t *)0x0) {
        puVar1 = *(undefined8 **)(pwVar5 + 4);
        pwVar6 = pwVar9;
        if (puVar1 != (undefined8 *)0x0) {
          if (puVar1 == *(undefined8 **)(pwVar5 + 8)) {
            pwVar6 = (wchar_t *)*puVar1;
          }
          else {
            iVar3 = DAT_140608158 + 1;
            bVar11 = DAT_140608158 == 0;
            DAT_140608158 = iVar3;
            if (bVar11) {
              FUN_140176d60(1);
            }
          }
        }
        if (7 < *(ulonglong *)(pwVar6 + 0xc)) {
          pwVar6 = *(wchar_t **)pwVar6;
        }
        iVar3 = _wcsicmp(param_4,pwVar6);
        if (iVar3 == 0) {
          if (pwVar5 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          puVar1 = *(undefined8 **)(pwVar5 + 4);
          if (puVar1 != (undefined8 *)0x0) {
            if (puVar1 == *(undefined8 **)(pwVar5 + 8)) {
              pwVar9 = (wchar_t *)*puVar1;
            }
            else {
              iVar3 = DAT_140608158 + 1;
              bVar11 = DAT_140608158 == 0;
              DAT_140608158 = iVar3;
              if (bVar11) {
                FUN_140176d60(1);
              }
            }
          }
          *(int *)(pwVar9 + 0x34) = *(int *)(pwVar9 + 0x34) + 1;
          lVar4 = *(longlong *)(pwVar5 + 4);
          *param_2 = lVar4;
          param_2[1] = lVar4;
          if (lVar4 != 0) {
            LOCK();
            *(int *)(lVar4 + 8) = *(int *)(lVar4 + 8) + 1;
            UNLOCK();
            lVar7 = local_70;
          }
          FUN_14034edd0(lVar7);
          goto LAB_14020ed79;
        }
        pwVar6 = pwVar9;
        if ((pwVar5 != (wchar_t *)0x0) &&
           (pwVar6 = *(wchar_t **)(pwVar5 + 0xc), *(wchar_t **)(pwVar5 + 0xc) == (wchar_t *)0x0)) {
          uVar2 = *(uint *)(pwVar5 + 0x10) % *(uint *)(param_1 + 0x60) + 1;
          lVar4 = (longlong)(int)uVar2 << 3;
          pwVar6 = pwVar9;
          do {
            if (*(uint *)(param_1 + 0x60) <= uVar2) break;
            if (*(longlong *)(*(longlong *)(param_1 + 0x50) + lVar4) != 0) {
              pwVar6 = *(wchar_t **)(*(longlong *)(param_1 + 0x50) + lVar4);
            }
            uVar2 = uVar2 + 1;
            lVar4 = lVar4 + 8;
          } while (pwVar6 == (wchar_t *)0x0);
        }
        goto LAB_14020eb20;
      }
      *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + 1;
      *param_3 = *(undefined8 *)(param_1 + 0xa0);
      pwVar5 = operator_new(0x70);
      pwVar6 = pwVar9;
      if (pwVar5 != (wchar_t *)0x0) {
        pwVar5[0xc] = L'\a';
        pwVar5[0xd] = L'\0';
        pwVar5[0xe] = L'\0';
        pwVar5[0xf] = L'\0';
        pwVar5[8] = L'\0';
        pwVar5[9] = L'\0';
        pwVar5[10] = L'\0';
        pwVar5[0xb] = L'\0';
        *pwVar5 = L'\0';
        FUN_1402ca220(pwVar5 + 0x14);
        pwVar5[0x34] = L'\0';
        pwVar5[0x35] = L'\0';
        pwVar6 = pwVar5;
      }
      FUN_14020f640(&local_80);
      if (pwVar6 == (wchar_t *)0x0) {
        local_80 = (undefined8 *)0x0;
      }
      else {
        local_80 = operator_new(0x10);
        *local_80 = pwVar6;
        *(undefined4 *)(local_80 + 1) = 1;
      }
      puVar1 = local_80;
      pwVar6 = pwVar9;
      if (local_80 != (undefined8 *)0x0) {
        pwVar6 = (wchar_t *)*local_80;
      }
      local_78 = local_80;
      FUN_140279aa0(pwVar6,param_4);
      pwVar6 = pwVar9;
      if (puVar1 != (undefined8 *)0x0) {
        pwVar6 = (wchar_t *)*puVar1;
      }
      *(int *)(pwVar6 + 0x34) = *(int *)(pwVar6 + 0x34) + 1;
      if (puVar1 != (undefined8 *)0x0) {
        pwVar9 = (wchar_t *)*puVar1;
      }
      *(int *)(pwVar9 + 0x34) = *(int *)(pwVar9 + 0x34) + 1;
      local_60 = *param_3;
      puVar10 = puVar1;
      if (puVar1 != (undefined8 *)0x0) {
        LOCK();
        *(int *)(puVar1 + 1) = *(int *)(puVar1 + 1) + 1;
        UNLOCK();
        puVar10 = local_80;
        lVar7 = local_70;
      }
      local_58 = puVar1;
      local_50 = puVar1;
      FUN_14020f1b0(param_1 + 0x50,local_60,&local_58);
      FUN_14020f640(&local_58);
      *param_2 = (longlong)puVar10;
      param_2[1] = (longlong)puVar10;
      if (puVar10 != (undefined8 *)0x0) {
        LOCK();
        *(int *)(puVar10 + 1) = *(int *)(puVar10 + 1) + 1;
        UNLOCK();
        lVar7 = local_70;
      }
      FUN_14034edd0(lVar7);
    }
  }
LAB_14020ed79:
  FUN_14020f640(&local_80);
  return param_2;
}



void FUN_14020eda0(longlong param_1)

{
  FUN_14020f640(param_1 + 8);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014020f07c)
// WARNING: Removing unreachable block (ram,0x00014020eefb)

void FUN_14020edb0(longlong param_1)

{
  longlong *plVar1;
  ulonglong *puVar2;
  longlong lVar3;
  uint uVar4;
  int iVar5;
  DWORD DVar6;
  longlong lVar8;
  HANDLE hObject;
  HANDLE pvVar9;
  longlong *plVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  bool bVar13;
  ulonglong uVar7;
  
  FUN_14034ed40(param_1 + 0xa8);
  uVar12 = 0;
  uVar11 = uVar12;
  if ((*(longlong *)(param_1 + 0x10) != 0) && (*(uint *)(param_1 + 0x18) != 0)) {
    plVar1 = *(longlong **)(param_1 + 8);
    uVar7 = uVar12;
    plVar10 = plVar1;
    do {
      if (*plVar10 != 0) {
        uVar11 = plVar1[uVar7];
        break;
      }
      uVar4 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar4;
      plVar10 = plVar10 + 1;
    } while (uVar4 < *(uint *)(param_1 + 0x18));
  }
LAB_14020ee50:
  uVar7 = uVar11;
  if (uVar7 != 0) {
    puVar2 = *(ulonglong **)(uVar7 + 8);
    uVar11 = uVar12;
    if (puVar2 != (ulonglong *)0x0) {
      if (puVar2 == *(ulonglong **)(uVar7 + 0x10)) {
        uVar11 = *puVar2;
      }
      else {
        iVar5 = DAT_140608150 + 1;
        bVar13 = DAT_140608150 == 0;
        DAT_140608150 = iVar5;
        if (bVar13) {
          FUN_140176d60(1);
        }
      }
    }
    FUN_1402761b0(uVar11);
    FUN_140278df0(uVar11 + 0x48);
    uVar11 = *(ulonglong *)(uVar7 + 0x18);
    if (*(ulonglong *)(uVar7 + 0x18) == 0) {
      uVar4 = *(uint *)(uVar7 + 0x20) % *(uint *)(param_1 + 0x18) + 1;
      lVar8 = (longlong)(int)uVar4 << 3;
      uVar11 = uVar12;
      do {
        if (*(uint *)(param_1 + 0x18) <= uVar4) break;
        lVar3 = *(longlong *)(param_1 + 8);
        if (*(longlong *)(lVar3 + lVar8) != 0) {
          uVar11 = *(ulonglong *)(lVar3 + lVar8);
        }
        uVar4 = uVar4 + 1;
        lVar8 = lVar8 + 8;
      } while (uVar11 == 0);
    }
    goto LAB_14020ee50;
  }
  uVar11 = uVar12;
  if ((*(longlong *)(param_1 + 0x58) != 0) && (*(uint *)(param_1 + 0x60) != 0)) {
    plVar1 = *(longlong **)(param_1 + 0x50);
    uVar7 = uVar12;
    plVar10 = plVar1;
    do {
      if (*plVar10 != 0) {
        uVar11 = plVar1[uVar7];
        break;
      }
      uVar4 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar4;
      plVar10 = plVar10 + 1;
    } while (uVar4 < *(uint *)(param_1 + 0x60));
  }
  do {
    do {
      uVar7 = uVar11;
      if (uVar7 == 0) {
        FUN_14034edd0(param_1 + 0xa8);
        return;
      }
      puVar2 = *(ulonglong **)(uVar7 + 8);
      uVar11 = uVar12;
      if (puVar2 != (ulonglong *)0x0) {
        if (puVar2 == *(ulonglong **)(uVar7 + 0x10)) {
          uVar11 = *puVar2;
        }
        else {
          iVar5 = DAT_140608158 + 1;
          bVar13 = DAT_140608158 == 0;
          DAT_140608158 = iVar5;
          if ((bVar13) &&
             (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), hObject != (HANDLE)0x0)) {
            DVar6 = GetCurrentProcessId();
            pvVar9 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar9,DVar6,hObject,2,0,0,0);
            CloseHandle(hObject);
          }
        }
      }
      FUN_14027a8d0(uVar11 + 0x28);
      FUN_140279aa0(uVar11);
      uVar11 = *(ulonglong *)(uVar7 + 0x18);
    } while (*(ulonglong *)(uVar7 + 0x18) != 0);
    uVar4 = *(uint *)(uVar7 + 0x20) % *(uint *)(param_1 + 0x60) + 1;
    lVar8 = (longlong)(int)uVar4 << 3;
    uVar11 = uVar12;
    do {
      if (*(uint *)(param_1 + 0x60) <= uVar4) break;
      lVar3 = *(longlong *)(param_1 + 0x50);
      if (*(longlong *)(lVar3 + lVar8) != 0) {
        uVar11 = *(ulonglong *)(lVar3 + lVar8);
      }
      uVar4 = uVar4 + 1;
      lVar8 = lVar8 + 8;
    } while (uVar11 == 0);
  } while( true );
}



ulonglong * FUN_14020f0b0(longlong *param_1,ulonglong param_2,ulonglong *param_3)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  uVar1 = (param_2 & 0xffffffff) % uVar4;
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[3]) {
      if (((int)puVar3[4] == (int)param_2) && (*puVar3 == param_2)) {
        if (puVar3[1] == *param_3) {
          return puVar3;
        }
        FUN_14020f700(puVar3 + 1);
        uVar1 = *param_3;
        puVar3[1] = uVar1;
        puVar3[2] = uVar1;
        if (uVar1 == 0) {
          return puVar3;
        }
        LOCK();
        *(int *)(uVar1 + 8) = *(int *)(uVar1 + 8) + 1;
        UNLOCK();
        return puVar3;
      }
    }
  }
  puVar3 = (ulonglong *)FUN_14020f4f0(param_1,param_2,uVar1,param_2 & 0xffffffff);
  if (puVar3[1] != *param_3) {
    FUN_14020f700(puVar3 + 1);
    uVar1 = *param_3;
    puVar3[1] = uVar1;
    puVar3[2] = uVar1;
    if (uVar1 != 0) {
      LOCK();
      *(int *)(uVar1 + 8) = *(int *)(uVar1 + 8) + 1;
      UNLOCK();
    }
  }
  return puVar3;
}



ulonglong * FUN_14020f1b0(longlong *param_1,ulonglong param_2,ulonglong *param_3)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  uVar1 = (param_2 & 0xffffffff) % uVar4;
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[3]) {
      if (((int)puVar3[4] == (int)param_2) && (*puVar3 == param_2)) {
        if (puVar3[1] == *param_3) {
          return puVar3;
        }
        FUN_14020f640(puVar3 + 1);
        uVar1 = *param_3;
        puVar3[1] = uVar1;
        puVar3[2] = uVar1;
        if (uVar1 == 0) {
          return puVar3;
        }
        LOCK();
        *(int *)(uVar1 + 8) = *(int *)(uVar1 + 8) + 1;
        UNLOCK();
        return puVar3;
      }
    }
  }
  puVar3 = (ulonglong *)FUN_14020f4f0(param_1,param_2,uVar1,param_2 & 0xffffffff);
  if (puVar3[1] != *param_3) {
    FUN_14020f640(puVar3 + 1);
    uVar1 = *param_3;
    puVar3[1] = uVar1;
    puVar3[2] = uVar1;
    if (uVar1 != 0) {
      LOCK();
      *(int *)(uVar1 + 8) = *(int *)(uVar1 + 8) + 1;
      UNLOCK();
    }
  }
  return puVar3;
}



void FUN_14020f2b0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_14020f330(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x18);
  FUN_14020f330(param_1,param_2);
  return;
}



void FUN_14020f330(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_14020f700(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_1402cddb0(param_1);
    FUN_1401dfb50(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_14020f3d0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_14020f450(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x18);
  FUN_14020f450(param_1,param_2);
  return;
}



void FUN_14020f450(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_14020f640(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_1402cddb0(param_1);
    FUN_1401dfb50(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;
}



undefined8 *
FUN_14020f4f0(longlong *param_1,undefined8 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined8 *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_14020f5a7;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14020f5a7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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 = (undefined8 *)param_1[8];
  if (puVar2 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = puVar2[3];
  *puVar2 = param_2;
  puVar2[1] = 0;
  *(undefined4 *)(puVar2 + 4) = param_4;
  param_1[1] = param_1[1] + 1;
  puVar2[3] = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined8 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_1402cddb0(param_1);
    FUN_1401dfb50(param_1,uVar4);
  }
  return puVar2;
}



void FUN_14020f640(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  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;
          puVar3 = (undefined8 *)*puVar2;
          if (puVar3 != (undefined8 *)0x0) {
            if (puVar3[5] != 0) {
              FUN_14027aaa0(puVar3 + 5);
            }
            if (7 < (ulonglong)puVar3[3]) {
              operator_delete((void *)*puVar3);
            }
            puVar3[3] = 7;
            puVar3[2] = 0;
            *(undefined2 *)puVar3 = 0;
            operator_delete(puVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608160 + 1;
      bVar5 = DAT_140608160 == 0;
      DAT_140608160 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void thunk_FUN_14020f640(undefined8 *param_1)

{
  int *piVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  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;
          puVar3 = (undefined8 *)*puVar2;
          if (puVar3 != (undefined8 *)0x0) {
            if (puVar3[5] != 0) {
              FUN_14027aaa0(puVar3 + 5);
            }
            if (7 < (ulonglong)puVar3[3]) {
              operator_delete((void *)*puVar3);
            }
            puVar3[3] = 7;
            puVar3[2] = 0;
            *(undefined2 *)puVar3 = 0;
            operator_delete(puVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608160 + 1;
      bVar5 = DAT_140608160 == 0;
      DAT_140608160 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_14020f700(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_140276130(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14060815c + 1;
      bVar5 = DAT_14060815c == 0;
      DAT_14060815c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void thunk_FUN_14020f700(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_140276130(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14060815c + 1;
      bVar5 = DAT_14060815c == 0;
      DAT_14060815c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_14020f790(longlong param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  int iVar7;
  undefined *local_res8;
  undefined1 local_res18 [8];
  
  local_res18[0] = param_3;
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_4);
  iVar7 = 0;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_res8 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar7) && (iVar4 = 0, local_res8 != (undefined *)0x0)) &&
     (local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  iVar7 = 1;
  if (1 < iVar4) {
    iVar7 = iVar4;
  }
  iVar4 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  if (iVar4 < iVar7) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_4,iVar3);
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar7 = 0;
  if (0 < iVar3) {
    iVar7 = iVar3;
  }
  iVar3 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar3 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -8);
  }
  if ((iVar3 <= iVar7) && (iVar7 = 0, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_14020f8c6;
    iVar7 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar7;
    *(undefined2 *)(local_res8 + (longlong)iVar7 * 2) = 0;
  }
LAB_14020f8c6:
  (**(code **)(*(longlong *)(param_1 + 0x70) + 0x160))
            ((longlong *)(param_1 + 0x70),1,&DAT_1405d85a0,param_2,local_res18,&local_res8);
  puVar6 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    FUN_14034ed40(uVar5);
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



undefined4 FUN_14020f960(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined4 uVar2;
  void *pvVar3;
  undefined8 *puVar4;
  int iVar5;
  longlong lVar6;
  bool bVar7;
  undefined8 uVar8;
  undefined8 *local_30;
  undefined8 *local_28;
  longlong local_20;
  undefined1 local_18;
  
  uVar8 = 0xfffffffffffffffe;
  lVar6 = param_1 + 0xd0;
  local_20 = lVar6;
  FUN_14034ed40(lVar6);
  local_18 = 1;
  FUN_14020fe20(param_1,&local_30,param_2,param_4,uVar8);
  puVar4 = local_30;
  if (local_30 != (undefined8 *)0x0) {
    if (local_30 == local_28) {
      if ((undefined4 *)*local_30 != (undefined4 *)0x0) {
        uVar2 = *(undefined4 *)*local_30;
        LOCK();
        piVar1 = (int *)(local_30 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          pvVar3 = (void *)*local_30;
          if (pvVar3 != (void *)0x0) {
            FUN_14027b3e0(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(local_30);
        }
        FUN_14034edd0(local_20);
        return uVar2;
      }
    }
    else {
      iVar5 = DAT_140608164 + 1;
      bVar7 = DAT_140608164 == 0;
      DAT_140608164 = iVar5;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == local_28) {
      LOCK();
      piVar1 = (int *)(puVar4 + 1);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      lVar6 = local_20;
      if (*piVar1 == 0) {
        pvVar3 = (void *)*local_30;
        if (pvVar3 != (void *)0x0) {
          FUN_14027b3e0(pvVar3);
          operator_delete(pvVar3);
        }
        operator_delete(local_30);
        lVar6 = local_20;
      }
    }
    else {
      iVar5 = DAT_140608168 + 1;
      bVar7 = DAT_140608168 == 0;
      DAT_140608168 = iVar5;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_14034edd0(lVar6);
  return 0;
}



void FUN_14020faa0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  void *pvVar2;
  int iVar3;
  longlong lVar4;
  bool bVar5;
  undefined8 uVar6;
  longlong *local_40;
  longlong *local_38;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  longlong local_20;
  undefined1 local_18;
  
  uVar6 = 0xfffffffffffffffe;
  lVar4 = param_1 + 0xd0;
  local_20 = lVar4;
  FUN_14034ed40(lVar4);
  local_18 = 1;
  local_30 = *(undefined4 *)(param_2 + 0x128);
  local_2c = *(undefined4 *)(param_2 + 300);
  local_28 = *(undefined4 *)(param_2 + 0x130);
  local_24 = *(undefined4 *)(param_2 + 0x134);
  FUN_14020fe20(param_1,&local_40,&local_30,param_4,uVar6);
  plVar1 = local_40;
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if (*local_40 != 0) {
        FUN_14027bb00(*local_40,param_2);
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        lVar4 = local_20;
        if ((int)*plVar1 == 0) {
          pvVar2 = (void *)*local_40;
          if (pvVar2 != (void *)0x0) {
            FUN_14027b3e0(pvVar2);
            operator_delete(pvVar2);
          }
          operator_delete(local_40);
          lVar4 = local_20;
        }
        goto LAB_14020fbe5;
      }
    }
    else {
      iVar3 = DAT_140608164 + 1;
      bVar5 = DAT_140608164 == 0;
      DAT_140608164 = iVar3;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_38) {
      LOCK();
      plVar1 = plVar1 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      lVar4 = local_20;
      if ((int)*plVar1 == 0) {
        pvVar2 = (void *)*local_40;
        if (pvVar2 != (void *)0x0) {
          FUN_14027b3e0(pvVar2);
          operator_delete(pvVar2);
        }
        operator_delete(local_40);
        lVar4 = local_20;
      }
    }
    else {
      iVar3 = DAT_140608168 + 1;
      bVar5 = DAT_140608168 == 0;
      DAT_140608168 = iVar3;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14020fbe5:
  FUN_14034edd0(lVar4);
  return;
}



undefined8
FUN_14020fc00(undefined8 param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  longlong *plVar1;
  void *pvVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  longlong *local_20;
  longlong *local_18;
  
  FUN_14020fe20(param_1,&local_20,param_2,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if (*local_20 != 0) {
        *(undefined1 *)(*local_20 + 0x4f) = param_3;
        LOCK();
        plVar1 = local_20 + 1;
        lVar3 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar3 == 1) {
          pvVar2 = (void *)*local_20;
          if (pvVar2 != (void *)0x0) {
            FUN_14027b3e0(pvVar2);
            operator_delete(pvVar2);
          }
          operator_delete(local_20);
        }
        return 1;
      }
    }
    else {
      iVar4 = DAT_140608164 + 1;
      bVar5 = DAT_140608164 == 0;
      DAT_140608164 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_18) {
      LOCK();
      plVar1 = plVar1 + 1;
      lVar3 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar3 == 1) {
        pvVar2 = (void *)*local_20;
        if (pvVar2 != (void *)0x0) {
          FUN_14027b3e0(pvVar2);
          operator_delete(pvVar2);
        }
        operator_delete(local_20);
      }
    }
    else {
      iVar4 = DAT_140608168 + 1;
      bVar5 = DAT_140608168 == 0;
      DAT_140608168 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  return 0;
}



void FUN_14020fd10(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  void *pvVar3;
  int iVar4;
  bool bVar5;
  undefined1 local_res18 [16];
  longlong *local_20;
  longlong *local_18;
  
  FUN_14020fe20(param_1,&local_20,param_2,param_4,0xfffffffffffffffe);
  plVar1 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      lVar2 = *local_20;
      if (lVar2 != 0) {
        memset((void *)(lVar2 + 0x158),0,0x3c);
        memset((void *)(lVar2 + 0x194),0,0x50);
        FUN_14027bf00(local_res18,*(undefined8 *)(lVar2 + 0x28),*(undefined8 *)(lVar2 + 0x30),lVar2)
        ;
        FUN_14027b6d0(lVar2);
        goto LAB_14020fddb;
      }
    }
    else {
      iVar4 = DAT_140608164 + 1;
      bVar5 = DAT_140608164 == 0;
      DAT_140608164 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_18) {
    if (DAT_140608168 != 0) {
      DAT_140608168 = DAT_140608168 + 1;
      return;
    }
    DAT_140608168 = DAT_140608168 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14020fddb:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar3 = (void *)*local_20;
    if (pvVar3 != (void *)0x0) {
      FUN_14027b3e0(pvVar3);
      operator_delete(pvVar3);
    }
    operator_delete(local_20);
  }
  return;
}



longlong * FUN_14020fe20(longlong param_1,longlong *param_2,longlong *param_3)

{
  int iVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  
  lVar4 = DAT_14060d130;
  lVar2 = *param_3;
  if (lVar2 == 0) {
    lVar2 = param_3[1];
    if (lVar2 == 0) {
      iVar1 = 0;
      goto LAB_14020fe4b;
    }
  }
  iVar1 = (1 - (uint)(lVar2 != 0)) - (uint)((lVar2 != 0) != 0);
LAB_14020fe4b:
  if (iVar1 == 0) {
    *param_2 = DAT_14060d130;
    param_2[1] = lVar4;
  }
  else {
    lVar2 = FUN_14020ff90(param_1 + 0x68,param_3);
    if (lVar2 == 0) {
      plVar3 = &DAT_14060d130;
    }
    else {
      plVar3 = (longlong *)(lVar2 + 0x10);
    }
    lVar4 = *plVar3;
    *param_2 = lVar4;
    param_2[1] = lVar4;
  }
  if (lVar4 != 0) {
    LOCK();
    *(int *)(lVar4 + 8) = *(int *)(lVar4 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



void thunk_FUN_14020ff10(void)

{
  FUN_14020ff10();
  return;
}



void FUN_14020feb0(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_14020ff10(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_14027b3e0(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608168 + 1;
      bVar5 = DAT_140608168 == 0;
      DAT_140608168 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



ulonglong * FUN_14020ff90(longlong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  int iVar2;
  uint uVar3;
  bool bVar4;
  
  uVar3 = *(uint *)((longlong)param_2 + 0xc) ^ (uint)param_2[1] ^ *(uint *)((longlong)param_2 + 4) ^
          (uint)*param_2;
  if (*param_1 != 0) {
    for (puVar1 = *(ulonglong **)
                   (*param_1 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
        puVar1 != (ulonglong *)0x0; puVar1 = (ulonglong *)puVar1[4]) {
      if ((uint)puVar1[5] == uVar3) {
        bVar4 = *puVar1 < *param_2;
        if ((*puVar1 == *param_2) && (bVar4 = puVar1[1] < param_2[1], puVar1[1] == param_2[1])) {
          iVar2 = 0;
        }
        else {
          iVar2 = (1 - (uint)bVar4) - (uint)(bVar4 != 0);
        }
        if (iVar2 == 0) {
          return puVar1;
        }
      }
    }
  }
  return (ulonglong *)0x0;
}



undefined8 * FUN_14020fff0(undefined8 *param_1,short *param_2,undefined8 param_3,undefined8 param_4)

{
  short sVar1;
  void *pvVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  short *psVar5;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_1402166f0();
  *param_1 = MGSCharacterPet::vftable;
  uVar3 = 0;
  *(undefined4 *)(param_1 + 0x41a) = 0;
  *(undefined1 *)((longlong)param_1 + 0x20d4) = 0;
  *(undefined8 *)((longlong)param_1 + 0x20dc) = 0;
  *(undefined8 *)((longlong)param_1 + 0x20e4) = 0;
  pvVar2 = operator_new(0xe0);
  if (pvVar2 != (void *)0x0) {
    uVar3 = FUN_1402e50b0(pvVar2);
  }
  param_1[0x41e] = uVar3;
  FUN_140215a90(param_1 + 0x41f,uVar3);
  FUN_140178e90(param_1 + 0x41e,uVar3,uVar3,param_4,uVar6);
  param_1[0x420] = 0;
  param_1[0x421] = 0;
  param_1[0x422] = 0;
  param_1[0x423] = 0;
  param_1[0x424] = 0;
  param_1[0x425] = 0;
  *(undefined2 *)(param_1 + 0x426) = 0;
  param_1[0x427] = 0;
  *(undefined1 *)(param_1 + 0x428) = 0;
  *(undefined2 *)((longlong)param_1 + 0x2142) = 0;
  param_1[0x429] = 0;
  param_1[0x42a] = 0;
  param_1[0x42b] = 0;
  param_1[0x42c] = 0;
  param_1[0x42d] = 0;
  param_1[0x42e] = 0;
  param_1[0x42f] = 0;
  uVar4 = 0xffffffffffffffff;
  psVar5 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1[0x41e] + 0x20,param_2,~uVar4 - 1);
  FUN_140001710(param_1 + 0x294,L"respawn01",9);
  return param_1;
}



void * FUN_140210160(void *param_1,uint param_2)

{
  FUN_140210190();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140210190(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = MGSCharacterPet::vftable;
  plVar3 = (longlong *)param_1[0x42e];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x42c];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x42a];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x41f];
  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);
      }
    }
  }
  FUN_1402172a0(param_1);
  return;
}



void FUN_140210280(longlong *param_1)

{
  int *piVar1;
  short sVar2;
  uint uVar3;
  longlong lVar4;
  undefined8 uVar5;
  longlong *plVar6;
  longlong lVar7;
  uint *puVar8;
  ulonglong uVar9;
  undefined2 *puVar10;
  longlong lVar11;
  short *psVar12;
  float fVar13;
  undefined2 local_98;
  undefined6 uStack_96;
  undefined8 local_88;
  ulonglong local_80;
  undefined1 local_70 [8];
  longlong *local_68;
  undefined1 local_60 [8];
  longlong *local_58;
  longlong *local_48;
  undefined1 local_40 [8];
  longlong *local_38;
  undefined8 local_30;
  undefined1 local_28 [8];
  longlong *local_20;
  
  local_30 = 0xfffffffffffffffe;
  uVar5 = FUN_1402ef030(DAT_140608068,local_28,(int)param_1[0x24]);
  FUN_140343ec0(param_1 + 0x26,uVar5);
  if (local_20 != (longlong *)0x0) {
    LOCK();
    plVar6 = local_20 + 1;
    *(int *)plVar6 = (int)*plVar6 + -1;
    UNLOCK();
    if ((int)*plVar6 == 0) {
      (**(code **)(*local_20 + 8))(local_20);
      LOCK();
      piVar1 = (int *)((longlong)local_20 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_20 + 0x10))(local_20);
      }
    }
  }
  if (param_1[0x26] != 0) {
    FUN_140217c30(param_1);
    lVar4 = *(longlong *)(param_1[0x26] + 0x930);
    if (lVar4 != 0) {
      *(undefined2 *)((longlong)param_1 + 0x2142) = *(undefined2 *)(lVar4 + 0x268);
      plVar6 = (longlong *)FUN_14020e690(DAT_140608068);
      uVar3 = *(uint *)(lVar4 + 0x30);
      lVar11 = *(longlong *)*plVar6;
      if (lVar11 != 0) {
        for (puVar8 = *(uint **)(lVar11 + ((ulonglong)uVar3 %
                                          (ulonglong)*(uint *)((longlong *)*plVar6 + 2)) * 8);
            puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 6)) {
          if ((puVar8[8] == uVar3) && (*puVar8 == uVar3)) {
            if (puVar8 != (uint *)0x0) {
              if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              lVar11 = *(longlong *)(puVar8 + 2);
              goto LAB_1402103a3;
            }
            break;
          }
        }
      }
      lVar11 = 0;
LAB_1402103a3:
      if (local_48 != (longlong *)0x0) {
        LOCK();
        plVar6 = local_48 + 1;
        *(int *)plVar6 = (int)*plVar6 + -1;
        UNLOCK();
        if ((int)*plVar6 == 0) {
          (**(code **)(*local_48 + 8))(local_48);
          LOCK();
          piVar1 = (int *)((longlong)local_48 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_48 + 0x10))(local_48);
          }
        }
      }
      if (lVar11 != 0) {
        lVar7 = (**(code **)(*param_1 + 0x280))(param_1);
        *(longlong *)(lVar7 + 0xd8) = lVar11;
      }
      plVar6 = (longlong *)(lVar4 + 0x138);
      if (7 < *(ulonglong *)(lVar4 + 0x150)) {
        plVar6 = (longlong *)*plVar6;
      }
      uVar5 = FUN_1402f12b0(DAT_140608068,local_70,plVar6);
      FUN_140343ec0(param_1 + 0x429,uVar5);
      if (local_68 != (longlong *)0x0) {
        LOCK();
        plVar6 = local_68 + 1;
        *(int *)plVar6 = (int)*plVar6 + -1;
        UNLOCK();
        if ((int)*plVar6 == 0) {
          (**(code **)(*local_68 + 8))(local_68);
          LOCK();
          piVar1 = (int *)((longlong)local_68 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_68 + 0x10))(local_68);
          }
        }
      }
      plVar6 = (longlong *)(lVar4 + 0x160);
      if (7 < *(ulonglong *)(lVar4 + 0x178)) {
        plVar6 = (longlong *)*plVar6;
      }
      uVar5 = FUN_1402f15c0(DAT_140608068,local_60,plVar6);
      FUN_140343ec0(param_1 + 0x42b,uVar5);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar6 = local_58 + 1;
        *(int *)plVar6 = (int)*plVar6 + -1;
        UNLOCK();
        if ((int)*plVar6 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      psVar12 = (short *)(lVar4 + 0x200);
      if (7 < *(ulonglong *)(lVar4 + 0x218)) {
        psVar12 = *(short **)psVar12;
      }
      if ((psVar12 != (short *)0x0) && (*psVar12 != 0)) {
        uVar5 = FUN_1402f1900(DAT_140608068,local_40);
        FUN_140343ec0(param_1 + 0x42d,uVar5);
        if (local_38 != (longlong *)0x0) {
          LOCK();
          plVar6 = local_38 + 1;
          *(int *)plVar6 = (int)*plVar6 + -1;
          UNLOCK();
          if ((int)*plVar6 == 0) {
            (**(code **)(*local_38 + 8))(local_38);
            LOCK();
            piVar1 = (int *)((longlong)local_38 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*local_38 + 0x10))(local_38);
            }
          }
        }
      }
      lVar4 = param_1[0x26];
      if ((int)(*(longlong *)(lVar4 + 0x350) - *(longlong *)(lVar4 + 0x348) >> 2) < 1) {
        fVar13 = 0.0;
      }
      else {
        fVar13 = **(float **)(lVar4 + 0x348);
      }
      param_1[0x28a] = (longlong)(double)fVar13;
      plVar6 = (longlong *)(lVar4 + 0x28);
      if (7 < *(ulonglong *)(lVar4 + 0x40)) {
        plVar6 = (longlong *)*plVar6;
      }
      local_80 = 7;
      local_88 = 0;
      local_98 = 0;
      uVar9 = 0xffffffffffffffff;
      psVar12 = (short *)plVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar2 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_98,plVar6,~uVar9 - 1);
      FUN_140002aa0(&local_98,L"_server",7);
      puVar10 = &local_98;
      if (7 < local_80) {
        puVar10 = (undefined2 *)CONCAT62(uStack_96,local_98);
      }
      (**(code **)(*param_1 + 0x8d8))(param_1,puVar10);
      if (param_1[0x3d0] == 0) {
        param_1[0xa2] = 0;
      }
      else {
        param_1[0xa2] = *(longlong *)(param_1[0x3d0] + 0x68);
      }
      *(int *)(param_1 + 0x41b) = (int)param_1[0xb3];
      if (7 < local_80) {
        operator_delete((void *)CONCAT62(uStack_96,local_98));
      }
    }
  }
  return;
}



void FUN_140210620(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  undefined1 local_20 [8];
  longlong *local_18;
  
  uVar3 = FUN_1402ef030(DAT_140608068,local_20,*(undefined4 *)(param_1 + 0x120),param_4,
                        0xfffffffffffffffe);
  FUN_140343ec0(param_1 + 0x130,uVar3);
  if (local_18 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_18 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_18 + 8))(local_18);
      LOCK();
      piVar2 = (int *)((longlong)local_18 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_18 + 0x10))(local_18);
      }
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140217fc2)
// WARNING: Removing unreachable block (ram,0x000140217fd0)

void thunk_FUN_140217f50(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *(undefined8 *)(param_1 + 0xed0) = 0;
  plVar3 = *(longlong **)(param_1 + 0xed8);
  *(undefined8 *)(param_1 + 0xed8) = 0;
  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);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2008) != *(longlong *)(param_1 + 0x2010)) {
    *(longlong *)(param_1 + 0x2010) = *(longlong *)(param_1 + 0x2008);
  }
  FUN_1402f7620(param_1);
  return;
}



undefined8 FUN_1402106b0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x20f0);
}



void FUN_1402106c0(longlong param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  
  *(undefined4 *)(param_1 + 0xfb0) = *param_2;
  *(undefined4 *)(param_1 + 0xfb4) = param_2[1];
  *(undefined4 *)(param_1 + 0xfb8) = param_2[2];
  *(undefined4 *)(param_1 + 0xfbc) = param_2[3];
  puVar1 = *(undefined4 **)(param_1 + 0x20f0);
  *puVar1 = *param_2;
  puVar1[1] = param_2[1];
  puVar1[2] = param_2[2];
  puVar1[3] = param_2[3];
  return;
}



bool FUN_140210710(longlong param_1,int param_2,undefined1 param_3)

{
  int iVar1;
  char cVar2;
  
  iVar1 = *(int *)(param_1 + 300);
  if (iVar1 == 0x25) {
    return true;
  }
  if (param_2 == 0x25) {
    if (*(char *)(*(longlong *)(param_1 + 0x20f0) + 0x80) == '\x01') {
      return false;
    }
    if ((iVar1 == 0) || (iVar1 == 1)) {
      if (1.0 < *(float *)(param_1 + 0x598) || *(float *)(param_1 + 0x598) == 1.0) {
        return false;
      }
      FUN_140218710(param_1);
      return false;
    }
    FUN_140214cb0(param_1,*(undefined4 *)(*(longlong *)(param_1 + 0x13d8) + 0x30));
  }
  if (*(char *)(param_1 + 0x20d4) == '\x01') {
    return false;
  }
  cVar2 = FUN_14021efc0(param_1,param_2,param_3);
  return cVar2 != '\0';
}



ulonglong FUN_1402107d0(longlong param_1,uint param_2,uint param_3,int *param_4)

{
  uint uVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  int iVar6;
  ulonglong in_RAX;
  uint *puVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  longlong lVar10;
  float fVar11;
  float fVar12;
  
  lVar2 = *(longlong *)(param_1 + 0x2148);
  uVar9 = (ulonglong)param_3;
  if ((lVar2 == 0) || (lVar10 = *(longlong *)(param_1 + 0x2158), lVar10 == 0)) {
    return in_RAX & 0xffffffffffffff00;
  }
  if (*(longlong *)(lVar2 + 0x38) != 0) {
    for (puVar7 = *(uint **)(*(longlong *)(lVar2 + 0x38) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar2 + 0x48)) * 8);
        puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 6)) {
      if ((puVar7[8] == param_2) && (*puVar7 == param_2)) {
        if (puVar7 != (uint *)0x0) goto LAB_14021083d;
        break;
      }
    }
  }
  puVar7 = (uint *)0x0;
LAB_14021083d:
  if ((puVar7 != (uint *)0x0) && (lVar2 = *(longlong *)(puVar7 + 2), lVar2 != 0)) {
    uVar8 = *(ulonglong *)(param_1 + 0x130);
    puVar7 = (uint *)0x0;
    if (uVar8 != 0) {
      lVar3 = *(longlong *)(uVar8 + 0x930);
      if (lVar3 != 0) {
        uVar1 = *(uint *)(*(longlong *)(param_1 + 0x20f0) + 0x4c);
        uVar8 = (ulonglong)uVar1;
        if ((0 < (int)uVar1) && ((int)uVar1 < *(int *)(lVar10 + 0x38))) {
          uVar8 = (ulonglong)(uVar1 - 1);
          lVar10 = (longlong)(int)(uVar1 - 1) * 0x80 + *(longlong *)(lVar10 + 0x40);
          if (lVar10 != 0) {
            if (0 < (int)param_3) {
              do {
                if (*(char *)(lVar3 + 0x17) != '\0') {
                  fVar11 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  iVar5 = *(int *)(lVar10 + 0x10);
                  *(int *)(lVar4 + 0x84) = *(int *)(lVar4 + 0x84) + (int)fVar11;
                  if (iVar5 < *(int *)(lVar4 + 0x84)) {
                    *(int *)(lVar4 + 0x84) = iVar5;
                  }
                  iVar5 = *(int *)(lVar4 + 0x84);
                  if (iVar5 < 0) {
                    iVar5 = 1;
                  }
                  *(int *)(lVar4 + 0x84) = iVar5;
                }
                if (*(char *)(lVar3 + 0x18) != '\0') {
                  fVar11 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  iVar5 = *(int *)(lVar10 + 0x14);
                  *(int *)(lVar4 + 0x88) = *(int *)(lVar4 + 0x88) + (int)fVar11;
                  if (iVar5 < *(int *)(lVar4 + 0x88)) {
                    *(int *)(lVar4 + 0x88) = iVar5;
                  }
                  iVar5 = *(int *)(lVar4 + 0x88);
                  if (iVar5 < 0) {
                    iVar5 = 1;
                  }
                  *(int *)(lVar4 + 0x88) = iVar5;
                }
                if (*(char *)(lVar3 + 0x19) != '\0') {
                  fVar11 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  iVar5 = *(int *)(lVar10 + 0x18);
                  *(int *)(lVar4 + 0x8c) = *(int *)(lVar4 + 0x8c) + (int)fVar11;
                  if (iVar5 < *(int *)(lVar4 + 0x8c)) {
                    *(int *)(lVar4 + 0x8c) = iVar5;
                  }
                  iVar5 = *(int *)(lVar4 + 0x8c);
                  if (iVar5 < 0) {
                    iVar5 = 1;
                  }
                  *(int *)(lVar4 + 0x8c) = iVar5;
                }
                if (*(char *)(lVar3 + 0x1a) != '\0') {
                  fVar11 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  iVar5 = *(int *)(lVar10 + 0x1c);
                  *(int *)(lVar4 + 0x90) = *(int *)(lVar4 + 0x90) + (int)fVar11;
                  if (iVar5 < *(int *)(lVar4 + 0x90)) {
                    *(int *)(lVar4 + 0x90) = iVar5;
                  }
                  iVar5 = *(int *)(lVar4 + 0x90);
                  if (iVar5 < 0) {
                    iVar5 = 1;
                  }
                  *(int *)(lVar4 + 0x90) = iVar5;
                }
                if (*(char *)(lVar3 + 0x1b) != '\0') {
                  fVar11 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  iVar5 = *(int *)(lVar10 + 0x20);
                  *(int *)(lVar4 + 0x94) = *(int *)(lVar4 + 0x94) + (int)fVar11;
                  if (iVar5 < *(int *)(lVar4 + 0x94)) {
                    *(int *)(lVar4 + 0x94) = iVar5;
                  }
                  iVar5 = *(int *)(lVar4 + 0x94);
                  if (iVar5 < 0) {
                    iVar5 = 1;
                  }
                  *(int *)(lVar4 + 0x94) = iVar5;
                }
                if (*(char *)(lVar3 + 0x1c) != '\0') {
                  fVar11 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  iVar5 = *(int *)(lVar10 + 0x24);
                  *(int *)(lVar4 + 0x98) = *(int *)(lVar4 + 0x98) + (int)fVar11;
                  if (iVar5 < *(int *)(lVar4 + 0x98)) {
                    *(int *)(lVar4 + 0x98) = iVar5;
                  }
                  iVar5 = *(int *)(lVar4 + 0x98);
                  if (iVar5 < 0) {
                    iVar5 = 1;
                  }
                  *(int *)(lVar4 + 0x98) = iVar5;
                }
                if (*(char *)(lVar3 + 0x1d) != '\0') {
                  fVar11 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  iVar5 = *(int *)(lVar10 + 0x28);
                  *(int *)(lVar4 + 0x9c) = *(int *)(lVar4 + 0x9c) + (int)fVar11;
                  if (iVar5 < *(int *)(lVar4 + 0x9c)) {
                    *(int *)(lVar4 + 0x9c) = iVar5;
                  }
                  iVar5 = *(int *)(lVar4 + 0x9c);
                  if (iVar5 < 0) {
                    iVar5 = 1;
                  }
                  *(int *)(lVar4 + 0x9c) = iVar5;
                }
                if (*(char *)(lVar3 + 0x1e) != '\0') {
                  fVar12 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  fVar11 = *(float *)(lVar10 + 0x2c);
                  fVar12 = fVar12 + *(float *)(lVar4 + 0xa0);
                  *(float *)(lVar4 + 0xa0) = fVar12;
                  if (fVar11 < fVar12) {
                    *(float *)(lVar4 + 0xa0) = fVar11;
                  }
                  if (*(float *)(lVar4 + 0xa0) <= 0.0 && *(float *)(lVar4 + 0xa0) != 0.0) {
                    *(undefined4 *)(lVar4 + 0xa0) = 0x3f800000;
                  }
                }
                if (*(char *)(lVar3 + 0x1f) != '\0') {
                  fVar12 = (float)FUN_140162600();
                  lVar4 = *(longlong *)(param_1 + 0x20f0);
                  fVar11 = *(float *)(lVar10 + 0x30);
                  fVar12 = fVar12 + *(float *)(lVar4 + 0xa4);
                  *(float *)(lVar4 + 0xa4) = fVar12;
                  if (fVar11 < fVar12) {
                    *(float *)(lVar4 + 0xa4) = fVar11;
                  }
                  if (*(float *)(lVar4 + 0xa4) <= 0.0 && *(float *)(lVar4 + 0xa4) != 0.0) {
                    *(undefined4 *)(lVar4 + 0xa4) = 0x3f800000;
                  }
                }
                iVar5 = FUN_14015b2f0(*(undefined4 *)(lVar2 + 0x7c),*(undefined4 *)(lVar2 + 0x80));
                *param_4 = *param_4 + iVar5;
                iVar6 = FUN_14015b2f0(*(undefined4 *)(lVar2 + 0x4c),*(undefined4 *)(lVar2 + 0x50));
                lVar4 = *(longlong *)(param_1 + 0x20f0);
                iVar5 = *(int *)(lVar10 + 0x3c);
                *(int *)(lVar4 + 0xa8) = *(int *)(lVar4 + 0xa8) + iVar6;
                if (iVar5 < *(int *)(lVar4 + 0xa8)) {
                  *(int *)(lVar4 + 0xa8) = iVar5;
                }
                iVar6 = FUN_14015b2f0(*(undefined4 *)(lVar2 + 0x54),*(undefined4 *)(lVar2 + 0x58));
                lVar4 = *(longlong *)(param_1 + 0x20f0);
                iVar5 = *(int *)(lVar10 + 0x40);
                *(int *)(lVar4 + 0xac) = *(int *)(lVar4 + 0xac) + iVar6;
                if (iVar5 < *(int *)(lVar4 + 0xac)) {
                  *(int *)(lVar4 + 0xac) = iVar5;
                }
                iVar6 = FUN_14015b2f0(*(undefined4 *)(lVar2 + 0x5c),*(undefined4 *)(lVar2 + 0x60));
                lVar4 = *(longlong *)(param_1 + 0x20f0);
                iVar5 = *(int *)(lVar10 + 0x44);
                fVar11 = (float)iVar6 + *(float *)(lVar4 + 0xb0);
                *(float *)(lVar4 + 0xb0) = fVar11;
                if ((float)iVar5 < fVar11) {
                  *(float *)(lVar4 + 0xb0) = (float)iVar5;
                }
                iVar6 = FUN_14015b2f0(*(undefined4 *)(lVar2 + 100),*(undefined4 *)(lVar2 + 0x68));
                lVar4 = *(longlong *)(param_1 + 0x20f0);
                iVar5 = *(int *)(lVar10 + 0x48);
                fVar11 = (float)iVar6 + *(float *)(lVar4 + 0xb4);
                *(float *)(lVar4 + 0xb4) = fVar11;
                if ((float)iVar5 < fVar11) {
                  *(float *)(lVar4 + 0xb4) = (float)iVar5;
                }
                iVar6 = FUN_14015b2f0(*(undefined4 *)(lVar2 + 0x6c),*(undefined4 *)(lVar2 + 0x70));
                lVar4 = *(longlong *)(param_1 + 0x20f0);
                iVar5 = *(int *)(lVar10 + 0x4c);
                fVar11 = (float)iVar6 + *(float *)(lVar4 + 0xb8);
                *(float *)(lVar4 + 0xb8) = fVar11;
                if ((float)iVar5 < fVar11) {
                  *(float *)(lVar4 + 0xb8) = (float)iVar5;
                }
                iVar6 = FUN_14015b2f0(*(undefined4 *)(lVar2 + 0x74),*(undefined4 *)(lVar2 + 0x78));
                lVar4 = *(longlong *)(param_1 + 0x20f0);
                iVar5 = *(int *)(lVar10 + 0x50);
                fVar11 = (float)iVar6 + *(float *)(lVar4 + 0xbc);
                *(float *)(lVar4 + 0xbc) = fVar11;
                if ((float)iVar5 < fVar11) {
                  *(float *)(lVar4 + 0xbc) = (float)iVar5;
                }
                fVar12 = (float)FUN_140162600();
                uVar8 = *(ulonglong *)(param_1 + 0x20f0);
                fVar11 = *(float *)(lVar10 + 0x54);
                fVar12 = fVar12 + *(float *)(uVar8 + 0xc0);
                *(float *)(uVar8 + 0xc0) = fVar12;
                if (fVar11 < fVar12) {
                  *(float *)(uVar8 + 0xc0) = fVar11;
                }
                uVar9 = uVar9 - 1;
              } while (uVar9 != 0);
            }
            return CONCAT71((int7)(uVar8 >> 8),1);
          }
        }
      }
      return uVar8 & 0xffffffffffffff00;
    }
  }
  return (ulonglong)puVar7 & 0xffffffffffffff00;
}



void FUN_140210da0(longlong *param_1,double param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  if ((param_1[0x41e] == 0) || (*(char *)(param_1[0x41e] + 0x80) != '\x01')) {
    FUN_140219610();
    if ((*(float *)(param_1 + 0xb3) <= 1.0 && *(float *)(param_1 + 0xb3) != 1.0) &&
       (*(int *)((longlong)param_1 + 300) != 0x25)) {
      (**(code **)(*param_1 + 200))(param_1);
    }
    plVar2 = (longlong *)param_1[0x3e1];
    if (plVar2 != (longlong *)param_1[0x3e2]) {
      do {
        lVar1 = *plVar2;
        plVar2 = plVar2 + 1;
        *(undefined8 *)(lVar1 + 0x40) = 0;
      } while (plVar2 != (longlong *)param_1[0x3e2]);
    }
    plVar2 = (longlong *)param_1[0x3e5];
    if (plVar2 != (longlong *)param_1[0x3e6]) {
      do {
        lVar1 = *plVar2;
        plVar2 = plVar2 + 1;
        *(undefined8 *)(lVar1 + 0x40) = 0;
      } while (plVar2 != (longlong *)param_1[0x3e6]);
    }
    plVar2 = (longlong *)param_1[0x3e9];
    if (plVar2 != (longlong *)param_1[0x3ea]) {
      do {
        lVar1 = *plVar2;
        plVar2 = plVar2 + 1;
        *(undefined8 *)(lVar1 + 0x40) = 0;
      } while (plVar2 != (longlong *)param_1[0x3ea]);
    }
    plVar2 = (longlong *)param_1[0x3f1];
    if (plVar2 != (longlong *)param_1[0x3f2]) {
      do {
        lVar1 = *plVar2;
        plVar2 = plVar2 + 1;
        *(undefined8 *)(lVar1 + 0x40) = 0;
      } while (plVar2 != (longlong *)param_1[0x3f2]);
    }
    plVar2 = (longlong *)param_1[0x3f5];
    if (plVar2 != (longlong *)param_1[0x3f6]) {
      do {
        lVar1 = *plVar2;
        plVar2 = plVar2 + 1;
        *(undefined8 *)(lVar1 + 0x40) = 0;
      } while (plVar2 != (longlong *)param_1[0x3f6]);
    }
    plVar2 = (longlong *)param_1[0x3ed];
    if (plVar2 != (longlong *)param_1[0x3ee]) {
      do {
        lVar1 = *plVar2;
        plVar2 = plVar2 + 1;
        *(undefined8 *)(lVar1 + 0x40) = 0;
      } while (plVar2 != (longlong *)param_1[0x3ee]);
    }
    plVar2 = (longlong *)param_1[0x3f9];
    if (plVar2 != (longlong *)param_1[0x3fa]) {
      do {
        lVar1 = *plVar2;
        plVar2 = plVar2 + 1;
        *(undefined8 *)(lVar1 + 0x40) = 0;
      } while (plVar2 != (longlong *)param_1[0x3fa]);
    }
    if ((DAT_1405dfc58 <= param_2 - (double)param_1[0x427]) || ((char)param_1[0x428] == '\x01')) {
      param_1[0x427] = (longlong)param_2;
      *(undefined1 *)(param_1 + 0x428) = 0;
      if (*(char *)((longlong)param_1 + 0x607) != '\0') {
        FUN_140214a00(param_1);
      }
      if (*(char *)((longlong)param_1 + 0x605) != '\0') {
        FUN_140214b00(param_1);
      }
      if ((char)param_1[0x219] != '\0') {
        FUN_140214be0(param_1);
        *(undefined1 *)(param_1 + 0x219) = 0;
      }
    }
    FUN_1402141e0(param_1);
  }
  return;
}



void FUN_140210f90(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  double dVar1;
  longlong lVar2;
  longlong *plVar3;
  float fVar4;
  float fVar5;
  float local_48;
  uint local_44;
  float local_40;
  float local_38;
  uint local_34;
  float local_30;
  
  lVar2 = (**(code **)(*param_1 + 0x4a8))();
  if (lVar2 != 0) {
    lVar2 = (**(code **)(*param_1 + 0x4a8))(param_1);
    if (*(int *)(lVar2 + 300) != 2) {
      plVar3 = (longlong *)(**(code **)(*param_1 + 0x4a8))(param_1);
      dVar1 = (double)(**(code **)(*plVar3 + 0x2d0))(plVar3);
      *(float *)((longlong)param_1 + 0x212c) = (float)dVar1;
    }
    fVar4 = 300.0;
    if (300.0 <= *(float *)((longlong)param_1 + 0x212c)) {
      fVar4 = *(float *)((longlong)param_1 + 0x212c);
    }
    FUN_1402c5d90(param_1[0x27b],fVar4);
    lVar2 = (**(code **)(*param_1 + 0x4a8))(param_1);
    fVar5 = *(float *)(lVar2 + 0x178) - *(float *)(param_1 + 0x2f);
    fVar4 = *(float *)(lVar2 + 0x180) - *(float *)(param_1 + 0x30);
    if (40000.0 <= fVar4 * fVar4 + fVar5 * fVar5) {
      if ((62500.0 <= fVar4 * fVar4 + fVar5 * fVar5) || (*(int *)((longlong)param_1 + 300) != 2)) {
        if (250000.0 <= fVar4 * fVar4 + fVar5 * fVar5) {
          *(undefined4 *)((longlong)param_1 + 0x212c) = 0x44bb8000;
        }
        fVar4 = *(float *)(lVar2 + 0x178) - *(float *)(param_1 + 0x2f);
        fVar5 = *(float *)(lVar2 + 0x180) - *(float *)(param_1 + 0x30);
        if (9e+06 <= fVar5 * fVar5 + fVar4 * fVar4) {
          *(undefined4 *)(param_1 + 0x2f) = *(undefined4 *)(lVar2 + 0x178);
          *(undefined4 *)((longlong)param_1 + 0x17c) = *(undefined4 *)(lVar2 + 0x17c);
          *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(lVar2 + 0x180);
        }
        local_48 = *(float *)(lVar2 + 0x178) - *(float *)(param_1 + 0x2f);
        local_40 = *(float *)(lVar2 + 0x180) - *(float *)(param_1 + 0x30);
        local_44 = 0;
        D3DXVec3Normalize(&local_48,&local_48);
        local_38 = -local_48;
        local_34 = local_44 ^ 0x80000000;
        local_30 = -local_40;
        *(float *)((longlong)param_1 + 0x154) = local_38;
        *(float *)(param_1 + 0x2c) = local_38;
        *(float *)((longlong)param_1 + 0x133c) = local_38;
        *(float *)(param_1 + 0x269) = local_38;
        *(uint *)(param_1 + 0x2b) = local_34;
        *(uint *)((longlong)param_1 + 0x164) = local_34;
        *(uint *)(param_1 + 0x268) = local_34;
        *(uint *)((longlong)param_1 + 0x134c) = local_34;
        *(float *)((longlong)param_1 + 0x15c) = local_30;
        *(float *)(param_1 + 0x2d) = local_30;
        *(float *)((longlong)param_1 + 0x1344) = local_30;
        *(float *)(param_1 + 0x26a) = local_30;
        (**(code **)(*param_1 + 0x1f0))(param_1);
        (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
      }
    }
    else {
      lVar2 = (**(code **)(*param_1 + 0x4a8))(param_1);
      if (*(int *)(lVar2 + 300) == 2) {
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
        return;
      }
    }
  }
  return;
}



void FUN_140211260(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  float *pfVar1;
  ulonglong uVar2;
  longlong lVar3;
  char cVar4;
  uint uVar5;
  int iVar6;
  longlong lVar7;
  ushort *puVar8;
  ushort *puVar9;
  ulonglong uVar10;
  float fVar11;
  float fVar12;
  undefined4 uVar13;
  float fVar14;
  undefined4 in_stack_ffffffffffffffa8;
  uint3 uVar15;
  
  lVar7 = (**(code **)(*param_1 + 0x4a8))();
  if (lVar7 == 0) {
    return;
  }
  if ((char)param_1[0xc0] == '\0') {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  lVar7 = (**(code **)(*param_1 + 0x4a8))(param_1);
  pfVar1 = (float *)(param_1 + 0x2f);
  fVar14 = *(float *)(lVar7 + 0x17c) - *(float *)((longlong)param_1 + 0x17c);
  fVar11 = *(float *)(lVar7 + 0x180) - *(float *)(param_1 + 0x30);
  fVar12 = *(float *)(lVar7 + 0x178) - *pfVar1;
  if (9e+06 <= fVar14 * fVar14 + fVar12 * fVar12 + fVar11 * fVar11) {
    *pfVar1 = *(float *)(lVar7 + 0x178);
    *(undefined4 *)((longlong)param_1 + 0x17c) = *(undefined4 *)(lVar7 + 0x17c);
    *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(lVar7 + 0x180);
  }
  iVar6 = *(int *)((longlong)param_1 + 0x13fc);
  if (iVar6 == 0) {
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 1;
    return;
  }
  if (iVar6 == 1) {
    *(undefined1 *)(param_1 + 0xc0) = 1;
    FUN_14032e070(param_1[0x1da],pfVar1,param_1 + 0x422,param_2,
                  ABS(*(float *)((longlong)param_1 + 0x2114) - *(float *)((longlong)param_1 + 0x17c)
                     ) * 1.5,0x42340000,*(float *)(param_1 + 0x395) * 2.0,(int)param_1[0x3c5]);
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 2;
    *(undefined4 *)(param_1 + 0xb7) = 0;
    param_1[0x28a] = 0;
    return;
  }
  uVar15 = (uint3)((uint)in_stack_ffffffffffffffa8 >> 8);
  if (iVar6 == 2) {
    cVar4 = FUN_14032e2b0(param_1[0x1da],param_2,param_3,*(float *)(param_1 + 0x395) * 2.0,
                          (uint)uVar15 << 8);
    if (cVar4 == '\0') goto LAB_1402116e1;
    lVar7 = param_1[0x27b];
    uVar2 = *(ulonglong *)(lVar7 + 0x50);
    if (*(ulonglong *)(lVar7 + 0x58) < 8) {
      puVar8 = (ushort *)(lVar7 + 0x40);
    }
    else {
      puVar8 = *(ushort **)(lVar7 + 0x40);
    }
    puVar9 = &DAT_1404ac548;
    uVar10 = 8;
    if (uVar2 < 8) {
      uVar10 = uVar2;
    }
    uVar5 = 0;
    iVar6 = 0;
    for (; uVar10 != 0; uVar10 = uVar10 - 1) {
      if (*puVar8 != *puVar9) {
        uVar5 = 1;
        if (*puVar8 < *puVar9) {
          uVar5 = 0xffffffff;
        }
        break;
      }
      puVar8 = puVar8 + 1;
      puVar9 = puVar9 + 1;
    }
    if (uVar5 == 0) {
      if (7 < uVar2) {
        uVar5 = (uint)(uVar2 != 8);
        goto LAB_1402115fb;
      }
LAB_1402115ff:
      FUN_140001710(lVar7 + 0x40,&DAT_1404ac548,8);
      if (*(longlong *)(lVar7 + 0x10) != 0) {
        lVar3 = *(longlong *)(*(longlong *)(lVar7 + 0x10) + 0xd8);
        if (lVar3 != 0) {
          iVar6 = FUN_1402ce620(lVar3,&DAT_1404ac548);
          iVar6 = iVar6 + 1;
        }
        FUN_1402c5c00(lVar7,iVar6,0,0);
      }
    }
    else {
LAB_1402115fb:
      if (uVar5 != 0) goto LAB_1402115ff;
    }
    FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
    if (param_1[0x16f] == 0) {
      uVar13 = 0x3f800000;
    }
    else {
      uVar13 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar13);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar7 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar7 + 0x54) == 1) {
      *(undefined8 *)(lVar7 + 0x10) = param_2;
      FUN_1402cc2c0(lVar7);
    }
    *(undefined4 *)(lVar7 + 0x54) = 0;
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 3;
    goto LAB_1402116e1;
  }
  if (iVar6 != 3) {
    if (iVar6 != 4) {
      return;
    }
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) {
      return;
    }
    FUN_14021eb20(param_1,0,0);
    return;
  }
  cVar4 = FUN_14032e4a0(param_1[0x1da],param_2,param_3,*(float *)(param_1 + 0x395) * 2.0,
                        (uint)uVar15 << 8);
  if (cVar4 == '\0') goto LAB_1402116e1;
  lVar7 = param_1[0x27b];
  uVar5 = 0;
  iVar6 = 0;
  *(undefined4 *)(param_1 + 0xb7) = 0;
  param_1[0x28a] = 0;
  *(undefined1 *)(param_1 + 0xc0) = 0;
  uVar2 = *(ulonglong *)(lVar7 + 0x50);
  if (*(ulonglong *)(lVar7 + 0x58) < 8) {
    puVar8 = (ushort *)(lVar7 + 0x40);
  }
  else {
    puVar8 = *(ushort **)(lVar7 + 0x40);
  }
  puVar9 = &DAT_1404ac560;
  uVar10 = 8;
  if (uVar2 < 8) {
    uVar10 = uVar2;
  }
  for (; uVar10 != 0; uVar10 = uVar10 - 1) {
    if (*puVar8 != *puVar9) {
      uVar5 = 1;
      if (*puVar8 < *puVar9) {
        uVar5 = 0xffffffff;
      }
      break;
    }
    puVar8 = puVar8 + 1;
    puVar9 = puVar9 + 1;
  }
  if (uVar5 == 0) {
    if (7 < uVar2) {
      uVar5 = (uint)(uVar2 != 8);
      goto LAB_140211472;
    }
LAB_140211476:
    FUN_140001710(lVar7 + 0x40,&DAT_1404ac560,8);
    if (*(longlong *)(lVar7 + 0x10) != 0) {
      lVar3 = *(longlong *)(*(longlong *)(lVar7 + 0x10) + 0xd8);
      if (lVar3 != 0) {
        iVar6 = FUN_1402ce620(lVar3,&DAT_1404ac560);
        iVar6 = iVar6 + 1;
      }
      FUN_1402c5c00(lVar7,iVar6,0,0);
    }
  }
  else {
LAB_140211472:
    if (uVar5 != 0) goto LAB_140211476;
  }
  FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
  if (param_1[0x16f] == 0) {
    uVar13 = 0x3f800000;
  }
  else {
    uVar13 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
  }
  FUN_1402c5e50(param_1[0x27b],uVar13);
  *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
  lVar7 = *(longlong *)(param_1[0x27b] + 0x20);
  if (*(int *)(lVar7 + 0x54) == 1) {
    *(undefined8 *)(lVar7 + 0x10) = param_2;
    FUN_1402cc2c0(lVar7);
  }
  *(undefined4 *)(lVar7 + 0x54) = 0;
  *(undefined4 *)((longlong)param_1 + 0x13fc) = 4;
LAB_1402116e1:
  if (*(char *)((longlong)param_1 + 0x1824) == '\0') {
    uVar13 = *(undefined4 *)((longlong)param_1 + 0x17c);
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    *(undefined4 *)((longlong)param_1 + 0x17c) = uVar13;
  }
  return;
}



void FUN_1402117e0(longlong *param_1,undefined8 param_2,double param_3)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  undefined8 in_RDX;
  undefined8 in_R8;
  float fVar4;
  float local_48;
  float local_44;
  float local_40;
  float local_38;
  float local_34;
  float local_30;
  
  if ((int)param_1[0x425] == 0) {
    local_48 = *(float *)(param_1 + 0x420) - *(float *)(param_1 + 0x2f);
    local_40 = *(float *)(param_1 + 0x421) - *(float *)(param_1 + 0x30);
    local_44 = 0.0;
    D3DXVec3Normalize(&local_48,&local_48);
    fVar4 = (float)param_3 * 800.0;
    local_48 = local_48 * fVar4;
    local_44 = local_44 * fVar4;
    local_40 = local_40 * fVar4;
    *(float *)(param_1 + 0x2f) = local_48 + *(float *)(param_1 + 0x2f);
    *(float *)((longlong)param_1 + 0x17c) = local_44 + *(float *)((longlong)param_1 + 0x17c);
    *(float *)(param_1 + 0x30) = local_40 + *(float *)(param_1 + 0x30);
    local_38 = -local_48;
    local_34 = -local_44;
    local_30 = -local_40;
    *(float *)((longlong)param_1 + 0x154) = local_38;
    *(float *)(param_1 + 0x2b) = local_34;
    *(float *)((longlong)param_1 + 0x15c) = local_30;
    D3DXVec3Normalize((longlong)param_1 + 0x154,(longlong)param_1 + 0x154);
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
    *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
    (**(code **)(*param_1 + 0x1f0))(param_1);
    fVar4 = *(float *)((longlong)param_1 + 0x17c) - *(float *)((longlong)param_1 + 0x2104);
    fVar4 = fVar4 * fVar4 +
            (*(float *)(param_1 + 0x2f) - *(float *)(param_1 + 0x420)) *
            (*(float *)(param_1 + 0x2f) - *(float *)(param_1 + 0x420)) +
            (*(float *)(param_1 + 0x30) - *(float *)(param_1 + 0x421)) *
            (*(float *)(param_1 + 0x30) - *(float *)(param_1 + 0x421));
    if ((*(float *)((longlong)param_1 + 0x210c) <= fVar4 &&
         fVar4 != *(float *)((longlong)param_1 + 0x210c)) ||
       (*(float *)((longlong)param_1 + 0x210c) = fVar4, fVar4 < 1600.0)) {
      lVar1 = param_1[0x27b];
      *(undefined4 *)(param_1 + 0x425) = 1;
      FUN_140001710(lVar1 + 0x40,L"pickup01",8);
      if (*(longlong *)(lVar1 + 0x10) != 0) {
        lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0xd8);
        if (lVar2 == 0) {
          iVar3 = 0;
        }
        else {
          iVar3 = FUN_1402ce620(lVar2,L"pickup01");
          iVar3 = iVar3 + 1;
        }
        FUN_1402c5c00(lVar1,iVar3,0,1);
      }
      FUN_1402c5e50(param_1[0x27b],0x3f800000);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar1 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar1 + 0x54) == 1) {
        *(longlong *)(lVar1 + 0x10) = param_1[0xa2];
        FUN_1402cc2c0(lVar1);
      }
      *(undefined4 *)(lVar1 + 0x54) = 0;
      fVar4 = (float)FUN_1402c5ee0(param_1[0x27b]);
      param_1[0x28a] = (longlong)(double)fVar4;
    }
  }
  else if ((int)param_1[0x425] == 1) {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,in_R8,1);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      FUN_14021eb20(param_1,0,0);
    }
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_140211b40(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  ulonglong uVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  longlong lVar6;
  ushort *puVar7;
  uint uVar8;
  ulonglong uVar9;
  ushort *puVar10;
  undefined4 uVar11;
  undefined4 in_stack_ffffffffffffffa8;
  uint3 uVar12;
  
  lVar6 = (**(code **)(*param_1 + 0x4a8))();
  if (lVar6 == 0) {
    return;
  }
  if ((char)param_1[0xc0] == '\0') {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  iVar4 = *(int *)((longlong)param_1 + 0x13fc);
  if (iVar4 == 0) {
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 1;
    return;
  }
  if (iVar4 == 1) {
    *(undefined1 *)(param_1 + 0xc0) = 1;
    FUN_14032e070(param_1[0x1da],param_1 + 0x2f,(longlong)param_1 + 0x211c,param_2,
                  ABS(*(float *)(param_1 + 0x424) - *(float *)((longlong)param_1 + 0x17c)) * 1.5,
                  0x42340000,*(float *)(param_1 + 0x395) * 2.0,(int)param_1[0x3c5]);
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 2;
    *(undefined4 *)(param_1 + 0xb7) = 0;
    param_1[0x28a] = 0;
    return;
  }
  uVar12 = (uint3)((uint)in_stack_ffffffffffffffa8 >> 8);
  if (iVar4 == 2) {
    cVar3 = FUN_14032e2b0(param_1[0x1da],param_2,param_3,*(float *)(param_1 + 0x395) * 2.0,
                          (uint)uVar12 << 8);
    if (cVar3 == '\0') goto LAB_140211f3f;
    lVar6 = param_1[0x27b];
    uVar1 = *(ulonglong *)(lVar6 + 0x50);
    if (*(ulonglong *)(lVar6 + 0x58) < 8) {
      puVar7 = (ushort *)(lVar6 + 0x40);
    }
    else {
      puVar7 = *(ushort **)(lVar6 + 0x40);
    }
    puVar10 = &DAT_1404ac548;
    uVar9 = 8;
    if (uVar1 < 8) {
      uVar9 = uVar1;
    }
    uVar5 = 0;
    for (; uVar8 = uVar5, uVar9 != 0; uVar9 = uVar9 - 1) {
      if (*puVar7 != *puVar10) {
        uVar8 = 1;
        if (*puVar7 < *puVar10) {
          uVar8 = 0xffffffff;
        }
        break;
      }
      puVar7 = puVar7 + 1;
      puVar10 = puVar10 + 1;
    }
    if (uVar8 == 0) {
      if (7 < uVar1) {
        uVar8 = (uint)(uVar1 != 8);
        goto LAB_140211e5a;
      }
LAB_140211e5e:
      FUN_140001710(lVar6 + 0x40,&DAT_1404ac548,8);
      if (*(longlong *)(lVar6 + 0x10) != 0) {
        lVar2 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
        if (lVar2 != 0) {
          iVar4 = FUN_1402ce620(lVar2,&DAT_1404ac548);
          uVar5 = iVar4 + 1;
        }
        FUN_1402c5c00(lVar6,uVar5,0,0);
      }
    }
    else {
LAB_140211e5a:
      if (uVar8 != 0) goto LAB_140211e5e;
    }
    FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
    if (param_1[0x16f] == 0) {
      uVar11 = 0x3f800000;
    }
    else {
      uVar11 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar11);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar6 + 0x54) == 1) {
      *(undefined8 *)(lVar6 + 0x10) = param_2;
      FUN_1402cc2c0(lVar6);
    }
    *(undefined4 *)(lVar6 + 0x54) = 0;
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 3;
    goto LAB_140211f3f;
  }
  if (iVar4 != 3) {
    if (iVar4 != 4) {
      return;
    }
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) {
      return;
    }
    FUN_14021eb20(param_1,0,0);
    return;
  }
  cVar3 = FUN_14032e4a0(param_1[0x1da],param_2,param_3,*(float *)(param_1 + 0x395) * 2.0,
                        (uint)uVar12 << 8);
  if (cVar3 == '\0') goto LAB_140211f3f;
  lVar6 = param_1[0x27b];
  uVar5 = 0;
  *(undefined4 *)(param_1 + 0xb7) = 0;
  param_1[0x28a] = 0;
  *(undefined1 *)(param_1 + 0xc0) = 0;
  uVar1 = *(ulonglong *)(lVar6 + 0x50);
  if (*(ulonglong *)(lVar6 + 0x58) < 8) {
    puVar7 = (ushort *)(lVar6 + 0x40);
  }
  else {
    puVar7 = *(ushort **)(lVar6 + 0x40);
  }
  puVar10 = &DAT_1404ac560;
  uVar9 = 8;
  if (uVar1 < 8) {
    uVar9 = uVar1;
  }
  for (; uVar9 != 0; uVar9 = uVar9 - 1) {
    if (*puVar7 != *puVar10) {
      uVar5 = 1;
      if (*puVar7 < *puVar10) {
        uVar5 = 0xffffffff;
      }
      break;
    }
    puVar7 = puVar7 + 1;
    puVar10 = puVar10 + 1;
  }
  if (uVar5 == 0) {
    if (7 < uVar1) {
      uVar5 = (uint)(uVar1 != 8);
      goto LAB_140211cda;
    }
LAB_140211cde:
    FUN_140001710(lVar6 + 0x40,&DAT_1404ac560,8);
    if (*(longlong *)(lVar6 + 0x10) != 0) {
      lVar2 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
      if (lVar2 == 0) {
        iVar4 = 0;
      }
      else {
        iVar4 = FUN_1402ce620(lVar2,&DAT_1404ac560);
        iVar4 = iVar4 + 1;
      }
      FUN_1402c5c00(lVar6,iVar4,0,0);
    }
  }
  else {
LAB_140211cda:
    if (uVar5 != 0) goto LAB_140211cde;
  }
  FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
  if (param_1[0x16f] == 0) {
    uVar11 = 0x3f800000;
  }
  else {
    uVar11 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
  }
  FUN_1402c5e50(param_1[0x27b],uVar11);
  *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
  lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
  if (*(int *)(lVar6 + 0x54) == 1) {
    *(undefined8 *)(lVar6 + 0x10) = param_2;
    FUN_1402cc2c0(lVar6);
  }
  *(undefined4 *)(lVar6 + 0x54) = 0;
  *(undefined4 *)((longlong)param_1 + 0x13fc) = 4;
LAB_140211f3f:
  if (*(char *)((longlong)param_1 + 0x1824) == '\0') {
    uVar11 = *(undefined4 *)((longlong)param_1 + 0x17c);
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    *(undefined4 *)((longlong)param_1 + 0x17c) = uVar11;
  }
  return;
}



void FUN_140212040(longlong *param_1,undefined8 param_2)

{
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))();
  FUN_140230d70(param_1,param_2);
  return;
}



undefined8 FUN_140212090(longlong param_1,float *param_2,float *param_3)

{
  float fVar1;
  float *pfVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float local_res8 [2];
  float local_res10 [2];
  
  fVar1 = param_3[1];
  fVar3 = param_3[2];
  *(float *)(param_1 + 0x154) = *(float *)(param_1 + 0x178) - *param_3;
  *(float *)(param_1 + 0x158) = *(float *)(param_1 + 0x17c) - fVar1;
  *(float *)(param_1 + 0x15c) = *(float *)(param_1 + 0x180) - fVar3;
  D3DXVec3Normalize((float *)(param_1 + 0x154),param_1 + 0x154);
  *(undefined4 *)(param_1 + 0x133c) = *(undefined4 *)(param_1 + 0x154);
  *(undefined4 *)(param_1 + 0x1340) = *(undefined4 *)(param_1 + 0x158);
  *(undefined4 *)(param_1 + 0x1344) = *(undefined4 *)(param_1 + 0x15c);
  *(undefined4 *)(param_1 + 0x160) = *(undefined4 *)(param_1 + 0x154);
  *(undefined4 *)(param_1 + 0x164) = *(undefined4 *)(param_1 + 0x158);
  *(undefined4 *)(param_1 + 0x168) = *(undefined4 *)(param_1 + 0x15c);
  *(float *)(param_1 + 0x20dc) = *param_2;
  *(float *)(param_1 + 0x20e0) = param_2[1];
  *(float *)(param_1 + 0x20e4) = param_2[2];
  fVar5 = *(float *)(param_1 + 0x17c) - param_3[1];
  fVar4 = *(float *)(param_1 + 0x178) - *param_3;
  fVar6 = (param_2[1] - param_3[1]) * (param_2[1] - param_3[1]) +
          (*param_2 - *param_3) * (*param_2 - *param_3) +
          (param_2[2] - param_3[2]) * (param_2[2] - param_3[2]);
  fVar1 = (float)(0x5f3759df - ((int)fVar6 >> 1));
  fVar1 = fVar1 * (1.5 - fVar1 * fVar1 * fVar6 * 0.5);
  fVar3 = *(float *)(param_1 + 0x180) - param_3[2];
  fVar4 = fVar5 * fVar5 + fVar4 * fVar4 + fVar3 * fVar3;
  fVar3 = (float)(0x5f3759df - ((int)fVar4 >> 1));
  pfVar2 = local_res8;
  local_res8[0] = 1.5;
  fVar3 = fVar3 * (1.5 - fVar3 * fVar3 * fVar4 * 0.5);
  local_res10[0] =
       ((1.5 - fVar3 * fVar3 * fVar4 * 0.5) * fVar3 * fVar4) /
       ((1.5 - fVar1 * fVar1 * fVar6 * 0.5) * fVar1 * fVar6);
  if (local_res10[0] <= 1.5) {
    pfVar2 = local_res10;
  }
  fVar1 = *pfVar2;
  *(float *)(param_1 + 0x20e8) = fVar1;
  return CONCAT71((uint7)(uint3)((uint)fVar1 >> 8),1);
}



ulonglong FUN_140212330(longlong *param_1,short *param_2,undefined8 param_3,undefined4 *param_4)

{
  short sVar1;
  byte bVar2;
  ulonglong uVar3;
  short *psVar4;
  
  uVar3 = *(ulonglong *)(param_1[0x16f] + 0x1a8);
  if ((*(char *)(uVar3 + 0x20) != '\0') ||
     (uVar3 = *(ulonglong *)(param_1[0x16f] + 0x1e8), *(char *)(uVar3 + 0x20) != '\0')) {
    return uVar3 & 0xffffffffffffff00;
  }
  uVar3 = 0xffffffffffffffff;
  psVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2a8,param_2,~uVar3 - 1);
  bVar2 = (**(code **)(*param_1 + 200))(param_1,0x1d,1);
  param_1[0x309] = param_1[0xa2];
  if (bVar2 != 0) {
    FUN_14022ecd0(param_1,param_3);
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return (ulonglong)bVar2;
}



char FUN_140212460(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x20,1);
  if (cVar1 != '\0') {
    FUN_14022ecd0(param_1,param_2);
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140212530(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x21,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140212600(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x2f,1);
  if (cVar1 != '\0') {
    FUN_14022ecd0(param_1,param_2);
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_1402126d0(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x30,1);
  if (cVar1 != '\0') {
    FUN_14022ecd0(param_1,param_2);
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_1402127a0(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x32,1);
  if (cVar1 != '\0') {
    FUN_14022ecd0(param_1,param_2);
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140212870(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x1e,1);
  if (cVar1 != '\0') {
    FUN_14022ecd0(param_1,param_2);
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140212940(longlong *param_1,short *param_2,undefined8 param_3,undefined4 *param_4)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  short *psVar4;
  
  uVar3 = 0xffffffffffffffff;
  psVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x29e,param_2,~uVar3 - 1);
  cVar2 = (**(code **)(*param_1 + 200))(param_1,0xd,1);
  if (cVar2 != '\0') {
    FUN_14022ecd0(param_1,param_3);
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



// WARNING: Removing unreachable block (ram,0x000140212a7d)

undefined1
FUN_140212a30(longlong *param_1,int param_2,short *param_3,undefined4 param_4,undefined4 param_5,
             undefined4 param_6,undefined4 *param_7,undefined4 *param_8,undefined4 *param_9)

{
  longlong *plVar1;
  short sVar2;
  byte bVar3;
  byte bVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  void *pvVar7;
  undefined1 uVar8;
  int iVar9;
  ulonglong uVar10;
  undefined8 uVar11;
  short *psVar12;
  longlong *plVar13;
  bool bVar14;
  longlong *local_28;
  longlong *local_20;
  
  *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
  uVar10 = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 0x34e) = param_5;
  *(undefined4 *)((longlong)param_1 + 0x1a74) = param_6;
  *(undefined4 *)((longlong)param_1 + 0x1c54) = *(undefined4 *)((longlong)param_1 + 0x1c54);
  plVar13 = param_1 + 0x299;
  psVar12 = param_3;
  do {
    if (uVar10 == 0) break;
    uVar10 = uVar10 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(plVar13,param_3,~uVar10 - 1);
  *(undefined4 *)(param_1 + 0x381) = param_4;
  *(undefined4 *)(param_1 + 0x2f) = *param_7;
  *(undefined4 *)((longlong)param_1 + 0x17c) = param_7[1];
  *(undefined4 *)(param_1 + 0x30) = param_7[2];
  if (param_2 != 0xb) goto LAB_140212c49;
  bVar3 = *(byte *)((longlong)param_1 + 0x601);
  uVar5 = *(undefined4 *)((longlong)param_1 + 300);
  bVar4 = *(byte *)(param_1 + 0xc0);
  *(undefined4 *)(param_1 + 0x407) = *param_9;
  *(undefined4 *)((longlong)param_1 + 0x203c) = param_9[1];
  *(undefined4 *)(param_1 + 0x408) = param_9[2];
  if (7 < (ulonglong)param_1[0x29c]) {
    plVar13 = (longlong *)*plVar13;
  }
  puVar6 = (undefined8 *)param_1[0x391];
  if (puVar6 == (undefined8 *)0x0) {
LAB_140212b6a:
    uVar11 = 0;
  }
  else {
    if (puVar6 != (undefined8 *)param_1[0x392]) {
      iVar9 = DAT_140608150 + 1;
      bVar14 = DAT_140608150 == 0;
      DAT_140608150 = iVar9;
      if (bVar14) {
        FUN_140176d60(1);
      }
      goto LAB_140212b6a;
    }
    uVar11 = *puVar6;
  }
  FUN_140278700(uVar11,&local_28,plVar13,(int)param_1[0x381],uVar5,bVar3 | bVar4,
                (char)param_1[0x413]);
  if (local_28 != (longlong *)0x0) {
    if (local_28 == local_20) {
      if (*local_28 != 0) {
        *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)(*local_28 + 0x330);
      }
    }
    else {
      iVar9 = DAT_140608154 + 1;
      bVar14 = DAT_140608154 == 0;
      DAT_140608154 = iVar9;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
    plVar13 = local_28;
    if (local_28 != (longlong *)0x0) {
      if (local_28 == local_20) {
        if (local_28 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_28 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_28 = (longlong *)0x0;
            pvVar7 = (void *)*plVar13;
            if (pvVar7 != (void *)0x0) {
              FUN_140197310(pvVar7);
              operator_delete(pvVar7);
            }
            operator_delete(plVar13);
          }
        }
      }
      else {
        iVar9 = DAT_1406080b4 + 1;
        bVar14 = DAT_1406080b4 == 0;
        DAT_1406080b4 = iVar9;
        if (bVar14) {
          FUN_140176d60(1);
        }
      }
    }
  }
LAB_140212c49:
  *(undefined4 *)(param_1 + 0x269) = *param_8;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_8[1];
  *(undefined4 *)(param_1 + 0x26a) = param_8[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_8;
  *(undefined4 *)(param_1 + 0x268) = param_8[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_8[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_8;
  *(undefined4 *)(param_1 + 0x2b) = param_8[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_8[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_8;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_8[1];
  *(undefined4 *)(param_1 + 0x2d) = param_8[2];
  uVar8 = (**(code **)(*param_1 + 200))(param_1,param_2,1);
  FUN_140212d00(param_1,param_7,param_8);
  return uVar8;
}



void FUN_140212d00(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined4 uVar1;
  
  switch(*(undefined4 *)((longlong)param_1 + 300)) {
  case 3:
  case 0x3a:
  case 0x4b:
    (**(code **)(*param_1 + 0x100))(param_1,param_3);
    FUN_14022ecd0(param_1,param_2);
    return;
  case 10:
  case 0x10:
  case 0x11:
    *(undefined4 *)((longlong)param_1 + 0x1a54) = *param_2;
    *(undefined4 *)(param_1 + 0x34b) = param_2[1];
    *(undefined4 *)((longlong)param_1 + 0x1a5c) = param_2[2];
    *(undefined4 *)((longlong)param_1 + 0x1a44) = *param_3;
    *(undefined4 *)(param_1 + 0x349) = param_3[1];
    uVar1 = param_3[2];
    *(undefined1 *)(param_1 + 0x348) = 1;
    *(undefined4 *)((longlong)param_1 + 0x1a4c) = uVar1;
    *(undefined1 *)(param_1 + 0x34a) = 1;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140212e4d)

char FUN_140212e10(longlong *param_1,undefined4 param_2,short *param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 *param_7,undefined4 *param_8,
                  undefined4 *param_9)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  short *psVar4;
  
  *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
  uVar3 = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 0x34e) = param_5;
  *(undefined4 *)((longlong)param_1 + 0x1a74) = param_6;
  *(undefined4 *)((longlong)param_1 + 0x1c54) = *(undefined4 *)((longlong)param_1 + 0x1c54);
  psVar4 = param_3;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x299,param_3,~uVar3 - 1);
  *(undefined4 *)(param_1 + 0x381) = param_4;
  *(undefined4 *)((longlong)param_1 + 0x1a9c) = *param_7;
  *(undefined4 *)(param_1 + 0x354) = param_7[1];
  *(undefined4 *)((longlong)param_1 + 0x1aa4) = param_7[2];
  *(undefined4 *)((longlong)param_1 + 0x1e94) = *param_9;
  *(undefined4 *)(param_1 + 0x3d3) = param_9[1];
  *(undefined4 *)((longlong)param_1 + 0x1e9c) = param_9[2];
  cVar2 = (**(code **)(*param_1 + 200))(param_1,param_2,1);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_7;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_7[1];
    *(undefined4 *)(param_1 + 0x30) = param_7[2];
    *(undefined4 *)(param_1 + 0x269) = *param_8;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_8[1];
    *(undefined4 *)(param_1 + 0x26a) = param_8[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_8;
    *(undefined4 *)(param_1 + 0x268) = param_8[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_8[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_8;
    *(undefined4 *)(param_1 + 0x2b) = param_8[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_8[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_8;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_8[1];
    *(undefined4 *)(param_1 + 0x2d) = param_8[2];
  }
  return cVar2;
}



char FUN_140212f90(longlong *param_1,undefined8 param_2,undefined4 *param_3,undefined4 param_4,
                  undefined4 param_5)

{
  char cVar1;
  
  *(undefined4 *)(param_1 + 0x350) = param_4;
  *(undefined4 *)((longlong)param_1 + 0x1a84) = param_5;
  cVar1 = (**(code **)(*param_1 + 200))(param_5,0x1c,1);
  if (cVar1 != '\0') {
    FUN_14022ecd0(param_1,param_2);
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140213070(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x22,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140213140(longlong *param_1,short *param_2,undefined4 *param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  
  *(undefined4 *)(param_1 + 0x350) = param_5;
  *(undefined4 *)((longlong)param_1 + 0x1a84) = param_6;
  uVar3 = 0xffffffffffffffff;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2a8,param_6,~uVar3 - 1);
  cVar2 = (**(code **)(*param_1 + 200))(param_1,0x23,1);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_3[1];
    *(undefined4 *)(param_1 + 0x30) = param_3[2];
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



char FUN_140213260(longlong *param_1,short *param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  
  *(undefined4 *)(param_1 + 0x34f) = param_5;
  *(undefined4 *)((longlong)param_1 + 0x1a7c) = param_6;
  uVar3 = 0xffffffffffffffff;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2ad,param_6,~uVar3 - 1);
  cVar2 = (**(code **)(*param_1 + 200))(param_1,0x24,1);
  if (cVar2 != '\0') {
    FUN_14022ecd0(param_1,param_3);
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



char FUN_140213360(longlong *param_1,short *param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  
  *(undefined4 *)(param_1 + 0x34f) = param_5;
  *(undefined4 *)((longlong)param_1 + 0x1a7c) = param_6;
  uVar3 = 0xffffffffffffffff;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2ad,param_6,~uVar3 - 1);
  cVar2 = (**(code **)(*param_1 + 200))(param_1,0x2b,1);
  if (cVar2 != '\0') {
    FUN_14022ecd0(param_1,param_3);
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



// WARNING: Removing unreachable block (ram,0x0001402134ab)

char FUN_140213460(longlong *param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  short *psVar4;
  
  uVar3 = 0xffffffffffffffff;
  psVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x299,param_2,~uVar3 - 1);
  *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
  cVar2 = (**(code **)(*param_1 + 200))(param_1,0x35,1);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_3[1];
    *(undefined4 *)(param_1 + 0x30) = param_3[2];
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



char FUN_140213570(longlong *param_1,undefined4 *param_2,undefined4 *param_3,undefined4 param_4,
                  undefined4 param_5)

{
  char cVar1;
  longlong *plVar2;
  
  (**(code **)(*param_1 + 0x148))(param_1,param_4,param_5);
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x39,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
    plVar2 = (longlong *)(**(code **)(*param_1 + 0x158))(param_1);
    if (plVar2 != (longlong *)0x0) {
      (**(code **)(*plVar2 + 200))(plVar2,0x3c,1);
    }
  }
  return cVar1;
}



char FUN_140213680(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x3a,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140213750(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x36,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140213820(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x37,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_1402138f0(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x38,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_1402139c0(longlong *param_1,undefined4 *param_2,undefined4 *param_3,undefined4 param_4,
                  undefined4 param_5)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x3c,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
    (**(code **)(*param_1 + 0x160))(param_1,param_4,param_5);
  }
  return cVar1;
}



char FUN_140213ac0(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(*param_1 + 200))(param_1,0x3d,1);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
    *(undefined4 *)(param_1 + 0x30) = param_2[2];
    *(undefined4 *)(param_1 + 0x269) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
    *(undefined4 *)(param_1 + 0x26a) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
    *(undefined4 *)(param_1 + 0x268) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
    *(undefined4 *)(param_1 + 0x2b) = param_3[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
    *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  }
  return cVar1;
}



char FUN_140213b90(longlong *param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  short *psVar4;
  
  uVar3 = 0xffffffffffffffff;
  psVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x28f,param_2,~uVar3 - 1);
  cVar2 = (**(code **)(*param_1 + 200))(param_1,0x3f,1);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_3[1];
    *(undefined4 *)(param_1 + 0x30) = param_3[2];
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



char FUN_140213c90(longlong *param_1,short *param_2,undefined4 *param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  char cVar2;
  longlong lVar3;
  ulonglong uVar4;
  short *psVar5;
  
  uVar4 = 0xffffffffffffffff;
  psVar5 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x28f,param_2,~uVar4 - 1);
  lVar3 = FUN_1402d6230(param_1,param_5,param_6);
  param_1[0x168] = lVar3;
  cVar2 = (**(code **)(*param_1 + 200))(param_1,0x44,1);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_3[1];
    *(undefined4 *)(param_1 + 0x30) = param_3[2];
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



void FUN_140213da0(longlong *param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4,
                  float param_5)

{
  double dVar1;
  
  *(undefined4 *)(param_1 + 0x40c) = *param_2;
  *(undefined4 *)((longlong)param_1 + 0x2064) = param_2[1];
  dVar1 = (double)param_5 + (double)param_1[0xa2];
  *(undefined4 *)(param_1 + 0x40d) = param_2[2];
  *(undefined4 *)((longlong)param_1 + 0x206c) = *param_3;
  *(undefined4 *)(param_1 + 0x40e) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x2074) = param_3[2];
  *(undefined4 *)(param_1 + 0x40f) = *param_4;
  *(undefined4 *)((longlong)param_1 + 0x207c) = param_4[1];
  *(undefined4 *)(param_1 + 0x410) = param_4[2];
  param_1[0x411] = param_1[0xa2];
  param_1[0x412] = (longlong)dVar1;
                    // WARNING: Could not recover jumptable at 0x000140213e24. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(dVar1,5,1);
  return;
}



void FUN_140213e30(longlong *param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4,
                  float param_5)

{
  double dVar1;
  
  *(undefined4 *)(param_1 + 0x40c) = *param_2;
  *(undefined4 *)((longlong)param_1 + 0x2064) = param_2[1];
  dVar1 = (double)param_5 + (double)param_1[0xa2];
  *(undefined4 *)(param_1 + 0x40d) = param_2[2];
  *(undefined4 *)((longlong)param_1 + 0x206c) = *param_3;
  *(undefined4 *)(param_1 + 0x40e) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x2074) = param_3[2];
  *(undefined4 *)(param_1 + 0x40f) = *param_4;
  *(undefined4 *)((longlong)param_1 + 0x207c) = param_4[1];
  *(undefined4 *)(param_1 + 0x410) = param_4[2];
  param_1[0x411] = param_1[0xa2];
  param_1[0x412] = (longlong)dVar1;
                    // WARNING: Could not recover jumptable at 0x000140213eb4. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(dVar1,6,1);
  return;
}



void FUN_140213ec0(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x2f) = *param_2;
  *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x30) = param_2[2];
  *(undefined4 *)(param_1 + 0x269) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x26a) = param_3[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x268) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x2b) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x2d) = param_3[2];
                    // WARNING: Could not recover jumptable at 0x000140213f59. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(param_1,7,1);
  return;
}



char FUN_140213f60(longlong *param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  short *psVar4;
  
  uVar3 = 0xffffffffffffffff;
  psVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2e4,param_2,~uVar3 - 1);
  cVar2 = (**(code **)(*param_1 + 200))(param_1,0x62,1);
  if (cVar2 != '\0') {
    *(undefined4 *)(param_1 + 0x2f) = *param_3;
    *(undefined4 *)((longlong)param_1 + 0x17c) = param_3[1];
    *(undefined4 *)(param_1 + 0x30) = param_3[2];
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



char FUN_140214060(longlong *param_1,short *param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  char cVar2;
  ulonglong uVar3;
  
  *(undefined4 *)(param_1 + 0x34f) = param_5;
  *(undefined4 *)((longlong)param_1 + 0x1a7c) = param_6;
  uVar3 = 0xffffffffffffffff;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2a8,param_6,~uVar3 - 1);
  cVar2 = (**(code **)(*param_1 + 200))(param_1,99,1);
  if (cVar2 != '\0') {
    FUN_14022ecd0(param_1,param_3);
    *(undefined4 *)(param_1 + 0x269) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
    *(undefined4 *)(param_1 + 0x26a) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
    *(undefined4 *)(param_1 + 0x268) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
    *(undefined4 *)(param_1 + 0x2b) = param_4[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_4;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
    *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  }
  return cVar2;
}



void FUN_140214160(longlong *param_1,undefined4 *param_2)

{
  float fVar1;
  
  *(undefined4 *)(param_1 + 0x420) = *param_2;
  *(undefined4 *)((longlong)param_1 + 0x2104) = param_2[1];
  *(undefined4 *)(param_1 + 0x421) = param_2[2];
  fVar1 = *(float *)((longlong)param_1 + 0x2104) - *(float *)((longlong)param_1 + 0x17c);
  fVar1 = fVar1 * fVar1;
  *(float *)((longlong)param_1 + 0x210c) =
       (*(float *)(param_1 + 0x420) - *(float *)(param_1 + 0x2f)) *
       (*(float *)(param_1 + 0x420) - *(float *)(param_1 + 0x2f)) + fVar1 +
       (*(float *)(param_1 + 0x421) - *(float *)(param_1 + 0x30)) *
       (*(float *)(param_1 + 0x421) - *(float *)(param_1 + 0x30));
                    // WARNING: Could not recover jumptable at 0x0001402141d1. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(fVar1,0x51,1);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402148a0)

void FUN_1402141e0(longlong *param_1)

{
  short sVar1;
  longlong lVar2;
  int iVar3;
  ulonglong uVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  short *psVar7;
  longlong lVar8;
  short *psVar9;
  longlong *plVar10;
  longlong lVar11;
  longlong lVar12;
  bool bVar13;
  bool bVar14;
  
  lVar11 = 0;
  bVar14 = false;
  plVar10 = (longlong *)param_1[0x25d];
  lVar12 = lVar11;
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == (longlong *)param_1[0x25e]) {
      lVar8 = *plVar10;
      lVar12 = 0;
      if (lVar8 != 0) {
        if ((plVar10 != (longlong *)param_1[0x25e]) &&
           (iVar3 = DAT_1406080a8 + 1, bVar14 = DAT_1406080a8 == 0, lVar8 = lVar11,
           DAT_1406080a8 = iVar3, bVar14)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar8);
        bVar14 = true;
        lVar12 = lVar8;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar13 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  lVar11 = param_1[0x316];
  lVar8 = param_1[0x315];
  do {
    if (lVar8 == lVar11) {
      if (param_1[0x315] != param_1[0x316]) {
        param_1[0x316] = param_1[0x315];
      }
      if (bVar14) {
        FUN_14034edd0(lVar12);
      }
      return;
    }
    if ((((*(int *)(lVar8 + 8) == 0) ||
         (lVar2 = *(longlong *)(*(longlong *)(param_1[0x27b] + 0x10) + 0xd8), lVar2 == 0)) ||
        (iVar3 = *(int *)(lVar8 + 8) + -1, iVar3 < 0)) ||
       (((int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4) <= iVar3 ||
        (lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10), lVar2 == 0))))
    goto switchD_140214334_caseD_1b;
    uVar5 = *(undefined4 *)(lVar8 + 4);
    switch(uVar5) {
    case 5:
      FUN_140213da0(param_1,lVar8 + 0xc,lVar8 + 0x18,lVar8 + 0x24,*(undefined4 *)(lVar8 + 0x48));
      break;
    case 6:
      FUN_140213e30(param_1,lVar8 + 0xc,lVar8 + 0x18,lVar8 + 0x24,*(undefined4 *)(lVar8 + 0x48));
      break;
    case 7:
      FUN_140213ec0(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    default:
      FUN_14022ecd0(param_1,lVar8 + 0xc);
      (**(code **)(*param_1 + 0x100))(param_1,lVar8 + 0x18);
      uVar5 = *(undefined4 *)(lVar8 + 4);
      goto LAB_140214861;
    case 10:
    case 0xb:
    case 0xe:
    case 0xf:
    case 0x10:
    case 0x11:
    case 0x12:
    case 0x14:
    case 0x17:
    case 0x19:
    case 0x1a:
    case 0x3b:
      plVar10 = (longlong *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        plVar10 = (longlong *)*plVar10;
      }
      FUN_140212a30(param_1,uVar5,plVar10,*(undefined4 *)(lVar8 + 0x5c),
                    *(undefined4 *)(lVar8 + 0x48),*(undefined4 *)(lVar8 + 0x4c),lVar8 + 0xc,
                    lVar8 + 0x18,lVar8 + 0x30);
      break;
    case 0xd:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140212940(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x15:
    case 0x16:
      plVar10 = (longlong *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        plVar10 = (longlong *)*plVar10;
      }
      FUN_140212e10(param_1,uVar5,plVar10,*(undefined4 *)(lVar8 + 0x5c),
                    *(undefined4 *)(lVar8 + 0x48),*(undefined4 *)(lVar8 + 0x4c),lVar8 + 0xc,
                    lVar8 + 0x18,lVar8 + 0x24);
      break;
    case 0x1b:
    case 0x3e:
      break;
    case 0x1c:
      FUN_140212f90(param_1,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                    *(undefined4 *)(lVar8 + 0x4c));
      break;
    case 0x1d:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140212330(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x1e:
      FUN_140212870(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x20:
      FUN_140212460(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x21:
      FUN_140212530(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x22:
      FUN_140213070(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x23:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140213140(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                    *(undefined4 *)(lVar8 + 0x4c));
      break;
    case 0x24:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140213260(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                    *(undefined4 *)(lVar8 + 0x4c));
      break;
    case 0x27:
      FUN_140212090(param_1,lVar8 + 0xc,lVar8 + 0x24);
      break;
    case 0x2b:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140213360(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                    *(undefined4 *)(lVar8 + 0x4c));
      break;
    case 0x2f:
      FUN_140212600(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x30:
      FUN_1402126d0(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x32:
      FUN_1402127a0(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x35:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140213460(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x36:
      FUN_140213750(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x37:
      FUN_140213820(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x38:
      FUN_1402138f0(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x39:
      FUN_140213570(param_1,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 100),
                    *(undefined4 *)(lVar8 + 0x60));
      break;
    case 0x3a:
      FUN_140213680(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x3c:
      FUN_1402139c0(param_1,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 100),
                    *(undefined4 *)(lVar8 + 0x60));
      break;
    case 0x3d:
      FUN_140213ac0(param_1,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x3f:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140213b90(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 0x44:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140213c90(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x3c),
                    *(undefined4 *)(lVar8 + 0x40));
      break;
    case 0x50:
      if (*(int *)((longlong)param_1 + 300) != 0x25) {
        uVar5 = 0x50;
        goto LAB_140214861;
      }
      break;
    case 0x51:
      FUN_140214160(param_1,lVar8 + 0x24);
      break;
    case 0x52:
      uVar5 = 0x52;
      goto LAB_140214861;
    case 0x53:
      *(undefined4 *)(param_1 + 0x422) = *(undefined4 *)(lVar8 + 0x24);
      *(undefined4 *)((longlong)param_1 + 0x2114) = *(undefined4 *)(lVar8 + 0x28);
      *(undefined4 *)(param_1 + 0x423) = *(undefined4 *)(lVar8 + 0x2c);
      uVar5 = 0x53;
      goto LAB_140214861;
    case 0x54:
      *(undefined4 *)((longlong)param_1 + 0x211c) = *(undefined4 *)(lVar8 + 0x24);
      *(undefined4 *)(param_1 + 0x424) = *(undefined4 *)(lVar8 + 0x28);
      *(undefined4 *)((longlong)param_1 + 0x2124) = *(undefined4 *)(lVar8 + 0x2c);
      uVar5 = 0x54;
      goto LAB_140214861;
    case 0x62:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140213f60(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18);
      break;
    case 99:
      puVar6 = (undefined8 *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_140214060(param_1,puVar6,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                    *(undefined4 *)(lVar8 + 0x4c));
      break;
    case 0x68:
      psVar7 = (short *)(lVar2 + 0x1b8);
      if (7 < *(ulonglong *)(lVar2 + 0x1d0)) {
        psVar7 = *(short **)psVar7;
      }
      uVar4 = 0xffffffffffffffff;
      psVar9 = psVar7;
      do {
        if (uVar4 == 0) break;
        uVar4 = uVar4 - 1;
        sVar1 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x414,psVar7,~uVar4 - 1);
      uVar5 = 0x68;
LAB_140214861:
      (**(code **)(*param_1 + 200))(param_1,uVar5,1);
    }
switchD_140214334_caseD_1b:
    lVar8 = lVar8 + 0xb0;
  } while( true );
}



void FUN_140214a00(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  undefined4 local_res8 [2];
  
  if (*(longlong *)(param_1 + 0x20f0) == 0) {
    return;
  }
  *(undefined4 *)(*(longlong *)(param_1 + 0x20f0) + 0xc4) = *(undefined4 *)(param_1 + 0x744);
  *(undefined4 *)(*(longlong *)(param_1 + 0x20f0) + 200) = *(undefined4 *)(param_1 + 0x74c);
  *(undefined4 *)(*(longlong *)(param_1 + 0x20f0) + 0xcc) = *(undefined4 *)(param_1 + 0x748);
  *(undefined4 *)(*(longlong *)(param_1 + 0x20f0) + 0xd0) = *(undefined4 *)(param_1 + 0x750);
  lVar2 = *(longlong *)(param_1 + 0x1e80);
  if (lVar2 == 0) {
    lVar2 = *(longlong *)(param_1 + 0x2178);
    if (lVar2 == 0) goto LAB_140214aee;
    local_res8[0] = *(undefined4 *)(param_1 + 0x128);
    lVar1 = *(longlong *)(lVar2 + 0xb50);
  }
  else {
    local_res8[0] = *(undefined4 *)(param_1 + 0x128);
    lVar1 = **(longlong **)(lVar2 + 0x48);
  }
  (**(code **)(*(longlong *)(lVar1 + 0x380) + 0x8e0))
            ((longlong *)(lVar1 + 0x380),*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_res8,
             (undefined4 *)(param_1 + 0x744),(undefined4 *)(param_1 + 0x74c),
             (undefined4 *)(param_1 + 0x748),(undefined4 *)(param_1 + 0x750),param_1 + 0x7fc);
LAB_140214aee:
  *(undefined1 *)(param_1 + 0x607) = 0;
  return;
}



void FUN_140214b00(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  float local_res8 [2];
  undefined4 local_res10 [6];
  
  lVar2 = *(longlong *)(param_1 + 0x1e80);
  if (lVar2 == 0) {
    lVar2 = *(longlong *)(param_1 + 0x2178);
    if (lVar2 == 0) {
      *(undefined1 *)(param_1 + 0x605) = 0;
      return;
    }
    local_res10[0] = *(undefined4 *)(param_1 + 0x128);
    local_res8[0] =
         *(float *)(param_1 + 0x5e0) + *(float *)(param_1 + 0x5dc) + *(float *)(param_1 + 0x5e4) +
         *(float *)(param_1 + 0x908);
    lVar1 = *(longlong *)(lVar2 + 0xb50);
  }
  else {
    local_res10[0] = *(undefined4 *)(param_1 + 0x128);
    local_res8[0] =
         *(float *)(param_1 + 0x5e0) + *(float *)(param_1 + 0x5dc) + *(float *)(param_1 + 0x5e4) +
         *(float *)(param_1 + 0x908);
    lVar1 = **(longlong **)(lVar2 + 0x48);
  }
  (**(code **)(*(longlong *)(lVar1 + 0x380) + 0x8f0))
            ((longlong *)(lVar1 + 0x380),*(undefined4 *)(lVar2 + 8),&DAT_1405d85a0,local_res10,
             local_res8);
  *(undefined1 *)(param_1 + 0x605) = 0;
  return;
}



void FUN_140214be0(longlong param_1)

{
  float fVar1;
  float fVar2;
  longlong lVar3;
  longlong lVar4;
  int local_res8 [2];
  int local_res10 [2];
  undefined4 local_res18 [4];
  
  lVar4 = *(longlong *)(param_1 + 0x1e80);
  if (lVar4 == 0) {
    lVar4 = *(longlong *)(param_1 + 0x2178);
    if (lVar4 == 0) {
      *(undefined1 *)(param_1 + 0x60c) = 0;
      return;
    }
    fVar1 = *(float *)(param_1 + 0x5a0);
    fVar2 = *(float *)(param_1 + 0x598);
    local_res18[0] = *(undefined4 *)(param_1 + 0x128);
    lVar3 = *(longlong *)(lVar4 + 0xb50);
  }
  else {
    fVar1 = *(float *)(param_1 + 0x5a0);
    fVar2 = *(float *)(param_1 + 0x598);
    local_res18[0] = *(undefined4 *)(param_1 + 0x128);
    lVar3 = **(longlong **)(lVar4 + 0x48);
  }
  local_res10[0] = (int)fVar2;
  local_res8[0] = (int)fVar1;
  (**(code **)(*(longlong *)(lVar3 + 0x380) + 0x530))
            ((longlong *)(lVar3 + 0x380),*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0,local_res18,
             local_res10,local_res8);
  *(undefined1 *)(param_1 + 0x60c) = 0;
  return;
}



void FUN_140214cb0(longlong *param_1,undefined2 param_2)

{
  int *piVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined1 local_res8 [16];
  undefined1 local_res18 [8];
  undefined2 local_res20 [4];
  undefined2 *puVar7;
  undefined2 local_48 [2];
  undefined4 local_44;
  undefined4 local_40 [2];
  undefined8 local_38;
  longlong *local_30;
  longlong *local_28;
  
  local_38 = 0xfffffffffffffffe;
  if (*(char *)((longlong)param_1 + 0x20d4) != '\0') {
    return;
  }
  lVar4 = param_1[0x3d0];
  if (lVar4 == 0) {
    return;
  }
  piVar1 = *(int **)(param_1[0x26] + 0x930);
  if (piVar1 == (int *)0x0) {
    return;
  }
  if (*piVar1 == 2) {
    if (*(longlong *)(piVar1 + 0x66) != 0) {
      *(undefined1 *)((longlong)param_1 + 0x20d4) = 1;
      plVar5 = param_1;
      FUN_1402f88a0(param_1,0x3f800000);
      (**(code **)(*plVar5 + 0xd0))();
      local_res8[0] = 1;
      local_44 = (undefined4)param_1[0x25];
      plVar5 = (longlong *)(**(longlong **)(param_1[0x3d0] + 0x48) + 0x380);
      local_res20[0] = param_2;
      (**(code **)(*plVar5 + 0x520))
                (plVar5,*(undefined4 *)(param_1[0x3d0] + 8),&DAT_1405d85a0,&local_44,local_res20,
                 local_res8);
      return;
    }
    *(undefined1 *)((longlong)param_1 + 0x20d4) = 0;
  }
  local_res18[0] = 0;
  local_40[0] = (undefined4)param_1[0x25];
  plVar5 = (longlong *)(**(longlong **)(lVar4 + 0x48) + 0x380);
  puVar7 = local_48;
  local_48[0] = param_2;
  (**(code **)(*plVar5 + 0x520))
            (plVar5,*(undefined4 *)(lVar4 + 8),&DAT_1405d85a0,local_40,puVar7,local_res18);
  lVar4 = (**(code **)(*param_1 + 0x280))(param_1);
  *(undefined1 *)(lVar4 + 0x80) = 1;
  lVar4 = FUN_14018fbc0(*(undefined8 *)(param_1[0x3d0] + 0x48),(int)param_1[0x41a]);
  if (lVar4 == 0) {
    return;
  }
  FUN_140198570(lVar4,&local_30);
  plVar5 = local_30;
  if (local_30 != (longlong *)0x0) {
    if (local_30 == local_28) {
      if (*local_30 != 0) {
        FUN_1402082d0(*local_30,(int)param_1[0x25],1);
        FUN_140248ab0(*plVar5,param_1 + 0x1f6,(int)param_1[0x25],piVar1[0xd],
                      (ulonglong)puVar7 & 0xffffffffffffff00);
        goto LAB_140214ec5;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar6 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar5 == (longlong *)0x0) {
    return;
  }
  if (plVar5 != local_28) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_140214ec5:
  LOCK();
  plVar5 = plVar5 + 1;
  *(int *)plVar5 = (int)*plVar5 + -1;
  UNLOCK();
  if ((int)*plVar5 == 0) {
    puVar2 = (undefined8 *)*local_30;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_30);
  }
  return;
}



undefined4
FUN_140214f00(longlong *param_1,undefined4 *param_2,undefined8 param_3,undefined4 param_4)

{
  int *piVar1;
  float fVar2;
  uint uVar3;
  int iVar4;
  undefined4 uVar5;
  longlong *plVar6;
  longlong lVar7;
  longlong lVar8;
  uint *puVar9;
  undefined4 uVar10;
  float fVar11;
  float fVar12;
  undefined1 local_20 [8];
  longlong *local_18;
  
  if ((param_1[0x26] == 0) || (lVar8 = *(longlong *)(param_1[0x26] + 0x930), lVar8 == 0)) {
    return 0xffffffff;
  }
  plVar6 = (longlong *)FUN_140215ba0(DAT_140608068,local_20,param_3,param_4,0xfffffffffffffffe);
  uVar3 = *(uint *)(lVar8 + 0x44);
  lVar8 = *(longlong *)*plVar6;
  if (lVar8 != 0) {
    for (puVar9 = *(uint **)(lVar8 + ((ulonglong)uVar3 %
                                     (ulonglong)*(uint *)((longlong *)*plVar6 + 2)) * 8);
        puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 6)) {
      if ((puVar9[8] == uVar3) && (*puVar9 == uVar3)) {
        if (puVar9 != (uint *)0x0) {
          if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          lVar8 = *(longlong *)(puVar9 + 2);
          goto LAB_140214fb4;
        }
        break;
      }
    }
  }
  lVar8 = 0;
LAB_140214fb4:
  if (local_18 != (longlong *)0x0) {
    LOCK();
    plVar6 = local_18 + 1;
    *(int *)plVar6 = (int)*plVar6 + -1;
    UNLOCK();
    if ((int)*plVar6 == 0) {
      (**(code **)(*local_18 + 8))(local_18);
      LOCK();
      piVar1 = (int *)((longlong)local_18 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_18 + 0x10))(local_18);
      }
    }
  }
  if (lVar8 == 0) {
    return 0xffffffff;
  }
  iVar4 = rand();
  fVar11 = (float)iVar4 * 3.0517578e-05;
  fVar2 = *(float *)(lVar8 + 4);
  fVar12 = fVar2 + *(float *)(lVar8 + 8);
  uVar10 = 1;
  uVar5 = 1;
  if ((fVar11 < 0.0) || (fVar2 < fVar11)) {
    if ((fVar11 <= fVar2) || (fVar12 < fVar11)) {
      uVar5 = uVar10;
      if ((fVar12 < fVar11) && (fVar11 <= fVar12 + *(float *)(lVar8 + 0xc))) {
        *param_2 = *(undefined4 *)(lVar8 + 0x14);
      }
    }
    else {
      if (*(int *)(lVar8 + 0x10) < 1) {
        lVar8 = (**(code **)(*param_1 + 0x280))();
        goto LAB_14021509c;
      }
      lVar7 = (**(code **)(*param_1 + 0x280))(param_1);
      *(undefined2 *)(lVar7 + 0x68) = 0;
      *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(lVar8 + 0x10);
      (**(code **)(*param_1 + 0xb8))(param_1);
      uVar5 = FUN_1402f8580(param_1);
      FUN_1402f81e0(param_1,uVar5);
      uVar5 = 3;
    }
  }
  else {
    uVar5 = 2;
  }
  lVar8 = (**(code **)(*param_1 + 0x280))(param_1);
LAB_14021509c:
  *(char *)(lVar8 + 0x80) = (char)uVar5;
  return uVar5;
}



undefined4 FUN_1402150c0(longlong *param_1)

{
  longlong lVar1;
  
  if (((param_1[0x26] != 0) && (lVar1 = *(longlong *)(param_1[0x26] + 0x930), lVar1 != 0)) &&
     (*(int *)(lVar1 + 8) < *(int *)(param_1[0x41e] + 0x4c))) {
    *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(lVar1 + 0x10);
    (**(code **)(*param_1 + 0xb8))(param_1);
    if (param_1[0x26] != 0) {
      *(undefined2 *)(param_1[0x41e] + 0x68) = *(undefined2 *)(param_1[0x26] + 0x274);
    }
    return (int)param_1[0x24];
  }
  return 0xffffffff;
}



void FUN_140215140(longlong *param_1)

{
  int iVar1;
  longlong lVar2;
  float *pfVar3;
  float *pfVar4;
  float fVar5;
  float local_res8 [2];
  float local_res10 [2];
  
  lVar2 = (**(code **)(*param_1 + 0x280))();
  pfVar4 = *(float **)(lVar2 + 0xd8);
  if (pfVar4 != (float *)0x0) {
    lVar2 = (**(code **)(*param_1 + 0x280))(param_1);
    iVar1 = *(int *)(lVar2 + 0x84);
    lVar2 = (**(code **)(*param_1 + 0x280))(param_1);
    fVar5 = (float)iVar1 * *pfVar4 + (float)*(int *)(lVar2 + 0xa8);
    lVar2 = (**(code **)(*param_1 + 0x280))(param_1);
    iVar1 = *(int *)(lVar2 + 0x88);
    lVar2 = (**(code **)(*param_1 + 0x280))(param_1);
    local_res8[0] = fVar5;
    pfVar3 = local_res8;
    local_res8[0] = (float)iVar1 * pfVar4[1] + (float)*(int *)(lVar2 + 0xac);
    local_res10[0] = 1.0;
    if (fVar5 <= 1.0) {
      pfVar3 = local_res10;
    }
    *(float *)((longlong)param_1 + 0x59c) = *pfVar3;
    *(undefined1 *)(param_1 + 0x219) = 1;
    pfVar4 = local_res8;
    local_res10[0] = 1.0;
    if (local_res8[0] <= 1.0) {
      pfVar4 = local_res10;
    }
    fVar5 = *pfVar4;
    *(undefined1 *)(param_1 + 0x219) = 1;
    *(float *)((longlong)param_1 + 0x5a4) = fVar5;
  }
  return;
}



void FUN_140215260(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  float fVar3;
  
  lVar2 = *(longlong *)(param_1 + 0x2158);
  if ((((lVar2 != 0) && (iVar1 = FUN_1402f8580(), 0 < iVar1)) && (iVar1 < *(int *)(lVar2 + 0x38)))
     && (lVar2 = (longlong)(iVar1 + -1) * 0x80 + *(longlong *)(lVar2 + 0x40), lVar2 != 0)) {
    iVar1 = *(int *)(lVar2 + 0x28);
    if (iVar1 < 1) {
      fVar3 = 0.1;
    }
    else {
      fVar3 = (float)iVar1;
    }
    if (1.0 < (float)*(int *)(*(longlong *)(param_1 + 0x20f0) + 0x9c) / fVar3 +
              *(float *)(*(longlong *)(param_1 + 0x20f0) + 0xc0)) {
      return;
    }
  }
  return;
}



void FUN_140215300(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong lVar2;
  longlong *plVar3;
  int iVar4;
  undefined4 uVar5;
  longlong lVar6;
  undefined8 uVar7;
  longlong *plVar8;
  longlong *plVar9;
  int *piVar10;
  
  if (((*(longlong *)(param_1 + 0x2178) != 0) && (*(longlong *)(param_1 + 0x11b0) != 0)) &&
     (lVar2 = *(longlong *)(param_1 + 0x2168), lVar2 != 0)) {
    if (*(longlong *)(param_1 + 0x1f08) == *(longlong *)(param_1 + 0x1f10)) {
      plVar9 = *(longlong **)(lVar2 + 0x38);
      iVar4 = FUN_1402f8580();
      if (plVar9 != *(longlong **)(lVar2 + 0x40)) {
        do {
          lVar6 = *plVar9;
          plVar3 = (longlong *)plVar9[1];
          if (plVar3 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
            UNLOCK();
          }
          if ((((int)(uint)*(ushort *)(lVar6 + 4) <= iVar4) &&
              (iVar4 <= (int)(uint)*(ushort *)(lVar6 + 6))) &&
             ((lVar6 = FUN_14030d840(*(undefined8 *)(param_1 + 0x11b0),*(undefined4 *)(lVar6 + 0xc),
                                     *(undefined2 *)(lVar6 + 0x10)), lVar6 != 0 &&
              (*(int *)(lVar6 + 0x58) == 1)))) {
            piVar10 = (int *)(lVar6 + 0x3d8);
            lVar6 = 4;
            do {
              iVar1 = *piVar10;
              if (0 < iVar1) {
                uVar7 = FUN_1403161f0();
                uVar5 = FUN_1403161b0(uVar7,iVar1);
                plVar8 = (longlong *)FUN_140267710(uVar5);
                if (plVar8 != (longlong *)0x0) {
                  (**(code **)(*plVar8 + 8))(plVar8,*piVar10);
                  FUN_1402360c0(param_1,*(undefined8 *)(param_1 + 0x2178),plVar8);
                  FUN_14026c2d0(plVar8,1);
                }
              }
              piVar10 = piVar10 + 1;
              lVar6 = lVar6 + -1;
            } while (lVar6 != 0);
          }
          if (plVar3 != (longlong *)0x0) {
            LOCK();
            plVar8 = plVar3 + 1;
            *(int *)plVar8 = (int)*plVar8 + -1;
            UNLOCK();
            if ((int)*plVar8 == 0) {
              (**(code **)(*plVar3 + 8))(plVar3);
              LOCK();
              piVar10 = (int *)((longlong)plVar3 + 0xc);
              *piVar10 = *piVar10 + -1;
              UNLOCK();
              if (*piVar10 == 0) {
                (**(code **)(*plVar3 + 0x10))();
              }
            }
          }
          plVar9 = plVar9 + 2;
        } while (plVar9 != *(longlong **)(lVar2 + 0x40));
      }
      *(undefined1 *)(param_1 + 0x2140) = 1;
    }
    else {
      FUN_1402154c0(param_1,1,param_3,param_4,0xfffffffffffffffe);
    }
  }
  return;
}



void FUN_1402154c0(longlong param_1,undefined1 param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  
  if (*(longlong **)(param_1 + 0x1f08) != *(longlong **)(param_1 + 0x1f10)) {
    plVar4 = *(longlong **)(param_1 + 0x1f08);
    if (plVar4 != *(longlong **)(param_1 + 0x1f10)) {
      do {
        plVar1 = (longlong *)*plVar4;
        if ((plVar1[9] != 0) &&
           (iVar2 = (**(code **)(*(longlong *)plVar1[9] + 0xb0))(), iVar2 == 0x20)) {
          if ((*(int *)((longlong)plVar1 + 0x34) == 1) &&
             (lVar3 = (**(code **)(*(longlong *)plVar1[9] + 0x4a8))(), lVar3 != 0)) {
            (**(code **)(*plVar1 + 0x88))(plVar1,param_2,lVar3);
          }
          (**(code **)(*plVar1 + 0x88))(plVar1,param_2,plVar1[9]);
        }
        plVar4 = plVar4 + 1;
      } while (plVar4 != *(longlong **)(param_1 + 0x1f10));
    }
    *(undefined1 *)(param_1 + 0x2140) = 1;
  }
  return;
}



longlong FUN_140215590(longlong param_1)

{
  undefined8 *puVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  longlong *local_28;
  longlong *local_20;
  longlong *local_18;
  longlong *local_10;
  
  if (*(longlong *)(param_1 + 0x1e80) == 0) {
    if (*(longlong *)(param_1 + 0x2178) != 0) {
      plVar5 = (longlong *)FUN_140198570(*(longlong *)(param_1 + 0x2178),&local_18);
      lVar4 = 0;
      plVar2 = (longlong *)*plVar5;
      if (plVar2 != (longlong *)0x0) {
        if (plVar2 == (longlong *)plVar5[1]) {
          lVar4 = *plVar2;
        }
        else {
          iVar3 = DAT_14060804c + 1;
          bVar6 = DAT_14060804c == 0;
          DAT_14060804c = iVar3;
          if (bVar6) {
            FUN_140176d60(1);
          }
        }
      }
      plVar2 = local_18;
      if (local_18 != (longlong *)0x0) {
        if (local_18 == local_10) {
          if (local_18 != (longlong *)0x0) {
            LOCK();
            local_18 = local_18 + 1;
            *(int *)local_18 = (int)*local_18 + -1;
            UNLOCK();
            if ((int)*local_18 == 0) {
              local_18 = (longlong *)0x0;
              puVar1 = (undefined8 *)*plVar2;
              if (puVar1 != (undefined8 *)0x0) {
                (**(code **)*puVar1)(puVar1,1);
              }
              operator_delete(plVar2);
            }
          }
        }
        else {
          iVar3 = DAT_140608054 + 1;
          bVar6 = DAT_140608054 == 0;
          DAT_140608054 = iVar3;
          if (bVar6) {
            FUN_140176d60(1);
            return lVar4;
          }
        }
      }
      return lVar4;
    }
  }
  else {
    lVar4 = FUN_14018fbc0(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),
                          *(undefined4 *)(param_1 + 0x20d0));
    if (lVar4 != 0) {
      FUN_140198570(lVar4,&local_28);
      plVar2 = local_28;
      if (local_28 == (longlong *)0x0) {
        lVar4 = 0;
      }
      else {
        if (local_28 == local_20) {
          lVar4 = *local_28;
        }
        else {
          iVar3 = DAT_14060804c + 1;
          bVar6 = DAT_14060804c == 0;
          DAT_14060804c = iVar3;
          if (bVar6) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        if (plVar2 == local_20) {
          LOCK();
          plVar2 = plVar2 + 1;
          *(int *)plVar2 = (int)*plVar2 + -1;
          UNLOCK();
          if ((int)*plVar2 == 0) {
            puVar1 = (undefined8 *)*local_28;
            if (puVar1 != (undefined8 *)0x0) {
              (**(code **)*puVar1)(puVar1,1);
            }
            operator_delete(local_28);
            return lVar4;
          }
        }
        else {
          iVar3 = DAT_140608054 + 1;
          bVar6 = DAT_140608054 == 0;
          DAT_140608054 = iVar3;
          if (bVar6) {
            FUN_140176d60(1);
            return lVar4;
          }
        }
      }
      return lVar4;
    }
  }
  return 0;
}



void FUN_140215770(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  bool bVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined8 uVar8;
  longlong *plVar9;
  longlong *plVar10;
  int *piVar11;
  longlong lVar12;
  longlong lVar13;
  bool bVar14;
  bool bVar15;
  longlong local_40;
  
  local_40 = 0;
  bVar15 = false;
  bVar3 = false;
  plVar10 = *(longlong **)(param_1 + 0x12e8);
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == *(longlong **)(param_1 + 0x12f0)) {
      lVar12 = *plVar10;
      if (lVar12 != 0) {
        if ((plVar10 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar15 = DAT_1406080a8 == 0, lVar12 = 0,
           DAT_1406080a8 = iVar5, bVar15)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar12);
        bVar15 = true;
        bVar3 = true;
        local_40 = lVar12;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar14 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
  if (((*(longlong *)(param_1 + 0x2178) != 0) && (*(longlong *)(param_1 + 0x11b0) != 0)) &&
     (lVar12 = *(longlong *)(param_1 + 0x2168), lVar12 != 0)) {
    plVar10 = *(longlong **)(lVar12 + 0x38);
    iVar5 = FUN_1402f8580(param_1);
    if (plVar10 != *(longlong **)(lVar12 + 0x40)) {
      do {
        lVar13 = *plVar10;
        plVar2 = (longlong *)plVar10[1];
        if (plVar2 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
          UNLOCK();
        }
        if ((iVar5 < (int)(uint)*(ushort *)(lVar13 + 4)) ||
           ((int)(uint)*(ushort *)(lVar13 + 6) < iVar5)) {
          cVar4 = FUN_1402159f0(param_1,*(undefined4 *)(lVar13 + 0xc),*(undefined2 *)(lVar13 + 0x10)
                                ,0);
          if ((((cVar4 == '\0') &&
               ((lVar7 = FUN_14030d840(*(undefined8 *)(param_1 + 0x11b0),
                                       *(undefined4 *)(lVar13 + 0xc),*(undefined2 *)(lVar13 + 0x10))
                , lVar7 != 0 && (*(int *)(lVar7 + 0x58) == 1)))) &&
              ((int)(uint)*(ushort *)(lVar13 + 4) <= iVar5)) &&
             (iVar5 <= (int)(uint)*(ushort *)(lVar13 + 6))) {
            piVar11 = (int *)(lVar7 + 0x3d8);
            lVar13 = 4;
            do {
              iVar1 = *piVar11;
              if (0 < iVar1) {
                uVar8 = FUN_1403161f0();
                uVar6 = FUN_1403161b0(uVar8,iVar1);
                plVar9 = (longlong *)FUN_140267710(uVar6);
                if (plVar9 != (longlong *)0x0) {
                  (**(code **)(*plVar9 + 8))(plVar9,*piVar11);
                  FUN_1402360c0(param_1,*(undefined8 *)(param_1 + 0x2178),plVar9);
                  FUN_14026c2d0(plVar9,1);
                }
              }
              piVar11 = piVar11 + 1;
              lVar13 = lVar13 + -1;
            } while (lVar13 != 0);
          }
        }
        else {
          FUN_1402159f0(param_1,*(undefined4 *)(lVar13 + 0xc),*(undefined2 *)(lVar13 + 0x10),1);
        }
        if (plVar2 != (longlong *)0x0) {
          LOCK();
          plVar9 = plVar2 + 1;
          *(int *)plVar9 = (int)*plVar9 + -1;
          UNLOCK();
          if ((int)*plVar9 == 0) {
            (**(code **)(*plVar2 + 8))(plVar2);
            LOCK();
            piVar11 = (int *)((longlong)plVar2 + 0xc);
            *piVar11 = *piVar11 + -1;
            UNLOCK();
            if (*piVar11 == 0) {
              (**(code **)(*plVar2 + 0x10))();
            }
          }
        }
        plVar10 = plVar10 + 2;
        bVar15 = bVar3;
      } while (plVar10 != *(longlong **)(lVar12 + 0x40));
    }
    *(undefined1 *)(param_1 + 0x2140) = 1;
  }
  if (bVar15) {
    FUN_14034edd0(local_40);
  }
  return;
}



undefined8 FUN_1402159f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined1 param_4)

{
  longlong lVar1;
  longlong *plVar2;
  int iVar3;
  int *piVar4;
  
  if (*(longlong *)(param_1 + 0x1f08) != *(longlong *)(param_1 + 0x1f10)) {
    lVar1 = FUN_14030d840(*(undefined8 *)(param_1 + 0x11b0));
    if (lVar1 != 0) {
      plVar2 = *(longlong **)(param_1 + 0x1f08);
      if (plVar2 != *(longlong **)(param_1 + 0x1f10)) {
        do {
          iVar3 = 0;
          piVar4 = (int *)(lVar1 + 0x3d8);
          do {
            if ((0 < *piVar4) && (*(int *)(*plVar2 + 8) == *piVar4)) {
              FUN_14026c2d0(*plVar2,param_4);
              return 1;
            }
            iVar3 = iVar3 + 1;
            piVar4 = piVar4 + 1;
          } while (iVar3 < 4);
          plVar2 = plVar2 + 1;
        } while (plVar2 != *(longlong **)(param_1 + 0x1f10));
      }
    }
  }
  return 0;
}



undefined8 * FUN_140215a90(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;
}



void FUN_140215b00(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x38)) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x20));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x38) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x30) = 0;
    *(undefined2 *)((longlong)pvVar1 + 0x20) = 0;
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140215b50(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)param_1 + 0x38)) {
      operator_delete(*(void **)((longlong)param_1 + 0x20));
    }
    *(undefined8 *)((longlong)param_1 + 0x38) = 7;
    *(undefined8 *)((longlong)param_1 + 0x30) = 0;
    *(undefined2 *)((longlong)param_1 + 0x20) = 0;
    operator_delete(param_1);
  }
  return;
}



undefined8 FUN_140215b90(void)

{
  return 0x20;
}



undefined8 * FUN_140215ba0(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0x468);
  lVar1 = *(longlong *)(param_1 + 0x470);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



void FUN_140215bd0(longlong *param_1)

{
  FUN_14034ed40(param_1 + 4);
  if (*param_1 != param_1[1]) {
    FUN_1402161e0(param_1);
  }
  FUN_14034edd0(param_1 + 4);
  FUN_14034edf0(param_1 + 4);
  if ((void *)*param_1 != (void *)0x0) {
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_140215c40(longlong param_1)

{
  undefined1 local_res10 [24];
  
  FUN_1402163c0(param_1,local_res10,**(undefined8 **)(param_1 + 8),*(undefined8 **)(param_1 + 8),
                0xfffffffffffffffe);
                    // WARNING: Could not recover jumptable at 0x000140215c74. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_1 + 8));
  return;
}



void FUN_140215c80(longlong param_1)

{
  undefined1 local_res18 [16];
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  FUN_14034edf0(param_1 + 0x21620);
  FUN_140215fd0(param_1 + 400);
  FUN_14034edf0(param_1 + 0x215e8);
  if (*(void **)(param_1 + 0x215b0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x215b0));
  }
  *(undefined8 *)(param_1 + 0x215b0) = 0;
  *(undefined8 *)(param_1 + 0x215b8) = 0;
  *(undefined8 *)(param_1 + 0x215c0) = 0;
  FUN_1401e27c0(param_1 + 0x168,local_res18,**(undefined8 **)(param_1 + 0x170),
                *(undefined8 **)(param_1 + 0x170),uVar1);
  operator_delete(*(void **)(param_1 + 0x170));
  FUN_1402163c0(param_1 + 0x148,local_res18,**(undefined8 **)(param_1 + 0x150),
                *(undefined8 **)(param_1 + 0x150));
  operator_delete(*(void **)(param_1 + 0x150));
  if (*(longlong *)(param_1 + 0x128) != 0) {
    FUN_140216580(*(longlong *)(param_1 + 0x128),*(undefined8 *)(param_1 + 0x130));
    operator_delete(*(void **)(param_1 + 0x128));
  }
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined8 *)(param_1 + 0x138) = 0;
  if (*(void **)(param_1 + 0x108) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x108));
  }
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined8 *)(param_1 + 0x118) = 0;
  if (*(longlong *)(param_1 + 0xe8) != 0) {
    FUN_140216500(*(longlong *)(param_1 + 0xe8),*(undefined8 *)(param_1 + 0xf0));
    operator_delete(*(void **)(param_1 + 0xe8));
  }
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined8 *)(param_1 + 0xf0) = 0;
  *(undefined8 *)(param_1 + 0xf8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xd8)) {
    operator_delete(*(void **)(param_1 + 0xc0));
  }
  *(undefined8 *)(param_1 + 0xd8) = 7;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  *(undefined2 *)(param_1 + 0xc0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xb0)) {
    operator_delete(*(void **)(param_1 + 0x98));
  }
  *(undefined8 *)(param_1 + 0xb0) = 7;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined2 *)(param_1 + 0x98) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x88)) {
    operator_delete(*(void **)(param_1 + 0x70));
  }
  *(undefined8 *)(param_1 + 0x88) = 7;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined2 *)(param_1 + 0x70) = 0;
  return;
}



void FUN_140215e80(int *param_1,ulonglong *param_2,undefined4 param_3)

{
  ulonglong *puVar1;
  int iVar2;
  bool bVar3;
  undefined4 local_res18 [4];
  undefined8 uVar4;
  int *piVar5;
  
  uVar4 = 0xfffffffffffffffe;
  local_res18[0] = param_3;
  piVar5 = param_1 + 0x8588;
  FUN_14034ed40();
  puVar1 = *(ulonglong **)(param_1 + 0x3a);
  do {
    if (puVar1 == *(ulonglong **)(param_1 + 0x3c)) {
LAB_140215f01:
      if ((*param_1 != 0) && (*(longlong *)(param_1 + 0x42) != *(longlong *)(param_1 + 0x44))) {
        (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x62) + 0x440) + 0x410))
                  ((longlong *)(*(longlong *)(param_1 + 0x62) + 0x440),*param_1,&DAT_1405d85a0,
                   param_1 + 1,param_2,local_res18,uVar4,piVar5,1);
      }
      FUN_14034edd0(param_1 + 0x8588);
      return;
    }
    bVar3 = *puVar1 < *param_2;
    if ((*puVar1 == *param_2) && (bVar3 = puVar1[1] < param_2[1], puVar1[1] == param_2[1])) {
      iVar2 = 0;
    }
    else {
      iVar2 = (1 - (uint)bVar3) - (uint)(bVar3 != 0);
    }
    if (iVar2 == 0) {
      *(undefined4 *)(puVar1 + 3) = local_res18[0];
      goto LAB_140215f01;
    }
    puVar1 = puVar1 + 0x10;
  } while( true );
}



void FUN_140215f70(longlong param_1)

{
  FUN_140215fd0();
  FUN_14034edf0(param_1 + 0x21458);
  if (*(void **)(param_1 + 0x21420) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x21420));
  }
  *(undefined8 *)(param_1 + 0x21420) = 0;
  *(undefined8 *)(param_1 + 0x21428) = 0;
  *(undefined8 *)(param_1 + 0x21430) = 0;
  return;
}



// WARNING: Removing unreachable block (ram,0x000140216023)

void FUN_140215fd0(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 local_b8 [168];
  undefined4 local_10;
  
  *(undefined8 *)(param_1 + 0x21440) = 0;
  *(undefined1 *)(param_1 + 0x21448) = 0;
  *(undefined1 *)(param_1 + 0x21450) = 0;
  if (*(longlong *)(param_1 + 0x21420) != *(longlong *)(param_1 + 0x21428)) {
    *(longlong *)(param_1 + 0x21428) = *(longlong *)(param_1 + 0x21420);
  }
  lVar1 = 10;
  do {
    lVar2 = 0x48;
    do {
      FUN_14000a170(local_b8);
      local_10 = 0;
      FUN_140090020(param_1,local_b8);
      param_1 = param_1 + 0xac;
      lVar2 = lVar2 + -1;
    } while (lVar2 != 0);
    lVar1 = lVar1 + -1;
  } while (lVar1 != 0);
  return;
}



void FUN_1402160c0(undefined8 *param_1)

{
  undefined8 *puVar1;
  
  puVar1 = param_1 + 0x21;
  FUN_14034ed40(puVar1);
  if (param_1[0x15] != param_1[0x16]) {
    FUN_14020feb0(param_1 + 0x15);
  }
  FUN_14034ed40(param_1 + 0xd);
  if (param_1[9] != param_1[10]) {
    FUN_1402161e0(param_1 + 9);
  }
  FUN_14034edd0(param_1 + 0xd);
  FUN_14034edd0(puVar1);
  FUN_14034edf0(puVar1);
  if ((void *)param_1[0x19] != (void *)0x0) {
    operator_delete((void *)param_1[0x19]);
  }
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  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;
  FUN_140215bd0(param_1 + 9);
  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: Removing unreachable block (ram,0x0001402161f8)
// WARNING: Removing unreachable block (ram,0x000140216210)
// WARNING: Removing unreachable block (ram,0x000140216239)

void FUN_1402161e0(longlong *param_1)

{
  if (*param_1 != param_1[1]) {
    param_1[1] = *param_1;
  }
  return;
}



void FUN_140216250(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140216500(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_140216290(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140216580(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1402162d0(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_140216350(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;
}



void FUN_140216350(undefined8 param_1,longlong *param_2)

{
  char cVar1;
  longlong *plVar2;
  
  cVar1 = *(char *)((longlong)param_2 + 0x21);
  while (cVar1 == '\0') {
    FUN_140216350(param_1,param_2[2]);
    plVar2 = (longlong *)*param_2;
    operator_delete(param_2);
    param_2 = plVar2;
    cVar1 = *(char *)((longlong)plVar2 + 0x21);
  }
  return;
}



void FUN_1402163b0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001402163b4. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_1 + 8));
  return;
}



undefined8 * FUN_1402163c0(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_1402162d0();
    *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_14015f880(param_1,local_res8,param_3);
    param_3 = local_res18;
  }
  *param_2 = param_3;
  return param_2;
}



void FUN_1402164a0(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_140216500(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0xd;
    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 + 3;
      puVar2 = puVar2 + 0x10;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_140216580(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0xb;
    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 + 0xd;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_140216600(undefined8 param_1,wchar_t *param_2)

{
  wchar_t wVar1;
  longlong lVar2;
  ulonglong uVar3;
  int iVar4;
  wchar_t *pwVar5;
  wchar_t local_208;
  undefined1 local_206 [510];
  
  uVar3 = 0xffffffffffffffff;
  pwVar5 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    wVar1 = *pwVar5;
    pwVar5 = pwVar5 + 1;
  } while (wVar1 != L'\0');
  if (1 < ~uVar3 - 1) {
    local_208 = L'\0';
    memset(local_206,0,0x1fe);
    wcscpy_s(&local_208,0x100,param_2);
    iVar4 = (int)(~uVar3 - 1) + -1;
    lVar2 = (longlong)iVar4;
    if (-1 < iVar4) {
      do {
        if (param_2[lVar2] == L'_') {
          *(undefined2 *)(local_206 + (longlong)iVar4 * 2 + -2) = 0;
          break;
        }
        iVar4 = iVar4 + -1;
        lVar2 = lVar2 + -1;
      } while (-1 < lVar2);
    }
    uVar3 = 0xffffffffffffffff;
    pwVar5 = &local_208;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      wVar1 = *pwVar5;
      pwVar5 = pwVar5 + 1;
    } while (wVar1 != L'\0');
    FUN_140001710(param_1,&local_208,~uVar3 - 1);
    FUN_140002aa0(param_1,&DAT_1404ad198,3);
  }
  return;
}



undefined8 * FUN_1402166f0(undefined8 *param_1)

{
  FUN_1402f4980();
  *param_1 = MGSCharacter::vftable;
  param_1[0x266] = 0;
  param_1[0x267] = 0;
  *(undefined4 *)(param_1 + 0x268) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1344) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x134c) = 0;
  *(undefined4 *)(param_1 + 0x26a) = 0x3f800000;
  param_1[0x27b] = 0;
  param_1[0x27c] = 0;
  param_1[0x27d] = 0;
  param_1[0x27e] = 0;
  *(undefined1 *)(param_1 + 0x27f) = 1;
  *(undefined8 *)((longlong)param_1 + 0x13fc) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1404) = 0;
  *(undefined8 *)((longlong)param_1 + 0x140c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1414) = 0;
  *(undefined8 *)((longlong)param_1 + 0x141c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1424) = 0;
  *(undefined8 *)((longlong)param_1 + 0x142c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1434) = 0;
  *(undefined8 *)((longlong)param_1 + 0x143c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1444) = 0;
  *(undefined4 *)((longlong)param_1 + 0x144c) = 0;
  param_1[0x28a] = 0;
  param_1[0x28b] = 0x4034000000000000;
  param_1[0x28c] = 0;
  param_1[0x28d] = 0;
  param_1[0x292] = 7;
  param_1[0x291] = 0;
  *(undefined2 *)(param_1 + 0x28f) = 0;
  param_1[0x297] = 7;
  param_1[0x296] = 0;
  *(undefined2 *)(param_1 + 0x294) = 0;
  param_1[0x29c] = 7;
  param_1[0x29b] = 0;
  *(undefined2 *)(param_1 + 0x299) = 0;
  param_1[0x2a1] = 7;
  param_1[0x2a0] = 0;
  *(undefined2 *)(param_1 + 0x29e) = 0;
  param_1[0x2a6] = 7;
  param_1[0x2a5] = 0;
  *(undefined2 *)(param_1 + 0x2a3) = 0;
  param_1[0x2ab] = 7;
  param_1[0x2aa] = 0;
  *(undefined2 *)(param_1 + 0x2a8) = 0;
  param_1[0x2b0] = 7;
  param_1[0x2af] = 0;
  *(undefined2 *)(param_1 + 0x2ad) = 0;
  param_1[0x2b5] = 7;
  param_1[0x2b4] = 0;
  *(undefined2 *)(param_1 + 0x2b2) = 0;
  param_1[0x2ba] = 7;
  param_1[0x2b9] = 0;
  *(undefined2 *)(param_1 + 0x2b7) = 0;
  param_1[0x2bf] = 7;
  param_1[0x2be] = 0;
  *(undefined2 *)(param_1 + 700) = 0;
  param_1[0x2c4] = 7;
  param_1[0x2c3] = 0;
  *(undefined2 *)(param_1 + 0x2c1) = 0;
  param_1[0x2c9] = 7;
  param_1[0x2c8] = 0;
  *(undefined2 *)(param_1 + 0x2c6) = 0;
  param_1[0x2ce] = 7;
  param_1[0x2cd] = 0;
  *(undefined2 *)(param_1 + 0x2cb) = 0;
  param_1[0x2d3] = 7;
  param_1[0x2d2] = 0;
  *(undefined2 *)(param_1 + 0x2d0) = 0;
  param_1[0x2d8] = 7;
  param_1[0x2d7] = 0;
  *(undefined2 *)(param_1 + 0x2d5) = 0;
  param_1[0x2dd] = 7;
  param_1[0x2dc] = 0;
  *(undefined2 *)(param_1 + 0x2da) = 0;
  param_1[0x2e2] = 7;
  param_1[0x2e1] = 0;
  *(undefined2 *)(param_1 + 0x2df) = 0;
  param_1[0x2e7] = 7;
  param_1[0x2e6] = 0;
  *(undefined2 *)(param_1 + 0x2e4) = 0;
  param_1[0x2ec] = 7;
  param_1[0x2eb] = 0;
  *(undefined2 *)(param_1 + 0x2e9) = 0;
  param_1[0x2f1] = 7;
  param_1[0x2f0] = 0;
  *(undefined2 *)(param_1 + 0x2ee) = 0;
  param_1[0x2f3] = 0;
  param_1[0x2f4] = 0;
  param_1[0x2f5] = 0;
  param_1[0x2f6] = 0;
  param_1[0x2f7] = 0;
  param_1[0x2f8] = 0;
  param_1[0x2fa] = 0;
  param_1[0x2fb] = 0;
  param_1[0x2fc] = 0;
  param_1[0x300] = 7;
  param_1[0x2ff] = 0;
  *(undefined2 *)(param_1 + 0x2fd) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1814) = 0;
  *(undefined4 *)((longlong)param_1 + 0x181c) = 0;
  *(undefined4 *)(param_1 + 0x304) = 0x43960000;
  *(undefined1 *)((longlong)param_1 + 0x1824) = 1;
  *(undefined4 *)(param_1 + 0x305) = 0;
  param_1[0x306] = 0;
  param_1[0x307] = 0;
  *(undefined4 *)(param_1 + 0x308) = 0;
  param_1[0x309] = 0;
  param_1[0x30a] = 0;
  *(undefined4 *)(param_1 + 0x30b) = 0;
  *(undefined2 *)(param_1 + 0x30d) = 0;
  *(undefined1 *)((longlong)param_1 + 0x186a) = 1;
  param_1[0x30e] = 0;
  *(undefined2 *)(param_1 + 0x30f) = 0;
  *(undefined8 *)((longlong)param_1 + 0x187c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1884) = 0;
  *(undefined8 *)((longlong)param_1 + 0x188c) = 0;
  param_1[0x313] = 0;
  param_1[0x314] = 0x3ff0000000000000;
  param_1[0x315] = 0;
  param_1[0x316] = 0;
  param_1[0x317] = 0;
  *(undefined4 *)(param_1 + 0x319) = 0;
  param_1[0x31a] = 0;
  *(undefined4 *)(param_1 + 0x31b) = 0x3f800000;
  *(undefined2 *)((longlong)param_1 + 0x18dc) = 0;
  *(undefined1 *)((longlong)param_1 + 0x18de) = 0;
  param_1[0x31c] = 0;
  param_1[0x31d] = 0;
  param_1[0x31e] = 0;
  *(undefined4 *)(param_1 + 799) = 0;
  param_1[0x324] = 0;
  *(undefined4 *)(param_1 + 0x325) = 0;
  *(undefined8 *)((longlong)param_1 + 0x192c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1934) = 0;
  param_1[0x327] = 0;
  *(undefined4 *)(param_1 + 0x328) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1944) = 0;
  *(undefined8 *)((longlong)param_1 + 0x194c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x18fc) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0x1904) = 0;
  *(undefined8 *)((longlong)param_1 + 0x190c) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0x1914) = 0;
  *(undefined4 *)((longlong)param_1 + 0x191c) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0x1954) = 0;
  *(undefined4 *)((longlong)param_1 + 0x195c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1984) = 0;
  *(undefined4 *)((longlong)param_1 + 0x198c) = 0;
  param_1[0x332] = 0;
  *(undefined4 *)(param_1 + 0x333) = 0;
  *(undefined8 *)((longlong)param_1 + 0x199c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x19a4) = 0;
  param_1[0x335] = 0;
  param_1[0x336] = 0;
  param_1[0x32c] = 0x3f800000;
  param_1[0x32d] = 0;
  param_1[0x32e] = 0x3f800000;
  param_1[0x32f] = 0;
  *(undefined4 *)(param_1 + 0x330) = 0x3f800000;
  param_1[0x337] = 0;
  *(undefined4 *)(param_1 + 0x338) = 0;
  param_1[0x33d] = 0;
  *(undefined4 *)(param_1 + 0x33e) = 0;
  *(undefined8 *)((longlong)param_1 + 0x19f4) = 0;
  *(undefined4 *)((longlong)param_1 + 0x19fc) = 0;
  param_1[0x340] = 0;
  *(undefined4 *)(param_1 + 0x341) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a0c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a14) = 0;
  *(undefined8 *)((longlong)param_1 + 0x19c4) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0x19cc) = 0;
  *(undefined8 *)((longlong)param_1 + 0x19d4) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0x19dc) = 0;
  *(undefined4 *)((longlong)param_1 + 0x19e4) = 0x3f800000;
  *(undefined1 *)((longlong)param_1 + 0x1a1c) = 0;
  param_1[0x344] = 0;
  param_1[0x345] = 0;
  *(undefined1 *)(param_1 + 0x346) = 0;
  param_1[0x347] = 0;
  *(undefined1 *)(param_1 + 0x348) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a44) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1a4c) = 0x3f800000;
  *(undefined1 *)(param_1 + 0x34a) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a54) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a5c) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0x1a64) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a6c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a74) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a7c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1a84) = 0;
  param_1[0x352] = 0;
  param_1[0x353] = 0;
  param_1[0x354] = 0;
  param_1[0x355] = 0;
  param_1[0x356] = 0;
  *(undefined4 *)(param_1 + 0x357) = 0;
  param_1[0x35c] = 0;
  param_1[0x35d] = 0;
  *(undefined4 *)(param_1 + 0x35e) = 0;
  param_1[0x35f] = 0;
  param_1[0x360] = 0;
  param_1[0x361] = 0;
  param_1[0x366] = 7;
  param_1[0x365] = 0;
  *(undefined2 *)(param_1 + 0x363) = 0;
  _eh_vector_constructor_iterator_
            (param_1 + 0x368,0x28,4,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  param_1[0x37f] = 7;
  param_1[0x37e] = 0;
  *(undefined2 *)(param_1 + 0x37c) = 0;
  *(undefined4 *)(param_1 + 0x381) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1c0c) = 0x3f800000;
  FUN_1402ca220(param_1 + 0x382);
  *(undefined1 *)(param_1 + 0x38a) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1c54) = 1;
  *(undefined4 *)((longlong)param_1 + 0x1c64) = 0;
  param_1[0x38d] = 0;
  *(undefined4 *)(param_1 + 0x38e) = 0;
  param_1[0x38f] = 0;
  param_1[0x391] = 0;
  param_1[0x393] = 0;
  param_1[0x395] = 0x44bb8000;
  param_1[0x396] = 0;
  *(undefined4 *)(param_1 + 0x397) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1cbc) = 0;
  param_1[0x398] = 0;
  param_1[0x399] = 0;
  param_1[0x39a] = 0;
  param_1[0x39b] = 0;
  _eh_vector_constructor_iterator_
            (param_1 + 0x3ab,0x28,3,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  param_1[0x3bd] = 7;
  param_1[0x3bc] = 0;
  *(undefined2 *)(param_1 + 0x3ba) = 0;
  *(undefined1 *)(param_1 + 0x3bf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1dfc) = 0;
  param_1[0x3c0] = 0;
  param_1[0x3c1] = 0;
  *(undefined4 *)(param_1 + 0x3c2) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1e14) = 0xff000000;
  param_1[0x3c3] = 0;
  *(undefined4 *)(param_1 + 0x3c4) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1e24) = 0xff000000;
  param_1[0x3c5] = 0;
  param_1[0x3c6] = 0;
  param_1[0x3c7] = 0;
  param_1[0x3c8] = 0x3f800000;
  param_1[0x3c9] = 0;
  param_1[0x3ca] = 0x3f800000;
  param_1[0x3cb] = 0;
  param_1[0x3cc] = 0;
  param_1[0x3cd] = 0;
  param_1[0x3ce] = 0;
  param_1[0x3d0] = 0;
  param_1[0x3d1] = 0;
  *(undefined4 *)(param_1 + 0x3d2) = 0;
  *(undefined1 *)(param_1 + 0x3d4) = 0;
  param_1[0x3d5] = 0;
  *(undefined4 *)(param_1 + 0x3d6) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1eb4) = 0;
  param_1[0x3d7] = 0;
  *(undefined1 *)(param_1 + 0x3d8) = 1;
  *(undefined8 *)((longlong)param_1 + 0x1ec4) = 0;
  param_1[0x3da] = 0;
  *(undefined4 *)(param_1 + 0x3db) = 0;
  param_1[0x3df] = 7;
  param_1[0x3de] = 0;
  *(undefined2 *)(param_1 + 0x3dc) = 0;
  param_1[0x3e1] = 0;
  param_1[0x3e2] = 0;
  param_1[0x3e3] = 0;
  param_1[0x3e5] = 0;
  param_1[0x3e6] = 0;
  param_1[999] = 0;
  param_1[0x3e9] = 0;
  param_1[0x3ea] = 0;
  param_1[0x3eb] = 0;
  param_1[0x3ed] = 0;
  param_1[0x3ee] = 0;
  param_1[0x3ef] = 0;
  param_1[0x3f1] = 0;
  param_1[0x3f2] = 0;
  param_1[0x3f3] = 0;
  param_1[0x3f5] = 0;
  param_1[0x3f6] = 0;
  param_1[0x3f7] = 0;
  param_1[0x3f9] = 0;
  param_1[0x3fa] = 0;
  param_1[0x3fb] = 0;
  param_1[0x3fd] = 0;
  param_1[0x3fe] = 0;
  param_1[0x3ff] = 0;
  param_1[0x401] = 0;
  param_1[0x402] = 0;
  param_1[0x403] = 0;
  *(undefined1 *)(param_1 + 0x405) = 0;
  *(undefined8 *)((longlong)param_1 + 0x202c) = 0;
  *(undefined1 *)((longlong)param_1 + 0x2034) = 1;
  *(undefined4 *)(param_1 + 0x40b) = 0;
  param_1[0x40c] = 0;
  param_1[0x40d] = 0;
  param_1[0x40e] = 0;
  param_1[0x40f] = 0;
  *(undefined4 *)(param_1 + 0x410) = 0;
  param_1[0x411] = 0;
  param_1[0x412] = 0;
  *(undefined2 *)(param_1 + 0x413) = 0;
  param_1[0x417] = 7;
  param_1[0x416] = 0;
  *(undefined2 *)(param_1 + 0x414) = 0;
  *(undefined4 *)(param_1 + 0x419) = 0;
  param_1[0x271] = 0;
  param_1[0x270] = 0;
  *(undefined8 *)((longlong)param_1 + 0x1374) = 0;
  *(undefined8 *)((longlong)param_1 + 0x136c) = 0;
  param_1[0x26c] = 0;
  param_1[0x26b] = 0;
  *(undefined4 *)(param_1 + 0x272) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x137c) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x26d) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x1354) = 0x3f800000;
  param_1[0x279] = 0;
  param_1[0x278] = 0;
  *(undefined8 *)((longlong)param_1 + 0x13b4) = 0;
  *(undefined8 *)((longlong)param_1 + 0x13ac) = 0;
  param_1[0x274] = 0;
  param_1[0x273] = 0;
  *(undefined4 *)(param_1 + 0x27a) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x13bc) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x275) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x1394) = 0x3f800000;
  FUN_140001710(param_1 + 0x294,&DAT_14049dca8,6);
  FUN_140001710(param_1 + 0x2ee,L"reaction01",10);
  param_1[0x3c1] = 0;
  param_1[0x3c2] = 0;
  param_1[0x3c3] = 0;
  param_1[0x3c4] = 0;
  memset(param_1 + 0x39c,0,0x78);
  return param_1;
}



void * FUN_1402171d0(void *param_1,uint param_2)

{
  FUN_1402172a0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140217200(void *param_1)

{
  _eh_vector_destructor_iterator_(param_1,0x28,3,FUN_14023be90);
  return;
}



void FUN_140217220(longlong *param_1)

{
  undefined8 *puVar1;
  void *_Dst;
  longlong *plVar2;
  
  plVar2 = (longlong *)*param_1;
  if (plVar2 != (longlong *)param_1[1]) {
    do {
      puVar1 = (undefined8 *)*plVar2;
      if (puVar1 != (undefined8 *)0x0) {
        (**(code **)*puVar1)(puVar1,1);
      }
      plVar2 = plVar2 + 1;
    } while (plVar2 != (longlong *)param_1[1]);
  }
  _Dst = (void *)*param_1;
  if (_Dst != (void *)param_1[1]) {
    memmove(_Dst,(void *)param_1[1],0);
    param_1[1] = (longlong)_Dst;
  }
  return;
}



void FUN_1402172a0(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  int iVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  longlong local_50;
  
  *param_1 = MGSCharacter::vftable;
  lVar5 = 0;
  local_50 = 0;
  bVar7 = false;
  plVar3 = (longlong *)param_1[0x25d];
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == (longlong *)param_1[0x25e]) {
      if (*plVar3 != 0) {
        if (plVar3 != (longlong *)0x0) {
          if (plVar3 == (longlong *)param_1[0x25e]) {
            lVar5 = *plVar3;
          }
          else {
            iVar4 = DAT_1406080a8 + 1;
            bVar7 = DAT_1406080a8 == 0;
            DAT_1406080a8 = iVar4;
            if (bVar7) {
              FUN_140176d60(1);
            }
          }
        }
        FUN_14034ed40();
        bVar7 = true;
        local_50 = lVar5;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1402ca8c0(DAT_1406081e0,param_1 + 0x27b);
  param_1[0x27b] = 0;
  plVar3 = (longlong *)param_1[0x27c];
  param_1[0x27c] = 0;
  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);
      }
    }
  }
  FUN_140217220(param_1 + 0x3ed);
  FUN_140217220(param_1 + 0x3e9);
  FUN_140217220(param_1 + 0x3e1);
  FUN_140217220(param_1 + 0x3e5);
  FUN_140217220(param_1 + 0x3f1);
  FUN_140217220(param_1 + 0x3f5);
  FUN_140217220(param_1 + 0x3f9);
  if (bVar7) {
    FUN_14034edd0(local_50);
  }
  FUN_14034ed40(param_1 + 0x25f);
  FUN_140217220(param_1 + 0x3fd);
  FUN_14034edd0(param_1 + 0x25f);
  if (7 < (ulonglong)param_1[0x417]) {
    operator_delete((void *)param_1[0x414]);
  }
  param_1[0x417] = 7;
  param_1[0x416] = 0;
  *(undefined2 *)(param_1 + 0x414) = 0;
  if ((void *)param_1[0x401] != (void *)0x0) {
    operator_delete((void *)param_1[0x401]);
  }
  param_1[0x401] = 0;
  param_1[0x402] = 0;
  param_1[0x403] = 0;
  if ((void *)param_1[0x3fd] != (void *)0x0) {
    operator_delete((void *)param_1[0x3fd]);
  }
  param_1[0x3fd] = 0;
  param_1[0x3fe] = 0;
  param_1[0x3ff] = 0;
  if ((void *)param_1[0x3f9] != (void *)0x0) {
    operator_delete((void *)param_1[0x3f9]);
  }
  param_1[0x3f9] = 0;
  param_1[0x3fa] = 0;
  param_1[0x3fb] = 0;
  if ((void *)param_1[0x3f5] != (void *)0x0) {
    operator_delete((void *)param_1[0x3f5]);
  }
  param_1[0x3f5] = 0;
  param_1[0x3f6] = 0;
  param_1[0x3f7] = 0;
  if ((void *)param_1[0x3f1] != (void *)0x0) {
    operator_delete((void *)param_1[0x3f1]);
  }
  param_1[0x3f1] = 0;
  param_1[0x3f2] = 0;
  param_1[0x3f3] = 0;
  if ((void *)param_1[0x3ed] != (void *)0x0) {
    operator_delete((void *)param_1[0x3ed]);
  }
  param_1[0x3ed] = 0;
  param_1[0x3ee] = 0;
  param_1[0x3ef] = 0;
  if ((void *)param_1[0x3e9] != (void *)0x0) {
    operator_delete((void *)param_1[0x3e9]);
  }
  param_1[0x3e9] = 0;
  param_1[0x3ea] = 0;
  param_1[0x3eb] = 0;
  if ((void *)param_1[0x3e5] != (void *)0x0) {
    operator_delete((void *)param_1[0x3e5]);
  }
  param_1[0x3e5] = 0;
  param_1[0x3e6] = 0;
  param_1[999] = 0;
  if ((void *)param_1[0x3e1] != (void *)0x0) {
    operator_delete((void *)param_1[0x3e1]);
  }
  param_1[0x3e1] = 0;
  param_1[0x3e2] = 0;
  param_1[0x3e3] = 0;
  if (7 < (ulonglong)param_1[0x3df]) {
    operator_delete((void *)param_1[0x3dc]);
  }
  param_1[0x3df] = 7;
  param_1[0x3de] = 0;
  *(undefined2 *)(param_1 + 0x3dc) = 0;
  if ((void *)param_1[0x3cc] != (void *)0x0) {
    operator_delete((void *)param_1[0x3cc]);
  }
  param_1[0x3cc] = 0;
  param_1[0x3cd] = 0;
  param_1[0x3ce] = 0;
  if (7 < (ulonglong)param_1[0x3bd]) {
    operator_delete((void *)param_1[0x3ba]);
  }
  param_1[0x3bd] = 7;
  param_1[0x3bc] = 0;
  *(undefined2 *)(param_1 + 0x3ba) = 0;
  _eh_vector_destructor_iterator_(param_1 + 0x3ab,0x28,3,FUN_14023be90);
  FUN_14020f640(param_1 + 0x393);
  FUN_14020f700(param_1 + 0x391);
  FUN_1401975d0(param_1 + 0x38f);
  if (param_1[0x382] != 0) {
    FUN_14012e3f0();
  }
  if (7 < (ulonglong)param_1[0x37f]) {
    operator_delete((void *)param_1[0x37c]);
  }
  param_1[0x37f] = 7;
  param_1[0x37e] = 0;
  *(undefined2 *)(param_1 + 0x37c) = 0;
  _eh_vector_destructor_iterator_(param_1 + 0x368,0x28,4,FUN_14023be90);
  if (7 < (ulonglong)param_1[0x366]) {
    operator_delete((void *)param_1[0x363]);
  }
  param_1[0x366] = 7;
  param_1[0x365] = 0;
  *(undefined2 *)(param_1 + 0x363) = 0;
  if (param_1[0x35f] != 0) {
    FUN_14008d0a0(param_1[0x35f],param_1[0x360]);
    operator_delete((void *)param_1[0x35f]);
  }
  param_1[0x35f] = 0;
  param_1[0x360] = 0;
  param_1[0x361] = 0;
  if ((void *)param_1[0x315] != (void *)0x0) {
    operator_delete((void *)param_1[0x315]);
  }
  param_1[0x315] = 0;
  param_1[0x316] = 0;
  param_1[0x317] = 0;
  if (7 < (ulonglong)param_1[0x300]) {
    operator_delete((void *)param_1[0x2fd]);
  }
  param_1[0x300] = 7;
  param_1[0x2ff] = 0;
  *(undefined2 *)(param_1 + 0x2fd) = 0;
  FUN_14023ae90(param_1 + 0x2f8);
  if (7 < (ulonglong)param_1[0x2f1]) {
    operator_delete((void *)param_1[0x2ee]);
  }
  param_1[0x2f1] = 7;
  param_1[0x2f0] = 0;
  *(undefined2 *)(param_1 + 0x2ee) = 0;
  if (7 < (ulonglong)param_1[0x2ec]) {
    operator_delete((void *)param_1[0x2e9]);
  }
  param_1[0x2ec] = 7;
  param_1[0x2eb] = 0;
  *(undefined2 *)(param_1 + 0x2e9) = 0;
  if (7 < (ulonglong)param_1[0x2e7]) {
    operator_delete((void *)param_1[0x2e4]);
  }
  param_1[0x2e7] = 7;
  param_1[0x2e6] = 0;
  *(undefined2 *)(param_1 + 0x2e4) = 0;
  if (7 < (ulonglong)param_1[0x2e2]) {
    operator_delete((void *)param_1[0x2df]);
  }
  param_1[0x2e2] = 7;
  param_1[0x2e1] = 0;
  *(undefined2 *)(param_1 + 0x2df) = 0;
  if (7 < (ulonglong)param_1[0x2dd]) {
    operator_delete((void *)param_1[0x2da]);
  }
  param_1[0x2dd] = 7;
  param_1[0x2dc] = 0;
  *(undefined2 *)(param_1 + 0x2da) = 0;
  if (7 < (ulonglong)param_1[0x2d8]) {
    operator_delete((void *)param_1[0x2d5]);
  }
  param_1[0x2d8] = 7;
  param_1[0x2d7] = 0;
  *(undefined2 *)(param_1 + 0x2d5) = 0;
  if (7 < (ulonglong)param_1[0x2d3]) {
    operator_delete((void *)param_1[0x2d0]);
  }
  param_1[0x2d3] = 7;
  param_1[0x2d2] = 0;
  *(undefined2 *)(param_1 + 0x2d0) = 0;
  if (7 < (ulonglong)param_1[0x2ce]) {
    operator_delete((void *)param_1[0x2cb]);
  }
  param_1[0x2ce] = 7;
  param_1[0x2cd] = 0;
  *(undefined2 *)(param_1 + 0x2cb) = 0;
  if (7 < (ulonglong)param_1[0x2c9]) {
    operator_delete((void *)param_1[0x2c6]);
  }
  param_1[0x2c9] = 7;
  param_1[0x2c8] = 0;
  *(undefined2 *)(param_1 + 0x2c6) = 0;
  if (7 < (ulonglong)param_1[0x2c4]) {
    operator_delete((void *)param_1[0x2c1]);
  }
  param_1[0x2c4] = 7;
  param_1[0x2c3] = 0;
  *(undefined2 *)(param_1 + 0x2c1) = 0;
  if (7 < (ulonglong)param_1[0x2bf]) {
    operator_delete((void *)param_1[700]);
  }
  param_1[0x2bf] = 7;
  param_1[0x2be] = 0;
  *(undefined2 *)(param_1 + 700) = 0;
  if (7 < (ulonglong)param_1[0x2ba]) {
    operator_delete((void *)param_1[0x2b7]);
  }
  param_1[0x2ba] = 7;
  param_1[0x2b9] = 0;
  *(undefined2 *)(param_1 + 0x2b7) = 0;
  if (7 < (ulonglong)param_1[0x2b5]) {
    operator_delete((void *)param_1[0x2b2]);
  }
  param_1[0x2b5] = 7;
  param_1[0x2b4] = 0;
  *(undefined2 *)(param_1 + 0x2b2) = 0;
  if (7 < (ulonglong)param_1[0x2b0]) {
    operator_delete((void *)param_1[0x2ad]);
  }
  param_1[0x2b0] = 7;
  param_1[0x2af] = 0;
  *(undefined2 *)(param_1 + 0x2ad) = 0;
  if (7 < (ulonglong)param_1[0x2ab]) {
    operator_delete((void *)param_1[0x2a8]);
  }
  param_1[0x2ab] = 7;
  param_1[0x2aa] = 0;
  *(undefined2 *)(param_1 + 0x2a8) = 0;
  if (7 < (ulonglong)param_1[0x2a6]) {
    operator_delete((void *)param_1[0x2a3]);
  }
  param_1[0x2a6] = 7;
  param_1[0x2a5] = 0;
  *(undefined2 *)(param_1 + 0x2a3) = 0;
  if (7 < (ulonglong)param_1[0x2a1]) {
    operator_delete((void *)param_1[0x29e]);
  }
  param_1[0x2a1] = 7;
  param_1[0x2a0] = 0;
  *(undefined2 *)(param_1 + 0x29e) = 0;
  if (7 < (ulonglong)param_1[0x29c]) {
    operator_delete((void *)param_1[0x299]);
  }
  param_1[0x29c] = 7;
  param_1[0x29b] = 0;
  *(undefined2 *)(param_1 + 0x299) = 0;
  if (7 < (ulonglong)param_1[0x297]) {
    operator_delete((void *)param_1[0x294]);
  }
  param_1[0x297] = 7;
  param_1[0x296] = 0;
  *(undefined2 *)(param_1 + 0x294) = 0;
  if (7 < (ulonglong)param_1[0x292]) {
    operator_delete((void *)param_1[0x28f]);
  }
  param_1[0x292] = 7;
  param_1[0x291] = 0;
  *(undefined2 *)(param_1 + 0x28f) = 0;
  plVar3 = (longlong *)param_1[0x27e];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x27c];
  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);
      }
    }
  }
  FUN_1402f6970(param_1);
  return;
}



void FUN_140217c30(longlong *param_1)

{
  int *piVar1;
  longlong lVar2;
  void *pvVar3;
  int iVar4;
  undefined4 uVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  bool bVar8;
  float fVar9;
  float fVar10;
  undefined4 uVar11;
  undefined8 local_res8;
  undefined8 local_res10;
  undefined8 uVar12;
  undefined8 *local_40;
  undefined8 *local_38;
  undefined1 local_30 [40];
  
  uVar12 = 0xfffffffffffffffe;
  FUN_1402f7040();
  local_res8 = 0;
  local_res10 = 0;
  puVar7 = (undefined8 *)(param_1[0x26] + 0x3b8);
  if (7 < *(ulonglong *)(param_1[0x26] + 0x3d0)) {
    puVar7 = (undefined8 *)*puVar7;
  }
  plVar6 = (longlong *)FUN_14020e6d0(DAT_140608070,&local_40,&local_res8,puVar7,uVar12);
  if (param_1[0x391] != *plVar6) {
    FUN_14020f700(param_1 + 0x391);
    lVar2 = *plVar6;
    param_1[0x391] = lVar2;
    param_1[0x392] = lVar2;
    if (lVar2 != 0) {
      LOCK();
      *(int *)(lVar2 + 8) = *(int *)(lVar2 + 8) + 1;
      UNLOCK();
    }
  }
  puVar7 = local_40;
  if (local_40 != (undefined8 *)0x0) {
    if (local_40 == local_38) {
      if (local_40 != (undefined8 *)0x0) {
        LOCK();
        piVar1 = (int *)(local_40 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          local_40 = (undefined8 *)0x0;
          pvVar3 = (void *)*puVar7;
          if (pvVar3 != (void *)0x0) {
            FUN_140276130(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar7);
        }
      }
    }
    else {
      iVar4 = DAT_14060815c + 1;
      bVar8 = DAT_14060815c == 0;
      DAT_14060815c = iVar4;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  puVar7 = (undefined8 *)(param_1[0x26] + 0x5c0);
  if (7 < *(ulonglong *)(param_1[0x26] + 0x5d8)) {
    puVar7 = (undefined8 *)*puVar7;
  }
  plVar6 = (longlong *)FUN_14020ea60(DAT_140608070,local_30,&local_res10,puVar7);
  if (param_1[0x393] != *plVar6) {
    FUN_14020f640(param_1 + 0x393);
    lVar2 = *plVar6;
    param_1[0x393] = lVar2;
    param_1[0x394] = lVar2;
    if (lVar2 != 0) {
      LOCK();
      *(int *)(lVar2 + 8) = *(int *)(lVar2 + 8) + 1;
      UNLOCK();
    }
  }
  FUN_14020f640(local_30);
  *(undefined4 *)(param_1 + 0x395) = 0x44bb8000;
  FUN_140218000(param_1,param_1 + 0x2f);
  FUN_140218150(param_1,param_1 + 0x2f);
  iVar4 = (**(code **)(*param_1 + 0xb0))(param_1);
  if ((iVar4 == 4) && (plVar6 = (longlong *)param_1[0x3d0], plVar6 != (longlong *)0x0)) {
    *(undefined4 *)(param_1 + 0x18b) = *(undefined4 *)(plVar6[6] + 0x2d8);
    uVar5 = (**(code **)(*plVar6 + 0x1e0))();
    uVar11 = *(undefined4 *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x2c8);
    uVar12 = FUN_140165ea0();
    fVar9 = (float)FUN_1401655e0(uVar12,uVar11,(int)param_1[0x18b],uVar5);
    fVar10 = (float)(**(code **)(*param_1 + 0xa90))(param_1);
    *(float *)((longlong)param_1 + 0xc5c) = fVar9 + fVar10;
    uVar11 = *(undefined4 *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x2c8);
    uVar12 = FUN_140165ea0();
    uVar11 = FUN_1401658a0(uVar12,uVar11,(int)param_1[0x18b],uVar5);
    *(undefined4 *)(param_1 + 0x18c) = uVar11;
    uVar11 = (**(code **)(*(longlong *)param_1[0x3d0] + 0x208))();
    *(undefined4 *)(param_1 + 0x419) = uVar11;
    uVar11 = (**(code **)(*(longlong *)param_1[0x3d0] + 0x228))();
    *(undefined4 *)((longlong)param_1 + 0x20cc) = uVar11;
  }
  FUN_140001710(param_1 + 0x3ab,L"attack04_01",0xb);
  FUN_140001710(param_1 + 0x3b0,L"attack04_02",0xb);
  FUN_140001710(param_1 + 0x3b5,L"attack04_03",0xb);
  FUN_140239e80(param_1);
  return;
}



void FUN_140217f20(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x130) != 0) {
    *(float *)(param_1 + 0x1e54) =
         *(float *)(param_1 + 0x1e50) * *(float *)(*(longlong *)(param_1 + 0x130) + 0x2a4);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140217fc2)
// WARNING: Removing unreachable block (ram,0x000140217fd0)

void FUN_140217f50(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *(undefined8 *)(param_1 + 0xed0) = 0;
  plVar3 = *(longlong **)(param_1 + 0xed8);
  *(undefined8 *)(param_1 + 0xed8) = 0;
  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);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2008) != *(longlong *)(param_1 + 0x2010)) {
    *(longlong *)(param_1 + 0x2010) = *(longlong *)(param_1 + 0x2008);
  }
  FUN_1402f7620(param_1);
  return;
}



void FUN_140218000(longlong param_1,float *param_2)

{
  float fVar1;
  float fVar2;
  longlong lVar3;
  float *pfVar4;
  float local_res8 [4];
  float local_res18 [4];
  float local_38;
  float local_34;
  float local_30;
  float local_28;
  float local_24;
  float local_20;
  
  lVar3 = *(longlong *)(param_1 + 0x130);
  if (lVar3 != 0) {
    pfVar4 = local_res8;
    local_res8[0] = *(float *)(lVar3 + 0x294) * 0.5;
    local_res18[0] = *(float *)(lVar3 + 0x2a8);
    if (local_res8[0] <= *(float *)(lVar3 + 0x2a8)) {
      pfVar4 = local_res18;
    }
    fVar1 = param_2[1];
    fVar2 = param_2[2];
    *(float *)(param_1 + 0x18e0) = *param_2;
    *(float *)(param_1 + 0x18e4) = local_res8[0] + fVar1;
    fVar1 = *pfVar4;
    *(float *)(param_1 + 0x18e8) = fVar2;
    *(float *)(param_1 + 0x18ec) = fVar1 + 150.0;
    local_30 = *(float *)(lVar3 + 0x2a8);
    local_34 = param_2[1] + *(float *)(lVar3 + 0x294);
    local_24 = param_2[1] - 150.0;
    local_28 = *param_2 - local_30;
    local_38 = *param_2 + local_30;
    local_20 = param_2[2] - local_30;
    local_30 = param_2[2] + local_30;
    FUN_1402bd590(param_1 + 0x18f0,&local_28,&local_38);
    FUN_1402bd590(param_1 + 0x19b8,&local_28,&local_38);
  }
  return;
}



void FUN_140218150(longlong param_1,float *param_2)

{
  float fVar1;
  float fVar2;
  longlong lVar3;
  float *pfVar4;
  float local_res8 [4];
  float local_res18 [4];
  float local_28;
  float local_24;
  float local_20;
  float local_18;
  float local_14;
  float local_10;
  
  lVar3 = *(longlong *)(param_1 + 0x130);
  if (lVar3 != 0) {
    pfVar4 = local_res8;
    local_res8[0] = *(float *)(lVar3 + 0x294) * 0.5;
    local_res18[0] = *(float *)(lVar3 + 0x2a8);
    if (local_res8[0] <= *(float *)(lVar3 + 0x2a8)) {
      pfVar4 = local_res18;
    }
    fVar1 = param_2[1];
    fVar2 = param_2[2];
    *(float *)(param_1 + 0x18e0) = *param_2;
    *(float *)(param_1 + 0x18e4) = local_res8[0] + fVar1;
    *(float *)(param_1 + 0x18e8) = fVar2;
    *(float *)(param_1 + 0x18ec) = *pfVar4;
    local_10 = *(float *)(lVar3 + 0x2a8);
    local_24 = *(float *)(lVar3 + 0x294) + param_2[1];
    local_28 = *param_2 + local_10;
    local_14 = local_24 - 70.0;
    local_20 = param_2[2] + local_10;
    local_18 = *param_2 - local_10;
    local_10 = param_2[2] - local_10;
    FUN_1402bd590(param_1 + 0x1954,&local_18,&local_28);
  }
  return;
}



void FUN_140218260(longlong param_1,undefined4 *param_2)

{
  float fVar1;
  undefined4 uVar2;
  float fVar3;
  float fVar4;
  
  if (*(longlong *)(param_1 + 0x130) != 0) {
    fVar1 = (float)param_2[1];
    uVar2 = param_2[2];
    fVar3 = *(float *)(*(longlong *)(param_1 + 0x130) + 0x294);
    fVar4 = fVar1 - 150.0;
    *(undefined4 *)(param_1 + 0x19b8) = *param_2;
    *(float *)(param_1 + 0x19bc) = ((fVar1 + fVar3) - fVar4) * 0.5 + fVar4;
    *(undefined4 *)(param_1 + 0x19c0) = uVar2;
  }
  return;
}



void FUN_1402182e0(longlong *param_1,undefined4 *param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined4 local_res8 [2];
  
  *(undefined4 *)(param_1 + 0x2f) = *param_2;
  local_res8[0] = 0;
  *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x30) = param_2[2];
  *(undefined4 *)((longlong)param_1 + 0x16c) = *param_2;
  *(undefined4 *)(param_1 + 0x2e) = param_2[1];
  *(undefined4 *)((longlong)param_1 + 0x174) = param_2[2];
  iVar1 = FUN_1402f9640(0,local_res8,param_1 + 0x2f,1,1);
  if (iVar1 == 1) {
    *(undefined4 *)((longlong)param_1 + 0x17c) = local_res8[0];
    *(undefined4 *)(param_1 + 0x2e) = local_res8[0];
  }
  else {
    (**(code **)(*param_1 + 0x468))(param_1,0);
  }
  *(int *)((longlong)param_1 + 0x534) = (int)param_1[0xa4];
  if ((((param_1[0x3d0] != 0) && (lVar3 = *(longlong *)(param_1[0x3d0] + 0x30), lVar3 != 0)) &&
      (lVar3 = *(longlong *)(lVar3 + 0x2d0), lVar3 != 0)) &&
     (lVar3 = *(longlong *)(lVar3 + 0x430), lVar3 != 0)) {
    param_1[1] = lVar3;
    param_1[2] = 0;
    param_1[5] = 0;
    *(undefined4 *)((longlong)param_1 + 0x24) = 0;
    uVar2 = (**(code **)(*param_1 + 0x50))(param_1);
    lVar3 = FUN_1402bf6b0(param_1[1],uVar2);
    param_1[2] = lVar3;
  }
  *(undefined4 *)(param_1 + 0x38b) = *param_2;
  *(undefined4 *)((longlong)param_1 + 0x1c5c) = param_2[1];
  *(undefined4 *)(param_1 + 0x38c) = param_2[2];
  return;
}



void FUN_140218400(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  
  uVar9 = 0xfffffffffffffffe;
  param_1[0x3d0] = param_2;
  lVar5 = 0;
  if (param_2 == 0) goto LAB_1402184d5;
  plVar3 = param_1 + 0x25d;
  plVar1 = (longlong *)*plVar3;
  if (plVar1 == (longlong *)0x0) {
LAB_140218473:
    lVar6 = param_1[0x3d0];
    if (*plVar3 != *(longlong *)(lVar6 + 0xb8)) {
      FUN_140195a40(plVar3);
      lVar6 = *(longlong *)(lVar6 + 0xb8);
      *plVar3 = lVar6;
      param_1[0x25e] = lVar6;
      if (lVar6 != 0) {
        LOCK();
        *(int *)(lVar6 + 8) = *(int *)(lVar6 + 8) + 1;
        UNLOCK();
      }
    }
  }
  else {
    if (plVar1 != (longlong *)param_1[0x25e]) {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
      goto LAB_140218473;
    }
    if (*plVar1 == 0) goto LAB_140218473;
  }
  lVar6 = *(longlong *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x2d0);
  lVar4 = lVar5;
  if (lVar6 != 0) {
    lVar4 = lVar6 + 0x370;
  }
  (**(code **)(*param_1 + 0x460))(param_1,lVar4,param_3,param_4,uVar9);
LAB_1402184d5:
  bVar7 = false;
  plVar3 = (longlong *)param_1[0x25d];
  lVar6 = lVar5;
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == (longlong *)param_1[0x25e]) {
      lVar4 = *plVar3;
      lVar6 = 0;
      if (lVar4 != 0) {
        if ((plVar3 != (longlong *)param_1[0x25e]) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar5,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar6 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x3e1];
  if (plVar3 != (longlong *)param_1[0x3e2]) {
    do {
      if (*plVar3 != 0) {
        *(longlong *)(*plVar3 + 0x98) = param_2;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != (longlong *)param_1[0x3e2]);
  }
  plVar3 = (longlong *)param_1[0x3e5];
  if (plVar3 != (longlong *)param_1[0x3e6]) {
    do {
      if (*plVar3 != 0) {
        *(longlong *)(*plVar3 + 0x98) = param_2;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != (longlong *)param_1[0x3e6]);
  }
  plVar3 = (longlong *)param_1[0x3e9];
  if (plVar3 != (longlong *)param_1[0x3ea]) {
    do {
      if (*plVar3 != 0) {
        *(longlong *)(*plVar3 + 0x98) = param_2;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != (longlong *)param_1[0x3ea]);
  }
  plVar3 = (longlong *)param_1[0x3ed];
  if (plVar3 != (longlong *)param_1[0x3ee]) {
    do {
      if (*plVar3 != 0) {
        *(longlong *)(*plVar3 + 0x98) = param_2;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != (longlong *)param_1[0x3ee]);
  }
  plVar3 = (longlong *)param_1[0x3f1];
  if (plVar3 != (longlong *)param_1[0x3f2]) {
    do {
      if (*plVar3 != 0) {
        *(longlong *)(*plVar3 + 0x98) = param_2;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != (longlong *)param_1[0x3f2]);
  }
  plVar3 = (longlong *)param_1[0x3f5];
  if (plVar3 != (longlong *)param_1[0x3f6]) {
    do {
      if (*plVar3 != 0) {
        *(longlong *)(*plVar3 + 0x98) = param_2;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != (longlong *)param_1[0x3f6]);
  }
  plVar3 = (longlong *)param_1[0x3f9];
  if (plVar3 != (longlong *)param_1[0x3fa]) {
    do {
      if (*plVar3 != 0) {
        *(longlong *)(*plVar3 + 0x98) = param_2;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != (longlong *)param_1[0x3fa]);
  }
  if (bVar7) {
    FUN_14034edd0(lVar6);
  }
  FUN_14034ed40(param_1 + 0x25f);
  plVar3 = (longlong *)param_1[0x3fd];
  if (plVar3 != (longlong *)param_1[0x3fe]) {
    do {
      if (*plVar3 != 0) {
        *(longlong *)(*plVar3 + 0x98) = param_2;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != (longlong *)param_1[0x3fe]);
  }
  FUN_14034edd0(param_1 + 0x25f);
  return;
}



void FUN_140218710(longlong *param_1)

{
  longlong *plVar1;
  undefined8 uVar2;
  
  plVar1 = param_1;
  FUN_1402f88a0(param_1,((float)((int)param_1[0x116] + (int)param_1[0xc3]) +
                        *(float *)((longlong)param_1 + 0x59c)) *
                        (*(float *)((longlong)param_1 + 0x8ec) +
                         *(float *)((longlong)param_1 + 0x734) + 1.0 + 0.0001) +
                        (float)(int)param_1[0x10d] + (float)*(int *)((longlong)param_1 + 0x88c));
  uVar2 = FUN_1402f8960(plVar1,((float)(*(int *)((longlong)param_1 + 0x8b4) +
                                       *(int *)((longlong)plVar1 + 0x61c)) +
                               *(float *)((longlong)plVar1 + 0x5a4)) *
                               (*(float *)(plVar1 + 0x11e) + *(float *)(plVar1 + 0xe7) + 1.0 +
                               0.0001) + (float)*(int *)((longlong)plVar1 + 0x86c) +
                               (float)(int)plVar1[0x112]);
  if (*(int *)((longlong)plVar1 + 300) == 0x25) {
    *(undefined4 *)((longlong)plVar1 + 300) = 0;
    (**(code **)(*plVar1 + 200))(uVar2,0,0);
  }
  return;
}



undefined8 FUN_140218810(longlong param_1,int param_2,undefined4 param_3)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  longlong *local_10;
  
  lVar6 = *(longlong *)(param_1 + 0x1e80);
  if (lVar6 == 0) {
    return 0;
  }
  if (param_2 == 2) {
    lVar6 = FUN_14018fbc0(*(undefined8 *)(lVar6 + 0x48),param_3);
    if (lVar6 == 0) {
      return 0;
    }
    uVar5 = FUN_140198570(lVar6,&local_28);
    uVar5 = FUN_140174f50(uVar5);
    plVar1 = local_28;
    if (local_28 != (longlong *)0x0) {
      if (local_28 == local_20) {
        if (local_28 != (longlong *)0x0) {
          LOCK();
          local_28 = local_28 + 1;
          *(int *)local_28 = (int)*local_28 + -1;
          UNLOCK();
          if ((int)*local_28 == 0) {
            local_28 = (longlong *)0x0;
            puVar3 = (undefined8 *)*plVar1;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(plVar1);
          }
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar7 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
  }
  else if (param_2 == 4) {
    FUN_14018fa30(*(undefined8 *)(lVar6 + 0x48),&local_18);
    uVar5 = local_18;
    if (local_10 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_10 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_10 + 8))(local_10);
        LOCK();
        piVar2 = (int *)((longlong)local_10 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_10 + 0x10))(local_10);
        }
      }
    }
  }
  else {
    uVar5 = 0;
    if (param_2 == 0x20) {
      uVar5 = FUN_14018fd10(*(undefined8 *)(lVar6 + 0x48),param_3);
    }
  }
  return uVar5;
}



void FUN_140218960(longlong param_1)

{
  FUN_140218810(param_1,*(undefined4 *)(param_1 + 0x53c),*(undefined4 *)(param_1 + 0x540));
  return;
}



undefined8 FUN_140218980(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  longlong *local_10;
  
  lVar6 = *(longlong *)(param_1 + 0x1e80);
  if (lVar6 == 0) {
    return 0;
  }
  iVar4 = *(int *)(param_1 + 0x544);
  uVar5 = 0;
  if (0 < iVar4) {
    if (iVar4 < 3) {
      lVar6 = FUN_14018fbc0(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x548));
      if (lVar6 == 0) {
        return 0;
      }
      uVar5 = FUN_140198570(lVar6,&local_28);
      uVar5 = FUN_140174f50(uVar5);
      plVar1 = local_28;
      if (local_28 != (longlong *)0x0) {
        if (local_28 == local_20) {
          if (local_28 != (longlong *)0x0) {
            LOCK();
            local_28 = local_28 + 1;
            *(int *)local_28 = (int)*local_28 + -1;
            UNLOCK();
            if ((int)*local_28 == 0) {
              local_28 = (longlong *)0x0;
              puVar3 = (undefined8 *)*plVar1;
              if (puVar3 != (undefined8 *)0x0) {
                (**(code **)*puVar3)(puVar3,1);
              }
              operator_delete(plVar1);
            }
          }
        }
        else {
          iVar4 = DAT_140608054 + 1;
          bVar7 = DAT_140608054 == 0;
          DAT_140608054 = iVar4;
          if (bVar7) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else if (iVar4 == 4) {
      FUN_14018fa30(*(undefined8 *)(lVar6 + 0x48),&local_18,*(undefined4 *)(param_1 + 0x548));
      uVar5 = local_18;
      if (local_10 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_10 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_10 + 8))(local_10);
          LOCK();
          piVar2 = (int *)((longlong)local_10 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_10 + 0x10))(local_10);
          }
        }
      }
    }
    else if ((iVar4 == 0x10) || (iVar4 == 0x20)) {
      uVar5 = FUN_14018fd10(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x548));
    }
  }
  return uVar5;
}



undefined8 FUN_140218af0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  longlong *local_10;
  
  lVar6 = *(longlong *)(param_1 + 0x1e80);
  if (lVar6 == 0) {
    return 0;
  }
  iVar4 = *(int *)(param_1 + 0x544);
  if (iVar4 == 2) {
    lVar6 = FUN_14018fbc0(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x548));
    if (lVar6 == 0) {
      return 0;
    }
    uVar5 = FUN_140198570(lVar6,&local_28);
    uVar5 = FUN_140174f50(uVar5);
    plVar1 = local_28;
    if (local_28 != (longlong *)0x0) {
      if (local_28 == local_20) {
        if (local_28 != (longlong *)0x0) {
          LOCK();
          local_28 = local_28 + 1;
          *(int *)local_28 = (int)*local_28 + -1;
          UNLOCK();
          if ((int)*local_28 == 0) {
            local_28 = (longlong *)0x0;
            puVar3 = (undefined8 *)*plVar1;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(plVar1);
          }
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar7 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
  }
  else if (iVar4 == 4) {
    FUN_14018fa30(*(undefined8 *)(lVar6 + 0x48),&local_18,*(undefined4 *)(param_1 + 0x548));
    uVar5 = local_18;
    if (local_10 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_10 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_10 + 8))(local_10);
        LOCK();
        piVar2 = (int *)((longlong)local_10 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_10 + 0x10))(local_10);
        }
      }
    }
  }
  else {
    uVar5 = 0;
    if (iVar4 == 0x20) {
      uVar5 = FUN_14018fd10(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x548));
    }
  }
  return uVar5;
}



undefined8 FUN_140218c50(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  longlong *local_10;
  
  lVar6 = *(longlong *)(param_1 + 0x1e80);
  if (lVar6 == 0) {
    return 0;
  }
  iVar4 = *(int *)(param_1 + 0x550);
  uVar5 = 0;
  if (0 < iVar4) {
    if (iVar4 < 3) {
      lVar6 = FUN_14018fbc0(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x554));
      if (lVar6 == 0) {
        return 0;
      }
      uVar5 = FUN_140198570(lVar6,&local_28);
      uVar5 = FUN_140174f50(uVar5);
      plVar1 = local_28;
      if (local_28 != (longlong *)0x0) {
        if (local_28 == local_20) {
          if (local_28 != (longlong *)0x0) {
            LOCK();
            local_28 = local_28 + 1;
            *(int *)local_28 = (int)*local_28 + -1;
            UNLOCK();
            if ((int)*local_28 == 0) {
              local_28 = (longlong *)0x0;
              puVar3 = (undefined8 *)*plVar1;
              if (puVar3 != (undefined8 *)0x0) {
                (**(code **)*puVar3)(puVar3,1);
              }
              operator_delete(plVar1);
            }
          }
        }
        else {
          iVar4 = DAT_140608054 + 1;
          bVar7 = DAT_140608054 == 0;
          DAT_140608054 = iVar4;
          if (bVar7) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else if (iVar4 == 4) {
      FUN_14018fa30(*(undefined8 *)(lVar6 + 0x48),&local_18,*(undefined4 *)(param_1 + 0x554));
      uVar5 = local_18;
      if (local_10 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_10 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_10 + 8))(local_10);
          LOCK();
          piVar2 = (int *)((longlong)local_10 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_10 + 0x10))(local_10);
          }
        }
      }
    }
    else if (iVar4 == 0x20) {
      uVar5 = FUN_14018fd10(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x554));
    }
  }
  return uVar5;
}



undefined8 FUN_140218dc0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  longlong *local_10;
  
  lVar6 = *(longlong *)(param_1 + 0x1e80);
  if (lVar6 == 0) {
    return 0;
  }
  iVar4 = *(int *)(param_1 + 0x560);
  if (iVar4 == 2) {
    lVar6 = FUN_14018fbc0(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x564));
    if (lVar6 == 0) {
      return 0;
    }
    uVar5 = FUN_140198570(lVar6,&local_28);
    uVar5 = FUN_140174f50(uVar5);
    plVar1 = local_28;
    if (local_28 != (longlong *)0x0) {
      if (local_28 == local_20) {
        if (local_28 != (longlong *)0x0) {
          LOCK();
          local_28 = local_28 + 1;
          *(int *)local_28 = (int)*local_28 + -1;
          UNLOCK();
          if ((int)*local_28 == 0) {
            local_28 = (longlong *)0x0;
            puVar3 = (undefined8 *)*plVar1;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(plVar1);
          }
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar7 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
  }
  else if (iVar4 == 4) {
    FUN_14018fa30(*(undefined8 *)(lVar6 + 0x48),&local_18,*(undefined4 *)(param_1 + 0x564));
    uVar5 = local_18;
    if (local_10 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_10 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_10 + 8))(local_10);
        LOCK();
        piVar2 = (int *)((longlong)local_10 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_10 + 0x10))(local_10);
        }
      }
    }
  }
  else {
    uVar5 = 0;
    if (iVar4 == 0x20) {
      uVar5 = FUN_14018fd10(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x564));
    }
  }
  return uVar5;
}



undefined8 FUN_140218f20(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  longlong *local_10;
  
  lVar6 = *(longlong *)(param_1 + 0x1e80);
  if (lVar6 == 0) {
    return 0;
  }
  iVar4 = *(int *)(param_1 + 0x568);
  if (iVar4 == 2) {
    lVar6 = FUN_14018fbc0(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x56c));
    if (lVar6 == 0) {
      return 0;
    }
    uVar5 = FUN_140198570(lVar6,&local_28);
    uVar5 = FUN_140174f50(uVar5);
    plVar1 = local_28;
    if (local_28 != (longlong *)0x0) {
      if (local_28 == local_20) {
        if (local_28 != (longlong *)0x0) {
          LOCK();
          local_28 = local_28 + 1;
          *(int *)local_28 = (int)*local_28 + -1;
          UNLOCK();
          if ((int)*local_28 == 0) {
            local_28 = (longlong *)0x0;
            puVar3 = (undefined8 *)*plVar1;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(plVar1);
          }
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar7 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
  }
  else if (iVar4 == 4) {
    FUN_14018fa30(*(undefined8 *)(lVar6 + 0x48),&local_18,*(undefined4 *)(param_1 + 0x56c));
    uVar5 = local_18;
    if (local_10 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_10 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_10 + 8))(local_10);
        LOCK();
        piVar2 = (int *)((longlong)local_10 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_10 + 0x10))(local_10);
        }
      }
    }
  }
  else {
    uVar5 = 0;
    if (iVar4 == 0x20) {
      uVar5 = FUN_14018fd10(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x56c));
    }
  }
  return uVar5;
}



undefined8 FUN_140219080(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  longlong lVar6;
  bool bVar7;
  longlong *local_28;
  longlong *local_20;
  undefined8 local_18;
  longlong *local_10;
  
  lVar6 = *(longlong *)(param_1 + 0x1e80);
  if (lVar6 == 0) {
    return 0;
  }
  iVar4 = *(int *)(param_1 + 0x570);
  if (iVar4 == 2) {
    lVar6 = FUN_14018fbc0(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x574));
    if (lVar6 == 0) {
      return 0;
    }
    uVar5 = FUN_140198570(lVar6,&local_28);
    uVar5 = FUN_140174f50(uVar5);
    plVar1 = local_28;
    if (local_28 != (longlong *)0x0) {
      if (local_28 == local_20) {
        if (local_28 != (longlong *)0x0) {
          LOCK();
          local_28 = local_28 + 1;
          *(int *)local_28 = (int)*local_28 + -1;
          UNLOCK();
          if ((int)*local_28 == 0) {
            local_28 = (longlong *)0x0;
            puVar3 = (undefined8 *)*plVar1;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(plVar1);
          }
        }
      }
      else {
        iVar4 = DAT_140608054 + 1;
        bVar7 = DAT_140608054 == 0;
        DAT_140608054 = iVar4;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
  }
  else if (iVar4 == 4) {
    FUN_14018fa30(*(undefined8 *)(lVar6 + 0x48),&local_18,*(undefined4 *)(param_1 + 0x574));
    uVar5 = local_18;
    if (local_10 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_10 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_10 + 8))(local_10);
        LOCK();
        piVar2 = (int *)((longlong)local_10 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_10 + 0x10))(local_10);
        }
      }
    }
  }
  else {
    uVar5 = 0;
    if (iVar4 == 0x20) {
      uVar5 = FUN_14018fd10(*(undefined8 *)(lVar6 + 0x48),*(undefined4 *)(param_1 + 0x574));
    }
  }
  return uVar5;
}



longlong FUN_1402191e0(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  char cVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *local_30;
  longlong *local_28;
  undefined8 local_20;
  
  lVar4 = 0;
  local_30 = (longlong *)0x0;
  local_28 = (longlong *)0x0;
  local_20 = 0;
  cVar2 = (**(code **)(*param_1 + 0x188))(param_1,&local_30,param_3,param_4,0xfffffffffffffffe);
  if ((cVar2 != '\0') && (local_30 != local_28)) {
    plVar3 = local_30;
    do {
      lVar1 = *plVar3;
      if ((*(float *)(lVar1 + 0x598) <=
           (((float)(*(int *)(lVar1 + 0x618) + *(int *)(lVar1 + 0x8b0)) + *(float *)(lVar1 + 0x59c))
            * (*(float *)(lVar1 + 0x734) + *(float *)(lVar1 + 0x8ec) + 1.0 + 0.0001) +
            (float)*(int *)(lVar1 + 0x868) + (float)*(int *)(lVar1 + 0x88c)) *
           *(float *)(param_2 + 0x34)) &&
         ((lVar4 == 0 || (*(float *)(lVar1 + 0x598) < *(float *)(lVar4 + 0x598))))) {
        lVar4 = lVar1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != local_28);
    if (lVar4 != 0) {
      if (local_30 == (longlong *)0x0) {
        return lVar4;
      }
      operator_delete(local_30);
      return lVar4;
    }
  }
  if (local_30 != (longlong *)0x0) {
    operator_delete(local_30);
  }
  return 0;
}



void FUN_140219320(longlong *param_1,double param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  longlong *plVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  longlong *plVar10;
  longlong *plVar11;
  uint uVar12;
  undefined8 uVar13;
  longlong local_res8;
  longlong *local_50;
  longlong *local_48;
  undefined8 local_40;
  
  if (((double)param_1[0x39b] <= param_2 - DAT_1405dfc58 &&
       param_2 - DAT_1405dfc58 != (double)param_1[0x39b]) &&
     (param_1[0x39b] = (longlong)param_2, param_1[0x16f] != 0)) {
    uVar12 = 1;
    local_res8 = 0x180;
    do {
      if (((uVar12 == 8) || (uVar12 == 0xc)) && (uVar12 - 1 < 0xe)) {
        if (uVar12 < 0xf) {
          plVar10 = (longlong *)(local_res8 + param_1[0x16f]);
        }
        else {
          if (DAT_140608178 == 0) {
            FUN_140176d60(0);
          }
          DAT_140608178 = DAT_140608178 + 1;
          plVar10 = &DAT_140608170;
        }
        if (*(char *)(*plVar10 + 0x20) != '\0') {
          local_50 = (longlong *)0x0;
          local_48 = (longlong *)0x0;
          local_40 = 0;
          uVar13 = FUN_14032b2a0(param_1[0x16f],uVar12);
          (**(code **)(*param_1 + 0x9e0))(param_1,&local_50,uVar13);
          plVar4 = local_48;
          for (plVar10 = local_50; plVar10 != plVar4; plVar10 = plVar10 + 1) {
            plVar1 = (longlong *)*plVar10;
            if (*(int *)(*(longlong *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x2d0) + 0x4bc) == 3)
            {
              if ((((int)param_1[0x34c] != 0) &&
                  (iVar6 = (**(code **)(*plVar1 + 0xb0))(plVar1), iVar6 == 2)) &&
                 ((int)plVar1[0x34c] == (int)param_1[0x34c])) {
LAB_1402194b4:
                cVar5 = FUN_14032b0a0(plVar1[0x16f],uVar12);
                if (cVar5 == '\0') {
                  uVar8 = FUN_14032af50(param_1[0x16f],uVar12);
                  cVar5 = FUN_14032ace0(plVar1[0x16f],uVar12,uVar8);
                  if (cVar5 != '\0') {
                    FUN_14032b0a0(plVar1[0x16f],uVar12);
                  }
                  FUN_140224d20(plVar1,uVar12);
                  if (uVar12 < 0xf) {
                    plVar11 = (longlong *)(local_res8 + param_1[0x16f]);
                  }
                  else {
                    if (DAT_140608178 == 0) {
                      FUN_140176d60(0);
                    }
                    DAT_140608178 = DAT_140608178 + 1;
                    plVar11 = &DAT_140608170;
                  }
                  FUN_14032ac50(plVar1[0x16f],uVar12,*(undefined8 *)(*plVar11 + 0x10));
                  lVar3 = plVar1[0x25];
                  lVar2 = *param_1;
                  uVar8 = FUN_14032af50(param_1[0x16f],uVar12);
                  uVar9 = (**(code **)(*plVar1 + 0xb0))(plVar1);
                  (**(code **)(lVar2 + 0x9b8))(param_1,(int)lVar3,uVar9,uVar12,uVar8);
                }
              }
            }
            else {
              iVar6 = (**(code **)(*plVar1 + 0xb0))(plVar1);
              iVar7 = (**(code **)(*param_1 + 0xb0))(param_1);
              if (iVar6 == iVar7) goto LAB_1402194b4;
            }
          }
          if (local_50 != (longlong *)0x0) {
            operator_delete(local_50);
          }
        }
      }
      uVar12 = uVar12 + 1;
      local_res8 = local_res8 + 8;
    } while ((int)uVar12 < 0xf);
  }
  return;
}



void FUN_140219610(longlong *param_1,double param_2,longlong param_3)

{
  char cVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  undefined1 local_60 [4];
  float local_5c;
  undefined8 local_50;
  undefined1 local_48;
  
  if (param_1[0x27b] == 0) {
    return;
  }
  if (param_1[0x3d0] == 0) {
    return;
  }
  lVar5 = *(longlong *)(param_1[0x3d0] + 0x30);
  if (lVar5 == 0) {
    return;
  }
  if (*(longlong *)(lVar5 + 0x2d0) == 0) {
    return;
  }
  if (param_1[0x26] == 0) {
    return;
  }
  uVar4 = 0;
  local_50 = 0;
  local_48 = 0;
  cVar1 = FUN_140195920(param_1 + 0x25d);
  if (cVar1 != '\0') {
    uVar4 = FUN_140195970(param_1 + 0x25d);
    local_48 = 0;
    local_50 = uVar4;
    FUN_14034ed40(uVar4);
    local_48 = 1;
  }
  param_1[0xa2] = (longlong)param_2;
  FUN_1402fac70(param_1);
  if (*(char *)((longlong)param_1 + 0x2099) != '\0') {
    FUN_1402392e0(param_1);
    *(undefined1 *)((longlong)param_1 + 0x2099) = 0;
  }
  param_1[0xa2] = (longlong)param_2;
  param_1[0xa3] = param_3;
  if (((*(int *)((longlong)param_1 + 300) != 0x25) &&
      (*(float *)(param_1 + 0xb3) <= 1.0 && *(float *)(param_1 + 0xb3) != 1.0)) &&
     (cVar2 = (**(code **)(*param_1 + 0x538))(param_1), cVar2 == '\x01')) {
    (**(code **)(*param_1 + 200))(param_1,0x25);
  }
  switch(*(undefined4 *)((longlong)param_1 + 300)) {
  case 0:
    (**(code **)(*param_1 + 200))(param_1,1);
    break;
  case 1:
    (**(code **)(*param_1 + 0x608))(param_1);
    break;
  case 2:
    (**(code **)(*param_1 + 0x638))(param_1);
    break;
  case 3:
    (**(code **)(*param_1 + 0x640))(param_1);
    break;
  case 4:
    (**(code **)(*param_1 + 0x648))(param_1);
    break;
  case 5:
    (**(code **)(*param_1 + 0x658))(param_1);
    break;
  case 6:
    (**(code **)(*param_1 + 0x660))(param_1);
    break;
  case 7:
    (**(code **)(*param_1 + 0x668))(param_1);
    break;
  case 8:
    (**(code **)(*param_1 + 0x670))(param_1);
    break;
  case 9:
    (**(code **)(*param_1 + 0x678))(param_1);
    break;
  case 10:
    (**(code **)(*param_1 + 0x610))(param_1);
    goto LAB_140219908;
  case 0xb:
    (**(code **)(*param_1 + 0x618))(param_1);
    goto LAB_140219908;
  case 0xc:
    (**(code **)(*param_1 + 0x620))(param_1);
    goto LAB_140219908;
  case 0xd:
    (**(code **)(*param_1 + 0x628))(param_1);
    break;
  case 0xe:
    (**(code **)(*param_1 + 0x630))(param_1);
LAB_140219908:
    *(int *)((longlong)param_1 + 0x184) = (int)param_1[0x2f];
    *(undefined4 *)(param_1 + 0x31) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)((longlong)param_1 + 0x18c) = (int)param_1[0x30];
    break;
  case 0xf:
    (**(code **)(*param_1 + 0x680))(param_1);
    break;
  case 0x10:
    (**(code **)(*param_1 + 0x688))(param_1);
    break;
  case 0x12:
    (**(code **)(*param_1 + 0x690))(param_1);
    break;
  case 0x14:
    (**(code **)(*param_1 + 0x698))(param_1);
    break;
  case 0x15:
    (**(code **)(*param_1 + 0x6a0))(param_1);
    break;
  case 0x16:
    (**(code **)(*param_1 + 0x6a8))(param_1);
    break;
  case 0x17:
    (**(code **)(*param_1 + 0x6b0))(param_1);
    break;
  case 0x18:
    (**(code **)(*param_1 + 0x650))(param_1);
    break;
  case 0x1b:
    (**(code **)(*param_1 + 0x6b8))(param_1);
    break;
  case 0x1c:
    (**(code **)(*param_1 + 0x6c8))(param_1);
    break;
  case 0x1d:
    (**(code **)(*param_1 + 0x6d0))(param_1);
    break;
  case 0x1e:
    (**(code **)(*param_1 + 0x6e0))(param_1);
    break;
  case 0x1f:
    (**(code **)(*param_1 + 0x6e8))(param_1);
    break;
  case 0x20:
    (**(code **)(*param_1 + 0x6f0))(param_1);
    break;
  case 0x21:
    (**(code **)(*param_1 + 0x6f8))(param_1);
    break;
  case 0x22:
    (**(code **)(*param_1 + 0x700))(param_1);
    break;
  case 0x23:
    (**(code **)(*param_1 + 0x708))(param_1);
    break;
  case 0x24:
    (**(code **)(*param_1 + 0x6d8))(param_1);
    break;
  case 0x25:
    (**(code **)(*param_1 + 0x710))(param_1);
    break;
  case 0x28:
    (**(code **)(*param_1 + 0x718))(param_1);
    break;
  case 0x29:
    (**(code **)(*param_1 + 0x720))(param_1);
    break;
  case 0x2a:
    (**(code **)(*param_1 + 0x728))(param_1);
    break;
  case 0x2b:
    (**(code **)(*param_1 + 0x730))(param_1);
    break;
  case 0x2c:
    (**(code **)(*param_1 + 0x738))(param_1);
    break;
  case 0x2d:
    (**(code **)(*param_1 + 0x740))(param_1);
    break;
  case 0x2e:
    (**(code **)(*param_1 + 0x748))(param_1);
    break;
  case 0x2f:
    (**(code **)(*param_1 + 0x760))(param_1);
    break;
  case 0x30:
    (**(code **)(*param_1 + 0x750))(param_1);
    break;
  case 0x31:
    (**(code **)(*param_1 + 0x758))(param_1);
    break;
  case 0x32:
    (**(code **)(*param_1 + 0x768))(param_1);
    break;
  case 0x33:
    (**(code **)(*param_1 + 0x770))(param_1);
    break;
  case 0x34:
    (**(code **)(*param_1 + 0x778))(param_1);
    break;
  case 0x35:
    (**(code **)(*param_1 + 0x780))(param_1);
    break;
  case 0x36:
    (**(code **)(*param_1 + 0x788))(param_1);
    break;
  case 0x37:
    (**(code **)(*param_1 + 0x790))(param_1);
    break;
  case 0x38:
    (**(code **)(*param_1 + 0x798))(param_1);
    break;
  case 0x39:
    (**(code **)(*param_1 + 0x7b8))(param_1);
    break;
  case 0x3a:
    (**(code **)(*param_1 + 0x7c0))(param_1);
    break;
  case 0x3b:
    (**(code **)(*param_1 + 0x7c8))(param_1);
    break;
  case 0x3c:
    (**(code **)(*param_1 + 0x7a0))(param_1);
    break;
  case 0x3d:
    (**(code **)(*param_1 + 0x7b0))(param_1);
    break;
  case 0x3e:
    (**(code **)(*param_1 + 0x7a8))(param_1);
    break;
  case 0x3f:
    (**(code **)(*param_1 + 2000))(param_1);
    break;
  case 0x42:
    (**(code **)(*param_1 + 0x7d8))(param_1);
    break;
  case 0x43:
    (**(code **)(*param_1 + 0x7e0))(param_1);
    break;
  case 0x44:
    (**(code **)(*param_1 + 0x7e8))(param_1);
    break;
  case 0x45:
    (**(code **)(*param_1 + 0x7f0))(param_1);
    break;
  case 0x46:
    (**(code **)(*param_1 + 0x7f8))(param_1);
    break;
  case 0x47:
    (**(code **)(*param_1 + 0x800))(param_1);
    break;
  case 0x48:
    (**(code **)(*param_1 + 0x6c0))(param_1);
    break;
  case 0x49:
    (**(code **)(*param_1 + 0x808))(param_1);
    break;
  case 0x4a:
    (**(code **)(*param_1 + 0x818))(param_1);
    break;
  case 0x4b:
    (**(code **)(*param_1 + 0x810))(param_1);
    break;
  case 0x4c:
    (**(code **)(*param_1 + 0x820))(param_1);
    break;
  case 0x4e:
    (**(code **)(*param_1 + 0x828))(param_1);
    break;
  case 0x4f:
    (**(code **)(*param_1 + 0x830))(param_1);
    break;
  case 0x51:
    (**(code **)(*param_1 + 0x878))(param_1);
    break;
  case 0x52:
    (**(code **)(*param_1 + 0x868))(param_1);
    break;
  case 0x53:
    (**(code **)(*param_1 + 0x870))(param_1);
    break;
  case 0x54:
    (**(code **)(*param_1 + 0x880))(param_1);
    break;
  case 0x55:
    (**(code **)(*param_1 + 0x890))(param_1);
    break;
  case 0x56:
    (**(code **)(*param_1 + 0x898))(param_1);
    break;
  case 0x57:
    (**(code **)(*param_1 + 0x8a0))(param_1);
    break;
  case 0x58:
    (**(code **)(*param_1 + 0x8a8))(param_1);
    break;
  case 0x59:
    (**(code **)(*param_1 + 0x8b0))(param_1);
    break;
  case 0x60:
    (**(code **)(*param_1 + 0x838))(param_1);
    break;
  case 0x61:
    (**(code **)(*param_1 + 0x840))(param_1);
    break;
  case 0x62:
    (**(code **)(*param_1 + 0x848))(param_1);
    break;
  case 99:
    (**(code **)(*param_1 + 0x850))(param_1);
    break;
  case 100:
    (**(code **)(*param_1 + 0x858))(param_1);
    break;
  case 0x65:
    (**(code **)(*param_1 + 0x860))(param_1);
    break;
  case 0x68:
    (**(code **)(*param_1 + 0x888))(param_1);
  }
  FUN_140235830(param_1);
  if (((*(int *)((longlong)param_1 + 300) != 0x3c) && (*(int *)((longlong)param_1 + 300) != 0x3e))
     && ((lVar5 = param_1[0x27b], *(int *)(lVar5 + 0x140) == 1 && (*(int *)(lVar5 + 0x140) != 0))))
  {
    *(undefined4 *)(lVar5 + 0x140) = 0;
    (**(code **)(*param_1 + 0x468))(param_1,0);
  }
  if ((((char)param_1[0xc0] == '\0') && (*(int *)(param_1[0x27b] + 0x140) != 1)) &&
     (*(char *)((longlong)param_1 + 0xeec) == '\x01')) {
    iVar3 = FUN_1402f98b0(param_1,local_60,param_1 + 0x2f,param_1 + 0x2f,(longlong)param_1 + 0x524,
                          param_1 + 0xa4,0,0x447a0000);
    *(float *)(param_1 + 0x3c5) = local_5c;
    if (iVar3 == 1) {
      if (*(float *)((longlong)param_1 + 0x17c) - local_5c <=
          *(float *)(param_1[0x26] + 0x2a0) * 1.5) {
        *(float *)((longlong)param_1 + 0x17c) = local_5c;
      }
      else if ((*(int *)((longlong)param_1 + 300) != 0x1b) &&
              (cVar2 = (**(code **)(*param_1 + 200))(param_1,0x1b), cVar2 != '\0')) {
        *(undefined4 *)(param_1 + 0x281) = 0;
      }
    }
    else {
      (**(code **)(*param_1 + 0x468))(param_1,1);
    }
  }
  *(float *)((longlong)param_1 + 0x1384) = *(float *)(param_1 + 0x2f) + *(float *)(param_1 + 0x18d);
  *(float *)(param_1 + 0x271) =
       *(float *)((longlong)param_1 + 0x17c) + *(float *)((longlong)param_1 + 0xc6c);
  *(float *)((longlong)param_1 + 0x138c) = *(float *)(param_1 + 0x18e) + *(float *)(param_1 + 0x30);
  *(float *)((longlong)param_1 + 0x13c4) = *(float *)(param_1 + 0x2f) + *(float *)(param_1 + 0x18d);
  *(float *)(param_1 + 0x279) =
       *(float *)((longlong)param_1 + 0x17c) + *(float *)((longlong)param_1 + 0xc6c);
  *(float *)((longlong)param_1 + 0x13cc) = *(float *)(param_1 + 0x18e) + *(float *)(param_1 + 0x30);
  lVar5 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar5 != 0) {
    if (*(int *)(lVar5 + 300) == 0x25) {
      *(undefined8 *)((longlong)param_1 + 0x53c) = 0;
    }
    fVar8 = *(float *)(lVar5 + 0x180) - *(float *)(param_1 + 0x30);
    fVar6 = *(float *)(lVar5 + 0x17c) - *(float *)((longlong)param_1 + 0x17c);
    fVar7 = *(float *)(lVar5 + 0x178) - *(float *)(param_1 + 0x2f);
    if (*(float *)(param_1[0x26] + 0x278) * *(float *)(param_1[0x26] + 0x278) <=
        fVar7 * fVar7 + fVar6 * fVar6 + fVar8 * fVar8) {
      *(undefined8 *)((longlong)param_1 + 0x53c) = 0;
    }
  }
  if ((*(int *)((longlong)param_1 + 0x524) == -1) && ((int)param_1[0xa4] == -1)) {
    *(int *)(param_1 + 0x2f) = (int)param_1[0x38b];
    *(undefined4 *)((longlong)param_1 + 0x17c) = *(undefined4 *)((longlong)param_1 + 0x1c5c);
    *(int *)(param_1 + 0x30) = (int)param_1[0x38c];
  }
  param_1[0x28d] = (longlong)param_2;
  FUN_1402c5990(param_1[0x27b],(longlong)param_1 + 0x1354);
  lVar5 = param_1[0x27b];
  *(double *)(lVar5 + 0x38) = param_2;
  FUN_1402cbda0(*(undefined8 *)(lVar5 + 0x20));
  if ((*(char *)((longlong)param_1 + 0x1a1c) != '\0') && ((double)param_1[0x344] <= param_2)) {
    lVar5 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar5 + 0x54) == 1) {
      *(double *)(lVar5 + 0x10) = param_2;
      FUN_1402cc2c0(lVar5);
    }
    *(undefined4 *)(lVar5 + 0x54) = 0;
    *(undefined1 *)((longlong)param_1 + 0x1a1c) = 0;
  }
  FUN_1402302d0(param_1);
  FUN_140230430(param_1);
  (**(code **)(*param_1 + 0x5d0))(param_1);
  (**(code **)(*param_1 + 0x8b8))(param_1);
  (**(code **)(*param_1 + 0x8c8))(param_1);
  (**(code **)(*param_1 + 0x8c0))(param_1);
  *(int *)(param_1 + 0x396) = (int)param_1[0x2f];
  *(undefined4 *)((longlong)param_1 + 0x1cb4) = *(undefined4 *)((longlong)param_1 + 0x17c);
  *(int *)(param_1 + 0x397) = (int)param_1[0x30];
  if (10.0 < param_2 - (double)param_1[0x309]) {
    *(undefined4 *)(param_1 + 0x308) = 0;
  }
  if (10.0 < param_2 - (double)param_1[0x30c]) {
    *(undefined4 *)((longlong)param_1 + 0x185c) = 0;
  }
  iVar3 = *(int *)(*(longlong *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x2d0) + 0x4bc);
  if ((iVar3 == 1) || ((3 < iVar3 && ((iVar3 < 7 || (iVar3 == 0xb)))))) {
    *(float *)(param_1 + 0xb3) =
         ((float)((int)param_1[0xc3] + (int)param_1[0x116]) + *(float *)((longlong)param_1 + 0x59c))
         * (*(float *)((longlong)param_1 + 0x8ec) + *(float *)((longlong)param_1 + 0x734) + 1.0 +
           0.0001) + (float)(int)param_1[0x10d] + (float)*(int *)((longlong)param_1 + 0x88c);
    *(float *)(param_1 + 0xb4) =
         ((float)(*(int *)((longlong)param_1 + 0x8b4) + *(int *)((longlong)param_1 + 0x61c)) +
         *(float *)((longlong)param_1 + 0x5a4)) *
         (*(float *)(param_1 + 0x11e) + *(float *)(param_1 + 0xe7) + 1.0 + 0.0001) +
         (float)*(int *)((longlong)param_1 + 0x86c) + (float)(int)param_1[0x112];
    *(undefined4 *)(param_1 + 0xb5) = 0;
  }
  FUN_140238e50(param_1);
  if (((((int)param_1[0x1f8] != 0) &&
       ((double)param_1[0x1f9] <= param_2 && param_2 != (double)param_1[0x1f9])) &&
      (*(int *)((longlong)param_1 + 300) != 0x3c)) && (*(int *)((longlong)param_1 + 300) != 0x3e)) {
    (**(code **)(*param_1 + 200))(param_1,0x65,1);
    (**(code **)(*param_1 + 0x510))(param_1,0);
  }
  if (cVar1 != '\0') {
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_14021a710(longlong *param_1)

{
  *(undefined4 *)(param_1 + 0x303) = 0;
  if ((*(int *)((longlong)param_1 + 300) == 0x1b) && ((int)param_1[0x281] == 3)) {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    *(undefined2 *)(param_1 + 0x19a) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x19a) = 0;
  return;
}



void FUN_14021a770(longlong *param_1,longlong *param_2,longlong param_3,longlong *param_4,
                  longlong param_5,float param_6)

{
  longlong lVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined4 uVar9;
  int iVar10;
  undefined4 uVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  float fVar18;
  undefined4 local_res8 [2];
  
  if (param_1[0x26] != 0) {
    if (*(int *)((longlong)param_1 + 300) == 0x3c) {
      *(int *)(*param_2 + 0x48) = (int)((float)(int)param_1[0x345] * 0.7);
      return;
    }
    fVar14 = 0.0;
    fVar15 = 0.0;
    iVar4 = (**(code **)(*param_1 + 0xb0))();
    if (iVar4 == 4) {
      lVar1 = param_1[0x26];
      fVar12 = *(float *)((longlong)param_1 + 0x744);
      fVar13 = *(float *)(lVar1 + 0x7b4);
      fVar17 = *(float *)(lVar1 + 0x7b0);
      if (1.0 < fVar12) {
        fVar13 = fVar12 * *(float *)(lVar1 + 0x7b4);
        fVar17 = fVar12 * *(float *)(lVar1 + 0x7b0);
      }
      lVar1 = param_1[0x26];
      fVar12 = *(float *)(param_1 + 0xe9);
      fVar18 = *(float *)(lVar1 + 0x7b8);
      fVar16 = *(float *)(lVar1 + 0x7bc);
      if (1.0 < fVar12) {
        fVar16 = fVar12 * *(float *)(lVar1 + 0x7bc);
        fVar18 = fVar12 * *(float *)(lVar1 + 0x7b8);
      }
      iVar10 = rand();
      iVar5 = rand();
      rand();
      iVar4 = *(int *)(param_3 + 0xe0);
      if (iVar4 == 1) {
        lVar1 = param_1[0x10a];
        lVar2 = param_1[0x109];
        iVar4 = *(int *)((longlong)param_1 + 0x644);
        iVar5 = *(int *)((longlong)param_1 + 0x64c);
        fVar14 = *(float *)(param_1 + 0xec);
        uVar9 = FUN_1402f8580(param_1);
        fVar12 = (float)FUN_140314ac0(param_4,uVar9);
        fVar14 = (1.0 - (fVar12 - ((float)(int)lVar1 + fVar14) / 100.0)) *
                 (float)(int)((float)iVar10 * 3.0517578e-05 * (fVar13 - fVar17) + fVar17) +
                 (float)iVar4 + (float)((int)lVar2 + iVar5);
      }
      else if (iVar4 == 2) {
        iVar4 = *(int *)((longlong)param_1 + 0x854);
        iVar10 = *(int *)((longlong)param_1 + 0x84c);
        lVar1 = param_1[0xc9];
        lVar2 = param_1[0xca];
        fVar15 = *(float *)((longlong)param_1 + 0x764);
        uVar9 = FUN_1402f8580(param_1);
        fVar12 = (float)FUN_140314b90(param_4,uVar9);
        fVar15 = (1.0 - (fVar12 - ((float)iVar4 + fVar15) / 100.0)) *
                 (float)(int)((float)iVar5 * 3.0517578e-05 * (fVar16 - fVar18) + fVar18) +
                 (float)(int)lVar1 + (float)(iVar10 + (int)lVar2);
      }
      else if (iVar4 - 3U < 8) {
        if (-1 < iVar4 + 0x11) {
          local_res8[0] = 0;
          fVar12 = *(float *)(param_1[0x26] + 0x7c4);
          fVar13 = *(float *)(param_1[0x26] + 0x7c0);
          uVar9 = FUN_1402f8580(param_4);
          uVar11 = FUN_1402f8580(param_1);
          FUN_140167670((int)fVar13,(int)fVar12,uVar11,
                        *(undefined4 *)((longlong)param_4 + (longlong)(iVar4 + 0x11) * 4 + 0x618),
                        uVar9,local_res8);
        }
        FUN_14023c460(param_1 + 0xc3,*(int *)(param_3 + 0xe0) + 0x11);
      }
    }
    else if (*(int *)(param_3 + 0xe0) == 1) {
      iVar5 = rand();
      iVar6 = FUN_1402fc320(param_1);
      iVar7 = FUN_1402fc250(param_1);
      iVar8 = FUN_1402fc250(param_1);
      lVar1 = param_1[0x10a];
      lVar2 = param_1[0x109];
      iVar4 = *(int *)((longlong)param_1 + 0x644);
      iVar10 = *(int *)((longlong)param_1 + 0x64c);
      fVar14 = *(float *)(param_1 + 0xec);
      uVar9 = FUN_1402f8580(param_1);
      fVar12 = (float)FUN_140314ac0(param_4,uVar9);
      fVar14 = (1.0 - (fVar12 - ((float)(int)lVar1 + fVar14) / 100.0)) *
               (float)((int)((float)(iVar6 - iVar7) * (float)iVar5 * 3.0517578e-05) + iVar8) +
               (float)iVar4 + (float)((int)lVar2 + iVar10);
    }
    else if (*(int *)(param_3 + 0xe0) == 2) {
      iVar5 = rand();
      iVar6 = FUN_14023c390(param_1);
      iVar7 = FUN_14023c4a0(param_1);
      iVar8 = FUN_14023c4a0(param_1);
      iVar4 = *(int *)((longlong)param_1 + 0x854);
      iVar10 = *(int *)((longlong)param_1 + 0x84c);
      lVar1 = param_1[0xc9];
      lVar2 = param_1[0xca];
      fVar15 = *(float *)((longlong)param_1 + 0x764);
      uVar9 = FUN_1402f8580(param_1);
      fVar12 = (float)FUN_140314b90(param_4,uVar9);
      fVar15 = (1.0 - (fVar12 - ((float)iVar4 + fVar15) / 100.0)) *
               (float)((int)((float)(iVar6 - iVar7) * (float)iVar5 * 3.0517578e-05) + iVar8) +
               (float)(int)lVar1 + (float)(iVar10 + (int)lVar2);
    }
    *(int *)(*param_2 + 0xe0) = (int)param_1[0xd1];
    *(int *)(*param_2 + 0x100) = (int)param_1[0xd5];
    *(undefined4 *)(*param_2 + 0xe4) = *(undefined4 *)((longlong)param_1 + 0x68c);
    *(undefined4 *)(*param_2 + 0x104) = *(undefined4 *)((longlong)param_1 + 0x6ac);
    *(int *)(*param_2 + 0xe8) = (int)param_1[0xd2];
    *(int *)(*param_2 + 0x108) = (int)param_1[0xd6];
    *(undefined4 *)(*param_2 + 0xec) = *(undefined4 *)((longlong)param_1 + 0x694);
    *(undefined4 *)(*param_2 + 0x10c) = *(undefined4 *)((longlong)param_1 + 0x6b4);
    *(int *)(*param_2 + 0xf0) = (int)param_1[0xd3];
    *(int *)(*param_2 + 0x110) = (int)param_1[0xd7];
    *(undefined4 *)(*param_2 + 0xf4) = *(undefined4 *)((longlong)param_1 + 0x69c);
    *(undefined4 *)(*param_2 + 0x114) = *(undefined4 *)((longlong)param_1 + 0x6bc);
    *(int *)(*param_2 + 0x6c) = (int)param_1[0x100];
    *(int *)(*param_2 + 0x70) = (int)param_1[0xde];
    if (param_5 != 0) {
      lVar1 = *(longlong *)(param_5 + 0x400);
      fVar12 = *(float *)(lVar1 + 0x14);
      fVar14 = (*(float *)(lVar1 + 0x10) / 100.0 + 1.0) * fVar14 +
               (float)*(int *)(*(longlong *)(param_5 + 0x3f0) + 0x10);
      iVar4 = *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x14);
      *(undefined4 *)(*param_2 + 0x6c) = *(undefined4 *)(lVar1 + 0xcc);
      *(undefined4 *)(*param_2 + 0x70) = *(undefined4 *)(*(longlong *)(param_5 + 0x3f0) + 0xd8);
      fVar15 = (fVar12 / 100.0 + 1.0) * fVar15 + (float)iVar4;
      *(int *)(*param_2 + 0xe0) =
           *(int *)(*param_2 + 0xe0) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x70);
      *(int *)(*param_2 + 0x100) =
           *(int *)(*param_2 + 0x100) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x90);
      *(int *)(*param_2 + 0xe4) =
           *(int *)(*param_2 + 0xe4) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x74);
      *(int *)(*param_2 + 0x104) =
           *(int *)(*param_2 + 0x104) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x94);
      *(int *)(*param_2 + 0xe8) =
           *(int *)(*param_2 + 0xe8) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x78);
      *(int *)(*param_2 + 0x108) =
           *(int *)(*param_2 + 0x108) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x98);
      *(int *)(*param_2 + 0xec) =
           *(int *)(*param_2 + 0xec) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x7c);
      *(int *)(*param_2 + 0x10c) =
           *(int *)(*param_2 + 0x10c) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x9c);
      *(int *)(*param_2 + 0xf0) =
           *(int *)(*param_2 + 0xf0) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x80);
      *(int *)(*param_2 + 0x110) =
           *(int *)(*param_2 + 0x110) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0xa0);
      *(int *)(*param_2 + 0xf4) =
           *(int *)(*param_2 + 0xf4) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0x84);
      *(int *)(*param_2 + 0x114) =
           *(int *)(*param_2 + 0x114) + *(int *)(*(longlong *)(param_5 + 0x3f0) + 0xa4);
    }
    *(undefined1 *)(*param_2 + 0x50) = 0;
    (**(code **)(*param_4 + 0x308))(param_4);
    cVar3 = FUN_1402f9210(param_1);
    if (cVar3 != '\0') {
      *(undefined1 *)(*param_2 + 0x50) = 1;
      fVar12 = *(float *)((longlong)param_1 + 0x90c) + *(float *)((longlong)param_1 + 0x80c) + 1.5;
      fVar14 = fVar14 * fVar12;
      fVar15 = fVar15 * fVar12;
    }
    *(int *)(*param_2 + 0x78) = (int)param_1[0x3d6];
    *(int *)(*param_2 + 0x48) =
         (int)(fVar14 * *(float *)(param_3 + 0x108) * param_6 * *(float *)(param_1 + 0x18c));
    *(int *)(*param_2 + 0x4c) =
         (int)(fVar15 * *(float *)(param_3 + 0x108) * param_6 * *(float *)(param_1 + 0x18c));
  }
  return;
}



int FUN_14021afe0(longlong *param_1,longlong param_2,undefined1 *param_3)

{
  float fVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined4 uVar9;
  int iVar10;
  int iVar11;
  undefined8 uVar12;
  short *psVar13;
  float fVar14;
  float fVar15;
  double dVar16;
  float fVar17;
  float fVar18;
  float fVar19;
  float fVar20;
  float local_res8 [2];
  
  if (param_1[0x26] == 0) {
    return 0;
  }
  if (*(int *)((longlong)param_1 + 300) == 0x3c) {
    return (int)((float)(int)param_1[0x345] * 0.7);
  }
  fVar17 = 0.0;
  iVar6 = (**(code **)(*param_1 + 0xb0))();
  if (iVar6 == 4) {
    lVar3 = param_1[0x26];
    fVar14 = *(float *)((longlong)param_1 + 0x744);
    fVar15 = *(float *)(lVar3 + 0x7b0);
    fVar18 = *(float *)(lVar3 + 0x7b4);
    if (1.0 < fVar14) {
      fVar18 = fVar14 * *(float *)(lVar3 + 0x7b4);
      fVar15 = fVar14 * *(float *)(lVar3 + 0x7b0);
    }
    lVar3 = param_1[0x26];
    fVar14 = *(float *)(param_1 + 0xe9);
    fVar20 = *(float *)(lVar3 + 0x7b8);
    fVar19 = *(float *)(lVar3 + 0x7bc);
    if (1.0 < fVar14) {
      fVar19 = fVar14 * *(float *)(lVar3 + 0x7bc);
      fVar20 = fVar14 * *(float *)(lVar3 + 0x7b8);
    }
    iVar10 = rand();
    iVar6 = rand();
    fVar14 = *(float *)(param_1[0x26] + 0x7c4);
    fVar1 = *(float *)(param_1[0x26] + 0x7c0);
    local_res8[0] = (float)iVar6 * 3.0517578e-05;
    iVar11 = rand();
    iVar6 = *(int *)(param_2 + 0xe0);
    if (iVar6 == 1) {
      iVar6 = (int)((fVar18 - fVar15) * (float)iVar10 * 3.0517578e-05 + fVar15);
    }
    else if (iVar6 == 2) {
      iVar6 = (int)((fVar19 - fVar20) * local_res8[0] + fVar20);
    }
    else {
      if (7 < iVar6 - 3U) goto LAB_14021b37f;
      iVar6 = (int)((fVar14 - fVar1) * (float)iVar11 * 3.0517578e-05 + fVar1);
    }
    fVar17 = (float)iVar6;
  }
  else {
    iVar6 = *(int *)((longlong)param_1 + 0x5cc);
    iVar7 = rand();
    lVar3 = param_1[0xba];
    iVar10 = *(int *)((longlong)param_1 + 0x5cc);
    iVar11 = *(int *)((longlong)param_1 + 0x5d4);
    iVar8 = rand();
    lVar4 = param_1[0xbb];
    iVar2 = *(int *)((longlong)param_1 + 0x5d4);
    local_res8[0] = (float)FUN_1402f8580(param_1);
    psVar13 = (short *)(param_1[0x26] + 0x480);
    if (7 < *(ulonglong *)(param_1[0x26] + 0x498)) {
      psVar13 = *(short **)psVar13;
    }
    if ((psVar13 != (short *)0x0) && (*psVar13 != 0)) {
      uVar12 = FUN_14031d6d0();
      FUN_14031d1f0(uVar12,psVar13,local_res8);
    }
    uVar9 = FUN_1402f8580(param_1);
    fVar14 = (float)FUN_1402f7da0(param_1,uVar9);
    uVar9 = FUN_1402f8580(param_1);
    fVar15 = (float)FUN_1402f7ba0(param_1,uVar9);
    FUN_1402f8580(param_1);
    fVar17 = 0.0;
    if (*(int *)(param_2 + 0xdc) == 1) {
      fVar17 = (float)((int)((float)((int)lVar3 - iVar10) * (float)iVar7 * 3.0517578e-05) + iVar6) +
               fVar15;
    }
    else if (*(int *)(param_2 + 0xdc) == 2) {
      fVar17 = (float)((int)((float)((int)lVar4 - iVar2) * (float)iVar8 * 3.0517578e-05) + iVar11) +
               fVar14;
    }
    dVar16 = (double)FUN_140414fe0();
    fVar17 = (5.0 - (float)(dVar16 * 10.0)) + fVar17;
  }
LAB_14021b37f:
  cVar5 = FUN_1402f9210(param_1);
  if (cVar5 == '\0') {
    *param_3 = 0;
  }
  else {
    fVar17 = fVar17 * 1.5;
    *param_3 = 1;
  }
  return (int)(fVar17 * *(float *)(param_2 + 0x108) * *(float *)(param_1 + 0x18c));
}



ulonglong FUN_14021b3f0(longlong *param_1,longlong *param_2,float param_3,char param_4)

{
  undefined8 uVar1;
  int iVar2;
  ulonglong in_RAX;
  undefined4 uVar3;
  
  if (param_3 < 1e-06) {
LAB_14021b4d7:
    return in_RAX & 0xffffffffffffff00;
  }
  in_RAX = *(ulonglong *)(param_1[0x3d0] + 0x30);
  if ((in_RAX == 0) || (*(longlong *)(in_RAX + 0x2d0) == 0)) goto LAB_14021b4d7;
  if (*(int *)(*(longlong *)(in_RAX + 0x2d0) + 0x4bc) == 3) goto LAB_14021b488;
  uVar1 = *(undefined8 *)(param_1[0x3d0] + 0x48);
  if (param_4 == '\0') {
    iVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (iVar2 != 2) {
      if (iVar2 != 4) goto LAB_14021b488;
      goto LAB_14021b4b4;
    }
LAB_14021b46a:
    uVar3 = 4;
  }
  else {
    iVar2 = (**(code **)(*param_1 + 0xb0))();
    if (iVar2 != 2) {
      if (iVar2 != 4) goto LAB_14021b488;
      goto LAB_14021b46a;
    }
LAB_14021b4b4:
    FUN_140190840(uVar1,param_2,param_1,param_3,2);
    uVar3 = 0x20;
  }
  FUN_140190840(uVar1,param_2,param_1,param_3,uVar3);
LAB_14021b488:
  return (ulonglong)(*param_2 != param_2[1]);
}



undefined8 FUN_14021b4f0(longlong param_1,undefined8 param_2)

{
  byte bVar1;
  byte bVar2;
  undefined4 uVar3;
  undefined8 *puVar4;
  int iVar5;
  longlong *plVar6;
  undefined8 uVar7;
  bool bVar8;
  
  bVar1 = *(byte *)(param_1 + 0x601);
  uVar3 = *(undefined4 *)(param_1 + 300);
  uVar7 = 0;
  bVar2 = *(byte *)(param_1 + 0x600);
  plVar6 = (longlong *)(param_1 + 0x14c8);
  if (7 < *(ulonglong *)(param_1 + 0x14e0)) {
    plVar6 = (longlong *)*plVar6;
  }
  puVar4 = *(undefined8 **)(param_1 + 0x1c88);
  if (puVar4 != (undefined8 *)0x0) {
    if (puVar4 == *(undefined8 **)(param_1 + 0x1c90)) {
      uVar7 = *puVar4;
    }
    else {
      iVar5 = DAT_140608150 + 1;
      bVar8 = DAT_140608150 == 0;
      DAT_140608150 = iVar5;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140278700(uVar7,param_2,plVar6,*(undefined4 *)(param_1 + 0x1c08),uVar3,bVar1 | bVar2,
                *(undefined1 *)(param_1 + 0x2098));
  return param_2;
}



void FUN_14021b5c0(longlong *param_1,longlong *param_2,longlong param_3)

{
  longlong *plVar1;
  byte bVar2;
  byte bVar3;
  undefined4 uVar4;
  void *pvVar5;
  undefined8 *puVar6;
  char cVar7;
  int iVar8;
  int iVar9;
  DWORD DVar10;
  longlong lVar11;
  HANDLE pvVar12;
  HANDLE pvVar13;
  undefined8 uVar14;
  undefined8 uVar15;
  float *pfVar16;
  longlong *plVar17;
  undefined8 *puVar18;
  float *pfVar19;
  undefined8 *puVar20;
  bool bVar21;
  float fVar22;
  float fVar23;
  undefined1 local_res8 [8];
  float local_res20 [2];
  undefined8 in_stack_ffffffffffffff28;
  undefined4 uVar24;
  float local_b8 [2];
  undefined8 local_b0;
  longlong *local_a8;
  longlong *local_a0;
  undefined8 *local_98;
  undefined8 *local_90;
  undefined8 local_88;
  undefined8 *local_78;
  undefined8 *local_70;
  undefined8 local_68;
  
  uVar24 = (undefined4)((ulonglong)in_stack_ffffffffffffff28 >> 0x20);
  local_b0 = 0xfffffffffffffffe;
  iVar8 = (**(code **)(*param_1 + 0xb0))();
  if (iVar8 == 2) {
    return;
  }
  plVar17 = param_1 + 0x299;
  uVar15 = 0;
  if (param_1[0x29b] == 0) {
    return;
  }
  fVar23 = 0.0;
  local_res20[0] = 0.0;
  lVar11 = *param_2;
  if (lVar11 != param_2[1]) {
    pfVar19 = (float *)(lVar11 + 0x24);
    do {
      fVar22 = *(float *)((longlong)param_1 + 0x17c) - *pfVar19;
      local_b8[0] = (*(float *)(param_1 + 0x2f) - pfVar19[-1]) *
                    (*(float *)(param_1 + 0x2f) - pfVar19[-1]) + fVar22 * fVar22 +
                    (*(float *)(param_1 + 0x30) - pfVar19[1]) *
                    (*(float *)(param_1 + 0x30) - pfVar19[1]) +
                    (pfVar19[-2] + pfVar19[-3]) * (pfVar19[-2] + pfVar19[-3]);
      pfVar16 = local_res20;
      if (fVar23 <= local_b8[0]) {
        pfVar16 = local_b8;
      }
      fVar23 = *pfVar16;
      lVar11 = lVar11 + 0x2c;
      pfVar19 = pfVar19 + 0xb;
      local_res20[0] = fVar23;
    } while (lVar11 != param_2[1]);
  }
  fVar23 = sqrtf(local_res20[0]);
  bVar2 = *(byte *)((longlong)param_1 + 0x601);
  bVar3 = *(byte *)(param_1 + 0xc0);
  uVar4 = *(undefined4 *)((longlong)param_1 + 300);
  if (7 < (ulonglong)param_1[0x29c]) {
    plVar17 = (longlong *)*plVar17;
  }
  puVar18 = (undefined8 *)param_1[0x391];
  uVar14 = uVar15;
  local_res20[0] = fVar23;
  if (puVar18 != (undefined8 *)0x0) {
    if (puVar18 == (undefined8 *)param_1[0x392]) {
      uVar14 = *puVar18;
    }
    else {
      iVar8 = DAT_140608150 + 1;
      bVar21 = DAT_140608150 == 0;
      DAT_140608150 = iVar8;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140278700(uVar14,&local_a8,plVar17,(int)param_1[0x381],CONCAT44(uVar24,uVar4),bVar2 | bVar3,
                (char)param_1[0x413]);
  if (local_a8 != (longlong *)0x0) {
    if (local_a8 == local_a0) {
      if (*local_a8 != 0) {
        local_78 = (undefined8 *)0x0;
        local_70 = (undefined8 *)0x0;
        local_68 = 0;
        if (param_1[0x3d0] != 0) {
          FUN_14021b3f0(param_1,&local_78,fVar23,(char)param_1[0x346]);
        }
        puVar6 = local_70;
        puVar20 = local_78;
        FUN_14021cc10(param_1,param_1[0x2fa],fVar23);
        puVar18 = puVar20;
        while ((puVar18 != puVar6 && (0 < *(int *)((longlong)param_1 + 0x1a2c)))) {
          (**(code **)(*(longlong *)*puVar18 + 0x988))
                    ((longlong *)*puVar18,*(undefined1 *)(param_3 + 0x14));
          puVar18 = puVar18 + 1;
        }
        local_98 = (undefined8 *)0x0;
        local_90 = (undefined8 *)0x0;
        local_88 = 0;
        if (param_1[0x3d0] != 0) {
          lVar11 = *(longlong *)(param_1[0x3d0] + 0x30);
          puVar18 = *(undefined8 **)(lVar11 + 0x290);
          if (puVar18 != (undefined8 *)0x0) {
            if (puVar18 == *(undefined8 **)(lVar11 + 0x298)) {
              uVar15 = *puVar18;
            }
            else {
              iVar8 = DAT_1406080b0 + 1;
              bVar21 = DAT_1406080b0 == 0;
              DAT_1406080b0 = iVar8;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          FUN_1402535c0(uVar15,&local_98,param_1 + 0x2f,fVar23);
        }
        puVar18 = local_98;
        if (local_98 != local_90) {
          do {
            uVar15 = *puVar18;
            lVar11 = *param_2;
            if (lVar11 != param_2[1]) {
              do {
                cVar7 = FUN_140252b30(uVar15,lVar11);
                if (cVar7 != '\0') {
                  if (local_a8 == (longlong *)0x0) {
LAB_14021b984:
                    lVar11 = 0;
                  }
                  else {
                    if (local_a8 != local_a0) {
                      iVar8 = DAT_140608154 + 1;
                      bVar21 = DAT_140608154 == 0;
                      DAT_140608154 = iVar8;
                      if ((bVar21) &&
                         (pvVar12 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,
                                                2,0x80,(HANDLE)0x0), pvVar12 != (HANDLE)0x0)) {
                        DVar10 = GetCurrentProcessId();
                        pvVar13 = GetCurrentProcess();
                        MiniDumpWriteDump(pvVar13,DVar10,pvVar12,2,0,0,0);
                        CloseHandle(pvVar12);
                      }
                      goto LAB_14021b984;
                    }
                    lVar11 = *local_a8;
                  }
                  fVar23 = *(float *)(param_3 + 0x18);
                  iVar8 = FUN_14021afe0(param_1,lVar11,local_res8);
                  iVar8 = (int)((float)iVar8 * fVar23);
                  plVar17 = (longlong *)param_1[0x2f8];
                  if (plVar17 != (longlong *)0x0) {
                    if (plVar17 == (longlong *)param_1[0x2f9]) {
                      lVar11 = *plVar17;
                      if (lVar11 != 0) {
                        if (plVar17 != (longlong *)param_1[0x2f9]) {
                          iVar9 = DAT_1406081cc + 1;
                          bVar21 = DAT_1406081cc == 0;
                          DAT_1406081cc = iVar9;
                          if ((bVar21) &&
                             (pvVar12 = CreateFileW(L"test.dmp",0x40000000,0,
                                                    (LPSECURITY_ATTRIBUTES)0x0,2,0x80,(HANDLE)0x0),
                             pvVar12 != (HANDLE)0x0)) {
                            DVar10 = GetCurrentProcessId();
                            pvVar13 = GetCurrentProcess();
                            MiniDumpWriteDump(pvVar13,DVar10,pvVar12,2,0,0,0);
                            CloseHandle(pvVar12);
                          }
                          lVar11 = 0;
                        }
                        iVar8 = (int)((float)iVar8 * *(float *)(*(longlong *)(lVar11 + 0x68) + 0x60)
                                     );
                      }
                    }
                    else {
                      iVar9 = DAT_1406081cc + 1;
                      bVar21 = DAT_1406081cc == 0;
                      DAT_1406081cc = iVar9;
                      if ((bVar21) &&
                         (pvVar12 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,
                                                2,0x80,(HANDLE)0x0), pvVar12 != (HANDLE)0x0)) {
                        DVar10 = GetCurrentProcessId();
                        pvVar13 = GetCurrentProcess();
                        MiniDumpWriteDump(pvVar13,DVar10,pvVar12,2,0,0,0);
                        CloseHandle(pvVar12);
                      }
                    }
                  }
                  FUN_14023c380(param_3);
                  FUN_140252870(uVar15,iVar8);
                  break;
                }
                lVar11 = lVar11 + 0x2c;
              } while (lVar11 != param_2[1]);
            }
            puVar18 = puVar18 + 1;
            puVar20 = local_78;
          } while (puVar18 != local_90);
        }
        if (local_98 != (undefined8 *)0x0) {
          operator_delete(local_98);
        }
        if (puVar20 != (undefined8 *)0x0) {
          operator_delete(puVar20);
        }
        if (local_a8 == (longlong *)0x0) {
          return;
        }
        plVar17 = local_a8;
        if (local_a8 != local_a0) {
          if (DAT_1406080b4 != 0) {
            DAT_1406080b4 = DAT_1406080b4 + 1;
            return;
          }
          DAT_1406080b4 = DAT_1406080b4 + 1;
          pvVar12 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                (HANDLE)0x0);
          if (pvVar12 == (HANDLE)0x0) {
            return;
          }
          DVar10 = GetCurrentProcessId();
          pvVar13 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar13,DVar10,pvVar12,2,0,0,0);
          CloseHandle(pvVar12);
          return;
        }
        goto LAB_14021bc2d;
      }
    }
    else {
      iVar8 = DAT_140608154 + 1;
      bVar21 = DAT_140608154 == 0;
      DAT_140608154 = iVar8;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_a8 == (longlong *)0x0) {
    return;
  }
  plVar17 = local_a8;
  if (local_a8 != local_a0) {
    if (DAT_1406080b4 != 0) {
      DAT_1406080b4 = DAT_1406080b4 + 1;
      return;
    }
    DAT_1406080b4 = DAT_1406080b4 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14021bc2d:
  if (plVar17 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar17 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_a8 = (longlong *)0x0;
      pvVar5 = (void *)*plVar17;
      if (pvVar5 != (void *)0x0) {
        FUN_140197310(pvVar5);
        operator_delete(pvVar5);
      }
      operator_delete(plVar17);
    }
  }
  return;
}



void FUN_14021bc90(longlong *param_1,float *param_2,longlong param_3)

{
  longlong *plVar1;
  byte bVar2;
  byte bVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  char cVar10;
  int iVar11;
  int iVar12;
  float *pfVar13;
  undefined8 uVar14;
  longlong lVar15;
  undefined8 *puVar16;
  longlong *plVar17;
  undefined2 *puVar18;
  undefined4 uVar19;
  bool bVar20;
  float fVar21;
  float fVar22;
  float local_res18 [2];
  longlong local_res20;
  longlong *local_c8;
  longlong *local_c0;
  undefined2 local_b8;
  undefined6 uStack_b6;
  longlong local_a8;
  ulonglong local_a0;
  undefined8 *local_90;
  undefined8 *local_88;
  undefined8 local_80;
  undefined8 *local_70;
  undefined8 *local_68;
  undefined8 local_60;
  undefined8 local_50;
  
  local_50 = 0xfffffffffffffffe;
  local_a0 = 7;
  local_a8 = 0;
  local_b8 = 0;
  if (*(longlong *)(param_3 + 0x10) == 0) {
    FUN_1400015e0(&local_b8,param_1 + 0x299,0,0xffffffffffffffff);
    uVar19 = (undefined4)param_1[0x381];
  }
  else {
    FUN_1400015e0(&local_b8,param_3,0,0xffffffffffffffff);
    uVar19 = *(undefined4 *)(param_3 + 0x28);
  }
  if (local_a8 == 0) goto LAB_14021c17c;
  lVar15 = *(longlong *)(param_3 + 0x30);
  bVar2 = *(byte *)((longlong)param_1 + 0x601);
  bVar3 = *(byte *)(param_1 + 0xc0);
  local_res18[0] = *(float *)((longlong)param_1 + 300);
  puVar18 = &local_b8;
  if (7 < local_a0) {
    puVar18 = (undefined2 *)CONCAT62(uStack_b6,local_b8);
  }
  puVar16 = (undefined8 *)param_1[0x391];
  local_res20 = lVar15;
  if (puVar16 == (undefined8 *)0x0) {
LAB_14021bd90:
    uVar14 = 0;
  }
  else {
    if (puVar16 != (undefined8 *)param_1[0x392]) {
      iVar11 = DAT_140608150 + 1;
      bVar20 = DAT_140608150 == 0;
      DAT_140608150 = iVar11;
      if (bVar20) {
        FUN_140176d60(1);
      }
      goto LAB_14021bd90;
    }
    uVar14 = *puVar16;
  }
  FUN_140278700(uVar14,&local_c8,puVar18,uVar19,local_res18[0],bVar2 | bVar3,(char)param_1[0x413]);
  if (local_c8 != (longlong *)0x0) {
    if (local_c8 == local_c0) {
      if (*local_c8 != 0) {
        pfVar13 = (float *)(**(code **)(*param_1 + 0xf8))(param_1);
        fVar21 = (param_2[2] - pfVar13[2]) * (param_2[2] - pfVar13[2]) +
                 (*param_2 - *pfVar13) * (*param_2 - *pfVar13);
        local_res18[0] = (float)(0x5f3759df - ((int)fVar21 >> 1));
        fVar22 = local_res18[0] * (1.5 - local_res18[0] * local_res18[0] * fVar21 * 0.5);
        fVar21 = fVar22 * (1.5 - fVar22 * fVar22 * fVar21 * 0.5) * fVar21;
        local_90 = (undefined8 *)0x0;
        local_88 = (undefined8 *)0x0;
        local_80 = 0;
        if (param_1[0x3d0] != 0) {
          FUN_14021b3f0(param_1,&local_90,param_2[3] + fVar21,(char)param_1[0x346]);
        }
        puVar5 = local_88;
        puVar16 = local_90;
        FUN_14021cc10(param_1,param_1[0x2fa],param_2[3] + fVar21);
        while ((puVar16 != puVar5 && (0 < *(int *)((longlong)param_1 + 0x1a2c)))) {
          (**(code **)(*(longlong *)*puVar16 + 0x988))
                    ((longlong *)*puVar16,*(undefined1 *)(lVar15 + 0x14));
          puVar16 = puVar16 + 1;
        }
        uVar14 = 0;
        local_70 = (undefined8 *)0x0;
        local_68 = (undefined8 *)0x0;
        local_60 = 0;
        fVar21 = param_2[3];
        puVar16 = local_70;
        puVar5 = local_70;
        puVar6 = local_68;
        if (param_1[0x3d0] != 0) {
          lVar15 = *(longlong *)(param_1[0x3d0] + 0x30);
          puVar16 = *(undefined8 **)(lVar15 + 0x290);
          if (puVar16 != (undefined8 *)0x0) {
            if (puVar16 == *(undefined8 **)(lVar15 + 0x298)) {
              uVar14 = *puVar16;
            }
            else {
              iVar11 = DAT_1406080b0 + 1;
              bVar20 = DAT_1406080b0 == 0;
              DAT_1406080b0 = iVar11;
              if (bVar20) {
                FUN_140176d60(1);
              }
            }
          }
          FUN_1402535c0(uVar14,&local_70,param_1 + 0x2f,fVar21);
          puVar16 = local_70;
          puVar5 = local_70;
          puVar6 = local_68;
        }
        for (; puVar9 = local_68, puVar8 = local_70, bVar20 = puVar16 != local_68, local_70 = puVar5
            , local_68 = puVar6, bVar20; puVar16 = puVar16 + 1) {
          uVar14 = *puVar16;
          cVar10 = FUN_140252990(uVar14,param_2);
          if (cVar10 != '\0') {
            if (local_c8 == (longlong *)0x0) {
LAB_14021bfe1:
              lVar15 = 0;
            }
            else {
              if (local_c8 != local_c0) {
                iVar11 = DAT_140608154 + 1;
                bVar20 = DAT_140608154 == 0;
                DAT_140608154 = iVar11;
                if (bVar20) {
                  FUN_140176d60(1);
                }
                goto LAB_14021bfe1;
              }
              lVar15 = *local_c8;
            }
            lVar7 = local_res20;
            fVar21 = *(float *)(local_res20 + 0x18);
            iVar11 = FUN_14021afe0(param_1,lVar15,local_res18);
            iVar11 = (int)((float)iVar11 * fVar21);
            plVar17 = (longlong *)param_1[0x2f8];
            if (plVar17 != (longlong *)0x0) {
              if (plVar17 == (longlong *)param_1[0x2f9]) {
                lVar15 = *plVar17;
                if (lVar15 != 0) {
                  if (plVar17 != (longlong *)param_1[0x2f9]) {
                    iVar12 = DAT_1406081cc + 1;
                    bVar20 = DAT_1406081cc == 0;
                    DAT_1406081cc = iVar12;
                    if (bVar20) {
                      FUN_140176d60();
                    }
                    lVar15 = 0;
                  }
                  iVar11 = (int)((float)iVar11 * *(float *)(*(longlong *)(lVar15 + 0x68) + 0x60));
                }
              }
              else {
                iVar12 = DAT_1406081cc + 1;
                bVar20 = DAT_1406081cc == 0;
                DAT_1406081cc = iVar12;
                if (bVar20) {
                  FUN_140176d60(1);
                }
              }
            }
            plVar17 = (longlong *)(lVar7 + 0x20);
            if (0xf < *(ulonglong *)(lVar7 + 0x38)) {
              plVar17 = (longlong *)*plVar17;
            }
            FUN_140252870(uVar14,iVar11,plVar17);
            break;
          }
          puVar5 = local_70;
          puVar6 = local_68;
          local_68 = puVar9;
          local_70 = puVar8;
        }
        if (puVar8 != (undefined8 *)0x0) {
          operator_delete(puVar8);
        }
        if (local_90 != (undefined8 *)0x0) {
          operator_delete(local_90);
        }
        plVar17 = local_c8;
        if (local_c8 != (longlong *)0x0) {
          if (local_c8 == local_c0) {
            if (local_c8 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_c8 + 1;
              lVar15 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)lVar15 == 1) {
                local_c8 = (longlong *)0x0;
                pvVar4 = (void *)*plVar17;
                if (pvVar4 != (void *)0x0) {
                  FUN_140197310(pvVar4);
                  operator_delete(pvVar4);
                }
                operator_delete(plVar17);
              }
            }
          }
          else {
            iVar11 = DAT_1406080b4 + 1;
            bVar20 = DAT_1406080b4 == 0;
            DAT_1406080b4 = iVar11;
            if (bVar20) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_14021c17c;
      }
    }
    else {
      iVar11 = DAT_140608154 + 1;
      bVar20 = DAT_140608154 == 0;
      DAT_140608154 = iVar11;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  plVar17 = local_c8;
  if (local_c8 != (longlong *)0x0) {
    if (local_c8 == local_c0) {
      if (local_c8 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_c8 + 1;
        lVar15 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar15 == 1) {
          local_c8 = (longlong *)0x0;
          pvVar4 = (void *)*plVar17;
          if (pvVar4 != (void *)0x0) {
            FUN_140197310(pvVar4);
            operator_delete(pvVar4);
          }
          operator_delete(plVar17);
        }
      }
    }
    else {
      iVar11 = DAT_1406080b4 + 1;
      bVar20 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar11;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14021c17c:
  if (7 < local_a0) {
    operator_delete((void *)CONCAT62(uStack_b6,local_b8));
  }
  return;
}



void FUN_14021c1b0(longlong *param_1,longlong param_2,longlong param_3)

{
  longlong *plVar1;
  byte bVar2;
  byte bVar3;
  undefined8 *puVar4;
  void *pvVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  undefined8 *puVar10;
  char cVar11;
  int iVar12;
  int iVar13;
  float *pfVar14;
  undefined8 uVar15;
  longlong lVar16;
  float *pfVar17;
  longlong *plVar18;
  undefined2 *puVar19;
  undefined4 uVar20;
  bool bVar21;
  float fVar22;
  float fVar23;
  float local_res18 [2];
  float local_res20 [2];
  longlong *local_d8;
  longlong *local_d0;
  float local_c8 [2];
  undefined2 local_c0;
  undefined6 uStack_be;
  longlong local_b0;
  ulonglong local_a8;
  longlong local_98;
  undefined8 *local_90;
  undefined8 *local_88;
  undefined8 local_80;
  undefined8 *local_70;
  undefined8 *local_68;
  undefined8 local_60;
  undefined8 local_50;
  
  local_50 = 0xfffffffffffffffe;
  local_a8 = 7;
  local_b0 = 0;
  local_c0 = 0;
  if (*(longlong *)(param_3 + 0x10) == 0) {
    FUN_1400015e0(&local_c0,param_1 + 0x299,0,0xffffffffffffffff);
    uVar20 = (undefined4)param_1[0x381];
  }
  else {
    FUN_1400015e0(&local_c0,param_3,0,0xffffffffffffffff);
    uVar20 = *(undefined4 *)(param_3 + 0x28);
  }
  if (local_b0 == 0) goto LAB_14021c6ac;
  lVar16 = *(longlong *)(param_3 + 0x30);
  bVar2 = *(byte *)((longlong)param_1 + 0x601);
  bVar3 = *(byte *)(param_1 + 0xc0);
  local_res18[0] = *(float *)((longlong)param_1 + 300);
  puVar19 = &local_c0;
  if (7 < local_a8) {
    puVar19 = (undefined2 *)CONCAT62(uStack_be,local_c0);
  }
  puVar4 = (undefined8 *)param_1[0x391];
  local_98 = lVar16;
  if (puVar4 == (undefined8 *)0x0) {
LAB_14021c2b0:
    uVar15 = 0;
  }
  else {
    if (puVar4 != (undefined8 *)param_1[0x392]) {
      iVar12 = DAT_140608150 + 1;
      bVar21 = DAT_140608150 == 0;
      DAT_140608150 = iVar12;
      if (bVar21) {
        FUN_140176d60(1);
      }
      goto LAB_14021c2b0;
    }
    uVar15 = *puVar4;
  }
  FUN_140278700(uVar15,&local_d8,puVar19,uVar20,local_res18[0],bVar2 | bVar3,(char)param_1[0x413]);
  if (local_d8 != (longlong *)0x0) {
    if (local_d8 == local_d0) {
      if (*local_d8 != 0) {
        local_res20[0] = *(float *)(param_2 + 0x30);
        local_c8[0] = *(float *)(param_2 + 0x34);
        pfVar17 = local_res20;
        if (local_res20[0] <= local_c8[0]) {
          pfVar17 = local_c8;
        }
        pfVar14 = (float *)(**(code **)(*param_1 + 0xf8))(param_1);
        fVar22 = *(float *)(param_2 + 0x2c) - pfVar14[2];
        fVar23 = *(float *)(param_2 + 0x24) - *pfVar14;
        fVar22 = fVar23 * fVar23 + fVar22 * fVar22;
        local_res18[0] = (float)(0x5f3759df - ((int)fVar22 >> 1));
        fVar23 = local_res18[0] * (1.5 - local_res18[0] * local_res18[0] * fVar22 * 0.5);
        local_90 = (undefined8 *)0x0;
        local_88 = (undefined8 *)0x0;
        local_80 = 0;
        puVar4 = local_90;
        puVar6 = local_88;
        if (param_1[0x3d0] != 0) {
          FUN_14021b3f0(param_1,&local_90,
                        fVar23 * (1.5 - fVar23 * fVar23 * fVar22 * 0.5) * fVar22 + *pfVar17,
                        (char)param_1[0x346]);
          puVar4 = local_90;
          puVar6 = local_88;
        }
        while ((puVar7 = local_88, puVar4 != local_88 && (0 < *(int *)((longlong)param_1 + 0x1a2c)))
              ) {
          local_88 = puVar6;
          (**(code **)(*(longlong *)*puVar4 + 0x988))
                    ((longlong *)*puVar4,*(undefined1 *)(lVar16 + 0x14));
          puVar4 = puVar4 + 1;
          puVar6 = local_88;
          local_88 = puVar7;
        }
        uVar15 = 0;
        local_70 = (undefined8 *)0x0;
        local_68 = (undefined8 *)0x0;
        local_60 = 0;
        uVar20 = *(undefined4 *)(param_2 + 0x34);
        local_88 = puVar6;
        puVar4 = local_70;
        puVar7 = local_70;
        puVar8 = local_68;
        if (param_1[0x3d0] != 0) {
          lVar16 = *(longlong *)(param_1[0x3d0] + 0x30);
          puVar4 = *(undefined8 **)(lVar16 + 0x290);
          if (puVar4 != (undefined8 *)0x0) {
            if (puVar4 == *(undefined8 **)(lVar16 + 0x298)) {
              uVar15 = *puVar4;
            }
            else {
              iVar12 = DAT_1406080b0 + 1;
              bVar21 = DAT_1406080b0 == 0;
              DAT_1406080b0 = iVar12;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
          FUN_1402535c0(uVar15,&local_70,param_1 + 0x2f,uVar20);
          puVar4 = local_70;
          puVar7 = local_70;
          puVar8 = local_68;
        }
        for (; puVar10 = local_68, puVar6 = local_70, bVar21 = puVar4 != local_68, local_70 = puVar7
            , local_68 = puVar8, bVar21; puVar4 = puVar4 + 1) {
          uVar15 = *puVar4;
          cVar11 = FUN_140252ca0(uVar15,param_2);
          if (cVar11 != '\0') {
            if (local_d8 == (longlong *)0x0) {
LAB_14021c511:
              lVar16 = 0;
            }
            else {
              if (local_d8 != local_d0) {
                iVar12 = DAT_140608154 + 1;
                bVar21 = DAT_140608154 == 0;
                DAT_140608154 = iVar12;
                if (bVar21) {
                  FUN_140176d60(1);
                }
                goto LAB_14021c511;
              }
              lVar16 = *local_d8;
            }
            lVar9 = local_98;
            fVar22 = *(float *)(local_98 + 0x18);
            iVar12 = FUN_14021afe0(param_1,lVar16,local_res18);
            iVar12 = (int)((float)iVar12 * fVar22);
            plVar18 = (longlong *)param_1[0x2f8];
            if (plVar18 != (longlong *)0x0) {
              if (plVar18 == (longlong *)param_1[0x2f9]) {
                lVar16 = *plVar18;
                if (lVar16 != 0) {
                  if (plVar18 != (longlong *)param_1[0x2f9]) {
                    iVar13 = DAT_1406081cc + 1;
                    bVar21 = DAT_1406081cc == 0;
                    DAT_1406081cc = iVar13;
                    if (bVar21) {
                      FUN_140176d60();
                    }
                    lVar16 = 0;
                  }
                  iVar12 = (int)((float)iVar12 * *(float *)(*(longlong *)(lVar16 + 0x68) + 0x60));
                }
              }
              else {
                iVar13 = DAT_1406081cc + 1;
                bVar21 = DAT_1406081cc == 0;
                DAT_1406081cc = iVar13;
                if (bVar21) {
                  FUN_140176d60(1);
                }
              }
            }
            plVar18 = (longlong *)(lVar9 + 0x20);
            if (0xf < *(ulonglong *)(lVar9 + 0x38)) {
              plVar18 = (longlong *)*plVar18;
            }
            FUN_140252870(uVar15,iVar12,plVar18);
            break;
          }
          puVar7 = local_70;
          puVar8 = local_68;
          local_68 = puVar10;
          local_70 = puVar6;
        }
        if (puVar6 != (undefined8 *)0x0) {
          operator_delete(puVar6);
        }
        if (local_90 != (undefined8 *)0x0) {
          operator_delete(local_90);
        }
        plVar18 = local_d8;
        if (local_d8 != (longlong *)0x0) {
          if (local_d8 == local_d0) {
            if (local_d8 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_d8 + 1;
              lVar16 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)lVar16 == 1) {
                local_d8 = (longlong *)0x0;
                pvVar5 = (void *)*plVar18;
                if (pvVar5 != (void *)0x0) {
                  FUN_140197310(pvVar5);
                  operator_delete(pvVar5);
                }
                operator_delete(plVar18);
              }
            }
          }
          else {
            iVar12 = DAT_1406080b4 + 1;
            bVar21 = DAT_1406080b4 == 0;
            DAT_1406080b4 = iVar12;
            if (bVar21) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_14021c6ac;
      }
    }
    else {
      iVar12 = DAT_140608154 + 1;
      bVar21 = DAT_140608154 == 0;
      DAT_140608154 = iVar12;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
  plVar18 = local_d8;
  if (local_d8 != (longlong *)0x0) {
    if (local_d8 == local_d0) {
      if (local_d8 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_d8 + 1;
        lVar16 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar16 == 1) {
          local_d8 = (longlong *)0x0;
          pvVar5 = (void *)*plVar18;
          if (pvVar5 != (void *)0x0) {
            FUN_140197310(pvVar5);
            operator_delete(pvVar5);
          }
          operator_delete(plVar18);
        }
      }
    }
    else {
      iVar12 = DAT_1406080b4 + 1;
      bVar21 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar12;
      if (bVar21) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14021c6ac:
  if (7 < local_a8) {
    operator_delete((void *)CONCAT62(uStack_be,local_c0));
  }
  return;
}



void FUN_14021c6e0(longlong *param_1,longlong param_2,longlong param_3)

{
  longlong *plVar1;
  byte bVar2;
  byte bVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  char cVar10;
  int iVar11;
  int iVar12;
  float *pfVar13;
  undefined8 uVar14;
  longlong lVar15;
  undefined8 *puVar16;
  longlong *plVar17;
  undefined2 *puVar18;
  undefined4 uVar19;
  bool bVar20;
  float fVar21;
  float fVar22;
  float local_res18 [2];
  longlong local_res20;
  longlong *local_c8;
  longlong *local_c0;
  undefined2 local_b8;
  undefined6 uStack_b6;
  longlong local_a8;
  ulonglong local_a0;
  undefined8 *local_90;
  undefined8 *local_88;
  undefined8 local_80;
  undefined8 *local_70;
  undefined8 *local_68;
  undefined8 local_60;
  undefined8 local_50;
  
  local_50 = 0xfffffffffffffffe;
  local_a0 = 7;
  local_a8 = 0;
  local_b8 = 0;
  if (*(longlong *)(param_3 + 0x10) == 0) {
    FUN_1400015e0(&local_b8,param_1 + 0x299,0,0xffffffffffffffff);
    uVar19 = (undefined4)param_1[0x381];
  }
  else {
    FUN_1400015e0(&local_b8,param_3,0,0xffffffffffffffff);
    uVar19 = *(undefined4 *)(param_3 + 0x28);
  }
  if (local_a8 == 0) goto LAB_14021cbcd;
  lVar15 = *(longlong *)(param_3 + 0x30);
  bVar2 = *(byte *)((longlong)param_1 + 0x601);
  bVar3 = *(byte *)(param_1 + 0xc0);
  local_res18[0] = *(float *)((longlong)param_1 + 300);
  puVar18 = &local_b8;
  if (7 < local_a0) {
    puVar18 = (undefined2 *)CONCAT62(uStack_b6,local_b8);
  }
  puVar16 = (undefined8 *)param_1[0x391];
  local_res20 = lVar15;
  if (puVar16 == (undefined8 *)0x0) {
LAB_14021c7e0:
    uVar14 = 0;
  }
  else {
    if (puVar16 != (undefined8 *)param_1[0x392]) {
      iVar11 = DAT_140608150 + 1;
      bVar20 = DAT_140608150 == 0;
      DAT_140608150 = iVar11;
      if (bVar20) {
        FUN_140176d60(1);
      }
      goto LAB_14021c7e0;
    }
    uVar14 = *puVar16;
  }
  FUN_140278700(uVar14,&local_c8,puVar18,uVar19,local_res18[0],bVar2 | bVar3,(char)param_1[0x413]);
  if (local_c8 != (longlong *)0x0) {
    if (local_c8 == local_c0) {
      if (*local_c8 != 0) {
        pfVar13 = (float *)(**(code **)(*param_1 + 0xf8))(param_1);
        fVar22 = *(float *)(param_2 + 0x28) - pfVar13[2];
        fVar21 = *(float *)(param_2 + 0x20) - *pfVar13;
        fVar21 = fVar22 * fVar22 + fVar21 * fVar21;
        local_res18[0] = (float)(0x5f3759df - ((int)fVar21 >> 1));
        fVar22 = local_res18[0] * (1.5 - local_res18[0] * local_res18[0] * fVar21 * 0.5);
        fVar21 = fVar22 * (1.5 - fVar22 * fVar22 * fVar21 * 0.5) * fVar21;
        local_90 = (undefined8 *)0x0;
        local_88 = (undefined8 *)0x0;
        local_80 = 0;
        if (param_1[0x3d0] != 0) {
          FUN_14021b3f0(param_1,&local_90,*(float *)(param_2 + 0x18) + fVar21,(char)param_1[0x346]);
        }
        puVar5 = local_88;
        puVar16 = local_90;
        FUN_14021cc10(param_1,param_1[0x2fa],*(float *)(param_2 + 0x18) + fVar21);
        while ((puVar16 != puVar5 && (0 < *(int *)((longlong)param_1 + 0x1a2c)))) {
          (**(code **)(*(longlong *)*puVar16 + 0x988))
                    ((longlong *)*puVar16,*(undefined1 *)(lVar15 + 0x14));
          puVar16 = puVar16 + 1;
        }
        uVar14 = 0;
        local_70 = (undefined8 *)0x0;
        local_68 = (undefined8 *)0x0;
        local_60 = 0;
        uVar19 = *(undefined4 *)(param_2 + 0x18);
        puVar16 = local_70;
        puVar5 = local_70;
        puVar6 = local_68;
        if (param_1[0x3d0] != 0) {
          lVar15 = *(longlong *)(param_1[0x3d0] + 0x30);
          puVar16 = *(undefined8 **)(lVar15 + 0x290);
          if (puVar16 != (undefined8 *)0x0) {
            if (puVar16 == *(undefined8 **)(lVar15 + 0x298)) {
              uVar14 = *puVar16;
            }
            else {
              iVar11 = DAT_1406080b0 + 1;
              bVar20 = DAT_1406080b0 == 0;
              DAT_1406080b0 = iVar11;
              if (bVar20) {
                FUN_140176d60(1);
              }
            }
          }
          FUN_1402535c0(uVar14,&local_70,param_1 + 0x2f,uVar19);
          puVar16 = local_70;
          puVar5 = local_70;
          puVar6 = local_68;
        }
        for (; puVar9 = local_68, puVar8 = local_70, bVar20 = puVar16 != local_68, local_70 = puVar5
            , local_68 = puVar6, bVar20; puVar16 = puVar16 + 1) {
          uVar14 = *puVar16;
          cVar10 = FUN_140252b30(uVar14,param_2);
          if (cVar10 != '\0') {
            if (local_c8 == (longlong *)0x0) {
LAB_14021ca32:
              lVar15 = 0;
            }
            else {
              if (local_c8 != local_c0) {
                iVar11 = DAT_140608154 + 1;
                bVar20 = DAT_140608154 == 0;
                DAT_140608154 = iVar11;
                if (bVar20) {
                  FUN_140176d60(1);
                }
                goto LAB_14021ca32;
              }
              lVar15 = *local_c8;
            }
            lVar7 = local_res20;
            fVar21 = *(float *)(local_res20 + 0x18);
            iVar11 = FUN_14021afe0(param_1,lVar15,local_res18);
            iVar11 = (int)((float)iVar11 * fVar21);
            plVar17 = (longlong *)param_1[0x2f8];
            if (plVar17 != (longlong *)0x0) {
              if (plVar17 == (longlong *)param_1[0x2f9]) {
                lVar15 = *plVar17;
                if (lVar15 != 0) {
                  if (plVar17 != (longlong *)param_1[0x2f9]) {
                    iVar12 = DAT_1406081cc + 1;
                    bVar20 = DAT_1406081cc == 0;
                    DAT_1406081cc = iVar12;
                    if (bVar20) {
                      FUN_140176d60();
                    }
                    lVar15 = 0;
                  }
                  iVar11 = (int)((float)iVar11 * *(float *)(*(longlong *)(lVar15 + 0x68) + 0x60));
                }
              }
              else {
                iVar12 = DAT_1406081cc + 1;
                bVar20 = DAT_1406081cc == 0;
                DAT_1406081cc = iVar12;
                if (bVar20) {
                  FUN_140176d60(1);
                }
              }
            }
            plVar17 = (longlong *)(lVar7 + 0x20);
            if (0xf < *(ulonglong *)(lVar7 + 0x38)) {
              plVar17 = (longlong *)*plVar17;
            }
            FUN_140252870(uVar14,iVar11,plVar17);
            break;
          }
          puVar5 = local_70;
          puVar6 = local_68;
          local_68 = puVar9;
          local_70 = puVar8;
        }
        if (puVar8 != (undefined8 *)0x0) {
          operator_delete(puVar8);
        }
        if (local_90 != (undefined8 *)0x0) {
          operator_delete(local_90);
        }
        plVar17 = local_c8;
        if (local_c8 != (longlong *)0x0) {
          if (local_c8 == local_c0) {
            if (local_c8 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_c8 + 1;
              lVar15 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)lVar15 == 1) {
                local_c8 = (longlong *)0x0;
                pvVar4 = (void *)*plVar17;
                if (pvVar4 != (void *)0x0) {
                  FUN_140197310(pvVar4);
                  operator_delete(pvVar4);
                }
                operator_delete(plVar17);
              }
            }
          }
          else {
            iVar11 = DAT_1406080b4 + 1;
            bVar20 = DAT_1406080b4 == 0;
            DAT_1406080b4 = iVar11;
            if (bVar20) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_14021cbcd;
      }
    }
    else {
      iVar11 = DAT_140608154 + 1;
      bVar20 = DAT_140608154 == 0;
      DAT_140608154 = iVar11;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
  plVar17 = local_c8;
  if (local_c8 != (longlong *)0x0) {
    if (local_c8 == local_c0) {
      if (local_c8 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_c8 + 1;
        lVar15 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar15 == 1) {
          local_c8 = (longlong *)0x0;
          pvVar4 = (void *)*plVar17;
          if (pvVar4 != (void *)0x0) {
            FUN_140197310(pvVar4);
            operator_delete(pvVar4);
          }
          operator_delete(plVar17);
        }
      }
    }
    else {
      iVar11 = DAT_1406080b4 + 1;
      bVar20 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar11;
      if (bVar20) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14021cbcd:
  if (7 < local_a0) {
    operator_delete((void *)CONCAT62(uStack_b6,local_b8));
  }
  return;
}



void FUN_14021cc10(longlong param_1,longlong param_2,undefined4 param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong *plVar4;
  uint uVar5;
  longlong *plVar6;
  uint *puVar7;
  longlong lVar8;
  uint *puVar9;
  int iVar10;
  bool bVar11;
  longlong local_res10;
  undefined8 uVar12;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  longlong *local_58;
  longlong *local_50;
  longlong *local_48;
  
  if (param_2 != 0) {
    uVar12 = 0xfffffffffffffffe;
    iVar10 = 0;
    puVar9 = (uint *)(param_2 + 0x3d8);
    do {
      uVar5 = *puVar9;
      if (uVar5 != 0) {
        plVar6 = (longlong *)FUN_1403161f0();
        if (*plVar6 != 0) {
          for (puVar7 = *(uint **)(*plVar6 +
                                  ((ulonglong)uVar5 % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
              puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xe8)) {
            if ((puVar7[0xea] == uVar5) && (*puVar7 == uVar5)) {
              if (puVar7 != (uint *)0x0) {
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar5 = puVar7[0x4a];
                goto LAB_14021ccc4;
              }
              break;
            }
          }
        }
        uVar5 = 1;
LAB_14021ccc4:
        local_58 = (longlong *)0x0;
        local_50 = (longlong *)0x0;
        local_48 = (longlong *)0x0;
        if (uVar5 == 1) {
          FUN_140195b20(&local_58);
          if (local_50 != (longlong *)0x0) {
            *local_50 = param_1;
          }
          local_50 = local_50 + 1;
          plVar6 = local_58;
          plVar1 = local_58;
          plVar2 = local_50;
        }
        else if (uVar5 == 2) {
          FUN_140190840(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),&local_58,param_1,
                        param_3,4);
          local_res10 = param_1;
          if ((&local_res10 < local_50) && (local_58 <= &local_res10)) {
            lVar8 = (longlong)&local_res10 - (longlong)local_58;
            if (local_50 == local_48) {
              FUN_140195b20(&local_58);
            }
            if (local_50 != (longlong *)0x0) {
              *local_50 = local_58[lVar8 >> 3];
            }
            local_50 = local_50 + 1;
            plVar6 = local_58;
            plVar1 = local_58;
            plVar2 = local_50;
          }
          else {
            if (local_50 == local_48) {
              FUN_140195b20(&local_58);
            }
            if (local_50 != (longlong *)0x0) {
              *local_50 = param_1;
            }
            local_50 = local_50 + 1;
            plVar6 = local_58;
            plVar1 = local_58;
            plVar2 = local_50;
          }
        }
        else {
          plVar6 = local_58;
          plVar1 = local_58;
          plVar2 = local_50;
          if (uVar5 == 3) {
            FUN_140190840(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),&local_58,param_1,
                          param_3,2);
            plVar6 = local_58;
            plVar1 = local_58;
            plVar2 = local_50;
          }
        }
        for (; plVar4 = local_50, plVar3 = local_58, plVar6 != local_50; plVar6 = plVar6 + 1) {
          local_78 = *(undefined4 *)(param_1 + 0x154);
          local_74 = *(undefined4 *)(param_1 + 0x158);
          local_70 = *(undefined4 *)(param_1 + 0x15c);
          local_68 = *(undefined4 *)(param_1 + 0x178);
          local_64 = *(undefined4 *)(param_1 + 0x17c);
          local_60 = *(undefined4 *)(param_1 + 0x180);
          local_58 = plVar1;
          local_50 = plVar2;
          FUN_1402343b0(*plVar6,*puVar9,*(undefined4 *)(param_2 + 0x18),
                        *(undefined4 *)(param_2 + 0x28),param_1,0,&local_68,&local_78,uVar12);
          plVar1 = local_58;
          plVar2 = local_50;
          local_50 = plVar4;
          local_58 = plVar3;
        }
        bVar11 = local_58 != (longlong *)0x0;
        local_58 = plVar1;
        local_50 = plVar2;
        if (bVar11) {
          operator_delete(plVar3);
        }
      }
      iVar10 = iVar10 + 1;
      puVar9 = puVar9 + 1;
    } while (iVar10 < 4);
  }
  return;
}



void FUN_14021cec0(longlong *param_1,longlong param_2)

{
  float *pfVar1;
  float *pfVar2;
  float fVar3;
  float fVar4;
  float local_res8 [2];
  float local_res20 [2];
  
  if (param_1[0x168] != 0) {
    local_res8[0] = *(float *)(param_2 + 0x30);
    local_res20[0] = *(float *)(param_2 + 0x34);
    pfVar2 = local_res8;
    if (local_res8[0] <= local_res20[0]) {
      pfVar2 = local_res20;
    }
    pfVar1 = (float *)(**(code **)(*param_1 + 0xf8))();
    fVar3 = *(float *)(param_2 + 0x24) - *pfVar1;
    fVar4 = *(float *)(param_2 + 0x2c) - pfVar1[2];
    fVar4 = fVar4 * fVar4 + fVar3 * fVar3;
    fVar3 = (float)(0x5f3759df - ((int)fVar4 >> 1));
    fVar3 = fVar3 * (1.5 - fVar3 * fVar3 * fVar4 * 0.5);
    FUN_14021cc10(param_1,param_1[0x168],
                  (1.5 - fVar3 * fVar3 * fVar4 * 0.5) * fVar3 * fVar4 + *pfVar2);
    param_1[0x168] = 0;
  }
  return;
}



void FUN_14021cfc0(longlong *param_1,longlong param_2)

{
  float *pfVar1;
  float *pfVar2;
  float fVar3;
  float fVar4;
  float local_res8 [2];
  float local_res20 [2];
  
  if (param_1[0x16a] != 0) {
    local_res8[0] = *(float *)(param_2 + 0x30);
    local_res20[0] = *(float *)(param_2 + 0x34);
    pfVar2 = local_res8;
    if (local_res8[0] <= local_res20[0]) {
      pfVar2 = local_res20;
    }
    pfVar1 = (float *)(**(code **)(*param_1 + 0xf8))();
    fVar3 = *(float *)(param_2 + 0x24) - *pfVar1;
    fVar4 = *(float *)(param_2 + 0x2c) - pfVar1[2];
    fVar4 = fVar4 * fVar4 + fVar3 * fVar3;
    fVar3 = (float)(0x5f3759df - ((int)fVar4 >> 1));
    fVar3 = fVar3 * (1.5 - fVar3 * fVar3 * fVar4 * 0.5);
    FUN_14021cc10(param_1,param_1[0x16a],
                  (1.5 - fVar3 * fVar3 * fVar4 * 0.5) * fVar3 * fVar4 + *pfVar2);
    param_1[0x16a] = 0;
  }
  return;
}



undefined1 * FUN_14021d0c0(longlong *param_1,float *param_2,longlong param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  longlong *plVar4;
  char cVar5;
  int iVar6;
  undefined4 uVar7;
  int iVar8;
  longlong lVar9;
  longlong *plVar10;
  float fVar11;
  undefined4 local_res8 [2];
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a0;
  float local_9c;
  float local_98;
  void *local_90;
  undefined8 local_88;
  undefined8 local_80;
  
  if (param_1[0x3d0] == 0) {
    return &stack0x00000000;
  }
  lVar9 = *(longlong *)(param_1[0x3d0] + 0x30);
  if (lVar9 == 0) {
    return &stack0x00000000;
  }
  if (*(longlong *)(lVar9 + 0x2d0) == 0) {
    return &stack0x00000000;
  }
  plVar4 = *(longlong **)(lVar9 + 0x2d0);
  if (plVar4 == (longlong *)0x0) {
    return &stack0x00000000;
  }
  iVar6 = *(int *)(param_3 + 0x28);
  if (iVar6 == 0) {
    plVar10 = (longlong *)(param_3 + 0x38);
    if (7 < *(ulonglong *)(param_3 + 0x50)) {
      plVar10 = (longlong *)*plVar10;
    }
    lVar9 = (**(code **)(*plVar4 + 0x18))(plVar4,plVar10);
    if (lVar9 != 0) {
      fVar11 = *(float *)(lVar9 + 500);
      fVar1 = *(float *)(lVar9 + 0x1e8);
      fVar2 = *(float *)(lVar9 + 0x1fc);
      fVar3 = *(float *)(lVar9 + 0x1f0);
      iVar6 = 0;
      do {
        iVar8 = rand();
        *param_2 = (float)iVar8 * 3.0517578e-05 * (fVar11 - fVar1) + *(float *)(lVar9 + 0x1e8);
        param_2[1] = (*(float *)(lVar9 + 0x1f8) + *(float *)(lVar9 + 0x1ec)) * 0.5;
        iVar8 = rand();
        param_2[2] = (float)iVar8 * 3.0517578e-05 * (fVar2 - fVar3) + *(float *)(lVar9 + 0x1f0);
        cVar5 = FUN_1402bbb40(lVar9 + 0x188,param_2);
        if (cVar5 != '\0') {
          local_res8[0] = 0;
          local_90 = (void *)0x0;
          local_88 = 0;
          local_80 = 0;
          uVar7 = (**(code **)(*param_1 + 0x80))(param_1);
          iVar8 = FUN_1402bec00(plVar4 + 0x6e,&local_90,local_res8,param_2,uVar7);
          if (iVar8 != -1) goto LAB_14021d675;
          if (local_90 != (void *)0x0) {
            operator_delete(local_90);
          }
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < 10);
    }
  }
  else if (iVar6 == 1) {
    local_b0 = 0.0;
    local_ac = 0.0;
    local_a8 = 0.0;
    iVar6 = rand();
    local_b0 = (float)iVar6 * 3.0517578e-05;
    local_ac = 0.0;
    iVar6 = rand();
    local_a8 = (float)iVar6 * 3.0517578e-05;
    D3DXVec3Normalize(&local_b0,&local_b0);
    local_b0 = local_b0 * *(float *)(param_3 + 0x30);
    local_ac = local_ac * *(float *)(param_3 + 0x30);
    iVar6 = rand();
    fVar11 = (float)iVar6 * 3.0517578e-05 * *(float *)(param_3 + 0x34);
    local_98 = fVar11 * local_a8 + *(float *)(param_1 + 0x30);
    local_9c = fVar11 * local_ac + *(float *)((longlong)param_1 + 0x17c);
    local_a0 = fVar11 * local_b0 + *(float *)(param_1 + 0x2f);
    *param_2 = local_a0;
    param_2[1] = local_9c;
    param_2[2] = local_98;
    iVar6 = 0;
    do {
      local_res8[0] = 0;
      local_90 = (void *)0x0;
      local_88 = 0;
      local_80 = 0;
      uVar7 = (**(code **)(*param_1 + 0x80))(param_1);
      iVar8 = FUN_1402bec00(plVar4 + 0x6e,&local_90,local_res8,param_2,uVar7);
      if (iVar8 != -1) goto LAB_14021d675;
      *param_2 = *param_2 - local_b0;
      param_2[1] = param_2[1] - local_ac;
      param_2[2] = param_2[2] - local_a8;
      if (local_90 != (void *)0x0) {
        operator_delete(local_90);
      }
      iVar6 = iVar6 + 1;
    } while (iVar6 < 10);
  }
  else if (iVar6 == 2) {
    local_b0 = 0.0;
    local_ac = 0.0;
    local_a8 = 0.0;
    iVar6 = rand();
    local_b0 = (float)iVar6 * 3.0517578e-05;
    local_ac = 0.0;
    iVar6 = rand();
    local_a8 = (float)iVar6 * 3.0517578e-05;
    D3DXVec3Normalize(&local_b0,&local_b0);
    local_b0 = local_b0 * *(float *)(param_3 + 0x30);
    local_ac = local_ac * *(float *)(param_3 + 0x30);
    lVar9 = (**(code **)(*param_1 + 0x110))(param_1);
    if (lVar9 == 0) {
      iVar6 = rand();
      fVar11 = (float)iVar6 * 3.0517578e-05 * *(float *)(param_3 + 0x34);
      local_98 = fVar11 * local_a8 + *(float *)(param_1 + 0x30);
      local_9c = fVar11 * local_ac + *(float *)((longlong)param_1 + 0x17c);
      local_a0 = fVar11 * local_b0 + *(float *)(param_1 + 0x2f);
      *param_2 = local_a0;
      param_2[1] = local_9c;
      param_2[2] = local_98;
      iVar6 = 0;
      do {
        local_res8[0] = 0;
        local_90 = (void *)0x0;
        local_88 = 0;
        local_80 = 0;
        uVar7 = (**(code **)(*param_1 + 0x80))(param_1);
        iVar8 = FUN_1402bec00(plVar4 + 0x6e,&local_90,local_res8,param_2,uVar7);
        if (iVar8 != -1) {
LAB_14021d675:
          if (local_90 == (void *)0x0) {
            return (undefined1 *)0x1;
          }
          operator_delete(local_90);
          return (undefined1 *)0x1;
        }
        *param_2 = *param_2 - local_b0;
        param_2[1] = param_2[1] - local_ac;
        param_2[2] = param_2[2] - local_a8;
        if (local_90 != (void *)0x0) {
          operator_delete(local_90);
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < 10);
    }
    else {
      iVar6 = rand();
      fVar11 = (float)iVar6 * 3.0517578e-05 * *(float *)(param_3 + 0x34);
      local_98 = fVar11 * local_a8 + *(float *)(lVar9 + 0x180);
      local_9c = fVar11 * local_ac + *(float *)(lVar9 + 0x17c);
      local_a0 = fVar11 * local_b0 + *(float *)(lVar9 + 0x178);
      *param_2 = local_a0;
      param_2[1] = local_9c;
      param_2[2] = local_98;
      iVar6 = 0;
      do {
        local_res8[0] = 0;
        local_90 = (void *)0x0;
        local_88 = 0;
        local_80 = 0;
        uVar7 = (**(code **)(*param_1 + 0x80))(param_1);
        iVar8 = FUN_1402bec00(plVar4 + 0x6e,&local_90,local_res8,param_2,uVar7);
        if (iVar8 != -1) goto LAB_14021d675;
        *param_2 = *param_2 - local_b0;
        param_2[1] = param_2[1] - local_ac;
        param_2[2] = param_2[2] - local_a8;
        if (local_90 != (void *)0x0) {
          operator_delete(local_90);
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < 10);
    }
  }
  return (undefined1 *)0x1;
}



void FUN_14021d6c0(longlong *param_1,uint *param_2)

{
  longlong *plVar1;
  byte bVar2;
  byte bVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  int iVar7;
  longlong *plVar8;
  undefined8 uVar9;
  bool bVar10;
  longlong *local_18;
  longlong *local_10;
  
  if (param_2 == (uint *)0x0) {
    return;
  }
  uVar4 = *param_2;
  if ((uVar4 & 1) == 0) goto LAB_14021d8eb;
  uVar5 = *(undefined4 *)((longlong)param_1 + 300);
  switch(uVar5) {
  case 0x38:
  case 0x3b:
    *(undefined4 *)(param_1 + 0x1af) = 2;
    break;
  default:
    bVar2 = *(byte *)((longlong)param_1 + 0x601);
    plVar8 = param_1 + 0x299;
    bVar3 = *(byte *)(param_1 + 0xc0);
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar8 = (longlong *)*plVar8;
    }
    uVar9 = FUN_14020d8c0(param_1 + 0x391);
    FUN_140278700(uVar9,&local_18,plVar8,(int)param_1[0x381],uVar5,bVar2 | bVar3,
                  (char)param_1[0x413]);
    if (local_18 == (longlong *)0x0) break;
    if (local_18 == local_10) {
      plVar8 = local_18;
      if (*local_18 == 0) goto LAB_14021d88b;
    }
    else {
      iVar7 = DAT_140608154 + 1;
      bVar10 = DAT_140608154 == 0;
      DAT_140608154 = iVar7;
      if (bVar10) {
        FUN_140176d60(1);
      }
LAB_14021d88b:
      plVar8 = local_18;
      if (local_18 == (longlong *)0x0) break;
    }
    if (plVar8 == local_10) {
      if (plVar8 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar8 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          local_18 = (longlong *)0x0;
          pvVar6 = (void *)*plVar8;
          if (pvVar6 != (void *)0x0) {
            FUN_140197310(pvVar6);
            operator_delete(pvVar6);
          }
          operator_delete(plVar8);
        }
      }
    }
    else {
      iVar7 = DAT_1406080b4 + 1;
      bVar10 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar7;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
    break;
  case 0x3c:
  case 0x3e:
    if (0 < (int)param_1[0x345]) {
      (**(code **)(*param_1 + 0x290))(param_1);
      (**(code **)(*param_1 + 0x990))(param_1);
    }
    break;
  case 0x43:
    if (param_1[0x3d0] == 0) {
      return;
    }
    plVar8 = (longlong *)
             FUN_140192f70(*(undefined8 *)(param_1[0x3d0] + 0x48),(int)param_1[0x194],
                           *(undefined4 *)((longlong)param_1 + 0xca4));
    if ((plVar8 != (longlong *)0x0) && (*(int *)((longlong)plVar8 + 300) != 0x25)) {
      (**(code **)(*plVar8 + 0x290))(plVar8);
      (**(code **)(*plVar8 + 0x990))(plVar8);
    }
    param_1[0x194] = 0;
    *(undefined4 *)(param_1 + 0x195) = 0;
    break;
  case 0x4e:
    (**(code **)(*param_1 + 0x960))(param_1);
  case 0x42:
    FUN_1402353b0(param_1);
  }
LAB_14021d8eb:
  if ((uVar4 & 2) != 0) {
    iVar7 = *(int *)((longlong)param_1 + 300);
    if ((iVar7 == 0x12) || (iVar7 == 0x15)) {
      iVar7 = *(int *)((longlong)param_1 + 0x13fc);
      if (iVar7 == 0) {
        iVar7 = 1;
      }
      *(int *)((longlong)param_1 + 0x13fc) = iVar7;
    }
    else if (iVar7 == 0x38) {
      *(undefined4 *)(param_1 + 0x1af) = 4;
    }
    else if (((char)param_1[0xc0] == '\x01') && (*(int *)((longlong)param_1 + 0x13fc) == 0)) {
      *(undefined4 *)((longlong)param_1 + 0x13fc) = 1;
    }
  }
  *(uint *)(param_1 + 0x303) = *(uint *)(param_1 + 0x303) | uVar4;
  return;
}



// WARNING: Removing unreachable block (ram,0x00014021da02)

void FUN_14021d9a0(longlong *param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  
  iVar2 = (**(code **)(*param_1 + 0xb0))();
  if (iVar2 != 4) {
    return;
  }
  cVar1 = FUN_1402d7670(param_1,4);
  if (cVar1 == '\0') {
    cVar1 = FUN_1402d7670(param_1,0xc);
    if (cVar1 == '\0') {
      cVar1 = FUN_1402d7670(param_1,0xe);
      if (cVar1 == '\0') {
        return;
      }
      iVar2 = (**(code **)(**(longlong **)(param_2 + 0x30) + 8))();
      if (iVar2 != 0) {
        if (iVar2 == 2) goto LAB_14021dd48;
        iVar2 = iVar2 + -3;
        if (iVar2 == 0) {
          local_18 = 0;
          local_14 = 0;
          local_48 = 0x3f800000;
          local_44 = 0;
          local_40 = 0;
          local_3c = 0;
          local_38 = 0x3f800000;
          local_34 = 0;
          local_30 = 0;
          local_2c = 0;
          local_28 = 0x3f800000;
          local_24 = 0;
          local_20 = 0;
          local_1c = 0;
          (**(code **)(**(longlong **)(param_2 + 0x30) + 0x70))
                    (*(longlong **)(param_2 + 0x30),&local_48,*(undefined8 *)(param_2 + 0x38));
          iVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
          if (iVar2 == 2) {
            return;
          }
          FUN_14021cfc0(param_1,&local_48,param_2);
          return;
        }
        goto LAB_14021dc75;
      }
    }
    else {
      iVar2 = (**(code **)(**(longlong **)(param_2 + 0x30) + 8))();
      if (iVar2 != 0) {
        if (iVar2 == 2) {
LAB_14021dd48:
          local_58 = 0;
          local_54 = 0;
          local_50 = 0;
          local_4c = 0;
          (**(code **)(**(longlong **)(param_2 + 0x30) + 0x68))
                    (*(longlong **)(param_2 + 0x30),&local_58,*(undefined8 *)(param_2 + 0x38));
          return;
        }
        iVar2 = iVar2 + -3;
        if (iVar2 == 0) {
          local_18 = 0;
          local_14 = 0;
          local_48 = 0x3f800000;
          local_44 = 0;
          local_40 = 0;
          local_3c = 0;
          local_38 = 0x3f800000;
          local_34 = 0;
          local_30 = 0;
          local_2c = 0;
          local_28 = 0x3f800000;
          local_24 = 0;
          local_20 = 0;
          local_1c = 0;
          (**(code **)(**(longlong **)(param_2 + 0x30) + 0x70))
                    (*(longlong **)(param_2 + 0x30),&local_48,*(undefined8 *)(param_2 + 0x38));
          iVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
          if (iVar2 == 2) {
            return;
          }
          FUN_14021cec0(param_1,&local_48,param_2);
          return;
        }
LAB_14021dc75:
        if (iVar2 != 1) {
          return;
        }
        local_48 = 0;
        local_44 = 0;
        local_40 = 0;
        local_3c = 0;
        local_38 = 0;
        local_34 = 0x3f800000;
        local_30 = 0;
        (**(code **)(**(longlong **)(param_2 + 0x30) + 0x78))
                  (*(longlong **)(param_2 + 0x30),&local_48,*(undefined8 *)(param_2 + 0x38));
        return;
      }
    }
  }
  else {
    if (*(char *)(*(longlong *)(param_2 + 0x30) + 0x16) != '\0') {
      *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
      *(undefined4 *)((longlong)param_1 + 0x1c54) = *(undefined4 *)((longlong)param_1 + 0x1c54);
    }
    iVar2 = (**(code **)(**(longlong **)(param_2 + 0x30) + 8))();
    if (iVar2 != 0) {
      if (iVar2 == 2) {
        local_58 = 0;
        local_54 = 0;
        local_50 = 0;
        local_4c = 0;
        (**(code **)(**(longlong **)(param_2 + 0x30) + 0x68))
                  (*(longlong **)(param_2 + 0x30),&local_58,*(undefined8 *)(param_2 + 0x38));
        iVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
        if (iVar2 == 2) {
          return;
        }
        FUN_14021bc90(param_1,&local_58,param_2);
        return;
      }
      if (iVar2 == 3) {
        local_18 = 0;
        local_14 = 0;
        local_48 = 0x3f800000;
        local_44 = 0;
        local_40 = 0;
        local_3c = 0;
        local_38 = 0x3f800000;
        local_34 = 0;
        local_30 = 0;
        local_2c = 0;
        local_28 = 0x3f800000;
        local_24 = 0;
        local_20 = 0;
        local_1c = 0;
        (**(code **)(**(longlong **)(param_2 + 0x30) + 0x70))
                  (*(longlong **)(param_2 + 0x30),&local_48,*(undefined8 *)(param_2 + 0x38));
        iVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
        if (iVar2 == 2) {
          return;
        }
        FUN_14021c1b0(param_1,&local_48,param_2);
        return;
      }
      if (iVar2 != 4) {
        return;
      }
      local_48 = 0;
      local_44 = 0;
      local_40 = 0;
      local_3c = 0;
      local_38 = 0;
      local_34 = 0x3f800000;
      local_30 = 0;
      (**(code **)(**(longlong **)(param_2 + 0x30) + 0x78))
                (*(longlong **)(param_2 + 0x30),&local_48,*(undefined8 *)(param_2 + 0x38));
      iVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
      if (iVar2 == 2) {
        return;
      }
      FUN_14021c6e0(param_1,&local_48,param_2);
      return;
    }
  }
  cVar1 = (**(code **)(**(longlong **)(param_2 + 0x30) + 0x58))
                    (*(longlong **)(param_2 + 0x30),param_1 + 0x3cc,*(undefined8 *)(param_2 + 0x38))
  ;
  if (cVar1 != '\0') {
    FUN_14021b5c0(param_1,param_1 + 0x3cc,*(undefined8 *)(param_2 + 0x30));
  }
  return;
}



void FUN_14021ddc0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  int *piVar3;
  longlong lVar4;
  longlong lVar5;
  char cVar6;
  char cVar7;
  int iVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  longlong lVar11;
  longlong *plVar12;
  float *pfVar13;
  int *piVar14;
  ushort *puVar15;
  wchar_t *_Str2;
  ushort *puVar16;
  wchar_t *pwVar17;
  undefined8 *puVar18;
  undefined8 *puVar19;
  undefined8 **ppuVar20;
  undefined8 *puVar21;
  uint uVar22;
  ulonglong uVar23;
  wchar_t *_Str1;
  undefined8 *puVar24;
  undefined8 *puVar25;
  float fVar26;
  float fVar27;
  int local_res10 [2];
  int local_res18 [2];
  int local_res20 [2];
  undefined8 *local_198;
  longlong *plStack_190;
  int local_188;
  float local_184;
  ulonglong local_180;
  char local_178;
  longlong local_170;
  longlong *local_168;
  longlong *local_160;
  ulonglong local_158;
  undefined1 *local_150;
  longlong *plStack_148;
  undefined8 local_140;
  undefined8 local_138;
  ulonglong local_130;
  undefined1 *local_128;
  longlong *plStack_120;
  undefined8 local_118;
  undefined8 local_110;
  undefined8 *local_108;
  undefined8 local_100;
  ulonglong local_f8;
  undefined1 *local_f0;
  longlong *local_e8;
  undefined8 local_e0;
  undefined8 local_d8;
  ulonglong local_d0;
  undefined1 *local_c8;
  longlong *local_c0;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined1 *local_a8;
  longlong *plStack_a0;
  undefined1 *local_98;
  longlong *plStack_90;
  undefined8 *local_88;
  undefined8 local_80;
  undefined8 *local_78;
  undefined8 local_70;
  undefined8 local_68;
  
  local_68 = 0xfffffffffffffffe;
  if ((*param_2 != 0) && (param_1[0x26] != 0)) {
    uVar10 = 0;
    local_180 = 0;
    local_178 = '\0';
    cVar6 = FUN_140195920(param_1 + 0x25d);
    cVar6 = cVar6 != '\0';
    uVar9 = uVar10;
    if ((bool)cVar6) {
      uVar9 = FUN_140195970(param_1 + 0x25d);
      local_178 = 0;
      local_180 = uVar9;
      FUN_14034ed40(uVar9);
      local_178 = '\x01';
    }
    plVar2 = param_1 + 0x27b;
    FUN_140343ec0(plVar2,param_2);
    fVar26 = *(float *)(param_1[0x26] + 0x26c);
    fVar27 = *(float *)(param_1[0x26] + 0x268);
    iVar8 = rand();
    fVar27 = (fVar26 - fVar27) * (float)iVar8 * 3.0517578e-05 + fVar27;
    *(float *)(param_1 + 0x3ca) = fVar27;
    *(float *)(*plVar2 + 0xfc) = fVar27;
    (**(code **)(*param_1 + 0xab8))(param_1);
    local_198 = (undefined8 *)&LAB_14023bed0;
    local_a8 = &LAB_14023bed0;
    plStack_190 = param_1;
    plStack_a0 = param_1;
    cVar7 = FUN_14023bee0(&local_a8);
    local_158 = uVar10;
    if (cVar7 == '\0') {
      local_150 = local_a8;
      plStack_148 = plStack_a0;
      local_158 = 0x1405e8c41;
    }
    local_d0 = 0;
    if (local_158 != 0) {
      local_d0 = local_158;
      if ((local_158 & 1) == 0) {
        (**(code **)(local_158 & 0xfffffffffffffffe))(&local_150,&local_c8,0);
      }
      else {
        local_c8 = local_150;
        local_c0 = plStack_148;
        local_b8 = local_140;
        local_b0 = local_138;
      }
    }
    FUN_1402c6090(*plVar2,&local_d0);
    local_198 = (undefined8 *)&LAB_14023bec0;
    local_98 = &LAB_14023bec0;
    plStack_190 = param_1;
    plStack_90 = param_1;
    cVar7 = FUN_14023bee0(&local_98);
    if (cVar7 == '\0') {
      local_128 = local_98;
      plStack_120 = plStack_90;
      uVar10 = 0x1405e8c51;
    }
    local_f8 = 0;
    local_130 = uVar10;
    if (uVar10 != 0) {
      local_f8 = uVar10;
      if ((uVar10 & 1) == 0) {
        (**(code **)(uVar10 & 0xfffffffffffffffe))(&local_128,&local_f0,0);
      }
      else {
        local_f0 = local_128;
        local_e8 = plStack_120;
        local_e0 = local_118;
        local_d8 = local_110;
      }
    }
    FUN_1402c6140(*plVar2,&local_f8);
    iVar8 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (iVar8 == 2) {
      if (*(longlong *)(*plVar2 + 0x120) == 0) {
        local_88 = (undefined8 *)0x0;
        local_80 = 0;
        ppuVar20 = &local_88;
      }
      else {
        local_108 = *(undefined8 **)(*plVar2 + 0x130);
        if (local_108 == (undefined8 *)0x0) {
          local_100 = 0;
        }
        else {
          local_100 = *local_108;
        }
        ppuVar20 = &local_108;
      }
      puVar25 = *ppuVar20;
      puVar24 = ppuVar20[1];
      while (puVar24 != (undefined8 *)0x0) {
        if ((ulonglong)puVar24[4] < 8) {
          _Str1 = (wchar_t *)(puVar24 + 1);
        }
        else {
          _Str1 = (wchar_t *)puVar24[1];
        }
        lVar11 = param_1[0x26];
        pwVar17 = *(wchar_t **)(lVar11 + 0x728);
        if (pwVar17 != *(wchar_t **)(lVar11 + 0x730)) {
          do {
            _Str2 = pwVar17;
            if (7 < *(ulonglong *)(pwVar17 + 0xc)) {
              _Str2 = *(wchar_t **)pwVar17;
            }
            iVar8 = _wcsicmp(_Str1,_Str2);
            if (iVar8 == 0) goto LAB_14021e2c3;
            pwVar17 = pwVar17 + 0x14;
          } while (pwVar17 != *(wchar_t **)(lVar11 + 0x730));
        }
        local_170 = puVar24[6];
        local_160 = (longlong *)puVar24[7];
        local_168 = local_160;
        if (local_160 != (longlong *)0x0) {
          LOCK();
          *(int *)(local_160 + 1) = (int)local_160[1] + 1;
          UNLOCK();
        }
        if (*(longlong *)(local_170 + 0x20) == 0) {
          local_78 = (undefined8 *)0x0;
          local_70 = 0;
          ppuVar20 = &local_78;
        }
        else {
          local_198 = *(undefined8 **)(local_170 + 0x30);
          if (local_198 == (undefined8 *)0x0) {
            plStack_190 = (longlong *)0x0;
          }
          else {
            plStack_190 = (longlong *)*local_198;
          }
          ppuVar20 = &local_198;
        }
        puVar19 = *ppuVar20;
        puVar21 = ppuVar20[1];
        plVar2 = local_168;
        while (local_168 = plVar2, puVar21 != (undefined8 *)0x0) {
          plVar2 = (longlong *)puVar21[6];
          puVar18 = (undefined8 *)*plVar2;
          if (puVar18 != (undefined8 *)plVar2[1]) {
            do {
              if ((((*(longlong *)*puVar18 != 0) &&
                   (piVar3 = *(int **)(*(longlong *)(*(longlong *)*puVar18 + 0x10) + 0xe8),
                   piVar3 != (int *)0x0)) && (*piVar3 != 0)) &&
                 (lVar11 = FUN_140266970(DAT_140608118,(int)param_1[0x24]), lVar11 != 0)) {
                local_res10[0] = *(int *)(lVar11 + 0xbc);
                piVar3 = (int *)((longlong)param_1 + 0x5cc);
                piVar14 = local_res10;
                if (*(int *)(lVar11 + 0xbc) <= *piVar3) {
                  piVar14 = piVar3;
                }
                *piVar3 = *piVar14;
                local_res18[0] = *(int *)(lVar11 + 0xc0);
                plVar1 = param_1 + 0xba;
                plVar12 = (longlong *)local_res18;
                if (*(int *)(lVar11 + 0xc0) <= (int)*plVar1) {
                  plVar12 = plVar1;
                }
                *(int *)plVar1 = (int)*plVar12;
                local_res20[0] = *(int *)(lVar11 + 0xc4);
                piVar3 = (int *)((longlong)param_1 + 0x5d4);
                piVar14 = local_res20;
                if (*(int *)(lVar11 + 0xc4) <= *piVar3) {
                  piVar14 = piVar3;
                }
                *piVar3 = *piVar14;
                local_188 = *(int *)(lVar11 + 200);
                plVar1 = param_1 + 0xbb;
                plVar12 = (longlong *)&local_188;
                if (*(int *)(lVar11 + 200) <= (int)*plVar1) {
                  plVar12 = plVar1;
                }
                *(int *)plVar1 = (int)*plVar12;
                local_184 = *(float *)(lVar11 + 0xcc);
                pfVar13 = &local_184;
                if (local_184 < *(float *)(param_1 + 0xbc) ||
                    local_184 == *(float *)(param_1 + 0xbc)) {
                  pfVar13 = (float *)(param_1 + 0xbc);
                }
                *(float *)(param_1 + 0xbc) = *pfVar13;
              }
              puVar18 = puVar18 + 2;
            } while (puVar18 != (undefined8 *)plVar2[1]);
          }
          puVar21 = (undefined8 *)*puVar21;
          while (puVar21 == (undefined8 *)0x0) {
            puVar19 = puVar19 + 1;
            puVar21 = (undefined8 *)*puVar19;
          }
          plVar2 = local_168;
          if (puVar19 == puVar21) {
            puVar21 = (undefined8 *)0x0;
          }
        }
        if (local_160 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_160 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar2 + 8))(plVar2);
            LOCK();
            piVar3 = (int *)((longlong)plVar2 + 0xc);
            *piVar3 = *piVar3 + -1;
            UNLOCK();
            if (*piVar3 == 0) {
              (**(code **)(*local_168 + 0x10))();
            }
          }
        }
LAB_14021e2c3:
        puVar24 = (undefined8 *)*puVar24;
        while (puVar24 == (undefined8 *)0x0) {
          puVar25 = puVar25 + 1;
          puVar24 = (undefined8 *)*puVar25;
        }
        cVar6 = local_178;
        uVar9 = local_180;
        if (puVar25 == puVar24) {
          puVar24 = (undefined8 *)0x0;
        }
      }
    }
    lVar11 = param_1[0x27b];
    lVar5 = param_1[0x381];
    uVar10 = *(ulonglong *)(lVar11 + 0x50);
    if (*(ulonglong *)(lVar11 + 0x58) < 8) {
      puVar15 = (ushort *)(lVar11 + 0x40);
    }
    else {
      puVar15 = *(ushort **)(lVar11 + 0x40);
    }
    uVar23 = 6;
    if (uVar10 < 6) {
      uVar23 = uVar10;
    }
    puVar16 = &DAT_14049dca8;
    for (; uVar23 != 0; uVar23 = uVar23 - 1) {
      if (*puVar15 != *puVar16) {
        uVar22 = 1;
        if (*puVar15 < *puVar16) {
          uVar22 = 0xffffffff;
        }
        goto LAB_14021e369;
      }
      puVar15 = puVar15 + 1;
      puVar16 = puVar16 + 1;
    }
    uVar22 = 0;
LAB_14021e369:
    if (uVar22 == 0) {
      if (uVar10 < 6) {
        uVar22 = 0xffffffff;
      }
      else {
        uVar22 = (uint)(uVar10 != 6);
      }
    }
    if (uVar22 != 0) {
      FUN_140001710(lVar11 + 0x40,&DAT_14049dca8,6);
      if (*(longlong *)(lVar11 + 0x10) != 0) {
        lVar4 = *(longlong *)(*(longlong *)(lVar11 + 0x10) + 0xd8);
        if (lVar4 == 0) {
          iVar8 = 0;
        }
        else {
          iVar8 = FUN_1402ce620(lVar4,&DAT_14049dca8);
          iVar8 = iVar8 + 1;
        }
        FUN_1402c5c00(lVar11,iVar8,(int)lVar5,1);
      }
    }
    lVar11 = param_1[0x26];
    if ((int)(*(longlong *)(lVar11 + 0x350) - *(longlong *)(lVar11 + 0x348) >> 2) < 1) {
      fVar26 = 0.0;
    }
    else {
      fVar26 = **(float **)(lVar11 + 0x348);
    }
    param_1[0x28a] = (longlong)(double)fVar26;
    FUN_1402c5d90(param_1[0x27b],fVar26);
    FUN_1402328d0(param_1,1);
    (**(code **)(*param_1 + 0x548))(param_1,1);
    (**(code **)(*param_1 + 0xb0))(param_1);
    if (local_130 != 0) {
      if (((local_130 & 1) == 0) && (*(code **)(local_130 & 0xfffffffffffffffe) != (code *)0x0)) {
        (**(code **)(local_130 & 0xfffffffffffffffe))(&local_128,&local_128,2);
      }
      local_130 = 0;
    }
    if (local_158 != 0) {
      if (((local_158 & 1) == 0) && (*(code **)(local_158 & 0xfffffffffffffffe) != (code *)0x0)) {
        (**(code **)(local_158 & 0xfffffffffffffffe))(&local_150,&local_150,2);
      }
      local_158 = 0;
    }
    if (cVar6 != '\0') {
      FUN_14034edd0(uVar9);
    }
  }
  return;
}



void FUN_14021e4f0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined1 local_20 [8];
  longlong *local_18;
  
  uVar5 = 0xfffffffffffffffe;
  uVar4 = 0xb;
  uVar3 = (**(code **)(*param_1 + 0xb0))();
  switch(uVar3) {
  case 1:
  case 2:
    uVar4 = 0;
    break;
  case 4:
    uVar4 = 1;
    break;
  case 8:
    uVar4 = 2;
    break;
  case 0x10:
  case 0x20:
    uVar4 = 3;
  }
  FUN_1402c4f90(local_20,param_2,uVar4,param_4,uVar5);
  (**(code **)(*param_1 + 0x8e0))(param_1,local_20);
  if (local_18 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_18 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_18 + 8))(local_18);
      LOCK();
      piVar2 = (int *)((longlong)local_18 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_18 + 0x10))(local_18);
      }
    }
  }
  return;
}



undefined8 FUN_14021e5f0(longlong *param_1,double param_2,float *param_3,int param_4)

{
  longlong lVar1;
  char cVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  float fVar5;
  
  if ((DAT_1405dfc58 <= param_2 - (double)param_1[0xa5]) && (param_1[0x3d0] != 0)) {
    param_1[0xa5] = (longlong)param_2;
    lVar1 = *(longlong *)(param_1[0x3d0] + 0x30);
    if ((lVar1 == 0) ||
       (((lVar1 = *(longlong *)(lVar1 + 0x2d0), lVar1 == 0 || (param_4 == -1)) ||
        ((int)param_1[0xa4] == -1)))) {
      uVar4 = 0;
    }
    else {
      cVar2 = (**(code **)(*param_1 + 0x410))(param_1);
      if ((cVar2 == '\0') ||
         (fVar5 = *(float *)((longlong)param_1 + 0x1334) - param_3[1],
         25.0 <= fVar5 * fVar5 +
                 (*(float *)(param_1 + 0x266) - *param_3) * (*(float *)(param_1 + 0x266) - *param_3)
                 + (*(float *)(param_1 + 0x267) - param_3[2]) *
                   (*(float *)(param_1 + 0x267) - param_3[2]))) {
        *(int *)(param_1 + 0xa6) = param_4;
        lVar1 = *(longlong *)(lVar1 + 0x430);
        if ((param_4 < (int)(*(longlong *)(lVar1 + 0x98) - *(longlong *)(lVar1 + 0x90) >> 3)) &&
           (-1 < param_4)) {
          uVar4 = *(undefined8 *)(*(longlong *)(lVar1 + 0x90) + (longlong)param_4 * 8);
        }
        else {
          uVar4 = 0;
        }
        uVar3 = (**(code **)(*param_1 + 0x80))(param_1);
        FUN_1402bd280(param_1,param_3,uVar4,uVar3);
        *(float *)(param_1 + 0x266) = *param_3;
        *(float *)((longlong)param_1 + 0x1334) = param_3[1];
        *(float *)(param_1 + 0x267) = param_3[2];
      }
      uVar4 = 1;
    }
    return uVar4;
  }
  return 0;
}



void FUN_14021e770(longlong param_1,float *param_2)

{
  float *pfVar1;
  
  if (0.0001 <= *param_2 * *param_2 + param_2[1] * param_2[1] + param_2[2] * param_2[2]) {
    pfVar1 = (float *)(param_1 + 0x133c);
    *pfVar1 = *param_2;
    *(float *)(param_1 + 0x1340) = param_2[1];
    *(float *)(param_1 + 0x1344) = param_2[2];
    D3DXVec3Normalize(pfVar1,pfVar1);
  }
  return;
}



void FUN_14021e7d0(longlong param_1,float *param_2)

{
  float *pfVar1;
  
  if (0.0001 <= *param_2 * *param_2 + param_2[1] * param_2[1] + param_2[2] * param_2[2]) {
    pfVar1 = (float *)(param_1 + 0x1348);
    *pfVar1 = *param_2;
    *(float *)(param_1 + 0x134c) = param_2[1];
    *(float *)(param_1 + 0x1350) = param_2[2];
    D3DXVec3Normalize(pfVar1,pfVar1);
  }
  return;
}



void FUN_14021e830(longlong *param_1,float *param_2)

{
  int iVar1;
  
  iVar1 = *(int *)((longlong)param_1 + 300);
  if ((((iVar1 < 0x35) || (((0x36 < iVar1 && (iVar1 != 0x39)) && (iVar1 != 0x3b)))) &&
      (iVar1 != 0x55)) && ((iVar1 < 0x57 || (0x59 < iVar1)))) {
    if (0.0001 <= *param_2 * *param_2 + param_2[1] * param_2[1] + param_2[2] * param_2[2]) {
      *(float *)((longlong)param_1 + 0x154) = *param_2;
      *(float *)(param_1 + 0x2b) = param_2[1];
      *(float *)((longlong)param_1 + 0x15c) = param_2[2];
      D3DXVec3Normalize((longlong)param_1 + 0x154,(longlong)param_1 + 0x154);
      *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
      *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
      *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
      if ((char)param_1[0x27f] != '\0') {
        *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
        *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
        *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
      }
      (**(code **)(*param_1 + 0x1f0))(param_1);
    }
    else if (iVar1 != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 1;
      return;
    }
  }
  return;
}



float FUN_14021e960(longlong param_1)

{
  return (float)*(double *)(param_1 + 0x1450);
}



longlong FUN_14021e970(longlong param_1)

{
  return param_1 + 0x178;
}



void FUN_14021e980(longlong param_1)

{
  longlong lVar1;
  
  FUN_140234b20();
  FUN_1402fbcc0(param_1);
  *(undefined1 *)(param_1 + 0x2099) = 1;
  *(undefined1 *)(param_1 + 0x1869) = 0;
  *(undefined1 *)(param_1 + 0x604) = 1;
  if (((*(longlong *)(param_1 + 0x1e80) != 0) &&
      (lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30), lVar1 != 0)) &&
     (lVar1 = *(longlong *)(lVar1 + 0x280), lVar1 != 0)) {
    FUN_14027c500(lVar1,*(undefined4 *)(param_1 + 0x128));
  }
  return;
}



void FUN_14021e9e0(longlong *param_1,undefined4 *param_2)

{
  undefined4 local_18;
  float local_14;
  undefined4 local_10;
  
  local_18 = *param_2;
  local_10 = param_2[2];
  local_14 = (float)param_2[1];
  if (*(float *)((longlong)param_1 + 0x17c) < (float)param_2[1]) {
    local_14 = *(float *)((longlong)param_1 + 0x17c);
  }
  FUN_14022ecd0(param_2[1],&local_18);
                    // WARNING: Could not recover jumptable at 0x00014021ea2a. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x1f0))(param_1);
  return;
}



undefined4 FUN_14021ea40(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x130) == 0) {
    return 0;
  }
  return *(undefined4 *)(*(longlong *)(param_1 + 0x130) + 0x2a0);
}



void FUN_14021ea60(longlong *param_1,float *param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  
  (**(code **)(*param_1 + 0xb0))();
  *(float *)((longlong)param_1 + 0x154) = *param_2;
  *(float *)(param_1 + 0x2b) = param_2[1];
  *(float *)((longlong)param_1 + 0x15c) = param_2[2];
  (**(code **)(*param_1 + 0x1f0))(param_1);
  fVar3 = (float)((double)param_1[0x28a] * (double)param_1[0xa3]) *
          *(float *)(param_1[0x27b] + 0xfc);
  fVar1 = param_2[2];
  fVar2 = param_2[1];
  *(float *)(param_1 + 0x35d) = fVar3 * *param_2;
  *(float *)((longlong)param_1 + 0x1aec) = fVar3 * fVar2;
  *(float *)(param_1 + 0x35e) = fVar3 * fVar1;
  return;
}



undefined4 FUN_14021eb10(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x520);
}



void FUN_14021eb20(longlong *param_1,undefined8 param_2,short *param_3)

{
  short sVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  short *psVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong lVar9;
  short *psVar10;
  longlong *plVar11;
  short *psVar12;
  bool bVar13;
  float fVar14;
  undefined4 uVar15;
  
  iVar3 = *(int *)((longlong)param_1 + 300);
  if (iVar3 == 0x25) {
    return;
  }
  if (iVar3 == 0x62) {
    return;
  }
  if (iVar3 == 0x65) {
    return;
  }
  iVar2 = 0;
  iVar3 = 0;
  *(undefined4 *)(param_1 + 0x3d6) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1eb4) = 0;
  FUN_140001710(param_1 + 0x299,&DAT_140477960,0);
  lVar6 = param_1[0x17d];
  *(int *)(param_1 + 0x38b) = (int)param_1[0x2f];
  *(undefined2 *)(param_1 + 0xc0) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1c5c) = *(undefined4 *)((longlong)param_1 + 0x17c);
  *(undefined1 *)((longlong)param_1 + 0x18dd) = 0;
  *(int *)(param_1 + 0x38c) = (int)param_1[0x30];
  if (lVar6 == 0) {
LAB_14021ed41:
    if (param_3 == (short *)0x0) {
      lVar6 = param_1[0x35f];
      lVar9 = param_1[0x360];
      if (lVar6 == lVar9) goto LAB_14021ed29;
      iVar3 = rand();
      lVar6 = (longlong)(iVar3 % (int)((lVar9 - lVar6) / 0x28));
      plVar11 = (longlong *)(param_1[0x35f] + lVar6 * 0x28);
      if (7 < *(ulonglong *)(param_1[0x35f] + 0x18 + lVar6 * 0x28)) {
        plVar11 = (longlong *)*plVar11;
      }
      lVar6 = param_1[0x27b];
      uVar15 = (undefined4)param_1[0x381];
      lVar9 = -1;
      psVar5 = (short *)plVar11;
      do {
        if (lVar9 == 0) break;
        lVar9 = lVar9 + -1;
        sVar1 = *psVar5;
        psVar5 = psVar5 + 1;
      } while (sVar1 != 0);
      if (lVar9 != -2) {
        uVar8 = 0xffffffffffffffff;
        psVar5 = (short *)plVar11;
        do {
          if (uVar8 == 0) break;
          uVar8 = uVar8 - 1;
          sVar1 = *psVar5;
          psVar5 = psVar5 + 1;
        } while (sVar1 != 0);
        iVar3 = FUN_140123e30(lVar6 + 0x40,*(undefined8 *)(lVar6 + 0x50),plVar11,~uVar8 - 1);
        if (iVar3 != 0) {
          uVar8 = 0xffffffffffffffff;
          psVar5 = (short *)plVar11;
          do {
            if (uVar8 == 0) break;
            uVar8 = uVar8 - 1;
            sVar1 = *psVar5;
            psVar5 = psVar5 + 1;
          } while (sVar1 != 0);
          FUN_140001710(lVar6 + 0x40,plVar11,~uVar8 - 1);
          if (*(longlong *)(lVar6 + 0x10) != 0) {
            lVar9 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
            if (lVar9 == 0) {
              iVar2 = 0;
            }
            else {
              iVar2 = FUN_1402ce620(lVar9,plVar11);
              iVar2 = iVar2 + 1;
            }
            goto LAB_14021eed5;
          }
        }
      }
    }
    else {
      lVar6 = param_1[0x27b];
      uVar15 = (undefined4)param_1[0x381];
      lVar9 = -1;
      psVar5 = param_3;
      do {
        if (lVar9 == 0) break;
        lVar9 = lVar9 + -1;
        sVar1 = *psVar5;
        psVar5 = psVar5 + 1;
      } while (sVar1 != 0);
      if (lVar9 != -2) {
        uVar8 = 0xffffffffffffffff;
        psVar5 = param_3;
        do {
          if (uVar8 == 0) break;
          uVar8 = uVar8 - 1;
          sVar1 = *psVar5;
          psVar5 = psVar5 + 1;
        } while (sVar1 != 0);
        iVar3 = FUN_140123e30(lVar6 + 0x40,*(undefined8 *)(lVar6 + 0x50),param_3,~uVar8 - 1);
        if (iVar3 != 0) {
          uVar8 = 0xffffffffffffffff;
          psVar5 = param_3;
          do {
            if (uVar8 == 0) break;
            uVar8 = uVar8 - 1;
            sVar1 = *psVar5;
            psVar5 = psVar5 + 1;
          } while (sVar1 != 0);
          FUN_140001710(lVar6 + 0x40,param_3,~uVar8 - 1);
          if (*(longlong *)(lVar6 + 0x10) != 0) {
            lVar9 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
            if (lVar9 != 0) {
              iVar2 = FUN_1402ce620(lVar9,param_3);
              iVar2 = iVar2 + 1;
            }
LAB_14021eed5:
            FUN_1402c5c00(lVar6,iVar2,uVar15,1);
          }
        }
      }
    }
    if (param_1[0x16f] == 0) {
      uVar15 = 0x3f800000;
    }
    else {
      uVar15 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar15);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar6 + 0x54) == 1) {
      *(longlong *)(lVar6 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar6);
    }
    *(undefined4 *)(lVar6 + 0x54) = 0;
    fVar14 = (float)FUN_1402c5ee0(param_1[0x27b]);
    *(undefined4 *)((longlong)param_1 + 300) = 2;
    param_1[0x28b] = 0x4049000000000000;
    *(undefined1 *)(param_1 + 0x30f) = 0;
    *(undefined4 *)(param_1 + 0xb7) = 0;
    param_1[0x28a] = (longlong)(double)fVar14;
    *(undefined1 *)((longlong)param_1 + 0x1824) = 1;
  }
  else {
    uVar4 = FUN_14022efc0(param_1);
    psVar5 = (short *)FUN_14032e9f0(lVar6,uVar4);
    if (psVar5 == (short *)0x0) goto LAB_14021ed41;
    lVar6 = 1;
    bVar13 = false;
    psVar10 = psVar5;
    psVar12 = &DAT_140477960;
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar13 = *psVar10 == *psVar12;
      psVar10 = psVar10 + 1;
      psVar12 = psVar12 + 1;
    } while (bVar13);
    if (bVar13) goto LAB_14021ed41;
    lVar6 = param_1[0x27b];
    lVar9 = param_1[0x381];
    lVar7 = -1;
    psVar10 = psVar5;
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      sVar1 = *psVar10;
      psVar10 = psVar10 + 1;
    } while (sVar1 != 0);
    if (lVar7 != -2) {
      uVar8 = 0xffffffffffffffff;
      psVar10 = psVar5;
      do {
        if (uVar8 == 0) break;
        uVar8 = uVar8 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      iVar2 = FUN_140123e30(lVar6 + 0x40,*(undefined8 *)(lVar6 + 0x50),psVar5,~uVar8 - 1);
      if (iVar2 != 0) {
        uVar8 = 0xffffffffffffffff;
        psVar10 = psVar5;
        do {
          if (uVar8 == 0) break;
          uVar8 = uVar8 - 1;
          sVar1 = *psVar10;
          psVar10 = psVar10 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar6 + 0x40,psVar5,~uVar8 - 1);
        if (*(longlong *)(lVar6 + 0x10) != 0) {
          lVar7 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
          if (lVar7 != 0) {
            iVar3 = FUN_1402ce620(lVar7,psVar5);
            iVar3 = iVar3 + 1;
          }
          FUN_1402c5c00(lVar6,iVar3,(int)lVar9,1);
        }
      }
    }
    if (param_1[0x16f] == 0) {
      uVar15 = 0x3f800000;
    }
    else {
      uVar15 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar15);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar6 + 0x54) == 1) {
      *(longlong *)(lVar6 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar6);
    }
    *(undefined4 *)(lVar6 + 0x54) = 0;
    fVar14 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0;
    param_1[0x28a] = (longlong)(double)fVar14;
LAB_14021ed29:
    (**(code **)(*param_1 + 200))(param_1,0x1e);
  }
  return;
}



undefined8 FUN_14021efc0(longlong *param_1,int param_2,char param_3)

{
  short sVar1;
  byte bVar2;
  byte bVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  int iVar8;
  undefined8 *puVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  longlong lVar12;
  longlong *plVar13;
  longlong lVar14;
  uint uVar15;
  ulonglong uVar16;
  ulonglong uVar17;
  longlong lVar18;
  uint uVar19;
  wchar_t *pwVar20;
  longlong *plVar21;
  longlong *plVar22;
  short *psVar23;
  wchar_t *pwVar24;
  short *psVar25;
  bool bVar26;
  float fVar27;
  float fVar28;
  float fVar29;
  undefined1 auVar30 [16];
  undefined1 auVar31 [16];
  undefined1 auVar32 [16];
  undefined1 auVar33 [16];
  undefined1 auVar34 [16];
  undefined1 auVar35 [16];
  float local_res10 [2];
  uint in_stack_fffffffffffffee8;
  uint3 uVar36;
  float local_f8;
  float fStack_f4;
  float local_f0;
  undefined4 uStack_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  undefined2 local_d8;
  undefined6 uStack_d6;
  undefined8 local_c8;
  ulonglong local_c0;
  undefined2 local_b0;
  undefined6 uStack_ae;
  undefined8 local_a0;
  ulonglong local_98;
  undefined8 local_88;
  undefined1 local_78 [80];
  
  local_88 = 0xfffffffffffffffe;
  if ((param_2 == 2) && (*(int *)((longlong)param_1 + 300) != 0xf)) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 1;
  }
  iVar8 = *(int *)((longlong)param_1 + 300);
  if (iVar8 == 0x25) {
    return 1;
  }
  if ((param_3 == '\0') &&
     (cVar4 = (**(code **)(*(longlong *)param_1[(longlong)iVar8 + 0x34] + 8))
                        ((longlong *)param_1[(longlong)iVar8 + 0x34],param_2), cVar4 == '\0')) {
    return 0;
  }
  *(int *)((longlong)param_1 + 300) = param_2;
  lVar14 = param_1[0x27b];
  if (lVar14 == 0) {
    return 0;
  }
  if (param_1[0x26] == 0) {
    return 0;
  }
  plVar13 = (longlong *)0x0;
  iVar5 = 0;
  *(undefined4 *)(param_1 + 0x3d6) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1eb4) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1cac) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1a2c) = 100000;
  *(undefined2 *)(param_1 + 0xc0) = 0;
  *(undefined1 *)(param_1 + 0x346) = 0;
  *(undefined2 *)((longlong)param_1 + 0x18dc) = 0;
  *(int *)((longlong)param_1 + 300) = param_2;
  uVar19 = 0;
  uVar36 = (uint3)(in_stack_fffffffffffffee8 >> 8);
  switch(param_2) {
  case 0:
    (**(code **)(*param_1 + 0x510))(param_1,0);
    break;
  case 1:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined2 *)((longlong)param_1 + 0x18dc) = 0x101;
    plVar13 = param_1 + 0x294;
    if (7 < (ulonglong)param_1[0x297]) {
      plVar13 = (longlong *)*plVar13;
    }
    lVar14 = param_1[0x27b];
    lVar12 = -1;
    psVar23 = (short *)plVar13;
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      sVar1 = *psVar23;
      psVar23 = psVar23 + 1;
    } while (sVar1 != 0);
    if (lVar12 != -2) {
      uVar16 = 0xffffffffffffffff;
      psVar23 = (short *)plVar13;
      do {
        if (uVar16 == 0) break;
        uVar16 = uVar16 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      iVar8 = FUN_140123e30(lVar14 + 0x40,*(undefined8 *)(lVar14 + 0x50),plVar13,~uVar16 - 1);
      if (iVar8 != 0) {
        uVar16 = 0xffffffffffffffff;
        psVar23 = (short *)plVar13;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          sVar1 = *psVar23;
          psVar23 = psVar23 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar14 + 0x40,plVar13,~uVar16 - 1);
        if (*(longlong *)(lVar14 + 0x10) != 0) {
          lVar12 = *(longlong *)(*(longlong *)(lVar14 + 0x10) + 0xd8);
          if (lVar12 != 0) {
            iVar5 = FUN_1402ce620(lVar12,plVar13);
            iVar5 = iVar5 + 1;
          }
          FUN_1402c5c00(lVar14,iVar5,0,1);
        }
      }
    }
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar14 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar14 + 0x54) == 1) {
      *(longlong *)(lVar14 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar14);
    }
    *(undefined4 *)(lVar14 + 0x54) = 0;
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    break;
  case 2:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    goto LAB_14021f21a;
  case 3:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x363;
    plVar21 = plVar13;
    if (7 < (ulonglong)param_1[0x366]) {
      plVar21 = (longlong *)*plVar13;
    }
    lVar14 = param_1[0x27b];
    lVar12 = -1;
    plVar22 = plVar21;
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      lVar18 = *plVar22;
      plVar22 = (longlong *)((longlong)plVar22 + 2);
    } while ((short)lVar18 != 0);
    if (lVar12 != -2) {
      uVar16 = 0xffffffffffffffff;
      plVar22 = plVar21;
      do {
        if (uVar16 == 0) break;
        uVar16 = uVar16 - 1;
        lVar12 = *plVar22;
        plVar22 = (longlong *)((longlong)plVar22 + 2);
      } while ((short)lVar12 != 0);
      iVar8 = FUN_140123e30(lVar14 + 0x40,*(undefined8 *)(lVar14 + 0x50),plVar21,~uVar16 - 1);
      if (iVar8 != 0) {
        uVar16 = 0xffffffffffffffff;
        plVar22 = plVar21;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          lVar12 = *plVar22;
          plVar22 = (longlong *)((longlong)plVar22 + 2);
        } while ((short)lVar12 != 0);
        FUN_140001710(lVar14 + 0x40,plVar21,~uVar16 - 1);
        if (*(longlong *)(lVar14 + 0x10) != 0) {
          lVar12 = *(longlong *)(*(longlong *)(lVar14 + 0x10) + 0xd8);
          if (lVar12 != 0) {
            iVar8 = FUN_1402ce620(lVar12,plVar21);
            uVar19 = iVar8 + 1;
          }
          FUN_1402c5c00(lVar14,uVar19,0,1);
        }
      }
    }
    if (7 < (ulonglong)param_1[0x366]) {
      plVar13 = (longlong *)*plVar13;
    }
    fVar28 = (float)FUN_14022ee30(param_1,plVar13);
    auVar30._0_8_ = (double)fVar28;
    auVar30._8_8_ = (double)fVar28;
    param_1[0x28a] = (longlong)auVar30._0_8_;
    auVar31._4_12_ = auVar30._4_12_;
    auVar31._0_4_ = fVar28;
    FUN_1402c5d90(param_1[0x27b],auVar31._0_8_);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    lVar14 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar14 + 0x54) == 1) {
      *(longlong *)(lVar14 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar14);
    }
LAB_14021f368:
    *(undefined4 *)(lVar14 + 0x54) = 0;
    goto LAB_14021f36c;
  case 4:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x363;
    plVar21 = plVar13;
    if (7 < (ulonglong)param_1[0x366]) {
      plVar21 = (longlong *)*plVar13;
    }
    lVar14 = param_1[0x27b];
    lVar12 = -1;
    plVar22 = plVar21;
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      lVar18 = *plVar22;
      plVar22 = (longlong *)((longlong)plVar22 + 2);
    } while ((short)lVar18 != 0);
    if (lVar12 != -2) {
      uVar16 = 0xffffffffffffffff;
      plVar22 = plVar21;
      do {
        if (uVar16 == 0) break;
        uVar16 = uVar16 - 1;
        lVar12 = *plVar22;
        plVar22 = (longlong *)((longlong)plVar22 + 2);
      } while ((short)lVar12 != 0);
      iVar8 = FUN_140123e30(lVar14 + 0x40,*(undefined8 *)(lVar14 + 0x50),plVar21,~uVar16 - 1);
      if (iVar8 != 0) {
        uVar16 = 0xffffffffffffffff;
        plVar22 = plVar21;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          lVar12 = *plVar22;
          plVar22 = (longlong *)((longlong)plVar22 + 2);
        } while ((short)lVar12 != 0);
        FUN_140001710(lVar14 + 0x40,plVar21,~uVar16 - 1);
        if (*(longlong *)(lVar14 + 0x10) != 0) {
          lVar12 = *(longlong *)(*(longlong *)(lVar14 + 0x10) + 0xd8);
          if (lVar12 != 0) {
            iVar8 = FUN_1402ce620(lVar12,plVar21);
            uVar19 = iVar8 + 1;
          }
          FUN_1402c5c00(lVar14,uVar19,0,1);
        }
      }
    }
    if (7 < (ulonglong)param_1[0x366]) {
      plVar13 = (longlong *)*plVar13;
    }
    fVar28 = (float)FUN_14022ee30(param_1,plVar13);
    auVar32._0_8_ = (double)fVar28;
    auVar32._8_8_ = (double)fVar28;
    param_1[0x28a] = (longlong)auVar32._0_8_;
    auVar33._4_12_ = auVar32._4_12_;
    auVar33._0_4_ = fVar28;
    FUN_1402c5d90(param_1[0x27b],auVar33._0_8_);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    lVar14 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar14 + 0x54) != 1) goto LAB_14021f368;
    *(longlong *)(lVar14 + 0x10) = param_1[0xa2];
    FUN_1402cc2c0(lVar14);
    *(undefined4 *)(lVar14 + 0x54) = 0;
    param_1[0x28b] = 0x4044000000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    goto LAB_14021f221;
  case 5:
    lVar14 = (**(code **)(*param_1 + 0x430))
                       (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    if (lVar14 == 0) {
LAB_14021fad0:
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return 0;
    }
    *(undefined4 *)(param_1 + 0x40f) = *(undefined4 *)(lVar14 + 0x178);
    *(undefined4 *)((longlong)param_1 + 0x207c) = *(undefined4 *)(lVar14 + 0x17c);
    *(undefined4 *)(param_1 + 0x410) = *(undefined4 *)(lVar14 + 0x180);
    *(undefined4 *)(param_1[0x27b] + 0x140) = 0;
    lVar14 = param_1[0x27b];
    uVar16 = *(ulonglong *)(lVar14 + 0x50);
    if (*(ulonglong *)(lVar14 + 0x58) < 8) {
      pwVar20 = (wchar_t *)(lVar14 + 0x40);
    }
    else {
      pwVar20 = *(wchar_t **)(lVar14 + 0x40);
    }
    uVar17 = 9;
    if (uVar16 < 9) {
      uVar17 = uVar16;
    }
    pwVar24 = L"lsidewalk";
    for (; uVar15 = uVar19, uVar17 != 0; uVar17 = uVar17 - 1) {
      if (*pwVar20 != *pwVar24) {
        uVar15 = 1;
        if ((ushort)*pwVar20 < (ushort)*pwVar24) {
          uVar15 = 0xffffffff;
        }
        break;
      }
      pwVar20 = pwVar20 + 1;
      pwVar24 = pwVar24 + 1;
    }
    if (uVar15 == 0) {
      if (8 < uVar16) {
        uVar15 = (uint)(uVar16 != 9);
        goto LAB_14021f6ce;
      }
LAB_14021f6d2:
      FUN_140001710(lVar14 + 0x40,L"lsidewalk",9);
      if (*(longlong *)(lVar14 + 0x10) != 0) {
        lVar12 = *(longlong *)(*(longlong *)(lVar14 + 0x10) + 0xd8);
        if (lVar12 != 0) {
          iVar8 = FUN_1402ce620(lVar12,L"lsidewalk");
          uVar19 = iVar8 + 1;
        }
        FUN_1402c5c00(lVar14,uVar19,0,1);
      }
    }
    else {
LAB_14021f6ce:
      if (uVar15 != 0) goto LAB_14021f6d2;
    }
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    lVar14 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar14 + 0x54) == 1) {
      *(longlong *)(lVar14 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar14);
    }
    *(undefined4 *)(lVar14 + 0x54) = 0;
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)((double)fVar28 * 1.5);
    param_1[0x28b] = 0x4056800000000000;
    param_1[0x28c] = param_1[0xa2];
    *(int *)(param_1 + 0x40c) = (int)param_1[0x2f];
    *(undefined4 *)((longlong)param_1 + 0x2064) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)(param_1 + 0x40d) = (int)param_1[0x30];
    iVar8 = rand();
    fVar28 = (((float)iVar8 / 32767.0) * 60.0 + 35.0) * 3.1415927;
    goto LAB_14021f81e;
  case 6:
    lVar14 = (**(code **)(*param_1 + 0x430))
                       (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    if (lVar14 == 0) goto LAB_14021fad0;
    *(undefined4 *)(param_1 + 0x40f) = *(undefined4 *)(lVar14 + 0x178);
    *(undefined4 *)((longlong)param_1 + 0x207c) = *(undefined4 *)(lVar14 + 0x17c);
    *(undefined4 *)(param_1 + 0x410) = *(undefined4 *)(lVar14 + 0x180);
    *(undefined4 *)(param_1[0x27b] + 0x140) = 0;
    lVar14 = param_1[0x27b];
    uVar16 = *(ulonglong *)(lVar14 + 0x50);
    if (*(ulonglong *)(lVar14 + 0x58) < 8) {
      pwVar20 = (wchar_t *)(lVar14 + 0x40);
    }
    else {
      pwVar20 = *(wchar_t **)(lVar14 + 0x40);
    }
    uVar17 = 9;
    if (uVar16 < 9) {
      uVar17 = uVar16;
    }
    pwVar24 = L"rsidewalk";
    for (; uVar15 = uVar19, uVar17 != 0; uVar17 = uVar17 - 1) {
      if (*pwVar20 != *pwVar24) {
        uVar15 = 1;
        if ((ushort)*pwVar20 < (ushort)*pwVar24) {
          uVar15 = 0xffffffff;
        }
        break;
      }
      pwVar20 = pwVar20 + 1;
      pwVar24 = pwVar24 + 1;
    }
    if (uVar15 == 0) {
      if (8 < uVar16) {
        uVar15 = (uint)(uVar16 != 9);
        goto LAB_14021fbb1;
      }
LAB_14021fbb5:
      FUN_140001710(lVar14 + 0x40,L"rsidewalk",9);
      if (*(longlong *)(lVar14 + 0x10) != 0) {
        lVar12 = *(longlong *)(*(longlong *)(lVar14 + 0x10) + 0xd8);
        if (lVar12 != 0) {
          iVar8 = FUN_1402ce620(lVar12,L"rsidewalk");
          uVar19 = iVar8 + 1;
        }
        FUN_1402c5c00(lVar14,uVar19,0,1);
      }
    }
    else {
LAB_14021fbb1:
      if (uVar15 != 0) goto LAB_14021fbb5;
    }
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    lVar14 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar14 + 0x54) == 1) {
      *(longlong *)(lVar14 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar14);
    }
    *(undefined4 *)(lVar14 + 0x54) = 0;
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)((double)fVar28 * 1.5);
    param_1[0x28b] = 0x4056800000000000;
    param_1[0x28c] = param_1[0xa2];
    *(int *)(param_1 + 0x40c) = (int)param_1[0x2f];
    *(undefined4 *)((longlong)param_1 + 0x2064) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)(param_1 + 0x40d) = (int)param_1[0x30];
    iVar8 = rand();
    fVar28 = (((float)iVar8 / 32767.0) * 60.0 + 35.0) * -3.1415927;
LAB_14021f81e:
    local_e8 = *(float *)(param_1 + 0x40c) - *(float *)(param_1 + 0x40f);
    local_e0 = *(float *)(param_1 + 0x40d) - *(float *)(param_1 + 0x410);
    local_e4 = *(float *)((longlong)param_1 + 0x2064) - *(float *)((longlong)param_1 + 0x207c);
    D3DXMatrixRotationY(local_78,fVar28 / 180.0);
    D3DXVec3TransformNormal(&local_e8,&local_e8,local_78);
    *(float *)((longlong)param_1 + 0x206c) = local_e8 + *(float *)(param_1 + 0x40f);
    *(float *)((longlong)param_1 + 0x2074) = local_e0 + *(float *)(param_1 + 0x410);
    fVar28 = *(float *)((longlong)param_1 + 0x17c);
    *(float *)((longlong)param_1 + 0x2064) = fVar28;
    *(float *)(param_1 + 0x40e) = fVar28;
    *(float *)((longlong)param_1 + 0x207c) = fVar28;
    fVar27 = *(float *)(param_1 + 0x40c) - *(float *)((longlong)param_1 + 0x206c);
    fVar29 = *(float *)(param_1 + 0x40d) - *(float *)((longlong)param_1 + 0x2074);
    fVar29 = fVar27 * fVar27 + (fVar28 - fVar28) * (fVar28 - fVar28) + fVar29 * fVar29;
    local_res10[0] = (float)(0x5f3759df - ((int)fVar29 >> 1));
    fVar28 = local_res10[0] * (1.5 - local_res10[0] * local_res10[0] * fVar29 * 0.5);
    param_1[0x411] = param_1[0xa2];
    param_1[0x412] =
         (longlong)
         ((double)((1.5 - fVar28 * fVar28 * fVar29 * 0.5) * fVar28 * fVar29) /
          (double)param_1[0x28a] + (double)param_1[0xa2]);
    local_f8 = *(float *)((longlong)param_1 + 0x206c) - *(float *)(param_1 + 0x40f);
    fStack_f4 = *(float *)(param_1 + 0x40e) - *(float *)((longlong)param_1 + 0x207c);
    local_f0 = *(float *)((longlong)param_1 + 0x2074) - *(float *)(param_1 + 0x410);
    *(float *)((longlong)param_1 + 0x154) = local_f8;
    *(float *)(param_1 + 0x2b) = fStack_f4;
    *(float *)((longlong)param_1 + 0x15c) = local_f0;
    D3DXVec3Normalize((longlong)param_1 + 0x154,(longlong)param_1 + 0x154);
LAB_14021fa45:
    *(undefined1 *)(param_1 + 0x27f) = 1;
    goto LAB_14021fa4d;
  case 7:
    lVar14 = (**(code **)(*param_1 + 0x430))
                       (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    if (lVar14 == 0) goto LAB_14021fad0;
    *(undefined4 *)(param_1[0x27b] + 0x140) = 0;
    psVar23 = (short *)(param_1[0x26] + 0x610);
    if (7 < *(ulonglong *)(param_1[0x26] + 0x628)) {
      psVar23 = *(short **)psVar23;
    }
    lVar12 = param_1[0x27b];
    lVar18 = -1;
    psVar25 = psVar23;
    do {
      if (lVar18 == 0) break;
      lVar18 = lVar18 + -1;
      sVar1 = *psVar25;
      psVar25 = psVar25 + 1;
    } while (sVar1 != 0);
    if (lVar18 != -2) {
      uVar16 = 0xffffffffffffffff;
      psVar25 = psVar23;
      do {
        if (uVar16 == 0) break;
        uVar16 = uVar16 - 1;
        sVar1 = *psVar25;
        psVar25 = psVar25 + 1;
      } while (sVar1 != 0);
      iVar8 = FUN_140123e30(lVar12 + 0x40,*(undefined8 *)(lVar12 + 0x50),psVar23,~uVar16 - 1);
      if (iVar8 != 0) {
        uVar16 = 0xffffffffffffffff;
        psVar25 = psVar23;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          sVar1 = *psVar25;
          psVar25 = psVar25 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar12 + 0x40,psVar23,~uVar16 - 1);
        if (*(longlong *)(lVar12 + 0x10) != 0) {
          lVar18 = *(longlong *)(*(longlong *)(lVar12 + 0x10) + 0xd8);
          if (lVar18 != 0) {
            iVar8 = FUN_1402ce620(lVar18,psVar23);
            uVar19 = iVar8 + 1;
          }
          FUN_1402c5c00(lVar12,uVar19,0,1);
        }
      }
    }
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar12 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar12 + 0x54) == 1) {
      *(longlong *)(lVar12 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar12);
    }
    *(undefined4 *)(lVar12 + 0x54) = 0;
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0x4056800000000000;
    param_1[0x28c] = param_1[0xa2];
    *(undefined1 *)(param_1 + 0x27f) = 1;
    local_f8 = *(float *)(param_1 + 0x2f) - *(float *)(lVar14 + 0x178);
    fStack_f4 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar14 + 0x17c);
    local_f0 = *(float *)(param_1 + 0x30) - *(float *)(lVar14 + 0x180);
    *(float *)((longlong)param_1 + 0x154) = local_f8;
    *(float *)(param_1 + 0x2b) = fStack_f4;
    *(float *)((longlong)param_1 + 0x15c) = local_f0;
    D3DXVec3Normalize((longlong)param_1 + 0x154,(longlong)param_1 + 0x154);
    goto LAB_14021fa4d;
  case 8:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)(param_1 + 0xb7) = 1;
    *(undefined1 *)(param_1 + 0xc0) = 1;
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 0;
    plVar13 = param_1 + 0x368;
    if (7 < (ulonglong)param_1[0x36b]) {
      plVar13 = (longlong *)*plVar13;
    }
    lVar14 = param_1[0x27b];
    lVar12 = -1;
    psVar23 = (short *)plVar13;
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      sVar1 = *psVar23;
      psVar23 = psVar23 + 1;
    } while (sVar1 != 0);
    if (lVar12 != -2) {
      uVar16 = 0xffffffffffffffff;
      psVar23 = (short *)plVar13;
      do {
        if (uVar16 == 0) break;
        uVar16 = uVar16 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      iVar8 = FUN_140123e30(lVar14 + 0x40,*(undefined8 *)(lVar14 + 0x50),plVar13,~uVar16 - 1);
      if (iVar8 != 0) {
        uVar16 = 0xffffffffffffffff;
        psVar23 = (short *)plVar13;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          sVar1 = *psVar23;
          psVar23 = psVar23 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar14 + 0x40,plVar13,~uVar16 - 1);
        if (*(longlong *)(lVar14 + 0x10) != 0) {
          lVar12 = *(longlong *)(*(longlong *)(lVar14 + 0x10) + 0xd8);
          if (lVar12 != 0) {
            iVar8 = FUN_1402ce620(lVar12,plVar13);
            uVar19 = iVar8 + 1;
          }
          FUN_1402c5c00(lVar14,uVar19,0,1);
        }
      }
    }
    param_1[0x28a] = 0x407f400000000000;
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar14 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar14 + 0x54) == 1) {
      *(longlong *)(lVar14 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar14);
    }
    *(undefined4 *)(lVar14 + 0x54) = 0;
    goto LAB_140220053;
  case 9:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)(param_1 + 0xb7) = 2;
    *(undefined1 *)(param_1 + 0xc0) = 1;
    *(undefined4 *)(param_1 + 0x280) = 0;
    plVar13 = param_1 + 0x36d;
    if (7 < (ulonglong)param_1[0x370]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,in_stack_fffffffffffffee8 & 0xffffff00);
    param_1[0x28a] = 0x407f400000000000;
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
LAB_140220053:
    param_1[0x28b] = 0x4056800000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x351) = 0x42340000;
    break;
  case 10:
  case 0xe:
  case 0x4e:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    goto LAB_1402203a7;
  case 0xb:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_140314a60(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    param_1[0x28a] = (longlong)(double)*(float *)(param_1 + 0x40a);
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(int *)((longlong)param_1 + 0x2044) = (int)param_1[0x2f];
    *(undefined4 *)(param_1 + 0x409) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)((longlong)param_1 + 0x204c) = (int)param_1[0x30];
    lVar14 = (**(code **)(*param_1 + 0x430))
                       (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    if (lVar14 == 0) {
      fVar28 = *(float *)(param_1 + 0x40a);
      fVar27 = fVar28 * *(float *)((longlong)param_1 + 0x154) +
               *(float *)((longlong)param_1 + 0x2044);
      fVar29 = fVar28 * *(float *)(param_1 + 0x2b) + *(float *)(param_1 + 0x409);
      fVar28 = fVar28 * *(float *)((longlong)param_1 + 0x15c) +
               *(float *)((longlong)param_1 + 0x204c);
    }
    else {
      local_e8 = *(float *)((longlong)param_1 + 0x2044) - *(float *)(lVar14 + 0x178);
      local_e4 = *(float *)(param_1 + 0x409) - *(float *)(lVar14 + 0x17c);
      local_e0 = *(float *)((longlong)param_1 + 0x204c) - *(float *)(lVar14 + 0x180);
      D3DXVec3Normalize(&local_e8,&local_e8);
      fVar28 = *(float *)(param_1 + 0x40b);
      if (fVar28 <= 0.0) {
        fVar28 = *(float *)(*(longlong *)(lVar14 + 0x130) + 0x2a8) + 100.0;
      }
      fVar27 = local_e8 * fVar28 + *(float *)(lVar14 + 0x178);
      fVar29 = local_e4 * fVar28 + *(float *)(lVar14 + 0x17c);
      fVar28 = local_e0 * fVar28 + *(float *)(lVar14 + 0x180);
    }
    *(float *)(param_1 + 0x407) = fVar27;
    *(float *)((longlong)param_1 + 0x203c) = fVar29;
    *(float *)(param_1 + 0x408) = fVar28;
    local_f8 = *(float *)((longlong)param_1 + 0x2044) - *(float *)(param_1 + 0x407);
    fStack_f4 = *(float *)(param_1 + 0x409) - *(float *)((longlong)param_1 + 0x203c);
    local_f0 = *(float *)((longlong)param_1 + 0x204c) - *(float *)(param_1 + 0x408);
    *(float *)((longlong)param_1 + 0x154) = local_f8;
    *(float *)(param_1 + 0x2b) = fStack_f4;
    *(float *)((longlong)param_1 + 0x15c) = local_f0;
    D3DXVec3Normalize((longlong)param_1 + 0x154,(longlong)param_1 + 0x154);
    goto LAB_14021fa4d;
  case 0xc:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_140314a60(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    param_1[0x28a] = (longlong)(double)*(float *)(param_1 + 0x40a);
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    *(undefined1 *)(param_1 + 0x27f) = 0;
    break;
  case 0xd:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x29e;
    if (7 < (ulonglong)param_1[0x2a1]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,CONCAT31(uVar36,1));
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5d60(param_1[0x27b],plVar13);
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0x4034000000000000;
    goto LAB_140220424;
  case 0xf:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0xc0) = 1;
    *(undefined4 *)((longlong)param_1 + 0x1404) = 0;
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],0,CONCAT31(uVar36,1));
    param_1[0x28a] = 0x4092c00000000000;
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    goto LAB_14021fa4d;
  case 0x10:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0xc0) = 1;
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_140314a60(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
    *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 0;
    break;
  case 0x12:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 0;
LAB_1402203a7:
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_140314a60(param_1,lVar14);
LAB_1402203e8:
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    lVar14 = param_1[0x27b];
LAB_140220418:
    fVar28 = (float)FUN_1402c5ee0(lVar14);
    param_1[0x28b] = 0;
LAB_140220424:
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28c] = param_1[0xa2];
    goto LAB_14021f21a;
  case 0x14:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,CONCAT31(uVar36,1));
    goto LAB_14022090f;
  case 0x15:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x299;
    plVar21 = plVar13;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar21 = (longlong *)*plVar13;
    }
    plVar22 = param_1 + 0x3ba;
    FUN_140216600(plVar22,plVar21);
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,1);
    if (7 < (ulonglong)param_1[0x3bd]) {
      plVar22 = (longlong *)*plVar22;
    }
    FUN_1402c5d60(param_1[0x27b],plVar22);
    goto LAB_14022090f;
  case 0x16:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x3ab;
    FUN_1400015e0(param_1 + 0x299,plVar13,0,0xffffffffffffffff);
    if (7 < (ulonglong)param_1[0x3ae]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,1);
    plVar13 = param_1 + 0x3b0;
    if (7 < (ulonglong)param_1[0x3b3]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5d60(param_1[0x27b],plVar13);
LAB_14022090f:
    lVar14 = param_1[0x27b];
    FUN_140314a60(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 0;
    break;
  case 0x17:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0x3bf) = 0;
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    uVar10 = 1;
    goto LAB_140220a4a;
  case 0x18:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x2da;
    if (7 < (ulonglong)param_1[0x2dd]) {
      plVar13 = (longlong *)*plVar13;
    }
    lVar14 = param_1[0x27b];
    lVar12 = -1;
    psVar23 = (short *)plVar13;
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      sVar1 = *psVar23;
      psVar23 = psVar23 + 1;
    } while (sVar1 != 0);
    if (lVar12 != -2) {
      uVar16 = 0xffffffffffffffff;
      psVar23 = (short *)plVar13;
      do {
        if (uVar16 == 0) break;
        uVar16 = uVar16 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      iVar8 = FUN_140123e30(lVar14 + 0x40,*(undefined8 *)(lVar14 + 0x50),plVar13,~uVar16 - 1);
      if (iVar8 != 0) {
        uVar16 = 0xffffffffffffffff;
        psVar23 = (short *)plVar13;
        do {
          if (uVar16 == 0) break;
          uVar16 = uVar16 - 1;
          sVar1 = *psVar23;
          psVar23 = psVar23 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar14 + 0x40,plVar13,~uVar16 - 1);
        if (*(longlong *)(lVar14 + 0x10) != 0) {
          lVar12 = *(longlong *)(*(longlong *)(lVar14 + 0x10) + 0xd8);
          if (lVar12 != 0) {
            iVar8 = FUN_1402ce620(lVar12,plVar13);
            uVar19 = iVar8 + 1;
          }
          FUN_1402c5c00(lVar14,uVar19,0,1);
        }
      }
    }
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    lVar14 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar14 + 0x54) == 1) {
      *(longlong *)(lVar14 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar14);
    }
    *(undefined4 *)(lVar14 + 0x54) = 0;
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    goto LAB_14021f36c;
  case 0x1c:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)((longlong)param_1 + 0x601) = 1;
    *(undefined4 *)(param_1 + 0x281) = 0;
    FUN_1402c5b20(param_1[0x27b],L"sky_damage01",0,0,CONCAT31(uVar36,1));
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    *(undefined1 *)(param_1 + 0x27f) = 0;
    goto LAB_14021fa4d;
  case 0x1d:
    plVar13 = param_1 + 0x2a8;
    goto LAB_140220aef;
  case 0x1f:
    if (param_1[0x183] == 0) break;
    *(undefined4 *)(lVar14 + 0x140) = 0;
    iVar8 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (((iVar8 == 4) || (iVar8 == 0x10)) || (iVar8 == 0x20)) {
      lVar14 = param_1[0x183];
      lVar12 = FUN_14032ef90(lVar14,(int)param_1[0x30b]);
      if (lVar12 != 0) {
        lVar12 = *(longlong *)(lVar14 + 0x38);
        if (*(longlong *)(lVar14 + 0x30) != lVar12) {
          lVar14 = *(longlong *)(lVar14 + 0x30);
          iVar8 = rand();
          uVar19 = iVar8 % (int)(lVar12 - lVar14 >> 4);
        }
        *(uint *)(param_1 + 0x30b) = uVar19;
      }
    }
    else {
      *(undefined4 *)(param_1 + 0x30b) = 1;
    }
    lVar14 = FUN_14032ef90(param_1[0x183],(int)param_1[0x30b]);
    if (lVar14 == 0) {
      *(undefined4 *)(param_1 + 0x30b) = 0;
    }
    plVar13 = (longlong *)(lVar14 + 8);
    if (7 < *(ulonglong *)(lVar14 + 0x20)) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,in_stack_fffffffffffffee8 & 0xffffff00);
    puVar9 = (undefined8 *)(lVar14 + 0x30);
    goto LAB_1402210ed;
  case 0x20:
    if (param_1[0x183] == 0) break;
    lVar12 = FUN_14032ef90(param_1[0x183],(int)param_1[0x30b]);
    if (lVar12 == 0) {
      *(undefined4 *)(param_1 + 0x30b) = 0;
    }
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)(param_1 + 0x282) = 0;
    param_1[0x30a] = param_1[0xa2];
    plVar13 = (longlong *)(lVar12 + 0x30);
    if (7 < *(ulonglong *)(lVar12 + 0x48)) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,in_stack_fffffffffffffee8 & 0xffffff00);
    puVar9 = (undefined8 *)(lVar12 + 0x58);
LAB_1402210ed:
    if (7 < (ulonglong)puVar9[3]) {
      puVar9 = (undefined8 *)*puVar9;
    }
    FUN_1402c5d60(param_1[0x27b],puVar9);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
LAB_1402207dc:
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    goto LAB_14021f21a;
  case 0x21:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)(param_1 + 0x282) = 0;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    break;
  case 0x22:
    if ((param_1[0x183] == 0) ||
       (lVar12 = FUN_14032ef90(param_1[0x183],(int)param_1[0x30b]), lVar12 == 0)) break;
    plVar13 = (longlong *)(lVar12 + 0x80);
    goto LAB_140220ec6;
  case 0x23:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0xc0) = 1;
    pwVar20 = L"sky_damage02";
    goto LAB_140220f18;
  case 0x24:
    if (param_1[0x26] != 0) {
      *(undefined4 *)(lVar14 + 0x140) = 0;
      *(undefined1 *)(param_1 + 0xc0) = 1;
      *(undefined4 *)(param_1 + 0x283) = 0;
      plVar13 = param_1 + 0x2ad;
      if (7 < (ulonglong)param_1[0x2b0]) {
        plVar13 = (longlong *)*plVar13;
      }
      FUN_1402c5b20(param_1[0x27b],plVar13,0,1,CONCAT31(uVar36,1));
      lVar14 = param_1[0x27b];
      FUN_1402f9550(param_1,lVar14);
      FUN_1402c5e50(lVar14);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
      fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
      param_1[0x28a] = (longlong)(double)fVar28;
      param_1[0x28b] = 0;
      *(undefined1 *)(param_1 + 0x27f) = 0;
      *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
      *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
      *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
      *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
      *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
      *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
      *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
      *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
      *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
      *(undefined4 *)(param_1 + 0x354) = *(undefined4 *)((longlong)param_1 + 0x17c);
      *(undefined4 *)(param_1 + 0x305) = 0;
      *(undefined1 *)(param_1 + 0x30f) = 0;
      local_f8 = *(float *)(param_1 + 0x2f);
      local_f0 = *(float *)(param_1 + 0x30);
      fStack_f4 = *(float *)((longlong)param_1 + 0x17c) + *(float *)(param_1[0x26] + 0x2d8) * 0.5;
      local_res10[0] = 100000.0;
      if (param_1[0x1b1] != 0) {
        FUN_1402f9f60(param_1,local_res10,&local_f8);
      }
    }
    break;
  case 0x25:
    (**(code **)(*param_1 + 0x510))(param_1,0);
    *(undefined4 *)(param_1[0x27b] + 0x140) = 0;
    FUN_1402357f0(param_1);
    (**(code **)(*param_1 + 0xa00))(param_1);
    iVar5 = (**(code **)(*param_1 + 0xb0))(param_1);
    if ((iVar5 == 4) && (plVar13 = (longlong *)FUN_140218af0(param_1), plVar13 != (longlong *)0x0))
    {
      (**(code **)(*plVar13 + 0xa48))(plVar13);
      (**(code **)(*plVar13 + 0xa30))(plVar13);
    }
    iVar5 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (iVar5 == 4) {
      *(undefined4 *)(param_1 + 0x30b) = 0;
    }
    else {
      *(undefined4 *)(param_1 + 0x30b) = 1;
    }
    cVar4 = (**(code **)(*param_1 + 0xae0))(param_1);
    if (cVar4 != '\0') {
      *(undefined4 *)((longlong)param_1 + 0x141c) = 5;
      break;
    }
    if (iVar8 == 0x20) {
      if ((param_1[0x183] != 0) &&
         (lVar14 = FUN_14032ef90(param_1[0x183],(int)param_1[0x30b]), lVar14 != 0)) {
        plVar13 = (longlong *)(lVar14 + 0x30);
        if (7 < *(ulonglong *)(lVar14 + 0x48)) {
          plVar13 = (longlong *)*plVar13;
        }
        FUN_1402c5b20(param_1[0x27b],plVar13,0,1,in_stack_fffffffffffffee8 & 0xffffff00);
        *(undefined4 *)((longlong)param_1 + 0x141c) = 2;
      }
    }
    else if ((iVar8 == 0x3c) || (iVar8 == 0x3e)) {
      if (param_1[0x183] != 0) {
        if (plVar13 != (longlong *)0x0) {
          local_f8 = *(float *)(param_1 + 0x2f) - *(float *)(plVar13 + 0x2f);
          fStack_f4 = *(float *)((longlong)param_1 + 0x17c) - *(float *)((longlong)plVar13 + 0x17c);
          local_f0 = *(float *)(param_1 + 0x30) - *(float *)(plVar13 + 0x30);
          *(undefined1 *)(param_1 + 0x27f) = 1;
          (**(code **)(*param_1 + 0x100))(param_1,&local_f8);
        }
        goto LAB_1402213ca;
      }
    }
    else if ((param_1[0x26] != 0) && (param_1[0x183] != 0)) {
      iVar8 = (**(code **)(*param_1 + 0xb0))(param_1);
      if (iVar8 == 4) {
        lVar14 = FUN_14023c340(param_1[0x26],&local_d8);
        lVar14 = *(longlong *)(lVar14 + 0x10);
        if (7 < local_c0) {
          operator_delete((void *)CONCAT62(uStack_d6,local_d8));
        }
        local_c0 = 7;
        local_c8 = 0;
        local_d8 = 0;
        if (lVar14 != 0) {
          puVar9 = (undefined8 *)FUN_14023c340(param_1[0x26],&local_b0);
          if (7 < (ulonglong)puVar9[3]) {
            puVar9 = (undefined8 *)*puVar9;
          }
          FUN_1402c5b20(param_1[0x27b],puVar9,0,1,in_stack_fffffffffffffee8 & 0xffffff00);
          if (7 < local_98) {
            operator_delete((void *)CONCAT62(uStack_ae,local_b0));
          }
          local_98 = 7;
          local_a0 = 0;
          local_b0 = 0;
          *(undefined4 *)((longlong)param_1 + 0x141c) = 6;
          goto LAB_14022147e;
        }
      }
LAB_1402213ca:
      lVar14 = FUN_14032ef90(param_1[0x183],(int)param_1[0x30b]);
      if (lVar14 != 0) {
        plVar13 = (longlong *)(lVar14 + 8);
        if (7 < *(ulonglong *)(lVar14 + 0x20)) {
          plVar13 = (longlong *)*plVar13;
        }
        FUN_1402c5b20(param_1[0x27b],plVar13,0,1,in_stack_fffffffffffffee8 & 0xffffff00);
        plVar13 = (longlong *)(lVar14 + 0x30);
        if (7 < *(ulonglong *)(lVar14 + 0x48)) {
          plVar13 = (longlong *)*plVar13;
        }
        FUN_1402c5d60(param_1[0x27b],plVar13);
        *(undefined4 *)((longlong)param_1 + 0x141c) = 0;
      }
    }
LAB_14022147e:
    FUN_14021e980(param_1);
    uVar10 = FUN_1402f88a0(param_1);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(uVar10,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    goto LAB_14021fa4d;
  case 0x28:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x2b2;
    if (7 < (ulonglong)param_1[0x2b5]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x284) = 0;
    break;
  case 0x29:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x2b7;
    if (7 < (ulonglong)param_1[0x2ba]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x1424) = 0;
    break;
  case 0x2a:
    plVar13 = param_1 + 700;
LAB_140220ec6:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    if (7 < (ulonglong)plVar13[3]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,in_stack_fffffffffffffee8 & 0xffffff00);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    goto LAB_1402207dc;
  case 0x2b:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0xc0) = 1;
    *(undefined4 *)(param_1 + 0x285) = 0;
    plVar13 = param_1 + 0x2ad;
    if (7 < (ulonglong)param_1[0x2b0]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
    *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
    (**(code **)(*param_1 + 0x1f0))(param_1);
    *(undefined4 *)(param_1 + 0x354) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(undefined4 *)(param_1 + 0x305) = 0;
    *(undefined1 *)(param_1 + 0x30f) = 0;
    break;
  case 0x2c:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x2ee;
    if (7 < (ulonglong)param_1[0x2f1]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0x4034000000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x142c) = 0;
    break;
  case 0x2d:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    FUN_1402c5b20(param_1[0x27b],L"idle01",0,1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0x4034000000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x286) = 0;
    break;
  case 0x2e:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x2fd;
    if (7 < (ulonglong)param_1[0x300]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(char *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = (char)param_1[0x302];
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0x4034000000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x1434) = 0;
    break;
  case 0x2f:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    FUN_1402c5b20(param_1[0x27b],L"guard01",(int)param_1[0x381],0,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0x4034000000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    goto LAB_1402219a6;
  case 0x30:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    goto LAB_14022192c;
  case 0x31:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    param_1[0x3cb] = param_1[0xa2];
LAB_14022192c:
    FUN_1402c5b20(param_1[0x27b],L"guard01_stay01",(int)param_1[0x381],0,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
LAB_1402219a6:
    param_1[0x28a] = (longlong)(double)fVar28;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x287) = 0;
    break;
  case 0x32:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    param_1[0x28b] = 0x4034000000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x287) = 0;
    FUN_14023ab30(param_1 + 0xaf);
    param_1[0x166] = param_1[0xa2];
    break;
  case 0x33:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    param_1[0x28e] = param_1[0xa2];
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    *(undefined4 *)((longlong)param_1 + 0x143c) = 0;
    break;
  case 0x34:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    FUN_1402c5b20(param_1[0x27b],L"levelup01",0,1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0x4034000000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x288) = 0;
    FUN_140001710(param_1 + 0x299,L"levelup01",9);
    *(undefined4 *)(param_1 + 0x381) = 0;
    break;
  case 0x35:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    goto LAB_140221cc0;
  case 0x36:
    *(undefined4 *)(lVar14 + 0x140) = 0;
LAB_140221cc0:
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
LAB_140221cea:
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x1af) = 0;
    *(undefined4 *)((longlong)param_1 + 0x1a2c) = 1;
    break;
  case 0x37:
  case 0x38:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x1af) = 0;
    break;
  case 0x39:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
    *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
    goto LAB_140221cea;
  case 0x3a:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    FUN_1402c5b20(param_1[0x27b],L"catch02_move",0,1,(uint)uVar36 << 8);
    fVar28 = (float)FUN_14022ee30(param_1,L"catch02_move");
    auVar34._0_8_ = (double)fVar28;
    auVar34._8_8_ = (double)fVar28;
    param_1[0x28a] = (longlong)auVar34._0_8_;
    auVar35._4_12_ = auVar34._4_12_;
    auVar35._0_4_ = fVar28;
    FUN_1402c5d90(param_1[0x27b],auVar35._0_8_);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
LAB_14021f36c:
    lVar14 = 0x4044000000000000;
LAB_14021f376:
    param_1[0x28b] = lVar14;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    goto LAB_14021f221;
  case 0x3b:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    (**(code **)(*param_1 + 0xa58))(param_1);
    plVar13 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,1);
    lVar14 = param_1[0x27b];
    FUN_140314a60(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    *(undefined4 *)(param_1 + 0x1af) = 0;
    break;
  case 0x3c:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0x346) = 1;
    FUN_140001710(param_1 + 0x299,L"caught02",8);
    pwVar20 = L"caught02";
    goto LAB_140221f47;
  case 0x3d:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    pwVar20 = L"caught03";
LAB_140221f47:
    FUN_1402c5b20(param_1[0x27b],pwVar20,(int)param_1[0x381],1,1);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
    *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x1444) = 0;
    break;
  case 0x3f:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x28f;
    if (7 < (ulonglong)param_1[0x292]) {
      plVar13 = (longlong *)*plVar13;
    }
    uVar10 = 0;
LAB_140220a4a:
    uVar7 = (undefined4)param_1[0x381];
LAB_140220a51:
    FUN_1402c5b20(param_1[0x27b],plVar13,uVar7,uVar10,1);
    lVar14 = param_1[0x27b];
    goto LAB_1402203e8;
  case 0x42:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    lVar14 = (**(code **)(*param_1 + 0x420))(param_1);
    if (lVar14 == 0) break;
    FUN_140235250(param_1,lVar14);
    goto LAB_1402220bb;
  case 0x43:
    *(undefined4 *)(lVar14 + 0x140) = 0;
LAB_1402220bb:
    plVar13 = param_1 + 0x2e9;
    if (7 < (ulonglong)param_1[0x2ec]) {
      plVar13 = (longlong *)*plVar13;
    }
    uVar10 = 0;
    uVar7 = 0;
    goto LAB_140220a51;
  case 0x44:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    lVar14 = param_1[0x168];
    if (lVar14 == 0) break;
    bVar2 = *(byte *)(param_1 + 0xc0);
    bVar3 = *(byte *)((longlong)param_1 + 0x601);
    uVar7 = *(undefined4 *)((longlong)param_1 + 300);
    lVar12 = param_1[0xb5];
    lVar18 = param_1[0x1dd];
    uVar6 = FUN_14023c2c0(lVar14,(int)lVar18,(int)lVar12);
    uVar10 = FUN_14023c1c0(lVar14,(int)lVar18,(int)lVar12);
    uVar11 = FUN_14020d8c0(param_1 + 0x391);
    FUN_140278700(uVar11,&local_f8,uVar10,uVar6,uVar7,bVar2 | bVar3,(char)param_1[0x413]);
    plVar13 = (longlong *)CONCAT44(fStack_f4,local_f8);
    if (plVar13 == (longlong *)0x0) {
LAB_1402221f0:
      lVar12 = param_1[0xb5];
      lVar18 = param_1[0x1dd];
      lVar14 = param_1[0x168];
      uVar7 = FUN_14023c2c0(lVar14,(int)lVar18,(int)lVar12);
      plVar13 = (longlong *)FUN_14023c1c0(lVar14,(int)lVar18,(int)lVar12);
    }
    else {
      if (plVar13 != (longlong *)CONCAT44(uStack_ec,local_f0)) {
        iVar8 = DAT_140608154 + 1;
        bVar26 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar26) {
          FUN_140176d60(1);
        }
        goto LAB_1402221f0;
      }
      if (((*plVar13 == 0) || (*(int *)(*plVar13 + 0xdc) != 5)) ||
         (lVar14 = FUN_14023ad10(param_1 + 0x2f8), lVar14 == 0)) goto LAB_1402221f0;
      lVar14 = FUN_14023ad10(param_1 + 0x2f8);
      lVar14 = *(longlong *)(lVar14 + 0x68);
      lVar12 = FUN_14023ad10(param_1 + 0x2f8);
      plVar13 = *(longlong **)(lVar12 + 0x68);
      if (7 < (ulonglong)plVar13[3]) {
        plVar13 = (longlong *)*plVar13;
      }
      uVar7 = *(undefined4 *)(lVar14 + 0x28);
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,uVar7,0,1);
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    FUN_1401975d0(&local_f8);
    break;
  case 0x45:
    plVar13 = param_1 + 0x2c6;
    goto LAB_1402207a1;
  case 0x46:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)(param_1 + 0x289) = 0;
    plVar13 = param_1 + 0x2cb;
    goto LAB_1402207a8;
  case 0x47:
    plVar13 = param_1 + 0x299;
LAB_1402207a1:
    *(undefined4 *)(lVar14 + 0x140) = 0;
LAB_1402207a8:
    if (7 < (ulonglong)plVar13[3]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_140314a60(param_1,lVar14);
    goto LAB_1402207dc;
  case 0x48:
    FUN_1402c5b20(lVar14,L"sky_damage02",(int)param_1[0x381],1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x140c) = 0;
    break;
  case 0x49:
    plVar13 = param_1 + 0x2d0;
    if (7 < (ulonglong)param_1[0x2d3]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(lVar14,plVar13,(int)param_1[0x381],1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0x404e000000000000;
LAB_14021f21a:
    *(undefined1 *)(param_1 + 0x27f) = 0;
LAB_14021f221:
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    break;
  case 0x4a:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    goto LAB_140222487;
  case 0x4b:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)((longlong)param_1 + 0x144c) = 0;
    if ((ulonglong)param_1[0x2d8] < 8) {
      plVar13 = param_1 + 0x2d5;
    }
    else {
      plVar13 = (longlong *)param_1[0x2d5];
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_140314a60(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0;
    param_1[0x28c] = param_1[0xa2];
    *(undefined1 *)(param_1 + 0x27f) = 0;
    goto LAB_14022251f;
  case 0x4c:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined4 *)((longlong)param_1 + 0x144c) = 0;
LAB_140222487:
    if ((ulonglong)param_1[0x2d8] < 8) {
      plVar13 = param_1 + 0x2d5;
    }
    else {
      plVar13 = (longlong *)param_1[0x2d5];
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,(uint)uVar36 << 8);
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0x4052c00000000000;
    *(undefined1 *)(param_1 + 0x27f) = 1;
LAB_14022251f:
    param_1[0x28a] = (longlong)(double)fVar28;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    FUN_1400015e0(param_1 + 0x299,param_1 + 0x2d5,0,0xffffffffffffffff);
    break;
  case 0x4f:
    *(undefined1 *)(param_1 + 0xc0) = 1;
    *(undefined4 *)(param_1 + 0x283) = 0;
    *(undefined4 *)(lVar14 + 0x140) = 0;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    goto LAB_14021fa4d;
  case 0x50:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    lVar14 = param_1[0x360];
    if (param_1[0x35f] != lVar14) {
      lVar12 = param_1[0x35f];
      iVar8 = rand();
      plVar13 = (longlong *)
                (param_1[0x35f] + (longlong)(iVar8 % (int)((lVar14 - lVar12) / 0x28)) * 0x28);
      if (7 < (ulonglong)plVar13[3]) {
        plVar13 = (longlong *)*plVar13;
      }
      FUN_1402c5b20(param_1[0x27b],plVar13,(int)param_1[0x381],1,
                    in_stack_fffffffffffffee8 & 0xffffff00);
    }
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    lVar14 = 0x4052c00000000000;
    goto LAB_14021f376;
  case 0x55:
  case 0x56:
    goto LAB_140220418;
  case 0x57:
  case 0x58:
  case 0x59:
    *(undefined4 *)(*(longlong *)(lVar14 + 0x20) + 0x54) = 2;
    param_1[0x28a] = 0;
    break;
  case 0x60:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0xc0) = 0;
    plVar13 = param_1 + 0x2df;
    if (7 < (ulonglong)param_1[0x2e2]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    goto LAB_14021fa45;
  case 0x61:
    plVar13 = param_1 + 0x2df;
    goto LAB_140220aef;
  case 0x62:
    plVar13 = param_1 + 0x2e4;
LAB_140220aef:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0xc0) = 0;
    if (7 < (ulonglong)plVar13[3]) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar13,0,1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
LAB_14021fa4d:
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
    *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
    break;
  case 99:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    *(undefined1 *)(param_1 + 0xc0) = 1;
    pwVar20 = (wchar_t *)(param_1 + 0x37c);
    if (7 < (ulonglong)param_1[0x37f]) {
      pwVar20 = *(wchar_t **)pwVar20;
    }
LAB_140220f18:
    FUN_1402c5b20(param_1[0x27b],pwVar20,0,1,CONCAT31(uVar36,1));
    lVar14 = param_1[0x27b];
    FUN_1402f9550(param_1,lVar14);
    FUN_1402c5e50(lVar14);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    param_1[0x28b] = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
    *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
    *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
    *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
    *(undefined4 *)(param_1 + 0x283) = 0;
    break;
  case 100:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    lVar14 = param_1[0x16e];
    if (lVar14 == 0) {
      pwVar20 = L"polymorph01";
    }
    else {
      pwVar20 = (wchar_t *)(lVar14 + 0x18);
      if (7 < *(ulonglong *)(lVar14 + 0x30)) {
        pwVar20 = *(wchar_t **)pwVar20;
      }
    }
    goto LAB_140222848;
  case 0x65:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    lVar14 = param_1[0x16e];
    if (lVar14 == 0) {
      pwVar20 = L"polymorph_end01";
    }
    else {
      pwVar20 = (wchar_t *)(lVar14 + 0x40);
      if (7 < *(ulonglong *)(lVar14 + 0x58)) {
        pwVar20 = *(wchar_t **)pwVar20;
      }
    }
LAB_140222848:
    FUN_1402c5b20(param_1[0x27b],pwVar20,0,1,(uint)uVar36 << 8);
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
    fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28a] = (longlong)(double)fVar28;
    lVar14 = 0x4052c00000000000;
    goto LAB_14021f376;
  case 0x68:
    *(undefined4 *)(lVar14 + 0x140) = 0;
    plVar13 = param_1 + 0x414;
    plVar21 = plVar13;
    if (7 < (ulonglong)param_1[0x417]) {
      plVar21 = (longlong *)*plVar13;
    }
    FUN_1402c5b20(param_1[0x27b],plVar21,0,1,CONCAT31(uVar36,1));
    lVar14 = (**(code **)(*param_1 + 0x4a8))(param_1);
    if (lVar14 != 0) {
      FUN_1402c5e50(param_1[0x27b]);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
      FUN_1402c5f40(param_1[0x27b],param_1[0xa2]);
      fVar28 = (float)FUN_1402c5ee0(param_1[0x27b]);
      param_1[0x28a] = (longlong)(double)fVar28;
      param_1[0x28b] = 0x4024000000000000;
      *(undefined1 *)(param_1 + 0x27f) = 1;
      if (7 < (ulonglong)param_1[0x417]) {
        plVar13 = (longlong *)*plVar13;
      }
      FUN_1400014c0(param_1 + 0x299,plVar13);
    }
  }
  cVar4 = FUN_1402d7670(param_1,4);
  if ((cVar4 == '\0') && (cVar4 = (**(code **)(*param_1 + 0x438))(param_1), cVar4 != '\0')) {
    *(undefined1 *)(param_1 + 0x19a) = 0;
  }
  return 1;
}



undefined8 FUN_140222bc0(longlong *param_1,short *param_2,short *param_3,longlong param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x29e,param_2,~uVar2 - 1);
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_3;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x299,param_3,~uVar2 - 1);
  param_1[0x307] = param_4;
  *(undefined1 *)((longlong)param_1 + 0xcd1) = 0;
  *(undefined4 *)(param_1 + 0x3d6) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1eb4) = 0;
  (**(code **)(*param_1 + 200))(param_1,0xd);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x000140223297)

undefined1
FUN_140222c70(longlong *param_1,short *param_2,undefined4 param_3,undefined4 param_4,char param_5,
             longlong param_6,char param_7)

{
  longlong *plVar1;
  short sVar2;
  byte bVar3;
  byte bVar4;
  undefined4 uVar5;
  void *pvVar6;
  undefined1 uVar7;
  int iVar8;
  longlong lVar9;
  longlong lVar10;
  ulonglong uVar11;
  undefined7 uVar12;
  longlong *plVar13;
  undefined8 uVar14;
  short *psVar15;
  short *psVar16;
  bool bVar17;
  float fVar18;
  double dVar19;
  longlong *local_70;
  longlong *local_68;
  longlong local_60;
  char local_58;
  longlong local_50;
  undefined4 local_48;
  undefined4 uStack_44;
  
  iVar8 = (**(code **)(*param_1 + 0xb0))();
  if ((iVar8 == 4) && (param_6 == 0)) {
    if ((int)param_1[0x1fa] == 3) {
      return 0;
    }
    if ((int)param_1[0x1fa] == 1) {
      return 0;
    }
  }
  bVar17 = false;
  lVar10 = 1;
  psVar15 = param_2;
  psVar16 = &DAT_140477960;
  do {
    if (lVar10 == 0) break;
    lVar10 = lVar10 + -1;
    bVar17 = *psVar15 == *psVar16;
    psVar15 = psVar15 + 1;
    psVar16 = psVar16 + 1;
  } while (bVar17);
  if (bVar17) {
    return 0;
  }
  lVar10 = 0;
  local_60 = 0;
  local_58 = '\0';
  plVar13 = (longlong *)param_1[0x25d];
  if (plVar13 != (longlong *)0x0) {
    if (plVar13 == (longlong *)param_1[0x25e]) {
      if (*plVar13 != 0) {
        lVar9 = *plVar13;
        if ((plVar13 != (longlong *)param_1[0x25e]) &&
           (iVar8 = DAT_1406080a8 + 1, bVar17 = DAT_1406080a8 == 0, lVar9 = lVar10,
           DAT_1406080a8 = iVar8, bVar17)) {
          FUN_140176d60(1);
        }
        local_58 = 0;
        local_60 = lVar9;
        FUN_14034ed40();
        local_58 = '\x01';
      }
    }
    else {
      iVar8 = DAT_1406080a8 + 1;
      bVar17 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar8;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  bVar3 = *(byte *)((longlong)param_1 + 0x601);
  bVar4 = *(byte *)(param_1 + 0xc0);
  uVar5 = *(undefined4 *)((longlong)param_1 + 300);
  plVar13 = (longlong *)param_1[0x391];
  if (plVar13 != (longlong *)0x0) {
    if (plVar13 == (longlong *)param_1[0x392]) {
      lVar10 = *plVar13;
    }
    else {
      iVar8 = DAT_140608150 + 1;
      bVar17 = DAT_140608150 == 0;
      DAT_140608150 = iVar8;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140278700(lVar10,&local_70,param_2,param_3,uVar5,bVar3 | bVar4,(char)param_1[0x413]);
  if (local_70 == (longlong *)0x0) {
LAB_140223718:
    plVar13 = local_70;
    if (local_70 != (longlong *)0x0) {
      if (local_70 == local_68) {
        if (local_70 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_70 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_70 = (longlong *)0x0;
            pvVar6 = (void *)*plVar13;
            if (pvVar6 != (void *)0x0) {
              FUN_140197310(pvVar6);
              operator_delete(pvVar6);
            }
            operator_delete(plVar13);
          }
        }
      }
      else {
        iVar8 = DAT_1406080b4 + 1;
        bVar17 = DAT_1406080b4 == 0;
        DAT_1406080b4 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
LAB_140223772:
    if (local_58 != '\0') {
      FUN_14034edd0(local_60);
    }
    return 0;
  }
  if (local_70 != local_68) {
    iVar8 = DAT_140608154 + 1;
    bVar17 = DAT_140608154 == 0;
    DAT_140608154 = iVar8;
    if (bVar17) {
      FUN_140176d60(1);
    }
    goto LAB_140223718;
  }
  lVar10 = *local_70;
  if (lVar10 == 0) goto LAB_140223718;
  if ((param_5 != '\0') && (*(longlong *)(lVar10 + 0x48) != 0)) {
    dVar19 = 0.0;
    if ((*(uint *)(lVar10 + 0xb0) & 0x7f800000) != 0) {
      dVar19 = (double)*(float *)(lVar10 + 0xb0) + (double)param_1[0xa2];
    }
    plVar13 = (longlong *)(lVar10 + 0x38);
    if (7 < *(ulonglong *)(lVar10 + 0x50)) {
      plVar13 = (longlong *)*plVar13;
    }
    FUN_140222bc0(param_1,plVar13,param_2,dVar19);
    plVar13 = local_70;
    param_1[0x2fc] = param_6;
    *(undefined4 *)(param_1 + 0x381) = param_3;
    if (local_70 != (longlong *)0x0) {
      if (local_70 == local_68) {
        if (local_70 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_70 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_70 = (longlong *)0x0;
            pvVar6 = (void *)*plVar13;
            if (pvVar6 != (void *)0x0) {
              FUN_140197310(pvVar6);
              operator_delete(pvVar6);
            }
            operator_delete(plVar13);
          }
        }
      }
      else {
        iVar8 = DAT_1406080b4 + 1;
        bVar17 = DAT_1406080b4 == 0;
        DAT_1406080b4 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
    goto LAB_140222eea;
  }
  uVar7 = 1;
  *(char *)(param_1 + 0x38a) = param_7;
  switch(*(undefined4 *)((longlong)param_1 + 300)) {
  case 10:
  case 0xb:
  case 0xe:
  case 0xf:
  case 0x10:
  case 0x12:
  case 0x14:
  case 0x15:
  case 0x16:
  case 0x3b:
    if (param_1[0x2c3] == 0) {
      uVar11 = 0xffffffffffffffff;
      psVar15 = param_2;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1[0x27b] + 0x68,param_2,~uVar11 - 1);
      uVar11 = 0xffffffffffffffff;
      psVar15 = param_2;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x2c1,param_2,~uVar11 - 1);
      *(undefined4 *)((longlong)param_1 + 0x1814) = param_3;
      param_1[0x2fb] = param_6;
      if (local_70 == (longlong *)0x0) {
LAB_140222fe1:
        lVar10 = 0;
      }
      else {
        if (local_70 != local_68) {
          iVar8 = DAT_140608154 + 1;
          bVar17 = DAT_140608154 == 0;
          DAT_140608154 = iVar8;
          if (bVar17) {
            FUN_140176d60(1);
          }
          goto LAB_140222fe1;
        }
        lVar10 = *local_70;
      }
      iVar8 = DAT_140608154;
      *(undefined4 *)((longlong)param_1 + 0x2054) = *(undefined4 *)(lVar10 + 0x330);
      if (local_70 == (longlong *)0x0) {
LAB_14022301a:
        lVar10 = 0;
      }
      else {
        if (local_70 != local_68) {
          DAT_140608154 = iVar8 + 1;
          if (iVar8 == 0) {
            FUN_140176d60(1);
          }
          goto LAB_14022301a;
        }
        lVar10 = *local_70;
      }
      *(undefined4 *)((longlong)param_1 + 0x205c) = *(undefined4 *)(lVar10 + 0x334);
    }
    plVar13 = local_70;
    if (local_70 != (longlong *)0x0) {
      if (local_70 == local_68) {
        if (local_70 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_70 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_70 = (longlong *)0x0;
            pvVar6 = (void *)*plVar13;
            if (pvVar6 != (void *)0x0) {
              FUN_140197310(pvVar6);
              operator_delete(pvVar6);
            }
            operator_delete(plVar13);
          }
        }
      }
      else {
        iVar8 = DAT_1406080b4 + 1;
        bVar17 = DAT_1406080b4 == 0;
        DAT_1406080b4 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
LAB_140222eea:
    if (local_58 != '\0') {
      FUN_14034edd0(local_60);
    }
    return 1;
  }
  if (param_6 != 0) {
    if (param_7 == '\0') {
      if (param_1[0x2c3] == 0) goto LAB_140223166;
      fVar18 = (float)FUN_1402349c0(param_1,*(undefined4 *)(param_6 + 0x18));
      plVar13 = local_70;
      if (fVar18 < 1.0) {
        if (local_70 != (longlong *)0x0) {
          if (local_70 == local_68) {
            if (local_70 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_70 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                local_70 = (longlong *)0x0;
                pvVar6 = (void *)*plVar13;
                if (pvVar6 != (void *)0x0) {
                  FUN_140197310(pvVar6);
                  operator_delete(pvVar6);
                }
                operator_delete(plVar13);
              }
            }
          }
          else {
            iVar8 = DAT_1406080b4 + 1;
            bVar17 = DAT_1406080b4 == 0;
            DAT_1406080b4 = iVar8;
            if (bVar17) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_140223772;
      }
    }
    local_48 = *(undefined4 *)(param_6 + 0x90);
    local_50 = param_1[0xa2];
    lVar10 = FUN_14023b4a0(param_1 + 0x382,param_6 + 0x18);
    *(longlong *)(lVar10 + 8) = local_50;
    *(ulonglong *)(lVar10 + 0x10) = CONCAT44(uStack_44,local_48);
  }
LAB_140223166:
  *(undefined4 *)(param_1 + 0x3d6) = 0;
  *(undefined1 *)((longlong)param_1 + 0x1eb4) = 0;
  *(undefined2 *)(param_1 + 0x19a) = 0;
  uVar11 = 0xffffffffffffffff;
  psVar15 = param_2;
  do {
    if (uVar11 == 0) break;
    uVar11 = uVar11 - 1;
    sVar2 = *psVar15;
    psVar15 = psVar15 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x299,param_2,~uVar11 - 1);
  *(undefined4 *)(param_1 + 0x381) = param_3;
  *(undefined4 *)((longlong)param_1 + 0x1c0c) = param_4;
  param_1[0x2fa] = param_6;
  if (local_70 == (longlong *)0x0) {
LAB_1402231f8:
    lVar10 = 0;
  }
  else {
    if (local_70 != local_68) {
      iVar8 = DAT_140608154 + 1;
      bVar17 = DAT_140608154 == 0;
      DAT_140608154 = iVar8;
      if (bVar17) {
        FUN_140176d60(1);
      }
      goto LAB_1402231f8;
    }
    lVar10 = *local_70;
  }
  iVar8 = DAT_140608154;
  *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)(lVar10 + 0x330);
  if (local_70 == (longlong *)0x0) {
LAB_14022322d:
    lVar10 = 0;
  }
  else {
    if (local_70 != local_68) {
      DAT_140608154 = iVar8 + 1;
      if (iVar8 == 0) {
        FUN_140176d60(1);
      }
      goto LAB_14022322d;
    }
    lVar10 = *local_70;
  }
  *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)(lVar10 + 0x334);
  *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
  *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
  *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
  *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
  *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
  *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
  *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
  *(undefined4 *)((longlong)param_1 + 0x1c54) = *(undefined4 *)((longlong)param_1 + 0x1c54);
  FUN_14023ae90(param_1 + 0x2f8);
  param_1[0x2f8] = 0;
  param_1[0x2f9] = 0;
  if (local_70 == (longlong *)0x0) {
LAB_1402232f3:
    lVar10 = 0;
  }
  else {
    if (local_70 != local_68) {
      iVar8 = DAT_140608154 + 1;
      bVar17 = DAT_140608154 == 0;
      DAT_140608154 = iVar8;
      if (bVar17) {
        FUN_140176d60(1);
      }
      goto LAB_1402232f3;
    }
    lVar10 = *local_70;
  }
  FUN_1400015e0(param_1 + 0x3dc,lVar10 + 0x308,0,0xffffffffffffffff);
  if (local_70 == (longlong *)0x0) {
LAB_140223350:
    lVar10 = 0;
  }
  else {
    if (local_70 != local_68) {
      iVar8 = DAT_140608154 + 1;
      bVar17 = DAT_140608154 == 0;
      DAT_140608154 = iVar8;
      if (bVar17) {
        FUN_140176d60(1);
      }
      goto LAB_140223350;
    }
    lVar10 = *local_70;
  }
  uVar12 = (undefined7)
           ((ulonglong)
            (IMAGE_DOS_HEADER_140000000.e_magic +
            (&switchD_140223377::switchdataD_1402237e8)[*(int *)(lVar10 + 0xe4)]) >> 8);
  switch(*(int *)(lVar10 + 0xe4)) {
  case 0:
    if (local_70 == (longlong *)0x0) {
LAB_14022339f:
      lVar10 = 0;
    }
    else {
      if (local_70 != local_68) {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(CONCAT71(uVar12,1));
        }
        goto LAB_14022339f;
      }
      lVar10 = *local_70;
    }
    switch(*(undefined4 *)(lVar10 + 0xdc)) {
    case 1:
    case 2:
      uVar14 = 10;
      break;
    case 3:
      uVar7 = (**(code **)(*param_1 + 0x5c8))(param_1,param_1[0x2fa]);
    default:
      goto switchD_140223377_caseD_3;
    case 5:
      uVar7 = (**(code **)(*param_1 + 0x5c0))(param_1,param_1[0x2fa]);
      goto switchD_140223377_caseD_3;
    case 6:
      uVar7 = (**(code **)(*param_1 + 0xac0))(param_1);
      goto switchD_140223377_caseD_3;
    case 7:
      uVar14 = 0x35;
      break;
    case 8:
      uVar14 = 0x3b;
      break;
    case 9:
      uVar14 = 2;
      break;
    case 10:
      uVar14 = 0xb;
      break;
    case 0xe:
      uVar14 = 0x4e;
    }
    goto LAB_140223684;
  case 1:
    if (local_70 == (longlong *)0x0) {
      lVar10 = 0;
LAB_14022349c:
      lVar9 = 0;
    }
    else {
      if (local_70 == local_68) {
        lVar10 = *local_70;
      }
      else {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(CONCAT71(uVar12,1));
        }
        lVar10 = 0;
      }
      if (local_70 == (longlong *)0x0) goto LAB_14022349c;
      if (local_70 != local_68) {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
        goto LAB_14022349c;
      }
      lVar9 = *local_70;
    }
    uVar14 = 0x12;
    break;
  case 2:
    if (local_70 == (longlong *)0x0) {
      lVar10 = 0;
LAB_1402235f4:
      lVar9 = 0;
    }
    else {
      if (local_70 == local_68) {
        lVar10 = *local_70;
      }
      else {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(CONCAT71(uVar12,1));
        }
        lVar10 = 0;
      }
      if (local_70 == (longlong *)0x0) goto LAB_1402235f4;
      if (local_70 != local_68) {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
        goto LAB_1402235f4;
      }
      lVar9 = *local_70;
    }
    uVar14 = 0x15;
    break;
  default:
    goto switchD_140223377_caseD_3;
  case 4:
    if ((char)param_1[0x30f] != '\x01') goto switchD_140223377_caseD_3;
    if (local_70 == (longlong *)0x0) {
      lVar10 = 0;
LAB_140223513:
      lVar9 = 0;
    }
    else {
      if (local_70 == local_68) {
        lVar10 = *local_70;
      }
      else {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(CONCAT71(uVar12,1));
        }
        lVar10 = 0;
      }
      if (local_70 == (longlong *)0x0) goto LAB_140223513;
      if (local_70 != local_68) {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
        goto LAB_140223513;
      }
      lVar9 = *local_70;
    }
    uVar14 = 0x10;
    break;
  case 5:
    if ((char)param_1[0x30f] != '\x01') goto switchD_140223377_caseD_3;
    if (local_70 == (longlong *)0x0) {
      lVar10 = 0;
LAB_14022358a:
      lVar9 = 0;
    }
    else {
      if (local_70 == local_68) {
        lVar10 = *local_70;
      }
      else {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(CONCAT71(uVar12,1));
        }
        lVar10 = 0;
      }
      if (local_70 == (longlong *)0x0) goto LAB_14022358a;
      if (local_70 != local_68) {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
        goto LAB_14022358a;
      }
      lVar9 = *local_70;
    }
    uVar14 = 0xf;
    break;
  case 6:
    if (local_70 == (longlong *)0x0) {
      lVar10 = 0;
LAB_14022365b:
      lVar9 = 0;
    }
    else {
      if (local_70 == local_68) {
        lVar10 = *local_70;
      }
      else {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(CONCAT71(uVar12,1));
        }
        lVar10 = 0;
      }
      if (local_70 == (longlong *)0x0) goto LAB_14022365b;
      if (local_70 != local_68) {
        iVar8 = DAT_140608154 + 1;
        bVar17 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
        goto LAB_14022365b;
      }
      lVar9 = *local_70;
    }
    uVar14 = 0x16;
  }
  uVar5 = *(undefined4 *)(lVar10 + 0xb8);
  *(undefined4 *)(param_1 + 0x34e) = *(undefined4 *)(lVar9 + 0xb4);
  *(undefined4 *)((longlong)param_1 + 0x1a74) = uVar5;
LAB_140223684:
  uVar7 = (**(code **)(*param_1 + 200))(param_1,uVar14,param_7);
switchD_140223377_caseD_3:
  FUN_1402388d0(param_1);
  plVar13 = local_70;
  if (local_70 != (longlong *)0x0) {
    if (local_70 == local_68) {
      if (local_70 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_70 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          local_70 = (longlong *)0x0;
          pvVar6 = (void *)*plVar13;
          if (pvVar6 != (void *)0x0) {
            FUN_140197310(pvVar6);
            operator_delete(pvVar6);
          }
          operator_delete(plVar13);
        }
      }
    }
    else {
      iVar8 = DAT_1406080b4 + 1;
      bVar17 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar8;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  if (local_58 != '\0') {
    FUN_14034edd0(local_60);
  }
  return uVar7;
}



void FUN_140223840(void)

{
  FUN_140222c70();
  return;
}



undefined1 FUN_140223870(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0xce0) = param_2;
  return 1;
}



void FUN_140223880(longlong *param_1,short *param_2)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x299,param_2,~uVar2 - 1);
                    // WARNING: Could not recover jumptable at 0x0001402238c3. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(param_1,0xe);
  return;
}



undefined8 FUN_1402238d0(longlong *param_1,undefined8 param_2)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  char cVar4;
  longlong *plVar5;
  longlong *plVar6;
  uint *puVar7;
  undefined8 uVar8;
  uint *puVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  
  (**(code **)(*param_1 + 0x128))();
  plVar5 = (longlong *)FUN_14027cfe0(*(undefined8 *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x280));
  if (plVar5 == (longlong *)0x0) {
    (**(code **)(*param_1 + 0x120))(param_1,0);
    return 0;
  }
  lVar2 = *plVar5;
  if (lVar2 == 0) {
    (**(code **)(*param_1 + 0x120))(param_1,0);
    return 0;
  }
  uVar1 = *(uint *)(plVar5 + 0x20);
  fVar13 = 0.0;
  puVar9 = (uint *)0x0;
  if (uVar1 != 0) {
    plVar6 = (longlong *)FUN_140330ad0();
    puVar7 = puVar9;
    if (*plVar6 != 0) {
      for (puVar3 = *(uint **)(*plVar6 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0xc)) {
        if ((puVar3[0xe] == uVar1) && (*puVar3 == uVar1)) {
          if (puVar3 != (uint *)0x0) {
            puVar7 = puVar3 + 1;
          }
          break;
        }
      }
    }
    fVar13 = (float)puVar7[4];
  }
  fVar11 = *(float *)(lVar2 + 0x68) - *(float *)(param_1 + 0x2f);
  fVar12 = *(float *)(lVar2 + 0x6c) - *(float *)((longlong)param_1 + 0x17c);
  fVar10 = *(float *)(lVar2 + 0x70) - *(float *)(param_1 + 0x30);
  fVar11 = fVar12 * fVar12 + fVar11 * fVar11 + fVar10 * fVar10;
  fVar10 = (float)(0x5f3759df - ((int)fVar11 >> 1));
  fVar10 = fVar10 * (1.5 - fVar10 * fVar10 * fVar11 * 0.5);
  if ((1.5 - fVar10 * fVar10 * fVar11 * 0.5) * fVar10 * fVar11 < fVar13) {
    uVar8 = 0;
  }
  else {
    uVar1 = *(uint *)(plVar5 + 0x20);
    plVar6 = (longlong *)FUN_140330ad0();
    puVar7 = puVar9;
    if (*plVar6 != 0) {
      for (puVar3 = *(uint **)(*plVar6 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
          (puVar7 = puVar9, puVar3 != (uint *)0x0 &&
          ((puVar3[0xe] != uVar1 || (puVar7 = puVar3, *puVar3 != uVar1))));
          puVar3 = *(uint **)(puVar3 + 0xc)) {
      }
    }
    if ((((puVar7 == (uint *)0x0) || (puVar7[2] == 0)) ||
        ((puVar7[2] == 1 &&
         (cVar4 = (**(code **)(*param_1 + 0x398))(param_1,param_2,0), cVar4 == '\0')))) &&
       (cVar4 = FUN_14021e5f0(param_1,param_2,lVar2 + 0x68,*(undefined4 *)((longlong)plVar5 + 0x7c))
       , cVar4 != '\0')) {
      (**(code **)(*param_1 + 0x918))(param_1,0);
    }
    uVar8 = 1;
  }
  return uVar8;
}



void FUN_140223b30(longlong *param_1,undefined8 param_2)

{
  char cVar1;
  longlong lVar2;
  
  lVar2 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar2 != 0) {
    cVar1 = FUN_14021e5f0(param_1,param_2,lVar2 + 0x178,*(undefined4 *)(lVar2 + 0x520));
    if (cVar1 != '\0') {
      (**(code **)(*param_1 + 0x918))(param_1,0);
    }
  }
  return;
}



ulonglong FUN_140223ba0(longlong *param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong *plVar4;
  ulonglong uVar5;
  
  plVar4 = (longlong *)param_1[0x3d0];
  if (plVar4 == (longlong *)0x0) {
    return 0;
  }
  if ((plVar4[6] != 0) && (lVar2 = *(longlong *)(plVar4[6] + 0x2d0), lVar2 != 0)) {
    plVar4 = (longlong *)(**(code **)(*param_1 + 0x128))(param_1);
    if ((int)plVar4 != 0) {
      plVar4 = (longlong *)
               FUN_14027cfe0(*(undefined8 *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x280),
                             (ulonglong)plVar4 & 0xffffffff);
      if (plVar4 != (longlong *)0x0) {
        iVar1 = *(int *)((longlong)plVar4 + 0x7c);
        if ((((iVar1 != -1) && ((int)param_1[0xa4] != -1)) && (iVar1 != (int)param_1[0xa4])) &&
           (lVar3 = *plVar4, lVar3 != 0)) {
          lVar2 = *(longlong *)(lVar2 + 0x430);
          if ((iVar1 < (int)(*(longlong *)(lVar2 + 0x98) - *(longlong *)(lVar2 + 0x90) >> 3)) &&
             (-1 < iVar1)) {
            uVar5 = FUN_1402bd3e0(param_1,lVar3 + 0x68,
                                  *(undefined8 *)(*(longlong *)(lVar2 + 0x90) + (longlong)iVar1 * 8)
                                 );
            return uVar5;
          }
          uVar5 = FUN_1402bd3e0(param_1,lVar3 + 0x68,0);
          return uVar5;
        }
      }
    }
  }
  return (ulonglong)plVar4 & 0xffffffffffffff00;
}



ulonglong FUN_140223ca0(longlong *param_1)

{
  int iVar1;
  longlong lVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[0x3d0];
  if (uVar3 == 0) {
    return 0;
  }
  if ((*(longlong *)(uVar3 + 0x30) != 0) &&
     (lVar2 = *(longlong *)(*(longlong *)(uVar3 + 0x30) + 0x2d0), lVar2 != 0)) {
    uVar3 = (**(code **)(*param_1 + 0x110))(param_1);
    if (uVar3 != 0) {
      iVar1 = *(int *)(uVar3 + 0x520);
      if ((iVar1 != -1) && ((int)param_1[0xa4] != -1)) {
        lVar2 = *(longlong *)(lVar2 + 0x430);
        if ((iVar1 < (int)(*(longlong *)(lVar2 + 0x98) - *(longlong *)(lVar2 + 0x90) >> 3)) &&
           (-1 < iVar1)) {
          uVar3 = FUN_1402bd3e0(param_1,uVar3 + 0x178,
                                *(undefined8 *)(*(longlong *)(lVar2 + 0x90) + (longlong)iVar1 * 8));
          return uVar3;
        }
        uVar3 = FUN_1402bd3e0(param_1,uVar3 + 0x178,0);
        return uVar3;
      }
    }
  }
  return uVar3 & 0xffffffffffffff00;
}



undefined1 FUN_140223d80(longlong *param_1,undefined1 param_2)

{
  short sVar1;
  int iVar2;
  char cVar3;
  undefined1 uVar4;
  longlong lVar5;
  ulonglong uVar6;
  undefined8 uVar7;
  longlong *plVar8;
  short *psVar9;
  
  uVar4 = 0;
  cVar3 = FUN_1402d7670(param_1,10);
  if (cVar3 != '\0') {
    if (*(int *)((longlong)param_1 + 300) == 0x3a) {
      return 1;
    }
                    // WARNING: Could not recover jumptable at 0x000140223ddf. Too many branches
                    // WARNING: Treating indirect jump as call
    uVar4 = (**(code **)(*param_1 + 200))(param_1,0x3a,param_2);
    return uVar4;
  }
  iVar2 = *(int *)((longlong)param_1 + 300);
  if (iVar2 == 3) {
    return 1;
  }
  if (iVar2 == 0x1e) {
    plVar8 = param_1 + 0x363;
    if (7 < (ulonglong)param_1[0x366]) {
      plVar8 = (longlong *)*plVar8;
    }
    uVar6 = 0xffffffffffffffff;
    psVar9 = (short *)plVar8;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      sVar1 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1[0x27b] + 0x68,plVar8,~uVar6 - 1);
    (**(code **)(*param_1 + 200))(param_1,3,param_2);
    return 1;
  }
  if ((iVar2 == 0x17) || (iVar2 == 0x18)) {
    cVar3 = FUN_14023acc0();
    if ((cVar3 == '\0') || (lVar5 = FUN_14023ad10(), *(int *)(lVar5 + 0x38) != 2))
    goto LAB_140223e96;
    uVar7 = 0x18;
  }
  else {
    uVar7 = 3;
  }
  uVar4 = (**(code **)(*param_1 + 200))(param_1,uVar7,param_2);
LAB_140223e96:
  if ((*(int *)((longlong)param_1 + 300) == 10) && (param_1[0x2c3] == 0)) {
    plVar8 = param_1 + 0x363;
    if (7 < (ulonglong)param_1[0x366]) {
      plVar8 = (longlong *)*plVar8;
    }
    uVar6 = 0xffffffffffffffff;
    psVar9 = (short *)plVar8;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      sVar1 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1[0x27b] + 0x68,plVar8,~uVar6 - 1);
  }
  return uVar4;
}



undefined1 FUN_140223f00(longlong *param_1)

{
  short sVar1;
  undefined1 uVar2;
  ulonglong uVar3;
  longlong *plVar4;
  short *psVar5;
  
  uVar2 = (**(code **)(*param_1 + 200))(param_1,8);
  if ((*(int *)((longlong)param_1 + 300) == 10) && (param_1[0x2c3] == 0)) {
    plVar4 = param_1 + 0x368;
    if (7 < (ulonglong)param_1[0x36b]) {
      plVar4 = (longlong *)*plVar4;
    }
    uVar3 = 0xffffffffffffffff;
    psVar5 = (short *)plVar4;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      sVar1 = *psVar5;
      psVar5 = psVar5 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1[0x27b] + 0x68,plVar4,~uVar3 - 1);
  }
  return uVar2;
}



undefined1 FUN_140223f80(longlong *param_1)

{
  short sVar1;
  undefined1 uVar2;
  ulonglong uVar3;
  longlong *plVar4;
  short *psVar5;
  
  uVar2 = (**(code **)(*param_1 + 200))(param_1,9);
  if ((*(int *)((longlong)param_1 + 300) == 10) && (param_1[0x2c3] == 0)) {
    plVar4 = param_1 + 0x36d;
    if (7 < (ulonglong)param_1[0x370]) {
      plVar4 = (longlong *)*plVar4;
    }
    uVar3 = 0xffffffffffffffff;
    psVar5 = (short *)plVar4;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      sVar1 = *psVar5;
      psVar5 = psVar5 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1[0x27b] + 0x68,plVar4,~uVar3 - 1);
  }
  return uVar2;
}



ulonglong FUN_140224000(longlong *param_1)

{
  short sVar1;
  int iVar2;
  byte bVar3;
  ulonglong uVar4;
  longlong *plVar5;
  short *psVar6;
  
  iVar2 = (int)param_1[0xb7];
  if (1 < iVar2) {
    return (ulonglong)(uint3)((uint)iVar2 >> 8) << 8;
  }
  bVar3 = (**(code **)(*param_1 + 200))(param_1,(iVar2 != 0) + '\b',0);
  if ((*(int *)((longlong)param_1 + 300) == 10) && (param_1[0x2c3] == 0)) {
    plVar5 = param_1 + (longlong)(int)param_1[0xb7] * 5 + 0x368;
    if (7 < (ulonglong)plVar5[3]) {
      plVar5 = (longlong *)*plVar5;
    }
    uVar4 = 0xffffffffffffffff;
    psVar6 = (short *)plVar5;
    do {
      if (uVar4 == 0) break;
      uVar4 = uVar4 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1[0x27b] + 0x68,plVar5,~uVar4 - 1);
  }
  return (ulonglong)bVar3;
}



bool FUN_1402240b0(undefined8 param_1,longlong param_2)

{
  if (param_2 == 0) {
    return false;
  }
  return *(int *)(param_2 + 0x58) == 2;
}



undefined1 FUN_1402240c0(undefined8 param_1,int param_2,undefined4 param_3)

{
  char cVar1;
  
  cVar1 = FUN_140224120(param_1,param_2 + -1);
  if (cVar1 != '\0') {
    FUN_140224300(param_1,param_2,param_3);
    return 1;
  }
  return 0;
}



undefined8 FUN_140224120(longlong *param_1,int param_2)

{
  double dVar1;
  float *pfVar2;
  longlong *plVar3;
  int iVar4;
  float extraout_XMM0_Da;
  undefined1 local_res10 [8];
  undefined1 local_res18 [8];
  undefined1 local_res20 [8];
  undefined4 local_38 [8];
  
  iVar4 = param_2 + 0x21;
  if ((iVar4 < 0) || (0x44 < iVar4)) {
    if (DAT_14060813c == 0) {
      FUN_140176d60(0);
    }
    DAT_14060813c = DAT_14060813c + 1;
    pfVar2 = (float *)&DAT_140608138;
  }
  else {
    pfVar2 = (float *)((longlong)param_1 + (longlong)iVar4 * 4 + 0x734);
  }
  if (*pfVar2 < 1000.0) {
    dVar1 = (double)FUN_140414fe0();
    FUN_14023bf40(param_1,param_2);
    if (extraout_XMM0_Da < (float)dVar1) {
      return 1;
    }
  }
  else {
    local_res18[0] = 0;
    switch(param_2) {
    case 0:
      local_res18[0] = 1;
      break;
    case 1:
      local_res18[0] = 2;
      break;
    case 2:
      local_res18[0] = 3;
      break;
    case 3:
      local_res18[0] = 4;
      break;
    case 4:
      local_res18[0] = 5;
      break;
    case 5:
      local_res18[0] = 6;
      break;
    case 6:
      local_res18[0] = 7;
      break;
    case 7:
      local_res18[0] = 8;
      break;
    case 8:
      local_res18[0] = 9;
      break;
    case 9:
      local_res18[0] = 10;
      break;
    case 10:
      local_res18[0] = 0xb;
      break;
    case 0xb:
      local_res18[0] = 0xc;
      break;
    case 0xc:
      local_res18[0] = 0xd;
      break;
    case 0xd:
      local_res18[0] = 0xe;
    }
    if (param_1[0x3d0] != 0) {
      local_38[0] = (undefined4)param_1[0x25];
      local_res10[0] = 1;
      local_res20[0] = (**(code **)(*param_1 + 0xb0))(param_1);
      plVar3 = (longlong *)(**(longlong **)(param_1[0x3d0] + 0x48) + 0x380);
      (**(code **)(*plVar3 + 0x180))
                (plVar3,*(undefined4 *)(param_1[0x3d0] + 8),&DAT_1405d85a0,local_res20,local_res18,
                 local_res10,local_38);
    }
  }
  return 0;
}



undefined8 FUN_140224300(longlong *param_1,int param_2,int param_3)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  wchar_t *_Str;
  wchar_t *pwVar6;
  longlong lVar7;
  uint uVar8;
  
  if ((*(float *)(param_1 + 0xb3) <= 0.0) || (param_3 < 1)) {
    return 0;
  }
  uVar8 = 1;
  do {
    if (uVar8 - 1 < 0xe) {
      if (uVar8 < 0xf) {
        plVar4 = (longlong *)(param_1[0x16f] + 0x178 + (longlong)(int)uVar8 * 8);
      }
      else {
        if (DAT_140608178 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608178 = DAT_140608178 + 1;
        plVar4 = &DAT_140608170;
      }
      lVar1 = DAT_1406081d8;
      if ((*(char *)(*plVar4 + 0x20) != '\0') && (uVar8 < 0xf)) {
        lVar7 = ((longlong)(int)uVar8 + 0x13) * 0x20;
        for (pwVar6 = *(wchar_t **)(lVar7 + DAT_1406081d8);
            pwVar6 != *(wchar_t **)(lVar7 + 8 + lVar1); pwVar6 = pwVar6 + 0x14) {
          _Str = pwVar6;
          if (7 < *(ulonglong *)(pwVar6 + 0xc)) {
            _Str = *(wchar_t **)pwVar6;
          }
          iVar3 = _wtoi(_Str);
          if (param_2 == iVar3) {
            return 0;
          }
        }
      }
    }
    uVar8 = uVar8 + 1;
    if (0xe < (int)uVar8) {
      if ((param_2 != 7) && (*(char *)(*(longlong *)(param_1[0x16f] + 0x1b0) + 0x20) != '\0')) {
        FUN_14032b110(param_1[0x16f],7);
        (**(code **)(*param_1 + 0x930))(param_1,7);
      }
      if (param_2 == 9) {
        if (*(char *)(*(longlong *)(param_1[0x16f] + 0x1c0) + 0x20) != '\0') {
          FUN_14032abd0(param_1[0x16f],9,param_3);
          return 0;
        }
      }
      else if (param_2 == 0xb) {
        if (*(char *)(*(longlong *)(param_1[0x16f] + 0x1d0) + 0x20) != '\0') {
          FUN_14032b110(param_1[0x16f],0xb);
          (**(code **)(*param_1 + 0x930))(param_1,0xb);
          return 0;
        }
      }
      else if ((param_2 == 0xd) && (*(char *)(*(longlong *)(param_1[0x16f] + 0x1e0) + 0x20) != '\0')
              ) {
        puVar5 = (undefined8 *)FUN_14020d880(param_1 + 0x16f,0);
        FUN_14032abd0(*puVar5,0xd,param_3);
        return 0;
      }
      cVar2 = FUN_14032ace0(param_1[0x16f],param_2,param_3);
      if (cVar2 != '\0') {
        FUN_14032b0a0(param_1[0x16f],param_2);
      }
      FUN_140224d20(param_1,param_2);
      return 1;
    }
  } while( true );
}



void FUN_140224540(longlong *param_1,uint param_2,int param_3,uint param_4)

{
  int iVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  plVar3 = &DAT_140608148;
  if (param_2 < 2) {
    plVar2 = param_1 + (longlong)(int)param_2 + 0x16f;
  }
  else {
    if (DAT_140608140 == 0) {
      FUN_140176d60(0);
    }
    DAT_140608140 = DAT_140608140 + 1;
    plVar2 = &DAT_140608148;
  }
  if (param_4 < 0xf) {
    plVar2 = (longlong *)(*plVar2 + 0x178 + (longlong)(int)param_4 * 8);
  }
  else {
    if (DAT_140608178 == 0) {
      FUN_140176d60(0);
    }
    DAT_140608178 = DAT_140608178 + 1;
    plVar2 = &DAT_140608170;
  }
  if ((*plVar2 != 0) && (*(char *)(*plVar2 + 0x20) != '\0')) {
    if (param_2 < 2) {
      plVar3 = param_1 + (longlong)(int)param_2 + 0x16f;
    }
    else {
      if (DAT_140608140 == 0) {
        FUN_140176d60(0);
      }
      DAT_140608140 = DAT_140608140 + 1;
    }
    if (param_4 - 1 < 0xe) {
      if (param_4 < 0xf) {
        iVar1 = *(int *)(*plVar3 + 0x88 + (longlong)(int)param_4 * 4);
      }
      else {
        if (DAT_140608190 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608190 = DAT_140608190 + 1;
        iVar1 = DAT_14060818c;
      }
    }
    else {
      iVar1 = 0;
    }
    if (iVar1 <= param_3) {
      (**(code **)(*param_1 + 0x930))(param_1,param_4,param_2);
    }
  }
  return;
}



undefined8 FUN_140224690(longlong *param_1,int param_2,uint param_3)

{
  double dVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  
  if ((3 < param_2) && (((param_2 < 7 || (param_2 == 10)) || (param_2 == 0xe)))) {
    iVar3 = (**(code **)(*param_1 + 0xb0))();
    if (iVar3 != 4) {
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    }
    dVar1 = (double)param_1[0xa2];
    iVar3 = rand();
    param_1[0x166] = (longlong)((dVar1 - (double)((float)iVar3 * 3.0517578e-05 * 3.0)) + 1.5);
    lVar4 = param_1[0xb0];
    if (param_1[0xaf] != lVar4) {
      lVar4 = FUN_14023b410(lVar4,lVar4);
      FUN_14023ae30(lVar4,param_1[0xb0]);
      param_1[0xb0] = lVar4;
    }
    FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
    FUN_140001710(param_1 + 0x299,&DAT_140477960,0);
  }
  plVar6 = &DAT_140608148;
  if (param_3 < 2) {
    plVar5 = param_1 + (longlong)(int)param_3 + 0x16f;
  }
  else {
    if (DAT_140608140 == 0) {
      FUN_140176d60(0);
    }
    DAT_140608140 = DAT_140608140 + 1;
    plVar5 = &DAT_140608148;
  }
  if (*plVar5 != 0) {
    if (param_3 < 2) {
      plVar6 = param_1 + (longlong)(int)param_3 + 0x16f;
    }
    else {
      if (DAT_140608140 == 0) {
        FUN_140176d60(0);
      }
      DAT_140608140 = DAT_140608140 + 1;
    }
    if (0 < param_2) {
      FUN_14032b110(*plVar6,param_2);
    }
  }
  if ((param_1[(longlong)(int)(uint)(param_3 == 0) + 0x16f] != 0) &&
     (cVar2 = FUN_14032b0a0(param_1[(longlong)(int)(uint)(param_3 == 0) + 0x16f],param_2),
     cVar2 != '\0')) {
    return 0;
  }
  return 1;
}



void FUN_140224870(longlong *param_1,uint param_2)

{
  wchar_t wVar1;
  int iVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  wchar_t *pwVar5;
  wchar_t *pwVar6;
  
  pwVar5 = (wchar_t *)0x0;
  if (param_2 < 0xf) {
    pwVar6 = (wchar_t *)(DAT_1406081d8 + 0x440 + (longlong)(int)param_2 * 0x28);
    if (7 < *(ulonglong *)(pwVar6 + 0xc)) {
      pwVar6 = *(wchar_t **)pwVar6;
    }
  }
  else {
    pwVar6 = (wchar_t *)0x0;
  }
  if ((param_2 < 0xf) &&
     (pwVar5 = (wchar_t *)(DAT_1406081d8 + 0x698 + (longlong)(int)param_2 * 0x28),
     7 < *(ulonglong *)(pwVar5 + 0xc))) {
    pwVar5 = *(wchar_t **)pwVar5;
  }
  if (((char)param_1[0xc0] == '\0') && (*(char *)((longlong)param_1 + 0x601) == '\0')) {
    iVar2 = _wcsicmp(pwVar6,L"");
    if (iVar2 == 0) {
      return;
    }
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    uVar3 = 0xffffffffffffffff;
    pwVar5 = pwVar6;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      wVar1 = *pwVar5;
      pwVar5 = pwVar5 + 1;
    } while (wVar1 != L'\0');
    FUN_140001710(param_1 + 0x2a8,pwVar6,~uVar3 - 1);
    uVar4 = 0x1d;
  }
  else {
    iVar2 = _wcsicmp(pwVar5,L"");
    if (iVar2 == 0) {
      return;
    }
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    uVar3 = 0xffffffffffffffff;
    pwVar6 = pwVar5;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      wVar1 = *pwVar6;
      pwVar6 = pwVar6 + 1;
    } while (wVar1 != L'\0');
    FUN_140001710(param_1 + 0x2ad,pwVar5,~uVar3 - 1);
    uVar4 = 0x23;
  }
  (**(code **)(*param_1 + 200))(param_1,uVar4,0);
  return;
}



undefined1 * FUN_1402249b0(longlong *param_1,int param_2,uint param_3)

{
  undefined4 uVar1;
  wchar_t wVar2;
  int iVar3;
  longlong *plVar4;
  longlong *plVar5;
  float *pfVar6;
  ulonglong uVar7;
  undefined8 uVar8;
  longlong lVar9;
  wchar_t *pwVar10;
  undefined8 *puVar11;
  undefined4 uVar12;
  wchar_t *pwVar13;
  undefined8 *puVar14;
  undefined8 *puVar15;
  float fVar16;
  float fVar17;
  undefined8 *local_70;
  undefined8 *local_68;
  undefined8 local_60;
  
  lVar9 = (longlong)param_2;
  if (*(float *)(param_1 + 0xb3) <= 0.0) {
    return &stack0x00000000;
  }
  puVar14 = (undefined8 *)0x0;
  if (param_2 < 0xf) {
    pwVar13 = (wchar_t *)(DAT_1406081d8 + 0x440 + lVar9 * 0x28);
    if (7 < *(ulonglong *)(pwVar13 + 0xc)) {
      pwVar13 = *(wchar_t **)pwVar13;
    }
  }
  else {
    pwVar13 = (wchar_t *)0x0;
  }
  if (param_2 < 0xf) {
    pwVar10 = (wchar_t *)(DAT_1406081d8 + 0x698 + lVar9 * 0x28);
    if (7 < *(ulonglong *)(pwVar10 + 0xc)) {
      pwVar10 = *(wchar_t **)pwVar10;
    }
  }
  else {
    pwVar10 = (wchar_t *)0x0;
  }
  if ((((param_2 == 1) || (param_2 == 3)) || (param_2 == 8)) || (param_2 == 0xc)) {
    param_1[lVar9 + 0x39c] = param_1[0xa2];
    if (((char)param_1[0xc0] == '\0') && (*(char *)((longlong)param_1 + 0x601) == '\0')) {
      iVar3 = _wcsicmp(pwVar13,L"");
      if (iVar3 != 0) {
        *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
        uVar7 = 0xffffffffffffffff;
        pwVar10 = pwVar13;
        do {
          if (uVar7 == 0) break;
          uVar7 = uVar7 - 1;
          wVar2 = *pwVar10;
          pwVar10 = pwVar10 + 1;
        } while (wVar2 != L'\0');
        FUN_140001710(param_1 + 0x2a8,pwVar13,~uVar7 - 1);
        uVar8 = 0x1d;
LAB_140224b2a:
        (**(code **)(*param_1 + 200))(param_1,uVar8,0);
      }
    }
    else {
      iVar3 = _wcsicmp(pwVar10,L"");
      if (iVar3 != 0) {
        *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
        uVar7 = 0xffffffffffffffff;
        pwVar13 = pwVar10;
        do {
          if (uVar7 == 0) break;
          uVar7 = uVar7 - 1;
          wVar2 = *pwVar13;
          pwVar13 = pwVar13 + 1;
        } while (wVar2 != L'\0');
        FUN_140001710(param_1 + 0x2ad,pwVar10,~uVar7 - 1);
        uVar8 = 0x23;
        goto LAB_140224b2a;
      }
    }
  }
  if (param_2 != 0xc) {
    return (undefined1 *)0x1;
  }
  if (param_3 < 2) {
    plVar4 = param_1 + (longlong)(int)param_3 + 0x16f;
  }
  else {
    if (DAT_140608140 == 0) {
      FUN_140176d60(0);
    }
    DAT_140608140 = DAT_140608140 + 1;
    plVar4 = &DAT_140608148;
  }
  uVar1 = *(undefined4 *)(*(longlong *)(*plVar4 + 0x1d8) + 0x2c);
  local_70 = (undefined8 *)0x0;
  puVar11 = (undefined8 *)0x0;
  local_68 = (undefined8 *)0x0;
  local_60 = 0;
  iVar3 = (**(code **)(*param_1 + 0xb0))(param_1);
  lVar9 = param_1[0x3d0];
  puVar15 = puVar14;
  if (iVar3 == 4) {
    puVar11 = puVar14;
    if (lVar9 == 0) goto joined_r0x000140224bf6;
    uVar12 = 4;
  }
  else {
    if (lVar9 == 0) goto joined_r0x000140224bf6;
    uVar12 = 3;
  }
  FUN_1401931c0(*(undefined8 *)(lVar9 + 0x48),&local_70,uVar12,param_1 + 0x2f,uVar1);
  puVar14 = local_70;
  puVar15 = local_70;
  puVar11 = local_68;
joined_r0x000140224bf6:
  for (; puVar14 != puVar11; puVar14 = puVar14 + 1) {
    plVar4 = (longlong *)*puVar14;
    if (plVar4 != param_1) {
      FUN_140224870(plVar4,0xc);
      if (param_3 < 2) {
        plVar5 = param_1 + (longlong)(int)param_3 + 0x16f;
      }
      else {
        if (DAT_140608140 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608140 = DAT_140608140 + 1;
        plVar5 = &DAT_140608148;
      }
      fVar17 = (float)(int)*(float *)(*(longlong *)(*plVar5 + 0x1d8) + 0x18);
      if (*(int *)((longlong)plVar4 + 300) != 0x25) {
        fVar16 = 0.0;
        for (pfVar6 = (float *)plVar4[0x238]; pfVar6 != (float *)plVar4[0x239]; pfVar6 = pfVar6 + 1)
        {
          fVar16 = fVar16 + *pfVar6;
        }
        fVar16 = fVar16 + *(float *)(plVar4 + 0xb3);
        if (1.0 < fVar16) {
          if (fVar16 - fVar17 <= 1.0) {
            fVar17 = fVar16 - 1.0;
          }
          (**(code **)(*plVar4 + 0x290))(plVar4,-fVar17);
        }
      }
    }
  }
  if (puVar15 != (undefined8 *)0x0) {
    operator_delete(puVar15);
  }
  return (undefined1 *)0x1;
}



undefined8 FUN_140224d20(longlong *param_1,uint param_2)

{
  wchar_t wVar1;
  longlong lVar2;
  int iVar3;
  wchar_t *pwVar4;
  longlong lVar5;
  ulonglong uVar6;
  undefined4 uVar7;
  wchar_t *_Str1;
  longlong lVar8;
  
  lVar8 = (longlong)(int)param_2;
  if (0xe < param_2) {
    return 0;
  }
  _Str1 = (wchar_t *)(DAT_1406081d8 + 0x440 + lVar8 * 0x28);
  if (7 < *(ulonglong *)(_Str1 + 0xc)) {
    _Str1 = *(wchar_t **)_Str1;
  }
  pwVar4 = (wchar_t *)(DAT_1406081d8 + 0x698 + lVar8 * 0x28);
  if (7 < *(ulonglong *)(pwVar4 + 0xc)) {
    pwVar4 = *(wchar_t **)pwVar4;
  }
  if (((char)param_1[0xc0] != '\0') || (*(char *)((longlong)param_1 + 0x601) != '\0')) {
    _Str1 = pwVar4;
  }
  iVar3 = _wcsicmp(_Str1,L"");
  if ((iVar3 != 0) && ((param_2 == 4 || (param_2 == 10)))) {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 1;
    }
    lVar2 = param_1[0x27b];
    lVar5 = -1;
    pwVar4 = _Str1;
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      wVar1 = *pwVar4;
      pwVar4 = pwVar4 + 1;
    } while (wVar1 != L'\0');
    if (lVar5 != -2) {
      uVar6 = 0xffffffffffffffff;
      pwVar4 = _Str1;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        wVar1 = *pwVar4;
        pwVar4 = pwVar4 + 1;
      } while (wVar1 != L'\0');
      iVar3 = FUN_140123e30(lVar2 + 0x40,*(undefined8 *)(lVar2 + 0x50),_Str1,~uVar6 - 1);
      if (iVar3 != 0) {
        uVar6 = 0xffffffffffffffff;
        pwVar4 = _Str1;
        do {
          if (uVar6 == 0) break;
          uVar6 = uVar6 - 1;
          wVar1 = *pwVar4;
          pwVar4 = pwVar4 + 1;
        } while (wVar1 != L'\0');
        FUN_140001710(lVar2 + 0x40,_Str1,~uVar6 - 1);
        if (*(longlong *)(lVar2 + 0x10) != 0) {
          lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
          if (lVar5 == 0) {
            iVar3 = 0;
          }
          else {
            iVar3 = FUN_1402ce620(lVar5,_Str1);
            iVar3 = iVar3 + 1;
          }
          FUN_1402c5c00(lVar2,iVar3,0,1);
        }
      }
    }
    FUN_1402c5e50(param_1[0x27b],0x3f800000);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
    lVar2 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar2 + 0x54) == 1) {
      *(longlong *)(lVar2 + 0x10) = param_1[0xa2];
      FUN_1402cc2c0(lVar2);
    }
    *(undefined4 *)(lVar2 + 0x54) = 0;
  }
  param_1[lVar8 + 0x39c] = param_1[0xa2];
  if (param_2 == 4) {
    uVar7 = 0x55;
  }
  else if (param_2 == 5) {
    uVar7 = 0x59;
  }
  else if (param_2 == 6) {
    uVar7 = 0x57;
  }
  else if (param_2 == 10) {
    uVar7 = 0x56;
  }
  else {
    if (param_2 != 0xe) goto LAB_140224f1b;
    uVar7 = 0x58;
  }
  (**(code **)(*param_1 + 200))(param_1,uVar7,1);
LAB_140224f1b:
  if (*(float *)(param_1 + 0xb3) <= 0.0) {
    return 0;
  }
  *(undefined4 *)((longlong)param_1 + 0x1414) = 0;
  return 1;
}



undefined1 FUN_140224f50(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x130) == 0) {
    return 0;
  }
  return *(undefined1 *)(*(longlong *)(param_1 + 0x130) + 0x140);
}



bool FUN_140224f70(longlong *param_1,int param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  char cVar9;
  int iVar10;
  double extraout_XMM0_Qa;
  
  cVar9 = (**(code **)(*param_1 + 0x938))();
  if (cVar9 != '\0') {
    if ((((char)param_1[0xc0] != '\0') || (*(char *)((longlong)param_1 + 0x601) != '\0')) ||
       (*(int *)((longlong)param_1 + 300) == 0x2f)) {
      return true;
    }
    lVar6 = param_1[0x116];
    fVar1 = *(float *)((longlong)param_1 + 0x8ec);
    iVar5 = *(int *)((longlong)param_1 + 0x88c);
    fVar2 = *(float *)((longlong)param_1 + 0x734);
    lVar7 = param_1[0xc3];
    fVar3 = *(float *)(param_1 + 0xb3);
    fVar4 = *(float *)((longlong)param_1 + 0x59c);
    lVar8 = param_1[0x10d];
    iVar10 = FUN_1402f8580(param_1);
    FUN_140414fe0();
    if (extraout_XMM0_Qa <=
        (double)(((float)(param_2 - iVar10) * 0.125 + 1.0) * 0.8 *
                ((((float)((int)lVar6 + (int)lVar7) + fVar4) * (fVar1 + fVar2 + 1.0 + 0.0001) +
                  (float)(int)lVar8 + (float)iVar5) / fVar3))) {
      lVar6 = param_1[0x16f];
      if ((*(char *)(*(longlong *)(lVar6 + 0x1a8) + 0x20) == '\0') &&
         (*(char *)(*(longlong *)(lVar6 + 0x1a0) + 0x20) == '\0')) {
        return *(char *)(*(longlong *)(lVar6 + 0x1e8) + 0x20) == '\0';
      }
    }
  }
  return false;
}



void FUN_1402250f0(longlong *param_1,undefined4 param_2,float *param_3)

{
  float local_38;
  undefined4 local_34;
  float local_30;
  float local_28;
  undefined4 local_24;
  float local_20;
  float local_18;
  float local_14;
  float local_10;
  
  local_18 = *param_3;
  local_14 = param_3[1];
  local_34 = 0;
  local_10 = param_3[2];
  local_28 = *(float *)(param_1 + 0x2f);
  local_24 = *(undefined4 *)((longlong)param_1 + 0x17c);
  local_20 = *(float *)(param_1 + 0x30);
  local_38 = local_28 - local_18;
  local_30 = local_20 - local_10;
  D3DXVec3Normalize(&local_38,&local_38);
  *(float *)((longlong)param_1 + 0x154) = local_38;
  *(float *)(param_1 + 0x2c) = local_38;
  *(float *)((longlong)param_1 + 0x133c) = local_38;
  *(float *)(param_1 + 0x269) = local_38;
  *(undefined4 *)(param_1 + 0x2b) = local_34;
  *(undefined4 *)((longlong)param_1 + 0x164) = local_34;
  *(undefined4 *)(param_1 + 0x268) = local_34;
  *(undefined4 *)((longlong)param_1 + 0x134c) = local_34;
  *(float *)((longlong)param_1 + 0x15c) = local_30;
  *(float *)(param_1 + 0x2d) = local_30;
  *(float *)((longlong)param_1 + 0x1344) = local_30;
  *(float *)(param_1 + 0x26a) = local_30;
  (**(code **)(*param_1 + 200))(param_1,param_2,0);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

longlong FUN_1402251e0(longlong param_1,float *param_2,float *param_3)

{
  uint7 uVar1;
  float local_18;
  float fStack_14;
  float local_10;
  
  _local_18 = CONCAT44(*(float *)(param_1 + 0x17c) - param_2[1],
                       *(float *)(param_1 + 0x178) - *param_2);
  local_10 = *(float *)(param_1 + 0x180) - param_2[2];
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&local_18);
  local_18 = (float)_DAT_1406081b0;
  fStack_14 = (float)((ulonglong)_DAT_1406081b0 >> 0x20);
  uVar1 = (uint7)(uint3)((uint)DAT_1406081b8 >> 8);
  if (local_18 * -*param_3 + fStack_14 * -param_3[1] + DAT_1406081b8 * -param_3[2] < 0.5) {
    return CONCAT71(uVar1,1);
  }
  return (ulonglong)uVar1 << 8;
}



int FUN_1402252c0(longlong *param_1,longlong param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float *pfVar4;
  float *pfVar5;
  longlong lVar6;
  int *piVar7;
  int iVar8;
  int *piVar9;
  uint uVar10;
  longlong lVar11;
  int iVar12;
  float local_res8 [2];
  float local_res10 [2];
  
  pfVar4 = (float *)(param_1 + 0xee);
  local_res8[0] = 0.9;
  if (0.9 < *pfVar4) {
    pfVar4 = local_res8;
  }
  fVar1 = *pfVar4;
  iVar8 = *(int *)((longlong)param_1 + 0x654);
  fVar2 = *(float *)(param_1 + 0xed);
  (**(code **)(*param_1 + 0x2e0))();
  local_res8[0] = 0.0;
  iVar8 = (int)(((fVar2 + 1.0) * (float)*(int *)(param_2 + 0x48) - (float)iVar8) * (1.0 - fVar1));
  local_res10[0] =
       (float)(int)((float)iVar8 - (float)(*(int *)((longlong)param_1 + 0x85c) * iVar8) / 10000.0);
  pfVar4 = (float *)((longlong)param_1 + 0x774);
  pfVar5 = local_res8;
  if (-1 < (int)local_res10[0]) {
    pfVar5 = local_res10;
  }
  fVar1 = *pfVar5;
  local_res8[0] = 0.9;
  if (0.9 < *pfVar4) {
    pfVar4 = local_res8;
  }
  fVar2 = *pfVar4;
  lVar6 = param_1[0xcb];
  fVar3 = *(float *)((longlong)param_1 + 0x76c);
  (**(code **)(*param_1 + 0x2e8))(param_1);
  iVar12 = 0;
  local_res8[0] = 0.0;
  uVar10 = 0x14;
  piVar9 = (int *)(param_2 + 0x100);
  lVar11 = 8;
  iVar8 = (int)(((fVar3 + 1.0) * (float)*(int *)(param_2 + 0x4c) - (float)(int)lVar6) *
               (1.0 - fVar2));
  local_res10[0] = (float)(int)((float)iVar8 - (float)((int)param_1[0x10c] * iVar8) / 10000.0);
  pfVar4 = local_res8;
  if (-1 < (int)local_res10[0]) {
    pfVar4 = local_res10;
  }
  local_res8[0] = 1.4013e-45;
  local_res10[0] = (float)((int)fVar1 + (int)*pfVar4);
  pfVar5 = local_res8;
  if (0 < (int)fVar1 + (int)*pfVar4) {
    pfVar5 = local_res10;
  }
  local_res10[0] = *pfVar5;
  do {
    if (*piVar9 != 0) {
      local_res8[0] = 0.0;
      lVar6 = (**(code **)(*param_1 + 0x278))(param_1);
      if (lVar6 == 0) {
        lVar6 = (**(code **)(*param_1 + 0x288))(param_1);
        if (lVar6 == 0) {
          iVar8 = *(int *)((longlong)param_1 + 0x124c);
          if (iVar8 == 0) {
            iVar8 = *(int *)(param_1[0x26] + 0x1f0);
          }
        }
        else {
          lVar6 = (**(code **)(*param_1 + 0x288))(param_1);
          iVar8 = *(int *)(lVar6 + 0x4c);
        }
      }
      else {
        lVar6 = (**(code **)(*param_1 + 0x278))();
        iVar8 = *(int *)(lVar6 + 0x5c);
      }
      iVar8 = FUN_140167670(piVar9[-8],*piVar9,*(undefined4 *)(param_2 + 0x40),
                            *(undefined4 *)
                             ((longlong)param_1 + (0x568 - param_2) + (longlong)piVar9),iVar8,
                            local_res8);
      if (uVar10 < 0x47) {
        piVar7 = (int *)((longlong)param_1 + (longlong)(int)uVar10 * 4 + 0x618);
      }
      else {
        if (DAT_140608134 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608134 = DAT_140608134 + 1;
        piVar7 = &DAT_140608130;
      }
      if (999 < *piVar7) {
        iVar8 = 0;
      }
      iVar12 = iVar12 + iVar8;
    }
    uVar10 = uVar10 + 1;
    piVar9 = piVar9 + 1;
    lVar11 = lVar11 + -1;
  } while (lVar11 != 0);
  return (int)local_res10[0] + iVar12;
}



undefined8 FUN_1402255f0(longlong *param_1,longlong param_2)

{
  double dVar1;
  double dVar2;
  bool bVar3;
  longlong lVar4;
  char cVar5;
  int iVar6;
  uint uVar7;
  int iVar8;
  int iVar9;
  undefined4 uVar10;
  longlong *plVar11;
  longlong lVar12;
  longlong *plVar13;
  wchar_t *pwVar14;
  undefined8 uVar15;
  undefined8 uVar16;
  bool bVar17;
  float fVar18;
  float fVar19;
  char local_res8;
  int local_104;
  int local_100;
  int local_fc;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined8 local_e8;
  ulonglong local_e0;
  uint local_d0;
  uint local_cc;
  uint local_c8;
  uint local_c4;
  uint local_c0;
  uint local_bc;
  undefined8 local_b8;
  
  local_b8 = 0xfffffffffffffffe;
  if (*(int *)((longlong)param_1 + 300) == 0x34) {
    return 0;
  }
  if (param_1[0x3d0] == 0) {
    return 0;
  }
  if (param_1[0x26] == 0) {
    return 0;
  }
  plVar11 = (longlong *)
            FUN_140192f70(*(undefined8 *)(param_1[0x3d0] + 0x48),*(undefined4 *)(param_2 + 0x38),
                          *(undefined4 *)(param_2 + 0x3c));
  if (*(int *)(param_2 + 0x54) == 4) {
    return 0;
  }
  cVar5 = (**(code **)(*param_1 + 0x440))(param_1);
  if (cVar5 != '\0') {
    return 1;
  }
  if ((char)param_1[0x235] != '\0') {
    return 1;
  }
  if (((int)param_1[0x34c] != 0) && ((int)param_1[0x34c] == (int)plVar11[0x34c])) {
    return 1;
  }
  if (*(char *)((longlong)param_1 + 0x18de) != '\0') {
    return 0;
  }
  if (((*(int *)(param_2 + 0x3c) != 0) &&
      (*(int *)(param_2 + 0x44) == *(int *)((longlong)param_1 + 0x1c64))) &&
     ((longlong)*(int *)(param_2 + 0x3c) == param_1[0x38d])) {
    return 0;
  }
  if (*(int *)(param_2 + 0x68) == 1) {
    *(undefined4 *)(param_1 + 0x38e) = *(undefined4 *)(param_2 + 0x58);
  }
  iVar6 = FUN_1402252c0(param_1,param_2);
  local_res8 = '\0';
  iVar9 = 0;
  local_100 = 0;
  local_fc = 0;
  fVar19 = 0.0;
  local_104 = 0;
  FUN_140001710(param_1 + 0x2a8,L"damage03",8);
  FUN_140001710(param_1 + 0x2ad,L"sky_damage01",0xc);
  cVar5 = FUN_14023ac20(param_2 + 0x80);
  if (cVar5 != '\0') {
    lVar12 = FUN_14020e650(param_2 + 0x80);
    local_res8 = *(char *)(lVar12 + 0xd9);
    lVar12 = FUN_14020e650(param_2 + 0x80);
    iVar9 = *(int *)(lVar12 + 0xdc);
    lVar12 = FUN_14020e650(param_2 + 0x80);
    local_100 = *(int *)(lVar12 + 0xe0);
    lVar12 = FUN_14020e650(param_2 + 0x80);
    local_fc = *(int *)(lVar12 + 0xe8);
    FUN_14020e650(param_2 + 0x80);
    uVar7 = rand();
    uVar7 = uVar7 & 0x80000001;
    if ((int)uVar7 < 0) {
      uVar7 = (uVar7 - 1 | 0xfffffffe) + 1;
    }
    lVar12 = FUN_14020e650(param_2 + 0x80);
    FUN_1400015e0(param_1 + 0x2a8,lVar12 + ((longlong)(int)uVar7 * 5 + 0x2d) * 8,0,
                  0xffffffffffffffff);
    lVar12 = FUN_14020e650(param_2 + 0x80);
    FUN_1400015e0(param_1 + 0x2ad,lVar12 + 0x1b8,0,0xffffffffffffffff);
    lVar12 = FUN_14020e650(param_2 + 0x80);
    fVar19 = *(float *)(lVar12 + 0xc4);
    FUN_14020e650(param_2 + 0x80);
    FUN_14020e650(param_2 + 0x80);
    FUN_14020e650(param_2 + 0x80);
    local_104 = *(int *)(param_2 + 0x78);
    lVar12 = FUN_14020e650(param_2 + 0x80);
    *(undefined4 *)((longlong)param_1 + 0x1e44) = *(undefined4 *)(lVar12 + 0x210);
  }
  lVar12 = FUN_140192f70(*(undefined8 *)(param_1[0x3d0] + 0x48),*(undefined4 *)(param_2 + 0x38),
                         *(undefined4 *)(param_2 + 0x3c));
  if ((lVar12 != 0) &&
     ((((iVar8 = *(int *)(lVar12 + 0xd7c), iVar8 == 2 && (local_100 == 2)) ||
       ((iVar8 == 1 && (local_100 == 1)))) || (iVar8 == 3)))) {
    local_res8 = '\x01';
  }
  if (((iVar9 == 1) || (iVar9 == 0xe)) &&
     (*(char *)(*(longlong *)(param_1[0x16f] + 0x1c8) + 0x20) != '\0')) {
    FUN_14032b110(param_1[0x16f],10);
    (**(code **)(*param_1 + 0x930))(param_1,10);
    (**(code **)(*param_1 + 200))(param_1,2,1);
  }
  bVar17 = false;
  if ((((*(int *)((longlong)param_1 + 300) == 0x3c) || (*(int *)((longlong)param_1 + 300) == 0x3e))
      && (plVar11 != (longlong *)0x0)) &&
     (plVar13 = (longlong *)(**(code **)(*plVar11 + 0x158))(plVar11), plVar13 != param_1)) {
    return 0;
  }
  bVar3 = false;
  if ((local_fc == 1) && (fVar18 = (float)(**(code **)(*param_1 + 0xa80))(param_1), 1e-06 < fVar18))
  {
    bVar3 = true;
  }
  *(undefined4 *)((longlong)param_1 + 0x1c64) = *(undefined4 *)(param_2 + 0x44);
  param_1[0x38d] = (longlong)*(int *)(param_2 + 0x3c);
  if (((*(int *)((longlong)param_1 + 300) == 0x3c) && (plVar11 != (longlong *)0x0)) &&
     ((*(int *)((longlong)plVar11 + 300) == 0x3b && (*(uint *)(plVar11 + 0x1af) < 2)))) {
    local_fc = 6;
  }
  else if (local_fc == 8) {
LAB_140225a95:
    local_fc = 2;
  }
  else if (iVar9 == 7) {
    local_104 = 0;
    local_fc = 5;
  }
  else if ((local_fc != 7) && (local_fc != 9)) {
    if ((*(int *)((longlong)param_1 + 300) == 0x20) && (!bVar3)) goto LAB_140225a95;
    if ((*(char *)((longlong)param_1 + 0x601) == '\0') && ((char)param_1[0xc0] == '\0')) {
      local_fc = 0;
      if (bVar3) {
        local_fc = 1;
      }
    }
    else {
      bVar17 = plVar11 != (longlong *)0x0;
      if (bVar17) {
        (**(code **)(*plVar11 + 0xa40))(plVar11);
      }
      if (fVar19 <= 0.0) {
        local_fc = 4;
      }
      else {
        local_fc = 3;
      }
    }
  }
  (**(code **)(*param_1 + 0x118))
            (param_1,*(undefined4 *)(param_2 + 0x38),*(undefined4 *)(param_2 + 0x3c));
  (**(code **)(*param_1 + 0x138))
            (param_1,*(undefined4 *)(param_2 + 0x38),*(undefined4 *)(param_2 + 0x3c));
  iVar8 = (**(code **)(*param_1 + 0xb0))(param_1);
  if (iVar8 == 4) {
    if (0 < iVar9) {
      if (iVar9 < 3) {
LAB_140225b48:
        if (((((char)param_1[0xc0] == '\0') && (*(char *)((longlong)param_1 + 0x601) == '\0')) &&
            (local_res8 != '\x01')) &&
           (((local_fc == 0 || (local_fc == 1)) && (*(int *)((longlong)param_1 + 300) - 0x2fU < 3)))
           ) {
          FUN_1402265a0(param_1,param_2,iVar6);
          return 0;
        }
      }
      else if (iVar9 == 7) {
        cVar5 = FUN_140224f70(param_1,*(undefined4 *)(param_2 + 0x40));
        if (cVar5 == '\0') {
          if (*(int *)((longlong)param_1 + 300) != 10) {
            FUN_1402250f0(param_1,0x3d,param_2 + 0x28);
          }
          if (plVar11 != (longlong *)0x0) {
            (**(code **)(*plVar11 + 200))(plVar11,0x37,1);
          }
          return 0;
        }
      }
      else {
joined_r0x000140225ba1:
        if (iVar9 == 0xe) goto LAB_140225b48;
      }
    }
  }
  else if (0 < iVar9) {
    if (iVar9 < 3) goto LAB_140225b48;
    if (iVar9 != 7) goto joined_r0x000140225ba1;
    FUN_1402d7670(param_1,4);
  }
  cVar5 = (**(code **)(*param_1 + 0x9e8))(param_1,param_2,iVar6,iVar9);
  if (cVar5 == '\x01') {
    return 0;
  }
  if (plVar11 != (longlong *)0x0) {
    if (!bVar17) {
      (**(code **)(*plVar11 + 0xa38))(plVar11);
    }
    if (((*(char *)((longlong)param_1 + 0x601) == '\0') && ((char)param_1[0xc0] == '\0')) &&
       (((iVar9 < 7 || (8 < iVar9)) &&
        (cVar5 = FUN_1402251e0(plVar11,param_1 + 0x2f), cVar5 != '\0')))) {
      (**(code **)(*plVar11 + 0xa20))(plVar11);
    }
  }
  *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
  *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
  *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
  *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
  *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
  *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
  switch(local_fc) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 4:
  case 6:
  case 8:
  case 9:
    (**(code **)(*param_1 + 0x290))(param_1);
    break;
  case 5:
    if (*(longlong *)(param_2 + 0x90) != 0) {
      *(undefined4 *)(param_1 + 0x345) =
           *(undefined4 *)(*(longlong *)(*(longlong *)(param_2 + 0x90) + 0x3f0) + 0x10);
    }
    goto LAB_140225cca;
  case 7:
    *(int *)(param_1 + 0x345) = iVar6;
LAB_140225cca:
    iVar6 = 0;
  }
  if (param_1[0x38f] != *(longlong *)(param_2 + 0x80)) {
    FUN_14023ac70(param_1 + 0x38f,param_2 + 0x80);
  }
  local_e0 = 7;
  local_e8 = 0;
  local_f8 = 0;
  switch(local_100) {
  case 1:
    pwVar14 = L"(PHYSICAL)";
    break;
  case 2:
    pwVar14 = L"(MAGIC)";
    break;
  case 3:
    pwVar14 = L"(FIRE)";
    break;
  case 4:
    pwVar14 = L"(WATER)";
    break;
  case 5:
    pwVar14 = L"(LIGHT)";
    break;
  default:
    goto switchD_140225d25_caseD_6;
  case 7:
    pwVar14 = L"(EARTH)";
    break;
  case 8:
    pwVar14 = L"(WINDY)";
    break;
  case 9:
    pwVar14 = L"(TOXICATION)";
    break;
  case 10:
    pwVar14 = L"(LIGHTNING)";
  }
  FUN_140001710(&local_f8,pwVar14);
switchD_140225d25_caseD_6:
  if (0 < iVar6) {
    *(int *)((longlong)param_1 + 0x1e34) = iVar6;
  }
  lVar12 = param_1[0x16f];
  if (((*(char *)(*(longlong *)(lVar12 + 0x1a8) + 0x20) != '\0') ||
      (*(char *)(*(longlong *)(lVar12 + 0x1a0) + 0x20) != '\0')) ||
     (*(char *)(*(longlong *)(lVar12 + 0x1e8) + 0x20) != '\0')) {
    if (iVar9 == 7) {
LAB_14022634e:
      if (7 < local_e0) {
        operator_delete((void *)CONCAT62(uStack_f6,local_f8));
      }
      return 0;
    }
    plVar11 = (longlong *)
              (**(code **)(*param_1 + 0x430))
                        (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    if (plVar11 != (longlong *)0x0) {
      (**(code **)(*plVar11 + 0xb0))(plVar11);
    }
    plVar11 = (longlong *)FUN_140218af0(param_1);
    if (plVar11 != (longlong *)0x0) {
      (**(code **)(*plVar11 + 0xb0))(plVar11);
    }
LAB_1402263ae:
    if (7 < local_e0) {
      operator_delete((void *)CONCAT62(uStack_f6,local_f8));
    }
    return 1;
  }
  if (*(char *)((longlong)param_1 + 0x186a) == '\0') goto LAB_1402263ae;
  if (local_fc == 0) {
    *(int *)(param_1 + 0x308) = (int)param_1[0x308] + iVar6;
    param_1[0x309] = param_1[0xa2];
    iVar6 = *(int *)(param_2 + 0x54);
    if (iVar6 == 2) {
      fVar19 = (float)(int)param_1[0x308] /
               (((float)((int)param_1[0x116] + (int)param_1[0xc3]) +
                *(float *)((longlong)param_1 + 0x59c)) *
                (*(float *)((longlong)param_1 + 0x8ec) + *(float *)((longlong)param_1 + 0x734) + 1.0
                + 0.0001) + (float)(int)param_1[0x10d] + (float)*(int *)((longlong)param_1 + 0x88c))
      ;
      if (*(float *)(param_1[0x26] + 0x154) <= fVar19 && fVar19 != *(float *)(param_1[0x26] + 0x154)
         ) {
        *(undefined4 *)(param_1 + 0x308) = 0;
        (**(code **)(*param_1 + 200))(param_1,0x1f);
        goto LAB_1402263ae;
      }
    }
    else {
      if (iVar6 == 3) {
        *(undefined4 *)(param_1 + 0x308) = 0;
        (**(code **)(*param_1 + 200))(param_1,0x1f);
        goto LAB_1402263ae;
      }
      if (iVar6 == 4) goto LAB_14022634e;
    }
  }
  switch(*(undefined4 *)((longlong)param_1 + 300)) {
  case 10:
  case 0xf:
  case 0x10:
  case 0x12:
  case 0x14:
  case 0x15:
  case 0x16:
    cVar5 = (**(code **)(*param_1 + 0x438))(param_1);
    if (((cVar5 != '\0') || ((char)param_1[0x19a] != '\0')) || (local_104 < (int)param_1[0x3d6]))
    goto LAB_1402263ae;
    break;
  case 0xd:
    cVar5 = (**(code **)(*param_1 + 0x438))(param_1);
    if ((cVar5 != '\0') || ((char)param_1[0x19a] != '\0')) goto LAB_1402263ae;
    if (local_104 < (int)param_1[0x3d6]) {
      if (iVar9 == 7) goto LAB_14022634e;
      goto LAB_1402263ae;
    }
  }
  uVar15 = 1;
  switch(local_fc) {
  case 1:
    FUN_140232750(param_1);
    uVar16 = 0x24;
    goto LAB_14022631e;
  case 2:
    if (plVar11 != (longlong *)0x0) {
      *(undefined1 *)(param_1 + 0x27f) = 1;
      local_c8 = *(uint *)((longlong)plVar11 + 0x15c) ^ 0x80000000;
      local_cc = *(uint *)(plVar11 + 0x2b) ^ 0x80000000;
      local_d0 = *(uint *)((longlong)plVar11 + 0x154) ^ 0x80000000;
      (**(code **)(*param_1 + 0x100))(param_1,&local_d0);
      *(undefined1 *)(param_1 + 0x27f) = 0;
      *(undefined4 *)((longlong)param_1 + 0x17c) = *(undefined4 *)((longlong)plVar11 + 0x17c);
    }
    (**(code **)(*param_1 + 200))(param_1,0x22,1);
    break;
  case 3:
    FUN_14023ac20(param_2 + 0x80);
    FUN_140232810(param_1);
    uVar16 = 0x23;
    goto LAB_14022631e;
  case 4:
    FUN_14023ac20(param_2 + 0x80);
    FUN_140232810(param_1);
    uVar16 = 0x1c;
    goto LAB_14022631e;
  case 5:
    if (plVar11 == (longlong *)0x0) break;
    iVar9 = (**(code **)(*plVar11 + 0xb0))(plVar11);
    lVar12 = *plVar11;
    if (iVar9 == 4) {
      uVar10 = (**(code **)(*param_1 + 0xb0))();
      (**(code **)(lVar12 + 0x148))(plVar11,uVar10,(int)param_1[0x25]);
      cVar5 = (**(code **)(*plVar11 + 200))(plVar11,0x36,1);
      if (cVar5 == '\x01') {
        FUN_140001710(param_1 + 700,&DAT_14049dca8,6);
        uVar16 = 0;
        uVar15 = 0x2a;
        goto LAB_1402261be;
      }
    }
    else {
      uVar10 = (**(code **)(*param_1 + 0xb0))(param_1);
      (**(code **)(lVar12 + 0x148))(plVar11,uVar10,(int)param_1[0x25]);
      (**(code **)(*plVar11 + 200))(plVar11,0x39,1);
      lVar4 = plVar11[0x25];
      lVar12 = *param_1;
      uVar10 = (**(code **)(*plVar11 + 0xb0))(plVar11);
      (**(code **)(lVar12 + 0x160))(param_1,uVar10,(int)lVar4);
      uVar16 = 1;
      uVar15 = 0x3c;
LAB_1402261be:
      (**(code **)(*param_1 + 200))(param_1,uVar15,uVar16);
    }
    uVar15 = 0;
    break;
  case 6:
    (**(code **)(*param_1 + 200))(param_1,0x3e,1);
    uVar15 = 1;
    break;
  case 7:
    if (plVar11 != (longlong *)0x0) {
      *(undefined1 *)(param_1 + 0x27f) = 1;
      local_bc = *(uint *)((longlong)plVar11 + 0x15c) ^ 0x80000000;
      local_c0 = *(uint *)(plVar11 + 0x2b) ^ 0x80000000;
      local_c4 = *(uint *)((longlong)plVar11 + 0x154) ^ 0x80000000;
      (**(code **)(*param_1 + 0x100))(param_1,&local_c4);
      *(undefined1 *)(param_1 + 0x27f) = 0;
    }
    FUN_140232750(param_1);
    (**(code **)(*param_1 + 200))(param_1,0x2b,1);
    uVar15 = 0;
    break;
  default:
    if (*(int *)(param_1[0x26] + 0x85c) == 1) {
      dVar1 = (double)param_1[0xa2];
      dVar2 = (double)param_1[0x166];
      fVar19 = (float)(**(code **)(*param_1 + 0x360))(param_1);
      if ((double)fVar19 < dVar1 - dVar2) {
        (**(code **)(*param_1 + 0x390))(param_1,param_1[0xa2],0);
        break;
      }
      uVar16 = 0x1d;
    }
    else {
      uVar16 = 0x1d;
    }
LAB_14022631e:
    FUN_1402250f0(param_1,uVar16,param_2 + 0x28);
    break;
  case 9:
    FUN_140232750(param_1);
    (**(code **)(*param_1 + 200))(param_1,99,1);
    uVar15 = 1;
  }
  *(undefined4 *)(param_1 + 0x38e) = 0;
  if (7 < local_e0) {
    operator_delete((void *)CONCAT62(uStack_f6,local_f8));
  }
  return uVar15;
}



void FUN_1402264b0(longlong *param_1,short *param_2,undefined8 param_3,undefined8 param_4)

{
  short sVar1;
  ulonglong uVar2;
  undefined4 uVar3;
  short *psVar4;
  
  (**(code **)(*param_1 + 0x100))(param_1,param_4);
  uVar2 = 0xffffffffffffffff;
  psVar4 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2a8,param_2,~uVar2 - 1);
  (**(code **)(*param_1 + 0x290))(param_1);
  uVar3 = 0x25;
  if (1.0 < *(float *)(param_1 + 0xb3) || *(float *)(param_1 + 0xb3) == 1.0) {
    uVar3 = 0x1d;
  }
                    // WARNING: Could not recover jumptable at 0x000140226548. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(param_1,uVar3);
  return;
}



void FUN_140226550(longlong param_1,longlong param_2)

{
  FUN_1400015e0(param_1 + 0x1590,param_2 + 0x280,0,0xffffffffffffffff);
  *(longlong *)(param_1 + 0x1ea8) = param_2;
  *(undefined4 *)(param_2 + 0x278) = 0;
  return;
}



ulonglong FUN_1402265a0(longlong *param_1,longlong param_2,int param_3)

{
  float fVar1;
  longlong lVar2;
  ulonglong in_RAX;
  longlong *plVar3;
  float *pfVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  float local_res8 [2];
  float local_res20 [2];
  float local_58 [16];
  
  if (param_1[0x26] == 0) {
    return in_RAX & 0xffffffffffffff00;
  }
  local_58[1] = 0.0;
  local_58[0] = *(float *)(param_1 + 0x2f) - *(float *)(param_2 + 0x28);
  local_58[2] = *(float *)(param_1 + 0x30) - *(float *)(param_2 + 0x30);
  (**(code **)(*param_1 + 0x8e8))(local_58[2],local_58);
  lVar2 = param_1[0x27f];
  *(undefined1 *)(param_1 + 0x27f) = 1;
  (**(code **)(*param_1 + 0x100))(param_1,local_58);
  *(char *)(param_1 + 0x27f) = (char)lVar2;
  param_1[0x30c] = param_1[0xa2];
  if (*(int *)((longlong)param_1 + 300) == 0x31) {
    (**(code **)(*param_1 + 0xa50))(param_1);
    if (*(char *)(param_2 + 0x5c) == '\0') {
      plVar3 = (longlong *)FUN_140218af0(param_1);
      if (plVar3 != (longlong *)0x0) {
        (**(code **)(*plVar3 + 200))(plVar3,0x32);
      }
    }
    param_1[0x3cb] = 0;
  }
  else {
    local_res8[0] = 1.0;
    pfVar4 = local_res8;
    local_res20[0] = (1.0 - *(float *)(param_1[0x26] + 0x7f0)) * (float)param_3;
    if (1.0 <= local_res20[0]) {
      pfVar4 = local_res20;
    }
    fVar1 = *pfVar4;
    (**(code **)(*param_1 + 0x290))(param_1);
    *(int *)((longlong)param_1 + 0x185c) =
         *(int *)((longlong)param_1 + 0x185c) + (int)((float)param_3 - fVar1);
    if (((int)((((float)((int)param_1[0x116] + (int)param_1[0xc3]) +
                *(float *)((longlong)param_1 + 0x59c)) *
                (*(float *)((longlong)param_1 + 0x8ec) + *(float *)((longlong)param_1 + 0x734) + 1.0
                + 0.0001) + (float)(int)param_1[0x10d] + (float)*(int *)((longlong)param_1 + 0x88c))
              * *(float *)(param_1[0x26] + 0x7ec)) <= *(int *)((longlong)param_1 + 0x185c)) &&
       (uVar6 = 0x32, *(int *)((longlong)param_1 + 300) == 0x2f)) goto LAB_1402267ec;
  }
  uVar6 = 0x2f;
LAB_1402267ec:
  uVar5 = (**(code **)(*param_1 + 200))(param_1,uVar6,0);
  return uVar5;
}



void FUN_140226810(longlong param_1)

{
  uint uVar1;
  
  *(undefined4 *)(param_1 + 0x1390) = 0x3f800000;
  *(undefined8 *)(param_1 + 5000) = 0;
  *(undefined8 *)(param_1 + 0x1380) = 0;
  *(undefined8 *)(param_1 + 0x1374) = 0;
  *(undefined8 *)(param_1 + 0x136c) = 0;
  *(undefined8 *)(param_1 + 0x1360) = 0;
  *(undefined8 *)(param_1 + 0x1358) = 0;
  *(undefined4 *)(param_1 + 0x137c) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x1368) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x1354) = 0x3f800000;
  D3DXVec3Normalize(param_1 + 0x1348,param_1 + 0x1348);
  *(undefined4 *)(param_1 + 0x1374) = *(undefined4 *)(param_1 + 0x1348);
  *(undefined4 *)(param_1 + 0x1378) = *(undefined4 *)(param_1 + 0x134c);
  *(undefined4 *)(param_1 + 0x137c) = *(undefined4 *)(param_1 + 0x1350);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)(param_1 + 0x1374);
  DAT_1406081a4 = *(float *)(param_1 + 0x1378);
  DAT_1406081a8 = *(float *)(param_1 + 0x137c);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081a8 - DAT_1406081a4 * 0.0;
  DAT_140608020 = DAT_1406081a4 * 0.0 - DAT_1406081a0;
  DAT_140608018._4_4_ = DAT_1406081a0 * 0.0 - DAT_1406081a8 * 0.0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  uVar1 = DAT_1406081bc;
  DAT_1406081c0 = DAT_1406081b0;
  *(float *)(param_1 + 0x1354) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x1358) = DAT_1406081b4;
  *(undefined4 *)(param_1 + 0x135c) = DAT_1406081b8;
  if ((uVar1 & 1) == 0) {
    DAT_1406081bc = uVar1 | 1;
  }
  DAT_1406081c4 = *(float *)(param_1 + 0x1358);
  DAT_1406081c8 = *(float *)(param_1 + 0x135c);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)(param_1 + 0x1374);
  DAT_1406081a4 = *(float *)(param_1 + 0x1378);
  DAT_1406081a8 = *(float *)(param_1 + 0x137c);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081c8 * DAT_1406081a4 - DAT_1406081c4 * DAT_1406081a8;
  DAT_140608020 = DAT_1406081c4 * DAT_1406081a0 - DAT_1406081c0 * DAT_1406081a4;
  DAT_140608018._4_4_ = DAT_1406081c0 * DAT_1406081a8 - DAT_1406081c8 * DAT_1406081a0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  *(float *)(param_1 + 0x1364) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x1368) = DAT_1406081b4;
  *(undefined4 *)(param_1 + 0x136c) = DAT_1406081b8;
  *(undefined4 *)(param_1 + 0x1384) = *(undefined4 *)(param_1 + 0x178);
  *(undefined4 *)(param_1 + 5000) = *(undefined4 *)(param_1 + 0x17c);
  *(undefined4 *)(param_1 + 0x138c) = *(undefined4 *)(param_1 + 0x180);
  *(undefined8 *)(param_1 + 0x13c8) = 0;
  *(undefined8 *)(param_1 + 0x13c0) = 0;
  *(undefined8 *)(param_1 + 0x13b4) = 0;
  *(undefined8 *)(param_1 + 0x13ac) = 0;
  *(undefined8 *)(param_1 + 0x13a0) = 0;
  *(undefined8 *)(param_1 + 0x1398) = 0;
  *(undefined4 *)(param_1 + 0x13d0) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x13bc) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x13a8) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x1394) = 0x3f800000;
  D3DXVec3Normalize(param_1 + 0x160,param_1 + 0x160);
  *(undefined4 *)(param_1 + 0x13b4) = *(undefined4 *)(param_1 + 0x160);
  *(undefined4 *)(param_1 + 0x13b8) = *(undefined4 *)(param_1 + 0x164);
  *(undefined4 *)(param_1 + 0x13bc) = *(undefined4 *)(param_1 + 0x168);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)(param_1 + 0x13b4);
  DAT_1406081a4 = *(float *)(param_1 + 0x13b8);
  DAT_1406081a8 = *(float *)(param_1 + 0x13bc);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081a8 - DAT_1406081a4 * 0.0;
  DAT_140608020 = DAT_1406081a4 * 0.0 - DAT_1406081a0;
  DAT_140608018._4_4_ = DAT_1406081a0 * 0.0 - DAT_1406081a8 * 0.0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  uVar1 = DAT_1406081bc;
  DAT_1406081c0 = DAT_1406081b0;
  *(float *)(param_1 + 0x1394) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x1398) = DAT_1406081b4;
  *(undefined4 *)(param_1 + 0x139c) = DAT_1406081b8;
  if ((uVar1 & 1) == 0) {
    DAT_1406081bc = uVar1 | 1;
  }
  DAT_1406081c4 = *(float *)(param_1 + 0x1398);
  DAT_1406081c8 = *(float *)(param_1 + 0x139c);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)(param_1 + 0x13b4);
  DAT_1406081a4 = *(float *)(param_1 + 0x13b8);
  DAT_1406081a8 = *(float *)(param_1 + 0x13bc);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081c8 * DAT_1406081a4 - DAT_1406081c4 * DAT_1406081a8;
  DAT_140608020 = DAT_1406081c4 * DAT_1406081a0 - DAT_1406081c0 * DAT_1406081a4;
  DAT_140608018._4_4_ = DAT_1406081c0 * DAT_1406081a8 - DAT_1406081c8 * DAT_1406081a0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  *(float *)(param_1 + 0x13a4) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x13a8) = DAT_1406081b4;
  *(undefined4 *)(param_1 + 0x13ac) = DAT_1406081b8;
  *(undefined4 *)(param_1 + 0x13c4) = *(undefined4 *)(param_1 + 0x178);
  *(undefined4 *)(param_1 + 0x13c8) = *(undefined4 *)(param_1 + 0x17c);
  *(undefined4 *)(param_1 + 0x13cc) = *(undefined4 *)(param_1 + 0x180);
  FUN_140218260(param_1,param_1 + 0x178);
  return;
}



void FUN_140226e10(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  void *pvVar8;
  float fVar9;
  longlong lVar10;
  undefined8 uVar11;
  float local_80;
  float fStack_7c;
  float local_78;
  undefined8 local_70;
  ulonglong local_68;
  undefined8 local_60;
  
  uVar11 = 0xfffffffffffffffe;
  if (param_1[0x3d0] == 0) {
    return;
  }
  if (param_1[0x26] == 0) {
    return;
  }
  lVar3 = *(longlong *)(param_1[0x3d0] + 0x30);
  if (lVar3 == 0) {
    return;
  }
  if (*(longlong *)(lVar3 + 0x2d0) == 0) {
    return;
  }
  lVar3 = *(longlong *)(lVar3 + 0x2d0);
  if (lVar3 == 0) {
    return;
  }
  fVar9 = (float)(((double)param_1[0xa2] - (double)param_1[0x313]) / (double)param_1[0x314]);
  if (1.0 <= fVar9) {
    pvVar8 = (void *)0x0;
    local_70 = (void *)0x0;
    local_68 = local_68 & 0xffffffffffffff00;
    cVar4 = FUN_140195920(param_1 + 0x25d);
    if (cVar4 != '\0') {
      pvVar8 = (void *)FUN_140195970(param_1 + 0x25d);
      local_68 = local_68 & 0xffffffffffffff00;
      local_70 = pvVar8;
      FUN_14034ed40(pvVar8);
      local_68 = CONCAT71(local_68._1_7_,1);
    }
    if ((param_1[0x315] == param_1[0x316]) || (*(int *)(param_1[0x315] + 4) != 4)) {
      FUN_14021eb20(param_1,0,0);
    }
    fVar9 = 1.0;
    if (cVar4 != '\0') {
      FUN_14034edd0(pvVar8);
    }
  }
  local_80 = (*(float *)(param_1 + 0x311) - *(float *)((longlong)param_1 + 0x187c)) * fVar9 +
             *(float *)((longlong)param_1 + 0x187c);
  fStack_7c = (*(float *)((longlong)param_1 + 0x188c) - *(float *)(param_1 + 0x310)) * fVar9 +
              *(float *)(param_1 + 0x310);
  local_78 = (*(float *)(param_1 + 0x312) - *(float *)((longlong)param_1 + 0x1884)) * fVar9 +
             *(float *)((longlong)param_1 + 0x1884);
  iVar5 = (**(code **)(*param_1 + 0xb0))(param_1);
  if (iVar5 != 1) {
    *(float *)(param_1 + 0x2f) = local_80;
    *(float *)((longlong)param_1 + 0x17c) = fStack_7c;
    *(float *)(param_1 + 0x30) = local_78;
    goto LAB_1402271b9;
  }
  local_70._0_4_ = local_80;
  local_70._4_4_ = fStack_7c;
  local_68 = CONCAT44(local_68._4_4_,local_78);
  plVar1 = param_1 + 0xa4;
  lVar2 = (longlong)param_1 + 0x524;
  lVar10 = lVar2;
  iVar5 = FUN_1402f98b0(param_1,&local_70,param_1 + 0x2f,&local_80,lVar2,plVar1,1,0x447a0000,uVar11)
  ;
  uVar7 = (undefined4)((ulonglong)lVar10 >> 0x20);
  if (iVar5 == 0) {
    local_78 = *(float *)(param_1 + 0x30);
    lVar10 = lVar2;
    iVar5 = FUN_1402f98b0(param_1,&local_70,param_1 + 0x2f,&local_80,lVar2,plVar1,1,0x447a0000,
                          uVar11);
    uVar7 = (undefined4)((ulonglong)lVar10 >> 0x20);
    if (iVar5 == 0) {
      local_80 = *(float *)(param_1 + 0x2f);
      lVar10 = lVar2;
      iVar5 = FUN_1402f98b0(param_1,&local_70,param_1 + 0x2f,&local_80,lVar2,plVar1,1,0x447a0000,
                            uVar11);
      uVar7 = (undefined4)((ulonglong)lVar10 >> 0x20);
      if (iVar5 != 0) {
        *(undefined4 *)(param_1 + 0x30) = (undefined4)local_68;
        goto LAB_1402270f8;
      }
    }
    else {
      *(float *)(param_1 + 0x2f) = (float)local_70;
LAB_1402270f8:
      if (*(float *)((longlong)param_1 + 0x17c) - local_70._4_4_ <=
          *(float *)(param_1[0x26] + 0x2a0)) {
        *(float *)((longlong)param_1 + 0x17c) = local_70._4_4_;
      }
    }
    *(int *)((longlong)param_1 + 0x184) = (int)param_1[0x2f];
    *(undefined4 *)(param_1 + 0x31) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)((longlong)param_1 + 0x18c) = (int)param_1[0x30];
  }
  else {
    *(float *)(param_1 + 0x2f) = (float)local_70;
    *(undefined4 *)(param_1 + 0x30) = (undefined4)local_68;
    if (*(float *)((longlong)param_1 + 0x17c) - local_70._4_4_ <= *(float *)(param_1[0x26] + 0x2a0))
    {
      *(float *)((longlong)param_1 + 0x17c) = local_70._4_4_;
    }
  }
  local_70 = (void *)0x0;
  local_68 = 0;
  local_60 = 0;
  uVar6 = (**(code **)(*param_1 + 0x80))(param_1);
  uVar7 = FUN_1402bec00(lVar3 + 0x370,&local_70,lVar2,param_1 + 0x2f,CONCAT44(uVar7,uVar6));
  *(undefined4 *)plVar1 = uVar7;
  if (local_70 != (void *)0x0) {
    operator_delete(local_70);
  }
LAB_1402271b9:
  (**(code **)(*param_1 + 0x8d0))(param_1,param_2,param_3);
  return;
}



void FUN_140227200(longlong *param_1,undefined8 param_2,double param_3,undefined1 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  bool bVar3;
  float fVar4;
  int iVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  float *pfVar8;
  double dVar9;
  float fVar10;
  longlong lVar11;
  undefined8 uVar12;
  float local_c0;
  float local_bc;
  float local_b8;
  undefined4 local_b0;
  float local_ac;
  undefined4 local_a8;
  undefined8 local_a0;
  float local_98;
  float local_90;
  float fStack_8c;
  float local_88;
  void *local_80;
  undefined8 local_78;
  undefined8 local_70;
  
  uVar12 = 0xfffffffffffffffe;
  if (param_1[0x3d0] == 0) {
    return;
  }
  lVar2 = *(longlong *)(param_1[0x3d0] + 0x30);
  if (lVar2 == 0) {
    return;
  }
  if (*(longlong *)(lVar2 + 0x2d0) == 0) {
    return;
  }
  lVar2 = *(longlong *)(lVar2 + 0x2d0);
  if (lVar2 == 0) {
    return;
  }
  if (param_1[0x26] == 0) {
    return;
  }
  dVar9 = (double)param_1[0x28a];
  bVar3 = false;
  switch(*(undefined4 *)((longlong)param_1 + 300)) {
  case 3:
  case 4:
  case 0x18:
  case 0x3a:
  case 0x4b:
  case 0x52:
    bVar3 = true;
    dVar9 = (double)(**(code **)(*param_1 + 0x2d0))(param_1);
  }
  local_c0 = 0.0;
  local_bc = 0.0;
  local_b8 = 1.0;
  if (((*(int *)((longlong)param_1 + 300) == 0x1b) || ((char)param_1[0xc0] != '\0')) || (bVar3)) {
    D3DXVec3TransformNormal(&local_c0,&local_c0,(longlong)param_1 + 0x1394);
    fVar10 = (float)(dVar9 * param_3) * *(float *)(param_1 + 0x3ca);
    local_b8 = local_b8 * fVar10;
    local_bc = local_bc * fVar10;
    local_c0 = local_c0 * fVar10;
  }
  else {
    lVar11 = param_1[0x27b];
    pfVar8 = (float *)FUN_1402cc100(*(undefined8 *)(lVar11 + 0x20),&local_90,(float)dVar9,
                                    (longlong)param_1 + 0x1394);
    local_c0 = *(float *)(lVar11 + 0xfc);
    local_b8 = local_c0 * pfVar8[2];
    local_bc = local_c0 * pfVar8[1];
    local_c0 = local_c0 * *pfVar8;
  }
  local_98 = *(float *)(param_1 + 0x30) - local_b8;
  fVar10 = *(float *)((longlong)param_1 + 0x17c) - local_bc;
  local_a0 = CONCAT44(fVar10,*(float *)(param_1 + 0x2f) - local_c0);
  *(float *)((longlong)param_1 + 0x184) = *(float *)(param_1 + 0x2f) - local_c0;
  *(float *)(param_1 + 0x31) = fVar10;
  *(float *)((longlong)param_1 + 0x18c) = local_98;
  local_88 = *(float *)(param_1 + 0x30) - local_b8;
  fStack_8c = *(float *)((longlong)param_1 + 0x17c) - local_bc;
  local_90 = *(float *)(param_1 + 0x2f) - local_c0;
  local_b0 = (undefined4)param_1[0x2f];
  local_ac = *(float *)((longlong)param_1 + 0x17c);
  local_a8 = (undefined4)param_1[0x30];
  plVar1 = param_1 + 0xa4;
  lVar11 = (longlong)param_1 + 0x524;
  iVar5 = FUN_1402f98b0(param_1,&local_b0,param_1 + 0x2f,&local_90,lVar11,plVar1,param_4,0x447a0000,
                        uVar12);
  fVar4 = local_88;
  fVar10 = fStack_8c;
  uVar7 = (undefined4)((ulonglong)lVar11 >> 0x20);
  if (iVar5 != 0) {
    *(undefined4 *)(param_1 + 0x2f) = local_b0;
    *(undefined4 *)(param_1 + 0x30) = local_a8;
    if (*(float *)((longlong)param_1 + 0x17c) - local_ac <= *(float *)(param_1[0x26] + 0x2a0)) {
      *(float *)((longlong)param_1 + 0x17c) = local_ac;
    }
    goto LAB_140227603;
  }
  local_a0 = CONCAT44(fStack_8c,local_90);
  local_98 = *(float *)(param_1 + 0x30);
  lVar11 = (longlong)param_1 + 0x524;
  iVar5 = FUN_1402f98b0(param_1,&local_b0,param_1 + 0x2f,&local_a0,lVar11,plVar1,param_4,0x447a0000,
                        uVar12);
  uVar7 = (undefined4)((ulonglong)lVar11 >> 0x20);
  if (iVar5 == 0) {
    local_98 = fVar4;
    local_a0 = CONCAT44(fVar10,(int)param_1[0x2f]);
    lVar11 = (longlong)param_1 + 0x524;
    iVar5 = FUN_1402f98b0(param_1,&local_b0,param_1 + 0x2f,&local_a0,lVar11,plVar1,param_4,
                          0x447a0000);
    uVar7 = (undefined4)((ulonglong)lVar11 >> 0x20);
    if (iVar5 != 0) {
      *(undefined4 *)(param_1 + 0x30) = local_a8;
      goto LAB_1402275b2;
    }
  }
  else {
    *(undefined4 *)(param_1 + 0x2f) = local_b0;
LAB_1402275b2:
    if (*(float *)((longlong)param_1 + 0x17c) - local_ac <= *(float *)(param_1[0x26] + 0x2a0)) {
      *(float *)((longlong)param_1 + 0x17c) = local_ac;
    }
  }
  *(int *)((longlong)param_1 + 0x184) = (int)param_1[0x2f];
  *(undefined4 *)(param_1 + 0x31) = *(undefined4 *)((longlong)param_1 + 0x17c);
  *(int *)((longlong)param_1 + 0x18c) = (int)param_1[0x30];
LAB_140227603:
  local_80 = (void *)0x0;
  local_78 = 0;
  local_70 = 0;
  uVar6 = (**(code **)(*param_1 + 0x80))(param_1);
  uVar7 = FUN_1402bec00(lVar2 + 0x370,&local_80,(longlong)param_1 + 0x524,param_1 + 0x2f,
                        CONCAT44(uVar7,uVar6));
  *(undefined4 *)plVar1 = uVar7;
  (**(code **)(*param_1 + 0x8d0))(param_1,param_2,param_3);
  if (local_80 != (void *)0x0) {
    operator_delete(local_80);
  }
  return;
}



undefined1 FUN_1402276f0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  if ((char)param_1[10] == '\0') {
    return (char)param_1[10];
  }
  FUN_1402bcc60();
  if ((char)param_1[10] != '\0') {
    (**(code **)(*param_1 + 0x100))(param_1,(longlong)param_1 + 0x34);
    FUN_14021e770(param_1,(longlong)param_1 + 0x34);
    (**(code **)(*param_1 + 0x8d0))(param_1,param_2,param_3);
    return (char)param_1[10];
  }
  return (char)param_1[10];
}



void FUN_1402277a0(longlong *param_1,undefined8 param_2,double param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float local_48;
  float local_40;
  
  fVar1 = *(float *)((longlong)param_1 + 0x133c);
  local_48 = *(float *)(param_1 + 0x269);
  fVar2 = atan2f(fVar1 * *(float *)(param_1 + 0x26a) -
                 local_48 * *(float *)((longlong)param_1 + 0x1344),
                 local_48 * fVar1 +
                 *(float *)((longlong)param_1 + 0x1344) * *(float *)(param_1 + 0x26a));
  fVar2 = ABS((fVar2 * 180.0) / 3.1415927);
  if (fVar2 <= 10.0) {
    *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x133c);
    *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x268];
    *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x1344);
  }
  else {
    fVar3 = (float)((double)(fVar2 / 180.0) * (double)param_1[0x28b] * param_3);
    local_40 = (*(float *)((longlong)param_1 + 0x1344) - *(float *)(param_1 + 0x26a)) * fVar3 +
               *(float *)(param_1 + 0x26a);
    local_48 = (fVar1 - local_48) * fVar3 + local_48;
    if ((177.0 < fVar2) && (fVar2 < 183.0)) {
      local_48 = local_48 + 0.3;
      local_40 = local_40 + 0.1;
    }
    *(float *)(param_1 + 0x269) = local_48;
    *(float *)((longlong)param_1 + 0x134c) =
         (*(float *)(param_1 + 0x268) - *(float *)((longlong)param_1 + 0x134c)) * fVar3 +
         *(float *)((longlong)param_1 + 0x134c);
    *(float *)(param_1 + 0x26a) = local_40;
    D3DXVec3Normalize(param_1 + 0x269,param_1 + 0x269);
  }
  *(undefined4 *)((longlong)param_1 + 0x134c) = 0;
                    // WARNING: Could not recover jumptable at 0x000140227963. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x1f0))(param_1);
  return;
}



void thunk_FUN_140226e10(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  void *pvVar8;
  float fVar9;
  longlong lVar10;
  undefined8 uVar11;
  float fStack_80;
  float fStack_7c;
  float fStack_78;
  undefined8 uStack_70;
  ulonglong uStack_68;
  undefined8 uStack_60;
  
  uVar11 = 0xfffffffffffffffe;
  if (param_1[0x3d0] == 0) {
    return;
  }
  if (param_1[0x26] == 0) {
    return;
  }
  lVar3 = *(longlong *)(param_1[0x3d0] + 0x30);
  if (lVar3 == 0) {
    return;
  }
  if (*(longlong *)(lVar3 + 0x2d0) == 0) {
    return;
  }
  lVar3 = *(longlong *)(lVar3 + 0x2d0);
  if (lVar3 == 0) {
    return;
  }
  fVar9 = (float)(((double)param_1[0xa2] - (double)param_1[0x313]) / (double)param_1[0x314]);
  if (1.0 <= fVar9) {
    pvVar8 = (void *)0x0;
    uStack_70 = (void *)0x0;
    uStack_68 = uStack_68 & 0xffffffffffffff00;
    cVar4 = FUN_140195920(param_1 + 0x25d);
    if (cVar4 != '\0') {
      pvVar8 = (void *)FUN_140195970(param_1 + 0x25d);
      uStack_68 = uStack_68 & 0xffffffffffffff00;
      uStack_70 = pvVar8;
      FUN_14034ed40(pvVar8);
      uStack_68 = CONCAT71(uStack_68._1_7_,1);
    }
    if ((param_1[0x315] == param_1[0x316]) || (*(int *)(param_1[0x315] + 4) != 4)) {
      FUN_14021eb20(param_1,0,0);
    }
    fVar9 = 1.0;
    if (cVar4 != '\0') {
      FUN_14034edd0(pvVar8);
    }
  }
  fStack_80 = (*(float *)(param_1 + 0x311) - *(float *)((longlong)param_1 + 0x187c)) * fVar9 +
              *(float *)((longlong)param_1 + 0x187c);
  fStack_7c = (*(float *)((longlong)param_1 + 0x188c) - *(float *)(param_1 + 0x310)) * fVar9 +
              *(float *)(param_1 + 0x310);
  fStack_78 = (*(float *)(param_1 + 0x312) - *(float *)((longlong)param_1 + 0x1884)) * fVar9 +
              *(float *)((longlong)param_1 + 0x1884);
  iVar5 = (**(code **)(*param_1 + 0xb0))(param_1);
  if (iVar5 != 1) {
    *(float *)(param_1 + 0x2f) = fStack_80;
    *(float *)((longlong)param_1 + 0x17c) = fStack_7c;
    *(float *)(param_1 + 0x30) = fStack_78;
    goto LAB_1402271b9;
  }
  uStack_70._0_4_ = fStack_80;
  uStack_70._4_4_ = fStack_7c;
  uStack_68 = CONCAT44(uStack_68._4_4_,fStack_78);
  plVar1 = param_1 + 0xa4;
  lVar2 = (longlong)param_1 + 0x524;
  lVar10 = lVar2;
  iVar5 = FUN_1402f98b0(param_1,&uStack_70,param_1 + 0x2f,&fStack_80,lVar2,plVar1,1,0x447a0000,
                        uVar11);
  uVar7 = (undefined4)((ulonglong)lVar10 >> 0x20);
  if (iVar5 == 0) {
    fStack_78 = *(float *)(param_1 + 0x30);
    lVar10 = lVar2;
    iVar5 = FUN_1402f98b0(param_1,&uStack_70,param_1 + 0x2f,&fStack_80,lVar2,plVar1,1,0x447a0000,
                          uVar11);
    uVar7 = (undefined4)((ulonglong)lVar10 >> 0x20);
    if (iVar5 == 0) {
      fStack_80 = *(float *)(param_1 + 0x2f);
      lVar10 = lVar2;
      iVar5 = FUN_1402f98b0(param_1,&uStack_70,param_1 + 0x2f,&fStack_80,lVar2,plVar1,1,0x447a0000,
                            uVar11);
      uVar7 = (undefined4)((ulonglong)lVar10 >> 0x20);
      if (iVar5 != 0) {
        *(undefined4 *)(param_1 + 0x30) = (undefined4)uStack_68;
        goto LAB_1402270f8;
      }
    }
    else {
      *(float *)(param_1 + 0x2f) = (float)uStack_70;
LAB_1402270f8:
      if (*(float *)((longlong)param_1 + 0x17c) - uStack_70._4_4_ <=
          *(float *)(param_1[0x26] + 0x2a0)) {
        *(float *)((longlong)param_1 + 0x17c) = uStack_70._4_4_;
      }
    }
    *(int *)((longlong)param_1 + 0x184) = (int)param_1[0x2f];
    *(undefined4 *)(param_1 + 0x31) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)((longlong)param_1 + 0x18c) = (int)param_1[0x30];
  }
  else {
    *(float *)(param_1 + 0x2f) = (float)uStack_70;
    *(undefined4 *)(param_1 + 0x30) = (undefined4)uStack_68;
    if (*(float *)((longlong)param_1 + 0x17c) - uStack_70._4_4_ <= *(float *)(param_1[0x26] + 0x2a0)
       ) {
      *(float *)((longlong)param_1 + 0x17c) = uStack_70._4_4_;
    }
  }
  uStack_70 = (void *)0x0;
  uStack_68 = 0;
  uStack_60 = 0;
  uVar6 = (**(code **)(*param_1 + 0x80))(param_1);
  uVar7 = FUN_1402bec00(lVar3 + 0x370,&uStack_70,lVar2,param_1 + 0x2f,CONCAT44(uVar7,uVar6));
  *(undefined4 *)plVar1 = uVar7;
  if (uStack_70 != (void *)0x0) {
    operator_delete(uStack_70);
  }
LAB_1402271b9:
  (**(code **)(*param_1 + 0x8d0))(param_1,param_2,param_3);
  return;
}



void FUN_140227980(longlong *param_1)

{
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))();
  *(int *)(param_1 + 0x38b) = (int)param_1[0x2f];
  *(undefined4 *)((longlong)param_1 + 0x1c5c) = *(undefined4 *)((longlong)param_1 + 0x17c);
  *(int *)(param_1 + 0x38c) = (int)param_1[0x30];
  return;
}



void FUN_1402279d0(longlong *param_1,double param_2,undefined8 param_3)

{
  bool bVar1;
  longlong lVar2;
  int iVar3;
  float fVar4;
  float local_48;
  float local_44;
  float local_40;
  undefined1 local_38 [48];
  
  fVar4 = (float)((param_2 - (double)param_1[0x411]) /
                 ((double)param_1[0x412] - (double)param_1[0x411]));
  bVar1 = 1.0 <= fVar4;
  if (bVar1) {
    fVar4 = 1.0;
  }
  FUN_140123b20(local_38,param_1 + 0x40c,(longlong)param_1 + 0x206c,param_1 + 0x40f,fVar4);
  iVar3 = FUN_1402f98b0(param_1,&local_48,param_1 + 0x2f,local_38,(longlong)param_1 + 0x524,
                        param_1 + 0xa4,1,0x447a0000);
  if (iVar3 == 1) {
    FUN_14022ecd0(param_1,&local_48);
  }
  lVar2 = param_1[0x1fd];
  FUN_140230d70(param_1,param_2);
  if ((char)lVar2 == '\x01' || (iVar3 != 1 || bVar1)) {
    FUN_14021eb20(param_1,0,0);
  }
  local_48 = *(float *)(param_1 + 0x2f) - *(float *)(param_1 + 0x40f);
  local_44 = *(float *)((longlong)param_1 + 0x17c) - *(float *)((longlong)param_1 + 0x207c);
  local_40 = *(float *)(param_1 + 0x30) - *(float *)(param_1 + 0x410);
  *(float *)((longlong)param_1 + 0x154) = local_48;
  *(float *)(param_1 + 0x2b) = local_44;
  *(float *)((longlong)param_1 + 0x15c) = local_40;
  D3DXVec3Normalize((longlong)param_1 + 0x154,(longlong)param_1 + 0x154);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
  *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
  *(undefined1 *)(param_1 + 0x27f) = 1;
  *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
  *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x154);
  *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x2b];
  *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x15c);
  *(undefined4 *)((longlong)param_1 + 0x133c) = *(undefined4 *)((longlong)param_1 + 0x154);
  *(int *)(param_1 + 0x268) = (int)param_1[0x2b];
  *(undefined4 *)((longlong)param_1 + 0x1344) = *(undefined4 *)((longlong)param_1 + 0x15c);
  (**(code **)(*param_1 + 0x8d0))(param_1,param_2,param_3);
  return;
}



void FUN_140227c00(longlong *param_1)

{
                    // WARNING: Could not recover jumptable at 0x000140227c03. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x658))();
  return;
}



void FUN_140227c10(longlong *param_1,longlong param_2,undefined8 param_3)

{
  float fVar1;
  short sVar2;
  short sVar3;
  longlong lVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  short *psVar8;
  longlong lVar9;
  ulonglong uVar10;
  longlong *plVar11;
  longlong lVar12;
  undefined4 uVar13;
  float fVar14;
  
  plVar11 = param_1 + 0x368;
  if (7 < (ulonglong)param_1[0x36b]) {
    plVar11 = (longlong *)*plVar11;
  }
  lVar4 = param_1[0x27b];
  psVar8 = (short *)(lVar4 + 0x40);
  if (7 < *(ulonglong *)(lVar4 + 0x58)) {
    psVar8 = *(short **)psVar8;
  }
  lVar12 = (longlong)plVar11 - (longlong)psVar8;
  do {
    sVar2 = *psVar8;
    sVar3 = *(short *)((longlong)psVar8 + lVar12);
    if (sVar2 != sVar3) break;
    psVar8 = psVar8 + 1;
  } while (sVar3 != 0);
  fVar14 = 1.0;
  iVar7 = 0;
  if ((sVar2 == sVar3) && (*(int *)(*(longlong *)(lVar4 + 0x20) + 0x54) == 1)) {
    plVar11 = param_1 + 0x372;
    if (7 < (ulonglong)param_1[0x375]) {
      plVar11 = (longlong *)*plVar11;
    }
    lVar12 = param_1[0x381];
    lVar9 = -1;
    psVar8 = (short *)plVar11;
    do {
      if (lVar9 == 0) break;
      lVar9 = lVar9 + -1;
      sVar2 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar2 != 0);
    if (lVar9 != -2) {
      uVar10 = 0xffffffffffffffff;
      psVar8 = (short *)plVar11;
      do {
        if (uVar10 == 0) break;
        uVar10 = uVar10 - 1;
        sVar2 = *psVar8;
        psVar8 = psVar8 + 1;
      } while (sVar2 != 0);
      iVar6 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),plVar11,~uVar10 - 1);
      if (iVar6 != 0) {
        uVar10 = 0xffffffffffffffff;
        psVar8 = (short *)plVar11;
        do {
          if (uVar10 == 0) break;
          uVar10 = uVar10 - 1;
          sVar2 = *psVar8;
          psVar8 = psVar8 + 1;
        } while (sVar2 != 0);
        FUN_140001710(lVar4 + 0x40,plVar11,~uVar10 - 1);
        if (*(longlong *)(lVar4 + 0x10) != 0) {
          lVar9 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
          iVar6 = iVar7;
          if (lVar9 != 0) {
            iVar6 = FUN_1402ce620(lVar9,plVar11);
            iVar6 = iVar6 + 1;
          }
          FUN_1402c5c00(lVar4,iVar6,(int)lVar12,1);
          plVar11 = param_1 + 0x377;
          if (7 < (ulonglong)param_1[0x37a]) {
            plVar11 = (longlong *)*plVar11;
          }
          uVar10 = 0xffffffffffffffff;
          psVar8 = (short *)plVar11;
          do {
            if (uVar10 == 0) break;
            uVar10 = uVar10 - 1;
            sVar2 = *psVar8;
            psVar8 = psVar8 + 1;
          } while (sVar2 != 0);
          FUN_140001710(param_1[0x27b] + 0x68,plVar11,~uVar10 - 1);
          if (param_1[0x16f] == 0) {
            uVar13 = 0x3f800000;
          }
          else {
            uVar13 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
          }
          FUN_1402c5e50(param_1[0x27b],uVar13);
          *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
          lVar4 = *(longlong *)(param_1[0x27b] + 0x20);
          if (*(int *)(lVar4 + 0x54) == 1) {
            *(longlong *)(lVar4 + 0x10) = param_2;
            FUN_1402cc2c0(lVar4);
          }
          *(undefined4 *)(lVar4 + 0x54) = 0;
        }
      }
    }
  }
  iVar6 = *(int *)((longlong)param_1 + 0x13fc);
  if (iVar6 == 0) {
    *(undefined1 *)(param_1 + 0x30f) = 0;
    if (param_1[0x26] != 0) {
      fVar14 = *(float *)(param_1[0x26] + 0x298) * *(float *)(param_1 + 0x3ca);
    }
    fVar1 = *(float *)(param_1 + 0x351);
    plVar11 = (longlong *)param_1[0x1da];
    lVar4 = param_1[0x3c5];
    *(int *)((longlong)plVar11 + 0x5c) = (int)lVar4;
    *(int *)(plVar11 + 1) = (int)lVar4;
    plVar11[2] = param_2;
    lVar4 = *plVar11;
    fVar14 = (fVar1 * fVar14) / 60.0;
    *(float *)((longlong)plVar11 + 0x1c) = fVar1;
    *(float *)(plVar11 + 3) = fVar14;
    *(undefined4 *)((longlong)plVar11 + 0x24) = *(undefined4 *)(lVar4 + 0x178);
    *(undefined4 *)(plVar11 + 5) = *(undefined4 *)(lVar4 + 0x17c);
    *(undefined4 *)((longlong)plVar11 + 0x2c) = *(undefined4 *)(lVar4 + 0x180);
    *(undefined4 *)(plVar11 + 6) = 0;
    *(undefined4 *)((longlong)plVar11 + 0x34) = 0;
    *(float *)(plVar11 + 5) = *(float *)(plVar11 + 5) + 0.0;
    *(undefined4 *)(plVar11 + 7) = 0;
    uVar13 = FUN_1403144d0(fVar14,fVar1,*(undefined4 *)(lVar4 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar11 + 4) = uVar13;
    *(undefined4 *)(lVar4 + 0xee0) = uVar13;
    *(undefined4 *)(plVar11 + 0xc) = 0x461c4000;
  }
  else {
    if (iVar6 == 1) {
      cVar5 = FUN_14032daf0(param_1[0x1da],param_2);
      if (cVar5 != '\0') {
        *(undefined1 *)(param_1 + 0x30f) = 1;
        *(undefined4 *)((longlong)param_1 + 0x13fc) = 3;
      }
    }
    else {
      if (iVar6 != 3) {
        if (iVar6 != 4) {
          return;
        }
        if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) {
          return;
        }
        FUN_14021eb20(param_1,0,0);
        return;
      }
      cVar5 = FUN_14032dd70(param_1[0x1da],param_2);
      if (cVar5 != '\0') {
        plVar11 = param_1 + 0x377;
        param_1[0x28a] = 0;
        *(undefined4 *)(param_1 + 0xb7) = 0;
        if (7 < (ulonglong)param_1[0x37a]) {
          plVar11 = (longlong *)*plVar11;
        }
        lVar4 = param_1[0x27b];
        lVar12 = param_1[0x381];
        lVar9 = -1;
        psVar8 = (short *)plVar11;
        do {
          if (lVar9 == 0) break;
          lVar9 = lVar9 + -1;
          sVar2 = *psVar8;
          psVar8 = psVar8 + 1;
        } while (sVar2 != 0);
        if (lVar9 != -2) {
          uVar10 = 0xffffffffffffffff;
          psVar8 = (short *)plVar11;
          do {
            if (uVar10 == 0) break;
            uVar10 = uVar10 - 1;
            sVar2 = *psVar8;
            psVar8 = psVar8 + 1;
          } while (sVar2 != 0);
          iVar6 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),plVar11,~uVar10 - 1);
          if (iVar6 != 0) {
            uVar10 = 0xffffffffffffffff;
            psVar8 = (short *)plVar11;
            do {
              if (uVar10 == 0) break;
              uVar10 = uVar10 - 1;
              sVar2 = *psVar8;
              psVar8 = psVar8 + 1;
            } while (sVar2 != 0);
            FUN_140001710(lVar4 + 0x40,plVar11,~uVar10 - 1);
            if (*(longlong *)(lVar4 + 0x10) != 0) {
              lVar9 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
              if (lVar9 != 0) {
                iVar7 = FUN_1402ce620(lVar9,plVar11);
                iVar7 = iVar7 + 1;
              }
              FUN_1402c5c00(lVar4,iVar7,(int)lVar12,0);
            }
          }
        }
        FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
        if (param_1[0x16f] != 0) {
          fVar14 = *(float *)(param_1[0x16f] + 0x1f8);
        }
        FUN_1402c5e50(param_1[0x27b],fVar14);
        *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
        lVar4 = *(longlong *)(param_1[0x27b] + 0x20);
        if (*(int *)(lVar4 + 0x54) == 1) {
          *(longlong *)(lVar4 + 0x10) = param_2;
          FUN_1402cc2c0(lVar4);
        }
        *(undefined4 *)(lVar4 + 0x54) = 0;
        *(undefined4 *)((longlong)param_1 + 0x13fc) = 4;
      }
    }
    if (*(char *)((longlong)param_1 + 0x1824) == '\0') {
      uVar13 = *(undefined4 *)((longlong)param_1 + 0x17c);
      (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
      *(undefined4 *)((longlong)param_1 + 0x17c) = uVar13;
    }
  }
  return;
}



void FUN_140228110(longlong *param_1,longlong param_2,undefined8 param_3)

{
  short sVar1;
  short sVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  short *psVar7;
  longlong lVar8;
  ulonglong uVar9;
  longlong *plVar10;
  longlong lVar11;
  undefined4 uVar12;
  float fVar13;
  float fVar14;
  
  plVar10 = param_1 + 0x36d;
  if (7 < (ulonglong)param_1[0x370]) {
    plVar10 = (longlong *)*plVar10;
  }
  lVar3 = param_1[0x27b];
  psVar7 = (short *)(lVar3 + 0x40);
  if (7 < *(ulonglong *)(lVar3 + 0x58)) {
    psVar7 = *(short **)psVar7;
  }
  lVar11 = (longlong)plVar10 - (longlong)psVar7;
  do {
    sVar1 = *psVar7;
    sVar2 = *(short *)((longlong)psVar7 + lVar11);
    if (sVar1 != sVar2) break;
    psVar7 = psVar7 + 1;
  } while (sVar2 != 0);
  fVar14 = 1.0;
  iVar6 = 0;
  if ((sVar1 == sVar2) && (*(int *)(*(longlong *)(lVar3 + 0x20) + 0x54) == 1)) {
    plVar10 = param_1 + 0x372;
    if (7 < (ulonglong)param_1[0x375]) {
      plVar10 = (longlong *)*plVar10;
    }
    lVar11 = param_1[0x381];
    lVar8 = -1;
    psVar7 = (short *)plVar10;
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      sVar1 = *psVar7;
      psVar7 = psVar7 + 1;
    } while (sVar1 != 0);
    if (lVar8 != -2) {
      uVar9 = 0xffffffffffffffff;
      psVar7 = (short *)plVar10;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar7;
        psVar7 = psVar7 + 1;
      } while (sVar1 != 0);
      iVar5 = FUN_140123e30(lVar3 + 0x40,*(undefined8 *)(lVar3 + 0x50),plVar10,~uVar9 - 1);
      if (iVar5 != 0) {
        uVar9 = 0xffffffffffffffff;
        psVar7 = (short *)plVar10;
        do {
          if (uVar9 == 0) break;
          uVar9 = uVar9 - 1;
          sVar1 = *psVar7;
          psVar7 = psVar7 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar3 + 0x40,plVar10,~uVar9 - 1);
        if (*(longlong *)(lVar3 + 0x10) != 0) {
          lVar8 = *(longlong *)(*(longlong *)(lVar3 + 0x10) + 0xd8);
          iVar5 = iVar6;
          if (lVar8 != 0) {
            iVar5 = FUN_1402ce620(lVar8,plVar10);
            iVar5 = iVar5 + 1;
          }
          FUN_1402c5c00(lVar3,iVar5,(int)lVar11,1);
          plVar10 = param_1 + 0x377;
          if (7 < (ulonglong)param_1[0x37a]) {
            plVar10 = (longlong *)*plVar10;
          }
          uVar9 = 0xffffffffffffffff;
          psVar7 = (short *)plVar10;
          do {
            if (uVar9 == 0) break;
            uVar9 = uVar9 - 1;
            sVar1 = *psVar7;
            psVar7 = psVar7 + 1;
          } while (sVar1 != 0);
          FUN_140001710(param_1[0x27b] + 0x68,plVar10,~uVar9 - 1);
          if (param_1[0x16f] == 0) {
            uVar12 = 0x3f800000;
          }
          else {
            uVar12 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
          }
          FUN_1402c5e50(param_1[0x27b],uVar12);
          *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
          lVar3 = *(longlong *)(param_1[0x27b] + 0x20);
          if (*(int *)(lVar3 + 0x54) == 1) {
            *(longlong *)(lVar3 + 0x10) = param_2;
            FUN_1402cc2c0(lVar3);
          }
          *(undefined4 *)(lVar3 + 0x54) = 0;
        }
      }
    }
  }
  iVar5 = (int)param_1[0x280];
  if (iVar5 == 0) {
    lVar3 = param_1[0x26];
    *(undefined1 *)(param_1 + 0x30f) = 1;
    *(undefined4 *)(param_1 + 0x280) = 1;
    if (lVar3 == 0) {
      fVar13 = 1.0;
    }
    else {
      fVar13 = *(float *)(lVar3 + 0x29c) * *(float *)(param_1 + 0x3ca);
      fVar14 = *(float *)(lVar3 + 0x298) * *(float *)(param_1 + 0x3ca);
    }
    plVar10 = (longlong *)param_1[0x1da];
    lVar3 = param_1[0x3c5];
    lVar11 = param_1[0x351];
    *(int *)((longlong)plVar10 + 0x5c) = (int)lVar3;
    *(int *)(plVar10 + 1) = (int)lVar3;
    plVar10[2] = param_2;
    lVar3 = *plVar10;
    *(int *)((longlong)plVar10 + 0x1c) = (int)lVar11;
    *(float *)(plVar10 + 3) = fVar13 - fVar14;
    *(undefined4 *)((longlong)plVar10 + 0x24) = *(undefined4 *)(lVar3 + 0x178);
    *(undefined4 *)(plVar10 + 5) = *(undefined4 *)(lVar3 + 0x17c);
    *(undefined4 *)((longlong)plVar10 + 0x2c) = *(undefined4 *)(lVar3 + 0x180);
    *(undefined4 *)(plVar10 + 6) = 0;
    *(undefined4 *)((longlong)plVar10 + 0x34) = 0;
    *(float *)(plVar10 + 5) = *(float *)(plVar10 + 5) + 0.0;
    *(undefined4 *)(plVar10 + 7) = 0;
    uVar12 = FUN_1403144d0(fVar13 - fVar14,(int)lVar11,*(undefined4 *)(lVar3 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar10 + 4) = uVar12;
    *(undefined4 *)(lVar3 + 0xee0) = uVar12;
    *(undefined4 *)(plVar10 + 0xc) = 0x461c4000;
  }
  else {
    if (iVar5 == 1) {
      cVar4 = FUN_14032daf0(param_1[0x1da],param_2);
      if (cVar4 != '\0') {
        *(undefined1 *)(param_1 + 0x30f) = 1;
        *(undefined4 *)(param_1 + 0x280) = 2;
      }
    }
    else {
      if (iVar5 != 2) {
        if (iVar5 != 3) {
          return;
        }
        if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) {
          return;
        }
        FUN_14021eb20(param_1,0,0);
        return;
      }
      cVar4 = FUN_14032dd70(param_1[0x1da],param_2);
      if (cVar4 != '\0') {
        plVar10 = param_1 + 0x377;
        if (7 < (ulonglong)param_1[0x37a]) {
          plVar10 = (longlong *)*plVar10;
        }
        lVar3 = param_1[0x27b];
        lVar11 = param_1[0x381];
        lVar8 = -1;
        psVar7 = (short *)plVar10;
        do {
          if (lVar8 == 0) break;
          lVar8 = lVar8 + -1;
          sVar1 = *psVar7;
          psVar7 = psVar7 + 1;
        } while (sVar1 != 0);
        if (lVar8 != -2) {
          uVar9 = 0xffffffffffffffff;
          psVar7 = (short *)plVar10;
          do {
            if (uVar9 == 0) break;
            uVar9 = uVar9 - 1;
            sVar1 = *psVar7;
            psVar7 = psVar7 + 1;
          } while (sVar1 != 0);
          iVar5 = FUN_140123e30(lVar3 + 0x40,*(undefined8 *)(lVar3 + 0x50),plVar10,~uVar9 - 1);
          if (iVar5 != 0) {
            uVar9 = 0xffffffffffffffff;
            psVar7 = (short *)plVar10;
            do {
              if (uVar9 == 0) break;
              uVar9 = uVar9 - 1;
              sVar1 = *psVar7;
              psVar7 = psVar7 + 1;
            } while (sVar1 != 0);
            FUN_140001710(lVar3 + 0x40,plVar10,~uVar9 - 1);
            if (*(longlong *)(lVar3 + 0x10) != 0) {
              lVar8 = *(longlong *)(*(longlong *)(lVar3 + 0x10) + 0xd8);
              if (lVar8 != 0) {
                iVar6 = FUN_1402ce620(lVar8,plVar10);
                iVar6 = iVar6 + 1;
              }
              FUN_1402c5c00(lVar3,iVar6,(int)lVar11,0);
            }
          }
        }
        FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
        if (param_1[0x16f] != 0) {
          fVar14 = *(float *)(param_1[0x16f] + 0x1f8);
        }
        FUN_1402c5e50(param_1[0x27b],fVar14);
        *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
        lVar3 = *(longlong *)(param_1[0x27b] + 0x20);
        if (*(int *)(lVar3 + 0x54) == 1) {
          *(longlong *)(lVar3 + 0x10) = param_2;
          FUN_1402cc2c0(lVar3);
        }
        *(undefined4 *)(lVar3 + 0x54) = 0;
        param_1[0x28a] = 0;
        *(undefined4 *)(param_1 + 0xb7) = 0;
        *(undefined4 *)(param_1 + 0x280) = 3;
      }
    }
    if (*(char *)((longlong)param_1 + 0x1824) == '\0') {
      uVar12 = *(undefined4 *)((longlong)param_1 + 0x17c);
      (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
      *(undefined4 *)((longlong)param_1 + 0x17c) = uVar12;
    }
  }
  return;
}



void FUN_140228620(longlong *param_1,double param_2,undefined8 param_3)

{
  uint uVar1;
  uint uVar2;
  float fVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong *plVar6;
  ulonglong uVar7;
  longlong lVar8;
  char cVar9;
  int iVar10;
  float *pfVar11;
  wchar_t *pwVar12;
  float *pfVar13;
  wchar_t *pwVar14;
  uint uVar15;
  longlong lVar16;
  float fVar17;
  undefined4 uVar18;
  float local_res8 [2];
  float local_res20 [2];
  
  iVar10 = *(int *)((longlong)param_1 + 0x1404);
  if (iVar10 == 0) {
    *(undefined4 *)((longlong)param_1 + 0x1404) = 1;
    pfVar13 = (float *)(param_1 + 0x34e);
    uVar15 = *(uint *)((longlong)param_1 + 0x133c);
    uVar1 = *(uint *)((longlong)param_1 + 0x1344);
    uVar2 = *(uint *)(param_1 + 0x268);
    local_res8[0] = -1.0;
    local_res20[0] = 1.0;
    if (-1.0 < *pfVar13) {
      pfVar13 = local_res8;
    }
    pfVar11 = (float *)((longlong)param_1 + 0x1a74);
    if (*pfVar11 <= 1.0 && *pfVar11 != 1.0) {
      pfVar11 = local_res20;
    }
    fVar17 = *pfVar11;
    plVar6 = (longlong *)param_1[0x1da];
    lVar8 = param_1[0x3c5];
    fVar3 = *pfVar13;
    *(int *)((longlong)plVar6 + 0x5c) = (int)lVar8;
    lVar16 = *plVar6;
    *(int *)(plVar6 + 1) = (int)lVar8;
    plVar6[2] = (longlong)param_2;
    *(float *)(plVar6 + 3) = fVar17;
    *(float *)((longlong)plVar6 + 0x1c) = fVar3;
    *(undefined4 *)((longlong)plVar6 + 0x24) = *(undefined4 *)(lVar16 + 0x178);
    *(undefined4 *)(plVar6 + 5) = *(undefined4 *)(lVar16 + 0x17c);
    *(undefined4 *)((longlong)plVar6 + 0x2c) = *(undefined4 *)(lVar16 + 0x180);
    *(uint *)(plVar6 + 6) = uVar15 ^ 0x80000000;
    *(float *)(plVar6 + 5) = *(float *)(plVar6 + 5) + 0.0;
    *(uint *)((longlong)plVar6 + 0x34) = uVar2 ^ 0x80000000;
    *(uint *)(plVar6 + 7) = uVar1 ^ 0x80000000;
    uVar18 = FUN_1403144d0(fVar17,fVar3,*(undefined4 *)(lVar16 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar6 + 4) = uVar18;
    *(undefined4 *)(lVar16 + 0xee0) = uVar18;
    *(undefined4 *)(plVar6 + 0xc) = 0x461c4000;
    return;
  }
  if (iVar10 == 1) {
    if (param_2 - (double)param_1[0x306] <= 0.2) {
      return;
    }
    *(undefined4 *)((longlong)param_1 + 0x1404) = 2;
    param_1[0x355] = (longlong)param_2;
    return;
  }
  if (iVar10 != 2) {
    if (iVar10 != 3) {
      if (iVar10 != 4) {
        return;
      }
      *(undefined2 *)(param_1 + 0xc0) = 0;
      FUN_14021eb20(param_1,0,0);
      return;
    }
    uVar18 = *(undefined4 *)((longlong)param_1 + 0x1404);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      uVar18 = 4;
    }
    *(undefined4 *)((longlong)param_1 + 0x1404) = uVar18;
    if (*(char *)((longlong)param_1 + 0x1824) != '\0') {
      return;
    }
    uVar18 = *(undefined4 *)((longlong)param_1 + 0x17c);
    (**(code **)(*param_1 + 0xa08))(param_1,4,param_3,1);
    *(undefined4 *)((longlong)param_1 + 0x17c) = uVar18;
    return;
  }
  cVar9 = FUN_14032dd70(param_1[0x1da]);
  if (cVar9 == '\0') {
    return;
  }
  lVar16 = param_1[0x27b];
  *(undefined4 *)((longlong)param_1 + 0x1404) = 3;
  uVar4 = *(ulonglong *)(lVar16 + 0x50);
  lVar8 = param_1[0x381];
  if (*(ulonglong *)(lVar16 + 0x58) < 8) {
    pwVar12 = (wchar_t *)(lVar16 + 0x40);
  }
  else {
    pwVar12 = *(wchar_t **)(lVar16 + 0x40);
  }
  pwVar14 = L"sky_to_ground01_2";
  uVar7 = 0x11;
  if (uVar4 < 0x11) {
    uVar7 = uVar4;
  }
  for (; uVar7 != 0; uVar7 = uVar7 - 1) {
    if (*pwVar12 != *pwVar14) {
      uVar15 = 1;
      if ((ushort)*pwVar12 < (ushort)*pwVar14) {
        uVar15 = 0xffffffff;
      }
      goto LAB_140228768;
    }
    pwVar12 = pwVar12 + 1;
    pwVar14 = pwVar14 + 1;
  }
  uVar15 = 0;
LAB_140228768:
  if (uVar15 == 0) {
    if (0x10 < uVar4) {
      uVar15 = (uint)(uVar4 != 0x11);
      goto LAB_14022877f;
    }
  }
  else {
LAB_14022877f:
    if (uVar15 == 0) goto LAB_1402287e3;
  }
  FUN_140001710(lVar16 + 0x40,L"sky_to_ground01_2",0x11);
  if (*(longlong *)(lVar16 + 0x10) != 0) {
    lVar5 = *(longlong *)(*(longlong *)(lVar16 + 0x10) + 0xd8);
    if (lVar5 == 0) {
      iVar10 = 0;
    }
    else {
      iVar10 = FUN_1402ce620(lVar5,L"sky_to_ground01_2");
      iVar10 = iVar10 + 1;
    }
    FUN_1402c5c00(lVar16,iVar10,(int)lVar8,1);
  }
LAB_1402287e3:
  if (param_1[0x16f] == 0) {
    uVar18 = 0x3f800000;
  }
  else {
    uVar18 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
  }
  FUN_1402c5e50(param_1[0x27b],uVar18);
  lVar16 = param_1[0x27b];
  fVar17 = (float)FUN_1402c5ee0(lVar16);
  param_1[0x28a] = (longlong)(double)fVar17;
  *(undefined1 *)(*(longlong *)(lVar16 + 0x20) + 0x50) = 0;
  lVar16 = *(longlong *)(param_1[0x27b] + 0x20);
  if (*(int *)(lVar16 + 0x54) == 1) {
    *(double *)(lVar16 + 0x10) = param_2;
    FUN_1402cc2c0(lVar16);
  }
  *(undefined4 *)(lVar16 + 0x54) = 0;
  return;
}



void FUN_1402289f0(longlong *param_1,longlong param_2,undefined8 param_3)

{
  float fVar1;
  short sVar2;
  longlong lVar3;
  longlong lVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  float *pfVar8;
  longlong lVar9;
  ulonglong uVar10;
  longlong *plVar11;
  short *psVar12;
  undefined4 uVar13;
  float local_res8 [2];
  
  uVar13 = 0x3f800000;
  iVar7 = 0;
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    if (param_1[0x2c3] == 0) {
      FUN_14021eb20(param_1,0,0);
    }
    else {
      *(undefined4 *)((longlong)param_1 + 300) = 2;
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)((longlong)param_1 + 0x2054);
      *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)((longlong)param_1 + 0x205c);
      if ((ulonglong)param_1[0x2c4] < 8) {
        plVar11 = param_1 + 0x2c1;
      }
      else {
        plVar11 = (longlong *)param_1[0x2c1];
      }
      (**(code **)(*param_1 + 0x8f8))
                (param_1,plVar11,*(undefined4 *)((longlong)param_1 + 0x1814),0x3f800000,1,
                 param_1[0x2fb],(char)param_1[0x38a]);
      FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
      *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
      param_1[0x2fb] = 0;
      *(undefined1 *)(param_1 + 0x38a) = 0;
      if (*(int *)((longlong)param_1 + 300) == 2) {
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      }
    }
  }
  iVar6 = *(int *)((longlong)param_1 + 0x13fc);
  if (iVar6 == 0) {
    pfVar8 = (float *)(param_1 + 0x34e);
    *(undefined1 *)(param_1 + 0xc0) = 1;
    *(undefined1 *)(param_1 + 0x30f) = 0;
    local_res8[0] = 1.0;
    if (*pfVar8 <= 1.0) {
      pfVar8 = local_res8;
    }
    fVar1 = *pfVar8;
    plVar11 = (longlong *)param_1[0x1da];
    uVar13 = *(undefined4 *)((longlong)param_1 + 0x1a74);
    lVar4 = param_1[0x3c5];
    plVar11[2] = param_2;
    *(undefined4 *)(plVar11 + 3) = uVar13;
    lVar3 = *plVar11;
    *(int *)((longlong)plVar11 + 0x5c) = (int)lVar4;
    *(int *)(plVar11 + 1) = (int)lVar4;
    *(float *)((longlong)plVar11 + 0x1c) = fVar1;
    *(undefined4 *)((longlong)plVar11 + 0x24) = *(undefined4 *)(lVar3 + 0x178);
    *(undefined4 *)(plVar11 + 5) = *(undefined4 *)(lVar3 + 0x17c);
    *(undefined4 *)((longlong)plVar11 + 0x2c) = *(undefined4 *)(lVar3 + 0x180);
    *(undefined4 *)(plVar11 + 6) = 0;
    *(undefined4 *)((longlong)plVar11 + 0x34) = 0;
    *(float *)(plVar11 + 5) = *(float *)(plVar11 + 5) + 0.0;
    *(undefined4 *)(plVar11 + 7) = 0;
    uVar13 = FUN_1403144d0(uVar13,fVar1,*(undefined4 *)(lVar3 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar11 + 4) = uVar13;
    *(undefined4 *)(lVar3 + 0xee0) = uVar13;
    *(undefined4 *)(plVar11 + 0xc) = 0x461c4000;
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 1;
  }
  else {
    if (iVar6 == 1) {
      cVar5 = FUN_14032daf0(param_1[0x1da],param_2);
      if (cVar5 != '\0') {
        *(undefined1 *)(param_1 + 0x30f) = 1;
        *(undefined4 *)((longlong)param_1 + 0x13fc) = 3;
      }
    }
    else {
      if (iVar6 != 3) {
        if (iVar6 != 4) {
          return;
        }
        if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) {
          return;
        }
        FUN_14021eb20(param_1,0,0);
        return;
      }
      cVar5 = FUN_14032dd70(param_1[0x1da],param_2);
      if (cVar5 != '\0') {
        plVar11 = param_1 + 0x377;
        if (7 < (ulonglong)param_1[0x37a]) {
          plVar11 = (longlong *)*plVar11;
        }
        lVar3 = param_1[0x27b];
        lVar4 = param_1[0x381];
        lVar9 = -1;
        psVar12 = (short *)plVar11;
        do {
          if (lVar9 == 0) break;
          lVar9 = lVar9 + -1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        if (lVar9 != -2) {
          uVar10 = 0xffffffffffffffff;
          psVar12 = (short *)plVar11;
          do {
            if (uVar10 == 0) break;
            uVar10 = uVar10 - 1;
            sVar2 = *psVar12;
            psVar12 = psVar12 + 1;
          } while (sVar2 != 0);
          iVar6 = FUN_140123e30(lVar3 + 0x40,*(undefined8 *)(lVar3 + 0x50),plVar11,~uVar10 - 1);
          if (iVar6 != 0) {
            uVar10 = 0xffffffffffffffff;
            psVar12 = (short *)plVar11;
            do {
              if (uVar10 == 0) break;
              uVar10 = uVar10 - 1;
              sVar2 = *psVar12;
              psVar12 = psVar12 + 1;
            } while (sVar2 != 0);
            FUN_140001710(lVar3 + 0x40,plVar11,~uVar10 - 1);
            if (*(longlong *)(lVar3 + 0x10) != 0) {
              lVar9 = *(longlong *)(*(longlong *)(lVar3 + 0x10) + 0xd8);
              if (lVar9 != 0) {
                iVar7 = FUN_1402ce620(lVar9,plVar11);
                iVar7 = iVar7 + 1;
              }
              FUN_1402c5c00(lVar3,iVar7,(int)lVar4,0);
            }
          }
        }
        FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
        if (param_1[0x16f] != 0) {
          uVar13 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
        }
        FUN_1402c5e50(param_1[0x27b],uVar13);
        *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
        lVar3 = *(longlong *)(param_1[0x27b] + 0x20);
        if (*(int *)(lVar3 + 0x54) == 1) {
          *(longlong *)(lVar3 + 0x10) = param_2;
          FUN_1402cc2c0(lVar3);
        }
        *(undefined4 *)(lVar3 + 0x54) = 0;
        *(undefined1 *)(param_1 + 0x30f) = 0;
        param_1[0x28a] = 0;
        *(undefined4 *)(param_1 + 0xb7) = 0;
        *(undefined4 *)((longlong)param_1 + 0x13fc) = 4;
      }
    }
    if (*(char *)((longlong)param_1 + 0x1824) == '\0') {
      uVar13 = *(undefined4 *)((longlong)param_1 + 0x17c);
      (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
      *(undefined4 *)((longlong)param_1 + 0x17c) = uVar13;
    }
  }
  return;
}



void FUN_140228e50(longlong *param_1,double param_2,undefined8 param_3)

{
  short sVar1;
  wchar_t wVar2;
  wchar_t wVar3;
  longlong lVar4;
  int iVar5;
  wchar_t *pwVar6;
  wchar_t *pwVar7;
  longlong lVar8;
  ulonglong uVar9;
  longlong *plVar10;
  longlong *plVar11;
  longlong lVar12;
  wchar_t *pwVar13;
  short *psVar14;
  bool bVar15;
  undefined4 uVar16;
  undefined4 uVar17;
  undefined4 local_68;
  float local_64;
  undefined4 local_60;
  undefined1 local_58 [4];
  float local_54;
  
  iVar5 = (int)param_1[0x281];
  if (iVar5 == 0) {
    param_1[0x355] = (longlong)param_2;
    *(undefined4 *)(param_1 + 0x281) = 2;
    *(int *)((longlong)param_1 + 0x1a9c) = (int)param_1[0x2f];
    *(undefined1 *)((longlong)param_1 + 0x601) = 1;
    *(undefined4 *)(param_1 + 0x354) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)((longlong)param_1 + 0x1aa4) = (int)param_1[0x30];
    return;
  }
  if (iVar5 != 2) {
    if (iVar5 != 3) {
      return;
    }
    FUN_14021eb20(param_1,0,0);
    return;
  }
  plVar10 = param_1 + 0x372;
  plVar11 = plVar10;
  if (7 < (ulonglong)param_1[0x375]) {
    plVar11 = (longlong *)*plVar10;
  }
  lVar4 = param_1[0x27b];
  pwVar6 = (wchar_t *)(lVar4 + 0x40);
  pwVar7 = pwVar6;
  if (7 < *(ulonglong *)(lVar4 + 0x58)) {
    pwVar7 = *(wchar_t **)pwVar6;
  }
  lVar12 = (longlong)plVar11 - (longlong)pwVar7;
  do {
    wVar2 = *pwVar7;
    wVar3 = *(wchar_t *)((longlong)pwVar7 + lVar12);
    if (wVar2 != wVar3) break;
    pwVar7 = pwVar7 + 1;
  } while (wVar3 != L'\0');
  uVar17 = 0x3f800000;
  if (wVar2 != wVar3) {
    bVar15 = *(ulonglong *)(lVar4 + 0x58) == 8;
    pwVar7 = pwVar6;
    if (7 < *(ulonglong *)(lVar4 + 0x58)) {
      pwVar7 = *(wchar_t **)pwVar6;
    }
    lVar12 = 0xd;
    pwVar13 = L"skyattack_05";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      bVar15 = *pwVar7 == *pwVar13;
      pwVar7 = pwVar7 + 1;
      pwVar13 = pwVar13 + 1;
    } while (bVar15);
    if (!bVar15) {
      plVar11 = param_1 + 0x368;
      if (7 < (ulonglong)param_1[0x36b]) {
        plVar11 = (longlong *)*plVar11;
      }
      if (7 < *(ulonglong *)(lVar4 + 0x58)) {
        pwVar6 = *(wchar_t **)pwVar6;
      }
      lVar12 = (longlong)plVar11 - (longlong)pwVar6;
      do {
        wVar2 = *pwVar6;
        wVar3 = *(wchar_t *)((longlong)pwVar6 + lVar12);
        if (wVar2 != wVar3) break;
        pwVar6 = pwVar6 + 1;
      } while (wVar3 != L'\0');
      if ((wVar2 != wVar3) || (*(int *)(*(longlong *)(lVar4 + 0x20) + 0x54) == 1)) {
        if (7 < (ulonglong)param_1[0x375]) {
          plVar10 = (longlong *)*plVar10;
        }
        lVar12 = param_1[0x381];
        lVar8 = -1;
        psVar14 = (short *)plVar10;
        do {
          if (lVar8 == 0) break;
          lVar8 = lVar8 + -1;
          sVar1 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar1 != 0);
        if (lVar8 != -2) {
          uVar9 = 0xffffffffffffffff;
          psVar14 = (short *)plVar10;
          do {
            if (uVar9 == 0) break;
            uVar9 = uVar9 - 1;
            sVar1 = *psVar14;
            psVar14 = psVar14 + 1;
          } while (sVar1 != 0);
          iVar5 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),plVar10,~uVar9 - 1);
          if (iVar5 != 0) {
            uVar9 = 0xffffffffffffffff;
            psVar14 = (short *)plVar10;
            do {
              if (uVar9 == 0) break;
              uVar9 = uVar9 - 1;
              sVar1 = *psVar14;
              psVar14 = psVar14 + 1;
            } while (sVar1 != 0);
            FUN_140001710(lVar4 + 0x40,plVar10,~uVar9 - 1);
            if (*(longlong *)(lVar4 + 0x10) != 0) {
              lVar8 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
              if (lVar8 == 0) {
                iVar5 = 0;
              }
              else {
                iVar5 = FUN_1402ce620(lVar8,plVar10);
                iVar5 = iVar5 + 1;
              }
              FUN_1402c5c00(lVar4,iVar5,(int)lVar12,1);
              plVar10 = param_1 + 0x377;
              if (7 < (ulonglong)param_1[0x37a]) {
                plVar10 = (longlong *)*plVar10;
              }
              uVar9 = 0xffffffffffffffff;
              psVar14 = (short *)plVar10;
              do {
                if (uVar9 == 0) break;
                uVar9 = uVar9 - 1;
                sVar1 = *psVar14;
                psVar14 = psVar14 + 1;
              } while (sVar1 != 0);
              FUN_140001710(param_1[0x27b] + 0x68,plVar10,~uVar9 - 1);
              if (param_1[0x16f] == 0) {
                uVar16 = 0x3f800000;
              }
              else {
                uVar16 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
              }
              FUN_1402c5e50(param_1[0x27b],uVar16);
              *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
              lVar4 = *(longlong *)(param_1[0x27b] + 0x20);
              if (*(int *)(lVar4 + 0x54) == 1) {
                *(double *)(lVar4 + 0x10) = param_2;
                FUN_1402cc2c0(lVar4);
              }
              *(undefined4 *)(lVar4 + 0x54) = 0;
            }
          }
        }
      }
    }
  }
  local_68 = (undefined4)param_1[0x2f];
  local_60 = (undefined4)param_1[0x30];
  local_64 = *(float *)(param_1 + 0x354) -
             (float)(param_2 - (double)param_1[0x355]) * (float)(param_2 - (double)param_1[0x355]) *
             *(float *)(param_1 + 0x395) * 0.5;
  iVar5 = FUN_1402f98b0(param_1,local_58,param_1 + 0x2f,&local_68,(longlong)param_1 + 0x524,
                        param_1 + 0xa4,0,0x447a0000);
  if (iVar5 == 1) {
    *(float *)((longlong)param_1 + 0x17c) = local_64;
    bVar15 = local_64 - local_54 < 0.1;
    if (bVar15) {
      *(float *)((longlong)param_1 + 0x17c) = local_54;
    }
    if (*(float *)((longlong)param_1 + 0x17c) - local_54 < 100.0) {
      *(undefined1 *)(param_1 + 0x30f) = 0;
    }
    if (!bVar15) goto LAB_1402292f7;
  }
  plVar10 = param_1 + 0x377;
  *(undefined4 *)(param_1 + 0x281) = 3;
  if (7 < (ulonglong)param_1[0x37a]) {
    plVar10 = (longlong *)*plVar10;
  }
  lVar4 = param_1[0x27b];
  lVar12 = param_1[0x381];
  lVar8 = -1;
  psVar14 = (short *)plVar10;
  do {
    if (lVar8 == 0) break;
    lVar8 = lVar8 + -1;
    sVar1 = *psVar14;
    psVar14 = psVar14 + 1;
  } while (sVar1 != 0);
  if (lVar8 != -2) {
    uVar9 = 0xffffffffffffffff;
    psVar14 = (short *)plVar10;
    do {
      if (uVar9 == 0) break;
      uVar9 = uVar9 - 1;
      sVar1 = *psVar14;
      psVar14 = psVar14 + 1;
    } while (sVar1 != 0);
    iVar5 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),plVar10,~uVar9 - 1);
    if (iVar5 != 0) {
      uVar9 = 0xffffffffffffffff;
      psVar14 = (short *)plVar10;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar14;
        psVar14 = psVar14 + 1;
      } while (sVar1 != 0);
      FUN_140001710(lVar4 + 0x40,plVar10,~uVar9 - 1);
      if (*(longlong *)(lVar4 + 0x10) != 0) {
        lVar8 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
        if (lVar8 == 0) {
          iVar5 = 0;
        }
        else {
          iVar5 = FUN_1402ce620(lVar8,plVar10);
          iVar5 = iVar5 + 1;
        }
        FUN_1402c5c00(lVar4,iVar5,(int)lVar12,0);
      }
    }
  }
  FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
  if (param_1[0x16f] != 0) {
    uVar17 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
  }
  FUN_1402c5e50(param_1[0x27b],uVar17);
  *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
  lVar4 = *(longlong *)(param_1[0x27b] + 0x20);
  if (*(int *)(lVar4 + 0x54) == 1) {
    *(double *)(lVar4 + 0x10) = param_2;
    FUN_1402cc2c0(lVar4);
  }
  *(undefined4 *)(lVar4 + 0x54) = 0;
  *(undefined1 *)((longlong)param_1 + 0x601) = 0;
LAB_1402292f7:
  if (*(char *)((longlong)param_1 + 0x1824) == '\0') {
    uVar17 = *(undefined4 *)((longlong)param_1 + 0x17c);
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    *(undefined4 *)((longlong)param_1 + 0x17c) = uVar17;
  }
  return;
}



void FUN_1402293b0(longlong param_1,double param_2)

{
  float fVar1;
  float fVar2;
  
  if (*(int *)(param_1 + 0x140c) == 0) {
    *(double *)(param_1 + 0x1ad8) = param_2;
    *(undefined1 *)(param_1 + 0x600) = 1;
    *(undefined4 *)(param_1 + 0x1ac8) = *(undefined4 *)(param_1 + 0x178);
    *(undefined4 *)(param_1 + 0x140c) = 1;
    *(undefined4 *)(param_1 + 0x1acc) = *(undefined4 *)(param_1 + 0x17c);
    *(undefined4 *)(param_1 + 0x1ad0) = *(undefined4 *)(param_1 + 0x180);
  }
  else if (*(int *)(param_1 + 0x140c) == 1) {
    param_2 = param_2 - *(double *)(param_1 + 0x1ad8);
    fVar1 = *(float *)(param_1 + 0x1acc);
    fVar2 = (float)param_2;
    fVar2 = fVar1 - fVar2 * fVar2 * 275.0 * 0.5;
    *(float *)(param_1 + 0x17c) = fVar2;
    if (fVar2 - fVar1 < -550.0) {
      *(float *)(param_1 + 0x17c) = fVar1 - 550.0;
    }
    if (2.0 < param_2) {
      *(undefined4 *)(param_1 + 0x140c) = 2;
      return;
    }
  }
  return;
}



void FUN_140229480(longlong *param_1,longlong param_2)

{
  short sVar1;
  wchar_t wVar2;
  wchar_t wVar3;
  longlong lVar4;
  char cVar5;
  int iVar6;
  wchar_t *pwVar7;
  longlong lVar8;
  ulonglong uVar9;
  longlong *plVar10;
  wchar_t *pwVar11;
  longlong *plVar12;
  longlong lVar13;
  short *psVar14;
  bool bVar15;
  undefined4 uVar16;
  
  if ((int)param_1[0x281] == 0) {
    plVar10 = (longlong *)param_1[0x1da];
    lVar13 = param_1[0x3c5];
    uVar16 = *(undefined4 *)((longlong)param_1 + 0x1a84);
    *(undefined1 *)((longlong)param_1 + 0x601) = 1;
    lVar4 = *plVar10;
    lVar8 = param_1[0x350];
    *(int *)((longlong)plVar10 + 0x5c) = (int)lVar13;
    *(int *)(plVar10 + 1) = (int)lVar13;
    plVar10[2] = param_2;
    *(undefined4 *)(plVar10 + 3) = uVar16;
    *(int *)((longlong)plVar10 + 0x1c) = (int)lVar8;
    *(undefined4 *)((longlong)plVar10 + 0x24) = *(undefined4 *)(lVar4 + 0x178);
    *(undefined4 *)(plVar10 + 5) = *(undefined4 *)(lVar4 + 0x17c);
    *(undefined4 *)((longlong)plVar10 + 0x2c) = *(undefined4 *)(lVar4 + 0x180);
    *(float *)(plVar10 + 5) = *(float *)(plVar10 + 5) + 0.0;
    *(undefined4 *)(plVar10 + 6) = *(undefined4 *)((longlong)param_1 + 0x133c);
    *(int *)((longlong)plVar10 + 0x34) = (int)param_1[0x268];
    *(undefined4 *)(plVar10 + 7) = *(undefined4 *)((longlong)param_1 + 0x1344);
    uVar16 = FUN_1403144d0(uVar16,(int)lVar8,*(undefined4 *)(lVar4 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar10 + 4) = uVar16;
    *(undefined4 *)(lVar4 + 0xee0) = uVar16;
    *(undefined4 *)(plVar10 + 0xc) = 0x461c4000;
    *(undefined4 *)(param_1 + 0x281) = 2;
  }
  else if ((int)param_1[0x281] == 2) {
    plVar10 = param_1 + 0x37c;
    plVar12 = plVar10;
    if (7 < (ulonglong)param_1[0x37f]) {
      plVar12 = (longlong *)*plVar10;
    }
    lVar4 = param_1[0x27b];
    pwVar11 = (wchar_t *)(lVar4 + 0x40);
    pwVar7 = pwVar11;
    if (7 < *(ulonglong *)(lVar4 + 0x58)) {
      pwVar7 = *(wchar_t **)pwVar11;
    }
    lVar13 = (longlong)plVar12 - (longlong)pwVar7;
    do {
      wVar2 = *pwVar7;
      wVar3 = *(wchar_t *)((longlong)pwVar7 + lVar13);
      if (wVar2 != wVar3) break;
      pwVar7 = pwVar7 + 1;
    } while (wVar3 != L'\0');
    if (wVar2 != wVar3) {
      bVar15 = *(ulonglong *)(lVar4 + 0x58) == 8;
      if (7 < *(ulonglong *)(lVar4 + 0x58)) {
        pwVar11 = *(wchar_t **)pwVar11;
      }
      lVar13 = 0xd;
      pwVar7 = L"sky_damage02";
      do {
        if (lVar13 == 0) break;
        lVar13 = lVar13 + -1;
        bVar15 = *pwVar11 == *pwVar7;
        pwVar11 = pwVar11 + 1;
        pwVar7 = pwVar7 + 1;
      } while (bVar15);
      if ((!bVar15) || (*(int *)(*(longlong *)(lVar4 + 0x20) + 0x54) == 1)) {
        if (7 < (ulonglong)param_1[0x37f]) {
          plVar10 = (longlong *)*plVar10;
        }
        lVar13 = param_1[0x381];
        lVar8 = -1;
        psVar14 = (short *)plVar10;
        do {
          if (lVar8 == 0) break;
          lVar8 = lVar8 + -1;
          sVar1 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar1 != 0);
        if (lVar8 != -2) {
          uVar9 = 0xffffffffffffffff;
          psVar14 = (short *)plVar10;
          do {
            if (uVar9 == 0) break;
            uVar9 = uVar9 - 1;
            sVar1 = *psVar14;
            psVar14 = psVar14 + 1;
          } while (sVar1 != 0);
          iVar6 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),plVar10,~uVar9 - 1);
          if (iVar6 != 0) {
            uVar9 = 0xffffffffffffffff;
            psVar14 = (short *)plVar10;
            do {
              if (uVar9 == 0) break;
              uVar9 = uVar9 - 1;
              sVar1 = *psVar14;
              psVar14 = psVar14 + 1;
            } while (sVar1 != 0);
            FUN_140001710(lVar4 + 0x40,plVar10,~uVar9 - 1);
            if (*(longlong *)(lVar4 + 0x10) != 0) {
              lVar8 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
              if (lVar8 == 0) {
                iVar6 = 0;
              }
              else {
                iVar6 = FUN_1402ce620(lVar8,plVar10);
                iVar6 = iVar6 + 1;
              }
              FUN_1402c5c00(lVar4,iVar6,(int)lVar13,1);
              FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
              if (param_1[0x16f] == 0) {
                uVar16 = 0x3f800000;
              }
              else {
                uVar16 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
              }
              FUN_1402c5e50(param_1[0x27b],uVar16);
              *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
              lVar4 = *(longlong *)(param_1[0x27b] + 0x20);
              if (*(int *)(lVar4 + 0x54) == 1) {
                *(longlong *)(lVar4 + 0x10) = param_2;
                FUN_1402cc2c0(lVar4);
              }
              *(undefined4 *)(lVar4 + 0x54) = 0;
              *(undefined4 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) = 2;
            }
          }
        }
      }
    }
    cVar5 = FUN_14032dd70(param_1[0x1da],param_2);
    if (cVar5 != '\0') {
      *(undefined1 *)((longlong)param_1 + 0x601) = 0;
      *(undefined1 *)(param_1 + 0x30f) = 0;
      *(undefined4 *)(param_1 + 0x30b) = 0;
                    // WARNING: Could not recover jumptable at 0x0001402296cd. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 200))(param_1,0x20);
      return;
    }
  }
  return;
}



void FUN_1402297b0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  float fVar1;
  int iVar2;
  
  if (param_1[0x26] != 0) {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      *(undefined2 *)((longlong)param_1 + 0x18dc) = 0;
      FUN_14021eb20(param_1,0,0);
      fVar1 = *(float *)(param_1[0x26] + 0x290);
      iVar2 = rand();
      param_1[0x166] =
           (longlong)((double)param_1[0xa2] - (double)((float)iVar2 * 3.0517578e-05 * fVar1));
    }
  }
  return;
}



void FUN_140229860(longlong *param_1)

{
  longlong *plVar1;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))();
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    if (param_1[0x2c3] == 0) {
      FUN_14021eb20(param_1,0,0);
      return;
    }
    *(undefined4 *)((longlong)param_1 + 300) = 2;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)((longlong)param_1 + 0x2054);
    *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)((longlong)param_1 + 0x205c);
    if ((ulonglong)param_1[0x2c4] < 8) {
      plVar1 = param_1 + 0x2c1;
    }
    else {
      plVar1 = (longlong *)param_1[0x2c1];
    }
    (**(code **)(*param_1 + 0x8f8))
              (param_1,plVar1,*(undefined4 *)((longlong)param_1 + 0x1814),0x3f800000,1,
               param_1[0x2fb],(char)param_1[0x38a]);
    FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
    *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
    param_1[0x2fb] = 0;
    *(undefined1 *)(param_1 + 0x38a) = 0;
    if (*(int *)((longlong)param_1 + 300) == 2) {
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    }
  }
  return;
}



void FUN_140229990(longlong *param_1,undefined8 param_2,double param_3)

{
  int iVar1;
  float fVar2;
  double dVar3;
  float local_48;
  float local_44;
  float local_40;
  undefined1 local_38 [48];
  
  dVar3 = (double)param_1[0x28a] * param_3 + (double)param_1[0x28a];
  param_1[0x28a] = (longlong)dVar3;
  fVar2 = (float)(dVar3 * param_3);
  local_48 = -*(float *)((longlong)param_1 + 0x154) * fVar2 + *(float *)(param_1 + 0x2f);
  local_44 = -*(float *)(param_1 + 0x2b) * fVar2 + *(float *)((longlong)param_1 + 0x17c);
  local_40 = -*(float *)((longlong)param_1 + 0x15c) * fVar2 + *(float *)(param_1 + 0x30);
  iVar1 = FUN_1402f98b0(param_1,local_38,param_1 + 0x2f,&local_48,(longlong)param_1 + 0x524,
                        param_1 + 0xa4,1,0x447a0000);
  if (iVar1 == 1) {
    FUN_14022ecd0(param_1,local_38);
  }
  if (0.0 <= -*(float *)(param_1 + 0x2b) *
             (*(float *)((longlong)param_1 + 0x203c) - *(float *)((longlong)param_1 + 0x17c)) +
             -*(float *)((longlong)param_1 + 0x154) *
             (*(float *)(param_1 + 0x407) - *(float *)(param_1 + 0x2f)) +
             -*(float *)((longlong)param_1 + 0x15c) *
             (*(float *)(param_1 + 0x408) - *(float *)(param_1 + 0x30))) {
    if (iVar1 == 1) {
      return;
    }
  }
  else {
    FUN_14022ecd0(param_1);
  }
  (**(code **)(*param_1 + 0x980))(param_1,param_2);
  return;
}



void FUN_140229b40(longlong *param_1,double param_2,undefined8 param_3)

{
  longlong *plVar1;
  byte bVar2;
  byte bVar3;
  undefined8 *puVar4;
  longlong lVar5;
  void *pvVar6;
  longlong lVar7;
  int iVar8;
  undefined4 uVar9;
  undefined8 uVar10;
  longlong lVar11;
  undefined8 in_RDX;
  longlong *plVar12;
  undefined8 uVar13;
  bool bVar14;
  uint in_stack_ffffffffffffff78;
  uint uVar15;
  float local_60;
  float local_5c;
  float local_58;
  longlong *local_50;
  longlong *local_48;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  if (param_1[0x2fc] == 0) {
    if ((*(uint *)(param_1 + 0x307) & 0x7f800000) == 0) {
      if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) goto LAB_140229f14;
    }
    else if (param_2 < (double)param_1[0x307] || param_2 == (double)param_1[0x307])
    goto LAB_140229f14;
    plVar12 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar12 = (longlong *)*plVar12;
    }
    (**(code **)(*param_1 + 0x8f8))
              (param_1,plVar12,(int)param_1[0x381],0x3f800000,in_stack_ffffffffffffff78 & 0xffffff00
               ,0,0);
    goto LAB_140229f14;
  }
  bVar2 = *(byte *)((longlong)param_1 + 0x601);
  bVar3 = *(byte *)(param_1 + 0xc0);
  uVar15 = *(uint *)((longlong)param_1 + 300);
  lVar11 = param_1[0xb5];
  puVar4 = (undefined8 *)param_1[0x391];
  if (puVar4 == (undefined8 *)0x0) {
LAB_140229bf1:
    uVar13 = 0;
  }
  else {
    if (puVar4 != (undefined8 *)param_1[0x392]) {
      iVar8 = DAT_140608150 + 1;
      bVar14 = DAT_140608150 == 0;
      DAT_140608150 = iVar8;
      if (bVar14) {
        FUN_140176d60(1);
      }
      goto LAB_140229bf1;
    }
    uVar13 = *puVar4;
  }
  lVar7 = param_1[0x1dd];
  lVar5 = param_1[0x2fc];
  uVar9 = FUN_14023c2c0(lVar5,(int)lVar7,(int)lVar11);
  uVar10 = FUN_14023c1c0(lVar5,(int)lVar7,(int)lVar11);
  FUN_140278700(uVar13,&local_50,uVar10,uVar9,uVar15,bVar2 | bVar3,(char)param_1[0x413]);
  if (local_50 == (longlong *)0x0) goto LAB_140229ccb;
  if (local_50 == local_48) {
    if ((*local_50 == 0) || (*(int *)(*local_50 + 0xdc) != 5)) goto LAB_140229c98;
LAB_140229cda:
    if ((((*(uint *)(param_1 + 0x307) & 0x7f800000) != 0) &&
        ((double)param_1[0x307] <= param_2 && param_2 != (double)param_1[0x307])) ||
       (((*(uint *)(param_1 + 0x307) & 0x7f800000) == 0 &&
        ((*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1 &&
         ((double)param_1[0x307] <= param_2 && param_2 != (double)param_1[0x307])))))) {
      if (local_50 == (longlong *)0x0) {
LAB_140229d4f:
        lVar11 = 0;
      }
      else {
        if (local_50 != local_48) {
          iVar8 = DAT_140608154 + 1;
          bVar14 = DAT_140608154 == 0;
          DAT_140608154 = iVar8;
          if (bVar14) {
            FUN_140176d60(1);
          }
          goto LAB_140229d4f;
        }
        lVar11 = *local_50;
      }
      if (*(int *)(lVar11 + 0xdc) == 5) {
        (**(code **)(*param_1 + 0x5c0))(param_1,param_1[0x2fc]);
      }
      else {
        if (local_50 == (longlong *)0x0) {
LAB_140229da0:
          lVar11 = 0;
        }
        else {
          if (local_50 != local_48) {
            iVar8 = DAT_140608154 + 1;
            bVar14 = DAT_140608154 == 0;
            DAT_140608154 = iVar8;
            if (bVar14) {
              FUN_140176d60(1);
            }
            goto LAB_140229da0;
          }
          lVar11 = *local_50;
        }
        if (*(int *)(lVar11 + 0xdc) == 3) {
          (**(code **)(*param_1 + 0x5c8))(param_1,param_1[0x2fc]);
        }
      }
    }
  }
  else {
    iVar8 = DAT_140608154 + 1;
    bVar14 = DAT_140608154 == 0;
    DAT_140608154 = iVar8;
    if (bVar14) {
      FUN_140176d60(1);
    }
LAB_140229c98:
    if (local_50 == (longlong *)0x0) {
LAB_140229ccb:
      lVar11 = 0;
    }
    else {
      if (local_50 != local_48) {
        iVar8 = DAT_140608154 + 1;
        bVar14 = DAT_140608154 == 0;
        DAT_140608154 = iVar8;
        if (bVar14) {
          FUN_140176d60(1);
        }
        goto LAB_140229ccb;
      }
      lVar11 = *local_50;
    }
    if (*(int *)(lVar11 + 0xdc) == 3) goto LAB_140229cda;
    if ((*(uint *)(param_1 + 0x307) & 0x7f800000) == 0) {
      if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) goto LAB_140229dee;
    }
    else if ((double)param_1[0x307] <= param_2 && param_2 != (double)param_1[0x307]) {
LAB_140229dee:
      plVar12 = param_1 + 0x299;
      if (7 < (ulonglong)param_1[0x29c]) {
        plVar12 = (longlong *)*plVar12;
      }
      (**(code **)(*param_1 + 0x8f8))
                (param_1,plVar12,(int)param_1[0x381],0x3f800000,uVar15 & 0xffffff00,param_1[0x2fc],0
                );
    }
  }
  plVar12 = local_50;
  if (local_50 != (longlong *)0x0) {
    if (local_50 == local_48) {
      if (local_50 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_50 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          local_50 = (longlong *)0x0;
          pvVar6 = (void *)*plVar12;
          if (pvVar6 != (void *)0x0) {
            FUN_140197310(pvVar6);
            operator_delete(pvVar6);
          }
          operator_delete(plVar12);
        }
      }
    }
    else {
      iVar8 = DAT_1406080b4 + 1;
      bVar14 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar8;
      if (bVar14) {
        FUN_140176d60(1);
      }
    }
  }
LAB_140229f14:
  lVar11 = (**(code **)(*param_1 + 0x430))
                     (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar11 != 0) {
    local_60 = *(float *)(param_1 + 0x2f) - *(float *)(lVar11 + 0x178);
    local_5c = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar11 + 0x17c);
    local_58 = *(float *)(param_1 + 0x30) - *(float *)(lVar11 + 0x180);
    (**(code **)(*param_1 + 0x100))(param_1,&local_60);
    (**(code **)(*param_1 + 0x8e8))(param_1,&local_60);
  }
  return;
}



void FUN_140229fc0(longlong *param_1)

{
  longlong *plVar1;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))();
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    if (param_1[0x2c3] != 0) {
      *(undefined4 *)((longlong)param_1 + 300) = 2;
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)((longlong)param_1 + 0x2054);
      *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)((longlong)param_1 + 0x205c);
      if ((ulonglong)param_1[0x2c4] < 8) {
        plVar1 = param_1 + 0x2c1;
      }
      else {
        plVar1 = (longlong *)param_1[0x2c1];
      }
      (**(code **)(*param_1 + 0x8f8))
                (param_1,plVar1,*(undefined4 *)((longlong)param_1 + 0x1814),0x3f800000,1,
                 param_1[0x2fb],(char)param_1[0x38a]);
      FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
      *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
      param_1[0x2fb] = 0;
      *(undefined1 *)(param_1 + 0x38a) = 0;
      if (*(int *)((longlong)param_1 + 300) != 2) {
        return;
      }
    }
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_14022a0e0(longlong *param_1,longlong param_2,undefined8 param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  float fVar4;
  short sVar5;
  longlong lVar6;
  longlong lVar7;
  char cVar8;
  int iVar9;
  int iVar10;
  float *pfVar11;
  longlong lVar12;
  ulonglong uVar13;
  longlong *plVar14;
  short *psVar15;
  undefined4 uVar16;
  float local_res8 [2];
  
  uVar16 = 0x3f800000;
  iVar10 = 0;
  if ((*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) && (param_1[0x2c3] != 0)) {
    *(undefined4 *)((longlong)param_1 + 300) = 2;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)((longlong)param_1 + 0x2054);
    *(undefined1 *)(param_1 + 0x30f) = 1;
    *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)((longlong)param_1 + 0x205c);
    if ((ulonglong)param_1[0x2c4] < 8) {
      plVar14 = param_1 + 0x2c1;
    }
    else {
      plVar14 = (longlong *)param_1[0x2c1];
    }
    (**(code **)(*param_1 + 0x8f8))
              (param_1,plVar14,*(undefined4 *)((longlong)param_1 + 0x1814),0x3f800000,1,
               param_1[0x2fb],(char)param_1[0x38a]);
    FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
    *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
    param_1[0x2fb] = 0;
    *(undefined1 *)(param_1 + 0x38a) = 0;
    if (*(int *)((longlong)param_1 + 300) == 2) {
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    }
  }
  if ((char)param_1[0xc0] == '\0') {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  iVar9 = *(int *)((longlong)param_1 + 0x13fc);
  if (iVar9 == 1) {
    *(undefined1 *)(param_1 + 0x30f) = 0;
    *(undefined1 *)(param_1 + 0xc0) = 1;
    uVar1 = *(uint *)((longlong)param_1 + 0x133c);
    uVar2 = *(uint *)((longlong)param_1 + 0x1344);
    pfVar11 = (float *)(param_1 + 0x34e);
    uVar3 = *(uint *)(param_1 + 0x268);
    local_res8[0] = 1.0;
    if (*pfVar11 <= 1.0) {
      pfVar11 = local_res8;
    }
    fVar4 = *pfVar11;
    plVar14 = (longlong *)param_1[0x1da];
    uVar16 = *(undefined4 *)((longlong)param_1 + 0x1a74);
    lVar7 = param_1[0x3c5];
    plVar14[2] = param_2;
    lVar6 = *plVar14;
    *(int *)((longlong)plVar14 + 0x5c) = (int)lVar7;
    *(int *)(plVar14 + 1) = (int)lVar7;
    *(undefined4 *)(plVar14 + 3) = uVar16;
    *(float *)((longlong)plVar14 + 0x1c) = fVar4;
    *(undefined4 *)((longlong)plVar14 + 0x24) = *(undefined4 *)(lVar6 + 0x178);
    *(undefined4 *)(plVar14 + 5) = *(undefined4 *)(lVar6 + 0x17c);
    *(undefined4 *)((longlong)plVar14 + 0x2c) = *(undefined4 *)(lVar6 + 0x180);
    *(uint *)(plVar14 + 6) = uVar1 ^ 0x80000000;
    *(float *)(plVar14 + 5) = *(float *)(plVar14 + 5) + 0.0;
    *(uint *)((longlong)plVar14 + 0x34) = uVar3 ^ 0x80000000;
    *(uint *)(plVar14 + 7) = uVar2 ^ 0x80000000;
    uVar16 = FUN_1403144d0(uVar16,fVar4,*(undefined4 *)(lVar6 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar14 + 4) = uVar16;
    *(undefined4 *)(lVar6 + 0xee0) = uVar16;
    *(undefined4 *)(plVar14 + 0xc) = 0x461c4000;
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 2;
  }
  else if (iVar9 == 2) {
    cVar8 = FUN_14032daf0(param_1[0x1da],param_2);
    if (cVar8 != '\0') {
      *(undefined1 *)(param_1 + 0x30f) = 1;
      *(undefined4 *)((longlong)param_1 + 0x13fc) = 3;
    }
  }
  else if (iVar9 == 3) {
    cVar8 = FUN_14032dd70(param_1[0x1da],param_2);
    if (cVar8 != '\0') {
      plVar14 = param_1 + 0x377;
      if (7 < (ulonglong)param_1[0x37a]) {
        plVar14 = (longlong *)*plVar14;
      }
      lVar6 = param_1[0x27b];
      lVar7 = param_1[0x381];
      lVar12 = -1;
      psVar15 = (short *)plVar14;
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        sVar5 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar5 != 0);
      if (lVar12 != -2) {
        uVar13 = 0xffffffffffffffff;
        psVar15 = (short *)plVar14;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar5 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar5 != 0);
        iVar9 = FUN_140123e30(lVar6 + 0x40,*(undefined8 *)(lVar6 + 0x50),plVar14,~uVar13 - 1);
        if (iVar9 != 0) {
          uVar13 = 0xffffffffffffffff;
          psVar15 = (short *)plVar14;
          do {
            if (uVar13 == 0) break;
            uVar13 = uVar13 - 1;
            sVar5 = *psVar15;
            psVar15 = psVar15 + 1;
          } while (sVar5 != 0);
          FUN_140001710(lVar6 + 0x40,plVar14,~uVar13 - 1);
          if (*(longlong *)(lVar6 + 0x10) != 0) {
            lVar12 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
            if (lVar12 != 0) {
              iVar10 = FUN_1402ce620(lVar12,plVar14);
              iVar10 = iVar10 + 1;
            }
            FUN_1402c5c00(lVar6,iVar10,(int)lVar7,0);
          }
        }
      }
      FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
      if (param_1[0x16f] != 0) {
        uVar16 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
      }
      FUN_1402c5e50(param_1[0x27b],uVar16);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar6 + 0x54) == 1) {
        *(longlong *)(lVar6 + 0x10) = param_2;
        FUN_1402cc2c0(lVar6);
      }
      *(undefined4 *)(lVar6 + 0x54) = 0;
      *(undefined1 *)(param_1 + 0x30f) = 0;
      param_1[0x28a] = 0;
      *(undefined4 *)(param_1 + 0xb7) = 0;
      *(undefined2 *)(param_1 + 0xc0) = 0;
      *(undefined4 *)((longlong)param_1 + 0x13fc) = 4;
    }
  }
  else if ((iVar9 == 4) && (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1)) {
    FUN_14021eb20(param_1,0,0);
  }
  return;
}



void FUN_14022a570(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  short sVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  undefined8 in_RDX;
  longlong *plVar9;
  short *psVar10;
  undefined8 in_R8;
  undefined4 uVar11;
  float local_58;
  float local_54;
  float local_50;
  float local_48;
  float local_44;
  float local_40;
  
  if ((char)param_1[0xc0] == '\0') {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,in_R8,1);
  }
  iVar5 = *(int *)((longlong)param_1 + 0x13fc);
  if (iVar5 == 1) {
    if ((char)param_1[0x3d4] == '\0') {
      lVar6 = (**(code **)(*param_1 + 0x430))
                        (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
      if (lVar6 == 0) {
        local_58 = *(float *)((longlong)param_1 + 0x154) * 50.0 + *(float *)(param_1 + 0x2f);
        local_54 = *(float *)(param_1 + 0x2b) * 50.0 + *(float *)((longlong)param_1 + 0x17c);
        local_50 = *(float *)((longlong)param_1 + 0x15c) * 50.0 + *(float *)(param_1 + 0x30);
        local_48 = local_58;
        local_44 = local_54;
        local_40 = local_50;
      }
      else {
        local_58 = *(float *)(lVar6 + 0x178);
        local_54 = *(float *)(lVar6 + 0x17c);
        local_50 = *(float *)(lVar6 + 0x180);
      }
    }
    else {
      local_58 = *(float *)((longlong)param_1 + 0x1e94);
      *(undefined1 *)(param_1 + 0x3d4) = 0;
      local_54 = *(float *)(param_1 + 0x3d3);
      local_50 = *(float *)((longlong)param_1 + 0x1e9c);
    }
    FUN_14032e070(param_1[0x1da],param_1 + 0x2f,&local_58,param_2,
                  *(undefined4 *)((longlong)param_1 + 0x1a74),(int)param_1[0x34e],
                  *(float *)(param_1 + 0x395) * 2.0,(int)param_1[0x3c5]);
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 2;
    *(undefined4 *)(param_1 + 0xb7) = 0;
    param_1[0x28a] = 0;
  }
  else if (iVar5 == 2) {
    *(undefined1 *)(param_1 + 0xc0) = 1;
    cVar3 = FUN_14032e2b0(param_1[0x1da],param_2,param_3,*(float *)(param_1 + 0x395) * 2.0,1);
    if (cVar3 != '\0') {
      *(undefined4 *)((longlong)param_1 + 0x13fc) = 3;
    }
  }
  else if (iVar5 == 3) {
    cVar3 = FUN_14032e4a0(param_1[0x1da],param_2,param_3,*(float *)(param_1 + 0x395) * 2.0,1);
    if (cVar3 != '\0') {
      plVar9 = param_1 + 0x3ba;
      iVar5 = 0;
      *(undefined4 *)(param_1 + 0xb7) = 0;
      param_1[0x28a] = 0;
      *(undefined1 *)(param_1 + 0xc0) = 0;
      if (7 < (ulonglong)param_1[0x3bd]) {
        plVar9 = (longlong *)*plVar9;
      }
      lVar6 = param_1[0x27b];
      lVar2 = param_1[0x381];
      lVar7 = -1;
      psVar10 = (short *)plVar9;
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      if (lVar7 != -2) {
        uVar8 = 0xffffffffffffffff;
        psVar10 = (short *)plVar9;
        do {
          if (uVar8 == 0) break;
          uVar8 = uVar8 - 1;
          sVar1 = *psVar10;
          psVar10 = psVar10 + 1;
        } while (sVar1 != 0);
        iVar4 = FUN_140123e30(lVar6 + 0x40,*(undefined8 *)(lVar6 + 0x50),plVar9,~uVar8 - 1);
        if (iVar4 != 0) {
          uVar8 = 0xffffffffffffffff;
          psVar10 = (short *)plVar9;
          do {
            if (uVar8 == 0) break;
            uVar8 = uVar8 - 1;
            sVar1 = *psVar10;
            psVar10 = psVar10 + 1;
          } while (sVar1 != 0);
          FUN_140001710(lVar6 + 0x40,plVar9,~uVar8 - 1);
          if (*(longlong *)(lVar6 + 0x10) != 0) {
            lVar7 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
            if (lVar7 != 0) {
              iVar5 = FUN_1402ce620(lVar7,plVar9);
              iVar5 = iVar5 + 1;
            }
            FUN_1402c5c00(lVar6,iVar5,(int)lVar2,0);
          }
        }
      }
      FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
      if (param_1[0x16f] == 0) {
        uVar11 = 0x3f800000;
      }
      else {
        uVar11 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
      }
      FUN_1402c5e50(param_1[0x27b],uVar11);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar6 + 0x54) == 1) {
        *(undefined8 *)(lVar6 + 0x10) = param_2;
        FUN_1402cc2c0(lVar6);
      }
      *(undefined4 *)(lVar6 + 0x54) = 0;
      *(undefined4 *)((longlong)param_1 + 0x13fc) = 4;
    }
  }
  else if ((iVar5 == 4) && (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1)) {
    (**(code **)(*param_1 + 0x980))(param_1,param_2);
  }
  return;
}



void FUN_14022a990(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  short sVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  undefined8 in_RDX;
  longlong *plVar9;
  short *psVar10;
  undefined8 in_R8;
  float fVar11;
  undefined4 uVar12;
  undefined8 uVar13;
  float local_78;
  float local_74;
  float local_70;
  float local_68;
  float local_64;
  float local_60;
  float local_5c;
  float local_58;
  float local_54;
  
  if ((char)param_1[0xc0] == '\0') {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,in_R8,1);
  }
  iVar5 = *(int *)((longlong)param_1 + 0x13fc);
  if (iVar5 == 0) {
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      plVar9 = param_1 + 0x3b0;
      FUN_1400015e0(param_1 + 0x299,plVar9,0,0xffffffffffffffff);
      if (7 < (ulonglong)param_1[0x3b3]) {
        plVar9 = (longlong *)*plVar9;
      }
      FUN_1402c5b20(param_1[0x27b],plVar9,(int)param_1[0x381],1,1);
      plVar9 = param_1 + 0x3b5;
      if (7 < (ulonglong)param_1[0x3b8]) {
        plVar9 = (longlong *)*plVar9;
      }
      uVar8 = 0xffffffffffffffff;
      psVar10 = (short *)plVar9;
      do {
        if (uVar8 == 0) break;
        uVar8 = uVar8 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1[0x27b] + 0x68,plVar9,~uVar8 - 1);
      lVar6 = param_1[0x27b];
      uVar13 = FUN_140314a60(param_1,lVar6);
      FUN_1402c5e50(lVar6,uVar13);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
      lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar6 + 0x54) == 1) {
        *(undefined8 *)(lVar6 + 0x10) = param_2;
        FUN_1402cc2c0(lVar6);
      }
      *(undefined4 *)(lVar6 + 0x54) = 0;
      fVar11 = (float)FUN_1402c5ee0(param_1[0x27b]);
      *(undefined4 *)((longlong)param_1 + 0x13fc) = 1;
      param_1[0x28a] = (longlong)(double)fVar11;
    }
  }
  else if (iVar5 == 1) {
    if ((char)param_1[0x3d4] == '\0') {
      lVar6 = (**(code **)(*param_1 + 0x430))
                        (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
      if (lVar6 == 0) {
        local_78 = *(float *)((longlong)param_1 + 0x154) * 50.0 + *(float *)(param_1 + 0x2f);
        local_74 = *(float *)(param_1 + 0x2b) * 50.0 + *(float *)((longlong)param_1 + 0x17c);
        local_70 = *(float *)((longlong)param_1 + 0x15c) * 50.0 + *(float *)(param_1 + 0x30);
        local_68 = local_78;
        local_64 = local_74;
        local_60 = local_70;
      }
      else {
        local_78 = *(float *)(lVar6 + 0x178);
        local_74 = *(float *)(lVar6 + 0x17c);
        local_70 = *(float *)(lVar6 + 0x180);
        local_5c = *(float *)(param_1 + 0x2f) - local_78;
        local_54 = *(float *)(param_1 + 0x30) - local_70;
        local_58 = *(float *)((longlong)param_1 + 0x17c) - local_74;
        if ((DAT_1406081ac & 1) == 0) {
          DAT_1406081ac = DAT_1406081ac | 1;
        }
        D3DXVec3Normalize(&DAT_1406081b0,&local_5c);
        (**(code **)(*param_1 + 0x100))(param_1,&DAT_1406081b0);
      }
    }
    else {
      local_78 = *(float *)((longlong)param_1 + 0x1e94);
      *(undefined1 *)(param_1 + 0x3d4) = 0;
      local_74 = *(float *)(param_1 + 0x3d3);
      local_70 = *(float *)((longlong)param_1 + 0x1e9c);
    }
    *(undefined1 *)(param_1 + 0xc0) = 1;
    FUN_14032e070(param_1[0x1da],param_1 + 0x2f,&local_78,param_2,
                  *(undefined4 *)((longlong)param_1 + 0x1a74),(int)param_1[0x34e],
                  *(float *)(param_1 + 0x395) * 2.0,(int)param_1[0x3c5]);
    *(undefined4 *)((longlong)param_1 + 0x13fc) = 2;
    *(undefined4 *)(param_1 + 0xb7) = 0;
    param_1[0x28a] = 0;
  }
  else if (iVar5 == 2) {
    cVar3 = FUN_14032e2b0(param_1[0x1da],param_2,param_3,*(float *)(param_1 + 0x395) * 2.0,1);
    if (cVar3 != '\0') {
      *(undefined4 *)((longlong)param_1 + 0x13fc) = 3;
    }
  }
  else if (iVar5 == 3) {
    cVar3 = FUN_14032e4a0(param_1[0x1da],param_2,param_3,*(float *)(param_1 + 0x395) * 2.0,1);
    if (cVar3 != '\0') {
      lVar6 = param_1[0x1da];
      iVar5 = 0;
      *(undefined4 *)(param_1 + 0xb7) = 0;
      param_1[0x28a] = 0;
      *(undefined4 *)(param_1 + 0x2f) = *(undefined4 *)(lVar6 + 0x3c);
      plVar9 = param_1 + 0x3b5;
      *(undefined4 *)((longlong)param_1 + 0x17c) = *(undefined4 *)(lVar6 + 0x40);
      *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(lVar6 + 0x44);
      *(undefined1 *)(param_1 + 0xc0) = 0;
      FUN_1400015e0(param_1 + 0x299,plVar9,0,0xffffffffffffffff);
      if (7 < (ulonglong)param_1[0x3b8]) {
        plVar9 = (longlong *)*plVar9;
      }
      lVar6 = param_1[0x27b];
      lVar2 = param_1[0x381];
      lVar7 = -1;
      psVar10 = (short *)plVar9;
      do {
        if (lVar7 == 0) break;
        lVar7 = lVar7 + -1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      if (lVar7 != -2) {
        uVar8 = 0xffffffffffffffff;
        psVar10 = (short *)plVar9;
        do {
          if (uVar8 == 0) break;
          uVar8 = uVar8 - 1;
          sVar1 = *psVar10;
          psVar10 = psVar10 + 1;
        } while (sVar1 != 0);
        iVar4 = FUN_140123e30(lVar6 + 0x40,*(undefined8 *)(lVar6 + 0x50),plVar9,~uVar8 - 1);
        if (iVar4 != 0) {
          uVar8 = 0xffffffffffffffff;
          psVar10 = (short *)plVar9;
          do {
            if (uVar8 == 0) break;
            uVar8 = uVar8 - 1;
            sVar1 = *psVar10;
            psVar10 = psVar10 + 1;
          } while (sVar1 != 0);
          FUN_140001710(lVar6 + 0x40,plVar9,~uVar8 - 1);
          if (*(longlong *)(lVar6 + 0x10) != 0) {
            lVar7 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
            if (lVar7 != 0) {
              iVar5 = FUN_1402ce620(lVar7,plVar9);
              iVar5 = iVar5 + 1;
            }
            FUN_1402c5c00(lVar6,iVar5,(int)lVar2,0);
          }
        }
      }
      FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
      if (param_1[0x16f] == 0) {
        uVar12 = 0x3f800000;
      }
      else {
        uVar12 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
      }
      FUN_1402c5e50(param_1[0x27b],uVar12);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar6 + 0x54) == 1) {
        *(undefined8 *)(lVar6 + 0x10) = param_2;
        FUN_1402cc2c0(lVar6);
      }
      *(undefined4 *)(lVar6 + 0x54) = 0;
      *(undefined4 *)((longlong)param_1 + 0x13fc) = 4;
    }
  }
  else if ((iVar5 == 4) && (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1)) {
    (**(code **)(*param_1 + 0x980))(param_1,param_2);
  }
  return;
}



void FUN_14022af70(longlong *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  
  plVar1 = (longlong *)param_1[0x2f8];
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_1[0x2f9]) {
      if (*plVar1 != 0) {
        lVar3 = 0;
        lVar4 = *plVar1;
        if ((plVar1 != (longlong *)param_1[0x2f9]) &&
           (iVar2 = DAT_1406081cc + 1, bVar5 = DAT_1406081cc == 0, lVar4 = lVar3,
           DAT_1406081cc = iVar2, bVar5)) {
          FUN_140176d60(1);
        }
        if (*(longlong *)(lVar4 + 0x68) == *(longlong *)(lVar4 + 0x70)) {
          (**(code **)(*param_1 + 200))(param_1,2,1);
        }
        else {
          plVar1 = (longlong *)param_1[0x2f8];
          if (plVar1 != (longlong *)0x0) {
            if (plVar1 == (longlong *)param_1[0x2f9]) {
              lVar3 = *plVar1;
            }
            else {
              iVar2 = DAT_1406081cc + 1;
              bVar5 = DAT_1406081cc == 0;
              DAT_1406081cc = iVar2;
              if (bVar5) {
                FUN_140176d60(1);
              }
            }
          }
          if (*(int *)(lVar3 + 4) == 0) {
            FUN_14022b220(param_1,param_2);
          }
          else {
            lVar3 = FUN_14023ad10(param_1 + 0x2f8);
            if (*(int *)(lVar3 + 4) == 1) {
              FUN_14022b0b0(param_1,param_2);
            }
          }
        }
      }
    }
    else {
      iVar2 = DAT_1406081cc + 1;
      bVar5 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_14022b0b0(longlong *param_1,double param_2)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  bool bVar7;
  
  if ((double)param_1[0x2f3] <= param_2) {
    if (param_1[0x16b] == 0) {
      plVar5 = (longlong *)param_1[0x2f8];
      lVar6 = 0;
      lVar2 = lVar6;
      if (plVar5 != (longlong *)0x0) {
        if (plVar5 == (longlong *)param_1[0x2f9]) {
          lVar2 = *plVar5;
        }
        else {
          iVar4 = DAT_1406081cc + 1;
          bVar7 = DAT_1406081cc == 0;
          DAT_1406081cc = iVar4;
          if (bVar7) {
            FUN_140176d60(1);
          }
        }
      }
      lVar2 = *(longlong *)(lVar2 + 0x68);
      plVar5 = (longlong *)param_1[0x2f8];
      lVar3 = lVar6;
      if (plVar5 != (longlong *)0x0) {
        if (plVar5 == (longlong *)param_1[0x2f9]) {
          lVar3 = *plVar5;
        }
        else {
          iVar4 = DAT_1406081cc + 1;
          bVar7 = DAT_1406081cc == 0;
          DAT_1406081cc = iVar4;
          if (bVar7) {
            FUN_140176d60(1);
          }
        }
      }
      lVar3 = *(longlong *)(lVar3 + 0x68);
      plVar5 = (longlong *)param_1[0x2f8];
      if (plVar5 != (longlong *)0x0) {
        if (plVar5 == (longlong *)param_1[0x2f9]) {
          lVar6 = *plVar5;
        }
        else {
          iVar4 = DAT_1406081cc + 1;
          bVar7 = DAT_1406081cc == 0;
          DAT_1406081cc = iVar4;
          if (bVar7) {
            FUN_140176d60(1);
          }
        }
      }
      plVar5 = *(longlong **)(lVar6 + 0x68);
      if (7 < (ulonglong)plVar5[3]) {
        plVar5 = (longlong *)*plVar5;
      }
      (**(code **)(*param_1 + 0x8f8))
                (param_1,plVar5,*(undefined4 *)(lVar3 + 0x28),*(undefined4 *)(lVar2 + 0x60),1,
                 param_1[0x2fa],0);
    }
    else {
      cVar1 = FUN_140232e40(param_1,*(undefined4 *)(param_1[0x16b] + 0x18),
                            *(undefined4 *)(param_1[0x16b] + 0x28),1);
      if (cVar1 == '\0') {
                    // WARNING: Could not recover jumptable at 0x00014022b0ff. Too many branches
                    // WARNING: Treating indirect jump as call
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
        return;
      }
    }
  }
  return;
}



void FUN_14022b220(longlong param_1,double param_2)

{
  short sVar1;
  undefined4 uVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  ulonglong uVar6;
  longlong *plVar7;
  short *psVar8;
  int iVar9;
  bool bVar10;
  float fVar11;
  
  if (((*(longlong *)(param_1 + 0x17c0) != 0) &&
      (*(longlong *)(param_1 + 0x17c0) != *(longlong *)(param_1 + 0x17c8))) &&
     (iVar9 = DAT_1406081cc + 1, bVar10 = DAT_1406081cc == 0, DAT_1406081cc = iVar9, bVar10)) {
    FUN_140176d60(1);
  }
  if (param_2 < *(double *)(param_1 + 0x1798)) goto LAB_14022b5d1;
  plVar7 = *(longlong **)(param_1 + 0x17c0);
  if (plVar7 == (longlong *)0x0) {
LAB_14022b2b8:
    lVar4 = 0;
  }
  else {
    if (plVar7 != *(longlong **)(param_1 + 0x17c8)) {
      iVar9 = DAT_1406081cc + 1;
      bVar10 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar9;
      if (bVar10) {
        FUN_140176d60(1);
      }
      goto LAB_14022b2b8;
    }
    lVar4 = *plVar7;
  }
  lVar4 = *(longlong *)(lVar4 + 0x70) - *(longlong *)(lVar4 + 0x68);
  if ((ulonglong)(lVar4 / 0x68) < 2) goto LAB_14022b5d1;
  plVar7 = *(longlong **)(param_1 + 0x17c0);
  if (plVar7 == (longlong *)0x0) {
LAB_14022b324:
    lVar4 = 0;
  }
  else {
    if (plVar7 != *(longlong **)(param_1 + 0x17c8)) {
      iVar9 = DAT_1406081cc + 1;
      bVar10 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar9;
      if (bVar10) {
        FUN_140176d60(CONCAT71((int7)((ulonglong)lVar4 >> 8),1));
      }
      goto LAB_14022b324;
    }
    lVar4 = *plVar7;
  }
  plVar7 = *(longlong **)(param_1 + 0x17c0);
  lVar4 = *(longlong *)(lVar4 + 0x68);
  if (plVar7 == (longlong *)0x0) {
LAB_14022b35b:
    lVar5 = 0;
  }
  else {
    if (plVar7 != *(longlong **)(param_1 + 0x17c8)) {
      iVar9 = DAT_1406081cc + 1;
      bVar10 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar9;
      if (bVar10) {
        FUN_140176d60(1);
      }
      goto LAB_14022b35b;
    }
    lVar5 = *plVar7;
  }
  FUN_14023b7f0(lVar4 + 0x68,*(undefined8 *)(lVar5 + 0x70),lVar4);
  FUN_14023b880(*(longlong *)(lVar5 + 0x70) + -0x68);
  *(longlong *)(lVar5 + 0x70) = *(longlong *)(lVar5 + 0x70) + -0x68;
  plVar7 = *(longlong **)(param_1 + 0x17c0);
  if (plVar7 == (longlong *)0x0) {
LAB_14022b3b3:
    lVar4 = 0;
  }
  else {
    if (plVar7 != *(longlong **)(param_1 + 0x17c8)) {
      iVar9 = DAT_1406081cc + 1;
      bVar10 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar9;
      if (bVar10) {
        FUN_140176d60(1);
      }
      goto LAB_14022b3b3;
    }
    lVar4 = *plVar7;
  }
  plVar7 = (longlong *)(param_1 + 0x14c8);
  FUN_1400015e0(plVar7,*(longlong *)(lVar4 + 0x68) + 0x30,0,0xffffffffffffffff);
  plVar3 = *(longlong **)(param_1 + 0x17c0);
  if (plVar3 == (longlong *)0x0) {
LAB_14022b40d:
    lVar4 = 0;
  }
  else {
    if (plVar3 != *(longlong **)(param_1 + 0x17c8)) {
      iVar9 = DAT_1406081cc + 1;
      bVar10 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar9;
      if (bVar10) {
        FUN_140176d60(1);
      }
      goto LAB_14022b40d;
    }
    lVar4 = *plVar3;
  }
  iVar9 = DAT_1406081cc;
  *(undefined4 *)(param_1 + 0x1c08) = *(undefined4 *)(*(longlong *)(lVar4 + 0x68) + 0x58);
  plVar3 = *(longlong **)(param_1 + 0x17c0);
  if (plVar3 == (longlong *)0x0) {
LAB_14022b44a:
    lVar4 = 0;
  }
  else {
    if (plVar3 != *(longlong **)(param_1 + 0x17c8)) {
      DAT_1406081cc = iVar9 + 1;
      if (iVar9 == 0) {
        FUN_140176d60();
      }
      goto LAB_14022b44a;
    }
    lVar4 = *plVar3;
  }
  *(double *)(param_1 + 0x1798) = (double)*(float *)(*(longlong *)(lVar4 + 0x68) + 0x5c) + param_2;
  if (*(int *)(param_1 + 300) != 0x18) {
    if (7 < *(ulonglong *)(param_1 + 0x14e0)) {
      plVar7 = (longlong *)*plVar7;
    }
    lVar4 = *(longlong *)(param_1 + 0x13d8);
    uVar2 = *(undefined4 *)(param_1 + 0x1c08);
    lVar5 = -1;
    psVar8 = (short *)plVar7;
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    if (lVar5 != -2) {
      uVar6 = 0xffffffffffffffff;
      psVar8 = (short *)plVar7;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        sVar1 = *psVar8;
        psVar8 = psVar8 + 1;
      } while (sVar1 != 0);
      iVar9 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),plVar7,~uVar6 - 1);
      if (iVar9 != 0) {
        uVar6 = 0xffffffffffffffff;
        psVar8 = (short *)plVar7;
        do {
          if (uVar6 == 0) break;
          uVar6 = uVar6 - 1;
          sVar1 = *psVar8;
          psVar8 = psVar8 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar4 + 0x40,plVar7,~uVar6 - 1);
        if (*(longlong *)(lVar4 + 0x10) != 0) {
          lVar5 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
          if (lVar5 == 0) {
            iVar9 = 0;
          }
          else {
            iVar9 = FUN_1402ce620(lVar5,plVar7);
            iVar9 = iVar9 + 1;
          }
          FUN_1402c5c00(lVar4,iVar9,uVar2,1);
        }
      }
    }
    FUN_1402c5e50(*(undefined8 *)(param_1 + 0x13d8),0x3f800000);
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x50) = 0;
    lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20);
    if (*(int *)(lVar4 + 0x54) == 1) {
      *(double *)(lVar4 + 0x10) = param_2;
      FUN_1402cc2c0(lVar4);
    }
    *(undefined4 *)(lVar4 + 0x54) = 0;
    fVar11 = (float)FUN_1402c5ee0(*(undefined8 *)(param_1 + 0x13d8));
    *(double *)(param_1 + 0x1450) = (double)fVar11;
  }
LAB_14022b5d1:
  if (*(int *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x54) == 1) {
    plVar7 = (longlong *)(param_1 + 0x14c8);
    if (7 < *(ulonglong *)(param_1 + 0x14e0)) {
      plVar7 = (longlong *)*plVar7;
    }
    FUN_1402c5b20(*(longlong *)(param_1 + 0x13d8),plVar7,*(undefined4 *)(param_1 + 0x1c08),1,1);
    lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20);
    if (*(int *)(lVar4 + 0x54) == 1) {
      *(double *)(lVar4 + 0x10) = param_2;
      FUN_1402cc2c0(lVar4);
    }
    *(undefined4 *)(lVar4 + 0x54) = 0;
  }
  FUN_14022b650(param_1);
  return;
}



void FUN_14022b650(longlong *param_1)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  longlong *plVar6;
  bool bVar7;
  
  if ((char)param_1[0x3bf] == '\0') {
    return;
  }
  lVar2 = param_1[0x16b];
  if (lVar2 != 0) {
    cVar1 = FUN_140232e40(param_1,*(undefined4 *)(lVar2 + 0x18),*(undefined4 *)(lVar2 + 0x28),1);
    if (cVar1 == '\0') {
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    }
    goto LAB_14022b792;
  }
  plVar6 = (longlong *)param_1[0x2f8];
  if (plVar6 == (longlong *)0x0) {
LAB_14022b6e3:
    lVar2 = 0;
  }
  else {
    if (plVar6 != (longlong *)param_1[0x2f9]) {
      iVar5 = DAT_1406081cc + 1;
      bVar7 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar5;
      if (bVar7) {
        FUN_140176d60(1);
      }
      goto LAB_14022b6e3;
    }
    lVar2 = *plVar6;
  }
  lVar2 = *(longlong *)(lVar2 + 0x68);
  plVar6 = (longlong *)param_1[0x2f8];
  if (plVar6 == (longlong *)0x0) {
LAB_14022b71d:
    lVar3 = 0;
  }
  else {
    if (plVar6 != (longlong *)param_1[0x2f9]) {
      iVar5 = DAT_1406081cc + 1;
      bVar7 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar5;
      if (bVar7) {
        FUN_140176d60(1);
      }
      goto LAB_14022b71d;
    }
    lVar3 = *plVar6;
  }
  lVar3 = *(longlong *)(lVar3 + 0x68);
  plVar6 = (longlong *)param_1[0x2f8];
  if (plVar6 == (longlong *)0x0) {
LAB_14022b751:
    lVar4 = 0;
  }
  else {
    if (plVar6 != (longlong *)param_1[0x2f9]) {
      iVar5 = DAT_1406081cc + 1;
      bVar7 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar5;
      if (bVar7) {
        FUN_140176d60(1);
      }
      goto LAB_14022b751;
    }
    lVar4 = *plVar6;
  }
  plVar6 = *(longlong **)(lVar4 + 0x68);
  if (7 < (ulonglong)plVar6[3]) {
    plVar6 = (longlong *)*plVar6;
  }
  (**(code **)(*param_1 + 0x8f8))
            (param_1,plVar6,*(undefined4 *)(lVar3 + 0x28),*(undefined4 *)(lVar2 + 0x60),1,
             param_1[0x2fa],0);
LAB_14022b792:
  FUN_14023ae90(param_1 + 0x2f8);
  param_1[0x2f8] = 0;
  param_1[0x2f9] = 0;
  *(undefined1 *)(param_1 + 0x3bf) = 0;
  return;
}



void FUN_14022b7e0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  
  plVar1 = (longlong *)param_1[0x2f8];
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_1[0x2f9]) {
      if (*plVar1 != 0) {
        if (*(int *)((longlong)param_1 + 300) != 0xf) {
          *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
        }
        (**(code **)(*param_1 + 0xa08))();
        *(int *)(param_1 + 0x38b) = (int)param_1[0x2f];
        *(undefined4 *)((longlong)param_1 + 0x1c5c) = *(undefined4 *)((longlong)param_1 + 0x17c);
        *(int *)(param_1 + 0x38c) = (int)param_1[0x30];
        (**(code **)(*param_1 + 0x6b0))(param_1,param_2,param_3);
      }
    }
    else {
      iVar2 = DAT_1406081cc + 1;
      bVar3 = DAT_1406081cc == 0;
      DAT_1406081cc = iVar2;
      if (bVar3) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_14022b8b0(longlong *param_1,undefined8 param_2)

{
  short sVar1;
  longlong lVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong *plVar8;
  short *psVar9;
  float fVar10;
  undefined4 uVar11;
  
  if (param_1[0x26] != 0) {
    iVar5 = (int)param_1[0x283];
    if (iVar5 == 0) {
      *(undefined1 *)(param_1 + 0x30f) = 0;
      *(undefined4 *)(param_1 + 0x283) = 1;
      fVar10 = (float)(**(code **)(*param_1 + 0xa80))(param_1);
      FUN_14032da30(param_1[0x1da],param_2,fVar10 * *(float *)((longlong)param_1 + 0x1a7c),
                    (int)param_1[0x34f],(longlong)param_1 + 0x133c,
                    *(float *)(param_1 + 0x3ca) * *(float *)(param_1[0x26] + 0x294) * 0.5,
                    (int)param_1[0x3c5],0x461c4000);
      if (*(char *)((longlong)param_1 + 0x2034) != '\0') {
        *(undefined4 *)(param_1 + 0x283) = 1;
        return;
      }
      (**(code **)(*param_1 + 200))(param_1,0x4f,1);
    }
    else if (iVar5 == 1) {
      cVar4 = FUN_14032daf0(param_1[0x1da]);
      if (cVar4 != '\0') {
        *(undefined4 *)(param_1 + 0x283) = 2;
        *(undefined1 *)((longlong)param_1 + 0x2034) = 1;
        return;
      }
    }
    else if (iVar5 == 2) {
      cVar4 = FUN_14032dd70();
      if (cVar4 != '\0') {
        plVar8 = param_1 + 0x37c;
        *(undefined4 *)(param_1 + 0x283) = 3;
        if (7 < (ulonglong)param_1[0x37f]) {
          plVar8 = (longlong *)*plVar8;
        }
        lVar2 = param_1[0x27b];
        lVar3 = param_1[0x381];
        lVar6 = -1;
        psVar9 = (short *)plVar8;
        do {
          if (lVar6 == 0) break;
          lVar6 = lVar6 + -1;
          sVar1 = *psVar9;
          psVar9 = psVar9 + 1;
        } while (sVar1 != 0);
        if (lVar6 != -2) {
          uVar7 = 0xffffffffffffffff;
          psVar9 = (short *)plVar8;
          do {
            if (uVar7 == 0) break;
            uVar7 = uVar7 - 1;
            sVar1 = *psVar9;
            psVar9 = psVar9 + 1;
          } while (sVar1 != 0);
          iVar5 = FUN_140123e30(lVar2 + 0x40,*(undefined8 *)(lVar2 + 0x50),plVar8,~uVar7 - 1);
          if (iVar5 != 0) {
            uVar7 = 0xffffffffffffffff;
            psVar9 = (short *)plVar8;
            do {
              if (uVar7 == 0) break;
              uVar7 = uVar7 - 1;
              sVar1 = *psVar9;
              psVar9 = psVar9 + 1;
            } while (sVar1 != 0);
            FUN_140001710(lVar2 + 0x40,plVar8,~uVar7 - 1);
            if (*(longlong *)(lVar2 + 0x10) != 0) {
              lVar6 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
              if (lVar6 == 0) {
                iVar5 = 0;
              }
              else {
                iVar5 = FUN_1402ce620(lVar6,plVar8);
                iVar5 = iVar5 + 1;
              }
              FUN_1402c5c00(lVar2,iVar5,(int)lVar3,1);
            }
          }
        }
        if (param_1[0x16f] == 0) {
          uVar11 = 0x3f800000;
        }
        else {
          uVar11 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
        }
        FUN_1402c5e50(param_1[0x27b],uVar11);
        *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
        lVar2 = *(longlong *)(param_1[0x27b] + 0x20);
        if (*(int *)(lVar2 + 0x54) == 1) {
          *(undefined8 *)(lVar2 + 0x10) = param_2;
          FUN_1402cc2c0(lVar2);
        }
        *(undefined4 *)(lVar2 + 0x54) = 0;
        *(undefined1 *)((longlong)param_1 + 0x2034) = 1;
        return;
      }
    }
    else if ((iVar5 == 3) && (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1)) {
      *(undefined4 *)(param_1 + 0x30b) = 0;
      (**(code **)(*param_1 + 200))(param_1,0x20);
      *(undefined1 *)((longlong)param_1 + 0x2034) = 1;
      return;
    }
  }
  return;
}



void FUN_14022bbb0(longlong *param_1)

{
  int iVar1;
  char cVar2;
  
  if (param_1[0x26] != 0) {
    iVar1 = (int)param_1[0x285];
    if (iVar1 == 0) {
      *(undefined1 *)(param_1 + 0xc0) = 1;
      *(undefined1 *)(param_1 + 0x30f) = 0;
      *(undefined4 *)(param_1 + 0x285) = 1;
      (**(code **)(*param_1 + 0xa80))(param_1);
      FUN_14032da30(param_1[0x1da]);
    }
    else if (iVar1 == 1) {
      cVar2 = FUN_14032daf0(param_1[0x1da]);
      if (cVar2 != '\0') {
        *(undefined4 *)(param_1 + 0x285) = 2;
        return;
      }
    }
    else if (iVar1 == 2) {
      cVar2 = FUN_14032dd70(param_1[0x1da]);
      if (cVar2 != '\0') {
        (**(code **)(*param_1 + 0x290))(param_1);
        *(undefined4 *)(param_1 + 0x345) = 0;
        (**(code **)(*param_1 + 0x990))(param_1);
        *(undefined4 *)(param_1 + 0x30b) = 1;
                    // WARNING: Could not recover jumptable at 0x00014022bc51. Too many branches
                    // WARNING: Treating indirect jump as call
        (**(code **)(*param_1 + 200))(param_1,0x22,1);
        return;
      }
    }
  }
  return;
}



void FUN_14022bd20(longlong *param_1)

{
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))();
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    (**(code **)(*param_1 + 200))(param_1,0x20);
  }
  return;
}



void FUN_14022bd70(longlong *param_1,double param_2)

{
  short sVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong lVar9;
  short *psVar10;
  short *psVar11;
  float fVar12;
  undefined4 uVar13;
  
  if ((int)param_1[0x282] == 0) {
    param_1[0x30a] = (longlong)param_2;
    *(undefined4 *)(param_1 + 0x282) = 1;
  }
  else if ((int)param_1[0x282] == 1) {
    iVar3 = (int)param_1[0x30b];
    plVar5 = *(longlong **)(param_1[0x183] + 0x30);
    plVar2 = *(longlong **)(param_1[0x183] + 0x38);
    if (plVar5 != plVar2) {
      if ((iVar3 < 0) || ((int)((longlong)plVar2 - (longlong)plVar5 >> 4) <= iVar3)) {
        lVar9 = *plVar5;
      }
      else {
        lVar9 = plVar5[(longlong)iVar3 * 2];
      }
      if ((lVar9 != 0) && ((double)*(float *)(lVar9 + 4) <= param_2 - (double)param_1[0x30a])) {
        lVar4 = (**(code **)(*param_1 + 0xe0))();
        if (lVar4 != 0) {
          plVar5 = (longlong *)(**(code **)(*param_1 + 0xe0))(param_1);
          iVar3 = (**(code **)(*plVar5 + 0xe8))();
          if (iVar3 == 1) {
            iVar3 = rand();
            plVar5 = (longlong *)(**(code **)(*param_1 + 0xe0))(param_1);
            fVar12 = (float)(**(code **)(*plVar5 + 0xf0))();
            if ((float)iVar3 * 3.0517578e-05 < fVar12) {
              plVar5 = (longlong *)(**(code **)(*param_1 + 0xe0))(param_1);
              lVar9 = *param_1;
              uVar6 = (**(code **)(*plVar5 + 0xb0))(plVar5);
              (**(code **)(lVar9 + 0x910))(param_1,uVar6);
              goto LAB_14022c009;
            }
          }
        }
        psVar10 = (short *)(lVar9 + 0x58);
        if (7 < *(ulonglong *)(lVar9 + 0x70)) {
          psVar10 = *(short **)psVar10;
        }
        lVar9 = param_1[0x27b];
        lVar4 = param_1[0x381];
        lVar7 = -1;
        psVar11 = psVar10;
        do {
          if (lVar7 == 0) break;
          lVar7 = lVar7 + -1;
          sVar1 = *psVar11;
          psVar11 = psVar11 + 1;
        } while (sVar1 != 0);
        if (lVar7 != -2) {
          uVar8 = 0xffffffffffffffff;
          psVar11 = psVar10;
          do {
            if (uVar8 == 0) break;
            uVar8 = uVar8 - 1;
            sVar1 = *psVar11;
            psVar11 = psVar11 + 1;
          } while (sVar1 != 0);
          iVar3 = FUN_140123e30(lVar9 + 0x40,*(undefined8 *)(lVar9 + 0x50),psVar10,~uVar8 - 1);
          if (iVar3 != 0) {
            uVar8 = 0xffffffffffffffff;
            psVar11 = psVar10;
            do {
              if (uVar8 == 0) break;
              uVar8 = uVar8 - 1;
              sVar1 = *psVar11;
              psVar11 = psVar11 + 1;
            } while (sVar1 != 0);
            FUN_140001710(lVar9 + 0x40,psVar10,~uVar8 - 1);
            if (*(longlong *)(lVar9 + 0x10) != 0) {
              lVar7 = *(longlong *)(*(longlong *)(lVar9 + 0x10) + 0xd8);
              if (lVar7 == 0) {
                iVar3 = 0;
              }
              else {
                iVar3 = FUN_1402ce620(lVar7,psVar10);
                iVar3 = iVar3 + 1;
              }
              FUN_1402c5c00(lVar9,iVar3,(int)lVar4,1);
            }
          }
        }
        if (param_1[0x16f] == 0) {
          uVar13 = 0x3f800000;
        }
        else {
          uVar13 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
        }
        FUN_1402c5e50(param_1[0x27b],uVar13);
        *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
        lVar9 = *(longlong *)(param_1[0x27b] + 0x20);
        if (*(int *)(lVar9 + 0x54) == 1) {
          *(double *)(lVar9 + 0x10) = param_2;
          FUN_1402cc2c0(lVar9);
        }
        *(undefined4 *)(lVar9 + 0x54) = 0;
        fVar12 = (float)FUN_1402c5ee0(param_1[0x27b]);
        param_1[0x28b] = 0;
        param_1[0x28a] = (longlong)(double)fVar12;
        (**(code **)(*param_1 + 200))(param_1,0x21);
      }
    }
  }
LAB_14022c009:
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022c030(longlong param_1,undefined8 param_2)

{
  if (*(int *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x54) == 1) {
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022c080(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  short sVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  ulonglong uVar7;
  undefined8 in_RDX;
  longlong *plVar8;
  longlong lVar9;
  short *psVar10;
  float fVar11;
  undefined4 uVar12;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  lVar2 = param_1[0x27b];
  if (*(int *)(*(longlong *)(lVar2 + 0x20) + 0x54) == 1) {
    iVar5 = (int)param_1[0x30b];
    *(undefined4 *)((longlong)param_1 + 300) = 0x20;
    *(undefined4 *)(param_1 + 0x282) = 1;
    plVar8 = *(longlong **)(param_1[0x183] + 0x30);
    plVar3 = *(longlong **)(param_1[0x183] + 0x38);
    if (plVar8 == plVar3) {
      return;
    }
    if ((iVar5 < 0) || ((int)((longlong)plVar3 - (longlong)plVar8 >> 4) <= iVar5)) {
      lVar9 = *plVar8;
    }
    else {
      lVar9 = plVar8[(longlong)iVar5 * 2];
    }
    if (lVar9 == 0) {
      return;
    }
    plVar8 = (longlong *)(lVar9 + 0x30);
    if (7 < *(ulonglong *)(lVar9 + 0x48)) {
      plVar8 = (longlong *)*plVar8;
    }
    lVar4 = param_1[0x381];
    lVar6 = -1;
    psVar10 = (short *)plVar8;
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      sVar1 = *psVar10;
      psVar10 = psVar10 + 1;
    } while (sVar1 != 0);
    if (lVar6 != -2) {
      uVar7 = 0xffffffffffffffff;
      psVar10 = (short *)plVar8;
      do {
        if (uVar7 == 0) break;
        uVar7 = uVar7 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      iVar5 = FUN_140123e30(lVar2 + 0x40,*(undefined8 *)(lVar2 + 0x50),plVar8,~uVar7 - 1);
      if (iVar5 != 0) {
        uVar7 = 0xffffffffffffffff;
        psVar10 = (short *)plVar8;
        do {
          if (uVar7 == 0) break;
          uVar7 = uVar7 - 1;
          sVar1 = *psVar10;
          psVar10 = psVar10 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar2 + 0x40,plVar8,~uVar7 - 1);
        if (*(longlong *)(lVar2 + 0x10) != 0) {
          lVar6 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
          if (lVar6 == 0) {
            iVar5 = 0;
          }
          else {
            iVar5 = FUN_1402ce620(lVar6,plVar8);
            iVar5 = iVar5 + 1;
          }
          FUN_1402c5c00(lVar2,iVar5,(int)lVar4,1);
        }
      }
    }
    plVar8 = (longlong *)(lVar9 + 0x58);
    if (7 < *(ulonglong *)(lVar9 + 0x70)) {
      plVar8 = (longlong *)*plVar8;
    }
    uVar7 = 0xffffffffffffffff;
    psVar10 = (short *)plVar8;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar1 = *psVar10;
      psVar10 = psVar10 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1[0x27b] + 0x68,plVar8,~uVar7 - 1);
    if (param_1[0x16f] == 0) {
      uVar12 = 0x3f800000;
    }
    else {
      uVar12 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar12);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar2 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar2 + 0x54) == 1) {
      *(undefined8 *)(lVar2 + 0x10) = param_2;
      FUN_1402cc2c0(lVar2);
    }
    *(undefined4 *)(lVar2 + 0x54) = 0;
    fVar11 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0;
    param_1[0x28a] = (longlong)(double)fVar11;
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022c2d0(longlong *param_1,longlong param_2)

{
  short sVar1;
  wchar_t wVar2;
  wchar_t wVar3;
  longlong lVar4;
  longlong lVar5;
  char cVar6;
  int iVar7;
  wchar_t *pwVar8;
  longlong lVar9;
  ulonglong uVar10;
  longlong *plVar11;
  wchar_t *pwVar12;
  longlong *plVar13;
  longlong lVar14;
  longlong *plVar15;
  short *psVar16;
  bool bVar17;
  float fVar18;
  undefined4 uVar19;
  undefined4 uVar20;
  
  iVar7 = (int)param_1[0x283];
  if (iVar7 == 0) {
    plVar11 = (longlong *)param_1[0x1da];
    lVar14 = param_1[0x3c5];
    lVar9 = param_1[0x350];
    *(undefined4 *)(param_1 + 0x283) = 1;
    *(undefined1 *)(param_1 + 0x30f) = 0;
    fVar18 = (float)(**(code **)(*param_1 + 0xa80))(param_1);
    lVar4 = *plVar11;
    fVar18 = fVar18 * *(float *)((longlong)param_1 + 0x1a84);
    *(int *)((longlong)plVar11 + 0x5c) = (int)lVar14;
    *(int *)(plVar11 + 1) = (int)lVar14;
    plVar11[2] = param_2;
    *(int *)((longlong)plVar11 + 0x1c) = (int)lVar9;
    *(float *)(plVar11 + 3) = fVar18;
    *(undefined4 *)((longlong)plVar11 + 0x24) = *(undefined4 *)(lVar4 + 0x178);
    *(undefined4 *)(plVar11 + 5) = *(undefined4 *)(lVar4 + 0x17c);
    *(undefined4 *)((longlong)plVar11 + 0x2c) = *(undefined4 *)(lVar4 + 0x180);
    *(float *)(plVar11 + 5) = *(float *)(plVar11 + 5) + 0.0;
    *(undefined4 *)(plVar11 + 6) = *(undefined4 *)((longlong)param_1 + 0x133c);
    *(int *)((longlong)plVar11 + 0x34) = (int)param_1[0x268];
    *(undefined4 *)(plVar11 + 7) = *(undefined4 *)((longlong)param_1 + 0x1344);
    uVar20 = FUN_1403144d0(fVar18,(int)lVar9,*(undefined4 *)(lVar4 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar11 + 4) = uVar20;
    *(undefined4 *)(lVar4 + 0xee0) = uVar20;
    *(undefined4 *)(plVar11 + 0xc) = 0x461c4000;
  }
  else if (iVar7 == 1) {
    cVar6 = FUN_14032daf0(param_1[0x1da]);
    if (cVar6 != '\0') {
      *(undefined4 *)(param_1 + 0x283) = 2;
    }
  }
  else if (iVar7 == 2) {
    plVar11 = param_1 + 0x37c;
    plVar13 = plVar11;
    if (7 < (ulonglong)param_1[0x37f]) {
      plVar13 = (longlong *)*plVar11;
    }
    lVar4 = param_1[0x27b];
    pwVar12 = (wchar_t *)(lVar4 + 0x40);
    pwVar8 = pwVar12;
    if (7 < *(ulonglong *)(lVar4 + 0x58)) {
      pwVar8 = *(wchar_t **)pwVar12;
    }
    lVar14 = (longlong)plVar13 - (longlong)pwVar8;
    do {
      wVar2 = *pwVar8;
      wVar3 = *(wchar_t *)((longlong)pwVar8 + lVar14);
      if (wVar2 != wVar3) break;
      pwVar8 = pwVar8 + 1;
    } while (wVar3 != L'\0');
    uVar20 = 0x3f800000;
    if (wVar2 != wVar3) {
      bVar17 = *(ulonglong *)(lVar4 + 0x58) == 8;
      if (7 < *(ulonglong *)(lVar4 + 0x58)) {
        pwVar12 = *(wchar_t **)pwVar12;
      }
      lVar14 = 0xd;
      pwVar8 = L"sky_damage02";
      do {
        if (lVar14 == 0) break;
        lVar14 = lVar14 + -1;
        bVar17 = *pwVar12 == *pwVar8;
        pwVar12 = pwVar12 + 1;
        pwVar8 = pwVar8 + 1;
      } while (bVar17);
      if ((!bVar17) || (*(int *)(*(longlong *)(lVar4 + 0x20) + 0x54) == 1)) {
        plVar13 = plVar11;
        if (7 < (ulonglong)param_1[0x37f]) {
          plVar13 = (longlong *)*plVar11;
        }
        lVar14 = param_1[0x381];
        lVar9 = -1;
        plVar15 = plVar13;
        do {
          if (lVar9 == 0) break;
          lVar9 = lVar9 + -1;
          lVar5 = *plVar15;
          plVar15 = (longlong *)((longlong)plVar15 + 2);
        } while ((short)lVar5 != 0);
        if (lVar9 != -2) {
          uVar10 = 0xffffffffffffffff;
          plVar15 = plVar13;
          do {
            if (uVar10 == 0) break;
            uVar10 = uVar10 - 1;
            lVar9 = *plVar15;
            plVar15 = (longlong *)((longlong)plVar15 + 2);
          } while ((short)lVar9 != 0);
          iVar7 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),plVar13,~uVar10 - 1);
          if (iVar7 != 0) {
            uVar10 = 0xffffffffffffffff;
            plVar15 = plVar13;
            do {
              if (uVar10 == 0) break;
              uVar10 = uVar10 - 1;
              lVar9 = *plVar15;
              plVar15 = (longlong *)((longlong)plVar15 + 2);
            } while ((short)lVar9 != 0);
            FUN_140001710(lVar4 + 0x40,plVar13,~uVar10 - 1);
            if (*(longlong *)(lVar4 + 0x10) != 0) {
              lVar9 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
              if (lVar9 == 0) {
                iVar7 = 0;
              }
              else {
                iVar7 = FUN_1402ce620(lVar9,plVar13);
                iVar7 = iVar7 + 1;
              }
              FUN_1402c5c00(lVar4,iVar7,(int)lVar14,1);
            }
          }
        }
        FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
        if (param_1[0x16f] == 0) {
          uVar19 = 0x3f800000;
        }
        else {
          uVar19 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
        }
        FUN_1402c5e50(param_1[0x27b],uVar19);
        *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
        lVar4 = *(longlong *)(param_1[0x27b] + 0x20);
        if (*(int *)(lVar4 + 0x54) == 1) {
          *(longlong *)(lVar4 + 0x10) = param_2;
          FUN_1402cc2c0(lVar4);
        }
        *(undefined4 *)(lVar4 + 0x54) = 0;
        *(undefined4 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) = 2;
      }
    }
    cVar6 = FUN_14032dd70(param_1[0x1da],param_2);
    if (cVar6 != '\0') {
      *(undefined4 *)(param_1 + 0x283) = 3;
      if (7 < (ulonglong)param_1[0x37f]) {
        plVar11 = (longlong *)*plVar11;
      }
      lVar4 = param_1[0x27b];
      lVar14 = param_1[0x381];
      lVar9 = -1;
      psVar16 = (short *)plVar11;
      do {
        if (lVar9 == 0) break;
        lVar9 = lVar9 + -1;
        sVar1 = *psVar16;
        psVar16 = psVar16 + 1;
      } while (sVar1 != 0);
      if (lVar9 != -2) {
        uVar10 = 0xffffffffffffffff;
        psVar16 = (short *)plVar11;
        do {
          if (uVar10 == 0) break;
          uVar10 = uVar10 - 1;
          sVar1 = *psVar16;
          psVar16 = psVar16 + 1;
        } while (sVar1 != 0);
        iVar7 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),plVar11,~uVar10 - 1);
        if (iVar7 != 0) {
          uVar10 = 0xffffffffffffffff;
          psVar16 = (short *)plVar11;
          do {
            if (uVar10 == 0) break;
            uVar10 = uVar10 - 1;
            sVar1 = *psVar16;
            psVar16 = psVar16 + 1;
          } while (sVar1 != 0);
          FUN_140001710(lVar4 + 0x40,plVar11,~uVar10 - 1);
          if (*(longlong *)(lVar4 + 0x10) != 0) {
            lVar9 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
            if (lVar9 == 0) {
              iVar7 = 0;
            }
            else {
              iVar7 = FUN_1402ce620(lVar9,plVar11);
              iVar7 = iVar7 + 1;
            }
            FUN_1402c5c00(lVar4,iVar7,(int)lVar14,1);
          }
        }
      }
      FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
      if (param_1[0x16f] != 0) {
        uVar20 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
      }
      FUN_1402c5e50(param_1[0x27b],uVar20);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar4 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar4 + 0x54) == 1) {
        *(longlong *)(lVar4 + 0x10) = param_2;
        FUN_1402cc2c0(lVar4);
      }
      *(undefined4 *)(lVar4 + 0x54) = 0;
    }
  }
  else if ((iVar7 == 3) && (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1)) {
    *(undefined4 *)(param_1 + 0x30b) = 0;
    (**(code **)(*param_1 + 200))(param_1,0x20);
  }
  return;
}



void FUN_14022c770(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  short sVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong lVar8;
  short *psVar9;
  short *psVar10;
  float fVar11;
  
  iVar5 = (**(code **)(*param_1 + 0xb0))();
  if ((iVar5 == 4) && (1.0 <= *(float *)(param_1 + 0xb3))) {
    *(undefined4 *)((longlong)param_1 + 300) = 0;
    return;
  }
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  if (*(int *)((longlong)param_1 + 0x141c) == 0) {
    iVar5 = (int)param_1[0x30b];
    plVar2 = *(longlong **)(param_1[0x183] + 0x30);
    plVar3 = *(longlong **)(param_1[0x183] + 0x38);
    if (plVar2 == plVar3) {
      return;
    }
    if ((iVar5 < 0) || ((int)((longlong)plVar3 - (longlong)plVar2 >> 4) <= iVar5)) {
      lVar8 = *plVar2;
    }
    else {
      lVar8 = plVar2[(longlong)iVar5 * 2];
    }
    if (lVar8 == 0) {
      return;
    }
    lVar4 = param_1[0x27b];
    iVar5 = *(int *)(*(longlong *)(lVar4 + 0x20) + 0x54);
    *(undefined4 *)((longlong)param_1 + 0x141c) = 2;
    if (iVar5 == 1) {
      psVar9 = (short *)(lVar8 + 0x30);
      if (7 < *(ulonglong *)(lVar8 + 0x48)) {
        psVar9 = *(short **)psVar9;
      }
      lVar8 = param_1[0x381];
      lVar6 = -1;
      psVar10 = psVar9;
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      if (lVar6 != -2) {
        uVar7 = 0xffffffffffffffff;
        psVar10 = psVar9;
        do {
          if (uVar7 == 0) break;
          uVar7 = uVar7 - 1;
          sVar1 = *psVar10;
          psVar10 = psVar10 + 1;
        } while (sVar1 != 0);
        iVar5 = FUN_140123e30(lVar4 + 0x40,*(undefined8 *)(lVar4 + 0x50),psVar9,~uVar7 - 1);
        if (iVar5 != 0) {
          uVar7 = 0xffffffffffffffff;
          psVar10 = psVar9;
          do {
            if (uVar7 == 0) break;
            uVar7 = uVar7 - 1;
            sVar1 = *psVar10;
            psVar10 = psVar10 + 1;
          } while (sVar1 != 0);
          FUN_140001710(lVar4 + 0x40,psVar9,~uVar7 - 1);
          if (*(longlong *)(lVar4 + 0x10) != 0) {
            lVar6 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
            if (lVar6 == 0) {
              iVar5 = 0;
            }
            else {
              iVar5 = FUN_1402ce620(lVar6,psVar9);
              iVar5 = iVar5 + 1;
            }
            FUN_1402c5c00(lVar4,iVar5,(int)lVar8,1);
          }
        }
      }
      FUN_1402c5e50(param_1[0x27b],0x3f800000);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar8 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar8 + 0x54) == 1) {
        *(undefined8 *)(lVar8 + 0x10) = param_2;
        FUN_1402cc2c0(lVar8);
      }
      *(undefined4 *)(lVar8 + 0x54) = 0;
      fVar11 = (float)FUN_1402c5ee0(param_1[0x27b]);
      param_1[0x28b] = 0;
      param_1[0x28a] = (longlong)(double)fVar11;
    }
  }
  else if ((*(int *)((longlong)param_1 + 0x141c) == 2) &&
          (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1)) {
    *(undefined1 *)(param_1 + 0x30d) = 1;
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022c9f0(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x1420) == 0) {
    *(undefined4 *)(param_1 + 0x1420) = 1;
  }
  else if (*(int *)(param_1 + 0x1420) == 1) {
    if (*(longlong *)(param_1 + 0x1ea8) != 0) {
      memcpy((void *)(param_1 + 0x1354),(void *)(*(longlong *)(param_1 + 0x1ea8) + 0x90),0x40);
    }
    if (*(int *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x54) == 1) {
      *(undefined8 *)(param_1 + 0x1ea8) = 0;
      FUN_14021eb20(param_1,0,0);
    }
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022ca80(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x1424) == 0) {
    *(undefined4 *)(param_1 + 0x1424) = 1;
  }
  else if ((*(int *)(param_1 + 0x1424) == 1) &&
          (*(int *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x54) == 1)) {
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022cae0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  if (*(int *)((longlong)param_1 + 0x142c) == 0) {
    *(undefined4 *)((longlong)param_1 + 0x142c) = 1;
  }
  else if (*(int *)((longlong)param_1 + 0x142c) == 1) {
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      FUN_14021eb20(param_1,0,0);
    }
                    // WARNING: Could not recover jumptable at 0x00014022cb47. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    return;
  }
  return;
}



void FUN_14022cb70(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  if ((int)param_1[0x286] == 0) {
    *(undefined4 *)(param_1 + 0x286) = 1;
  }
  else if ((int)param_1[0x286] == 1) {
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      FUN_14021eb20(param_1,0,0);
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022cc00(longlong *param_1)

{
  undefined4 uVar1;
  
  if (*(int *)((longlong)param_1 + 0x1434) == 0) {
    *(undefined4 *)((longlong)param_1 + 0x1434) = 1;
  }
  else if (*(int *)((longlong)param_1 + 0x1434) == 1) {
    uVar1 = *(undefined4 *)((longlong)param_1 + 0x1434);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      uVar1 = 2;
    }
    *(undefined4 *)((longlong)param_1 + 0x1434) = uVar1;
                    // WARNING: Could not recover jumptable at 0x00014022cc39. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(*param_1 + 0xa08))();
    return;
  }
  return;
}



void FUN_14022cc50(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  if ((int)param_1[0x287] == 0) {
    *(undefined4 *)(param_1 + 0x287) = 1;
  }
  else if ((int)param_1[0x287] == 1) {
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      FUN_14021eb20(param_1,0,0);
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022cce0(longlong *param_1,double param_2,undefined8 param_3)

{
  if ((int)param_1[0x287] == 0) {
    *(undefined4 *)(param_1 + 0x287) = 1;
  }
  else if ((int)param_1[0x287] == 1) {
    if (0.2 < param_2 - (double)param_1[0x3cb]) {
      (**(code **)(*param_1 + 200))(param_1,0x30,0);
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022cd70(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  if ((int)param_1[0x287] == 0) {
    FUN_140001710(param_1[0x27b] + 0x68,L"guard01_stay01",0xe);
    *(undefined4 *)(param_1 + 0x287) = 1;
  }
  else if ((int)param_1[0x287] == 1) {
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      (**(code **)(*param_1 + 200))(param_1,0x30,0);
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022ce20(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  float fVar5;
  undefined4 uVar6;
  
  if ((int)param_1[0x287] == 0) {
    lVar3 = param_1[0x381];
    lVar1 = param_1[0x27b];
    FUN_140001710(lVar1 + 0x40,L"guard01_break01",0xf);
    if (*(longlong *)(lVar1 + 0x10) != 0) {
      lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0xd8);
      if (lVar2 == 0) {
        iVar4 = 0;
      }
      else {
        iVar4 = FUN_1402ce620(lVar2,L"guard01_break01");
        iVar4 = iVar4 + 1;
      }
      FUN_1402c5c00(lVar1,iVar4,(int)lVar3,0);
    }
    if (param_1[0x16f] == 0) {
      uVar6 = 0x3f800000;
    }
    else {
      uVar6 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar6);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar1 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar1 + 0x54) == 1) {
      *(undefined8 *)(lVar1 + 0x10) = param_2;
      FUN_1402cc2c0(lVar1);
    }
    *(undefined4 *)(lVar1 + 0x54) = 0;
    fVar5 = (float)FUN_1402c5ee0(param_1[0x27b]);
    *(undefined4 *)(param_1 + 0x287) = 1;
    param_1[0x28a] = (longlong)(double)fVar5;
  }
  else if ((int)param_1[0x287] == 1) {
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      (**(code **)(*param_1 + 200))(param_1,0x30,0);
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022cfa0(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x143c) == 0) {
    *(undefined4 *)(param_1 + 0x143c) = 1;
  }
  else if ((*(int *)(param_1 + 0x143c) == 1) && (5.0 <= param_2 - *(double *)(param_1 + 0x1470))) {
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022d010(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x1440) == 0) {
    *(undefined4 *)(param_1 + 0x1440) = 1;
  }
  else if ((*(int *)(param_1 + 0x1440) == 1) &&
          (*(int *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x54) == 1)) {
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022d070(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  undefined8 in_RDX;
  
  iVar1 = (int)param_1[0x1af];
  if (iVar1 == 0) {
    *(undefined4 *)(param_1 + 0x1af) = 1;
  }
  else if (iVar1 == 1) {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      *(undefined4 *)(param_1 + 0x1af) = 5;
    }
  }
  else if (iVar1 == 5) {
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022d100(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  float fVar5;
  undefined4 uVar6;
  
  if ((int)param_1[0x1af] == 0) {
    lVar2 = param_1[0x381];
    lVar4 = param_1[0x27b];
    FUN_140001710(lVar4 + 0x40,L"catch02_1",9);
    if (*(longlong *)(lVar4 + 0x10) != 0) {
      lVar1 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
      if (lVar1 == 0) {
        iVar3 = 0;
      }
      else {
        iVar3 = FUN_1402ce620(lVar1,L"catch02_1");
        iVar3 = iVar3 + 1;
      }
      FUN_1402c5c00(lVar4,iVar3,(int)lVar2,0);
    }
    if (param_1[0x16f] == 0) {
      uVar6 = 0x3f800000;
    }
    else {
      uVar6 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar6);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar4 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar4 + 0x54) == 1) {
      *(undefined8 *)(lVar4 + 0x10) = param_2;
      FUN_1402cc2c0(lVar4);
    }
    *(undefined4 *)(lVar4 + 0x54) = 0;
    lVar4 = param_1[0x27b];
    fVar5 = (float)FUN_1402c5ee0(lVar4);
    param_1[0x28b] = 0;
    param_1[0x28a] = (longlong)(double)fVar5;
    FUN_1402cbda0(*(undefined8 *)(lVar4 + 0x20),param_2,param_3);
    *(undefined4 *)(param_1 + 0x1af) = 1;
  }
  else if ((int)param_1[0x1af] == 1) {
    lVar4 = (**(code **)(*param_1 + 0x158))(param_1);
    if ((lVar4 == 0) || ((*(int *)(lVar4 + 300) != 0x3c && (*(int *)(lVar4 + 300) != 0x3e)))) {
                    // WARNING: Could not recover jumptable at 0x00014022d15c. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return;
    }
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      (**(code **)(*param_1 + 200))(param_1,0x36);
    }
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022d300(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  ulonglong uVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  ushort *puVar7;
  ushort *puVar8;
  uint uVar9;
  float fVar10;
  undefined4 uVar11;
  
  if ((int)param_1[0x1af] != 0) {
    if ((int)param_1[0x1af] == 1) {
      lVar6 = (**(code **)(*param_1 + 0x158))(param_1);
      if ((lVar6 == 0) || ((*(int *)(lVar6 + 300) != 0x3c && (*(int *)(lVar6 + 300) != 0x3e)))) {
                    // WARNING: Could not recover jumptable at 0x00014022d358. Too many branches
                    // WARNING: Treating indirect jump as call
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
        return;
      }
      if (*(int *)((longlong)param_1 + 300) != 0xf) {
        *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
      }
      (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    }
    goto LAB_14022d512;
  }
  lVar4 = param_1[0x381];
  lVar6 = param_1[0x27b];
  uVar1 = *(ulonglong *)(lVar6 + 0x50);
  if (*(ulonglong *)(lVar6 + 0x58) < 8) {
    puVar7 = (ushort *)(lVar6 + 0x40);
  }
  else {
    puVar7 = *(ushort **)(lVar6 + 0x40);
  }
  puVar8 = &DAT_1404ad3e8;
  uVar3 = 9;
  if (uVar1 < 9) {
    uVar3 = uVar1;
  }
  for (; uVar3 != 0; uVar3 = uVar3 - 1) {
    if (*puVar7 != *puVar8) {
      uVar9 = 1;
      if (*puVar7 < *puVar8) {
        uVar9 = 0xffffffff;
      }
      goto LAB_14022d3fb;
    }
    puVar7 = puVar7 + 1;
    puVar8 = puVar8 + 1;
  }
  uVar9 = 0;
LAB_14022d3fb:
  if (uVar9 == 0) {
    if (8 < uVar1) {
      uVar9 = (uint)(uVar1 != 9);
      goto LAB_14022d412;
    }
LAB_14022d416:
    FUN_140001710(lVar6 + 0x40,&DAT_1404ad3e8,9);
    if (*(longlong *)(lVar6 + 0x10) != 0) {
      lVar2 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
      if (lVar2 == 0) {
        iVar5 = 0;
      }
      else {
        iVar5 = FUN_1402ce620(lVar2,&DAT_1404ad3e8);
        iVar5 = iVar5 + 1;
      }
      FUN_1402c5c00(lVar6,iVar5,(int)lVar4,1);
    }
  }
  else {
LAB_14022d412:
    if (uVar9 != 0) goto LAB_14022d416;
  }
  if (param_1[0x16f] == 0) {
    uVar11 = 0x3f800000;
  }
  else {
    uVar11 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
  }
  FUN_1402c5e50(param_1[0x27b],uVar11);
  *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
  lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
  if (*(int *)(lVar6 + 0x54) == 1) {
    *(undefined8 *)(lVar6 + 0x10) = param_2;
    FUN_1402cc2c0(lVar6);
  }
  *(undefined4 *)(lVar6 + 0x54) = 0;
  fVar10 = (float)FUN_1402c5ee0(param_1[0x27b]);
  param_1[0x28b] = 0;
  *(undefined4 *)(param_1 + 0x1af) = 1;
  param_1[0x28a] = (longlong)(double)fVar10;
LAB_14022d512:
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022d530(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  
  lVar1 = (**(code **)(*param_1 + 0x158))();
  if ((lVar1 != 0) && ((*(int *)(lVar1 + 300) == 0x3c || (*(int *)(lVar1 + 300) == 0x3e)))) {
    FUN_14022ecd0(lVar1,param_1 + 0x2f);
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    *(int *)(param_1 + 0x38b) = (int)param_1[0x2f];
    *(undefined4 *)((longlong)param_1 + 0x1c5c) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)(param_1 + 0x38c) = (int)param_1[0x30];
    return;
  }
                    // WARNING: Could not recover jumptable at 0x00014022d576. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014022d8bc)
// WARNING: Removing unreachable block (ram,0x00014022daa8)

void FUN_14022d600(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  int *piVar1;
  short sVar2;
  byte bVar3;
  byte bVar4;
  longlong lVar5;
  int iVar6;
  undefined4 uVar7;
  longlong *plVar8;
  undefined8 uVar9;
  void *pvVar10;
  longlong lVar11;
  longlong lVar12;
  ulonglong uVar13;
  longlong *plVar14;
  short *psVar15;
  bool bVar16;
  undefined4 local_res8 [2];
  undefined8 in_stack_ffffffffffffff68;
  undefined4 uVar17;
  undefined8 in_stack_ffffffffffffff70;
  undefined8 uVar18;
  longlong local_70;
  longlong *local_68;
  longlong *local_60;
  longlong *local_58;
  
  iVar6 = (int)param_1[0x1af];
  if (iVar6 == 0) {
    *(undefined4 *)(param_1 + 0x1af) = 1;
    goto LAB_14022dc49;
  }
  if (iVar6 == 1) {
    lVar12 = (**(code **)(*param_1 + 0x158))(param_1);
    if (lVar12 != 0) {
      FUN_14022ecd0(lVar12,param_1 + 0x2f);
      if ((*(int *)(lVar12 + 300) != 0x3c) && (*(int *)(lVar12 + 300) != 0x3e)) {
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
        return;
      }
      if (*(int *)((longlong)param_1 + 300) != 0xf) {
        *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
      }
      (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
      (**(code **)(*param_1 + 0xa88))(param_1);
      goto LAB_14022dc49;
    }
  }
  else if (iVar6 == 2) {
    *(undefined4 *)(param_1 + 0x1af) = 3;
    plVar8 = (longlong *)(**(code **)(*param_1 + 0x158))(param_1);
    if (plVar8 != (longlong *)0x0) {
      lVar12 = 0;
      if (*(int *)(plVar8[0x27b] + 0x140) != 0) {
        *(undefined4 *)(plVar8[0x27b] + 0x140) = 0;
        (**(code **)(*plVar8 + 0x468))(plVar8,0);
      }
      local_res8[0] = 0;
      uVar9 = CONCAT71((int7)((ulonglong)in_stack_ffffffffffffff68 >> 8),1);
      iVar6 = FUN_1402f9640(plVar8,local_res8,plVar8 + 0x2f,1,uVar9);
      uVar17 = (undefined4)((ulonglong)uVar9 >> 0x20);
      if (iVar6 != 1) {
        FUN_14022ecd0(plVar8,param_1 + 0x2f);
      }
      bVar3 = *(byte *)((longlong)param_1 + 0x601);
      bVar4 = *(byte *)(param_1 + 0xc0);
      uVar7 = *(undefined4 *)((longlong)param_1 + 300);
      plVar14 = param_1 + 0x299;
      if (7 < (ulonglong)param_1[0x29c]) {
        plVar14 = (longlong *)*plVar14;
      }
      uVar9 = FUN_14020d8c0(param_1 + 0x391);
      uVar18 = CONCAT71((int7)((ulonglong)in_stack_ffffffffffffff70 >> 8),bVar3 | bVar4);
      FUN_140278700(uVar9,&local_60,plVar14,(int)param_1[0x381],CONCAT44(uVar17,uVar7),uVar18,
                    (char)param_1[0x413]);
      uVar17 = (undefined4)((ulonglong)uVar18 >> 0x20);
      plVar14 = local_60;
      if (local_60 != (longlong *)0x0) {
        if (local_60 == local_58) {
          if (*local_60 != 0) {
            *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
            *(undefined4 *)((longlong)param_1 + 0x1c54) =
                 *(undefined4 *)((longlong)param_1 + 0x1c54);
            pvVar10 = operator_new(0x120);
            lVar11 = lVar12;
            if (pvVar10 != (void *)0x0) {
              lVar11 = FUN_140197660(pvVar10);
            }
            local_70 = lVar11;
            FUN_140196140(&local_68,lVar11);
            FUN_140178e90(&local_70,lVar11,lVar11);
            plVar14 = param_1 + 0x1a;
            if (7 < (ulonglong)param_1[0x1d]) {
              plVar14 = (longlong *)*plVar14;
            }
            uVar13 = 0xffffffffffffffff;
            psVar15 = (short *)plVar14;
            do {
              if (uVar13 == 0) break;
              uVar13 = uVar13 - 1;
              sVar2 = *psVar15;
              psVar15 = psVar15 + 1;
            } while (sVar2 != 0);
            FUN_140001710(local_70,plVar14,~uVar13 - 1);
            lVar11 = local_70;
            *(int *)(local_70 + 0x34) = (int)param_1[0x24];
            *(int *)(local_70 + 0x28) = (int)param_1[0x2f];
            *(undefined4 *)(local_70 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x17c);
            *(int *)(local_70 + 0x30) = (int)param_1[0x30];
            uVar7 = (**(code **)(*param_1 + 0xb0))(param_1);
            lVar5 = local_70;
            *(undefined4 *)(lVar11 + 0x38) = uVar7;
            *(int *)(local_70 + 0x3c) = (int)param_1[0x25];
            uVar7 = FUN_1402f8580(param_1);
            *(undefined4 *)(lVar5 + 0x40) = uVar7;
            *(undefined4 *)(local_70 + 0x44) = *(undefined4 *)((longlong)param_1 + 0x1c54);
            if (local_60 != (longlong *)0x0) {
              if (local_60 == local_58) {
                lVar12 = *local_60;
              }
              else {
                iVar6 = DAT_140608154 + 1;
                bVar16 = DAT_140608154 == 0;
                DAT_140608154 = iVar6;
                if (bVar16) {
                  FUN_140176d60(1);
                }
              }
            }
            FUN_14021a770(param_1,&local_70,lVar12,plVar8,param_1[0x2fa],CONCAT44(uVar17,0x3f800000)
                         );
            lVar12 = local_70;
            *(undefined4 *)(local_70 + 0x54) = 1;
            *(undefined4 *)(local_70 + 0x58) = *(undefined4 *)(param_1[0x27b] + 0x30);
            if (*(longlong **)(local_70 + 0x80) != local_60) {
              FUN_1401975d0(local_70 + 0x80);
              *(longlong **)(lVar12 + 0x80) = local_60;
              *(longlong **)(lVar12 + 0x88) = local_60;
              if (local_60 != (longlong *)0x0) {
                LOCK();
                *(int *)(local_60 + 1) = (int)local_60[1] + 1;
                UNLOCK();
              }
            }
            *(longlong *)(local_70 + 0x90) = param_1[0x2fa];
            *(undefined4 *)(local_70 + 0x48) = 0;
            *(int *)(local_70 + 0x78) = (int)param_1[0x3d6];
            (**(code **)(*plVar8 + 0x950))(plVar8,local_70,0);
            (**(code **)(*param_1 + 0x148))(param_1,0,0);
            *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
            if (local_68 != (longlong *)0x0) {
              LOCK();
              plVar8 = local_68 + 1;
              *(int *)plVar8 = (int)*plVar8 + -1;
              UNLOCK();
              if ((int)*plVar8 == 0) {
                (**(code **)(*local_68 + 8))(local_68);
                LOCK();
                piVar1 = (int *)((longlong)local_68 + 0xc);
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                if (*piVar1 == 0) {
                  (**(code **)(*local_68 + 0x10))(local_68);
                }
              }
            }
            plVar8 = local_60;
            if (local_60 != (longlong *)0x0) {
              if (local_60 == local_58) {
                if (local_60 != (longlong *)0x0) {
                  LOCK();
                  plVar14 = local_60 + 1;
                  *(int *)plVar14 = (int)*plVar14 + -1;
                  UNLOCK();
                  if ((int)*plVar14 == 0) {
                    local_60 = (longlong *)0x0;
                    pvVar10 = (void *)*plVar8;
                    if (pvVar10 != (void *)0x0) {
                      FUN_140197310(pvVar10);
                      operator_delete(pvVar10);
                    }
                    operator_delete(plVar8);
                  }
                }
              }
              else {
                iVar6 = DAT_1406080b4 + 1;
                bVar16 = DAT_1406080b4 == 0;
                DAT_1406080b4 = iVar6;
                if (bVar16) {
                  FUN_140176d60(1);
                }
              }
            }
            goto LAB_14022dc49;
          }
        }
        else {
          iVar6 = DAT_140608154 + 1;
          bVar16 = DAT_140608154 == 0;
          DAT_140608154 = iVar6;
          if (bVar16) {
            FUN_140176d60(1);
            plVar14 = local_60;
          }
        }
      }
      if (plVar14 == (longlong *)0x0) {
        return;
      }
      if (plVar14 != local_58) {
        if (DAT_1406080b4 != 0) {
          DAT_1406080b4 = DAT_1406080b4 + 1;
          return;
        }
        DAT_1406080b4 = DAT_1406080b4 + 1;
        FUN_140176d60(1);
        return;
      }
      if (plVar14 == (longlong *)0x0) {
        return;
      }
      LOCK();
      plVar8 = plVar14 + 1;
      *(int *)plVar8 = (int)*plVar8 + -1;
      UNLOCK();
      if ((int)*plVar8 != 0) {
        return;
      }
      local_60 = (longlong *)0x0;
      pvVar10 = (void *)*plVar14;
      if (pvVar10 != (void *)0x0) {
        FUN_140197310(pvVar10);
        operator_delete(pvVar10);
      }
      operator_delete(plVar14);
      return;
    }
  }
  else {
    if (iVar6 != 3) goto LAB_14022dc49;
    (**(code **)(*param_1 + 0x148))(param_1,0,0);
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) goto LAB_14022dc49;
    if (param_1[0x2c3] != 0) {
      *(undefined4 *)((longlong)param_1 + 300) = 2;
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)((longlong)param_1 + 0x2054);
      *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)((longlong)param_1 + 0x205c);
      if ((ulonglong)param_1[0x2c4] < 8) {
        plVar8 = param_1 + 0x2c1;
      }
      else {
        plVar8 = (longlong *)param_1[0x2c1];
      }
      (**(code **)(*param_1 + 0x8f8))
                (param_1,plVar8,*(undefined4 *)((longlong)param_1 + 0x1814),0x3f800000,1,
                 param_1[0x2fb],(char)param_1[0x38a]);
      FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
      *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
      param_1[0x2fb] = 0;
      *(undefined1 *)(param_1 + 0x38a) = 0;
      if (*(int *)((longlong)param_1 + 300) != 2) goto LAB_14022dc49;
    }
  }
  (**(code **)(*param_1 + 0xd0))(param_1,0,0);
LAB_14022dc49:
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022dc80(longlong *param_1,longlong param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  undefined8 in_RDX;
  float fVar5;
  undefined4 uVar6;
  
  iVar4 = (int)param_1[0x1af];
  if (iVar4 == 0) {
    lVar3 = param_1[0x381];
    lVar1 = param_1[0x27b];
    FUN_140001710(lVar1 + 0x40,L"catch01_3",9);
    if (*(longlong *)(lVar1 + 0x10) != 0) {
      lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0xd8);
      if (lVar2 == 0) {
        iVar4 = 0;
      }
      else {
        iVar4 = FUN_1402ce620(lVar2,L"catch01_3");
        iVar4 = iVar4 + 1;
      }
      FUN_1402c5c00(lVar1,iVar4,(int)lVar3,1);
    }
    if (param_1[0x16f] == 0) {
      uVar6 = 0x3f800000;
    }
    else {
      uVar6 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar6);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar1 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar1 + 0x54) == 1) {
      *(longlong *)(lVar1 + 0x10) = param_2;
      FUN_1402cc2c0(lVar1);
    }
    *(undefined4 *)(lVar1 + 0x54) = 0;
    fVar5 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0;
    param_1[0x28c] = param_2;
    *(undefined4 *)(param_1 + 0x1af) = 1;
    param_1[0x28a] = (longlong)(double)fVar5;
  }
  else if (iVar4 == 1) {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      *(undefined4 *)(param_1 + 0x1af) = 5;
    }
  }
  else if (iVar4 == 5) {
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022de20(longlong *param_1,double param_2)

{
  char cVar1;
  int iVar2;
  longlong *plVar3;
  uint local_38;
  uint local_34;
  uint local_30;
  uint local_2c;
  uint local_28;
  uint local_24;
  
  plVar3 = (longlong *)(**(code **)(*param_1 + 0x170))();
  if (plVar3 != (longlong *)0x0) {
    cVar1 = FUN_1402d7670(plVar3,10);
    if (cVar1 != '\0') {
      iVar2 = *(int *)((longlong)param_1 + 0x1444);
      if (iVar2 == 0) {
        iVar2 = rand();
        param_1[0x3c9] = (longlong)((double)((float)iVar2 * 3.0517578e-05) * 2.0 + param_2 + 2.0);
        local_2c = *(uint *)((longlong)plVar3 + 0x154) ^ 0x80000000;
        local_28 = *(uint *)(plVar3 + 0x2b) ^ 0x80000000;
        local_24 = *(uint *)((longlong)plVar3 + 0x15c) ^ 0x80000000;
        (**(code **)(*param_1 + 0x100))(param_1,&local_2c);
        FUN_14022ecd0(param_1,plVar3 + 0x2f);
        FUN_1402c5c00(param_1[0x27b],0,0,1);
        *(undefined4 *)(param_1[0x27b] + 0x140) = 1;
        *(undefined4 *)((longlong)param_1 + 0x1444) = 1;
      }
      else if (iVar2 == 1) {
        iVar2 = (**(code **)(*plVar3 + 0xb0))(plVar3);
        if ((iVar2 != 4) && ((double)param_1[0x3c9] <= param_2 && param_2 != (double)param_1[0x3c9])
           ) {
          local_38 = *(uint *)((longlong)plVar3 + 0x154) ^ 0x80000000;
          local_30 = *(uint *)((longlong)plVar3 + 0x15c) ^ 0x80000000;
          local_34 = *(uint *)(plVar3 + 0x2b) ^ 0x80000000;
          (**(code **)(*param_1 + 0x100))(param_1,&local_38);
          FUN_14022ecd0(param_1,plVar3 + 0x2f);
          FUN_1402357f0(param_1);
          (**(code **)(*param_1 + 200))(param_1,0x3d);
          (**(code **)(*plVar3 + 200))(plVar3,0x37);
          return;
        }
      }
      else if (iVar2 == 5) {
        *(undefined4 *)(param_1 + 0x30b) = 2;
        (**(code **)(*param_1 + 200))(param_1,0x20,0);
        return;
      }
      return;
    }
  }
  if (*(int *)(param_1[0x27b] + 0x140) != 0) {
    *(undefined4 *)(param_1[0x27b] + 0x140) = 0;
    (**(code **)(*param_1 + 0x468))(param_1,0);
  }
                    // WARNING: Could not recover jumptable at 0x00014022de89. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  return;
}



void FUN_14022e080(longlong param_1)

{
  *(undefined4 *)(param_1 + 300) = 0x3c;
  return;
}



void FUN_14022e090(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  undefined8 in_RDX;
  
  iVar1 = *(int *)((longlong)param_1 + 0x1444);
  if (iVar1 == 0) {
    *(undefined4 *)((longlong)param_1 + 0x1444) = 1;
  }
  else if (iVar1 == 1) {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      *(undefined4 *)((longlong)param_1 + 0x1444) = 5;
    }
  }
  else if (iVar1 == 5) {
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022e120(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 in_RDX;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    FUN_14021eb20(param_1,0,0);
    *(undefined1 *)((longlong)param_1 + 0x1869) = 0;
    *(undefined2 *)(param_1 + 0x19a) = 0;
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022e1a0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 in_RDX;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022e210(longlong *param_1,undefined8 param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  ulonglong uVar4;
  char cVar5;
  int iVar6;
  ushort *puVar7;
  ushort *puVar8;
  uint uVar9;
  undefined4 uVar10;
  
  iVar6 = (int)param_1[0x283];
  if (iVar6 != 0) {
    if (iVar6 != 2) {
      if (iVar6 != 3) {
        return;
      }
      if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) {
        return;
      }
      *(undefined4 *)(param_1 + 0x30b) = 0;
      *(undefined1 *)((longlong)param_1 + 0x2034) = 1;
                    // WARNING: Could not recover jumptable at 0x00014022e281. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return;
    }
    cVar5 = FUN_14032dd70(param_1[0x1da]);
    if (cVar5 == '\0') {
      return;
    }
    lVar1 = param_1[0x27b];
    uVar2 = *(ulonglong *)(lVar1 + 0x50);
    if (*(ulonglong *)(lVar1 + 0x58) < 8) {
      puVar7 = (ushort *)(lVar1 + 0x40);
    }
    else {
      puVar7 = *(ushort **)(lVar1 + 0x40);
    }
    puVar8 = &DAT_1404ad430;
    uVar4 = 10;
    if (uVar2 < 10) {
      uVar4 = uVar2;
    }
    for (; uVar4 != 0; uVar4 = uVar4 - 1) {
      if (*puVar7 != *puVar8) {
        uVar9 = 1;
        if (*puVar7 < *puVar8) {
          uVar9 = 0xffffffff;
        }
        goto LAB_14022e2ec;
      }
      puVar7 = puVar7 + 1;
      puVar8 = puVar8 + 1;
    }
    uVar9 = 0;
LAB_14022e2ec:
    if (uVar9 == 0) {
      if (9 < uVar2) {
        uVar9 = (uint)(uVar2 != 10);
        goto LAB_14022e303;
      }
    }
    else {
LAB_14022e303:
      if (uVar9 == 0) goto LAB_14022e367;
    }
    FUN_140001710(lVar1 + 0x40,&DAT_1404ad430,10);
    if (*(longlong *)(lVar1 + 0x10) != 0) {
      lVar3 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0xd8);
      if (lVar3 == 0) {
        iVar6 = 0;
      }
      else {
        iVar6 = FUN_1402ce620(lVar3,&DAT_1404ad430);
        iVar6 = iVar6 + 1;
      }
      FUN_1402c5c00(lVar1,iVar6,0,1);
    }
LAB_14022e367:
    if (param_1[0x16f] == 0) {
      uVar10 = 0x3f800000;
    }
    else {
      uVar10 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar10);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar1 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar1 + 0x54) == 1) {
      *(undefined8 *)(lVar1 + 0x10) = param_2;
      FUN_1402cc2c0(lVar1);
    }
    *(undefined4 *)(lVar1 + 0x54) = 0;
    *(undefined4 *)(param_1 + 0x283) = 3;
    return;
  }
  cVar5 = FUN_14032daf0(param_1[0x1da]);
  if (cVar5 == '\0') {
    return;
  }
  lVar1 = param_1[0x27b];
  uVar2 = *(ulonglong *)(lVar1 + 0x50);
  if (*(ulonglong *)(lVar1 + 0x58) < 8) {
    puVar7 = (ushort *)(lVar1 + 0x40);
  }
  else {
    puVar7 = *(ushort **)(lVar1 + 0x40);
  }
  puVar8 = &DAT_1404ad418;
  uVar4 = 10;
  if (uVar2 < 10) {
    uVar4 = uVar2;
  }
  for (; uVar4 != 0; uVar4 = uVar4 - 1) {
    if (*puVar7 != *puVar8) {
      uVar9 = 1;
      if (*puVar7 < *puVar8) {
        uVar9 = 0xffffffff;
      }
      goto LAB_14022e448;
    }
    puVar7 = puVar7 + 1;
    puVar8 = puVar8 + 1;
  }
  uVar9 = 0;
LAB_14022e448:
  if (uVar9 == 0) {
    if (9 < uVar2) {
      uVar9 = (uint)(uVar2 != 10);
      goto LAB_14022e45f;
    }
  }
  else {
LAB_14022e45f:
    if (uVar9 == 0) goto LAB_14022e4c3;
  }
  FUN_140001710(lVar1 + 0x40,&DAT_1404ad418,10);
  if (*(longlong *)(lVar1 + 0x10) != 0) {
    lVar3 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0xd8);
    if (lVar3 == 0) {
      iVar6 = 0;
    }
    else {
      iVar6 = FUN_1402ce620(lVar3,&DAT_1404ad418);
      iVar6 = iVar6 + 1;
    }
    FUN_1402c5c00(lVar1,iVar6,0,1);
  }
LAB_14022e4c3:
  if (param_1[0x16f] == 0) {
    uVar10 = 0x3f800000;
  }
  else {
    uVar10 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
  }
  FUN_1402c5e50(param_1[0x27b],uVar10);
  *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
  lVar1 = *(longlong *)(param_1[0x27b] + 0x20);
  if (*(int *)(lVar1 + 0x54) == 1) {
    *(undefined8 *)(lVar1 + 0x10) = param_2;
    FUN_1402cc2c0(lVar1);
  }
  *(undefined4 *)(lVar1 + 0x54) = 0;
  *(undefined4 *)(param_1 + 0x283) = 2;
  return;
}



void FUN_14022e540(longlong *param_1,undefined8 param_2)

{
  if ((char)param_1[0x30d] != '\x01') {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))();
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      *(undefined1 *)(param_1 + 0x30d) = 1;
    }
    FUN_140230d70(param_1,param_2);
  }
  return;
}



void FUN_14022e5b0(longlong *param_1,double param_2,undefined8 param_3)

{
  short sVar1;
  longlong lVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong *plVar8;
  short *psVar9;
  float fVar10;
  undefined4 uVar11;
  undefined4 local_68;
  float local_64;
  undefined4 local_60;
  undefined1 local_58 [4];
  float local_54;
  
  if (param_1[0x26] == 0) {
    return;
  }
  switch((int)param_1[0x283]) {
  case 0:
    param_1[0x355] = (longlong)param_2;
    *(undefined4 *)(param_1 + 0x283) = 1;
    *(int *)((longlong)param_1 + 0x1a9c) = (int)param_1[0x2f];
    *(undefined4 *)(param_1 + 0x354) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)((longlong)param_1 + 0x1aa4) = (int)param_1[0x30];
    fVar10 = *(float *)(param_1[0x26] + 0x294);
    *(undefined1 *)((longlong)param_1 + 0x601) = 1;
    fVar10 = fVar10 * *(float *)(param_1 + 0x3ca) * 0.1 + *(float *)(param_1 + 0x354);
    *(float *)(param_1 + 0x354) = fVar10;
    *(float *)((longlong)param_1 + 0x17c) = fVar10;
    break;
  case 1:
    local_68 = (undefined4)param_1[0x2f];
    local_60 = (undefined4)param_1[0x30];
    local_64 = *(float *)(param_1 + 0x354) -
               (float)(param_2 - (double)param_1[0x355]) * (float)(param_2 - (double)param_1[0x355])
               * 16000.0 * 0.5;
    iVar5 = FUN_1402f98b0(param_1,local_58,param_1 + 0x2f,&local_68,(longlong)param_1 + 0x524,
                          param_1 + 0xa4,0,0x447a0000);
    if (iVar5 == 1) {
      *(float *)((longlong)param_1 + 0x17c) = local_64;
      if (local_64 - local_54 < 0.1) {
        *(float *)((longlong)param_1 + 0x17c) = local_54;
        goto LAB_14022e751;
      }
    }
    else {
LAB_14022e751:
      plVar8 = param_1 + 0x2ad;
      *(undefined4 *)(param_1 + 0x283) = 2;
      if (7 < (ulonglong)param_1[0x2b0]) {
        plVar8 = (longlong *)*plVar8;
      }
      lVar2 = param_1[0x27b];
      lVar3 = param_1[0x381];
      lVar6 = -1;
      psVar9 = (short *)plVar8;
      do {
        if (lVar6 == 0) break;
        lVar6 = lVar6 + -1;
        sVar1 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar1 != 0);
      if (lVar6 != -2) {
        uVar7 = 0xffffffffffffffff;
        psVar9 = (short *)plVar8;
        do {
          if (uVar7 == 0) break;
          uVar7 = uVar7 - 1;
          sVar1 = *psVar9;
          psVar9 = psVar9 + 1;
        } while (sVar1 != 0);
        iVar5 = FUN_140123e30(lVar2 + 0x40,*(undefined8 *)(lVar2 + 0x50),plVar8,~uVar7 - 1);
        if (iVar5 != 0) {
          uVar7 = 0xffffffffffffffff;
          psVar9 = (short *)plVar8;
          do {
            if (uVar7 == 0) break;
            uVar7 = uVar7 - 1;
            sVar1 = *psVar9;
            psVar9 = psVar9 + 1;
          } while (sVar1 != 0);
          FUN_140001710(lVar2 + 0x40,plVar8,~uVar7 - 1);
          if (*(longlong *)(lVar2 + 0x10) != 0) {
            lVar6 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
            if (lVar6 == 0) {
              iVar5 = 0;
            }
            else {
              iVar5 = FUN_1402ce620(lVar6,plVar8);
              iVar5 = iVar5 + 1;
            }
            FUN_1402c5c00(lVar2,iVar5,(int)lVar3,0);
          }
        }
      }
      FUN_140001710(param_1[0x27b] + 0x68,&DAT_140477960,0);
      if (param_1[0x16f] == 0) {
        uVar11 = 0x3f800000;
      }
      else {
        uVar11 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
      }
      FUN_1402c5e50(param_1[0x27b],uVar11);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar2 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar2 + 0x54) == 1) {
        *(double *)(lVar2 + 0x10) = param_2;
        FUN_1402cc2c0(lVar2);
      }
      *(undefined4 *)(lVar2 + 0x54) = 0;
      *(undefined1 *)((longlong)param_1 + 0x601) = 0;
    }
    if (*(char *)((longlong)param_1 + 0x1824) == '\0') {
      uVar11 = *(undefined4 *)((longlong)param_1 + 0x17c);
      (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
      *(undefined4 *)((longlong)param_1 + 0x17c) = uVar11;
    }
    break;
  case 2:
    *(undefined1 *)(param_1 + 0x30f) = 0;
    *(undefined4 *)(param_1 + 0x283) = 3;
    fVar10 = (float)(**(code **)(*param_1 + 0xa80))(param_1);
    plVar8 = (longlong *)param_1[0x1da];
    lVar3 = param_1[0x34f];
    local_68 = 0;
    local_64 = 0.0;
    local_60 = 0;
    lVar2 = *plVar8;
    fVar10 = fVar10 * *(float *)((longlong)param_1 + 0x1a7c);
    lVar6 = param_1[0x3c5];
    *(float *)(plVar8 + 3) = fVar10;
    plVar8[2] = (longlong)param_2;
    *(int *)((longlong)plVar8 + 0x5c) = (int)lVar6;
    *(int *)(plVar8 + 1) = (int)lVar6;
    *(int *)((longlong)plVar8 + 0x1c) = (int)lVar3;
    *(undefined4 *)((longlong)plVar8 + 0x24) = *(undefined4 *)(lVar2 + 0x178);
    *(undefined4 *)(plVar8 + 5) = *(undefined4 *)(lVar2 + 0x17c);
    *(undefined4 *)((longlong)plVar8 + 0x2c) = *(undefined4 *)(lVar2 + 0x180);
    *(undefined4 *)(plVar8 + 6) = 0;
    *(undefined4 *)((longlong)plVar8 + 0x34) = 0;
    *(float *)(plVar8 + 5) = *(float *)(plVar8 + 5) + 0.0;
    *(undefined4 *)(plVar8 + 7) = 0;
    uVar11 = FUN_1403144d0(fVar10,(int)lVar3,*(undefined4 *)(lVar2 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar8 + 4) = uVar11;
    *(undefined4 *)(lVar2 + 0xee0) = uVar11;
    *(undefined4 *)(plVar8 + 0xc) = 0x461c4000;
    break;
  case 3:
    cVar4 = FUN_14032daf0(param_1[0x1da]);
    if (cVar4 != '\0') {
      *(undefined4 *)(param_1 + 0x283) = 4;
    }
    break;
  case 4:
    cVar4 = FUN_14032dd70();
    if (cVar4 == '\0') {
      return;
    }
    plVar8 = param_1 + 0x37c;
    *(undefined4 *)(param_1 + 0x283) = 5;
    if (7 < (ulonglong)param_1[0x37f]) {
      plVar8 = (longlong *)*plVar8;
    }
    lVar2 = param_1[0x27b];
    lVar3 = param_1[0x381];
    lVar6 = -1;
    psVar9 = (short *)plVar8;
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      sVar1 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar1 != 0);
    if (lVar6 != -2) {
      uVar7 = 0xffffffffffffffff;
      psVar9 = (short *)plVar8;
      do {
        if (uVar7 == 0) break;
        uVar7 = uVar7 - 1;
        sVar1 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar1 != 0);
      iVar5 = FUN_140123e30(lVar2 + 0x40,*(undefined8 *)(lVar2 + 0x50),plVar8,~uVar7 - 1);
      if (iVar5 != 0) {
        uVar7 = 0xffffffffffffffff;
        psVar9 = (short *)plVar8;
        do {
          if (uVar7 == 0) break;
          uVar7 = uVar7 - 1;
          sVar1 = *psVar9;
          psVar9 = psVar9 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar2 + 0x40,plVar8,~uVar7 - 1);
        if (*(longlong *)(lVar2 + 0x10) != 0) {
          lVar6 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
          if (lVar6 == 0) {
            iVar5 = 0;
          }
          else {
            iVar5 = FUN_1402ce620(lVar6,plVar8);
            iVar5 = iVar5 + 1;
          }
          FUN_1402c5c00(lVar2,iVar5,(int)lVar3,1);
        }
      }
    }
    if (param_1[0x16f] == 0) {
      uVar11 = 0x3f800000;
    }
    else {
      uVar11 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar11);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar2 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar2 + 0x54) == 1) {
      *(double *)(lVar2 + 0x10) = param_2;
      FUN_1402cc2c0(lVar2);
    }
    *(undefined4 *)(lVar2 + 0x54) = 0;
    goto LAB_14022eb30;
  case 5:
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) {
      return;
    }
    *(undefined4 *)(param_1 + 0x30b) = 0;
    (**(code **)(*param_1 + 200))(param_1,0x20);
LAB_14022eb30:
    *(undefined1 *)((longlong)param_1 + 0x2034) = 1;
  }
  return;
}



void FUN_14022eb90(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 in_RDX;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14022ec00(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 in_RDX;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    *(undefined4 *)((longlong)param_1 + 300) = 2;
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined4 * FUN_14022ec70(longlong param_1)

{
  if ((DAT_140609420 & 1) == 0) {
    DAT_140609420 = DAT_140609420 | 1;
    DAT_140609410 = 0;
    DAT_140609414 = 0;
    DAT_140609418 = 0;
    _DAT_14060941c = 0;
  }
  if (*(longlong *)(param_1 + 0x13d8) == 0) {
    return &DAT_140609410;
  }
  return (undefined4 *)(*(longlong *)(param_1 + 0x13d8) + 0x144);
}



ulonglong FUN_14022ecd0(longlong param_1,float *param_2)

{
  int iVar1;
  ulonglong uVar2;
  float fVar3;
  undefined4 local_res10 [6];
  float local_48;
  float local_44;
  float local_40;
  
  local_48 = *param_2;
  local_44 = param_2[1];
  local_res10[0] = 0;
  local_40 = param_2[2];
  iVar1 = FUN_1402f9640(0,local_res10,&local_48,1,1);
  if (iVar1 == 1) {
    *(float *)(param_1 + 0x178) = local_48;
    *(float *)(param_1 + 0x17c) = local_44;
    *(float *)(param_1 + 0x180) = local_40;
    return CONCAT71((uint7)(uint3)((uint)local_40 >> 8),1);
  }
  fVar3 = 0.2;
  do {
    local_48 = (*(float *)(param_1 + 0x178) - *param_2) * fVar3 + *param_2;
    local_44 = (*(float *)(param_1 + 0x17c) - param_2[1]) * fVar3 + param_2[1];
    local_40 = (*(float *)(param_1 + 0x180) - param_2[2]) * fVar3 + param_2[2];
    uVar2 = FUN_1402f9640(param_1,local_res10,&local_48,1,1);
    if ((int)uVar2 == 1) {
      *(float *)(param_1 + 0x178) = local_48;
      *(float *)(param_1 + 0x17c) = local_44;
      *(float *)(param_1 + 0x180) = local_40;
      return CONCAT71((uint7)(uint3)((uint)local_40 >> 8),1);
    }
    fVar3 = fVar3 + 0.2;
  } while (fVar3 < 1.0);
  return uVar2 & 0xffffffffffffff00;
}



float FUN_14022ee30(longlong param_1,wchar_t *param_2)

{
  int iVar1;
  longlong lVar2;
  wchar_t *pwVar3;
  bool bVar4;
  
  if (*(longlong *)(param_1 + 0x130) != 0) {
    pwVar3 = (wchar_t *)(param_1 + 0x1b18);
    if (7 < *(ulonglong *)(param_1 + 0x1b30)) {
      pwVar3 = *(wchar_t **)pwVar3;
    }
    iVar1 = _wcsicmp(param_2,pwVar3);
    if (iVar1 == 0) {
      lVar2 = *(longlong *)(param_1 + 0x130);
      if ((int)(*(longlong *)(lVar2 + 0x350) - *(longlong *)(lVar2 + 0x348) >> 2) < 1) {
        return 0.0;
      }
      return **(float **)(lVar2 + 0x348);
    }
    lVar2 = 0xd;
    bVar4 = false;
    pwVar3 = L"catch02_move";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      bVar4 = *param_2 == *pwVar3;
      param_2 = param_2 + 1;
      pwVar3 = pwVar3 + 1;
    } while (bVar4);
    if (bVar4) {
      lVar2 = *(longlong *)(param_1 + 0x130);
      if ((int)(*(longlong *)(lVar2 + 0x350) - *(longlong *)(lVar2 + 0x348) >> 2) < 1) {
        return 0.0;
      }
      return **(float **)(lVar2 + 0x348) / 3.0;
    }
  }
  return 1.0;
}



double FUN_14022ef30(longlong param_1)

{
  float fVar1;
  double dVar2;
  
  dVar2 = (double)(*(float *)(param_1 + 0x7fc) + 1.0 + *(float *)(param_1 + 0x904) +
                  *(float *)(param_1 + 0x844)) * *(double *)(param_1 + 0x1450);
  if ((*(longlong *)(param_1 + 0xb80) != 0) &&
     (fVar1 = *(float *)(*(longlong *)(param_1 + 0xb80) + 0x1f8), fVar1 != 1.0)) {
    dVar2 = dVar2 * (double)fVar1;
  }
  if ((*(longlong *)(param_1 + 0xb78) != 0) &&
     (fVar1 = *(float *)(*(longlong *)(param_1 + 0xb78) + 0x1f8), fVar1 != 1.0)) {
    dVar2 = dVar2 * (double)fVar1;
  }
  return dVar2;
}



undefined8 * FUN_14022efc0(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  
  lVar1 = *(longlong *)(param_1 + 0x13d8);
  if ((((lVar1 != 0) && (*(longlong *)(lVar1 + 0x10) != 0)) && (*(int *)(lVar1 + 0x30) != 0)) &&
     (lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0xd8), lVar2 != 0)) {
    lVar4 = 0;
    iVar3 = *(int *)(lVar1 + 0x30) + -1;
    lVar5 = lVar4;
    if ((-1 < iVar3) &&
       (iVar3 < (int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4))) {
      lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10);
    }
    if (lVar5 != 0) {
      if (((*(longlong *)(lVar1 + 0x10) != 0) && (*(int *)(lVar1 + 0x30) != 0)) &&
         ((lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0xd8), lVar2 != 0 &&
          ((iVar3 = *(int *)(lVar1 + 0x30) + -1, lVar4 = 0, -1 < iVar3 &&
           (iVar3 < (int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4))))))) {
        lVar4 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10);
      }
      if (*(ulonglong *)(lVar4 + 0x1d0) < 8) {
        return (undefined8 *)(lVar4 + 0x1b8);
      }
      return *(undefined8 **)(lVar4 + 0x1b8);
    }
  }
  return (undefined8 *)0x0;
}



ulonglong FUN_14022f080(longlong param_1,char param_2)

{
  uint uVar1;
  ulonglong in_RAX;
  
  if (*(char *)(param_1 + 0x1869) != '\x04') {
    if (param_2 == '\0') {
      in_RAX = 0;
      switch(*(undefined4 *)(param_1 + 300)) {
      case 0:
      case 0x1f:
      case 0x20:
      case 0x25:
      case 0x46:
      case 0x47:
      case 0x62:
        goto switchD_14022f0d3_caseD_0;
      }
    }
    else {
      uVar1 = *(uint *)(param_1 + 300);
      in_RAX = (ulonglong)uVar1;
      if (((uVar1 == 0) || (uVar1 == 0x25)) ||
         ((0x45 < (int)uVar1 && (((int)uVar1 < 0x48 || (uVar1 == 0x62))))))
      goto switchD_14022f0d3_caseD_0;
    }
    return CONCAT71((int7)(in_RAX >> 8),1);
  }
switchD_14022f0d3_caseD_0:
  return in_RAX & 0xffffffffffffff00;
}



void FUN_14022f150(longlong param_1,undefined4 param_2,int param_3,undefined4 *param_4,
                  undefined4 *param_5,undefined4 param_6,undefined4 param_7)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 local_e8 [4];
  undefined4 local_e4;
  int local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined8 local_ac;
  undefined1 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined8 local_68;
  undefined2 local_60;
  undefined8 local_5c;
  undefined4 local_54;
  undefined2 local_50;
  undefined8 local_4c;
  undefined8 local_44;
  undefined1 local_3c;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    if (lVar1 == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4) + 1;
    }
    if (((param_3 < iVar3) && (*(longlong *)(param_1 + 0x1e80) != 0)) &&
       (*(int *)(param_1 + 300) != 0x62)) {
      uVar4 = 0;
      cVar2 = FUN_140195920(param_1 + 0x12e8);
      if (cVar2 != '\0') {
        uVar4 = FUN_140195970(param_1 + 0x12e8);
        FUN_14034ed40(uVar4);
      }
      local_e8[0] = 0;
      local_ac = 0;
      local_a4 = 0;
      local_98 = 0;
      local_94 = 0;
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_68 = 0;
      local_60 = 0;
      local_5c = 0;
      local_54 = 0;
      local_50 = 0;
      local_4c = 0;
      local_44 = 0;
      local_3c = 0;
      local_dc = *param_4;
      local_d8 = param_4[1];
      local_d4 = param_4[2];
      local_d0 = *param_5;
      local_cc = param_5[1];
      local_c8 = param_5[2];
      local_c4 = 0;
      local_c0 = 0;
      local_bc = 0;
      local_a0 = param_6;
      local_9c = param_7;
      local_90 = 0;
      local_e4 = param_2;
      local_e0 = param_3;
      FUN_14023ad50(param_1 + 0x18a8,local_e8);
      if (cVar2 != '\0') {
        FUN_14034edd0(uVar4);
      }
    }
  }
  return;
}



void FUN_14022f330(longlong param_1,undefined8 param_2,int param_3,undefined4 *param_4,
                  undefined4 *param_5,undefined4 *param_6)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 local_e8 [4];
  undefined4 local_e4;
  int local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined8 local_ac;
  undefined1 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined8 local_90;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined8 local_68;
  undefined2 local_60;
  undefined8 local_5c;
  undefined4 local_54;
  undefined2 local_50;
  undefined8 local_4c;
  undefined8 local_44;
  undefined1 local_3c;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    if (lVar1 == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4) + 1;
    }
    if (((param_3 < iVar3) && (*(longlong *)(param_1 + 0x1e80) != 0)) &&
       (*(int *)(param_1 + 300) != 0x62)) {
      uVar4 = 0;
      cVar2 = FUN_140195920(param_1 + 0x12e8,param_2,param_3,param_4,0,0);
      if (cVar2 != '\0') {
        uVar4 = FUN_140195970(param_1 + 0x12e8);
        FUN_14034ed40(uVar4);
      }
      local_e8[0] = 0;
      local_ac = 0;
      local_a4 = 0;
      local_a0 = 0;
      local_9c = 0;
      local_98 = 0;
      local_94 = 0;
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_68 = 0;
      local_60 = 0;
      local_5c = 0;
      local_54 = 0;
      local_50 = 0;
      local_4c = 0;
      local_44 = 0;
      local_3c = 0;
      local_e4 = (undefined4)param_2;
      local_dc = *param_4;
      local_d8 = param_4[1];
      local_d4 = param_4[2];
      local_d0 = *param_5;
      local_cc = param_5[1];
      local_c8 = param_5[2];
      local_c4 = *param_6;
      local_c0 = param_6[1];
      local_bc = param_6[2];
      local_90 = 0;
      local_e0 = param_3;
      FUN_14023ad50(param_1 + 0x18a8,local_e8);
      if (cVar2 != '\0') {
        FUN_14034edd0(uVar4);
      }
    }
  }
  return;
}



void FUN_14022f4f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined1 uVar4;
  undefined1 local_d8 [4];
  undefined8 local_d4;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined8 local_9c;
  undefined1 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined4 local_60;
  undefined8 local_58;
  undefined2 local_50;
  undefined8 local_4c;
  undefined4 local_44;
  undefined2 local_40;
  undefined8 local_3c;
  undefined4 local_34;
  undefined4 local_30;
  undefined1 local_2c;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0x1e80) != 0) && (*(int *)(param_1 + 300) != 0x62)) {
    uVar2 = 0;
    uVar3 = 0;
    uVar4 = 0;
    cVar1 = FUN_140195920(param_1 + 0x12e8,param_2,param_3,param_4,0,0);
    if (cVar1 != '\0') {
      uVar2 = FUN_140195970(param_1 + 0x12e8);
      uVar3 = uVar2;
      FUN_14034ed40(uVar2);
      uVar4 = 1;
    }
    local_d8[0] = 0;
    local_cc = 0;
    local_c8 = 0;
    local_c4 = 0;
    local_c0 = 0;
    local_bc = 0;
    local_b8 = 0;
    local_b4 = 0;
    local_b0 = 0;
    local_ac = 0;
    local_9c = 0;
    local_94 = 0;
    local_90 = 0;
    local_8c = 0;
    local_88 = 0;
    local_84 = 0;
    local_80 = 0;
    local_78 = 0;
    local_70 = 0;
    local_68 = 0;
    local_60 = 0;
    local_58 = 0;
    local_50 = 0;
    local_4c = 0;
    local_44 = 0;
    local_40 = 0;
    local_3c = 0;
    local_34 = 0;
    local_2c = 0;
    local_d4 = 0x67;
    local_30 = (undefined4)param_2;
    FUN_14023ad50(param_1 + 0x18a8,local_d8,param_3,param_4,uVar3,uVar4);
    if (cVar1 != '\0') {
      FUN_14034edd0(uVar2);
    }
  }
  return;
}



void FUN_14022f670(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined1 uVar4;
  undefined1 local_d8 [4];
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined8 local_9c;
  undefined1 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined4 local_60;
  undefined8 local_58;
  undefined2 local_50;
  undefined8 local_4c;
  undefined4 local_44;
  undefined2 local_40;
  undefined8 local_3c;
  undefined8 local_34;
  undefined1 local_2c;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0x1e80) != 0) && (*(int *)(param_1 + 300) != 0x62)) {
    uVar2 = 0;
    uVar3 = 0;
    uVar4 = 0;
    cVar1 = FUN_140195920(param_1 + 0x12e8);
    if (cVar1 != '\0') {
      uVar2 = FUN_140195970(param_1 + 0x12e8);
      uVar3 = uVar2;
      FUN_14034ed40(uVar2);
      uVar4 = 1;
    }
    local_d8[0] = 0;
    local_9c = 0;
    local_94 = 0;
    local_88 = 0;
    local_84 = 0;
    local_78 = 0;
    local_70 = 0;
    local_68 = 0;
    local_60 = 0;
    local_58 = 0;
    local_50 = 0;
    local_4c = 0;
    local_44 = 0;
    local_40 = 0;
    local_3c = 0;
    local_34 = 0;
    local_2c = 0;
    local_d4 = 0x52;
    local_cc = 0;
    local_c8 = 0;
    local_c4 = 0;
    local_c0 = 0;
    local_bc = 0;
    local_b8 = 0;
    local_b4 = 0;
    local_b0 = 0;
    local_ac = 0;
    local_90 = 0;
    local_8c = 0;
    local_80 = 0;
    local_d0 = param_2;
    FUN_14023ad50(param_1 + 0x18a8,local_d8,param_3,param_4,0,0,uVar3,uVar4);
    if (cVar1 != '\0') {
      FUN_14034edd0(uVar2);
    }
  }
  return;
}



void FUN_14022f830(longlong param_1,undefined8 param_2,int param_3,undefined4 *param_4,
                  undefined4 *param_5,undefined4 param_6,undefined4 *param_7)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 local_e8 [4];
  undefined4 local_e4;
  int local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined8 local_ac;
  undefined1 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined8 local_68;
  undefined2 local_60;
  undefined8 local_5c;
  undefined4 local_54;
  undefined2 local_50;
  undefined8 local_4c;
  undefined8 local_44;
  undefined1 local_3c;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    if (lVar1 == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4) + 1;
    }
    if (((param_3 < iVar3) && (*(longlong *)(param_1 + 0x1e80) != 0)) &&
       (*(int *)(param_1 + 300) != 0x62)) {
      uVar4 = 0;
      cVar2 = FUN_140195920(param_1 + 0x12e8,param_2,param_3,param_4,0,0);
      if (cVar2 != '\0') {
        uVar4 = FUN_140195970(param_1 + 0x12e8);
        FUN_14034ed40(uVar4);
      }
      local_e8[0] = 0;
      local_ac = 0;
      local_a4 = 0;
      local_a0 = 0;
      local_9c = 0;
      local_98 = 0;
      local_94 = 0;
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_68 = 0;
      local_60 = 0;
      local_5c = 0;
      local_54 = 0;
      local_50 = 0;
      local_4c = 0;
      local_44 = 0;
      local_3c = 0;
      local_e4 = (undefined4)param_2;
      local_dc = *param_4;
      local_d8 = param_4[1];
      local_d4 = param_4[2];
      local_d0 = *param_7;
      local_cc = param_7[1];
      local_c8 = param_7[2];
      local_c4 = *param_5;
      local_c0 = param_5[1];
      local_bc = param_5[2];
      local_90 = param_6;
      local_8c = 0;
      local_e0 = param_3;
      FUN_14023ad50(param_1 + 0x18a8,local_e8);
      if (cVar2 != '\0') {
        FUN_14034edd0(uVar4);
      }
    }
  }
  return;
}



void FUN_14022fa00(longlong param_1,undefined4 param_2,int param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 *param_7,undefined4 *param_8,
                  undefined4 param_9,undefined4 param_10,undefined4 *param_11)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 local_e8 [4];
  undefined4 local_e4;
  int local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined8 local_ac;
  undefined1 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined8 local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined8 local_68;
  undefined2 local_60;
  undefined8 local_5c;
  undefined4 local_54;
  undefined2 local_50;
  undefined8 local_4c;
  undefined8 local_44;
  undefined1 local_3c;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    if (lVar1 == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4) + 1;
    }
    if (((param_3 < iVar3) && (*(longlong *)(param_1 + 0x1e80) != 0)) &&
       (*(int *)(param_1 + 300) != 0x62)) {
      uVar4 = 0;
      cVar2 = FUN_140195920(param_1 + 0x12e8);
      if (cVar2 != '\0') {
        uVar4 = FUN_140195970(param_1 + 0x12e8);
        FUN_14034ed40(uVar4);
      }
      local_e8[0] = 0;
      local_a4 = 0;
      local_98 = 0;
      local_94 = 0;
      local_90 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_68 = 0;
      local_5c = 0;
      local_54 = 0;
      local_50 = 0;
      local_4c = 0;
      local_44 = 0;
      local_3c = 0;
      local_dc = *param_7;
      local_d8 = param_7[1];
      local_d4 = param_7[2];
      local_d0 = *param_8;
      local_cc = param_8[1];
      local_c8 = param_8[2];
      local_c4 = 0;
      local_c0 = 0;
      local_bc = 0;
      local_a0 = param_9;
      local_9c = param_10;
      local_ac = 0;
      local_84 = param_5;
      local_88 = param_6;
      local_60 = 0;
      local_b8 = *param_11;
      local_b4 = param_11[1];
      local_b0 = param_11[2];
      local_e4 = param_2;
      local_e0 = param_3;
      local_8c = param_4;
      FUN_14023ad50(param_1 + 0x18a8,local_e8);
      if (cVar2 != '\0') {
        FUN_14034edd0(uVar4);
      }
    }
  }
  return;
}



void FUN_14022fc10(longlong param_1,longlong param_2)

{
  longlong lVar1;
  char cVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  undefined1 uVar5;
  undefined1 local_d8 [4];
  uint local_d4;
  uint local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  float local_c0;
  float local_bc;
  float local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined8 local_9c;
  undefined1 local_94;
  float local_90;
  float local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  int local_7c;
  undefined4 local_78;
  int local_74;
  undefined8 local_70;
  undefined4 local_68;
  undefined8 local_64;
  undefined8 local_58;
  undefined2 local_50;
  undefined8 local_4c;
  undefined4 local_44;
  undefined2 local_40;
  undefined8 local_3c;
  undefined8 local_34;
  undefined1 local_2c;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    uVar3 = 0;
    uVar4 = uVar3;
    if (lVar1 != 0) {
      uVar4 = (ulonglong)((int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4) + 1)
      ;
    }
    if ((((int)(uint)*(ushort *)(param_2 + 10) < (int)uVar4) &&
        (*(longlong *)(param_1 + 0x1e80) != 0)) && (*(int *)(param_1 + 300) != 0x62)) {
      uVar4 = 0;
      uVar5 = 0;
      cVar2 = FUN_140195920(param_1 + 0x12e8);
      if (cVar2 != '\0') {
        uVar3 = FUN_140195970(param_1 + 0x12e8);
        uVar4 = uVar3;
        FUN_14034ed40(uVar3);
        uVar5 = 1;
      }
      local_d8[0] = 0;
      local_9c = 0;
      local_94 = 0;
      local_88 = 0;
      local_84 = 0;
      local_80 = 0;
      local_70 = 0;
      local_64 = 0;
      local_58 = 0;
      local_50 = 0;
      local_4c = 0;
      local_44 = 0;
      local_40 = 0;
      local_3c = 0;
      local_34 = 0;
      local_d4 = (uint)*(ushort *)(param_2 + 8);
      local_d0 = (uint)*(ushort *)(param_2 + 10);
      local_cc = *(undefined4 *)(param_2 + 0x20);
      local_c8 = *(undefined4 *)(param_2 + 0x24);
      local_c4 = *(undefined4 *)(param_2 + 0x28);
      local_b8 = (float)(int)*(char *)(param_2 + 0x1e) / 125.0;
      local_bc = (float)(int)*(char *)(param_2 + 0x1d) / 125.0;
      local_c0 = (float)(int)*(char *)(param_2 + 0x1c) / 125.0;
      local_b4 = 0;
      local_b0 = 0;
      local_ac = 0;
      local_90 = (float)(int)*(short *)(param_2 + 0x2c);
      local_8c = (float)*(ushort *)(param_2 + 0x2e);
      local_78 = *(undefined4 *)(param_2 + 0x10);
      local_74 = (int)*(char *)(param_2 + 0xd);
      local_7c = (int)*(char *)(param_2 + 0xc);
      local_68 = *(undefined4 *)(param_2 + 0x30);
      local_2c = *(undefined1 *)(param_2 + 0x35);
      FUN_14023ad50(param_1 + 0x18a8,local_d8,0x42fa0000,local_b8,0,0,uVar4,uVar5);
      if (cVar2 != '\0') {
        FUN_14034edd0(uVar3);
      }
    }
  }
  return;
}



void FUN_14022fe70(longlong param_1,undefined8 param_2,int param_3,undefined4 param_4,
                  undefined4 *param_5,undefined4 *param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 *param_9,undefined4 param_10)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 local_e8 [4];
  undefined4 local_e4;
  int local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined8 local_ac;
  undefined1 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined8 local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined8 local_68;
  undefined2 local_60;
  undefined8 local_5c;
  undefined4 local_54;
  undefined2 local_50;
  undefined4 local_4c;
  undefined8 local_48;
  undefined4 local_40;
  undefined1 local_3c;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    if (lVar1 == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4) + 1;
    }
    if (((param_3 < iVar3) && (*(longlong *)(param_1 + 0x1e80) != 0)) &&
       (*(int *)(param_1 + 300) != 0x62)) {
      uVar4 = 0;
      cVar2 = FUN_140195920(param_1 + 0x12e8,param_2,param_3,param_4,0,0);
      if (cVar2 != '\0') {
        uVar4 = FUN_140195970(param_1 + 0x12e8);
        FUN_14034ed40(uVar4);
      }
      local_e8[0] = 0;
      local_a4 = 0;
      local_98 = 0;
      local_94 = 0;
      local_90 = 0;
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_68 = 0;
      local_60 = 0;
      local_5c = 0;
      local_54 = 0;
      local_50 = 0;
      local_48 = 0;
      local_40 = 0;
      local_3c = 0;
      local_e4 = (undefined4)param_2;
      local_dc = *param_5;
      local_d8 = param_5[1];
      local_d4 = param_5[2];
      local_d0 = *param_6;
      local_cc = param_6[1];
      local_c8 = param_6[2];
      local_c4 = *param_9;
      local_c0 = param_9[1];
      local_bc = param_9[2];
      local_a0 = param_7;
      local_9c = param_8;
      local_ac = 0;
      local_4c = param_10;
      local_e0 = param_3;
      local_8c = param_4;
      FUN_14023ad50(param_1 + 0x18a8,local_e8);
      if (cVar2 != '\0') {
        FUN_14034edd0(uVar4);
      }
    }
  }
  return;
}



void FUN_140230050(longlong param_1,longlong param_2)

{
  longlong lVar1;
  char cVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  undefined1 uVar5;
  undefined1 local_d8 [4];
  uint local_d4;
  uint local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  float local_c0;
  float local_bc;
  float local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined1 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  int local_7c;
  undefined4 local_78;
  int local_74;
  undefined8 local_70;
  undefined8 local_68;
  undefined4 local_60;
  undefined8 local_58;
  undefined1 local_50;
  undefined1 local_4f;
  undefined8 local_4c;
  undefined4 local_44;
  undefined1 local_40;
  undefined1 local_3f;
  undefined4 local_3c;
  undefined8 local_38;
  undefined4 local_30;
  undefined1 local_2c;
  undefined8 local_28;
  
  local_28 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    uVar3 = 0;
    uVar4 = uVar3;
    if (lVar1 != 0) {
      uVar4 = (ulonglong)((int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4) + 1)
      ;
    }
    if ((((int)(uint)*(ushort *)(param_2 + 10) < (int)uVar4) &&
        (*(longlong *)(param_1 + 0x1e80) != 0)) && (*(int *)(param_1 + 300) != 0x62)) {
      uVar4 = 0;
      uVar5 = 0;
      cVar2 = FUN_140195920(param_1 + 0x12e8);
      if (cVar2 != '\0') {
        uVar3 = FUN_140195970(param_1 + 0x12e8);
        uVar4 = uVar3;
        FUN_14034ed40(uVar3);
        uVar5 = 1;
      }
      local_94 = 0;
      local_88 = 0;
      local_84 = 0;
      local_80 = 0;
      local_70 = 0;
      local_68 = 0;
      local_60 = 0;
      local_58 = 0;
      local_4c = 0;
      local_44 = 0;
      local_40 = 0;
      local_38 = 0;
      local_30 = 0;
      local_d8[0] = 1;
      local_d4 = (uint)*(ushort *)(param_2 + 8);
      local_d0 = (uint)*(ushort *)(param_2 + 10);
      local_cc = *(undefined4 *)(param_2 + 0x30);
      local_c8 = *(undefined4 *)(param_2 + 0x34);
      local_c4 = *(undefined4 *)(param_2 + 0x38);
      local_b8 = (float)(int)*(char *)(param_2 + 0x2e) / 125.0;
      local_bc = (float)(int)*(char *)(param_2 + 0x2d) / 125.0;
      local_c0 = (float)(int)*(char *)(param_2 + 0x2c) / 125.0;
      local_b4 = 0;
      local_b0 = 0;
      local_ac = 0;
      local_90 = *(undefined4 *)(param_2 + 0x24);
      local_8c = *(undefined4 *)(param_2 + 0x28);
      local_7c = (int)*(char *)(param_2 + 0xc);
      local_9c = *(undefined4 *)(param_2 + 0x3c);
      local_98 = *(undefined4 *)(param_2 + 0x40);
      local_74 = (int)*(char *)(param_2 + 0xd);
      local_78 = *(undefined4 *)(param_2 + 0x10);
      local_50 = 1;
      local_4f = *(undefined1 *)(param_2 + 0x44);
      local_a8 = *(undefined4 *)(param_2 + 0x48);
      local_a4 = *(undefined4 *)(param_2 + 0x4c);
      local_a0 = *(undefined4 *)(param_2 + 0x50);
      local_3f = *(undefined1 *)(param_2 + 0x54);
      local_3c = *(undefined4 *)(param_2 + 0x58);
      local_2c = *(undefined1 *)(param_2 + 0x5d);
      FUN_14023ad50(param_1 + 0x18a8,local_d8,0x42fa0000,local_b8,0,0,uVar4,uVar5);
      if (cVar2 != '\0') {
        FUN_14034edd0(uVar3);
      }
    }
  }
  return;
}



void FUN_1402302d0(longlong *param_1,double param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  lVar4 = 0;
  bVar8 = false;
  plVar1 = (longlong *)param_1[0x25d];
  lVar6 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    plVar2 = (longlong *)param_1[0x25e];
    if (plVar1 == plVar2) {
      lVar5 = *plVar1;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar1 != plVar2) &&
           (iVar3 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar3, bVar8)) {
          FUN_140176d60(1,plVar2,param_3,param_4,0xfffffffffffffffe,0,0);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar7) {
        FUN_140176d60(1,plVar2,param_3,param_4,0xfffffffffffffffe,0,0);
      }
    }
  }
  if (*(int *)((longlong)param_1 + 300) != 0x25) {
    if (((*(float *)(param_1 + 0xb6) != 0.0) && (*(int *)((longlong)param_1 + 300) != 0x25)) &&
       ((float)((double)*(float *)(param_1 + 0xb6) * param_2) != 0.0)) {
      (**(code **)(*param_1 + 0x2b8))(param_1);
    }
    if (((*(float *)((longlong)param_1 + 0x5b4) != 0.0) &&
        (*(int *)((longlong)param_1 + 300) != 0x25)) &&
       ((float)((double)*(float *)((longlong)param_1 + 0x5b4) * param_2) != 0.0)) {
      (**(code **)(*param_1 + 0x2c0))(param_1);
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar6);
  }
  return;
}



void FUN_140230430(longlong *param_1,double param_2,undefined8 param_3)

{
  wchar_t wVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  wchar_t *pwVar5;
  longlong *plVar6;
  longlong lVar7;
  wchar_t *_Str1;
  uint uVar8;
  float fVar9;
  float fVar10;
  
  uVar8 = 0;
  iVar4 = DAT_140608140;
  do {
    if (uVar8 < 2) {
      plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
    }
    else {
      if (iVar4 == 0) {
        FUN_140176d60(0);
        iVar4 = DAT_140608140;
      }
      DAT_140608140 = iVar4 + 1;
      plVar6 = &DAT_140608148;
      iVar4 = DAT_140608140;
    }
    if ((*plVar6 != 0) && (param_1[0x27b] != 0)) {
      if (param_1[0x16f] == 0) {
        fVar9 = 1.0;
      }
      else {
        fVar9 = *(float *)(param_1[0x16f] + 0x1f8);
      }
      if (uVar8 < 2) {
        plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
      }
      else {
        if (iVar4 == 0) {
          FUN_140176d60(0);
          iVar4 = DAT_140608140;
        }
        DAT_140608140 = iVar4 + 1;
        plVar6 = &DAT_140608148;
      }
      iVar4 = FUN_14032afb0(*plVar6,param_2,param_3);
      if ((0 < iVar4) && (uVar8 == 0)) {
        (**(code **)(*param_1 + 0x930))(param_1,iVar4,0);
      }
      if (param_1[0x16f] == 0) {
        fVar10 = 1.0;
      }
      else {
        fVar10 = *(float *)(param_1[0x16f] + 0x1f8);
      }
      if (0.01 < ABS(fVar10 - fVar9)) {
        FUN_1402c5e50(param_1[0x27b]);
        fVar9 = (float)FUN_1402c5ee0(param_1[0x27b]);
        param_1[0x28a] = (longlong)(double)fVar9;
      }
      if (uVar8 == 0) {
        if ((*(char *)(*(longlong *)(param_1[0x16f] + 0x1a8) + 0x20) != '\0') &&
           (*(int *)((longlong)param_1 + 300) != 0x57)) {
          (**(code **)(*param_1 + 200))(param_1,0x57);
        }
        if ((*(char *)(*(longlong *)(param_1[0x16f] + 0x1e8) + 0x20) != '\0') &&
           (*(int *)((longlong)param_1 + 300) != 0x58)) {
          (**(code **)(*param_1 + 200))(param_1,0x58);
        }
        if (((*(char *)(*(longlong *)(param_1[0x16f] + 0x198) + 0x20) != '\0') &&
            (cVar3 = FUN_1402fb200(param_1), cVar3 != '\0')) &&
           (*(int *)((longlong)param_1 + 300) != 0x55)) {
          (**(code **)(*param_1 + 200))(param_1,0x55);
          _Str1 = (wchar_t *)(DAT_1406081d8 + 0x4e0);
          if (7 < *(ulonglong *)(DAT_1406081d8 + 0x4f8)) {
            _Str1 = *(wchar_t **)_Str1;
          }
          pwVar5 = (wchar_t *)(DAT_1406081d8 + 0x738);
          if (7 < *(ulonglong *)(DAT_1406081d8 + 0x750)) {
            pwVar5 = *(wchar_t **)pwVar5;
          }
          if (((char)param_1[0xc0] != '\0') || (*(char *)((longlong)param_1 + 0x601) != '\0')) {
            _Str1 = pwVar5;
          }
          iVar4 = _wcsicmp(_Str1,L"");
          if (iVar4 != 0) {
            lVar2 = param_1[0x27b];
            lVar7 = -1;
            pwVar5 = _Str1;
            do {
              if (lVar7 == 0) break;
              lVar7 = lVar7 + -1;
              wVar1 = *pwVar5;
              pwVar5 = pwVar5 + 1;
            } while (wVar1 != L'\0');
            if (lVar7 != -2) {
              lVar7 = -1;
              pwVar5 = _Str1;
              do {
                if (lVar7 == 0) break;
                lVar7 = lVar7 + -1;
                wVar1 = *pwVar5;
                pwVar5 = pwVar5 + 1;
              } while (wVar1 != L'\0');
              FUN_140001710(lVar2 + 0x40,_Str1);
              if (*(longlong *)(lVar2 + 0x10) != 0) {
                lVar7 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
                iVar4 = 0;
                if (lVar7 != 0) {
                  iVar4 = FUN_1402ce620(lVar7,_Str1);
                  iVar4 = iVar4 + 1;
                }
                FUN_1402c5c00(lVar2,iVar4,0,0);
              }
            }
            FUN_1402c5e50(param_1[0x27b],0x3f800000);
            *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 1;
            lVar2 = *(longlong *)(param_1[0x27b] + 0x20);
            if (*(int *)(lVar2 + 0x54) == 1) {
              *(longlong *)(lVar2 + 0x10) = param_1[0xa2];
              FUN_1402cc2c0(lVar2);
            }
            *(undefined4 *)(lVar2 + 0x54) = 0;
            fVar9 = (float)FUN_1402c5ee0(param_1[0x27b]);
            param_1[0x28b] = 0;
            *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x154);
            param_1[0x28a] = (longlong)(double)fVar9;
            *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x2b];
            *(undefined1 *)(param_1 + 0x27f) = 0;
            *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x15c);
          }
        }
        if ((*(char *)(*(longlong *)(param_1[0x16f] + 0x1a0) + 0x20) != '\0') &&
           (*(int *)((longlong)param_1 + 300) != 0x59)) {
          (**(code **)(*param_1 + 200))(param_1,0x59);
        }
        if ((*(char *)(*(longlong *)(param_1[0x16f] + 0x1c8) + 0x20) != '\0') &&
           (*(int *)((longlong)param_1 + 300) != 0x56)) {
          (**(code **)(*param_1 + 200))(param_1,0x56);
          FUN_140239aa0(param_1,10);
        }
LAB_140230846:
        plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
      }
      else {
        if ((-1 < (int)uVar8) && ((int)uVar8 < 2)) goto LAB_140230846;
        if (DAT_140608140 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608140 = DAT_140608140 + 1;
        plVar6 = &DAT_140608148;
      }
      if (*(char *)(*(longlong *)(*plVar6 + 400) + 0x20) != '\0') {
        if (uVar8 < 2) {
          plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
        }
        else {
          if (DAT_140608140 == 0) {
            FUN_140176d60(0);
          }
          DAT_140608140 = DAT_140608140 + 1;
          plVar6 = &DAT_140608148;
        }
        if (((double)*(float *)(*(longlong *)(*plVar6 + 400) + 0x54) <
             param_2 - (double)param_1[0x39f]) && (0.0 < *(float *)(param_1 + 0xb3))) {
          FUN_1402249b0(param_1,3);
          if (uVar8 < 2) {
            plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
          }
          else {
            if (DAT_140608140 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608140 = DAT_140608140 + 1;
            plVar6 = &DAT_140608148;
          }
          (**(code **)**(undefined8 **)(*plVar6 + 400))();
          if (((int)uVar8 < 0) || (1 < (int)uVar8)) {
            if (DAT_140608140 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608140 = DAT_140608140 + 1;
          }
        }
      }
      if (uVar8 < 2) {
        plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
      }
      else {
        if (DAT_140608140 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608140 = DAT_140608140 + 1;
        plVar6 = &DAT_140608148;
      }
      if (*(char *)(*(longlong *)(*plVar6 + 0x180) + 0x20) != '\0') {
        if (uVar8 < 2) {
          plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
        }
        else {
          if (DAT_140608140 == 0) {
            FUN_140176d60(0);
          }
          DAT_140608140 = DAT_140608140 + 1;
          plVar6 = &DAT_140608148;
        }
        if (((double)*(float *)(*(longlong *)(*plVar6 + 0x180) + 0x54) <
             param_2 - (double)param_1[0x39d]) && (0.0 < *(float *)(param_1 + 0xb3))) {
          FUN_1402249b0(param_1,1);
          if (uVar8 < 2) {
            plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
          }
          else {
            if (DAT_140608140 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608140 = DAT_140608140 + 1;
            plVar6 = &DAT_140608148;
          }
          (**(code **)**(undefined8 **)(*plVar6 + 0x180))();
          if (((int)uVar8 < 0) || (1 < (int)uVar8)) {
            if (DAT_140608140 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608140 = DAT_140608140 + 1;
          }
        }
      }
      if (uVar8 < 2) {
        plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
      }
      else {
        if (DAT_140608140 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608140 = DAT_140608140 + 1;
        plVar6 = &DAT_140608148;
      }
      if (*(char *)(*(longlong *)(*plVar6 + 0x1d8) + 0x20) != '\0') {
        if (uVar8 < 2) {
          plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
        }
        else {
          if (DAT_140608140 == 0) {
            FUN_140176d60(0);
          }
          DAT_140608140 = DAT_140608140 + 1;
          plVar6 = &DAT_140608148;
        }
        if (((double)*(float *)(*(longlong *)(*plVar6 + 0x1d8) + 0x54) <
             param_2 - (double)param_1[0x3a8]) && (0.0 < *(float *)(param_1 + 0xb3))) {
          FUN_1402249b0(param_1,0xc);
          if (uVar8 < 2) {
            plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
          }
          else {
            if (DAT_140608140 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608140 = DAT_140608140 + 1;
            plVar6 = &DAT_140608148;
          }
          (**(code **)**(undefined8 **)(*plVar6 + 0x1d8))();
          if (((int)uVar8 < 0) || (1 < (int)uVar8)) {
            if (DAT_140608140 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608140 = DAT_140608140 + 1;
          }
        }
      }
      if (uVar8 < 2) {
        plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
      }
      else {
        if (DAT_140608140 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608140 = DAT_140608140 + 1;
        plVar6 = &DAT_140608148;
      }
      iVar4 = DAT_140608140;
      if (*(char *)(*(longlong *)(*plVar6 + 0x1b8) + 0x20) != '\0') {
        if (uVar8 < 2) {
          plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
        }
        else {
          if (DAT_140608140 == 0) {
            FUN_140176d60(0);
          }
          DAT_140608140 = DAT_140608140 + 1;
          plVar6 = &DAT_140608148;
        }
        iVar4 = DAT_140608140;
        if (((double)*(float *)(*(longlong *)(*plVar6 + 0x1b8) + 0x54) <
             param_2 - (double)param_1[0x3a4]) && (0.0 < *(float *)(param_1 + 0xb3))) {
          FUN_1402249b0(param_1,8);
          if (uVar8 < 2) {
            plVar6 = param_1 + (longlong)(int)uVar8 + 0x16f;
          }
          else {
            if (DAT_140608140 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608140 = DAT_140608140 + 1;
            plVar6 = &DAT_140608148;
          }
          (**(code **)**(undefined8 **)(*plVar6 + 0x1b8))();
          if (((int)uVar8 < 0) || (iVar4 = DAT_140608140, 1 < (int)uVar8)) {
            if (DAT_140608140 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608140 = DAT_140608140 + 1;
            iVar4 = DAT_140608140;
          }
        }
      }
    }
    uVar8 = uVar8 + 1;
    if (1 < (int)uVar8) {
      FUN_140219320(param_1,param_2);
      return;
    }
  } while( true );
}



void FUN_140230d70(longlong param_1,longlong param_2)

{
  int iVar1;
  longlong lVar2;
  longlong *plVar3;
  char cVar4;
  undefined4 uVar5;
  
  if ((((*(longlong *)(param_1 + 0x1e80) != 0) &&
       (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30), lVar2 != 0)) &&
      (lVar2 = *(longlong *)(lVar2 + 0x2d0), lVar2 != 0)) &&
     (((iVar1 = *(int *)(lVar2 + 0x4bc), iVar1 != 3 && (iVar1 != 6)) &&
      (*(char *)(param_1 + 0xeec) != '\0')))) {
    iVar1 = *(int *)(param_1 + 0x1cac);
    if (iVar1 == 0) {
      if (5.0 < *(float *)(param_1 + 0x17c) - *(float *)(param_1 + 0x1e28)) {
        *(undefined4 *)(param_1 + 0x1cac) = 1;
      }
    }
    else {
      if (iVar1 == 1) {
        uVar5 = *(undefined4 *)(param_1 + 0x1e28);
        plVar3 = *(longlong **)(param_1 + 0xed0);
        lVar2 = *plVar3;
        *(undefined4 *)(plVar3 + 3) = 0;
        *(undefined4 *)((longlong)plVar3 + 0x1c) = 0xba83126f;
        plVar3[2] = param_2;
        *(undefined4 *)((longlong)plVar3 + 0x5c) = uVar5;
        *(undefined4 *)(plVar3 + 1) = uVar5;
        *(undefined4 *)((longlong)plVar3 + 0x24) = *(undefined4 *)(lVar2 + 0x178);
        *(undefined4 *)(plVar3 + 5) = *(undefined4 *)(lVar2 + 0x17c);
        *(undefined4 *)((longlong)plVar3 + 0x2c) = *(undefined4 *)(lVar2 + 0x180);
        *(undefined4 *)(plVar3 + 6) = 0;
        *(float *)(plVar3 + 5) = *(float *)(plVar3 + 5) + 0.0;
        *(undefined4 *)((longlong)plVar3 + 0x34) = 0;
        *(undefined4 *)(plVar3 + 7) = 0;
        uVar5 = FUN_1403144d0(0,0xba83126f,*(undefined4 *)(lVar2 + 0xecc),0x453b8000);
        *(undefined4 *)(plVar3 + 4) = uVar5;
        *(undefined4 *)(lVar2 + 0xee0) = uVar5;
        *(undefined4 *)(plVar3 + 0xc) = 0x461c4000;
        *(undefined4 *)(param_1 + 0x1cac) = 2;
        return;
      }
      if (iVar1 == 2) {
        cVar4 = FUN_14032dd70(*(undefined8 *)(param_1 + 0xed0));
        if (cVar4 != '\0') {
          *(undefined4 *)(param_1 + 0x1cac) = 3;
          return;
        }
      }
      else if (iVar1 == 3) {
        *(undefined4 *)(param_1 + 0x1cac) = 0;
        return;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_140230f20(longlong *param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  undefined4 uVar6;
  float *pfVar7;
  longlong lVar8;
  float fVar9;
  int local_res8 [2];
  undefined4 local_res10 [2];
  undefined4 local_res18 [2];
  float local_c0;
  float local_bc;
  float local_b8;
  float local_b0;
  float local_ac;
  float local_a8;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined1 local_78 [64];
  
  if ((((param_1[0x3d0] != 0) && (lVar2 = *(longlong *)(param_1[0x3d0] + 0x30), lVar2 != 0)) &&
      (*(longlong *)(lVar2 + 0x2d0) != 0)) &&
     ((lVar2 = *(longlong *)(lVar2 + 0x2d0), lVar2 != 0 && (param_1[0x26] != 0)))) {
    iVar5 = rand();
    fVar9 = *(float *)(param_1[0x26] + 0x27c) * (((float)iVar5 / 32767.0) * 0.5 + 0.5);
    local_90 = 1;
    local_8c = 2;
    local_88 = 3;
    local_84 = 4;
    local_80 = 5;
    local_7c = 6;
    lVar8 = 0;
    if ((DAT_14060ab70 & 1) == 0) {
      DAT_14060ab70 = DAT_14060ab70 | 1;
      DAT_14060ab50 = 0;
      DAT_14060ab58 = 0;
      _DAT_14060ab60 = 0;
      FUN_14023b740(&DAT_14060ab50,&local_90,local_78);
      atexit(FUN_140448c50);
    }
    if (DAT_14060ab50 != DAT_14060ab58) {
      FUN_1401fbc30(DAT_14060ab50);
    }
    local_a0 = 0;
    local_9c = 0x3f800000;
    local_98 = 0;
    do {
      pfVar7 = (float *)FUN_140123260(param_1 + 0x2f,&local_a0,
                                      ((float)*(int *)(lVar8 + DAT_14060ab50) * 60.0 * 3.1415927) /
                                      180.0);
      local_c0 = *pfVar7;
      local_bc = pfVar7[1];
      local_b8 = pfVar7[2];
      D3DXVec3Normalize(&local_c0,&local_c0);
      local_b0 = local_c0 * fVar9 + *(float *)(param_1 + 0x2f);
      local_ac = *(float *)(param_1 + 0x2e);
      if (local_ac < *(float *)((longlong)param_1 + 0x17c)) {
        local_ac = *(float *)((longlong)param_1 + 0x17c);
      }
      local_a8 = local_b8 * fVar9 + *(float *)(param_1 + 0x30);
      local_res8[0] = 0;
      local_res10[0] = 0;
      local_res18[0] = 0;
      uVar6 = (**(code **)(*param_1 + 0x80))(param_1);
      if ((*(int *)(lVar2 + 0x428) != 0) &&
         (iVar5 = FUN_1402be1a0(lVar2 + 0x370,local_res18,local_res10,local_res8,&local_b0,uVar6),
         iVar5 != 0)) {
        lVar3 = *(longlong *)(lVar2 + 0x430);
        if (((local_res8[0] < (int)(*(longlong *)(lVar3 + 0x98) - *(longlong *)(lVar3 + 0x90) >> 3))
            && (((-1 < local_res8[0] &&
                 (lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x90) + (longlong)local_res8[0] * 8),
                 lVar3 != 0)) && (*(char *)(lVar3 + 0xe0) == '\0')))) &&
           (((iVar5 = (**(code **)(*param_1 + 0x80))(param_1), *(char *)(lVar3 + 0xe1) == '\0' ||
             (iVar5 == 3)) ||
            ((iVar1 = *(int *)(lVar3 + 0xe4), iVar1 != 0 && ((1 < iVar1 - 1U || (iVar1 != iVar5)))))
            ))) {
          lVar4 = *param_1;
          uVar6 = (**(code **)(lVar4 + 0x80))(param_1);
          (**(code **)(lVar4 + 0x18))(param_1,&local_b0,lVar3,uVar6);
          if ((char)param_1[10] != '\0') goto LAB_140231243;
        }
      }
      lVar8 = lVar8 + 4;
    } while (lVar8 < 0x18);
    if ((char)param_1[10] != '\0') {
LAB_140231243:
      (**(code **)(*param_1 + 0x918))(param_1,0);
      return 1;
    }
  }
  return 0;
}



undefined8 FUN_140231290(longlong *param_1)

{
  float fVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  undefined4 uVar5;
  int iVar6;
  longlong lVar7;
  int iVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  undefined4 local_res8 [2];
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a0;
  float local_9c;
  float local_98;
  void *local_90;
  undefined8 local_88;
  undefined8 local_80;
  
  lVar7 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (((((lVar7 == 0) || (param_1[0x3d0] == 0)) ||
       (lVar3 = *(longlong *)(param_1[0x3d0] + 0x30), lVar3 == 0)) ||
      ((*(longlong *)(lVar3 + 0x2d0) == 0 || (lVar3 = *(longlong *)(lVar3 + 0x2d0), lVar3 == 0))))
     || (param_1[0x26] == 0)) {
    return 0;
  }
  fVar1 = *(float *)(param_1[0x26] + 0x28c);
  local_98 = *(float *)(param_1 + 0x30) - *(float *)(lVar7 + 0x180);
  local_9c = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar7 + 0x17c);
  local_a0 = *(float *)(param_1 + 0x2f) - *(float *)(lVar7 + 0x178);
  D3DXVec3Normalize(&local_a0,&local_a0);
  local_a8 = local_98 * fVar1 + *(float *)(param_1 + 0x30);
  local_ac = local_9c * fVar1 + *(float *)((longlong)param_1 + 0x17c);
  local_b0 = local_a0 * fVar1 + *(float *)(param_1 + 0x2f);
  fVar9 = -local_98;
  fVar10 = -local_9c;
  fVar11 = -local_a0;
  iVar8 = 0;
  if (0 < (int)(fVar1 / 100.0)) {
    do {
      local_res8[0] = 0;
      local_90 = (void *)0x0;
      local_88 = 0;
      local_80 = 0;
      uVar5 = (**(code **)(*param_1 + 0x80))(param_1);
      iVar6 = FUN_1402bec00(lVar3 + 0x370,&local_90,local_res8,&local_b0,uVar5);
      if ((((iVar6 != -1) &&
           (lVar7 = *(longlong *)(lVar3 + 0x430),
           iVar6 < (int)(*(longlong *)(lVar7 + 0x98) - *(longlong *)(lVar7 + 0x90) >> 3))) &&
          ((-1 < iVar6 &&
           ((lVar7 = *(longlong *)(*(longlong *)(lVar7 + 0x90) + (longlong)iVar6 * 8), lVar7 != 0 &&
            (*(char *)(lVar7 + 0xe0) == '\0')))))) &&
         (((iVar6 = (**(code **)(*param_1 + 0x80))(param_1), *(char *)(lVar7 + 0xe1) == '\0' ||
           (iVar6 == 3)) ||
          ((iVar2 = *(int *)(lVar7 + 0xe4), iVar2 != 0 && ((1 < iVar2 - 1U || (iVar2 != iVar6)))))))
         ) {
        lVar4 = *param_1;
        uVar5 = (**(code **)(lVar4 + 0x80))(param_1);
        (**(code **)(lVar4 + 0x18))(param_1,&local_b0,lVar7,uVar5);
        if ((char)param_1[10] != '\0') {
          if (local_90 != (void *)0x0) {
            operator_delete(local_90);
          }
          break;
        }
      }
      if (local_90 != (void *)0x0) {
        operator_delete(local_90);
      }
      iVar8 = iVar8 + 1;
      local_b0 = local_b0 - fVar11 * 100.0;
      local_ac = local_ac - fVar10 * 100.0;
      local_a8 = local_a8 - fVar9 * 100.0;
    } while (iVar8 < (int)(fVar1 / 100.0));
  }
  *(float *)((longlong)param_1 + 0x154) = local_a0;
  *(float *)(param_1 + 0x2b) = local_9c;
  *(float *)((longlong)param_1 + 0x15c) = local_98;
  *(float *)(param_1 + 0x2c) = local_a0;
  *(float *)((longlong)param_1 + 0x164) = local_9c;
  *(float *)(param_1 + 0x2d) = local_98;
  *(float *)(param_1 + 0x269) = local_a0;
  *(float *)((longlong)param_1 + 0x134c) = local_9c;
  *(float *)(param_1 + 0x26a) = local_98;
  *(float *)((longlong)param_1 + 0x133c) = local_a0;
  *(float *)(param_1 + 0x268) = local_9c;
  *(float *)((longlong)param_1 + 0x1344) = local_98;
  (**(code **)(*param_1 + 0x918))(param_1,0);
  return 1;
}



undefined8
FUN_140231600(longlong *param_1,undefined8 param_2,undefined8 param_3,float *param_4,
             undefined4 param_5)

{
  char cVar1;
  float fVar2;
  
  cVar1 = FUN_14021e5f0(param_1,param_2,param_4,param_5);
  if (cVar1 != '\0') {
    (**(code **)(*param_1 + 0x918))(param_1,0);
  }
  fVar2 = param_4[1] - *(float *)((longlong)param_1 + 0x17c);
  if ((*param_4 - *(float *)(param_1 + 0x2f)) * (*param_4 - *(float *)(param_1 + 0x2f)) +
      fVar2 * fVar2 +
      (param_4[2] - *(float *)(param_1 + 0x30)) * (param_4[2] - *(float *)(param_1 + 0x30)) < 400.0)
  {
    return 0;
  }
  return 1;
}



void FUN_140231690(longlong *param_1,double param_2,longlong *param_3)

{
  longlong lVar1;
  double dVar2;
  longlong *plVar3;
  char cVar4;
  int iVar5;
  longlong *plVar6;
  double *pdVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float local_res18 [4];
  
  if ((param_3 != (longlong *)0x0) && (lVar1 = *param_3, lVar1 != 0)) {
    pdVar7 = (double *)param_1[0x401];
    fVar9 = *(float *)(lVar1 + 0x68) - *(float *)(param_1 + 0x2f);
    fVar10 = *(float *)(lVar1 + 0x6c) - *(float *)((longlong)param_1 + 0x17c);
    fVar8 = *(float *)(lVar1 + 0x70) - *(float *)(param_1 + 0x30);
    fVar9 = fVar10 * fVar10 + fVar9 * fVar9 + fVar8 * fVar8;
    local_res18[0] = (float)(0x5f3759df - ((int)fVar9 >> 1));
    fVar8 = local_res18[0] * (1.5 - local_res18[0] * local_res18[0] * fVar9 * 0.5);
    fVar9 = (1.5 - fVar8 * fVar8 * fVar9 * 0.5) * fVar8 * fVar9;
    if (pdVar7 != (double *)param_1[0x402]) {
      do {
        dVar2 = pdVar7[1];
        if (dVar2 != 0.0) {
          if (0.1 < *(float *)((longlong)dVar2 + 0x20)) {
            if (*pdVar7 <= 0.1) {
              *pdVar7 = param_2;
            }
            if (param_2 - *pdVar7 < (double)*(float *)((longlong)dVar2 + 0x20)) goto LAB_14023182f;
          }
          cVar4 = (**(code **)(*param_1 + 0x490))(param_1,*(undefined4 *)((longlong)dVar2 + 8));
          if (((cVar4 != '\0') && (*(float *)((longlong)dVar2 + 0x14) <= fVar9)) &&
             (iVar5 = rand(),
             (float)iVar5 * 3.0517578e-05 < *(float *)((longlong)dVar2 + 0x10) ||
             (float)iVar5 * 3.0517578e-05 == *(float *)((longlong)dVar2 + 0x10))) {
            if (fVar9 < *(float *)((longlong)dVar2 + 0x18) ||
                fVar9 == *(float *)((longlong)dVar2 + 0x18)) {
              FUN_14023a8b0(param_1 + 0xaf,(longlong)dVar2 + 0x48);
              *(undefined4 *)((longlong)param_1 + 0x1ec4) = *(undefined4 *)((longlong)dVar2 + 0xc);
              FUN_140237480(param_1,*(undefined4 *)((longlong)dVar2 + 0xc),param_3,1);
              *(undefined4 *)(param_1 + 0x3db) = *(undefined4 *)((longlong)dVar2 + 4);
              *pdVar7 = param_2;
              if (param_1[0xaf] == param_1[0xb0]) {
                *(undefined1 *)(param_1 + 0x3d8) = 1;
                (**(code **)(*param_1 + 0x8f8))(param_1,L"attack01",0,0x3f800000,1,0,0);
              }
              else {
                plVar3 = (longlong *)param_1[0xaf];
                *(bool *)(param_1 + 0x3d8) = (ulonglong)((param_1[0xb0] - param_1[0xaf]) / 0x30) < 2
                ;
                plVar6 = plVar3;
                if (7 < (ulonglong)plVar3[3]) {
                  plVar6 = (longlong *)*plVar3;
                }
                (**(code **)(*param_1 + 0x8f8))(param_1,plVar6,(int)plVar3[5],0x3f800000,1,0,0);
                FUN_14023aaa0(param_1 + 0xaf,local_res18,param_1[0xaf]);
              }
              break;
            }
            if (0.1 < *(float *)((longlong)dVar2 + 0x1c)) {
              *(undefined4 *)(param_1 + 0x3d9) = 1;
              *(undefined4 *)((longlong)param_1 + 0x181c) = *(undefined4 *)((longlong)dVar2 + 0x18);
              param_1[0x3da] = (longlong)((double)*(float *)((longlong)dVar2 + 0x1c) + param_2);
              *(undefined4 *)((longlong)param_1 + 0x1ec4) = *(undefined4 *)((longlong)dVar2 + 0xc);
              FUN_14023a8b0(param_1 + 0xaf,(longlong)dVar2 + 0x48);
              break;
            }
          }
        }
LAB_14023182f:
        pdVar7 = pdVar7 + 2;
      } while (pdVar7 != (double *)param_1[0x402]);
    }
    iVar5 = rand();
    param_1[0x166] = (longlong)((param_2 - (double)((float)iVar5 * 3.0517578e-05 * 3.0)) + 1.5);
  }
  return;
}



void FUN_140231a20(longlong *param_1,double param_2,longlong param_3)

{
  double dVar1;
  longlong *plVar2;
  char cVar3;
  int iVar4;
  longlong lVar5;
  wchar_t *_Str1;
  longlong *plVar6;
  double *pdVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  longlong lVar10;
  wchar_t *_Str2;
  uint uVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float local_res18 [4];
  
  if (param_3 != 0) {
    pdVar7 = (double *)param_1[0x401];
    fVar15 = *(float *)(param_3 + 0x178) - *(float *)(param_1 + 0x2f);
    fVar16 = *(float *)(param_3 + 0x17c) - *(float *)((longlong)param_1 + 0x17c);
    fVar14 = *(float *)(param_3 + 0x180) - *(float *)(param_1 + 0x30);
    fVar15 = fVar16 * fVar16 + fVar15 * fVar15 + fVar14 * fVar14;
    local_res18[0] = (float)(0x5f3759df - ((int)fVar15 >> 1));
    fVar14 = local_res18[0] * (1.5 - local_res18[0] * local_res18[0] * fVar15 * 0.5);
    fVar15 = (1.5 - fVar14 * fVar14 * fVar15 * 0.5) * fVar14 * fVar15;
    if (pdVar7 != (double *)param_1[0x402]) {
      uVar13 = 0;
      do {
        dVar1 = pdVar7[1];
        if (dVar1 != 0.0) {
          if (0.1 < *(float *)((longlong)dVar1 + 0x20)) {
            if (*pdVar7 <= 0.1) {
              *pdVar7 = param_2;
            }
            if (param_2 - *pdVar7 < (double)*(float *)((longlong)dVar1 + 0x20)) goto LAB_140231cc6;
          }
          cVar3 = (**(code **)(*param_1 + 0x490))(param_1,*(undefined4 *)((longlong)dVar1 + 8));
          if ((cVar3 != '\0') && (*(float *)((longlong)dVar1 + 0x14) <= fVar15)) {
            iVar4 = rand();
            fVar14 = (float)(**(code **)(*param_1 + 0xa98))(param_1);
            if ((float)iVar4 * 3.0517578e-05 <= fVar14 + *(float *)((longlong)dVar1 + 0x10)) {
              lVar10 = *(longlong *)((longlong)dVar1 + 0x28);
              if (lVar10 == *(longlong *)((longlong)dVar1 + 0x30)) {
LAB_140231cb4:
                if (fVar15 < *(float *)((longlong)dVar1 + 0x18) ||
                    fVar15 == *(float *)((longlong)dVar1 + 0x18)) {
                  FUN_14023a8b0(param_1 + 0xaf,(longlong)dVar1 + 0x48);
                  *(undefined4 *)((longlong)param_1 + 0x1ec4) =
                       *(undefined4 *)((longlong)dVar1 + 0xc);
                  FUN_140237940(param_1,*(undefined4 *)((longlong)dVar1 + 0xc),param_3,1);
                  *(undefined4 *)(param_1 + 0x3db) = *(undefined4 *)((longlong)dVar1 + 4);
                  *pdVar7 = param_2;
                  if (param_1[0xaf] == param_1[0xb0]) {
                    *(undefined1 *)(param_1 + 0x3d8) = 1;
                    (**(code **)(*param_1 + 0x8f8))(param_1,L"attack01",0,0x3f800000,1,0,0);
                  }
                  else {
                    plVar2 = (longlong *)param_1[0xaf];
                    *(bool *)(param_1 + 0x3d8) =
                         (ulonglong)((param_1[0xb0] - param_1[0xaf]) / 0x30) < 2;
                    plVar6 = plVar2;
                    if (7 < (ulonglong)plVar2[3]) {
                      plVar6 = (longlong *)*plVar2;
                    }
                    (**(code **)(*param_1 + 0x8f8))(param_1,plVar6,(int)plVar2[5],0x3f800000,1,0,0);
                    FUN_14023aaa0(param_1 + 0xaf,local_res18,param_1[0xaf]);
                  }
                  break;
                }
                if (0.1 < *(float *)((longlong)dVar1 + 0x1c)) {
                  *(undefined4 *)(param_1 + 0x3d9) = 1;
                  *(undefined4 *)((longlong)param_1 + 0x181c) =
                       *(undefined4 *)((longlong)dVar1 + 0x18);
                  param_1[0x3da] = (longlong)((double)*(float *)((longlong)dVar1 + 0x1c) + param_2);
                  *(undefined4 *)((longlong)param_1 + 0x1ec4) =
                       *(undefined4 *)((longlong)dVar1 + 0xc);
                  FUN_14023a8b0(param_1 + 0xaf,(longlong)dVar1 + 0x48);
                  break;
                }
              }
              else {
                uVar8 = 1;
                uVar9 = uVar13;
                uVar12 = uVar13;
                if (0 < (int)((*(longlong *)((longlong)dVar1 + 0x30) - lVar10) / 0x28)) {
                  do {
                    lVar5 = FUN_14022efc0(param_3);
                    if (lVar5 != 0) {
                      _Str2 = (wchar_t *)(lVar10 + uVar9);
                      if (7 < *(ulonglong *)(_Str2 + 0xc)) {
                        _Str2 = *(wchar_t **)_Str2;
                      }
                      _Str1 = (wchar_t *)FUN_14022efc0(param_3);
                      iVar4 = _wcsicmp(_Str1,_Str2);
                      if (iVar4 == 0) {
                        uVar8 = uVar13;
                      }
                    }
                    lVar10 = *(longlong *)((longlong)dVar1 + 0x28);
                    uVar11 = (int)uVar12 + 1;
                    uVar9 = uVar9 + 0x28;
                    uVar12 = (ulonglong)uVar11;
                  } while ((int)uVar11 <
                           (int)((*(longlong *)((longlong)dVar1 + 0x30) - lVar10) / 0x28));
                  if ((char)uVar8 == '\0') goto LAB_140231cb4;
                }
              }
            }
          }
        }
LAB_140231cc6:
        pdVar7 = pdVar7 + 2;
      } while (pdVar7 != (double *)param_1[0x402]);
    }
    iVar4 = rand();
    param_1[0x166] = (longlong)((param_2 - (double)((float)iVar4 * 3.0517578e-05 * 3.0)) + 1.5);
  }
  return;
}



void FUN_140231ee0(undefined8 param_1)

{
  FUN_14021eb20(param_1,0,0);
  return;
}



undefined1 FUN_140231ef0(longlong *param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  undefined1 local_res8 [8];
  
  iVar3 = (**(code **)(*param_1 + 0x128))();
  if (iVar3 == 0) {
    return 0;
  }
  lVar4 = FUN_14027cfe0(*(undefined8 *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x280),iVar3);
  if (lVar4 != 0) {
    uVar2 = 0;
    switch(*(undefined4 *)((longlong)param_1 + 300)) {
    case 10:
    case 0xb:
    case 0xd:
    case 0xe:
    case 0xf:
    case 0x10:
    case 0x12:
    case 0x14:
    case 0x15:
    case 0x16:
    case 0x3b:
      break;
    default:
      if ((int)param_1[0x19c] == 0) {
        FUN_140231690(param_1,param_2,lVar4);
      }
      else {
        iVar3 = (int)param_1[0x19c] + -1;
        lVar1 = param_1[0x17f];
        if (((iVar3 < 0) ||
            ((int)(*(longlong *)(lVar1 + 0x38) - *(longlong *)(lVar1 + 0x30) >> 4) <= iVar3)) ||
           (lVar1 = *(longlong *)(*(longlong *)(lVar1 + 0x30) + (longlong)iVar3 * 0x10), lVar1 == 0)
           ) {
          (**(code **)(*param_1 + 0xd0))(param_1,0,0);
          FUN_1402fc3f0(param_1,param_2);
          plVar6 = param_1 + 0x1a;
          if (7 < (ulonglong)param_1[0x1d]) {
            plVar6 = (longlong *)*plVar6;
          }
          FUN_140418da0(DAT_140607fd8,L"NOT COMBO : \"%s %d\" ",plVar6,(int)param_1[0x19c]);
          return 0;
        }
        FUN_14023a8b0(param_1 + 0xaf,lVar1 + 0x48);
        *(undefined4 *)((longlong)param_1 + 0x1ec4) = *(undefined4 *)(lVar1 + 0xc);
        FUN_140237480(param_1,*(undefined4 *)(lVar1 + 0xc),lVar4,1);
        lVar1 = param_1[0x19c];
        *(undefined4 *)(param_1 + 0x19c) = 0;
        *(int *)(param_1 + 0x3db) = (int)lVar1 + -1;
        if (param_1[0xaf] == param_1[0xb0]) {
          uVar2 = (**(code **)(*param_1 + 0x8f8))(param_1,L"attack01",0,0x3f800000,1,0,0);
        }
        else {
          plVar6 = (longlong *)param_1[0xaf];
          plVar5 = plVar6;
          if (7 < (ulonglong)plVar6[3]) {
            plVar5 = (longlong *)*plVar6;
          }
          uVar2 = (**(code **)(*param_1 + 0x8f8))(param_1,plVar5,(int)plVar6[5],0x3f800000,1,0,0);
          FUN_14023aaa0(param_1 + 0xaf,local_res8,param_1[0xaf]);
        }
        FUN_1402fc3f0(param_1,param_2);
      }
    }
    iVar3 = *(int *)((longlong)param_1 + 300);
    if (9 < iVar3) {
      if (iVar3 < 0xc) {
        if ((param_1[0x2c3] == 0) && (param_1[0xaf] != param_1[0xb0])) {
          FUN_140237480(param_1,*(undefined4 *)((longlong)param_1 + 0x1ec4),lVar4,0);
          plVar6 = (longlong *)param_1[0xaf];
          plVar5 = plVar6;
          if (7 < (ulonglong)plVar6[3]) {
            plVar5 = (longlong *)*plVar6;
          }
          uVar2 = (**(code **)(*param_1 + 0x8f8))(param_1,plVar5,(int)plVar6[5],0x3f800000,1,0,0);
          FUN_14023aaa0(param_1 + 0xaf,local_res8,param_1[0xaf]);
          FUN_1402fc3f0(param_1,param_2);
        }
      }
      else if (iVar3 == 0xd) {
        FUN_1402fc3f0(param_1,param_2);
        uVar2 = 1;
      }
    }
    return uVar2;
  }
  return 0;
}



undefined1 FUN_140232260(longlong *param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined1 uVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  longlong *plVar6;
  undefined1 local_res8 [8];
  
  lVar3 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar3 == 0) {
    return 0;
  }
  uVar2 = 0;
  switch(*(undefined4 *)((longlong)param_1 + 300)) {
  case 10:
  case 0xb:
  case 0xd:
  case 0xe:
  case 0xf:
  case 0x10:
  case 0x12:
  case 0x14:
  case 0x15:
  case 0x16:
  case 0x3b:
    break;
  default:
    if ((int)param_1[0x19c] == 0) {
      FUN_140231a20(param_1,param_2,lVar3);
    }
    else {
      iVar4 = (int)param_1[0x19c] + -1;
      lVar1 = param_1[0x17f];
      if (((iVar4 < 0) ||
          ((int)(*(longlong *)(lVar1 + 0x38) - *(longlong *)(lVar1 + 0x30) >> 4) <= iVar4)) ||
         (lVar1 = *(longlong *)(*(longlong *)(lVar1 + 0x30) + (longlong)iVar4 * 0x10), lVar1 == 0))
      {
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
        FUN_1402fc3f0(param_1,param_2);
        plVar6 = param_1 + 0x1a;
        if (7 < (ulonglong)param_1[0x1d]) {
          plVar6 = (longlong *)*plVar6;
        }
        FUN_140418da0(DAT_140607fd8,L"NOT COMBO : \"%s %d\" ",plVar6,(int)param_1[0x19c]);
        return 0;
      }
      FUN_14023a8b0(param_1 + 0xaf,lVar1 + 0x48);
      *(undefined4 *)((longlong)param_1 + 0x1ec4) = *(undefined4 *)(lVar1 + 0xc);
      FUN_140237940(param_1,*(undefined4 *)(lVar1 + 0xc),lVar3,1);
      lVar1 = param_1[0x19c];
      *(undefined4 *)(param_1 + 0x19c) = 0;
      *(int *)(param_1 + 0x3db) = (int)lVar1 + -1;
      if (param_1[0xaf] == param_1[0xb0]) {
        uVar2 = (**(code **)(*param_1 + 0x8f8))(param_1,L"attack01",0,0x3f800000,1,0,0);
      }
      else {
        plVar6 = (longlong *)param_1[0xaf];
        plVar5 = plVar6;
        if (7 < (ulonglong)plVar6[3]) {
          plVar5 = (longlong *)*plVar6;
        }
        uVar2 = (**(code **)(*param_1 + 0x8f8))(param_1,plVar5,(int)plVar6[5],0x3f800000,1,0,0);
        FUN_14023aaa0(param_1 + 0xaf,local_res8,param_1[0xaf]);
      }
      FUN_1402fc3f0(param_1,param_2);
    }
  }
  iVar4 = *(int *)((longlong)param_1 + 300);
  if (9 < iVar4) {
    if (iVar4 < 0xc) {
      if ((param_1[0x2c3] == 0) && (param_1[0xaf] != param_1[0xb0])) {
        FUN_140237940(param_1,*(undefined4 *)((longlong)param_1 + 0x1ec4),lVar3,0);
        plVar6 = (longlong *)param_1[0xaf];
        plVar5 = plVar6;
        if (7 < (ulonglong)plVar6[3]) {
          plVar5 = (longlong *)*plVar6;
        }
        uVar2 = (**(code **)(*param_1 + 0x8f8))(param_1,plVar5,(int)plVar6[5],0x3f800000,1,0,0);
        FUN_14023aaa0(param_1 + 0xaf,local_res8,param_1[0xaf]);
        FUN_1402fc3f0(param_1,param_2);
      }
    }
    else if (iVar4 == 0xd) {
      FUN_1402fc3f0(param_1,param_2);
      uVar2 = 1;
    }
  }
  return uVar2;
}



undefined8 FUN_1402325b0(longlong *param_1,double param_2)

{
  int iVar1;
  
  iVar1 = rand();
  param_1[0x166] = (longlong)((double)((float)iVar1 * 3.0517578e-05 * 5.0) + (param_2 - 2.5));
  if ((*(int *)((longlong)param_1 + 300) != 10) && (*(int *)((longlong)param_1 + 300) != 0xd)) {
    *(undefined1 *)(param_1 + 0x27f) = 1;
    (**(code **)(*param_1 + 0x8f8))(param_1,L"mustkill01",0,0x3f800000,1,0,0);
  }
  if (*(int *)((longlong)param_1 + 300) == 10) {
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    }
  }
  else if (*(int *)((longlong)param_1 + 300) == 0xd) {
    iVar1 = rand();
    param_1[0x166] = (longlong)((double)((float)iVar1 * 3.0517578e-05 * 5.0) + (param_2 - 2.5));
    return 1;
  }
  return 1;
}



bool FUN_1402326c0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar1 == 0) {
    return true;
  }
  return (char)param_1[10] == '\0';
}



bool FUN_140232700(longlong param_1)

{
  return *(char *)(param_1 + 0x50) == '\0';
}



ulonglong FUN_140232710(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  
  lVar1 = *(longlong *)(*(ulonglong *)(param_1 + 0x1e80) + 0x30);
  if (lVar1 != 0) {
    uVar2 = FUN_14027cb90(*(undefined8 *)(lVar1 + 0x280));
    return uVar2;
  }
  return *(ulonglong *)(param_1 + 0x1e80) & 0xffffffffffffff00;
}



undefined8 FUN_140232730(longlong param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30);
  if (lVar1 != 0) {
    uVar2 = FUN_14027ccd0(*(undefined8 *)(lVar1 + 0x280));
    return uVar2;
  }
  return 0;
}



void FUN_140232750(longlong *param_1,undefined4 param_2,float param_3,float param_4,float param_5)

{
  int iVar1;
  int iVar2;
  float *pfVar3;
  float fVar4;
  float local_res10 [6];
  
  *(undefined4 *)(param_1 + 0x34f) = param_2;
  fVar4 = (float)(**(code **)(*param_1 + 0x2d8))();
  iVar1 = (int)param_5 + 1;
  iVar2 = FUN_1402f8580(param_1);
  param_5 = 0.0;
  pfVar3 = &param_5;
  local_res10[0] = (param_3 * param_4 * (float)iVar1 * 24.0) / ((float)(iVar2 * 2) + fVar4 + 40.0);
  if (0.0 <= local_res10[0]) {
    pfVar3 = local_res10;
  }
  *(float *)((longlong)param_1 + 0x1a7c) = *pfVar3;
  return;
}



void FUN_140232810(longlong *param_1,undefined4 param_2,float param_3,float param_4,float param_5)

{
  int iVar1;
  int iVar2;
  float *pfVar3;
  float fVar4;
  float local_res10 [6];
  
  *(undefined4 *)(param_1 + 0x350) = param_2;
  fVar4 = (float)(**(code **)(*param_1 + 0x2d8))();
  iVar1 = (int)param_5 + 1;
  iVar2 = FUN_1402f8580(param_1);
  param_5 = 0.0;
  pfVar3 = &param_5;
  local_res10[0] = (param_3 * param_4 * (float)iVar1 * 24.0) / ((float)(iVar2 * 2) + fVar4 + 40.0);
  if (0.0 <= local_res10[0]) {
    pfVar3 = local_res10;
  }
  *(float *)((longlong)param_1 + 0x1a84) = *pfVar3;
  return;
}



void FUN_1402328d0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  short sVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  short *psVar6;
  ulonglong uVar7;
  short *psVar8;
  longlong lVar9;
  short *psVar10;
  short *local_60;
  short *local_58;
  undefined2 local_40;
  undefined6 uStack_3e;
  undefined8 local_30;
  ulonglong local_28;
  
  if (*(longlong *)(param_1 + 0xc08) == 0) {
    lVar2 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    if (lVar2 != 0) {
      iVar3 = FUN_1402ce620(lVar2,&DAT_14049dca8,param_3,param_4,0xfffffffffffffffe);
      lVar5 = 0;
      lVar9 = lVar5;
      if (((iVar3 != -1) && (-1 < iVar3)) &&
         (iVar3 < (int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4))) {
        lVar9 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10);
      }
      if (lVar9 != 0) {
        local_28 = 7;
        local_30 = 0;
        local_40 = 0;
        FUN_140001710(&local_40,&DAT_14049dca8,6);
        FUN_14008ec00(param_1 + 0x1af8,&local_40);
        if (7 < local_28) {
          operator_delete((void *)CONCAT62(uStack_3e,local_40));
        }
        lVar2 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
        lVar4 = lVar5;
        if (lVar2 != 0) {
          iVar3 = FUN_1402ce620(lVar2,L"stay02");
          if (((iVar3 != -1) && (-1 < iVar3)) &&
             (iVar3 < (int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4))) {
            lVar4 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10);
          }
        }
        if (lVar9 == lVar4) {
          local_28 = 7;
          local_30 = 0;
          local_40 = 0;
          FUN_140001710(&local_40,L"stay02",6);
          FUN_14008ec00(param_1 + 0x1af8,&local_40);
          if (7 < local_28) {
            operator_delete((void *)CONCAT62(uStack_3e,local_40));
          }
        }
        lVar2 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
        if (lVar2 != 0) {
          iVar3 = FUN_1402ce620(lVar2,L"stay03");
          if (((iVar3 != -1) && (-1 < iVar3)) &&
             (iVar3 < (int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4))) {
            lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10);
          }
        }
        if (lVar9 == lVar5) {
          local_28 = 7;
          local_30 = 0;
          local_40 = 0;
          FUN_140001710(&local_40,L"stay03",6);
          FUN_14008ec00(param_1 + 0x1af8,&local_40);
          if (7 < local_28) {
            operator_delete((void *)CONCAT62(uStack_3e,local_40));
          }
        }
      }
    }
    FUN_140001710(param_1 + 0x1b18,L"move02",6);
    FUN_140001710(param_1 + 0x1b40,L"jump01_1",8);
    FUN_140001710(param_1 + 0x1b68,L"jump01_4",8);
    FUN_140001710(param_1 + 0x1b90,&DAT_1404ac548,8);
    FUN_140001710(param_1 + 0x1bb8,&DAT_1404ac560,8);
  }
  else {
    FUN_140123dc0(param_1 + 0x1af8);
    FUN_14032c930(*(undefined8 *)(param_1 + 0xc08),&local_60,param_2);
    psVar8 = local_60;
    if (local_60 != local_58) {
      do {
        psVar6 = psVar8;
        if (7 < *(ulonglong *)(psVar8 + 0xc)) {
          psVar6 = *(short **)psVar8;
        }
        lVar2 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
        if ((lVar2 != 0) && (iVar3 = FUN_1402ce620(lVar2,psVar6), iVar3 != -1)) {
          lVar5 = 0;
          if ((-1 < iVar3) &&
             (iVar3 < (int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4))) {
            lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10);
          }
          if (lVar5 != 0) {
            psVar6 = psVar8;
            if (7 < *(ulonglong *)(psVar8 + 0xc)) {
              psVar6 = *(short **)psVar8;
            }
            local_28 = 7;
            local_30 = 0;
            local_40 = 0;
            uVar7 = 0xffffffffffffffff;
            psVar10 = psVar6;
            do {
              if (uVar7 == 0) break;
              uVar7 = uVar7 - 1;
              sVar1 = *psVar10;
              psVar10 = psVar10 + 1;
            } while (sVar1 != 0);
            FUN_140001710(&local_40,psVar6,~uVar7 - 1);
            FUN_140165f30(param_1 + 0x1af8,&local_40);
            if (7 < local_28) {
              operator_delete((void *)CONCAT62(uStack_3e,local_40));
            }
          }
        }
        psVar8 = psVar8 + 0x14;
      } while (psVar8 != local_58);
    }
    psVar6 = (short *)FUN_14032ca30(*(undefined8 *)(param_1 + 0xc08),param_2);
    uVar7 = 0xffffffffffffffff;
    psVar8 = psVar6;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x1b18,psVar6,~uVar7 - 1);
    psVar6 = (short *)FUN_14032cae0(*(undefined8 *)(param_1 + 0xc08),param_2);
    uVar7 = 0xffffffffffffffff;
    psVar8 = psVar6;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x1b40,psVar6,~uVar7 - 1);
    psVar6 = (short *)FUN_14032cb90(*(undefined8 *)(param_1 + 0xc08),param_2);
    uVar7 = 0xffffffffffffffff;
    psVar8 = psVar6;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x1b68,psVar6,~uVar7 - 1);
    psVar6 = (short *)FUN_14032cc40(*(undefined8 *)(param_1 + 0xc08),param_2);
    uVar7 = 0xffffffffffffffff;
    psVar8 = psVar6;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x1b90,psVar6,~uVar7 - 1);
    psVar6 = (short *)FUN_14032ccf0(*(undefined8 *)(param_1 + 0xc08),param_2);
    uVar7 = 0xffffffffffffffff;
    psVar8 = psVar6;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x1bb8,psVar6,~uVar7 - 1);
    psVar6 = (short *)FUN_14032cda0(*(undefined8 *)(param_1 + 0xc08),param_2);
    uVar7 = 0xffffffffffffffff;
    psVar8 = psVar6;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x1be0,psVar6,~uVar7 - 1);
    *(undefined4 *)(param_1 + 0xee8) = param_2;
    psVar8 = local_60;
    if (local_60 != (short *)0x0) {
      for (; psVar8 != local_58; psVar8 = psVar8 + 0x14) {
        if (7 < *(ulonglong *)(psVar8 + 0xc)) {
          operator_delete(*(void **)psVar8);
        }
        psVar8[0xc] = 7;
        psVar8[0xd] = 0;
        psVar8[0xe] = 0;
        psVar8[0xf] = 0;
        psVar8[8] = 0;
        psVar8[9] = 0;
        psVar8[10] = 0;
        psVar8[0xb] = 0;
        *psVar8 = 0;
      }
      operator_delete(local_60);
    }
  }
  return;
}



ulonglong FUN_140232e40(longlong *param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4)

{
  uint uVar1;
  int iVar2;
  longlong lVar3;
  ulonglong uVar4;
  
  lVar3 = FUN_1402d6230();
  uVar4 = 0;
  if (lVar3 == 0) {
LAB_140232e6a:
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  else {
    iVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (iVar2 == 4) {
      uVar1 = *(uint *)(param_1 + 0x1fa);
      uVar4 = (ulonglong)uVar1;
      if ((uVar1 == 3) || (uVar1 == 2)) goto LAB_140232e6a;
    }
    uVar4 = FUN_1402d72f0(param_1,param_2,param_3,param_4);
  }
  return uVar4;
}



void FUN_140232ec0(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  float *pfVar2;
  longlong lVar3;
  longlong lVar4;
  
  if (param_2 != 0) {
    piVar1 = *(int **)(param_2 + 0x3f0);
    lVar3 = 0;
    lVar4 = lVar3;
    do {
      if (*piVar1 != 0) break;
      lVar4 = lVar4 + 1;
      piVar1 = piVar1 + 1;
    } while (lVar4 < 0x47);
    pfVar2 = *(float **)(param_2 + 0x400);
    do {
      if (*pfVar2 != 0.0) {
        return;
      }
      lVar3 = lVar3 + 1;
      pfVar2 = pfVar2 + 1;
    } while (lVar3 < 0x45);
  }
  return;
}



void FUN_140232f10(longlong *param_1,longlong param_2,int param_3,undefined1 param_4)

{
  short sVar1;
  byte bVar2;
  byte bVar3;
  undefined8 *puVar4;
  void *pvVar5;
  longlong lVar6;
  longlong *plVar7;
  char cVar8;
  int iVar9;
  undefined4 uVar10;
  undefined4 uVar11;
  undefined8 uVar12;
  longlong lVar13;
  short *psVar14;
  ulonglong uVar15;
  undefined8 uVar16;
  short *psVar17;
  bool bVar18;
  longlong *local_40;
  longlong *local_38;
  
  if (param_2 == 0) {
    return;
  }
  if ((int)param_1[0x25] != param_3) {
    return;
  }
  bVar2 = *(byte *)((longlong)param_1 + 0x601);
  bVar3 = *(byte *)(param_1 + 0xc0);
  uVar11 = *(undefined4 *)((longlong)param_1 + 300);
  lVar13 = param_1[0xb5];
  puVar4 = (undefined8 *)param_1[0x391];
  if (puVar4 == (undefined8 *)0x0) {
LAB_140232faf:
    uVar16 = 0;
  }
  else {
    if (puVar4 != (undefined8 *)param_1[0x392]) {
      iVar9 = DAT_140608150 + 1;
      bVar18 = DAT_140608150 == 0;
      DAT_140608150 = iVar9;
      if (bVar18) {
        FUN_140176d60(1);
      }
      goto LAB_140232faf;
    }
    uVar16 = *puVar4;
  }
  lVar6 = param_1[0x1dd];
  uVar10 = FUN_14023c2c0(param_2,(int)lVar6,(int)lVar13);
  uVar12 = FUN_14023c1c0(param_2,(int)lVar6,(int)lVar13);
  FUN_140278700(uVar16,&local_40,uVar12,uVar10,uVar11,bVar2 | bVar3,(char)param_1[0x413]);
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if ((*local_40 != 0) && (*(int *)(*local_40 + 0xdc) == 5)) {
        cVar8 = FUN_14023acc0(param_1 + 0x2f8);
        if (cVar8 != '\0') {
          lVar13 = FUN_14023ad10(param_1 + 0x2f8);
          FUN_1400015e0(param_1 + 0x28f,*(undefined8 *)(lVar13 + 0x68),0,0xffffffffffffffff);
          lVar13 = FUN_14023ad10(param_1 + 0x2f8);
          *(undefined4 *)(param_1 + 0x381) = *(undefined4 *)(*(longlong *)(lVar13 + 0x68) + 0x28);
        }
        goto LAB_1402330eb;
      }
    }
    else {
      iVar9 = DAT_140608154 + 1;
      bVar18 = DAT_140608154 == 0;
      DAT_140608154 = iVar9;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  psVar14 = (short *)FUN_14023c1c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5]);
  uVar15 = 0xffffffffffffffff;
  psVar17 = psVar14;
  do {
    if (uVar15 == 0) break;
    uVar15 = uVar15 - 1;
    sVar1 = *psVar17;
    psVar17 = psVar17 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x28f,psVar14,~uVar15 - 1);
  uVar11 = FUN_14023c2c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5]);
  *(undefined4 *)(param_1 + 0x381) = uVar11;
LAB_1402330eb:
  (**(code **)(*param_1 + 200))(param_1,0x3f,param_4);
  if (*(int *)(param_2 + 0x3d4) != 0) {
    (**(code **)(*param_1 + 0xf8))(param_1);
  }
  plVar7 = local_40;
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if (local_40 != (longlong *)0x0) {
        LOCK();
        local_40 = local_40 + 1;
        *(int *)local_40 = (int)*local_40 + -1;
        UNLOCK();
        if ((int)*local_40 == 0) {
          local_40 = (longlong *)0x0;
          pvVar5 = (void *)*plVar7;
          if (pvVar5 != (void *)0x0) {
            FUN_140197310(pvVar5);
            operator_delete(pvVar5);
          }
          operator_delete(plVar7);
        }
      }
    }
    else {
      iVar9 = DAT_1406080b4 + 1;
      bVar18 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar9;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



undefined1 FUN_1402331a0(longlong *param_1,longlong param_2,undefined1 param_3)

{
  longlong *plVar1;
  short sVar2;
  byte bVar3;
  byte bVar4;
  undefined8 *puVar5;
  void *pvVar6;
  longlong lVar7;
  char cVar8;
  undefined1 uVar9;
  int iVar10;
  undefined4 uVar11;
  undefined4 uVar12;
  undefined8 uVar13;
  short *psVar14;
  longlong lVar15;
  undefined8 uVar16;
  longlong lVar17;
  ulonglong uVar18;
  longlong *plVar19;
  short *psVar20;
  bool bVar21;
  float fVar22;
  longlong *local_80;
  longlong *local_78;
  undefined8 local_70;
  char local_68;
  longlong local_60;
  undefined4 local_58;
  undefined4 uStack_54;
  
  if ((param_2 == 0) ||
     (fVar22 = (float)FUN_1402349c0(param_1,*(undefined4 *)(param_2 + 0x18)), fVar22 < 1.0)) {
LAB_14023341c:
    uVar9 = 0;
  }
  else {
    local_70 = 0;
    local_68 = '\0';
    cVar8 = FUN_140195920(param_1 + 0x25d);
    if (cVar8 != '\0') {
      local_70 = FUN_140195970(param_1 + 0x25d);
      local_68 = 0;
      FUN_14034ed40(local_70);
      local_68 = '\x01';
    }
    bVar3 = *(byte *)((longlong)param_1 + 0x601);
    bVar4 = *(byte *)(param_1 + 0xc0);
    uVar12 = *(undefined4 *)((longlong)param_1 + 300);
    lVar17 = param_1[0xb5];
    puVar5 = (undefined8 *)param_1[0x391];
    if (puVar5 == (undefined8 *)0x0) {
LAB_140233295:
      uVar16 = 0;
    }
    else {
      if (puVar5 != (undefined8 *)param_1[0x392]) {
        iVar10 = DAT_140608150 + 1;
        bVar21 = DAT_140608150 == 0;
        DAT_140608150 = iVar10;
        if (bVar21) {
          FUN_140176d60(1);
        }
        goto LAB_140233295;
      }
      uVar16 = *puVar5;
    }
    lVar15 = param_1[0x1dd];
    uVar11 = FUN_14023c2c0(param_2,(int)lVar15,(int)lVar17);
    uVar13 = FUN_14023c1c0(param_2,(int)lVar15,(int)lVar17);
    FUN_140278700(uVar16,&local_80,uVar13,uVar11,uVar12,bVar3 | bVar4,(char)param_1[0x413]);
    psVar14 = (short *)FUN_14023c1c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5]);
    uVar18 = 0xffffffffffffffff;
    psVar20 = psVar14;
    do {
      if (uVar18 == 0) break;
      uVar18 = uVar18 - 1;
      sVar2 = *psVar20;
      psVar20 = psVar20 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x299,psVar14,~uVar18 - 1);
    uVar12 = FUN_14023c2c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5]);
    plVar19 = local_80;
    *(undefined4 *)(param_1 + 0x381) = uVar12;
    if ((((*(int *)(param_2 + 0x1c) == -1) || (*(int *)(param_2 + 0x1c) == (int)param_1[0x1f8])) ||
        (param_1[0x16e] == 0)) || (*(int *)(param_1[0x16e] + 0xc) == 0)) {
      param_1[0x16a] = param_2;
    }
    iVar10 = *(int *)(param_2 + 0x74);
    if (iVar10 == 1) {
LAB_14023377d:
      local_60 = param_1[0xa2];
      local_58 = *(undefined4 *)(param_2 + 0x90);
      lVar17 = FUN_14023b4a0(param_1 + 0x382,param_2 + 0x18);
      *(longlong *)(lVar17 + 8) = local_60;
      *(ulonglong *)(lVar17 + 0x10) = CONCAT44(uStack_54,local_58);
      FUN_140232f10(param_1,param_2,(int)param_1[0x25],param_3);
    }
    else {
      if (iVar10 == 2) {
        if (((*(int *)((longlong)param_1 + 300) == 10) || (*(int *)((longlong)param_1 + 300) == 0xd)
            ) && (param_1[0x2c3] != 0)) {
          if (local_80 != (longlong *)0x0) {
            if (local_80 == local_78) {
              if (local_80 != (longlong *)0x0) {
                LOCK();
                plVar1 = local_80 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  local_80 = (longlong *)0x0;
                  pvVar6 = (void *)*plVar19;
                  if (pvVar6 != (void *)0x0) {
                    FUN_140197310(pvVar6);
                    operator_delete(pvVar6);
                  }
                  operator_delete(plVar19);
                }
              }
            }
            else {
              iVar10 = DAT_1406080b4 + 1;
              bVar21 = DAT_1406080b4 == 0;
              DAT_1406080b4 = iVar10;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else {
          iVar10 = (**(code **)(*param_1 + 0xb0))(param_1);
          plVar19 = local_80;
          if (iVar10 == 4) {
            if (local_80 != (longlong *)0x0) {
              if (local_80 == local_78) {
                if ((*local_80 != 0) && (*(int *)(*local_80 + 0xdc) == 5)) {
                  lVar17 = FUN_14023ad10(param_1 + 0x2f8);
                  lVar17 = *(longlong *)(lVar17 + 0x68);
                  lVar15 = FUN_14023ad10(param_1 + 0x2f8);
                  plVar19 = *(longlong **)(lVar15 + 0x68);
                  if (7 < (ulonglong)plVar19[3]) {
                    plVar19 = (longlong *)*plVar19;
                  }
                  uVar9 = (**(code **)(*param_1 + 0x8f8))
                                    (param_1,plVar19,*(undefined4 *)(lVar17 + 0x28),0x3f800000,1,
                                     param_2,param_3);
                  plVar19 = local_80;
                  if (local_80 != (longlong *)0x0) {
                    if (local_80 == local_78) {
                      if (local_80 != (longlong *)0x0) {
                        LOCK();
                        plVar1 = local_80 + 1;
                        *(int *)plVar1 = (int)*plVar1 + -1;
                        UNLOCK();
                        if ((int)*plVar1 == 0) {
                          local_80 = (longlong *)0x0;
                          pvVar6 = (void *)*plVar19;
                          if (pvVar6 != (void *)0x0) {
                            FUN_140197310(pvVar6);
                            operator_delete(pvVar6);
                          }
                          operator_delete(plVar19);
                        }
                      }
                    }
                    else {
                      iVar10 = DAT_1406080b4 + 1;
                      bVar21 = DAT_1406080b4 == 0;
                      DAT_1406080b4 = iVar10;
                      if (bVar21) {
                        FUN_140176d60(1);
                      }
                    }
                  }
                  goto LAB_1402335a7;
                }
              }
              else {
                iVar10 = DAT_140608154 + 1;
                bVar21 = DAT_140608154 == 0;
                DAT_140608154 = iVar10;
                if (bVar21) {
                  FUN_140176d60(1);
                }
              }
              if (local_80 != (longlong *)0x0) {
                if (local_80 == local_78) {
                  if ((*local_80 != 0) && (*(int *)(*local_80 + 0xdc) == 3)) {
                    lVar17 = FUN_14023ad10(param_1 + 0x2f8);
                    lVar17 = *(longlong *)(lVar17 + 0x68);
                    lVar15 = FUN_14023ad10(param_1 + 0x2f8);
                    plVar19 = *(longlong **)(lVar15 + 0x68);
                    if (7 < (ulonglong)plVar19[3]) {
                      plVar19 = (longlong *)*plVar19;
                    }
                    uVar9 = (**(code **)(*param_1 + 0x8f8))
                                      (param_1,plVar19,*(undefined4 *)(lVar17 + 0x28),0x3f800000,1,
                                       param_2,param_3);
                    plVar19 = local_80;
                    if (local_80 != (longlong *)0x0) {
                      if (local_80 == local_78) {
                        if (local_80 != (longlong *)0x0) {
                          LOCK();
                          plVar1 = local_80 + 1;
                          *(int *)plVar1 = (int)*plVar1 + -1;
                          UNLOCK();
                          if ((int)*plVar1 == 0) {
                            local_80 = (longlong *)0x0;
                            pvVar6 = (void *)*plVar19;
                            if (pvVar6 != (void *)0x0) {
                              FUN_140197310(pvVar6);
                              operator_delete(pvVar6);
                            }
                            operator_delete(plVar19);
                          }
                        }
                      }
                      else {
                        iVar10 = DAT_1406080b4 + 1;
                        bVar21 = DAT_1406080b4 == 0;
                        DAT_1406080b4 = iVar10;
                        if (bVar21) {
                          FUN_140176d60(1);
                        }
                      }
                    }
                    goto LAB_1402335a7;
                  }
                }
                else {
                  iVar10 = DAT_140608154 + 1;
                  bVar21 = DAT_140608154 == 0;
                  DAT_140608154 = iVar10;
                  if (bVar21) {
                    FUN_140176d60(1);
                  }
                }
              }
            }
            lVar15 = param_1[0xb5];
            lVar7 = param_1[0x1dd];
            lVar17 = *param_1;
            uVar12 = FUN_14023c2c0(param_2,(int)lVar7,(int)lVar15);
            uVar16 = FUN_14023c1c0(param_2,(int)lVar7,(int)lVar15);
            uVar9 = (**(code **)(lVar17 + 0x8f8))
                              (param_1,uVar16,uVar12,0x3f800000,1,param_2,param_3);
            plVar19 = local_80;
            if (local_80 != (longlong *)0x0) {
              if (local_80 == local_78) {
                if (local_80 != (longlong *)0x0) {
                  LOCK();
                  plVar1 = local_80 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  if ((int)*plVar1 == 0) {
                    local_80 = (longlong *)0x0;
                    pvVar6 = (void *)*plVar19;
                    if (pvVar6 != (void *)0x0) {
                      FUN_140197310(pvVar6);
                      operator_delete(pvVar6);
                    }
                    operator_delete(plVar19);
                  }
                }
              }
              else {
                iVar10 = DAT_1406080b4 + 1;
                bVar21 = DAT_1406080b4 == 0;
                DAT_1406080b4 = iVar10;
                if (bVar21) {
                  FUN_140176d60(1);
                }
              }
            }
LAB_1402335a7:
            if (local_68 == '\0') {
              return uVar9;
            }
            FUN_14034edd0(local_70);
            return uVar9;
          }
          if (local_80 != (longlong *)0x0) {
            if (local_80 == local_78) {
              if (local_80 != (longlong *)0x0) {
                LOCK();
                plVar1 = local_80 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  local_80 = (longlong *)0x0;
                  pvVar6 = (void *)*plVar19;
                  if (pvVar6 != (void *)0x0) {
                    FUN_140197310(pvVar6);
                    operator_delete(pvVar6);
                  }
                  operator_delete(plVar19);
                }
              }
            }
            else {
              iVar10 = DAT_1406080b4 + 1;
              bVar21 = DAT_1406080b4 == 0;
              DAT_1406080b4 = iVar10;
              if (bVar21) {
                FUN_140176d60(1);
              }
            }
          }
        }
        if (local_68 != '\0') {
          FUN_14034edd0(local_70);
        }
        goto LAB_14023341c;
      }
      if ((2 < iVar10) && (iVar10 < 5)) goto LAB_14023377d;
    }
    plVar19 = local_80;
    if (local_80 != (longlong *)0x0) {
      if (local_80 == local_78) {
        if (local_80 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_80 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_80 = (longlong *)0x0;
            pvVar6 = (void *)*plVar19;
            if (pvVar6 != (void *)0x0) {
              FUN_140197310(pvVar6);
              operator_delete(pvVar6);
            }
            operator_delete(plVar19);
          }
        }
      }
      else {
        iVar10 = DAT_1406080b4 + 1;
        bVar21 = DAT_1406080b4 == 0;
        DAT_1406080b4 = iVar10;
        if (bVar21) {
          FUN_140176d60(1);
        }
      }
    }
    if (local_68 != '\0') {
      FUN_14034edd0(local_70);
    }
    uVar9 = 1;
  }
  return uVar9;
}



undefined1 thunk_FUN_140233880(longlong *param_1,longlong param_2)

{
  int *piVar1;
  byte bVar2;
  byte bVar3;
  undefined4 uVar4;
  void *pvVar5;
  longlong lVar6;
  undefined1 uVar7;
  int iVar8;
  undefined4 uVar9;
  undefined8 uVar10;
  longlong *plVar11;
  undefined8 *puVar12;
  longlong lVar13;
  undefined8 *puVar14;
  undefined8 uVar15;
  undefined8 *puVar16;
  bool bVar17;
  longlong *plStack_80;
  longlong *plStack_78;
  longlong *plStack_70;
  longlong *plStack_68;
  undefined8 *puStack_60;
  undefined8 *puStack_58;
  undefined8 *puStack_50;
  undefined8 *puStack_48;
  
  uVar7 = 1;
  param_1[0x16b] = param_2;
  uVar15 = 0;
  plStack_80 = (longlong *)0x0;
  if (param_2 == 0) {
    bVar2 = *(byte *)((longlong)param_1 + 0x601);
    bVar3 = *(byte *)(param_1 + 0xc0);
    uVar4 = *(undefined4 *)((longlong)param_1 + 300);
    plVar11 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar11 = (longlong *)*plVar11;
    }
    puVar14 = (undefined8 *)param_1[0x391];
    if (puVar14 != (undefined8 *)0x0) {
      if (puVar14 == (undefined8 *)param_1[0x392]) {
        uVar15 = *puVar14;
      }
      else {
        iVar8 = DAT_140608150 + 1;
        bVar17 = DAT_140608150 == 0;
        DAT_140608150 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
    plVar11 = (longlong *)
              FUN_140278700(uVar15,&puStack_50,plVar11,(int)param_1[0x381],uVar4,bVar2 | bVar3,
                            (char)param_1[0x413]);
    puVar14 = puStack_50;
    plVar11 = (longlong *)*plVar11;
    if (plVar11 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar11 + 1) = (int)plVar11[1] + 1;
      UNLOCK();
      plStack_80 = plVar11;
      plStack_78 = plVar11;
    }
    iVar8 = DAT_1406080b4;
    if (puStack_50 == (undefined8 *)0x0) goto LAB_140233ad9;
    if (puStack_50 != puStack_48) {
      DAT_1406080b4 = DAT_1406080b4 + 1;
      if (iVar8 == 0) {
        FUN_140176d60(CONCAT71((int7)((ulonglong)plVar11 >> 8),1));
      }
      goto LAB_140233ad9;
    }
    if (puStack_50 == (undefined8 *)0x0) goto LAB_140233ad9;
    LOCK();
    piVar1 = (int *)(puStack_50 + 1);
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    if (*piVar1 != 0) goto LAB_140233ad9;
    puStack_50 = (undefined8 *)0x0;
  }
  else {
    bVar2 = *(byte *)((longlong)param_1 + 0x601);
    bVar3 = *(byte *)(param_1 + 0xc0);
    uVar4 = *(undefined4 *)((longlong)param_1 + 300);
    lVar13 = param_1[0xb5];
    puVar14 = (undefined8 *)param_1[0x391];
    if (puVar14 != (undefined8 *)0x0) {
      if (puVar14 == (undefined8 *)param_1[0x392]) {
        uVar15 = *puVar14;
      }
      else {
        iVar8 = DAT_140608150 + 1;
        bVar17 = DAT_140608150 == 0;
        DAT_140608150 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
    lVar6 = param_1[0x1dd];
    uVar9 = FUN_14023c2c0(param_2,(int)lVar6,(int)lVar13);
    uVar10 = FUN_14023c1c0(param_2,(int)lVar6,(int)lVar13);
    plVar11 = (longlong *)
              FUN_140278700(uVar15,&puStack_60,uVar10,uVar9,uVar4,bVar2 | bVar3,(char)param_1[0x413]
                           );
    puVar14 = puStack_60;
    plVar11 = (longlong *)*plVar11;
    if (plVar11 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar11 + 1) = (int)plVar11[1] + 1;
      UNLOCK();
      plStack_80 = plVar11;
      plStack_78 = plVar11;
    }
    iVar8 = DAT_1406080b4;
    if (puStack_60 == (undefined8 *)0x0) goto LAB_140233ad9;
    if (puStack_60 != puStack_58) {
      DAT_1406080b4 = DAT_1406080b4 + 1;
      if (iVar8 == 0) {
        FUN_140176d60(CONCAT71((int7)((ulonglong)plVar11 >> 8),1));
      }
      goto LAB_140233ad9;
    }
    if (puStack_60 == (undefined8 *)0x0) goto LAB_140233ad9;
    LOCK();
    piVar1 = (int *)(puStack_60 + 1);
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    if (*piVar1 != 0) goto LAB_140233ad9;
    puStack_60 = (undefined8 *)0x0;
  }
  pvVar5 = (void *)*puVar14;
  if (pvVar5 != (void *)0x0) {
    FUN_140197310(pvVar5);
    operator_delete(pvVar5);
  }
  operator_delete(puVar14);
LAB_140233ad9:
  puVar14 = (undefined8 *)0x0;
  if (plStack_80 != (longlong *)0x0) {
    if (plStack_80 == plStack_78) {
      if ((*plStack_80 != 0) && (plVar11 = (longlong *)param_1[0x393], plVar11 != (longlong *)0x0))
      {
        if (plVar11 == (longlong *)param_1[0x394]) {
          if (*plVar11 != 0) {
            puVar12 = operator_new(0x88);
            puVar16 = puVar14;
            if (puVar12 != (void *)0x0) {
              puVar12[4] = 7;
              puVar12[3] = 0;
              *(undefined2 *)(puVar12 + 1) = 0;
              puVar12[0xb] = 7;
              puVar12[10] = 0;
              *(undefined2 *)(puVar12 + 8) = 0;
              puVar12[0xd] = 0;
              puVar12[0xe] = 0;
              puVar12[0xf] = 0;
              puVar16 = puVar12;
            }
            FUN_14023ae90(param_1 + 0x2f8);
            puVar12 = puVar14;
            if (puVar16 != (undefined8 *)0x0) {
              puVar12 = operator_new(0x10);
              *puVar12 = puVar16;
              *(undefined4 *)(puVar12 + 1) = 1;
            }
            param_1[0x2f8] = (longlong)puVar12;
            param_1[0x2f9] = (longlong)puVar12;
            puVar16 = (undefined8 *)(*plStack_80 + 0x88);
            if (7 < *(ulonglong *)(*plStack_80 + 0xa0)) {
              puVar16 = (undefined8 *)*puVar16;
            }
            plVar11 = (longlong *)param_1[0x393];
            if (plVar11 != (longlong *)0x0) {
              if (plVar11 == (longlong *)param_1[0x394]) {
                puVar14 = (undefined8 *)*plVar11;
              }
              else {
                iVar8 = DAT_140608158 + 1;
                bVar17 = DAT_140608158 == 0;
                DAT_140608158 = iVar8;
                if (bVar17) {
                  FUN_140176d60(1);
                }
              }
            }
            FUN_14027a560(puVar14,&plStack_70,puVar16);
            plVar11 = plStack_70;
            if (plStack_70 != (longlong *)0x0) {
              if (plStack_70 == plStack_68) {
                if (*plStack_70 != 0) {
                  param_1[0x2f3] = 0;
                  if ((longlong *)param_1[0x2f8] != plStack_70) {
                    FUN_14023ae90(param_1 + 0x2f8);
                    param_1[0x2f8] = (longlong)plVar11;
                    param_1[0x2f9] = (longlong)plVar11;
                    LOCK();
                    *(int *)(plVar11 + 1) = (int)plVar11[1] + 1;
                    UNLOCK();
                  }
                  plVar11 = plStack_70;
                  param_1[0x3d7] = param_1[0xa2];
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  *(undefined4 *)(param_1 + 0x381) =
                       *(undefined4 *)(*(longlong *)(lVar13 + 0x68) + 0x28);
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  FUN_1400015e0(param_1 + 0x299,*(longlong *)(lVar13 + 0x68) + 0x30,0,
                                0xffffffffffffffff);
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  FUN_1400015e0(param_1 + 0x2da,lVar13 + 0x40,0,0xffffffffffffffff);
                  if (*(int *)(*plStack_80 + 0xdc) == 5) {
                    lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                    *(undefined4 *)(lVar13 + 4) = 1;
                  }
                  else if (*(int *)(*plStack_80 + 0xdc) == 3) {
                    lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                    *(undefined4 *)(lVar13 + 4) = 0;
                  }
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  if (*(longlong *)(lVar13 + 0x68) != *(longlong *)(lVar13 + 0x70)) {
                    lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                    param_1[0x2f3] =
                         (longlong)
                         ((double)*(float *)(*(longlong *)(lVar13 + 0x68) + 0x5c) +
                         (double)param_1[0xa2]);
                  }
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  uVar15 = 0x1a;
                  if (*(int *)(lVar13 + 0x38) != 6) {
                    uVar15 = 0x17;
                  }
                  uVar7 = (**(code **)(*param_1 + 200))(param_1,uVar15,1);
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  if (*(int *)(lVar13 + 0x38) != 4) {
                    FUN_14023ad10(param_1 + 0x2f8);
                  }
                }
              }
              else {
                iVar8 = DAT_1406081cc + 1;
                bVar17 = DAT_1406081cc == 0;
                DAT_1406081cc = iVar8;
                if (bVar17) {
                  FUN_140176d60(1);
                }
              }
            }
            if (plVar11 != (longlong *)0x0) {
              if (plVar11 == plStack_68) {
                LOCK();
                plVar11 = plVar11 + 1;
                *(int *)plVar11 = (int)*plVar11 + -1;
                UNLOCK();
                if ((int)*plVar11 == 0) {
                  pvVar5 = (void *)*plStack_70;
                  if (pvVar5 != (void *)0x0) {
                    FUN_14023b080(pvVar5);
                    operator_delete(pvVar5);
                  }
                  operator_delete(plStack_70);
                }
              }
              else {
                iVar8 = DAT_1406081d0 + 1;
                bVar17 = DAT_1406081d0 == 0;
                DAT_1406081d0 = iVar8;
                if (bVar17) {
                  FUN_140176d60(1);
                }
              }
            }
          }
        }
        else {
          iVar8 = DAT_140608158 + 1;
          bVar17 = DAT_140608158 == 0;
          DAT_140608158 = iVar8;
          if (bVar17) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      iVar8 = DAT_140608154 + 1;
      bVar17 = DAT_140608154 == 0;
      DAT_140608154 = iVar8;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  iVar8 = DAT_1406080b4;
  if (plStack_80 != (longlong *)0x0) {
    if (plStack_80 == plStack_78) {
      LOCK();
      plVar11 = plStack_80 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      if ((int)*plVar11 == 0) {
        pvVar5 = (void *)*plStack_80;
        if (pvVar5 != (void *)0x0) {
          FUN_140197310(pvVar5);
          operator_delete(pvVar5);
        }
        operator_delete(plStack_80);
      }
    }
    else {
      DAT_1406080b4 = DAT_1406080b4 + 1;
      if (iVar8 == 0) {
        FUN_140176d60(1);
      }
    }
  }
  return uVar7;
}



undefined1 FUN_140233880(longlong *param_1,longlong param_2)

{
  int *piVar1;
  byte bVar2;
  byte bVar3;
  undefined4 uVar4;
  void *pvVar5;
  longlong lVar6;
  undefined1 uVar7;
  int iVar8;
  undefined4 uVar9;
  undefined8 uVar10;
  longlong *plVar11;
  undefined8 *puVar12;
  longlong lVar13;
  undefined8 *puVar14;
  undefined8 uVar15;
  undefined8 *puVar16;
  bool bVar17;
  longlong *local_80;
  longlong *local_78;
  longlong *local_70;
  longlong *local_68;
  undefined8 *local_60;
  undefined8 *local_58;
  undefined8 *local_50;
  undefined8 *local_48;
  
  uVar7 = 1;
  param_1[0x16b] = param_2;
  uVar15 = 0;
  local_80 = (longlong *)0x0;
  if (param_2 == 0) {
    bVar2 = *(byte *)((longlong)param_1 + 0x601);
    bVar3 = *(byte *)(param_1 + 0xc0);
    uVar4 = *(undefined4 *)((longlong)param_1 + 300);
    plVar11 = param_1 + 0x299;
    if (7 < (ulonglong)param_1[0x29c]) {
      plVar11 = (longlong *)*plVar11;
    }
    puVar14 = (undefined8 *)param_1[0x391];
    if (puVar14 != (undefined8 *)0x0) {
      if (puVar14 == (undefined8 *)param_1[0x392]) {
        uVar15 = *puVar14;
      }
      else {
        iVar8 = DAT_140608150 + 1;
        bVar17 = DAT_140608150 == 0;
        DAT_140608150 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
    plVar11 = (longlong *)
              FUN_140278700(uVar15,&local_50,plVar11,(int)param_1[0x381],uVar4,bVar2 | bVar3,
                            (char)param_1[0x413]);
    puVar14 = local_50;
    plVar11 = (longlong *)*plVar11;
    if (plVar11 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar11 + 1) = (int)plVar11[1] + 1;
      UNLOCK();
      local_80 = plVar11;
      local_78 = plVar11;
    }
    iVar8 = DAT_1406080b4;
    if (local_50 == (undefined8 *)0x0) goto LAB_140233ad9;
    if (local_50 != local_48) {
      DAT_1406080b4 = DAT_1406080b4 + 1;
      if (iVar8 == 0) {
        FUN_140176d60(CONCAT71((int7)((ulonglong)plVar11 >> 8),1));
      }
      goto LAB_140233ad9;
    }
    if (local_50 == (undefined8 *)0x0) goto LAB_140233ad9;
    LOCK();
    piVar1 = (int *)(local_50 + 1);
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    if (*piVar1 != 0) goto LAB_140233ad9;
    local_50 = (undefined8 *)0x0;
  }
  else {
    bVar2 = *(byte *)((longlong)param_1 + 0x601);
    bVar3 = *(byte *)(param_1 + 0xc0);
    uVar4 = *(undefined4 *)((longlong)param_1 + 300);
    lVar13 = param_1[0xb5];
    puVar14 = (undefined8 *)param_1[0x391];
    if (puVar14 != (undefined8 *)0x0) {
      if (puVar14 == (undefined8 *)param_1[0x392]) {
        uVar15 = *puVar14;
      }
      else {
        iVar8 = DAT_140608150 + 1;
        bVar17 = DAT_140608150 == 0;
        DAT_140608150 = iVar8;
        if (bVar17) {
          FUN_140176d60(1);
        }
      }
    }
    lVar6 = param_1[0x1dd];
    uVar9 = FUN_14023c2c0(param_2,(int)lVar6,(int)lVar13);
    uVar10 = FUN_14023c1c0(param_2,(int)lVar6,(int)lVar13);
    plVar11 = (longlong *)
              FUN_140278700(uVar15,&local_60,uVar10,uVar9,uVar4,bVar2 | bVar3,(char)param_1[0x413]);
    puVar14 = local_60;
    plVar11 = (longlong *)*plVar11;
    if (plVar11 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar11 + 1) = (int)plVar11[1] + 1;
      UNLOCK();
      local_80 = plVar11;
      local_78 = plVar11;
    }
    iVar8 = DAT_1406080b4;
    if (local_60 == (undefined8 *)0x0) goto LAB_140233ad9;
    if (local_60 != local_58) {
      DAT_1406080b4 = DAT_1406080b4 + 1;
      if (iVar8 == 0) {
        FUN_140176d60(CONCAT71((int7)((ulonglong)plVar11 >> 8),1));
      }
      goto LAB_140233ad9;
    }
    if (local_60 == (undefined8 *)0x0) goto LAB_140233ad9;
    LOCK();
    piVar1 = (int *)(local_60 + 1);
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    if (*piVar1 != 0) goto LAB_140233ad9;
    local_60 = (undefined8 *)0x0;
  }
  pvVar5 = (void *)*puVar14;
  if (pvVar5 != (void *)0x0) {
    FUN_140197310(pvVar5);
    operator_delete(pvVar5);
  }
  operator_delete(puVar14);
LAB_140233ad9:
  puVar14 = (undefined8 *)0x0;
  if (local_80 != (longlong *)0x0) {
    if (local_80 == local_78) {
      if ((*local_80 != 0) && (plVar11 = (longlong *)param_1[0x393], plVar11 != (longlong *)0x0)) {
        if (plVar11 == (longlong *)param_1[0x394]) {
          if (*plVar11 != 0) {
            puVar12 = operator_new(0x88);
            puVar16 = puVar14;
            if (puVar12 != (void *)0x0) {
              puVar12[4] = 7;
              puVar12[3] = 0;
              *(undefined2 *)(puVar12 + 1) = 0;
              puVar12[0xb] = 7;
              puVar12[10] = 0;
              *(undefined2 *)(puVar12 + 8) = 0;
              puVar12[0xd] = 0;
              puVar12[0xe] = 0;
              puVar12[0xf] = 0;
              puVar16 = puVar12;
            }
            FUN_14023ae90(param_1 + 0x2f8);
            puVar12 = puVar14;
            if (puVar16 != (undefined8 *)0x0) {
              puVar12 = operator_new(0x10);
              *puVar12 = puVar16;
              *(undefined4 *)(puVar12 + 1) = 1;
            }
            param_1[0x2f8] = (longlong)puVar12;
            param_1[0x2f9] = (longlong)puVar12;
            puVar16 = (undefined8 *)(*local_80 + 0x88);
            if (7 < *(ulonglong *)(*local_80 + 0xa0)) {
              puVar16 = (undefined8 *)*puVar16;
            }
            plVar11 = (longlong *)param_1[0x393];
            if (plVar11 != (longlong *)0x0) {
              if (plVar11 == (longlong *)param_1[0x394]) {
                puVar14 = (undefined8 *)*plVar11;
              }
              else {
                iVar8 = DAT_140608158 + 1;
                bVar17 = DAT_140608158 == 0;
                DAT_140608158 = iVar8;
                if (bVar17) {
                  FUN_140176d60(1);
                }
              }
            }
            FUN_14027a560(puVar14,&local_70,puVar16);
            plVar11 = local_70;
            if (local_70 != (longlong *)0x0) {
              if (local_70 == local_68) {
                if (*local_70 != 0) {
                  param_1[0x2f3] = 0;
                  if ((longlong *)param_1[0x2f8] != local_70) {
                    FUN_14023ae90(param_1 + 0x2f8);
                    param_1[0x2f8] = (longlong)plVar11;
                    param_1[0x2f9] = (longlong)plVar11;
                    LOCK();
                    *(int *)(plVar11 + 1) = (int)plVar11[1] + 1;
                    UNLOCK();
                  }
                  plVar11 = local_70;
                  param_1[0x3d7] = param_1[0xa2];
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  *(undefined4 *)(param_1 + 0x381) =
                       *(undefined4 *)(*(longlong *)(lVar13 + 0x68) + 0x28);
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  FUN_1400015e0(param_1 + 0x299,*(longlong *)(lVar13 + 0x68) + 0x30,0,
                                0xffffffffffffffff);
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  FUN_1400015e0(param_1 + 0x2da,lVar13 + 0x40,0,0xffffffffffffffff);
                  if (*(int *)(*local_80 + 0xdc) == 5) {
                    lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                    *(undefined4 *)(lVar13 + 4) = 1;
                  }
                  else if (*(int *)(*local_80 + 0xdc) == 3) {
                    lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                    *(undefined4 *)(lVar13 + 4) = 0;
                  }
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  if (*(longlong *)(lVar13 + 0x68) != *(longlong *)(lVar13 + 0x70)) {
                    lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                    param_1[0x2f3] =
                         (longlong)
                         ((double)*(float *)(*(longlong *)(lVar13 + 0x68) + 0x5c) +
                         (double)param_1[0xa2]);
                  }
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  uVar15 = 0x1a;
                  if (*(int *)(lVar13 + 0x38) != 6) {
                    uVar15 = 0x17;
                  }
                  uVar7 = (**(code **)(*param_1 + 200))(param_1,uVar15,1);
                  lVar13 = FUN_14023ad10(param_1 + 0x2f8);
                  if (*(int *)(lVar13 + 0x38) != 4) {
                    FUN_14023ad10(param_1 + 0x2f8);
                  }
                }
              }
              else {
                iVar8 = DAT_1406081cc + 1;
                bVar17 = DAT_1406081cc == 0;
                DAT_1406081cc = iVar8;
                if (bVar17) {
                  FUN_140176d60(1);
                }
              }
            }
            if (plVar11 != (longlong *)0x0) {
              if (plVar11 == local_68) {
                LOCK();
                plVar11 = plVar11 + 1;
                *(int *)plVar11 = (int)*plVar11 + -1;
                UNLOCK();
                if ((int)*plVar11 == 0) {
                  pvVar5 = (void *)*local_70;
                  if (pvVar5 != (void *)0x0) {
                    FUN_14023b080(pvVar5);
                    operator_delete(pvVar5);
                  }
                  operator_delete(local_70);
                }
              }
              else {
                iVar8 = DAT_1406081d0 + 1;
                bVar17 = DAT_1406081d0 == 0;
                DAT_1406081d0 = iVar8;
                if (bVar17) {
                  FUN_140176d60(1);
                }
              }
            }
          }
        }
        else {
          iVar8 = DAT_140608158 + 1;
          bVar17 = DAT_140608158 == 0;
          DAT_140608158 = iVar8;
          if (bVar17) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      iVar8 = DAT_140608154 + 1;
      bVar17 = DAT_140608154 == 0;
      DAT_140608154 = iVar8;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  iVar8 = DAT_1406080b4;
  if (local_80 != (longlong *)0x0) {
    if (local_80 == local_78) {
      LOCK();
      plVar11 = local_80 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      if ((int)*plVar11 == 0) {
        pvVar5 = (void *)*local_80;
        if (pvVar5 != (void *)0x0) {
          FUN_140197310(pvVar5);
          operator_delete(pvVar5);
        }
        operator_delete(local_80);
      }
    }
    else {
      DAT_1406080b4 = DAT_1406080b4 + 1;
      if (iVar8 == 0) {
        FUN_140176d60(1);
      }
    }
  }
  return uVar7;
}



undefined8 FUN_140233ec0(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  short sVar1;
  longlong *plVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  short *psVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong lVar9;
  short *psVar10;
  bool bVar11;
  bool bVar12;
  float extraout_XMM0_Da;
  undefined8 uVar13;
  longlong lVar14;
  undefined1 uVar15;
  undefined4 uStack_14;
  
  uVar13 = 0xfffffffffffffffe;
  FUN_1402349c0(param_1,*(undefined4 *)(param_2 + 0x18),param_3,param_4,0xfffffffffffffffe);
  if (1.0 <= extraout_XMM0_Da) {
    lVar8 = 0;
    lVar14 = 0;
    bVar12 = false;
    uVar15 = 0;
    plVar2 = (longlong *)param_1[0x25d];
    lVar9 = lVar8;
    if (plVar2 != (longlong *)0x0) {
      if (plVar2 == (longlong *)param_1[0x25e]) {
        lVar5 = *plVar2;
        lVar9 = 0;
        if (lVar5 != 0) {
          if ((plVar2 != (longlong *)param_1[0x25e]) &&
             (iVar3 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, lVar5 = lVar8,
             DAT_1406080a8 = iVar3, bVar12)) {
            FUN_140176d60(1);
          }
          lVar14 = lVar5;
          FUN_14034ed40(lVar5);
          bVar12 = true;
          uVar15 = 1;
          lVar9 = lVar5;
        }
      }
      else {
        iVar3 = DAT_1406080a8 + 1;
        bVar11 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar3;
        if (bVar11) {
          FUN_140176d60(1);
        }
      }
    }
    lVar8 = param_1[0xa2];
    uVar4 = *(undefined4 *)(param_2 + 0x90);
    lVar5 = FUN_14023b4a0(param_1 + 0x382,param_2 + 0x18);
    *(longlong *)(lVar5 + 8) = lVar8;
    *(ulonglong *)(lVar5 + 0x10) = CONCAT44(uStack_14,uVar4);
    param_1[0x167] = param_2;
    psVar6 = (short *)FUN_14023c1c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5],param_4,uVar13,
                                    lVar14,uVar15);
    uVar7 = 0xffffffffffffffff;
    psVar10 = psVar6;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar1 = *psVar10;
      psVar10 = psVar10 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x2c6,psVar6,~uVar7 - 1);
    uVar4 = FUN_14023c2c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5]);
    *(undefined4 *)(param_1 + 0x381) = uVar4;
    (**(code **)(*param_1 + 200))(param_1,0x42);
    if (bVar12) {
      FUN_14034edd0(lVar9);
    }
    uVar13 = 1;
  }
  else {
    uVar13 = 0;
  }
  return uVar13;
}



undefined8 FUN_140234070(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  short sVar2;
  char cVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined8 uVar8;
  longlong lVar9;
  short *psVar10;
  ulonglong uVar11;
  short *psVar12;
  float extraout_XMM0_Da;
  undefined8 uVar13;
  undefined8 uVar14;
  undefined1 uVar15;
  undefined4 uStack_34;
  
  uVar13 = 0xfffffffffffffffe;
  FUN_1402349c0(param_1,*(undefined4 *)(param_2 + 0x18),param_3,param_4,0xfffffffffffffffe);
  if (1.0 <= extraout_XMM0_Da) {
    lVar6 = (**(code **)(*param_1 + 0x428))(param_1);
    if (lVar6 != 0) {
      plVar7 = (longlong *)FUN_1402191e0(param_1,lVar6);
      if (plVar7 != (longlong *)0x0) {
        uVar8 = 0;
        uVar14 = 0;
        uVar15 = 0;
        cVar3 = FUN_140195920(param_1 + 0x25d);
        if (cVar3 != '\0') {
          uVar8 = FUN_140195970(param_1 + 0x25d);
          uVar14 = uVar8;
          FUN_14034ed40(uVar8);
          uVar15 = 1;
        }
        lVar1 = param_1[0xa2];
        uVar4 = *(undefined4 *)(param_2 + 0x90);
        lVar9 = FUN_14023b4a0(param_1 + 0x382,param_2 + 0x18);
        *(longlong *)(lVar9 + 8) = lVar1;
        *(ulonglong *)(lVar9 + 0x10) = CONCAT44(uStack_34,uVar4);
        param_1[0x167] = param_2;
        psVar10 = (short *)FUN_14023c1c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5],param_4,
                                         uVar13,uVar14,uVar15);
        uVar11 = 0xffffffffffffffff;
        psVar12 = psVar10;
        do {
          if (uVar11 == 0) break;
          uVar11 = uVar11 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(param_1 + 0x2c6,psVar10,~uVar11 - 1);
        uVar4 = FUN_14023c2c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5]);
        *(undefined4 *)(param_1 + 0x381) = uVar4;
        lVar1 = plVar7[0x25];
        uVar4 = *(undefined4 *)(lVar6 + 0x28);
        uVar5 = (**(code **)(*plVar7 + 0xb0))(plVar7);
        *(undefined4 *)(param_1 + 0x194) = uVar5;
        *(int *)((longlong)param_1 + 0xca4) = (int)lVar1;
        *(undefined4 *)(param_1 + 0x195) = uVar4;
        (**(code **)(*param_1 + 200))(param_1,0x43);
        if (cVar3 != '\0') {
          FUN_14034edd0(uVar8);
        }
        return 1;
      }
    }
  }
  return 0;
}



undefined8 FUN_140234230(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  short sVar2;
  char cVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong lVar6;
  short *psVar7;
  ulonglong uVar8;
  short *psVar9;
  float extraout_XMM0_Da;
  undefined8 uVar10;
  undefined8 uVar11;
  undefined1 uVar12;
  undefined4 uStack_24;
  
  uVar10 = 0xfffffffffffffffe;
  if ((param_2 == 0) ||
     (FUN_1402349c0(param_1,*(undefined4 *)(param_2 + 0x18),param_3,param_4,0xfffffffffffffffe),
     extraout_XMM0_Da < 1.0)) {
    return 0;
  }
  uVar5 = 0;
  uVar11 = 0;
  uVar12 = 0;
  cVar3 = FUN_140195920(param_1 + 0x25d);
  if (cVar3 != '\0') {
    uVar5 = FUN_140195970(param_1 + 0x25d);
    uVar11 = uVar5;
    FUN_14034ed40(uVar5);
    uVar12 = 1;
  }
  lVar1 = param_1[0xa2];
  uVar4 = *(undefined4 *)(param_2 + 0x90);
  lVar6 = FUN_14023b4a0(param_1 + 0x382,param_2 + 0x18);
  *(longlong *)(lVar6 + 8) = lVar1;
  *(ulonglong *)(lVar6 + 0x10) = CONCAT44(uStack_24,uVar4);
  param_1[0x167] = param_2;
  psVar7 = (short *)FUN_14023c1c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5],param_4,uVar10,
                                  uVar11,uVar12);
  uVar8 = 0xffffffffffffffff;
  psVar9 = psVar7;
  do {
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    sVar2 = *psVar9;
    psVar9 = psVar9 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x2c6,psVar7,~uVar8 - 1);
  uVar4 = FUN_14023c2c0(param_2,(int)param_1[0x1dd],(int)param_1[0xb5]);
  *(undefined4 *)(param_1 + 0x381) = uVar4;
  *(undefined4 *)((longlong)param_1 + 0xcd4) = *(undefined4 *)(param_2 + 0x3d4);
  (**(code **)(*param_1 + 200))(param_1,0x45);
  if (cVar3 != '\0') {
    FUN_14034edd0(uVar5);
  }
  return 1;
}



void FUN_1402343b0(longlong param_1,uint param_2,undefined4 param_3,undefined4 param_4,
                  undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8)

{
  uint *puVar1;
  char cVar2;
  longlong *plVar3;
  ulonglong uVar4;
  uint uVar5;
  
  uVar4 = (ulonglong)param_2;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar1 = *(uint **)(*plVar3 + (uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar5 = puVar1[3];
          goto LAB_140234414;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_140234414:
  if (*(int *)(param_1 + 300) != 0x25) {
    FUN_1403161f0();
    cVar2 = FUN_1403175c0(uVar4);
    if ((cVar2 != '\0') &&
       (plVar3 = (longlong *)FUN_140267670(uVar5,uVar4,param_1), plVar3 != (longlong *)0x0)) {
      (**(code **)(*plVar3 + 8))(plVar3,uVar4);
      *(undefined4 *)(plVar3 + 0x10) = *(undefined4 *)(param_1 + 0x178);
      *(undefined4 *)((longlong)plVar3 + 0x84) = *(undefined4 *)(param_1 + 0x17c);
      *(undefined4 *)(plVar3 + 0x11) = *(undefined4 *)(param_1 + 0x180);
      *(undefined4 *)((longlong)plVar3 + 0x6c) = 3;
      *(undefined4 *)(plVar3 + 0x10) = *param_7;
      *(undefined4 *)((longlong)plVar3 + 0x84) = param_7[1];
      *(undefined4 *)(plVar3 + 0x11) = param_7[2];
      *(undefined4 *)((longlong)plVar3 + 0x8c) = *param_8;
      *(undefined4 *)(plVar3 + 0x12) = param_8[1];
      *(undefined4 *)((longlong)plVar3 + 0x94) = param_8[2];
      FUN_140236830(param_1,param_6,plVar3,param_5,param_3,param_4);
    }
  }
  return;
}



void FUN_140234510(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4,
                  undefined4 *param_5,undefined4 *param_6)

{
  uint uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  uint *puVar10;
  char cVar11;
  longlong *plVar12;
  int iVar13;
  uint *puVar14;
  uint uVar15;
  
  iVar13 = 0;
  puVar14 = (uint *)(param_2 + 0x3d8);
  do {
    if ((param_2 != 0) && (uVar1 = *puVar14, 0 < (int)uVar1)) {
      uVar2 = *param_6;
      uVar3 = param_6[1];
      uVar4 = param_6[2];
      uVar5 = *param_5;
      uVar6 = param_5[1];
      uVar7 = param_5[2];
      uVar8 = *(undefined4 *)(param_2 + 0x28);
      uVar9 = *(undefined4 *)(param_2 + 0x18);
      plVar12 = (longlong *)FUN_1403161f0();
      if (*plVar12 != 0) {
        for (puVar10 = *(uint **)(*plVar12 +
                                 ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar12 + 2)) * 8);
            puVar10 != (uint *)0x0; puVar10 = *(uint **)(puVar10 + 0xe8)) {
          if ((puVar10[0xea] == uVar1) && (*puVar10 == uVar1)) {
            if (puVar10 != (uint *)0x0) {
              uVar15 = puVar10[3];
              goto LAB_1402345e5;
            }
            break;
          }
        }
      }
      uVar15 = 0;
LAB_1402345e5:
      if (*(int *)(param_1 + 300) != 0x25) {
        FUN_1403161f0();
        cVar11 = FUN_1403175c0(uVar1);
        if ((cVar11 != '\0') &&
           (plVar12 = (longlong *)FUN_140267670(uVar15,uVar1,param_1), plVar12 != (longlong *)0x0))
        {
          (**(code **)(*plVar12 + 8))(plVar12,uVar1);
          *(undefined4 *)(plVar12 + 0x10) = uVar5;
          *(undefined4 *)((longlong)plVar12 + 0x84) = uVar6;
          *(undefined4 *)(plVar12 + 0x11) = uVar7;
          *(undefined4 *)((longlong)plVar12 + 0x8c) = uVar2;
          *(undefined4 *)((longlong)plVar12 + 0x6c) = 3;
          *(undefined4 *)(plVar12 + 0x12) = uVar3;
          *(undefined4 *)((longlong)plVar12 + 0x94) = uVar4;
          FUN_140236830(param_1,param_4,plVar12,param_3,uVar9,uVar8);
        }
      }
    }
    iVar13 = iVar13 + 1;
    puVar14 = puVar14 + 1;
    if (3 < iVar13) {
      return;
    }
  } while( true );
}



ulonglong FUN_1402346d0(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  longlong *plVar2;
  byte bVar3;
  int iVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  bool bVar9;
  bool bVar10;
  float extraout_XMM0_Da;
  undefined4 uStack_14;
  
  uVar5 = FUN_1402349c0(param_1,*(undefined4 *)(param_2 + 0x18),param_3,param_4,0xfffffffffffffffe);
  if (1.0 <= extraout_XMM0_Da) {
    lVar7 = 0;
    bVar10 = false;
    plVar2 = (longlong *)param_1[0x25d];
    lVar8 = lVar7;
    if (plVar2 != (longlong *)0x0) {
      if (plVar2 == (longlong *)param_1[0x25e]) {
        lVar6 = *plVar2;
        lVar8 = 0;
        if (lVar6 != 0) {
          if ((plVar2 != (longlong *)param_1[0x25e]) &&
             (iVar4 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar6 = lVar7,
             DAT_1406080a8 = iVar4, bVar10)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40(lVar6);
          bVar10 = true;
          lVar8 = lVar6;
        }
      }
      else {
        iVar4 = DAT_1406080a8 + 1;
        bVar9 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar4;
        if (bVar9) {
          FUN_140176d60(1);
        }
      }
    }
    lVar7 = param_1[0xa2];
    uVar1 = *(undefined4 *)(param_2 + 0x90);
    lVar6 = FUN_14023b4a0(param_1 + 0x382,param_2 + 0x18);
    *(longlong *)(lVar6 + 8) = lVar7;
    *(ulonglong *)(lVar6 + 0x10) = CONCAT44(uStack_14,uVar1);
    if ((((*(int *)(param_2 + 0x1c) == -1) || (*(int *)(param_2 + 0x1c) == (int)param_1[0x1f8])) ||
        (param_1[0x16e] == 0)) || (*(int *)(param_1[0x16e] + 0xc) == 0)) {
      param_1[0x168] = param_2;
      bVar3 = (**(code **)(*param_1 + 200))(param_1,0x44);
    }
    else {
      bVar3 = 0;
    }
    if (bVar10) {
      FUN_14034edd0(lVar8);
    }
    uVar5 = (ulonglong)bVar3;
  }
  else {
    uVar5 = uVar5 & 0xffffffffffffff00;
  }
  return uVar5;
}



ulonglong FUN_140234850(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  longlong *plVar3;
  int iVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  bool bVar9;
  bool bVar10;
  float extraout_XMM0_Da;
  undefined4 uStack_14;
  
  uVar5 = FUN_1402349c0(param_1,*(undefined4 *)(param_2 + 0x18),param_3,param_4,0xfffffffffffffffe);
  if (1.0 <= extraout_XMM0_Da) {
    lVar6 = 0;
    bVar10 = false;
    plVar3 = *(longlong **)(param_1 + 0x12e8);
    lVar8 = lVar6;
    if (plVar3 != (longlong *)0x0) {
      if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
        lVar7 = *plVar3;
        lVar8 = 0;
        if (lVar7 != 0) {
          if ((plVar3 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar4 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar7 = lVar6,
             DAT_1406080a8 = iVar4, bVar10)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40(lVar7);
          bVar10 = true;
          lVar8 = lVar7;
        }
      }
      else {
        iVar4 = DAT_1406080a8 + 1;
        bVar9 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar4;
        if (bVar9) {
          FUN_140176d60(1);
        }
      }
    }
    uVar2 = *(undefined8 *)(param_1 + 0x510);
    uVar1 = *(undefined4 *)(param_2 + 0x90);
    lVar6 = FUN_14023b4a0(param_1 + 0x1c10,param_2 + 0x18);
    *(undefined8 *)(lVar6 + 8) = uVar2;
    *(ulonglong *)(lVar6 + 0x10) = CONCAT44(uStack_14,uVar1);
    if ((((*(int *)(param_2 + 0x1c) == -1) ||
         (*(int *)(param_2 + 0x1c) == *(int *)(param_1 + 0xfc0))) ||
        (*(longlong *)(param_1 + 0xb70) == 0)) ||
       (*(int *)(*(longlong *)(param_1 + 0xb70) + 0xc) == 0)) {
      *(longlong *)(param_1 + 0xb48) = param_2;
      uVar5 = 1;
    }
    else {
      uVar5 = 0;
    }
    if (bVar10) {
      FUN_14034edd0(lVar8);
    }
  }
  else {
    uVar5 = uVar5 & 0xffffffffffffff00;
  }
  return uVar5;
}



void FUN_1402349c0(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  bool bVar7;
  bool bVar8;
  
  puVar4 = (undefined8 *)0x0;
  puVar5 = (undefined8 *)0x0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  puVar6 = puVar4;
  if (plVar1 != (longlong *)0x0) {
    plVar2 = *(longlong **)(param_1 + 0x12f0);
    puVar6 = puVar5;
    if (plVar1 == plVar2) {
      if ((undefined8 *)*plVar1 != (undefined8 *)0x0) {
        puVar6 = (undefined8 *)*plVar1;
        if ((plVar1 != plVar2) &&
           (iVar3 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, puVar6 = puVar4,
           DAT_1406080a8 = iVar3, bVar8)) {
          FUN_140176d60(1,plVar2,param_3,param_4,0xfffffffffffffffe);
        }
        FUN_14034ed40(puVar6);
        bVar8 = true;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar7) {
        FUN_140176d60(1,plVar2,param_3,param_4,0xfffffffffffffffe);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x1c30) != 0) {
    for (puVar5 = *(undefined8 **)
                   (*(longlong *)(param_1 + 0x1c10) +
                   ((ulonglong)(longlong)param_2 % *(ulonglong *)(param_1 + 0x1c18)) * 8);
        puVar5 != (undefined8 *)0x0; puVar5 = (undefined8 *)*puVar5) {
      if (param_2 == *(int *)(puVar5 + 1)) {
        puVar4 = (undefined8 *)0x0;
        if (puVar5 != (undefined8 *)0x0) {
          puVar4 = puVar5;
        }
        break;
      }
    }
  }
  if (puVar4 == (undefined8 *)0x0) {
    if (bVar8) {
      FUN_14034edd0(puVar6);
    }
  }
  else if (bVar8) {
    FUN_14034edd0(puVar6);
  }
  return;
}



void FUN_140234b20(longlong *param_1)

{
  DWORD DVar1;
  longlong *plVar2;
  HANDLE pvVar3;
  HANDLE pvVar4;
  uint uVar5;
  uint uVar6;
  longlong lVar7;
  longlong *plVar8;
  
  uVar5 = 0;
  plVar8 = param_1 + 0x16f;
  do {
    uVar6 = 1;
    lVar7 = 0x180;
    do {
      plVar2 = plVar8;
      if (1 < uVar5) {
        if ((DAT_140608140 == 0) &&
           (pvVar3 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0), pvVar3 != (HANDLE)0x0)) {
          DVar1 = GetCurrentProcessId();
          pvVar4 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar4,DVar1,pvVar3,0x2000,0,0,0);
          CloseHandle(pvVar3);
        }
        DAT_140608140 = DAT_140608140 + 1;
        plVar2 = &DAT_140608148;
      }
      if (*plVar2 != 0) {
        plVar2 = plVar8;
        if (1 < uVar5) {
          if ((DAT_140608140 == 0) &&
             (pvVar3 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                   (HANDLE)0x0), pvVar3 != (HANDLE)0x0)) {
            DVar1 = GetCurrentProcessId();
            pvVar4 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar4,DVar1,pvVar3,0x2000,0,0,0);
            CloseHandle(pvVar3);
          }
          DAT_140608140 = DAT_140608140 + 1;
          plVar2 = &DAT_140608148;
        }
        if (uVar6 - 1 < 0xe) {
          if (uVar6 < 0xf) {
            plVar2 = (longlong *)(*plVar2 + lVar7);
          }
          else {
            if (DAT_140608178 == 0) {
              FUN_140176d60(0);
            }
            DAT_140608178 = DAT_140608178 + 1;
            plVar2 = &DAT_140608170;
          }
          if (*(char *)(*plVar2 + 0x20) != '\0') {
            (**(code **)(*param_1 + 0x930))(param_1,uVar6);
          }
        }
      }
      uVar6 = uVar6 + 1;
      lVar7 = lVar7 + 8;
    } while ((int)uVar6 < 0xf);
    plVar2 = plVar8;
    if (1 < uVar5) {
      if ((DAT_140608140 == 0) &&
         (pvVar3 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                               (HANDLE)0x0), pvVar3 != (HANDLE)0x0)) {
        DVar1 = GetCurrentProcessId();
        pvVar4 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar4,DVar1,pvVar3,0x2000,0,0,0);
        CloseHandle(pvVar3);
      }
      DAT_140608140 = DAT_140608140 + 1;
      plVar2 = &DAT_140608148;
    }
    if (*plVar2 != 0) {
      plVar2 = plVar8;
      if (1 < uVar5) {
        if ((DAT_140608140 == 0) &&
           (pvVar3 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0), pvVar3 != (HANDLE)0x0)) {
          DVar1 = GetCurrentProcessId();
          pvVar4 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar4,DVar1,pvVar3,0x2000,0,0,0);
          CloseHandle(pvVar3);
        }
        DAT_140608140 = DAT_140608140 + 1;
        plVar2 = &DAT_140608148;
      }
      FUN_14032b210(*plVar2);
    }
    uVar5 = uVar5 + 1;
    plVar8 = plVar8 + 1;
  } while ((int)uVar5 < 2);
  return;
}



ulonglong FUN_140234e50(longlong *param_1)

{
  ulonglong uVar1;
  
  uVar1 = (**(code **)(*param_1 + 0xb0))();
  if ((int)uVar1 == 4) {
    uVar1 = *(ulonglong *)(param_1[0x16f] + 0x1a8);
    if (((*(char *)(uVar1 + 0x20) != '\0') ||
        (uVar1 = *(ulonglong *)(param_1[0x16f] + 0x1a0), *(char *)(uVar1 + 0x20) != '\0')) ||
       (*(int *)((longlong)param_1 + 0x1e44) == 1)) {
      return CONCAT71((int7)(uVar1 >> 8),1);
    }
  }
  return uVar1 & 0xffffffffffffff00;
}



void FUN_140234eb0(longlong *param_1)

{
  if ((char)param_1[0x405] != '\0') {
    (**(code **)(*param_1 + 0x290))();
    *(undefined1 *)(param_1 + 0x405) = 0;
  }
  return;
}



void FUN_140234ef0(longlong *param_1,double param_2,double param_3)

{
  float fVar1;
  float local_48;
  float local_44;
  float local_40;
  float local_38;
  undefined4 local_34;
  float local_30;
  float local_28;
  float local_24;
  float local_20;
  
  if (*(char *)((longlong)param_1 + 0x1cbc) != '\0') {
    if ((double)param_1[0x39a] <= param_2) {
      *(undefined1 *)((longlong)param_1 + 0x1cbc) = 0;
      return;
    }
    local_28 = *(float *)(param_1 + 0x2f);
    local_24 = *(float *)((longlong)param_1 + 0x17c);
    local_44 = 0.0;
    local_20 = *(float *)(param_1 + 0x30);
    local_38 = *(float *)(param_1 + 0x398);
    local_34 = *(undefined4 *)((longlong)param_1 + 0x1cc4);
    local_30 = *(float *)(param_1 + 0x399);
    local_48 = local_38 - local_28;
    local_40 = local_30 - local_20;
    D3DXVec3Normalize(&local_48,&local_48);
    fVar1 = (float)((double)*(float *)((longlong)param_1 + 0x1ccc) * param_3);
    local_48 = local_48 * fVar1;
    local_44 = local_44 * fVar1;
    local_40 = local_40 * fVar1;
    fVar1 = (float)(**(code **)(*param_1 + 0x2d8))(param_1);
    fVar1 = 100.0 / fVar1;
    local_48 = local_48 * fVar1;
    local_40 = local_40 * fVar1;
    local_44 = local_44 * fVar1;
    local_28 = *(float *)(param_1 + 0x2f) - local_48;
    local_24 = *(float *)((longlong)param_1 + 0x17c) - local_44;
    local_20 = *(float *)(param_1 + 0x30) - local_40;
    FUN_14022ecd0(param_1,&local_28);
  }
  return;
}



undefined8
FUN_140235080(undefined8 param_1,longlong param_2,undefined8 param_3,undefined8 param_4,
             undefined4 param_5)

{
  int iVar1;
  
  if (param_2 == 0) {
    return 0;
  }
  FUN_1402d7440();
  if (*(char *)(param_2 + 0x3a8) != '\0') {
    iVar1 = 1;
    do {
      FUN_140224540(param_1,0,*(undefined4 *)(param_2 + 0x3c4),iVar1,param_5);
      FUN_140224540(param_1,1,*(undefined4 *)(param_2 + 0x3c4),iVar1);
      iVar1 = iVar1 + 1;
    } while (iVar1 < 0xf);
    return 1;
  }
  if (0 < *(int *)(param_2 + 0x3c0)) {
    FUN_140224540(param_1,0,*(undefined4 *)(param_2 + 0x3c4),*(int *)(param_2 + 0x3c0),param_5);
    FUN_140224540(param_1,1,*(undefined4 *)(param_2 + 0x3c4),*(undefined4 *)(param_2 + 0x3c0));
  }
  return 1;
}



void FUN_140235160(longlong *param_1,double param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  
  plVar5 = (longlong *)param_1[0x196];
  lVar2 = param_1[0x197] - (longlong)plVar5 >> 0x3f;
  if (((param_1[0x197] - (longlong)plVar5) / 0x28 + lVar2 != lVar2) &&
     (plVar5 != (longlong *)param_1[0x197])) {
    do {
      if (param_2 < (double)plVar5[4] || param_2 == (double)plVar5[4]) {
        plVar5 = plVar5 + 5;
      }
      else {
        plVar1 = (longlong *)param_1[0x197];
        plVar3 = plVar5;
        plVar4 = plVar5;
        while (plVar4 = plVar4 + 5, plVar4 != plVar1) {
          *plVar3 = *plVar4;
          plVar3[1] = plVar4[1];
          plVar3[2] = plVar4[2];
          plVar3[3] = plVar4[3];
          plVar3[4] = plVar4[4];
          plVar3 = plVar3 + 5;
        }
        param_1[0x197] = param_1[0x197] + -0x28;
        if (*plVar5 != 0) {
          (**(code **)(*param_1 + 0x5e0))(param_1,*plVar5,0);
        }
      }
    } while (plVar5 != (longlong *)param_1[0x197]);
  }
  return;
}



void FUN_140235250(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  float local_48;
  float local_44;
  float local_40;
  float local_38;
  float local_34;
  float local_30;
  float local_28;
  undefined4 local_24;
  float local_20;
  float local_18;
  undefined4 local_14;
  float local_10;
  
  if (*(int *)(param_2 + 0x28) == 0) {
    if (param_1[0x3d0] == 0) {
      return;
    }
    lVar2 = *(longlong *)(param_1[0x3d0] + 0x30);
    if (lVar2 == 0) {
      return;
    }
    plVar1 = *(longlong **)(lVar2 + 0x2d0);
    if (plVar1 == (longlong *)0x0) {
      return;
    }
    puVar3 = (undefined8 *)(param_2 + 0x38);
    if (7 < *(ulonglong *)(param_2 + 0x50)) {
      puVar3 = (undefined8 *)*puVar3;
    }
    lVar2 = (**(code **)(*plVar1 + 0x18))(plVar1,puVar3);
    if (lVar2 == 0) {
      return;
    }
    local_18 = *(float *)(lVar2 + 0x68);
    local_14 = *(undefined4 *)(lVar2 + 0x6c);
    local_10 = *(float *)(lVar2 + 0x70);
    local_44 = 0.0;
    local_28 = *(float *)(param_1 + 0x2f);
    local_24 = *(undefined4 *)((longlong)param_1 + 0x17c);
    local_20 = *(float *)(param_1 + 0x30);
    local_38 = local_28 - local_18;
    local_40 = local_20 - local_10;
  }
  else {
    if (*(int *)(param_2 + 0x28) != 2) {
      return;
    }
    lVar2 = (**(code **)(*param_1 + 0x430))
                      (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    if (lVar2 == 0) {
      return;
    }
    local_38 = *(float *)(param_1 + 0x2f) - *(float *)(lVar2 + 0x178);
    local_44 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar2 + 0x17c);
    local_40 = *(float *)(param_1 + 0x30) - *(float *)(lVar2 + 0x180);
  }
  local_48 = local_38;
  local_34 = local_44;
  local_30 = local_40;
  D3DXVec3Normalize(&local_48,&local_48);
  *(float *)((longlong)param_1 + 0x154) = local_48;
  *(float *)(param_1 + 0x2b) = local_44;
  *(float *)((longlong)param_1 + 0x15c) = local_40;
  return;
}



undefined8 FUN_1402353b0(longlong *param_1)

{
  int *piVar1;
  short sVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong lVar8;
  int iVar9;
  short *psVar10;
  undefined8 *puVar11;
  undefined8 *puVar12;
  short *psVar13;
  ulonglong uVar14;
  longlong lVar15;
  int iVar16;
  int local_res10;
  undefined8 *local_res18;
  longlong local_res20;
  undefined8 *local_128;
  undefined8 *local_120;
  undefined8 *local_118;
  longlong local_108;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined8 local_e8;
  undefined2 local_e0;
  undefined6 uStack_de;
  undefined8 local_d0;
  ulonglong local_c8;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  int local_a8;
  longlong local_a0;
  undefined2 local_98;
  undefined8 local_94;
  undefined8 local_8c;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined8 *local_68;
  undefined8 local_60;
  
  local_60 = 0xfffffffffffffffe;
  lVar5 = (**(code **)(*param_1 + 0x420))();
  if ((lVar5 == 0) ||
     (*(float *)(param_1 + 0xb4) <= (float)*(int *)(lVar5 + 0x2c) &&
      (float)*(int *)(lVar5 + 0x2c) != *(float *)(param_1 + 0xb4))) {
    uVar6 = 0;
  }
  else {
    puVar11 = (undefined8 *)0x0;
    local_128 = (undefined8 *)0x0;
    local_120 = (undefined8 *)0x0;
    local_118 = (undefined8 *)0x0;
    local_res10 = 0;
    puVar12 = puVar11;
    if (0 < (int)(*(longlong *)(lVar5 + 0x68) - *(longlong *)(lVar5 + 0x60) >> 2)) {
      local_108 = 0;
      local_res20 = 0;
      do {
        lVar15 = local_108;
        psVar10 = (short *)(local_res20 + *(longlong *)(lVar5 + 0x80));
        if (7 < *(ulonglong *)(psVar10 + 0xc)) {
          psVar10 = *(short **)psVar10;
        }
        lVar7 = FUN_140302f80();
        lVar8 = (**(code **)(PTR_PTR_1405d8520 + 0x18))();
        puVar11 = (undefined8 *)(lVar8 + 0x18);
        iVar16 = 0;
        iVar9 = iVar16;
        local_res18 = puVar11;
        if (psVar10 == (short *)0x0) {
LAB_1402354cd:
          FUN_140306fd0(&local_res18,psVar10,iVar9);
          puVar11 = local_res18;
        }
        else {
          if (((ulonglong)psVar10 & 0xffffffffffff0000) != 0) {
            lVar8 = -1;
            psVar13 = psVar10;
            do {
              if (lVar8 == 0) break;
              lVar8 = lVar8 + -1;
              sVar2 = *psVar13;
              psVar13 = psVar13 + 1;
            } while (sVar2 != 0);
            iVar9 = ~(uint)lVar8 - 1;
            goto LAB_1402354cd;
          }
          lVar8 = FUN_140306ad0((ulonglong)psVar10 & 0xffff,0);
          if (lVar8 != 0) {
            FUN_140306d00(&local_res18,lVar8,(ulonglong)psVar10 & 0xffff);
            puVar11 = local_res18;
          }
        }
        lVar7 = FUN_14033da60(lVar7 + 0xd8,puVar11);
        LOCK();
        piVar1 = (int *)(puVar11 + -1);
        iVar9 = *piVar1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (iVar9 + -1 < 1) {
          (**(code **)(*(longlong *)puVar11[-3] + 8))();
        }
        if (lVar7 != 0) {
          if (lVar7 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          iVar16 = *(int *)(lVar7 + 8);
        }
        uVar3 = *(uint *)(lVar15 + *(longlong *)(lVar5 + 0x60));
        puVar11 = local_120;
        puVar12 = local_128;
        if (0 < (int)uVar3) {
          lVar7 = (longlong)param_1 + 0x154;
          uVar14 = (ulonglong)uVar3;
          do {
            FUN_14021d0c0(param_1,&local_100,lVar5);
            lVar15 = *(longlong *)(param_1[0x3d0] + 0x48);
            piVar1 = (int *)(lVar15 + 0x178);
            *piVar1 = *piVar1 + 1;
            uVar4 = *(undefined4 *)(lVar15 + 0x178);
            local_c8 = 7;
            local_d0 = 0;
            local_e0 = 0;
            local_94 = 0;
            local_8c = 0;
            local_84 = 0;
            local_80 = 0;
            local_7c = 0;
            local_78 = 0;
            local_e8 = 0;
            FUN_140001710(&local_e0,L"respawn01",9);
            local_b4 = local_100;
            local_b0 = local_fc;
            local_ac = local_f8;
            local_98 = 0;
            local_94 = 0;
            local_8c = 0;
            local_b8 = uVar4;
            local_a8 = iVar16;
            local_a0 = lVar7;
            if ((&local_e8 < puVar11) && (puVar12 <= &local_e8)) {
              lVar15 = ((longlong)&local_e8 - (longlong)puVar12) +
                       SUB168(SEXT816(-0x7777777777777777) *
                              SEXT816((longlong)&local_e8 - (longlong)puVar12),8);
              if (puVar11 == local_118) {
                FUN_14023afd0(&local_128);
                puVar11 = local_120;
                puVar12 = local_128;
              }
              local_res18 = puVar11;
              local_68 = puVar11;
              if (puVar11 != (undefined8 *)0x0) {
                FUN_14023b900(puVar11,puVar12 + ((lVar15 >> 6) - (lVar15 >> 0x3f)) * 0xf);
              }
            }
            else {
              if (puVar11 == local_118) {
                FUN_14023afd0(&local_128);
                puVar11 = local_120;
                puVar12 = local_128;
              }
              local_res18 = puVar11;
              local_68 = puVar11;
              if (puVar11 != (undefined8 *)0x0) {
                FUN_14023b900(puVar11,&local_e8);
              }
            }
            puVar11 = puVar11 + 0xf;
            local_120 = puVar11;
            if (7 < local_c8) {
              operator_delete((void *)CONCAT62(uStack_de,local_e0));
            }
            uVar14 = uVar14 - 1;
            lVar15 = local_108;
          } while (uVar14 != 0);
        }
        local_res10 = local_res10 + 1;
        local_res20 = local_res20 + 0x28;
        local_108 = lVar15 + 4;
      } while (local_res10 < (int)(*(longlong *)(lVar5 + 0x68) - *(longlong *)(lVar5 + 0x60) >> 2));
      if (puVar12 != puVar11) {
        FUN_140194130(*(undefined8 *)(param_1[0x3d0] + 0x48),&local_128);
      }
    }
    if (puVar12 != (undefined8 *)0x0) {
      FUN_140195ac0(puVar12,puVar11);
      operator_delete(puVar12);
    }
    uVar6 = 1;
  }
  return uVar6;
}



ulonglong FUN_140235770(longlong *param_1)

{
  uint uVar1;
  longlong lVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[0x3d0];
  if (((uVar3 != 0) && (*(longlong *)(uVar3 + 0x30) != 0)) &&
     (lVar2 = *(longlong *)(*(longlong *)(uVar3 + 0x30) + 0x2d0), uVar3 = 0, lVar2 != 0)) {
    uVar1 = *(uint *)(lVar2 + 0x4bc);
    uVar3 = (ulonglong)uVar1;
    if (((uVar1 == 2) || (uVar1 == 8)) || ((uVar1 == 9 || (uVar1 == 10)))) {
      if ((double)param_1[0xa2] - (double)param_1[0x3cb] < 0.7) {
                    // WARNING: Could not recover jumptable at 0x0001402357d3. Too many branches
                    // WARNING: Treating indirect jump as call
        uVar3 = (**(code **)(*param_1 + 200))(0x3fe6666666666666,0x30);
        return uVar3;
      }
                    // WARNING: Could not recover jumptable at 0x0001402357df. Too many branches
                    // WARNING: Treating indirect jump as call
      uVar3 = (**(code **)(*param_1 + 200))(0x3fe6666666666666,0x31);
      return uVar3;
    }
  }
  return uVar3 & 0xffffffffffffff00;
}



void FUN_1402357f0(longlong *param_1)

{
  if (*(int *)(param_1[0x27b] + 0x140) != 0) {
    *(undefined4 *)(param_1[0x27b] + 0x140) = 0;
    (**(code **)(*param_1 + 0x468))(param_1,0);
  }
  return;
}



longlong FUN_140235820(longlong param_1)

{
  return *(longlong *)(param_1 + 0x13d8) + 0x144;
}



void FUN_140235830(longlong param_1)

{
  int *piVar1;
  float fVar2;
  byte bVar3;
  byte bVar4;
  undefined4 uVar5;
  void *pvVar6;
  int iVar7;
  undefined8 uVar8;
  longlong lVar9;
  longlong *plVar10;
  longlong *plVar11;
  undefined8 *puVar12;
  bool bVar13;
  undefined8 *local_28;
  undefined8 *local_20;
  undefined8 *local_18;
  undefined8 *local_10;
  
  uVar5 = *(undefined4 *)(param_1 + 300);
  switch(uVar5) {
  case 10:
  case 0xe:
  case 0xf:
  case 0x10:
  case 0x12:
  case 0x14:
  case 0x15:
  case 0x16:
  case 0x3b:
    bVar3 = *(byte *)(param_1 + 0x601);
    plVar11 = (longlong *)(param_1 + 0x14c8);
    bVar4 = *(byte *)(param_1 + 0x600);
    if (7 < *(ulonglong *)(param_1 + 0x14e0)) {
      plVar11 = (longlong *)*plVar11;
    }
    puVar12 = *(undefined8 **)(param_1 + 0x1c88);
    if (puVar12 == (undefined8 *)0x0) {
LAB_140235984:
      uVar8 = 0;
    }
    else {
      if (puVar12 != *(undefined8 **)(param_1 + 0x1c90)) {
        iVar7 = DAT_140608150 + 1;
        bVar13 = DAT_140608150 == 0;
        DAT_140608150 = iVar7;
        if (bVar13) {
          FUN_140176d60(1);
        }
        goto LAB_140235984;
      }
      uVar8 = *puVar12;
    }
    plVar10 = (longlong *)
              FUN_140278700(uVar8,&local_18,plVar11,*(undefined4 *)(param_1 + 0x1c08),uVar5,
                            bVar3 | bVar4,*(undefined1 *)(param_1 + 0x2098));
    plVar11 = (longlong *)*plVar10;
    if (plVar11 == (longlong *)0x0) {
LAB_1402359d7:
      lVar9 = 0;
    }
    else {
      if (plVar11 != (longlong *)plVar10[1]) {
        iVar7 = DAT_140608154 + 1;
        bVar13 = DAT_140608154 == 0;
        DAT_140608154 = iVar7;
        if (bVar13) {
          FUN_140176d60(1);
        }
        goto LAB_1402359d7;
      }
      lVar9 = *plVar11;
    }
    puVar12 = local_18;
    if (local_18 != (undefined8 *)0x0) {
      if (local_18 == local_10) {
        if (local_18 != (undefined8 *)0x0) {
          LOCK();
          piVar1 = (int *)(local_18 + 1);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            local_18 = (undefined8 *)0x0;
            goto LAB_140235a28;
          }
        }
      }
      else {
        iVar7 = DAT_1406080b4 + 1;
        bVar13 = DAT_1406080b4 == 0;
        DAT_1406080b4 = iVar7;
        if (bVar13) {
          FUN_140176d60(1);
        }
      }
    }
    break;
  case 0xb:
  case 0xc:
  case 0x11:
  case 0x13:
  case 0x17:
  case 0x18:
  case 0x19:
  case 0x1a:
  case 0x1b:
  case 0x1c:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x20:
  case 0x21:
  case 0x22:
  case 0x23:
  case 0x24:
  case 0x25:
  case 0x26:
  case 0x27:
  case 0x28:
  case 0x29:
  case 0x2a:
  case 0x2b:
  case 0x2c:
  case 0x2d:
  case 0x2e:
  case 0x2f:
  case 0x30:
  case 0x31:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x35:
  case 0x36:
  case 0x37:
  case 0x38:
  case 0x39:
  case 0x3a:
    goto switchD_140235874_caseD_b;
  case 0xd:
    bVar3 = *(byte *)(param_1 + 0x601);
    plVar11 = (longlong *)(param_1 + 0x14f0);
    bVar4 = *(byte *)(param_1 + 0x600);
    if (7 < *(ulonglong *)(param_1 + 0x1508)) {
      plVar11 = (longlong *)*plVar11;
    }
    uVar8 = FUN_14020d8c0(param_1 + 0x1c88);
    uVar8 = FUN_140278700(uVar8,&local_28,plVar11,*(undefined4 *)(param_1 + 0x1c08),uVar5,
                          bVar3 | bVar4,*(undefined1 *)(param_1 + 0x2098));
    lVar9 = FUN_14020e650(uVar8);
    puVar12 = local_28;
    if (local_28 != (undefined8 *)0x0) {
      if (local_28 == local_20) {
        if (local_28 == (undefined8 *)0x0) break;
        LOCK();
        piVar1 = (int *)(local_28 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 != 0) break;
        local_28 = (undefined8 *)0x0;
LAB_140235a28:
        pvVar6 = (void *)*puVar12;
        if (pvVar6 != (void *)0x0) {
          FUN_140197310(pvVar6);
          operator_delete(pvVar6);
        }
        operator_delete(puVar12);
      }
      else {
        iVar7 = DAT_1406080b4 + 1;
        bVar13 = DAT_1406080b4 == 0;
        DAT_1406080b4 = iVar7;
        if (bVar13) {
          FUN_140176d60(1);
        }
      }
    }
    break;
  default:
    goto switchD_140235874_default;
  }
  if (lVar9 != 0) {
    fVar2 = *(float *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x4c);
    if (*(char *)(param_1 + 0x1eb4) == '\0') {
      if (*(float *)(lVar9 + 0xf4) <= fVar2) {
        *(undefined1 *)(param_1 + 0x1eb4) = 1;
        iVar7 = *(int *)(lVar9 + 0xf0);
        *(int *)(param_1 + 0x1eb0) = iVar7;
        if (iVar7 == 10000) {
          *(undefined1 *)(param_1 + 0xcd0) = 1;
        }
        else {
          if (iVar7 != 20000) goto LAB_140235a7b;
          *(undefined1 *)(param_1 + 0xcd1) = 1;
        }
      }
    }
    else if (*(float *)(lVar9 + 0xf8) <= fVar2) {
      *(undefined4 *)(param_1 + 0x1eb0) = 0;
LAB_140235a7b:
      *(undefined2 *)(param_1 + 0xcd0) = 0;
    }
  }
switchD_140235874_caseD_b:
switchD_140235874_default:
  return;
}



undefined8 FUN_140235b20(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar2 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar2;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  plVar2 = *(longlong **)(param_1 + 0x1f28);
  while( true ) {
    if (plVar2 == *(longlong **)(param_1 + 0x1f30)) {
      if (bVar7) {
        FUN_14034edd0(lVar5);
      }
      return 0;
    }
    if (*(int *)(*plVar2 + 8) == param_2) break;
    plVar2 = plVar2 + 1;
  }
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return 1;
}



void FUN_140235c20(longlong *param_1,undefined8 param_2,longlong param_3,longlong *param_4,
                  undefined4 param_5,undefined4 param_6,longlong *param_7)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined8 in_stack_ffffffffffffffa8;
  undefined4 uVar7;
  
  uVar3 = *(undefined4 *)(param_3 + 8);
  puVar6 = (undefined8 *)*param_4;
  if (puVar6 != (undefined8 *)param_4[1]) {
    do {
      iVar2 = FUN_14026ba30(*puVar6,uVar3);
      if (iVar2 != 0) {
        FUN_14026bb70(param_3);
        if ((DAT_14060b7c4 & 1) == 0) {
          DAT_14060b7c4 = DAT_14060b7c4 | 1;
          FUN_140418590();
          atexit((_func_5014 *)&LAB_140448470);
        }
        if (DAT_14060a120 != 1000) {
          return;
        }
        lVar4 = param_1[0x3d0];
        if (lVar4 == 0) {
          return;
        }
        local_res18[0] = 199;
        goto LAB_140235d5e;
      }
      puVar6 = puVar6 + 1;
    } while (puVar6 != (undefined8 *)param_4[1]);
  }
  uVar3 = *(undefined4 *)(param_3 + 8);
  puVar6 = (undefined8 *)*param_4;
  if (puVar6 != (undefined8 *)param_4[1]) {
    do {
      cVar1 = FUN_14026b7e0(*puVar6,uVar3);
      if (cVar1 != '\0') {
        FUN_14026bb70(param_3);
        if ((DAT_14060b7c4 & 1) == 0) {
          DAT_14060b7c4 = DAT_14060b7c4 | 1;
          FUN_140418590();
          atexit((_func_5014 *)&LAB_140448470);
        }
        if (DAT_14060a120 != 1000) {
          return;
        }
        lVar4 = param_1[0x3d0];
        if (lVar4 == 0) {
          return;
        }
        local_res18[0] = 200;
LAB_140235d5e:
        local_res20[0] = 0x9c50;
        plVar5 = (longlong *)(**(longlong **)(lVar4 + 0x48) + 0x78);
        (**(code **)(*plVar5 + 0x70))
                  (plVar5,(int)param_1[0x25],&DAT_1405d85a0,local_res20,local_res18);
        return;
      }
      puVar6 = puVar6 + 1;
    } while (puVar6 != (undefined8 *)param_4[1]);
  }
  uVar7 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);
  uVar3 = *(undefined4 *)(param_3 + 8);
  puVar6 = (undefined8 *)*param_4;
  if (puVar6 != (undefined8 *)param_4[1]) {
    do {
      FUN_14026b8f0(*puVar6,uVar3);
      uVar7 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);
      puVar6 = puVar6 + 1;
    } while (puVar6 != (undefined8 *)param_4[1]);
  }
  *(longlong *)(param_3 + 0x98) = param_1[0x3d0];
  lVar4 = param_1[0x25];
  uVar3 = (**(code **)(*param_1 + 0xb0))(param_1);
  FUN_14026bc90(param_3,param_2,(int)lVar4,uVar3,CONCAT44(uVar7,param_5),param_6,0);
  *(longlong **)(param_3 + 0x48) = param_1;
  if (param_7 != (longlong *)0x0) {
    *(longlong **)(param_3 + 0x50) = param_7;
    *(int *)(param_3 + 0x58) = (int)param_7[0x25];
    uVar3 = (**(code **)(*param_7 + 0xb0))();
    *(undefined4 *)(param_3 + 0x5c) = uVar3;
  }
  return;
}



void FUN_140235e60(longlong param_1,undefined8 param_2,longlong param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  bool bVar6;
  longlong local_res18;
  
  lVar3 = 0;
  bVar6 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  local_res18 = param_3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar3 = 0;
      if (lVar4 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar6 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar6) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        FUN_14034ed40(lVar4);
        bVar6 = true;
        lVar3 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar5 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_3 != 0) {
    *(undefined4 *)(param_3 + 0x6c) = 4;
  }
  FUN_140235c20(param_1,param_2,param_3,param_1 + 0x1f68,0,0,param_1);
  FUN_1401959b0(param_1 + 0x1f68,&local_res18);
  if (bVar6) {
    FUN_14034edd0(lVar3);
  }
  return;
}



void FUN_140235f90(longlong param_1,undefined8 param_2,longlong param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  bool bVar6;
  longlong local_res18;
  
  lVar3 = 0;
  bVar6 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  local_res18 = param_3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar3 = 0;
      if (lVar4 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar6 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar6) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        FUN_14034ed40(lVar4);
        bVar6 = true;
        lVar3 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar5 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_3 != 0) {
    *(undefined4 *)(param_3 + 0x6c) = 8;
  }
  FUN_140235c20(param_1,param_2,param_3,param_1 + 0x1fa8,0,0,param_1);
  FUN_1401959b0(param_1 + 0x1fa8,&local_res18);
  if (bVar6) {
    FUN_14034edd0(lVar3);
  }
  return;
}



void FUN_1402360c0(longlong param_1,undefined8 param_2,longlong param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  bool bVar6;
  longlong local_res18;
  
  lVar3 = 0;
  bVar6 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  local_res18 = param_3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar3 = 0;
      if (lVar4 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar6 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar6) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        FUN_14034ed40(lVar4);
        bVar6 = true;
        lVar3 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar5 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_3 != 0) {
    *(undefined4 *)(param_3 + 0x6c) = 2;
  }
  FUN_140235c20(param_1,param_2,param_3,param_1 + 0x1f08,0,0,param_1);
  FUN_1401959b0(param_1 + 0x1f08,&local_res18);
  if (bVar6) {
    FUN_14034edd0(lVar3);
  }
  return;
}



bool FUN_1402361f0(longlong param_1,undefined8 param_2,longlong param_3,undefined1 *param_4)

{
  longlong lVar1;
  longlong local_res18;
  
  lVar1 = param_1 + 0x12f8;
  local_res18 = param_3;
  FUN_14034ed40(lVar1);
  if (param_3 != 0) {
    *(undefined4 *)(param_3 + 0x6c) = 7;
    FUN_140235c20(param_1,param_2,param_3,param_1 + 0x1fe8,*(undefined4 *)(param_4 + 5),*param_4,
                  param_1);
    FUN_1402362d0(param_1,param_3);
    FUN_1401959b0(param_1 + 0x1fe8,&local_res18);
    FUN_14034edd0(lVar1);
  }
  else {
    FUN_14034edd0(lVar1);
  }
  return param_3 != 0;
}



undefined8 FUN_1402362d0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  void *_Dst;
  longlong local_res10 [3];
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x12f8;
  local_res10[0] = param_2;
  lVar3 = lVar1;
  FUN_14034ed40(lVar1);
  if (local_res10[0] == 0) {
    FUN_14034edd0(lVar1);
    uVar2 = 0;
  }
  else if (*(int *)(local_res10[0] + 0xc) == 0xd1) {
    _Dst = (void *)FUN_14023b770(*(undefined8 *)(param_1 + 0x1fe8),*(undefined8 *)(param_1 + 0x1ff0)
                                 ,local_res10,param_4,uVar2,lVar3,1);
    if (*(void **)(param_1 + 0x1ff0) == _Dst) {
      FUN_14034edd0(lVar1);
      uVar2 = 0;
    }
    else {
      memmove(_Dst,(void *)((longlong)_Dst + 8),
              *(longlong *)(param_1 + 0x1ff0) - ((longlong)_Dst + 8) & 0xfffffffffffffff8);
      *(longlong *)(param_1 + 0x1ff0) = *(longlong *)(param_1 + 0x1ff0) + -8;
      FUN_14034edd0(lVar1);
      uVar2 = 1;
    }
  }
  else {
    FUN_14034edd0(lVar1);
    uVar2 = 0;
  }
  return uVar2;
}



bool FUN_1402363a0(longlong param_1,undefined4 *param_2,int param_3)

{
  longlong lVar1;
  longlong *plVar2;
  int iVar3;
  longlong *plVar4;
  bool bVar5;
  undefined4 uVar6;
  
  lVar1 = param_1 + 0x12f8;
  FUN_14034ed40(lVar1);
  plVar2 = *(longlong **)(param_1 + 0x1ff0);
  plVar4 = *(longlong **)(param_1 + 0x1fe8);
  while ((plVar4 != plVar2 &&
         (((longlong *)*plVar4 == (longlong *)0x0 ||
          (iVar3 = (**(code **)(*(longlong *)*plVar4 + 0x78))(), param_3 != iVar3))))) {
    plVar4 = plVar4 + 1;
  }
  bVar5 = *(longlong **)(param_1 + 0x1ff0) != plVar4;
  if (bVar5) {
    uVar6 = (**(code **)(*(longlong *)*plVar4 + 0x80))();
    *param_2 = uVar6;
    FUN_14034edd0(lVar1);
  }
  else {
    FUN_14034edd0(lVar1);
  }
  return bVar5;
}



void FUN_140236470(longlong param_1,int param_2,int param_3)

{
  code *pcVar1;
  int iVar2;
  ulonglong uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  ulonglong uVar8;
  longlong *plVar9;
  longlong lVar10;
  bool bVar11;
  bool bVar12;
  undefined8 uVar13;
  longlong lVar14;
  undefined1 uVar15;
  longlong *local_50;
  longlong *local_48;
  longlong *local_40;
  
  uVar13 = 0xfffffffffffffffe;
  lVar10 = 0;
  lVar14 = 0;
  bVar12 = false;
  uVar15 = 0;
  plVar4 = *(longlong **)(param_1 + 0x12e8);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar4;
      lVar10 = 0;
      if (lVar5 != 0) {
        if (plVar4 != *(longlong **)(param_1 + 0x12f0)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar12 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar12) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        lVar14 = lVar5;
        FUN_14034ed40();
        bVar12 = true;
        uVar15 = 1;
        lVar10 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar11) {
        FUN_140176d60();
      }
    }
  }
  plVar6 = (longlong *)0x0;
  local_50 = (longlong *)0x0;
  local_48 = (longlong *)0x0;
  plVar9 = (longlong *)0x0;
  local_40 = (longlong *)0x0;
  for (plVar4 = *(longlong **)(param_1 + 0x1f28); plVar4 != *(longlong **)(param_1 + 0x1f30);
      plVar4 = plVar4 + 1) {
    if ((plVar4 < local_48) && (plVar6 <= plVar4)) {
      lVar5 = (longlong)plVar4 - (longlong)plVar6;
      if (local_48 == plVar9) {
        uVar8 = (longlong)local_48 - (longlong)plVar6 >> 3;
        if (0x1ffffffffffffffe < uVar8) {
          std::_Xlength_error("vector<T> too long");
          pcVar1 = (code *)swi(3);
          (*pcVar1)();
          return;
        }
        uVar8 = uVar8 + 1;
        uVar3 = (longlong)plVar9 - (longlong)plVar6 >> 3;
        if (uVar3 < uVar8) {
          if (0x1fffffffffffffff - (uVar3 >> 1) < uVar3) {
            uVar3 = 0;
          }
          else {
            uVar3 = uVar3 + (uVar3 >> 1);
          }
          if (uVar3 < uVar8) {
            uVar3 = uVar8;
          }
          FUN_140195bb0(&local_50,uVar3,plVar6,uVar8,uVar13,lVar14,uVar15);
          plVar6 = local_50;
          plVar9 = local_40;
        }
      }
      if (local_48 != (longlong *)0x0) {
        lVar5 = plVar6[lVar5 >> 3];
LAB_140236653:
        *local_48 = lVar5;
      }
    }
    else {
      if (local_48 == plVar9) {
        uVar8 = (longlong)local_48 - (longlong)plVar6 >> 3;
        if (0x1ffffffffffffffe < uVar8) {
          std::_Xlength_error("vector<T> too long");
          pcVar1 = (code *)swi(3);
          (*pcVar1)();
          return;
        }
        uVar8 = uVar8 + 1;
        uVar3 = (longlong)plVar9 - (longlong)plVar6 >> 3;
        if (uVar3 < uVar8) {
          if (0x1fffffffffffffff - (uVar3 >> 1) < uVar3) {
            uVar3 = 0;
          }
          else {
            uVar3 = uVar3 + (uVar3 >> 1);
          }
          if (uVar3 < uVar8) {
            uVar3 = uVar8;
          }
          FUN_140195bb0(&local_50,uVar3,plVar6,uVar8,uVar13,lVar14,uVar15);
          plVar6 = local_50;
          plVar9 = local_40;
        }
      }
      if (local_48 != (longlong *)0x0) {
        lVar5 = *plVar4;
        goto LAB_140236653;
      }
    }
    local_48 = local_48 + 1;
  }
  plVar4 = *(longlong **)(param_1 + 0x1f88);
  plVar7 = plVar6;
  if (plVar4 != *(longlong **)(param_1 + 0x1f90)) {
    do {
      if ((plVar4 < local_48) && (plVar6 <= plVar4)) {
        lVar5 = (longlong)plVar4 - (longlong)plVar6;
        if (local_48 == plVar9) {
          uVar8 = (longlong)local_48 - (longlong)plVar6 >> 3;
          if (0x1ffffffffffffffe < uVar8) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar8 = uVar8 + 1;
          uVar3 = (longlong)plVar9 - (longlong)plVar6 >> 3;
          if (uVar3 < uVar8) {
            if (0x1fffffffffffffff - (uVar3 >> 1) < uVar3) {
              uVar3 = 0;
            }
            else {
              uVar3 = uVar3 + (uVar3 >> 1);
            }
            if (uVar3 < uVar8) {
              uVar3 = uVar8;
            }
            FUN_140195bb0(&local_50,uVar3,plVar6,uVar8,uVar13,lVar14,uVar15);
            plVar6 = local_50;
            plVar9 = local_40;
          }
        }
        if (local_48 != (longlong *)0x0) {
          lVar5 = plVar6[lVar5 >> 3];
LAB_140236774:
          *local_48 = lVar5;
        }
      }
      else {
        if (local_48 == plVar9) {
          uVar8 = (longlong)local_48 - (longlong)plVar6 >> 3;
          if (0x1ffffffffffffffe < uVar8) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar8 = uVar8 + 1;
          uVar3 = (longlong)plVar9 - (longlong)plVar6 >> 3;
          if (uVar3 < uVar8) {
            if (0x1fffffffffffffff - (uVar3 >> 1) < uVar3) {
              uVar3 = 0;
            }
            else {
              uVar3 = uVar3 + (uVar3 >> 1);
            }
            if (uVar3 < uVar8) {
              uVar3 = uVar8;
            }
            FUN_140195bb0(&local_50,uVar3,plVar6,uVar8,uVar13,lVar14,uVar15);
            plVar6 = local_50;
            plVar9 = local_40;
          }
        }
        if (local_48 != (longlong *)0x0) {
          lVar5 = *plVar4;
          goto LAB_140236774;
        }
      }
      local_48 = local_48 + 1;
      plVar4 = plVar4 + 1;
      plVar7 = plVar6;
    } while (plVar4 != *(longlong **)(param_1 + 0x1f90));
  }
  for (; plVar6 != local_48; plVar6 = plVar6 + 1) {
    lVar14 = *plVar6;
    if ((*(int *)(lVar14 + 0x58) == param_2) && (*(int *)(lVar14 + 0x5c) == param_3)) {
      *(undefined8 *)(lVar14 + 0x50) = 0;
      *(undefined4 *)(lVar14 + 0x58) = 0;
    }
  }
  if (plVar7 != (longlong *)0x0) {
    operator_delete(plVar7);
  }
  if (bVar12) {
    FUN_14034edd0(lVar10);
  }
  return;
}



void FUN_140236830(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
                  undefined4 param_5,undefined4 param_6)

{
  longlong *plVar1;
  code *pcVar2;
  int iVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 *puVar8;
  ulonglong uVar9;
  undefined8 *puVar10;
  longlong lVar11;
  bool bVar12;
  bool bVar13;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined8 *local_60;
  undefined8 *local_58;
  undefined8 *local_50;
  
  lVar11 = 0;
  bVar13 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  local_res18 = param_3;
  local_res20 = param_4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar7 = *plVar1;
      lVar11 = 0;
      if (lVar7 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar13 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar13) {
            FUN_140176d60(1);
          }
          lVar7 = 0;
        }
        FUN_14034ed40();
        bVar13 = true;
        lVar11 = lVar7;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar12) {
        FUN_140176d60();
      }
    }
  }
  puVar8 = (undefined8 *)0x0;
  local_60 = (undefined8 *)0x0;
  local_58 = (undefined8 *)0x0;
  puVar10 = (undefined8 *)0x0;
  local_50 = (undefined8 *)0x0;
  for (puVar6 = *(undefined8 **)(param_1 + 0x1f28); puVar6 != *(undefined8 **)(param_1 + 0x1f30);
      puVar6 = puVar6 + 1) {
    if ((puVar6 < local_58) && (puVar8 <= puVar6)) {
      lVar7 = (longlong)puVar6 - (longlong)puVar8;
      if (local_58 == puVar10) {
        uVar9 = (longlong)local_58 - (longlong)puVar8 >> 3;
        if (0x1ffffffffffffffe < uVar9) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        uVar9 = uVar9 + 1;
        uVar5 = (longlong)puVar10 - (longlong)puVar8 >> 3;
        if (uVar5 < uVar9) {
          if (0x1fffffffffffffff - (uVar5 >> 1) < uVar5) {
            uVar5 = 0;
          }
          else {
            uVar5 = uVar5 + (uVar5 >> 1);
          }
          if (uVar5 < uVar9) {
            uVar5 = uVar9;
          }
          FUN_140195bb0(&local_60,uVar5);
          puVar8 = local_60;
          puVar10 = local_50;
        }
      }
      if (local_58 != (undefined8 *)0x0) {
        uVar4 = puVar8[lVar7 >> 3];
LAB_140236a15:
        *local_58 = uVar4;
      }
    }
    else {
      if (local_58 == puVar10) {
        uVar9 = (longlong)local_58 - (longlong)puVar8 >> 3;
        if (0x1ffffffffffffffe < uVar9) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        uVar9 = uVar9 + 1;
        uVar5 = (longlong)puVar10 - (longlong)puVar8 >> 3;
        if (uVar5 < uVar9) {
          if (0x1fffffffffffffff - (uVar5 >> 1) < uVar5) {
            uVar5 = 0;
          }
          else {
            uVar5 = uVar5 + (uVar5 >> 1);
          }
          if (uVar5 < uVar9) {
            uVar5 = uVar9;
          }
          FUN_140195bb0(&local_60,uVar5);
          puVar8 = local_60;
          puVar10 = local_50;
        }
      }
      if (local_58 != (undefined8 *)0x0) {
        uVar4 = *puVar6;
        goto LAB_140236a15;
      }
    }
    local_58 = local_58 + 1;
  }
  puVar6 = *(undefined8 **)(param_1 + 0x1f88);
  if (puVar6 != *(undefined8 **)(param_1 + 0x1f90)) {
    do {
      if ((puVar6 < local_58) && (puVar8 <= puVar6)) {
        lVar7 = (longlong)puVar6 - (longlong)puVar8;
        if (local_58 == puVar10) {
          uVar9 = (longlong)local_58 - (longlong)puVar8 >> 3;
          if (0x1ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar5 = (longlong)puVar10 - (longlong)puVar8 >> 3;
          if (uVar5 < uVar9) {
            if (0x1fffffffffffffff - (uVar5 >> 1) < uVar5) {
              uVar5 = 0;
            }
            else {
              uVar5 = uVar5 + (uVar5 >> 1);
            }
            if (uVar5 < uVar9) {
              uVar5 = uVar9;
            }
            FUN_140195bb0(&local_60,uVar5);
            puVar8 = local_60;
            puVar10 = local_50;
          }
        }
        if (local_58 != (undefined8 *)0x0) {
          uVar4 = puVar8[lVar7 >> 3];
LAB_140236b3d:
          *local_58 = uVar4;
        }
      }
      else {
        if (local_58 == puVar10) {
          uVar9 = (longlong)local_58 - (longlong)puVar8 >> 3;
          if (0x1ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar5 = (longlong)puVar10 - (longlong)puVar8 >> 3;
          if (uVar5 < uVar9) {
            if (0x1fffffffffffffff - (uVar5 >> 1) < uVar5) {
              uVar5 = 0;
            }
            else {
              uVar5 = uVar5 + (uVar5 >> 1);
            }
            if (uVar5 < uVar9) {
              uVar5 = uVar9;
            }
            FUN_140195bb0(&local_60,uVar5);
            puVar8 = local_60;
            puVar10 = local_50;
          }
        }
        if (local_58 != (undefined8 *)0x0) {
          uVar4 = *puVar6;
          goto LAB_140236b3d;
        }
      }
      local_58 = local_58 + 1;
      puVar6 = puVar6 + 1;
    } while (puVar6 != *(undefined8 **)(param_1 + 0x1f90));
  }
  uVar4 = local_res18;
  FUN_140235c20(param_1,param_2,local_res18,&local_60,param_5,param_6,local_res20);
  puVar6 = *(undefined8 **)(param_1 + 0x1f90);
  if ((&local_res18 < puVar6) &&
     (puVar10 = *(undefined8 **)(param_1 + 0x1f88), puVar10 <= &local_res18)) {
    if (puVar6 == *(undefined8 **)(param_1 + 0x1f98)) {
      FUN_140195b20(param_1 + 0x1f88);
    }
    if (*(undefined8 **)(param_1 + 0x1f90) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x1f90) =
           *(undefined8 *)
            (*(longlong *)(param_1 + 0x1f88) + ((longlong)&local_res18 - (longlong)puVar10 >> 3) * 8
            );
    }
  }
  else {
    if (puVar6 == *(undefined8 **)(param_1 + 0x1f98)) {
      FUN_140195b20(param_1 + 0x1f88);
    }
    if (*(undefined8 **)(param_1 + 0x1f90) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x1f90) = uVar4;
    }
  }
  *(longlong *)(param_1 + 0x1f90) = *(longlong *)(param_1 + 0x1f90) + 8;
  if (puVar8 != (undefined8 *)0x0) {
    operator_delete(puVar8);
  }
  if (bVar13) {
    FUN_14034edd0(lVar11);
  }
  return;
}



undefined8 FUN_140236c80(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined8 uVar8;
  bool bVar9;
  bool bVar10;
  
  uVar8 = 0;
  lVar4 = 0;
  bVar10 = false;
  plVar3 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar3;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar3 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar10)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar10 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(longlong **)(param_1 + 0x1f08) != *(longlong **)(param_1 + 0x1f10)) &&
     (plVar3 = *(longlong **)(param_1 + 0x1f08), plVar3 != *(longlong **)(param_1 + 0x1f10))) {
    do {
      if ((int)((longlong *)*plVar3)[1] == param_2) {
        (**(code **)(*(longlong *)*plVar3 + 0x68))();
        uVar8 = 1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != *(longlong **)(param_1 + 0x1f10));
  }
  if ((*(longlong **)(param_1 + 0x1f28) != *(longlong **)(param_1 + 0x1f30)) &&
     (plVar3 = *(longlong **)(param_1 + 0x1f28), plVar3 != *(longlong **)(param_1 + 0x1f30))) {
    do {
      if ((int)((longlong *)*plVar3)[1] == param_2) {
        (**(code **)(*(longlong *)*plVar3 + 0x68))();
        uVar8 = 1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != *(longlong **)(param_1 + 0x1f30));
  }
  if ((*(longlong **)(param_1 + 0x1f48) != *(longlong **)(param_1 + 0x1f50)) &&
     (plVar3 = *(longlong **)(param_1 + 0x1f48), plVar3 != *(longlong **)(param_1 + 0x1f50))) {
    do {
      if ((int)((longlong *)*plVar3)[1] == param_2) {
        (**(code **)(*(longlong *)*plVar3 + 0x68))();
        uVar8 = 1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != *(longlong **)(param_1 + 0x1f50));
  }
  if ((*(longlong **)(param_1 + 0x1f68) != *(longlong **)(param_1 + 0x1f70)) &&
     (plVar3 = *(longlong **)(param_1 + 0x1f68), plVar3 != *(longlong **)(param_1 + 0x1f70))) {
    do {
      if ((int)((longlong *)*plVar3)[1] == param_2) {
        (**(code **)(*(longlong *)*plVar3 + 0x68))();
        uVar8 = 1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != *(longlong **)(param_1 + 0x1f70));
  }
  if ((*(longlong **)(param_1 + 0x1fa8) != *(longlong **)(param_1 + 0x1fb0)) &&
     (plVar3 = *(longlong **)(param_1 + 0x1fa8), plVar3 != *(longlong **)(param_1 + 0x1fb0))) {
    do {
      if ((int)((longlong *)*plVar3)[1] == param_2) {
        (**(code **)(*(longlong *)*plVar3 + 0x68))();
        uVar8 = 1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != *(longlong **)(param_1 + 0x1fb0));
  }
  if ((*(longlong **)(param_1 + 0x1fc8) != *(longlong **)(param_1 + 0x1fd0)) &&
     (plVar3 = *(longlong **)(param_1 + 0x1fc8), plVar3 != *(longlong **)(param_1 + 0x1fd0))) {
    do {
      if ((int)((longlong *)*plVar3)[1] == param_2) {
        (**(code **)(*(longlong *)*plVar3 + 0x68))();
        uVar8 = 1;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != *(longlong **)(param_1 + 0x1fd0));
  }
  if (bVar10) {
    FUN_14034edd0(lVar6);
  }
  FUN_14034ed40(param_1 + 0x12f8);
  plVar3 = *(longlong **)(param_1 + 0x1ff0);
  if (*(longlong **)(param_1 + 0x1fe8) != plVar3) {
    for (plVar7 = *(longlong **)(param_1 + 0x1fe8); plVar7 != plVar3; plVar7 = plVar7 + 1) {
      plVar1 = (longlong *)*plVar7;
      if ((plVar1 != (longlong *)0x0) && (param_2 == (int)plVar1[1])) {
        (**(code **)(*plVar1 + 0x68))();
        uVar8 = 1;
      }
    }
  }
  FUN_14034edd0(param_1 + 0x12f8);
  return uVar8;
}



void FUN_140236f40(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  code *pcVar2;
  int iVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 *puVar8;
  ulonglong uVar9;
  undefined8 *puVar10;
  longlong lVar11;
  bool bVar12;
  bool bVar13;
  undefined8 local_res18 [2];
  undefined8 *local_60;
  undefined8 *local_58;
  undefined8 *local_50;
  
  lVar11 = 0;
  bVar13 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  local_res18[0] = param_3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar7 = *plVar1;
      lVar11 = 0;
      if (lVar7 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar13 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar13) {
            FUN_140176d60(1);
          }
          lVar7 = 0;
        }
        FUN_14034ed40();
        bVar13 = true;
        lVar11 = lVar7;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar12) {
        FUN_140176d60();
      }
    }
  }
  puVar8 = (undefined8 *)0x0;
  local_60 = (undefined8 *)0x0;
  local_58 = (undefined8 *)0x0;
  puVar10 = (undefined8 *)0x0;
  local_50 = (undefined8 *)0x0;
  for (puVar6 = *(undefined8 **)(param_1 + 0x1f28); puVar6 != *(undefined8 **)(param_1 + 0x1f30);
      puVar6 = puVar6 + 1) {
    if ((puVar6 < local_58) && (puVar8 <= puVar6)) {
      lVar7 = (longlong)puVar6 - (longlong)puVar8;
      if (local_58 == puVar10) {
        uVar9 = (longlong)local_58 - (longlong)puVar8 >> 3;
        if (0x1ffffffffffffffe < uVar9) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        uVar9 = uVar9 + 1;
        uVar5 = (longlong)puVar10 - (longlong)puVar8 >> 3;
        if (uVar5 < uVar9) {
          if (0x1fffffffffffffff - (uVar5 >> 1) < uVar5) {
            uVar5 = 0;
          }
          else {
            uVar5 = uVar5 + (uVar5 >> 1);
          }
          if (uVar5 < uVar9) {
            uVar5 = uVar9;
          }
          FUN_140195bb0(&local_60,uVar5);
          puVar8 = local_60;
          puVar10 = local_50;
        }
      }
      if (local_58 != (undefined8 *)0x0) {
        uVar4 = puVar8[lVar7 >> 3];
LAB_140237124:
        *local_58 = uVar4;
      }
    }
    else {
      if (local_58 == puVar10) {
        uVar9 = (longlong)local_58 - (longlong)puVar8 >> 3;
        if (0x1ffffffffffffffe < uVar9) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        uVar9 = uVar9 + 1;
        uVar5 = (longlong)puVar10 - (longlong)puVar8 >> 3;
        if (uVar5 < uVar9) {
          if (0x1fffffffffffffff - (uVar5 >> 1) < uVar5) {
            uVar5 = 0;
          }
          else {
            uVar5 = uVar5 + (uVar5 >> 1);
          }
          if (uVar5 < uVar9) {
            uVar5 = uVar9;
          }
          FUN_140195bb0(&local_60,uVar5);
          puVar8 = local_60;
          puVar10 = local_50;
        }
      }
      if (local_58 != (undefined8 *)0x0) {
        uVar4 = *puVar6;
        goto LAB_140237124;
      }
    }
    local_58 = local_58 + 1;
  }
  puVar6 = *(undefined8 **)(param_1 + 0x1f88);
  if (puVar6 != *(undefined8 **)(param_1 + 0x1f90)) {
    do {
      if ((puVar6 < local_58) && (puVar8 <= puVar6)) {
        lVar7 = (longlong)puVar6 - (longlong)puVar8;
        if (local_58 == puVar10) {
          uVar9 = (longlong)local_58 - (longlong)puVar8 >> 3;
          if (0x1ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar5 = (longlong)puVar10 - (longlong)puVar8 >> 3;
          if (uVar5 < uVar9) {
            if (0x1fffffffffffffff - (uVar5 >> 1) < uVar5) {
              uVar5 = 0;
            }
            else {
              uVar5 = uVar5 + (uVar5 >> 1);
            }
            if (uVar5 < uVar9) {
              uVar5 = uVar9;
            }
            FUN_140195bb0(&local_60,uVar5);
            puVar8 = local_60;
            puVar10 = local_50;
          }
        }
        if (local_58 != (undefined8 *)0x0) {
          uVar4 = puVar8[lVar7 >> 3];
LAB_140237245:
          *local_58 = uVar4;
        }
      }
      else {
        if (local_58 == puVar10) {
          uVar9 = (longlong)local_58 - (longlong)puVar8 >> 3;
          if (0x1ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            (*pcVar2)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar5 = (longlong)puVar10 - (longlong)puVar8 >> 3;
          if (uVar5 < uVar9) {
            if (0x1fffffffffffffff - (uVar5 >> 1) < uVar5) {
              uVar5 = 0;
            }
            else {
              uVar5 = uVar5 + (uVar5 >> 1);
            }
            if (uVar5 < uVar9) {
              uVar5 = uVar9;
            }
            FUN_140195bb0(&local_60,uVar5);
            puVar8 = local_60;
            puVar10 = local_50;
          }
        }
        if (local_58 != (undefined8 *)0x0) {
          uVar4 = *puVar6;
          goto LAB_140237245;
        }
      }
      local_58 = local_58 + 1;
      puVar6 = puVar6 + 1;
    } while (puVar6 != *(undefined8 **)(param_1 + 0x1f90));
  }
  uVar4 = local_res18[0];
  FUN_140235c20(param_1,param_2,local_res18[0],&local_60,0,0,0);
  puVar6 = *(undefined8 **)(param_1 + 0x1f90);
  if ((local_res18 < puVar6) &&
     (puVar10 = *(undefined8 **)(param_1 + 0x1f88), puVar10 <= local_res18)) {
    if (puVar6 == *(undefined8 **)(param_1 + 0x1f98)) {
      FUN_140195b20(param_1 + 0x1f88);
    }
    if (*(undefined8 **)(param_1 + 0x1f90) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x1f90) =
           *(undefined8 *)
            (*(longlong *)(param_1 + 0x1f88) + ((longlong)local_res18 - (longlong)puVar10 >> 3) * 8)
      ;
    }
  }
  else {
    if (puVar6 == *(undefined8 **)(param_1 + 0x1f98)) {
      FUN_140195b20(param_1 + 0x1f88);
    }
    if (*(undefined8 **)(param_1 + 0x1f90) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x1f90) = uVar4;
    }
  }
  *(longlong *)(param_1 + 0x1f90) = *(longlong *)(param_1 + 0x1f90) + 8;
  if (puVar8 != (undefined8 *)0x0) {
    operator_delete(puVar8);
  }
  if (bVar13) {
    FUN_14034edd0(lVar11);
  }
  return;
}



void FUN_140237380(longlong param_1,undefined8 param_2,longlong param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  longlong local_res18 [2];
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  local_res18[0] = param_3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_3 != 0) {
    *(undefined8 *)(param_3 + 0x40) = param_2;
    *(longlong *)(param_3 + 0x48) = param_1;
    *(undefined4 *)(param_3 + 0x6c) = 1;
    FUN_1401959b0(param_1 + 0x1f48,local_res18);
  }
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_140237480(longlong *param_1,undefined4 param_2,longlong *param_3,char param_4)

{
  float *pfVar1;
  float fVar2;
  float fVar3;
  longlong lVar4;
  int iVar5;
  undefined4 *puVar6;
  float local_28;
  float local_24;
  float local_20;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  if ((param_3 != (longlong *)0x0) && (lVar4 = *param_3, lVar4 != 0)) {
    switch(param_2) {
    case 0:
      local_28 = *(float *)(param_1 + 0x2f) - *(float *)(lVar4 + 0x68);
      local_24 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar4 + 0x6c);
      local_20 = *(float *)(param_1 + 0x30) - *(float *)(lVar4 + 0x70);
      *(float *)((longlong)param_1 + 0x1a44) = local_28;
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(float *)(param_1 + 0x349) = local_24;
      *(undefined1 *)(param_1 + 0x348) = 1;
      *(float *)((longlong)param_1 + 0x1a4c) = local_20;
      (**(code **)(*param_1 + 0x100))(param_1);
      break;
    case 1:
      if (param_4 != '\0') {
        local_28 = *(float *)(param_1 + 0x2f) - *(float *)(lVar4 + 0x68);
        local_24 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar4 + 0x6c);
        local_20 = *(float *)(param_1 + 0x30) - *(float *)(lVar4 + 0x70);
        *(float *)((longlong)param_1 + 0x1a44) = local_28;
        *(undefined1 *)(param_1 + 0x27f) = 1;
        *(float *)(param_1 + 0x349) = local_24;
        *(undefined1 *)(param_1 + 0x348) = 1;
        *(float *)((longlong)param_1 + 0x1a4c) = local_20;
        (**(code **)(*param_1 + 0x100))(param_1);
        return;
      }
      *(undefined1 *)(param_1 + 0x27f) = 0;
      *(undefined1 *)(param_1 + 0x348) = 0;
      break;
    case 2:
      pfVar1 = (float *)((longlong)param_1 + 0x1a44);
      fVar2 = *(float *)(lVar4 + 0x6c);
      fVar3 = *(float *)(lVar4 + 0x70);
      *pfVar1 = *(float *)(param_1 + 0x2f) - *(float *)(lVar4 + 0x68);
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(float *)(param_1 + 0x349) = *(float *)((longlong)param_1 + 0x17c) - fVar2;
      *(undefined1 *)(param_1 + 0x348) = 1;
      *(float *)((longlong)param_1 + 0x1a4c) = *(float *)(param_1 + 0x30) - fVar3;
      local_28 = -*pfVar1;
      local_20 = (float)(*(uint *)((longlong)param_1 + 0x1a4c) ^ 0x80000000);
      *pfVar1 = local_28;
      local_24 = (float)(*(uint *)(param_1 + 0x349) ^ 0x80000000);
      *(float *)(param_1 + 0x349) = local_24;
      *(float *)((longlong)param_1 + 0x1a4c) = local_20;
      (**(code **)(*param_1 + 0x100))(param_1);
      break;
    case 3:
      iVar5 = rand();
      local_14 = 0x3f800000;
      local_18 = 0;
      local_28 = *(float *)(param_1 + 0x2f) - *(float *)(lVar4 + 0x68);
      local_10 = 0;
      local_24 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar4 + 0x6c);
      local_20 = *(float *)(param_1 + 0x30) - *(float *)(lVar4 + 0x70);
      puVar6 = (undefined4 *)
               FUN_140123260(&local_28,&local_18,
                             (((float)iVar5 * 3.0517578e-05 * 330.0 + 20.0) * 3.1415927) / 180.0);
      *(undefined4 *)((longlong)param_1 + 0x1a44) = *puVar6;
      *(undefined4 *)(param_1 + 0x349) = puVar6[1];
      *(undefined4 *)((longlong)param_1 + 0x1a4c) = puVar6[2];
      *(undefined1 *)(param_1 + 0x27f) = 0;
      *(undefined1 *)(param_1 + 0x348) = 0;
      (**(code **)(*param_1 + 0x100))(param_1);
      D3DXVec3Normalize(&local_28,&local_28);
      break;
    case 4:
      (**(code **)(*param_1 + 0xa68))(param_1,4);
      break;
    case 5:
    case 0x14:
      local_28 = 0.0;
      local_24 = 0.0;
      *(undefined4 *)((longlong)param_1 + 0x1a44) = 0;
      *(undefined1 *)(param_1 + 0x27f) = 0;
      local_20 = 1.0;
      *(undefined4 *)(param_1 + 0x349) = 0;
      *(undefined1 *)(param_1 + 0x348) = 0;
      *(undefined4 *)((longlong)param_1 + 0x1a4c) = 0x3f800000;
      (**(code **)(*param_1 + 0x100))(param_1);
      break;
    case 0x1e:
      local_28 = *(float *)((longlong)param_1 + 0x1abc) - *(float *)(lVar4 + 0x68);
      local_24 = *(float *)(param_1 + 0x358) - *(float *)(lVar4 + 0x6c);
      local_20 = *(float *)((longlong)param_1 + 0x1ac4) - *(float *)(lVar4 + 0x70);
      *(float *)((longlong)param_1 + 0x1a44) = local_28;
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(float *)(param_1 + 0x349) = local_24;
      *(undefined1 *)(param_1 + 0x348) = 1;
      *(float *)((longlong)param_1 + 0x1a4c) = local_20;
      (**(code **)(*param_1 + 0x100))(param_1);
      break;
    case 100:
    case 200:
    case 0xc9:
    case 0xca:
    case 0xcb:
    case 0xcc:
    case 0xcd:
    case 0xce:
    case 0xcf:
    case 0xd0:
    case 0xd1:
      (**(code **)(*param_1 + 0xa78))(param_1,param_2);
    }
    *(undefined4 *)((longlong)param_1 + 0x1ec4) = param_2;
  }
  return;
}



void FUN_140237940(longlong *param_1,undefined4 param_2,longlong param_3,char param_4)

{
  float *pfVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  undefined4 *puVar5;
  float local_28;
  float local_24;
  float local_20;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  switch(param_2) {
  case 0:
    local_24 = *(float *)((longlong)param_1 + 0x17c);
    local_28 = *(float *)(param_1 + 0x2f) - *(float *)(param_3 + 0x178);
    local_20 = *(float *)(param_1 + 0x30);
    goto LAB_1402379af;
  case 1:
    if (param_4 != '\0') {
      local_28 = *(float *)(param_1 + 0x2f) - *(float *)(param_3 + 0x178);
      local_24 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(param_3 + 0x17c);
      local_20 = *(float *)(param_1 + 0x30) - *(float *)(param_3 + 0x180);
      *(float *)((longlong)param_1 + 0x1a44) = local_28;
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(float *)(param_1 + 0x349) = local_24;
      *(undefined1 *)(param_1 + 0x348) = 1;
      *(float *)((longlong)param_1 + 0x1a4c) = local_20;
      (**(code **)(*param_1 + 0x100))(param_1);
      return;
    }
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined1 *)(param_1 + 0x348) = 0;
    break;
  case 2:
    pfVar1 = (float *)((longlong)param_1 + 0x1a44);
    fVar2 = *(float *)(param_3 + 0x17c);
    fVar3 = *(float *)(param_3 + 0x180);
    *pfVar1 = *(float *)(param_1 + 0x2f) - *(float *)(param_3 + 0x178);
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(float *)(param_1 + 0x349) = *(float *)((longlong)param_1 + 0x17c) - fVar2;
    *(undefined1 *)(param_1 + 0x348) = 1;
    *(float *)((longlong)param_1 + 0x1a4c) = *(float *)(param_1 + 0x30) - fVar3;
    local_28 = -*pfVar1;
    local_20 = (float)(*(uint *)((longlong)param_1 + 0x1a4c) ^ 0x80000000);
    *pfVar1 = local_28;
    local_24 = (float)(*(uint *)(param_1 + 0x349) ^ 0x80000000);
    *(float *)(param_1 + 0x349) = local_24;
    *(float *)((longlong)param_1 + 0x1a4c) = local_20;
    (**(code **)(*param_1 + 0x100))(param_1);
    break;
  case 3:
    iVar4 = rand();
    local_14 = 0x3f800000;
    local_18 = 0;
    local_28 = *(float *)(param_1 + 0x2f) - *(float *)(param_3 + 0x178);
    local_10 = 0;
    local_24 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(param_3 + 0x17c);
    local_20 = *(float *)(param_1 + 0x30) - *(float *)(param_3 + 0x180);
    puVar5 = (undefined4 *)
             FUN_140123260(&local_28,&local_18,
                           (((float)iVar4 * 3.0517578e-05 * 330.0 + 20.0) * 3.1415927) / 180.0);
    *(undefined4 *)((longlong)param_1 + 0x1a44) = *puVar5;
    *(undefined4 *)(param_1 + 0x349) = puVar5[1];
    *(undefined4 *)((longlong)param_1 + 0x1a4c) = puVar5[2];
    *(undefined1 *)(param_1 + 0x27f) = 0;
    *(undefined1 *)(param_1 + 0x348) = 0;
    (**(code **)(*param_1 + 0x100))(param_1);
    D3DXVec3Normalize(&local_28,&local_28);
    break;
  case 4:
    (**(code **)(*param_1 + 0xa70))(param_1,4);
    break;
  case 5:
  case 0x14:
    local_28 = 0.0;
    local_24 = 0.0;
    *(undefined4 *)((longlong)param_1 + 0x1a44) = 0;
    *(undefined1 *)(param_1 + 0x27f) = 0;
    local_20 = 1.0;
    *(undefined4 *)(param_1 + 0x349) = 0;
    *(undefined1 *)(param_1 + 0x348) = 0;
    *(undefined4 *)((longlong)param_1 + 0x1a4c) = 0x3f800000;
    (**(code **)(*param_1 + 0x100))(param_1);
    break;
  case 0x1e:
    local_24 = *(float *)(param_1 + 0x358);
    local_28 = *(float *)((longlong)param_1 + 0x1abc) - *(float *)(param_3 + 0x178);
    local_20 = *(float *)((longlong)param_1 + 0x1ac4);
LAB_1402379af:
    local_24 = local_24 - *(float *)(param_3 + 0x17c);
    local_20 = local_20 - *(float *)(param_3 + 0x180);
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(float *)((longlong)param_1 + 0x1a44) = local_28;
    *(undefined1 *)(param_1 + 0x348) = 1;
    *(float *)(param_1 + 0x349) = local_24;
    *(float *)((longlong)param_1 + 0x1a4c) = local_20;
    (**(code **)(*param_1 + 0x100))(param_1);
    break;
  case 100:
  case 200:
  case 0xc9:
  case 0xca:
  case 0xcb:
  case 0xcc:
  case 0xcd:
  case 0xce:
  case 0xcf:
  case 0xd0:
  case 0xd1:
    (**(code **)(*param_1 + 0xa78))(param_1,param_2);
  }
  *(undefined4 *)((longlong)param_1 + 0x1ec4) = param_2;
  return;
}



void FUN_140237de0(longlong param_1,ulonglong *param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  bool bVar6;
  
  lVar3 = 0;
  bVar6 = false;
  plVar2 = *(longlong **)(param_1 + 0x12e8);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar2;
      lVar3 = 0;
      if (lVar4 != 0) {
        if (plVar2 != *(longlong **)(param_1 + 0x12f0)) {
          iVar1 = DAT_1406080a8 + 1;
          bVar6 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar1;
          if (bVar6) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        FUN_14034ed40(lVar4);
        bVar6 = true;
        lVar3 = lVar4;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar5 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(longlong **)(param_1 + 0x1f48) != *(longlong **)(param_1 + 0x1f50)) &&
     (plVar2 = *(longlong **)(param_1 + 0x1f48), plVar2 != *(longlong **)(param_1 + 0x1f50))) {
    do {
      lVar4 = *plVar2;
      bVar5 = *(ulonglong *)(lVar4 + 0x70) < *param_2;
      if ((*(ulonglong *)(lVar4 + 0x70) == *param_2) &&
         (bVar5 = *(ulonglong *)(lVar4 + 0x78) < param_2[1],
         *(ulonglong *)(lVar4 + 0x78) == param_2[1])) {
        iVar1 = 0;
      }
      else {
        iVar1 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
      }
      if (iVar1 == 0) {
        FUN_14026bb70(lVar4);
      }
      plVar2 = plVar2 + 1;
    } while (plVar2 != *(longlong **)(param_1 + 0x1f50));
  }
  if (bVar6) {
    FUN_14034edd0(lVar3);
  }
  return;
}



void FUN_140237f20(longlong param_1,int param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  bool bVar7;
  bool bVar8;
  
  lVar3 = 0;
  bVar8 = false;
  plVar2 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar2;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar1 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar1, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar8 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(longlong **)(param_1 + 0x1f08) != *(longlong **)(param_1 + 0x1f10)) &&
     (plVar2 = *(longlong **)(param_1 + 0x1f08), plVar2 != *(longlong **)(param_1 + 0x1f10))) {
    do {
      if (*(int *)(*plVar2 + 0x6c) == param_2) {
        FUN_14026bb70();
      }
      plVar2 = plVar2 + 1;
    } while (plVar2 != *(longlong **)(param_1 + 0x1f10));
  }
  if ((*(longlong **)(param_1 + 0x1f28) != *(longlong **)(param_1 + 0x1f30)) &&
     (plVar2 = *(longlong **)(param_1 + 0x1f28), plVar2 != *(longlong **)(param_1 + 0x1f30))) {
    do {
      if (*(int *)(*plVar2 + 0x6c) == param_2) {
        FUN_14026bb70();
      }
      plVar2 = plVar2 + 1;
    } while (plVar2 != *(longlong **)(param_1 + 0x1f30));
  }
  if ((*(longlong **)(param_1 + 0x1f48) != *(longlong **)(param_1 + 0x1f50)) &&
     (plVar2 = *(longlong **)(param_1 + 0x1f48), plVar2 != *(longlong **)(param_1 + 0x1f50))) {
    do {
      if (*(int *)(*plVar2 + 0x6c) == param_2) {
        FUN_14026bb70();
      }
      plVar2 = plVar2 + 1;
    } while (plVar2 != *(longlong **)(param_1 + 0x1f50));
  }
  if ((*(longlong **)(param_1 + 0x1f68) != *(longlong **)(param_1 + 0x1f70)) &&
     (plVar2 = *(longlong **)(param_1 + 0x1f68), plVar2 != *(longlong **)(param_1 + 0x1f70))) {
    do {
      if (*(int *)(*plVar2 + 0x6c) == param_2) {
        FUN_14026bb70();
      }
      plVar2 = plVar2 + 1;
    } while (plVar2 != *(longlong **)(param_1 + 0x1f70));
  }
  if ((*(longlong **)(param_1 + 0x1fa8) != *(longlong **)(param_1 + 0x1fb0)) &&
     (plVar2 = *(longlong **)(param_1 + 0x1fa8), plVar2 != *(longlong **)(param_1 + 0x1fb0))) {
    do {
      if (*(int *)(*plVar2 + 0x6c) == param_2) {
        FUN_14026bb70();
      }
      plVar2 = plVar2 + 1;
    } while (plVar2 != *(longlong **)(param_1 + 0x1fb0));
  }
  if ((*(longlong **)(param_1 + 0x1fc8) != *(longlong **)(param_1 + 0x1fd0)) &&
     (plVar2 = *(longlong **)(param_1 + 0x1fc8), plVar2 != *(longlong **)(param_1 + 0x1fd0))) {
    do {
      if (*(int *)(*plVar2 + 0x6c) == param_2) {
        FUN_14026bb70();
      }
      plVar2 = plVar2 + 1;
    } while (plVar2 != *(longlong **)(param_1 + 0x1fd0));
  }
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  FUN_14034ed40(param_1 + 0x12f8);
  plVar2 = *(longlong **)(param_1 + 0x1ff0);
  if (*(longlong **)(param_1 + 0x1fe8) != plVar2) {
    for (plVar6 = *(longlong **)(param_1 + 0x1fe8); plVar6 != plVar2; plVar6 = plVar6 + 1) {
      if ((*plVar6 != 0) && (*(int *)(*plVar6 + 0x6c) == param_2)) {
        FUN_14026bb70();
      }
    }
  }
  FUN_14034edd0(param_1 + 0x12f8);
  return;
}



void FUN_1402381b0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  lVar4 = 0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar1;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  puVar3 = *(undefined8 **)(param_1 + 0x1f08);
  if (puVar3 != *(undefined8 **)(param_1 + 0x1f10)) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x60))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f10));
  }
  puVar3 = *(undefined8 **)(param_1 + 0x1f28);
  if (puVar3 != *(undefined8 **)(param_1 + 0x1f30)) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x60))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f30));
  }
  puVar3 = *(undefined8 **)(param_1 + 0x1f48);
  if (puVar3 != *(undefined8 **)(param_1 + 0x1f50)) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x60))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f50));
  }
  puVar3 = *(undefined8 **)(param_1 + 0x1f68);
  if (puVar3 != *(undefined8 **)(param_1 + 0x1f70)) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x60))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f70));
  }
  puVar3 = *(undefined8 **)(param_1 + 0x1fa8);
  if (puVar3 != *(undefined8 **)(param_1 + 0x1fb0)) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x60))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fb0));
  }
  puVar3 = *(undefined8 **)(param_1 + 0x1fc8);
  if (puVar3 != *(undefined8 **)(param_1 + 0x1fd0)) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x60))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fd0));
  }
  if (bVar8) {
    FUN_14034edd0(lVar6);
  }
  FUN_14034ed40(param_1 + 0x12f8);
  puVar3 = *(undefined8 **)(param_1 + 0x1fe8);
  if (puVar3 != *(undefined8 **)(param_1 + 0x1ff0)) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x60))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1ff0));
  }
  FUN_14034edd0(param_1 + 0x12f8);
  return;
}



void FUN_1402383f0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  bool bVar8;
  bool bVar9;
  
  lVar4 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar1;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar9 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(undefined8 **)(param_1 + 0x1f08) != *(undefined8 **)(param_1 + 0x1f10)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f08), puVar3 != *(undefined8 **)(param_1 + 0x1f10))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x28))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f10));
  }
  if ((*(undefined8 **)(param_1 + 0x1f28) != *(undefined8 **)(param_1 + 0x1f30)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f28), puVar3 != *(undefined8 **)(param_1 + 0x1f30))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x28))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f30));
  }
  if ((*(undefined8 **)(param_1 + 0x1f48) != *(undefined8 **)(param_1 + 0x1f50)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f48), puVar3 != *(undefined8 **)(param_1 + 0x1f50))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x28))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f50));
  }
  if ((*(undefined8 **)(param_1 + 0x1f68) != *(undefined8 **)(param_1 + 0x1f70)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f68), puVar3 != *(undefined8 **)(param_1 + 0x1f70))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x28))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f70));
  }
  if ((*(undefined8 **)(param_1 + 0x1fa8) != *(undefined8 **)(param_1 + 0x1fb0)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1fa8), puVar3 != *(undefined8 **)(param_1 + 0x1fb0))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x28))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fb0));
  }
  if ((*(undefined8 **)(param_1 + 0x1fc8) != *(undefined8 **)(param_1 + 0x1fd0)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1fc8), puVar3 != *(undefined8 **)(param_1 + 0x1fd0))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x28))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fd0));
  }
  if (bVar9) {
    FUN_14034edd0(lVar6);
  }
  FUN_14034ed40(param_1 + 0x12f8);
  plVar1 = *(longlong **)(param_1 + 0x1ff0);
  if (*(longlong **)(param_1 + 0x1fe8) != plVar1) {
    for (plVar7 = *(longlong **)(param_1 + 0x1fe8); plVar7 != plVar1; plVar7 = plVar7 + 1) {
      if ((longlong *)*plVar7 != (longlong *)0x0) {
        (**(code **)(*(longlong *)*plVar7 + 0x28))();
      }
    }
  }
  FUN_14034edd0(param_1 + 0x12f8);
  return;
}



void FUN_140238660(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  bool bVar8;
  bool bVar9;
  
  lVar4 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar1;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar9 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(undefined8 **)(param_1 + 0x1f08) != *(undefined8 **)(param_1 + 0x1f10)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f08), puVar3 != *(undefined8 **)(param_1 + 0x1f10))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x30))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f10));
  }
  if ((*(undefined8 **)(param_1 + 0x1f28) != *(undefined8 **)(param_1 + 0x1f30)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f28), puVar3 != *(undefined8 **)(param_1 + 0x1f30))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x30))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f30));
  }
  if ((*(undefined8 **)(param_1 + 0x1f48) != *(undefined8 **)(param_1 + 0x1f50)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f48), puVar3 != *(undefined8 **)(param_1 + 0x1f50))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x30))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f50));
  }
  if ((*(undefined8 **)(param_1 + 0x1f68) != *(undefined8 **)(param_1 + 0x1f70)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f68), puVar3 != *(undefined8 **)(param_1 + 0x1f70))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x30))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f70));
  }
  if ((*(undefined8 **)(param_1 + 0x1fa8) != *(undefined8 **)(param_1 + 0x1fb0)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1fa8), puVar3 != *(undefined8 **)(param_1 + 0x1fb0))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x30))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fb0));
  }
  if ((*(undefined8 **)(param_1 + 0x1fc8) != *(undefined8 **)(param_1 + 0x1fd0)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1fc8), puVar3 != *(undefined8 **)(param_1 + 0x1fd0))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x30))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fd0));
  }
  if (bVar9) {
    FUN_14034edd0(lVar6);
  }
  FUN_14034ed40(param_1 + 0x12f8);
  plVar1 = *(longlong **)(param_1 + 0x1ff0);
  if (*(longlong **)(param_1 + 0x1fe8) != plVar1) {
    for (plVar7 = *(longlong **)(param_1 + 0x1fe8); plVar7 != plVar1; plVar7 = plVar7 + 1) {
      if ((longlong *)*plVar7 != (longlong *)0x0) {
        (**(code **)(*(longlong *)*plVar7 + 0x30))();
      }
    }
  }
  FUN_14034edd0(param_1 + 0x12f8);
  return;
}



void FUN_1402388d0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  bool bVar8;
  bool bVar9;
  
  lVar4 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar1;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar9 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(undefined8 **)(param_1 + 0x1f08) != *(undefined8 **)(param_1 + 0x1f10)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f08), puVar3 != *(undefined8 **)(param_1 + 0x1f10))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x20))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f10));
  }
  if ((*(undefined8 **)(param_1 + 0x1f28) != *(undefined8 **)(param_1 + 0x1f30)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f28), puVar3 != *(undefined8 **)(param_1 + 0x1f30))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x20))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f30));
  }
  if ((*(undefined8 **)(param_1 + 0x1f48) != *(undefined8 **)(param_1 + 0x1f50)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f48), puVar3 != *(undefined8 **)(param_1 + 0x1f50))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x20))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f50));
  }
  if ((*(undefined8 **)(param_1 + 0x1f68) != *(undefined8 **)(param_1 + 0x1f70)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f68), puVar3 != *(undefined8 **)(param_1 + 0x1f70))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x20))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f70));
  }
  if ((*(undefined8 **)(param_1 + 0x1fa8) != *(undefined8 **)(param_1 + 0x1fb0)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1fa8), puVar3 != *(undefined8 **)(param_1 + 0x1fb0))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x20))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fb0));
  }
  if ((*(undefined8 **)(param_1 + 0x1fc8) != *(undefined8 **)(param_1 + 0x1fd0)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1fc8), puVar3 != *(undefined8 **)(param_1 + 0x1fd0))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x20))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fd0));
  }
  if (bVar9) {
    FUN_14034edd0(lVar6);
  }
  FUN_14034ed40(param_1 + 0x12f8);
  plVar1 = *(longlong **)(param_1 + 0x1ff0);
  if (*(longlong **)(param_1 + 0x1fe8) != plVar1) {
    for (plVar7 = *(longlong **)(param_1 + 0x1fe8); plVar7 != plVar1; plVar7 = plVar7 + 1) {
      if ((longlong *)*plVar7 != (longlong *)0x0) {
        (**(code **)(*(longlong *)*plVar7 + 0x20))();
      }
    }
  }
  FUN_14034edd0(param_1 + 0x12f8);
  return;
}



void FUN_140238b40(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  bool bVar8;
  bool bVar9;
  
  lVar4 = 0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar1;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar9 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(undefined8 **)(param_1 + 0x1f08) != *(undefined8 **)(param_1 + 0x1f10)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f08), puVar3 != *(undefined8 **)(param_1 + 0x1f10))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x18))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f10));
  }
  if ((*(undefined8 **)(param_1 + 0x1f28) != *(undefined8 **)(param_1 + 0x1f30)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f28), puVar3 != *(undefined8 **)(param_1 + 0x1f30))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x18))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f30));
  }
  if ((*(undefined8 **)(param_1 + 0x1f48) != *(undefined8 **)(param_1 + 0x1f50)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f48), puVar3 != *(undefined8 **)(param_1 + 0x1f50))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x18))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f50));
  }
  if ((*(undefined8 **)(param_1 + 0x1f68) != *(undefined8 **)(param_1 + 0x1f70)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1f68), puVar3 != *(undefined8 **)(param_1 + 0x1f70))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x18))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1f70));
  }
  if ((*(undefined8 **)(param_1 + 0x1fa8) != *(undefined8 **)(param_1 + 0x1fb0)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1fa8), puVar3 != *(undefined8 **)(param_1 + 0x1fb0))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x18))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fb0));
  }
  if ((*(undefined8 **)(param_1 + 0x1fc8) != *(undefined8 **)(param_1 + 0x1fd0)) &&
     (puVar3 = *(undefined8 **)(param_1 + 0x1fc8), puVar3 != *(undefined8 **)(param_1 + 0x1fd0))) {
    do {
      (**(code **)(*(longlong *)*puVar3 + 0x18))();
      puVar3 = puVar3 + 1;
    } while (puVar3 != *(undefined8 **)(param_1 + 0x1fd0));
  }
  if (bVar9) {
    FUN_14034edd0(lVar6);
  }
  FUN_14034ed40(param_1 + 0x12f8);
  plVar1 = *(longlong **)(param_1 + 0x1ff0);
  if (*(longlong **)(param_1 + 0x1fe8) != plVar1) {
    for (plVar7 = *(longlong **)(param_1 + 0x1fe8); plVar7 != plVar1; plVar7 = plVar7 + 1) {
      if ((longlong *)*plVar7 != (longlong *)0x0) {
        (**(code **)(*(longlong *)*plVar7 + 0x18))();
      }
    }
  }
  FUN_14034edd0(param_1 + 0x12f8);
  return;
}



void FUN_140238db0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  longlong *_Dst;
  longlong *_Src;
  
  _Dst = (longlong *)*param_1;
  if (_Dst != (longlong *)param_1[1]) {
    _Src = _Dst + 1;
    do {
      plVar1 = (longlong *)*_Dst;
      if (*(int *)((longlong)plVar1 + 0x24) == 0) {
        (**(code **)(*plVar1 + 0x10))(plVar1,param_2,param_3);
        _Dst = _Dst + 1;
        _Src = _Src + 1;
      }
      else {
        if (plVar1 != (longlong *)0x0) {
          (**(code **)*plVar1)(plVar1,1);
        }
        memmove(_Dst,_Src,param_1[1] - (longlong)_Src & 0xfffffffffffffff8);
        param_1[1] = param_1[1] + -8;
      }
    } while (_Dst != (longlong *)param_1[1]);
  }
  return;
}



void FUN_140238e50(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  void *_Dst;
  int iVar7;
  undefined8 *puVar8;
  undefined8 in_R8;
  longlong lVar9;
  longlong lVar10;
  longlong lVar11;
  bool bVar12;
  bool bVar13;
  undefined8 local_res8;
  undefined8 uVar14;
  longlong lVar15;
  undefined1 uVar16;
  
  uVar14 = 0xfffffffffffffffe;
  lVar9 = 0;
  lVar15 = 0;
  bVar13 = false;
  uVar16 = 0;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar11 = lVar9;
  if (plVar1 != (longlong *)0x0) {
    plVar2 = *(longlong **)(param_1 + 0x12f0);
    if (plVar1 == plVar2) {
      lVar10 = *plVar1;
      lVar11 = 0;
      if (lVar10 != 0) {
        if ((plVar1 != plVar2) &&
           (iVar7 = DAT_1406080a8 + 1, bVar13 = DAT_1406080a8 == 0, lVar10 = lVar9,
           DAT_1406080a8 = iVar7, bVar13)) {
          FUN_140176d60(1,plVar2,in_R8,param_4,0xfffffffffffffffe,0,0);
        }
        lVar15 = lVar10;
        FUN_14034ed40(lVar10);
        bVar13 = true;
        uVar16 = 1;
        lVar11 = lVar10;
      }
    }
    else {
      iVar7 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar7;
      if (bVar12) {
        FUN_140176d60(1,plVar2,in_R8,param_4,0xfffffffffffffffe,0,0);
      }
    }
  }
  FUN_140238db0(param_1 + 0x1f08,param_2,param_3,param_4,uVar14,lVar15,uVar16);
  FUN_140238db0(param_1 + 0x1f28,param_2,param_3);
  FUN_140238db0(param_1 + 0x1f48,param_2,param_3);
  FUN_140238db0(param_1 + 0x1f68,param_2,param_3);
  FUN_140238db0(param_1 + 0x1fa8,param_2,param_3);
  FUN_140238db0(param_1 + 0x1fc8,param_2,param_3);
  puVar3 = *(undefined8 **)(param_1 + 0x1f90);
  if (*(undefined8 **)(param_1 + 0x1f88) != puVar3) {
    for (puVar8 = *(undefined8 **)(param_1 + 0x1f88); puVar8 != puVar3; puVar8 = puVar8 + 1) {
      uVar4 = *puVar8;
      puVar5 = *(undefined8 **)(param_1 + 0x1f30);
      local_res8 = uVar4;
      if ((&local_res8 < puVar5) &&
         (puVar6 = *(undefined8 **)(param_1 + 0x1f28), puVar6 <= &local_res8)) {
        if (puVar5 == *(undefined8 **)(param_1 + 0x1f38)) {
          FUN_140195b20(param_1 + 0x1f28);
        }
        if (*(undefined8 **)(param_1 + 0x1f30) != (undefined8 *)0x0) {
          **(undefined8 **)(param_1 + 0x1f30) =
               *(undefined8 *)
                (*(longlong *)(param_1 + 0x1f28) +
                ((longlong)&local_res8 - (longlong)puVar6 >> 3) * 8);
        }
      }
      else {
        if (puVar5 == *(undefined8 **)(param_1 + 0x1f38)) {
          FUN_140195b20(param_1 + 0x1f28);
        }
        if (*(undefined8 **)(param_1 + 0x1f30) != (undefined8 *)0x0) {
          **(undefined8 **)(param_1 + 0x1f30) = uVar4;
        }
      }
      *(longlong *)(param_1 + 0x1f30) = *(longlong *)(param_1 + 0x1f30) + 8;
    }
    _Dst = *(void **)(param_1 + 0x1f88);
    if (_Dst != *(void **)(param_1 + 0x1f90)) {
      memmove(_Dst,*(void **)(param_1 + 0x1f90),0);
      *(void **)(param_1 + 0x1f90) = _Dst;
    }
  }
  if (bVar13) {
    FUN_14034edd0(lVar11);
  }
  lVar11 = param_1 + 0x12f8;
  lVar15 = lVar11;
  FUN_14034ed40(lVar11);
  FUN_140238db0(param_1 + 0x1fe8,param_2,param_3,param_4,uVar14,lVar15,1);
  FUN_14034edd0(lVar11);
  return;
}



void FUN_140239120(longlong param_1,int param_2)

{
  undefined8 *puVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  lVar4 = 0;
  bVar8 = false;
  plVar3 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar3;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar3 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong **)(param_1 + 0x1f28) != *(longlong **)(param_1 + 0x1f30)) {
    for (plVar3 = *(longlong **)(param_1 + 0x1f28); plVar3 != *(longlong **)(param_1 + 0x1f30);
        plVar3 = plVar3 + 1) {
      if (*(int *)(*plVar3 + 0x20) == param_2) {
        FUN_14026bb70();
        puVar1 = (undefined8 *)*plVar3;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        memmove(plVar3,plVar3 + 1,
                *(longlong *)(param_1 + 0x1f30) - (longlong)(plVar3 + 1) & 0xfffffffffffffff8);
        *(longlong *)(param_1 + 0x1f30) = *(longlong *)(param_1 + 0x1f30) + -8;
        goto LAB_1402392af;
      }
    }
  }
  if (*(longlong **)(param_1 + 0x1f88) != *(longlong **)(param_1 + 0x1f90)) {
    for (plVar3 = *(longlong **)(param_1 + 0x1f88); plVar3 != *(longlong **)(param_1 + 0x1f90);
        plVar3 = plVar3 + 1) {
      if (*(int *)(*plVar3 + 0x20) == param_2) {
        FUN_14026bb70();
        puVar1 = (undefined8 *)*plVar3;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        memmove(plVar3,plVar3 + 1,
                *(longlong *)(param_1 + 0x1f90) - (longlong)(plVar3 + 1) & 0xfffffffffffffff8);
        *(longlong *)(param_1 + 0x1f90) = *(longlong *)(param_1 + 0x1f90) + -8;
        break;
      }
    }
  }
LAB_1402392af:
  if (bVar8) {
    FUN_14034edd0(lVar6);
  }
  return;
}



void FUN_1402392e0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  int iVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined8 uVar10;
  longlong lVar11;
  
  uVar10 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar11 = 0;
  bVar9 = false;
  plVar1 = (longlong *)param_1[0x25d];
  lVar7 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_1[0x25e]) {
      lVar6 = *plVar1;
      lVar7 = 0;
      if (lVar6 != 0) {
        if ((plVar1 != (longlong *)param_1[0x25e]) &&
           (iVar3 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar6 = lVar5,
           DAT_1406080a8 = iVar3, bVar9)) {
          FUN_140176d60(1);
        }
        lVar11 = lVar6;
        FUN_14034ed40(lVar6);
        bVar9 = true;
        lVar7 = lVar6;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_1[0x3d0] != 0) {
    lVar5 = param_1[0x25];
    uVar2 = *(undefined8 *)(param_1[0x3d0] + 0x48);
    uVar4 = (**(code **)(*param_1 + 0xb0))(param_1);
    FUN_140195010(uVar2,(int)lVar5,uVar4,param_4,uVar10,lVar11);
  }
  FUN_140237f20(param_1,3);
  FUN_140237f20(param_1,5);
  if (bVar9) {
    FUN_14034edd0(lVar7);
  }
  return;
}



void FUN_140239410(longlong *param_1,undefined8 *param_2,int param_3)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  int iVar4;
  undefined8 *_Dst;
  longlong *local_res8;
  
  lVar1 = param_1[0x3d0];
  if (*(longlong *)(lVar1 + 0x30) == 0) {
    return;
  }
  lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x30) + 0x2d0);
  if (lVar2 == 0) {
    return;
  }
  if (param_3 == 0) {
    return;
  }
  local_res8 = param_1;
  if (param_3 == 1) {
    FUN_1401959b0(param_2,&local_res8);
    return;
  }
  uVar3 = *(undefined8 *)(lVar1 + 0x48);
  if (*(int *)(*(longlong *)(*(longlong *)(lVar1 + 0x30) + 0x2d0) + 0x4bc) == 3) {
    if (*(int *)(lVar2 + 0x4bc) != 3) {
      return;
    }
    if (param_3 != 3) {
      if (param_3 != 2) {
        return;
      }
      iVar4 = (int)param_1[0x34c];
      if (iVar4 != 0) {
        if ((iVar4 != 1) && (iVar4 != 2)) {
          return;
        }
        FUN_140190340(uVar3,param_2,iVar4);
      }
      FUN_1401959b0(param_2,&local_res8);
      return;
    }
    iVar4 = (int)param_1[0x34c];
    if (iVar4 == 0) {
      FUN_140190080(uVar3,param_2);
      _Dst = (undefined8 *)*param_2;
      while( true ) {
        if (_Dst == (undefined8 *)param_2[1]) {
          return;
        }
        if ((longlong *)*_Dst == param_1) break;
        _Dst = _Dst + 1;
      }
      memmove(_Dst,_Dst + 1,(longlong)param_2[1] - (longlong)(_Dst + 1) & 0xfffffffffffffff8);
      param_2[1] = param_2[1] + -8;
      return;
    }
    if (iVar4 == 1) {
      FUN_140190340(uVar3,param_2,2);
      return;
    }
    if (iVar4 != 2) {
      return;
    }
    FUN_140190340(uVar3,param_2,1);
    return;
  }
  iVar4 = (**(code **)(*param_1 + 0xb0))(param_1);
  if (iVar4 != 2) {
    if (iVar4 == 4) {
      if (param_3 == 3) goto LAB_1402394c7;
      if (param_3 != 2) {
        return;
      }
      goto LAB_1402394e5;
    }
    if (iVar4 != 0x20) {
      return;
    }
  }
  if (param_3 != 3) {
    if (param_3 != 2) {
      return;
    }
LAB_1402394c7:
    FUN_140190080(uVar3,param_2);
    return;
  }
LAB_1402394e5:
  FUN_14018fe60(uVar3,param_2);
  return;
}



void FUN_1402395e0(longlong *param_1,undefined8 param_2,undefined4 param_3,int param_4,
                  undefined4 *param_5)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  int iVar4;
  undefined8 uVar5;
  longlong *local_res8;
  undefined4 uVar6;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  
  lVar1 = param_1[0x3d0];
  if (*(longlong *)(lVar1 + 0x30) == 0) {
    return;
  }
  lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x30) + 0x2d0);
  if (lVar2 == 0) {
    return;
  }
  if (param_4 == 0) {
    return;
  }
  local_res8 = param_1;
  if (param_4 == 1) {
    FUN_1401959b0(param_2,&local_res8);
    return;
  }
  uVar3 = *(undefined8 *)(lVar1 + 0x48);
  if (*(int *)(*(longlong *)(*(longlong *)(lVar1 + 0x30) + 0x2d0) + 0x4bc) == 3) {
    if (*(int *)(lVar2 + 0x4bc) != 3) {
      return;
    }
    if (param_4 == 3) {
      iVar4 = (int)param_1[0x34c];
      if (iVar4 == 0) {
        local_38 = *param_5;
        local_34 = param_5[1];
        local_30 = param_5[2];
        FUN_140191c10(uVar3,param_2,param_1,param_3,2,&local_38);
        FUN_140190740(uVar3,param_2,param_1);
        return;
      }
      if (iVar4 != 1) {
        if (iVar4 != 2) {
          return;
        }
        local_38 = *param_5;
        local_34 = param_5[1];
        local_30 = param_5[2];
        FUN_140191c10(uVar3,param_2,param_1,param_3,2,&local_38);
        uVar5 = 1;
        goto LAB_14023983d;
      }
    }
    else {
      if (param_4 != 2) {
        return;
      }
      iVar4 = (int)param_1[0x34c];
      if (iVar4 == 0) {
        FUN_1401959b0(param_2,&local_res8);
        return;
      }
      if ((iVar4 != 1) && (iVar4 != 2)) {
        return;
      }
    }
    local_38 = *param_5;
    local_34 = param_5[1];
    local_30 = param_5[2];
    FUN_140191c10(uVar3,param_2,param_1,param_3,2,&local_38);
    uVar5 = 2;
LAB_14023983d:
    FUN_140190630(uVar3,param_2,uVar5);
    return;
  }
  iVar4 = (**(code **)(*param_1 + 0xb0))(param_1);
  if (iVar4 == 2) {
LAB_140239688:
    if (param_4 != 3) {
      if (param_4 != 2) {
        return;
      }
      local_38 = *param_5;
      local_34 = param_5[1];
      local_30 = param_5[2];
LAB_1402396a8:
      uVar6 = 2;
      goto LAB_1402396bc;
    }
  }
  else {
    if (iVar4 != 4) {
      if (iVar4 != 0x20) {
        return;
      }
      goto LAB_140239688;
    }
    if (param_4 == 3) {
      local_38 = *param_5;
      local_34 = param_5[1];
      local_30 = param_5[2];
      goto LAB_1402396a8;
    }
    if (param_4 != 2) {
      return;
    }
  }
  local_38 = *param_5;
  local_34 = param_5[1];
  local_30 = param_5[2];
  uVar6 = 4;
LAB_1402396bc:
  FUN_140191c10(uVar3,param_2,param_1,param_3,uVar6,&local_38);
  return;
}



undefined4 FUN_140239870(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x130) == 0) {
    return 0x3f800000;
  }
  return *(undefined4 *)(*(longlong *)(param_1 + 0x130) + 0x2dc);
}



void FUN_140239890(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    if (param_1[0x2c3] == 0) {
      lVar1 = *param_1;
    }
    else {
      *(undefined4 *)((longlong)param_1 + 300) = 0x36;
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)((longlong)param_1 + 0x2054);
      *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)((longlong)param_1 + 0x205c);
      if ((ulonglong)param_1[0x2c4] < 8) {
        plVar2 = param_1 + 0x2c1;
      }
      else {
        plVar2 = (longlong *)param_1[0x2c1];
      }
      (**(code **)(*param_1 + 0x8f8))
                (param_1,plVar2,*(undefined4 *)((longlong)param_1 + 0x1814),0x3f800000,1,
                 param_1[0x2fb],(char)param_1[0x38a]);
      FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
      *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
      param_1[0x2fb] = 0;
      *(undefined1 *)(param_1 + 0x38a) = 0;
      if (*(int *)((longlong)param_1 + 300) != 0x36) {
        return;
      }
      lVar1 = *param_1;
    }
    (**(code **)(lVar1 + 200))(param_1,0x36);
  }
  return;
}



void FUN_1402399a0(longlong *param_1,undefined1 param_2)

{
  longlong *plVar1;
  undefined1 local_res8 [8];
  undefined1 local_res10 [8];
  undefined4 local_res18 [4];
  
  if (param_1[0x3d0] != 0) {
    local_res10[0] = param_2;
    local_res8[0] = (**(code **)(*param_1 + 0xb0))();
    local_res18[0] = (undefined4)param_1[0x25];
    plVar1 = (longlong *)(**(longlong **)(param_1[0x3d0] + 0x48) + 0x380);
    (**(code **)(*plVar1 + 0x3f0))
              (plVar1,*(undefined4 *)(param_1[0x3d0] + 8),&DAT_1405d85a0,local_res18,local_res8,
               local_res10);
  }
  return;
}



void FUN_140239a20(longlong *param_1,undefined1 param_2)

{
  longlong *plVar1;
  undefined1 local_res8 [16];
  undefined1 local_res18 [8];
  undefined4 local_res20 [2];
  
  if (param_1[0x3d0] != 0) {
    local_res8[0] = param_2;
    local_res18[0] = (**(code **)(*param_1 + 0xb0))();
    local_res20[0] = (undefined4)param_1[0x25];
    plVar1 = (longlong *)(**(longlong **)(param_1[0x3d0] + 0x48) + 0x380);
    (**(code **)(*plVar1 + 0x400))
              (plVar1,*(undefined4 *)(param_1[0x3d0] + 8),&DAT_1405d85a0,local_res20,local_res18,
               local_res8);
  }
  return;
}



void FUN_140239aa0(longlong param_1,uint param_2)

{
  wchar_t wVar1;
  longlong lVar2;
  int iVar3;
  wchar_t *pwVar4;
  longlong lVar5;
  ulonglong uVar6;
  wchar_t *_Str1;
  float fVar7;
  
  if (param_2 < 0xf) {
    _Str1 = (wchar_t *)(DAT_1406081d8 + 0x440 + (longlong)(int)param_2 * 0x28);
    if (7 < *(ulonglong *)(_Str1 + 0xc)) {
      _Str1 = *(wchar_t **)_Str1;
    }
  }
  else {
    _Str1 = (wchar_t *)0x0;
  }
  if (param_2 < 0xf) {
    pwVar4 = (wchar_t *)(DAT_1406081d8 + 0x698 + (longlong)(int)param_2 * 0x28);
    if (7 < *(ulonglong *)(pwVar4 + 0xc)) {
      pwVar4 = *(wchar_t **)pwVar4;
    }
  }
  else {
    pwVar4 = (wchar_t *)0x0;
  }
  if ((*(char *)(param_1 + 0x600) != '\0') || (*(char *)(param_1 + 0x601) != '\0')) {
    _Str1 = pwVar4;
  }
  iVar3 = _wcsicmp(_Str1,L"");
  if ((iVar3 != 0) && ((param_2 == 4 || (param_2 == 10)))) {
    lVar5 = -1;
    pwVar4 = _Str1;
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      wVar1 = *pwVar4;
      pwVar4 = pwVar4 + 1;
    } while (wVar1 != L'\0');
    lVar2 = *(longlong *)(param_1 + 0x13d8);
    if (lVar5 != -2) {
      uVar6 = 0xffffffffffffffff;
      pwVar4 = _Str1;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        wVar1 = *pwVar4;
        pwVar4 = pwVar4 + 1;
      } while (wVar1 != L'\0');
      FUN_140001710(lVar2 + 0x40,_Str1,~uVar6 - 1);
      if (*(longlong *)(lVar2 + 0x10) != 0) {
        lVar5 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
        if (lVar5 == 0) {
          iVar3 = 0;
        }
        else {
          iVar3 = FUN_1402ce620(lVar5,_Str1);
          iVar3 = iVar3 + 1;
        }
        FUN_1402c5c00(lVar2,iVar3,0,0);
      }
    }
    FUN_1402c5e50(*(undefined8 *)(param_1 + 0x13d8),0x3f800000);
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x50) = 1;
    lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20);
    if (*(int *)(lVar5 + 0x54) == 1) {
      *(undefined8 *)(lVar5 + 0x10) = *(undefined8 *)(param_1 + 0x510);
      FUN_1402cc2c0(lVar5);
    }
    *(undefined4 *)(lVar5 + 0x54) = 0;
    fVar7 = (float)FUN_1402c5ee0(*(undefined8 *)(param_1 + 0x13d8));
    *(undefined8 *)(param_1 + 0x1458) = 0;
    *(undefined4 *)(param_1 + 0x160) = *(undefined4 *)(param_1 + 0x154);
    *(double *)(param_1 + 0x1450) = (double)fVar7;
    *(undefined4 *)(param_1 + 0x164) = *(undefined4 *)(param_1 + 0x158);
    *(undefined1 *)(param_1 + 0x13f8) = 0;
    *(undefined4 *)(param_1 + 0x168) = *(undefined4 *)(param_1 + 0x15c);
  }
  return;
}



void FUN_140239c60(longlong *param_1,short *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  int iVar4;
  ulonglong uVar5;
  undefined2 *puVar6;
  undefined4 uVar7;
  short *psVar8;
  undefined8 uVar9;
  undefined1 local_40 [8];
  longlong *local_38;
  undefined2 local_30;
  undefined6 uStack_2e;
  undefined8 local_20;
  ulonglong local_18;
  
  uVar9 = 0xfffffffffffffffe;
  uVar7 = 0xb;
  iVar4 = (**(code **)(*param_1 + 0xb0))();
  if (0 < iVar4) {
    if (iVar4 < 3) {
      uVar7 = 4;
    }
    else if (iVar4 == 4) {
      uVar7 = 5;
    }
  }
  FUN_140343ec0(param_1 + 0x27d,param_1 + 0x27b);
  local_18 = 7;
  local_20 = 0;
  local_30 = 0;
  uVar5 = 0xffffffffffffffff;
  psVar8 = param_2;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    sVar3 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar3 != 0);
  FUN_140001710(&local_30,param_2,~uVar5 - 1,param_4,uVar9);
  FUN_140002aa0(&local_30,L"_server",7);
  puVar6 = &local_30;
  if (7 < local_18) {
    puVar6 = (undefined2 *)CONCAT62(uStack_2e,local_30);
  }
  FUN_1402c4f90(local_40,puVar6,uVar7);
  (**(code **)(*param_1 + 0x8e0))(param_1,local_40);
  if (local_38 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_38 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_38 + 8))(local_38);
      LOCK();
      piVar2 = (int *)((longlong)local_38 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_38 + 0x10))(local_38);
      }
    }
  }
  if (7 < local_18) {
    operator_delete((void *)CONCAT62(uStack_2e,local_30));
  }
  return;
}



void FUN_140239da0(longlong *param_1)

{
  FUN_1402ca8c0(DAT_1406081e0,param_1 + 0x27b);
                    // WARNING: Could not recover jumptable at 0x000140239dce. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x8e0))(param_1,param_1 + 0x27d);
  return;
}



void FUN_140239de0(longlong *param_1,int param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  FUN_1402d84d0();
  lVar1 = param_1[0x16e];
  if (param_2 == 0) {
    if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x80) != 0)) {
      (**(code **)(*param_1 + 0x520))(param_1);
    }
    param_1[0x16e] = 0;
    return;
  }
  if ((lVar1 != 0) && (*(longlong *)(lVar1 + 0x80) != 0)) {
    plVar2 = (longlong *)(lVar1 + 0x70);
    if (7 < *(ulonglong *)(lVar1 + 0x88)) {
      plVar2 = (longlong *)*plVar2;
    }
    (**(code **)(*param_1 + 0x518))(param_1,plVar2);
  }
                    // WARNING: Could not recover jumptable at 0x000140239e70. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(param_1,100);
  return;
}



void FUN_140239e80(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  longlong *local_28;
  
  lVar2 = *(longlong *)(param_1 + 0xbf8);
  if (lVar2 != 0) {
    FUN_140246190(param_1 + 0x2008,
                  (longlong)(int)(*(longlong *)(lVar2 + 0x38) - *(longlong *)(lVar2 + 0x30) >> 4),
                  param_3,param_4,0xfffffffffffffffe);
    lVar2 = *(longlong *)(param_1 + 0xbf8);
    puVar7 = *(undefined8 **)(lVar2 + 0x30);
    if (puVar7 != *(undefined8 **)(lVar2 + 0x38)) {
      do {
        uVar3 = *puVar7;
        plVar4 = (longlong *)puVar7[1];
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
          UNLOCK();
        }
        local_40 = *(undefined8 *)(param_1 + 0x510);
        puVar5 = *(undefined8 **)(param_1 + 0x2010);
        local_38 = uVar3;
        local_30 = uVar3;
        local_28 = plVar4;
        if (&local_40 < puVar5) {
          puVar8 = *(undefined8 **)(param_1 + 0x2008);
          if (&local_40 < puVar8) goto LAB_140239f96;
          if (puVar5 == *(undefined8 **)(param_1 + 0x2018)) {
            FUN_1402462a0(param_1 + 0x2008);
          }
          puVar8 = (undefined8 *)
                   (((longlong)&local_40 - (longlong)puVar8 & 0xfffffffffffffff0U) +
                   *(longlong *)(param_1 + 0x2008));
          puVar5 = *(undefined8 **)(param_1 + 0x2010);
          if (puVar5 != (undefined8 *)0x0) {
            *puVar5 = *puVar8;
            puVar5[1] = puVar8[1];
          }
        }
        else {
LAB_140239f96:
          if (puVar5 == *(undefined8 **)(param_1 + 0x2018)) {
            FUN_1402462a0(param_1 + 0x2008);
          }
          puVar5 = *(undefined8 **)(param_1 + 0x2010);
          if (puVar5 != (undefined8 *)0x0) {
            *puVar5 = local_40;
            puVar5[1] = uVar3;
          }
        }
        plVar6 = local_28;
        *(longlong *)(param_1 + 0x2010) = *(longlong *)(param_1 + 0x2010) + 0x10;
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          plVar4 = plVar4 + 1;
          *(int *)plVar4 = (int)*plVar4 + -1;
          UNLOCK();
          if ((int)*plVar4 == 0) {
            (**(code **)(*local_28 + 8))(local_28);
            LOCK();
            piVar1 = (int *)((longlong)plVar6 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*local_28 + 0x10))();
            }
          }
        }
        puVar7 = puVar7 + 2;
      } while (puVar7 != *(undefined8 **)(lVar2 + 0x38));
    }
  }
  return;
}



void FUN_14023a030(longlong param_1,undefined8 param_2,longlong param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  bool bVar6;
  longlong local_res18;
  
  lVar3 = 0;
  bVar6 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  local_res18 = param_3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar3 = 0;
      if (lVar4 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar6 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar6) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        FUN_14034ed40(lVar4);
        bVar6 = true;
        lVar3 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar5 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (param_3 != 0) {
    *(undefined4 *)(param_3 + 0x6c) = 9;
  }
  FUN_140235c20(param_1,param_2,param_3,param_1 + 0x1fc8,0,0,param_1);
  FUN_1401959b0(param_1 + 0x1fc8,&local_res18);
  if (bVar6) {
    FUN_14034edd0(lVar3);
  }
  return;
}



void FUN_14023a160(longlong param_1,int param_2)

{
  undefined8 *puVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  lVar4 = 0;
  bVar8 = false;
  plVar3 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
      lVar5 = *plVar3;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar3 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong **)(param_1 + 0x1fc8) != *(longlong **)(param_1 + 0x1fd0)) {
    for (plVar3 = *(longlong **)(param_1 + 0x1fc8); plVar3 != *(longlong **)(param_1 + 0x1fd0);
        plVar3 = plVar3 + 1) {
      if (*(int *)(*plVar3 + 8) == param_2) {
        FUN_14026bb70();
        puVar1 = (undefined8 *)*plVar3;
        if (puVar1 != (undefined8 *)0x0) {
          (**(code **)*puVar1)(puVar1,1);
        }
        memmove(plVar3,plVar3 + 1,
                *(longlong *)(param_1 + 0x1fd0) - (longlong)(plVar3 + 1) & 0xfffffffffffffff8);
        *(longlong *)(param_1 + 0x1fd0) = *(longlong *)(param_1 + 0x1fd0) + -8;
        break;
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar6);
  }
  return;
}



void FUN_14023a2b0(longlong param_1,undefined8 param_2,float param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  
  lVar4 = 0;
  bVar8 = false;
  plVar3 = *(longlong **)(param_1 + 0x12e8);
  lVar6 = lVar4;
  if (plVar3 != (longlong *)0x0) {
    plVar1 = *(longlong **)(param_1 + 0x12f0);
    if (plVar3 == plVar1) {
      lVar5 = *plVar3;
      lVar6 = 0;
      if (lVar5 != 0) {
        if ((plVar3 != plVar1) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar4,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1,param_2,plVar1,param_4,0xfffffffffffffffe);
        }
        FUN_14034ed40(lVar5);
        bVar8 = true;
        lVar6 = lVar5;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1,param_2,plVar1,param_4,0xfffffffffffffffe);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x1fc8) != *(longlong *)(param_1 + 0x1fd0)) {
    for (plVar3 = *(longlong **)(param_1 + 0x1fc8); plVar3 != *(longlong **)(param_1 + 0x1fd0);
        plVar3 = plVar3 + 1) {
      lVar4 = *plVar3;
      if (*(int *)(lVar4 + 8) == (int)param_2) {
        *(float *)(lVar4 + 0x60) = *(float *)(lVar4 + 0x60) + param_3;
        break;
      }
    }
  }
  if (bVar8) {
    FUN_14034edd0(lVar6);
  }
  return;
}



undefined8 FUN_14023a3d0(longlong param_1,int *param_2,float param_3)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  char cVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  undefined8 uVar9;
  bool bVar10;
  float fVar11;
  float local_res18 [4];
  longlong *local_58;
  longlong *local_50;
  longlong *local_48;
  longlong *local_40;
  
  iVar6 = *(int *)(param_1 + 0x544);
  if (0 < iVar6) {
    fVar11 = param_3;
    if (iVar6 < 3) {
      lVar8 = FUN_14018fbc0(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),
                            *(undefined4 *)(param_1 + 0x548));
      if (lVar8 == 0) {
        return 0;
      }
      uVar9 = FUN_140198570(lVar8,&local_58);
      plVar7 = (longlong *)FUN_140174f50(uVar9);
      plVar1 = local_58;
      if (local_58 != (longlong *)0x0) {
        if (local_58 == local_50) {
          if (local_58 != (longlong *)0x0) {
            LOCK();
            plVar3 = local_58 + 1;
            *(int *)plVar3 = (int)*plVar3 + -1;
            UNLOCK();
            if ((int)*plVar3 == 0) {
              local_58 = (longlong *)0x0;
              puVar4 = (undefined8 *)*plVar1;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              operator_delete(plVar1);
            }
          }
        }
        else {
          iVar6 = DAT_140608054 + 1;
          bVar10 = DAT_140608054 == 0;
          DAT_140608054 = iVar6;
          if (bVar10) {
            FUN_140176d60(1);
          }
        }
      }
      local_res18[0] = 0.0;
      cVar5 = FUN_1401b4a60(lVar8,local_res18,0x191);
      if (cVar5 != '\0') {
        fVar11 = local_res18[0] * param_3 + param_3;
        lVar8 = FUN_1404186a0();
        if ((*(int *)(lVar8 + 0x250) == 1000) ||
           (lVar8 = FUN_1404186a0(), *(char *)(lVar8 + 0x215) == '\x01')) {
          lVar8 = FUN_14015f0c0();
          iVar6 = *(int *)(lVar8 + 0x90);
          if ((0 < iVar6) && ((iVar6 < 6 && (3 < iVar6)))) {
            FUN_140005370(0xd,
                          L"INFO >> GUILD SKILL | SOUL RED RECOVERY %.2f = (%.2f + (%.2f * %.2f))",
                          (double)fVar11,(double)param_3,(double)param_3,(double)local_res18[0]);
          }
        }
      }
    }
    else if (iVar6 == 4) {
      FUN_14018fa30(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),&local_48,
                    *(undefined4 *)(param_1 + 0x548));
      plVar7 = local_48;
      if (local_40 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_40 + 1;
        lVar8 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar8 == 1) {
          (**(code **)(*local_40 + 8))(local_40);
          LOCK();
          piVar2 = (int *)((longlong)local_40 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_40 + 0x10))(local_40);
          }
        }
      }
    }
    else {
      if ((iVar6 != 0x10) && (iVar6 != 0x20)) {
        return 0;
      }
      plVar7 = (longlong *)
               FUN_14018fd10(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),
                             *(undefined4 *)(param_1 + 0x548));
    }
    if ((plVar7 != (longlong *)0x0) && (*(int *)((longlong)plVar7 + 300) != 0x25)) {
      (**(code **)(*plVar7 + 0x290))(plVar7,fVar11);
      *param_2 = (int)fVar11;
      return 1;
    }
  }
  return 0;
}



undefined8 FUN_14023a640(longlong param_1,int *param_2,float param_3)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  char cVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  undefined8 uVar9;
  bool bVar10;
  float fVar11;
  float local_res18 [4];
  longlong *local_58;
  longlong *local_50;
  longlong *local_48;
  longlong *local_40;
  
  iVar6 = *(int *)(param_1 + 0x544);
  if (0 < iVar6) {
    fVar11 = param_3;
    if (iVar6 < 3) {
      lVar8 = FUN_14018fbc0(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),
                            *(undefined4 *)(param_1 + 0x548));
      if (lVar8 == 0) {
        return 0;
      }
      uVar9 = FUN_140198570(lVar8,&local_58);
      plVar7 = (longlong *)FUN_140174f50(uVar9);
      plVar1 = local_58;
      if (local_58 != (longlong *)0x0) {
        if (local_58 == local_50) {
          if (local_58 != (longlong *)0x0) {
            LOCK();
            plVar3 = local_58 + 1;
            *(int *)plVar3 = (int)*plVar3 + -1;
            UNLOCK();
            if ((int)*plVar3 == 0) {
              local_58 = (longlong *)0x0;
              puVar4 = (undefined8 *)*plVar1;
              if (puVar4 != (undefined8 *)0x0) {
                (**(code **)*puVar4)(puVar4,1);
              }
              operator_delete(plVar1);
            }
          }
        }
        else {
          iVar6 = DAT_140608054 + 1;
          bVar10 = DAT_140608054 == 0;
          DAT_140608054 = iVar6;
          if (bVar10) {
            FUN_140176d60(1);
          }
        }
      }
      local_res18[0] = 0.0;
      cVar5 = FUN_1401b4a60(lVar8,local_res18,0x192);
      if (cVar5 != '\0') {
        fVar11 = local_res18[0] * param_3 + param_3;
        lVar8 = FUN_1404186a0();
        if ((*(int *)(lVar8 + 0x250) == 1000) ||
           (lVar8 = FUN_1404186a0(), *(char *)(lVar8 + 0x215) == '\x01')) {
          lVar8 = FUN_14015f0c0();
          iVar6 = *(int *)(lVar8 + 0x90);
          if ((0 < iVar6) && ((iVar6 < 6 && (3 < iVar6)))) {
            FUN_140005370(0xd,
                          L"INFO >> GUILD SKILL | SOUL BLUE RECOVERY %.2f = (%.2f + (%.2f * %.2f))",
                          (double)fVar11,(double)param_3,(double)param_3,(double)local_res18[0]);
          }
        }
      }
    }
    else if (iVar6 == 4) {
      FUN_14018fa30(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),&local_48,
                    *(undefined4 *)(param_1 + 0x548));
      plVar7 = local_48;
      if (local_40 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_40 + 1;
        lVar8 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar8 == 1) {
          (**(code **)(*local_40 + 8))(local_40);
          LOCK();
          piVar2 = (int *)((longlong)local_40 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_40 + 0x10))(local_40);
          }
        }
      }
    }
    else {
      if ((iVar6 != 0x10) && (iVar6 != 0x20)) {
        return 0;
      }
      plVar7 = (longlong *)
               FUN_14018fd10(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),
                             *(undefined4 *)(param_1 + 0x548));
    }
    if (plVar7 != (longlong *)0x0) {
      (**(code **)(*plVar7 + 0x298))(plVar7,fVar11);
      *param_2 = (int)fVar11;
      return 1;
    }
  }
  return 0;
}



longlong * FUN_14023a8b0(longlong *param_1,longlong *param_2)

{
  code *pcVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  
  if (param_1 != param_2) {
    lVar2 = *param_2;
    lVar5 = param_2[1] - lVar2;
    lVar5 = lVar5 / 6 + (lVar5 >> 0x3f);
    lVar6 = lVar5 >> 3;
    lVar5 = lVar5 >> 0x3f;
    uVar7 = lVar6 - lVar5;
    if (lVar6 == lVar5) {
      lVar2 = param_1[1];
      if (*param_1 != lVar2) {
        lVar2 = FUN_14023b410(lVar2,lVar2);
        FUN_14023ae30(lVar2,param_1[1]);
        param_1[1] = lVar2;
      }
    }
    else {
      lVar5 = *param_1;
      lVar6 = param_1[1] - lVar5;
      lVar6 = lVar6 / 6 + (lVar6 >> 0x3f);
      uVar8 = (lVar6 >> 3) - (lVar6 >> 0x3f);
      if (uVar8 < uVar7) {
        if ((ulonglong)((param_1[2] - lVar5) / 0x30) < uVar7) {
          if (lVar5 != 0) {
            FUN_14023ae30(lVar5,param_1[1]);
            operator_delete((void *)*param_1);
          }
          lVar2 = (param_2[1] - *param_2) / 6 + (param_2[1] - *param_2 >> 0x3f);
          uVar7 = (lVar2 >> 3) - (lVar2 >> 0x3f);
          *param_1 = 0;
          param_1[1] = 0;
          param_1[2] = 0;
          if (uVar7 == 0) {
            return param_1;
          }
          if (0x555555555555555 < uVar7) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            plVar4 = (longlong *)(*pcVar1)();
            return plVar4;
          }
          lVar2 = FUN_14023b110(uVar7);
          *param_1 = lVar2;
          param_1[1] = lVar2;
          param_1[2] = uVar7 * 0x30 + lVar2;
          lVar6 = *param_2;
        }
        else {
          lVar6 = uVar8 * 0x30 + lVar2;
          FUN_14023b410(lVar2,lVar6,lVar5);
          lVar2 = param_1[1];
        }
        lVar2 = FUN_14023b9c0(lVar6,param_2[1],lVar2);
      }
      else {
        uVar3 = FUN_14023b410(lVar2,param_2[1],lVar5);
        FUN_14023ae30(uVar3,param_1[1]);
        lVar2 = ((param_2[1] - *param_2) / 0x30) * 0x30 + *param_1;
      }
      param_1[1] = lVar2;
    }
  }
  return param_1;
}



longlong * FUN_14023aaa0(longlong param_1,longlong *param_2,longlong param_3)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  FUN_14023b410(param_3 + 0x30,*(undefined8 *)(param_1 + 8));
  puVar1 = *(undefined8 **)(param_1 + 8);
  for (puVar2 = puVar1 + -6; puVar2 != puVar1; puVar2 = puVar2 + 6) {
    if (7 < (ulonglong)puVar2[3]) {
      operator_delete((void *)*puVar2);
    }
    puVar2[3] = 7;
    puVar2[2] = 0;
    *(undefined2 *)puVar2 = 0;
  }
  *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -0x30;
  *param_2 = param_3;
  return param_2;
}



void FUN_14023ab30(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = param_1[1];
  if (*param_1 != lVar1) {
    lVar1 = FUN_14023b410(lVar1,lVar1);
    FUN_14023ae30(lVar1,param_1[1]);
    param_1[1] = lVar1;
  }
  return;
}



void FUN_14023ab70(ulonglong *param_1)

{
  ulonglong uVar1;
  
  uVar1 = *param_1;
  if (uVar1 != 0) {
    if ((uVar1 & 1) == 0) {
      if (*(code **)(uVar1 & 0xfffffffffffffffe) != (code *)0x0) {
        (**(code **)(uVar1 & 0xfffffffffffffffe))(param_1 + 1,param_1 + 1,2);
      }
    }
    *param_1 = 0;
  }
  return;
}



ulonglong * FUN_14023abb0(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  
  *param_1 = 0;
  uVar1 = *param_2;
  if (uVar1 != 0) {
    *param_1 = uVar1;
    if ((uVar1 & 1) != 0) {
      param_1[1] = param_2[1];
      param_1[2] = param_2[2];
      param_1[3] = param_2[3];
      param_1[4] = param_2[4];
      return param_1;
    }
    (**(code **)(uVar1 & 0xfffffffffffffffe))(param_2 + 1,param_1 + 1,0);
  }
  return param_1;
}



undefined8 FUN_14023ac20(longlong *param_1)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_1[1]) {
      return CONCAT71((int7)((ulonglong)*plVar1 >> 8),*plVar1 != 0);
    }
    iVar2 = DAT_140608154 + 1;
    bVar3 = DAT_140608154 == 0;
    DAT_140608154 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void FUN_14023ac70(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  
  FUN_1401975d0();
  lVar1 = *param_2;
  *param_1 = lVar1;
  param_1[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return;
}



void thunk_FUN_14023ae90(void)

{
  FUN_14023ae90();
  return;
}



undefined8 FUN_14023acc0(longlong *param_1)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  
  plVar1 = (longlong *)*param_1;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == (longlong *)param_1[1]) {
      return CONCAT71((int7)((ulonglong)*plVar1 >> 8),*plVar1 != 0);
    }
    iVar2 = DAT_1406081cc + 1;
    bVar3 = DAT_1406081cc == 0;
    DAT_1406081cc = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



undefined8 FUN_14023ad10(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_1406081cc + 1;
    bVar3 = DAT_1406081cc == 0;
    DAT_1406081cc = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



void FUN_14023ad50(ulonglong *param_1,void *param_2)

{
  void *pvVar1;
  void *pvVar2;
  
  pvVar1 = (void *)param_1[1];
  if ((param_2 < pvVar1) && (pvVar2 = (void *)*param_1, pvVar2 <= param_2)) {
    if (pvVar1 == (void *)param_1[2]) {
      FUN_14023af10(param_1);
    }
    param_2 = (void *)((((longlong)param_2 - (longlong)pvVar2) / 0xb0) * 0xb0 + *param_1);
  }
  else if (pvVar1 == (void *)param_1[2]) {
    FUN_14023af10(param_1);
  }
  if ((void *)param_1[1] != (void *)0x0) {
    memcpy((void *)param_1[1],param_2,0xb0);
  }
  param_1[1] = param_1[1] + 0xb0;
  return;
}



void FUN_14023adf0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140195ac0(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_14023ae30(undefined8 *param_1,undefined8 *param_2)

{
  for (; param_1 != param_2; param_1 = param_1 + 6) {
    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_14023ae90(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_14023b080(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_1406081d0 + 1;
      bVar5 = DAT_1406081d0 == 0;
      DAT_1406081d0 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_14023af10(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0xb0;
  if (0x1745d1745d1745c < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0xb0;
  if (uVar2 < uVar3) {
    if (0x1745d1745d1745d - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14023b180(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14023b180(param_1,uVar2);
  }
  return;
}



void FUN_14023afd0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  longlong lVar3;
  ulonglong uVar4;
  
  lVar3 = param_1[1] - *param_1;
  lVar3 = lVar3 + SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar3),8);
  uVar4 = (lVar3 >> 6) - (lVar3 >> 0x3f);
  if (0x222222222222221 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  lVar3 = param_1[2] - *param_1;
  lVar3 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar3),8) + lVar3;
  uVar2 = (lVar3 >> 6) - (lVar3 >> 0x3f);
  if (uVar2 < uVar4) {
    if (0x222222222222222 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar4) {
      uVar2 = uVar4;
    }
    FUN_14023b2c0(param_1,uVar2);
  }
  return;
}



void FUN_14023b080(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x68) != 0) {
    FUN_14023b880(*(longlong *)(param_1 + 0x68),*(undefined8 *)(param_1 + 0x70));
    operator_delete(*(void **)(param_1 + 0x68));
  }
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x58)) {
    operator_delete(*(void **)(param_1 + 0x40));
  }
  *(undefined8 *)(param_1 + 0x58) = 7;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined2 *)(param_1 + 0x40) = 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_14023b110(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x555555555555556) &&
     (pvVar1 = operator_new(param_1 * 0x30), 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_1405d3608);
}



void FUN_14023b180(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 (0x1745d1745d1745d < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0xb0) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0xb0);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14023baf0(*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 * 0xb0);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0xb0) * 0xb0);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_14023b2c0(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 (0x222222222222222 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  lVar5 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar5 >> 6) - (lVar5 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x78);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14023bb50(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    lVar6 = lVar1 - lVar2;
    lVar5 = lVar6 + SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar6),8);
    if (lVar2 != 0) {
      FUN_140195ac0(lVar2,lVar1,lVar6,lVar1,uVar7);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x78);
    param_1[1] = (longlong)(pcVar4 + ((lVar5 >> 6) - (lVar5 >> 0x3f)) * 0x78);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



longlong FUN_14023b410(longlong param_1,longlong param_2,longlong param_3)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  if (param_1 != param_2) {
    lVar3 = param_1 - param_3;
    lVar2 = param_3 - param_1;
    do {
      FUN_1400015e0(param_3,param_1,0,0xffffffffffffffff);
      puVar1 = (undefined4 *)(param_1 + 0x28 + lVar2);
      param_1 = param_1 + 0x30;
      param_3 = param_3 + 0x30;
      *puVar1 = *(undefined4 *)((longlong)puVar1 + lVar3);
    } while (param_1 != param_2);
  }
  return param_3;
}



int * FUN_14023b4a0(longlong *param_1,int *param_2)

{
  char **ppcVar1;
  int iVar2;
  char cVar3;
  undefined8 *puVar4;
  char *pcVar5;
  undefined8 *puVar6;
  int *piVar7;
  char **ppcVar8;
  char *local_res8;
  undefined8 local_res10;
  undefined **local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  
  iVar2 = *param_2;
  ppcVar1 = (char **)(param_1 + 1);
  puVar4 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar2 % (ulonglong)*ppcVar1) * 8);
  if (*param_1 == 0) {
    puVar4 = operator_new(0x20);
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (char *)0x0;
      std::exception::exception((exception *)&local_58,&local_res8);
      local_58 = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_58,(ThrowInfo *)&DAT_1405d3608);
    }
    *puVar4 = 0;
    puVar4[1] = local_50;
    puVar4[2] = local_48;
    puVar4[3] = local_40;
    piVar7 = (int *)(puVar4 + 1);
    if (piVar7 != (int *)0x0) {
      *piVar7 = *param_2;
      puVar4[2] = 0;
      puVar4[3] = 0;
    }
    iVar2 = *piVar7;
    if (*param_1 == 0) {
      local_res8 = (char *)FUN_1402c9710(param_1);
      ppcVar8 = &local_res8;
      if (local_res8 <= *ppcVar1) {
        ppcVar8 = ppcVar1;
      }
      *ppcVar1 = *ppcVar8;
      FUN_140346140(param_1);
      FUN_140296160(param_1);
    }
    else {
      local_res10 = 1;
      if ((ulonglong)param_1[7] < 2) {
        local_res8 = (char *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
        pcVar5 = (char *)FUN_1402c9710(param_1);
        if (pcVar5 != *ppcVar1) {
          FUN_14027dcb0(param_1);
        }
      }
    }
    puVar6 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar2 % (ulonglong)*ppcVar1) * 8);
    *puVar4 = *puVar6;
    *puVar6 = puVar4;
    param_1[4] = param_1[4] + 1;
    param_1[6] = (longlong)puVar6;
  }
  else {
    for (puVar6 = (undefined8 *)*puVar4; puVar6 != (undefined8 *)0x0; puVar6 = (undefined8 *)*puVar6
        ) {
      if (iVar2 == *(int *)(puVar6 + 1)) {
        if (puVar6 != (undefined8 *)0x0) {
          return (int *)(puVar6 + 1);
        }
        break;
      }
    }
    puVar6 = operator_new(0x20);
    if (puVar6 == (undefined8 *)0x0) {
      local_res8 = (char *)0x0;
      std::exception::exception((exception *)&local_58,&local_res8);
      local_58 = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_58,(ThrowInfo *)&DAT_1405d3608);
    }
    *puVar6 = 0;
    puVar6[1] = local_50;
    puVar6[2] = local_48;
    puVar6[3] = local_40;
    piVar7 = (int *)(puVar6 + 1);
    if (piVar7 != (int *)0x0) {
      *piVar7 = *param_2;
      puVar6[2] = 0;
      puVar6[3] = 0;
    }
    cVar3 = FUN_14027dc40(param_1);
    if (cVar3 != '\0') {
      puVar4 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar2 % (ulonglong)*ppcVar1) * 8);
    }
    *puVar6 = *puVar4;
    *puVar4 = puVar6;
    param_1[4] = param_1[4] + 1;
    puVar6 = (undefined8 *)param_1[6];
    if (puVar4 < (undefined8 *)param_1[6]) {
      puVar6 = puVar4;
    }
    param_1[6] = (longlong)puVar6;
  }
  return piVar7;
}



void FUN_14023b740(undefined8 *param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_14023bd20(param_1,*param_1,param_2,param_3,0xfffffffffffffffe);
  return;
}



longlong * FUN_14023b770(longlong *param_1,longlong *param_2,undefined8 *param_3)

{
  longlong *plVar1;
  int iVar2;
  int iVar3;
  
  if (param_1 == param_2) {
    return param_1;
  }
  do {
    if ((longlong *)*param_1 != (longlong *)0x0) {
      plVar1 = (longlong *)*param_3;
      iVar2 = (**(code **)(*(longlong *)*param_1 + 0x78))();
      iVar3 = (**(code **)(*plVar1 + 0x78))(plVar1);
      if (iVar3 == iVar2) {
        return param_1;
      }
    }
    param_1 = param_1 + 1;
  } while (param_1 != param_2);
  return param_1;
}



longlong FUN_14023b7f0(longlong param_1,longlong param_2,longlong param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  if (param_1 != param_2) {
    lVar2 = param_3;
    lVar3 = param_1 + 0x30;
    do {
      FUN_1400015e0(lVar2,lVar3 + -0x30,0,0xffffffffffffffff);
      *(undefined4 *)(lVar2 + 0x28) = *(undefined4 *)(lVar3 + -8);
      FUN_1400015e0(lVar2 + 0x30,lVar3);
      *(undefined4 *)(lVar2 + 0x58) = *(undefined4 *)(lVar3 + 0x28);
      *(undefined4 *)(lVar2 + 0x5c) = *(undefined4 *)(lVar3 + 0x2c);
      param_3 = lVar2 + 0x68;
      *(undefined4 *)(lVar2 + 0x60) = *(undefined4 *)(lVar3 + 0x30);
      lVar1 = lVar3 + 0x38;
      lVar2 = param_3;
      lVar3 = lVar3 + 0x68;
    } while (lVar1 != param_2);
  }
  return param_3;
}



void FUN_14023b880(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[-6]) {
        operator_delete((void *)puVar2[-9]);
      }
      puVar2[-6] = 7;
      puVar2[-7] = 0;
      *(undefined2 *)(puVar2 + -9) = 0;
      puVar1 = puVar2 + 4;
      puVar2 = puVar2 + 0xd;
    } while (puVar1 != param_2);
  }
  return;
}



undefined4 * FUN_14023b900(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_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  *(undefined8 *)(param_1 + 0x12) = *(undefined8 *)(param_2 + 0x12);
  *(undefined1 *)(param_1 + 0x14) = *(undefined1 *)(param_2 + 0x14);
  *(undefined1 *)((longlong)param_1 + 0x51) = *(undefined1 *)((longlong)param_2 + 0x51);
  param_1[0x15] = param_2[0x15];
  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];
  return param_1;
}



undefined2 * FUN_14023b9c0(longlong param_1,longlong param_2,undefined2 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  for (; param_1 != param_2; param_1 = param_1 + 0x30) {
    if (param_3 != (undefined2 *)0x0) {
      *(undefined8 *)(param_3 + 0xc) = 7;
      *(undefined8 *)(param_3 + 8) = 0;
      *param_3 = 0;
      FUN_1400015e0(param_3,param_1,0,0xffffffffffffffff,uVar1);
      *(undefined4 *)(param_3 + 0x14) = *(undefined4 *)(param_1 + 0x28);
    }
    param_3 = param_3 + 0x18;
  }
  return param_3;
}



undefined8 * FUN_14023ba50(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 2) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      param_3[1] = param_1[1];
    }
    param_3 = param_3 + 2;
  }
  return param_3;
}



void FUN_14023ba90(undefined8 *param_1)

{
  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[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 7;
  param_1[2] = 0;
  *(undefined2 *)param_1 = 0;
  return;
}



void * FUN_14023baf0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0xb0)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0xb0);
    }
    param_3 = (void *)((longlong)param_3 + 0xb0);
  }
  return param_3;
}



longlong FUN_14023bb50(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x78) {
    if (param_3 != 0) {
      FUN_14023b900(param_3,param_1);
    }
    param_3 = param_3 + 0x78;
  }
  return param_3;
}



void FUN_14023bbb0(undefined8 param_1,undefined8 *param_2,int param_3)

{
  if (param_3 != 4) {
    FUN_14023bc00();
    return;
  }
  *(undefined2 *)(param_2 + 1) = 0;
  *param_2 = &std::binder1st<>::RTTI_Type_Descriptor;
  return;
}



void FUN_14023bbe0(undefined8 param_1,undefined8 *param_2,int param_3)

{
  if (param_3 != 4) {
    FUN_14023bc90();
    return;
  }
  *(undefined2 *)(param_2 + 1) = 0;
  *param_2 = &std::binder1st<>::RTTI_Type_Descriptor;
  return;
}



void FUN_14023bc00(undefined8 *param_1,undefined8 *param_2,int param_3)

{
  bool bVar1;
  undefined8 *puVar2;
  
  if ((param_3 == 0) || (param_3 == 1)) {
    if (param_2 != (undefined8 *)0x0) {
      *param_2 = *param_1;
      param_2[1] = param_1[1];
    }
  }
  else if (param_3 != 2) {
    if (param_3 == 3) {
      bVar1 = type_info::operator==
                        ((type_info *)*param_2,(type_info *)&std::binder1st<>::RTTI_Type_Descriptor)
      ;
      puVar2 = (undefined8 *)0x0;
      if (bVar1) {
        puVar2 = param_1;
      }
      *param_2 = puVar2;
      return;
    }
    *(undefined2 *)(param_2 + 1) = 0;
    *param_2 = &std::binder1st<>::RTTI_Type_Descriptor;
    return;
  }
  return;
}



void FUN_14023bc90(undefined8 *param_1,undefined8 *param_2,int param_3)

{
  bool bVar1;
  undefined8 *puVar2;
  
  if ((param_3 == 0) || (param_3 == 1)) {
    if (param_2 != (undefined8 *)0x0) {
      *param_2 = *param_1;
      param_2[1] = param_1[1];
    }
  }
  else if (param_3 != 2) {
    if (param_3 == 3) {
      bVar1 = type_info::operator==
                        ((type_info *)*param_2,(type_info *)&std::binder1st<>::RTTI_Type_Descriptor)
      ;
      puVar2 = (undefined8 *)0x0;
      if (bVar1) {
        puVar2 = param_1;
      }
      *param_2 = puVar2;
      return;
    }
    *(undefined2 *)(param_2 + 1) = 0;
    *param_2 = &std::binder1st<>::RTTI_Type_Descriptor;
    return;
  }
  return;
}



void FUN_14023bd20(longlong *param_1,void *param_2,void *param_3,longlong param_4)

{
  ulonglong uVar1;
  size_t sVar2;
  code *pcVar3;
  longlong lVar4;
  void *_Dst;
  void *pvVar5;
  longlong lVar6;
  ulonglong uVar7;
  
  uVar7 = param_4 - (longlong)param_3 >> 2;
  if (uVar7 != 0) {
    pvVar5 = (void *)param_1[1];
    lVar6 = (longlong)pvVar5 - *param_1 >> 2;
    if (0x3fffffffffffffffU - lVar6 < uVar7) {
      std::_Xlength_error("vector<T> too long");
      pcVar3 = (code *)swi(3);
      (*pcVar3)();
      return;
    }
    uVar1 = lVar6 + uVar7;
    if ((ulonglong)(param_1[2] - *param_1 >> 2) < uVar1) {
      lVar4 = FUN_140056ac0(param_1,uVar1,uVar1,pvVar5,0xfffffffffffffffe);
      _Dst = (void *)FUN_140055720(param_1 + 3,lVar4);
      sVar2 = ((longlong)param_2 - *param_1 >> 2) * 4;
      pvVar5 = memmove(_Dst,(void *)*param_1,sVar2);
      pvVar5 = memmove((void *)(sVar2 + (longlong)pvVar5),param_3,uVar7 * 4);
      memmove((void *)(uVar7 * 4 + (longlong)pvVar5),param_2,
              param_1[1] - (longlong)param_2 & 0xfffffffffffffffc);
      pvVar5 = (void *)*param_1;
      lVar6 = param_1[1];
      if (pvVar5 != (void *)0x0) {
        operator_delete(pvVar5);
      }
      param_1[2] = (longlong)((longlong)_Dst + lVar4 * 4);
      param_1[1] = (longlong)((longlong)_Dst + (uVar7 + (lVar6 - (longlong)pvVar5 >> 2)) * 4);
      *param_1 = (longlong)_Dst;
    }
    else {
      sVar2 = uVar7 * 4;
      memmove(pvVar5,param_3,sVar2);
      FUN_1401560e0(param_2,param_1[1],sVar2 + param_1[1]);
      param_1[1] = param_1[1] + sVar2;
    }
  }
  return;
}



void FUN_14023be90(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;
}



undefined1 FUN_14023bee0(void)

{
  return 0;
}



undefined8 * FUN_14023bf00(longlong param_1,uint param_2)

{
  if (param_2 < 0xf) {
    return (undefined8 *)(param_1 + (longlong)(int)param_2 * 8);
  }
  if (DAT_140608178 == 0) {
    FUN_140176d60(0);
  }
  DAT_140608178 = DAT_140608178 + 1;
  return &DAT_140608170;
}



float FUN_14023bf40(longlong *param_1,undefined4 param_2)

{
  float fVar1;
  float fVar2;
  
  switch(param_2) {
  case 0:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)(param_1 + 0xf7);
    break;
  case 1:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)((longlong)param_1 + 0x7bc);
    break;
  case 2:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)(param_1 + 0xf8);
    break;
  case 3:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)((longlong)param_1 + 0x7c4);
    break;
  case 4:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)(param_1 + 0xf9);
    break;
  case 5:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)((longlong)param_1 + 0x7cc);
    break;
  case 6:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)(param_1 + 0xfa);
    break;
  case 7:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)((longlong)param_1 + 0x7d4);
    break;
  case 8:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)(param_1 + 0xfb);
    break;
  case 9:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)((longlong)param_1 + 0x7dc);
    break;
  case 10:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)(param_1 + 0xfc);
    break;
  case 0xb:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)((longlong)param_1 + 0x7e4);
    break;
  case 0xc:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)(param_1 + 0xfd);
    break;
  case 0xd:
    fVar1 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
    fVar1 = fVar1 + *(float *)((longlong)param_1 + 0x7b4) + *(float *)((longlong)param_1 + 0x7ec);
    break;
  default:
    return 0.0;
  }
  fVar2 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
  return fVar2 + fVar1;
}



undefined8 * FUN_14023c1c0(longlong param_1,int param_2,int param_3)

{
  bool bVar1;
  undefined8 *puVar2;
  
  bVar1 = param_3 < *(int *)(param_1 + 0x80);
  if (param_2 == 1) {
    if ((bVar1) || (*(longlong *)(param_1 + 0x198) == 0)) {
      puVar2 = (undefined8 *)(param_1 + 0xe8);
      if (7 < *(ulonglong *)(param_1 + 0x100)) {
        return (undefined8 *)*puVar2;
      }
    }
    else {
      puVar2 = (undefined8 *)(param_1 + 0x188);
      if (7 < *(ulonglong *)(param_1 + 0x1a0)) {
        return (undefined8 *)*puVar2;
      }
    }
  }
  else if (param_2 == 2) {
    if ((bVar1) || (*(longlong *)(param_1 + 0x1c0) == 0)) {
      puVar2 = (undefined8 *)(param_1 + 0x110);
      if (7 < *(ulonglong *)(param_1 + 0x128)) {
        return (undefined8 *)*puVar2;
      }
    }
    else {
      puVar2 = (undefined8 *)(param_1 + 0x1b0);
      if (7 < *(ulonglong *)(param_1 + 0x1c8)) {
        return (undefined8 *)*puVar2;
      }
    }
  }
  else if (param_2 == 3) {
    if ((bVar1) || (*(longlong *)(param_1 + 0x1e8) == 0)) {
      puVar2 = (undefined8 *)(param_1 + 0x138);
      if (7 < *(ulonglong *)(param_1 + 0x150)) {
        return (undefined8 *)*puVar2;
      }
    }
    else {
      puVar2 = (undefined8 *)(param_1 + 0x1d8);
      if (7 < *(ulonglong *)(param_1 + 0x1f0)) {
        return (undefined8 *)*puVar2;
      }
    }
  }
  else if (param_2 == 4) {
    if ((bVar1) || (*(longlong *)(param_1 + 0x210) == 0)) {
      puVar2 = (undefined8 *)(param_1 + 0x160);
      if (7 < *(ulonglong *)(param_1 + 0x178)) {
        return (undefined8 *)*puVar2;
      }
    }
    else {
      puVar2 = (undefined8 *)(param_1 + 0x200);
      if (7 < *(ulonglong *)(param_1 + 0x218)) {
        return (undefined8 *)*puVar2;
      }
    }
  }
  else {
    puVar2 = (undefined8 *)0x0;
  }
  return puVar2;
}



undefined4 FUN_14023c2c0(longlong param_1,int param_2,int param_3)

{
  bool bVar1;
  
  bVar1 = *(int *)(param_1 + 0x80) <= param_3;
  if (param_2 == 1) {
    if ((bVar1) && (*(longlong *)(param_1 + 0x198) != 0)) {
      return *(undefined4 *)(param_1 + 0x44);
    }
    return *(undefined4 *)(param_1 + 0x34);
  }
  if (param_2 == 2) {
    if ((bVar1) && (*(longlong *)(param_1 + 0x1c0) != 0)) {
      return *(undefined4 *)(param_1 + 0x48);
    }
    return *(undefined4 *)(param_1 + 0x38);
  }
  if (param_2 == 3) {
    if ((bVar1) && (*(longlong *)(param_1 + 0x1e8) != 0)) {
      return *(undefined4 *)(param_1 + 0x4c);
    }
    return *(undefined4 *)(param_1 + 0x3c);
  }
  if (param_2 != 4) {
    return 0;
  }
  if ((bVar1) && (*(longlong *)(param_1 + 0x210) != 0)) {
    return *(undefined4 *)(param_1 + 0x50);
  }
  return *(undefined4 *)(param_1 + 0x40);
}



undefined2 * FUN_14023c340(longlong param_1,undefined2 *param_2)

{
  *(undefined8 *)(param_2 + 0xc) = 7;
  *(undefined8 *)(param_2 + 8) = 0;
  *param_2 = 0;
  FUN_1400015e0(param_2,param_1 + 0x6b0,0,0xffffffffffffffff);
  return param_2;
}



longlong * FUN_14023c380(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 0x20);
  if (0xf < *(ulonglong *)(param_1 + 0x38)) {
    plVar1 = (longlong *)*plVar1;
  }
  return plVar1;
}



int FUN_14023c390(longlong param_1)

{
  float fVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  float fVar6;
  
  uVar5 = FUN_1402f8580();
  fVar1 = *(float *)(param_1 + 0x740);
  iVar2 = *(int *)(param_1 + 0x624);
  iVar3 = *(int *)(param_1 + 0x5d8);
  iVar4 = *(int *)(param_1 + 0x874);
  fVar6 = (float)FUN_1402f7da0(param_1,uVar5);
  return (int)((fVar6 + (float)(int)((fVar1 + 1.0) * (float)iVar2 + (float)iVar3 + (float)iVar4) +
               (float)(*(int *)(param_1 + 0x8bc) + *(int *)(param_1 + 0x62c))) *
               (*(float *)(param_1 + 0x748) + 1.0 + *(float *)(param_1 + 0x8f8)) +
               (float)*(int *)(param_1 + 0x87c) + (float)*(int *)(param_1 + 0x8a0));
}



undefined4 * FUN_14023c460(longlong param_1,uint param_2)

{
  if (param_2 < 0x47) {
    return (undefined4 *)(param_1 + (longlong)(int)param_2 * 4);
  }
  if (DAT_140608134 == 0) {
    FUN_140176d60(0);
  }
  DAT_140608134 = DAT_140608134 + 1;
  return &DAT_140608130;
}



int FUN_14023c4a0(longlong param_1)

{
  float fVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  float fVar6;
  
  uVar5 = FUN_1402f8580();
  fVar1 = *(float *)(param_1 + 0x740);
  iVar2 = *(int *)(param_1 + 0x624);
  iVar3 = *(int *)(param_1 + 0x5d4);
  iVar4 = *(int *)(param_1 + 0x874);
  fVar6 = (float)FUN_1402f7da0(param_1,uVar5);
  return (int)((fVar6 + (float)(int)((fVar1 + 1.0) * (float)iVar2 + (float)iVar3 + (float)iVar4) +
               (float)(*(int *)(param_1 + 0x8bc) + *(int *)(param_1 + 0x62c))) *
               (*(float *)(param_1 + 0x748) + 1.0 + *(float *)(param_1 + 0x8f8)) +
               (float)*(int *)(param_1 + 0x87c) + (float)*(int *)(param_1 + 0x8a0));
}



undefined8 *
FUN_14023c570(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  FUN_1402166f0();
  *param_1 = MGSCharacterEnemy::vftable;
  param_1[0x41a] = 0;
  param_1[0x41b] = 0;
  param_1[0x41c] = 0;
  *(undefined4 *)(param_1 + 0x41d) = 4;
  *(undefined4 *)((longlong)param_1 + 0x20ec) = 2;
  *(undefined4 *)(param_1 + 0x41e) = 4;
  *(undefined4 *)((longlong)param_1 + 0x20f4) = 4;
  *(undefined4 *)(param_1 + 0x41f) = 2;
  *(undefined4 *)((longlong)param_1 + 0x20fc) = 4;
  param_1[0x420] = 0;
  param_1[0x421] = 0;
  *(undefined4 *)(param_1 + 0x422) = 0;
  *(undefined2 *)((longlong)param_1 + 0x2114) = 0;
  param_1[0x423] = 0;
  param_1[0x424] = 0;
  param_1[0x425] = 0;
  param_1[0x427] = 0;
  param_1[0x428] = 0;
  param_1[0x429] = 0;
  param_1[0x42a] = 0;
  param_1[0x42b] = 0;
  param_1[0x42c] = 0;
  *(undefined4 *)(param_1 + 0x42e) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2174) = 2;
  param_1[0x432] = 7;
  param_1[0x431] = 0;
  *(undefined2 *)(param_1 + 0x42f) = 0;
  param_1[0x434] = 0;
  param_1[0x435] = 0;
  param_1[0x436] = 0;
  param_1[0x437] = 0;
  param_1[0x438] = 0;
  param_1[0x439] = 0;
  param_1[0x43a] = 0;
  param_1[0x43b] = 0;
  param_1[0x43c] = 0;
  param_1[0x43d] = 0;
  param_1[0x43e] = 0;
  param_1[0x43f] = 0;
  param_1[0x440] = 0;
  param_1[0x441] = 0;
  param_1[0x443] = 0;
  param_1[0x444] = 0;
  *(undefined1 *)(param_1 + 0x445) = 0;
  param_1[0x446] = 0;
  param_1[0x447] = 0;
  param_1[0x448] = 0;
  *(undefined2 *)(param_1 + 1099) = 0;
  param_1[0x44c] = 0;
  param_1[0x44d] = 0;
  param_1[0x44e] = 0;
  param_1[0x44f] = 0;
  *(undefined1 *)(param_1 + 0x450) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2284) = 0;
  param_1[0x451] = 0;
  param_1[0x452] = 0;
  *(undefined1 *)(param_1 + 0x453) = 0;
  *(undefined4 *)((longlong)param_1 + 0x229c) = 0;
  *(undefined4 *)(param_1 + 0x454) = 0x3f800000;
  *(undefined1 *)((longlong)param_1 + 0x22a4) = 0;
  FUN_140001710(param_1 + 0x294,L"respawn01",9,param_4,uVar1);
  *(undefined4 *)(param_1 + 0x34c) = 99;
  return param_1;
}



void * FUN_14023c780(void *param_1,uint param_2)

{
  FUN_14023c7b0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14023c7b0(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = MGSCharacterEnemy::vftable;
  plVar3 = (longlong *)param_1[0x44e];
  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);
      }
    }
  }
  if ((void *)param_1[0x446] != (void *)0x0) {
    operator_delete((void *)param_1[0x446]);
  }
  param_1[0x446] = 0;
  param_1[0x447] = 0;
  param_1[0x448] = 0;
  if ((void *)param_1[0x43f] != (void *)0x0) {
    operator_delete((void *)param_1[0x43f]);
  }
  param_1[0x43f] = 0;
  param_1[0x440] = 0;
  param_1[0x441] = 0;
  plVar3 = (longlong *)param_1[0x43e];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x436];
  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);
      }
    }
  }
  if (7 < (ulonglong)param_1[0x432]) {
    operator_delete((void *)param_1[0x42f]);
  }
  param_1[0x432] = 7;
  param_1[0x431] = 0;
  *(undefined2 *)(param_1 + 0x42f) = 0;
  if ((void *)param_1[0x42a] != (void *)0x0) {
    operator_delete((void *)param_1[0x42a]);
  }
  param_1[0x42a] = 0;
  param_1[0x42b] = 0;
  param_1[0x42c] = 0;
  plVar3 = (longlong *)param_1[0x429];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x41b];
  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);
      }
    }
  }
  FUN_1402172a0(param_1);
  return;
}



void FUN_14023c980(longlong *param_1)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  longlong lVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  short *psVar7;
  undefined2 *puVar8;
  short *psVar9;
  undefined8 *puVar10;
  float fVar11;
  undefined4 uVar12;
  undefined1 local_res8 [8];
  undefined2 local_288;
  undefined6 uStack_286;
  undefined8 local_278;
  ulonglong local_270;
  undefined1 local_260 [8];
  longlong *local_258;
  undefined1 local_250 [8];
  longlong *local_248;
  undefined1 local_240 [8];
  longlong *local_238;
  undefined1 local_230 [8];
  longlong *local_228;
  undefined8 local_220;
  wchar_t local_218 [256];
  
  local_220 = 0xfffffffffffffffe;
  uVar5 = FUN_1402eeee0(DAT_140608068,local_230,(int)param_1[0x24]);
  FUN_140343ec0(param_1 + 0x26,uVar5);
  if (local_228 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_228 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_228 + 8))(local_228);
      LOCK();
      piVar2 = (int *)((longlong)local_228 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_228 + 0x10))(local_228);
      }
    }
  }
  puVar10 = (undefined8 *)(param_1[0x26] + 200);
  if (7 < *(ulonglong *)(param_1[0x26] + 0xe0)) {
    puVar10 = (undefined8 *)*puVar10;
  }
  uVar5 = FUN_140334cf0(DAT_1406081f0,local_240,puVar10);
  FUN_140343ec0(param_1 + 0x44d,uVar5);
  if (local_238 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_238 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_238 + 8))(local_238);
      LOCK();
      piVar2 = (int *)((longlong)local_238 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_238 + 0x10))(local_238);
      }
    }
  }
  if (param_1[0x44d] == 0) {
    swprintf_s(local_218,0x100,L"%s");
  }
  FUN_140244750(param_1);
  FUN_140217c30(param_1);
  lVar4 = param_1[0x26];
  if ((int)(*(longlong *)(lVar4 + 0x350) - *(longlong *)(lVar4 + 0x348) >> 2) < 1) {
    fVar11 = 0.0;
  }
  else {
    fVar11 = **(float **)(lVar4 + 0x348);
  }
  param_1[0x28a] = (longlong)(double)fVar11;
  psVar7 = (short *)(lVar4 + 0x28);
  if (7 < *(ulonglong *)(lVar4 + 0x40)) {
    psVar7 = *(short **)psVar7;
  }
  local_270 = 7;
  local_278 = 0;
  local_288 = 0;
  uVar6 = 0xffffffffffffffff;
  psVar9 = psVar7;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar3 = *psVar9;
    psVar9 = psVar9 + 1;
  } while (sVar3 != 0);
  FUN_140001710(&local_288,psVar7,~uVar6 - 1);
  FUN_140002aa0(&local_288,L"_server",7);
  puVar8 = &local_288;
  if (7 < local_270) {
    puVar8 = (undefined2 *)CONCAT62(uStack_286,local_288);
  }
  (**(code **)(*param_1 + 0x8d8))(param_1,puVar8);
  FUN_1402f81e0(param_1,*(undefined4 *)(param_1[0x26] + 0x1f0));
  lVar4 = param_1[0x3d0];
  if (lVar4 != 0) {
    param_1[0xa2] = *(longlong *)(lVar4 + 0x68);
    param_1[0x44f] = *(longlong *)(lVar4 + 0x68);
  }
  FUN_14023d010(param_1);
  lVar4 = param_1[0x434];
  if ((lVar4 == 0) || (*(longlong *)(lVar4 + 0x230) == 0)) {
    puVar10 = (undefined8 *)(param_1[0x26] + 0x868);
  }
  else {
    puVar10 = (undefined8 *)(lVar4 + 0x220);
  }
  if (7 < (ulonglong)puVar10[3]) {
    puVar10 = (undefined8 *)*puVar10;
  }
  uVar5 = FUN_140336e90(DAT_1406081f8,local_260,local_res8,puVar10);
  FUN_140343ec0(param_1 + 0x428,uVar5);
  if (local_258 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_258 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_258 + 8))(local_258);
      LOCK();
      piVar2 = (int *)((longlong)local_258 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_258 + 0x10))(local_258);
      }
    }
  }
  if (param_1[0x428] != 0) {
    FUN_140243fa0(param_1);
  }
  FUN_140244bc0(param_1);
  *(int *)(param_1 + 0x426) = (int)param_1[0xb3];
  puVar10 = (undefined8 *)(param_1[0x26] + 0x8b8);
  if (7 < *(ulonglong *)(param_1[0x26] + 0x8d0)) {
    puVar10 = (undefined8 *)*puVar10;
  }
  uVar5 = FUN_140337f10(DAT_1406081f8,local_250,local_res8,puVar10);
  FUN_140343ec0(param_1 + 0x435,uVar5);
  if (local_248 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_248 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_248 + 8))(local_248);
      LOCK();
      piVar2 = (int *)((longlong)local_248 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_248 + 0x10))(local_248);
      }
    }
  }
  if ((longlong *)param_1[0x3d0] != (longlong *)0x0) {
    uVar12 = (**(code **)(*(longlong *)param_1[0x3d0] + 0x200))();
    *(undefined4 *)(param_1 + 0x452) = uVar12;
    uVar12 = (**(code **)(*(longlong *)param_1[0x3d0] + 0x220))();
    *(undefined4 *)((longlong)param_1 + 0x2294) = uVar12;
  }
  if (7 < local_270) {
    operator_delete((void *)CONCAT62(uStack_286,local_288));
  }
  return;
}



void FUN_14023cd20(longlong param_1,longlong *param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  if (*(longlong *)(param_1 + 0x20d0) == 0) {
    puVar1 = operator_new(200);
    if (puVar1 == (undefined8 *)0x0) {
      puVar1 = (undefined8 *)0x0;
    }
    else {
      *puVar1 = 0;
      puVar1[0x14] = param_1;
      puVar1[0x15] = 0;
      *(undefined1 *)(puVar1 + 0x16) = 0;
      *(undefined4 *)(puVar1 + 0x18) = 0xffffffff;
      memset(puVar1 + 1,0,0x98);
    }
    FUN_140246330(param_1 + 0x20d0,puVar1);
  }
  puVar1 = *(undefined8 **)(param_1 + 0x20e0);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  *(longlong **)(param_1 + 0x20e0) = param_2;
  (**(code **)(*param_2 + 8))(param_2,param_1);
  puVar1 = *(undefined8 **)(param_1 + 0x20d0);
  lVar3 = (longlong)param_2 - (longlong)puVar1;
  lVar2 = 0x13;
  do {
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
    *puVar1 = *(undefined8 *)(lVar3 + (longlong)puVar1);
  } while (lVar2 != 0);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014023cf01)

void FUN_14023ce10(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  longlong lVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  undefined8 *puVar7;
  short *psVar8;
  undefined1 local_res8 [8];
  undefined1 local_40 [8];
  longlong *local_38;
  undefined1 local_30 [8];
  longlong *local_28;
  undefined1 local_20 [8];
  longlong *local_18;
  
  uVar5 = FUN_1402eeee0(DAT_140608068,local_40,*(undefined4 *)(param_1 + 0x120),param_4,
                        0xfffffffffffffffe);
  FUN_140343ec0(param_1 + 0x130,uVar5);
  if (local_38 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_38 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_38 + 8))(local_38);
      LOCK();
      piVar2 = (int *)((longlong)local_38 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_38 + 0x10))(local_38);
      }
    }
  }
  puVar7 = (undefined8 *)(*(longlong *)(param_1 + 0x130) + 200);
  if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x130) + 0xe0)) {
    puVar7 = (undefined8 *)*puVar7;
  }
  uVar5 = FUN_140334cf0(DAT_1406081f0,local_30,puVar7);
  FUN_140343ec0(param_1 + 0x2268,uVar5);
  if (local_28 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_28 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_28 + 8))(local_28);
      LOCK();
      piVar2 = (int *)((longlong)local_28 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_28 + 0x10))(local_28);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2150) != *(longlong *)(param_1 + 0x2158)) {
    *(longlong *)(param_1 + 0x2158) = *(longlong *)(param_1 + 0x2150);
  }
  lVar4 = *(longlong *)(param_1 + 0x21a0);
  if ((lVar4 == 0) || (*(longlong *)(lVar4 + 0x230) == 0)) {
    psVar8 = (short *)(*(longlong *)(param_1 + 0x130) + 0x868);
  }
  else {
    psVar8 = (short *)(lVar4 + 0x220);
  }
  if (7 < *(ulonglong *)(psVar8 + 0xc)) {
    psVar8 = *(short **)psVar8;
  }
  uVar6 = 0xffffffffffffffff;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar3 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar3 != 0);
  if (1 < ~uVar6 - 1) {
    uVar5 = FUN_140336e90(DAT_1406081f8,local_20,local_res8);
    FUN_140343ec0(param_1 + 0x2140,uVar5);
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_18 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_18 + 8))(local_18);
        LOCK();
        piVar2 = (int *)((longlong)local_18 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_18 + 0x10))(local_18);
        }
      }
    }
  }
  if (*(longlong *)(param_1 + 0x2140) != 0) {
    FUN_140243fa0(param_1);
  }
  FUN_140244750(param_1);
  FUN_14023d010(param_1);
  return;
}



void FUN_14023d010(longlong param_1)

{
  int *piVar1;
  short sVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  longlong *plVar6;
  undefined8 uVar7;
  ulonglong uVar8;
  undefined8 *puVar9;
  ulonglong *puVar10;
  short *psVar11;
  undefined8 *puVar12;
  short *psVar13;
  undefined1 local_res8 [8];
  undefined8 local_50;
  undefined8 local_48;
  undefined8 local_40;
  longlong *local_38;
  undefined1 local_30 [8];
  longlong *local_28;
  
  psVar13 = (short *)(*(longlong *)(param_1 + 0x130) + 0x890);
  if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x130) + 0x8a8)) {
    psVar13 = *(short **)psVar13;
  }
  uVar8 = 0xffffffffffffffff;
  psVar11 = psVar13;
  do {
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    sVar2 = *psVar11;
    psVar11 = psVar11 + 1;
  } while (sVar2 != 0);
  if (1 < ~uVar8 - 1) {
    uVar7 = FUN_140337490(DAT_1406081f8,local_30,local_res8,psVar13,0xfffffffffffffffe);
    FUN_140343ec0(param_1 + 0x21e8,uVar7);
    if (local_28 != (longlong *)0x0) {
      LOCK();
      plVar4 = local_28 + 1;
      *(int *)plVar4 = (int)*plVar4 + -1;
      UNLOCK();
      if ((int)*plVar4 == 0) {
        (**(code **)(*local_28 + 8))(local_28);
        LOCK();
        piVar1 = (int *)((longlong)local_28 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_28 + 0x10))(local_28);
        }
      }
    }
    lVar3 = *(longlong *)(param_1 + 0x21e8);
    if (lVar3 != 0) {
      puVar12 = *(undefined8 **)(lVar3 + 0x30);
      puVar10 = (ulonglong *)(param_1 + 0x21f8);
      FUN_140246190(puVar10,*(longlong *)(lVar3 + 0x38) - (longlong)puVar12 >> 4);
      if (puVar12 != *(undefined8 **)(lVar3 + 0x38)) {
        local_50 = 0;
        do {
          uVar7 = *puVar12;
          plVar4 = (longlong *)puVar12[1];
          if (plVar4 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
            UNLOCK();
          }
          puVar5 = *(undefined8 **)(param_1 + 0x2200);
          local_48 = uVar7;
          local_40 = uVar7;
          local_38 = plVar4;
          if (&local_50 < puVar5) {
            puVar9 = (undefined8 *)*puVar10;
            if (&local_50 < puVar9) goto LAB_14023d17b;
            if (puVar5 == *(undefined8 **)(param_1 + 0x2208)) {
              FUN_1402462a0(puVar10);
            }
            puVar9 = (undefined8 *)
                     (((longlong)&local_50 - (longlong)puVar9 & 0xfffffffffffffff0U) + *puVar10);
            puVar5 = *(undefined8 **)(param_1 + 0x2200);
            if (puVar5 != (undefined8 *)0x0) {
              *puVar5 = *puVar9;
              puVar5[1] = puVar9[1];
            }
          }
          else {
LAB_14023d17b:
            if (puVar5 == *(undefined8 **)(param_1 + 0x2208)) {
              FUN_1402462a0(puVar10);
            }
            puVar5 = *(undefined8 **)(param_1 + 0x2200);
            if (puVar5 != (undefined8 *)0x0) {
              *puVar5 = local_50;
              puVar5[1] = uVar7;
            }
          }
          plVar6 = local_38;
          *(longlong *)(param_1 + 0x2200) = *(longlong *)(param_1 + 0x2200) + 0x10;
          if (plVar4 != (longlong *)0x0) {
            LOCK();
            plVar4 = plVar4 + 1;
            *(int *)plVar4 = (int)*plVar4 + -1;
            UNLOCK();
            if ((int)*plVar4 == 0) {
              (**(code **)(*local_38 + 8))(local_38);
              LOCK();
              piVar1 = (int *)((longlong)plVar6 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*local_38 + 0x10))();
              }
            }
          }
          puVar12 = puVar12 + 2;
        } while (puVar12 != *(undefined8 **)(lVar3 + 0x38));
      }
    }
  }
  return;
}



void FUN_14023d200(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  longlong lVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  short *psVar7;
  short *psVar8;
  undefined1 local_20 [8];
  longlong *local_18;
  
  lVar4 = *(longlong *)(param_1 + 0x21a0);
  if ((lVar4 == 0) || (*(longlong *)(lVar4 + 0x208) == 0)) {
    psVar8 = (short *)(*(longlong *)(param_1 + 0x130) + 0x458);
  }
  else {
    psVar8 = (short *)(lVar4 + 0x1f8);
  }
  if (7 < *(ulonglong *)(psVar8 + 0xc)) {
    psVar8 = *(short **)psVar8;
  }
  uVar6 = 0xffffffffffffffff;
  psVar7 = psVar8;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar3 = *psVar7;
    psVar7 = psVar7 + 1;
  } while (sVar3 != 0);
  if (1 < ~uVar6 - 1) {
    uVar5 = FUN_1402ed720(DAT_140608060,local_20,psVar8,0,0);
    FUN_140343ec0(param_1 + 0x11b0,uVar5);
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_18 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_18 + 8))(local_18);
        LOCK();
        piVar2 = (int *)((longlong)local_18 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_18 + 0x10))(local_18);
        }
      }
    }
  }
  return;
}



void FUN_14023d2d0(longlong param_1)

{
  float fVar1;
  
  if ((*(longlong *)(param_1 + 0x21a0) == 0) ||
     (fVar1 = *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x15c), fVar1 <= 0.01)) {
    fVar1 = *(float *)(*(longlong *)(param_1 + 0x130) + 0x2a4);
  }
  *(float *)(param_1 + 0x1e54) = fVar1 * *(float *)(param_1 + 0x1e50);
  return;
}



void FUN_14023d310(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  undefined4 uVar4;
  int iVar5;
  longlong lVar6;
  undefined8 uVar7;
  bool bVar8;
  longlong *local_20;
  longlong *local_18;
  
  lVar6 = *(longlong *)(param_1 + 0x1e80);
  if (((lVar6 != 0) && (lVar1 = *(longlong *)(lVar6 + 0x30), lVar1 != 0)) &&
     (*(longlong *)(lVar1 + 0x2d0) != 0)) {
    iVar5 = *(int *)(*(longlong *)(lVar1 + 0x2d0) + 0x4c0);
    lVar6 = FUN_14018fbc0(*(longlong *)(lVar6 + 0x48),
                          *(undefined4 *)(*(longlong *)(lVar6 + 0x48) + 0x198),param_3,param_4,
                          0xfffffffffffffffe);
    if ((lVar6 != 0) && (iVar5 == 1)) {
      uVar7 = FUN_140198570(lVar6,&local_20);
      uVar7 = FUN_140174f50(uVar7);
      uVar4 = FUN_1402f8580(uVar7);
      FUN_1402f81e0(param_1,uVar4);
      plVar3 = local_20;
      if (local_20 != (longlong *)0x0) {
        if (local_20 == local_18) {
          if (local_20 != (longlong *)0x0) {
            LOCK();
            local_20 = local_20 + 1;
            *(int *)local_20 = (int)*local_20 + -1;
            UNLOCK();
            if ((int)*local_20 == 0) {
              local_20 = (longlong *)0x0;
              puVar2 = (undefined8 *)*plVar3;
              if (puVar2 != (undefined8 *)0x0) {
                (**(code **)*puVar2)(puVar2,1);
              }
              operator_delete(plVar3);
            }
          }
        }
        else {
          iVar5 = DAT_140608054 + 1;
          bVar8 = DAT_140608054 == 0;
          DAT_140608054 = iVar5;
          if (bVar8) {
            FUN_140176d60(1);
          }
        }
      }
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014023d434)
// WARNING: Removing unreachable block (ram,0x00014023d440)

void FUN_14023d410(longlong param_1)

{
  undefined8 *puVar1;
  longlong *plVar2;
  bool bVar3;
  
  if (*(longlong *)(param_1 + 0x2150) != *(longlong *)(param_1 + 0x2158)) {
    *(longlong *)(param_1 + 0x2158) = *(longlong *)(param_1 + 0x2150);
  }
  FUN_140217f50(param_1);
  puVar1 = *(undefined8 **)(param_1 + 0x20e0);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  bVar3 = DAT_140607be2 != '\0';
  *(undefined8 *)(param_1 + 0x20e0) = 0;
  *(undefined8 *)(param_1 + 0x21a0) = 0;
  if (bVar3) {
    plVar2 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x380);
    (**(code **)(*plVar2 + 0x340))
              (plVar2,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,
               param_1 + 0x128);
  }
  return;
}



uint * FUN_14023d4e0(longlong param_1)

{
  uint uVar1;
  uint *puVar2;
  longlong lVar3;
  
  lVar3 = *(longlong *)(param_1 + 0x21a0);
  if ((lVar3 == 0) ||
     ((puVar2 = (uint *)(lVar3 + 0x174), *puVar2 == 0 && (*(int *)(lVar3 + 0x178) == 0)))) {
    uVar1 = *(uint *)(param_1 + 0x120);
    lVar3 = FUN_140302f80();
    if (*(longlong *)(lVar3 + 0x90) != 0) {
      for (puVar2 = *(uint **)(*(longlong *)(lVar3 + 0x90) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0xa0)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x248)) {
        if ((puVar2[0x24a] == uVar1) && (*puVar2 == uVar1)) {
          if (puVar2 != (uint *)0x0) goto LAB_14023d555;
          break;
        }
      }
    }
    puVar2 = (uint *)0x0;
LAB_14023d555:
    if (puVar2 == (uint *)0x0) {
      return (uint *)&DAT_140607d08;
    }
    puVar2 = puVar2 + 0xb0;
  }
  return puVar2;
}



uint * FUN_14023d580(longlong param_1)

{
  uint uVar1;
  uint *puVar2;
  longlong lVar3;
  
  lVar3 = *(longlong *)(param_1 + 0x21a0);
  if ((lVar3 == 0) ||
     ((puVar2 = (uint *)(lVar3 + 0x168), *puVar2 == 0 && (*(int *)(lVar3 + 0x16c) == 0)))) {
    uVar1 = *(uint *)(param_1 + 0x120);
    lVar3 = FUN_140302f80();
    if (*(longlong *)(lVar3 + 0x90) != 0) {
      for (puVar2 = *(uint **)(*(longlong *)(lVar3 + 0x90) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0xa0)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x248)) {
        if ((puVar2[0x24a] == uVar1) && (*puVar2 == uVar1)) {
          if (puVar2 != (uint *)0x0) goto LAB_14023d5f5;
          break;
        }
      }
    }
    puVar2 = (uint *)0x0;
LAB_14023d5f5:
    if (puVar2 == (uint *)0x0) {
      return (uint *)&DAT_140607d08;
    }
    puVar2 = puVar2 + 0xaa;
  }
  return puVar2;
}



uint * FUN_14023d620(longlong param_1)

{
  uint uVar1;
  uint *puVar2;
  longlong lVar3;
  
  uVar1 = *(uint *)(param_1 + 0x120);
  lVar3 = FUN_140302f80();
  if (*(longlong *)(lVar3 + 0x90) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(lVar3 + 0x90) +
                            ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0xa0)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x248)) {
      if ((puVar2[0x24a] == uVar1) && (*puVar2 == uVar1)) {
        if (puVar2 != (uint *)0x0) {
          return puVar2 + 0xb3;
        }
        break;
      }
    }
  }
  return (uint *)&DAT_140607d08;
}



uint * FUN_14023d6a0(longlong param_1)

{
  uint uVar1;
  uint *puVar2;
  longlong lVar3;
  
  uVar1 = *(uint *)(param_1 + 0x120);
  lVar3 = FUN_140302f80();
  if (*(longlong *)(lVar3 + 0x90) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(lVar3 + 0x90) +
                            ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0xa0)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x248)) {
      if ((puVar2[0x24a] == uVar1) && (*puVar2 == uVar1)) {
        if (puVar2 != (uint *)0x0) {
          return puVar2 + 0xc0;
        }
        break;
      }
    }
  }
  return (uint *)&DAT_140607d08;
}



uint * FUN_14023d720(longlong param_1)

{
  uint uVar1;
  uint *puVar2;
  longlong lVar3;
  
  uVar1 = *(uint *)(param_1 + 0x120);
  lVar3 = FUN_140302f80();
  if (*(longlong *)(lVar3 + 0x90) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(lVar3 + 0x90) +
                            ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar3 + 0xa0)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x248)) {
      if ((puVar2[0x24a] == uVar1) && (*puVar2 == uVar1)) {
        if (puVar2 != (uint *)0x0) {
          return puVar2 + 0xba;
        }
        break;
      }
    }
  }
  return (uint *)&DAT_140607d08;
}



float FUN_14023d7a0(longlong param_1,longlong *param_2)

{
  longlong *plVar1;
  int iVar2;
  bool bVar3;
  float fVar4;
  
  if (((*(longlong *)(param_1 + 0x21a0) == 0) ||
      (fVar4 = *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x194), fVar4 <= 0.01)) &&
     (plVar1 = (longlong *)*param_2, fVar4 = fRam00000000000000fc, plVar1 != (longlong *)0x0)) {
    if (plVar1 == (longlong *)param_2[1]) {
      return *(float *)(*plVar1 + 0xfc);
    }
    iVar2 = DAT_140608154 + 1;
    bVar3 = DAT_140608154 == 0;
    DAT_140608154 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
      fVar4 = fRam00000000000000fc;
    }
  }
  return fVar4;
}



int FUN_14023d810(longlong param_1,longlong *param_2)

{
  int iVar1;
  longlong *plVar2;
  int iVar3;
  bool bVar4;
  
  if (((*(longlong *)(param_1 + 0x21a0) == 0) ||
      (iVar1 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x19c), iVar1 < 1)) &&
     (plVar2 = (longlong *)*param_2, iVar1 = iRam0000000000000218, plVar2 != (longlong *)0x0)) {
    if (plVar2 == (longlong *)param_2[1]) {
      return *(int *)(*plVar2 + 0x218);
    }
    iVar3 = DAT_140608154 + 1;
    bVar4 = DAT_140608154 == 0;
    DAT_140608154 = iVar3;
    if (bVar4) {
      FUN_140176d60(1);
      iVar1 = iRam0000000000000218;
    }
  }
  return iVar1;
}



int FUN_14023d870(longlong param_1,longlong *param_2)

{
  int iVar1;
  longlong *plVar2;
  int iVar3;
  bool bVar4;
  
  if (((*(longlong *)(param_1 + 0x21a0) == 0) ||
      (iVar1 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x198), iVar1 == 0)) &&
     (plVar2 = (longlong *)*param_2, iVar1 = iRam0000000000000214, plVar2 != (longlong *)0x0)) {
    if (plVar2 == (longlong *)param_2[1]) {
      return *(int *)(*plVar2 + 0x214);
    }
    iVar3 = DAT_140608154 + 1;
    bVar4 = DAT_140608154 == 0;
    DAT_140608154 = iVar3;
    if (bVar4) {
      FUN_140176d60(1);
      iVar1 = iRam0000000000000214;
    }
  }
  return iVar1;
}



float FUN_14023d8d0(longlong param_1)

{
  float fVar1;
  
  if (*(char *)(param_1 + 0x2298) == '\0') {
    fVar1 = *(float *)(param_1 + 0x2290);
  }
  else {
    fVar1 = *(float *)(param_1 + 0x2294);
  }
  fVar1 = *(float *)(*(longlong *)(param_1 + 0x130) + 0x290) - fVar1;
  if (*(longlong *)(param_1 + 0x21a0) != 0) {
    fVar1 = fVar1 - *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x164);
  }
  return fVar1;
}



float FUN_14023d920(longlong param_1)

{
  float fVar1;
  
  if ((*(longlong *)(param_1 + 0x21a0) != 0) &&
     (fVar1 = *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x160), 0.01 < fVar1)) {
    return fVar1 * *(float *)(*(longlong *)(param_1 + 0x130) + 0x2dc);
  }
  return *(float *)(*(longlong *)(param_1 + 0x130) + 0x2dc);
}



void FUN_14023d960(longlong param_1,undefined4 *param_2)

{
  undefined1 local_118 [4];
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  
  *(undefined4 *)(param_1 + 0x21c8) = *param_2;
  *(undefined4 *)(param_1 + 0x21cc) = param_2[1];
  *(undefined4 *)(param_1 + 0x21d0) = param_2[2];
  local_10c = *(undefined4 *)(param_1 + 0x128);
  local_118[0] = 0xf;
  local_114 = 4;
  local_110 = 4;
  FUN_140122120(local_118,param_1 + 0x178);
  FUN_140122120(local_118,param_2);
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_14023da00(longlong *param_1,uint param_2,undefined4 param_3)

{
  uint uVar1;
  undefined4 uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong *plVar5;
  
  if (param_2 == 0) {
    *(undefined4 *)(param_1 + 0xa8) = param_3;
    *(undefined4 *)((longlong)param_1 + 0xcdc) = param_3;
    *(undefined4 *)((longlong)param_1 + 0x53c) = 0;
    *(undefined4 *)(param_1 + 0x19b) = 0;
    return;
  }
  uVar1 = (**(code **)(*param_1 + 0x218))();
  if ((param_2 & uVar1) != 0) {
    uVar1 = (**(code **)(*param_1 + 0xb0))(param_1);
    if ((uVar1 == param_2) && (uVar3 = (**(code **)(*param_1 + 0x218))(param_1), (uVar3 & 4) == 0))
    {
      lVar4 = (**(code **)(*param_1 + 0x430))
                        (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
      if (lVar4 == 0) {
        return;
      }
      plVar5 = (longlong *)
               (**(code **)(*param_1 + 0x430))
                         (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
      uVar2 = (**(code **)(*plVar5 + 0xb0))(plVar5);
      *(undefined4 *)((longlong)param_1 + 0x53c) = uVar2;
      lVar4 = (**(code **)(*param_1 + 0x430))(param_1,uVar2,(int)param_1[0xa8]);
      *(undefined4 *)(param_1 + 0xa8) = *(undefined4 *)(lVar4 + 0x128);
      return;
    }
    *(undefined4 *)((longlong)param_1 + 0xcdc) = param_3;
    *(uint *)(param_1 + 0x19b) = param_2;
    *(undefined4 *)(param_1 + 0xa8) = param_3;
    *(uint *)((longlong)param_1 + 0x53c) = param_2;
  }
  return;
}



void FUN_14023db20(longlong *param_1,int param_2,undefined4 param_3)

{
  int iVar1;
  undefined4 uVar2;
  longlong lVar3;
  longlong *plVar4;
  
  iVar1 = (**(code **)(*param_1 + 0xb0))();
  if (iVar1 == param_2) {
    lVar3 = FUN_140218af0(param_1);
    if (lVar3 != 0) {
      plVar4 = (longlong *)FUN_140218af0(param_1);
      uVar2 = (**(code **)(*plVar4 + 0xb0))(plVar4);
      *(undefined4 *)((longlong)param_1 + 0x544) = uVar2;
      lVar3 = FUN_140218af0(param_1);
      *(undefined4 *)(param_1 + 0xa9) = *(undefined4 *)(lVar3 + 0x128);
      return;
    }
  }
  else {
    *(int *)((longlong)param_1 + 0x544) = param_2;
    *(undefined4 *)(param_1 + 0xa9) = param_3;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140254bd7)

void thunk_FUN_140254b90(longlong param_1,undefined4 param_2)

{
  undefined4 auStackX_10 [6];
  undefined1 auStack_118 [4];
  int iStack_114;
  int iStack_110;
  undefined4 uStack_10c;
  undefined1 auStack_108 [256];
  
  uStack_10c = *(undefined4 *)(param_1 + 0x128);
  auStack_118[0] = 0x19;
  iStack_114 = 4;
  iStack_110 = 4;
  auStackX_10[0] = param_2;
  memcpy(auStack_108,auStackX_10,4);
  iStack_114 = iStack_114 + 4;
  iStack_110 = iStack_114;
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),auStack_118);
  return;
}



void FUN_14023dbc0(longlong param_1,int param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  
  plVar1 = *(longlong **)(param_1 + 0x20d0);
  iVar3 = 6;
  if (param_2 == 10) {
    iVar3 = 3;
  }
  else if (param_2 == 0x2f) {
    iVar3 = 10;
  }
  else if (param_2 == 0x68) {
    iVar3 = 0x12;
  }
  plVar2 = (longlong *)plVar1[(longlong)iVar3 + 1];
  *plVar1 = (longlong)plVar2;
  (**(code **)(*plVar2 + 0x38))(plVar2,plVar1);
  *(undefined1 *)(*plVar1 + 8) = 0;
  return;
}



void FUN_14023dc20(longlong *param_1)

{
  *(undefined4 *)(param_1 + 0x303) = 0;
  if ((*(int *)((longlong)param_1 + 300) == 0x1b) && ((int)param_1[0x281] == 3)) {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_14023dc60(longlong *param_1,double param_2,undefined8 param_3)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined1 local_138 [4];
  undefined8 local_134;
  
  lVar3 = 0;
  lVar4 = 0;
  bVar7 = false;
  plVar2 = (longlong *)param_1[0x25d];
  lVar5 = lVar3;
  if (plVar2 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar2 == (longlong *)param_1[0x25e]) {
      if (*plVar2 != 0) {
        lVar5 = *plVar2;
        if ((plVar2 != (longlong *)param_1[0x25e]) &&
           (iVar1 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar5 = lVar3,
           DAT_1406080a8 = iVar1, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar5);
        bVar7 = true;
      }
    }
    else {
      iVar1 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar1;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if ((char)param_1[0x450] == '\0') {
    plVar2 = (longlong *)param_1[0x3e1];
    if (plVar2 != (longlong *)param_1[0x3e2]) {
      do {
        *(undefined8 *)(*plVar2 + 0x40) = 0;
        plVar2 = plVar2 + 1;
      } while (plVar2 != (longlong *)param_1[0x3e2]);
    }
    plVar2 = (longlong *)param_1[0x3e5];
    if (plVar2 != (longlong *)param_1[0x3e6]) {
      do {
        *(undefined8 *)(*plVar2 + 0x40) = 0;
        plVar2 = plVar2 + 1;
      } while (plVar2 != (longlong *)param_1[0x3e6]);
    }
    plVar2 = (longlong *)param_1[0x3e9];
    if (plVar2 != (longlong *)param_1[0x3ea]) {
      do {
        *(undefined8 *)(*plVar2 + 0x40) = 0;
        plVar2 = plVar2 + 1;
      } while (plVar2 != (longlong *)param_1[0x3ea]);
    }
    plVar2 = (longlong *)param_1[0x3f1];
    if (plVar2 != (longlong *)param_1[0x3f2]) {
      do {
        *(undefined8 *)(*plVar2 + 0x40) = 0;
        plVar2 = plVar2 + 1;
      } while (plVar2 != (longlong *)param_1[0x3f2]);
    }
    plVar2 = (longlong *)param_1[0x3f5];
    if (plVar2 != (longlong *)param_1[0x3f6]) {
      do {
        *(undefined8 *)(*plVar2 + 0x40) = 0;
        plVar2 = plVar2 + 1;
      } while (plVar2 != (longlong *)param_1[0x3f6]);
    }
    plVar2 = (longlong *)param_1[0x3ed];
    if (plVar2 != (longlong *)param_1[0x3ee]) {
      do {
        *(undefined8 *)(*plVar2 + 0x40) = 0;
        plVar2 = plVar2 + 1;
      } while (plVar2 != (longlong *)param_1[0x3ee]);
    }
    plVar2 = (longlong *)param_1[0x3f9];
    if (plVar2 != (longlong *)param_1[0x3fa]) {
      do {
        *(undefined8 *)(*plVar2 + 0x40) = 0;
        plVar2 = plVar2 + 1;
      } while (plVar2 != (longlong *)param_1[0x3fa]);
    }
    *(undefined1 *)((longlong)param_1 + 0xc64) =
         **(undefined1 **)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x2f8);
    FUN_140219610(param_1,param_2,param_3);
    if (1.0 < param_2 - (double)param_1[0x420]) {
      param_1[0x421] = 0;
    }
    (**(code **)(*param_1 + 0xb10))(param_1,param_2,param_3);
    iVar1 = (**(code **)(*param_1 + 0xaf0))(param_1);
    if ((((iVar1 != 3) &&
         (((longlong *)param_1[0x44d] == (longlong *)0x0 ||
          (iVar1 = (**(code **)(*(longlong *)param_1[0x44d] + 0x10))(), iVar1 != 0)))) &&
        ((*(int *)((longlong)param_1 + 300) < 0x46 || (0x47 < *(int *)((longlong)param_1 + 300)))))
       && (*(char *)((longlong)param_1 + 0x22a4) == '\0')) {
      (**(code **)(*param_1 + 0x468))(param_1,0);
    }
    (**(code **)(*param_1 + 0xb18))(param_1);
    FUN_14023dff0(param_1,param_2);
    if (DAT_140607be2 != '\0') {
      FUN_140255aa0(param_1);
    }
    if ((char)param_1[0x219] != '\0') {
      (**(code **)(*param_1 + 0xbc0))(param_1,(int)param_1[0xb3]);
      local_138[0] = 0;
      local_134 = 0;
      FUN_1402b7b20(local_138,(int)param_1[0x25],(int)*(float *)(param_1 + 0xb3),
                    (int)*(float *)(param_1 + 0xb4),(int)param_1[0xc2],
                    *(undefined4 *)((longlong)param_1 + 0x614));
      FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_138);
      param_1[0xc2] = 0;
      *(undefined1 *)(param_1 + 0x219) = 0;
    }
  }
  else {
    param_1[0xa2] = (longlong)param_2;
  }
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void thunk_FUN_140255870(longlong param_1)

{
  longlong lVar1;
  undefined4 auStackX_8 [2];
  undefined4 auStackX_10 [6];
  
  lVar1 = *(longlong *)(param_1 + 0x1e80);
  if (lVar1 == 0) {
    *(undefined1 *)(param_1 + 0x608) = 0;
    return;
  }
  auStackX_8[0] = *(undefined4 *)(param_1 + 0xd7c);
  auStackX_10[0] = *(undefined4 *)(param_1 + 0x128);
  (**(code **)(*(longlong *)(**(longlong **)(lVar1 + 0x48) + 0x78) + 0x730))
            (**(longlong **)(lVar1 + 0x48) + 0x78,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,
             auStackX_10,auStackX_8);
  *(undefined1 *)(param_1 + 0x608) = 0;
  return;
}



void FUN_14023dff0(longlong param_1,double param_2)

{
  if (DAT_1405dfc60 <= param_2 - *(double *)(param_1 + 0x2260)) {
    *(double *)(param_1 + 0x2260) = param_2;
    if (*(char *)(param_1 + 0x606) != '\0') {
      FUN_140254d80();
    }
    if (*(char *)(param_1 + 0x607) != '\0') {
      FUN_140254fa0(param_1);
    }
    if (*(char *)(param_1 + 0x609) != '\0') {
      FUN_1402551c0(param_1);
    }
    if (*(char *)(param_1 + 0x60a) != '\0') {
      FUN_1402553e0(param_1);
    }
    if (*(char *)(param_1 + 0x60b) != '\0') {
      FUN_140255540(param_1);
    }
    if (*(char *)(param_1 + 0x605) != '\0') {
      FUN_1402557e0(param_1);
    }
    if (*(char *)(param_1 + 0x604) != '\0') {
      FUN_140255760(param_1);
    }
    if (*(char *)(param_1 + 0x608) != '\0') {
      FUN_140255870(param_1);
    }
    if (*(char *)(param_1 + 0x60c) != '\0') {
      FUN_140254b10(param_1);
    }
    if (*(char *)(param_1 + 0x60d) != '\0') {
      FUN_1402558e0(param_1);
    }
  }
  return;
}



void FUN_14023e0d0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 *puVar1;
  longlong *plVar2;
  
  puVar1 = *(undefined8 **)(param_1 + 0x20d0);
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[0x15] = param_2;
    plVar2 = (longlong *)FUN_1402d4550(puVar1);
    *puVar1 = plVar2;
    if (plVar2 != (longlong *)0x0) {
      (**(code **)(*plVar2 + 0x20))(plVar2,puVar1,param_2,param_3);
    }
  }
  return;
}



void FUN_14023e140(longlong *param_1)

{
  char cVar1;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  cVar1 = FUN_1402276f0();
  if (cVar1 == '\0') {
    (**(code **)(*param_1 + 200))(param_1,0x50);
  }
  return;
}



void FUN_14023e180(longlong *param_1,undefined8 param_2)

{
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))();
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    (**(code **)(*param_1 + 0x980))(param_1,param_2);
  }
  return;
}



void FUN_14023e1e0(longlong param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined4 *puVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84 [6];
  undefined4 local_6c [3];
  undefined4 local_60 [3];
  undefined4 auStack_54 [3];
  undefined4 local_48 [3];
  undefined4 auStack_3c [3];
  undefined4 auStack_30 [3];
  undefined4 auStack_24 [7];
  
  if (*(char *)(param_1 + 0x2228) == '\0') {
    lVar3 = 0;
    uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 0x130) + 0x7f4);
    uVar5 = 0;
    if (*(longlong *)(param_1 + 0x21a0) != 0) {
      uVar5 = *(undefined4 *)(*(longlong *)(param_1 + 0x21a0) + 0x1a4);
    }
    uVar6 = 0;
    local_a8 = 0;
    local_a0 = 0;
    local_98 = 0;
    local_94 = 0;
    local_90 = 0;
    local_8c = 0;
    local_88 = 0;
    do {
      local_84[lVar3] = 0;
      local_84[lVar3 + 3] = 0;
      local_84[lVar3 + 6] = 0;
      local_84[lVar3 + 9] = 0;
      local_84[lVar3 + 0xc] = 0;
      local_84[lVar3 + 0xf] = 0;
      local_84[lVar3 + 0x12] = 0;
      local_84[lVar3 + 0x15] = 0;
      local_84[lVar3 + 0x18] = 0;
      lVar3 = lVar3 + 1;
    } while (lVar3 < 3);
    uVar2 = FUN_1402f8580(param_1);
    local_a0 = CONCAT44(local_a0._4_4_,uVar1);
    local_a8 = CONCAT44(*(undefined4 *)(param_1 + 0x120),uVar2);
    local_90 = *(undefined4 *)(param_1 + 0x178);
    local_8c = *(undefined4 *)(param_1 + 0x17c);
    local_88 = *(undefined4 *)(param_1 + 0x180);
    lVar3 = *(longlong *)(param_1 + 0x21a0);
    if (lVar3 == 0) {
      local_98 = 0;
    }
    else {
      local_98 = *(undefined4 *)(lVar3 + 0xf0);
      uVar6 = *(undefined4 *)(lVar3 + 0x158);
    }
    local_94 = uVar6;
    puVar4 = (undefined4 *)FUN_14023d580(param_1);
    local_84[0] = *puVar4;
    local_84[1] = puVar4[1];
    local_84[2] = puVar4[2];
    puVar4 = (undefined4 *)FUN_14023d4e0(param_1);
    local_84[3] = *puVar4;
    local_84[4] = puVar4[1];
    local_84[5] = puVar4[2];
    puVar4 = (undefined4 *)FUN_14023d620(param_1);
    local_6c[0] = *puVar4;
    local_6c[1] = puVar4[1];
    local_6c[2] = puVar4[2];
    local_a0 = CONCAT44(uVar5,(undefined4)local_a0);
    puVar4 = (undefined4 *)FUN_14023d720(param_1);
    local_60[0] = *puVar4;
    local_60[1] = puVar4[1];
    local_60[2] = puVar4[2];
    puVar4 = (undefined4 *)FUN_14023d6a0(param_1);
    local_48[0] = *puVar4;
    local_48[1] = puVar4[1];
    local_48[2] = puVar4[2];
    (**(code **)(**(longlong **)(param_1 + 0x1e80) + 0x50))
              (*(longlong **)(param_1 + 0x1e80),&local_a8);
    *(undefined1 *)(param_1 + 0x2228) = 1;
  }
  return;
}



void FUN_14023e3b0(longlong *param_1,double param_2,undefined8 param_3)

{
  short sVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  longlong lVar6;
  undefined8 uVar7;
  ushort *puVar8;
  longlong lVar9;
  longlong lVar10;
  ulonglong uVar11;
  undefined8 in_RDX;
  ushort *puVar12;
  undefined2 *puVar13;
  short *psVar14;
  short *psVar15;
  int iVar16;
  int iVar17;
  undefined4 uVar18;
  uint uVar19;
  float fVar20;
  int local_res8 [2];
  undefined1 local_158 [4];
  undefined8 local_154;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  iVar5 = *(int *)((longlong)param_1 + 0x141c);
  uVar19 = 0;
  uVar4 = 0;
  if (iVar5 == 0) {
    lVar6 = param_1[0x183];
    if (lVar6 != 0) {
      plVar2 = *(longlong **)(lVar6 + 0x30);
      iVar5 = (int)param_1[0x30b];
      if (plVar2 != *(longlong **)(lVar6 + 0x38)) {
        if ((iVar5 < 0) ||
           ((int)((longlong)*(longlong **)(lVar6 + 0x38) - (longlong)plVar2 >> 4) <= iVar5)) {
          lVar6 = *plVar2;
        }
        else {
          lVar6 = plVar2[(longlong)iVar5 * 2];
        }
        if (lVar6 != 0) {
          lVar9 = param_1[0x27b];
          if (*(int *)(*(longlong *)(lVar9 + 0x20) + 0x54) == 1) {
            psVar14 = (short *)(lVar6 + 0x30);
            *(undefined4 *)((longlong)param_1 + 0x141c) = 2;
            if (7 < *(ulonglong *)(lVar6 + 0x48)) {
              psVar14 = *(short **)psVar14;
            }
            lVar6 = param_1[0x381];
            lVar10 = -1;
            psVar15 = psVar14;
            do {
              if (lVar10 == 0) break;
              lVar10 = lVar10 + -1;
              sVar1 = *psVar15;
              psVar15 = psVar15 + 1;
            } while (sVar1 != 0);
            if (lVar10 != -2) {
              uVar11 = 0xffffffffffffffff;
              psVar15 = psVar14;
              do {
                if (uVar11 == 0) break;
                uVar11 = uVar11 - 1;
                sVar1 = *psVar15;
                psVar15 = psVar15 + 1;
              } while (sVar1 != 0);
              iVar5 = FUN_140123e30(lVar9 + 0x40,*(undefined8 *)(lVar9 + 0x50),psVar14,~uVar11 - 1);
              if (iVar5 != 0) {
                uVar11 = 0xffffffffffffffff;
                psVar15 = psVar14;
                do {
                  if (uVar11 == 0) break;
                  uVar11 = uVar11 - 1;
                  sVar1 = *psVar15;
                  psVar15 = psVar15 + 1;
                } while (sVar1 != 0);
                FUN_140001710(lVar9 + 0x40,psVar14,~uVar11 - 1);
                if (*(longlong *)(lVar9 + 0x10) != 0) {
                  lVar10 = *(longlong *)(*(longlong *)(lVar9 + 0x10) + 0xd8);
                  if (lVar10 != 0) {
                    iVar5 = FUN_1402ce620(lVar10,psVar14);
                    uVar4 = iVar5 + 1;
                  }
                  FUN_1402c5c00(lVar9,uVar4,(int)lVar6,1);
                }
              }
            }
            FUN_1402c5e50(param_1[0x27b]);
            *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
            lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
            if (*(int *)(lVar6 + 0x54) == 1) {
              *(double *)(lVar6 + 0x10) = param_2;
              FUN_1402cc2c0(lVar6);
            }
            *(undefined4 *)(lVar6 + 0x54) = 0;
            fVar20 = (float)FUN_1402c5ee0(param_1[0x27b]);
            param_1[0x28b] = 0;
            param_1[0x28a] = (longlong)(double)fVar20;
          }
          goto LAB_14023e843;
        }
      }
      *(undefined4 *)((longlong)param_1 + 0x141c) = 2;
    }
    goto LAB_14023e843;
  }
  if (iVar5 == 2) {
    lVar6 = param_1[0x27b];
    if (*(int *)(*(longlong *)(lVar6 + 0x20) + 0x54) != 1) goto LAB_14023e843;
    if ((int)param_1[0x30b] == 0) {
      uVar11 = *(ulonglong *)(lVar6 + 0x50);
      uVar18 = (undefined4)param_1[0x381];
      if (*(ulonglong *)(lVar6 + 0x58) < 8) {
        puVar8 = (ushort *)(lVar6 + 0x40);
      }
      else {
        puVar8 = *(ushort **)(lVar6 + 0x40);
      }
      puVar12 = &DAT_1404ae120;
      uVar3 = 6;
      if (uVar11 < 6) {
        uVar3 = uVar11;
      }
      for (; uVar3 != 0; uVar3 = uVar3 - 1) {
        if (*puVar8 != *puVar12) {
          uVar19 = 1;
          if (*puVar8 < *puVar12) {
            uVar19 = 0xffffffff;
          }
          break;
        }
        puVar8 = puVar8 + 1;
        puVar12 = puVar12 + 1;
      }
      if (uVar19 == 0) {
        if (5 < uVar11) {
          uVar19 = (uint)(uVar11 != 6);
          goto LAB_14023e5bb;
        }
      }
      else {
LAB_14023e5bb:
        if (uVar19 == 0) goto LAB_14023e61e;
      }
      FUN_140001710(lVar6 + 0x40,&DAT_1404ae120,6);
      if (*(longlong *)(lVar6 + 0x10) != 0) {
        lVar9 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
        uVar19 = uVar4;
        if (lVar9 != 0) {
          puVar13 = &DAT_1404ae120;
LAB_14023e607:
          iVar5 = FUN_1402ce620(lVar9,puVar13);
          uVar19 = iVar5 + 1;
        }
LAB_14023e60e:
        FUN_1402c5c00(lVar6,uVar19,uVar18,1);
      }
    }
    else if ((int)param_1[0x30b] - 1U < 2) {
      uVar11 = *(ulonglong *)(lVar6 + 0x50);
      uVar18 = (undefined4)param_1[0x381];
      if (*(ulonglong *)(lVar6 + 0x58) < 8) {
        puVar8 = (ushort *)(lVar6 + 0x40);
      }
      else {
        puVar8 = *(ushort **)(lVar6 + 0x40);
      }
      puVar12 = &DAT_1404ae130;
      uVar3 = 6;
      if (uVar11 < 6) {
        uVar3 = uVar11;
      }
      for (; uVar4 = uVar19, uVar3 != 0; uVar3 = uVar3 - 1) {
        if (*puVar8 != *puVar12) {
          uVar4 = 1;
          if (*puVar8 < *puVar12) {
            uVar4 = 0xffffffff;
          }
          break;
        }
        puVar8 = puVar8 + 1;
        puVar12 = puVar12 + 1;
      }
      if (uVar4 == 0) {
        if (5 < uVar11) {
          uVar4 = (uint)(uVar11 != 6);
          goto LAB_14023e4fd;
        }
      }
      else {
LAB_14023e4fd:
        if (uVar4 == 0) goto LAB_14023e61e;
      }
      FUN_140001710(lVar6 + 0x40,&DAT_1404ae130,6);
      if (*(longlong *)(lVar6 + 0x10) != 0) {
        lVar9 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
        if (lVar9 != 0) {
          puVar13 = &DAT_1404ae130;
          goto LAB_14023e607;
        }
        goto LAB_14023e60e;
      }
    }
LAB_14023e61e:
    FUN_1402c5e50(param_1[0x27b]);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar6 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar6 + 0x54) == 1) {
      *(double *)(lVar6 + 0x10) = param_2;
      FUN_1402cc2c0(lVar6);
    }
    *(undefined4 *)(lVar6 + 0x54) = 0;
    fVar20 = (float)FUN_1402c5ee0(param_1[0x27b]);
    param_1[0x28b] = 0;
    *(undefined4 *)((longlong)param_1 + 0x141c) = 3;
    param_1[0x423] = (longlong)param_2;
    param_1[0x28a] = (longlong)(double)fVar20;
    goto LAB_14023e843;
  }
  if (iVar5 == 3) {
    if (0.4000000059604645 < param_2 - (double)param_1[0x423]) {
      *(undefined4 *)(param_1 + 0x3c8) = 0;
    }
LAB_14023e44c:
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) goto LAB_14023e843;
  }
  else if (iVar5 != 5) {
    if (iVar5 != 6) goto LAB_14023e843;
    goto LAB_14023e44c;
  }
  *(undefined1 *)(param_1 + 0x30d) = 1;
LAB_14023e843:
  if (((char)param_1[0x30d] != '\0') && (lVar6 = FUN_140218af0(param_1), lVar6 != 0)) {
    if ((param_1[0x185] != 0) && (iVar5 = FUN_140343510(), iVar5 != 0)) {
      iVar16 = (iVar5 % 0x32) % 0x14;
      iVar17 = iVar16 % 10;
      fVar20 = (float)((iVar5 % 0x32) / 0x14) * 20.0 + (float)(iVar5 / 0x32) * 50.0 +
               (float)(iVar16 / 10) * 10.0 + (float)(iVar17 / 5) * 5.0 +
               (float)((iVar17 % 5) / 2) * 2.0;
      local_res8[0] = (int)fVar20;
      if (param_1[0x3d0] != 0) {
        FUN_14023a3d0(param_1,local_res8,fVar20);
      }
      iVar5 = local_res8[0];
      lVar6 = FUN_140218af0(param_1);
      *(undefined8 *)(lVar6 + 0x1220) = 0x4014000000000000;
      lVar6 = FUN_140218af0(param_1);
      *(undefined1 *)(lVar6 + 0x1230) = 1;
      *(double *)(lVar6 + 0x1228) = param_2;
      lVar6 = FUN_140218af0(param_1);
      uVar18 = *(undefined4 *)(lVar6 + 0x128);
      uVar7 = (**(code **)(*param_1 + 0xf8))(param_1);
      local_158[0] = 0;
      local_154 = 0;
      FUN_1402bafb0(local_158,uVar7,uVar18,1,iVar5);
      FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_158);
    }
    if ((param_1[0x187] != 0) && (iVar5 = FUN_140343510(), iVar5 != 0)) {
      iVar16 = (iVar5 % 0x32) % 0x14;
      iVar17 = iVar16 % 10;
      fVar20 = (float)((iVar5 % 0x32) / 0x14) * 20.0 + (float)(iVar5 / 0x32) * 50.0 +
               (float)(iVar16 / 10) * 10.0 + (float)(iVar17 / 5) * 5.0 +
               (float)((iVar17 % 5) / 2) * 2.0;
      local_res8[0] = (int)fVar20;
      if (param_1[0x3d0] != 0) {
        FUN_14023a640(param_1,local_res8,fVar20);
      }
      iVar5 = local_res8[0];
      lVar6 = FUN_140218af0(param_1);
      *(undefined8 *)(lVar6 + 0x1220) = 0x4014000000000000;
      lVar6 = FUN_140218af0(param_1);
      *(undefined1 *)(lVar6 + 0x1230) = 1;
      *(double *)(lVar6 + 0x1228) = param_2;
      lVar6 = FUN_140218af0(param_1);
      uVar18 = *(undefined4 *)(lVar6 + 0x128);
      uVar7 = (**(code **)(*param_1 + 0xf8))(param_1);
      local_158[0] = 0;
      local_154 = 0;
      FUN_1402bafb0(local_158,uVar7,uVar18,2,iVar5);
      FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_158);
    }
  }
  FUN_140230d70(param_1);
  return;
}



void FUN_14023ec50(longlong *param_1)

{
  longlong *plVar1;
  int iVar2;
  
  FUN_14022cd70();
  if ((longlong *)param_1[0x41a] != (longlong *)0x0) {
    plVar1 = *(longlong **)param_1[0x41a];
    if ((plVar1 != (longlong *)0x0) && (iVar2 = (**(code **)(*plVar1 + 8))(), iVar2 == 10)) {
      return;
    }
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_14023eca0(longlong *param_1)

{
  longlong *plVar1;
  int iVar2;
  
  FUN_14022cc50();
  if ((longlong *)param_1[0x41a] != (longlong *)0x0) {
    plVar1 = *(longlong **)param_1[0x41a];
    if ((plVar1 != (longlong *)0x0) && (iVar2 = (**(code **)(*plVar1 + 8))(), iVar2 == 10)) {
      return;
    }
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_14023ecf0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  longlong lVar3;
  float fVar4;
  undefined4 uVar5;
  
  if ((int)param_1[0x1af] == 0) {
    if ((param_1[0x435] == 0) || (lVar1 = param_1[0x437], lVar1 == 0)) {
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      *(undefined4 *)(param_1 + 0x438) = 0;
    }
    else {
      puVar2 = (undefined8 *)(lVar1 + 0x78);
      if (7 < *(ulonglong *)(lVar1 + 0x90)) {
        puVar2 = (undefined8 *)*puVar2;
      }
      FUN_1402c5b20(param_1[0x27b],puVar2,(int)param_1[0x381],1,1);
      if (param_1[0x16f] == 0) {
        uVar5 = 0x3f800000;
      }
      else {
        uVar5 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
      }
      FUN_1402c5e50(param_1[0x27b],uVar5);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar1 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar1 + 0x54) == 1) {
        *(undefined8 *)(lVar1 + 0x10) = param_2;
        FUN_1402cc2c0(lVar1);
      }
      lVar3 = 0;
      *(undefined4 *)(lVar1 + 0x54) = 0;
      fVar4 = (float)FUN_1402c5ee0(param_1[0x27b]);
      param_1[0x28b] = lVar3;
      *(undefined4 *)(param_1 + 0x1af) = 1;
      param_1[0x28a] = (longlong)(double)fVar4;
    }
  }
  else if ((int)param_1[0x1af] == 1) {
    lVar1 = (**(code **)(*param_1 + 0x158))(param_1);
    if ((lVar1 == 0) || ((*(int *)(lVar1 + 300) != 0x3c && (*(int *)(lVar1 + 300) != 0x3e)))) {
                    // WARNING: Could not recover jumptable at 0x00014023ed4c. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return;
    }
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      (**(code **)(*param_1 + 200))(param_1,0x36,1);
    }
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14023eed0(longlong *param_1,undefined8 param_2,undefined1 param_3)

{
  int iVar1;
  undefined8 in_RDX;
  
  iVar1 = (int)param_1[0x1af];
  if (iVar1 == 0) {
    *(undefined4 *)(param_1 + 0x1af) = 1;
  }
  else if (iVar1 == 1) {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      *(undefined4 *)(param_1 + 0x1af) = 5;
    }
  }
  else if (iVar1 == 5) {
    (**(code **)(*param_1 + 200))(param_1,0x37,1);
    (**(code **)(*param_1 + 0xb90))(param_1);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14023ef80(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  longlong lVar2;
  undefined8 *puVar3;
  
  if ((int)param_1[0x1af] == 0) {
    lVar2 = param_1[0x437];
    if (lVar2 == 0) {
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    }
    else {
      puVar3 = (undefined8 *)(lVar2 + 0xa0);
      if (7 < *(ulonglong *)(lVar2 + 0xb8)) {
        puVar3 = (undefined8 *)*puVar3;
      }
      cVar1 = (**(code **)(*param_1 + 0x8f8))(param_1,puVar3,(int)param_1[0x381],0x3f800000,1,0,0);
      *(undefined4 *)(param_1 + 0x438) = 0;
      if (cVar1 == '\0') {
        param_1[0x437] = 0;
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      }
      else {
        *(undefined4 *)(param_1 + 0x1af) = 1;
      }
    }
  }
  else if ((int)param_1[0x1af] == 1) {
    lVar2 = (**(code **)(*param_1 + 0x158))(param_1);
    if ((lVar2 == 0) || ((*(int *)(lVar2 + 300) != 0x3c && (*(int *)(lVar2 + 300) != 0x3e)))) {
                    // WARNING: Could not recover jumptable at 0x00014023efd8. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return;
    }
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14023f0d0(longlong *param_1,longlong param_2,undefined8 param_3)

{
  int iVar1;
  longlong lVar2;
  undefined8 in_RDX;
  undefined8 *puVar3;
  longlong lVar4;
  float fVar5;
  undefined4 uVar6;
  
  iVar1 = (int)param_1[0x1af];
  if (iVar1 == 0) {
    if ((param_1[0x435] == 0) || (lVar2 = param_1[0x437], lVar2 == 0)) {
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    }
    else {
      puVar3 = (undefined8 *)(lVar2 + 0xf0);
      if (7 < *(ulonglong *)(lVar2 + 0x108)) {
        puVar3 = (undefined8 *)*puVar3;
      }
      FUN_1402c5b20(param_1[0x27b],puVar3,(int)param_1[0x381],1,1);
      if (param_1[0x16f] == 0) {
        uVar6 = 0x3f800000;
      }
      else {
        uVar6 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
      }
      FUN_1402c5e50(param_1[0x27b],uVar6);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar2 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar2 + 0x54) == 1) {
        *(longlong *)(lVar2 + 0x10) = param_2;
        FUN_1402cc2c0(lVar2);
      }
      lVar4 = 0;
      *(undefined4 *)(lVar2 + 0x54) = 0;
      fVar5 = (float)FUN_1402c5ee0(param_1[0x27b]);
      param_1[0x28b] = lVar4;
      param_1[0x44a] = param_2;
      *(undefined4 *)(param_1 + 0x1af) = 1;
      *(int *)(param_1 + 0x438) = (int)lVar4;
      param_1[0x28a] = (longlong)(double)fVar5;
    }
  }
  else if (iVar1 == 1) {
    if (*(int *)((longlong)param_1 + 300) != 0xf) {
      *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
    }
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      *(undefined4 *)(param_1 + 0x1af) = 5;
      param_1[0x437] = 0;
    }
  }
  else if (iVar1 == 5) {
    FUN_14021eb20(param_1,0,0);
    param_1[0x437] = 0;
  }
  FUN_140230d70(param_1,param_2);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014023f4b9)
// WARNING: Removing unreachable block (ram,0x00014023f6a6)

void FUN_14023f280(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  int *piVar1;
  short sVar2;
  byte bVar3;
  byte bVar4;
  undefined4 uVar5;
  longlong lVar6;
  int iVar7;
  undefined4 uVar8;
  longlong lVar9;
  longlong *plVar10;
  undefined8 uVar11;
  void *pvVar12;
  longlong lVar13;
  ulonglong uVar14;
  longlong *plVar15;
  undefined8 *puVar16;
  short *psVar17;
  bool bVar18;
  float fVar19;
  undefined4 local_res8 [2];
  undefined8 in_stack_ffffffffffffff68;
  longlong local_70;
  longlong *local_68;
  longlong *local_60;
  longlong *local_58;
  
  iVar7 = (int)param_1[0x1af];
  if (iVar7 == 0) {
    lVar9 = param_1[0x437];
    if (lVar9 != 0) {
      puVar16 = (undefined8 *)(lVar9 + 0x118);
      if (7 < *(ulonglong *)(lVar9 + 0x130)) {
        puVar16 = (undefined8 *)*puVar16;
      }
      FUN_1402c5b20(param_1[0x27b],puVar16,(int)param_1[0x381],1,1);
      if (param_1[0x16f] == 0) {
        uVar8 = 0x3f800000;
      }
      else {
        uVar8 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
      }
      FUN_1402c5e50(param_1[0x27b],uVar8);
      *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
      lVar9 = *(longlong *)(param_1[0x27b] + 0x20);
      if (*(int *)(lVar9 + 0x54) == 1) {
        *(undefined8 *)(lVar9 + 0x10) = param_2;
        FUN_1402cc2c0(lVar9);
      }
      *(undefined4 *)(lVar9 + 0x54) = 0;
      fVar19 = (float)FUN_1402c5ee0(param_1[0x27b]);
      param_1[0x28a] = (longlong)(double)fVar19;
      param_1[0x28b] = 0;
      *(undefined4 *)(param_1 + 0x1af) = 1;
      *(undefined4 *)(param_1 + 0x438) = 0;
      goto LAB_14023f93e;
    }
  }
  else if (iVar7 == 1) {
    lVar9 = (**(code **)(*param_1 + 0x158))(param_1);
    if (lVar9 != 0) {
      if ((*(int *)(lVar9 + 300) != 0x3c) && (*(int *)(lVar9 + 300) != 0x3e)) {
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
        return;
      }
      if (*(int *)((longlong)param_1 + 300) != 0xf) {
        *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
      }
      (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
      if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
        (**(code **)(*param_1 + 0x148))(param_1,0,0);
      }
      goto LAB_14023f93e;
    }
  }
  else {
    if (iVar7 != 2) {
      if (iVar7 == 3) {
        (**(code **)(*param_1 + 0x148))(param_1,0,0);
        if (*(int *)((longlong)param_1 + 300) != 0xf) {
          *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
        }
        (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
        if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
          (**(code **)(*param_1 + 0xd0))(param_1,0,0);
          param_1[0x437] = 0;
        }
      }
      else if (iVar7 == 4) {
        (**(code **)(*param_1 + 0x148))(param_1,0,0);
        param_1[0x437] = 0;
        lVar9 = (**(code **)(*param_1 + 0x158))(param_1);
        if (lVar9 != 0) {
          FUN_1402357f0(lVar9);
        }
      }
      goto LAB_14023f93e;
    }
    *(undefined4 *)(param_1 + 0x1af) = 3;
    plVar10 = (longlong *)(**(code **)(*param_1 + 0x158))(param_1);
    if ((plVar10 != (longlong *)0x0) && (param_1[0x437] != 0)) {
      FUN_1402357f0(plVar10);
      local_res8[0] = 0;
      uVar11 = CONCAT71((int7)((ulonglong)in_stack_ffffffffffffff68 >> 8),1);
      iVar7 = FUN_1402f9640(plVar10,local_res8,plVar10 + 0x2f,1,uVar11);
      uVar8 = (undefined4)((ulonglong)uVar11 >> 0x20);
      if (iVar7 != 1) {
        FUN_14022ecd0(plVar10,param_1 + 0x2f);
      }
      bVar3 = *(byte *)((longlong)param_1 + 0x601);
      bVar4 = *(byte *)(param_1 + 0xc0);
      uVar5 = *(undefined4 *)((longlong)param_1 + 300);
      puVar16 = (undefined8 *)(param_1[0x437] + 0x118);
      if (7 < *(ulonglong *)(param_1[0x437] + 0x130)) {
        puVar16 = (undefined8 *)*puVar16;
      }
      uVar11 = FUN_14020d8c0(param_1 + 0x391);
      FUN_140278700(uVar11,&local_60,puVar16,(int)param_1[0x381],CONCAT44(uVar8,uVar5),bVar3 | bVar4
                    ,(char)param_1[0x413]);
      plVar15 = local_60;
      if (local_60 != (longlong *)0x0) {
        if (local_60 == local_58) {
          if (*local_60 != 0) {
            *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
            *(undefined4 *)((longlong)param_1 + 0x1c54) =
                 *(undefined4 *)((longlong)param_1 + 0x1c54);
            pvVar12 = operator_new(0x120);
            lVar9 = 0;
            lVar13 = lVar9;
            if (pvVar12 != (void *)0x0) {
              lVar13 = FUN_140197660(pvVar12);
            }
            local_70 = lVar13;
            FUN_140196140(&local_68,lVar13);
            FUN_140178e90(&local_70,lVar13,lVar13);
            plVar15 = param_1 + 0x1a;
            if (7 < (ulonglong)param_1[0x1d]) {
              plVar15 = (longlong *)*plVar15;
            }
            uVar14 = 0xffffffffffffffff;
            psVar17 = (short *)plVar15;
            do {
              if (uVar14 == 0) break;
              uVar14 = uVar14 - 1;
              sVar2 = *psVar17;
              psVar17 = psVar17 + 1;
            } while (sVar2 != 0);
            FUN_140001710(local_70,plVar15,~uVar14 - 1);
            lVar13 = local_70;
            *(int *)(local_70 + 0x34) = (int)param_1[0x24];
            *(int *)(local_70 + 0x28) = (int)param_1[0x2f];
            *(undefined4 *)(local_70 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x17c);
            *(int *)(local_70 + 0x30) = (int)param_1[0x30];
            uVar8 = (**(code **)(*param_1 + 0xb0))(param_1);
            lVar6 = local_70;
            *(undefined4 *)(lVar13 + 0x38) = uVar8;
            *(int *)(local_70 + 0x3c) = (int)param_1[0x25];
            uVar8 = FUN_1402f8580(param_1);
            *(undefined4 *)(lVar6 + 0x40) = uVar8;
            *(undefined4 *)(local_70 + 0x44) = *(undefined4 *)((longlong)param_1 + 0x1c54);
            if (local_60 != (longlong *)0x0) {
              if (local_60 == local_58) {
                lVar9 = *local_60;
              }
              else {
                iVar7 = DAT_140608154 + 1;
                bVar18 = DAT_140608154 == 0;
                DAT_140608154 = iVar7;
                if (bVar18) {
                  FUN_140176d60(1);
                }
              }
            }
            FUN_14021a770(param_1,&local_70,lVar9,plVar10,param_1[0x2fa],0x3f800000);
            lVar9 = local_70;
            *(undefined4 *)(local_70 + 0x54) = 1;
            *(undefined4 *)(local_70 + 0x58) = *(undefined4 *)(param_1[0x27b] + 0x30);
            if (*(longlong **)(local_70 + 0x80) != local_60) {
              FUN_1401975d0(local_70 + 0x80);
              *(longlong **)(lVar9 + 0x80) = local_60;
              *(longlong **)(lVar9 + 0x88) = local_60;
              if (local_60 != (longlong *)0x0) {
                LOCK();
                *(int *)(local_60 + 1) = (int)local_60[1] + 1;
                UNLOCK();
              }
            }
            *(longlong *)(local_70 + 0x90) = param_1[0x2fa];
            *(undefined4 *)(local_70 + 0x48) = 0;
            *(int *)(local_70 + 0x78) = (int)param_1[0x3d6];
            (**(code **)(*plVar10 + 0x950))(plVar10,local_70,0);
            (**(code **)(*param_1 + 0x148))(param_1,0,0);
            *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
            if (local_68 != (longlong *)0x0) {
              LOCK();
              plVar10 = local_68 + 1;
              *(int *)plVar10 = (int)*plVar10 + -1;
              UNLOCK();
              if ((int)*plVar10 == 0) {
                (**(code **)(*local_68 + 8))(local_68);
                LOCK();
                piVar1 = (int *)((longlong)local_68 + 0xc);
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                if (*piVar1 == 0) {
                  (**(code **)(*local_68 + 0x10))(local_68);
                }
              }
            }
            plVar10 = local_60;
            if (local_60 != (longlong *)0x0) {
              if (local_60 == local_58) {
                if (local_60 != (longlong *)0x0) {
                  LOCK();
                  plVar15 = local_60 + 1;
                  *(int *)plVar15 = (int)*plVar15 + -1;
                  UNLOCK();
                  if ((int)*plVar15 == 0) {
                    local_60 = (longlong *)0x0;
                    pvVar12 = (void *)*plVar10;
                    if (pvVar12 != (void *)0x0) {
                      FUN_140197310(pvVar12);
                      operator_delete(pvVar12);
                    }
                    operator_delete(plVar10);
                  }
                }
              }
              else {
                iVar7 = DAT_1406080b4 + 1;
                bVar18 = DAT_1406080b4 == 0;
                DAT_1406080b4 = iVar7;
                if (bVar18) {
                  FUN_140176d60(1);
                }
              }
            }
            goto LAB_14023f93e;
          }
        }
        else {
          iVar7 = DAT_140608154 + 1;
          bVar18 = DAT_140608154 == 0;
          DAT_140608154 = iVar7;
          if (bVar18) {
            FUN_140176d60(1);
            plVar15 = local_60;
          }
        }
      }
      if (plVar15 == (longlong *)0x0) {
        return;
      }
      if (plVar15 != local_58) {
        if (DAT_1406080b4 != 0) {
          DAT_1406080b4 = DAT_1406080b4 + 1;
          return;
        }
        DAT_1406080b4 = DAT_1406080b4 + 1;
        FUN_140176d60(1);
        return;
      }
      if (plVar15 == (longlong *)0x0) {
        return;
      }
      LOCK();
      plVar10 = plVar15 + 1;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      if ((int)*plVar10 != 0) {
        return;
      }
      local_60 = (longlong *)0x0;
      pvVar12 = (void *)*plVar15;
      if (pvVar12 != (void *)0x0) {
        FUN_140197310(pvVar12);
        operator_delete(pvVar12);
      }
      operator_delete(plVar15);
      return;
    }
  }
  (**(code **)(*param_1 + 0xd0))(param_1,0,0);
LAB_14023f93e:
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14023f970(longlong *param_1)

{
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))();
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    (**(code **)(*param_1 + 0x960))(param_1);
  }
  return;
}



void FUN_14023f9c0(longlong *param_1,double param_2,undefined8 param_3)

{
  short sVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  undefined8 in_RDX;
  int *piVar8;
  longlong *plVar9;
  int *piVar10;
  int *piVar11;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  iVar4 = *(int *)((longlong)param_1 + 0x21dc);
  if (iVar4 != 0) {
    if (iVar4 == 1) {
      if (((int)param_1[0x43c] == 0) || (param_1[0x43d] == 0)) {
        FUN_14021eb20(param_1,0,0);
      }
      else if ((double)param_1[0x444] <= param_2 - (double)param_1[0x443] &&
               param_2 - (double)param_1[0x443] != (double)param_1[0x444]) {
        *(undefined4 *)((longlong)param_1 + 0x21dc) = 2;
      }
    }
    else if (((iVar4 == 2) && ((int)param_1[0x43c] != 0)) && (lVar2 = param_1[0x43d], lVar2 != 0)) {
      for (puVar6 = *(undefined8 **)(lVar2 + 0x30); puVar6 != *(undefined8 **)(lVar2 + 0x38);
          puVar6 = puVar6 + 2) {
        piVar11 = (int *)*puVar6;
        if (*piVar11 == (int)param_1[0x43c]) {
          iVar4 = rand();
          if ((double)(float)piVar11[0xd] <= (double)((float)iVar4 * 3.0517578e-05)) {
            if (*(longlong *)(piVar11 + 0x32) == 0) {
              (**(code **)(*param_1 + 0xd0))(param_1,0,0);
              goto LAB_14023fc34;
            }
            plVar9 = (longlong *)(piVar11 + 0x2e);
            if (7 < *(ulonglong *)(piVar11 + 0x34)) {
              plVar9 = (longlong *)*plVar9;
            }
            uVar7 = 0xffffffffffffffff;
            goto code_r0x00014023fb57;
          }
          FUN_1402fc3f0(param_1);
          piVar10 = piVar11 + 0x38;
          piVar8 = piVar10;
          if (7 < *(ulonglong *)(piVar11 + 0x3e)) {
            piVar8 = *(int **)piVar10;
          }
          cVar3 = (**(code **)(*param_1 + 0x8f8))
                            (param_1,piVar8,(int)param_1[0x381],0x3f800000,1,0,0);
          if (cVar3 != '\0') {
            FUN_14021eb20(param_1,0,0);
            goto LAB_14023fc34;
          }
          if (7 < *(ulonglong *)(piVar11 + 0x3e)) {
            piVar10 = *(int **)piVar10;
          }
          uVar7 = 0xffffffffffffffff;
          *(undefined4 *)(param_1 + 0x42e) = 1;
          piVar11 = piVar10;
          goto code_r0x00014023fafc;
        }
      }
    }
    goto LAB_14023fc3e;
  }
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) goto LAB_14023fc3e;
  uVar5 = 1;
  if ((double)param_1[0x444] <= DAT_1405dfc60) {
    uVar5 = 2;
  }
  param_1[0x443] = (longlong)param_2;
  *(undefined4 *)((longlong)param_1 + 0x21dc) = uVar5;
  goto LAB_14023fc34;
  while( true ) {
    uVar7 = uVar7 - 1;
    sVar1 = *(short *)plVar9;
    plVar9 = (longlong *)((longlong)plVar9 + 2);
    if (sVar1 == 0) break;
code_r0x00014023fb57:
    if (uVar7 == 0) break;
  }
  FUN_140001710(param_1 + 0x2df,(double)(float)piVar11[0xd],~uVar7 - 1);
  (**(code **)(*param_1 + 0xb30))(param_1,piVar11[3]);
  (**(code **)(*param_1 + 200))(param_1,0x61);
  goto LAB_14023fc34;
  while( true ) {
    uVar7 = uVar7 - 1;
    iVar4 = *piVar11;
    piVar11 = (int *)((longlong)piVar11 + 2);
    if ((short)iVar4 == 0) break;
code_r0x00014023fafc:
    if (uVar7 == 0) break;
  }
  FUN_140001710(param_1 + 0x42f,piVar10,~uVar7 - 1);
LAB_14023fc34:
  *(undefined4 *)((longlong)param_1 + 0x21e4) = 0;
LAB_14023fc3e:
  FUN_140230d70(param_1);
  return;
}



void FUN_14023fc60(longlong *param_1)

{
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))();
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    *(undefined4 *)((longlong)param_1 + 0x21e4) = 0;
    FUN_14021eb20(param_1,0,0);
  }
  return;
}



void FUN_14023fcc0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  undefined8 in_RDX;
  float fVar5;
  undefined4 uVar6;
  
  if ((int)param_1[0x287] == 0) {
    lVar3 = param_1[0x381];
    lVar1 = param_1[0x27b];
    FUN_140001710(lVar1 + 0x40,L"guard01_break01",0xf);
    if (*(longlong *)(lVar1 + 0x10) != 0) {
      lVar2 = *(longlong *)(*(longlong *)(lVar1 + 0x10) + 0xd8);
      if (lVar2 == 0) {
        iVar4 = 0;
      }
      else {
        iVar4 = FUN_1402ce620(lVar2,L"guard01_break01");
        iVar4 = iVar4 + 1;
      }
      FUN_1402c5c00(lVar1,iVar4,(int)lVar3,0);
    }
    if (param_1[0x16f] == 0) {
      uVar6 = 0x3f800000;
    }
    else {
      uVar6 = *(undefined4 *)(param_1[0x16f] + 0x1f8);
    }
    FUN_1402c5e50(param_1[0x27b],uVar6);
    *(undefined1 *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x50) = 0;
    lVar1 = *(longlong *)(param_1[0x27b] + 0x20);
    if (*(int *)(lVar1 + 0x54) == 1) {
      *(undefined8 *)(lVar1 + 0x10) = param_2;
      FUN_1402cc2c0(lVar1);
    }
    *(undefined4 *)(lVar1 + 0x54) = 0;
    fVar5 = (float)FUN_1402c5ee0(param_1[0x27b]);
    *(undefined4 *)(param_1 + 0x287) = 1;
    param_1[0x28a] = (longlong)(double)fVar5;
  }
  else if ((int)param_1[0x287] == 1) {
    (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      FUN_14021eb20(param_1,0,0);
    }
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14023fe30(longlong *param_1,double param_2,undefined8 param_3)

{
  undefined8 in_RDX;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  if (*(int *)((longlong)param_1 + 0x2284) == 0) {
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      param_2 = param_2 + DAT_1405dfc58;
      *(undefined4 *)((longlong)param_1 + 0x2284) = 1;
      param_1[0x451] = (longlong)param_2;
    }
  }
  else if ((*(int *)((longlong)param_1 + 0x2284) == 1) && ((double)param_1[0x451] <= param_2)) {
    *(undefined2 *)((longlong)param_1 + 0x18dc) = 0;
    FUN_14021eb20(param_1,0,0);
    return;
  }
  return;
}



undefined1 FUN_14023fed0(undefined8 param_1,longlong param_2)

{
  if ((param_2 != 0) && (*(int *)(param_2 + 0x58) == 2)) {
    return 1;
  }
  return 0;
}



void FUN_14023fef0(longlong *param_1)

{
  (**(code **)(*param_1 + 0x290))(param_1,*(uint *)(param_1 + 0xb3) ^ 0x80000000);
                    // WARNING: Could not recover jumptable at 0x00014023ff23. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(param_1,0x25);
  return;
}



ulonglong FUN_14023ff30(longlong *param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  undefined4 uVar4;
  ulonglong uVar5;
  float fVar6;
  double dVar7;
  
  *(int *)(param_1 + 0x421) = (int)param_1[0x421] + 1;
  fVar6 = *(float *)(param_1 + 0xb3);
  param_1[0x420] = param_1[0xa2];
  uVar5 = FUN_1402255f0(param_1,param_2,0);
  *(int *)((longlong)param_1 + 0x210c) =
       *(int *)((longlong)param_1 + 0x210c) + (int)((float)(int)fVar6 - *(float *)(param_1 + 0xb3));
  param_1[0x166] = (longlong)((double)param_1[0x166] - 0.20000000298023224);
  if ((longlong *)param_1[0x44d] == (longlong *)0x0) {
    return uVar5 & 0xffffffffffffff00;
  }
  iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0xa8))();
  if (iVar3 != 0) {
    iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0x80))();
    if (iVar3 != 0) {
      iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0x80))();
      if (iVar3 <= (int)param_1[0x421]) {
        plVar1 = (longlong *)param_1[0x44d];
        dVar7 = (double)FUN_140414fe0();
        fVar6 = (float)(**(code **)(*plVar1 + 0x90))(plVar1);
        if (dVar7 <= (double)fVar6) {
          lVar2 = *param_1;
          uVar4 = (**(code **)(*(longlong *)param_1[0x44d] + 0xa8))();
          (**(code **)(lVar2 + 0x908))(param_1,uVar4);
          *(undefined4 *)(param_1 + 0x421) = 0;
        }
      }
      goto LAB_1402400eb;
    }
  }
  iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0xa8))();
  if (iVar3 != 0) {
    iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0x88))();
    if (iVar3 != 0) {
      iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0x88))();
      if (iVar3 <= *(int *)((longlong)param_1 + 0x210c)) {
        plVar1 = (longlong *)param_1[0x44d];
        dVar7 = (double)FUN_140414fe0();
        fVar6 = (float)(**(code **)(*plVar1 + 0x90))(plVar1);
        if (dVar7 <= (double)fVar6) {
          lVar2 = *param_1;
          uVar4 = (**(code **)(*(longlong *)param_1[0x44d] + 0xa8))();
          (**(code **)(lVar2 + 0x908))(param_1,uVar4);
          *(undefined4 *)((longlong)param_1 + 0x210c) = 0;
        }
      }
    }
  }
LAB_1402400eb:
  (**(code **)(*param_1 + 0x990))(param_1);
  return uVar5 & 0xff;
}



bool FUN_140240110(longlong *param_1,longlong *param_2,undefined4 param_3)

{
  longlong *plVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  longlong *_Dst;
  longlong *_Src;
  
  FUN_1401931c0(*(undefined8 *)(param_1[0x3d0] + 0x48),param_2,
                *(undefined4 *)((longlong)param_1 + 0x20ec),param_1 + 0x2f,param_3);
  _Dst = (longlong *)*param_2;
  if (_Dst != (longlong *)param_2[1]) {
    _Src = _Dst + 1;
    do {
      plVar1 = (longlong *)*_Dst;
      iVar2 = (**(code **)(*plVar1 + 0xb0))(plVar1);
      if (iVar2 == 4) {
        if (param_1 != plVar1) {
          uVar3 = (**(code **)(*plVar1 + 0x210))(plVar1);
          uVar4 = (**(code **)(*param_1 + 0x218))(param_1);
          if ((uVar4 & uVar3) != 0) goto LAB_1402401c8;
        }
LAB_14024018a:
        memmove(_Dst,_Src,param_2[1] - (longlong)_Src & 0xfffffffffffffff8);
        param_2[1] = param_2[1] + -8;
      }
      else {
LAB_1402401c8:
        if (*(float *)(plVar1 + 0xb3) <= 1.0 && *(float *)(plVar1 + 0xb3) != 1.0)
        goto LAB_14024018a;
        _Dst = _Dst + 1;
        _Src = _Src + 1;
      }
    } while (_Dst != (longlong *)param_2[1]);
  }
  return *param_2 != param_2[1];
}



bool FUN_140240210(longlong *param_1,longlong *param_2,undefined4 param_3)

{
  longlong *plVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  longlong *_Dst;
  longlong *_Src;
  
  FUN_1401931c0(*(undefined8 *)(param_1[0x3d0] + 0x48),param_2,(int)param_1[0x41e],param_1 + 0x2f,
                param_3);
  _Dst = (longlong *)*param_2;
  if (_Dst != (longlong *)param_2[1]) {
    _Src = _Dst + 1;
    do {
      plVar1 = (longlong *)*_Dst;
      iVar2 = (**(code **)(*plVar1 + 0xb0))(plVar1);
      if (iVar2 == 4) {
        if (param_1 != plVar1) {
          uVar3 = (**(code **)(*plVar1 + 0x210))(plVar1);
          uVar4 = (**(code **)(*param_1 + 0x220))(param_1);
          if ((uVar4 & uVar3) != 0) goto LAB_1402402c8;
        }
LAB_14024028a:
        memmove(_Dst,_Src,param_2[1] - (longlong)_Src & 0xfffffffffffffff8);
        param_2[1] = param_2[1] + -8;
      }
      else {
LAB_1402402c8:
        if (*(float *)(plVar1 + 0xb3) <= 0.0) goto LAB_14024028a;
        _Dst = _Dst + 1;
        _Src = _Src + 1;
      }
    } while (_Dst != (longlong *)param_2[1]);
  }
  return *param_2 != param_2[1];
}



bool FUN_140240310(longlong *param_1,longlong *param_2,undefined4 param_3)

{
  longlong *plVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  longlong *_Dst;
  longlong *_Src;
  
  FUN_1401931c0(*(undefined8 *)(param_1[0x3d0] + 0x48),param_2,(int)param_1[0x41e],param_1 + 0x2f,
                param_3);
  _Dst = (longlong *)*param_2;
  if (_Dst != (longlong *)param_2[1]) {
    _Src = _Dst + 1;
    do {
      plVar1 = (longlong *)*_Dst;
      iVar2 = (**(code **)(*plVar1 + 0xb0))(plVar1);
      if (iVar2 == 4) {
        uVar3 = (**(code **)(*plVar1 + 0x210))(plVar1);
        uVar4 = (**(code **)(*param_1 + 0x220))(param_1);
        if ((uVar4 & uVar3) != 0) goto LAB_1402403a5;
LAB_1402403bd:
        memmove(_Dst,_Src,param_2[1] - (longlong)_Src & 0xfffffffffffffff8);
        param_2[1] = param_2[1] + -8;
      }
      else {
LAB_1402403a5:
        if ((*(float *)(plVar1 + 0xb3) <= 0.0) || (plVar1 == param_1)) goto LAB_1402403bd;
        _Dst = _Dst + 1;
        _Src = _Src + 1;
      }
    } while (_Dst != (longlong *)param_2[1]);
  }
  return *param_2 != param_2[1];
}



ulonglong FUN_140240410(longlong param_1,undefined4 *param_2,float param_3,float param_4)

{
  undefined4 uVar1;
  ulonglong in_RAX;
  
  if ((0.1 <= ABS(param_3)) && (0.1 <= param_4)) {
    *(undefined1 *)(param_1 + 0x1cbc) = 1;
    *(undefined4 *)(param_1 + 0x1cc0) = *param_2;
    *(undefined4 *)(param_1 + 0x1cc4) = param_2[1];
    uVar1 = param_2[2];
    *(undefined4 *)(param_1 + 0x1cc8) = uVar1;
    *(float *)(param_1 + 0x1ccc) = param_3;
    *(double *)(param_1 + 0x1cd0) = (double)param_4 + *(double *)(param_1 + 0x510);
    return CONCAT71((uint7)(uint3)((uint)uVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



void FUN_140240480(longlong param_1,char param_2)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  FUN_14021eb20();
  if ((*(int *)(param_1 + 300) == 2) && (param_2 == '\x01')) {
    local_114 = 0;
    local_118[0] = 0;
    FUN_1402b8b80(local_118,*(undefined4 *)(param_1 + 0x128),
                  *(undefined4 *)(*(longlong *)(param_1 + 0x13d8) + 0x30),param_1 + 0x154,
                  param_1 + 0x178);
    FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  }
  FUN_140001710(param_1 + 0x1608,&DAT_140477960,0);
  return;
}



undefined8 FUN_140240520(longlong *param_1,ulonglong param_2,char param_3)

{
  float *pfVar1;
  float *pfVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int *piVar5;
  longlong lVar6;
  char cVar7;
  undefined4 uVar8;
  int iVar9;
  undefined4 uVar10;
  int iVar11;
  longlong *plVar12;
  longlong lVar13;
  undefined4 *puVar14;
  undefined8 uVar15;
  undefined8 *puVar16;
  undefined4 uVar17;
  undefined4 uVar18;
  float fVar19;
  undefined4 local_res8;
  undefined4 local_res20;
  ulonglong in_stack_fffffffffffffdb8;
  undefined4 uVar20;
  undefined8 in_stack_fffffffffffffdc0;
  undefined4 uVar21;
  undefined8 in_stack_fffffffffffffdc8;
  undefined4 uVar22;
  undefined8 in_stack_fffffffffffffdd0;
  undefined8 in_stack_fffffffffffffdd8;
  undefined8 in_stack_fffffffffffffde0;
  uint uVar23;
  undefined8 in_stack_fffffffffffffde8;
  uint uVar24;
  undefined8 in_stack_fffffffffffffdf0;
  undefined4 uVar25;
  undefined8 in_stack_fffffffffffffdf8;
  undefined4 uVar26;
  float local_1f8;
  float local_1f4;
  float local_1f0;
  undefined4 local_1e8;
  float local_1e4;
  float local_1e0;
  float local_1dc;
  undefined4 local_1d8;
  undefined8 local_1d0;
  float local_1c8;
  undefined4 local_1c0;
  undefined4 local_1bc;
  undefined4 local_1b8;
  undefined1 local_1a8 [4];
  undefined8 local_1a4;
  
  uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffdd0 >> 0x20);
  uVar23 = (uint)((ulonglong)in_stack_fffffffffffffde0 >> 0x20);
  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffdf8 >> 0x20);
  uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffdd8 >> 0x20);
  if (((char)param_1[0x450] != '\0') || (*(int *)((longlong)param_1 + 300) == 0x25)) {
    return 0;
  }
  *(undefined1 *)((longlong)param_1 + 0x2259) = 0;
  cVar7 = FUN_14021efc0(param_1,param_2,param_3);
  if (cVar7 == '\0') {
    return 0;
  }
  iVar9 = 0;
  uVar3 = *(undefined4 *)(param_1[0x27b] + 0x30);
  uVar10 = 0;
  local_res20 = 0;
  local_res8 = 0;
  plVar12 = (longlong *)
            (**(code **)(*param_1 + 0x430))
                      (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  local_1d0 = plVar12;
  if (plVar12 != (longlong *)0x0) {
    local_res20 = (**(code **)(*plVar12 + 0xb0))(plVar12);
    local_res8 = (undefined4)plVar12[0x25];
  }
  local_1e8 = 0;
  local_1d8 = 0;
  plVar12 = (longlong *)FUN_140218af0(param_1);
  uVar17 = uVar10;
  uVar8 = uVar10;
  if (plVar12 != (longlong *)0x0) {
    uVar8 = (**(code **)(*plVar12 + 0xb0))(plVar12);
    uVar17 = (undefined4)plVar12[0x25];
    local_1e8 = uVar8;
    local_1d8 = uVar17;
  }
  switch(*(undefined4 *)((longlong)param_1 + 300)) {
  case 0:
  case 1:
    param_1[0x44f] = (longlong)((double)param_1[0xa2] + 1.0);
    break;
  case 0x20:
  case 0x24:
  case 0x57:
  case 0x58:
  case 0x59:
    *(undefined4 *)(param_1 + 0x422) = 0;
  }
  if (param_3 == '\x01') {
    return 1;
  }
  cVar7 = FUN_1402d7670(param_1,4);
  if (cVar7 != '\0') {
    FUN_140245f40(param_1);
  }
  pfVar1 = (float *)((longlong)param_1 + 0x154);
  D3DXVec3Normalize(pfVar1,pfVar1);
  uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffdc0 >> 0x20);
  uVar22 = (undefined4)((ulonglong)in_stack_fffffffffffffdc8 >> 0x20);
  uVar24 = (uint)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
  uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffffdf0 >> 0x20);
  uVar4 = *(undefined4 *)((longlong)param_1 + 300);
  iVar11 = 0;
  switch(uVar4) {
  case 1:
    *(undefined4 *)((longlong)param_1 + 0x2284) = 0;
    break;
  default:
    (**(code **)(*param_1 + 0xb98))
              (param_1,uVar4,uVar3,(int)param_1[0x381],local_res20,CONCAT44(uVar21,local_res8),
               CONCAT44(uVar22,uVar8),uVar17,pfVar1,param_1 + 0x2f);
    break;
  case 3:
  case 0x3a:
    local_1a8[0] = 0;
    local_1a4 = 0;
    FUN_1402b9c10(local_1a8,(int)param_1[0x25],uVar4,uVar3,param_1 + 0x2f,param_1 + 0x439,
                  CONCAT44(uVar22,*(undefined4 *)((longlong)param_1 + 0x4c)),pfVar1);
    FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
    break;
  case 5:
  case 6:
    local_1a8[0] = 0;
    local_1a4 = 0;
    FUN_1402bb0b0(local_1a8,param_1 + 0x25,uVar4,uVar3,param_1 + 0x40c,(longlong)param_1 + 0x206c,
                  param_1 + 0x40f,(float)((double)param_1[0x412] - (double)param_1[0x411]));
    FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
    break;
  case 10:
    iVar9 = iVar11;
    if ((param_1[0x3d0] != 0) && (piVar5 = *(int **)(param_1[0x3d0] + 0x58), piVar5 != (int *)0x0))
    {
      iVar9 = *piVar5;
    }
    lVar13 = param_1[0x16a];
    if (lVar13 != 0) {
      uVar10 = *(undefined4 *)(lVar13 + 0x18);
      iVar11 = *(int *)(lVar13 + 0x28);
    }
    (**(code **)(*param_1 + 0xba8))
              (param_1,uVar3,(int)param_1[0x381],local_res20,local_res8,CONCAT44(uVar21,uVar8),
               CONCAT44(uVar22,uVar17),(char)param_1[0x3d8],pfVar1,param_1 + 0x2f,
               CONCAT44(uVar24,iVar9),CONCAT44(uVar25,uVar10),CONCAT44(uVar26,iVar11));
    if ((param_1[0x27b] != 0) && (lVar13 = *(longlong *)(param_1[0x27b] + 0x20), lVar13 != 0)) {
      uVar15 = FUN_1402c5d10();
      iVar11 = FUN_1402cc6e0(lVar13,uVar15);
      **(int **)(param_1[0x3d0] + 0x58) = iVar11 + iVar9;
    }
    break;
  case 0xb:
    local_1a8[0] = 0;
    local_1a4 = 0;
    FUN_1402ba890(local_1a8,(int)param_1[0x25],uVar4,uVar3,(int)param_1[0x381],
                  CONCAT44(uVar21,local_res20),CONCAT44(uVar22,local_res8),uVar8,
                  CONCAT44(uVar20,uVar17),(char)param_1[0x3d8],pfVar1,param_1 + 0x2f,param_1 + 0x407
                 );
    FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
    break;
  case 0x15:
  case 0x16:
    pfVar2 = (float *)(param_1 + 0x2f);
    *(undefined1 *)(param_1 + 0x3d4) = 1;
    *(float *)((longlong)param_1 + 0x1a9c) = *pfVar2;
    *(undefined4 *)(param_1 + 0x354) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)((longlong)param_1 + 0x1aa4) = (int)param_1[0x30];
    lVar13 = (**(code **)(*param_1 + 0x430))
                       (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    plVar12 = local_1d0;
    uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffdc0 >> 0x20);
    uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffdc8 >> 0x20);
    uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
    uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffdf0 >> 0x20);
    if (*(int *)((longlong)param_1 + 0x1ec4) == 3) {
      if (param_1[0x3d0] == 0) {
        return 1;
      }
      lVar13 = *(longlong *)(param_1[0x3d0] + 0x30);
      if (lVar13 == 0) {
        return 1;
      }
      if (*(longlong *)(lVar13 + 0x2d0) == 0) {
        return 1;
      }
      local_1f8 = *pfVar2 - *pfVar1 * 200.0;
      local_1f4 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(param_1 + 0x2b) * 200.0;
      *(float *)((longlong)param_1 + 0x1e94) = local_1f8;
      local_1f0 = *(float *)(param_1 + 0x30) - *(float *)((longlong)param_1 + 0x15c) * 200.0;
      *(float *)(param_1 + 0x3d3) = local_1f4;
      *(float *)((longlong)param_1 + 0x1e9c) = local_1f0;
      while( true ) {
        if ((0 < iVar9) && (plVar12 != (longlong *)0x0)) {
          rand();
          local_1c0 = 0;
          local_1c8 = *(float *)(param_1 + 0x30) - local_1f0;
          local_1bc = 0x3f800000;
          local_1b8 = 0;
          local_1d0 = (longlong *)
                      CONCAT44(*(float *)((longlong)param_1 + 0x17c) - local_1f4,*pfVar2 - local_1f8
                              );
          puVar14 = (undefined4 *)
                    FUN_140123260(&local_1d0,&local_1c0,((float)iVar9 * 75.0 * 3.1415927) / 180.0);
          *(undefined4 *)((longlong)param_1 + 0x1a44) = *puVar14;
          *(undefined4 *)(param_1 + 0x349) = puVar14[1];
          *(undefined4 *)((longlong)param_1 + 0x1a4c) = puVar14[2];
          *(undefined1 *)(param_1 + 0x27f) = 0;
          *(undefined1 *)(param_1 + 0x348) = 0;
          (**(code **)(*param_1 + 0x100))(param_1);
          D3DXVec3Normalize(&local_1d0,&local_1d0);
          local_1f8 = *pfVar2 - *pfVar1 * 200.0;
          local_1e0 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(param_1 + 0x2b) * 200.0;
          local_1f0 = *(float *)(param_1 + 0x30) - *(float *)((longlong)param_1 + 0x15c) * 200.0;
          local_1f4 = local_1e0 + 20.0;
          local_1e4 = local_1f8;
          local_1dc = local_1f0;
        }
        local_1e8 = 0;
        in_stack_fffffffffffffdb8 = in_stack_fffffffffffffdb8 & 0xffffffffffffff00;
        iVar11 = FUN_1402f9640(param_1,&local_1e8,&local_1f8,1,in_stack_fffffffffffffdb8);
        uVar18 = (undefined4)((ulonglong)in_stack_fffffffffffffdc0 >> 0x20);
        uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffdc8 >> 0x20);
        uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffde8 >> 0x20);
        uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffdf0 >> 0x20);
        if (iVar11 == 1) break;
        iVar9 = iVar9 + 1;
        if (3 < iVar9) {
          (**(code **)(*param_1 + 0xd0))(param_1,0,0);
          return 0;
        }
      }
    }
    else {
      plVar12 = param_1 + 0x3dc;
      if (param_1[0x3de] == 0) {
        if (lVar13 == 0) {
          local_1e4 = *pfVar1 * 50.0 + *pfVar2;
          local_1e0 = *(float *)(param_1 + 0x2b) * 50.0 + *(float *)((longlong)param_1 + 0x17c);
          fVar19 = *(float *)((longlong)param_1 + 0x15c) * 50.0 + *(float *)(param_1 + 0x30);
          *(float *)((longlong)param_1 + 0x1e94) = local_1e4;
          *(float *)(param_1 + 0x3d3) = local_1e0;
          local_1dc = fVar19;
        }
        else {
          *(undefined4 *)((longlong)param_1 + 0x1e94) = *(undefined4 *)(lVar13 + 0x178);
          *(undefined4 *)(param_1 + 0x3d3) = *(undefined4 *)(lVar13 + 0x17c);
          fVar19 = *(float *)(lVar13 + 0x180);
        }
      }
      else {
        if (param_1[0x3d0] == 0) {
          return 1;
        }
        lVar13 = *(longlong *)(param_1[0x3d0] + 0x30);
        if (lVar13 == 0) {
          return 1;
        }
        lVar13 = *(longlong *)(lVar13 + 0x2d0);
        if (lVar13 == 0) {
          return 1;
        }
        if (7 < (ulonglong)param_1[0x3df]) {
          plVar12 = (longlong *)*plVar12;
        }
        lVar13 = FUN_1402bc270(lVar13,plVar12);
        if (lVar13 == 0) goto LAB_140240f54;
        *(undefined4 *)((longlong)param_1 + 0x1e94) = *(undefined4 *)(lVar13 + 0x68);
        *(undefined4 *)(param_1 + 0x3d3) = *(undefined4 *)(lVar13 + 0x6c);
        fVar19 = *(float *)(lVar13 + 0x70);
      }
      *(float *)((longlong)param_1 + 0x1e9c) = fVar19;
    }
LAB_140240f54:
    local_1a8[0] = 0;
    local_1a4 = 0;
    FUN_1402bab50(local_1a8,(int)param_1[0x25],*(undefined4 *)((longlong)param_1 + 300),uVar3,
                  (int)param_1[0x381],CONCAT44(uVar18,local_res20),CONCAT44(uVar20,local_res8),
                  pfVar1,pfVar2,(longlong)param_1 + 0x1e94,CONCAT44(uVar26,(int)param_1[0x34e]),
                  CONCAT44(uVar10,*(undefined4 *)((longlong)param_1 + 0x1a74)));
    FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
    break;
  case 0x1c:
  case 0x23:
    uVar20 = *(undefined4 *)((longlong)param_1 + 0x1a84);
    uVar18 = (undefined4)param_1[0x350];
    goto LAB_14024073c;
  case 0x1d:
  case 0x22:
    (**(code **)(*param_1 + 0xbb0))
              (param_1,uVar4,uVar3,local_res20,local_res8,CONCAT44(uVar21,uVar8),
               CONCAT44(uVar22,uVar17),pfVar1,param_1 + 0x2f,(ulonglong)uVar23 << 0x20,
               (ulonglong)uVar24 << 0x20,CONCAT44(uVar25,(int)param_1[0x43c]),
               CONCAT44(uVar26,(int)param_1[0xa4]));
    break;
  case 0x1f:
    local_1a8[0] = 0;
    local_1a4 = 0;
    FUN_1402b91a0(local_1a8,(int)param_1[0x25],uVar4,uVar3,local_res20,CONCAT44(uVar21,local_res8),
                  CONCAT44(uVar22,uVar8),uVar17,CONCAT44(uVar20,(int)param_1[0x30b]),pfVar1,
                  param_1 + 0x2f);
    FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
    break;
  case 0x20:
  case 0x2b:
    break;
  case 0x24:
    uVar20 = *(undefined4 *)((longlong)param_1 + 0x1a7c);
    uVar18 = (undefined4)param_1[0x34f];
LAB_14024073c:
    FUN_140254820(param_1,uVar4,uVar3,local_res20,local_res8,CONCAT44(uVar21,uVar8),
                  CONCAT44(uVar22,uVar17),pfVar1,param_1 + 0x2f,CONCAT44(uVar23,uVar18),
                  CONCAT44(uVar24,uVar20),CONCAT44(uVar25,(int)param_1[0x43c]),
                  CONCAT44(uVar26,(int)param_1[0xa4]));
    break;
  case 0x25:
    FUN_14023e1e0(param_1);
    local_1a8[0] = 0;
    local_1a4 = 0;
    FUN_1402b9d70(local_1a8,(int)param_1[0x25],*(undefined4 *)((longlong)param_1 + 300),uVar3,
                  param_1 + 0x2f,pfVar1);
    FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
    break;
  case 0x2f:
    local_1a8[0] = 0;
    local_1a4 = 0;
    FUN_1402b8f80(local_1a8,(int)param_1[0x25],uVar4,uVar3,local_res20,CONCAT44(uVar21,local_res8),
                  CONCAT44(uVar22,uVar8),uVar17,pfVar1,param_1 + 0x2f);
    FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
    break;
  case 0x35:
    param_1[0x437] = 0;
    if (param_1[0x435] != 0) {
      puVar16 = (undefined8 *)(param_1[0x27b] + 0x40);
      if (7 < *(ulonglong *)(param_1[0x27b] + 0x58)) {
        puVar16 = (undefined8 *)*puVar16;
      }
      lVar13 = FUN_14033a3d0(param_1[0x435],puVar16);
      param_1[0x437] = lVar13;
    }
  case 0x10:
  case 0x12:
    (**(code **)(*param_1 + 0xba0))
              (param_1,uVar4,uVar3,(int)param_1[0x381],local_res20,CONCAT44(uVar21,local_res8),
               CONCAT44(uVar22,uVar8),uVar17,pfVar1,param_1 + 0x2f,
               CONCAT44(uVar24,(int)param_1[0x34e]),
               CONCAT44(uVar25,*(undefined4 *)((longlong)param_1 + 0x1a74)));
    break;
  case 0x39:
  case 0x3b:
    plVar12 = (longlong *)(**(code **)(*param_1 + 0x158))(param_1);
    uVar20 = (undefined4)(in_stack_fffffffffffffdb8 >> 0x20);
    uVar18 = uVar10;
    if (plVar12 != (longlong *)0x0) {
      iVar9 = (**(code **)(*plVar12 + 0xb0))(plVar12);
      uVar18 = (int)plVar12[0x25];
    }
    lVar13 = param_1[0x16a];
    if (lVar13 != 0) {
      uVar10 = *(undefined4 *)(lVar13 + 0x18);
      iVar11 = *(int *)(lVar13 + 0x28);
    }
    (**(code **)(*param_1 + 0xba8))
              (param_1,uVar3,(int)param_1[0x381],iVar9,CONCAT44(uVar20,uVar18),
               CONCAT44(uVar21,uVar8),CONCAT44(uVar22,uVar17),(char)param_1[0x3d8],pfVar1,
               param_1 + 0x2f,(ulonglong)uVar24 << 0x20,CONCAT44(uVar25,uVar10),
               CONCAT44(uVar26,iVar11));
    break;
  case 0x3c:
    plVar12 = (longlong *)(**(code **)(*param_1 + 0x170))(param_1);
    uVar20 = (undefined4)(in_stack_fffffffffffffdb8 >> 0x20);
    if (plVar12 != (longlong *)0x0) {
      lVar6 = plVar12[0x25];
      uVar26 = *(undefined4 *)((longlong)param_1 + 300);
      lVar13 = *param_1;
      uVar10 = (**(code **)(*plVar12 + 0xb0))(plVar12);
      (**(code **)(lVar13 + 0xb98))
                (param_1,uVar26,uVar3,(int)param_1[0x381],CONCAT44(uVar20,uVar10),
                 CONCAT44(uVar21,(int)lVar6),CONCAT44(uVar22,local_1e8),CONCAT44(uVar18,local_1d8),
                 pfVar1,param_1 + 0x2f);
    }
    break;
  case 0x44:
    lVar13 = param_1[0x168];
    if (lVar13 != 0) {
      local_1a8[0] = 0;
      local_1a4 = 0;
      FUN_1402badd0(local_1a8,(int)param_1[0x25],uVar4,local_res20,local_res8,pfVar1,param_1 + 0x2f,
                    *(undefined4 *)(lVar13 + 0x18),CONCAT44(uVar20,*(undefined4 *)(lVar13 + 0x28)));
      FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
    }
    break;
  case 0x46:
  case 0x47:
    (**(code **)(*param_1 + 3000))
              (param_1,param_2 & 0xffffffff,uVar3,(int)param_1[0x381],local_res20,
               CONCAT44(uVar21,local_res8),pfVar1,param_1 + 0x2f);
    break;
  case 0x60:
    local_1a8[0] = 0;
    local_1a4 = 0;
    FUN_1402ba2b0(local_1a8,(int)param_1[0x25],uVar4,uVar3,local_res20,CONCAT44(uVar21,local_res8),
                  CONCAT44(uVar22,uVar8),uVar17,CONCAT44(uVar20,(int)param_1[0x43c]),pfVar1,
                  param_1 + 0x2f);
    FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_1a8);
  }
  return 1;
}



undefined8
FUN_140241440(longlong *param_1,undefined8 param_2,undefined8 param_3,int param_4,
             undefined4 *param_5)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  
  (**(code **)(*param_1 + 200))(param_1,3,1);
  FUN_14022ecd0(param_1,param_2);
  *(undefined4 *)(param_1 + 0x269) = *param_5;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_5[1];
  *(undefined4 *)(param_1 + 0x26a) = param_5[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_5;
  *(undefined4 *)(param_1 + 0x268) = param_5[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_5[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_5;
  *(undefined4 *)(param_1 + 0x2b) = param_5[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_5[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_5;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_5[1];
  *(undefined4 *)(param_1 + 0x2d) = param_5[2];
  if (((param_1[0x3d0] == 0) || (lVar1 = *(longlong *)(param_1[0x3d0] + 0x30), lVar1 == 0)) ||
     (lVar1 = *(longlong *)(lVar1 + 0x2d0), lVar1 == 0)) {
    uVar3 = 0;
  }
  else {
    lVar1 = *(longlong *)(lVar1 + 0x430);
    if ((param_4 < (int)(*(longlong *)(lVar1 + 0x98) - *(longlong *)(lVar1 + 0x90) >> 3)) &&
       (-1 < param_4)) {
      uVar3 = *(undefined8 *)(*(longlong *)(lVar1 + 0x90) + (longlong)param_4 * 8);
    }
    else {
      uVar3 = 0;
    }
    uVar2 = (**(code **)(*param_1 + 0x80))(param_1);
    FUN_1402bd280(param_1,param_3,uVar3,uVar2);
    uVar3 = 1;
  }
  return uVar3;
}



void FUN_140241580(longlong param_1,short *param_2,undefined8 param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x14f0,param_2,~uVar2 - 1);
  FUN_14022ecd0(param_1,param_3);
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0xd,1);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402416a4)

char FUN_140241660(longlong *param_1,undefined4 param_2,short *param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 *param_7,undefined4 *param_8,
                  int param_9)

{
  longlong *plVar1;
  short sVar2;
  byte bVar3;
  byte bVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  void *pvVar7;
  longlong *plVar8;
  char cVar9;
  char cVar10;
  int iVar11;
  ulonglong uVar12;
  undefined8 uVar13;
  short *psVar14;
  bool bVar15;
  longlong *local_40;
  longlong *local_38;
  
  *(int *)((longlong)param_1 + 0x1c54) = *(int *)((longlong)param_1 + 0x1c54) + 1;
  *(undefined4 *)((longlong)param_1 + 0x1c54) = *(undefined4 *)((longlong)param_1 + 0x1c54);
  *(undefined4 *)(param_1 + 0x34e) = param_5;
  *(undefined4 *)((longlong)param_1 + 0x1a74) = param_6;
  uVar12 = 0xffffffffffffffff;
  psVar14 = param_3;
  do {
    if (uVar12 == 0) break;
    uVar12 = uVar12 - 1;
    sVar2 = *psVar14;
    psVar14 = psVar14 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x299,param_3,~uVar12 - 1);
  *(undefined4 *)(param_1 + 0x381) = param_4;
  *(undefined4 *)(param_1 + 0x2f) = *param_7;
  *(undefined4 *)((longlong)param_1 + 0x17c) = param_7[1];
  *(undefined4 *)(param_1 + 0x30) = param_7[2];
  *(undefined4 *)(param_1 + 0x269) = *param_8;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_8[1];
  *(undefined4 *)(param_1 + 0x26a) = param_8[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_8;
  *(undefined4 *)(param_1 + 0x268) = param_8[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_8[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_8;
  *(undefined4 *)(param_1 + 0x2b) = param_8[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_8[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_8;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_8[1];
  *(undefined4 *)(param_1 + 0x2d) = param_8[2];
  cVar9 = FUN_14021efc0(param_1,param_2,1);
  if (cVar9 == '\0') {
    FUN_140243470(param_1,param_7,param_8);
    goto LAB_140241908;
  }
  bVar3 = *(byte *)((longlong)param_1 + 0x601);
  bVar4 = *(byte *)(param_1 + 0xc0);
  uVar5 = *(undefined4 *)((longlong)param_1 + 300);
  puVar6 = (undefined8 *)param_1[0x391];
  if (puVar6 == (undefined8 *)0x0) {
LAB_1402417f4:
    uVar13 = 0;
  }
  else {
    if (puVar6 != (undefined8 *)param_1[0x392]) {
      iVar11 = DAT_140608150 + 1;
      bVar15 = DAT_140608150 == 0;
      DAT_140608150 = iVar11;
      if (bVar15) {
        FUN_140176d60(1);
      }
      goto LAB_1402417f4;
    }
    uVar13 = *puVar6;
  }
  FUN_140278700(uVar13,&local_40,param_3,param_4,uVar5,bVar3 | bVar4,(char)param_1[0x413]);
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if (*local_40 != 0) {
        iVar11 = *(int *)(*local_40 + 0xf0);
        if (iVar11 == 10000) {
          *(undefined1 *)(param_1 + 0x19a) = 1;
        }
        else if (iVar11 == 20000) {
          *(undefined1 *)((longlong)param_1 + 0xcd1) = 1;
        }
        else {
          cVar10 = (**(code **)(*param_1 + 0x438))(param_1);
          if (cVar10 == '\0') {
            *(undefined1 *)(param_1 + 0x19a) = 0;
          }
        }
      }
    }
    else {
      iVar11 = DAT_140608154 + 1;
      bVar15 = DAT_140608154 == 0;
      DAT_140608154 = iVar11;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  plVar8 = local_40;
  if (local_40 != (longlong *)0x0) {
    if (local_40 == local_38) {
      if (local_40 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_40 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          local_40 = (longlong *)0x0;
          pvVar7 = (void *)*plVar8;
          if (pvVar7 != (void *)0x0) {
            FUN_140197310(pvVar7);
            operator_delete(pvVar7);
          }
          operator_delete(plVar8);
        }
      }
    }
    else {
      iVar11 = DAT_1406080b4 + 1;
      bVar15 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar11;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
LAB_140241908:
  if (param_9 != 0) {
    FUN_140238b40(param_1);
  }
  FUN_1402388d0(param_1);
  return cVar9;
}



ulonglong FUN_140241950(longlong *param_1,short *param_2,undefined8 param_3,undefined4 *param_4)

{
  double dVar1;
  double dVar2;
  short sVar3;
  char cVar4;
  byte bVar5;
  longlong lVar6;
  ulonglong uVar7;
  short *psVar8;
  float fVar9;
  
  uVar7 = *(ulonglong *)(param_1[0x16f] + 0x1a8);
  if ((*(char *)(uVar7 + 0x20) != '\0') ||
     (uVar7 = *(ulonglong *)(param_1[0x16f] + 0x1e8), *(char *)(uVar7 + 0x20) != '\0')) {
    return uVar7 & 0xffffffffffffff00;
  }
  FUN_14022ecd0(param_1,param_3);
  uVar7 = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 0x269) = *param_4;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x26a) = param_4[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x268) = param_4[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x2b) = param_4[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_4;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  psVar8 = param_2;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    sVar3 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar3 != 0);
  FUN_140001710(param_1 + 0x2a8,param_2,~uVar7 - 1);
  bVar5 = 0;
  if (((*(int *)(param_1[0x26] + 0x85c) != 1) ||
      (dVar1 = (double)param_1[0xa2], dVar2 = (double)param_1[0x166],
      fVar9 = (float)(**(code **)(*param_1 + 0x360))(param_1), dVar1 - dVar2 <= (double)fVar9)) ||
     (cVar4 = (**(code **)(*param_1 + 0x390))(param_1,param_1[0xa2],0), cVar4 == '\0')) {
    bVar5 = FUN_14021efc0(param_1,0x1d,1);
  }
  param_1[0x309] = param_1[0xa2];
  FUN_1402383f0(param_1);
  lVar6 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar6 != 0) {
    FUN_140238660(lVar6);
  }
  return (ulonglong)bVar5;
}



void FUN_140241b00(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  FUN_14022ecd0();
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x20,1);
  return;
}



undefined1 FUN_140241ba0(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  undefined1 uVar1;
  
  FUN_14022ecd0();
  *(undefined4 *)(param_1 + 0x269) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x26a) = param_3[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x268) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x2b) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  uVar1 = FUN_14021efc0(param_1,0x2f,1);
  (**(code **)(*param_1 + 0xb08))(param_1,0x2f,param_1[0xa2]);
  return uVar1;
}



void FUN_140241c60(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  FUN_14022ecd0();
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x30,1);
  return;
}



undefined1 FUN_140241d00(longlong *param_1,undefined8 param_2,undefined4 *param_3)

{
  undefined1 uVar1;
  
  FUN_14022ecd0();
  *(undefined4 *)(param_1 + 0x269) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x26a) = param_3[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x268) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x2b) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  uVar1 = FUN_14021efc0(param_1,0x32,1);
  (**(code **)(*param_1 + 0xbc8))(param_1);
  return uVar1;
}



void FUN_140241db0(longlong param_1,undefined8 param_2,undefined4 *param_3)

{
  FUN_14022ecd0();
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x1e,1);
  return;
}



void FUN_140241e50(longlong param_1,undefined8 param_2,undefined4 *param_3,undefined4 param_4,
                  undefined4 param_5)

{
  *(undefined4 *)(param_1 + 0x1a80) = param_4;
  *(undefined4 *)(param_1 + 0x1a84) = param_5;
  FUN_14022ecd0();
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x1c,1);
  return;
}



void FUN_140241f00(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x22,1);
  return;
}



void FUN_140241fa0(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  ulonglong uVar2;
  
  *(undefined4 *)(param_1 + 0x1a80) = param_5;
  *(undefined4 *)(param_1 + 0x1a84) = param_6;
  uVar2 = 0xffffffffffffffff;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x1540,param_6,~uVar2 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0x23,1);
  return;
}



undefined1
FUN_1402420a0(longlong param_1,short *param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  undefined1 uVar2;
  int iVar3;
  ulonglong uVar4;
  float fVar5;
  undefined1 local_138 [4];
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_12c;
  
  *(undefined4 *)(param_1 + 0x1a78) = param_5;
  *(undefined4 *)(param_1 + 0x1a7c) = param_6;
  uVar4 = 0xffffffffffffffff;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x1568,param_6,~uVar4 - 1);
  FUN_14022ecd0(param_1,param_3);
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  uVar2 = FUN_14021efc0(param_1,0x24,1);
  *(undefined1 *)(param_1 + 0x2034) = 1;
  if (((*(longlong *)(param_1 + 0x21a0) == 0) ||
      (*(float *)(*(longlong *)(param_1 + 0x21a0) + 0x18c) <= 0.01)) &&
     (fVar5 = (float)(**(code **)(**(longlong **)(param_1 + 0x2268) + 0xb8))(), fVar5 <= 0.01)) {
    return uVar2;
  }
  iVar3 = rand();
  if ((*(longlong *)(param_1 + 0x21a0) == 0) ||
     (fVar5 = *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x18c), fVar5 <= 0.01)) {
    fVar5 = (float)(**(code **)(**(longlong **)(param_1 + 0x2268) + 0xb8))();
  }
  if ((float)iVar3 * 3.0517578e-05 < fVar5) {
    if ((*(longlong *)(param_1 + 0x21a0) == 0) ||
       (fVar5 = *(float *)(*(longlong *)(param_1 + 0x21a0) + 400), fVar5 <= 0.01)) {
      fVar5 = (float)(**(code **)(**(longlong **)(param_1 + 0x2268) + 0xc0))();
    }
    if ((double)fVar5 < *(double *)(param_1 + 0x510) - *(double *)(param_1 + 0x2128)) {
      local_12c = *(undefined4 *)(param_1 + 0x128);
      *(double *)(param_1 + 0x2128) = *(double *)(param_1 + 0x510);
      *(undefined1 *)(param_1 + 0x2034) = 0;
      local_134 = 4;
      local_130 = 4;
      local_138[0] = 0x1e;
      FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_138);
    }
    return uVar2;
  }
  return uVar2;
}



void FUN_1402422e0(longlong param_1,short *param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  ulonglong uVar2;
  
  *(undefined4 *)(param_1 + 0x1a78) = param_5;
  *(undefined4 *)(param_1 + 0x1a7c) = param_6;
  uVar2 = 0xffffffffffffffff;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x1540,param_6,~uVar2 - 1);
  FUN_14022ecd0(param_1,param_3);
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0x2b,1);
  return;
}



undefined1 FUN_1402423d0(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  short *psVar5;
  
  uVar4 = 0xffffffffffffffff;
  psVar5 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x14c8,param_2,~uVar4 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  uVar2 = FUN_14021efc0(param_1,0x35,1);
  if (*(longlong *)(param_1 + 0x21a8) != 0) {
    uVar3 = FUN_14033a3d0(*(longlong *)(param_1 + 0x21a8),param_2);
    *(undefined4 *)(param_1 + 0x21c0) = 0;
    *(undefined8 *)(param_1 + 0x21b8) = uVar3;
  }
  return uVar2;
}



char FUN_1402424f0(longlong *param_1,undefined4 *param_2,undefined4 *param_3,undefined4 param_4,
                  undefined4 param_5)

{
  char cVar1;
  longlong *plVar2;
  
  (**(code **)(*param_1 + 0x148))(param_1,param_4,param_5);
  *(undefined4 *)(param_1 + 0x438) = 0;
  *(undefined4 *)(param_1 + 0x2f) = *param_2;
  *(undefined4 *)((longlong)param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x30) = param_2[2];
  *(undefined4 *)(param_1 + 0x269) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x26a) = param_3[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x268) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_3[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x2b) = param_3[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x2d) = param_3[2];
  cVar1 = FUN_14021efc0(param_1,0x39,1);
  if (cVar1 != '\0') {
    plVar2 = (longlong *)(**(code **)(*param_1 + 0x158))(param_1);
    if (plVar2 != (longlong *)0x0) {
      (**(code **)(*plVar2 + 200))(plVar2,0x3c,1);
    }
  }
  (**(code **)(*param_1 + 0xb90))(param_1);
  return cVar1;
}



void FUN_140242610(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x3a,1);
  return;
}



void FUN_1402426b0(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x36,1);
  return;
}



void FUN_140242750(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x37,1);
  return;
}



void FUN_1402427f0(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x38,1);
  return;
}



void FUN_140242890(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x3d,1);
  return;
}



void FUN_140242930(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x1478,param_2,~uVar2 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0x3f,1);
  return;
}



void FUN_140242a20(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x42,1);
  return;
}



void FUN_140242ac0(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x43,1);
  return;
}



void FUN_140242b60(longlong param_1,undefined4 *param_2,undefined4 *param_3)

{
  *(undefined4 *)(param_1 + 0x178) = *param_2;
  *(undefined4 *)(param_1 + 0x17c) = param_2[1];
  *(undefined4 *)(param_1 + 0x180) = param_2[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_3;
  *(undefined4 *)(param_1 + 0x134c) = param_3[1];
  *(undefined4 *)(param_1 + 0x1350) = param_3[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_3;
  *(undefined4 *)(param_1 + 0x1340) = param_3[1];
  *(undefined4 *)(param_1 + 0x1344) = param_3[2];
  *(undefined4 *)(param_1 + 0x154) = *param_3;
  *(undefined4 *)(param_1 + 0x158) = param_3[1];
  *(undefined4 *)(param_1 + 0x15c) = param_3[2];
  *(undefined4 *)(param_1 + 0x160) = *param_3;
  *(undefined4 *)(param_1 + 0x164) = param_3[1];
  *(undefined4 *)(param_1 + 0x168) = param_3[2];
  FUN_14021efc0(param_1,0x46,1);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140242c2e)

void FUN_140242c00(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  *(int *)(param_1 + 0x1c54) = *(int *)(param_1 + 0x1c54) + 1;
  uVar2 = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 0x1c54) = *(undefined4 *)(param_1 + 0x1c54);
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x14c8,param_2,~uVar2 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0x47,1);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140242d2e)

void FUN_140242d00(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  *(int *)(param_1 + 0x1c54) = *(int *)(param_1 + 0x1c54) + 1;
  uVar2 = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 0x1c54) = *(undefined4 *)(param_1 + 0x1c54);
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x16a8,param_2,~uVar2 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0x4b,1);
  return;
}



void FUN_140242e00(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x16a8,param_2,~uVar2 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0x4a,1);
  return;
}



void FUN_140242ef0(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x16a8,param_2,~uVar2 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0x4c,1);
  return;
}



void FUN_140242fe0(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x1680,param_2,~uVar2 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,0x49,1);
  return;
}



void FUN_1402430d0(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x16f8,param_2,~uVar2 - 1);
  FUN_14021efc0(param_1,0x60,1);
  return;
}



void FUN_1402431b0(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x16f8,param_2,~uVar2 - 1);
  FUN_14021efc0(param_1,0x61,1);
  return;
}



void FUN_140243290(longlong *param_1,short *param_2,undefined4 *param_3,undefined4 *param_4)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  *(undefined4 *)(param_1 + 0x2f) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x30) = param_3[2];
  *(undefined4 *)(param_1 + 0x269) = *param_4;
  *(undefined4 *)((longlong)param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x26a) = param_4[2];
  *(undefined4 *)((longlong)param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x268) = param_4[1];
  *(undefined4 *)((longlong)param_1 + 0x1344) = param_4[2];
  *(undefined4 *)((longlong)param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x2b) = param_4[1];
  *(undefined4 *)((longlong)param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x2c) = *param_4;
  *(undefined4 *)((longlong)param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x2d) = param_4[2];
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2e4,param_2,~uVar2 - 1);
                    // WARNING: Could not recover jumptable at 0x000140243365. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 200))(param_1,0x62,1);
  return;
}



void FUN_140243370(longlong param_1,short *param_2,undefined4 *param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  short sVar1;
  ulonglong uVar2;
  
  *(undefined4 *)(param_1 + 0x1a78) = param_5;
  *(undefined4 *)(param_1 + 0x1a7c) = param_6;
  uVar2 = 0xffffffffffffffff;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x1540,param_6,~uVar2 - 1);
  *(undefined4 *)(param_1 + 0x178) = *param_3;
  *(undefined4 *)(param_1 + 0x17c) = param_3[1];
  *(undefined4 *)(param_1 + 0x180) = param_3[2];
  *(undefined4 *)(param_1 + 0x1348) = *param_4;
  *(undefined4 *)(param_1 + 0x134c) = param_4[1];
  *(undefined4 *)(param_1 + 0x1350) = param_4[2];
  *(undefined4 *)(param_1 + 0x133c) = *param_4;
  *(undefined4 *)(param_1 + 0x1340) = param_4[1];
  *(undefined4 *)(param_1 + 0x1344) = param_4[2];
  *(undefined4 *)(param_1 + 0x154) = *param_4;
  *(undefined4 *)(param_1 + 0x158) = param_4[1];
  *(undefined4 *)(param_1 + 0x15c) = param_4[2];
  *(undefined4 *)(param_1 + 0x160) = *param_4;
  *(undefined4 *)(param_1 + 0x164) = param_4[1];
  *(undefined4 *)(param_1 + 0x168) = param_4[2];
  FUN_14021efc0(param_1,99,1);
  return;
}



void FUN_140243470(longlong *param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined4 uVar1;
  
  switch(*(undefined4 *)((longlong)param_1 + 300)) {
  case 3:
  case 0x3a:
  case 0x4b:
    (**(code **)(*param_1 + 0x100))(param_1,param_3);
    FUN_14022ecd0(param_1,param_2);
    return;
  case 10:
  case 0x10:
    *(undefined4 *)((longlong)param_1 + 0x1a54) = *param_2;
    *(undefined4 *)(param_1 + 0x34b) = param_2[1];
    *(undefined4 *)((longlong)param_1 + 0x1a5c) = param_2[2];
    *(undefined4 *)((longlong)param_1 + 0x1a44) = *param_3;
    *(undefined4 *)(param_1 + 0x349) = param_3[1];
    uVar1 = param_3[2];
    *(undefined1 *)(param_1 + 0x348) = 1;
    *(undefined4 *)((longlong)param_1 + 0x1a4c) = uVar1;
    *(undefined1 *)(param_1 + 0x34a) = 1;
    return;
  case 0x46:
  case 0x47:
    (**(code **)(*param_1 + 0xb58))(param_1);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140243d27)
// WARNING: Removing unreachable block (ram,0x000140243d30)

void FUN_1402435a0(longlong *param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  longlong lVar5;
  int iVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  bool bVar11;
  bool bVar12;
  
  lVar9 = 0;
  bVar12 = false;
  plVar7 = (longlong *)param_1[0x25d];
  lVar10 = lVar9;
  if (plVar7 != (longlong *)0x0) {
    if (plVar7 == (longlong *)param_1[0x25e]) {
      lVar8 = *plVar7;
      lVar10 = 0;
      if (lVar8 != 0) {
        if ((plVar7 != (longlong *)param_1[0x25e]) &&
           (iVar4 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, lVar8 = lVar9,
           DAT_1406080a8 = iVar4, bVar12)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar8);
        bVar12 = true;
        lVar10 = lVar8;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  lVar9 = param_1[0x316];
  for (lVar8 = param_1[0x315]; lVar8 != lVar9; lVar8 = lVar8 + 0xb0) {
    iVar4 = *(int *)(lVar8 + 4);
    if (iVar4 == 0x67) {
      if (*(int *)((longlong)param_1 + 300) != 0x25) {
        (**(code **)(*param_1 + 0x290))(param_1);
      }
      lVar5 = (**(code **)(*param_1 + 0x430))
                        (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
      if (lVar5 != 0) {
        *(int *)(lVar5 + 0x2030) = -*(int *)(lVar8 + 0xa8);
      }
    }
    else if ((((*(int *)(lVar8 + 8) != 0) &&
              (lVar5 = *(longlong *)(*(longlong *)(param_1[0x27b] + 0x10) + 0xd8), lVar5 != 0)) &&
             (iVar6 = *(int *)(lVar8 + 8) + -1, -1 < iVar6)) &&
            ((iVar6 < (int)(*(longlong *)(lVar5 + 0x30) - *(longlong *)(lVar5 + 0x28) >> 4) &&
             (lVar5 = *(longlong *)(*(longlong *)(lVar5 + 0x28) + (longlong)iVar6 * 0x10),
             lVar5 != 0)))) {
      switch(iVar4) {
      case 2:
        FUN_14022ecd0(param_1,lVar8 + 0xc);
        (**(code **)(*param_1 + 0x100))(param_1,lVar8 + 0x18);
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_14021eb20(param_1,0,plVar7);
        break;
      case 3:
        FUN_140241440(param_1,lVar8 + 0xc,lVar8 + 0x24,*(undefined4 *)(lVar8 + 0x58),lVar8 + 0x18);
        break;
      default:
        FUN_14022ecd0(param_1,lVar8 + 0xc);
        (**(code **)(*param_1 + 0x100))(param_1,lVar8 + 0x18);
        (**(code **)(*param_1 + 200))(param_1,*(undefined4 *)(lVar8 + 4),1);
        break;
      case 8:
        cVar3 = FUN_140223f00(param_1);
        if (cVar3 != '\0') {
          FUN_14022ecd0(param_1,lVar8 + 0xc);
          (**(code **)(*param_1 + 0x100))(param_1,lVar8 + 0x18);
        }
        break;
      case 9:
        cVar3 = FUN_140223f80(param_1);
        if (cVar3 != '\0') {
          FUN_14022ecd0(param_1,lVar8 + 0xc);
          (**(code **)(*param_1 + 0x100))(param_1,lVar8 + 0x18);
        }
        break;
      case 10:
      case 0xf:
      case 0x10:
      case 0x12:
      case 0x14:
      case 0x15:
      case 0x16:
      case 0x17:
      case 0x3b:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140241660(param_1,iVar4,plVar7,*(undefined4 *)(lVar8 + 0x5c),
                      *(undefined4 *)(lVar8 + 0x48),*(undefined4 *)(lVar8 + 0x4c),lVar8 + 0xc,
                      lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x60));
        break;
      case 0xd:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140241580(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x1b:
      case 0x3e:
      case 0x5e:
      case 0x5f:
        break;
      case 0x1c:
        FUN_140241e50(param_1,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                      *(undefined4 *)(lVar8 + 0x4c));
        break;
      case 0x1d:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140241950(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x1e:
        FUN_140241db0(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x20:
        FUN_140241b00(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x22:
        FUN_140241f00(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x23:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140241fa0(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                      *(undefined4 *)(lVar8 + 0x4c));
        break;
      case 0x24:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_1402420a0(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                      *(undefined4 *)(lVar8 + 0x4c));
        break;
      case 0x26:
        FUN_140243470(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x2b:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_1402422e0(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                      *(undefined4 *)(lVar8 + 0x4c));
        break;
      case 0x2f:
        FUN_140241ba0(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x30:
        FUN_140241c60(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x32:
        FUN_140241d00(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x35:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_1402423d0(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x36:
        FUN_1402426b0(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x37:
        FUN_140242750(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x38:
        FUN_1402427f0(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x39:
        FUN_1402424f0(param_1,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 100),
                      *(undefined4 *)(lVar8 + 0x60));
        break;
      case 0x3a:
        FUN_140242610(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x3c:
        uVar1 = *(undefined4 *)(lVar8 + 0x60);
        uVar2 = *(undefined4 *)(lVar8 + 100);
        cVar3 = FUN_14021efc0(param_1,0x3c,1);
        if (cVar3 != '\0') {
          (**(code **)(*param_1 + 0x160))(param_1,uVar2,uVar1);
        }
        break;
      case 0x3d:
        FUN_140242890(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x3f:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140242930(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x42:
        FUN_140242a20(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x43:
        FUN_140242ac0(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x46:
        FUN_140242b60(param_1,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x47:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140242c00(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x49:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140242fe0(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x4a:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140242e00(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x4b:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140242d00(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x4c:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140242ef0(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x60:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_1402430d0(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x61:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_1402431b0(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 0x62:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140243290(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18);
        break;
      case 99:
        plVar7 = (longlong *)(lVar5 + 0x1b8);
        if (7 < *(ulonglong *)(lVar5 + 0x1d0)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140243370(param_1,plVar7,lVar8 + 0xc,lVar8 + 0x18,*(undefined4 *)(lVar8 + 0x48),
                      *(undefined4 *)(lVar8 + 0x4c));
      }
    }
  }
  if (param_1[0x315] != param_1[0x316]) {
    param_1[0x316] = param_1[0x315];
  }
  if (bVar12) {
    FUN_14034edd0(lVar10);
  }
  return;
}



void thunk_FUN_140254b10(longlong param_1)

{
  undefined1 auStack_118 [4];
  undefined8 uStack_114;
  
  auStack_118[0] = 0;
  uStack_114 = 0;
  FUN_1402b7b20(auStack_118,*(undefined4 *)(param_1 + 0x128),(int)*(float *)(param_1 + 0x598),
                (int)*(float *)(param_1 + 0x5a0),*(undefined4 *)(param_1 + 0x610),
                *(undefined4 *)(param_1 + 0x614));
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),auStack_118);
  *(undefined8 *)(param_1 + 0x610) = 0;
  return;
}



void thunk_FUN_140254c40(longlong *param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined1 auStack_118 [4];
  undefined8 uStack_114;
  
  auStack_118[0] = 0;
  uStack_114 = 0;
  uVar1 = (**(code **)(*param_1 + 0x220))();
  uVar2 = (**(code **)(*param_1 + 0x218))(param_1);
  uVar3 = (**(code **)(*param_1 + 0x210))(param_1);
  FUN_1402bb870(auStack_118,param_1 + 0x25,uVar3,uVar2,uVar1);
  FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),auStack_118);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140254d1c)

void thunk_FUN_140254cd0(longlong param_1)

{
  undefined4 auStackX_8 [2];
  undefined1 auStack_118 [4];
  int iStack_114;
  int iStack_110;
  undefined4 uStack_10c;
  undefined1 auStack_108 [256];
  
  uStack_10c = *(undefined4 *)(param_1 + 0x128);
  auStackX_8[0] = *(undefined4 *)(param_1 + 0x1e50);
  auStack_118[0] = 0x25;
  iStack_114 = 4;
  iStack_110 = 4;
  memcpy(auStack_108,auStackX_8,4);
  iStack_114 = iStack_114 + 4;
  iStack_110 = iStack_114;
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),auStack_118);
  return;
}



undefined1 FUN_140243ec0(longlong *param_1,undefined1 param_2)

{
  undefined1 uVar1;
  
  uVar1 = 0;
  if (*(int *)((longlong)param_1 + 300) != 3) {
    uVar1 = FUN_140223d80();
  }
  (**(code **)(*param_1 + 200))(param_1,3,param_2);
  return uVar1;
}



undefined8
FUN_140243f20(longlong *param_1,longlong param_2,undefined4 param_3,undefined4 param_4,
             undefined4 param_5)

{
  char cVar1;
  
  if ((param_2 != 0) && (*(char *)(param_2 + 0x3aa) != '\0')) {
    cVar1 = (**(code **)(*param_1 + 0x438))();
    if (cVar1 == '\0') {
      *(undefined1 *)(param_1 + 0x19a) = 1;
    }
  }
  FUN_140235080(param_1,param_2,param_3,param_4,param_5);
  return 1;
}



void FUN_140243fa0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong *plVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  undefined8 *puVar10;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined8 local_48;
  undefined4 local_40;
  undefined4 uStack_3c;
  undefined8 local_38;
  
  FUN_1402c10c0(param_1 + 0x2150,
                (longlong)
                (int)(*(longlong *)(*(longlong *)(param_1 + 0x2140) + 0x38) -
                      *(longlong *)(*(longlong *)(param_1 + 0x2140) + 0x30) >> 4),param_3,param_4,
                0xfffffffffffffffe);
  lVar3 = *(longlong *)(param_1 + 0x2140);
  puVar9 = *(undefined8 **)(lVar3 + 0x30);
  if (puVar9 != *(undefined8 **)(lVar3 + 0x38)) {
    do {
      uVar4 = *puVar9;
      plVar5 = (longlong *)puVar9[1];
      if (plVar5 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar5 + 1) = (int)plVar5[1] + 1;
        UNLOCK();
      }
      local_48 = *(undefined8 *)(param_1 + 0x510);
      local_40 = 0;
      local_50 = 0;
      puVar6 = *(undefined4 **)(param_1 + 0x2158);
      local_38 = uVar4;
      if ((&local_50 < puVar6) && (puVar7 = *(undefined4 **)(param_1 + 0x2150), puVar7 <= &local_50)
         ) {
        if (puVar6 == *(undefined4 **)(param_1 + 0x2160)) {
          FUN_1402c1030(param_1 + 0x2150);
        }
        puVar10 = (undefined8 *)
                  (((longlong)&local_50 - (longlong)puVar7 & 0xffffffffffffffe0U) +
                  *(longlong *)(param_1 + 0x2150));
        puVar8 = *(undefined8 **)(param_1 + 0x2158);
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = *puVar10;
          puVar8[1] = puVar10[1];
          puVar8[2] = puVar10[2];
          puVar8[3] = puVar10[3];
        }
      }
      else {
        if (puVar6 == *(undefined4 **)(param_1 + 0x2160)) {
          FUN_1402c1030(param_1 + 0x2150);
        }
        puVar8 = *(undefined8 **)(param_1 + 0x2158);
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = CONCAT44(uStack_4c,local_50);
          puVar8[1] = local_48;
          puVar8[2] = CONCAT44(uStack_3c,local_40);
          puVar8[3] = uVar4;
        }
      }
      *(longlong *)(param_1 + 0x2158) = *(longlong *)(param_1 + 0x2158) + 0x20;
      if (plVar5 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar5 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*plVar5 + 8))(plVar5);
          LOCK();
          piVar2 = (int *)((longlong)plVar5 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar5 + 0x10))();
          }
        }
      }
      puVar9 = puVar9 + 2;
    } while (puVar9 != *(undefined8 **)(lVar3 + 0x38));
  }
  return;
}



undefined8 FUN_140244170(longlong *param_1)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int *piVar5;
  
  if (param_1[0x428] == 0) {
    return 0;
  }
  piVar5 = (int *)param_1[0x42a];
  if (piVar5 != (int *)param_1[0x42b]) {
    do {
      cVar2 = FUN_140244320(param_1);
      if ((cVar2 != '\0') && (cVar2 = (**(code **)(*param_1 + 0xb78))(param_1), cVar2 != '\0')) {
        iVar3 = FUN_14033ae70();
        if (iVar3 == 0) {
          lVar1 = *(longlong *)(piVar5 + 6);
          if (*(longlong *)(lVar1 + 0x28) != *(longlong *)(lVar1 + 0x30)) {
            iVar3 = (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 2);
            if (iVar3 == 0) {
              iVar4 = 0;
            }
            else {
              iVar4 = rand();
              iVar4 = iVar4 % iVar3;
            }
            (**(code **)(*param_1 + 0x908))
                      (param_1,*(undefined4 *)
                                (*(longlong *)(*(longlong *)(piVar5 + 6) + 0x28) +
                                (longlong)iVar4 * 4));
          }
          *piVar5 = *piVar5 + 1;
          *(longlong *)(piVar5 + 2) = param_1[0xa2];
          if (*(int *)(*(longlong *)(piVar5 + 6) + 0x24) == 0) {
            return 0;
          }
          (**(code **)(*param_1 + 0xb38))(param_1);
          return 1;
        }
        if (iVar3 != 2) {
          *(longlong *)(piVar5 + 2) = param_1[0xa2];
        }
      }
      piVar5 = piVar5 + 8;
    } while (piVar5 != (int *)param_1[0x42b]);
  }
  return 0;
}



ulonglong FUN_140244320(longlong param_1,int *param_2)

{
  uint uVar1;
  ulonglong uVar2;
  
  uVar2 = 0;
  switch(*(undefined4 *)(param_1 + 300)) {
  case 8:
  case 9:
  case 0x13:
  case 0x1b:
  case 0x1c:
  case 0x1f:
  case 0x20:
  case 0x21:
  case 0x22:
  case 0x23:
  case 0x24:
  case 0x25:
  case 0x3c:
  case 0x3d:
  case 0x3e:
  case 0x46:
  case 0x47:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
    break;
  default:
    uVar1 = *(uint *)(*(longlong *)(param_2 + 6) + 0x14);
    uVar2 = (ulonglong)uVar1;
    if ((*param_2 < (int)uVar1) &&
       ((double)*(float *)(*(longlong *)(param_2 + 6) + 8) <=
        *(double *)(param_1 + 0x510) - *(double *)(param_2 + 2))) {
      return CONCAT71((uint7)(uint3)(uVar1 >> 8),1);
    }
  }
  return uVar2 & 0xffffffffffffff00;
}



undefined8 FUN_1402443e0(longlong *param_1,longlong param_2,undefined4 param_3,int param_4)

{
  double dVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong lVar6;
  int iVar7;
  longlong lVar8;
  bool bVar9;
  float extraout_XMM0_Da;
  float fVar10;
  float extraout_XMM0_Da_00;
  double dVar11;
  float fVar12;
  float fVar13;
  
  plVar4 = *(longlong **)(param_2 + 0x80);
  if (plVar4 == (longlong *)0x0) {
    return 0;
  }
  if (plVar4 != *(longlong **)(param_2 + 0x88)) {
    if (DAT_140608154 == 0) {
      DAT_140608154 = DAT_140608154 + 1;
      FUN_140176d60(1);
      return 0;
    }
    DAT_140608154 = DAT_140608154 + 1;
    return 0;
  }
  if (*plVar4 == 0) {
    return 0;
  }
  lVar6 = 0;
  lVar8 = *plVar4;
  if ((plVar4 != *(longlong **)(param_2 + 0x88)) &&
     (iVar7 = DAT_140608154 + 1, bVar9 = DAT_140608154 == 0, lVar8 = lVar6, DAT_140608154 = iVar7,
     bVar9)) {
    FUN_140176d60(1);
  }
  plVar4 = *(longlong **)(param_2 + 0x80);
  cVar2 = *(char *)(lVar8 + 0xd9);
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == *(longlong **)(param_2 + 0x88)) {
      lVar6 = *plVar4;
    }
    else {
      iVar7 = DAT_140608154 + 1;
      bVar9 = DAT_140608154 == 0;
      DAT_140608154 = iVar7;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  iVar7 = *(int *)(lVar6 + 0xe0);
  lVar6 = FUN_140192f70(*(undefined8 *)(param_1[0x3d0] + 0x48),*(undefined4 *)(param_2 + 0x38),
                        *(undefined4 *)(param_2 + 0x3c));
  if (lVar6 != 0) {
    iVar3 = *(int *)(lVar6 + 0xd7c);
    if ((iVar3 == 2) && (iVar7 == 2)) {
      return 0;
    }
    if ((iVar3 == 1) && (iVar7 == 1)) {
      return 0;
    }
    if (iVar3 == 3) {
      return 0;
    }
  }
  if (cVar2 != '\0') {
    return 0;
  }
  if ((longlong *)param_1[0x44d] == (longlong *)0x0) {
    return 0;
  }
  iVar7 = (**(code **)(*(longlong *)param_1[0x44d] + 0x50))();
  if (iVar7 == 0) {
    return 0;
  }
  if ((char)param_1[0x19a] != '\x01') {
    if (*(char *)((longlong)param_1 + 0xcd1) == '\x01') {
      return 0;
    }
    if (param_4 != 7) {
      iVar7 = *(int *)((longlong)param_1 + 300);
      switch(iVar7 + -2) {
      case 0:
      case 1:
      case 3:
      case 4:
      case 5:
      case 0x1b:
      case 0x2d:
      case 0x2e:
        goto switchD_140244576_caseD_0;
      default:
        return 0;
      case 8:
      case 0xd:
      case 0xe:
      case 0x10:
      case 0x12:
      case 0x13:
      case 0x14:
      case 0x15:
      case 0x16:
        param_1[0x424] = (longlong)((double)param_1[0xa2] + 0.800000011920929);
        return 0;
      }
    }
    return 0;
  }
  return 0;
switchD_140244576_caseD_0:
  if ((iVar7 != 0x2f) && (iVar7 != 0x30)) {
    dVar11 = (double)param_1[0xa2];
    dVar1 = (double)param_1[0x424];
    (**(code **)(*(longlong *)param_1[0x44d] + 0x60))();
    if (dVar11 - dVar1 < (double)extraout_XMM0_Da) {
      return 0;
    }
    plVar4 = (longlong *)param_1[0x44d];
    fVar10 = (float)(**(code **)(*plVar4 + 0xa0))(plVar4);
    lVar6 = param_1[0x421];
    dVar11 = (double)FUN_140414fe0();
    (**(code **)(*plVar4 + 0x98))(plVar4);
    if ((double)(extraout_XMM0_Da_00 + fVar10 * (float)(int)lVar6) < dVar11) {
      return 0;
    }
  }
  lVar6 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if ((lVar6 != 0) &&
     (fVar13 = *(float *)(lVar6 + 0x17c) - *(float *)((longlong)param_1 + 0x17c),
     fVar10 = *(float *)(lVar6 + 0x180) - *(float *)(param_1 + 0x30),
     fVar12 = *(float *)(lVar6 + 0x178) - *(float *)(param_1 + 0x2f),
     fVar13 * fVar13 + fVar12 * fVar12 + fVar10 * fVar10 < 160000.0)) {
    plVar4 = (longlong *)param_1[0x41a];
    if (plVar4 != (longlong *)0x0) {
      plVar5 = (longlong *)plVar4[0xb];
      lVar6 = param_1[0xa2];
      *plVar4 = (longlong)plVar5;
      (**(code **)(*plVar5 + 0x38))(plVar5,plVar4,lVar6);
      *(undefined1 *)(*plVar4 + 8) = 0;
    }
    FUN_1402265a0(param_1,param_2,param_3);
    param_1[0x424] = param_1[0xa2];
    return 1;
  }
  return 0;
}



undefined8 FUN_140244750(longlong param_1)

{
  char cVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  longlong lVar5;
  ulonglong uVar6;
  int *piVar7;
  longlong lVar8;
  uint *puVar9;
  longlong *plVar10;
  longlong lVar11;
  longlong *_Dst;
  longlong *plVar12;
  longlong local_res10;
  longlong *local_70;
  longlong *local_68;
  longlong *local_60;
  longlong *local_58;
  longlong *local_50;
  
  uVar2 = *(uint *)(*(longlong *)(param_1 + 0x130) + 0x8e0);
  lVar5 = FUN_140302f80();
  if (*(longlong *)(lVar5 + 0x90) == 0) {
    return 0;
  }
  puVar9 = *(uint **)(*(longlong *)(lVar5 + 0x90) +
                     ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar5 + 0xa0)) * 8);
  while( true ) {
    if (puVar9 == (uint *)0x0) {
      return 0;
    }
    if ((puVar9[0x24a] == uVar2) && (*puVar9 == uVar2)) break;
    puVar9 = *(uint **)(puVar9 + 0x248);
  }
  if (puVar9 == (uint *)0x0) {
    return 0;
  }
  if (puVar9 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (puVar9[0x6a] != 4) {
    return 0;
  }
  if (*(longlong *)(param_1 + 0x1e80) == 0) {
    return 0;
  }
  lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30);
  if (lVar5 == 0) {
    return 0;
  }
  if (*(longlong *)(lVar5 + 0x2d0) == 0) {
    return 0;
  }
  iVar4 = *(int *)(*(longlong *)(lVar5 + 0x2d0) + 0x4c4);
  lVar5 = param_1;
  FUN_140337c40(DAT_1406081f8);
  if (local_70[1] != 0) {
    uVar6 = 0;
    if (*(uint *)(local_70 + 2) != 0) {
      plVar10 = (longlong *)*local_70;
      do {
        if (*plVar10 != 0) {
          lVar11 = ((longlong *)*local_70)[uVar6];
          goto LAB_14024487a;
        }
        uVar2 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar2;
        plVar10 = plVar10 + 1;
      } while (uVar2 < *(uint *)(local_70 + 2));
    }
  }
  lVar11 = 0;
LAB_14024487a:
  _Dst = (longlong *)0x0;
  local_60 = (longlong *)0x0;
  plVar10 = (longlong *)0x0;
  local_58 = (longlong *)0x0;
  plVar12 = (longlong *)0x0;
  local_50 = (longlong *)0x0;
  do {
    do {
      lVar8 = lVar11;
      if (lVar8 == 0) {
        if (_Dst == plVar10) {
          if (_Dst != (longlong *)0x0) {
            operator_delete(_Dst);
          }
          if (local_68 != (longlong *)0x0) {
            LOCK();
            plVar10 = local_68 + 1;
            lVar5 = *plVar10;
            *(int *)plVar10 = (int)*plVar10 + -1;
            UNLOCK();
            if ((int)lVar5 == 1) {
              (**(code **)(*local_68 + 8))(local_68);
              LOCK();
              piVar7 = (int *)((longlong)local_68 + 0xc);
              *piVar7 = *piVar7 + -1;
              UNLOCK();
              if (*piVar7 == 0) {
                (**(code **)(*local_68 + 0x10))();
              }
            }
          }
          return 0;
        }
        iVar4 = rand();
        *(longlong *)(param_1 + 0x21a0) =
             _Dst[iVar4 % (int)((longlong)plVar10 - (longlong)_Dst >> 3)];
        memmove(_Dst,plVar10,0);
        if (_Dst != (longlong *)0x0) {
          operator_delete(_Dst);
        }
        if (local_68 != (longlong *)0x0) {
          LOCK();
          plVar10 = local_68 + 1;
          lVar5 = *plVar10;
          *(int *)plVar10 = (int)*plVar10 + -1;
          UNLOCK();
          if ((int)lVar5 == 1) {
            (**(code **)(*local_68 + 8))(local_68);
            LOCK();
            piVar7 = (int *)((longlong)local_68 + 0xc);
            *piVar7 = *piVar7 + -1;
            UNLOCK();
            if (*piVar7 == 0) {
              (**(code **)(*local_68 + 0x10))();
            }
          }
        }
        return 1;
      }
      lVar11 = *(longlong *)(lVar8 + 8);
      local_res10 = lVar11;
      iVar3 = FUN_1402f8580(lVar5);
      if ((*(int *)(lVar11 + 4) <= iVar3) &&
         (iVar3 = FUN_1402f8580(param_1), iVar3 <= *(int *)(lVar11 + 8))) {
        iVar3 = *(int *)(*(longlong *)(param_1 + 0x130) + 0x8e4);
        if (*(int **)(lVar11 + 0x10) == *(int **)(lVar11 + 0x18)) {
LAB_140244902:
          if (*(int **)(lVar11 + 0x30) != *(int **)(lVar11 + 0x38)) {
            for (piVar7 = *(int **)(lVar11 + 0x30); piVar7 != *(int **)(lVar11 + 0x38);
                piVar7 = piVar7 + 1) {
              if (*piVar7 == iVar3) goto LAB_140244a7e;
            }
          }
          if (*(longlong *)(lVar11 + 0x50) == *(longlong *)(lVar11 + 0x58)) {
LAB_140244957:
            if (*(longlong *)(lVar11 + 0x70) != *(longlong *)(lVar11 + 0x78)) {
              for (piVar7 = *(int **)(lVar11 + 0x70); piVar7 != *(int **)(lVar11 + 0x78);
                  piVar7 = piVar7 + 1) {
                if (*piVar7 == iVar4) goto LAB_140244a7e;
              }
            }
            iVar3 = *(int *)(*(longlong *)(param_1 + 0x130) + 0x8ec);
            if (*(longlong *)(lVar11 + 0x90) == *(longlong *)(lVar11 + 0x98)) {
LAB_1402449c2:
              if (*(longlong *)(lVar11 + 0xb0) != *(longlong *)(lVar11 + 0xb8)) {
                for (piVar7 = *(int **)(lVar11 + 0xb0); piVar7 != *(int **)(lVar11 + 0xb8);
                    piVar7 = piVar7 + 1) {
                  if (*piVar7 == iVar3) goto LAB_140244a7e;
                }
              }
              cVar1 = FUN_14033b0c0(lVar11);
              if (cVar1 != '\0') {
                if ((&local_res10 < plVar10) && (_Dst <= &local_res10)) {
                  lVar5 = (longlong)&local_res10 - (longlong)_Dst;
                  if (plVar10 == plVar12) {
                    FUN_140195b20(&local_60);
                    plVar10 = local_58;
                    _Dst = local_60;
                    plVar12 = local_50;
                  }
                  if (plVar10 != (longlong *)0x0) {
                    *plVar10 = _Dst[lVar5 >> 3];
                  }
                }
                else {
                  if (plVar10 == plVar12) {
                    FUN_140195b20(&local_60);
                    plVar10 = local_58;
                    _Dst = local_60;
                    plVar12 = local_50;
                  }
                  if (plVar10 != (longlong *)0x0) {
                    *plVar10 = lVar11;
                  }
                }
                plVar10 = plVar10 + 1;
                local_58 = plVar10;
              }
            }
            else {
              for (piVar7 = *(int **)(lVar11 + 0x90); piVar7 != *(int **)(lVar11 + 0x98);
                  piVar7 = piVar7 + 1) {
                if (*piVar7 == iVar3) goto LAB_1402449c2;
              }
            }
          }
          else {
            for (piVar7 = *(int **)(lVar11 + 0x50); piVar7 != *(int **)(lVar11 + 0x58);
                piVar7 = piVar7 + 1) {
              if (*piVar7 == iVar4) goto LAB_140244957;
            }
          }
        }
        else {
          for (piVar7 = *(int **)(lVar11 + 0x10); piVar7 != *(int **)(lVar11 + 0x18);
              piVar7 = piVar7 + 1) {
            if (*piVar7 == iVar3) goto LAB_140244902;
          }
        }
      }
LAB_140244a7e:
      lVar11 = *(longlong *)(lVar8 + 0x18);
      lVar5 = param_1;
    } while (lVar11 != 0);
    uVar2 = *(uint *)(lVar8 + 0x20) % *(uint *)(local_70 + 2) + 1;
    lVar8 = (longlong)(int)uVar2 << 3;
    do {
      if (*(uint *)(local_70 + 2) <= uVar2) break;
      if (*(longlong *)(lVar8 + *local_70) != 0) {
        lVar11 = *(longlong *)(lVar8 + *local_70);
      }
      uVar2 = uVar2 + 1;
      lVar8 = lVar8 + 8;
    } while (lVar11 == 0);
  } while( true );
}



void FUN_140244bc0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  short *psVar8;
  undefined8 *puVar9;
  undefined1 local_20 [8];
  longlong *local_18;
  
  if (*(longlong *)(param_1 + 0x21a0) != 0) {
    *(float *)(param_1 + 0x734) =
         *(float *)(*(longlong *)(param_1 + 0x21a0) + 0xf4) + *(float *)(param_1 + 0x734);
    *(undefined1 *)(param_1 + 0x607) = 1;
    *(float *)(param_1 + 0x744) =
         *(float *)(*(longlong *)(param_1 + 0x21a0) + 0xf8) + *(float *)(param_1 + 0x744);
    *(undefined1 *)(param_1 + 0x607) = 1;
    *(float *)(param_1 + 0x748) =
         *(float *)(*(longlong *)(param_1 + 0x21a0) + 0xfc) + *(float *)(param_1 + 0x748);
    *(undefined1 *)(param_1 + 0x607) = 1;
    *(float *)(param_1 + 0x74c) =
         *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x100) + *(float *)(param_1 + 0x74c);
    *(undefined1 *)(param_1 + 0x607) = 1;
    *(float *)(param_1 + 0x750) =
         *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x104) + *(float *)(param_1 + 0x750);
    *(undefined1 *)(param_1 + 0x607) = 1;
    *(float *)(param_1 + 0x5dc) =
         *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x108) + *(float *)(param_1 + 0x5dc);
    *(undefined1 *)(param_1 + 0x605) = 1;
    *(float *)(param_1 + 0x7fc) =
         *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x10c) + *(float *)(param_1 + 0x7fc);
    *(undefined1 *)(param_1 + 0x607) = 1;
    *(float *)(param_1 + 0x7f8) =
         *(float *)(*(longlong *)(param_1 + 0x21a0) + 0x110) + *(float *)(param_1 + 0x7f8);
    *(undefined1 *)(param_1 + 0x607) = 1;
    *(int *)(param_1 + 0x668) =
         *(int *)(param_1 + 0x668) + *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x118);
    *(undefined1 *)(param_1 + 0x606) = 1;
    *(int *)(param_1 + 0x66c) =
         *(int *)(param_1 + 0x66c) + *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x11c);
    *(undefined1 *)(param_1 + 0x606) = 1;
    *(int *)(param_1 + 0x670) =
         *(int *)(param_1 + 0x670) + *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x120);
    *(undefined1 *)(param_1 + 0x606) = 1;
    *(int *)(param_1 + 0x674) =
         *(int *)(param_1 + 0x674) + *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x124);
    *(undefined1 *)(param_1 + 0x606) = 1;
    *(int *)(param_1 + 0x678) =
         *(int *)(param_1 + 0x678) + *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x128);
    *(undefined1 *)(param_1 + 0x606) = 1;
    *(int *)(param_1 + 0x67c) =
         *(int *)(param_1 + 0x67c) + *(int *)(*(longlong *)(param_1 + 0x21a0) + 300);
    *(undefined1 *)(param_1 + 0x606) = 1;
    *(int *)(param_1 + 0x680) =
         *(int *)(param_1 + 0x680) + *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x130);
    *(undefined1 *)(param_1 + 0x606) = 1;
    *(int *)(param_1 + 0x684) =
         *(int *)(param_1 + 0x684) + *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x134);
    *(undefined1 *)(param_1 + 0x606) = 1;
    iVar4 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x138);
    *(int *)(param_1 + 0x688) = *(int *)(param_1 + 0x688) + iVar4;
    *(int *)(param_1 + 0x6a8) = *(int *)(param_1 + 0x6a8) + iVar4;
    *(undefined1 *)(param_1 + 0x606) = 1;
    iVar4 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x13c);
    *(int *)(param_1 + 0x68c) = *(int *)(param_1 + 0x68c) + iVar4;
    *(int *)(param_1 + 0x6ac) = *(int *)(param_1 + 0x6ac) + iVar4;
    *(undefined1 *)(param_1 + 0x606) = 1;
    iVar4 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x140);
    *(int *)(param_1 + 0x690) = *(int *)(param_1 + 0x690) + iVar4;
    *(int *)(param_1 + 0x6b0) = *(int *)(param_1 + 0x6b0) + iVar4;
    *(undefined1 *)(param_1 + 0x606) = 1;
    iVar4 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x144);
    *(int *)(param_1 + 0x694) = *(int *)(param_1 + 0x694) + iVar4;
    *(int *)(param_1 + 0x6b4) = *(int *)(param_1 + 0x6b4) + iVar4;
    *(undefined1 *)(param_1 + 0x606) = 1;
    iVar4 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x148);
    *(int *)(param_1 + 0x698) = *(int *)(param_1 + 0x698) + iVar4;
    *(int *)(param_1 + 0x6b8) = *(int *)(param_1 + 0x6b8) + iVar4;
    *(undefined1 *)(param_1 + 0x606) = 1;
    iVar4 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x14c);
    *(int *)(param_1 + 0x69c) = *(int *)(param_1 + 0x69c) + iVar4;
    *(int *)(param_1 + 0x6bc) = *(int *)(param_1 + 0x6bc) + iVar4;
    *(undefined1 *)(param_1 + 0x606) = 1;
    lVar5 = *(longlong *)(param_1 + 0x21a0);
    if ((lVar5 == 0) || (*(longlong *)(lVar5 + 0x208) == 0)) {
      psVar8 = (short *)(*(longlong *)(param_1 + 0x130) + 0x458);
    }
    else {
      psVar8 = (short *)(lVar5 + 0x1f8);
    }
    if (7 < *(ulonglong *)(psVar8 + 0xc)) {
      psVar8 = *(short **)psVar8;
    }
    uVar7 = 0xffffffffffffffff;
    do {
      if (uVar7 == 0) break;
      uVar7 = uVar7 - 1;
      sVar3 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar3 != 0);
    if (1 < ~uVar7 - 1) {
      if ((lVar5 == 0) || (*(longlong *)(lVar5 + 0x208) == 0)) {
        puVar9 = (undefined8 *)(*(longlong *)(param_1 + 0x130) + 0x458);
      }
      else {
        puVar9 = (undefined8 *)(lVar5 + 0x1f8);
      }
      if (7 < (ulonglong)puVar9[3]) {
        puVar9 = (undefined8 *)*puVar9;
      }
      uVar6 = FUN_1402ed720(DAT_140608060,local_20,puVar9,0,0);
      FUN_140343ec0(param_1 + 0x11b0,uVar6);
      if (local_18 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_18 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_18 + 8))(local_18);
          LOCK();
          piVar2 = (int *)((longlong)local_18 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_18 + 0x10))(local_18);
          }
        }
      }
    }
    *(float *)(param_1 + 0x598) =
         ((float)(*(int *)(param_1 + 0x8b0) + *(int *)(param_1 + 0x618)) +
         *(float *)(param_1 + 0x59c)) *
         (*(float *)(param_1 + 0x8ec) + *(float *)(param_1 + 0x734) + 1.0 + 0.0001) +
         (float)*(int *)(param_1 + 0x868) + (float)*(int *)(param_1 + 0x88c);
    *(float *)(param_1 + 0x5a0) =
         ((float)(*(int *)(param_1 + 0x8b4) + *(int *)(param_1 + 0x61c)) +
         *(float *)(param_1 + 0x5a4)) *
         (*(float *)(param_1 + 0x8f0) + *(float *)(param_1 + 0x738) + 1.0 + 0.0001) +
         (float)*(int *)(param_1 + 0x86c) + (float)*(int *)(param_1 + 0x890);
    *(undefined2 *)(param_1 + 0x606) = 0;
  }
  return;
}



void FUN_140245060(longlong param_1,undefined8 param_2,short *param_3)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  *(undefined4 *)(param_1 + 0x2170) = 1;
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_3;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2178,param_3,~uVar2 - 1);
  return;
}



ulonglong FUN_1402450a0(longlong param_1,int param_2)

{
  int iVar1;
  ulonglong uVar2;
  
  uVar2 = *(ulonglong *)(param_1 + 0x21a0);
  if (uVar2 == 0) {
    uVar2 = *(ulonglong *)(param_1 + 0x130);
    iVar1 = *(int *)(uVar2 + 0x858);
  }
  else {
    iVar1 = *(int *)(uVar2 + 0x180);
  }
  if ((iVar1 != param_2) && (-1 < param_2)) {
    return uVar2 & 0xffffffffffffff00;
  }
  return CONCAT71((int7)(uVar2 >> 8),1);
}



uint FUN_1402450e0(longlong param_1)

{
  int iVar1;
  
  if ((*(longlong *)(param_1 + 0x21a0) != 0) &&
     (iVar1 = *(int *)(*(longlong *)(param_1 + 0x21a0) + 0x184), iVar1 != 100)) {
    return CONCAT31((int3)((uint)iVar1 >> 8),iVar1 == 1);
  }
  return (uint)*(byte *)(*(longlong *)(param_1 + 0x130) + 0x140);
}



ulonglong FUN_140245110(longlong *param_1,float param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  undefined4 uVar4;
  uint uVar5;
  ulonglong uVar6;
  undefined4 extraout_var;
  undefined8 *puVar7;
  float fVar8;
  double dVar9;
  
  *(int *)(param_1 + 0x421) = (int)param_1[0x421] + 1;
  *(int *)(param_1 + 0x422) = (int)param_1[0x422] + 1;
  fVar8 = *(float *)(param_1 + 0x426) - param_2;
  param_1[0x420] = param_1[0xa2];
  *(float *)(param_1 + 0x426) = param_2;
  *(int *)((longlong)param_1 + 0x210c) = *(int *)((longlong)param_1 + 0x210c) + (int)fVar8;
  uVar6 = FUN_140244170(fVar8,fVar8);
  if ((char)uVar6 == '\x01') {
    return uVar6;
  }
  param_1[0x166] = (longlong)((double)param_1[0x166] - 0.20000000298023224);
  if ((longlong *)param_1[0x44d] != (longlong *)0x0) {
    iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0xa8))();
    if ((iVar3 == 0) || (iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0x80))(), iVar3 == 0)) {
      iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0xa8))();
      if ((iVar3 != 0) &&
         ((iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0x88))(), iVar3 != 0 &&
          (iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0x88))(),
          iVar3 <= *(int *)((longlong)param_1 + 0x210c))))) {
        plVar1 = (longlong *)param_1[0x44d];
        dVar9 = (double)FUN_140414fe0();
        fVar8 = (float)(**(code **)(*plVar1 + 0x90))(plVar1);
        if (dVar9 <= (double)fVar8) {
          lVar2 = *param_1;
          uVar4 = (**(code **)(*(longlong *)param_1[0x44d] + 0xa8))();
          uVar6 = (**(code **)(lVar2 + 0x908))(param_1,uVar4);
          *(undefined4 *)((longlong)param_1 + 0x210c) = 0;
          return uVar6 & 0xffffffffffffff00;
        }
      }
    }
    else {
      iVar3 = (**(code **)(*(longlong *)param_1[0x44d] + 0x80))();
      if (iVar3 <= (int)param_1[0x421]) {
        plVar1 = (longlong *)param_1[0x44d];
        dVar9 = (double)FUN_140414fe0();
        fVar8 = (float)(**(code **)(*plVar1 + 0x90))(plVar1);
        if (dVar9 <= (double)fVar8) {
          lVar2 = *param_1;
          uVar4 = (**(code **)(*(longlong *)param_1[0x44d] + 0xa8))();
          uVar6 = (**(code **)(lVar2 + 0x908))(param_1,uVar4);
          *(undefined4 *)(param_1 + 0x421) = 0;
          return uVar6 & 0xffffffffffffff00;
        }
      }
    }
    if ((*(int *)(param_1[0x44d] + 0x110) != 0) &&
       (*(int *)(param_1[0x44d] + 0x10c) <= (int)param_1[0x422])) {
      iVar3 = rand();
      uVar6 = CONCAT44(extraout_var,iVar3);
      if ((float)iVar3 * 3.0517578e-05 < *(float *)(param_1[0x44d] + 0x108)) {
        uVar6 = (**(code **)(*param_1 + 0x908))(param_1,*(undefined4 *)(param_1[0x44d] + 0x110));
      }
      *(undefined4 *)(param_1 + 0x422) = 0;
      return uVar6 & 0xffffffffffffff00;
    }
    uVar5 = *(uint *)((longlong)param_1 + 300);
    uVar6 = (ulonglong)uVar5;
    if ((((uVar5 == 0x36) || (uVar5 == 0x39)) || (uVar5 == 0x3b)) &&
       (lVar2 = param_1[0x437], lVar2 != 0)) {
      *(int *)((longlong)param_1 + 0x21c4) = *(int *)((longlong)param_1 + 0x21c4) + 1;
      uVar6 = (ulonglong)*(uint *)((longlong)param_1 + 0x21c4);
      if (*(int *)(lVar2 + 8) < (int)*(uint *)((longlong)param_1 + 0x21c4)) {
        if (*(int *)(lVar2 + 4) == 0) {
          (**(code **)(*param_1 + 0xb48))(param_1,*(undefined4 *)(lVar2 + 0x18));
          puVar7 = (undefined8 *)(param_1[0x437] + 0x118);
          if (7 < *(ulonglong *)(param_1[0x437] + 0x130)) {
            puVar7 = (undefined8 *)*puVar7;
          }
          (**(code **)(*param_1 + 0x8f8))(param_1,puVar7,(int)param_1[0x381],0x3f800000,1,0,0);
          param_1[0x437] = 0;
          FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
          *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
          param_1[0x2fb] = 0;
          *(undefined1 *)(param_1 + 0x38a) = 0;
LAB_140245471:
          uVar6 = (**(code **)(*param_1 + 0xd0))(param_1,0,0);
          return uVar6 & 0xffffffffffffff00;
        }
        uVar5 = *(int *)(lVar2 + 4) - 1;
        uVar6 = (ulonglong)uVar5;
        if (uVar5 < 2) {
          *(undefined4 *)((longlong)param_1 + 300) = 0x36;
          *(undefined1 *)(param_1 + 0x27f) = 1;
          *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)((longlong)param_1 + 0x2054);
          *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)((longlong)param_1 + 0x205c);
          *(undefined4 *)(param_1 + 0x438) = 0;
          (**(code **)(*param_1 + 0xb48))(param_1,*(undefined4 *)(lVar2 + 0x18));
          puVar7 = (undefined8 *)(param_1[0x437] + 0x118);
          if (7 < *(ulonglong *)(param_1[0x437] + 0x130)) {
            puVar7 = (undefined8 *)*puVar7;
          }
          (**(code **)(*param_1 + 0x8f8))(param_1,puVar7,(int)param_1[0x381],0x3f800000,1,0,0);
          uVar6 = FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
          *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
          param_1[0x2fb] = 0;
          *(undefined1 *)(param_1 + 0x38a) = 0;
          if (*(int *)((longlong)param_1 + 300) != 0x36) goto LAB_14024552e;
          param_1[0x437] = 0;
          goto LAB_140245471;
        }
      }
    }
    *(undefined4 *)((longlong)param_1 + 0x21c4) = 0;
  }
LAB_14024552e:
  return uVar6 & 0xffffffffffffff00;
}



undefined8 FUN_140245540(longlong *param_1,int param_2)

{
  short sVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  char cVar4;
  int iVar5;
  int *piVar6;
  ulonglong uVar7;
  longlong *plVar8;
  short *psVar9;
  
  if (param_2 != 0) {
    *(int *)(param_1 + 0x43c) = param_2;
  }
  if (param_1[0x43d] != 0) {
    iVar5 = (int)param_1[0x43c];
    if ((iVar5 != 0) && (iVar5 != *(int *)((longlong)param_1 + 0x21e4))) {
      *(int *)((longlong)param_1 + 0x21e4) = iVar5;
      piVar6 = (int *)FUN_140245e60();
      if (piVar6 == (int *)0x0) {
        return 0;
      }
      *piVar6 = *piVar6 + 1;
      puVar3 = *(undefined4 **)(piVar6 + 2);
      if (((int)puVar3[2] <= *piVar6) || (param_2 != 0)) {
        plVar8 = (longlong *)(puVar3 + 0x1a);
        if (7 < *(ulonglong *)(puVar3 + 0x20)) {
          plVar8 = (longlong *)*plVar8;
        }
        uVar7 = 0xffffffffffffffff;
        psVar9 = (short *)plVar8;
        do {
          if (uVar7 == 0) break;
          uVar7 = uVar7 - 1;
          sVar1 = *psVar9;
          psVar9 = psVar9 + 1;
        } while (sVar1 != 0);
        FUN_140001710(param_1 + 0x2df,plVar8,~uVar7 - 1);
        cVar4 = (**(code **)(*param_1 + 200))(param_1,0x60);
        if (cVar4 == '\x01') {
          *piVar6 = 0;
          uVar2 = *puVar3;
          *(undefined4 *)((longlong)param_1 + 0x21dc) = 0;
          *(undefined4 *)(param_1 + 0x43c) = uVar2;
          iVar5 = FUN_14015b2f0((int)((float)puVar3[0xb] * 1000.0),
                                (int)((float)puVar3[0xc] * 1000.0));
          param_1[0x444] = (longlong)((double)iVar5 * 0.001);
          FUN_140245d90(param_1);
        }
      }
      else {
        *(undefined4 *)((longlong)param_1 + 0x21e4) = 0;
      }
      return 1;
    }
  }
  return 0;
}



undefined8 FUN_140245690(longlong param_1,char param_2)

{
  double dVar1;
  int iVar2;
  uint uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  uint *puVar7;
  longlong *local_30;
  longlong *local_28;
  undefined8 local_20;
  
  iVar2 = *(int *)(param_1 + 300);
  if (((iVar2 < 0) || ((1 < iVar2 && (iVar2 != 0x25)))) &&
     (dVar1 = *(double *)(param_1 + 0x510), 5.0 <= dVar1 - *(double *)(param_1 + 0x2278))) {
    *(double *)(param_1 + 0x2278) = dVar1;
    if (param_2 == '\0') {
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30);
      uVar3 = *(uint *)(param_1 + 0x520);
      lVar5 = *(longlong *)(lVar4 + 0x3a0);
      if (lVar5 != 0) {
        for (puVar7 = *(uint **)(lVar5 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar4 + 0x3b0)) *
                                         8); puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 2))
        {
          if ((puVar7[4] == uVar3) && (*puVar7 == uVar3)) {
            if (puVar7 != (uint *)0x0) {
              return 1;
            }
            break;
          }
        }
      }
    }
    local_30 = (longlong *)0x0;
    local_28 = (longlong *)0x0;
    local_20 = 0;
    FUN_140190080(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),&local_30,dVar1,0,
                  0xfffffffffffffffe);
    plVar6 = local_30;
    if ((local_30 != local_28) && (lVar4 = *local_30, lVar4 != 0)) {
      *(undefined4 *)(param_1 + 0x520) = *(undefined4 *)(lVar4 + 0x520);
      *(undefined4 *)(param_1 + 0x178) = *(undefined4 *)(lVar4 + 0x178);
      *(undefined4 *)(param_1 + 0x17c) = *(undefined4 *)(lVar4 + 0x17c);
      *(undefined4 *)(param_1 + 0x180) = *(undefined4 *)(lVar4 + 0x180);
      FUN_140255950(param_1);
    }
    if (plVar6 != (longlong *)0x0) {
      operator_delete(plVar6);
    }
  }
  return 1;
}



void FUN_1402457e0(longlong param_1)

{
  FUN_140337e70(DAT_1406081f8,*(undefined4 *)(param_1 + 0x21d4));
  return;
}



undefined8 FUN_140245800(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  
  uVar1 = *(uint *)(param_1 + 0x21d8);
  lVar2 = *(longlong *)(*(longlong *)(DAT_1406081f8 + 0x2f0) + 0x30);
  if (lVar2 != 0) {
    for (puVar3 = *(uint **)(lVar2 + ((ulonglong)uVar1 %
                                     (ulonglong)
                                     *(uint *)(*(longlong *)(DAT_1406081f8 + 0x2f0) + 0x40)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 6)) {
      if ((puVar3[8] == uVar1) && (*puVar3 == uVar1)) {
        if (puVar3 == (uint *)0x0) {
          return 0;
        }
        return *(undefined8 *)(puVar3 + 2);
      }
    }
  }
  return 0;
}



void FUN_140245860(longlong *param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    lVar1 = param_1[0x437];
    if (lVar1 == 0) {
                    // WARNING: Could not recover jumptable at 0x00014024589a. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return;
    }
    if (*(int *)(lVar1 + 4) == 0) {
      (**(code **)(*param_1 + 0xb48))(param_1,*(undefined4 *)(lVar1 + 0x18));
      *(undefined4 *)((longlong)param_1 + 300) = 2;
      puVar2 = (undefined8 *)(param_1[0x437] + 200);
      if (7 < *(ulonglong *)(param_1[0x437] + 0xe0)) {
        puVar2 = (undefined8 *)*puVar2;
      }
      (**(code **)(*param_1 + 0x8f8))(param_1,puVar2,(int)param_1[0x381],0x3f800000,1,0,0);
      param_1[0x437] = 0;
      FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
      *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
      param_1[0x2fb] = 0;
      *(undefined1 *)(param_1 + 0x38a) = 0;
    }
    else if (*(int *)(lVar1 + 4) - 1U < 2) {
      *(int *)(param_1 + 0x438) = (int)param_1[0x438] + 1;
      *(undefined4 *)((longlong)param_1 + 300) = 0x36;
      *(undefined4 *)(param_1 + 0x40a) = *(undefined4 *)((longlong)param_1 + 0x2054);
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(undefined4 *)(param_1 + 0x40b) = *(undefined4 *)((longlong)param_1 + 0x205c);
      if ((int)param_1[0x438] < *(int *)(lVar1 + 0x10)) {
        puVar2 = (undefined8 *)(lVar1 + 0xa0);
      }
      else {
        *(undefined4 *)((longlong)param_1 + 300) = 2;
        (**(code **)(*param_1 + 0xb48))(param_1,*(undefined4 *)(lVar1 + 0x18));
        puVar2 = (undefined8 *)(param_1[0x437] + 200);
      }
      if (7 < (ulonglong)puVar2[3]) {
        puVar2 = (undefined8 *)*puVar2;
      }
      (**(code **)(*param_1 + 0x8f8))(param_1,puVar2,(int)param_1[0x381],0x3f800000,1,0,0);
      FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
      *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
      param_1[0x2fb] = 0;
      *(undefined1 *)(param_1 + 0x38a) = 0;
      if (*(int *)((longlong)param_1 + 300) == 0x36) {
        param_1[0x437] = 0;
                    // WARNING: Could not recover jumptable at 0x0001402459af. Too many branches
                    // WARNING: Treating indirect jump as call
        (**(code **)(*param_1 + 0xd0))(param_1,0,0);
        return;
      }
    }
  }
  return;
}



undefined8 FUN_140245a50(longlong *param_1)

{
  int iVar1;
  char cVar2;
  
  if ((int)param_1[0x42e] == 0) {
    return 0;
  }
  iVar1 = *(int *)((longlong)param_1 + 0x2174);
  if (iVar1 != 2) {
    if (iVar1 == 10) {
      FUN_1400015e0(param_1 + 0x299,param_1 + 0x42f,0,0xffffffffffffffff);
      cVar2 = (**(code **)(*param_1 + 200))(param_1,*(undefined4 *)((longlong)param_1 + 0x2174),0);
      if (cVar2 != '\x01') {
        return 1;
      }
    }
    else {
      cVar2 = (**(code **)(*param_1 + 200))(param_1,iVar1,0);
      if (cVar2 != '\x01') {
        return 0;
      }
    }
    (**(code **)(*param_1 + 0xb08))
              (param_1,*(undefined4 *)((longlong)param_1 + 0x2174),param_1[0xa2]);
    *(undefined4 *)(param_1 + 0x42e) = 0;
    *(undefined4 *)((longlong)param_1 + 0x2174) = 2;
    return 1;
  }
  *(undefined4 *)(param_1 + 0x42e) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2174) = 2;
  return 1;
}



undefined8 FUN_140245b20(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x2268);
}



void FUN_140245b30(longlong *param_1,undefined8 param_2)

{
  char cVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  undefined1 local_res8 [8];
  
  if (param_1[0x2c3] != 0) {
    lVar2 = (**(code **)(*param_1 + 0x430))
                      (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    cVar1 = (**(code **)(*param_1 + 0xb60))(param_1);
    if ((cVar1 != '\0') && (lVar2 != 0)) {
      FUN_140237940(param_1,*(undefined4 *)((longlong)param_1 + 0x1ec4),lVar2,0);
    }
    *(undefined4 *)((longlong)param_1 + 300) = 2;
    if ((char)param_1[0x34a] != '\0') {
      FUN_14022ecd0(param_1,(longlong)param_1 + 0x1a54);
    }
    *(undefined1 *)(param_1 + 0x34a) = 0;
    *(bool *)(param_1 + 0x3d8) = param_1[0xaf] == param_1[0xb0];
    if ((ulonglong)param_1[0x2c4] < 8) {
      plVar3 = param_1 + 0x2c1;
    }
    else {
      plVar3 = (longlong *)param_1[0x2c1];
    }
    cVar1 = (**(code **)(*param_1 + 0x8f8))
                      (param_1,plVar3,*(undefined4 *)((longlong)param_1 + 0x1814),0x3f800000,1,
                       param_1[0x2fb],0);
    if (cVar1 == '\0') {
      FUN_14021eb20(param_1,0,0);
    }
    FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
    *(undefined4 *)((longlong)param_1 + 0x1814) = 0;
    param_1[0x2fb] = 0;
    return;
  }
  cVar1 = (**(code **)(*param_1 + 0x438))();
  if (cVar1 == '\0') {
    *(undefined1 *)(param_1 + 0x19a) = 0;
  }
  *(undefined1 *)((longlong)param_1 + 0xcd1) = 0;
  *(bool *)(param_1 + 0x3d8) = param_1[0xaf] == param_1[0xb0];
  if (param_1[0xaf] != param_1[0xb0]) {
    plVar3 = (longlong *)param_1[0xaf];
    plVar4 = plVar3;
    if (7 < (ulonglong)plVar3[3]) {
      plVar4 = (longlong *)*plVar3;
    }
    cVar1 = (**(code **)(*param_1 + 0x8f8))(param_1,plVar4,(int)plVar3[5],0x3f800000,1,0,0);
    if (cVar1 == '\0') {
      FUN_14021eb20(param_1,0,0);
    }
    FUN_14023aaa0(param_1 + 0xaf,local_res8,param_1[0xaf]);
    *(bool *)(param_1 + 0x3d8) = param_1[0xaf] == param_1[0xb0];
    return;
  }
  *(undefined4 *)((longlong)param_1 + 0x1ec4) = 0;
  FUN_1402fc3f0(param_1,param_2);
  (**(code **)(*param_1 + 0x9c0))(param_1,param_2);
                    // WARNING: Could not recover jumptable at 0x000140245bc8. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  return;
}



void FUN_140245d80(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x21d4) = param_2;
  FUN_1402353b0();
  return;
}



void FUN_140245d90(longlong param_1)

{
  int *piVar1;
  int iVar2;
  longlong lVar3;
  
  lVar3 = *(longlong *)(param_1 + 0x21f8);
  if (lVar3 != *(longlong *)(param_1 + 0x2200)) {
    while (piVar1 = *(int **)(lVar3 + 8), *piVar1 != *(int *)(param_1 + 0x21e0)) {
      lVar3 = lVar3 + 0x10;
      if (lVar3 == *(longlong *)(param_1 + 0x2200)) {
        return;
      }
    }
    if ((*(int *)(lVar3 + 4) < piVar1[8]) &&
       (iVar2 = rand(), (float)iVar2 * 3.0517578e-05 <= (float)piVar1[0xf])) {
      if (piVar1[4] == 1) {
        (**(code **)(**(longlong **)(param_1 + 0x1e80) + 0x60))
                  (*(longlong **)(param_1 + 0x1e80),piVar1[5],piVar1[6],piVar1[7],param_1 + 0x178);
      }
      *(int *)(lVar3 + 4) = *(int *)(lVar3 + 4) + 1;
    }
  }
  return;
}



longlong FUN_140245e60(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x21f8);
  if (lVar1 != *(longlong *)(param_1 + 0x2200)) {
    do {
      if (**(int **)(lVar1 + 8) == *(int *)(param_1 + 0x21e0)) {
        return lVar1;
      }
      lVar1 = lVar1 + 0x10;
    } while (lVar1 != *(longlong *)(param_1 + 0x2200));
  }
  return 0;
}



ulonglong FUN_140245ea0(longlong *param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  ulonglong extraout_RAX;
  void *local_38 [3];
  ulonglong local_20;
  
  uVar2 = FUN_14023c340(param_1[0x26],local_38);
  lVar1 = *(longlong *)(uVar2 + 0x10);
  if (7 < local_20) {
    operator_delete(local_38[0]);
    uVar2 = extraout_RAX;
  }
  if (lVar1 == 0) {
    uVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
    if ((int)uVar2 == 4) {
      uVar2 = *(ulonglong *)(param_1[0x16f] + 0x1a8);
      if (((*(char *)(uVar2 + 0x20) != '\0') ||
          (uVar2 = *(ulonglong *)(param_1[0x16f] + 0x1a0), *(char *)(uVar2 + 0x20) != '\0')) ||
         (*(int *)((longlong)param_1 + 0x1e44) == 1)) {
        return CONCAT71((int7)(uVar2 >> 8),1);
      }
    }
  }
  return uVar2 & 0xffffffffffffff00;
}



void FUN_140245f40(longlong *param_1)

{
  undefined4 uVar1;
  undefined8 *puVar2;
  void *pvVar3;
  char cVar4;
  int iVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined8 uVar8;
  longlong *plVar9;
  bool bVar10;
  undefined1 local_res8 [8];
  longlong *local_20;
  longlong *local_18;
  
  lVar6 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar6 == 0) {
    return;
  }
  plVar7 = (longlong *)
           (**(code **)(*param_1 + 0x430))
                     (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  cVar4 = (**(code **)(*plVar7 + 0xad0))(plVar7);
  if (cVar4 == '\x01') {
    return;
  }
  uVar1 = *(undefined4 *)((longlong)param_1 + 300);
  plVar9 = param_1 + 0x299;
  if (7 < (ulonglong)param_1[0x29c]) {
    plVar9 = (longlong *)*plVar9;
  }
  puVar2 = (undefined8 *)param_1[0x391];
  if (puVar2 != (undefined8 *)0x0) {
    if (puVar2 == (undefined8 *)param_1[0x392]) {
      uVar8 = *puVar2;
      goto LAB_140245fff;
    }
    iVar5 = DAT_140608150 + 1;
    bVar10 = DAT_140608150 == 0;
    DAT_140608150 = iVar5;
    if (bVar10) {
      FUN_140176d60(1);
    }
  }
  uVar8 = 0;
LAB_140245fff:
  FUN_140278700(uVar8,&local_20,plVar9,(int)param_1[0x381],uVar1,0,0);
  plVar9 = local_20;
  if (local_20 != (longlong *)0x0) {
    if (local_20 == local_18) {
      if ((*local_20 != 0) &&
         (FUN_14021afe0(param_1,*local_20,local_res8), plVar9 = local_20,
         *(char *)((longlong)plVar7 + 0x1869) != '\x04')) {
        (**(code **)(*plVar7 + 0x290))(plVar7);
        plVar9 = local_20;
      }
    }
    else {
      iVar5 = DAT_140608154 + 1;
      bVar10 = DAT_140608154 == 0;
      DAT_140608154 = iVar5;
      if (bVar10) {
        FUN_140176d60(1);
        plVar9 = local_20;
      }
    }
  }
  if (plVar9 != (longlong *)0x0) {
    if (plVar9 == local_18) {
      if (plVar9 != (longlong *)0x0) {
        LOCK();
        plVar7 = plVar9 + 1;
        *(int *)plVar7 = (int)*plVar7 + -1;
        UNLOCK();
        if ((int)*plVar7 == 0) {
          local_20 = (longlong *)0x0;
          pvVar3 = (void *)*plVar9;
          if (pvVar3 != (void *)0x0) {
            FUN_140197310(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(plVar9);
        }
      }
    }
    else {
      iVar5 = DAT_1406080b4 + 1;
      bVar10 = DAT_1406080b4 == 0;
      DAT_1406080b4 = iVar5;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



float FUN_140246110(longlong param_1)

{
  float fVar1;
  
  if (*(longlong *)(param_1 + 0x1e80) == 0) {
    return 0.0;
  }
  if (*(char *)(param_1 + 0x2298) == '\0') {
    fVar1 = (float)(**(code **)(**(longlong **)(param_1 + 0x1e80) + 0x1f0))();
    return fVar1 + *(float *)(param_1 + 0x229c);
  }
  fVar1 = (float)(**(code **)(**(longlong **)(param_1 + 0x1e80) + 0x210))();
  return fVar1 + *(float *)(param_1 + 0x229c);
}



undefined4 FUN_140246170(longlong param_1)

{
  if (*(char *)(param_1 + 0x2298) == '\0') {
    return *(undefined4 *)(param_1 + 0x20c8);
  }
  return *(undefined4 *)(param_1 + 0x20cc);
}



void FUN_140246190(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14023ba50(*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;
}



void FUN_1402462a0(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_140246190(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140246190(param_1,uVar2);
  }
  return;
}



void FUN_140246330(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_1402463b0(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



undefined8 * FUN_1402463b0(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;
}



undefined8 * FUN_140246420(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_140246470(longlong param_1)

{
  if (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  return;
}



undefined1 FUN_140246490(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x2115);
}



undefined1 FUN_1402464a0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x2114);
}



undefined8 FUN_1402464b0(void)

{
  return 0x451c4000;
}



undefined8 FUN_1402464c0(void)

{
  return 0x44fa0000;
}



undefined8 FUN_1402464d0(longlong param_1)

{
  undefined8 uVar1;
  
  if ((longlong *)**(longlong **)(param_1 + 0x20d0) != (longlong *)0x0) {
                    // WARNING: Could not recover jumptable at 0x0001402464e2. Too many branches
                    // WARNING: Treating indirect jump as call
    uVar1 = (**(code **)(*(longlong *)**(longlong **)(param_1 + 0x20d0) + 8))();
    return uVar1;
  }
  return 6;
}



void FUN_1402464f0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x2170) = 0;
  *(undefined4 *)(param_1 + 0x2174) = 2;
  return;
}



undefined4 FUN_140246510(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x2174);
}



bool FUN_140246520(longlong param_1)

{
  return *(int *)(param_1 + 0x2170) != 0;
}



undefined4 FUN_140246530(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x22a0);
}



undefined4 FUN_140246540(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x20fc);
}



undefined4 FUN_140246550(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x20f8);
}



undefined4 FUN_140246560(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x20f4);
}



void FUN_140246570(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x20fc) = param_2;
  return;
}



void FUN_140246580(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x20f8) = param_2;
  return;
}



void FUN_140246590(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x20f4) = param_2;
  return;
}



void FUN_1402465a0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x20f0) = param_2;
  return;
}



void FUN_1402465b0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x20ec) = param_2;
  return;
}



void FUN_1402465c0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x20e8) = param_2;
  return;
}



undefined4 FUN_1402465d0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x20e8);
}



undefined4 FUN_1402465e0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x20f0);
}



undefined4 FUN_1402465f0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x20ec);
}



void thunk_FUN_1402475c0(void)

{
  FUN_1402475c0();
  return;
}



// WARNING: Removing unreachable block (ram,0x000140246720)

undefined4
FUN_140246610(longlong param_1,uint param_2,undefined4 *param_3,undefined8 param_4,
             undefined4 param_5,longlong *param_6)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  uint uVar4;
  longlong lVar5;
  undefined4 uVar6;
  longlong *plVar7;
  longlong *plVar8;
  undefined8 uVar9;
  void *pvVar10;
  longlong lVar11;
  uint *puVar12;
  ulonglong uVar13;
  char *pcVar14;
  uint uVar15;
  char *pcVar16;
  uint *puVar17;
  longlong *local_128;
  longlong *local_120;
  undefined4 local_118;
  undefined4 local_114;
  longlong *local_110;
  longlong *local_108;
  float local_f8;
  float local_f4;
  float local_f0;
  undefined4 local_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  undefined4 local_dc;
  float local_d8;
  float local_d4;
  float local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  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;
  
  local_68 = 0xfffffffffffffffe;
  if ((*(longlong *)(param_1 + 0x280) != 0) && (*(longlong *)(param_1 + 0x2d0) != 0)) {
    plVar7 = (longlong *)FUN_14032f6c0();
    if (*plVar7 != 0) {
      for (puVar12 = *(uint **)(*plVar7 +
                               ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar7 + 2)) * 8);
          puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0x3a)) {
        if ((puVar12[0x3c] == param_2) && (*puVar12 == param_2)) {
          if (puVar12 == (uint *)0x0) {
            return 0;
          }
          plVar7 = (longlong *)0x0;
          uVar15 = 0;
          if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          puVar17 = puVar12 + 8;
          if (7 < *(ulonglong *)(puVar12 + 0xe)) {
            puVar17 = *(uint **)puVar17;
          }
          if (puVar17 == (uint *)0x0) {
            return 0;
          }
          plVar8 = (longlong *)FUN_14032f6c0();
          if (*plVar8 == 0) goto LAB_140246734;
          puVar12 = *(uint **)(*plVar8 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar8 + 2)) * 8
                              );
          goto LAB_1402466f8;
        }
      }
    }
  }
  return 0;
LAB_1402466f8:
  if (puVar12 == (uint *)0x0) goto LAB_140246734;
  if ((puVar12[0x3c] == param_2) && (*puVar12 == param_2)) {
    if (puVar12 != (uint *)0x0) {
      uVar15 = puVar12[5];
    }
    goto LAB_140246734;
  }
  puVar12 = *(uint **)(puVar12 + 0x3a);
  goto LAB_1402466f8;
LAB_140246734:
  uVar9 = FUN_14032f6c0();
  uVar6 = FUN_14032f680(uVar9,(ulonglong)param_2);
  pvVar10 = operator_new(0x228);
  if (pvVar10 != (void *)0x0) {
    plVar7 = (longlong *)FUN_1402ccbb0(pvVar10);
  }
  local_128 = plVar7;
  FUN_140247b40(&local_120,plVar7);
  FUN_140178e90(&local_128,plVar7,plVar7);
  plVar7 = local_128;
  uVar13 = 0xffffffffffffffff;
  puVar12 = puVar17;
  do {
    if (uVar13 == 0) break;
    uVar13 = uVar13 - 1;
    uVar4 = *puVar12;
    puVar12 = (uint *)((longlong)puVar12 + 2);
  } while ((short)uVar4 != 0);
  FUN_140001710(local_128 + 0x1e,puVar17,~uVar13 - 1);
  FUN_140001710(plVar7 + 0x23,&DAT_140477960,0);
  FUN_140003e50(plVar7 + 0x36,&DAT_14047e238,0);
  *(undefined4 *)(local_128 + 0xd) = *param_3;
  *(undefined4 *)((longlong)local_128 + 0x6c) = param_3[1];
  *(undefined4 *)(local_128 + 0xe) = param_3[2];
  local_118 = 0x3f800000;
  local_114 = 0x3f800000;
  local_110 = (longlong *)CONCAT44(local_110._4_4_,0x3f800000);
  *(undefined4 *)((longlong)local_128 + 0x74) = 0x3f800000;
  *(undefined4 *)(local_128 + 0xf) = 0x3f800000;
  *(undefined4 *)((longlong)local_128 + 0x7c) = 0x3f800000;
  *(undefined4 *)(local_128 + 0x1a) = 0x3f800000;
  *(undefined4 *)((longlong)local_128 + 0xd4) = 0x3f800000;
  *(undefined4 *)(local_128 + 0x1b) = 0x3f800000;
  local_c0 = 0;
  local_c4 = 0;
  local_c8 = 0;
  local_cc = 0;
  local_d4 = 0.0;
  local_d8 = 0.0;
  local_dc = 0;
  local_e0 = 0.0;
  local_e8 = 0.0;
  local_ec = 0;
  local_f0 = 0.0;
  local_f4 = 0.0;
  local_bc = 0x3f800000;
  local_d0 = 1.0;
  local_e4 = 1.0;
  local_f8 = 1.0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,param_4);
  local_d8 = DAT_1406081b0;
  local_d4 = DAT_1406081b4;
  local_d0 = DAT_1406081b8;
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = DAT_1406081b0;
  DAT_1406081a4 = DAT_1406081b4;
  DAT_1406081a8 = DAT_1406081b8;
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081b8 - DAT_1406081b4 * 0.0;
  DAT_140608018._4_4_ = DAT_1406081b0 * 0.0 - DAT_1406081b8 * 0.0;
  DAT_140608020 = DAT_1406081b4 * 0.0 - DAT_1406081b0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  local_f8 = DAT_1406081b0;
  local_f4 = DAT_1406081b4;
  local_f0 = DAT_1406081b8;
  if ((DAT_1406081bc & 1) == 0) {
    DAT_1406081bc = DAT_1406081bc | 1;
  }
  DAT_1406081c0 = DAT_1406081b0;
  DAT_1406081c4 = DAT_1406081b4;
  DAT_1406081c8 = DAT_1406081b8;
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = local_d8;
  DAT_1406081a4 = local_d4;
  DAT_1406081a8 = local_d0;
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081b8 * local_d4 - local_d0 * DAT_1406081b4;
  DAT_140608018._4_4_ = local_d0 * DAT_1406081b0 - DAT_1406081b8 * local_d8;
  DAT_140608020 = DAT_1406081b4 * local_d8 - local_d4 * DAT_1406081b0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  local_e8 = DAT_1406081b0;
  local_e4 = DAT_1406081b4;
  local_e0 = DAT_1406081b8;
  D3DXQuaternionRotationMatrix(local_128 + 0x10,&local_f8);
  *(uint *)((longlong)local_128 + 0x224) = uVar15;
  (**(code **)(*local_128 + 8))();
  if (local_128[0x1c] != 0) {
    *(undefined1 *)(local_128 + 0x2b) = 1;
    *(undefined1 *)(*(longlong *)(local_128[0x1c] + 0x20) + 0x50) = 0;
  }
  FUN_1402cd640(local_128,1);
  lVar11 = *(longlong *)(param_1 + 0x2d0);
  iVar3 = *(int *)(lVar11 + 8);
  *(int *)(lVar11 + 8) = iVar3 + 1;
  *(undefined4 *)(local_128 + 0x28) = *(undefined4 *)(lVar11 + 0x4c4);
  *(int *)(local_128 + 1) = iVar3;
  FUN_1402cd3a0(local_128);
  plVar7 = local_120;
  local_118 = (undefined4)local_128[1];
  local_110 = local_128;
  local_108 = local_120;
  if (local_120 != (longlong *)0x0) {
    LOCK();
    *(int *)(local_120 + 1) = (int)local_120[1] + 1;
    UNLOCK();
  }
  FUN_14030e3c0(lVar11 + 0x648,local_118,&local_110);
  plVar8 = local_108;
  if (plVar7 != (longlong *)0x0) {
    LOCK();
    plVar7 = plVar7 + 1;
    *(int *)plVar7 = (int)*plVar7 + -1;
    UNLOCK();
    if ((int)*plVar7 == 0) {
      (**(code **)(*local_108 + 8))(local_108);
      LOCK();
      piVar1 = (int *)((longlong)plVar8 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_108 + 0x10))();
      }
    }
  }
  plVar7 = local_128 + 3;
  if (7 < (ulonglong)local_128[6]) {
    plVar7 = (longlong *)*plVar7;
  }
  local_a0 = 7;
  lVar11 = 0;
  local_a8 = 0;
  local_b8 = 0;
  uVar13 = 0xffffffffffffffff;
  plVar8 = plVar7;
  do {
    if (uVar13 == 0) break;
    uVar13 = uVar13 - 1;
    lVar5 = *plVar8;
    plVar8 = (longlong *)((longlong)plVar8 + 2);
  } while ((short)lVar5 != 0);
  FUN_140001710(&local_b8,plVar7,~uVar13 - 1);
  FUN_140415220(&local_90,&local_b8);
  if (7 < local_a0) {
    operator_delete((void *)CONCAT62(uStack_b6,local_b8));
  }
  local_a0 = 7;
  local_a8 = 0;
  local_b8 = 0;
  pvVar10 = operator_new(0x160);
  if (pvVar10 != (void *)0x0) {
    lVar11 = FUN_14027d4b0(pvVar10);
  }
  *(undefined8 *)(lVar11 + 0x20) = *(undefined8 *)(param_1 + 0x70);
  pcVar14 = &local_90;
  if (0xf < local_78) {
    pcVar14 = (char *)CONCAT71(uStack_8f,local_90);
  }
  uVar13 = 0xffffffffffffffff;
  pcVar16 = pcVar14;
  do {
    if (uVar13 == 0) break;
    uVar13 = uVar13 - 1;
    cVar2 = *pcVar16;
    pcVar16 = pcVar16 + 1;
  } while (cVar2 != '\0');
  FUN_140003e50(lVar11 + 0x28,pcVar14,~uVar13 - 1);
  *(undefined8 *)(lVar11 + 0x18) = *(undefined8 *)(param_1 + 0x2d0);
  *(undefined4 *)(lVar11 + 0x104) = param_5;
  *(undefined4 *)(lVar11 + 0xf4) = 1;
  *(uint *)(lVar11 + 0xf8) = param_2;
  *(undefined4 *)(lVar11 + 0xfc) = uVar6;
  if (param_6 != (longlong *)0x0) {
    uVar6 = (**(code **)(*param_6 + 0xb0))(param_6);
    *(undefined4 *)(lVar11 + 0x10c) = uVar6;
    *(int *)(lVar11 + 0x108) = (int)param_6[0x25];
  }
  FUN_14027d660(lVar11,local_128);
  FUN_14027c9d0(*(undefined8 *)(param_1 + 0x280),lVar11);
  uVar6 = *(undefined4 *)(lVar11 + 0x78);
  if (0xf < local_78) {
    operator_delete((void *)CONCAT71(uStack_8f,local_90));
  }
  local_78 = 0xf;
  local_80 = 0;
  local_90 = '\0';
  if (local_120 != (longlong *)0x0) {
    LOCK();
    plVar7 = local_120 + 1;
    *(int *)plVar7 = (int)*plVar7 + -1;
    UNLOCK();
    if ((int)*plVar7 == 0) {
      (**(code **)(*local_120 + 8))(local_120);
      LOCK();
      piVar1 = (int *)((longlong)local_120 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_120 + 0x10))(local_120);
      }
    }
  }
  return uVar6;
}



void FUN_140246d80(longlong param_1,char *param_2,undefined4 param_3,undefined8 param_4)

{
  char cVar1;
  longlong lVar2;
  ulonglong uVar3;
  char *pcVar4;
  undefined1 local_30;
  undefined7 uStack_2f;
  undefined8 local_20;
  ulonglong local_18;
  
  local_18 = 0xf;
  local_20 = 0;
  local_30 = 0;
  uVar3 = 0xffffffffffffffff;
  pcVar4 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  FUN_140003e50(&local_30,param_2,~uVar3 - 1,param_4,0xfffffffffffffffe);
  lVar2 = FUN_1402475e0(param_1 + 0xf0,&local_30);
  *(undefined4 *)(lVar2 + 0x28) = param_3;
  if (0xf < local_18) {
    operator_delete((void *)CONCAT71(uStack_2f,local_30));
  }
  return;
}



undefined4 FUN_140246e10(longlong param_1,char *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined4 uVar2;
  longlong lVar3;
  ulonglong uVar4;
  char *pcVar5;
  undefined1 local_30;
  undefined7 uStack_2f;
  undefined8 local_20;
  ulonglong local_18;
  
  if (param_2 == (char *)0x0) {
    uVar2 = 0;
  }
  else {
    local_18 = 0xf;
    local_20 = 0;
    local_30 = 0;
    uVar4 = 0xffffffffffffffff;
    pcVar5 = param_2;
    do {
      if (uVar4 == 0) break;
      uVar4 = uVar4 - 1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar5 + 1;
    } while (cVar1 != '\0');
    FUN_140003e50(&local_30,param_2,~uVar4 - 1,param_4,0xfffffffffffffffe);
    lVar3 = FUN_1402475e0(param_1 + 0xf0,&local_30);
    uVar2 = *(undefined4 *)(lVar3 + 0x28);
    if (0xf < local_18) {
      operator_delete((void *)CONCAT71(uStack_2f,local_30));
    }
  }
  return uVar2;
}



void FUN_140246ea0(longlong param_1,char *param_2,char *param_3,undefined8 param_4)

{
  char cVar1;
  longlong lVar2;
  ulonglong uVar3;
  char *pcVar4;
  undefined8 uVar5;
  undefined1 local_30;
  undefined7 uStack_2f;
  undefined8 local_20;
  ulonglong local_18;
  
  if ((param_2 != (char *)0x0) && (uVar5 = 0xfffffffffffffffe, param_3 != (char *)0x0)) {
    local_18 = 0xf;
    local_20 = 0;
    local_30 = 0;
    uVar3 = 0xffffffffffffffff;
    pcVar4 = param_2;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    FUN_140003e50(&local_30,param_2,~uVar3 - 1,param_4,0xfffffffffffffffe);
    lVar2 = FUN_140247810(param_1 + 0x130,&local_30);
    uVar3 = 0xffffffffffffffff;
    pcVar4 = param_3;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    FUN_140003e50(lVar2 + 0x28,param_3,~uVar3 - 1,param_4,uVar5);
    if (0xf < local_18) {
      operator_delete((void *)CONCAT71(uStack_2f,local_30));
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140247252)
// WARNING: Removing unreachable block (ram,0x00014024725d)
// WARNING: Restarted to delay deadcode elimination for space: stack

void FUN_140246f60(longlong param_1,longlong param_2)

{
  longlong **pplVar1;
  undefined8 *puVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  longlong **pplVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong **pplVar9;
  longlong *plVar10;
  longlong **pplVar11;
  bool bVar12;
  longlong *local_b0;
  longlong *local_a8;
  longlong **local_98;
  longlong **pplStack_90;
  longlong *local_88;
  longlong local_80;
  uint local_78;
  
  if (*(longlong *)(param_1 + 0x2d0) == 0) {
    return;
  }
  FUN_140198570(param_2,&local_b0);
  plVar10 = local_b0;
  if (local_b0 != (longlong *)0x0) {
    if (local_b0 == local_a8) {
      if (*local_b0 != 0) {
        FUN_1402472e0(&local_88);
        pplVar11 = (longlong **)0x0;
        local_98 = pplVar11;
        if ((local_80 != 0) && (pplVar6 = pplVar11, plVar8 = local_88, local_78 != 0)) {
          do {
            if (*plVar8 != 0) {
              local_98 = (longlong **)local_88[(longlong)pplVar6];
              break;
            }
            uVar4 = (int)pplVar6 + 1;
            pplVar6 = (longlong **)(ulonglong)uVar4;
            plVar8 = plVar8 + 1;
          } while (uVar4 < local_78);
        }
        pplStack_90 = &local_88;
        pplVar6 = local_98;
LAB_14024705d:
        pplVar9 = pplVar6;
        iVar3 = -1;
        if (pplVar9 != (longlong **)0x0) {
          if (pplVar9 == (longlong **)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (*(int *)(param_2 + 8) != (int)pplVar9[1][1]) {
            FUN_140198570(pplVar9[1]);
            pplVar1 = pplStack_90;
            pplVar6 = local_98;
            if (local_98 == (longlong **)0x0) {
LAB_1402471ba:
              if (pplVar6 != (longlong **)0x0) {
                if (pplVar6 == pplVar1) {
                  if (pplVar6 != (longlong **)0x0) goto LAB_14024718d;
                }
                else {
                  iVar3 = DAT_140608054 + 1;
                  bVar12 = DAT_140608054 == 0;
                  DAT_140608054 = iVar3;
                  if (bVar12) {
                    FUN_140176d60(1);
                  }
                }
              }
            }
            else {
              if (local_98 != pplStack_90) {
                iVar5 = DAT_14060804c + 1;
                bVar12 = DAT_14060804c == 0;
                DAT_14060804c = iVar5;
                if (bVar12) {
                  FUN_140176d60(1);
                  iVar3 = -1;
                }
                goto LAB_1402471ba;
              }
              plVar8 = *local_98;
              if (plVar8 == (longlong *)0x0) goto LAB_1402471ba;
              if (*(int *)((longlong)plVar8 + 300) == 2) {
                (**(code **)(*plVar8 + 0x600))(plVar8,*plVar10 + 0x178);
                (**(code **)(**pplVar6 + 0xd0))(*pplVar6,0,0);
                plVar8 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x70) + 0x48) + 0x3a0)
                ;
                lVar7 = *plVar10;
                (**(code **)(*plVar8 + 0xb30))
                          (plVar8,*(undefined4 *)(*(longlong *)(param_1 + 0x70) + 8),&DAT_1405d85a0,
                           pplVar9[1] + 1,lVar7 + 0x178,lVar7 + 0x17c,lVar7 + 0x180);
                iVar3 = -1;
              }
LAB_14024718d:
              LOCK();
              pplVar1 = pplVar6 + 1;
              iVar5 = *(int *)pplVar1;
              *(int *)pplVar1 = *(int *)pplVar1 + iVar3;
              UNLOCK();
              plVar10 = local_b0;
              if (iVar5 == 1) {
                local_98 = (longlong **)0x0;
                if (*pplVar6 != (longlong *)0x0) {
                  (**(code **)**pplVar6)();
                }
                operator_delete(pplVar6);
                plVar10 = local_b0;
              }
            }
          }
          pplVar6 = pplVar11;
          if ((pplVar9 != (longlong **)0x0) &&
             (pplVar6 = (longlong **)pplVar9[2], (longlong **)pplVar9[2] == (longlong **)0x0)) {
            uVar4 = *(uint *)(pplVar9 + 3) % local_78 + 1;
            lVar7 = (longlong)(int)uVar4 << 3;
            pplVar6 = pplVar11;
            do {
              if (local_78 <= uVar4) break;
              if (*(longlong *)((longlong)local_88 + lVar7) != 0) {
                pplVar6 = *(longlong ***)((longlong)local_88 + lVar7);
              }
              uVar4 = uVar4 + 1;
              lVar7 = lVar7 + 8;
            } while (pplVar6 == (longlong **)0x0);
          }
          goto LAB_14024705d;
        }
        FUN_1401625e0(&local_88);
        goto LAB_14024729a;
      }
    }
    else {
      iVar3 = DAT_14060804c + 1;
      bVar12 = DAT_14060804c == 0;
      DAT_14060804c = iVar3;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar10 == (longlong *)0x0) {
    return;
  }
  if (plVar10 != local_a8) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14024729a:
  LOCK();
  plVar10 = plVar10 + 1;
  *(int *)plVar10 = (int)*plVar10 + -1;
  UNLOCK();
  if ((int)*plVar10 == 0) {
    puVar2 = (undefined8 *)*local_b0;
    if (puVar2 != (undefined8 *)0x0) {
      (**(code **)*puVar2)(puVar2,1);
    }
    operator_delete(local_b0);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140247360)
// WARNING: Removing unreachable block (ram,0x000140247369)
// WARNING: Removing unreachable block (ram,0x000140247387)
// WARNING: Removing unreachable block (ram,0x000140247390)
// WARNING: Removing unreachable block (ram,0x00014024745e)

undefined8 *
FUN_1402472e0(undefined8 *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  uint uVar1;
  longlong lVar3;
  longlong *plVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar2;
  
  uVar6 = 0;
  *param_1 = 0;
  param_1[1] = 0;
  *(undefined4 *)(param_1 + 2) = 0x11;
  *(undefined4 *)(param_1 + 6) = 0;
  *(undefined4 *)((longlong)param_1 + 0x34) = 10;
  param_1[7] = 0;
  param_1[8] = 0;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0x3f400000;
  *(undefined4 *)(param_1 + 3) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1c) = 0x40100000;
  param_1[4] = 0x26;
  param_1[5] = 0;
  FUN_1401624a0(param_1,0x8000000000000000,param_3,param_4,0xfffffffffffffffe);
  uVar5 = uVar6;
  if ((param_2[1] != 0) && (*(uint *)(param_2 + 2) != 0)) {
    uVar2 = uVar6;
    plVar4 = (longlong *)*param_2;
    do {
      if (*plVar4 != 0) {
        uVar5 = ((longlong *)*param_2)[uVar2];
        break;
      }
      uVar1 = (int)uVar2 + 1;
      uVar2 = (ulonglong)uVar1;
      plVar4 = plVar4 + 1;
    } while (uVar1 < *(uint *)(param_2 + 2));
  }
  do {
    do {
      uVar2 = uVar5;
      if (uVar2 == 0) {
        return param_1;
      }
      FUN_140195e30(param_1,uVar2,uVar2 + 8);
      uVar5 = *(ulonglong *)(uVar2 + 0x10);
    } while (*(ulonglong *)(uVar2 + 0x10) != 0);
    uVar1 = *(uint *)(uVar2 + 0x18) % *(uint *)(param_2 + 2) + 1;
    lVar3 = (longlong)(int)uVar1 << 3;
    uVar5 = uVar6;
    do {
      if (*(uint *)(param_2 + 2) <= uVar1) break;
      if (*(longlong *)(*param_2 + lVar3) != 0) {
        uVar5 = *(ulonglong *)(*param_2 + lVar3);
      }
      uVar1 = uVar1 + 1;
      lVar3 = lVar3 + 8;
    } while (uVar5 == 0);
  } while( true );
}



void FUN_140247480(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar7 = 0;
  if ((*param_1 != 0) && (uVar8 = uVar7, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(uVar8 + *param_1);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 8);
        *(longlong *)(lVar3 + 8) = param_1[8];
        param_1[1] = param_1[1] + -1;
        param_1[8] = lVar3;
        if (((ulonglong)param_1[1] < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          uVar4 = FUN_1402cddb0(param_1);
          FUN_140248140(param_1,uVar4);
        }
        lVar3 = lVar1;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar5 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar5;
              free(plVar5);
              plVar5 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      uVar8 = uVar8 + 8;
    } 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_1402cddb0(param_1,0);
    FUN_1402c6d50(param_1,uVar4,0);
  }
  param_1[8] = 0;
  plVar5 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar5;
      free(plVar5);
      plVar5 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_1402475c0(void)

{
  FUN_140247480();
  return;
}



undefined8 * FUN_1402475e0(longlong *param_1,undefined8 param_2)

{
  undefined8 **ppuVar1;
  char cVar2;
  ulonglong uVar3;
  undefined8 *puVar4;
  longlong lVar5;
  undefined8 *puVar6;
  undefined8 **ppuVar7;
  undefined8 *puVar8;
  undefined8 *local_res8;
  undefined8 uVar9;
  longlong *local_50;
  undefined8 *local_48;
  undefined2 local_40;
  
  uVar9 = 0xfffffffffffffffe;
  local_res8 = (undefined8 *)FUN_1401686e0(param_2);
  ppuVar1 = (undefined8 **)(param_1 + 1);
  puVar8 = (undefined8 *)(*param_1 + ((ulonglong)local_res8 % (ulonglong)*ppuVar1) * 8);
  local_50 = param_1;
  if (*param_1 == 0) {
    local_48 = (undefined8 *)0x0;
    local_40 = 0;
    FUN_1402482f0(&local_50);
    puVar8 = local_48;
    puVar6 = local_48 + 1;
    local_res8 = puVar6;
    if (puVar6 != (undefined8 *)0x0) {
      local_48[4] = 0xf;
      local_48[3] = 0;
      *(undefined1 *)puVar6 = 0;
      FUN_140003d90(puVar6,param_2,0,0xffffffffffffffff,uVar9);
      *(undefined4 *)(puVar8 + 6) = 0;
    }
    local_40 = CONCAT11(1,(undefined1)local_40);
    uVar3 = FUN_1401686e0(puVar6);
    if (*param_1 == 0) {
      local_res8 = (undefined8 *)FUN_1402c9710(param_1);
      ppuVar7 = &local_res8;
      if (local_res8 <= *ppuVar1) {
        ppuVar7 = ppuVar1;
      }
      *ppuVar1 = *ppuVar7;
      FUN_140346140(param_1);
      FUN_140296160(param_1);
    }
    else if ((ulonglong)param_1[7] < 2) {
      local_res8 = (undefined8 *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      puVar4 = (undefined8 *)FUN_1402c9710(param_1);
      if (puVar4 != *ppuVar1) {
        FUN_1402483f0(param_1);
      }
    }
    puVar4 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)*ppuVar1) * 8);
    *puVar8 = *puVar4;
    *puVar4 = puVar8;
    param_1[4] = param_1[4] + 1;
    param_1[6] = (longlong)puVar4;
  }
  else {
    lVar5 = FUN_140247f10(puVar8,param_2);
    if (lVar5 == 0) {
      local_48 = (undefined8 *)0x0;
      local_40 = 0;
      FUN_1402482f0(&local_50);
      puVar4 = local_48;
      puVar6 = local_48 + 1;
      if (puVar6 != (undefined8 *)0x0) {
        local_48[4] = 0xf;
        local_48[3] = 0;
        *(undefined1 *)puVar6 = 0;
        FUN_140003d90(puVar6,param_2,0,0xffffffffffffffff,uVar9);
        *(undefined4 *)(puVar4 + 6) = 0;
      }
      local_40 = CONCAT11(1,(undefined1)local_40);
      cVar2 = FUN_140247cc0(param_1);
      if (cVar2 != '\0') {
        puVar8 = (undefined8 *)(*param_1 + ((ulonglong)local_res8 % (ulonglong)*ppuVar1) * 8);
      }
      *puVar4 = *puVar8;
      *puVar8 = puVar4;
      param_1[4] = param_1[4] + 1;
      puVar4 = (undefined8 *)param_1[6];
      if (puVar8 < (undefined8 *)param_1[6]) {
        puVar4 = puVar8;
      }
      param_1[6] = (longlong)puVar4;
    }
    else {
      puVar6 = (undefined8 *)(lVar5 + 8);
    }
  }
  return puVar6;
}



undefined8 *
FUN_140247810(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong *puVar1;
  char cVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  ulonglong *puVar8;
  ulonglong local_res8;
  undefined8 uVar9;
  longlong *local_30;
  undefined8 *local_28;
  undefined2 local_20;
  
  uVar9 = 0xfffffffffffffffe;
  uVar3 = FUN_1401686e0(param_2);
  puVar1 = (ulonglong *)(param_1 + 1);
  local_28 = (undefined8 *)*param_1;
  puVar6 = local_28 + uVar3 % *puVar1;
  local_30 = param_1;
  if (local_28 == (undefined8 *)0x0) {
    local_20 = 0;
    FUN_140247e40(&local_30);
    puVar6 = local_28;
    uVar3 = FUN_1401686e0(local_28 + 1);
    if (*param_1 == 0) {
      local_res8 = FUN_1402c9710(param_1);
      puVar8 = &local_res8;
      if (local_res8 <= *puVar1) {
        puVar8 = puVar1;
      }
      *puVar1 = *puVar8;
      FUN_140346140(param_1);
      FUN_140296160(param_1);
    }
    else if ((ulonglong)param_1[7] < 2) {
      local_res8 = ((ulonglong)param_1[4] >> 1) + param_1[4];
      uVar4 = FUN_1402c9710(param_1);
      if (uVar4 != *puVar1) {
        FUN_140248780(param_1);
      }
    }
    puVar7 = (undefined8 *)(*param_1 + (uVar3 % *puVar1) * 8);
    *puVar6 = *puVar7;
    *puVar7 = puVar6;
    param_1[4] = param_1[4] + 1;
    param_1[6] = (longlong)puVar7;
    puVar6 = puVar6 + 1;
  }
  else {
    lVar5 = FUN_140247f10(puVar6,param_2,local_28,param_4,uVar9);
    if (lVar5 == 0) {
      local_28 = (undefined8 *)0x0;
      local_20 = 0;
      FUN_140247e40(&local_30,param_2);
      cVar2 = FUN_140247fe0(param_1);
      if (cVar2 != '\0') {
        puVar6 = (undefined8 *)(*param_1 + (uVar3 % *puVar1) * 8);
      }
      *local_28 = *puVar6;
      *puVar6 = local_28;
      param_1[4] = param_1[4] + 1;
      puVar7 = (undefined8 *)param_1[6];
      if (puVar6 < (undefined8 *)param_1[6]) {
        puVar7 = puVar6;
      }
      param_1[6] = (longlong)puVar7;
      puVar6 = local_28 + 1;
    }
    else {
      puVar6 = (undefined8 *)(lVar5 + 8);
    }
  }
  return puVar6;
}



void FUN_1402479d0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140247bb0();
  }
  return;
}



void FUN_1402479f0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140247d30();
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140247a10(void)

{
  longlong lVar1;
  longlong lVar2;
  undefined **ppuVar3;
  
  ppuVar3 = (undefined **)&DAT_14049ab70;
  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 == &MBISingleton<>::vftable_meta_ptr) {
    ppuVar3 = (undefined **)&UNK_14049aca8;
  }
  _DAT_140607ef8 = *ppuVar3;
  _DAT_140607f18 = 0x3f800000;
  DAT_140607ef0 = 0;
  DAT_140607f08 = 0;
  _DAT_140607f10 = 0;
  _DAT_140607f20 = 0;
  _DAT_140607f28 = 0;
  return &DAT_140607ef0;
}



void FUN_140247ab0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 8) = *(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_1402cddb0();
      FUN_140248140(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_14000d450(0x80004005);
}



undefined8 * FUN_140247b40(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;
}



void FUN_140247bb0(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;
}



void FUN_140247c60(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;
}



undefined8 FUN_140247cc0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_1402483f0(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140247d30(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[9]) {
        operator_delete((void *)puVar2[6]);
      }
      puVar2[9] = 0xf;
      puVar2[8] = 0;
      *(undefined1 *)(puVar2 + 6) = 0;
      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;
}



void FUN_140247e00(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_140248720(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



void FUN_140247e40(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined1 *puVar2;
  undefined8 uVar3;
  undefined1 local_40;
  undefined7 uStack_3f;
  undefined8 local_30;
  ulonglong local_28;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_140248670();
  lVar1 = *(longlong *)(param_1 + 8);
  puVar2 = (undefined1 *)(lVar1 + 8);
  if (puVar2 != (undefined1 *)0x0) {
    local_28 = 0xf;
    local_30 = 0;
    local_40 = 0;
    *(undefined8 *)(lVar1 + 0x20) = 0xf;
    *(undefined8 *)(lVar1 + 0x18) = 0;
    *puVar2 = 0;
    FUN_140003d90(puVar2,param_2,0,0xffffffffffffffff,uVar3);
    *(undefined8 *)(lVar1 + 0x48) = 0xf;
    *(undefined8 *)(lVar1 + 0x40) = 0;
    *(undefined1 *)(lVar1 + 0x30) = 0;
    FUN_140129f70((undefined1 *)(lVar1 + 0x30),&local_40);
    if (0xf < local_28) {
      operator_delete((void *)CONCAT71(uStack_3f,local_40));
    }
  }
  *(undefined1 *)(param_1 + 0x11) = 1;
  return;
}



// WARNING: Removing unreachable block (ram,0x000140247f68)

longlong * FUN_140247f10(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_140247f9e;
      }
    }
    else {
LAB_140247f9e:
      if (uVar4 == 0) {
        return param_1;
      }
    }
    param_1 = (longlong *)*param_1;
    if (param_1 == (longlong *)0x0) {
      return (longlong *)0x0;
    }
  } while( true );
}



undefined8 FUN_140247fe0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_140248780(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140248050(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  
  puVar7 = (undefined8 *)*param_1;
  puVar3 = puVar7 + param_1[1];
  for (; puVar7 != puVar3; puVar7 = puVar7 + 1) {
    puVar4 = (undefined8 *)*puVar7;
    *puVar7 = 0;
    while (puVar4 != (undefined8 *)0x0) {
      puVar5 = (undefined8 *)*puVar4;
      plVar6 = (longlong *)puVar4[7];
      if (plVar6 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar6 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*plVar6 + 8))(plVar6);
          LOCK();
          piVar2 = (int *)((longlong)plVar6 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar6 + 0x10))(plVar6);
          }
        }
      }
      if (0xf < (ulonglong)puVar4[4]) {
        operator_delete((void *)puVar4[1]);
      }
      puVar4[4] = 0xf;
      puVar4[3] = 0;
      *(undefined1 *)(puVar4 + 1) = 0;
      operator_delete(puVar4);
      puVar4 = puVar5;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



void FUN_140248140(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 8);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x10) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 8) = *(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_1402482f0(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_1405d3608);
}



void FUN_1402483f0(longlong *param_1,ulonglong param_2)

{
  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;
  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_140346140(&local_40);
  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;
    }
  }
  local_40 = plVar14;
  local_38 = uVar12;
  lVar10 = FUN_1402961d0(param_1);
  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_140248670(longlong param_1)

{
  void *_Dst;
  char *local_res8 [4];
  undefined **local_78 [3];
  undefined8 local_60 [11];
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_140248720(*(longlong *)(param_1 + 8) + 8);
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  _Dst = operator_new(0x58);
  if (_Dst != (void *)0x0) {
    *(void **)(param_1 + 8) = _Dst;
    local_60[0] = 0;
    memcpy(_Dst,local_60,0x58);
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_78,local_res8);
  local_78[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d3608);
}



void FUN_140248720(undefined8 *param_1)

{
  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;
}



void FUN_140248780(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  longlong lVar8;
  ulonglong uVar9;
  longlong local_50;
  ulonglong local_48;
  longlong local_38;
  longlong local_30;
  
  lVar8 = param_1[4];
  lVar5 = param_1[1];
  lVar1 = *param_1;
  local_50 = 0;
  local_48 = param_2;
  FUN_140346140(&local_50);
  local_30 = param_1[1];
  lVar2 = *param_1;
  *param_1 = 0;
  param_1[1] = local_30;
  param_1[4] = 0;
  for (puVar7 = (undefined8 *)param_1[6]; puVar7 != (undefined8 *)(lVar1 + lVar5 * 8);
      puVar7 = puVar7 + 1) {
    puVar3 = (undefined8 *)*puVar7;
    while (puVar3 != (undefined8 *)0x0) {
      plVar4 = puVar3 + 1;
      plVar6 = plVar4;
      if (0xf < (ulonglong)puVar3[4]) {
        plVar6 = (longlong *)*plVar4;
      }
      if (0xf < (ulonglong)puVar3[4]) {
        plVar4 = (longlong *)*plVar4;
      }
      uVar9 = 0;
      for (; plVar4 != (longlong *)(puVar3[3] + (longlong)plVar6);
          plVar4 = (longlong *)((longlong)plVar4 + 1)) {
        uVar9 = uVar9 ^ (longlong)*(char *)plVar4 + (uVar9 >> 2) + uVar9 * 0x40 + 0x9e3779b9;
      }
      *puVar7 = *puVar3;
      *puVar3 = *(undefined8 *)(local_50 + (uVar9 % local_48) * 8);
      *(undefined8 **)(local_50 + (uVar9 % local_48) * 8) = puVar3;
      puVar3 = (undefined8 *)*puVar7;
    }
  }
  param_1[4] = lVar8;
  lVar8 = *param_1;
  *param_1 = local_50;
  lVar5 = param_1[1];
  param_1[1] = local_48;
  plVar4 = (longlong *)*param_1;
  if (param_1[4] == 0) {
    param_1[6] = (longlong)(plVar4 + local_48);
  }
  else {
    param_1[6] = (longlong)plVar4;
    lVar1 = *plVar4;
    while (lVar1 == 0) {
      plVar4 = plVar4 + 1;
      param_1[6] = (longlong)plVar4;
      lVar1 = *plVar4;
    }
  }
  local_50 = lVar8;
  local_48 = lVar5;
  local_38 = lVar2;
  lVar5 = FUN_1402961d0(param_1);
  param_1[7] = lVar5;
  if (lVar2 != 0) {
    FUN_140247d30(&local_38);
    lVar8 = local_50;
  }
  if (lVar8 != 0) {
    FUN_140247d30(&local_50);
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_140248950(longlong param_1)

{
  undefined *puVar1;
  
  if ((DAT_140609408 & 1) == 0) {
    DAT_140609408 = DAT_140609408 | 1;
    FUN_140385af0(&DAT_1406093e8);
    _DAT_1406093e8 = CHARACTER_PROTOCOL::Proxy::vftable;
    if (DAT_1406093fc != 1) {
      FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
    }
    _DAT_1406093e8 = RNP::CharacterProxy::vftable;
    DAT_140609400 = 0;
    atexit((_func_5014 *)&LAB_140448cb0);
  }
  if (*(longlong *)(param_1 + 0x1e80) == 0) {
    puVar1 = &DAT_1406093e8;
  }
  else {
    puVar1 = (undefined *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x380);
  }
  return puVar1;
}



void FUN_1402489f0(longlong param_1)

{
  longlong *plVar1;
  undefined2 local_res8 [4];
  int local_res10 [2];
  int local_res18 [2];
  undefined4 local_res20 [2];
  
  if (*(longlong *)(param_1 + 0x1e80) != 0) {
    local_res8[0] = *(undefined2 *)(param_1 + 0x5a8);
    local_res10[0] = (int)*(float *)(param_1 + 0x5a0);
    local_res18[0] = (int)*(float *)(param_1 + 0x598);
    local_res20[0] = *(undefined4 *)(param_1 + 0x128);
    plVar1 = (longlong *)FUN_140248950();
    (**(code **)(*plVar1 + 0xb0))
              (plVar1,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,
               local_res20,local_res18,local_res10,local_res8,param_1 + 0x610,param_1 + 0x614);
  }
  *(undefined8 *)(param_1 + 0x610) = 0;
  *(undefined1 *)(param_1 + 0x60c) = 0;
  return;
}



void FUN_140248ab0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  undefined *puVar1;
  int *piVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  undefined8 uVar8;
  undefined *puVar9;
  longlong *plVar10;
  undefined4 uVar11;
  undefined8 *puVar12;
  int iVar13;
  undefined1 local_res8 [8];
  undefined *local_c8 [2];
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined8 local_94;
  undefined8 local_8c;
  undefined8 local_84;
  undefined8 local_7c;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_48;
  undefined1 local_40;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  lVar7 = *(longlong *)(param_1 + 0x20e0);
  if (lVar7 == 0) {
    return;
  }
  if (*(longlong *)(lVar7 + 0xb50) == 0) {
    return;
  }
  FUN_140201920(*(longlong *)(lVar7 + 0xb50),*(undefined4 *)(lVar7 + 0x288),
                *(undefined4 *)(lVar7 + 0x284),*(undefined4 *)(lVar7 + 8),param_2,1);
  lVar7 = FUN_140208860(param_1,param_3);
  iVar13 = 0;
  if (lVar7 != 0) {
    local_b8 = 0;
    local_b0 = 0;
    local_a8 = 0;
    local_a0 = 0;
    local_9c = 0;
    local_98 = 0;
    local_94 = 0;
    local_8c = 0;
    local_84 = 0;
    local_7c = 0;
    lVar3 = *(longlong *)(param_1 + 0x20e0);
    if (lVar3 != 0) {
      FUN_140203e10(*(undefined8 *)(lVar3 + 0xb50),0x1fa,lVar3,lVar7,&local_b8);
    }
  }
  uVar11 = 3;
  if (*(longlong *)(param_1 + 0x1e80) != 0) {
    uVar11 = *(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 0xb0);
  }
  local_res8[0] = FUN_1401b7910(*(undefined8 *)(param_1 + 0x20e0),uVar11,param_4,param_2);
  puVar12 = (undefined8 *)(lVar7 + 0xd0);
  if (7 < *(ulonglong *)(lVar7 + 0xe8)) {
    puVar12 = (undefined8 *)*puVar12;
  }
  FUN_14034fe70();
  local_c8[0] = PTR_DAT_1405d8010;
  iVar4 = FUN_14034fcf0(puVar12);
  iVar6 = iVar13;
  if ((local_c8[0] != (undefined *)0x0) && (local_c8[0] != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_c8[0] + -8);
  }
  iVar5 = iVar4;
  if (((iVar4 <= iVar6) && (iVar5 = iVar13, local_c8[0] != (undefined *)0x0)) &&
     (local_c8[0] != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_c8[0] + -8);
  }
  iVar13 = 1;
  if (1 < iVar5) {
    iVar13 = iVar5;
  }
  iVar5 = 0;
  iVar6 = iVar5;
  if ((local_c8[0] != (undefined *)0x0) && (local_c8[0] != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_c8[0] + -8);
  }
  if (iVar6 < iVar13) {
    FUN_140002d30(local_c8);
  }
  FUN_140002e10(local_c8);
  puVar9 = local_c8[0];
  if (local_c8[0] == (undefined *)0x0) {
    puVar9 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar9,puVar12,iVar4);
  puVar9 = local_c8[0];
  if (local_c8[0] == (undefined *)0x0) {
    puVar9 = PTR_DAT_1405d8010;
  }
  iVar6 = FUN_14034fcf0(puVar9);
  iVar13 = 0;
  if (0 < iVar6) {
    iVar13 = iVar6;
  }
  iVar6 = iVar5;
  if ((local_c8[0] != (undefined *)0x0) && (local_c8[0] != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_c8[0] + -8);
  }
  if ((iVar6 <= iVar13) && (iVar13 = iVar5, local_c8[0] != (undefined *)0x0)) {
    if (local_c8[0] == PTR_DAT_1405d8010) goto LAB_140248cc7;
    iVar13 = *(int *)(local_c8[0] + -8);
  }
  if (((local_c8[0] != PTR_DAT_1405d8010) && (local_c8[0] != (undefined *)0x0)) &&
     ((int *)(local_c8[0] + -8) != (int *)0x0)) {
    *(int *)(local_c8[0] + -8) = iVar13;
    *(undefined2 *)(local_c8[0] + (longlong)iVar13 * 2) = 0;
  }
LAB_140248cc7:
  plVar10 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x380);
  (**(code **)(*plVar10 + 2000))
            (plVar10,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),&DAT_1405d85a0,local_c8,
             local_res8,&stack0x00000028);
  puVar9 = local_c8[0];
  if (((local_c8[0] != (undefined *)0x0) && (local_c8[0] != PTR_DAT_1405d8010)) &&
     (puVar1 = local_c8[0] + -8, puVar1 != (undefined *)0x0)) {
    uVar8 = FUN_14034fe70();
    local_48 = uVar8;
    FUN_14034ed40(uVar8);
    local_40 = 1;
    piVar2 = (int *)(puVar9 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar8);
  }
  FUN_1402082d0(param_1,param_3,0);
  local_68 = (void *)0x0;
  local_60 = 0;
  local_58 = 0;
  FUN_14020ca50(param_1,&local_68);
  plVar10 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x20e0) + 0xb50) + 0x380);
  (**(code **)(*plVar10 + 0x820))
            (plVar10,*(undefined4 *)(*(longlong *)(param_1 + 0x20e0) + 8),&DAT_1405d85a0,&local_68);
  if (local_68 != (void *)0x0) {
    operator_delete(local_68);
  }
  return;
}



void FUN_140248dd0(longlong param_1,undefined2 param_2)

{
  longlong *plVar1;
  undefined2 local_res8 [8];
  int local_res18 [2];
  int local_res20 [2];
  undefined4 local_18 [4];
  
  if (*(longlong *)(param_1 + 0x1e80) != 0) {
    local_res18[0] = (int)*(float *)(param_1 + 0x5a0);
    local_res20[0] = (int)*(float *)(param_1 + 0x598);
    local_18[0] = *(undefined4 *)(param_1 + 0x128);
    local_res8[0] = param_2;
    plVar1 = (longlong *)FUN_140248950();
    (**(code **)(*plVar1 + 0x830))
              (plVar1,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,local_18,
               local_res20,local_res18,local_res8);
  }
  return;
}



void FUN_140248e60(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  void *pvVar3;
  int iVar4;
  uint uVar5;
  undefined4 uVar6;
  ulonglong uVar7;
  short *psVar8;
  longlong lVar9;
  longlong lVar10;
  undefined4 *puVar11;
  short *psVar12;
  longlong *plVar13;
  short *psVar14;
  undefined4 *puVar15;
  longlong lVar16;
  bool bVar17;
  undefined1 uVar18;
  longlong *local_50;
  longlong *local_48;
  longlong local_40;
  undefined1 local_38;
  undefined4 *local_30;
  
  if (*(double *)(param_1 + 0x28) - *(double *)(param_1 + 0x30) < 5.0) {
    return;
  }
  *(double *)(param_1 + 0x30) = *(double *)(param_1 + 0x28);
  FUN_140294910(DAT_140607ff0,&local_50);
  plVar13 = local_50;
  if (local_50 == (longlong *)0x0) goto LAB_1402490e7;
  if (local_50 != local_48) {
    iVar4 = DAT_140608200 + 1;
    bVar17 = DAT_140608200 == 0;
    DAT_140608200 = iVar4;
    if (bVar17) {
      FUN_140176d60(1);
      plVar13 = local_50;
    }
    goto LAB_1402490e7;
  }
  if (*local_50 == 0) goto LAB_1402490e7;
  param_1 = param_1 + 0x80;
  local_40 = param_1;
  FUN_14034ed40(param_1);
  local_38 = 1;
  if (local_50 == (longlong *)0x0) {
LAB_140248f5e:
    lVar16 = 0;
  }
  else {
    if (local_50 != local_48) {
      iVar4 = DAT_140608200 + 1;
      bVar17 = DAT_140608200 == 0;
      DAT_140608200 = iVar4;
      if (bVar17) {
        FUN_140176d60(1);
      }
      goto LAB_140248f5e;
    }
    lVar16 = *local_50;
  }
  if (*(longlong *)(lVar16 + 0x70) != 0) {
    uVar7 = 0;
    if (*(uint *)(lVar16 + 0x78) != 0) {
      plVar13 = *(longlong **)(lVar16 + 0x68);
      do {
        if (*plVar13 != 0) {
          puVar15 = (undefined4 *)(*(longlong **)(lVar16 + 0x68))[uVar7];
          goto LAB_140248f9a;
        }
        uVar5 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar5;
        plVar13 = plVar13 + 1;
      } while (uVar5 < *(uint *)(lVar16 + 0x78));
    }
  }
  puVar15 = (undefined4 *)0x0;
LAB_140248f9a:
  puVar11 = puVar15;
  local_30 = puVar11;
  if (puVar11 != (undefined4 *)0x0) {
    uVar2 = *puVar11;
    if (local_50 == (longlong *)0x0) {
LAB_140248fd2:
      lVar9 = 0;
      uVar18 = true;
    }
    else {
      uVar18 = local_50 == local_48;
      if (!(bool)uVar18) {
        iVar4 = DAT_140608200 + 1;
        bVar17 = DAT_140608200 == 0;
        DAT_140608200 = iVar4;
        if (bVar17) {
          FUN_140176d60(1);
        }
        goto LAB_140248fd2;
      }
      lVar9 = *local_50;
    }
    uVar6 = FUN_1402970c0(lVar9,L"szName");
    psVar8 = (short *)FUN_140296990(lVar9,uVar2,uVar6,L"szName",1);
    FUN_140338610(DAT_1406081f8,psVar8);
    FUN_1402f1c30(DAT_140608068);
    lVar9 = DAT_1406081f0;
    lVar10 = 9;
    psVar12 = psVar8;
    psVar14 = &DAT_1404aed90;
    do {
      if (lVar10 == 0) break;
      lVar10 = lVar10 + -1;
      uVar18 = *psVar12 == *psVar14;
      psVar12 = psVar12 + 1;
      psVar14 = psVar14 + 1;
    } while ((bool)uVar18);
    if ((bool)uVar18) {
      FUN_1402f3920(DAT_1406081f0 + 0x50);
      FUN_1402f3920(lVar9 + 8);
      FUN_140334520(lVar9);
    }
    lVar9 = DAT_1406081f0;
    lVar10 = 7;
    psVar12 = &DAT_1404d2988;
    do {
      if (lVar10 == 0) break;
      lVar10 = lVar10 + -1;
      uVar18 = *psVar8 == *psVar12;
      psVar8 = psVar8 + 1;
      psVar12 = psVar12 + 1;
    } while ((bool)uVar18);
    if ((bool)uVar18) {
      FUN_1402f3920(DAT_1406081f0 + 0x50);
      FUN_1402f3920(lVar9 + 8);
      FUN_140334520(lVar9);
    }
    puVar15 = *(undefined4 **)(puVar11 + 6);
    if (puVar15 == (undefined4 *)0x0) {
      uVar5 = (uint)puVar11[8] % *(uint *)(lVar16 + 0x78) + 1;
      lVar9 = (longlong)(int)uVar5 << 3;
      do {
        if (*(uint *)(lVar16 + 0x78) <= uVar5) break;
        if (*(longlong *)(lVar9 + *(longlong *)(lVar16 + 0x68)) != 0) {
          puVar15 = *(undefined4 **)(lVar9 + *(longlong *)(lVar16 + 0x68));
        }
        uVar5 = uVar5 + 1;
        lVar9 = lVar9 + 8;
      } while (puVar15 == (undefined4 *)0x0);
    }
    goto LAB_140248f9a;
  }
  FUN_14034edd0(param_1);
  plVar13 = local_50;
LAB_1402490e7:
  if (plVar13 != (longlong *)0x0) {
    if (plVar13 == local_48) {
      if (plVar13 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar13 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          local_50 = (longlong *)0x0;
          pvVar3 = (void *)*plVar13;
          if (pvVar3 != (void *)0x0) {
            FUN_140296560(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(plVar13);
        }
      }
    }
    else {
      iVar4 = DAT_140608204 + 1;
      bVar17 = DAT_140608204 == 0;
      DAT_140608204 = iVar4;
      if (bVar17) {
        FUN_140176d60(1);
      }
    }
  }
  return;
}



void thunk_FUN_140249180(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_140296560(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608204 + 1;
      bVar5 = DAT_140608204 == 0;
      DAT_140608204 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_140249180(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_140296560(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608204 + 1;
      bVar5 = DAT_140608204 == 0;
      DAT_140608204 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_140249200(longlong param_1)

{
  FUN_14024afc0();
  *(undefined4 *)(param_1 + 0x1e2c) = 1;
  *(undefined4 *)(param_1 + 0x1e30) = 1;
  return;
}



void FUN_140249230(longlong param_1)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x22d8);
  if (puVar1 != (undefined8 *)0x0) {
    if ((void *)*puVar1 != (void *)0x0) {
      operator_delete((void *)*puVar1);
    }
    *puVar1 = 0;
  }
  FUN_14023d410(param_1);
  return;
}



void FUN_140249270(longlong *param_1,undefined4 *param_2,char param_3)

{
  if ((param_3 != '\0') || (*(int *)(param_1[0x45d] + 0x54) != 0)) {
    (**(code **)(*param_1 + 0x100))();
    *(undefined4 *)(param_1 + 0x269) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x134c) = param_2[1];
    *(undefined4 *)(param_1 + 0x26a) = param_2[2];
    *(undefined4 *)((longlong)param_1 + 0x133c) = *param_2;
    *(undefined4 *)(param_1 + 0x268) = param_2[1];
    *(undefined4 *)((longlong)param_1 + 0x1344) = param_2[2];
    *(undefined4 *)((longlong)param_1 + 0x154) = *param_2;
    *(undefined4 *)(param_1 + 0x2b) = param_2[1];
    *(undefined4 *)((longlong)param_1 + 0x15c) = param_2[2];
    *(undefined4 *)(param_1 + 0x2c) = *param_2;
    *(undefined4 *)((longlong)param_1 + 0x164) = param_2[1];
    *(undefined4 *)(param_1 + 0x2d) = param_2[2];
  }
  return;
}



void FUN_140249310(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x1e2c) = 1;
  *(undefined4 *)(param_1 + 0x1814) = 0;
  FUN_14024d7d0();
  return;
}



undefined4 FUN_140249330(longlong param_1)

{
  return *(undefined4 *)(*(longlong *)(param_1 + 0x22e8) + 0xc);
}



void FUN_140249340(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x2351) = param_2;
  return;
}



undefined8 FUN_140249350(longlong param_1)

{
  return CONCAT71((int7)((ulonglong)*(longlong *)(param_1 + 0x22e8) >> 8),
                  *(int *)(*(longlong *)(param_1 + 0x22e8) + 0x54) != 0);
}



void FUN_140249360(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x22d0) = param_2;
  return;
}



void FUN_140249370(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x2340) = param_2;
  return;
}



undefined8 FUN_140249380(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(longlong *)(*(longlong *)(param_1 + 0x22d8) + 8) != 0) {
                    // WARNING: Could not recover jumptable at 0x000140249395. Too many branches
                    // WARNING: Treating indirect jump as call
    uVar1 = (**(code **)**(undefined8 **)(*(longlong *)(param_1 + 0x22d8) + 8))();
    return uVar1;
  }
  return 0;
}



undefined4 FUN_1402493a0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x238c);
}



undefined8 * FUN_1402493b0(undefined8 *param_1,uint param_2)

{
  *param_1 = MGSCharacterEnemyFixBoss::vftable;
  if ((void *)param_1[0x475] != (void *)0x0) {
    operator_delete((void *)param_1[0x475]);
  }
  param_1[0x475] = 0;
  param_1[0x476] = 0;
  param_1[0x477] = 0;
  *param_1 = MGSCharacterEnemyBoss::vftable;
  FUN_14024aef0(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140249430(longlong *param_1)

{
  longlong lVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  FUN_14024afc0();
  lVar1 = param_1[0x45d];
  *(undefined4 *)((longlong)param_1 + 0x1e2c) = 1;
  *(undefined4 *)(param_1 + 0x3c6) = 1;
  if ((lVar1 != 0) &&
     (puVar2 = *(undefined4 **)(lVar1 + 0x2c8), puVar2 != *(undefined4 **)(lVar1 + 0x2d0))) {
    do {
      if (*(ulonglong *)(puVar2 + 0x12) < 8) {
        puVar4 = puVar2 + 0xc;
      }
      else {
        puVar4 = *(undefined4 **)(puVar2 + 0xc);
      }
      if (*(ulonglong *)(puVar2 + 8) < 8) {
        puVar3 = puVar2 + 2;
      }
      else {
        puVar3 = *(undefined4 **)(puVar2 + 2);
      }
      (**(code **)(*param_1 + 0xb50))(param_1,*puVar2,puVar3,puVar4);
      puVar2 = puVar2 + 0x16;
    } while (puVar2 != *(undefined4 **)(lVar1 + 0x2d0));
  }
  *(undefined1 *)((longlong)param_1 + 0xeec) = 0;
  param_1[0xa4] = 0;
  return;
}



// WARNING: Removing unreachable block (ram,0x000140249508)
// WARNING: Removing unreachable block (ram,0x000140249510)

void FUN_1402494e0(longlong param_1)

{
  undefined8 *puVar1;
  
  if (*(longlong *)(param_1 + 0x23a8) != *(longlong *)(param_1 + 0x23b0)) {
    *(longlong *)(param_1 + 0x23b0) = *(longlong *)(param_1 + 0x23a8);
  }
  puVar1 = *(undefined8 **)(param_1 + 0x22d8);
  if (puVar1 != (undefined8 *)0x0) {
    if ((void *)*puVar1 != (void *)0x0) {
      operator_delete((void *)*puVar1);
    }
    *puVar1 = 0;
  }
  FUN_14023d410(param_1);
  return;
}



void FUN_140249580(longlong param_1)

{
  float fVar1;
  undefined4 *puVar2;
  
  fVar1 = *(float *)(*(longlong *)(param_1 + 0x22e8) + 0x10);
  if (0.0001 <= fVar1 * fVar1 + 0.0) {
    puVar2 = (undefined4 *)(param_1 + 0x1348);
    *puVar2 = 0;
    *(undefined4 *)(param_1 + 0x134c) = 0;
    *(float *)(param_1 + 0x1350) = fVar1;
    D3DXVec3Normalize(puVar2,puVar2);
  }
  return;
}



void FUN_1402495f0(longlong param_1)

{
  undefined4 uVar1;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  *(undefined1 *)(param_1 + 0x13f8) = 0;
  uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 0x22e8) + 0x10);
  *(undefined4 *)(param_1 + 0x160) = 0;
  local_18 = 0;
  local_14 = 0;
  *(undefined4 *)(param_1 + 0x164) = 0;
  *(undefined4 *)(param_1 + 0x168) = uVar1;
  local_10 = *(undefined4 *)(*(longlong *)(param_1 + 0x22e8) + 0x10);
  FUN_14021e830(local_10,&local_18);
  return;
}



void FUN_140249660(longlong *param_1,undefined8 param_2)

{
  (**(code **)(*param_1 + 0xb58))();
  FUN_1402182e0(param_1,param_2);
  *(undefined4 *)(param_1 + 0x2f) = *(undefined4 *)((longlong)param_1 + 0x239c);
  *(int *)((longlong)param_1 + 0x17c) = (int)param_1[0x474];
  *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)((longlong)param_1 + 0x23a4);
  *(undefined4 *)(param_1 + 0x38b) = *(undefined4 *)((longlong)param_1 + 0x239c);
  *(int *)((longlong)param_1 + 0x1c5c) = (int)param_1[0x474];
  *(undefined4 *)(param_1 + 0x38c) = *(undefined4 *)((longlong)param_1 + 0x23a4);
  return;
}



void FUN_1402496e0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  longlong lVar5;
  float *pfVar6;
  float local_78;
  float local_74;
  float local_70;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  
  lVar5 = param_1[0x27b];
  local_30 = 0;
  local_34 = 0;
  local_38 = 0;
  local_3c = 0;
  local_44 = 0;
  local_48 = 0;
  local_4c = 0;
  local_50 = 0;
  local_58 = 0;
  local_5c = 0;
  local_60 = 0;
  local_64 = 0;
  local_2c = 0x3f800000;
  local_40 = 0x3f800000;
  local_54 = 0x3f800000;
  local_68 = 0x3f800000;
  pfVar6 = (float *)FUN_1402cc100(*(undefined8 *)(lVar5 + 0x20),&local_78,
                                  (float)(double)param_1[0x28a],&local_68);
  fVar1 = *(float *)(lVar5 + 0xfc);
  fVar2 = pfVar6[2];
  fVar3 = *pfVar6;
  fVar4 = pfVar6[1];
  *(float *)((longlong)param_1 + 0x184) = *(float *)(param_1 + 0x2f) - fVar1 * fVar3;
  *(float *)(param_1 + 0x31) = *(float *)((longlong)param_1 + 0x17c) - fVar1 * fVar4;
  *(float *)((longlong)param_1 + 0x18c) = *(float *)(param_1 + 0x30) - fVar1 * fVar2;
  local_78 = *(float *)(param_1 + 0x2f) - fVar1 * fVar3;
  local_74 = *(float *)((longlong)param_1 + 0x17c) - fVar1 * fVar4;
  *(float *)(param_1 + 0x2f) = local_78;
  *(float *)((longlong)param_1 + 0x17c) = local_74;
  local_70 = *(float *)(param_1 + 0x30) - fVar1 * fVar2;
  *(float *)(param_1 + 0x30) = local_70;
  (**(code **)(*param_1 + 0x8d0))(param_1,param_2,param_3);
  return;
}



void FUN_140249870(longlong *param_1,char param_2)

{
  int iVar1;
  int *piVar2;
  
  iVar1 = (int)param_1[0x473];
  if (iVar1 == 100) {
    *(undefined4 *)(param_1 + 0x2f) = *(undefined4 *)((longlong)param_1 + 0x239c);
    *(int *)((longlong)param_1 + 0x17c) = (int)param_1[0x474];
    *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)((longlong)param_1 + 0x23a4);
  }
  else if ((iVar1 - 200U < 8) && (piVar2 = (int *)param_1[0x475], piVar2 != (int *)param_1[0x476]))
  {
    do {
      if (*piVar2 == iVar1) {
        if (param_2 == '\0') {
          *(int *)(param_1 + 0x2f) = piVar2[1];
          *(int *)((longlong)param_1 + 0x17c) = piVar2[2];
          *(int *)(param_1 + 0x30) = piVar2[3];
                    // WARNING: Could not recover jumptable at 0x00014024992d. Too many branches
                    // WARNING: Treating indirect jump as call
          (**(code **)(*param_1 + 0xb58))(param_1);
          return;
        }
        *(int *)(param_1 + 0x2f) = piVar2[4];
        *(int *)((longlong)param_1 + 0x17c) = piVar2[5];
        *(int *)(param_1 + 0x30) = piVar2[6];
        (**(code **)(*param_1 + 0xb58))();
        *(undefined4 *)(param_1 + 0x473) = 0;
        return;
      }
      piVar2 = piVar2 + 7;
    } while (piVar2 != (int *)param_1[0x476]);
    return;
  }
  return;
}



void FUN_140249960(longlong param_1,undefined4 *param_2)

{
  *(undefined4 *)(param_1 + 0x239c) = *param_2;
  *(undefined4 *)(param_1 + 0x23a0) = param_2[1];
  *(undefined4 *)(param_1 + 0x23a4) = param_2[2];
  return;
}



void FUN_140249980(longlong param_1)

{
  if (1.0 <= *(float *)(param_1 + 0x598)) {
    *(undefined1 *)(param_1 + 0x600) = 1;
    FUN_14023dc60();
    return;
  }
  *(undefined1 *)(param_1 + 0x600) = 0;
  FUN_14023dc60();
  return;
}



void FUN_1402499b0(longlong param_1)

{
  undefined4 uVar1;
  uint uVar2;
  
  uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 0x22e8) + 0x10);
  *(undefined4 *)(param_1 + 0x133c) = 0;
  *(undefined4 *)(param_1 + 0x1340) = 0;
  *(undefined4 *)(param_1 + 0x1344) = uVar1;
  D3DXVec3Normalize((undefined4 *)(param_1 + 0x133c),param_1 + 0x133c);
  *(undefined4 *)(param_1 + 0x1348) = *(undefined4 *)(param_1 + 0x133c);
  *(undefined4 *)(param_1 + 0x134c) = *(undefined4 *)(param_1 + 0x1340);
  *(undefined4 *)(param_1 + 0x1350) = *(undefined4 *)(param_1 + 0x1344);
  *(undefined4 *)(param_1 + 0x154) = *(undefined4 *)(param_1 + 0x133c);
  *(undefined4 *)(param_1 + 0x158) = *(undefined4 *)(param_1 + 0x1340);
  *(undefined4 *)(param_1 + 0x15c) = *(undefined4 *)(param_1 + 0x1344);
  *(undefined4 *)(param_1 + 0x160) = *(undefined4 *)(param_1 + 0x133c);
  *(undefined4 *)(param_1 + 0x164) = *(undefined4 *)(param_1 + 0x1340);
  *(undefined4 *)(param_1 + 0x168) = *(undefined4 *)(param_1 + 0x1344);
  *(undefined8 *)(param_1 + 5000) = 0;
  *(undefined8 *)(param_1 + 0x1380) = 0;
  *(undefined8 *)(param_1 + 0x1374) = 0;
  *(undefined8 *)(param_1 + 0x136c) = 0;
  *(undefined8 *)(param_1 + 0x1360) = 0;
  *(undefined8 *)(param_1 + 0x1358) = 0;
  *(undefined4 *)(param_1 + 0x1390) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x137c) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x1368) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x1354) = 0x3f800000;
  D3DXVec3Normalize(param_1 + 0x1348,param_1 + 0x1348);
  *(undefined4 *)(param_1 + 0x1374) = *(undefined4 *)(param_1 + 0x1348);
  *(undefined4 *)(param_1 + 0x1378) = *(undefined4 *)(param_1 + 0x134c);
  *(undefined4 *)(param_1 + 0x137c) = *(undefined4 *)(param_1 + 0x1350);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)(param_1 + 0x1374);
  DAT_1406081a4 = *(float *)(param_1 + 0x1378);
  DAT_1406081a8 = *(float *)(param_1 + 0x137c);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081a8 - DAT_1406081a4 * 0.0;
  DAT_140608020 = DAT_1406081a4 * 0.0 - DAT_1406081a0;
  DAT_140608018._4_4_ = DAT_1406081a0 * 0.0 - DAT_1406081a8 * 0.0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  uVar2 = DAT_1406081bc;
  DAT_1406081c0 = DAT_1406081b0;
  *(float *)(param_1 + 0x1354) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x1358) = DAT_1406081b4;
  *(undefined4 *)(param_1 + 0x135c) = DAT_1406081b8;
  if ((uVar2 & 1) == 0) {
    DAT_1406081bc = uVar2 | 1;
  }
  DAT_1406081c4 = *(float *)(param_1 + 0x1358);
  DAT_1406081c8 = *(float *)(param_1 + 0x135c);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)(param_1 + 0x1374);
  DAT_1406081a4 = *(float *)(param_1 + 0x1378);
  DAT_1406081a8 = *(float *)(param_1 + 0x137c);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081c8 * DAT_1406081a4 - DAT_1406081c4 * DAT_1406081a8;
  DAT_140608020 = DAT_1406081c4 * DAT_1406081a0 - DAT_1406081c0 * DAT_1406081a4;
  DAT_140608018._4_4_ = DAT_1406081c0 * DAT_1406081a8 - DAT_1406081c8 * DAT_1406081a0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  *(float *)(param_1 + 0x1364) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x1368) = DAT_1406081b4;
  *(undefined4 *)(param_1 + 0x136c) = DAT_1406081b8;
  *(undefined4 *)(param_1 + 0x1384) = *(undefined4 *)(param_1 + 0x178);
  *(undefined4 *)(param_1 + 5000) = *(undefined4 *)(param_1 + 0x17c);
  *(undefined4 *)(param_1 + 0x138c) = *(undefined4 *)(param_1 + 0x180);
  *(undefined8 *)(param_1 + 0x13c8) = 0;
  *(undefined8 *)(param_1 + 0x13c0) = 0;
  *(undefined8 *)(param_1 + 0x13b4) = 0;
  *(undefined8 *)(param_1 + 0x13ac) = 0;
  *(undefined8 *)(param_1 + 0x13a0) = 0;
  *(undefined8 *)(param_1 + 0x1398) = 0;
  *(undefined4 *)(param_1 + 0x13d0) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x13bc) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x13a8) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x1394) = 0x3f800000;
  D3DXVec3Normalize(param_1 + 0x160,param_1 + 0x160);
  *(undefined4 *)(param_1 + 0x13b4) = *(undefined4 *)(param_1 + 0x160);
  *(undefined4 *)(param_1 + 0x13b8) = *(undefined4 *)(param_1 + 0x164);
  *(undefined4 *)(param_1 + 0x13bc) = *(undefined4 *)(param_1 + 0x168);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)(param_1 + 0x13b4);
  DAT_1406081a4 = *(float *)(param_1 + 0x13b8);
  DAT_1406081a8 = *(float *)(param_1 + 0x13bc);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081a8 - DAT_1406081a4 * 0.0;
  DAT_140608020 = DAT_1406081a4 * 0.0 - DAT_1406081a0;
  DAT_140608018._4_4_ = DAT_1406081a0 * 0.0 - DAT_1406081a8 * 0.0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  uVar2 = DAT_1406081bc;
  DAT_1406081c0 = DAT_1406081b0;
  *(float *)(param_1 + 0x1394) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x1398) = DAT_1406081b4;
  *(undefined4 *)(param_1 + 0x139c) = DAT_1406081b8;
  if ((uVar2 & 1) == 0) {
    DAT_1406081bc = uVar2 | 1;
  }
  DAT_1406081c4 = *(float *)(param_1 + 0x1398);
  DAT_1406081c8 = *(float *)(param_1 + 0x139c);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)(param_1 + 0x13b4);
  DAT_1406081a4 = *(float *)(param_1 + 0x13b8);
  DAT_1406081a8 = *(float *)(param_1 + 0x13bc);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081c8 * DAT_1406081a4 - DAT_1406081c4 * DAT_1406081a8;
  DAT_140608020 = DAT_1406081c4 * DAT_1406081a0 - DAT_1406081c0 * DAT_1406081a4;
  DAT_140608018._4_4_ = DAT_1406081c0 * DAT_1406081a8 - DAT_1406081c8 * DAT_1406081a0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  *(float *)(param_1 + 0x13a4) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x13a8) = DAT_1406081b4;
  *(undefined4 *)(param_1 + 0x13ac) = DAT_1406081b8;
  *(undefined4 *)(param_1 + 0x13c4) = *(undefined4 *)(param_1 + 0x178);
  *(undefined4 *)(param_1 + 0x13c8) = *(undefined4 *)(param_1 + 0x17c);
  *(undefined4 *)(param_1 + 0x13cc) = *(undefined4 *)(param_1 + 0x180);
  FUN_140218260(param_1,param_1 + 0x178);
  return;
}



void FUN_14024a070(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x2398) = param_2;
  return;
}



void FUN_14024a080(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong *puVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int *piVar8;
  undefined4 *puVar9;
  longlong lVar10;
  longlong lVar11;
  int *piVar12;
  undefined4 *puVar13;
  int local_48;
  int local_44;
  int local_40;
  int local_3c;
  int local_38;
  int local_34;
  int local_30;
  
  if (((((*(longlong *)(param_1 + 0x1e80) != 0) &&
        (lVar11 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30), lVar11 != 0)) &&
       (lVar11 = *(longlong *)(lVar11 + 0x2d0), lVar11 != 0)) &&
      ((*(longlong *)(param_1 + 0x2308) != 0 &&
       (lVar10 = FUN_1402bc270(lVar11,param_3), lVar10 != 0)))) &&
     (lVar11 = FUN_1402bc270(lVar11,param_4), lVar11 != 0)) {
    puVar1 = (ulonglong *)(param_1 + 0x23a8);
    for (piVar12 = (int *)*puVar1; piVar12 != *(int **)(param_1 + 0x23b0); piVar12 = piVar12 + 7) {
      if (*piVar12 == param_2) {
        piVar12[1] = *(int *)(lVar10 + 0x68);
        piVar12[2] = *(int *)(lVar10 + 0x6c);
        piVar12[3] = *(int *)(lVar10 + 0x70);
        piVar12[4] = *(int *)(lVar11 + 0x68);
        piVar12[5] = *(int *)(lVar11 + 0x6c);
        piVar12[6] = *(int *)(lVar11 + 0x70);
        return;
      }
    }
    iVar2 = *(int *)(lVar10 + 0x68);
    iVar3 = *(int *)(lVar10 + 0x6c);
    piVar12 = *(int **)(param_1 + 0x23b0);
    iVar4 = *(int *)(lVar10 + 0x70);
    iVar5 = *(int *)(lVar11 + 0x68);
    iVar6 = *(int *)(lVar11 + 0x6c);
    iVar7 = *(int *)(lVar11 + 0x70);
    local_48 = param_2;
    local_44 = iVar2;
    local_40 = iVar3;
    local_3c = iVar4;
    local_38 = iVar5;
    local_34 = iVar6;
    local_30 = iVar7;
    if ((&local_48 < piVar12) && (piVar8 = (int *)*puVar1, piVar8 <= &local_48)) {
      if (piVar12 == *(int **)(param_1 + 0x23b8)) {
        FUN_140162330(puVar1);
      }
      puVar9 = *(undefined4 **)(param_1 + 0x23b0);
      puVar13 = (undefined4 *)((((longlong)&local_48 - (longlong)piVar8) / 0x1c) * 0x1c + *puVar1);
      if (puVar9 != (undefined4 *)0x0) {
        *puVar9 = *puVar13;
        puVar9[1] = puVar13[1];
        puVar9[2] = puVar13[2];
        puVar9[3] = puVar13[3];
        puVar9[4] = puVar13[4];
        puVar9[5] = puVar13[5];
        puVar9[6] = puVar13[6];
      }
    }
    else {
      if (piVar12 == *(int **)(param_1 + 0x23b8)) {
        FUN_140162330(puVar1);
      }
      piVar12 = *(int **)(param_1 + 0x23b0);
      if (piVar12 != (int *)0x0) {
        *piVar12 = param_2;
        piVar12[1] = iVar2;
        piVar12[2] = iVar3;
        piVar12[3] = iVar4;
        piVar12[4] = iVar5;
        piVar12[5] = iVar6;
        piVar12[6] = iVar7;
      }
    }
    *(longlong *)(param_1 + 0x23b0) = *(longlong *)(param_1 + 0x23b0) + 0x1c;
  }
  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 = MGSCharacterEnemyBoss::vftable;
  FUN_14024aef0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14024a2d0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  if (((*(longlong *)(param_1 + 0x1e80) != 0) &&
      (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30), lVar2 != 0)) &&
     (lVar2 = *(longlong *)(lVar2 + 0x2d0), lVar2 != 0)) {
    lVar1 = FUN_1402bc270(lVar2);
    if (lVar1 != 0) {
      *(undefined4 *)(param_1 + 0x23a8) = *(undefined4 *)(lVar1 + 0x68);
      *(undefined4 *)(param_1 + 0x23ac) = *(undefined4 *)(lVar1 + 0x6c);
      *(undefined4 *)(param_1 + 0x23b0) = *(undefined4 *)(lVar1 + 0x70);
    }
    lVar2 = FUN_1402bc270(lVar2,param_3);
    if (lVar2 != 0) {
      *(undefined4 *)(param_1 + 0x23b4) = *(undefined4 *)(lVar2 + 0x68);
      *(undefined4 *)(param_1 + 0x23b8) = *(undefined4 *)(lVar2 + 0x6c);
      *(undefined4 *)(param_1 + 0x23bc) = *(undefined4 *)(lVar2 + 0x70);
    }
  }
  return;
}



void FUN_14024a370(longlong param_1)

{
  *(uint *)(param_1 + 0x23a0) = (uint)(*(int *)(param_1 + 0x23a0) + 1 < 2);
  FUN_140240520(param_1,0x49);
  return;
}



void FUN_14024a3a0(longlong *param_1)

{
  uint uVar1;
  longlong lVar2;
  wchar_t *pwVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float local_c8;
  float local_c4;
  float local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  
  fVar6 = *(float *)((longlong)param_1 + 0x17c);
  fVar5 = fVar6 - fVar6;
  lVar2 = (longlong)(int)param_1[0x474];
  local_b8 = (undefined4)param_1[0x2f];
  local_b4 = *(undefined4 *)((longlong)param_1 + 0x17c);
  fVar7 = *(float *)((longlong)param_1 + 0x17c) -
          *(float *)((longlong)param_1 + lVar2 * 0xc + 0x23ac);
  local_b0 = (undefined4)param_1[0x30];
  fVar10 = *(float *)(param_1 + 0x2f) - *(float *)((longlong)param_1 + lVar2 * 0xc + 0x23a8);
  fVar11 = *(float *)(param_1 + 0x30) - *(float *)((longlong)param_1 + lVar2 * 0xc + 0x23b0);
  *(float *)((longlong)param_1 + 0x23ac) = fVar6;
  *(float *)(param_1 + 0x477) = fVar6;
  fVar4 = *(float *)(param_1 + 0x475);
  fVar8 = *(float *)((longlong)param_1 + 0x23b4) - fVar4;
  fVar9 = *(float *)((longlong)param_1 + 0x23bc) - *(float *)(param_1 + 0x476);
  fVar6 = ((*(float *)(param_1 + 0x2f) - fVar4) * fVar8 + (fVar6 - fVar6) * fVar5 +
          (*(float *)(param_1 + 0x30) - *(float *)(param_1 + 0x476)) * fVar9) /
          (fVar8 * fVar8 + fVar5 * fVar5 + fVar9 * fVar9);
  if (0.0 <= fVar6) {
    if (1.0 < fVar6) {
      fVar6 = 1.0;
    }
  }
  else {
    fVar6 = 0.0;
  }
  fVar5 = *(float *)(param_1 + 0x476);
  *(float *)((longlong)param_1 + 0x133c) = fVar10;
  *(float *)(param_1 + 0x268) = fVar7;
  *(float *)((longlong)param_1 + 0x1344) = fVar11;
  local_c8 = fVar10;
  local_c4 = fVar7;
  local_c0 = fVar11;
  D3DXVec3Normalize((float *)((longlong)param_1 + 0x133c),(longlong)param_1 + 0x133c);
  *(undefined4 *)(param_1 + 0x269) = *(undefined4 *)((longlong)param_1 + 0x133c);
  *(int *)((longlong)param_1 + 0x134c) = (int)param_1[0x268];
  *(undefined4 *)(param_1 + 0x26a) = *(undefined4 *)((longlong)param_1 + 0x1344);
  *(undefined4 *)((longlong)param_1 + 0x154) = *(undefined4 *)((longlong)param_1 + 0x133c);
  *(int *)(param_1 + 0x2b) = (int)param_1[0x268];
  *(undefined4 *)((longlong)param_1 + 0x15c) = *(undefined4 *)((longlong)param_1 + 0x1344);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)((longlong)param_1 + 0x133c);
  *(int *)((longlong)param_1 + 0x164) = (int)param_1[0x268];
  *(undefined4 *)(param_1 + 0x2d) = *(undefined4 *)((longlong)param_1 + 0x1344);
  param_1[0x271] = 0;
  param_1[0x270] = 0;
  *(undefined8 *)((longlong)param_1 + 0x1374) = 0;
  *(undefined8 *)((longlong)param_1 + 0x136c) = 0;
  param_1[0x26c] = 0;
  param_1[0x26b] = 0;
  *(undefined4 *)(param_1 + 0x272) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x137c) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x26d) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x1354) = 0x3f800000;
  D3DXVec3Normalize(param_1 + 0x269,param_1 + 0x269);
  *(int *)((longlong)param_1 + 0x1374) = (int)param_1[0x269];
  *(undefined4 *)(param_1 + 0x26f) = *(undefined4 *)((longlong)param_1 + 0x134c);
  *(int *)((longlong)param_1 + 0x137c) = (int)param_1[0x26a];
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)((longlong)param_1 + 0x1374);
  DAT_1406081a4 = *(float *)(param_1 + 0x26f);
  DAT_1406081a8 = *(float *)((longlong)param_1 + 0x137c);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081a8 - DAT_1406081a4 * 0.0;
  DAT_140608020 = DAT_1406081a4 * 0.0 - DAT_1406081a0;
  DAT_140608018._4_4_ = DAT_1406081a0 * 0.0 - DAT_1406081a8 * 0.0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  uVar1 = DAT_1406081bc;
  DAT_1406081c0 = DAT_1406081b0;
  *(float *)((longlong)param_1 + 0x1354) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x26b) = DAT_1406081b4;
  *(undefined4 *)((longlong)param_1 + 0x135c) = DAT_1406081b8;
  if ((uVar1 & 1) == 0) {
    DAT_1406081bc = uVar1 | 1;
  }
  DAT_1406081c4 = *(float *)(param_1 + 0x26b);
  DAT_1406081c8 = *(float *)((longlong)param_1 + 0x135c);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)((longlong)param_1 + 0x1374);
  DAT_1406081a4 = *(float *)(param_1 + 0x26f);
  DAT_1406081a8 = *(float *)((longlong)param_1 + 0x137c);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081c8 * DAT_1406081a4 - DAT_1406081c4 * DAT_1406081a8;
  DAT_140608020 = DAT_1406081c4 * DAT_1406081a0 - DAT_1406081c0 * DAT_1406081a4;
  DAT_140608018._4_4_ = DAT_1406081c0 * DAT_1406081a8 - DAT_1406081c8 * DAT_1406081a0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  *(float *)((longlong)param_1 + 0x1364) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x26d) = DAT_1406081b4;
  *(undefined4 *)((longlong)param_1 + 0x136c) = DAT_1406081b8;
  *(int *)((longlong)param_1 + 0x1384) = (int)param_1[0x2f];
  *(undefined4 *)(param_1 + 0x271) = *(undefined4 *)((longlong)param_1 + 0x17c);
  *(int *)((longlong)param_1 + 0x138c) = (int)param_1[0x30];
  param_1[0x279] = 0;
  param_1[0x278] = 0;
  *(undefined8 *)((longlong)param_1 + 0x13b4) = 0;
  *(undefined8 *)((longlong)param_1 + 0x13ac) = 0;
  param_1[0x274] = 0;
  param_1[0x273] = 0;
  *(undefined4 *)(param_1 + 0x27a) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x13bc) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x275) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x1394) = 0x3f800000;
  D3DXVec3Normalize(param_1 + 0x2c,param_1 + 0x2c);
  *(int *)((longlong)param_1 + 0x13b4) = (int)param_1[0x2c];
  *(undefined4 *)(param_1 + 0x277) = *(undefined4 *)((longlong)param_1 + 0x164);
  *(int *)((longlong)param_1 + 0x13bc) = (int)param_1[0x2d];
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)((longlong)param_1 + 0x13b4);
  DAT_1406081a4 = *(float *)(param_1 + 0x277);
  DAT_1406081a8 = *(float *)((longlong)param_1 + 0x13bc);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081a8 - DAT_1406081a4 * 0.0;
  DAT_140608020 = DAT_1406081a4 * 0.0 - DAT_1406081a0;
  DAT_140608018._4_4_ = DAT_1406081a0 * 0.0 - DAT_1406081a8 * 0.0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  uVar1 = DAT_1406081bc;
  DAT_1406081c0 = DAT_1406081b0;
  *(float *)((longlong)param_1 + 0x1394) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x273) = DAT_1406081b4;
  *(undefined4 *)((longlong)param_1 + 0x139c) = DAT_1406081b8;
  if ((uVar1 & 1) == 0) {
    DAT_1406081bc = uVar1 | 1;
  }
  DAT_1406081c4 = *(float *)(param_1 + 0x273);
  DAT_1406081c8 = *(float *)((longlong)param_1 + 0x139c);
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(float *)((longlong)param_1 + 0x13b4);
  DAT_1406081a4 = *(float *)(param_1 + 0x277);
  DAT_1406081a8 = *(float *)((longlong)param_1 + 0x13bc);
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = DAT_1406081c8 * DAT_1406081a4 - DAT_1406081c4 * DAT_1406081a8;
  DAT_140608020 = DAT_1406081c4 * DAT_1406081a0 - DAT_1406081c0 * DAT_1406081a4;
  DAT_140608018._4_4_ = DAT_1406081c0 * DAT_1406081a8 - DAT_1406081c8 * DAT_1406081a0;
  if ((DAT_1406081ac & 1) == 0) {
    DAT_1406081ac = DAT_1406081ac | 1;
  }
  D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
  *(float *)((longlong)param_1 + 0x13a4) = DAT_1406081b0;
  *(undefined4 *)(param_1 + 0x275) = DAT_1406081b4;
  *(undefined4 *)((longlong)param_1 + 0x13ac) = DAT_1406081b8;
  *(int *)((longlong)param_1 + 0x13c4) = (int)param_1[0x2f];
  *(undefined4 *)(param_1 + 0x279) = *(undefined4 *)((longlong)param_1 + 0x17c);
  *(int *)((longlong)param_1 + 0x13cc) = (int)param_1[0x30];
  FUN_140218260(param_1,param_1 + 0x2f);
  fVar10 = fVar7 * fVar7 + fVar10 * fVar10 + fVar11 * fVar11;
  fVar7 = (float)(0x5f3759df - ((int)fVar10 >> 1));
  fVar7 = fVar7 * (1.5 - fVar7 * fVar7 * fVar10 * 0.5);
  if (*(float *)(param_1[0x45d] + 8) + *(float *)(param_1 + 0x32a) <=
      (1.5 - fVar7 * fVar7 * fVar10 * 0.5) * fVar7 * fVar10) {
    *(float *)(param_1 + 0x2f) = fVar8 * fVar6 + fVar4;
    *(float *)(param_1 + 0x30) = fVar9 * fVar6 + fVar5;
  }
  else {
    *(undefined4 *)(param_1 + 0x2f) = local_b8;
    *(undefined4 *)(param_1 + 0x30) = local_b0;
    if (3.0 < (double)param_1[0xa2] - (double)param_1[0x473]) {
      param_1[0x473] = param_1[0xa2];
      lVar2 = (**(code **)(*param_1 + 0x430))
                        (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
      if (lVar2 != 0) {
        local_c8 = *(float *)(param_1 + 0x2f) - *(float *)(lVar2 + 0x178);
        local_c4 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar2 + 0x17c);
        local_c0 = *(float *)(param_1 + 0x30) - *(float *)(lVar2 + 0x180);
        D3DXVec3Normalize(&local_c8,&local_c8);
        fVar6 = atan2f(local_c8 * *(float *)(param_1 + 0x26a) -
                       *(float *)(param_1 + 0x269) * local_c0,
                       *(float *)(param_1 + 0x26a) * local_c0 +
                       local_c8 * *(float *)(param_1 + 0x269));
        fVar4 = (fVar6 * 180.0) / 3.1415927;
        fVar6 = ABS(fVar4);
        if (*(float *)(param_1[0x45d] + 0x14) <= fVar6 && fVar6 != *(float *)(param_1[0x45d] + 0x14)
           ) {
          pwVar3 = L"lturn01";
          if (0.0 <= fVar4) {
            pwVar3 = L"rturn01";
          }
          FUN_140001710(param_1 + 0x2d0,pwVar3,7);
          (**(code **)(*param_1 + 0xbf8))(param_1);
        }
      }
    }
  }
  return;
}



undefined8 * FUN_14024add0(undefined8 *param_1)

{
  FUN_14023c570();
  param_1[0x455] = 0;
  param_1[0x457] = 0;
  param_1[0x458] = 0;
  *(undefined4 *)(param_1 + 0x459) = 0;
  *(undefined1 *)((longlong)param_1 + 0x22cc) = 0;
  param_1[0x45a] = 0;
  *param_1 = MGSCharacterExEnemy::vftable;
  param_1[0x45b] = 0;
  param_1[0x45c] = 0;
  param_1[0x45d] = 0;
  param_1[0x45e] = 0;
  param_1[0x45f] = 0;
  param_1[0x460] = 0;
  param_1[0x461] = 0;
  param_1[0x462] = 0;
  param_1[0x465] = 0;
  param_1[0x466] = 0;
  param_1[0x467] = 0;
  param_1[0x468] = 0;
  param_1[0x469] = 0;
  *(undefined2 *)(param_1 + 0x46a) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2354) = 0;
  param_1[0x46b] = 0;
  param_1[0x46e] = 0;
  param_1[0x46f] = 7;
  *(undefined2 *)(param_1 + 0x46c) = 0;
  *(undefined4 *)(param_1 + 0x471) = 0;
  *(undefined8 *)((longlong)param_1 + 0x238c) = 1;
  return param_1;
}



void * FUN_14024aec0(void *param_1,uint param_2)

{
  FUN_14024aef0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14024aef0(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = MGSCharacterExEnemy::vftable;
  if (7 < (ulonglong)param_1[0x46f]) {
    operator_delete((void *)param_1[0x46c]);
  }
  param_1[0x46f] = 7;
  param_1[0x46e] = 0;
  *(undefined2 *)(param_1 + 0x46c) = 0;
  plVar3 = (longlong *)param_1[0x45e];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x45c];
  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);
      }
    }
  }
  FUN_14023c7b0(param_1);
  return;
}



void FUN_14024afc0(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  int *piVar3;
  int *piVar4;
  undefined8 *puVar5;
  undefined4 local_res8 [2];
  undefined1 local_res10 [8];
  undefined8 uVar6;
  undefined1 local_30 [8];
  longlong *local_28;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_14023c980();
  puVar5 = (undefined8 *)(*(longlong *)(param_1 + 0x130) + 200);
  if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x130) + 0xe0)) {
    puVar5 = (undefined8 *)*puVar5;
  }
  uVar6 = FUN_14033d7d0(DAT_140608220,local_30,local_res10,puVar5,uVar6);
  FUN_140343ec0(param_1 + 0x22e8,uVar6);
  if (local_28 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_28 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_28 + 8))(local_28);
      LOCK();
      piVar4 = (int *)((longlong)local_28 + 0xc);
      *piVar4 = *piVar4 + -1;
      UNLOCK();
      if (*piVar4 == 0) {
        (**(code **)(*local_28 + 0x10))(local_28);
      }
    }
  }
  lVar2 = *(longlong *)(param_1 + 0x22e8);
  if (lVar2 != 0) {
    puVar5 = (undefined8 *)(lVar2 + 0xa8);
    if (7 < *(ulonglong *)(lVar2 + 0xc0)) {
      puVar5 = (undefined8 *)*puVar5;
    }
    lVar2 = FUN_140334fd0(DAT_1406081f8,local_res10,puVar5);
    *(longlong *)(param_1 + 0x22f8) = lVar2;
    piVar4 = (int *)0x0;
    for (puVar5 = *(undefined8 **)(lVar2 + 0x28);
        (piVar3 = piVar4, puVar5 != *(undefined8 **)(lVar2 + 0x30) &&
        (piVar3 = (int *)*puVar5, *(int *)*puVar5 != 1)); puVar5 = puVar5 + 2) {
    }
    *(int **)(param_1 + 0x2308) = piVar3;
    puVar5 = (undefined8 *)(*(longlong *)(param_1 + 0x22e8) + 0xd0);
    if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x22e8) + 0xe8)) {
      puVar5 = (undefined8 *)*puVar5;
    }
    piVar3 = piVar4;
    if (puVar5 != (undefined8 *)0x0) {
      piVar3 = (int *)FUN_140335a40(DAT_1406081f8,local_res10);
    }
    *(int **)(param_1 + 0x2300) = piVar3;
    FUN_14024d1f0(param_1,*(undefined8 *)(param_1 + 0x2308));
    puVar5 = (undefined8 *)(*(longlong *)(param_1 + 0x22e8) + 0x170);
    if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x22e8) + 0x188)) {
      puVar5 = (undefined8 *)*puVar5;
    }
    if (puVar5 != (undefined8 *)0x0) {
      piVar4 = (int *)FUN_1403364b0(DAT_1406081f8,local_res10);
    }
    *(int **)(param_1 + 0x2318) = piVar4;
    FUN_14024b510(param_1);
    local_res8[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x22e8) + 0x1c);
    FUN_14008ea70(*(longlong *)(param_1 + 0x130) + 0x348,local_res8);
  }
  return;
}



void FUN_14024b170(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  void *pvVar3;
  
  if (*(longlong *)(param_1 + 0x22d8) == 0) {
    puVar1 = operator_new(0x58);
    puVar2 = (undefined8 *)0x0;
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = 0;
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      puVar1[4] = 0;
      puVar1[6] = param_1;
      puVar1[7] = 0;
      *(undefined1 *)(puVar1 + 8) = 0;
      *(undefined4 *)(puVar1 + 10) = 0xffffffff;
      puVar2 = puVar1;
    }
    FUN_14024f980(param_1 + 0x22d8,puVar2);
  }
  puVar2 = *(undefined8 **)(param_1 + 0x22d8);
  pvVar3 = operator_new(1);
  *puVar2 = pvVar3;
  FUN_140195bb0(puVar2 + 2,0xb);
  FUN_14027e210(puVar2);
  return;
}



void FUN_14024b210(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  int *piVar3;
  int *piVar4;
  undefined8 *puVar5;
  undefined4 local_res8 [2];
  undefined1 local_res10 [8];
  undefined8 uVar6;
  undefined1 local_30 [8];
  longlong *local_28;
  
  uVar6 = 0xfffffffffffffffe;
  FUN_14023ce10();
  puVar5 = (undefined8 *)(*(longlong *)(param_1 + 0x130) + 200);
  if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x130) + 0xe0)) {
    puVar5 = (undefined8 *)*puVar5;
  }
  uVar6 = FUN_14033d7d0(DAT_140608220,local_30,local_res10,puVar5,uVar6);
  FUN_140343ec0(param_1 + 0x22e8,uVar6);
  if (local_28 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_28 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_28 + 8))(local_28);
      LOCK();
      piVar4 = (int *)((longlong)local_28 + 0xc);
      *piVar4 = *piVar4 + -1;
      UNLOCK();
      if (*piVar4 == 0) {
        (**(code **)(*local_28 + 0x10))(local_28);
      }
    }
  }
  lVar2 = *(longlong *)(param_1 + 0x22e8);
  if (lVar2 != 0) {
    puVar5 = (undefined8 *)(lVar2 + 0xa8);
    if (7 < *(ulonglong *)(lVar2 + 0xc0)) {
      puVar5 = (undefined8 *)*puVar5;
    }
    lVar2 = FUN_140334fd0(DAT_1406081f8,local_res10,puVar5);
    *(longlong *)(param_1 + 0x22f8) = lVar2;
    piVar4 = (int *)0x0;
    for (puVar5 = *(undefined8 **)(lVar2 + 0x28);
        (piVar3 = piVar4, puVar5 != *(undefined8 **)(lVar2 + 0x30) &&
        (piVar3 = (int *)*puVar5, *(int *)*puVar5 != 1)); puVar5 = puVar5 + 2) {
    }
    *(int **)(param_1 + 0x2308) = piVar3;
    puVar5 = (undefined8 *)(*(longlong *)(param_1 + 0x22e8) + 0xd0);
    if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x22e8) + 0xe8)) {
      puVar5 = (undefined8 *)*puVar5;
    }
    piVar3 = piVar4;
    if (puVar5 != (undefined8 *)0x0) {
      piVar3 = (int *)FUN_140335a40(DAT_1406081f8,local_res10);
    }
    *(int **)(param_1 + 0x2300) = piVar3;
    FUN_14024d1f0(param_1,*(undefined8 *)(param_1 + 0x2308));
    puVar5 = (undefined8 *)(*(longlong *)(param_1 + 0x22e8) + 0x170);
    if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x22e8) + 0x188)) {
      puVar5 = (undefined8 *)*puVar5;
    }
    if (puVar5 != (undefined8 *)0x0) {
      piVar4 = (int *)FUN_1403364b0(DAT_1406081f8,local_res10);
    }
    *(int **)(param_1 + 0x2318) = piVar4;
    FUN_14024b510(param_1);
    local_res8[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x22e8) + 0x1c);
    FUN_14008ea70(*(longlong *)(param_1 + 0x130) + 0x348,local_res8);
  }
  return;
}



undefined8 FUN_14024b3c0(longlong *param_1,uint param_2)

{
  longlong lVar1;
  undefined4 uVar2;
  uint *puVar3;
  
  if (param_2 == 0) {
    param_2 = *(uint *)(param_1[0x461] + 0x38);
  }
  lVar1 = *(longlong *)(param_1[0x463] + 0x30);
  if (lVar1 != 0) {
    for (puVar3 = *(uint **)(lVar1 + ((ulonglong)param_2 %
                                     (ulonglong)*(uint *)(param_1[0x463] + 0x40)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 6)) {
      if ((puVar3[8] == param_2) && (*puVar3 == param_2)) goto LAB_14024b416;
    }
  }
  puVar3 = (uint *)0x0;
LAB_14024b416:
  if ((puVar3 != (uint *)0x0) && (lVar1 = *(longlong *)(puVar3 + 2), lVar1 != 0)) {
    uVar2 = 1;
    if (*(int *)(lVar1 + 0x20) == 1) {
      uVar2 = 3;
    }
    *(undefined4 *)((longlong)param_1 + 0x238c) = uVar2;
    (**(code **)(*param_1 + 0xb48))(param_1,*(undefined4 *)(lVar1 + 0x1c));
    uVar2 = *(undefined4 *)(lVar1 + 0x18);
    *(undefined4 *)(param_1 + 0x3c6) = uVar2;
    *(undefined4 *)((longlong)param_1 + 0x1e2c) = uVar2;
    (**(code **)(*param_1 + 200))(param_1,0x46);
    return 1;
  }
  return 0;
}



undefined8 FUN_14024b490(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = FUN_140341860(param_1[0x464]);
  if (lVar1 != 0) {
    lVar2 = (**(code **)(*param_1 + 0x430))
                      (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    if (lVar2 != 0) {
      FUN_14024f060(param_1,lVar1,lVar2);
      (**(code **)(*param_1 + 200))(param_1,0x4a);
      return 1;
    }
  }
  return 0;
}



void FUN_14024b510(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  uint uVar4;
  char *pcVar5;
  ulonglong uVar6;
  longlong lVar7;
  longlong lVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined4 *puVar11;
  undefined8 *puVar12;
  
  if ((((*(longlong *)(param_1 + 0x1e80) != 0) &&
       (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30), lVar3 != 0)) &&
      (*(longlong *)(lVar3 + 0x2d0) != 0)) &&
     ((lVar3 = *(longlong *)(lVar3 + 0x2d0), lVar3 != 0 &&
      (lVar10 = *(longlong *)(param_1 + 0x22e8), lVar10 != 0)))) {
    puVar12 = (undefined8 *)(lVar10 + 0x198);
    if (7 < *(ulonglong *)(lVar10 + 0x1b0)) {
      puVar12 = (undefined8 *)*puVar12;
    }
    if (puVar12 == (undefined8 *)0x0) {
      pcVar5 = (char *)0x0;
    }
    else {
      pcVar5 = (char *)FUN_1403369a0(DAT_1406081f8);
    }
    *(char **)(param_1 + 0x2320) = pcVar5;
    if ((pcVar5 != (char *)0x0) && (*pcVar5 != '\x01')) {
      if (*(longlong *)(pcVar5 + 0x38) != 0) {
        uVar6 = 0;
        if (*(uint *)(pcVar5 + 0x40) != 0) {
          plVar9 = *(longlong **)(pcVar5 + 0x30);
          do {
            if (*plVar9 != 0) {
              lVar10 = (*(longlong **)(pcVar5 + 0x30))[uVar6];
              goto LAB_14024b600;
            }
            uVar4 = (int)uVar6 + 1;
            uVar6 = (ulonglong)uVar4;
            plVar9 = plVar9 + 1;
          } while (uVar4 < *(uint *)(pcVar5 + 0x40));
        }
      }
      lVar10 = 0;
LAB_14024b600:
      lVar8 = lVar10;
      if (lVar8 != 0) {
        lVar10 = *(longlong *)(lVar8 + 8);
        plVar9 = *(longlong **)(lVar8 + 0x10);
        if (plVar9 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar9 + 1) = (int)plVar9[1] + 1;
          UNLOCK();
        }
        if ((*(int *)(lVar10 + 4) != 0) &&
           (puVar11 = *(undefined4 **)(lVar10 + 0x100), puVar11 != *(undefined4 **)(lVar10 + 0x108))
           ) {
          do {
            lVar7 = FUN_1402bc270(lVar3);
            if ((lVar7 != 0) || (lVar7 = FUN_1402bc090(lVar3), lVar7 != 0)) {
              *puVar11 = *(undefined4 *)(lVar7 + 0x68);
              puVar11[1] = *(undefined4 *)(lVar7 + 0x6c);
              puVar11[2] = *(undefined4 *)(lVar7 + 0x70);
            }
            puVar11 = puVar11 + 0xe;
          } while (puVar11 != *(undefined4 **)(lVar10 + 0x108));
        }
        if (plVar9 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar9 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar9 + 8))(plVar9);
            LOCK();
            piVar2 = (int *)((longlong)plVar9 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar9 + 0x10))();
            }
          }
        }
        lVar10 = *(longlong *)(lVar8 + 0x18);
        if (lVar10 == 0) {
          uVar4 = *(uint *)(lVar8 + 0x20) % *(uint *)(pcVar5 + 0x40) + 1;
          lVar8 = (longlong)(int)uVar4 << 3;
          do {
            if (*(uint *)(pcVar5 + 0x40) <= uVar4) break;
            if (*(longlong *)(*(longlong *)(pcVar5 + 0x30) + lVar8) != 0) {
              lVar10 = *(longlong *)(*(longlong *)(pcVar5 + 0x30) + lVar8);
            }
            uVar4 = uVar4 + 1;
            lVar8 = lVar8 + 8;
          } while (lVar10 == 0);
        }
        goto LAB_14024b600;
      }
      **(undefined1 **)(param_1 + 0x2320) = 1;
    }
  }
  return;
}



void FUN_14024b750(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x1814) = 0;
  FUN_14024d7d0();
  return;
}



void FUN_14024b760(longlong param_1)

{
  FUN_14027e400(*(undefined8 *)(param_1 + 0x22d8));
  return;
}



void FUN_14024b770(undefined8 param_1)

{
  FUN_140240520(param_1,0x49);
  return;
}



void FUN_14024b780(longlong *param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014024b783. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x100))();
  return;
}



void FUN_14024b790(longlong *param_1,uint *param_2)

{
  WCHAR WVar1;
  undefined8 uVar2;
  int iVar3;
  longlong lVar4;
  LPCWSTR pWVar5;
  LPCWSTR pWVar6;
  WCHAR *pWVar7;
  bool bVar8;
  CHAR local_108;
  undefined1 local_107 [255];
  
  if (*(int *)((longlong)param_1 + 300) == 0x4e) {
                    // WARNING: Could not recover jumptable at 0x00014024b9c8. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(*param_1 + 0x960))();
    return;
  }
  if ((*param_2 & 1) == 0) {
    if ((*param_2 & 2) != 0) {
      if (*(int *)((longlong)param_1 + 0x234c) == 1) {
        local_108 = '\0';
        memset(local_107,0,0xff);
        pWVar5 = (LPCWSTR)(param_1 + 0x299);
        bVar8 = param_1[0x29c] == 8;
        if (7 < (ulonglong)param_1[0x29c]) {
          pWVar5 = *(LPCWSTR *)pWVar5;
        }
        lVar4 = 1;
        pWVar6 = pWVar5;
        pWVar7 = L"";
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          bVar8 = *pWVar6 == *pWVar7;
          pWVar6 = pWVar6 + 1;
          pWVar7 = pWVar7 + 1;
        } while (bVar8);
        if ((bVar8) && (pWVar5 = (LPCWSTR)(param_1 + 0x2cb), 7 < (ulonglong)param_1[0x2ce])) {
          pWVar5 = *(LPCWSTR *)pWVar5;
        }
        lVar4 = -1;
        pWVar6 = pWVar5;
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          WVar1 = *pWVar6;
          pWVar6 = pWVar6 + 1;
        } while (WVar1 != L'\0');
        WideCharToMultiByte(0,0,pWVar5,~(uint)lVar4,&local_108,0x100,(LPCSTR)0x0,(LPBOOL)0x0);
        uVar2 = *(undefined8 *)(param_1[0x3d0] + 0x30);
        iVar3 = FUN_140246e10(uVar2,&local_108);
        if (iVar3 < (int)param_1[0x469]) {
          FUN_140246d80(uVar2,&local_108,iVar3 + 1);
        }
      }
      else {
        pWVar5 = (LPCWSTR)(param_1 + 0x299);
        bVar8 = param_1[0x29c] == 8;
        if (7 < (ulonglong)param_1[0x29c]) {
          pWVar5 = *(LPCWSTR *)pWVar5;
        }
        lVar4 = 1;
        pWVar6 = pWVar5;
        pWVar7 = L"";
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          bVar8 = *pWVar6 == *pWVar7;
          pWVar6 = pWVar6 + 1;
          pWVar7 = pWVar7 + 1;
        } while (bVar8);
        if ((bVar8) && (pWVar5 = (LPCWSTR)(param_1 + 0x2cb), 7 < (ulonglong)param_1[0x2ce])) {
          pWVar5 = *(LPCWSTR *)pWVar5;
        }
        local_108 = '\0';
        memset(local_107,0,0xff);
        lVar4 = -1;
        pWVar6 = pWVar5;
        do {
          if (lVar4 == 0) break;
          lVar4 = lVar4 + -1;
          WVar1 = *pWVar6;
          pWVar6 = pWVar6 + 1;
        } while (WVar1 != L'\0');
        WideCharToMultiByte(0,0,pWVar5,~(uint)lVar4,&local_108,0x100,(LPCSTR)0x0,(LPBOOL)0x0);
        FUN_140246d80(*(undefined8 *)(param_1[0x3d0] + 0x30),&local_108,(int)param_1[0x469]);
      }
    }
  }
  else if ((param_1[0x461] != 0) && (*(int *)(param_1[0x461] + 0x20) == 2)) {
    *(undefined1 *)(param_1 + 0x46a) = 1;
    FUN_14021d6c0();
    return;
  }
  FUN_14021d6c0(param_1,param_2);
  return;
}



longlong FUN_14024b9d0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 0x2360);
  if (*(longlong *)(param_1 + 0x2370) != 0) {
    if (7 < *(ulonglong *)(param_1 + 0x2378)) {
      plVar1 = (longlong *)*plVar1;
    }
    return (longlong)plVar1;
  }
  return param_2;
}



undefined1 FUN_14024ba00(longlong *param_1,longlong param_2)

{
  undefined1 uVar1;
  undefined8 *puVar2;
  int *piVar3;
  
  uVar1 = FUN_14023ff30(param_1,param_2,0);
  (**(code **)(*param_1 + 0x118))
            (param_1,*(undefined4 *)(param_2 + 0x38),*(undefined4 *)((longlong)param_1 + 0x22d4));
  if (*(int *)(param_2 + 0x68) == 1) {
    for (puVar2 = *(undefined8 **)(param_1[0x45f] + 0x28);
        puVar2 != *(undefined8 **)(param_1[0x45f] + 0x30); puVar2 = puVar2 + 2) {
      piVar3 = (int *)*puVar2;
      if (*piVar3 == *(int *)(param_1[0x461] + 0xc)) goto LAB_14024ba73;
    }
    piVar3 = (int *)0x0;
LAB_14024ba73:
    FUN_14024d1f0(param_1,piVar3);
  }
  return uVar1;
}



ulonglong FUN_14024ba90(longlong *param_1,undefined8 param_2)

{
  longlong lVar1;
  char cVar2;
  byte bVar3;
  int iVar4;
  ulonglong uVar5;
  longlong *plVar6;
  longlong *plVar7;
  undefined1 local_res8 [8];
  
  uVar5 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  bVar3 = 0;
  if (((uVar5 == 0) || (param_1[0x461] == 0)) || (param_1[0x462] == 0)) {
    return uVar5 & 0xffffffffffffff00;
  }
  cVar2 = FUN_14024c610(param_1);
  if ((cVar2 == '\0') && (iVar4 = FUN_14024c6e0(param_1,1), iVar4 != 0)) {
    plVar6 = (longlong *)param_1[0x401];
    if (plVar6 != (longlong *)param_1[0x402]) {
      do {
        lVar1 = plVar6[1];
        if ((lVar1 != 0) && (*(int *)(lVar1 + 4) == iVar4)) {
          *plVar6 = param_1[0xa2];
          FUN_14023a8b0(param_1 + 0xaf,lVar1 + 0x48);
          *(undefined4 *)((longlong)param_1 + 0x1ec4) = *(undefined4 *)(lVar1 + 0xc);
          FUN_140237940(param_1,*(undefined4 *)(lVar1 + 0xc),uVar5,1);
          *(int *)(param_1 + 0x3db) = iVar4;
          if (param_1[0xaf] == param_1[0xb0]) {
            *(undefined1 *)(param_1 + 0x3d8) = 1;
            bVar3 = (**(code **)(*param_1 + 0x8f8))
                              (param_1,L"attack01",*(undefined4 *)((longlong)param_1 + 0x1814),
                               0x3f800000,1,0,0);
          }
          else {
            *(bool *)(param_1 + 0x3d8) = (ulonglong)((param_1[0xb0] - param_1[0xaf]) / 0x30) < 2;
            (**(code **)(*param_1 + 0xbf0))(param_1,0);
            plVar6 = (longlong *)param_1[0xaf];
            plVar7 = plVar6;
            if (7 < (ulonglong)plVar6[3]) {
              plVar7 = (longlong *)*plVar6;
            }
            bVar3 = (**(code **)(*param_1 + 0x8f8))(param_1,plVar7,(int)plVar6[5],0x3f800000,1,0,0);
            FUN_14023aaa0(param_1 + 0xaf,local_res8,param_1[0xaf]);
            FUN_1402fc3f0(param_1,param_2);
          }
          *(bool *)((longlong)param_1 + 0x22cc) = (char)param_1[0x3d8] == '\0';
          goto LAB_14024bcda;
        }
        plVar6 = plVar6 + 2;
      } while (plVar6 != (longlong *)param_1[0x402]);
    }
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    FUN_1402fc3f0(param_1,param_2);
    plVar6 = param_1 + 0x1a;
    if (7 < (ulonglong)param_1[0x1d]) {
      plVar6 = (longlong *)*plVar6;
    }
    uVar5 = FUN_140418da0(DAT_140607fd8,L"NOT COMBO : \"%s %d\" ",plVar6,iVar4);
    uVar5 = uVar5 & 0xffffffffffffff00;
  }
  else {
LAB_14024bcda:
    iVar4 = *(int *)((longlong)param_1 + 300);
    if (9 < iVar4) {
      if (iVar4 < 0xc) {
        if ((param_1[0x2c3] == 0) && (param_1[0xaf] != param_1[0xb0])) {
          FUN_140237940(param_1,*(undefined4 *)((longlong)param_1 + 0x1ec4),uVar5,0);
          plVar6 = (longlong *)param_1[0xaf];
          plVar7 = plVar6;
          if (7 < (ulonglong)plVar6[3]) {
            plVar7 = (longlong *)*plVar6;
          }
          bVar3 = (**(code **)(*param_1 + 0x8f8))(param_1,plVar7,(int)plVar6[5],0x3f800000,1,0,0);
          FUN_14023aaa0(param_1 + 0xaf,local_res8,param_1[0xaf]);
          FUN_1402fc3f0(param_1,param_2);
          *(bool *)((longlong)param_1 + 0x22cc) = param_1[0xaf] != param_1[0xb0];
        }
      }
      else if (iVar4 == 0xd) {
        FUN_1402fc3f0(param_1,param_2);
        bVar3 = 1;
      }
    }
    uVar5 = (ulonglong)bVar3;
  }
  return uVar5;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

longlong FUN_14024bde0(longlong param_1,longlong param_2,uint param_3)

{
  float *pfVar1;
  longlong lVar2;
  ulonglong uVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  longlong lVar7;
  float *pfVar8;
  longlong lVar9;
  uint *puVar10;
  longlong lVar11;
  undefined1 *puVar12;
  char *pcVar13;
  longlong *plVar14;
  char *pcVar15;
  longlong *plVar16;
  undefined1 *puVar17;
  short *psVar18;
  bool bVar19;
  float fVar20;
  float fVar21;
  float fVar22;
  float fVar23;
  float local_res20 [2];
  float local_e8;
  float local_e4;
  float local_e0;
  float local_d8;
  float local_d4;
  float local_d0;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined1 local_a8 [112];
  
  if (param_2 != 0) {
    lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x2318) + 0x30);
    if (lVar2 != 0) {
      for (puVar10 = *(uint **)(lVar2 + ((ulonglong)param_3 %
                                        (ulonglong)*(uint *)(*(longlong *)(param_1 + 0x2318) + 0x40)
                                        ) * 8); puVar10 != (uint *)0x0;
          puVar10 = *(uint **)(puVar10 + 6)) {
        if ((puVar10[8] == param_3) && (*puVar10 == param_3)) goto LAB_14024be7d;
      }
    }
    puVar10 = (uint *)0x0;
LAB_14024be7d:
    if (puVar10 != (uint *)0x0) {
      if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar2 = *(longlong *)(puVar10 + 2);
      if (lVar2 != 0) {
        fVar23 = 0.0;
        pfVar1 = (float *)(param_2 + 0x178);
        fVar21 = *(float *)(param_2 + 0x180) - *(float *)(param_1 + 0x180);
        fVar20 = *(float *)(param_2 + 0x17c) - *(float *)(param_1 + 0x17c);
        fVar22 = *pfVar1 - *(float *)(param_1 + 0x178);
        fVar20 = fVar22 * fVar22 + fVar20 * fVar20 + fVar21 * fVar21;
        local_res20[0] = (float)(0x5f3759df - ((int)fVar20 >> 1));
        fVar21 = local_res20[0] * (1.5 - local_res20[0] * local_res20[0] * fVar20 * 0.5);
        fVar20 = fVar21 * (1.5 - fVar21 * fVar21 * fVar20 * 0.5) * fVar20;
        puVar17 = *(undefined1 **)(lVar2 + 0xe0);
        if (puVar17 != *(undefined1 **)(lVar2 + 0xe8)) {
          do {
            if (*(int *)(puVar17 + 0x20) == 1) {
              if (*(ulonglong *)(puVar17 + 0x68) < 8) {
                puVar12 = puVar17 + 0x50;
              }
              else {
                puVar12 = *(undefined1 **)(puVar17 + 0x50);
              }
              if ((((*(longlong *)(param_1 + 0x1e80) == 0) ||
                   (lVar7 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30), lVar7 == 0)) ||
                  (*(longlong *)(lVar7 + 0x2d0) == 0)) ||
                 (((*(longlong *)(lVar7 + 0x2d0) == 0 ||
                   (lVar7 = FUN_1402bc270(*(longlong *)(lVar7 + 0x2d0),puVar12), lVar7 == 0)) ||
                  (cVar4 = FUN_1402bbb40(lVar7 + 0x188,pfVar1), cVar4 == '\0')))) {
                *puVar17 = 0;
              }
              else {
LAB_14024bfef:
                fVar23 = fVar23 + *(float *)(puVar17 + 4);
                *puVar17 = 1;
              }
            }
            else if (*(float *)(puVar17 + 8) <= fVar20) {
              if (fVar20 < *(float *)(puVar17 + 0xc) || fVar20 == *(float *)(puVar17 + 0xc))
              goto LAB_14024bfef;
              *puVar17 = 0;
            }
            else {
              *puVar17 = 0;
            }
            puVar17 = puVar17 + 0x78;
          } while (puVar17 != *(undefined1 **)(lVar2 + 0xe8));
          if (0.0 < fVar23) {
            iVar5 = rand();
            *(undefined4 *)(param_1 + 0x1abc) = *(undefined4 *)(param_1 + 0x178);
            *(undefined4 *)(param_1 + 0x1ac0) = *(undefined4 *)(param_1 + 0x17c);
            *(undefined4 *)(param_1 + 0x1ac4) = *(undefined4 *)(param_1 + 0x180);
            fVar20 = 0.0;
            pcVar15 = *(char **)(lVar2 + 0xe0);
            if (pcVar15 != *(char **)(lVar2 + 0xe8)) {
              do {
                if (*pcVar15 != '\0') {
                  if ((fVar20 <= (float)iVar5 * 3.0517578e-05) &&
                     ((float)iVar5 * 3.0517578e-05 < fVar20 + *(float *)(pcVar15 + 4))) {
                    if (*(longlong *)(pcVar15 + 0x60) != 0) {
                      if ((((*(longlong *)(param_1 + 0x1e80) == 0) ||
                           (lVar7 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30),
                           lVar7 == 0)) || (*(longlong *)(lVar7 + 0x2d0) == 0)) ||
                         (*(longlong *)(lVar7 + 0x2d0) == 0)) goto LAB_14024c37e;
                      if (*(ulonglong *)(pcVar15 + 0x68) < 8) {
                        pcVar13 = pcVar15 + 0x50;
                      }
                      else {
                        pcVar13 = *(char **)(pcVar15 + 0x50);
                      }
                      lVar7 = FUN_1402bc270(*(longlong *)(lVar7 + 0x2d0),pcVar13);
                      if (lVar7 != 0) {
                        *(undefined4 *)(param_1 + 0x1abc) = *(undefined4 *)(lVar7 + 0x68);
                        *(undefined4 *)(param_1 + 0x1ac0) = *(undefined4 *)(lVar7 + 0x6c);
                        *(undefined4 *)(param_1 + 0x1ac4) = *(undefined4 *)(lVar7 + 0x70);
                        if (*(int *)(lVar2 + 0x10) != 0) {
                          *(int *)(param_1 + 0x2348) = *(int *)(lVar2 + 0x10);
                          *(undefined4 *)(param_1 + 0x234c) = *(undefined4 *)(lVar2 + 0x14);
                        }
                        FUN_1400015e0(param_1 + 0x1658,pcVar15 + 0x28,0,0xffffffffffffffff);
LAB_14024c3ed:
                        *(undefined4 *)(param_1 + 0x2340) = *(undefined4 *)(pcVar15 + 0x1c);
                        *(double *)(param_1 + 0x2330) = (double)*(float *)(pcVar15 + 0x14);
                        *(uint *)(param_1 + 0x2344) = param_3;
                        *(double *)(param_1 + 0x2338) = (double)*(float *)(pcVar15 + 0x18);
                        if (*(int *)(lVar2 + 8) == 0) {
                          FUN_140237940(param_1,*(undefined4 *)(lVar2 + 0xc),param_2,0);
                          return lVar2;
                        }
                        FUN_14024edc0(param_1,lVar2,param_2);
                        return lVar2;
                      }
                    }
                    local_b8 = 1;
                    local_b4 = 2;
                    local_b0 = 3;
                    local_ac = 4;
                    if ((DAT_14060b7f0 & 1) == 0) {
                      DAT_14060b7f0 = DAT_14060b7f0 | 1;
                      DAT_14060b7d0 = 0;
                      DAT_14060b7d8 = 0;
                      _DAT_14060b7e0 = 0;
                      FUN_14023b740(&DAT_14060b7d0,&local_b8,local_a8);
                      atexit(FUN_140448cd0);
                    }
                    lVar7 = 0;
                    if (DAT_14060b7d0 != DAT_14060b7d8) {
                      FUN_1401fbc30(DAT_14060b7d0);
                    }
                    local_c8 = 0;
                    local_c4 = 0x3f800000;
                    local_c0 = 0;
                    do {
                      local_e8 = *(float *)(param_1 + 0x178) - *pfVar1;
                      local_e4 = *(float *)(param_1 + 0x17c) - *(float *)(param_2 + 0x17c);
                      local_e0 = *(float *)(param_1 + 0x180) - *(float *)(param_2 + 0x180);
                      pfVar8 = (float *)FUN_140123260(&local_e8,&local_c8,
                                                      ((float)*(int *)(lVar7 + DAT_14060b7d0) * 90.0
                                                      * 3.1415927) / 180.0);
                      local_e8 = *pfVar8;
                      local_e4 = pfVar8[1];
                      local_e0 = pfVar8[2];
                      D3DXVec3Normalize(&local_e8,&local_e8);
                      fVar22 = *pfVar1 - local_e8 * *(float *)(pcVar15 + 0x10);
                      fVar21 = *(float *)(param_2 + 0x17c);
                      fVar23 = *(float *)(param_2 + 0x180) - local_e0 * *(float *)(pcVar15 + 0x10);
                      lVar9 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30);
                      plVar14 = (longlong *)(lVar9 + 0x2a0);
                      uVar3 = *(ulonglong *)(lVar9 + 0x2b8);
                      bVar19 = uVar3 == 8;
                      plVar16 = plVar14;
                      if (7 < uVar3) {
                        plVar16 = (longlong *)*plVar14;
                      }
                      lVar11 = 1;
                      psVar18 = &DAT_140477960;
                      do {
                        if (lVar11 == 0) break;
                        lVar11 = lVar11 + -1;
                        bVar19 = (short)*plVar16 == *psVar18;
                        plVar16 = (longlong *)((longlong)plVar16 + 2);
                        psVar18 = psVar18 + 1;
                      } while (bVar19);
                      local_d8 = fVar22;
                      local_d4 = fVar21;
                      local_d0 = fVar23;
                      if (bVar19) {
LAB_14024c337:
                        local_res20[0] = 0.0;
                        iVar6 = FUN_1402f9640(param_1,local_res20,&local_d8,1,1);
                        if (iVar6 == 1) {
                          *(float *)(param_1 + 0x1abc) = local_d8;
                          *(float *)(param_1 + 0x1ac0) = local_d4;
                          *(float *)(param_1 + 0x1ac4) = local_d0;
                          *(undefined4 *)(param_1 + 0x1ac0) = *(undefined4 *)(param_2 + 0x17c);
                          if (*(int *)(lVar2 + 0x10) != 0) {
                            *(int *)(param_1 + 0x2348) = *(int *)(lVar2 + 0x10);
                            *(undefined4 *)(param_1 + 0x234c) = *(undefined4 *)(lVar2 + 0x14);
                          }
                          FUN_1400015e0(param_1 + 0x1658,pcVar15 + 0x28,0,0xffffffffffffffff);
                          goto LAB_14024c3ed;
                        }
                      }
                      else {
                        if (7 < uVar3) {
                          plVar14 = (longlong *)*plVar14;
                        }
                        if (((*(longlong *)(param_1 + 0x1e80) != 0) && (lVar9 != 0)) &&
                           ((*(longlong *)(lVar9 + 0x2d0) != 0 &&
                            (lVar9 = FUN_1402bc180(*(longlong *)(lVar9 + 0x2d0),plVar14), lVar9 != 0
                            )))) {
                          lVar11 = 0;
                          pfVar8 = (float *)(lVar9 + 400);
                          do {
                            if (fVar21 * pfVar8[-1] + fVar22 * pfVar8[-2] + fVar23 * *pfVar8 +
                                pfVar8[1] < 0.0) goto LAB_14024c35e;
                            lVar11 = lVar11 + 1;
                            pfVar8 = pfVar8 + 4;
                          } while (lVar11 < 6);
                          goto LAB_14024c337;
                        }
                      }
LAB_14024c35e:
                      lVar7 = lVar7 + 4;
                    } while (lVar7 < 0x10);
                  }
                  fVar20 = fVar20 + *(float *)(pcVar15 + 4);
                }
LAB_14024c37e:
                pcVar15 = pcVar15 + 0x78;
              } while (pcVar15 != *(char **)(lVar2 + 0xe8));
            }
          }
        }
      }
    }
  }
  return 0;
}



ulonglong FUN_14024c500(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  ulonglong uVar4;
  longlong *plVar5;
  bool bVar6;
  
  lVar3 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  bVar6 = false;
  if (lVar3 == 0) {
    return 0;
  }
  uVar4 = FUN_14024c6e0(param_1,0);
  iVar2 = (int)uVar4;
  if (iVar2 == 0) {
LAB_14024c5f8:
    uVar4 = (ulonglong)bVar6;
  }
  else {
    plVar5 = (longlong *)param_1[0x401];
    if (plVar5 != (longlong *)param_1[0x402]) {
      do {
        lVar1 = plVar5[1];
        if ((lVar1 != 0) && (*(int *)(lVar1 + 4) == iVar2)) {
          *plVar5 = param_1[0xa2];
          FUN_14023a8b0(param_1 + 0xaf,lVar1 + 0x48);
          *(int *)(param_1 + 0x3db) = iVar2;
          if ((param_2 == 0) || (*(int *)(param_2 + 8) == 0)) {
            FUN_140237940(param_1,*(undefined4 *)(lVar1 + 0xc),lVar3,0);
          }
          else {
            FUN_14024edc0(param_1,param_2,lVar3);
          }
          bVar6 = param_1[0xaf] != param_1[0xb0];
          goto LAB_14024c5f8;
        }
        plVar5 = plVar5 + 2;
      } while (plVar5 != (longlong *)param_1[0x402]);
    }
    uVar4 = uVar4 & 0xffffffffffffff00;
  }
  return uVar4;
}



undefined4 FUN_14024c610(longlong param_1)

{
  switch(*(int *)(param_1 + 300) + -10) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
  case 8:
  case 10:
  case 0xb:
  case 0xc:
  case 0xd:
  case 0xe:
  case 0xf:
  case 0x10:
  case 0x2b:
  case 0x2c:
  case 0x2f:
  case 0x31:
    return 1;
  default:
    return 0;
  }
}



bool FUN_14024c680(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  longlong lVar2;
  
  if (((*(longlong *)(param_1 + 0x1e80) != 0) &&
      (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x1e80) + 0x30), lVar2 != 0)) &&
     (*(longlong *)(lVar2 + 0x2d0) != 0)) {
    lVar2 = FUN_1402bc180();
    if (lVar2 != 0) {
      cVar1 = FUN_1402bbb40(lVar2 + 0x188,param_3);
      return cVar1 != '\0';
    }
  }
  return false;
}



ulonglong FUN_14024c6e0(longlong *param_1,char param_2)

{
  WCHAR WVar1;
  uint uVar2;
  double dVar3;
  char cVar4;
  int iVar5;
  longlong lVar6;
  double *pdVar7;
  longlong lVar8;
  longlong lVar9;
  ulonglong uVar10;
  undefined1 *puVar11;
  undefined1 *puVar12;
  LPCWSTR pWVar13;
  char *pcVar14;
  LPCWSTR lpWideCharStr;
  float fVar15;
  float fVar16;
  undefined1 auVar17 [16];
  float fVar18;
  float fVar19;
  float local_1f8;
  float local_1f4;
  float local_1f0;
  longlong *local_1e8;
  undefined8 local_1e0;
  undefined8 local_1d8;
  undefined8 local_1c8;
  CHAR local_1b8;
  undefined1 local_1b7 [399];
  
  local_1c8 = 0xfffffffffffffffe;
  if ((param_2 != '\0') && (uVar2 = *(uint *)(param_1 + 0x19c), uVar2 != 0)) {
    FUN_1402fc3f0(param_1,param_1[0xa2]);
    *(undefined4 *)(param_1 + 0x19c) = 0;
    return (ulonglong)uVar2;
  }
  fVar19 = 0.0;
  lVar6 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar6 == 0) {
    return 0;
  }
  fVar16 = *(float *)(lVar6 + 0x180) - *(float *)(param_1 + 0x30);
  fVar15 = *(float *)(lVar6 + 0x17c) - *(float *)((longlong)param_1 + 0x17c);
  fVar18 = *(float *)(lVar6 + 0x178) - *(float *)(param_1 + 0x2f);
  fVar16 = fVar18 * fVar18 + fVar15 * fVar15 + fVar16 * fVar16;
  fVar15 = (float)(0x5f3759df - ((int)fVar16 >> 1));
  fVar15 = fVar15 * (1.5 - fVar15 * fVar15 * fVar16 * 0.5);
  fVar16 = fVar15 * (1.5 - fVar15 * fVar15 * fVar16 * 0.5) * fVar16;
  puVar12 = *(undefined1 **)(param_1[0x462] + 0x10);
  if (puVar12 != *(undefined1 **)(param_1[0x462] + 0x18)) {
LAB_14024c891:
    for (pdVar7 = (double *)param_1[0x401]; pdVar7 != (double *)param_1[0x402]; pdVar7 = pdVar7 + 2)
    {
      dVar3 = pdVar7[1];
      if ((dVar3 != 0.0) && (*(int *)((longlong)dVar3 + 4) == *(int *)(puVar12 + 0x10))) {
        if (0.1 < *(float *)((longlong)dVar3 + 0x20)) {
          if (*pdVar7 <= 0.1) {
            *pdVar7 = (double)param_1[0xa2];
          }
          if ((double)param_1[0xa2] - *pdVar7 < (double)*(float *)((longlong)dVar3 + 0x20)) break;
        }
        if (fVar16 < *(float *)((longlong)dVar3 + 0x14)) {
          *puVar12 = 0;
          break;
        }
        fVar15 = *(float *)(param_1[0x462] + 0xc) + *(float *)((longlong)dVar3 + 0x18);
        if (fVar15 < fVar16) {
          *puVar12 = 0;
          fVar18 = *(float *)((longlong)dVar3 + 0x1c);
          if (0.1 < fVar18) {
            *(undefined4 *)(param_1 + 0x3d9) = 1;
            *(float *)((longlong)param_1 + 0x181c) = fVar15;
            param_1[0x3da] = (longlong)((double)fVar18 + (double)param_1[0xa2]);
            *(undefined4 *)((longlong)param_1 + 0x1ec4) = *(undefined4 *)((longlong)dVar3 + 0xc);
            FUN_14023a8b0(param_1 + 0xaf,(longlong)dVar3 + 0x48);
            goto LAB_14024cc64;
          }
          break;
        }
        iVar5 = *(int *)(param_1[0x462] + 4);
        if ((iVar5 == 1) || (iVar5 == 2)) {
          iVar5 = rand();
          if ((float)iVar5 * 3.0517578e-05 <= *(float *)(puVar12 + 4)) {
            *puVar12 = 1;
            fVar19 = fVar19 + *(float *)(puVar12 + 4);
            goto LAB_14024cc64;
          }
          break;
        }
        if (*(longlong *)(puVar12 + 0x40) != 0) {
          if (param_1[0x3d0] == 0) break;
          local_1e8 = (longlong *)0x0;
          local_1e0 = 0;
          local_1d8 = 0;
          cVar4 = (**(code **)(*param_1 + 0x180))
                            (param_1,&local_1e8,*(undefined4 *)(param_1[0x26] + 0x278));
          if (cVar4 == '\0') {
            *puVar12 = 0;
LAB_14024c9a3:
            if (local_1e8 != (longlong *)0x0) {
              operator_delete(local_1e8);
            }
            break;
          }
          lVar8 = FUN_140192f70(*(undefined8 *)(param_1[0x3d0] + 0x48),2,
                                *(undefined4 *)(*local_1e8 + 0x128));
          if ((lVar8 != 0) && (lVar9 = FUN_14022ec70(lVar8), lVar9 != 0)) {
            if (*(ulonglong *)(puVar12 + 0x48) < 8) {
              puVar11 = puVar12 + 0x30;
            }
            else {
              puVar11 = *(undefined1 **)(puVar12 + 0x30);
            }
            cVar4 = FUN_14024c680(param_1,puVar11,lVar8 + 0x178);
            if (cVar4 == '\0') {
              *puVar12 = 0;
              goto LAB_14024c9a3;
            }
          }
          if (local_1e8 != (longlong *)0x0) {
            operator_delete(local_1e8);
          }
        }
        if (*(int *)(puVar12 + 0x1c) == 0) goto LAB_14024cac3;
        local_1b8 = '\0';
        memset(local_1b7,0,0xff);
        lpWideCharStr = *(LPCWSTR *)((longlong)dVar3 + 0x48);
        if (7 < *(ulonglong *)(lpWideCharStr + 0xc)) {
          lpWideCharStr = *(LPCWSTR *)lpWideCharStr;
        }
        lVar8 = -1;
        pWVar13 = lpWideCharStr;
        goto code_r0x00014024ca61;
      }
    }
    goto LAB_14024cc01;
  }
LAB_14024ce63:
  if (*(int *)(param_1[0x462] + 4) == 1) {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    dVar3 = (double)param_1[0xa2];
    iVar5 = rand();
    param_1[0x166] = (longlong)((dVar3 - (double)((float)iVar5 * 3.0517578e-05 * 3.0)) + 1.5);
    (**(code **)(*param_1 + 0xb90))(param_1);
  }
  else if (*(int *)(param_1[0x462] + 4) == 2) {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
    dVar3 = (double)param_1[0xa2];
    iVar5 = rand();
    param_1[0x166] = (longlong)((dVar3 - (double)((float)iVar5 * 3.0517578e-05 * 3.0)) + 1.5);
  }
  return 0;
  while( true ) {
    lVar8 = lVar8 + -1;
    WVar1 = *pWVar13;
    pWVar13 = pWVar13 + 1;
    if (WVar1 == L'\0') break;
code_r0x00014024ca61:
    if (lVar8 == 0) break;
  }
  WideCharToMultiByte(0,0,lpWideCharStr,~(uint)lVar8,&local_1b8,0x100,(LPCSTR)0x0,(LPBOOL)0x0);
  iVar5 = FUN_140246e10(*(undefined8 *)(param_1[0x3d0] + 0x30),&local_1b8);
  if (*(int *)(puVar12 + 0x20) == 1) {
    if (*(int *)(puVar12 + 0x1c) <= iVar5) {
      *puVar12 = 0;
      goto LAB_14024cc01;
    }
  }
  else if (*(int *)(puVar12 + 0x1c) == iVar5) {
    *puVar12 = 0;
    goto LAB_14024cc01;
  }
LAB_14024cac3:
  if (*(int *)(puVar12 + 0x24) != 0) {
    local_1f8 = *(float *)(param_1 + 0x2f) - *(float *)(lVar6 + 0x178);
    local_1f4 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar6 + 0x17c);
    local_1f0 = *(float *)(param_1 + 0x30) - *(float *)(lVar6 + 0x180);
    D3DXVec3Normalize(&local_1f8,&local_1f8);
    fVar15 = atan2f(local_1f8 * *(float *)(param_1 + 0x26a) -
                    local_1f0 * *(float *)(param_1 + 0x269),
                    local_1f8 * *(float *)(param_1 + 0x269) +
                    local_1f0 * *(float *)(param_1 + 0x26a));
    fVar15 = (fVar15 * 180.0) / 3.1415927;
    iVar5 = *(int *)(puVar12 + 0x24);
    if (iVar5 == 1) {
      if (*(float *)(puVar12 + 0xc) <= ABS(fVar15) && ABS(fVar15) != *(float *)(puVar12 + 0xc)) {
        *puVar12 = 0;
        goto LAB_14024cc01;
      }
    }
    else if (iVar5 == 2) {
      if (ABS(fVar15) < *(float *)(puVar12 + 0xc)) {
        *puVar12 = 0;
        goto LAB_14024cc01;
      }
    }
    else if (iVar5 == 3) {
      if (fVar15 < 0.0) {
        fVar15 = fVar15 + 360.0;
      }
      if ((fVar15 < *(float *)(puVar12 + 8)) ||
         (*(float *)(puVar12 + 0xc) <= fVar15 && fVar15 != *(float *)(puVar12 + 0xc))) {
        *puVar12 = 0;
        goto LAB_14024cc01;
      }
    }
  }
  *puVar12 = 1;
  fVar19 = fVar19 + *(float *)(puVar12 + 4);
LAB_14024cc01:
  puVar12 = puVar12 + 0x58;
  if (puVar12 == *(undefined1 **)(param_1[0x462] + 0x18)) goto LAB_14024cc64;
  goto LAB_14024c891;
LAB_14024cc64:
  if (0.0 < fVar19) {
    iVar5 = rand();
    fVar19 = ceilf(fVar19 * 100.0);
    fVar19 = (((float)iVar5 / 32767.0) * (fVar19 - 0.0) + 0.0) * 0.01;
    auVar17 = ZEXT816(0);
    lVar8 = param_1[0x462];
    pcVar14 = *(char **)(lVar8 + 0x10);
    do {
      if (pcVar14 == *(char **)(lVar8 + 0x18)) {
        dVar3 = (double)param_1[0xa2];
        iVar5 = rand();
        param_1[0x166] = (longlong)((dVar3 - (double)((float)iVar5 * 3.0517578e-05 * 3.0)) + 1.5);
        *(undefined4 *)(param_1 + 0x468) = 0;
        return 0;
      }
      if (*pcVar14 != '\0') {
        fVar15 = auVar17._0_4_;
        if ((fVar15 <= fVar19) && (fVar19 < fVar15 + *(float *)(pcVar14 + 4))) {
          if ((*(longlong *)(pcVar14 + 0x40) == 0) && (*(int *)(pcVar14 + 0x24) != 0)) {
            local_1f8 = *(float *)(param_1 + 0x2f) - *(float *)(lVar6 + 0x178);
            local_1f4 = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar6 + 0x17c);
            local_1f0 = *(float *)(param_1 + 0x30) - *(float *)(lVar6 + 0x180);
            D3DXVec3Normalize(&local_1f8,&local_1f8);
            fVar19 = atan2f(local_1f8 * *(float *)(param_1 + 0x26a) -
                            local_1f0 * *(float *)(param_1 + 0x269),
                            local_1f0 * *(float *)(param_1 + 0x26a) +
                            local_1f8 * *(float *)(param_1 + 0x269));
            fVar19 = (fVar19 * 180.0) / 3.1415927;
            iVar5 = *(int *)(pcVar14 + 0x24);
            if (((iVar5 != 1) && (iVar5 != 2)) && (iVar5 == 3)) {
              if (fVar19 < 0.0) {
                fVar19 = fVar19 + 360.0;
              }
              if ((*(float *)(pcVar14 + 8) <= fVar19) && (fVar19 <= *(float *)(pcVar14 + 0xc))) {
                uVar10 = (**(code **)(*param_1 + 0xbd8))(param_1,pcVar14);
                return uVar10;
              }
            }
          }
          uVar10 = (**(code **)(*param_1 + 0xbd8))(param_1,pcVar14);
          return uVar10;
        }
        auVar17._0_4_ = fVar15 + *(float *)(pcVar14 + 4);
      }
      pcVar14 = pcVar14 + 0x58;
      lVar8 = param_1[0x462];
    } while( true );
  }
  goto LAB_14024ce63;
}



undefined4 FUN_14024cf70(longlong param_1,longlong param_2)

{
  *(undefined4 *)(param_1 + 0x1e30) = *(undefined4 *)(param_2 + 0x18);
  *(undefined4 *)(param_1 + 0x1814) = *(undefined4 *)(param_2 + 0x14);
  if (*(int *)(param_2 + 0x1c) != 0) {
    *(int *)(param_1 + 0x2348) = *(int *)(param_2 + 0x1c);
    *(undefined4 *)(param_1 + 0x234c) = *(undefined4 *)(param_2 + 0x20);
  }
  FUN_140001710(param_1 + 0x2360,&DAT_140477960,0);
  if (*(int *)(*(longlong *)(param_1 + 0x2310) + 4) == 3) {
    FUN_1400015e0(param_1 + 0x2360,param_2 + 0x30,0,0xffffffffffffffff);
  }
  *(undefined4 *)(param_1 + 0x22d0) = *(undefined4 *)(param_2 + 0x28);
  return *(undefined4 *)(param_2 + 0x10);
}



void FUN_14024d010(longlong param_1,int param_2)

{
  undefined8 *puVar1;
  int *piVar2;
  
  if (param_2 != 0) {
    for (puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x22f8) + 0x28);
        puVar1 != *(undefined8 **)(*(longlong *)(param_1 + 0x22f8) + 0x30); puVar1 = puVar1 + 2) {
      piVar2 = (int *)*puVar1;
      if (*piVar2 == param_2) goto LAB_14024d043;
    }
    piVar2 = (int *)0x0;
LAB_14024d043:
    FUN_14024d1f0(param_1,piVar2);
  }
  return;
}



void FUN_14024d050(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x2390) = param_2;
  return;
}



void FUN_14024d060(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(int *)(param_1 + 0x2390) == 0) {
    if (*(int *)(*(longlong *)(param_1 + 0x2308) + 0x14) == 5) {
      return;
    }
    *(int *)(param_1 + 0x22b8) = *(int *)(param_1 + 0x22b8) + 1;
    if (*(int *)(param_1 + 0x22b8) < *(int *)(*(longlong *)(param_1 + 0x2308) + 0x28)) {
      return;
    }
    *(undefined4 *)(param_1 + 0x22b8) = 0;
  }
  else {
    *(undefined4 *)(param_1 + 0x22b8) = 0;
  }
  uVar1 = FUN_14024d0c0(param_1);
  FUN_14024d1f0(param_1,uVar1);
  return;
}



int * FUN_14024d0c0(longlong param_1)

{
  undefined8 *puVar1;
  int *piVar2;
  int iVar3;
  longlong lVar4;
  double dVar5;
  double dVar6;
  
  if (*(int *)(param_1 + 0x2390) != 0) {
    for (puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x22f8) + 0x28);
        puVar1 != *(undefined8 **)(*(longlong *)(param_1 + 0x22f8) + 0x30); puVar1 = puVar1 + 2) {
      piVar2 = (int *)*puVar1;
      if (*piVar2 == *(int *)(param_1 + 0x2390)) goto LAB_14024d103;
    }
    piVar2 = (int *)0x0;
LAB_14024d103:
    *(undefined4 *)(param_1 + 0x2390) = 0;
    return piVar2;
  }
  lVar4 = *(longlong *)(param_1 + 0x2308);
  iVar3 = 0;
  if (*(int *)(lVar4 + 0x1c) == 0) {
    lVar4 = *(longlong *)(lVar4 + 0x88) - *(longlong *)(lVar4 + 0x80) >> 2;
    dVar5 = (double)FUN_140414fe0();
    dVar6 = (double)lVar4;
    if (lVar4 < 0) {
      dVar6 = dVar6 + 1.8446744073709552e+19;
    }
    dVar5 = dVar5 * dVar6;
  }
  else {
    if ((ulonglong)(*(longlong *)(lVar4 + 0x88) - *(longlong *)(lVar4 + 0x80) >> 2) < 2)
    goto LAB_14024d18a;
    dVar5 = (double)FUN_140414fe0();
    dVar5 = dVar5 * 2.0;
  }
  iVar3 = (int)dVar5;
LAB_14024d18a:
  lVar4 = *(longlong *)(param_1 + 0x2308);
  if (*(longlong *)(lVar4 + 0x80) == *(longlong *)(lVar4 + 0x88)) {
    iVar3 = *(int *)(param_1 + 0x22c8);
  }
  else {
    iVar3 = *(int *)(*(longlong *)(lVar4 + 0x80) + (longlong)iVar3 * 4);
  }
  puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x22f8) + 0x28);
  while( true ) {
    if (puVar1 == *(undefined8 **)(*(longlong *)(param_1 + 0x22f8) + 0x30)) {
      return (int *)0x0;
    }
    if (*(int *)*puVar1 == iVar3) break;
    puVar1 = puVar1 + 2;
  }
  return (int *)*puVar1;
}



void FUN_14024d1f0(longlong param_1,longlong param_2)

{
  float fVar1;
  undefined4 uVar2;
  uint uVar3;
  longlong lVar4;
  uint *puVar5;
  int iVar6;
  uint *puVar7;
  uint *puVar8;
  
  if (param_2 == 0) {
    return;
  }
  iVar6 = *(int *)(param_2 + 0x14);
  if (iVar6 < 0) goto LAB_14024d249;
  if (iVar6 < 2) {
LAB_14024d22a:
    *(undefined8 *)(param_1 + 0x22a8) = *(undefined8 *)(param_1 + 0x510);
  }
  else {
    if (iVar6 != 2) {
      if ((iVar6 < 5) || (7 < iVar6)) goto LAB_14024d249;
      goto LAB_14024d22a;
    }
    if (*(int *)(*(longlong *)(param_1 + 0x2308) + 0x14) != 3) goto LAB_14024d22a;
  }
  *(double *)(param_1 + 0x22b0) = (double)*(int *)(param_2 + 0x24);
LAB_14024d249:
  *(undefined1 *)(param_1 + 0x2350) = 0;
  puVar8 = (uint *)0x0;
  uVar2 = **(undefined4 **)(param_1 + 0x2308);
  *(longlong *)(param_1 + 0x2308) = param_2;
  *(undefined4 *)(param_1 + 0x22c8) = uVar2;
  fVar1 = *(float *)(param_2 + 0x44);
  *(undefined4 *)(param_1 + 0x22c0) = 0;
  *(undefined4 *)(param_1 + 0x22b8) = 0;
  *(float *)(param_1 + 0x22bc) =
       (((float)(*(int *)(param_1 + 0x8b0) + *(int *)(param_1 + 0x618)) +
        *(float *)(param_1 + 0x59c)) *
        (*(float *)(param_1 + 0x8ec) + *(float *)(param_1 + 0x734) + 1.0 + 0.0001) +
        (float)*(int *)(param_1 + 0x868) + (float)*(int *)(param_1 + 0x88c)) * fVar1;
  iVar6 = *(int *)(param_2 + 0x3c);
  if (iVar6 == 0) {
    iVar6 = *(int *)(param_1 + 0x2354);
  }
  *(int *)(param_1 + 0x2354) = iVar6;
  uVar3 = *(uint *)(param_2 + 0x30);
  lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x2300) + 0x28);
  puVar7 = puVar8;
  if (lVar4 != 0) {
    for (puVar5 = *(uint **)(lVar4 + ((ulonglong)uVar3 %
                                     (ulonglong)*(uint *)(*(longlong *)(param_1 + 0x2300) + 0x38)) *
                                     8);
        (puVar7 = puVar8, puVar5 != (uint *)0x0 &&
        ((puVar5[8] != uVar3 || (puVar7 = puVar5, *puVar5 != uVar3))));
        puVar5 = *(uint **)(puVar5 + 6)) {
    }
  }
  if (puVar7 != (uint *)0x0) {
    puVar8 = *(uint **)(puVar7 + 2);
  }
  *(uint **)(param_1 + 0x2310) = puVar8;
  FUN_14027e980(param_1);
  return;
}



void FUN_14024d360(longlong *param_1,double param_2,undefined8 param_3)

{
  int iVar1;
  longlong lVar2;
  char cVar3;
  longlong *plVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  
  if (((param_1[0x461] != 0) && (param_1[0x462] != 0)) &&
     ((*(int *)(param_1[0x461] + 0x14) != 7 ||
      ((((param_1[0x3d0] != 0 && (lVar2 = *(longlong *)(param_1[0x3d0] + 0x30), lVar2 != 0)) &&
        (lVar2 = *(longlong *)(lVar2 + 0x2d0), lVar2 != 0)) &&
       (*(char *)(*(longlong *)(lVar2 + 0x6a0) + 0x28) != '\x01')))))) {
    lVar2 = param_1[0x45b];
    if (lVar2 != 0) {
      *(double *)(lVar2 + 0x38) = param_2;
      plVar4 = (longlong *)FUN_14027df30(lVar2);
      *(longlong **)(lVar2 + 8) = plVar4;
      if (plVar4 != (longlong *)0x0) {
        (**(code **)(*plVar4 + 0x18))(plVar4,lVar2,param_2,param_3);
      }
    }
    if ((int)param_1[0x472] == 0) {
      iVar1 = *(int *)(param_1[0x461] + 0x14);
      if ((((iVar1 != 0) && (iVar1 != 4)) && ((iVar1 < 6 || (7 < iVar1)))) &&
         ((*(char *)((longlong)param_1 + 0x22cc) == '\0' &&
          ((double)param_1[0x456] <= param_2 - (double)param_1[0x455] &&
           param_2 - (double)param_1[0x455] != (double)param_1[0x456])))) {
        *(undefined1 *)((longlong)param_1 + 0x22cc) = 1;
        uVar5 = FUN_14024d0c0(param_1);
        FUN_14024d1f0(param_1,uVar5);
      }
      lVar2 = param_1[0x461];
      if (((*(int *)(lVar2 + 0x20) != 0) && (*(int *)(lVar2 + 0x20) == 1)) &&
         (*(longlong *)(lVar2 + 0x68) != 0)) {
        puVar6 = (undefined8 *)(lVar2 + 0x58);
        if (7 < *(ulonglong *)(lVar2 + 0x70)) {
          puVar6 = (undefined8 *)*puVar6;
        }
        cVar3 = FUN_14024c680(param_1,puVar6,param_1 + 0x2f);
        if (cVar3 != '\0') {
          (**(code **)(*param_1 + 0xb30))(param_1,*(undefined4 *)(param_1[0x461] + 0x34));
        }
      }
      FUN_14024d4f0(param_1);
    }
  }
  return;
}



void FUN_14024d4f0(longlong *param_1)

{
  char cVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  undefined2 local_res8 [4];
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  undefined4 local_res20 [2];
  longlong *local_70;
  longlong *local_68;
  undefined8 local_60;
  
  lVar2 = param_1[0x461];
  if ((((*(int *)(lVar2 + 0x20) == 2) && ((char)param_1[0x46a] != '\0')) && (param_1[0x3d0] != 0))
     && (((lVar4 = *(longlong *)(param_1[0x3d0] + 0x30), lVar4 != 0 &&
          (*(longlong *)(lVar4 + 0x2d0) != 0)) && (*(longlong *)(lVar4 + 0x2d0) != 0)))) {
    puVar6 = (undefined8 *)(lVar2 + 0x58);
    if (7 < *(ulonglong *)(lVar2 + 0x70)) {
      puVar6 = (undefined8 *)*puVar6;
    }
    lVar2 = FUN_1402bc180(*(longlong *)(lVar4 + 0x2d0),puVar6);
    if (lVar2 != 0) {
      local_70 = (longlong *)0x0;
      local_68 = (longlong *)0x0;
      local_60 = 0;
      cVar1 = (**(code **)(*param_1 + 0x180))
                        (param_1,&local_70,*(undefined4 *)(param_1[0x26] + 0x278));
      if ((cVar1 != '\0') && (plVar7 = local_70, local_70 != local_68)) {
        do {
          lVar2 = *plVar7;
          plVar3 = (longlong *)
                   FUN_140192f70(*(undefined8 *)(param_1[0x3d0] + 0x48),2,
                                 *(undefined4 *)(lVar2 + 0x128));
          if (*(int *)(lVar2 + 300) == 0x48) break;
          puVar6 = (undefined8 *)(param_1[0x461] + 0x58);
          if (7 < *(ulonglong *)(param_1[0x461] + 0x70)) {
            puVar6 = (undefined8 *)*puVar6;
          }
          lVar2 = FUN_14022ec70(plVar3,puVar6);
          if (((((param_1[0x3d0] != 0) && (lVar4 = *(longlong *)(param_1[0x3d0] + 0x30), lVar4 != 0)
                ) && (*(longlong *)(lVar4 + 0x2d0) != 0)) &&
              ((*(longlong *)(lVar4 + 0x2d0) != 0 && (lVar4 = FUN_1402bc180(), lVar4 != 0)))) &&
             (cVar1 = FUN_1402bbac0(lVar4 + 0x188,lVar2,*(undefined4 *)(lVar2 + 0xc)), cVar1 != '\0'
             )) {
            *(undefined1 *)(param_1 + 0x46a) = 0;
            (**(code **)(*plVar3 + 200))(plVar3,0x48,0);
            local_res18 = (undefined1)(int)(*(float *)((longlong)plVar3 + 0x154) * 125.0);
            local_res19 = (undefined1)(int)(*(float *)(plVar3 + 0x2b) * 125.0);
            local_res1a = (undefined1)(int)(*(float *)((longlong)plVar3 + 0x15c) * 125.0);
            local_res8[0] = 0;
            local_res10[0] = 0x48;
            local_res20[0] = (undefined4)plVar3[0x25];
            plVar5 = (longlong *)(**(longlong **)(param_1[0x3d0] + 0x48) + 0x380);
            (**(code **)(*plVar5 + 0x2a0))
                      (plVar5,*(undefined4 *)(param_1[0x3d0] + 8),&DAT_1405d85a0,local_res20,
                       local_res10,local_res8,plVar3 + 0x2f,&local_res18);
          }
          plVar7 = plVar7 + 1;
        } while (plVar7 != local_68);
      }
      if (local_70 != (longlong *)0x0) {
        operator_delete(local_70);
      }
    }
  }
  return;
}



void FUN_14024d7d0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined8 *puVar5;
  int iVar6;
  int *piVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  
  if (*(int *)(param_1[0x461] + 0x1c) == 0) {
    return;
  }
  if ((int)param_1[0x472] != 0) {
    return;
  }
  lVar4 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if (lVar4 == 0) {
    return;
  }
  lVar1 = param_1[0x461];
  fVar9 = *(float *)(lVar4 + 0x178) - *(float *)(param_1 + 0x2f);
  fVar10 = *(float *)(lVar4 + 0x17c) - *(float *)((longlong)param_1 + 0x17c);
  fVar8 = *(float *)(lVar4 + 0x180) - *(float *)(param_1 + 0x30);
  fVar9 = fVar10 * fVar10 + fVar9 * fVar9 + fVar8 * fVar8;
  fVar8 = (float)(0x5f3759df - ((int)fVar9 >> 1));
  fVar8 = fVar8 * (1.5 - fVar8 * fVar8 * fVar9 * 0.5);
  fVar9 = (1.5 - fVar8 * fVar8 * fVar9 * 0.5) * fVar8 * fVar9;
  if (*(int *)(lVar1 + 0x1c) == 1) {
    if (*(float *)(lVar1 + 0x48) <= fVar9) {
      return;
    }
    lVar4 = *(longlong *)(lVar1 + 0x88);
    iVar6 = 0;
    lVar2 = *(longlong *)(lVar1 + 0x80);
    *(undefined1 *)((longlong)param_1 + 0x22cc) = 1;
    if (1 < (ulonglong)(lVar4 - lVar2 >> 2)) {
      iVar6 = 2;
    }
    puVar5 = *(undefined8 **)(param_1[0x45f] + 0x28);
    puVar3 = *(undefined8 **)(param_1[0x45f] + 0x30);
    if (puVar5 != puVar3) {
      while (piVar7 = (int *)*puVar5,
            *piVar7 != *(int *)(*(longlong *)(lVar1 + 0x80) + (longlong)iVar6 * 4)) {
        puVar5 = puVar5 + 2;
        if (puVar5 == puVar3) {
          FUN_14024d1f0(param_1,0);
          return;
        }
      }
      goto LAB_14024d9c3;
    }
  }
  else {
    if (*(int *)(lVar1 + 0x1c) != 2) {
      return;
    }
    if (fVar9 < *(float *)(lVar1 + 0x48) || fVar9 == *(float *)(lVar1 + 0x48)) {
      return;
    }
    lVar4 = *(longlong *)(lVar1 + 0x88);
    iVar6 = 0;
    lVar2 = *(longlong *)(lVar1 + 0x80);
    *(undefined1 *)((longlong)param_1 + 0x22cc) = 1;
    if (1 < (ulonglong)(lVar4 - lVar2 >> 2)) {
      iVar6 = 2;
    }
    for (puVar5 = *(undefined8 **)(param_1[0x45f] + 0x28);
        puVar5 != *(undefined8 **)(param_1[0x45f] + 0x30); puVar5 = puVar5 + 2) {
      piVar7 = (int *)*puVar5;
      if (*piVar7 == *(int *)(*(longlong *)(lVar1 + 0x80) + (longlong)iVar6 * 4))
      goto LAB_14024d9c3;
    }
  }
  piVar7 = (int *)0x0;
LAB_14024d9c3:
  FUN_14024d1f0(param_1,piVar7);
  return;
}



void FUN_14024d9e0(longlong *param_1,double param_2,undefined8 param_3)

{
  short sVar1;
  int iVar2;
  uint uVar3;
  uint *puVar4;
  uint *puVar5;
  longlong lVar6;
  undefined8 *puVar7;
  ulonglong uVar8;
  undefined8 in_RDX;
  short *psVar9;
  int *piVar10;
  short *psVar11;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  iVar2 = (int)param_1[0x289];
  if (iVar2 == 0) {
    if (param_1[0x2cd] != 0) {
      if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) != 1) goto LAB_14024dc49;
      param_1[0x465] = (longlong)param_2;
      *(undefined4 *)(param_1 + 0x289) = 1;
      if (9.999999747378752e-05 < (double)param_1[0x467]) goto LAB_14024dc49;
    }
  }
  else {
    if (iVar2 != 1) {
      if (iVar2 == 2) {
        *(undefined4 *)(param_1 + 0x289) = 3;
        for (puVar7 = *(undefined8 **)(param_1[0x45f] + 0x28);
            puVar7 != *(undefined8 **)(param_1[0x45f] + 0x30); puVar7 = puVar7 + 2) {
          piVar10 = (int *)*puVar7;
          if (*piVar10 == (int)param_1[0x468]) goto LAB_14024dbc3;
        }
        piVar10 = (int *)0x0;
LAB_14024dbc3:
        FUN_14024d1f0(param_1,piVar10);
        *(undefined1 *)((longlong)param_1 + 0x1869) = 0;
        *(undefined2 *)(param_1 + 0x19a) = 0;
      }
      else if (iVar2 == 3) {
        uVar3 = *(uint *)((longlong)param_1 + 0x2344);
        lVar6 = *(longlong *)(param_1[0x463] + 0x30);
        puVar5 = (uint *)0x0;
        if (lVar6 != 0) {
          for (puVar4 = *(uint **)(lVar6 + ((ulonglong)uVar3 %
                                           (ulonglong)*(uint *)(param_1[0x463] + 0x40)) * 8);
              (puVar5 = (uint *)0x0, puVar4 != (uint *)0x0 &&
              ((puVar4[8] != uVar3 || (puVar5 = puVar4, *puVar4 != uVar3))));
              puVar4 = *(uint **)(puVar4 + 6)) {
          }
        }
        if ((puVar5 != (uint *)0x0) && (*(longlong *)(puVar5 + 2) != 0)) {
          FUN_14024c500();
        }
        if (param_1[0xaf] == param_1[0xb0]) {
          FUN_140001710(param_1 + 0x299,&DAT_14049dca8,6);
          *(undefined4 *)(param_1 + 0x381) = 0;
        }
        else {
          psVar9 = (short *)param_1[0xaf];
          if (7 < *(ulonglong *)(psVar9 + 0xc)) {
            psVar9 = *(short **)psVar9;
          }
          uVar8 = 0xffffffffffffffff;
          psVar11 = psVar9;
          do {
            if (uVar8 == 0) break;
            uVar8 = uVar8 - 1;
            sVar1 = *psVar11;
            psVar11 = psVar11 + 1;
          } while (sVar1 != 0);
          FUN_140001710(param_1 + 0x299,psVar9,~uVar8 - 1);
          *(undefined4 *)(param_1 + 0x381) = *(undefined4 *)(param_1[0xaf] + 0x28);
        }
        *(undefined4 *)(param_1 + 0x2f) = *(undefined4 *)((longlong)param_1 + 0x1abc);
        *(int *)((longlong)param_1 + 0x17c) = (int)param_1[0x358];
        *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)((longlong)param_1 + 0x1ac4);
        (**(code **)(*param_1 + 0xb58))(param_1);
        lVar6 = param_1[0xb0];
        if (param_1[0xaf] != lVar6) {
          lVar6 = FUN_14023b410(lVar6,lVar6);
          FUN_14023ae30(lVar6,param_1[0xb0]);
          param_1[0xb0] = lVar6;
        }
        (**(code **)(*param_1 + 0xb90))(param_1);
        (**(code **)(*param_1 + 200))(param_1,0x47);
        *(undefined4 *)((longlong)param_1 + 0x2344) = 0;
      }
      goto LAB_14024dc49;
    }
    if (param_2 - (double)param_1[0x465] < (double)param_1[0x467] ||
        param_2 - (double)param_1[0x465] == (double)param_1[0x467]) goto LAB_14024dc49;
    param_1[0x465] = (longlong)param_2;
  }
  *(undefined4 *)(param_1 + 0x289) = 2;
LAB_14024dc49:
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14024dc70(longlong param_1)

{
  if (*(int *)(param_1 + 0x1ec4) != 0x14) {
    FUN_14024ebc0();
    return;
  }
  FUN_14024ec60();
  return;
}



void FUN_14024dc90(longlong *param_1,double param_2)

{
  float fVar1;
  longlong lVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  undefined8 local_178;
  float local_170;
  float local_168;
  float local_164;
  float local_160;
  float local_158;
  float local_154;
  float local_150;
  float local_148;
  float local_144;
  float local_140;
  float local_138;
  float local_134;
  float local_130;
  undefined1 local_128 [16];
  undefined1 local_118 [16];
  undefined1 local_108 [16];
  undefined1 local_f8 [64];
  undefined1 local_b8 [176];
  
  lVar2 = (**(code **)(*param_1 + 0x430))
                    (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
  if ((lVar2 == 0) || (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1)) {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  else {
    local_170 = *(float *)(param_1 + 0x30) - *(float *)(lVar2 + 0x180);
    local_178._4_4_ = *(float *)((longlong)param_1 + 0x17c) - *(float *)(lVar2 + 0x17c);
    local_178._0_4_ = *(float *)(param_1 + 0x2f) - *(float *)(lVar2 + 0x178);
    D3DXVec3Normalize(&local_178,&local_178);
    fVar1 = local_170;
    fVar4 = (float)local_178;
    fVar5 = *(float *)(param_1 + 0x269);
    fVar3 = atan2f(*(float *)(param_1 + 0x26a) * (float)local_178 - local_170 * fVar5,
                   local_170 * *(float *)(param_1 + 0x26a) + fVar5 * (float)local_178);
    fVar3 = ABS((fVar3 * 180.0) / 3.1415927);
    if (1.0 <= fVar3) {
      fVar4 = atan2f(fVar1 * 0.0 - fVar4,fVar4 * 0.0 + fVar1);
      fVar5 = atan2f(*(float *)(param_1 + 0x26a) * 0.0 - fVar5,
                     fVar5 * 0.0 + *(float *)(param_1 + 0x26a));
      D3DXMatrixRotationY(local_f8,(((fVar5 * 180.0) / 3.1415927) * 3.1415927) / 180.0);
      D3DXMatrixRotationY(local_b8,(((fVar4 * 180.0) / 3.1415927) * 3.1415927) / 180.0);
      fVar5 = (float)((param_2 - (double)param_1[0x28d]) * (double)param_1[0x28b]);
      if (fVar3 < fVar5) {
        fVar5 = fVar3;
      }
      D3DXQuaternionRotationMatrix(local_118,local_f8);
      D3DXQuaternionRotationMatrix(local_108,local_b8);
      D3DXQuaternionSlerp(local_128,local_118,local_108,fVar5 / fVar3);
      D3DXMatrixRotationQuaternion(&local_168,local_128);
      if ((DAT_140608208 & 1) == 0) {
        DAT_140608208 = DAT_140608208 | 1;
      }
      local_170 = local_150 * 0.0 + local_160 * 0.0 + local_140 + local_130;
      DAT_140608210._0_4_ = local_158 * 0.0 + local_168 * 0.0 + local_148 + local_138;
      local_134 = local_154 * 0.0 + local_164 * 0.0 + local_144 + local_134;
      local_178 = CONCAT44(local_134,(float)DAT_140608210) ^ 0x80000000;
      DAT_140608210._4_4_ = local_134;
      DAT_140608218 = local_170;
      *(float *)(param_1 + 0x269) = -(float)DAT_140608210;
      *(float *)((longlong)param_1 + 0x134c) = local_134;
      *(float *)(param_1 + 0x26a) = local_170;
      D3DXVec3Normalize(param_1 + 0x269,param_1 + 0x269);
      *(undefined4 *)((longlong)param_1 + 0x134c) = 0;
      *(int *)((longlong)param_1 + 0x154) = (int)param_1[0x269];
      *(undefined4 *)(param_1 + 0x2b) = *(undefined4 *)((longlong)param_1 + 0x134c);
      *(int *)((longlong)param_1 + 0x15c) = (int)param_1[0x26a];
      *(int *)(param_1 + 0x2c) = (int)param_1[0x269];
      *(undefined4 *)((longlong)param_1 + 0x164) = *(undefined4 *)((longlong)param_1 + 0x134c);
      *(int *)(param_1 + 0x2d) = (int)param_1[0x26a];
      *(int *)((longlong)param_1 + 0x133c) = (int)param_1[0x269];
      *(undefined4 *)(param_1 + 0x268) = *(undefined4 *)((longlong)param_1 + 0x134c);
      *(int *)((longlong)param_1 + 0x1344) = (int)param_1[0x26a];
      (**(code **)(*param_1 + 0x1f0))(param_1);
    }
    else {
      *(float *)(param_1 + 0x269) = (float)local_178;
      *(float *)((longlong)param_1 + 0x134c) = local_178._4_4_;
      *(float *)(param_1 + 0x26a) = local_170;
      D3DXVec3Normalize(param_1 + 0x269,param_1 + 0x269);
      *(undefined4 *)((longlong)param_1 + 0x134c) = 0;
      *(int *)((longlong)param_1 + 0x154) = (int)param_1[0x269];
      *(undefined4 *)(param_1 + 0x2b) = *(undefined4 *)((longlong)param_1 + 0x134c);
      *(int *)((longlong)param_1 + 0x15c) = (int)param_1[0x26a];
      *(int *)(param_1 + 0x2c) = (int)param_1[0x269];
      *(undefined4 *)((longlong)param_1 + 0x164) = *(undefined4 *)((longlong)param_1 + 0x134c);
      *(int *)(param_1 + 0x2d) = (int)param_1[0x26a];
      *(int *)((longlong)param_1 + 0x133c) = (int)param_1[0x269];
      *(undefined4 *)(param_1 + 0x268) = *(undefined4 *)((longlong)param_1 + 0x134c);
      *(int *)((longlong)param_1 + 0x1344) = (int)param_1[0x26a];
      (**(code **)(*param_1 + 0x1f0))(param_1);
    }
  }
  return;
}



void FUN_14024e1a0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  short sVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 in_RDX;
  longlong *plVar4;
  short *psVar5;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    *(undefined1 *)((longlong)param_1 + 0x1869) = 0;
    *(undefined2 *)(param_1 + 0x19a) = 0;
    lVar2 = FUN_140341860(param_1[0x464],*(undefined4 *)((longlong)param_1 + 0x2354));
    if (lVar2 == 0) {
                    // WARNING: Could not recover jumptable at 0x00014024e21f. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return;
    }
    plVar4 = (longlong *)(lVar2 + 0x48);
    if (7 < *(ulonglong *)(lVar2 + 0x60)) {
      plVar4 = (longlong *)*plVar4;
    }
    uVar3 = 0xffffffffffffffff;
    psVar5 = (short *)plVar4;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      sVar1 = *psVar5;
      psVar5 = psVar5 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x2d5,plVar4,~uVar3 - 1);
    (**(code **)(*param_1 + 200))(param_1,0x4b,1);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14024e290(longlong *param_1,double param_2,undefined8 param_3)

{
  short sVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  longlong lVar5;
  float *pfVar6;
  ulonglong uVar7;
  longlong *plVar8;
  short *psVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  undefined8 in_stack_fffffffffffffe18;
  float local_1c8;
  float fStack_1c4;
  float local_1c0;
  float local_1b8;
  float local_1b4;
  float local_1b0;
  undefined8 local_1a8;
  float local_1a0;
  void *local_198;
  undefined8 local_190;
  undefined8 local_188;
  undefined8 local_178;
  undefined1 local_168 [4];
  undefined8 local_164;
  
  uVar4 = (undefined4)((ulonglong)in_stack_fffffffffffffe18 >> 0x20);
  local_178 = 0xfffffffffffffffe;
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  iVar2 = *(int *)((longlong)param_1 + 0x144c);
  if (iVar2 == 0) {
    *(undefined4 *)((longlong)param_1 + 0x144c) = 1;
    param_1[0x46b] = (longlong)param_2;
  }
  else {
    if (iVar2 != 1) {
      if (iVar2 == 2) {
        lVar5 = FUN_140341860(param_1[0x464],*(undefined4 *)((longlong)param_1 + 0x2354));
        if (lVar5 == 0) {
          (**(code **)(*param_1 + 0xd0))(param_1,0,0);
          return;
        }
        plVar8 = (longlong *)(lVar5 + 0x70);
        if (7 < *(ulonglong *)(lVar5 + 0x88)) {
          plVar8 = (longlong *)*plVar8;
        }
        uVar7 = 0xffffffffffffffff;
        psVar9 = (short *)plVar8;
        do {
          if (uVar7 == 0) break;
          uVar7 = uVar7 - 1;
          sVar1 = *psVar9;
          psVar9 = psVar9 + 1;
        } while (sVar1 != 0);
        FUN_140001710(param_1 + 0x2d5,plVar8,~uVar7 - 1);
        (**(code **)(*param_1 + 200))(param_1,0x4c);
        return;
      }
      goto LAB_14024e6fa;
    }
    if (param_1[0x45d] == 0) {
      return;
    }
    if (param_1[0x464] == 0) {
      return;
    }
    lVar5 = FUN_140341860(param_1[0x464],*(undefined4 *)((longlong)param_1 + 0x2354));
    if (lVar5 == 0) {
      *(undefined4 *)((longlong)param_1 + 0x144c) = 2;
      return;
    }
    lVar5 = param_1[0x27b];
    pfVar6 = (float *)FUN_1402cc100(*(undefined8 *)(lVar5 + 0x20),&local_1b8,
                                    (float)(double)param_1[0x28a],(longlong)param_1 + 0x1394);
    fVar10 = *(float *)(lVar5 + 0xfc);
    fVar11 = pfVar6[2];
    fVar12 = pfVar6[1];
    fVar13 = *pfVar6;
    *(float *)((longlong)param_1 + 0x184) = *(float *)(param_1 + 0x2f) - fVar10 * fVar13;
    *(float *)(param_1 + 0x31) = *(float *)((longlong)param_1 + 0x17c) - fVar10 * fVar12;
    *(float *)((longlong)param_1 + 0x18c) = *(float *)(param_1 + 0x30) - fVar10 * fVar11;
    fVar11 = *(float *)(param_1 + 0x30) - fVar10 * fVar11;
    fVar12 = *(float *)((longlong)param_1 + 0x17c) - fVar10 * fVar12;
    fVar13 = *(float *)(param_1 + 0x2f) - fVar10 * fVar13;
    local_1a8 = CONCAT44(fVar12,fVar13);
    local_1c8 = fVar13;
    fStack_1c4 = fVar12;
    local_1c0 = fVar11;
    local_1a0 = fVar11;
    D3DXVec3Normalize(&local_1a8,&local_1a8);
    fVar10 = *(float *)(param_1[0x45d] + 0x1c);
    local_1c0 = local_1a0 * fVar10 + fVar11;
    fStack_1c4 = local_1a8._4_4_ * fVar10 + fVar12;
    local_1c8 = (float)local_1a8 * fVar10 + fVar13;
    lVar5 = (longlong)param_1 + 0x524;
    local_1b8 = local_1c8;
    local_1b4 = fStack_1c4;
    local_1b0 = local_1c0;
    iVar2 = FUN_1402f98b0(param_1,&local_1b8,param_1 + 0x2f,&local_1c8,lVar5,param_1 + 0xa4,1,
                          0x447a0000);
    uVar4 = (undefined4)((ulonglong)lVar5 >> 0x20);
    if (iVar2 == 1) {
      *(float *)(param_1 + 0x2f) = local_1b8;
      *(float *)((longlong)param_1 + 0x17c) = local_1b4;
      *(float *)(param_1 + 0x30) = local_1b0;
    }
    else {
      *(undefined4 *)((longlong)param_1 + 0x144c) = 2;
    }
    *(int *)((longlong)param_1 + 0x184) = (int)param_1[0x2f];
    *(undefined4 *)(param_1 + 0x31) = *(undefined4 *)((longlong)param_1 + 0x17c);
    *(int *)((longlong)param_1 + 0x18c) = (int)param_1[0x30];
    if (param_2 - (double)param_1[0x46b] <= DAT_1405dfc58) goto LAB_14024e6fa;
    param_1[0x46b] = (longlong)param_2;
    fVar10 = *(float *)((longlong)param_1 + 0x1e9c) - *(float *)(param_1 + 0x30);
    fVar11 = *(float *)((longlong)param_1 + 0x1e94) - *(float *)(param_1 + 0x2f);
    fVar11 = fVar11 * fVar11 + fVar10 * fVar10;
    fVar10 = (float)(0x5f3759df - ((int)fVar11 >> 1));
    fVar10 = fVar10 * (1.5 - fVar10 * fVar10 * fVar11 * 0.5);
    if (param_1[0x26] == 0) {
      fVar12 = 1.0;
    }
    else {
      fVar12 = *(float *)(param_1 + 0x3ca) * *(float *)(param_1[0x26] + 0x2a8);
    }
    if (fVar10 * (1.5 - fVar10 * fVar10 * fVar11 * 0.5) * fVar11 < fVar12) {
      *(undefined4 *)((longlong)param_1 + 0x144c) = 2;
      local_168[0] = 0;
      local_164 = 0;
      FUN_1402b9ec0(local_168,(int)param_1[0x25],param_1 + 0x2f,(longlong)param_1 + 0x154);
      FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_168);
      return;
    }
  }
  *(int *)((longlong)param_1 + 0x1e94) = (int)param_1[0x2f];
  *(undefined4 *)(param_1 + 0x3d3) = *(undefined4 *)((longlong)param_1 + 0x17c);
  *(int *)((longlong)param_1 + 0x1e9c) = (int)param_1[0x30];
LAB_14024e6fa:
  if ((((param_1[0x3d0] != 0) && (lVar5 = *(longlong *)(param_1[0x3d0] + 0x30), lVar5 != 0)) &&
      (*(longlong *)(lVar5 + 0x2d0) != 0)) && (lVar5 = *(longlong *)(lVar5 + 0x2d0), lVar5 != 0)) {
    local_198 = (void *)0x0;
    local_190 = 0;
    local_188 = 0;
    uVar3 = (**(code **)(*param_1 + 0x80))(param_1);
    uVar4 = FUN_1402bec00(lVar5 + 0x370,&local_198,(longlong)param_1 + 0x524,param_1 + 0x2f,
                          CONCAT44(uVar4,uVar3));
    *(undefined4 *)(param_1 + 0xa4) = uVar4;
    (**(code **)(*param_1 + 0x8d0))(param_1,param_2,param_3);
    if (local_198 != (void *)0x0) {
      operator_delete(local_198);
    }
  }
  return;
}



void FUN_14024e7d0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  short sVar1;
  int iVar2;
  longlong lVar3;
  undefined4 *puVar4;
  ulonglong uVar5;
  short *psVar6;
  longlong lVar7;
  short *psVar8;
  double dVar9;
  double dVar10;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,param_2,param_3,1);
  iVar2 = *(int *)((longlong)param_1 + 0x144c);
  if (iVar2 == 0) {
    lVar3 = FUN_140341860(param_1[0x464],*(undefined4 *)((longlong)param_1 + 0x2354));
    if (lVar3 != 0) {
      if ((int)param_1[0x471] + 1 < *(int *)(lVar3 + 8)) {
        *(undefined4 *)((longlong)param_1 + 0x144c) = 1;
        return;
      }
      psVar6 = (short *)(lVar3 + 0x98);
      if (7 < *(ulonglong *)(lVar3 + 0xb0)) {
        psVar6 = *(short **)psVar6;
      }
      uVar5 = 0xffffffffffffffff;
      psVar8 = psVar6;
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        sVar1 = *psVar8;
        psVar8 = psVar8 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x2d5,psVar6,~uVar5 - 1);
    }
LAB_14024eaa8:
    *(undefined4 *)((longlong)param_1 + 0x144c) = 2;
    return;
  }
  if (iVar2 == 1) {
    if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
      lVar3 = FUN_140341860(param_1[0x464],*(undefined4 *)((longlong)param_1 + 0x2354));
      if (lVar3 != 0) {
        *(int *)(param_1 + 0x471) = (int)param_1[0x471] + 1;
        lVar7 = (**(code **)(*param_1 + 0x430))
                          (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
        if (lVar7 != 0) {
          FUN_14024f060(param_1,lVar3,lVar7);
                    // WARNING: Could not recover jumptable at 0x00014024ea4a. Too many branches
                    // WARNING: Treating indirect jump as call
          (**(code **)(*param_1 + 200))(param_1,0x4a);
          return;
        }
        *(undefined4 *)((longlong)param_1 + 0x144c) = 0;
        return;
      }
      goto LAB_14024eaa8;
    }
  }
  else if ((iVar2 == 2) && (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1)) {
    lVar3 = FUN_140341860(param_1[0x464],*(undefined4 *)((longlong)param_1 + 0x2354));
    if (lVar3 != 0) {
      if (1.0 < *(float *)(lVar3 + 0x18)) {
        local_34 = 0x3f800000;
        local_38 = 0;
        local_30 = 0;
        puVar4 = (undefined4 *)
                 FUN_140123260((longlong)param_1 + 0x154,&local_38,
                               (*(float *)(lVar3 + 0x18) * 3.1415927) / 180.0);
        local_28 = *puVar4;
        local_24 = puVar4[1];
        local_20 = puVar4[2];
        *(undefined1 *)(param_1 + 0x27f) = 1;
        (**(code **)(*param_1 + 0xbe8))(param_1,&local_28,1);
      }
      if (*(longlong *)(lVar3 + 0xe0) != *(longlong *)(lVar3 + 0xe8)) {
        lVar7 = *(longlong *)(lVar3 + 0xe8) - *(longlong *)(lVar3 + 0xe0) >> 2;
        dVar9 = (double)FUN_140414fe0();
        dVar10 = (double)lVar7;
        if (lVar7 < 0) {
          dVar10 = dVar10 + 1.8446744073709552e+19;
        }
        (**(code **)(*param_1 + 0xb30))
                  (param_1,*(undefined4 *)
                            (*(longlong *)(lVar3 + 0xe0) + (longlong)(int)(dVar9 * dVar10) * 4));
      }
    }
    FUN_14023ab30(param_1 + 0xaf);
    FUN_140001710(param_1 + 0x299,&DAT_140477960,0);
    FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
    FUN_1402fc3f0(param_1);
    *(undefined4 *)(param_1 + 0x471) = 0;
    (**(code **)(*param_1 + 0xd0))(param_1,1,0);
                    // WARNING: Could not recover jumptable at 0x00014024e9ac. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(*param_1 + 0xb08))(param_1,2,param_1[0xa2]);
    return;
  }
  return;
}



void FUN_14024eae0(longlong *param_1)

{
  longlong lVar1;
  int iVar2;
  
  FUN_14022cd70();
  lVar1 = param_1[0x45b];
  if (lVar1 != 0) {
    if ((*(longlong *)(lVar1 + 8) != 0) &&
       (iVar2 = (**(code **)**(undefined8 **)(lVar1 + 8))(), iVar2 == 7)) {
      return;
    }
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_14024eb30(longlong *param_1)

{
  longlong lVar1;
  int iVar2;
  
  FUN_14022cc50();
  lVar1 = param_1[0x45b];
  if (lVar1 != 0) {
    if ((*(longlong *)(lVar1 + 8) != 0) &&
       (iVar2 = (**(code **)**(undefined8 **)(lVar1 + 8))(), iVar2 == 7)) {
      return;
    }
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_14024eb80(longlong param_1)

{
  FUN_140228e50();
  if ((*(int *)(param_1 + 0x1408) == 3) &&
     (*(int *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x54) == 1)) {
    FUN_14021eb20(param_1,0,0);
  }
  return;
}



void FUN_14024ebc0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 in_RDX;
  
  if (*(int *)((longlong)param_1 + 300) != 0xf) {
    *(undefined1 *)((longlong)param_1 + 0x1824) = 0;
  }
  (**(code **)(*param_1 + 0xa08))(param_1,in_RDX,param_3,1);
  if (*(int *)(*(longlong *)(param_1[0x27b] + 0x20) + 0x54) == 1) {
    *(undefined4 *)((longlong)param_1 + 0x238c) = 1;
    if (*(int *)((longlong)param_1 + 0x1ec4) == 5) {
      *(undefined4 *)(param_1 + 0x2f) = *(undefined4 *)((longlong)param_1 + 0x1abc);
      *(int *)((longlong)param_1 + 0x17c) = (int)param_1[0x358];
      *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)((longlong)param_1 + 0x1ac4);
    }
    FUN_14021eb20(param_1,0,0);
  }
  FUN_140230d70(param_1,param_2);
  return;
}



void FUN_14024ec60(longlong param_1)

{
  if (*(int *)(param_1 + 300) != 0xf) {
    *(undefined1 *)(param_1 + 0x1824) = 0;
  }
  FUN_14024f1a0();
  if (*(int *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x54) == 1) {
    *(undefined4 *)(param_1 + 0x238c) = 1;
    if (*(int *)(param_1 + 0x1ec4) == 0x14) {
      *(undefined4 *)(param_1 + 0x178) = *(undefined4 *)(param_1 + 0x1abc);
      *(undefined4 *)(param_1 + 0x17c) = *(undefined4 *)(param_1 + 0x1ac0);
      *(undefined4 *)(param_1 + 0x180) = *(undefined4 *)(param_1 + 0x1ac4);
    }
    FUN_14021eb20(param_1,0,0);
  }
  return;
}



void FUN_14024ece0(longlong *param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 *puVar6;
  
  if ((((param_1[0x3d0] != 0) && (lVar5 = *(longlong *)(param_1[0x3d0] + 0x30), lVar5 != 0)) &&
      (lVar5 = *(longlong *)(lVar5 + 0x2d0), lVar5 != 0)) && (lVar4 = param_1[0x461], lVar4 != 0)) {
    puVar6 = (undefined8 *)(lVar4 + 0x58);
    if (7 < *(ulonglong *)(lVar4 + 0x70)) {
      puVar6 = (undefined8 *)*puVar6;
    }
    lVar5 = FUN_1402bc270(lVar5,puVar6);
    if (lVar5 != 0) {
      fVar1 = *(float *)(lVar5 + 0x68);
      fVar2 = *(float *)(lVar5 + 0x6c);
      fVar3 = *(float *)(lVar5 + 0x70);
      *(undefined1 *)(param_1 + 0x27f) = 1;
      *(undefined1 *)(param_1 + 0x348) = 1;
      *(float *)((longlong)param_1 + 0x1a44) = *(float *)(param_1 + 0x2f) - fVar1;
      *(float *)(param_1 + 0x349) = *(float *)((longlong)param_1 + 0x17c) - fVar2;
      *(float *)((longlong)param_1 + 0x1a4c) = *(float *)(param_1 + 0x30) - fVar3;
      (**(code **)(*param_1 + 0x100))(param_1);
    }
  }
  return;
}



void FUN_14024edc0(longlong *param_1,longlong param_2,undefined8 param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  int iVar5;
  undefined4 uVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  longlong *plVar10;
  
  iVar5 = *(int *)(param_2 + 8);
  if (iVar5 == 1) {
    if (((param_1[0x3d0] != 0) && (lVar9 = *(longlong *)(param_1[0x3d0] + 0x30), lVar9 != 0)) &&
       (lVar9 = *(longlong *)(lVar9 + 0x2d0), lVar9 != 0)) {
      plVar10 = (longlong *)(param_2 + 0x28);
      *(undefined4 *)(param_2 + 200) = 0;
      *(undefined4 *)(param_2 + 0xcc) = 0;
      *(undefined4 *)(param_2 + 0xd0) = 0;
      *(undefined4 *)(param_2 + 0xd4) = 0;
      *(undefined4 *)(param_2 + 0xd8) = 0;
      *(undefined4 *)(param_2 + 0xdc) = 0;
      if (7 < *(ulonglong *)(param_2 + 0x40)) {
        plVar10 = (longlong *)*plVar10;
      }
      lVar7 = FUN_1402bc270(lVar9,plVar10);
      plVar10 = (longlong *)(param_2 + 0x50);
      if (7 < *(ulonglong *)(param_2 + 0x68)) {
        plVar10 = (longlong *)*plVar10;
      }
      lVar8 = FUN_1402bc270(lVar9,plVar10);
      if ((lVar7 != 0) && (lVar8 != 0)) {
        fVar1 = *(float *)(lVar7 + 0x6c);
        fVar2 = *(float *)(lVar8 + 0x6c);
        fVar3 = *(float *)(lVar7 + 0x70);
        fVar4 = *(float *)(lVar8 + 0x70);
        *(float *)(param_2 + 200) = *(float *)(lVar7 + 0x68) - *(float *)(lVar8 + 0x68);
        *(float *)(param_2 + 0xcc) = fVar1 - fVar2;
        *(float *)(param_2 + 0xd0) = fVar3 - fVar4;
        D3DXVec3Normalize(param_2 + 200,param_2 + 200);
        *(undefined4 *)(param_2 + 8) = 2;
      }
      plVar10 = (longlong *)(param_2 + 0x78);
      if (7 < *(ulonglong *)(param_2 + 0x90)) {
        plVar10 = (longlong *)*plVar10;
      }
      lVar7 = FUN_1402bc270(lVar9,plVar10);
      plVar10 = (longlong *)(param_2 + 0xa0);
      if (7 < *(ulonglong *)(param_2 + 0xb8)) {
        plVar10 = (longlong *)*plVar10;
      }
      lVar9 = FUN_1402bc270(lVar9,plVar10);
      if ((lVar7 != 0) && (lVar9 != 0)) {
        fVar1 = *(float *)(lVar7 + 0x6c);
        fVar2 = *(float *)(lVar9 + 0x6c);
        fVar3 = *(float *)(lVar7 + 0x70);
        fVar4 = *(float *)(lVar9 + 0x70);
        *(float *)(param_2 + 0xd4) = *(float *)(lVar7 + 0x68) - *(float *)(lVar9 + 0x68);
        *(float *)(param_2 + 0xd8) = fVar1 - fVar2;
        *(float *)(param_2 + 0xdc) = fVar3 - fVar4;
        D3DXVec3Normalize(param_2 + 0xd4,param_2 + 0xd4);
        *(undefined4 *)(param_2 + 8) = 3;
      }
    }
  }
  else if (iVar5 - 2U < 2) {
    if (*(int *)((longlong)param_1 + 300) == 0x46) {
      if (iVar5 != 3) {
        FUN_140237940(param_1,*(undefined4 *)(param_2 + 0xc),param_3,0);
        return;
      }
      *(undefined4 *)((longlong)param_1 + 0x1a44) = *(undefined4 *)(param_2 + 0xd4);
      *(undefined4 *)(param_1 + 0x349) = *(undefined4 *)(param_2 + 0xd8);
      uVar6 = *(undefined4 *)(param_2 + 0xdc);
    }
    else {
      *(undefined4 *)((longlong)param_1 + 0x1a44) = *(undefined4 *)(param_2 + 200);
      *(undefined4 *)(param_1 + 0x349) = *(undefined4 *)(param_2 + 0xcc);
      uVar6 = *(undefined4 *)(param_2 + 0xd0);
    }
    *(undefined4 *)((longlong)param_1 + 0x1a4c) = uVar6;
    *(undefined1 *)(param_1 + 0x27f) = 1;
    *(undefined1 *)(param_1 + 0x348) = 1;
                    // WARNING: Could not recover jumptable at 0x00014024ee5c. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(*param_1 + 0x100))();
    return;
  }
  return;
}



void FUN_14024f060(longlong *param_1,longlong param_2,longlong param_3)

{
  short sVar1;
  ulonglong uVar2;
  longlong *plVar3;
  short *psVar4;
  undefined1 local_18 [16];
  
  FUN_140340a40(param_2,local_18,param_1 + 0x2f,param_3 + 0x178);
  plVar3 = (longlong *)(param_2 + 0x20);
  if (7 < *(ulonglong *)(param_2 + 0x38)) {
    plVar3 = (longlong *)*plVar3;
  }
  uVar2 = 0xffffffffffffffff;
  psVar4 = (short *)plVar3;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar4;
    psVar4 = psVar4 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x2d5,plVar3,~uVar2 - 1);
  *(undefined1 *)(param_1 + 0x27f) = 1;
  (**(code **)(*param_1 + 0xbe8))(param_1,local_18,1);
  return;
}



ulonglong FUN_14024f0e0(longlong param_1)

{
  uint uVar1;
  ulonglong uVar2;
  
  uVar2 = 0;
  switch(*(undefined4 *)(param_1 + 300)) {
  case 0:
  case 1:
  case 0x25:
  case 0x46:
  case 0x47:
  case 0x62:
    break;
  default:
    uVar2 = *(ulonglong *)(param_1 + 0x2308);
    if ((uVar2 == 0) || (*(int *)(uVar2 + 0x14) != 4)) {
      uVar1 = *(int *)(param_1 + 0x1e2c) - 3;
      return (ulonglong)CONCAT31((int3)(uVar1 >> 8),2 < uVar1);
    }
  }
  return uVar2 & 0xffffffffffffff00;
}



void FUN_14024f1a0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  float fVar1;
  longlong lVar2;
  longlong lVar3;
  undefined4 uVar4;
  float *pfVar5;
  float local_60;
  float local_5c;
  float local_58;
  void *local_50;
  undefined8 local_48;
  undefined8 local_40;
  
  if ((((param_1[0x3d0] != 0) && (lVar2 = *(longlong *)(param_1[0x3d0] + 0x30), lVar2 != 0)) &&
      (*(longlong *)(lVar2 + 0x2d0) != 0)) && (lVar2 = *(longlong *)(lVar2 + 0x2d0), lVar2 != 0)) {
    lVar3 = param_1[0x27b];
    pfVar5 = (float *)FUN_1402cc100(*(undefined8 *)(lVar3 + 0x20),&local_60,
                                    (float)(double)param_1[0x28a],(longlong)param_1 + 0x1394);
    fVar1 = *(float *)(lVar3 + 0xfc);
    local_58 = *(float *)(param_1 + 0x30) - fVar1 * pfVar5[2];
    local_5c = *(float *)((longlong)param_1 + 0x17c) - fVar1 * pfVar5[1];
    local_60 = *(float *)(param_1 + 0x2f) - fVar1 * *pfVar5;
    *(float *)((longlong)param_1 + 0x184) = local_60;
    *(float *)(param_1 + 0x31) = local_5c;
    *(float *)((longlong)param_1 + 0x18c) = local_58;
    local_50 = (void *)0x0;
    local_48 = 0;
    local_40 = 0;
    uVar4 = (**(code **)(*param_1 + 0x80))(param_1);
    uVar4 = FUN_1402bec00(lVar2 + 0x370,&local_50,(longlong)param_1 + 0x524,param_1 + 0x2f,uVar4);
    *(undefined4 *)(param_1 + 0xa4) = uVar4;
    (**(code **)(*param_1 + 0x8d0))(param_1,param_2,param_3);
    if (local_50 != (void *)0x0) {
      operator_delete(local_50);
    }
  }
  return;
}



ulonglong FUN_14024f330(longlong param_1,undefined8 param_2)

{
  undefined4 *puVar1;
  ulonglong uVar2;
  
  puVar1 = *(undefined4 **)(param_1 + 0x2308);
  if (((puVar1 != (undefined4 *)0x0) && (*(longlong *)(param_1 + 0x2140) != 0)) && (puVar1[5] != 4))
  {
    uVar2 = FUN_14033af00(param_2,*puVar1);
    return uVar2;
  }
  return (ulonglong)puVar1 & 0xffffffffffffff00;
}



void FUN_14024f360(longlong *param_1)

{
  if ((*(char *)((longlong)param_1 + 0x22cc) == '\0') || ((int)param_1[0x472] != 0)) {
    (**(code **)(*param_1 + 0xb90))();
  }
                    // WARNING: Could not recover jumptable at 0x00014024f391. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0xbf0))(param_1,1);
  return;
}



void FUN_14024f3a0(longlong *param_1,undefined4 param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  
  if (param_1[0x463] != 0) {
    *(undefined4 *)((longlong)param_1 + 300) = 2;
    uVar1 = (**(code **)(*param_1 + 0x430))
                      (param_1,*(undefined4 *)((longlong)param_1 + 0x53c),(int)param_1[0xa8]);
    lVar2 = FUN_14024bde0(param_1,uVar1,param_2);
    if (lVar2 != 0) {
      FUN_14024b3c0(param_1,param_2);
                    // WARNING: Could not recover jumptable at 0x00014024f413. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xb08))(param_1,0x46,param_1[0xa2]);
      return;
    }
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_14024f440(longlong *param_1,undefined4 param_2)

{
  char cVar1;
  
  if (param_1[0x464] != 0) {
    *(undefined4 *)((longlong)param_1 + 300) = 2;
    cVar1 = FUN_14024b490();
    if (cVar1 == '\x01') {
      *(undefined4 *)((longlong)param_1 + 0x2354) = param_2;
                    // WARNING: Could not recover jumptable at 0x00014024f48f. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xb08))(param_1,0x4a,param_1[0xa2]);
      return;
    }
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



undefined8 FUN_14024f4b0(longlong param_1)

{
  longlong lVar1;
  
  if ((((*(char *)(param_1 + 0x600) == '\0') && (*(char *)(param_1 + 0x601) == '\0')) &&
      (*(int *)(param_1 + 300) != 0x24)) &&
     (((lVar1 = *(longlong *)(param_1 + 0x2308), lVar1 == 0 || (*(int *)(lVar1 + 0x18) != 1)) ||
      ((((float)(*(int *)(param_1 + 0x8b0) + *(int *)(param_1 + 0x618)) +
        *(float *)(param_1 + 0x59c)) *
        (*(float *)(param_1 + 0x8ec) + *(float *)(param_1 + 0x734) + 1.0 + 0.0001) +
        (float)*(int *)(param_1 + 0x868) + (float)*(int *)(param_1 + 0x88c)) *
       *(float *)(lVar1 + 0x44) <= 0.0)))) {
    return 1;
  }
  return 0;
}



undefined8 FUN_14024f560(longlong param_1)

{
  float fVar1;
  longlong *plVar2;
  char cVar3;
  int iVar4;
  longlong *plVar5;
  longlong lVar6;
  float fVar7;
  
  cVar3 = FUN_140245110();
  if (cVar3 != '\x01') {
    lVar6 = *(longlong *)(param_1 + 0x2308);
    if ((lVar6 == 0) || (*(float *)(param_1 + 0x22bc) < *(float *)(param_1 + 0x598))) {
      return 0;
    }
    iVar4 = *(int *)(param_1 + 0x8b0) + *(int *)(param_1 + 0x618);
    fVar7 = *(float *)(param_1 + 0x8ec) + *(float *)(param_1 + 0x734) + 1.0 + 0.0001;
    if (*(int *)(lVar6 + 0x18) != 1) {
      plVar5 = *(longlong **)(*(longlong *)(param_1 + 0x22f8) + 0x28);
      plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x22f8) + 0x30);
      fVar7 = *(float *)(param_1 + 0x598) /
              (((float)iVar4 + *(float *)(param_1 + 0x59c)) * fVar7 +
               (float)*(int *)(param_1 + 0x868) + (float)*(int *)(param_1 + 0x88c));
      if (plVar5 != plVar2) {
        while (((fVar7 < *(float *)(*plVar5 + 0x44) || (*(float *)(lVar6 + 0x44) + 0.001 < fVar7))
               || (*(int *)(*plVar5 + 4) != *(int *)(lVar6 + 8)))) {
          plVar5 = plVar5 + 2;
          if (plVar5 == plVar2) {
            return 1;
          }
        }
        FUN_14024d1f0(param_1);
        *(undefined1 *)(param_1 + 0x22cc) = 1;
      }
      return 1;
    }
    fVar1 = *(float *)(lVar6 + 0x44);
    *(undefined1 *)(param_1 + 0x18dc) = 1;
    *(undefined1 *)(param_1 + 0x22cc) = 1;
    FUN_1402f88a0(param_1,(((float)iVar4 + *(float *)(param_1 + 0x59c)) * fVar7 +
                           (float)*(int *)(param_1 + 0x868) + (float)*(int *)(param_1 + 0x88c)) *
                          fVar1);
    plVar5 = *(longlong **)(*(longlong *)(param_1 + 0x22f8) + 0x28);
    plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x22f8) + 0x30);
    if (plVar5 != plVar2) {
      do {
        lVar6 = *plVar5;
        if (*(int *)(lVar6 + 4) == *(int *)(*(longlong *)(param_1 + 0x2308) + 8))
        goto LAB_14024f654;
        plVar5 = plVar5 + 2;
      } while (plVar5 != plVar2);
    }
    lVar6 = 0;
LAB_14024f654:
    FUN_14024d1f0(param_1,lVar6);
  }
  return 1;
}



void FUN_14024f710(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  double dVar3;
  double dVar4;
  
  if (*(char *)((longlong)param_1 + 0x2351) != '\0') {
    *(undefined1 *)((longlong)param_1 + 0x2351) = 0;
    if (2 < *(int *)((longlong)param_1 + 300) - 0x4aU) {
                    // WARNING: Could not recover jumptable at 0x00014024f7d7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*param_1 + 0xb90))();
      return;
    }
    if ((param_1[0x464] != 0) &&
       (lVar1 = FUN_140341860(param_1[0x464],*(undefined4 *)((longlong)param_1 + 0x2354)),
       lVar1 != 0)) {
      if (*(longlong *)(lVar1 + 0xe0) != *(longlong *)(lVar1 + 0xe8)) {
        lVar2 = *(longlong *)(lVar1 + 0xe8) - *(longlong *)(lVar1 + 0xe0) >> 2;
        dVar3 = (double)FUN_140414fe0();
        dVar4 = (double)lVar2;
        if (lVar2 < 0) {
          dVar4 = dVar4 + 1.8446744073709552e+19;
        }
        (**(code **)(*param_1 + 0xb30))
                  (param_1,*(undefined4 *)
                            (*(longlong *)(lVar1 + 0xe0) + (longlong)(int)(dVar3 * dVar4) * 4));
      }
    }
  }
  return;
}



ulonglong FUN_14024f7e0(longlong *param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  
  uVar2 = (**(code **)(*param_1 + 0x128))();
  if ((int)uVar2 != 0) {
    plVar3 = (longlong *)
             FUN_14027cfe0(*(undefined8 *)(*(longlong *)(param_1[0x3d0] + 0x30) + 0x280),
                           uVar2 & 0xffffffff);
    uVar2 = 0;
    if (plVar3 != (longlong *)0x0) {
      lVar1 = *plVar3;
      fVar6 = *(float *)(lVar1 + 0x68) - *(float *)(param_1 + 0x2f);
      fVar7 = *(float *)(lVar1 + 0x6c) - *(float *)((longlong)param_1 + 0x17c);
      fVar5 = *(float *)(lVar1 + 0x70) - *(float *)(param_1 + 0x30);
      fVar6 = fVar7 * fVar7 + fVar6 * fVar6 + fVar5 * fVar5;
      fVar5 = (float)(0x5f3759df - ((int)fVar6 >> 1));
      uVar2 = (ulonglong)(uint)fVar5;
      fVar5 = fVar5 * (1.5 - fVar5 * fVar5 * fVar6 * 0.5);
      if ((1.5 - fVar5 * fVar5 * fVar6 * 0.5) * fVar5 * fVar6 <= 300.0) {
        uVar2 = 0;
        switch(*(undefined4 *)((longlong)param_1 + 300)) {
        case 10:
        case 0xb:
        case 0xd:
        case 0xe:
        case 0xf:
        case 0x10:
        case 0x12:
        case 0x14:
        case 0x15:
        case 0x16:
        case 0x3b:
          break;
        default:
          puVar4 = (undefined8 *)(param_1[0x45d] + 0x1c0);
          if (7 < *(ulonglong *)(param_1[0x45d] + 0x1d8)) {
            puVar4 = (undefined8 *)*puVar4;
          }
          uVar2 = (**(code **)(*param_1 + 0x8f8))(param_1,puVar4,0,0x3f800000,1,0,0);
          return uVar2;
        }
      }
    }
  }
  return uVar2 & 0xffffffffffffff00;
}



void FUN_14024f980(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_14024fa00(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



undefined8 * FUN_14024fa00(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;
}



void FUN_14024fa70(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14027de90(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



undefined8 FUN_14024faa0(void)

{
  return 0x40000000;
}



undefined8 * FUN_14024fab0(float *param_1,float *param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  
  if ((DAT_140608208 & 1) == 0) {
    DAT_140608208 = DAT_140608208 | 1;
  }
  fVar1 = *param_1;
  fVar2 = param_1[1];
  fVar3 = param_1[2];
  DAT_140608210._0_4_ = fVar2 * param_2[4] + fVar1 * *param_2 + fVar3 * param_2[8] + param_2[0xc];
  DAT_140608218 = fVar1 * param_2[2] + fVar2 * param_2[6] + fVar3 * param_2[10] + param_2[0xe];
  DAT_140608210._4_4_ = fVar1 * param_2[1] + fVar2 * param_2[5] + fVar3 * param_2[9] + param_2[0xd];
  return &DAT_140608210;
}



undefined8 * FUN_14024fb70(undefined8 *param_1)

{
  FUN_14023c570();
  param_1[0x456] = 0;
  param_1[0x457] = 0;
  *(undefined1 *)(param_1 + 0x458) = 0;
  *param_1 = MGSCharacterEnemyDebugAI::vftable;
  param_1[0x455] = MGSCharacterEnemyDebugAI::vftable;
  return param_1;
}



undefined8 * FUN_14024fbc0(undefined8 *param_1,uint param_2)

{
  *param_1 = MGSCharacterEnemyDebugAI::vftable;
  param_1[0x455] = MGSCharacterDebugAI::vftable;
  FUN_14023c7b0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14024fc10(longlong param_1)

{
  FUN_14023c980();
                    // WARNING: Could not recover jumptable at 0x00014024fc2d. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x22a8) + 8))();
  return;
}



void FUN_14024fc40(longlong param_1)

{
  (**(code **)(*(longlong *)(param_1 + 0x22a8) + 0x10))();
  FUN_14023d410(param_1);
  return;
}



void FUN_14024fc70(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014024fc7a. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + -0x22a8) + 0xb00))();
  return;
}



void FUN_14024fc90(longlong param_1)

{
  FUN_14021ddc0();
                    // WARNING: Could not recover jumptable at 0x00014024fcad. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x22a8) + 8))();
  return;
}



ulonglong FUN_14024fcc0(longlong param_1)

{
  uint uVar1;
  ulonglong in_RAX;
  ulonglong uVar2;
  
  if (*(char *)(param_1 + 0x22c0) == '\0') {
    in_RAX = FUN_140240520();
    if ((char)in_RAX != '\0') {
      uVar1 = *(uint *)(param_1 + 300);
      uVar2 = (ulonglong)uVar1;
      if (4 < (int)uVar1) {
        if ((int)uVar1 < 7) {
          uVar2 = *(ulonglong *)(param_1 + 0x510);
          *(ulonglong *)(param_1 + 0x22b8) = uVar2;
        }
        else if (uVar1 == 7) {
          *(undefined8 *)(param_1 + 0x22b0) = *(undefined8 *)(param_1 + 0x510);
          return CONCAT71((int7)((ulonglong)*(undefined8 *)(param_1 + 0x510) >> 8),1);
        }
      }
      return CONCAT71((int7)(uVar2 >> 8),1);
    }
  }
  return in_RAX & 0xffffffffffffff00;
}



void FUN_14024fd30(longlong param_1,char param_2)

{
  longlong lVar1;
  
  if (param_2 != '\0') {
    FUN_14032b110();
    return;
  }
  FUN_14032ace0(*(undefined8 *)(param_1 + -0x1730),5,1);
  lVar1 = *(longlong *)(*(longlong *)(param_1 + -0x1730) + 0x1a0);
  *(double *)(lVar1 + 0x10) = *(double *)(lVar1 + 0x10) + 100000.0;
  return;
}



void FUN_14024fd90(longlong param_1)

{
  double dVar1;
  longlong *plVar2;
  undefined4 local_res8 [2];
  float local_res10 [2];
  float local_res18 [2];
  float local_res20 [2];
  
  dVar1 = *(double *)(param_1 + -0x1d98);
  local_res8[0] = 0;
  local_res20[0] = (float)(dVar1 - *(double *)(param_1 + -0x1778));
  local_res18[0] = (float)(dVar1 - *(double *)(param_1 + 8));
  local_res10[0] = (float)(dVar1 - *(double *)(param_1 + 0x10));
  plVar2 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + -0x428) + 0x48) + 0x380);
  (**(code **)(*plVar2 + 0x3e0))
            (plVar2,*(undefined4 *)(*(longlong *)(param_1 + -0x428) + 8),&DAT_1405d85a0,
             param_1 + -0x2180,param_1 + -0x3d0,local_res20,local_res18,local_res10,local_res8);
  return;
}



void FUN_14024fe50(longlong param_1)

{
  FUN_14024fbc0(param_1 + -0x22a8);
  return;
}



void FUN_14024fe60(longlong param_1)

{
  FUN_1402559f0(param_1 + -0x22a8);
  return;
}



bool FUN_14024fe70(longlong param_1)

{
  return *(int *)(param_1 + -0x217c) == 0x25;
}



longlong FUN_14024fe80(longlong param_1)

{
  return param_1 + -0x2130;
}



longlong FUN_14024fe90(longlong param_1)

{
  return param_1 + -0xf54;
}



void FUN_14024fea0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014024feaa. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + -0x22a8) + 0xaf0))();
  return;
}



undefined8 FUN_14024fec0(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0x1778);
}



undefined4 FUN_14024fed0(longlong param_1)

{
  return *(undefined4 *)(param_1 + -0x2188);
}



undefined8 FUN_14024fee0(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0xed0);
}



undefined8 FUN_14024fef0(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0x2178);
}



undefined8 * FUN_14024ff00(undefined8 *param_1,uint param_2)

{
  param_1[0x473] = MGSCharacterDebugAI::vftable;
  *param_1 = MGSCharacterEnemyBoss::vftable;
  FUN_14024aef0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14024ff50(longlong param_1)

{
  FUN_14024afc0();
  *(undefined4 *)(param_1 + 0x1e2c) = 1;
  *(undefined4 *)(param_1 + 0x1e30) = 1;
                    // WARNING: Could not recover jumptable at 0x00014024ff81. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x2398) + 8))();
  return;
}



void FUN_14024ff90(longlong param_1)

{
  undefined8 *puVar1;
  
  (**(code **)(*(longlong *)(param_1 + 0x2398) + 0x10))();
  puVar1 = *(undefined8 **)(param_1 + 0x22d8);
  if (puVar1 != (undefined8 *)0x0) {
    if ((void *)*puVar1 != (void *)0x0) {
      operator_delete((void *)*puVar1);
    }
    *puVar1 = 0;
  }
  FUN_14023d410(param_1);
  return;
}



void FUN_14024ffe0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014024ffea. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + -0x2398) + 0xb00))();
  return;
}



ulonglong FUN_140250000(longlong param_1)

{
  uint uVar1;
  ulonglong in_RAX;
  ulonglong uVar2;
  
  if (*(char *)(param_1 + 0x23b0) == '\0') {
    in_RAX = FUN_140240520();
    if ((char)in_RAX != '\0') {
      uVar1 = *(uint *)(param_1 + 300);
      uVar2 = (ulonglong)uVar1;
      if (4 < (int)uVar1) {
        if ((int)uVar1 < 7) {
          uVar2 = *(ulonglong *)(param_1 + 0x510);
          *(ulonglong *)(param_1 + 0x23a8) = uVar2;
        }
        else if (uVar1 == 7) {
          *(undefined8 *)(param_1 + 0x23a0) = *(undefined8 *)(param_1 + 0x510);
          return CONCAT71((int7)((ulonglong)*(undefined8 *)(param_1 + 0x510) >> 8),1);
        }
      }
      return CONCAT71((int7)(uVar2 >> 8),1);
    }
  }
  return in_RAX & 0xffffffffffffff00;
}



void FUN_140250070(longlong param_1)

{
  double dVar1;
  longlong *plVar2;
  float local_res8 [2];
  float local_res10 [2];
  float local_res18 [4];
  
  dVar1 = *(double *)(param_1 + -0x1e88);
  local_res18[0] = (float)(dVar1 - *(double *)(param_1 + -0x1868));
  local_res10[0] = (float)(dVar1 - *(double *)(param_1 + 8));
  local_res8[0] = (float)(dVar1 - *(double *)(param_1 + 0x10));
  plVar2 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + -0x518) + 0x48) + 0x380);
  (**(code **)(*plVar2 + 0x3e0))
            (plVar2,*(undefined4 *)(*(longlong *)(param_1 + -0x518) + 8),&DAT_1405d85a0,
             param_1 + -0x2270,param_1 + -0x4c0,local_res18,local_res10,local_res8,param_1 + -0xe0);
  return;
}



void FUN_140250120(longlong param_1)

{
  FUN_14024ff00(param_1 + -0x2398);
  return;
}



void FUN_140250130(longlong param_1)

{
  FUN_1402559f0(param_1 + -0x2398);
  return;
}



bool FUN_140250140(longlong param_1)

{
  return *(int *)(param_1 + -0x226c) == 0x25;
}



longlong FUN_140250150(longlong param_1)

{
  return param_1 + -0x2220;
}



void FUN_140250160(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014025016a. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + -0x2398) + 0xaf0))();
  return;
}



undefined8 FUN_140250180(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0x1868);
}



undefined4 FUN_140250190(longlong param_1)

{
  return *(undefined4 *)(param_1 + -0x2278);
}



undefined8 FUN_1402501a0(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0xfc0);
}



void * FUN_1402501b0(void *param_1,uint param_2)

{
  FUN_1402501e0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402501e0(undefined8 *param_1)

{
  param_1[0x479] = MGSCharacterDebugAI::vftable;
  *param_1 = MGSCharacterEnemyFixBoss::vftable;
  if ((void *)param_1[0x475] != (void *)0x0) {
    operator_delete((void *)param_1[0x475]);
  }
  param_1[0x475] = 0;
  param_1[0x476] = 0;
  param_1[0x477] = 0;
  *param_1 = MGSCharacterEnemyBoss::vftable;
  FUN_14024aef0(param_1);
  return;
}



void FUN_140250250(longlong param_1)

{
  FUN_140249430();
                    // WARNING: Could not recover jumptable at 0x00014025026d. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x23c8) + 8))();
  return;
}



void FUN_140250280(longlong param_1)

{
  (**(code **)(*(longlong *)(param_1 + 0x23c8) + 0x10))();
  FUN_1402494e0(param_1);
  return;
}



void FUN_1402502b0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001402502ba. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + -0x23c8) + 0xb00))();
  return;
}



void FUN_1402502d0(longlong param_1)

{
  FUN_14021ddc0();
                    // WARNING: Could not recover jumptable at 0x0001402502ed. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x23c8) + 8))();
  return;
}



ulonglong FUN_140250300(longlong param_1)

{
  uint uVar1;
  ulonglong in_RAX;
  ulonglong uVar2;
  
  if (*(char *)(param_1 + 0x23e0) == '\0') {
    in_RAX = FUN_140240520();
    if ((char)in_RAX != '\0') {
      uVar1 = *(uint *)(param_1 + 300);
      uVar2 = (ulonglong)uVar1;
      if (4 < (int)uVar1) {
        if ((int)uVar1 < 7) {
          uVar2 = *(ulonglong *)(param_1 + 0x510);
          *(ulonglong *)(param_1 + 0x23d8) = uVar2;
        }
        else if (uVar1 == 7) {
          *(undefined8 *)(param_1 + 0x23d0) = *(undefined8 *)(param_1 + 0x510);
          return CONCAT71((int7)((ulonglong)*(undefined8 *)(param_1 + 0x510) >> 8),1);
        }
      }
      return CONCAT71((int7)(uVar2 >> 8),1);
    }
  }
  return in_RAX & 0xffffffffffffff00;
}



void FUN_140250370(longlong param_1,char param_2)

{
  longlong lVar1;
  
  if (param_2 != '\0') {
    FUN_14032b110();
    return;
  }
  FUN_14032ace0(*(undefined8 *)(param_1 + -0x1850),5,1);
  lVar1 = *(longlong *)(*(longlong *)(param_1 + -0x1850) + 0x1a0);
  *(double *)(lVar1 + 0x10) = *(double *)(lVar1 + 0x10) + 100000.0;
  return;
}



void FUN_1402503d0(longlong param_1)

{
  double dVar1;
  longlong *plVar2;
  float local_res8 [2];
  float local_res10 [2];
  float local_res18 [4];
  
  dVar1 = *(double *)(param_1 + -0x1eb8);
  local_res18[0] = (float)(dVar1 - *(double *)(param_1 + -0x1898));
  local_res10[0] = (float)(dVar1 - *(double *)(param_1 + 8));
  local_res8[0] = (float)(dVar1 - *(double *)(param_1 + 0x10));
  plVar2 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + -0x548) + 0x48) + 0x380);
  (**(code **)(*plVar2 + 0x3e0))
            (plVar2,*(undefined4 *)(*(longlong *)(param_1 + -0x548) + 8),&DAT_1405d85a0,
             param_1 + -0x22a0,param_1 + -0x4f0,local_res18,local_res10,local_res8,param_1 + -0x110)
  ;
  return;
}



void FUN_140250480(longlong param_1)

{
  FUN_1402501b0(param_1 + -0x23c8);
  return;
}



void FUN_140250490(longlong param_1)

{
  FUN_1402559f0(param_1 + -0x23c8);
  return;
}



bool FUN_1402504a0(longlong param_1)

{
  return *(int *)(param_1 + -0x229c) == 0x25;
}



longlong FUN_1402504b0(longlong param_1)

{
  return param_1 + -0x2250;
}



longlong FUN_1402504c0(longlong param_1)

{
  return param_1 + -0x1074;
}



void FUN_1402504d0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001402504da. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + -0x23c8) + 0xaf0))();
  return;
}



undefined8 FUN_1402504f0(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0x1898);
}



undefined4 FUN_140250500(longlong param_1)

{
  return *(undefined4 *)(param_1 + -0x22a8);
}



undefined8 FUN_140250510(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0xff0);
}



undefined8 FUN_140250520(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0x2298);
}



undefined8 * FUN_140250530(undefined8 *param_1,uint param_2)

{
  param_1[0x478] = MGSCharacterDebugAI::vftable;
  *param_1 = MGSCharacterEnemyBoss::vftable;
  FUN_14024aef0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140250580(longlong param_1)

{
  FUN_14024afc0();
  *(undefined4 *)(param_1 + 0x1e2c) = 1;
  *(undefined4 *)(param_1 + 0x1e30) = 1;
                    // WARNING: Could not recover jumptable at 0x0001402505b1. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x23c0) + 8))();
  return;
}



void FUN_1402505c0(longlong param_1)

{
  undefined8 *puVar1;
  
  (**(code **)(*(longlong *)(param_1 + 0x23c0) + 0x10))();
  puVar1 = *(undefined8 **)(param_1 + 0x22d8);
  if (puVar1 != (undefined8 *)0x0) {
    if ((void *)*puVar1 != (void *)0x0) {
      operator_delete((void *)*puVar1);
    }
    *puVar1 = 0;
  }
  FUN_14023d410(param_1);
  return;
}



void FUN_140250610(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014025061a. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + -0x23c0) + 0xb00))();
  return;
}



void FUN_140250630(longlong param_1)

{
  FUN_14021ddc0();
                    // WARNING: Could not recover jumptable at 0x00014025064d. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x23c0) + 8))();
  return;
}



ulonglong FUN_140250660(longlong param_1)

{
  uint uVar1;
  ulonglong in_RAX;
  ulonglong uVar2;
  
  if (*(char *)(param_1 + 0x23d8) == '\0') {
    in_RAX = FUN_140240520();
    if ((char)in_RAX != '\0') {
      uVar1 = *(uint *)(param_1 + 300);
      uVar2 = (ulonglong)uVar1;
      if (4 < (int)uVar1) {
        if ((int)uVar1 < 7) {
          uVar2 = *(ulonglong *)(param_1 + 0x510);
          *(ulonglong *)(param_1 + 0x23d0) = uVar2;
        }
        else if (uVar1 == 7) {
          *(undefined8 *)(param_1 + 0x23c8) = *(undefined8 *)(param_1 + 0x510);
          return CONCAT71((int7)((ulonglong)*(undefined8 *)(param_1 + 0x510) >> 8),1);
        }
      }
      return CONCAT71((int7)(uVar2 >> 8),1);
    }
  }
  return in_RAX & 0xffffffffffffff00;
}



void FUN_1402506d0(longlong param_1,char param_2)

{
  longlong lVar1;
  
  if (param_2 != '\0') {
    FUN_14032b110();
    return;
  }
  FUN_14032ace0(*(undefined8 *)(param_1 + -0x1848),5,1);
  lVar1 = *(longlong *)(*(longlong *)(param_1 + -0x1848) + 0x1a0);
  *(double *)(lVar1 + 0x10) = *(double *)(lVar1 + 0x10) + 100000.0;
  return;
}



void FUN_140250730(longlong param_1)

{
  double dVar1;
  longlong *plVar2;
  float local_res8 [2];
  float local_res10 [2];
  float local_res18 [4];
  
  dVar1 = *(double *)(param_1 + -0x1eb0);
  local_res18[0] = (float)(dVar1 - *(double *)(param_1 + -0x1890));
  local_res10[0] = (float)(dVar1 - *(double *)(param_1 + 8));
  local_res8[0] = (float)(dVar1 - *(double *)(param_1 + 0x10));
  plVar2 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + -0x540) + 0x48) + 0x380);
  (**(code **)(*plVar2 + 0x3e0))
            (plVar2,*(undefined4 *)(*(longlong *)(param_1 + -0x540) + 8),&DAT_1405d85a0,
             param_1 + -0x2298,param_1 + -0x4e8,local_res18,local_res10,local_res8,param_1 + -0x108)
  ;
  return;
}



void FUN_1402507e0(longlong param_1)

{
  FUN_140250530(param_1 + -0x23c0);
  return;
}



void FUN_1402507f0(longlong param_1)

{
  FUN_1402559f0(param_1 + -0x23c0);
  return;
}



bool FUN_140250800(longlong param_1)

{
  return *(int *)(param_1 + -0x2294) == 0x25;
}



longlong FUN_140250810(longlong param_1)

{
  return param_1 + -0x2248;
}



longlong FUN_140250820(longlong param_1)

{
  return param_1 + -0x106c;
}



void FUN_140250830(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014025083a. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + -0x23c0) + 0xaf0))();
  return;
}



undefined8 FUN_140250850(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0x1890);
}



undefined4 FUN_140250860(longlong param_1)

{
  return *(undefined4 *)(param_1 + -0x22a0);
}



undefined8 FUN_140250870(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0xfe8);
}



undefined8 FUN_140250880(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0x2290);
}



undefined8 * FUN_140250890(undefined8 *param_1,uint param_2)

{
  *param_1 = MGSCharacterExEnemyDebugAI::vftable;
  param_1[0x473] = MGSCharacterDebugAI::vftable;
  FUN_14024aef0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402508e0(longlong param_1)

{
  FUN_14024afc0();
                    // WARNING: Could not recover jumptable at 0x0001402508fd. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x2398) + 8))();
  return;
}



void FUN_140250910(longlong param_1)

{
  FUN_14021ddc0();
                    // WARNING: Could not recover jumptable at 0x00014025092d. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(param_1 + 0x2398) + 8))();
  return;
}



void FUN_140250940(longlong param_1,char param_2)

{
  longlong lVar1;
  
  if (param_2 != '\0') {
    FUN_14032b110();
    return;
  }
  FUN_14032ace0(*(undefined8 *)(param_1 + -0x1820),5,1);
  lVar1 = *(longlong *)(*(longlong *)(param_1 + -0x1820) + 0x1a0);
  *(double *)(lVar1 + 0x10) = *(double *)(lVar1 + 0x10) + 100000.0;
  return;
}



void FUN_1402509a0(longlong param_1)

{
  FUN_140250890(param_1 + -0x2398);
  return;
}



longlong FUN_1402509b0(longlong param_1)

{
  return param_1 + -0x1044;
}



undefined8 FUN_1402509c0(longlong param_1)

{
  return *(undefined8 *)(param_1 + -0x2268);
}



longlong FUN_1402509d0(longlong param_1)

{
  longlong lVar1;
  longlong *plVar2;
  uint7 uVar3;
  
  plVar2 = *(longlong **)(param_1 + 0x40);
  while( true ) {
    uVar3 = (uint7)((ulonglong)plVar2 >> 8);
    if (plVar2 == *(longlong **)(param_1 + 0x48)) {
      return CONCAT71(uVar3,1);
    }
    lVar1 = *plVar2;
    if ((((*(uint *)(lVar1 + 0x148) & 2) == 0) && ((*(uint *)(lVar1 + 0x148) & 1) == 0)) &&
       ((0 < *(int *)(lVar1 + 0x68) || (*(longlong *)(lVar1 + 0x188) != *(longlong *)(lVar1 + 400)))
       )) break;
    plVar2 = plVar2 + 2;
  }
  return (ulonglong)uVar3 << 8;
}



void FUN_140250a20(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  void *pvVar3;
  longlong *plVar4;
  undefined4 *puVar5;
  undefined8 uVar6;
  longlong *local_30;
  longlong *local_28;
  
  uVar6 = 0xfffffffffffffffe;
  puVar5 = *(undefined4 **)(param_1 + 0x188);
  if (puVar5 != *(undefined4 **)(param_1 + 400)) {
    do {
      FUN_14018fa30(*(undefined8 *)(*(longlong *)(param_1 + 0x1b0) + 0x48),&local_30,*puVar5,param_4
                    ,uVar6);
      if ((local_30 != (longlong *)0x0) && (*(int *)((longlong)local_30 + 300) != 0x25)) {
        (**(code **)(*local_30 + 0x290))(local_30,*(uint *)(local_30 + 0xb3) ^ 0x80000000);
        (**(code **)(*local_30 + 200))(local_30,0x25);
      }
      plVar4 = local_28;
      if (local_28 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_28 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_28 + 8))(local_28);
          LOCK();
          piVar2 = (int *)((longlong)plVar4 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar4 + 0x10))(plVar4);
          }
        }
      }
      puVar5 = puVar5 + 1;
    } while (puVar5 != *(undefined4 **)(param_1 + 400));
  }
  pvVar3 = *(void **)(param_1 + 0x188);
  if (pvVar3 != *(void **)(param_1 + 400)) {
    memmove(pvVar3,*(void **)(param_1 + 400),0);
    *(void **)(param_1 + 400) = pvVar3;
  }
  pvVar3 = *(void **)(param_1 + 0x168);
  if (pvVar3 != *(void **)(param_1 + 0x170)) {
    memmove(pvVar3,*(void **)(param_1 + 0x170),0);
    *(void **)(param_1 + 0x170) = pvVar3;
  }
  *(undefined4 *)(param_1 + 0x68) = 0;
  return;
}



undefined8 * FUN_140250b90(undefined8 *param_1)

{
  *param_1 = 0;
  param_1[3] = 0;
  param_1[4] = 0xf;
  *(undefined1 *)(param_1 + 1) = 0;
  param_1[8] = 0;
  param_1[9] = 7;
  *(undefined2 *)(param_1 + 6) = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  *(undefined4 *)(param_1 + 0x13) = 0;
  param_1[0x14] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  *(undefined4 *)((longlong)param_1 + 0xc4) = 0;
  *(undefined2 *)(param_1 + 0x19) = 0;
  *(undefined4 *)(param_1 + 0xb) = 1;
  *(undefined8 *)((longlong)param_1 + 0x7c) = 1;
  *(undefined2 *)(param_1 + 0x18) = 0x100;
  *(undefined1 *)((longlong)param_1 + 0xc2) = 1;
  param_1[0x1b] = 0;
  param_1[0x1c] = 0;
  param_1[0x1d] = 0;
  param_1[0x1f] = 0;
  param_1[0x20] = 0;
  param_1[0x21] = 0;
  param_1[0x25] = 0;
  param_1[0x26] = 7;
  *(undefined2 *)(param_1 + 0x23) = 0;
  param_1[0x2a] = 0;
  param_1[0x2b] = 7;
  *(undefined2 *)(param_1 + 0x28) = 0;
  param_1[0x2d] = 0;
  param_1[0x2e] = 0;
  param_1[0x2f] = 0;
  param_1[0x30] = 0;
  param_1[0x33] = 0;
  param_1[0x34] = 0xf;
  *(undefined1 *)(param_1 + 0x31) = 0;
  *(undefined1 *)(param_1 + 0x36) = 0;
  param_1[0x37] = 0;
  param_1[0x38] = 0;
  param_1[0x39] = 0;
  param_1[0x3a] = 0;
  *(undefined4 *)(param_1 + 0x3b) = 0;
  param_1[0x44] = 0;
  *(undefined4 *)(param_1 + 0x45) = 0;
  param_1[0x46] = 0;
  param_1[0x42] = 0;
  param_1[0x41] = 0;
  *(undefined8 *)((longlong)param_1 + 0x1fc) = 0;
  *(undefined8 *)((longlong)param_1 + 500) = 0;
  param_1[0x3d] = 0;
  param_1[0x3c] = 0;
  *(undefined4 *)(param_1 + 0x43) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x204) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x3e) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x1dc) = 0x3f800000;
  return param_1;
}



void FUN_140250d40(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  FUN_140195a40(param_1 + 0x230);
  plVar3 = *(longlong **)(param_1 + 0x1c0);
  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);
      }
    }
  }
  if (0xf < *(ulonglong *)(param_1 + 0x1a0)) {
    operator_delete(*(void **)(param_1 + 0x188));
  }
  *(undefined8 *)(param_1 + 0x1a0) = 0xf;
  *(undefined8 *)(param_1 + 0x198) = 0;
  *(undefined1 *)(param_1 + 0x188) = 0;
  plVar3 = *(longlong **)(param_1 + 0x180);
  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);
      }
    }
  }
  plVar3 = *(longlong **)(param_1 + 0x170);
  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);
      }
    }
  }
  if (7 < *(ulonglong *)(param_1 + 0x158)) {
    operator_delete(*(void **)(param_1 + 0x140));
  }
  *(undefined8 *)(param_1 + 0x158) = 7;
  *(undefined8 *)(param_1 + 0x150) = 0;
  *(undefined2 *)(param_1 + 0x140) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x130)) {
    operator_delete(*(void **)(param_1 + 0x118));
  }
  *(undefined8 *)(param_1 + 0x130) = 7;
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined2 *)(param_1 + 0x118) = 0;
  if (*(void **)(param_1 + 0xf8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xf8));
  }
  *(undefined8 *)(param_1 + 0xf8) = 0;
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x108) = 0;
  if (*(longlong *)(param_1 + 0xd8) != 0) {
    FUN_14008d0a0(*(longlong *)(param_1 + 0xd8),*(undefined8 *)(param_1 + 0xe0));
    operator_delete(*(void **)(param_1 + 0xd8));
  }
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  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 (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_140250f40(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  bool bVar5;
  
  plVar1 = (longlong *)(param_1 + 0x230);
  *(longlong *)(param_1 + 0x1d0) = param_2;
  plVar2 = (longlong *)*plVar1;
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x238)) {
      if (*plVar2 != 0) {
        return;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar5 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  if (*plVar1 != *(longlong *)(param_2 + 0xb8)) {
    FUN_140195a40(plVar1);
    lVar3 = *(longlong *)(param_2 + 0xb8);
    *plVar1 = lVar3;
    *(longlong *)(param_1 + 0x238) = lVar3;
    if (lVar3 != 0) {
      LOCK();
      *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
      UNLOCK();
    }
  }
  return;
}



void FUN_140250fd0(longlong param_1,undefined4 param_2,undefined4 param_3,longlong param_4,
                  undefined4 param_5,undefined1 param_6,undefined1 param_7)

{
  int *piVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong *plVar7;
  undefined2 *puVar8;
  undefined4 local_res10 [4];
  undefined4 local_res20 [2];
  float local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined1 local_a0 [8];
  longlong *local_98;
  undefined2 local_90;
  undefined6 uStack_8e;
  undefined8 local_80;
  ulonglong local_78;
  
  if (param_4 != 0) {
    *(undefined8 *)(param_1 + 0xa8) = DAT_140607d00;
    *(undefined4 *)(param_1 + 0x1d8) = param_3;
    *(undefined4 *)(param_1 + 0xc4) = param_5;
    *(undefined1 *)(param_1 + 200) = param_6;
    *(undefined1 *)(param_1 + 0xc9) = param_7;
    local_res10[0] = param_2;
    lVar5 = FUN_140343050(DAT_140608228);
    if (lVar5 != 0) {
      *(undefined8 *)(param_1 + 0xd0) = *(undefined8 *)(*(longlong *)(param_1 + 0x1d0) + 0x68);
      *(longlong *)(param_1 + 0x220) = param_4;
      local_c0 = *(float *)(param_4 + 0x154);
      local_bc = *(undefined4 *)(param_4 + 0x158);
      local_b8 = *(undefined4 *)(param_4 + 0x15c);
      local_b0 = *(undefined4 *)(param_4 + 0x178);
      local_ac = *(undefined4 *)(param_4 + 0x17c);
      local_a8 = *(undefined4 *)(param_4 + 0x180);
      *(undefined8 *)(param_1 + 0x210) = 0;
      *(undefined8 *)(param_1 + 0x208) = 0;
      *(undefined8 *)(param_1 + 0x1fc) = 0;
      *(undefined8 *)(param_1 + 500) = 0;
      *(undefined8 *)(param_1 + 0x1e8) = 0;
      *(undefined8 *)(param_1 + 0x1e0) = 0;
      *(undefined4 *)(param_1 + 0x218) = 0x3f800000;
      *(undefined4 *)(param_1 + 0x204) = 0x3f800000;
      *(undefined4 *)(param_1 + 0x1f0) = 0x3f800000;
      *(undefined4 *)(param_1 + 0x1dc) = 0x3f800000;
      D3DXVec3Normalize(&local_c0,&local_c0);
      *(float *)(param_1 + 0x1fc) = local_c0;
      *(undefined4 *)(param_1 + 0x200) = local_bc;
      *(undefined4 *)(param_1 + 0x204) = local_b8;
      if ((DAT_14060819c & 1) == 0) {
        DAT_14060819c = DAT_14060819c | 1;
      }
      DAT_1406081a0 = local_c0;
      DAT_1406081a4 = *(float *)(param_1 + 0x200);
      DAT_1406081a8 = *(float *)(param_1 + 0x204);
      if ((DAT_140608010 & 1) == 0) {
        DAT_140608010 = DAT_140608010 | 1;
      }
      DAT_140608018._0_4_ = DAT_1406081a8 - DAT_1406081a4 * 0.0;
      DAT_140608018._4_4_ = local_c0 * 0.0 - DAT_1406081a8 * 0.0;
      DAT_140608020 = DAT_1406081a4 * 0.0 - local_c0;
      if ((DAT_1406081ac & 1) == 0) {
        DAT_1406081ac = DAT_1406081ac | 1;
      }
      D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
      DAT_1406081c0 = DAT_1406081b0;
      *(float *)(param_1 + 0x1dc) = DAT_1406081b0;
      *(undefined4 *)(param_1 + 0x1e0) = DAT_1406081b4;
      *(undefined4 *)(param_1 + 0x1e4) = DAT_1406081b8;
      if ((DAT_1406081bc & 1) == 0) {
        DAT_1406081bc = DAT_1406081bc | 1;
      }
      DAT_1406081c4 = *(float *)(param_1 + 0x1e0);
      DAT_1406081c8 = *(float *)(param_1 + 0x1e4);
      if ((DAT_14060819c & 1) == 0) {
        DAT_14060819c = DAT_14060819c | 1;
      }
      DAT_1406081a0 = *(float *)(param_1 + 0x1fc);
      DAT_1406081a4 = *(float *)(param_1 + 0x200);
      DAT_1406081a8 = *(float *)(param_1 + 0x204);
      if ((DAT_140608010 & 1) == 0) {
        DAT_140608010 = DAT_140608010 | 1;
      }
      DAT_140608018._0_4_ = DAT_1406081c8 * DAT_1406081a4 - DAT_1406081c4 * DAT_1406081a8;
      DAT_140608018._4_4_ = DAT_1406081c0 * DAT_1406081a8 - DAT_1406081c8 * DAT_1406081a0;
      DAT_140608020 = DAT_1406081c4 * DAT_1406081a0 - DAT_1406081c0 * DAT_1406081a4;
      if ((DAT_1406081ac & 1) == 0) {
        DAT_1406081ac = DAT_1406081ac | 1;
      }
      D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
      *(float *)(param_1 + 0x1ec) = DAT_1406081b0;
      *(undefined4 *)(param_1 + 0x1f0) = DAT_1406081b4;
      *(undefined4 *)(param_1 + 500) = DAT_1406081b8;
      *(undefined4 *)(param_1 + 0x20c) = local_b0;
      *(undefined4 *)(param_1 + 0x210) = local_ac;
      *(undefined4 *)(param_1 + 0x214) = local_a8;
      FUN_140252f10(param_1,local_res10[0]);
      local_78 = 7;
      local_80 = 0;
      local_90 = 0;
      FUN_1400015e0(&local_90,lVar5 + 0x30,0,0xffffffffffffffff);
      FUN_140002aa0(&local_90,L"_server",7);
      puVar8 = &local_90;
      if (7 < local_78) {
        puVar8 = (undefined2 *)CONCAT62(uStack_8e,local_90);
      }
      uVar6 = FUN_1402c4f90(local_a0,puVar8,9);
      FUN_140343ec0(param_1 + 0x1b8,uVar6);
      if (local_98 != (longlong *)0x0) {
        LOCK();
        plVar7 = local_98 + 1;
        *(int *)plVar7 = (int)*plVar7 + -1;
        UNLOCK();
        if ((int)*plVar7 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)local_98 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))(local_98);
          }
        }
      }
      if (*(longlong *)(param_1 + 0x1b8) != 0) {
        FUN_1402c5990(*(longlong *)(param_1 + 0x1b8),param_1 + 0x1dc);
        lVar5 = *(longlong *)(param_1 + 0x1d0);
        if (**(longlong **)(lVar5 + 0x48) != 0) {
          local_res20[0] = *(undefined4 *)(param_4 + 0x120);
          plVar7 = (longlong *)(**(longlong **)(lVar5 + 0x48) + 0x78);
          (**(code **)(*plVar7 + 0x460))
                    (plVar7,*(undefined4 *)(lVar5 + 8),&DAT_1405d85a0,param_1 + 0x1d8,local_res10,
                     local_res20,&local_b0,&local_c0);
        }
        lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x220) + 0x130);
        fVar2 = *(float *)(lVar5 + 0x92c);
        fVar3 = *(float *)(lVar5 + 0x928);
        iVar4 = rand();
        *(float *)(param_1 + 0x228) = (fVar2 - fVar3) * ((float)iVar4 / 32767.0) + fVar3;
        FUN_140251c70(param_1,6);
      }
      if (7 < local_78) {
        operator_delete((void *)CONCAT62(uStack_8e,local_90));
      }
    }
  }
  return;
}



void FUN_140251530(longlong param_1)

{
  longlong *plVar1;
  float fVar2;
  char cVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong *plVar7;
  ulonglong *puVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  ulonglong uVar12;
  int iVar13;
  int iVar14;
  ulonglong uVar15;
  bool bVar16;
  float fVar17;
  float fVar18;
  float fVar19;
  float local_res8 [2];
  float local_res10 [2];
  undefined8 in_stack_fffffffffffffee8;
  undefined4 uVar21;
  double dVar20;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  longlong *local_f0;
  longlong *local_e8;
  longlong *local_d8;
  longlong local_d0;
  uint local_c8;
  
  lVar6 = *(longlong *)(param_1 + 0x1b8);
  local_100 = *(undefined4 *)(lVar6 + 0x144);
  local_fc = *(undefined4 *)(lVar6 + 0x148);
  local_f8 = *(undefined4 *)(lVar6 + 0x14c);
  uVar15 = 0;
  iVar11 = 0;
  iVar14 = 0;
  iVar13 = iVar11;
  if (*(longlong *)(param_1 + 0x168) != 0) {
    iVar13 = FUN_140343510();
  }
  if (*(longlong *)(param_1 + 0x220) != 0) {
    iVar9 = iVar14;
    if (*(longlong *)(*(longlong *)(param_1 + 0x220) + 0xc28) != 0) {
      iVar9 = FUN_140343510();
    }
    iVar13 = iVar13 + iVar9;
  }
  fVar19 = 0.0;
  fVar18 = 0.0;
  if (iVar13 != 0) {
    iVar9 = (iVar13 % 0x32) % 0x14;
    iVar10 = iVar9 % 10;
    fVar19 = (float)((iVar13 % 0x32) / 0x14) * 20.0 + (float)(iVar13 / 0x32) * 50.0 +
             (float)(iVar9 / 10) * 10.0 + (float)(iVar10 / 5) * 5.0 +
             (float)((iVar10 % 5) / 2) * 2.0;
  }
  if (*(longlong *)(param_1 + 0x178) != 0) {
    iVar14 = FUN_140343510();
  }
  if (*(longlong *)(param_1 + 0x220) != 0) {
    if (*(longlong *)(*(longlong *)(param_1 + 0x220) + 0xc38) != 0) {
      iVar11 = FUN_140343510();
    }
    iVar14 = iVar14 + iVar11;
  }
  if (iVar14 != 0) {
    iVar11 = (iVar14 % 0x32) % 0x14;
    iVar9 = iVar11 % 10;
    fVar18 = (float)((iVar14 % 0x32) / 0x14) * 20.0 + (float)(iVar14 / 0x32) * 50.0 +
             (float)(iVar11 / 10) * 10.0 + (float)(iVar9 / 5) * 5.0 + (float)((iVar9 % 5) / 2) * 2.0
    ;
  }
  FUN_1402472e0(&local_d8,*(longlong *)(*(longlong *)(param_1 + 0x1d0) + 0x48) + 0xe0);
  uVar12 = uVar15;
  if ((local_d0 != 0) && (uVar5 = uVar15, plVar7 = local_d8, local_c8 != 0)) {
    do {
      if (*plVar7 != 0) {
        uVar12 = local_d8[uVar5];
        break;
      }
      uVar4 = (int)uVar5 + 1;
      uVar5 = (ulonglong)uVar4;
      plVar7 = plVar7 + 1;
    } while (uVar4 < local_c8);
  }
  do {
    uVar5 = uVar12;
    if (uVar5 == 0) {
      FUN_1401625e0(&local_d8);
      return;
    }
    FUN_140198570(*(undefined8 *)(uVar5 + 8));
    plVar1 = local_e8;
    plVar7 = local_f0;
    uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffee8 >> 0x20);
    if (local_f0 == (longlong *)0x0) {
LAB_140251b90:
      if (plVar7 != (longlong *)0x0) {
        if (plVar7 == plVar1) {
          if (plVar7 != (longlong *)0x0) goto LAB_140251bbc;
        }
        else {
          iVar11 = DAT_140608054 + 1;
          bVar16 = DAT_140608054 == 0;
          DAT_140608054 = iVar11;
          if (bVar16) {
            FUN_140176d60(1);
          }
        }
      }
    }
    else {
      if (local_f0 != local_e8) {
        iVar11 = DAT_14060804c + 1;
        bVar16 = DAT_14060804c == 0;
        DAT_14060804c = iVar11;
        if (bVar16) {
          FUN_140176d60(1);
        }
        goto LAB_140251b90;
      }
      if (*local_f0 == 0) goto LAB_140251b90;
      if (iVar13 != 0) {
        if (*(int *)(*local_f0 + 300) != 0x25) {
          local_res8[0] = 0.0;
          cVar3 = FUN_1401b4a60(*(undefined8 *)(uVar5 + 8),local_res8,0x191);
          fVar2 = local_res8[0];
          if (cVar3 == '\0') {
            fVar17 = local_res8[0] * fVar19;
            if ((DAT_14060b7c4 & 1) == 0) {
              DAT_14060b7c4 = DAT_14060b7c4 | 1;
              FUN_140418590();
              atexit((_func_5014 *)&LAB_140448470);
            }
            if ((DAT_14060a120 == 1000) ||
               (lVar6 = FUN_1404186a0(), *(char *)(lVar6 + 0x215) == '\x01')) {
              if ((DAT_14060b7f4 & 1) == 0) {
                DAT_14060b7f4 = DAT_14060b7f4 | 1;
                FUN_14015b4b0();
                atexit((_func_5014 *)&LAB_140448930);
              }
              if ((DAT_1406094c0 - 1U < 5) && (2 < DAT_1406094c0)) {
                dVar20 = (double)fVar19;
                FUN_140005370(0xd,
                              L"INFO >> GUILD SKILL | SOUL RED RECOVERY BOX %.2f = (%.2f + (%.2f * %.2f))"
                              ,(double)(fVar17 + fVar19),dVar20,dVar20,(double)fVar2);
                uVar21 = (undefined4)((ulonglong)dVar20 >> 0x20);
              }
            }
          }
          (**(code **)(*(longlong *)*plVar7 + 0x290))();
        }
        in_stack_fffffffffffffee8 = CONCAT44(uVar21,iVar13);
        FUN_1402531b0(param_1,&local_100,*(undefined4 *)(*plVar7 + 0x128),1,
                      in_stack_fffffffffffffee8);
      }
      uVar21 = (undefined4)((ulonglong)in_stack_fffffffffffffee8 >> 0x20);
      if (iVar14 != 0) {
        local_res10[0] = 0.0;
        cVar3 = FUN_1401b4a60(*(undefined8 *)(uVar5 + 8),local_res10,0x192);
        fVar2 = local_res10[0];
        if (cVar3 == '\0') {
          fVar17 = local_res10[0] * fVar18;
          if ((DAT_14060b7c4 & 1) == 0) {
            DAT_14060b7c4 = DAT_14060b7c4 | 1;
            FUN_140418590();
            atexit((_func_5014 *)&LAB_140448470);
          }
          if (DAT_14060a120 != 1000) {
            if ((DAT_14060b7c4 & 1) == 0) {
              DAT_14060b7c4 = DAT_14060b7c4 | 1;
              FUN_140418590();
              atexit((_func_5014 *)&LAB_140448470);
            }
            if (DAT_14060a0e5 != '\x01') goto LAB_140251b5c;
          }
          if ((DAT_14060b7f4 & 1) == 0) {
            DAT_14060b7f4 = DAT_14060b7f4 | 1;
            FUN_14015b4b0();
            atexit((_func_5014 *)&LAB_140448930);
          }
          if ((DAT_1406094c0 - 1U < 5) && (2 < DAT_1406094c0)) {
            dVar20 = (double)fVar18;
            FUN_140005370(0xd,
                          L"INFO >> GUILD SKILL | SOUL RED RECOVERY BOX %.2f = (%.2f + (%.2f * %.2f))"
                          ,(double)(fVar17 + fVar18),dVar20,dVar20,(double)fVar2);
            uVar21 = (undefined4)((ulonglong)dVar20 >> 0x20);
          }
        }
LAB_140251b5c:
        (**(code **)(*(longlong *)*plVar7 + 0x298))();
        in_stack_fffffffffffffee8 = CONCAT44(uVar21,iVar14);
        FUN_1402531b0(param_1,&local_100,*(undefined4 *)(*plVar7 + 0x128),2,
                      in_stack_fffffffffffffee8);
      }
LAB_140251bbc:
      LOCK();
      plVar1 = plVar7 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        local_f0 = (longlong *)0x0;
        if ((undefined8 *)*plVar7 != (undefined8 *)0x0) {
          (*(code *)**(undefined8 **)*plVar7)();
        }
        operator_delete(plVar7);
      }
    }
    uVar12 = *(ulonglong *)(uVar5 + 0x10);
    if (*(ulonglong *)(uVar5 + 0x10) == 0) {
      uVar4 = *(uint *)(uVar5 + 0x18) % local_c8 + 1;
      puVar8 = (ulonglong *)(local_d8 + (int)uVar4);
      uVar12 = uVar15;
      do {
        if (local_c8 <= uVar4) break;
        if (*puVar8 != 0) {
          uVar12 = *puVar8;
        }
        uVar4 = uVar4 + 1;
        puVar8 = puVar8 + 1;
      } while (uVar12 == 0);
    }
  } while( true );
}



void FUN_140251c70(longlong param_1,undefined4 param_2)

{
  uint *puVar1;
  undefined *puVar2;
  int *piVar3;
  short sVar4;
  wchar_t wVar5;
  longlong lVar6;
  undefined4 uVar7;
  int iVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  undefined8 uVar12;
  ushort *puVar13;
  longlong lVar14;
  ulonglong uVar15;
  undefined *puVar16;
  ushort *puVar17;
  longlong *plVar18;
  wchar_t *pwVar19;
  wchar_t *pwVar20;
  uint uVar21;
  short *psVar22;
  ulonglong uVar23;
  short *psVar24;
  uint uVar25;
  uint uVar26;
  undefined *local_res8;
  undefined2 local_res10 [4];
  undefined8 in_stack_ffffffffffffff80;
  undefined4 uVar27;
  undefined8 in_stack_ffffffffffffff88;
  undefined4 uVar28;
  undefined8 local_50;
  undefined4 local_48;
  
  uVar28 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
  uVar27 = (undefined4)((ulonglong)in_stack_ffffffffffffff80 >> 0x20);
  *(undefined4 *)(param_1 + 0x58) = param_2;
  lVar6 = *(longlong *)(param_1 + 0x1b8);
  if (lVar6 == 0) {
    return;
  }
  uVar25 = 1;
  uVar21 = 0;
  uVar26 = 0;
  uVar11 = 0;
  switch(param_2) {
  case 0:
    uVar15 = *(ulonglong *)(lVar6 + 0x50);
    if (*(ulonglong *)(lVar6 + 0x58) < 8) {
      pwVar19 = (wchar_t *)(lVar6 + 0x40);
    }
    else {
      pwVar19 = *(wchar_t **)(lVar6 + 0x40);
    }
    uVar23 = 5;
    if (uVar15 < 5) {
      uVar23 = uVar15;
    }
    pwVar20 = L"close";
    for (; uVar9 = uVar11, uVar23 != 0; uVar23 = uVar23 - 1) {
      if (*pwVar19 != *pwVar20) {
        uVar9 = uVar25;
        if ((ushort)*pwVar19 < (ushort)*pwVar20) {
          uVar9 = 0xffffffff;
        }
        break;
      }
      pwVar19 = pwVar19 + 1;
      pwVar20 = pwVar20 + 1;
    }
    if (uVar9 == 0) {
      if (uVar15 < 5) {
        uVar9 = 0xffffffff;
      }
      else {
        uVar9 = (uint)(uVar15 != 5);
      }
    }
    if (uVar9 != 0) {
      FUN_140001710(lVar6 + 0x40,L"close",5);
      if (*(longlong *)(lVar6 + 0x10) != 0) {
        lVar14 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
        if (lVar14 != 0) {
          pwVar19 = L"close";
LAB_140251d83:
          iVar8 = FUN_1402ce620(lVar14,pwVar19);
          uVar11 = iVar8 + 1;
        }
LAB_140251d8a:
        FUN_1402c5c00(lVar6,uVar11,0,1);
      }
    }
    goto LAB_140251d9b;
  case 1:
    uVar15 = *(ulonglong *)(lVar6 + 0x50);
    if (*(ulonglong *)(lVar6 + 0x58) < 8) {
      pwVar19 = (wchar_t *)(lVar6 + 0x40);
    }
    else {
      pwVar19 = *(wchar_t **)(lVar6 + 0x40);
    }
    uVar23 = 9;
    if (uVar15 < 9) {
      uVar23 = uVar15;
    }
    pwVar20 = L"closestay";
    for (; uVar9 = uVar11, uVar23 != 0; uVar23 = uVar23 - 1) {
      if (*pwVar19 != *pwVar20) {
        uVar9 = uVar25;
        if ((ushort)*pwVar19 < (ushort)*pwVar20) {
          uVar9 = 0xffffffff;
        }
        break;
      }
      pwVar19 = pwVar19 + 1;
      pwVar20 = pwVar20 + 1;
    }
    if (uVar9 == 0) {
      if (uVar15 < 9) {
        uVar9 = 0xffffffff;
      }
      else {
        uVar9 = (uint)(uVar15 != 9);
      }
    }
    if (uVar9 != 0) {
      FUN_140001710(lVar6 + 0x40,L"closestay",9);
      if (*(longlong *)(lVar6 + 0x10) != 0) {
        lVar14 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
        if (lVar14 != 0) {
          pwVar19 = L"closestay";
          goto LAB_140251d83;
        }
        goto LAB_140251d8a;
      }
    }
    goto LAB_140251d9b;
  case 2:
    uVar15 = *(ulonglong *)(lVar6 + 0x50);
    if (*(ulonglong *)(lVar6 + 0x58) < 8) {
      puVar13 = (ushort *)(lVar6 + 0x40);
    }
    else {
      puVar13 = *(ushort **)(lVar6 + 0x40);
    }
    uVar23 = 4;
    if (uVar15 < 4) {
      uVar23 = uVar15;
    }
    puVar17 = &DAT_1404b5e10;
    for (; uVar9 = uVar11, uVar23 != 0; uVar23 = uVar23 - 1) {
      if (*puVar13 != *puVar17) {
        uVar9 = uVar25;
        if (*puVar13 < *puVar17) {
          uVar9 = 0xffffffff;
        }
        break;
      }
      puVar13 = puVar13 + 1;
      puVar17 = puVar17 + 1;
    }
    if (uVar9 == 0) {
      if (uVar15 < 4) {
        uVar9 = 0xffffffff;
      }
      else {
        uVar9 = (uint)(uVar15 != 4);
      }
    }
    if (uVar9 != 0) {
      FUN_140001710(lVar6 + 0x40,&DAT_1404b5e10,4);
      if (*(longlong *)(lVar6 + 0x10) != 0) {
        lVar14 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
        if (lVar14 != 0) {
          iVar8 = FUN_1402ce620(lVar14,&DAT_1404b5e10);
          uVar11 = iVar8 + 1;
        }
        FUN_1402c5c00(lVar6,uVar11,0,1);
      }
    }
    FUN_1402c5e50(*(undefined8 *)(param_1 + 0x1b8),0x3f800000);
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0x20) + 0x50) = 0;
    lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0x20);
    if (*(int *)(lVar6 + 0x54) == 1) {
      *(undefined8 *)(lVar6 + 0x10) = *(undefined8 *)(param_1 + 0xa8);
      FUN_1402cc2c0(lVar6);
    }
    *(undefined4 *)(lVar6 + 0x54) = 0;
    if (*(int *)(param_1 + 0x7c) != 0) {
      FUN_1402c5150(*(undefined8 *)(param_1 + 0x1b8));
      FUN_1402c64c0(*(undefined8 *)(param_1 + 0x1c8));
    }
    *(undefined8 *)(param_1 + 0xb0) = *(undefined8 *)(param_1 + 0xa8);
    if (*(char *)(param_1 + 0x1b0) == '\0') {
      local_48 = *(undefined4 *)(*(longlong *)(param_1 + 0x1b8) + 0xcc);
      local_50 = *(undefined8 *)(*(longlong *)(param_1 + 0x1b8) + 0xc4);
      plVar18 = (longlong *)(param_1 + 8);
      if (0xf < *(ulonglong *)(param_1 + 0x20)) {
        plVar18 = (longlong *)*plVar18;
      }
      uVar12 = CONCAT44(uVar28,*(undefined4 *)(param_1 + 0x90));
      (**(code **)(**(longlong **)(param_1 + 0x1d0) + 0x58))
                (*(longlong **)(param_1 + 0x1d0),plVar18,*(undefined4 *)(param_1 + 0x78),
                 *(undefined4 *)(param_1 + 0x84),*(undefined4 *)(param_1 + 0x88),
                 CONCAT44(uVar27,*(undefined4 *)(param_1 + 0x8c)),uVar12,
                 *(undefined4 *)(param_1 + 0x94),&local_50,*(undefined4 *)(param_1 + 0x98));
      uVar28 = (undefined4)((ulonglong)uVar12 >> 0x20);
      *(undefined1 *)(param_1 + 0x1b0) = 1;
    }
    lVar6 = *(longlong *)(param_1 + 0x220);
    if (lVar6 != 0) {
      psVar24 = (short *)(*(longlong *)(lVar6 + 0x130) + 0x900);
      if (7 < *(ulonglong *)(*(longlong *)(lVar6 + 0x130) + 0x918)) {
        psVar24 = *(short **)psVar24;
      }
      *(undefined1 *)(lVar6 + 0x2280) = 0;
      uVar27 = *(undefined4 *)(*(longlong *)(param_1 + 0x220) + 0x120);
      uVar7 = FUN_1402f8580();
      FUN_1402543a0(*(undefined8 *)(param_1 + 0x220),*(undefined4 *)(param_1 + 0xc4),uVar27,
                    *(undefined1 *)(param_1 + 200),*(undefined1 *)(param_1 + 0xc9),psVar24,
                    CONCAT44(uVar28,*(undefined4 *)(param_1 + 0x1d8)),uVar7);
      uVar15 = 0xffffffffffffffff;
      psVar22 = psVar24;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar4 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar4 != 0);
      FUN_140001710(*(longlong *)(param_1 + 0x220) + 0x14a0,psVar24,~uVar15 - 1);
      (**(code **)(**(longlong **)(param_1 + 0x220) + 200))(*(longlong **)(param_1 + 0x220),1,0);
      *(undefined8 *)(param_1 + 0x220) = 0;
      *(undefined4 *)(param_1 + 0x1d8) = 0;
      FUN_140251530(param_1);
      return;
    }
    FUN_140251530(param_1);
    break;
  case 3:
    uVar15 = *(ulonglong *)(lVar6 + 0x50);
    if (*(ulonglong *)(lVar6 + 0x58) < 8) {
      pwVar19 = (wchar_t *)(lVar6 + 0x40);
    }
    else {
      pwVar19 = *(wchar_t **)(lVar6 + 0x40);
    }
    uVar23 = 8;
    if (uVar15 < 8) {
      uVar23 = uVar15;
    }
    pwVar20 = L"openstay";
    for (; uVar9 = uVar11, uVar23 != 0; uVar23 = uVar23 - 1) {
      if (*pwVar19 != *pwVar20) {
        uVar9 = uVar25;
        if ((ushort)*pwVar19 < (ushort)*pwVar20) {
          uVar9 = 0xffffffff;
        }
        break;
      }
      pwVar19 = pwVar19 + 1;
      pwVar20 = pwVar20 + 1;
    }
    if (uVar9 == 0) {
      if (uVar15 < 8) {
        uVar9 = 0xffffffff;
      }
      else {
        uVar9 = (uint)(uVar15 != 8);
      }
    }
    if (uVar9 != 0) {
      FUN_140001710(lVar6 + 0x40,L"openstay",8);
      if (*(longlong *)(lVar6 + 0x10) != 0) {
        lVar14 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
        if (lVar14 != 0) {
          pwVar19 = L"openstay";
          goto LAB_140251d83;
        }
        goto LAB_140251d8a;
      }
    }
LAB_140251d9b:
    FUN_1402c5e50(*(undefined8 *)(param_1 + 0x1b8),0x3f800000);
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0x20) + 0x50) = 0;
    lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0x20);
    if (*(int *)(lVar6 + 0x54) == 1) {
      *(undefined8 *)(lVar6 + 0x10) = *(undefined8 *)(param_1 + 0xa8);
      FUN_1402cc2c0(lVar6);
    }
    *(undefined4 *)(lVar6 + 0x54) = 0;
    break;
  case 4:
    if (*(longlong *)(param_1 + 0xd8) != *(longlong *)(param_1 + 0xe0)) {
      uVar9 = *(uint *)(param_1 + 0x80);
      if ((int)*(uint *)(param_1 + 0x80) < 0) {
        uVar9 = uVar11;
      }
      *(uint *)(param_1 + 0x80) = uVar9;
      pwVar19 = (wchar_t *)(*(longlong *)(param_1 + 0xd8) + (longlong)(int)uVar9 * 0x28);
      if (7 < *(ulonglong *)(pwVar19 + 0xc)) {
        pwVar19 = *(wchar_t **)pwVar19;
      }
      lVar14 = -1;
      pwVar20 = pwVar19;
      do {
        if (lVar14 == 0) break;
        lVar14 = lVar14 + -1;
        wVar5 = *pwVar20;
        pwVar20 = pwVar20 + 1;
      } while (wVar5 != L'\0');
      if (lVar14 != -2) {
        uVar15 = 0xffffffffffffffff;
        pwVar20 = pwVar19;
        do {
          if (uVar15 == 0) break;
          uVar15 = uVar15 - 1;
          wVar5 = *pwVar20;
          pwVar20 = pwVar20 + 1;
        } while (wVar5 != L'\0');
        iVar8 = FUN_140123e30(lVar6 + 0x40,*(undefined8 *)(lVar6 + 0x50),pwVar19,~uVar15 - 1);
        if (iVar8 != 0) {
          uVar15 = 0xffffffffffffffff;
          pwVar20 = pwVar19;
          do {
            if (uVar15 == 0) break;
            uVar15 = uVar15 - 1;
            wVar5 = *pwVar20;
            pwVar20 = pwVar20 + 1;
          } while (wVar5 != L'\0');
          FUN_140001710(lVar6 + 0x40,pwVar19,~uVar15 - 1);
          if (*(longlong *)(lVar6 + 0x10) != 0) {
            lVar14 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
            if (lVar14 != 0) goto LAB_140251d83;
            goto LAB_140251d8a;
          }
        }
      }
      goto LAB_140251d9b;
    }
    break;
  case 5:
    *(undefined8 *)(param_1 + 0xb8) = *(undefined8 *)(param_1 + 0xa8);
    break;
  case 6:
    FUN_140418da0(DAT_140607fd8,L"start respawn %f",*(undefined8 *)(param_1 + 0xa8));
    lVar6 = *(longlong *)(param_1 + 0x1b8);
    uVar15 = *(ulonglong *)(lVar6 + 0x50);
    if (*(ulonglong *)(lVar6 + 0x58) < 8) {
      pwVar19 = (wchar_t *)(lVar6 + 0x40);
    }
    else {
      pwVar19 = *(wchar_t **)(lVar6 + 0x40);
    }
    uVar23 = 7;
    if (uVar15 < 7) {
      uVar23 = uVar15;
    }
    pwVar20 = L"respawn";
    for (; uVar26 = uVar11, uVar23 != 0; uVar23 = uVar23 - 1) {
      if (*pwVar19 != *pwVar20) {
        uVar26 = uVar25;
        if ((ushort)*pwVar19 < (ushort)*pwVar20) {
          uVar26 = 0xffffffff;
        }
        break;
      }
      pwVar19 = pwVar19 + 1;
      pwVar20 = pwVar20 + 1;
    }
    if (uVar26 == 0) {
      if (6 < uVar15) {
        uVar26 = (uint)(uVar15 != 7);
        goto LAB_1402523ca;
      }
    }
    else {
LAB_1402523ca:
      if (uVar26 == 0) goto LAB_14025241d;
    }
    FUN_140001710(lVar6 + 0x40,L"respawn",7);
    if (*(longlong *)(lVar6 + 0x10) != 0) {
      lVar14 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
      if (lVar14 != 0) {
        iVar8 = FUN_1402ce620(lVar14,L"respawn");
        uVar11 = iVar8 + 1;
      }
      FUN_1402c5c00(lVar6,uVar11,0,1);
    }
LAB_14025241d:
    FUN_1402c5e50(*(undefined8 *)(param_1 + 0x1b8),0x3f800000);
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0x20) + 0x50) = 0;
    lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0x20);
    if (*(int *)(lVar6 + 0x54) == 1) {
      *(undefined8 *)(lVar6 + 0x10) = *(undefined8 *)(param_1 + 0xa8);
      FUN_1402cc2c0(lVar6);
    }
    *(undefined4 *)(lVar6 + 0x54) = 0;
    return;
  case 7:
    if (*(int *)(param_1 + 0x7c) != 0) {
      FUN_1402c5150(lVar6);
      FUN_1402c64c0(*(undefined8 *)(param_1 + 0x1c8));
    }
    lVar6 = *(longlong *)(param_1 + 0x1b8);
    uVar15 = *(ulonglong *)(lVar6 + 0x50);
    if (*(ulonglong *)(lVar6 + 0x58) < 8) {
      pwVar19 = (wchar_t *)(lVar6 + 0x40);
    }
    else {
      pwVar19 = *(wchar_t **)(lVar6 + 0x40);
    }
    uVar23 = 5;
    if (uVar15 < 5) {
      uVar23 = uVar15;
    }
    pwVar20 = L"break";
    for (; uVar11 = uVar26, uVar23 != 0; uVar23 = uVar23 - 1) {
      if (*pwVar19 != *pwVar20) {
        uVar11 = uVar25;
        if ((ushort)*pwVar19 < (ushort)*pwVar20) {
          uVar11 = 0xffffffff;
        }
        break;
      }
      pwVar19 = pwVar19 + 1;
      pwVar20 = pwVar20 + 1;
    }
    if (uVar11 == 0) {
      if (uVar15 < 5) {
        uVar11 = 0xffffffff;
      }
      else {
        uVar11 = (uint)(uVar15 != 5);
      }
    }
    if (uVar11 != 0) {
      FUN_140001710(lVar6 + 0x40,L"break",5);
      if (*(longlong *)(lVar6 + 0x10) != 0) {
        lVar14 = *(longlong *)(*(longlong *)(lVar6 + 0x10) + 0xd8);
        uVar11 = uVar26;
        if (lVar14 != 0) {
          iVar8 = FUN_1402ce620(lVar14,L"break");
          uVar11 = iVar8 + 1;
        }
        FUN_1402c5c00(lVar6,uVar11,0,1);
      }
    }
    FUN_1402c5e50(*(undefined8 *)(param_1 + 0x1b8),0x3f800000);
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0x20) + 0x50) = 0;
    lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0x20);
    if (*(int *)(lVar6 + 0x54) == 1) {
      *(undefined8 *)(lVar6 + 0x10) = *(undefined8 *)(param_1 + 0xa8);
      FUN_1402cc2c0(lVar6);
    }
    *(undefined4 *)(lVar6 + 0x54) = 0;
    if (*(longlong *)(param_1 + 0x220) != 0) {
      FUN_140251530(param_1);
      *(undefined1 *)(*(longlong *)(param_1 + 0x220) + 0x1868) = 1;
      FUN_14023e1e0();
      *(undefined8 *)(param_1 + 0x220) = 0;
      *(undefined4 *)(param_1 + 0x1d8) = 0;
    }
  }
  if (*(int *)(param_1 + 0x1d8) != 0) {
    lVar6 = *(longlong *)(param_1 + 0x1d0);
    if (**(longlong **)(lVar6 + 0x48) == 0) {
      return;
    }
    local_res10[0] = *(undefined2 *)(param_1 + 0x58);
    (**(code **)(*(longlong *)(**(longlong **)(lVar6 + 0x48) + 0x78) + 0x450))
              (**(longlong **)(lVar6 + 0x48) + 0x78,*(undefined4 *)(lVar6 + 8),&DAT_1405d85a0,
               (int *)(param_1 + 0x1d8),local_res10,param_1 + 0x70,param_1 + 0x80);
    return;
  }
  if (**(longlong **)(*(longlong *)(param_1 + 0x1d0) + 0x48) == 0) {
    return;
  }
  local_res10[0] = *(undefined2 *)(param_1 + 0x58);
  plVar18 = (longlong *)(param_1 + 8);
  if (0xf < *(ulonglong *)(param_1 + 0x20)) {
    plVar18 = (longlong *)*plVar18;
  }
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8008;
  uVar9 = FUN_14034fd90(plVar18);
  uVar11 = uVar21;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8008)) {
    uVar11 = *(uint *)(local_res8 + -8);
  }
  uVar10 = uVar9;
  if ((((int)uVar9 <= (int)uVar11) && (uVar10 = uVar21, local_res8 != (undefined *)0x0)) &&
     (local_res8 != PTR_DAT_1405d8008)) {
    uVar10 = *(uint *)(local_res8 + -8);
  }
  if (1 < (int)uVar10) {
    uVar25 = uVar10;
  }
  uVar11 = uVar26;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8008)) {
    uVar11 = *(uint *)(local_res8 + -8);
  }
  if ((int)uVar11 < (int)uVar25) {
    FUN_140057890(&local_res8,uVar25);
  }
  FUN_140057970(&local_res8);
  puVar16 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar16 = PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar16,plVar18,uVar9);
  puVar16 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar16 = PTR_DAT_1405d8008;
  }
  uVar11 = FUN_14034fd90(puVar16);
  uVar25 = 0;
  if (0 < (int)uVar11) {
    uVar25 = uVar11;
  }
  uVar11 = uVar26;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8008)) {
    uVar11 = *(uint *)(local_res8 + -8);
  }
  if (((int)uVar11 <= (int)uVar25) && (uVar25 = uVar26, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8008) goto LAB_14025278b;
    uVar25 = *(uint *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8008) && (local_res8 != (undefined *)0x0)) &&
     (puVar1 = (uint *)(local_res8 + -8), puVar1 != (uint *)0x0)) {
    *puVar1 = uVar25;
    *(undefined1 *)((longlong)(int)uVar25 + 8 + (longlong)puVar1) = 0;
  }
LAB_14025278b:
  lVar6 = **(longlong **)(*(longlong *)(param_1 + 0x1d0) + 0x48);
  (**(code **)(*(longlong *)(lVar6 + 0x78) + 0x440))
            (lVar6 + 0x78,*(undefined4 *)(*(longlong *)(param_1 + 0x1d0) + 8),&DAT_1405d85a0,
             &local_res8,local_res10,param_1 + 0x70,param_1 + 0x80);
  puVar16 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8008)) &&
     (puVar2 = local_res8 + -8, puVar2 != (undefined *)0x0)) {
    uVar12 = FUN_14034fe70();
    local_50 = uVar12;
    FUN_14034ed40(uVar12);
    local_48 = CONCAT31(local_48._1_3_,1);
    piVar3 = (int *)(puVar16 + -4);
    *piVar3 = *piVar3 + -1;
    if (*piVar3 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar12);
  }
  return;
}



void FUN_140252870(longlong param_1,int param_2,char *param_3)

{
  char cVar1;
  int iVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  char *pcVar5;
  
  if (*(char *)(param_1 + 0xc1) != '\0') {
    if ((param_3 != (char *)0x0) && (*(longlong *)(param_1 + 0x198) != 0)) {
      uVar3 = 0xffffffffffffffff;
      pcVar5 = param_3;
      do {
        if (uVar3 == 0) break;
        uVar3 = uVar3 - 1;
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + 1;
      } while (cVar1 != '\0');
      iVar2 = FUN_140168660(param_1 + 0x188,*(undefined8 *)(param_1 + 0x198),param_3,~uVar3 - 1);
      if (iVar2 != 0) {
        return;
      }
    }
    *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) - param_2;
    if (*(int *)(param_1 + 0x70) < 1) {
      uVar4 = 7;
      if (*(int *)(param_1 + 0x1d8) == 0) {
        uVar4 = 2;
      }
    }
    else {
      *(int *)(param_1 + 0x80) =
           ((int)((*(longlong *)(param_1 + 0xe0) - *(longlong *)(param_1 + 0xd8)) / 0x28) -
           (int)(((float)*(int *)(param_1 + 0x70) / (float)*(int *)(param_1 + 0x74)) *
                (float)(int)((*(longlong *)(param_1 + 0xe0) - *(longlong *)(param_1 + 0xd8)) / 0x28)
                )) + -1;
      uVar4 = 4;
    }
    FUN_140251c70(param_1,uVar4);
  }
  return;
}



undefined8 FUN_140252990(longlong param_1,float *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  int iVar7;
  longlong lVar8;
  longlong lVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  
  if (((*(int *)(param_1 + 0x58) != 2) && (*(int *)(param_1 + 0x58) != 3)) &&
     (lVar9 = *(longlong *)(param_1 + 0x1b8), lVar9 != 0)) {
    lVar8 = 0;
    iVar7 = (int)(*(longlong *)(lVar9 + 0xe0) - *(longlong *)(lVar9 + 0xd8) >> 4);
    lVar9 = lVar8;
    if (0 < iVar7) {
      do {
        lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0xd8);
        lVar5 = *(longlong *)(lVar9 + lVar4);
        plVar6 = *(longlong **)(lVar9 + 8 + lVar4);
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar6 + 1) = (int)plVar6[1] + 1;
          UNLOCK();
        }
        if ((lVar5 != 0) &&
           (fVar13 = *(float *)(lVar5 + 0x34) + param_2[3],
           fVar12 = *(float *)(lVar5 + 0x30) - param_2[2],
           fVar10 = *(float *)(lVar5 + 0x2c) - param_2[1],
           fVar11 = *(float *)(lVar5 + 0x28) - *param_2,
           fVar11 * fVar11 + fVar10 * fVar10 + fVar12 * fVar12 <= fVar13 * fVar13)) {
          if (plVar6 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar6 + 1;
            lVar9 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar9 == 1) {
              (**(code **)(*plVar6 + 8))(plVar6);
              LOCK();
              piVar2 = (int *)((longlong)plVar6 + 0xc);
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              if (*piVar2 == 0) {
                (**(code **)(*plVar6 + 0x10))();
              }
            }
          }
          return 1;
        }
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          lVar4 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar4 == 1) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            iVar3 = *piVar2;
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (iVar3 == 1) {
              (**(code **)(*plVar6 + 0x10))();
            }
          }
        }
        lVar8 = lVar8 + 1;
        lVar9 = lVar9 + 0x10;
      } while (lVar8 < iVar7);
    }
  }
  return 0;
}



undefined8 FUN_140252b30(longlong param_1,undefined8 param_2)

{
  int *piVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  char cVar6;
  int iVar7;
  longlong lVar8;
  longlong lVar9;
  longlong *plVar10;
  
  if (((*(int *)(param_1 + 0x58) != 2) && (*(int *)(param_1 + 0x58) != 3)) &&
     (lVar9 = *(longlong *)(param_1 + 0x1b8), lVar9 != 0)) {
    lVar8 = 0;
    iVar7 = (int)(*(longlong *)(lVar9 + 0xe0) - *(longlong *)(lVar9 + 0xd8) >> 4);
    lVar9 = lVar8;
    if (0 < iVar7) {
      do {
        lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0xd8);
        lVar4 = *(longlong *)(lVar3 + lVar8);
        plVar5 = *(longlong **)(lVar3 + 8 + lVar8);
        if (plVar5 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar5 + 1) = (int)plVar5[1] + 1;
          UNLOCK();
        }
        plVar10 = plVar5;
        if ((lVar4 != 0) && (cVar6 = FUN_1402bbec0(lVar4 + 0x28,param_2), cVar6 != '\0')) {
          if (plVar10 != (longlong *)0x0) {
            LOCK();
            plVar10 = plVar10 + 1;
            lVar9 = *plVar10;
            *(int *)plVar10 = (int)*plVar10 + -1;
            UNLOCK();
            if ((int)lVar9 == 1) {
              (**(code **)(*plVar5 + 8))(plVar5);
              LOCK();
              piVar1 = (int *)((longlong)plVar5 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar5 + 0x10))();
              }
            }
          }
          return 1;
        }
        if (plVar10 != (longlong *)0x0) {
          LOCK();
          plVar10 = plVar10 + 1;
          lVar3 = *plVar10;
          *(int *)plVar10 = (int)*plVar10 + -1;
          UNLOCK();
          if ((int)lVar3 == 1) {
            (**(code **)(*plVar5 + 8))(plVar5);
            LOCK();
            piVar1 = (int *)((longlong)plVar5 + 0xc);
            iVar2 = *piVar1;
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (iVar2 == 1) {
              (**(code **)(*plVar5 + 0x10))();
            }
          }
        }
        lVar9 = lVar9 + 1;
        lVar8 = lVar8 + 0x10;
      } while (lVar9 < iVar7);
    }
  }
  return 0;
}



undefined8 FUN_140252ca0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  char cVar7;
  int iVar8;
  longlong lVar9;
  longlong lVar10;
  undefined8 uVar11;
  
  uVar11 = 0xfffffffffffffffe;
  if (((*(int *)(param_1 + 0x58) != 2) && (*(int *)(param_1 + 0x58) != 3)) &&
     (lVar10 = *(longlong *)(param_1 + 0x1b8), lVar10 != 0)) {
    lVar9 = 0;
    iVar8 = (int)(*(longlong *)(lVar10 + 0xe0) - *(longlong *)(lVar10 + 0xd8) >> 4);
    lVar10 = lVar9;
    if (0 < iVar8) {
      do {
        lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x1b8) + 0xd8);
        lVar5 = *(longlong *)(lVar9 + lVar4);
        plVar6 = *(longlong **)(lVar9 + 8 + lVar4);
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar6 + 1) = (int)plVar6[1] + 1;
          UNLOCK();
        }
        if ((lVar5 != 0) &&
           (cVar7 = FUN_1402c1fa0(param_2,lVar5 + 0x28,*(undefined4 *)(lVar5 + 0x34),param_4,uVar11)
           , cVar7 != '\0')) {
          if (plVar6 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar6 + 1;
            lVar10 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)lVar10 == 1) {
              (**(code **)(*plVar6 + 8))(plVar6);
              LOCK();
              piVar2 = (int *)((longlong)plVar6 + 0xc);
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              if (*piVar2 == 0) {
                (**(code **)(*plVar6 + 0x10))();
              }
            }
          }
          return 1;
        }
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          lVar4 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar4 == 1) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            iVar3 = *piVar2;
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (iVar3 == 1) {
              (**(code **)(*plVar6 + 0x10))();
            }
          }
        }
        lVar10 = lVar10 + 1;
        lVar9 = lVar9 + 0x10;
      } while (lVar10 < iVar8);
    }
  }
  return 0;
}



void FUN_140252e10(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  longlong local_30;
  undefined1 local_28;
  
  lVar3 = 0;
  local_30 = 0;
  bVar7 = false;
  local_28 = 0;
  plVar1 = *(longlong **)(param_1 + 0x230);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x238)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x238)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        local_28 = 0;
        local_30 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        local_28 = 1;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  local_40 = param_2;
  local_3c = param_4;
  local_38 = param_3;
  FUN_1402532e0(param_1 + 0xf8,&local_40);
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_140252f10(undefined4 *param_1,undefined4 param_2)

{
  int *piVar1;
  undefined4 uVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong local_40;
  undefined1 local_30 [8];
  longlong *local_28;
  undefined1 local_20 [8];
  longlong *local_18;
  
  uVar9 = 0xfffffffffffffffe;
  local_40 = 0;
  bVar8 = false;
  plVar6 = *(longlong **)(param_1 + 0x8c);
  if (plVar6 != (longlong *)0x0) {
    if (plVar6 == *(longlong **)(param_1 + 0x8e)) {
      lVar4 = *plVar6;
      if (lVar4 != 0) {
        if ((plVar6 != *(longlong **)(param_1 + 0x8e)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar4 = 0, DAT_1406080a8 = iVar3,
           bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar8 = true;
        local_40 = lVar4;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  lVar4 = FUN_140343050(DAT_140608228,param_2);
  if (lVar4 != 0) {
    *param_1 = param_2;
    FUN_1400015e0(param_1 + 0xc,lVar4 + 0x30,0,0xffffffffffffffff,uVar9);
    uVar2 = *(undefined4 *)(lVar4 + 0x84);
    param_1[0x1c] = uVar2;
    param_1[0x1d] = uVar2;
    param_1[0x1f] = *(undefined4 *)(lVar4 + 0x88);
    param_1[0x21] = *(undefined4 *)(lVar4 + 0xb4);
    param_1[0x22] = *(undefined4 *)(lVar4 + 0xb8);
    param_1[0x1e] = *(undefined4 *)(lVar4 + 0x80);
    param_1[0x23] = *(undefined4 *)(lVar4 + 0xbc);
    param_1[0x24] = *(undefined4 *)(lVar4 + 0xc0);
    if (param_1 + 0x36 != (undefined4 *)(lVar4 + 0x90)) {
      FUN_14015b160();
    }
    param_1[0x25] = *(undefined4 *)(lVar4 + 0xc4);
    param_1[0x26] = *(undefined4 *)(lVar4 + 200);
    plVar6 = (longlong *)(param_1 + 0x46);
    FUN_1400015e0(plVar6,lVar4 + 0x138,0,0xffffffffffffffff,uVar9);
    plVar5 = (longlong *)(param_1 + 0x50);
    FUN_1400015e0(plVar5,lVar4 + 0x160,0,0xffffffffffffffff);
    FUN_140003d90(param_1 + 0x62,lVar4 + 0x188,0,0xffffffffffffffff);
    if (7 < *(ulonglong *)(param_1 + 0x4c)) {
      plVar6 = (longlong *)*plVar6;
    }
    uVar9 = FUN_1402eff30(DAT_140608068,local_30,plVar6);
    FUN_140343ec0(param_1 + 0x5a,uVar9);
    if (local_28 != (longlong *)0x0) {
      LOCK();
      plVar6 = local_28 + 1;
      *(int *)plVar6 = (int)*plVar6 + -1;
      UNLOCK();
      if ((int)*plVar6 == 0) {
        (**(code **)(*local_28 + 8))(local_28);
        LOCK();
        piVar1 = (int *)((longlong)local_28 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_28 + 0x10))(local_28);
        }
      }
    }
    if (7 < *(ulonglong *)(param_1 + 0x56)) {
      plVar5 = (longlong *)*plVar5;
    }
    uVar9 = FUN_1402f02a0(DAT_140608068,local_20,plVar5);
    FUN_140343ec0(param_1 + 0x5e,uVar9);
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar6 = local_18 + 1;
      *(int *)plVar6 = (int)*plVar6 + -1;
      UNLOCK();
      if ((int)*plVar6 == 0) {
        (**(code **)(*local_18 + 8))(local_18);
        LOCK();
        piVar1 = (int *)((longlong)local_18 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_18 + 0x10))(local_18);
        }
      }
    }
    *(undefined1 *)(param_1 + 0x6c) = 0;
  }
  if (bVar8) {
    FUN_14034edd0(local_40);
  }
  return;
}



void FUN_1402531b0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  bool bVar6;
  undefined1 local_128 [4];
  undefined8 local_124;
  
  lVar3 = 0;
  bVar6 = false;
  plVar1 = *(longlong **)(param_1 + 0x230);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x238)) {
      lVar4 = *plVar1;
      lVar3 = 0;
      if (lVar4 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x238)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar6 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar6) {
            FUN_140176d60(1);
          }
          lVar4 = 0;
        }
        FUN_14034ed40(lVar4);
        bVar6 = true;
        lVar3 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar5 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar5) {
        FUN_140176d60(1);
      }
    }
  }
  local_128[0] = 0;
  local_124 = 0;
  FUN_1402bafb0(local_128,param_2,param_3,param_4,param_5);
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1d0) + 0x48),local_128);
  if (bVar6) {
    FUN_14034edd0(lVar3);
  }
  return;
}



void FUN_1402532e0(longlong *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  puVar1 = (undefined4 *)param_1[1];
  if ((param_2 < puVar1) && ((undefined4 *)*param_1 <= param_2)) {
    lVar3 = (longlong)param_2 - *param_1;
    lVar3 = lVar3 / 6 + (lVar3 >> 0x3f);
    lVar3 = (lVar3 >> 1) - (lVar3 >> 0x3f);
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_140275840(param_1);
    }
    puVar1 = (undefined4 *)param_1[1];
    lVar2 = *param_1;
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *(undefined4 *)(lVar2 + lVar3 * 0xc);
      puVar1[1] = *(undefined4 *)(lVar2 + 4 + lVar3 * 0xc);
      puVar1[2] = *(undefined4 *)(lVar2 + 8 + lVar3 * 0xc);
      param_1[1] = param_1[1] + 0xc;
      return;
    }
  }
  else {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_140275840(param_1);
    }
    puVar1 = (undefined4 *)param_1[1];
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *param_2;
      puVar1[1] = param_2[1];
      puVar1[2] = param_2[2];
    }
  }
  param_1[1] = param_1[1] + 0xc;
  return;
}



undefined4 * FUN_1402533a0(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;
}



undefined8 * FUN_1402533e0(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0x70);
  lVar1 = *(longlong *)(param_1 + 0x78);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



void FUN_140253400(ulonglong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong **pplVar1;
  longlong **pplVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 *puVar5;
  void *pvVar6;
  int iVar7;
  longlong *plVar8;
  bool bVar9;
  bool bVar10;
  undefined8 uVar11;
  longlong local_40;
  longlong *local_30;
  longlong *local_28;
  int local_20;
  longlong local_18 [2];
  
  uVar11 = 0xfffffffffffffffe;
  local_40 = 0;
  bVar10 = false;
  plVar8 = (longlong *)param_1[0x17];
  if (plVar8 != (longlong *)0x0) {
    if (plVar8 == (longlong *)param_1[0x18]) {
      if (*plVar8 != 0) {
        local_40 = *plVar8;
        if ((plVar8 != (longlong *)param_1[0x18]) &&
           (iVar7 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, local_40 = 0,
           DAT_1406080a8 = iVar7, bVar10)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar10 = true;
      }
    }
    else {
      iVar7 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar7;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  local_20 = *(int *)(param_2 + 0x1d8);
  if (local_20 == 0) {
    if (*(longlong *)(param_2 + 0x68) == 0) {
      local_20 = 0;
    }
    else {
      local_20 = *(int *)(*(longlong *)(param_2 + 0x68) + 8);
    }
  }
  local_18[0] = param_2;
  FUN_1401623f0(param_1 + 0xd,local_20,local_18,param_4,uVar11);
  local_30 = (longlong *)0x0;
  plVar8 = operator_new(0x10);
  *plVar8 = param_2;
  *(undefined4 *)(plVar8 + 1) = 1;
  pplVar1 = (longlong **)param_1[1];
  local_30 = plVar8;
  local_28 = plVar8;
  if ((&local_30 < pplVar1) && (pplVar2 = (longlong **)*param_1, pplVar2 <= &local_30)) {
    if (pplVar1 == (longlong **)param_1[2]) {
      FUN_140253ca0(param_1);
    }
    plVar3 = (longlong *)param_1[1];
    if (plVar3 != (longlong *)0x0) {
      lVar4 = *(longlong *)
               (((longlong)&local_30 - (longlong)pplVar2 & 0xfffffffffffffff0U) + *param_1);
      *plVar3 = lVar4;
      plVar3[1] = lVar4;
      if (lVar4 != 0) {
        LOCK();
        *(int *)(lVar4 + 8) = *(int *)(lVar4 + 8) + 1;
        UNLOCK();
      }
    }
  }
  else {
    if (pplVar1 == (longlong **)param_1[2]) {
      FUN_140253ca0(param_1);
    }
    puVar5 = (undefined8 *)param_1[1];
    if (puVar5 != (undefined8 *)0x0) {
      *puVar5 = plVar8;
      puVar5[1] = plVar8;
      LOCK();
      *(int *)(plVar8 + 1) = (int)plVar8[1] + 1;
      UNLOCK();
    }
  }
  param_1[1] = param_1[1] + 0x10;
  LOCK();
  plVar3 = plVar8 + 1;
  *(int *)plVar3 = (int)*plVar3 + -1;
  UNLOCK();
  if ((int)*plVar3 == 0) {
    pvVar6 = (void *)*plVar8;
    if (pvVar6 != (void *)0x0) {
      FUN_140250d40(pvVar6);
      operator_delete(pvVar6);
    }
    operator_delete(plVar8);
  }
  if (bVar10) {
    FUN_14034edd0(local_40);
  }
  return;
}



bool FUN_1402535c0(longlong *param_1,ulonglong *param_2,float *param_3,float param_4)

{
  int *piVar1;
  longlong lVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  bool bVar7;
  float *pfVar8;
  int iVar9;
  longlong *plVar10;
  longlong *plVar11;
  undefined8 uVar12;
  longlong lVar13;
  longlong *plVar14;
  longlong lVar15;
  longlong lVar16;
  bool bVar17;
  bool bVar18;
  float fVar19;
  float fVar20;
  float fVar21;
  float fVar22;
  undefined8 local_res10;
  float *local_res18;
  longlong local_90;
  undefined1 local_70 [8];
  longlong *local_68;
  undefined1 local_60 [8];
  longlong *local_58;
  
  local_90 = 0;
  bVar18 = false;
  bVar7 = false;
  plVar11 = (longlong *)param_1[0x17];
  local_res18 = param_3;
  if (plVar11 != (longlong *)0x0) {
    plVar14 = (longlong *)param_1[0x18];
    if (plVar11 == plVar14) {
      lVar13 = *plVar11;
      if (lVar13 != 0) {
        if (plVar11 != plVar14) {
          iVar9 = DAT_1406080a8 + 1;
          bVar18 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar9;
          if (bVar18) {
            FUN_140176d60(1,plVar14,param_3,param_4,0xfffffffffffffffe);
          }
          lVar13 = 0;
        }
        FUN_14034ed40(lVar13);
        bVar18 = true;
        bVar7 = true;
        local_90 = lVar13;
      }
    }
    else {
      iVar9 = DAT_1406080a8 + 1;
      bVar17 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar9;
      if (bVar17) {
        FUN_140176d60(1,plVar14,param_3,param_4,0xfffffffffffffffe);
      }
    }
  }
  lVar13 = 0;
  plVar11 = (longlong *)*param_1;
  if (plVar11 != (longlong *)param_1[1]) {
    do {
      iVar9 = DAT_140608230;
      plVar14 = (longlong *)*plVar11;
      if (plVar14 == (longlong *)0x0) {
LAB_1402536c0:
        lVar16 = 0;
      }
      else {
        if (plVar14 != (longlong *)plVar11[1]) {
          DAT_140608230 = DAT_140608230 + 1;
          if (iVar9 == 0) {
            FUN_140176d60(1);
          }
          goto LAB_1402536c0;
        }
        lVar16 = *plVar14;
      }
      iVar9 = DAT_140608230;
      lVar16 = *(longlong *)(lVar16 + 0x60);
      plVar14 = (longlong *)*plVar11;
      if (plVar14 == (longlong *)0x0) {
LAB_1402536f2:
        lVar15 = 0;
      }
      else {
        if (plVar14 != (longlong *)plVar11[1]) {
          DAT_140608230 = DAT_140608230 + 1;
          if (iVar9 == 0) {
            FUN_140176d60(1);
          }
          goto LAB_1402536f2;
        }
        lVar15 = *plVar14;
      }
      if (lVar16 == 0) {
        if (*(longlong *)(lVar15 + 0x68) != 0) {
          plVar10 = (longlong *)FUN_14027d480(*(longlong *)(lVar15 + 0x68),local_60);
          plVar14 = local_58;
          goto LAB_140253725;
        }
      }
      else {
        plVar10 = (longlong *)FUN_1402533e0(lVar16,local_70);
        plVar14 = local_68;
LAB_140253725:
        lVar13 = *plVar10;
        if (plVar14 != (longlong *)0x0) {
          LOCK();
          plVar10 = plVar14 + 1;
          *(int *)plVar10 = (int)*plVar10 + -1;
          UNLOCK();
          if ((int)*plVar10 == 0) {
            (**(code **)(*plVar14 + 8))(plVar14);
            LOCK();
            piVar1 = (int *)((longlong)plVar14 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*plVar14 + 0x10))(plVar14);
            }
          }
        }
      }
      pfVar8 = local_res18;
      if ((lVar13 != 0) &&
         (iVar9 = (int)(*(longlong *)(lVar13 + 0xe0) - *(longlong *)(lVar13 + 0xd8) >> 4),
         lVar16 = (longlong)iVar9, 0 < iVar9)) {
        lVar15 = 0;
        do {
          lVar2 = *(longlong *)(lVar15 + *(longlong *)(lVar13 + 0xd8));
          plVar14 = *(longlong **)(lVar15 + 8 + *(longlong *)(lVar13 + 0xd8));
          if (plVar14 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar14 + 1) = (int)plVar14[1] + 1;
            UNLOCK();
          }
          iVar9 = DAT_140608230;
          fVar22 = param_4 + *(float *)(lVar2 + 0x34);
          fVar21 = pfVar8[2] - *(float *)(lVar2 + 0x30);
          fVar19 = pfVar8[1] - *(float *)(lVar2 + 0x2c);
          fVar20 = *pfVar8 - *(float *)(lVar2 + 0x28);
          if (fVar20 * fVar20 + fVar19 * fVar19 + fVar21 * fVar21 <= fVar22 * fVar22) {
            puVar3 = (undefined8 *)*plVar11;
            if (puVar3 == (undefined8 *)0x0) {
LAB_140253823:
              uVar12 = 0;
            }
            else {
              if (puVar3 != (undefined8 *)plVar11[1]) {
                DAT_140608230 = DAT_140608230 + 1;
                if (iVar9 == 0) {
                  FUN_140176d60(CONCAT71((int7)((ulonglong)lVar2 >> 8),1));
                }
                goto LAB_140253823;
              }
              uVar12 = *puVar3;
            }
            puVar3 = (undefined8 *)param_2[1];
            local_res10 = uVar12;
            if ((&local_res10 < puVar3) && (puVar4 = (undefined8 *)*param_2, puVar4 <= &local_res10)
               ) {
              if (puVar3 == (undefined8 *)param_2[2]) {
                FUN_140195b20(param_2);
              }
              if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
                *(undefined8 *)param_2[1] =
                     *(undefined8 *)
                      (*param_2 + ((longlong)&local_res10 - (longlong)puVar4 >> 3) * 8);
              }
            }
            else {
              if (puVar3 == (undefined8 *)param_2[2]) {
                FUN_140195b20(param_2);
              }
              if ((undefined8 *)param_2[1] != (undefined8 *)0x0) {
                *(undefined8 *)param_2[1] = uVar12;
              }
            }
            param_2[1] = param_2[1] + 8;
          }
          if (plVar14 != (longlong *)0x0) {
            LOCK();
            plVar10 = plVar14 + 1;
            *(int *)plVar10 = (int)*plVar10 + -1;
            UNLOCK();
            if ((int)*plVar10 == 0) {
              (**(code **)(*plVar14 + 8))(plVar14);
              LOCK();
              piVar1 = (int *)((longlong)plVar14 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar14 + 0x10))();
              }
            }
          }
          lVar15 = lVar15 + 0x10;
          lVar16 = lVar16 + -1;
        } while (lVar16 != 0);
      }
      plVar11 = plVar11 + 2;
      bVar18 = bVar7;
    } while (plVar11 != (longlong *)param_1[1]);
  }
  uVar5 = param_2[1];
  uVar6 = *param_2;
  if (bVar18) {
    FUN_14034edd0(local_90);
  }
  return uVar6 == uVar5;
}



void FUN_140253930(longlong param_1,char *param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5)

{
  char cVar1;
  longlong *plVar2;
  int iVar3;
  ulonglong uVar4;
  char *pcVar5;
  char *pcVar6;
  longlong lVar7;
  longlong lVar8;
  char *pcVar9;
  bool bVar10;
  bool bVar11;
  undefined8 uVar12;
  longlong lVar13;
  undefined1 uVar14;
  char local_40;
  undefined7 uStack_3f;
  longlong local_30;
  ulonglong local_28;
  
  uVar12 = 0xfffffffffffffffe;
  lVar7 = 0;
  lVar13 = 0;
  bVar11 = false;
  uVar14 = 0;
  plVar2 = *(longlong **)(param_1 + 0xb8);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0xc0)) {
      lVar8 = *plVar2;
      lVar7 = 0;
      if (lVar8 != 0) {
        if (plVar2 != *(longlong **)(param_1 + 0xc0)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar11 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar11) {
            FUN_140176d60(1);
          }
          lVar8 = 0;
        }
        lVar13 = lVar8;
        FUN_14034ed40();
        bVar11 = true;
        uVar14 = 1;
        lVar7 = lVar8;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar10) {
        FUN_140176d60();
      }
    }
  }
  local_28 = 0xf;
  local_30 = 0;
  local_40 = '\0';
  uVar4 = 0xffffffffffffffff;
  pcVar9 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar9;
    pcVar9 = pcVar9 + 1;
  } while (cVar1 != '\0');
  FUN_140003e50(&local_40,param_2,~uVar4 - 1);
  if (*(longlong *)(param_1 + 0x48) == 0) {
    lVar13 = 0;
  }
  else {
    pcVar9 = (char *)CONCAT71(uStack_3f,local_40);
    pcVar6 = &local_40;
    if (0xf < local_28) {
      pcVar6 = pcVar9;
    }
    pcVar5 = &local_40;
    if (0xf < local_28) {
      pcVar5 = pcVar9;
    }
    uVar4 = 0;
    for (; pcVar5 != pcVar6 + local_30; pcVar5 = pcVar5 + 1) {
      pcVar9 = (char *)(uVar4 * 0x40);
      uVar4 = uVar4 ^ (ulonglong)(pcVar9 + (longlong)*pcVar5 + (uVar4 >> 2) + 0x9e3779b9);
    }
    lVar13 = FUN_140247f10(*(longlong *)(param_1 + 0x28) +
                           (uVar4 % *(ulonglong *)(param_1 + 0x30)) * 8,&local_40,pcVar9,uVar4,
                           uVar12,lVar13,uVar14);
  }
  if (0xf < local_28) {
    operator_delete((void *)CONCAT71(uStack_3f,local_40));
  }
  local_28 = 0xf;
  local_30 = 0;
  local_40 = '\0';
  if (lVar13 != 0) {
    FUN_140252e10(*(undefined8 *)(lVar13 + 0x30),param_3,param_4,param_5);
  }
  if (bVar11) {
    FUN_14034edd0(lVar7);
  }
  return;
}



ulonglong FUN_140253b30(longlong param_1,uint param_2,undefined4 param_3,undefined4 param_4,
                       undefined4 param_5)

{
  longlong *plVar1;
  int iVar2;
  ulonglong uVar3;
  uint *puVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  undefined8 uVar10;
  longlong lVar11;
  undefined1 uVar12;
  
  uVar10 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar6 = 0;
  lVar11 = 0;
  bVar9 = false;
  uVar12 = 0;
  plVar1 = *(longlong **)(param_1 + 0xb8);
  lVar7 = lVar5;
  if (plVar1 != (longlong *)0x0) {
    lVar7 = lVar6;
    if (plVar1 == *(longlong **)(param_1 + 0xc0)) {
      if (*plVar1 != 0) {
        lVar7 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0xc0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar7 = lVar5,
           DAT_1406080a8 = iVar2, bVar9)) {
          FUN_140176d60(1);
        }
        lVar11 = lVar7;
        FUN_14034ed40(lVar7);
        bVar9 = true;
        uVar12 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  uVar3 = (ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 0x78);
  if (*(longlong *)(param_1 + 0x68) != 0) {
    for (puVar4 = *(uint **)(*(longlong *)(param_1 + 0x68) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x78)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 4)) {
      if ((puVar4[6] == param_2) && (*puVar4 == param_2)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar3 = FUN_140252e10(*(undefined8 *)(puVar4 + 2),param_3,param_4,param_5,uVar10,lVar11,
                                uVar12);
        }
        break;
      }
    }
  }
  if (bVar9) {
    uVar3 = FUN_14034edd0(lVar7);
  }
  return uVar3;
}



void thunk_FUN_140253d30(void)

{
  FUN_140253d30();
  return;
}



void FUN_140253ca0(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_140253db0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140253db0(param_1,uVar2);
  }
  return;
}



void FUN_140253d30(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_140250d40(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_140608234 + 1;
      bVar5 = DAT_140608234 == 0;
      DAT_140608234 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_140253db0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140254230(*param_1,param_1[1],local_res10,param_4,uVar5);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140253f40();
      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;
}



void FUN_140253ec0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x18) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x10); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x10))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      FUN_1402541a0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x10);
  FUN_1402541a0(param_1,param_2);
  return;
}



void FUN_140253f40(undefined8 *param_1,undefined8 *param_2)

{
  int *piVar1;
  undefined8 *puVar2;
  void *pvVar3;
  int iVar4;
  
  iVar4 = DAT_140608234;
  for (; param_1 != param_2; param_1 = param_1 + 2) {
    puVar2 = (undefined8 *)*param_1;
    DAT_140608234 = 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_140250d40(pvVar3);
              operator_delete(pvVar3);
            }
            operator_delete(puVar2);
          }
        }
      }
      else {
        DAT_140608234 = iVar4 + 1;
        if (iVar4 == 0) {
          FUN_140176d60(1);
        }
      }
    }
    iVar4 = DAT_140608234;
  }
  DAT_140608234 = iVar4;
  return;
}



void FUN_140253ff0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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;
}



void FUN_1402541a0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(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_1402cddb0();
      FUN_140253ff0(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_14000d450(0x80004005);
}



longlong * FUN_140254230(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_140254280(longlong param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4,
                  undefined1 param_5,undefined8 param_6,undefined4 param_7)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  undefined1 local_118 [4];
  undefined8 local_114;
  
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    iVar3 = 0;
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    iVar2 = iVar3;
    if (lVar1 != 0) {
      iVar2 = FUN_1402ce620(lVar1,param_6);
      iVar2 = iVar2 + 1;
    }
    local_118[0] = 0;
    local_114 = 0;
    if (*(int **)(param_1 + 0x21a0) != (int *)0x0) {
      iVar3 = **(int **)(param_1 + 0x21a0);
    }
    FUN_1402b7c60(local_118,param_2,*(undefined4 *)(param_1 + 0x128),*(undefined4 *)(param_1 + 300),
                  iVar2,param_3,param_1 + 0x178,param_1 + 0x154,param_4,param_5,iVar3,param_7,
                  *(undefined4 *)(param_1 + 0xfec));
    FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  }
  return;
}



void FUN_1402543a0(longlong param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4,
                  undefined1 param_5,undefined8 param_6,undefined4 param_7,undefined4 param_8)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  undefined1 local_118 [4];
  undefined8 local_114;
  
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    iVar3 = 0;
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    iVar2 = iVar3;
    if (lVar1 != 0) {
      iVar2 = FUN_1402ce620(lVar1,param_6);
      iVar2 = iVar2 + 1;
    }
    local_118[0] = 0;
    local_114 = 0;
    if (*(int **)(param_1 + 0x21a0) != (int *)0x0) {
      iVar3 = **(int **)(param_1 + 0x21a0);
    }
    FUN_1402b8870(local_118,param_2,*(undefined4 *)(param_1 + 0x128),*(undefined4 *)(param_1 + 300),
                  iVar2,param_3,param_1 + 0x178,param_1 + 0x154,param_4,param_5,iVar3,param_7,
                  param_8);
    FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  }
  return;
}



void FUN_1402544c0(longlong param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4,
                  undefined1 param_5,undefined8 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,undefined4 param_10)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  undefined1 local_118 [4];
  undefined8 local_114;
  
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    iVar3 = 0;
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    iVar2 = iVar3;
    if (lVar1 != 0) {
      iVar2 = FUN_1402ce620(lVar1,param_6);
      iVar2 = iVar2 + 1;
    }
    local_118[0] = 0;
    local_114 = 0;
    if (*(int **)(param_1 + 0x21a0) != (int *)0x0) {
      iVar3 = **(int **)(param_1 + 0x21a0);
    }
    FUN_1402b7f70(local_118,param_2,*(undefined4 *)(param_1 + 0x128),*(undefined4 *)(param_1 + 300),
                  iVar2,param_3,param_1 + 0x178,param_1 + 0x154,param_4,param_5,iVar3,param_7,
                  param_8,param_9,param_10);
    FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  }
  return;
}



void FUN_140254600(longlong param_1,undefined4 param_2,undefined4 param_3,undefined1 param_4,
                  undefined1 param_5,undefined8 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,undefined4 param_10)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  undefined1 local_118 [4];
  undefined8 local_114;
  
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    iVar3 = 0;
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    iVar2 = iVar3;
    if (lVar1 != 0) {
      iVar2 = FUN_1402ce620(lVar1,param_6);
      iVar2 = iVar2 + 1;
    }
    local_118[0] = 0;
    local_114 = 0;
    if (*(int **)(param_1 + 0x21a0) != (int *)0x0) {
      iVar3 = **(int **)(param_1 + 0x21a0);
    }
    FUN_1402b82e0(local_118,param_2,*(undefined4 *)(param_1 + 0x128),*(undefined4 *)(param_1 + 300),
                  iVar2,param_3,param_1 + 0x178,param_1 + 0x154,param_4,param_5,iVar3,param_7,
                  param_8,param_9,param_10);
    FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  }
  return;
}



void FUN_140254750(longlong param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,
                  undefined4 param_5,undefined4 param_6)

{
  longlong lVar1;
  int iVar2;
  undefined1 local_118 [4];
  undefined8 local_114;
  
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    lVar1 = *(longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x10) + 0xd8);
    if (lVar1 == 0) {
      iVar2 = 0;
    }
    else {
      iVar2 = FUN_1402ce620(lVar1,param_4);
      iVar2 = iVar2 + 1;
    }
    local_118[0] = 0;
    local_114 = 0;
    FUN_1402b8650(local_118,param_2,*(undefined4 *)(param_1 + 0x128),*(undefined4 *)(param_1 + 300),
                  iVar2,param_3,param_1 + 0x178,param_1 + 0x154,param_5,param_6);
    FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  }
  return;
}



void FUN_140254820(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined8 param_8,
                  undefined8 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12,
                  undefined4 param_13)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_114 = 0;
  local_118[0] = 0;
  FUN_1402b8c50(local_118,*(undefined4 *)(param_1 + 0x128),param_2,param_3,param_4,param_5,param_6,
                param_7,param_8,param_9,param_10,param_11,param_12,param_13);
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_1402548e0(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined1 param_8,
                  undefined8 param_9,undefined8 param_10,undefined4 param_11,undefined4 param_12,
                  undefined4 param_13)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_118[0] = 0;
  local_114 = 0;
  FUN_1402ba510(local_118,*(undefined4 *)(param_1 + 0x128),*(undefined4 *)(param_1 + 300),param_2,
                param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,param_11,param_12,
                param_13);
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_1402549b0(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined8 param_9,undefined8 param_10)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_118[0] = 0;
  local_114 = 0;
  FUN_1402b9700(local_118,*(undefined4 *)(param_1 + 0x128),param_2,param_3,param_4,param_5,param_6,
                param_7,param_8,param_9,param_10);
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_140254a50(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined8 param_9,undefined8 param_10,undefined4 param_11,undefined4 param_12)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_114 = 0;
  local_118[0] = 0;
  FUN_1402b9400(local_118,*(undefined4 *)(param_1 + 0x128),param_2,param_3,param_4,param_5,param_6,
                param_7,param_8,param_9,param_10,param_11,param_12);
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_140254b10(longlong param_1)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_118[0] = 0;
  local_114 = 0;
  FUN_1402b7b20(local_118,*(undefined4 *)(param_1 + 0x128),(int)*(float *)(param_1 + 0x598),
                (int)*(float *)(param_1 + 0x5a0),*(undefined4 *)(param_1 + 0x610),
                *(undefined4 *)(param_1 + 0x614));
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  *(undefined8 *)(param_1 + 0x610) = 0;
  return;
}



// WARNING: Removing unreachable block (ram,0x000140254bd7)

void FUN_140254b90(longlong param_1,undefined4 param_2)

{
  undefined4 local_res10 [6];
  undefined1 local_118 [4];
  int local_114;
  int local_110;
  undefined4 local_10c;
  undefined1 auStack_108 [256];
  
  local_10c = *(undefined4 *)(param_1 + 0x128);
  local_118[0] = 0x19;
  local_114 = 4;
  local_110 = 4;
  local_res10[0] = param_2;
  memcpy(auStack_108,local_res10,4);
  local_114 = local_114 + 4;
  local_110 = local_114;
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_140254c40(longlong *param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_118[0] = 0;
  local_114 = 0;
  uVar1 = (**(code **)(*param_1 + 0x220))();
  uVar2 = (**(code **)(*param_1 + 0x218))(param_1);
  uVar3 = (**(code **)(*param_1 + 0x210))(param_1);
  FUN_1402bb870(local_118,param_1 + 0x25,uVar3,uVar2,uVar1);
  FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_118);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140254d1c)

void FUN_140254cd0(longlong param_1)

{
  undefined4 local_res8 [2];
  undefined1 local_118 [4];
  int local_114;
  int local_110;
  undefined4 local_10c;
  undefined1 auStack_108 [256];
  
  local_10c = *(undefined4 *)(param_1 + 0x128);
  local_res8[0] = *(undefined4 *)(param_1 + 0x1e50);
  local_118[0] = 0x25;
  local_114 = 4;
  local_110 = 4;
  memcpy(auStack_108,local_res8,4);
  local_114 = local_114 + 4;
  local_110 = local_114;
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_140254d80(longlong param_1)

{
  code *pcVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  ulonglong uVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 *puVar8;
  ulonglong uVar9;
  undefined4 *puVar10;
  undefined4 local_res8 [2];
  undefined4 *local_40;
  undefined4 *local_38;
  undefined4 *local_30;
  
  if (*(longlong *)(param_1 + 0x1e80) != 0) {
    puVar3 = (undefined4 *)0x0;
    local_40 = (undefined4 *)0x0;
    local_38 = (undefined4 *)0x0;
    puVar10 = (undefined4 *)0x0;
    local_30 = (undefined4 *)0x0;
    puVar8 = (undefined4 *)(param_1 + 0x618);
    lVar7 = 0;
    do {
      if ((puVar8 < local_38) && (puVar3 <= puVar8)) {
        lVar6 = (longlong)puVar8 - (longlong)puVar3;
        if (local_38 == puVar10) {
          uVar9 = (longlong)local_38 - (longlong)puVar3 >> 2;
          if (0x3ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar4 = (longlong)puVar10 - (longlong)puVar3 >> 2;
          if (uVar4 < uVar9) {
            if (0x3fffffffffffffff - (uVar4 >> 1) < uVar4) {
              uVar4 = 0;
            }
            else {
              uVar4 = uVar4 + (uVar4 >> 1);
            }
            if (uVar4 < uVar9) {
              uVar4 = uVar9;
            }
            FUN_140051e60(&local_40,uVar4);
            puVar3 = local_40;
            puVar10 = local_30;
          }
        }
        if (local_38 != (undefined4 *)0x0) {
          uVar2 = puVar3[lVar6 >> 2];
LAB_140254ed9:
          *local_38 = uVar2;
          puVar3 = local_40;
          puVar10 = local_30;
        }
      }
      else {
        if (local_38 == puVar10) {
          uVar9 = (longlong)local_38 - (longlong)puVar3 >> 2;
          if (0x3ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar4 = (longlong)puVar10 - (longlong)puVar3 >> 2;
          if (uVar4 < uVar9) {
            if (0x3fffffffffffffff - (uVar4 >> 1) < uVar4) {
              uVar4 = 0;
            }
            else {
              uVar4 = uVar4 + (uVar4 >> 1);
            }
            if (uVar4 < uVar9) {
              uVar4 = uVar9;
            }
            FUN_140051e60(&local_40,uVar4);
            puVar3 = local_40;
            puVar10 = local_30;
          }
        }
        if (local_38 != (undefined4 *)0x0) {
          uVar2 = *puVar8;
          goto LAB_140254ed9;
        }
      }
      local_38 = local_38 + 1;
      lVar7 = lVar7 + 1;
      puVar8 = puVar8 + 1;
    } while (lVar7 < 0x47);
    local_res8[0] = *(undefined4 *)(param_1 + 0x128);
    plVar5 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x78);
    (**(code **)(*plVar5 + 0x740))
              (plVar5,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,local_res8
               ,&local_40);
    *(undefined1 *)(param_1 + 0x606) = 0;
    if (local_40 != (undefined4 *)0x0) {
      operator_delete(local_40);
    }
  }
  return;
}



void FUN_140254fa0(longlong param_1)

{
  code *pcVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  ulonglong uVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 *puVar8;
  ulonglong uVar9;
  undefined4 *puVar10;
  undefined4 local_res8 [2];
  undefined4 *local_40;
  undefined4 *local_38;
  undefined4 *local_30;
  
  if (*(longlong *)(param_1 + 0x1e80) != 0) {
    puVar3 = (undefined4 *)0x0;
    local_40 = (undefined4 *)0x0;
    local_38 = (undefined4 *)0x0;
    puVar10 = (undefined4 *)0x0;
    local_30 = (undefined4 *)0x0;
    puVar8 = (undefined4 *)(param_1 + 0x734);
    lVar7 = 0;
    do {
      if ((puVar8 < local_38) && (puVar3 <= puVar8)) {
        lVar6 = (longlong)puVar8 - (longlong)puVar3;
        if (local_38 == puVar10) {
          uVar9 = (longlong)local_38 - (longlong)puVar3 >> 2;
          if (0x3ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar4 = (longlong)puVar10 - (longlong)puVar3 >> 2;
          if (uVar4 < uVar9) {
            if (0x3fffffffffffffff - (uVar4 >> 1) < uVar4) {
              uVar4 = 0;
            }
            else {
              uVar4 = uVar4 + (uVar4 >> 1);
            }
            if (uVar4 < uVar9) {
              uVar4 = uVar9;
            }
            FUN_14030db30(&local_40,uVar4);
            puVar3 = local_40;
            puVar10 = local_30;
          }
        }
        if (local_38 != (undefined4 *)0x0) {
          uVar2 = puVar3[lVar6 >> 2];
LAB_1402550f9:
          *local_38 = uVar2;
          puVar3 = local_40;
          puVar10 = local_30;
        }
      }
      else {
        if (local_38 == puVar10) {
          uVar9 = (longlong)local_38 - (longlong)puVar3 >> 2;
          if (0x3ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar4 = (longlong)puVar10 - (longlong)puVar3 >> 2;
          if (uVar4 < uVar9) {
            if (0x3fffffffffffffff - (uVar4 >> 1) < uVar4) {
              uVar4 = 0;
            }
            else {
              uVar4 = uVar4 + (uVar4 >> 1);
            }
            if (uVar4 < uVar9) {
              uVar4 = uVar9;
            }
            FUN_14030db30(&local_40,uVar4);
            puVar3 = local_40;
            puVar10 = local_30;
          }
        }
        if (local_38 != (undefined4 *)0x0) {
          uVar2 = *puVar8;
          goto LAB_1402550f9;
        }
      }
      local_38 = local_38 + 1;
      lVar7 = lVar7 + 1;
      puVar8 = puVar8 + 1;
    } while (lVar7 < 0x45);
    local_res8[0] = *(undefined4 *)(param_1 + 0x128);
    plVar5 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x78);
    (**(code **)(*plVar5 + 0x750))
              (plVar5,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,local_res8
               ,&local_40);
    *(undefined1 *)(param_1 + 0x607) = 0;
    if (local_40 != (undefined4 *)0x0) {
      operator_delete(local_40);
    }
  }
  return;
}



void FUN_1402551c0(longlong param_1)

{
  code *pcVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  ulonglong uVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 *puVar8;
  ulonglong uVar9;
  undefined4 *puVar10;
  undefined4 local_res8 [2];
  undefined4 *local_40;
  undefined4 *local_38;
  undefined4 *local_30;
  
  if (*(longlong *)(param_1 + 0x1e80) != 0) {
    puVar3 = (undefined4 *)0x0;
    local_40 = (undefined4 *)0x0;
    local_38 = (undefined4 *)0x0;
    puVar10 = (undefined4 *)0x0;
    local_30 = (undefined4 *)0x0;
    puVar8 = (undefined4 *)(param_1 + 0x848);
    lVar7 = 0;
    do {
      if ((puVar8 < local_38) && (puVar3 <= puVar8)) {
        lVar6 = (longlong)puVar8 - (longlong)puVar3;
        if (local_38 == puVar10) {
          uVar9 = (longlong)local_38 - (longlong)puVar3 >> 2;
          if (0x3ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar4 = (longlong)puVar10 - (longlong)puVar3 >> 2;
          if (uVar4 < uVar9) {
            if (0x3fffffffffffffff - (uVar4 >> 1) < uVar4) {
              uVar4 = 0;
            }
            else {
              uVar4 = uVar4 + (uVar4 >> 1);
            }
            if (uVar4 < uVar9) {
              uVar4 = uVar9;
            }
            FUN_140051e60(&local_40,uVar4);
            puVar3 = local_40;
            puVar10 = local_30;
          }
        }
        if (local_38 != (undefined4 *)0x0) {
          uVar2 = puVar3[lVar6 >> 2];
LAB_140255319:
          *local_38 = uVar2;
          puVar3 = local_40;
          puVar10 = local_30;
        }
      }
      else {
        if (local_38 == puVar10) {
          uVar9 = (longlong)local_38 - (longlong)puVar3 >> 2;
          if (0x3ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar4 = (longlong)puVar10 - (longlong)puVar3 >> 2;
          if (uVar4 < uVar9) {
            if (0x3fffffffffffffff - (uVar4 >> 1) < uVar4) {
              uVar4 = 0;
            }
            else {
              uVar4 = uVar4 + (uVar4 >> 1);
            }
            if (uVar4 < uVar9) {
              uVar4 = uVar9;
            }
            FUN_140051e60(&local_40,uVar4);
            puVar3 = local_40;
            puVar10 = local_30;
          }
        }
        if (local_38 != (undefined4 *)0x0) {
          uVar2 = *puVar8;
          goto LAB_140255319;
        }
      }
      local_38 = local_38 + 1;
      lVar7 = lVar7 + 1;
      puVar8 = puVar8 + 1;
    } while (lVar7 < 8);
    local_res8[0] = *(undefined4 *)(param_1 + 0x128);
    plVar5 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x78);
    (**(code **)(*plVar5 + 0x760))
              (plVar5,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,local_res8
               ,&local_40);
    *(undefined1 *)(param_1 + 0x609) = 0;
    if (local_40 != (undefined4 *)0x0) {
      operator_delete(local_40);
    }
  }
  return;
}



void FUN_1402553e0(longlong param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 local_res8 [2];
  undefined8 local_58;
  undefined4 local_48;
  undefined4 uStack_44;
  uint uStack_40;
  undefined4 uStack_3c;
  void *local_38;
  undefined8 local_30;
  undefined8 local_28;
  ulonglong local_18;
  
  if (*(longlong *)(param_1 + 0x1e80) != 0) {
    lVar3 = 0;
    local_res8[0] = 0;
    local_38 = (void *)0x0;
    local_30 = 0;
    local_28 = 0;
    FUN_14008d100(&local_38,0,local_res8);
    local_18 = 0;
    do {
      local_58 = local_38;
      uStack_40 = 0;
      if (local_18 != 0) {
        if (((longlong)local_18 < 0) && (local_18 != 0)) {
          lVar1 = -((-local_18 - 1 >> 5) * 4 + 4);
        }
        else {
          lVar1 = (local_18 >> 5) * 4;
        }
        local_58 = (void *)((longlong)local_38 + lVar1);
        uStack_40 = (uint)local_18 & 0x1f;
      }
      local_48 = (undefined4)local_58;
      uStack_44 = local_58._4_4_;
      uStack_3c = 0;
      FUN_14008f040(&local_38,&local_48,1,*(undefined1 *)(lVar3 + 0x8a9 + param_1));
      lVar3 = lVar3 + 1;
    } while (lVar3 < 4);
    local_res8[0] = *(undefined4 *)(param_1 + 0x128);
    plVar2 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x78);
    (**(code **)(*plVar2 + 0x770))
              (plVar2,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,local_res8
               ,&local_38);
    *(undefined1 *)(param_1 + 0x60a) = 0;
    local_18 = 0;
    if (local_38 != (void *)0x0) {
      operator_delete(local_38);
    }
  }
  return;
}



void FUN_140255540(longlong param_1)

{
  code *pcVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  ulonglong uVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 *puVar8;
  ulonglong uVar9;
  undefined4 *puVar10;
  undefined4 local_res8 [2];
  undefined4 *local_40;
  undefined4 *local_38;
  undefined4 *local_30;
  
  if (*(longlong *)(param_1 + 0x1e80) != 0) {
    puVar3 = (undefined4 *)0x0;
    local_40 = (undefined4 *)0x0;
    local_38 = (undefined4 *)0x0;
    puVar10 = (undefined4 *)0x0;
    local_30 = (undefined4 *)0x0;
    puVar8 = (undefined4 *)(param_1 + 0x868);
    lVar7 = 0;
    do {
      if ((puVar8 < local_38) && (puVar3 <= puVar8)) {
        lVar6 = (longlong)puVar8 - (longlong)puVar3;
        if (local_38 == puVar10) {
          uVar9 = (longlong)local_38 - (longlong)puVar3 >> 2;
          if (0x3ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar4 = (longlong)puVar10 - (longlong)puVar3 >> 2;
          if (uVar4 < uVar9) {
            if (0x3fffffffffffffff - (uVar4 >> 1) < uVar4) {
              uVar4 = 0;
            }
            else {
              uVar4 = uVar4 + (uVar4 >> 1);
            }
            if (uVar4 < uVar9) {
              uVar4 = uVar9;
            }
            FUN_140051e60(&local_40,uVar4);
            puVar3 = local_40;
            puVar10 = local_30;
          }
        }
        if (local_38 != (undefined4 *)0x0) {
          uVar2 = puVar3[lVar6 >> 2];
LAB_140255699:
          *local_38 = uVar2;
          puVar3 = local_40;
          puVar10 = local_30;
        }
      }
      else {
        if (local_38 == puVar10) {
          uVar9 = (longlong)local_38 - (longlong)puVar3 >> 2;
          if (0x3ffffffffffffffe < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar1 = (code *)swi(3);
            (*pcVar1)();
            return;
          }
          uVar9 = uVar9 + 1;
          uVar4 = (longlong)puVar10 - (longlong)puVar3 >> 2;
          if (uVar4 < uVar9) {
            if (0x3fffffffffffffff - (uVar4 >> 1) < uVar4) {
              uVar4 = 0;
            }
            else {
              uVar4 = uVar4 + (uVar4 >> 1);
            }
            if (uVar4 < uVar9) {
              uVar4 = uVar9;
            }
            FUN_140051e60(&local_40,uVar4);
            puVar3 = local_40;
            puVar10 = local_30;
          }
        }
        if (local_38 != (undefined4 *)0x0) {
          uVar2 = *puVar8;
          goto LAB_140255699;
        }
      }
      local_38 = local_38 + 1;
      lVar7 = lVar7 + 1;
      puVar8 = puVar8 + 1;
    } while (lVar7 < 8);
    local_res8[0] = *(undefined4 *)(param_1 + 0x128);
    plVar5 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x78);
    (**(code **)(*plVar5 + 0x780))
              (plVar5,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,local_res8
               ,&local_40);
    *(undefined1 *)(param_1 + 0x60b) = 0;
    if (local_40 != (undefined4 *)0x0) {
      operator_delete(local_40);
    }
  }
  return;
}



void FUN_140255760(longlong param_1)

{
  longlong lVar1;
  undefined1 local_res8 [8];
  undefined4 local_res10 [6];
  
  lVar1 = *(longlong *)(param_1 + 0x1e80);
  if (lVar1 == 0) {
    *(undefined1 *)(param_1 + 0x604) = 0;
    return;
  }
  local_res8[0] = *(undefined1 *)(param_1 + 0x1869);
  local_res10[0] = *(undefined4 *)(param_1 + 0x128);
  (**(code **)(*(longlong *)(**(longlong **)(lVar1 + 0x48) + 0x78) + 0x7c0))
            (**(longlong **)(lVar1 + 0x48) + 0x78,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,
             local_res10,local_res8);
  *(undefined1 *)(param_1 + 0x604) = 0;
  return;
}



void FUN_1402557e0(longlong param_1)

{
  longlong lVar1;
  float local_res8 [2];
  undefined4 local_res10 [6];
  
  lVar1 = *(longlong *)(param_1 + 0x1e80);
  if (lVar1 == 0) {
    *(undefined1 *)(param_1 + 0x605) = 0;
    return;
  }
  local_res10[0] = *(undefined4 *)(param_1 + 0x128);
  local_res8[0] =
       *(float *)(param_1 + 0x5e0) + *(float *)(param_1 + 0x5dc) + *(float *)(param_1 + 0x5e4) +
       *(float *)(param_1 + 0x908);
  (**(code **)(*(longlong *)(**(longlong **)(lVar1 + 0x48) + 0x78) + 0x720))
            (**(longlong **)(lVar1 + 0x48) + 0x78,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,
             local_res10,local_res8);
  *(undefined1 *)(param_1 + 0x605) = 0;
  return;
}



void FUN_140255870(longlong param_1)

{
  longlong lVar1;
  undefined4 local_res8 [2];
  undefined4 local_res10 [6];
  
  lVar1 = *(longlong *)(param_1 + 0x1e80);
  if (lVar1 == 0) {
    *(undefined1 *)(param_1 + 0x608) = 0;
    return;
  }
  local_res8[0] = *(undefined4 *)(param_1 + 0xd7c);
  local_res10[0] = *(undefined4 *)(param_1 + 0x128);
  (**(code **)(*(longlong *)(**(longlong **)(lVar1 + 0x48) + 0x78) + 0x730))
            (**(longlong **)(lVar1 + 0x48) + 0x78,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,
             local_res10,local_res8);
  *(undefined1 *)(param_1 + 0x608) = 0;
  return;
}



void FUN_1402558e0(longlong param_1)

{
  longlong lVar1;
  undefined4 local_res8 [2];
  undefined4 local_res10 [6];
  
  lVar1 = *(longlong *)(param_1 + 0x1e80);
  if (lVar1 == 0) {
    *(undefined1 *)(param_1 + 0x60d) = 0;
    return;
  }
  local_res8[0] = *(undefined4 *)(param_1 + 0xfec);
  local_res10[0] = *(undefined4 *)(param_1 + 0x128);
  (**(code **)(*(longlong *)(**(longlong **)(lVar1 + 0x48) + 0x78) + 0xc10))
            (**(longlong **)(lVar1 + 0x48) + 0x78,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,
             local_res10,local_res8);
  *(undefined1 *)(param_1 + 0x60d) = 0;
  return;
}



void FUN_140255950(longlong param_1)

{
  longlong *plVar1;
  undefined1 local_res8;
  undefined1 local_res9;
  undefined1 local_resa;
  
  local_res8 = (undefined1)(int)(*(float *)(param_1 + 0x154) * 125.0);
  local_res9 = (undefined1)(int)(*(float *)(param_1 + 0x158) * 125.0);
  local_resa = (undefined1)(int)(*(float *)(param_1 + 0x15c) * 125.0);
  plVar1 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x380);
  (**(code **)(*plVar1 + 0x650))
            (plVar1,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,
             param_1 + 0x128,param_1 + 0x178,&local_res8);
  return;
}



void FUN_1402559f0(longlong param_1)

{
  longlong *plVar1;
  undefined1 local_res10;
  undefined1 local_res11;
  undefined1 local_res12;
  
  if (DAT_140607be2 != '\0') {
    local_res10 = (undefined1)(int)(*(float *)(param_1 + 0x154) * 125.0);
    local_res11 = (undefined1)(int)(*(float *)(param_1 + 0x158) * 125.0);
    local_res12 = (undefined1)(int)(*(float *)(param_1 + 0x15c) * 125.0);
    plVar1 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x380);
    (**(code **)(*plVar1 + 0x330))
              (plVar1,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,
               param_1 + 0x128,param_1 + 0x120,param_1 + 0x178,&local_res10);
  }
  return;
}



void FUN_140255aa0(longlong param_1)

{
  longlong *plVar1;
  undefined2 local_res10 [4];
  undefined2 local_res18 [4];
  undefined1 local_res20;
  undefined1 local_res21;
  undefined1 local_res22;
  undefined4 local_18 [6];
  
  if ((DAT_140607be2 != '\0') && (*(longlong *)(param_1 + 0x13d8) != 0)) {
    local_res10[0] = (undefined2)*(undefined4 *)(*(longlong *)(param_1 + 0x13d8) + 0x30);
    local_18[0] = *(undefined4 *)(*(longlong *)(*(longlong *)(param_1 + 0x13d8) + 0x20) + 0x4c);
    local_res20 = (undefined1)(int)(*(float *)(param_1 + 0x154) * 125.0);
    local_res21 = (undefined1)(int)(*(float *)(param_1 + 0x158) * 125.0);
    local_res22 = (undefined1)(int)(*(float *)(param_1 + 0x15c) * 125.0);
    local_res18[0] = *(undefined2 *)(param_1 + 300);
    plVar1 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x380);
    (**(code **)(*plVar1 + 0x350))
              (plVar1,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,
               param_1 + 0x128,local_res18,local_res10,local_18,param_1 + 0x178,&local_res20);
  }
  return;
}



void FUN_140255ba0(longlong param_1,undefined4 param_2,undefined1 param_3,undefined1 param_4,
                  undefined2 param_5)

{
  longlong *plVar1;
  undefined1 local_res8 [8];
  undefined4 local_res10 [6];
  undefined1 local_18;
  undefined1 local_17;
  undefined2 local_16 [11];
  
  if (*(longlong *)(param_1 + 0x13d8) != 0) {
    local_16[0] = param_5;
    local_res8[0] = 0;
    plVar1 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x1e80) + 0x48) + 0x380);
    local_res10[0] = param_2;
    local_18 = param_4;
    local_17 = param_3;
    (**(code **)(*plVar1 + 0x3b0))
              (plVar1,*(undefined4 *)(*(longlong *)(param_1 + 0x1e80) + 8),&DAT_1405d85a0,
               local_res10,&local_17,&local_18,local_16,local_res8);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140255d5a)
// WARNING: Removing unreachable block (ram,0x000140255cba)

void FUN_140255c20(uint param_1,longlong param_2)

{
  undefined4 uVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  uint uVar10;
  undefined8 *puVar11;
  undefined8 *puVar12;
  undefined8 *puVar13;
  undefined8 uVar14;
  undefined8 *local_70;
  undefined8 *local_68;
  undefined8 local_60;
  undefined8 *local_50;
  undefined8 *local_48;
  undefined8 local_40;
  
  uVar14 = 0xfffffffffffffffe;
  puVar11 = (undefined8 *)0x0;
  uVar10 = 0;
  local_70 = (undefined8 *)0x0;
  local_68 = (undefined8 *)0x0;
  local_60 = 0;
  local_50 = (undefined8 *)0x0;
  local_48 = (undefined8 *)0x0;
  local_40 = 0;
  plVar2 = (longlong *)FUN_1402e0270();
  puVar7 = puVar11;
  puVar9 = puVar11;
  puVar12 = puVar11;
  puVar13 = puVar11;
  if (*plVar2 != 0) {
    for (puVar4 = *(uint **)(*plVar2 + ((ulonglong)param_1 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar7 = (undefined8 *)0x0, puVar9 = (undefined8 *)0x0, puVar12 = (undefined8 *)0x0,
        puVar13 = (undefined8 *)0x0, puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0x90)) {
      if ((puVar4[0x92] == param_1) && (*puVar4 == param_1)) {
        if (puVar4 != (uint *)0x0) {
          FUN_14012bb70(&local_70,puVar4 + 0x40);
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          FUN_1402e0fc0(&local_50);
          puVar7 = local_70;
          puVar9 = local_68;
          puVar12 = local_50;
          puVar13 = local_48;
        }
        break;
      }
    }
  }
  plVar2 = (longlong *)FUN_1402e0270();
  if (*plVar2 != 0) {
    for (puVar4 = *(uint **)(*plVar2 + ((ulonglong)param_1 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0x90)) {
      if ((puVar4[0x92] == param_1) && (*puVar4 == param_1)) {
        if (puVar4 != (uint *)0x0) {
          uVar10 = puVar4[0x13];
        }
        break;
      }
    }
  }
  *(uint *)(param_2 + 0x3c) = uVar10;
  switch(uVar10) {
  case 1:
  case 4:
  case 0x11:
  case 0x1a:
  case 0x1d:
  case 0x2c:
  case 0x34:
  case 0x35:
  case 0x3b:
  case 0x3e:
  case 0x41:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    goto LAB_140255dd6;
  case 2:
  case 5:
  case 0x12:
  case 0x1b:
  case 0x1e:
  case 0x2d:
  case 0x36:
  case 0x3c:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
LAB_140255df6:
    if (uVar3 < 4) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(puVar7 + 1);
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)((longlong)puVar7 + 0xc);
    break;
  case 3:
  case 6:
  case 0x13:
  case 0x1c:
  case 0x1f:
  case 0x2e:
  case 0x37:
  case 0x3d:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
LAB_140255e22:
    if (uVar3 < 6) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(puVar7 + 1);
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)((longlong)puVar7 + 0xc);
    *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(puVar7 + 2);
    *(undefined4 *)(param_2 + 0x5c) = *(undefined4 *)((longlong)puVar7 + 0x14);
    break;
  case 7:
  case 8:
  case 0x32:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    goto LAB_140255e5a;
  case 9:
  case 10:
  case 0xd:
  case 0x14:
  case 0x2f:
  case 0x38:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 3) goto LAB_140255db1;
LAB_140255eab:
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)((longlong)puVar7 + 4);
    uVar1 = *(undefined4 *)(puVar7 + 1);
LAB_140255eb9:
    *(undefined4 *)(param_2 + 0x44) = uVar1;
    break;
  case 0xb:
  case 0xe:
  case 0x15:
  case 0x30:
  case 0x39:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 5) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(puVar7 + 1);
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)((longlong)puVar7 + 0xc);
    *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(puVar7 + 2);
    break;
  case 0xc:
  case 0xf:
  case 0x16:
  case 0x31:
  case 0x3a:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 7) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(puVar7 + 1);
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)((longlong)puVar7 + 0xc);
    *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(puVar7 + 2);
    *(undefined4 *)(param_2 + 0x5c) = *(undefined4 *)((longlong)puVar7 + 0x14);
    *(undefined4 *)(param_2 + 0x4c) = *(undefined4 *)(puVar7 + 3);
    break;
  case 0x10:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 2) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(int *)(param_2 + 0x54) = *(int *)((longlong)puVar7 + 4) * 0x3c;
    break;
  case 0x17:
  case 0x18:
  case 0x19:
    puVar8 = (undefined8 *)((longlong)puVar9 - (longlong)puVar7 >> 2);
    if (puVar8 != (undefined8 *)0x0) {
      puVar5 = puVar7;
      puVar6 = puVar11;
      do {
        *(undefined4 *)((param_2 - (longlong)puVar7) + 0x40 + (longlong)puVar5) =
             *(undefined4 *)puVar5;
        puVar6 = (undefined8 *)(ulonglong)((int)puVar6 + 1);
        puVar5 = (undefined8 *)((longlong)puVar5 + 4);
      } while (puVar6 < puVar8);
    }
    puVar8 = (undefined8 *)(((longlong)puVar13 - (longlong)puVar12) / 0x28);
    *(int *)(param_2 + 0x68) = (int)puVar8;
    if (puVar8 != (undefined8 *)0x0) {
      do {
        FUN_140003d90(param_2 + 0x70 + (longlong)puVar11 * 0x28,puVar12 + (longlong)puVar11 * 5,0,
                      0xffffffffffffffff,uVar14);
        puVar11 = (undefined8 *)(ulonglong)((int)puVar11 + 1);
      } while (puVar11 < puVar8);
    }
    break;
  case 0x20:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 3) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x24) = *(undefined4 *)(puVar7 + 1);
    break;
  case 0x21:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    if (uVar3 < 3) goto LAB_140256179;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)(puVar7 + 1);
    break;
  case 0x22:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    if (uVar3 < 4) {
      if (uVar3 < 3) {
        if (uVar3 < 2) goto LAB_140255db1;
        *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)puVar7;
        *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)((longlong)puVar7 + 4);
      }
      else {
        *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
        *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)((longlong)puVar7 + 4);
        *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(puVar7 + 1);
      }
    }
    else {
      *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
      *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)((longlong)puVar7 + 4);
      *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(puVar7 + 1);
      *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)((longlong)puVar7 + 0xc);
    }
    break;
  case 0x23:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 4) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x24) = *(undefined4 *)(puVar7 + 1);
    *(int *)(param_2 + 0x54) = *(int *)((longlong)puVar7 + 0xc) * 0x3c;
    break;
  case 0x24:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    if (uVar3 < 2) {
      if (uVar3 == 0) goto LAB_140255db1;
      *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
      *(undefined4 *)(param_2 + 0x20) = 0;
    }
    else {
      *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
      *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)((longlong)puVar7 + 4);
    }
    break;
  case 0x25:
  case 0x27:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
LAB_140256179:
    if (1 < uVar3) {
      *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
      uVar1 = *(undefined4 *)((longlong)puVar7 + 4);
      goto LAB_140255eb9;
    }
    goto LAB_140255db1;
  case 0x26:
  case 0x33:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    if (1 < uVar3) {
      *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
      uVar1 = *(undefined4 *)((longlong)puVar7 + 4);
      goto LAB_140255eb9;
    }
LAB_140255e5a:
    if (uVar3 != 0) {
      *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
      break;
    }
    goto LAB_140255db1;
  case 0x28:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 3) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)(puVar7 + 1);
    break;
  case 0x29:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    if (2 < uVar3) goto LAB_140255eab;
LAB_140255dd6:
    if (uVar3 < 2) {
LAB_140255db1:
      FUN_140418da0(DAT_140607fd8,L"Invalid Quest : Code[%d]",param_1);
    }
    else {
      *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
      *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)((longlong)puVar7 + 4);
    }
    break;
  case 0x2a:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    if (uVar3 < 5) goto LAB_140255df6;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(puVar7 + 1);
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)((longlong)puVar7 + 0xc);
    *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(puVar7 + 2);
    break;
  case 0x2b:
    uVar3 = (longlong)puVar9 - (longlong)puVar7 >> 2;
    if (uVar3 < 7) goto LAB_140255e22;
    *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)puVar7;
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)((longlong)puVar7 + 4);
    *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(puVar7 + 1);
    *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)((longlong)puVar7 + 0xc);
    *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(puVar7 + 2);
    *(undefined4 *)(param_2 + 0x5c) = *(undefined4 *)((longlong)puVar7 + 0x14);
    *(undefined4 *)(param_2 + 0x4c) = *(undefined4 *)(puVar7 + 3);
    break;
  case 0x3f:
  case 0x40:
  case 0x42:
    if ((longlong)puVar9 - (longlong)puVar7 >> 2 == 0) goto LAB_140255db1;
    *(undefined4 *)(param_2 + 0x54) = *(undefined4 *)puVar7;
  }
  switch(*(undefined4 *)(param_2 + 0x3c)) {
  case 0x1a:
  case 0x1d:
  case 0x3b:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 3) {
LAB_14025623c:
      FUN_140418da0(DAT_140607fd8,L"Invalid Quest : Code[%d]",param_1);
      goto switchD_140256201_caseD_20;
    }
    uVar1 = *(undefined4 *)(puVar7 + 1);
    break;
  case 0x1b:
  case 0x1e:
  case 0x3c:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 5) goto LAB_14025623c;
    uVar1 = *(undefined4 *)(puVar7 + 2);
    break;
  case 0x1c:
  case 0x1f:
  case 0x3d:
    if ((ulonglong)((longlong)puVar9 - (longlong)puVar7 >> 2) < 7) goto LAB_14025623c;
    uVar1 = *(undefined4 *)(puVar7 + 3);
    break;
  default:
    goto switchD_140256201_caseD_20;
  }
  *(undefined4 *)(param_2 + 0x20) = uVar1;
switchD_140256201_caseD_20:
  puVar9 = puVar12;
  if (puVar12 != (undefined8 *)0x0) {
    for (; puVar9 != puVar13; puVar9 = puVar9 + 5) {
      if (0xf < (ulonglong)puVar9[3]) {
        operator_delete((void *)*puVar9);
      }
      puVar9[3] = 0xf;
      puVar9[2] = 0;
      *(undefined1 *)puVar9 = 0;
    }
    operator_delete(puVar12);
  }
  if (puVar7 != (undefined8 *)0x0) {
    operator_delete(puVar7);
  }
  return;
}



void FUN_140256390(longlong param_1,longlong *param_2)

{
  uint uVar1;
  longlong lVar2;
  longlong *plVar3;
  uint *puVar4;
  longlong lVar5;
  uint uVar6;
  uint uVar7;
  undefined8 local_178;
  undefined8 uStack_170;
  undefined4 local_168;
  uint local_164;
  uint local_160;
  undefined2 local_15c;
  undefined1 local_108 [208];
  undefined8 local_38;
  
  FUN_14034ed40(param_1 + 0x48);
  uVar7 = 0;
  uVar6 = (uint)(param_2[1] - *param_2 >> 5);
  if (uVar6 != 0) {
    lVar5 = 0;
    do {
      FUN_14025c9b0(&local_178);
      lVar2 = *param_2;
      local_178 = *(undefined8 *)(lVar2 + lVar5);
      uStack_170 = ((undefined8 *)(lVar2 + lVar5))[1];
      local_168 = *(undefined4 *)(lVar2 + 0x10 + lVar5);
      uVar1 = *(uint *)(lVar2 + 0x14 + lVar5);
      local_15c = 0xff;
      local_38 = *(undefined8 *)(lVar2 + 0x18 + lVar5);
      local_164 = uVar1;
      plVar3 = (longlong *)FUN_1402e0270();
      if (*plVar3 != 0) {
        for (puVar4 = *(uint **)(*plVar3 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar3 + 2)) * 8
                                ); puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0x90)) {
          if ((puVar4[0x92] == uVar1) && (*puVar4 == uVar1)) {
            if (puVar4 != (uint *)0x0) {
              if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              local_160 = puVar4[3];
              goto LAB_14025647b;
            }
            break;
          }
        }
      }
      local_160 = 0;
LAB_14025647b:
      FUN_14025c040(param_1 + 0x20,&local_178);
      _eh_vector_destructor_iterator_(local_108,0x28,5,FUN_140129b90);
      uVar7 = uVar7 + 1;
      lVar5 = lVar5 + 0x20;
    } while (uVar7 < uVar6);
  }
  FUN_14034edd0(param_1 + 0x48);
  return;
}



// Library Function - Single Match
//  public: __cdecl Concurrency::details::SubAllocator::~SubAllocator(void) __ptr64
// 
// Library: Visual Studio 2010 Release

void __thiscall Concurrency::details::SubAllocator::~SubAllocator(SubAllocator *this)

{
  _eh_vector_destructor_iterator_(this + 0x70,0x28,5,FUN_140129b90);
  return;
}



void FUN_140256510(longlong param_1,longlong *param_2)

{
  undefined4 *puVar1;
  uint uVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  longlong *plVar6;
  uint *puVar7;
  uint uVar8;
  longlong lVar9;
  undefined4 local_168;
  undefined4 uStack_164;
  undefined4 uStack_160;
  undefined4 uStack_15c;
  undefined4 local_158;
  uint local_154;
  uint local_150;
  undefined2 local_14c;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined1 local_f8 [200];
  uint local_30;
  
  FUN_14034ed40(param_1 + 0x48);
  iVar5 = (int)(param_2[1] - *param_2 >> 0x3f);
  iVar4 = (int)((param_2[1] - *param_2) / 0x38) + iVar5;
  uVar8 = 0;
  if (iVar4 != iVar5) {
    lVar9 = 0;
    do {
      FUN_14025c9b0(&local_168);
      lVar3 = *param_2;
      puVar1 = (undefined4 *)(lVar9 + lVar3);
      local_168 = *puVar1;
      uStack_164 = puVar1[1];
      uStack_160 = puVar1[2];
      uStack_15c = puVar1[3];
      local_158 = *(undefined4 *)(lVar9 + 0x10 + lVar3);
      uVar2 = *(uint *)(lVar9 + 0x14 + lVar3);
      local_14c = *(undefined2 *)(lVar9 + 0x18 + lVar3);
      local_140 = *(undefined4 *)(lVar9 + 0x1a + lVar3);
      local_13c = *(undefined4 *)(lVar9 + 0x1e + lVar3);
      local_138 = *(undefined4 *)(lVar9 + 0x22 + lVar3);
      local_134 = *(undefined4 *)(lVar9 + 0x26 + lVar3);
      local_130 = *(undefined4 *)(lVar9 + 0x2a + lVar3);
      local_30 = (uint)(0 < *(short *)(lVar9 + 0x36 + lVar3));
      local_154 = uVar2;
      plVar6 = (longlong *)FUN_1402e0270();
      if (*plVar6 != 0) {
        for (puVar7 = *(uint **)(*plVar6 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar6 + 2)) * 8
                                ); puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0x90)) {
          if ((puVar7[0x92] == uVar2) && (*puVar7 == uVar2)) {
            if (puVar7 != (uint *)0x0) {
              if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              local_150 = puVar7[3];
              goto LAB_14025663e;
            }
            break;
          }
        }
      }
      local_150 = 0;
LAB_14025663e:
      FUN_140255c20(local_154,&local_168);
      FUN_14025c040(param_1,&local_168);
      _eh_vector_destructor_iterator_(local_f8,0x28,5,FUN_140129b90);
      uVar8 = uVar8 + 1;
      lVar9 = lVar9 + 0x38;
    } while (uVar8 < (uint)(iVar4 - iVar5));
  }
  FUN_14034edd0(param_1 + 0x48);
  return;
}



undefined8 FUN_1402566c0(longlong *param_1,longlong param_2,int param_3,uint param_4)

{
  short sVar1;
  longlong lVar2;
  void *pvVar3;
  code *pcVar4;
  undefined4 *puVar5;
  int iVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined8 uVar9;
  int *piVar10;
  uint uVar11;
  uint uVar12;
  longlong *plVar13;
  uint *puVar14;
  int *piVar15;
  ulonglong uVar16;
  ulonglong uVar17;
  longlong lVar18;
  int *piVar19;
  int iVar20;
  int *piVar21;
  int *piVar22;
  int *piVar23;
  bool bVar24;
  undefined2 local_res8 [4];
  longlong local_res10;
  int local_res18;
  uint local_1e8;
  int local_1e4;
  int local_1e0;
  int local_1dc;
  longlong *local_1d8;
  int *local_1d0;
  int *local_1c8;
  int *local_1c0;
  int *local_1b8;
  int *local_1a8;
  int *local_1a0;
  int *local_198;
  int *local_188;
  int *local_180;
  int *local_178;
  longlong local_168;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  _SYSTEMTIME local_140;
  longlong *local_130;
  undefined1 local_128;
  undefined4 local_120;
  undefined4 uStack_11c;
  undefined4 local_118;
  undefined4 uStack_114;
  longlong *local_110;
  longlong *local_108;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  int local_f0;
  int *local_e8;
  int *local_e0;
  undefined8 local_d8;
  undefined4 *local_c8;
  longlong local_c0;
  undefined8 local_b8;
  undefined8 local_a8;
  ushort local_a0 [8];
  undefined1 local_90 [2];
  ushort local_8e;
  undefined1 local_80 [8];
  undefined1 local_78 [6];
  ushort local_72;
  undefined1 local_68 [8];
  ushort local_60;
  undefined1 local_58 [8];
  ushort local_50;
  
  local_a8 = 0xfffffffffffffffe;
  uVar16 = (ulonglong)param_4;
  plVar8 = param_1 + 9;
  local_res10 = param_2;
  local_res18 = param_3;
  local_130 = plVar8;
  FUN_14034ed40(plVar8);
  local_128 = 1;
  iVar20 = 0;
  lVar7 = *param_1;
  if (lVar7 != param_1[1]) {
    do {
      sVar1 = *(short *)(lVar7 + 0x1c);
      if (((sVar1 == 0) || (sVar1 == 1)) || (sVar1 == 2)) {
        iVar20 = iVar20 + 1;
      }
      lVar7 = lVar7 + 0x150;
    } while (lVar7 != param_1[1]);
    if (9 < iVar20) {
      local_1e8 = 0x1e;
      local_148 = 0x2b16;
      plVar13 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar13 + 0x70))
                (plVar13,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_148,&local_1e8);
      goto LAB_140257442;
    }
  }
  plVar13 = (longlong *)FUN_1402e0270();
  if (*plVar13 != 0) {
    for (puVar14 = *(uint **)(*plVar13 + (uVar16 % (ulonglong)*(uint *)(plVar13 + 2)) * 8);
        puVar14 != (uint *)0x0; puVar14 = *(uint **)(puVar14 + 0x90)) {
      if ((puVar14[0x92] == param_4) && (*puVar14 == param_4)) {
        if (puVar14 != (uint *)0x0) {
          if (puVar14 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar12 = puVar14[3];
          if (uVar12 == 4) {
            lVar7 = param_1[4];
            param_2 = local_res10;
            if (lVar7 != param_1[5]) {
              do {
                uVar12 = 0xffffffff;
                if (*(int *)(lVar7 + 0x10) == param_3) {
                  uVar11 = *(uint *)(lVar7 + 0x14);
                  plVar13 = (longlong *)FUN_1402e0270();
                  if (*plVar13 != 0) {
                    puVar14 = *(uint **)(*plVar13 +
                                        ((ulonglong)uVar11 % (ulonglong)*(uint *)(plVar13 + 2)) * 8)
                    ;
LAB_14025683c:
                    if (puVar14 != (uint *)0x0) {
                      if ((puVar14[0x92] != uVar11) || (*puVar14 != uVar11)) goto LAB_140256851;
                      if (puVar14 != (uint *)0x0) {
                        if (puVar14 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        if (puVar14[3] == 4) {
                          GetLocalTime(&local_140);
                          uVar9 = *(undefined8 *)(lVar7 + 0x140);
                          iVar20 = Ordinal_185(uVar9,local_a0);
                          uVar11 = (uint)local_a0[0];
                          if (iVar20 == 0) {
                            uVar11 = uVar12;
                          }
                          if (local_140.wYear == uVar11) {
                            iVar20 = Ordinal_185(uVar9,local_90);
                            uVar11 = (uint)local_8e;
                            if (iVar20 == 0) {
                              uVar11 = uVar12;
                            }
                            if (local_140.wMonth == uVar11) {
                              iVar20 = Ordinal_185(uVar9,local_78);
                              uVar11 = (uint)local_72;
                              if (iVar20 == 0) {
                                uVar11 = uVar12;
                              }
                              if (local_140.wDay == uVar11) {
                                iVar20 = Ordinal_185(uVar9,local_58);
                                uVar11 = (uint)local_50;
                                if (iVar20 == 0) {
                                  uVar11 = uVar12;
                                }
                                if (local_140.wHour == uVar11) {
                                  local_14c = 0x140;
                                  local_144 = 0x2b16;
                                  plVar13 = (longlong *)(*(longlong *)(local_res10 + 0xb50) + 0x78);
                                  (**(code **)(*plVar13 + 0x70))
                                            (plVar13,*(undefined4 *)(local_res10 + 8),&DAT_1405d85a0
                                             ,&local_144,&local_14c);
                                  goto LAB_140257442;
                                }
                                iVar20 = Ordinal_185(uVar9,local_68);
                                uVar12 = (uint)local_60;
                                if (iVar20 == 0) {
                                  uVar12 = 0xffffffff;
                                }
                                if ((int)(local_140.wHour - uVar12) < 2) {
                                  local_160 = 0x140;
                                  local_15c = 0x2b16;
                                  plVar13 = (longlong *)(*(longlong *)(local_res10 + 0xb50) + 0x78);
                                  (**(code **)(*plVar13 + 0x70))
                                            (plVar13,*(undefined4 *)(local_res10 + 8),&DAT_1405d85a0
                                             ,&local_15c,&local_160);
                                  goto LAB_140257442;
                                }
                                local_100 = *(undefined4 *)(local_res10 + 0x170);
                                local_fc = *(undefined4 *)(local_res10 + 0x174);
                                local_f8 = *(undefined4 *)(local_res10 + 0x178);
                                local_f4 = *(undefined4 *)(local_res10 + 0x17c);
                                FUN_1401fc230(*(undefined8 *)(local_res10 + 0xb50),
                                              *(undefined4 *)(local_res10 + 0x288),
                                              *(undefined4 *)(local_res10 + 0x284),&local_100,lVar7)
                                ;
                                plVar13 = (longlong *)FUN_14025c110(param_1 + 4,local_80,lVar7);
                                lVar7 = *plVar13;
                                goto LAB_140256af9;
                              }
                            }
                          }
                          local_120 = *(undefined4 *)(local_res10 + 0x170);
                          uStack_11c = *(undefined4 *)(local_res10 + 0x174);
                          local_118 = *(undefined4 *)(local_res10 + 0x178);
                          uStack_114 = *(undefined4 *)(local_res10 + 0x17c);
                          iVar20 = *(int *)(local_res10 + 0x284);
                          if ((-1 < iVar20) &&
                             (iVar20 < *(short *)(*(longlong *)(local_res10 + 0xb50) + 700))) {
                            if ((*(longlong *)(local_res10 + 0x170) == 0) &&
                               (*(longlong *)(local_res10 + 0x178) == 0)) {
                              bVar24 = false;
                            }
                            else {
                              bVar24 = true;
                            }
                            if ((bVar24) &&
                               (lVar18 = *(longlong *)(*(longlong *)(local_res10 + 0xb50) + 0x4c0),
                               lVar18 != 0)) {
                              local_res8[0] = (undefined2)iVar20;
                              plVar13 = (longlong *)
                                        (*(longlong *)
                                          (*(longlong *)(lVar18 + 8) +
                                          (longlong)*(int *)(local_res10 + 0x288) * 8) + 0x70);
                              (**(code **)(*plVar13 + 0x1c0))
                                        (plVar13,1,&DAT_1405d85a0,local_res8,&local_120,lVar7);
                            }
                          }
                          FUN_14025c680(lVar7 + 0x150,param_1[5],lVar7);
                          lVar2 = param_1[5];
                          for (lVar18 = lVar2 + -0x150; lVar18 != lVar2; lVar18 = lVar18 + 0x150) {
                            _eh_vector_destructor_iterator_
                                      ((void *)(lVar18 + 0x70),0x28,5,FUN_140129b90);
                          }
                          param_1[5] = param_1[5] + -0x150;
                          goto LAB_140256af9;
                        }
                      }
                    }
                  }
                }
                lVar7 = lVar7 + 0x150;
LAB_140256af9:
                param_2 = local_res10;
                param_3 = local_res18;
              } while (lVar7 != param_1[5]);
            }
          }
          else if ((uVar12 == 1) || (uVar12 == 2)) {
            lVar7 = param_1[4];
            goto LAB_140256bb1;
          }
        }
        break;
      }
    }
  }
LAB_140256c0c:
  FUN_140197b70(param_2);
  plVar13 = local_110;
  local_1d8 = local_110;
  if (local_110 != (longlong *)0x0) {
    if (local_110 == local_108) {
      if (*local_110 != 0) {
        plVar8 = (longlong *)FUN_1402e0270();
        if (*plVar8 != 0) {
          for (puVar14 = *(uint **)(*plVar8 + (uVar16 % (ulonglong)*(uint *)(plVar8 + 2)) * 8);
              puVar14 != (uint *)0x0; puVar14 = *(uint **)(puVar14 + 0x90)) {
            if ((puVar14[0x92] == param_4) && (*puVar14 == param_4)) {
              if (puVar14 != (uint *)0x0) {
                if (puVar14 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar12 = puVar14[0x13];
                goto LAB_140256cc2;
              }
              break;
            }
          }
        }
        uVar12 = 0;
LAB_140256cc2:
        piVar15 = (int *)0x0;
        local_1a8 = (int *)0x0;
        local_1a0 = (int *)0x0;
        local_198 = (int *)0x0;
        local_1c8 = (int *)0x0;
        local_1c0 = (int *)0x0;
        local_1b8 = (int *)0x0;
        local_188 = (int *)0x0;
        local_180 = (int *)0x0;
        local_178 = (int *)0x0;
        piVar19 = piVar15;
        piVar21 = piVar15;
        piVar22 = piVar15;
        piVar23 = piVar15;
        if (uVar12 == 9) {
          local_c8 = (undefined4 *)0x0;
          local_c0 = 0;
          local_b8 = 0;
          uVar9 = FUN_1402e0270();
          FUN_1402e00d0(uVar9,uVar16,&local_c8);
          puVar5 = local_c8;
          if (2 < (ulonglong)(local_c0 - (longlong)local_c8 >> 2)) {
            uVar9 = FUN_140137690();
            iVar20 = FUN_140136b30(uVar9,*puVar5);
            piVar22 = local_1c8;
            local_f0 = iVar20;
            if (iVar20 - 1U < 4) {
              FUN_140051e60(&local_1a8,1);
              if (local_1a0 != (int *)0x0) {
                *local_1a0 = iVar20;
              }
              piVar15 = local_1a0 + 1;
              local_1a0 = piVar15;
              FUN_14012e5c0(&local_1c8,puVar5);
              FUN_14012e5c0(&local_188,puVar5 + 1);
              piVar19 = local_180;
              piVar21 = local_1c0;
              piVar22 = local_1c8;
              piVar23 = local_188;
            }
          }
          if (puVar5 != (undefined4 *)0x0) {
            operator_delete(puVar5);
          }
        }
        local_e8 = (int *)0x0;
        local_e0 = (int *)0x0;
        local_d8 = 0;
        uVar9 = FUN_1402e0270();
        FUN_1402e01a0(uVar9,uVar16,&local_e8);
        if (local_e8 != local_e0) {
          local_168 = (longlong)local_e0 - (longlong)local_e8 >> 2;
          local_1e8 = 0;
          piVar10 = local_e8;
          if ((int)local_168 != 0) {
            do {
              iVar20 = *piVar10;
              local_1e4 = piVar10[1];
              local_1dc = iVar20;
              local_1d0 = piVar10;
              uVar9 = FUN_140137690();
              iVar6 = FUN_140136b30(uVar9,iVar20);
              local_1e0 = iVar6;
              if (iVar6 - 1U < 4) {
                if ((&local_1e0 < piVar15) && (local_1a8 <= &local_1e0)) {
                  lVar7 = (longlong)&local_1e0 - (longlong)local_1a8;
                  if (piVar15 == local_198) {
                    uVar16 = (longlong)piVar15 - (longlong)local_1a8 >> 2;
                    if (0x3ffffffffffffffe < uVar16) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar4 = (code *)swi(3);
                      uVar9 = (*pcVar4)();
                      return uVar9;
                    }
                    uVar16 = uVar16 + 1;
                    uVar17 = (longlong)local_198 - (longlong)local_1a8 >> 2;
                    if (uVar17 < uVar16) {
                      if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                        uVar17 = 0;
                      }
                      else {
                        uVar17 = uVar17 + (uVar17 >> 1);
                      }
                      if (uVar17 < uVar16) {
                        uVar17 = uVar16;
                      }
                      FUN_140051e60(&local_1a8,uVar17);
                      piVar15 = local_1a0;
                    }
                  }
                  if (piVar15 != (int *)0x0) {
                    *piVar15 = local_1a8[lVar7 >> 2];
                  }
                }
                else {
                  if (piVar15 == local_198) {
                    uVar16 = (longlong)piVar15 - (longlong)local_1a8 >> 2;
                    if (0x3ffffffffffffffe < uVar16) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar4 = (code *)swi(3);
                      uVar9 = (*pcVar4)();
                      return uVar9;
                    }
                    uVar16 = uVar16 + 1;
                    uVar17 = (longlong)local_198 - (longlong)local_1a8 >> 2;
                    if (uVar17 < uVar16) {
                      if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                        uVar17 = 0;
                      }
                      else {
                        uVar17 = uVar17 + (uVar17 >> 1);
                      }
                      if (uVar17 < uVar16) {
                        uVar17 = uVar16;
                      }
                      FUN_140051e60(&local_1a8,uVar17);
                      piVar15 = local_1a0;
                    }
                  }
                  if (piVar15 != (int *)0x0) {
                    *piVar15 = iVar6;
                  }
                }
                piVar15 = piVar15 + 1;
                local_1a0 = piVar15;
                if ((&local_1dc < piVar21) && (piVar22 <= &local_1dc)) {
                  piVar10 = piVar22;
                  if (piVar21 == local_1b8) {
                    uVar16 = (longlong)piVar21 - (longlong)piVar22 >> 2;
                    if (0x3ffffffffffffffe < uVar16) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar4 = (code *)swi(3);
                      uVar9 = (*pcVar4)();
                      return uVar9;
                    }
                    uVar16 = uVar16 + 1;
                    uVar17 = (longlong)local_1b8 - (longlong)piVar22 >> 2;
                    if (uVar17 < uVar16) {
                      if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                        uVar17 = 0;
                      }
                      else {
                        uVar17 = uVar17 + (uVar17 >> 1);
                      }
                      if (uVar17 < uVar16) {
                        uVar17 = uVar16;
                      }
                      FUN_140051e60(&local_1c8,uVar17);
                      piVar21 = local_1c0;
                      piVar10 = local_1c8;
                    }
                  }
                  if (piVar21 != (int *)0x0) {
                    *piVar21 = piVar10[(longlong)&local_1dc - (longlong)piVar22 >> 2];
                  }
                }
                else {
                  if (piVar21 == local_1b8) {
                    uVar16 = (longlong)piVar21 - (longlong)piVar22 >> 2;
                    if (0x3ffffffffffffffe < uVar16) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar4 = (code *)swi(3);
                      uVar9 = (*pcVar4)();
                      return uVar9;
                    }
                    uVar16 = uVar16 + 1;
                    uVar17 = (longlong)local_1b8 - (longlong)piVar22 >> 2;
                    if (uVar17 < uVar16) {
                      if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                        uVar17 = 0;
                      }
                      else {
                        uVar17 = uVar17 + (uVar17 >> 1);
                      }
                      if (uVar17 < uVar16) {
                        uVar17 = uVar16;
                      }
                      FUN_140051e60(&local_1c8,uVar17);
                      piVar21 = local_1c0;
                    }
                  }
                  if (piVar21 != (int *)0x0) {
                    *piVar21 = iVar20;
                  }
                }
                piVar21 = piVar21 + 1;
                local_1c0 = piVar21;
                if ((&local_1e4 < piVar19) && (piVar23 <= &local_1e4)) {
                  lVar7 = (longlong)&local_1e4 - (longlong)piVar23;
                  if (piVar19 == local_178) {
                    uVar16 = (longlong)piVar19 - (longlong)piVar23 >> 2;
                    if (0x3ffffffffffffffe < uVar16) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar4 = (code *)swi(3);
                      uVar9 = (*pcVar4)();
                      return uVar9;
                    }
                    uVar16 = uVar16 + 1;
                    uVar17 = (longlong)local_178 - (longlong)piVar23 >> 2;
                    if (uVar17 < uVar16) {
                      if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                        uVar17 = 0;
                      }
                      else {
                        uVar17 = uVar17 + (uVar17 >> 1);
                      }
                      if (uVar17 < uVar16) {
                        uVar17 = uVar16;
                      }
                      FUN_140051e60(&local_188,uVar17);
                      piVar19 = local_180;
                      piVar23 = local_188;
                    }
                  }
                  if (piVar19 != (int *)0x0) {
                    iVar20 = piVar23[lVar7 >> 2];
LAB_1402571b0:
                    *piVar19 = iVar20;
                  }
                }
                else {
                  if (piVar19 == local_178) {
                    uVar16 = (longlong)piVar19 - (longlong)piVar23 >> 2;
                    if (0x3ffffffffffffffe < uVar16) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar4 = (code *)swi(3);
                      uVar9 = (*pcVar4)();
                      return uVar9;
                    }
                    uVar16 = uVar16 + 1;
                    uVar17 = (longlong)local_178 - (longlong)piVar23 >> 2;
                    if (uVar17 < uVar16) {
                      if (0x3fffffffffffffff - (uVar17 >> 1) < uVar17) {
                        uVar17 = 0;
                      }
                      else {
                        uVar17 = uVar17 + (uVar17 >> 1);
                      }
                      if (uVar17 < uVar16) {
                        uVar17 = uVar16;
                      }
                      FUN_140051e60(&local_188,uVar17);
                      piVar19 = local_180;
                      piVar23 = local_188;
                    }
                  }
                  iVar20 = local_1e4;
                  if (piVar19 != (int *)0x0) goto LAB_1402571b0;
                }
                piVar19 = piVar19 + 1;
                local_180 = piVar19;
              }
              local_1e8 = local_1e8 + 2;
              piVar10 = local_1d0 + 2;
              piVar22 = local_1c8;
              local_1d0 = piVar10;
            } while (local_1e8 < (uint)local_168);
          }
        }
        piVar21 = local_e8;
        piVar19 = local_1a8;
        plVar13 = local_1d8;
        if ((local_1a8 == piVar15) ||
           (iVar20 = FUN_1401ed620(*local_1d8,&local_1a8,&local_1c8,&local_188), iVar20 != 0)) {
          if (piVar21 != (int *)0x0) {
            operator_delete(piVar21);
          }
          if (piVar23 != (int *)0x0) {
            operator_delete(piVar23);
          }
          if (local_1c8 != (int *)0x0) {
            operator_delete(local_1c8);
          }
          if (piVar19 != (int *)0x0) {
            operator_delete(piVar19);
          }
          local_1d8 = (longlong *)CONCAT44(local_1d8._4_4_,0x20);
          local_1d0 = (int *)CONCAT44(local_1d0._4_4_,0x2b16);
          plVar8 = (longlong *)(*(longlong *)(local_res10 + 0xb50) + 0x78);
          (**(code **)(*plVar8 + 0x70))
                    (plVar8,*(undefined4 *)(local_res10 + 8),&DAT_1405d85a0,&local_1d0,&local_1d8);
          LOCK();
          plVar13 = plVar13 + 1;
          *(int *)plVar13 = (int)*plVar13 + -1;
          UNLOCK();
          if ((int)*plVar13 == 0) {
            pvVar3 = (void *)*local_110;
            if (pvVar3 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar3 + 0xf630);
              operator_delete(pvVar3);
            }
            operator_delete(local_110);
          }
          FUN_14034edd0(local_130);
          return 1;
        }
        local_158 = 0x24;
        local_168 = CONCAT44(local_168._4_4_,0x2b16);
        plVar8 = (longlong *)(*(longlong *)(local_res10 + 0xb50) + 0x78);
        (**(code **)(*plVar8 + 0x70))
                  (plVar8,*(undefined4 *)(local_res10 + 8),&DAT_1405d85a0,&local_168,&local_158);
        if (piVar21 != (int *)0x0) {
          operator_delete(piVar21);
        }
        if (piVar23 != (int *)0x0) {
          operator_delete(piVar23);
        }
        if (local_1c8 != (int *)0x0) {
          operator_delete(local_1c8);
        }
        if (piVar19 != (int *)0x0) {
          operator_delete(piVar19);
        }
        LOCK();
        plVar13 = plVar13 + 1;
        *(int *)plVar13 = (int)*plVar13 + -1;
        UNLOCK();
        plVar8 = local_130;
        if ((int)*plVar13 == 0) {
          pvVar3 = (void *)*local_110;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_110);
          plVar8 = local_130;
        }
        goto LAB_140257442;
      }
    }
    else {
      iVar20 = DAT_140608048 + 1;
      bVar24 = DAT_140608048 == 0;
      DAT_140608048 = iVar20;
      if (bVar24) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar13 != (longlong *)0x0) {
    if (plVar13 == local_108) {
      LOCK();
      plVar13 = plVar13 + 1;
      lVar7 = *plVar13;
      *(int *)plVar13 = (int)*plVar13 + -1;
      UNLOCK();
      plVar8 = local_130;
      if ((int)lVar7 == 1) {
        pvVar3 = (void *)*local_110;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0xf630);
          operator_delete(pvVar3);
        }
        operator_delete(local_110);
        plVar8 = local_130;
      }
    }
    else {
      iVar20 = DAT_140608050 + 1;
      bVar24 = DAT_140608050 == 0;
      DAT_140608050 = iVar20;
      if (bVar24) {
        FUN_140176d60(1);
      }
    }
  }
LAB_140257442:
  FUN_14034edd0(plVar8);
  return 0;
LAB_140256851:
  puVar14 = *(uint **)(puVar14 + 0x90);
  goto LAB_14025683c;
LAB_140256bb1:
  if (lVar7 == param_1[5]) goto LAB_140256c0c;
  if ((*(int *)(lVar7 + 0x10) == param_3) && (*(uint *)(lVar7 + 0x14) == param_4)) {
    local_150 = 0x1f;
    local_154 = 0x2b16;
    plVar13 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar13 + 0x70))
              (plVar13,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_154,&local_150);
    goto LAB_140257442;
  }
  lVar7 = lVar7 + 0x150;
  goto LAB_140256bb1;
}



undefined8 FUN_140257470(longlong *param_1,longlong param_2,int param_3)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined4 local_res8 [2];
  undefined4 local_res20 [2];
  
  plVar1 = param_1 + 9;
  FUN_14034ed40(plVar1);
  lVar2 = *param_1;
  if (lVar2 == param_1[1]) {
    local_res8[0] = 0x1d;
    local_res20[0] = 0x2b17;
    plVar3 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar3 + 0x70))
              (plVar3,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res20,local_res8);
  }
  else {
    do {
      if (*(int *)(lVar2 + 0x14) == param_3) {
        FUN_14034edd0(plVar1);
        return 1;
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
    local_res8[0] = 0x1c;
    local_res20[0] = 0x2b17;
    plVar3 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar3 + 0x70))
              (plVar3,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res20,local_res8);
  }
  FUN_14034edd0(plVar1);
  return 0;
}



void FUN_140257570(longlong param_1,longlong param_2,undefined4 param_3)

{
  undefined4 local_res18 [4];
  
  local_res18[0] = param_3;
  if (*(short *)(param_1 + 0x1c) != 2) {
    *(undefined2 *)(param_1 + 0x1c) = 2;
    FUN_14025aff0(param_2,param_1);
  }
  (**(code **)(*(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78) + 0x180))
            (*(longlong *)(param_2 + 0xb50) + 0x78,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
             param_1,local_res18,param_1 + 0x14);
  return;
}



undefined8 FUN_1402575f0(longlong *param_1,longlong param_2,ulonglong *param_3,uint param_4)

{
  longlong *plVar1;
  uint uVar2;
  int iVar3;
  longlong lVar4;
  uint *puVar5;
  longlong *plVar6;
  ulonglong *puVar7;
  ulonglong uVar8;
  bool bVar9;
  uint local_res8 [2];
  undefined8 uVar10;
  longlong *plVar11;
  
  uVar10 = 0xfffffffffffffffe;
  uVar8 = (ulonglong)param_4;
  plVar1 = param_1 + 9;
  plVar11 = plVar1;
  FUN_14034ed40(plVar1);
  puVar7 = (ulonglong *)*param_1;
  if (puVar7 != (ulonglong *)param_1[1]) {
    do {
      if (*(short *)((longlong)puVar7 + 0x1c) != 0xff) {
        bVar9 = *puVar7 < *param_3;
        if ((*puVar7 == *param_3) && (bVar9 = puVar7[1] < param_3[1], puVar7[1] == param_3[1])) {
          iVar3 = 0;
        }
        else {
          iVar3 = (1 - (uint)bVar9) - (uint)(bVar9 != 0);
        }
        if (iVar3 == 0) {
          iVar3 = *(int *)((longlong)puVar7 + 0x3c);
          if (iVar3 == 7) {
            if ((uint)puVar7[8] == param_4) {
              FUN_140257570(puVar7,param_2,param_4);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (iVar3 == 0x32) {
            lVar4 = FUN_1402e8780();
            if (*(longlong *)(lVar4 + 0x48) != 0) {
              for (puVar5 = *(uint **)(*(longlong *)(lVar4 + 0x48) +
                                      (uVar8 % (ulonglong)*(uint *)(lVar4 + 0x58)) * 8);
                  puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xc4)) {
                if ((puVar5[0xc6] == param_4) && (*puVar5 == param_4)) {
                  if (puVar5 != (uint *)0x0) {
                    if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                      FUN_14000d450(0x80004005);
                    }
                    uVar2 = puVar5[0x22];
                    goto LAB_1402576f7;
                  }
                  break;
                }
              }
            }
            uVar2 = 0;
LAB_1402576f7:
            if ((uint)puVar7[8] == uVar2) {
              local_res8[0] = param_4;
              if (*(short *)((longlong)puVar7 + 0x1c) != 2) {
                *(undefined2 *)((longlong)puVar7 + 0x1c) = 2;
                FUN_14025aff0(param_2,puVar7);
              }
              plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              (**(code **)(*plVar6 + 0x9a0))
                        (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,puVar7,local_res8,
                         (longlong)puVar7 + 0x14,uVar10,plVar11);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if ((iVar3 == 9) || (iVar3 == 10)) {
            if ((*(uint *)((longlong)puVar7 + 0x44) == param_4) &&
               (iVar3 = FUN_140198700(param_2,(int)puVar7[8],
                                      *(undefined4 *)((longlong)puVar7 + 0x54)), iVar3 != 0)) {
              FUN_140257570(puVar7,param_2,uVar8);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (iVar3 == 0xb) {
            if ((((uint)puVar7[9] == param_4) &&
                (iVar3 = FUN_140198700(param_2,(int)puVar7[8],
                                       *(undefined4 *)((longlong)puVar7 + 0x54)), iVar3 != 0)) &&
               (iVar3 = FUN_140198700(param_2,*(undefined4 *)((longlong)puVar7 + 0x44),
                                      (int)puVar7[0xb]), iVar3 != 0)) {
              FUN_140257570(puVar7,param_2,uVar8);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (iVar3 == 0xc) {
            if ((((*(uint *)((longlong)puVar7 + 0x4c) == param_4) &&
                 (iVar3 = FUN_140198700(param_2,(int)puVar7[8],
                                        *(undefined4 *)((longlong)puVar7 + 0x54)), iVar3 != 0)) &&
                (iVar3 = FUN_140198700(param_2,*(undefined4 *)((longlong)puVar7 + 0x44),
                                       (int)puVar7[0xb]), iVar3 != 0)) &&
               (iVar3 = FUN_140198700(param_2,(int)puVar7[9],
                                      *(undefined4 *)((longlong)puVar7 + 0x5c)), iVar3 != 0)) {
              FUN_140257570(puVar7,param_2,uVar8);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (iVar3 == 0x2f) {
            if ((*(uint *)((longlong)puVar7 + 0x44) == param_4) &&
               (iVar3 = FUN_140198590(param_2,(int)puVar7[8],
                                      *(undefined4 *)((longlong)puVar7 + 0x54)), iVar3 != 0)) {
              FUN_140257570(puVar7,param_2,uVar8);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (iVar3 == 0x30) {
            if ((((uint)puVar7[9] == param_4) &&
                (iVar3 = FUN_140198590(param_2,(int)puVar7[8],
                                       *(undefined4 *)((longlong)puVar7 + 0x54)), iVar3 != 0)) &&
               (iVar3 = FUN_140198590(param_2,*(undefined4 *)((longlong)puVar7 + 0x44),
                                      (int)puVar7[0xb]), iVar3 != 0)) {
              FUN_140257570(puVar7,param_2,uVar8);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (iVar3 == 0x31) {
            if ((((*(uint *)((longlong)puVar7 + 0x4c) == param_4) &&
                 (iVar3 = FUN_140198590(param_2,(int)puVar7[8],
                                        *(undefined4 *)((longlong)puVar7 + 0x54)), iVar3 != 0)) &&
                (iVar3 = FUN_140198590(param_2,*(undefined4 *)((longlong)puVar7 + 0x44),
                                       (int)puVar7[0xb]), iVar3 != 0)) &&
               (iVar3 = FUN_140198590(param_2,(int)puVar7[9],
                                      *(undefined4 *)((longlong)puVar7 + 0x5c)), iVar3 != 0)) {
              FUN_140257570(puVar7,param_2,uVar8);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (((iVar3 == 0xd) || (iVar3 == 0x14)) || (iVar3 == 0x38)) {
            if ((*(uint *)((longlong)puVar7 + 0x44) == param_4) &&
               (*(int *)((longlong)puVar7 + 0x54) <= (int)puVar7[5])) {
              FUN_140257570(puVar7,param_2,uVar8);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (((iVar3 == 0xe) || (iVar3 == 0x15)) || (iVar3 == 0x39)) {
            if ((((uint)puVar7[9] == param_4) &&
                (*(int *)((longlong)puVar7 + 0x54) <= (int)puVar7[5])) &&
               ((int)puVar7[0xb] <= *(int *)((longlong)puVar7 + 0x2c))) {
              FUN_140257570(puVar7,param_2,uVar8);
              FUN_14034edd0(plVar1);
              return 1;
            }
          }
          else if (((((iVar3 == 0xf) || (iVar3 == 0x16)) || (iVar3 == 0x3a)) &&
                   ((*(uint *)((longlong)puVar7 + 0x4c) == param_4 &&
                    (*(int *)((longlong)puVar7 + 0x54) <= (int)puVar7[5])))) &&
                  (((int)puVar7[0xb] <= *(int *)((longlong)puVar7 + 0x2c) &&
                   (*(int *)((longlong)puVar7 + 0x5c) <= (int)puVar7[6])))) {
            FUN_140257570(puVar7,param_2,uVar8);
            FUN_14034edd0(plVar1);
            return 1;
          }
        }
      }
      puVar7 = puVar7 + 0x2a;
    } while (puVar7 != (ulonglong *)param_1[1]);
  }
  FUN_14034edd0(plVar1);
  return 0;
}



void FUN_140257b00(longlong param_1)

{
  uint uVar1;
  int iVar2;
  int *piVar3;
  uint uVar4;
  ulonglong uVar5;
  bool bVar6;
  bool bVar7;
  
  iVar2 = *(int *)(param_1 + 0x3c);
  if ((((((iVar2 == 1) || (iVar2 == 0x11)) || (iVar2 == 0x35)) ||
       ((iVar2 == 0x1a || (iVar2 == 0x1d)))) || (iVar2 == 0x3b)) ||
     (((iVar2 == 0x28 || (iVar2 == 0x29)) ||
      ((iVar2 == 0x3f || (((iVar2 == 0x40 || (iVar2 == 0x41)) || (iVar2 == 0x42)))))))) {
    iVar2 = *(int *)(param_1 + 0x28);
    if (0 < iVar2) {
      *(undefined2 *)(param_1 + 0x1c) = 1;
    }
    bVar7 = SBORROW4(iVar2,*(int *)(param_1 + 0x54));
    bVar6 = iVar2 - *(int *)(param_1 + 0x54) < 0;
  }
  else if ((((iVar2 == 2) || (iVar2 == 0x12)) ||
           ((iVar2 == 0x36 || ((iVar2 == 0x1b || (iVar2 == 0x1e)))))) ||
          ((iVar2 == 0x3c || (iVar2 == 0x2a)))) {
    if ((0 < *(int *)(param_1 + 0x28)) || (0 < *(int *)(param_1 + 0x2c))) {
      *(undefined2 *)(param_1 + 0x1c) = 1;
    }
    if (*(int *)(param_1 + 0x28) < *(int *)(param_1 + 0x54)) {
      return;
    }
    bVar7 = SBORROW4(*(int *)(param_1 + 0x2c),*(int *)(param_1 + 0x58));
    bVar6 = *(int *)(param_1 + 0x2c) - *(int *)(param_1 + 0x58) < 0;
  }
  else {
    if ((((iVar2 != 3) && (iVar2 != 0x13)) && (iVar2 != 0x37)) &&
       (((iVar2 != 0x1c && (iVar2 != 0x1f)) && ((iVar2 != 0x3d && (iVar2 != 0x2b)))))) {
      if ((((iVar2 == 4) || (iVar2 == 0x2c)) || (iVar2 == 0x34)) || (iVar2 == 0x3e)) {
LAB_140257e4b:
        iVar2 = *(int *)(param_1 + 0x28);
        if (-1 < iVar2) {
          *(undefined2 *)(param_1 + 0x1c) = 1;
        }
        bVar7 = SBORROW4(iVar2,*(int *)(param_1 + 0x54));
        bVar6 = iVar2 - *(int *)(param_1 + 0x54) < 0;
      }
      else if ((iVar2 == 5) || (iVar2 == 0x2d)) {
LAB_140257e21:
        if ((-1 < *(int *)(param_1 + 0x28)) || (-1 < *(int *)(param_1 + 0x2c))) {
          *(undefined2 *)(param_1 + 0x1c) = 1;
        }
        if (*(int *)(param_1 + 0x28) < *(int *)(param_1 + 0x54)) goto LAB_140257db5;
        bVar7 = SBORROW4(*(int *)(param_1 + 0x2c),*(int *)(param_1 + 0x58));
        bVar6 = *(int *)(param_1 + 0x2c) - *(int *)(param_1 + 0x58) < 0;
      }
      else {
        if ((iVar2 == 6) || (iVar2 == 0x2e)) {
LAB_140257e04:
          iVar2 = *(int *)(param_1 + 0x28);
          if ((-1 < iVar2) || ((-1 < *(int *)(param_1 + 0x2c) || (-1 < *(int *)(param_1 + 0x30)))))
          {
LAB_140257d98:
            *(undefined2 *)(param_1 + 0x1c) = 1;
          }
        }
        else {
          if ((((((iVar2 == 8) || (iVar2 == 0x20)) || (iVar2 == 0x22)) ||
               (((iVar2 == 0x23 || (iVar2 == 0x24)) || (iVar2 == 0x25)))) ||
              ((iVar2 == 0x26 || (iVar2 == 0x27)))) ||
             ((iVar2 == 0x10 || ((iVar2 == 0x21 || (iVar2 == 0x33)))))) {
            iVar2 = *(int *)(param_1 + 0x28);
            if (-1 < iVar2) {
              *(undefined2 *)(param_1 + 0x1c) = 1;
            }
            bVar7 = SBORROW4(iVar2,1);
            bVar6 = iVar2 + -1 < 0;
            goto LAB_140257edf;
          }
          if ((iVar2 == 10) || (iVar2 == 0x2f)) goto LAB_140257e4b;
          if ((iVar2 == 0xb) || (iVar2 == 0x30)) goto LAB_140257e21;
          if ((iVar2 == 0xc) || (iVar2 == 0x31)) goto LAB_140257e04;
          if ((iVar2 == 0xd) || ((iVar2 == 0x14 || (iVar2 == 0x38)))) {
            if (0 < *(int *)(param_1 + 0x28)) {
              *(undefined2 *)(param_1 + 0x1c) = 1;
            }
            if (*(int *)(param_1 + 0x28) < *(int *)(param_1 + 0x54)) {
              *(undefined2 *)(param_1 + 0x1c) = 1;
              return;
            }
            goto LAB_140257ee1;
          }
          if (((iVar2 == 0xe) || (iVar2 == 0x15)) || (iVar2 == 0x39)) {
            if ((0 < *(int *)(param_1 + 0x28)) || (0 < *(int *)(param_1 + 0x2c))) {
              *(undefined2 *)(param_1 + 0x1c) = 1;
            }
            if ((*(int *)(param_1 + 0x28) < *(int *)(param_1 + 0x54)) ||
               (*(int *)(param_1 + 0x2c) < *(int *)(param_1 + 0x58))) {
              *(undefined2 *)(param_1 + 0x1c) = 1;
              return;
            }
            goto LAB_140257ee1;
          }
          if (((iVar2 != 0xf) && (iVar2 != 0x16)) && (iVar2 != 0x3a)) {
            if (((iVar2 == 0x17) || (iVar2 == 0x18)) || (iVar2 == 0x19)) {
              uVar1 = *(uint *)(param_1 + 0x68);
              uVar4 = 0;
              if (0 < (int)uVar1) {
                piVar3 = (int *)(param_1 + 0x28);
                uVar5 = (ulonglong)uVar1;
                do {
                  if (0 < *piVar3) {
                    uVar4 = uVar4 + 1;
                  }
                  piVar3 = piVar3 + 1;
                  uVar5 = uVar5 - 1;
                } while (uVar5 != 0);
              }
              if ((int)uVar1 <= (int)uVar4) {
                if (uVar1 != uVar4) {
                  return;
                }
                *(undefined2 *)(param_1 + 0x1c) = 2;
                return;
              }
              *(undefined2 *)(param_1 + 0x1c) = 1;
              return;
            }
            if (iVar2 != 0x43) {
              return;
            }
            if (*(int *)(param_1 + 0x28) < 1) {
              return;
            }
            *(undefined2 *)(param_1 + 0x1c) = 2;
            return;
          }
          iVar2 = *(int *)(param_1 + 0x28);
          if (((0 < iVar2) || (0 < *(int *)(param_1 + 0x2c))) || (0 < *(int *)(param_1 + 0x30)))
          goto LAB_140257d98;
        }
        if ((iVar2 < *(int *)(param_1 + 0x54)) ||
           (*(int *)(param_1 + 0x2c) < *(int *)(param_1 + 0x58))) goto LAB_140257db5;
        bVar7 = SBORROW4(*(int *)(param_1 + 0x30),*(int *)(param_1 + 0x5c));
        bVar6 = *(int *)(param_1 + 0x30) - *(int *)(param_1 + 0x5c) < 0;
      }
      if (bVar7 != bVar6) {
LAB_140257db5:
        *(undefined2 *)(param_1 + 0x1c) = 1;
        return;
      }
      goto LAB_140257ee1;
    }
    if (((0 < *(int *)(param_1 + 0x28)) || (0 < *(int *)(param_1 + 0x2c))) ||
       (0 < *(int *)(param_1 + 0x30))) {
      *(undefined2 *)(param_1 + 0x1c) = 1;
    }
    if (*(int *)(param_1 + 0x28) < *(int *)(param_1 + 0x54)) {
      return;
    }
    if (*(int *)(param_1 + 0x2c) < *(int *)(param_1 + 0x58)) {
      return;
    }
    bVar7 = SBORROW4(*(int *)(param_1 + 0x30),*(int *)(param_1 + 0x5c));
    bVar6 = *(int *)(param_1 + 0x30) - *(int *)(param_1 + 0x5c) < 0;
  }
LAB_140257edf:
  if (bVar7 != bVar6) {
    return;
  }
LAB_140257ee1:
  *(undefined2 *)(param_1 + 0x1c) = 2;
  return;
}



ulonglong FUN_140257ef0(int param_1,int param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  ulonglong uVar3;
  int local_res10 [6];
  
  local_res10[0] = param_2;
  iVar1 = *(int *)(param_3 + 0x3c);
  uVar3 = 0;
  if ((iVar1 == 0x2c) || (iVar1 == 0x2f)) {
    if (*(int *)(param_3 + 0x40) != param_1) goto LAB_14025800b;
    piVar2 = local_res10;
    if (*(int *)(param_3 + 0x54) < param_2) {
      piVar2 = (int *)(param_3 + 0x54);
    }
    *(int *)(param_3 + 0x28) = *piVar2;
LAB_140257ffd:
    uVar3 = 1;
  }
  else {
    if ((iVar1 != 0x2d) && (iVar1 != 0x30)) {
      if ((iVar1 != 0x2e) && (iVar1 != 0x31)) goto LAB_14025800b;
      if (*(int *)(param_3 + 0x40) == param_1) {
        piVar2 = local_res10;
        if (*(int *)(param_3 + 0x54) < param_2) {
          piVar2 = (int *)(param_3 + 0x54);
        }
        uVar3 = 1;
        *(int *)(param_3 + 0x28) = *piVar2;
      }
      if (*(int *)(param_3 + 0x44) == param_1) {
        piVar2 = local_res10;
        if (*(int *)(param_3 + 0x58) < param_2) {
          piVar2 = (int *)(param_3 + 0x58);
        }
        uVar3 = 1;
        *(int *)(param_3 + 0x2c) = *piVar2;
      }
      if (*(int *)(param_3 + 0x48) != param_1) goto LAB_140257fd3;
      piVar2 = local_res10;
      if (*(int *)(param_3 + 0x5c) < param_2) {
        piVar2 = (int *)(param_3 + 0x5c);
      }
      *(int *)(param_3 + 0x30) = *piVar2;
      goto LAB_140257ffd;
    }
    if (*(int *)(param_3 + 0x40) == param_1) {
      piVar2 = local_res10;
      if (*(int *)(param_3 + 0x54) < param_2) {
        piVar2 = (int *)(param_3 + 0x54);
      }
      uVar3 = 1;
      *(int *)(param_3 + 0x28) = *piVar2;
    }
    if (*(int *)(param_3 + 0x44) == param_1) {
      piVar2 = local_res10;
      if (*(int *)(param_3 + 0x58) < param_2) {
        piVar2 = (int *)(param_3 + 0x58);
      }
      *(int *)(param_3 + 0x2c) = *piVar2;
      goto LAB_140257ffd;
    }
LAB_140257fd3:
    if ((int)uVar3 == 0) {
      return uVar3;
    }
  }
  FUN_140257b00(param_3);
LAB_14025800b:
  return uVar3 & 0xffffffff;
}



ulonglong FUN_140258020(int param_1,int param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  ulonglong uVar3;
  int local_res10 [6];
  
  local_res10[0] = param_2;
  iVar1 = *(int *)(param_3 + 0x3c);
  uVar3 = 0;
  if (((iVar1 == 4) || (iVar1 == 9)) || (iVar1 == 10)) {
    if (*(int *)(param_3 + 0x40) != param_1) goto LAB_140258144;
    piVar2 = local_res10;
    if (*(int *)(param_3 + 0x54) < param_2) {
      piVar2 = (int *)(param_3 + 0x54);
    }
    *(int *)(param_3 + 0x28) = *piVar2;
LAB_140258136:
    uVar3 = 1;
  }
  else {
    if ((iVar1 != 5) && (iVar1 != 0xb)) {
      if ((iVar1 != 6) && (iVar1 != 0xc)) goto LAB_140258144;
      if (*(int *)(param_3 + 0x40) == param_1) {
        piVar2 = local_res10;
        if (*(int *)(param_3 + 0x54) < param_2) {
          piVar2 = (int *)(param_3 + 0x54);
        }
        uVar3 = 1;
        *(int *)(param_3 + 0x28) = *piVar2;
      }
      if (*(int *)(param_3 + 0x44) == param_1) {
        piVar2 = local_res10;
        if (*(int *)(param_3 + 0x58) < param_2) {
          piVar2 = (int *)(param_3 + 0x58);
        }
        uVar3 = 1;
        *(int *)(param_3 + 0x2c) = *piVar2;
      }
      if (*(int *)(param_3 + 0x48) != param_1) goto LAB_14025810c;
      piVar2 = local_res10;
      if (*(int *)(param_3 + 0x5c) < param_2) {
        piVar2 = (int *)(param_3 + 0x5c);
      }
      *(int *)(param_3 + 0x30) = *piVar2;
      goto LAB_140258136;
    }
    if (*(int *)(param_3 + 0x40) == param_1) {
      piVar2 = local_res10;
      if (*(int *)(param_3 + 0x54) < param_2) {
        piVar2 = (int *)(param_3 + 0x54);
      }
      uVar3 = 1;
      *(int *)(param_3 + 0x28) = *piVar2;
    }
    if (*(int *)(param_3 + 0x44) == param_1) {
      piVar2 = local_res10;
      if (*(int *)(param_3 + 0x58) < param_2) {
        piVar2 = (int *)(param_3 + 0x58);
      }
      *(int *)(param_3 + 0x2c) = *piVar2;
      goto LAB_140258136;
    }
LAB_14025810c:
    if ((int)uVar3 == 0) {
      return uVar3;
    }
  }
  FUN_140257b00(param_3);
LAB_140258144:
  return uVar3 & 0xffffffff;
}



void FUN_140258150(longlong *param_1,undefined8 param_2,int param_3,int param_4)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_14034ed40(param_1 + 9);
  lVar2 = *param_1;
  if (lVar2 != param_1[1]) {
    do {
      if ((((*(short *)(lVar2 + 0x1c) == 0) || (*(short *)(lVar2 + 0x1c) == 1)) &&
          (*(int *)(lVar2 + 0x3c) == 0x3e)) && (*(int *)(lVar2 + 0x40) == param_3)) {
        *(int *)(lVar2 + 0x28) = param_4;
        puVar1 = (undefined4 *)(lVar2 + 0x28);
        if (*(int *)(lVar2 + 0x54) < param_4) {
          puVar1 = (undefined4 *)(lVar2 + 0x54);
        }
        *(undefined4 *)(lVar2 + 0x28) = *puVar1;
        FUN_140257b00(lVar2);
        FUN_14025aff0(param_2,lVar2);
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



void FUN_140258220(longlong *param_1,undefined8 param_2,int param_3)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_14034ed40(param_1 + 9);
  lVar2 = *param_1;
  if (lVar2 != param_1[1]) {
    do {
      if ((((*(short *)(lVar2 + 0x1c) == 0) || (*(short *)(lVar2 + 0x1c) == 1)) &&
          (*(int *)(lVar2 + 0x3c) == 0x34)) && (*(int *)(lVar2 + 0x40) == param_3)) {
        *(int *)(lVar2 + 0x28) = *(int *)(lVar2 + 0x28) + 1;
        puVar1 = (undefined4 *)(lVar2 + 0x28);
        if (*(int *)(lVar2 + 0x54) < *(int *)(lVar2 + 0x28)) {
          puVar1 = (undefined4 *)(lVar2 + 0x54);
        }
        *(undefined4 *)(lVar2 + 0x28) = *puVar1;
        FUN_140257b00(lVar2);
        FUN_14025aff0(param_2,lVar2);
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



void FUN_1402582f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  short sVar1;
  int iVar2;
  longlong lVar3;
  
  FUN_14034ed40(param_1 + 9);
  lVar3 = *param_1;
  if (lVar3 != param_1[1]) {
    do {
      sVar1 = *(short *)(lVar3 + 0x1c);
      if (((sVar1 == 0) || (sVar1 == 1)) || (sVar1 == 2)) {
        iVar2 = FUN_140257ef0(param_3,param_4,lVar3);
        if (iVar2 != 0) {
          FUN_14025aff0(param_2,lVar3);
        }
      }
      lVar3 = lVar3 + 0x150;
    } while (lVar3 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



void FUN_1402583a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  short sVar1;
  int iVar2;
  longlong lVar3;
  
  FUN_14034ed40(param_1 + 9);
  lVar3 = *param_1;
  if (lVar3 != param_1[1]) {
    do {
      sVar1 = *(short *)(lVar3 + 0x1c);
      if (((sVar1 == 0) || (sVar1 == 1)) || (sVar1 == 2)) {
        iVar2 = FUN_140258020(param_3,param_4,lVar3);
        if (iVar2 != 0) {
          FUN_14025aff0(param_2,lVar3);
        }
      }
      lVar3 = lVar3 + 0x150;
    } while (lVar3 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



void FUN_140258450(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined1 uVar5;
  
  uVar3 = 0xfffffffffffffffe;
  plVar1 = param_1 + 9;
  plVar4 = plVar1;
  FUN_14034ed40(plVar1);
  uVar5 = 1;
  lVar2 = *param_1;
  if (lVar2 != param_1[1]) {
    do {
      if (((*(short *)(lVar2 + 0x1c) == 0) || (*(short *)(lVar2 + 0x1c) == 1)) &&
         (*(int *)(lVar2 + 0x3c) == 0x43)) {
        *(undefined4 *)(lVar2 + 0x28) = 1;
        FUN_140257b00(lVar2);
        FUN_14025aff0(param_2,lVar2,param_3,param_4,uVar3,plVar4,uVar5);
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
  }
  FUN_14034edd0(plVar1);
  return;
}



void FUN_1402584f0(longlong *param_1,undefined8 param_2,int param_3)

{
  int *piVar1;
  longlong lVar2;
  int local_res8 [2];
  
  FUN_14034ed40(param_1 + 9);
  lVar2 = *param_1;
  if (lVar2 != param_1[1]) {
    do {
      if (((*(short *)(lVar2 + 0x1c) == 0) || (*(short *)(lVar2 + 0x1c) == 1)) &&
         (local_res8[0] = param_3, *(int *)(lVar2 + 0x3c) == 0x42)) {
        piVar1 = local_res8;
        if (*(int *)(lVar2 + 0x54) <= param_3) {
          piVar1 = (int *)(lVar2 + 0x54);
        }
        *(int *)(lVar2 + 0x28) = *piVar1;
        FUN_140257b00(lVar2);
        FUN_14025aff0(param_2,lVar2);
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



void FUN_1402585a0(longlong *param_1,undefined8 param_2,int param_3,int param_4)

{
  int *piVar1;
  longlong lVar2;
  int local_res8 [2];
  
  FUN_14034ed40(param_1 + 9);
  lVar2 = *param_1;
  if (lVar2 != param_1[1]) {
    do {
      if ((((*(short *)(lVar2 + 0x1c) == 0) || (*(short *)(lVar2 + 0x1c) == 1)) &&
          (local_res8[0] = param_4, *(int *)(lVar2 + 0x3c) == 0x41)) &&
         (*(int *)(lVar2 + 0x40) == param_3)) {
        piVar1 = local_res8;
        if (*(int *)(lVar2 + 0x54) <= param_4) {
          piVar1 = (int *)(lVar2 + 0x54);
        }
        *(int *)(lVar2 + 0x28) = *piVar1;
        FUN_140257b00(lVar2);
        FUN_14025aff0(param_2,lVar2);
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



undefined8 FUN_140258670(undefined8 *param_1,ulonglong *param_2,undefined4 param_3)

{
  ulonglong *puVar1;
  int iVar2;
  bool bVar3;
  
  FUN_14034ed40(param_1 + 9);
  puVar1 = (ulonglong *)*param_1;
  while( true ) {
    if (puVar1 == (ulonglong *)param_1[1]) {
      FUN_14034edd0(param_1 + 9);
      return 0;
    }
    bVar3 = *puVar1 < *param_2;
    if ((*puVar1 == *param_2) && (bVar3 = puVar1[1] < param_2[1], puVar1[1] == param_2[1])) {
      iVar2 = 0;
    }
    else {
      iVar2 = (1 - (uint)bVar3) - (uint)(bVar3 != 0);
    }
    if (iVar2 == 0) break;
    puVar1 = puVar1 + 0x2a;
  }
  *(undefined4 *)(puVar1 + 0x27) = param_3;
  FUN_14034edd0(param_1 + 9);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014025887e)
// WARNING: Removing unreachable block (ram,0x000140258e37)
// WARNING: Removing unreachable block (ram,0x00014025881e)

undefined8 FUN_140258720(longlong *param_1,longlong param_2,ulonglong *param_3,int param_4)

{
  short sVar1;
  uint uVar2;
  longlong lVar3;
  int iVar4;
  undefined4 uVar5;
  errno_t eVar6;
  longlong *plVar7;
  undefined8 uVar8;
  longlong *plVar9;
  uint *puVar10;
  uint *puVar11;
  ulonglong *puVar12;
  int *piVar13;
  ulonglong *puVar14;
  ulonglong *puVar15;
  ulonglong uVar16;
  longlong lVar17;
  longlong *plVar18;
  bool bVar19;
  bool bVar20;
  longlong *local_res8;
  undefined8 local_c8;
  undefined2 local_c0;
  undefined2 uStack_be;
  undefined2 uStack_bc;
  undefined2 uStack_ba;
  ulonglong local_b8;
  undefined4 local_b0;
  undefined4 uStack_ac;
  longlong *local_a8;
  undefined8 local_a0;
  longlong *local_98;
  undefined1 local_90;
  tm local_88;
  int *local_60;
  int *local_58;
  undefined8 local_50;
  undefined8 local_40;
  
  local_40 = 0xfffffffffffffffe;
  plVar18 = param_1 + 9;
  local_res8 = param_1;
  local_98 = plVar18;
  FUN_14034ed40(plVar18);
  local_90 = 1;
  puVar14 = (ulonglong *)*param_1;
  if (puVar14 != (ulonglong *)param_1[1]) {
    puVar11 = (uint *)0x0;
    bVar20 = false;
    do {
      if (*(short *)((longlong)puVar14 + 0x1c) != 0xff) {
        bVar19 = *puVar14 < *param_3;
        iVar4 = 0;
        if ((*puVar14 != *param_3) || (bVar19 = puVar14[1] < param_3[1], puVar14[1] != param_3[1]))
        {
          iVar4 = (1 - (uint)bVar19) - (uint)(bVar19 != 0);
        }
        if (((iVar4 == 0) && (*(int *)((longlong)puVar14 + 0x14) == param_4)) &&
           (*(short *)((longlong)puVar14 + 0x1c) == 2)) {
          uVar2 = *(uint *)((longlong)puVar14 + 0x14);
          plVar7 = (longlong *)FUN_1402e0270();
          if (*plVar7 == 0) goto LAB_140258832;
          puVar10 = *(uint **)(*plVar7 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar7 + 2)) * 8);
          goto LAB_1402587f5;
        }
      }
      puVar14 = puVar14 + 0x2a;
    } while (puVar14 != (ulonglong *)param_1[1]);
  }
  goto LAB_1402590eb;
LAB_1402587f5:
  if (puVar10 == (uint *)0x0) goto LAB_140258832;
  if ((puVar10[0x92] == uVar2) && (*puVar10 == uVar2)) {
    if (puVar10 != (uint *)0x0) {
      puVar11 = puVar10 + 0x10;
    }
    goto LAB_140258832;
  }
  puVar10 = *(uint **)(puVar10 + 0x90);
  goto LAB_1402587f5;
LAB_140258832:
  uVar2 = *(uint *)((longlong)puVar14 + 0x14);
  local_c8 = puVar11;
  plVar7 = (longlong *)FUN_1402e0270();
  if (*plVar7 != 0) {
    for (puVar10 = *(uint **)(*plVar7 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar7 + 2)) * 8);
        puVar10 != (uint *)0x0; puVar10 = *(uint **)(puVar10 + 0x90)) {
      if ((puVar10[0x92] == uVar2) && (*puVar10 == uVar2)) {
        if (puVar10 != (uint *)0x0) {
          bVar20 = puVar10[0xf] == 0;
        }
        break;
      }
    }
  }
  iVar4 = *(int *)((longlong)puVar14 + 0x3c);
  if (((iVar4 == 4) || (iVar4 == 9)) || (iVar4 == 10)) {
    iVar4 = FUN_140198700(param_2,(int)puVar14[8],*(undefined4 *)((longlong)puVar14 + 0x54));
    if (iVar4 == 0) goto LAB_1402590eb;
    if (!bVar20) goto LAB_140258b6a;
    iVar4 = FUN_140198870(param_2,(int)puVar14[8],*(undefined4 *)((longlong)puVar14 + 0x54),*puVar11
                         );
  }
  else {
    if ((iVar4 == 5) || (iVar4 == 0xb)) {
      lVar17 = 0;
      puVar12 = puVar14 + 8;
      puVar15 = puVar12;
      do {
        iVar4 = FUN_140198700(param_2,(int)*puVar15,*(undefined4 *)((longlong)puVar15 + 0x14));
        puVar11 = local_c8;
        if (iVar4 == 0) goto LAB_1402590eb;
        lVar17 = lVar17 + 1;
        puVar15 = (ulonglong *)((longlong)puVar15 + 4);
      } while (lVar17 < 2);
      if (bVar20) {
        lVar17 = 0;
        do {
          iVar4 = FUN_140198870(param_2,(int)*puVar12,*(undefined4 *)((longlong)puVar12 + 0x14),
                                *(undefined4 *)
                                 ((longlong)puVar12 +
                                 (longlong)puVar11 + (-0x40 - (longlong)puVar14)));
          if (iVar4 == 0) goto LAB_1402590eb;
          lVar17 = lVar17 + 1;
          puVar12 = (ulonglong *)((longlong)puVar12 + 4);
        } while (lVar17 < 2);
      }
      goto LAB_140258b6a;
    }
    if ((iVar4 == 6) || (iVar4 == 0xc)) {
      lVar17 = 0;
      puVar12 = puVar14 + 8;
      puVar15 = puVar12;
      do {
        iVar4 = FUN_140198700(param_2,(int)*puVar15,*(undefined4 *)((longlong)puVar15 + 0x14));
        puVar11 = local_c8;
        if (iVar4 == 0) goto LAB_1402590eb;
        lVar17 = lVar17 + 1;
        puVar15 = (ulonglong *)((longlong)puVar15 + 4);
      } while (lVar17 < 3);
      if (bVar20) {
        lVar17 = 0;
        do {
          iVar4 = FUN_140198870(param_2,(int)*puVar12,*(undefined4 *)((longlong)puVar12 + 0x14),
                                *(undefined4 *)
                                 ((longlong)puVar12 +
                                 (longlong)puVar11 + (-0x40 - (longlong)puVar14)));
          if (iVar4 == 0) goto LAB_1402590eb;
          lVar17 = lVar17 + 1;
          puVar12 = (ulonglong *)((longlong)puVar12 + 4);
        } while (lVar17 < 3);
      }
      goto LAB_140258b6a;
    }
    if ((iVar4 != 0x2c) && (iVar4 != 0x2f)) {
      if ((iVar4 == 0x2d) || (iVar4 == 0x30)) {
        lVar17 = 0;
        puVar12 = puVar14 + 8;
        puVar15 = puVar12;
        do {
          iVar4 = FUN_140198590(param_2,(int)*puVar15,*(undefined4 *)((longlong)puVar15 + 0x14));
          puVar11 = local_c8;
          if (iVar4 == 0) goto LAB_1402590eb;
          lVar17 = lVar17 + 1;
          puVar15 = (ulonglong *)((longlong)puVar15 + 4);
        } while (lVar17 < 2);
        if (bVar20) {
          lVar17 = 0;
          do {
            iVar4 = FUN_140198a10(param_2,(int)*puVar12,*(undefined4 *)((longlong)puVar12 + 0x14),
                                  *(undefined4 *)
                                   ((longlong)puVar12 +
                                   (longlong)puVar11 + (-0x40 - (longlong)puVar14)));
            if (iVar4 == 0) goto LAB_1402590eb;
            lVar17 = lVar17 + 1;
            puVar12 = (ulonglong *)((longlong)puVar12 + 4);
          } while (lVar17 < 2);
        }
      }
      else if ((iVar4 == 0x2e) || (iVar4 == 0x31)) {
        lVar17 = 0;
        puVar12 = puVar14 + 8;
        puVar15 = puVar12;
        do {
          iVar4 = FUN_140198590(param_2,(int)*puVar15,*(undefined4 *)((longlong)puVar15 + 0x14));
          puVar11 = local_c8;
          if (iVar4 == 0) goto LAB_1402590eb;
          lVar17 = lVar17 + 1;
          puVar15 = (ulonglong *)((longlong)puVar15 + 4);
        } while (lVar17 < 3);
        if (bVar20) {
          lVar17 = 0;
          do {
            iVar4 = FUN_140198a10(param_2,(int)*puVar12,*(undefined4 *)((longlong)puVar12 + 0x14),
                                  *(undefined4 *)
                                   ((longlong)puVar11 + (-0x40 - (longlong)puVar14) +
                                   (longlong)puVar12));
            if (iVar4 == 0) goto LAB_1402590eb;
            lVar17 = lVar17 + 1;
            puVar12 = (ulonglong *)((longlong)puVar12 + 4);
          } while (lVar17 < 3);
        }
      }
      goto LAB_140258b6a;
    }
    iVar4 = FUN_140198590(param_2,(int)puVar14[8],*(undefined4 *)((longlong)puVar14 + 0x54));
    if (iVar4 == 0) goto LAB_1402590eb;
    if (!bVar20) goto LAB_140258b6a;
    iVar4 = FUN_140198a10(param_2,(int)puVar14[8],*(undefined4 *)((longlong)puVar14 + 0x54),*puVar11
                         );
  }
  if (iVar4 != 0) {
LAB_140258b6a:
    *(undefined2 *)((longlong)puVar14 + 0x1c) = 0xff;
    local_60 = (int *)0x0;
    local_58 = (int *)0x0;
    local_50 = 0;
    uVar8 = FUN_1402e0270();
    FUN_1402e01a0(uVar8,param_4,&local_60);
    puVar11 = local_c8;
    if ((local_60 != local_58) &&
       (iVar4 = (int)((longlong)local_58 - (longlong)local_60 >> 2), iVar4 != 0)) {
      uVar16 = (ulonglong)((iVar4 - 1U >> 1) + 1);
      piVar13 = local_60;
      do {
        if (((bVar20) && (0 < *piVar13)) && (0 < piVar13[1])) {
          FUN_140198870(param_2,*piVar13,piVar13[1],*puVar11);
        }
        piVar13 = piVar13 + 2;
        uVar16 = uVar16 - 1;
      } while (uVar16 != 0);
    }
    piVar13 = local_60;
    plVar18 = local_res8;
    iVar4 = *(int *)((longlong)puVar14 + 0x3c);
    if (((iVar4 == 4) || (iVar4 == 9)) || (iVar4 == 10)) {
      uVar5 = FUN_1401a6190(param_2,(int)puVar14[8]);
      uVar16 = puVar14[8];
      local_a8 = local_98;
      FUN_14034ed40(local_98);
      plVar18 = local_res8;
      local_a0 = CONCAT71(local_a0._1_7_,1);
      lVar17 = *local_res8;
      if (lVar17 != local_res8[1]) {
        do {
          sVar1 = *(short *)(lVar17 + 0x1c);
          if ((((sVar1 == 0) || (sVar1 == 1)) || (sVar1 == 2)) &&
             (iVar4 = FUN_140258020((int)uVar16,uVar5,lVar17), iVar4 != 0)) {
            FUN_14025aff0(param_2,lVar17);
          }
          lVar17 = lVar17 + 0x150;
        } while (lVar17 != plVar18[1]);
      }
      FUN_14034edd0(plVar18 + 9);
      plVar7 = plVar18 + 9;
    }
    else if ((iVar4 == 5) || (iVar4 == 0xb)) {
      puVar12 = puVar14 + 8;
      lVar17 = 2;
      do {
        uVar5 = FUN_1401a6190(param_2,(int)*puVar12);
        FUN_1402583a0(plVar18,param_2,(int)*puVar12,uVar5);
        puVar12 = (ulonglong *)((longlong)puVar12 + 4);
        lVar17 = lVar17 + -1;
      } while (lVar17 != 0);
      plVar7 = plVar18 + 9;
    }
    else if ((iVar4 == 6) || (plVar7 = local_98, iVar4 == 0xc)) {
      puVar12 = puVar14 + 8;
      lVar17 = 3;
      do {
        uVar5 = FUN_1401a6190(param_2,(int)*puVar12);
        FUN_1402583a0(plVar18,param_2,(int)*puVar12,uVar5);
        puVar12 = (ulonglong *)((longlong)puVar12 + 4);
        lVar17 = lVar17 + -1;
      } while (lVar17 != 0);
      plVar7 = plVar18 + 9;
    }
    local_res8 = (longlong *)_time64((__time64_t *)0x0);
    local_b8 = 0;
    local_b0 = 0;
    eVar6 = _localtime64_s(&local_88,(__time64_t *)&local_res8);
    if (eVar6 == 0) {
      local_c8 = (uint *)CONCAT26((undefined2)local_88.tm_mday,
                                  CONCAT24((undefined2)local_88.tm_wday,
                                           CONCAT22((short)local_88.tm_mon + 1,
                                                    (short)local_88.tm_year + 0x76c)));
      local_c0 = (undefined2)local_88.tm_hour;
      uStack_be = (undefined2)local_88.tm_min;
      uStack_bc = (undefined2)local_88.tm_sec;
      uStack_ba = 0;
      iVar4 = Ordinal_184(&local_c8,&local_b8);
      local_a8 = (longlong *)0x0;
      local_a0 = 0;
      if (iVar4 != 0) {
        Ordinal_185(local_b8,&local_a8);
      }
    }
    puVar14[0x28] = local_b8;
    FUN_14025aff0(param_2);
    uVar2 = *(uint *)((longlong)puVar14 + 0x14);
    plVar9 = (longlong *)FUN_1402e0270();
    if (*plVar9 != 0) {
      for (puVar11 = *(uint **)(*plVar9 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar9 + 2)) * 8)
          ; puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0x90)) {
        if ((puVar11[0x92] == uVar2) && (*puVar11 == uVar2)) {
          bVar20 = false;
          if ((puVar11 != (uint *)0x0) && (puVar11[3] == 3)) {
            local_c8 = *(uint **)(param_2 + 0x170);
            uVar5 = *(undefined4 *)(param_2 + 0x178);
            local_c0 = (undefined2)uVar5;
            uStack_be = (undefined2)((uint)uVar5 >> 0x10);
            uStack_bc = (undefined2)*(undefined4 *)(param_2 + 0x17c);
            uStack_ba = (undefined2)((uint)*(undefined4 *)(param_2 + 0x17c) >> 0x10);
            iVar4 = *(int *)(param_2 + 0x284);
            if ((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
              if ((local_c8 != (uint *)0x0) ||
                 (CONCAT26(uStack_ba,*(undefined6 *)(param_2 + 0x178)) != 0)) {
                bVar20 = true;
              }
              if ((bVar20) &&
                 (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                local_res8 = (longlong *)CONCAT62(local_res8._2_6_,(short)iVar4);
                plVar9 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                (**(code **)(*plVar9 + 0x1c0))
                          (plVar9,1,&DAT_1405d85a0,&local_res8,&local_c8,puVar14);
              }
            }
            FUN_14025c680(puVar14 + 0x2a,plVar18[1],puVar14);
            lVar3 = plVar18[1];
            for (lVar17 = lVar3 + -0x150; lVar17 != lVar3; lVar17 = lVar17 + 0x150) {
              _eh_vector_destructor_iterator_((void *)(lVar17 + 0x70),0x28,5,FUN_140129b90);
            }
            goto LAB_1402590c5;
          }
          break;
        }
      }
    }
    bVar20 = false;
    local_c8 = (uint *)CONCAT44(local_c8._4_4_,(uint)*(ushort *)((longlong)puVar14 + 0x1c));
    local_b8 = *(ulonglong *)(param_2 + 0x170);
    local_b0 = *(undefined4 *)(param_2 + 0x178);
    uStack_ac = *(undefined4 *)(param_2 + 0x17c);
    iVar4 = *(int *)(param_2 + 0x284);
    if ((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
      if ((local_b8 != 0) || (*(longlong *)(param_2 + 0x178) != 0)) {
        bVar20 = true;
      }
      if ((bVar20) && (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0))
      {
        local_res8 = (longlong *)CONCAT62(local_res8._2_6_,(short)iVar4);
        plVar9 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        (**(code **)(*plVar9 + 0x1b0))
                  (plVar9,1,&DAT_1405d85a0,&local_res8,&local_b8,puVar14,&local_c8,puVar14 + 5,
                   (longlong)puVar14 + 0x2c,puVar14 + 6,(longlong)puVar14 + 0x34,puVar14 + 7,
                   puVar14 + 0x28);
      }
    }
    FUN_14025c040(plVar18 + 4,puVar14);
    FUN_14025c680(puVar14 + 0x2a,plVar18[1],puVar14);
    lVar3 = plVar18[1];
    for (lVar17 = lVar3 + -0x150; lVar17 != lVar3; lVar17 = lVar17 + 0x150) {
      _eh_vector_destructor_iterator_((void *)(lVar17 + 0x70),0x28,5,FUN_140129b90);
    }
LAB_1402590c5:
    plVar18[1] = plVar18[1] + -0x150;
    if (piVar13 != (int *)0x0) {
      operator_delete(piVar13);
    }
    FUN_14034edd0(plVar7);
    return 1;
  }
LAB_1402590eb:
  FUN_14034edd0(plVar18);
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001402592c4)
// WARNING: Removing unreachable block (ram,0x00014025a1c8)
// WARNING: Removing unreachable block (ram,0x000140259205)

ulonglong FUN_140259110(longlong *param_1,longlong param_2,int param_3,uint param_4)

{
  undefined4 uVar1;
  undefined8 *puVar2;
  void *pvVar3;
  uint uVar4;
  longlong *plVar5;
  int iVar6;
  uint uVar7;
  uint uVar8;
  int iVar9;
  longlong *plVar10;
  longlong *plVar11;
  undefined8 uVar12;
  undefined4 *puVar13;
  undefined4 *puVar14;
  longlong lVar15;
  ulonglong uVar16;
  uint *puVar17;
  uint *puVar18;
  longlong lVar19;
  undefined2 uVar20;
  undefined2 uVar21;
  bool bVar22;
  int local_res18 [2];
  uint local_res20 [2];
  undefined4 *in_stack_fffffffffffff9b8;
  undefined4 uVar24;
  int *piVar23;
  longlong *in_stack_fffffffffffff9c0;
  undefined4 *in_stack_fffffffffffff9c8;
  undefined4 uVar25;
  undefined *in_stack_fffffffffffff9d0;
  undefined4 uVar26;
  longlong *in_stack_fffffffffffff9d8;
  ulonglong in_stack_fffffffffffff9e0;
  longlong local_5f8;
  uint local_5f0;
  uint local_5ec;
  undefined2 local_5e8;
  undefined2 local_5e6;
  undefined2 local_5e4;
  undefined2 local_5e2;
  undefined2 local_5e0;
  undefined2 local_5de;
  undefined2 local_5dc;
  undefined2 local_5da;
  longlong *local_5d8;
  longlong *local_5d0;
  uint local_5c8;
  uint local_5c4;
  undefined4 local_5c0 [2];
  uint local_5b8 [2];
  undefined4 local_5b0 [2];
  undefined4 local_5a8 [2];
  undefined4 local_5a0;
  undefined4 uStack_59c;
  undefined4 local_598;
  undefined4 uStack_594;
  undefined4 local_590;
  undefined4 uStack_58c;
  undefined4 local_588;
  undefined4 uStack_584;
  undefined4 local_580;
  undefined4 uStack_57c;
  undefined4 local_578;
  undefined4 uStack_574;
  undefined4 local_570;
  undefined4 uStack_56c;
  undefined4 local_568;
  undefined4 uStack_564;
  longlong *local_560;
  undefined1 local_558;
  undefined4 local_550;
  undefined4 local_54c;
  undefined4 local_548;
  undefined4 local_544;
  undefined4 local_540;
  undefined4 local_53c;
  undefined4 local_538;
  undefined4 local_534;
  undefined4 local_530;
  undefined4 uStack_52c;
  undefined4 local_528;
  undefined4 uStack_524;
  undefined4 local_520;
  undefined4 uStack_51c;
  undefined4 local_518;
  undefined4 uStack_514;
  undefined4 local_510;
  undefined4 local_50c;
  undefined4 local_508;
  undefined4 local_504;
  undefined4 local_500;
  undefined4 local_4fc;
  undefined4 local_4f8;
  undefined4 local_4f4;
  longlong *local_4f0;
  longlong *local_4e8;
  undefined4 *local_4e0;
  longlong local_4d8;
  undefined8 local_4d0;
  longlong local_4c0;
  void *local_4b8;
  void *local_4b0;
  undefined8 local_4a8;
  longlong *local_498;
  longlong *local_490;
  undefined8 local_488;
  undefined1 local_480 [16];
  undefined1 local_470 [16];
  undefined4 local_460 [6];
  undefined4 local_448 [4];
  int local_438;
  uint local_434 [2];
  undefined2 local_42c;
  uint local_408 [12];
  undefined1 local_3d8 [224];
  longlong local_2f8;
  longlong local_2f0;
  undefined2 local_2e4;
  undefined2 local_2e2;
  int local_2e0;
  undefined4 local_250;
  longlong local_248;
  longlong local_240;
  undefined2 local_234;
  undefined2 local_232;
  int local_230;
  undefined4 local_1a0;
  undefined4 local_198;
  undefined4 uStack_194;
  undefined4 uStack_190;
  undefined4 uStack_18c;
  uint local_180;
  undefined2 local_17c;
  undefined4 local_178;
  undefined2 local_12c;
  undefined4 local_f0;
  undefined4 local_e8;
  undefined4 uStack_e4;
  undefined4 uStack_e0;
  undefined4 uStack_dc;
  undefined4 local_d0;
  undefined2 local_cc;
  undefined4 local_c8;
  undefined2 local_7c;
  undefined4 local_40;
  
  local_488 = 0xfffffffffffffffe;
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  plVar10 = (longlong *)FUN_1402e0270();
  uVar16 = (ulonglong)param_4 / (ulonglong)*(uint *)(plVar10 + 2);
  if (*plVar10 == 0) {
    return uVar16;
  }
  puVar17 = *(uint **)(*plVar10 + ((ulonglong)param_4 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
  while( true ) {
    if (puVar17 == (uint *)0x0) {
      return uVar16;
    }
    if ((puVar17[0x92] == param_4) && (*puVar17 == param_4)) break;
    puVar17 = *(uint **)(puVar17 + 0x90);
  }
  if (puVar17 == (uint *)0x0) {
    return uVar16;
  }
  plVar10 = param_1 + 9;
  local_560 = plVar10;
  FUN_14034ed40(plVar10);
  uVar7 = local_res20[0];
  local_558 = 1;
  plVar11 = (longlong *)FUN_1402e0270();
  if (*plVar11 != 0) {
    for (puVar17 = *(uint **)(*plVar11 + ((ulonglong)uVar7 % (ulonglong)*(uint *)(plVar11 + 2)) * 8)
        ; puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0x90)) {
      if ((puVar17[0x92] == uVar7) && (*puVar17 == uVar7)) {
        if ((puVar17 != (uint *)0x0) && (puVar17[3] == 4)) {
          for (lVar19 = *param_1; lVar19 != param_1[1]; lVar19 = lVar19 + 0x150) {
            if (*(int *)(lVar19 + 0x10) == local_res18[0]) {
              uVar7 = *(uint *)(lVar19 + 0x14);
              plVar11 = (longlong *)FUN_1402e0270();
              if (*plVar11 != 0) {
                for (puVar17 = *(uint **)(*plVar11 +
                                         ((ulonglong)uVar7 % (ulonglong)*(uint *)(plVar11 + 2)) * 8)
                    ; puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0x90)) {
                  if ((puVar17[0x92] == uVar7) && (*puVar17 == uVar7)) {
                    if ((puVar17 != (uint *)0x0) && (puVar17[3] == 4)) {
                      plVar11 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                      (**(code **)(*plVar11 + 0xba0))
                                (plVar11,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18,
                                 local_res20);
                      goto LAB_14025a356;
                    }
                    break;
                  }
                }
              }
            }
          }
        }
        break;
      }
    }
  }
  FUN_140197b70(param_2);
  plVar11 = local_5d8;
  uVar7 = local_res20[0];
  if (local_5d8 != (longlong *)0x0) {
    if (local_5d8 == local_5d0) {
      if (*local_5d8 != 0) {
        plVar10 = (longlong *)FUN_1402e0270();
        if (*plVar10 != 0) {
          for (puVar17 = *(uint **)(*plVar10 +
                                   ((ulonglong)uVar7 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
              puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0x90)) {
            if ((puVar17[0x92] == uVar7) && (*puVar17 == uVar7)) {
              if (puVar17 != (uint *)0x0) {
                if (puVar17 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar7 = puVar17[0x13];
                goto LAB_14025938c;
              }
              break;
            }
          }
        }
        uVar7 = 0;
LAB_14025938c:
        local_5c4 = uVar7;
        FUN_14025c9b0(local_448);
        FUN_140255c20(local_res20[0],local_448);
        local_434[0] = local_res20[0];
        local_438 = local_res18[0];
        local_42c = 0;
        if (uVar7 == 9) {
          local_4e0 = (undefined4 *)0x0;
          local_4d8 = 0;
          local_4d0 = 0;
          uVar12 = FUN_1402e0270();
          FUN_1402e00d0(uVar12,local_res20[0],&local_4e0);
          puVar14 = local_4e0;
          if (2 < (ulonglong)(local_4d8 - (longlong)local_4e0 >> 2)) {
            uVar12 = FUN_140137690();
            uVar7 = FUN_140136b30(uVar12,*puVar14);
            uVar16 = (ulonglong)(int)uVar7;
            local_5f0 = uVar7;
            iVar6 = FUN_1401eceb0(*plVar11,&local_5f0,*puVar14);
            if (iVar6 < (int)puVar14[1]) {
              puVar13 = (undefined4 *)FUN_140357570(local_470);
              local_530 = *puVar13;
              uStack_52c = puVar13[1];
              local_528 = puVar13[2];
              uStack_524 = puVar13[3];
              local_590 = 0;
              uStack_58c = 0;
              local_588 = 0;
              uStack_584 = 0;
              FUN_14000a170(&local_e8);
              local_40 = 0;
              local_e8 = *puVar13;
              uStack_e4 = puVar13[1];
              uStack_e0 = puVar13[2];
              uStack_dc = puVar13[3];
              uVar24 = *puVar14;
              local_cc = *(undefined2 *)(puVar14 + 1);
              local_c8 = 0xffffffff;
              local_d0 = uVar24;
              uVar12 = FUN_140137690();
              local_7c = FUN_140136c10(uVar12,uVar24);
              uVar12 = FUN_140174f00(&local_5d8);
              if ((int)uVar7 < 0) {
                iVar6 = -1;
              }
              else {
                in_stack_fffffffffffff9b8 = &local_590;
                iVar6 = FUN_1401e8dc0(uVar12,param_2,&local_5f0,&local_e8,in_stack_fffffffffffff9b8)
                ;
              }
              lVar19 = FUN_1404186a0();
              if (*(int *)(lVar19 + 0x250) == 1000) {
                uVar12 = FUN_140137690();
                lVar19 = FUN_140136770(uVar12,*puVar14);
                if (lVar19 == 0) {
                  wprintf(
                         L"QUEST DATA ERROR Quest[%d] Item[%d]: 없는 아이템을 배달 시킴.\n"
                         );
                }
              }
              FUN_14000a170(&local_2f8);
              local_250 = 0;
              lVar19 = FUN_140174f00(&local_5d8);
              uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffff9b8 >> 0x20);
              if (((uVar7 < 5) && (-1 < iVar6)) && (iVar6 < 0x18)) {
                lVar19 = ((longlong)iVar6 + uVar16 * 0x18) * 0xac + lVar19;
                uVar20 = (undefined2)uVar7;
                *(undefined2 *)(lVar19 + 0x14) = uVar20;
                uVar21 = (undefined2)iVar6;
                *(undefined2 *)(lVar19 + 0x16) = uVar21;
                FUN_140090020(&local_2f8);
                bVar22 = CONCAT44(uStack_52c,local_530) < CONCAT44(uStack_58c,local_590);
                if ((CONCAT44(uStack_52c,local_530) == CONCAT44(uStack_58c,local_590)) &&
                   (bVar22 = CONCAT44(uStack_524,local_528) < CONCAT44(uStack_584,local_588),
                   CONCAT44(uStack_524,local_528) == CONCAT44(uStack_584,local_588))) {
                  iVar6 = 0;
                }
                else {
                  iVar6 = (1 - (uint)bVar22) - (uint)(bVar22 != 0);
                }
                if (iVar6 == 0) {
                  local_550 = *(undefined4 *)(param_2 + 0x160);
                  local_54c = *(undefined4 *)(param_2 + 0x164);
                  local_548 = *(undefined4 *)(param_2 + 0x168);
                  local_544 = *(undefined4 *)(param_2 + 0x16c);
                  local_540 = *(undefined4 *)(param_2 + 0x170);
                  local_53c = *(undefined4 *)(param_2 + 0x174);
                  local_538 = *(undefined4 *)(param_2 + 0x178);
                  local_534 = *(undefined4 *)(param_2 + 0x17c);
                  iVar6 = *(int *)(param_2 + 0x284);
                  local_5a8[0] = *(undefined4 *)(param_2 + 8);
                  local_2e4 = uVar20;
                  local_2e2 = uVar21;
                  if ((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
                    if ((local_2f8 == 0) && (local_2f0 == 0)) {
                      bVar22 = false;
                    }
                    else {
                      bVar22 = true;
                    }
                    if (((bVar22) && (local_2e0 != 0)) &&
                       (lVar19 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar19 != 0)
                       ) {
                      local_5e2 = (undefined2)iVar6;
                      plVar10 = (longlong *)
                                (*(longlong *)
                                  (*(longlong *)(lVar19 + 8) +
                                  (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                      in_stack_fffffffffffff9d8 = &local_2f8;
                      in_stack_fffffffffffff9d0 = &DAT_14047b98c;
                      in_stack_fffffffffffff9c8 = &local_550;
                      in_stack_fffffffffffff9c0 = (longlong *)&local_540;
                      puVar13 = local_5a8;
                      (**(code **)(*plVar10 + 0xb0))
                                (plVar10,1,&DAT_1405d85a0,&local_5e2,puVar13,
                                 in_stack_fffffffffffff9c0,in_stack_fffffffffffff9c8,&DAT_14047b98c,
                                 in_stack_fffffffffffff9d8);
                      uVar24 = (undefined4)((ulonglong)puVar13 >> 0x20);
                    }
                  }
                  FUN_140198570(param_2,&local_498);
                  plVar10 = local_498;
                  uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffff9c8 >> 0x20);
                  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffff9d0 >> 0x20);
                  uVar7 = (uint)(in_stack_fffffffffffff9e0 >> 0x20);
                  if (local_498 != (longlong *)0x0) {
                    if (local_498 == local_490) {
                      if (*local_498 != 0) {
                        lVar19 = FUN_140174f00(&local_5d8);
                        uVar1 = *(undefined4 *)(lVar19 + 0x50a0);
                        lVar19 = FUN_140174f00(&local_5d8);
                        in_stack_fffffffffffff9e0 = (ulonglong)uVar7 << 0x20;
                        in_stack_fffffffffffff9d8 =
                             (longlong *)((ulonglong)in_stack_fffffffffffff9d8 & 0xffffffff00000000)
                        ;
                        in_stack_fffffffffffff9d0 = (undefined *)CONCAT44(uVar26,uVar1);
                        in_stack_fffffffffffff9c8 =
                             (undefined4 *)CONCAT44(uVar25,*(undefined4 *)(lVar19 + 0x50a0));
                        FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,&local_2f8,0x191,
                                      CONCAT44(uVar24,0x23),
                                      (ulonglong)in_stack_fffffffffffff9c0 & 0xffffffff00000000,
                                      in_stack_fffffffffffff9c8,in_stack_fffffffffffff9d0,
                                      in_stack_fffffffffffff9d8,in_stack_fffffffffffff9e0);
                      }
                    }
                    else {
                      iVar6 = DAT_14060804c + 1;
                      bVar22 = DAT_14060804c == 0;
                      DAT_14060804c = iVar6;
                      if (bVar22) {
                        FUN_140176d60(1);
                      }
                    }
                  }
                  if (plVar10 != (longlong *)0x0) {
                    if (plVar10 == local_490) {
                      LOCK();
                      plVar10 = plVar10 + 1;
                      *(int *)plVar10 = (int)*plVar10 + -1;
                      UNLOCK();
                      if ((int)*plVar10 == 0) {
                        puVar2 = (undefined8 *)*local_498;
                        if (puVar2 != (undefined8 *)0x0) {
                          (**(code **)*puVar2)(puVar2,1);
                        }
                        operator_delete(local_498);
                      }
                      uVar16 = (ulonglong)local_5f0;
                      puVar14 = local_4e0;
                      plVar11 = local_5d8;
                    }
                    else {
                      iVar6 = DAT_140608054 + 1;
                      bVar22 = DAT_140608054 == 0;
                      DAT_140608054 = iVar6;
                      if (bVar22) {
                        FUN_140176d60(1);
                      }
                    }
                  }
                }
                local_5de = (undefined2)uVar16;
                plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                in_stack_fffffffffffff9c0 = &local_2f8;
                in_stack_fffffffffffff9b8 = (undefined4 *)&local_5e4;
                local_5e4 = uVar21;
                (**(code **)(*plVar10 + 0xe0))
                          (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_5de,
                           in_stack_fffffffffffff9b8,in_stack_fffffffffffff9c0);
              }
            }
          }
          if (puVar14 != (undefined4 *)0x0) {
            operator_delete(puVar14);
          }
        }
        local_4b8 = (void *)0x0;
        local_4b0 = (void *)0x0;
        local_4a8 = 0;
        uVar12 = FUN_1402e0270();
        FUN_1402e01a0(uVar12,local_res20[0],&local_4b8);
        if (local_4b8 != local_4b0) {
          local_4c0 = (longlong)local_4b0 - (longlong)local_4b8 >> 2;
          local_5c8 = 0;
          local_5f8 = 0;
          if ((int)local_4c0 != 0) {
            do {
              uVar7 = *(uint *)((longlong)local_4b8 + local_5f8 * 4);
              iVar6 = *(int *)((longlong)local_4b8 + local_5f8 * 4 + 4);
              if ((DAT_14060b7c4 & 1) == 0) {
                DAT_14060b7c4 = DAT_14060b7c4 | 1;
                FUN_140418590();
                atexit((_func_5014 *)&LAB_140448470);
              }
              if (DAT_14060a120 == 1000) {
                lVar19 = FUN_140137690();
                if (*(longlong *)(lVar19 + 0x88) != 0) {
                  for (puVar17 = *(uint **)(*(longlong *)(lVar19 + 0x88) +
                                           ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar19 + 0x98))
                                           * 8); puVar17 != (uint *)0x0;
                      puVar17 = *(uint **)(puVar17 + 0xa6)) {
                    if ((puVar17[0xa8] == uVar7) && (*puVar17 == uVar7)) {
                      if (puVar17 != (uint *)0x0) {
                        if (puVar17 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        if (puVar17 != (uint *)0xfffffffffffffff8) goto LAB_1402599b3;
                      }
                      break;
                    }
                  }
                }
                wprintf(L"QUEST DATA ERROR Quest[%d] Item[%d]: 없는 아이템을 주고 있음.\n"
                       );
              }
LAB_1402599b3:
              uVar12 = FUN_140137690();
              uVar8 = FUN_140136b30(uVar12,uVar7);
              uVar16 = (ulonglong)(int)uVar8;
              local_5ec = uVar8;
              iVar9 = FUN_1401eceb0(*plVar11,&local_5ec,uVar7);
              if (iVar9 < iVar6) {
                puVar14 = (undefined4 *)FUN_140357570(local_480);
                local_520 = *puVar14;
                uStack_51c = puVar14[1];
                local_518 = puVar14[2];
                uStack_514 = puVar14[3];
                local_5a0 = 0;
                uStack_59c = 0;
                local_598 = 0;
                uStack_594 = 0;
                FUN_14000a170(&local_198);
                local_f0 = 0;
                local_198 = *puVar14;
                uStack_194 = puVar14[1];
                uStack_190 = puVar14[2];
                uStack_18c = puVar14[3];
                local_17c = (undefined2)iVar6;
                local_178 = 0xffffffff;
                local_180 = uVar7;
                lVar19 = FUN_140137690();
                if (*(longlong *)(lVar19 + 0x88) != 0) {
                  for (puVar17 = *(uint **)(*(longlong *)(lVar19 + 0x88) +
                                           ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar19 + 0x98))
                                           * 8); puVar17 != (uint *)0x0;
                      puVar17 = *(uint **)(puVar17 + 0xa6)) {
                    if ((puVar17[0xa8] == uVar7) && (*puVar17 == uVar7)) {
                      if (puVar17 != (uint *)0x0) goto LAB_140259aac;
                      break;
                    }
                  }
                }
                puVar17 = (uint *)0x0;
LAB_140259aac:
                iVar6 = 0;
                if (puVar17 == (uint *)0x0) {
                  local_12c = 1;
                }
                else {
                  if (puVar17 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                    FUN_14000d450(0x80004005);
                  }
                  local_12c = (undefined2)puVar17[0x3d];
                }
                if ((int)uVar8 < 0) {
                  iVar9 = -1;
                }
                else {
                  in_stack_fffffffffffff9b8 = &local_5a0;
                  iVar9 = FUN_1401e8dc0(*plVar11,param_2,&local_5ec,&local_198,
                                        in_stack_fffffffffffff9b8);
                }
                FUN_14000a170(&local_248);
                uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffff9b8 >> 0x20);
                local_1a0 = 0;
                if (((uVar8 < 5) && (-1 < iVar9)) && (iVar9 < 0x18)) {
                  lVar19 = ((longlong)iVar9 + uVar16 * 0x18) * 0xac + *plVar11;
                  uVar21 = (undefined2)uVar8;
                  *(undefined2 *)(lVar19 + 0x14) = uVar21;
                  uVar20 = (undefined2)iVar9;
                  *(undefined2 *)(lVar19 + 0x16) = uVar20;
                  FUN_140090020(&local_248);
                  bVar22 = CONCAT44(uStack_51c,local_520) < CONCAT44(uStack_59c,local_5a0);
                  if ((CONCAT44(uStack_51c,local_520) != CONCAT44(uStack_59c,local_5a0)) ||
                     (bVar22 = CONCAT44(uStack_514,local_518) < CONCAT44(uStack_594,local_598),
                     iVar9 = iVar6, CONCAT44(uStack_514,local_518) != CONCAT44(uStack_594,local_598)
                     )) {
                    iVar9 = (1 - (uint)bVar22) - (uint)(bVar22 != 0);
                  }
                  if (iVar9 == 0) {
                    local_500 = *(undefined4 *)(param_2 + 0x160);
                    local_4fc = *(undefined4 *)(param_2 + 0x164);
                    local_4f8 = *(undefined4 *)(param_2 + 0x168);
                    local_4f4 = *(undefined4 *)(param_2 + 0x16c);
                    local_510 = *(undefined4 *)(param_2 + 0x170);
                    local_50c = *(undefined4 *)(param_2 + 0x174);
                    local_508 = *(undefined4 *)(param_2 + 0x178);
                    local_504 = *(undefined4 *)(param_2 + 0x17c);
                    iVar9 = *(int *)(param_2 + 0x284);
                    local_5b0[0] = *(undefined4 *)(param_2 + 8);
                    local_234 = uVar21;
                    local_232 = uVar20;
                    if ((-1 < iVar9) && (iVar9 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                    {
                      if ((local_248 != 0) || (local_240 != 0)) {
                        iVar6 = 1;
                      }
                      if (((iVar6 != 0) && (local_230 != 0)) &&
                         (lVar19 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0),
                         lVar19 != 0)) {
                        local_5da = (undefined2)iVar9;
                        plVar10 = (longlong *)
                                  (*(longlong *)
                                    (*(longlong *)(lVar19 + 8) +
                                    (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        in_stack_fffffffffffff9d8 = &local_248;
                        in_stack_fffffffffffff9d0 = &DAT_14047b990;
                        in_stack_fffffffffffff9c8 = &local_500;
                        in_stack_fffffffffffff9c0 = (longlong *)&local_510;
                        puVar14 = local_5b0;
                        (**(code **)(*plVar10 + 0xb0))
                                  (plVar10,1,&DAT_1405d85a0,&local_5da,puVar14,
                                   in_stack_fffffffffffff9c0,in_stack_fffffffffffff9c8,
                                   &DAT_14047b990,in_stack_fffffffffffff9d8);
                        uVar24 = (undefined4)((ulonglong)puVar14 >> 0x20);
                      }
                    }
                    FUN_140198570(param_2,&local_4f0);
                    plVar5 = local_4e8;
                    plVar10 = local_4f0;
                    uVar25 = (undefined4)((ulonglong)in_stack_fffffffffffff9c8 >> 0x20);
                    uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffff9d0 >> 0x20);
                    if (local_4f0 != (longlong *)0x0) {
                      if (local_4f0 == local_4e8) {
                        if (*local_4f0 != 0) {
                          lVar19 = FUN_140174f00(&local_5d8);
                          uVar1 = *(undefined4 *)(lVar19 + 0x50a0);
                          lVar19 = FUN_140174f00(&local_5d8);
                          in_stack_fffffffffffff9e0 = in_stack_fffffffffffff9e0 & 0xffffffff00000000
                          ;
                          in_stack_fffffffffffff9d8 =
                               (longlong *)
                               ((ulonglong)in_stack_fffffffffffff9d8 & 0xffffffff00000000);
                          in_stack_fffffffffffff9d0 = (undefined *)CONCAT44(uVar26,uVar1);
                          in_stack_fffffffffffff9c8 =
                               (undefined4 *)CONCAT44(uVar25,*(undefined4 *)(lVar19 + 0x50a0));
                          FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,&local_248,0x191,
                                        CONCAT44(uVar24,0x23),
                                        (ulonglong)in_stack_fffffffffffff9c0 & 0xffffffff00000000,
                                        in_stack_fffffffffffff9c8,in_stack_fffffffffffff9d0,
                                        in_stack_fffffffffffff9d8,in_stack_fffffffffffff9e0);
                        }
                      }
                      else {
                        iVar6 = DAT_14060804c + 1;
                        bVar22 = DAT_14060804c == 0;
                        DAT_14060804c = iVar6;
                        if (bVar22) {
                          FUN_140176d60(1);
                        }
                      }
                    }
                    if (plVar10 != (longlong *)0x0) {
                      if (plVar10 == plVar5) {
                        if (plVar10 != (longlong *)0x0) {
                          LOCK();
                          plVar11 = plVar10 + 1;
                          lVar19 = *plVar11;
                          *(int *)plVar11 = (int)*plVar11 + -1;
                          UNLOCK();
                          if ((int)lVar19 == 1) {
                            local_4f0 = (longlong *)0x0;
                            puVar2 = (undefined8 *)*plVar10;
                            if (puVar2 != (undefined8 *)0x0) {
                              (**(code **)*puVar2)(puVar2,1);
                            }
                            operator_delete(plVar10);
                          }
                          uVar16 = (ulonglong)local_5ec;
                          plVar11 = local_5d8;
                        }
                      }
                      else {
                        iVar6 = DAT_140608054 + 1;
                        bVar22 = DAT_140608054 == 0;
                        DAT_140608054 = iVar6;
                        if (bVar22) {
                          FUN_140176d60(1);
                        }
                      }
                    }
                  }
                  local_5dc = (undefined2)uVar16;
                  plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                  in_stack_fffffffffffff9c0 = &local_248;
                  in_stack_fffffffffffff9b8 = (undefined4 *)&local_5e6;
                  local_5e6 = uVar20;
                  (**(code **)(*plVar10 + 0xe0))
                            (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_5dc,
                             in_stack_fffffffffffff9b8,in_stack_fffffffffffff9c0);
                }
              }
              local_5c8 = local_5c8 + 2;
              local_5f8 = local_5f8 + 2;
            } while (local_5c8 < (uint)local_4c0);
          }
        }
        pvVar3 = local_4b8;
        puVar14 = (undefined4 *)*param_1;
        uVar7 = 0;
        if (puVar14 != (undefined4 *)param_1[1]) {
LAB_140259e80:
          if (((puVar14[5] != local_res20[0]) || (puVar14[4] != local_res18[0])) ||
             (*(short *)(puVar14 + 7) == 0xff)) goto LAB_140259e92;
          local_448[0] = *puVar14;
          local_448[1] = puVar14[1];
          local_448[2] = puVar14[2];
          local_448[3] = puVar14[3];
          *(undefined2 *)(puVar14 + 7) = 0;
          puVar13 = puVar14 + 0x10;
          lVar19 = 5;
          do {
            puVar13[-6] = *(undefined4 *)
                           (((longlong)local_460 - (longlong)puVar14) + (longlong)puVar13);
            *puVar13 = *(undefined4 *)
                        (((longlong)local_448 - (longlong)puVar14) + (longlong)puVar13);
            puVar13[5] = *(undefined4 *)
                          (((longlong)local_434 - (longlong)puVar14) + (longlong)puVar13);
            puVar13 = puVar13 + 1;
            lVar19 = lVar19 + -1;
          } while (lVar19 != 0);
          local_5b8[0] = (uint)*(ushort *)(puVar14 + 7);
          local_570 = *(undefined4 *)(param_2 + 0x170);
          uStack_56c = *(undefined4 *)(param_2 + 0x174);
          local_568 = *(undefined4 *)(param_2 + 0x178);
          uStack_564 = *(undefined4 *)(param_2 + 0x17c);
          iVar6 = *(int *)(param_2 + 0x284);
          if ((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
            if ((*(longlong *)(param_2 + 0x170) != 0) ||
               (uVar8 = uVar7, *(longlong *)(param_2 + 0x178) != 0)) {
              uVar8 = 1;
            }
            if ((uVar8 != 0) &&
               (lVar19 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar19 != 0)) {
              local_5e0 = (undefined2)iVar6;
              lVar19 = *(longlong *)
                        (*(longlong *)(lVar19 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8);
              (**(code **)(*(longlong *)(lVar19 + 0x70) + 0x1b0))
                        (lVar19 + 0x70,1,&DAT_1405d85a0,&local_5e0,&local_570,puVar14,local_5b8,
                         puVar14 + 10,puVar14 + 0xb,puVar14 + 0xc,puVar14 + 0xd,puVar14 + 0xe,
                         puVar14 + 0x50);
            }
          }
          goto LAB_14025a13d;
        }
LAB_14025a022:
        puVar14 = (undefined4 *)FUN_140357570(local_460);
        local_448[0] = *puVar14;
        local_448[1] = puVar14[1];
        local_448[2] = puVar14[2];
        local_448[3] = puVar14[3];
        local_580 = *(undefined4 *)(param_2 + 0x170);
        uStack_57c = *(undefined4 *)(param_2 + 0x174);
        local_578 = *(undefined4 *)(param_2 + 0x178);
        uStack_574 = *(undefined4 *)(param_2 + 0x17c);
        iVar6 = *(int *)(param_2 + 0x284);
        local_5c0[0] = 0;
        if ((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
          if ((*(longlong *)(param_2 + 0x170) == 0) && (*(longlong *)(param_2 + 0x178) == 0)) {
            bVar22 = false;
          }
          else {
            bVar22 = true;
          }
          if ((bVar22) &&
             (lVar19 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar19 != 0)) {
            local_5e8 = (undefined2)iVar6;
            plVar10 = (longlong *)
                      (*(longlong *)
                        (*(longlong *)(lVar19 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                      );
            (**(code **)(*plVar10 + 0x1a0))
                      (plVar10,1,&DAT_1405d85a0,&local_5e8,&local_580,local_448,&local_438,local_434
                       ,local_5c0);
          }
        }
        FUN_14025c040(param_1,local_448);
LAB_14025a13d:
        plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        puVar17 = local_434;
        piVar23 = &local_438;
        (**(code **)(*plVar10 + 0x170))
                  (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_448,piVar23,puVar17);
        uVar8 = local_res20[0];
        uVar24 = (undefined4)((ulonglong)piVar23 >> 0x20);
        uVar25 = (undefined4)((ulonglong)puVar17 >> 0x20);
        plVar10 = (longlong *)FUN_1402e0270();
        uVar4 = local_5c4;
        if (*plVar10 != 0) {
          for (puVar17 = *(uint **)(*plVar10 +
                                   ((ulonglong)uVar8 % (ulonglong)*(uint *)(plVar10 + 2)) * 8);
              puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0x90)) {
            if ((puVar17[0x92] == uVar8) && (*puVar17 == uVar8)) {
              if (puVar17 != (uint *)0x0) {
                uVar7 = puVar17[0x59];
              }
              break;
            }
          }
        }
        FUN_140202650(*(undefined8 *)(param_2 + 0xb50),param_2,700,local_434[0],
                      CONCAT44(uVar24,local_5c4),CONCAT44(uVar25,uVar7));
        if (((((uVar4 == 4) || (uVar4 == 5)) || (uVar4 == 6)) || ((uVar4 == 10 || (uVar4 == 0xb))))
           || (uVar4 == 0xc)) {
          puVar17 = local_408;
          lVar19 = 5;
          do {
            uVar7 = *puVar17;
            if (0 < (int)uVar7) {
              lVar15 = FUN_140137690();
              if (*(longlong *)(lVar15 + 0x88) != 0) {
                for (puVar18 = *(uint **)(*(longlong *)(lVar15 + 0x88) +
                                         ((ulonglong)uVar7 % (ulonglong)*(uint *)(lVar15 + 0x98)) *
                                         8); puVar18 != (uint *)0x0;
                    puVar18 = *(uint **)(puVar18 + 0xa6)) {
                  if ((puVar18[0xa8] == uVar7) && (*puVar18 == uVar7)) {
                    if (puVar18 != (uint *)0x0) {
                      FUN_1401a8bb0(param_2);
                    }
                    break;
                  }
                }
              }
            }
            puVar17 = puVar17 + 1;
            lVar19 = lVar19 + -1;
          } while (lVar19 != 0);
        }
        if (pvVar3 != (void *)0x0) {
          operator_delete(pvVar3);
        }
        _eh_vector_destructor_iterator_(local_3d8,0x28,5,FUN_140129b90);
        LOCK();
        plVar11 = plVar11 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        plVar10 = local_560;
        if ((int)*plVar11 == 0) {
          pvVar3 = (void *)*local_5d8;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_5d8);
          plVar10 = local_560;
        }
        goto LAB_14025a356;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar22 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar22) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar11 != (longlong *)0x0) {
    if (plVar11 == local_5d0) {
      LOCK();
      plVar11 = plVar11 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      plVar10 = local_560;
      if ((int)*plVar11 == 0) {
        pvVar3 = (void *)*local_5d8;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0xf630);
          operator_delete(pvVar3);
        }
        operator_delete(local_5d8);
        plVar10 = local_560;
      }
    }
    else {
      iVar6 = DAT_140608050 + 1;
      bVar22 = DAT_140608050 == 0;
      DAT_140608050 = iVar6;
      if (bVar22) {
        FUN_140176d60(1);
      }
    }
  }
LAB_14025a356:
  uVar16 = FUN_14034edd0(plVar10);
  return uVar16;
LAB_140259e92:
  puVar14 = puVar14 + 0x54;
  if (puVar14 == (undefined4 *)param_1[1]) goto LAB_14025a022;
  goto LAB_140259e80;
}



// WARNING: Removing unreachable block (ram,0x00014025a645)
// WARNING: Removing unreachable block (ram,0x00014025a6d8)
// WARNING: Removing unreachable block (ram,0x00014025a4a0)

void FUN_14025a380(longlong param_1,longlong param_2,longlong *param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  uint uVar4;
  longlong lVar5;
  void *pvVar6;
  int iVar7;
  uint uVar8;
  longlong *plVar9;
  undefined8 uVar10;
  uint *puVar11;
  uint uVar12;
  undefined4 *puVar13;
  longlong lVar14;
  uint uVar15;
  ulonglong uVar16;
  longlong lVar17;
  bool bVar18;
  uint local_res18 [2];
  undefined2 local_res20 [4];
  undefined8 in_stack_fffffffffffffef8;
  undefined4 uVar19;
  undefined8 in_stack_ffffffffffffff00;
  undefined4 uVar20;
  undefined8 in_stack_ffffffffffffff08;
  undefined4 uVar21;
  ulonglong in_stack_ffffffffffffff10;
  uint local_b8;
  undefined4 local_b4;
  undefined4 uStack_b0;
  undefined4 local_ac;
  undefined4 uStack_a8;
  longlong *local_a0;
  longlong *local_98;
  undefined4 local_90;
  undefined4 uStack_8c;
  undefined4 local_88;
  undefined4 uStack_84;
  undefined4 *local_80;
  undefined4 *local_78;
  undefined8 local_70;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  
  uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffef8 >> 0x20);
  uVar21 = (undefined4)((ulonglong)in_stack_ffffffffffffff08 >> 0x20);
  local_60 = 0xfffffffffffffffe;
  *(undefined2 *)(*param_3 + 0x1c) = 0xff;
  uVar8 = 0;
  *(undefined4 *)(*param_3 + 0x28) = 0;
  *(undefined4 *)(*param_3 + 0x2c) = 0;
  *(undefined4 *)(*param_3 + 0x30) = 0;
  *(undefined4 *)(*param_3 + 0x34) = 0;
  *(undefined4 *)(*param_3 + 0x38) = 0;
  plVar9 = param_3;
  FUN_140197b70(param_2);
  plVar1 = local_a0;
  if (local_a0 != (longlong *)0x0) {
    if (local_a0 == local_98) {
      if (*local_a0 != 0) {
        local_80 = (undefined4 *)0x0;
        local_78 = (undefined4 *)0x0;
        local_70 = 0;
        local_58 = 0;
        local_50 = 0;
        local_48 = 0;
        uVar15 = *(uint *)(*plVar9 + 0x14);
        plVar9 = (longlong *)FUN_1402e0270();
        if (*plVar9 != 0) {
          for (puVar11 = *(uint **)(*plVar9 +
                                   ((ulonglong)uVar15 % (ulonglong)*(uint *)(plVar9 + 2)) * 8);
              puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0x90)) {
            if ((puVar11[0x92] == uVar15) && (*puVar11 == uVar15)) {
              if (puVar11 != (uint *)0x0) {
                uVar15 = puVar11[0x13];
                local_res18[0] = uVar15;
                if (uVar15 == 9) {
                  lVar17 = *param_3;
                  uVar10 = FUN_1402e0270();
                  FUN_1402e00d0(uVar10,*(undefined4 *)(lVar17 + 0x14),&local_80);
                  puVar13 = local_80;
                  uVar20 = (undefined4)((ulonglong)in_stack_ffffffffffffff00 >> 0x20);
                  if (2 < (ulonglong)((longlong)local_78 - (longlong)local_80 >> 2)) {
                    uVar2 = *local_80;
                    uVar3 = local_80[1];
                    uVar10 = FUN_140174f00(&local_a0);
                    in_stack_ffffffffffffff10 = in_stack_ffffffffffffff10 & 0xffffffff00000000;
                    in_stack_ffffffffffffff00 = CONCAT44(uVar20,0x19e);
                    FUN_1401ebc50(uVar10,param_2,uVar2,uVar3,CONCAT44(uVar19,0xfffffffa),
                                  in_stack_ffffffffffffff00,CONCAT44(uVar21,7),
                                  in_stack_ffffffffffffff10);
                    uVar15 = local_res18[0];
                  }
                  if (puVar13 != local_78) {
                    memmove(puVar13,local_78,0);
                    local_78 = puVar13;
                  }
                }
                goto LAB_14025a553;
              }
              break;
            }
          }
        }
        local_res18[0] = 0;
        uVar15 = uVar8;
LAB_14025a553:
        lVar17 = *param_3;
        uVar10 = FUN_1402e0270();
        FUN_1402e01a0(uVar10,*(undefined4 *)(lVar17 + 0x14),&local_80);
        uVar19 = (undefined4)((ulonglong)in_stack_ffffffffffffff00 >> 0x20);
        if ((local_80 != local_78) &&
           (iVar7 = (int)((longlong)local_78 - (longlong)local_80 >> 2), iVar7 != 0)) {
          uVar16 = (ulonglong)((iVar7 - 1U >> 1) + 1);
          puVar13 = local_80;
          do {
            in_stack_ffffffffffffff10 = in_stack_ffffffffffffff10 & 0xffffffff00000000;
            in_stack_ffffffffffffff00 =
                 CONCAT44((int)((ulonglong)in_stack_ffffffffffffff00 >> 0x20),0x19e);
            FUN_1401ebc50(*plVar1,param_2,*puVar13,puVar13[1],0xfffffffa,in_stack_ffffffffffffff00,7
                          ,in_stack_ffffffffffffff10);
            uVar19 = (undefined4)((ulonglong)in_stack_ffffffffffffff00 >> 0x20);
            puVar13 = puVar13 + 2;
            uVar16 = uVar16 - 1;
            uVar15 = local_res18[0];
          } while (uVar16 != 0);
        }
        plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        lVar17 = *param_3 + 0x14;
        (**(code **)(*plVar9 + 0xb30))
                  (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,*param_3,lVar17);
        uVar21 = (undefined4)((ulonglong)lVar17 >> 0x20);
        uVar4 = *(uint *)(*param_3 + 0x14);
        plVar9 = (longlong *)FUN_1402e0270();
        uVar12 = uVar8;
        if (*plVar9 != 0) {
          for (puVar11 = *(uint **)(*plVar9 +
                                   ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar9 + 2)) * 8);
              puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0x90)) {
            if ((puVar11[0x92] == uVar4) && (*puVar11 == uVar4)) {
              if (puVar11 != (uint *)0x0) {
                uVar12 = puVar11[0x59];
              }
              break;
            }
          }
        }
        FUN_140202650(*(undefined8 *)(param_2 + 0xb50),param_2,0x2c0,
                      *(undefined4 *)(*param_3 + 0x14),CONCAT44(uVar21,uVar15),
                      CONCAT44(uVar19,uVar12));
        uVar15 = *(uint *)(*param_3 + 0x14);
        plVar9 = (longlong *)FUN_1402e0270();
        if (*plVar9 != 0) {
          puVar11 = *(uint **)(*plVar9 + ((ulonglong)uVar15 % (ulonglong)*(uint *)(plVar9 + 2)) * 8)
          ;
LAB_14025a6a8:
          if (puVar11 != (uint *)0x0) {
            if ((puVar11[0x92] != uVar15) || (*puVar11 != uVar15)) goto LAB_14025a6bd;
            if ((puVar11 != (uint *)0x0) && (puVar11[3] == 3)) {
              local_90 = *(undefined4 *)(param_2 + 0x170);
              uStack_8c = *(undefined4 *)(param_2 + 0x174);
              local_88 = *(undefined4 *)(param_2 + 0x178);
              uStack_84 = *(undefined4 *)(param_2 + 0x17c);
              iVar7 = *(int *)(param_2 + 0x284);
              if ((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
                if ((*(longlong *)(param_2 + 0x170) != 0) || (*(longlong *)(param_2 + 0x178) != 0))
                {
                  uVar8 = 1;
                }
                if ((uVar8 != 0) &&
                   (lVar17 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar17 != 0)) {
                  local_res18[0] = CONCAT22(local_res18[0]._2_2_,(short)iVar7);
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar17 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar9 + 0x1c0))
                            (plVar9,1,&DAT_1405d85a0,local_res18,&local_90,*param_3);
                }
              }
              lVar14 = *param_3;
              FUN_14025c680(lVar14 + 0x150,*(undefined8 *)(param_1 + 8),lVar14);
              lVar5 = *(longlong *)(param_1 + 8);
              for (lVar17 = lVar5 + -0x150; lVar17 != lVar5; lVar17 = lVar17 + 0x150) {
                _eh_vector_destructor_iterator_((void *)(lVar17 + 0x70),0x28,5,FUN_140129b90);
              }
              goto LAB_14025a995;
            }
          }
        }
        lVar17 = *param_3;
        local_b8 = (uint)*(ushort *)(lVar17 + 0x1c);
        local_b4 = *(undefined4 *)(param_2 + 0x170);
        uStack_b0 = *(undefined4 *)(param_2 + 0x174);
        local_ac = *(undefined4 *)(param_2 + 0x178);
        uStack_a8 = *(undefined4 *)(param_2 + 0x17c);
        iVar7 = *(int *)(param_2 + 0x284);
        if ((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
          if ((*(longlong *)(param_2 + 0x170) != 0) || (*(longlong *)(param_2 + 0x178) != 0)) {
            uVar8 = 1;
          }
          if ((uVar8 != 0) &&
             (lVar14 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar14 != 0)) {
            local_res20[0] = (undefined2)iVar7;
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar14 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70)
            ;
            (**(code **)(*plVar9 + 0x1b0))
                      (plVar9,1,&DAT_1405d85a0,local_res20,&local_b4,lVar17,&local_b8,lVar17 + 0x28,
                       lVar17 + 0x2c,lVar17 + 0x30,lVar17 + 0x34,lVar17 + 0x38,lVar17 + 0x140);
          }
        }
        FUN_14025c040(param_1 + 0x20,*param_3);
        lVar14 = *param_3;
        FUN_14025c680(lVar14 + 0x150,*(undefined8 *)(param_1 + 8),lVar14);
        lVar5 = *(longlong *)(param_1 + 8);
        for (lVar17 = lVar5 + -0x150; lVar17 != lVar5; lVar17 = lVar17 + 0x150) {
          _eh_vector_destructor_iterator_((void *)(lVar17 + 0x70),0x28,5,FUN_140129b90);
        }
LAB_14025a995:
        *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -0x150;
        *param_3 = lVar14;
        if (local_80 != (undefined4 *)0x0) {
          operator_delete(local_80);
        }
        goto LAB_14025a9da;
      }
    }
    else {
      iVar7 = DAT_140608048 + 1;
      bVar18 = DAT_140608048 == 0;
      DAT_140608048 = iVar7;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_98) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14025a9da:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    pvVar6 = (void *)*local_a0;
    if (pvVar6 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar6 + 0xf630);
      operator_delete(pvVar6);
    }
    operator_delete(local_a0);
  }
  return;
LAB_14025a6bd:
  puVar11 = *(uint **)(puVar11 + 0x90);
  goto LAB_14025a6a8;
}



void FUN_14025aa30(longlong *param_1,undefined8 param_2,int param_3)

{
  longlong *plVar1;
  longlong local_res8;
  undefined8 uVar2;
  longlong *plVar3;
  
  uVar2 = 0xfffffffffffffffe;
  plVar1 = param_1 + 9;
  plVar3 = plVar1;
  FUN_14034ed40(plVar1);
  local_res8 = *param_1;
  do {
    if (local_res8 == param_1[1]) {
LAB_14025aaaa:
      FUN_14034edd0(plVar1);
      return;
    }
    if (*(int *)(local_res8 + 0x14) == param_3) {
      FUN_14025a380(param_1,param_2,&local_res8,param_1[1],uVar2,plVar3,1);
      goto LAB_14025aaaa;
    }
    local_res8 = local_res8 + 0x150;
  } while( true );
}



void FUN_14025aad0(undefined8 *param_1,undefined8 param_2,ulonglong *param_3,int param_4)

{
  int iVar1;
  bool bVar2;
  ulonglong *local_res8;
  
  FUN_14034ed40();
  local_res8 = (ulonglong *)*param_1;
  do {
    if (local_res8 == (ulonglong *)param_1[1]) {
LAB_14025ab5f:
      FUN_14034edd0(param_1 + 9);
      return;
    }
    bVar2 = *local_res8 < *param_3;
    if ((*local_res8 == *param_3) &&
       (bVar2 = local_res8[1] < param_3[1], local_res8[1] == param_3[1])) {
      iVar1 = 0;
    }
    else {
      iVar1 = (1 - (uint)bVar2) - (uint)(bVar2 != 0);
    }
    if ((iVar1 == 0) && (*(int *)((longlong)local_res8 + 0x14) == param_4)) {
      FUN_14025a380(param_1,param_2,&local_res8);
      goto LAB_14025ab5f;
    }
    local_res8 = local_res8 + 0x2a;
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x00014025aee4)
// WARNING: Removing unreachable block (ram,0x00014025acd9)

void FUN_14025ab80(longlong *param_1,longlong param_2,ulonglong *param_3,uint param_4)

{
  longlong *plVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  longlong lVar4;
  void *pvVar5;
  undefined4 *_Src;
  uint uVar6;
  int iVar7;
  longlong *plVar8;
  undefined8 uVar9;
  uint *puVar10;
  ulonglong *puVar11;
  longlong lVar12;
  ulonglong uVar13;
  undefined4 *puVar14;
  uint uVar15;
  bool bVar16;
  uint local_res20 [2];
  undefined8 in_stack_ffffffffffffff38;
  undefined4 uVar17;
  uint local_a8;
  longlong *local_98;
  longlong *local_90;
  longlong *local_88;
  undefined1 local_80;
  undefined4 *local_78;
  undefined4 *local_70;
  undefined8 local_68;
  undefined8 local_58;
  undefined8 local_50;
  undefined8 local_48;
  
  uVar17 = (undefined4)((ulonglong)in_stack_ffffffffffffff38 >> 0x20);
  plVar8 = param_1 + 9;
  local_res20[0] = param_4;
  local_88 = plVar8;
  FUN_14034ed40(plVar8);
  local_80 = 1;
  puVar11 = (ulonglong *)*param_1;
  if (puVar11 != (ulonglong *)param_1[1]) {
    uVar15 = 0;
    do {
      bVar16 = *puVar11 < *param_3;
      if ((*puVar11 != *param_3) ||
         (bVar16 = puVar11[1] < param_3[1], uVar6 = uVar15, puVar11[1] != param_3[1])) {
        uVar6 = (1 - (uint)bVar16) - (uint)(bVar16 != 0);
      }
      if ((uVar6 == 0) && (*(uint *)((longlong)puVar11 + 0x14) == local_res20[0])) {
        FUN_140197b70(param_2);
        plVar1 = local_98;
        uVar6 = local_res20[0];
        if (local_98 != (longlong *)0x0) {
          if (local_98 == local_90) {
            if (*local_98 != 0) {
              local_78 = (undefined4 *)0x0;
              local_70 = (undefined4 *)0x0;
              local_68 = 0;
              local_58 = 0;
              local_50 = 0;
              local_48 = 0;
              plVar8 = (longlong *)FUN_1402e0270();
              if (*plVar8 == 0) goto LAB_14025ad7b;
              puVar10 = *(uint **)(*plVar8 +
                                  ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar8 + 2)) * 8);
              goto LAB_14025aca8;
            }
          }
          else {
            iVar7 = DAT_140608048 + 1;
            bVar16 = DAT_140608048 == 0;
            DAT_140608048 = iVar7;
            if (bVar16) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == local_90) {
            LOCK();
            plVar1 = plVar1 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            plVar8 = local_88;
            if ((int)*plVar1 == 0) {
              pvVar5 = (void *)*local_98;
              if (pvVar5 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar5 + 0xf630);
                operator_delete(pvVar5);
              }
              operator_delete(local_98);
              plVar8 = local_88;
            }
          }
          else {
            iVar7 = DAT_140608050 + 1;
            bVar16 = DAT_140608050 == 0;
            DAT_140608050 = iVar7;
            if (bVar16) {
              FUN_140176d60(1);
            }
          }
        }
        break;
      }
      puVar11 = puVar11 + 0x2a;
    } while (puVar11 != (ulonglong *)param_1[1]);
  }
  goto LAB_14025afc5;
LAB_14025aca8:
  if (puVar10 == (uint *)0x0) goto LAB_14025ad7b;
  if ((puVar10[0x92] == uVar6) && (*puVar10 == uVar6)) {
    if (puVar10 != (uint *)0x0) {
      local_a8 = puVar10[0x13];
      if (local_a8 == 9) {
        uVar9 = FUN_1402e0270();
        FUN_1402e00d0(uVar9,local_res20[0],&local_78);
        _Src = local_70;
        puVar14 = local_78;
        if (2 < (ulonglong)((longlong)local_70 - (longlong)local_78 >> 2)) {
          uVar2 = *local_78;
          uVar3 = local_78[1];
          uVar9 = FUN_140174f00(&local_98);
          FUN_1401ebc50(uVar9,param_2,uVar2,uVar3,CONCAT44(uVar17,0xfffffffa),0x19e,7,0);
        }
        if (puVar14 != _Src) {
          memmove(puVar14,_Src,0);
          local_70 = puVar14;
        }
      }
      goto LAB_14025ad88;
    }
    goto LAB_14025ad7b;
  }
  puVar10 = *(uint **)(puVar10 + 0x90);
  goto LAB_14025aca8;
LAB_14025ad7b:
  local_a8 = 0;
LAB_14025ad88:
  uVar9 = FUN_1402e0270();
  FUN_1402e01a0(uVar9,local_res20[0],&local_78);
  if ((local_78 != local_70) &&
     (iVar7 = (int)((longlong)local_70 - (longlong)local_78 >> 2), iVar7 != 0)) {
    uVar13 = (ulonglong)((iVar7 - 1U >> 1) + 1);
    puVar14 = local_78;
    do {
      FUN_1401ebc50(*plVar1,param_2,*puVar14,puVar14[1],0xfffffffa,0x19e,7,0);
      puVar14 = puVar14 + 2;
      uVar13 = uVar13 - 1;
    } while (uVar13 != 0);
  }
  puVar14 = local_78;
  plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
  puVar10 = local_res20;
  (**(code **)(*plVar8 + 400))(plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,puVar11,puVar10);
  *(undefined2 *)((longlong)puVar11 + 0x1c) = 10;
  puVar11[5] = 0;
  *(undefined4 *)(puVar11 + 6) = 0;
  FUN_14025c680(puVar11 + 0x2a,param_1[1],puVar11);
  uVar17 = (undefined4)((ulonglong)puVar10 >> 0x20);
  lVar4 = param_1[1];
  uVar6 = local_res20[0];
  for (lVar12 = lVar4 + -0x150; local_res20[0] = uVar6, lVar12 != lVar4; lVar12 = lVar12 + 0x150) {
    _eh_vector_destructor_iterator_((void *)(lVar12 + 0x70),0x28,5,FUN_140129b90);
    uVar17 = (undefined4)((ulonglong)puVar10 >> 0x20);
    uVar6 = local_res20[0];
  }
  param_1[1] = param_1[1] + -0x150;
  plVar8 = (longlong *)FUN_1402e0270();
  if (*plVar8 != 0) {
    for (puVar10 = *(uint **)(*plVar8 + ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar8 + 2)) * 8);
        puVar10 != (uint *)0x0; puVar10 = *(uint **)(puVar10 + 0x90)) {
      if ((puVar10[0x92] == uVar6) && (*puVar10 == uVar6)) {
        if (puVar10 != (uint *)0x0) {
          uVar15 = puVar10[0x59];
        }
        break;
      }
    }
  }
  FUN_140202650(*(undefined8 *)(param_2 + 0xb50),param_2,0x2be,local_res20[0],
                CONCAT44(uVar17,local_a8),uVar15);
  if (puVar14 != (undefined4 *)0x0) {
    operator_delete(puVar14);
  }
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  plVar8 = local_88;
  if ((int)*plVar1 == 0) {
    pvVar5 = (void *)*local_98;
    if (pvVar5 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar5 + 0xf630);
      operator_delete(pvVar5);
    }
    operator_delete(local_98);
    plVar8 = local_88;
  }
LAB_14025afc5:
  FUN_14034edd0(plVar8);
  return;
}



undefined8 FUN_14025aff0(longlong param_1,longlong param_2)

{
  short *psVar1;
  uint *puVar2;
  uint uVar3;
  longlong *plVar4;
  uint uVar5;
  uint uVar6;
  uint *puVar7;
  undefined4 uVar8;
  short *psVar9;
  undefined4 uVar10;
  
  psVar1 = (short *)(param_2 + 0x1c);
  puVar2 = (uint *)(param_2 + 0x14);
  puVar7 = puVar2;
  psVar9 = psVar1;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78) + 0x160))
            (*(longlong *)(param_1 + 0xb50) + 0x78,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,
             param_2,puVar2,psVar1,param_2 + 0x28,param_2 + 0x2c,param_2 + 0x30,param_2 + 0x34,
             param_2 + 0x38);
  uVar8 = (undefined4)((ulonglong)puVar7 >> 0x20);
  uVar10 = (undefined4)((ulonglong)psVar9 >> 0x20);
  *(undefined4 *)(param_2 + 0x148) = 1;
  if (*psVar1 == 2) {
    uVar6 = *puVar2;
    plVar4 = (longlong *)FUN_1402e0270();
    if (*plVar4 != 0) {
      for (puVar7 = *(uint **)(*plVar4 + ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
          puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0x90)) {
        if ((puVar7[0x92] == uVar6) && (*puVar7 == uVar6)) {
          if (puVar7 != (uint *)0x0) {
            uVar6 = puVar7[0x59];
            goto LAB_14025b0ca;
          }
          break;
        }
      }
    }
    uVar6 = 0;
LAB_14025b0ca:
    uVar3 = *puVar2;
    plVar4 = (longlong *)FUN_1402e0270();
    uVar5 = 0;
    if (*plVar4 != 0) {
      for (puVar7 = *(uint **)(*plVar4 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
          uVar5 = 0, puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0x90)) {
        if ((puVar7[0x92] == uVar3) && (*puVar7 == uVar3)) {
          if (puVar7 != (uint *)0x0) {
            uVar5 = puVar7[0x13];
          }
          break;
        }
      }
    }
    FUN_140202650(*(undefined8 *)(param_1 + 0xb50),param_1,0x2bd,*puVar2,CONCAT44(uVar8,uVar5),
                  CONCAT44(uVar10,uVar6));
  }
  return 1;
}



ulonglong FUN_14025b170(longlong *param_1,int param_2)

{
  ushort uVar1;
  longlong lVar2;
  int *piVar3;
  longlong lVar4;
  ulonglong uVar5;
  
  FUN_14034ed40(param_1 + 9);
  for (lVar2 = *param_1; lVar2 != param_1[1]; lVar2 = lVar2 + 0x150) {
    if (*(int *)(lVar2 + 0x14) == param_2) {
      uVar1 = *(ushort *)(lVar2 + 0x1c);
      FUN_14034edd0(param_1 + 9);
      return (ulonglong)uVar1;
    }
  }
  uVar5 = 0;
  lVar2 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(param_1[5] - param_1[4]),8) +
          (param_1[5] - param_1[4]);
  lVar4 = lVar2 >> 8;
  lVar2 = lVar2 >> 0x3f;
  if (lVar4 != lVar2) {
    piVar3 = (int *)(param_1[4] + 0x14);
    do {
      if (*piVar3 == param_2) {
        uVar1 = *(ushort *)(uVar5 * 0x150 + 0x1c + param_1[4]);
        FUN_14034edd0(param_1 + 9);
        return (ulonglong)uVar1;
      }
      uVar5 = (ulonglong)((int)uVar5 + 1);
      piVar3 = piVar3 + 0x54;
    } while (uVar5 < (ulonglong)(lVar4 - lVar2));
  }
  FUN_14034edd0(param_1 + 9);
  return 0xffffffff;
}



// WARNING: Removing unreachable block (ram,0x00014025b2ec)

undefined8 FUN_14025b260(uint param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  longlong *plVar4;
  ulonglong uVar5;
  undefined4 *puVar6;
  uint *puVar7;
  uint uVar8;
  int iVar9;
  bool bVar10;
  bool bVar11;
  undefined8 uVar12;
  undefined4 *local_30;
  longlong local_28;
  undefined8 local_20;
  
  uVar12 = 0xfffffffffffffffe;
  iVar9 = 0;
  local_30 = (undefined4 *)0x0;
  local_28 = 0;
  local_20 = 0;
  uVar3 = FUN_1402e0270();
  FUN_1402e00d0(uVar3,param_1,&local_30,param_4,uVar12);
  plVar4 = (longlong *)FUN_1402e0270();
  puVar1 = local_30;
  uVar8 = 0;
  if (*plVar4 != 0) {
    for (puVar7 = *(uint **)(*plVar4 + ((ulonglong)param_1 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
        puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0x90)) {
      if ((puVar7[0x92] == param_1) && (*puVar7 == param_1)) {
        if (puVar7 != (uint *)0x0) {
          uVar8 = puVar7[0x13];
        }
        break;
      }
    }
  }
  *(uint *)(param_2 + 0x3c) = uVar8;
  switch(uVar8) {
  case 1:
  case 0x11:
  case 0x1a:
  case 0x1d:
  case 0x24:
  case 0x29:
  case 0x35:
  case 0x3b:
  case 0x41:
    if (1 < (ulonglong)(local_28 - (longlong)local_30 >> 2)) {
      uVar2 = local_30[1];
LAB_14025b448:
      *(undefined4 *)(param_2 + 0x28) = uVar2;
      goto LAB_14025b464;
    }
    break;
  case 2:
  case 0x12:
  case 0x1b:
  case 0x1e:
  case 0x25:
  case 0x26:
  case 0x27:
  case 0x2a:
  case 0x36:
  case 0x3c:
    uVar5 = local_28 - (longlong)local_30 >> 2;
    bVar10 = uVar5 < 3;
    bVar11 = uVar5 == 3;
    goto LAB_14025b35c;
  case 3:
  case 0x13:
  case 0x1c:
  case 0x1f:
  case 0x2b:
  case 0x37:
  case 0x3d:
    uVar5 = local_28 - (longlong)local_30 >> 2;
    bVar10 = uVar5 < 5;
    bVar11 = uVar5 == 5;
    goto LAB_14025b383;
  default:
    if (local_30 != (undefined4 *)0x0) {
      operator_delete(local_30);
    }
    return 0;
  case 7:
  case 8:
  case 0x20:
  case 0x32:
  case 0x42:
    if (local_28 - (longlong)local_30 >> 2 != 0) {
      uVar2 = *local_30;
      goto LAB_14025b448;
    }
    break;
  case 0xd:
  case 0x14:
  case 0x38:
    if (2 < (ulonglong)(local_28 - (longlong)local_30 >> 2)) {
      uVar2 = local_30[1];
      goto LAB_14025b448;
    }
    break;
  case 0xe:
  case 0x15:
  case 0x39:
    uVar5 = local_28 - (longlong)local_30 >> 2;
    bVar10 = uVar5 < 4;
    bVar11 = uVar5 == 4;
LAB_14025b35c:
    if (!bVar10 && !bVar11) {
      *(undefined4 *)(param_2 + 0x28) = local_30[1];
      *(undefined4 *)(param_2 + 0x2c) = local_30[3];
      goto LAB_14025b464;
    }
    break;
  case 0xf:
  case 0x16:
  case 0x3a:
    uVar5 = local_28 - (longlong)local_30 >> 2;
    bVar10 = uVar5 < 6;
    bVar11 = uVar5 == 6;
LAB_14025b383:
    if (!bVar10 && !bVar11) {
      *(undefined4 *)(param_2 + 0x28) = local_30[1];
      *(undefined4 *)(param_2 + 0x2c) = local_30[3];
      *(undefined4 *)(param_2 + 0x30) = local_30[5];
      goto LAB_14025b464;
    }
    break;
  case 0x10:
  case 0x21:
  case 0x22:
  case 0x23:
    if (1 < (ulonglong)(local_28 - (longlong)local_30 >> 2)) {
      *(undefined4 *)(param_2 + 0x28) = 1;
      goto LAB_14025b464;
    }
    break;
  case 0x17:
  case 0x18:
  case 0x19:
    if (0 < *(int *)(param_2 + 0x68)) {
      puVar6 = (undefined4 *)(param_2 + 0x28);
      do {
        *puVar6 = 1;
        iVar9 = iVar9 + 1;
        puVar6 = puVar6 + 1;
      } while (iVar9 < *(int *)(param_2 + 0x68));
    }
    goto LAB_14025b464;
  case 0x28:
    if (2 < (ulonglong)(local_28 - (longlong)local_30 >> 2)) {
      uVar2 = local_30[2];
      goto LAB_14025b448;
    }
  }
  FUN_140418da0(DAT_140607fd8,L"Invalid Quest : Code[%d]",param_1);
LAB_14025b464:
  if (puVar1 != (undefined4 *)0x0) {
    operator_delete(puVar1);
  }
  return 1;
}



void FUN_14025b510(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  longlong *plVar6;
  longlong lVar7;
  undefined2 local_res8 [4];
  undefined8 uVar8;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  longlong *local_40;
  undefined1 local_38;
  
  uVar8 = 0xfffffffffffffffe;
  plVar1 = param_1 + 9;
  local_40 = plVar1;
  FUN_14034ed40(plVar1);
  local_38 = 1;
  lVar3 = *param_1;
  if (lVar3 != param_1[1]) {
    do {
      local_50 = *(undefined4 *)(param_2 + 0x170);
      uStack_4c = *(undefined4 *)(param_2 + 0x174);
      local_48 = *(undefined4 *)(param_2 + 0x178);
      uStack_44 = *(undefined4 *)(param_2 + 0x17c);
      iVar2 = *(int *)(param_2 + 0x284);
      if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
        if ((*(longlong *)(param_2 + 0x170) == 0) && (*(longlong *)(param_2 + 0x178) == 0)) {
          bVar5 = false;
        }
        else {
          bVar5 = true;
        }
        if ((bVar5) && (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0))
        {
          local_res8[0] = (undefined2)iVar2;
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar6 + 0x1c0))(plVar6,1,&DAT_1405d85a0,local_res8,&local_50,lVar3,uVar8);
        }
      }
      plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar6 + 0x5d0))
                (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,lVar3,lVar3 + 0x14);
      FUN_14025c680(lVar3 + 0x150,param_1[1],lVar3);
      lVar4 = param_1[1];
      for (lVar7 = lVar4 + -0x150; lVar7 != lVar4; lVar7 = lVar7 + 0x150) {
        _eh_vector_destructor_iterator_((void *)(lVar7 + 0x70),0x28,5,FUN_140129b90);
      }
      param_1[1] = param_1[1] + -0x150;
    } while (lVar3 != param_1[1]);
  }
  lVar3 = param_1[4];
  if (lVar3 != param_1[5]) {
    do {
      local_50 = *(undefined4 *)(param_2 + 0x170);
      uStack_4c = *(undefined4 *)(param_2 + 0x174);
      local_48 = *(undefined4 *)(param_2 + 0x178);
      uStack_44 = *(undefined4 *)(param_2 + 0x17c);
      iVar2 = *(int *)(param_2 + 0x284);
      if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
        if ((*(longlong *)(param_2 + 0x170) == 0) && (*(longlong *)(param_2 + 0x178) == 0)) {
          bVar5 = false;
        }
        else {
          bVar5 = true;
        }
        if ((bVar5) && (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0))
        {
          local_res8[0] = (undefined2)iVar2;
          plVar6 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          (**(code **)(*plVar6 + 0x1c0))(plVar6,1,&DAT_1405d85a0,local_res8,&local_50,lVar3);
        }
      }
      plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar6 + 0x5d0))
                (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,lVar3,lVar3 + 0x14);
      FUN_14025c680(lVar3 + 0x150,param_1[5],lVar3);
      lVar4 = param_1[5];
      for (lVar7 = lVar4 + -0x150; lVar7 != lVar4; lVar7 = lVar7 + 0x150) {
        _eh_vector_destructor_iterator_((void *)(lVar7 + 0x70),0x28,5,FUN_140129b90);
      }
      param_1[5] = param_1[5] + -0x150;
    } while (lVar3 != param_1[5]);
  }
  FUN_14034edd0(plVar1);
  return;
}



void FUN_14025b870(longlong *param_1,longlong param_2,int param_3)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  bool bVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  undefined2 local_res8 [4];
  undefined8 uVar8;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 uStack_44;
  longlong *local_40;
  undefined1 local_38;
  
  uVar8 = 0xfffffffffffffffe;
  plVar1 = param_1 + 9;
  local_40 = plVar1;
  FUN_14034ed40(plVar1);
  local_38 = 1;
  lVar6 = *param_1;
  if (lVar6 != param_1[1]) {
    do {
      if (*(int *)(lVar6 + 0x14) == param_3) {
        local_50 = *(undefined4 *)(param_2 + 0x170);
        uStack_4c = *(undefined4 *)(param_2 + 0x174);
        local_48 = *(undefined4 *)(param_2 + 0x178);
        uStack_44 = *(undefined4 *)(param_2 + 0x17c);
        iVar2 = *(int *)(param_2 + 0x284);
        if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
          if ((*(longlong *)(param_2 + 0x170) == 0) && (*(longlong *)(param_2 + 0x178) == 0)) {
            bVar4 = false;
          }
          else {
            bVar4 = true;
          }
          if ((bVar4) && (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)
             ) {
            local_res8[0] = (undefined2)iVar2;
            plVar5 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar5 + 0x1c0))(plVar5,1,&DAT_1405d85a0,local_res8,&local_50,lVar6,uVar8)
            ;
          }
        }
        plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0x5d0))
                  (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,lVar6,(int *)(lVar6 + 0x14));
        FUN_14025c680(lVar6 + 0x150,param_1[1],lVar6);
        lVar3 = param_1[1];
        for (lVar7 = lVar3 + -0x150; lVar7 != lVar3; lVar7 = lVar7 + 0x150) {
          _eh_vector_destructor_iterator_((void *)(lVar7 + 0x70),0x28,5,FUN_140129b90);
        }
        param_1[1] = param_1[1] + -0x150;
      }
      else {
        lVar6 = lVar6 + 0x150;
      }
    } while (lVar6 != param_1[1]);
  }
  lVar6 = param_1[4];
  if (lVar6 != param_1[5]) {
    do {
      if (*(int *)(lVar6 + 0x14) == param_3) {
        local_50 = *(undefined4 *)(param_2 + 0x170);
        uStack_4c = *(undefined4 *)(param_2 + 0x174);
        local_48 = *(undefined4 *)(param_2 + 0x178);
        uStack_44 = *(undefined4 *)(param_2 + 0x17c);
        iVar2 = *(int *)(param_2 + 0x284);
        if ((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
          if ((*(longlong *)(param_2 + 0x170) == 0) && (*(longlong *)(param_2 + 0x178) == 0)) {
            bVar4 = false;
          }
          else {
            bVar4 = true;
          }
          if ((bVar4) && (lVar7 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar7 != 0)
             ) {
            local_res8[0] = (undefined2)iVar2;
            plVar5 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar7 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
            (**(code **)(*plVar5 + 0x1c0))(plVar5,1,&DAT_1405d85a0,local_res8,&local_50,lVar6);
          }
        }
        plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0x5d0))
                  (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,lVar6,(int *)(lVar6 + 0x14));
        FUN_14025c680(lVar6 + 0x150,param_1[5],lVar6);
        lVar3 = param_1[5];
        for (lVar7 = lVar3 + -0x150; lVar7 != lVar3; lVar7 = lVar7 + 0x150) {
          _eh_vector_destructor_iterator_((void *)(lVar7 + 0x70),0x28,5,FUN_140129b90);
        }
        param_1[5] = param_1[5] + -0x150;
      }
      else {
        lVar6 = lVar6 + 0x150;
      }
    } while (lVar6 != param_1[5]);
  }
  FUN_14034edd0(plVar1);
  return;
}



void FUN_14025bbf0(longlong *param_1,undefined8 param_2,int param_3)

{
  longlong lVar1;
  
  FUN_14034ed40(param_1 + 9);
  lVar1 = *param_1;
  if (lVar1 != param_1[1]) {
    do {
      if ((*(int *)(lVar1 + 0x14) == param_3) &&
         ((*(short *)(lVar1 + 0x1c) == 2 || (*(short *)(lVar1 + 0x1c) == 0xff)))) {
        *(undefined2 *)(lVar1 + 0x1c) = 0;
        *(undefined8 *)(lVar1 + 0x28) = 0;
        *(undefined8 *)(lVar1 + 0x30) = 0;
        *(undefined4 *)(lVar1 + 0x38) = 0;
        FUN_14025aff0(param_2,lVar1);
      }
      lVar1 = lVar1 + 0x150;
    } while (lVar1 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



void FUN_14025bcb0(longlong *param_1,undefined8 param_2,int param_3)

{
  int iVar1;
  longlong lVar2;
  
  FUN_14034ed40(param_1 + 9);
  lVar2 = *param_1;
  if (lVar2 != param_1[1]) {
    do {
      if ((((*(short *)(lVar2 + 0x1c) == 0) || (*(short *)(lVar2 + 0x1c) == 1)) &&
          (*(int *)(lVar2 + 0x14) == param_3)) &&
         (iVar1 = FUN_14025b260(*(int *)(lVar2 + 0x14),lVar2), iVar1 != 0)) {
        *(undefined2 *)(lVar2 + 0x1c) = 2;
        FUN_14025aff0(param_2,lVar2);
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



void FUN_14025bd60(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong *plVar5;
  undefined1 uVar6;
  
  uVar4 = 0xfffffffffffffffe;
  plVar1 = param_1 + 9;
  plVar5 = plVar1;
  FUN_14034ed40(plVar1);
  uVar6 = 1;
  lVar3 = *param_1;
  if (lVar3 != param_1[1]) {
    do {
      if (((*(short *)(lVar3 + 0x1c) == 0) || (*(short *)(lVar3 + 0x1c) == 1)) &&
         (iVar2 = FUN_14025b260(*(undefined4 *)(lVar3 + 0x14),lVar3,param_3,param_4,uVar4,plVar5,
                                uVar6), iVar2 != 0)) {
        *(undefined2 *)(lVar3 + 0x1c) = 2;
        FUN_14025aff0(param_2,lVar3);
      }
      lVar3 = lVar3 + 0x150;
    } while (lVar3 != param_1[1]);
  }
  FUN_14034edd0(plVar1);
  return;
}



void FUN_14025be10(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined1 uVar5;
  
  uVar3 = 0xfffffffffffffffe;
  plVar1 = param_1 + 9;
  plVar4 = plVar1;
  FUN_14034ed40(plVar1);
  uVar5 = 1;
  lVar2 = *param_1;
  if (lVar2 != param_1[1]) {
    do {
      if ((*(short *)(lVar2 + 0x1c) == 0) || (*(short *)(lVar2 + 0x1c) == 1)) {
        FUN_14012e5c0(param_2,lVar2 + 0x14,param_3,param_4,uVar3,plVar4,uVar5);
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
  }
  FUN_14034edd0(plVar1);
  return;
}



void FUN_14025bea0(longlong *param_1,undefined8 param_2,int param_3)

{
  int iVar1;
  longlong lVar2;
  
  FUN_14034ed40(param_1 + 9);
  lVar2 = *param_1;
  if (lVar2 != param_1[1]) {
    do {
      if ((*(int *)(lVar2 + 0x14) == param_3) &&
         (((*(short *)(lVar2 + 0x1c) == 0 || (*(short *)(lVar2 + 0x1c) == 1)) &&
          (iVar1 = FUN_14025b260(*(int *)(lVar2 + 0x14),lVar2), iVar1 != 0)))) {
        *(undefined2 *)(lVar2 + 0x1c) = 2;
        FUN_14025aff0(param_2,lVar2);
      }
      lVar2 = lVar2 + 0x150;
    } while (lVar2 != param_1[1]);
  }
  FUN_14034edd0(param_1 + 9);
  return;
}



void FUN_14025bf50(longlong *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  puVar1 = (undefined4 *)param_1[1];
  if ((param_2 < puVar1) && ((undefined4 *)*param_1 <= param_2)) {
    lVar3 = ((longlong)param_2 - *param_1) / 0x14;
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_14025c1a0(param_1);
    }
    puVar1 = (undefined4 *)param_1[1];
    lVar2 = *param_1;
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *(undefined4 *)(lVar2 + lVar3 * 0x14);
      puVar1[1] = *(undefined4 *)(lVar2 + 4 + lVar3 * 0x14);
      puVar1[2] = *(undefined4 *)(lVar2 + 8 + lVar3 * 0x14);
      puVar1[3] = *(undefined4 *)(lVar2 + 0xc + lVar3 * 0x14);
      puVar1[4] = *(undefined4 *)(lVar2 + 0x10 + lVar3 * 0x14);
      param_1[1] = param_1[1] + 0x14;
      return;
    }
  }
  else {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_14025c1a0(param_1);
    }
    puVar1 = (undefined4 *)param_1[1];
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *param_2;
      puVar1[1] = param_2[1];
      puVar1[2] = param_2[2];
      puVar1[3] = param_2[3];
      puVar1[4] = param_2[4];
    }
  }
  param_1[1] = param_1[1] + 0x14;
  return;
}



void thunk_FUN_14025c370(void)

{
  FUN_14025c370();
  return;
}



void FUN_14025c040(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (*param_1 <= param_2)) {
    lVar2 = param_2 - *param_1;
    lVar2 = lVar2 + SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar2),8);
    if (uVar1 == param_1[2]) {
      FUN_14025c2c0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_14025c7e0(param_1[1],((lVar2 >> 8) - (lVar2 >> 0x3f)) * 0x150 + *param_1,param_3,param_4,
                    uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14025c2c0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_14025c7e0(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x150;
  return;
}



longlong * FUN_14025c110(longlong param_1,longlong *param_2,longlong param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  FUN_14025c680(param_3 + 0x150,*(undefined8 *)(param_1 + 8));
  lVar1 = *(longlong *)(param_1 + 8);
  for (lVar2 = lVar1 + -0x150; lVar2 != lVar1; lVar2 = lVar2 + 0x150) {
    _eh_vector_destructor_iterator_((void *)(lVar2 + 0x70),0x28,5,FUN_140129b90);
  }
  *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -0x150;
  *param_2 = param_3;
  return param_2;
}



void FUN_14025c1a0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x14;
  if (0xccccccccccccccb < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x14;
  if (uVar2 < uVar3) {
    if (0xccccccccccccccc - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14025c3f0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14025c3f0(param_1,uVar2);
  }
  return;
}



void FUN_14025c260(longlong param_1,longlong param_2)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x150) {
    _eh_vector_destructor_iterator_((void *)(param_1 + 0x70),0x28,5,FUN_140129b90);
  }
  return;
}



void FUN_14025c2c0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  longlong lVar3;
  ulonglong uVar4;
  
  lVar3 = param_1[1] - *param_1;
  lVar3 = lVar3 + SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar3),8);
  uVar4 = (lVar3 >> 8) - (lVar3 >> 0x3f);
  if (0xc30c30c30c30c2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  lVar3 = param_1[2] - *param_1;
  lVar3 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar3),8) + lVar3;
  uVar2 = (lVar3 >> 8) - (lVar3 >> 0x3f);
  if (uVar2 < uVar4) {
    if (0xc30c30c30c30c3 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar4) {
      uVar2 = uVar4;
    }
    FUN_14025c530(param_1,uVar2);
  }
  return;
}



void FUN_14025c370(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0x150) {
      _eh_vector_destructor_iterator_((void *)(lVar2 + 0x70),0x28,5,FUN_140129b90);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_14025c3f0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14025c900(*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_14025c530(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 (0xc30c30c30c30c3 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  lVar5 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar5 >> 8) - (lVar5 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x150);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14025c950(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    lVar6 = lVar1 - lVar2;
    lVar5 = lVar6 + SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar6),8);
    if (lVar2 != 0) {
      FUN_14025c260(lVar2,lVar1,lVar6,lVar1,uVar7);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x150);
    param_1[1] = (longlong)(pcVar4 + ((lVar5 >> 8) - (lVar5 >> 0x3f)) * 0x150);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



undefined4 * FUN_14025c680(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  longlong lVar4;
  
  if (param_1 != param_2) {
    puVar2 = param_3;
    puVar3 = param_1 + 5;
    do {
      puVar1 = puVar2 + 0x1c;
      *puVar2 = puVar3[-5];
      lVar4 = 5;
      puVar2[1] = puVar3[-4];
      puVar2[2] = puVar3[-3];
      puVar2[3] = puVar3[-2];
      puVar2[4] = puVar3[-1];
      puVar2[5] = *puVar3;
      puVar2[6] = puVar3[1];
      *(undefined2 *)(puVar2 + 7) = *(undefined2 *)(puVar3 + 2);
      puVar2[8] = puVar3[3];
      puVar2[9] = puVar3[4];
      puVar2[10] = puVar3[5];
      puVar2[0xb] = puVar3[6];
      puVar2[0xc] = puVar3[7];
      puVar2[0xd] = puVar3[8];
      puVar2[0xe] = puVar3[9];
      puVar2[0xf] = puVar3[10];
      puVar2[0x10] = puVar3[0xb];
      puVar2[0x11] = puVar3[0xc];
      puVar2[0x12] = puVar3[0xd];
      puVar2[0x13] = puVar3[0xe];
      puVar2[0x14] = puVar3[0xf];
      puVar2[0x15] = puVar3[0x10];
      puVar2[0x16] = puVar3[0x11];
      puVar2[0x17] = puVar3[0x12];
      puVar2[0x18] = puVar3[0x13];
      puVar2[0x19] = puVar3[0x14];
      puVar2[0x1a] = puVar3[0x15];
      *(undefined1 *)(puVar2 + 0x1b) = *(undefined1 *)(puVar3 + 0x16);
      do {
        FUN_140003d90(puVar1,(longlong)puVar1 + (longlong)puVar3 + (-0x14 - (longlong)puVar2),0,
                      0xffffffffffffffff);
        puVar1 = puVar1 + 10;
        lVar4 = lVar4 + -1;
      } while (lVar4 != 0);
      param_3 = puVar2 + 0x54;
      puVar2[0x4e] = puVar3[0x49];
      *(undefined8 *)(puVar2 + 0x50) = *(undefined8 *)(puVar3 + 0x4b);
      puVar2[0x52] = puVar3[0x4d];
      puVar1 = puVar3 + 0x4f;
      puVar2 = param_3;
      puVar3 = puVar3 + 0x54;
    } while (puVar1 != param_2);
  }
  return param_3;
}



undefined4 * FUN_14025c7e0(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  *(undefined2 *)(param_1 + 7) = *(undefined2 *)(param_2 + 7);
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  *(undefined1 *)(param_1 + 0x1b) = *(undefined1 *)(param_2 + 0x1b);
  _eh_vector_copy_constructor_iterator_
            (param_1 + 0x1c,param_2 + 0x1c,0x28,5,FUN_140004650,FUN_140129b90);
  param_1[0x4e] = param_2[0x4e];
  *(undefined8 *)(param_1 + 0x50) = *(undefined8 *)(param_2 + 0x50);
  param_1[0x52] = param_2[0x52];
  return param_1;
}



undefined4 * FUN_14025c900(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 5) {
    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];
    }
    param_3 = param_3 + 5;
  }
  return param_3;
}



longlong FUN_14025c950(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x150) {
    if (param_3 != 0) {
      FUN_14025c7e0(param_3,param_1);
    }
    param_3 = param_3 + 0x150;
  }
  return param_3;
}



undefined4 * FUN_14025c9b0(undefined4 *param_1)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  *param_1 = 0;
  lVar2 = 5;
  param_1[1] = 0;
  param_1[2] = 0;
  *(undefined8 *)(param_1 + 4) = 0;
  param_1[3] = 0;
  param_1[6] = 0;
  *(undefined2 *)(param_1 + 7) = 0;
  *(undefined8 *)(param_1 + 8) = 0;
  param_1[0xf] = 0;
  param_1[0x1a] = 0;
  *(undefined1 *)(param_1 + 0x1b) = 0;
  _eh_vector_constructor_iterator_
            (param_1 + 0x1c,0x28,5,(_func_void_void_ptr *)&LAB_140003b90,FUN_140129b90);
  param_1[0x4e] = 1;
  *(undefined8 *)(param_1 + 0x50) = 0;
  param_1[0x52] = 0;
  puVar1 = param_1 + 0x10;
  do {
    puVar1[-6] = 0;
    *puVar1 = 0;
    puVar1[5] = 0;
    puVar1 = puVar1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  return param_1;
}



void thunk_FUN_14025e600(void)

{
  FUN_14025e600();
  return;
}



void thunk_FUN_14025e6b0(void)

{
  FUN_14025e6b0();
  return;
}



undefined8 FUN_14025caa0(longlong *param_1,int param_2,int param_3)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  
  FUN_14034ed40(param_1 + 0x12);
  if (param_1[1] != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar6 = ((longlong *)*param_1)[uVar2];
          goto LAB_14025cb0a;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar5 = plVar5 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar6 = 0;
LAB_14025cb0a:
  do {
    lVar3 = lVar6;
    if (lVar3 == 0) {
      FUN_14034edd0(param_1 + 0x12);
      return 0;
    }
    lVar6 = *(longlong *)(lVar3 + 0x38);
    if (lVar6 == 0) {
      uVar1 = *(uint *)(lVar3 + 0x40) % *(uint *)(param_1 + 2) + 1;
      lVar4 = (longlong)(int)uVar1 << 3;
      do {
        if (*(uint *)(param_1 + 2) <= uVar1) break;
        if (*(longlong *)(lVar4 + *param_1) != 0) {
          lVar6 = *(longlong *)(lVar4 + *param_1);
        }
        uVar1 = uVar1 + 1;
        lVar4 = lVar4 + 8;
      } while (lVar6 == 0);
    }
    if ((*(int *)(lVar3 + 0x20) == param_2) && (*(int *)(lVar3 + 0x24) == param_3)) {
      FUN_14034edd0(param_1 + 0x12);
      return 1;
    }
  } while( true );
}



void FUN_14025cba0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  short sVar2;
  longlong lVar3;
  longlong lVar4;
  uint uVar5;
  longlong lVar6;
  uint uVar7;
  undefined8 uVar8;
  undefined8 local_70;
  undefined8 local_68;
  longlong local_60;
  undefined1 local_58;
  undefined8 local_50;
  undefined8 local_48;
  undefined4 local_40;
  int local_3c;
  uint local_38;
  uint local_34;
  undefined1 local_30;
  
  uVar8 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x90;
  local_60 = lVar1;
  FUN_14034ed40(lVar1);
  local_58 = 1;
  uVar5 = 0;
  lVar3 = *param_2;
  if ((param_2[1] - lVar3) / 0x1b != 0) {
    lVar6 = 0;
    do {
      if (*(char *)(lVar6 + 0x1a + lVar3) != '\0') {
        local_30 = 1;
        local_50 = *(undefined8 *)(lVar6 + lVar3);
        local_48 = *(undefined8 *)(lVar6 + 8 + lVar3);
        uVar7 = (uint)*(short *)(lVar6 + 0x10 + lVar3);
        sVar2 = *(short *)(lVar6 + 0x12 + lVar3);
        lVar4 = (longlong)sVar2;
        local_40 = *(undefined4 *)(lVar6 + 0x14 + lVar3);
        local_3c = (int)*(short *)(lVar6 + 0x18 + lVar3);
        local_70 = *(undefined8 *)(lVar6 + lVar3);
        local_68 = *(undefined8 *)(lVar6 + 8 + lVar3);
        local_38 = uVar7;
        local_34 = (int)sVar2;
        FUN_14025e2b0(param_1,&local_70,&local_50,lVar3,uVar8);
        if ((uVar7 < 3) && ((uint)(int)sVar2 < 0x1e)) {
          lVar3 = FUN_14025e620(param_1 + 0x48,uVar7);
          *(undefined4 *)(lVar3 + lVar4 * 0x10) = (undefined4)local_50;
          *(undefined4 *)(lVar3 + 4 + lVar4 * 0x10) = local_50._4_4_;
          *(undefined4 *)(lVar3 + 8 + lVar4 * 0x10) = (undefined4)local_48;
          *(undefined4 *)(lVar3 + 0xc + lVar4 * 0x10) = local_48._4_4_;
        }
      }
      uVar5 = uVar5 + 1;
      lVar6 = lVar6 + 0x1b;
      lVar3 = *param_2;
    } while ((ulonglong)uVar5 < (ulonglong)((param_2[1] - lVar3) / 0x1b));
  }
  FUN_14034edd0(lVar1);
  return;
}



void FUN_14025cd10(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  int iVar2;
  DWORD DVar3;
  HANDLE hObject;
  HANDLE pvVar4;
  ulonglong *puVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  ulonglong *puVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  uint uVar11;
  ulonglong uVar12;
  uint uVar13;
  bool bVar14;
  undefined4 local_res18;
  longlong local_res20;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined1 local_50 [24];
  
  FUN_14034ed40(param_1 + 0x12);
  uVar13 = 0;
  local_res20 = 0;
  do {
    uVar10 = 0;
    uVar12 = uVar10;
    do {
      uVar9 = 0;
      puVar5 = (ulonglong *)*param_2;
      uVar7 = uVar9;
      if (puVar5 != (ulonglong *)0x0) {
        if (puVar5 == (ulonglong *)param_2[1]) {
          uVar7 = *puVar5;
        }
        else {
          iVar2 = DAT_1406080cc + 1;
          bVar14 = DAT_1406080cc == 0;
          DAT_1406080cc = iVar2;
          if ((bVar14) &&
             (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), hObject != (HANDLE)0x0)) {
            DVar3 = GetCurrentProcessId();
            pvVar4 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar4,DVar3,hObject,2,0,0,0);
            CloseHandle(hObject);
          }
        }
      }
      puVar5 = (ulonglong *)FUN_1402612e0(uVar7,local_50,uVar13);
      if ((*puVar5 == 0) && (puVar5[1] == 0)) {
        bVar14 = false;
      }
      else {
        bVar14 = true;
      }
      if (bVar14) {
        uVar7 = puVar5[1];
        uVar11 = (uint)*puVar5 ^ *(uint *)((longlong)puVar5 + 4) ^ (uint)puVar5[1] ^
                 *(uint *)((longlong)puVar5 + 0xc);
        if (*param_1 != 0) {
          for (puVar8 = *(ulonglong **)
                         (*param_1 + ((ulonglong)uVar11 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
              puVar8 != (ulonglong *)0x0; puVar8 = (ulonglong *)puVar8[7]) {
            if ((uint)puVar8[8] == uVar11) {
              bVar14 = *puVar8 < *puVar5;
              if ((*puVar8 != *puVar5) ||
                 (bVar14 = puVar8[1] < uVar7, uVar6 = uVar9, puVar8[1] != uVar7)) {
                uVar6 = (ulonglong)((1 - (uint)bVar14) - (uint)(bVar14 != 0));
              }
              if ((int)uVar6 == 0) {
                if (puVar8 != (ulonglong *)0x0) {
                  FUN_14025d170(param_1,puVar8 + 2);
                  puVar5 = (ulonglong *)*param_2;
                  if (puVar5 != (ulonglong *)0x0) {
                    if (puVar5 == (ulonglong *)param_2[1]) {
                      uVar9 = *puVar5;
                    }
                    else {
                      iVar2 = DAT_1406080cc + 1;
                      bVar14 = DAT_1406080cc == 0;
                      DAT_1406080cc = iVar2;
                      if (bVar14) {
                        FUN_140176d60(1);
                      }
                    }
                  }
                  uVar7 = puVar8[4];
                  FUN_14034ed40(uVar9 + 0x4b18);
                  if ((uVar13 < 3) && ((uint)uVar10 < 0x20)) {
                    lVar1 = local_res20 + uVar12;
                    *(undefined4 *)(uVar9 + 0x188 + lVar1 * 0x18) = local_80;
                    *(undefined4 *)(uVar9 + 0x18c + lVar1 * 0x18) = local_7c;
                    *(undefined4 *)(uVar9 + 400 + lVar1 * 0x18) = local_78;
                    *(undefined4 *)(uVar9 + 0x194 + lVar1 * 0x18) = local_74;
                    *(int *)(uVar9 + (local_res20 + 0x11 + uVar12) * 0x18) = (int)uVar7;
                    *(undefined4 *)(uVar9 + 0x19c + lVar1 * 0x18) = local_res18;
                    FUN_14025f030(uVar9,uVar13);
                  }
                  FUN_14034edd0(uVar9 + 0x4b18);
                }
                break;
              }
            }
          }
        }
      }
      uVar11 = (uint)uVar10 + 1;
      uVar10 = (ulonglong)uVar11;
      uVar12 = uVar12 + 1;
    } while ((int)uVar11 < 0x20);
    uVar13 = uVar13 + 1;
    local_res20 = local_res20 + 0x20;
    if (2 < (int)uVar13) {
      FUN_14034edd0(param_1 + 0x12);
      return;
    }
  } while( true );
}



void FUN_14025d030(longlong *param_1,int param_2,int param_3,undefined4 *param_4)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  
  FUN_14034ed40(param_1 + 0x12);
  if (param_1[1] != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar6 = ((longlong *)*param_1)[uVar2];
          goto LAB_14025d09b;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar5 = plVar5 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar6 = 0;
LAB_14025d09b:
  do {
    lVar3 = lVar6;
    if (lVar3 == 0) goto LAB_14025d145;
    lVar6 = *(longlong *)(lVar3 + 0x38);
    if (lVar6 == 0) {
      uVar1 = *(uint *)(lVar3 + 0x40) % *(uint *)(param_1 + 2) + 1;
      lVar4 = (longlong)(int)uVar1 << 3;
      do {
        if (*(uint *)(param_1 + 2) <= uVar1) break;
        if (*(longlong *)(lVar4 + *param_1) != 0) {
          lVar6 = *(longlong *)(lVar4 + *param_1);
        }
        uVar1 = uVar1 + 1;
        lVar4 = lVar4 + 8;
      } while (lVar6 == 0);
    }
  } while ((*(int *)(lVar3 + 0x20) != param_2) || (*(int *)(lVar3 + 0x24) != param_3));
  *param_4 = *(undefined4 *)(lVar3 + 0x10);
  param_4[1] = *(undefined4 *)(lVar3 + 0x14);
  param_4[2] = *(undefined4 *)(lVar3 + 0x18);
  param_4[3] = *(undefined4 *)(lVar3 + 0x1c);
  local_30 = *(undefined4 *)(lVar3 + 0x10);
  local_2c = *(undefined4 *)(lVar3 + 0x14);
  local_28 = *(undefined4 *)(lVar3 + 0x18);
  local_24 = *(undefined4 *)(lVar3 + 0x1c);
  FUN_14025e400(param_1,&local_30);
LAB_14025d145:
  FUN_14034edd0(param_1 + 0x12);
  return;
}



void FUN_14025d170(longlong *param_1,undefined4 *param_2,undefined4 *param_3,int *param_4)

{
  longlong lVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  
  *param_3 = *param_2;
  param_3[1] = param_2[1];
  param_3[2] = param_2[2];
  param_3[3] = param_2[3];
  *param_4 = param_2[5];
  FUN_14034ed40(param_1 + 0x12);
  if (param_1[1] != 0) {
    uVar3 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar6 = ((longlong *)*param_1)[uVar3];
          goto joined_r0x00014025d1ee;
        }
        uVar2 = (int)uVar3 + 1;
        uVar3 = (ulonglong)uVar2;
        plVar5 = plVar5 + 1;
      } while (uVar2 < *(uint *)(param_1 + 2));
    }
  }
  lVar6 = 0;
joined_r0x00014025d1ee:
  do {
    lVar1 = lVar6;
    if (lVar1 == 0) {
      FUN_14034edd0(param_1 + 0x12);
      return;
    }
    if (lVar1 == 0) {
      lVar6 = 0;
    }
    else {
      lVar6 = *(longlong *)(lVar1 + 0x38);
      if (lVar6 == 0) {
        uVar2 = *(uint *)(lVar1 + 0x40) % *(uint *)(param_1 + 2) + 1;
        lVar4 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(param_1 + 2) <= uVar2) break;
          if (*(longlong *)(lVar4 + *param_1) != 0) {
            lVar6 = *(longlong *)(lVar4 + *param_1);
          }
          uVar2 = uVar2 + 1;
          lVar4 = lVar4 + 8;
        } while (lVar6 == 0);
      }
    }
    if ((*(int *)(lVar1 + 0x20) == param_2[4]) && (*param_4 < *(int *)(lVar1 + 0x24))) {
      *param_4 = *(int *)(lVar1 + 0x24);
      *param_3 = *(undefined4 *)(lVar1 + 0x10);
      param_3[1] = *(undefined4 *)(lVar1 + 0x14);
      param_3[2] = *(undefined4 *)(lVar1 + 0x18);
      param_3[3] = *(undefined4 *)(lVar1 + 0x1c);
    }
  } while( true );
}



void FUN_14025d2b0(longlong param_1)

{
  FUN_14034ed40(param_1 + 0x90);
  FUN_14025e4c0(param_1);
  FUN_14025d310(param_1);
  FUN_14034edd0(param_1 + 0x90);
  return;
}



void FUN_14025d310(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined1 uVar6;
  
  uVar4 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x90;
  lVar5 = lVar1;
  FUN_14034ed40(lVar1);
  uVar6 = 1;
  lVar3 = 0;
  do {
    lVar2 = FUN_14025e620(param_1 + 0x48,0,param_3,param_4,uVar4,lVar5,uVar6);
    *(undefined4 *)(lVar3 + lVar2) = 0;
    *(undefined4 *)(lVar3 + 4 + lVar2) = 0;
    *(undefined4 *)(lVar3 + 8 + lVar2) = 0;
    *(undefined4 *)(lVar3 + 0xc + lVar2) = 0;
    lVar3 = lVar3 + 0x10;
  } while (lVar3 < 0x1e0);
  FUN_14034edd0(lVar1);
  return;
}



undefined4 *
FUN_14025d3b0(longlong param_1,undefined4 *param_2,longlong param_3,longlong param_4,
             undefined8 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,int param_9
             )

{
  longlong lVar1;
  int iVar2;
  bool bVar3;
  longlong lVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong *plVar8;
  undefined4 local_res8 [2];
  longlong local_res20;
  undefined4 local_90;
  undefined4 uStack_8c;
  undefined4 local_88;
  undefined4 uStack_84;
  undefined8 local_80;
  undefined8 local_78;
  longlong local_70;
  undefined1 local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined4 local_50;
  int local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined1 local_40;
  
  local_res20 = param_4;
  FUN_140357570(&local_80);
  iVar7 = param_9;
  uVar6 = param_8;
  local_90 = 0;
  uStack_8c = 0;
  local_88 = 0;
  uStack_84 = 0;
  if (1 < param_9) {
    FUN_14025d030(param_1,param_8,param_9 + -1,&local_90);
  }
  uVar5 = param_6;
  local_44 = 0xffffffff;
  local_40 = 1;
  local_60 = local_80;
  local_58 = local_78;
  local_50 = uVar6;
  local_4c = iVar7;
  local_48 = param_6;
  if (CONCAT44(uStack_8c,local_90) == 0) {
    if (CONCAT44(uStack_84,local_88) == 0) {
      bVar3 = false;
      goto LAB_14025d481;
    }
  }
  bVar3 = true;
LAB_14025d481:
  if (bVar3) {
    local_60 = CONCAT44(uStack_8c,local_90);
    local_58 = CONCAT44(uStack_84,local_88);
  }
  lVar1 = param_1 + 0x90;
  local_70 = lVar1;
  FUN_14034ed40(lVar1);
  local_68 = 1;
  local_90 = (undefined4)local_60;
  uStack_8c = local_60._4_4_;
  local_88 = (undefined4)local_58;
  uStack_84 = local_58._4_4_;
  FUN_14025e2b0(param_1,&local_90,&local_60);
  lVar4 = local_res20;
  iVar2 = *(int *)(local_res20 + 0x284);
  param_6 = uVar6;
  local_res20 = CONCAT44(local_res20._4_4_,uVar5);
  local_res8[0] = *(undefined4 *)(lVar4 + 8);
  param_9 = iVar7;
  if (((-1 < iVar2) && (iVar2 < *(short *)(param_3 + 700))) && (*(longlong *)(param_3 + 0x4c0) != 0)
     ) {
    param_8 = CONCAT22(param_8._2_2_,(short)iVar2);
    plVar8 = (longlong *)
             (*(longlong *)
               (*(longlong *)(*(longlong *)(param_3 + 0x4c0) + 8) +
               (longlong)*(int *)(lVar4 + 0x288) * 8) + 0x70);
    (**(code **)(*plVar8 + 0xc0))
              (plVar8,1,&DAT_1405d85a0,&param_8,local_res8,param_5,&local_res20,&param_7,&local_80,
               &param_6,&param_9);
  }
  *param_2 = (undefined4)local_60;
  param_2[1] = local_60._4_4_;
  param_2[2] = (undefined4)local_58;
  param_2[3] = local_58._4_4_;
  FUN_14034edd0(lVar1);
  return param_2;
}



undefined8 FUN_14025d5e0(longlong *param_1,undefined4 param_2,uint param_3,ulonglong *param_4)

{
  ulonglong uVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  ulonglong *puVar5;
  longlong lVar6;
  uint uVar7;
  bool bVar8;
  
  lVar6 = (longlong)(int)param_3;
  if (param_3 < 0x1e) {
    FUN_14034ed40(param_1 + 0x12);
    lVar3 = FUN_14025e620(param_1 + 9,param_2);
    *(uint *)(lVar3 + lVar6 * 0x10) = (uint)*param_4;
    *(uint *)(lVar3 + 4 + lVar6 * 0x10) = *(uint *)((longlong)param_4 + 4);
    *(uint *)(lVar3 + 8 + lVar6 * 0x10) = (uint)param_4[1];
    *(uint *)(lVar3 + 0xc + lVar6 * 0x10) = *(uint *)((longlong)param_4 + 0xc);
    uVar1 = param_4[1];
    uVar7 = (uint)*param_4 ^ (uint)param_4[1] ^ *(uint *)((longlong)param_4 + 0xc) ^
            *(uint *)((longlong)param_4 + 4);
    if (*param_1 != 0) {
      for (puVar5 = *(ulonglong **)
                     (*param_1 + ((ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
          puVar5 != (ulonglong *)0x0; puVar5 = (ulonglong *)puVar5[7]) {
        if ((uint)puVar5[8] == uVar7) {
          bVar8 = *puVar5 < *param_4;
          if ((*puVar5 == *param_4) && (bVar8 = puVar5[1] < uVar1, puVar5[1] == uVar1)) {
            iVar2 = 0;
          }
          else {
            iVar2 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
          }
          if (iVar2 == 0) {
            if (puVar5 != (ulonglong *)0x0) {
              *(undefined4 *)(puVar5 + 5) = param_2;
              *(uint *)((longlong)puVar5 + 0x2c) = param_3;
            }
            break;
          }
        }
      }
    }
    FUN_14034edd0(param_1 + 0x12);
    uVar4 = 1;
  }
  else {
    uVar4 = 0;
  }
  return uVar4;
}



void FUN_14025d710(longlong *param_1,longlong param_2)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  code *pcVar6;
  bool bVar7;
  uint uVar8;
  int iVar9;
  undefined8 *puVar11;
  undefined8 *puVar12;
  longlong *plVar13;
  longlong lVar14;
  longlong lVar15;
  undefined4 *puVar16;
  undefined4 *puVar17;
  undefined4 *puVar18;
  undefined8 *puVar19;
  undefined8 *puVar20;
  undefined8 *puVar21;
  undefined4 *puVar22;
  ulonglong uVar23;
  undefined8 *puVar24;
  undefined8 *local_res20;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined8 local_a8;
  undefined4 local_98;
  undefined4 uStack_94;
  undefined4 local_90;
  undefined4 uStack_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined8 *local_80;
  undefined8 *local_78;
  undefined8 *local_70;
  longlong *local_60;
  undefined1 local_58;
  undefined8 local_50;
  undefined4 *puVar10;
  
  local_50 = 0xfffffffffffffffe;
  local_60 = param_1 + 0x12;
  FUN_14034ed40(local_60);
  local_58 = 1;
  puVar18 = (undefined4 *)0x0;
  local_b8 = (undefined4 *)0x0;
  local_b0 = (undefined4 *)0x0;
  local_a8 = (undefined4 *)0x0;
  local_98 = 0;
  uStack_94 = 0;
  local_90 = 0;
  uStack_8c = 0;
  local_88 = 0;
  local_84 = (uint)local_84._2_2_ << 0x10;
  puVar16 = puVar18;
  if ((param_1[1] != 0) && (*(uint *)(param_1 + 2) != 0)) {
    puVar10 = puVar18;
    plVar13 = (longlong *)*param_1;
    do {
      if (*plVar13 != 0) {
        puVar16 = (undefined4 *)((longlong *)*param_1)[(longlong)puVar10];
        break;
      }
      uVar8 = (int)puVar10 + 1;
      puVar10 = (undefined4 *)(ulonglong)uVar8;
      plVar13 = plVar13 + 1;
    } while (uVar8 < *(uint *)(param_1 + 2));
  }
  puVar10 = puVar18;
  if (puVar16 != (undefined4 *)0x0) {
    do {
      puVar22 = (undefined4 *)0x0;
      puVar17 = puVar22;
      if ((puVar16 != (undefined4 *)0x0) &&
         (puVar17 = *(undefined4 **)(puVar16 + 0xe),
         *(undefined4 **)(puVar16 + 0xe) == (undefined4 *)0x0)) {
        uVar8 = (uint)puVar16[0x10] % *(uint *)(param_1 + 2) + 1;
        lVar14 = (longlong)(int)uVar8 << 3;
        do {
          puVar17 = puVar22;
          if (*(uint *)(param_1 + 2) <= uVar8) break;
          if (*(longlong *)(lVar14 + *param_1) != 0) {
            puVar22 = *(undefined4 **)(lVar14 + *param_1);
          }
          uVar8 = uVar8 + 1;
          lVar14 = lVar14 + 8;
          puVar17 = puVar22;
        } while (puVar22 == (undefined4 *)0x0);
      }
      uVar1 = puVar16[4];
      uVar2 = puVar16[5];
      uVar3 = puVar16[6];
      uVar4 = puVar16[7];
      local_88 = puVar16[8];
      local_84 = CONCAT22(local_84._2_2_,*(undefined2 *)(puVar16 + 9));
      local_98 = uVar1;
      uStack_94 = uVar2;
      local_90 = uVar3;
      uStack_8c = uVar4;
      if ((&local_98 < local_b0) && (puVar10 <= &local_98)) {
        lVar14 = ((longlong)&local_98 - (longlong)puVar10) / 6 +
                 ((longlong)&local_98 - (longlong)puVar10 >> 0x3f);
        lVar14 = (lVar14 >> 2) - (lVar14 >> 0x3f);
        if (local_b0 == puVar18) {
          lVar15 = ((longlong)local_b0 - (longlong)puVar10) / 6 +
                   ((longlong)local_b0 - (longlong)puVar10 >> 0x3f);
          uVar23 = (lVar15 >> 2) - (lVar15 >> 0x3f);
          if (0xaaaaaaaaaaaaaa9 < uVar23) {
            std::_Xlength_error("vector<T> too long");
            pcVar6 = (code *)swi(3);
            (*pcVar6)();
            return;
          }
          if ((ulonglong)(((longlong)puVar18 - (longlong)puVar10) / 0x18) < uVar23 + 1) {
            FUN_14008e930(&local_b8);
            puVar18 = local_a8;
            puVar10 = local_b8;
          }
        }
        if (local_b0 != (undefined4 *)0x0) {
          *local_b0 = puVar10[lVar14 * 6];
          local_b0[1] = puVar10[lVar14 * 6 + 1];
          local_b0[2] = puVar10[lVar14 * 6 + 2];
          local_b0[3] = puVar10[lVar14 * 6 + 3];
          local_b0[4] = puVar10[lVar14 * 6 + 4];
          iVar9 = puVar10[lVar14 * 6 + 5];
LAB_14025da38:
          local_b0[5] = iVar9;
          puVar18 = local_a8;
          puVar10 = local_b8;
        }
      }
      else {
        if (local_b0 == puVar18) {
          lVar14 = ((longlong)local_b0 - (longlong)puVar10) / 6 +
                   ((longlong)local_b0 - (longlong)puVar10 >> 0x3f);
          uVar23 = (lVar14 >> 2) - (lVar14 >> 0x3f);
          if (0xaaaaaaaaaaaaaa9 < uVar23) {
            std::_Xlength_error("vector<T> too long");
            pcVar6 = (code *)swi(3);
            (*pcVar6)();
            return;
          }
          if ((ulonglong)(((longlong)puVar18 - (longlong)puVar10) / 0x18) < uVar23 + 1) {
            FUN_14008e930(&local_b8);
            puVar18 = local_a8;
            puVar10 = local_b8;
          }
        }
        if (local_b0 != (undefined4 *)0x0) {
          *local_b0 = uVar1;
          local_b0[1] = uVar2;
          local_b0[2] = uVar3;
          local_b0[3] = uVar4;
          local_b0[4] = local_88;
          iVar9 = local_84;
          goto LAB_14025da38;
        }
      }
      local_b0 = local_b0 + 6;
      puVar16 = puVar17;
    } while (puVar17 != (undefined4 *)0x0);
    puVar18 = puVar10;
    if (puVar10 != local_b0) {
      plVar13 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar13 + 0x700))(plVar13,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_b8)
      ;
      puVar18 = local_b8;
    }
  }
  puVar20 = (undefined8 *)0x0;
  if (puVar18 != (undefined4 *)0x0) {
    operator_delete(puVar18);
  }
  local_80 = (undefined8 *)0x0;
  local_78 = (undefined8 *)0x0;
  local_70 = (undefined8 *)0x0;
  local_b8 = (undefined4 *)((ulonglong)local_b8 & 0xffff000000000000);
  local_b0 = (undefined4 *)0x0;
  local_a8 = (undefined4 *)0x0;
  puVar12 = puVar20;
  if ((param_1[10] != 0) && (*(uint *)(param_1 + 0xb) != 0)) {
    puVar11 = puVar20;
    plVar13 = (longlong *)param_1[9];
    do {
      if (*plVar13 != 0) {
        puVar12 = (undefined8 *)((longlong *)param_1[9])[(longlong)puVar11];
        break;
      }
      uVar8 = (int)puVar11 + 1;
      puVar11 = (undefined8 *)(ulonglong)uVar8;
      plVar13 = plVar13 + 1;
    } while (uVar8 < *(uint *)(param_1 + 0xb));
  }
  puVar11 = puVar20;
  puVar24 = puVar20;
  if (puVar12 != (undefined8 *)0x0) {
    do {
      puVar19 = (undefined8 *)0x0;
      if (puVar12 == (undefined8 *)0x0) {
        local_res20 = (undefined8 *)0x0;
      }
      else {
        local_res20 = (undefined8 *)puVar12[0x3d];
        if (local_res20 == (undefined8 *)0x0) {
          uVar8 = *(uint *)(puVar12 + 0x3e) % *(uint *)(param_1 + 0xb) + 1;
          lVar14 = (longlong)(int)uVar8 << 3;
          local_res20 = puVar19;
          do {
            if (*(uint *)(param_1 + 0xb) <= uVar8) break;
            if (*(longlong *)(lVar14 + param_1[9]) != 0) {
              local_res20 = *(undefined8 **)(lVar14 + param_1[9]);
            }
            uVar8 = uVar8 + 1;
            lVar14 = lVar14 + 8;
          } while (local_res20 == (undefined8 *)0x0);
        }
      }
      do {
        lVar14 = (longlong)(int)puVar19;
        local_98 = *(undefined4 *)((longlong)puVar12 + lVar14 * 0x10 + 4);
        uStack_94 = *(undefined4 *)(puVar12 + lVar14 * 2 + 1);
        local_90 = *(undefined4 *)((longlong)puVar12 + lVar14 * 0x10 + 0xc);
        uStack_8c = *(undefined4 *)(puVar12 + lVar14 * 2 + 2);
        if ((CONCAT44(uStack_94,local_98) == 0) && (CONCAT44(uStack_8c,local_90) == 0)) {
          bVar7 = false;
        }
        else {
          bVar7 = true;
        }
        if (bVar7) {
          uVar1 = *(undefined4 *)puVar12;
          local_b8._0_6_ = CONCAT24((short)puVar19,uVar1);
          uVar2 = *(undefined4 *)((longlong)puVar12 + lVar14 * 0x10 + 4);
          uVar3 = *(undefined4 *)(puVar12 + lVar14 * 2 + 1);
          local_b0 = (undefined4 *)CONCAT44(uVar3,uVar2);
          uVar4 = *(undefined4 *)((longlong)puVar12 + lVar14 * 0x10 + 0xc);
          uVar5 = *(undefined4 *)(puVar12 + lVar14 * 2 + 2);
          local_a8 = (undefined4 *)CONCAT44(uVar5,uVar4);
          if ((&local_b8 < puVar11) && (puVar24 <= &local_b8)) {
            lVar14 = ((longlong)&local_b8 - (longlong)puVar24) / 6 +
                     ((longlong)&local_b8 - (longlong)puVar24 >> 0x3f);
            lVar14 = (lVar14 >> 2) - (lVar14 >> 0x3f);
            if (puVar11 == puVar20) {
              lVar15 = ((longlong)puVar11 - (longlong)puVar24) / 6 +
                       ((longlong)puVar11 - (longlong)puVar24 >> 0x3f);
              uVar23 = (lVar15 >> 2) - (lVar15 >> 0x3f);
              if (0xaaaaaaaaaaaaaa9 < uVar23) {
                std::_Xlength_error("vector<T> too long");
                pcVar6 = (code *)swi(3);
                (*pcVar6)();
                return;
              }
              if ((ulonglong)(((longlong)puVar20 - (longlong)puVar24) / 0x18) < uVar23 + 1) {
                FUN_14008e930(&local_80);
                puVar20 = local_70;
                puVar11 = local_78;
                puVar24 = local_80;
              }
            }
            puVar21 = (undefined8 *)0x0;
            if (puVar11 != (undefined8 *)0x0) {
              *(undefined4 *)puVar11 = *(undefined4 *)(puVar24 + lVar14 * 3);
              *(undefined4 *)((longlong)puVar11 + 4) =
                   *(undefined4 *)((longlong)puVar24 + lVar14 * 0x18 + 4);
              *(undefined4 *)(puVar11 + 1) = *(undefined4 *)(puVar24 + lVar14 * 3 + 1);
              *(undefined4 *)((longlong)puVar11 + 0xc) =
                   *(undefined4 *)((longlong)puVar24 + lVar14 * 0x18 + 0xc);
              *(undefined4 *)(puVar11 + 2) = *(undefined4 *)(puVar24 + lVar14 * 3 + 2);
              *(undefined4 *)((longlong)puVar11 + 0x14) =
                   *(undefined4 *)((longlong)puVar24 + lVar14 * 0x18 + 0x14);
              puVar20 = local_70;
              puVar21 = local_78;
              puVar24 = local_80;
            }
          }
          else {
            if (puVar11 == puVar20) {
              lVar14 = ((longlong)puVar11 - (longlong)puVar24) / 6 +
                       ((longlong)puVar11 - (longlong)puVar24 >> 0x3f);
              uVar23 = (lVar14 >> 2) - (lVar14 >> 0x3f);
              if (0xaaaaaaaaaaaaaa9 < uVar23) {
                std::_Xlength_error("vector<T> too long");
                pcVar6 = (code *)swi(3);
                (*pcVar6)();
                return;
              }
              if ((ulonglong)(((longlong)puVar20 - (longlong)puVar24) / 0x18) < uVar23 + 1) {
                FUN_14008e930(&local_80);
                puVar20 = local_70;
                puVar11 = local_78;
                puVar24 = local_80;
              }
            }
            puVar21 = (undefined8 *)0x0;
            if (puVar11 != (undefined8 *)0x0) {
              *(undefined4 *)puVar11 = uVar1;
              *(undefined4 *)((longlong)puVar11 + 4) = local_b8._4_4_;
              *(undefined4 *)(puVar11 + 1) = uVar2;
              *(undefined4 *)((longlong)puVar11 + 0xc) = uVar3;
              *(undefined4 *)(puVar11 + 2) = uVar4;
              *(undefined4 *)((longlong)puVar11 + 0x14) = uVar5;
              puVar20 = local_70;
              puVar21 = local_78;
              puVar24 = local_80;
            }
          }
          puVar11 = puVar21 + 3;
          local_78 = puVar11;
        }
        uVar8 = (int)puVar19 + 1;
        puVar19 = (undefined8 *)(ulonglong)uVar8;
      } while ((int)uVar8 < 0x1e);
      puVar12 = local_res20;
    } while (local_res20 != (undefined8 *)0x0);
    puVar20 = puVar24;
    if (puVar24 != puVar11) {
      plVar13 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar13 + 0x710))(plVar13,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_80)
      ;
      puVar20 = local_80;
    }
  }
  if (puVar20 != (undefined8 *)0x0) {
    operator_delete(puVar20);
  }
  FUN_14034edd0(local_60);
  return;
}



void FUN_14025dee0(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong lVar4;
  int iVar5;
  uint uVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong *plVar9;
  uint *puVar10;
  longlong lVar11;
  uint *puVar12;
  bool bVar13;
  longlong *local_60;
  longlong *local_58;
  longlong *local_50;
  undefined1 local_48;
  
  FUN_140198570(param_2,&local_60,param_3,param_4,0xfffffffffffffffe);
  plVar1 = local_60;
  if (local_60 != (longlong *)0x0) {
    if (local_60 == local_58) {
      if (*local_60 != 0) {
        lVar2 = *(longlong *)(*local_60 + 0x11b0);
        if (lVar2 != 0) {
          if (param_2 != 0) {
            plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            (**(code **)(*plVar9 + 0x2b0))(plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0);
          }
          local_50 = param_1 + 0x12;
          FUN_14034ed40(local_50);
          local_48 = 1;
          if (param_1[1] != 0) {
            uVar7 = 0;
            if (*(uint *)(param_1 + 2) != 0) {
              plVar9 = (longlong *)*param_1;
              do {
                if (*plVar9 != 0) {
                  lVar4 = ((longlong *)*param_1)[uVar7];
                  goto joined_r0x00014025dfed;
                }
                uVar6 = (int)uVar7 + 1;
                uVar7 = (ulonglong)uVar6;
                plVar9 = plVar9 + 1;
              } while (uVar6 < *(uint *)(param_1 + 2));
            }
          }
          lVar4 = 0;
joined_r0x00014025dfed:
          while (lVar4 != 0) {
            lVar11 = 0;
            if ((lVar4 != 0) && (lVar11 = *(longlong *)(lVar4 + 0x38), lVar11 == 0)) {
              uVar6 = *(uint *)(lVar4 + 0x40) % *(uint *)(param_1 + 2) + 1;
              lVar8 = (longlong)(int)uVar6 << 3;
              do {
                if (*(uint *)(param_1 + 2) <= uVar6) break;
                if (*(longlong *)(lVar8 + *param_1) != 0) {
                  lVar11 = *(longlong *)(lVar8 + *param_1);
                }
                uVar6 = uVar6 + 1;
                lVar8 = lVar8 + 8;
              } while (lVar11 == 0);
            }
            lVar8 = FUN_14030d840(lVar2,*(undefined4 *)(lVar4 + 0x20),*(undefined4 *)(lVar4 + 0x24))
            ;
            lVar4 = lVar11;
            if ((lVar8 != 0) && (*(int *)(lVar8 + 0x58) == 1)) {
              iVar5 = 0;
              puVar12 = (uint *)(lVar8 + 0x3d8);
              do {
                uVar6 = *puVar12;
                if (0 < (int)uVar6) {
                  plVar9 = (longlong *)FUN_1403161f0();
                  if (*plVar9 != 0) {
                    for (puVar10 = *(uint **)(*plVar9 +
                                             ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar9 + 2)) *
                                             8); puVar10 != (uint *)0x0;
                        puVar10 = *(uint **)(puVar10 + 0xe8)) {
                      if ((puVar10[0xea] == uVar6) && (*puVar10 == uVar6)) {
                        if (puVar10 != (uint *)0x0) {
                          if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                            FUN_14000d450(0x80004005);
                          }
                          uVar6 = puVar10[3];
                          goto LAB_14025e0c8;
                        }
                        break;
                      }
                    }
                  }
                  uVar6 = 0;
LAB_14025e0c8:
                  plVar9 = (longlong *)FUN_140267710(uVar6);
                  if (plVar9 != (longlong *)0x0) {
                    (**(code **)(*plVar9 + 8))(plVar9,*puVar12);
                    FUN_1402360c0(*plVar1,param_2,plVar9);
                    (**(code **)(*plVar9 + 0x10))(plVar9,0,0);
                  }
                }
                iVar5 = iVar5 + 1;
                puVar12 = puVar12 + 1;
              } while (iVar5 < 4);
            }
          }
          FUN_14034edd0(local_50);
        }
        goto LAB_14025e15a;
      }
    }
    else {
      iVar5 = DAT_14060804c + 1;
      bVar13 = DAT_14060804c == 0;
      DAT_14060804c = iVar5;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar1 == (longlong *)0x0) {
    return;
  }
  if (plVar1 != local_58) {
    if (DAT_140608054 != 0) {
      DAT_140608054 = DAT_140608054 + 1;
      return;
    }
    DAT_140608054 = DAT_140608054 + 1;
    FUN_140176d60(1);
    return;
  }
LAB_14025e15a:
  LOCK();
  plVar1 = plVar1 + 1;
  *(int *)plVar1 = (int)*plVar1 + -1;
  UNLOCK();
  if ((int)*plVar1 == 0) {
    puVar3 = (undefined8 *)*local_60;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    operator_delete(local_60);
  }
  return;
}



undefined8 FUN_14025e1b0(longlong *param_1,int param_2,int param_3)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  
  FUN_14034ed40(param_1 + 0x12);
  if (param_1[1] != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar6 = ((longlong *)*param_1)[uVar2];
          goto LAB_14025e21a;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar5 = plVar5 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar6 = 0;
LAB_14025e21a:
  do {
    lVar3 = lVar6;
    if (lVar3 == 0) {
      FUN_14034edd0(param_1 + 0x12);
      return 0;
    }
    lVar6 = *(longlong *)(lVar3 + 0x38);
    if (lVar6 == 0) {
      uVar1 = *(uint *)(lVar3 + 0x40) % *(uint *)(param_1 + 2) + 1;
      lVar4 = (longlong)(int)uVar1 << 3;
      do {
        if (*(uint *)(param_1 + 2) <= uVar1) break;
        if (*(longlong *)(lVar4 + *param_1) != 0) {
          lVar6 = *(longlong *)(lVar4 + *param_1);
        }
        uVar1 = uVar1 + 1;
        lVar4 = lVar4 + 8;
      } while (lVar6 == 0);
    }
    if ((*(int *)(lVar3 + 0x20) == param_2) && (param_3 <= *(int *)(lVar3 + 0x24))) {
      FUN_14034edd0(param_1 + 0x12);
      return 1;
    }
  } while( true );
}



ulonglong * FUN_14025e2b0(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_1402c6d50(param_1,uVar5,1,uVar5,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + ((ulonglong)uVar4 % uVar5) * 8);
        puVar3 != (ulonglong *)0x0; puVar3 = (ulonglong *)puVar3[7]) {
      if ((uint)puVar3[8] == 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;
          *(undefined4 *)((longlong)puVar3 + 0x14) = param_3[1];
          *(undefined4 *)(puVar3 + 3) = param_3[2];
          *(undefined4 *)((longlong)puVar3 + 0x1c) = param_3[3];
          *(undefined4 *)(puVar3 + 4) = param_3[4];
          *(undefined4 *)((longlong)puVar3 + 0x24) = param_3[5];
          *(undefined4 *)(puVar3 + 5) = param_3[6];
          *(undefined4 *)((longlong)puVar3 + 0x2c) = param_3[7];
          *(undefined4 *)(puVar3 + 6) = param_3[8];
          return puVar3;
        }
      }
    }
  }
  puVar3 = (ulonglong *)FUN_14025ea60(param_1,param_2,(ulonglong)uVar4 % uVar5,uVar4);
  *(undefined4 *)(puVar3 + 2) = *param_3;
  *(undefined4 *)((longlong)puVar3 + 0x14) = param_3[1];
  *(undefined4 *)(puVar3 + 3) = param_3[2];
  *(undefined4 *)((longlong)puVar3 + 0x1c) = param_3[3];
  *(undefined4 *)(puVar3 + 4) = param_3[4];
  *(undefined4 *)((longlong)puVar3 + 0x24) = param_3[5];
  *(undefined4 *)(puVar3 + 5) = param_3[6];
  *(undefined4 *)((longlong)puVar3 + 0x2c) = param_3[7];
  *(undefined4 *)(puVar3 + 6) = param_3[8];
  return puVar3;
}



undefined8 FUN_14025e400(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[8] == 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[7] = puVar2[7];
            FUN_14025e750(param_1,puVar2);
            return 1;
          }
          *(ulonglong *)
           (lVar1 + ((ulonglong)(uint)puVar2[8] % (ulonglong)*(uint *)(param_1 + 2)) * 8) =
               puVar2[7];
          FUN_14025e750(param_1,puVar2);
          return 1;
        }
      }
      puVar3 = puVar2;
      puVar4 = (ulonglong *)puVar2[7];
    }
  }
  return 0;
}



void FUN_14025e4c0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar7 = 0;
  if ((*param_1 != 0) && (uVar8 = uVar7, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(uVar8 + *param_1);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x38);
        *(longlong *)(lVar3 + 0x38) = param_1[8];
        param_1[1] = param_1[1] + -1;
        param_1[8] = lVar3;
        if (((ulonglong)param_1[1] < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          uVar4 = FUN_1402cddb0(param_1);
          FUN_14025e8b0(param_1,uVar4);
        }
        lVar3 = lVar1;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar5 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar5;
              free(plVar5);
              plVar5 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      uVar8 = uVar8 + 8;
    } 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_1402cddb0(param_1,0);
    FUN_1402c6d50(param_1,uVar4,0);
  }
  param_1[8] = 0;
  plVar5 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar5;
      free(plVar5);
      plVar5 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



void FUN_14025e600(void)

{
  FUN_14025e4c0();
  return;
}



uint * FUN_14025e620(longlong *param_1,uint param_2)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,(ulonglong)*(uint *)(param_1 + 2),1);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x7a)) {
      if ((puVar3[0x7c] == param_2) && (*puVar3 == param_2)) goto LAB_14025e67a;
    }
  }
  puVar3 = (uint *)FUN_14025eda0(param_1,param_2,uVar1,param_2);
LAB_14025e67a:
  return puVar3 + 1;
}



void FUN_14025e6b0(void)

{
  FUN_14025e7e0();
  return;
}



void FUN_14025e6d0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x40) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x38); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x38))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x38) = *(undefined8 *)(param_2 + 0x38);
      FUN_14025e750(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x38);
  FUN_14025e750(param_1,param_2);
  return;
}



void FUN_14025e750(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0x38) = *(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_1402cddb0();
      FUN_14025e8b0(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_14000d450(0x80004005);
}



void FUN_14025e7e0(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 + 0x1e8);
        FUN_14025ef10(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_14025e8b0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x38);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x40) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x38) = *(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_14025ea60(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));
    lVar7 = 0;
    if (uVar6 != 0) {
      auVar3._8_8_ = 0;
      auVar3._0_8_ = uVar6;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar3,0) < 0x48)
      goto LAB_14025eb07;
      lVar7 = uVar6 * 0x48;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14025eb07:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 9 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[7] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -9;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0xe);
  *puVar2 = *param_2;
  puVar2[1] = param_2[1];
  puVar2[2] = param_2[2];
  puVar2[3] = param_2[3];
  puVar2[4] = 0;
  puVar2[5] = 0;
  puVar2[6] = 0;
  puVar2[7] = 0;
  *(undefined8 *)(puVar2 + 8) = 0;
  puVar2[10] = 0;
  puVar2[0xb] = 0xffffffff;
  *(undefined1 *)(puVar2 + 0xc) = 1;
  puVar2[0x10] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0xe) = *(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_1402cddb0(param_1);
    FUN_14025e8b0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_14025ebf0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x1e8);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x1f0) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x1e8) = *(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_14025eda0(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) < 0x1f8)
      goto LAB_14025ee6d;
      lVar7 = uVar6 * 0x1f8;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14025ee6d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x3f + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x3d] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x3f;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x7a);
  *puVar2 = param_2;
  puVar2[0x7c] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x7a) = *(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_1402cddb0(param_1);
    FUN_14025ebf0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_14025ef10(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0x1e8) = *(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_1402cddb0();
      FUN_14025ebf0(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_14000d450(0x80004005);
}



undefined4 FUN_14025efa0(longlong param_1,uint param_2,uint param_3)

{
  undefined4 uVar1;
  
  FUN_14034ed40(param_1 + 0x4b18);
  if ((param_2 < 3) && (param_3 < 0x20)) {
    uVar1 = *(undefined4 *)
             (param_1 + 8 + ((longlong)(int)param_2 * 0x20 + (longlong)(int)param_3) * 4);
    FUN_14034edd0(param_1 + 0x4b18);
  }
  else {
    FUN_14034edd0(param_1 + 0x4b18);
    uVar1 = 3;
  }
  return uVar1;
}



void FUN_14025f030(longlong param_1,int param_2,int param_3,undefined4 param_4)

{
  FUN_14034ed40(param_1 + 0x4b18);
  *(undefined4 *)(param_1 + 8 + ((longlong)param_2 * 0x20 + (longlong)param_3) * 4) = param_4;
  FUN_14034edd0(param_1 + 0x4b18);
  return;
}



void FUN_14025f0a0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  bool bVar2;
  longlong lVar3;
  int *piVar4;
  undefined4 *puVar5;
  longlong lVar6;
  undefined8 uVar7;
  longlong lVar8;
  
  uVar7 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x4b18;
  lVar8 = lVar1;
  FUN_14034ed40(lVar1);
  bVar2 = false;
  puVar5 = (undefined4 *)(param_1 + 0x188);
  piVar4 = (int *)(param_1 + 8);
  lVar6 = 3;
  do {
    lVar3 = 0x20;
    do {
      if (*piVar4 == 2) {
        *puVar5 = 0;
        puVar5[1] = 0;
        puVar5[2] = 0;
        puVar5[3] = 0;
        *piVar4 = 0;
        if (!bVar2) {
          bVar2 = true;
        }
      }
      puVar5 = puVar5 + 6;
      piVar4 = piVar4 + 1;
      lVar3 = lVar3 + -1;
    } while (lVar3 != 0);
    lVar6 = lVar6 + -1;
  } while (lVar6 != 0);
  if (bVar2) {
    FUN_1402613f0(param_1,param_2,piVar4,puVar5,uVar7,lVar8,1);
  }
  FUN_14034edd0(lVar1);
  return;
}



void FUN_14025f180(longlong param_1,int *param_2,uint param_3)

{
  int iVar1;
  int *piVar2;
  int *piVar3;
  longlong lVar4;
  longlong lVar5;
  int *piVar6;
  
  lVar4 = (longlong)(int)param_3;
  FUN_14034ed40(param_1 + 0x4b18);
  if (param_3 < 3) {
    piVar6 = param_2 + 0x20;
    piVar3 = (int *)(lVar4 * 0x300 + 0x188 + param_1);
    lVar5 = lVar4 * 0x80 - (longlong)param_2;
    piVar2 = (int *)(lVar4 * 0x1580 + 0xa88 + param_1);
    lVar4 = 0x20;
    do {
      iVar1 = *param_2;
      *(int *)(lVar5 + 8 + param_1 + (longlong)param_2) = iVar1;
      if (iVar1 == 1) {
        *piVar2 = *piVar6;
        piVar2[1] = piVar6[1];
        piVar2[2] = piVar6[2];
        piVar2[3] = piVar6[3];
      }
      else if (iVar1 == 2) {
        *piVar3 = *piVar6;
        piVar3[1] = piVar6[1];
        piVar3[2] = piVar6[2];
        piVar3[3] = piVar6[3];
      }
      piVar2 = piVar2 + 0x2b;
      piVar6 = piVar6 + 4;
      piVar3 = piVar3 + 6;
      param_2 = param_2 + 1;
      lVar4 = lVar4 + -1;
    } while (lVar4 != 0);
  }
  FUN_14034edd0(param_1 + 0x4b18);
  return;
}



void FUN_14025f270(longlong param_1,ulonglong *param_2,int param_3)

{
  longlong lVar1;
  ulonglong *puVar2;
  short sVar3;
  ulonglong uVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  uint uVar8;
  bool bVar9;
  undefined8 uVar10;
  
  uVar10 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x4b18;
  lVar7 = lVar1;
  FUN_14034ed40(lVar1);
  uVar8 = param_3 - 0xb;
  if (((uVar8 < 3) && (sVar3 = *(short *)((longlong)param_2 + 0x12), -1 < sVar3)) && (sVar3 < 0x20))
  {
    lVar6 = (longlong)sVar3 + (longlong)(int)uVar8 * 0x20;
    if (*(int *)(param_1 + 8 + lVar6 * 4) == 1) {
      puVar2 = (ulonglong *)(lVar6 * 0xac + 0xa88 + param_1);
      uVar4 = *puVar2;
      bVar9 = uVar4 < *param_2;
      if ((uVar4 == *param_2) &&
         (uVar4 = puVar2[1], bVar9 = uVar4 < param_2[1], uVar4 == param_2[1])) {
        iVar5 = 0;
      }
      else {
        iVar5 = (1 - (uint)bVar9) - (uint)(bVar9 != 0);
      }
      if (iVar5 == 0) {
        lVar7 = ((longlong)*(short *)((longlong)param_2 + 0x12) + (longlong)(int)uVar8 * 0x20) *
                0xac;
        *(short *)(lVar7 + 0xa9c + param_1) = (short)param_2[2];
        *(undefined2 *)(lVar7 + 0xa9e + param_1) = *(undefined2 *)((longlong)param_2 + 0x12);
        *(ulonglong *)(lVar7 + 0xa88 + param_1) = *param_2;
        *(ulonglong *)(lVar7 + 0xa90 + param_1) = param_2[1];
        *(undefined4 *)(lVar7 + 0xaa0 + param_1) = *(undefined4 *)((longlong)param_2 + 0x14);
        *(short *)(lVar7 + 0xaa4 + param_1) = (short)param_2[3];
        *(undefined4 *)(lVar7 + 0xaa8 + param_1) = *(undefined4 *)((longlong)param_2 + 0x1a);
        *(undefined2 *)(lVar7 + 0xab0 + param_1) = *(undefined2 *)((longlong)param_2 + 0x1e);
      }
      else {
        FUN_140418da0(DAT_140607fd8,&DAT_1404b5fa0,uVar8,(int)sVar3,uVar10,lVar7,1);
      }
    }
  }
  FUN_14034edd0(lVar1);
  return;
}



void FUN_14025f3c0(longlong param_1,undefined8 param_2,undefined8 param_3,uint param_4)

{
  undefined4 *puVar1;
  longlong lVar2;
  undefined4 *puVar3;
  int *piVar4;
  int *piVar5;
  undefined4 *puVar6;
  
  lVar2 = (longlong)(int)param_4;
  FUN_14034ed40(param_1 + 0x4b18);
  if (param_4 < 3) {
    piVar4 = (int *)(lVar2 * 0x80 + 8 + param_1);
    puVar3 = (undefined4 *)(lVar2 * 0x300 + 0x188 + param_1);
    puVar6 = (undefined4 *)(lVar2 * 0x1580 + 0xa88 + param_1);
    lVar2 = 0x20;
    piVar5 = piVar4;
    do {
      FUN_14012e5c0(param_2,piVar4);
      puVar1 = puVar6;
      if ((*piVar5 != 1) && (puVar1 = puVar3, *piVar5 != 2)) {
        puVar1 = &DAT_14044e480;
      }
      FUN_140051700(param_3,puVar1);
      piVar4 = piVar4 + 1;
      puVar6 = puVar6 + 0x2b;
      puVar3 = puVar3 + 6;
      piVar5 = piVar5 + 1;
      lVar2 = lVar2 + -1;
    } while (lVar2 != 0);
  }
  FUN_14034edd0(param_1 + 0x4b18);
  return;
}



void FUN_14025f4c0(longlong param_1,uint param_2,longlong param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  bool bVar4;
  int iVar5;
  longlong *plVar6;
  longlong lVar7;
  int *piVar8;
  ulonglong uVar9;
  uint uVar10;
  longlong lVar12;
  uint local_res10 [2];
  longlong local_res18;
  undefined4 local_c8;
  int local_c4;
  int iStack_c0;
  int local_bc;
  int local_b8;
  int local_b4;
  int local_b0;
  int *local_a8;
  int *local_a0;
  int *local_98;
  undefined2 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  void *local_70;
  void *local_68;
  undefined8 local_60;
  undefined8 local_50;
  ulonglong uVar11;
  
  local_50 = 0xfffffffffffffffe;
  uVar9 = 0;
  local_c8 = (local_c8 >> 8 & 0xff) << 8;
  local_c4 = 0;
  iStack_c0 = 0;
  local_bc = 0;
  local_b8 = 0;
  local_b4 = 0;
  local_b0 = 0;
  local_88 = 0;
  local_84 = 0;
  local_80 = 0;
  local_7c = 0;
  local_78 = 0;
  local_74 = 0;
  local_a8 = (int *)0x0;
  local_a0 = (int *)0x0;
  local_98 = (int *)0x0;
  local_70 = (void *)0x0;
  local_68 = (void *)0x0;
  local_60 = 0;
  uVar11 = uVar9;
  local_res10[0] = param_2;
  local_res18 = param_3;
  do {
    uVar10 = local_res10[0];
    lVar12 = param_1 + 0x4b18;
    lVar7 = (longlong)(int)local_res10[0];
    FUN_14034ed40(lVar12);
    bVar4 = false;
    if ((uVar10 < 3) && ((uint)uVar11 < 0x20)) {
      iVar5 = *(int *)(param_1 + 8 + (lVar7 * 0x20 + uVar9) * 4);
      FUN_14034edd0(lVar12);
      if (iVar5 != 1) goto LAB_14025f728;
      lVar7 = ((longlong)(int)local_res10[0] * 0x20 + uVar9) * 0xac;
      plVar6 = (longlong *)(lVar7 + 0xa88 + param_1);
      if ((*plVar6 != 0) || (plVar6[1] != 0)) {
        bVar4 = true;
      }
      if (bVar4) {
        local_c8 = CONCAT31(local_c8._1_3_,(char)uVar11);
        iVar5 = (int)*plVar6;
        iVar1 = *(int *)((longlong)plVar6 + 4);
        iVar2 = (int)plVar6[1];
        iVar3 = *(int *)((longlong)plVar6 + 0xc);
        local_c4 = *(int *)(lVar7 + 0xaa0 + param_1);
        local_c8 = CONCAT22(*(undefined2 *)(lVar7 + 0xaa4 + param_1),(undefined2)local_c8);
        iStack_c0 = *(int *)(lVar7 + 0xaa8 + param_1);
        local_bc = iVar5;
        local_b8 = iVar1;
        local_b4 = iVar2;
        local_b0 = iVar3;
        if ((&local_c8 < local_a0) && (local_a8 <= &local_c8)) {
          lVar7 = (longlong)&local_c8 - (longlong)local_a8;
          if (local_a0 == local_98) {
            FUN_14008f330(&local_a8,1);
          }
          piVar8 = local_a8 + (lVar7 / 0x1c) * 7;
          if (local_a0 != (int *)0x0) {
            *local_a0 = *piVar8;
            local_a0[1] = piVar8[1];
            local_a0[2] = piVar8[2];
            local_a0[3] = piVar8[3];
            local_a0[4] = piVar8[4];
            local_a0[5] = piVar8[5];
            local_a0[6] = piVar8[6];
          }
        }
        else {
          if (local_a0 == local_98) {
            FUN_14008f330(&local_a8,1);
          }
          if (local_a0 != (int *)0x0) {
            *local_a0 = local_c8;
            local_a0[1] = local_c4;
            local_a0[2] = iStack_c0;
            local_a0[3] = iVar5;
            local_a0[4] = iVar1;
            local_a0[5] = iVar2;
            local_a0[6] = iVar3;
          }
        }
        local_a0 = local_a0 + 7;
      }
    }
    else {
      FUN_14034edd0(lVar12);
LAB_14025f728:
      iVar5 = FUN_14025efa0(param_1,local_res10[0],uVar11);
      if (iVar5 == 2) {
        lVar7 = (longlong)(int)local_res10[0] * 0x20 + uVar9;
        plVar6 = (longlong *)(param_1 + 0x188 + lVar7 * 0x18);
        if ((*plVar6 != 0) || (plVar6[1] != 0)) {
          bVar4 = true;
        }
        if (bVar4) {
          local_80 = (undefined4)*plVar6;
          local_7c = *(undefined4 *)((longlong)plVar6 + 4);
          local_78 = (undefined4)plVar6[1];
          local_74 = *(undefined4 *)((longlong)plVar6 + 0xc);
          local_84 = *(undefined4 *)(param_1 + (lVar7 * 3 + 0x33) * 8);
          local_88 = CONCAT11(*(undefined1 *)(param_1 + 0x19c + lVar7 * 0x18),(char)uVar11);
          FUN_14008e830(&local_70,&local_88);
        }
      }
    }
    lVar7 = local_res18;
    uVar10 = (uint)uVar11 + 1;
    uVar11 = (ulonglong)uVar10;
    uVar9 = uVar9 + 1;
    if (0x1f < (int)uVar10) {
      if (local_a8 != local_a0) {
        plVar6 = (longlong *)(*(longlong *)(local_res18 + 0xb50) + 0x78);
        (**(code **)(*plVar6 + 0x6a0))
                  (plVar6,*(undefined4 *)(local_res18 + 8),&DAT_1405d85a0,&local_a8,local_res10);
      }
      if (local_70 != local_68) {
        plVar6 = (longlong *)(*(longlong *)(lVar7 + 0xb50) + 0x78);
        (**(code **)(*plVar6 + 0x6b0))
                  (plVar6,*(undefined4 *)(lVar7 + 8),&DAT_1405d85a0,&local_70,local_res10);
      }
      if (local_70 != (void *)0x0) {
        operator_delete(local_70);
      }
      local_70 = (void *)0x0;
      local_68 = (void *)0x0;
      local_60 = 0;
      if (local_a8 != (int *)0x0) {
        operator_delete(local_a8);
      }
      return;
    }
  } while( true );
}



bool FUN_14025f890(longlong param_1,ulonglong *param_2,int *param_3,uint param_4)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong uVar3;
  int iVar4;
  bool bVar5;
  
  lVar1 = param_1 + 0x4b18;
  FUN_14034ed40(lVar1);
  if ((((param_4 < 3) && (-1 < *param_3)) && (*param_3 < 0x20)) &&
     (iVar4 = FUN_14025efa0(param_1,param_4), iVar4 == 1)) {
    puVar2 = (ulonglong *)
             (((longlong)(int)param_4 * 0x20 + (longlong)*param_3) * 0xac + 0xa88 + param_1);
    uVar3 = *puVar2;
    bVar5 = uVar3 < *param_2;
    if ((uVar3 == *param_2) && (uVar3 = puVar2[1], bVar5 = uVar3 < param_2[1], uVar3 == param_2[1]))
    {
      iVar4 = 0;
    }
    else {
      iVar4 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
    }
    FUN_14034edd0(lVar1);
    return iVar4 == 0;
  }
  FUN_14034edd0(lVar1);
  return false;
}



undefined8 FUN_14025f970(longlong param_1,int *param_2,undefined8 param_3,uint param_4)

{
  int iVar1;
  
  FUN_14034ed40(param_1 + 0x4b18);
  if (param_4 < 3) {
    iVar1 = *param_2;
    if ((-1 < iVar1) && (iVar1 < 0x20)) {
      FUN_140090020(param_3,((longlong)(int)param_4 * 0x20 + (longlong)iVar1) * 0xac + 0xa88 +
                            param_1);
      FUN_14034edd0(param_1 + 0x4b18);
      return 1;
    }
  }
  FUN_14034edd0(param_1 + 0x4b18);
  return 0;
}



undefined8 FUN_14025fa20(longlong param_1,int *param_2,undefined8 param_3,uint param_4)

{
  int iVar1;
  
  FUN_14034ed40(param_1 + 0x4b18);
  if (param_4 < 3) {
    iVar1 = *param_2;
    if ((-1 < iVar1) && (iVar1 < 0x20)) {
      FUN_140090020(((longlong)iVar1 + (longlong)(int)param_4 * 0x20) * 0xac + 0xa88 + param_1,
                    param_3);
      *(undefined4 *)(((longlong)*param_2 + (longlong)(int)param_4 * 0x20) * 0xac + 0xb30 + param_1)
           = 6;
      FUN_14034edd0(param_1 + 0x4b18);
      return 1;
    }
  }
  FUN_14034edd0(param_1 + 0x4b18);
  return 0;
}



undefined8
FUN_14025fae0(longlong param_1,longlong param_2,int *param_3,ulonglong *param_4,uint param_5)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong uVar3;
  int iVar4;
  longlong *plVar5;
  bool bVar6;
  undefined2 local_res8 [4];
  undefined4 local_e8 [2];
  undefined8 local_e0;
  longlong local_d8;
  undefined1 local_d0;
  undefined1 local_c8 [168];
  undefined4 local_20;
  
  local_e0 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x4b18;
  local_d8 = lVar1;
  FUN_14034ed40(lVar1);
  local_d0 = 1;
  if (param_5 < 3) {
    iVar4 = *param_3;
    if ((-1 < iVar4) && (iVar4 < 0x20)) {
      puVar2 = (ulonglong *)
               (((longlong)(int)param_5 * 0x20 + (longlong)iVar4) * 0xac + 0xa88 + param_1);
      uVar3 = *puVar2;
      bVar6 = uVar3 < *param_4;
      if ((uVar3 == *param_4) &&
         (uVar3 = puVar2[1], bVar6 = uVar3 < param_4[1], uVar3 == param_4[1])) {
        iVar4 = 0;
      }
      else {
        iVar4 = (1 - (uint)bVar6) - (uint)(bVar6 != 0);
      }
      if (iVar4 == 0) {
        local_res8[0] = (undefined2)*param_3;
        local_e8[0] = 1;
        plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0x310))
                  (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_e8,local_res8,param_4,
                   &param_5);
        FUN_14025f030(param_1,param_5,*param_3,0);
        FUN_14000a170(local_c8);
        local_20 = 0;
        FUN_140090020(((longlong)(int)param_5 * 0x20 + (longlong)*param_3) * 0xac + 0xa88 + param_1,
                      local_c8);
        FUN_1402613f0(param_1,param_2);
        FUN_14034edd0(lVar1);
        return 1;
      }
    }
  }
  local_res8[0] = (undefined2)*param_3;
  local_e8[0] = 0x17;
  plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
  (**(code **)(*plVar5 + 0x310))
            (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_e8,local_res8,param_4,&param_5
            );
  FUN_14034edd0(lVar1);
  return 0;
}



void FUN_14025fcd0(longlong param_1,longlong param_2,ulonglong *param_3,longlong param_4,
                  int *param_5,uint param_6)

{
  longlong lVar1;
  ulonglong *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  bool bVar6;
  undefined2 local_res8 [4];
  undefined8 in_stack_ffffffffffffff60;
  undefined4 uVar7;
  ulonglong in_stack_ffffffffffffff68;
  undefined8 in_stack_ffffffffffffff70;
  undefined4 uVar8;
  undefined8 in_stack_ffffffffffffff78;
  undefined4 uVar9;
  int local_78 [2];
  undefined4 local_70 [2];
  undefined8 local_68;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  longlong local_40;
  undefined1 local_38;
  
  uVar7 = (undefined4)((ulonglong)in_stack_ffffffffffffff60 >> 0x20);
  uVar8 = (undefined4)((ulonglong)in_stack_ffffffffffffff70 >> 0x20);
  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffff78 >> 0x20);
  local_68 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x4b18;
  local_40 = lVar1;
  FUN_14034ed40(lVar1);
  local_38 = 1;
  if (param_6 < 3) {
    lVar4 = ((longlong)(int)param_6 * 0x20 + (longlong)*param_5) * 0xac;
    puVar2 = (ulonglong *)(lVar4 + 0xa88 + param_1);
    bVar6 = *puVar2 < *param_3;
    if ((*puVar2 == *param_3) && (bVar6 = puVar2[1] < param_3[1], puVar2[1] == param_3[1])) {
      iVar3 = 0;
    }
    else {
      iVar3 = (1 - (uint)bVar6) - (uint)(bVar6 != 0);
    }
    if (iVar3 == 0) {
      in_stack_ffffffffffffff68 = in_stack_ffffffffffffff68 & 0xffffffff00000000;
      FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c5,0x20,param_2,puVar2,
                    CONCAT44(uVar7,(int)*(short *)(lVar4 + 0xaa4 + param_1)),
                    in_stack_ffffffffffffff68,CONCAT44(uVar8,*param_5),
                    CONCAT44(uVar9,(int)*(short *)(param_4 + 0x16)));
      FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c5,0x1f,param_2,param_4,
                    (int)*(short *)(param_4 + 0x1c),in_stack_ffffffffffffff68 & 0xffffffff00000000,
                    (int)*(short *)(param_4 + 0x16),*param_5);
      FUN_140090020(((longlong)(int)param_6 * 0x20 + (longlong)*param_5) * 0xac + 0xa88 + param_1,
                    param_4);
      local_60 = *(undefined4 *)(param_2 + 0x160);
      local_5c = *(undefined4 *)(param_2 + 0x164);
      local_58 = *(undefined4 *)(param_2 + 0x168);
      local_54 = *(undefined4 *)(param_2 + 0x16c);
      local_50 = *(undefined4 *)(param_2 + 0x170);
      local_4c = *(undefined4 *)(param_2 + 0x174);
      local_48 = *(undefined4 *)(param_2 + 0x178);
      local_44 = *(undefined4 *)(param_2 + 0x17c);
      iVar3 = *(int *)(param_2 + 0x284);
      local_78[0] = *param_5;
      local_70[0] = 0xb;
      if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar4 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar4 != 0)) {
        local_res8[0] = (undefined2)iVar3;
        plVar5 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        (**(code **)(*plVar5 + 0x130))
                  (plVar5,1,&DAT_1405d85a0,local_res8,&local_50,&local_60,
                   ((longlong)(int)param_6 * 0x20 + (longlong)local_78[0]) * 0xac + 0xa88 + param_1,
                   local_70,local_78);
      }
      local_50 = *(undefined4 *)(param_2 + 0x160);
      local_4c = *(undefined4 *)(param_2 + 0x164);
      local_48 = *(undefined4 *)(param_2 + 0x168);
      local_44 = *(undefined4 *)(param_2 + 0x16c);
      local_60 = *(undefined4 *)(param_2 + 0x170);
      local_5c = *(undefined4 *)(param_2 + 0x174);
      local_58 = *(undefined4 *)(param_2 + 0x178);
      local_54 = *(undefined4 *)(param_2 + 0x17c);
      iVar3 = *(int *)(param_2 + 0x284);
      if (((-1 < iVar3) && (iVar3 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar4 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar4 != 0)) {
        local_res8[0] = (undefined2)iVar3;
        plVar5 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        (**(code **)(*plVar5 + 0x140))
                  (plVar5,1,&DAT_1405d85a0,local_res8,&local_60,&local_50,
                   ((longlong)(int)param_6 * 0x20 + (longlong)*param_5) * 0xac + 0xa88 + param_1);
      }
      local_res8[0] = (undefined2)*param_5;
      plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      lVar4 = ((longlong)(int)param_6 * 0x20 + (longlong)*param_5) * 0xac;
      (**(code **)(*plVar5 + 0x2e0))
                (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res8,
                 lVar4 + 0xa88 + param_1,lVar4 + 0xaa0 + param_1,lVar4 + 0xaa4 + param_1,
                 lVar4 + 0xaa8 + param_1,&param_6);
    }
  }
  FUN_14034edd0(lVar1);
  return;
}



void FUN_140260090(longlong param_1,longlong param_2,int *param_3,int *param_4,undefined4 param_5,
                  uint param_6)

{
  short *psVar1;
  int iVar2;
  longlong lVar3;
  ulonglong in_stack_ffffffffffffffa8;
  undefined2 local_38 [2];
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  
  if (param_6 < 3) {
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c5,0x20,param_2,
                  ((longlong)(int)param_6 * 0x20 + (longlong)*param_3) * 0xac + 0xa88 + param_1,
                  *param_4,in_stack_ffffffffffffffa8 & 0xffffffff00000000,*param_3,param_5);
    lVar3 = ((longlong)(int)param_6 * 0x20 + (longlong)*param_3) * 0xac;
    if ((int)*(short *)(lVar3 + 0xaa4 + param_1) == *param_4) {
      FUN_14025fae0(param_1,param_2,param_3,lVar3 + 0xa88 + param_1,param_6);
      FUN_1402613f0(param_1,param_2);
    }
    else {
      psVar1 = (short *)(lVar3 + 0xaa4 + param_1);
      *psVar1 = *psVar1 - (short)*param_4;
      local_34 = *(undefined4 *)(param_2 + 0x160);
      iVar2 = *(int *)(param_2 + 0x284);
      local_30 = *(undefined4 *)(param_2 + 0x164);
      local_2c = *(undefined4 *)(param_2 + 0x168);
      local_28 = *(undefined4 *)(param_2 + 0x16c);
      local_24 = *(undefined4 *)(param_2 + 0x170);
      local_20 = *(undefined4 *)(param_2 + 0x174);
      local_1c = *(undefined4 *)(param_2 + 0x178);
      local_18 = *(undefined4 *)(param_2 + 0x17c);
      if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
        local_38[0] = (undefined2)iVar2;
        lVar3 = *(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8);
        (**(code **)(*(longlong *)(lVar3 + 0x70) + 0x140))
                  (lVar3 + 0x70,1,&DAT_1405d85a0,local_38,&local_24,&local_34,
                   ((longlong)(int)param_6 * 0x20 + (longlong)*param_3) * 0xac + 0xa88 + param_1);
      }
      local_38[0] = (undefined2)*param_3;
      lVar3 = ((longlong)(int)param_6 * 0x20 + (longlong)*param_3) * 0xac;
      (**(code **)(*(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78) + 0x2e0))
                (*(longlong *)(param_2 + 0xb50) + 0x78,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,
                 local_38,lVar3 + 0xa88 + param_1,lVar3 + 0xaa0 + param_1,lVar3 + 0xaa4 + param_1,
                 lVar3 + 0xaa8 + param_1,&param_6);
    }
  }
  return;
}



undefined8
FUN_140260310(longlong param_1,longlong param_2,ulonglong param_3,int *param_4,int *param_5,
             ulonglong param_6,int param_7)

{
  short *psVar1;
  short sVar2;
  undefined8 *puVar3;
  void *pvVar4;
  int iVar5;
  undefined4 *puVar6;
  undefined8 uVar7;
  int iVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong lVar11;
  undefined8 uVar12;
  int *piVar13;
  longlong lVar14;
  longlong lVar15;
  longlong lVar16;
  longlong *plVar17;
  bool bVar18;
  undefined4 *puVar19;
  undefined4 uVar20;
  undefined4 uVar23;
  undefined4 *puVar21;
  undefined8 uVar22;
  ulonglong uVar24;
  undefined4 uVar26;
  undefined4 uVar27;
  undefined8 uVar25;
  undefined4 uVar28;
  undefined2 local_198;
  undefined2 local_196;
  undefined2 local_194;
  undefined2 local_192;
  undefined2 local_190;
  undefined2 local_18e;
  undefined2 local_18c;
  undefined2 local_18a;
  undefined2 local_188;
  undefined2 local_186;
  undefined2 local_184;
  undefined2 local_182;
  int local_180 [2];
  longlong local_178;
  int local_170 [2];
  undefined4 local_168 [2];
  undefined4 local_160 [2];
  int local_158 [2];
  longlong *local_150;
  longlong *local_148;
  undefined4 local_140 [2];
  longlong *local_138;
  longlong *local_130;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  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;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined8 local_48;
  undefined1 local_40 [24];
  
  local_48 = 0xfffffffffffffffe;
  if (2 < param_7) {
    return 0;
  }
  if (*param_4 < 0) {
    return 0;
  }
  if (0x1f < *param_4) {
    return 0;
  }
  piVar13 = param_4;
  FUN_140197b70(param_2,&local_150);
  plVar17 = local_150;
  if (local_150 != (longlong *)0x0) {
    if (local_150 == local_148) {
      if (*local_150 != 0) {
        iVar5 = FUN_14011b180(((longlong)param_7 * 0x20 + (longlong)*piVar13) * 0xac + 0xa88 +
                              param_1);
        if (iVar5 != 0) {
          FUN_140090020();
          *(short *)(((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xa9e + param_1) =
               (short)*param_4;
          if ((int)*(short *)(param_3 + 0x1c) == *param_5) {
            local_108 = *(undefined4 *)(param_2 + 0x160);
            local_104 = *(undefined4 *)(param_2 + 0x164);
            local_100 = *(undefined4 *)(param_2 + 0x168);
            local_fc = *(undefined4 *)(param_2 + 0x16c);
            local_88 = *(undefined4 *)(param_2 + 0x170);
            local_84 = *(undefined4 *)(param_2 + 0x174);
            local_80 = *(undefined4 *)(param_2 + 0x178);
            local_7c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            local_158[0] = *param_4;
            local_160[0] = 0xb;
            if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
              local_196 = (undefined2)iVar5;
              plVar9 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                       0x70);
              (**(code **)(*plVar9 + 0x130))
                        (plVar9,1,&DAT_1405d85a0,&local_196,&local_88,&local_108,
                         ((longlong)param_7 * 0x20 + (longlong)local_158[0]) * 0xac + 0xa88 +
                         param_1,local_160,local_158);
            }
            local_e8 = *(undefined4 *)(param_2 + 0x160);
            local_e4 = *(undefined4 *)(param_2 + 0x164);
            local_e0 = *(undefined4 *)(param_2 + 0x168);
            local_dc = *(undefined4 *)(param_2 + 0x16c);
            local_128 = *(undefined4 *)(param_2 + 0x170);
            local_124 = *(undefined4 *)(param_2 + 0x174);
            local_120 = *(undefined4 *)(param_2 + 0x178);
            local_11c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
              local_18a = (undefined2)iVar5;
              plVar9 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                       0x70);
              (**(code **)(*plVar9 + 0x140))
                        (plVar9,1,&DAT_1405d85a0,&local_18a,&local_128,&local_e8,
                         ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xa88 + param_1);
            }
            local_192 = (undefined2)*param_4;
            plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            lVar16 = ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac;
            lVar11 = lVar16 + 0xaa4 + param_1;
            puVar21 = &param_7;
            (**(code **)(*plVar9 + 0x2e0))
                      (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_192,
                       lVar16 + 0xa88 + param_1,lVar16 + 0xaa0 + param_1,lVar11,
                       lVar16 + 0xaa8 + param_1,puVar21);
            puVar6 = (undefined4 *)
                     CONCAT44((int)((ulonglong)lVar11 >> 0x20),*(undefined4 *)(*plVar17 + 0x50a0));
            FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,400,9,
                          *(undefined4 *)
                           (((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xaa0 + param_1
                           ),puVar6,*(undefined4 *)(*plVar17 + 0x50a0),
                          (ulonglong)puVar21 & 0xffffffff00000000,0);
          }
          else {
            puVar6 = (undefined4 *)FUN_140357570(local_40);
            lVar11 = ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac;
            *(undefined4 *)(lVar11 + 0xa88 + param_1) = *puVar6;
            *(undefined4 *)(lVar11 + 0xa8c + param_1) = puVar6[1];
            *(undefined4 *)(lVar11 + 0xa90 + param_1) = puVar6[2];
            *(undefined4 *)(lVar11 + 0xa94 + param_1) = puVar6[3];
            *(short *)(((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xaa4 + param_1) =
                 (short)*param_5;
            local_182 = (undefined2)*param_4;
            plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            lVar14 = ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac;
            lVar11 = lVar14 + 0xaa8 + param_1;
            puVar6 = (undefined4 *)(lVar14 + 0xaa4 + param_1);
            lVar16 = lVar14 + 0xaa0 + param_1;
            lVar14 = lVar14 + 0xa88 + param_1;
            plVar9 = (longlong *)&param_7;
            (**(code **)(*plVar10 + 0x2e0))
                      (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_182,lVar14,lVar16,
                       puVar6,lVar11,plVar9);
            uVar20 = (undefined4)((ulonglong)lVar14 >> 0x20);
            uVar23 = (undefined4)((ulonglong)lVar16 >> 0x20);
            uVar26 = (undefined4)((ulonglong)lVar11 >> 0x20);
            *(undefined2 *)
             (((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xa9c + param_1) = 0xb;
            *(short *)(((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xa9e + param_1) =
                 (short)*param_4;
            local_c8 = *(undefined4 *)(param_2 + 0x160);
            local_c4 = *(undefined4 *)(param_2 + 0x164);
            local_c0 = *(undefined4 *)(param_2 + 0x168);
            local_bc = *(undefined4 *)(param_2 + 0x16c);
            local_78 = *(undefined4 *)(param_2 + 0x170);
            local_74 = *(undefined4 *)(param_2 + 0x174);
            local_70 = *(undefined4 *)(param_2 + 0x178);
            local_6c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            plVar10 = (longlong *)
                      (((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xa88 + param_1);
            local_168[0] = *(undefined4 *)(param_2 + 8);
            if ((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
              if ((*plVar10 == 0) && (plVar10[1] == 0)) {
                bVar18 = false;
              }
              else {
                bVar18 = true;
              }
              if (((bVar18) && ((int)plVar10[3] != 0)) &&
                 (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
                local_18e = (undefined2)iVar5;
                plVar9 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                uVar26 = 1;
                puVar6 = &local_c8;
                puVar21 = &local_78;
                puVar19 = local_168;
                (**(code **)(*plVar9 + 0xb0))
                          (plVar9,1,&DAT_1405d85a0,&local_18e,puVar19,puVar21,puVar6,&DAT_14047b988,
                           plVar10);
                uVar20 = (undefined4)((ulonglong)puVar19 >> 0x20);
                uVar23 = (undefined4)((ulonglong)puVar21 >> 0x20);
                plVar9 = plVar10;
              }
            }
            FUN_140198570(param_2,&local_138);
            plVar10 = local_138;
            if (local_138 != (longlong *)0x0) {
              if (local_138 == local_130) {
                if (*local_138 != 0) {
                  puVar6 = (undefined4 *)
                           CONCAT44((int)((ulonglong)puVar6 >> 0x20),
                                    *(undefined4 *)(*plVar17 + 0x50a0));
                  FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,400,
                                CONCAT44(uVar20,9),
                                CONCAT44(uVar23,*(undefined4 *)
                                                 (((longlong)param_7 * 0x20 + (longlong)*param_4) *
                                                  0xac + 0xaa0 + param_1)),puVar6,
                                CONCAT44(uVar26,*(undefined4 *)(*plVar17 + 0x50a0)),
                                (ulonglong)plVar9 & 0xffffffff00000000,0);
                }
              }
              else {
                iVar5 = DAT_14060804c + 1;
                bVar18 = DAT_14060804c == 0;
                DAT_14060804c = iVar5;
                if (bVar18) {
                  FUN_140176d60(1);
                }
              }
            }
            if (plVar10 != (longlong *)0x0) {
              if (plVar10 == local_130) {
                LOCK();
                plVar10 = plVar10 + 1;
                *(int *)plVar10 = (int)*plVar10 + -1;
                UNLOCK();
                plVar17 = local_150;
                if ((int)*plVar10 == 0) {
                  puVar3 = (undefined8 *)*local_138;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  operator_delete(local_138);
                  plVar17 = local_150;
                }
              }
              else {
                iVar5 = DAT_140608054 + 1;
                bVar18 = DAT_140608054 == 0;
                DAT_140608054 = iVar5;
                if (bVar18) {
                  FUN_140176d60(1);
                }
              }
            }
          }
          sVar2 = *(short *)(param_3 + 0x16);
          iVar5 = *param_4;
          goto LAB_1402611df;
        }
        uVar7 = FUN_140137690();
        iVar5 = FUN_140136a70(uVar7,*(undefined4 *)(param_3 + 0x18));
        local_178 = (longlong)param_7 * 0x20;
        lVar11 = (*param_4 + local_178) * 0xac;
        if ((*(int *)(lVar11 + 0xaa0 + param_1) == *(int *)(param_3 + 0x18)) && (1 < iVar5)) {
          iVar8 = (int)*(short *)(lVar11 + 0xaa4 + param_1);
          if (iVar5 <= iVar8) goto LAB_140261287;
          if (iVar5 < iVar8 + *param_5) {
            sVar2 = *(short *)(lVar11 + 0xaa4 + param_1);
            local_180[0] = iVar5 - sVar2;
            *(short *)(lVar11 + 0xaa4 + param_1) = sVar2 + (short)local_180[0];
            FUN_140090020(param_6,param_3);
            *(short *)(param_6 + 0x1c) = *(short *)(param_6 + 0x1c) - (short)local_180[0];
            local_b8 = *(undefined4 *)(param_2 + 0x160);
            local_b4 = *(undefined4 *)(param_2 + 0x164);
            local_b0 = *(undefined4 *)(param_2 + 0x168);
            local_ac = *(undefined4 *)(param_2 + 0x16c);
            local_98 = *(undefined4 *)(param_2 + 0x170);
            local_94 = *(undefined4 *)(param_2 + 0x174);
            local_90 = *(undefined4 *)(param_2 + 0x178);
            local_8c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
              local_190 = (undefined2)iVar5;
              plVar9 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                       0x70);
              (**(code **)(*plVar9 + 0x140))
                        (plVar9,1,&DAT_1405d85a0,&local_190,&local_98,&local_b8,
                         ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xa88 + param_1);
            }
            local_18c = (undefined2)*param_4;
            plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            lVar15 = ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac;
            lVar11 = lVar15 + 0xaa8 + param_1;
            lVar16 = lVar15 + 0xaa4 + param_1;
            lVar14 = lVar15 + 0xaa0 + param_1;
            lVar15 = lVar15 + 0xa88 + param_1;
            puVar21 = &param_7;
            (**(code **)(*plVar9 + 0x2e0))
                      (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_18c,lVar15,lVar14,
                       lVar16,lVar11,puVar21);
            uVar20 = (undefined4)((ulonglong)lVar15 >> 0x20);
            uVar23 = (undefined4)((ulonglong)lVar14 >> 0x20);
            uVar26 = (undefined4)((ulonglong)lVar16 >> 0x20);
            uVar27 = (undefined4)((ulonglong)lVar11 >> 0x20);
          }
          else {
            psVar1 = (short *)(lVar11 + 0xaa4 + param_1);
            *psVar1 = *psVar1 + (short)*param_5;
            local_a8 = *(undefined4 *)(param_2 + 0x160);
            local_a4 = *(undefined4 *)(param_2 + 0x164);
            local_a0 = *(undefined4 *)(param_2 + 0x168);
            local_9c = *(undefined4 *)(param_2 + 0x16c);
            local_118 = *(undefined4 *)(param_2 + 0x170);
            local_114 = *(undefined4 *)(param_2 + 0x174);
            local_110 = *(undefined4 *)(param_2 + 0x178);
            local_10c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
              local_186 = (undefined2)iVar5;
              plVar9 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                       0x70);
              (**(code **)(*plVar9 + 0x140))
                        (plVar9,1,&DAT_1405d85a0,&local_186,&local_118,&local_a8,
                         ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac + 0xa88 + param_1);
            }
            local_198 = (undefined2)*param_4;
            plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            lVar14 = ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac;
            lVar11 = lVar14 + 0xaa8 + param_1;
            uVar24 = lVar14 + 0xaa4 + param_1;
            lVar16 = lVar14 + 0xaa0 + param_1;
            lVar14 = lVar14 + 0xa88 + param_1;
            puVar21 = &param_7;
            (**(code **)(*plVar9 + 0x2e0))
                      (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_198,lVar14,lVar16,
                       uVar24,lVar11,puVar21);
            uVar20 = (undefined4)((ulonglong)lVar14 >> 0x20);
            uVar26 = (undefined4)(uVar24 >> 0x20);
            uVar23 = (undefined4)((ulonglong)lVar16 >> 0x20);
            uVar27 = (undefined4)((ulonglong)lVar11 >> 0x20);
            uVar28 = (undefined4)((ulonglong)puVar21 >> 0x20);
            if ((int)*(short *)(param_3 + 0x1c) == *param_5) {
              local_f8 = *(undefined4 *)(param_2 + 0x160);
              local_f4 = *(undefined4 *)(param_2 + 0x164);
              local_f0 = *(undefined4 *)(param_2 + 0x168);
              local_ec = *(undefined4 *)(param_2 + 0x16c);
              local_d8 = *(undefined4 *)(param_2 + 0x170);
              local_d4 = *(undefined4 *)(param_2 + 0x174);
              local_d0 = *(undefined4 *)(param_2 + 0x178);
              local_cc = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              local_140[0] = 0xffffffff;
              local_180[0] = -0xe;
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
                local_194 = (undefined2)iVar5;
                plVar9 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                puVar6 = local_140;
                piVar13 = local_180;
                puVar21 = &local_f8;
                uVar24 = param_3;
                (**(code **)(*plVar9 + 0x130))
                          (plVar9,1,&DAT_1405d85a0,&local_194,&local_d8,puVar21,param_3,piVar13,
                           puVar6);
                uVar23 = (undefined4)((ulonglong)puVar21 >> 0x20);
                uVar27 = (undefined4)((ulonglong)piVar13 >> 0x20);
                uVar28 = (undefined4)((ulonglong)puVar6 >> 0x20);
              }
              puVar21 = (undefined4 *)CONCAT44(uVar28,*param_4);
              uVar25 = CONCAT44(uVar27,(int)*(short *)(param_3 + 0x16));
              uVar22 = CONCAT44(uVar23,(int)*(short *)(param_3 + 0x1c));
              uVar7 = 0x1c3;
              uVar12 = 0xc;
              param_6 = param_3;
              goto LAB_14026115a;
            }
          }
        }
        else {
          FUN_140090020(param_6,lVar11 + 0xa88 + param_1);
          FUN_140090020((*param_4 + local_178) * 0xac + 0xa88 + param_1,param_3);
          local_58 = *(undefined4 *)(param_2 + 0x160);
          local_54 = *(undefined4 *)(param_2 + 0x164);
          local_50 = *(undefined4 *)(param_2 + 0x168);
          local_4c = *(undefined4 *)(param_2 + 0x16c);
          local_68 = *(undefined4 *)(param_2 + 0x170);
          local_64 = *(undefined4 *)(param_2 + 0x174);
          local_60 = *(undefined4 *)(param_2 + 0x178);
          local_5c = *(undefined4 *)(param_2 + 0x17c);
          iVar5 = *(int *)(param_2 + 0x284);
          local_170[0] = *param_4;
          local_178 = CONCAT44(local_178._4_4_,0xb);
          if ((-1 < iVar5) &&
             ((iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700) &&
              (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)))) {
            local_188 = (undefined2)iVar5;
            plVar9 = (longlong *)
                     (*(longlong *)
                       (*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70)
            ;
            (**(code **)(*plVar9 + 0x130))
                      (plVar9,1,&DAT_1405d85a0,&local_188,&local_68,&local_58,
                       ((longlong)param_7 * 0x20 + (longlong)local_170[0]) * 0xac + 0xa88 + param_1,
                       &local_178,local_170);
          }
          local_184 = (undefined2)*param_4;
          plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
          lVar14 = ((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac;
          lVar11 = lVar14 + 0xaa8 + param_1;
          uVar24 = lVar14 + 0xaa4 + param_1;
          lVar16 = lVar14 + 0xaa0 + param_1;
          puVar6 = &param_7;
          (**(code **)(*plVar9 + 0x2e0))
                    (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_184,
                     lVar14 + 0xa88 + param_1,lVar16,uVar24,lVar11,puVar6);
          puVar21 = (undefined4 *)
                    CONCAT44((int)((ulonglong)puVar6 >> 0x20),(int)*(short *)(param_3 + 0x16));
          uVar25 = CONCAT44((int)((ulonglong)lVar11 >> 0x20),(int)*(short *)(param_6 + 0x16));
          uVar22 = CONCAT44((int)((ulonglong)lVar16 >> 0x20),(int)*(short *)(param_6 + 0x1c));
          uVar7 = 0x1c5;
          uVar12 = 0x20;
LAB_14026115a:
          uVar24 = uVar24 & 0xffffffff00000000;
          FUN_140203700(*(undefined8 *)(param_2 + 0xb50),uVar7,uVar12,param_2,param_6,uVar22,uVar24,
                        uVar25,puVar21);
          uVar20 = (undefined4)(param_6 >> 0x20);
          uVar23 = (undefined4)((ulonglong)uVar22 >> 0x20);
          uVar26 = (undefined4)(uVar24 >> 0x20);
          uVar27 = (undefined4)((ulonglong)uVar25 >> 0x20);
        }
        puVar6 = (undefined4 *)CONCAT44(uVar26,*(undefined4 *)(*plVar17 + 0x50a0));
        FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,400,CONCAT44(uVar20,9),
                      CONCAT44(uVar23,*(undefined4 *)
                                       (((longlong)param_7 * 0x20 + (longlong)*param_4) * 0xac +
                                        0xaa0 + param_1)),puVar6,
                      CONCAT44(uVar27,*(undefined4 *)(*plVar17 + 0x50a0)),
                      (ulonglong)puVar21 & 0xffffffff00000000,0);
        sVar2 = *(short *)(param_3 + 0x16);
        iVar5 = *param_4;
LAB_1402611df:
        FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c5,0x1f,param_2,param_3,*param_5,
                      (ulonglong)puVar6 & 0xffffffff00000000,(int)sVar2,iVar5);
        FUN_14025f030(param_1,param_7,*param_4,1);
        LOCK();
        plVar17 = plVar17 + 1;
        lVar11 = *plVar17;
        *(int *)plVar17 = (int)*plVar17 + -1;
        UNLOCK();
        if ((int)lVar11 == 1) {
          pvVar4 = (void *)*local_150;
          if (pvVar4 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar4 + 0xf630);
            operator_delete(pvVar4);
          }
          operator_delete(local_150);
        }
        return 1;
      }
    }
    else {
      iVar5 = DAT_140608048 + 1;
      bVar18 = DAT_140608048 == 0;
      DAT_140608048 = iVar5;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar17 == (longlong *)0x0) {
    return 0;
  }
  if (plVar17 != local_148) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 0;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_140261287:
  LOCK();
  plVar17 = plVar17 + 1;
  *(int *)plVar17 = (int)*plVar17 + -1;
  UNLOCK();
  if ((int)*plVar17 == 0) {
    pvVar4 = (void *)*local_150;
    if (pvVar4 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar4 + 0xf630);
      operator_delete(pvVar4);
    }
    operator_delete(local_150);
  }
  return 0;
}



undefined4 * FUN_1402612e0(longlong param_1,undefined4 *param_2,uint param_3,uint param_4)

{
  int iVar1;
  longlong lVar2;
  
  FUN_14034ed40(param_1 + 0x4b18);
  if (param_3 < 3) {
    if (param_4 < 0x20) {
      iVar1 = FUN_14025efa0(param_1,param_3,param_4);
      if (iVar1 == 2) {
        lVar2 = (longlong)(int)param_3 * 0x20 + (longlong)(int)param_4;
        *param_2 = *(undefined4 *)(param_1 + 0x188 + lVar2 * 0x18);
        param_2[1] = *(undefined4 *)(param_1 + 0x18c + lVar2 * 0x18);
        param_2[2] = *(undefined4 *)(param_1 + 400 + lVar2 * 0x18);
        param_2[3] = *(undefined4 *)(param_1 + 0x194 + lVar2 * 0x18);
        goto LAB_1402613c9;
      }
    }
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
  }
  else {
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
  }
LAB_1402613c9:
  FUN_14034edd0(param_1 + 0x4b18);
  return param_2;
}



void FUN_1402613f0(longlong param_1,longlong param_2)

{
  int *piVar1;
  code *pcVar2;
  int iVar3;
  undefined4 uVar4;
  ulonglong uVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong lVar9;
  undefined4 *puVar10;
  longlong lVar11;
  undefined4 *puVar12;
  longlong lVar13;
  int iVar14;
  uint uVar15;
  longlong local_res18;
  uint local_res20 [2];
  undefined8 uVar16;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  longlong local_90;
  undefined1 local_88;
  undefined4 *local_80;
  undefined4 *local_78;
  undefined4 *local_70;
  int *local_60;
  int *local_58;
  int *local_50;
  
  uVar16 = 0xfffffffffffffffe;
  uVar15 = 0;
  local_res18 = 0;
  do {
    lVar9 = local_res18;
    local_90 = param_1 + 0x4b18;
    local_60 = (int *)0x0;
    local_58 = (int *)0x0;
    local_50 = (int *)0x0;
    local_80 = (undefined4 *)0x0;
    local_78 = (undefined4 *)0x0;
    local_70 = (undefined4 *)0x0;
    FUN_14034ed40(local_90);
    local_88 = 1;
    if (uVar15 < 3) {
      iVar14 = 0;
      lVar11 = 0;
      lVar13 = lVar9 * 0x20;
      puVar12 = local_80;
      do {
        piVar1 = (int *)(param_1 + (lVar11 + 2 + lVar13) * 4);
        if ((piVar1 < local_58) && (local_60 <= piVar1)) {
          lVar9 = (longlong)piVar1 - (longlong)local_60;
          if (local_58 == local_50) {
            uVar5 = (longlong)local_58 - (longlong)local_60 >> 2;
            if (0x3ffffffffffffffe < uVar5) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar5 = uVar5 + 1;
            uVar7 = (longlong)local_50 - (longlong)local_60 >> 2;
            if (uVar7 < uVar5) {
              if (0x3fffffffffffffff - (uVar7 >> 1) < uVar7) {
                uVar7 = 0;
              }
              else {
                uVar7 = uVar7 + (uVar7 >> 1);
              }
              if (uVar7 < uVar5) {
                uVar7 = uVar5;
              }
              FUN_140051e60(&local_60,uVar7);
              puVar12 = local_80;
            }
          }
          if (local_58 != (int *)0x0) {
            iVar3 = local_60[lVar9 >> 2];
LAB_1402615b8:
            *local_58 = iVar3;
            puVar12 = local_80;
          }
        }
        else {
          if (local_58 == local_50) {
            uVar5 = (longlong)local_58 - (longlong)local_60 >> 2;
            if (0x3ffffffffffffffe < uVar5) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
            uVar5 = uVar5 + 1;
            uVar7 = (longlong)local_50 - (longlong)local_60 >> 2;
            if (uVar7 < uVar5) {
              if (0x3fffffffffffffff - (uVar7 >> 1) < uVar7) {
                uVar7 = 0;
              }
              else {
                uVar7 = uVar7 + (uVar7 >> 1);
              }
              if (uVar7 < uVar5) {
                uVar7 = uVar5;
              }
              FUN_140051e60(&local_60,uVar7);
              puVar12 = local_80;
            }
          }
          if (local_58 != (int *)0x0) {
            iVar3 = *piVar1;
            goto LAB_1402615b8;
          }
        }
        local_58 = local_58 + 1;
        if (*piVar1 == 1) {
          puVar10 = (undefined4 *)((lVar11 + lVar13) * 0xac + 0xa88 + param_1);
          if ((puVar10 < local_78) && (puVar12 <= puVar10)) {
            uVar5 = (longlong)puVar10 - (longlong)puVar12;
            if (local_78 == local_70) {
              uVar7 = (longlong)local_78 - (longlong)puVar12 >> 4;
              if (0xffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                pcVar2 = (code *)swi(3);
                (*pcVar2)();
                return;
              }
              goto LAB_140261620;
            }
            goto LAB_140261666;
          }
          if (local_78 == local_70) {
            uVar5 = (longlong)local_78 - (longlong)puVar12 >> 4;
            if (0xffffffffffffffe < uVar5) {
              std::_Xlength_error("vector<T> too long");
              pcVar2 = (code *)swi(3);
              (*pcVar2)();
              return;
            }
LAB_1402616b7:
            uVar5 = uVar5 + 1;
            uVar7 = (longlong)local_70 - (longlong)puVar12 >> 4;
            if (uVar7 < uVar5) {
              if (0xfffffffffffffff - (uVar7 >> 1) < uVar7) {
                uVar7 = 0;
              }
              else {
                uVar7 = uVar7 + (uVar7 >> 1);
              }
              if (uVar7 < uVar5) {
                uVar7 = uVar5;
              }
              FUN_1402d2250(&local_80,uVar7);
              puVar12 = local_80;
            }
          }
LAB_14026166d:
          if (local_78 != (undefined4 *)0x0) {
            *local_78 = *puVar10;
            local_78[1] = puVar10[1];
            local_78[2] = puVar10[2];
            uVar4 = puVar10[3];
LAB_14026185c:
            local_78[3] = uVar4;
            puVar12 = local_80;
          }
        }
        else {
          if (*piVar1 == 2) {
            puVar10 = (undefined4 *)(param_1 + 0x188 + (lVar11 + lVar13) * 0x18);
            if ((local_78 <= puVar10) || (puVar10 < puVar12)) {
              if (local_78 == local_70) {
                uVar5 = (longlong)local_78 - (longlong)puVar12 >> 4;
                if (0xffffffffffffffe < uVar5) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar2 = (code *)swi(3);
                  (*pcVar2)();
                  return;
                }
                goto LAB_1402616b7;
              }
              goto LAB_14026166d;
            }
            uVar5 = (longlong)puVar10 - (longlong)puVar12;
            if (local_78 == local_70) {
              uVar7 = (longlong)local_78 - (longlong)puVar12 >> 4;
              if (0xffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                pcVar2 = (code *)swi(3);
                (*pcVar2)();
                return;
              }
              goto LAB_140261620;
            }
LAB_140261666:
            puVar10 = (undefined4 *)((uVar5 & 0xfffffffffffffff0) + (longlong)puVar12);
            goto LAB_14026166d;
          }
          if ((&DAT_14044e480 < local_78) &&
             (puVar12 < (undefined4 *)((longlong)&DAT_14044e480 + 1))) {
            uVar5 = (longlong)&DAT_14044e480 - (longlong)puVar12;
            if (local_78 == local_70) {
              uVar7 = (longlong)local_78 - (longlong)puVar12 >> 4;
              if (0xffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                pcVar2 = (code *)swi(3);
                (*pcVar2)();
                return;
              }
LAB_140261620:
              uVar7 = uVar7 + 1;
              uVar8 = (longlong)local_70 - (longlong)puVar12 >> 4;
              if (uVar8 < uVar7) {
                if (0xfffffffffffffff - (uVar8 >> 1) < uVar8) {
                  uVar8 = 0;
                }
                else {
                  uVar8 = uVar8 + (uVar8 >> 1);
                }
                if (uVar8 < uVar7) {
                  uVar8 = uVar7;
                }
                FUN_1402d2250(&local_80,uVar8);
                puVar12 = local_80;
              }
            }
            goto LAB_140261666;
          }
          if (local_78 == local_70) {
            uVar5 = (longlong)local_78 - (longlong)puVar12 >> 4;
            if (0xffffffffffffffe < uVar5) {
              std::_Xlength_error("vector<T> too long");
              return;
            }
            uVar5 = uVar5 + 1;
            uVar7 = (longlong)local_70 - (longlong)puVar12 >> 4;
            if (uVar7 < uVar5) {
              if (0xfffffffffffffff - (uVar7 >> 1) < uVar7) {
                uVar7 = 0;
              }
              else {
                uVar7 = uVar7 + (uVar7 >> 1);
              }
              if (uVar7 < uVar5) {
                uVar7 = uVar5;
              }
              FUN_1402d2250(&local_80,uVar7);
              puVar12 = local_80;
            }
          }
          if (local_78 != (undefined4 *)0x0) {
            *local_78 = 0;
            local_78[1] = 0;
            local_78[2] = 0;
            uVar4 = 0;
            goto LAB_14026185c;
          }
        }
        local_78 = local_78 + 4;
        iVar14 = iVar14 + 1;
        lVar11 = lVar11 + 1;
        lVar9 = local_res18;
      } while (iVar14 < 0x20);
    }
    FUN_14034edd0(param_1 + 0x4b18);
    local_88 = 0;
    local_a0 = *(undefined4 *)(param_2 + 0x170);
    local_9c = *(undefined4 *)(param_2 + 0x174);
    local_98 = *(undefined4 *)(param_2 + 0x178);
    local_94 = *(undefined4 *)(param_2 + 0x17c);
    iVar14 = *(int *)(param_2 + 0x284);
    local_res20[0] = uVar15;
    if (((-1 < iVar14) && (iVar14 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
       (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
      local_res18 = CONCAT62(local_res18._2_6_,(short)iVar14);
      plVar6 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar6 + 0x290))
                (plVar6,1,&DAT_1405d85a0,&local_res18,&local_a0,&local_60,&local_80,local_res20,
                 uVar16);
    }
    if (local_80 != (undefined4 *)0x0) {
      operator_delete(local_80);
    }
    local_80 = (undefined4 *)0x0;
    local_78 = (undefined4 *)0x0;
    local_70 = (undefined4 *)0x0;
    if (local_60 != (int *)0x0) {
      operator_delete(local_60);
    }
    uVar15 = uVar15 + 1;
    local_res18 = lVar9 + 1;
    if (2 < (int)uVar15) {
      return;
    }
  } while( true );
}



void FUN_140261a10(longlong param_1,longlong param_2,undefined4 *param_3,int param_4,int param_5,
                  longlong param_6)

{
  ulonglong *puVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  uint uVar5;
  ulonglong uVar6;
  longlong lVar7;
  uint uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  bool bVar11;
  undefined2 local_78;
  undefined2 local_76;
  uint local_74;
  uint local_70 [2];
  ulonglong local_68;
  undefined8 local_60;
  ulonglong local_58;
  undefined1 local_50;
  
  local_60 = 0xfffffffffffffffe;
  puVar1 = *(ulonglong **)(param_2 + 0xb28);
  uVar10 = 0;
  local_68 = uVar10;
  if (puVar1 != (ulonglong *)0x0) {
    if (puVar1 == *(ulonglong **)(param_2 + 0xb30)) {
      local_68 = *puVar1;
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  local_58 = local_68;
  FUN_14034ed40(local_68);
  local_50 = 1;
  local_70[0] = 0;
  local_74 = 0;
  uVar6 = uVar10;
  uVar9 = uVar10;
  do {
    uVar5 = local_74;
    lVar4 = (longlong)(int)local_74;
    FUN_14034ed40(param_1 + 0x4b18);
    if ((uVar5 < 3) && ((uint)uVar6 < 0x20)) {
      iVar2 = *(int *)(param_1 + 8 + (lVar4 * 0x20 + uVar9) * 4);
      FUN_14034edd0(param_1 + 0x4b18);
      if (iVar2 == 2) {
        lVar4 = (longlong)(int)local_74 * 0x20 + uVar9;
        plVar3 = (longlong *)(param_1 + 0x188 + lVar4 * 0x18);
        if ((*plVar3 != 0) || (bVar11 = false, plVar3[1] != 0)) {
          bVar11 = true;
        }
        if (((bVar11) && (*(int *)(param_1 + (lVar4 * 3 + 0x33) * 8) == param_4)) &&
           (*(int *)(param_1 + 0x19c + lVar4 * 0x18) < param_5)) {
          *(undefined4 *)plVar3 = *param_3;
          *(undefined4 *)((longlong)plVar3 + 4) = param_3[1];
          *(undefined4 *)(plVar3 + 1) = param_3[2];
          *(undefined4 *)((longlong)plVar3 + 0xc) = param_3[3];
          *(int *)(param_1 + 0x19c + ((longlong)(int)local_74 * 0x20 + uVar9) * 0x18) = param_5;
          lVar4 = (longlong)(int)local_74 * 0x20 + uVar9;
          local_78 = *(undefined2 *)(param_1 + 0x19c + lVar4 * 0x18);
          local_76 = (undefined2)uVar6;
          plVar3 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
          (**(code **)(*plVar3 + 0x360))
                    (plVar3,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_76,
                     param_1 + 0x188 + lVar4 * 0x18,param_1 + (lVar4 * 3 + 0x33) * 8,&local_78,
                     &local_74);
          local_70[0] = 1;
        }
      }
    }
    else {
      FUN_14034edd0(param_1 + 0x4b18);
    }
    uVar5 = (uint)uVar6 + 1;
    uVar6 = (ulonglong)uVar5;
    uVar9 = uVar9 + 1;
  } while (((int)uVar5 < 0x20) ||
          (local_74 = local_74 + 1, uVar6 = uVar10, uVar9 = uVar10, (int)local_74 < 3));
  if (local_70[0] == 0) {
    if ((param_6 == 0) || (iVar2 = *(int *)(param_6 + 0x68), iVar2 == 4)) goto LAB_140261ef6;
    if (iVar2 == 3) {
      local_70[0] = 0;
      while( true ) {
        iVar2 = FUN_14025efa0(param_1,uVar10,uVar6);
        if (iVar2 == 0) break;
        uVar5 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar5;
        if (7 < (int)uVar5) goto LAB_140261ef6;
        uVar10 = (ulonglong)local_70[0];
      }
      lVar7 = (longlong)(int)uVar6;
      lVar4 = (longlong)(int)local_70[0] * 0x20 + lVar7;
      *(undefined4 *)(param_1 + 0x188 + lVar4 * 0x18) = *param_3;
      *(undefined4 *)(param_1 + 0x18c + lVar4 * 0x18) = param_3[1];
      *(undefined4 *)(param_1 + 400 + lVar4 * 0x18) = param_3[2];
      *(undefined4 *)(param_1 + 0x194 + lVar4 * 0x18) = param_3[3];
      *(int *)(param_1 + ((longlong)(int)local_70[0] * 0x20 + 0x11 + lVar7) * 0x18) = param_4;
      *(int *)(param_1 + 0x19c + ((longlong)(int)local_70[0] * 0x20 + lVar7) * 0x18) = param_5;
      lVar4 = (longlong)(int)local_70[0];
      FUN_14034ed40(param_1 + 0x4b18);
      *(undefined4 *)(param_1 + 8 + (lVar4 * 0x20 + lVar7) * 4) = 2;
      FUN_14034edd0(param_1 + 0x4b18);
      lVar7 = (longlong)(int)local_70[0] * 0x20 + lVar7;
      local_76 = *(undefined2 *)(param_1 + 0x19c + lVar7 * 0x18);
      lVar4 = param_1 + 0x188 + lVar7 * 0x18;
    }
    else {
      if ((iVar2 != 1) && (iVar2 != 2)) goto LAB_140261ef6;
      uVar5 = 0x14;
      uVar6 = 8;
      if (*(int *)(param_6 + 0x60) == 1) {
        uVar6 = 0x14;
        uVar5 = 0x1a;
      }
      local_70[0] = 0;
      if (uVar5 <= (uint)uVar6) goto LAB_140261ef6;
      while( true ) {
        iVar2 = FUN_14025efa0(param_1,uVar10,uVar6);
        if (iVar2 == 0) break;
        uVar8 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar8;
        if ((int)uVar5 <= (int)uVar8) goto LAB_140261ef6;
        uVar10 = (ulonglong)local_70[0];
      }
      lVar7 = (longlong)(int)uVar6;
      lVar4 = (longlong)(int)local_70[0] * 0x20 + lVar7;
      *(undefined4 *)(param_1 + 0x188 + lVar4 * 0x18) = *param_3;
      *(undefined4 *)(param_1 + 0x18c + lVar4 * 0x18) = param_3[1];
      *(undefined4 *)(param_1 + 400 + lVar4 * 0x18) = param_3[2];
      *(undefined4 *)(param_1 + 0x194 + lVar4 * 0x18) = param_3[3];
      *(int *)(param_1 + ((longlong)(int)local_70[0] * 0x20 + 0x11 + lVar7) * 0x18) = param_4;
      *(int *)(param_1 + 0x19c + ((longlong)(int)local_70[0] * 0x20 + lVar7) * 0x18) = param_5;
      lVar4 = (longlong)(int)local_70[0];
      FUN_14034ed40(param_1 + 0x4b18);
      *(undefined4 *)(param_1 + 8 + (lVar4 * 0x20 + lVar7) * 4) = 2;
      FUN_14034edd0(param_1 + 0x4b18);
      lVar7 = (longlong)(int)local_70[0] * 0x20 + lVar7;
      local_76 = *(undefined2 *)(param_1 + 0x19c + lVar7 * 0x18);
      lVar4 = param_1 + 0x188 + lVar7 * 0x18;
    }
    plVar3 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    local_78 = (undefined2)uVar6;
    (**(code **)(*plVar3 + 0x360))
              (plVar3,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_78,lVar4,
               param_1 + (lVar7 * 3 + 0x33) * 8,&local_76,local_70);
  }
  FUN_1402613f0(param_1,param_2);
LAB_140261ef6:
  FUN_14034edd0(local_68);
  return;
}



undefined8
FUN_140261f20(longlong param_1,longlong param_2,undefined4 *param_3,undefined4 param_4,
             undefined4 param_5,int *param_6,int param_7,uint param_8)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined2 local_res8 [4];
  undefined2 local_38 [4];
  undefined8 local_30;
  longlong local_28;
  undefined1 local_20;
  
  local_30 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x4b18;
  local_28 = lVar1;
  FUN_14034ed40(lVar1);
  local_20 = 1;
  if (param_8 < 3) {
    iVar2 = *param_6;
    if ((-1 < iVar2) && (iVar2 < 0x20)) {
      lVar3 = (longlong)(int)param_8 * 0x20 + (longlong)iVar2;
      *(undefined4 *)(param_1 + 0x188 + lVar3 * 0x18) = *param_3;
      *(undefined4 *)(param_1 + 0x18c + lVar3 * 0x18) = param_3[1];
      *(undefined4 *)(param_1 + 400 + lVar3 * 0x18) = param_3[2];
      *(undefined4 *)(param_1 + 0x194 + lVar3 * 0x18) = param_3[3];
      *(undefined4 *)(param_1 + ((longlong)(int)param_8 * 0x20 + 0x11 + (longlong)*param_6) * 0x18)
           = param_4;
      *(undefined4 *)(param_1 + 0x19c + ((longlong)(int)param_8 * 0x20 + (longlong)*param_6) * 0x18)
           = param_5;
      FUN_14025f030(param_1,param_8,*param_6,2);
      lVar3 = (longlong)(int)param_8 * 0x20 + (longlong)*param_6;
      local_res8[0] = *(undefined2 *)(param_1 + 0x19c + lVar3 * 0x18);
      local_38[0] = (undefined2)*param_6;
      plVar4 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
      (**(code **)(*plVar4 + 0x360))
                (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_38,
                 param_1 + 0x188 + lVar3 * 0x18,param_1 + (lVar3 * 3 + 0x33) * 8,local_res8,&param_8
                );
      if (param_7 != 0) {
        FUN_1402613f0(param_1,param_2);
      }
      FUN_14034edd0(lVar1);
      return 1;
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



undefined8
FUN_140262100(longlong param_1,longlong param_2,int *param_3,ulonglong *param_4,uint param_5)

{
  longlong lVar1;
  ulonglong *puVar2;
  int iVar3;
  longlong *plVar4;
  bool bVar5;
  undefined2 local_res8 [4];
  
  lVar1 = param_1 + 0x4b18;
  FUN_14034ed40(lVar1);
  if (param_5 < 3) {
    iVar3 = *param_3;
    if ((-1 < iVar3) && (iVar3 < 0x20)) {
      puVar2 = (ulonglong *)
               (param_1 + 0x188 + ((longlong)(int)param_5 * 0x20 + (longlong)iVar3) * 0x18);
      bVar5 = *puVar2 < *param_4;
      if ((*puVar2 == *param_4) && (bVar5 = puVar2[1] < param_4[1], puVar2[1] == param_4[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
      }
      if (iVar3 == 0) {
        *(undefined4 *)puVar2 = 0;
        *(undefined4 *)((longlong)puVar2 + 4) = 0;
        *(undefined4 *)(puVar2 + 1) = 0;
        *(undefined4 *)((longlong)puVar2 + 0xc) = 0;
        puVar2[2] = 0;
        FUN_14025f030(param_1,param_5,*param_3,0);
        local_res8[0] = (undefined2)*param_3;
        plVar4 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar4 + 0x370))
                  (plVar4,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res8,&param_5);
        FUN_1402613f0(param_1,param_2);
        FUN_14034edd0(lVar1);
        return 1;
      }
    }
  }
  FUN_14034edd0(lVar1);
  return 0;
}



undefined8
FUN_140262270(longlong param_1,longlong param_2,uint param_3,uint param_4,int param_5,int param_6,
             uint param_7)

{
  longlong lVar1;
  ulonglong *puVar2;
  short sVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong *plVar8;
  ulonglong uVar9;
  longlong lVar10;
  longlong lVar11;
  longlong lVar12;
  bool bVar13;
  int *local_res8;
  undefined8 in_stack_fffffffffffffea0;
  undefined4 *puVar14;
  undefined4 uVar15;
  ulonglong in_stack_fffffffffffffea8;
  undefined8 in_stack_fffffffffffffeb0;
  int **ppiVar16;
  undefined4 uVar17;
  uint uVar18;
  undefined8 in_stack_fffffffffffffeb8;
  int **ppiVar19;
  undefined4 uVar20;
  int *local_138;
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  ulonglong *local_110;
  undefined4 local_108;
  undefined4 local_104;
  undefined8 local_100;
  longlong local_f8;
  undefined1 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar15 = (undefined4)((ulonglong)in_stack_fffffffffffffea0 >> 0x20);
  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffeb8 >> 0x20);
  local_100 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x4b18;
  local_f8 = lVar1;
  FUN_14034ed40(lVar1);
  local_f0 = 1;
  if ((((2 < param_7) || (0x1f < param_3)) || (0x1f < param_4)) ||
     ((param_5 == 3 || (param_6 == 3)))) {
LAB_140262e2e:
    FUN_14034edd0(lVar1);
    return 0;
  }
  lVar12 = (longlong)(int)param_7 * 0x20 + (longlong)(int)param_3;
  local_138 = (int *)(param_1 + 8 + lVar12 * 4);
  if (*local_138 != param_5) goto LAB_140262e2e;
  lVar10 = (longlong)(int)param_7 * 0x20 + (longlong)(int)param_4;
  local_res8 = (int *)(param_1 + 8 + lVar10 * 4);
  if (*local_res8 != param_6) goto LAB_140262e2e;
  if (param_5 == 0) {
    if (((param_6 != 0) && (param_6 != 1)) && (param_6 != 2)) goto LAB_140262e0d;
    goto LAB_140262e2e;
  }
  if (param_5 == 1) {
    uVar18 = param_4;
    if (param_6 == 0) {
      lVar12 = lVar12 * 0xac + 0xa88 + param_1;
      uVar9 = lVar10 * 0xac + 0xa88 + param_1;
      FUN_140090020(uVar9,lVar12);
      FUN_14000a170(local_e8);
      local_40 = 0;
      FUN_140090020(lVar12,local_e8);
      *local_res8 = 1;
      *local_138 = 0;
      local_110 = *(ulonglong **)(param_2 + 0x160);
      local_108 = *(undefined4 *)(param_2 + 0x168);
      local_104 = *(undefined4 *)(param_2 + 0x16c);
      local_130 = *(undefined4 *)(param_2 + 0x170);
      local_12c = *(undefined4 *)(param_2 + 0x174);
      local_128 = *(undefined4 *)(param_2 + 0x178);
      local_124 = *(undefined4 *)(param_2 + 0x17c);
      iVar7 = *(int *)(param_2 + 0x284);
      local_res8 = (int *)CONCAT44(local_res8._4_4_,param_4);
      local_138 = (int *)CONCAT44(local_138._4_4_,0xb);
      if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar12 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar12 != 0)) {
        param_7 = CONCAT22(param_7._2_2_,(short)iVar7);
        plVar8 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        in_stack_fffffffffffffea8 = uVar9;
        (**(code **)(*plVar8 + 0x130))
                  (plVar8,1,&DAT_1405d85a0,&param_7,&local_130,&local_110,uVar9,&local_138,
                   &local_res8);
      }
      iVar7 = (int)*(short *)(lVar10 * 0xac + 0xaa4 + param_1);
      in_stack_fffffffffffffea8 = in_stack_fffffffffffffea8 & 0xffffffff00000000;
      param_4 = param_3;
    }
    else {
      if (param_6 != 1) {
        if (param_6 != 2) goto LAB_140262e0d;
        *(undefined4 *)(param_1 + 0x188 + lVar12 * 0x18) =
             *(undefined4 *)(param_1 + 0x188 + lVar10 * 0x18);
        *(undefined4 *)(param_1 + 0x18c + lVar12 * 0x18) =
             *(undefined4 *)(param_1 + 0x18c + lVar10 * 0x18);
        *(undefined4 *)(param_1 + 400 + lVar12 * 0x18) =
             *(undefined4 *)(param_1 + 400 + lVar10 * 0x18);
        *(undefined4 *)(param_1 + 0x194 + lVar12 * 0x18) =
             *(undefined4 *)(param_1 + 0x194 + lVar10 * 0x18);
        *(undefined4 *)(param_1 + 0x198 + lVar12 * 0x18) =
             *(undefined4 *)(param_1 + 0x198 + lVar10 * 0x18);
        *(undefined4 *)(param_1 + 0x19c + lVar12 * 0x18) =
             *(undefined4 *)(param_1 + 0x19c + lVar10 * 0x18);
        lVar12 = lVar12 * 0xac + 0xa88 + param_1;
        lVar11 = lVar10 * 0xac;
        FUN_140090020(lVar11 + 0xa88 + param_1,lVar12);
        FUN_14000a170(local_e8);
        local_40 = 0;
        FUN_140090020(lVar12,local_e8);
        *(undefined4 *)(param_1 + 0x188 + lVar10 * 0x18) = 0;
        *(undefined4 *)(param_1 + 0x18c + lVar10 * 0x18) = 0;
        *(undefined4 *)(param_1 + 400 + lVar10 * 0x18) = 0;
        *(undefined4 *)(param_1 + 0x194 + lVar10 * 0x18) = 0;
        *(undefined8 *)(param_1 + 0x198 + lVar10 * 0x18) = 0;
        *local_138 = 2;
        *local_res8 = 1;
        local_120 = *(undefined4 *)(param_2 + 0x160);
        local_11c = *(undefined4 *)(param_2 + 0x164);
        local_118 = *(undefined4 *)(param_2 + 0x168);
        local_114 = *(undefined4 *)(param_2 + 0x16c);
        local_130 = *(undefined4 *)(param_2 + 0x170);
        local_12c = *(undefined4 *)(param_2 + 0x174);
        local_128 = *(undefined4 *)(param_2 + 0x178);
        local_124 = *(undefined4 *)(param_2 + 0x17c);
        iVar7 = *(int *)(param_2 + 0x284);
        local_res8 = (int *)CONCAT44(local_res8._4_4_,param_4);
        local_138 = (int *)CONCAT44(local_138._4_4_,0xb);
        uVar9 = lVar11 + 0xa88 + param_1;
        if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
           (lVar12 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar12 != 0)) {
          param_7 = CONCAT22(param_7._2_2_,(short)iVar7);
          plVar8 = (longlong *)
                   (*(longlong *)
                     (*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
          in_stack_fffffffffffffea8 = uVar9;
          (**(code **)(*plVar8 + 0x130))
                    (plVar8,1,&DAT_1405d85a0,&param_7,&local_130,&local_120,uVar9,&local_138,
                     &local_res8);
        }
        sVar3 = *(short *)(lVar11 + 0xaa4 + param_1);
        param_4 = param_3;
        goto LAB_140262d23;
      }
      lVar12 = lVar12 * 0xac;
      puVar2 = (ulonglong *)(lVar12 + 0xa88 + param_1);
      lVar10 = lVar10 * 0xac;
      local_110 = (ulonglong *)(lVar10 + 0xa88 + param_1);
      uVar9 = *puVar2;
      bVar13 = *local_110 < uVar9;
      if ((*local_110 == uVar9) &&
         (uVar9 = puVar2[1], bVar13 = local_110[1] < uVar9, local_110[1] == uVar9)) {
        iVar7 = 0;
      }
      else {
        iVar7 = (1 - (uint)bVar13) - (uint)(bVar13 != 0);
      }
      if (iVar7 == 0) goto LAB_140262e2e;
      memcpy(local_e8,local_110,0xac);
      FUN_140090020(lVar10 + 0xa88 + param_1,lVar12 + 0xa88 + param_1);
      FUN_140090020(lVar12 + 0xa88 + param_1,local_e8);
      local_130 = *(undefined4 *)(param_2 + 0x160);
      local_12c = *(undefined4 *)(param_2 + 0x164);
      local_128 = *(undefined4 *)(param_2 + 0x168);
      local_124 = *(undefined4 *)(param_2 + 0x16c);
      local_120 = *(undefined4 *)(param_2 + 0x170);
      local_11c = *(undefined4 *)(param_2 + 0x174);
      local_118 = *(undefined4 *)(param_2 + 0x178);
      local_114 = *(undefined4 *)(param_2 + 0x17c);
      iVar7 = *(int *)(param_2 + 0x284);
      local_138._0_4_ = 0xb;
      if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
        param_7 = CONCAT22(param_7._2_2_,(short)iVar7);
        plVar8 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        ppiVar19 = &local_res8;
        ppiVar16 = &local_138;
        in_stack_fffffffffffffea8 = lVar10 + 0xa88 + param_1;
        puVar14 = &local_130;
        local_res8._0_4_ = param_4;
        (**(code **)(*plVar8 + 0x130))
                  (plVar8,1,&DAT_1405d85a0,&param_7,&local_120,puVar14,in_stack_fffffffffffffea8,
                   ppiVar16,ppiVar19);
        uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
        uVar17 = (undefined4)((ulonglong)ppiVar16 >> 0x20);
        uVar20 = (undefined4)((ulonglong)ppiVar19 >> 0x20);
      }
      local_120 = *(undefined4 *)(param_2 + 0x160);
      local_11c = *(undefined4 *)(param_2 + 0x164);
      local_118 = *(undefined4 *)(param_2 + 0x168);
      local_114 = *(undefined4 *)(param_2 + 0x16c);
      local_130 = *(undefined4 *)(param_2 + 0x170);
      local_12c = *(undefined4 *)(param_2 + 0x174);
      local_128 = *(undefined4 *)(param_2 + 0x178);
      local_124 = *(undefined4 *)(param_2 + 0x17c);
      iVar7 = *(int *)(param_2 + 0x284);
      local_res8 = (int *)CONCAT44(local_res8._4_4_,param_3);
      local_138 = (int *)CONCAT44(local_138._4_4_,0xb);
      if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar11 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar11 != 0)) {
        param_7 = CONCAT22(param_7._2_2_,(short)iVar7);
        plVar8 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar11 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        ppiVar19 = &local_res8;
        ppiVar16 = &local_138;
        in_stack_fffffffffffffea8 = lVar12 + 0xa88 + param_1;
        puVar14 = &local_120;
        (**(code **)(*plVar8 + 0x130))
                  (plVar8,1,&DAT_1405d85a0,&param_7,&local_130,puVar14,in_stack_fffffffffffffea8,
                   ppiVar16,ppiVar19);
        uVar15 = (undefined4)((ulonglong)puVar14 >> 0x20);
        uVar17 = (undefined4)((ulonglong)ppiVar16 >> 0x20);
        uVar20 = (undefined4)((ulonglong)ppiVar19 >> 0x20);
      }
      in_stack_fffffffffffffea8 = in_stack_fffffffffffffea8 & 0xffffffff00000000;
      FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c5,0x21,param_2,local_110,
                    CONCAT44(uVar15,(int)*(short *)(lVar10 + 0xaa4 + param_1)),
                    in_stack_fffffffffffffea8,CONCAT44(uVar17,param_3),CONCAT44(uVar20,param_4));
      iVar7 = (int)*(short *)(lVar12 + 0xaa4 + param_1);
      in_stack_fffffffffffffea8 = in_stack_fffffffffffffea8 & 0xffffffff00000000;
      uVar9 = lVar12 + 0xa88 + param_1;
      uVar18 = param_3;
    }
  }
  else {
    if (param_5 != 2) goto LAB_140262e0d;
    if (param_6 == 0) {
      *(undefined4 *)(param_1 + 0x188 + lVar10 * 0x18) =
           *(undefined4 *)(param_1 + 0x188 + lVar12 * 0x18);
      *(undefined4 *)(param_1 + 0x18c + lVar10 * 0x18) =
           *(undefined4 *)(param_1 + 0x18c + lVar12 * 0x18);
      *(undefined4 *)(param_1 + 400 + lVar10 * 0x18) =
           *(undefined4 *)(param_1 + 400 + lVar12 * 0x18);
      *(undefined4 *)(param_1 + 0x194 + lVar10 * 0x18) =
           *(undefined4 *)(param_1 + 0x194 + lVar12 * 0x18);
      *(undefined4 *)(param_1 + 0x198 + lVar10 * 0x18) =
           *(undefined4 *)(param_1 + 0x198 + lVar12 * 0x18);
      *(undefined4 *)(param_1 + 0x19c + lVar10 * 0x18) =
           *(undefined4 *)(param_1 + 0x19c + lVar12 * 0x18);
      *(undefined4 *)(param_1 + 0x188 + lVar12 * 0x18) = 0;
      *(undefined4 *)(param_1 + 0x18c + lVar12 * 0x18) = 0;
      *(undefined4 *)(param_1 + 400 + lVar12 * 0x18) = 0;
      *(undefined4 *)(param_1 + 0x194 + lVar12 * 0x18) = 0;
      *(undefined8 *)(param_1 + 0x198 + lVar12 * 0x18) = 0;
      *local_res8 = 2;
      *local_138 = 0;
      goto LAB_140262e0d;
    }
    if (param_6 != 1) {
      if (param_6 == 2) {
        uVar15 = *(undefined4 *)(param_1 + 0x188 + lVar10 * 0x18);
        uVar17 = *(undefined4 *)(param_1 + 0x18c + lVar10 * 0x18);
        uVar20 = *(undefined4 *)(param_1 + 400 + lVar10 * 0x18);
        uVar4 = *(undefined4 *)(param_1 + 0x194 + lVar10 * 0x18);
        uVar5 = *(undefined4 *)(param_1 + 0x198 + lVar10 * 0x18);
        uVar6 = *(undefined4 *)(param_1 + 0x19c + lVar10 * 0x18);
        *(undefined4 *)(param_1 + 0x188 + lVar10 * 0x18) =
             *(undefined4 *)(param_1 + 0x188 + lVar12 * 0x18);
        *(undefined4 *)(param_1 + 0x18c + lVar10 * 0x18) =
             *(undefined4 *)(param_1 + 0x18c + lVar12 * 0x18);
        *(undefined4 *)(param_1 + 400 + lVar10 * 0x18) =
             *(undefined4 *)(param_1 + 400 + lVar12 * 0x18);
        *(undefined4 *)(param_1 + 0x194 + lVar10 * 0x18) =
             *(undefined4 *)(param_1 + 0x194 + lVar12 * 0x18);
        *(undefined4 *)(param_1 + 0x198 + lVar10 * 0x18) =
             *(undefined4 *)(param_1 + 0x198 + lVar12 * 0x18);
        *(undefined4 *)(param_1 + 0x19c + lVar10 * 0x18) =
             *(undefined4 *)(param_1 + 0x19c + lVar12 * 0x18);
        *(undefined4 *)(param_1 + 0x188 + lVar12 * 0x18) = uVar15;
        *(undefined4 *)(param_1 + 0x18c + lVar12 * 0x18) = uVar17;
        *(undefined4 *)(param_1 + 400 + lVar12 * 0x18) = uVar20;
        *(undefined4 *)(param_1 + 0x194 + lVar12 * 0x18) = uVar4;
        *(undefined4 *)(param_1 + 0x198 + lVar12 * 0x18) = uVar5;
        *(undefined4 *)(param_1 + 0x19c + lVar12 * 0x18) = uVar6;
      }
      goto LAB_140262e0d;
    }
    *(undefined4 *)(param_1 + 0x188 + lVar10 * 0x18) =
         *(undefined4 *)(param_1 + 0x188 + lVar12 * 0x18);
    *(undefined4 *)(param_1 + 0x18c + lVar10 * 0x18) =
         *(undefined4 *)(param_1 + 0x18c + lVar12 * 0x18);
    *(undefined4 *)(param_1 + 400 + lVar10 * 0x18) = *(undefined4 *)(param_1 + 400 + lVar12 * 0x18);
    *(undefined4 *)(param_1 + 0x194 + lVar10 * 0x18) =
         *(undefined4 *)(param_1 + 0x194 + lVar12 * 0x18);
    *(undefined4 *)(param_1 + 0x198 + lVar10 * 0x18) =
         *(undefined4 *)(param_1 + 0x198 + lVar12 * 0x18);
    *(undefined4 *)(param_1 + 0x19c + lVar10 * 0x18) =
         *(undefined4 *)(param_1 + 0x19c + lVar12 * 0x18);
    lVar10 = lVar10 * 0xac + 0xa88 + param_1;
    lVar11 = lVar12 * 0xac;
    FUN_140090020(lVar11 + 0xa88 + param_1,lVar10);
    *(undefined4 *)(param_1 + 0x188 + lVar12 * 0x18) = 0;
    *(undefined4 *)(param_1 + 0x18c + lVar12 * 0x18) = 0;
    *(undefined4 *)(param_1 + 400 + lVar12 * 0x18) = 0;
    *(undefined4 *)(param_1 + 0x194 + lVar12 * 0x18) = 0;
    *(undefined8 *)(param_1 + 0x198 + lVar12 * 0x18) = 0;
    FUN_14000a170(local_e8);
    local_40 = 0;
    FUN_140090020(lVar10,local_e8);
    *local_res8 = 2;
    *local_138 = 1;
    local_120 = *(undefined4 *)(param_2 + 0x160);
    local_11c = *(undefined4 *)(param_2 + 0x164);
    local_118 = *(undefined4 *)(param_2 + 0x168);
    local_114 = *(undefined4 *)(param_2 + 0x16c);
    local_130 = *(undefined4 *)(param_2 + 0x170);
    local_12c = *(undefined4 *)(param_2 + 0x174);
    local_128 = *(undefined4 *)(param_2 + 0x178);
    local_124 = *(undefined4 *)(param_2 + 0x17c);
    iVar7 = *(int *)(param_2 + 0x284);
    local_res8 = (int *)CONCAT44(local_res8._4_4_,param_3);
    local_138 = (int *)CONCAT44(local_138._4_4_,0xb);
    uVar9 = lVar11 + 0xa88 + param_1;
    if (((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
       (lVar12 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar12 != 0)) {
      param_7 = CONCAT22(param_7._2_2_,(short)iVar7);
      plVar8 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar12 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
               0x70);
      in_stack_fffffffffffffea8 = uVar9;
      (**(code **)(*plVar8 + 0x130))
                (plVar8,1,&DAT_1405d85a0,&param_7,&local_130,&local_120,uVar9,&local_138,&local_res8
                );
    }
    sVar3 = *(short *)(lVar11 + 0xaa4 + param_1);
    uVar18 = param_3;
LAB_140262d23:
    in_stack_fffffffffffffea8 = in_stack_fffffffffffffea8 & 0xffffffff00000000;
    iVar7 = (int)sVar3;
  }
  FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c5,0x21,param_2,uVar9,iVar7,
                in_stack_fffffffffffffea8,param_4,uVar18);
LAB_140262e0d:
  FUN_1402613f0(param_1,param_2);
  FUN_14034edd0(lVar1);
  return 1;
}



undefined4 *
FUN_140262e60(longlong param_1,undefined4 *param_2,int *param_3,undefined4 *param_4,int *param_5,
             int *param_6,int param_7)

{
  undefined4 *puVar1;
  short sVar2;
  int iVar3;
  short sVar4;
  longlong lVar5;
  uint *puVar6;
  short *psVar7;
  ulonglong uVar8;
  int iVar9;
  ulonglong uVar10;
  uint uVar11;
  int iVar12;
  ulonglong uVar13;
  longlong lVar14;
  undefined8 uVar15;
  
  uVar15 = 0xfffffffffffffffe;
  uVar11 = param_4[6];
  lVar5 = FUN_140137690();
  uVar8 = 0;
  if (*(longlong *)(lVar5 + 0x88) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                            ((ulonglong)uVar11 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 0xa6)) {
      if ((puVar6[0xa8] == uVar11) && (*puVar6 == uVar11)) {
        if (puVar6 != (uint *)0x0) {
          if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar11 = puVar6[0x4c];
          goto LAB_140262f07;
        }
        break;
      }
    }
  }
  uVar11 = 1;
LAB_140262f07:
  FUN_14034ed40(param_1 + 0x4b18);
  if (param_7 < 0) {
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
    param_2[3] = 0;
  }
  else {
    uVar13 = uVar8;
    if (param_7 != 0xb) {
      if (param_7 == 0xc) {
        uVar13 = 1;
      }
      else {
        if (param_7 != 0xd) {
          *param_2 = 0;
          param_2[1] = 0;
          param_2[2] = 0;
          param_2[3] = 0;
          goto LAB_140263130;
        }
        uVar13 = 2;
      }
    }
    iVar12 = (int)uVar13;
    if (1 < (int)uVar11) {
      iVar3 = param_4[6];
      psVar7 = (short *)((longlong)iVar12 * 0x1580 + 0xaa4 + param_1);
      uVar10 = uVar8;
      do {
        iVar9 = (int)uVar10;
        if ((*(int *)(psVar7 + -2) == iVar3) && ((int)*psVar7 < (int)uVar11)) {
          lVar14 = (longlong)iVar12 * 0x20;
          lVar5 = (iVar9 + lVar14) * 0xac;
          psVar7 = (short *)(lVar5 + 0xaa4 + param_1);
          *psVar7 = *psVar7 + *(short *)(param_4 + 7);
          *(undefined4 *)(lVar5 + 0xb30 + param_1) = 6;
          if ((int)uVar11 < (int)*(short *)(lVar5 + 0xaa4 + param_1)) {
            *param_6 = iVar9;
            sVar2 = *(short *)(lVar5 + 0xaa4 + param_1);
            sVar4 = sVar2 - (short)uVar11;
            *(short *)(lVar5 + 0xaa4 + param_1) = sVar2 - sVar4;
            *(short *)(param_4 + 7) = sVar4;
            *(undefined2 *)(param_4 + 5) = 0xb;
            *(short *)((longlong)param_4 + 0x16) = (short)*param_3;
            FUN_140090020((*param_3 + lVar14) * 0xac + 0xa88 + param_1,param_4,iVar3,uVar13,uVar15);
            *(undefined4 *)(param_1 + 8 + (*param_3 + lVar14) * 4) = 1;
            *param_2 = *param_4;
            param_2[1] = param_4[1];
            param_2[2] = param_4[2];
            param_2[3] = param_4[3];
          }
          else {
            *param_5 = iVar9;
            puVar1 = (undefined4 *)(lVar5 + 0xa88 + param_1);
            FUN_140090020(param_4,puVar1,iVar3,uVar13,uVar15);
            *param_2 = *puVar1;
            param_2[1] = puVar1[1];
            param_2[2] = puVar1[2];
            param_2[3] = puVar1[3];
          }
          goto LAB_140263130;
        }
        uVar10 = (ulonglong)(iVar9 + 1);
        uVar8 = uVar8 + 1;
        psVar7 = psVar7 + 0x56;
      } while ((longlong)uVar8 < 0x20);
    }
    *(undefined4 *)(param_1 + 8 + ((longlong)*param_3 + (longlong)iVar12 * 0x20) * 4) = 1;
    *(undefined2 *)(param_4 + 5) = 0xb;
    *(short *)((longlong)param_4 + 0x16) = (short)*param_3;
    FUN_140090020(((longlong)*param_3 + (longlong)iVar12 * 0x20) * 0xac + 0xa88 + param_1,param_4);
    *param_2 = *param_4;
    param_2[1] = param_4[1];
    param_2[2] = param_4[2];
    param_2[3] = param_4[3];
  }
LAB_140263130:
  FUN_14034edd0(param_1 + 0x4b18);
  return param_2;
}



undefined8 FUN_140263160(longlong param_1,uint *param_2,undefined8 param_3)

{
  uint uVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  
  FUN_14034ed40(param_1 + 0x848);
  uVar1 = *param_2;
  if (((int)uVar1 < 0) || (0xb < (int)uVar1)) {
    FUN_14034edd0(param_1 + 0x848);
    uVar2 = 0;
  }
  else {
    if (uVar1 < 0xc) {
      puVar3 = (undefined8 *)((longlong)(int)uVar1 * 0xac + param_1);
    }
    else {
      if (DAT_1406093a0 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a0 = DAT_1406093a0 + 1;
      puVar3 = &DAT_14060d140;
    }
    FUN_140090020(param_3,puVar3);
    FUN_14034edd0(param_1 + 0x848);
    uVar2 = 1;
  }
  return uVar2;
}



bool FUN_140263220(longlong param_1,ulonglong *param_2,uint *param_3)

{
  uint uVar1;
  int iVar2;
  ulonglong *puVar3;
  bool bVar4;
  
  FUN_14034ed40(param_1 + 0x848);
  uVar1 = *param_3;
  if (((int)uVar1 < 0) || (0xb < (int)uVar1)) {
    FUN_14034edd0(param_1 + 0x848);
    bVar4 = false;
  }
  else {
    if (uVar1 < 0xc) {
      puVar3 = (ulonglong *)((longlong)(int)uVar1 * 0xac + param_1);
    }
    else {
      if (DAT_1406093a0 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a0 = DAT_1406093a0 + 1;
      puVar3 = &DAT_14060d140;
    }
    bVar4 = *puVar3 < *param_2;
    if ((*puVar3 == *param_2) && (bVar4 = puVar3[1] < param_2[1], puVar3[1] == param_2[1])) {
      iVar2 = 0;
    }
    else {
      iVar2 = (1 - (uint)bVar4) - (uint)(bVar4 != 0);
    }
    bVar4 = iVar2 == 0;
    FUN_14034edd0(param_1 + 0x848);
  }
  return bVar4;
}



void FUN_1402632f0(longlong param_1,longlong param_2,uint *param_3,int *param_4)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  int iVar6;
  undefined8 *puVar7;
  undefined2 local_res8 [4];
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined8 local_f8;
  longlong local_f0;
  undefined1 local_e8;
  undefined1 local_e0 [168];
  undefined4 local_38;
  
  local_f8 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x848;
  local_f0 = lVar1;
  FUN_14034ed40(lVar1);
  local_e8 = 1;
  puVar7 = &DAT_14060d140;
  if (*param_3 < 0xc) {
    puVar4 = (undefined8 *)((longlong)(int)*param_3 * 0xac + param_1);
  }
  else {
    if (DAT_1406093a0 == 0) {
      FUN_140176d60(0);
    }
    DAT_1406093a0 = DAT_1406093a0 + 1;
    puVar4 = &DAT_14060d140;
  }
  iVar6 = DAT_1406093a0;
  if ((int)*(short *)((longlong)puVar4 + 0x1c) == *param_4) {
    FUN_14000a170(local_e0);
    local_38 = 0;
    if (*param_3 < 0xc) {
      puVar4 = (undefined8 *)((longlong)(int)*param_3 * 0xac + param_1);
    }
    else {
      if (iVar6 == 0) {
        FUN_140176d60(0);
        iVar6 = DAT_1406093a0;
      }
      iVar6 = iVar6 + 1;
      puVar4 = &DAT_14060d140;
      DAT_1406093a0 = iVar6;
    }
    FUN_140090020(puVar4,local_e0);
  }
  else {
    if (*param_3 < 0xc) {
      puVar4 = (undefined8 *)((longlong)(int)*param_3 * 0xac + param_1);
    }
    else {
      if (DAT_1406093a0 == 0) {
        FUN_140176d60(0);
      }
      DAT_1406093a0 = DAT_1406093a0 + 1;
      puVar4 = &DAT_14060d140;
    }
    iVar6 = DAT_1406093a0;
    *(short *)((longlong)puVar4 + 0x1c) = *(short *)((longlong)puVar4 + 0x1c) - (short)*param_4;
    if (*param_3 < 0xc) {
      puVar4 = (undefined8 *)((longlong)(int)*param_3 * 0xac + param_1);
    }
    else {
      if (iVar6 == 0) {
        FUN_140176d60(0);
        iVar6 = DAT_1406093a0;
      }
      iVar6 = iVar6 + 1;
      puVar4 = &DAT_14060d140;
      DAT_1406093a0 = iVar6;
    }
    local_108 = *(undefined4 *)(param_2 + 0x160);
    local_104 = *(undefined4 *)(param_2 + 0x164);
    local_100 = *(undefined4 *)(param_2 + 0x168);
    local_fc = *(undefined4 *)(param_2 + 0x16c);
    local_118 = *(undefined4 *)(param_2 + 0x170);
    local_114 = *(undefined4 *)(param_2 + 0x174);
    local_110 = *(undefined4 *)(param_2 + 0x178);
    local_10c = *(undefined4 *)(param_2 + 0x17c);
    iVar2 = *(int *)(param_2 + 0x284);
    if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
       (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
      local_res8[0] = (undefined2)iVar2;
      plVar5 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
               0x70);
      (**(code **)(*plVar5 + 0x140))
                (plVar5,1,&DAT_1405d85a0,local_res8,&local_118,&local_108,puVar4);
      iVar6 = DAT_1406093a0;
    }
  }
  if (*param_3 < 0xc) {
    puVar7 = (undefined8 *)((longlong)(int)*param_3 * 0xac + param_1);
  }
  else {
    if (iVar6 == 0) {
      FUN_140176d60(0);
      iVar6 = DAT_1406093a0;
    }
    DAT_1406093a0 = iVar6 + 1;
  }
  plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x400);
  (**(code **)(*plVar5 + 0x80))(plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,param_3,puVar7);
  FUN_14034edd0(lVar1);
  return;
}



void FUN_1402635b0(longlong param_1,int param_2)

{
  int *piVar1;
  undefined4 uVar2;
  
  FUN_14034ed40(param_1 + 0x9130);
  piVar1 = (int *)(param_1 + 0x9120);
  *piVar1 = *piVar1 + param_2;
  uVar2 = *(undefined4 *)(param_1 + 0x9120);
  if (*piVar1 < 0) {
    uVar2 = 0;
  }
  *(undefined4 *)(param_1 + 0x9120) = uVar2;
  FUN_14034edd0(param_1 + 0x9130);
  return;
}



void FUN_140263610(longlong param_1,longlong param_2)

{
  longlong lVar1;
  short sVar2;
  bool bVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong lVar7;
  
  uVar6 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x9130;
  lVar7 = lVar1;
  FUN_14034ed40(lVar1);
  sVar2 = *(short *)(param_2 + 0x12);
  if ((sVar2 < 0) || (0xd7 < sVar2)) goto LAB_1402636bf;
  plVar4 = (longlong *)((longlong)sVar2 * 0xac + param_1);
  lVar5 = *plVar4;
  if (lVar5 == 0) {
    lVar5 = plVar4[1];
    if (lVar5 != 0) goto LAB_140263689;
    bVar3 = false;
  }
  else {
LAB_140263689:
    bVar3 = true;
  }
  if (((bVar3) || ((int)plVar4[3] != 0)) || (0 < *(short *)((longlong)plVar4 + 0x1c))) {
    FUN_140418da0(DAT_140607fd8,&DAT_1404b5fd0,(int)sVar2,lVar5,uVar6,lVar7,1);
  }
  else {
    FUN_1401e0370(plVar4,param_2);
  }
LAB_1402636bf:
  FUN_14034edd0(lVar1);
  return;
}



undefined8 FUN_1402636e0(longlong param_1,int *param_2,undefined8 param_3)

{
  int iVar1;
  undefined8 uVar2;
  
  FUN_14034ed40(param_1 + 0x9130);
  iVar1 = *param_2;
  if ((iVar1 < 0) || (0xd7 < iVar1)) {
    FUN_14034edd0(param_1 + 0x9130);
    uVar2 = 0;
  }
  else {
    FUN_140090020(param_3,(longlong)iVar1 * 0xac + param_1);
    FUN_14034edd0(param_1 + 0x9130);
    uVar2 = 1;
  }
  return uVar2;
}



bool FUN_140263770(longlong param_1,ulonglong *param_2,int *param_3)

{
  ulonglong uVar1;
  int iVar2;
  bool bVar3;
  
  FUN_14034ed40(param_1 + 0x9130);
  iVar2 = *param_3;
  if ((iVar2 < 0) || (0xd7 < iVar2)) {
    FUN_14034edd0(param_1 + 0x9130);
    bVar3 = false;
  }
  else {
    uVar1 = *(ulonglong *)((longlong)iVar2 * 0xac + param_1);
    bVar3 = uVar1 < *param_2;
    if ((uVar1 == *param_2) &&
       (uVar1 = *(ulonglong *)((longlong)iVar2 * 0xac + 8 + param_1), bVar3 = uVar1 < param_2[1],
       uVar1 == param_2[1])) {
      iVar2 = 0;
    }
    else {
      iVar2 = (1 - (uint)bVar3) - (uint)(bVar3 != 0);
    }
    bVar3 = iVar2 == 0;
    FUN_14034edd0(param_1 + 0x9130);
  }
  return bVar3;
}



undefined8
FUN_140263810(longlong param_1,longlong param_2,longlong param_3,int *param_4,int *param_5,
             longlong param_6)

{
  longlong lVar1;
  undefined8 *puVar2;
  void *pvVar3;
  short sVar4;
  int iVar5;
  undefined4 *puVar6;
  undefined8 uVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong lVar10;
  longlong *plVar11;
  bool bVar12;
  int local_res8 [2];
  undefined4 *puVar13;
  undefined4 uVar14;
  undefined4 *puVar15;
  undefined4 uVar17;
  undefined1 *puVar16;
  undefined8 in_stack_fffffffffffffe58;
  undefined4 uVar19;
  ulonglong uVar18;
  undefined8 in_stack_fffffffffffffe60;
  undefined4 uVar20;
  longlong *in_stack_fffffffffffffe68;
  uint uVar21;
  undefined2 local_188;
  undefined2 local_186;
  undefined2 local_184;
  undefined2 local_182;
  undefined2 local_180;
  undefined2 local_17e;
  undefined2 local_17c;
  undefined2 local_17a;
  undefined2 local_178;
  undefined2 local_176 [3];
  longlong *local_170;
  longlong *local_168;
  longlong local_160;
  undefined1 local_158;
  undefined4 local_150 [2];
  int local_148 [2];
  undefined4 local_140 [2];
  undefined4 local_138 [2];
  int local_130 [2];
  undefined4 local_128 [2];
  undefined4 local_120 [2];
  longlong *local_118;
  longlong *local_110;
  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;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined8 local_48;
  undefined1 local_40 [24];
  
  uVar20 = (undefined4)((ulonglong)in_stack_fffffffffffffe60 >> 0x20);
  uVar19 = (undefined4)((ulonglong)in_stack_fffffffffffffe58 >> 0x20);
  puVar6 = &local_d8;
  local_48 = 0xfffffffffffffffe;
  lVar10 = param_1 + 0x9130;
  local_160 = lVar10;
  FUN_14034ed40(lVar10);
  local_158 = 1;
  FUN_140197b70(param_2,&local_170);
  plVar11 = local_170;
  if (local_170 != (longlong *)0x0) {
    if (local_170 == local_168) {
      if (*local_170 != 0) {
        iVar5 = *param_4;
        lVar10 = local_160;
        if ((iVar5 < 0) || (0xd7 < iVar5)) {
          LOCK();
          plVar11 = local_170 + 1;
          *(int *)plVar11 = (int)*plVar11 + -1;
          UNLOCK();
          if ((int)*plVar11 == 0) {
            pvVar3 = (void *)*local_170;
            if (pvVar3 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar3 + 0xf630);
              operator_delete(pvVar3);
            }
            operator_delete(local_170);
            lVar10 = local_160;
          }
        }
        else if (*(int *)(param_1 + 0x9124) + *(int *)(param_1 + 0x9128) < iVar5) {
          LOCK();
          plVar11 = local_170 + 1;
          *(int *)plVar11 = (int)*plVar11 + -1;
          UNLOCK();
          if ((int)*plVar11 == 0) {
            pvVar3 = (void *)*local_170;
            if (pvVar3 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar3 + 0xf630);
              operator_delete(pvVar3);
            }
            operator_delete(local_170);
            lVar10 = local_160;
          }
        }
        else {
          iVar5 = FUN_14011b180((longlong)iVar5 * 0xac + param_1);
          if (iVar5 != 0) {
            FUN_140090020();
            *(short *)((longlong)*param_4 * 0xac + 0x16 + param_1) = (short)*param_4;
            *(short *)(param_6 + 0x16) = (short)*param_4;
            if ((int)*(short *)(param_3 + 0x1c) != *param_5) {
              puVar6 = (undefined4 *)FUN_140357570(local_40);
              lVar10 = (longlong)*param_4 * 0xac;
              *(undefined4 *)(lVar10 + param_1) = *puVar6;
              *(undefined4 *)(lVar10 + 4 + param_1) = puVar6[1];
              *(undefined4 *)(lVar10 + 8 + param_1) = puVar6[2];
              *(undefined4 *)(lVar10 + 0xc + param_1) = puVar6[3];
              *(short *)((longlong)*param_4 * 0xac + 0x1c + param_1) = (short)*param_5;
              local_184 = (undefined2)*param_4;
              plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              lVar10 = (longlong)*param_4 * 0xac + param_1;
              puVar16 = &stack0x00000038;
              (**(code **)(*plVar8 + 0x140))
                        (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_184,lVar10,
                         puVar16);
              uVar14 = (undefined4)((ulonglong)lVar10 >> 0x20);
              uVar17 = (undefined4)((ulonglong)puVar16 >> 0x20);
              *(undefined2 *)((longlong)*param_4 * 0xac + 0x14 + param_1) = 0x15;
              *(short *)((longlong)*param_4 * 0xac + 0x16 + param_1) = (short)*param_4;
              local_108 = *(undefined4 *)(param_2 + 0x160);
              local_104 = *(undefined4 *)(param_2 + 0x164);
              local_100 = *(undefined4 *)(param_2 + 0x168);
              local_fc = *(undefined4 *)(param_2 + 0x16c);
              local_b8 = *(undefined4 *)(param_2 + 0x170);
              local_b4 = *(undefined4 *)(param_2 + 0x174);
              local_b0 = *(undefined4 *)(param_2 + 0x178);
              local_ac = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              plVar8 = (longlong *)((longlong)*param_4 * 0xac + param_1);
              local_128[0] = *(undefined4 *)(param_2 + 8);
              if ((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
                if ((*plVar8 == 0) && (plVar8[1] == 0)) {
                  bVar12 = false;
                }
                else {
                  bVar12 = true;
                }
                if (((bVar12) && ((int)plVar8[3] != 0)) &&
                   (lVar10 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar10 != 0)) {
                  local_17c = (undefined2)iVar5;
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  uVar20 = 1;
                  puVar6 = &local_108;
                  puVar15 = &local_b8;
                  puVar13 = local_128;
                  (**(code **)(*plVar9 + 0xb0))
                            (plVar9,1,&DAT_1405d85a0,&local_17c,puVar13,puVar15,puVar6,
                             &DAT_14047b978,plVar8);
                  uVar14 = (undefined4)((ulonglong)puVar13 >> 0x20);
                  uVar17 = (undefined4)((ulonglong)puVar15 >> 0x20);
                  uVar19 = (undefined4)((ulonglong)puVar6 >> 0x20);
                  in_stack_fffffffffffffe68 = plVar8;
                }
              }
              FUN_140198570(param_2,&local_118);
              plVar8 = local_118;
              if (local_118 != (longlong *)0x0) {
                if (local_118 == local_110) {
                  if (*local_118 != 0) {
                    lVar10 = (longlong)*param_4 * 0xac + param_1;
                    uVar18 = CONCAT44(uVar19,*(undefined4 *)(*plVar11 + 0x50a0));
                    FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,lVar10,0x197,
                                  CONCAT44(uVar14,2),CONCAT44(uVar17,*(undefined4 *)(lVar10 + 0x18))
                                  ,uVar18,CONCAT44(uVar20,*(undefined4 *)(*plVar11 + 0x50a0)),
                                  (ulonglong)in_stack_fffffffffffffe68 & 0xffffffff00000000,0);
                    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x15,param_2,
                                  (longlong)*param_4 * 0xac + param_1,*param_5,
                                  uVar18 & 0xffffffff00000000,(int)*(short *)(param_3 + 0x16),
                                  *param_4);
                  }
                }
                else {
                  iVar5 = DAT_14060804c + 1;
                  bVar12 = DAT_14060804c == 0;
                  DAT_14060804c = iVar5;
                  if (bVar12) {
                    FUN_140176d60(1);
                  }
                }
              }
              if (plVar8 != (longlong *)0x0) {
                if (plVar8 == local_110) {
                  LOCK();
                  plVar8 = plVar8 + 1;
                  *(int *)plVar8 = (int)*plVar8 + -1;
                  UNLOCK();
                  plVar11 = local_170;
                  if ((int)*plVar8 == 0) {
                    puVar2 = (undefined8 *)*local_118;
                    if (puVar2 != (undefined8 *)0x0) {
                      (**(code **)*puVar2)(puVar2,1);
                    }
                    operator_delete(local_118);
                    plVar11 = local_170;
                  }
                }
                else {
                  iVar5 = DAT_140608054 + 1;
                  bVar12 = DAT_140608054 == 0;
                  DAT_140608054 = iVar5;
                  if (bVar12) {
                    FUN_140176d60(1);
                  }
                }
              }
              LOCK();
              plVar11 = plVar11 + 1;
              *(int *)plVar11 = (int)*plVar11 + -1;
              UNLOCK();
              if ((int)*plVar11 == 0) {
                pvVar3 = (void *)*local_170;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0xf630);
                  operator_delete(pvVar3);
                }
                operator_delete(local_170);
              }
              FUN_14034edd0(local_160);
              return 1;
            }
            local_e8 = *(undefined4 *)(param_2 + 0x160);
            local_e4 = *(undefined4 *)(param_2 + 0x164);
            local_e0 = *(undefined4 *)(param_2 + 0x168);
            local_dc = *(undefined4 *)(param_2 + 0x16c);
            local_c8 = *(undefined4 *)(param_2 + 0x170);
            local_c4 = *(undefined4 *)(param_2 + 0x174);
            local_c0 = *(undefined4 *)(param_2 + 0x178);
            local_bc = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            local_148[0] = *param_4;
            lVar10 = (longlong)local_148[0] * 0xac + param_1;
            local_138[0] = 0x15;
            if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar1 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar1 != 0)) {
              local_res8[0] = CONCAT22(local_res8[0]._2_2_,(short)iVar5);
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar1 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              in_stack_fffffffffffffe68 = (longlong *)local_148;
              puVar6 = local_138;
              (**(code **)(*plVar8 + 0x130))
                        (plVar8,1,&DAT_1405d85a0,local_res8,&local_c8,&local_e8,lVar10,puVar6,
                         in_stack_fffffffffffffe68);
              uVar19 = (undefined4)((ulonglong)lVar10 >> 0x20);
              uVar20 = (undefined4)((ulonglong)puVar6 >> 0x20);
            }
            local_178 = (undefined2)*param_4;
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            (**(code **)(*plVar8 + 0x140))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_178,
                       (longlong)*param_4 * 0xac + param_1,&stack0x00000038);
            lVar10 = (longlong)*param_4 * 0xac + param_1;
            uVar18 = CONCAT44(uVar19,*(undefined4 *)(*plVar11 + 0x50a0));
            FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,lVar10,400,2,
                          *(undefined4 *)(lVar10 + 0x18),uVar18,
                          CONCAT44(uVar20,*(undefined4 *)(*plVar11 + 0x50a0)),
                          (ulonglong)in_stack_fffffffffffffe68 & 0xffffffff00000000,0);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x15,param_2,
                          (longlong)*param_4 * 0xac + param_1,*param_5,uVar18 & 0xffffffff00000000,
                          (int)*(short *)(param_3 + 0x16),*param_4);
            LOCK();
            plVar11 = plVar11 + 1;
            *(int *)plVar11 = (int)*plVar11 + -1;
            UNLOCK();
            if ((int)*plVar11 == 0) {
              pvVar3 = (void *)*local_170;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0xf630);
                operator_delete(pvVar3);
              }
              operator_delete(local_170);
            }
            FUN_14034edd0(local_160);
            return 1;
          }
          uVar7 = FUN_140137690();
          local_res8[0] = FUN_140136a70(uVar7,*(undefined4 *)(param_3 + 0x18));
          uVar21 = (uint)((ulonglong)in_stack_fffffffffffffe68 >> 0x20);
          lVar10 = (longlong)*param_4 * 0xac + param_1;
          if ((*(int *)(lVar10 + 0x18) != *(int *)(param_3 + 0x18)) || (local_res8[0] < 2)) {
            FUN_140090020(param_6);
            FUN_140090020((longlong)*param_4 * 0xac + param_1,param_3);
            local_58 = *(undefined4 *)(param_2 + 0x160);
            local_54 = *(undefined4 *)(param_2 + 0x164);
            local_50 = *(undefined4 *)(param_2 + 0x168);
            local_4c = *(undefined4 *)(param_2 + 0x16c);
            local_88 = *(undefined4 *)(param_2 + 0x170);
            local_84 = *(undefined4 *)(param_2 + 0x174);
            local_80 = *(undefined4 *)(param_2 + 0x178);
            local_7c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            local_130[0] = *param_4;
            local_150[0] = 0xb;
            if ((-1 < iVar5) &&
               ((iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700) &&
                (lVar10 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar10 != 0)))) {
              local_17e = (undefined2)iVar5;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                       0x70);
              (**(code **)(*plVar8 + 0x130))
                        (plVar8,1,&DAT_1405d85a0,&local_17e,&local_88,&local_58,
                         (longlong)local_130[0] * 0xac + param_1,local_150,local_130);
            }
            local_176[0] = (undefined2)*param_4;
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            (**(code **)(*plVar8 + 0x140))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_176,
                       (longlong)*param_4 * 0xac + param_1,&stack0x00000038);
            LOCK();
            plVar11 = plVar11 + 1;
            *(int *)plVar11 = (int)*plVar11 + -1;
            UNLOCK();
            if ((int)*plVar11 == 0) {
              pvVar3 = (void *)*local_170;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0xf630);
                operator_delete(pvVar3);
              }
              operator_delete(local_170);
            }
            FUN_14034edd0(local_160);
            return 1;
          }
          if (*(short *)(lVar10 + 0x1c) < local_res8[0]) {
            if ((int)*(short *)(lVar10 + 0x1c) + *param_5 <= local_res8[0]) {
              *(short *)(lVar10 + 0x1c) = *(short *)(lVar10 + 0x1c) + (short)*param_5;
              local_a8 = *(undefined4 *)(param_2 + 0x160);
              local_a4 = *(undefined4 *)(param_2 + 0x164);
              local_a0 = *(undefined4 *)(param_2 + 0x168);
              local_9c = *(undefined4 *)(param_2 + 0x16c);
              local_68 = *(undefined4 *)(param_2 + 0x170);
              local_64 = *(undefined4 *)(param_2 + 0x174);
              local_60 = *(undefined4 *)(param_2 + 0x178);
              local_5c = *(undefined4 *)(param_2 + 0x17c);
              iVar5 = *(int *)(param_2 + 0x284);
              lVar10 = (longlong)*param_4 * 0xac + param_1;
              if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                 (lVar1 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar1 != 0)) {
                local_180 = (undefined2)iVar5;
                plVar8 = (longlong *)
                         (*(longlong *)
                           (*(longlong *)(lVar1 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                         0x70);
                (**(code **)(*plVar8 + 0x140))
                          (plVar8,1,&DAT_1405d85a0,&local_180,&local_68,&local_a8,lVar10);
                uVar19 = (undefined4)((ulonglong)lVar10 >> 0x20);
              }
              local_17a = (undefined2)*param_4;
              plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              lVar10 = (longlong)*param_4 * 0xac + param_1;
              puVar16 = &stack0x00000038;
              (**(code **)(*plVar8 + 0x140))
                        (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_17a,lVar10,
                         puVar16);
              uVar14 = (undefined4)((ulonglong)lVar10 >> 0x20);
              uVar17 = (undefined4)((ulonglong)puVar16 >> 0x20);
              if ((int)*(short *)(param_3 + 0x1c) == *param_5) {
                local_f8 = *(undefined4 *)(param_2 + 0x160);
                local_f4 = *(undefined4 *)(param_2 + 0x164);
                local_f0 = *(undefined4 *)(param_2 + 0x168);
                local_ec = *(undefined4 *)(param_2 + 0x16c);
                local_d8 = *(undefined4 *)(param_2 + 0x170);
                local_d4 = *(undefined4 *)(param_2 + 0x174);
                local_d0 = *(undefined4 *)(param_2 + 0x178);
                local_cc = *(undefined4 *)(param_2 + 0x17c);
                iVar5 = *(int *)(param_2 + 0x284);
                local_140[0] = 0xffffffff;
                local_120[0] = 0xfffffff1;
                if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar10 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar10 != 0)) {
                  local_188 = (undefined2)iVar5;
                  plVar8 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar10 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  in_stack_fffffffffffffe68 = (longlong *)local_140;
                  puVar15 = local_120;
                  puVar13 = &local_f8;
                  lVar10 = param_3;
                  (**(code **)(*plVar8 + 0x130))
                            (plVar8,1,&DAT_1405d85a0,&local_188,puVar6,puVar13,param_3,puVar15,
                             in_stack_fffffffffffffe68);
                  uVar14 = (undefined4)((ulonglong)puVar6 >> 0x20);
                  uVar17 = (undefined4)((ulonglong)puVar13 >> 0x20);
                  uVar19 = (undefined4)((ulonglong)lVar10 >> 0x20);
                  uVar20 = (undefined4)((ulonglong)puVar15 >> 0x20);
                }
              }
              iVar5 = *param_5;
              if (*(short *)(param_3 + 0x1c) == iVar5) {
                iVar5 = 0;
                uVar7 = 0x199;
              }
              else {
                uVar7 = 0x198;
              }
              uVar18 = CONCAT44(uVar19,*(undefined4 *)(*plVar11 + 0x50a0));
              FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,uVar7,
                            CONCAT44(uVar14,2),
                            CONCAT44(uVar17,*(undefined4 *)
                                             ((longlong)*param_4 * 0xac + 0x18 + param_1)),uVar18,
                            CONCAT44(uVar20,*(undefined4 *)(*plVar11 + 0x50a0)),
                            (ulonglong)in_stack_fffffffffffffe68 & 0xffffffff00000000,iVar5);
              FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x15,param_2,
                            (longlong)*param_4 * 0xac + param_1,*param_5,uVar18 & 0xffffffff00000000
                            ,(int)*(short *)(param_3 + 0x16),*param_4);
              LOCK();
              plVar11 = plVar11 + 1;
              *(int *)plVar11 = (int)*plVar11 + -1;
              UNLOCK();
              if ((int)*plVar11 == 0) {
                pvVar3 = (void *)*local_170;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0xf630);
                  operator_delete(pvVar3);
                }
                operator_delete(local_170);
              }
              FUN_14034edd0(local_160);
              return 1;
            }
            local_res8[0] = local_res8[0] - *(short *)(lVar10 + 0x1c);
            sVar4 = (short)local_res8[0];
            *(short *)(lVar10 + 0x1c) = *(short *)(lVar10 + 0x1c) + sVar4;
            FUN_140090020(param_6,param_3);
            *(short *)(param_6 + 0x1c) = *(short *)(param_6 + 0x1c) - sVar4;
            local_98 = *(undefined4 *)(param_2 + 0x160);
            local_94 = *(undefined4 *)(param_2 + 0x164);
            local_90 = *(undefined4 *)(param_2 + 0x168);
            local_8c = *(undefined4 *)(param_2 + 0x16c);
            local_78 = *(undefined4 *)(param_2 + 0x170);
            local_74 = *(undefined4 *)(param_2 + 0x174);
            local_70 = *(undefined4 *)(param_2 + 0x178);
            local_6c = *(undefined4 *)(param_2 + 0x17c);
            iVar5 = *(int *)(param_2 + 0x284);
            lVar10 = (longlong)*param_4 * 0xac + param_1;
            if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar1 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar1 != 0)) {
              local_186 = (undefined2)iVar5;
              plVar8 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar1 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              (**(code **)(*plVar8 + 0x140))
                        (plVar8,1,&DAT_1405d85a0,&local_186,&local_78,&local_98,lVar10);
              uVar19 = (undefined4)((ulonglong)lVar10 >> 0x20);
            }
            local_182 = (undefined2)*param_4;
            plVar8 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
            (**(code **)(*plVar8 + 0x140))
                      (plVar8,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_182,
                       (longlong)*param_4 * 0xac + param_1,&stack0x00000038);
            uVar18 = CONCAT44(uVar19,*(undefined4 *)(*plVar11 + 0x50a0));
            FUN_1402024f0(*(undefined8 *)(param_2 + 0xb50),param_2,param_3,0x198,2,
                          *(undefined4 *)((longlong)*param_4 * 0xac + 0x18 + param_1),uVar18,
                          CONCAT44(uVar20,*(undefined4 *)(*plVar11 + 0x50a0)),
                          (ulonglong)uVar21 << 0x20,0);
            FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x15,param_2,
                          (longlong)*param_4 * 0xac + param_1,local_res8[0],
                          uVar18 & 0xffffffff00000000,(int)*(short *)(param_3 + 0x16),*param_4);
            LOCK();
            plVar11 = plVar11 + 1;
            *(int *)plVar11 = (int)*plVar11 + -1;
            UNLOCK();
            if ((int)*plVar11 == 0) {
              pvVar3 = (void *)*local_170;
              if (pvVar3 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar3 + 0xf630);
                operator_delete(pvVar3);
              }
              operator_delete(local_170);
            }
            FUN_14034edd0(local_160);
            return 1;
          }
          LOCK();
          plVar11 = plVar11 + 1;
          *(int *)plVar11 = (int)*plVar11 + -1;
          UNLOCK();
          lVar10 = local_160;
          if ((int)*plVar11 == 0) {
            pvVar3 = (void *)*local_170;
            if (pvVar3 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar3 + 0xf630);
              operator_delete(pvVar3);
            }
            operator_delete(local_170);
            lVar10 = local_160;
          }
        }
        goto LAB_140264705;
      }
    }
    else {
      iVar5 = DAT_140608048 + 1;
      bVar12 = DAT_140608048 == 0;
      DAT_140608048 = iVar5;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar11 != (longlong *)0x0) {
    if (plVar11 == local_168) {
      LOCK();
      plVar11 = plVar11 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      lVar10 = local_160;
      if ((int)*plVar11 == 0) {
        pvVar3 = (void *)*local_170;
        if (pvVar3 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar3 + 0xf630);
          operator_delete(pvVar3);
        }
        operator_delete(local_170);
        lVar10 = local_160;
      }
    }
    else {
      iVar5 = DAT_140608050 + 1;
      bVar12 = DAT_140608050 == 0;
      DAT_140608050 = iVar5;
      if (bVar12) {
        FUN_140176d60(1);
      }
    }
  }
LAB_140264705:
  FUN_14034edd0(lVar10);
  return 0;
}



void FUN_140264730(longlong param_1,longlong param_2,int *param_3,int *param_4,undefined4 param_5)

{
  longlong lVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined2 local_res8 [4];
  undefined8 in_stack_fffffffffffffed0;
  undefined4 uVar5;
  ulonglong in_stack_fffffffffffffed8;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  undefined8 local_e8;
  longlong local_e0;
  undefined1 local_d8;
  undefined1 local_d0 [168];
  undefined4 local_28;
  
  uVar5 = (undefined4)((ulonglong)in_stack_fffffffffffffed0 >> 0x20);
  local_e8 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x9130;
  local_e0 = lVar1;
  FUN_14034ed40(lVar1);
  local_d8 = 1;
  iVar2 = *param_3;
  if ((-1 < iVar2) && (iVar2 < 0xd8)) {
    FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x16,param_2,
                  (longlong)iVar2 * 0xac + param_1,CONCAT44(uVar5,*param_4),
                  in_stack_fffffffffffffed8 & 0xffffffff00000000,iVar2,param_5);
    lVar4 = (longlong)*param_3 * 0xac + param_1;
    if ((int)*(short *)(lVar4 + 0x1c) == *param_4) {
      FUN_14000a170(local_d0);
      local_28 = 0;
      FUN_140090020(lVar4,local_d0);
    }
    else {
      *(short *)(lVar4 + 0x1c) = *(short *)(lVar4 + 0x1c) - (short)*param_4;
      local_f8 = *(undefined4 *)(param_2 + 0x160);
      local_f4 = *(undefined4 *)(param_2 + 0x164);
      local_f0 = *(undefined4 *)(param_2 + 0x168);
      local_ec = *(undefined4 *)(param_2 + 0x16c);
      local_108 = *(undefined4 *)(param_2 + 0x170);
      local_104 = *(undefined4 *)(param_2 + 0x174);
      local_100 = *(undefined4 *)(param_2 + 0x178);
      local_fc = *(undefined4 *)(param_2 + 0x17c);
      iVar2 = *(int *)(param_2 + 0x284);
      if (((-1 < iVar2) && (iVar2 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
         (lVar4 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar4 != 0)) {
        local_res8[0] = (undefined2)iVar2;
        plVar3 = (longlong *)
                 (*(longlong *)(*(longlong *)(lVar4 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                 + 0x70);
        (**(code **)(*plVar3 + 0x140))
                  (plVar3,1,&DAT_1405d85a0,local_res8,&local_108,&local_f8,
                   (longlong)*param_3 * 0xac + param_1);
      }
    }
    local_res8[0] = (undefined2)*param_3;
    plVar3 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar3 + 0x140))
              (plVar3,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res8,
               (longlong)*param_3 * 0xac + param_1,&stack0x00000030);
  }
  FUN_14034edd0(lVar1);
  return;
}



undefined8
FUN_140264990(longlong param_1,longlong param_2,uint param_3,uint param_4,ulonglong *param_5,
             ulonglong *param_6,int param_7)

{
  longlong lVar1;
  undefined4 uVar2;
  longlong lVar3;
  int iVar4;
  longlong *plVar5;
  ulonglong *_Src;
  ulonglong *puVar6;
  bool bVar7;
  undefined2 local_res18 [4];
  undefined8 in_stack_fffffffffffffeb0;
  undefined4 *puVar8;
  undefined8 uVar9;
  ulonglong *in_stack_fffffffffffffeb8;
  undefined8 in_stack_fffffffffffffec0;
  uint *puVar11;
  undefined8 uVar12;
  undefined8 in_stack_fffffffffffffec8;
  uint *puVar14;
  undefined8 uVar15;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  undefined4 local_11c;
  uint local_118 [2];
  uint local_110 [2];
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  longlong local_f8;
  undefined1 local_f0;
  undefined8 local_e8;
  undefined1 local_d8 [176];
  undefined4 uVar10;
  undefined4 uVar13;
  undefined4 uVar16;
  
  uVar13 = (undefined4)((ulonglong)in_stack_fffffffffffffec0 >> 0x20);
  uVar16 = (undefined4)((ulonglong)in_stack_fffffffffffffec8 >> 0x20);
  uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffeb0 >> 0x20);
  local_e8 = 0xfffffffffffffffe;
  if ((param_3 < 0xd8) && (param_4 < 0xd8)) {
    if (((int)param_3 <= *(int *)(param_1 + 0x9128) + *(int *)(param_1 + 0x9124)) &&
       ((int)param_4 <= *(int *)(param_1 + 0x9128) + *(int *)(param_1 + 0x9124))) {
      lVar1 = param_1 + 0x9130;
      local_f8 = lVar1;
      FUN_14034ed40(lVar1);
      local_f0 = 1;
      _Src = (ulonglong *)((longlong)(int)param_3 * 0xac + param_1);
      bVar7 = *_Src < *param_5;
      if ((*_Src == *param_5) && (bVar7 = _Src[1] < param_5[1], _Src[1] == param_5[1])) {
        iVar4 = 0;
      }
      else {
        iVar4 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
      }
      if (iVar4 == 0) {
        puVar6 = (ulonglong *)(param_1 + (longlong)(int)param_4 * 0xac);
        bVar7 = *puVar6 < *param_6;
        if ((*puVar6 == *param_6) && (bVar7 = puVar6[1] < param_6[1], puVar6[1] == param_6[1])) {
          iVar4 = 0;
        }
        else {
          iVar4 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
        }
        if (iVar4 == 0) {
          bVar7 = *puVar6 < *_Src;
          if ((*puVar6 == *_Src) && (bVar7 = puVar6[1] < _Src[1], puVar6[1] == _Src[1])) {
            iVar4 = 0;
          }
          else {
            iVar4 = (1 - (uint)bVar7) - (uint)(bVar7 != 0);
          }
          if (iVar4 != 0) {
            memcpy(local_d8,_Src,0xac);
            FUN_140090020(_Src,puVar6);
            FUN_140090020(puVar6,local_d8);
            *(short *)((longlong)_Src + 0x16) = (short)param_3;
            *(short *)((longlong)puVar6 + 0x16) = (short)param_4;
            if ((*_Src == 0) && (_Src[1] == 0)) {
              bVar7 = false;
            }
            else {
              bVar7 = true;
            }
            if (bVar7) {
              local_128 = *(undefined4 *)(param_2 + 0x160);
              lVar3 = *(longlong *)(param_2 + 0xb50);
              iVar4 = *(int *)(param_2 + 0x284);
              if (param_7 == 0) {
                local_104 = *(undefined4 *)(param_2 + 0x164);
                local_100 = *(undefined4 *)(param_2 + 0x168);
                local_fc = *(undefined4 *)(param_2 + 0x16c);
                uVar2 = *(undefined4 *)(param_2 + 0x170);
                local_124 = *(undefined4 *)(param_2 + 0x174);
                local_120 = *(undefined4 *)(param_2 + 0x178);
                local_11c = *(undefined4 *)(param_2 + 0x17c);
                local_118[0] = 0x15;
                local_110[0] = param_3;
                local_108 = local_128;
                if (((-1 < iVar4) && (iVar4 < *(short *)(lVar3 + 700))) &&
                   (*(longlong *)(lVar3 + 0x4c0) != 0)) {
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(*(longlong *)(lVar3 + 0x4c0) + 8) +
                             (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                  puVar14 = local_110;
                  puVar11 = local_118;
                  puVar8 = &local_108;
                  local_res18[0] = (short)iVar4;
                  in_stack_fffffffffffffeb8 = _Src;
                  local_128 = uVar2;
                  (**(code **)(*plVar5 + 0x130))
                            (plVar5,1,&DAT_1405d85a0,local_res18,&local_128,puVar8,_Src,puVar11,
                             puVar14);
                  uVar10 = (undefined4)((ulonglong)puVar8 >> 0x20);
                  uVar13 = (undefined4)((ulonglong)puVar11 >> 0x20);
                  uVar16 = (undefined4)((ulonglong)puVar14 >> 0x20);
                  uVar2 = local_128;
                }
                local_128 = uVar2;
                uVar15 = CONCAT44(uVar16,param_3);
                uVar12 = CONCAT44(uVar13,param_4);
                in_stack_fffffffffffffeb8 =
                     (ulonglong *)((ulonglong)in_stack_fffffffffffffeb8 & 0xffffffff00000000);
                uVar9 = CONCAT44(uVar10,(int)*(short *)((longlong)_Src + 0x1c));
                FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x17,param_2,_Src,uVar9,
                              in_stack_fffffffffffffeb8,uVar12,uVar15);
                uVar10 = (undefined4)((ulonglong)uVar9 >> 0x20);
                uVar13 = (undefined4)((ulonglong)uVar12 >> 0x20);
                uVar16 = (undefined4)((ulonglong)uVar15 >> 0x20);
              }
              else {
                local_124 = *(undefined4 *)(param_2 + 0x164);
                local_120 = *(undefined4 *)(param_2 + 0x168);
                local_11c = *(undefined4 *)(param_2 + 0x16c);
                if (((-1 < iVar4) && (iVar4 < *(short *)(lVar3 + 700))) &&
                   (*(longlong *)(lVar3 + 0x4c0) != 0)) {
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(*(longlong *)(lVar3 + 0x4c0) + 8) +
                             (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                  local_res18[0] = (short)iVar4;
                  (**(code **)(*plVar5 + 4000))(plVar5,1,&DAT_1405d85a0,local_res18,&local_128,_Src)
                  ;
                  uVar10 = (undefined4)((ulonglong)_Src >> 0x20);
                }
              }
            }
            if ((*puVar6 == 0) && (puVar6[1] == 0)) {
              bVar7 = false;
            }
            else {
              bVar7 = true;
            }
            if (bVar7) {
              local_128 = *(undefined4 *)(param_2 + 0x160);
              local_124 = *(undefined4 *)(param_2 + 0x164);
              local_120 = *(undefined4 *)(param_2 + 0x168);
              local_11c = *(undefined4 *)(param_2 + 0x16c);
              if (param_7 == 0) {
                local_108 = *(undefined4 *)(param_2 + 0x170);
                local_104 = *(undefined4 *)(param_2 + 0x174);
                local_100 = *(undefined4 *)(param_2 + 0x178);
                local_fc = *(undefined4 *)(param_2 + 0x17c);
                iVar4 = *(int *)(param_2 + 0x284);
                local_110[0] = 0x15;
                local_118[0] = param_4;
                if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
                  local_res18[0] = (undefined2)iVar4;
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  puVar14 = local_118;
                  puVar11 = local_110;
                  puVar8 = &local_128;
                  in_stack_fffffffffffffeb8 = puVar6;
                  (**(code **)(*plVar5 + 0x130))
                            (plVar5,1,&DAT_1405d85a0,local_res18,&local_108,puVar8,puVar6,puVar11,
                             puVar14);
                  uVar10 = (undefined4)((ulonglong)puVar8 >> 0x20);
                  uVar13 = (undefined4)((ulonglong)puVar11 >> 0x20);
                  uVar16 = (undefined4)((ulonglong)puVar14 >> 0x20);
                }
                FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x17,param_2,puVar6,
                              CONCAT44(uVar10,(int)*(short *)((longlong)puVar6 + 0x1c)),
                              (ulonglong)in_stack_fffffffffffffeb8 & 0xffffffff00000000,
                              CONCAT44(uVar13,param_3),CONCAT44(uVar16,param_4));
              }
              else {
                iVar4 = *(int *)(param_2 + 0x284);
                if (((-1 < iVar4) && (iVar4 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar3 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar3 != 0)) {
                  local_res18[0] = (undefined2)iVar4;
                  plVar5 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar3 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  (**(code **)(*plVar5 + 4000))
                            (plVar5,1,&DAT_1405d85a0,local_res18,&local_128,puVar6);
                }
              }
            }
            FUN_14034edd0(lVar1);
            return 1;
          }
        }
      }
      FUN_14034edd0(lVar1);
    }
  }
  return 0;
}



void FUN_140264ec0(longlong *param_1,longlong param_2,int param_3)

{
  undefined4 uVar1;
  longlong lVar2;
  code *pcVar3;
  bool bVar4;
  longlong *plVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong *plVar9;
  ulonglong uVar10;
  uint uVar11;
  longlong *plVar12;
  longlong *plVar13;
  int iVar14;
  longlong *local_res8;
  int local_res18 [2];
  uint local_res20 [2];
  longlong *in_stack_fffffffffffffe88;
  undefined4 local_158 [2];
  longlong *local_150;
  longlong *local_148;
  longlong *local_140;
  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;
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  longlong *local_100;
  undefined1 local_f8;
  undefined8 local_f0;
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  local_f0 = 0xfffffffffffffffe;
  local_100 = param_1 + 0x1226;
  local_res8 = param_1;
  local_res18[0] = param_3;
  FUN_14034ed40(local_100);
  local_f8 = 1;
  plVar13 = (longlong *)0x0;
  local_150 = (longlong *)0x0;
  plVar9 = (longlong *)0x0;
  local_148 = (longlong *)0x0;
  plVar5 = (longlong *)0x0;
  local_140 = (longlong *)0x0;
  iVar14 = 0;
  plVar12 = param_1;
  do {
    if ((*plVar12 == 0) && (plVar12[1] == 0)) {
      bVar4 = false;
    }
    else {
      bVar4 = true;
    }
    if (((bVar4) || ((int)plVar12[3] != 0)) || (0 < *(short *)((longlong)plVar12 + 0x1c))) {
      if ((plVar12 < plVar9) && (plVar13 <= plVar12)) {
        lVar6 = ((longlong)plVar12 - (longlong)plVar13) / 0x56 +
                ((longlong)plVar12 - (longlong)plVar13 >> 0x3f);
        if (plVar9 == plVar5) {
          lVar7 = ((longlong)plVar9 - (longlong)plVar13) / 0x56 +
                  ((longlong)plVar9 - (longlong)plVar13 >> 0x3f);
          uVar10 = (lVar7 >> 1) - (lVar7 >> 0x3f);
          if (0x17d05f417d05f40 < uVar10) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          uVar10 = uVar10 + 1;
          uVar8 = ((longlong)plVar5 - (longlong)plVar13) / 0xac;
          if (uVar8 < uVar10) {
            if (0x17d05f417d05f41 - (uVar8 >> 1) < uVar8) {
              uVar8 = 0;
            }
            else {
              uVar8 = uVar8 + (uVar8 >> 1);
            }
            if (uVar8 < uVar10) {
              uVar8 = uVar10;
            }
            FUN_14008e560(&local_150,uVar8);
            plVar9 = local_148;
            plVar13 = local_150;
            plVar5 = local_140;
          }
        }
        param_1 = local_res8;
        if (plVar9 != (longlong *)0x0) {
          memcpy(plVar9,(void *)(((lVar6 >> 1) - (lVar6 >> 0x3f)) * 0xac + (longlong)plVar13),0xac);
          param_1 = local_res8;
        }
      }
      else {
        if (plVar9 == plVar5) {
          lVar6 = ((longlong)plVar9 - (longlong)plVar13) / 0x56 +
                  ((longlong)plVar9 - (longlong)plVar13 >> 0x3f);
          uVar10 = (lVar6 >> 1) - (lVar6 >> 0x3f);
          if (0x17d05f417d05f40 < uVar10) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            (*pcVar3)();
            return;
          }
          uVar10 = uVar10 + 1;
          uVar8 = ((longlong)plVar5 - (longlong)plVar13) / 0xac;
          if (uVar8 < uVar10) {
            if (0x17d05f417d05f41 - (uVar8 >> 1) < uVar8) {
              uVar8 = 0;
            }
            else {
              uVar8 = uVar8 + (uVar8 >> 1);
            }
            if (uVar8 < uVar10) {
              uVar8 = uVar10;
            }
            FUN_14008e560(&local_150,uVar8);
            plVar9 = local_148;
            plVar13 = local_150;
            plVar5 = local_140;
          }
        }
        if (plVar9 != (longlong *)0x0) {
          memcpy(plVar9,plVar12,0xac);
        }
      }
      plVar9 = (longlong *)((longlong)plVar9 + 0xac);
      local_148 = plVar9;
      FUN_14000a170(local_e8);
      local_40 = 0;
      FUN_140090020((longlong)iVar14 * 0xac + (longlong)param_1,local_e8);
    }
    iVar14 = iVar14 + 1;
    plVar12 = (longlong *)((longlong)plVar12 + 0xac);
  } while (iVar14 < 0xd8);
  if (plVar13 != plVar9) {
    plVar12 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar12 + 0xb10))(plVar12,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res18)
    ;
    local_res20[0] = CONCAT22(local_res20[0]._2_2_,*(undefined2 *)((longlong)param_1 + 0x9124));
    plVar12 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
    (**(code **)(*plVar12 + 0x120))
              (plVar12,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res20,param_1 + 0x1224,
               local_res18);
    plVar12 = local_res8;
    uVar11 = 0;
    lVar6 = ((longlong)plVar9 - (longlong)plVar13) / 0x56 +
            ((longlong)plVar9 - (longlong)plVar13 >> 0x3f);
    lVar7 = lVar6 >> 1;
    lVar6 = lVar6 >> 0x3f;
    if (lVar7 != lVar6) {
      uVar10 = 0;
      plVar9 = plVar13;
      do {
        if ((int)*(short *)((longlong)plVar9 + 0x16) != uVar11) {
          in_stack_fffffffffffffe88 =
               (longlong *)((ulonglong)in_stack_fffffffffffffe88 & 0xffffffff00000000);
          FUN_140203700(*(undefined8 *)(param_2 + 0xb50),0x1c4,0x17,param_2,plVar9,
                        (int)*(short *)((longlong)plVar9 + 0x1c),in_stack_fffffffffffffe88,
                        (int)*(short *)((longlong)plVar9 + 0x16),uVar11);
          *(short *)((longlong)plVar9 + 0x16) = (short)uVar11;
          uVar1 = *(undefined4 *)(param_2 + 0x160);
          if (local_res18[0] == 0) {
            local_11c = *(undefined4 *)(param_2 + 0x164);
            local_118 = *(undefined4 *)(param_2 + 0x168);
            local_114 = *(undefined4 *)(param_2 + 0x16c);
            local_130 = *(undefined4 *)(param_2 + 0x170);
            local_12c = *(undefined4 *)(param_2 + 0x174);
            local_128 = *(undefined4 *)(param_2 + 0x178);
            local_124 = *(undefined4 *)(param_2 + 0x17c);
            iVar14 = *(int *)(param_2 + 0x284);
            local_158[0] = 0x15;
            local_res20[0] = uVar11;
            local_120 = uVar1;
            if (((-1 < iVar14) && (iVar14 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar2 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar2 != 0)) {
              local_res8 = (longlong *)CONCAT62(local_res8._2_6_,(short)iVar14);
              plVar5 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              in_stack_fffffffffffffe88 = plVar9;
              (**(code **)(*plVar5 + 0x130))
                        (plVar5,1,&DAT_1405d85a0,&local_res8,&local_130,&local_120,plVar9,local_158,
                         local_res20);
            }
          }
          else {
            local_10c = *(undefined4 *)(param_2 + 0x164);
            local_108 = *(undefined4 *)(param_2 + 0x168);
            local_104 = *(undefined4 *)(param_2 + 0x16c);
            iVar14 = *(int *)(param_2 + 0x284);
            local_110 = uVar1;
            if (((-1 < iVar14) && (iVar14 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
               (lVar2 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar2 != 0)) {
              local_res8 = (longlong *)CONCAT62(local_res8._2_6_,(short)iVar14);
              plVar5 = (longlong *)
                       (*(longlong *)
                         (*(longlong *)(lVar2 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70
                       );
              (**(code **)(*plVar5 + 4000))(plVar5,1,&DAT_1405d85a0,&local_res8,&local_110,plVar9);
            }
          }
        }
        FUN_140090020((longlong)plVar12 + uVar10 * 0xac,plVar9);
        local_res8 = (longlong *)CONCAT62(local_res8._2_6_,(short)uVar11);
        plVar5 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
        (**(code **)(*plVar5 + 0x140))
                  (plVar5,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_res8,plVar9,local_res18
                  );
        uVar11 = uVar11 + 1;
        plVar9 = (longlong *)((longlong)plVar9 + 0xac);
        uVar10 = (ulonglong)uVar11;
      } while (uVar10 < (ulonglong)(lVar7 - lVar6));
    }
  }
  if (plVar13 != (longlong *)0x0) {
    operator_delete(plVar13);
  }
  FUN_14034edd0(local_100);
  return;
}



undefined8
FUN_1402654c0(longlong param_1,longlong param_2,int param_3,uint param_4,uint param_5,int param_6)

{
  longlong *plVar1;
  undefined8 *puVar2;
  void *pvVar3;
  bool bVar4;
  int iVar5;
  uint uVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  short sVar11;
  int *piVar12;
  undefined2 uVar13;
  undefined1 *puVar14;
  undefined2 uVar15;
  bool bVar16;
  undefined4 extraout_XMM0_Da;
  int local_res18 [4];
  short *psVar17;
  undefined4 uVar18;
  undefined2 local_338;
  undefined2 local_336;
  undefined2 local_334;
  undefined2 local_332;
  undefined2 local_330;
  undefined2 local_32e;
  undefined2 local_32c [2];
  longlong *local_328;
  longlong *local_320;
  longlong local_318;
  undefined4 local_310 [2];
  undefined4 local_308 [2];
  int local_300 [2];
  longlong *local_2f8;
  longlong *local_2f0;
  undefined4 local_2e8;
  undefined4 local_2e4;
  undefined4 local_2e0;
  undefined4 local_2dc;
  undefined4 local_2d8;
  undefined4 local_2d4;
  undefined4 local_2d0;
  undefined4 local_2cc;
  undefined4 local_2c8;
  undefined4 local_2c4;
  undefined4 local_2c0;
  undefined4 local_2bc;
  undefined4 local_2b8;
  undefined4 local_2b4;
  undefined4 local_2b0;
  undefined4 local_2ac;
  undefined4 local_2a8;
  undefined4 local_2a4;
  undefined4 local_2a0;
  undefined4 local_29c;
  undefined4 local_298;
  undefined4 local_294;
  undefined4 local_290;
  undefined4 local_28c;
  longlong local_288;
  undefined1 local_280;
  undefined8 local_278;
  undefined4 local_268;
  undefined4 uStack_264;
  undefined4 uStack_260;
  undefined4 uStack_25c;
  undefined2 local_254;
  undefined2 local_252;
  int local_250;
  short local_24c;
  undefined4 local_1c0;
  longlong local_1b8;
  longlong local_1b0;
  short local_1a4;
  short local_1a2;
  int local_1a0;
  short local_19c;
  undefined4 local_110;
  undefined1 local_108 [24];
  int local_f0;
  short local_ec;
  undefined4 local_60;
  undefined1 local_58 [16];
  longlong local_48;
  
  local_278 = 0xfffffffffffffffe;
  if (param_3 < 0xd8) {
    local_res18[0] = param_3;
    FUN_140197b70(param_2,&local_328);
    plVar10 = local_328;
    if (local_328 != (longlong *)0x0) {
      if (local_328 == local_320) {
        if (*local_328 != 0) {
          FUN_140198570(param_2,&local_2f8);
          plVar1 = local_2f8;
          if (local_2f8 == (longlong *)0x0) {
LAB_140265cda:
            if (plVar1 != (longlong *)0x0) {
              if (plVar1 == local_2f0) {
                LOCK();
                plVar1 = plVar1 + 1;
                lVar9 = *plVar1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                plVar10 = local_328;
                if ((int)lVar9 == 1) {
                  puVar2 = (undefined8 *)*local_2f8;
                  if (puVar2 != (undefined8 *)0x0) {
                    (**(code **)*puVar2)(puVar2,1);
                  }
                  operator_delete(local_2f8);
                  plVar10 = local_328;
                }
              }
              else {
                iVar5 = DAT_140608054 + 1;
                bVar16 = DAT_140608054 == 0;
                DAT_140608054 = iVar5;
                if (bVar16) {
                  FUN_140176d60(1);
                }
              }
            }
            LOCK();
            plVar10 = plVar10 + 1;
            *(int *)plVar10 = (int)*plVar10 + -1;
            bVar16 = (int)*plVar10 == 0;
            UNLOCK();
          }
          else {
            if (local_2f8 != local_2f0) {
              iVar5 = DAT_14060804c + 1;
              bVar16 = DAT_14060804c == 0;
              DAT_14060804c = iVar5;
              if (bVar16) {
                FUN_140176d60(1);
              }
              goto LAB_140265cda;
            }
            if (*local_2f8 == 0) goto LAB_140265cda;
            FUN_14000a170(&local_1b8);
            bVar16 = false;
            local_110 = 0;
            FUN_14000a170(local_108);
            local_60 = 0;
            FUN_14000a170(&local_268);
            local_1c0 = 0;
            lVar9 = param_1 + 0x9130;
            local_48 = lVar9;
            FUN_14034ed40(lVar9);
            puVar14 = (undefined1 *)(param_1 + (longlong)param_3 * 0xac);
            FUN_140090020(local_108,puVar14);
            FUN_14034edd0(lVar9);
            uVar7 = FUN_140137690();
            uVar6 = FUN_140136b30(uVar7,local_f0);
            if (uVar6 == param_4) {
              uVar13 = (undefined2)param_4;
              sVar11 = (short)param_6;
              uVar15 = (undefined2)param_5;
              local_254 = uVar13;
              local_252 = uVar15;
              if (param_6 < local_ec) {
                FUN_140090020(&local_268,local_108);
                puVar8 = (undefined4 *)FUN_140357570(local_58);
                local_268 = *puVar8;
                uStack_264 = puVar8[1];
                uStack_260 = puVar8[2];
                uStack_25c = puVar8[3];
                local_ec = local_ec - sVar11;
                *(short *)(puVar14 + 0x1c) = *(short *)(puVar14 + 0x1c) - sVar11;
                local_298 = *(undefined4 *)(param_2 + 0x160);
                local_294 = *(undefined4 *)(param_2 + 0x164);
                local_290 = *(undefined4 *)(param_2 + 0x168);
                local_28c = *(undefined4 *)(param_2 + 0x16c);
                iVar5 = *(int *)(param_2 + 0x284);
                local_24c = sVar11;
                if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
                  local_336 = (undefined2)iVar5;
                  plVar10 = (longlong *)
                            (*(longlong *)
                              (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                            0x70);
                  (**(code **)(*plVar10 + 4000))
                            (plVar10,1,&DAT_1405d85a0,&local_336,&local_298,local_108);
                }
                puVar14 = local_108;
                piVar12 = local_res18;
              }
              else {
                FUN_140090020(&local_268,local_108);
                FUN_140090020(puVar14,&local_1b8);
                local_2a8 = *(undefined4 *)(param_2 + 0x160);
                local_2a4 = *(undefined4 *)(param_2 + 0x164);
                local_2a0 = *(undefined4 *)(param_2 + 0x168);
                local_29c = *(undefined4 *)(param_2 + 0x16c);
                iVar5 = *(int *)(param_2 + 0x284);
                if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
                  local_32e = (undefined2)iVar5;
                  plVar10 = (longlong *)
                            (*(longlong *)
                              (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                            0x70);
                  (**(code **)(*plVar10 + 0xfc0))
                            (plVar10,1,&DAT_1405d85a0,&local_32e,&local_2a8,&local_268);
                }
                local_332 = (undefined2)local_res18[0];
                piVar12 = (int *)&local_332;
              }
              plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
              (**(code **)(*plVar10 + 0x140))
                        (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,piVar12,puVar14,
                         &stack0x00000038);
              lVar9 = FUN_140174f00(&local_328);
              if ((param_4 < 5) && (param_5 < 0x18)) {
                lVar9 = ((longlong)(int)param_5 + (longlong)(int)param_4 * 0x18) * 0xac + lVar9;
                *(undefined2 *)(lVar9 + 0x14) = uVar13;
                *(undefined2 *)(lVar9 + 0x16) = uVar15;
                FUN_140090020(&local_1b8);
              }
              if ((local_1b8 == 0) && (local_1b0 == 0)) {
                bVar4 = false;
              }
              else {
                bVar4 = true;
              }
              if (((bVar4) || (local_1a0 != 0)) || (0 < local_19c)) {
                uVar7 = FUN_140137690();
                iVar5 = FUN_140136a70(uVar7,local_1a0);
                if (((local_f0 == local_1a0) && (1 < iVar5)) && (param_6 + local_19c <= iVar5)) {
                  local_19c = local_19c + sVar11;
                  plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                  psVar17 = &local_1a2;
                  (**(code **)(*plVar10 + 0xe0))
                            (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_1a4,psVar17,
                             &local_1b8);
                  uVar18 = (undefined4)((ulonglong)psVar17 >> 0x20);
                  local_2b8 = *(undefined4 *)(param_2 + 0x160);
                  local_2b4 = *(undefined4 *)(param_2 + 0x164);
                  local_2b0 = *(undefined4 *)(param_2 + 0x168);
                  local_2ac = *(undefined4 *)(param_2 + 0x16c);
                  local_2d8 = *(undefined4 *)(param_2 + 0x170);
                  local_2d4 = *(undefined4 *)(param_2 + 0x174);
                  local_2d0 = *(undefined4 *)(param_2 + 0x178);
                  local_2cc = *(undefined4 *)(param_2 + 0x17c);
                  iVar5 = *(int *)(param_2 + 0x284);
                  if (((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                     && (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0))
                  {
                    local_32c[0] = (undefined2)iVar5;
                    plVar10 = (longlong *)
                              (*(longlong *)
                                (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                              + 0x70);
                    puVar8 = &local_2d8;
                    (**(code **)(*plVar10 + 0x140))
                              (plVar10,1,&DAT_1405d85a0,local_32c,puVar8,&local_2b8,&local_1b8);
                    uVar18 = (undefined4)((ulonglong)puVar8 >> 0x20);
                  }
                  if (local_1a4 == 5) {
                    local_310[0] = 5;
                    uVar7 = FUN_140174f00(&local_328);
                    FUN_1401ed120(uVar7,local_310,&local_1b8);
                  }
                  else {
                    local_300[0] = (int)local_1a2;
                    local_318 = CONCAT44(local_318._4_4_,(int)local_1a4);
                    uVar7 = FUN_140174f00(&local_328);
                    if (-1 < local_1a4) {
                      FUN_1401ed220(uVar7,&local_318,local_300,&local_1b8,CONCAT44(uVar18,6));
                    }
                  }
                }
              }
              else {
                local_318 = FUN_140174f00(&local_328);
                lVar9 = local_318 + 0xf630;
                local_288 = lVar9;
                FUN_14034ed40(lVar9);
                local_280 = 1;
                if ((param_4 < 5) && (param_5 < 0x18)) {
                  uVar7 = FUN_140137690();
                  uVar6 = FUN_140136b30(uVar7,local_250);
                  if ((param_4 == uVar6) &&
                     (iVar5 = FUN_14011b180(((longlong)(int)param_5 + (longlong)(int)param_4 * 0x18)
                                            * 0xac + local_318), iVar5 != 0)) {
                    local_254 = uVar13;
                    local_252 = uVar15;
                    FUN_140090020(extraout_XMM0_Da,&local_268);
                  }
                }
                FUN_14034edd0(lVar9);
                local_2e8 = *(undefined4 *)(param_2 + 0x160);
                local_2e4 = *(undefined4 *)(param_2 + 0x164);
                local_2e0 = *(undefined4 *)(param_2 + 0x168);
                local_2dc = *(undefined4 *)(param_2 + 0x16c);
                local_2c8 = *(undefined4 *)(param_2 + 0x170);
                local_2c4 = *(undefined4 *)(param_2 + 0x174);
                local_2c0 = *(undefined4 *)(param_2 + 0x178);
                local_2bc = *(undefined4 *)(param_2 + 0x17c);
                iVar5 = *(int *)(param_2 + 0x284);
                local_308[0] = *(undefined4 *)(param_2 + 8);
                if ((-1 < iVar5) && (iVar5 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) {
                  if ((CONCAT44(uStack_264,local_268) != 0) ||
                     (CONCAT44(uStack_25c,uStack_260) != 0)) {
                    bVar16 = true;
                  }
                  if (((bVar16) && (local_250 != 0)) &&
                     (lVar9 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar9 != 0)) {
                    local_338 = (undefined2)iVar5;
                    plVar10 = (longlong *)
                              (*(longlong *)
                                (*(longlong *)(lVar9 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8)
                              + 0x70);
                    (**(code **)(*plVar10 + 0xb0))
                              (plVar10,1,&DAT_1405d85a0,&local_338,local_308,&local_2c8,&local_2e8,
                               &DAT_14047b980,&local_268);
                  }
                }
                plVar10 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                local_334 = uVar15;
                local_330 = uVar13;
                (**(code **)(*plVar10 + 0xc0))
                          (plVar10,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_330,&local_334
                           ,&local_268);
              }
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                puVar2 = (undefined8 *)*local_2f8;
                if (puVar2 != (undefined8 *)0x0) {
                  (**(code **)*puVar2)(puVar2,1);
                }
                operator_delete(local_2f8);
              }
              LOCK();
              plVar10 = local_328 + 1;
              *(int *)plVar10 = (int)*plVar10 + -1;
              bVar16 = (int)*plVar10 == 0;
              UNLOCK();
            }
            else {
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                puVar2 = (undefined8 *)*local_2f8;
                if (puVar2 != (undefined8 *)0x0) {
                  (**(code **)*puVar2)(puVar2,1);
                }
                operator_delete(local_2f8);
              }
              LOCK();
              plVar10 = local_328 + 1;
              *(int *)plVar10 = (int)*plVar10 + -1;
              bVar16 = (int)*plVar10 == 0;
              UNLOCK();
            }
          }
          if (bVar16) {
            pvVar3 = (void *)*local_328;
            if (pvVar3 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar3 + 0xf630);
              operator_delete(pvVar3);
            }
            operator_delete(local_328);
          }
          goto LAB_140265d66;
        }
      }
      else {
        iVar5 = DAT_140608048 + 1;
        bVar16 = DAT_140608048 == 0;
        DAT_140608048 = iVar5;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar10 != (longlong *)0x0) {
      if (plVar10 == local_320) {
        LOCK();
        plVar10 = plVar10 + 1;
        *(int *)plVar10 = (int)*plVar10 + -1;
        UNLOCK();
        if ((int)*plVar10 == 0) {
          pvVar3 = (void *)*local_328;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_328);
        }
      }
      else {
        iVar5 = DAT_140608050 + 1;
        bVar16 = DAT_140608050 == 0;
        DAT_140608050 = iVar5;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    uVar7 = 1;
  }
  else {
LAB_140265d66:
    uVar7 = 0;
  }
  return uVar7;
}



undefined8 FUN_140265de0(longlong param_1,longlong param_2,longlong param_3,int param_4,int param_5)

{
  longlong *plVar1;
  short sVar2;
  undefined8 *puVar3;
  void *pvVar4;
  longlong lVar5;
  int iVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  longlong *plVar9;
  short sVar10;
  undefined4 *puVar11;
  undefined2 uVar12;
  bool bVar13;
  int local_res20 [2];
  undefined8 in_stack_fffffffffffffd98;
  undefined4 uVar14;
  longlong *local_238;
  longlong *local_230;
  int local_228;
  undefined2 local_224;
  undefined2 local_222;
  undefined2 local_220;
  undefined2 local_21e;
  undefined2 local_21c;
  undefined2 local_21a;
  undefined2 local_218;
  undefined2 local_216;
  undefined2 local_214;
  undefined2 local_212;
  undefined2 local_210 [2];
  int local_20c;
  longlong *local_208;
  longlong *local_200;
  int local_1f8;
  int local_1f4;
  int local_1f0 [2];
  undefined4 local_1e8 [2];
  undefined4 local_1e0 [2];
  undefined4 local_1d8 [2];
  int local_1d0 [2];
  undefined4 local_1c8 [2];
  undefined4 local_1c0 [2];
  undefined4 local_1b8;
  undefined4 local_1b4;
  undefined4 local_1b0;
  undefined4 local_1ac;
  undefined4 local_1a8;
  undefined4 local_1a4;
  undefined4 local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  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;
  undefined4 local_11c;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined8 local_100;
  undefined1 local_f8 [16];
  undefined1 local_e8 [168];
  undefined4 local_40;
  
  uVar14 = (undefined4)((ulonglong)in_stack_fffffffffffffd98 >> 0x20);
  local_100 = 0xfffffffffffffffe;
  if (0xd7 < param_4) {
    return 0;
  }
  local_res20[0] = param_4;
  FUN_140197b70(param_2,&local_238);
  plVar9 = local_238;
  if (local_238 != (longlong *)0x0) {
    if (local_238 == local_230) {
      if (*local_238 != 0) {
        FUN_140198570(param_2,&local_208);
        plVar1 = local_208;
        if (local_208 != (longlong *)0x0) {
          if (local_208 == local_200) {
            if (*local_208 != 0) {
              FUN_14000a170(local_e8);
              local_40 = 0;
              puVar11 = (undefined4 *)((longlong)param_4 * 0xac + param_1);
              iVar6 = FUN_14011b180(puVar11);
              uVar12 = (undefined2)param_4;
              sVar10 = (short)param_5;
              if (iVar6 == 0) {
                uVar7 = FUN_140137690();
                iVar6 = FUN_140136a70(uVar7,*(undefined4 *)(param_3 + 0x18));
                local_228 = (int)*(short *)(param_3 + 0x14);
                local_20c = (int)*(short *)(param_3 + 0x16);
                if ((puVar11[6] == *(int *)(param_3 + 0x18)) && (1 < iVar6)) {
                  if (iVar6 < param_5 + *(short *)(puVar11 + 7)) {
                    LOCK();
                    plVar1 = plVar1 + 1;
                    *(int *)plVar1 = (int)*plVar1 + -1;
                    UNLOCK();
                    if ((int)*plVar1 == 0) {
                      puVar3 = (undefined8 *)*local_208;
                      if (puVar3 != (undefined8 *)0x0) {
                        (**(code **)*puVar3)(puVar3,1);
                      }
                      operator_delete(local_208);
                    }
                    LOCK();
                    plVar9 = local_238 + 1;
                    *(int *)plVar9 = (int)*plVar9 + -1;
                    bVar13 = (int)*plVar9 == 0;
                    UNLOCK();
                  }
                  else {
                    *(short *)(puVar11 + 7) = *(short *)(puVar11 + 7) + sVar10;
                    local_1a4 = *(undefined4 *)(param_2 + 0x160);
                    local_1a0 = *(undefined4 *)(param_2 + 0x164);
                    local_19c = *(undefined4 *)(param_2 + 0x168);
                    local_198 = *(undefined4 *)(param_2 + 0x16c);
                    iVar6 = *(int *)(param_2 + 0x284);
                    if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700)))
                       && (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0
                          )) {
                      local_214 = (undefined2)iVar6;
                      plVar9 = (longlong *)
                               (*(longlong *)
                                 (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8
                                 ) + 0x70);
                      (**(code **)(*plVar9 + 4000))
                                (plVar9,1,&DAT_1405d85a0,&local_214,&local_1a4,puVar11);
                    }
                    plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                    local_21a = uVar12;
                    (**(code **)(*plVar9 + 0x140))
                              (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_21a,puVar11
                               ,&stack0x00000030);
                    uVar14 = (undefined4)((ulonglong)puVar11 >> 0x20);
                    sVar2 = *(short *)(param_3 + 0x1c);
                    if (sVar2 == param_5) {
                      *(short *)(param_3 + 0x1c) = sVar2 - sVar10;
                      local_184 = *(undefined4 *)(param_2 + 0x160);
                      local_180 = *(undefined4 *)(param_2 + 0x164);
                      local_17c = *(undefined4 *)(param_2 + 0x168);
                      local_178 = *(undefined4 *)(param_2 + 0x16c);
                      local_164 = *(undefined4 *)(param_2 + 0x170);
                      local_160 = *(undefined4 *)(param_2 + 0x174);
                      local_15c = *(undefined4 *)(param_2 + 0x178);
                      local_158 = *(undefined4 *)(param_2 + 0x17c);
                      iVar6 = *(int *)(param_2 + 0x284);
                      local_1e8[0] = 0xffffffff;
                      local_1d8[0] = 0xffffffe4;
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                         (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0)
                         ) {
                        local_224 = (undefined2)iVar6;
                        plVar9 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar5 + 8) +
                                   (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        puVar11 = &local_164;
                        (**(code **)(*plVar9 + 0x130))
                                  (plVar9,1,&DAT_1405d85a0,&local_224,puVar11,&local_184,param_3,
                                   local_1d8,local_1e8);
                        uVar14 = (undefined4)((ulonglong)puVar11 >> 0x20);
                      }
                      FUN_140090020(param_3,local_e8);
                    }
                    else {
                      *(short *)(param_3 + 0x1c) = sVar2 - sVar10;
                      local_144 = *(undefined4 *)(param_2 + 0x160);
                      local_140 = *(undefined4 *)(param_2 + 0x164);
                      local_13c = *(undefined4 *)(param_2 + 0x168);
                      local_138 = *(undefined4 *)(param_2 + 0x16c);
                      local_124 = *(undefined4 *)(param_2 + 0x170);
                      local_120 = *(undefined4 *)(param_2 + 0x174);
                      local_11c = *(undefined4 *)(param_2 + 0x178);
                      local_118 = *(undefined4 *)(param_2 + 0x17c);
                      iVar6 = *(int *)(param_2 + 0x284);
                      if (((-1 < iVar6) &&
                          (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                         (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0)
                         ) {
                        local_222 = (undefined2)iVar6;
                        plVar9 = (longlong *)
                                 (*(longlong *)
                                   (*(longlong *)(lVar5 + 8) +
                                   (longlong)*(int *)(param_2 + 0x288) * 8) + 0x70);
                        puVar11 = &local_124;
                        (**(code **)(*plVar9 + 0x140))
                                  (plVar9,1,&DAT_1405d85a0,&local_222,puVar11,&local_144,param_3);
                        uVar14 = (undefined4)((ulonglong)puVar11 >> 0x20);
                      }
                    }
                    if (*(short *)(param_3 + 0x14) == 5) {
                      uVar7 = FUN_140174f00(&local_238);
                      FUN_1401ed120(uVar7,&local_228,param_3);
                      iVar6 = local_228;
                    }
                    else {
                      uVar7 = FUN_140174f00(&local_238);
                      iVar6 = local_228;
                      if (-1 < local_228) {
                        FUN_1401ed220(uVar7,&local_228,&local_20c,param_3,CONCAT44(uVar14,6));
                      }
                    }
                    local_220 = (undefined2)local_20c;
                    local_21c = (undefined2)iVar6;
                    plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                    (**(code **)(*plVar9 + 0xe0))
                              (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_21c,
                               &local_220,param_3);
                    LOCK();
                    plVar1 = plVar1 + 1;
                    *(int *)plVar1 = (int)*plVar1 + -1;
                    UNLOCK();
                    if ((int)*plVar1 == 0) {
                      puVar3 = (undefined8 *)*local_208;
                      if (puVar3 != (undefined8 *)0x0) {
                        (**(code **)*puVar3)(puVar3,1);
                      }
                      operator_delete(local_208);
                    }
                    LOCK();
                    plVar9 = local_238 + 1;
                    *(int *)plVar9 = (int)*plVar9 + -1;
                    bVar13 = (int)*plVar9 == 0;
                    UNLOCK();
                  }
                  goto LAB_140266925;
                }
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  puVar3 = (undefined8 *)*local_208;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  operator_delete(local_208);
                }
                LOCK();
                plVar9 = local_238 + 1;
                *(int *)plVar9 = (int)*plVar9 + -1;
                iVar6 = (int)*plVar9;
                UNLOCK();
                goto LAB_1402668c9;
              }
              FUN_140090020();
              *(undefined2 *)((longlong)puVar11 + 0x16) = uVar12;
              sVar2 = *(short *)(param_3 + 0x1c);
              if (sVar2 == param_5) {
                *(short *)(param_3 + 0x1c) = sVar2 - sVar10;
                local_194 = *(undefined4 *)(param_2 + 0x160);
                local_190 = *(undefined4 *)(param_2 + 0x164);
                local_18c = *(undefined4 *)(param_2 + 0x168);
                local_188 = *(undefined4 *)(param_2 + 0x16c);
                iVar6 = *(int *)(param_2 + 0x284);
                if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0)) {
                  local_210[0] = (undefined2)iVar6;
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  puVar8 = &local_194;
                  (**(code **)(*plVar9 + 0xfb0))
                            (plVar9,1,&DAT_1405d85a0,local_210,puVar8,&DAT_14047b97c,puVar11);
                  uVar14 = (undefined4)((ulonglong)puVar8 >> 0x20);
                }
                local_1b4 = *(undefined4 *)(param_2 + 0x160);
                local_1b0 = *(undefined4 *)(param_2 + 0x164);
                local_1ac = *(undefined4 *)(param_2 + 0x168);
                local_1a8 = *(undefined4 *)(param_2 + 0x16c);
                local_174 = *(undefined4 *)(param_2 + 0x170);
                local_170 = *(undefined4 *)(param_2 + 0x174);
                local_16c = *(undefined4 *)(param_2 + 0x178);
                local_168 = *(undefined4 *)(param_2 + 0x17c);
                iVar6 = *(int *)(param_2 + 0x284);
                local_1c0[0] = 0xffffffff;
                local_1c8[0] = 0xffffffdf;
                if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0)) {
                  local_218 = (undefined2)iVar6;
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  puVar8 = &local_174;
                  (**(code **)(*plVar9 + 0x130))
                            (plVar9,1,&DAT_1405d85a0,&local_218,puVar8,&local_1b4,param_3,local_1c8,
                             local_1c0);
                  uVar14 = (undefined4)((ulonglong)puVar8 >> 0x20);
                }
                sVar10 = *(short *)(param_3 + 0x14);
                if (sVar10 == 5) {
                  local_1b8 = 5;
                  uVar7 = FUN_140174f00(&local_238);
                  FUN_1401ed120(uVar7,&local_1b8,local_e8);
                }
                else {
                  local_1f0[0] = (int)*(short *)(param_3 + 0x16);
                  local_1d0[0] = (int)sVar10;
                  uVar7 = FUN_140174f00(&local_238);
                  if (-1 < sVar10) {
                    FUN_1401ed220(uVar7,local_1d0,local_1f0,local_e8,CONCAT44(uVar14,6));
                  }
                }
                plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                (**(code **)(*plVar9 + 0x140))
                          (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,local_res20,puVar11,
                           &stack0x00000030);
                plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                (**(code **)(*plVar9 + 0xe0))
                          (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,param_3 + 0x14,
                           param_3 + 0x16,local_e8);
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  puVar3 = (undefined8 *)*local_208;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  operator_delete(local_208);
                }
                LOCK();
                plVar9 = local_238 + 1;
                *(int *)plVar9 = (int)*plVar9 + -1;
                bVar13 = (int)*plVar9 == 0;
                UNLOCK();
              }
              else {
                *(short *)(param_3 + 0x1c) = sVar2 - sVar10;
                puVar8 = (undefined4 *)FUN_140357570(local_f8);
                *puVar11 = *puVar8;
                puVar11[1] = puVar8[1];
                puVar11[2] = puVar8[2];
                puVar11[3] = puVar8[3];
                *(short *)(puVar11 + 7) = sVar10;
                *(undefined2 *)((longlong)puVar11 + 0x16) = uVar12;
                local_114 = *(undefined4 *)(param_2 + 0x160);
                local_110 = *(undefined4 *)(param_2 + 0x164);
                local_10c = *(undefined4 *)(param_2 + 0x168);
                local_108 = *(undefined4 *)(param_2 + 0x16c);
                iVar6 = *(int *)(param_2 + 0x284);
                if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0)) {
                  local_212 = (undefined2)iVar6;
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  puVar8 = &local_114;
                  (**(code **)(*plVar9 + 0xfb0))
                            (plVar9,1,&DAT_1405d85a0,&local_212,puVar8,&DAT_14047b97c,puVar11);
                  uVar14 = (undefined4)((ulonglong)puVar8 >> 0x20);
                }
                local_154 = *(undefined4 *)(param_2 + 0x160);
                local_150 = *(undefined4 *)(param_2 + 0x164);
                local_14c = *(undefined4 *)(param_2 + 0x168);
                local_148 = *(undefined4 *)(param_2 + 0x16c);
                local_134 = *(undefined4 *)(param_2 + 0x170);
                local_130 = *(undefined4 *)(param_2 + 0x174);
                local_12c = *(undefined4 *)(param_2 + 0x178);
                local_128 = *(undefined4 *)(param_2 + 0x17c);
                iVar6 = *(int *)(param_2 + 0x284);
                if (((-1 < iVar6) && (iVar6 < *(short *)(*(longlong *)(param_2 + 0xb50) + 700))) &&
                   (lVar5 = *(longlong *)(*(longlong *)(param_2 + 0xb50) + 0x4c0), lVar5 != 0)) {
                  local_216 = (undefined2)iVar6;
                  plVar9 = (longlong *)
                           (*(longlong *)
                             (*(longlong *)(lVar5 + 8) + (longlong)*(int *)(param_2 + 0x288) * 8) +
                           0x70);
                  puVar8 = &local_134;
                  (**(code **)(*plVar9 + 0x140))
                            (plVar9,1,&DAT_1405d85a0,&local_216,puVar8,&local_154,param_3);
                  uVar14 = (undefined4)((ulonglong)puVar8 >> 0x20);
                }
                sVar10 = *(short *)(param_3 + 0x14);
                if (sVar10 == 5) {
                  local_1e0[0] = 5;
                  uVar7 = FUN_140174f00(&local_238);
                  FUN_1401ed120(uVar7,local_1e0,param_3);
                }
                else {
                  local_1f8 = (int)*(short *)(param_3 + 0x16);
                  local_1f4 = (int)sVar10;
                  uVar7 = FUN_140174f00(&local_238);
                  if (-1 < sVar10) {
                    FUN_1401ed220(uVar7,&local_1f4,&local_1f8,param_3,CONCAT44(uVar14,6));
                  }
                }
                plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                local_21e = uVar12;
                (**(code **)(*plVar9 + 0x140))
                          (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,&local_21e,puVar11,
                           &stack0x00000030);
                plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
                (**(code **)(*plVar9 + 0xe0))
                          (plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,param_3 + 0x14,
                           param_3 + 0x16,param_3);
                LOCK();
                plVar1 = plVar1 + 1;
                *(int *)plVar1 = (int)*plVar1 + -1;
                UNLOCK();
                if ((int)*plVar1 == 0) {
                  puVar3 = (undefined8 *)*local_208;
                  if (puVar3 != (undefined8 *)0x0) {
                    (**(code **)*puVar3)(puVar3,1);
                  }
                  operator_delete(local_208);
                }
                LOCK();
                plVar9 = local_238 + 1;
                *(int *)plVar9 = (int)*plVar9 + -1;
                bVar13 = (int)*plVar9 == 0;
                UNLOCK();
              }
              goto LAB_140266925;
            }
          }
          else {
            iVar6 = DAT_14060804c + 1;
            bVar13 = DAT_14060804c == 0;
            DAT_14060804c = iVar6;
            if (bVar13) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == local_200) {
            LOCK();
            plVar1 = plVar1 + 1;
            lVar5 = *plVar1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            plVar9 = local_238;
            if ((int)lVar5 == 1) {
              puVar3 = (undefined8 *)*local_208;
              if (puVar3 != (undefined8 *)0x0) {
                (**(code **)*puVar3)(puVar3,1);
              }
              operator_delete(local_208);
              plVar9 = local_238;
            }
          }
          else {
            iVar6 = DAT_140608054 + 1;
            bVar13 = DAT_140608054 == 0;
            DAT_140608054 = iVar6;
            if (bVar13) {
              FUN_140176d60(1);
            }
          }
        }
        LOCK();
        plVar9 = plVar9 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        iVar6 = (int)*plVar9;
        UNLOCK();
LAB_1402668c9:
        if (iVar6 == 0) {
          pvVar4 = (void *)*local_238;
          if (pvVar4 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar4 + 0xf630);
            operator_delete(pvVar4);
          }
          operator_delete(local_238);
        }
        return 0;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar13 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar9 == (longlong *)0x0) {
    return 1;
  }
  if (plVar9 != local_230) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 1;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 1;
  }
  LOCK();
  plVar9 = plVar9 + 1;
  *(int *)plVar9 = (int)*plVar9 + -1;
  bVar13 = (int)*plVar9 == 0;
  UNLOCK();
LAB_140266925:
  if (bVar13) {
    pvVar4 = (void *)*local_238;
    if (pvVar4 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar4 + 0xf630);
      operator_delete(pvVar4);
    }
    operator_delete(local_238);
  }
  return 1;
}



undefined8 FUN_140266970(longlong param_1,uint param_2,uint param_3)

{
  longlong lVar1;
  uint *puVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 uVar5;
  bool bVar6;
  
  if (param_2 == 0) {
    uVar5 = 0;
    if (*(longlong *)(param_1 + 0x128) != 0) {
      for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x128) +
                              ((ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x138)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 6)) {
        if ((puVar2[8] == param_3) && (*puVar2 == param_3)) {
          if (puVar2 == (uint *)0x0) {
            return 0;
          }
          puVar3 = *(undefined8 **)(puVar2 + 2);
          if (puVar3 != (undefined8 *)0x0) {
            if (puVar3 == *(undefined8 **)(puVar2 + 4)) {
              uVar5 = *puVar3;
            }
            else {
              iVar4 = DAT_140608238 + 1;
              bVar6 = DAT_140608238 == 0;
              DAT_140608238 = iVar4;
              if (bVar6) {
                FUN_140176d60(1);
                return 0;
              }
            }
          }
          return uVar5;
        }
      }
    }
  }
  else if (param_2 < 4) {
    lVar1 = *(longlong *)(param_1 + 8 + (longlong)(int)(param_2 - 1) * 0x48);
    if (lVar1 != 0) {
      for (puVar2 = *(uint **)(lVar1 + ((ulonglong)param_3 %
                                       (ulonglong)
                                       *(uint *)(param_1 + 0x18 +
                                                (longlong)(int)(param_2 - 1) * 0x48)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 6)) {
        if ((puVar2[8] == param_3) && (*puVar2 == param_3)) {
          if (puVar2 == (uint *)0x0) {
            return 0;
          }
          uVar5 = FUN_140266a70(puVar2 + 2);
          return uVar5;
        }
      }
    }
  }
  return 0;
}



undefined8 FUN_140266a70(longlong *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  bool bVar3;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    if (puVar1 == (undefined8 *)param_1[1]) {
      return *puVar1;
    }
    iVar2 = DAT_140608238 + 1;
    bVar3 = DAT_140608238 == 0;
    DAT_140608238 = iVar2;
    if (bVar3) {
      FUN_140176d60(1);
    }
  }
  return 0;
}



undefined8 FUN_140266ab0(uint param_1,int param_2,ulonglong *param_3)

{
  uint uVar1;
  uint *puVar2;
  uint uVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  uint *puVar8;
  longlong lVar9;
  undefined8 *puVar10;
  longlong *plVar11;
  uint *puVar12;
  void *_Dst;
  longlong *plVar13;
  longlong *plVar14;
  longlong *plVar15;
  uint uVar16;
  longlong *plVar17;
  longlong local_res20;
  longlong *local_148;
  longlong *local_140;
  longlong *local_138;
  longlong local_128;
  longlong *plStack_120;
  longlong *local_118;
  undefined8 local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f8;
  undefined8 local_e8;
  undefined8 uStack_e0;
  uint local_d0;
  undefined2 local_cc;
  uint local_80;
  undefined4 local_40;
  
  local_110 = 0xfffffffffffffffe;
  local_108 = 0;
  local_100 = 0;
  local_f8 = 0;
  lVar5 = FUN_140139d80();
  lVar6 = FUN_140137690();
  if (*(longlong *)(lVar6 + 0x88) != 0) {
    for (puVar12 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                             ((ulonglong)param_1 % (ulonglong)*(uint *)(lVar6 + 0x98)) * 8);
        puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0xa6)) {
      if ((puVar12[0xa8] == param_1) && (*puVar12 == param_1)) {
        if (puVar12 == (uint *)0x0) {
          return 0;
        }
        if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (puVar12 == (uint *)0xfffffffffffffff8) {
          return 0;
        }
        plVar13 = (longlong *)0x0;
        local_148 = (longlong *)0x0;
        plVar14 = (longlong *)0x0;
        local_140 = (longlong *)0x0;
        plVar15 = (longlong *)0x0;
        local_138 = (longlong *)0x0;
        plVar17 = (longlong *)(lVar5 + 8);
        plStack_120 = plVar17;
        local_118 = plVar17;
        if (*(longlong *)(lVar5 + 0x10) == 0) goto LAB_140266bbc;
        uVar7 = 0;
        if (*(uint *)(lVar5 + 0x18) == 0) goto LAB_140266bbc;
        plVar11 = (longlong *)*plVar17;
        goto LAB_140266ba4;
      }
    }
  }
  return 0;
  while( true ) {
    uVar3 = (int)uVar7 + 1;
    uVar7 = (ulonglong)uVar3;
    plVar11 = plVar11 + 1;
    if (*(uint *)(lVar5 + 0x18) <= uVar3) break;
LAB_140266ba4:
    if (*plVar11 != 0) {
      local_128 = ((longlong *)*plVar17)[uVar7];
      lVar6 = local_128;
      goto LAB_140266be0;
    }
  }
LAB_140266bbc:
  local_128 = 0;
  lVar6 = local_128;
LAB_140266be0:
  lVar9 = lVar6;
  if (lVar9 != 0) {
    lVar6 = lVar9 + 8;
    local_res20 = lVar6;
    if ((((*(uint *)(lVar9 + 0x10) == 0) || (*(uint *)(lVar9 + 0x10) == param_1)) &&
        (*(int *)(lVar9 + 0x14) <= (int)puVar12[0x44])) &&
       ((int)puVar12[0x44] <= *(int *)(lVar9 + 0x18))) {
      puVar2 = *(uint **)(lVar9 + 0x28);
      puVar8 = *(uint **)(lVar9 + 0x20);
      if (puVar2 != puVar8) {
        do {
          if (*puVar8 == puVar12[0x32]) break;
          puVar8 = puVar8 + 1;
        } while (puVar8 != puVar2);
        if (puVar2 != puVar8) {
          puVar2 = *(uint **)(lVar9 + 0x48);
          puVar8 = *(uint **)(lVar9 + 0x40);
          if (puVar2 != puVar8) {
            do {
              if (*puVar8 == puVar12[0x33]) break;
              puVar8 = puVar8 + 1;
            } while (puVar8 != puVar2);
            if (puVar2 != puVar8) {
              puVar2 = *(uint **)(lVar9 + 0x68);
              puVar8 = *(uint **)(lVar9 + 0x60);
              if (puVar2 != puVar8) {
                do {
                  if (*puVar8 == puVar12[0x35]) break;
                  puVar8 = puVar8 + 1;
                } while (puVar8 != puVar2);
                if (puVar2 != puVar8) {
                  if ((&local_res20 < plVar14) && (plVar13 <= &local_res20)) {
                    lVar6 = (longlong)&local_res20 - (longlong)plVar13;
                    if (plVar14 == plVar15) {
                      FUN_140195b20(&local_148);
                      plVar13 = local_148;
                      plVar14 = local_140;
                      plVar15 = local_138;
                    }
                    if (plVar14 != (longlong *)0x0) {
                      *plVar14 = plVar13[lVar6 >> 3];
                    }
                  }
                  else {
                    if (plVar14 == plVar15) {
                      FUN_140195b20(&local_148);
                      plVar13 = local_148;
                      plVar14 = local_140;
                      plVar15 = local_138;
                    }
                    if (plVar14 != (longlong *)0x0) {
                      *plVar14 = lVar6;
                    }
                  }
                  plVar14 = plVar14 + 1;
                  local_140 = plVar14;
                }
              }
            }
          }
        }
      }
    }
    lVar6 = *(longlong *)(lVar9 + 0x90);
    if (lVar6 == 0) {
      uVar3 = *(uint *)(lVar9 + 0x98) % *(uint *)(lVar5 + 0x18) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      do {
        if (*(uint *)(lVar5 + 0x18) <= uVar3) break;
        if (*(longlong *)(*plVar17 + lVar9) != 0) {
          lVar6 = *(longlong *)(*plVar17 + lVar9);
        }
        uVar3 = uVar3 + 1;
        lVar9 = lVar9 + 8;
      } while (lVar6 == 0);
    }
    goto LAB_140266be0;
  }
  if (plVar17 != local_118) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar16 = 0;
  uVar3 = (uint)((longlong)plVar14 - (longlong)local_148 >> 3);
  plVar17 = local_148;
  if (uVar3 != 0) {
    do {
      lVar5 = *plVar17;
      iVar4 = rand();
      if ((float)(iVar4 % 1000) < *(float *)(lVar5 + 0x78) ||
          (float)(iVar4 % 1000) == *(float *)(lVar5 + 0x78)) {
        if (*(int *)(lVar5 + 0x80) < 2) {
          iVar4 = 1;
        }
        else {
          iVar4 = rand();
          iVar4 = iVar4 % *(int *)(lVar5 + 0x80) + 1;
        }
        if (iVar4 < *(int *)(lVar5 + 0x7c)) {
          iVar4 = *(int *)(lVar5 + 0x7c);
        }
        puVar10 = (undefined8 *)FUN_140357570(&local_128);
        FUN_14000a170(&local_e8);
        local_40 = 0;
        local_e8 = *puVar10;
        uStack_e0 = puVar10[1];
        uVar1 = *(uint *)(lVar5 + 4);
        local_cc = (undefined2)iVar4;
        local_d0 = uVar1;
        lVar5 = FUN_140137690();
        if (*(longlong *)(lVar5 + 0x88) != 0) {
          for (puVar12 = *(uint **)(*(longlong *)(lVar5 + 0x88) +
                                   ((ulonglong)uVar1 % (ulonglong)*(uint *)(lVar5 + 0x98)) * 8);
              puVar12 != (uint *)0x0; puVar12 = *(uint **)(puVar12 + 0xa6)) {
            if ((puVar12[0xa8] == uVar1) && (*puVar12 == uVar1)) {
              if (puVar12 != (uint *)0x0) {
                if (puVar12 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_80 = puVar12[0x5b];
                goto LAB_140266eab;
              }
              break;
            }
          }
        }
        local_80 = 1;
LAB_140266eab:
        puVar10 = (undefined8 *)param_3[1];
        if ((&local_e8 < puVar10) && ((undefined8 *)*param_3 <= &local_e8)) {
          lVar5 = (longlong)&local_e8 - (longlong)*param_3;
          lVar5 = lVar5 / 0x56 + (lVar5 >> 0x3f);
          if (puVar10 == (undefined8 *)param_3[2]) {
            FUN_14008f210(param_3,1);
          }
          puVar10 = (undefined8 *)(((lVar5 >> 1) - (lVar5 >> 0x3f)) * 0xac + *param_3);
          _Dst = (void *)param_3[1];
          if (_Dst != (void *)0x0) {
LAB_140266f36:
            memcpy(_Dst,puVar10,0xac);
          }
        }
        else {
          if (puVar10 == (undefined8 *)param_3[2]) {
            FUN_14008f210(param_3,1);
          }
          _Dst = (void *)param_3[1];
          if (_Dst != (void *)0x0) {
            puVar10 = &local_e8;
            goto LAB_140266f36;
          }
        }
        param_3[1] = param_3[1] + 0xac;
        if ((int)((longlong)(param_3[1] - *param_3) / 0xac) == param_2) break;
      }
      uVar16 = uVar16 + 1;
      plVar17 = plVar17 + 1;
    } while (uVar16 < uVar3);
  }
  if (local_148 != (longlong *)0x0) {
    operator_delete(local_148);
  }
  return 1;
}



undefined4
FUN_140266fd0(undefined8 *param_1,ulonglong *param_2,undefined8 param_3,longlong *param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  ulonglong *puVar3;
  undefined4 *puVar4;
  int iVar5;
  bool bVar6;
  ulonglong local_28;
  ulonglong uStack_20;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  plVar1 = (longlong *)*param_1;
  plVar2 = (longlong *)param_1[1];
  if (plVar1 != plVar2) {
    param_4 = plVar1;
    do {
      puVar3 = (ulonglong *)*param_4;
      if (puVar3 != (ulonglong *)0x0) {
        bVar6 = *param_2 < *puVar3;
        if ((*param_2 == *puVar3) && (bVar6 = param_2[1] < puVar3[1], param_2[1] == puVar3[1])) {
          iVar5 = 0;
        }
        else {
          iVar5 = (1 - (uint)bVar6) - (uint)(bVar6 != 0);
        }
        if (iVar5 == 0) break;
      }
      param_4 = param_4 + 1;
    } while (param_4 != plVar2);
    if (plVar2 != param_4) {
      puVar4 = (undefined4 *)*param_4;
      *(undefined4 *)(param_1 + 4) = *puVar4;
      *(undefined4 *)((longlong)param_1 + 0x24) = puVar4[1];
      *(undefined4 *)(param_1 + 5) = puVar4[2];
      *(undefined4 *)((longlong)param_1 + 0x2c) = puVar4[3];
      *(undefined4 *)(param_1 + 6) = puVar4[4];
      *(undefined4 *)((longlong)param_1 + 0x34) = puVar4[5];
      *(undefined4 *)(param_1 + 7) = puVar4[6];
      return *(undefined4 *)(param_1 + 6);
    }
  }
  local_28 = *param_2;
  uStack_20 = param_2[1];
  local_18 = (undefined4)param_2[2];
  local_14 = *(undefined4 *)((longlong)param_2 + 0x14);
  local_10 = (undefined4)param_2[3];
  if ((ulonglong)((longlong)plVar2 - (longlong)plVar1 >> 3) < 0x32) {
    FUN_1402670e0(param_1,&local_28,0,param_4,0xfffffffffffffffe);
  }
  else {
    FUN_1400050f0(L"ERROR >> MGSTitle::Add [Title is Full!!!]");
  }
  return 0xffffffff;
}



undefined8 FUN_1402670e0(ulonglong *param_1,ulonglong *param_2,char param_3)

{
  longlong *plVar1;
  ulonglong *puVar2;
  undefined4 **ppuVar3;
  undefined4 **ppuVar4;
  undefined4 *puVar5;
  int iVar6;
  longlong *plVar7;
  bool bVar8;
  undefined4 *local_res20;
  
  if (param_3 == '\x01') {
    plVar7 = (longlong *)*param_1;
    plVar1 = (longlong *)param_1[1];
    if (plVar7 != plVar1) {
      do {
        puVar2 = (ulonglong *)*plVar7;
        if (puVar2 != (ulonglong *)0x0) {
          bVar8 = *param_2 < *puVar2;
          if (*param_2 == *puVar2) {
            bVar8 = param_2[1] < puVar2[1];
            if (param_2[1] != puVar2[1]) goto LAB_140267133;
            iVar6 = 0;
          }
          else {
LAB_140267133:
            iVar6 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
          }
          if (iVar6 == 0) break;
        }
        plVar7 = plVar7 + 1;
      } while (plVar7 != plVar1);
      if (plVar1 != plVar7) {
        FUN_1400050f0(L"ERROR >> MGSTitle::Add [Title is Overlap!!!]");
        return 0;
      }
    }
  }
  puVar5 = operator_new(0x1c);
  if (puVar5 == (undefined4 *)0x0) {
    puVar5 = (undefined4 *)0x0;
  }
  else {
    *puVar5 = (int)*param_2;
    puVar5[1] = *(undefined4 *)((longlong)param_2 + 4);
    puVar5[2] = (int)param_2[1];
    puVar5[3] = *(undefined4 *)((longlong)param_2 + 0xc);
    puVar5[4] = (int)param_2[2];
    puVar5[5] = *(undefined4 *)((longlong)param_2 + 0x14);
    puVar5[6] = (int)param_2[3];
  }
  ppuVar3 = (undefined4 **)param_1[1];
  local_res20 = puVar5;
  if (&local_res20 < ppuVar3) {
    ppuVar4 = (undefined4 **)*param_1;
    if (ppuVar4 <= &local_res20) {
      if (ppuVar3 == (undefined4 **)param_1[2]) {
        FUN_1402675e0(param_1);
      }
      if ((undefined8 *)param_1[1] != (undefined8 *)0x0) {
        *(undefined8 *)param_1[1] =
             *(undefined8 *)(*param_1 + ((longlong)&local_res20 - (longlong)ppuVar4 >> 3) * 8);
      }
      goto LAB_140267215;
    }
  }
  if (ppuVar3 == (undefined4 **)param_1[2]) {
    FUN_1402675e0(param_1);
  }
  if ((undefined8 *)param_1[1] != (undefined8 *)0x0) {
    *(undefined8 *)param_1[1] = puVar5;
  }
LAB_140267215:
  param_1[1] = param_1[1] + 8;
  return 1;
}



undefined8 FUN_140267230(undefined8 *param_1,undefined4 *param_2,ulonglong *param_3)

{
  LPSYSTEMTIME lpSystemTime;
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int iVar5;
  longlong *plVar6;
  ulonglong *puVar7;
  ulonglong uVar8;
  undefined4 *puVar9;
  int iVar10;
  int iVar11;
  undefined8 *puVar12;
  void *pvVar13;
  longlong lVar14;
  longlong *plVar15;
  bool bVar16;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  undefined4 local_58;
  int local_54;
  int local_50;
  undefined4 uStack_4c;
  
  *param_2 = 0xffffffff;
  plVar6 = (longlong *)param_1[1];
  plVar15 = (longlong *)*param_1;
  local_68 = (undefined4)*param_3;
  uStack_64 = *(undefined4 *)((longlong)param_3 + 4);
  uStack_60 = (undefined4)param_3[1];
  uStack_5c = *(undefined4 *)((longlong)param_3 + 0xc);
  uVar8 = param_3[1];
  if (plVar6 != plVar15) {
    do {
      puVar7 = (ulonglong *)*plVar15;
      if (puVar7 != (ulonglong *)0x0) {
        bVar16 = *param_3 < *puVar7;
        if ((*param_3 == *puVar7) && (bVar16 = uVar8 < puVar7[1], uVar8 == puVar7[1])) {
          iVar10 = 0;
        }
        else {
          iVar10 = (1 - (uint)bVar16) - (uint)(bVar16 != 0);
        }
        if (iVar10 == 0) break;
      }
      plVar15 = plVar15 + 1;
    } while (plVar15 != plVar6);
    if (plVar6 != plVar15) {
      uVar8 = param_1[4];
      bVar16 = *param_3 < uVar8;
      if ((*param_3 == uVar8) &&
         (bVar16 = param_3[1] < (ulonglong)param_1[5], param_3[1] == param_1[5])) {
        iVar10 = 0;
      }
      else {
        iVar10 = (1 - (uint)bVar16) - (uint)(bVar16 != 0);
      }
      if (iVar10 == 0) {
        puVar12 = (undefined8 *)FUN_140415800(&local_68,param_3,param_1,plVar15,0xfffffffffffffffe);
        if (7 < (ulonglong)puVar12[3]) {
          puVar12 = (undefined8 *)*puVar12;
        }
        FUN_1400050f0(L"ERROR >> MGSTitle::Equip [Alread Title-%s]",puVar12);
        if (7 < CONCAT44(uStack_4c,local_50)) {
          operator_delete((void *)CONCAT44(uStack_64,local_68));
        }
        return 0x13b;
      }
      puVar9 = (undefined4 *)*plVar15;
      uVar1 = *puVar9;
      uVar2 = puVar9[1];
      uVar3 = puVar9[2];
      uStack_5c = puVar9[3];
      uVar4 = puVar9[4];
      iVar10 = puVar9[5];
      iVar5 = puVar9[6];
      if (0 < iVar10) {
        lVar14 = DAT_140607cc0;
        local_68 = uVar1;
        uStack_64 = uVar2;
        uStack_60 = uVar3;
        local_58 = uVar4;
        local_54 = iVar10;
        local_50 = iVar5;
        if (DAT_140607cc0 == 0) {
          pvVar13 = operator_new(0x130);
          lVar14 = 0;
          if (pvVar13 != (void *)0x0) {
            lVar14 = FUN_1401e04e0(pvVar13);
          }
        }
        DAT_140607cc0 = lVar14;
        lpSystemTime = (LPSYSTEMTIME)(DAT_140607cc0 + 200);
        GetLocalTime(lpSystemTime);
        iVar11 = FUN_1401e2290(lpSystemTime);
        if ((0 < iVar5) && (iVar5 <= iVar11)) {
          FUN_1400050f0(L"ERROR >> MGSTitle::Equip [Title expire-%d]",uVar4);
          return 0x13a;
        }
      }
      *(undefined4 *)(param_1 + 4) = uVar1;
      *(undefined4 *)((longlong)param_1 + 0x24) = uVar2;
      *(undefined4 *)(param_1 + 5) = uVar3;
      *(undefined4 *)((longlong)param_1 + 0x2c) = uStack_5c;
      *(undefined4 *)(param_1 + 6) = uVar4;
      *(int *)((longlong)param_1 + 0x34) = iVar10;
      *(int *)(param_1 + 7) = iVar5;
      *(int *)(param_1 + 7) = iVar5;
      *param_2 = *(undefined4 *)(param_1 + 6);
      return 1;
    }
  }
  puVar12 = (undefined8 *)FUN_140415800(&local_68,param_3,param_1,plVar15,0xfffffffffffffffe);
  if (7 < (ulonglong)puVar12[3]) {
    puVar12 = (undefined8 *)*puVar12;
  }
  FUN_1400050f0(L"ERROR >> MGSTitle::Equip [Have no Title-%s]",puVar12);
  if (7 < CONCAT44(uStack_4c,local_50)) {
    operator_delete((void *)CONCAT44(uStack_64,local_68));
  }
  return 0x4d;
}



void FUN_140267470(undefined8 *param_1)

{
  undefined4 *puVar1;
  void *_Dst;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)*param_1;
  if (puVar2 != (undefined8 *)param_1[1]) {
    do {
      puVar1 = (undefined4 *)*puVar2;
      if (puVar1 != (undefined4 *)0x0) {
        *puVar1 = 0;
        puVar1[1] = 0;
        puVar1[2] = 0;
        *(undefined8 *)(puVar1 + 4) = 0;
        puVar1[3] = 0;
        puVar1[6] = 0;
        operator_delete(puVar1);
      }
      puVar2 = puVar2 + 1;
    } while ((undefined8 *)param_1[1] != puVar2);
    _Dst = (void *)*param_1;
    if (_Dst != (void *)param_1[1]) {
      memmove(_Dst,(void *)param_1[1],0);
      param_1[1] = _Dst;
    }
  }
  return;
}



void FUN_140267520(longlong *param_1,ulonglong param_2)

{
  void *pvVar1;
  longlong lVar2;
  code *pcVar3;
  void *_Dst;
  
  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) {
    _Dst = (void *)FUN_1401e02d0(param_2);
    memmove(_Dst,(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)((longlong)_Dst + param_2 * 8);
    param_1[1] = (longlong)((longlong)_Dst + (lVar2 - (longlong)pvVar1 >> 3) * 8);
    *param_1 = (longlong)_Dst;
  }
  return;
}



void FUN_1402675e0(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_140267520(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140267520(param_1,uVar2);
  }
  return;
}



undefined8 FUN_140267670(undefined4 param_1,uint param_2,longlong param_3)

{
  uint *puVar1;
  char cVar2;
  longlong *plVar3;
  undefined8 uVar4;
  
  if (param_2 != 0) {
    plVar3 = (longlong *)FUN_1403161f0();
    if (*plVar3 != 0) {
      for (puVar1 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8
                              ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
        if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
          if ((puVar1 != (uint *)0x0) &&
             (((*(char *)((longlong)puVar1 + 9) != '\0' && (param_3 != 0)) &&
              (cVar2 = FUN_140236c80(param_3,param_2), cVar2 != '\0')))) {
            return 0;
          }
          break;
        }
      }
    }
  }
  uVar4 = FUN_140267710(param_1);
  return uVar4;
}



undefined8 * FUN_140267710(undefined4 param_1)

{
  undefined8 *puVar1;
  void *pvVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  int iVar5;
  
  puVar3 = (undefined8 *)0x0;
  puVar4 = (undefined8 *)0x0;
  iVar5 = DAT_140607cc8 + 1;
  DAT_140607cc8 = iVar5;
  switch(param_1) {
  case 1:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026c350(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 2:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026c500(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 3:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026c770(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 4:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026cb40(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 5:
    pvVar2 = operator_new(0xb0);
    if (pvVar2 != (void *)0x0) {
      puVar4 = (undefined8 *)FUN_14026c350(pvVar2,iVar5);
    }
    goto LAB_1402678de;
  case 6:
    pvVar2 = operator_new(0xb0);
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026c500(pvVar2,iVar5);
      *(undefined4 *)(puVar3 + 5) = 1;
      return puVar3;
    }
    goto LAB_1402678de;
  case 7:
    pvVar2 = operator_new(0xb8);
    puVar4 = puVar3;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026c770(pvVar2,iVar5);
      *(undefined4 *)(puVar3 + 5) = 1;
      return puVar3;
    }
    goto LAB_1402678de;
  case 8:
    pvVar2 = operator_new(0xb8);
    puVar4 = puVar3;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026cb40(pvVar2,iVar5);
      *(undefined4 *)(puVar3 + 5) = 1;
      return puVar3;
    }
    goto LAB_1402678de;
  case 9:
    puVar1 = operator_new(0xa8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectNotUseJump::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 10:
    puVar1 = operator_new(0xa8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectNotUseAttack::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0xb:
    puVar1 = operator_new(0xa8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectInvincibility::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0xc:
    puVar1 = operator_new(0xb8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectThatDropDamage::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0xd:
    puVar1 = operator_new(0xa8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectHoldUp::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0xe:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectBonusExp::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0xf:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectHPMPInc::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x10:
    puVar1 = operator_new(0xa8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectResurrection::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x11:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectHpUpMinMax::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x12:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectAntiCondition::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x13:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCRITICAL_POINT_INC::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x14:
    puVar1 = operator_new(0xb8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *(undefined4 *)(puVar1 + 0x16) = 0;
      *puVar1 = MGSAddEffectCRITICAL_POINT_INC_MASTERY::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x15:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectGUARD_DEFENSE_PERCENT_INC::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x16:
    puVar1 = operator_new(0xa8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *puVar1 = MGSAddEffectGUARD_DISABLE::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x17:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectALL_ATTACK_BLOODSUCKING::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x18:
    puVar1 = operator_new(0xc0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *(undefined4 *)(puVar1 + 0x16) = 0;
      *puVar1 = MGSAddEffectDAMAGE_RANGE::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x19:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectMP_CONSUMPTION_DOWN::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x1a:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectATTACK_SPEED_PERCENT_INC::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x1b:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectMOVE_SPEED_PERCENT_INC::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x1c:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *puVar1 = MGSAddEffectSUPER_ARMOR::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x1d:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCASTING_TIME_DOWN_NOLIMIT::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x1e:
    puVar1 = operator_new(0xb8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *(undefined4 *)(puVar1 + 0x16) = 0;
      *puVar1 = MGSAddEffectCASTING_TIME_DOWN_MASTERY::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x1f:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCASTING_TIME_DOWN::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x20:
    puVar1 = operator_new(0xb8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *(undefined4 *)(puVar1 + 0x16) = 0;
      *puVar1 = MGSAddEffectMAX_HP_PERCENT_INC_MASTERY::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x21:
    puVar1 = operator_new(0xb8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *(undefined4 *)(puVar1 + 0x16) = 0;
      *puVar1 = MGSAddEffectMAX_MP_POINT_INC_MASTERY::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x22:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *puVar1 = MGSAddEffectMAX_HP_OR_MP_POINT_INC::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x23:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *puVar1 = MGSAddEffectMAX_HP_OR_MP_PERCENT_INC::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x24:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_ATTACK_LEVEL_INC_Bleeding::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x25:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_Stun::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x26:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_PROBABILITY_INC_Stun::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x27:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_Bleeding::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x28:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_Bleeding_NOLIMIT::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x29:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_Slow::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x2a:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_Stone::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x2b:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_Fire::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x2c:
    puVar1 = operator_new(0xb8);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *(undefined4 *)(puVar1 + 0x16) = 0;
      *puVar1 = MGSAddEffectCONDITION_ACTIVITY_RANGE::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x2d:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_Poison::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x2e:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_ALL::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0x2f:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140286540(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x30:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140286d80(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x31:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140286ed0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x32:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287010(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x33:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287160(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x34:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287290(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x35:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402873e0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x36:
    pvVar2 = operator_new(0xc0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288250(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x37:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288430(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x38:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288580(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x39:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402886b0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x3a:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288810(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x3b:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288ad0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x3c:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288d50(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x3d:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288fd0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x3e:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140289130(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x3f:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140289260(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x40:
    pvVar2 = operator_new(0xc0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402893c0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x41:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402896f0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x42:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402899b0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x43:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140289b10(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x44:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028aa80(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x46:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140286740(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x47:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288970(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x48:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288c10(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x49:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288e90(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x4a:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028a920(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x4b:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14027fce0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x4c:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14027fbd0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x4d:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14027ffa0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x4e:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402846b0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x4f:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402848f0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x50:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028ad10(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x51:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028aeb0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x52:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028b0e0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x53:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028b230(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x54:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028b370(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x55:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028b4b0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x56:
    pvVar2 = operator_new(0xc0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026d5c0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x57:
    pvVar2 = operator_new(0xc0);
    puVar4 = puVar3;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026d5c0(pvVar2,iVar5);
      *(undefined4 *)(puVar3 + 5) = 1;
      return puVar3;
    }
LAB_1402678de:
    *(undefined4 *)(puVar4 + 5) = 1;
    return puVar4;
  case 0x58:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402800b0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x59:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280220(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x5a:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280340(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x5b:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280440(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x5c:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280530(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x5d:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280650(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x5e:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280770(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x5f:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280810(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x60:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280910(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x61:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280a10(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x62:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280bc0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 99:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280cc0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 100:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280dc0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x65:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140280ec0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x66:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281070(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x67:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281170(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x68:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281270(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x69:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281370(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x6a:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281470(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x6b:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281510(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x6c:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281610(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x6d:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281850(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x6e:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281a10(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x6f:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281bd0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x70:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281ce0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x71:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140281ea0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x72:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140282060(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x73:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140282220(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x74:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140282330(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x75:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402824f0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x76:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402826b0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x77:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140282870(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x78:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140282a30(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x79:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287ae0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x7a:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287c30(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x7b:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287d60(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x7c:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287f90(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x7d:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140288100(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x7f:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028b680(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x80:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028b8c0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x81:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028ba10(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x82:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028bbb0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x83:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028bc90(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x84:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028bd60(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x85:
    pvVar2 = operator_new(200);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028bfc0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x86:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026d980(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x87:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026db00(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x88:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028c440(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x8c:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026dc70(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x8d:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028c7a0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x8e:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028c9b0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x8f:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14027f500(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x90:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287770(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x91:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140282bf0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x92:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140282d30(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x93:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14027fb20(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x94:
    pvVar2 = operator_new(0xb8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028cbc0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x95:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028d090(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x96:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028d280(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x9e:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028d5a0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0x9f:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140289810(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa0:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028b770(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa1:
    pvVar2 = operator_new(0xa8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028a0e0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa2:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028a340(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa3:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028a5d0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa4:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028d6d0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa5:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028d7d0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa6:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028d8d0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa7:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140286a40(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa8:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140286c60(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xa9:
    pvVar2 = operator_new(0xa8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14026d460(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xaa:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028d9d0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xab:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140282fa0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xac:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140283360(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xad:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402835c0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xae:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140284bc0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xaf:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140284d30(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb0:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140284ea0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb1:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140285050(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb2:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140285210(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb3:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140285380(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb4:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402854f0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb5:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140285660(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb6:
    pvVar2 = operator_new(0xc0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028dbe0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb7:
    pvVar2 = operator_new(0xc0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028e0e0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb8:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028e390(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xb9:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028e690(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xba:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028e8a0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xbb:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028e9a0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xbc:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      *(undefined4 *)(puVar1 + 0x15) = 0;
      *puVar1 = MGSAddEffectCONDITION_RESISTANCE_INC_ALL_NOLIMIT::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0xbd:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402830a0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xbe:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402831c0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xbf:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402832b0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xc0:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140289ec0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xc1:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140283670(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xc2:
    pvVar2 = operator_new(0xa8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_1402837d0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xc4:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287640(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xc5:
    puVar1 = operator_new(0xb0);
    puVar3 = puVar4;
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
      puVar1[7] = 0;
      puVar1[8] = 0;
      puVar1[9] = 0;
      puVar1[10] = 0;
      puVar1[0xb] = 0;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0;
      *(int *)(puVar1 + 4) = iVar5;
      *(undefined8 *)((longlong)puVar1 + 0x2c) = 1;
      *puVar1 = MGSAddEffect::vftable;
      *(undefined4 *)(puVar1 + 0xe) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x74) = 0;
      *(undefined4 *)(puVar1 + 0xf) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x7c) = 0;
      puVar1[0x10] = 0;
      puVar1[0x11] = 0;
      puVar1[0x12] = 0;
      puVar1[0x13] = 0;
      puVar1[0x15] = 0;
      *puVar1 = MGSAddEffectDAMAGE_ADD_EFFECT_TIME::vftable;
      *(undefined4 *)(puVar1 + 0x14) = 1;
      return puVar1;
    }
    break;
  case 0xc6:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14027f970(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 199:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14027f8c0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 200:
    pvVar2 = operator_new(0xa8);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028ebe0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xc9:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140287980(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xca:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140283900(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xcb:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140283a00(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xcc:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140283b00(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xcd:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140283c50(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xce:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140283d70(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xcf:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140283eb0(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xd0:
    pvVar2 = operator_new(0xb0);
    puVar3 = puVar4;
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14027ed70(pvVar2,iVar5);
      return puVar3;
    }
    break;
  case 0xd1:
    pvVar2 = operator_new(0xb0);
    if (pvVar2 != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_14028f050(pvVar2,iVar5);
    }
  }
  return puVar3;
}



void FUN_14026b4e0(undefined8 *param_1)

{
  *param_1 = MGSAddEffect::vftable;
  return;
}



void FUN_14026b4f0(longlong param_1)

{
  float fVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(undefined4 *)(param_1 + 0x3c) = 0;
    fVar1 = *(float *)(param_1 + 0x60) -
            (float)(*(double *)(param_1 + 0x10) - *(double *)(param_1 + 0x18));
    *(float *)(param_1 + 0x60) = fVar1;
    if (fVar1 <= 0.0) {
      *(undefined4 *)(param_1 + 0x60) = 0;
    }
  }
  return;
}



void FUN_14026b530(longlong param_1,uint param_2)

{
  uint uVar1;
  uint *puVar2;
  longlong *plVar3;
  uint uVar4;
  uint uVar5;
  
  *(uint *)(param_1 + 8) = param_2;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[0x3f];
          goto LAB_14026b587;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_14026b587:
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x60) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[7];
          goto LAB_14026b5cf;
        }
        break;
      }
    }
  }
  uVar5 = 0xffffffff;
LAB_14026b5cf:
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x38) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[0x22];
          goto LAB_14026b614;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_14026b614:
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 100) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[0x23];
          goto LAB_14026b65e;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_14026b65e:
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x68) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  uVar5 = 1;
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          uVar4 = puVar2[0x4a];
          goto LAB_14026b6ae;
        }
        break;
      }
    }
  }
  uVar4 = 1;
LAB_14026b6ae:
  uVar1 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x2c) = uVar4;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar1) && (*puVar2 == uVar1)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[0x27];
        }
        break;
      }
    }
  }
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x30) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          *(uint *)(param_1 + 0x34) = puVar2[0x28];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x34) = 0;
  return;
}



undefined8 FUN_14026b7e0(longlong param_1,uint param_2)

{
  uint uVar1;
  uint *puVar2;
  longlong *plVar3;
  uint *puVar4;
  uint *puVar5;
  
  if ((0 < *(int *)(param_1 + 8)) && (0 < (int)param_2)) {
    plVar3 = (longlong *)FUN_1403161f0();
    puVar4 = (uint *)0x0;
    if (*plVar3 != 0) {
      for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8
                              ); puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
        if ((puVar2[0xea] == param_2) && (*puVar2 == param_2)) {
          puVar5 = puVar2 + 2;
          if (puVar2 != (uint *)0x0) goto LAB_14026b856;
          break;
        }
      }
    }
    puVar5 = puVar4;
LAB_14026b856:
    uVar1 = *(uint *)(param_1 + 8);
    plVar3 = (longlong *)FUN_1403161f0();
    if (*plVar3 != 0) {
      for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
        if ((puVar2[0xea] == uVar1) && (*puVar2 == uVar1)) {
          puVar4 = (uint *)0x0;
          if (puVar2 != (uint *)0x0) {
            puVar4 = puVar2 + 2;
          }
          break;
        }
      }
    }
    if ((puVar5 != (uint *)0x0) && (puVar4 != (uint *)0x0)) {
      if ((puVar4[3] != 0) && (puVar4[3] == puVar5[3])) {
        if ((int)puVar5[4] < (int)puVar4[4]) {
          return 1;
        }
        FUN_14026bb70(param_1);
      }
      return 0;
    }
  }
  return 1;
}



void FUN_14026b8f0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint *puVar3;
  longlong lVar4;
  uint *puVar5;
  uint uVar6;
  uint *puVar7;
  
  if ((0 < *(int *)(param_1 + 8)) && (0 < (int)param_2)) {
    plVar2 = (longlong *)FUN_1403161f0();
    puVar7 = (uint *)0x0;
    if (*plVar2 != 0) {
      for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8
                              ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
        if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
          puVar3 = puVar1 + 2;
          if (puVar1 != (uint *)0x0) goto LAB_14026b96a;
          break;
        }
      }
    }
    puVar3 = puVar7;
LAB_14026b96a:
    uVar6 = *(uint *)(param_1 + 8);
    plVar2 = (longlong *)FUN_1403161f0();
    if (*plVar2 != 0) {
      for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
          puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
        if ((puVar1[0xea] == uVar6) && (*puVar1 == uVar6)) {
          puVar5 = puVar1 + 2;
          if (puVar1 != (uint *)0x0) goto LAB_14026b9b6;
          break;
        }
      }
    }
    puVar5 = puVar7;
LAB_14026b9b6:
    if (puVar3 != (uint *)0x0) {
      puVar3 = puVar3 + 6;
      do {
        if ((0 < (int)*puVar3) && (*puVar3 == puVar5[3])) {
          lVar4 = FUN_1404186a0();
          if (*(int *)(lVar4 + 0x250) == 1000) {
            FUN_140418da0(DAT_140607fd8,L"AddEffect Clear : Cur ID[%d] Clear ID[%d]",
                          *(undefined4 *)(param_1 + 8),(ulonglong)param_2);
          }
          FUN_14026bb70(param_1);
          return;
        }
        uVar6 = (int)puVar7 + 1;
        puVar7 = (uint *)(ulonglong)uVar6;
        puVar3 = puVar3 + 1;
      } while ((int)uVar6 < 4);
    }
  }
  return;
}



undefined8 FUN_14026ba30(longlong param_1,uint param_2)

{
  longlong *plVar1;
  uint *puVar2;
  longlong lVar3;
  uint uVar4;
  uint *puVar5;
  uint *puVar6;
  
  if ((0 < *(int *)(param_1 + 8)) && (0 < (int)param_2)) {
    plVar1 = (longlong *)FUN_1403161f0();
    puVar5 = (uint *)0x0;
    if (*plVar1 != 0) {
      for (puVar2 = *(uint **)(*plVar1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar1 + 2)) * 8
                              ); puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
        if ((puVar2[0xea] == param_2) && (*puVar2 == param_2)) {
          puVar6 = puVar2 + 2;
          if (puVar2 != (uint *)0x0) goto LAB_14026baaa;
          break;
        }
      }
    }
    puVar6 = puVar5;
LAB_14026baaa:
    uVar4 = *(uint *)(param_1 + 8);
    plVar1 = (longlong *)FUN_1403161f0();
    if (*plVar1 != 0) {
      for (puVar2 = *(uint **)(*plVar1 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar1 + 2)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
        if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
          if (puVar2 == (uint *)0x0) {
            return 0;
          }
          if (puVar2 == (uint *)0xfffffffffffffff8) {
            return 0;
          }
          if (puVar6 == (uint *)0x0) {
            return 0;
          }
          puVar2 = puVar2 + 0xc;
          while (((int)*puVar2 < 1 || (*puVar2 != puVar6[3]))) {
            uVar4 = (int)puVar5 + 1;
            puVar5 = (uint *)(ulonglong)uVar4;
            puVar2 = puVar2 + 1;
            if (0xe < (int)uVar4) {
              return 0;
            }
          }
          lVar3 = FUN_1404186a0();
          if (*(int *)(lVar3 + 0x250) == 1000) {
            FUN_140418da0(DAT_140607fd8,L"AddEffect Block : Cur ID[%d] Block ID[%d]",
                          *(undefined4 *)(param_1 + 8),(ulonglong)param_2);
          }
          return 1;
        }
      }
    }
  }
  return 0;
}



void FUN_14026bb70(longlong *param_1)

{
  int iVar1;
  undefined1 *puVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if (*(int *)((longlong)param_1 + 0x24) == 0) {
    *(undefined4 *)((longlong)param_1 + 0x24) = 1;
    (**(code **)(*param_1 + 0x58))();
    puVar2 = (undefined1 *)param_1[8];
    if (puVar2 == (undefined1 *)0x0) {
      lVar3 = param_1[0x13];
      if (lVar3 == 0) {
        return;
      }
      plVar4 = *(longlong **)(lVar3 + 0x48);
      if (param_1[9] == 0) {
        if (plVar4 == (longlong *)0x0) {
          return;
        }
        if (*plVar4 == 0) {
          return;
        }
        lVar5 = *plVar4;
      }
      else {
        if (plVar4 == (longlong *)0x0) {
          return;
        }
        if (*plVar4 == 0) {
          return;
        }
        lVar5 = **(longlong **)(lVar3 + 0x48);
      }
      iVar1 = *(int *)(lVar3 + 8);
    }
    else {
      if (*(longlong *)(puVar2 + 0xb58) == 0) {
        if (*(longlong *)(puVar2 + 0xb50) == 0) {
          return;
        }
        iVar1 = *(int *)(puVar2 + 0xc);
      }
      else {
        if (*(longlong *)(puVar2 + 0xb50) == 0) {
          return;
        }
        iVar1 = *(int *)(*(longlong *)(puVar2 + 0xb58) + 8);
      }
      if (iVar1 == 0) {
        iVar1 = *(int *)(puVar2 + 8);
      }
      lVar5 = *(longlong *)(puVar2 + 0xb50);
      register0x00000020 = (BADSPACEBASE *)puVar2;
    }
    (**(code **)(*(longlong *)(lVar5 + 0x78) + 0x2d0))
              (lVar5 + 0x78,iVar1,&DAT_1405d85a0,(undefined1 *)((longlong)register0x00000020 + 8),
               param_1 + 1,param_1 + 4);
  }
  return;
}



void FUN_14026bc90(longlong param_1,longlong param_2,undefined4 param_3,undefined4 param_4)

{
  longlong lVar1;
  int iVar2;
  undefined4 local_res8 [2];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  
  *(longlong *)(param_1 + 0x40) = param_2;
  if (param_2 == 0) {
    lVar1 = *(longlong *)(param_1 + 0x98);
    if (lVar1 == 0) {
      return;
    }
    local_res8[0] = *(undefined4 *)(param_1 + 0x6c);
    iVar2 = *(int *)(lVar1 + 8);
    lVar1 = **(longlong **)(lVar1 + 0x48);
  }
  else {
    if (*(longlong *)(param_2 + 0xb58) == 0) {
      if (*(longlong *)(param_2 + 0xb50) == 0) {
        return;
      }
      local_res8[0] = *(undefined4 *)(param_1 + 0x6c);
      iVar2 = *(int *)(param_2 + 0xc);
    }
    else {
      if (*(longlong *)(param_2 + 0xb50) == 0) {
        return;
      }
      local_res8[0] = *(undefined4 *)(param_1 + 0x6c);
      iVar2 = *(int *)(*(longlong *)(param_2 + 0xb58) + 8);
    }
    if (iVar2 == 0) {
      iVar2 = *(int *)(param_2 + 8);
    }
    lVar1 = *(longlong *)(param_2 + 0xb50);
  }
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  (**(code **)(*(longlong *)(lVar1 + 0x78) + 0x2c0))
            (lVar1 + 0x78,iVar2,&DAT_1405d85a0,local_res18,local_res20,param_1 + 8,param_1 + 0x20,
             &stack0x00000028,&stack0x00000030,param_1 + 0x80,param_1 + 0x8c,&stack0x00000038,
             param_1 + 0xc,local_res8);
  return;
}



int FUN_14026bde0(longlong param_1,int param_2)

{
  longlong *plVar1;
  float fVar2;
  undefined8 *puVar3;
  void *pvVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined8 uVar8;
  longlong lVar9;
  uint uVar10;
  longlong *plVar11;
  longlong lVar12;
  bool bVar13;
  longlong *local_118;
  longlong *local_110;
  longlong *local_108;
  longlong *local_100;
  undefined8 local_f8;
  longlong local_e8;
  longlong local_e0;
  int local_d0;
  short local_cc;
  int local_c4;
  undefined4 local_40;
  
  local_f8 = 0xfffffffffffffffe;
  iVar6 = 0;
  if (*(longlong *)(param_1 + 0x40) == 0) {
    return 0;
  }
  FUN_140197b70(*(longlong *)(param_1 + 0x40),&local_118);
  plVar11 = local_118;
  if (local_118 != (longlong *)0x0) {
    if (local_118 == local_110) {
      if (*local_118 != 0) {
        FUN_140198570(*(undefined8 *)(param_1 + 0x40),&local_108);
        plVar1 = local_108;
        if (local_108 != (longlong *)0x0) {
          if (local_108 == local_100) {
            if (*local_108 != 0) {
              fVar2 = *(float *)(*local_108 + 0x2298);
              iVar7 = FUN_1402f8580();
              FUN_14000a170(&local_e8);
              local_40 = 0;
              uVar10 = 0;
              lVar12 = 0;
              do {
                bVar13 = false;
                lVar9 = *plVar11;
                if (uVar10 < 0x18) {
                  *(undefined2 *)(lVar12 + lVar9 + 0x14) = 0;
                  *(short *)(lVar12 + lVar9 + 0x16) = (short)uVar10;
                  FUN_140090020(&local_e8);
                  iVar5 = local_d0;
                  if ((local_e8 != 0) || (local_e0 != 0)) {
                    bVar13 = true;
                  }
                  if ((((bVar13) || (local_d0 != 0)) || (0 < local_cc)) && (0 < local_c4)) {
                    uVar8 = FUN_140137690();
                    lVar9 = FUN_140136770(uVar8,iVar5);
                    if (((lVar9 != 0) && (*(int *)(lVar9 + 0x108) <= iVar7 + (int)fVar2)) &&
                       (param_2 == *(int *)(lVar9 + 0xc0))) {
                      iVar6 = iVar6 + 1;
                    }
                  }
                }
                uVar10 = uVar10 + 1;
                lVar12 = lVar12 + 0xac;
              } while ((int)uVar10 < 0x18);
              LOCK();
              plVar1 = plVar1 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                puVar3 = (undefined8 *)*local_108;
                if (puVar3 != (undefined8 *)0x0) {
                  (**(code **)*puVar3)(puVar3,1);
                }
                operator_delete(local_108);
              }
              LOCK();
              plVar11 = local_118 + 1;
              *(int *)plVar11 = (int)*plVar11 + -1;
              UNLOCK();
              if ((int)*plVar11 == 0) {
                pvVar4 = (void *)*local_118;
                if (pvVar4 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar4 + 0xf630);
                  operator_delete(pvVar4);
                }
                operator_delete(local_118);
                return iVar6;
              }
              return iVar6;
            }
          }
          else {
            iVar6 = DAT_14060804c + 1;
            bVar13 = DAT_14060804c == 0;
            DAT_14060804c = iVar6;
            if (bVar13) {
              FUN_140176d60(1);
            }
          }
        }
        if (plVar1 != (longlong *)0x0) {
          if (plVar1 == local_100) {
            LOCK();
            plVar1 = plVar1 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            plVar11 = local_118;
            if ((int)*plVar1 == 0) {
              puVar3 = (undefined8 *)*local_108;
              if (puVar3 != (undefined8 *)0x0) {
                (**(code **)*puVar3)(puVar3,1);
              }
              operator_delete(local_108);
              plVar11 = local_118;
            }
          }
          else {
            iVar6 = DAT_140608054 + 1;
            bVar13 = DAT_140608054 == 0;
            DAT_140608054 = iVar6;
            if (bVar13) {
              FUN_140176d60(1);
            }
          }
        }
        goto LAB_14026c081;
      }
    }
    else {
      iVar6 = DAT_140608048 + 1;
      bVar13 = DAT_140608048 == 0;
      DAT_140608048 = iVar6;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  if (plVar11 == (longlong *)0x0) {
    return 0;
  }
  if (plVar11 != local_110) {
    if (DAT_140608050 != 0) {
      DAT_140608050 = DAT_140608050 + 1;
      return 0;
    }
    DAT_140608050 = DAT_140608050 + 1;
    FUN_140176d60(1);
    return 0;
  }
LAB_14026c081:
  LOCK();
  plVar11 = plVar11 + 1;
  *(int *)plVar11 = (int)*plVar11 + -1;
  UNLOCK();
  if ((int)*plVar11 == 0) {
    pvVar4 = (void *)*local_118;
    if (pvVar4 != (void *)0x0) {
      FUN_14034edf0((longlong)pvVar4 + 0xf630);
      operator_delete(pvVar4);
    }
    operator_delete(local_118);
  }
  return 0;
}



void FUN_14026c0e0(longlong param_1,longlong *param_2,int param_3,undefined4 param_4)

{
  int iVar1;
  longlong lVar2;
  char cVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined1 *puVar6;
  undefined1 local_res10 [8];
  undefined1 *puVar7;
  undefined1 local_28;
  undefined1 local_27;
  undefined2 local_26;
  undefined4 local_24 [3];
  
  if ((param_2 != (longlong *)0x0) && (cVar3 = FUN_140224120(param_2,param_3 + -1), cVar3 != '\0'))
  {
    FUN_140224300(param_2,param_3,param_4);
    lVar4 = *(longlong *)(param_1 + 0x40);
    if (lVar4 != 0) {
      lVar2 = *(longlong *)(lVar4 + 0xb58);
      local_26 = (undefined2)param_4;
      local_28 = (undefined1)param_3;
      if (lVar2 == 0) {
        if (*(longlong *)(lVar4 + 0xb50) == 0) {
          return;
        }
        local_res10[0] = 0;
        local_27 = local_28;
        local_28 = (**(code **)(*param_2 + 0xb0))(param_2);
        local_24[0] = (undefined4)param_2[0x25];
        lVar4 = *(longlong *)(param_1 + 0x40);
        iVar1 = *(int *)(lVar4 + 0xc);
        if (iVar1 == 0) {
          iVar1 = *(int *)(lVar4 + 8);
        }
        puVar7 = &local_27;
        puVar6 = &local_28;
      }
      else {
        if (*(longlong *)(lVar4 + 0xb50) == 0) {
          return;
        }
        local_res10[0] = 0;
        local_27 = (**(code **)(*param_2 + 0xb0))(param_2);
        iVar1 = *(int *)(lVar2 + 8);
        local_24[0] = (undefined4)param_2[0x25];
        if (iVar1 == 0) {
          iVar1 = *(int *)(*(longlong *)(param_1 + 0x40) + 8);
        }
        lVar4 = *(longlong *)(param_1 + 0x40);
        puVar7 = &local_28;
        puVar6 = &local_27;
      }
      plVar5 = (longlong *)(*(longlong *)(lVar4 + 0xb50) + 0x380);
      (**(code **)(*plVar5 + 0x3b0))
                (plVar5,iVar1,&DAT_1405d85a0,local_24,puVar6,puVar7,&local_26,local_res10);
    }
  }
  return;
}



void FUN_14026c260(longlong param_1)

{
  longlong lVar1;
  longlong *plVar2;
  undefined4 local_res8 [8];
  
  lVar1 = *(longlong *)(param_1 + 0x40);
  *(int *)(param_1 + 0xa0) = *(int *)(param_1 + 0xa0) + 1;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_1 + 0x10);
  if (((lVar1 != 0) && (*(longlong *)(lVar1 + 0xb50) != 0)) && (*(longlong *)(param_1 + 0x48) != 0))
  {
    local_res8[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x48) + 0x128);
    plVar2 = (longlong *)(*(longlong *)(lVar1 + 0xb50) + 0x380);
    (**(code **)(*plVar2 + 400))
              (plVar2,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,param_1 + 8,local_res8);
  }
  return;
}



void FUN_14026c2d0(longlong *param_1,undefined1 param_2)

{
  int iVar1;
  longlong lVar2;
  
  if (param_1[9] != 0) {
    iVar1 = (**(code **)(*(longlong *)param_1[9] + 0xb0))();
    if (iVar1 == 0x20) {
      if (*(int *)((longlong)param_1 + 0x34) == 1) {
        lVar2 = (**(code **)(*(longlong *)param_1[9] + 0x4a8))();
        if (lVar2 != 0) {
          (**(code **)(*param_1 + 0x88))(param_1,param_2,lVar2);
        }
      }
      (**(code **)(*param_1 + 0x88))(param_1,param_2,param_1[9]);
    }
  }
  return;
}



undefined8 * FUN_14026c350(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectHPInc::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_14026c3f0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xa8) = puVar1[0x31];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_14026c480(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  uint uVar2;
  
  if (*(int *)(param_1 + 0x24) != 0) {
    return;
  }
  *(undefined8 *)(param_1 + 0x10) = param_2;
  if (*(int *)(param_1 + 0x3c) == 0) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
  }
  plVar1 = *(longlong **)(param_1 + 0x48);
  if (*(int *)(param_1 + 0x28) == 0) {
    if ((plVar1 == (longlong *)0x0) || (*(int *)((longlong)plVar1 + 300) == 0x25))
    goto LAB_14026c4e7;
    uVar2 = *(uint *)(param_1 + 0xa8);
  }
  else {
    if ((plVar1 == (longlong *)0x0) || (*(int *)((longlong)plVar1 + 300) == 0x25))
    goto LAB_14026c4e7;
    uVar2 = *(uint *)(param_1 + 0xa8) ^ 0x80000000;
  }
  (**(code **)(*plVar1 + 0x290))(plVar1,uVar2);
LAB_14026c4e7:
  FUN_14026bb70(param_1);
  return;
}



undefined8 * FUN_14026c500(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMPInc::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_14026c5a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xa8) = puVar1[0x32];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_14026c630(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  uint uVar2;
  
  if (*(int *)(param_1 + 0x24) != 0) {
    return;
  }
  *(undefined8 *)(param_1 + 0x10) = param_2;
  if (*(int *)(param_1 + 0x3c) == 0) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
  }
  plVar1 = *(longlong **)(param_1 + 0x48);
  if (*(int *)(param_1 + 0x28) == 0) {
    if (plVar1 == (longlong *)0x0) goto LAB_14026c685;
    uVar2 = *(uint *)(param_1 + 0xa8);
  }
  else {
    if (plVar1 == (longlong *)0x0) goto LAB_14026c685;
    uVar2 = *(uint *)(param_1 + 0xa8) ^ 0x80000000;
  }
  (**(code **)(*plVar1 + 0x298))(plVar1,uVar2);
LAB_14026c685:
  FUN_14026bb70(param_1);
  return;
}



void FUN_14026c6a0(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    plVar1 = *(longlong **)(param_1 + 0x48);
    if (*(int *)(param_1 + 0x28) == 0) {
      if ((plVar1 != (longlong *)0x0) && (*(int *)((longlong)plVar1 + 300) != 0x25)) {
        (**(code **)(*plVar1 + 0x290))(plVar1,*(undefined4 *)(param_1 + 0xa8));
        (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))
                  (*(longlong **)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xa8));
      }
    }
    else if ((plVar1 != (longlong *)0x0) && (*(int *)((longlong)plVar1 + 300) != 0x25)) {
      (**(code **)(*plVar1 + 0x290))(plVar1,*(uint *)(param_1 + 0xa8) ^ 0x80000000);
      (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))
                (*(longlong **)(param_1 + 0x48),*(uint *)(param_1 + 0xa8) ^ 0x80000000);
      FUN_14026bb70(param_1);
      return;
    }
    FUN_14026bb70(param_1);
  }
  return;
}



undefined8 * FUN_14026c770(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectHPIntervalInc::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_14026c810(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  float fVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x4a];
          goto LAB_14026c871;
        }
        break;
      }
    }
  }
  uVar4 = 1;
LAB_14026c871:
  *(uint *)(param_1 + 0x2c) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  fVar5 = 0.0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x31];
          goto LAB_14026c8b3;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14026c8b3:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar5 = (float)puVar1[0x33];
        }
        break;
      }
    }
  }
  *(float *)(param_1 + 0xac) = fVar5;
  *(float *)(param_1 + 0xa8) = (fVar5 / *(float *)(param_1 + 0x60)) * *(float *)(param_1 + 0xa8);
  return;
}



void FUN_14026c960(longlong param_1)

{
  float *pfVar1;
  longlong *plVar2;
  float fVar3;
  float fVar4;
  undefined1 local_res8 [8];
  undefined1 local_res10 [8];
  undefined4 local_res18 [2];
  int local_res20 [2];
  
  plVar2 = *(longlong **)(param_1 + 0x48);
  if (plVar2 == (longlong *)0x0) {
    return;
  }
  if (*(int *)((longlong)plVar2 + 300) == 0x25) {
    return;
  }
  fVar3 = 0.0;
  for (pfVar1 = (float *)plVar2[0x238]; pfVar1 != (float *)plVar2[0x239]; pfVar1 = pfVar1 + 1) {
    fVar3 = fVar3 + *pfVar1;
  }
  fVar3 = fVar3 + *(float *)(plVar2 + 0xb3);
  fVar4 = *(float *)(param_1 + 0xa8);
  if (*(int *)(param_1 + 0x28) == 0) {
    if (1.0 < fVar4 + fVar3) goto LAB_14026c9fb;
LAB_14026c9ed:
    fVar4 = fVar3 - 1.0;
  }
  else if (fVar3 - fVar4 <= 1.0) goto LAB_14026c9ed;
  fVar4 = -fVar4;
LAB_14026c9fb:
  (**(code **)(*plVar2 + 0x290))(plVar2,fVar4);
  if (*(longlong *)(param_1 + 0x98) != 0) {
    local_res8[0] = 0;
    local_res18[0] = (undefined4)(*(longlong **)(param_1 + 0x48))[0x25];
    local_res20[0] = (int)fVar4;
    local_res10[0] = (**(code **)(**(longlong **)(param_1 + 0x48) + 0xb0))();
    plVar2 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x98) + 0x48) + 0x380);
    (**(code **)(*plVar2 + 0x170))
              (plVar2,*(undefined4 *)(*(longlong *)(param_1 + 0x98) + 8),&DAT_1405d85a0,local_res10,
               local_res20,local_res18,local_res8);
  }
  return;
}



void FUN_14026ca90(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0xb0) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026c960(param_1);
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70(param_1);
        return;
      }
      if ((double)*(float *)(param_1 + 0xac) <= param_2 - *(double *)(param_1 + 0xb0)) {
        *(double *)(param_1 + 0xb0) = param_2;
        FUN_14026c960(param_1);
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14026cb40(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMPIntervalInc::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_14026cbe0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  float fVar4;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  fVar4 = 0.0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x33];
          goto LAB_14026cc3b;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_14026cc3b:
  *(uint *)(param_1 + 0xac) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x32];
        }
        break;
      }
    }
  }
  *(float *)(param_1 + 0xa8) = (*(float *)(param_1 + 0xac) / *(float *)(param_1 + 0x60)) * fVar4;
  return;
}



void FUN_14026ccd0(longlong param_1)

{
  if (*(int *)(param_1 + 0x28) == 0) {
    if (*(longlong *)(param_1 + 0x48) != 0) {
      (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))
                (*(longlong **)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xa8));
    }
  }
  else if (*(longlong *)(param_1 + 0x48) != 0) {
                    // WARNING: Could not recover jumptable at 0x00014026ccfe. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))
              (*(longlong **)(param_1 + 0x48),*(uint *)(param_1 + 0xa8) ^ 0x80000000);
    return;
  }
  return;
}



void FUN_14026cd30(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0xb0) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026ccd0(param_1);
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70(param_1);
        return;
      }
      if ((double)*(float *)(param_1 + 0xac) <= param_2 - *(double *)(param_1 + 0xb0)) {
        FUN_14026ccd0(param_1);
        *(undefined8 *)(param_1 + 0xb0) = *(undefined8 *)(param_1 + 0x10);
        return;
      }
    }
  }
  return;
}



void FUN_14026cde0(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)(param_1 + 0x48);
  if ((plVar1 != (longlong *)0x0) && (*(int *)(param_1 + 0x3c) == 1)) {
    (**(code **)(*plVar1 + 0x90))(plVar1,1);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14026ce10(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (*(longlong **)(param_1 + 0x48) != (longlong *)0x0) {
        (**(code **)(**(longlong **)(param_1 + 0x48) + 0x90))();
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14026ce70(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)(param_1 + 0x48);
  if ((plVar1 != (longlong *)0x0) && (*(int *)(param_1 + 0x3c) == 1)) {
    (**(code **)(*plVar1 + 0x88))(plVar1,1);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14026cea0(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (*(longlong **)(param_1 + 0x48) != (longlong *)0x0) {
        (**(code **)(**(longlong **)(param_1 + 0x48) + 0x88))();
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14026cf00(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)(param_1 + 0x48);
  if ((plVar1 != (longlong *)0x0) && (*(int *)(param_1 + 0x3c) == 1)) {
    (**(code **)(*plVar1 + 0x98))(plVar1,0);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14026cf30(longlong param_1,double param_2)

{
  longlong *plVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      plVar1 = *(longlong **)(param_1 + 0x48);
      if (plVar1 != (longlong *)0x0) {
        (**(code **)(*plVar1 + 0x98))(plVar1,1);
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14026cf90(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  float fVar4;
  uint uVar5;
  uint uVar6;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  uVar6 = 0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x38];
          goto LAB_14026cfef;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_14026cfef:
  *(int *)(param_1 + 0xa8) = (int)fVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar5 = puVar1[0x33];
          goto LAB_14026d03b;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_14026d03b:
  *(uint *)(param_1 + 0xac) = uVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar6 = puVar1[0x39];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0xb0) = uVar6;
  *(float *)(param_1 + 0x60) = (float)*(int *)(param_1 + 0xa8) * *(float *)(param_1 + 0xac);
  return;
}



void FUN_14026d0e0(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14026d130(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined4 uVar3;
  
  if (*(int *)(param_1 + 0x24) != 0) {
    return;
  }
  *(undefined8 *)(param_1 + 0x10) = param_2;
  if (*(int *)(param_1 + 0x3c) == 0) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
  }
  lVar1 = *(longlong *)(param_1 + 0x40);
  if (lVar1 != 0) {
    lVar2 = *(longlong *)(lVar1 + 0xb50);
    if (*(longlong *)(lVar1 + 0xb58) == 0) {
      if (lVar2 == 0) goto LAB_14026d188;
      uVar3 = 0;
    }
    else {
      if (lVar2 == 0) goto LAB_14026d188;
      uVar3 = *(undefined4 *)(*(longlong *)(lVar1 + 0xb58) + 8);
    }
    FUN_1401fce00(lVar2,uVar3,lVar1,*(undefined4 *)(param_1 + 0xa8));
  }
LAB_14026d188:
  FUN_14026bb70(param_1);
  return;
}



void FUN_14026d1a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  int iVar2;
  longlong *plVar3;
  float fVar4;
  float fVar5;
  
  FUN_14026b530();
  plVar3 = (longlong *)FUN_1403161f0();
  fVar5 = 0.0;
  if (*plVar3 != 0) {
    for (puVar1 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x35];
          goto LAB_14026d1fd;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_14026d1fd:
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar1 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar5 = (float)puVar1[0x36];
        }
        break;
      }
    }
  }
  iVar2 = rand();
  *(float *)(param_1 + 0xa8) =
       (float)iVar2 * 3.0517578e-05 * (float)((int)fVar5 - (int)fVar4) + (float)(int)fVar4;
  return;
}



void FUN_14026d2b0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  float fVar4;
  float fVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  fVar5 = 0.0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x3c];
          goto LAB_14026d30b;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_14026d30b:
  *(int *)(param_1 + 0xa8) = (int)fVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar5 = (float)puVar1[0x3d];
        }
        break;
      }
    }
  }
  *(int *)(param_1 + 0xac) = (int)fVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_14026d3f0(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    if (*(longlong *)(param_1 + 0x48) != 0) {
      FUN_140224540(*(longlong *)(param_1 + 0x48),0,*(undefined4 *)(param_1 + 0xac),
                    *(undefined4 *)(param_1 + 0xa8));
      FUN_140224540(*(undefined8 *)(param_1 + 0x48),1,*(undefined4 *)(param_1 + 0xac),
                    *(undefined4 *)(param_1 + 0xa8));
    }
    FUN_14026bb70(param_1);
  }
  return;
}



undefined8 * FUN_14026d460(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectAntiAllCondition::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_14026d500(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_14026d580(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    if (*(longlong *)(param_1 + 0x48) != 0) {
      FUN_140234b20();
    }
    FUN_14026bb70(param_1);
  }
  return;
}



undefined8 * FUN_14026d5c0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectHP_MP_INC_INTERVAL::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_14026d660(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  float fVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x4a];
          goto LAB_14026d6c1;
        }
        break;
      }
    }
  }
  uVar4 = 1;
LAB_14026d6c1:
  *(uint *)(param_1 + 0x2c) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  fVar5 = 0.0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x31];
          goto LAB_14026d707;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14026d707:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x32];
          goto LAB_14026d74b;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14026d74b:
  *(uint *)(param_1 + 0xac) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar5 = (float)puVar1[0x33];
        }
        break;
      }
    }
  }
  *(float *)(param_1 + 0xb0) = fVar5;
  fVar5 = fVar5 / *(float *)(param_1 + 0x60);
  *(float *)(param_1 + 0xac) = fVar5 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xa8) = fVar5 * *(float *)(param_1 + 0xa8);
  return;
}



void FUN_14026d820(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0xb8) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026d8d0(param_1);
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70(param_1);
        return;
      }
      if ((double)*(float *)(param_1 + 0xb0) <= param_2 - *(double *)(param_1 + 0xb8)) {
        *(double *)(param_1 + 0xb8) = param_2;
        FUN_14026d8d0(param_1);
        return;
      }
    }
  }
  return;
}



void FUN_14026d8d0(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)(param_1 + 0x48);
  if (*(int *)(param_1 + 0x28) == 0) {
    if ((plVar1 != (longlong *)0x0) && (*(int *)((longlong)plVar1 + 300) != 0x25)) {
      (**(code **)(*plVar1 + 0x290))(plVar1,*(undefined4 *)(param_1 + 0xa8));
      (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))
                (*(longlong **)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xac));
    }
  }
  else if ((plVar1 != (longlong *)0x0) && (*(int *)((longlong)plVar1 + 300) != 0x25)) {
    (**(code **)(*plVar1 + 0x290))(plVar1,*(uint *)(param_1 + 0xa8) ^ 0x80000000);
                    // WARNING: Could not recover jumptable at 0x00014026d935. Too many branches
                    // WARNING: Treating indirect jump as call
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))
              (*(longlong **)(param_1 + 0x48),*(uint *)(param_1 + 0xac) ^ 0x80000000);
    return;
  }
  return;
}



undefined8 * FUN_14026d980(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectHP_PERCENT_INC_PARTY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14026da30(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    plVar1 = *(longlong **)(param_1 + 0x48);
    if ((plVar1 != (longlong *)0x0) && (*(int *)((longlong)plVar1 + 300) != 0x25)) {
      (**(code **)(*plVar1 + 0x290))();
    }
    FUN_14026bb70(param_1);
  }
  return;
}



undefined8 * FUN_14026db00(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMP_PERCENT_INC_PARTY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14026dbb0(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    if (*(longlong **)(param_1 + 0x48) != (longlong *)0x0) {
      (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))();
    }
    FUN_14026bb70(param_1);
  }
  return;
}



undefined8 * FUN_14026dc70(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectHP_MP_PERCENT_INC_PARTY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14026dd20(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    plVar1 = *(longlong **)(param_1 + 0x48);
    if ((plVar1 != (longlong *)0x0) && (*(int *)((longlong)plVar1 + 300) != 0x25)) {
      if (*(int *)(param_1 + 0x28) != 0) {
        (**(code **)(*plVar1 + 0x290))();
        (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))();
        FUN_14026bb70(param_1);
        return;
      }
      (**(code **)(*plVar1 + 0x290))();
      (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))();
    }
    FUN_14026bb70(param_1);
  }
  return;
}



void FUN_14026deb0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4)

{
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  return;
}



void FUN_14026ded0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined2 param_4,
                  undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  int iVar6;
  undefined *puVar7;
  longlong *plVar8;
  undefined *local_res8;
  undefined2 local_res20 [4];
  undefined *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  
  local_40 = 0xfffffffffffffffe;
  local_res20[0] = param_4;
  FUN_14034fe70();
  uVar5 = param_6;
  local_48 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_6);
  iVar6 = 0;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_48 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar6) && (iVar4 = 0, local_48 != (undefined *)0x0)) &&
     (local_48 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_48 + -8);
  }
  iVar6 = 1;
  if (1 < iVar4) {
    iVar6 = iVar4;
  }
  iVar4 = 0;
  if ((local_48 != (undefined *)0x0) && (iVar4 = 0, local_48 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_48 + -8);
  }
  if (iVar4 < iVar6) {
    FUN_140002d30(&local_48);
  }
  FUN_140002e10(&local_48);
  puVar7 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,uVar5,iVar3);
  puVar7 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar7);
  iVar6 = 0;
  if (0 < iVar3) {
    iVar6 = iVar3;
  }
  iVar3 = 0;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_48 + -8);
  }
  if ((iVar6 < iVar3) || (iVar6 = 0, local_48 == (undefined *)0x0)) {
LAB_14026dfe8:
    if (((local_48 != PTR_DAT_1405d8010) && (local_48 != (undefined *)0x0)) &&
       ((int *)(local_48 + -8) != (int *)0x0)) {
      *(int *)(local_48 + -8) = iVar6;
      *(undefined2 *)(local_48 + (longlong)iVar6 * 2) = 0;
    }
  }
  else if (local_48 != PTR_DAT_1405d8010) {
    iVar6 = *(int *)(local_48 + -8);
    goto LAB_14026dfe8;
  }
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_3);
  iVar6 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar6 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_res8 + -8);
  }
  iVar4 = iVar3;
  if (iVar3 <= iVar6) {
    iVar4 = 0;
    if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(local_res8 + -8);
    }
  }
  iVar6 = 1;
  if (1 < iVar4) {
    iVar6 = iVar4;
  }
  iVar4 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  if (iVar4 < iVar6) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar7 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,param_3,iVar3);
  puVar7 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar7);
  iVar6 = 0;
  if (0 < iVar3) {
    iVar6 = iVar3;
  }
  iVar3 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar3 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -8);
  }
  if ((iVar3 <= iVar6) && (iVar6 = 0, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_14026e102;
    iVar6 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar6;
    *(undefined2 *)(local_res8 + (longlong)iVar6 * 2) = 0;
  }
LAB_14026e102:
  plVar8 = (longlong *)(*(longlong *)(param_1 + 0x4e0) + 0x70);
  (**(code **)(*plVar8 + 0x50))
            (plVar8,1,&DAT_1405d85a0,param_2,&local_res8,local_res20,&param_5,&local_48,param_7);
  puVar7 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    local_38 = uVar5;
    FUN_14034ed40(uVar5);
    local_30 = 1;
    piVar2 = (int *)(puVar7 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  puVar7 = local_48;
  if (((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_48 + -8, puVar1 != (undefined *)0x0)) {
    local_res8 = PTR_DAT_1405d8010;
    uVar5 = FUN_14034fe70();
    local_38 = uVar5;
    FUN_14034ed40(uVar5);
    local_30 = 1;
    piVar2 = (int *)(puVar7 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_14026e210(longlong param_1,undefined4 param_2,undefined8 param_3,undefined2 param_4,
                  undefined8 param_5,undefined8 param_6,undefined8 param_7)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  longlong *plVar7;
  int iVar8;
  undefined *local_res8;
  undefined4 local_res10 [2];
  undefined2 local_res20 [4];
  undefined *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  
  local_40 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x4e0) == 0) {
    return;
  }
  local_res10[0] = param_2;
  local_res20[0] = param_4;
  FUN_14034fe70();
  uVar5 = param_6;
  local_48 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_6);
  iVar8 = 0;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_48 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_48 != (undefined *)0x0)) &&
     (local_48 != PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar4 = *(int *)(local_48 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_48);
  }
  FUN_140002e10(&local_48);
  puVar6 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,uVar5,iVar3);
  puVar6 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_48 + -8);
  }
  if ((iVar8 < iVar3) || (iVar8 = 0, local_48 == (undefined *)0x0)) {
LAB_14026e331:
    if (((local_48 != PTR_DAT_1405d8010) && (local_48 != (undefined *)0x0)) &&
       ((int *)(local_48 + -8) != (int *)0x0)) {
      *(int *)(local_48 + -8) = iVar8;
      *(undefined2 *)(local_48 + (longlong)iVar8 * 2) = 0;
    }
  }
  else if (local_48 != PTR_DAT_1405d8010) {
    iVar8 = *(int *)(local_48 + -8);
    goto LAB_14026e331;
  }
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_3);
  iVar8 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar8 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_res8 + -8);
  }
  iVar4 = iVar3;
  if (iVar3 <= iVar8) {
    iVar4 = 0;
    if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(local_res8 + -8);
    }
  }
  iVar8 = 1;
  if (1 < iVar4) {
    iVar8 = iVar4;
  }
  iVar4 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_3,iVar3);
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar3 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -8);
  }
  if ((iVar3 <= iVar8) && (iVar8 = 0, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_14026e44b;
    iVar8 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar8;
    *(undefined2 *)(local_res8 + (longlong)iVar8 * 2) = 0;
  }
LAB_14026e44b:
  plVar7 = (longlong *)(*(longlong *)(param_1 + 0x4e0) + 0x70);
  (**(code **)(*plVar7 + 0x60))
            (plVar7,1,&DAT_1405d85a0,local_res10,&local_res8,local_res20,&param_5,&local_48,param_7)
  ;
  puVar6 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    local_38 = uVar5;
    FUN_14034ed40(uVar5);
    local_30 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  puVar6 = local_48;
  if (((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_48 + -8, puVar1 != (undefined *)0x0)) {
    local_res8 = PTR_DAT_1405d8010;
    uVar5 = FUN_14034fe70();
    local_38 = uVar5;
    FUN_14034ed40(uVar5);
    local_30 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_14026e550(longlong param_1,undefined8 param_2,undefined2 param_3,undefined4 param_4,
                  undefined8 param_5,undefined8 param_6)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined *puVar6;
  longlong *plVar7;
  int iVar8;
  undefined *local_res8;
  undefined2 local_res18 [4];
  undefined4 local_res20 [2];
  undefined *local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined1 local_30;
  
  local_40 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x4e0) == 0) {
    return;
  }
  local_res18[0] = param_3;
  local_res20[0] = param_4;
  FUN_14034fe70();
  local_48 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_5);
  iVar8 = 0;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_48 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar8) && (iVar4 = 0, local_48 != (undefined *)0x0)) &&
     (local_48 != PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar4 = *(int *)(local_48 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_48);
  }
  FUN_140002e10(&local_48);
  puVar6 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_5,iVar3);
  puVar6 = local_48;
  if (local_48 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_48 + -8);
  }
  if ((iVar8 < iVar3) || (iVar8 = 0, local_48 == (undefined *)0x0)) {
LAB_14026e672:
    if (((local_48 != PTR_DAT_1405d8010) && (local_48 != (undefined *)0x0)) &&
       ((int *)(local_48 + -8) != (int *)0x0)) {
      *(int *)(local_48 + -8) = iVar8;
      *(undefined2 *)(local_48 + (longlong)iVar8 * 2) = 0;
    }
  }
  else if (local_48 != PTR_DAT_1405d8010) {
    iVar8 = *(int *)(local_48 + -8);
    goto LAB_14026e672;
  }
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_2);
  iVar8 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar8 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar8 = *(int *)(local_res8 + -8);
  }
  iVar4 = iVar3;
  if (iVar3 <= iVar8) {
    iVar4 = 0;
    if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
      iVar4 = *(int *)(local_res8 + -8);
    }
  }
  iVar8 = 1;
  if (1 < iVar4) {
    iVar8 = iVar4;
  }
  iVar4 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  if (iVar4 < iVar8) {
    FUN_140002d30(&local_res8);
  }
  FUN_140002e10(&local_res8);
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_2,iVar3);
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar8 = 0;
  if (0 < iVar3) {
    iVar8 = iVar3;
  }
  iVar3 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar3 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -8);
  }
  if ((iVar3 <= iVar8) && (iVar8 = 0, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_14026e78c;
    iVar8 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar8;
    *(undefined2 *)(local_res8 + (longlong)iVar8 * 2) = 0;
  }
LAB_14026e78c:
  plVar7 = (longlong *)(*(longlong *)(param_1 + 0x4e0) + 0x70);
  (**(code **)(*plVar7 + 0xa0))
            (plVar7,1,&DAT_1405d85a0,&local_res8,local_res18,local_res20,&local_48,param_6,
             &stack0x00000038);
  puVar6 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    local_38 = uVar5;
    FUN_14034ed40(uVar5);
    local_30 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  puVar6 = local_48;
  if (((local_48 != (undefined *)0x0) && (local_48 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_48 + -8, puVar1 != (undefined *)0x0)) {
    local_res8 = PTR_DAT_1405d8010;
    uVar5 = FUN_14034fe70();
    local_38 = uVar5;
    FUN_14034ed40(uVar5);
    local_30 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_14026e890(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined8 uVar6;
  int iVar7;
  undefined *puVar8;
  longlong *plVar9;
  int iVar10;
  undefined *local_res8;
  undefined4 local_res10 [2];
  
  local_res10[0] = param_2;
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_3);
  iVar10 = 0;
  iVar7 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar7 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_res8 + -8);
  }
  iVar5 = 0;
  iVar4 = iVar3;
  if (((iVar3 <= iVar7) && (iVar4 = iVar10, local_res8 != (undefined *)0x0)) &&
     (iVar4 = iVar5, local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  iVar7 = 1;
  if (1 < iVar4) {
    iVar7 = iVar4;
  }
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_res8 + -8);
  }
  if (iVar5 < iVar7) {
    FUN_140002d30(&local_res8,iVar7);
  }
  FUN_140002e10(&local_res8);
  puVar8 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar8,param_3,iVar3);
  puVar8 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar8 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar8);
  iVar7 = 0;
  if (0 < iVar3) {
    iVar7 = iVar3;
  }
  iVar3 = iVar10;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -8);
  }
  if ((iVar3 <= iVar7) && (iVar7 = iVar10, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_14026e9c3;
    iVar7 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar7;
    *(undefined2 *)(local_res8 + (longlong)iVar7 * 2) = 0;
  }
LAB_14026e9c3:
  plVar9 = (longlong *)(*(longlong *)(param_1 + 0x4e0) + 0x70);
  (**(code **)(*plVar9 + 0x70))(plVar9,1,&DAT_1405d85a0,local_res10,&local_res8,param_4);
  puVar8 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar6 = FUN_14034fe70();
    FUN_14034ed40(uVar6);
    piVar2 = (int *)(puVar8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar6);
  }
  return;
}



void FUN_14026ea60(longlong param_1,undefined8 param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  int iVar6;
  undefined *puVar7;
  longlong *plVar8;
  undefined *local_res8;
  
  if (*(longlong *)(param_1 + 0x4e0) == 0) {
    return;
  }
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(param_2);
  iVar6 = 0;
  if ((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) {
    iVar6 = *(int *)(local_res8 + -8);
  }
  iVar4 = iVar3;
  if (((iVar3 <= iVar6) && (iVar4 = 0, local_res8 != (undefined *)0x0)) &&
     (local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  iVar6 = 1;
  if (1 < iVar4) {
    iVar6 = iVar4;
  }
  iVar4 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar4 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(local_res8 + -8);
  }
  if (iVar4 < iVar6) {
    FUN_140002d30(&local_res8,iVar6);
  }
  FUN_140002e10(&local_res8);
  puVar7 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,param_2,iVar3);
  puVar7 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar7);
  iVar6 = 0;
  if (0 < iVar3) {
    iVar6 = iVar3;
  }
  iVar3 = 0;
  if ((local_res8 != (undefined *)0x0) && (iVar3 = 0, local_res8 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -8);
  }
  if ((iVar3 <= iVar6) && (iVar6 = 0, local_res8 != (undefined *)0x0)) {
    if (local_res8 == PTR_DAT_1405d8010) goto LAB_14026eb94;
    iVar6 = *(int *)(local_res8 + -8);
  }
  if (((local_res8 != PTR_DAT_1405d8010) && (local_res8 != (undefined *)0x0)) &&
     ((int *)(local_res8 + -8) != (int *)0x0)) {
    *(int *)(local_res8 + -8) = iVar6;
    *(undefined2 *)(local_res8 + (longlong)iVar6 * 2) = 0;
  }
LAB_14026eb94:
  plVar8 = (longlong *)(*(longlong *)(param_1 + 0x4e0) + 0x70);
  (**(code **)(*plVar8 + 0x80))(plVar8,1,&DAT_1405d85a0,&local_res8);
  puVar7 = local_res8;
  if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    FUN_14034ed40(uVar5);
    piVar2 = (int *)(puVar7 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  return;
}



void FUN_14026ec20(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = param_1 + 0x32;
  FUN_14034ed40(plVar1);
  lVar2 = 0x32;
  do {
    if (*param_1 != 0) {
      FUN_140273340();
      *param_1 = 0;
    }
    param_1 = param_1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_14034edd0(plVar1);
  FUN_14034edf0(plVar1);
  return;
}



undefined4 *
FUN_14026eca0(longlong *param_1,ulonglong *param_2,short *param_3,undefined4 param_4,
             undefined4 param_5)

{
  short sVar1;
  ulonglong *puVar2;
  int iVar3;
  undefined4 *puVar4;
  ulonglong uVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  uint uVar8;
  undefined4 *puVar9;
  short *psVar10;
  longlong *plVar11;
  bool bVar12;
  
  puVar7 = (undefined4 *)0x0;
  if ((*param_2 != 0) || (puVar4 = puVar7, param_2[1] != 0)) {
    puVar4 = (undefined4 *)0x1;
  }
  puVar9 = puVar7;
  plVar11 = param_1;
  if ((int)puVar4 == 0) {
    return puVar4;
  }
  do {
    puVar2 = (ulonglong *)*plVar11;
    if (puVar2 != (ulonglong *)0x0) {
      bVar12 = *puVar2 < *param_2;
      if ((*puVar2 != *param_2) ||
         (bVar12 = puVar2[1] < param_2[1], iVar3 = 0, puVar2[1] != param_2[1])) {
        iVar3 = (1 - (uint)bVar12) - (uint)(bVar12 != 0);
      }
      if (iVar3 == 0) {
        return (undefined4 *)0x0;
      }
    }
    uVar8 = (int)puVar9 + 1;
    puVar4 = puVar7;
    puVar6 = puVar7;
    puVar9 = (undefined4 *)(ulonglong)uVar8;
    plVar11 = plVar11 + 1;
  } while ((int)uVar8 < 0x32);
  while (iVar3 = (int)puVar6, param_1[(longlong)puVar4] != 0) {
    puVar4 = (undefined4 *)((longlong)puVar4 + 1);
    puVar6 = (undefined4 *)(ulonglong)(iVar3 + 1);
    if (0x31 < (longlong)puVar4) {
      return (undefined4 *)0x0;
    }
  }
  if (iVar3 < 0) {
    return (undefined4 *)0x0;
  }
  puVar4 = operator_new(0x80);
  if (puVar4 != (undefined4 *)0x0) {
    *(undefined8 *)(puVar4 + 0xe) = 7;
    *(undefined8 *)(puVar4 + 0xc) = 0;
    *(undefined2 *)(puVar4 + 8) = 0;
    *(undefined8 *)(puVar4 + 0x18) = 7;
    *(undefined8 *)(puVar4 + 0x16) = 0;
    *(undefined2 *)(puVar4 + 0x12) = 0;
    puVar7 = puVar4;
  }
  uVar5 = 0xffffffffffffffff;
  *puVar7 = (int)*param_2;
  puVar7[1] = *(undefined4 *)((longlong)param_2 + 4);
  puVar7[2] = (int)param_2[1];
  puVar7[3] = *(undefined4 *)((longlong)param_2 + 0xc);
  psVar10 = param_3;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    sVar1 = *psVar10;
    psVar10 = psVar10 + 1;
  } while (sVar1 != 0);
  FUN_140001710(puVar7 + 8,param_3,~uVar5 - 1);
  puVar7[4] = param_4;
  puVar7[5] = param_5;
  param_1[iVar3] = (longlong)puVar7;
  return (undefined4 *)0x1;
}



bool FUN_14026ee30(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4,
                  undefined4 param_5)

{
  longlong lVar1;
  int iVar2;
  
  lVar1 = param_1 + 400;
  FUN_14034ed40(lVar1);
  iVar2 = FUN_14026eca0(param_1,param_2,param_3,param_4,param_5);
  if (iVar2 == 0) {
    FUN_14034edd0(lVar1);
  }
  else {
    FUN_14034edd0(lVar1);
  }
  return iVar2 != 0;
}



undefined8 FUN_14026eed0(longlong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong *plVar5;
  bool bVar6;
  
  FUN_14034ed40(param_1 + 0x32);
  uVar4 = 0;
  plVar5 = param_1;
  do {
    puVar1 = (ulonglong *)*plVar5;
    if (puVar1 != (ulonglong *)0x0) {
      bVar6 = *puVar1 < *param_2;
      if ((*puVar1 == *param_2) && (bVar6 = puVar1[1] < param_2[1], puVar1[1] == param_2[1])) {
        iVar2 = 0;
      }
      else {
        iVar2 = (1 - (uint)bVar6) - (uint)(bVar6 != 0);
      }
      if (iVar2 == 0) {
        if (puVar1 != (ulonglong *)0x0) {
          FUN_140273340();
        }
        param_1[uVar4] = 0;
        FUN_14034edd0(param_1 + 0x32);
        return 1;
      }
    }
    uVar3 = (int)uVar4 + 1;
    uVar4 = (ulonglong)uVar3;
    plVar5 = plVar5 + 1;
    if (0x31 < uVar3) {
      FUN_14034edd0(param_1 + 0x32);
      return 0;
    }
  } while( true );
}



void FUN_14026ef90(undefined8 *param_1,ulonglong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined4 *puVar2;
  void *_Dst;
  undefined4 *puVar3;
  wchar_t *_Src;
  longlong lVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  undefined1 uVar7;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  wchar_t local_50 [16];
  undefined8 local_30;
  
  uVar5 = 0xfffffffffffffffe;
  puVar1 = param_1 + 0x32;
  puVar6 = puVar1;
  FUN_14034ed40(puVar1);
  uVar7 = 1;
  lVar4 = 0x32;
  do {
    puVar3 = (undefined4 *)*param_1;
    if (puVar3 != (undefined4 *)0x0) {
      local_50[0] = L'\0';
      local_50[1] = L'\0';
      local_50[2] = L'\0';
      local_50[3] = L'\0';
      local_50[4] = L'\0';
      local_50[5] = L'\0';
      local_50[6] = L'\0';
      local_50[7] = L'\0';
      local_50[8] = L'\0';
      local_50[9] = L'\0';
      local_50[10] = L'\0';
      local_50[0xb] = L'\0';
      local_50[0xc] = L'\0';
      local_50[0xd] = L'\0';
      local_50[0xe] = L'\0';
      local_50[0xf] = L'\0';
      local_60 = *puVar3;
      local_5c = puVar3[1];
      local_58 = puVar3[2];
      local_54 = puVar3[3];
      local_30 = (ulonglong)CONCAT12(*(undefined1 *)(puVar3 + 5),*(undefined2 *)(puVar3 + 4));
      if (*(ulonglong *)(puVar3 + 0xc) < 0x10) {
        _Src = (wchar_t *)(puVar3 + 8);
        if (7 < *(ulonglong *)(puVar3 + 0xe)) {
          _Src = *(wchar_t **)_Src;
        }
        wcscpy_s(local_50,0x10,_Src);
        puVar3 = (undefined4 *)param_2[1];
        if ((&local_60 < puVar3) && (puVar2 = (undefined4 *)*param_2, puVar2 <= &local_60)) {
          if (puVar3 == (undefined4 *)param_2[2]) {
            FUN_140117a90(param_2,1,puVar3,param_4,uVar5,puVar6,uVar7);
          }
          puVar3 = (undefined4 *)
                   ((((longlong)&local_60 - (longlong)puVar2) / 0x38) * 0x38 + *param_2);
          _Dst = (void *)param_2[1];
          if (_Dst != (void *)0x0) {
LAB_14026f109:
            memcpy(_Dst,puVar3,0x38);
          }
        }
        else {
          if (puVar3 == (undefined4 *)param_2[2]) {
            FUN_140117a90(param_2,1,puVar3,param_4,uVar5,puVar6,uVar7);
          }
          _Dst = (void *)param_2[1];
          if (_Dst != (void *)0x0) {
            puVar3 = &local_60;
            goto LAB_14026f109;
          }
        }
        param_2[1] = param_2[1] + 0x38;
      }
    }
    param_1 = param_1 + 1;
    lVar4 = lVar4 + -1;
    if (lVar4 == 0) {
      FUN_14034edd0(puVar1);
      return;
    }
  } while( true );
}



void FUN_14026f150(longlong *param_1,ulonglong *param_2,wchar_t *param_3)

{
  longlong *plVar1;
  ulonglong *puVar2;
  int iVar3;
  uint uVar4;
  wchar_t *_Src;
  bool bVar5;
  
  plVar1 = param_1 + 0x32;
  FUN_14034ed40(plVar1);
  uVar4 = 0;
  do {
    puVar2 = (ulonglong *)*param_1;
    if (puVar2 != (ulonglong *)0x0) {
      bVar5 = *puVar2 < *param_2;
      if ((*puVar2 == *param_2) && (bVar5 = puVar2[1] < param_2[1], puVar2[1] == param_2[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
      }
      if (iVar3 == 0) {
        if (0xf < puVar2[6]) break;
        _Src = (wchar_t *)(puVar2 + 4);
        if (7 < puVar2[7]) {
          _Src = *(wchar_t **)_Src;
        }
        wcscpy_s(param_3,0x10,_Src);
      }
    }
    uVar4 = uVar4 + 1;
    param_1 = param_1 + 1;
  } while (uVar4 < 0x32);
  FUN_14034edd0(plVar1);
  return;
}



undefined8 FUN_14026f210(longlong *param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  short sVar3;
  longlong lVar4;
  short *psVar5;
  undefined8 *puVar6;
  uint uVar7;
  
  plVar1 = param_1 + 0x32;
  FUN_14034ed40(plVar1);
  uVar7 = 0;
  do {
    lVar4 = *param_1;
    if (lVar4 != 0) {
      puVar6 = (undefined8 *)(lVar4 + 0x20);
      if (7 < *(ulonglong *)(lVar4 + 0x38)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      psVar5 = param_2;
      do {
        sVar2 = *psVar5;
        sVar3 = *(short *)((longlong)psVar5 + ((longlong)puVar6 - (longlong)param_2));
        if (sVar2 != sVar3) break;
        psVar5 = psVar5 + 1;
      } while (sVar3 != 0);
      if (sVar2 == sVar3) {
        FUN_14034edd0(plVar1);
        return 1;
      }
    }
    uVar7 = uVar7 + 1;
    param_1 = param_1 + 1;
    if (0x31 < uVar7) {
      FUN_14034edd0(plVar1);
      return 0;
    }
  } while( true );
}



void FUN_14026f2b0(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = param_1 + 0x19;
  FUN_14034ed40(plVar1);
  lVar2 = 0x19;
  do {
    if (*param_1 != 0) {
      FUN_140273340();
      *param_1 = 0;
    }
    param_1 = param_1 + 1;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_14034edd0(plVar1);
  FUN_14034edf0(plVar1);
  return;
}



undefined4 *
FUN_14026f330(longlong *param_1,ulonglong *param_2,short *param_3,undefined4 param_4,
             undefined4 param_5,short *param_6)

{
  short sVar1;
  ulonglong *puVar2;
  int iVar3;
  undefined4 *puVar4;
  ulonglong uVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  uint uVar8;
  undefined4 *puVar9;
  short *psVar10;
  longlong *plVar11;
  bool bVar12;
  
  puVar7 = (undefined4 *)0x0;
  if ((*param_2 != 0) || (puVar4 = puVar7, param_2[1] != 0)) {
    puVar4 = (undefined4 *)0x1;
  }
  puVar9 = puVar7;
  plVar11 = param_1;
  if ((int)puVar4 == 0) {
    return puVar4;
  }
  do {
    puVar2 = (ulonglong *)*plVar11;
    if (puVar2 != (ulonglong *)0x0) {
      bVar12 = *puVar2 < *param_2;
      if ((*puVar2 != *param_2) ||
         (bVar12 = puVar2[1] < param_2[1], iVar3 = 0, puVar2[1] != param_2[1])) {
        iVar3 = (1 - (uint)bVar12) - (uint)(bVar12 != 0);
      }
      if (iVar3 == 0) {
        return (undefined4 *)0x0;
      }
    }
    uVar8 = (int)puVar9 + 1;
    puVar4 = puVar7;
    puVar6 = puVar7;
    puVar9 = (undefined4 *)(ulonglong)uVar8;
    plVar11 = plVar11 + 1;
  } while ((int)uVar8 < 0x19);
  while (iVar3 = (int)puVar6, param_1[(longlong)puVar4] != 0) {
    puVar4 = (undefined4 *)((longlong)puVar4 + 1);
    puVar6 = (undefined4 *)(ulonglong)(iVar3 + 1);
    if (0x18 < (longlong)puVar4) {
      return (undefined4 *)0x0;
    }
  }
  if (iVar3 < 0) {
    return (undefined4 *)0x0;
  }
  puVar4 = operator_new(0x80);
  if (puVar4 != (undefined4 *)0x0) {
    *(undefined8 *)(puVar4 + 0xe) = 7;
    *(undefined8 *)(puVar4 + 0xc) = 0;
    *(undefined2 *)(puVar4 + 8) = 0;
    *(undefined8 *)(puVar4 + 0x18) = 7;
    *(undefined8 *)(puVar4 + 0x16) = 0;
    *(undefined2 *)(puVar4 + 0x12) = 0;
    puVar7 = puVar4;
  }
  uVar5 = 0xffffffffffffffff;
  *puVar7 = (int)*param_2;
  puVar7[1] = *(undefined4 *)((longlong)param_2 + 4);
  puVar7[2] = (int)param_2[1];
  puVar7[3] = *(undefined4 *)((longlong)param_2 + 0xc);
  psVar10 = param_3;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    sVar1 = *psVar10;
    psVar10 = psVar10 + 1;
  } while (sVar1 != 0);
  FUN_140001710(puVar7 + 8,param_3,~uVar5 - 1);
  uVar5 = 0xffffffffffffffff;
  puVar7[5] = param_5;
  puVar7[4] = param_4;
  psVar10 = param_6;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    sVar1 = *psVar10;
    psVar10 = psVar10 + 1;
  } while (sVar1 != 0);
  FUN_140001710(puVar7 + 0x12,param_6,~uVar5 - 1);
  param_1[iVar3] = (longlong)puVar7;
  return (undefined4 *)0x1;
}



bool FUN_14026f4e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4,
                  undefined4 param_5,undefined8 param_6)

{
  longlong lVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  
  uVar3 = 0xfffffffffffffffe;
  lVar1 = param_1 + 200;
  lVar4 = lVar1;
  FUN_14034ed40(lVar1);
  iVar2 = FUN_14026f330(param_1,param_2,param_3,param_4,param_5,param_6,uVar3,lVar4,1);
  if (iVar2 == 0) {
    FUN_14034edd0(lVar1);
  }
  else {
    FUN_14034edd0(lVar1);
  }
  return iVar2 != 0;
}



undefined8 FUN_14026f590(longlong *param_1,ulonglong *param_2,short *param_3)

{
  longlong *plVar1;
  short sVar2;
  ulonglong *puVar3;
  int iVar4;
  ulonglong uVar5;
  short *psVar6;
  uint uVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong *plVar10;
  
  uVar9 = 0xfffffffffffffffe;
  plVar1 = param_1 + 0x19;
  plVar10 = plVar1;
  FUN_14034ed40();
  uVar7 = 0;
  do {
    puVar3 = (ulonglong *)*param_1;
    if (puVar3 != (ulonglong *)0x0) {
      bVar8 = *puVar3 < *param_2;
      if ((*puVar3 == *param_2) && (bVar8 = puVar3[1] < param_2[1], puVar3[1] == param_2[1])) {
        iVar4 = 0;
      }
      else {
        iVar4 = (1 - (uint)bVar8) - (uint)(bVar8 != 0);
      }
      if (iVar4 == 0) {
        uVar5 = 0xffffffffffffffff;
        psVar6 = param_3;
        break;
      }
    }
    uVar7 = uVar7 + 1;
    param_1 = param_1 + 1;
    if (0x18 < uVar7) {
      FUN_14034edd0(plVar1);
      return 0;
    }
  } while( true );
  while( true ) {
    uVar5 = uVar5 - 1;
    sVar2 = *psVar6;
    psVar6 = psVar6 + 1;
    if (sVar2 == 0) break;
    if (uVar5 == 0) break;
  }
  FUN_140001710(puVar3 + 9,param_3,~uVar5 - 1,puVar3 + 9,uVar9,plVar10,1);
  FUN_14034edd0(plVar1);
  return 1;
}



undefined8 FUN_14026f660(longlong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong *plVar5;
  bool bVar6;
  
  FUN_14034ed40(param_1 + 0x19);
  uVar4 = 0;
  plVar5 = param_1;
  do {
    puVar1 = (ulonglong *)*plVar5;
    if (puVar1 != (ulonglong *)0x0) {
      bVar6 = *puVar1 < *param_2;
      if ((*puVar1 == *param_2) && (bVar6 = puVar1[1] < param_2[1], puVar1[1] == param_2[1])) {
        iVar2 = 0;
      }
      else {
        iVar2 = (1 - (uint)bVar6) - (uint)(bVar6 != 0);
      }
      if (iVar2 == 0) {
        if (puVar1 != (ulonglong *)0x0) {
          FUN_140273340();
        }
        param_1[uVar4] = 0;
        FUN_14034edd0(param_1 + 0x19);
        return 1;
      }
    }
    uVar3 = (int)uVar4 + 1;
    uVar4 = (ulonglong)uVar3;
    plVar5 = plVar5 + 1;
    if (0x18 < uVar3) {
      FUN_14034edd0(param_1 + 0x19);
      return 0;
    }
  } while( true );
}



undefined8 FUN_14026f720(longlong *param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  short sVar3;
  longlong lVar4;
  short *psVar5;
  undefined8 *puVar6;
  uint uVar7;
  
  plVar1 = param_1 + 0x19;
  FUN_14034ed40(plVar1);
  uVar7 = 0;
  do {
    lVar4 = *param_1;
    if (lVar4 != 0) {
      puVar6 = (undefined8 *)(lVar4 + 0x20);
      if (7 < *(ulonglong *)(lVar4 + 0x38)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      psVar5 = param_2;
      do {
        sVar2 = *psVar5;
        sVar3 = *(short *)((longlong)psVar5 + ((longlong)puVar6 - (longlong)param_2));
        if (sVar2 != sVar3) break;
        psVar5 = psVar5 + 1;
      } while (sVar3 != 0);
      if (sVar2 == sVar3) {
        FUN_14034edd0(plVar1);
        return 1;
      }
    }
    uVar7 = uVar7 + 1;
    param_1 = param_1 + 1;
    if (0x18 < uVar7) {
      FUN_14034edd0(plVar1);
      return 0;
    }
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x00014026f980)

ulonglong FUN_14026f7c0(longlong *param_1,uint param_2,uint param_3)

{
  short sVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  undefined4 *puVar13;
  char cVar14;
  int iVar15;
  uint uVar16;
  short *psVar17;
  longlong lVar18;
  undefined8 uVar19;
  longlong *plVar20;
  int *piVar21;
  ulonglong extraout_RAX;
  ulonglong extraout_RAX_00;
  uint uVar22;
  ulonglong uVar23;
  uint *puVar24;
  uint *puVar26;
  undefined2 *puVar27;
  ulonglong uVar28;
  uint *puVar29;
  short *psVar30;
  undefined4 *puVar31;
  undefined4 uVar32;
  void *pvVar33;
  uint *puVar34;
  uint local_res8 [2];
  uint local_res10;
  uint local_res18;
  uint local_res20;
  uint local_238;
  uint local_234;
  longlong *local_230;
  longlong *local_228;
  longlong local_1f0;
  uint local_1e8;
  void *local_1e0;
  uint local_1d8;
  uint local_1d4;
  uint local_1d0;
  uint local_1cc;
  uint local_1c8;
  uint local_1c4;
  uint local_1c0;
  uint local_1bc;
  uint local_1b8;
  uint local_1b4;
  uint local_1b0;
  undefined2 local_1a8;
  undefined6 uStack_1a6;
  undefined8 local_198;
  ulonglong local_190;
  uint *local_180;
  uint *local_178;
  uint *local_170;
  undefined4 local_158;
  uint local_154;
  undefined8 local_150;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  uint local_134 [6];
  uint local_11c [3];
  uint local_110 [3];
  uint local_104 [3];
  uint local_f8 [3];
  uint local_ec [3];
  uint local_e0 [3];
  uint local_d4 [3];
  longlong local_c8;
  longlong *local_c0;
  longlong local_b8;
  longlong *local_b0;
  undefined4 *local_a8;
  undefined4 *local_a0;
  undefined8 local_98;
  undefined2 local_88;
  undefined6 uStack_86;
  undefined8 local_78;
  ulonglong local_70;
  undefined8 local_60;
  longlong local_58;
  undefined1 local_50;
  uint *puVar25;
  
  local_60 = 0xfffffffffffffffe;
  uVar28 = (ulonglong)param_2;
  local_190 = 7;
  puVar26 = (uint *)0x0;
  local_198 = 0;
  local_1a8 = 0;
  local_res10 = param_2;
  local_res18 = param_3;
  FUN_140001710(&local_1a8,&DAT_14049d858,1);
  iVar15 = (int)param_1[0x12];
  if (iVar15 == 1) {
    puVar27 = (undefined2 *)&DAT_14049d858;
LAB_14026f862:
    uVar32 = 1;
  }
  else {
    if (iVar15 == 2) {
      puVar27 = (undefined2 *)&DAT_1404a34c8;
      goto LAB_14026f862;
    }
    if (iVar15 != 3) {
      if (iVar15 != 4) goto LAB_14026f86e;
      puVar27 = &DAT_140475bc8;
      goto LAB_14026f862;
    }
    uVar32 = 2;
    puVar27 = (undefined2 *)&DAT_1404b7058;
  }
  FUN_140001710(&local_1a8,puVar27,uVar32);
LAB_14026f86e:
  if (DAT_140607fd8 != 0) {
    puVar27 = &local_1a8;
    if (7 < local_190) {
      puVar27 = (undefined2 *)CONCAT62(uStack_1a6,local_1a8);
    }
    psVar17 = (short *)FUN_1404154c0(&local_88,L"MOB_%d_%s.txt",*(undefined4 *)(param_1[6] + 0x2c8),
                                     puVar27);
    if (7 < *(ulonglong *)(psVar17 + 0xc)) {
      psVar17 = *(short **)psVar17;
    }
    uVar23 = 0xffffffffffffffff;
    psVar30 = psVar17;
    do {
      if (uVar23 == 0) break;
      uVar23 = uVar23 - 1;
      sVar1 = *psVar30;
      psVar30 = psVar30 + 1;
    } while (sVar1 != 0);
    FUN_140001710(DAT_140607fd8 + 0x90,psVar17,~uVar23 - 1);
    if (7 < local_70) {
      operator_delete((void *)CONCAT62(uStack_86,local_88));
    }
    local_70 = 7;
    local_78 = 0;
    local_88 = 0;
    FUN_140418830(DAT_140607fd8,&DAT_1404b70e4,uVar28);
  }
  lVar18 = FUN_140302f80();
  uVar23 = uVar28 / *(uint *)(lVar18 + 0xa0);
  puVar24 = puVar26;
  if (*(longlong *)(lVar18 + 0x90) != 0) {
    for (puVar25 = *(uint **)(*(longlong *)(lVar18 + 0x90) +
                             (uVar28 % (ulonglong)*(uint *)(lVar18 + 0xa0)) * 8);
        (puVar24 = puVar26, puVar25 != (uint *)0x0 &&
        ((puVar25[0x24a] != param_2 || (puVar24 = puVar25, *puVar25 != param_2))));
        puVar25 = *(uint **)(puVar25 + 0x248)) {
    }
  }
  if ((((puVar24 != (uint *)0x0) && (uVar23 = 1, puVar24 != (uint *)0xfffffffffffffff8)) &&
      (uVar23 = param_1[6], uVar23 != 0)) && (*(longlong *)(uVar23 + 0x2d0) != 0)) {
    (**(code **)(*param_1 + 0x198))(param_1);
    FUN_1402eeee0(DAT_140608068,&local_c8,uVar28);
    local_res20 = puVar24[0xaa];
    local_234 = puVar24[0xab];
    local_238 = puVar24[0xac];
    local_1d4 = puVar24[0xb0];
    local_1bc = puVar24[0xb1];
    local_1b8 = puVar24[0xb2];
    uVar16 = puVar24[0xb3];
    local_1c8 = puVar24[0xb4];
    uVar2 = puVar24[0xb5];
    local_1c4 = puVar24[0xba];
    uVar3 = puVar24[0xbb];
    local_1b4 = puVar24[0xbc];
    uVar4 = puVar24[0xbd];
    local_1cc = puVar24[0xbe];
    uVar5 = puVar24[0xbf];
    local_1d0 = puVar24[0xc0];
    local_1e8 = puVar24[0xc1];
    local_1c0 = puVar24[0xc2];
    local_1d8 = puVar24[0xc3];
    uVar6 = puVar24[0xc4];
    local_1b0 = puVar24[0xc5];
    uVar7 = puVar24[0xc6];
    uVar8 = puVar24[199];
    uVar9 = puVar24[200];
    uVar10 = puVar24[0xc9];
    uVar11 = puVar24[0xca];
    uVar12 = puVar24[0xcb];
    FUN_1402eeee0(DAT_140608068,&local_b8,uVar28);
    uVar19 = FUN_140302f80();
    iVar15 = FUN_140301120(uVar19,uVar28);
    if (iVar15 == 4) {
      iVar15 = *(int *)(*(longlong *)(param_1[6] + 0x2d0) + 0x4c4);
      FUN_140337c40(DAT_1406081f8);
      puVar24 = puVar26;
      if ((local_230[1] != 0) && (*(uint *)(local_230 + 2) != 0)) {
        plVar20 = (longlong *)*local_230;
        puVar25 = puVar26;
        do {
          if (*plVar20 != 0) {
            puVar24 = (uint *)((longlong *)*local_230)[(longlong)puVar25];
            break;
          }
          uVar22 = (int)puVar25 + 1;
          puVar25 = (uint *)(ulonglong)uVar22;
          plVar20 = plVar20 + 1;
        } while (uVar22 < *(uint *)(local_230 + 2));
      }
      local_180 = (uint *)0x0;
      local_178 = (uint *)0x0;
      local_170 = (uint *)0x0;
      puVar25 = puVar26;
      puVar34 = puVar26;
LAB_14026fb80:
      puVar29 = puVar24;
      if (puVar29 != (uint *)0x0) {
        lVar18 = *(longlong *)(puVar29 + 2);
        local_1f0 = lVar18;
        if ((*(int *)(lVar18 + 4) <= *(int *)(local_c8 + 0x1f0)) &&
           (*(int *)(local_c8 + 0x1f0) <= *(int *)(lVar18 + 8))) {
          if (*(int **)(lVar18 + 0x10) == *(int **)(lVar18 + 0x18)) {
LAB_14026fbea:
            if (*(int **)(lVar18 + 0x30) != *(int **)(lVar18 + 0x38)) {
              for (piVar21 = *(int **)(lVar18 + 0x30); piVar21 != *(int **)(lVar18 + 0x38);
                  piVar21 = piVar21 + 1) {
                if (*piVar21 == *(int *)(local_b8 + 0x8e4)) goto LAB_14026fd04;
              }
            }
            if (*(longlong *)(lVar18 + 0x50) == *(longlong *)(lVar18 + 0x58)) {
LAB_14026fc43:
              if (*(longlong *)(lVar18 + 0x70) != *(longlong *)(lVar18 + 0x78)) {
                for (piVar21 = *(int **)(lVar18 + 0x70); piVar21 != *(int **)(lVar18 + 0x78);
                    piVar21 = piVar21 + 1) {
                  if (*piVar21 == iVar15) goto LAB_14026fd04;
                }
              }
              FUN_14032a080(local_b8);
              cVar14 = FUN_14033b0c0(lVar18);
              if (cVar14 != '\0') {
                if ((&local_1f0 < puVar26) && (puVar25 <= &local_1f0)) {
                  lVar18 = (longlong)&local_1f0 - (longlong)puVar25;
                  if (puVar26 == puVar34) {
                    FUN_140195b20(&local_180);
                    puVar26 = local_178;
                    puVar25 = local_180;
                    puVar34 = local_170;
                  }
                  if (puVar26 != (uint *)0x0) {
                    *(longlong *)puVar26 = *(longlong *)(puVar25 + (lVar18 >> 3) * 2);
                  }
                }
                else {
                  if (puVar26 == puVar34) {
                    FUN_140195b20(&local_180);
                    puVar26 = local_178;
                    puVar25 = local_180;
                    puVar34 = local_170;
                  }
                  if (puVar26 != (uint *)0x0) {
                    *(longlong *)puVar26 = lVar18;
                  }
                }
                puVar26 = puVar26 + 2;
                local_178 = puVar26;
              }
            }
            else {
              for (piVar21 = *(int **)(lVar18 + 0x50); piVar21 != *(int **)(lVar18 + 0x58);
                  piVar21 = piVar21 + 1) {
                if (*piVar21 == iVar15) goto LAB_14026fc43;
              }
            }
          }
          else {
            for (piVar21 = *(int **)(lVar18 + 0x10); piVar21 != *(int **)(lVar18 + 0x18);
                piVar21 = piVar21 + 1) {
              if (*piVar21 == *(int *)(local_b8 + 0x8e4)) goto LAB_14026fbea;
            }
          }
        }
LAB_14026fd04:
        puVar24 = *(uint **)(puVar29 + 6);
        if (puVar24 == (uint *)0x0) {
          uVar22 = puVar29[8] % *(uint *)(local_230 + 2) + 1;
          lVar18 = (longlong)(int)uVar22 << 3;
          do {
            if (*(uint *)(local_230 + 2) <= uVar22) break;
            if (*(longlong *)(lVar18 + *local_230) != 0) {
              puVar24 = *(uint **)(lVar18 + *local_230);
            }
            uVar22 = uVar22 + 1;
            lVar18 = lVar18 + 8;
          } while (puVar24 == (uint *)0x0);
        }
        goto LAB_14026fb80;
      }
      if (puVar25 != puVar26) {
        iVar15 = rand();
        uVar22 = **(uint **)(puVar25 +
                            (longlong)(iVar15 % (int)((longlong)puVar26 - (longlong)puVar25 >> 3)) *
                            2);
        if (*local_230 != 0) {
          for (puVar26 = *(uint **)(*local_230 +
                                   ((ulonglong)uVar22 % (ulonglong)*(uint *)(local_230 + 2)) * 8);
              puVar26 != (uint *)0x0; puVar26 = *(uint **)(puVar26 + 6)) {
            if ((puVar26[8] == uVar22) && (*puVar26 == uVar22)) {
              if (puVar26 != (uint *)0x0) {
                if (puVar26 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                lVar18 = *(longlong *)(puVar26 + 2);
                goto LAB_14026fdba;
              }
              break;
            }
          }
        }
        lVar18 = 0;
LAB_14026fdba:
        local_res20 = *(uint *)(lVar18 + 0x168);
        local_234 = *(uint *)(lVar18 + 0x16c);
        local_238 = *(uint *)(lVar18 + 0x170);
      }
      if (puVar25 != (uint *)0x0) {
        operator_delete(puVar25);
      }
      param_2 = local_res10;
      if (local_228 != (longlong *)0x0) {
        LOCK();
        plVar20 = local_228 + 1;
        *(int *)plVar20 = (int)*plVar20 + -1;
        UNLOCK();
        if ((int)*plVar20 == 0) {
          (**(code **)(*local_228 + 8))(local_228);
          LOCK();
          piVar21 = (int *)((longlong)local_228 + 0xc);
          *piVar21 = *piVar21 + -1;
          UNLOCK();
          param_2 = local_res10;
          if (*piVar21 == 0) {
            (**(code **)(*local_228 + 0x10))();
            param_2 = local_res10;
          }
        }
      }
    }
    uVar22 = 1;
    local_res8[0] = 1;
    local_a8 = (undefined4 *)0x0;
    local_a0 = (undefined4 *)0x0;
    local_98 = 0;
    lVar18 = DAT_140607cc0;
    if ((DAT_140607cc0 == 0) &&
       (local_1e0 = operator_new(0x130), lVar18 = 0, local_1e0 != (void *)0x0)) {
      lVar18 = FUN_1401e04e0(local_1e0);
    }
    DAT_140607cc0 = lVar18;
    lVar18 = DAT_140607cc0;
    local_58 = DAT_140607cc0 + 0xf8;
    FUN_14034ed40(local_58);
    local_50 = 1;
    FUN_14012bb70(&local_a8,lVar18 + 0x68);
    FUN_14034edd0();
    puVar13 = local_a0;
    puVar31 = local_a8;
    if (local_a8 != local_a0) {
      do {
        uVar32 = *puVar31;
        lVar18 = DAT_140607cc0;
        if (DAT_140607cc0 == 0) {
          local_1e0 = operator_new(0x130);
          lVar18 = 0;
          if (local_1e0 != (void *)0x0) {
            lVar18 = FUN_1401e04e0(local_1e0);
          }
        }
        DAT_140607cc0 = lVar18;
        cVar14 = FUN_1401e0c70(DAT_140607cc0,uVar32,local_res8);
        pvVar33 = (void *)(ulonglong)local_res8[0];
        local_1e0 = pvVar33;
        if (cVar14 != '\0') {
          if ((DAT_14060b7c4 & 1) == 0) {
            DAT_14060b7c4 = DAT_14060b7c4 | 1;
            FUN_140418590();
            atexit((_func_5014 *)&LAB_140448470);
          }
          if (DAT_14060a120 == 1000) {
            FUN_140418da0(DAT_140607fd8,&DAT_1404b7080,uVar32,pvVar33);
          }
        }
        puVar31 = puVar31 + 1;
      } while (puVar31 != puVar13);
      uVar22 = (uint)local_1e0;
    }
    puVar13 = local_a8;
    lVar18 = 0;
    local_150 = 0;
    local_148 = 0;
    local_144 = 0;
    local_140 = 0;
    local_13c = 0;
    local_138 = 0;
    do {
      local_134[lVar18] = 0;
      local_134[lVar18 + 3] = 0;
      local_134[lVar18 + 6] = 0;
      local_134[lVar18 + 9] = 0;
      local_134[lVar18 + 0xc] = 0;
      local_134[lVar18 + 0xf] = 0;
      local_134[lVar18 + 0x12] = 0;
      local_134[lVar18 + 0x15] = 0;
      local_134[lVar18 + 0x18] = 0;
      lVar18 = lVar18 + 1;
    } while (lVar18 < 3);
    local_158 = *(undefined4 *)(local_c8 + 0x1f0);
    local_134[0] = local_res20;
    local_134[1] = local_234;
    local_134[2] = local_238;
    local_134[3] = local_1d4;
    local_134[4] = local_1bc;
    local_134[5] = local_1b8;
    local_11c[1] = local_1c8;
    local_110[0] = local_1c4;
    local_110[2] = local_1b4;
    local_104[1] = local_1cc;
    local_f8[0] = local_1d0;
    local_f8[1] = local_1e8;
    local_f8[2] = local_1c0;
    local_ec[0] = local_1d8;
    local_ec[2] = local_1b0;
    local_154 = param_2;
    local_11c[0] = uVar16;
    local_11c[2] = uVar2;
    local_110[1] = uVar3;
    local_104[0] = uVar4;
    local_104[2] = uVar5;
    local_ec[1] = uVar6;
    local_e0[0] = uVar7;
    local_e0[1] = uVar8;
    local_e0[2] = uVar9;
    local_d4[0] = uVar10;
    local_d4[1] = uVar11;
    local_d4[2] = uVar12;
    if (0 < (int)uVar22) {
      uVar28 = (ulonglong)uVar22;
      uVar16 = local_res18;
      do {
        if (0 < (int)uVar16) {
          uVar23 = (ulonglong)uVar16;
          do {
            (**(code **)(*param_1 + 400))(param_1,&local_158);
            uVar23 = uVar23 - 1;
            uVar16 = local_res18;
          } while (uVar23 != 0);
        }
        uVar28 = uVar28 - 1;
      } while (uVar28 != 0);
    }
    uVar23 = (**(code **)(*param_1 + 0x1a0))(param_1,param_2);
    if (puVar13 != (undefined4 *)0x0) {
      operator_delete(puVar13);
      uVar23 = extraout_RAX;
    }
    if (local_b0 != (longlong *)0x0) {
      LOCK();
      plVar20 = local_b0 + 1;
      *(int *)plVar20 = (int)*plVar20 + -1;
      UNLOCK();
      if ((int)*plVar20 == 0) {
        uVar23 = (**(code **)(*local_b0 + 8))(local_b0);
        LOCK();
        piVar21 = (int *)((longlong)local_b0 + 0xc);
        *piVar21 = *piVar21 + -1;
        UNLOCK();
        if (*piVar21 == 0) {
          uVar23 = (**(code **)(*local_b0 + 0x10))(local_b0);
        }
      }
    }
    if (local_c0 != (longlong *)0x0) {
      LOCK();
      plVar20 = local_c0 + 1;
      lVar18 = *plVar20;
      *(int *)plVar20 = (int)*plVar20 + -1;
      UNLOCK();
      uVar16 = (int)lVar18 - 1;
      uVar23 = (ulonglong)uVar16;
      if (uVar16 == 0) {
        uVar23 = (**(code **)(*local_c0 + 8))(local_c0);
        LOCK();
        piVar21 = (int *)((longlong)local_c0 + 0xc);
        iVar15 = *piVar21;
        *piVar21 = *piVar21 + -1;
        UNLOCK();
        if (iVar15 == 1) {
          uVar23 = (**(code **)(*local_c0 + 0x10))(local_c0);
        }
      }
    }
  }
  if (7 < local_190) {
    operator_delete((void *)CONCAT62(uStack_1a6,local_1a8));
    uVar23 = extraout_RAX_00;
  }
  return uVar23;
}



undefined4 FUN_1402701a0(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  
  uVar4 = 0xfffffffffffffffe;
  lVar2 = *(longlong *)(param_1 + 0x578);
  lVar1 = lVar2 + 0x300;
  lVar5 = lVar1;
  FUN_14034ed40(lVar1);
  uVar3 = FUN_1401e4840(lVar2,lVar2 + 0x50,param_2,param_4,uVar4,lVar5,1);
  FUN_14034edd0(lVar1);
  return uVar3;
}



undefined4
FUN_140270210(longlong param_1,uint param_2,longlong param_3,int param_4,int *param_5,int *param_6)

{
  int *piVar1;
  longlong *plVar2;
  uint uVar3;
  void *pvVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  DWORD DVar10;
  longlong *plVar11;
  undefined8 uVar12;
  uint *puVar13;
  HANDLE hObject;
  HANDLE pvVar14;
  uint *puVar15;
  undefined4 uVar16;
  longlong lVar17;
  uint uVar18;
  int iVar19;
  bool bVar20;
  float fVar21;
  float fVar22;
  int *in_stack_fffffffffffffed8;
  ulonglong in_stack_fffffffffffffee0;
  undefined8 in_stack_fffffffffffffee8;
  undefined4 uVar23;
  uint local_f0 [5];
  float afStack_dc [5];
  float local_c8 [4];
  longlong *local_b8;
  longlong *local_b0;
  int local_a8 [6];
  undefined8 local_90;
  
  local_90 = 0xfffffffffffffffe;
  FUN_140197b70();
  plVar11 = (longlong *)FUN_1401390a0();
  plVar2 = local_b8;
  iVar6 = 0;
  if (*plVar11 != 0) {
    for (puVar15 = *(uint **)(*plVar11 +
                             ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
        puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x3c)) {
      if ((puVar15[0x3e] == param_2) && (*puVar15 == param_2)) {
        if ((puVar15 != (uint *)0x0) && (local_b8 != (longlong *)0x0)) {
          if (local_b8 == local_b0) {
            if (*local_b8 != 0) {
              iVar8 = *(int *)(*local_b8 + 0x50a0);
              uVar12 = FUN_1401390a0();
              iVar7 = FUN_140139040(uVar12);
              iVar7 = iVar7 * param_4;
              if (iVar7 <= iVar8) {
                local_f0[0] = 0;
                local_f0[1] = 0;
                local_f0[2] = 0;
                local_f0[3] = 0;
                local_f0[4] = 0;
                local_a8[0] = 0;
                local_a8[1] = 0;
                local_a8[2] = 0;
                local_a8[3] = 0;
                local_a8[4] = 0;
                lVar17 = 0;
                goto LAB_140270360;
              }
              uVar16 = 0x55;
              goto LAB_1402708da;
            }
          }
          else {
            iVar6 = DAT_140608048 + 1;
            bVar20 = DAT_140608048 == 0;
            DAT_140608048 = iVar6;
            if (bVar20) {
              FUN_140176d60(1);
            }
          }
        }
        break;
      }
    }
  }
  uVar16 = 0x54;
  goto LAB_1402708da;
LAB_140270639:
  if (puVar15 == (uint *)0x0) goto LAB_140270675;
  if ((puVar15[0x3e] == param_2) && (*puVar15 == param_2)) {
    if (puVar15 != (uint *)0x0) {
      if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      if (0 < (int)puVar15[lVar17 + 0x26]) {
        iVar8 = iVar8 + 1;
        iVar19 = iVar19 + puVar15[lVar17 + 0x26];
      }
    }
    goto LAB_140270675;
  }
  puVar15 = *(uint **)(puVar15 + 0x3c);
  goto LAB_140270639;
LAB_140270360:
  do {
    plVar11 = (longlong *)FUN_1401390a0();
    if (*plVar11 != 0) {
      for (puVar15 = *(uint **)(*plVar11 +
                               ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
          puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x3c)) {
        if ((puVar15[0x3e] == param_2) && (*puVar15 == param_2)) {
          if (puVar15 != (uint *)0x0) {
            if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            iVar8 = *(int *)((longlong)puVar15 + lVar17 + 0xa4);
            goto LAB_1402703bd;
          }
          break;
        }
      }
    }
    iVar8 = 0;
LAB_1402703bd:
    *(int *)((longlong)local_f0 + lVar17) = iVar8;
    if (0 < iVar8) {
      iVar8 = FUN_1401eceb0(*plVar2);
      plVar11 = (longlong *)FUN_1401390a0();
      if (*plVar11 != 0) {
        for (puVar15 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x3c)) {
          if ((puVar15[0x3e] == param_2) && (*puVar15 == param_2)) {
            if (puVar15 != (uint *)0x0) {
              if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              iVar19 = *(int *)((longlong)puVar15 + (0xb8 - (longlong)local_f0) +
                               (longlong)local_f0 + lVar17);
              goto LAB_140270434;
            }
            break;
          }
        }
      }
      iVar19 = 0;
LAB_140270434:
      *(int *)((longlong)local_a8 + lVar17) = iVar19 * param_4;
      if (iVar8 < iVar19 * param_4) {
        uVar16 = 0x56;
        goto LAB_1402708da;
      }
    }
    iVar6 = iVar6 + 1;
    lVar17 = lVar17 + 4;
  } while (iVar6 < 5);
  afStack_dc[1] = 0.0;
  afStack_dc[2] = 0.0;
  afStack_dc[3] = 0.0;
  local_c8[0] = 0.0;
  local_c8[1] = 0.0;
  local_c8[2] = 0.0;
  lVar17 = 0;
  do {
    if (lVar17 == 0) {
      local_c8[0] = 0.0;
      plVar11 = (longlong *)FUN_1401390a0();
      if (*plVar11 != 0) {
        for (puVar15 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x3c)) {
          if ((puVar15[0x3e] == param_2) && (*puVar15 == param_2)) {
            if (puVar15 != (uint *)0x0) {
              if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              fVar21 = (float)puVar15[0x23];
              goto LAB_140270512;
            }
            break;
          }
        }
      }
      fVar21 = 0.0;
LAB_140270512:
      afStack_dc[1] = fVar21 * 100.0;
    }
    else {
      fVar21 = afStack_dc[lVar17];
      local_c8[lVar17] = fVar21 + 1.0;
      plVar11 = (longlong *)FUN_1401390a0();
      if (*plVar11 != 0) {
        for (puVar15 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x3c)) {
          if ((puVar15[0x3e] == param_2) && (*puVar15 == param_2)) {
            if (puVar15 != (uint *)0x0) {
              if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              fVar22 = (float)puVar15[lVar17 + 0x23];
              goto LAB_140270588;
            }
            break;
          }
        }
      }
      fVar22 = 0.0;
LAB_140270588:
      afStack_dc[lVar17 + 1] = fVar21 + fVar22 * 100.0;
    }
    lVar17 = lVar17 + 1;
  } while (lVar17 < 3);
  iVar19 = 0;
  iVar8 = 0;
  iVar6 = 0;
  if (0 < param_4) {
    do {
      iVar9 = rand();
      lVar17 = 0;
      do {
        if ((local_c8[lVar17] <= (float)(iVar9 % 100)) &&
           ((float)(iVar9 % 100) <= afStack_dc[lVar17 + 1])) {
          plVar11 = (longlong *)FUN_1401390a0();
          if (*plVar11 != 0) {
            puVar15 = *(uint **)(*plVar11 +
                                ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            goto LAB_140270639;
          }
          break;
        }
        lVar17 = lVar17 + 1;
      } while (lVar17 < 3);
LAB_140270675:
      iVar6 = iVar6 + 1;
    } while (iVar6 < param_4);
    if ((0 < iVar8) && (cVar5 = FUN_140272090(param_1,param_2,iVar19,iVar8), cVar5 != '\0')) {
      *param_5 = iVar8;
      *param_6 = iVar19;
    }
  }
  iVar6 = 0;
  puVar15 = local_f0;
  do {
    piVar1 = (int *)((param_3 - (longlong)local_f0) + (longlong)puVar15);
    if (((-1 < *piVar1) && (0 < *(int *)((longlong)piVar1 + ((longlong)local_a8 - param_3)))) &&
       (uVar3 = *puVar15, 0 < (int)uVar3)) {
      lVar17 = (longlong)iVar6;
      in_stack_fffffffffffffed8 = local_a8 + lVar17;
      in_stack_fffffffffffffee8 = CONCAT44((int)((ulonglong)in_stack_fffffffffffffee8 >> 0x20),0x2b)
      ;
      in_stack_fffffffffffffee0 = CONCAT44((int)(in_stack_fffffffffffffee0 >> 0x20),0x1a1);
      FUN_1401f11c0(*plVar2,param_1,param_3 + lVar17 * 4,local_f0 + lVar17,in_stack_fffffffffffffed8
                    ,in_stack_fffffffffffffee0,in_stack_fffffffffffffee8);
      lVar17 = FUN_140137690();
      if (*(longlong *)(lVar17 + 0x88) != 0) {
        for (puVar13 = *(uint **)(*(longlong *)(lVar17 + 0x88) +
                                 ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar17 + 0x98)) * 8);
            puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 0xa6)) {
          if ((puVar13[0xa8] == uVar3) && (*puVar13 == uVar3)) {
            if (puVar13 != (uint *)0x0) {
              if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar18 = puVar13[0x18];
              goto LAB_14027079a;
            }
            break;
          }
        }
      }
      uVar18 = 0;
LAB_14027079a:
      lVar17 = FUN_1402e0270();
      if (*(longlong *)(lVar17 + 0x1b0) != 0) {
        for (puVar13 = *(uint **)(*(longlong *)(lVar17 + 0x1b0) +
                                 ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar17 + 0x1c0)) * 8);
            puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 2)) {
          if ((puVar13[4] == uVar3) && (*puVar13 == uVar3)) goto LAB_1402707d6;
        }
      }
      puVar13 = (uint *)0x0;
LAB_1402707d6:
      if (puVar13 == (uint *)0x0) {
        lVar17 = FUN_1402e0270();
        if (0 < (int)uVar18) {
          if (*(longlong *)(lVar17 + 0x1f8) != 0) {
            for (puVar13 = *(uint **)(*(longlong *)(lVar17 + 0x1f8) +
                                     ((ulonglong)uVar18 % (ulonglong)*(uint *)(lVar17 + 0x208)) * 8)
                ; puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 2)) {
              if ((puVar13[4] == uVar18) && (*puVar13 == uVar18)) goto LAB_14027081b;
            }
          }
          puVar13 = (uint *)0x0;
LAB_14027081b:
          if (puVar13 != (uint *)0x0) goto LAB_140270820;
        }
      }
      else {
LAB_140270820:
        iVar8 = *piVar1;
        if ((((iVar8 == 1) || (iVar8 == 2)) || (iVar8 == 3)) || ((iVar8 == 4 || (iVar8 == 5)))) {
          FUN_1401a8bb0(param_1,uVar3);
        }
      }
    }
    uVar16 = (undefined4)((ulonglong)in_stack_fffffffffffffed8 >> 0x20);
    uVar23 = (undefined4)((ulonglong)in_stack_fffffffffffffee8 >> 0x20);
    iVar6 = iVar6 + 1;
    puVar15 = puVar15 + 1;
  } while (iVar6 < 5);
  FUN_140197b90(param_1,-iVar7);
  FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x196,CONCAT44(uVar16,0x3d),
                in_stack_fffffffffffffee0 & 0xffffffff00000000,
                CONCAT44(uVar23,iVar7 + *(int *)(*plVar2 + 0x50a0)),*(int *)(*plVar2 + 0x50a0),iVar7
                ,0);
  uVar16 = 0x53;
LAB_1402708da:
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == local_b0) {
      LOCK();
      plVar2 = plVar2 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        pvVar4 = (void *)*local_b8;
        if (pvVar4 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar4 + 0xf630);
          operator_delete(pvVar4);
        }
        operator_delete(local_b8);
      }
    }
    else {
      iVar6 = DAT_140608050 + 1;
      bVar20 = DAT_140608050 == 0;
      DAT_140608050 = iVar6;
      if ((bVar20) &&
         (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                (HANDLE)0x0), hObject != (HANDLE)0x0)) {
        DVar10 = GetCurrentProcessId();
        pvVar14 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar14,DVar10,hObject,2,0,0,0);
        CloseHandle(hObject);
      }
    }
  }
  return uVar16;
}



undefined4
FUN_1402709e0(longlong param_1,uint param_2,longlong param_3,int param_4,int *param_5,int *param_6)

{
  longlong *plVar1;
  int *piVar2;
  uint uVar3;
  void *pvVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  DWORD DVar10;
  longlong *plVar11;
  undefined8 uVar12;
  uint *puVar13;
  HANDLE hObject;
  HANDLE pvVar14;
  uint *puVar15;
  longlong lVar16;
  undefined4 uVar17;
  uint uVar18;
  int iVar19;
  bool bVar20;
  float fVar21;
  float fVar22;
  undefined8 in_stack_fffffffffffffee0;
  ulonglong uVar23;
  undefined8 in_stack_fffffffffffffee8;
  undefined4 uVar24;
  uint local_f0 [5];
  float afStack_dc [5];
  float local_c8 [4];
  longlong *local_b8;
  longlong *local_b0;
  int local_a8 [6];
  undefined8 local_90;
  int local_58 [6];
  
  local_90 = 0xfffffffffffffffe;
  FUN_140197b70();
  plVar11 = (longlong *)FUN_140140140();
  plVar1 = local_b8;
  iVar6 = 0;
  if (*plVar11 != 0) {
    for (puVar15 = *(uint **)(*plVar11 +
                             ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
        puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x30)) {
      if ((puVar15[0x32] == param_2) && (*puVar15 == param_2)) {
        if ((puVar15 != (uint *)0x0) && (local_b8 != (longlong *)0x0)) {
          if (local_b8 == local_b0) {
            if (*local_b8 != 0) {
              iVar8 = *(int *)(*local_b8 + 0x50a0);
              uVar12 = FUN_140140140();
              iVar7 = FUN_1401400e0(uVar12);
              iVar7 = iVar7 * param_4;
              if (iVar7 <= iVar8) {
                local_f0[0] = 0;
                local_f0[1] = 0;
                local_f0[2] = 0;
                local_f0[3] = 0;
                local_f0[4] = 0;
                local_a8[0] = 0;
                local_a8[1] = 0;
                local_a8[2] = 0;
                local_a8[3] = 0;
                local_a8[4] = 0;
                lVar16 = 0;
                goto LAB_140270b30;
              }
              uVar17 = 0x55;
              goto LAB_1402710e6;
            }
          }
          else {
            iVar6 = DAT_140608048 + 1;
            bVar20 = DAT_140608048 == 0;
            DAT_140608048 = iVar6;
            if (bVar20) {
              FUN_140176d60(1);
            }
          }
        }
        break;
      }
    }
  }
  uVar17 = 0x54;
  goto LAB_1402710e6;
LAB_140270e09:
  if (puVar15 == (uint *)0x0) goto LAB_140270e42;
  if ((puVar15[0x32] == param_2) && (*puVar15 == param_2)) {
    if (puVar15 != (uint *)0x0) {
      if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      if (0 < (int)puVar15[lVar16 + 0x1e]) {
        iVar8 = iVar8 + 1;
        iVar19 = iVar19 + puVar15[lVar16 + 0x1e];
      }
    }
    goto LAB_140270e42;
  }
  puVar15 = *(uint **)(puVar15 + 0x30);
  goto LAB_140270e09;
LAB_140270b30:
  do {
    plVar11 = (longlong *)FUN_140140140();
    if (*plVar11 != 0) {
      for (puVar15 = *(uint **)(*plVar11 +
                               ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
          puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x30)) {
        if ((puVar15[0x32] == param_2) && (*puVar15 == param_2)) {
          if (puVar15 != (uint *)0x0) {
            if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            iVar8 = *(int *)((longlong)puVar15 + lVar16 + 0x84);
            goto LAB_140270b8d;
          }
          break;
        }
      }
    }
    iVar8 = 0;
LAB_140270b8d:
    *(int *)((longlong)local_f0 + lVar16) = iVar8;
    if (0 < iVar8) {
      iVar8 = FUN_1401eceb0(*plVar1);
      plVar11 = (longlong *)FUN_140140140();
      if (*plVar11 != 0) {
        for (puVar15 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x30)) {
          if ((puVar15[0x32] == param_2) && (*puVar15 == param_2)) {
            if (puVar15 != (uint *)0x0) {
              if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              iVar19 = *(int *)((longlong)puVar15 + (0x98 - (longlong)local_f0) +
                               (longlong)local_f0 + lVar16);
              goto LAB_140270c04;
            }
            break;
          }
        }
      }
      iVar19 = 0;
LAB_140270c04:
      *(int *)((longlong)local_a8 + lVar16) = iVar19 * param_4;
      if (iVar8 < iVar19 * param_4) {
        uVar17 = 0x56;
        goto LAB_1402710e6;
      }
    }
    iVar6 = iVar6 + 1;
    lVar16 = lVar16 + 4;
  } while (iVar6 < 5);
  afStack_dc[1] = 0.0;
  afStack_dc[2] = 0.0;
  afStack_dc[3] = 0.0;
  local_c8[0] = 0.0;
  local_c8[1] = 0.0;
  local_c8[2] = 0.0;
  lVar16 = 0;
  do {
    if (lVar16 == 0) {
      local_c8[0] = 0.0;
      plVar11 = (longlong *)FUN_140140140();
      if (*plVar11 != 0) {
        for (puVar15 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x30)) {
          if ((puVar15[0x32] == param_2) && (*puVar15 == param_2)) {
            if (puVar15 != (uint *)0x0) {
              if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              fVar21 = (float)puVar15[0x1b];
              goto LAB_140270cdf;
            }
            break;
          }
        }
      }
      fVar21 = 0.0;
LAB_140270cdf:
      afStack_dc[1] = fVar21 * 100.0;
    }
    else {
      fVar21 = afStack_dc[lVar16];
      local_c8[lVar16] = fVar21 + 1.0;
      plVar11 = (longlong *)FUN_140140140();
      if (*plVar11 != 0) {
        for (puVar15 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar15 != (uint *)0x0; puVar15 = *(uint **)(puVar15 + 0x30)) {
          if ((puVar15[0x32] == param_2) && (*puVar15 == param_2)) {
            if (puVar15 != (uint *)0x0) {
              if (puVar15 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              fVar22 = (float)puVar15[lVar16 + 0x1b];
              goto LAB_140270d52;
            }
            break;
          }
        }
      }
      fVar22 = 0.0;
LAB_140270d52:
      afStack_dc[lVar16 + 1] = fVar21 + fVar22 * 100.0;
    }
    lVar16 = lVar16 + 1;
  } while (lVar16 < 3);
  iVar19 = 0;
  iVar8 = 0;
  iVar6 = 0;
  if (0 < param_4) {
    do {
      iVar9 = rand();
      lVar16 = 0;
      do {
        if ((local_c8[lVar16] <= (float)(iVar9 % 100)) &&
           ((float)(iVar9 % 100) <= afStack_dc[lVar16 + 1])) {
          plVar11 = (longlong *)FUN_140140140();
          if (*plVar11 != 0) {
            puVar15 = *(uint **)(*plVar11 +
                                ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            goto LAB_140270e09;
          }
          break;
        }
        lVar16 = lVar16 + 1;
      } while (lVar16 < 3);
LAB_140270e42:
      iVar6 = iVar6 + 1;
    } while (iVar6 < param_4);
    if ((0 < iVar8) && (cVar5 = FUN_140272090(param_1,param_2,iVar19,iVar8), cVar5 != '\0')) {
      *param_5 = iVar8;
      *param_6 = iVar19;
    }
  }
  iVar6 = 0;
  puVar15 = local_f0;
  do {
    piVar2 = (int *)((param_3 - (longlong)local_f0) + (longlong)puVar15);
    if (((-1 < *piVar2) && (0 < *(int *)((longlong)piVar2 + ((longlong)local_a8 - param_3)))) &&
       (uVar3 = *puVar15, 0 < (int)uVar3)) {
      lVar16 = (longlong)iVar6;
      in_stack_fffffffffffffee8 = CONCAT44((int)((ulonglong)in_stack_fffffffffffffee8 >> 0x20),0x2b)
      ;
      in_stack_fffffffffffffee0 =
           CONCAT44((int)((ulonglong)in_stack_fffffffffffffee0 >> 0x20),0x1a1);
      FUN_1401f11c0(*plVar1,param_1,param_3 + lVar16 * 4,local_f0 + lVar16,local_a8 + lVar16,
                    in_stack_fffffffffffffee0,in_stack_fffffffffffffee8);
      lVar16 = FUN_140137690();
      if (*(longlong *)(lVar16 + 0x88) != 0) {
        for (puVar13 = *(uint **)(*(longlong *)(lVar16 + 0x88) +
                                 ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar16 + 0x98)) * 8);
            puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 0xa6)) {
          if ((puVar13[0xa8] == uVar3) && (*puVar13 == uVar3)) {
            if (puVar13 != (uint *)0x0) {
              if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar18 = puVar13[0x18];
              goto LAB_140270f6a;
            }
            break;
          }
        }
      }
      uVar18 = 0;
LAB_140270f6a:
      lVar16 = FUN_1402e0270();
      if (*(longlong *)(lVar16 + 0x1b0) != 0) {
        for (puVar13 = *(uint **)(*(longlong *)(lVar16 + 0x1b0) +
                                 ((ulonglong)uVar3 % (ulonglong)*(uint *)(lVar16 + 0x1c0)) * 8);
            puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 2)) {
          if ((puVar13[4] == uVar3) && (*puVar13 == uVar3)) goto LAB_140270fa6;
        }
      }
      puVar13 = (uint *)0x0;
LAB_140270fa6:
      if (puVar13 == (uint *)0x0) {
        lVar16 = FUN_1402e0270();
        if (0 < (int)uVar18) {
          if (*(longlong *)(lVar16 + 0x1f8) != 0) {
            for (puVar13 = *(uint **)(*(longlong *)(lVar16 + 0x1f8) +
                                     ((ulonglong)uVar18 % (ulonglong)*(uint *)(lVar16 + 0x208)) * 8)
                ; puVar13 != (uint *)0x0; puVar13 = *(uint **)(puVar13 + 2)) {
              if ((puVar13[4] == uVar18) && (*puVar13 == uVar18)) goto LAB_140270feb;
            }
          }
          puVar13 = (uint *)0x0;
LAB_140270feb:
          if (puVar13 != (uint *)0x0) goto LAB_140270ff0;
        }
      }
      else {
LAB_140270ff0:
        iVar8 = *piVar2;
        if ((((iVar8 == 1) || (iVar8 == 2)) || (iVar8 == 3)) || ((iVar8 == 4 || (iVar8 == 5)))) {
          FUN_1401a8bb0(param_1,uVar3);
        }
      }
    }
    uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffee0 >> 0x20);
    uVar24 = (undefined4)((ulonglong)in_stack_fffffffffffffee8 >> 0x20);
    iVar6 = iVar6 + 1;
    puVar15 = puVar15 + 1;
  } while (iVar6 < 5);
  FUN_140197b90(param_1,-iVar7);
  uVar23 = CONCAT44(uVar17,*param_6);
  uVar17 = 0;
  FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a1,0x2b,param_1,0,uVar23,CONCAT44(uVar24,iVar7),
                0,*param_5);
  FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x196,CONCAT44(uVar17,0x3d),
                uVar23 & 0xffffffff00000000,iVar7 + *(int *)(*plVar1 + 0x50a0),
                *(int *)(*plVar1 + 0x50a0),iVar7,0);
  uVar17 = 0x53;
LAB_1402710e6:
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == local_b0) {
      LOCK();
      plVar1 = plVar1 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        pvVar4 = (void *)*local_b8;
        if (pvVar4 != (void *)0x0) {
          FUN_14034edf0((longlong)pvVar4 + 0xf630);
          operator_delete(pvVar4);
        }
        operator_delete(local_b8);
      }
    }
    else {
      iVar6 = DAT_140608050 + 1;
      bVar20 = DAT_140608050 == 0;
      DAT_140608050 = iVar6;
      if ((bVar20) &&
         (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                (HANDLE)0x0), hObject != (HANDLE)0x0)) {
        DVar10 = GetCurrentProcessId();
        pvVar14 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar14,DVar10,hObject,2,0,0,0);
        CloseHandle(hObject);
      }
    }
  }
  return uVar17;
}



// WARNING: Removing unreachable block (ram,0x0001402717b5)
// WARNING: Removing unreachable block (ram,0x000140271651)
// WARNING: Removing unreachable block (ram,0x0001402717c0)
// WARNING: Removing unreachable block (ram,0x000140271875)
// WARNING: Removing unreachable block (ram,0x000140271646)
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1402711e0(longlong param_1,uint param_2,longlong *param_3)

{
  ulonglong uVar1;
  ulonglong uVar2;
  void *pvVar3;
  ushort uVar4;
  ushort uVar5;
  uint uVar6;
  int iVar7;
  DWORD DVar8;
  longlong *plVar9;
  longlong lVar10;
  longlong *plVar11;
  longlong lVar12;
  undefined4 *puVar13;
  longlong lVar14;
  HANDLE hObject;
  HANDLE pvVar15;
  short *psVar16;
  uint *puVar17;
  uint uVar18;
  int iVar19;
  undefined1 *puVar20;
  uint uVar21;
  undefined8 uVar22;
  ushort *puVar23;
  ulonglong *puVar24;
  longlong lVar25;
  longlong lVar26;
  ulonglong uVar27;
  bool bVar28;
  float fVar29;
  float fVar30;
  uint local_res10 [2];
  longlong *local_res18;
  longlong *local_res20;
  ushort *in_stack_fffffffffffffa48;
  longlong *in_stack_fffffffffffffa50;
  undefined4 uVar33;
  undefined8 uVar31;
  undefined4 *puVar32;
  undefined4 *in_stack_fffffffffffffa58;
  uint uVar34;
  undefined8 in_stack_fffffffffffffa60;
  undefined4 uVar35;
  undefined8 in_stack_fffffffffffffa68;
  undefined4 uVar36;
  undefined4 uVar37;
  undefined8 local_588;
  float local_580 [4];
  longlong *local_570;
  longlong *local_568;
  int local_560;
  float local_558 [4];
  longlong local_548;
  longlong local_540;
  undefined4 local_538;
  undefined4 local_534;
  undefined4 local_530;
  undefined4 local_52c;
  undefined4 local_528;
  undefined4 local_524;
  undefined4 local_520;
  undefined4 local_51c;
  uint local_518 [8];
  undefined8 local_4f8;
  undefined4 uStack_4f0;
  undefined4 uStack_4ec;
  uint local_4e8;
  ushort local_4e4;
  ushort local_4e2;
  uint local_4e0;
  short local_4dc;
  undefined1 local_4cc [4];
  undefined1 local_4c8 [12];
  undefined1 local_4bc [108];
  undefined4 local_450;
  longlong local_448;
  undefined1 local_440;
  undefined8 local_438;
  undefined1 local_430 [16];
  longlong local_420;
  longlong local_410;
  int aiStack_400 [6];
  undefined1 local_3e8 [20];
  short local_3d4 [2];
  ushort local_3d0 [2];
  short local_3cc [454];
  
  local_438 = 0xfffffffffffffffe;
  local_res18 = param_3;
  FUN_140197b70();
  plVar9 = (longlong *)FUN_1401390a0();
  plVar11 = local_570;
  uVar27 = 0;
  local_res20 = local_570;
  if (*plVar9 == 0) {
LAB_140271f8c:
    uVar22 = 0x54;
LAB_140271f91:
    if (plVar11 != (longlong *)0x0) {
      if (plVar11 == local_568) {
        LOCK();
        plVar11 = plVar11 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          pvVar3 = (void *)*local_570;
          if (pvVar3 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar3 + 0xf630);
            operator_delete(pvVar3);
          }
          operator_delete(local_570);
        }
      }
      else {
        iVar7 = DAT_140608050 + 1;
        bVar28 = DAT_140608050 == 0;
        DAT_140608050 = iVar7;
        if ((bVar28) &&
           (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                  (HANDLE)0x0), hObject != (HANDLE)0x0)) {
          DVar8 = GetCurrentProcessId();
          pvVar15 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar15,DVar8,hObject,2,0,0,0);
          CloseHandle(hObject);
        }
      }
    }
    return uVar22;
  }
  puVar17 = *(uint **)(*plVar9 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar9 + 2)) * 8);
  while( true ) {
    if (puVar17 == (uint *)0x0) goto LAB_140271f8c;
    if ((puVar17[0x3e] == param_2) && (*puVar17 == param_2)) break;
    puVar17 = *(uint **)(puVar17 + 0x3c);
  }
  if ((puVar17 == (uint *)0x0) || (local_570 == (longlong *)0x0)) goto LAB_140271f8c;
  if (local_570 != local_568) {
    iVar7 = DAT_140608048 + 1;
    bVar28 = DAT_140608048 == 0;
    DAT_140608048 = iVar7;
    if (bVar28) {
      FUN_140176d60(1);
    }
    goto LAB_140271f8c;
  }
  if (*local_570 == 0) goto LAB_140271f8c;
  uVar22 = FUN_1401390a0();
  local_560 = FUN_140139040(uVar22);
  puVar20 = local_3e8;
  iVar7 = 4;
  do {
    FUN_14000a170(puVar20);
    *(undefined4 *)(puVar20 + 0xa8) = 0;
    puVar20 = puVar20 + 0xac;
    iVar7 = iVar7 + -1;
  } while (-1 < iVar7);
  local_res10[0] = 0;
  lVar25 = *param_3;
  if (param_3[1] - lVar25 >> 4 != 0) {
    do {
      puVar24 = (ulonglong *)(uVar27 * 0x10 + lVar25);
      lVar12 = *plVar11;
      lVar25 = lVar12 + 0xf630;
      local_410 = lVar25;
      FUN_14034ed40(lVar25);
      uVar21 = 1;
      do {
        uVar18 = 0;
        do {
          lVar10 = ((longlong)(int)uVar18 + (longlong)(int)uVar21 * 0x18) * 0xac;
          uVar1 = *(ulonglong *)(lVar10 + lVar12);
          uVar2 = *puVar24;
          bVar28 = uVar1 < uVar2;
          if ((uVar1 == uVar2) &&
             (uVar1 = *(ulonglong *)(lVar10 + 8 + lVar12), uVar2 = puVar24[1],
             bVar28 = uVar1 < uVar2, uVar1 == uVar2)) {
            iVar7 = 0;
          }
          else {
            iVar7 = (1 - (uint)bVar28) - (uint)(bVar28 != 0);
          }
          if (iVar7 == 0) {
            FUN_14034edd0(lVar25);
            plVar11 = local_res20;
            if ((4 < uVar21) || (0x17 < uVar18)) {
              LOCK();
              plVar11 = local_res20 + 1;
              *(int *)plVar11 = (int)*plVar11 + -1;
              UNLOCK();
              if ((int)*plVar11 == 0) {
                pvVar3 = (void *)*local_570;
                if (pvVar3 != (void *)0x0) {
                  FUN_14034edf0((longlong)pvVar3 + 0xf630);
                  operator_delete(pvVar3);
                }
                operator_delete(local_570);
              }
              return 0;
            }
            lVar25 = ((longlong)(int)uVar18 + (longlong)(int)uVar21 * 0x18) * 0xac + *local_res20;
            *(short *)(lVar25 + 0x14) = (short)uVar21;
            *(short *)(lVar25 + 0x16) = (short)uVar18;
            FUN_140090020(local_3e8 + uVar27 * 0xac);
            goto LAB_14027140f;
          }
          uVar18 = uVar18 + 1;
        } while ((int)uVar18 < 0x18);
        uVar21 = uVar21 + 1;
      } while ((int)uVar21 < 5);
      FUN_14034edd0(lVar25);
      plVar11 = local_res20;
LAB_14027140f:
      local_res10[0] = local_res10[0] + 1;
      lVar25 = *local_res18;
      uVar27 = (ulonglong)local_res10[0];
    } while (uVar27 < (ulonglong)(local_res18[1] - lVar25 >> 4));
  }
  local_res10[0] = 0;
  local_540 = 0x9c - (longlong)local_518;
  lVar25 = 0xb0 - (longlong)local_518;
  local_588 = 0;
  local_548 = lVar25;
  do {
    lVar10 = local_540;
    lVar12 = local_588;
    iVar7 = 0;
    bVar28 = false;
    plVar11 = (longlong *)FUN_1401390a0();
    uVar21 = 0;
    if (*plVar11 != 0) {
      for (puVar17 = *(uint **)(*plVar11 +
                               ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
          puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0x3c)) {
        if ((puVar17[0x3e] == param_2) && (*puVar17 == param_2)) {
          if (puVar17 != (uint *)0x0) {
            uVar21 = *(uint *)((longlong)puVar17 + (longlong)local_518 + lVar10 + lVar12 + 8);
          }
          break;
        }
      }
    }
    *(uint *)((longlong)local_518 + lVar12) = uVar21;
    if (0 < (int)uVar21) {
      plVar11 = (longlong *)FUN_1401390a0();
      if (*plVar11 != 0) {
        for (puVar17 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0x3c)) {
          if ((puVar17[0x3e] == param_2) && (*puVar17 == param_2)) {
            if (puVar17 != (uint *)0x0) {
              iVar7 = *(int *)((longlong)local_518 + lVar12 + lVar25 + 8 + (longlong)puVar17);
            }
            break;
          }
        }
      }
      *(int *)((longlong)aiStack_400 + lVar12) = iVar7;
      lVar25 = 0;
      psVar16 = local_3cc;
      do {
        uVar18 = *(uint *)(psVar16 + -2);
        lVar12 = FUN_140137690();
        if (*(longlong *)(lVar12 + 0x88) != 0) {
          for (puVar17 = *(uint **)(*(longlong *)(lVar12 + 0x88) +
                                   ((ulonglong)uVar18 % (ulonglong)*(uint *)(lVar12 + 0x98)) * 8);
              puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0xa6)) {
            if ((puVar17[0xa8] == uVar18) && (*puVar17 == uVar18)) {
              if (puVar17 != (uint *)0x0) {
                if (puVar17 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                uVar18 = puVar17[0x5c];
                goto LAB_1402715ec;
              }
              break;
            }
          }
        }
        uVar18 = 0;
LAB_1402715ec:
        plVar11 = local_res20;
        if ((uVar21 == uVar18) && (bVar28 = true, *psVar16 < iVar7)) {
          uVar22 = 0x56;
          goto LAB_140271f91;
        }
        lVar25 = lVar25 + 1;
        psVar16 = psVar16 + 0x56;
      } while (lVar25 < 5);
      lVar12 = local_588;
      lVar25 = local_548;
      if (!bVar28) {
        uVar22 = 0x56;
        goto LAB_140271f91;
      }
    }
    lVar10 = 0;
    local_res10[0] = local_res10[0] + 1;
    local_588 = lVar12 + 4;
  } while ((int)local_res10[0] < 5);
  local_580[0] = 0.0;
  local_580[1] = 0.0;
  local_580[2] = 0.0;
  local_558[0] = 0.0;
  local_558[1] = 0.0;
  local_558[2] = 0.0;
  lVar25 = lVar10;
  do {
    if (lVar25 == 0) {
      local_558[0] = 0.0;
      plVar11 = (longlong *)FUN_1401390a0();
      if (*plVar11 != 0) {
        for (puVar17 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0x3c)) {
          if ((puVar17[0x3e] == param_2) && (*puVar17 == param_2)) {
            if (puVar17 != (uint *)0x0) {
              fVar29 = (float)puVar17[0x23];
              goto LAB_140271724;
            }
            break;
          }
        }
      }
      fVar29 = 0.0;
LAB_140271724:
      local_580[0] = fVar29 * 100.0;
    }
    else {
      fVar29 = *(float *)((longlong)&local_588 + lVar25 * 4 + 4);
      local_558[lVar25] = fVar29 + 1.0;
      plVar11 = (longlong *)FUN_1401390a0();
      if (*plVar11 != 0) {
        for (puVar17 = *(uint **)(*plVar11 +
                                 ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar11 + 2)) * 8);
            puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0x3c)) {
          if ((puVar17[0x3e] == param_2) && (*puVar17 == param_2)) {
            if (puVar17 != (uint *)0x0) {
              fVar30 = (float)puVar17[lVar25 + 0x23];
              goto LAB_140271798;
            }
            break;
          }
        }
      }
      fVar30 = 0.0;
LAB_140271798:
      local_580[lVar25] = fVar29 + fVar30 * 100.0;
    }
    lVar25 = lVar25 + 1;
  } while (lVar25 < 3);
  iVar7 = rand();
  iVar19 = 0;
  lVar25 = lVar10;
  do {
    if ((*(float *)((longlong)local_558 + lVar25) <= (float)(iVar7 % 100)) &&
       ((float)(iVar7 % 100) <= *(float *)((longlong)local_580 + lVar25))) {
      plVar9 = (longlong *)FUN_1401390a0();
      uVar35 = (undefined4)((ulonglong)in_stack_fffffffffffffa60 >> 0x20);
      uVar36 = (undefined4)((ulonglong)in_stack_fffffffffffffa68 >> 0x20);
      uVar33 = (undefined4)((ulonglong)in_stack_fffffffffffffa50 >> 0x20);
      plVar11 = local_res20;
      if (*plVar9 != 0) {
        puVar17 = *(uint **)(*plVar9 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar9 + 2)) * 8);
        goto LAB_140271844;
      }
      break;
    }
    iVar19 = iVar19 + 1;
    lVar25 = lVar25 + 4;
    plVar11 = local_res20;
  } while (lVar25 < 0xc);
  goto LAB_140271e8f;
LAB_140271844:
  if (puVar17 == (uint *)0x0) goto LAB_140271e8f;
  if ((puVar17[0x3e] == param_2) && (*puVar17 == param_2)) {
    if ((puVar17 == (uint *)0x0) || (uVar21 = puVar17[(longlong)iVar19 + 0x26], (int)uVar21 < 1))
    goto LAB_140271e8f;
    FUN_14000a170(&local_4f8);
    local_450 = 0;
    puVar13 = (undefined4 *)FUN_140357570(local_430);
    local_4f8._0_4_ = *puVar13;
    local_4f8._4_4_ = puVar13[1];
    uStack_4f0 = puVar13[2];
    uStack_4ec = puVar13[3];
    local_4dc = (short)uVar21;
    local_4e8 = param_2;
    local_4e0 = param_2;
    lVar25 = FUN_140137690();
    uVar21 = 0xfffffffd;
    if (param_2 == 0) {
      local_4e4 = 0;
      goto LAB_14027194d;
    }
    if (*(longlong *)(lVar25 + 0x88) == 0) goto code_r0x000140271917;
    puVar17 = *(uint **)(*(longlong *)(lVar25 + 0x88) +
                        ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar25 + 0x98)) * 8);
    goto LAB_1402718f0;
  }
  puVar17 = *(uint **)(puVar17 + 0x3c);
  goto LAB_140271844;
LAB_1402718f0:
  if (puVar17 == (uint *)0x0) goto code_r0x000140271917;
  if ((puVar17[0xa8] == param_2) && (*puVar17 == param_2)) {
    if (puVar17 != (uint *)0x0) {
      if (puVar17 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      local_4e4 = (ushort)puVar17[0x39];
      goto LAB_14027194d;
    }
    goto code_r0x000140271917;
  }
  puVar17 = *(uint **)(puVar17 + 0xa6);
  goto LAB_1402718f0;
code_r0x000140271917:
  if (param_2 != 1) {
    FUN_1400050f0(L"GetInventoryType Miss : %d",param_2);
  }
  local_4e4 = 0xfffd;
LAB_14027194d:
  plVar11 = local_res20;
  lVar12 = (longlong)(short)local_4e4;
  lVar25 = *local_res20;
  if (4 < local_4e4) {
LAB_140271e45:
    LOCK();
    plVar11 = plVar11 + 1;
    *(int *)plVar11 = (int)*plVar11 + -1;
    UNLOCK();
    if ((int)*plVar11 == 0) {
      pvVar3 = (void *)*local_570;
      if (pvVar3 != (void *)0x0) {
        FUN_14034edf0((longlong)pvVar3 + 0xf630);
        operator_delete(pvVar3);
      }
      operator_delete(local_570);
    }
    return 0x56;
  }
  lVar26 = lVar25 + 0xf630;
  local_420 = lVar26;
  FUN_14034ed40(lVar26);
  iVar7 = 0;
  psVar16 = (short *)(lVar12 * 0x1020 + 0x1c + lVar25);
  while( true ) {
    if ((*(longlong *)(psVar16 + -0xe) == 0) && (*(longlong *)(psVar16 + -10) == 0)) {
      bVar28 = false;
    }
    else {
      bVar28 = true;
    }
    if (((!bVar28) && (*(int *)(psVar16 + -2) == 0)) && (*psVar16 < 1)) break;
    iVar7 = iVar7 + 1;
    lVar10 = lVar10 + 1;
    psVar16 = psVar16 + 0x56;
    if (0x17 < lVar10) {
      FUN_14034edd0(lVar26);
      goto LAB_140271e45;
    }
  }
  FUN_14034edd0(lVar26);
  uVar18 = local_4e0;
  if (iVar7 < 0) goto LAB_140271e45;
  local_4e2 = (ushort)iVar7;
  if (((local_4e4 == 1) || (local_4e4 == 2)) || (local_4e4 == 5)) {
    lVar25 = FUN_140137690();
    uVar6 = local_4e0;
    uVar34 = (uint)((ulonglong)in_stack_fffffffffffffa58 >> 0x20);
    if (*(longlong *)(lVar25 + 0x88) != 0) {
      for (puVar17 = *(uint **)(*(longlong *)(lVar25 + 0x88) +
                               ((ulonglong)uVar18 % (ulonglong)*(uint *)(lVar25 + 0x98)) * 8);
          puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0xa6)) {
        if ((puVar17[0xa8] == uVar18) && (*puVar17 == uVar18)) {
          if (puVar17 != (uint *)0x0) {
            if (puVar17 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if ((puVar17[0x46] != 0) && (puVar17[0x46] != 0x17)) goto LAB_140271b2e;
          }
          break;
        }
      }
    }
    lVar25 = FUN_140137690();
    if (*(longlong *)(lVar25 + 0x88) == 0) {
code_r0x000140271add:
      uVar18 = 0;
    }
    else {
      puVar17 = *(uint **)(*(longlong *)(lVar25 + 0x88) +
                          ((ulonglong)uVar6 % (ulonglong)*(uint *)(lVar25 + 0x98)) * 8);
      while( true ) {
        if (puVar17 == (uint *)0x0) goto code_r0x000140271add;
        if ((puVar17[0xa8] == uVar6) && (*puVar17 == uVar6)) break;
        puVar17 = *(uint **)(puVar17 + 0xa6);
      }
      if (puVar17 == (uint *)0x0) goto code_r0x000140271add;
      if (puVar17 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar18 = puVar17[0x35];
    }
    uVar22 = FUN_140137690();
    in_stack_fffffffffffffa58 = (undefined4 *)((ulonglong)uVar34 << 0x20);
    uVar31 = CONCAT44(uVar33,uVar18);
    FUN_140136f10(uVar22,local_4e0,local_4cc,local_4c8,local_4bc,uVar31,in_stack_fffffffffffffa58);
    uVar33 = (undefined4)((ulonglong)uVar31 >> 0x20);
  }
LAB_140271b2e:
  uVar5 = local_4e2;
  uVar4 = local_4e4;
  lVar26 = (longlong)(short)local_4e2;
  lVar10 = (longlong)(short)local_4e4;
  lVar12 = *plVar11;
  lVar25 = lVar12 + 0xf630;
  local_448 = lVar25;
  FUN_14034ed40(lVar25);
  uVar18 = local_4e0;
  local_440 = 1;
  if (((uint)(int)(short)uVar4 < 5) && (uVar5 < 0x18)) {
    lVar14 = FUN_140137690();
    if (uVar18 == 0) {
      uVar21 = 0;
    }
    else {
      if (*(longlong *)(lVar14 + 0x88) != 0) {
        for (puVar17 = *(uint **)(*(longlong *)(lVar14 + 0x88) +
                                 ((ulonglong)uVar18 % (ulonglong)*(uint *)(lVar14 + 0x98)) * 8);
            puVar17 != (uint *)0x0; puVar17 = *(uint **)(puVar17 + 0xa6)) {
          if ((puVar17[0xa8] == uVar18) && (*puVar17 == uVar18)) {
            if (puVar17 != (uint *)0x0) {
              if (puVar17 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar21 = puVar17[0x39];
              goto LAB_140271bf2;
            }
            break;
          }
        }
      }
      if (uVar18 != 1) {
        FUN_1400050f0(L"GetInventoryType Miss : %d",uVar18);
      }
    }
LAB_140271bf2:
    if ((int)(short)uVar4 == uVar21) {
      plVar9 = (longlong *)((lVar26 + lVar10 * 0x18) * 0xac + lVar12);
      if ((*plVar9 == 0) && (plVar9[1] == 0)) {
        bVar28 = false;
      }
      else {
        bVar28 = true;
      }
      if (((!bVar28) && ((int)plVar9[3] == 0)) && (*(short *)((longlong)plVar9 + 0x1c) < 1)) {
        local_4e4 = uVar4;
        local_4e2 = uVar5;
        FUN_140090020(plVar9,&local_4f8);
      }
    }
  }
  FUN_14034edd0(lVar25);
  local_538 = *(undefined4 *)(param_1 + 0x160);
  local_534 = *(undefined4 *)(param_1 + 0x164);
  local_530 = *(undefined4 *)(param_1 + 0x168);
  local_52c = *(undefined4 *)(param_1 + 0x16c);
  local_528 = *(undefined4 *)(param_1 + 0x170);
  local_524 = *(undefined4 *)(param_1 + 0x174);
  local_520 = *(undefined4 *)(param_1 + 0x178);
  local_51c = *(undefined4 *)(param_1 + 0x17c);
  iVar7 = *(int *)(param_1 + 0x284);
  local_res20 = (longlong *)CONCAT44(local_res20._4_4_,*(undefined4 *)(param_1 + 8));
  if ((-1 < iVar7) && (iVar7 < *(short *)(*(longlong *)(param_1 + 0xb50) + 700))) {
    if ((CONCAT44(local_4f8._4_4_,(undefined4)local_4f8) == 0) &&
       (CONCAT44(uStack_4ec,uStack_4f0) == 0)) {
      bVar28 = false;
    }
    else {
      bVar28 = true;
    }
    if (((bVar28) && (local_4e0 != 0)) &&
       (lVar25 = *(longlong *)(*(longlong *)(param_1 + 0xb50) + 0x4c0), lVar25 != 0)) {
      local_res10[0] = CONCAT22(local_res10[0]._2_2_,(short)iVar7);
      plVar9 = (longlong *)
               (*(longlong *)(*(longlong *)(lVar25 + 8) + (longlong)*(int *)(param_1 + 0x288) * 8) +
               0x70);
      puVar13 = (undefined4 *)&local_4f8;
      uVar35 = 1;
      in_stack_fffffffffffffa58 = &local_538;
      puVar32 = &local_528;
      (**(code **)(*plVar9 + 0xb0))
                (plVar9,1,&DAT_1405d85a0,local_res10,&local_res20,puVar32,in_stack_fffffffffffffa58,
                 &DAT_14047b970,puVar13);
      uVar33 = (undefined4)((ulonglong)puVar32 >> 0x20);
      uVar36 = (undefined4)((ulonglong)puVar13 >> 0x20);
    }
  }
  in_stack_fffffffffffffa68 = CONCAT44(uVar36,(int)local_4dc);
  in_stack_fffffffffffffa60 = CONCAT44(uVar35,local_4dc + -1);
  in_stack_fffffffffffffa58 =
       (undefined4 *)((ulonglong)in_stack_fffffffffffffa58 & 0xffffffff00000000);
  FUN_140203700(*(undefined8 *)(param_1 + 0xb50),0x1a1,0x2a,param_1,&local_4f8,CONCAT44(uVar33,1),
                in_stack_fffffffffffffa58,in_stack_fffffffffffffa60,in_stack_fffffffffffffa68);
  plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  in_stack_fffffffffffffa50 = &local_4f8;
  in_stack_fffffffffffffa48 = &local_4e2;
  (**(code **)(*plVar9 + 0xc0))
            (plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_4e4,in_stack_fffffffffffffa48
             ,in_stack_fffffffffffffa50);
  plVar9 = (longlong *)(*(longlong *)(param_1 + 0xb50) + 0x78);
  (**(code **)(*plVar9 + 0xb50))(plVar9,*(undefined4 *)(param_1 + 8),&DAT_1405d85a0,&local_4f8);
LAB_140271e8f:
  psVar16 = local_3d4;
  puVar23 = local_3d0;
  lVar25 = 5;
  do {
    local_540 = CONCAT44(local_540._4_4_,1);
    if ((*(longlong *)(puVar23 + -0xc) != 0) || (bVar28 = false, *(longlong *)(puVar23 + -8) != 0))
    {
      bVar28 = true;
    }
    if (bVar28) {
      local_548 = CONCAT44(local_548._4_4_,(int)psVar16[1]);
      local_588 = CONCAT44(local_588._4_4_,(int)*psVar16);
      if (-1 < *psVar16) {
        in_stack_fffffffffffffa60 =
             CONCAT44((int)((ulonglong)in_stack_fffffffffffffa60 >> 0x20),0x2b);
        in_stack_fffffffffffffa58 =
             (undefined4 *)CONCAT44((int)((ulonglong)in_stack_fffffffffffffa58 >> 0x20),0x1a2);
        in_stack_fffffffffffffa50 = &local_540;
        in_stack_fffffffffffffa48 = puVar23;
        FUN_1401f1280(*plVar11,param_1,&local_588,&local_548,puVar23,in_stack_fffffffffffffa50,
                      in_stack_fffffffffffffa58,in_stack_fffffffffffffa60);
      }
    }
    iVar7 = local_560;
    uVar33 = (undefined4)((ulonglong)in_stack_fffffffffffffa48 >> 0x20);
    uVar35 = (undefined4)((ulonglong)in_stack_fffffffffffffa58 >> 0x20);
    uVar36 = (undefined4)((ulonglong)in_stack_fffffffffffffa60 >> 0x20);
    uVar37 = (undefined4)((ulonglong)in_stack_fffffffffffffa68 >> 0x20);
    puVar23 = puVar23 + 0x56;
    psVar16 = psVar16 + 0x56;
    lVar25 = lVar25 + -1;
  } while (lVar25 != 0);
  FUN_140197b90(param_1,-local_560);
  FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,0,0x196,CONCAT44(uVar33,0x3d),
                (ulonglong)in_stack_fffffffffffffa50 & 0xffffffff00000000,
                CONCAT44(uVar35,iVar7 + *(int *)(*plVar11 + 0x50a0)),
                CONCAT44(uVar36,*(int *)(*plVar11 + 0x50a0)),CONCAT44(uVar37,iVar7),0);
  uVar22 = 0x53;
  goto LAB_140271f91;
}



// WARNING: Removing unreachable block (ram,0x0001402725ee)

undefined8 FUN_140272090(longlong param_1,uint param_2,int param_3,int param_4)

{
  void *pvVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  longlong *plVar9;
  uint *puVar10;
  short sVar11;
  longlong lVar12;
  longlong *plVar13;
  longlong *plVar14;
  bool bVar15;
  undefined8 in_stack_fffffffffffffe98;
  undefined1 *puVar16;
  int local_138;
  longlong *local_128;
  longlong *local_120;
  void *local_118;
  longlong *local_110;
  longlong *local_108;
  undefined4 local_f8;
  undefined4 uStack_f4;
  undefined4 uStack_f0;
  undefined4 uStack_ec;
  short local_e4;
  uint local_e0;
  undefined2 local_dc;
  uint local_d4;
  undefined1 local_cc [4];
  undefined1 local_c8 [12];
  undefined1 local_bc [12];
  undefined1 local_b0 [28];
  undefined1 local_94 [4];
  uint local_90;
  undefined2 local_8c;
  undefined2 local_62;
  undefined4 local_50;
  undefined8 local_48;
  undefined1 local_40 [24];
  undefined4 uVar17;
  
  local_48 = 0xfffffffffffffffe;
  if (param_1 != 0) {
    FUN_140197b70(param_1,&local_128);
    plVar14 = local_128;
    if (local_128 != (longlong *)0x0) {
      if (local_128 == local_120) {
        if (*local_128 != 0) {
          lVar12 = 0;
          local_110 = (longlong *)0x0;
          local_118 = operator_new(0x850);
          lVar6 = lVar12;
          if (local_118 != (void *)0x0) {
            lVar6 = FUN_1401e64f0(local_118);
          }
          if (lVar6 == 0) {
            local_110 = (longlong *)0x0;
          }
          else {
            local_110 = operator_new(0x10);
            *local_110 = lVar6;
            *(undefined4 *)(local_110 + 1) = 1;
          }
          plVar13 = local_110;
          local_108 = local_110;
          if (*(longlong **)(param_1 + 0x6d0) != local_110) {
            FUN_1401dede0(param_1 + 0x6d0);
            *(longlong **)(param_1 + 0x6d0) = plVar13;
            *(longlong **)(param_1 + 0x6d8) = plVar13;
            if (plVar13 != (longlong *)0x0) {
              LOCK();
              *(int *)(plVar13 + 1) = (int)plVar13[1] + 1;
              UNLOCK();
              plVar13 = local_110;
              plVar14 = local_128;
            }
          }
          uVar7 = FUN_140137690();
          iVar4 = FUN_140136b30(uVar7,param_2);
          uVar7 = FUN_140137690();
          iVar5 = FUN_140136a70(uVar7,param_2);
          iVar3 = param_3 / iVar5;
          if (iVar3 == 0) {
            iVar3 = 1;
          }
          if (iVar4 == 1) {
            iVar3 = param_4;
          }
          local_118 = (void *)CONCAT44(local_118._4_4_,iVar3);
          local_138 = 0;
          if (0 < iVar3) {
            do {
              uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffe98 >> 0x20);
              FUN_14000a170(&local_f8);
              local_50 = 0;
              puVar8 = (undefined4 *)FUN_140357570(local_40);
              local_f8 = *puVar8;
              uStack_f4 = puVar8[1];
              uStack_f0 = puVar8[2];
              uStack_ec = puVar8[3];
              local_e4 = (short)iVar4;
              local_e0 = param_2;
              lVar6 = FUN_140137690();
              if (*(longlong *)(lVar6 + 0x88) != 0) {
                for (puVar10 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                                         ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar6 + 0x98)) *
                                         8); puVar10 != (uint *)0x0;
                    puVar10 = *(uint **)(puVar10 + 0xa6)) {
                  if ((puVar10[0xa8] == param_2) && (*puVar10 == param_2)) {
                    if (puVar10 != (uint *)0x0) {
                      if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                        FUN_14000d450(0x80004005);
                      }
                      local_8c = (undefined2)puVar10[0x3d];
                      goto LAB_1402722a0;
                    }
                    break;
                  }
                }
              }
              local_8c = 1;
LAB_1402722a0:
              local_62 = 4;
              local_dc = (undefined2)param_3;
              if (iVar5 < param_3) {
                local_dc = (undefined2)iVar5;
              }
              param_3 = param_3 + -1;
              if (iVar4 == 1) {
                lVar6 = FUN_140137690();
                if (*(longlong *)(lVar6 + 0x88) != 0) {
                  for (puVar10 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                                           ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar6 + 0x98))
                                           * 8); puVar10 != (uint *)0x0;
                      puVar10 = *(uint **)(puVar10 + 0xa6)) {
                    if ((puVar10[0xa8] == param_2) && (*puVar10 == param_2)) {
                      if (puVar10 != (uint *)0x0) {
                        if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        local_d4 = puVar10[0x52];
                        goto LAB_14027233a;
                      }
                      break;
                    }
                  }
                }
                local_d4 = 1;
LAB_14027233a:
                local_dc = 1;
              }
              lVar6 = FUN_140137690();
              if (*(longlong *)(lVar6 + 0x88) != 0) {
                for (puVar10 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                                         ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar6 + 0x98)) *
                                         8); puVar10 != (uint *)0x0;
                    puVar10 = *(uint **)(puVar10 + 0xa6)) {
                  if ((puVar10[0xa8] == param_2) && (*puVar10 == param_2)) {
                    if (puVar10 != (uint *)0x0) {
                      if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                        FUN_14000d450(0x80004005);
                      }
                      local_90 = puVar10[0x5b];
                      goto LAB_1402723ad;
                    }
                    break;
                  }
                }
              }
              local_90 = 1;
LAB_1402723ad:
              FUN_1401a40e0(&local_f8);
              sVar11 = local_e4;
              if ((local_e4 == 1) || (local_e4 == 5)) {
                lVar6 = FUN_140137690();
                uVar2 = local_e0;
                if (*(longlong *)(lVar6 + 0x88) != 0) {
                  for (puVar10 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                                           ((ulonglong)local_e0 % (ulonglong)*(uint *)(lVar6 + 0x98)
                                           ) * 8); puVar10 != (uint *)0x0;
                      puVar10 = *(uint **)(puVar10 + 0xa6)) {
                    if ((puVar10[0xa8] == local_e0) && (*puVar10 == local_e0)) {
                      if (puVar10 != (uint *)0x0) {
                        if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        if (puVar10[0x5c] != 0) goto LAB_140272452;
                      }
                      break;
                    }
                  }
                }
                uVar7 = FUN_140137690();
                FUN_1401371c0(uVar7,uVar2,local_b0,local_94);
                sVar11 = local_e4;
              }
LAB_140272452:
              uVar2 = local_e0;
              if (((sVar11 == 1) || (sVar11 == 2)) || (sVar11 == 5)) {
                lVar6 = FUN_140137690();
                if (*(longlong *)(lVar6 + 0x88) != 0) {
                  for (puVar10 = *(uint **)(*(longlong *)(lVar6 + 0x88) +
                                           ((ulonglong)uVar2 % (ulonglong)*(uint *)(lVar6 + 0x98)) *
                                           8); puVar10 != (uint *)0x0;
                      puVar10 = *(uint **)(puVar10 + 0xa6)) {
                    if ((puVar10[0xa8] == uVar2) && (*puVar10 == uVar2)) {
                      if (puVar10 != (uint *)0x0) {
                        if (puVar10 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                          FUN_14000d450(0x80004005);
                        }
                        if ((puVar10[0x46] != 0) && (puVar10[0x46] != 0x17)) goto LAB_140272500;
                      }
                      break;
                    }
                  }
                }
                uVar7 = FUN_140137690();
                puVar16 = local_bc;
                FUN_140136f10(uVar7,uVar2,local_cc,local_c8,puVar16,1,0);
                uVar17 = (undefined4)((ulonglong)puVar16 >> 0x20);
              }
LAB_140272500:
              lVar6 = lVar12;
              if (plVar13 != (longlong *)0x0) {
                lVar6 = *plVar13;
              }
              uVar7 = CONCAT44(uVar17,0x29);
              FUN_1401e6560(lVar6,&local_f8,param_1,0x1a1,uVar7);
              uVar17 = (undefined4)((ulonglong)uVar7 >> 0x20);
              plVar9 = (longlong *)FUN_140140140();
              if (*plVar9 != 0) {
                for (puVar10 = *(uint **)(*plVar9 +
                                         ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar9 + 2)) * 8
                                         );
                    (puVar10 != (uint *)0x0 && ((puVar10[0x32] != param_2 || (*puVar10 != param_2)))
                    ); puVar10 = *(uint **)(puVar10 + 0x30)) {
                }
              }
              in_stack_fffffffffffffe98 = CONCAT44(uVar17,0x28);
              FUN_1402024f0(*(undefined8 *)(param_1 + 0xb50),param_1,&local_f8,0x191,
                            in_stack_fffffffffffffe98,0,*(undefined4 *)(*plVar14 + 0x50a0),
                            *(undefined4 *)(*plVar14 + 0x50a0),0,0);
              local_138 = local_138 + 1;
            } while (local_138 < (int)local_118);
          }
          if (plVar13 != (longlong *)0x0) {
            lVar12 = *plVar13;
          }
          FUN_1401e6700(lVar12,2,param_1);
          plVar9 = local_110;
          if (plVar13 != (longlong *)0x0) {
            LOCK();
            plVar13 = plVar13 + 1;
            lVar12 = *plVar13;
            *(int *)plVar13 = (int)*plVar13 + -1;
            UNLOCK();
            plVar14 = local_128;
            if ((int)lVar12 == 1) {
              pvVar1 = (void *)*local_110;
              if (pvVar1 != (void *)0x0) {
                FUN_14034edf0((longlong)pvVar1 + 0x818);
                operator_delete(pvVar1);
              }
              operator_delete(plVar9);
              plVar14 = local_128;
            }
          }
          LOCK();
          plVar14 = plVar14 + 1;
          *(int *)plVar14 = (int)*plVar14 + -1;
          UNLOCK();
          if ((int)*plVar14 == 0) {
            pvVar1 = (void *)*local_128;
            if (pvVar1 != (void *)0x0) {
              FUN_14034edf0((longlong)pvVar1 + 0xf630);
              operator_delete(pvVar1);
            }
            operator_delete(local_128);
          }
          return 1;
        }
      }
      else {
        iVar3 = DAT_140608048 + 1;
        bVar15 = DAT_140608048 == 0;
        DAT_140608048 = iVar3;
        if (bVar15) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar14 != (longlong *)0x0) {
      if (plVar14 == local_120) {
        LOCK();
        plVar14 = plVar14 + 1;
        *(int *)plVar14 = (int)*plVar14 + -1;
        UNLOCK();
        if ((int)*plVar14 == 0) {
          pvVar1 = (void *)*local_128;
          if (pvVar1 != (void *)0x0) {
            FUN_14034edf0((longlong)pvVar1 + 0xf630);
            operator_delete(pvVar1);
          }
          operator_delete(local_128);
        }
      }
      else {
        iVar3 = DAT_140608050 + 1;
        bVar15 = DAT_140608050 == 0;
        DAT_140608050 = iVar3;
        if (bVar15) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return 0;
}



void FUN_140272720(undefined1 *param_1,short *param_2)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  *param_1 = 1;
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 8,param_2,~uVar2 - 1);
  *(double *)(param_1 + 0x30) = *(double *)(param_1 + 0x38) + 20.0;
  return;
}



void FUN_140272770(undefined1 *param_1)

{
  *param_1 = 0;
  FUN_140001710(param_1 + 8,&DAT_140477960,0);
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  return;
}



void FUN_1402727a0(undefined1 *param_1)

{
  *param_1 = 0;
  FUN_140001710(param_1 + 0x18,&DAT_140477960,0);
  *(undefined8 *)(param_1 + 8) = 0;
  return;
}



void FUN_1402727d0(longlong param_1,char *param_2,undefined4 param_3,undefined8 param_4)

{
  char cVar1;
  longlong *plVar2;
  int iVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  char *pcVar7;
  bool bVar8;
  bool bVar9;
  undefined8 uVar10;
  longlong lVar11;
  undefined1 uVar12;
  undefined1 local_40;
  undefined7 uStack_3f;
  undefined8 local_30;
  ulonglong local_28;
  
  uVar10 = 0xfffffffffffffffe;
  lVar5 = 0;
  lVar11 = 0;
  bVar9 = false;
  uVar12 = 0;
  plVar2 = *(longlong **)(param_1 + 0x58);
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x60)) {
      lVar6 = *plVar2;
      lVar5 = 0;
      if (lVar6 != 0) {
        if (plVar2 != *(longlong **)(param_1 + 0x60)) {
          iVar3 = DAT_1406080a8 + 1;
          bVar9 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar3;
          if (bVar9) {
            FUN_140176d60(1);
          }
          lVar6 = 0;
        }
        lVar11 = lVar6;
        FUN_14034ed40();
        bVar9 = true;
        uVar12 = 1;
        lVar5 = lVar6;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar8) {
        FUN_140176d60();
      }
    }
  }
  local_28 = 0xf;
  local_30 = 0;
  local_40 = 0;
  uVar4 = 0xffffffffffffffff;
  pcVar7 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar1 != '\0');
  FUN_140003e50(&local_40,param_2,~uVar4 - 1,param_4,uVar10,lVar11,uVar12);
  lVar11 = FUN_1402475e0(param_1,&local_40);
  *(undefined4 *)(lVar11 + 0x28) = param_3;
  if (0xf < local_28) {
    operator_delete((void *)CONCAT71(uStack_3f,local_40));
  }
  if (bVar9) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_140272910(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x58);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x60)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x60)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + param_2;
  *(int *)(param_1 + 0x44) = *(int *)(param_1 + 0x44) + 1;
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_1402729e0(longlong param_1,undefined4 param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x58);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x60)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x60)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  *(undefined4 *)(param_1 + 0x48) = param_2;
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_140272aa0(undefined8 param_1,undefined4 param_2,undefined4 param_3)

{
  longlong lVar1;
  undefined4 local_res10 [2];
  
  local_res10[0] = param_2;
  FUN_14034ed40(&DAT_140607f30);
  lVar1 = FUN_140272b10(param_1,local_res10);
  *(undefined4 *)(lVar1 + 4) = param_3;
  FUN_14034edd0(&DAT_140607f30);
  return;
}



int * FUN_140272b10(longlong *param_1,int *param_2)

{
  char **ppcVar1;
  int iVar2;
  char cVar3;
  undefined8 *puVar4;
  char *pcVar5;
  undefined8 *puVar6;
  int *piVar7;
  char **ppcVar8;
  char *local_res8;
  undefined8 local_res10;
  undefined **local_58 [4];
  
  local_res8 = (char *)(longlong)*param_2;
  ppcVar1 = (char **)(param_1 + 1);
  puVar4 = (undefined8 *)(*param_1 + ((ulonglong)local_res8 % (ulonglong)*ppcVar1) * 8);
  if (*param_1 == 0) {
    puVar4 = operator_new(0x10);
    if (puVar4 == (undefined8 *)0x0) {
      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_1405d3608);
    }
    *puVar4 = 0;
    puVar4[1] = puVar4;
    piVar7 = (int *)(puVar4 + 1);
    if (piVar7 != (int *)0x0) {
      *piVar7 = *param_2;
      *(undefined4 *)((longlong)puVar4 + 0xc) = 0;
    }
    iVar2 = *piVar7;
    if (*param_1 == 0) {
      local_res8 = (char *)FUN_1402c9710(param_1);
      ppcVar8 = &local_res8;
      if (local_res8 <= *ppcVar1) {
        ppcVar8 = ppcVar1;
      }
      *ppcVar1 = *ppcVar8;
      FUN_140346140(param_1);
      FUN_140296160(param_1);
    }
    else {
      local_res10 = 1;
      if ((ulonglong)param_1[7] < 2) {
        local_res8 = (char *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
        pcVar5 = (char *)FUN_1402c9710(param_1);
        if (pcVar5 != *ppcVar1) {
          FUN_14027dcb0(param_1);
        }
      }
    }
    puVar6 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar2 % (ulonglong)*ppcVar1) * 8);
    *puVar4 = *puVar6;
    *puVar6 = puVar4;
    param_1[4] = param_1[4] + 1;
    param_1[6] = (longlong)puVar6;
  }
  else {
    for (puVar6 = (undefined8 *)*puVar4; puVar6 != (undefined8 *)0x0; puVar6 = (undefined8 *)*puVar6
        ) {
      if (*param_2 == *(int *)(puVar6 + 1)) {
        if (puVar6 != (undefined8 *)0x0) {
          return (int *)(puVar6 + 1);
        }
        break;
      }
    }
    puVar6 = operator_new(0x10);
    if (puVar6 == (undefined8 *)0x0) {
      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_1405d3608);
    }
    *puVar6 = 0;
    puVar6[1] = puVar6;
    piVar7 = (int *)(puVar6 + 1);
    if (piVar7 != (int *)0x0) {
      *piVar7 = *param_2;
      *(undefined4 *)((longlong)puVar6 + 0xc) = 0;
    }
    cVar3 = FUN_14027dc40(param_1);
    if (cVar3 != '\0') {
      puVar4 = (undefined8 *)(*param_1 + ((ulonglong)local_res8 % (ulonglong)*ppcVar1) * 8);
    }
    *puVar6 = *puVar4;
    *puVar4 = puVar6;
    param_1[4] = param_1[4] + 1;
    puVar6 = (undefined8 *)param_1[6];
    if (puVar4 < (undefined8 *)param_1[6]) {
      puVar6 = puVar4;
    }
    param_1[6] = (longlong)puVar6;
  }
  return piVar7;
}



// WARNING: Removing unreachable block (ram,0x000140272e67)

void FUN_140272d90(longlong param_1,undefined4 param_2)

{
  undefined4 uVar1;
  ulonglong *puVar2;
  undefined8 *puVar3;
  uint uVar4;
  int iVar5;
  longlong *plVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  bool bVar10;
  longlong *local_a8;
  longlong *local_a0;
  undefined8 local_98;
  undefined1 local_88 [8];
  undefined2 local_80;
  undefined8 local_70;
  undefined8 local_68;
  undefined8 local_34;
  undefined8 local_2c;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  ulonglong uVar6;
  
  local_98 = 0xfffffffffffffffe;
  *(int *)(param_1 + 0x178) = *(int *)(param_1 + 0x178) + 1;
  uVar1 = *(undefined4 *)(param_1 + 0x178);
  uVar8 = 0;
  uVar9 = uVar8;
  if ((*(longlong *)(param_1 + 0xe8) != 0) && (*(uint *)(param_1 + 0xf0) != 0)) {
    uVar6 = uVar8;
    plVar7 = *(longlong **)(param_1 + 0xe0);
    do {
      if (*plVar7 != 0) {
        uVar9 = (*(longlong **)(param_1 + 0xe0))[uVar6];
        break;
      }
      uVar4 = (int)uVar6 + 1;
      uVar6 = (ulonglong)uVar4;
      plVar7 = plVar7 + 1;
    } while (uVar4 < *(uint *)(param_1 + 0xf0));
  }
  if (uVar9 != 0) {
    local_68 = 7;
    local_70 = 0;
    local_80 = 0;
    local_34 = 0;
    local_2c = 0;
    local_24 = 0;
    local_20 = 0;
    local_1c = 0;
    local_18 = 0;
    plVar7 = (longlong *)FUN_140198570(*(undefined8 *)(uVar9 + 8),&local_a8);
    puVar2 = (ulonglong *)*plVar7;
    if (puVar2 != (ulonglong *)0x0) {
      if (puVar2 == (ulonglong *)plVar7[1]) {
        uVar8 = *puVar2;
      }
      else {
        iVar5 = DAT_14060804c + 1;
        bVar10 = DAT_14060804c == 0;
        DAT_14060804c = iVar5;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
    FUN_140194280(param_1,local_88,0xffffffff,0,L"respawn01",uVar1,uVar8 + 0x178,param_2,0,0,0);
    plVar7 = local_a8;
    if (local_a8 != (longlong *)0x0) {
      if (local_a8 == local_a0) {
        if (local_a8 != (longlong *)0x0) {
          LOCK();
          local_a8 = local_a8 + 1;
          *(int *)local_a8 = (int)*local_a8 + -1;
          UNLOCK();
          if ((int)*local_a8 == 0) {
            local_a8 = (longlong *)0x0;
            puVar3 = (undefined8 *)*plVar7;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(plVar7);
          }
        }
      }
      else {
        iVar5 = DAT_140608054 + 1;
        bVar10 = DAT_140608054 == 0;
        DAT_140608054 = iVar5;
        if (bVar10) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140273055)

void FUN_140272f70(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5)

{
  longlong *plVar1;
  undefined4 uVar2;
  ulonglong *puVar3;
  undefined8 *puVar4;
  uint uVar5;
  int iVar6;
  longlong *plVar8;
  ulonglong uVar9;
  longlong *plVar10;
  ulonglong uVar11;
  bool bVar12;
  longlong *local_b8;
  longlong *local_b0;
  undefined8 local_a8;
  undefined1 local_98 [8];
  undefined2 local_90;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_44;
  undefined8 local_3c;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  ulonglong uVar7;
  
  local_a8 = 0xfffffffffffffffe;
  *(int *)(param_1 + 0x178) = *(int *)(param_1 + 0x178) + 1;
  uVar2 = *(undefined4 *)(param_1 + 0x178);
  uVar9 = 0;
  uVar11 = uVar9;
  if ((*(longlong *)(param_1 + 0xe8) != 0) && (*(uint *)(param_1 + 0xf0) != 0)) {
    uVar7 = uVar9;
    plVar8 = *(longlong **)(param_1 + 0xe0);
    do {
      if (*plVar8 != 0) {
        uVar11 = (*(longlong **)(param_1 + 0xe0))[uVar7];
        break;
      }
      uVar5 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar5;
      plVar8 = plVar8 + 1;
    } while (uVar5 < *(uint *)(param_1 + 0xf0));
  }
  if (uVar11 != 0) {
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    local_44 = 0;
    local_3c = 0;
    local_34 = 0;
    local_30 = 0;
    local_2c = 0;
    local_28 = 0;
    plVar8 = (longlong *)FUN_140198570(*(undefined8 *)(uVar11 + 8),&local_b8);
    puVar3 = (ulonglong *)*plVar8;
    if (puVar3 != (ulonglong *)0x0) {
      if (puVar3 == (ulonglong *)plVar8[1]) {
        uVar9 = *puVar3;
      }
      else {
        iVar6 = DAT_14060804c + 1;
        bVar12 = DAT_14060804c == 0;
        DAT_14060804c = iVar6;
        if (bVar12) {
          FUN_140176d60(1);
        }
      }
    }
    plVar10 = (longlong *)
              FUN_140194280(param_1,local_98,0xffffffff,0,L"respawn01",uVar2,uVar9 + 0x178,param_2,0
                            ,0,0);
    plVar8 = local_b8;
    if (local_b8 != (longlong *)0x0) {
      if (local_b8 == local_b0) {
        if (local_b8 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_b8 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_b8 = (longlong *)0x0;
            puVar4 = (undefined8 *)*plVar8;
            if (puVar4 != (undefined8 *)0x0) {
              (**(code **)*puVar4)(puVar4,1);
            }
            operator_delete(plVar8);
          }
        }
      }
      else {
        iVar6 = DAT_140608054 + 1;
        bVar12 = DAT_140608054 == 0;
        DAT_140608054 = iVar6;
        if (bVar12) {
          FUN_140176d60(1);
        }
      }
    }
    if (plVar10 != (longlong *)0x0) {
      (**(code **)(*plVar10 + 0x228))(plVar10,param_3);
      (**(code **)(*plVar10 + 0x230))(plVar10,param_4);
      (**(code **)(*plVar10 + 0x238))(plVar10,param_5);
      (**(code **)(*plVar10 + 0x240))(plVar10,param_3);
      (**(code **)(*plVar10 + 0x248))(plVar10,param_4);
      (**(code **)(*plVar10 + 0x250))(plVar10,param_5);
    }
  }
  return;
}



void FUN_1402731e0(int *param_1)

{
  DWORD DVar1;
  int *piVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  DVar1 = timeGetTime();
  if (*(ulonglong *)(param_1 + 8) < 8) {
    piVar2 = param_1 + 2;
  }
  else {
    piVar2 = *(int **)(param_1 + 2);
  }
  FUN_140418da0(DAT_140607fd8,L"%s Check TIME %d ms",piVar2,DVar1 - *param_1,uVar3);
  if (7 < *(ulonglong *)(param_1 + 8)) {
    operator_delete(*(void **)(param_1 + 2));
  }
  param_1[8] = 7;
  param_1[9] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  return;
}



void FUN_140273260(undefined8 *param_1)

{
  FUN_140176fd0();
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



void FUN_140273290(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  FUN_14034ed40(param_1 + 0x4e);
  lVar2 = 0x46;
  plVar1 = param_1;
  do {
    plVar1 = plVar1 + 1;
    if (*plVar1 != 0) {
      FUN_140273340();
    }
    *plVar1 = 0;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_14034edd0(param_1 + 0x4e);
  FUN_14034edf0(param_1 + 0x4e);
  FUN_140176fd0(param_1 + 0x48);
  operator_delete((void *)param_1[0x48]);
  param_1[0x48] = 0;
  return;
}



void * FUN_140273340(void *param_1)

{
  if (7 < *(ulonglong *)((longlong)param_1 + 0x60)) {
    operator_delete(*(void **)((longlong)param_1 + 0x48));
  }
  *(undefined8 *)((longlong)param_1 + 0x60) = 7;
  *(undefined8 *)((longlong)param_1 + 0x58) = 0;
  *(undefined2 *)((longlong)param_1 + 0x48) = 0;
  if (7 < *(ulonglong *)((longlong)param_1 + 0x38)) {
    operator_delete(*(void **)((longlong)param_1 + 0x20));
  }
  *(undefined8 *)((longlong)param_1 + 0x38) = 7;
  *(undefined8 *)((longlong)param_1 + 0x30) = 0;
  *(undefined2 *)((longlong)param_1 + 0x20) = 0;
  operator_delete(param_1);
  return param_1;
}



void FUN_1402733b0(longlong *param_1,undefined8 param_2,ulonglong *param_3,undefined8 param_4)

{
  longlong *plVar1;
  ulonglong *puVar2;
  longlong lVar3;
  DWORD DVar4;
  int iVar5;
  DWORD DVar6;
  ulonglong uVar7;
  uint uVar8;
  undefined2 *puVar9;
  longlong *plVar10;
  bool bVar11;
  undefined8 uVar12;
  longlong *plVar13;
  undefined1 uVar14;
  undefined2 local_38;
  undefined6 uStack_36;
  undefined8 local_28;
  ulonglong local_20;
  
  uVar12 = 0xfffffffffffffffe;
  local_20 = 7;
  uVar7 = 0;
  local_28 = 0;
  local_38 = 0;
  FUN_140001710(&local_38,L"LoadMailItem",0xc,param_4,0xfffffffffffffffe);
  DVar4 = timeGetTime();
  plVar1 = param_1 + 0x4e;
  plVar13 = plVar1;
  FUN_14034ed40(plVar1);
  uVar14 = 1;
  plVar10 = param_1;
  do {
    plVar10 = plVar10 + 1;
    puVar2 = (ulonglong *)*plVar10;
    if (puVar2 != (ulonglong *)0x0) {
      bVar11 = *puVar2 < *param_3;
      if ((*puVar2 != *param_3) ||
         (bVar11 = puVar2[1] < param_3[1], iVar5 = 0, puVar2[1] != param_3[1])) {
        iVar5 = (1 - (uint)bVar11) - (uint)(bVar11 != 0);
      }
      if (((iVar5 == 0) && (-1 < *(short *)((longlong)param_3 + 0x22))) &&
         (*(short *)((longlong)param_3 + 0x22) < 3)) {
        FUN_1402752a0((longlong)*(short *)((longlong)param_3 + 0x22) * 0xb8 + 0x90 +
                      param_1[uVar7 + 1],param_3);
        lVar3 = param_1[uVar7 + 1];
        if ((*(int *)(lVar3 + 0x80) == 5) && (*(int *)(lVar3 + 0x74) < *(int *)(lVar3 + 0x2b8))) {
          FUN_1402743e0(param_1,param_2);
        }
        FUN_14034edd0(plVar1);
        DVar6 = timeGetTime();
        puVar9 = &local_38;
        if (7 < local_20) {
          puVar9 = (undefined2 *)CONCAT62(uStack_36,local_38);
        }
        FUN_140418da0(DAT_140607fd8,L"%s Check TIME %d ms",puVar9,DVar6 - DVar4);
        goto LAB_14027353d;
      }
    }
    uVar8 = (int)uVar7 + 1;
    uVar7 = (ulonglong)uVar8;
    if (0x45 < uVar8) {
      FUN_14034edd0(plVar1);
      DVar6 = timeGetTime();
      puVar9 = &local_38;
      if (7 < local_20) {
        puVar9 = (undefined2 *)CONCAT62(uStack_36,local_38);
      }
      FUN_140418da0(DAT_140607fd8,L"%s Check TIME %d ms",puVar9,DVar6 - DVar4,uVar12,plVar13,uVar14)
      ;
LAB_14027353d:
      if (7 < local_20) {
        operator_delete((void *)CONCAT62(uStack_36,local_38));
      }
      return;
    }
  } while( true );
}



undefined8 FUN_140273570(longlong *param_1,ulonglong *param_2)

{
  longlong *plVar1;
  ulonglong uVar2;
  int iVar3;
  ulonglong uVar4;
  longlong lVar5;
  ulonglong *puVar6;
  longlong *plVar7;
  int iVar8;
  bool bVar9;
  undefined8 uVar10;
  longlong *plVar11;
  
  uVar10 = 0xfffffffffffffffe;
  plVar1 = param_1 + 0x4e;
  plVar11 = plVar1;
  FUN_14034ed40(plVar1);
  iVar8 = 0;
  lVar5 = 0;
  plVar7 = param_1;
  do {
    plVar7 = plVar7 + 1;
    puVar6 = (ulonglong *)*plVar7;
    if (puVar6 != (ulonglong *)0x0) {
      bVar9 = *puVar6 < *param_2;
      if ((*puVar6 == *param_2) && (bVar9 = puVar6[1] < param_2[1], puVar6[1] == param_2[1])) {
        iVar3 = 0;
      }
      else {
        iVar3 = (1 - (uint)bVar9) - (uint)(bVar9 != 0);
      }
      if (iVar3 == 0) {
        lVar5 = param_1[(longlong)iVar8 + 1];
        *(ulonglong *)(lVar5 + 0x10) = param_2[2];
        *(ulonglong *)(lVar5 + 0x18) = param_2[3];
        uVar4 = 0xffffffffffffffff;
        puVar6 = param_2 + 4;
        break;
      }
    }
    iVar8 = iVar8 + 1;
    lVar5 = lVar5 + 1;
    if (0x45 < lVar5) {
      FUN_14034edd0(plVar1);
      return 0;
    }
  } while( true );
  while( true ) {
    uVar4 = uVar4 - 1;
    uVar2 = *puVar6;
    puVar6 = (ulonglong *)((longlong)puVar6 + 2);
    if ((short)uVar2 == 0) break;
    if (uVar4 == 0) break;
  }
  FUN_140001710(param_1[(longlong)iVar8 + 1] + 0x20,param_2 + 4,~uVar4 - 1,
                param_1[(longlong)iVar8 + 1],uVar10,plVar11,1);
  uVar4 = 0xffffffffffffffff;
  puVar6 = param_2 + 0xc;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    uVar2 = *puVar6;
    puVar6 = (ulonglong *)((longlong)puVar6 + 2);
  } while ((short)uVar2 != 0);
  FUN_140001710(param_1[(longlong)iVar8 + 1] + 0x48,param_2 + 0xc,~uVar4 - 1,
                param_1[(longlong)iVar8 + 1],uVar10,plVar11);
  *(undefined4 *)(param_1[(longlong)iVar8 + 1] + 0x70) = *(undefined4 *)((longlong)param_2 + 0x31c);
  *(int *)(param_1[(longlong)iVar8 + 1] + 0x74) = (int)(short)param_2[100];
  *(undefined4 *)(param_1[(longlong)iVar8 + 1] + 0x78) = *(undefined4 *)((longlong)param_2 + 0x322);
  *(int *)(param_1[(longlong)iVar8 + 1] + 0x7c) = (int)*(short *)((longlong)param_2 + 0x326);
  *(ulonglong *)(param_1[(longlong)iVar8 + 1] + 0x88) = param_2[0x65];
  *(int *)(param_1[(longlong)iVar8 + 1] + 0x80) = (int)(short)param_2[0x66];
  *(undefined4 *)(param_1[(longlong)iVar8 + 1] + 0x2b8) = *(undefined4 *)((longlong)param_2 + 0x332)
  ;
  FUN_14034edd0(plVar1);
  return 1;
}



void FUN_140273710(int *param_1,undefined8 *param_2)

{
  short sVar1;
  int iVar2;
  void *pvVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  short *psVar6;
  
  FUN_14034ed40(param_1 + 0x9c);
  if (param_1[0xab] != 0) {
    FUN_140274f60(param_1 + 0x90,param_2);
  }
  iVar2 = FUN_140273570(param_1,param_2);
  if (iVar2 == 0) {
    pvVar3 = operator_new(0x2c0);
    if (pvVar3 == (void *)0x0) {
      puVar4 = (undefined8 *)0x0;
    }
    else {
      puVar4 = (undefined8 *)FUN_1402738a0();
    }
    *puVar4 = *param_2;
    puVar4[1] = param_2[1];
    puVar4[2] = param_2[2];
    puVar4[3] = param_2[3];
    uVar5 = 0xffffffffffffffff;
    psVar6 = (short *)(param_2 + 4);
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    FUN_140001710(puVar4 + 4,param_2 + 4,~uVar5 - 1);
    uVar5 = 0xffffffffffffffff;
    psVar6 = (short *)(param_2 + 0xc);
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    FUN_140001710(puVar4 + 9,param_2 + 0xc,~uVar5 - 1);
    *(undefined4 *)(puVar4 + 0xe) = *(undefined4 *)((longlong)param_2 + 0x31c);
    *(int *)((longlong)puVar4 + 0x74) = (int)*(short *)(param_2 + 100);
    *(undefined4 *)(puVar4 + 0xf) = *(undefined4 *)((longlong)param_2 + 0x322);
    *(int *)((longlong)puVar4 + 0x7c) = (int)*(short *)((longlong)param_2 + 0x326);
    puVar4[0x11] = param_2[0x65];
    *(int *)(puVar4 + 0x10) = (int)*(short *)(param_2 + 0x66);
    *(undefined4 *)(puVar4 + 0x57) = *(undefined4 *)((longlong)param_2 + 0x332);
    *(undefined1 *)((longlong)puVar4 + 700) = 0;
    *param_1 = *param_1 + 1;
    if (*param_1 < 0x46) {
      *(undefined8 **)(param_1 + (longlong)*param_1 * 2 + 2) = puVar4;
    }
    else {
      *param_1 = 0x45;
    }
  }
  FUN_14034edd0(param_1 + 0x9c);
  return;
}



longlong FUN_1402738a0(longlong param_1)

{
  undefined4 *puVar1;
  int iVar2;
  longlong lVar3;
  
  *(undefined8 *)(param_1 + 0x38) = 7;
  lVar3 = param_1 + 0x90;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined2 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x60) = 7;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  iVar2 = 2;
  puVar1 = (undefined4 *)(param_1 + 0x138);
  do {
    FUN_14000a170(lVar3);
    *puVar1 = 0;
    lVar3 = lVar3 + 0xb8;
    iVar2 = iVar2 + -1;
    puVar1[1] = 0;
    puVar1[2] = 0;
    puVar1[3] = 0;
    puVar1 = puVar1 + 0x2e;
  } while (-1 < iVar2);
  return param_1;
}



void FUN_140273960(longlong *param_1,longlong param_2)

{
  uint *puVar1;
  ulonglong *puVar2;
  undefined *puVar3;
  uint uVar4;
  uint uVar5;
  longlong *plVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  uint *puVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  ulonglong uVar12;
  uint *puVar13;
  uint uVar14;
  uint uVar15;
  longlong lVar16;
  uint uVar17;
  undefined8 *puVar19;
  ulonglong uVar20;
  bool bVar21;
  uint *local_res8;
  longlong local_res10;
  uint *local_res18;
  void *local_f8;
  undefined8 local_f0;
  undefined8 local_e8;
  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;
  undefined8 local_88;
  undefined1 local_80;
  undefined8 local_78;
  undefined1 local_70;
  undefined8 local_68;
  undefined1 local_60;
  undefined8 local_58;
  longlong *local_50;
  undefined1 local_48;
  ulonglong uVar18;
  
  local_58 = 0xfffffffffffffffe;
  local_50 = param_1 + 0x4e;
  local_res10 = param_2;
  FUN_14034ed40(local_50);
  local_48 = 1;
  if (*(int *)((longlong)param_1 + 0x2ac) != 0) {
    if (param_1[0x4c] != 0) {
      do {
        uVar12 = 0;
        plVar6 = (longlong *)FUN_140275030(param_1 + 0x48,&local_f8);
        uVar11 = uVar12;
        if ((ulonglong *)*plVar6 != (ulonglong *)0x0) {
          uVar11 = *(ulonglong *)*plVar6;
        }
        uVar10 = plVar6[2];
        if (*(ulonglong *)(uVar11 + 0x10) <= uVar10) {
          uVar10 = uVar10 - *(ulonglong *)(uVar11 + 0x10);
        }
        puVar2 = *(ulonglong **)(*(longlong *)(uVar11 + 8) + uVar10 * 8);
        uVar11 = *puVar2;
        uVar10 = puVar2[1];
        uVar14 = 0;
        uVar18 = uVar12;
        uVar20 = uVar12;
        plVar6 = param_1;
LAB_140273a40:
        plVar6 = plVar6 + 1;
        puVar2 = (ulonglong *)*plVar6;
        if (puVar2 == (ulonglong *)0x0) goto LAB_140273a6c;
        bVar21 = *puVar2 < uVar11;
        if ((*puVar2 != uVar11) ||
           (bVar21 = puVar2[1] < uVar10, uVar17 = uVar14, puVar2[1] != uVar10)) {
          uVar17 = (1 - (uint)bVar21) - (uint)(bVar21 != 0);
        }
        if (uVar17 != 0) goto LAB_140273a6c;
        local_f8 = (void *)0x0;
        local_f0 = 0;
        local_e8 = 0;
        lVar16 = 3;
        uVar11 = uVar12;
        do {
          plVar6 = (longlong *)(param_1[uVar20 + 1] + 0x90 + uVar11);
          uVar17 = 0;
          if ((*plVar6 != 0) || (uVar4 = uVar17, plVar6[1] != 0)) {
            uVar4 = 1;
          }
          if (uVar4 != 0) {
            FUN_140117330(&local_f8,plVar6);
          }
          uVar11 = uVar11 + 0xb8;
          lVar16 = lVar16 + -1;
        } while (lVar16 != 0);
        puVar19 = (undefined8 *)(param_1[uVar20 + 1] + 0x48);
        if (7 < *(ulonglong *)(param_1[uVar20 + 1] + 0x60)) {
          puVar19 = (undefined8 *)*puVar19;
        }
        FUN_14034fe70();
        local_res18 = (uint *)PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar19);
        if ((local_res18 != (uint *)0x0) && (uVar12 = 0, local_res18 != (uint *)PTR_DAT_1405d8010))
        {
          uVar12 = (ulonglong)local_res18[-2];
        }
        uVar5 = uVar4;
        if ((((int)uVar4 <= (int)uVar12) && (uVar5 = uVar17, local_res18 != (uint *)0x0)) &&
           (local_res18 != (uint *)PTR_DAT_1405d8010)) {
          uVar5 = local_res18[-2];
        }
        uVar15 = 1;
        if (1 < (int)uVar5) {
          uVar15 = uVar5;
        }
        uVar5 = uVar17;
        if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
          uVar5 = local_res18[-2];
        }
        puVar9 = local_res18;
        if ((int)uVar5 < (int)uVar15) {
          puVar13 = local_res18;
          if (local_res18 == (uint *)0x0) {
            puVar13 = (uint *)PTR_DAT_1405d8010;
          }
          local_res18 = puVar13;
          if ((int)uVar15 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          if (uVar15 == 0) {
            puVar9 = (uint *)PTR_DAT_1405d8010;
            if (((puVar13 != (uint *)0x0) &&
                (puVar9 = (uint *)PTR_DAT_1405d8010, puVar13 != (uint *)PTR_DAT_1405d8010)) &&
               (puVar9 = (uint *)PTR_DAT_1405d8010, puVar13 + -2 != (uint *)0x0)) {
              uVar7 = FUN_14034fe70();
              local_78 = uVar7;
              FUN_14034ed40(uVar7);
              local_70 = 1;
              puVar9 = puVar13 + -1;
              *puVar9 = *puVar9 - 1;
              if (*puVar9 == 0) {
                FUN_14034ff60(puVar13 + -2);
              }
              FUN_14034edd0(uVar7);
              local_70 = 0;
              puVar9 = (uint *)PTR_DAT_1405d8010;
            }
          }
          else {
            uVar5 = uVar17;
            if ((puVar13 != (uint *)0x0) && (puVar13 != (uint *)PTR_DAT_1405d8010)) {
              uVar5 = puVar13[-2];
            }
            puVar9 = puVar13;
            if (uVar15 != uVar5) {
              puVar9 = (uint *)FUN_14034fef0((longlong)(int)uVar15 * 2 + 10);
              if (puVar9 != (uint *)0x0) {
                *puVar9 = 0;
                puVar9[1] = 1;
              }
              *puVar9 = uVar15;
              if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
                uVar17 = local_res18[-2];
              }
              puVar13 = (uint *)PTR_DAT_1405d8010;
              if ((int)uVar15 < (int)uVar17) {
LAB_140273c3e:
                if (local_res18 != (uint *)0x0) {
                  puVar13 = local_res18;
                }
              }
              else {
                uVar15 = uVar14;
                if (local_res18 != (uint *)0x0) {
                  if (local_res18 != (uint *)PTR_DAT_1405d8010) {
                    uVar15 = local_res18[-2];
                  }
                  goto LAB_140273c3e;
                }
              }
              puVar9 = puVar9 + 2;
              FUN_14034fd20(puVar9,puVar13,uVar15);
              puVar13 = local_res18;
              if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
                 (puVar1 = local_res18 + -2, puVar1 != (uint *)0x0)) {
                uVar7 = FUN_14034fe70();
                local_b8 = uVar7;
                FUN_14034ed40(uVar7);
                local_b0 = 1;
                puVar13 = puVar13 + -1;
                *puVar13 = *puVar13 - 1;
                if (*puVar13 == 0) {
                  FUN_14034ff60(puVar1);
                }
                FUN_14034edd0(uVar7);
                local_b0 = 0;
              }
            }
          }
        }
        local_res18 = puVar9;
        uVar17 = 0;
        uVar14 = 0;
        puVar9 = (uint *)PTR_DAT_1405d8010;
        if (((local_res18 == (uint *)0x0) ||
            (puVar9 = local_res18, local_res18 == (uint *)PTR_DAT_1405d8010)) ||
           (local_res18 + -2 == (uint *)0x0)) {
          local_res18 = puVar9;
          puVar8 = (undefined8 *)FUN_14034fef0();
          *puVar8 = 0;
          *(undefined2 *)(puVar8 + 1) = 0;
          if (puVar8 != (undefined8 *)0x0) {
            *(undefined4 *)puVar8 = 0;
            *(undefined4 *)((longlong)puVar8 + 4) = 1;
          }
          *(undefined2 *)(puVar8 + 1) = 0;
          puVar9 = (uint *)(puVar8 + 1);
        }
        else if (1 < (int)local_res18[-1]) {
          uVar5 = local_res18[-2];
          if ((int)uVar5 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          puVar9 = (uint *)FUN_14034fef0((longlong)(int)uVar5 * 2 + 10);
          if (puVar9 != (uint *)0x0) {
            *puVar9 = 0;
            puVar9[1] = 1;
          }
          puVar3 = PTR_DAT_1405d8010;
          if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
            uVar14 = local_res18[-2];
          }
          *puVar9 = uVar14;
          puVar13 = (uint *)puVar3;
          if ((local_res18 != (uint *)0x0) && (puVar13 = local_res18, local_res18 != (uint *)puVar3)
             ) {
            uVar17 = local_res18[-2];
          }
          puVar9 = puVar9 + 2;
          FUN_14034fd20(puVar9,puVar13,uVar17);
          puVar13 = local_res18;
          if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
             (puVar1 = local_res18 + -2, puVar1 != (uint *)0x0)) {
            uVar7 = FUN_14034fe70();
            local_98 = uVar7;
            FUN_14034ed40(uVar7);
            local_90 = 1;
            puVar13 = puVar13 + -1;
            *puVar13 = *puVar13 - 1;
            if (*puVar13 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(uVar7);
            local_90 = 0;
          }
        }
        local_res18 = puVar9;
        puVar9 = local_res18;
        if (local_res18 == (uint *)0x0) {
          puVar9 = (uint *)PTR_DAT_1405d8010;
        }
        FUN_14034fd20(puVar9,puVar19,uVar4);
        puVar9 = local_res18;
        if (local_res18 == (uint *)0x0) {
          puVar9 = (uint *)PTR_DAT_1405d8010;
        }
        uVar17 = FUN_14034fcf0(puVar9);
        uVar14 = 0;
        if (0 < (int)uVar17) {
          uVar14 = uVar17;
        }
        uVar17 = 0;
        if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
          uVar17 = local_res18[-2];
        }
        if (((int)uVar14 < (int)uVar17) || (uVar14 = 0, local_res18 == (uint *)0x0)) {
LAB_140273e48:
          if (((local_res18 != (uint *)PTR_DAT_1405d8010) && (local_res18 != (uint *)0x0)) &&
             (local_res18 + -2 != (uint *)0x0)) {
            local_res18[-2] = uVar14;
            *(undefined2 *)((longlong)local_res18 + (longlong)(int)uVar14 * 2) = 0;
          }
        }
        else if (local_res18 != (uint *)PTR_DAT_1405d8010) {
          uVar14 = local_res18[-2];
          goto LAB_140273e48;
        }
        puVar19 = (undefined8 *)(param_1[uVar20 + 1] + 0x20);
        if (7 < *(ulonglong *)(param_1[uVar20 + 1] + 0x38)) {
          puVar19 = (undefined8 *)*puVar19;
        }
        FUN_14034fe70();
        local_res8 = (uint *)PTR_DAT_1405d8010;
        uVar17 = FUN_14034fcf0(puVar19);
        uVar14 = 0;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
          uVar14 = local_res8[-2];
        }
        uVar4 = uVar17;
        if ((int)uVar17 <= (int)uVar14) {
          uVar4 = 0;
          if ((local_res8 != (uint *)0x0) && (uVar4 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
            uVar4 = local_res8[-2];
          }
        }
        uVar14 = 1;
        if (1 < (int)uVar4) {
          uVar14 = uVar4;
        }
        uVar4 = 0;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
          uVar4 = local_res8[-2];
        }
        puVar9 = local_res8;
        if ((int)uVar4 < (int)uVar14) {
          puVar13 = local_res8;
          if (local_res8 == (uint *)0x0) {
            puVar13 = (uint *)PTR_DAT_1405d8010;
          }
          local_res8 = puVar13;
          if ((int)uVar14 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          if (uVar14 == 0) {
            puVar9 = (uint *)PTR_DAT_1405d8010;
            if (((puVar13 != (uint *)0x0) &&
                (puVar9 = (uint *)PTR_DAT_1405d8010, puVar13 != (uint *)PTR_DAT_1405d8010)) &&
               (puVar9 = (uint *)PTR_DAT_1405d8010, puVar13 + -2 != (uint *)0x0)) {
              uVar7 = FUN_14034fe70();
              local_d8 = uVar7;
              FUN_14034ed40(uVar7);
              local_d0 = 1;
              puVar9 = puVar13 + -1;
              *puVar9 = *puVar9 - 1;
              if (*puVar9 == 0) {
                FUN_14034ff60(puVar13 + -2);
              }
              FUN_14034edd0(uVar7);
              local_d0 = 0;
              puVar9 = (uint *)PTR_DAT_1405d8010;
            }
          }
          else {
            uVar4 = 0;
            if ((puVar13 != (uint *)0x0) && (uVar4 = 0, puVar13 != (uint *)PTR_DAT_1405d8010)) {
              uVar4 = puVar13[-2];
            }
            puVar9 = puVar13;
            if (uVar14 != uVar4) {
              puVar9 = (uint *)FUN_14034fef0((longlong)(int)uVar14 * 2 + 10);
              if (puVar9 != (uint *)0x0) {
                *puVar9 = 0;
                puVar9[1] = 1;
              }
              *puVar9 = uVar14;
              uVar4 = 0;
              if ((local_res8 != (uint *)0x0) &&
                 (uVar4 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
                uVar4 = local_res8[-2];
              }
              puVar13 = (uint *)PTR_DAT_1405d8010;
              if ((int)uVar14 < (int)uVar4) {
LAB_140273fbd:
                if (local_res8 != (uint *)0x0) {
                  puVar13 = local_res8;
                }
              }
              else {
                uVar14 = 0;
                if (local_res8 != (uint *)0x0) {
                  if (local_res8 != (uint *)PTR_DAT_1405d8010) {
                    uVar14 = local_res8[-2];
                  }
                  goto LAB_140273fbd;
                }
              }
              puVar9 = puVar9 + 2;
              FUN_14034fd20(puVar9,puVar13,uVar14);
              puVar13 = local_res8;
              if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
                 (puVar1 = local_res8 + -2, puVar1 != (uint *)0x0)) {
                uVar7 = FUN_14034fe70();
                local_88 = uVar7;
                FUN_14034ed40(uVar7);
                local_80 = 1;
                puVar13 = puVar13 + -1;
                *puVar13 = *puVar13 - 1;
                if (*puVar13 == 0) {
                  FUN_14034ff60(puVar1);
                }
                FUN_14034edd0(uVar7);
                local_80 = 0;
              }
            }
          }
        }
        local_res8 = puVar9;
        puVar9 = (uint *)PTR_DAT_1405d8010;
        if (((local_res8 == (uint *)0x0) ||
            (puVar9 = local_res8, local_res8 == (uint *)PTR_DAT_1405d8010)) ||
           (local_res8 + -2 == (uint *)0x0)) {
          local_res8 = puVar9;
          puVar8 = (undefined8 *)FUN_14034fef0();
          *puVar8 = 0;
          *(undefined2 *)(puVar8 + 1) = 0;
          if (puVar8 != (undefined8 *)0x0) {
            *(undefined4 *)puVar8 = 0;
            *(undefined4 *)((longlong)puVar8 + 4) = 1;
          }
          *(undefined2 *)(puVar8 + 1) = 0;
          puVar9 = (uint *)(puVar8 + 1);
        }
        else if (1 < (int)local_res8[-1]) {
          uVar14 = local_res8[-2];
          if ((int)uVar14 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          puVar9 = (uint *)FUN_14034fef0((longlong)(int)uVar14 * 2 + 10);
          if (puVar9 != (uint *)0x0) {
            *puVar9 = 0;
            puVar9[1] = 1;
          }
          puVar3 = PTR_DAT_1405d8010;
          uVar14 = 0;
          if ((local_res8 != (uint *)0x0) && (uVar14 = 0, local_res8 != (uint *)PTR_DAT_1405d8010))
          {
            uVar14 = local_res8[-2];
          }
          *puVar9 = uVar14;
          uVar14 = 0;
          puVar13 = (uint *)puVar3;
          if ((local_res8 != (uint *)0x0) && (puVar13 = local_res8, local_res8 != (uint *)puVar3)) {
            uVar14 = local_res8[-2];
          }
          puVar9 = puVar9 + 2;
          FUN_14034fd20(puVar9,puVar13,uVar14);
          puVar13 = local_res8;
          if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
             (puVar1 = local_res8 + -2, puVar1 != (uint *)0x0)) {
            uVar7 = FUN_14034fe70();
            local_c8 = uVar7;
            FUN_14034ed40(uVar7);
            local_c0 = 1;
            puVar13 = puVar13 + -1;
            *puVar13 = *puVar13 - 1;
            if (*puVar13 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(uVar7);
            local_c0 = 0;
          }
        }
        local_res8 = puVar9;
        puVar9 = local_res8;
        if (local_res8 == (uint *)0x0) {
          puVar9 = (uint *)PTR_DAT_1405d8010;
        }
        FUN_14034fd20(puVar9,puVar19,uVar17);
        puVar9 = local_res8;
        if (local_res8 == (uint *)0x0) {
          puVar9 = (uint *)PTR_DAT_1405d8010;
        }
        uVar17 = FUN_14034fcf0(puVar9);
        uVar14 = 0;
        if (0 < (int)uVar17) {
          uVar14 = uVar17;
        }
        uVar17 = 0;
        if ((local_res8 != (uint *)0x0) && (uVar17 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
          uVar17 = local_res8[-2];
        }
        if (((int)uVar14 < (int)uVar17) || (uVar14 = 0, local_res8 == (uint *)0x0)) {
LAB_1402741cb:
          if (((local_res8 != (uint *)PTR_DAT_1405d8010) && (local_res8 != (uint *)0x0)) &&
             (local_res8 + -2 != (uint *)0x0)) {
            local_res8[-2] = uVar14;
            *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar14 * 2) = 0;
          }
        }
        else if (local_res8 != (uint *)PTR_DAT_1405d8010) {
          uVar14 = local_res8[-2];
          goto LAB_1402741cb;
        }
        lVar16 = param_1[uVar20 + 1];
        (**(code **)(*(longlong *)(*(longlong *)(local_res10 + 0xb50) + 0x3c0) + 0x340))
                  (*(longlong *)(local_res10 + 0xb50) + 0x3c0,*(undefined4 *)(local_res10 + 8),
                   &DAT_1405d85a0,lVar16,&local_res8,&local_res18,lVar16 + 0x70,lVar16 + 0x7c,
                   lVar16 + 0x80,lVar16 + 0x88,lVar16 + 0x74,lVar16 + 0x78,&local_f8);
        puVar9 = local_res8;
        if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
           (puVar13 = local_res8 + -2, puVar13 != (uint *)0x0)) {
          uVar7 = FUN_14034fe70();
          local_a8 = uVar7;
          FUN_14034ed40(uVar7);
          local_a0 = 1;
          puVar9 = puVar9 + -1;
          *puVar9 = *puVar9 - 1;
          if (*puVar9 == 0) {
            FUN_14034ff60(puVar13);
          }
          FUN_14034edd0(uVar7);
          local_a0 = 0;
        }
        puVar9 = local_res18;
        local_res8 = (uint *)PTR_DAT_1405d8010;
        if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
           (puVar13 = local_res18 + -2, puVar13 != (uint *)0x0)) {
          uVar7 = FUN_14034fe70();
          local_68 = uVar7;
          FUN_14034ed40(uVar7);
          local_60 = 1;
          puVar9 = puVar9 + -1;
          *puVar9 = *puVar9 - 1;
          if (*puVar9 == 0) {
            FUN_14034ff60(puVar13);
          }
          FUN_14034edd0(uVar7);
          local_60 = 0;
        }
        local_res18 = (uint *)PTR_DAT_1405d8010;
        if (local_f8 != (void *)0x0) {
          operator_delete(local_f8);
        }
LAB_14027434f:
        if (param_1[0x4c] != 0) {
          param_1[0x4b] = param_1[0x4b] + 1;
          uVar11 = param_1[0x4b];
          if ((ulonglong)param_1[0x4a] <= uVar11) {
            uVar11 = 0;
          }
          param_1[0x4b] = uVar11;
          lVar16 = param_1[0x4c] + -1;
          param_1[0x4c] = lVar16;
          if (lVar16 == 0) {
            param_1[0x4b] = 0;
          }
        }
        if (param_1[0x4c] == 0) break;
      } while( true );
    }
    *(undefined4 *)((longlong)param_1 + 0x2ac) = 0;
  }
  FUN_14034edd0(param_1 + 0x4e);
  return;
LAB_140273a6c:
  uVar17 = (int)uVar18 + 1;
  uVar18 = (ulonglong)uVar17;
  uVar20 = uVar20 + 1;
  if (0x45 < uVar17) goto LAB_14027434f;
  goto LAB_140273a40;
}



void FUN_1402743e0(longlong *param_1,longlong param_2,ulonglong *param_3)

{
  longlong *plVar1;
  ulonglong *puVar2;
  longlong lVar3;
  int iVar4;
  undefined4 uVar5;
  longlong *plVar6;
  longlong lVar7;
  longlong lVar8;
  undefined8 *puVar9;
  longlong lVar10;
  bool bVar11;
  undefined4 local_res8 [2];
  
  plVar1 = param_1 + 0x4e;
  FUN_14034ed40(plVar1);
  lVar10 = 0x46;
  do {
    param_1 = param_1 + 1;
    puVar2 = (ulonglong *)*param_1;
    if (puVar2 != (ulonglong *)0x0) {
      bVar11 = *puVar2 < *param_3;
      if ((*puVar2 != *param_3) ||
         (bVar11 = puVar2[1] < param_3[1], iVar4 = 0, puVar2[1] != param_3[1])) {
        iVar4 = (1 - (uint)bVar11) - (uint)(bVar11 != 0);
      }
      if (iVar4 == 0) {
        lVar8 = 3;
        lVar7 = 0;
        do {
          lVar3 = *param_1;
          plVar6 = (longlong *)(lVar3 + 0x90 + lVar7);
          if ((*plVar6 != 0) || (iVar4 = 0, plVar6[1] != 0)) {
            iVar4 = 1;
          }
          if (iVar4 != 0) {
            puVar9 = (undefined8 *)(lVar3 + 0x20);
            if (7 < *(ulonglong *)(lVar3 + 0x38)) {
              puVar9 = (undefined8 *)*puVar9;
            }
            FUN_1402031e0(*(undefined8 *)(param_2 + 0xb50),param_2,plVar6,puVar9,1);
          }
          lVar7 = lVar7 + 0xb8;
          lVar8 = lVar8 + -1;
        } while (lVar8 != 0);
        FUN_1401fc100(*(undefined8 *)(param_2 + 0xb50),*(undefined4 *)(param_2 + 0x288),
                      *(undefined4 *)(param_2 + 0x284),*(undefined4 *)(param_2 + 8),param_3);
        local_res8[0] = 1;
        plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x3c0);
        (**(code **)(*plVar6 + 0x3a0))
                  (plVar6,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0,param_3,local_res8);
        puVar9 = (undefined8 *)(*param_1 + 0x20);
        if (7 < *(ulonglong *)(*param_1 + 0x38)) {
          puVar9 = (undefined8 *)*puVar9;
        }
        uVar5 = (**(code **)(**(longlong **)(param_2 + 0xb50) + 0x168))
                          (*(longlong **)(param_2 + 0xb50),puVar9);
        lVar7 = FUN_14016e240(*(undefined8 *)(param_2 + 0xb50),uVar5);
        if (lVar7 == 0) {
          FUN_14026ea60(*(longlong *)(param_2 + 0xb50),puVar9);
        }
        else {
          plVar6 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x78);
          (**(code **)(*plVar6 + 0x940))(plVar6,*(undefined4 *)(lVar7 + 8),&DAT_1405d85a0);
        }
        if (*param_1 != 0) {
          FUN_140273340();
        }
        *param_1 = 0;
      }
    }
    lVar10 = lVar10 + -1;
  } while (lVar10 != 0);
  FUN_14034edd0(plVar1);
  return;
}



void FUN_1402745e0(longlong param_1,longlong param_2)

{
  uint *puVar1;
  undefined *puVar2;
  undefined4 uVar3;
  uint uVar4;
  uint uVar5;
  undefined8 uVar6;
  undefined8 *puVar7;
  uint *puVar8;
  longlong *plVar9;
  uint uVar10;
  uint *puVar11;
  ulonglong uVar12;
  uint uVar13;
  uint uVar14;
  longlong lVar15;
  undefined8 *puVar16;
  longlong lVar17;
  uint *local_res8;
  longlong local_res10;
  uint *local_res18;
  void *local_d8;
  undefined8 local_d0;
  undefined8 local_c8;
  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;
  undefined8 local_68;
  undefined1 local_60;
  longlong local_58;
  undefined1 local_50;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  local_58 = param_1 + 0x270;
  local_res10 = param_2;
  FUN_14034ed40(local_58);
  local_50 = 1;
  uVar3 = FUN_140275240(param_1);
  *(undefined4 *)(param_1 + 0x238) = uVar3;
  plVar9 = (longlong *)(*(longlong *)(param_2 + 0xb50) + 0x3c0);
  (**(code **)(*plVar9 + 0x330))(plVar9,*(undefined4 *)(param_2 + 8),&DAT_1405d85a0);
  if (0 < *(int *)(param_1 + 0x238)) {
    lVar17 = 0;
    do {
      if (*(longlong *)(param_1 + 8 + lVar17 * 8) != 0) {
        local_d8 = (void *)0x0;
        local_d0 = 0;
        local_c8 = 0;
        lVar15 = 3;
        uVar12 = 0;
        do {
          plVar9 = (longlong *)(uVar12 + 0x90 + *(longlong *)(param_1 + 8 + lVar17 * 8));
          uVar13 = 0;
          if ((*plVar9 != 0) || (uVar4 = uVar13, plVar9[1] != 0)) {
            uVar4 = 1;
          }
          if (uVar4 != 0) {
            FUN_140117330(&local_d8,plVar9);
          }
          uVar12 = uVar12 + 0xb8;
          lVar15 = lVar15 + -1;
        } while (lVar15 != 0);
        lVar15 = *(longlong *)(param_1 + 8 + lVar17 * 8);
        puVar16 = (undefined8 *)(lVar15 + 0x48);
        if (7 < *(ulonglong *)(lVar15 + 0x60)) {
          puVar16 = (undefined8 *)*puVar16;
        }
        FUN_14034fe70();
        local_res18 = (uint *)PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar16);
        uVar12 = 0;
        if ((local_res18 != (uint *)0x0) && (uVar12 = 0, local_res18 != (uint *)PTR_DAT_1405d8010))
        {
          uVar12 = (ulonglong)local_res18[-2];
        }
        uVar10 = 0;
        uVar5 = uVar4;
        if ((((int)uVar4 <= (int)uVar12) && (uVar5 = uVar10, local_res18 != (uint *)0x0)) &&
           (local_res18 != (uint *)PTR_DAT_1405d8010)) {
          uVar5 = local_res18[-2];
        }
        uVar14 = 1;
        if (1 < (int)uVar5) {
          uVar14 = uVar5;
        }
        uVar5 = uVar10;
        if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
          uVar5 = local_res18[-2];
        }
        puVar8 = local_res18;
        if ((int)uVar5 < (int)uVar14) {
          puVar11 = local_res18;
          if (local_res18 == (uint *)0x0) {
            puVar11 = (uint *)PTR_DAT_1405d8010;
          }
          local_res18 = puVar11;
          if ((int)uVar14 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          if (uVar14 == 0) {
            puVar8 = (uint *)PTR_DAT_1405d8010;
            if (((puVar11 != (uint *)0x0) &&
                (puVar8 = (uint *)PTR_DAT_1405d8010, puVar11 != (uint *)PTR_DAT_1405d8010)) &&
               (puVar8 = (uint *)PTR_DAT_1405d8010, puVar11 + -2 != (uint *)0x0)) {
              uVar6 = FUN_14034fe70();
              FUN_14034ed40(uVar6);
              puVar8 = puVar11 + -1;
              *puVar8 = *puVar8 - 1;
              if (*puVar8 == 0) {
                FUN_14034ff60(puVar11 + -2);
              }
              FUN_14034edd0(uVar6);
              puVar8 = (uint *)PTR_DAT_1405d8010;
            }
          }
          else {
            uVar5 = uVar10;
            if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8010)) {
              uVar5 = puVar11[-2];
            }
            puVar8 = puVar11;
            if (uVar14 != uVar5) {
              puVar8 = (uint *)FUN_14034fef0((longlong)(int)uVar14 * 2 + 10);
              if (puVar8 != (uint *)0x0) {
                *puVar8 = 0;
                puVar8[1] = 1;
              }
              *puVar8 = uVar14;
              if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
                uVar10 = local_res18[-2];
              }
              puVar11 = (uint *)PTR_DAT_1405d8010;
              if ((int)uVar14 < (int)uVar10) {
LAB_140274836:
                if (local_res18 != (uint *)0x0) {
                  puVar11 = local_res18;
                }
              }
              else {
                uVar14 = uVar13;
                if (local_res18 != (uint *)0x0) {
                  if (local_res18 != (uint *)PTR_DAT_1405d8010) {
                    uVar14 = local_res18[-2];
                  }
                  goto LAB_140274836;
                }
              }
              puVar8 = puVar8 + 2;
              FUN_14034fd20(puVar8,puVar11,uVar14);
              puVar11 = local_res18;
              if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
                 (puVar1 = local_res18 + -2, puVar1 != (uint *)0x0)) {
                uVar6 = FUN_14034fe70();
                local_88 = uVar6;
                FUN_14034ed40(uVar6);
                local_80 = 1;
                puVar11 = puVar11 + -1;
                *puVar11 = *puVar11 - 1;
                if (*puVar11 == 0) {
                  FUN_14034ff60(puVar1);
                }
                FUN_14034edd0(uVar6);
                local_80 = 0;
              }
            }
          }
        }
        local_res18 = puVar8;
        uVar5 = 0;
        uVar13 = 0;
        puVar8 = (uint *)PTR_DAT_1405d8010;
        if (((local_res18 == (uint *)0x0) ||
            (puVar8 = local_res18, local_res18 == (uint *)PTR_DAT_1405d8010)) ||
           (local_res18 + -2 == (uint *)0x0)) {
          local_res18 = puVar8;
          puVar7 = (undefined8 *)FUN_14034fef0();
          *puVar7 = 0;
          *(undefined2 *)(puVar7 + 1) = 0;
          if (puVar7 != (undefined8 *)0x0) {
            *(undefined4 *)puVar7 = 0;
            *(undefined4 *)((longlong)puVar7 + 4) = 1;
          }
          *(undefined2 *)(puVar7 + 1) = 0;
          puVar8 = (uint *)(puVar7 + 1);
        }
        else if (1 < (int)local_res18[-1]) {
          uVar10 = local_res18[-2];
          if ((int)uVar10 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          puVar8 = (uint *)FUN_14034fef0((longlong)(int)uVar10 * 2 + 10);
          if (puVar8 != (uint *)0x0) {
            *puVar8 = 0;
            puVar8[1] = 1;
          }
          puVar2 = PTR_DAT_1405d8010;
          if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
            uVar13 = local_res18[-2];
          }
          *puVar8 = uVar13;
          puVar11 = (uint *)puVar2;
          if ((local_res18 != (uint *)0x0) && (puVar11 = local_res18, local_res18 != (uint *)puVar2)
             ) {
            uVar5 = local_res18[-2];
          }
          puVar8 = puVar8 + 2;
          FUN_14034fd20(puVar8,puVar11,uVar5);
          puVar11 = local_res18;
          if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
             (puVar1 = local_res18 + -2, puVar1 != (uint *)0x0)) {
            uVar6 = FUN_14034fe70();
            local_a8 = uVar6;
            FUN_14034ed40(uVar6);
            local_a0 = 1;
            puVar11 = puVar11 + -1;
            *puVar11 = *puVar11 - 1;
            if (*puVar11 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(uVar6);
            local_a0 = 0;
          }
        }
        local_res18 = puVar8;
        puVar8 = local_res18;
        if (local_res18 == (uint *)0x0) {
          puVar8 = (uint *)PTR_DAT_1405d8010;
        }
        FUN_14034fd20(puVar8,puVar16,uVar4);
        puVar8 = local_res18;
        if (local_res18 == (uint *)0x0) {
          puVar8 = (uint *)PTR_DAT_1405d8010;
        }
        uVar4 = FUN_14034fcf0(puVar8);
        uVar13 = 0;
        if (0 < (int)uVar4) {
          uVar13 = uVar4;
        }
        uVar4 = 0;
        if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
          uVar4 = local_res18[-2];
        }
        if (((int)uVar13 < (int)uVar4) || (uVar13 = 0, local_res18 == (uint *)0x0)) {
LAB_140274a40:
          if (((local_res18 != (uint *)PTR_DAT_1405d8010) && (local_res18 != (uint *)0x0)) &&
             (local_res18 + -2 != (uint *)0x0)) {
            local_res18[-2] = uVar13;
            *(undefined2 *)((longlong)local_res18 + (longlong)(int)uVar13 * 2) = 0;
          }
        }
        else if (local_res18 != (uint *)PTR_DAT_1405d8010) {
          uVar13 = local_res18[-2];
          goto LAB_140274a40;
        }
        lVar15 = *(longlong *)(param_1 + 8 + lVar17 * 8);
        puVar16 = (undefined8 *)(lVar15 + 0x20);
        if (7 < *(ulonglong *)(lVar15 + 0x38)) {
          puVar16 = (undefined8 *)*puVar16;
        }
        FUN_14034fe70();
        local_res8 = (uint *)PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar16);
        uVar13 = 0;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
          uVar13 = local_res8[-2];
        }
        uVar5 = uVar4;
        if ((int)uVar4 <= (int)uVar13) {
          uVar5 = 0;
          if ((local_res8 != (uint *)0x0) && (uVar5 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
            uVar5 = local_res8[-2];
          }
        }
        uVar13 = 1;
        if (1 < (int)uVar5) {
          uVar13 = uVar5;
        }
        uVar5 = 0;
        if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
          uVar5 = local_res8[-2];
        }
        puVar8 = local_res8;
        if ((int)uVar5 < (int)uVar13) {
          puVar11 = local_res8;
          if (local_res8 == (uint *)0x0) {
            puVar11 = (uint *)PTR_DAT_1405d8010;
          }
          local_res8 = puVar11;
          if ((int)uVar13 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          if (uVar13 == 0) {
            puVar8 = (uint *)PTR_DAT_1405d8010;
            if (((puVar11 != (uint *)0x0) &&
                (puVar8 = (uint *)PTR_DAT_1405d8010, puVar11 != (uint *)PTR_DAT_1405d8010)) &&
               (puVar8 = (uint *)PTR_DAT_1405d8010, puVar11 + -2 != (uint *)0x0)) {
              uVar6 = FUN_14034fe70();
              local_68 = uVar6;
              FUN_14034ed40(uVar6);
              local_60 = 1;
              puVar8 = puVar11 + -1;
              *puVar8 = *puVar8 - 1;
              if (*puVar8 == 0) {
                FUN_14034ff60(puVar11 + -2);
              }
              FUN_14034edd0(uVar6);
              local_60 = 0;
              puVar8 = (uint *)PTR_DAT_1405d8010;
            }
          }
          else {
            uVar5 = 0;
            if ((puVar11 != (uint *)0x0) && (uVar5 = 0, puVar11 != (uint *)PTR_DAT_1405d8010)) {
              uVar5 = puVar11[-2];
            }
            puVar8 = puVar11;
            if (uVar13 != uVar5) {
              puVar8 = (uint *)FUN_14034fef0((longlong)(int)uVar13 * 2 + 10);
              if (puVar8 != (uint *)0x0) {
                *puVar8 = 0;
                puVar8[1] = 1;
              }
              *puVar8 = uVar13;
              uVar5 = 0;
              if ((local_res8 != (uint *)0x0) &&
                 (uVar5 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
                uVar5 = local_res8[-2];
              }
              puVar11 = (uint *)PTR_DAT_1405d8010;
              if ((int)uVar13 < (int)uVar5) {
LAB_140274ba6:
                if (local_res8 != (uint *)0x0) {
                  puVar11 = local_res8;
                }
              }
              else {
                uVar13 = 0;
                if (local_res8 != (uint *)0x0) {
                  if (local_res8 != (uint *)PTR_DAT_1405d8010) {
                    uVar13 = local_res8[-2];
                  }
                  goto LAB_140274ba6;
                }
              }
              puVar8 = puVar8 + 2;
              FUN_14034fd20(puVar8,puVar11,uVar13);
              puVar11 = local_res8;
              if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
                 (puVar1 = local_res8 + -2, puVar1 != (uint *)0x0)) {
                uVar6 = FUN_14034fe70();
                FUN_14034ed40(uVar6);
                puVar11 = puVar11 + -1;
                *puVar11 = *puVar11 - 1;
                if (*puVar11 == 0) {
                  FUN_14034ff60(puVar1);
                }
                FUN_14034edd0(uVar6);
              }
            }
          }
        }
        local_res8 = puVar8;
        puVar8 = (uint *)PTR_DAT_1405d8010;
        if (((local_res8 == (uint *)0x0) ||
            (puVar8 = local_res8, local_res8 == (uint *)PTR_DAT_1405d8010)) ||
           (local_res8 + -2 == (uint *)0x0)) {
          local_res8 = puVar8;
          puVar7 = (undefined8 *)FUN_14034fef0();
          *puVar7 = 0;
          *(undefined2 *)(puVar7 + 1) = 0;
          if (puVar7 != (undefined8 *)0x0) {
            *(undefined4 *)puVar7 = 0;
            *(undefined4 *)((longlong)puVar7 + 4) = 1;
          }
          *(undefined2 *)(puVar7 + 1) = 0;
          puVar8 = (uint *)(puVar7 + 1);
        }
        else if (1 < (int)local_res8[-1]) {
          uVar13 = local_res8[-2];
          if ((int)uVar13 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          puVar8 = (uint *)FUN_14034fef0((longlong)(int)uVar13 * 2 + 10);
          if (puVar8 != (uint *)0x0) {
            *puVar8 = 0;
            puVar8[1] = 1;
          }
          puVar2 = PTR_DAT_1405d8010;
          uVar13 = 0;
          if ((local_res8 != (uint *)0x0) && (uVar13 = 0, local_res8 != (uint *)PTR_DAT_1405d8010))
          {
            uVar13 = local_res8[-2];
          }
          *puVar8 = uVar13;
          uVar13 = 0;
          puVar11 = (uint *)puVar2;
          if ((local_res8 != (uint *)0x0) && (puVar11 = local_res8, local_res8 != (uint *)puVar2)) {
            uVar13 = local_res8[-2];
          }
          puVar8 = puVar8 + 2;
          FUN_14034fd20(puVar8,puVar11,uVar13);
          puVar11 = local_res8;
          if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
             (puVar1 = local_res8 + -2, puVar1 != (uint *)0x0)) {
            uVar6 = FUN_14034fe70();
            local_b8 = uVar6;
            FUN_14034ed40(uVar6);
            local_b0 = 1;
            puVar11 = puVar11 + -1;
            *puVar11 = *puVar11 - 1;
            if (*puVar11 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(uVar6);
            local_b0 = 0;
          }
        }
        local_res8 = puVar8;
        puVar8 = local_res8;
        if (local_res8 == (uint *)0x0) {
          puVar8 = (uint *)PTR_DAT_1405d8010;
        }
        FUN_14034fd20(puVar8,puVar16,uVar4);
        puVar8 = local_res8;
        if (local_res8 == (uint *)0x0) {
          puVar8 = (uint *)PTR_DAT_1405d8010;
        }
        uVar4 = FUN_14034fcf0(puVar8);
        uVar13 = 0;
        if (0 < (int)uVar4) {
          uVar13 = uVar4;
        }
        uVar4 = 0;
        if ((local_res8 != (uint *)0x0) && (uVar4 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
          uVar4 = local_res8[-2];
        }
        if (((int)uVar13 < (int)uVar4) || (uVar13 = 0, local_res8 == (uint *)0x0)) {
LAB_140274d9c:
          if (((local_res8 != (uint *)PTR_DAT_1405d8010) && (local_res8 != (uint *)0x0)) &&
             (local_res8 + -2 != (uint *)0x0)) {
            local_res8[-2] = uVar13;
            *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar13 * 2) = 0;
          }
        }
        else if (local_res8 != (uint *)PTR_DAT_1405d8010) {
          uVar13 = local_res8[-2];
          goto LAB_140274d9c;
        }
        lVar15 = *(longlong *)(param_1 + 8 + lVar17 * 8);
        (**(code **)(*(longlong *)(*(longlong *)(local_res10 + 0xb50) + 0x3c0) + 0x340))
                  (*(longlong *)(local_res10 + 0xb50) + 0x3c0,*(undefined4 *)(local_res10 + 8),
                   &DAT_1405d85a0,lVar15,&local_res8,&local_res18,lVar15 + 0x70,lVar15 + 0x7c,
                   lVar15 + 0x80,lVar15 + 0x88,lVar15 + 0x74,lVar15 + 0x78,&local_d8);
        puVar8 = local_res8;
        if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
           (puVar11 = local_res8 + -2, puVar11 != (uint *)0x0)) {
          uVar6 = FUN_14034fe70();
          local_98 = uVar6;
          FUN_14034ed40(uVar6);
          local_90 = 1;
          puVar8 = puVar8 + -1;
          *puVar8 = *puVar8 - 1;
          if (*puVar8 == 0) {
            FUN_14034ff60(puVar11);
          }
          FUN_14034edd0(uVar6);
          local_90 = 0;
        }
        puVar8 = local_res18;
        local_res8 = (uint *)PTR_DAT_1405d8010;
        if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
           (puVar11 = local_res18 + -2, puVar11 != (uint *)0x0)) {
          uVar6 = FUN_14034fe70();
          local_78 = uVar6;
          FUN_14034ed40(uVar6);
          local_70 = 1;
          puVar8 = puVar8 + -1;
          *puVar8 = *puVar8 - 1;
          if (*puVar8 == 0) {
            FUN_14034ff60(puVar11);
          }
          FUN_14034edd0(uVar6);
          local_70 = 0;
        }
        local_res18 = (uint *)PTR_DAT_1405d8010;
        if (local_d8 != (void *)0x0) {
          operator_delete(local_d8);
        }
      }
      lVar17 = lVar17 + 1;
    } while (lVar17 < 0x46);
  }
  FUN_14034edd0(local_58);
  return;
}



void FUN_140274f60(longlong param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  void *pvVar2;
  ulonglong uVar3;
  char *local_res8;
  undefined **local_28 [4];
  
  if (*(ulonglong *)(param_1 + 0x10) <= *(longlong *)(param_1 + 0x20) + 1U) {
    FUN_140275050();
  }
  uVar3 = *(longlong *)(param_1 + 0x18) + *(longlong *)(param_1 + 0x20);
  if (*(ulonglong *)(param_1 + 0x10) <= uVar3) {
    uVar3 = uVar3 - *(ulonglong *)(param_1 + 0x10);
  }
  if (*(longlong *)(*(longlong *)(param_1 + 8) + uVar3 * 8) == 0) {
    pvVar2 = operator_new(0x10);
    if (pvVar2 == (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_1405d3608);
    }
    *(void **)(*(longlong *)(param_1 + 8) + uVar3 * 8) = pvVar2;
  }
  puVar1 = *(undefined4 **)(*(longlong *)(param_1 + 8) + uVar3 * 8);
  if (puVar1 != (undefined4 *)0x0) {
    *puVar1 = *param_2;
    puVar1[1] = param_2[1];
    puVar1[2] = param_2[2];
    puVar1[3] = param_2[3];
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
  return;
}



undefined8 * FUN_140275030(undefined8 *param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = *param_1;
  uVar2 = param_1[3];
  param_2[1] = 0;
  *param_2 = uVar1;
  param_2[2] = uVar2;
  return param_2;
}



void FUN_140275050(longlong param_1)

{
  longlong lVar1;
  size_t sVar2;
  code *pcVar3;
  ulonglong uVar4;
  void *_Dst;
  void *pvVar5;
  void *pvVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  char *local_res8;
  undefined **local_48 [4];
  
  uVar7 = *(ulonglong *)(param_1 + 0x10);
  uVar8 = 1;
  if (uVar7 == 0xfffffffffffffff) {
    std::_Xlength_error("deque<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  uVar4 = uVar7 >> 1;
  if (uVar4 < 8) {
    uVar4 = 8;
  }
  else if (uVar4 < 2) goto LAB_1402750b5;
  if (uVar7 <= 0xfffffffffffffff - uVar4) {
    uVar8 = uVar4;
  }
LAB_1402750b5:
  uVar4 = *(ulonglong *)(param_1 + 0x18);
  _Dst = (void *)0x0;
  uVar7 = uVar7 + uVar8;
  if ((uVar7 != 0) &&
     ((0x1fffffffffffffff < uVar7 || (_Dst = operator_new(uVar7 * 8), _Dst == (void *)0x0)))) {
    local_res8 = (char *)0x0;
    std::exception::exception((exception *)local_48,&local_res8);
    local_48[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_48,(ThrowInfo *)&DAT_1405d3608);
  }
  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 (uVar8 < uVar4) {
    memmove(pvVar5,*(void **)(param_1 + 8),uVar8 * 8);
    pvVar5 = (void *)(uVar8 * 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 = uVar8;
  }
  else {
    sVar2 = (lVar1 >> 3) * 8;
    pvVar6 = memmove(pvVar5,*(void **)(param_1 + 8),sVar2);
    pvVar5 = _Dst;
    if (uVar8 - uVar4 != 0) {
      memset((void *)((longlong)pvVar6 + sVar2),0,(uVar8 - 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) + uVar8;
  *(void **)(param_1 + 8) = _Dst;
  return;
}



int FUN_140275240(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  
  plVar1 = param_1 + 0x4e;
  FUN_14034ed40(plVar1);
  iVar3 = 0;
  lVar2 = 0x46;
  do {
    param_1 = param_1 + 1;
    if (*param_1 != 0) {
      iVar3 = iVar3 + 1;
    }
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  FUN_14034edd0(plVar1);
  return iVar3;
}



undefined8 * FUN_1402752a0(undefined8 *param_1,undefined8 *param_2)

{
  param_1[0x15] = *param_2;
  param_1[0x16] = param_2[1];
  *(undefined2 *)((longlong)param_1 + 0x14) = *(undefined2 *)(param_2 + 4);
  *(undefined2 *)((longlong)param_1 + 0x16) = *(undefined2 *)((longlong)param_2 + 0x22);
  *param_1 = param_2[2];
  param_1[1] = param_2[3];
  *(undefined4 *)(param_1 + 3) = *(undefined4 *)((longlong)param_2 + 0x24);
  *(undefined2 *)((longlong)param_1 + 0x1c) = *(undefined2 *)(param_2 + 5);
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)((longlong)param_2 + 0x2a);
  *(undefined4 *)((longlong)param_1 + 0x24) = *(undefined4 *)((longlong)param_2 + 0x2e);
  *(undefined2 *)(param_1 + 5) = *(undefined2 *)((longlong)param_2 + 0x32);
  *(undefined4 *)(param_1 + 6) = *(undefined4 *)((longlong)param_2 + 0x34);
  *(undefined4 *)((longlong)param_1 + 0x34) = *(undefined4 *)((longlong)param_2 + 0x3c);
  *(undefined4 *)(param_1 + 7) = *(undefined4 *)((longlong)param_2 + 0x44);
  *(undefined4 *)((longlong)param_1 + 0x3c) = *(undefined4 *)(param_2 + 7);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_2 + 8);
  *(undefined4 *)((longlong)param_1 + 0x44) = *(undefined4 *)(param_2 + 9);
  *(undefined4 *)((longlong)param_1 + 0x2c) = *(undefined4 *)((longlong)param_2 + 0x4c);
  *(undefined2 *)(param_1 + 9) = *(undefined2 *)(param_2 + 10);
  *(undefined4 *)((longlong)param_1 + 0x4c) = *(undefined4 *)((longlong)param_2 + 0x52);
  *(undefined4 *)(param_1 + 10) = *(undefined4 *)((longlong)param_2 + 0x5a);
  *(undefined4 *)((longlong)param_1 + 0x54) = *(undefined4 *)((longlong)param_2 + 0x62);
  *(undefined4 *)(param_1 + 0xb) = *(undefined4 *)((longlong)param_2 + 0x56);
  *(undefined4 *)((longlong)param_1 + 0x5c) = *(undefined4 *)((longlong)param_2 + 0x5e);
  *(undefined4 *)(param_1 + 0xc) = *(undefined4 *)((longlong)param_2 + 0x66);
  *(undefined1 *)((longlong)param_1 + 100) = *(undefined1 *)((longlong)param_2 + 0x6a);
  *(undefined1 *)((longlong)param_1 + 0x65) = *(undefined1 *)((longlong)param_2 + 0x6b);
  *(undefined1 *)((longlong)param_1 + 0x66) = *(undefined1 *)((longlong)param_2 + 0x6c);
  *(undefined2 *)((longlong)param_1 + 0x6c) = *(undefined2 *)((longlong)param_2 + 0x6d);
  *(undefined2 *)((longlong)param_1 + 0x6e) = *(undefined2 *)((longlong)param_2 + 0x6f);
  *(undefined2 *)((longlong)param_1 + 0x7c) = *(undefined2 *)((longlong)param_2 + 0x71);
  *(undefined2 *)((longlong)param_1 + 0x94) = *(undefined2 *)((longlong)param_2 + 0x7b);
  *(undefined2 *)((longlong)param_1 + 0x96) = *(undefined2 *)((longlong)param_2 + 0x7d);
  *(undefined4 *)(param_1 + 0x13) = *(undefined4 *)((longlong)param_2 + 0x7f);
  *(undefined4 *)((longlong)param_1 + 0x9c) = *(undefined4 *)((longlong)param_2 + 0x83);
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)((longlong)param_2 + 0x87);
  *(undefined4 *)(param_1 + 0xd) = *(undefined4 *)((longlong)param_2 + 0x8b);
  param_1[0x10] = *(undefined8 *)((longlong)param_2 + 0x8f);
  param_1[0x11] = *(undefined8 *)((longlong)param_2 + 0x97);
  return param_1;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe

void FUN_1402753e0(int param_1,uint param_2,longlong param_3,longlong *param_4)

{
  int *piVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  uint *puVar5;
  undefined1 *puVar6;
  ulonglong uVar7;
  uint uVar8;
  longlong local_2758;
  uint local_2750;
  uint local_2748 [1248];
  int local_13c8;
  undefined4 local_13c4;
  undefined4 local_13bc;
  undefined1 local_13b8 [5000];
  undefined8 uStack_30;
  
  uStack_30 = 0x14027540a;
  local_2748[0] = 0x1571;
  local_13c8 = 1;
  do {
    local_2748[local_13c8] =
         (local_2748[(longlong)local_13c8 + -1] >> 0x1e ^ local_2748[(longlong)local_13c8 + -1]) *
         0x6c078965 + local_13c8;
    local_13c8 = local_13c8 + 1;
  } while (local_13c8 < 0x270);
  local_13c8 = 1;
  local_2748[0] = param_1 + 1;
  do {
    local_2748[local_13c8] =
         (local_2748[(longlong)local_13c8 + -1] >> 0x1e ^ local_2748[(longlong)local_13c8 + -1]) *
         0x6c078965 + local_13c8;
    local_13c8 = local_13c8 + 1;
  } while (local_13c8 < 0x270);
  uVar8 = 0;
  local_2758 = (ulonglong)param_2 << 0x20;
  puVar5 = local_2748;
  puVar6 = local_13b8;
  for (lVar4 = 0x1384; lVar4 != 0; lVar4 = lVar4 + -1) {
    *puVar6 = (char)*puVar5;
    puVar5 = (uint *)((longlong)puVar5 + 1);
    puVar6 = puVar6 + 1;
  }
  local_2750 = param_2;
  FUN_140275780(local_2748,local_13b8,&local_2758);
  lVar4 = *param_4;
  lVar2 = param_4[1] - lVar4 >> 0x3f;
  if ((param_4[1] - lVar4) / 0xc + lVar2 != lVar2) {
    uVar7 = 0;
    do {
      piVar1 = (int *)(lVar4 + 4 + uVar7 * 0xc);
      iVar3 = *(int *)(lVar4 + 4 + uVar7 * 0xc);
      while (0 < iVar3) {
        *piVar1 = *piVar1 + -1;
        if (-1 < *(int *)(*param_4 + 4 + uVar7 * 0xc)) {
          do {
            do {
              iVar3 = FUN_140275a40(local_2748,local_13c4,local_13bc);
            } while (iVar3 < 0);
          } while (((int)param_2 <= iVar3) || (*(char *)(iVar3 + param_3) != -1));
          *(char *)(iVar3 + param_3) = (char)uVar8;
        }
        piVar1 = (int *)(*param_4 + 4 + uVar7 * 0xc);
        iVar3 = *(int *)(*param_4 + 4 + uVar7 * 0xc);
      }
      lVar4 = *param_4;
      uVar8 = uVar8 + 1;
      uVar7 = (ulonglong)uVar8;
    } while (uVar7 < (ulonglong)((param_4[1] - lVar4) / 0xc));
  }
  return;
}



undefined8 FUN_1402755d0(longlong param_1)

{
  int iVar1;
  int iVar2;
  void *_Dst;
  undefined4 uVar3;
  longlong lVar4;
  undefined4 *puVar5;
  longlong lVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  uint uVar9;
  undefined8 uVar10;
  undefined4 *local_50;
  undefined4 *local_48;
  undefined4 *local_40;
  
  uVar10 = 0xfffffffffffffffe;
  iVar1 = *(int *)(param_1 + 4);
  _Dst = *(void **)(param_1 + 0x30);
  memset(_Dst,-1,(longlong)iVar1);
  puVar7 = (undefined4 *)0x0;
  local_50 = (undefined4 *)0x0;
  local_48 = (undefined4 *)0x0;
  puVar8 = (undefined4 *)0x0;
  local_40 = (undefined4 *)0x0;
  uVar9 = 0;
  if ((*(longlong *)(param_1 + 0x10) - *(longlong *)(param_1 + 8)) / 0xc != 0) {
    lVar6 = 0;
    do {
      puVar5 = (undefined4 *)(*(longlong *)(param_1 + 8) + lVar6);
      if ((puVar5 < local_48) && (puVar7 <= puVar5)) {
        lVar4 = ((longlong)puVar5 - (longlong)puVar7) / 6 +
                ((longlong)puVar5 - (longlong)puVar7 >> 0x3f);
        lVar4 = (lVar4 >> 1) - (lVar4 >> 0x3f);
        if (local_48 == puVar8) {
          FUN_140275840(&local_50);
          puVar7 = local_50;
          puVar8 = local_40;
        }
        if (local_48 != (undefined4 *)0x0) {
          *local_48 = puVar7[lVar4 * 3];
          local_48[1] = puVar7[lVar4 * 3 + 1];
          uVar3 = puVar7[lVar4 * 3 + 2];
LAB_1402756f7:
          local_48[2] = uVar3;
        }
      }
      else {
        if (local_48 == puVar8) {
          FUN_140275840(&local_50);
          puVar7 = local_50;
          puVar8 = local_40;
        }
        if (local_48 != (undefined4 *)0x0) {
          *local_48 = *puVar5;
          local_48[1] = puVar5[1];
          uVar3 = puVar5[2];
          goto LAB_1402756f7;
        }
      }
      local_48 = local_48 + 3;
      uVar9 = uVar9 + 1;
      lVar6 = lVar6 + 0xc;
    } while ((ulonglong)uVar9 <
             (ulonglong)((*(longlong *)(param_1 + 0x10) - *(longlong *)(param_1 + 8)) / 0xc));
  }
  iVar2 = *(int *)(param_1 + 0x28);
  *(int *)(param_1 + 0x28) = iVar2 + 1;
  FUN_1402753e0(iVar2,iVar1,_Dst,&local_50,uVar10);
  *(undefined4 *)(param_1 + 0x38) = 0;
  if (puVar7 != (undefined4 *)0x0) {
    operator_delete(puVar7);
  }
  return 0;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe

longlong FUN_140275780(longlong param_1,undefined1 *param_2,undefined4 *param_3)

{
  undefined1 *puVar1;
  longlong lVar2;
  undefined1 *puVar3;
  undefined1 local_2718 [5000];
  undefined1 local_1390 [4992];
  undefined8 uStack_10;
  
  uStack_10 = 0x14027579a;
  puVar1 = local_2718;
  for (lVar2 = 0x1384; lVar2 != 0; lVar2 = lVar2 + -1) {
    *puVar1 = *param_2;
    param_2 = param_2 + 1;
    puVar1 = puVar1 + 1;
  }
  puVar1 = (undefined1 *)FUN_140275820(local_1390,local_2718);
  puVar3 = local_2718;
  for (lVar2 = 0x1384; lVar2 != 0; lVar2 = lVar2 + -1) {
    *puVar3 = *puVar1;
    puVar1 = puVar1 + 1;
    puVar3 = puVar3 + 1;
  }
  FUN_140275820(param_1,local_2718);
  *(undefined4 *)(param_1 + 0x1384) = *param_3;
  *(undefined4 *)(param_1 + 5000) = param_3[1];
  *(undefined4 *)(param_1 + 0x138c) = param_3[2];
  return param_1;
}



void * FUN_140275820(void *param_1,void *param_2)

{
  memcpy(param_1,param_2,0x1384);
  return param_1;
}



void FUN_140275840(longlong *param_1)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = param_1[1] - *param_1;
  lVar2 = lVar2 / 6 + (lVar2 >> 0x3f);
  uVar4 = (lVar2 >> 1) - (lVar2 >> 0x3f);
  if (0x1555555555555554 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  uVar3 = (param_1[2] - *param_1) / 0xc;
  if (uVar3 < uVar4) {
    if (0x1555555555555555 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
      if (uVar4 != 0) {
        uVar3 = uVar4;
      }
      FUN_140275900(param_1,uVar3);
      return;
    }
    uVar3 = uVar3 + (uVar3 >> 1);
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140275900(param_1,uVar3);
  }
  return;
}



void FUN_140275900(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_1405d3608);
      }
    }
    pcVar3 = local_res10;
    FUN_1402533a0(*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;
}



int FUN_140275a40(undefined8 param_1,int param_2,uint param_3)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  ulonglong uVar5;
  longlong lVar6;
  uint uVar7;
  ulonglong uVar8;
  uint uVar9;
  
  uVar9 = 0;
  uVar2 = 1;
  lVar6 = 0x10;
  do {
    uVar1 = uVar2 << 1 | (uint)((int)uVar2 < 0);
    uVar9 = uVar9 | uVar2 | uVar1;
    uVar2 = uVar1 << 1 | (uint)((int)uVar1 < 0);
    lVar6 = lVar6 + -1;
  } while (lVar6 != 0);
  if (param_3 == 0) {
    return param_2;
  }
  if (uVar9 == param_3) {
    iVar3 = FUN_140275c00(param_1);
    return iVar3 + param_2;
  }
  if (uVar9 < param_3) {
    do {
      uVar2 = uVar9 + 1;
      if (param_3 == 0xffffffff) {
        uVar1 = (uint)(0xffffffff / (ulonglong)uVar2);
        if ((uint)(0xffffffff % (ulonglong)uVar2) == uVar9) {
          uVar1 = uVar1 + 1;
        }
      }
      else {
        uVar1 = (param_3 + 1) / uVar2;
      }
      uVar7 = 1;
      iVar4 = 0;
      iVar3 = 0;
      if (uVar1 != 0) {
        do {
          iVar4 = FUN_140275c00(param_1);
          iVar4 = iVar3 + iVar4 * uVar7;
          if (uVar9 * uVar7 == (param_3 - uVar7) + 1) {
            return iVar4;
          }
          uVar7 = uVar7 * uVar2;
          iVar3 = iVar4;
        } while (uVar7 <= uVar1);
      }
      uVar1 = FUN_140275c70(param_1,0,(ulonglong)param_3 / (ulonglong)uVar7,
                            (ulonglong)param_3 / (ulonglong)uVar7);
    } while ((((uint)(0xffffffff / (ulonglong)uVar7) < uVar1) ||
             (uVar2 = iVar4 + uVar1 * uVar7, uVar2 < uVar1 * uVar7)) || (param_3 < uVar2));
  }
  else {
    uVar2 = param_3 + 1;
    if (uVar9 == 0xffffffff) {
      uVar8 = 0xffffffff / (ulonglong)uVar2;
      if ((uint)(0xffffffff % (ulonglong)uVar2) == param_3) {
        uVar8 = (ulonglong)((int)uVar8 + 1);
      }
    }
    else {
      uVar8 = (ulonglong)(uVar9 + 1) / (ulonglong)uVar2;
    }
    do {
      uVar5 = FUN_140275c00(param_1);
      uVar2 = (uint)((uVar5 & 0xffffffff) / uVar8);
    } while (param_3 < uVar2);
  }
  return uVar2 + param_2;
}



uint FUN_140275c00(longlong param_1)

{
  uint uVar1;
  undefined8 uVar2;
  
  if (*(int *)(param_1 + 0x1380) == 0x270) {
    uVar2 = 0;
  }
  else {
    if (*(int *)(param_1 + 0x1380) < 0x4e0) goto LAB_140275c2b;
    uVar2 = 1;
  }
  FUN_140275e00(param_1,uVar2);
LAB_140275c2b:
  uVar1 = *(uint *)(param_1 + (longlong)*(int *)(param_1 + 0x1380) * 4);
  *(int *)(param_1 + 0x1380) = *(int *)(param_1 + 0x1380) + 1;
  uVar1 = uVar1 ^ uVar1 >> 0xb;
  uVar1 = uVar1 ^ (uVar1 & 0xff3a58ad) << 7;
  uVar1 = uVar1 ^ (uVar1 & 0xffffdf8c) << 0xf;
  return uVar1 >> 0x12 ^ uVar1;
}



int FUN_140275c70(undefined8 param_1,int param_2,undefined8 param_3,uint param_4)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  ulonglong uVar5;
  longlong lVar6;
  ulonglong uVar7;
  uint uVar8;
  uint uVar9;
  
  uVar8 = 0;
  uVar2 = 1;
  lVar6 = 0x10;
  do {
    uVar1 = uVar2 << 1 | (uint)((int)uVar2 < 0);
    uVar8 = uVar8 | uVar2 | uVar1;
    uVar2 = uVar1 << 1 | (uint)((int)uVar1 < 0);
    lVar6 = lVar6 + -1;
  } while (lVar6 != 0);
  if (param_4 == 0) {
    return param_2;
  }
  if (uVar8 == param_4) {
    iVar3 = FUN_140275c00(param_1);
    return iVar3 + param_2;
  }
  if (param_4 <= uVar8) {
    uVar2 = param_4 + 1;
    if (uVar8 == 0xffffffff) {
      uVar7 = 0xffffffff / (ulonglong)uVar2;
      if (0xffffffffU % uVar2 == param_4) {
        uVar7 = (ulonglong)((int)uVar7 + 1);
      }
    }
    else {
      uVar7 = (ulonglong)(uVar8 + 1) / (ulonglong)uVar2;
    }
    do {
      uVar5 = FUN_140275c00(param_1);
      uVar2 = (uint)((uVar5 & 0xffffffff) / uVar7);
    } while (param_4 < uVar2);
    return uVar2 + param_2;
  }
  do {
    uVar2 = uVar8 + 1;
    if (param_4 == 0xffffffff) {
      uVar1 = 0xffffffff / uVar2;
      if (0xffffffffU % uVar2 == uVar8) {
        uVar1 = uVar1 + 1;
      }
    }
    else {
      uVar1 = (param_4 + 1) / uVar2;
    }
    uVar2 = 1;
    iVar3 = 0;
    iVar4 = 0;
    if (uVar1 != 0) {
      do {
        iVar4 = FUN_140275c00(param_1);
        iVar4 = iVar3 + iVar4 * uVar2;
        if (uVar8 * uVar2 == (param_4 - uVar2) + 1) {
          return iVar4;
        }
        uVar2 = uVar2 * (uVar8 + 1);
        iVar3 = iVar4;
      } while (uVar2 <= uVar1);
    }
    uVar1 = FUN_140275c70(param_1,0,(ulonglong)param_4 / (ulonglong)uVar2,
                          (ulonglong)param_4 / (ulonglong)uVar2);
  } while ((((uint)(0xffffffff / (ulonglong)uVar2) < uVar1) ||
           (uVar9 = iVar4 + uVar1 * uVar2, uVar9 < uVar1 * uVar2)) || (param_4 < uVar9));
  return param_2 + uVar9;
}



undefined8 FUN_140275e00(uint *param_1,int param_2)

{
  char cVar1;
  undefined8 in_RAX;
  ulonglong uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  uint *puVar7;
  longlong lVar8;
  
  if (param_2 == 0) {
    lVar8 = 0x68;
    puVar7 = param_1 + 1;
    do {
      uVar4 = *puVar7;
      uVar5 = puVar7[1];
      uVar3 = (puVar7[-1] ^ uVar4) & 0x7fffffff ^ puVar7[-1];
      puVar7[0x26f] = -(uint)((uVar3 & 1) != 0) & 0x9908b0df ^ uVar3 >> 1 ^ puVar7[0x18c];
      uVar4 = (uVar4 ^ uVar5) & 0x7fffffff ^ uVar4;
      uVar3 = puVar7[2];
      puVar7[0x270] = -(uint)((uVar4 & 1) != 0) & 0x9908b0df ^ puVar7[0x18d] ^ uVar4 >> 1;
      uVar5 = (uVar3 ^ uVar5) & 0x7fffffff ^ uVar5;
      uVar4 = puVar7[3];
      puVar7[0x271] = -(uint)((uVar5 & 1) != 0) & 0x9908b0df ^ puVar7[0x18e] ^ uVar5 >> 1;
      uVar3 = (uVar4 ^ uVar3) & 0x7fffffff ^ uVar3;
      uVar5 = puVar7[4];
      puVar7[0x272] = -(uint)((uVar3 & 1) != 0) & 0x9908b0df ^ puVar7[399] ^ uVar3 >> 1;
      uVar4 = (uVar5 ^ uVar4) & 0x7fffffff ^ uVar4;
      puVar7[0x273] = -(uint)((uVar4 & 1) != 0) & 0x9908b0df ^ puVar7[400] ^ uVar4 >> 1;
      uVar5 = (puVar7[5] ^ uVar5) & 0x7fffffff ^ uVar5;
      uVar2 = (ulonglong)uVar5 & 0xffffffffffffff01;
      cVar1 = (char)uVar2;
      lVar8 = lVar8 + -1;
      puVar7[0x274] = -(uint)(cVar1 != '\0') & 0x9908b0df ^ puVar7[0x191] ^ uVar5 >> 1;
      puVar7 = puVar7 + 6;
    } while (lVar8 != 0);
    return CONCAT71((int7)(uVar2 >> 8),-cVar1);
  }
  if (param_2 == 1) {
    lVar8 = 0xe3;
    puVar7 = param_1 + 0x270;
    do {
      uVar4 = (puVar7[1] ^ *puVar7) & 0x7fffffff ^ *puVar7;
      lVar8 = lVar8 + -1;
      puVar7[-0x270] = -(uint)((uVar4 & 1) != 0) & 0x9908b0df ^ puVar7[0x18d] ^ uVar4 >> 1;
      puVar7 = puVar7 + 1;
    } while (lVar8 != 0);
    lVar8 = 0x42;
    puVar7 = param_1 + 0x354;
    do {
      uVar4 = *puVar7;
      uVar5 = puVar7[1];
      uVar3 = puVar7[3];
      uVar6 = (puVar7[-1] ^ uVar4) & 0x7fffffff ^ puVar7[-1];
      puVar7[-0x271] = -(uint)((uVar6 & 1) != 0) & 0x9908b0df ^ uVar6 >> 1 ^ puVar7[-0x354];
      uVar4 = (uVar5 ^ uVar4) & 0x7fffffff ^ uVar4;
      uVar6 = puVar7[2];
      puVar7[-0x270] = -(uint)((uVar4 & 1) != 0) & 0x9908b0df ^ puVar7[-0x353] ^ uVar4 >> 1;
      uVar5 = (uVar6 ^ uVar5) & 0x7fffffff ^ uVar5;
      uVar4 = puVar7[4];
      puVar7[-0x26f] = -(uint)((uVar5 & 1) != 0) & 0x9908b0df ^ puVar7[-0x352] ^ uVar5 >> 1;
      uVar6 = (uVar3 ^ uVar6) & 0x7fffffff ^ uVar6;
      puVar7[-0x26e] = -(uint)((uVar6 & 1) != 0) & 0x9908b0df ^ puVar7[-0x351] ^ uVar6 >> 1;
      uVar3 = (uVar4 ^ uVar3) & 0x7fffffff ^ uVar3;
      puVar7[-0x26d] = -(uint)((uVar3 & 1) != 0) & 0x9908b0df ^ puVar7[-0x350] ^ uVar3 >> 1;
      uVar4 = (puVar7[5] ^ uVar4) & 0x7fffffff ^ uVar4;
      lVar8 = lVar8 + -1;
      puVar7[-0x26c] = -(uint)((uVar4 & 1) != 0) & 0x9908b0df ^ puVar7[-0x34f] ^ uVar4 >> 1;
      puVar7 = puVar7 + 6;
    } while (lVar8 != 0);
    param_1[0x4e0] = 0;
    uVar4 = (param_1[0x4df] ^ *param_1) & 0x7fffffff ^ param_1[0x4df];
    uVar2 = (ulonglong)uVar4 & 0xffffffffffffff01;
    cVar1 = (char)uVar2;
    in_RAX = CONCAT71((int7)(uVar2 >> 8),-cVar1);
    param_1[0x26f] = -(uint)(cVar1 != '\0') & 0x9908b0df ^ param_1[0x18c] ^ uVar4 >> 1;
  }
  return in_RAX;
}



void FUN_140276130(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  if (param_1[9] != 0) {
    FUN_140278fc0();
  }
  if (param_1[5] != 0) {
    FUN_14008d0a0(param_1[5],param_1[6],param_3,param_4,uVar1);
    operator_delete((void *)param_1[5]);
  }
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 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;
}



// WARNING: Removing unreachable block (ram,0x000140278517)

undefined8 FUN_1402761b0(longlong param_1,short *param_2)

{
  short sVar1;
  wchar_t wVar2;
  undefined4 uVar3;
  ulonglong *puVar4;
  void *pvVar5;
  uint uVar6;
  undefined4 uVar7;
  int iVar8;
  undefined4 *puVar9;
  longlong lVar10;
  undefined4 *puVar11;
  short *psVar12;
  undefined4 *puVar13;
  undefined4 *puVar14;
  undefined4 *puVar15;
  undefined4 *puVar16;
  int *piVar17;
  wchar_t *pwVar18;
  undefined8 uVar19;
  float *pfVar20;
  longlong lVar21;
  short *psVar22;
  short *psVar23;
  short *psVar24;
  short *psVar25;
  ulonglong uVar26;
  longlong *plVar27;
  undefined4 *puVar28;
  ulonglong uVar29;
  ulonglong uVar30;
  wchar_t *pwVar31;
  short *psVar32;
  double dVar33;
  wchar_t *local_5e8;
  wchar_t *local_5e0;
  undefined8 local_5d8;
  wchar_t *local_5c8;
  longlong local_5c0;
  undefined4 *local_5b8;
  longlong *local_5b0;
  ulonglong *local_5a8;
  ulonglong *local_5a0;
  undefined2 local_598;
  undefined6 uStack_596;
  undefined8 local_588;
  ulonglong local_580;
  void *local_570;
  longlong local_568;
  undefined8 local_560;
  undefined2 local_550;
  undefined6 uStack_54e;
  undefined8 local_540;
  ulonglong local_538;
  ulonglong *local_528;
  ulonglong *local_520;
  undefined4 *local_518;
  undefined4 *local_510;
  undefined4 *local_508;
  undefined2 local_500;
  undefined6 uStack_4fe;
  undefined8 local_4f0;
  ulonglong local_4e8;
  ulonglong *local_4d8;
  ulonglong *local_4d0;
  undefined4 *local_4c8;
  undefined4 *local_4c0;
  undefined4 *local_4b8;
  undefined2 local_4b0;
  undefined6 uStack_4ae;
  undefined8 local_4a0;
  ulonglong local_498;
  undefined8 local_488;
  undefined1 local_480 [24];
  undefined1 local_468 [32];
  wchar_t local_448 [256];
  wchar_t local_248 [264];
  
  local_488 = 0xfffffffffffffffe;
  local_498 = 7;
  puVar28 = (undefined4 *)0x0;
  local_4a0 = 0;
  local_4b0 = 0;
  if ((DAT_140607c18 == (undefined4 *)0x0) &&
     (puVar9 = operator_new(0x28), DAT_140607c18 = puVar28, puVar9 != (undefined4 *)0x0)) {
    *(undefined8 *)(puVar9 + 6) = 7;
    *(undefined8 *)(puVar9 + 4) = 0;
    *(undefined2 *)puVar9 = 0;
    DAT_140607c18 = puVar9;
  }
  FUN_1400015e0(&local_4b0,DAT_140607c18,0,0xffffffffffffffff);
  FUN_140002aa0(&local_4b0,&DAT_14049a36c,1);
  uVar26 = 0xffffffffffffffff;
  psVar12 = param_2;
  do {
    if (uVar26 == 0) break;
    uVar26 = uVar26 - 1;
    sVar1 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1,param_2,~uVar26 - 1);
  lVar10 = FUN_1402933b0(DAT_140607ff0,param_2);
  local_5c0 = lVar10;
  if (lVar10 == 0) {
    if (7 < local_498) {
      operator_delete((void *)CONCAT62(uStack_4ae,local_4b0));
    }
    uVar19 = 0;
  }
  else {
    local_5b0 = (longlong *)(lVar10 + 0x68);
    if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
      puVar9 = puVar28;
      plVar27 = (longlong *)*local_5b0;
      do {
        if (*plVar27 != 0) {
          puVar28 = (undefined4 *)((longlong *)*local_5b0)[(longlong)puVar9];
          break;
        }
        uVar6 = (int)puVar9 + 1;
        puVar9 = (undefined4 *)(ulonglong)uVar6;
        plVar27 = plVar27 + 1;
      } while (uVar6 < *(uint *)(lVar10 + 0x78));
    }
LAB_1402762f8:
    puVar9 = (undefined4 *)0x0;
    local_5b8 = puVar28;
    if (puVar28 != (undefined4 *)0x0) {
      uVar3 = *puVar28;
      local_5a8 = (ulonglong *)0x0;
      local_5c8 = operator_new(0x338);
      puVar11 = puVar9;
      if (local_5c8 != (void *)0x0) {
        puVar11 = (undefined4 *)FUN_140278560(local_5c8);
      }
      if (puVar11 == (undefined4 *)0x0) {
        local_5a8 = (ulonglong *)0x0;
      }
      else {
        local_5a8 = operator_new(0x10);
        *local_5a8 = (ulonglong)puVar11;
        *(undefined4 *)(local_5a8 + 1) = 1;
      }
      puVar4 = local_5a8;
      puVar11 = puVar9;
      if (local_5a8 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*local_5a8;
      }
      *puVar11 = 0;
      puVar11[0xc] = 0;
      *(undefined8 *)(puVar11 + 0x2c) = 0;
      *(undefined8 *)(puVar11 + 0x2e) = 0;
      *(undefined8 *)(puVar11 + 0x30) = 0;
      *(undefined8 *)(puVar11 + 0x32) = 0;
      *(undefined8 *)(puVar11 + 0x34) = 0;
      *(undefined2 *)(puVar11 + 0x36) = 0;
      *(undefined8 *)(puVar11 + 0x37) = 0;
      *(undefined8 *)(puVar11 + 0x39) = 0;
      *(undefined8 *)(puVar11 + 0x3b) = 0;
      *(undefined8 *)(puVar11 + 0x3f) = 0;
      *(undefined8 *)(puVar11 + 0x41) = 0;
      puVar11[0x43] = 0;
      *(undefined1 *)(puVar11 + 0x44) = 0;
      *(undefined8 *)(puVar11 + 0x78) = 0;
      *(undefined8 *)(puVar11 + 0x84) = 0;
      *(undefined8 *)(puVar11 + 0x86) = 0;
      *(undefined8 *)(puVar11 + 0x88) = 0;
      *(undefined8 *)(puVar11 + 0xbc) = 0;
      *(undefined8 *)(puVar11 + 0xbe) = 0;
      *(undefined8 *)(puVar11 + 0xc0) = 0;
      *(undefined8 *)(puVar11 + 0xcc) = 0x42480000;
      puVar11 = puVar9;
      if (local_5a8 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*local_5a8;
      }
      *puVar11 = uVar3;
      local_5a0 = local_5a8;
      uVar7 = FUN_1402970c0(lVar10,L"szName");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szName",1);
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      uVar26 = 0xffffffffffffffff;
      psVar22 = psVar12;
      do {
        if (uVar26 == 0) break;
        uVar26 = uVar26 - 1;
        sVar1 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar1 != 0);
      FUN_140001710(puVar11 + 2,psVar12,~uVar26 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"nMotionCategory");
      puVar13 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nMotionCategory",1);
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      puVar11[0xc] = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szReadyMotion");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szReadyMotion",1);
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      uVar26 = 0xffffffffffffffff;
      psVar22 = psVar12;
      do {
        if (uVar26 == 0) break;
        uVar26 = uVar26 - 1;
        sVar1 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar1 != 0);
      FUN_140001710(puVar11 + 0xe,psVar12,~uVar26 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"fReadyDuration");
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fReadyDuration",1);
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      puVar11[0x2c] = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szCastingAttack");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szCastingAttack",0);
      if (psVar12 != (short *)0x0) {
        puVar11 = puVar9;
        if (puVar4 != (ulonglong *)0x0) {
          puVar11 = (undefined4 *)*puVar4;
        }
        uVar26 = 0xffffffffffffffff;
        psVar22 = psVar12;
        do {
          if (uVar26 == 0) break;
          uVar26 = uVar26 - 1;
          sVar1 = *psVar22;
          psVar22 = psVar22 + 1;
        } while (sVar1 != 0);
        FUN_140001710(puVar11 + 0x18,psVar12,~uVar26 - 1);
      }
      uVar7 = FUN_1402970c0(lVar10,L"szChargeAttack");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szChargeAttack",0);
      if (psVar12 != (short *)0x0) {
        puVar11 = puVar9;
        if (puVar4 != (ulonglong *)0x0) {
          puVar11 = (undefined4 *)*puVar4;
        }
        uVar26 = 0xffffffffffffffff;
        psVar22 = psVar12;
        do {
          if (uVar26 == 0) break;
          uVar26 = uVar26 - 1;
          sVar1 = *psVar22;
          psVar22 = psVar22 + 1;
        } while (sVar1 != 0);
        FUN_140001710(puVar11 + 0x22,psVar12,~uVar26 - 1);
      }
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      puVar11[0x2d] = 0;
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      puVar11[0x2e] = 0;
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      puVar11[0x2f] = 0;
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      puVar11[0x30] = 0;
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      puVar11[0x31] = 0;
      puVar11 = puVar9;
      if (puVar4 != (ulonglong *)0x0) {
        puVar11 = (undefined4 *)*puVar4;
      }
      puVar11[0x32] = 0;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      puVar9[0x3f] = 0;
      uVar7 = FUN_1402970c0(lVar10,L"fRisingAttackAngle");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fRisingAttackAngle",1);
      uVar7 = FUN_1402970c0(lVar10,L"fRisingAttackDist");
      puVar11 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fRisingAttackDist",1);
      uVar7 = FUN_1402970c0(lVar10,L"fRisingDamageAngle");
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fRisingDamageAngle",1);
      uVar7 = FUN_1402970c0(lVar10,L"fRisingDamageDist");
      puVar14 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fRisingDamageDist",1);
      uVar7 = FUN_1402970c0(lVar10,L"fSkyDamageAngle");
      puVar15 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fSkyDamageAngle",1);
      uVar7 = FUN_1402970c0(lVar10,L"fSkyDamageDist");
      puVar16 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fSkyDamageDist",1);
      if (puVar9 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0xb4) = *puVar9;
      }
      if (puVar11 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0xb8) = *puVar11;
      }
      if (puVar13 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0xbc) = *puVar13;
      }
      if (puVar14 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0xc0) = *puVar14;
      }
      if (puVar15 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0xc4) = *puVar15;
      }
      if (puVar16 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 200) = *puVar16;
      }
      uVar7 = FUN_1402970c0(lVar10,&DAT_1404b72b8);
      puVar9 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,&DAT_1404b72b8,1);
      uVar26 = 0;
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0xcc) = *puVar9;
      uVar7 = FUN_1402970c0(lVar10,L"nFrustumCheck");
      piVar17 = (int *)FUN_140296600(lVar10,uVar3,uVar7,L"nFrustumCheck",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(bool *)(uVar30 + 0xd8) = *piVar17 != 0;
      uVar7 = FUN_1402970c0(lVar10,L"nNoGuard");
      piVar17 = (int *)FUN_140296600(lVar10,uVar3,uVar7,L"nNoGuard",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(bool *)(uVar30 + 0xd9) = *piVar17 != 0;
      uVar7 = FUN_1402970c0(lVar10,L"fHitDelay");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fHitDelay",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0xd4) = *puVar9;
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0xdc) = 0;
      uVar7 = FUN_1402970c0(lVar10,L"szAttackType");
      pwVar18 = (wchar_t *)FUN_140296990(lVar10,uVar3,uVar7,L"szAttackType",1);
      iVar8 = _wcsicmp(pwVar18,L"MELEE");
      if (iVar8 == 0) {
        if (puVar4 != (ulonglong *)0x0) {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0xdc) = 1;
      }
      else {
        iVar8 = _wcsicmp(pwVar18,L"RANGE");
        if (iVar8 == 0) {
          if (puVar4 != (ulonglong *)0x0) {
            uVar26 = *puVar4;
          }
          *(undefined4 *)(uVar26 + 0xdc) = 2;
        }
        else {
          iVar8 = _wcsicmp(pwVar18,L"CHARGE");
          if (iVar8 == 0) {
            if (puVar4 != (ulonglong *)0x0) {
              uVar26 = *puVar4;
            }
            *(undefined4 *)(uVar26 + 0xdc) = 3;
          }
          else {
            iVar8 = _wcsicmp(pwVar18,L"AREA");
            if (iVar8 == 0) {
              if (puVar4 != (ulonglong *)0x0) {
                uVar26 = *puVar4;
              }
              *(undefined4 *)(uVar26 + 0xdc) = 4;
            }
            else {
              iVar8 = _wcsicmp(pwVar18,L"CASTING");
              if (iVar8 == 0) {
                if (puVar4 != (ulonglong *)0x0) {
                  uVar26 = *puVar4;
                }
                *(undefined4 *)(uVar26 + 0xdc) = 5;
              }
              else {
                iVar8 = _wcsicmp(pwVar18,L"CATCH");
                if (iVar8 == 0) {
                  if (puVar4 != (ulonglong *)0x0) {
                    uVar26 = *puVar4;
                  }
                  *(undefined4 *)(uVar26 + 0xdc) = 7;
                }
                else {
                  iVar8 = _wcsicmp(pwVar18,L"CATCH_ATTACK");
                  if (iVar8 == 0) {
                    if (puVar4 != (ulonglong *)0x0) {
                      uVar26 = *puVar4;
                    }
                    *(undefined4 *)(uVar26 + 0xdc) = 8;
                  }
                  else {
                    iVar8 = _wcsicmp(pwVar18,L"GUARD");
                    if (iVar8 == 0) {
                      if (puVar4 != (ulonglong *)0x0) {
                        uVar26 = *puVar4;
                      }
                      *(undefined4 *)(uVar26 + 0xdc) = 6;
                    }
                    else {
                      iVar8 = _wcsicmp(pwVar18,L"CASTING_CANCEL");
                      if (iVar8 == 0) {
                        if (puVar4 != (ulonglong *)0x0) {
                          uVar26 = *puVar4;
                        }
                        *(undefined4 *)(uVar26 + 0xdc) = 9;
                      }
                      else {
                        iVar8 = wcsncmp(pwVar18,L"SNAP",4);
                        if (iVar8 == 0) {
                          if (puVar4 != (ulonglong *)0x0) {
                            uVar26 = *puVar4;
                          }
                          *(undefined4 *)(uVar26 + 0xdc) = 10;
                          local_570 = (void *)0x0;
                          local_568 = 0;
                          local_560 = 0;
                          FUN_140415b90(&local_570,pwVar18,&DAT_14049c7b8);
                          lVar21 = local_568;
                          pvVar5 = local_570;
                          uVar26 = (local_568 - (longlong)local_570) / 0x28;
                          if (uVar26 == 2) {
                            pwVar18 = (wchar_t *)((longlong)local_570 + 0x28);
                            if (7 < *(ulonglong *)((longlong)local_570 + 0x40)) {
                              pwVar18 = *(wchar_t **)pwVar18;
                            }
                            if (puVar4 == (ulonglong *)0x0) {
                              uVar30 = 0;
                            }
                            else {
                              uVar30 = *puVar4;
                            }
                            dVar33 = _wtof(pwVar18);
                            *(float *)(uVar30 + 0x330) = (float)dVar33;
                          }
                          if (2 < uVar26) {
                            pwVar18 = (wchar_t *)((longlong)pvVar5 + 0x50);
                            if (7 < *(ulonglong *)((longlong)pvVar5 + 0x68)) {
                              pwVar18 = *(wchar_t **)pwVar18;
                            }
                            if (puVar4 == (ulonglong *)0x0) {
                              uVar26 = 0;
                            }
                            else {
                              uVar26 = *puVar4;
                            }
                            dVar33 = _wtof(pwVar18);
                            *(float *)(uVar26 + 0x334) = (float)dVar33;
                          }
                          if (pvVar5 != (void *)0x0) {
                            FUN_14008d0a0(pvVar5,lVar21);
                            operator_delete(pvVar5);
                          }
                          local_570 = (void *)0x0;
                          local_568 = 0;
                          local_560 = 0;
                        }
                        else {
                          iVar8 = _wcsicmp(pwVar18,L"SELF_DESTURCT");
                          if (iVar8 == 0) {
                            if (puVar4 != (ulonglong *)0x0) {
                              uVar26 = *puVar4;
                            }
                            *(undefined4 *)(uVar26 + 0xdc) = 0xe;
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      uVar26 = 0;
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0xe0) = 0;
      uVar7 = FUN_1402970c0(lVar10,L"szDamageType");
      pwVar18 = (wchar_t *)FUN_140296990(lVar10,uVar3,uVar7,L"szDamageType",1);
      iVar8 = _wcsicmp(pwVar18,L"PHYSICAL");
      if (iVar8 == 0) {
        uVar30 = uVar26;
        if (puVar4 != (ulonglong *)0x0) {
          uVar30 = *puVar4;
        }
        *(undefined4 *)(uVar30 + 0xe0) = 1;
      }
      else {
        iVar8 = _wcsicmp(pwVar18,L"MAGIC");
        if (iVar8 == 0) {
          uVar30 = uVar26;
          if (puVar4 != (ulonglong *)0x0) {
            uVar30 = *puVar4;
          }
          *(undefined4 *)(uVar30 + 0xe0) = 2;
        }
        else {
          iVar8 = _wcsicmp(pwVar18,L"LIGHT");
          if (iVar8 == 0) {
            uVar30 = uVar26;
            if (puVar4 != (ulonglong *)0x0) {
              uVar30 = *puVar4;
            }
            *(undefined4 *)(uVar30 + 0xe0) = 5;
          }
          else {
            iVar8 = _wcsicmp(pwVar18,L"DARKNESS");
            if (iVar8 == 0) {
              uVar30 = uVar26;
              if (puVar4 != (ulonglong *)0x0) {
                uVar30 = *puVar4;
              }
              *(undefined4 *)(uVar30 + 0xe0) = 6;
            }
            else {
              iVar8 = _wcsicmp(pwVar18,L"EARTH");
              if (iVar8 == 0) {
                uVar30 = uVar26;
                if (puVar4 != (ulonglong *)0x0) {
                  uVar30 = *puVar4;
                }
                *(undefined4 *)(uVar30 + 0xe0) = 7;
              }
              else {
                iVar8 = _wcsicmp(pwVar18,L"WATER");
                if (iVar8 == 0) {
                  uVar30 = uVar26;
                  if (puVar4 != (ulonglong *)0x0) {
                    uVar30 = *puVar4;
                  }
                  *(undefined4 *)(uVar30 + 0xe0) = 4;
                }
                else {
                  iVar8 = _wcsicmp(pwVar18,L"FIRE");
                  if (iVar8 == 0) {
                    uVar30 = uVar26;
                    if (puVar4 != (ulonglong *)0x0) {
                      uVar30 = *puVar4;
                    }
                    *(undefined4 *)(uVar30 + 0xe0) = 3;
                  }
                  else {
                    iVar8 = _wcsicmp(pwVar18,L"WINDY");
                    if (iVar8 == 0) {
                      uVar30 = uVar26;
                      if (puVar4 != (ulonglong *)0x0) {
                        uVar30 = *puVar4;
                      }
                      *(undefined4 *)(uVar30 + 0xe0) = 8;
                    }
                    else {
                      iVar8 = _wcsicmp(pwVar18,L"TOXICATION");
                      if (iVar8 == 0) {
                        uVar30 = uVar26;
                        if (puVar4 != (ulonglong *)0x0) {
                          uVar30 = *puVar4;
                        }
                        *(undefined4 *)(uVar30 + 0xe0) = 9;
                      }
                      else {
                        iVar8 = _wcsicmp(pwVar18,L"LIGHTNING");
                        if (iVar8 == 0) {
                          uVar30 = uVar26;
                          if (puVar4 != (ulonglong *)0x0) {
                            uVar30 = *puVar4;
                          }
                          *(undefined4 *)(uVar30 + 0xe0) = 10;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"szJumpAttackType");
      uVar19 = FUN_140296990(lVar10,uVar3,uVar7,L"szJumpAttackType",1);
      memset(local_448,0,0x200);
      local_5e8 = (wchar_t *)0x0;
      local_5e0 = (wchar_t *)0x0;
      local_5d8 = 0;
      FUN_140415930(&local_5e8,uVar19,&DAT_14049c7b8);
      pwVar18 = local_5e8;
      uVar30 = uVar26;
      if (local_5e8 != local_5e0) {
        do {
          iVar8 = (int)uVar30;
          if (iVar8 == 0) {
            pwVar31 = pwVar18;
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              pwVar31 = *(wchar_t **)pwVar18;
            }
            wcscpy_s(local_448,0x100,pwVar31);
          }
          else if (iVar8 == 1) {
            pwVar31 = pwVar18;
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              pwVar31 = *(wchar_t **)pwVar18;
            }
            wcscpy_s(local_248,0x100,pwVar31);
            uVar30 = uVar26;
            if (puVar4 != (ulonglong *)0x0) {
              uVar30 = *puVar4;
            }
            uVar29 = 0xffffffffffffffff;
            pwVar31 = local_248;
            do {
              if (uVar29 == 0) break;
              uVar29 = uVar29 - 1;
              wVar2 = *pwVar31;
              pwVar31 = pwVar31 + 1;
            } while (wVar2 != L'\0');
            FUN_140001710(uVar30 + 0x308,local_248,~uVar29 - 1);
          }
          pwVar18 = pwVar18 + 0x14;
          uVar30 = (ulonglong)(iVar8 + 1);
        } while (pwVar18 != local_5e0);
      }
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0xe4) = 0;
      iVar8 = _wcsicmp(local_448,L"RISING");
      if (iVar8 == 0) {
        uVar30 = uVar26;
        if (puVar4 != (ulonglong *)0x0) {
          uVar30 = *puVar4;
        }
        *(undefined4 *)(uVar30 + 0xe4) = 1;
      }
      else {
        iVar8 = _wcsicmp(local_448,L"JUMP");
        if (iVar8 == 0) {
          uVar30 = uVar26;
          if (puVar4 != (ulonglong *)0x0) {
            uVar30 = *puVar4;
          }
          *(undefined4 *)(uVar30 + 0xe4) = 3;
        }
        else {
          iVar8 = _wcsicmp(local_448,L"JUMP_DOWN");
          if (iVar8 == 0) {
            uVar30 = uVar26;
            if (puVar4 != (ulonglong *)0x0) {
              uVar30 = *puVar4;
            }
            *(undefined4 *)(uVar30 + 0xe4) = 2;
          }
          else {
            iVar8 = _wcsicmp(local_448,L"MIDAIR");
            if (iVar8 == 0) {
              uVar30 = uVar26;
              if (puVar4 != (ulonglong *)0x0) {
                uVar30 = *puVar4;
              }
              *(undefined4 *)(uVar30 + 0xe4) = 4;
            }
            else {
              iVar8 = _wcsicmp(local_448,L"MIDAIR_DOWN");
              if (iVar8 == 0) {
                uVar30 = uVar26;
                if (puVar4 != (ulonglong *)0x0) {
                  uVar30 = *puVar4;
                }
                *(undefined4 *)(uVar30 + 0xe4) = 5;
              }
              else {
                iVar8 = _wcsicmp(local_448,L"ROLLING_JUMP_DOWN");
                if (iVar8 == 0) {
                  uVar30 = uVar26;
                  if (puVar4 != (ulonglong *)0x0) {
                    uVar30 = *puVar4;
                  }
                  *(undefined4 *)(uVar30 + 0xe4) = 6;
                }
              }
            }
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"szEnemyJumpAttackType");
      pwVar18 = (wchar_t *)FUN_140296990(lVar10,uVar3,uVar7,L"szEnemyJumpAttackType",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0xe8) = 0;
      iVar8 = _wcsicmp(pwVar18,L"RISING");
      if (iVar8 == 0) {
        uVar30 = uVar26;
        if (puVar4 != (ulonglong *)0x0) {
          uVar30 = *puVar4;
        }
        *(undefined4 *)(uVar30 + 0xe8) = 1;
      }
      else {
        iVar8 = _wcsicmp(pwVar18,L"THROW");
        if (iVar8 == 0) {
          uVar30 = uVar26;
          if (puVar4 != (ulonglong *)0x0) {
            uVar30 = *puVar4;
          }
          *(undefined4 *)(uVar30 + 0xe8) = 7;
        }
        else {
          iVar8 = _wcsicmp(pwVar18,L"DOWN");
          if (iVar8 == 0) {
            uVar30 = uVar26;
            if (puVar4 != (ulonglong *)0x0) {
              uVar30 = *puVar4;
            }
            *(undefined4 *)(uVar30 + 0xe8) = 8;
          }
          else {
            iVar8 = _wcsicmp(pwVar18,L"BOUNCE");
            if (iVar8 == 0) {
              uVar30 = uVar26;
              if (puVar4 != (ulonglong *)0x0) {
                uVar30 = *puVar4;
              }
              *(undefined4 *)(uVar30 + 0xe8) = 9;
            }
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"szSoundType");
      pwVar18 = (wchar_t *)FUN_140296990(lVar10,uVar3,uVar7,L"szSoundType",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0xec) = 0;
      iVar8 = _wcsicmp(pwVar18,L"WEAPON");
      if (iVar8 == 0) {
        uVar30 = uVar26;
        if (puVar4 != (ulonglong *)0x0) {
          uVar30 = *puVar4;
        }
        *(undefined4 *)(uVar30 + 0xec) = 10;
      }
      else {
        iVar8 = _wcsicmp(pwVar18,L"SWORD");
        if (iVar8 == 0) {
          uVar30 = uVar26;
          if (puVar4 != (ulonglong *)0x0) {
            uVar30 = *puVar4;
          }
          *(undefined4 *)(uVar30 + 0xec) = 1;
        }
        else {
          iVar8 = _wcsicmp(pwVar18,L"AXE");
          if (iVar8 == 0) {
            uVar30 = uVar26;
            if (puVar4 != (ulonglong *)0x0) {
              uVar30 = *puVar4;
            }
            *(undefined4 *)(uVar30 + 0xec) = 2;
          }
          else {
            iVar8 = _wcsicmp(pwVar18,L"LANCE");
            if (iVar8 == 0) {
              uVar30 = uVar26;
              if (puVar4 != (ulonglong *)0x0) {
                uVar30 = *puVar4;
              }
              *(undefined4 *)(uVar30 + 0xec) = 3;
            }
            else {
              iVar8 = _wcsicmp(pwVar18,L"STAFF");
              if (iVar8 == 0) {
                uVar30 = uVar26;
                if (puVar4 != (ulonglong *)0x0) {
                  uVar30 = *puVar4;
                }
                *(undefined4 *)(uVar30 + 0xec) = 4;
              }
              else {
                iVar8 = _wcsicmp(pwVar18,L"ARROW");
                if (iVar8 == 0) {
                  uVar30 = uVar26;
                  if (puVar4 != (ulonglong *)0x0) {
                    uVar30 = *puVar4;
                  }
                  *(undefined4 *)(uVar30 + 0xec) = 5;
                }
                else {
                  iVar8 = _wcsicmp(pwVar18,L"WINDY");
                  if (iVar8 == 0) {
                    uVar30 = uVar26;
                    if (puVar4 != (ulonglong *)0x0) {
                      uVar30 = *puVar4;
                    }
                    *(undefined4 *)(uVar30 + 0xec) = 6;
                  }
                  else {
                    iVar8 = _wcsicmp(pwVar18,L"EARTH");
                    if (iVar8 == 0) {
                      uVar30 = uVar26;
                      if (puVar4 != (ulonglong *)0x0) {
                        uVar30 = *puVar4;
                      }
                      *(undefined4 *)(uVar30 + 0xec) = 7;
                    }
                    else {
                      iVar8 = _wcsicmp(pwVar18,L"FIRE");
                      if (iVar8 == 0) {
                        uVar30 = uVar26;
                        if (puVar4 != (ulonglong *)0x0) {
                          uVar30 = *puVar4;
                        }
                        *(undefined4 *)(uVar30 + 0xec) = 8;
                      }
                      else {
                        iVar8 = _wcsicmp(pwVar18,L"WATER");
                        if (iVar8 == 0) {
                          uVar30 = uVar26;
                          if (puVar4 != (ulonglong *)0x0) {
                            uVar30 = *puVar4;
                          }
                          *(undefined4 *)(uVar30 + 0xec) = 9;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"nPriority");
      puVar9 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nPriority",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0xf0) = *puVar9;
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      if (*(int *)(uVar30 + 0xf0) == -2) {
        uVar30 = uVar26;
        if (puVar4 != (ulonglong *)0x0) {
          uVar30 = *puVar4;
        }
        *(undefined4 *)(uVar30 + 0xf0) = 20000;
      }
      else if (*(int *)(uVar30 + 0xf0) == -1) {
        uVar30 = uVar26;
        if (puVar4 != (ulonglong *)0x0) {
          uVar30 = *puVar4;
        }
        *(undefined4 *)(uVar30 + 0xf0) = 10000;
      }
      uVar7 = FUN_1402970c0(lVar10,L"fPriorityStartFrame");
      pfVar20 = (float *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fPriorityStartFrame",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(float *)(uVar30 + 0xf4) = *pfVar20 / 30.0;
      uVar7 = FUN_1402970c0(lVar10,L"fPriorityEndFrame");
      pfVar20 = (float *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fPriorityEndFrame",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(float *)(uVar30 + 0xf8) = *pfVar20 / 30.0;
      uVar7 = FUN_1402970c0(lVar10,L"fHitRange");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fHitRange",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0x100) = *puVar9;
      uVar7 = FUN_1402970c0(lVar10,L"fSkillProbability");
      lVar21 = FUN_1402967b0(lVar10,uVar3,uVar7,L"fSkillProbability",0);
      if (lVar21 != 0) {
        uVar7 = FUN_1402970c0(lVar10,L"fSkillProbability");
        puVar9 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fSkillProbability",1);
        uVar30 = uVar26;
        if (puVar4 != (ulonglong *)0x0) {
          uVar30 = *puVar4;
        }
        *(undefined4 *)(uVar30 + 0xfc) = *puVar9;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nDamageAngle");
      puVar9 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nDamageAngle",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0x104) = *puVar9;
      uVar7 = FUN_1402970c0(lVar10,L"fDamageWeight");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fDamageWeight",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0x108) = *puVar9;
      uVar7 = FUN_1402970c0(lVar10,L"nHitLevel");
      puVar9 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nHitLevel",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(undefined4 *)(uVar30 + 0x10c) = *puVar9;
      uVar7 = FUN_1402970c0(lVar10,L"nDownHit");
      piVar17 = (int *)FUN_140296600(lVar10,uVar3,uVar7,L"nDownHit",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      *(bool *)(uVar30 + 0x110) = *piVar17 != 0;
      uVar7 = FUN_1402970c0(lVar10,L"szAttackDummyName");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szAttackDummyName",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      uVar29 = 0xffffffffffffffff;
      psVar22 = psVar12;
      do {
        if (uVar29 == 0) break;
        uVar29 = uVar29 - 1;
        sVar1 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar1 != 0);
      FUN_140001710(uVar30 + 0x118,psVar12,~uVar29 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szAttackDummyGroupName");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szAttackDummyGroupName",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      uVar29 = 0xffffffffffffffff;
      psVar22 = psVar12;
      do {
        if (uVar29 == 0) break;
        uVar29 = uVar29 - 1;
        sVar1 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar1 != 0);
      FUN_140001710(uVar30 + 0x140,psVar12,~uVar29 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szDamageMotion");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szDamageMotion",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      uVar29 = 0xffffffffffffffff;
      psVar22 = psVar12;
      do {
        if (uVar29 == 0) break;
        uVar29 = uVar29 - 1;
        sVar1 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar1 != 0);
      FUN_140001710(uVar30 + 0x168,psVar12,~uVar29 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szDamageMotion2");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szDamageMotion2",1);
      uVar30 = uVar26;
      if (puVar4 != (ulonglong *)0x0) {
        uVar30 = *puVar4;
      }
      uVar29 = 0xffffffffffffffff;
      psVar22 = psVar12;
      do {
        if (uVar29 == 0) break;
        uVar29 = uVar29 - 1;
        sVar1 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar1 != 0);
      FUN_140001710(uVar30 + 400,psVar12,~uVar29 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szSkyDamageMotion");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szSkyDamageMotion",1);
      if (puVar4 != (ulonglong *)0x0) {
        uVar26 = *puVar4;
      }
      uVar30 = 0xffffffffffffffff;
      psVar22 = psVar12;
      do {
        if (uVar30 == 0) break;
        uVar30 = uVar30 - 1;
        sVar1 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar1 != 0);
      FUN_140001710(uVar26 + 0x1b8,psVar12,~uVar30 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szDamageEffectType");
      local_5c8 = (wchar_t *)FUN_140296990(lVar10,uVar3,uVar7,L"szDamageEffectType",1);
      uVar7 = FUN_1402970c0(lVar10,L"fFollowEnemyRange");
      local_508 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar7,L"fFollowEnemyRange",1);
      uVar7 = FUN_1402970c0(lVar10,L"szJustGuardStateMotion");
      psVar12 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szJustGuardStateMotion",0);
      uVar7 = FUN_1402970c0(lVar10,L"szDownStateMotion");
      psVar22 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szDownStateMotion",0);
      uVar7 = FUN_1402970c0(lVar10,L"szMiddleStateMotion");
      psVar23 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szMiddleStateMotion",0);
      uVar7 = FUN_1402970c0(lVar10,L"szDamageStateMotion");
      psVar24 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szDamageStateMotion",0);
      uVar7 = FUN_1402970c0(lVar10,L"szSkyDamageStateMotion");
      psVar25 = (short *)FUN_140296990(lVar10,uVar3,uVar7,L"szSkyDamageStateMotion",0);
      lVar10 = local_5c0;
      uVar7 = FUN_1402970c0(local_5c0,L"nJustGuardStateMotionCategory");
      local_4c8 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nJustGuardStateMotionCategory",0)
      ;
      uVar7 = FUN_1402970c0(lVar10,L"nDownStateMotionCategory");
      local_518 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nDownStateMotionCategory",0);
      uVar7 = FUN_1402970c0(lVar10,L"nMiddleStateMotionCategory");
      local_510 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nMiddleStateMotionCategory",0);
      uVar7 = FUN_1402970c0(lVar10,L"nDamageStateMotionCategory");
      local_4b8 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nDamageStateMotionCategory",0);
      uVar7 = FUN_1402970c0(lVar10,L"nSkyDamageStateMotionCategory");
      local_4c0 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nSkyDamageStateMotionCategory",0)
      ;
      if (psVar12 != (short *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        uVar30 = 0xffffffffffffffff;
        psVar32 = psVar12;
        do {
          if (uVar30 == 0) break;
          uVar30 = uVar30 - 1;
          sVar1 = *psVar32;
          psVar32 = psVar32 + 1;
        } while (sVar1 != 0);
        FUN_140001710(uVar26 + 0x228,psVar12,~uVar30 - 1);
      }
      if (psVar22 != (short *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        uVar30 = 0xffffffffffffffff;
        psVar12 = psVar22;
        do {
          if (uVar30 == 0) break;
          uVar30 = uVar30 - 1;
          sVar1 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar1 != 0);
        FUN_140001710(uVar26 + 0x250,psVar22,~uVar30 - 1);
      }
      if (psVar23 != (short *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        uVar30 = 0xffffffffffffffff;
        psVar12 = psVar23;
        do {
          if (uVar30 == 0) break;
          uVar30 = uVar30 - 1;
          sVar1 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar1 != 0);
        FUN_140001710(uVar26 + 0x278,psVar23,~uVar30 - 1);
      }
      if (psVar24 != (short *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        uVar30 = 0xffffffffffffffff;
        psVar12 = psVar24;
        do {
          if (uVar30 == 0) break;
          uVar30 = uVar30 - 1;
          sVar1 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar1 != 0);
        FUN_140001710(uVar26 + 0x2a0,psVar24,~uVar30 - 1);
      }
      if (psVar25 != (short *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        uVar30 = 0xffffffffffffffff;
        psVar12 = psVar25;
        do {
          if (uVar30 == 0) break;
          uVar30 = uVar30 - 1;
          sVar1 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar1 != 0);
        FUN_140001710(uVar26 + 0x2c8,psVar25,~uVar30 - 1);
      }
      lVar10 = local_5c0;
      if (local_4c8 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0x2f0) = *local_4c8;
      }
      if (local_518 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0x2f4) = *local_518;
      }
      if (local_510 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0x2f8) = *local_510;
      }
      if (local_4b8 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0x2fc) = *local_4b8;
      }
      if (local_4c0 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0x300) = *local_4c0;
      }
      uVar7 = FUN_1402970c0(local_5c0,L"nReadyMotionCategory");
      puVar9 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nReadyMotionCategory",0);
      pwVar18 = local_5c8;
      if (puVar9 != (undefined4 *)0x0) {
        if (puVar4 == (ulonglong *)0x0) {
          uVar26 = 0;
        }
        else {
          uVar26 = *puVar4;
        }
        *(undefined4 *)(uVar26 + 0x304) = *puVar9;
      }
      puVar11 = (undefined4 *)0x0;
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      puVar9[0x87] = 0x43480000;
      if (local_508 != (undefined4 *)0x0) {
        puVar9 = puVar11;
        if (puVar4 != (ulonglong *)0x0) {
          puVar9 = (undefined4 *)*puVar4;
        }
        puVar9[0x87] = *local_508;
      }
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      puVar9[0x78] = 0;
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      puVar9[0x79] = 0;
      iVar8 = _wcsicmp(local_5c8,L"WEAPON1");
      if (iVar8 == 0) {
        puVar9 = puVar11;
        if (puVar4 != (ulonglong *)0x0) {
          puVar9 = (undefined4 *)*puVar4;
        }
        puVar9[0x78] = 1;
        puVar9 = puVar11;
        if (puVar4 != (ulonglong *)0x0) {
          puVar9 = (undefined4 *)*puVar4;
        }
        puVar9[0x79] = 0;
      }
      else {
        iVar8 = _wcsicmp(pwVar18,L"WEAPON2");
        if (iVar8 == 0) {
          puVar9 = puVar11;
          if (puVar4 != (ulonglong *)0x0) {
            puVar9 = (undefined4 *)*puVar4;
          }
          puVar9[0x78] = 1;
          puVar9 = puVar11;
          if (puVar4 != (ulonglong *)0x0) {
            puVar9 = (undefined4 *)*puVar4;
          }
          puVar9[0x79] = 1;
        }
        else {
          iVar8 = _wcsicmp(pwVar18,L"WEAPON3");
          if (iVar8 == 0) {
            puVar9 = puVar11;
            if (puVar4 != (ulonglong *)0x0) {
              puVar9 = (undefined4 *)*puVar4;
            }
            puVar9[0x78] = 1;
            puVar9 = puVar11;
            if (puVar4 != (ulonglong *)0x0) {
              puVar9 = (undefined4 *)*puVar4;
            }
            puVar9[0x79] = 2;
          }
          else {
            iVar8 = _wcsicmp(pwVar18,L"WEAPON4");
            if (iVar8 == 0) {
              puVar9 = puVar11;
              if (puVar4 != (ulonglong *)0x0) {
                puVar9 = (undefined4 *)*puVar4;
              }
              puVar9[0x78] = 1;
              puVar9 = puVar11;
              if (puVar4 != (ulonglong *)0x0) {
                puVar9 = (undefined4 *)*puVar4;
              }
              puVar9[0x79] = 3;
            }
            else {
              iVar8 = _wcsicmp(pwVar18,L"WEAPON5");
              if (iVar8 == 0) {
                puVar9 = puVar11;
                if (puVar4 != (ulonglong *)0x0) {
                  puVar9 = (undefined4 *)*puVar4;
                }
                puVar9[0x78] = 1;
                puVar9 = puVar11;
                if (puVar4 != (ulonglong *)0x0) {
                  puVar9 = (undefined4 *)*puVar4;
                }
                puVar9[0x79] = 4;
              }
              else {
                iVar8 = _wcsicmp(pwVar18,L"EFFECT");
                if (iVar8 == 0) {
                  puVar9 = puVar11;
                  if (puVar4 != (ulonglong *)0x0) {
                    puVar9 = (undefined4 *)*puVar4;
                  }
                  puVar9[0x78] = 2;
                }
              }
            }
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"szCorpseType");
      pwVar18 = (wchar_t *)FUN_140296990(lVar10,uVar3,uVar7,L"szCorpseType",0);
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      puVar9[0x84] = 0;
      if ((pwVar18 != (wchar_t *)0x0) &&
         (iVar8 = _wcsicmp(pwVar18,L"CORPSE_TYPE_EXPLOSION"), iVar8 == 0)) {
        puVar9 = puVar11;
        if (puVar4 != (ulonglong *)0x0) {
          puVar9 = (undefined4 *)*puVar4;
        }
        puVar9[0x84] = 1;
      }
      uVar7 = FUN_1402970c0(lVar10,L"szCondition");
      pwVar18 = (wchar_t *)FUN_140296990(lVar10,uVar3,uVar7,L"szCondition",0);
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      puVar9[0x85] = 0;
      if (pwVar18 != (wchar_t *)0x0) {
        iVar8 = _wcsicmp(pwVar18,L"BLOODING");
        if (iVar8 == 0) {
          puVar9 = puVar11;
          if (puVar4 != (ulonglong *)0x0) {
            puVar9 = (undefined4 *)*puVar4;
          }
          puVar9[0x85] = 1;
        }
        else {
          iVar8 = _wcsicmp(pwVar18,L"CHAOS");
          if (iVar8 == 0) {
            puVar9 = puVar11;
            if (puVar4 != (ulonglong *)0x0) {
              puVar9 = (undefined4 *)*puVar4;
            }
            puVar9[0x85] = 0xb;
          }
          else {
            iVar8 = _wcsicmp(pwVar18,L"COLD");
            if (iVar8 == 0) {
              puVar9 = puVar11;
              if (puVar4 != (ulonglong *)0x0) {
                puVar9 = (undefined4 *)*puVar4;
              }
              puVar9[0x85] = 2;
            }
            else {
              iVar8 = _wcsicmp(pwVar18,L"FIRE");
              if (iVar8 == 0) {
                puVar9 = puVar11;
                if (puVar4 != (ulonglong *)0x0) {
                  puVar9 = (undefined4 *)*puVar4;
                }
                puVar9[0x85] = 3;
              }
              else {
                iVar8 = _wcsicmp(pwVar18,L"FREEZING");
                if (iVar8 == 0) {
                  puVar9 = puVar11;
                  if (puVar4 != (ulonglong *)0x0) {
                    puVar9 = (undefined4 *)*puVar4;
                  }
                  puVar9[0x85] = 6;
                }
                else {
                  iVar8 = _wcsicmp(pwVar18,L"HOLD");
                  if (iVar8 == 0) {
                    puVar9 = puVar11;
                    if (puVar4 != (ulonglong *)0x0) {
                      puVar9 = (undefined4 *)*puVar4;
                    }
                    puVar9[0x85] = 0xe;
                  }
                  else {
                    iVar8 = _wcsicmp(pwVar18,L"SICKNESS");
                    if (iVar8 == 0) {
                      puVar9 = puVar11;
                      if (puVar4 != (ulonglong *)0x0) {
                        puVar9 = (undefined4 *)*puVar4;
                      }
                      puVar9[0x85] = 9;
                    }
                    else {
                      iVar8 = _wcsicmp(pwVar18,L"SLEEP");
                      if (iVar8 == 0) {
                        puVar9 = puVar11;
                        if (puVar4 != (ulonglong *)0x0) {
                          puVar9 = (undefined4 *)*puVar4;
                        }
                        puVar9[0x85] = 10;
                      }
                      else {
                        iVar8 = _wcsicmp(pwVar18,L"SLOW");
                        if (iVar8 == 0) {
                          puVar9 = puVar11;
                          if (puVar4 != (ulonglong *)0x0) {
                            puVar9 = (undefined4 *)*puVar4;
                          }
                          puVar9[0x85] = 7;
                        }
                        else {
                          iVar8 = _wcsicmp(pwVar18,L"STONE");
                          if (iVar8 == 0) {
                            puVar9 = puVar11;
                            if (puVar4 != (ulonglong *)0x0) {
                              puVar9 = (undefined4 *)*puVar4;
                            }
                            puVar9[0x85] = 5;
                          }
                          else {
                            iVar8 = _wcsicmp(pwVar18,L"STUN");
                            if (iVar8 == 0) {
                              puVar9 = puVar11;
                              if (puVar4 != (ulonglong *)0x0) {
                                puVar9 = (undefined4 *)*puVar4;
                              }
                              puVar9[0x85] = 4;
                            }
                            else {
                              iVar8 = _wcsicmp(pwVar18,L"TOXICATION");
                              if (iVar8 == 0) {
                                puVar9 = puVar11;
                                if (puVar4 != (ulonglong *)0x0) {
                                  puVar9 = (undefined4 *)*puVar4;
                                }
                                puVar9[0x85] = 8;
                              }
                              else {
                                iVar8 = _wcsicmp(pwVar18,L"DARKNESS");
                                if (iVar8 == 0) {
                                  puVar9 = puVar11;
                                  if (puVar4 != (ulonglong *)0x0) {
                                    puVar9 = (undefined4 *)*puVar4;
                                  }
                                  puVar9[0x85] = 0xd;
                                }
                                else {
                                  iVar8 = _wcsicmp(pwVar18,L"LIGHTNING");
                                  if (iVar8 == 0) {
                                    puVar9 = puVar11;
                                    if (puVar4 != (ulonglong *)0x0) {
                                      puVar9 = (undefined4 *)*puVar4;
                                    }
                                    puVar9[0x85] = 0xc;
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      puVar9[0x86] = 0;
      uVar7 = FUN_1402970c0(lVar10,L"nConditionLevel");
      puVar9 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nConditionLevel",0);
      if (puVar9 != (undefined4 *)0x0) {
        puVar13 = puVar11;
        if (puVar4 != (ulonglong *)0x0) {
          puVar13 = (undefined4 *)*puVar4;
        }
        puVar13[0x86] = *puVar9;
      }
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      puVar9[0x88] = 0;
      uVar7 = FUN_1402970c0(lVar10,L"nShootID");
      puVar9 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nShootID",0);
      if (puVar9 != (undefined4 *)0x0) {
        puVar13 = puVar11;
        if (puVar4 != (ulonglong *)0x0) {
          puVar13 = (undefined4 *)*puVar4;
        }
        puVar13[0x88] = *puVar9;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nIKApply");
      puVar9 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar7,L"nIKApply",0);
      if (puVar9 != (undefined4 *)0x0) {
        puVar13 = puVar11;
        if (puVar4 != (ulonglong *)0x0) {
          puVar13 = (undefined4 *)*puVar4;
        }
        puVar13[0x89] = *puVar9;
      }
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      local_580 = 7;
      local_588 = 0;
      local_598 = 0;
      FUN_1400015e0(&local_598,puVar9 + 2,0,0xffffffffffffffff);
      FUN_140002aa0(&local_598,&DAT_1404b7c6c,2);
      puVar9 = puVar11;
      if (puVar4 != (ulonglong *)0x0) {
        puVar9 = (undefined4 *)*puVar4;
      }
      FUN_140123f40(&local_598,1,*(short *)(puVar9 + 0xc) + 0x30);
      local_4e8 = 7;
      local_4f0 = 0;
      local_500 = 0;
      FUN_1400015e0(&local_500,&local_598,0,0xffffffffffffffff);
      if (puVar4 != (ulonglong *)0x0) {
        LOCK();
        *(int *)(puVar4 + 1) = (int)puVar4[1] + 1;
        UNLOCK();
        puVar28 = local_5b8;
      }
      local_538 = 7;
      local_540 = 0;
      local_550 = 0;
      local_4d8 = puVar4;
      local_4d0 = puVar4;
      FUN_14008ff90(&local_550,&local_500);
      local_528 = local_4d8;
      local_520 = local_4d8;
      puVar9 = puVar28;
      if (local_4d8 != (ulonglong *)0x0) {
        LOCK();
        *(int *)(local_4d8 + 1) = (int)local_4d8[1] + 1;
        UNLOCK();
        puVar9 = local_5b8;
      }
      if (*(longlong *)(param_1 + 0x68) == 0) {
        FUN_1402792d0(param_1 + 0x48,local_480,&local_550);
      }
      else {
        FUN_140279170(param_1 + 0x48,local_468,&local_550,&local_550);
      }
      FUN_1401975d0(&local_528);
      if (7 < local_538) {
        operator_delete((void *)CONCAT62(uStack_54e,local_550));
      }
      local_538 = 7;
      local_540 = 0;
      local_550 = 0;
      FUN_1401975d0(&local_4d8);
      if (7 < local_4e8) {
        operator_delete((void *)CONCAT62(uStack_4fe,local_500));
      }
      local_4e8 = 7;
      local_4f0 = 0;
      local_500 = 0;
      if (7 < local_580) {
        operator_delete((void *)CONCAT62(uStack_596,local_598));
      }
      local_580 = 7;
      local_588 = 0;
      local_598 = 0;
      if (local_5e8 != (wchar_t *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_5e8);
        FUN_14008d0a0(local_5e8);
        operator_delete(local_5e8);
      }
      local_5e8 = (wchar_t *)0x0;
      local_5e0 = (wchar_t *)0x0;
      local_5d8 = 0;
      FUN_1401975d0(&local_5a8);
      puVar28 = *(undefined4 **)(puVar9 + 6);
      if (puVar28 == (undefined4 *)0x0) {
        uVar6 = (uint)puVar9[8] % *(uint *)(lVar10 + 0x78) + 1;
        lVar21 = (longlong)(int)uVar6 << 3;
        puVar28 = puVar11;
        do {
          if (*(uint *)(lVar10 + 0x78) <= uVar6) break;
          if (*(longlong *)(lVar21 + *(longlong *)(lVar10 + 0x68)) != 0) {
            puVar28 = *(undefined4 **)(lVar21 + *(longlong *)(lVar10 + 0x68));
          }
          uVar6 = uVar6 + 1;
          lVar21 = lVar21 + 8;
        } while (puVar28 == (undefined4 *)0x0);
      }
      goto LAB_1402762f8;
    }
    if (7 < local_498) {
      operator_delete((void *)CONCAT62(uStack_4ae,local_4b0));
    }
    uVar19 = 1;
  }
  return uVar19;
}



longlong FUN_140278560(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x50) = 7;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined2 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x78) = 7;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined2 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 7;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined2 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0x130) = 7;
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined2 *)(param_1 + 0x118) = 0;
  *(undefined8 *)(param_1 + 0x158) = 7;
  *(undefined8 *)(param_1 + 0x150) = 0;
  *(undefined2 *)(param_1 + 0x140) = 0;
  _eh_vector_constructor_iterator_
            ((void *)(param_1 + 0x168),0x28,2,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  *(undefined8 *)(param_1 + 0x1d0) = 7;
  *(undefined8 *)(param_1 + 0x1c8) = 0;
  *(undefined2 *)(param_1 + 0x1b8) = 0;
  *(undefined8 *)(param_1 + 0x200) = 7;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined2 *)(param_1 + 0x1e8) = 0;
  *(undefined8 *)(param_1 + 0x240) = 7;
  *(undefined8 *)(param_1 + 0x238) = 0;
  *(undefined2 *)(param_1 + 0x228) = 0;
  *(undefined8 *)(param_1 + 0x268) = 7;
  *(undefined8 *)(param_1 + 0x260) = 0;
  *(undefined2 *)(param_1 + 0x250) = 0;
  *(undefined8 *)(param_1 + 0x290) = 7;
  *(undefined8 *)(param_1 + 0x288) = 0;
  *(undefined2 *)(param_1 + 0x278) = 0;
  *(undefined8 *)(param_1 + 0x2b8) = 7;
  *(undefined8 *)(param_1 + 0x2b0) = 0;
  *(undefined2 *)(param_1 + 0x2a0) = 0;
  *(undefined8 *)(param_1 + 0x2e0) = 7;
  *(undefined8 *)(param_1 + 0x2d8) = 0;
  *(undefined2 *)(param_1 + 0x2c8) = 0;
  *(undefined8 *)(param_1 + 800) = 7;
  *(undefined8 *)(param_1 + 0x318) = 0;
  *(undefined2 *)(param_1 + 0x308) = 0;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x000140278d54)

longlong *
FUN_140278700(longlong param_1,longlong *param_2,short *param_3,int param_4,int param_5,char param_6
             ,char param_7)

{
  short sVar1;
  ushort uVar2;
  void *pvVar3;
  longlong lVar4;
  ushort *puVar5;
  ulonglong *puVar6;
  ulonglong uVar7;
  ushort *puVar8;
  ulonglong *puVar9;
  int iVar10;
  short *psVar11;
  ulonglong uVar12;
  ushort local_e8;
  undefined6 uStack_e6;
  longlong local_d8;
  ulonglong local_d0;
  ulonglong *local_c0;
  ulonglong *local_b8;
  ushort local_b0;
  undefined6 uStack_ae;
  longlong local_a0;
  ulonglong local_98;
  ulonglong local_80;
  ulonglong local_70;
  undefined8 local_68;
  ulonglong local_58;
  undefined8 local_50;
  
  local_68 = 0xfffffffffffffffe;
  uVar12 = 0;
  local_98 = 7;
  local_a0 = 0;
  local_b0 = 0;
  uVar7 = 0xffffffffffffffff;
  psVar11 = param_3;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    sVar1 = *psVar11;
    psVar11 = psVar11 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_b0,param_3,~uVar7 - 1);
  FUN_140002aa0(&local_b0,&DAT_1404b7c6c,2);
  FUN_140123f40(&local_b0,1,param_4 + 0x30);
  local_58 = uVar12;
  if (*(longlong *)(param_1 + 0x68) != 0) {
    puVar8 = &local_b0;
    if (7 < local_98) {
      puVar8 = (ushort *)CONCAT62(uStack_ae,local_b0);
    }
    puVar5 = &local_b0;
    uVar7 = uVar12;
    if (7 < local_98) {
      puVar5 = (ushort *)CONCAT62(uStack_ae,local_b0);
    }
    for (; puVar5 != puVar8 + local_a0; puVar5 = puVar5 + 1) {
      uVar2 = *puVar5;
      uVar7 = uVar7 ^ (uVar7 >> 2) + uVar7 * 0x40 + 0x9e3779b9 + (ulonglong)uVar2;
    }
    local_58 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x48) +
                             (uVar7 % *(ulonglong *)(param_1 + 0x50)) * 8,&local_b0);
  }
  local_50 = 0;
  local_d0 = 7;
  local_d8 = 0;
  local_e8 = 0;
  if (local_58 == 0) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    puVar9 = *(ulonglong **)(local_58 + 0x30);
    if (puVar9 != (ulonglong *)0x0) {
      LOCK();
      *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
      UNLOCK();
    }
    local_c0 = puVar9;
    local_b8 = puVar9;
    if (param_5 == 0x1d) {
      uVar7 = uVar12;
      if (puVar9 != (ulonglong *)0x0) {
        uVar7 = *puVar9;
      }
      FUN_1400015e0(&local_e8,uVar7 + 0x2a0,0,0xffffffffffffffff);
      uVar7 = uVar12;
      if (puVar9 != (ulonglong *)0x0) {
        uVar7 = *puVar9;
      }
      iVar10 = *(int *)(uVar7 + 0x2fc);
    }
    else if (param_5 == 0x20) {
      uVar7 = uVar12;
      if (puVar9 != (ulonglong *)0x0) {
        uVar7 = *puVar9;
      }
      FUN_1400015e0(&local_e8,uVar7 + 0x250,0,0xffffffffffffffff);
      uVar7 = uVar12;
      if (puVar9 != (ulonglong *)0x0) {
        uVar7 = *puVar9;
      }
      iVar10 = *(int *)(uVar7 + 0x2f4);
    }
    else if (param_5 == 0x23) {
      uVar7 = uVar12;
      if (puVar9 != (ulonglong *)0x0) {
        uVar7 = *puVar9;
      }
      FUN_1400015e0(&local_e8,uVar7 + 0x2c8,0,0xffffffffffffffff);
      uVar7 = uVar12;
      if (puVar9 != (ulonglong *)0x0) {
        uVar7 = *puVar9;
      }
      iVar10 = *(int *)(uVar7 + 0x300);
    }
    else {
      if (param_6 == '\0') {
        if (param_7 != '\0') {
          uVar7 = uVar12;
          if (puVar9 != (ulonglong *)0x0) {
            uVar7 = *puVar9;
          }
          FUN_1400015e0(&local_e8,uVar7 + 0x228,0,0xffffffffffffffff);
          uVar7 = uVar12;
          if (puVar9 != (ulonglong *)0x0) {
            uVar7 = *puVar9;
          }
          iVar10 = *(int *)(uVar7 + 0x2f0);
          FUN_140002aa0(&local_e8,&DAT_1404b7c6c,2);
          FUN_140123f40(&local_e8,1,iVar10 + 0x30);
          if (*(longlong *)(param_1 + 0x68) != 0) {
            puVar8 = &local_e8;
            if (7 < local_d0) {
              puVar8 = (ushort *)CONCAT62(uStack_e6,local_e8);
            }
            puVar5 = &local_e8;
            if (7 < local_d0) {
              puVar5 = (ushort *)CONCAT62(uStack_e6,local_e8);
            }
            for (; puVar5 != puVar8 + local_d8; puVar5 = puVar5 + 1) {
              uVar12 = uVar12 ^ (uVar12 >> 2) + uVar12 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar5;
            }
            uVar12 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x48) +
                                   (uVar12 % *(ulonglong *)(param_1 + 0x50)) * 8,&local_e8);
          }
          puVar6 = local_c0;
          local_80 = uVar12;
          if (uVar12 != 0) {
            lVar4 = *(longlong *)(uVar12 + 0x30);
            *param_2 = lVar4;
            param_2[1] = lVar4;
            if (lVar4 != 0) {
              LOCK();
              *(int *)(lVar4 + 8) = *(int *)(lVar4 + 8) + 1;
              UNLOCK();
              puVar9 = local_c0;
            }
            if (puVar9 != (ulonglong *)0x0) {
              LOCK();
              puVar9 = puVar9 + 1;
              *(int *)puVar9 = (int)*puVar9 + -1;
              UNLOCK();
              if ((int)*puVar9 == 0) {
                pvVar3 = (void *)*local_c0;
                if (pvVar3 != (void *)0x0) {
                  FUN_140197310(pvVar3);
                  operator_delete(pvVar3);
                }
                operator_delete(puVar6);
              }
            }
            if (7 < local_d0) {
              operator_delete((void *)CONCAT62(uStack_e6,local_e8));
            }
            goto LAB_140278dbd;
          }
        }
        puVar6 = local_c0;
        *param_2 = (longlong)puVar9;
        param_2[1] = (longlong)puVar9;
        if (puVar9 != (ulonglong *)0x0) {
          LOCK();
          *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
          UNLOCK();
          puVar9 = local_c0;
        }
        if (puVar9 != (ulonglong *)0x0) {
          LOCK();
          puVar9 = puVar9 + 1;
          *(int *)puVar9 = (int)*puVar9 + -1;
          UNLOCK();
          if ((int)*puVar9 == 0) {
            pvVar3 = (void *)*local_c0;
            if (pvVar3 != (void *)0x0) {
              FUN_140197310(pvVar3);
              operator_delete(pvVar3);
            }
            operator_delete(puVar6);
          }
        }
        if (7 < local_d0) {
          operator_delete((void *)CONCAT62(uStack_e6,local_e8));
        }
        goto LAB_140278dbd;
      }
      uVar7 = uVar12;
      if (puVar9 != (ulonglong *)0x0) {
        uVar7 = *puVar9;
      }
      FUN_1400015e0(&local_e8,uVar7 + 0x278,0,0xffffffffffffffff);
      uVar7 = uVar12;
      if (puVar9 != (ulonglong *)0x0) {
        uVar7 = *puVar9;
      }
      iVar10 = *(int *)(uVar7 + 0x2f8);
    }
    puVar6 = local_c0;
    if (local_d8 == 0) {
      *param_2 = (longlong)puVar9;
      param_2[1] = (longlong)puVar9;
      if (puVar9 != (ulonglong *)0x0) {
        LOCK();
        *(int *)(puVar9 + 1) = (int)puVar9[1] + 1;
        UNLOCK();
        puVar9 = local_c0;
      }
      if (puVar9 != (ulonglong *)0x0) {
        LOCK();
        puVar9 = puVar9 + 1;
        *(int *)puVar9 = (int)*puVar9 + -1;
        UNLOCK();
        if ((int)*puVar9 == 0) {
          pvVar3 = (void *)*local_c0;
          if (pvVar3 != (void *)0x0) {
            FUN_140197310(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar6);
        }
      }
      if (7 < local_d0) {
        operator_delete((void *)CONCAT62(uStack_e6,local_e8));
      }
    }
    else {
      FUN_140002aa0(&local_e8,&DAT_1404b7c6c,2);
      FUN_140123f40(&local_e8,1,iVar10 + 0x30);
      if (*(longlong *)(param_1 + 0x68) != 0) {
        puVar8 = &local_e8;
        if (7 < local_d0) {
          puVar8 = (ushort *)CONCAT62(uStack_e6,local_e8);
        }
        puVar5 = &local_e8;
        if (7 < local_d0) {
          puVar5 = (ushort *)CONCAT62(uStack_e6,local_e8);
        }
        for (; puVar5 != puVar8 + local_d8; puVar5 = puVar5 + 1) {
          uVar12 = uVar12 ^ (uVar12 >> 2) + uVar12 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar5;
        }
        uVar12 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x48) +
                               (uVar12 % *(ulonglong *)(param_1 + 0x50)) * 8,&local_e8);
      }
      puVar6 = local_c0;
      local_70 = uVar12;
      if (uVar12 == 0) {
        *param_2 = 0;
        param_2[1] = 0;
        if (puVar9 != (ulonglong *)0x0) {
          LOCK();
          puVar9 = puVar9 + 1;
          *(int *)puVar9 = (int)*puVar9 + -1;
          UNLOCK();
          if ((int)*puVar9 == 0) {
            pvVar3 = (void *)*local_c0;
            if (pvVar3 != (void *)0x0) {
              FUN_140197310(pvVar3);
              operator_delete(pvVar3);
            }
            operator_delete(puVar6);
          }
        }
        if (7 < local_d0) {
          operator_delete((void *)CONCAT62(uStack_e6,local_e8));
        }
      }
      else {
        lVar4 = *(longlong *)(uVar12 + 0x30);
        *param_2 = lVar4;
        param_2[1] = lVar4;
        if (lVar4 != 0) {
          LOCK();
          *(int *)(lVar4 + 8) = *(int *)(lVar4 + 8) + 1;
          UNLOCK();
          puVar9 = local_c0;
        }
        if (puVar9 != (ulonglong *)0x0) {
          LOCK();
          puVar9 = puVar9 + 1;
          *(int *)puVar9 = (int)*puVar9 + -1;
          UNLOCK();
          if ((int)*puVar9 == 0) {
            pvVar3 = (void *)*local_c0;
            if (pvVar3 != (void *)0x0) {
              FUN_140197310(pvVar3);
              operator_delete(pvVar3);
            }
            operator_delete(puVar6);
          }
        }
        if (7 < local_d0) {
          operator_delete((void *)CONCAT62(uStack_e6,local_e8));
        }
      }
    }
  }
LAB_140278dbd:
  local_d0 = 7;
  local_d8 = 0;
  local_e8 = 0;
  if (7 < local_98) {
    operator_delete((void *)CONCAT62(uStack_ae,local_b0));
  }
  return param_2;
}



void FUN_140278df0(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_1406080b4;
      while (DAT_1406080b4 = 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_140197310(pvVar6);
                  operator_delete(pvVar6);
                }
                operator_delete(puVar5);
              }
            }
          }
          else {
            DAT_1406080b4 = 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_1406080b4;
      }
    }
    param_1[4] = 0;
    param_1[6] = puVar2;
  }
  return;
}



void FUN_140278fa0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140278fc0();
  }
  return;
}



void FUN_140278fc0(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;
  
  puVar10 = (undefined8 *)*param_1;
  puVar2 = puVar10 + param_1[1];
  for (; puVar10 != puVar2; puVar10 = puVar10 + 1) {
    puVar3 = (undefined8 *)*puVar10;
    *puVar10 = 0;
    iVar7 = DAT_1406080b4;
    while (DAT_1406080b4 = 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_140197310(pvVar6);
                operator_delete(pvVar6);
              }
              operator_delete(puVar5);
            }
          }
        }
        else {
          DAT_1406080b4 = 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_1406080b4;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



longlong * FUN_140279170(longlong *param_1,longlong *param_2,undefined8 param_3,longlong param_4)

{
  char cVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar6;
  undefined8 uVar7;
  longlong *local_48;
  longlong *local_40;
  undefined2 local_38;
  
  uVar7 = 0xfffffffffffffffe;
  uVar2 = FUN_14015afa0(param_3);
  plVar5 = (longlong *)(*param_1 + (uVar2 % (ulonglong)param_1[1]) * 8);
  lVar3 = FUN_1402cb0b0(plVar5,param_3);
  if (lVar3 == 0) {
    local_40 = (longlong *)0x0;
    local_38 = 0;
    local_48 = param_1;
    FUN_1402796e0(&local_48);
    plVar6 = local_40;
    plVar4 = local_40 + 1;
    if (plVar4 != (longlong *)0x0) {
      local_40[4] = 7;
      local_40[3] = 0;
      *(undefined2 *)plVar4 = 0;
      FUN_1400015e0(plVar4,param_4,0,0xffffffffffffffff,uVar7,plVar4);
      lVar3 = *(longlong *)(param_4 + 0x28);
      plVar6[6] = lVar3;
      plVar6[7] = lVar3;
      if (lVar3 != 0) {
        LOCK();
        *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
        UNLOCK();
        plVar6 = local_40;
      }
    }
    local_38 = CONCAT11(1,(undefined1)local_38);
    cVar1 = FUN_140279460(param_1);
    if (cVar1 != '\0') {
      plVar5 = (longlong *)(*param_1 + (uVar2 % (ulonglong)param_1[1]) * 8);
    }
    *plVar6 = *plVar5;
    *plVar5 = (longlong)plVar6;
    param_1[4] = param_1[4] + 1;
    plVar4 = (longlong *)param_1[6];
    if (plVar5 < (longlong *)param_1[6]) {
      plVar4 = plVar5;
    }
    param_1[6] = (longlong)plVar4;
    *param_2 = (longlong)plVar5;
    param_2[1] = (longlong)plVar6;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)plVar5;
    param_2[1] = lVar3;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



longlong * FUN_1402792d0(longlong *param_1,longlong *param_2,longlong param_3)

{
  undefined8 *puVar1;
  ulonglong *puVar2;
  longlong *plVar3;
  ulonglong uVar4;
  longlong lVar5;
  ulonglong *puVar6;
  undefined8 *puVar7;
  ulonglong local_res20;
  undefined8 uVar8;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  uVar8 = 0xfffffffffffffffe;
  local_38 = (undefined8 *)0x0;
  local_30 = 0;
  local_40 = param_1;
  FUN_1402796e0(&local_40);
  puVar7 = local_38;
  puVar1 = local_38 + 1;
  if (puVar1 != (undefined8 *)0x0) {
    local_38[4] = 7;
    local_38[3] = 0;
    *(undefined2 *)puVar1 = 0;
    FUN_1400015e0(puVar1,param_3,0,0xffffffffffffffff,uVar8);
    lVar5 = *(longlong *)(param_3 + 0x28);
    puVar7[6] = lVar5;
    puVar7[7] = lVar5;
    if (lVar5 != 0) {
      LOCK();
      *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
      UNLOCK();
      puVar7 = local_38;
    }
  }
  local_30 = CONCAT11(1,(undefined1)local_30);
  uVar4 = FUN_14015afa0(puVar1);
  if (*param_1 == 0) {
    local_res20 = FUN_1402c9710(param_1,1);
    puVar2 = (ulonglong *)(param_1 + 1);
    puVar6 = &local_res20;
    if (local_res20 <= *puVar2) {
      puVar6 = puVar2;
    }
    *puVar2 = *puVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else if (((ulonglong)param_1[7] < 2) && (lVar5 = FUN_1402c9710(param_1), lVar5 != param_1[1])) {
    FUN_140279510(param_1);
  }
  plVar3 = (longlong *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar7 = *plVar3;
  *plVar3 = (longlong)puVar7;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)plVar3;
  *param_2 = (longlong)plVar3;
  param_2[1] = (longlong)puVar7;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



undefined8 FUN_140279460(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_140279510(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_1402794d0(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_140279800(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



void FUN_140279510(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  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_140346140(&local_50);
  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;
    }
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  lVar6 = FUN_1402961d0(param_1);
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_140278fc0(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_140278fc0(&local_50);
  }
  return;
}



void FUN_1402796e0(longlong param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  char *pcVar3;
  char *local_res8;
  undefined **local_60 [4];
  undefined8 local_40;
  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) {
    *(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_1405d3608);
    }
    *(undefined8 **)(param_1 + 8) = puVar2;
    *puVar2 = 0;
    puVar2[1] = local_40;
    puVar2[2] = local_38;
    puVar2[3] = local_30;
    puVar2[4] = local_28;
    puVar2[5] = local_20;
    puVar2[6] = local_18;
    puVar2[7] = local_10;
    *(undefined1 *)(param_1 + 0x10) = 1;
  }
  else {
    pcVar3 = (char *)(lVar1 + 8);
    local_res8 = pcVar3;
    FUN_1401975d0();
    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_140279800(undefined8 *param_1)

{
  FUN_1401975d0(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_140279850(longlong *param_1)

{
  FUN_140279990();
  if (*(char *)(*(longlong *)(param_1[0x16f] + 0x198) + 0x20) == '\0') {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_140279890(longlong *param_1)

{
  FUN_140279990();
  if (*(char *)(*(longlong *)(param_1[0x16f] + 0x1c8) + 0x20) == '\0') {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_1402798d0(longlong *param_1)

{
  FUN_140279990();
  if (*(char *)(*(longlong *)(param_1[0x16f] + 0x1a8) + 0x20) == '\0') {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_140279910(longlong *param_1)

{
  FUN_140279990();
  if (*(char *)(*(longlong *)(param_1[0x16f] + 0x1e8) + 0x20) == '\0') {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_140279950(longlong *param_1)

{
  FUN_140279990();
  if (*(char *)(*(longlong *)(param_1[0x16f] + 0x1a0) + 0x20) == '\0') {
    (**(code **)(*param_1 + 0xd0))(param_1,0,0);
  }
  return;
}



void FUN_140279990(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  char cVar3;
  undefined4 uVar4;
  
  if (*(int *)(param_1 + 0x1414) == 0) {
    plVar1 = *(longlong **)(param_1 + 0xed0);
    plVar1[2] = param_2;
    lVar2 = *plVar1;
    plVar1[3] = 0;
    *(undefined4 *)((longlong)plVar1 + 0x5c) = 0x3dcccccd;
    *(undefined4 *)(plVar1 + 1) = 0x3dcccccd;
    *(undefined4 *)((longlong)plVar1 + 0x24) = *(undefined4 *)(lVar2 + 0x178);
    *(undefined4 *)(plVar1 + 5) = *(undefined4 *)(lVar2 + 0x17c);
    *(undefined4 *)((longlong)plVar1 + 0x2c) = *(undefined4 *)(lVar2 + 0x180);
    *(undefined4 *)(plVar1 + 6) = 0;
    *(float *)(plVar1 + 5) = *(float *)(plVar1 + 5) + 0.0;
    *(undefined4 *)((longlong)plVar1 + 0x34) = 0;
    *(undefined4 *)(plVar1 + 7) = 0;
    uVar4 = FUN_1403144d0(0,0,*(undefined4 *)(lVar2 + 0xecc),0x453b8000);
    *(undefined4 *)(plVar1 + 4) = uVar4;
    *(undefined4 *)(lVar2 + 0xee0) = uVar4;
    *(undefined4 *)(plVar1 + 0xc) = 0x461c4000;
    *(undefined4 *)(param_1 + 0x1414) = 1;
  }
  else if (*(int *)(param_1 + 0x1414) == 1) {
    cVar3 = FUN_14032dd70(*(undefined8 *)(param_1 + 0xed0));
    if (cVar3 != '\0') {
      *(undefined4 *)(param_1 + 0x1414) = 2;
      return;
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014027a4e9)

undefined8 FUN_140279aa0(longlong param_1,short *param_2)

{
  int *piVar1;
  short sVar2;
  undefined4 uVar3;
  undefined2 *puVar4;
  undefined2 *puVar5;
  uint uVar6;
  undefined4 uVar7;
  int iVar8;
  longlong lVar9;
  void *pvVar11;
  short *psVar12;
  undefined4 *puVar13;
  wchar_t *_Str1;
  undefined8 *puVar14;
  short *psVar15;
  undefined8 uVar16;
  ulonglong uVar17;
  longlong *plVar18;
  undefined8 *puVar19;
  longlong lVar20;
  undefined8 *local_d88;
  void *local_d78 [2];
  longlong local_d68;
  ulonglong local_d60;
  undefined8 *local_d50;
  undefined8 *local_d48;
  undefined2 local_d38;
  undefined6 uStack_d36;
  undefined8 local_d28;
  ulonglong local_d20;
  undefined4 local_d10;
  undefined2 local_d08;
  undefined6 uStack_d06;
  longlong local_cf8;
  ulonglong local_cf0;
  undefined4 local_ce0;
  undefined4 local_cdc;
  undefined4 local_cd8;
  undefined8 *local_cc8;
  longlong *local_cc0;
  void *local_cb8 [2];
  longlong local_ca8;
  ulonglong local_ca0;
  undefined8 *local_c90;
  undefined8 *local_c88;
  undefined2 *local_c80;
  undefined8 local_c78;
  undefined1 local_c70 [24];
  undefined1 local_c58 [32];
  wchar_t local_c38 [256];
  wchar_t local_a38 [256];
  wchar_t local_838 [256];
  wchar_t local_638 [256];
  wchar_t local_438 [256];
  wchar_t local_238 [256];
  undefined8 *puVar10;
  
  local_c78 = 0xfffffffffffffffe;
  uVar17 = 0xffffffffffffffff;
  psVar12 = param_2;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1,param_2,~uVar17 - 1);
  lVar9 = FUN_1402933b0(DAT_140607ff0,param_2);
  uVar16 = 0;
  if (lVar9 != 0) {
    local_cc0 = (longlong *)(lVar9 + 0x68);
    puVar19 = (undefined8 *)0x0;
    puVar14 = puVar19;
    if ((*(longlong *)(lVar9 + 0x70) != 0) && (*(uint *)(lVar9 + 0x78) != 0)) {
      puVar10 = puVar19;
      plVar18 = (longlong *)*local_cc0;
      do {
        if (*plVar18 != 0) {
          puVar14 = (undefined8 *)((longlong *)*local_cc0)[(longlong)puVar10];
          break;
        }
        uVar6 = (int)puVar10 + 1;
        puVar10 = (undefined8 *)(ulonglong)uVar6;
        plVar18 = plVar18 + 1;
      } while (uVar6 < *(uint *)(lVar9 + 0x78));
    }
LAB_140279b52:
    local_cc8 = puVar14;
    if (local_cc8 != (undefined8 *)0x0) {
      uVar3 = *(undefined4 *)local_cc8;
      pvVar11 = operator_new(0x88);
      if (pvVar11 == (void *)0x0) {
        local_d88 = (undefined8 *)0x0;
      }
      else {
        *(undefined8 *)((longlong)pvVar11 + 0x20) = 7;
        *(undefined8 *)((longlong)pvVar11 + 0x18) = 0;
        *(undefined2 *)((longlong)pvVar11 + 8) = 0;
        *(undefined8 *)((longlong)pvVar11 + 0x58) = 7;
        *(undefined8 *)((longlong)pvVar11 + 0x50) = 0;
        *(undefined2 *)((longlong)pvVar11 + 0x40) = 0;
        *(undefined8 *)((longlong)pvVar11 + 0x68) = 0;
        *(undefined8 *)((longlong)pvVar11 + 0x70) = 0;
        *(undefined8 *)((longlong)pvVar11 + 0x78) = 0;
        local_d88 = operator_new(0x10);
        *local_d88 = pvVar11;
        *(undefined4 *)(local_d88 + 1) = 1;
      }
      puVar14 = puVar19;
      if (local_d88 != (undefined8 *)0x0) {
        puVar14 = (undefined8 *)*local_d88;
      }
      *puVar14 = 0;
      puVar14[6] = 0;
      puVar14 = puVar19;
      if (local_d88 != (undefined8 *)0x0) {
        puVar14 = (undefined8 *)*local_d88;
      }
      *(undefined4 *)puVar14 = uVar3;
      uVar7 = FUN_1402970c0(lVar9,L"szName");
      psVar12 = (short *)FUN_140296990(lVar9,uVar3,uVar7,L"szName",1);
      puVar14 = puVar19;
      if (local_d88 != (undefined8 *)0x0) {
        puVar14 = (undefined8 *)*local_d88;
      }
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar12;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(puVar14 + 1,psVar12,~uVar17 - 1);
      uVar7 = FUN_1402970c0(lVar9,L"fMoveSpeed");
      puVar13 = (undefined4 *)FUN_1402967b0(lVar9,uVar3,uVar7,L"fMoveSpeed",1);
      puVar14 = puVar19;
      if (local_d88 != (undefined8 *)0x0) {
        puVar14 = (undefined8 *)*local_d88;
      }
      *(undefined4 *)((longlong)puVar14 + 0x34) = *puVar13;
      uVar7 = FUN_1402970c0(lVar9,L"fMoveLength");
      puVar13 = (undefined4 *)FUN_1402967b0(lVar9,uVar3,uVar7,L"fMoveLength",1);
      puVar14 = puVar19;
      if (local_d88 != (undefined8 *)0x0) {
        puVar14 = (undefined8 *)*local_d88;
      }
      *(undefined4 *)(puVar14 + 6) = *puVar13;
      uVar7 = FUN_1402970c0(lVar9,L"szMoveMotion");
      psVar12 = (short *)FUN_140296990(lVar9,uVar3,uVar7,L"szMoveMotion",1);
      puVar14 = puVar19;
      if (local_d88 != (undefined8 *)0x0) {
        puVar14 = (undefined8 *)*local_d88;
      }
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar12;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(puVar14 + 8,psVar12,~uVar17 - 1);
      uVar7 = FUN_1402970c0(lVar9,L"szAttackType");
      _Str1 = (wchar_t *)FUN_140296990(lVar9,uVar3,uVar7,L"szAttackType",1);
      iVar8 = _wcsicmp(_Str1,L"AFTER_ATTACK");
      if (iVar8 == 0) {
        puVar14 = puVar19;
        if (local_d88 != (undefined8 *)0x0) {
          puVar14 = (undefined8 *)*local_d88;
        }
        *(undefined4 *)(puVar14 + 7) = 0;
      }
      else {
        iVar8 = _wcsicmp(_Str1,L"AFTER_ATTACK_MOVE");
        if (iVar8 == 0) {
          puVar14 = puVar19;
          if (local_d88 != (undefined8 *)0x0) {
            puVar14 = (undefined8 *)*local_d88;
          }
          *(undefined4 *)(puVar14 + 7) = 2;
        }
        else {
          iVar8 = _wcsicmp(_Str1,L"AFTER_ATTACK_SELECT_RANGE");
          if (iVar8 == 0) {
            puVar14 = puVar19;
            if (local_d88 != (undefined8 *)0x0) {
              puVar14 = (undefined8 *)*local_d88;
            }
            *(undefined4 *)(puVar14 + 7) = 1;
          }
          else {
            iVar8 = _wcsicmp(_Str1,L"DURING_ATTACK");
            if (iVar8 == 0) {
              puVar14 = puVar19;
              if (local_d88 != (undefined8 *)0x0) {
                puVar14 = (undefined8 *)*local_d88;
              }
              *(undefined4 *)(puVar14 + 7) = 3;
            }
            else {
              iVar8 = _wcsicmp(_Str1,L"DURING_ATTACK_SELECT_RANGE");
              if (iVar8 == 0) {
                puVar14 = puVar19;
                if (local_d88 != (undefined8 *)0x0) {
                  puVar14 = (undefined8 *)*local_d88;
                }
                *(undefined4 *)(puVar14 + 7) = 4;
              }
              else {
                iVar8 = _wcsicmp(_Str1,L"DURING_ATTACK_MOVE");
                if (iVar8 == 0) {
                  puVar14 = puVar19;
                  if (local_d88 != (undefined8 *)0x0) {
                    puVar14 = (undefined8 *)*local_d88;
                  }
                  *(undefined4 *)(puVar14 + 7) = 5;
                }
                else {
                  iVar8 = _wcsicmp(_Str1,L"DURING_ATTACK_AUTO_MOVE");
                  if (iVar8 == 0) {
                    puVar14 = puVar19;
                    if (local_d88 != (undefined8 *)0x0) {
                      puVar14 = (undefined8 *)*local_d88;
                    }
                    *(undefined4 *)(puVar14 + 7) = 6;
                  }
                }
              }
            }
          }
        }
      }
      lVar20 = 7;
      do {
        swprintf_s(local_838,0x100,L"szAttackMotion%02d");
        swprintf_s(local_438,0x100,L"nAttackMotionCategory%02d");
        swprintf_s(local_c38,0x100,L"szMotionName%02d");
        swprintf_s(local_a38,0x100,L"nMotionCategory%02d");
        swprintf_s(local_638,0x100,L"fDuration%02d");
        swprintf_s(local_238,0x100,L"fDamageWeight%02d");
        local_d20 = 7;
        local_d28 = 0;
        local_d38 = 0;
        local_cf0 = 7;
        local_cf8 = 0;
        local_d08 = 0;
        uVar7 = FUN_1402970c0(lVar9,local_c38);
        psVar15 = (short *)FUN_140296990(lVar9,uVar3,uVar7,local_c38,1);
        uVar17 = 0xffffffffffffffff;
        psVar12 = psVar15;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_d08,psVar15,~uVar17 - 1);
        if (local_cf8 == 0) {
          if (7 < local_cf0) {
            operator_delete((void *)CONCAT62(uStack_d06,local_d08));
          }
          local_cf0 = 7;
          local_cf8 = 0;
          local_d08 = 0;
          if (7 < local_d20) {
            operator_delete((void *)CONCAT62(uStack_d36,local_d38));
          }
        }
        else {
          uVar7 = FUN_1402970c0(lVar9,local_838);
          psVar15 = (short *)FUN_140296990(lVar9,uVar3,uVar7,local_838,1);
          uVar17 = 0xffffffffffffffff;
          psVar12 = psVar15;
          do {
            if (uVar17 == 0) break;
            uVar17 = uVar17 - 1;
            sVar2 = *psVar12;
            psVar12 = psVar12 + 1;
          } while (sVar2 != 0);
          FUN_140001710(&local_d38,psVar15,~uVar17 - 1);
          uVar7 = FUN_1402970c0(lVar9,local_438);
          puVar13 = (undefined4 *)FUN_140296600(lVar9,uVar3,uVar7,local_438,1);
          local_d10 = *puVar13;
          uVar7 = FUN_1402970c0(lVar9,local_a38);
          puVar13 = (undefined4 *)FUN_140296600(lVar9,uVar3,uVar7,local_a38,1);
          local_ce0 = *puVar13;
          uVar7 = FUN_1402970c0(lVar9,local_638);
          puVar13 = (undefined4 *)FUN_1402967b0(lVar9,uVar3,uVar7,local_638,1);
          local_cdc = *puVar13;
          uVar7 = FUN_1402970c0(lVar9,local_238);
          puVar13 = (undefined4 *)FUN_1402967b0(lVar9,uVar3,uVar7,local_238,1);
          local_cd8 = *puVar13;
          puVar14 = puVar19;
          if (local_d88 != (undefined8 *)0x0) {
            puVar14 = (undefined8 *)*local_d88;
          }
          puVar4 = (undefined2 *)puVar14[0xe];
          if ((&local_d38 < puVar4) && (puVar5 = (undefined2 *)puVar14[0xd], puVar5 <= &local_d38))
          {
            if (puVar4 == (undefined2 *)puVar14[0xf]) {
              FUN_14027a6c0(puVar14 + 0xd);
            }
            local_c80 = (undefined2 *)puVar14[0xe];
            if (local_c80 != (undefined2 *)0x0) {
              FUN_14027af30(local_c80,
                            (((longlong)&local_d38 - (longlong)puVar5) / 0x68) * 0x68 + puVar14[0xd]
                           );
            }
          }
          else {
            if (puVar4 == (undefined2 *)puVar14[0xf]) {
              FUN_14027a6c0(puVar14 + 0xd);
            }
            puVar4 = (undefined2 *)puVar14[0xe];
            local_c80 = puVar4;
            if (puVar4 != (undefined2 *)0x0) {
              *(undefined8 *)(puVar4 + 0xc) = 7;
              *(undefined8 *)(puVar4 + 8) = 0;
              *puVar4 = 0;
              FUN_1400015e0(puVar4,&local_d38,0,0xffffffffffffffff);
              *(undefined4 *)(puVar4 + 0x14) = local_d10;
              *(undefined8 *)(puVar4 + 0x24) = 7;
              *(undefined8 *)(puVar4 + 0x20) = 0;
              puVar4[0x18] = 0;
              FUN_1400015e0(puVar4 + 0x18,&local_d08,0,0xffffffffffffffff);
              *(undefined4 *)(puVar4 + 0x2c) = local_ce0;
              *(undefined4 *)(puVar4 + 0x2e) = local_cdc;
              *(undefined4 *)(puVar4 + 0x30) = local_cd8;
            }
          }
          puVar14[0xe] = puVar14[0xe] + 0x68;
          if (7 < local_cf0) {
            operator_delete((void *)CONCAT62(uStack_d06,local_d08));
          }
          local_cf0 = 7;
          local_cf8 = 0;
          local_d08 = 0;
          if (7 < local_d20) {
            operator_delete((void *)CONCAT62(uStack_d36,local_d38));
          }
        }
        local_d38 = 0;
        local_d28 = 0;
        local_d20 = 7;
        lVar20 = lVar20 + -1;
      } while (lVar20 != 0);
      puVar14 = puVar19;
      if (local_d88 != (undefined8 *)0x0) {
        puVar14 = (undefined8 *)*local_d88;
      }
      local_d60 = 7;
      local_d68 = 0;
      local_d78[0] = (void *)((ulonglong)local_d78[0] & 0xffffffffffff0000);
      FUN_1400015e0(local_d78,puVar14 + 1,0,0xffffffffffffffff);
      if (local_d88 != (undefined8 *)0x0) {
        LOCK();
        *(int *)(local_d88 + 1) = *(int *)(local_d88 + 1) + 1;
        UNLOCK();
      }
      local_ca0 = 7;
      local_ca8 = 0;
      local_cb8[0] = (void *)((ulonglong)local_cb8[0] & 0xffffffffffff0000);
      local_d50 = local_d88;
      local_d48 = local_d88;
      if (local_d60 < 8) {
        memmove(local_cb8,local_d78,local_d68 * 2 + 2);
        local_ca0 = local_d60;
      }
      else {
        local_cb8[0] = local_d78[0];
        local_d78[0] = (void *)0x0;
        local_ca0 = local_d60;
      }
      local_ca8 = local_d68;
      local_d68 = 0;
      local_d60 = 0;
      if (local_d50 != (undefined8 *)0x0) {
        LOCK();
        *(int *)(local_d50 + 1) = *(int *)(local_d50 + 1) + 1;
        UNLOCK();
      }
      local_c90 = local_d50;
      local_c88 = local_d50;
      if (*(longlong *)(param_1 + 0x48) == 0) {
        FUN_14027ada0(param_1 + 0x28,local_c70,local_cb8);
      }
      else {
        FUN_14027ac40(param_1 + 0x28,local_c58,local_cb8,local_cb8);
      }
      puVar14 = local_c90;
      iVar8 = DAT_1406081d0;
      if (local_c90 != (undefined8 *)0x0) {
        if (local_c90 == local_c88) {
          if (local_c90 != (undefined8 *)0x0) {
            LOCK();
            piVar1 = (int *)(local_c90 + 1);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              local_c90 = (undefined8 *)0x0;
              pvVar11 = (void *)*puVar14;
              if (pvVar11 != (void *)0x0) {
                FUN_14023b080(pvVar11);
                operator_delete(pvVar11);
              }
              operator_delete(puVar14);
            }
          }
        }
        else {
          DAT_1406081d0 = DAT_1406081d0 + 1;
          if (iVar8 == 0) {
            FUN_140176d60(1);
          }
        }
      }
      if (7 < local_ca0) {
        operator_delete(local_cb8[0]);
      }
      puVar14 = local_d50;
      iVar8 = DAT_1406081d0;
      local_ca0 = 7;
      local_ca8 = 0;
      local_cb8[0] = (void *)((ulonglong)local_cb8[0] & 0xffffffffffff0000);
      if (local_d50 != (undefined8 *)0x0) {
        if (local_d50 == local_d48) {
          if (local_d50 != (undefined8 *)0x0) {
            LOCK();
            piVar1 = (int *)(local_d50 + 1);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              local_d50 = (undefined8 *)0x0;
              pvVar11 = (void *)*puVar14;
              if (pvVar11 != (void *)0x0) {
                FUN_14023b080(pvVar11);
                operator_delete(pvVar11);
              }
              operator_delete(puVar14);
            }
          }
        }
        else {
          DAT_1406081d0 = DAT_1406081d0 + 1;
          if (iVar8 == 0) {
            FUN_140176d60(1);
          }
        }
      }
      if (7 < local_d60) {
        operator_delete(local_d78[0]);
      }
      local_d60 = 7;
      local_d68 = 0;
      local_d78[0] = (void *)((ulonglong)local_d78[0] & 0xffffffffffff0000);
      if (local_d88 != (undefined8 *)0x0) {
        LOCK();
        piVar1 = (int *)(local_d88 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          pvVar11 = (void *)*local_d88;
          if (pvVar11 != (void *)0x0) {
            FUN_14023b080(pvVar11);
            operator_delete(pvVar11);
          }
          operator_delete(local_d88);
        }
      }
      puVar14 = (undefined8 *)local_cc8[3];
      if ((undefined8 *)local_cc8[3] == (undefined8 *)0x0) {
        uVar6 = *(uint *)(local_cc8 + 4) % *(uint *)(lVar9 + 0x78) + 1;
        lVar20 = (longlong)(int)uVar6 << 3;
        puVar14 = puVar19;
        do {
          if (*(uint *)(lVar9 + 0x78) <= uVar6) break;
          if (*(longlong *)(*(longlong *)(lVar9 + 0x68) + lVar20) != 0) {
            puVar14 = *(undefined8 **)(*(longlong *)(lVar9 + 0x68) + lVar20);
          }
          uVar6 = uVar6 + 1;
          lVar20 = lVar20 + 8;
        } while (puVar14 == (undefined8 *)0x0);
      }
      goto LAB_140279b52;
    }
    uVar16 = 1;
  }
  return uVar16;
}



void FUN_14027a520(undefined8 *param_1)

{
  FUN_14023ae90(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_14027a560(longlong param_1,longlong *param_2,short *param_3)

{
  short sVar1;
  longlong lVar2;
  ushort *puVar3;
  ulonglong uVar4;
  ushort *puVar5;
  short *psVar6;
  ulonglong uVar7;
  ushort local_30;
  undefined6 uStack_2e;
  longlong local_20;
  ulonglong local_18;
  
  uVar7 = 0;
  local_18 = 7;
  local_20 = 0;
  local_30 = 0;
  uVar4 = 0xffffffffffffffff;
  psVar6 = param_3;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_30,param_3,~uVar4 - 1,param_3,0xfffffffffffffffe);
  if (*(longlong *)(param_1 + 0x48) != 0) {
    puVar5 = &local_30;
    if (7 < local_18) {
      puVar5 = (ushort *)CONCAT62(uStack_2e,local_30);
    }
    puVar3 = &local_30;
    if (7 < local_18) {
      puVar3 = (ushort *)CONCAT62(uStack_2e,local_30);
    }
    for (; puVar3 != puVar5 + local_20; puVar3 = puVar3 + 1) {
      uVar7 = uVar7 ^ (uVar7 >> 2) + uVar7 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar3;
    }
    uVar7 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x28) +
                          (uVar7 % *(ulonglong *)(param_1 + 0x30)) * 8,&local_30);
  }
  if (7 < local_18) {
    operator_delete((void *)CONCAT62(uStack_2e,local_30));
  }
  if (uVar7 == 0) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar2 = *(longlong *)(uVar7 + 0x30);
    *param_2 = lVar2;
    param_2[1] = lVar2;
    if (lVar2 != 0) {
      LOCK();
      *(int *)(lVar2 + 8) = *(int *)(lVar2 + 8) + 1;
      UNLOCK();
    }
  }
  return param_2;
}



void FUN_14027a6c0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x68;
  if (0x276276276276275 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x68;
  if (uVar2 < uVar3) {
    if (0x276276276276276 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_14027a780(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14027a780(param_1,uVar2);
  }
  return;
}



void FUN_14027a780(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 (0x276276276276276 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x68) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x68);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14027b0a0(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_14023b880(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x68);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0x68) * 0x68);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_14027a8d0(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_1406081d0;
      while (DAT_1406081d0 = 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_14023b080(pvVar6);
                  operator_delete(pvVar6);
                }
                operator_delete(puVar5);
              }
            }
          }
          else {
            DAT_1406081d0 = 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_1406081d0;
      }
    }
    param_1[4] = 0;
    param_1[6] = puVar2;
  }
  return;
}



void FUN_14027aa80(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14027aaa0();
  }
  return;
}



void FUN_14027aaa0(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;
  
  puVar10 = (undefined8 *)*param_1;
  puVar2 = puVar10 + param_1[1];
  for (; puVar10 != puVar2; puVar10 = puVar10 + 1) {
    puVar3 = (undefined8 *)*puVar10;
    *puVar10 = 0;
    iVar7 = DAT_1406081d0;
    while (DAT_1406081d0 = 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_14023b080(pvVar6);
                operator_delete(pvVar6);
              }
              operator_delete(puVar5);
            }
          }
        }
        else {
          DAT_1406081d0 = 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_1406081d0;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



longlong * FUN_14027ac40(longlong *param_1,longlong *param_2,undefined8 param_3,longlong param_4)

{
  char cVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar6;
  undefined8 uVar7;
  longlong *local_48;
  longlong *local_40;
  undefined2 local_38;
  
  uVar7 = 0xfffffffffffffffe;
  uVar2 = FUN_14015afa0(param_3);
  plVar5 = (longlong *)(*param_1 + (uVar2 % (ulonglong)param_1[1]) * 8);
  lVar3 = FUN_1402cb0b0(plVar5,param_3);
  if (lVar3 == 0) {
    local_40 = (longlong *)0x0;
    local_38 = 0;
    local_48 = param_1;
    FUN_14027b2d0(&local_48);
    plVar6 = local_40;
    plVar4 = local_40 + 1;
    if (plVar4 != (longlong *)0x0) {
      local_40[4] = 7;
      local_40[3] = 0;
      *(undefined2 *)plVar4 = 0;
      FUN_1400015e0(plVar4,param_4,0,0xffffffffffffffff,uVar7,plVar4);
      lVar3 = *(longlong *)(param_4 + 0x28);
      plVar6[6] = lVar3;
      plVar6[7] = lVar3;
      if (lVar3 != 0) {
        LOCK();
        *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
        UNLOCK();
        plVar6 = local_40;
      }
    }
    local_38 = CONCAT11(1,(undefined1)local_38);
    cVar1 = FUN_14027afd0(param_1);
    if (cVar1 != '\0') {
      plVar5 = (longlong *)(*param_1 + (uVar2 % (ulonglong)param_1[1]) * 8);
    }
    *plVar6 = *plVar5;
    *plVar5 = (longlong)plVar6;
    param_1[4] = param_1[4] + 1;
    plVar4 = (longlong *)param_1[6];
    if (plVar5 < (longlong *)param_1[6]) {
      plVar4 = plVar5;
    }
    param_1[6] = (longlong)plVar4;
    *param_2 = (longlong)plVar5;
    param_2[1] = (longlong)plVar6;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)plVar5;
    param_2[1] = lVar3;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



longlong * FUN_14027ada0(longlong *param_1,longlong *param_2,longlong param_3)

{
  undefined8 *puVar1;
  ulonglong *puVar2;
  longlong *plVar3;
  ulonglong uVar4;
  longlong lVar5;
  ulonglong *puVar6;
  undefined8 *puVar7;
  ulonglong local_res20;
  undefined8 uVar8;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  uVar8 = 0xfffffffffffffffe;
  local_38 = (undefined8 *)0x0;
  local_30 = 0;
  local_40 = param_1;
  FUN_14027b2d0(&local_40);
  puVar7 = local_38;
  puVar1 = local_38 + 1;
  if (puVar1 != (undefined8 *)0x0) {
    local_38[4] = 7;
    local_38[3] = 0;
    *(undefined2 *)puVar1 = 0;
    FUN_1400015e0(puVar1,param_3,0,0xffffffffffffffff,uVar8);
    lVar5 = *(longlong *)(param_3 + 0x28);
    puVar7[6] = lVar5;
    puVar7[7] = lVar5;
    if (lVar5 != 0) {
      LOCK();
      *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
      UNLOCK();
      puVar7 = local_38;
    }
  }
  local_30 = CONCAT11(1,(undefined1)local_30);
  uVar4 = FUN_14015afa0(puVar1);
  if (*param_1 == 0) {
    local_res20 = FUN_1402c9710(param_1,1);
    puVar2 = (ulonglong *)(param_1 + 1);
    puVar6 = &local_res20;
    if (local_res20 <= *puVar2) {
      puVar6 = puVar2;
    }
    *puVar2 = *puVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else if (((ulonglong)param_1[7] < 2) && (lVar5 = FUN_1402c9710(param_1), lVar5 != param_1[1])) {
    FUN_14027b100(param_1);
  }
  plVar3 = (longlong *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar7 = *plVar3;
  *plVar3 = (longlong)puVar7;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)plVar3;
  *param_2 = (longlong)plVar3;
  param_2[1] = (longlong)puVar7;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



undefined2 * FUN_14027af30(undefined2 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_2 + 0x28);
  *(undefined8 *)(param_1 + 0x24) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  param_1[0x18] = 0;
  FUN_1400015e0(param_1 + 0x18,param_2 + 0x30,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x58);
  *(undefined4 *)(param_1 + 0x2e) = *(undefined4 *)(param_2 + 0x5c);
  *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(param_2 + 0x60);
  return param_1;
}



undefined8 FUN_14027afd0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_14027b100(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_14027b040(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_14023ae90(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_14027b0a0(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x68) {
    if (param_3 != 0) {
      FUN_14027af30(param_3,param_1);
    }
    param_3 = param_3 + 0x68;
  }
  return param_3;
}



void FUN_14027b100(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  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_140346140(&local_50);
  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;
    }
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  lVar6 = FUN_1402961d0(param_1);
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_14027aaa0(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_14027aaa0(&local_50);
  }
  return;
}



void FUN_14027b2d0(longlong param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  char *local_res8;
  undefined **local_68 [4];
  undefined8 local_48;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  
  lVar1 = *(longlong *)(param_1 + 8);
  if (lVar1 != 0) {
    FUN_14023ae90();
    if (7 < *(ulonglong *)(lVar1 + 0x20)) {
      operator_delete(*(void **)(lVar1 + 8));
    }
    *(undefined8 *)(lVar1 + 0x20) = 7;
    *(undefined8 *)(lVar1 + 0x18) = 0;
    *(undefined2 *)(lVar1 + 8) = 0;
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar2 = operator_new(0x40);
  if (puVar2 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar2;
    *puVar2 = 0;
    puVar2[1] = local_48;
    puVar2[2] = local_40;
    puVar2[3] = local_38;
    puVar2[4] = local_30;
    puVar2[5] = local_28;
    puVar2[6] = local_20;
    puVar2[7] = local_18;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8 = (char *)0x0;
  std::exception::exception((exception *)local_68,&local_res8);
  local_68[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d3608);
}



void FUN_14027b3e0(longlong param_1)

{
  FUN_14027b610();
  FUN_14027b610(param_1);
  FUN_14027bc10(param_1);
  *(undefined2 *)(param_1 + 0x4d) = 0;
  FUN_14034edf0(param_1 + 0x1e8);
  if (*(void **)(param_1 + 0x128) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x128));
  }
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined8 *)(param_1 + 0x138) = 0;
  if (*(void **)(param_1 + 0x108) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x108));
  }
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined8 *)(param_1 + 0x118) = 0;
  FUN_14027bda0(param_1 + 0xd8);
  if (*(void **)(param_1 + 0x28) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x28));
  }
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  FUN_140175470(param_1 + 8);
  return;
}



void FUN_14027b4b0(longlong param_1,float *param_2,int *param_3)

{
  float fVar1;
  DWORD DVar2;
  HANDLE hObject;
  HANDLE pvVar3;
  float *pfVar4;
  int *piVar5;
  uint uVar6;
  float *pfVar7;
  uint uVar8;
  int *piVar9;
  int iVar10;
  
  uVar8 = 0;
  piVar9 = (int *)(param_1 + 0x158);
  uVar6 = uVar8;
  iVar10 = DAT_140608190;
  do {
    piVar5 = piVar9;
    if (0xe < uVar6) {
      if (iVar10 == 0) {
        FUN_140176d60(0);
        iVar10 = DAT_140608190;
      }
      DAT_140608190 = iVar10 + 1;
      piVar5 = &DAT_14060818c;
      iVar10 = DAT_140608190;
    }
    uVar6 = uVar6 + 1;
    piVar9 = piVar9 + 1;
    *piVar5 = *piVar5 + *param_3;
    param_3 = param_3 + 1;
  } while ((int)uVar6 < 0xf);
  pfVar7 = (float *)(param_1 + 0x194);
  do {
    pfVar4 = pfVar7;
    if (0x13 < uVar8) {
      if ((DAT_140608198 == 0) &&
         (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                (HANDLE)0x0), hObject != (HANDLE)0x0)) {
        DVar2 = GetCurrentProcessId();
        pvVar3 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar3,DVar2,hObject,0x2000,0,0,0);
        CloseHandle(hObject);
      }
      DAT_140608198 = DAT_140608198 + 1;
      pfVar4 = (float *)&DAT_140608194;
    }
    fVar1 = *param_2;
    uVar8 = uVar8 + 1;
    pfVar7 = pfVar7 + 1;
    param_2 = param_2 + 1;
    *pfVar4 = fVar1 + *pfVar4;
  } while ((int)uVar8 < 0x14);
  return;
}



void FUN_14027b610(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x28);
  if (pvVar1 != *(void **)(param_1 + 0x30)) {
    memmove(pvVar1,*(void **)(param_1 + 0x30),0);
    *(void **)(param_1 + 0x30) = pvVar1;
  }
  FUN_14027bca0(param_1 + 8);
  pvVar1 = *(void **)(param_1 + 0x128);
  if (pvVar1 != *(void **)(param_1 + 0x130)) {
    memmove(pvVar1,*(void **)(param_1 + 0x130),0);
    *(void **)(param_1 + 0x130) = pvVar1;
  }
  memset((void *)(param_1 + 0x158),0,0x3c);
  memset((void *)(param_1 + 0x194),0,0x50);
  return;
}



void FUN_14027b6d0(longlong param_1)

{
  longlong *plVar1;
  code *pcVar2;
  undefined4 uVar3;
  DWORD DVar4;
  HANDLE hObject;
  HANDLE pvVar5;
  ulonglong uVar6;
  undefined4 *puVar7;
  longlong *plVar8;
  undefined4 *puVar9;
  longlong lVar10;
  uint uVar11;
  longlong *plVar12;
  undefined4 *puVar13;
  undefined4 *puVar14;
  undefined4 *puVar15;
  undefined4 *local_70;
  undefined4 *local_68;
  undefined4 *local_60;
  undefined4 *local_50;
  undefined4 *local_48;
  undefined4 *local_40;
  
  puVar15 = (undefined4 *)0x0;
  local_50 = (undefined4 *)0x0;
  local_48 = (undefined4 *)0x0;
  local_40 = (undefined4 *)0x0;
  local_70 = (undefined4 *)0x0;
  local_68 = (undefined4 *)0x0;
  local_60 = (undefined4 *)0x0;
  puVar7 = puVar15;
  puVar13 = puVar15;
  do {
    uVar11 = (uint)puVar7;
    if (uVar11 < 0xf) {
      puVar7 = (undefined4 *)(param_1 + 0x158 + (longlong)(int)uVar11 * 4);
    }
    else {
      if (DAT_140608190 == 0) {
        FUN_140176d60(0);
        puVar13 = local_50;
      }
      DAT_140608190 = DAT_140608190 + 1;
      puVar7 = &DAT_14060818c;
    }
    if ((puVar7 < local_48) && (puVar13 <= puVar7)) {
      lVar10 = (longlong)puVar7 - (longlong)puVar13;
      if (local_48 == local_40) {
        uVar6 = (longlong)local_48 - (longlong)puVar13 >> 2;
        if (0x3ffffffffffffffe < uVar6) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        puVar7 = (undefined4 *)(uVar6 + 1);
        puVar9 = (undefined4 *)((longlong)local_40 - (longlong)puVar13 >> 2);
        if (puVar9 < puVar7) {
          puVar13 = puVar15;
          if (puVar9 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar9 >> 1))) {
            puVar13 = (undefined4 *)((longlong)puVar9 + ((ulonglong)puVar9 >> 1));
          }
          if (puVar13 < puVar7) {
            puVar13 = puVar7;
          }
          FUN_140051e60(&local_50,puVar13);
          puVar13 = local_50;
        }
      }
      if (local_48 != (undefined4 *)0x0) {
        uVar3 = puVar13[lVar10 >> 2];
LAB_14027b851:
        *local_48 = uVar3;
        puVar13 = local_50;
      }
    }
    else {
      if (local_48 == local_40) {
        uVar6 = (longlong)local_48 - (longlong)puVar13 >> 2;
        if (0x3ffffffffffffffe < uVar6) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        puVar9 = (undefined4 *)(uVar6 + 1);
        puVar14 = (undefined4 *)((longlong)local_40 - (longlong)puVar13 >> 2);
        if (puVar14 < puVar9) {
          puVar13 = puVar15;
          if (puVar14 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar14 >> 1))) {
            puVar13 = (undefined4 *)((longlong)puVar14 + ((ulonglong)puVar14 >> 1));
          }
          if (puVar13 < puVar9) {
            puVar13 = puVar9;
          }
          FUN_140051e60(&local_50,puVar13);
          puVar13 = local_50;
        }
      }
      if (local_48 != (undefined4 *)0x0) {
        uVar3 = *puVar7;
        goto LAB_14027b851;
      }
    }
    local_48 = local_48 + 1;
    puVar7 = (undefined4 *)(ulonglong)(uVar11 + 1);
    puVar14 = puVar15;
    puVar9 = local_70;
  } while ((int)(uVar11 + 1) < 0xf);
  do {
    uVar11 = (uint)puVar14;
    if (uVar11 < 0x14) {
      puVar7 = (undefined4 *)(param_1 + 0x194 + (longlong)(int)uVar11 * 4);
    }
    else {
      if ((DAT_140608198 == 0) &&
         (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                (HANDLE)0x0), puVar9 = local_70, hObject != (HANDLE)0x0)) {
        DVar4 = GetCurrentProcessId();
        pvVar5 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar5,DVar4,hObject,0x2000,0,0,0);
        CloseHandle(hObject);
        puVar9 = local_70;
      }
      DAT_140608198 = DAT_140608198 + 1;
      puVar7 = &DAT_140608194;
    }
    if ((puVar7 < local_68) && (puVar9 <= puVar7)) {
      lVar10 = (longlong)puVar7 - (longlong)puVar9;
      if (local_68 == local_60) {
        uVar6 = (longlong)local_68 - (longlong)puVar9 >> 2;
        if (0x3ffffffffffffffe < uVar6) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        puVar13 = (undefined4 *)(uVar6 + 1);
        puVar7 = (undefined4 *)((longlong)local_60 - (longlong)puVar9 >> 2);
        if (puVar7 < puVar13) {
          puVar9 = puVar15;
          if (puVar7 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar7 >> 1))) {
            puVar9 = (undefined4 *)((longlong)puVar7 + ((ulonglong)puVar7 >> 1));
          }
          if (puVar9 < puVar13) {
            puVar9 = puVar13;
          }
          FUN_14030db30(&local_70,puVar9);
          puVar9 = local_70;
        }
      }
      if (local_68 != (undefined4 *)0x0) {
        uVar3 = puVar9[lVar10 >> 2];
LAB_14027ba29:
        *local_68 = uVar3;
        puVar9 = local_70;
      }
    }
    else {
      if (local_68 == local_60) {
        uVar6 = (longlong)local_68 - (longlong)puVar9 >> 2;
        if (0x3ffffffffffffffe < uVar6) {
          std::_Xlength_error("vector<T> too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        puVar14 = (undefined4 *)(uVar6 + 1);
        puVar13 = (undefined4 *)((longlong)local_60 - (longlong)puVar9 >> 2);
        if (puVar13 < puVar14) {
          puVar9 = puVar15;
          if (puVar13 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar13 >> 1))) {
            puVar9 = (undefined4 *)((longlong)puVar13 + ((ulonglong)puVar13 >> 1));
          }
          if (puVar9 < puVar14) {
            puVar9 = puVar14;
          }
          FUN_14030db30(&local_70,puVar9);
          puVar9 = local_70;
        }
      }
      if (local_68 != (undefined4 *)0x0) {
        uVar3 = *puVar7;
        goto LAB_14027ba29;
      }
    }
    local_68 = local_68 + 1;
    puVar14 = (undefined4 *)(ulonglong)(uVar11 + 1);
    if (0x13 < (int)(uVar11 + 1)) {
      plVar1 = *(longlong **)(param_1 + 0x30);
      for (plVar12 = *(longlong **)(param_1 + 0x28); plVar12 != plVar1; plVar12 = plVar12 + 1) {
        lVar10 = *plVar12;
        if (lVar10 != 0) {
          plVar8 = (longlong *)(*(longlong *)(lVar10 + 0xb50) + 0x3c0);
          (**(code **)(*plVar8 + 0x850))
                    (plVar8,*(undefined4 *)(lVar10 + 8),&DAT_1405d85a0,&local_50,&local_70);
        }
        puVar9 = local_70;
      }
      if (puVar9 != (undefined4 *)0x0) {
        operator_delete(puVar9);
      }
      local_70 = (undefined4 *)0x0;
      local_68 = (undefined4 *)0x0;
      local_60 = (undefined4 *)0x0;
      if (local_50 != (undefined4 *)0x0) {
        operator_delete(local_50);
      }
      return;
    }
  } while( true );
}



void FUN_14027bb00(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong *plVar4;
  bool bVar5;
  longlong local_res10 [3];
  longlong *local_40;
  longlong *local_38;
  longlong **local_28;
  longlong *plStack_20;
  undefined1 local_18 [16];
  
  if (param_2 != 0) {
    local_res10[0] = param_2;
    FUN_140198570(param_2,&local_40,param_3,param_4,0xfffffffffffffffe);
    plVar4 = local_40;
    if (local_40 != (longlong *)0x0) {
      if (local_40 == local_38) {
        if (*local_40 != 0) {
          local_28 = &local_40;
          plStack_20 = local_res10;
          FUN_14027c040(local_18,*(undefined8 *)(param_1 + 0x28),*(undefined8 *)(param_1 + 0x30),
                        &local_28);
          plVar4 = local_40;
        }
      }
      else {
        iVar3 = DAT_14060804c + 1;
        bVar5 = DAT_14060804c == 0;
        DAT_14060804c = iVar3;
        if (bVar5) {
          FUN_140176d60(1);
          plVar4 = local_40;
        }
      }
    }
    if (plVar4 != (longlong *)0x0) {
      if (plVar4 == local_38) {
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_40 = (longlong *)0x0;
            puVar2 = (undefined8 *)*plVar4;
            if (puVar2 != (undefined8 *)0x0) {
              (**(code **)*puVar2)(puVar2,1);
            }
            operator_delete(plVar4);
          }
        }
      }
      else {
        iVar3 = DAT_140608054 + 1;
        bVar5 = DAT_140608054 == 0;
        DAT_140608054 = iVar3;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return;
}



void FUN_14027bc10(longlong param_1)

{
  void *_Dst;
  undefined1 local_res8 [8];
  
  FUN_14027c190(local_res8,*(undefined8 *)(param_1 + 0x108),*(undefined8 *)(param_1 + 0x110),param_1
               );
  _Dst = *(void **)(param_1 + 0x108);
  if (_Dst != *(void **)(param_1 + 0x110)) {
    memmove(_Dst,*(void **)(param_1 + 0x110),0);
    *(void **)(param_1 + 0x110) = _Dst;
  }
  FUN_14027bca0(param_1 + 8);
  return;
}



void FUN_14027bca0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  
  lVar2 = param_1[1];
  if (*param_1 != lVar2) {
    lVar3 = FUN_14027c270(lVar2,lVar2);
    lVar2 = param_1[1];
    if (lVar3 != lVar2) {
      lVar4 = lVar3 + 5;
      do {
        *(undefined4 *)(lVar4 + -5) = 0;
        *(undefined2 *)(lVar4 + -1) = 0;
        *(undefined8 *)(lVar4 + 1) = 0;
        *(undefined8 *)(lVar4 + 9) = 0;
        *(undefined8 *)(lVar4 + 0x11) = 0;
        *(undefined8 *)(lVar4 + 0x19) = 0;
        *(undefined8 *)(lVar4 + 0x21) = 0;
        *(undefined8 *)(lVar4 + 0x29) = 0;
        *(undefined8 *)(lVar4 + 0x31) = 0;
        lVar1 = lVar4 + 0x39;
        lVar4 = lVar4 + 0x3e;
      } while (lVar1 != lVar2);
    }
    param_1[1] = lVar3;
  }
  return;
}



void FUN_14027bd20(undefined8 *param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  *(undefined4 *)param_2 = 0;
  *(undefined2 *)((longlong)param_2 + 4) = 0;
  *(undefined8 *)((longlong)param_2 + 6) = 0;
  *(undefined8 *)((longlong)param_2 + 0xe) = 0;
  *(undefined8 *)((longlong)param_2 + 0x16) = 0;
  *(undefined8 *)((longlong)param_2 + 0x1e) = 0;
  *(undefined8 *)((longlong)param_2 + 0x26) = 0;
  *(undefined8 *)((longlong)param_2 + 0x2e) = 0;
  *(undefined8 *)((longlong)param_2 + 0x36) = 0;
  puVar1 = (undefined8 *)*param_1;
  if ((puVar1 != (undefined8 *)0x0) && (puVar1 <= param_2)) {
    for (puVar2 = (undefined8 *)*puVar1; (puVar2 != (undefined8 *)0x0 && (puVar2 <= param_2));
        puVar2 = (undefined8 *)*puVar2) {
      puVar1 = puVar2;
    }
    *param_2 = *puVar1;
    *puVar1 = param_2;
    return;
  }
  *param_2 = puVar1;
  *param_1 = param_2;
  return;
}



void FUN_14027bda0(undefined8 *param_1)

{
  void *pvVar1;
  ulonglong uVar2;
  void *pvVar3;
  longlong lVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  longlong lVar7;
  ulonglong uVar8;
  undefined8 *puVar9;
  void *local_38;
  longlong lStack_30;
  
  if (param_1[1] != 0) {
    uVar2 = param_1[3];
    puVar9 = (undefined8 *)*param_1;
    uVar5 = uVar2;
    uVar8 = 8;
    do {
      uVar6 = uVar8;
      uVar8 = uVar5 % uVar6;
      uVar5 = uVar6;
    } while (uVar8 != 0);
    local_38 = (void *)param_1[1];
    lStack_30 = param_1[2];
    do {
      pvVar3 = *(void **)(lStack_30 + -0x10 + (longlong)local_38);
      lVar4 = *(longlong *)(lStack_30 + -8 + (longlong)local_38);
      pvVar1 = (void *)(lStack_30 + -0x10 + (longlong)local_38);
      if (local_38 != pvVar1) {
        lVar7 = (longlong)local_38 + 5;
        do {
          if ((undefined8 *)(lVar7 + -5) == puVar9) {
            puVar9 = (undefined8 *)*puVar9;
          }
          else {
            *(undefined4 *)(lVar7 + -5) = 0;
            *(undefined2 *)(lVar7 + -1) = 0;
            *(undefined8 *)(lVar7 + 1) = 0;
            *(undefined8 *)(lVar7 + 9) = 0;
            *(undefined8 *)(lVar7 + 0x11) = 0;
            *(undefined8 *)(lVar7 + 0x19) = 0;
            *(undefined8 *)(lVar7 + 0x21) = 0;
            *(undefined8 *)(lVar7 + 0x29) = 0;
            *(undefined8 *)(lVar7 + 0x31) = 0;
          }
          lVar7 = lVar7 + (uVar2 / uVar6) * 8;
        } while ((void *)(lVar7 + -5) != pvVar1);
      }
      operator_delete__(local_38);
      local_38 = pvVar3;
      lStack_30 = lVar4;
    } while (pvVar3 != (void *)0x0);
    param_1[1] = 0;
  }
  FUN_14012e360(param_1);
  return;
}



undefined8 *
FUN_14027bf00(undefined8 *param_1,longlong *param_2,longlong *param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  int iVar5;
  bool bVar6;
  longlong *local_30;
  longlong *local_28;
  
  if (param_2 == param_3) {
    *param_1 = param_4;
  }
  else {
    do {
      if (*param_2 != 0) {
        FUN_140198570(*param_2,&local_30);
        plVar1 = local_28;
        plVar4 = local_30;
        if (local_30 == (longlong *)0x0) {
LAB_14027bfab:
          if (plVar4 != (longlong *)0x0) {
            if (plVar4 == plVar1) {
              if (plVar4 != (longlong *)0x0) goto LAB_14027bfd7;
            }
            else {
              iVar5 = DAT_140608054 + 1;
              bVar6 = DAT_140608054 == 0;
              DAT_140608054 = iVar5;
              if (bVar6) {
                FUN_140176d60(1);
              }
            }
          }
        }
        else {
          if (local_30 != local_28) {
            iVar5 = DAT_14060804c + 1;
            bVar6 = DAT_14060804c == 0;
            DAT_14060804c = iVar5;
            if (bVar6) {
              FUN_140176d60(1);
            }
            goto LAB_14027bfab;
          }
          lVar2 = *local_30;
          if (lVar2 == 0) goto LAB_14027bfab;
          FUN_14027b4b0(param_4,lVar2 + 0x978,lVar2 + 0x93c);
LAB_14027bfd7:
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            puVar3 = (undefined8 *)*plVar4;
            local_30 = (longlong *)0x0;
            if (puVar3 != (undefined8 *)0x0) {
              (**(code **)*puVar3)(puVar3,1);
            }
            operator_delete(plVar4);
          }
        }
      }
      param_2 = param_2 + 1;
    } while (param_2 != param_3);
    *param_1 = param_4;
  }
  return param_1;
}



longlong * FUN_14027c040(longlong *param_1,longlong *param_2,longlong *param_3,longlong *param_4)

{
  longlong lVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  bool bVar7;
  undefined4 local_res8 [2];
  
  if (param_2 != param_3) {
    plVar6 = (longlong *)0x0;
    do {
      lVar1 = *param_2;
      if (lVar1 != 0) {
        local_res8[0] = 0;
        puVar2 = *(undefined8 **)*param_4;
        plVar5 = plVar6;
        if (puVar2 != (undefined8 *)0x0) {
          if (puVar2 == (undefined8 *)((longlong *)*param_4)[1]) {
            plVar5 = (longlong *)*puVar2;
          }
          else {
            iVar3 = DAT_14060804c + 1;
            bVar7 = DAT_14060804c == 0;
            DAT_14060804c = iVar3;
            if (bVar7) {
              FUN_140176d60(1);
            }
          }
        }
        lVar4 = (**(code **)(*plVar5 + 0x270))();
        if (lVar4 != 0) {
          puVar2 = *(undefined8 **)*param_4;
          plVar5 = plVar6;
          if (puVar2 != (undefined8 *)0x0) {
            if (puVar2 == (undefined8 *)((undefined8 *)*param_4)[1]) {
              plVar5 = (longlong *)*puVar2;
            }
            else {
              iVar3 = DAT_14060804c + 1;
              bVar7 = DAT_14060804c == 0;
              DAT_14060804c = iVar3;
              if (bVar7) {
                FUN_140176d60(1);
              }
            }
          }
          lVar4 = (**(code **)(*plVar5 + 0x270))();
          local_res8[0] = *(undefined4 *)(lVar4 + 0x150);
        }
        (**(code **)(*(longlong *)(*(longlong *)(lVar1 + 0xb50) + 0x78) + 0xdb0))
                  (*(longlong *)(lVar1 + 0xb50) + 0x78,*(undefined4 *)(lVar1 + 8),&DAT_1405d85a0,
                   *(longlong *)param_4[1] + 8,local_res8);
      }
      param_2 = param_2 + 1;
    } while (param_2 != param_3);
  }
  *param_1 = *param_4;
  param_1[1] = param_4[1];
  return param_1;
}



longlong * FUN_14027c190(longlong *param_1,ulonglong *param_2,ulonglong *param_3,longlong param_4)

{
  ulonglong uVar1;
  undefined8 uVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined4 uStack_10;
  undefined4 uStack_c;
  
  if (param_2 == param_3) {
    *param_1 = param_4;
    return param_1;
  }
  do {
    uVar1 = *param_2;
    if (uVar1 != 0) {
      uStack_10 = *(undefined4 *)(param_4 + 0xe8);
      uStack_c = *(undefined4 *)(param_4 + 0xec);
      uVar4 = *(ulonglong *)(param_4 + 0xe0);
      while (uVar4 != 0) {
        lVar3 = CONCAT44(uStack_c,uStack_10);
        if ((uVar4 <= uVar1) && (uVar1 < (uVar4 - 0x10) + lVar3)) {
          if (uVar4 != 0) {
            FUN_14027bd20(param_4 + 0xd8,uVar1);
          }
          break;
        }
        uVar2 = *(undefined8 *)((uVar4 - 8) + lVar3);
        uStack_10 = (undefined4)uVar2;
        uStack_c = (undefined4)((ulonglong)uVar2 >> 0x20);
        uVar4 = *(ulonglong *)((uVar4 - 0x10) + lVar3);
      }
    }
    param_2 = param_2 + 1;
    if (param_2 == param_3) {
      *param_1 = param_4;
      return param_1;
    }
  } while( true );
}



undefined4 * FUN_14027c270(undefined1 *param_1,undefined1 *param_2,undefined4 *param_3)

{
  wchar_t *_Src;
  undefined1 *puVar1;
  wchar_t wVar2;
  ulonglong uVar3;
  undefined1 *puVar4;
  wchar_t *pwVar5;
  
  if (param_1 != param_2) {
    puVar4 = param_1 + 5;
    do {
      _Src = (wchar_t *)(puVar4 + 0x19);
      *param_3 = *(undefined4 *)(puVar4 + -5);
      *(undefined1 *)(param_3 + 1) = puVar4[-1];
      *(undefined1 *)((longlong)param_3 + 5) = *puVar4;
      *(undefined4 *)((longlong)param_3 + 6) = *(undefined4 *)(puVar4 + 1);
      *(undefined4 *)((longlong)param_3 + 10) = *(undefined4 *)(puVar4 + 5);
      *(undefined8 *)((longlong)param_3 + 0xe) = *(undefined8 *)(puVar4 + 9);
      *(undefined8 *)((longlong)param_3 + 0x16) = *(undefined8 *)(puVar4 + 0x11);
      if (_Src != (wchar_t *)0x0) {
        uVar3 = 0xffffffffffffffff;
        pwVar5 = _Src;
        do {
          if (uVar3 == 0) break;
          uVar3 = uVar3 - 1;
          wVar2 = *pwVar5;
          pwVar5 = pwVar5 + 1;
        } while (wVar2 != L'\0');
        if (~uVar3 - 1 < 0x10) {
          wcscpy_s((wchar_t *)((longlong)param_3 + 0x1e),0x10,_Src);
        }
      }
      param_3 = (undefined4 *)((longlong)param_3 + 0x3e);
      puVar1 = puVar4 + 0x39;
      puVar4 = puVar4 + 0x3e;
    } while (puVar1 != param_2);
  }
  return param_3;
}



undefined4 * FUN_14027c330(longlong param_1,uint param_2)

{
  if (param_2 < 0xf) {
    return (undefined4 *)(param_1 + (longlong)(int)param_2 * 4);
  }
  if (DAT_140608190 == 0) {
    FUN_140176d60(0);
  }
  DAT_140608190 = DAT_140608190 + 1;
  return &DAT_14060818c;
}



void FUN_14027c370(longlong *param_1,longlong *param_2,undefined4 param_3)

{
  longlong lVar1;
  longlong *plVar2;
  undefined4 local_res8 [4];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  
  lVar1 = *param_1;
  if (((((lVar1 != 0) && (*(longlong *)(lVar1 + 0x30) != 0)) &&
       (*(longlong *)(*(longlong *)(lVar1 + 0x30) + 0x2d0) != 0)) &&
      ((*(longlong *)(lVar1 + 0x48) != 0 && (param_2 != (longlong *)0x0)))) &&
     ((param_2[4] != 0 &&
      ((lVar1 = *(longlong *)(param_2[4] + 0x48), lVar1 != 0 &&
       (local_res18[0] = param_3,
       plVar2 = (longlong *)
                FUN_140195560(lVar1,*(undefined4 *)((longlong)param_2 + 0x10c),(int)param_2[0x21]),
       plVar2 != (longlong *)0x0)))))) {
    local_24 = (undefined4)param_2[0x1f];
    FUN_1402fbd60(plVar2);
    local_res20[0] = (undefined4)plVar2[0x25];
    local_res8[0] = (**(code **)(*plVar2 + 0xb0))(plVar2);
    FUN_1402c6bd0(*(undefined8 *)(*(longlong *)(*param_1 + 0x30) + 0x2d0),
                  *(undefined4 *)(*param_2 + 8));
    local_28 = (undefined4)param_2[0xf];
    local_20 = (**(code **)(*plVar2 + 0xb0))(plVar2);
    local_1c = (undefined4)plVar2[0x25];
    plVar2 = (longlong *)(**(longlong **)(*param_1 + 0x48) + 0x3a0);
    (**(code **)(*plVar2 + 0xb00))
              (plVar2,*(undefined4 *)(*param_1 + 8),&DAT_1405d85a0,&local_1c,&local_20,&local_24,
               &local_28,local_res20,local_res8,local_res18);
    FUN_14027d5c0(param_2);
    operator_delete(param_2);
  }
  return;
}



void FUN_14027c500(longlong *param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  bool bVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  bool bVar7;
  bool bVar8;
  longlong local_res8;
  undefined8 uVar9;
  undefined8 local_88;
  undefined8 uStack_80;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  undefined1 local_58 [32];
  
  uVar9 = 0xfffffffffffffffe;
  local_res8 = 0;
  bVar8 = false;
  bVar1 = false;
  plVar4 = (longlong *)param_1[1];
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == (longlong *)param_1[2]) {
      if (*plVar4 != 0) {
        local_res8 = *plVar4;
        if ((plVar4 != (longlong *)param_1[2]) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, local_res8 = 0,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(local_res8);
        bVar8 = true;
        bVar1 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (((*param_1 == 0) || (lVar3 = *(longlong *)(*param_1 + 0x30), lVar3 == 0)) ||
     (*(longlong *)(lVar3 + 0x2d0) == 0)) goto LAB_14027c722;
  if (param_1[0xc] == 0) {
    local_88 = (undefined8 *)0x0;
LAB_14027c60a:
    uStack_80 = (undefined8 *)0x0;
  }
  else {
    local_88 = (undefined8 *)param_1[0xe];
    if (local_88 == (undefined8 *)0x0) goto LAB_14027c60a;
    uStack_80 = (undefined8 *)*local_88;
  }
  if (uStack_80 != (undefined8 *)0x0) {
    puVar5 = local_88;
    puVar6 = uStack_80;
    while( true ) {
      plVar4 = (longlong *)puVar6[2];
      if ((((*param_1 == 0) || (lVar3 = *(longlong *)(*param_1 + 0x30), lVar3 == 0)) ||
          ((*(longlong *)(lVar3 + 0x2d0) == 0 || ((plVar4 == (longlong *)0x0 || (*plVar4 == 0))))))
         || ((*(int *)((longlong)plVar4 + 0xf4) != 1 ||
             ((((plVar4[4] == 0 || (lVar3 = *(longlong *)(plVar4[4] + 0x48), lVar3 == 0)) ||
               (lVar3 = FUN_140195560(lVar3,*(undefined4 *)((longlong)plVar4 + 0x10c),
                                      (int)plVar4[0x21],param_4,uVar9), lVar3 == 0)) ||
              (*(int *)(lVar3 + 0x128) != param_2)))))) {
        puVar6 = (undefined8 *)*puVar6;
        while (puVar6 == (undefined8 *)0x0) {
          puVar5 = puVar5 + 1;
          local_88 = puVar5;
          puVar6 = (undefined8 *)*puVar5;
        }
        if (puVar5 == puVar6) {
          puVar6 = (undefined8 *)0x0;
        }
      }
      else {
        FUN_14027c370(param_1,plVar4,1);
        local_68 = (undefined4)local_88;
        uStack_64 = local_88._4_4_;
        uStack_60 = (undefined4)uStack_80;
        uStack_5c = uStack_80._4_4_;
        plVar4 = (longlong *)FUN_14027c900(param_1 + 8,local_58,&local_68);
        puVar5 = (undefined8 *)*plVar4;
        puVar6 = (undefined8 *)plVar4[1];
        local_88 = puVar5;
      }
      bVar8 = bVar1;
      if (puVar6 == (undefined8 *)0x0) break;
      uStack_80._0_4_ = SUB84(puVar6,0);
      uStack_80._4_4_ = (undefined4)((ulonglong)puVar6 >> 0x20);
    }
  }
LAB_14027c722:
  if (bVar8) {
    FUN_14034edd0(local_res8);
  }
  return;
}



void FUN_14027c750(longlong param_1,undefined8 param_2,undefined4 param_3,undefined8 *param_4)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 in_R8;
  undefined8 *puVar7;
  bool bVar8;
  bool bVar9;
  undefined8 *local_50;
  undefined8 *local_48;
  
  puVar7 = (undefined8 *)0x0;
  puVar5 = (undefined8 *)0x0;
  bVar9 = false;
  plVar1 = *(longlong **)(param_1 + 8);
  puVar6 = puVar7;
  if (plVar1 != (longlong *)0x0) {
    puVar6 = puVar5;
    if (plVar1 == *(longlong **)(param_1 + 0x10)) {
      puVar5 = (undefined8 *)*plVar1;
      if (puVar5 != (undefined8 *)0x0) {
        puVar6 = puVar5;
        if ((plVar1 != *(longlong **)(param_1 + 0x10)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, puVar6 = puVar7,
           DAT_1406080a8 = iVar4, bVar9)) {
          FUN_140176d60(1,puVar5,in_R8,param_4,0xfffffffffffffffe,0,0);
        }
        FUN_14034ed40(puVar6);
        bVar9 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar8) {
        FUN_140176d60(1,param_2,in_R8,param_4,0xfffffffffffffffe,0,0);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x60) == 0) {
    local_50 = (undefined8 *)0x0;
  }
  else {
    local_50 = *(undefined8 **)(param_1 + 0x70);
    if (local_50 != (undefined8 *)0x0) {
      local_48 = (undefined8 *)*local_50;
      goto joined_r0x00014027c847;
    }
  }
  local_48 = (undefined8 *)0x0;
joined_r0x00014027c847:
  while (local_48 != (undefined8 *)0x0) {
    lVar2 = local_48[2];
    if ((lVar2 != 0) && (*(int *)(lVar2 + 0xf4) == 1)) {
      puVar5 = puVar7;
      if ((*(longlong *)(lVar2 + 0x20) != 0) &&
         (lVar3 = *(longlong *)(*(longlong *)(lVar2 + 0x20) + 0x48), lVar3 != 0)) {
        puVar5 = (undefined8 *)
                 FUN_140195560(lVar3,*(undefined4 *)(lVar2 + 0x10c),*(undefined4 *)(lVar2 + 0x108));
      }
      if ((puVar5 == param_4) && (*(int *)(lVar2 + 0xfc) == (int)param_2)) {
        *(undefined4 *)(lVar2 + 0x104) = param_3;
      }
    }
    local_48 = (undefined8 *)*local_48;
    while (local_48 == (undefined8 *)0x0) {
      local_50 = local_50 + 1;
      local_48 = (undefined8 *)*local_50;
    }
    if (local_50 == local_48) {
      local_48 = puVar7;
    }
  }
  if (bVar9) {
    FUN_14034edd0(puVar6);
  }
  return;
}



longlong * FUN_14027c900(longlong param_1,longlong *param_2,longlong *param_3)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  
  plVar2 = (longlong *)*param_3;
  plVar3 = (longlong *)param_3[1];
  lVar5 = *param_3;
  lVar6 = *(longlong *)param_3[1];
  while (lVar6 == 0) {
    plVar1 = (longlong *)(lVar5 + 8);
    lVar5 = lVar5 + 8;
    lVar6 = *plVar1;
  }
  if (lVar5 == lVar6) {
    lVar6 = 0;
  }
  *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
  plVar1 = (longlong *)*plVar2;
  plVar4 = plVar2;
  while (plVar1 != plVar3) {
    plVar4 = (longlong *)*plVar4;
    plVar1 = (longlong *)*plVar4;
  }
  *plVar4 = *plVar3;
  operator_delete(plVar3);
  if ((plVar2 == *(longlong **)(param_1 + 0x30)) && (*plVar2 == 0)) {
    *(longlong *)(param_1 + 0x30) = lVar5;
  }
  *param_2 = lVar5;
  param_2[1] = lVar6;
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x00014027cb2e)

void FUN_14027c9d0(longlong param_1,longlong *param_2)

{
  uint uVar1;
  undefined8 *puVar2;
  int iVar3;
  longlong *plVar4;
  uint *puVar5;
  uint *puVar6;
  uint uVar7;
  bool bVar9;
  bool bVar10;
  undefined8 uVar11;
  uint *puVar12;
  undefined1 uVar13;
  int local_60 [2];
  longlong *local_58;
  undefined1 local_50 [24];
  undefined1 local_38 [32];
  uint *puVar8;
  
  uVar11 = 0xfffffffffffffffe;
  puVar8 = (uint *)0x0;
  uVar7 = 0;
  puVar5 = (uint *)0x0;
  puVar12 = (uint *)0x0;
  bVar10 = false;
  uVar13 = 0;
  puVar2 = *(undefined8 **)(param_1 + 8);
  puVar6 = puVar8;
  if (puVar2 != (undefined8 *)0x0) {
    puVar6 = puVar5;
    if (puVar2 == *(undefined8 **)(param_1 + 0x10)) {
      if ((uint *)*puVar2 != (uint *)0x0) {
        puVar6 = (uint *)*puVar2;
        if ((puVar2 != *(undefined8 **)(param_1 + 0x10)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, puVar6 = puVar8,
           DAT_1406080a8 = iVar3, bVar10)) {
          FUN_140176d60(1);
        }
        puVar12 = puVar6;
        FUN_14034ed40(puVar6);
        bVar10 = true;
        uVar13 = 1;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  if ((param_2 != (longlong *)0x0) && (*param_2 != 0)) {
    iVar3 = *(int *)(param_1 + 0x18) + 1;
    *(int *)(param_1 + 0x18) = iVar3;
    local_60[0] = iVar3;
    local_58 = param_2;
    if (*(longlong *)(param_1 + 0x60) == 0) {
      FUN_14027d2d0(param_1 + 0x40,local_38,local_60);
    }
    else {
      FUN_14027d140(param_1 + 0x40,local_50,local_60,local_60,uVar11,puVar12,uVar13);
    }
    *(int *)(param_2 + 0xf) = iVar3;
    uVar1 = *(uint *)(*param_2 + 0x224);
    plVar4 = (longlong *)FUN_140330790();
    puVar12 = puVar8;
    if (*plVar4 != 0) {
      for (puVar5 = *(uint **)(*plVar4 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
          (puVar12 = puVar8, puVar5 != (uint *)0x0 &&
          ((puVar5[0x7c] != uVar1 || (puVar12 = puVar5, *puVar5 != uVar1))));
          puVar5 = *(uint **)(puVar5 + 0x7a)) {
      }
    }
    if (puVar12 != (uint *)0x0) {
      uVar7 = puVar12[0x17];
    }
    *(uint *)(param_2 + 0x20) = uVar7;
    param_2[0x22] = *(longlong *)(param_1 + 0x80);
  }
  if (bVar10) {
    FUN_14034edd0(puVar6);
  }
  return;
}



undefined8 FUN_14027cb90(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  bool bVar6;
  bool bVar7;
  undefined8 *local_20;
  undefined8 *local_18;
  
  puVar3 = (undefined8 *)0x0;
  puVar4 = (undefined8 *)0x0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 8);
  puVar5 = puVar3;
  if (plVar1 != (longlong *)0x0) {
    puVar5 = puVar4;
    if (plVar1 == *(longlong **)(param_1 + 0x10)) {
      if ((undefined8 *)*plVar1 != (undefined8 *)0x0) {
        puVar5 = (undefined8 *)*plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x10)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, puVar5 = puVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(puVar5);
        bVar7 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x60) == 0) {
    local_20 = (undefined8 *)0x0;
  }
  else {
    local_20 = *(undefined8 **)(param_1 + 0x70);
    if (local_20 != (undefined8 *)0x0) {
      local_18 = (undefined8 *)*local_20;
      goto LAB_14027cc61;
    }
  }
  local_18 = (undefined8 *)0x0;
LAB_14027cc61:
  while( true ) {
    if (local_18 == (undefined8 *)0x0) {
      if (bVar7) {
        FUN_14034edd0(puVar5);
      }
      return 0;
    }
    if ((local_18[2] != 0) && (*(int *)(local_18[2] + 0x100) != 0)) break;
    local_18 = (undefined8 *)*local_18;
    while (local_18 == (undefined8 *)0x0) {
      local_20 = local_20 + 1;
      local_18 = (undefined8 *)*local_20;
    }
    if (local_20 == local_18) {
      local_18 = puVar3;
    }
  }
  if (bVar7) {
    FUN_14034edd0(puVar5);
  }
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014027cf7d)

undefined4 FUN_14027ccd0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  float *pfVar1;
  uint uVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  longlong *plVar6;
  uint *puVar7;
  longlong *plVar8;
  longlong *plVar9;
  longlong *plVar10;
  longlong *plVar11;
  bool bVar12;
  bool bVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  undefined8 *local_80;
  undefined8 *local_78;
  
  if (param_2 == 0) {
    return 0;
  }
  plVar8 = (longlong *)0x0;
  plVar9 = (longlong *)0x0;
  bVar13 = false;
  plVar11 = *(longlong **)(param_1 + 8);
  plVar10 = plVar8;
  if (plVar11 != (longlong *)0x0) {
    plVar10 = plVar9;
    if (plVar11 == *(longlong **)(param_1 + 0x10)) {
      plVar9 = (longlong *)*plVar11;
      if (plVar9 != (longlong *)0x0) {
        plVar10 = plVar9;
        if ((plVar11 != *(longlong **)(param_1 + 0x10)) &&
           (iVar5 = DAT_1406080a8 + 1, bVar13 = DAT_1406080a8 == 0, plVar10 = plVar8,
           DAT_1406080a8 = iVar5, bVar13)) {
          FUN_140176d60(1,plVar9,param_3,param_4,0xfffffffffffffffe);
        }
        FUN_14034ed40(plVar10);
        bVar13 = true;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar12 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar12) {
        FUN_140176d60(1,param_2,param_3,param_4,0xfffffffffffffffe);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x60) == 0) {
    local_80 = (undefined8 *)0x0;
  }
  else {
    local_80 = *(undefined8 **)(param_1 + 0x70);
    if (local_80 != (undefined8 *)0x0) {
      local_78 = (undefined8 *)*local_80;
      goto LAB_14027cdb6;
    }
  }
  local_78 = (undefined8 *)0x0;
LAB_14027cdb6:
  plVar11 = plVar8;
  if (local_78 != (undefined8 *)0x0) {
    do {
      plVar9 = (longlong *)local_78[2];
      if ((plVar9 != (longlong *)0x0) && (uVar2 = *(uint *)(plVar9 + 0x20), uVar2 != 0)) {
        plVar6 = (longlong *)FUN_140330ad0();
        if (*plVar6 != 0) {
          for (puVar7 = *(uint **)(*plVar6 +
                                  ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar6 + 2)) * 8);
              puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 0xc)) {
            if ((puVar7[0xe] == uVar2) && (*puVar7 == uVar2)) {
              if ((puVar7 != (uint *)0x0) &&
                 ((puVar7 != (uint *)0xfffffffffffffffc && (lVar3 = *plVar9, lVar3 != 0)))) {
                fVar15 = *(float *)(lVar3 + 0x70) - *(float *)(param_2 + 0x180);
                fVar14 = *(float *)(lVar3 + 0x6c) - *(float *)(param_2 + 0x17c);
                fVar16 = *(float *)(lVar3 + 0x68) - *(float *)(param_2 + 0x178);
                fVar15 = fVar16 * fVar16 + fVar14 * fVar14 + fVar15 * fVar15;
                fVar14 = (float)(0x5f3759df - ((int)fVar15 >> 1));
                fVar14 = fVar14 * (1.5 - fVar14 * fVar14 * fVar15 * 0.5);
                fVar15 = fVar14 * (1.5 - fVar14 * fVar14 * fVar15 * 0.5) * fVar15;
                if (((float)puVar7[5] <= fVar15) &&
                   (pfVar1 = (float *)(*(longlong *)(param_2 + 0x130) + 0x278),
                   fVar15 < *pfVar1 || fVar15 == *pfVar1)) {
                  uVar2 = puVar7[4];
                  cVar4 = FUN_14027d840(plVar9);
                  if ((cVar4 != '\0') && ((int)plVar8 < (int)uVar2)) {
                    plVar8 = (longlong *)(ulonglong)uVar2;
                    plVar11 = plVar9;
                  }
                }
              }
              break;
            }
          }
        }
      }
      local_78 = (undefined8 *)*local_78;
      while (local_78 == (undefined8 *)0x0) {
        local_80 = local_80 + 1;
        local_78 = (undefined8 *)*local_80;
      }
      if (local_80 == local_78) {
        local_78 = (undefined8 *)0x0;
      }
    } while (local_78 != (undefined8 *)0x0);
    if (plVar11 != (longlong *)0x0) {
      lVar3 = plVar11[0xf];
      if (bVar13) {
        FUN_14034edd0(plVar10);
        return (int)lVar3;
      }
      return (int)lVar3;
    }
  }
  if (bVar13) {
    FUN_14034edd0(plVar10);
  }
  return 0;
}



longlong FUN_14027cfe0(longlong param_1,int param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  bool bVar7;
  bool bVar8;
  undefined8 *local_20;
  undefined8 *local_18;
  
  puVar6 = (undefined8 *)0x0;
  puVar4 = (undefined8 *)0x0;
  bVar8 = false;
  plVar1 = *(longlong **)(param_1 + 8);
  puVar5 = puVar6;
  if (plVar1 != (longlong *)0x0) {
    puVar5 = puVar4;
    if (plVar1 == *(longlong **)(param_1 + 0x10)) {
      if ((undefined8 *)*plVar1 != (undefined8 *)0x0) {
        puVar5 = (undefined8 *)*plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x10)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, puVar5 = puVar6,
           DAT_1406080a8 = iVar3, bVar8)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(puVar5);
        bVar8 = true;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0x60) == 0) {
    local_20 = (undefined8 *)0x0;
  }
  else {
    local_20 = *(undefined8 **)(param_1 + 0x70);
    if (local_20 != (undefined8 *)0x0) {
      local_18 = (undefined8 *)*local_20;
      goto LAB_14027d0ba;
    }
  }
  local_18 = (undefined8 *)0x0;
LAB_14027d0ba:
  while( true ) {
    if (local_18 == (undefined8 *)0x0) {
      if (bVar8) {
        FUN_14034edd0(puVar5);
      }
      return 0;
    }
    lVar2 = local_18[2];
    if ((lVar2 != 0) && (*(int *)(lVar2 + 0x78) == param_2)) break;
    local_18 = (undefined8 *)*local_18;
    while (local_18 == (undefined8 *)0x0) {
      local_20 = local_20 + 1;
      local_18 = (undefined8 *)*local_20;
    }
    if (local_20 == local_18) {
      local_18 = puVar6;
    }
  }
  if (!bVar8) {
    return lVar2;
  }
  FUN_14034edd0(puVar5);
  return lVar2;
}



undefined8 * FUN_14027d140(longlong *param_1,undefined8 *param_2,int *param_3,undefined4 *param_4)

{
  int iVar1;
  char cVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  char *local_res8;
  undefined **local_38;
  undefined8 local_30;
  undefined8 local_28;
  
  iVar1 = *param_3;
  puVar5 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar1 % (ulonglong)param_1[1]) * 8);
  puVar3 = (undefined8 *)*puVar5;
  do {
    if (puVar3 == (undefined8 *)0x0) {
LAB_14027d1b4:
      puVar3 = operator_new(0x18);
      if (puVar3 != (undefined8 *)0x0) {
        *puVar3 = 0;
        puVar3[1] = local_30;
        puVar3[2] = local_28;
        if (puVar3 + 1 != (undefined8 *)0x0) {
          *(undefined4 *)(puVar3 + 1) = *param_4;
          puVar3[2] = *(undefined8 *)(param_4 + 2);
        }
        cVar2 = FUN_14027dc40(param_1);
        if (cVar2 != '\0') {
          puVar5 = (undefined8 *)
                   (*param_1 + ((ulonglong)(longlong)iVar1 % (ulonglong)param_1[1]) * 8);
        }
        *puVar3 = *puVar5;
        *puVar5 = puVar3;
        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 = puVar5;
        param_2[1] = puVar3;
        *(undefined1 *)(param_2 + 2) = 1;
        return param_2;
      }
      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_1405d3608);
    }
    if (iVar1 == *(int *)(puVar3 + 1)) {
      if (puVar3 != (undefined8 *)0x0) {
        *param_2 = puVar5;
        param_2[1] = puVar3;
        *(undefined1 *)(param_2 + 2) = 0;
        return param_2;
      }
      goto LAB_14027d1b4;
    }
    puVar3 = (undefined8 *)*puVar3;
  } while( true );
}



undefined8 * FUN_14027d2d0(longlong *param_1,undefined8 *param_2,int *param_3)

{
  int *piVar1;
  char **ppcVar2;
  undefined8 *puVar3;
  int iVar4;
  undefined8 *puVar5;
  longlong lVar6;
  char **ppcVar7;
  char *local_res8;
  undefined **local_38;
  undefined8 local_30;
  undefined8 local_28;
  
  puVar5 = operator_new(0x18);
  if (puVar5 != (undefined8 *)0x0) {
    *puVar5 = 0;
    puVar5[1] = local_30;
    puVar5[2] = local_28;
    piVar1 = (int *)(puVar5 + 1);
    if (piVar1 != (int *)0x0) {
      *piVar1 = *param_3;
      puVar5[2] = *(undefined8 *)(param_3 + 2);
    }
    iVar4 = *piVar1;
    if (*param_1 == 0) {
      local_res8 = (char *)FUN_1402c9710(param_1,1);
      ppcVar2 = (char **)(param_1 + 1);
      ppcVar7 = &local_res8;
      if (local_res8 <= *ppcVar2) {
        ppcVar7 = ppcVar2;
      }
      *ppcVar2 = *ppcVar7;
      FUN_140346140(param_1);
      FUN_140296160(param_1);
    }
    else if ((ulonglong)param_1[7] < 2) {
      local_res8 = (char *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      lVar6 = FUN_1402c9710(param_1);
      if (lVar6 != param_1[1]) {
        FUN_14027dcb0(param_1);
      }
    }
    puVar3 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar4 % (ulonglong)param_1[1]) * 8);
    *puVar5 = *puVar3;
    *puVar3 = puVar5;
    param_1[4] = param_1[4] + 1;
    param_1[6] = (longlong)puVar3;
    *param_2 = puVar3;
    param_2[1] = puVar5;
    *(undefined1 *)(param_2 + 2) = 1;
    return param_2;
  }
  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_1405d3608);
}



undefined8 * FUN_14027d480(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0xe0);
  lVar1 = *(longlong *)(param_1 + 0xe8);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



undefined8 * FUN_14027d4b0(undefined8 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[8] = 0xf;
  param_1[7] = 0;
  *(undefined1 *)(param_1 + 5) = 0;
  param_1[0xd] = 7;
  param_1[0xc] = 0;
  *(undefined2 *)(param_1 + 10) = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  *(undefined4 *)(param_1 + 0x13) = 0;
  param_1[0x18] = 0;
  *(undefined4 *)(param_1 + 0x19) = 0;
  *(undefined8 *)((longlong)param_1 + 0xcc) = 0;
  *(undefined4 *)((longlong)param_1 + 0xd4) = 0;
  param_1[0x1b] = 0;
  *(undefined4 *)(param_1 + 0x1c) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xec) = 0;
  *(undefined8 *)((longlong)param_1 + 0x9c) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xa4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xac) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xb4) = 0;
  *(undefined4 *)((longlong)param_1 + 0xbc) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xf4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xfc) = 0;
  *(undefined4 *)((longlong)param_1 + 0x104) = 0;
  param_1[0x22] = 0;
  FUN_1402ca220(param_1 + 0x23);
  *(undefined4 *)(param_1 + 0x2b) = 0;
  return param_1;
}



void FUN_14027d5c0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  if (*(longlong *)(param_1 + 0x118) != 0) {
    FUN_14012e3f0();
  }
  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 (0xf < *(ulonglong *)(param_1 + 0x40)) {
    operator_delete(*(void **)(param_1 + 0x28));
  }
  *(undefined8 *)(param_1 + 0x40) = 0xf;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined1 *)(param_1 + 0x28) = 0;
  plVar3 = *(longlong **)(param_1 + 0x10);
  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_14027d660(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong *plVar6;
  int iVar7;
  undefined8 uVar8;
  undefined4 local_res10 [2];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined4 local_68 [2];
  undefined8 local_60;
  undefined4 local_58;
  float local_54;
  undefined4 local_50;
  undefined4 uStack_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  
  if ((param_2 != 0) && (local_60 = 0xfffffffffffffffe, param_1[3] != 0)) {
    *param_1 = param_2;
    FUN_1402cd500(param_2,1);
    uVar8 = FUN_14027d480(*param_1,&local_58);
    FUN_140343ec0(param_1 + 1,uVar8);
    plVar6 = (longlong *)CONCAT44(uStack_4c,local_50);
    if (plVar6 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar6 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar6 + 8))(plVar6);
        LOCK();
        piVar2 = (int *)((longlong)plVar6 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar6 + 0x10))(plVar6);
        }
      }
    }
    if (param_1[1] != 0) {
      FUN_1402c5990(param_1[1],*param_1 + 0x90);
    }
    lVar5 = *param_1;
    uVar3 = *(undefined4 *)(lVar5 + 0x6c);
    uVar4 = *(undefined4 *)(lVar5 + 0x70);
    *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(lVar5 + 0x68);
    *(undefined4 *)((longlong)param_1 + 0x84) = uVar3;
    *(undefined4 *)(param_1 + 0x11) = uVar4;
    *(undefined4 *)((longlong)param_1 + 0x8c) = 0x437a0000;
    local_58 = *(undefined4 *)(lVar5 + 0x68);
    local_50 = *(undefined4 *)(lVar5 + 0x70);
    local_54 = *(float *)(lVar5 + 0x6c) - 150.0;
    local_54 = (*(float *)(lVar5 + 0x6c) - local_54) * 0.5 + local_54;
    *(undefined4 *)(param_1 + 0x12) = local_58;
    *(float *)((longlong)param_1 + 0x94) = local_54;
    *(undefined4 *)(param_1 + 0x13) = local_50;
    local_res18[0] = 0;
    local_res10[0] = 0;
    local_48 = *(undefined4 *)(lVar5 + 0x68);
    local_44 = *(undefined4 *)(lVar5 + 0x6c);
    local_40 = *(undefined4 *)(lVar5 + 0x70);
    lVar5 = param_1[3];
    local_res20[0] = 0xcb189680;
    if ((*(int *)(lVar5 + 0x428) != 0) &&
       (iVar7 = FUN_1402be1a0(lVar5 + 0x370,local_res20,local_res18,local_res10,&local_48,2),
       iVar7 == 1)) {
      local_68[0] = 0xcb189680;
      FUN_1402be8a0(lVar5 + 0x370,local_68,&local_48,param_1 + 0x10,param_1 + 0x12);
    }
    *(undefined4 *)((longlong)param_1 + 0x7c) = local_res10[0];
  }
  return;
}



ulonglong FUN_14027d840(longlong param_1,longlong *param_2)

{
  float fVar1;
  uint uVar2;
  double *pdVar3;
  int iVar4;
  ulonglong in_RAX;
  double *pdVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined4 extraout_var;
  undefined4 local_res10 [2];
  
  if (param_2 == (longlong *)0x0) {
    return in_RAX & 0xffffffffffffff00;
  }
  uVar2 = *(uint *)(param_1 + 0x100);
  pdVar5 = (double *)FUN_140330ad0();
  if (*pdVar5 != 0.0) {
    for (pdVar3 = *(double **)
                   ((longlong)*pdVar5 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(pdVar5 + 2)) * 8);
        pdVar5 = pdVar3, pdVar3 != (double *)0x0; pdVar3 = (double *)pdVar3[6]) {
      if ((*(uint *)(pdVar3 + 7) == uVar2) && (*(uint *)pdVar3 == uVar2)) {
        if ((pdVar3 != (double *)0x0) && (pdVar3 != (double *)0xfffffffffffffffc)) {
          local_res10[0] = (undefined4)param_2[0x25];
          lVar6 = FUN_14027d990(param_1 + 0x118,local_res10);
          pdVar5 = (double *)(lVar6 + 8);
          if ((double)*(float *)((longlong)pdVar3 + 0xc) < *(double *)(param_1 + 0x110) - *pdVar5) {
            local_res10[0] = (undefined4)param_2[0x25];
            lVar6 = FUN_14027d990(param_1 + 0x118,local_res10);
            *(undefined8 *)(lVar6 + 8) = *(undefined8 *)(param_1 + 0x110);
            pdVar5 = (double *)(**(code **)(*param_2 + 0xb0))(param_2);
            if ((int)pdVar5 == 4) {
              lVar6 = param_2[0x24];
              uVar7 = FUN_140302f80();
              iVar4 = FUN_140301120(uVar7,(int)lVar6);
              fVar1 = *(float *)((longlong)pdVar3 + (longlong)iVar4 * 4 + 0x18);
              iVar4 = rand();
              pdVar5 = (double *)CONCAT44(extraout_var,iVar4);
              if ((float)iVar4 / 32767.0 < fVar1) {
                return CONCAT71((int7)((ulonglong)pdVar5 >> 8),1);
              }
            }
          }
        }
        break;
      }
    }
  }
  return (ulonglong)pdVar5 & 0xffffffffffffff00;
}



int * FUN_14027d990(longlong *param_1,int *param_2)

{
  char **ppcVar1;
  int iVar2;
  char cVar3;
  undefined8 *puVar4;
  char *pcVar5;
  undefined8 *puVar6;
  int *piVar7;
  char **ppcVar8;
  char *local_res8;
  undefined8 local_res10;
  undefined **local_58;
  undefined8 local_50;
  undefined8 local_48;
  
  local_res8 = (char *)(longlong)*param_2;
  ppcVar1 = (char **)(param_1 + 1);
  puVar4 = (undefined8 *)(*param_1 + ((ulonglong)local_res8 % (ulonglong)*ppcVar1) * 8);
  if (*param_1 == 0) {
    puVar4 = operator_new(0x18);
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (char *)0x0;
      std::exception::exception((exception *)&local_58,&local_res8);
      local_58 = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_58,(ThrowInfo *)&DAT_1405d3608);
    }
    *puVar4 = 0;
    puVar4[1] = local_50;
    puVar4[2] = local_48;
    piVar7 = (int *)(puVar4 + 1);
    if (piVar7 != (int *)0x0) {
      *piVar7 = *param_2;
      puVar4[2] = 0;
    }
    iVar2 = *piVar7;
    if (*param_1 == 0) {
      local_res8 = (char *)FUN_1402c9710(param_1);
      ppcVar8 = &local_res8;
      if (local_res8 <= *ppcVar1) {
        ppcVar8 = ppcVar1;
      }
      *ppcVar1 = *ppcVar8;
      FUN_140346140(param_1);
      FUN_140296160(param_1);
    }
    else {
      local_res10 = 1;
      if ((ulonglong)param_1[7] < 2) {
        local_res8 = (char *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
        pcVar5 = (char *)FUN_1402c9710(param_1);
        if (pcVar5 != *ppcVar1) {
          FUN_14027dcb0(param_1);
        }
      }
    }
    puVar6 = (undefined8 *)(*param_1 + ((ulonglong)(longlong)iVar2 % (ulonglong)*ppcVar1) * 8);
    *puVar4 = *puVar6;
    *puVar6 = puVar4;
    param_1[4] = param_1[4] + 1;
    param_1[6] = (longlong)puVar6;
  }
  else {
    for (puVar6 = (undefined8 *)*puVar4; puVar6 != (undefined8 *)0x0; puVar6 = (undefined8 *)*puVar6
        ) {
      if (*param_2 == *(int *)(puVar6 + 1)) {
        if (puVar6 != (undefined8 *)0x0) {
          return (int *)(puVar6 + 1);
        }
        break;
      }
    }
    puVar6 = operator_new(0x18);
    if (puVar6 == (undefined8 *)0x0) {
      local_res8 = (char *)0x0;
      std::exception::exception((exception *)&local_58,&local_res8);
      local_58 = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_58,(ThrowInfo *)&DAT_1405d3608);
    }
    *puVar6 = 0;
    puVar6[1] = local_50;
    puVar6[2] = local_48;
    piVar7 = (int *)(puVar6 + 1);
    if (piVar7 != (int *)0x0) {
      *piVar7 = *param_2;
      puVar6[2] = 0;
    }
    cVar3 = FUN_14027dc40(param_1);
    if (cVar3 != '\0') {
      puVar4 = (undefined8 *)(*param_1 + ((ulonglong)local_res8 % (ulonglong)*ppcVar1) * 8);
    }
    *puVar6 = *puVar4;
    *puVar4 = puVar6;
    param_1[4] = param_1[4] + 1;
    puVar6 = (undefined8 *)param_1[6];
    if (puVar4 < (undefined8 *)param_1[6]) {
      puVar6 = puVar4;
    }
    param_1[6] = (longlong)puVar6;
  }
  return piVar7;
}



void FUN_14027dc20(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14012e3f0();
  }
  return;
}



undefined8 FUN_14027dc40(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_14027dcb0(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_14027dcb0(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong lVar9;
  ulonglong uVar10;
  undefined8 *puVar11;
  longlong *plVar12;
  longlong *local_30;
  ulonglong local_28;
  
  lVar9 = param_1[4];
  lVar1 = param_1[1];
  lVar2 = *param_1;
  local_30 = (longlong *)0x0;
  local_28 = param_2;
  FUN_140346140(&local_30);
  lVar3 = param_1[1];
  puVar4 = (undefined8 *)*param_1;
  *param_1 = 0;
  param_1[1] = lVar3;
  param_1[4] = 0;
  for (plVar12 = (longlong *)param_1[6]; plVar12 != (longlong *)(lVar2 + lVar1 * 8);
      plVar12 = plVar12 + 1) {
    plVar8 = (longlong *)*plVar12;
    while (plVar8 != (longlong *)0x0) {
      uVar10 = (ulonglong)(longlong)(int)plVar8[1] % local_28;
      *plVar12 = *plVar8;
      *plVar8 = local_30[uVar10];
      local_30[uVar10] = (longlong)plVar8;
      plVar8 = (longlong *)*plVar12;
    }
  }
  param_1[4] = lVar9;
  plVar12 = (longlong *)*param_1;
  *param_1 = (longlong)local_30;
  uVar10 = param_1[1];
  param_1[1] = local_28;
  if (param_1[4] == 0) {
    param_1[6] = *param_1 + local_28 * 8;
  }
  else {
    plVar8 = (longlong *)*param_1;
    param_1[6] = (longlong)plVar8;
    lVar9 = *plVar8;
    while (lVar9 == 0) {
      plVar8 = plVar8 + 1;
      param_1[6] = (longlong)plVar8;
      lVar9 = *plVar8;
    }
  }
  local_30 = plVar12;
  local_28 = uVar10;
  lVar9 = FUN_1402961d0(param_1);
  param_1[7] = lVar9;
  if (puVar4 != (undefined8 *)0x0) {
    for (puVar11 = puVar4; puVar11 != puVar4 + lVar3; puVar11 = puVar11 + 1) {
      puVar5 = (undefined8 *)*puVar11;
      *puVar11 = 0;
      while (puVar5 != (undefined8 *)0x0) {
        puVar6 = (undefined8 *)*puVar5;
        operator_delete(puVar5);
        puVar5 = puVar6;
      }
    }
    operator_delete(puVar4);
    uVar10 = local_28;
    plVar12 = local_30;
  }
  if (plVar12 != (longlong *)0x0) {
    plVar8 = plVar12 + uVar10;
    plVar7 = plVar12;
    for (; plVar12 != plVar8; plVar12 = plVar12 + 1) {
      puVar4 = (undefined8 *)*plVar12;
      *plVar12 = 0;
      while (puVar4 != (undefined8 *)0x0) {
        puVar11 = (undefined8 *)*puVar4;
        operator_delete(puVar4);
        puVar4 = puVar11;
      }
      plVar7 = local_30;
    }
    operator_delete(plVar7);
  }
  return;
}



void FUN_14027de90(longlong param_1)

{
  void *_Dst;
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  if (puVar1 != *(undefined8 **)(param_1 + 0x18)) {
    do {
      operator_delete((void *)*puVar1);
      puVar1 = puVar1 + 1;
    } while (puVar1 != *(undefined8 **)(param_1 + 0x18));
  }
  _Dst = *(void **)(param_1 + 0x10);
  if (_Dst != *(void **)(param_1 + 0x18)) {
    memmove(_Dst,*(void **)(param_1 + 0x18),0);
    *(void **)(param_1 + 0x18) = _Dst;
  }
  if (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  return;
}



longlong * FUN_14027df30(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  longlong lVar2;
  char cVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  float fVar8;
  float fVar9;
  longlong *local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  if ((*(longlong *)(param_1 + 8) == 0) ||
     (cVar3 = (**(code **)(**(longlong **)(param_1 + 8) + 0x20))(), cVar3 != '\0')) {
    plVar6 = (longlong *)0x0;
    fVar9 = 0.0;
    plVar1 = *(longlong **)(param_1 + 0x30);
    lVar5 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar5 == 0) {
      plVar1 = *(longlong **)(param_1 + 0x30);
      local_60 = (longlong *)0x0;
      local_58 = 0;
      local_50 = 0;
      cVar3 = (**(code **)(*plVar1 + 0x180))(plVar1,&local_60,*(undefined4 *)(plVar1[0x26] + 0x278))
      ;
      if (cVar3 == '\0') {
        (**(code **)(**(longlong **)(param_1 + 0x30) + 0x118))(*(longlong **)(param_1 + 0x30),0,0);
      }
      else {
        lVar2 = ((longlong *)*local_60)[0x25];
        lVar5 = **(longlong **)(param_1 + 0x30);
        uVar4 = (**(code **)(*(longlong *)*local_60 + 0xb0))();
        (**(code **)(lVar5 + 0x118))(*(undefined8 *)(param_1 + 0x30),uVar4,(int)lVar2);
        *(undefined4 *)(*(longlong *)(param_1 + 0x30) + 0x22d4) = *(undefined4 *)(*local_60 + 0x128)
        ;
      }
      plVar1 = *(longlong **)(param_1 + 0x30);
      lVar5 = (**(code **)(*plVar1 + 0x430))
                        (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
      if (local_60 != (longlong *)0x0) {
        operator_delete(local_60);
      }
      local_60 = (longlong *)0x0;
      local_58 = 0;
      local_50 = 0;
    }
    puVar7 = *(undefined8 **)(param_1 + 0x10);
    if (puVar7 != *(undefined8 **)(param_1 + 0x18)) {
      do {
        plVar1 = (longlong *)*puVar7;
        fVar8 = (float)(**(code **)(*plVar1 + 8))(plVar1,lVar5,param_1,param_2,param_3);
        if (fVar9 < fVar8) {
          plVar6 = plVar1;
          fVar9 = fVar8;
        }
        puVar7 = puVar7 + 1;
      } while (puVar7 != *(undefined8 **)(param_1 + 0x18));
      if (plVar6 != (longlong *)0x0) {
        cVar3 = (**(code **)(*plVar6 + 0x10))(plVar6,param_1,param_2);
        if (cVar3 == '\x01') {
          *(undefined1 *)(plVar6 + 1) = 0;
        }
        if ((DAT_14060b7c4 & 1) == 0) {
          DAT_14060b7c4 = DAT_14060b7c4 | 1;
          FUN_140418590();
          atexit((_func_5014 *)&LAB_140448470);
        }
        if (DAT_14060a120 == 1000) {
          lVar5 = **(longlong **)(param_1 + 0x30);
          uVar4 = (**(code **)*plVar6)(plVar6);
          (**(code **)(lVar5 + 0x470))(*(undefined8 *)(param_1 + 0x30),uVar4);
        }
      }
    }
  }
  else {
    plVar6 = *(longlong **)(param_1 + 8);
  }
  return plVar6;
}



void FUN_14027e160(longlong param_1,undefined4 param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  undefined8 local_res8;
  
  uVar3 = FUN_14028f2c0(param_2);
  puVar1 = *(undefined8 **)(param_1 + 0x18);
  local_res8 = uVar3;
  if ((&local_res8 < puVar1) && (puVar2 = *(undefined8 **)(param_1 + 0x10), puVar2 <= &local_res8))
  {
    if (puVar1 == *(undefined8 **)(param_1 + 0x20)) {
      FUN_140195b20(param_1 + 0x10);
    }
    if (*(undefined8 **)(param_1 + 0x18) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x18) =
           *(undefined8 *)
            (*(longlong *)(param_1 + 0x10) + ((longlong)&local_res8 - (longlong)puVar2 >> 3) * 8);
      *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + 8;
      return;
    }
  }
  else {
    if (puVar1 == *(undefined8 **)(param_1 + 0x20)) {
      FUN_140195b20(param_1 + 0x10);
    }
    if (*(undefined8 **)(param_1 + 0x18) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x18) = uVar3;
    }
  }
  *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + 8;
  return;
}



void FUN_14027e210(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  short *psVar5;
  bool bVar6;
  
  FUN_14027e160(param_1,0);
  if ((*(longlong *)(param_1 + 0x30) != 0) &&
     (plVar2 = (longlong *)(**(code **)(**(longlong **)(param_1 + 0x30) + 0xe0))(),
     plVar2 != (longlong *)0x0)) {
    iVar1 = (**(code **)(*plVar2 + 0x10))(plVar2);
    if (iVar1 != 0) {
      FUN_14027e160(param_1,1);
      FUN_14027e160(param_1,0xf);
    }
    iVar1 = (**(code **)(*plVar2 + 0x48))(plVar2);
    if (iVar1 != 0) {
      FUN_14027e160(param_1,2);
    }
    iVar1 = (**(code **)(*plVar2 + 8))(plVar2);
    if (iVar1 != 0) {
      FUN_14027e160(param_1,3);
    }
    iVar1 = (**(code **)(*plVar2 + 0x18))(plVar2);
    if (iVar1 != 0) {
      FUN_14027e160(param_1,4);
    }
    lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x30) + 0x22e8);
    if (*(int *)(lVar4 + 0x40) != 0) {
      FUN_14027e160(param_1,5);
    }
    iVar1 = (**(code **)(*plVar2 + 0x68))(plVar2);
    if (iVar1 != 0) {
      FUN_14027e160(param_1,6);
    }
    iVar1 = (**(code **)(*plVar2 + 0x50))(plVar2);
    if (iVar1 != 0) {
      FUN_14027e160(param_1,7);
    }
    iVar1 = (**(code **)(*plVar2 + 0x30))(plVar2);
    if (iVar1 != 0) {
      FUN_14027e160(param_1,8);
      FUN_14027e160(param_1,9);
    }
    if (*(longlong *)(*(longlong *)(param_1 + 0x30) + 0x2318) != 0) {
      FUN_14027e160(param_1,10);
    }
    if (10.0 < *(float *)(lVar4 + 0x18)) {
      FUN_14027e160(param_1,0xb);
    }
    plVar2 = (longlong *)(lVar4 + 0x198);
    bVar6 = *(ulonglong *)(lVar4 + 0x1b0) == 8;
    if (7 < *(ulonglong *)(lVar4 + 0x1b0)) {
      plVar2 = (longlong *)*plVar2;
    }
    lVar3 = 1;
    psVar5 = &DAT_140477960;
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      bVar6 = *(short *)plVar2 == *psVar5;
      plVar2 = (longlong *)((longlong)plVar2 + 2);
      psVar5 = psVar5 + 1;
    } while (bVar6);
    if (!bVar6) {
      FUN_14027e160(param_1,0xc);
    }
    plVar2 = (longlong *)(lVar4 + 0x1c0);
    bVar6 = *(ulonglong *)(lVar4 + 0x1d8) == 8;
    if (7 < *(ulonglong *)(lVar4 + 0x1d8)) {
      plVar2 = (longlong *)*plVar2;
    }
    lVar4 = 1;
    psVar5 = &DAT_140477960;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar6 = *(short *)plVar2 == *psVar5;
      plVar2 = (longlong *)((longlong)plVar2 + 2);
      psVar5 = psVar5 + 1;
    } while (bVar6);
    if (!bVar6) {
      FUN_14027e160(param_1,0xd);
    }
    FUN_14027e160(param_1,0xe);
  }
  return;
}



undefined8 FUN_14027e400(longlong param_1,int param_2,undefined8 param_3)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  int iVar5;
  
  iVar5 = 0;
  if (param_2 != 2) {
    if (param_2 == 10) {
      iVar5 = 3;
    }
    else if (param_2 == 0x2f) {
      iVar5 = 7;
    }
    else if (param_2 == 0x46) {
      iVar5 = 10;
    }
    else if (param_2 == 0x4a) {
      iVar5 = 0xc;
    }
  }
  plVar4 = *(longlong **)(param_1 + 0x10);
  if (plVar4 != *(longlong **)(param_1 + 0x18)) {
    do {
      plVar1 = (longlong *)*plVar4;
      iVar3 = (**(code **)*plVar1)(plVar1);
      if ((iVar3 == iVar5) &&
         (cVar2 = (**(code **)(*plVar1 + 0x30))(plVar1,param_1,param_3), cVar2 == '\x01')) {
        *(undefined1 *)(plVar1 + 1) = 0;
        *(longlong **)(param_1 + 8) = plVar1;
        return 1;
      }
      plVar4 = plVar4 + 1;
    } while (plVar4 != *(longlong **)(param_1 + 0x18));
  }
  return 0;
}



void FUN_14027e4c0(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined8 param_9,undefined8 param_10)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_118[0] = 0;
  *(undefined4 *)(param_1 + 0x1e2c) = *(undefined4 *)(param_1 + 0x1e30);
  local_114 = 0;
  FUN_1402b9960(local_118,*(undefined4 *)(param_1 + 0x128),param_2,param_3,param_4,param_5,param_6,
                param_7,param_8,param_9,param_10,*(undefined4 *)(param_1 + 0x1e30));
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_14027e570(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined1 param_8,
                  undefined8 param_9,undefined8 param_10,undefined8 param_11,undefined4 param_12,
                  undefined4 param_13)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_114 = 0;
  *(undefined4 *)(param_1 + 0x1e2c) = *(undefined4 *)(param_1 + 0x1e30);
  local_118[0] = 0;
  FUN_1402bb4a0(local_118,param_1 + 0x128,*(undefined4 *)(param_1 + 300),param_2,param_3,param_4,
                param_5,param_6,param_7,param_8,param_9,param_10,*(undefined4 *)(param_1 + 0x1e30),
                *(undefined4 *)(param_1 + 0x22d0),param_12,param_13);
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_14027e660(longlong *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined8 param_8,
                  undefined8 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12,
                  undefined4 param_13)

{
  longlong lVar1;
  undefined1 local_118 [4];
  undefined8 local_114;
  
  lVar1 = param_1[0xb0];
  if ((param_1[0xaf] != lVar1) || (param_1[0x2c3] != 0)) {
    if (param_1[0xaf] != lVar1) {
      lVar1 = FUN_14023b410(lVar1,lVar1);
      FUN_14023ae30(lVar1,param_1[0xb0]);
      param_1[0xb0] = lVar1;
    }
    FUN_140001710(param_1 + 0x2c1,&DAT_140477960,0);
    FUN_140001710(param_1 + 0x299,&DAT_140477960,0);
    (**(code **)(*param_1 + 0xb90))(param_1);
  }
  local_114 = 0;
  local_118[0] = 0;
  FUN_1402b8c50(local_118,(int)param_1[0x25],param_2,param_3,param_4,param_5,param_6,param_7,param_8
                ,param_9,param_10,param_11,param_12,param_13);
  FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_118);
  return;
}



void FUN_14027e7e0(longlong param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined8 param_9,undefined8 param_10,undefined4 param_11,undefined4 param_12)

{
  undefined1 local_118 [4];
  undefined8 local_114;
  
  *(undefined4 *)(param_1 + 0x1e2c) = *(undefined4 *)(param_1 + 0x1e30);
  local_114 = 0;
  local_118[0] = 0;
  FUN_1402b9f80(local_118,*(undefined4 *)(param_1 + 0x128),param_2,param_3,param_4,param_5,param_6,
                param_7,param_8,param_9,param_10,param_11,param_12,*(undefined4 *)(param_1 + 0x1e30)
               );
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



void FUN_14027e8b0(longlong *param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,
                  undefined4 param_5,undefined4 param_6,undefined8 param_7,undefined8 param_8)

{
  undefined4 uVar1;
  undefined1 local_118 [4];
  undefined8 local_114;
  
  local_114 = 0;
  local_118[0] = 0;
  uVar1 = (**(code **)(*param_1 + 0x80))();
  FUN_1402bb1f0(local_118,param_1 + 0x25,param_2,param_3,param_5,param_6,param_7,param_8,
                *(undefined4 *)((longlong)param_1 + 0x1e2c),uVar1,
                *(undefined4 *)((longlong)param_1 + 0x1ec4),(int)param_1[0x45a]);
  FUN_140194d80(*(undefined8 *)(param_1[0x3d0] + 0x48),local_118);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014027e9d3)

void FUN_14027e980(longlong param_1)

{
  undefined2 local_res8 [4];
  undefined1 local_118 [4];
  int local_114;
  int local_110;
  undefined4 local_10c;
  undefined1 auStack_108 [256];
  
  local_res8[0] = 0;
  if (*(undefined4 **)(param_1 + 0x2308) != (undefined4 *)0x0) {
    local_res8[0] = (undefined2)**(undefined4 **)(param_1 + 0x2308);
  }
  local_10c = *(undefined4 *)(param_1 + 0x128);
  local_118[0] = 0x1d;
  local_114 = 4;
  local_110 = 4;
  memcpy(auStack_108,local_res8,2);
  local_114 = local_114 + 2;
  local_110 = local_114;
  FUN_140194d80(*(undefined8 *)(*(longlong *)(param_1 + 0x1e80) + 0x48),local_118);
  return;
}



undefined8 * FUN_14027ea30(undefined8 *param_1,byte param_2)

{
  *param_1 = MGSCharacterDebugAI::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14027ea60(longlong *param_1)

{
  longlong lVar1;
  int iVar2;
  
  lVar1 = DAT_1406080b8;
  if (*(int *)(DAT_1406080b8 + 0x38) == 1) {
    if (((*(int *)(DAT_1406080b8 + 8) != 0) && (param_1 != (longlong *)0x0)) &&
       (iVar2 = (**(code **)(*param_1 + 0x40))(), *(int *)(lVar1 + 8) != iVar2)) {
      return;
    }
    *(longlong **)(lVar1 + 0x18) = param_1;
  }
  return;
}



void FUN_14027eaa0(longlong *param_1)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  
  iVar1 = *(int *)(DAT_1406080b8 + 8);
  if (iVar1 != 0) {
    iVar2 = (**(code **)(*param_1 + 0x40))();
    lVar3 = DAT_1406080b8;
    if (iVar1 != iVar2) goto LAB_14027ead3;
  }
  lVar3 = DAT_1406080b8;
  if (*(int *)(DAT_1406080b8 + 0x38) == 1) {
    *(undefined8 *)(DAT_1406080b8 + 0x18) = 0;
  }
LAB_14027ead3:
  *(int *)(lVar3 + 0x40) = *(int *)(lVar3 + 0x40) + -1;
  return;
}



undefined8 FUN_14027eae0(void)

{
  return 0;
}



void FUN_14027eaf0(longlong param_1)

{
  float fVar1;
  longlong lVar2;
  
  lVar2 = *(longlong *)(param_1 + 0x48);
  if ((lVar2 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    fVar1 = *(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar2 + 0x605) = 1;
    *(float *)(lVar2 + 0x5dc) = -fVar1 + *(float *)(lVar2 + 0x5dc);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14027eb30(longlong param_1,double param_2)

{
  float fVar1;
  longlong lVar2;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar2 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar2 != 0) {
        fVar1 = *(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar2 + 0x605) = 1;
        *(float *)(lVar2 + 0x5dc) = fVar1 + *(float *)(lVar2 + 0x5dc);
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14027eba0(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((lVar1 != 0) && (0.0 < fVar3)) {
    *(undefined1 *)(lVar1 + 0x605) = 1;
    *(float *)(lVar1 + 0x5dc) = fVar3 + *(float *)(lVar1 + 0x5dc);
  }
  return;
}



void FUN_14027ec00(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x804) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x804);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14027ec50(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x804) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x804);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



void FUN_14027eca0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(undefined4 *)(lVar1 + 0xd7c) = 0;
    *(undefined1 *)(lVar1 + 0x608) = 1;
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0xad8))();
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14027ecf0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(undefined4 *)(lVar1 + 0xd7c) = 3;
        *(undefined1 *)(lVar1 + 0x608) = 1;
        (**(code **)(**(longlong **)(param_1 + 0x48) + 0xad8))();
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14027ed70(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_REFLECTION_DAMAGE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14027ee20(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  float fVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar3 = (float)puVar1[0x2a];
          goto LAB_14027ee7b;
        }
        break;
      }
    }
  }
  fVar3 = 0.0;
LAB_14027ee7b:
  *(int *)(param_1 + 0xa8) = (int)fVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x3a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_14027ef10(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  
  iVar1 = rand();
  if (((float)iVar1 * 3.0517578e-05 < *(float *)(param_1 + 0xac) ||
       (float)iVar1 * 3.0517578e-05 == *(float *)(param_1 + 0xac)) &&
     (plVar2 = *(longlong **)(param_1 + 0x48), plVar2 != (longlong *)0x0)) {
    plVar2 = (longlong *)
             (**(code **)(*plVar2 + 0x430))
                       (plVar2,*(undefined4 *)((longlong)plVar2 + 0x53c),(int)plVar2[0xa8]);
    if (plVar2 != (longlong *)0x0) {
      (**(code **)(*plVar2 + 0x290))(plVar2);
    }
  }
  return;
}



void FUN_14027ef80(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x800) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x800);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14027efc0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x800) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x800);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14027f030(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(lVar1 + 300) != 0x25)) {
    *(int *)(lVar1 + 0x202c) = (int)((float)*(int *)(lVar1 + 0x2030) * *(float *)(param_1 + 0xa8));
    *(undefined1 *)(*(longlong *)(param_1 + 0x48) + 0x2028) = 1;
  }
  return;
}



void FUN_14027f070(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  float fVar4;
  uint uVar5;
  uint uVar6;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  uVar6 = 0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x39];
          goto LAB_14027f0cf;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_14027f0cf:
  *(int *)(param_1 + 0xa8) = (int)fVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar5 = puVar1[0x33];
          goto LAB_14027f11b;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_14027f11b:
  *(uint *)(param_1 + 0xac) = uVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar6 = puVar1[0x41];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0xb0) = uVar6;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_14027f210(longlong param_1,double param_2)

{
  void *pvVar1;
  longlong *plVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  float fVar5;
  undefined1 local_res8 [8];
  undefined1 local_res20 [8];
  undefined4 local_68;
  int local_64 [4];
  undefined4 local_54;
  undefined4 local_50;
  void *local_48;
  longlong local_40;
  undefined8 local_38;
  
  local_64[1] = -2;
  local_64[2] = -1;
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0xb8) = param_2;
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if (param_2 - *(double *)(param_1 + 0x18) < (double)*(float *)(param_1 + 0x60)) {
        if ((double)*(float *)(param_1 + 0xac) <= param_2 - *(double *)(param_1 + 0xb8)) {
          *(double *)(param_1 + 0xb8) = param_2;
          uVar4 = 0;
          local_48 = (void *)0x0;
          local_40 = 0;
          local_38 = 0;
          local_64[3] = *(undefined4 *)(param_1 + 0x80);
          local_54 = *(undefined4 *)(param_1 + 0x84);
          local_50 = *(undefined4 *)(param_1 + 0x88);
          if (*(longlong *)(*(longlong *)(param_1 + 0x48) + 0x1e80) != 0) {
            FUN_1402395e0(*(longlong *)(param_1 + 0x48),&local_48,*(undefined4 *)(param_1 + 0xb0),
                          *(undefined4 *)(param_1 + 0x2c),local_64 + 3);
          }
          pvVar1 = local_48;
          uVar3 = local_40 - (longlong)local_48 >> 3;
          if (uVar3 != 0) {
            do {
              if (((*(int *)(param_1 + 0xa8) != 0) &&
                  (plVar2 = *(longlong **)((longlong)pvVar1 + uVar4 * 8),
                  *(int *)((longlong)plVar2 + 300) != 0x25)) && ((char)plVar2[0x235] == '\0')) {
                fVar5 = (float)-*(int *)(param_1 + 0xa8);
                (**(code **)(*plVar2 + 0x290))(plVar2,fVar5);
                if (*(longlong *)(param_1 + 0x98) != 0) {
                  local_res8[0] = 0;
                  local_68 = *(undefined4 *)(*(longlong *)((longlong)pvVar1 + uVar4 * 8) + 0x128);
                  local_64[0] = (int)fVar5;
                  local_res20[0] =
                       (**(code **)(**(longlong **)((longlong)pvVar1 + uVar4 * 8) + 0xb0))();
                  plVar2 = (longlong *)
                           (*(longlong *)(*(longlong *)(param_1 + 0x40) + 0xb50) + 0x380);
                  (**(code **)(*plVar2 + 0x170))
                            (plVar2,*(undefined4 *)(*(longlong *)(param_1 + 0x98) + 8),
                             &DAT_1405d85a0,local_res20,local_64,&local_68,local_res8);
                }
              }
              uVar4 = uVar4 + 1;
            } while (uVar4 < uVar3);
          }
          if (pvVar1 != (void *)0x0) {
            operator_delete(pvVar1);
          }
        }
      }
      else {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70(param_1);
      }
    }
  }
  return;
}



void FUN_14027f460(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x754) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x754);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14027f4b0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x754) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x754);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



undefined8 * FUN_14027f500(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMP_CONSUMPTION_DOWN_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14027f5b0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x3e];
          goto LAB_14027f60b;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_14027f60b:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x3f];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_14027f6a0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x754) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x754);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14027f6e0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x754) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x754);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0xac) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14027f750(longlong param_1)

{
  longlong lVar1;
  undefined4 *puVar2;
  float fVar3;
  undefined4 local_res8 [8];
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    puVar2 = local_res8;
    local_res8[0] = 0x3e4ccccd;
    fVar3 = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7f8);
    *(float *)(lVar1 + 0x7f8) = fVar3;
    if (fVar3 <= 0.2) {
      puVar2 = (undefined4 *)(lVar1 + 0x7f8);
    }
    *(undefined4 *)(lVar1 + 0x7f8) = *puVar2;
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14027f7c0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7fc) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7fc);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14027f800(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x7fc) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7fc);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14027f870(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14027f8c0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectATTACK_ADD_EFFECT_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



undefined8 * FUN_14027f970(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectATTACK_ADD_EFFECT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14027fa20(longlong param_1,undefined8 param_2)

{
  int iVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    iVar1 = *(int *)(param_1 + 0x3c);
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (iVar1 == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
      iVar1 = 1;
    }
    *(int *)(param_1 + 0x3c) = iVar1;
  }
  return;
}



void FUN_14027fa50(longlong param_1)

{
  uint *puVar1;
  int iVar2;
  longlong *plVar3;
  uint uVar4;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    uVar4 = *(uint *)(param_1 + 0x38);
    plVar3 = (longlong *)FUN_1403161f0();
    if (*plVar3 != 0) {
      for (puVar1 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
          puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
        if ((puVar1[0xea] == uVar4) && (*puVar1 == uVar4)) {
          if (puVar1 != (uint *)0x0) {
            uVar4 = puVar1[3];
            goto LAB_14027fac2;
          }
          break;
        }
      }
    }
    uVar4 = 0;
LAB_14027fac2:
    plVar3 = (longlong *)
             FUN_140267670(uVar4,*(undefined4 *)(param_1 + 0x38),*(undefined8 *)(param_1 + 0x48));
    if (plVar3 != (longlong *)0x0) {
      (**(code **)(*plVar3 + 8))(plVar3,*(undefined4 *)(param_1 + 0x38));
      *(undefined4 *)((longlong)plVar3 + 0x6c) = 3;
      if (*(longlong *)(param_1 + 0x48) != 0) {
        FUN_140236f40(*(longlong *)(param_1 + 0x48),*(undefined8 *)(param_1 + 0x40),plVar3);
      }
    }
  }
  return;
}



undefined8 * FUN_14027fb20(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectSUPER_ARMOR_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



undefined8 * FUN_14027fbd0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectRATIO_DEC_DAMAGE_MAGIC_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  return param_1;
}



void FUN_14027fc80(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((lVar1 != 0) && (0.0 < fVar3)) {
    *(float *)(lVar1 + 0x75c) = fVar3 + *(float *)(lVar1 + 0x75c);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_14027fce0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_HP_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  return param_1;
}



void FUN_14027fd90(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x21];
          goto LAB_14027fdee;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14027fdee:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x40];
          goto LAB_14027fe37;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14027fe37:
  *(uint *)(param_1 + 0xac) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xb0) = puVar1[0x3e];
          goto LAB_14027fe80;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xb0) = 0;
LAB_14027fe80:
  *(undefined4 *)(param_1 + 0xb4) = 0;
  return;
}



void FUN_14027fee0(longlong param_1)

{
  int iVar1;
  
  iVar1 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  *(float *)(param_1 + 0xb4) = (float)iVar1 * *(float *)(param_1 + 0xb0);
  return;
}



void FUN_14027ff20(longlong *param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014027ff23. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x38))();
  return;
}



void FUN_14027ff30(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  
  if (0.0 < *(float *)(param_1 + 0xb4)) {
    iVar2 = rand();
    if ((((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xac)) &&
        (plVar1 = *(longlong **)(param_1 + 0x48), plVar1 != (longlong *)0x0)) &&
       (*(int *)((longlong)plVar1 + 300) != 0x25)) {
      (**(code **)(*plVar1 + 0x290))(plVar1);
    }
  }
  return;
}



undefined8 * FUN_14027ffa0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_MP_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  return param_1;
}



void FUN_140280050(longlong param_1)

{
  int iVar1;
  
  iVar1 = rand();
  if (((0.0 < *(float *)(param_1 + 0xb4)) &&
      ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xac))) &&
     (*(longlong *)(param_1 + 0x48) != 0)) {
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))();
  }
  return;
}



undefined8 * FUN_1402800b0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_ADD_PHYSIC_DAMAGE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140280150(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  int param_5,float param_6)

{
  undefined4 uVar1;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  uVar1 = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  *(undefined4 *)(param_1 + 0x7c) = uVar1;
  *(float *)(param_1 + 0xac) = (float)param_5;
  return;
}



void FUN_1402801a0(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  
  iVar1 = rand();
  if ((((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
      (plVar2 = (longlong *)FUN_140218c50(*(undefined8 *)(param_1 + 0x48)),
      plVar2 != (longlong *)0x0)) && (*(int *)((longlong)plVar2 + 300) != 0x25)) {
    (**(code **)(*plVar2 + 0x290))(plVar2);
    *(int *)(plVar2 + 0xc2) = (int)plVar2[0xc2] + (int)*(float *)(param_1 + 0xac);
  }
  return;
}



undefined8 * FUN_140280220(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_ADD_MAGIC_DAMAGE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402802c0(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  
  iVar1 = rand();
  if ((((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
      (plVar2 = (longlong *)FUN_140218c50(*(undefined8 *)(param_1 + 0x48)),
      plVar2 != (longlong *)0x0)) && (*(int *)((longlong)plVar2 + 300) != 0x25)) {
    (**(code **)(*plVar2 + 0x290))(plVar2);
    *(int *)((longlong)plVar2 + 0x614) =
         *(int *)((longlong)plVar2 + 0x614) + (int)*(float *)(param_1 + 0xac);
  }
  return;
}



undefined8 * FUN_140280340(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_HP_SUCKING::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402803e0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  
  iVar2 = rand();
  if ((((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
      (plVar1 = *(longlong **)(param_1 + 0x48), plVar1 != (longlong *)0x0)) &&
     (*(int *)((longlong)plVar1 + 300) != 0x25)) {
    (**(code **)(*plVar1 + 0x290))(plVar1);
  }
  return;
}



undefined8 * FUN_140280440(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_MP_SUCKING::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402804e0(longlong param_1)

{
  int iVar1;
  
  iVar1 = rand();
  if (((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
     (*(longlong *)(param_1 + 0x48) != 0)) {
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))();
  }
  return;
}



undefined8 * FUN_140280530(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_PHYSIC_ATTACK_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402805d0(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  
  iVar1 = rand();
  if ((((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
      (*(longlong *)(param_1 + 0x48) != 0)) &&
     (plVar2 = (longlong *)FUN_140267710(0x51), plVar2 != (longlong *)0x0)) {
    (**(code **)(*plVar2 + 0x48))(plVar2,*plVar2,*(undefined4 *)(param_1 + 0xac));
    FUN_140236f40(*(undefined8 *)(param_1 + 0x48),*(undefined8 *)(param_1 + 0x40),plVar2);
  }
  return;
}



undefined8 * FUN_140280650(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_MAGIC_ATTACK_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402806f0(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  
  iVar1 = rand();
  if ((((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
      (*(longlong *)(param_1 + 0x48) != 0)) &&
     (plVar2 = (longlong *)FUN_140267710(0x53), plVar2 != (longlong *)0x0)) {
    (**(code **)(*plVar2 + 0x48))(plVar2,*plVar2,*(undefined4 *)(param_1 + 0xac));
    FUN_140236f40(*(undefined8 *)(param_1 + 0x48),*(undefined8 *)(param_1 + 0x40),plVar2);
  }
  return;
}



undefined8 * FUN_140280770(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_HP_RECOVERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



undefined8 * FUN_140280810(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_STONE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402808b0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,5,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140280910(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_FREEZE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402809b0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,6,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140280a10(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_STUN::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140280ab0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_STUN");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140280b60(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,4,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140280bc0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_SLOW::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140280c60(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,7,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140280cc0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_CHAOS::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140280d60(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,0xb,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140280dc0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_BURN::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140280e60(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,3,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140280ec0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_DISEASE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140280f60(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_SICKNESS");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140281010(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,9,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281070(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_POISON::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140281110(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,8,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281170(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_SLEEP::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140281210(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,10,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281270(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_DARKNESS::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140281310(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,0xd,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281370(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_CONDITION_BLEEDING::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140281410(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    lVar2 = FUN_140218c50(*(undefined8 *)(param_1 + 0x48));
    if (lVar2 != 0) {
      FUN_14026c0e0(param_1,lVar2,1,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281470(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_DEC_PHYSIC_DAMAGE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



undefined8 * FUN_140281510(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_DEC_MAGIC_DAMAGE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402815b0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  int param_5,undefined4 param_6)

{
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = (float)param_5 / 100.0;
  *(undefined4 *)(param_1 + 0xac) = param_6;
  return;
}



int __cdecl rand(void)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140281600. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = rand();
  return iVar1;
}



undefined8 * FUN_140281610(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_GOD::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined1 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void FUN_1402816c0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(char *)(param_1 + 0xac) = (char)puVar1[0x20];
          return;
        }
        break;
      }
    }
  }
  *(undefined1 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_140281740(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  int param_5,undefined8 param_6,undefined4 param_7)

{
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = (float)param_5 / 100.0;
  *(undefined4 *)(param_1 + 0x60) = param_7;
  return;
}



void FUN_140281780(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(undefined1 *)(lVar1 + 0x1869) = 0;
    *(undefined1 *)(lVar1 + 0x604) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402817b0(longlong param_1,double param_2)

{
  undefined1 uVar1;
  longlong lVar2;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar2 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar2 != 0) {
        uVar1 = *(undefined1 *)(param_1 + 0xac);
        *(undefined1 *)(lVar2 + 0x604) = 1;
        *(undefined1 *)(lVar2 + 0x1869) = uVar1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140281810(longlong param_1)

{
  int iVar1;
  
  iVar1 = rand();
  if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    *(uint *)(param_1 + 0x3c) = (uint)(*(int *)(param_1 + 0x3c) == 1);
  }
  return;
}



undefined8 * FUN_140281850(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_STONE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402818f0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_STONE");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_1402819a0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,5,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281a10(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_FREEZE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140281ab0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_FREEZING");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140281b60(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,6,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281bd0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_STUN::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140281c70(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,4,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281ce0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_SLOW::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140281d80(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_SLOW");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140281e30(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,7,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140281ea0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_CHAOS::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140281f40(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_CHAOS");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140281ff0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,0xb,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140282060(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_BURN::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140282100(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_FIRE");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_1402821b0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,3,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140282220(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_DISEASE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402822c0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,9,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140282330(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_POISON::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402823d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_TOXICATION");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140282480(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,8,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_1402824f0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_SLEEP::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140282590(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_SLEEP");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140282640(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,10,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_1402826b0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_DARKNESS::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140282750(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_DARKNESS");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140282800(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,0xd,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140282870(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_BLEEDING::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140282910(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_BLEEDING");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_1402829c0(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,1,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140282a30(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_TIME_CONDITION_LIGHTNING::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140282ad0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,float param_6)

{
  undefined4 uVar1;
  longlong lVar2;
  int *piVar3;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  lVar2 = FUN_1402933b0(DAT_140607ff0,L"CONDITION_LIGHTNING");
  if (lVar2 != 0) {
    uVar1 = FUN_1402970c0(lVar2,L"nLevel");
    piVar3 = (int *)FUN_140296600(lVar2,param_5,uVar1,L"nLevel",0);
    if (piVar3 != (int *)0x0) {
      *(float *)(param_1 + 0xac) = (float)*piVar3;
    }
  }
  return;
}



void FUN_140282b80(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    lVar3 = (**(code **)(*plVar1 + 0x430))
                      (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
    if (lVar3 != 0) {
      FUN_14026c0e0(param_1,lVar3,0xc,(int)*(float *)(param_1 + 0xac));
    }
  }
  return;
}



undefined8 * FUN_140282bf0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCRITICAL_POWER_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140282ca0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x80c) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x80c);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140282ce0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x80c) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x80c);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



undefined8 * FUN_140282d30(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCRITICAL_POWER_INC_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140282de0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x3e];
          goto LAB_140282e3f;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_140282e3f:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x4a];
          goto LAB_140282e85;
        }
        break;
      }
    }
  }
  uVar4 = 1;
LAB_140282e85:
  *(uint *)(param_1 + 0x2c) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x60) = puVar1[0x3f];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x60) = 0;
  return;
}



void FUN_140282f30(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x80c) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x80c);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140282fa0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_SKILL_CLASS_LIMT_ATTACK_POINT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140283050(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  int param_5,float param_6)

{
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xac) = (float)param_5 / 10000.0;
  *(int *)(param_1 + 0xa8) = (int)param_6;
  return;
}



undefined8 * FUN_1402830a0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_SKILL_CLASS_LIMT_SKILL_COOL_TIME_DECREMENT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140283150(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  int param_5,float param_6)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = param_5;
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  param_5 = 0x3eb33333;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  puVar2 = &param_5;
  *(float *)(param_1 + 0xac) = (float)iVar1 / 10000.0;
  if ((float)iVar1 / 10000.0 <= 0.35) {
    puVar2 = (undefined4 *)(param_1 + 0xac);
  }
  *(undefined4 *)(param_1 + 0xac) = *puVar2;
  *(int *)(param_1 + 0xa8) = (int)param_6;
  return;
}



undefined8 * FUN_1402831c0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_SKILL_SPEC_SKILL_LIMT_SKILL_COOL_TIME_DECREMENT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140283270(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(undefined4 *)(param_1 + 0xac) = param_6;
  *(undefined4 *)(param_1 + 0xa8) = param_5;
  return;
}



undefined8 * FUN_1402832b0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_SKILL_SPEC_SKILL_LIMT_ATTACK_POINT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



undefined8 * FUN_140283360(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_EVENT_ADD_EFFECT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140283410(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xa8) = puVar1[0x40];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_1402834a0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  undefined4 param_5,undefined4 param_6)

{
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(undefined4 *)(param_1 + 0xa8) = param_6;
  *(undefined4 *)(param_1 + 0xac) = param_5;
  return;
}



void FUN_1402834e0(longlong param_1)

{
  uint *puVar1;
  int iVar2;
  longlong *plVar3;
  uint uVar4;
  
  iVar2 = rand();
  if ((float)iVar2 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
    uVar4 = *(uint *)(param_1 + 0xac);
    plVar3 = (longlong *)FUN_1403161f0();
    if (*plVar3 != 0) {
      for (puVar1 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
          puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
        if ((puVar1[0xea] == uVar4) && (*puVar1 == uVar4)) {
          if (puVar1 != (uint *)0x0) {
            uVar4 = puVar1[3];
            goto LAB_14028355a;
          }
          break;
        }
      }
    }
    uVar4 = 0;
LAB_14028355a:
    plVar3 = (longlong *)
             FUN_140267670(uVar4,*(undefined4 *)(param_1 + 0xac),*(undefined8 *)(param_1 + 0x48));
    if (plVar3 != (longlong *)0x0) {
      (**(code **)(*plVar3 + 8))(plVar3,*(undefined4 *)(param_1 + 0xac));
      *(undefined4 *)((longlong)plVar3 + 0x6c) = 3;
      if (*(longlong *)(param_1 + 0x48) != 0) {
        FUN_140236f40(*(longlong *)(param_1 + 0x48),*(undefined8 *)(param_1 + 0x40),plVar3);
      }
    }
  }
  return;
}



undefined8 * FUN_1402835c0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_DAMAGE_EVENT_ADD_EFFECT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



undefined8 * FUN_140283670(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectEXP_PERCENT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140283720(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7f0) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7f0);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140283760(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x7f0) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7f0);
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_1402837d0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPARTY_TELEPORT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140283870(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        if (((*(longlong *)(param_1 + 0x40) != 0) &&
            (lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x40) + 0xb58), lVar1 != 0)) &&
           (*(longlong *)(lVar1 + 0x30) != 0)) {
          FUN_140246f60();
        }
        FUN_14026bb70(param_1);
        return;
      }
    }
  }
  return;
}



void FUN_1402838f0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x3c) = 2;
  return;
}



undefined8 * FUN_140283900(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_PHYSIC_ATTACK_INC_PARTY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402839a0(longlong param_1)

{
  int iVar1;
  
  iVar1 = rand();
  if (((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
     (*(longlong *)(param_1 + 0x98) != 0)) {
    (**(code **)(**(longlong **)(param_1 + 0x98) + 600))
              (*(longlong **)(param_1 + 0x98),0xce,*(undefined4 *)(param_1 + 0x60),
               *(undefined4 *)(param_1 + 0xac));
  }
  return;
}



undefined8 * FUN_140283a00(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_MAGIC_ATTACK_INC_PARTY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140283aa0(longlong param_1)

{
  int iVar1;
  
  iVar1 = rand();
  if (((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
     (*(longlong *)(param_1 + 0x98) != 0)) {
    (**(code **)(**(longlong **)(param_1 + 0x98) + 600))
              (*(longlong **)(param_1 + 0x98),0xcf,*(undefined4 *)(param_1 + 0x60),
               *(undefined4 *)(param_1 + 0xac));
  }
  return;
}



undefined8 * FUN_140283b00(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectON_ATTACK_TIME_ATTACK_SPEED_INC_PARTY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140283ba0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  int param_5,float param_6,undefined4 param_7)

{
  undefined4 uVar1;
  
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  uVar1 = param_4[3];
  *(float *)(param_1 + 0xa8) = param_6 / 100.0;
  *(undefined4 *)(param_1 + 0x60) = param_7;
  *(undefined4 *)(param_1 + 0x7c) = uVar1;
  *(float *)(param_1 + 0xac) = (float)param_5;
  return;
}



void FUN_140283bf0(longlong param_1)

{
  int iVar1;
  
  iVar1 = rand();
  if (((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) &&
     (*(longlong *)(param_1 + 0x98) != 0)) {
    (**(code **)(**(longlong **)(param_1 + 0x98) + 600))
              (*(longlong **)(param_1 + 0x98),0xcd,*(undefined4 *)(param_1 + 0x60),
               *(undefined4 *)(param_1 + 0xac));
  }
  return;
}



undefined8 * FUN_140283c50(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectTIME_ATTACK_SPEED_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140283d00(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (*(longlong *)(param_1 + 0x48) != 0) {
        FUN_140314970(*(longlong *)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xa8));
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140283d70(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectTIME_PHYSIC_ATTACK_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140283e20(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x628) = *(int *)(lVar1 + 0x628) + (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x606) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140283e80(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x628) = *(int *)(lVar1 + 0x628) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



undefined8 * FUN_140283eb0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectTIME_MAGIC_ATTACK_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140283f60(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x62c) = *(int *)(lVar1 + 0x62c) + (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x606) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140283fc0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x62c) = *(int *)(lVar1 + 0x62c) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140283ff0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x808) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x808);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140284040(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x808) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x808);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



void FUN_140284090(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb0))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x808) = -*(float *)(param_1 + 0xb0) + *(float *)(lVar1 + 0x808);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402840e0(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((lVar1 != 0) && (0.0 < fVar3)) {
    *(float *)(lVar1 + 0x808) = fVar3 + *(float *)(lVar1 + 0x808);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140284140(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x808) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x808);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140284180(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x808) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x808);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_1402841f0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    if (0.0 < *(float *)(param_1 + 0xb0)) {
      *(float *)(lVar1 + 0x734) = -*(float *)(param_1 + 0xb0) + *(float *)(lVar1 + 0x734);
      *(undefined1 *)(lVar1 + 0x607) = 1;
      FUN_1402fb060(*(undefined8 *)(param_1 + 0x48));
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140284250(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((lVar1 != 0) && (0.0 < fVar3)) {
    *(float *)(lVar1 + 0x734) = fVar3 + *(float *)(lVar1 + 0x734);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    FUN_1402fb060(*(undefined8 *)(param_1 + 0x48));
  }
  return;
}



void FUN_1402842c0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    if (0.0 < *(float *)(param_1 + 0xb0)) {
      *(int *)(lVar1 + 0x86c) = *(int *)(lVar1 + 0x86c) - (int)*(float *)(param_1 + 0xb0);
      *(undefined1 *)(lVar1 + 0x60b) = 1;
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140284300(longlong *param_1,longlong param_2)

{
  if ((*(int *)((longlong)param_1 + 0x24) == 0) &&
     (param_1[2] = param_2, *(int *)((longlong)param_1 + 0x3c) == 0)) {
    param_1[3] = param_2;
    *(undefined4 *)((longlong)param_1 + 0x3c) = 1;
    (**(code **)(*param_1 + 0x38))();
  }
  return;
}



void FUN_140284330(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
    lVar1 = *(longlong *)(param_1 + 0x48);
    fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
    *(float *)(param_1 + 0xb0) = fVar3;
    if ((lVar1 != 0) && (0.0 < fVar3)) {
      *(int *)(lVar1 + 0x86c) = *(int *)(lVar1 + 0x86c) + (int)fVar3;
      *(undefined1 *)(lVar1 + 0x60b) = 1;
    }
  }
  return;
}



void FUN_140284390(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x31];
          goto LAB_1402843eb;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_1402843eb:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x32];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_140284480(longlong param_1)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x3c) == 1) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    if ((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) {
      *(int *)(lVar1 + 0x868) = *(int *)(lVar1 + 0x868) - (int)*(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar1 + 0x60b) = 1;
      FUN_1402fb060(*(undefined8 *)(param_1 + 0x48));
    }
    lVar1 = *(longlong *)(param_1 + 0x48);
    if ((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xac))) {
      *(int *)(lVar1 + 0x86c) = *(int *)(lVar1 + 0x86c) - (int)*(float *)(param_1 + 0xac);
      *(undefined1 *)(lVar1 + 0x60b) = 1;
      FUN_1402fb060(*(undefined8 *)(param_1 + 0x48));
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140284510(longlong param_1,undefined8 param_2)

{
  int *piVar1;
  longlong lVar2;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    lVar2 = *(longlong *)(param_1 + 0x48);
    if (lVar2 != 0) {
      *(int *)(lVar2 + 0x868) = *(int *)(lVar2 + 0x868) + (int)*(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar2 + 0x60b) = 1;
      lVar2 = *(longlong *)(param_1 + 0x48);
      piVar1 = (int *)(lVar2 + 0x86c);
      *piVar1 = *piVar1 + (int)*(float *)(param_1 + 0xac);
      *(undefined1 *)(lVar2 + 0x60b) = 1;
      FUN_1402fb060(*(undefined8 *)(param_1 + 0x48));
    }
  }
  return;
}



undefined8 * FUN_140284580(undefined8 *param_1,byte param_2)

{
  *param_1 = MGSAddEffect::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402845b0(longlong param_1,float param_2)

{
  float fVar1;
  longlong lVar2;
  
  lVar2 = *(longlong *)(param_1 + 0x48);
  fVar1 = *(float *)(param_1 + 0xac);
  if ((lVar2 != 0) && (*(int *)(lVar2 + 300) != 0x25)) {
    *(float *)(lVar2 + 0x734) = param_2 * *(float *)(param_1 + 0xa8) + *(float *)(lVar2 + 0x734);
    *(undefined1 *)(lVar2 + 0x607) = 1;
    lVar2 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar2 + 0x738) = param_2 * fVar1 + *(float *)(lVar2 + 0x738);
    *(undefined1 *)(lVar2 + 0x607) = 1;
    FUN_1402fb060(*(undefined8 *)(param_1 + 0x48));
  }
  return;
}



void FUN_140284620(longlong param_1)

{
  if ((*(longlong *)(param_1 + 0x48) != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    FUN_1402845b0(param_1,0xbf800000);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140284650(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      FUN_1402845b0(param_1,0x3f800000);
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_1402846b0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAX_MP_PERCENT_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  return param_1;
}



void FUN_140284760(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x21];
          goto LAB_1402847af;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_1402847af:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x3e];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_140284840(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    if (0.0 < *(float *)(param_1 + 0xb0)) {
      *(float *)(lVar1 + 0x738) = -*(float *)(param_1 + 0xb0) + *(float *)(lVar1 + 0x738);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140284890(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((lVar1 != 0) && (0.0 < fVar3)) {
    *(float *)(lVar1 + 0x738) = fVar3 + *(float *)(lVar1 + 0x738);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_1402848f0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAX_HP_OR_MP_POINT_INC_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_1402849a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  uint uVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  uVar5 = 0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x31];
          goto LAB_1402849fb;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_1402849fb:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar5 = puVar1[0x32];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0xac) = uVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_140284ad0(longlong param_1,float param_2)

{
  int *piVar1;
  float fVar2;
  longlong lVar3;
  
  fVar2 = *(float *)(param_1 + 0xac);
  lVar3 = *(longlong *)(param_1 + 0x48);
  if (lVar3 != 0) {
    *(int *)(lVar3 + 0x618) = *(int *)(lVar3 + 0x618) + (int)(param_2 * *(float *)(param_1 + 0xa8));
    *(undefined1 *)(lVar3 + 0x606) = 1;
    lVar3 = *(longlong *)(param_1 + 0x48);
    piVar1 = (int *)(lVar3 + 0x61c);
    *piVar1 = *piVar1 + (int)(param_2 * fVar2);
    *(undefined1 *)(lVar3 + 0x606) = 1;
    FUN_1402fb060(*(undefined8 *)(param_1 + 0x48));
  }
  return;
}



void FUN_140284b30(longlong param_1)

{
  if ((*(longlong *)(param_1 + 0x48) != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    FUN_140284ad0(param_1,0xbf800000);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140284b60(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      FUN_140284ad0(param_1,0x3f800000);
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140284bc0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_POINT_CHANGE_F_Attribute::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0xffffffff;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void FUN_140284c70(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 1;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = *(undefined4 *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140284cd0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_140284d30(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_POINT_CHANGE_W_Attribute::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0xffffffff;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void FUN_140284de0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 2;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = *(undefined4 *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140284e40(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 2;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_140284ea0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_POINT_CHANGE_L_Attribute::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0xffffffff;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void thunk_FUN_14026b530(longlong param_1,uint param_2)

{
  uint uVar1;
  uint *puVar2;
  longlong *plVar3;
  uint uVar4;
  uint uVar5;
  
  *(uint *)(param_1 + 8) = param_2;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[0x3f];
          goto LAB_14026b587;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_14026b587:
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x60) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[7];
          goto LAB_14026b5cf;
        }
        break;
      }
    }
  }
  uVar5 = 0xffffffff;
LAB_14026b5cf:
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x38) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[0x22];
          goto LAB_14026b614;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_14026b614:
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 100) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[0x23];
          goto LAB_14026b65e;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_14026b65e:
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x68) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  uVar5 = 1;
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          uVar4 = puVar2[0x4a];
          goto LAB_14026b6ae;
        }
        break;
      }
    }
  }
  uVar4 = 1;
LAB_14026b6ae:
  uVar1 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x2c) = uVar4;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar1) && (*puVar2 == uVar1)) {
        if (puVar2 != (uint *)0x0) {
          uVar5 = puVar2[0x27];
        }
        break;
      }
    }
  }
  uVar4 = *(uint *)(param_1 + 8);
  *(uint *)(param_1 + 0x30) = uVar5;
  plVar3 = (longlong *)FUN_1403161f0();
  if (*plVar3 != 0) {
    for (puVar2 = *(uint **)(*plVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0xe8)) {
      if ((puVar2[0xea] == uVar4) && (*puVar2 == uVar4)) {
        if (puVar2 != (uint *)0x0) {
          *(uint *)(param_1 + 0x34) = puVar2[0x28];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x34) = 0;
  return;
}



void FUN_140284f60(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 3;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = *(undefined4 *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140284fc0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 3;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140285020(longlong *param_1)

{
  if ((param_1[9] != 0) && (*(int *)((longlong)param_1 + 0x3c) == 1)) {
    (**(code **)(*param_1 + 0x40))();
    *(undefined4 *)((longlong)param_1 + 0x3c) = 2;
  }
  return;
}



undefined8 * FUN_140285050(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_POINT_CHANGE_D_Attribute::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0xffffffff;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void FUN_140285100(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 *param_4,
                  int param_5,float param_6)

{
  *(undefined4 *)(param_1 + 0x70) = *param_4;
  *(undefined4 *)(param_1 + 0x74) = param_4[1];
  *(undefined4 *)(param_1 + 0x78) = param_4[2];
  *(undefined4 *)(param_1 + 0x7c) = param_4[3];
  *(float *)(param_1 + 0xac) = (float)param_5 / 100.0;
  *(int *)(param_1 + 0xa8) = (int)param_6;
  return;
}



void FUN_140285150(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 4;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = *(undefined4 *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_1402851b0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 4;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_140285210(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_POINT_CHANGE_E_Attribute::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0xffffffff;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void FUN_1402852c0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 5;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = *(undefined4 *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140285320(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 5;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_140285380(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_POINT_CHANGE_WD_Attribut::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0xffffffff;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void FUN_140285430(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 6;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = *(undefined4 *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140285490(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 6;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_1402854f0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_POINT_CHANGE_T_Attribute::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0xffffffff;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void FUN_1402855a0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 7;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = *(undefined4 *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140285600(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 7;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_140285660(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_POINT_CHANGE_LN_Attribute::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0xffffffff;
  *(undefined4 *)((longlong)param_1 + 0xac) = 0;
  return param_1;
}



void FUN_140285710(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 8;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = *(undefined4 *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140285770(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (lVar1 != 0) {
    *(undefined4 *)(lVar1 + 0x72c) = 8;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined4 *)(lVar1 + 0x730) = 0;
    *(undefined1 *)(lVar1 + 0x606) = 1;
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar1 + 0x814) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x814);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_1402857d0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x6f4) = *(int *)(lVar1 + 0x6f4) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140285810(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(int *)(lVar1 + 0x6f4) = *(int *)(lVar1 + 0x6f4) + (int)*(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar1 + 0x606) = 1;
    }
  }
  return;
}



void FUN_140285850(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7c4) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7c4);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140285890(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x7c4) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7c4);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140285900(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x788) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x788);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140285940(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x788) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x788);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_1402859b0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7b8) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7b8);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402859f0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x7b8) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7b8);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140285a60(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x7b8) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7b8);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



void FUN_140285ab0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 2000) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 2000);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140285af0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 2000) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 2000);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140285b60(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x2a];
          goto LAB_140285bb0;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_140285bb0:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_140285c40(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x78c) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x78c);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140285c80(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x78c) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x78c);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140285cf0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x3e];
          goto LAB_140285d40;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_140285d40:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_140285dd0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7c0) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7c0);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140285e10(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x7c0) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7c0);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140285e80(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  float fVar4;
  uint uVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  uVar5 = 0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x3c];
          goto LAB_140285edf;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_140285edf:
  *(int *)(param_1 + 0xa8) = (int)fVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x45];
          goto LAB_140285f2b;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_140285f2b:
  *(int *)(param_1 + 0xac) = (int)fVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar5 = puVar1[0x41];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0xb0) = uVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_140286020(longlong param_1,double param_2)

{
  uint uVar1;
  longlong lVar2;
  void *pvVar3;
  char cVar4;
  longlong *plVar5;
  longlong lVar6;
  int iVar7;
  ulonglong uVar8;
  undefined1 *puVar9;
  undefined4 *puVar10;
  ulonglong uVar11;
  undefined1 local_res8 [8];
  undefined1 local_res20 [8];
  undefined1 *puVar12;
  undefined2 *puVar13;
  undefined1 *puVar14;
  undefined1 local_88;
  undefined1 local_87;
  undefined1 local_86;
  undefined1 local_85;
  undefined1 local_84;
  undefined1 local_83;
  undefined1 local_82 [2];
  undefined2 local_80;
  undefined2 local_7e;
  undefined2 local_7c [2];
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70 [2];
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  void *local_58;
  longlong local_50;
  undefined8 local_48;
  undefined8 local_38;
  
  local_38 = 0xfffffffffffffffe;
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if (param_2 - *(double *)(param_1 + 0x18) < (double)*(float *)(param_1 + 0x60)) {
        uVar8 = 0;
        local_58 = (void *)0x0;
        local_50 = 0;
        local_48 = 0;
        local_68 = *(undefined4 *)(param_1 + 0x80);
        local_64 = *(undefined4 *)(param_1 + 0x84);
        local_60 = *(undefined4 *)(param_1 + 0x88);
        if (*(longlong *)(*(longlong *)(param_1 + 0x48) + 0x1e80) != 0) {
          FUN_1402395e0(*(longlong *)(param_1 + 0x48),&local_58,*(undefined4 *)(param_1 + 0xb0),
                        *(undefined4 *)(param_1 + 0x2c),&local_68);
        }
        pvVar3 = local_58;
        uVar11 = local_50 - (longlong)local_58 >> 3;
        if (uVar11 != 0) {
          do {
            lVar6 = *(longlong *)((longlong)pvVar3 + uVar8 * 8);
            if (*(longlong *)(param_1 + 0x48) != lVar6) {
              uVar1 = *(uint *)(param_1 + 0xa8);
              if (uVar1 - 1 < 0xe) {
                if (uVar1 < 0xf) {
                  plVar5 = (longlong *)
                           (*(longlong *)(lVar6 + 0xb78) + 0x178 + (longlong)(int)uVar1 * 8);
                }
                else {
                  if (DAT_140608178 == 0) {
                    FUN_140176d60(0);
                  }
                  DAT_140608178 = DAT_140608178 + 1;
                  plVar5 = &DAT_140608170;
                }
                if (*(char *)(*plVar5 + 0x20) != '\0') goto LAB_14028634a;
              }
              lVar6 = *(longlong *)((longlong)pvVar3 + uVar8 * 8);
              if ((*(char *)(lVar6 + 0x11a8) == '\0') &&
                 (cVar4 = FUN_1402240c0(lVar6,*(undefined4 *)(param_1 + 0xa8),
                                        *(undefined4 *)(param_1 + 0xac)), cVar4 != '\0')) {
                lVar6 = *(longlong *)(param_1 + 0x40);
                if (lVar6 == 0) {
                  if (*(longlong *)(param_1 + 0x98) != 0) {
                    local_86 = 0;
                    local_7c[0] = *(undefined2 *)(param_1 + 0xac);
                    local_84 = *(undefined1 *)(param_1 + 0xa8);
                    local_82[0] = (**(code **)(**(longlong **)((longlong)pvVar3 + uVar8 * 8) + 0xb0)
                                  )();
                    local_74 = *(undefined4 *)(*(longlong *)((longlong)pvVar3 + uVar8 * 8) + 0x128);
                    lVar6 = **(longlong **)(*(longlong *)(param_1 + 0x98) + 0x48);
                    puVar14 = &local_86;
                    puVar13 = local_7c;
                    puVar12 = &local_84;
                    puVar9 = local_82;
                    puVar10 = &local_74;
                    iVar7 = *(int *)(*(longlong *)(param_1 + 0x98) + 8);
                    goto LAB_14028632e;
                  }
                }
                else {
                  lVar2 = *(longlong *)(lVar6 + 0xb58);
                  if (lVar2 == 0) {
                    if (*(longlong *)(lVar6 + 0xb50) != 0) {
                      local_83 = 0;
                      local_7e = *(undefined2 *)(param_1 + 0xac);
                      local_85 = *(undefined1 *)(param_1 + 0xa8);
                      local_88 = (**(code **)(**(longlong **)((longlong)pvVar3 + uVar8 * 8) + 0xb0))
                                           ();
                      local_78 = *(undefined4 *)
                                  (*(longlong *)((longlong)pvVar3 + uVar8 * 8) + 0x128);
                      lVar6 = *(longlong *)(param_1 + 0x40);
                      iVar7 = *(int *)(lVar6 + 0xc);
                      if (iVar7 == 0) {
                        iVar7 = *(int *)(lVar6 + 8);
                      }
                      lVar6 = *(longlong *)(lVar6 + 0xb50);
                      puVar14 = &local_83;
                      puVar13 = &local_7e;
                      puVar12 = &local_85;
                      puVar9 = &local_88;
                      puVar10 = &local_78;
                      goto LAB_14028632e;
                    }
                  }
                  else if (*(longlong *)(lVar6 + 0xb50) != 0) {
                    local_res8[0] = 0;
                    local_80 = *(undefined2 *)(param_1 + 0xac);
                    local_res20[0] = *(undefined1 *)(param_1 + 0xa8);
                    local_87 = (**(code **)(**(longlong **)((longlong)pvVar3 + uVar8 * 8) + 0xb0))()
                    ;
                    local_70[0] = *(undefined4 *)
                                   (*(longlong *)((longlong)pvVar3 + uVar8 * 8) + 0x128);
                    iVar7 = *(int *)(lVar2 + 8);
                    if (iVar7 == 0) {
                      iVar7 = *(int *)(*(longlong *)(param_1 + 0x40) + 8);
                    }
                    lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x40) + 0xb50);
                    puVar14 = local_res8;
                    puVar13 = &local_80;
                    puVar12 = local_res20;
                    puVar9 = &local_87;
                    puVar10 = local_70;
LAB_14028632e:
                    (**(code **)(*(longlong *)(lVar6 + 0x380) + 0x3b0))
                              ((longlong *)(lVar6 + 0x380),iVar7,&DAT_1405d85a0,puVar10,puVar9,
                               puVar12,puVar13,puVar14);
                  }
                }
              }
            }
LAB_14028634a:
            uVar8 = uVar8 + 1;
          } while (uVar8 < uVar11);
        }
        if (pvVar3 != (void *)0x0) {
          operator_delete(pvVar3);
        }
      }
      else {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70(param_1);
      }
    }
  }
  return;
}



void FUN_140286390(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7d4) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7d4);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402863d0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x7d4) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7d4);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_140286440(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7b4) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7b4);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140286480(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x7b4) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7b4);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_1402864f0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    *(undefined8 *)(param_1 + 0x18) = param_2;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x7b4) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7b4);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



undefined8 * FUN_140286540(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_ATTACK_CONDITION_ACTIVITY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  return param_1;
}



void FUN_1402865f0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  float fVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x40];
          goto LAB_140286644;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_140286644:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar5 = (float)puVar1[0x3c];
          goto LAB_14028668f;
        }
        break;
      }
    }
  }
  fVar5 = 0.0;
LAB_14028668f:
  *(int *)(param_1 + 0xac) = (int)fVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(int *)(param_1 + 0xb0) = (int)(float)puVar1[0x45];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xb0) = 0;
  return;
}



undefined8 * FUN_140286740(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCONDITION_ACTIVITY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  return param_1;
}



void FUN_1402867f0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  float fVar5;
  float fVar6;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  fVar6 = 0.0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x40];
          goto LAB_14028684f;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028684f:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar5 = (float)puVar1[0x3c];
          goto LAB_140286893;
        }
        break;
      }
    }
  }
  fVar5 = 0.0;
LAB_140286893:
  *(int *)(param_1 + 0xac) = (int)fVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar6 = (float)puVar1[0x45];
        }
        break;
      }
    }
  }
  *(int *)(param_1 + 0xb0) = (int)fVar6;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_140286990(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong lVar2;
  void *local_30;
  longlong local_28;
  undefined8 local_20;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    local_30 = (void *)0x0;
    local_28 = 0;
    local_20 = 0;
    if (*(longlong *)(*(longlong *)(param_1 + 0x48) + 0x1e80) != 0) {
      FUN_140239410(*(longlong *)(param_1 + 0x48),&local_30,*(undefined4 *)(param_1 + 0x2c),param_4,
                    0xfffffffffffffffe);
    }
    pvVar1 = local_30;
    for (lVar2 = local_28 - (longlong)local_30 >> 3; lVar2 != 0; lVar2 = lVar2 + -1) {
      rand();
    }
    FUN_14026bb70(param_1);
    if (pvVar1 != (void *)0x0) {
      operator_delete(pvVar1);
    }
  }
  return;
}



undefined8 * FUN_140286a40(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCONDITION_RESISTANCE_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140286af0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x3e];
          goto LAB_140286b40;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_140286b40:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x1d];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_140286bd0(longlong param_1)

{
  if ((*(longlong *)(param_1 + 0x48) != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    FUN_140314900(*(longlong *)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xac),
                  *(uint *)(param_1 + 0xa8) ^ 0x80000000);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140286c10(longlong param_1,undefined8 param_2)

{
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    *(undefined8 *)(param_1 + 0x18) = param_2;
    if (*(longlong *)(param_1 + 0x48) != 0) {
      FUN_140314900(*(longlong *)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xac),
                    *(undefined4 *)(param_1 + 0xa8));
    }
  }
  return;
}



undefined8 * FUN_140286c60(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCONDITION_RESISTANCE_INC_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140286d10(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (*(longlong *)(param_1 + 0x48) != 0) {
        FUN_140314900(*(longlong *)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xac),
                      *(undefined4 *)(param_1 + 0xa8));
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140286d80(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_Attr_Resistance_POINT_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  return param_1;
}



void FUN_140286e30(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb0))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x65c) = *(int *)(lVar1 + 0x65c) - (int)*(float *)(param_1 + 0xb0);
    *(undefined1 *)(lVar1 + 0x606) = 1;
  }
  return;
}



void FUN_140286e70(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((lVar1 != 0) && (0.0 < fVar3)) {
    *(int *)(lVar1 + 0x65c) = *(int *)(lVar1 + 0x65c) + (int)fVar3;
    *(undefined1 *)(lVar1 + 0x606) = 1;
  }
  return;
}



undefined8 * FUN_140286ed0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectF_Attr_ATTACK_PERCENT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140286f80(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7e4) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7e4);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



void FUN_140286fc0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x7e4) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7e4);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



undefined8 * FUN_140287010(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectD_Attr_Resistance_POINT_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  return param_1;
}



void FUN_1402870c0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb0))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x674) = *(int *)(lVar1 + 0x674) - (int)*(float *)(param_1 + 0xb0);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140287100(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((lVar1 != 0) && (0.0 < fVar3)) {
    *(int *)(lVar1 + 0x674) = *(int *)(lVar1 + 0x674) + (int)fVar3;
    *(undefined1 *)(lVar1 + 0x606) = 1;
  }
  return;
}



undefined8 * FUN_140287160(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectD_Attr_Resistance_POINT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140287210(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x674) = *(int *)(lVar1 + 0x674) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140287250(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(int *)(lVar1 + 0x674) = *(int *)(lVar1 + 0x674) + (int)*(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar1 + 0x606) = 1;
    }
  }
  return;
}



undefined8 * FUN_140287290(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectD_Attr_ATTACK_PERCENT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140287340(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x824) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x824);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140287390(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x824) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x824);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



undefined8 * FUN_1402873e0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectAttr_ATTACK_POINT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140287490(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x3e];
          goto LAB_1402874e0;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_1402874e0:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x1b];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_140287570(longlong param_1)

{
  int iVar1;
  
  if ((*(longlong *)(param_1 + 0x48) != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    iVar1 = *(int *)(param_1 + 0xac);
    if ((0x2b < iVar1) && (iVar1 < 0x34)) {
      FUN_1403149b0(*(longlong *)(param_1 + 0x48),iVar1,-(int)*(float *)(param_1 + 0xa8));
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402875c0(longlong param_1,double param_2)

{
  int iVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (*(longlong *)(param_1 + 0x48) != 0) {
        iVar1 = *(int *)(param_1 + 0xac);
        if ((0x2b < iVar1) && (iVar1 < 0x34)) {
          FUN_1403149b0(*(longlong *)(param_1 + 0x48),iVar1,(int)*(float *)(param_1 + 0xa8));
        }
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140287640(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectALL_Attr_ATTACK_POINT_INC_NO_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_1402876f0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x660) = *(int *)(lVar1 + 0x660) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140287720(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    *(undefined8 *)(param_1 + 0x18) = param_2;
    if (lVar1 != 0) {
      *(int *)(lVar1 + 0x660) = *(int *)(lVar1 + 0x660) + (int)*(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar1 + 0x606) = 1;
    }
  }
  return;
}



undefined8 * FUN_140287770(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectAttr_Resistance_POINT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140287820(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x3e];
          goto LAB_140287870;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_140287870:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x1c];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_140287900(longlong param_1,double param_2)

{
  int iVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (*(longlong *)(param_1 + 0x48) != 0) {
        iVar1 = *(int *)(param_1 + 0xac);
        if ((0x13 < iVar1) && (iVar1 < 0x1c)) {
          FUN_1403149b0(*(longlong *)(param_1 + 0x48),iVar1,(int)*(float *)(param_1 + 0xa8));
        }
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140287980(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectAttr_Resistance_POINT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140287a30(longlong param_1)

{
  int iVar1;
  
  if ((*(longlong *)(param_1 + 0x48) != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    iVar1 = *(int *)(param_1 + 0xac);
    if ((0x13 < iVar1) && (iVar1 < 0x1c)) {
      FUN_1403149b0(*(longlong *)(param_1 + 0x48),iVar1,-(int)*(float *)(param_1 + 0xa8));
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140287a80(longlong param_1,undefined8 param_2)

{
  int iVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    *(undefined8 *)(param_1 + 0x18) = param_2;
    if (*(longlong *)(param_1 + 0x48) != 0) {
      iVar1 = *(int *)(param_1 + 0xac);
      if ((0x13 < iVar1) && (iVar1 < 0x1c)) {
        FUN_1403149b0(*(longlong *)(param_1 + 0x48),iVar1,(int)*(float *)(param_1 + 0xa8));
      }
    }
  }
  return;
}



undefined8 * FUN_140287ae0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCRITICAL_POINT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140287b90(longlong param_1)

{
  float fVar1;
  longlong lVar2;
  
  lVar2 = *(longlong *)(param_1 + 0x48);
  if (((lVar2 != 0) && (fVar1 = *(float *)(param_1 + 0xa8), 0.0 < fVar1)) &&
     (*(int *)(param_1 + 0x3c) == 1)) {
    *(undefined1 *)(lVar2 + 0x605) = 1;
    *(float *)(lVar2 + 0x5dc) = -fVar1 + *(float *)(lVar2 + 0x5dc);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140287be0(longlong param_1,undefined8 param_2)

{
  float fVar1;
  longlong lVar2;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar2 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar2 != 0) {
      fVar1 = *(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar2 + 0x605) = 1;
      *(float *)(lVar2 + 0x5dc) = fVar1 + *(float *)(lVar2 + 0x5dc);
    }
  }
  return;
}



undefined8 * FUN_140287c30(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectATTACK_SPEED_PERCENT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140287ce0(longlong param_1)

{
  if (((*(longlong *)(param_1 + 0x48) != 0) && (0.0 < *(float *)(param_1 + 0xa8))) &&
     (*(int *)(param_1 + 0x3c) == 1)) {
    FUN_140314970(*(longlong *)(param_1 + 0x48),-*(float *)(param_1 + 0xa8));
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140287d20(longlong param_1,undefined8 param_2)

{
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (*(longlong *)(param_1 + 0x48) != 0) {
      FUN_140314970(*(longlong *)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xa8));
    }
  }
  return;
}



undefined8 * FUN_140287d60(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMOVE_SPEED_PERCENT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140287e10(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xa8) = puVar1[0x2a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_140287ea0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7fc) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7fc);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140287ef0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x7fc) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x7fc);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



void FUN_140287f40(longlong param_1,char param_2,longlong param_3)

{
  float fVar1;
  
  if (param_2 == '\0') {
    if (param_3 == 0) {
      return;
    }
    fVar1 = -*(float *)(param_1 + 0xa8);
  }
  else {
    if (param_3 == 0) {
      return;
    }
    fVar1 = *(float *)(param_1 + 0xa8);
  }
  *(float *)(param_3 + 0x7fc) = fVar1 + *(float *)(param_3 + 0x7fc);
  *(undefined1 *)(param_3 + 0x607) = 1;
  return;
}



undefined8 * FUN_140287f90(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectATTACK_SPEED_PERCENT_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_140288030(longlong param_1)

{
  if (((*(longlong *)(param_1 + 0x48) != 0) && (0.0 < *(float *)(param_1 + 0xb0))) &&
     (*(int *)(param_1 + 0x3c) == 1)) {
    FUN_140314970(*(longlong *)(param_1 + 0x48),-*(float *)(param_1 + 0xb0));
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288070(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  undefined4 *puVar3;
  float fVar4;
  undefined4 local_res8 [8];
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar4 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar4;
  if ((lVar1 != 0) && (0.0 < fVar4)) {
    fVar4 = fVar4 + *(float *)(lVar1 + 0x7f8);
    puVar3 = local_res8;
    *(float *)(lVar1 + 0x7f8) = fVar4;
    local_res8[0] = 0x3e4ccccd;
    if (fVar4 <= 0.2) {
      puVar3 = (undefined4 *)(lVar1 + 0x7f8);
    }
    *(undefined4 *)(lVar1 + 0x7f8) = *puVar3;
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_140288100(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMOVE_SPEED_PERCENT_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_1402881a0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb0))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x7fc) = -*(float *)(param_1 + 0xb0) + *(float *)(lVar1 + 0x7fc);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402881f0(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  lVar1 = *(longlong *)(param_1 + 0x48);
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((lVar1 != 0) && (0.0 < fVar3)) {
    *(float *)(lVar1 + 0x7fc) = fVar3 + *(float *)(lVar1 + 0x7fc);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_140288250(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectATTACK_PERCENT_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  *(undefined4 *)(param_1 + 0x17) = 0;
  return param_1;
}



void FUN_140288310(longlong param_1)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x3c) == 1) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    if ((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb4))) {
      *(float *)(lVar1 + 0x744) = -*(float *)(param_1 + 0xb4) + *(float *)(lVar1 + 0x744);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
    lVar1 = *(longlong *)(param_1 + 0x48);
    if ((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb8))) {
      *(float *)(lVar1 + 0x748) = -*(float *)(param_1 + 0xb8) + *(float *)(lVar1 + 0x748);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288390(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb8) = (float)iVar2 * *(float *)(param_1 + 0xb0);
  *(float *)(param_1 + 0xb4) = fVar3;
  if ((0.0 < fVar3) && (lVar1 = *(longlong *)(param_1 + 0x48), lVar1 != 0)) {
    *(float *)(lVar1 + 0x744) = fVar3 + *(float *)(lVar1 + 0x744);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  if ((0.0 < *(float *)(param_1 + 0xb8)) && (lVar1 = *(longlong *)(param_1 + 0x48), lVar1 != 0)) {
    *(float *)(lVar1 + 0x748) = *(float *)(param_1 + 0xb8) + *(float *)(lVar1 + 0x748);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_140288430(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_POINT_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  return param_1;
}



void FUN_1402884e0(longlong param_1)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x3c) == 1) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    if ((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb0))) {
      *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) - (int)*(float *)(param_1 + 0xb0);
      *(undefined1 *)(lVar1 + 0x60b) = 1;
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288520(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb0) = fVar3;
  if ((0.0 < fVar3) && (lVar1 = *(longlong *)(param_1 + 0x48), lVar1 != 0)) {
    *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) + (int)fVar3;
    *(undefined1 *)(lVar1 + 0x60b) = 1;
  }
  return;
}



undefined8 * FUN_140288580(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_POINT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140288630(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288670(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) + (int)*(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar1 + 0x60b) = 1;
    }
  }
  return;
}



undefined8 * FUN_1402886b0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_PERCENT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140288760(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x744) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x744);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402887a0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x744) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x744);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140288810(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_PERCENT_DEC_PROBABILITY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_1402888c0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x744) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x744);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288900(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x744) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x744);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140288970(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_PERCENT_DEC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140288a20(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x744) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x744);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288a60(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x744) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x744);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140288ad0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_POINT_DEC_PROBABILITY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140288b80(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) + (int)*(float *)(param_1 + 0xac);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288bb0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) - (int)*(float *)(param_1 + 0xac);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140288c10(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_POINT_DEC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140288cc0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) + (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288cf0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) - (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140288d50(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_ATTACK_POINT_DEC_PROBABILITY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140288e00(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x87c) = *(int *)(lVar1 + 0x87c) + (int)*(float *)(param_1 + 0xac);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288e30(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x87c) = *(int *)(lVar1 + 0x87c) - (int)*(float *)(param_1 + 0xac);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140288e90(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_ATTACK_POINT_DEC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140288f40(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x87c) = *(int *)(lVar1 + 0x87c) + (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140288f70(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x87c) = *(int *)(lVar1 + 0x87c) - (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140288fd0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_DEFENSE_PERCENT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140289080(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x750) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x750);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402890c0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x750) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x750);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140289130(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_ATTACK_POINT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_1402891e0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x87c) = *(int *)(lVar1 + 0x87c) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140289220(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(int *)(lVar1 + 0x87c) = *(int *)(lVar1 + 0x87c) + (int)*(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar1 + 0x60b) = 1;
    }
  }
  return;
}



undefined8 * FUN_140289260(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_ATTACK_PERCENT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140289310(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x748) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x748);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140289350(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x748) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x748);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_1402893c0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectDEFENSE_PERCENT_INC_MASTERY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  *(undefined4 *)(param_1 + 0x17) = 0;
  return param_1;
}



void FUN_140289480(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x21];
          goto LAB_1402894de;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_1402894de:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x42];
          goto LAB_140289527;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_140289527:
  *(uint *)(param_1 + 0xac) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xb0) = puVar1[0x43];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xb0) = 0;
  return;
}



void FUN_1402895d0(longlong param_1)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x3c) == 1) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    if ((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb4))) {
      *(float *)(lVar1 + 0x74c) = -*(float *)(param_1 + 0xb4) + *(float *)(lVar1 + 0x74c);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
    lVar1 = *(longlong *)(param_1 + 0x48);
    if ((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xb8))) {
      *(float *)(lVar1 + 0x750) = -*(float *)(param_1 + 0xb8) + *(float *)(lVar1 + 0x750);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140289650(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = FUN_14026bde0(param_1,*(undefined4 *)(param_1 + 0xa8));
  fVar3 = (float)iVar2 * *(float *)(param_1 + 0xac);
  *(float *)(param_1 + 0xb8) = (float)iVar2 * *(float *)(param_1 + 0xb0);
  *(float *)(param_1 + 0xb4) = fVar3;
  if ((0.0 < fVar3) && (lVar1 = *(longlong *)(param_1 + 0x48), lVar1 != 0)) {
    *(float *)(lVar1 + 0x74c) = fVar3 + *(float *)(lVar1 + 0x74c);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  if ((0.0 < *(float *)(param_1 + 0xb8)) && (lVar1 = *(longlong *)(param_1 + 0x48), lVar1 != 0)) {
    *(float *)(lVar1 + 0x750) = *(float *)(param_1 + 0xb8) + *(float *)(lVar1 + 0x750);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  return;
}



undefined8 * FUN_1402896f0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_DEFENSE_POINT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_1402897a0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0 < *(int *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x638) = *(int *)(lVar1 + 0x638) - *(int *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x606) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_1402897d0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(int *)(lVar1 + 0x638) = *(int *)(lVar1 + 0x638) + *(int *)(param_1 + 0xa8);
      *(undefined1 *)(lVar1 + 0x606) = 1;
    }
  }
  return;
}



undefined8 * FUN_140289810(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_DEFENSE_POINT_INC_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_1402898c0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(int *)(param_1 + 0xa8) = (int)(float)puVar1[0x2a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_140289950(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x638) = *(int *)(lVar1 + 0x638) + *(int *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x606) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_1402899b0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_DEFENSE_PERCENT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_140289a60(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x74c) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x74c);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_140289aa0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x74c) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x74c);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_140289b10(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectRANGE_ADD_EFFECT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140289bc0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  uint uVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  uVar5 = 0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x3e];
          goto LAB_140289c1b;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_140289c1b:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar5 = puVar1[0x41];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0xac) = uVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_140289cf0(longlong param_1,double param_2)

{
  longlong lVar1;
  void *pvVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  void *local_28;
  longlong local_20;
  undefined8 local_18;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if (param_2 - *(double *)(param_1 + 0x18) < (double)*(float *)(param_1 + 0x60)) {
        uVar8 = 0;
        local_28 = (void *)0x0;
        local_20 = 0;
        local_18 = 0;
        lVar1 = *(longlong *)(param_1 + 0x48);
        if (lVar1 != 0) {
          local_38 = *(undefined4 *)(param_1 + 0x80);
          local_34 = *(undefined4 *)(param_1 + 0x84);
          local_30 = *(undefined4 *)(param_1 + 0x88);
          if (*(longlong *)(lVar1 + 0x1e80) != 0) {
            FUN_1402395e0(lVar1,&local_28,*(undefined4 *)(param_1 + 0xac),
                          *(undefined4 *)(param_1 + 0x2c),&local_38);
          }
        }
        pvVar2 = local_28;
        uVar7 = local_20 - (longlong)local_28 >> 3;
        if (uVar7 != 0) {
          do {
            lVar1 = *(longlong *)((longlong)pvVar2 + uVar8 * 8);
            if (*(char *)(lVar1 + 0x11a8) == '\0') {
              iVar3 = FUN_140235b20(lVar1,*(undefined4 *)(param_1 + 0x38));
              if (iVar3 == 0) {
                uVar5 = FUN_1403161f0();
                uVar4 = FUN_1403161b0(uVar5,*(undefined4 *)(param_1 + 0x38));
                plVar6 = (longlong *)
                         FUN_140267670(uVar4,*(undefined4 *)(param_1 + 0x38),
                                       *(undefined8 *)((longlong)pvVar2 + uVar8 * 8));
                if (plVar6 != (longlong *)0x0) {
                  (**(code **)(*plVar6 + 8))(plVar6,*(undefined4 *)(param_1 + 0x38));
                  *(undefined4 *)(plVar6 + 0x10) = *(undefined4 *)(param_1 + 0x80);
                  *(undefined4 *)((longlong)plVar6 + 0x84) = *(undefined4 *)(param_1 + 0x84);
                  *(undefined4 *)(plVar6 + 0x11) = *(undefined4 *)(param_1 + 0x88);
                  *(undefined4 *)((longlong)plVar6 + 0x6c) = 3;
                  FUN_140236f40(*(undefined8 *)((longlong)pvVar2 + uVar8 * 8),
                                *(undefined8 *)(param_1 + 0x40),plVar6);
                }
              }
            }
            uVar8 = uVar8 + 1;
          } while (uVar8 < uVar7);
        }
        if (pvVar2 != (void *)0x0) {
          operator_delete(pvVar2);
        }
      }
      else {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70(param_1);
      }
    }
  }
  return;
}



undefined8 * FUN_140289ec0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectTIME_ADD_EFFECT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_140289f70(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x29];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_140289ff0(longlong param_1,double param_2)

{
  undefined8 uVar1;
  undefined4 uVar2;
  longlong *plVar3;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      return;
    }
    if ((*(int *)(param_1 + 0x3c) == 1) &&
       ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18))) {
      *(undefined4 *)(param_1 + 0x3c) = 2;
      FUN_14026bb70(param_1);
      uVar1 = FUN_1403161f0();
      uVar2 = FUN_1403161b0(uVar1,*(undefined4 *)(param_1 + 0x38));
      plVar3 = (longlong *)
               FUN_140267670(uVar2,*(undefined4 *)(param_1 + 0x38),*(undefined8 *)(param_1 + 0x48));
      if (plVar3 != (longlong *)0x0) {
        (**(code **)(*plVar3 + 8))(plVar3,*(undefined4 *)(param_1 + 0x38));
        *(undefined4 *)(plVar3 + 0x10) = *(undefined4 *)(param_1 + 0x80);
        *(undefined4 *)((longlong)plVar3 + 0x84) = *(undefined4 *)(param_1 + 0x84);
        uVar2 = *(undefined4 *)(param_1 + 0x88);
        *(undefined4 *)((longlong)plVar3 + 0x6c) = 3;
        *(undefined4 *)(plVar3 + 0x11) = uVar2;
        FUN_140236f40(*(undefined8 *)(param_1 + 0x48),*(undefined8 *)(param_1 + 0x40),plVar3);
      }
    }
  }
  return;
}



undefined8 * FUN_14028a0e0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPARTY_ADD_EFFECT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void thunk_FUN_14028a190(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong *plVar2;
  uint uVar3;
  uint *puVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  void *pvStack_30;
  longlong lStack_28;
  undefined8 uStack_20;
  
  pvStack_30 = (void *)0x0;
  lStack_28 = 0;
  uStack_20 = 0;
  if (*(longlong *)(*(longlong *)(param_1 + 0x48) + 0x1e80) != 0) {
    FUN_140239410(*(longlong *)(param_1 + 0x48),&pvStack_30,*(undefined4 *)(param_1 + 0x2c),param_4,
                  0xfffffffffffffffe);
  }
  pvVar1 = pvStack_30;
  uVar5 = lStack_28 - (longlong)pvStack_30 >> 3;
  uVar6 = 0;
  if (uVar5 != 0) {
    do {
      uVar3 = *(uint *)(param_1 + 0x38);
      plVar2 = (longlong *)FUN_1403161f0();
      if (*plVar2 != 0) {
        for (puVar4 = *(uint **)(*plVar2 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8
                                ); puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0xe8)) {
          if ((puVar4[0xea] == uVar3) && (*puVar4 == uVar3)) {
            if (puVar4 != (uint *)0x0) {
              if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar3 = puVar4[3];
              goto LAB_14028a253;
            }
            break;
          }
        }
      }
      uVar3 = 0;
LAB_14028a253:
      plVar2 = (longlong *)
               FUN_140267670(uVar3,*(undefined4 *)(param_1 + 0x38),
                             *(undefined8 *)((longlong)pvVar1 + uVar6 * 8));
      if (plVar2 != (longlong *)0x0) {
        (**(code **)(*plVar2 + 8))(plVar2,*(undefined4 *)(param_1 + 0x38));
        *(undefined4 *)(plVar2 + 0x10) = *(undefined4 *)(param_1 + 0x80);
        *(undefined4 *)((longlong)plVar2 + 0x84) = *(undefined4 *)(param_1 + 0x84);
        *(undefined4 *)(plVar2 + 0x11) = *(undefined4 *)(param_1 + 0x88);
        *(undefined4 *)((longlong)plVar2 + 0x6c) = 3;
        FUN_140236f40(*(undefined8 *)((longlong)pvVar1 + uVar6 * 8),*(undefined8 *)(param_1 + 0x40),
                      plVar2);
      }
      uVar6 = uVar6 + 1;
    } while (uVar6 < uVar5);
  }
  if (pvVar1 != (void *)0x0) {
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14028a190(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  longlong *plVar2;
  uint uVar3;
  uint *puVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  void *local_30;
  longlong local_28;
  undefined8 local_20;
  
  local_30 = (void *)0x0;
  local_28 = 0;
  local_20 = 0;
  if (*(longlong *)(*(longlong *)(param_1 + 0x48) + 0x1e80) != 0) {
    FUN_140239410(*(longlong *)(param_1 + 0x48),&local_30,*(undefined4 *)(param_1 + 0x2c),param_4,
                  0xfffffffffffffffe);
  }
  pvVar1 = local_30;
  uVar5 = local_28 - (longlong)local_30 >> 3;
  uVar6 = 0;
  if (uVar5 != 0) {
    do {
      uVar3 = *(uint *)(param_1 + 0x38);
      plVar2 = (longlong *)FUN_1403161f0();
      if (*plVar2 != 0) {
        for (puVar4 = *(uint **)(*plVar2 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8
                                ); puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0xe8)) {
          if ((puVar4[0xea] == uVar3) && (*puVar4 == uVar3)) {
            if (puVar4 != (uint *)0x0) {
              if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar3 = puVar4[3];
              goto LAB_14028a253;
            }
            break;
          }
        }
      }
      uVar3 = 0;
LAB_14028a253:
      plVar2 = (longlong *)
               FUN_140267670(uVar3,*(undefined4 *)(param_1 + 0x38),
                             *(undefined8 *)((longlong)pvVar1 + uVar6 * 8));
      if (plVar2 != (longlong *)0x0) {
        (**(code **)(*plVar2 + 8))(plVar2,*(undefined4 *)(param_1 + 0x38));
        *(undefined4 *)(plVar2 + 0x10) = *(undefined4 *)(param_1 + 0x80);
        *(undefined4 *)((longlong)plVar2 + 0x84) = *(undefined4 *)(param_1 + 0x84);
        *(undefined4 *)(plVar2 + 0x11) = *(undefined4 *)(param_1 + 0x88);
        *(undefined4 *)((longlong)plVar2 + 0x6c) = 3;
        FUN_140236f40(*(undefined8 *)((longlong)pvVar1 + uVar6 * 8),*(undefined8 *)(param_1 + 0x40),
                      plVar2);
      }
      uVar6 = uVar6 + 1;
    } while (uVar6 < uVar5);
  }
  if (pvVar1 != (void *)0x0) {
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14028a300(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    FUN_14028a190();
    FUN_14026bb70(param_1);
  }
  return;
}



undefined8 * FUN_14028a340(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectAURA_ADD_EFFECT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028a3f0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  void *pvVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  void *local_28;
  longlong local_20;
  undefined8 local_18;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
      *(undefined8 *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      if (lVar1 != 0) {
        *(undefined4 *)(param_1 + 0x80) = *(undefined4 *)(lVar1 + 0x178);
        *(undefined4 *)(param_1 + 0x84) = *(undefined4 *)(lVar1 + 0x17c);
        *(undefined4 *)(param_1 + 0x88) = *(undefined4 *)(lVar1 + 0x180);
      }
      uVar7 = 0;
      local_28 = (void *)0x0;
      local_20 = 0;
      local_18 = 0;
      if (lVar1 != 0) {
        local_38 = *(undefined4 *)(param_1 + 0x80);
        local_34 = *(undefined4 *)(param_1 + 0x84);
        local_30 = *(undefined4 *)(param_1 + 0x88);
        if (*(longlong *)(lVar1 + 0x1e80) != 0) {
          FUN_1402395e0(lVar1,&local_28,*(undefined4 *)(param_1 + 0xa8),
                        *(undefined4 *)(param_1 + 0x2c),&local_38);
        }
      }
      pvVar2 = local_28;
      uVar8 = local_20 - (longlong)local_28 >> 3;
      if (uVar8 != 0) {
        do {
          lVar1 = *(longlong *)((longlong)pvVar2 + uVar7 * 8);
          if (*(char *)(lVar1 + 0x11a8) == '\0') {
            iVar3 = FUN_140235b20(lVar1,*(undefined4 *)(param_1 + 0x38));
            if ((iVar3 == 0) &&
               (*(longlong *)((longlong)pvVar2 + uVar7 * 8) != *(longlong *)(param_1 + 0x48))) {
              uVar5 = FUN_1403161f0();
              uVar4 = FUN_1403161b0(uVar5,*(undefined4 *)(param_1 + 0x38));
              plVar6 = (longlong *)
                       FUN_140267670(uVar4,*(undefined4 *)(param_1 + 0x38),
                                     *(undefined8 *)((longlong)pvVar2 + uVar7 * 8));
              if (plVar6 != (longlong *)0x0) {
                (**(code **)(*plVar6 + 8))(plVar6,*(undefined4 *)(param_1 + 0x38));
                *(undefined4 *)(plVar6 + 0x10) = *(undefined4 *)(param_1 + 0x80);
                *(undefined4 *)((longlong)plVar6 + 0x84) = *(undefined4 *)(param_1 + 0x84);
                *(undefined4 *)(plVar6 + 0x11) = *(undefined4 *)(param_1 + 0x88);
                *(undefined4 *)((longlong)plVar6 + 0x6c) = 3;
                FUN_140236f40(*(undefined8 *)((longlong)pvVar2 + uVar7 * 8),
                              *(undefined8 *)(param_1 + 0x40),plVar6);
              }
            }
          }
          uVar7 = uVar7 + 1;
        } while (uVar7 < uVar8);
      }
      if (pvVar2 != (void *)0x0) {
        operator_delete(pvVar2);
      }
    }
  }
  return;
}



undefined8 * FUN_14028a5d0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectAURA_ADD_EFFECT_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028a680(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xa8) = puVar1[0x41];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_14028a710(longlong param_1,double param_2)

{
  longlong lVar1;
  void *pvVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  void *local_28;
  longlong local_20;
  undefined8 local_18;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      if (lVar1 != 0) {
        *(undefined4 *)(param_1 + 0x80) = *(undefined4 *)(lVar1 + 0x178);
        *(undefined4 *)(param_1 + 0x84) = *(undefined4 *)(lVar1 + 0x17c);
        *(undefined4 *)(param_1 + 0x88) = *(undefined4 *)(lVar1 + 0x180);
      }
      if (param_2 - *(double *)(param_1 + 0x18) < (double)*(float *)(param_1 + 0x60)) {
        uVar8 = 0;
        local_28 = (void *)0x0;
        local_20 = 0;
        local_18 = 0;
        if (lVar1 != 0) {
          local_38 = *(undefined4 *)(param_1 + 0x80);
          local_34 = *(undefined4 *)(param_1 + 0x84);
          local_30 = *(undefined4 *)(param_1 + 0x88);
          if (*(longlong *)(lVar1 + 0x1e80) != 0) {
            FUN_1402395e0(lVar1,&local_28,*(undefined4 *)(param_1 + 0xa8),
                          *(undefined4 *)(param_1 + 0x2c),&local_38);
          }
        }
        pvVar2 = local_28;
        uVar7 = local_20 - (longlong)local_28 >> 3;
        if (uVar7 != 0) {
          do {
            iVar3 = FUN_140235b20(*(undefined8 *)((longlong)pvVar2 + uVar8 * 8),
                                  *(undefined4 *)(param_1 + 0x38));
            if (((iVar3 == 0) &&
                (*(longlong *)((longlong)pvVar2 + uVar8 * 8) != *(longlong *)(param_1 + 0x48))) &&
               (*(char *)(*(longlong *)((longlong)pvVar2 + uVar8 * 8) + 0x11a8) == '\0')) {
              uVar5 = FUN_1403161f0();
              uVar4 = FUN_1403161b0(uVar5,*(undefined4 *)(param_1 + 0x38));
              plVar6 = (longlong *)
                       FUN_140267670(uVar4,*(undefined4 *)(param_1 + 0x38),
                                     *(undefined8 *)((longlong)pvVar2 + uVar8 * 8));
              if (plVar6 != (longlong *)0x0) {
                (**(code **)(*plVar6 + 8))(plVar6,*(undefined4 *)(param_1 + 0x38));
                *(undefined4 *)(plVar6 + 0x10) = *(undefined4 *)(param_1 + 0x80);
                *(undefined4 *)((longlong)plVar6 + 0x84) = *(undefined4 *)(param_1 + 0x84);
                *(undefined4 *)(plVar6 + 0x11) = *(undefined4 *)(param_1 + 0x88);
                *(undefined4 *)((longlong)plVar6 + 0x6c) = 3;
                FUN_140236f40(*(undefined8 *)((longlong)pvVar2 + uVar8 * 8),
                              *(undefined8 *)(param_1 + 0x40),plVar6);
              }
            }
            uVar8 = uVar8 + 1;
          } while (uVar8 < uVar7);
        }
        if (pvVar2 != (void *)0x0) {
          operator_delete(pvVar2);
        }
      }
      else {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70(param_1);
      }
    }
  }
  return;
}



undefined8 * FUN_14028a920(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_DEFENSE_PERCENT_DEC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028a9d0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x74c) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x74c);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028aa10(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x74c) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x74c);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028aa80(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_DEFENSE_PERCENT_DEC_PROBABILITY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14028ab30(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  uint uVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  uVar5 = 0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x40];
          goto LAB_14028ab8b;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028ab8b:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar5 = puVar1[0x3e];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0xac) = uVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_14028ac60(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x74c) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x74c);
    *(undefined1 *)(lVar1 + 0x607) = 1;
  }
  *(undefined4 *)(param_1 + 0x3c) = 2;
  return;
}



void FUN_14028aca0(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x74c) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x74c);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028ad10(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_PERCENT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028adc0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x744) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x744);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028ae10(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x744) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x744);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



void FUN_14028ae60(longlong param_1,char param_2,longlong param_3)

{
  float fVar1;
  
  if (param_2 == '\0') {
    if (param_3 == 0) {
      return;
    }
    fVar1 = -*(float *)(param_1 + 0xa8);
  }
  else {
    if (param_3 == 0) {
      return;
    }
    fVar1 = *(float *)(param_1 + 0xa8);
  }
  *(float *)(param_3 + 0x744) = fVar1 + *(float *)(param_3 + 0x744);
  *(undefined1 *)(param_3 + 0x607) = 1;
  return;
}



undefined8 * FUN_14028aeb0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_ATTACK_POINT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028af60(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x3e];
          goto LAB_14028afbb;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_14028afbb:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x60) = puVar1[0x3f];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x60) = 0;
  return;
}



void FUN_14028b050(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028b080(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x878) = *(int *)(lVar1 + 0x878) + (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028b0e0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_ATTACK_PERCENT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028b190(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x748) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x748);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028b1e0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x748) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x748);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



undefined8 * FUN_14028b230(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_ATTACK_POINT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028b2e0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x87c) = *(int *)(lVar1 + 0x87c) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028b310(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x87c) = *(int *)(lVar1 + 0x87c) + (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028b370(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_DEFENSE_POINT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028b420(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x880) = *(int *)(lVar1 + 0x880) + (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028b450(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x880) = *(int *)(lVar1 + 0x880) - (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028b4b0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_DEFENSE_POINT_INC::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028b560(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xa8) = puVar1[0x3e];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_14028b5f0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if ((lVar1 != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x884) = *(int *)(lVar1 + 0x884) + (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028b620(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x884) = *(int *)(lVar1 + 0x884) - (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028b680(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_DEFENSE_POINT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028b730(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(int *)(lVar1 + 0x884) = *(int *)(lVar1 + 0x884) + (int)*(float *)(param_1 + 0xa8);
      *(undefined1 *)(lVar1 + 0x60b) = 1;
    }
  }
  return;
}



undefined8 * FUN_14028b770(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_DEFENSE_POINT_INC_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028b820(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(int *)(lVar1 + 0x884) = *(int *)(lVar1 + 0x884) - (int)*(float *)(param_1 + 0xa8);
    *(undefined1 *)(lVar1 + 0x60b) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028b860(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar1 != 0) {
        *(int *)(lVar1 + 0x884) = *(int *)(lVar1 + 0x884) + (int)*(float *)(param_1 + 0xa8);
        *(undefined1 *)(lVar1 + 0x60b) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028b8c0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_DEFENSE_PERCENT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028b970(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x74c) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x74c);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028b9c0(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x74c) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x74c);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



undefined8 * FUN_14028ba10(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAGIC_DEFENSE_PERCENT_INC_NOLIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028bac0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x48);
  if (((lVar1 != 0) && (0.0 < *(float *)(param_1 + 0xa8))) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(float *)(lVar1 + 0x750) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x750);
    *(undefined1 *)(lVar1 + 0x607) = 1;
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028bb10(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x750) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x750);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



void FUN_14028bb60(longlong param_1,char param_2,longlong param_3)

{
  float fVar1;
  
  if (param_2 == '\0') {
    if (param_3 == 0) {
      return;
    }
    fVar1 = -*(float *)(param_1 + 0xa8);
  }
  else {
    if (param_3 == 0) {
      return;
    }
    fVar1 = *(float *)(param_1 + 0xa8);
  }
  *(float *)(param_3 + 0x750) = fVar1 + *(float *)(param_3 + 0x750);
  *(undefined1 *)(param_3 + 0x607) = 1;
  return;
}



undefined8 * FUN_14028bbb0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCOOL_TIME_CLEAR::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028bc60(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    FUN_14026bb70();
  }
  return;
}



undefined8 * FUN_14028bc90(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectSKILL_ATTRIBUTE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  return param_1;
}



void FUN_14028bd40(longlong param_1,undefined8 param_2)

{
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
  }
  return;
}



undefined8 * FUN_14028bd60(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectSKILL_ATTRIBUTE_TIME::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  return param_1;
}



void FUN_14028be10(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x1f];
          goto LAB_14028be6e;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028be6e:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x46];
          goto LAB_14028beb7;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028beb7:
  *(uint *)(param_1 + 0xac) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x47];
          goto LAB_14028beff;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028beff:
  *(uint *)(param_1 + 0xb0) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xb4) = puVar1[0x48];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xb4) = 0;
  return;
}



undefined8 * FUN_14028bfc0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectENEMY_CONTROL::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined1 *)((longlong)param_1 + 0xc4) = 0;
  return param_1;
}



void FUN_14028c080(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  float fVar4;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x2a];
          goto LAB_14028c0df;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_14028c0df:
  *(int *)(param_1 + 0xb4) = (int)fVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x2b];
          goto LAB_14028c12f;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_14028c12f:
  *(int *)(param_1 + 0xb8) = (int)fVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar4 = (float)puVar1[0x2c];
          goto LAB_14028c17f;
        }
        break;
      }
    }
  }
  fVar4 = 0.0;
LAB_14028c17f:
  *(int *)(param_1 + 0xbc) = (int)fVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xc0) = puVar1[0x40];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xc0) = 0;
  return;
}



void FUN_14028c250(longlong param_1)

{
  longlong lVar1;
  undefined4 uVar2;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    lVar1 = **(longlong **)(param_1 + 0x48);
    uVar2 = (**(code **)(lVar1 + 600))(*(longlong **)(param_1 + 0x48));
    (**(code **)(lVar1 + 0x228))(*(undefined8 *)(param_1 + 0x48),uVar2);
    lVar1 = **(longlong **)(param_1 + 0x48);
    uVar2 = (**(code **)(lVar1 + 0x260))(*(longlong **)(param_1 + 0x48));
    (**(code **)(lVar1 + 0x230))(*(undefined8 *)(param_1 + 0x48),uVar2);
    lVar1 = **(longlong **)(param_1 + 0x48);
    uVar2 = (**(code **)(lVar1 + 0x268))(*(longlong **)(param_1 + 0x48));
    (**(code **)(lVar1 + 0x238))(*(undefined8 *)(param_1 + 0x48),uVar2);
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x118))(*(longlong **)(param_1 + 0x48),0,0);
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x998))();
  }
  return;
}



void FUN_14028c2f0(longlong param_1,double param_2)

{
  undefined4 uVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      iVar3 = rand();
      if ((float)iVar3 * 3.0517578e-05 < *(float *)(param_1 + 0xc0) ||
          (float)iVar3 * 3.0517578e-05 == *(float *)(param_1 + 0xc0)) {
        if (*(longlong **)(param_1 + 0x48) == (longlong *)0x0) {
          return;
        }
        cVar2 = (**(code **)(**(longlong **)(param_1 + 0x48) + 0x9f8))();
        if (cVar2 != '\0') {
          uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 0x48) + 0x120);
          uVar4 = FUN_140302f80();
          iVar3 = FUN_140301120(uVar4,uVar1);
          if ((iVar3 != 2) && (iVar3 != 3)) {
            if (0 < *(int *)(param_1 + 0xb4)) {
              (**(code **)(**(longlong **)(param_1 + 0x48) + 0x228))();
            }
            if (0 < *(int *)(param_1 + 0xb8)) {
              (**(code **)(**(longlong **)(param_1 + 0x48) + 0x230))();
            }
            if (0 < *(int *)(param_1 + 0xbc)) {
              (**(code **)(**(longlong **)(param_1 + 0x48) + 0x238))();
            }
            (**(code **)(**(longlong **)(param_1 + 0x48) + 0x118))
                      (*(longlong **)(param_1 + 0x48),0,0);
            (**(code **)(**(longlong **)(param_1 + 0x48) + 0x998))();
            *(undefined1 *)(param_1 + 0xc4) = 1;
            return;
          }
        }
      }
    }
    else {
      if (*(int *)(param_1 + 0x3c) != 1) {
        return;
      }
      if (param_2 - *(double *)(param_1 + 0x18) < (double)*(float *)(param_1 + 0x60)) {
        return;
      }
      *(undefined4 *)(param_1 + 0x3c) = 2;
    }
    FUN_14026bb70(param_1);
  }
  return;
}



undefined8 * FUN_14028c440(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectPHYSIC_MAGIC_ATTACK_PERCENT_INC_PARTY::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  *(undefined4 *)((longlong)param_1 + 0xb4) = 0;
  return param_1;
}



void FUN_14028c4f0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  uint uVar5;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  uVar5 = 0;
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x42];
          goto LAB_14028c54f;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028c54f:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x43];
          goto LAB_14028c593;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028c593:
  *(uint *)(param_1 + 0xac) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar5 = puVar1[0x3f];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0xb4) = uVar5;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0x2c) = puVar1[0x4a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0x2c) = 1;
  return;
}



void FUN_14028c690(longlong param_1)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x3c) == 1) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x744) = -*(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x744);
      *(undefined1 *)(lVar1 + 0x607) = 1;
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(float *)(lVar1 + 0x748) = -*(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x748);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028c700(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar1 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(float *)(param_1 + 0xb0) = (float)param_2;
      if (lVar1 != 0) {
        *(float *)(lVar1 + 0x744) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x744);
        *(undefined1 *)(lVar1 + 0x607) = 1;
        lVar1 = *(longlong *)(param_1 + 0x48);
        *(float *)(lVar1 + 0x748) = *(float *)(param_1 + 0xac) + *(float *)(lVar1 + 0x748);
        *(undefined1 *)(lVar1 + 0x607) = 1;
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0xb4) <= param_2 - (double)*(float *)(param_1 + 0xb0)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028c7a0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectSCALE_CHANGE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14028c850(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x2a];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_14028c8e0(longlong param_1)

{
  undefined4 uVar1;
  longlong lVar2;
  
  lVar2 = *(longlong *)(param_1 + 0x48);
  if (lVar2 != 0) {
    uVar1 = *(undefined4 *)(param_1 + 0xa8);
    *(undefined4 *)(lVar2 + 0x1e50) = uVar1;
    if (*(longlong *)(lVar2 + 0x13d8) != 0) {
      *(undefined4 *)(*(longlong *)(lVar2 + 0x13d8) + 0xfc) = uVar1;
    }
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x9a0))();
  }
  return;
}



void FUN_14028c930(longlong param_1,double param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar2 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar2 != 0) {
        uVar1 = *(undefined4 *)(param_1 + 0xac);
        *(undefined4 *)(param_1 + 0xa8) = *(undefined4 *)(lVar2 + 0x1e50);
        *(undefined4 *)(lVar2 + 0x1e50) = uVar1;
        if (*(longlong *)(lVar2 + 0x13d8) != 0) {
          *(undefined4 *)(*(longlong *)(lVar2 + 0x13d8) + 0xfc) = uVar1;
        }
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028c9b0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectRESTRICT_RISING_DAMAGE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined2 *)(param_1 + 0x15) = 0x101;
  return param_1;
}



void FUN_14028ca60(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if ((puVar1 != (uint *)0x0) && (0.0 < (float)puVar1[0x2a])) {
          *(undefined1 *)(param_1 + 0xa8) = 1;
          return;
        }
        break;
      }
    }
  }
  *(undefined1 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_14028caf0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x48) != 0) {
    *(undefined1 *)(*(longlong *)(param_1 + 0x48) + 0x602) = *(undefined1 *)(param_1 + 0xa9);
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x9a8))
              (*(longlong **)(param_1 + 0x48),*(undefined1 *)(param_1 + 0xa9));
  }
  return;
}



void FUN_14028cb30(longlong param_1,double param_2)

{
  int iVar1;
  longlong lVar2;
  undefined1 uVar3;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      lVar2 = *(longlong *)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (lVar2 != 0) {
        iVar1 = *(int *)(lVar2 + 300);
        if ((iVar1 < 0x1f) || ((0x20 < iVar1 && (iVar1 != 0x22)))) {
          uVar3 = *(undefined1 *)(lVar2 + 0x602);
        }
        else {
          uVar3 = 0;
        }
        *(undefined1 *)(param_1 + 0xa9) = uVar3;
        *(undefined1 *)(lVar2 + 0x602) = *(undefined1 *)(param_1 + 0xa8);
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028cbc0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectDAMAGE_ONESELF::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  return param_1;
}



void FUN_14028cc70(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  
  uVar3 = (ulonglong)param_2;
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x20];
          goto LAB_14028ccce;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028ccce:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x3a];
          goto LAB_14028cd17;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028cd17:
  *(uint *)(param_1 + 0xac) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x3b];
          goto LAB_14028cd5f;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028cd5f:
  *(uint *)(param_1 + 0xb0) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xb4) = puVar1[0x40];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xb4) = 0;
  return;
}



void FUN_14028ce20(longlong param_1)

{
  int iVar1;
  
  iVar1 = *(int *)(param_1 + 0x3c);
  if (iVar1 == 1) {
    iVar1 = 2;
  }
  *(int *)(param_1 + 0x3c) = iVar1;
  return;
}



void FUN_14028ce40(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



void FUN_14028ce80(longlong param_1)

{
  longlong *plVar1;
  void *pvVar2;
  int iVar3;
  longlong *plVar4;
  bool bVar5;
  float fVar6;
  float fVar7;
  undefined1 local_res8 [8];
  undefined1 local_res10 [8];
  undefined4 local_res18 [2];
  int local_res20 [2];
  longlong *local_50;
  longlong *local_48;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    FUN_14021b4f0(*(longlong *)(param_1 + 0x48),&local_50);
    plVar4 = local_50;
    if (local_50 != (longlong *)0x0) {
      if (local_50 == local_48) {
        if (*local_50 != 0) {
          local_res8[0] = 0;
          iVar3 = FUN_14021afe0(*(undefined8 *)(param_1 + 0x48),*local_50,local_res8);
          fVar6 = (float)(int)((float)iVar3 * *(float *)(param_1 + 0xac));
          fVar7 = -fVar6;
          (**(code **)(**(longlong **)(param_1 + 0x48) + 0x290))
                    (*(longlong **)(param_1 + 0x48),fVar7);
          if (*(longlong *)(param_1 + 0x98) != 0) {
            local_res18[0] = (undefined4)(*(longlong **)(param_1 + 0x48))[0x25];
            local_res20[0] = (int)fVar7;
            local_res10[0] = (**(code **)(**(longlong **)(param_1 + 0x48) + 0xb0))();
            plVar4 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x98) + 0x48) + 0x380);
            (**(code **)(*plVar4 + 0x170))
                      (plVar4,*(undefined4 *)(*(longlong *)(param_1 + 0x98) + 8),&DAT_1405d85a0,
                       local_res10,local_res20,local_res18,local_res8);
          }
          plVar4 = local_50;
          if (((*(int *)(param_1 + 0xa8) == 1) &&
              (plVar1 = *(longlong **)(param_1 + 0x50), plVar1 != (longlong *)0x0)) &&
             (*(int *)((longlong)plVar1 + 300) != 0x25)) {
            (**(code **)(*plVar1 + 0x290))(plVar1,fVar6 * *(float *)(param_1 + 0xb0));
            plVar4 = local_50;
          }
        }
      }
      else {
        iVar3 = DAT_140608154 + 1;
        bVar5 = DAT_140608154 == 0;
        DAT_140608154 = iVar3;
        if (bVar5) {
          FUN_140176d60(1);
          plVar4 = local_50;
        }
      }
    }
    if (plVar4 != (longlong *)0x0) {
      if (plVar4 == local_48) {
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            local_50 = (longlong *)0x0;
            pvVar2 = (void *)*plVar4;
            if (pvVar2 != (void *)0x0) {
              FUN_140197310(pvVar2);
              operator_delete(pvVar2);
            }
            operator_delete(plVar4);
          }
        }
      }
      else {
        iVar3 = DAT_1406080b4 + 1;
        bVar5 = DAT_1406080b4 == 0;
        DAT_1406080b4 = iVar3;
        if (bVar5) {
          FUN_140176d60(1);
        }
      }
    }
  }
  return;
}



undefined8 * FUN_14028d090(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCANT_ATTACK::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028d140(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xa8) = puVar1[0x20];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_14028d1c0(longlong param_1)

{
  if ((*(longlong *)(param_1 + 0x48) != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    *(undefined4 *)(*(longlong *)(param_1 + 0x48) + 0xfd0) = 0;
    (**(code **)(**(longlong **)(param_1 + 0x48) + 0x9b0))(*(longlong **)(param_1 + 0x48),0);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028d200(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (*(longlong *)(param_1 + 0x48) != 0) {
        *(undefined4 *)(*(longlong *)(param_1 + 0x48) + 0xfd0) = *(undefined4 *)(param_1 + 0xa8);
        (**(code **)(**(longlong **)(param_1 + 0x48) + 0x9b0))
                  (*(longlong **)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xa8));
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70(param_1);
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028d280(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMODEL_CHANGE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14028d330(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  float fVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar3 = (float)puVar1[0x3e];
          goto LAB_14028d38b;
        }
        break;
      }
    }
  }
  fVar3 = 0.0;
LAB_14028d38b:
  *(int *)(param_1 + 0xa8) = (int)fVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x40];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_14028d420(longlong param_1)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  undefined4 local_res8 [2];
  
  iVar3 = rand();
  if ((float)iVar3 * 3.0517578e-05 < *(float *)(param_1 + 0xac) ||
      (float)iVar3 * 3.0517578e-05 == *(float *)(param_1 + 0xac)) {
    if (*(longlong *)(param_1 + 0x40) == 0) {
      if (*(longlong *)(param_1 + 0x98) != 0) {
        if (*(longlong *)(param_1 + 0x48) == 0) {
          local_res8[0] = 1;
        }
        else {
          local_res8[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x48) + 0x128);
        }
        plVar4 = (longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x98) + 0x48) + 0x380);
        (**(code **)(*plVar4 + 0x610))
                  (plVar4,*(undefined4 *)(*(longlong *)(param_1 + 0x98) + 8),&DAT_1405d85a0,
                   local_res8,param_1 + 0xa8);
        return;
      }
    }
    else {
      cVar2 = (**(code **)(**(longlong **)(param_1 + 0x48) + 0x350))
                        (*(longlong **)(param_1 + 0x48),*(undefined4 *)(param_1 + 0xa8));
      if (cVar2 != '\0') {
        lVar1 = *(longlong *)(param_1 + 0x40);
        if (*(longlong *)(lVar1 + 0xb58) == 0) {
          iVar3 = *(int *)(lVar1 + 0xc);
        }
        else {
          iVar3 = *(int *)(*(longlong *)(lVar1 + 0xb58) + 8);
        }
        if (iVar3 == 0) {
          iVar3 = *(int *)(lVar1 + 8);
        }
        plVar4 = (longlong *)(*(longlong *)(lVar1 + 0xb50) + 0x380);
        (**(code **)(*plVar4 + 0x610))
                  (plVar4,iVar3,&DAT_1405d85a0,lVar1 + 8,(undefined4 *)(param_1 + 0xa8));
      }
    }
  }
  return;
}



void FUN_14028d530(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      FUN_14028d420(param_1);
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_1 + 0x10);
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        FUN_14026bb70(param_1);
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028d5a0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMODEL_CHANGE_RELEASE::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028d650(longlong param_1,undefined8 param_2)

{
  int iVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
      if (*(longlong *)(param_1 + 0x48) != 0) {
        iVar1 = rand();
        if ((float)iVar1 * 3.0517578e-05 <= *(float *)(param_1 + 0xa8)) {
          (**(code **)(**(longlong **)(param_1 + 0x48) + 0x358))();
        }
      }
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_1 + 0x10);
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      FUN_14026bb70(param_1);
      return;
    }
  }
  return;
}



undefined8 * FUN_14028d6d0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectSUMMON::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028d780(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (plVar1 != (longlong *)0x0) {
      (**(code **)(*plVar1 + 0x9c8))(plVar1,*(undefined4 *)(param_1 + 0xa8));
    }
  }
  return;
}



undefined8 * FUN_14028d7d0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectRUSH::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028d880(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (plVar1 != (longlong *)0x0) {
      (**(code **)(*plVar1 + 0x9d8))(plVar1,*(undefined4 *)(param_1 + 0xa8));
    }
  }
  return;
}



undefined8 * FUN_14028d8d0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectWARP::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028d980(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    plVar1 = *(longlong **)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    if (plVar1 != (longlong *)0x0) {
      (**(code **)(*plVar1 + 0x9d0))(plVar1,*(undefined4 *)(param_1 + 0xa8));
    }
  }
  return;
}



undefined8 * FUN_14028d9d0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectItemRepair::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14028da80(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  float fVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar3 = (float)puVar1[0x2a];
          goto LAB_14028dadb;
        }
        break;
      }
    }
  }
  fVar3 = 0.0;
LAB_14028dadb:
  *(int *)(param_1 + 0xa8) = (int)fVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x2b];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_14028db70(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined4 uVar2;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
    }
    lVar1 = *(longlong *)(param_1 + 0x40);
    if (lVar1 != 0) {
      uVar2 = 1;
      if (*(longlong *)(lVar1 + 0xb58) != 0) {
        uVar2 = *(undefined4 *)(*(longlong *)(lVar1 + 0xb58) + 0x90);
      }
      FUN_1401b4bc0(lVar1,*(undefined4 *)(param_1 + 0xac),*(undefined4 *)(param_1 + 0xa8),uVar2);
    }
    FUN_14026bb70(param_1);
  }
  return;
}



undefined8 * FUN_14028dbe0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectGIMMICK_SUMMON::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  return param_1;
}



undefined8 * FUN_14028dca0(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = MGSAddEffectGIMMICK_SUMMON::vftable;
  plVar3 = (longlong *)param_1[0x17];
  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);
      }
    }
  }
  *param_1 = MGSAddEffect::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14028dd30(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x26];
          goto LAB_14028dd7f;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_14028dd7f:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x49];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_14028de10(longlong param_1)

{
  uint *puVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  longlong lVar5;
  uint uVar6;
  float fVar7;
  float fVar8;
  char local_res8 [8];
  undefined4 local_res10 [2];
  undefined4 local_res18 [2];
  undefined4 local_res20 [2];
  undefined8 in_stack_ffffffffffffff88;
  undefined4 uVar9;
  
  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);
  uVar6 = *(uint *)(param_1 + 8);
  local_res8[0] = '\x01';
  plVar4 = (longlong *)FUN_1403161f0();
  if (*plVar4 != 0) {
    for (puVar1 = *(uint **)(*plVar4 + ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == uVar6) && (*puVar1 == uVar6)) {
        if (puVar1 != (uint *)0x0) {
          uVar6 = puVar1[0x26];
          goto LAB_14028de7f;
        }
        break;
      }
    }
  }
  uVar6 = 0;
LAB_14028de7f:
  plVar4 = (longlong *)FUN_14032f6c0();
  fVar7 = 0.0;
  if (*plVar4 != 0) {
    for (puVar1 = *(uint **)(*plVar4 + ((ulonglong)uVar6 % (ulonglong)*(uint *)(plVar4 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x3a)) {
      if ((puVar1[0x3c] == uVar6) && (*puVar1 == uVar6)) {
        if (puVar1 != (uint *)0x0) {
          fVar8 = (float)puVar1[6];
          goto LAB_14028dec2;
        }
        break;
      }
    }
  }
  fVar8 = 0.0;
LAB_14028dec2:
  iVar3 = rand();
  if (fVar8 < (float)iVar3 * 3.0517578e-05) {
    local_res8[0] = '\0';
  }
  if (*(longlong *)(param_1 + 0x48) != 0) {
    cVar2 = FUN_1402fbfd0(*(longlong *)(param_1 + 0x48),uVar6);
    if (cVar2 == '\0') {
      local_res8[0] = '\0';
    }
    if ((*(longlong *)(param_1 + 0x98) != 0) &&
       (lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x98) + 0x30), lVar5 != 0)) {
      local_res10[0] = 0;
      if (local_res8[0] != '\0') {
        if (0.0 < *(float *)(param_1 + 0xac)) {
          fVar7 = (float)*(double *)(param_1 + 0x10) + *(float *)(param_1 + 0xac);
        }
        local_res10[0] =
             FUN_140246610(lVar5,*(undefined4 *)(param_1 + 0xa8),param_1 + 0x80,param_1 + 0x8c,
                           CONCAT44(uVar9,fVar7),*(undefined8 *)(param_1 + 0x48));
      }
      if (*(longlong *)(param_1 + 0x40) == 0) {
        local_res18[0] = (**(code **)(**(longlong **)(param_1 + 0x48) + 0xb0))();
        local_res20[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x48) + 0x128);
        iVar3 = *(int *)(*(longlong *)(param_1 + 0x98) + 8);
        lVar5 = **(longlong **)(*(longlong *)(param_1 + 0x98) + 0x48);
      }
      else {
        lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x40) + 0xb58);
        local_res18[0] = (**(code **)(**(longlong **)(param_1 + 0x48) + 0xb0))();
        local_res20[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x48) + 0x128);
        if (lVar5 == 0) {
          lVar5 = *(longlong *)(param_1 + 0x40);
          iVar3 = *(int *)(lVar5 + 0xc);
          if (iVar3 == 0) {
            iVar3 = *(int *)(lVar5 + 8);
          }
          lVar5 = *(longlong *)(lVar5 + 0xb50);
        }
        else {
          iVar3 = *(int *)(lVar5 + 8);
          if (iVar3 == 0) {
            iVar3 = *(int *)(*(longlong *)(param_1 + 0x40) + 8);
          }
          lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x40) + 0xb50);
        }
      }
      (**(code **)(*(longlong *)(lVar5 + 0x3a0) + 0xaf0))
                ((longlong *)(lVar5 + 0x3a0),iVar3,&DAT_1405d85a0,local_res20,local_res18,
                 param_1 + 8,param_1 + 0x80,param_1 + 0x8c,local_res8,local_res10);
    }
  }
  return;
}



void FUN_14028e090(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
      FUN_14028de10();
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_1 + 0x10);
      *(undefined4 *)(param_1 + 0x3c) = 1;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      FUN_14026bb70();
      return;
    }
  }
  return;
}



undefined8 * FUN_14028e0e0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectGIMMICK_WITH_DRAW::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  return param_1;
}



undefined8 * FUN_14028e1a0(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = MGSAddEffectGIMMICK_WITH_DRAW::vftable;
  plVar3 = (longlong *)param_1[0x17];
  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);
      }
    }
  }
  *param_1 = MGSAddEffect::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14028e230(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x25];
          goto LAB_14028e27f;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_14028e27f:
  *(uint *)(param_1 + 0xa8) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xac) = puVar1[0x49];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xac) = 0;
  return;
}



void FUN_14028e310(longlong param_1,double param_2)

{
  longlong lVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      if ((*(longlong *)(param_1 + 0x98) != 0) &&
         (lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x98) + 0x30), lVar1 != 0)) {
        FUN_14027c750(*(undefined8 *)(lVar1 + 0x280),*(undefined4 *)(param_1 + 0xa8),
                      (float)param_2 + *(float *)(param_1 + 0xac),*(undefined8 *)(param_1 + 0x48));
      }
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_1 + 0x10);
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      FUN_14026bb70(param_1);
      return;
    }
  }
  return;
}



undefined8 * FUN_14028e390(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectREVIVAL::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_14028e430(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  
  uVar3 = (ulonglong)param_2;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x24];
          goto LAB_14028e47a;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028e47a:
  *(uint *)(param_1 + 0xa8) = uVar4;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + (uVar3 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar4 = puVar1[0x40];
          goto LAB_14028e4bc;
        }
        break;
      }
    }
  }
  uVar4 = 0;
LAB_14028e4bc:
  *(uint *)(param_1 + 0xac) = uVar4;
  FUN_14026b530(param_1,uVar3);
  return;
}



void FUN_14028e500(longlong param_1)

{
  char cVar1;
  int iVar2;
  longlong *plVar3;
  undefined4 local_res8 [2];
  undefined4 local_res10 [2];
  undefined4 local_res18 [4];
  
  iVar2 = rand();
  if (*(float *)(param_1 + 0xac) < (float)iVar2 * 3.0517578e-05) {
    return;
  }
  if (*(int *)(param_1 + 0xa8) != 0) {
    if (*(int *)(param_1 + 0xa8) != 1) {
      return;
    }
    if (*(longlong *)(param_1 + 0x98) == 0) {
      return;
    }
    cVar1 = FUN_1402509d0(*(undefined8 *)(*(longlong *)(param_1 + 0x98) + 0x50));
    if (cVar1 == '\0') {
      return;
    }
  }
  if ((((*(longlong *)(param_1 + 0x48) != 0) && (*(longlong *)(param_1 + 0x40) != 0)) &&
      (*(longlong *)(*(longlong *)(param_1 + 0x40) + 0xb50) != 0)) &&
     (*(longlong *)(param_1 + 0x98) != 0)) {
    FUN_140218710();
    local_res8[0] = 0;
    if (*(longlong *)(param_1 + 0x50) != 0) {
      local_res8[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x50) + 0x128);
    }
    local_res10[0] = 1;
    local_res18[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x48) + 0x128);
    plVar3 = (longlong *)(*(longlong *)(*(longlong *)(param_1 + 0x40) + 0xb50) + 0x3e0);
    (**(code **)(*plVar3 + 0x1d0))
              (plVar3,*(undefined4 *)(*(longlong *)(param_1 + 0x98) + 8),&DAT_1405d85a0,local_res8,
               local_res18,local_res10);
  }
  return;
}



void FUN_14028e620(longlong param_1)

{
  int iVar1;
  
  if (*(longlong *)(param_1 + 0x48) != 0) {
    iVar1 = *(int *)(param_1 + 0x3c);
    if (iVar1 == 1) {
      iVar1 = 2;
    }
    *(int *)(param_1 + 0x3c) = iVar1;
  }
  return;
}



void FUN_14028e640(longlong param_1,undefined8 param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(undefined8 *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(undefined8 *)(param_1 + 0x18) = param_2;
      FUN_14028e500();
      *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_1 + 0x10);
      *(undefined4 *)(param_1 + 0x3c) = 1;
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      FUN_14026bb70();
      return;
    }
  }
  return;
}



undefined8 * FUN_14028e690(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectMAX_HP_OR_MP_PERCENT_INC_NO_LIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14028e740(longlong param_1,float param_2)

{
  float fVar1;
  longlong lVar2;
  longlong *plVar3;
  float fVar4;
  float fVar5;
  
  lVar2 = *(longlong *)(param_1 + 0x48);
  fVar4 = param_2 * *(float *)(param_1 + 0xa8);
  fVar5 = param_2 * *(float *)(param_1 + 0xac);
  if ((lVar2 != 0) && (*(int *)(lVar2 + 300) != 0x25)) {
    *(float *)(lVar2 + 0x734) = fVar4 + *(float *)(lVar2 + 0x734);
    *(undefined1 *)(lVar2 + 0x607) = 1;
    lVar2 = *(longlong *)(param_1 + 0x48);
    *(float *)(lVar2 + 0x738) = fVar5 + *(float *)(lVar2 + 0x738);
    *(undefined1 *)(lVar2 + 0x607) = 1;
    if (0.0 < param_2) {
      plVar3 = *(longlong **)(param_1 + 0x48);
      fVar1 = *(float *)((longlong)plVar3 + 0x5a4);
      (**(code **)(*plVar3 + 0x290))(plVar3,fVar4 * *(float *)((longlong)plVar3 + 0x59c) + 1.0);
      (**(code **)(**(longlong **)(param_1 + 0x48) + 0x298))
                (*(longlong **)(param_1 + 0x48),fVar1 * fVar5 + 1.0);
    }
    FUN_1402fb060(*(undefined8 *)(param_1 + 0x48));
  }
  return;
}



void FUN_14028e830(longlong param_1)

{
  if ((*(longlong *)(param_1 + 0x48) != 0) && (*(int *)(param_1 + 0x3c) == 1)) {
    FUN_14028e740(param_1,0xbf800000);
    *(undefined4 *)(param_1 + 0x3c) = 2;
  }
  return;
}



void FUN_14028e860(longlong param_1,undefined8 param_2)

{
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    FUN_14028e740(param_1,0x3f800000);
  }
  return;
}



undefined8 * FUN_14028e8a0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectCRITICAL_PERCENT_INC_NO_LIMIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  *(undefined4 *)(param_1 + 0x15) = 0;
  return param_1;
}



void FUN_14028e950(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  if ((*(int *)(param_1 + 0x24) == 0) &&
     (*(undefined8 *)(param_1 + 0x10) = param_2, *(int *)(param_1 + 0x3c) == 0)) {
    lVar1 = *(longlong *)(param_1 + 0x48);
    *(undefined8 *)(param_1 + 0x18) = param_2;
    *(undefined4 *)(param_1 + 0x3c) = 1;
    *(undefined8 *)(param_1 + 0x18) = param_2;
    if (lVar1 != 0) {
      *(float *)(lVar1 + 0x80c) = *(float *)(param_1 + 0xa8) + *(float *)(lVar1 + 0x80c);
      *(undefined1 *)(lVar1 + 0x607) = 1;
    }
  }
  return;
}



undefined8 * FUN_14028e9a0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectWEAK_HIT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14028ea50(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  float fVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          fVar3 = (float)puVar1[0x2a];
          goto LAB_14028eaa0;
        }
        break;
      }
    }
  }
  fVar3 = 0.0;
LAB_14028eaa0:
  *(int *)(param_1 + 0xac) = (int)fVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(int *)(param_1 + 0xa8) = (int)(float)puVar1[0x2b];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_14028eb30(longlong param_1,double param_2)

{
  longlong *plVar1;
  
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      plVar1 = *(longlong **)(param_1 + 0x48);
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      *(double *)(param_1 + 0x18) = param_2;
      if (((plVar1 != (longlong *)0x0) &&
          (*(int *)(plVar1[0x26] + 0x8e4) == *(int *)(param_1 + 0xac))) && (plVar1[0x26] != 0)) {
        (**(code **)(*plVar1 + 0xac8))(plVar1,*(undefined4 *)(param_1 + 0xa8));
      }
    }
    else if (*(int *)(param_1 + 0x3c) == 1) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined4 FUN_14028ebc0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xb0);
}



void FUN_14028ebd0(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x60) = param_2;
  *(undefined4 *)(param_1 + 0xa8) = param_3;
  return;
}



undefined8 * FUN_14028ebe0(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectWILD_CARD_ADD_EFFECT::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  return param_1;
}



void FUN_14028ec80(undefined8 param_1)

{
  FUN_14026c260();
  FUN_14028ecb0(param_1,1);
  return;
}



void FUN_14028eca0(longlong param_1)

{
  FUN_14028ecb0(param_1,-*(int *)(param_1 + 0xa0));
  return;
}



ulonglong FUN_14028ecb0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  uint uVar2;
  longlong *plVar3;
  ulonglong uVar4;
  ulonglong extraout_RAX;
  ulonglong extraout_RAX_00;
  ulonglong extraout_RAX_01;
  ulonglong extraout_RAX_02;
  uint *puVar5;
  float *pfVar6;
  int iVar7;
  void *pvVar8;
  float *pfVar9;
  longlong lVar10;
  undefined1 uVar11;
  longlong lVar12;
  float fVar13;
  void *local_60;
  longlong local_58;
  undefined8 local_50;
  float *local_40;
  longlong local_38;
  undefined8 local_30;
  
  pvVar8 = (void *)0x0;
  local_60 = (void *)0x0;
  lVar10 = 0;
  local_58 = 0;
  local_50 = 0;
  pfVar9 = (float *)0x0;
  local_40 = (float *)0x0;
  lVar12 = 0;
  local_38 = 0;
  local_30 = 0;
  uVar2 = *(uint *)(param_1 + 8);
  plVar3 = (longlong *)FUN_1403161f0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  if (*plVar3 != 0) {
    for (puVar5 = *(uint **)(*plVar3 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xe8)) {
      if ((puVar5[0xea] == uVar2) && (*puVar5 == uVar2)) {
        if (puVar5 != (uint *)0x0) {
          if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          FUN_14012bb70(&local_60);
          lVar10 = local_58;
          pvVar8 = local_60;
        }
        break;
      }
    }
  }
  uVar2 = *(uint *)(param_1 + 8);
  plVar3 = (longlong *)FUN_1403161f0();
  uVar4 = (ulonglong)uVar2 / (ulonglong)*(uint *)(plVar3 + 2);
  if (*plVar3 != 0) {
    for (puVar5 = *(uint **)(*plVar3 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0xe8)) {
      if ((puVar5[0xea] == uVar2) && (*puVar5 == uVar2)) {
        if (puVar5 != (uint *)0x0) {
          if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar4 = FUN_1402bc630(&local_40,puVar5 + 0xd8);
          pfVar9 = local_40;
          lVar12 = local_38;
        }
        break;
      }
    }
  }
  if (*(longlong *)(param_1 + 0x48) == 0) {
    if (pfVar9 != (float *)0x0) {
      operator_delete(pfVar9);
      uVar4 = extraout_RAX;
    }
  }
  else {
    iVar7 = (int)(lVar10 - (longlong)pvVar8 >> 2);
    if (iVar7 == (int)(lVar12 - (longlong)pfVar9 >> 2)) {
      lVar10 = (longlong)iVar7;
      if (0 < iVar7) {
        pfVar6 = pfVar9;
        do {
          fVar13 = (float)(int)param_2 * *pfVar6;
          uVar11 = 0;
          if (0 < (int)param_2) {
            uVar11 = 4;
          }
          uVar2 = *(int *)(((longlong)pvVar8 - (longlong)pfVar9) + (longlong)pfVar6) - 1;
          uVar4 = (ulonglong)uVar2;
          switch(uVar2) {
          case 0:
            lVar12 = *(longlong *)(param_1 + 0x48);
            uVar4 = (ulonglong)(uint)(int)fVar13;
            piVar1 = (int *)(lVar12 + 0x628);
            *piVar1 = *piVar1 + (int)fVar13;
            *(undefined1 *)(lVar12 + 0x606) = 1;
            break;
          case 1:
            uVar4 = *(ulonglong *)(param_1 + 0x48);
            *(float *)(uVar4 + 0x744) = fVar13 + *(float *)(uVar4 + 0x744);
            *(undefined1 *)(uVar4 + 0x607) = 1;
            break;
          case 2:
            lVar12 = *(longlong *)(param_1 + 0x48);
            uVar4 = (ulonglong)(uint)(int)fVar13;
            piVar1 = (int *)(lVar12 + 0x638);
            *piVar1 = *piVar1 + (int)fVar13;
            *(undefined1 *)(lVar12 + 0x606) = 1;
            break;
          case 3:
            uVar4 = *(ulonglong *)(param_1 + 0x48);
            *(float *)(uVar4 + 0x74c) = fVar13 + *(float *)(uVar4 + 0x74c);
            *(undefined1 *)(uVar4 + 0x607) = 1;
            break;
          case 4:
            lVar12 = *(longlong *)(param_1 + 0x48);
            uVar4 = (ulonglong)(uint)(int)fVar13;
            piVar1 = (int *)(lVar12 + 0x62c);
            *piVar1 = *piVar1 + (int)fVar13;
            *(undefined1 *)(lVar12 + 0x606) = 1;
            break;
          case 5:
            uVar4 = *(ulonglong *)(param_1 + 0x48);
            *(float *)(uVar4 + 0x748) = fVar13 + *(float *)(uVar4 + 0x748);
            *(undefined1 *)(uVar4 + 0x607) = 1;
            break;
          case 6:
            lVar12 = *(longlong *)(param_1 + 0x48);
            uVar4 = (ulonglong)(uint)(int)fVar13;
            piVar1 = (int *)(lVar12 + 0x63c);
            *piVar1 = *piVar1 + (int)fVar13;
            *(undefined1 *)(lVar12 + 0x606) = 1;
            break;
          case 7:
            uVar4 = *(ulonglong *)(param_1 + 0x48);
            *(float *)(uVar4 + 0x750) = fVar13 + *(float *)(uVar4 + 0x750);
            *(undefined1 *)(uVar4 + 0x607) = 1;
            break;
          case 8:
            uVar4 = *(ulonglong *)(param_1 + 0x48);
            *(undefined1 *)(uVar4 + 0x1869) = uVar11;
            *(undefined1 *)(uVar4 + 0x604) = 1;
          }
          pfVar6 = pfVar6 + 1;
          lVar10 = lVar10 + -1;
        } while (lVar10 != 0);
      }
      if (pfVar9 != (float *)0x0) {
        operator_delete(pfVar9);
        uVar4 = extraout_RAX_01;
      }
    }
    else if (pfVar9 != (float *)0x0) {
      operator_delete(pfVar9);
      uVar4 = extraout_RAX_00;
    }
  }
  if (pvVar8 != (void *)0x0) {
    operator_delete(pvVar8);
    uVar4 = extraout_RAX_02;
  }
  return uVar4;
}



void FUN_14028efe0(longlong param_1,double param_2)

{
  if (*(int *)(param_1 + 0x24) == 0) {
    *(double *)(param_1 + 0x10) = param_2;
    if (*(int *)(param_1 + 0x3c) == 0) {
      *(double *)(param_1 + 0x18) = param_2;
      *(undefined4 *)(param_1 + 0x3c) = 1;
      FUN_14028ecb0(param_1,1);
    }
    else if ((*(int *)(param_1 + 0x3c) == 1) && (0.0 < *(float *)(param_1 + 0x60))) {
      if ((double)*(float *)(param_1 + 0x60) <= param_2 - *(double *)(param_1 + 0x18)) {
        *(undefined4 *)(param_1 + 0x3c) = 2;
        FUN_14026bb70();
        return;
      }
    }
  }
  return;
}



undefined8 * FUN_14028f050(undefined8 *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 4) = param_2;
  *(undefined8 *)((longlong)param_1 + 0x2c) = 1;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 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;
  param_1[0xd] = 0;
  *param_1 = MGSAddEffect::vftable;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  *(undefined4 *)(param_1 + 0xf) = 0;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  *param_1 = MGSAddEffectGuildSkillPassive::vftable;
  *(undefined4 *)(param_1 + 0x14) = 1;
  param_1[0x15] = 0;
  return param_1;
}



void FUN_14028f100(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint uVar3;
  
  FUN_14026b530();
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          uVar3 = puVar1[0x2a];
          goto LAB_14028f150;
        }
        break;
      }
    }
  }
  uVar3 = 0;
LAB_14028f150:
  *(uint *)(param_1 + 0xac) = uVar3;
  plVar2 = (longlong *)FUN_1403161f0();
  if (*plVar2 != 0) {
    for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          *(uint *)(param_1 + 0xc) = puVar1[3];
          return;
        }
        break;
      }
    }
  }
  *(undefined4 *)(param_1 + 0xc) = 0;
  return;
}



void FUN_14028f1d0(longlong param_1,undefined8 param_2)

{
  *(undefined8 *)(param_1 + 0x10) = param_2;
  if (*(int *)(param_1 + 0x3c) == 0) {
    *(undefined8 *)(param_1 + 0x18) = param_2;
  }
  return;
}



undefined4 FUN_14028f1f0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xac);
}



undefined4 FUN_14028f200(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xa8);
}



void FUN_14028f210(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0xa8) = param_2;
  return;
}



undefined8 FUN_14028f220(undefined4 param_1)

{
  switch(param_1) {
  case 0:
  case 1:
  case 5:
  case 6:
  case 7:
  case 10:
  case 0xb:
  case 0xc:
  case 0xd:
  case 0xe:
  case 0x14:
  case 0x15:
  case 0x16:
  case 0x1b:
  case 0x1c:
  case 0x1d:
  case 0x1f:
  case 0x20:
  case 0x21:
  case 0x22:
  case 0x23:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2b:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x35:
  case 0x36:
  case 0x37:
  case 0x38:
  case 0x39:
  case 0x3a:
  case 0x3b:
  case 0x3c:
  case 0x3d:
  case 0x3e:
  case 0x42:
  case 0x43:
  case 0x44:
  case 0x4a:
  case 0x4b:
  case 0x4c:
  case 0x4e:
  case 0x4f:
  case 0x55:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
  case 99:
    return 1;
  default:
    return 0;
  }
}



undefined8 * FUN_14028f2c0(undefined4 param_1)

{
  undefined8 *puVar1;
  
  switch(param_1) {
  case 0:
    puVar1 = operator_new(0x18);
    if (puVar1 == (undefined8 *)0x0) {
      return (undefined8 *)0x0;
    }
    *puVar1 = AIExEnemy::Stay::vftable;
    return puVar1;
  case 1:
    puVar1 = operator_new(0x30);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Patrol::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 2:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Runaway::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 3:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Attack::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 4:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::RangeAttack::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 5:
    puVar1 = operator_new(0x28);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Chase::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 6:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::BackStep::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 7:
    puVar1 = operator_new(0x20);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Guard::vftable;
      puVar1[2] = 0;
      puVar1[3] = 0;
      return puVar1;
    }
    break;
  case 8:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::SideStepLeft::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 9:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::SideStepRight::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 10:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Warp::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 0xb:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Turn::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 0xc:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Rush::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 0xd:
    puVar1 = operator_new(0x18);
    if (puVar1 == (undefined8 *)0x0) {
      return (undefined8 *)0x0;
    }
    *(undefined2 *)(puVar1 + 2) = 0;
    *puVar1 = AIExEnemy::SelfDestruction::vftable;
    return puVar1;
  case 0xe:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Special::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  case 0xf:
    puVar1 = operator_new(0x18);
    if (puVar1 != (undefined8 *)0x0) {
      *puVar1 = AIExEnemy::Return::vftable;
      puVar1[2] = 0;
      return puVar1;
    }
    break;
  default:
    return (undefined8 *)0x0;
  }
  return (undefined8 *)0x0;
}



undefined8 FUN_14028f610(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  
  uVar4 = (**(code **)(**(longlong **)(param_2 + 0x30) + 0x370))();
  if ((char)uVar4 == '\0') {
    *(undefined1 *)(param_1 + 8) = 1;
    return uVar4;
  }
  *(undefined8 *)(param_1 + 0x10) = param_3;
  *(undefined8 *)(param_1 + 0x18) = param_3;
  lVar3 = *(longlong *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(lVar3 + 0x178);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(lVar3 + 0x17c);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(lVar3 + 0x180);
  uVar1 = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x520);
  *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(param_1 + 0x20);
  *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(param_1 + 0x24);
  uVar2 = *(undefined4 *)(param_1 + 0x28);
  *(undefined4 *)(param_2 + 0x4c) = uVar2;
  *(undefined4 *)(param_2 + 0x50) = uVar1;
  return CONCAT71((uint7)(uint3)((uint)uVar2 >> 8),1);
}



longlong FUN_14028f6b0(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  
  *(undefined8 *)(param_1 + 0x18) = param_3;
  *(undefined8 *)(param_1 + 0x10) = param_3;
  lVar3 = *(longlong *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(lVar3 + 0x178);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(lVar3 + 0x17c);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(lVar3 + 0x180);
  uVar1 = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x520);
  *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(param_1 + 0x20);
  *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(param_1 + 0x24);
  uVar2 = *(undefined4 *)(param_1 + 0x28);
  *(undefined4 *)(param_2 + 0x50) = uVar1;
  *(undefined4 *)(param_2 + 0x4c) = uVar2;
  return (ulonglong)(uint3)((uint)uVar2 >> 8) << 8;
}



void FUN_14028f710(longlong param_1,longlong param_2,double param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  void *local_50;
  undefined8 local_48;
  undefined8 local_40;
  
  plVar1 = *(longlong **)(param_2 + 0x30);
  cVar2 = FUN_14028f220(*(undefined4 *)((longlong)plVar1 + 300),param_2,param_3,param_4,
                        0xfffffffffffffffe);
  if (cVar2 == '\0') {
    local_50 = (void *)0x0;
    local_48 = 0;
    local_40 = 0;
    cVar2 = (**(code **)(*plVar1 + 0x180))(plVar1,&local_50,*(undefined4 *)(plVar1[0x26] + 0x280));
    if (cVar2 == '\0') {
      cVar2 = (**(code **)(*plVar1 + 0x3a8))(plVar1,param_3,param_4);
      if (cVar2 == '\x01') {
        *(double *)(param_1 + 0x10) = param_3 - 1.5;
        *(undefined1 *)(param_1 + 8) = 1;
      }
      if (2.0 < param_3 - *(double *)(param_1 + 0x18)) {
        *(double *)(param_1 + 0x18) = param_3;
        fVar5 = *(float *)(param_1 + 0x28) - *(float *)(plVar1 + 0x30);
        fVar3 = *(float *)(param_1 + 0x24) - *(float *)((longlong)plVar1 + 0x17c);
        fVar4 = *(float *)(param_1 + 0x20) - *(float *)(plVar1 + 0x2f);
        if (100.0 <= fVar4 * fVar4 + fVar3 * fVar3 + fVar5 * fVar5) {
          *(int *)(param_1 + 0x20) = (int)plVar1[0x2f];
          *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)((longlong)plVar1 + 0x17c);
          *(int *)(param_1 + 0x28) = (int)plVar1[0x30];
        }
        else {
          *(undefined1 *)(param_1 + 8) = 1;
          *(double *)(param_1 + 0x10) = param_3 - 2.5;
          *(undefined1 *)(param_2 + 0x40) = 1;
        }
      }
    }
    else {
      *(undefined1 *)(param_1 + 8) = 1;
    }
    if (local_50 != (void *)0x0) {
      operator_delete(local_50);
    }
  }
  else {
    *(undefined1 *)(param_1 + 8) = 1;
  }
  return;
}



undefined1 FUN_14028f890(longlong param_1,longlong param_2,undefined8 param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(**(longlong **)(param_2 + 0x30) + 0x378))();
  if (cVar1 == '\0') {
    *(undefined1 *)(param_1 + 8) = 1;
    return 0;
  }
  *(undefined8 *)(param_1 + 0x10) = param_3;
  return 1;
}



ulonglong FUN_14028f8e0(longlong param_1,longlong param_2,undefined8 param_3)

{
  ulonglong uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_2 + 0x30) + 0x378))();
  if ((char)uVar1 == '\x01') {
    *(undefined8 *)(param_1 + 0x10) = param_3;
    return uVar1;
  }
  return uVar1 & 0xffffffffffffff00;
}



void FUN_14028f920(longlong param_1,longlong param_2,double param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  double dVar7;
  
  plVar1 = *(longlong **)(param_2 + 0x30);
  dVar7 = param_3;
  cVar2 = FUN_14028f220(*(undefined4 *)((longlong)plVar1 + 300));
  if ((((cVar2 == '\0') && ((int)plVar1[0x19c] == 0)) &&
      (dVar7 - *(double *)(param_1 + 0x10) <= 10.0)) &&
     (((lVar3 = (**(code **)(*plVar1 + 0x430))
                          (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]),
       lVar3 != 0 &&
       (fVar6 = *(float *)(lVar3 + 0x17c) - *(float *)((longlong)plVar1 + 0x17c),
       fVar5 = *(float *)(lVar3 + 0x178) - *(float *)(plVar1 + 0x2f),
       fVar4 = *(float *)(lVar3 + 0x180) - *(float *)(plVar1 + 0x30),
       fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4 <
       *(float *)(plVar1[0x26] + 0x28c) * *(float *)(plVar1[0x26] + 0x28c))) &&
      (cVar2 = (**(code **)(*plVar1 + 0x3a0))(plVar1,param_3,param_4), cVar2 != '\x01')))) {
    return;
  }
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



void FUN_14028fa30(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  double dVar4;
  
  dVar4 = *(double *)(*(longlong *)(param_2 + 0x30) + 0x510);
  iVar3 = rand();
  plVar1 = *(longlong **)(param_2 + 0x30);
  lVar2 = *plVar1;
  dVar4 = (double)((float)iVar3 * 3.0517578e-05 * 2.0) + (dVar4 - 1.0);
  *(double *)(param_1 + 0x10) = dVar4;
  plVar1[0x166] = (longlong)dVar4;
                    // WARNING: Could not recover jumptable at 0x00014028fab9. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(lVar2 + 0x390))(plVar1,param_3,0);
  return;
}



undefined8 FUN_14028fac0(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  double dVar4;
  
  dVar4 = *(double *)(*(longlong *)(param_2 + 0x30) + 0x510);
  iVar3 = rand();
  plVar1 = *(longlong **)(param_2 + 0x30);
  lVar2 = *plVar1;
  dVar4 = (double)((float)iVar3 * 3.0517578e-05 * 2.0) + (dVar4 - 1.0);
  *(double *)(param_1 + 0x10) = dVar4;
  plVar1[0x166] = (longlong)dVar4;
  (**(code **)(lVar2 + 0x390))(plVar1,param_3,0);
  return 1;
}



void FUN_14028fb60(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  longlong lVar3;
  
  plVar1 = *(longlong **)(param_2 + 0x30);
  if (*(char *)((longlong)plVar1 + 0xc64) == '\0') {
    cVar2 = FUN_14024c610(plVar1);
    if ((cVar2 != '\0') &&
       (lVar3 = (**(code **)(*plVar1 + 0x430))
                          (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]),
       lVar3 != 0)) {
      (**(code **)(*plVar1 + 0x390))(plVar1,param_3,param_4);
      return;
    }
    *(undefined1 *)(param_1 + 8) = 1;
  }
  else {
    *(undefined1 *)(param_1 + 8) = 1;
  }
  (**(code **)(*plVar1 + 0xbe0))(plVar1);
  (**(code **)(*plVar1 + 0xbf0))(plVar1,0);
  return;
}



undefined8 FUN_14028fc10(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  
  *(undefined8 *)(param_1 + 0x10) = param_3;
  lVar3 = *(longlong *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(lVar3 + 0x178);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(lVar3 + 0x17c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(lVar3 + 0x180);
  uVar1 = *(undefined4 *)(*(longlong *)(param_2 + 0x30) + 0x520);
  *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(param_1 + 0x18);
  *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(param_1 + 0x1c);
  uVar2 = *(undefined4 *)(param_1 + 0x20);
  *(undefined4 *)(param_2 + 0x50) = uVar1;
  *(undefined4 *)(param_2 + 0x4c) = uVar2;
  return CONCAT71((uint7)(uint3)((uint)uVar2 >> 8),1);
}



void FUN_14028fc60(longlong param_1,longlong param_2,double param_3)

{
  longlong *plVar1;
  char cVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  
  plVar1 = *(longlong **)(param_2 + 0x30);
  cVar2 = FUN_14028f220(*(undefined4 *)((longlong)plVar1 + 300));
  if ((cVar2 != '\0') || ((int)plVar1[0x19c] != 0)) {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  lVar3 = (**(code **)(*plVar1 + 0x430))
                    (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
  if (lVar3 != 0) {
    (**(code **)(*plVar1 + 0x1b0))(plVar1,param_3);
    if (2.0 < param_3 - *(double *)(param_1 + 0x10)) {
      *(double *)(param_1 + 0x10) = param_3;
      fVar6 = *(float *)(param_1 + 0x1c) - *(float *)((longlong)plVar1 + 0x17c);
      fVar5 = *(float *)(param_1 + 0x18) - *(float *)(plVar1 + 0x2f);
      fVar4 = *(float *)(param_1 + 0x20) - *(float *)(plVar1 + 0x30);
      if (fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4 < 100.0) {
        *(undefined1 *)(param_2 + 0x40) = 1;
        goto LAB_14028fe0c;
      }
      *(int *)(param_1 + 0x18) = (int)plVar1[0x2f];
      *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)((longlong)plVar1 + 0x17c);
      *(int *)(param_1 + 0x20) = (int)plVar1[0x30];
    }
    fVar4 = *(float *)(plVar1[0x26] + 0x284);
    if (plVar1[0x462] != 0) {
      fVar4 = fVar4 + *(float *)(plVar1[0x462] + 0xc);
    }
    fVar6 = *(float *)(lVar3 + 0x178) - *(float *)(plVar1 + 0x2f);
    fVar5 = *(float *)(lVar3 + 0x17c) - *(float *)((longlong)plVar1 + 0x17c);
    fVar7 = *(float *)(lVar3 + 0x180) - *(float *)(plVar1 + 0x30);
    if (((fVar4 * fVar4 <= fVar5 * fVar5 + fVar6 * fVar6 + fVar7 * fVar7) &&
        (fVar4 = *(float *)(plVar1[0x26] + 0x280),
        fVar5 * fVar5 + fVar6 * fVar6 + fVar7 * fVar7 < fVar4 * fVar4)) &&
       (cVar2 = (**(code **)(*plVar1 + 0x410))(plVar1), cVar2 != '\0')) {
      return;
    }
  }
LAB_14028fe0c:
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



undefined8 FUN_14028fe30(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  (**(code **)(**(longlong **)(param_2 + 0x30) + 0xbf0))(*(longlong **)(param_2 + 0x30),0);
  (**(code **)(**(longlong **)(param_2 + 0x30) + 0xd0))(*(longlong **)(param_2 + 0x30),1,0);
  return 1;
}



void FUN_14028fe70(longlong param_1,longlong param_2,double param_3)

{
  double dVar1;
  longlong *plVar2;
  char cVar3;
  float fVar4;
  
  plVar2 = *(longlong **)(param_2 + 0x30);
  cVar3 = FUN_14028f220(*(undefined4 *)((longlong)plVar2 + 300));
  if ((cVar3 != '\0') ||
     (dVar1 = *(double *)(param_1 + 0x10), fVar4 = (float)(**(code **)(*plVar2 + 0xbd0))(plVar2),
     (double)fVar4 < param_3 - dVar1)) {
    *(undefined1 *)(param_1 + 8) = 1;
    (**(code **)(*plVar2 + 0xbe0))(plVar2);
  }
  return;
}



undefined8 FUN_14028fee0(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  (**(code **)(**(longlong **)(param_2 + 0x30) + 200))(*(longlong **)(param_2 + 0x30),7);
  return 1;
}



void FUN_14028ff10(longlong param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  
  iVar2 = *(int *)(*(longlong *)(param_2 + 0x30) + 300);
  if (iVar2 != 7) {
    cVar1 = FUN_14028f220(iVar2);
    if ((cVar1 != '\0') || (iVar2 != 7)) {
      *(undefined1 *)(param_1 + 8) = 1;
    }
  }
  return;
}



undefined8 FUN_14028ff50(longlong param_1,longlong param_2)

{
  double dVar1;
  longlong lVar2;
  longlong *plVar3;
  float fVar4;
  
  plVar3 = (longlong *)(**(code **)(**(longlong **)(param_2 + 0x30) + 0xe0))();
  dVar1 = *(double *)(*(longlong *)(param_2 + 0x30) + 0x510);
  fVar4 = (float)(**(code **)(*plVar3 + 0x58))(plVar3);
  plVar3 = *(longlong **)(param_2 + 0x30);
  lVar2 = *plVar3;
  *(double *)(param_1 + 0x10) = (double)fVar4 + dVar1;
  (**(code **)(lVar2 + 200))(plVar3,0x30);
  return 1;
}



void FUN_14028ffc0(longlong param_1,longlong param_2,double param_3,undefined8 param_4)

{
  double dVar1;
  undefined4 uVar2;
  longlong *plVar3;
  char cVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  plVar3 = *(longlong **)(param_2 + 0x30);
  lVar5 = (**(code **)(*plVar3 + 0x430))
                    (plVar3,*(undefined4 *)((longlong)plVar3 + 0x53c),(int)plVar3[0xa8]);
  if (lVar5 != 0) {
    if (*(double *)(param_1 + 0x10) <= param_3 && param_3 != *(double *)(param_1 + 0x10)) {
      if (*(int *)(lVar5 + 300) != 10) goto switchD_1402900c8_caseD_1d;
      *(double *)(param_1 + 0x10) = param_3 + DAT_1405dfc58;
      dVar1 = (double)plVar3[0x166];
      fVar6 = (float)(**(code **)(*plVar3 + 0x360))(plVar3);
      if ((double)fVar6 < param_3 - dVar1) {
        uVar2 = *(undefined4 *)((longlong)plVar3 + 300);
        *(undefined4 *)((longlong)plVar3 + 300) = 2;
        cVar4 = (**(code **)(*plVar3 + 0x390))(plVar3,param_3,param_4);
        if (cVar4 == '\0') {
          *(undefined4 *)((longlong)plVar3 + 300) = uVar2;
        }
      }
    }
    switch(*(undefined4 *)(lVar5 + 300)) {
    case 0x1d:
    case 0x1f:
    case 0x20:
    case 0x21:
    case 0x22:
    case 0x23:
    case 0x2f:
    case 0x30:
    case 0x32:
      break;
    default:
      fVar8 = *(float *)((longlong)plVar3 + 0x17c) - *(float *)(lVar5 + 0x17c);
      fVar6 = *(float *)(plVar3 + 0x30) - *(float *)(lVar5 + 0x180);
      fVar7 = *(float *)(plVar3 + 0x2f) - *(float *)(lVar5 + 0x178);
      if (((fVar8 * fVar8 + fVar7 * fVar7 + fVar6 * fVar6 < 160000.0) &&
          (0x2e < *(int *)((longlong)plVar3 + 300))) && (*(int *)((longlong)plVar3 + 300) < 0x32)) {
        return;
      }
    }
  }
switchD_1402900c8_caseD_1d:
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



void FUN_140290170(longlong param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  
  iVar2 = *(int *)(*(longlong *)(param_2 + 0x30) + 300);
  if (iVar2 != 5) {
    cVar1 = FUN_14028f220(iVar2);
    if ((cVar1 != '\0') || (iVar2 != 5)) {
      *(undefined1 *)(param_1 + 8) = 1;
    }
  }
  return;
}



undefined8 FUN_1402901b0(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  (**(code **)(**(longlong **)(param_2 + 0x30) + 200))(*(longlong **)(param_2 + 0x30),5);
  return 1;
}



void FUN_1402901e0(longlong param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  
  iVar2 = *(int *)(*(longlong *)(param_2 + 0x30) + 300);
  if (iVar2 != 6) {
    cVar1 = FUN_14028f220(iVar2);
    if ((cVar1 != '\0') || (iVar2 != 6)) {
      *(undefined1 *)(param_1 + 8) = 1;
    }
  }
  return;
}



void FUN_140290220(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  FUN_14024b3c0(*(undefined8 *)(param_2 + 0x30),0);
  return;
}



void FUN_140290240(longlong *param_1,longlong param_2,undefined8 param_3)

{
  switch(*(undefined4 *)(*(longlong *)(param_2 + 0x30) + 300)) {
  case 10:
  case 0xd:
  case 0x1d:
  case 0x23:
  case 0x24:
  case 0x46:
  case 0x47:
  case 0x5b:
    break;
  default:
    *(undefined1 *)(param_1 + 1) = 1;
    (**(code **)(**(longlong **)(param_2 + 0x30) + 0xbe0))();
    (**(code **)(*param_1 + 0x30))(param_1,param_2,param_3);
  }
  return;
}



undefined8 FUN_140290320(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  (**(code **)(**(longlong **)(param_2 + 0x30) + 0xbf8))();
  return 1;
}



undefined1 FUN_140290340(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  return 1;
}



void FUN_140290350(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = *(longlong **)(param_2 + 0x30);
  lVar2 = (**(code **)(*plVar1 + 0x430))
                    (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
  if ((lVar2 == 0) || (*(int *)(*(longlong *)(param_2 + 0x30) + 300) != 0x49)) {
    *(undefined1 *)(param_1 + 8) = 1;
  }
  return;
}



undefined8 FUN_1402903a0(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong lVar1;
  char cVar2;
  
  lVar1 = *(longlong *)(*(longlong *)(param_2 + 0x30) + 0x2308);
  if (lVar1 != 0) {
    cVar2 = FUN_14024b490(*(longlong *)(param_2 + 0x30),*(undefined4 *)(lVar1 + 0x3c));
    if (cVar2 != '\0') {
      *(undefined8 *)(param_1 + 0x10) = param_3;
      return 1;
    }
  }
  *(undefined1 *)(param_1 + 8) = 1;
  return 0;
}



void FUN_140290400(longlong param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  
  iVar2 = *(int *)(*(longlong *)(param_2 + 0x30) + 300);
  cVar1 = FUN_14028f220(iVar2);
  if (((cVar1 != '\0') || (iVar2 < 0x4a)) || (0x4c < iVar2)) {
    *(undefined1 *)(param_1 + 8) = 1;
  }
  return;
}



undefined8 FUN_140290440(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined8 *puVar3;
  
  plVar1 = *(longlong **)(param_2 + 0x30);
  lVar2 = (**(code **)(*plVar1 + 0x430))
                    (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
  if (lVar2 == 0) {
    *(undefined1 *)(param_1 + 8) = 1;
    return 0;
  }
  if (*(char *)(param_1 + 0x11) == '\0') {
    puVar3 = (undefined8 *)(plVar1[0x45d] + 0x1c0);
    if (7 < *(ulonglong *)(plVar1[0x45d] + 0x1d8)) {
      puVar3 = (undefined8 *)*puVar3;
    }
    (**(code **)(*plVar1 + 0x8f8))(plVar1,puVar3,0,0x3f800000,1,0,0);
    *(undefined4 *)((longlong)plVar1 + 0x1e2c) = 3;
  }
  else {
    (**(code **)(**(longlong **)(param_2 + 0x30) + 0x118))(*(longlong **)(param_2 + 0x30),0,0);
  }
  *(undefined1 *)(param_1 + 0x10) = 1;
  return 1;
}



void FUN_140290510(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  
  plVar1 = *(longlong **)(param_2 + 0x30);
  lVar4 = *plVar1;
  if (*(char *)(param_1 + 0x11) == '\0') {
    if (*(int *)((longlong)plVar1 + 300) == 10) {
      lVar4 = (**(code **)(lVar4 + 0x430))
                        (plVar1,*(undefined4 *)((longlong)plVar1 + 0x53c),(int)plVar1[0xa8]);
      if (lVar4 == 0) goto LAB_1402905c3;
      if (*(int *)(*(longlong *)(plVar1[0x27b] + 0x20) + 0x54) != 1) {
        return;
      }
      lVar4 = *plVar1;
    }
    (**(code **)(lVar4 + 0x960))(plVar1);
  }
  else {
    iVar3 = (**(code **)(lVar4 + 0x128))();
    if ((iVar3 != 0) &&
       (cVar2 = (**(code **)(*plVar1 + 0x1b8))(plVar1,param_3,param_4), cVar2 != '\0')) {
      (**(code **)(*plVar1 + 0x118))(plVar1,0,0);
      cVar2 = (**(code **)(*plVar1 + 0x410))(plVar1);
      if (cVar2 != '\0') {
        return;
      }
    }
  }
LAB_1402905c3:
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



undefined8 FUN_1402905e0(longlong param_1,longlong param_2)

{
  char cVar1;
  
  cVar1 = (**(code **)(**(longlong **)(param_2 + 0x30) + 0x400))();
  if (cVar1 == '\x01') {
    *(undefined1 *)(param_1 + 8) = 1;
    return 0;
  }
  return 1;
}



void FUN_140290610(longlong param_1,longlong param_2,double param_3)

{
  char cVar1;
  
  if (1.0 <= param_3 - *(double *)(param_1 + 0x10)) {
    *(double *)(param_1 + 0x10) = param_3;
    cVar1 = (**(code **)(**(longlong **)(param_2 + 0x30) + 0x3f8))();
    if ((cVar1 != '\0') &&
       (cVar1 = (**(code **)(**(longlong **)(param_2 + 0x30) + 0x400))(), cVar1 != '\x01')) {
      return;
    }
    *(undefined1 *)(param_1 + 8) = 1;
  }
  return;
}



undefined8 FUN_140290670(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  *(undefined1 *)(param_2 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x10) = param_3;
  lVar3 = *(longlong *)(param_2 + 0x30);
  fVar6 = *(float *)(param_2 + 0x48) - *(float *)(lVar3 + 0x17c);
  fVar4 = *(float *)(param_2 + 0x4c) - *(float *)(lVar3 + 0x180);
  fVar5 = *(float *)(param_2 + 0x44) - *(float *)(lVar3 + 0x178);
  if (fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4 < 400.0) {
    uVar1 = *(undefined4 *)(lVar3 + 0x534);
    *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(lVar3 + 0x16c);
    *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(lVar3 + 0x170);
    uVar2 = *(undefined4 *)(lVar3 + 0x174);
    *(undefined4 *)(param_2 + 0x50) = uVar1;
    *(undefined4 *)(param_2 + 0x4c) = uVar2;
  }
  return 1;
}



void FUN_140290700(longlong param_1,longlong param_2,double param_3,undefined8 param_4)

{
  int iVar1;
  longlong *plVar2;
  char cVar3;
  
  plVar2 = *(longlong **)(param_2 + 0x30);
  iVar1 = *(int *)((longlong)plVar2 + 300);
  if (((1 < iVar1) && (((iVar1 < 4 || (iVar1 == 0x1e)) || (iVar1 == 0x50)))) &&
     ((cVar3 = (**(code **)(*plVar2 + 0x388))
                         (plVar2,param_3,param_4,param_2 + 0x44,*(undefined4 *)(param_2 + 0x50)),
      cVar3 != '\0' && (param_3 - *(double *)(param_1 + 0x10) <= 5.0)))) {
    return;
  }
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



undefined8 FUN_140290780(void)

{
  return 0xf;
}



wchar_t * FUN_140290790(void)

{
  return L"Return";
}



undefined8 FUN_1402907a0(void)

{
  return 0xe;
}



wchar_t * FUN_1402907b0(void)

{
  return L"Special";
}



undefined8 FUN_1402907c0(void)

{
  return 0xd;
}



wchar_t * FUN_1402907d0(void)

{
  return L"SelfDestruction";
}



undefined8 FUN_1402907e0(void)

{
  return 0xc;
}



wchar_t * FUN_1402907f0(void)

{
  return L"Rush";
}



undefined8 FUN_140290800(void)

{
  return 0xb;
}



wchar_t * FUN_140290810(void)

{
  return L"Turn";
}



undefined8 FUN_140290820(void)

{
  return 10;
}



wchar_t * FUN_140290830(void)

{
  return L"Warp";
}



wchar_t * FUN_140290840(void)

{
  return L"SideStepR";
}



undefined8 FUN_140290850(void)

{
  return 8;
}



wchar_t * FUN_140290860(void)

{
  return L"SideStepL";
}



wchar_t * FUN_140290870(void)

{
  return L"BackStep";
}



wchar_t * FUN_140290880(void)

{
  return L"Guard";
}



wchar_t * FUN_140290890(void)

{
  return L"Stay";
}



wchar_t * FUN_1402908a0(void)

{
  return L"Chase";
}



wchar_t * FUN_1402908b0(void)

{
  return L"RangeAttack";
}



undefined8 FUN_1402908c0(void)

{
  return 3;
}



wchar_t * FUN_1402908d0(void)

{
  return L"Attack";
}



undefined8 FUN_1402908e0(void)

{
  return 2;
}



wchar_t * FUN_1402908f0(void)

{
  return L"Runaway";
}



wchar_t * FUN_140290900(void)

{
  return L"Patrol";
}



undefined8 FUN_140290910(undefined8 param_1,undefined8 param_2,longlong param_3)

{
  char cVar1;
  
  cVar1 = FUN_14028f220(*(undefined4 *)(*(longlong *)(param_3 + 0x30) + 300));
  if (cVar1 != '\0') {
    return 0;
  }
  return 0x3dcccccd;
}



undefined8 FUN_140290940(longlong param_1,undefined8 param_2,longlong param_3,double param_4)

{
  char cVar1;
  
  cVar1 = FUN_14028f220(*(undefined4 *)(*(longlong *)(param_3 + 0x30) + 300));
  if ((cVar1 == '\0') && (3.0 <= param_4 - *(double *)(param_1 + 0x10))) {
    return 0x3e4ccccd;
  }
  return 0;
}



void FUN_140290990(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  char cVar1;
  int iVar2;
  longlong *plVar3;
  float local_38;
  float local_34;
  float local_30;
  float local_28;
  float local_24;
  float local_20;
  
  plVar3 = *(longlong **)(param_3 + 0x30);
  cVar1 = FUN_14028f220(*(undefined4 *)((longlong)plVar3 + 300));
  if (((cVar1 == '\0') && (5.0 <= param_4 - *(double *)(param_1 + 0x10))) && (param_2 != 0)) {
    local_38 = *(float *)((longlong)plVar3 + 0x154) * 50.0 + *(float *)(plVar3 + 0x2f);
    local_34 = *(float *)(plVar3 + 0x2b) * 50.0 + *(float *)((longlong)plVar3 + 0x17c);
    local_30 = *(float *)((longlong)plVar3 + 0x15c) * 50.0 + *(float *)(plVar3 + 0x30);
    local_28 = local_38;
    local_24 = local_34;
    local_20 = local_30;
    iVar2 = FUN_1402f98b0(plVar3,&local_38,plVar3 + 0x2f,&local_28,(longlong)plVar3 + 0x524,
                          plVar3 + 0xa4,1,0x447a0000);
    if (iVar2 == 1) {
      rand();
      plVar3 = (longlong *)(**(code **)(*plVar3 + 0xe0))(plVar3);
      (**(code **)(*plVar3 + 0x78))(plVar3);
    }
    return;
  }
  return;
}



undefined8 FUN_140290b70(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  char cVar1;
  longlong lVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  lVar2 = *(longlong *)(param_3 + 0x30);
  cVar1 = FUN_14028f220(*(undefined4 *)(lVar2 + 300));
  if (((cVar1 == '\0') && (*(char *)(lVar2 + 0xc64) == '\0')) && (param_2 != 0)) {
    switch(*(undefined4 *)(param_2 + 300)) {
    case 0:
    case 1:
    case 0x25:
    case 0x46:
    case 0x47:
    case 0x62:
      break;
    default:
      if (*(int *)(lVar2 + 0xce0) != 0) {
        return 0x40000000;
      }
      if (*(longlong *)(lVar2 + 0x2308) == 0) {
        fVar6 = 0.0;
      }
      else {
        fVar6 = *(float *)(*(longlong *)(lVar2 + 0x2308) + 0x4c);
      }
      if ((double)(*(float *)(*(longlong *)(lVar2 + 0x130) + 0x290) - fVar6) <=
          param_4 - *(double *)(param_1 + 0x10)) {
        fVar6 = *(float *)(*(longlong *)(lVar2 + 0x130) + 0x284);
        if (*(longlong *)(lVar2 + 0x2310) != 0) {
          fVar6 = fVar6 + *(float *)(*(longlong *)(lVar2 + 0x2310) + 0xc);
        }
        fVar5 = *(float *)(param_2 + 0x178) - *(float *)(lVar2 + 0x178);
        fVar3 = *(float *)(param_2 + 0x17c) - *(float *)(lVar2 + 0x17c);
        fVar4 = *(float *)(param_2 + 0x180) - *(float *)(lVar2 + 0x180);
        if (fVar5 * fVar5 + fVar3 * fVar3 + fVar4 * fVar4 < fVar6 * fVar6) {
          return 0x40000000;
        }
      }
      return 0;
    }
  }
  return 0;
}



undefined8 FUN_140290d10(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  float *pfVar1;
  char cVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  
  lVar3 = *(longlong *)(param_3 + 0x30);
  cVar2 = FUN_14028f220(*(undefined4 *)(lVar3 + 300));
  if ((((cVar2 != '\0') || (*(char *)(lVar3 + 0xc64) != '\0')) || (param_2 == 0)) ||
     (pfVar1 = (float *)(*(longlong *)(lVar3 + 0x130) + 0x288), *pfVar1 <= 1.0 && *pfVar1 != 1.0)) {
    return 0;
  }
  fVar7 = *(float *)(*(longlong *)(lVar3 + 0x130) + 0x284);
  if (*(longlong *)(lVar3 + 0x2310) != 0) {
    fVar7 = fVar7 + *(float *)(*(longlong *)(lVar3 + 0x2310) + 0xc);
  }
  fVar6 = *(float *)(param_2 + 0x17c) - *(float *)(lVar3 + 0x17c);
  fVar5 = *(float *)(param_2 + 0x178) - *(float *)(lVar3 + 0x178);
  fVar4 = *(float *)(param_2 + 0x180) - *(float *)(lVar3 + 0x180);
  if (((fVar7 * fVar7 <= fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4) &&
      (*(int *)(param_2 + 300) != 0x25)) && (*(int *)(param_2 + 300) != 0x62)) {
    if (*(longlong *)(lVar3 + 0x2308) == 0) {
      fVar7 = 0.0;
    }
    else {
      fVar7 = *(float *)(*(longlong *)(lVar3 + 0x2308) + 0x4c);
    }
    if ((double)(*(float *)(*(longlong *)(lVar3 + 0x130) + 0x290) - fVar7) <=
        param_4 - *(double *)(param_1 + 0x10)) {
      fVar7 = *(float *)(*(longlong *)(lVar3 + 0x130) + 0x284);
      if (*(longlong *)(lVar3 + 0x2310) != 0) {
        fVar7 = fVar7 + *(float *)(*(longlong *)(lVar3 + 0x2310) + 0xc);
      }
      fVar4 = *(float *)(param_2 + 0x17c) - *(float *)(lVar3 + 0x17c);
      fVar5 = *(float *)(param_2 + 0x178) - *(float *)(lVar3 + 0x178);
      fVar6 = *(float *)(param_2 + 0x180) - *(float *)(lVar3 + 0x180);
      if (fVar4 * fVar4 + fVar5 * fVar5 + fVar6 * fVar6 < fVar7 * fVar7) {
        return 0x40000000;
      }
    }
    return 0;
  }
  return 0;
}



undefined8 FUN_140290ed0(undefined8 param_1,longlong param_2,longlong param_3)

{
  float fVar1;
  char cVar2;
  longlong *plVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  plVar3 = *(longlong **)(param_3 + 0x30);
  cVar2 = FUN_14028f220(*(undefined4 *)((longlong)plVar3 + 300));
  if (((cVar2 == '\0') && (param_2 != 0)) && (*(char *)(param_3 + 0x40) != '\x01')) {
    fVar6 = *(float *)(param_2 + 0x17c) - *(float *)((longlong)plVar3 + 0x17c);
    fVar5 = *(float *)(param_2 + 0x178) - *(float *)(plVar3 + 0x2f);
    fVar4 = *(float *)(param_2 + 0x180) - *(float *)(plVar3 + 0x30);
    fVar1 = *(float *)(plVar3[0x26] + 0x28c);
    if ((fVar1 * fVar1 <= fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4) &&
       (fVar4 = *(float *)(param_2 + 0x17c) - *(float *)((longlong)plVar3 + 0x17c),
       fVar5 = *(float *)(param_2 + 0x178) - *(float *)(plVar3 + 0x2f),
       fVar6 = *(float *)(param_2 + 0x180) - *(float *)(plVar3 + 0x30),
       fVar1 = *(float *)(plVar3[0x26] + 0x280),
       fVar4 * fVar4 + fVar5 * fVar5 + fVar6 * fVar6 < fVar1 * fVar1)) {
      cVar2 = (**(code **)(*plVar3 + 0x1d8))(plVar3);
      if (cVar2 != '\0') {
        return 0x3f4ccccd;
      }
    }
    return 0;
  }
  return 0;
}



undefined8 FUN_140290fe0(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  longlong lVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  longlong *plVar5;
  float fVar6;
  float local_48;
  float local_44;
  float local_40;
  float local_38;
  float local_34;
  float local_30;
  
  plVar5 = *(longlong **)(param_3 + 0x30);
  cVar3 = FUN_14028f220(*(undefined4 *)((longlong)plVar5 + 300));
  if (cVar3 == '\0') {
    plVar5 = (longlong *)(**(code **)(*plVar5 + 0xe0))(plVar5);
    fVar6 = (float)(**(code **)(*plVar5 + 0x70))(plVar5);
    if ((double)fVar6 <= param_4 - *(double *)(param_1 + 0x10)) {
      iVar4 = rand();
      plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0x30) + 0xe0))();
      fVar6 = (float)(**(code **)(*plVar5 + 0x78))(plVar5);
      if ((float)iVar4 * 3.0517578e-05 < fVar6) {
        lVar1 = *(longlong *)(param_3 + 0x30);
        lVar2 = *(longlong *)(param_3 + 0x30);
        local_48 = *(float *)(lVar1 + 0x154) * 200.0 + *(float *)(lVar1 + 0x178);
        local_44 = *(float *)(lVar1 + 0x158) * 200.0 + *(float *)(lVar1 + 0x17c);
        local_40 = *(float *)(lVar1 + 0x15c) * 200.0 + *(float *)(lVar1 + 0x180);
        local_38 = local_48;
        local_34 = local_44;
        local_30 = local_40;
        iVar4 = FUN_1402f98b0(lVar2,&local_48,lVar2 + 0x178,&local_38,lVar2 + 0x524,lVar2 + 0x520,1,
                              0x447a0000);
        if ((iVar4 == 1) && (param_2 != 0)) {
          lVar1 = *(longlong *)(param_3 + 0x30);
          local_38 = *(float *)(param_2 + 0x178) - *(float *)(lVar1 + 0x178);
          local_34 = *(float *)(param_2 + 0x17c) - *(float *)(lVar1 + 0x17c);
          local_30 = *(float *)(param_2 + 0x180) - *(float *)(lVar1 + 0x180);
          cVar3 = FUN_140197780(&local_38,*(undefined4 *)(*(longlong *)(lVar1 + 0x130) + 0x28c));
          if (cVar3 != '\0') {
            *(double *)(param_1 + 0x10) = param_4;
            return 0x3f400000;
          }
        }
      }
      else {
        *(double *)(param_1 + 0x10) = param_4;
      }
    }
  }
  return 0;
}



undefined4 FUN_1402911e0(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  
  plVar4 = *(longlong **)(param_3 + 0x30);
  cVar2 = FUN_14028f220(*(undefined4 *)((longlong)plVar4 + 300));
  if (cVar2 == '\0') {
    plVar4 = (longlong *)(**(code **)(*plVar4 + 0xe0))(plVar4);
    iVar3 = (**(code **)(*plVar4 + 0x50))(plVar4);
    if ((((iVar3 != 0) && (10.0 <= param_4 - *(double *)(param_1 + 0x10))) &&
        (3.0 <= param_4 - *(double *)(param_1 + 0x18))) &&
       (((*(double *)(param_1 + 0x18) = param_4, param_2 != 0 &&
         (lVar1 = *(longlong *)(param_3 + 0x30),
         fVar7 = *(float *)(param_2 + 0x17c) - *(float *)(lVar1 + 0x17c),
         fVar6 = *(float *)(param_2 + 0x178) - *(float *)(lVar1 + 0x178),
         fVar5 = *(float *)(param_2 + 0x180) - *(float *)(lVar1 + 0x180),
         fVar7 * fVar7 + fVar6 * fVar6 + fVar5 * fVar5 < 160000.0)) &&
        (iVar3 = rand(), 0.3 <= (float)iVar3 * 3.0517578e-05)))) {
      switch(*(undefined4 *)(param_2 + 300)) {
      case 0x1c:
      case 0x1d:
      case 0x1f:
      case 0x20:
      case 0x21:
      case 0x22:
      case 0x23:
      case 0x24:
      case 0x2f:
      case 0x30:
      case 0x32:
      case 0x60:
      case 0x61:
        break;
      default:
        return 0x3f4ccccd;
      }
    }
  }
  return 0;
}



undefined8 FUN_140291390(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  longlong *plVar4;
  float fVar5;
  undefined4 local_res18 [4];
  float local_48;
  float local_44;
  float local_40;
  float local_38;
  float local_34;
  float local_30;
  
  plVar4 = *(longlong **)(param_3 + 0x30);
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar4 + 300));
  if (cVar2 == '\0') {
    plVar4 = (longlong *)(**(code **)(*plVar4 + 0xe0))(plVar4);
    iVar3 = (**(code **)(*plVar4 + 0x30))(plVar4);
    if ((iVar3 != 0) && (param_2 != 0)) {
      plVar4 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0x30) + 0xe0))();
      fVar5 = (float)(**(code **)(*plVar4 + 0x38))(plVar4);
      if ((double)fVar5 <= param_4 - *(double *)(param_1 + 0x10)) {
        iVar3 = rand();
        plVar4 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0x30) + 0xe0))();
        fVar5 = (float)(**(code **)(*plVar4 + 0x40))(plVar4);
        if (fVar5 <= (float)iVar3 * 3.0517578e-05) {
          *(double *)(param_1 + 0x10) = param_4;
          return 0;
        }
        lVar1 = *(longlong *)(param_3 + 0x30);
        local_40 = *(float *)(param_2 + 0x180) - *(float *)(lVar1 + 0x180);
        local_44 = *(float *)(param_2 + 0x17c) - *(float *)(lVar1 + 0x17c);
        local_48 = *(float *)(param_2 + 0x178) - *(float *)(lVar1 + 0x178);
        D3DXVec3Normalize(&local_48,&local_48);
        if ((DAT_140608010 & 1) == 0) {
          DAT_140608010 = DAT_140608010 | 1;
        }
        DAT_140608018._4_4_ = local_48 * 0.0 - local_40 * 0.0;
        DAT_140608018._0_4_ = local_40 - local_44 * 0.0;
        DAT_140608020 = local_44 * 0.0 - local_48;
        if ((DAT_1406081ac & 1) == 0) {
          DAT_1406081ac = DAT_1406081ac | 1;
        }
        D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
        lVar1 = *(longlong *)(param_3 + 0x30);
        local_res18[0] = 0;
        local_38 = -DAT_1406081b0 * 30.0 + *(float *)(lVar1 + 0x178);
        local_34 = -DAT_1406081b4 * 30.0 + *(float *)(lVar1 + 0x17c);
        local_30 = -DAT_1406081b8 * 30.0 + *(float *)(lVar1 + 0x180);
        iVar3 = FUN_1402f9640(lVar1,local_res18,&local_38,1,0);
        if (iVar3 == 1) {
          lVar1 = *(longlong *)(param_3 + 0x30);
          local_34 = *(float *)(param_2 + 0x17c) - *(float *)(lVar1 + 0x17c);
          local_38 = *(float *)(param_2 + 0x178) - *(float *)(lVar1 + 0x178);
          local_30 = *(float *)(param_2 + 0x180) - *(float *)(lVar1 + 0x180);
          fVar5 = *(float *)(*(longlong *)(lVar1 + 0x130) + 0x28c);
          cVar2 = FUN_140197780(&local_38,fVar5 * 0.2 + fVar5);
          if (cVar2 != '\0') {
            iVar3 = rand();
            if ((float)iVar3 * 3.0517578e-05 < 0.5) {
              return 0x3f35c28f;
            }
            return 0x3f3851ec;
          }
        }
        return 0;
      }
    }
  }
  return 0;
}



undefined8 FUN_1402916a0(longlong param_1,undefined8 param_2,longlong param_3,double param_4)

{
  longlong lVar1;
  char cVar2;
  longlong lVar3;
  double dVar4;
  
  lVar1 = *(longlong *)(param_3 + 0x30);
  dVar4 = param_4;
  cVar2 = FUN_14028f220(*(undefined4 *)(lVar1 + 300),param_2,param_3,param_2);
  if (cVar2 == '\0') {
    if (*(double *)(param_1 + 0x10) == 0.0) {
      *(double *)(param_1 + 0x10) = dVar4;
    }
    else if (*(double *)(lVar1 + 0x2330) <= dVar4 - *(double *)(param_1 + 0x10)) {
      if ((*(int *)(*(longlong *)(lVar1 + 0x2308) + 0x38) == 0) ||
         (lVar3 = FUN_14024bde0(lVar1,param_2), lVar3 == 0)) {
        *(double *)(param_1 + 0x10) = param_4;
      }
      else if (*(double *)(lVar1 + 0x2330) <= param_4 - *(double *)(param_1 + 0x10)) {
        return 0x40200000;
      }
    }
  }
  return 0;
}



undefined8 FUN_140291760(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  float *pfVar1;
  longlong lVar2;
  char cVar3;
  wchar_t *pwVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  float fVar10;
  
  uVar9 = (undefined4)((ulonglong)param_4 >> 0x20);
  uVar8 = SUB84(param_4,0);
  lVar2 = *(longlong *)(param_3 + 0x30);
  cVar3 = FUN_14028f220(*(undefined4 *)(lVar2 + 300));
  if ((cVar3 != '\0') || ((double)CONCAT44(uVar9,uVar8) - *(double *)(param_1 + 0x10) < 5.0)) {
    return 0;
  }
  if (param_2 != 0) {
    fVar7 = *(float *)(param_2 + 0x17c) - *(float *)(lVar2 + 0x17c);
    fVar6 = *(float *)(param_2 + 0x178) - *(float *)(lVar2 + 0x178);
    fVar5 = *(float *)(param_2 + 0x180) - *(float *)(lVar2 + 0x180);
    fVar10 = *(float *)(*(longlong *)(lVar2 + 0x22e8) + 0x18);
    if (fVar10 * fVar10 <= fVar7 * fVar7 + fVar6 * fVar6 + fVar5 * fVar5) {
      return 0;
    }
    fVar5 = *(float *)(param_2 + 0x180) - *(float *)(lVar2 + 0x180);
    fVar10 = *(float *)(param_2 + 0x178) - *(float *)(lVar2 + 0x178);
    fVar10 = atan2f(-*(float *)(lVar2 + 0x1350) * fVar10 - fVar5 * -*(float *)(lVar2 + 0x1348),
                    -*(float *)(lVar2 + 0x1350) * fVar5 + -*(float *)(lVar2 + 0x1348) * fVar10);
    fVar5 = (fVar10 * 180.0) / 3.1415927;
    fVar10 = ABS(fVar5);
    pfVar1 = (float *)(*(longlong *)(lVar2 + 0x22e8) + 0x14);
    if (*pfVar1 <= fVar10 && fVar10 != *pfVar1) {
      pwVar4 = L"lturn01";
      if (0.0 <= fVar5) {
        pwVar4 = L"rturn01";
      }
      FUN_140001710(lVar2 + 0x1680,pwVar4,7);
      return 0x3fc00000;
    }
  }
  fVar10 = 0.0;
  if (*(longlong *)(lVar2 + 0x2308) != 0) {
    fVar10 = *(float *)(*(longlong *)(lVar2 + 0x2308) + 0x4c);
  }
  if (param_4 - *(double *)(lVar2 + 0xb30) <
      (double)(*(float *)(*(longlong *)(lVar2 + 0x130) + 0x290) - fVar10)) {
    return 0x3fc00000;
  }
  return 0;
}



void FUN_140291940(longlong param_1,longlong param_2,longlong param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  
  plVar1 = *(longlong **)(param_3 + 0x30);
  cVar2 = FUN_14028f220(*(undefined4 *)((longlong)plVar1 + 300));
  if ((cVar2 == '\0') && (param_2 != 0)) {
    lVar4 = plVar1[0x461];
    if (((lVar4 != 0) &&
        (((plVar1[0x464] != 0 && (*(int *)(lVar4 + 0x3c) != 0)) && (*(int *)(lVar4 + 0x14) != 4))))
       && (((lVar4 = FUN_140341860(), lVar4 != 0 &&
            (iVar3 = (**(code **)(*plVar1 + 0x478))(plVar1), iVar3 != 0x4a)) &&
           (*(double *)(param_1 + 0x10) == 0.0)))) {
      *(undefined8 *)(param_1 + 0x10) = param_4;
    }
  }
  return;
}



undefined8 FUN_140291a80(longlong param_1,longlong param_2,longlong param_3)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  plVar1 = *(longlong **)(param_3 + 0x30);
  cVar2 = FUN_14028f220(*(undefined4 *)((longlong)plVar1 + 300));
  if (cVar2 == '\0') {
    iVar3 = (**(code **)(*plVar1 + 0x478))(plVar1);
    if (iVar3 == 0x4e) {
      return 0x40400000;
    }
    if (plVar1[0x461] == 0) {
      return 0;
    }
    if (*(int *)(plVar1[0x461] + 0x18) != 2) {
      return 0;
    }
    iVar3 = (**(code **)(*plVar1 + 1000))(plVar1,plVar1);
    if (iVar3 == 0) {
      *(undefined1 *)(param_1 + 0x11) = 0;
    }
    else {
      (**(code **)(*plVar1 + 0x120))(plVar1,iVar3);
      cVar2 = (**(code **)(*plVar1 + 0x1e0))(plVar1);
      if (cVar2 != '\0') {
        *(undefined1 *)(param_1 + 0x11) = 1;
        return 0x40200000;
      }
    }
    if ((param_2 != 0) &&
       (fVar6 = *(float *)(param_2 + 0x178) - *(float *)(plVar1 + 0x2f),
       fVar4 = *(float *)(param_2 + 0x17c) - *(float *)((longlong)plVar1 + 0x17c),
       fVar5 = *(float *)(param_2 + 0x180) - *(float *)(plVar1 + 0x30),
       fVar6 * fVar6 + fVar4 * fVar4 + fVar5 * fVar5 <
       *(float *)(plVar1[0x45d] + 0x20) * *(float *)(plVar1[0x45d] + 0x20))) {
      return 0x40200000;
    }
  }
  return 0;
}



undefined8 FUN_140291bc0(undefined8 param_1,undefined8 param_2,longlong param_3)

{
  char cVar1;
  longlong *plVar2;
  
  plVar2 = *(longlong **)(param_3 + 0x30);
  cVar1 = FUN_14028f220(*(undefined4 *)((longlong)plVar2 + 300));
  if (cVar1 == '\0') {
    cVar1 = (**(code **)(*plVar2 + 0x3f8))(plVar2);
    if (cVar1 != '\0') {
      return 0x40600000;
    }
  }
  return 0;
}



undefined8 FUN_140291c00(undefined8 param_1,undefined8 param_2,longlong param_3)

{
  if (*(char *)(param_3 + 0x40) == '\x01') {
    return 0x3fb33333;
  }
  return 0;
}



undefined8 * FUN_140291c20(undefined8 *param_1)

{
  LPCRITICAL_SECTION p_Var1;
  LPCRITICAL_SECTION lpCriticalSection;
  
  *param_1 = MBISingleton<>::vftable;
  param_1[1] = MBMultiThreadSync<>::vftable;
  p_Var1 = DAT_140608240;
  if ((DAT_140608240 == (LPCRITICAL_SECTION)0x0) &&
     (lpCriticalSection = operator_new(0x28), p_Var1 = (LPCRITICAL_SECTION)0x0,
     lpCriticalSection != (LPCRITICAL_SECTION)0x0)) {
    InitializeCriticalSection(lpCriticalSection);
    p_Var1 = lpCriticalSection;
  }
  DAT_140608240 = p_Var1;
  *param_1 = MagiTable::TableManager::vftable;
  param_1[1] = MagiTable::TableManager::vftable;
  param_1[2] = MagiTable::TableManager::vftable;
  FUN_1402ca220(param_1 + 3);
  FUN_1402ca220(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_140291d10(void *param_1,uint param_2)

{
  FUN_140291d40();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140291d40(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_140295440(param_1 + 3);
  FUN_140167bf0(param_1 + 0xb);
  if (param_1[0x19] != 0) {
    FUN_140295c00(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_140295c00(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_140167cd0(param_1 + 0xb);
  }
  if (param_1[3] != 0) {
    FUN_140295760(param_1 + 3);
  }
  param_1[1] = MBMultiThreadSync<>::vftable;
  p_Var1 = DAT_140608240;
  if (DAT_140608240 != (LPCRITICAL_SECTION)0x0) {
    DeleteCriticalSection(DAT_140608240);
    operator_delete(p_Var1);
  }
  DAT_140608240 = (LPCRITICAL_SECTION)0x0;
  *param_1 = MBISingleton<>::vftable;
  DAT_140607ff0 = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140291e90(longlong param_1)

{
  int *piVar1;
  ushort *puVar2;
  short sVar3;
  undefined4 uVar4;
  void *pvVar5;
  undefined8 *puVar6;
  uint uVar7;
  undefined4 uVar8;
  short *psVar10;
  void **_Src;
  int iVar11;
  ulonglong uVar12;
  ushort *puVar13;
  longlong *plVar14;
  undefined4 *puVar15;
  undefined8 uVar16;
  ushort *puVar17;
  undefined4 *puVar18;
  longlong lVar19;
  short *psVar20;
  undefined4 *puVar21;
  bool bVar22;
  undefined1 auStack_178 [32];
  undefined1 local_158;
  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 *puVar9;
  
  local_138[1] = 0xfffffffffffffffe;
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_178;
  EnterCriticalSection(DAT_140608240);
  FUN_140292360(&local_148,L"table\\TableList.rh");
  FUN_140295020(param_1 + 0x98,&local_148);
  puVar15 = (undefined4 *)0x0;
  puVar21 = puVar15;
  if (local_148 != (undefined8 *)0x0) {
    if (local_148 == local_140) {
      puVar21 = (undefined4 *)*local_148;
    }
    else {
      iVar11 = DAT_140608200 + 1;
      bVar22 = DAT_140608200 == 0;
      DAT_140608200 = iVar11;
      if (bVar22) {
        FUN_140176d60(1);
      }
    }
  }
  if ((*(longlong *)(puVar21 + 0x1c) != 0) && (puVar21[0x1e] != 0)) {
    puVar9 = puVar15;
    plVar14 = *(longlong **)(puVar21 + 0x1a);
    do {
      if (*plVar14 != 0) {
        puVar15 = (undefined4 *)(*(longlong **)(puVar21 + 0x1a))[(longlong)puVar9];
        break;
      }
      uVar7 = (int)puVar9 + 1;
      puVar9 = (undefined4 *)(ulonglong)uVar7;
      plVar14 = plVar14 + 1;
    } while (uVar7 < (uint)puVar21[0x1e]);
  }
  do {
    puVar9 = puVar15;
    puVar6 = local_148;
    uVar16 = 0;
    local_128 = puVar9;
    if (puVar9 == (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;
              pvVar5 = (void *)*puVar6;
              if (pvVar5 != (void *)0x0) {
                FUN_140296560(pvVar5);
                operator_delete(pvVar5);
              }
              operator_delete(puVar6);
            }
          }
        }
        else {
          iVar11 = DAT_140608204 + 1;
          bVar22 = DAT_140608204 == 0;
          DAT_140608204 = iVar11;
          if (bVar22) {
            FUN_140176d60(1);
          }
        }
      }
      LeaveCriticalSection(DAT_140608240);
      return;
    }
    uVar4 = *puVar9;
    if (local_148 != (undefined8 *)0x0) {
      if (local_148 == local_140) {
        uVar16 = *local_148;
      }
      else {
        iVar11 = DAT_140608200 + 1;
        bVar22 = DAT_140608200 == 0;
        DAT_140608200 = iVar11;
        if (bVar22) {
          FUN_140176d60(1);
        }
      }
    }
    uVar8 = FUN_1402970c0(uVar16,L"szName");
    local_158 = 1;
    psVar10 = (short *)FUN_140296990(uVar16,uVar4,uVar8,L"szName");
    if (local_148 == (undefined8 *)0x0) {
LAB_14029201a:
      uVar16 = 0;
    }
    else {
      if (local_148 != local_140) {
        iVar11 = DAT_140608200 + 1;
        bVar22 = DAT_140608200 == 0;
        DAT_140608200 = iVar11;
        if (bVar22) {
          FUN_140176d60(1);
        }
        goto LAB_14029201a;
      }
      uVar16 = *local_148;
    }
    uVar8 = FUN_1402970c0(uVar16,L"szTableFile");
    local_158 = 1;
    local_138[0] = FUN_140296990(uVar16,uVar4,uVar8,L"szTableFile");
    if (*(char *)(param_1 + 0xb9) == '\0') {
      if ((psVar10 != (short *)0x0) && (local_138[0] != 0)) {
        FUN_140292e80(param_1,psVar10,local_138[0]);
      }
    }
    else {
      local_d0 = 7;
      local_d8 = 0;
      local_e8 = 0;
      uVar12 = 0xffffffffffffffff;
      psVar20 = psVar10;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar3 = *psVar20;
        psVar20 = psVar20 + 1;
      } while (sVar3 != 0);
      FUN_140001710(&local_e8,psVar10,~uVar12 - 1);
      puVar13 = &local_e8;
      if (7 < local_d0) {
        puVar13 = (ushort *)CONCAT62(uStack_e6,local_e8);
      }
      puVar2 = puVar13 + local_d8;
      puVar17 = &local_e8;
      if (7 < local_d0) {
        puVar17 = (ushort *)CONCAT62(uStack_e6,local_e8);
      }
      if (puVar17 != puVar2) {
        lVar19 = (longlong)puVar13 - (longlong)puVar17;
        do {
          iVar11 = tolower((uint)*puVar17);
          *(short *)(lVar19 + (longlong)puVar17) = (short)iVar11;
          puVar17 = puVar17 + 1;
        } while (puVar17 != puVar2);
      }
      _Src = (void **)FUN_140295300(&local_68,&local_e8,local_138);
      local_a0 = (void *)0x7;
      local_a8 = (void *)0x0;
      uVar12 = (ulonglong)local_b8[0] >> 0x10;
      local_b8[0] = (void *)(uVar12 << 0x10);
      if (local_b8 != _Src) {
        local_a0 = (void *)0x7;
        local_a8 = (void *)0x0;
        local_b8[0] = (void *)(uVar12 << 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;
      uVar12 = 0xffffffffffffffff;
      psVar10 = _Src[5];
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar3 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar3 != 0);
      FUN_140001710(&local_90,_Src[5],~uVar12 - 1);
      if (*(longlong *)(param_1 + 0x78) == 0) {
        FUN_140167ec0(param_1 + 0x58,local_100,local_b8);
      }
      else {
        FUN_140167da0();
      }
      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;
    }
    puVar18 = (undefined4 *)0x0;
    puVar15 = *(undefined4 **)(puVar9 + 6);
    if (*(undefined4 **)(puVar9 + 6) == (undefined4 *)0x0) {
      uVar7 = (uint)puVar9[8] % (uint)puVar21[0x1e] + 1;
      lVar19 = (longlong)(int)uVar7 << 3;
      do {
        puVar15 = puVar18;
        if ((uint)puVar21[0x1e] <= uVar7) break;
        if (*(longlong *)(lVar19 + *(longlong *)(puVar21 + 0x1a)) != 0) {
          puVar18 = *(undefined4 **)(lVar19 + *(longlong *)(puVar21 + 0x1a));
        }
        uVar7 = uVar7 + 1;
        lVar19 = lVar19 + 8;
        puVar15 = puVar18;
      } while (puVar18 == (undefined4 *)0x0);
    }
  } while( true );
}



void FUN_140292350(longlong param_1)

{
  FUN_140295170(param_1 + 8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140292360(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_1405d84f0 ^ (ulonglong)auStack_db8;
  local_d98 = 0;
  local_d10 = param_1;
  EnterCriticalSection(DAT_140608240);
  local_d70 = (ulonglong *)0x0;
  pvVar4 = operator_new(0xb0);
  if ((pvVar4 == (void *)0x0) || (uVar5 = FUN_140296460(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_140297580(local_ce8,&local_d08);
  local_d80 = 0;
  local_d90 = MagiFileStream::vftable;
  local_d78 = (FILE *)0x0;
  local_d88 = 0;
  if (DAT_140607be1 == '\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_140418da0(DAT_140607fd8,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_140168350(&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_140296560(pvVar4);
            operator_delete(pvVar4);
          }
          operator_delete(puVar1);
        }
      }
      goto LAB_140292e3b;
    }
  }
  else {
    local_d28 = (undefined ***)(**(code **)(*DAT_140606108 + 8))();
    if ((local_d28 == (undefined ***)0x0) &&
       (local_d28 = (undefined ***)(**(code **)(*DAT_140606100 + 8))(DAT_140606100,param_2),
       local_d28 == (undefined ***)0x0)) {
      FUN_140418da0(DAT_140607fd8,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_140168350(&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_140296560(pvVar4);
            operator_delete(pvVar4);
          }
          operator_delete(puVar1);
        }
      }
      goto LAB_140292e3b;
    }
  }
  cVar3 = FUN_1402973d0(&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_140168350(&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_140296560(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_1402981e0(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_140293860(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_140168350(&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_140296560(pvVar4);
                operator_delete(pvVar4);
              }
              operator_delete(puVar1);
            }
          }
        }
        else {
          uVar5 = uVar11;
          if (puVar9 != (ulonglong *)0x0) {
            uVar5 = *puVar9;
          }
          cVar3 = FUN_140293b30(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_140168350(&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_140296560(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_140293c40(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_140168350(&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_140296560(pvVar4);
                        operator_delete(pvVar4);
                      }
                      operator_delete(puVar1);
                    }
                  }
                  goto LAB_140292e3b;
                }
                uVar8 = (int)uVar5 + 1;
                uVar5 = (ulonglong)uVar8;
              } while ((int)uVar8 < iVar7);
            }
            if (DAT_140607be1 != '\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_140168350(&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_140296560(pvVar4);
                  operator_delete(pvVar4);
                }
                operator_delete(puVar1);
              }
            }
          }
        }
        goto LAB_140292e3b;
      }
    }
    *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_140168350(&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_140296560(pvVar4);
          operator_delete(pvVar4);
        }
        operator_delete(puVar1);
      }
    }
  }
LAB_140292e3b:
  LeaveCriticalSection(DAT_140608240);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140292e80(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_1405d84f0 ^ (ulonglong)auStack_1a8;
  EnterCriticalSection(DAT_140608240);
  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_140001710(&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_140001710(&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_1402cb0b0(*(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_140001710(&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_140292360(&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_140608200 + 1;
        bVar16 = DAT_140608200 == 0;
        DAT_140608200 = iVar7;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    uVar9 = 0xffffffffffffffff;
    puVar11 = puVar10;
    do {
      if (uVar9 == 0) break;
      uVar9 = uVar9 - 1;
      uVar4 = *puVar11;
      puVar11 = puVar11 + 1;
    } while (uVar4 != 0);
    FUN_140001710(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_140001710(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_140295a70(param_1 + 0x18,local_160,local_80);
    }
    else {
      FUN_140295910(param_1 + 0x18,local_148,local_80,local_80);
    }
    FUN_140249180(&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_140249180(&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_140296560(pvVar5);
              operator_delete(pvVar5);
            }
            operator_delete(puVar6);
          }
        }
      }
      else {
        iVar7 = DAT_140608204 + 1;
        bVar16 = DAT_140608204 == 0;
        DAT_140608204 = iVar7;
        if (bVar16) {
          FUN_140176d60(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_140608240);
    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_140608240);
    uVar8 = 0;
  }
  return uVar8;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1402933b0(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_1405d84f0 ^ (ulonglong)auStack_d8;
  EnterCriticalSection(DAT_140608240);
  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_140001710(&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_1402935e2;
  if (*(longlong *)(param_1 + 0x78) == 0) {
LAB_14029353e:
    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_1402cb0b0(plVar1,&local_a0);
    puVar12 = (ushort *)CONCAT62(uStack_9e,local_a0);
    local_b8 = plVar1;
    if (plStack_b0 == (longlong *)0x0) goto LAB_14029353e;
  }
  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_140292e80(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_140168010();
    if ((plVar1 == *(longlong **)(param_1 + 0x88)) && (*plVar1 == 0)) {
      *(longlong **)(param_1 + 0x88) = plVar16;
    }
    puVar12 = (ushort *)CONCAT62(uStack_9e,local_a0);
  }
LAB_1402935e2:
  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_140001710(&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_1402cb0b0(*(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_140418da0(DAT_140607fd8,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_140608240);
    uVar10 = 0;
  }
  else {
    puVar5 = *(ulonglong **)(uVar11 + 0x30);
    if (puVar5 != (ulonglong *)0x0) {
      if (puVar5 == *(ulonglong **)(uVar11 + 0x38)) {
        uVar10 = *puVar5;
      }
      else {
        iVar8 = DAT_140608200 + 1;
        bVar18 = DAT_140608200 == 0;
        DAT_140608200 = iVar8;
        if (bVar18) {
          FUN_140176d60(1);
        }
      }
    }
    if (7 < local_88) {
      operator_delete((void *)CONCAT62(uStack_9e,local_a0));
    }
    local_88 = 7;
    local_90 = 0;
    local_a0 = 0;
    LeaveCriticalSection(DAT_140608240);
  }
  return uVar10;
}



undefined8 FUN_1402937b0(undefined8 *param_1,longlong *param_2)

{
  ulonglong uVar1;
  char cVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  ushort local_res8 [4];
  undefined2 local_res10 [4];
  
  (**(code **)(*param_2 + 8))(param_2,local_res8,2);
  uVar5 = (ulonglong)local_res8[0];
  uVar1 = param_1[2];
  uVar4 = (ulonglong)(int)(local_res8[0] + 1);
  if (((uVar1 <= uVar4) && (param_1[3] != uVar4)) &&
     (cVar2 = FUN_140001910(param_1,uVar4,1), cVar2 != '\0')) {
    param_1[2] = uVar1;
    puVar3 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar3 = (undefined8 *)*param_1;
    }
    *(undefined2 *)((longlong)puVar3 + uVar1 * 2) = 0;
  }
  if (local_res8[0] != 0) {
    do {
      (**(code **)(*param_2 + 8))(param_2,local_res10,2);
      FUN_140123f40(param_1,1,local_res10[0]);
      uVar5 = uVar5 - 1;
    } while (uVar5 != 0);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140293860(int param_1,longlong param_2,longlong *param_3)

{
  ulonglong uVar1;
  code *pcVar2;
  void *_Src;
  ushort uVar3;
  undefined2 uVar4;
  undefined2 *puVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  int iVar8;
  ulonglong uVar9;
  int iVar10;
  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_1405d84f0 ^ (ulonglong)auStack_a8;
  local_50 = 7;
  iVar10 = 0;
  local_58 = 0;
  local_68 = 0;
  local_78 = param_2 + 0x28;
  local_80 = param_1;
  FUN_140123dc0(local_78);
  if (0 < param_1) {
    do {
      (**(code **)(*param_3 + 8))(param_3,local_88,2);
      uVar1 = local_58;
      uVar3 = local_88[0];
      uVar7 = (ulonglong)(int)(local_88[0] + 1);
      if ((local_58 <= uVar7) && (local_50 != uVar7)) {
        if (0x7ffffffffffffffe < uVar7) {
          std::_Xlength_error("string too long");
          pcVar2 = (code *)swi(3);
          uVar6 = (*pcVar2)();
          return uVar6;
        }
        if (local_50 < uVar7) {
          FUN_1400019f0(&local_68,uVar7,local_58);
        }
        else if (uVar7 < 8) {
          uVar9 = local_58;
          if (uVar7 < local_58) {
            uVar9 = uVar7;
          }
          if (7 < local_50) {
            _Src = (void *)CONCAT62(uStack_66,local_68);
            if (uVar9 != 0) {
              memcpy(&local_68,_Src,uVar9 * 2);
            }
            operator_delete(_Src);
            param_1 = local_80;
          }
          local_50 = 7;
          local_58 = uVar9;
          (&local_68)[uVar9] = 0;
        }
        else if (uVar7 == 0) {
          local_58 = 0;
          puVar5 = &local_68;
          if (7 < local_50) {
            puVar5 = (undefined2 *)CONCAT62(uStack_66,local_68);
          }
          *puVar5 = 0;
        }
        if (uVar7 != 0) {
          puVar5 = &local_68;
          if (7 < local_50) {
            puVar5 = (undefined2 *)CONCAT62(uStack_66,local_68);
          }
          local_58 = uVar1;
          puVar5[uVar1] = 0;
        }
      }
      iVar8 = 0;
      if (uVar3 != 0) {
        do {
          (**(code **)(*param_3 + 8))(param_3,local_84);
          uVar4 = local_84[0];
          if (-local_58 - 1 < 2) {
            std::_Xlength_error("string too long");
            goto LAB_140293af5;
          }
          uVar1 = local_58 + 1;
          if (0x7ffffffffffffffe < uVar1) {
            std::_Xlength_error("string too long");
            pcVar2 = (code *)swi(3);
            uVar6 = (*pcVar2)();
            return uVar6;
          }
          if (local_50 < uVar1) {
            FUN_1400019f0(&local_68,uVar1);
          }
          else if (uVar1 == 0) {
            local_58 = 0;
            puVar5 = &local_68;
            if (7 < local_50) {
              puVar5 = (undefined2 *)CONCAT62(uStack_66,local_68);
            }
            *puVar5 = 0;
          }
          if (uVar1 != 0) {
            puVar5 = &local_68;
            if (7 < local_50) {
              puVar5 = (undefined2 *)CONCAT62(uStack_66,local_68);
            }
            puVar5[local_58] = uVar4;
            puVar5 = &local_68;
            if (7 < local_50) {
              puVar5 = (undefined2 *)CONCAT62(uStack_66,local_68);
            }
            local_58 = uVar1;
            puVar5[uVar1] = 0;
          }
          iVar8 = iVar8 + 1;
        } while (iVar8 < (int)(uint)uVar3);
      }
      FUN_14008ec00(local_78,&local_68);
      FUN_140001710(&local_68,&DAT_140477960,0);
      iVar10 = iVar10 + 1;
    } while (iVar10 < param_1);
  }
LAB_140293af5:
  if (7 < local_50) {
    operator_delete((void *)CONCAT62(uStack_66,local_68));
  }
  return 1;
}



undefined8 FUN_140293b30(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_1400556a0(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_1400556a0(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_140293c40(int param_1,ulonglong *param_2,longlong *param_3)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  short sVar3;
  undefined8 *puVar4;
  void **ppvVar5;
  void **ppvVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  code *pcVar9;
  undefined1 auVar10 [16];
  undefined1 auVar11 [16];
  ushort uVar12;
  ushort uVar13;
  ulonglong *puVar14;
  char cVar15;
  undefined8 *puVar16;
  __uint64 _Var17;
  void *pvVar18;
  ulonglong *puVar19;
  short *psVar20;
  ulonglong uVar21;
  int *piVar22;
  undefined8 uVar23;
  short *psVar24;
  int *piVar25;
  longlong lVar26;
  longlong lVar27;
  ulonglong *puVar28;
  ulonglong uVar29;
  uint uVar30;
  int iVar31;
  int *piVar32;
  undefined1 auStack_148 [32];
  int local_128;
  undefined4 local_124;
  int local_120;
  int local_11c;
  ushort local_118 [2];
  int local_114;
  int local_110;
  ushort local_10c [2];
  int local_108;
  longlong *local_100;
  undefined8 local_f8;
  ulonglong *local_f0;
  void *local_e8;
  void *local_e0;
  ulonglong *local_d8;
  ulonglong *local_d0;
  longlong local_c8;
  longlong local_c0;
  undefined4 local_b8;
  ulonglong *local_b0;
  ulonglong *local_a8;
  undefined8 local_a0;
  short local_98;
  undefined6 uStack_96;
  ulonglong *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_1405d84f0 ^ (ulonglong)auStack_148;
  uVar29 = 0;
  local_d8 = (ulonglong *)0x0;
  local_100 = param_3;
  local_f0 = param_2;
  puVar16 = operator_new(0xa0);
  if (puVar16 == (undefined8 *)0x0) {
    local_d8 = (ulonglong *)0x0;
  }
  else {
    *puVar16 = 0;
    puVar16[1] = 0;
    puVar16[2] = 0;
    puVar16[4] = 0;
    puVar16[5] = 0;
    puVar16[6] = 0;
    puVar16[8] = 0;
    puVar16[9] = 0;
    puVar16[10] = 0;
    puVar16[0xc] = 0;
    puVar16[0xd] = 0;
    puVar16[0xe] = 0;
    puVar16[0x10] = 0;
    puVar16[0x11] = 0;
    puVar16[0x12] = 0;
    local_d8 = operator_new(0x10);
    *local_d8 = (ulonglong)puVar16;
    *(undefined4 *)(local_d8 + 1) = 1;
  }
  puVar2 = local_d8;
  local_108 = 0;
  local_c8 = 0;
  local_d0 = local_d8;
  local_c0 = (longlong)param_1;
  if (0 < param_1) {
    do {
      puVar28 = (ulonglong *)0x0;
      iVar31 = *(int *)(param_2[9] + local_c8 * 4);
      if (iVar31 == 0) {
        (**(code **)(*param_3 + 8))(param_3,&local_128,4);
        if (puVar2 != (ulonglong *)0x0) {
          puVar28 = (ulonglong *)*puVar2;
        }
        piVar22 = (int *)puVar28[0x11];
        if ((&local_128 < piVar22) && (piVar25 = (int *)puVar28[0x10], piVar25 <= &local_128)) {
          piVar32 = &local_128;
LAB_140294485:
          if (piVar22 == (int *)puVar28[0x12]) {
            FUN_1400556a0(puVar28 + 0x10,1);
          }
          piVar22 = (int *)puVar28[0x11];
          if (piVar22 != (int *)0x0) {
            iVar31 = *(int *)(puVar28[0x10] + ((longlong)piVar32 - (longlong)piVar25 >> 2) * 4);
LAB_1402944bc:
            *piVar22 = iVar31;
          }
        }
        else {
          if (piVar22 == (int *)puVar28[0x12]) {
            FUN_1400556a0(puVar28 + 0x10,1);
          }
          piVar22 = (int *)puVar28[0x11];
          iVar31 = local_128;
          if (piVar22 != (int *)0x0) goto LAB_1402944bc;
        }
        puVar28[0x11] = puVar28[0x11] + 4;
      }
      else if (iVar31 == 1) {
        (**(code **)(*param_3 + 8))(param_3,&local_124,4);
        puVar19 = puVar28;
        if (puVar2 != (ulonglong *)0x0) {
          puVar19 = (ulonglong *)*puVar2;
        }
        puVar7 = (undefined4 *)puVar19[0xd];
        if ((&local_124 < puVar7) && (puVar8 = (undefined4 *)puVar19[0xc], puVar8 <= &local_124)) {
          if (puVar7 == (undefined4 *)puVar19[0xe]) {
            FUN_14008f490(puVar19 + 0xc,1);
          }
          if ((undefined4 *)puVar19[0xd] != (undefined4 *)0x0) {
            *(undefined4 *)puVar19[0xd] =
                 *(undefined4 *)(puVar19[0xc] + ((longlong)&local_124 - (longlong)puVar8 >> 2) * 4);
          }
        }
        else {
          if (puVar7 == (undefined4 *)puVar19[0xe]) {
            FUN_14008f490(puVar19 + 0xc,1);
          }
          if ((undefined4 *)puVar19[0xd] != (undefined4 *)0x0) {
            *(undefined4 *)puVar19[0xd] = local_124;
          }
        }
        puVar19[0xd] = puVar19[0xd] + 4;
        puVar19 = puVar28;
        if (puVar2 != (ulonglong *)0x0) {
          puVar19 = (ulonglong *)*puVar2;
        }
        iVar31 = (int)((longlong)(puVar19[0xd] - puVar19[0xc]) >> 2) + -1;
        if (puVar2 != (ulonglong *)0x0) {
          puVar28 = (ulonglong *)*puVar2;
        }
        piVar22 = (int *)puVar28[0x11];
        local_114 = iVar31;
        if ((&local_114 < piVar22) && (piVar25 = (int *)puVar28[0x10], piVar25 <= &local_114)) {
          piVar32 = &local_114;
          goto LAB_140294485;
        }
LAB_140294407:
        if (piVar22 == (int *)puVar28[0x12]) {
          FUN_1400556a0(puVar28 + 0x10,1);
        }
        if ((int *)puVar28[0x11] != (int *)0x0) {
          *(int *)puVar28[0x11] = iVar31;
        }
        puVar28[0x11] = puVar28[0x11] + 4;
      }
      else {
        if (iVar31 == 2) {
          param_2 = (ulonglong *)0x7;
          local_80 = (ulonglong *)0x7;
          local_88 = (ulonglong *)0x0;
          local_98 = 0;
          (**(code **)(*param_3 + 8))(param_3,local_10c,2);
          uVar13 = local_10c[0];
          puVar19 = puVar28;
          if ((local_10c[0] + 1 != 7) &&
             (cVar15 = FUN_140001910(&local_98,local_10c[0] + 1,1), puVar19 = local_88,
             param_2 = local_80, cVar15 != '\0')) {
            local_88 = (ulonglong *)0x0;
            psVar20 = &local_98;
            if ((ulonglong *)0x7 < local_80) {
              psVar20 = (short *)CONCAT62(uStack_96,local_98);
            }
            *psVar20 = 0;
            puVar19 = local_88;
            param_2 = local_80;
          }
          if (uVar13 != 0) {
            do {
              (**(code **)(*local_100 + 8))(local_100,local_118,2);
              uVar12 = local_118[0];
              uVar29 = (ulonglong)local_118[0];
              if (-(longlong)puVar19 - 1U < 2) {
                std::_Xlength_error("string too long");
                goto LAB_14029453e;
              }
              puVar1 = (ulonglong *)((longlong)puVar19 + 1);
              if ((ulonglong *)0x7ffffffffffffffe < puVar1) {
                std::_Xlength_error("string too long");
                pcVar9 = (code *)swi(3);
                uVar23 = (*pcVar9)();
                return uVar23;
              }
              if (param_2 < puVar1) {
                FUN_1400019f0(&local_98,puVar1,puVar19);
                puVar19 = local_88;
                param_2 = local_80;
              }
              else if (puVar1 == (ulonglong *)0x0) {
                local_88 = (ulonglong *)0x0;
                psVar20 = &local_98;
                if ((ulonglong *)0x7 < param_2) {
                  psVar20 = (short *)CONCAT62(uStack_96,local_98);
                }
                *psVar20 = 0;
                puVar19 = local_88;
                param_2 = local_80;
              }
              if (puVar1 != (ulonglong *)0x0) {
                psVar20 = &local_98;
                if ((ulonglong *)0x7 < param_2) {
                  psVar20 = (short *)CONCAT62(uStack_96,local_98);
                }
                psVar20[(longlong)puVar19] = uVar12;
                psVar20 = &local_98;
                if ((ulonglong *)0x7 < local_80) {
                  psVar20 = (short *)CONCAT62(uStack_96,local_98);
                }
                local_88 = puVar1;
                psVar20[(longlong)puVar1] = 0;
                puVar19 = local_88;
                param_2 = local_80;
              }
              uVar30 = (int)puVar28 + 1;
              puVar28 = (ulonglong *)(ulonglong)uVar30;
            } while ((int)uVar30 < (int)(uint)uVar13);
          }
          uVar29 = 0;
          auVar11._8_8_ = 0;
          auVar11._0_8_ = (longlong)puVar19 + 1;
          _Var17 = SUB168(ZEXT816(2) * auVar11,0);
          if (SUB168(ZEXT816(2) * auVar11,8) != 0) {
            _Var17 = 0xffffffffffffffff;
          }
          pvVar18 = operator_new(_Var17);
          psVar20 = (short *)CONCAT62(uStack_96,local_98);
          puVar14 = local_f0;
          local_e8 = pvVar18;
          puVar1 = param_2;
          if (pvVar18 != (void *)0x0) {
            psVar24 = &local_98;
            if ((ulonglong *)0x7 < param_2) {
              psVar24 = psVar20;
            }
            lVar27 = (longlong)pvVar18 - (longlong)psVar24;
            do {
              sVar3 = *psVar24;
              *(short *)(lVar27 + (longlong)psVar24) = sVar3;
              psVar24 = psVar24 + 1;
            } while (sVar3 != 0);
            *(undefined2 *)((longlong)pvVar18 + (longlong)puVar19 * 2) = 0;
            uVar21 = uVar29;
            if (puVar2 != (ulonglong *)0x0) {
              uVar21 = *puVar2;
            }
            ppvVar5 = *(void ***)(uVar21 + 0x48);
            if ((&local_e8 < ppvVar5) &&
               (ppvVar6 = *(void ***)(uVar21 + 0x40), ppvVar6 <= &local_e8)) {
              if (ppvVar5 == *(void ***)(uVar21 + 0x50)) {
                FUN_140195b20(uVar21 + 0x40);
              }
              if (*(undefined8 **)(uVar21 + 0x48) != (undefined8 *)0x0) {
                **(undefined8 **)(uVar21 + 0x48) =
                     *(undefined8 *)
                      (*(longlong *)(uVar21 + 0x40) +
                      ((longlong)&local_e8 - (longlong)ppvVar6 >> 3) * 8);
              }
            }
            else {
              if (ppvVar5 == *(void ***)(uVar21 + 0x50)) {
                FUN_140195b20(uVar21 + 0x40);
              }
              if (*(undefined8 **)(uVar21 + 0x48) != (undefined8 *)0x0) {
                **(undefined8 **)(uVar21 + 0x48) = pvVar18;
              }
            }
            *(longlong *)(uVar21 + 0x48) = *(longlong *)(uVar21 + 0x48) + 8;
            uVar21 = uVar29;
            if (puVar2 != (ulonglong *)0x0) {
              uVar21 = *puVar2;
            }
            iVar31 = (int)(*(longlong *)(uVar21 + 0x48) - *(longlong *)(uVar21 + 0x40) >> 3) + -1;
            if (puVar2 != (ulonglong *)0x0) {
              uVar29 = *puVar2;
            }
            piVar22 = *(int **)(uVar29 + 0x88);
            local_11c = iVar31;
            if ((&local_11c < piVar22) &&
               (piVar25 = *(int **)(uVar29 + 0x80), piVar25 <= &local_11c)) {
              if (piVar22 == *(int **)(uVar29 + 0x90)) {
                FUN_1400556a0(uVar29 + 0x80,1);
              }
              if (*(undefined4 **)(uVar29 + 0x88) != (undefined4 *)0x0) {
                **(undefined4 **)(uVar29 + 0x88) =
                     *(undefined4 *)
                      (*(longlong *)(uVar29 + 0x80) +
                      ((longlong)local_118 + (-4 - (longlong)piVar25) >> 2) * 4);
              }
            }
            else {
              if (piVar22 == *(int **)(uVar29 + 0x90)) {
                FUN_1400556a0(uVar29 + 0x80,1);
              }
              if (*(int **)(uVar29 + 0x88) != (int *)0x0) {
                **(int **)(uVar29 + 0x88) = iVar31;
              }
            }
            *(longlong *)(uVar29 + 0x88) = *(longlong *)(uVar29 + 0x88) + 4;
            puVar14 = local_f0;
          }
        }
        else {
          if (iVar31 != 3) {
            if (iVar31 == 4) {
              (**(code **)(*param_3 + 8))(param_3,&local_f8,8);
              puVar19 = puVar28;
              if (puVar2 != (ulonglong *)0x0) {
                puVar19 = (ulonglong *)*puVar2;
              }
              puVar16 = (undefined8 *)puVar19[1];
              if ((&local_f8 < puVar16) && (puVar4 = (undefined8 *)*puVar19, puVar4 <= &local_f8)) {
                if (puVar16 == (undefined8 *)puVar19[2]) {
                  FUN_140195b20(puVar19);
                }
                puVar16 = (undefined8 *)puVar19[1];
                if (puVar16 != (undefined8 *)0x0) {
                  uVar23 = *(undefined8 *)
                            (*puVar19 + ((longlong)&local_f8 - (longlong)puVar4 >> 3) * 8);
LAB_140293de2:
                  *puVar16 = uVar23;
                }
              }
              else {
                if (puVar16 == (undefined8 *)puVar19[2]) {
                  FUN_140195b20(puVar19);
                }
                puVar16 = (undefined8 *)puVar19[1];
                uVar23 = local_f8;
                if (puVar16 != (undefined8 *)0x0) goto LAB_140293de2;
              }
              puVar19[1] = puVar19[1] + 8;
              puVar19 = puVar28;
              if (puVar2 != (ulonglong *)0x0) {
                puVar19 = (ulonglong *)*puVar2;
              }
              iVar31 = (int)((longlong)(puVar19[1] - *puVar19) >> 3) + -1;
              if (puVar2 != (ulonglong *)0x0) {
                puVar28 = (ulonglong *)*puVar2;
              }
              piVar22 = (int *)puVar28[0x11];
              local_120 = iVar31;
              if ((&local_120 < piVar22) && (piVar25 = (int *)puVar28[0x10], piVar25 <= &local_120))
              {
                piVar32 = &local_120;
                goto LAB_140294485;
              }
              goto LAB_140294407;
            }
            goto LAB_140294504;
          }
          local_58 = (ulonglong *)0x7;
          local_60 = 0;
          local_70 = 0;
          FUN_1402937b0(&local_70,param_3);
          lVar27 = local_60;
          auVar10._8_8_ = 0;
          auVar10._0_8_ = local_60 + 1;
          _Var17 = SUB168(ZEXT816(2) * auVar10,0);
          if (SUB168(ZEXT816(2) * auVar10,8) != 0) {
            _Var17 = 0xffffffffffffffff;
          }
          pvVar18 = operator_new(_Var17);
          puVar1 = local_58;
          psVar20 = (short *)CONCAT62(uStack_6e,local_70);
          puVar14 = local_f0;
          local_e0 = pvVar18;
          if (pvVar18 != (void *)0x0) {
            psVar24 = &local_70;
            if ((ulonglong *)0x7 < local_58) {
              psVar24 = psVar20;
            }
            lVar26 = (longlong)pvVar18 - (longlong)psVar24;
            do {
              sVar3 = *psVar24;
              *(short *)(lVar26 + (longlong)psVar24) = sVar3;
              psVar24 = psVar24 + 1;
            } while (sVar3 != 0);
            *(undefined2 *)((longlong)pvVar18 + lVar27 * 2) = 0;
            puVar19 = puVar28;
            if (puVar2 != (ulonglong *)0x0) {
              puVar19 = (ulonglong *)*puVar2;
            }
            ppvVar5 = (void **)puVar19[5];
            if ((&local_e0 < ppvVar5) && (ppvVar6 = (void **)puVar19[4], ppvVar6 <= &local_e0)) {
              if (ppvVar5 == (void **)puVar19[6]) {
                FUN_140195b20(puVar19 + 4);
              }
              if ((undefined8 *)puVar19[5] != (undefined8 *)0x0) {
                *(undefined8 *)puVar19[5] =
                     *(undefined8 *)
                      (puVar19[4] + ((longlong)&local_e0 - (longlong)ppvVar6 >> 3) * 8);
              }
            }
            else {
              if (ppvVar5 == (void **)puVar19[6]) {
                FUN_140195b20(puVar19 + 4);
              }
              if ((undefined8 *)puVar19[5] != (undefined8 *)0x0) {
                *(undefined8 *)puVar19[5] = pvVar18;
              }
            }
            puVar19[5] = puVar19[5] + 8;
            puVar19 = puVar28;
            if (puVar2 != (ulonglong *)0x0) {
              puVar19 = (ulonglong *)*puVar2;
            }
            iVar31 = (int)((longlong)(puVar19[5] - puVar19[4]) >> 3) + -1;
            if (puVar2 != (ulonglong *)0x0) {
              puVar28 = (ulonglong *)*puVar2;
            }
            piVar22 = (int *)puVar28[0x11];
            local_110 = iVar31;
            if ((&local_110 < piVar22) && (piVar25 = (int *)puVar28[0x10], piVar25 <= &local_110)) {
              if (piVar22 == (int *)puVar28[0x12]) {
                FUN_1400556a0(puVar28 + 0x10,1);
              }
              if ((undefined4 *)puVar28[0x11] != (undefined4 *)0x0) {
                *(undefined4 *)puVar28[0x11] =
                     *(undefined4 *)
                      (puVar28[0x10] + ((longlong)local_10c + (-4 - (longlong)piVar25) >> 2) * 4);
              }
            }
            else {
              if (piVar22 == (int *)puVar28[0x12]) {
                FUN_1400556a0(puVar28 + 0x10,1);
              }
              if ((int *)puVar28[0x11] != (int *)0x0) {
                *(int *)puVar28[0x11] = iVar31;
              }
            }
            puVar28[0x11] = puVar28[0x11] + 4;
            puVar14 = local_f0;
          }
        }
        param_2 = puVar14;
        param_3 = local_100;
        local_f0 = param_2;
        if ((ulonglong *)0x7 < puVar1) {
          operator_delete(psVar20);
          param_3 = local_100;
          param_2 = local_f0;
        }
      }
LAB_140294504:
      uVar29 = 0;
      local_108 = local_108 + 1;
      local_c8 = local_c8 + 1;
    } while (local_c8 < local_c0);
  }
LAB_14029453e:
  puVar28 = local_d8;
  uVar21 = uVar29;
  if (puVar2 != (ulonglong *)0x0) {
    uVar21 = *puVar2;
  }
  if (*(longlong *)(uVar21 + 0x80) == *(longlong *)(uVar21 + 0x88)) {
    if (puVar2 != (ulonglong *)0x0) {
      LOCK();
      puVar2 = puVar2 + 1;
      uVar29 = *puVar2;
      *(int *)puVar2 = (int)*puVar2 + -1;
      UNLOCK();
      if ((int)uVar29 == 1) {
        pvVar18 = (void *)*local_d8;
        if (pvVar18 != (void *)0x0) {
          FUN_140296260(pvVar18);
          operator_delete(pvVar18);
        }
        operator_delete(puVar28);
      }
    }
    uVar23 = 0;
  }
  else {
    if (puVar2 != (ulonglong *)0x0) {
      uVar29 = *puVar2;
    }
    local_b8 = **(undefined4 **)(uVar29 + 0x80);
    puVar28 = puVar2;
    if (puVar2 != (ulonglong *)0x0) {
      LOCK();
      *(int *)(puVar2 + 1) = (int)puVar2[1] + 1;
      UNLOCK();
      puVar28 = local_d8;
    }
    local_b0 = puVar2;
    local_a8 = puVar2;
    FUN_140295350(param_2 + 0xd,local_b8,&local_b0);
    FUN_140295170(&local_b0);
    puVar2 = local_d8;
    if (puVar28 != (ulonglong *)0x0) {
      LOCK();
      puVar28 = puVar28 + 1;
      uVar29 = *puVar28;
      *(int *)puVar28 = (int)*puVar28 + -1;
      UNLOCK();
      if ((int)uVar29 == 1) {
        pvVar18 = (void *)*local_d8;
        if (pvVar18 != (void *)0x0) {
          FUN_140296260(pvVar18);
          operator_delete(pvVar18);
        }
        operator_delete(puVar2);
      }
    }
    uVar23 = 1;
  }
  return uVar23;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140294650(longlong param_1,short *param_2)

{
  ushort *puVar1;
  longlong *plVar2;
  short sVar3;
  ushort uVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong *plVar7;
  int iVar8;
  undefined8 uVar9;
  ulonglong uVar10;
  ushort *puVar11;
  ushort *puVar12;
  ushort *puVar13;
  longlong *plVar14;
  longlong lVar15;
  short *psVar16;
  ulonglong uVar17;
  undefined1 auStack_c8 [32];
  longlong *local_a8;
  longlong *plStack_a0;
  undefined8 local_98;
  ushort local_90;
  undefined6 uStack_8e;
  longlong local_80;
  ulonglong local_78;
  ushort local_68;
  undefined6 uStack_66;
  longlong local_58;
  ulonglong local_50;
  ulonglong local_38;
  
  local_98 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  EnterCriticalSection(DAT_140608240);
  local_78 = 7;
  uVar17 = 0;
  local_80 = 0;
  local_90 = 0;
  uVar10 = 0xffffffffffffffff;
  psVar16 = param_2;
  do {
    if (uVar10 == 0) break;
    uVar10 = uVar10 - 1;
    sVar3 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar3 != 0);
  FUN_140001710(&local_90,param_2,~uVar10 - 1);
  puVar12 = (ushort *)CONCAT62(uStack_8e,local_90);
  puVar11 = &local_90;
  if (7 < local_78) {
    puVar11 = puVar12;
  }
  puVar1 = puVar11 + local_80;
  puVar13 = &local_90;
  if (7 < local_78) {
    puVar13 = puVar12;
  }
  if (puVar13 != puVar1) {
    lVar15 = (longlong)puVar11 - (longlong)puVar13;
    do {
      iVar8 = tolower((uint)*puVar13);
      *(short *)(lVar15 + (longlong)puVar13) = (short)iVar8;
      puVar13 = puVar13 + 1;
    } while (puVar13 != puVar1);
    puVar12 = (ushort *)CONCAT62(uStack_8e,local_90);
  }
  puVar11 = &local_90;
  if (7 < local_78) {
    puVar11 = puVar12;
  }
  local_50 = 7;
  local_58 = 0;
  local_68 = 0;
  uVar10 = 0xffffffffffffffff;
  puVar12 = puVar11;
  do {
    if (uVar10 == 0) break;
    uVar10 = uVar10 - 1;
    uVar4 = *puVar12;
    puVar12 = puVar12 + 1;
  } while (uVar4 != 0);
  FUN_140001710(&local_68,puVar11,~uVar10 - 1);
  if (*(longlong *)(param_1 + 0x38) != 0) {
    puVar12 = &local_68;
    if (7 < local_50) {
      puVar12 = (ushort *)CONCAT62(uStack_66,local_68);
    }
    puVar11 = &local_68;
    if (7 < local_50) {
      puVar11 = (ushort *)CONCAT62(uStack_66,local_68);
    }
    for (; puVar11 != puVar12 + local_58; puVar11 = puVar11 + 1) {
      uVar17 = uVar17 ^ (uVar17 >> 2) + uVar17 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar11;
    }
    plVar2 = (longlong *)
             (*(longlong *)(param_1 + 0x18) + (uVar17 % *(ulonglong *)(param_1 + 0x20)) * 8);
    plStack_a0 = (longlong *)FUN_1402cb0b0(plVar2,&local_68);
    local_a8 = plVar2;
    if (plStack_a0 != (longlong *)0x0) goto LAB_140294805;
  }
  plStack_a0 = (longlong *)0x0;
  local_a8 = (longlong *)0x0;
LAB_140294805:
  plVar7 = plStack_a0;
  plVar2 = local_a8;
  if (7 < local_50) {
    operator_delete((void *)CONCAT62(uStack_66,local_68));
  }
  local_50 = 7;
  local_58 = 0;
  local_68 = 0;
  if (plVar7 == (longlong *)0x0) {
    if (7 < local_78) {
      operator_delete((void *)CONCAT62(uStack_8e,local_90));
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    LeaveCriticalSection(DAT_140608240);
    uVar9 = 0;
  }
  else {
    lVar15 = *plVar7;
    plVar14 = local_a8;
    while (lVar15 == 0) {
      plVar14 = plVar14 + 1;
      lVar15 = *plVar14;
    }
    *(longlong *)(param_1 + 0x38) = *(longlong *)(param_1 + 0x38) + -1;
    plVar5 = (longlong *)*plVar2;
    plVar6 = plVar2;
    while (plVar5 != plVar7) {
      plVar6 = (longlong *)*plVar6;
      plVar5 = (longlong *)*plVar6;
    }
    *plVar6 = *plVar7;
    FUN_140295700(plVar7);
    if ((plVar2 == *(longlong **)(param_1 + 0x48)) && (*plVar2 == 0)) {
      *(longlong **)(param_1 + 0x48) = plVar14;
    }
    if (7 < local_78) {
      operator_delete((void *)CONCAT62(uStack_8e,local_90));
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    LeaveCriticalSection(DAT_140608240);
    uVar9 = 1;
  }
  return uVar9;
}



undefined8 * FUN_140294910(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong lVar3;
  longlong **pplVar4;
  longlong **pplVar5;
  undefined8 *puVar6;
  void *pvVar7;
  int iVar8;
  uint uVar9;
  undefined4 uVar10;
  ulonglong uVar11;
  undefined8 uVar12;
  undefined8 uVar13;
  longlong lVar14;
  longlong *plVar15;
  undefined4 *puVar16;
  undefined4 *puVar17;
  bool bVar18;
  longlong *local_60;
  longlong *local_58;
  undefined4 *local_50;
  
  FUN_140292360(&local_60,L"table\\reloadTableList.rh");
  if (local_60 != (longlong *)0x0) {
    if (local_60 == local_58) {
      lVar3 = *local_60;
      if (lVar3 != 0) {
        if (*(longlong *)(lVar3 + 0x70) != 0) {
          uVar11 = 0;
          if (*(uint *)(lVar3 + 0x78) != 0) {
            plVar15 = *(longlong **)(lVar3 + 0x68);
            do {
              if (*plVar15 != 0) {
                puVar17 = (undefined4 *)(*(longlong **)(lVar3 + 0x68))[uVar11];
                goto LAB_1402949d1;
              }
              uVar9 = (int)uVar11 + 1;
              uVar11 = (ulonglong)uVar9;
              plVar15 = plVar15 + 1;
            } while (uVar9 < *(uint *)(lVar3 + 0x78));
          }
        }
        puVar17 = (undefined4 *)0x0;
LAB_1402949d1:
        puVar16 = puVar17;
        local_50 = puVar16;
        if (puVar16 != (undefined4 *)0x0) {
          uVar2 = *puVar16;
          if (local_60 == (longlong *)0x0) {
LAB_140294a0a:
            lVar14 = 0;
          }
          else {
            if (local_60 != local_58) {
              iVar8 = DAT_140608200 + 1;
              bVar18 = DAT_140608200 == 0;
              DAT_140608200 = iVar8;
              if (bVar18) {
                FUN_140176d60(1);
              }
              goto LAB_140294a0a;
            }
            lVar14 = *local_60;
          }
          uVar10 = FUN_1402970c0(lVar14,L"szName");
          uVar12 = FUN_140296990(lVar14,uVar2,uVar10,L"szName",1);
          if (local_60 == (longlong *)0x0) {
LAB_140294a69:
            lVar14 = 0;
          }
          else {
            if (local_60 != local_58) {
              iVar8 = DAT_140608200 + 1;
              bVar18 = DAT_140608200 == 0;
              DAT_140608200 = iVar8;
              if (bVar18) {
                FUN_140176d60(1);
              }
              goto LAB_140294a69;
            }
            lVar14 = *local_60;
          }
          uVar10 = FUN_1402970c0(lVar14,L"szTableFile");
          uVar13 = FUN_140296990(lVar14,uVar2,uVar10,L"szTableFile",1);
          FUN_140294650(param_1,uVar12);
          FUN_140292e80(param_1,uVar12,uVar13);
          puVar17 = *(undefined4 **)(puVar16 + 6);
          if (puVar17 == (undefined4 *)0x0) {
            uVar9 = (uint)puVar16[8] % *(uint *)(lVar3 + 0x78) + 1;
            lVar14 = (longlong)(int)uVar9 << 3;
            do {
              if (*(uint *)(lVar3 + 0x78) <= uVar9) break;
              if (*(longlong *)(*(longlong *)(lVar3 + 0x68) + lVar14) != 0) {
                puVar17 = *(undefined4 **)(*(longlong *)(lVar3 + 0x68) + lVar14);
              }
              uVar9 = uVar9 + 1;
              lVar14 = lVar14 + 8;
            } while (puVar17 == (undefined4 *)0x0);
          }
          goto LAB_1402949d1;
        }
        lVar3 = *(longlong *)(param_1 + 0xa0);
        if (*(longlong *)(param_1 + 0x98) != lVar3) {
          uVar12 = FUN_1402955f0(lVar3,lVar3);
          FUN_140295c00(uVar12,*(undefined8 *)(param_1 + 0xa0));
          *(undefined8 *)(param_1 + 0xa0) = uVar12;
        }
        pplVar4 = *(longlong ***)(param_1 + 0xa0);
        if ((&local_60 < pplVar4) &&
           (pplVar5 = *(longlong ***)(param_1 + 0x98), pplVar5 <= &local_60)) {
          if (pplVar4 == *(longlong ***)(param_1 + 0xa8)) {
            FUN_1402950e0(param_1 + 0x98);
          }
          plVar15 = *(longlong **)(param_1 + 0xa0);
          if (plVar15 != (longlong *)0x0) {
            lVar3 = *(longlong *)
                     (((longlong)&local_60 - (longlong)pplVar5 & 0xfffffffffffffff0U) +
                     *(longlong *)(param_1 + 0x98));
            *plVar15 = lVar3;
            plVar15[1] = lVar3;
            if (lVar3 != 0) {
              LOCK();
              *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
              UNLOCK();
            }
          }
        }
        else {
          if (pplVar4 == *(longlong ***)(param_1 + 0xa8)) {
            FUN_1402950e0(param_1 + 0x98);
          }
          puVar6 = *(undefined8 **)(param_1 + 0xa0);
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = local_60;
            puVar6[1] = local_60;
            if (local_60 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_60 + 1) = (int)local_60[1] + 1;
              UNLOCK();
            }
          }
        }
        *(longlong *)(param_1 + 0xa0) = *(longlong *)(param_1 + 0xa0) + 0x10;
        *param_2 = local_60;
        param_2[1] = local_60;
        plVar15 = local_60;
        if (local_60 != (longlong *)0x0) {
          LOCK();
          *(int *)(local_60 + 1) = (int)local_60[1] + 1;
          UNLOCK();
        }
        goto LAB_140294c20;
      }
    }
    else {
      iVar8 = DAT_140608200 + 1;
      bVar18 = DAT_140608200 == 0;
      DAT_140608200 = iVar8;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  *param_2 = local_60;
  param_2[1] = local_60;
  plVar15 = local_60;
  if (local_60 != (longlong *)0x0) {
    LOCK();
    *(int *)(local_60 + 1) = (int)local_60[1] + 1;
    UNLOCK();
  }
LAB_140294c20:
  if (plVar15 != (longlong *)0x0) {
    if (plVar15 == local_58) {
      if (plVar15 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar15 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          local_60 = (longlong *)0x0;
          pvVar7 = (void *)*plVar15;
          if (pvVar7 != (void *)0x0) {
            FUN_140296560(pvVar7);
            operator_delete(pvVar7);
          }
          operator_delete(plVar15);
        }
      }
    }
    else {
      iVar8 = DAT_140608204 + 1;
      bVar18 = DAT_140608204 == 0;
      DAT_140608204 = iVar8;
      if (bVar18) {
        FUN_140176d60(1);
      }
    }
  }
  return param_2;
}



undefined8 FUN_140294ca0(longlong param_1,short *param_2)

{
  short sVar1;
  short sVar2;
  undefined4 uVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  DWORD DVar6;
  undefined4 uVar7;
  int iVar8;
  longlong *plVar9;
  HANDLE pvVar10;
  HANDLE pvVar11;
  longlong lVar12;
  undefined8 uVar13;
  short *psVar14;
  int iVar15;
  uint uVar16;
  longlong *plVar18;
  undefined4 *puVar19;
  undefined4 *puVar20;
  undefined4 *puVar21;
  bool bVar22;
  undefined4 *puVar17;
  
  plVar4 = *(longlong **)(param_1 + 0xa0);
  plVar18 = *(longlong **)(param_1 + 0x98);
  iVar8 = DAT_140608200;
  do {
    if (plVar18 == plVar4) {
      return 0;
    }
    puVar20 = (undefined4 *)0x0;
    puVar5 = (undefined8 *)*plVar18;
    puVar21 = puVar20;
    iVar15 = iVar8;
    if (puVar5 != (undefined8 *)0x0) {
      if (puVar5 == (undefined8 *)plVar18[1]) {
        puVar21 = (undefined4 *)*puVar5;
      }
      else {
        DAT_140608200 = iVar8 + 1;
        iVar15 = DAT_140608200;
        if (iVar8 == 0) {
          FUN_140176d60(1);
          iVar15 = DAT_140608200;
        }
      }
    }
    iVar8 = iVar15;
    if ((*(longlong *)(puVar21 + 0x1c) != 0) && (puVar21[0x1e] != 0)) {
      plVar9 = *(longlong **)(puVar21 + 0x1a);
      puVar17 = puVar20;
      puVar19 = puVar20;
      do {
        if (*plVar9 != 0) {
          puVar20 = (undefined4 *)(*(longlong **)(puVar21 + 0x1a))[(longlong)puVar19];
          break;
        }
        uVar16 = (int)puVar17 + 1;
        puVar17 = (undefined4 *)(ulonglong)uVar16;
        puVar19 = (undefined4 *)((longlong)puVar19 + 1);
        plVar9 = plVar9 + 1;
      } while (uVar16 < (uint)puVar21[0x1e]);
    }
LAB_140294d50:
    puVar17 = puVar20;
    uVar13 = 0;
    if (puVar17 != (undefined4 *)0x0) {
      puVar5 = (undefined8 *)*plVar18;
      uVar3 = *puVar17;
      if (puVar5 != (undefined8 *)0x0) {
        if (puVar5 == (undefined8 *)plVar18[1]) {
          uVar13 = *puVar5;
        }
        else {
          DAT_140608200 = iVar8 + 1;
          if ((iVar8 == 0) &&
             (pvVar10 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), pvVar10 != (HANDLE)0x0)) {
            DVar6 = GetCurrentProcessId();
            pvVar11 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar11,DVar6,pvVar10,2,0,0,0);
            CloseHandle(pvVar10);
          }
        }
      }
      uVar7 = FUN_1402970c0(uVar13,L"szName");
      lVar12 = FUN_140296990(uVar13,uVar3,uVar7,L"szName",1);
      puVar5 = (undefined8 *)*plVar18;
      if (puVar5 == (undefined8 *)0x0) {
LAB_140294ebc:
        uVar13 = 0;
      }
      else {
        if (puVar5 != (undefined8 *)plVar18[1]) {
          iVar8 = DAT_140608200 + 1;
          bVar22 = DAT_140608200 == 0;
          DAT_140608200 = iVar8;
          if ((bVar22) &&
             (pvVar10 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), pvVar10 != (HANDLE)0x0)) {
            DVar6 = GetCurrentProcessId();
            pvVar11 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar11,DVar6,pvVar10,2,0,0,0);
            CloseHandle(pvVar10);
          }
          goto LAB_140294ebc;
        }
        uVar13 = *puVar5;
      }
      uVar7 = FUN_1402970c0(uVar13,L"szTableFile");
      uVar13 = FUN_140296990(uVar13,uVar3,uVar7,L"szTableFile",1);
      psVar14 = param_2;
      do {
        sVar1 = *psVar14;
        sVar2 = *(short *)((longlong)psVar14 + (lVar12 - (longlong)param_2));
        if (sVar1 != sVar2) break;
        psVar14 = psVar14 + 1;
      } while (sVar2 != 0);
      if (sVar1 == sVar2) {
        return uVar13;
      }
      puVar19 = (undefined4 *)0x0;
      puVar20 = *(undefined4 **)(puVar17 + 6);
      iVar8 = DAT_140608200;
      if (*(undefined4 **)(puVar17 + 6) == (undefined4 *)0x0) {
        uVar16 = (uint)puVar17[8] % (uint)puVar21[0x1e] + 1;
        lVar12 = (longlong)(int)uVar16 << 3;
        do {
          puVar20 = puVar19;
          if ((uint)puVar21[0x1e] <= uVar16) break;
          if (*(longlong *)(lVar12 + *(longlong *)(puVar21 + 0x1a)) != 0) {
            puVar19 = *(undefined4 **)(lVar12 + *(longlong *)(puVar21 + 0x1a));
          }
          uVar16 = uVar16 + 1;
          lVar12 = lVar12 + 8;
          puVar20 = puVar19;
        } while (puVar19 == (undefined4 *)0x0);
      }
      goto LAB_140294d50;
    }
    plVar18 = plVar18 + 2;
  } while( true );
}



void FUN_140294fc0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140295760();
  }
  return;
}



void FUN_140294fe0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_140295c00(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_140295020(ulonglong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong lVar3;
  
  plVar1 = (longlong *)param_1[1];
  if ((param_2 < plVar1) && (plVar2 = (longlong *)*param_1, plVar2 <= param_2)) {
    if (plVar1 == (longlong *)param_1[2]) {
      FUN_1402950e0(param_1);
    }
    plVar1 = (longlong *)param_1[1];
    if (plVar1 != (longlong *)0x0) {
      lVar3 = *(longlong *)(((longlong)param_2 - (longlong)plVar2 & 0xfffffffffffffff0U) + *param_1)
      ;
      *plVar1 = lVar3;
      plVar1[1] = lVar3;
      if (lVar3 != 0) {
        LOCK();
        *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
        UNLOCK();
        param_1[1] = param_1[1] + 0x10;
        return;
      }
    }
  }
  else {
    if (plVar1 == (longlong *)param_1[2]) {
      FUN_1402950e0(param_1);
    }
    plVar1 = (longlong *)param_1[1];
    if (plVar1 != (longlong *)0x0) {
      lVar3 = *param_2;
      *plVar1 = lVar3;
      plVar1[1] = lVar3;
      if (lVar3 != 0) {
        LOCK();
        *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
        UNLOCK();
      }
    }
  }
  param_1[1] = param_1[1] + 0x10;
  return;
}



void FUN_1402950c0(void)

{
                    // WARNING: Could not recover jumptable at 0x0001402950c7. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608240);
  return;
}



void thunk_FUN_140295170(void)

{
  FUN_140295170();
  return;
}



void FUN_1402950e0(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_1402951f0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402951f0(param_1,uVar2);
  }
  return;
}



void FUN_140295170(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_140296260(pvVar3);
            operator_delete(pvVar3);
          }
          operator_delete(puVar2);
        }
      }
    }
    else {
      iVar4 = DAT_14060823c + 1;
      bVar5 = DAT_14060823c == 0;
      DAT_14060823c = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



void FUN_1402951f0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140295db0(*param_1,param_1[1],local_res10,param_4,uVar5);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140295c00();
      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_140295300(undefined2 *param_1,undefined8 param_2,undefined8 *param_3)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x14) = *param_3;
  return param_1;
}



uint * FUN_140295350(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_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_140295170(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_1401e59d0(param_1,param_2,(ulonglong)param_2 % uVar4,param_2);
  if (*(longlong *)(puVar3 + 2) != *param_3) {
    FUN_140295170(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;
}



void FUN_140295440(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_140608204;
      while (DAT_140608204 = 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_140296560(pvVar6);
                  operator_delete(pvVar6);
                }
                operator_delete(puVar5);
              }
            }
          }
          else {
            DAT_140608204 = 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_140608204;
      }
    }
    param_1[4] = 0;
    param_1[6] = puVar2;
  }
  return;
}



longlong * FUN_1402955f0(longlong param_1,longlong param_2,longlong *param_3)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  
  plVar2 = param_3;
  if (param_1 != param_2) {
    lVar3 = param_1 - (longlong)param_3;
    do {
      if (*plVar2 != *(longlong *)(lVar3 + (longlong)plVar2)) {
        FUN_140249180(plVar2);
        lVar1 = *(longlong *)(lVar3 + (longlong)plVar2);
        *plVar2 = lVar1;
        *(longlong *)((longlong)param_3 + (8 - param_1) + lVar3 + (longlong)plVar2) = lVar1;
        if (lVar1 != 0) {
          LOCK();
          *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
          UNLOCK();
        }
      }
      plVar2 = plVar2 + 2;
    } while (lVar3 + (longlong)plVar2 != param_2);
  }
  return plVar2;
}



void FUN_140295680(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_140295e00(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x18);
  FUN_140295e00(param_1,param_2);
  return;
}



void FUN_140295700(void *param_1)

{
  FUN_140249180((longlong)param_1 + 0x30);
  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 0x000140295758. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(param_1);
  return;
}



void FUN_140295760(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;
  
  puVar10 = (undefined8 *)*param_1;
  puVar2 = puVar10 + param_1[1];
  for (; puVar10 != puVar2; puVar10 = puVar10 + 1) {
    puVar3 = (undefined8 *)*puVar10;
    *puVar10 = 0;
    iVar7 = DAT_140608204;
    while (DAT_140608204 = 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_140296560(pvVar6);
                operator_delete(pvVar6);
              }
              operator_delete(puVar5);
            }
          }
        }
        else {
          DAT_140608204 = 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_140608204;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



longlong * FUN_140295910(longlong *param_1,longlong *param_2,undefined8 param_3,longlong param_4)

{
  char cVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar6;
  undefined8 uVar7;
  longlong *local_48;
  longlong *local_40;
  undefined2 local_38;
  
  uVar7 = 0xfffffffffffffffe;
  uVar2 = FUN_14015afa0(param_3);
  plVar5 = (longlong *)(*param_1 + (uVar2 % (ulonglong)param_1[1]) * 8);
  lVar3 = FUN_1402cb0b0(plVar5,param_3);
  if (lVar3 == 0) {
    local_40 = (longlong *)0x0;
    local_38 = 0;
    local_48 = param_1;
    FUN_140296070(&local_48);
    plVar6 = local_40;
    plVar4 = local_40 + 1;
    if (plVar4 != (longlong *)0x0) {
      local_40[4] = 7;
      local_40[3] = 0;
      *(undefined2 *)plVar4 = 0;
      FUN_1400015e0(plVar4,param_4,0,0xffffffffffffffff,uVar7,plVar4);
      lVar3 = *(longlong *)(param_4 + 0x28);
      plVar6[6] = lVar3;
      plVar6[7] = lVar3;
      if (lVar3 != 0) {
        LOCK();
        *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
        UNLOCK();
        plVar6 = local_40;
      }
    }
    local_38 = CONCAT11(1,(undefined1)local_38);
    cVar1 = FUN_140295cb0(param_1);
    if (cVar1 != '\0') {
      plVar5 = (longlong *)(*param_1 + (uVar2 % (ulonglong)param_1[1]) * 8);
    }
    *plVar6 = *plVar5;
    *plVar5 = (longlong)plVar6;
    param_1[4] = param_1[4] + 1;
    plVar4 = (longlong *)param_1[6];
    if (plVar5 < (longlong *)param_1[6]) {
      plVar4 = plVar5;
    }
    param_1[6] = (longlong)plVar4;
    *param_2 = (longlong)plVar5;
    param_2[1] = (longlong)plVar6;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)plVar5;
    param_2[1] = lVar3;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



longlong * FUN_140295a70(longlong *param_1,longlong *param_2,longlong param_3)

{
  undefined8 *puVar1;
  ulonglong *puVar2;
  longlong *plVar3;
  ulonglong uVar4;
  longlong lVar5;
  ulonglong *puVar6;
  undefined8 *puVar7;
  ulonglong local_res20;
  undefined8 uVar8;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  uVar8 = 0xfffffffffffffffe;
  local_38 = (undefined8 *)0x0;
  local_30 = 0;
  local_40 = param_1;
  FUN_140296070(&local_40);
  puVar7 = local_38;
  puVar1 = local_38 + 1;
  if (puVar1 != (undefined8 *)0x0) {
    local_38[4] = 7;
    local_38[3] = 0;
    *(undefined2 *)puVar1 = 0;
    FUN_1400015e0(puVar1,param_3,0,0xffffffffffffffff,uVar8);
    lVar5 = *(longlong *)(param_3 + 0x28);
    puVar7[6] = lVar5;
    puVar7[7] = lVar5;
    if (lVar5 != 0) {
      LOCK();
      *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
      UNLOCK();
      puVar7 = local_38;
    }
  }
  local_30 = CONCAT11(1,(undefined1)local_30);
  uVar4 = FUN_14015afa0(puVar1);
  if (*param_1 == 0) {
    local_res20 = FUN_1402c9710(param_1,1);
    puVar2 = (ulonglong *)(param_1 + 1);
    puVar6 = &local_res20;
    if (local_res20 <= *puVar2) {
      puVar6 = puVar2;
    }
    *puVar2 = *puVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else if (((ulonglong)param_1[7] < 2) && (lVar5 = FUN_1402c9710(param_1), lVar5 != param_1[1])) {
    FUN_140295ea0(param_1);
  }
  plVar3 = (longlong *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar7 = *plVar3;
  *plVar3 = (longlong)puVar7;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)plVar3;
  *param_2 = (longlong)plVar3;
  param_2[1] = (longlong)puVar7;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



void FUN_140295c00(undefined8 *param_1,undefined8 *param_2)

{
  int *piVar1;
  undefined8 *puVar2;
  void *pvVar3;
  int iVar4;
  
  iVar4 = DAT_140608204;
  for (; param_1 != param_2; param_1 = param_1 + 2) {
    puVar2 = (undefined8 *)*param_1;
    DAT_140608204 = 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_140296560(pvVar3);
              operator_delete(pvVar3);
            }
            operator_delete(puVar2);
          }
        }
      }
      else {
        DAT_140608204 = iVar4 + 1;
        if (iVar4 == 0) {
          FUN_140176d60(1);
        }
      }
    }
    iVar4 = DAT_140608204;
  }
  DAT_140608204 = iVar4;
  return;
}



undefined8 FUN_140295cb0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_140295ea0(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140295d20(undefined8 *param_1)

{
  FUN_140249180(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_140295d70(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_140295d20(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



longlong * FUN_140295db0(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_140295e00(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140295170(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_1402cddb0(param_1);
    FUN_1401dfb50(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_140295ea0(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  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_140346140(&local_50);
  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;
    }
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  lVar6 = FUN_1402961d0(param_1);
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_140295760(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_140295760(&local_50);
  }
  return;
}



void FUN_140296070(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_1405d3608);
    }
    *(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_140249180(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_140296160(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_1402961d0(param_1);
      param_1[7] = lVar2;
      return;
    }
  }
  lVar2 = FUN_1402961d0(param_1);
  param_1[7] = lVar2;
  return;
}



longlong FUN_1402961d0(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_140296250(longlong param_1)

{
  FUN_140291d10(param_1 + -8);
  return;
}



void FUN_140296260(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_140296350(undefined8 *param_1,uint param_2)

{
  LPCRITICAL_SECTION lpCriticalSection;
  
  lpCriticalSection = DAT_140608240;
  *param_1 = MBMultiThreadSync<>::vftable;
  if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) {
    DeleteCriticalSection(lpCriticalSection);
    operator_delete(lpCriticalSection);
  }
  DAT_140608240 = (LPCRITICAL_SECTION)0x0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402963c0(undefined8 *param_1)

{
  LPCRITICAL_SECTION lpCriticalSection;
  
  lpCriticalSection = DAT_140608240;
  *param_1 = MBMultiThreadSync<>::vftable;
  if (lpCriticalSection != (LPCRITICAL_SECTION)0x0) {
    DeleteCriticalSection(lpCriticalSection);
    operator_delete(lpCriticalSection);
  }
  DAT_140608240 = (LPCRITICAL_SECTION)0x0;
  return;
}



undefined8 * FUN_140296400(undefined8 *param_1,byte param_2)

{
  DAT_140607ff0 = 0;
  *param_1 = MBISingleton<>::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140296440(undefined8 *param_1)

{
  DAT_140607ff0 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402964f5)
// WARNING: Removing unreachable block (ram,0x0001402964fe)
// WARNING: Removing unreachable block (ram,0x00014029651f)
// WARNING: Removing unreachable block (ram,0x000140296528)

undefined2 * FUN_140296460(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_140297310(void)

{
  FUN_140297310();
  return;
}



void FUN_140296560(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  FUN_140297240(param_1 + 0xd);
  FUN_140297310(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;
  if (param_1[5] != 0) {
    FUN_14008d0a0(param_1[5],param_1[6],param_3,param_4,uVar1);
    operator_delete((void *)param_1[5]);
  }
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 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;
}



longlong FUN_140296600(longlong param_1,ulonglong param_2,int param_3,undefined8 param_4,
                      undefined1 param_5)

{
  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_1402971a0(param_1,param_2,L"Not Found Column",param_4,param_5);
    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_140296260(pvVar5);
                    operator_delete(pvVar5);
                  }
                  operator_delete(plVar3);
                }
                return lVar4 + (longlong)param_3 * 4;
              }
              FUN_1402971a0(param_1,uVar6,L"Not Found LineTable Over Index",param_4,param_5);
              goto LAB_14029674e;
            }
          }
          FUN_1402971a0(param_1,uVar6,L"NULL LineTable",param_4,param_5);
          if (plVar3 == (longlong *)0x0) {
            return 0;
          }
LAB_14029674e:
          LOCK();
          plVar1 = plVar3 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar5 = (void *)*plVar3;
            if (pvVar5 != (void *)0x0) {
              FUN_140296260(pvVar5);
              operator_delete(pvVar5);
            }
            operator_delete(plVar3);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_1402971a0(param_1,uVar6,L"Not Found Line",param_4,param_5);
  return 0;
}



longlong FUN_1402967b0(longlong param_1,ulonglong param_2,int param_3,undefined8 param_4,
                      undefined1 param_5)

{
  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_1402971a0(param_1,param_2,L"Not Found Column",param_4,param_5);
    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_140296260(pvVar6);
                      operator_delete(pvVar6);
                    }
                    operator_delete(plVar4);
                  }
                  return lVar5 + (longlong)iVar2 * 4;
                }
                FUN_1402971a0(param_1,uVar7,L"Not Found LineTable Over nFloatIdx",param_4,param_5);
              }
              else {
                FUN_1402971a0(param_1,uVar7,L"Not Found LineTable Over Index",param_4,param_5);
              }
              goto LAB_140296934;
            }
          }
          FUN_1402971a0(param_1,uVar7,L"NULL LineTable",param_4,param_5);
          if (plVar4 == (longlong *)0x0) {
            return 0;
          }
LAB_140296934:
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar6 = (void *)*plVar4;
            if (pvVar6 != (void *)0x0) {
              FUN_140296260(pvVar6);
              operator_delete(pvVar6);
            }
            operator_delete(plVar4);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_1402971a0(param_1,uVar7,L"Not Found Line",param_4,param_5);
  return 0;
}



undefined8
FUN_140296990(longlong param_1,ulonglong param_2,int param_3,undefined8 param_4,undefined1 param_5)

{
  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_1402971a0(param_1,param_2,L"Not Found Column",param_4,param_5);
    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_140296260(pvVar7);
                      operator_delete(pvVar7);
                    }
                    operator_delete(plVar4);
                  }
                  return uVar6;
                }
                FUN_1402971a0(param_1,uVar8,L"Not Found LineTable Over nStringIdx",param_4,param_5);
              }
              else {
                FUN_1402971a0(param_1,uVar8,L"Not Found LineTable Over Index",param_4,param_5);
              }
              goto LAB_140296b14;
            }
          }
          FUN_1402971a0(param_1,uVar8,L"NULL LineTable",param_4,param_5);
          if (plVar4 == (longlong *)0x0) {
            return 0;
          }
LAB_140296b14:
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar7 = (void *)*plVar4;
            if (pvVar7 != (void *)0x0) {
              FUN_140296260(pvVar7);
              operator_delete(pvVar7);
            }
            operator_delete(plVar4);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_1402971a0(param_1,uVar8,L"Not Found Line",param_4,param_5);
  return 0;
}



undefined8
FUN_140296b70(longlong param_1,ulonglong param_2,int param_3,undefined8 param_4,undefined1 param_5)

{
  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_1402971a0(param_1,param_2,L"Not Found Column",param_4,param_5);
    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_140296260(pvVar7);
                      operator_delete(pvVar7);
                    }
                    operator_delete(plVar4);
                  }
                  return uVar6;
                }
                FUN_1402971a0(param_1,uVar8,L"Not Found LineTable Over nWStringIdx",param_4,param_5)
                ;
              }
              else {
                FUN_1402971a0(param_1,uVar8,L"Not Found LineTable Over Index",param_4,param_5);
              }
              goto LAB_140296cf4;
            }
          }
          FUN_1402971a0(param_1,uVar8,L"NULL LineTable",param_4,param_5);
          if (plVar4 == (longlong *)0x0) {
            return 0;
          }
LAB_140296cf4:
          LOCK();
          plVar1 = plVar4 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            pvVar7 = (void *)*plVar4;
            if (pvVar7 != (void *)0x0) {
              FUN_140296260(pvVar7);
              operator_delete(pvVar7);
            }
            operator_delete(plVar4);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_1402971a0(param_1,uVar8,L"Not Found Line",param_4,param_5);
  return 0;
}



longlong FUN_140296d50(longlong param_1,ulonglong param_2,int param_3)

{
  int iVar1;
  int *piVar2;
  longlong *plVar3;
  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) != 4)) {
    FUN_1402971a0(param_1,param_2,L"Not Found Column",L"i64Exp",1);
    return 0;
  }
  if (*(longlong *)(param_1 + 0x68) != 0) {
    for (piVar2 = *(int **)(*(longlong *)(param_1 + 0x68) +
                           (uVar7 % (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();
            plVar4 = (longlong *)*plVar3;
            if (plVar4 != (longlong *)0x0) {
              if (param_3 < (int)(plVar4[0x11] - plVar4[0x10] >> 2)) {
                iVar1 = *(int *)(plVar4[0x10] + (longlong)param_3 * 4);
                if (iVar1 < (int)(plVar4[1] - *plVar4 >> 3)) {
                  lVar5 = *plVar4;
                  LOCK();
                  plVar4 = plVar3 + 1;
                  *(int *)plVar4 = (int)*plVar4 + -1;
                  UNLOCK();
                  if ((int)*plVar4 == 0) {
                    pvVar6 = (void *)*plVar3;
                    if (pvVar6 != (void *)0x0) {
                      FUN_140296260(pvVar6);
                      operator_delete(pvVar6);
                    }
                    operator_delete(plVar3);
                  }
                  return lVar5 + (longlong)iVar1 * 8;
                }
                FUN_1402971a0(param_1,uVar7,L"Not Found LineTable Over nInt64Idx",L"i64Exp",1);
              }
              else {
                FUN_1402971a0(param_1,uVar7,L"Not Found LineTable Over Index",L"i64Exp",1);
              }
              goto LAB_140296edf;
            }
          }
          FUN_1402971a0(param_1,uVar7,L"NULL LineTable",L"i64Exp",1);
          if (plVar3 == (longlong *)0x0) {
            return 0;
          }
LAB_140296edf:
          LOCK();
          plVar4 = plVar3 + 1;
          *(int *)plVar4 = (int)*plVar4 + -1;
          UNLOCK();
          if ((int)*plVar4 == 0) {
            pvVar6 = (void *)*plVar3;
            if (pvVar6 != (void *)0x0) {
              FUN_140296260(pvVar6);
              operator_delete(pvVar6);
            }
            operator_delete(plVar3);
          }
          return 0;
        }
        break;
      }
    }
  }
  FUN_1402971a0(param_1,uVar7,L"Not Found Line",L"i64Exp",1);
  return 0;
}



void FUN_140296f40(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined1 param_4)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1402970c0(param_1,param_3);
  FUN_140296600(param_1,param_2,uVar1,param_3,param_4);
  return;
}



void FUN_140296fa0(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined1 param_4)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1402970c0(param_1,param_3);
  FUN_1402967b0(param_1,param_2,uVar1,param_3,param_4);
  return;
}



void FUN_140297000(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined1 param_4)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1402970c0(param_1,param_3);
  FUN_140296990(param_1,param_2,uVar1,param_3,param_4);
  return;
}



void FUN_140297060(undefined8 param_1,undefined4 param_2,undefined8 param_3,undefined1 param_4)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1402970c0(param_1,param_3);
  FUN_140296b70(param_1,param_2,uVar1,param_3,param_4);
  return;
}



int FUN_1402970c0(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_140297147;
      }
      puVar6 = puVar6 + 1;
      puVar4 = puVar4 + 1;
    }
    uVar7 = 0;
LAB_140297147:
    if (uVar7 == 0) {
      if (uVar5 <= uVar2) {
        uVar7 = (uint)(uVar2 != uVar5);
        goto LAB_14029715b;
      }
    }
    else {
LAB_14029715b:
      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_1402971a0(undefined8 *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
                  char param_5)

{
  undefined1 auStack_248 [32];
  undefined8 local_228;
  undefined8 local_220;
  WCHAR local_218 [256];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_248;
  if ((param_5 != '\0') && (DAT_140607c16 == '\0')) {
    if (7 < (ulonglong)param_1[3]) {
      param_1 = (undefined8 *)*param_1;
    }
    local_228 = param_4;
    local_220 = param_3;
    FUN_14012f380(local_218,L"Table = %s, ID = %d, Column = %s - ErrorMsg %s",param_1,param_2);
    if (*(char *)(DAT_140607ff0 + 0xb8) == '\0') {
      MessageBoxW(DAT_140607bc0,local_218,L"table error",0);
    }
  }
  return;
}



void FUN_140297240(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 + 0x18);
        FUN_140295e00(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140297310(void)

{
  FUN_140297240();
  return;
}



void FUN_140297330(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_1402973d0(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_140297520(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_140297580(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_1404c0038,(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_140297977;
      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_14047b3f0;
    do {
      uVar9 = (ulonglong)(int)*(uint *)(param_1 + lVar15 * 4 + 0x40c);
      uVar5 = 0;
      *(uint *)(param_1 + 0x410) =
           *(uint *)(param_1 + 0x410) ^
           CONCAT31(CONCAT21(CONCAT11((&DAT_1404781f0)[(longlong)uVar9 >> 0x10 & 0xff] ^ *pbVar13,
                                      (&DAT_1404781f0)[(longlong)uVar9 >> 8 & 0xff]),
                             (&DAT_1404781f0)[uVar9 & 0xff]),
                    (&DAT_1404781f0)[*(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_1404781f0)[*(uint *)(param_1 + 0x41c) >> 0x18],
                                        (&DAT_1404781f0)[(longlong)uVar5 >> 0x10 & 0xff]),
                               (&DAT_1404781f0)[(longlong)uVar5 >> 8 & 0xff]),
                      (&DAT_1404781f0)[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_140297977;
          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_140297977:
  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_14047a3f0 + (ulonglong)(*puVar12 >> 0x18) * 4) ^
                     *(uint *)(&DAT_14047a7f0 + ((longlong)uVar9 >> 0x10 & 0xffU) * 4) ^
                     *(uint *)(&DAT_14047abf0 + ((longlong)uVar9 >> 8 & 0xffU) * 4) ^
                     *(uint *)(&DAT_14047aff0 + 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_140297a40(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_1404797f0 + ((longlong)uVar7 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_1404793f0 + ((longlong)uVar10 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_140479bf0 + ((longlong)uVar9 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_140479ff0 + (uVar8 & 0xff) * 4) ^ puVar2[-1];
      uVar4 = *(uint *)(&DAT_1404793f0 + ((longlong)uVar8 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_140479bf0 + ((longlong)uVar7 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_1404797f0 + ((longlong)uVar10 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_140479ff0 + (uVar9 & 0xff) * 4) ^ *puVar2;
      uVar11 = *(uint *)(&DAT_1404797f0 + ((longlong)uVar8 >> 0x10 & 0xffU) * 4) ^
               *(uint *)(&DAT_140479bf0 + ((longlong)uVar10 >> 8 & 0xffU) * 4) ^
               *(uint *)(&DAT_1404793f0 + ((longlong)uVar9 >> 0x18 & 0xffU) * 4) ^
               *(uint *)(&DAT_140479ff0 + (uVar7 & 0xff) * 4) ^ puVar2[1];
      uVar6 = *(uint *)(&DAT_1404793f0 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_140479bf0 + ((longlong)uVar8 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_1404797f0 + ((longlong)uVar9 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_140479ff0 + (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_1404782f0)[(longlong)uVar13 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_3[1] = (&DAT_1404782f0)[(longlong)uVar9 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_3[2] = (&DAT_1404782f0)[(longlong)uVar8 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_3[3] = (&DAT_1404782f0)[uVar7 & 0xff] ^ (byte)uVar1;
  uVar1 = *(undefined4 *)(lVar3 + 0x1e8 + param_1);
  param_3[4] = (&DAT_1404782f0)[(longlong)uVar7 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_3[5] = (&DAT_1404782f0)[(longlong)uVar13 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_3[6] = (&DAT_1404782f0)[(longlong)uVar9 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_3[7] = (&DAT_1404782f0)[uVar8 & 0xff] ^ (byte)uVar1;
  uVar1 = *(undefined4 *)(lVar3 + 0x1ec + param_1);
  param_3[8] = (&DAT_1404782f0)[(longlong)uVar8 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_3[9] = (&DAT_1404782f0)[(longlong)uVar7 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_3[10] = (&DAT_1404782f0)[(longlong)uVar13 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_3[0xb] = (&DAT_1404782f0)[uVar9 & 0xff] ^ (byte)uVar1;
  uVar1 = *(undefined4 *)(lVar3 + 0x1f0 + param_1);
  param_3[0xc] = (&DAT_1404782f0)[(longlong)uVar9 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_3[0xd] = (&DAT_1404782f0)[(longlong)uVar8 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_3[0xe] = (&DAT_1404782f0)[(longlong)uVar7 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_3[0xf] = (&DAT_1404782f0)[uVar13 & 0xff] ^ (byte)uVar1;
  return;
}



void FUN_140297e60(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_14047b41c + lVar5);
    iVar9 = *(int *)(&DAT_14047b424 + lVar5);
    iVar10 = *(int *)(&DAT_14047b42c + 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_140479bf0 +
                          ((longlong)
                           (ulonglong)
                           *(uint *)(param_1 + 0x450 +
                                    (longlong)(((iVar9 - iVar4) + iVar12) % iVar3) * 4) >> 8 & 0xffU
                          ) * 4) ^
                 *(uint *)(&DAT_140479ff0 +
                          (ulonglong)
                          *(byte *)(param_1 + 0x450 +
                                   (longlong)(((iVar10 - iVar4) + iVar12) % iVar3) * 4) * 4) ^
                 *(uint *)(&DAT_1404797f0 +
                          ((longlong)
                           (ulonglong)*(uint *)(param_1 + 0x450 + (longlong)(iVar12 % iVar3) * 4) >>
                           0x10 & 0xffU) * 4) ^
                 *(uint *)(&DAT_1404793f0 +
                          (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_1404782f0)[*(byte *)(lVar5 + 3)] ^ (byte)((uint)uVar2 >> 0x18);
        param_3[1] = (&DAT_1404782f0)
                     [(longlong)
                      (ulonglong)
                      *(uint *)(param_1 + 0x450 + (longlong)((iVar4 + iVar9) % iVar3) * 4) >> 0x10 &
                      0xff] ^ (byte)((uint)uVar2 >> 0x10);
        param_3[2] = (&DAT_1404782f0)
                     [(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_1404782f0)[*(byte *)(param_1 + 0x450 + (longlong)(iVar12 % iVar3) * 4)] ^
                     (byte)uVar2;
        lVar5 = lVar5 + 4;
        param_3 = param_3 + 4;
      } while (lVar7 < lVar11);
    }
    return;
  }
  FUN_140297a40();
  return;
}



ulonglong FUN_1402981e0(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_140297e60(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_140298290(void)

{
  return 0x8534;
}



undefined8 FUN_1402982a0(void)

{
  return 0x8541;
}



void * FUN_1402982b0(void *param_1,uint param_2)

{
  FUN_140385b20();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1
FUN_1402982e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8535);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058470(local_30,param_5[2]);
  FUN_140058670(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402983f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8535);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,param_6[1]);
  FUN_140058470(local_30,param_6[2]);
  FUN_140058670(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140298520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8536);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058470(local_30,param_5[2]);
  FUN_140058470(local_30,param_5[6]);
  FUN_140058470(local_30,param_5[3]);
  FUN_140058870(local_30,*(undefined1 *)(param_5 + 7));
  FUN_140058870(local_30,*(undefined1 *)((longlong)param_5 + 0x1d));
  FUN_140058670(local_30,*(undefined8 *)(param_5 + 4));
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402986b0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x8536);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,param_6[1]);
  FUN_140058470(local_40,param_6[2]);
  FUN_140058470(local_40,param_6[6]);
  FUN_140058470(local_40,param_6[3]);
  FUN_140058870(local_40,*(undefined1 *)(param_6 + 7));
  FUN_140058870(local_40,*(undefined1 *)((longlong)param_6 + 0x1d));
  FUN_140058670(local_40,*(undefined8 *)(param_6 + 4));
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140298850(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8537);
  FUN_140058870(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140298950(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8537);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140298a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8538);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140298b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8538);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_1403859e0(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140298c90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8539);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"RESP_SERVER_LOCK",0x8539);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140298d50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x8539);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"RESP_SERVER_LOCK",0x8539);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140298e20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853a);
  FUN_1403859e0(local_30,param_4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"NOTIFY_STORAGE_ALARM",0x853a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140298f20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853a);
  FUN_1403859e0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140299020(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853b);
  FUN_1403859e0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_1403a17c0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"NOTIFY_MAIL_ALARM",0x853b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140299130(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853b);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_1403a17c0(local_30,param_7);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140299250(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853c);
  FUN_140058470(local_30,*param_4);
  FUN_140058770(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_STATISTICS",0x853c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140299340(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853c);
  FUN_140058470(local_30,*param_5);
  FUN_140058770(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_STATISTICS",0x853c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140299440(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853d);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SERVER_STEP",0x853d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140299520(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853d);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140299600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853e);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MESSAGE",0x853e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402996f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853e);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MESSAGE",0x853e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402997e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853f);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402998c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x853f);
  FUN_140058470(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402999a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140299a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(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_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_140299b30(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_1405d84f0 ^ (ulonglong)auStack_3f8;
  iVar2 = param_2[10];
  if (iVar2 == 0) {
    FUN_140385b50(param_1,0);
  }
  iVar13 = *param_2;
  cVar5 = FUN_140384a90(param_2,local_278);
  if (cVar5 == '\0') {
switchD_140299bd4_default:
    FUN_140383db0(param_2,(int)((iVar13 >> 0x1f & 7U) + iVar13) >> 3);
    return 0;
  }
  local_2e0 = param_3;
  switch(local_278[0]) {
  case 0x84d1:
    FUN_14035b390(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_14029cae0(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_140299fcf;
      local_3d8 = (undefined8 *******)&DAT_140477960;
      (**(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_140299fcf;
      FUN_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_360 = (longlong *******)PTR_DAT_1405d8010;
      FUN_140017720(&local_360,L"<Array %d>",((longlong)local_398 - (longlong)local_3a0) / 0xa0);
      FUN_140017520(&local_3b8,&local_360);
      ppppppplVar4 = local_360;
      if (((local_360 != (longlong *******)0x0) &&
          (local_360 != (longlong *******)PTR_DAT_1405d8010)) &&
         (ppppppuVar10 = local_360 + -1, ppppppuVar10 != (undefined8 ******)0x0)) {
        ppppppuVar9 = (undefined8 ******)FUN_14034fe70();
        local_360 = (longlong *******)ppppppuVar9;
        FUN_14034ed40(ppppppuVar9);
        local_358 = 1;
        piVar1 = (int *)((longlong)ppppppplVar4 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(ppppppuVar10);
        }
        FUN_14034edd0(ppppppuVar9);
      }
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      pppppppuVar14 = local_3b8;
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_1400174a0(&local_3b8,&local_218,iVar13 + -2);
      if (pppppppuVar14 == (undefined8 *******)0x0) {
        pppppppuVar14 = (undefined8 *******)PTR_DAT_1405d8010;
      }
      local_3b8 = pppppppuVar14;
      if ((undefined8 *******)*local_360 != pppppppuVar14) {
        ppppppuVar10 = (undefined8 ******)FUN_14034fe70();
        local_370 = ppppppuVar10;
        FUN_14034ed40(ppppppuVar10);
        local_368 = 1;
        if (((pppppppuVar14 != (undefined8 *******)0x0) &&
            (pppppppuVar14 != (undefined8 *******)PTR_DAT_1405d8010)) &&
           (pppppppuVar14 + -1 != (undefined8 *******)0x0)) {
          uVar12 = FUN_14034fe70();
          local_348 = uVar12;
          FUN_14034ed40(uVar12);
          local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(pppppppuVar14 + -1);
          }
          FUN_14034edd0(uVar12);
        }
        pppppppuVar14 = (undefined8 *******)*local_360;
        if (((pppppppuVar14 != (undefined8 *******)PTR_DAT_1405d8010) &&
            (pppppppuVar14 != (undefined8 *******)0x0)) &&
           (pppppppuVar14 != (undefined8 *******)0x8)) {
          *(int *)((longlong)pppppppuVar14 + -4) = *(int *)((longlong)pppppppuVar14 + -4) + 1;
        }
        local_3b8 = pppppppuVar14;
        FUN_14034edd0(ppppppuVar10);
      }
      if (((local_218 != (undefined *)0x0) && (local_218 != PTR_DAT_1405d8010)) &&
         (local_218 + -8 != (undefined *)0x0)) {
        uVar12 = FUN_14034fe70();
        local_348 = uVar12;
        FUN_14034ed40(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        piVar1 = (int *)(local_218 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_218 + -8);
        }
        FUN_14034edd0(uVar12);
      }
      local_360 = (longlong *******)&local_2b8;
      local_218 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_2b8 = (undefined8 *******)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_2b8 = pppppppuVar15;
      }
      if (pppppppuVar14 != (undefined8 *******)PTR_DAT_1405d8010) {
        uVar12 = FUN_14034fe70();
        local_348 = uVar12;
        FUN_14034ed40(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        FUN_1400031d0(&local_2b8);
        if (((pppppppuVar14 != (undefined8 *******)PTR_DAT_1405d8010) &&
            (pppppppuVar14 != (undefined8 *******)0x0)) &&
           (pppppppuVar14 != (undefined8 *******)0x8)) {
          *(int *)((longlong)pppppppuVar14 + -4) = *(int *)((longlong)pppppppuVar14 + -4) + 1;
        }
        local_2b8 = pppppppuVar14;
        FUN_14034edd0(uVar12);
      }
      FUN_14034fe70();
      local_220 = PTR_DAT_1405d8010;
      uVar6 = FUN_14034fcf0(L"PT_SERVER_OPTIONS");
      uVar12 = FUN_140002f00(&local_220,uVar6);
      FUN_14034fd20(uVar12,L"PT_SERVER_OPTIONS",uVar6);
      FUN_140002fe0(&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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0x84d1,L"PT_SERVER_OPTIONS");
      if (((pppppppuVar14 != (undefined8 *******)0x0) &&
          (pppppppuVar14 != (undefined8 *******)PTR_DAT_1405d8010)) &&
         (pppppppuVar14 + -1 != (undefined8 *******)0x0)) {
        uVar12 = FUN_14034fe70();
        local_348 = uVar12;
        FUN_14034ed40(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(pppppppuVar14 + -1);
        }
        FUN_14034edd0(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_140299fcf:
    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_14012d9d0(pvVar11);
    }
    operator_delete(local_3a0);
    return 1;
  case 0x84d2:
    FUN_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_1403840e0(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_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d2,L"PT_SERVER_COMMAND");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0 + 4);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_1400174a0(&local_3b8,&local_210,iVar13 + -2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        uVar12 = FUN_14034fe70();
        local_348 = uVar12;
        FUN_14034ed40(uVar12);
        pppppppuVar14 = local_3b8;
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          ppppppuVar10 = (undefined8 ******)FUN_14034fe70();
          local_370 = ppppppuVar10;
          FUN_14034ed40(ppppppuVar10);
          local_368 = 1;
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(pppppppuVar15);
          }
          FUN_14034edd0(ppppppuVar10);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(uVar12);
      }
      if (((local_210 != (undefined *)0x0) && (local_210 != PTR_DAT_1405d8010)) &&
         (local_210 + -8 != (undefined *)0x0)) {
        uVar12 = FUN_14034fe70();
        local_348 = uVar12;
        FUN_14034ed40(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        piVar1 = (int *)(local_210 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_210 + -8);
        }
        FUN_14034edd0(uVar12);
      }
      local_360 = (longlong *******)&local_2a0;
      local_210 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_2a0 = (undefined8 *******)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_2a0 = (undefined8 *******)0x0;
      }
      if (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) {
        uVar12 = FUN_14034fe70();
        local_348 = uVar12;
        FUN_14034ed40(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_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(uVar12);
      }
      FUN_14034fe70();
      local_228 = PTR_DAT_1405d8010;
      uVar6 = FUN_14034fcf0(L"PT_SERVER_COMMAND");
      uVar12 = FUN_140002f00(&local_228,uVar6);
      FUN_14034fd20(uVar12,L"PT_SERVER_COMMAND",uVar6);
      FUN_140002fe0(&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_1405d8010;
      }
      (**(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_1405d8010)) &&
         (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
        uVar12 = FUN_14034fe70();
        local_348 = uVar12;
        FUN_14034ed40(uVar12);
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(pppppppuVar15);
        }
        FUN_14034edd0(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_14029a450;
  case 0x84d3:
    FUN_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_1403840e0(param_2,local_3b0,4);
    FUN_14034fe70();
    local_370 = (undefined8 ******)PTR_DAT_1405d8010;
    thunk_FUN_140385220(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_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d3,L"PT_SERVER_NOTICE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0 + 4);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1d20(&local_3b8,&local_370);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      DVar8 = DVar7;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        DVar8 = *(DWORD *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_1400174a0(&local_3b8,&local_208,DVar8 - 2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        uVar12 = FUN_14034fe70();
        local_348 = uVar12;
        FUN_14034ed40(uVar12);
        pppppppuVar14 = local_3b8;
        local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          pvVar11 = (void *)FUN_14034fe70();
          local_3a0 = pvVar11;
          FUN_14034ed40(pvVar11);
          local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(pppppppuVar15);
          }
          FUN_14034edd0(pvVar11);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(uVar12);
      }
      if (((local_208 != (undefined *)0x0) && (local_208 != PTR_DAT_1405d8010)) &&
         (local_208 + -8 != (undefined *)0x0)) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)(local_208 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_208 + -8);
        }
        FUN_14034edd0(pvVar11);
      }
      local_360 = (longlong *******)&local_2b0;
      local_208 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_2b0 = (undefined8 *******)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_2b0 = (undefined8 *******)0x0;
      }
      if (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(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_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(pvVar11);
      }
      FUN_14034fe70();
      local_280 = PTR_DAT_1405d8010;
      uVar6 = FUN_14034fcf0(L"PT_SERVER_NOTICE");
      uVar12 = FUN_140002f00(&local_280,uVar6);
      FUN_14034fd20(uVar12,L"PT_SERVER_NOTICE",uVar6);
      FUN_140002fe0(&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_1405d8010;
      }
      (**(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_1405d8010)) &&
         (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(pppppppuVar15);
        }
        FUN_14034edd0(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_1405d8010) {
      return 1;
    }
    ppppppuVar9 = local_370 + -1;
    if (ppppppuVar9 == (undefined8 ******)0x0) {
      return 1;
    }
    pvVar11 = (void *)FUN_14034fe70();
    local_3a0 = pvVar11;
    FUN_14034ed40(pvVar11);
    local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
    piVar1 = (int *)((longlong)ppppppuVar10 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(ppppppuVar9);
    }
    FUN_14034edd0(pvVar11);
    return 1;
  case 0x84d4:
    FUN_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_1403840e0(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_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d4,L"PT_SERVER_CONNECT");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0 + 4);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_1400174a0(&local_3b8,&local_1f8,iVar13 + -2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        pppppppuVar14 = local_3b8;
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          uVar12 = FUN_14034fe70();
          local_348 = uVar12;
          FUN_14034ed40(uVar12);
          local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(pppppppuVar15);
          }
          FUN_14034edd0(uVar12);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(pvVar11);
      }
      if (((local_1f8 != (undefined *)0x0) && (local_1f8 != PTR_DAT_1405d8010)) &&
         (local_1f8 + -8 != (undefined *)0x0)) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)(local_1f8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_1f8 + -8);
        }
        FUN_14034edd0(pvVar11);
      }
      local_360 = (longlong *******)&local_2a8;
      local_1f8 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_2a8 = (undefined8 *******)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_2a8 = (undefined8 *******)0x0;
      }
      if (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(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_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(pvVar11);
      }
      FUN_14034fe70();
      local_230 = PTR_DAT_1405d8010;
      uVar6 = FUN_14034fcf0(L"PT_SERVER_CONNECT");
      uVar12 = FUN_140002f00(&local_230,uVar6);
      FUN_14034fd20(uVar12,L"PT_SERVER_CONNECT",uVar6);
      FUN_140002fe0(&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_1405d8010;
      }
      (**(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_1405d8010)) &&
         (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(pppppppuVar15);
        }
        FUN_14034edd0(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_14029a450;
  case 0x84d5:
    FUN_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_1403840e0(param_2,local_3a8,4);
    FUN_1403840e0(param_2,local_3a8,4);
    FUN_1403840e0(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_140477960;
        (**(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_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1a60(&local_3b8,&local_378);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1a60(&local_3b8,local_3b0 + 4);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_1400174a0(&local_3b8,&local_200,iVar13 + -2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        pppppppuVar14 = local_3b8;
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          uVar12 = FUN_14034fe70();
          local_348 = uVar12;
          FUN_14034ed40(uVar12);
          local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(pppppppuVar15);
          }
          FUN_14034edd0(uVar12);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(pvVar11);
      }
      if (((local_200 != (undefined *)0x0) && (local_200 != PTR_DAT_1405d8010)) &&
         (local_200 + -8 != (undefined *)0x0)) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)(local_200 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_200 + -8);
        }
        FUN_14034edd0(pvVar11);
      }
      local_360 = (longlong *******)&local_298;
      local_200 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_298 = (undefined8 *******)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_298 = (undefined8 *******)0x0;
      }
      if (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(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_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(pvVar11);
      }
      FUN_14034fe70();
      local_260 = PTR_DAT_1405d8010;
      uVar6 = FUN_14034fcf0(L"PT_CHANNEL_STATUS_CHANGE");
      uVar12 = FUN_140002f00(&local_260,uVar6);
      FUN_14034fd20(uVar12,L"PT_CHANNEL_STATUS_CHANGE",uVar6);
      FUN_140002fe0(&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_1405d8010;
      }
      (**(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_1405d8010)) &&
         (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        piVar1 = (int *)((longlong)pppppppuVar14 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(pppppppuVar15);
        }
        FUN_14034edd0(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_14029a450;
  case 0x84d6:
    FUN_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_14034fe70();
    local_370 = (undefined8 ******)PTR_DAT_1405d8010;
    thunk_FUN_140385220(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_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d6,L"PT_USER_KICK");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1d20(&local_3b8,&local_370);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      local_360 = (longlong *******)FUN_1400174a0(&local_3b8,local_1c8,iVar13 + -2);
      if (local_3b8 == (undefined8 *******)0x0) {
        local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      }
      if ((undefined8 *******)*local_360 != local_3b8) {
        pvVar11 = (void *)FUN_14034fe70();
        local_3a0 = pvVar11;
        FUN_14034ed40(pvVar11);
        pppppppuVar14 = local_3b8;
        local_398 = (wchar_t *)CONCAT71(local_398._1_7_,1);
        if (((local_3b8 != (undefined8 *******)0x0) &&
            (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) &&
           (pppppppuVar15 = local_3b8 + -1, pppppppuVar15 != (undefined8 *******)0x0)) {
          uVar12 = FUN_14034fe70();
          local_348 = uVar12;
          FUN_14034ed40(uVar12);
          local_340 = (wchar_t *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)pppppppuVar14 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(pppppppuVar15);
          }
          FUN_14034edd0(uVar12);
        }
        local_3b8 = (undefined8 *******)*local_360;
        if (((local_3b8 != (undefined8 *******)PTR_DAT_1405d8010) &&
            (local_3b8 != (undefined8 *******)0x0)) && (local_3b8 != (undefined8 *******)0x8)) {
          *(int *)((longlong)local_3b8 + -4) = *(int *)((longlong)local_3b8 + -4) + 1;
        }
        FUN_14034edd0(pvVar11);
      }
      FUN_1400031d0(local_1c8);
      local_360 = &local_270;
      FUN_14034fe70();
      local_270 = (longlong ******)PTR_DAT_1405d8010;
      FUN_140003100(&local_270,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_1403840e0(param_2,local_3a8,4);
    FUN_1403840e0(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_140477960;
        (**(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_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,&local_378);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1a60(&local_3b8,local_3b0);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      DVar8 = DVar7;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        DVar8 = *(DWORD *)(local_3b8 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3b8,local_1c0,DVar8 - 2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1c0);
      local_360 = &local_250;
      FUN_14034fe70();
      local_250 = (longlong ******)PTR_DAT_1405d8010;
      FUN_140003100(&local_250,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14029a450;
  case 0x84d8:
    FUN_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_14034fe70();
    local_370 = (undefined8 ******)PTR_DAT_1405d8010;
    thunk_FUN_140385220(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_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84d8,L"PT_STRING_COMMAND");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1d20(&local_3b8,&local_370);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3b8,local_1b0,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1b0);
      local_360 = &local_240;
      FUN_14034fe70();
      local_240 = (longlong ******)PTR_DAT_1405d8010;
      FUN_140003100(&local_240,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    FUN_1403840e0(param_2,local_350,1);
    FUN_1403840e0(param_2,local_3a8,4);
    DVar7 = 0;
    local_158 = 0;
    memset(local_150,0,0x100);
    FUN_14011e4a0(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_140477960;
        (**(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_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a18c0(&local_3b8,(undefined4 *)((longlong)&local_378 + 4));
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1a60(&local_3b8,local_3b0);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_14011e3f0(&local_3b8,&local_158);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      DVar8 = DVar7;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        DVar8 = *(DWORD *)(local_3b8 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3b8,local_1f0,DVar8 - 2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1f0);
      local_360 = &local_258;
      FUN_14034fe70();
      local_258 = (longlong ******)PTR_DAT_1405d8010;
      FUN_140003100(&local_258,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14029a450:
    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_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_1403840e0(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3a8[0];
    }
    FUN_14034fe70();
    local_370 = (undefined8 ******)PTR_DAT_1405d8010;
    thunk_FUN_140385220(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_140477960;
        (**(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_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1d20(&local_3b8,&local_370);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3b8,local_1d0,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1d0);
      local_360 = &local_238;
      FUN_14034fe70();
      local_238 = (longlong ******)PTR_DAT_1405d8010;
      FUN_140003100(&local_238,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_1403840e0(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3a8[0];
    }
    FUN_14034fe70();
    local_370 = (undefined8 ******)PTR_DAT_1405d8010;
    thunk_FUN_140385220(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_140477960;
        (**(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_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1d20(&local_3b8,&local_370);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3b8,local_1d8,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1d8);
      local_360 = &local_248;
      FUN_14034fe70();
      local_248 = (longlong ******)PTR_DAT_1405d8010;
      FUN_140003100(&local_248,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_1403840e0(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3a8[0];
    }
    FUN_14034fe70();
    local_370 = (undefined8 ******)PTR_DAT_1405d8010;
    thunk_FUN_140385220(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_140477960;
        (**(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_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1d20(&local_3b8,&local_370);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3b8,local_1b8,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1b8);
      local_360 = &local_268;
      FUN_14034fe70();
      local_268 = (longlong ******)PTR_DAT_1405d8010;
      FUN_140003100(&local_268,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_1403840e0(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._4_4_ = local_3a8[0];
    }
    FUN_14034fe70();
    local_360 = (longlong *******)PTR_DAT_1405d8010;
    thunk_FUN_140385220(param_2,&local_360);
    cVar5 = FUN_1403840e0(param_2,&local_370,4);
    if (cVar5 != '\0') {
      local_378._0_4_ = local_370._0_4_;
    }
    cVar5 = FUN_1403840e0(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_140477960;
        (**(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_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0 + 4);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1d20(&local_3b8,&local_360);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1a60(&local_3b8,&local_378);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1a60(&local_3b8,local_3b0);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3b8,local_1e8,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1e8);
      local_370 = &local_288;
      FUN_14034fe70();
      local_288 = (undefined8 *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_288,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14029c9c2;
  case 0x84de:
    FUN_14035b390(local_318);
    local_314 = param_2[10];
    local_318[0] = (undefined1)param_2[0x10];
    cVar5 = FUN_1403840e0(param_2,&local_3b8,4);
    if (cVar5 != '\0') {
      local_3b0._4_4_ = local_3b8._0_4_;
    }
    cVar5 = FUN_1403840e0(param_2,&local_370,4);
    if (cVar5 != '\0') {
      local_378._0_4_ = local_370._0_4_;
    }
    cVar5 = FUN_1403840e0(param_2,local_3a8,4);
    if (cVar5 != '\0') {
      local_3b0._0_4_ = local_3a8[0];
    }
    FUN_14034fe70();
    local_360 = (longlong *******)PTR_DAT_1405d8010;
    thunk_FUN_140385220(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_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x84de,L"PWE_REQ_NOTICE");
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3b8 = (undefined8 *******)PTR_DAT_1405d8010;
      FUN_1403a1a60(&local_3b8,local_3b0 + 4);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1a60(&local_3b8,&local_378);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1a60(&local_3b8,local_3b0);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      FUN_1403a1d20(&local_3b8,&local_360);
      FUN_140017790(&local_3b8,&DAT_14047edb0);
      iVar13 = 0;
      if ((local_3b8 != (undefined8 *******)0x0) &&
         (local_3b8 != (undefined8 *******)PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_3b8 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3b8,local_1e0,iVar13 + -2);
      FUN_140003100(&local_3b8,uVar12);
      FUN_1400031d0(local_1e0);
      local_370 = &local_290;
      FUN_14034fe70();
      local_290 = (undefined8 *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_290,&local_3b8);
      uVar12 = FUN_140003060(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_1405d8010;
      }
      (**(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_14029c9c2:
    pppppppuVar14 = &local_360;
    break;
  default:
    goto switchD_140299bd4_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_140388ea0();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14029ca80(undefined8 *param_1)

{
  *param_1 = RNP::Agent2ServerStub::vftable;
  FUN_140388ea0();
  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_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_14029cad0(undefined8 *param_1)

{
  *param_1 = RNP::Server2AgentProxy::vftable;
  FUN_140385b20();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14029cae0(undefined8 param_1,undefined8 param_2)

{
  ulonglong uVar1;
  undefined1 auStack_f8 [32];
  uint local_d8 [2];
  undefined8 local_d0;
  undefined8 local_c8;
  undefined4 local_c0;
  undefined1 local_bc;
  undefined8 local_b8;
  undefined8 local_b0;
  undefined1 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_d0 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_f8;
  FUN_1403840e0(param_1,local_d8,4);
  uVar1 = (ulonglong)local_d8[0];
  if (((int)local_d8[0] < 0) || (DAT_1405d8140 <= (int)local_d8[0])) {
    FUN_1403a1730(local_d8[0]);
  }
  FUN_14012def0(param_2,(longlong)(int)local_d8[0]);
  FUN_14029cc50(param_2);
  if (0 < (int)local_d8[0]) {
    do {
      local_c8 = 0;
      local_c0 = 0;
      local_bc = 0;
      local_b8 = 0;
      local_b0 = 0;
      local_a8 = 0;
      local_88 = 7;
      local_90 = 0;
      local_a0 = 0;
      local_60 = 7;
      local_68 = 0;
      local_78 = 0;
      local_38 = 7;
      local_40 = 0;
      local_50 = 0;
      FUN_14011e9c0(param_1,&local_c8);
      FUN_14012dd70(param_2,&local_c8);
      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));
      }
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  return param_1;
}



void FUN_14029cc50(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_14029cce0(lVar1,lVar1);
    lVar1 = param_1[1];
    for (lVar3 = lVar2; lVar3 != lVar1; lVar3 = lVar3 + 0xa0) {
      FUN_14012d9d0(lVar3);
    }
    param_1[1] = lVar2;
  }
  return;
}



undefined4 * FUN_14029cce0(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_1400015e0(param_3 + 10,puVar2 + 8,0,0xffffffffffffffff);
      FUN_1400015e0(param_3 + 0x14,puVar2 + 0x12);
      FUN_1400015e0(param_3 + 0x1e,puVar2 + 0x1c);
      param_3 = param_3 + 0x28;
      puVar1 = puVar2 + 0x26;
      puVar2 = puVar2 + 0x28;
    } while (puVar1 != param_2);
  }
  return param_3;
}



undefined8 FUN_14029cdb0(void)

{
  return 20000;
}



undefined8 FUN_14029cdc0(void)

{
  return 0x4ef7;
}



undefined1
FUN_14029cdd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x4e21);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PU_DUNGEON_OPEN",0x4e21);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029cec0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x4e21);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PU_DUNGEON_OPEN",0x4e21);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029cfb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e22);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_DIRECT_DUNGEON_OPEN",0x4e22);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d0e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e22);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_DIRECT_DUNGEON_OPEN",0x4e22);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d210(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e23);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_DIRECT_PVP",0x4e23);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d300(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e23);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_DIRECT_PVP",0x4e23);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d3f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e24);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_DIRECT_WAR",0x4e24);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d4e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e24);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_DIRECT_WAR",0x4e24);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d5d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e25);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_STAGE_LOAD_COMPLETE",0x4e25);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d6e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e25);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_STAGE_LOAD_COMPLETE",0x4e25);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d7f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e26);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PVP_STAGE_LOAD_COMPLETE",0x4e26
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029d900(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e26);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PVP_STAGE_LOAD_COMPLETE",
                     0x4e26);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029da10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e27);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STAGE_LOAD_COMPLETE",0x4e27);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029daf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e27);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STAGE_LOAD_COMPLETE",0x4e27);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029dbd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x4e28);
  local_48 = *param_4;
  uStack_44 = param_4[1];
  uStack_40 = param_4[2];
  uStack_3c = param_4[3];
  FUN_140090370(local_38,&local_48);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PU_REQ_LOAD_CHAR",0x4e28);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029dce0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x4e28);
  local_48 = *param_5;
  uStack_44 = param_5[1];
  uStack_40 = param_5[2];
  uStack_3c = param_5[3];
  FUN_140090370(local_38,&local_48);
  local_48 = *param_6;
  uStack_44 = param_6[1];
  uStack_40 = param_6[2];
  uStack_3c = param_6[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PU_REQ_LOAD_CHAR",0x4e28);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029ddf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e29);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_DUNGEON_GROUP_ID",0x4e29);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029ded0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e29);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_DUNGEON_GROUP_ID",0x4e29);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029dfb0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *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,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2a);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_DUNGEON_JOIN",0x4e2a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029e150(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 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,undefined4 *param_16,
             undefined4 *param_17)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2a);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058570(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_DUNGEON_JOIN",0x4e2a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029e300(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2b);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_DUNGEON_LEAVE",0x4e2b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029e410(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2b);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_DUNGEON_LEAVE",0x4e2b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14029e530(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2c);
  FUN_1403a17c0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_LOG_SKILL_USE",0x4e2c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029e610(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2c);
  FUN_1403a17c0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_LOG_SKILL_USE",0x4e2c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029e6f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2d);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_OPEN",0x4e2d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029e7d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2d);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_OPEN",0x4e2d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029e8b0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2e);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_OPEN_RESULT",0x4e2e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029e9f0(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,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2e);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_OPEN_RESULT",0x4e2e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029eb40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2f);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_DECISION",0x4e2f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029ec20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e2f);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_DECISION",0x4e2f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029ed00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e30);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_DECISION_RESULT",0x4e30);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029ee40(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,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e30);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_DECISION_RESULT",0x4e30);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029ef90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e31);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_CHANGE",0x4e31);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029f070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e31);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_CHANGE",0x4e31);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029f150(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e32);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_CHANGE_RESULT",0x4e32);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029f240(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e32);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_CHANGE_RESULT",0x4e32);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14029f340(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e33);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_SECOND_CHOICE",0x4e33);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14029f400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e33);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_SECOND_CHOICE",0x4e33);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14029f4d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e34);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_TIME_OUT",0x4e34);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_14029f590(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e34);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_TIME_OUT",0x4e34);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029f660(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             longlong *param_5,longlong *param_6,longlong *param_7,longlong *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e35);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_30,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_30,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_FINISH",0x4e35);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029f870(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             longlong *param_5,longlong *param_6,longlong *param_7,longlong *param_8,
             longlong *param_9)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4e35);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar2 = (undefined4 *)*param_9;
  if (puVar2 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_9[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_CARD_FINISH",0x4e35);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029fa90(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e36);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MISSION_COMPLETE_RESULT",0x4e36);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029fbb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6,undefined1 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e36);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MISSION_COMPLETE_RESULT",0x4e36);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029fcd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e37);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DEC_ARMOR_DURABILITY",0x4e37);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029fdc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e37);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DEC_ARMOR_DURABILITY",0x4e37);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_14029fec0(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             longlong *param_5)

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e38);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RANK_POINT",0x4e38);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0010(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             longlong *param_5,longlong *param_6)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4e38);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RANK_POINT",0x4e38);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e39);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REAL_RANK",0x4e39);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e39);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REAL_RANK",0x4e39);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a03b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3a);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQUEST_RESURRECTION",0x4e3a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3a);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQUEST_RESURRECTION",0x4e3a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3b);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_RESURRECTION",0x4e3b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0670(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3b);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_RESURRECTION",0x4e3b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a0780(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GAME_SCORING_RESULT",0x4e3c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a0840(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3c);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GAME_SCORING_RESULT",0x4e3c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a0910(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RETURN_LOBBY",0x4e3d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a09d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RETURN_LOBBY",0x4e3d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a0aa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STAGE_RETURN_LOBBY",0x4e3e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a0b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STAGE_RETURN_LOBBY",0x4e3e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0c30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_PICKUP",0x4e3f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0d50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e3f);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_PICKUP",0x4e3f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0e70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e40);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_14011a5b0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_PICKUP_RESULT",0x4e40);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a0fc0(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,undefined8 param_10,undefined4 *param_11)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e40);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_14011a5b0(local_30,param_10);
  FUN_140058470(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_PICKUP_RESULT",0x4e40);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1120(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e41);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MSG_BIND_PICKUP",0x4e41);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1220(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e41);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MSG_BIND_PICKUP",0x4e41);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1330(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e42);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MSG_BIND_PICKUP_RESPONSE",0x4e42);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1450(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e42);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_MSG_BIND_PICKUP_RESPONSE",0x4e42)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1570(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined1 *param_14,undefined4 *param_15,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e43);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058870(local_30,*param_14);
  FUN_140058570(local_30,*param_15);
  FUN_140058470(local_30,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_SPAWN",0x4e43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1720(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,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined4 *param_14,undefined1 *param_15,undefined4 *param_16,
             undefined4 *param_17)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e43);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  FUN_140058870(local_30,*param_15);
  FUN_140058570(local_30,*param_16);
  FUN_140058470(local_30,*param_17);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_SPAWN",0x4e43);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a18d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e44);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSTANCE_ITEM_SPAWN_POS",0x4e44);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1a70(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,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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e44);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058570(local_30,*param_10);
  FUN_140058570(local_30,*param_11);
  FUN_140058570(local_30,*param_12);
  FUN_140058570(local_30,*param_13);
  FUN_140058570(local_30,*param_14);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSTANCE_ITEM_SPAWN_POS",0x4e44);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1c20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e45);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140385940(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSTANCE_ITEM_SPAWN",0x4e45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1d50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e45);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140385940(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSTANCE_ITEM_SPAWN",0x4e45);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1e80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e46);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSTANCE_ITEM_PICKUP",0x4e46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a1f60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e46);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSTANCE_ITEM_PICKUP",0x4e46);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2040(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e47);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSTANCE_ITEM_PICKUP_RESULT",0x4e47
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e47);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSTANCE_ITEM_PICKUP_RESULT",
                     0x4e47);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e48);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSTANCE_ITEM_DEL_COUNT",0x4e48);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e48);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSTANCE_ITEM_DEL_COUNT",0x4e48);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e49);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSTANCE_ITEM_DEL",0x4e49);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2550(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e49);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSTANCE_ITEM_DEL",0x4e49);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2630(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_PICKUP_SHARE_RULE",0x4e4a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2750(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4a);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_PICKUP_SHARE_RULE",0x4e4a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2870(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4b);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_PICKUP_SHARE",0x4e4b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2970(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4b);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_PICKUP_SHARE",0x4e4b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4c);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DROP_ITEM_SHOW",0x4e4c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4c);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DROP_ITEM_SHOW",0x4e4c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4d);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_ROOM_JOIN",0x4e4d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a2d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4d);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_ROOM_JOIN",0x4e4d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a2e00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_ROOM_LEAVE",0x4e4e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a2ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_ROOM_LEAVE",0x4e4e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a2f90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_ROOM_REMOVE",0x4e4f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a3050(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e4f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_ROOM_REMOVE",0x4e4f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a3120(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e50);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_PORTAL_WAIT",0x4e50);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a31e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e50);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_PORTAL_WAIT",0x4e50);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a32b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e51);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_ACTIVE_CONTROL",0x4e51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3390(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e51);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_ACTIVE_CONTROL",0x4e51);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3470(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e52);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_SET_NPC_DIALOG_TEXTID",0x4e52);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e52);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_SET_NPC_DIALOG_TEXTID",0x4e52);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a3660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e53);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_SET_DIALOG_SPRITE",0x4e53);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e53);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_SET_DIALOG_SPRITE",0x4e53);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e54);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_SET_DIALOG_TEXTID",0x4e54);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3900(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e54);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_SET_DIALOG_TEXTID",0x4e54);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a39e0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e55);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_SET_DIALOG_SPEECH_TIME",0x4e55);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3ae0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e55);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_SET_DIALOG_SPEECH_TIME",0x4e55);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3bf0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e56);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_SHOW_DIR_ARROW",0x4e56);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3cd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e56);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_SHOW_DIR_ARROW",0x4e56);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3db0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e57);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_JUMP_DOWN_ATTACK_LANDING",0x4e57);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e57);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_JUMP_DOWN_ATTACK_LANDING",0x4e57)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a3fd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e58);
  FUN_140385940(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_CLOSE_WINDOW",0x4e58);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a40c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e58);
  FUN_140385940(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_CLOSE_WINDOW",0x4e58);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a41b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e59);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_ITEM_OPTION_EFFECT",0x4e59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a42b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e59);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_ITEM_OPTION_EFFECT",0x4e59);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a43c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e5a);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_ITEM_OPTION_EFFECT_CONDITION",
                     0x4e5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a44c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e5a);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_ITEM_OPTION_EFFECT_CONDITION",
                     0x4e5a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a45d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5b);
  uVar1 = param_4[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_4[3]) {
    param_4 = (undefined8 *)*param_4;
  }
  FUN_1403857a0(local_88,param_4,uVar1 & 0xffffffff);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_88,L"PU_SET_MINIMAP_CHANGE",0x4e5b);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a46f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5b);
  uVar1 = param_5[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_5[3]) {
    param_5 = (undefined8 *)*param_5;
  }
  FUN_1403857a0(local_88,param_5,uVar1 & 0xffffffff);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_88,L"PU_SET_MINIMAP_CHANGE",0x4e5b);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a4810(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5c);
  uVar1 = param_4[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_4[3]) {
    param_4 = (undefined8 *)*param_4;
  }
  FUN_1403857a0(local_88,param_4,uVar1 & 0xffffffff);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_88,L"PU_SET_MAP_CHANGE",0x4e5c);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a4930(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5c);
  uVar1 = param_5[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_5[3]) {
    param_5 = (undefined8 *)*param_5;
  }
  FUN_1403857a0(local_88,param_5,uVar1 & 0xffffffff);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_88,L"PU_SET_MAP_CHANGE",0x4e5c);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a4a50(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined1 *param_5)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5d);
  uVar1 = param_4[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_4[3]) {
    param_4 = (undefined8 *)*param_4;
  }
  FUN_1403857a0(local_88,param_4,uVar1 & 0xffffffff);
  FUN_140058870(local_88,*param_5);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_88,L"PU_SET_MINIMAP_ICON_LOOP",0x4e5d);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a4b80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined1 *param_6)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5d);
  uVar1 = param_5[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_5[3]) {
    param_5 = (undefined8 *)*param_5;
  }
  FUN_1403857a0(local_88,param_5,uVar1 & 0xffffffff);
  FUN_140058870(local_88,*param_6);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_88,L"PU_SET_MINIMAP_ICON_LOOP",0x4e5d);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a4cc0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined4 *param_5)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5e);
  uVar1 = param_4[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_4[3]) {
    param_4 = (undefined8 *)*param_4;
  }
  FUN_1403857a0(local_88,param_4,uVar1 & 0xffffffff);
  FUN_140058470(local_88,*param_5);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_88,L"PU_SET_MINIMAP_ICON_TYPE",0x4e5e);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a4df0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined4 *param_6)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5e);
  uVar1 = param_5[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_5[3]) {
    param_5 = (undefined8 *)*param_5;
  }
  FUN_1403857a0(local_88,param_5,uVar1 & 0xffffffff);
  FUN_140058470(local_88,*param_6);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_88,L"PU_SET_MINIMAP_ICON_TYPE",0x4e5e);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a4f30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined4 *param_5,undefined4 *param_6)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5f);
  uVar1 = param_4[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_4[3]) {
    param_4 = (undefined8 *)*param_4;
  }
  FUN_1403857a0(local_88,param_4,uVar1 & 0xffffffff);
  FUN_140058470(local_88,*param_5);
  FUN_140058470(local_88,*param_6);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_88,L"PU_SET_MINIMAP_ICON_PLAY_POS",0x4e5f);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a5080(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined4 *param_6,undefined4 *param_7)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e5f);
  uVar1 = param_5[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_5[3]) {
    param_5 = (undefined8 *)*param_5;
  }
  FUN_1403857a0(local_88,param_5,uVar1 & 0xffffffff);
  FUN_140058470(local_88,*param_6);
  FUN_140058470(local_88,*param_7);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_88,L"PU_SET_MINIMAP_ICON_PLAY_POS",0x4e5f
                    );
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a51d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined1 *param_7)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined4 local_res10 [2];
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  local_res10[0] = param_2;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e60);
  uVar1 = param_4[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_4[3]) {
    param_4 = (undefined8 *)*param_4;
  }
  FUN_1403857a0(local_88,param_4,uVar1 & 0xffffffff);
  FUN_140058470(local_88,*param_5);
  FUN_140058470(local_88,*param_6);
  FUN_140058870(local_88,*param_7);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_88,L"PU_SET_MINIMAP_ICON",0x4e60);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1402a5330(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,undefined4 *param_6,undefined4 *param_7,undefined1 *param_8)

{
  ulonglong uVar1;
  undefined1 uVar2;
  undefined1 local_88 [8];
  undefined1 local_80 [8];
  longlong local_78;
  int local_6c;
  undefined8 local_60;
  undefined1 local_58 [80];
  
  local_60 = 0xfffffffffffffffe;
  FUN_1403841b0(local_88);
  FUN_140383c40(local_88);
  FUN_140017c50(local_88,0x4e60);
  uVar1 = param_5[2];
  if (0x7fffffff < uVar1) {
    FUN_14034f420(local_58,L"WriteString failed! length=%I64d",uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (0xf < (ulonglong)param_5[3]) {
    param_5 = (undefined8 *)*param_5;
  }
  FUN_1403857a0(local_88,param_5,uVar1 & 0xffffffff);
  FUN_140058470(local_88,*param_6);
  FUN_140058470(local_88,*param_7);
  FUN_140058870(local_88,*param_8);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_88,L"PU_SET_MINIMAP_ICON",0x4e60);
  FUN_140399690(local_80);
  if ((local_78 != 0) && (local_6c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1 FUN_1402a5490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e61);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GAME_RESTART",0x4e61);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a5550(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e61);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GAME_RESTART",0x4e61);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5620(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e62);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_RESTART",0x4e62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5710(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e62);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_RESTART",0x4e62);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5810(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e63);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_RESTART_FAIL",0x4e63);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a58f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e63);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_RESTART_FAIL",0x4e63);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a59d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e64);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_DIFFERENT_WORLD_START",
                     0x4e64);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5ac0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e64);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_DIFFERENT_WORLD_START",
                     0x4e64);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5bc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e65);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_QUESTION_BOX_RESPONSE",0x4e65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5ca0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e65);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_QUESTION_BOX_RESPONSE",0x4e65);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5d80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e66);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RARE_CARD",0x4e66);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5e60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e66);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RARE_CARD",0x4e66);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a5f40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e67);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CHANGE_COMBO",0x4e67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a6020(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e67);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CHANGE_COMBO",0x4e67);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a6100(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e68);
  FUN_140058470(local_30,*param_4);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_TRIGGER_ACTION",0x4e68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a61f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e68);
  FUN_140058470(local_30,*param_5);
  FUN_140385940(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_TRIGGER_ACTION",0x4e68);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a62e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e69);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_CHANNEL_CHANGE",0x4e69);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a63c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e69);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_CHANNEL_CHANGE",0x4e69);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a64a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_BATTLE_INFO",0x4e6a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_BATTLE_INFO",0x4e6a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6630(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PROCESS_FREEZING",0x4e6b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a66f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6b);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PROCESS_FREEZING",0x4e6b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a67c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6c);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"RESP_PROCESS_FREEZING",0x4e6c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a68b0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6c);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"RESP_PROCESS_FREEZING",0x4e6c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a69b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIVE_UP_RECOVERY",0x4e6d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6a70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6d);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_GIVE_UP_RECOVERY",0x4e6d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6b40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RECOVERY",0x4e6e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6c00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6e);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RECOVERY",0x4e6e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6cd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_CHANNEL_JOIN",0x4e6f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6d90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e6f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_CHANNEL_JOIN",0x4e6f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6e60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e70);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_CHANNEL_LEAVE",0x4e70);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a6f20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e70);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_CHANNEL_LEAVE",0x4e70);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a6ff0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e71);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_BATTLE_ROOM_LIST",0x4e71);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a70d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e71);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_BATTLE_ROOM_LIST",0x4e71);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a71b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e72);
  FUN_14011dfa0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_INFO",0x4e72);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a7290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e72);
  FUN_14011dfa0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_INFO",0x4e72);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a7370(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4e73);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0xb0);
  lVar2 = *param_4;
  if (lVar2 != param_4[1]) {
    do {
      FUN_140385a20(local_40,lVar2);
      FUN_140385a20(local_40,lVar2 + 0x40);
      FUN_1403a17c0(local_40,lVar2 + 0x80);
      FUN_140058770(local_40,*(undefined8 *)(lVar2 + 0x90));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x98));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x9c));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0xa0));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0xa4));
      FUN_140058870(local_40,*(undefined1 *)(lVar2 + 0xa8));
      FUN_140058870(local_40,*(undefined1 *)(lVar2 + 0xa9));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0xac));
      lVar2 = lVar2 + 0xb0;
    } while (lVar2 != param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_BATTLE_ROOM_INFO_LIST",0x4e73);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a7530(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             longlong *param_5)

{
  undefined1 uVar1;
  longlong lVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4e73);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0xb0);
  lVar2 = *param_5;
  if (lVar2 != param_5[1]) {
    do {
      FUN_140385a20(local_40,lVar2);
      FUN_140385a20(local_40,lVar2 + 0x40);
      FUN_1403a17c0(local_40,lVar2 + 0x80);
      FUN_140058770(local_40,*(undefined8 *)(lVar2 + 0x90));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x98));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0x9c));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0xa0));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0xa4));
      FUN_140058870(local_40,*(undefined1 *)(lVar2 + 0xa8));
      FUN_140058870(local_40,*(undefined1 *)(lVar2 + 0xa9));
      FUN_140058470(local_40,*(undefined4 *)(lVar2 + 0xac));
      lVar2 = lVar2 + 0xb0;
    } while (lVar2 != param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_BATTLE_ROOM_INFO_LIST",0x4e73);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a7700(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e74);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_LIST_END",0x4e74);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a77e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e74);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_LIST_END",0x4e74);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a78c0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined8 param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e75);
  FUN_1403859e0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_CREATE",0x4e75);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a79f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined8 param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e75);
  FUN_1403859e0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_CREATE",0x4e75);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a7b20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e76);
  FUN_1403a17c0(local_30,param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_JOIN",0x4e76);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a7c20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e76);
  FUN_1403a17c0(local_30,param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_JOIN",0x4e76);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a7d30(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e77);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058770(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_JOIN_RESULT",0x4e77);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a7e70(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e77);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058770(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_JOIN_RESULT",0x4e77);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a7fb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e78);
  FUN_140058770(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_LEAVE",0x4e78);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e78);
  FUN_140058770(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_LEAVE",0x4e78);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a8170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e79);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_LEAVE_RESULT",0x4e79);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a8230(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e79);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_LEAVE_RESULT",0x4e79)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a8300(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_QUICK_JOIN",0x4e7a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a83c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7a);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_QUICK_JOIN",0x4e7a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a8490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7b);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PVP_INVITE",0x4e7b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7b);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PVP_INVITE",0x4e7b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a8650(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7c);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PVP_INVITE_REFUSAL",0x4e7c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8730(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7c);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PVP_INVITE_REFUSAL",0x4e7c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8810(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7d);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_PVP_INVITE_LIST",0x4e7d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a88f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7d);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_PVP_INVITE_LIST",0x4e7d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a89d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7e);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058770(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"RESP_PVP_INVITE",0x4e7e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8ad0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7e);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058770(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"RESP_PVP_INVITE",0x4e7e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a8bd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7f);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"RESP_PVP_INVITE_REFUSAL",0x4e7f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8cb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e7f);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"RESP_PVP_INVITE_REFUSAL",0x4e7f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8d90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e80);
  FUN_1402b76d0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"RESP_PVP_INVITE_LIST",0x4e80);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8e80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e80);
  FUN_1402b76d0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"RESP_PVP_INVITE_LIST",0x4e80);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a8f70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e81);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_BATTLE_USER_LIST",0x4e81);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9050(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e81);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_BATTLE_USER_LIST",0x4e81);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9130(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e82);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_4[1]);
  FUN_140058470(local_30,param_4[10]);
  FUN_140058470(local_30,param_4[0xb]);
  FUN_140058770(local_30,*(undefined8 *)(param_4 + 0xc));
  FUN_140058770(local_30,*(undefined8 *)(param_4 + 0xe));
  FUN_1403a17c0(local_30,param_4 + 0x10);
  FUN_140385a20(local_30,param_4 + 2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_USER_INFO",0x4e82);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e82);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_5[1]);
  FUN_140058470(local_30,param_5[10]);
  FUN_140058470(local_30,param_5[0xb]);
  FUN_140058770(local_30,*(undefined8 *)(param_5 + 0xc));
  FUN_140058770(local_30,*(undefined8 *)(param_5 + 0xe));
  FUN_1403a17c0(local_30,param_5 + 0x10);
  FUN_140385a20(local_30,param_5 + 2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_USER_INFO",0x4e82);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a93c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e83);
  FUN_1402b76d0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_USER_INFO_LIST",0x4e83);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a94a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e83);
  FUN_1402b76d0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_USER_INFO_LIST",0x4e83);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9580(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e84);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_USER_LIST_END",0x4e84);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e84);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_USER_LIST_END",0x4e84);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a9740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e85);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PVP_PLAYER_INFO",0x4e85);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e85);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PVP_PLAYER_INFO",0x4e85);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9900(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e86);
  FUN_140058470(local_30,*param_4);
  FUN_140120f40(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_USER_RANK_INFO",0x4e86);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a99f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e86);
  FUN_140058470(local_30,*param_5);
  FUN_140120f40(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_USER_RANK_INFO",0x4e86);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a9ae0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e87);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_PREV_RETURN",0x4e87);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402a9ba0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e87);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_PREV_RETURN",0x4e87);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9c70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e88);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_PREV_RETURN_RESULT",
                     0x4e88);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9d50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e88);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_PREV_RETURN_RESULT",
                     0x4e88);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9e30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e89);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PU_PVP_GROUP_ID",0x4e89);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9f10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e89);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PU_PVP_GROUP_ID",0x4e89);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402a9ff0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8a);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_USER_DISCONNECT",0x4e8a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa0d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8a);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_USER_DISCONNECT",0x4e8a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa1b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8b);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_MASTER",0x4e8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa290(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8b);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_MASTER",0x4e8b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa370(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8c);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_TYPE_CHANGE",0x4e8c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa460(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8c);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_TYPE_CHANGE",0x4e8c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8d);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_TYPE_CHANGE_RESULT",
                     0x4e8d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa640(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8d);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_TYPE_CHANGE_RESULT",
                     0x4e8d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa720(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8e);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PVP_ROOM_SLOT_LOCK",0x4e8e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa840(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8e);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PVP_ROOM_SLOT_LOCK",0x4e8e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aa960(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *param_4,
             longlong *param_5)

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e8f);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,(param_5[1] - *param_5) / 10);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      FUN_140058470(local_30,puVar2[1]);
      FUN_140058870(local_30,*(undefined1 *)(puVar2 + 2));
      FUN_140058870(local_30,*(undefined1 *)((longlong)puVar2 + 9));
      puVar2 = (undefined4 *)((longlong)puVar2 + 10);
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_PVP_ROOM_SLOT_LIST",0x4e8f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aaac0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *param_5,longlong *param_6)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4e8f);
  FUN_140058770(local_40,*param_5);
  FUN_140058470(local_40,(param_6[1] - *param_6) / 10);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140058470(local_40,puVar2[1]);
      FUN_140058870(local_40,*(undefined1 *)(puVar2 + 2));
      FUN_140058870(local_40,*(undefined1 *)((longlong)puVar2 + 9));
      puVar2 = (undefined4 *)((longlong)puVar2 + 10);
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_RESP_PVP_ROOM_SLOT_LIST",0x4e8f);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aac20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e90);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_PVP_ROOM_SLOT_LOCK",0x4e90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aad40(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e90);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_PVP_ROOM_SLOT_LOCK",0x4e90);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aae60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e91);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_PVP_ROOM_SLOT_ENTER",0x4e91);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aaf60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e91);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_PVP_ROOM_SLOT_ENTER",0x4e91)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab070(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e92);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_PVP_ROOM_SLOT_LEAVE",0x4e92);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e92);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_PVP_ROOM_SLOT_LEAVE",0x4e92)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e93);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_PVP_ROOM_MAX_PLAYERCOUNT",
                     0x4e93);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab340(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e93);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_PVP_ROOM_MAX_PLAYERCOUNT",
                     0x4e93);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab420(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e94);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_MAP_CHANGE",0x4e94);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e94);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_MAP_CHANGE",0x4e94);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab610(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e95);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_MAP_CHANGE_RESULT",
                     0x4e95);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab6f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e95);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_MAP_CHANGE_RESULT",
                     0x4e95);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab7d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e96);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_USER_COUNT",0x4e96);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab8b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e96);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_USER_COUNT",0x4e96);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ab990(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e97);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_KICK",0x4e97);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aba80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e97);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_KICK",0x4e97);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402abb80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e98);
  FUN_140058770(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_GAME_READY",0x4e98);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402abc60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e98);
  FUN_140058770(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_GAME_READY",0x4e98);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402abd40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e99);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_LEAVE_USER",0x4e99);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402abe20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e99);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_LEAVE_USER",0x4e99);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402abf00(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9a);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_READY_CHANGE",0x4e9a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402abff0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9a);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_READY_CHANGE",0x4e9a)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ac0f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9b);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_CHANGE_TEAM_RQ",0x4e9b)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ac1e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9b);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_CHANGE_TEAM_RQ",
                     0x4e9b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ac2e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9c);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_CHANGE_TEAM",0x4e9c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ac3e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9c);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_CHANGE_TEAM",0x4e9c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ac4f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9d);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_CHANGE_LEADER_RQ",0x4e9d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ac5e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9d);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_CHANGE_LEADER_RQ",0x4e9d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ac6e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9e);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_CHANGE_LEADER_RESULT",0x4e9e
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ac7d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9e);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_CHANGE_LEADER_RESULT",
                     0x4e9e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402ac8d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ENTER_CHANEL",0x4e9f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402ac990(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4e9f);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ENTER_CHANEL",0x4e9f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aca60(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea0);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_START",0x4ea0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402acb60(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea0);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_START",0x4ea0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402acc70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea1);
  FUN_1403a17c0(local_30,param_4);
  FUN_140058770(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_RAID",0x4ea1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402acdb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea1);
  FUN_1403a17c0(local_30,param_5);
  FUN_140058770(local_30,*param_6);
  FUN_1403859e0(local_30,param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_RAID",0x4ea1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402acef0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_GAME_WAIT",0x4ea2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402acfb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_GAME_WAIT",0x4ea2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402ad080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_GAME_WAIT_SETTING_END",
                     0x4ea3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402ad140(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     L"PT_BATTLE_ROOM_GAME_WAIT_SETTING_END",0x4ea3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ad210(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea4);
  FUN_140058770(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_GAME_START",0x4ea4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ad2f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea4);
  FUN_140058770(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_GAME_START",0x4ea4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ad3d0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea5);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_STATUS_TRANS",0x4ea5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ad4f0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined1 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea5);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_STATUS_TRANS",0x4ea5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ad610(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea6);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_SKILL_TRANS",0x4ea6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ad710(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6,undefined4 *param_7)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea6);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_SKILL_TRANS",0x4ea6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402ad820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_PLAY_WAIT",0x4ea7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402ad8e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_GAME_PLAY_WAIT",0x4ea7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402ad9b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_PLAY_START",0x4ea8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402ada70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_GAME_PLAY_START",0x4ea8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402adb40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_PLAY_END",0x4ea9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402adc00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ea9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_GAME_PLAY_END",0x4ea9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402adcd0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined8 param_5,undefined4 *param_6,undefined1 *param_7,undefined4 *param_8,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eaa);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140120f40(local_30,param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_PLAY_RESULT",0x4eaa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ade50(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined4 *param_7,undefined1 *param_8,
             undefined4 *param_9,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eaa);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058470(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  FUN_140120f40(local_30,param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_GAME_PLAY_RESULT",0x4eaa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ae010(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eab);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_PVP_DEATH",0x4eab);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ae110(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eab);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_PVP_DEATH",0x4eab);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ae220(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined1 *param_8,
             undefined8 param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined1 *param_13,undefined4 *param_14,undefined4 *param_15,undefined4 *param_16,
             undefined4 *param_17,undefined1 *param_18)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eac);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_1403859e0(local_30,param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140058870(local_30,*param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,param_14[1]);
  FUN_140058470(local_30,param_14[10]);
  FUN_140058470(local_30,param_14[0xb]);
  FUN_140058770(local_30,*(undefined8 *)(param_14 + 0xc));
  FUN_140058770(local_30,*(undefined8 *)(param_14 + 0xe));
  FUN_1403a17c0(local_30,param_14 + 0x10);
  FUN_140385a20(local_30,param_14 + 2);
  FUN_140058570(local_30,*param_15);
  FUN_140058570(local_30,*param_16);
  FUN_140058570(local_30,*param_17);
  FUN_140058870(local_30,*param_18);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_USER_INFO",0x4eac);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ae440(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 *param_9,undefined8 param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined1 *param_14,undefined4 *param_15,undefined4 *param_16,
             undefined4 *param_17,undefined4 *param_18,undefined1 *param_19)

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4eac);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,*param_8);
  FUN_140058870(local_40,*param_9);
  FUN_1403859e0(local_40,param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,*param_13);
  FUN_140058870(local_40,*param_14);
  FUN_140058470(local_40,*param_15);
  FUN_140058470(local_40,param_15[1]);
  FUN_140058470(local_40,param_15[10]);
  FUN_140058470(local_40,param_15[0xb]);
  FUN_140058770(local_40,*(undefined8 *)(param_15 + 0xc));
  FUN_140058770(local_40,*(undefined8 *)(param_15 + 0xe));
  FUN_1403a17c0(local_40,param_15 + 0x10);
  FUN_140385a20(local_40,param_15 + 2);
  FUN_140058570(local_40,*param_16);
  FUN_140058570(local_40,*param_17);
  FUN_140058570(local_40,*param_18);
  FUN_140058870(local_40,*param_19);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_BATTLE_ROOM_USER_INFO",0x4eac);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ae670(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ead);
  FUN_140058870(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_BATTLE_HOST_INFO",0x4ead);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ae7a0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined1 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ead);
  FUN_140058870(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_BATTLE_HOST_INFO",0x4ead);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ae8e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eae);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_TOURNAMENT_CHANGE",0x4eae);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402ae9d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eae);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_TOURNAMENT_CHANGE",0x4eae)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aead0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eaf);
  FUN_140058770(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_ROOM_CHANGE_MASTER",0x4eaf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aebc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eaf);
  FUN_140058770(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_ROOM_CHANGE_MASTER",0x4eaf
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aecc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb0);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_SCENE_STOP",0x4eb0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402aeda0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb0);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_SCENE_STOP",0x4eb0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402aee80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSTANCE_ITEM_CLEAR",0x4eb1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402aef40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSTANCE_ITEM_CLEAR",0x4eb1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402af010(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb2);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140385940(local_30,param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_SPAWN_EVENTBOX",0x4eb2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402af140(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb2);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140385940(local_30,param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ITEM_SPAWN_EVENTBOX",0x4eb2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402af270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STAGE_RETURN_LOBBY_FROM_TUTORIAL",
                     0x4eb3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402af330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STAGE_RETURN_LOBBY_FROM_TUTORIAL"
                     ,0x4eb3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402af400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb4);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_CARD_OPEN_REMAIN_TIME",0x4eb4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402af4e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_CARD_OPEN_REMAIN_TIME",0x4eb4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402af5c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb5);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_ITEM_STEAL",0x4eb5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402af6f0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4eb5);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_ITEM_STEAL",0x4eb5);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402af830(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             longlong *param_5,longlong *param_6,longlong *param_7,longlong *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb6);
  FUN_140385940(local_30,param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_30,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_30,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ITEM_SPAWN_EVENTBOX_STEAL",0x4eb6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402afa10(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,longlong *param_6,longlong *param_7,longlong *param_8,
             longlong *param_9)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4eb6);
  FUN_140385940(local_40,param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_7[1]);
  }
  FUN_140058470(local_40,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar2 = (undefined4 *)*param_9;
  if (puVar2 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_9[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_ITEM_SPAWN_EVENTBOX_STEAL",0x4eb6
                    );
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402afc00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RARE_CARD_CLEAR",0x4eb7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402afcc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RARE_CARD_CLEAR",0x4eb7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402afd90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DICE_EXP_COMPLETE",0x4eb8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402afe50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DICE_EXP_COMPLETE",0x4eb8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402aff20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_DICE_USE",0x4eb9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402affe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eb9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_DICE_USE",0x4eb9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b00b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eba);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_DICE_USE",0x4eba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b0190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eba);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_DICE_USE",0x4eba);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b0270(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,undefined1 *param_10,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebb);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_DICE_RESULT",0x4ebb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b03e0(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,undefined1 *param_11,undefined1 *param_12)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebb);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058570(local_30,*param_9);
  FUN_140058870(local_30,*param_10);
  FUN_140058870(local_30,*param_11);
  FUN_140058870(local_30,*param_12);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_DICE_RESULT",0x4ebb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b0560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DICE_END",0x4ebc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b0620(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DICE_END",0x4ebc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b06f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DICE_PARTY_WAIT",0x4ebd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b07b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DICE_PARTY_WAIT",0x4ebd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b0880(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,longlong *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebe);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,param_8[1] - *param_8 >> 2);
  puVar2 = (undefined4 *)*param_8;
  if (puVar2 != (undefined4 *)param_8[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_8[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SUPER_ROULETTE",0x4ebe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b09e0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             longlong *param_9)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ebe);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058470(local_40,*param_8);
  FUN_140058470(local_40,param_9[1] - *param_9 >> 2);
  puVar2 = (undefined4 *)*param_9;
  if (puVar2 != (undefined4 *)param_9[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_9[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_SUPER_ROULETTE",0x4ebe);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b0b50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebf);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SUPER_ROULETTE_COOLTIME_END",0x4ebf
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b0c10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ebf);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SUPER_ROULETTE_COOLTIME_END",
                     0x4ebf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b0ce0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec0);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_USER_RESURRECTION",0x4ec0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b0dd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec0);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_USER_RESURRECTION",0x4ec0)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b0ed0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_ROULETTE_REWARD",0x4ec1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b0f90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_ROULETTE_REWARD",0x4ec1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1060(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec2);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RARE_CARD_ROULETTE",0x4ec2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1150(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec2);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RARE_CARD_ROULETTE",0x4ec2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1250(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec3);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RARE_CARD_LASET_DEL",0x4ec3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec3);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RARE_CARD_LASET_DEL",0x4ec3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec4);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_SUPER_ROULETTE_ING",0x4ec4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1500(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_SUPER_ROULETTE_ING",0x4ec4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec5);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INSTANCE_ITEM_REMOVE",0x4ec5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b16e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec5);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INSTANCE_ITEM_REMOVE",0x4ec5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b17c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec6);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RARE_CARD_BONUS",0x4ec6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b18a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec6);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RARE_CARD_BONUS",0x4ec6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1980(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec7);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_PLAY_READY_TEAMTAG",
                     0x4ec7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1a70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec7);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_GAME_PLAY_READY_TEAMTAG",
                     0x4ec7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b1b70(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ec8);
  FUN_140058470(local_40,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_BATTLE_GAME_PLAY_END_TEAMTAG",
                     0x4ec8);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1c80(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             longlong *param_5)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ec8);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_BATTLE_GAME_PLAY_END_TEAMTAG",
                     0x4ec8);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1da0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec9);
  FUN_140058470(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_PLAY_RECORVERY",0x4ec9)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1ea0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ec9);
  FUN_140058470(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_GAME_PLAY_RECORVERY",
                     0x4ec9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b1fb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eca);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DISABLE_SUPER_ROULETTE",0x4eca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2090(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eca);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DISABLE_SUPER_ROULETTE",0x4eca);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ecb);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DISABLE_UNDEAD_HAND",0x4ecb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2250(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ecb);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DISABLE_UNDEAD_HAND",0x4ecb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2330(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ecc);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_TRADE_INSTANCE_ITEM",0x4ecc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ecc);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_TRADE_INSTANCE_ITEM",0x4ecc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b24f0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ecd);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_30,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(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_BATTLE_GAME_USESKILL",0x4ecd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2650(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,longlong *param_6,longlong *param_7)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ecd);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  FUN_140058470(local_40,param_7[1] - *param_7 >> 2);
  puVar2 = (undefined4 *)*param_7;
  if (puVar2 != (undefined4 *)param_7[1]) {
    do {
      FUN_140058470(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_BATTLE_GAME_USESKILL",0x4ecd);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b27c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ece);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_DISCONNECT",0x4ece);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b28a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ece);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_DISCONNECT",0x4ece);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2980(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4,
             longlong *param_5)

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ecf);
  FUN_140058470(local_30,param_4[1] - *param_4 >> 2);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_TAG_ORDER",0x4ecf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2ad0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             longlong *param_5,longlong *param_6)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ecf);
  FUN_140058470(local_40,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_BATTLE_GAME_TAG_ORDER",0x4ecf);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2c30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed0);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_DEATHMATCH_KILLCOUNT",
                     0x4ed0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed0);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_GAME_DEATHMATCH_KILLCOUNT"
                     ,0x4ed0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2e20(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed1);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_STAGE_LOAD_COMPLETE",0x4ed1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b2f20(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed1);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_STAGE_LOAD_COMPLETE",0x4ed1)
  ;
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b3030(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ALL_STAGE_LOAD_COMPLETE",0x4ed2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b30f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed2);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ALL_STAGE_LOAD_COMPLETE",0x4ed2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b31c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_STAGE_LOAD_FAILED",0x4ed3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b3280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed3);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_STAGE_LOAD_FAILED",0x4ed3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed4);
  FUN_140017c50(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_REARING_TURNSTATE",0x4ed4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3430(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed4);
  FUN_140017c50(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_REARING_TURNSTATE",0x4ed4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed5);
  FUN_140017c50(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_NTF_REARING_LEVELUP",0x4ed5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3600(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed5);
  FUN_140017c50(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_NTF_REARING_LEVELUP",0x4ed5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b3700(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_CLEAR",0x4ed6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b37c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_CLEAR",0x4ed6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3890(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed7);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REBIRTHCOIN_COUNT_STATE",0x4ed7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3970(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed7);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REBIRTHCOIN_COUNT_STATE",0x4ed7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3a50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed8);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_USER_KILL",0x4ed8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3b40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed8);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_USER_KILL",0x4ed8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed9);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_LIMIT_REBIRTH_COUNT",0x4ed9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ed9);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_LIMIT_REBIRTH_COUNT",0x4ed9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3e00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eda);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_REMAIN_TIME",0x4eda);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b3ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eda);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_REMAIN_TIME",0x4eda);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b3fc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4edb);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_BATTLE_LADDER_MATCH",0x4edb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b4080(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4edb);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_BATTLE_LADDER_MATCH",0x4edb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b4150(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 *param_5,undefined8 param_6,undefined8 *param_7,undefined4 *param_8)

{
  undefined1 uVar1;
  undefined4 local_res10 [2];
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  local_res10[0] = param_2;
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x4edc);
  FUN_1403859e0(local_38,param_4);
  FUN_140058470(local_38,*param_5);
  FUN_1403a17c0(local_38,param_6);
  FUN_140058770(local_38,*param_7);
  local_48 = *param_8;
  uStack_44 = param_8[1];
  uStack_40 = param_8[2];
  uStack_3c = param_8[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_38,L"PT_SERVER_BATTLE_ROOM_JOIN",0x4edc);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b4290(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)

{
  undefined1 uVar1;
  undefined4 local_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  undefined1 local_38 [8];
  undefined1 local_30 [8];
  longlong local_28;
  int local_1c;
  
  FUN_1403841b0(local_38);
  FUN_140383c40(local_38);
  FUN_140017c50(local_38,0x4edc);
  FUN_1403859e0(local_38,param_5);
  FUN_140058470(local_38,*param_6);
  FUN_1403a17c0(local_38,param_7);
  FUN_140058770(local_38,*param_8);
  local_48 = *param_9;
  uStack_44 = param_9[1];
  uStack_40 = param_9[2];
  uStack_3c = param_9[3];
  FUN_140090370(local_38,&local_48);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_38,L"PT_SERVER_BATTLE_ROOM_JOIN",0x4edc);
  FUN_140399690(local_30);
  if ((local_28 != 0) && (local_1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b43d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4edd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_LADDER_END",0x4edd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b4490(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4edd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_LADDER_END",0x4edd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b4560(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ede);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_LADDER_START",0x4ede);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b4620(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ede);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_LADDER_START",0x4ede);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b46f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4edf);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESULT_RESURRECTION_LIMIT",0x4edf);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b47e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4edf);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESULT_RESURRECTION_LIMIT",0x4edf
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b48e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee0);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"REQ_BATTLE_LADDER_MATCH_CANCEL",0x4ee0
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b49a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee0);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"REQ_BATTLE_LADDER_MATCH_CANCEL",
                     0x4ee0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b4a70(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined8 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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee1);
  FUN_140385940(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,param_7[1]);
  FUN_140058570(local_30,param_7[2]);
  FUN_140058570(local_30,*param_8);
  FUN_140058570(local_30,param_8[1]);
  FUN_140058570(local_30,param_8[2]);
  FUN_140058470(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  FUN_140058470(local_30,*param_11);
  FUN_140058470(local_30,*param_12);
  FUN_140385940(local_30,param_13);
  FUN_140058470(local_30,*param_14);
  FUN_140058470(local_30,*param_15);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_GIMMICK_STATE",0x4ee1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b4c30(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined2 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 *param_12,
             undefined4 *param_13,undefined8 param_14,undefined4 *param_15,undefined4 *param_16)

{
  undefined1 uVar1;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ee1);
  FUN_140385940(local_40,param_5);
  FUN_140017c50(local_40,*param_6);
  FUN_140058470(local_40,*param_7);
  FUN_140058570(local_40,*param_8);
  FUN_140058570(local_40,param_8[1]);
  FUN_140058570(local_40,param_8[2]);
  FUN_140058570(local_40,*param_9);
  FUN_140058570(local_40,param_9[1]);
  FUN_140058570(local_40,param_9[2]);
  FUN_140058470(local_40,*param_10);
  FUN_140058470(local_40,*param_11);
  FUN_140058470(local_40,*param_12);
  FUN_140058470(local_40,*param_13);
  FUN_140385940(local_40,param_14);
  FUN_140058470(local_40,*param_15);
  FUN_140058470(local_40,*param_16);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_GIMMICK_STATE",0x4ee1);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b4e00(longlong *param_1,undefined4 param_2,undefined8 param_3,longlong *param_4)

{
  undefined1 uVar1;
  undefined4 *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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ee2);
  FUN_140058470(local_40,(param_4[1] - *param_4) / 0x34);
  puVar2 = (undefined4 *)*param_4;
  if (puVar2 != (undefined4 *)param_4[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140058470(local_40,puVar2[1]);
      FUN_140058470(local_40,puVar2[2]);
      FUN_140058470(local_40,puVar2[3]);
      FUN_140058570(local_40,puVar2[4]);
      FUN_140058570(local_40,puVar2[5]);
      FUN_140058570(local_40,puVar2[6]);
      FUN_140058570(local_40,puVar2[7]);
      FUN_140058570(local_40,puVar2[8]);
      FUN_140058570(local_40,puVar2[9]);
      FUN_140058870(local_40,*(undefined1 *)(puVar2 + 10));
      FUN_140058570(local_40,puVar2[0xb]);
      FUN_140058470(local_40,puVar2[0xc]);
      puVar2 = puVar2 + 0xd;
    } while (puVar2 != (undefined4 *)param_4[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,L"PT_ITEM_SPAWN_LIST",0x4ee2);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b4fb0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             longlong *param_5)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ee2);
  FUN_140058470(local_40,(param_5[1] - *param_5) / 0x34);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      FUN_140058470(local_40,puVar2[1]);
      FUN_140058470(local_40,puVar2[2]);
      FUN_140058470(local_40,puVar2[3]);
      FUN_140058570(local_40,puVar2[4]);
      FUN_140058570(local_40,puVar2[5]);
      FUN_140058570(local_40,puVar2[6]);
      FUN_140058570(local_40,puVar2[7]);
      FUN_140058570(local_40,puVar2[8]);
      FUN_140058570(local_40,puVar2[9]);
      FUN_140058870(local_40,*(undefined1 *)(puVar2 + 10));
      FUN_140058570(local_40,puVar2[0xb]);
      FUN_140058470(local_40,puVar2[0xc]);
      puVar2 = puVar2 + 0xd;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_ITEM_SPAWN_LIST",0x4ee2);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5190(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee3);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PET_EAT_ITEM_RESULT",0x4ee3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5270(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee3);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PET_EAT_ITEM_RESULT",0x4ee3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b5350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_STAGE_LOAD_COMPLETE_RETRY",
                     0x4ee4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b5410(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_STAGE_LOAD_COMPLETE_RETRY",
                     0x4ee4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b54e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee5);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ELAPSED_TIME",0x4ee5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b55c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee5);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ELAPSED_TIME",0x4ee5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b56a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_COUNT_SKIP",0x4ee6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b5760(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_COUNT_SKIP",0x4ee6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5830(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee7);
  FUN_1403859e0(local_30,param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_ACK_COUNT_SKIP",0x4ee7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5920(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee7);
  FUN_1403859e0(local_30,param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_ACK_COUNT_SKIP",0x4ee7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b5a10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_PARTY_TELEPORT",0x4ee8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b5ad0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_PARTY_TELEPORT",0x4ee8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5ba0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee9);
  FUN_140058870(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_RESP_PARTY_TELEPORT",0x4ee9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5c90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ee9);
  FUN_140058870(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_RESP_PARTY_TELEPORT",0x4ee9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5d80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eea);
  FUN_140058570(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_DUNGEON_CONTROL",0x4eea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5ea0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eea);
  FUN_140058570(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_DUNGEON_CONTROL",0x4eea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b5fd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eeb);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INTRUSION_LOAD",0x4eeb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b60b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eeb);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INTRUSION_LOAD",0x4eeb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6190(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eec);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_INTRUSION_LOAD_COMPLETE",0x4eec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6280(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eec);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_INTRUSION_LOAD_COMPLETE",0x4eec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6380(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eed);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_OBSERVER",0x4eed);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6470(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,undefined1 *param_6)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eed);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_OBSERVER",0x4eed);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b6570(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eee);
  FUN_140385940(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PLAYER_ANI_REPEAT_COUNT",0x4eee);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6650(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eee);
  FUN_140385940(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PLAYER_ANI_REPEAT_COUNT",0x4eee);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6730(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eef);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_EVENT_GAME_MODE_NOTIFY",
                     0x4eef);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6810(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4eef);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_EVENT_GAME_MODE_NOTIFY",
                     0x4eef);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b68f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef0);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_MISSION_START",0x4ef0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b69d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef0);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_MISSION_START",0x4ef0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b6ab0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_MISSION_FAIL",0x4ef1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b6b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef1);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_MISSION_FAIL",0x4ef1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef2);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_PARTY_MISSION_RESULT",0x4ef2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef2);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_PARTY_MISSION_RESULT",0x4ef2);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6e00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef3);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_EVENT_INFO",0x4ef3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b6f00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef3);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_EVENT_INFO",0x4ef3);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b7010(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4,
             undefined2 *param_5,undefined4 *param_6,undefined4 *param_7,undefined1 *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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef4);
  FUN_1403a17c0(local_30,param_4);
  FUN_140017c50(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  FUN_140058470(local_30,*param_9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_REQ_USE_RESURRECTION_ITEM",0x4ef4);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b7150(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined8 param_5,undefined2 *param_6,undefined4 *param_7,undefined4 *param_8,
             undefined1 *param_9,undefined4 *param_10)

{
  undefined1 uVar1;
  undefined1 local_30 [8];
  undefined1 local_28 [8];
  longlong local_20;
  int local_14;
  
  FUN_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef4);
  FUN_1403a17c0(local_30,param_5);
  FUN_140017c50(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058470(local_30,*param_8);
  FUN_140058870(local_30,*param_9);
  FUN_140058470(local_30,*param_10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_REQ_USE_RESURRECTION_ITEM",0x4ef4
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b72a0(longlong *param_1,undefined4 param_2,undefined8 param_3,undefined4 *param_4,
             longlong *param_5)

{
  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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef5);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,param_5[1] - *param_5 >> 2);
  puVar2 = (undefined4 *)*param_5;
  if (puVar2 != (undefined4 *)param_5[1]) {
    do {
      FUN_140058470(local_30,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_5[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_MAP_GAME_START_FAIL_U",0x4ef5);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1402b73c0(longlong *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4,
             undefined4 *param_5,longlong *param_6)

{
  undefined1 uVar1;
  undefined4 *puVar2;
  undefined1 local_40 [8];
  undefined1 local_38 [8];
  longlong local_30;
  int local_24;
  
  FUN_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x4ef5);
  FUN_140058470(local_40,*param_5);
  FUN_140058470(local_40,param_6[1] - *param_6 >> 2);
  puVar2 = (undefined4 *)*param_6;
  if (puVar2 != (undefined4 *)param_6[1]) {
    do {
      FUN_140058470(local_40,*puVar2);
      puVar2 = puVar2 + 1;
    } while (puVar2 != (undefined4 *)param_6[1]);
  }
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,L"PT_MAP_GAME_START_FAIL_U",0x4ef5);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b74f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,L"PT_BATTLE_GAME_PLAY_RESULT_END",0x4ef6
                    );
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1402b75b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x4ef6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,L"PT_BATTLE_GAME_PLAY_RESULT_END",
                     0x4ef6);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



// 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::UdpProxy::vftable;
  FUN_140385b20();
  if ((param_1 & 1) != 0) {
    operator_delete(this);
  }
  return this;
}



void FUN_1402b76c0(undefined8 *param_1)

{
  *param_1 = RNP::UdpProxy::vftable;
  FUN_140385b20();
  return;
}



undefined8 FUN_1402b76d0(undefined8 param_1,longlong *param_2)

{
  undefined4 *puVar1;
  
  FUN_140058470(param_1,(param_2[1] - *param_2) / 0x50);
  puVar1 = (undefined4 *)*param_2;
  if (puVar1 != (undefined4 *)param_2[1]) {
    do {
      FUN_140058470(param_1,*puVar1);
      FUN_140058470(param_1,puVar1[1]);
      FUN_140058470(param_1,puVar1[10]);
      FUN_140058470(param_1,puVar1[0xb]);
      FUN_140058770(param_1,*(undefined8 *)(puVar1 + 0xc));
      FUN_140058770(param_1,*(undefined8 *)(puVar1 + 0xe));
      FUN_1403a17c0(param_1,puVar1 + 0x10);
      FUN_140385a20(param_1,puVar1 + 2);
      puVar1 = puVar1 + 0x14;
    } while (puVar1 != (undefined4 *)param_2[1]);
  }
  return param_1;
}



void FUN_1402b7790(longlong param_1,void *param_2,uint *param_3,uint *param_4,void *param_5,
                  void *param_6,void *param_7,void *param_8,float *param_9,undefined8 param_10,
                  float *param_11,float *param_12,uint *param_13)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  ushort local_res8 [8];
  ushort local_res18 [4];
  ushort local_res20 [4];
  ushort local_48 [2];
  ushort local_44 [2];
  undefined2 local_40;
  char local_3e;
  
  iVar3 = 4;
  local_40 = 0;
  local_3e = '\0';
  iVar2 = 4;
  iVar1 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar1 = 0x100 - *(int *)(param_1 + 4), 0 < iVar1)) {
    memcpy(param_2,(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar1 = 2;
  iVar5 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    iVar4 = *(int *)(param_1 + 4);
    memcpy(local_res8,(void *)((longlong)iVar4 + 0xc + param_1),(longlong)iVar5);
    iVar4 = iVar4 + iVar5;
    *(int *)(param_1 + 4) = iVar4;
    *(int *)(param_1 + 8) = iVar4;
  }
  iVar5 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    iVar4 = *(int *)(param_1 + 4);
    memcpy(local_res18,(void *)((longlong)iVar4 + 0xc + param_1),(longlong)iVar5);
    iVar4 = iVar4 + iVar5;
    *(int *)(param_1 + 4) = iVar4;
    *(int *)(param_1 + 8) = iVar4;
  }
  iVar5 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy(param_5,(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  iVar2 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy(param_6,(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_7,(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar3 = 0x100 - *(int *)(param_1 + 4), 0 < iVar3)) {
    memcpy(param_8,(void *)((longlong)*(int *)(param_1 + 4) + 0xc + param_1),(longlong)iVar3);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar3;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122040(param_1,&local_40);
  FUN_140121f60(param_1,param_10);
  iVar2 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    iVar3 = *(int *)(param_1 + 4);
    memcpy(local_res20,(void *)((longlong)iVar3 + 0xc + param_1),(longlong)iVar2);
    iVar3 = iVar3 + iVar2;
    *(int *)(param_1 + 4) = iVar3;
    *(int *)(param_1 + 8) = iVar3;
  }
  iVar2 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    iVar3 = *(int *)(param_1 + 4);
    memcpy(local_48,(void *)((longlong)iVar3 + 0xc + param_1),(longlong)iVar2);
    iVar3 = iVar3 + iVar2;
    *(int *)(param_1 + 4) = iVar3;
    *(int *)(param_1 + 8) = iVar3;
  }
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar1 = 0x100 - *(int *)(param_1 + 4), 0 < iVar1)) {
    iVar2 = *(int *)(param_1 + 4);
    memcpy(local_44,(void *)((longlong)iVar2 + 0xc + param_1),(longlong)iVar1);
    iVar2 = iVar2 + iVar1;
    *(int *)(param_1 + 4) = iVar2;
    *(int *)(param_1 + 8) = iVar2;
  }
  *param_3 = (uint)local_res8[0];
  *param_4 = (uint)local_res18[0];
  *param_11 = (float)local_res20[0];
  *param_12 = (float)local_48[0];
  *param_13 = (uint)local_44[0];
  *param_9 = (float)(int)(char)local_40 / 125.0;
  param_9[1] = (float)(int)local_40._1_1_ / 125.0;
  param_9[2] = (float)(int)local_3e / 125.0;
  return;
}



void FUN_1402b7b20(undefined1 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 param_5,undefined4 param_6)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 local_res10 [2];
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 0x15;
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar3 = *(int *)(param_1 + 4);
  iVar4 = 4;
  *(int *)(param_1 + 8) = iVar3;
  iVar2 = 4;
  iVar1 = 4;
  if ((iVar3 + 4 < 0x101) || (iVar1 = 0x100 - iVar3, 0 < iVar1)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar3 + 0xc,local_res10,(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar3 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar3 = 0x100 - *(int *)(param_1 + 4), 0 < iVar3)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar3);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar3;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b7c60(undefined1 *param_1,undefined2 param_2,undefined4 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined8 param_7,float *param_8,
                  undefined4 param_9,undefined1 param_10,undefined4 param_11,undefined4 param_12,
                  undefined4 param_13)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined4 local_res10 [2];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 1;
  iVar7 = 4;
  iVar6 = 4;
  iVar5 = 4;
  fVar1 = *param_8;
  fVar2 = param_8[2];
  fVar3 = param_8[1];
  *(undefined2 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 2;
  iVar4 = *(int *)(param_1 + 4);
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar4;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar4 + 4 < 0x101) || (iVar5 = 0x100 - iVar4, local_res10[0] = param_3, 0 < iVar5)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar4 + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 2;
  local_res10[0] = CONCAT22(local_res10[0]._2_2_,param_4);
  iVar4 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122120(param_1,param_7);
  FUN_140122200(param_1,&local_res18);
  iVar5 = 1;
  iVar4 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = CONCAT31(param_9._1_3_,param_10);
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  iVar4 = 4;
  param_9 = param_11;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_12;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_13;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b7f70(undefined1 *param_1,undefined2 param_2,undefined4 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined8 param_7,float *param_8,
                  undefined4 param_9,undefined1 param_10,undefined4 param_11,undefined2 param_12,
                  undefined2 param_13,undefined2 param_14,undefined4 param_15)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined4 local_res10 [2];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 0x24;
  iVar8 = 4;
  iVar5 = 4;
  iVar6 = 4;
  fVar1 = *param_8;
  fVar2 = param_8[2];
  fVar3 = param_8[1];
  *(undefined2 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 2;
  iVar4 = *(int *)(param_1 + 4);
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar4;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar4 + 4 < 0x101) || (iVar6 = 0x100 - iVar4, local_res10[0] = param_3, 0 < iVar6)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar4 + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 2;
  local_res10[0] = CONCAT22(local_res10[0]._2_2_,param_4);
  iVar6 = 2;
  iVar4 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122120(param_1,param_7);
  FUN_140122200(param_1,&local_res18);
  iVar5 = 1;
  iVar4 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = CONCAT31(param_9._1_3_,param_10);
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar4 = 4;
  param_9 = param_11;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 2;
  iVar4 = 2;
  param_9._0_2_ = param_12;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9._0_2_ = param_13;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = CONCAT22(param_9._2_2_,param_14);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_15;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar8 = 0x100 - *(int *)(param_1 + 4), 0 < iVar8)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar8);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar8;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b82e0(undefined1 *param_1,undefined2 param_2,undefined4 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined8 param_7,float *param_8,
                  undefined4 param_9,undefined1 param_10,undefined4 param_11,undefined4 param_12,
                  undefined4 param_13,undefined4 param_14,undefined4 param_15)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined4 local_res10 [2];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 0x29;
  iVar6 = 4;
  iVar5 = 4;
  iVar4 = 4;
  fVar1 = *param_8;
  fVar2 = param_8[2];
  fVar3 = param_8[1];
  *(undefined2 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 2;
  iVar7 = *(int *)(param_1 + 4);
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar7;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar7 + 4 < 0x101) || (iVar4 = 0x100 - iVar7, local_res10[0] = param_3, 0 < iVar4)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar7 + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar4 = 2;
  local_res10[0] = CONCAT22(local_res10[0]._2_2_,param_4);
  iVar7 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122120(param_1,param_7);
  FUN_140122200(param_1,&local_res18);
  iVar4 = 1;
  iVar7 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = CONCAT31(param_9._1_3_,param_10);
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar4 = 4;
  iVar7 = 4;
  param_9 = param_11;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_12;
  iVar7 = iVar4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_13;
  iVar7 = iVar4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_14;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_15;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b8650(undefined1 *param_1,undefined2 param_2,undefined4 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined8 param_7,float *param_8,
                  undefined4 param_9,undefined4 param_10)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined4 local_res10 [2];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 0x2b;
  iVar5 = 4;
  iVar7 = 4;
  fVar1 = *param_8;
  fVar2 = param_8[2];
  fVar3 = param_8[1];
  *(undefined2 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 2;
  iVar4 = *(int *)(param_1 + 4);
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar4;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  iVar6 = iVar7;
  if ((iVar4 + 4 < 0x101) || (iVar6 = 0x100 - iVar4, local_res10[0] = param_3, 0 < iVar6)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar4 + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 2;
  local_res10[0] = CONCAT22(local_res10[0]._2_2_,param_4);
  iVar4 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122120(param_1,param_7);
  FUN_140122200(param_1,&local_res18);
  param_5 = param_9;
  iVar4 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_10;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b8870(undefined1 *param_1,undefined2 param_2,undefined4 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined8 param_7,float *param_8,
                  undefined4 param_9,undefined1 param_10,undefined4 param_11,undefined4 param_12,
                  undefined4 param_13)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined4 local_res10 [2];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 0x27;
  iVar7 = 4;
  iVar6 = 4;
  iVar5 = 4;
  fVar1 = *param_8;
  fVar2 = param_8[2];
  fVar3 = param_8[1];
  *(undefined2 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 2;
  iVar4 = *(int *)(param_1 + 4);
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar4;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar4 + 4 < 0x101) || (iVar5 = 0x100 - iVar4, local_res10[0] = param_3, 0 < iVar5)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar4 + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 2;
  local_res10[0] = CONCAT22(local_res10[0]._2_2_,param_4);
  iVar4 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122120(param_1,param_7);
  FUN_140122200(param_1,&local_res18);
  iVar5 = 1;
  iVar4 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = CONCAT31(param_9._1_3_,param_10);
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  iVar4 = 4;
  param_9 = param_11;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_12;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_9 = param_13;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_9,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b8b80(undefined1 *param_1,undefined4 param_2,undefined2 param_3,float *param_4,
                  undefined8 param_5)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  fVar1 = *param_4;
  iVar5 = 2;
  fVar2 = param_4[2];
  fVar3 = param_4[1];
  *param_1 = 2;
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar4 = *(int *)(param_1 + 4);
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(int *)(param_1 + 8) = iVar4;
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  local_res10[0] = param_3;
  if ((iVar4 + 2 < 0x101) || (iVar5 = 0x100 - iVar4, 0 < iVar5)) {
    memcpy(param_1 + (longlong)iVar4 + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_5);
  return;
}



void FUN_1402b8c50(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  float *param_9,undefined8 param_10,float param_11,float param_12,
                  undefined2 param_13,undefined2 param_14)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar4 = 2;
  fVar1 = *param_9;
  fVar2 = param_9[2];
  iVar6 = 2;
  fVar3 = param_9[1];
  *param_1 = 4;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar7 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar7;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  iVar5 = iVar6;
  if ((iVar7 + 2 < 0x101) || (iVar5 = 0x100 - iVar7, 0 < iVar5)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar7 + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 4;
  iVar5 = 4;
  iVar7 = iVar5;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 4;
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_10);
  iVar5 = 2;
  iVar7 = iVar5;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    param_5._0_2_ = (short)(longlong)param_11;
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5._0_2_ = (undefined2)(longlong)param_12;
  iVar7 = iVar5;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5._0_2_ = param_13;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = CONCAT22(param_5._2_2_,param_14);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b8f80(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  float *param_9,undefined8 param_10)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar6 = 2;
  fVar1 = *param_9;
  fVar2 = param_9[2];
  iVar4 = 2;
  fVar3 = param_9[1];
  *param_1 = 5;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar5 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar5;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar5 + 2 < 0x101) || (iVar4 = 0x100 - iVar5, 0 < iVar4)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar5 + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 4;
  iVar4 = 4;
  iVar5 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_10);
  return;
}



void FUN_1402b91a0(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined1 param_9,float *param_10,undefined8 param_11)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar6 = 2;
  fVar1 = *param_10;
  fVar2 = param_10[2];
  iVar4 = 2;
  fVar3 = param_10[1];
  *param_1 = 6;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar5 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar5;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar5 + 2 < 0x101) || (iVar4 = 0x100 - iVar5, 0 < iVar4)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar5 + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 4;
  iVar4 = 4;
  iVar5 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 1;
  param_5 = CONCAT31(param_5._1_3_,param_9);
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_11);
  return;
}



void FUN_1402b9400(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,float *param_10,undefined8 param_11,undefined4 param_12,
                  undefined4 param_13)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar5 = 2;
  fVar1 = *param_10;
  fVar2 = param_10[2];
  iVar4 = 2;
  fVar3 = param_10[1];
  *param_1 = 7;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar6 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar6;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar6 + 2 < 0x101) || (iVar4 = 0x100 - iVar6, 0 < iVar4)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar6 + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  param_5 = param_6;
  iVar4 = 4;
  iVar6 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar4 = 4;
  iVar6 = 4;
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_9;
  iVar6 = iVar4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_11);
  param_5 = param_12;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_13;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b9700(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,float *param_10,undefined8 param_11)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar5 = 2;
  fVar1 = *param_10;
  fVar2 = param_10[2];
  iVar4 = 2;
  fVar3 = param_10[1];
  *param_1 = 0x20;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar6 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar6;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar6 + 2 < 0x101) || (iVar4 = 0x100 - iVar6, 0 < iVar4)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar6 + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  param_5 = param_6;
  iVar4 = 4;
  iVar6 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 4;
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_9;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_11);
  return;
}



void FUN_1402b9960(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,float *param_10,undefined8 param_11,undefined2 param_12)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar4 = 2;
  fVar1 = *param_10;
  fVar2 = param_10[2];
  iVar6 = 2;
  fVar3 = param_10[1];
  *param_1 = 0x22;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar7 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar7;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  iVar5 = iVar6;
  if ((iVar7 + 2 < 0x101) || (iVar5 = 0x100 - iVar7, 0 < iVar5)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar7 + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 4;
  param_5 = param_6;
  iVar5 = 4;
  iVar7 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 4;
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_9;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_11);
  param_5 = CONCAT22(param_5._2_2_,param_12);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b9c10(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined8 param_5,undefined8 param_6,undefined2 param_7,float *param_8)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar7 = 2;
  fVar1 = *param_8;
  fVar2 = param_8[2];
  iVar6 = 2;
  iVar5 = 2;
  fVar3 = param_8[1];
  *param_1 = 8;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar4 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar4;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar4 + 2 < 0x101) || (iVar5 = 0x100 - iVar4, 0 < iVar5)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar4 + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122120(param_1,param_5);
  FUN_140122120(param_1,param_6);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_7,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  return;
}



void FUN_1402b9d70(undefined1 *param_1,undefined4 param_2,ushort param_3,ushort param_4,
                  undefined8 param_5,float *param_6)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  ushort local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar5 = 2;
  fVar1 = *param_6;
  fVar2 = param_6[2];
  iVar4 = 2;
  fVar3 = param_6[1];
  *param_1 = 9;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar6 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar6;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar6 + 2 < 0x101) || (iVar4 = 0x100 - iVar6, 0 < iVar4)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar6 + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = local_res10[0] & 0xff00;
  iVar6 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_5);
  return;
}



void FUN_1402b9ec0(undefined1 *param_1,undefined4 param_2,undefined8 param_3,float *param_4)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  undefined2 local_res10;
  undefined1 local_res12;
  
  *(undefined4 *)(param_1 + 4) = 0;
  fVar1 = *param_4;
  fVar2 = param_4[2];
  fVar3 = param_4[1];
  *param_1 = 10;
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  local_res10 = CONCAT11((char)(int)(fVar3 * 125.0),(char)(int)(fVar1 * 125.0));
  local_res12 = (undefined1)(int)(fVar2 * 125.0);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  FUN_140122120(fVar3 * 125.0,param_3);
  FUN_140122200(param_1,&local_res10);
  local_res10 = 0;
  iVar4 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402b9f80(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,float *param_10,undefined8 param_11,float param_12,
                  float param_13,undefined2 param_14)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar4 = 2;
  fVar1 = *param_10;
  fVar2 = param_10[2];
  iVar6 = 2;
  fVar3 = param_10[1];
  *param_1 = 0xb;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar7 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar7;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  iVar5 = iVar6;
  if ((iVar7 + 2 < 0x101) || (iVar5 = 0x100 - iVar7, 0 < iVar5)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar7 + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 4;
  param_5 = param_6;
  iVar5 = 4;
  iVar7 = iVar5;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 4;
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_9;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_11);
  iVar5 = 2;
  iVar7 = iVar5;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    param_5._0_2_ = (short)(longlong)param_12;
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5._0_2_ = (undefined2)(longlong)param_13;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = CONCAT22(param_5._2_2_,param_14);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402ba2b0(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined2 param_9,float *param_10,undefined8 param_11)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar4 = 2;
  fVar1 = *param_10;
  fVar2 = param_10[2];
  iVar7 = 2;
  fVar3 = param_10[1];
  *param_1 = 0xe;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar5 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar5;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  iVar6 = iVar7;
  if ((iVar5 + 2 < 0x101) || (iVar6 = 0x100 - iVar5, 0 < iVar6)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar5 + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 4;
  iVar6 = 4;
  iVar5 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = CONCAT22(param_5._2_2_,param_9);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_11);
  return;
}



void FUN_1402ba510(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,undefined4 param_10,float *param_11,undefined8 param_12,
                  undefined4 param_13,undefined4 param_14,undefined2 param_15)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar8 = 2;
  fVar1 = *param_11;
  fVar2 = param_11[2];
  iVar5 = 2;
  iVar4 = 2;
  fVar3 = param_11[1];
  *param_1 = 0x10;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar6 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar6;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar6 + 2 < 0x101) || (iVar4 = 0x100 - iVar6, 0 < iVar4)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar6 + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar4 = 1;
  iVar6 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 4;
  param_5 = param_6;
  iVar5 = 4;
  iVar6 = iVar5;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  param_5 = param_8;
  iVar6 = iVar5;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_9;
  iVar6 = iVar5;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_12);
  param_10 = param_13;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_10 = param_14;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_10 = CONCAT22(param_10._2_2_,param_15);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar8 = 0x100 - *(int *)(param_1 + 4), 0 < iVar8)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar8);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar8;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402ba890(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,undefined1 param_10,float *param_11,undefined8 param_12,
                  undefined8 param_13)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar5 = 2;
  fVar1 = *param_11;
  fVar2 = param_11[2];
  iVar4 = 2;
  fVar3 = param_11[1];
  *param_1 = 0x11;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar6 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar6;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar6 + 2 < 0x101) || (iVar4 = 0x100 - iVar6, 0 < iVar4)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar6 + 0xc,local_res10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar4 = 1;
  iVar6 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 4;
  param_5 = param_6;
  iVar5 = 4;
  iVar6 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 4;
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_9;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_12);
  FUN_140122120(param_1,param_13);
  return;
}



void FUN_1402bab50(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,float *param_8,
                  undefined8 param_9,undefined8 param_10,float param_11,float param_12)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined2 local_res10 [4];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar4 = 2;
  fVar1 = *param_8;
  fVar2 = param_8[2];
  iVar6 = 2;
  fVar3 = param_8[1];
  *param_1 = 0x12;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar7 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar7;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  iVar5 = iVar6;
  if ((iVar7 + 2 < 0x101) || (iVar5 = 0x100 - iVar7, 0 < iVar5)) {
    local_res10[0] = param_3;
    memcpy(param_1 + (longlong)iVar7 + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  param_5 = param_6;
  iVar7 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_9);
  FUN_140122120(param_1,param_10);
  iVar7 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    param_5._0_2_ = (short)(longlong)param_11;
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = CONCAT22(param_5._2_2_,(short)(longlong)param_12);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402badd0(undefined1 *param_1,undefined4 param_2,undefined2 param_3,undefined4 param_4,
                  undefined4 param_5,float *param_6,undefined8 param_7,undefined4 param_8,
                  undefined2 param_9)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined4 local_res10 [2];
  undefined1 local_res18;
  undefined1 local_res19;
  undefined1 local_res1a;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar4 = 2;
  fVar1 = *param_6;
  fVar2 = param_6[2];
  local_res10[0] = CONCAT22(local_res10[0]._2_2_,param_3);
  iVar6 = 2;
  fVar3 = param_6[1];
  *param_1 = 0x13;
  local_res18 = (undefined1)(int)(fVar1 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar5 = *(int *)(param_1 + 4);
  local_res19 = (undefined1)(int)(fVar3 * 125.0);
  *(int *)(param_1 + 8) = iVar5;
  local_res1a = (undefined1)(int)(fVar2 * 125.0);
  if ((iVar5 + 2 < 0x101) || (iVar6 = 0x100 - iVar5, 0 < iVar6)) {
    memcpy(param_1 + (longlong)iVar5 + 0xc,local_res10,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar7 = 4;
  iVar6 = 4;
  iVar5 = 4;
  local_res10[0] = param_4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res18);
  FUN_140122120(param_1,param_7);
  param_5 = param_8;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = CONCAT22(param_5._2_2_,param_9);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402bafb0(undefined1 *param_1,undefined8 param_2,undefined4 param_3,undefined2 param_4,
                  undefined2 param_5)

{
  int iVar1;
  int iVar2;
  undefined4 local_res18 [4];
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 0x1a;
  FUN_140122120();
  iVar1 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) ||
     (iVar1 = 0x100 - *(int *)(param_1 + 4), local_res18[0] = param_3, 0 < iVar1)) {
    local_res18[0] = param_3;
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res18,(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar2 = 2;
  local_res18[0] = CONCAT22(local_res18[0]._2_2_,param_4);
  iVar1 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar1 = 0x100 - *(int *)(param_1 + 4), 0 < iVar1)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res18,(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402bb0b0(undefined1 *param_1,undefined4 *param_2,undefined2 param_3,undefined2 param_4,
                  undefined8 param_5,undefined8 param_6,undefined8 param_7,undefined4 param_8)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined2 local_res18 [4];
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 0x1b;
  *(undefined4 *)(param_1 + 0xc) = *param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar3 = *(int *)(param_1 + 4);
  iVar2 = 2;
  *(int *)(param_1 + 8) = iVar3;
  iVar1 = 2;
  if ((iVar3 + 2 < 0x101) || (iVar1 = 0x100 - iVar3, 0 < iVar1)) {
    local_res18[0] = param_3;
    memcpy(param_1 + (longlong)iVar3 + 0xc,local_res18,(longlong)iVar1);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar1;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res18[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar2 = 0x100 - *(int *)(param_1 + 4), 0 < iVar2)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res18,(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122120(param_1,param_5);
  FUN_140122120(param_1,param_6);
  FUN_140122120(param_1,param_7);
  iVar3 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar3 = 0x100 - *(int *)(param_1 + 4), 0 < iVar3)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_8,(longlong)iVar3);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar3;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402bb1f0(undefined1 *param_1,undefined4 *param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,float *param_7,undefined8 param_8,
                  undefined2 param_9,undefined2 param_10,undefined2 param_11,undefined2 param_12)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  undefined2 local_res18 [4];
  undefined1 local_res20;
  undefined1 local_res21;
  undefined1 local_res22;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar7 = 2;
  fVar1 = *param_7;
  fVar2 = param_7[2];
  iVar6 = 2;
  iVar5 = 2;
  fVar3 = param_7[1];
  *param_1 = 0x1c;
  local_res20 = (undefined1)(int)(fVar1 * 125.0);
  local_res21 = (undefined1)(int)(fVar3 * 125.0);
  local_res22 = (undefined1)(int)(fVar2 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = *param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar4 = *(int *)(param_1 + 4);
  *(int *)(param_1 + 8) = iVar4;
  if ((iVar4 + 2 < 0x101) || (iVar5 = 0x100 - iVar4, 0 < iVar5)) {
    local_res18[0] = param_3;
    memcpy(param_1 + (longlong)iVar4 + 0xc,local_res18,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res18[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res18,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 4;
  iVar4 = 4;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res20);
  FUN_140122120(param_1,param_8);
  param_5._0_2_ = param_9;
  iVar5 = 2;
  iVar4 = 2;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5._0_2_ = param_10;
  iVar4 = iVar5;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5._0_2_ = param_11;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = CONCAT22(param_5._2_2_,param_12);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402bb4a0(undefined1 *param_1,undefined4 *param_2,undefined2 param_3,undefined2 param_4,
                  undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                  undefined4 param_9,undefined4 param_10,float *param_11,undefined8 param_12,
                  undefined2 param_13,undefined2 param_14,undefined4 param_15,undefined2 param_16)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined2 local_res18 [4];
  undefined1 local_res20;
  undefined1 local_res21;
  undefined1 local_res22;
  
  *(undefined4 *)(param_1 + 4) = 0;
  iVar4 = 2;
  fVar1 = *param_11;
  fVar2 = param_11[2];
  iVar6 = 2;
  fVar3 = param_11[1];
  *param_1 = 0x21;
  local_res20 = (undefined1)(int)(fVar1 * 125.0);
  local_res21 = (undefined1)(int)(fVar3 * 125.0);
  local_res22 = (undefined1)(int)(fVar2 * 125.0);
  *(undefined4 *)(param_1 + 0xc) = *param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar7 = *(int *)(param_1 + 4);
  *(int *)(param_1 + 8) = iVar7;
  iVar5 = iVar6;
  if ((iVar7 + 2 < 0x101) || (iVar5 = 0x100 - iVar7, 0 < iVar5)) {
    local_res18[0] = param_3;
    memcpy(param_1 + (longlong)iVar7 + 0xc,local_res18,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res18[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res18,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar5 = 1;
  iVar7 = 1;
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar8 = 4;
  param_5 = param_6;
  iVar6 = 4;
  iVar7 = iVar6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_7;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  iVar6 = 4;
  param_5 = param_8;
  iVar7 = iVar6;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_5 = param_9;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar6 = 0x100 - *(int *)(param_1 + 4), 0 < iVar6)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar6);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar6;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 1 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  FUN_140122200(param_1,&local_res20);
  FUN_140122120(param_1,param_12);
  param_10._0_2_ = param_13;
  iVar5 = 2;
  iVar7 = iVar5;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar7 = 0x100 - *(int *)(param_1 + 4), 0 < iVar7)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar7);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar7;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_10 = CONCAT22(param_10._2_2_,param_14);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar5 = 0x100 - *(int *)(param_1 + 4), 0 < iVar5)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar5);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar5;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_10 = param_15;
  if ((*(int *)(param_1 + 4) + 4 < 0x101) || (iVar8 = 0x100 - *(int *)(param_1 + 4), 0 < iVar8)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar8);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar8;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  param_10 = CONCAT22(param_10._2_2_,param_16);
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_10,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



void FUN_1402bb870(undefined1 *param_1,undefined4 *param_2,undefined2 param_3,undefined2 param_4,
                  undefined2 param_5)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined2 local_res18 [4];
  
  *(undefined4 *)(param_1 + 4) = 0;
  *param_1 = 0x23;
  *(undefined4 *)(param_1 + 0xc) = *param_2;
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + 4;
  iVar1 = *(int *)(param_1 + 4);
  iVar4 = 2;
  *(int *)(param_1 + 8) = iVar1;
  iVar3 = 2;
  iVar2 = 2;
  if ((iVar1 + 2 < 0x101) || (iVar2 = 0x100 - iVar1, 0 < iVar2)) {
    local_res18[0] = param_3;
    memcpy(param_1 + (longlong)iVar1 + 0xc,local_res18,(longlong)iVar2);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar2;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  local_res18[0] = param_4;
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar3 = 0x100 - *(int *)(param_1 + 4), 0 < iVar3)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,local_res18,(longlong)iVar3);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar3;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  if ((*(int *)(param_1 + 4) + 2 < 0x101) || (iVar4 = 0x100 - *(int *)(param_1 + 4), 0 < iVar4)) {
    memcpy(param_1 + (longlong)*(int *)(param_1 + 4) + 0xc,&param_5,(longlong)iVar4);
    *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + iVar4;
    *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402bb980(float *param_1,undefined8 param_2)

{
  float fVar1;
  float *pfVar2;
  float fVar3;
  undefined1 auStack_48 [40];
  float local_20;
  float local_1c;
  float local_18;
  ulonglong local_10;
  
  local_10 = DAT_1405d84f0 ^ (ulonglong)auStack_48;
  local_20 = param_1[3] + *param_1;
  local_1c = param_1[1] + 0.0;
  local_18 = param_1[2] + 0.0;
  pfVar2 = (float *)FUN_14024fab0();
  *param_1 = *pfVar2;
  param_1[1] = pfVar2[1];
  param_1[2] = pfVar2[2];
  pfVar2 = (float *)FUN_14024fab0(&local_20,param_2);
  fVar3 = (pfVar2[1] - param_1[1]) * (pfVar2[1] - param_1[1]) +
          (*pfVar2 - *param_1) * (*pfVar2 - *param_1) +
          (pfVar2[2] - param_1[2]) * (pfVar2[2] - param_1[2]);
  fVar1 = (float)(0x5f3759df - ((int)fVar3 >> 1));
  fVar1 = fVar1 * (1.5 - fVar1 * fVar1 * fVar3 * 0.5);
  param_1[3] = (1.5 - fVar1 * fVar1 * fVar3 * 0.5) * fVar1 * fVar3;
  return;
}



ulonglong FUN_1402bbac0(longlong param_1,float *param_2,float param_3)

{
  ulonglong uVar1;
  float *pfVar2;
  
  uVar1 = 0;
  pfVar2 = (float *)(param_1 + 8);
  do {
    if (*param_2 * pfVar2[-2] + param_2[1] * pfVar2[-1] + param_2[2] * *pfVar2 + pfVar2[1] <
        -param_3) {
      return uVar1 & 0xffffffffffffff00;
    }
    uVar1 = uVar1 + 1;
    pfVar2 = pfVar2 + 4;
  } while ((longlong)uVar1 < 6);
  return CONCAT71((int7)(uVar1 >> 8),1);
}



ulonglong FUN_1402bbb40(longlong param_1,float *param_2)

{
  ulonglong uVar1;
  float *pfVar2;
  
  uVar1 = 0;
  pfVar2 = (float *)(param_1 + 8);
  do {
    if (*param_2 * pfVar2[-2] + param_2[1] * pfVar2[-1] + param_2[2] * *pfVar2 + pfVar2[1] < 0.0) {
      return uVar1 & 0xffffffffffffff00;
    }
    uVar1 = uVar1 + 1;
    pfVar2 = pfVar2 + 4;
  } while ((longlong)uVar1 < 6);
  return CONCAT71((int7)(uVar1 >> 8),1);
}



float FUN_1402bbbb0(float *param_1,float *param_2,float *param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  
  fVar1 = param_3[1] - param_2[1];
  fVar7 = *param_3 - *param_2;
  fVar3 = *param_3 - *param_1;
  fVar4 = param_3[1] - param_1[1];
  fVar6 = *param_2 - *param_1;
  fVar9 = param_2[1] - param_1[1];
  fVar5 = param_3[2] - param_1[2];
  fVar10 = param_2[2] - param_1[2];
  fVar8 = param_3[2] - param_2[2];
  fVar2 = fVar3 * fVar6 + fVar4 * fVar9 + fVar5 * fVar10;
  if (0.0 < fVar2) {
    fVar6 = fVar6 * fVar6 + fVar9 * fVar9 + fVar10 * fVar10;
    if (fVar6 <= fVar2) {
      fVar1 = fVar1 * fVar1 + fVar7 * fVar7 + fVar8 * fVar8;
    }
    else {
      fVar1 = (fVar3 * fVar3 + fVar4 * fVar4 + fVar5 * fVar5) - (fVar2 * fVar2) / fVar6;
    }
  }
  else {
    fVar1 = fVar3 * fVar3 + fVar4 * fVar4 + fVar5 * fVar5;
  }
  return fVar1;
}



ulonglong FUN_1402bbd20(float *param_1,int param_2,longlong param_3,longlong param_4,float *param_5,
                       float *param_6)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  int iVar5;
  ulonglong in_RAX;
  ushort *puVar6;
  byte bVar7;
  longlong lVar8;
  float fVar9;
  float local_res20 [2];
  undefined1 local_68 [4];
  undefined1 local_64 [60];
  
  bVar7 = 0;
  if (param_4 != 0) {
    fVar9 = 1e+06;
    lVar8 = (longlong)param_2;
    if (0 < param_2) {
      puVar6 = (ushort *)(param_4 + 4);
      do {
        local_res20[0] = 0.0;
        iVar5 = D3DXIntersectTri(param_3 + (ulonglong)puVar6[-2] * 0xc,
                                 param_3 + (ulonglong)puVar6[-1] * 0xc,
                                 param_3 + (ulonglong)*puVar6 * 0xc,param_5,param_6,local_64,
                                 local_68,local_res20);
        if ((iVar5 != 0) && (bVar7 = 1, local_res20[0] < fVar9)) {
          fVar9 = local_res20[0];
        }
        puVar6 = puVar6 + 3;
        lVar8 = lVar8 + -1;
      } while (lVar8 != 0);
      if (bVar7 == 1) {
        fVar1 = param_6[2];
        fVar2 = param_6[1];
        fVar3 = param_5[2];
        fVar4 = param_5[1];
        *param_1 = fVar9 * *param_6 + *param_5;
        param_1[1] = fVar9 * fVar2 + fVar4;
        param_1[2] = fVar9 * fVar1 + fVar3;
      }
    }
    return (ulonglong)bVar7;
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_1402bbec0(longlong param_1,float *param_2)

{
  float extraout_XMM0_Da;
  float fVar1;
  float local_28;
  float local_24;
  float local_20;
  
  local_28 = param_2[3] + *param_2;
  local_24 = param_2[4] + param_2[1];
  fVar1 = *(float *)(param_1 + 0xc) + param_2[6];
  local_20 = param_2[5] + param_2[2];
  FUN_1402bbbb0(param_2,&local_28,param_1);
  if (extraout_XMM0_Da <= fVar1 * fVar1) {
    return 1;
  }
  return 0;
}



longlong FUN_1402bbf40(longlong param_1,char *param_2)

{
  char cVar1;
  longlong lVar2;
  ulonglong uVar3;
  uint uVar4;
  ulonglong uVar5;
  ulonglong *puVar6;
  longlong lVar7;
  ulonglong *puVar8;
  char *pcVar9;
  ulonglong uVar10;
  
  lVar7 = *(longlong *)(param_1 + 0x70);
  lVar2 = *(longlong *)(param_1 + 0x78);
  if (lVar7 != lVar2) {
    puVar8 = (ulonglong *)(lVar7 + 0x50);
    do {
      uVar5 = 0xffffffffffffffff;
      pcVar9 = param_2;
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        cVar1 = *pcVar9;
        pcVar9 = pcVar9 + 1;
      } while (cVar1 != '\0');
      uVar3 = *puVar8;
      uVar5 = ~uVar5 - 1;
      if (puVar8[1] < 0x10) {
        puVar6 = puVar8 + -2;
      }
      else {
        puVar6 = (ulonglong *)puVar8[-2];
      }
      uVar10 = uVar5;
      if (uVar3 < uVar5) {
        uVar10 = uVar3;
      }
      uVar4 = memcmp(puVar6,param_2,uVar10);
      if (uVar4 == 0) {
        if (uVar5 <= uVar3) {
          uVar4 = (uint)(uVar3 != uVar5);
          goto LAB_1402bbfcf;
        }
      }
      else {
LAB_1402bbfcf:
        if (uVar4 == 0) {
          return lVar7;
        }
      }
      lVar7 = lVar7 + 0x370;
      puVar8 = puVar8 + 0x6e;
    } while (lVar7 != lVar2);
  }
  lVar7 = *(longlong *)(param_1 + 0x210);
  lVar2 = *(longlong *)(param_1 + 0x218);
  if (lVar7 != lVar2) {
    puVar8 = (ulonglong *)(lVar7 + 0x50);
    do {
      uVar5 = 0xffffffffffffffff;
      pcVar9 = param_2;
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        cVar1 = *pcVar9;
        pcVar9 = pcVar9 + 1;
      } while (cVar1 != '\0');
      uVar3 = *puVar8;
      uVar5 = ~uVar5 - 1;
      if (puVar8[1] < 0x10) {
        puVar6 = puVar8 + -2;
      }
      else {
        puVar6 = (ulonglong *)puVar8[-2];
      }
      uVar10 = uVar5;
      if (uVar3 < uVar5) {
        uVar10 = uVar3;
      }
      uVar4 = memcmp(puVar6,param_2,uVar10);
      if (uVar4 == 0) {
        if (uVar5 <= uVar3) {
          uVar4 = (uint)(uVar3 != uVar5);
          goto LAB_1402bc054;
        }
      }
      else {
LAB_1402bc054:
        if (uVar4 == 0) {
          return lVar7;
        }
      }
      lVar7 = lVar7 + 0x370;
      puVar8 = puVar8 + 0x6e;
    } while (lVar7 != lVar2);
  }
  return 0;
}



longlong FUN_1402bc090(longlong param_1,ushort *param_2)

{
  ushort uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong *puVar5;
  uint uVar6;
  ushort *puVar7;
  longlong lVar8;
  ulonglong *puVar9;
  
  lVar8 = *(longlong *)(param_1 + 0x150);
  if (lVar8 != *(longlong *)(param_1 + 0x158)) {
    puVar9 = (ulonglong *)(lVar8 + 0x28);
    do {
      uVar2 = *puVar9;
      uVar4 = 0xffffffffffffffff;
      puVar7 = param_2;
      do {
        if (uVar4 == 0) break;
        uVar4 = uVar4 - 1;
        uVar1 = *puVar7;
        puVar7 = puVar7 + 1;
      } while (uVar1 != 0);
      uVar4 = ~uVar4 - 1;
      if (puVar9[1] < 8) {
        puVar5 = puVar9 + -2;
      }
      else {
        puVar5 = (ulonglong *)puVar9[-2];
      }
      uVar3 = uVar4;
      puVar7 = param_2;
      if (uVar2 < uVar4) {
        uVar3 = uVar2;
      }
      for (; uVar3 != 0; uVar3 = uVar3 - 1) {
        if ((ushort)*puVar5 != *puVar7) {
          uVar6 = 1;
          if ((ushort)*puVar5 < *puVar7) {
            uVar6 = 0xffffffff;
          }
          goto LAB_1402bc127;
        }
        puVar5 = (ulonglong *)((longlong)puVar5 + 2);
        puVar7 = puVar7 + 1;
      }
      uVar6 = 0;
LAB_1402bc127:
      if (uVar6 == 0) {
        if (uVar4 <= uVar2) {
          uVar6 = (uint)(uVar2 != uVar4);
          goto LAB_1402bc13b;
        }
      }
      else {
LAB_1402bc13b:
        if (uVar6 == 0) {
          return lVar8;
        }
      }
      lVar8 = lVar8 + 0x280;
      puVar9 = puVar9 + 0x50;
    } while (lVar8 != *(longlong *)(param_1 + 0x158));
  }
  return 0;
}



longlong FUN_1402bc180(longlong param_1,ushort *param_2)

{
  ushort uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong *puVar5;
  uint uVar6;
  ushort *puVar7;
  longlong lVar8;
  ulonglong *puVar9;
  
  lVar8 = *(longlong *)(param_1 + 0x250);
  if (lVar8 != *(longlong *)(param_1 + 600)) {
    puVar9 = (ulonglong *)(lVar8 + 0x28);
    do {
      uVar2 = *puVar9;
      uVar4 = 0xffffffffffffffff;
      puVar7 = param_2;
      do {
        if (uVar4 == 0) break;
        uVar4 = uVar4 - 1;
        uVar1 = *puVar7;
        puVar7 = puVar7 + 1;
      } while (uVar1 != 0);
      uVar4 = ~uVar4 - 1;
      if (puVar9[1] < 8) {
        puVar5 = puVar9 + -2;
      }
      else {
        puVar5 = (ulonglong *)puVar9[-2];
      }
      uVar3 = uVar4;
      puVar7 = param_2;
      if (uVar2 < uVar4) {
        uVar3 = uVar2;
      }
      for (; uVar3 != 0; uVar3 = uVar3 - 1) {
        if ((ushort)*puVar5 != *puVar7) {
          uVar6 = 1;
          if ((ushort)*puVar5 < *puVar7) {
            uVar6 = 0xffffffff;
          }
          goto LAB_1402bc217;
        }
        puVar5 = (ulonglong *)((longlong)puVar5 + 2);
        puVar7 = puVar7 + 1;
      }
      uVar6 = 0;
LAB_1402bc217:
      if (uVar6 == 0) {
        if (uVar4 <= uVar2) {
          uVar6 = (uint)(uVar2 != uVar4);
          goto LAB_1402bc22b;
        }
      }
      else {
LAB_1402bc22b:
        if (uVar6 == 0) {
          return lVar8;
        }
      }
      lVar8 = lVar8 + 0x328;
      puVar9 = puVar9 + 0x65;
    } while (lVar8 != *(longlong *)(param_1 + 600));
  }
  return 0;
}



longlong FUN_1402bc270(longlong param_1,ushort *param_2)

{
  ushort uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  ulonglong *puVar5;
  uint uVar6;
  ushort *puVar7;
  longlong lVar8;
  ulonglong *puVar9;
  
  lVar8 = *(longlong *)(param_1 + 0x2f0);
  if (lVar8 != *(longlong *)(param_1 + 0x2f8)) {
    puVar9 = (ulonglong *)(lVar8 + 0x28);
    do {
      uVar2 = *puVar9;
      uVar4 = 0xffffffffffffffff;
      puVar7 = param_2;
      do {
        if (uVar4 == 0) break;
        uVar4 = uVar4 - 1;
        uVar1 = *puVar7;
        puVar7 = puVar7 + 1;
      } while (uVar1 != 0);
      uVar4 = ~uVar4 - 1;
      if (puVar9[1] < 8) {
        puVar5 = puVar9 + -2;
      }
      else {
        puVar5 = (ulonglong *)puVar9[-2];
      }
      uVar3 = uVar4;
      puVar7 = param_2;
      if (uVar2 < uVar4) {
        uVar3 = uVar2;
      }
      for (; uVar3 != 0; uVar3 = uVar3 - 1) {
        if ((ushort)*puVar5 != *puVar7) {
          uVar6 = 1;
          if ((ushort)*puVar5 < *puVar7) {
            uVar6 = 0xffffffff;
          }
          goto LAB_1402bc307;
        }
        puVar5 = (ulonglong *)((longlong)puVar5 + 2);
        puVar7 = puVar7 + 1;
      }
      uVar6 = 0;
LAB_1402bc307:
      if (uVar6 == 0) {
        if (uVar4 <= uVar2) {
          uVar6 = (uint)(uVar2 != uVar4);
          goto LAB_1402bc31b;
        }
      }
      else {
LAB_1402bc31b:
        if (uVar6 == 0) {
          return lVar8;
        }
      }
      lVar8 = lVar8 + 0x280;
      puVar9 = puVar9 + 0x50;
    } while (lVar8 != *(longlong *)(param_1 + 0x2f8));
  }
  return 0;
}



undefined8 *
FUN_1402bc360(undefined8 *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  cVar1 = FUN_14008d170(param_1,param_2[1] - *param_2 >> 2,param_3,param_4,0xfffffffffffffffe);
  if (cVar1 != '\0') {
    uVar2 = FUN_14012e4e0(*param_2,param_2[1],*param_1);
    param_1[1] = uVar2;
  }
  return param_1;
}



void FUN_1402bc3c0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1402bc3e0();
  }
  return;
}



undefined8 * FUN_1402bc3e0(undefined8 *param_1)

{
  if ((void *)param_1[0x18] != (void *)0x0) {
    operator_delete__((void *)param_1[0x18]);
  }
  param_1[0x18] = 0;
  if ((void *)param_1[0x19] != (void *)0x0) {
    operator_delete__((void *)param_1[0x19]);
  }
  param_1[0x19] = 0;
  if (7 < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 7;
  param_1[2] = 0;
  *(undefined2 *)param_1 = 0;
  operator_delete(param_1);
  return param_1;
}



undefined8 * FUN_1402bc460(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;
}



undefined2 * FUN_1402bc4d0(undefined2 *param_1)

{
  undefined2 *puVar1;
  int iVar2;
  
  *(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 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x24) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x44) = 0;
  *(undefined8 *)(param_1 + 0x46) = 0;
  *(undefined4 *)(param_1 + 0x4a) = 0;
  *(undefined8 *)(param_1 + 0x4c) = 0;
  *(undefined4 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x52) = 0;
  *(undefined8 *)(param_1 + 0x56) = 0;
  *(undefined8 *)(param_1 + 0x2e) = 0x3f800000;
  *(undefined8 *)(param_1 + 0x32) = 0;
  *(undefined8 *)(param_1 + 0x36) = 0x3f800000;
  *(undefined8 *)(param_1 + 0x3a) = 0;
  *(undefined4 *)(param_1 + 0x3e) = 0x3f800000;
  puVar1 = param_1 + 0x98;
  iVar2 = 0xb;
  *(undefined8 *)(param_1 + 0x5a) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 100) = 0;
  do {
    *(undefined4 *)(puVar1 + 1) = 0;
    *puVar1 = 0;
    puVar1 = puVar1 + 3;
    iVar2 = iVar2 + -1;
  } while (-1 < iVar2);
  *(undefined8 *)(param_1 + 0xd6) = 0;
  *(undefined8 *)(param_1 + 0xd2) = 0;
  *(undefined8 *)(param_1 + 0xcc) = 0;
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined8 *)(param_1 + 0xc2) = 0;
  *(undefined8 *)(param_1 + 0xbe) = 0;
  *(undefined4 *)(param_1 + 0xda) = 0x3f800000;
  *(undefined4 *)(param_1 + 0xd0) = 0x3f800000;
  *(undefined4 *)(param_1 + 0xc6) = 0x3f800000;
  *(undefined4 *)(param_1 + 0xbc) = 0x3f800000;
  return param_1;
}



void * FUN_1402bc5f0(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);
}



longlong * FUN_1402bc630(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_14012baa0(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_14008d170(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_1402bc5f0(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;
}



undefined8 * FUN_1402bc770(undefined8 *param_1)

{
  *param_1 = mcoObjectBase::vftable;
  *(undefined4 *)(param_1 + 1) = 0;
  param_1[2] = 0;
  param_1[5] = 0;
  param_1[6] = 7;
  *(undefined2 *)(param_1 + 3) = 0;
  param_1[10] = 0;
  param_1[0xb] = 0xf;
  *(undefined1 *)(param_1 + 8) = 0;
  param_1[0xd] = 0;
  *(undefined4 *)(param_1 + 0xe) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0x3f800000;
  *(undefined4 *)(param_1 + 0xf) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x7c) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x1a) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0xd4) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x1b) = 0x3f800000;
  *(undefined2 *)((longlong)param_1 + 0xdc) = 0x101;
  *(undefined8 *)((longlong)param_1 + 0x84) = 0;
  *(undefined4 *)(param_1 + 0x10) = 0;
  *(undefined4 *)((longlong)param_1 + 0x8c) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xc4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xbc) = 0;
  param_1[0x16] = 0;
  param_1[0x15] = 0;
  *(undefined8 *)((longlong)param_1 + 0x9c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x94) = 0;
  *(undefined4 *)((longlong)param_1 + 0xcc) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x17) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0xa4) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x12) = 0x3f800000;
  return param_1;
}



void * FUN_1402bc860(void *param_1,uint param_2)

{
  FUN_1402bc9e0();
  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_1402bc890(undefined8 *param_1,undefined8 param_2,undefined4 *param_3,undefined8 *param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined1 auStack_108 [32];
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  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 uStack_70;
  undefined4 uStack_6c;
  undefined1 local_68 [64];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  local_b8 = 0;
  local_bc = 0;
  local_c4 = 0;
  local_c8 = 0;
  local_cc = 0;
  local_d0 = 0;
  local_d8 = 0;
  local_dc = 0;
  local_e0 = 0;
  local_e4 = 0;
  uStack_b0 = 0x3f80000000000000;
  local_c0 = 0x3f800000;
  local_d4 = 0x3f800000;
  local_e8 = 0x3f800000;
  D3DXMatrixRotationQuaternion(&local_e8);
  D3DXMatrixScaling(local_68,*param_3,param_3[1],param_3[2]);
  D3DXMatrixMultiply(&local_a8,local_68,&local_e8);
  uVar2 = *param_4;
  uVar1 = *(undefined4 *)(param_4 + 1);
  *param_1 = local_a8;
  param_1[1] = uStack_a0;
  param_1[2] = local_98;
  param_1[3] = uStack_90;
  uStack_b0 = CONCAT44(uStack_6c,uVar1);
  param_1[4] = local_88;
  param_1[5] = uStack_80;
  param_1[6] = uVar2;
  param_1[7] = uStack_b0;
  return;
}



void FUN_1402bc9c0(longlong param_1)

{
  FUN_1402bc890(param_1 + 0x90,param_1 + 0x80,param_1 + 0x74,param_1 + 0x68);
  return;
}



void FUN_1402bc9e0(undefined8 *param_1)

{
  *param_1 = mcoObjectBase::vftable;
  if (0xf < (ulonglong)param_1[0xb]) {
    operator_delete((void *)param_1[8]);
  }
  param_1[0xb] = 0xf;
  param_1[10] = 0;
  *(undefined1 *)(param_1 + 8) = 0;
  if (7 < (ulonglong)param_1[6]) {
    operator_delete((void *)param_1[3]);
  }
  param_1[6] = 7;
  param_1[5] = 0;
  *(undefined2 *)(param_1 + 3) = 0;
  return;
}



longlong FUN_1402bca50(longlong param_1,longlong param_2)

{
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_2 + 8);
  *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_2 + 0x10);
  FUN_1400015e0(param_1 + 0x18,param_2 + 0x18,0,0xffffffffffffffff);
  FUN_140003d90(param_1 + 0x40,param_2 + 0x40,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x68) = *(undefined4 *)(param_2 + 0x68);
  *(undefined4 *)(param_1 + 0x6c) = *(undefined4 *)(param_2 + 0x6c);
  *(undefined4 *)(param_1 + 0x70) = *(undefined4 *)(param_2 + 0x70);
  *(undefined4 *)(param_1 + 0x74) = *(undefined4 *)(param_2 + 0x74);
  *(undefined4 *)(param_1 + 0x78) = *(undefined4 *)(param_2 + 0x78);
  *(undefined4 *)(param_1 + 0x7c) = *(undefined4 *)(param_2 + 0x7c);
  *(undefined4 *)(param_1 + 0x80) = *(undefined4 *)(param_2 + 0x80);
  *(undefined4 *)(param_1 + 0x84) = *(undefined4 *)(param_2 + 0x84);
  *(undefined4 *)(param_1 + 0x88) = *(undefined4 *)(param_2 + 0x88);
  *(undefined4 *)(param_1 + 0x8c) = *(undefined4 *)(param_2 + 0x8c);
  memcpy((void *)(param_1 + 0x90),(void *)(param_2 + 0x90),0x40);
  *(undefined4 *)(param_1 + 0xd0) = *(undefined4 *)(param_2 + 0xd0);
  *(undefined4 *)(param_1 + 0xd4) = *(undefined4 *)(param_2 + 0xd4);
  *(undefined4 *)(param_1 + 0xd8) = *(undefined4 *)(param_2 + 0xd8);
  *(undefined1 *)(param_1 + 0xdc) = *(undefined1 *)(param_2 + 0xdc);
  *(undefined1 *)(param_1 + 0xdd) = *(undefined1 *)(param_2 + 0xdd);
  return param_1;
}



void FUN_1402bcb60(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0xdd) = param_2;
  return;
}



undefined8 * FUN_1402bcb70(undefined8 *param_1,uint param_2)

{
  *param_1 = mcoCNavigationActor::vftable;
  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 ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402bcbd0(undefined8 *param_1)

{
  *param_1 = mcoCNavigationActor::vftable;
  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;
  return;
}



void FUN_1402bcc20(longlong *param_1,longlong param_2,longlong param_3)

{
  undefined8 uVar1;
  longlong lVar2;
  
  param_1[1] = param_2;
  param_1[2] = param_3;
  param_1[5] = 0;
  *(undefined4 *)((longlong)param_1 + 0x24) = 0;
  if ((param_2 != 0) && (param_3 == 0)) {
    uVar1 = (**(code **)(*param_1 + 0x50))();
    lVar2 = FUN_1402bf6b0(param_1[1],uVar1);
    param_1[2] = lVar2;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402bcc60(longlong *param_1)

{
  longlong *plVar1;
  float fVar2;
  undefined4 *puVar3;
  char cVar4;
  int iVar5;
  undefined4 uVar6;
  float *pfVar7;
  longlong *plVar8;
  undefined8 uVar9;
  longlong lVar10;
  longlong lVar11;
  float fVar12;
  float fVar13;
  undefined4 uVar14;
  undefined1 auStack_b8 [32];
  longlong *local_98;
  undefined4 local_90;
  undefined4 local_88;
  undefined8 local_78;
  float local_70;
  undefined8 local_68;
  float local_60;
  undefined8 local_58;
  float local_50;
  ulonglong local_48;
  
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  if (param_1[1] == 0) {
    return;
  }
  fVar12 = (float)(**(code **)(*param_1 + 0x48))();
  fVar13 = (float)(**(code **)(*param_1 + 0x48))(param_1);
  iVar5 = (**(code **)(*param_1 + 0x70))(param_1);
  lVar10 = param_1[1];
  lVar11 = 0;
  if ((iVar5 < (int)(*(longlong *)(lVar10 + 0x98) - *(longlong *)(lVar10 + 0x90) >> 3)) &&
     (-1 < iVar5)) {
    lVar11 = *(longlong *)(*(longlong *)(lVar10 + 0x90) + (longlong)iVar5 * 8);
  }
  param_1[2] = lVar11;
  if (lVar11 == 0) {
    return;
  }
  if (lVar10 == 0) {
    return;
  }
  if ((char)param_1[10] == '\0') {
    *(undefined1 *)(param_1 + 10) = 0;
    param_1[5] = 0;
    *(undefined4 *)((longlong)param_1 + 0x24) = 0;
    return;
  }
  plVar1 = param_1 + 0x19;
  puVar3 = (undefined4 *)*plVar1;
  if (puVar3 == (undefined4 *)param_1[0x16]) {
    *(undefined1 *)(param_1 + 10) = 0;
    param_1[5] = 0;
    *(undefined4 *)((longlong)param_1 + 0x24) = 0;
    return;
  }
  *(undefined4 *)((longlong)param_1 + 0x24) = *puVar3;
  *(undefined4 *)(param_1 + 5) = puVar3[1];
  *(undefined4 *)((longlong)param_1 + 0x2c) = puVar3[2];
  pfVar7 = (float *)(**(code **)(*param_1 + 0x50))(param_1);
  *(float *)((longlong)param_1 + 0x24) = *(float *)((longlong)param_1 + 0x24) - *pfVar7;
  *(float *)(param_1 + 5) = *(float *)(param_1 + 5) - pfVar7[1];
  *(float *)((longlong)param_1 + 0x2c) = *(float *)((longlong)param_1 + 0x2c) - pfVar7[2];
  fVar2 = *(float *)((longlong)param_1 + 0x24);
  local_68 = *(ulonglong *)((longlong)param_1 + 0x24);
  local_60 = *(float *)((longlong)param_1 + 0x2c);
  if (fVar2 * fVar2 + 0.0 + local_60 * local_60 < 225.0) {
    (**(code **)(*param_1 + 0x58))(param_1,*plVar1);
    *plVar1 = *plVar1 + 0x20;
    if (*plVar1 == param_1[0x16]) {
      *(undefined1 *)(param_1 + 10) = 0;
      param_1[5] = 0;
      *(undefined4 *)((longlong)param_1 + 0x24) = 0;
      return;
    }
    (**(code **)(*param_1 + 0x78))(param_1);
  }
  if (fVar12 * fVar13 <
      *(float *)((longlong)param_1 + 0x24) * *(float *)((longlong)param_1 + 0x24) +
      *(float *)(param_1 + 5) * *(float *)(param_1 + 5) +
      *(float *)((longlong)param_1 + 0x2c) * *(float *)((longlong)param_1 + 0x2c)) {
    D3DXVec3Normalize((longlong)param_1 + 0x24,(longlong)param_1 + 0x24);
    fVar12 = sqrtf(fVar12 * fVar13);
    *(float *)((longlong)param_1 + 0x2c) = fVar12 * *(float *)((longlong)param_1 + 0x2c);
    *(float *)((longlong)param_1 + 0x24) = fVar12 * *(float *)((longlong)param_1 + 0x24);
    *(float *)(param_1 + 5) = fVar12 * *(float *)(param_1 + 5);
  }
  if (ABS(*(float *)((longlong)param_1 + 0x24)) < 0.005) {
    *(undefined4 *)((longlong)param_1 + 0x24) = 0;
  }
  if (ABS(*(float *)(param_1 + 5)) < 0.005) {
    *(undefined4 *)(param_1 + 5) = 0;
  }
  if (ABS(*(float *)((longlong)param_1 + 0x2c)) < 0.005) {
    *(undefined4 *)((longlong)param_1 + 0x2c) = 0;
  }
  local_60 = (float)(*(uint *)((longlong)param_1 + 0x2c) ^ 0x80000000);
  *(uint *)((longlong)param_1 + 0x34) = *(uint *)((longlong)param_1 + 0x24) ^ 0x80000000;
  local_68 = *(ulonglong *)((longlong)param_1 + 0x24) ^ 0x8000000080000000;
  *(float *)(param_1 + 7) = local_68._4_4_;
  *(float *)((longlong)param_1 + 0x3c) = local_60;
  D3DXVec3Normalize((longlong)param_1 + 0x34,(longlong)param_1 + 0x34);
  plVar8 = (longlong *)(**(code **)(*param_1 + 0x68))(param_1,(longlong)param_1 + 0x34);
  local_68 = *plVar8;
  local_60 = *(float *)(plVar8 + 1);
  pfVar7 = (float *)(**(code **)(*param_1 + 0x50))(param_1);
  local_58 = CONCAT44(pfVar7[1] - local_68._4_4_,*pfVar7 - (float)local_68);
  local_50 = pfVar7[2] - local_60;
  if (*(float *)(param_1 + 5) * *(float *)(param_1 + 5) +
      *(float *)((longlong)param_1 + 0x24) * *(float *)((longlong)param_1 + 0x24) +
      *(float *)((longlong)param_1 + 0x2c) * *(float *)((longlong)param_1 + 0x2c) <
      (float)local_68 * (float)local_68 + local_68._4_4_ * local_68._4_4_ + local_60 * local_60) {
    pfVar7 = (float *)(**(code **)(*param_1 + 0x50))(param_1);
    local_70 = pfVar7[2] + *(float *)((longlong)param_1 + 0x2c);
    local_78 = CONCAT44(pfVar7[1] + *(float *)(param_1 + 5),
                        *(float *)((longlong)param_1 + 0x24) + *pfVar7);
    local_58 = local_78;
    local_50 = local_70;
  }
  if ((*(float *)((longlong)param_1 + 0x24) == 0.0) && (*(float *)((longlong)param_1 + 0x2c) == 0.0)
     ) {
    if ((char)param_1[10] == '\0') {
      return;
    }
    param_1[5] = 0;
    *(undefined4 *)((longlong)param_1 + 0x24) = 0;
    *plVar1 = *plVar1 + 0x20;
    if (*plVar1 == param_1[0x16]) {
LAB_1402bd1c6:
      *(undefined1 *)(param_1 + 10) = 0;
      param_1[5] = 0;
      *(undefined4 *)((longlong)param_1 + 0x24) = 0;
      return;
    }
    uVar6 = (**(code **)(*param_1 + 0x80))(param_1);
    uVar14 = (**(code **)(*param_1 + 0x60))(param_1);
    uVar9 = (**(code **)(*param_1 + 0x50))(param_1);
    local_98 = plVar1;
    local_90 = uVar14;
    local_88 = uVar6;
    plVar8 = (longlong *)FUN_1402c0da0(param_1 + 0xb,&local_78,uVar9,param_1[2]);
    *plVar1 = *plVar8;
LAB_1402bd093:
    (**(code **)(*param_1 + 0x78))(param_1);
  }
  else {
    if (param_1[1] == 0) {
      return;
    }
    local_78 = 0;
    local_68 = local_58;
    local_60 = local_50;
    uVar6 = (**(code **)(*param_1 + 0x80))(param_1);
    uVar14 = (**(code **)(*param_1 + 0x60))(param_1);
    uVar9 = (**(code **)(*param_1 + 0x50))(param_1);
    local_98 = (longlong *)CONCAT44(local_98._4_4_,uVar14);
    local_90 = uVar6;
    cVar4 = FUN_1402bfdf0(uVar9,param_1[2],&local_58,&local_78);
    if (cVar4 == '\0') {
      lVar10 = FUN_1402bf6b0(param_1[1],&local_58);
      param_1[2] = lVar10;
      (**(code **)(*param_1 + 0x58))(param_1,&local_58);
      return;
    }
    lVar10 = *param_1;
    if (2.25 < (local_58._4_4_ - local_68._4_4_) * (local_58._4_4_ - local_68._4_4_) +
               ((float)local_58 - (float)local_68) * ((float)local_58 - (float)local_68) +
               (local_50 - local_60) * (local_50 - local_60)) {
      pfVar7 = (float *)(**(code **)(lVar10 + 0x50))(param_1);
      local_68 = *(ulonglong *)pfVar7;
      local_60 = pfVar7[2];
      if ((local_58._4_4_ - pfVar7[1]) * (local_58._4_4_ - pfVar7[1]) +
          ((float)local_58 - *pfVar7) * ((float)local_58 - *pfVar7) +
          (local_50 - local_60) * (local_50 - local_60) < 2.25) {
        if (param_1[0x15] == param_1[0x16]) {
          return;
        }
        (**(code **)(*param_1 + 0x58))(param_1,*plVar1);
        *plVar1 = *plVar1 + 0x20;
        if (*plVar1 == param_1[0x16]) goto LAB_1402bd1c6;
        goto LAB_1402bd093;
      }
      lVar10 = *param_1;
    }
    (**(code **)(lVar10 + 0x58))(param_1,&local_58);
    param_1[2] = local_78;
  }
  return;
}



void FUN_1402bd280(longlong *param_1,undefined4 *param_2,undefined4 *param_3,undefined4 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  undefined8 uVar5;
  longlong *plVar6;
  longlong lVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  undefined1 local_res8 [8];
  undefined4 *puVar10;
  
  if (param_1[1] != 0) {
    lVar7 = 0;
    param_1[5] = 0;
    *(undefined4 *)((longlong)param_1 + 0x24) = 0;
    iVar4 = (**(code **)(*param_1 + 0x70))();
    lVar2 = param_1[1];
    if ((iVar4 < (int)(*(longlong *)(lVar2 + 0x98) - *(longlong *)(lVar2 + 0x90) >> 3)) &&
       (-1 < iVar4)) {
      lVar7 = *(longlong *)(*(longlong *)(lVar2 + 0x90) + (longlong)iVar4 * 8);
    }
    param_1[2] = lVar7;
    if (lVar7 != 0) {
      uVar8 = (**(code **)(*param_1 + 0x60))(param_1);
      uVar5 = (**(code **)(*param_1 + 0x50))(param_1);
      puVar10 = param_2;
      cVar3 = FUN_1402bfad0(param_1[1],param_1 + 0xb,param_1[2],uVar5,param_3,param_2,uVar8,param_4)
      ;
      uVar8 = (undefined4)((ulonglong)puVar10 >> 0x20);
      *(char *)(param_1 + 10) = cVar3;
      if (cVar3 != '\0') {
        FUN_1402c0e70(param_1 + 0xb);
        plVar1 = param_1 + 0x19;
        *plVar1 = param_1[0x15];
        uVar9 = (**(code **)(*param_1 + 0x60))(param_1);
        uVar5 = (**(code **)(*param_1 + 0x50))(param_1);
        plVar6 = (longlong *)
                 FUN_1402c0da0(param_1 + 0xb,local_res8,uVar5,param_1[2],plVar1,
                               CONCAT44(uVar8,uVar9),param_4);
        *plVar1 = *plVar6;
        (**(code **)(*param_1 + 0x78))(param_1);
        *(undefined4 *)(param_1 + 8) = *param_2;
        *(undefined4 *)((longlong)param_1 + 0x44) = param_2[1];
        *(undefined4 *)(param_1 + 9) = param_2[2];
        *(undefined4 *)((longlong)param_1 + 0x4c) = *param_3;
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1402bd3e0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  byte bVar2;
  int iVar3;
  undefined4 uVar4;
  ulonglong uVar5;
  undefined8 uVar6;
  undefined4 uVar7;
  undefined1 auStack_f8 [32];
  undefined8 local_d8;
  undefined8 local_d0;
  undefined4 local_c8;
  undefined4 local_c0;
  undefined8 local_b8;
  undefined1 local_a8 [72];
  undefined8 local_60;
  void *local_58;
  undefined8 local_50;
  undefined8 local_48;
  ulonglong local_38;
  
  local_b8 = 0xfffffffffffffffe;
  uVar5 = DAT_1405d84f0 ^ (ulonglong)auStack_f8;
  if (param_1[1] != 0) {
    local_38 = uVar5;
    uVar5 = (**(code **)(*param_1 + 0x70))();
    lVar1 = param_1[1];
    iVar3 = (int)uVar5;
    if ((iVar3 < (int)(*(longlong *)(lVar1 + 0x98) - *(longlong *)(lVar1 + 0x90) >> 3)) &&
       (-1 < iVar3)) {
      uVar5 = *(ulonglong *)(lVar1 + 0x90);
      lVar1 = *(longlong *)(uVar5 + (longlong)iVar3 * 8);
      if (lVar1 != 0) {
        local_60 = 0;
        local_58 = (void *)0x0;
        local_50 = 0;
        local_48 = 0;
        uVar4 = (**(code **)(*param_1 + 0x80))(param_1);
        uVar7 = (**(code **)(*param_1 + 0x60))(param_1);
        uVar6 = (**(code **)(*param_1 + 0x50))(param_1);
        local_d8 = param_3;
        local_d0 = param_2;
        local_c8 = uVar7;
        local_c0 = uVar4;
        bVar2 = FUN_1402bfad0(param_1[1],local_a8,lVar1,uVar6);
        if (local_58 != (void *)0x0) {
          operator_delete(local_58);
        }
        return (ulonglong)bVar2;
      }
    }
  }
  return uVar5 & 0xffffffffffffff00;
}



void FUN_1402bd530(longlong param_1,float *param_2)

{
  *(float *)(param_1 + 0x24) = *(float *)(param_1 + 0x24) + *param_2;
  *(float *)(param_1 + 0x28) = param_2[1] + *(float *)(param_1 + 0x28);
  *(float *)(param_1 + 0x2c) = param_2[2] + *(float *)(param_1 + 0x2c);
  return;
}



void FUN_1402bd560(longlong param_1,float param_2)

{
  *(float *)(param_1 + 0x24) = param_2 + *(float *)(param_1 + 0x24);
  return;
}



void FUN_1402bd570(longlong param_1,float param_2)

{
  *(float *)(param_1 + 0x28) = param_2 + *(float *)(param_1 + 0x28);
  return;
}



void FUN_1402bd580(longlong param_1,float param_2)

{
  *(float *)(param_1 + 0x2c) = param_2 + *(float *)(param_1 + 0x2c);
  return;
}



void FUN_1402bd590(float *param_1,float *param_2,float *param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  
  param_1[0x12] = *param_2;
  param_1[0x13] = param_2[1];
  param_1[0x14] = param_2[2];
  param_1[0x15] = *param_3;
  param_1[0x16] = param_3[1];
  param_1[0x17] = param_3[2];
  fVar1 = (*param_2 + *param_3) * 0.5;
  *param_1 = fVar1;
  fVar3 = (param_2[1] + param_3[1]) * 0.5;
  param_1[1] = fVar3;
  fVar2 = (param_2[2] + param_3[2]) * 0.5;
  param_1[2] = fVar2;
  param_1[0xc] = ABS(*param_3 - fVar1);
  param_1[0xd] = ABS(param_3[1] - fVar3);
  fVar1 = param_3[2];
  param_1[3] = 1.0;
  param_1[4] = 0.0;
  param_1[7] = 1.0;
  param_1[8] = 0.0;
  param_1[0xb] = 1.0;
  param_1[0xe] = ABS(fVar1 - fVar2);
  param_1[0xf] = param_1[0xc];
  param_1[0x10] = param_1[0xd];
  param_1[0x11] = param_1[0xe];
  param_1[5] = 0.0;
  param_1[6] = 0.0;
  param_1[9] = 0.0;
  param_1[10] = 0.0;
  FUN_1402bdc00();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402bd690(longlong param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  undefined1 auStack_108 [32];
  float local_e8;
  undefined8 local_d8;
  ulonglong uStack_d0;
  undefined8 local_c8;
  ulonglong uStack_c0;
  undefined4 local_b8;
  undefined4 uStack_b4;
  undefined4 uStack_b0;
  undefined4 uStack_ac;
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined4 uStack_a0;
  undefined4 uStack_9c;
  undefined8 local_98;
  undefined8 uStack_90;
  undefined8 local_88;
  undefined8 uStack_80;
  undefined4 local_78;
  undefined4 uStack_74;
  undefined4 uStack_70;
  undefined4 uStack_6c;
  undefined4 local_68;
  undefined4 uStack_64;
  undefined4 uStack_60;
  undefined4 uStack_5c;
  ulonglong local_58;
  
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  uStack_a0 = 0;
  uStack_a4 = 0;
  local_a8 = 0;
  uStack_ac = 0;
  uStack_9c = 0x3f800000;
  local_d8 = *(undefined8 *)(param_1 + 0xc);
  uStack_d0 = (ulonglong)*(uint *)(param_1 + 0x14);
  local_c8 = *(undefined8 *)(param_1 + 0x18);
  local_b8 = *(undefined4 *)(param_1 + 0x24);
  uStack_c0 = (ulonglong)*(uint *)(param_1 + 0x20);
  uStack_b4 = *(undefined4 *)(param_1 + 0x28);
  uStack_b0 = *(undefined4 *)(param_1 + 0x2c);
  D3DXMatrixMultiply(&local_98,uStack_b0,&local_d8);
  local_d8 = local_98;
  uStack_d0 = uStack_90;
  local_c8 = local_88;
  uStack_c0 = uStack_80;
  local_b8 = local_78;
  uStack_b4 = uStack_74;
  uStack_b0 = uStack_70;
  uStack_ac = uStack_6c;
  local_a8 = local_68;
  uStack_a4 = uStack_64;
  uStack_a0 = uStack_60;
  uStack_9c = uStack_5c;
  D3DXVec3TransformCoord(param_1,param_1,&local_d8);
  if ((DAT_1406081bc & 1) == 0) {
    DAT_1406081bc = DAT_1406081bc | 1;
  }
  DAT_1406081c0 = (undefined4)local_d8;
  DAT_1406081c4 = local_d8._4_4_;
  DAT_1406081c8 = (undefined4)uStack_d0;
  *(undefined4 *)(param_1 + 0xc) = (undefined4)local_d8;
  *(undefined4 *)(param_1 + 0x10) = DAT_1406081c4;
  *(undefined4 *)(param_1 + 0x14) = DAT_1406081c8;
  if ((DAT_140608248 & 1) == 0) {
    DAT_140608248 = DAT_140608248 | 1;
  }
  DAT_140608250 = (undefined4)local_c8;
  DAT_140608254 = local_c8._4_4_;
  DAT_140608258 = (undefined4)uStack_c0;
  *(undefined4 *)(param_1 + 0x18) = (undefined4)local_c8;
  *(undefined4 *)(param_1 + 0x1c) = DAT_140608254;
  *(undefined4 *)(param_1 + 0x20) = DAT_140608258;
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a4 = uStack_b4;
  DAT_1406081a0 = local_b8;
  DAT_1406081a8 = uStack_b0;
  *(undefined4 *)(param_1 + 0x24) = local_b8;
  *(undefined4 *)(param_1 + 0x28) = DAT_1406081a4;
  *(undefined4 *)(param_1 + 0x2c) = DAT_1406081a8;
  fVar3 = *(float *)(param_1 + 0x10) * *(float *)(param_1 + 0x10) +
          *(float *)(param_1 + 0xc) * *(float *)(param_1 + 0xc) +
          *(float *)(param_1 + 0x14) * *(float *)(param_1 + 0x14);
  fVar1 = (float)(0x5f3759df - ((int)fVar3 >> 1));
  fVar1 = fVar1 * (1.5 - fVar1 * fVar1 * fVar3 * 0.5);
  fVar4 = *(float *)(param_1 + 0x1c) * *(float *)(param_1 + 0x1c) +
          *(float *)(param_1 + 0x18) * *(float *)(param_1 + 0x18) +
          *(float *)(param_1 + 0x20) * *(float *)(param_1 + 0x20);
  fVar2 = (float)(0x5f3759df - ((int)fVar4 >> 1));
  fVar2 = fVar2 * (1.5 - fVar2 * fVar2 * fVar4 * 0.5);
  fVar5 = *(float *)(param_1 + 0x24) * *(float *)(param_1 + 0x24) +
          *(float *)(param_1 + 0x28) * *(float *)(param_1 + 0x28) +
          *(float *)(param_1 + 0x2c) * *(float *)(param_1 + 0x2c);
  *(float *)(param_1 + 0x30) =
       (1.5 - fVar1 * fVar1 * fVar3 * 0.5) * fVar1 * fVar3 * *(float *)(param_1 + 0x3c);
  *(float *)(param_1 + 0x34) =
       (1.5 - fVar2 * fVar2 * fVar4 * 0.5) * fVar2 * fVar4 * *(float *)(param_1 + 0x40);
  local_e8 = (float)(0x5f3759df - ((int)fVar5 >> 1));
  fVar1 = local_e8 * (1.5 - local_e8 * local_e8 * fVar5 * 0.5);
  *(float *)(param_1 + 0x38) =
       (1.5 - fVar1 * fVar1 * fVar5 * 0.5) * fVar1 * fVar5 * *(float *)(param_1 + 0x44);
  D3DXVec3Normalize(param_1 + 0xc,param_1 + 0xc);
  D3DXVec3Normalize(param_1 + 0x18,param_1 + 0x18);
  D3DXVec3Normalize(param_1 + 0x24,param_1 + 0x24);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402bda90(undefined4 *param_1,undefined4 *param_2)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined1 auStack_88 [32];
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  local_58 = param_1[3];
  local_54 = param_1[4];
  local_50 = param_1[5];
  local_44 = param_1[7];
  local_48 = param_1[6];
  local_38 = param_1[9];
  local_40 = param_1[8];
  local_30 = param_1[0xb];
  local_34 = param_1[10];
  local_20 = 0;
  local_24 = 0;
  local_28 = 0;
  local_2c = 0;
  local_3c = 0;
  local_4c = 0;
  local_1c = 0x3f800000;
  local_60 = 0;
  local_64 = 0;
  local_68 = 0;
  local_5c = 0x3f800000;
  D3DXQuaternionRotationMatrix(&local_68,&local_58);
  D3DXQuaternionNormalize(&local_68,&local_68);
  uVar1 = param_1[2];
  uVar2 = *param_1;
  param_2[1] = param_1[1];
  param_2[2] = uVar1;
  *param_2 = uVar2;
  uVar1 = param_1[0xe];
  uVar2 = param_1[0xc];
  param_2[4] = param_1[0xd];
  param_2[5] = uVar1;
  param_2[3] = uVar2;
  param_2[6] = local_68;
  param_2[7] = local_64;
  param_2[8] = local_60;
  param_2[9] = local_5c;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402bdc00(longlong param_1)

{
  float *pfVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  undefined1 auStack_d8 [64];
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined1 local_58 [64];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_d8;
  local_98 = *(undefined4 *)(param_1 + 0xc);
  local_60 = 0;
  local_64 = 0;
  local_68 = 0;
  local_6c = 0;
  local_7c = 0;
  local_8c = 0;
  local_90 = *(undefined4 *)(param_1 + 0x14);
  local_5c = 0x3f800000;
  local_94 = *(undefined4 *)(param_1 + 0x10);
  local_84 = *(undefined4 *)(param_1 + 0x1c);
  local_88 = *(undefined4 *)(param_1 + 0x18);
  local_80 = *(undefined4 *)(param_1 + 0x20);
  local_78 = *(undefined4 *)(param_1 + 0x24);
  local_74 = *(undefined4 *)(param_1 + 0x28);
  local_70 = *(undefined4 *)(param_1 + 0x2c);
  D3DXMatrixInverse(local_58,0,&local_98);
  pfVar1 = (float *)FUN_14024fab0(param_1,local_58);
  fVar3 = (*pfVar1 - *(float *)(param_1 + 0x30)) - *pfVar1;
  fVar4 = (pfVar1[1] - *(float *)(param_1 + 0x34)) - pfVar1[1];
  fVar2 = (pfVar1[2] - *(float *)(param_1 + 0x38)) - pfVar1[2];
  fVar3 = fVar4 * fVar4 + fVar3 * fVar3 + fVar2 * fVar2;
  fVar2 = (float)(0x5f3759df - ((int)fVar3 >> 1));
  fVar2 = fVar2 * (1.5 - fVar2 * fVar2 * fVar3 * 0.5);
  *(float *)(param_1 + 0x60) = (1.5 - fVar2 * fVar2 * fVar3 * 0.5) * fVar2 * fVar3;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

char FUN_1402bdda0(longlong param_1,float *param_2,undefined4 *param_3,float *param_4,
                  undefined8 param_5)

{
  longlong *plVar1;
  longlong lVar2;
  char cVar3;
  char cVar4;
  int iVar5;
  float *pfVar6;
  longlong *plVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  undefined1 auStack_1b8 [32];
  undefined4 *local_198;
  undefined4 *local_190;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined1 local_178 [48];
  undefined1 local_148 [48];
  undefined4 local_118;
  float local_114;
  undefined4 local_110;
  undefined8 local_108;
  undefined4 local_100;
  undefined8 local_fc;
  undefined8 local_f4;
  undefined8 local_ec;
  undefined8 local_e4;
  undefined4 local_dc;
  undefined8 local_d8;
  undefined4 local_d0;
  undefined8 local_cc;
  undefined4 local_c4;
  undefined8 local_c0;
  undefined4 local_b8;
  undefined8 local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  ulonglong local_78;
  
  local_78 = DAT_1405d84f0 ^ (ulonglong)auStack_1b8;
  plVar1 = *(longlong **)(param_1 + 0x100);
  plVar7 = *(longlong **)(param_1 + 0xf8);
  cVar4 = '\0';
  *param_2 = 1e+06;
  for (; plVar7 != plVar1; plVar7 = plVar7 + 2) {
    lVar2 = *plVar7;
    fVar11 = *(float *)(lVar2 + 0x2c) - param_4[1];
    fVar10 = *(float *)(lVar2 + 0x28) - *param_4;
    fVar8 = *(float *)(lVar2 + 0x30) - param_4[2];
    fVar9 = param_4[3] + *(float *)(lVar2 + 0x34);
    if (fVar11 * fVar11 + fVar10 * fVar10 + fVar8 * fVar8 <= fVar9 * fVar9) {
      FUN_1402bda90(lVar2 + 0x50,local_178);
      FUN_1402bda90(param_5,local_148);
      iVar5 = FUN_1402c21e0(local_178,local_148);
      if (iVar5 != 0) {
        local_a8 = 0;
        local_188 = 0;
        local_184 = 0x3f800000;
        local_180 = 0;
        local_198 = (undefined4 *)CONCAT44(local_198._4_4_,0x3f800000);
        local_fc = 0x3f800000;
        local_f4 = 0;
        local_ec = 0x3f800000;
        local_108 = 0;
        local_100 = 0;
        local_e4 = 0;
        local_dc = 0x3f800000;
        local_d8 = 0;
        local_d0 = 0;
        local_cc = 0;
        local_c4 = 0;
        local_c0 = 0;
        local_b8 = 0;
        local_b4 = 0;
        local_ac = 0;
        cVar3 = FUN_1402c3360(&local_108,*plVar7,param_5,&local_188);
        cVar4 = '\0';
        if (cVar3 != '\0') {
          local_98 = *param_3;
          local_88 = 0;
          local_84 = 0x3f800000;
          local_94 = param_3[1];
          local_80 = 0;
          local_118 = 0;
          local_114 = 0.0;
          local_90 = param_3[2];
          local_110 = 0;
          lVar2 = *plVar7;
          if (*(longlong *)(lVar2 + 0xc0) == 0) {
            cVar4 = '\0';
          }
          else {
            local_190 = &local_88;
            local_198 = &local_98;
            cVar4 = FUN_1402bbd20(&local_118,*(undefined4 *)(lVar2 + 0xb8),
                                  *(longlong *)(lVar2 + 0xc0),*(undefined8 *)(lVar2 + 200));
            if (cVar4 != '\0') {
              pfVar6 = &local_114;
              if (*param_2 <= local_114) {
                pfVar6 = param_2;
              }
              *param_2 = *pfVar6;
            }
          }
        }
      }
    }
  }
  return cVar4;
}



undefined4
FUN_1402be010(longlong param_1,ulonglong *param_2,int *param_3,undefined4 *param_4,
             undefined4 *param_5,undefined8 param_6)

{
  int iVar1;
  undefined4 uVar2;
  void *_Dst;
  undefined4 *puVar3;
  undefined4 *puVar4;
  longlong lVar5;
  undefined4 local_res8 [2];
  longlong local_res10;
  
  _Dst = (void *)*param_2;
  if (_Dst != (void *)param_2[1]) {
    memmove(_Dst,(void *)param_2[1],0);
    param_2[1] = (ulonglong)_Dst;
  }
  if (*(int *)(param_1 + 0xb8) != 0) {
    lVar5 = 0;
    *param_4 = 0;
    *param_5 = 0;
    *param_3 = -1;
    local_res10 = 0;
    if ((*(longlong *)(param_1 + 0xe8) != 0) &&
       (FUN_1402c3870(*(longlong *)(param_1 + 0xe8),param_3,param_6,&local_res10), *param_3 != -1))
    {
      *param_5 = *(undefined4 *)(local_res10 + 0x18);
      *param_4 = *(undefined4 *)(local_res10 + 0x1c);
      iVar1 = *(int *)(local_res10 + 0x90);
      if (0 < (longlong)iVar1) {
        do {
          puVar3 = (undefined4 *)param_2[1];
          uVar2 = *(undefined4 *)(*(longlong *)(local_res10 + 0x98) + lVar5 * 4);
          local_res8[0] = uVar2;
          if ((local_res8 < puVar3) && (puVar4 = (undefined4 *)*param_2, puVar4 <= local_res8)) {
            if (puVar3 == (undefined4 *)param_2[2]) {
              FUN_1400556a0(param_2,1);
            }
            if ((undefined4 *)param_2[1] != (undefined4 *)0x0) {
              *(undefined4 *)param_2[1] =
                   *(undefined4 *)(*param_2 + ((longlong)local_res8 - (longlong)puVar4 >> 2) * 4);
            }
          }
          else {
            if (puVar3 == (undefined4 *)param_2[2]) {
              FUN_1400556a0(param_2,1);
            }
            if ((undefined4 *)param_2[1] != (undefined4 *)0x0) {
              *(undefined4 *)param_2[1] = uVar2;
            }
          }
          param_2[1] = param_2[1] + 4;
          lVar5 = lVar5 + 1;
        } while (lVar5 < iVar1);
      }
      if ((undefined4 *)*param_2 != (undefined4 *)param_2[1]) {
        return *(undefined4 *)*param_2;
      }
    }
  }
  return 0xffffffff;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001402be2f6)
// WARNING: Removing unreachable block (ram,0x0001402be3e0)

undefined4
FUN_1402be1a0(longlong param_1,float *param_2,uint *param_3,uint *param_4,float *param_5,int param_6
             )

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  longlong *plVar4;
  char cVar5;
  uint uVar6;
  ulonglong *puVar7;
  longlong lVar8;
  ulonglong *puVar9;
  int iVar10;
  uint *puVar11;
  int iVar12;
  ulonglong uVar13;
  ulonglong uVar14;
  ulonglong *puVar15;
  int iVar16;
  undefined4 uVar17;
  int iVar18;
  float fVar19;
  undefined1 auStack_1a8 [32];
  float *local_188;
  float *local_180;
  undefined1 *local_178;
  float *local_170;
  float local_168 [2];
  undefined8 local_160;
  float local_158;
  float *local_150;
  float local_148 [2];
  longlong local_140;
  longlong *local_138;
  float *local_130;
  float local_128 [2];
  longlong local_120;
  longlong *local_118;
  float local_110;
  float fStack_10c;
  float local_108;
  uint local_100;
  longlong local_f8;
  uint *local_f0;
  longlong local_e8;
  undefined8 local_e0;
  undefined1 local_d0 [4];
  float local_cc;
  undefined8 local_c8;
  float local_c0;
  float local_bc;
  float local_b8;
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a0;
  float local_9c;
  float local_98;
  ulonglong local_90;
  
  local_c8 = 0xfffffffffffffffe;
  local_90 = DAT_1405d84f0 ^ (ulonglong)auStack_1a8;
  local_150 = param_5;
  if (*(char *)(param_1 + 0xa0) == '\0') {
    local_168[0] = 0.0;
    local_a0 = 0.0;
    local_9c = -1.0;
    local_98 = 0.0;
    local_c0 = *param_5;
    local_bc = param_5[1];
    local_b8 = param_5[2];
    *param_2 = param_5[1];
    local_f0 = (uint *)0x0;
    local_e8 = 0;
    local_e0 = 0;
    local_bc = local_bc + 100.0;
    local_180 = &local_c0;
    local_188 = local_128;
    local_160 = param_3;
    local_130 = param_2;
    local_f8 = param_1;
    uVar6 = FUN_1402be010(local_bc,&local_f0,param_3,local_168);
    *param_4 = uVar6;
    uVar6 = *param_3;
    puVar11 = local_160;
    while (uVar6 != 0xffffffff) {
      iVar18 = 0;
      if (*param_4 != 0xffffffff) {
        FUN_1402bf690(*(undefined8 *)(param_1 + 0xc0),&local_140);
        FUN_1402533e0(*(undefined8 *)(param_1 + 0xc0),&local_120);
        lVar3 = local_120;
        local_b0 = *param_5;
        local_a8 = param_5[2];
        local_ac = param_5[1] + 100.0;
        fVar19 = 1e+07;
        iVar10 = (int)(local_e8 - (longlong)local_f0 >> 2);
        puVar11 = local_f0;
        iVar16 = iVar18;
        if (0 < iVar10) {
          do {
            local_100 = *puVar11;
            lVar8 = (longlong)(int)local_100;
            local_148[0] = 0.0;
            local_170 = local_148;
            local_178 = local_d0;
            local_180 = &local_cc;
            local_188 = &local_a0;
            iVar12 = D3DXIntersectTri((longlong)*(int *)(lVar3 + lVar8 * 0xc) * 0x10 + local_140,
                                      (longlong)*(int *)(lVar3 + 4 + lVar8 * 0xc) * 0x10 + local_140
                                      ,(longlong)*(int *)(lVar3 + 8 + lVar8 * 0xc) * 0x10 +
                                       local_140,&local_b0);
            plVar4 = local_118;
            if ((iVar12 != 0) && (iVar16 = 1, local_148[0] < fVar19)) {
              *param_4 = local_100;
              fVar19 = local_148[0];
            }
            iVar18 = iVar18 + 1;
            puVar11 = puVar11 + 1;
          } while (iVar18 < iVar10);
          param_1 = local_f8;
          if (iVar16 == 1) {
            if (local_118 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_118 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                (**(code **)(*local_118 + 8))(local_118);
                LOCK();
                piVar2 = (int *)((longlong)plVar4 + 0xc);
                *piVar2 = *piVar2 + -1;
                UNLOCK();
                if (*piVar2 == 0) {
                  (**(code **)(*local_118 + 0x10))();
                }
              }
            }
            plVar4 = local_138;
            if (local_138 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_138 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                (**(code **)(*local_138 + 8))(local_138);
                LOCK();
                piVar2 = (int *)((longlong)plVar4 + 0xc);
                *piVar2 = *piVar2 + -1;
                UNLOCK();
                if (*piVar2 == 0) {
                  (**(code **)(*local_138 + 0x10))();
                }
              }
            }
            local_158 = local_a8 + local_98 * fVar19;
            fStack_10c = local_9c * fVar19 + local_ac;
            local_160 = (uint *)CONCAT44(fStack_10c,local_a0 * fVar19 + local_b0);
            local_110 = *local_150;
            local_108 = local_150[2];
            uVar6 = *param_4;
            lVar3 = *(longlong *)(local_f8 + 0xc0);
            uVar17 = 1;
            if (((((int)uVar6 <
                   (int)(*(longlong *)(lVar3 + 0x98) - *(longlong *)(lVar3 + 0x90) >> 3)) &&
                 (-1 < (int)uVar6)) &&
                (lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x90) + (longlong)(int)uVar6 * 8),
                lVar3 != 0)) && (cVar5 = FUN_1402bf5b0(lVar3,&local_110,param_6), cVar5 == '\0')) {
              uVar17 = 2;
            }
            *local_130 = fStack_10c;
            if (local_f0 == (uint *)0x0) {
              return uVar17;
            }
            operator_delete(local_f0);
            return uVar17;
          }
        }
        plVar4 = local_118;
        if (local_118 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_118 + 1;
          lVar3 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar3 == 1) {
            (**(code **)(*local_118 + 8))(local_118);
            LOCK();
            piVar2 = (int *)((longlong)plVar4 + 0xc);
            iVar18 = *piVar2;
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (iVar18 == 1) {
              (**(code **)(*local_118 + 0x10))();
            }
          }
        }
        plVar4 = local_138;
        param_5 = local_150;
        puVar11 = local_160;
        if (local_138 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_138 + 1;
          lVar3 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar3 == 1) {
            (**(code **)(*local_138 + 8))(local_138);
            LOCK();
            piVar2 = (int *)((longlong)plVar4 + 0xc);
            iVar18 = *piVar2;
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            param_5 = local_150;
            puVar11 = local_160;
            if (iVar18 == 1) {
              (**(code **)(*local_138 + 0x10))();
              param_5 = local_150;
              puVar11 = local_160;
            }
          }
        }
      }
      local_bc = local_bc - local_168[0];
      local_180 = &local_c0;
      local_188 = local_128;
      uVar6 = FUN_1402be010(param_1,&local_f0,puVar11,local_168);
      *param_4 = uVar6;
      uVar6 = *puVar11;
    }
    if (local_f0 != (uint *)0x0) {
      operator_delete(local_f0);
    }
  }
  else {
    piVar2 = *(int **)(param_1 + 0xa8);
    if (piVar2 != (int *)0x0) {
      puVar15 = (ulonglong *)0x0;
      iVar16 = 0;
      iVar10 = 0;
      iVar12 = (int)param_5[1];
      iVar18 = iVar16;
      if (((int)*param_5 != *piVar2) && (piVar2[3] != 0)) {
        iVar18 = ((int)*param_5 - *piVar2) / piVar2[3];
      }
      if ((iVar12 != piVar2[1]) && (iVar16 = iVar10, piVar2[4] != 0)) {
        iVar16 = (iVar12 - piVar2[1]) / piVar2[4];
      }
      if (((int)param_5[2] != piVar2[2]) && (piVar2[3] != 0)) {
        iVar10 = ((int)param_5[2] - piVar2[2]) / piVar2[3];
      }
      uVar13 = ((longlong)iVar18 * 0x100000 + (longlong)iVar16) * 0x100000 + (longlong)iVar10;
      uVar14 = ((longlong)iVar18 << 0x20) + (longlong)iVar10;
      puVar9 = puVar15;
      if (*(longlong *)(piVar2 + 0x18) != 0) {
        for (puVar7 = *(ulonglong **)
                       (*(longlong *)(piVar2 + 0x18) +
                       ((uVar14 & 0xffffffff) % (ulonglong)(uint)piVar2[0x1c]) * 8);
            (puVar9 = puVar15, puVar7 != (ulonglong *)0x0 &&
            (((int)puVar7[3] != (int)uVar14 || (puVar9 = puVar7, *puVar7 != uVar14))));
            puVar7 = (ulonglong *)puVar7[2]) {
        }
      }
      if (puVar9 != (ulonglong *)0x0) {
        if (*(float *)((longlong)puVar9 + 0xc) <= param_5[1] + 50.0) {
          *param_3 = (uint)(ushort)puVar9[1];
          *param_4 = (uint)*(ushort *)((longlong)puVar9 + 10);
          *param_2 = *(float *)((longlong)puVar9 + 0xc);
          uVar6 = *param_4;
          lVar3 = *(longlong *)(param_1 + 0xc0);
          if ((int)(*(longlong *)(lVar3 + 0x98) - *(longlong *)(lVar3 + 0x90) >> 3) <= (int)uVar6) {
            return 1;
          }
          if ((int)uVar6 < 0) {
            return 1;
          }
          lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x90) + (longlong)(int)uVar6 * 8);
          if (lVar3 == 0) {
            return 1;
          }
          if (*(char *)(lVar3 + 0xe1) == '\0') {
            return 1;
          }
          if (param_6 == 3) {
            return 1;
          }
          iVar18 = *(int *)(lVar3 + 0xe4);
          if (iVar18 != 0) {
            if (1 < iVar18 - 1U) {
              return 1;
            }
            if (iVar18 != param_6) {
              return 1;
            }
          }
          return 2;
        }
        puVar9 = puVar15;
        if (*(longlong *)(piVar2 + 6) != 0) {
          for (puVar7 = *(ulonglong **)
                         (*(longlong *)(piVar2 + 6) +
                         ((uVar13 & 0xffffffff) % (ulonglong)(uint)piVar2[10]) * 8);
              (puVar9 = puVar15, puVar7 != (ulonglong *)0x0 &&
              (((int)puVar7[3] != (int)uVar13 || (puVar9 = puVar7, *puVar7 != uVar13))));
              puVar7 = (ulonglong *)puVar7[2]) {
          }
        }
        if ((puVar9 != (ulonglong *)0x0) && (puVar9 + 1 != (ulonglong *)0x0)) {
          *param_3 = (uint)(ushort)puVar9[1];
          *param_4 = (uint)*(ushort *)((longlong)puVar9 + 10);
          *param_2 = *(float *)((longlong)puVar9 + 0xc);
          uVar6 = *param_4;
          lVar3 = *(longlong *)(param_1 + 0xc0);
          if ((int)(*(longlong *)(lVar3 + 0x98) - *(longlong *)(lVar3 + 0x90) >> 3) <= (int)uVar6) {
            return 1;
          }
          if ((int)uVar6 < 0) {
            return 1;
          }
          lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x90) + (longlong)(int)uVar6 * 8);
          if (lVar3 == 0) {
            return 1;
          }
          if (*(char *)(lVar3 + 0xe1) == '\0') {
            return 1;
          }
          if (param_6 == 3) {
            return 1;
          }
          iVar18 = *(int *)(lVar3 + 0xe4);
          if (iVar18 != 0) {
            if (1 < iVar18 - 1U) {
              return 1;
            }
            if (iVar18 != param_6) {
              return 1;
            }
          }
          return 2;
        }
      }
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_1402be8a0(longlong param_1,float *param_2,undefined4 *param_3,float *param_4,
                      longlong param_5)

{
  int *piVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *plVar5;
  float *pfVar6;
  char cVar7;
  int iVar8;
  longlong *plVar9;
  float *pfVar10;
  undefined4 *puVar11;
  longlong *plVar12;
  longlong lVar13;
  longlong lVar14;
  longlong *plVar15;
  float fVar16;
  float fVar17;
  float fVar18;
  float fVar19;
  undefined1 auStack_198 [32];
  undefined4 *local_178;
  undefined4 *local_170;
  longlong local_168;
  longlong *local_160;
  longlong *local_158;
  longlong *local_150;
  longlong local_140;
  longlong *local_138;
  undefined4 *local_130;
  float *local_128;
  float *local_120;
  undefined8 local_118;
  undefined1 local_108 [48];
  undefined1 local_d8 [48];
  undefined4 local_a8;
  float local_a4 [3];
  undefined4 local_98;
  float local_94;
  undefined4 local_90;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  ulonglong local_78;
  
  local_118 = 0xfffffffffffffffe;
  local_78 = DAT_1405d84f0 ^ (ulonglong)auStack_198;
  local_168 = param_5;
  if (*(longlong *)(param_1 + 0xf8) != *(longlong *)(param_1 + 0x100)) {
    *param_2 = -100000.0;
    plVar9 = (longlong *)0x0;
    local_160 = (longlong *)0x0;
    local_158 = (longlong *)0x0;
    local_150 = (longlong *)0x0;
    plVar2 = *(longlong **)(param_1 + 0x100);
    plVar12 = *(longlong **)(param_1 + 0xf8);
    plVar15 = plVar9;
    local_130 = param_3;
    local_128 = param_4;
    local_120 = param_2;
    if (plVar12 != plVar2) {
      do {
        lVar14 = *plVar12;
        plVar3 = (longlong *)plVar12[1];
        if (plVar3 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
          UNLOCK();
          plVar9 = local_158;
          plVar15 = local_160;
        }
        fVar19 = local_128[3] + *(float *)(lVar14 + 0x34);
        fVar18 = *(float *)(lVar14 + 0x30) - local_128[2];
        fVar16 = *(float *)(lVar14 + 0x2c) - local_128[1];
        fVar17 = *(float *)(lVar14 + 0x28) - *local_128;
        local_140 = lVar14;
        local_138 = plVar3;
        if (fVar17 * fVar17 + fVar16 * fVar16 + fVar18 * fVar18 <= fVar19 * fVar19) {
          FUN_1402bda90(lVar14 + 0x50,local_108);
          FUN_1402bda90(param_5,local_d8);
          iVar8 = FUN_1402c21e0(local_108,local_d8);
          if (iVar8 != 0) {
            local_168 = lVar14;
            if ((&local_168 < plVar9) && (plVar15 <= &local_168)) {
              lVar14 = (longlong)&local_168 - (longlong)plVar15;
              if (plVar9 == local_150) {
                FUN_140195b20(&local_160);
                plVar9 = local_158;
                plVar15 = local_160;
              }
              if (plVar9 != (longlong *)0x0) {
                *plVar9 = plVar15[lVar14 >> 3];
              }
            }
            else {
              if (plVar9 == local_150) {
                FUN_140195b20(&local_160);
                plVar9 = local_158;
                plVar15 = local_160;
              }
              if (plVar9 != (longlong *)0x0) {
                *plVar9 = lVar14;
              }
            }
            plVar9 = plVar9 + 1;
            local_158 = plVar9;
          }
        }
        plVar5 = local_138;
        if (plVar3 != (longlong *)0x0) {
          LOCK();
          plVar3 = plVar3 + 1;
          *(int *)plVar3 = (int)*plVar3 + -1;
          UNLOCK();
          plVar9 = local_158;
          plVar15 = local_160;
          if ((int)*plVar3 == 0) {
            (**(code **)(*local_138 + 8))(local_138);
            LOCK();
            piVar1 = (int *)((longlong)plVar5 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            plVar9 = local_158;
            plVar15 = local_160;
            if (*piVar1 == 0) {
              (**(code **)(*local_138 + 0x10))();
              plVar9 = local_158;
              plVar15 = local_160;
            }
          }
        }
        pfVar6 = local_120;
        plVar12 = plVar12 + 2;
      } while (plVar12 != plVar2);
      if (plVar15 != plVar9) {
        local_88 = 0;
        local_84 = 0xbf800000;
        local_80 = 0;
        lVar13 = 0;
        iVar8 = (int)((longlong)plVar9 - (longlong)plVar15 >> 3);
        puVar11 = local_130;
        lVar14 = lVar13;
        if (0 < iVar8) {
          do {
            lVar4 = plVar15[lVar13];
            local_98 = *puVar11;
            local_90 = puVar11[2];
            local_94 = *(float *)(lVar4 + 0x48) + 10.0;
            local_a8 = 0;
            local_a4[0] = 0.0;
            local_a4[1] = 0.0;
            if ((*(longlong *)(lVar4 + 0xc0) != 0) && (*(longlong *)(lVar4 + 200) != 0)) {
              local_170 = &local_88;
              local_178 = &local_98;
              cVar7 = FUN_1402bbd20(&local_a8,*(undefined4 *)(lVar4 + 0xb8));
              puVar11 = local_130;
              if (cVar7 != '\0') {
                pfVar10 = local_a4;
                if (local_a4[0] < *pfVar6 || local_a4[0] == *pfVar6) {
                  pfVar10 = pfVar6;
                }
                *pfVar6 = *pfVar10;
                lVar14 = 1;
              }
            }
            lVar13 = lVar13 + 1;
          } while (lVar13 < iVar8);
        }
        if (plVar15 == (longlong *)0x0) {
          return lVar14;
        }
        operator_delete(plVar15);
        return lVar14;
      }
    }
    if (plVar15 != (longlong *)0x0) {
      operator_delete(plVar15);
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4
FUN_1402bec00(longlong param_1,ulonglong *param_2,int *param_3,undefined4 *param_4,
             undefined4 param_5)

{
  int iVar1;
  int iVar2;
  void *_Dst;
  longlong lVar3;
  int *piVar4;
  int *piVar5;
  char cVar6;
  undefined4 *puVar7;
  longlong lVar8;
  float fVar9;
  undefined1 auStack_a8 [32];
  int local_88 [2];
  longlong local_80;
  undefined4 local_78;
  float local_74;
  undefined4 local_70;
  ulonglong local_68;
  
  local_68 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  _Dst = (void *)*param_2;
  if (_Dst != (void *)param_2[1]) {
    memmove(_Dst,(void *)param_2[1],0);
    param_2[1] = (ulonglong)_Dst;
  }
  if (*(int *)(param_1 + 0xb8) != 0) {
    *param_3 = -1;
    local_80 = 0;
    if ((*(longlong *)(param_1 + 0xe8) != 0) &&
       (FUN_1402c3870(*(longlong *)(param_1 + 0xe8),param_3,param_4,&local_80), *param_3 != -1)) {
      iVar1 = *(int *)(local_80 + 0x90);
      lVar8 = 0;
      fVar9 = *(float *)(local_80 + 0x1c);
      if (0 < (longlong)iVar1) {
        do {
          lVar3 = *(longlong *)(param_1 + 0xc0);
          iVar2 = *(int *)(*(longlong *)(local_80 + 0x98) + lVar8 * 4);
          local_88[0] = iVar2;
          if ((((iVar2 < (int)(*(longlong *)(lVar3 + 0x98) - *(longlong *)(lVar3 + 0x90) >> 3)) &&
               (-1 < iVar2)) &&
              (lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x90) + (longlong)iVar2 * 8), lVar3 != 0)
              ) && (cVar6 = FUN_1402bf5b0(lVar3,param_4,param_5), cVar6 != '\0')) {
            piVar4 = (int *)param_2[1];
            if ((local_88 < piVar4) && (piVar5 = (int *)*param_2, piVar5 <= local_88)) {
              if (piVar4 == (int *)param_2[2]) {
                FUN_1400556a0(param_2,1);
              }
              if ((undefined4 *)param_2[1] != (undefined4 *)0x0) {
                *(undefined4 *)param_2[1] =
                     *(undefined4 *)(*param_2 + ((longlong)local_88 - (longlong)piVar5 >> 2) * 4);
              }
            }
            else {
              if (piVar4 == (int *)param_2[2]) {
                FUN_1400556a0(param_2,1);
              }
              if ((int *)param_2[1] != (int *)0x0) {
                *(int *)param_2[1] = iVar2;
              }
            }
            param_2[1] = param_2[1] + 4;
          }
          lVar8 = lVar8 + 1;
        } while (lVar8 < iVar1);
      }
      puVar7 = (undefined4 *)*param_2;
      if (puVar7 == (undefined4 *)param_2[1]) {
        local_78 = *param_4;
        local_74 = (float)param_4[1];
        local_70 = param_4[2];
        while( true ) {
          *param_3 = -1;
          local_74 = local_74 - fVar9;
          local_80 = 0;
          if ((*(longlong *)(param_1 + 0xe8) == 0) ||
             (FUN_1402c3870(*(longlong *)(param_1 + 0xe8),param_3,&local_78,&local_80),
             *param_3 == -1)) break;
          lVar8 = 0;
          iVar1 = *(int *)(local_80 + 0x90);
          fVar9 = *(float *)(local_80 + 0x1c);
          if (0 < (longlong)iVar1) {
            do {
              lVar3 = *(longlong *)(param_1 + 0xc0);
              iVar2 = *(int *)(*(longlong *)(local_80 + 0x98) + lVar8 * 4);
              local_88[0] = iVar2;
              if ((((iVar2 < (int)(*(longlong *)(lVar3 + 0x98) - *(longlong *)(lVar3 + 0x90) >> 3))
                   && (-1 < iVar2)) &&
                  (lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x90) + (longlong)iVar2 * 8),
                  lVar3 != 0)) && (cVar6 = FUN_1402bf5b0(lVar3,param_4,param_5), cVar6 != '\0')) {
                piVar4 = (int *)param_2[1];
                if ((local_88 < piVar4) && (piVar5 = (int *)*param_2, piVar5 <= local_88)) {
                  if (piVar4 == (int *)param_2[2]) {
                    FUN_1400556a0(param_2,1);
                  }
                  if ((undefined4 *)param_2[1] != (undefined4 *)0x0) {
                    *(undefined4 *)param_2[1] =
                         *(undefined4 *)
                          (*param_2 + ((longlong)local_88 - (longlong)piVar5 >> 2) * 4);
                  }
                }
                else {
                  if (piVar4 == (int *)param_2[2]) {
                    FUN_1400556a0(param_2,1);
                  }
                  if ((int *)param_2[1] != (int *)0x0) {
                    *(int *)param_2[1] = iVar2;
                  }
                }
                param_2[1] = param_2[1] + 4;
              }
              lVar8 = lVar8 + 1;
            } while (lVar8 < iVar1);
          }
        }
        puVar7 = (undefined4 *)*param_2;
        if (puVar7 == (undefined4 *)param_2[1]) {
          return 0xffffffff;
        }
      }
      return *puVar7;
    }
  }
  return 0xffffffff;
}



void FUN_1402bef70(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_90 [72];
  undefined1 local_48 [72];
  
  uVar1 = FUN_1402bf340(local_48,param_1,param_3,param_4,0xfffffffffffffffe);
  FUN_1402bf390(local_90,uVar1);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_90,(ThrowInfo *)&DAT_1405d3810);
}



undefined8 * FUN_1402befb0(undefined8 *param_1)

{
  FUN_1402beff0();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[3] = boost::exception_detail::clone_impl<>::vftable;
  param_1[8] = boost::exception_detail::clone_impl<>::vftable;
  return param_1;
}



exception * FUN_1402beff0(exception *param_1,exception *param_2)

{
  longlong *plVar1;
  
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::bad_function_call::vftable;
  if (param_2 != (exception *)0x0) {
    param_2 = param_2 + 0x18;
  }
  *(undefined ***)(param_1 + 0x18) = boost::exception::vftable;
  plVar1 = *(longlong **)(param_2 + 8);
  *(longlong **)(param_1 + 0x20) = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))();
  }
  *(undefined8 *)(param_1 + 0x28) = *(undefined8 *)(param_2 + 0x10);
  *(undefined8 *)(param_1 + 0x30) = *(undefined8 *)(param_2 + 0x18);
  *(undefined4 *)(param_1 + 0x38) = *(undefined4 *)(param_2 + 0x20);
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x18) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



exception * FUN_1402bf080(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::bad_function_call::vftable;
  return param_1;
}



exception * FUN_1402bf0b0(exception *param_1,uint param_2)

{
  *(undefined ***)(param_1 + 0x40) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x18) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x20) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x20))();
  }
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



exception * FUN_1402bf120(exception *param_1,uint param_2)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x18) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x20) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x20))();
  }
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402bf180(exception *param_1)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x18) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x20) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x20))();
  }
                    // WARNING: Could not recover jumptable at 0x0001402bf1b5. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



void FUN_1402bf1c0(exception *param_1)

{
  *(undefined ***)(param_1 + 0x40) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x18) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x20) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 0x20))();
  }
                    // WARNING: Could not recover jumptable at 0x0001402bf200. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



undefined8 *
FUN_1402bf210(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x48);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_1402beff0(puVar1,param_1 + -0x40,param_3,param_4,uVar2);
    *puVar1 = boost::exception_detail::clone_impl<>::vftable;
    puVar1[3] = boost::exception_detail::clone_impl<>::vftable;
    puVar1[8] = boost::exception_detail::clone_impl<>::vftable;
  }
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    puVar1 = puVar1 + 8;
  }
  return puVar1;
}



void FUN_1402bf290(longlong param_1)

{
  longlong lVar1;
  undefined **local_50 [3];
  undefined **local_38;
  longlong *local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined4 local_18;
  undefined **local_10;
  
  std::exception::exception((exception *)local_50,(exception *)(param_1 + -0x40));
  local_50[0] = boost::bad_function_call::vftable;
  lVar1 = 0;
  if ((exception *)(param_1 + -0x40) != (exception *)0x0) {
    lVar1 = param_1 + -0x28;
  }
  local_38 = boost::exception::vftable;
  local_30 = *(longlong **)(lVar1 + 8);
  if (local_30 != (longlong *)0x0) {
    (**(code **)(*local_30 + 0x18))();
  }
  local_28 = *(undefined8 *)(lVar1 + 0x10);
  local_20 = *(undefined8 *)(lVar1 + 0x18);
  local_18 = *(undefined4 *)(lVar1 + 0x20);
  local_50[0] = boost::exception_detail::clone_impl<>::vftable;
  local_38 = boost::exception_detail::clone_impl<>::vftable;
  local_10 = boost::exception_detail::clone_impl<>::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d3810);
}



exception * FUN_1402bf340(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined4 *)(param_1 + 0x38) = 0xffffffff;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x18) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



undefined8 FUN_1402bf390(undefined8 param_1)

{
  FUN_1402bf3b0();
  return param_1;
}



undefined8 * FUN_1402bf3b0(undefined8 *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_1402beff0();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[3] = boost::exception_detail::clone_impl<>::vftable;
  param_1[8] = boost::exception_detail::clone_impl<>::vftable;
  if (param_2 != 0) {
    param_2 = param_2 + 0x18;
  }
  plVar1 = *(longlong **)(param_2 + 8);
  if ((longlong *)param_1[4] != (longlong *)0x0) {
    (**(code **)(*(longlong *)param_1[4] + 0x20))();
  }
  param_1[4] = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))(plVar1);
  }
  param_1[5] = *(undefined8 *)(param_2 + 0x10);
  param_1[6] = *(undefined8 *)(param_2 + 0x18);
  *(undefined4 *)(param_1 + 7) = *(undefined4 *)(param_2 + 0x20);
  return param_1;
}



void FUN_1402bf450(longlong param_1)

{
  FUN_1402bf0b0(param_1 + -0x18);
  return;
}



void FUN_1402bf460(longlong param_1)

{
  FUN_1402bf0b0(param_1 + -0x40);
  return;
}



void FUN_1402bf470(longlong param_1)

{
  FUN_1402bf120(param_1 + -0x18);
  return;
}



void FUN_1402bf480(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar1 = (undefined8 *)(param_1 + 4);
  *(undefined8 *)(param_1 + 0x14) = 0;
  puVar2 = puVar1;
  if (7 < *(ulonglong *)(param_1 + 0x1c)) {
    puVar2 = (undefined8 *)*puVar1;
  }
  *(undefined2 *)puVar2 = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1c)) {
    operator_delete((void *)*puVar1);
  }
  *(undefined8 *)(param_1 + 0x1c) = 7;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined2 *)puVar1 = 0;
  return;
}



void FUN_1402bf4d0(undefined8 *param_1)

{
  *param_1 = boost::exception_detail::clone_base::vftable;
  return;
}



undefined8 * FUN_1402bf4e0(undefined8 *param_1,byte param_2)

{
  *param_1 = boost::exception_detail::clone_base::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1402bf520(undefined8 *param_1,longlong param_2)

{
  longlong *plVar1;
  
  *param_1 = boost::exception::vftable;
  plVar1 = *(longlong **)(param_2 + 8);
  param_1[1] = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))();
  }
  param_1[2] = *(undefined8 *)(param_2 + 0x10);
  param_1[3] = *(undefined8 *)(param_2 + 0x18);
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 0x20);
  return param_1;
}



exception * FUN_1402bf580(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = std::runtime_error::vftable;
  return param_1;
}



ulonglong FUN_1402bf5b0(longlong param_1,float *param_2,int param_3)

{
  int iVar1;
  float *in_RAX;
  longlong lVar2;
  float fVar3;
  float fVar4;
  
  if ((*(char *)(param_1 + 0xe0) == '\0') &&
     (((*(char *)(param_1 + 0xe1) == '\0' || (param_3 == 3)) ||
      ((iVar1 = *(int *)(param_1 + 0xe4), iVar1 != 0 &&
       ((in_RAX = (float *)(ulonglong)(iVar1 - 1U), 1 < iVar1 - 1U || (iVar1 != param_3)))))))) {
    fVar4 = *param_2 - *(float *)(param_1 + 0x38);
    fVar3 = param_2[2] - *(float *)(param_1 + 0x40);
    if (fVar3 * fVar3 + fVar4 * fVar4 <= *(float *)(param_1 + 0x148) * *(float *)(param_1 + 0x148))
    {
      lVar2 = 0;
      in_RAX = (float *)(param_1 + 0xb8);
      while (0.0 <= param_2[1] * in_RAX[-1] + *param_2 * in_RAX[-2] + param_2[2] * *in_RAX +
                    in_RAX[1]) {
        lVar2 = lVar2 + 1;
        in_RAX = in_RAX + 4;
        if (2 < lVar2) {
          return CONCAT71((int7)((ulonglong)in_RAX >> 8),1);
        }
      }
    }
    return (ulonglong)in_RAX & 0xffffffffffffff00;
  }
  return (ulonglong)in_RAX & 0xffffffffffffff00;
}



undefined8 * FUN_1402bf690(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0x60);
  lVar1 = *(longlong *)(param_1 + 0x68);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



longlong FUN_1402bf6b0(longlong param_1,float *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  bool bVar3;
  bool bVar4;
  float fVar5;
  longlong lVar6;
  char cVar7;
  int iVar8;
  longlong lVar9;
  longlong *plVar10;
  char *pcVar11;
  int iVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  longlong local_150;
  float local_110;
  float local_10c;
  float local_108;
  float local_104;
  undefined8 local_100;
  undefined8 local_f8 [2];
  undefined1 local_e8;
  
  plVar1 = *(longlong **)(param_1 + 0x98);
  plVar10 = *(longlong **)(param_1 + 0x90);
  bVar3 = false;
  lVar9 = 0;
  fVar16 = 3.4e+38;
  bVar4 = false;
  local_150 = 0;
  fVar5 = 3.4e+38;
  do {
    if (plVar10 == plVar1) {
      return lVar9;
    }
    lVar2 = *plVar10;
    fVar15 = fVar5;
    lVar6 = local_150;
    if (lVar2 != 0) {
      local_110 = *param_2;
      local_10c = param_2[2];
      cVar7 = FUN_1402c0a80(lVar2,&local_110);
      if (cVar7 != '\0') {
        if (*(float *)(lVar2 + 8) == 0.0) {
          fVar13 = 0.0;
        }
        else {
          fVar13 = -((param_2[2] * *(float *)(lVar2 + 0xc) + *param_2 * *(float *)(lVar2 + 4) +
                     *(float *)(lVar2 + 0x10)) / *(float *)(lVar2 + 8));
        }
        fVar13 = ABS(fVar13 - param_2[1]);
        if (!bVar3) {
          bVar4 = true;
          lVar9 = lVar2;
          fVar16 = fVar13;
          lVar6 = lVar2;
          bVar3 = true;
          goto LAB_1402bf982;
        }
        if (fVar13 < fVar16) {
          fVar16 = fVar13;
          local_150 = lVar2;
        }
      }
      lVar9 = local_150;
      lVar6 = local_150;
      if (!bVar3) {
        fVar15 = *(float *)(lVar2 + 0x38);
        fVar13 = *(float *)(lVar2 + 0x40);
        iVar12 = 0;
        local_100 = CONCAT44(fVar13,fVar15);
        pcVar11 = (char *)(lVar2 + 0x5c);
        local_f8[0] = CONCAT44(param_2[2],*param_2);
        local_e8 = 0;
        do {
          lVar9 = (longlong)iVar12 * 0x1c + 0x44 + lVar2;
          iVar8 = FUN_1402c09f0(lVar9,local_f8,0);
          bVar3 = bVar4;
          if (iVar8 != 2) {
            if (*pcVar11 == '\0') {
              FUN_1402c0980(pcVar11 + -0x18);
            }
            fVar14 = (fVar13 - *(float *)(pcVar11 + -0x14)) * *(float *)(pcVar11 + -4) +
                     (fVar15 - *(float *)(pcVar11 + -0x18)) * *(float *)(pcVar11 + -8);
            if (((0.0 < fVar14) || (-0.0 <= fVar14)) &&
               ((iVar8 = FUN_1402c1c00(&local_100,lVar9,&local_108), iVar8 == 2 || (iVar8 == 3)))) {
              if (*(float *)(lVar2 + 8) == 0.0) {
                fVar15 = 0.0;
              }
              else {
                fVar15 = -((local_104 * *(float *)(lVar2 + 0xc) + local_108 * *(float *)(lVar2 + 4)
                           + *(float *)(lVar2 + 0x10)) / *(float *)(lVar2 + 8));
              }
              fVar15 = (fVar15 - param_2[1]) * (fVar15 - param_2[1]) +
                       (local_108 - *param_2) * (local_108 - *param_2) +
                       (local_104 - param_2[2]) * (local_104 - param_2[2]);
              fVar13 = (float)(0x5f3759df - ((int)fVar15 >> 1));
              fVar13 = fVar13 * (1.5 - fVar13 * fVar13 * fVar15 * 0.5);
              fVar15 = (1.5 - fVar13 * fVar13 * fVar15 * 0.5) * fVar13 * fVar15;
              lVar9 = lVar2;
              lVar6 = lVar2;
              if (fVar15 < fVar5) goto LAB_1402bf982;
              break;
            }
          }
          iVar12 = iVar12 + 1;
          pcVar11 = pcVar11 + 0x1c;
        } while (iVar12 < 3);
        lVar9 = local_150;
        fVar15 = fVar5;
        lVar6 = local_150;
      }
    }
LAB_1402bf982:
    local_150 = lVar6;
    plVar10 = plVar10 + 1;
    fVar5 = fVar15;
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x0001402bfb50)

undefined8
FUN_1402bfad0(longlong param_1,longlong param_2,longlong param_3,undefined4 *param_4,
             longlong param_5,undefined8 param_6,undefined4 param_7,undefined4 param_8)

{
  undefined4 uVar1;
  longlong *plVar2;
  bool bVar3;
  char cVar4;
  int iVar5;
  longlong lVar6;
  float fVar7;
  float fVar8;
  float local_res8;
  float local_resc;
  undefined8 local_res20;
  float local_98;
  undefined8 local_88;
  longlong local_80;
  
  *(int *)(param_1 + 0xb0) = *(int *)(param_1 + 0xb0) + 1;
  *(undefined4 *)(param_1 + 0xe4) = *param_4;
  *(undefined4 *)(param_1 + 0xe8) = param_4[1];
  uVar1 = param_4[2];
  *(undefined4 *)(param_1 + 0xe0) = *(undefined4 *)(param_1 + 0xb0);
  *(undefined4 *)(param_1 + 0xec) = uVar1;
  bVar3 = false;
  if (*(longlong *)(param_1 + 0xc0) != *(longlong *)(param_1 + 200)) {
    *(longlong *)(param_1 + 200) = *(longlong *)(param_1 + 0xc0);
  }
  local_res20 = param_4;
  FUN_1402c16a0(param_5,param_1 + 0xb8,0,0);
  if ((*(longlong *)(param_1 + 200) - *(longlong *)(param_1 + 0xc0) & 0xfffffffffffffff0U) != 0) {
    do {
      if (bVar3) goto LAB_1402bfc59;
      plVar2 = *(longlong **)(param_1 + 0xc0);
      local_80 = plVar2[1];
      lVar6 = *plVar2;
      if (0x10 < (longlong)(*(longlong *)(param_1 + 200) - (longlong)plVar2 & 0xfffffffffffffff0U))
      {
        FUN_1402c0870(plVar2,*(longlong *)(param_1 + 200),*(undefined1 *)(param_1 + 0xb8));
      }
      if (*(longlong *)(param_1 + 0xc0) != *(longlong *)(param_1 + 200)) {
        *(longlong *)(param_1 + 200) = *(longlong *)(param_1 + 200) + -0x10;
      }
      if (lVar6 == param_3) {
        bVar3 = true;
      }
      else {
        FUN_1402c1570(lVar6,param_1 + 0xb8,param_7,param_8);
      }
    } while ((*(longlong *)(param_1 + 200) - *(longlong *)(param_1 + 0xc0) & 0xfffffffffffffff0U) !=
             0);
    if (bVar3) {
LAB_1402bfc59:
      if (param_3 != 0) {
        FUN_1402c0bd0(param_2,param_1,local_res20,param_3,param_6,param_5);
        iVar5 = 0;
        do {
          if (param_3 == param_5) break;
          lVar6 = (longlong)*(int *)(param_3 + 0x114);
          local_98 = *(float *)(param_3 + 0x118 + lVar6 * 0xc);
          fVar7 = *(float *)(param_3 + 0x120 + lVar6 * 0xc);
          local_res8 = local_98;
          local_resc = fVar7;
          cVar4 = FUN_1402c0a80(param_3,&local_res8);
          if (cVar4 == '\0') {
            local_res20 = (undefined4 *)CONCAT44(fVar7,local_98);
            cVar4 = FUN_1402c13d0(param_3,&local_res20);
            if (cVar4 != '\0') {
              local_98 = (float)local_res20;
              fVar7 = local_res20._4_4_;
            }
          }
          if (*(float *)(param_3 + 8) == 0.0) {
            fVar8 = 0.0;
          }
          else {
            fVar8 = -((fVar7 * *(float *)(param_3 + 0xc) + local_98 * *(float *)(param_3 + 4) +
                      *(float *)(param_3 + 0x10)) / *(float *)(param_3 + 8));
          }
          local_88 = CONCAT44(fVar8,local_98);
          local_80 = CONCAT44(local_80._4_4_,fVar7);
          FUN_1402c0c80(param_2,&local_88,param_3);
          param_3 = *(longlong *)(param_3 + 0x98 + lVar6 * 8);
          iVar5 = iVar5 + 1;
          if (100 < iVar5) {
            FUN_1402c0fb0(param_2 + 0x50,param_2 + 0x28);
            return 0;
          }
        } while (param_3 != 0);
        FUN_1402c0fb0(param_2 + 0x50,param_2 + 0x28);
        return 1;
      }
    }
  }
  return 0;
}



undefined8
FUN_1402bfdf0(float *param_1,longlong param_2,float *param_3,longlong *param_4,float param_5,
             int param_6)

{
  int iVar1;
  undefined8 uVar2;
  float *pfVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  int local_res8;
  int local_res10;
  undefined8 local_138;
  float local_130;
  float fStack_12c;
  float local_128;
  float fStack_124;
  undefined8 local_120;
  float local_118;
  float fStack_114;
  undefined8 local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined1 local_f0;
  
  fVar9 = *param_3;
  fVar7 = param_3[2];
  local_f0 = 0;
  fVar11 = *param_1;
  fVar10 = param_1[2];
  local_100 = CONCAT44(fVar7,fVar9);
  local_res10 = 0;
  uVar2 = CONCAT44(fVar10,fVar11);
  local_res8 = 0;
  local_108 = uVar2;
  do {
    if ((fVar11 == fVar9) && (fVar10 == fVar7)) break;
    iVar4 = 0;
    iVar5 = 0;
    pfVar3 = (float *)(param_2 + 0x58);
    lVar6 = 0;
    do {
      if (*(char *)(pfVar3 + 1) == '\0') {
        local_130 = pfVar3[-3] - pfVar3[-5];
        fStack_12c = pfVar3[-2] - pfVar3[-4];
        *(ulonglong *)(pfVar3 + -1) = CONCAT44(fStack_12c,local_130);
        D3DXVec2Normalize(pfVar3 + -1,pfVar3 + -1);
        *(undefined1 *)(pfVar3 + 1) = 1;
        fVar8 = pfVar3[-1];
        pfVar3[-1] = *pfVar3;
        *pfVar3 = -fVar8;
      }
      if (0.0 < (fVar7 - pfVar3[-4]) * *pfVar3 + (fVar9 - pfVar3[-5]) * pfVar3[-1]) {
        iVar4 = iVar4 + 1;
      }
      else {
        if (*(char *)(pfVar3 + 1) == '\0') {
          local_128 = pfVar3[-3] - pfVar3[-5];
          fStack_124 = pfVar3[-2] - pfVar3[-4];
          *(ulonglong *)(pfVar3 + -1) = CONCAT44(fStack_124,local_128);
          D3DXVec2Normalize(pfVar3 + -1,pfVar3 + -1);
          *(undefined1 *)(pfVar3 + 1) = 1;
          fVar8 = pfVar3[-1];
          pfVar3[-1] = *pfVar3;
          *pfVar3 = -fVar8;
        }
        fVar8 = (fVar10 - pfVar3[-4]) * *pfVar3 + (fVar11 - pfVar3[-5]) * pfVar3[-1];
        if (((0.0 < fVar8) || (-0.0 <= fVar8)) &&
           ((iVar1 = FUN_1402c1c00(&local_108,(longlong)iVar5 * 0x1c + 0x44 + param_2,&local_120),
            iVar1 == 2 || (iVar1 == 3)))) {
          lVar6 = *(longlong *)(param_2 + 0x98 + lVar6 * 8);
          iVar4 = 2;
          if (lVar6 != 0) {
            uVar2 = local_120;
            if (param_6 == 3) goto LAB_1402c01f7;
            if ((*(char *)(lVar6 + 0xe1) == '\0') ||
               ((iVar1 = *(int *)(lVar6 + 0xe4), iVar1 != 0 &&
                ((1 < iVar1 - 1U || (iVar1 != param_6)))))) {
              if (param_5 < *(float *)(lVar6 + 0xec)) {
                if (*(char *)(lVar6 + 0x100) == '\0') goto LAB_1402c01f7;
                if (*(float *)(param_2 + 0xf0) < *(float *)(lVar6 + 0xf0)) goto LAB_1402c010a;
              }
              if ((*(char *)(lVar6 + 0x100) == '\0') ||
                 (*(float *)(lVar6 + 0xf0) - *(float *)(param_2 + 0xf0) <= param_5))
              goto LAB_1402c01f7;
            }
          }
LAB_1402c010a:
          local_f0 = 0;
          local_108 = local_120;
          FUN_1402c11d0(param_2,iVar5,&local_108);
          local_f0 = 0;
          fVar9 = ((float)local_100 - (float)local_108) * 0.9 + (float)local_108;
          fVar7 = (local_100._4_4_ - local_108._4_4_) * 0.9 + local_108._4_4_;
          local_100 = CONCAT44(fVar7,fVar9);
          uVar2 = local_108;
          fVar10 = local_108._4_4_;
          fVar11 = (float)local_108;
          local_118 = fVar9;
          fStack_114 = fVar7;
          goto LAB_1402c0203;
        }
      }
      iVar5 = iVar5 + 1;
      lVar6 = lVar6 + 1;
      pfVar3 = pfVar3 + 7;
    } while (iVar5 < 3);
    if (iVar4 == 3) {
      iVar4 = 1;
    }
    else {
      iVar4 = 0;
      local_138 = uVar2;
      local_110 = uVar2;
      FUN_1402c13d0(param_2,&local_138);
      if (*(char *)(param_2 + 0xe0) != '\0') {
        return 0;
      }
      if ((local_138._4_4_ - local_110._4_4_) * (local_138._4_4_ - local_110._4_4_) +
          ((float)local_138 - (float)local_110) * ((float)local_138 - (float)local_110) < 0.1) {
        return 0;
      }
      if (10 < local_res8) {
        return 0;
      }
      local_res8 = local_res8 + 1;
      uVar2 = local_138;
      lVar6 = param_2;
LAB_1402c01f7:
      local_f0 = 0;
      local_108._0_4_ = (float)uVar2;
      local_108._4_4_ = (float)((ulonglong)uVar2 >> 0x20);
      param_2 = lVar6;
      fVar10 = local_108._4_4_;
      fVar11 = (float)local_108;
      local_108 = uVar2;
    }
LAB_1402c0203:
    fVar8 = sqrtf((fVar9 - fVar11) * (fVar9 - fVar11) + (fVar7 - fVar10) * (fVar7 - fVar10));
    if ((fVar8 < 0.001) || (0x32 < local_res10)) {
      return 0;
    }
    local_res10 = local_res10 + 1;
  } while (iVar4 != 1);
  *param_4 = param_2;
  *param_3 = fVar9;
  param_3[2] = fVar7;
  return 1;
}



bool FUN_1402c02c0(longlong param_1,float *param_2,float *param_3,float param_4,int param_5)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  int iVar5;
  ulonglong uVar6;
  float *pfVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  uint uVar11;
  float fVar13;
  float fVar14;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined1 local_d0;
  ulonglong uVar12;
  
  fVar1 = *param_3;
  fVar2 = param_3[2];
  uVar10 = 0;
  local_d0 = 0;
  fVar14 = *(float *)(param_1 + 0xf0);
  fVar3 = *param_2;
  fVar4 = param_2[2];
  local_e8 = CONCAT44(fVar4,fVar3);
  local_e0 = CONCAT44(fVar2,fVar1);
  uVar12 = uVar10;
LAB_1402c03a0:
  pfVar7 = (float *)(param_1 + 0x58);
  uVar6 = uVar10;
  uVar8 = uVar10;
  uVar9 = uVar10;
  do {
    if (*(char *)(pfVar7 + 1) == '\0') {
      *(ulonglong *)(pfVar7 + -1) = CONCAT44(pfVar7[-2] - pfVar7[-4],pfVar7[-3] - pfVar7[-5]);
      D3DXVec2Normalize(pfVar7 + -1,pfVar7 + -1);
      *(undefined1 *)(pfVar7 + 1) = 1;
      fVar13 = pfVar7[-1];
      pfVar7[-1] = *pfVar7;
      *pfVar7 = -fVar13;
    }
    if (0.0 < (fVar1 - pfVar7[-5]) * pfVar7[-1] + (fVar2 - pfVar7[-4]) * *pfVar7) {
      uVar9 = (ulonglong)((int)uVar9 + 1);
    }
    else {
      if (*(char *)(pfVar7 + 1) == '\0') {
        *(ulonglong *)(pfVar7 + -1) = CONCAT44(pfVar7[-2] - pfVar7[-4],pfVar7[-3] - pfVar7[-5]);
        D3DXVec2Normalize(pfVar7 + -1,pfVar7 + -1);
        *(undefined1 *)(pfVar7 + 1) = 1;
        fVar13 = pfVar7[-1];
        pfVar7[-1] = *pfVar7;
        *pfVar7 = -fVar13;
      }
      fVar13 = (fVar3 - pfVar7[-5]) * pfVar7[-1] + (fVar4 - pfVar7[-4]) * *pfVar7;
      if (((0.0 < fVar13) || (-0.0 <= fVar13)) &&
         ((iVar5 = FUN_1402c1c00(&local_e8,(longlong)(int)uVar6 * 0x1c + 0x44 + param_1,0),
          iVar5 == 2 || (iVar5 == 3)))) break;
    }
    uVar11 = (int)uVar6 + 1;
    uVar6 = (ulonglong)uVar11;
    uVar8 = uVar8 + 1;
    pfVar7 = pfVar7 + 7;
    if (2 < (int)uVar11) {
      return (int)uVar9 == 3;
    }
  } while( true );
  param_1 = *(longlong *)(param_1 + 0x98 + uVar8 * 8);
  if (param_1 == 0) {
    return false;
  }
  if (param_5 != 3) {
    if (*(char *)(param_1 + 0xe1) != '\0') {
      iVar5 = *(int *)(param_1 + 0xe4);
      if (iVar5 == 0) {
        return false;
      }
      if ((iVar5 - 1U < 2) && (iVar5 == param_5)) {
        return false;
      }
    }
    if (param_4 < *(float *)(param_1 + 0xec)) {
      if (*(char *)(param_1 + 0x100) == '\0') goto LAB_1402c0561;
      if (fVar14 < *(float *)(param_1 + 0xf0)) {
        return false;
      }
    }
    if ((*(char *)(param_1 + 0x100) != '\0') && (param_4 < *(float *)(param_1 + 0xf0) - fVar14)) {
      return false;
    }
  }
LAB_1402c0561:
  fVar14 = *(float *)(param_1 + 0xf0);
  uVar11 = (int)uVar12 + 1;
  uVar12 = (ulonglong)uVar11;
  if (0x13 < (int)uVar11) {
    return false;
  }
  goto LAB_1402c03a0;
}



void FUN_1402c05f0(longlong *param_1,uint param_2,uint param_3)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  longlong lVar4;
  
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,*(uint *)(param_1 + 2),1,0,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 2)) {
      if ((puVar3[4] == param_2) && (*puVar3 == param_2)) {
        puVar3[1] = param_3;
        return;
      }
    }
  }
  lVar4 = FUN_1402c0710(param_1,param_2,uVar1,param_2);
  *(uint *)(lVar4 + 4) = param_3;
  return;
}



void FUN_1402c0690(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x10) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 8); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 8)) {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 8) = *(undefined8 *)(param_2 + 8);
      FUN_140247ab0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 8);
  FUN_140247ab0(param_1,param_2);
  return;
}



undefined4 *
FUN_1402c0710(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) < 0x18)
      goto LAB_1402c07d7;
      lVar7 = uVar6 * 0x18;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402c07d7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 3 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[1] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -3;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 2);
  *puVar2 = param_2;
  puVar2[4] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 2) = *(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_1402cddb0(param_1);
    FUN_140248140(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402c0870(undefined8 *param_1,longlong param_2)

{
  undefined8 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  float local_10;
  
  uVar1 = *(undefined8 *)(param_2 + -8);
  uVar2 = *(undefined8 *)(param_2 + -0x10);
  *(undefined8 *)(param_2 + -0x10) = *param_1;
  *(undefined8 *)(param_2 + -8) = param_1[1];
  lVar3 = 2;
  lVar4 = 0;
  lVar6 = (param_2 - (longlong)param_1) + -0x10 >> 4;
  bVar7 = lVar6 == 2;
  lVar5 = lVar4;
  if (2 < lVar6) {
    do {
      lVar4 = lVar3;
      if (*(float *)(param_1 + lVar3 * 2 + -1) <= *(float *)(param_1 + lVar3 * 2 + 1) &&
          *(float *)(param_1 + lVar3 * 2 + 1) != *(float *)(param_1 + lVar3 * 2 + -1)) {
        lVar4 = lVar3 + -1;
      }
      param_1[lVar5 * 2] = param_1[lVar4 * 2];
      param_1[lVar5 * 2 + 1] = param_1[lVar4 * 2 + 1];
      lVar3 = lVar4 * 2 + 2;
      bVar7 = lVar3 == lVar6;
      lVar5 = lVar4;
    } while (lVar3 < lVar6);
  }
  if (bVar7) {
    param_1[lVar4 * 2] = param_1[lVar6 * 2 + -2];
    param_1[lVar4 * 2 + 1] = param_1[lVar6 * 2 + -1];
    lVar4 = lVar6 + -1;
  }
  if (0 < lVar4) {
    local_10 = (float)uVar1;
    do {
      lVar3 = (lVar4 + -1) / 2;
      if (*(float *)(param_1 + lVar3 * 2 + 1) <= local_10) break;
      param_1[lVar4 * 2] = param_1[lVar3 * 2];
      param_1[lVar4 * 2 + 1] = param_1[lVar3 * 2 + 1];
      lVar4 = lVar3;
    } while (0 < lVar3);
  }
  param_1[lVar4 * 2] = uVar2;
  param_1[lVar4 * 2 + 1] = uVar1;
  return;
}



void FUN_1402c0980(float *param_1)

{
  float fVar1;
  
  *(ulonglong *)(param_1 + 4) = CONCAT44(param_1[3] - param_1[1],param_1[2] - *param_1);
  D3DXVec2Normalize(param_1 + 4,param_1 + 4);
  fVar1 = param_1[4];
  param_1[4] = param_1[5];
  *(undefined1 *)(param_1 + 6) = 1;
  param_1[5] = -fVar1;
  return;
}



undefined8 FUN_1402c09f0(float *param_1,float *param_2,float param_3)

{
  float fVar1;
  
  if (*(char *)(param_1 + 6) == '\0') {
    FUN_1402c0980();
  }
  fVar1 = (param_2[1] - param_1[1]) * param_1[5] + (*param_2 - *param_1) * param_1[4];
  if (param_3 < fVar1) {
    return 2;
  }
  if (fVar1 < -param_3) {
    return 1;
  }
  return 0;
}



bool FUN_1402c0a80(longlong param_1,float *param_2)

{
  longlong lVar1;
  int iVar2;
  float *pfVar3;
  float fVar4;
  
  pfVar3 = (float *)(param_1 + 0x58);
  lVar1 = 3;
  iVar2 = 0;
  do {
    if (*(char *)(pfVar3 + 1) == '\0') {
      *(ulonglong *)(pfVar3 + -1) = CONCAT44(pfVar3[-2] - pfVar3[-4],pfVar3[-3] - pfVar3[-5]);
      D3DXVec2Normalize(pfVar3 + -1,pfVar3 + -1);
      *(undefined1 *)(pfVar3 + 1) = 1;
      fVar4 = pfVar3[-1];
      pfVar3[-1] = *pfVar3;
      *pfVar3 = -fVar4;
    }
    fVar4 = (*param_2 - pfVar3[-5]) * pfVar3[-1] + (param_2[1] - pfVar3[-4]) * *pfVar3;
    if ((0.0 < fVar4) || (-0.0 <= fVar4)) {
      iVar2 = iVar2 + 1;
    }
    pfVar3 = pfVar3 + 7;
    lVar1 = lVar1 + -1;
  } while (lVar1 != 0);
  return iVar2 == 3;
}



void FUN_1402c0ba0(longlong param_1)

{
  if (*(void **)(param_1 + 0x50) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x50));
  }
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402c0bf8)
// WARNING: Removing unreachable block (ram,0x0001402c0c00)

void FUN_1402c0bd0(undefined8 *param_1,undefined8 param_2,undefined4 *param_3,undefined8 param_4,
                  undefined4 *param_5,undefined8 param_6)

{
  undefined4 uVar1;
  
  if (param_1[10] != param_1[0xb]) {
    param_1[0xb] = param_1[10];
  }
  *param_1 = param_2;
  *(undefined4 *)(param_1 + 1) = *param_3;
  *(undefined4 *)((longlong)param_1 + 0xc) = param_3[1];
  uVar1 = param_3[2];
  param_1[4] = param_4;
  *(undefined4 *)(param_1 + 2) = uVar1;
  *(undefined4 *)(param_1 + 5) = *param_5;
  *(undefined4 *)((longlong)param_1 + 0x2c) = param_5[1];
  *(undefined4 *)(param_1 + 6) = param_5[2];
  param_1[8] = param_6;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402c0c80(longlong param_1,undefined4 *param_2,undefined8 param_3)

{
  ulonglong *puVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined1 auStack_68 [32];
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_38;
  undefined4 uStack_34;
  undefined4 local_30;
  undefined4 uStack_2c;
  undefined4 local_28;
  undefined4 uStack_24;
  undefined8 local_20;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  local_38 = *param_2;
  puVar1 = (ulonglong *)(param_1 + 0x50);
  puVar2 = *(undefined4 **)(param_1 + 0x58);
  uStack_34 = param_2[1];
  local_48 = 0;
  local_44 = 0;
  local_40 = 0;
  local_30 = param_2[2];
  uStack_2c = 0;
  local_28 = 0;
  uStack_24 = 0;
  local_20 = param_3;
  if (&local_38 < puVar2) {
    puVar3 = (undefined4 *)*puVar1;
    if (puVar3 <= &local_38) {
      if (puVar2 == *(undefined4 **)(param_1 + 0x60)) {
        FUN_1402c1030(puVar1);
      }
      puVar4 = *(undefined8 **)(param_1 + 0x58);
      puVar5 = (undefined8 *)
               (((longlong)&local_38 - (longlong)puVar3 & 0xffffffffffffffe0U) + *puVar1);
      if (puVar4 != (undefined8 *)0x0) {
        *puVar4 = *puVar5;
        puVar4[1] = puVar5[1];
        puVar4[2] = puVar5[2];
        puVar4[3] = puVar5[3];
      }
      goto LAB_1402c0d7c;
    }
  }
  if (puVar2 == *(undefined4 **)(param_1 + 0x60)) {
    FUN_1402c1030(puVar1);
  }
  puVar4 = *(undefined8 **)(param_1 + 0x58);
  if (puVar4 != (undefined8 *)0x0) {
    *puVar4 = CONCAT44(uStack_34,local_38);
    puVar4[1] = CONCAT44(uStack_2c,local_30);
    puVar4[2] = CONCAT44(uStack_24,local_28);
    puVar4[3] = param_3;
  }
LAB_1402c0d7c:
  *(longlong *)(param_1 + 0x58) = *(longlong *)(param_1 + 0x58) + 0x20;
  return;
}



ulonglong *
FUN_1402c0da0(longlong param_1,ulonglong *param_2,undefined8 param_3,undefined8 param_4,
             ulonglong *param_5,undefined4 param_6,undefined4 param_7)

{
  char cVar1;
  int iVar2;
  ulonglong uVar3;
  
  iVar2 = (int)(*(longlong *)(param_1 + 0x58) - *(longlong *)(param_1 + 0x50) >> 5);
  while ((iVar2 = iVar2 + -1, 0 < iVar2 &&
         (uVar3 = (longlong)iVar2 * 0x20 + *(longlong *)(param_1 + 0x50), *param_5 <= uVar3))) {
    cVar1 = FUN_1402c02c0(param_4,param_3,uVar3,param_6,param_7);
    if (cVar1 != '\0') {
      *param_2 = uVar3;
      return param_2;
    }
  }
  *param_2 = *param_5;
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402c0e70(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined4 local_40;
  float local_38;
  float local_34;
  float local_30;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  iVar3 = 1;
  if (1 < (int)(*(longlong *)(param_1 + 0x58) - *(longlong *)(param_1 + 0x50) >> 5)) {
    lVar2 = 0x20;
    do {
      lVar1 = *(longlong *)(param_1 + 0x50);
      local_30 = *(float *)(lVar2 + 8 + lVar1) - *(float *)(lVar2 + -0x18 + lVar1);
      local_34 = *(float *)(lVar2 + 4 + lVar1) - *(float *)(lVar2 + -0x1c + lVar1);
      local_38 = *(float *)(lVar2 + lVar1) - *(float *)(lVar2 + -0x20 + lVar1);
      if ((DAT_1406081ac & 1) == 0) {
        DAT_1406081ac = DAT_1406081ac | 1;
      }
      D3DXVec3Normalize(&DAT_1406081b0,&local_38);
      local_48 = _DAT_1406081b0 & 0xffffffff;
      local_40 = DAT_1406081b8;
      D3DXVec3Normalize(&local_48,&local_48);
      lVar1 = *(longlong *)(param_1 + 0x50);
      iVar3 = iVar3 + 1;
      *(undefined4 *)(lVar2 + 0xc + lVar1) = (undefined4)local_48;
      *(undefined4 *)(lVar2 + 0x10 + lVar1) = local_48._4_4_;
      *(undefined4 *)(lVar2 + 0x14 + lVar1) = local_40;
      lVar2 = lVar2 + 0x20;
    } while (iVar3 < (int)(*(longlong *)(param_1 + 0x58) - *(longlong *)(param_1 + 0x50) >> 5));
  }
  return;
}



void FUN_1402c0fb0(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_1402c1030(param_1);
    }
    param_2 = (undefined8 *)
              (((longlong)param_2 - (longlong)puVar2 & 0xffffffffffffffe0U) + *param_1);
  }
  else if (puVar1 == (undefined8 *)param_1[2]) {
    FUN_1402c1030(param_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];
  }
  param_1[1] = param_1[1] + 0x20;
  return;
}



void FUN_1402c1030(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = param_1[1] - *param_1 >> 5;
  if (0x7fffffffffffffe < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = param_1[2] - *param_1 >> 5;
  if (uVar2 < uVar3) {
    if (0x7ffffffffffffff - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_1402c10c0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402c10c0(param_1,uVar2);
  }
  return;
}



void FUN_1402c10c0(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140246420(*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_1402c11d0(longlong param_1,int param_2,float *param_3)

{
  longlong lVar1;
  float fVar2;
  float local_res8;
  float local_resc;
  undefined8 local_res18;
  float local_res20;
  float fStackX_24;
  
  lVar1 = (longlong)param_2 * 0x1c;
  local_res8 = *(float *)(lVar1 + 0x4c + param_1) - *(float *)(lVar1 + 0x44 + param_1);
  local_resc = *(float *)(lVar1 + 0x50 + param_1) - *(float *)(lVar1 + 0x48 + param_1);
  D3DXVec2Normalize(&local_res8,&local_res8);
  *(undefined1 *)(param_3 + 6) = 0;
  fVar2 = (param_3[2] - *param_3) * local_res8 + local_resc * (param_3[3] - param_3[1]);
  local_res20 = *param_3 + local_res8 * fVar2;
  fStackX_24 = param_3[1] + local_resc * fVar2;
  *(ulonglong *)(param_3 + 2) = CONCAT44(fStackX_24,local_res20);
  local_res18 = *(undefined8 *)param_3;
  FUN_1402c13d0(param_1,&local_res18);
  *(undefined8 *)param_3 = local_res18;
  *(undefined1 *)(param_3 + 6) = 0;
  local_res18 = *(undefined8 *)(param_3 + 2);
  FUN_1402c12f0(param_1,param_2,&local_res18);
  *(undefined8 *)(param_3 + 2) = local_res18;
  *(undefined1 *)(param_3 + 6) = 0;
  return;
}



ulonglong FUN_1402c12f0(longlong param_1,int param_2,float *param_3)

{
  float *pfVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  float fVar4;
  float local_res8;
  float fStackX_c;
  
  uVar3 = (longlong)param_2 * 0x1c;
  pfVar1 = (float *)(uVar3 + 0x44 + param_1);
  if (*(char *)(uVar3 + 0x5c + param_1) == '\0') {
    uVar3 = FUN_1402c0980(pfVar1);
  }
  fVar4 = (param_3[1] - pfVar1[1]) * pfVar1[5] + (*param_3 - *pfVar1) * pfVar1[4];
  if (fVar4 <= 0.001) {
    if (fVar4 <= 0.0) {
      fVar4 = fVar4 - 0.001;
    }
    fVar4 = ABS(fVar4);
    if (fVar4 < 0.001) {
      fVar4 = 0.001;
    }
    if (*(char *)(pfVar1 + 6) == '\0') {
      FUN_1402c0980(pfVar1);
    }
    uVar2 = *(undefined8 *)(pfVar1 + 4);
    local_res8 = (float)uVar2;
    fStackX_c = (float)((ulonglong)uVar2 >> 0x20);
    *param_3 = local_res8 * fVar4 + *param_3;
    param_3[1] = fStackX_c * fVar4 + param_3[1];
    return CONCAT71((int7)((ulonglong)uVar2 >> 8),1);
  }
  return uVar3 & 0xffffffffffffff00;
}



bool FUN_1402c13d0(longlong param_1,float *param_2)

{
  longlong lVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  float fVar8;
  float local_res8;
  float fStackX_c;
  undefined8 local_78;
  undefined8 local_70 [2];
  undefined1 local_60;
  
  fVar2 = *(float *)(param_1 + 0x38);
  fVar3 = *(float *)(param_1 + 0x40);
  iVar6 = 0;
  local_60 = 0;
  pcVar5 = (char *)(param_1 + 0x5c);
  iVar7 = 0;
  local_78 = CONCAT44(fVar3,fVar2);
  local_70[0] = *(undefined8 *)param_2;
  local_res8 = fVar2;
  fStackX_c = fVar3;
  do {
    lVar1 = (longlong)iVar7 * 0x1c + 0x44 + param_1;
    iVar4 = FUN_1402c09f0(lVar1,local_70,0);
    if (iVar4 == 2) {
      iVar6 = iVar6 + 1;
    }
    else {
      if (*pcVar5 == '\0') {
        FUN_1402c0980(pcVar5 + -0x18);
      }
      fVar8 = (fVar2 - *(float *)(pcVar5 + -0x18)) * *(float *)(pcVar5 + -8) +
              (fVar3 - *(float *)(pcVar5 + -0x14)) * *(float *)(pcVar5 + -4);
      if (((0.0 < fVar8) || (-0.0 <= fVar8)) &&
         ((iVar4 = FUN_1402c1c00(&local_78,lVar1,&local_res8), iVar4 == 2 || (iVar4 == 3)))) {
        fVar2 = *(float *)(param_1 + 0x40);
        *param_2 = *(float *)(param_1 + 0x38) + (local_res8 - *(float *)(param_1 + 0x38)) * 0.9;
        param_2[1] = (fStackX_c - fVar2) * 0.9 + *(float *)(param_1 + 0x40);
        return true;
      }
    }
    iVar7 = iVar7 + 1;
    pcVar5 = pcVar5 + 0x1c;
    if (2 < iVar7) {
      if (iVar6 != 3) {
        *param_2 = *(float *)(param_1 + 0x38);
        param_2[1] = *(float *)(param_1 + 0x40);
      }
      return iVar6 != 3;
    }
  } while( true );
}



undefined8 FUN_1402c1570(longlong param_1,longlong param_2,float param_3,int param_4)

{
  int iVar1;
  longlong lVar2;
  uint uVar3;
  undefined8 uVar4;
  uint uVar5;
  longlong *plVar6;
  int iVar7;
  
  if (*(int *)(param_1 + 0x104) == *(int *)(param_2 + 0x28)) {
    *(undefined1 *)(param_1 + 0x110) = 0;
    iVar7 = 0;
    plVar6 = (longlong *)(param_1 + 0x98);
    do {
      lVar2 = *plVar6;
      if (lVar2 != 0) {
        if (param_4 == 3) {
LAB_1402c1632:
          uVar3 = iVar7 - *(int *)(param_1 + 0x114);
          uVar5 = (int)uVar3 >> 0x1f;
          FUN_1402c16a0(lVar2,param_2,param_1,
                        *(float *)(param_1 + 0x13c + (longlong)(int)((uVar3 ^ uVar5) - uVar5) * 4) +
                        *(float *)(param_1 + 0x108));
        }
        else if ((*(char *)(param_1 + 0xe1) == '\0') ||
                ((iVar1 = *(int *)(param_1 + 0xe4), iVar1 != 0 &&
                 ((1 < iVar1 - 1U || (iVar1 != param_4)))))) {
          if (param_3 < *(float *)(param_1 + 0xec)) {
            if (*(char *)(param_1 + 0x100) == '\0') goto LAB_1402c1632;
            if (*(float *)(lVar2 + 0xf0) < *(float *)(param_1 + 0xf0)) goto LAB_1402c1660;
          }
          if ((*(char *)(param_1 + 0x100) == '\0') ||
             (*(float *)(param_1 + 0xf0) - *(float *)(lVar2 + 0xf0) <= param_3)) goto LAB_1402c1632;
        }
      }
LAB_1402c1660:
      iVar7 = iVar7 + 1;
      plVar6 = plVar6 + 1;
    } while (iVar7 < 3);
    uVar4 = 1;
  }
  else {
    uVar4 = 0;
  }
  return uVar4;
}



undefined8 FUN_1402c16a0(longlong param_1,undefined1 *param_2,longlong param_3,float param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  longlong *plVar3;
  
  if (*(int *)(param_1 + 0x104) == *(int *)(param_2 + 0x28)) {
    if ((*(char *)(param_1 + 0x110) != '\0') &&
       (*(float *)(param_1 + 0x10c) + param_4 <
        *(float *)(param_1 + 0x10c) + *(float *)(param_1 + 0x108))) {
      *(float *)(param_1 + 0x108) = param_4;
      if (param_3 == *(longlong *)(param_1 + 0x98)) {
        *(undefined4 *)(param_1 + 0x114) = 0;
      }
      else if (param_3 == *(longlong *)(param_1 + 0xa0)) {
        *(undefined4 *)(param_1 + 0x114) = 1;
      }
      else if (param_3 == *(longlong *)(param_1 + 0xa8)) {
        *(undefined4 *)(param_1 + 0x114) = 2;
      }
      plVar1 = *(longlong **)(param_2 + 0x10);
      for (plVar2 = *(longlong **)(param_2 + 8);
          (plVar3 = plVar1, plVar2 != plVar1 && (plVar3 = plVar2, *plVar2 != param_1));
          plVar2 = plVar2 + 2) {
      }
      if (plVar3 != plVar1) {
        *plVar3 = param_1;
        *(float *)(plVar3 + 1) = *(float *)(param_1 + 0x10c) + *(float *)(param_1 + 0x108);
        if (*(longlong **)(param_2 + 8) != plVar3 + 2) {
          FUN_1402c1a90(*(longlong **)(param_2 + 8),plVar3,*param_2);
        }
      }
      return 1;
    }
    return 0;
  }
  *(int *)(param_1 + 0x104) = *(int *)(param_2 + 0x28);
  if (param_3 == 0) {
    *(undefined1 *)(param_1 + 0x110) = 0;
    *(undefined8 *)(param_1 + 0x108) = 0;
  }
  else {
    *(undefined1 *)(param_1 + 0x110) = 1;
    FUN_1402c1850(param_1,param_2 + 0x2c);
    *(float *)(param_1 + 0x108) = param_4;
    if (param_3 != *(longlong *)(param_1 + 0x98)) {
      if (param_3 == *(longlong *)(param_1 + 0xa0)) {
        *(undefined4 *)(param_1 + 0x114) = 1;
        FUN_1402c1b20(param_2,param_1);
        return 1;
      }
      if (param_3 == *(longlong *)(param_1 + 0xa8)) {
        *(undefined4 *)(param_1 + 0x114) = 2;
        FUN_1402c1b20(param_2,param_1);
        return 1;
      }
      goto LAB_1402c1758;
    }
  }
  *(undefined4 *)(param_1 + 0x114) = 0;
LAB_1402c1758:
  FUN_1402c1b20(param_2,param_1);
  return 1;
}



void FUN_1402c1850(longlong param_1,float *param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  
  fVar1 = ABS(*param_2 - *(float *)(param_1 + 0x38));
  fVar2 = ABS(param_2[1] - *(float *)(param_1 + 0x3c));
  fVar3 = ABS(param_2[2] - *(float *)(param_1 + 0x40));
  fVar4 = fVar2;
  if (fVar2 < fVar1) {
    fVar4 = fVar1;
  }
  if (fVar4 <= fVar3) {
    *(float *)(param_1 + 0x10c) = fVar3;
    return;
  }
  if (fVar1 <= fVar2) {
    *(float *)(param_1 + 0x10c) = fVar2;
    return;
  }
  *(float *)(param_1 + 0x10c) = fVar1;
  return;
}



void FUN_1402c18e0(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  code *pcVar1;
  char *pcVar2;
  longlong lVar3;
  ulonglong uVar4;
  char *local_res10;
  undefined8 uVar5;
  undefined **local_20 [3];
  
  uVar5 = 0xfffffffffffffffe;
  if (0xfffffffffffffff < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    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), 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_1405d3608);
    }
    pcVar2 = local_res10;
    FUN_14023ba50(*param_1,param_1[1],local_res10,param_4,uVar5);
    lVar3 = *param_1;
    uVar4 = param_1[1] - lVar3;
    if (lVar3 != 0) {
      for (; lVar3 != param_1[1]; lVar3 = lVar3 + 0x10) {
      }
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar2 + param_2 * 0x10);
    param_1[1] = (longlong)(pcVar2 + (uVar4 & 0xfffffffffffffff0));
    *param_1 = (longlong)pcVar2;
  }
  return;
}



void FUN_1402c1a00(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_1402c18e0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402c18e0(param_1,uVar2);
  }
  return;
}



void FUN_1402c1a90(longlong param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  float local_10;
  
  lVar4 = (longlong)param_2 - param_1 >> 4;
  if (0 < lVar4) {
    uVar1 = param_2[1];
    uVar2 = *param_2;
    local_10 = (float)uVar1;
    do {
      lVar3 = (lVar4 + -1) / 2;
      if (*(float *)(param_1 + 8 + lVar3 * 0x10) <= local_10) break;
      *(undefined8 *)(param_1 + lVar4 * 0x10) = *(undefined8 *)(param_1 + lVar3 * 0x10);
      *(undefined8 *)(param_1 + 8 + lVar4 * 0x10) = *(undefined8 *)(param_1 + 8 + lVar3 * 0x10);
      lVar4 = lVar3;
    } while (0 < lVar3);
    *(undefined8 *)(param_1 + lVar4 * 0x10) = uVar2;
    *(undefined8 *)(param_1 + 8 + lVar4 * 0x10) = uVar1;
  }
  return;
}



void FUN_1402c1b20(undefined1 *param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong local_18;
  float local_10;
  undefined4 uStack_c;
  
  plVar2 = *(longlong **)(param_1 + 0x10);
  local_10 = *(float *)(param_2 + 0x10c) + *(float *)(param_2 + 0x108);
  local_18 = param_2;
  if ((&local_18 < plVar2) && (plVar3 = *(longlong **)(param_1 + 8), plVar3 <= &local_18)) {
    if (plVar2 == *(longlong **)(param_1 + 0x18)) {
      FUN_1402c1a00(param_1 + 8);
    }
    plVar2 = *(longlong **)(param_1 + 0x10);
    plVar3 = (longlong *)
             (((longlong)&local_18 - (longlong)plVar3 & 0xfffffffffffffff0U) +
             *(longlong *)(param_1 + 8));
    if (plVar2 == (longlong *)0x0) goto LAB_1402c1bc4;
    *plVar2 = *plVar3;
    lVar1 = plVar3[1];
  }
  else {
    if (plVar2 == *(longlong **)(param_1 + 0x18)) {
      FUN_1402c1a00(param_1 + 8);
    }
    plVar2 = *(longlong **)(param_1 + 0x10);
    if (plVar2 == (longlong *)0x0) goto LAB_1402c1bc4;
    lVar1 = CONCAT44(uStack_c,local_10);
    *plVar2 = param_2;
  }
  plVar2[1] = lVar1;
LAB_1402c1bc4:
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  if (*(longlong *)(param_1 + 8) != *(longlong *)(param_1 + 0x10)) {
    FUN_1402c1a90(*(longlong *)(param_1 + 8),*(longlong *)(param_1 + 0x10) + -0x10,*param_1);
  }
  return;
}



undefined8 FUN_1402c1c00(float *param_1,float *param_2,float *param_3)

{
  undefined8 uVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  fVar6 = param_1[1] - param_2[1];
  fVar2 = param_1[2] - *param_1;
  fVar4 = param_1[3] - param_1[1];
  fVar3 = (param_2[2] - *param_2) * fVar6 - (param_2[3] - param_2[1]) * (*param_1 - *param_2);
  fVar5 = fVar2 * (param_2[3] - param_2[1]) - fVar4 * (param_2[2] - *param_2);
  if (fVar5 == 0.0) {
    if (fVar3 == 0.0) {
      return 0;
    }
    return 5;
  }
  fVar3 = fVar3 / fVar5;
  fVar5 = (fVar2 * fVar6 - fVar4 * (*param_1 - *param_2)) / fVar5;
  if (param_3 != (float *)0x0) {
    *param_3 = fVar3 * fVar2 + *param_1;
    param_3[1] = fVar3 * fVar4 + param_1[1];
  }
  if ((0.0 <= fVar3) && (fVar3 <= 1.0)) {
    if (fVar5 < 0.0) goto LAB_1402c1d16;
    if (fVar5 <= 1.0) {
      return 2;
    }
  }
  if ((0.0 <= fVar5) && (fVar5 <= 1.0)) {
    return 3;
  }
LAB_1402c1d16:
  if ((fVar3 < 0.0) || (uVar1 = 4, 1.0 < fVar3)) {
    uVar1 = 1;
  }
  return uVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402c1d50(undefined4 *param_1,undefined8 param_2)

{
  undefined1 auStack_78 [32];
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_78;
  local_58 = *param_1;
  local_20 = 0;
  local_24 = 0;
  local_28 = 0;
  local_2c = 0;
  local_3c = 0;
  local_4c = 0;
  local_50 = param_1[2];
  local_1c = 0x3f800000;
  local_54 = param_1[1];
  local_44 = param_1[4];
  local_48 = param_1[3];
  local_40 = param_1[5];
  local_38 = param_1[6];
  local_34 = param_1[7];
  local_30 = param_1[8];
  D3DXMatrixMultiply(&local_58,&local_58,param_2);
  D3DXVec3TransformCoord(param_1 + 9,param_1 + 9,&local_58);
  if ((DAT_1406081bc & 1) == 0) {
    DAT_1406081bc = DAT_1406081bc | 1;
  }
  DAT_1406081c0 = local_58;
  DAT_1406081c4 = local_54;
  DAT_1406081c8 = local_50;
  *param_1 = local_58;
  param_1[1] = DAT_1406081c4;
  param_1[2] = DAT_1406081c8;
  if ((DAT_140608248 & 1) == 0) {
    DAT_140608248 = DAT_140608248 | 1;
  }
  DAT_140608250 = local_48;
  DAT_140608254 = local_44;
  DAT_140608258 = local_40;
  param_1[3] = local_48;
  param_1[4] = DAT_140608254;
  param_1[5] = DAT_140608258;
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = local_38;
  DAT_1406081a4 = local_34;
  DAT_1406081a8 = local_30;
  param_1[6] = local_38;
  param_1[7] = DAT_1406081a4;
  param_1[8] = DAT_1406081a8;
  if ((DAT_14060817c & 1) == 0) {
    DAT_14060817c = DAT_14060817c | 1;
  }
  DAT_140608180 = local_28;
  DAT_140608184 = local_24;
  DAT_140608188 = local_20;
  param_1[9] = local_28;
  param_1[10] = DAT_140608184;
  param_1[0xb] = DAT_140608188;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_1402c1fa0(float *param_1,float *param_2,float param_3)

{
  uint7 uVar2;
  longlong lVar1;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  undefined1 auStack_c8 [32];
  float local_a8;
  float fStack_a4;
  float local_a0;
  float local_98;
  float fStack_94;
  float local_90;
  ulonglong local_88;
  
  local_88 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  fVar6 = param_2[1] - param_1[10];
  fVar4 = *param_2 - param_1[9];
  fVar3 = param_2[2] - param_1[0xb];
  fVar8 = fVar6 * param_1[1] + fVar4 * *param_1 + fVar3 * param_1[2];
  local_98 = fVar8 - 0.0;
  fVar5 = param_1[0xc] * 0.5;
  fVar7 = fVar6 * param_1[7] + fVar4 * param_1[6] + fVar3 * param_1[8];
  fVar3 = fVar6 * param_1[4] + fVar4 * param_1[3] + fVar3 * param_1[5];
  fStack_94 = fVar3 - 0.0;
  local_90 = fVar7 - fVar7;
  if (param_1[0xd] * param_1[0xd] <
      local_98 * local_98 + fStack_94 * fStack_94 + local_90 * local_90) {
    D3DXVec3Normalize(&local_98,&local_98);
    fVar4 = param_1[0xd];
    local_90 = fVar4 * local_90;
    local_98 = fVar4 * local_98;
    fStack_94 = fVar4 * fStack_94;
  }
  local_a0 = local_90 + fVar7;
  fStack_a4 = fStack_94 + 0.0;
  local_a8 = local_98 + 0.0;
  fVar4 = -fVar5;
  if ((-fVar5 <= local_a0) && (fVar4 = local_a0, fVar5 < local_a0)) {
    fVar4 = fVar5;
  }
  local_a8 = local_a8 - fVar8;
  fStack_a4 = fStack_a4 - fVar3;
  uVar2 = (uint7)(uint3)((uint)local_a0 >> 8);
  if (param_3 * param_3 <=
      local_a8 * local_a8 + fStack_a4 * fStack_a4 + (fVar4 - fVar7) * (fVar4 - fVar7)) {
    lVar1 = (ulonglong)uVar2 << 8;
  }
  else {
    lVar1 = CONCAT71(uVar2,1);
  }
  return lVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_1402c21e0(float *param_1,undefined1 (*param_2) [12])

{
  float *pfVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  undefined1 auVar6 [16];
  undefined1 auVar7 [16];
  undefined1 auVar8 [16];
  undefined1 auVar9 [16];
  undefined1 auVar10 [16];
  undefined1 auVar11 [16];
  undefined1 auVar12 [16];
  undefined1 auVar13 [16];
  undefined1 auVar14 [16];
  undefined8 uVar15;
  undefined1 auVar16 [8];
  undefined8 uVar17;
  undefined8 uVar18;
  undefined8 uVar19;
  int iVar20;
  longlong lVar21;
  longlong lVar22;
  longlong lVar23;
  longlong lVar24;
  undefined1 auVar25 [16];
  undefined1 auVar26 [16];
  undefined1 auVar27 [16];
  undefined1 auVar28 [16];
  undefined1 auVar29 [16];
  undefined1 auVar30 [16];
  undefined1 auVar31 [16];
  undefined1 auVar32 [16];
  undefined1 auVar33 [16];
  undefined1 auVar34 [16];
  undefined1 auVar35 [16];
  undefined1 auVar36 [16];
  undefined1 auVar37 [16];
  undefined1 auVar38 [16];
  undefined1 auVar39 [16];
  float fVar40;
  float fVar41;
  float fVar42;
  float fVar43;
  float fVar44;
  float fVar45;
  float fVar46;
  undefined1 auVar47 [16];
  undefined1 auVar48 [16];
  undefined1 auVar49 [16];
  undefined1 auVar50 [16];
  undefined1 auVar51 [16];
  undefined1 auVar52 [16];
  float fVar53;
  float fVar54;
  float fVar55;
  float fVar56;
  float fVar57;
  float fVar58;
  float fVar59;
  float fVar60;
  float fVar62;
  float fVar63;
  float fVar64;
  float fVar65;
  undefined1 auVar61 [16];
  float fVar66;
  float fVar69;
  float fVar70;
  float fVar71;
  undefined1 auVar67 [16];
  undefined1 auVar68 [16];
  undefined1 auVar72 [16];
  undefined1 auVar73 [16];
  float fVar74;
  float fVar75;
  float fVar79;
  undefined1 auVar76 [16];
  undefined1 auVar77 [16];
  undefined1 auVar78 [16];
  float fVar82;
  float fVar83;
  float fVar84;
  undefined1 auVar80 [16];
  undefined1 auVar81 [16];
  undefined1 auVar85 [16];
  undefined1 local_188 [8];
  undefined8 uStack_180;
  float local_178 [4];
  undefined1 local_168 [16];
  float local_158 [4];
  undefined1 local_148 [16];
  float local_138;
  float fStack_134;
  float fStack_130;
  undefined4 uStack_12c;
  undefined1 local_128 [16];
  undefined1 local_118 [8];
  undefined8 uStack_110;
  float local_108;
  float fStack_104;
  float fStack_100;
  undefined4 uStack_fc;
  undefined1 local_f8 [16];
  undefined1 local_e8 [16];
  undefined1 local_d8 [16];
  undefined1 local_c8 [16];
  ulonglong local_b8;
  
  local_b8 = DAT_1405d84f0 ^ (ulonglong)local_188;
  fVar2 = param_1[6];
  fVar3 = param_1[7];
  fVar4 = param_1[8];
  fVar5 = param_1[9];
  fVar53 = *(float *)param_2[2] * -1.0;
  fVar62 = *(float *)(param_2[2] + 4) * -1.0;
  fVar63 = *(float *)(param_2[2] + 8) * -1.0;
  fVar64 = *(float *)param_2[3] * 1.0;
  fVar66 = fVar3 * fVar63 * -1.0 + fVar62 * fVar4 * 1.0 + fVar64 * fVar2 + fVar53 * fVar5 * 1.0;
  fVar69 = fVar2 * fVar63 * 1.0 + fVar62 * fVar5 * 1.0 + fVar64 * fVar3 + fVar53 * fVar4 * -1.0;
  fVar70 = fVar5 * fVar63 * 1.0 + fVar62 * fVar2 * -1.0 + fVar64 * fVar4 + fVar53 * fVar3 * 1.0;
  fVar71 = fVar4 * fVar63 * -1.0 + fVar62 * fVar3 * -1.0 + fVar64 * fVar5 + fVar53 * fVar2 * -1.0;
  fVar63 = fVar69 + fVar69;
  fVar64 = fVar70 + fVar70;
  fVar53 = (fVar66 + fVar66) * fVar66;
  fVar62 = (fVar71 + fVar71) * fVar71;
  local_108 = (1.0 - fVar63 * fVar69) - fVar64 * fVar70;
  fVar70 = (1.0 - fVar53) - fVar64 * fVar70;
  fStack_130 = (1.0 - (float)((uint)fVar53 & DAT_140477958)) -
               (float)((uint)(fVar63 * fVar69) & DAT_140477958);
  fVar65 = (0.0 - (float)((uint)fVar62 & DAT_14047795c)) - (float)((uint)fVar62 & DAT_14047795c);
  fVar53 = (fVar66 + fVar66) * fVar71;
  auVar76._0_4_ = fVar63 * fVar71 + fVar64 * fVar66;
  fVar79 = fVar64 * fVar71 + fVar63 * fVar66;
  fStack_134 = fVar53 + fVar64 * fVar69;
  local_138 = fVar64 * fVar66 - fVar63 * fVar71;
  fStack_104 = fVar63 * fVar66 - fVar64 * fVar71;
  local_148._8_4_ = fVar64 * fVar69 - fVar53;
  auVar76._4_4_ = local_148._8_4_;
  auVar76._8_4_ = fStack_130;
  auVar76._12_4_ = fVar65;
  fVar53 = *(float *)*param_2 - *param_1;
  fVar62 = (float)((ulonglong)*(undefined8 *)*param_2 >> 0x20) - param_1[1];
  fVar63 = (float)((uint)(SUB124(*param_2,8) - param_1[2]) & DAT_140477958);
  fVar71 = fVar2 * -1.0;
  fVar82 = fVar3 * -1.0;
  fVar83 = fVar4 * -1.0;
  fVar84 = fVar5 * 1.0;
  fVar64 = fVar3 * fVar63 * -1.0 + fVar62 * fVar4 * 1.0 + fVar2 * 0.0 + fVar53 * fVar5 * 1.0;
  fVar66 = fVar2 * fVar63 * 1.0 + fVar62 * fVar5 * 1.0 + fVar3 * 0.0 + fVar53 * fVar4 * -1.0;
  fVar69 = fVar5 * fVar63 * 1.0 + fVar62 * fVar2 * -1.0 + fVar4 * 0.0 + fVar53 * fVar3 * 1.0;
  fVar62 = fVar4 * fVar63 * -1.0 + fVar62 * fVar3 * -1.0 + fVar5 * 0.0 + fVar53 * fVar2 * -1.0;
  fVar2 = *(float *)param_2[1];
  fVar3 = param_1[4];
  auVar81._0_4_ = 0.0 - auVar76._0_4_;
  auVar81._4_4_ = 0.0 - local_148._8_4_;
  auVar81._8_4_ = 0.0 - fStack_130;
  auVar81._12_4_ = 0.0 - fVar65;
  auVar85._0_4_ = 0.0 - fStack_104;
  auVar85._4_4_ = 0.0 - fVar70;
  auVar85._8_4_ = 0.0 - fStack_134;
  auVar85._12_4_ = 0.0 - fVar65;
  pfVar1 = param_1 + 3;
  fVar4 = *pfVar1;
  uVar15 = *(undefined8 *)pfVar1;
  local_168 = maxps(auVar81,auVar76);
  auVar68._4_4_ = fVar70;
  auVar68._0_4_ = fStack_104;
  auVar68._8_4_ = fStack_134;
  auVar68._12_4_ = fVar65;
  auVar85 = maxps(auVar85,auVar68);
  fVar5 = param_1[5];
  fVar53 = *(float *)(param_2[1] + 4);
  fVar74 = fVar66 * fVar83 * -1.0 + fVar82 * fVar69 * 1.0 + fVar84 * fVar64 + fVar71 * fVar62 * 1.0;
  fVar75 = fVar64 * fVar83 * 1.0 + fVar82 * fVar62 * 1.0 + fVar84 * fVar66 + fVar71 * fVar69 * -1.0;
  fVar82 = fVar62 * fVar83 * 1.0 + fVar82 * fVar64 * -1.0 + fVar84 * fVar69 + fVar71 * fVar66 * 1.0;
  fVar62 = *(float *)(param_2[1] + 8);
  auVar80._0_4_ = 0.0 - local_108;
  auVar80._4_4_ = 0.0 - fVar79;
  auVar80._8_4_ = 0.0 - local_138;
  auVar80._12_4_ = 0.0 - fVar65;
  auVar78._4_4_ = fVar79;
  auVar78._0_4_ = local_108;
  auVar78._8_4_ = local_138;
  auVar78._12_4_ = fVar65;
  auVar81 = maxps(auVar80,auVar78);
  local_148._4_4_ = fVar70;
  local_148._0_4_ = fVar79;
  local_148._12_4_ = 0;
  fStack_100 = auVar76._0_4_;
  uStack_fc = 0;
  local_e8._0_8_ = CONCAT44(0.0 - fStack_104,0.0 - local_108);
  local_e8._8_4_ = 0.0 - auVar76._0_4_;
  local_e8._12_4_ = 0;
  uStack_12c = 0;
  auVar77._8_4_ = local_e8._8_4_;
  auVar77._0_8_ = local_e8._0_8_;
  auVar77._12_4_ = 0;
  local_128._0_8_ = CONCAT44(0.0 - fVar70,0.0 - fVar79);
  local_128._8_4_ = 0.0 - local_148._8_4_;
  local_128._12_4_ = 0;
  auVar52._4_4_ = fStack_104;
  auVar52._0_4_ = local_108;
  auVar52._8_4_ = auVar76._0_4_;
  auVar52._12_4_ = 0;
  auVar78 = maxps(auVar77,auVar52);
  auVar67._8_4_ = local_128._8_4_;
  auVar67._0_8_ = local_128._0_8_;
  auVar67._12_4_ = 0;
  local_f8._0_4_ = 0.0 - local_138;
  local_f8._4_4_ = 0.0 - fStack_134;
  local_f8._8_4_ = 0.0 - fStack_130;
  local_f8._12_4_ = 0;
  auVar68 = maxps(auVar67,local_148);
  auVar26._4_4_ = fStack_134;
  auVar26._0_4_ = local_138;
  auVar26._8_4_ = fStack_130;
  auVar26._12_4_ = 0;
  _local_118 = maxps(local_f8,auVar26);
  auVar26 = _local_118;
  _local_188 = auVar68;
  auVar28._0_4_ = 0.0 - fVar74;
  auVar28._4_4_ = 0.0 - fVar74;
  auVar28._8_4_ = 0.0 - fVar74;
  auVar28._12_4_ = 0.0 - fVar74;
  fVar71 = auVar81._0_4_ * fVar2 + auVar81._4_4_ * fVar53 + auVar81._8_4_ * fVar62;
  auVar47._4_4_ = fVar74;
  auVar47._0_4_ = fVar74;
  auVar47._8_4_ = fVar74;
  auVar47._12_4_ = fVar74;
  auVar47 = maxps(auVar28,auVar47);
  auVar30._0_4_ = 0.0 - fVar75;
  auVar30._4_4_ = 0.0 - fVar75;
  auVar30._8_4_ = 0.0 - fVar75;
  auVar30._12_4_ = 0.0 - fVar75;
  auVar48._4_4_ = fVar75;
  auVar48._0_4_ = fVar75;
  auVar48._8_4_ = fVar75;
  auVar48._12_4_ = fVar75;
  auVar48 = maxps(auVar30,auVar48);
  fVar69 = auVar85._0_4_ * fVar2 + auVar85._4_4_ * fVar53 + auVar85._8_4_ * fVar62;
  fVar63 = (float)((ulonglong)*(undefined8 *)pfVar1 >> 0x20);
  auVar32._0_4_ = 0.0 - fVar82;
  auVar32._4_4_ = 0.0 - fVar82;
  auVar32._8_4_ = 0.0 - fVar82;
  auVar32._12_4_ = 0.0 - fVar82;
  fVar66 = local_168._0_4_ * fVar2 + local_168._4_4_ * fVar53 + local_168._8_4_ * fVar62;
  auVar49._4_4_ = fVar82;
  auVar49._0_4_ = fVar82;
  auVar49._8_4_ = fVar82;
  auVar49._12_4_ = fVar82;
  auVar49 = maxps(auVar32,auVar49);
  fVar64 = local_108 * fVar74 + fStack_104 * fVar75 + auVar76._0_4_ * fVar82;
  auVar35._0_4_ = 0.0 - fVar64;
  auVar35._4_4_ = 0.0 - fVar64;
  auVar35._8_4_ = 0.0 - fVar64;
  auVar35._12_4_ = 0.0 - fVar64;
  fVar65 = auVar78._0_4_ * fVar4 + auVar78._4_4_ * fVar3 + auVar78._8_4_ * fVar5;
  auVar50._4_4_ = fVar64;
  auVar50._0_4_ = fVar64;
  auVar50._8_4_ = fVar64;
  auVar50._12_4_ = fVar64;
  auVar50 = maxps(auVar35,auVar50);
  lVar22 = 0;
  lVar21 = 0x10;
  lVar24 = 0x10;
  fVar64 = fVar79 * fVar74 + fVar70 * fVar75 + local_148._8_4_ * fVar82;
  auVar37._0_4_ = 0.0 - fVar64;
  auVar37._4_4_ = 0.0 - fVar64;
  auVar37._8_4_ = 0.0 - fVar64;
  auVar37._12_4_ = 0.0 - fVar64;
  fVar70 = auVar68._0_4_ * fVar4 + auVar68._4_4_ * fVar3 + auVar68._8_4_ * fVar5;
  auVar51._4_4_ = fVar64;
  auVar51._0_4_ = fVar64;
  auVar51._8_4_ = fVar64;
  auVar51._12_4_ = fVar64;
  auVar51 = maxps(auVar37,auVar51);
  local_158[0] = 1.0866475e-31;
  local_158[1] = 1.9787966e-24;
  local_158[2] = 1.5636842e-36;
  local_158[3] = 9.25572e-41;
  auVar61._0_4_ = local_138 * fVar74 + fStack_134 * fVar75 + fStack_130 * fVar82;
  auVar61._4_4_ = auVar61._0_4_;
  auVar61._8_4_ = auVar61._0_4_;
  auVar61._12_4_ = auVar61._0_4_;
  auVar39._0_4_ = 0.0 - auVar61._0_4_;
  auVar39._4_4_ = 0.0 - auVar61._0_4_;
  auVar39._8_4_ = 0.0 - auVar61._0_4_;
  auVar39._12_4_ = 0.0 - auVar61._0_4_;
  fVar64 = (float)local_118._0_4_ * fVar4 + (float)local_118._4_4_ * fVar3 +
           (float)uStack_110 * fVar5;
  auVar52 = maxps(auVar39,auVar61);
  local_d8._4_4_ = fStack_104;
  local_d8._0_4_ = local_108;
  local_d8._8_4_ = auVar76._0_4_;
  local_d8._12_4_ = 0;
  local_c8._8_4_ = local_e8._8_4_;
  local_c8._0_8_ = local_e8._0_8_;
  local_c8._12_4_ = 0;
  lVar23 = lVar22;
  _local_118 = auVar26;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) =
         local_d8[(*(byte *)((longlong)local_158 + lVar23) ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar78;
  lVar24 = 0x10;
  fVar79 = local_178[0] * fVar74;
  fVar84 = local_178[1] * fVar75;
  fVar83 = local_178[2] * fVar82;
  local_c8 = auVar78;
  local_178[0] = 1.0866475e-31;
  local_178[1] = 4.1238743e-34;
  local_178[2] = 1.5636842e-36;
  local_178[3] = 9.25572e-41;
  fVar83 = fVar79 + fVar84 + fVar83;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_158 + lVar23) =
         local_d8[(*(byte *)((longlong)local_178 + lVar23) ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar81;
  local_c8 = auVar81;
  lVar24 = 0x10;
  local_178[0] = 1.0866475e-31;
  local_178[1] = 4.1238743e-34;
  local_178[2] = 1.5636842e-36;
  local_178[3] = 9.25572e-41;
  fVar79 = local_158[0] * fVar4 + local_158[1] * fVar3 + local_158[2] * fVar5;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_158 + lVar23) =
         local_d8[(*(byte *)((longlong)local_178 + lVar23) ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_178[0] = 1.0866475e-31;
  local_178[1] = 1.9787966e-24;
  local_178[2] = 1.5636842e-36;
  local_178[3] = 9.25572e-41;
  lVar24 = 0x10;
  fVar84 = local_158[0] * fVar2 + local_158[1] * fVar53 + local_158[2] * fVar62;
  auVar25._0_4_ = 0.0 - fVar83;
  auVar25._4_4_ = 0.0 - fVar83;
  auVar25._8_4_ = 0.0 - fVar83;
  auVar25._12_4_ = 0.0 - fVar83;
  auVar6._4_4_ = fVar83;
  auVar6._0_4_ = fVar83;
  auVar6._8_4_ = fVar83;
  auVar6._12_4_ = fVar83;
  auVar26 = maxps(auVar25,auVar6);
  local_d8._0_8_ = local_148._0_8_;
  local_d8._8_8_ = local_148._8_8_;
  local_c8._0_8_ = local_128._0_8_;
  local_c8._8_8_ = local_128._8_8_;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_158 + lVar23) =
         local_d8[(*(byte *)((longlong)local_178 + lVar23) ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_188 = auVar68._0_8_;
  auVar16 = local_188;
  uStack_180 = auVar68._8_8_;
  uVar17 = uStack_180;
  lVar24 = 0x10;
  local_d8 = auVar68;
  local_c8 = auVar68;
  local_188 = (undefined1  [8])0x8090a0b0c0d0e0f;
  uStack_180 = 0x1020304050607;
  fVar83 = local_158[0] * fVar74 + local_158[1] * fVar75 + local_158[2] * fVar82;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar81;
  lVar24 = 0x10;
  local_c8 = auVar81;
  local_188 = (undefined1  [8])0xc0d0e0f08090a0b;
  uStack_180 = 0x405060700010203;
  fVar54 = local_178[0] * fVar4 + local_178[1] * fVar3 + local_178[2] * fVar5;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_188 = (undefined1  [8])0x18191a1b0c0d0e0f;
  uStack_180 = 0x1020304050607;
  lVar24 = 0x10;
  fVar40 = local_178[0] * fVar2 + local_178[1] * fVar53 + local_178[2] * fVar62;
  auVar27._0_4_ = 0.0 - fVar83;
  auVar27._4_4_ = 0.0 - fVar83;
  auVar27._8_4_ = 0.0 - fVar83;
  auVar27._12_4_ = 0.0 - fVar83;
  auVar7._4_4_ = fVar83;
  auVar7._0_4_ = fVar83;
  auVar7._8_4_ = fVar83;
  auVar7._12_4_ = fVar83;
  auVar28 = maxps(auVar27,auVar7);
  local_d8._0_8_ = CONCAT44(fStack_134,local_138);
  local_d8._8_8_ = CONCAT44(uStack_12c,fStack_130);
  local_c8._0_8_ = local_f8._0_8_;
  local_c8._8_8_ = local_f8._8_8_;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_188 = (undefined1  [8])0x8090a0b0c0d0e0f;
  uStack_180 = 0x1020304050607;
  lVar24 = 0x10;
  fVar83 = local_178[0] * fVar74 + local_178[1] * fVar75 + local_178[2] * fVar82;
  local_d8 = _local_118;
  local_c8 = _local_118;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar81;
  lVar24 = 0x10;
  local_c8 = auVar81;
  local_188 = (undefined1  [8])0x1020304050607;
  uStack_180 = 0x8090a0b0c0d0e0f;
  fVar55 = local_178[0] * fVar4 + local_178[1] * fVar3 + local_178[2] * fVar5;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  lVar24 = 0x10;
  local_188 = (undefined1  [8])0xc0d0e0f08090a0b;
  uStack_180 = 0x405060710111213;
  fVar41 = local_178[0] * fVar2 + local_178[1] * fVar53 + local_178[2] * fVar62;
  auVar29._0_4_ = 0.0 - fVar83;
  auVar29._4_4_ = 0.0 - fVar83;
  auVar29._8_4_ = 0.0 - fVar83;
  auVar29._12_4_ = 0.0 - fVar83;
  auVar8._4_4_ = fVar83;
  auVar8._0_4_ = fVar83;
  auVar8._8_4_ = fVar83;
  auVar8._12_4_ = fVar83;
  auVar30 = maxps(auVar29,auVar8);
  local_d8._4_4_ = fStack_104;
  local_d8._0_4_ = local_108;
  local_d8._12_4_ = uStack_fc;
  local_d8._8_4_ = fStack_100;
  local_c8 = local_e8;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar78;
  local_c8 = auVar78;
  lVar24 = 0x10;
  local_188 = (undefined1  [8])0xc0d0e0f08090a0b;
  uStack_180 = 0x405060700010203;
  fVar83 = local_178[0] * fVar74 + local_178[1] * fVar75 + local_178[2] * fVar82;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar85;
  local_c8 = auVar85;
  lVar24 = 0x10;
  local_188 = (undefined1  [8])0x8090a0b0c0d0e0f;
  uStack_180 = 0x1020304050607;
  fVar56 = local_178[0] * fVar4 + local_178[1] * fVar3 + local_178[2] * fVar5;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_188 = (undefined1  [8])0xc0d0e0f08090a0b;
  uStack_180 = 0x405060710111213;
  lVar24 = 0x10;
  fVar42 = local_178[0] * fVar2 + local_178[1] * fVar53 + local_178[2] * fVar62;
  auVar31._0_4_ = 0.0 - fVar83;
  auVar31._4_4_ = 0.0 - fVar83;
  auVar31._8_4_ = 0.0 - fVar83;
  auVar31._12_4_ = 0.0 - fVar83;
  auVar9._4_4_ = fVar83;
  auVar9._0_4_ = fVar83;
  auVar9._8_4_ = fVar83;
  auVar9._12_4_ = fVar83;
  auVar32 = maxps(auVar31,auVar9);
  local_d8._0_8_ = local_148._0_8_;
  local_d8._8_8_ = local_148._8_8_;
  local_c8._0_8_ = local_128._0_8_;
  local_c8._8_8_ = local_128._8_8_;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar68;
  local_c8 = auVar68;
  lVar24 = 0x10;
  local_188 = (undefined1  [8])0xc0d0e0f08090a0b;
  uStack_180 = 0x405060700010203;
  fVar83 = local_178[0] * fVar74 + local_178[1] * fVar75 + local_178[2] * fVar82;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar85;
  local_c8 = auVar85;
  lVar24 = 0x10;
  local_188 = (undefined1  [8])0xc0d0e0f08090a0b;
  uStack_180 = 0x405060700010203;
  fVar57 = local_178[0] * fVar4 + local_178[1] * fVar3 + local_178[2] * fVar5;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_188 = (undefined1  [8])0xc0d0e0f08090a0b;
  uStack_180 = 0x405060710111213;
  lVar24 = 0x10;
  fVar43 = local_178[0] * fVar2 + local_178[1] * fVar53 + local_178[2] * fVar62;
  auVar33._0_4_ = 0.0 - fVar83;
  auVar33._4_4_ = 0.0 - fVar83;
  auVar33._8_4_ = 0.0 - fVar83;
  auVar33._12_4_ = 0.0 - fVar83;
  auVar10._4_4_ = fVar83;
  auVar10._0_4_ = fVar83;
  auVar10._8_4_ = fVar83;
  auVar10._12_4_ = fVar83;
  auVar68 = maxps(auVar33,auVar10);
  local_d8._0_8_ = CONCAT44(fStack_134,local_138);
  local_d8._8_8_ = CONCAT44(uStack_12c,fStack_130);
  local_c8._0_8_ = local_f8._0_8_;
  local_c8._8_8_ = local_f8._8_8_;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_188 = (undefined1  [8])0xc0d0e0f08090a0b;
  uStack_180 = 0x405060700010203;
  lVar24 = 0x10;
  local_d8 = _local_118;
  local_c8 = _local_118;
  fVar83 = local_178[0] * fVar74 + local_178[1] * fVar75 + local_178[2] * fVar82;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar85;
  local_c8 = auVar85;
  lVar24 = 0x10;
  local_188 = (undefined1  [8])0x1020304050607;
  uStack_180 = 0x8090a0b0c0d0e0f;
  fVar58 = local_178[0] * fVar4 + local_178[1] * fVar3 + local_178[2] * fVar5;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  lVar24 = 0x10;
  local_188 = (undefined1  [8])0x1020314151617;
  uStack_180 = 0x8090a0b0c0d0e0f;
  fVar44 = local_178[0] * fVar2 + local_178[1] * fVar53 + local_178[2] * fVar62;
  auVar34._0_4_ = 0.0 - fVar83;
  auVar34._4_4_ = 0.0 - fVar83;
  auVar34._8_4_ = 0.0 - fVar83;
  auVar34._12_4_ = 0.0 - fVar83;
  auVar11._4_4_ = fVar83;
  auVar11._0_4_ = fVar83;
  auVar11._8_4_ = fVar83;
  auVar11._12_4_ = fVar83;
  auVar35 = maxps(auVar34,auVar11);
  local_d8._4_4_ = fStack_104;
  local_d8._0_4_ = local_108;
  local_d8._12_4_ = uStack_fc;
  local_d8._8_4_ = fStack_100;
  local_c8 = local_e8;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar78;
  local_c8 = auVar78;
  lVar24 = 0x10;
  uStack_180 = 0x8090a0b0c0d0e0f;
  local_188 = (undefined1  [8])0x1020304050607;
  fVar83 = local_178[0] * fVar74 + local_178[1] * fVar75 + local_178[2] * fVar82;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    *(undefined1 *)((longlong)local_178 + lVar23) = local_d8[((byte)local_188[lVar23] ^ 3) & 0x1f];
    auVar78 = local_168;
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  uVar18 = local_168._0_8_;
  uVar19 = local_168._8_8_;
  lVar24 = 0x10;
  local_d8._0_8_ = local_168._0_8_;
  local_d8._8_8_ = local_168._8_8_;
  local_c8._0_8_ = local_168._0_8_;
  local_c8._8_8_ = local_168._8_8_;
  local_168._0_8_ = 0x8090a0b0c0d0e0f;
  local_168._8_8_ = 0x1020304050607;
  fVar59 = local_178[0] * fVar4 + local_178[1] * fVar3 + local_178[2] * fVar5;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    local_188[lVar23] = local_d8[((byte)local_168[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_168._0_8_ = 0x1020314151617;
  local_168._8_8_ = 0x8090a0b0c0d0e0f;
  lVar24 = 0x10;
  fVar45 = (float)local_188._0_4_ * fVar2 + (float)local_188._4_4_ * fVar53 +
           (float)uStack_180 * fVar62;
  auVar36._0_4_ = 0.0 - fVar83;
  auVar36._4_4_ = 0.0 - fVar83;
  auVar36._8_4_ = 0.0 - fVar83;
  auVar36._12_4_ = 0.0 - fVar83;
  auVar12._4_4_ = fVar83;
  auVar12._0_4_ = fVar83;
  auVar12._8_4_ = fVar83;
  auVar12._12_4_ = fVar83;
  auVar37 = maxps(auVar36,auVar12);
  local_d8._0_8_ = local_148._0_8_;
  local_d8._8_8_ = local_148._8_8_;
  local_c8._0_8_ = local_128._0_8_;
  local_c8._8_8_ = local_128._8_8_;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    local_188[lVar23] = local_d8[((byte)local_168[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8._0_8_ = auVar16;
  local_d8._8_8_ = uVar17;
  local_c8._0_8_ = auVar16;
  local_c8._8_8_ = uVar17;
  lVar24 = 0x10;
  local_168._0_8_ = 0x1020304050607;
  local_168._8_8_ = 0x8090a0b0c0d0e0f;
  fVar83 = (float)local_188._0_4_ * fVar74 + (float)local_188._4_4_ * fVar75 +
           (float)uStack_180 * fVar82;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    local_188[lVar23] = local_d8[((byte)local_168[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8._0_8_ = uVar18;
  local_d8._8_8_ = uVar19;
  local_c8._0_8_ = uVar18;
  local_c8._8_8_ = uVar19;
  lVar24 = 0x10;
  local_168._0_8_ = 0xc0d0e0f08090a0b;
  local_168._8_8_ = 0x405060700010203;
  fVar60 = (float)local_188._0_4_ * fVar4 + (float)local_188._4_4_ * fVar3 +
           (float)uStack_180 * fVar5;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    local_188[lVar23] = local_d8[((byte)local_168[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_168._0_8_ = 0x1020314151617;
  local_168._8_8_ = 0x8090a0b0c0d0e0f;
  lVar24 = 0x10;
  fVar46 = (float)local_188._0_4_ * fVar2 + (float)local_188._4_4_ * fVar53 +
           (float)uStack_180 * fVar62;
  auVar38._0_4_ = 0.0 - fVar83;
  auVar38._4_4_ = 0.0 - fVar83;
  auVar38._8_4_ = 0.0 - fVar83;
  auVar38._12_4_ = 0.0 - fVar83;
  auVar13._4_4_ = fVar83;
  auVar13._0_4_ = fVar83;
  auVar13._8_4_ = fVar83;
  auVar13._12_4_ = fVar83;
  auVar39 = maxps(auVar38,auVar13);
  local_d8._0_8_ = CONCAT44(fStack_134,local_138);
  local_d8._8_8_ = CONCAT44(uStack_12c,fStack_130);
  local_c8._0_8_ = local_f8._0_8_;
  local_c8._8_8_ = local_f8._8_8_;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    local_188[lVar23] = local_d8[((byte)local_168[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8._0_8_ = local_118;
  local_d8._8_8_ = uStack_110;
  local_c8._0_8_ = local_118;
  local_c8._8_8_ = uStack_110;
  lVar24 = 0x10;
  local_168._0_8_ = 0x1020304050607;
  local_168._8_8_ = 0x8090a0b0c0d0e0f;
  fVar74 = (float)local_188._0_4_ * fVar74 + (float)local_188._4_4_ * fVar75 +
           (float)uStack_180 * fVar82;
  lVar23 = lVar22;
  do {
    lVar24 = lVar24 + -1;
    local_188[lVar23] = local_d8[((byte)local_168[lVar23] ^ 3) & 0x1f];
    lVar23 = lVar23 + 1;
  } while (lVar24 != 0);
  local_d8 = auVar78;
  local_c8 = auVar78;
  local_168._8_8_ = 0x8090a0b0c0d0e0f;
  local_168._0_8_ = 0x1020304050607;
  fVar75 = (float)local_188._0_4_ * fVar4 + (float)local_188._4_4_ * fVar3 +
           (float)uStack_180 * fVar5;
  do {
    lVar21 = lVar21 + -1;
    local_188[lVar22] = local_d8[((byte)local_168[lVar22] ^ 3) & 0x1f];
    lVar22 = lVar22 + 1;
  } while (lVar21 != 0);
  auVar73._0_4_ = 0.0 - fVar74;
  auVar73._4_4_ = 0.0 - fVar74;
  auVar73._8_4_ = 0.0 - fVar74;
  auVar73._12_4_ = 0.0 - fVar74;
  auVar14._4_4_ = fVar74;
  auVar14._0_4_ = fVar74;
  auVar14._8_4_ = fVar74;
  auVar14._12_4_ = fVar74;
  auVar78 = maxps(auVar73,auVar14);
  fVar74 = (float)local_188._0_4_ * fVar2 + (float)local_188._4_4_ * fVar53 +
           (float)uStack_180 * fVar62;
  auVar72._0_4_ =
       -(uint)((((((((((((fVar65 + fVar2 < auVar50._0_4_ ||
                         (fVar66 + fVar5 < auVar49._0_4_ ||
                         (fVar71 + (float)uVar15 < auVar47._0_4_ || fVar69 + fVar63 < auVar48._0_4_)
                         )) || fVar70 + fVar53 < auVar51._0_4_) || fVar64 + fVar62 < auVar52._0_4_)
                      || fVar84 + fVar79 < auVar26._0_4_) || fVar40 + fVar54 < auVar28._0_4_) ||
                    fVar41 + fVar55 < auVar30._0_4_) || fVar42 + fVar56 < auVar32._0_4_) ||
                  fVar43 + fVar57 < auVar68._0_4_) || fVar44 + fVar58 < auVar35._0_4_) ||
                fVar45 + fVar59 < auVar37._0_4_) || fVar46 + fVar60 < auVar39._0_4_) ||
              fVar74 + fVar75 < auVar78._0_4_);
  auVar72._4_4_ =
       -(uint)((((((((((((fVar65 + fVar2 < auVar50._4_4_ ||
                         (fVar66 + fVar5 < auVar49._4_4_ ||
                         (fVar71 + (float)uVar15 < auVar47._4_4_ || fVar69 + fVar63 < auVar48._4_4_)
                         )) || fVar70 + fVar53 < auVar51._4_4_) || fVar64 + fVar62 < auVar52._4_4_)
                      || fVar84 + fVar79 < auVar26._4_4_) || fVar40 + fVar54 < auVar28._4_4_) ||
                    fVar41 + fVar55 < auVar30._4_4_) || fVar42 + fVar56 < auVar32._4_4_) ||
                  fVar43 + fVar57 < auVar68._4_4_) || fVar44 + fVar58 < auVar35._4_4_) ||
                fVar45 + fVar59 < auVar37._4_4_) || fVar46 + fVar60 < auVar39._4_4_) ||
              fVar74 + fVar75 < auVar78._4_4_);
  auVar72._8_4_ =
       -(uint)((((((((((((fVar65 + fVar2 < auVar50._8_4_ ||
                         (fVar66 + fVar5 < auVar49._8_4_ ||
                         (fVar71 + fVar4 < auVar47._8_4_ || fVar69 + fVar3 < auVar48._8_4_))) ||
                        fVar70 + fVar53 < auVar51._8_4_) || fVar64 + fVar62 < auVar52._8_4_) ||
                      fVar84 + fVar79 < auVar26._8_4_) || fVar40 + fVar54 < auVar28._8_4_) ||
                    fVar41 + fVar55 < auVar30._8_4_) || fVar42 + fVar56 < auVar32._8_4_) ||
                  fVar43 + fVar57 < auVar68._8_4_) || fVar44 + fVar58 < auVar35._8_4_) ||
                fVar45 + fVar59 < auVar37._8_4_) || fVar46 + fVar60 < auVar39._8_4_) ||
              fVar74 + fVar75 < auVar78._8_4_);
  auVar72._12_4_ =
       -(uint)((((((((((((fVar65 + fVar2 < auVar50._12_4_ ||
                         (fVar66 + fVar5 < auVar49._12_4_ ||
                         (fVar71 + fVar4 < auVar47._12_4_ || fVar69 + fVar3 < auVar48._12_4_))) ||
                        fVar70 + fVar53 < auVar51._12_4_) || fVar64 + fVar62 < auVar52._12_4_) ||
                      fVar84 + fVar79 < auVar26._12_4_) || fVar40 + fVar54 < auVar28._12_4_) ||
                    fVar41 + fVar55 < auVar30._12_4_) || fVar42 + fVar56 < auVar32._12_4_) ||
                  fVar43 + fVar57 < auVar68._12_4_) || fVar44 + fVar58 < auVar35._12_4_) ||
                fVar45 + fVar59 < auVar37._12_4_) || fVar46 + fVar60 < auVar39._12_4_) ||
              fVar74 + fVar75 < auVar78._12_4_);
  iVar20 = movmskps(0,auVar72);
  return iVar20 != 0xf;
}



void * FUN_1402c3240(void *param_1,uint param_2)

{
  FUN_1402c3270();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402c3270(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  
  *param_1 = mcoCObstacleList::vftable;
  lVar1 = param_1[2];
  if (param_1[1] != lVar1) {
    uVar2 = FUN_140333a10(lVar1,lVar1,param_1[1],param_4,0xfffffffffffffffe);
    FUN_1402ce6b0(uVar2,param_1[2]);
    param_1[2] = uVar2;
  }
  if (param_1[1] != 0) {
    FUN_1402ce6b0(param_1[1],param_1[2]);
    operator_delete((void *)param_1[1]);
  }
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  return;
}



undefined8 * FUN_1402c3300(longlong param_1,undefined8 *param_2,int param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  
  if (param_3 < (int)(*(longlong *)(param_1 + 0x10) - *(longlong *)(param_1 + 8) >> 4)) {
    puVar2 = (undefined8 *)((longlong)param_3 * 0x10 + *(longlong *)(param_1 + 8));
    *param_2 = *puVar2;
    lVar1 = puVar2[1];
    param_2[1] = lVar1;
    if (lVar1 != 0) {
      LOCK();
      *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
      UNLOCK();
    }
  }
  else {
    *param_2 = 0;
    param_2[1] = 0;
  }
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1402c3360(undefined8 *param_1,longlong param_2,undefined8 *param_3,float *param_4,float param_5)

{
  longlong lVar1;
  code *pcVar2;
  char cVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong lVar9;
  int *piVar10;
  int *piVar11;
  int *piVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  undefined1 auStack_1f8 [32];
  int local_1d8 [2];
  int *local_1d0;
  int *local_1c8;
  int *local_1c0;
  float *local_1b0;
  undefined8 local_1a8;
  undefined1 local_198 [48];
  undefined1 local_168 [48];
  float local_138;
  float fStack_134;
  float local_130;
  undefined8 local_128;
  undefined8 uStack_120;
  undefined8 local_118;
  undefined8 uStack_110;
  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;
  undefined4 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;
  undefined4 local_98;
  ulonglong local_90;
  
  local_1a8 = 0xfffffffffffffffe;
  local_90 = DAT_1405d84f0 ^ (ulonglong)auStack_1f8;
  local_128 = *param_3;
  uStack_120 = param_3[1];
  local_118 = param_3[2];
  uStack_110 = param_3[3];
  local_108 = param_3[4];
  uStack_100 = param_3[5];
  local_f8 = param_3[6];
  uStack_f0 = param_3[7];
  local_e8 = *(undefined4 *)(param_3 + 8);
  uStack_e4 = *(undefined4 *)((longlong)param_3 + 0x44);
  uStack_e0 = *(undefined4 *)(param_3 + 9);
  uStack_dc = *(undefined4 *)((longlong)param_3 + 0x4c);
  local_d8 = *(undefined4 *)(param_3 + 10);
  uStack_d4 = *(undefined4 *)((longlong)param_3 + 0x54);
  uStack_d0 = *(undefined4 *)(param_3 + 0xb);
  uStack_cc = *(undefined4 *)((longlong)param_3 + 0x5c);
  local_c8 = *(undefined4 *)(param_3 + 0xc);
  local_1b0 = param_4;
  FUN_1402bdc00(&local_128);
  fVar13 = (float)uStack_f0 * param_4[2];
  fVar14 = local_f8._4_4_ * param_4[1];
  fVar15 = (float)local_f8 * *param_4;
  piVar11 = (int *)0x0;
  local_1d0 = (int *)0x0;
  piVar12 = (int *)0x0;
  local_1c8 = (int *)0x0;
  piVar10 = (int *)0x0;
  local_1c0 = (int *)0x0;
  do {
    local_1d8[0] = 0;
    if (0 < *(int *)(param_2 + 0xb8)) {
      do {
        iVar4 = local_1d8[0];
        lVar5 = (longlong)local_1d8[0];
        lVar9 = *(longlong *)(param_2 + 200);
        lVar1 = *(longlong *)(param_2 + 0xc0);
        uVar7 = (ulonglong)*(ushort *)(lVar9 + lVar5 * 6);
        local_b8 = *(undefined4 *)(lVar1 + uVar7 * 0xc);
        local_b4 = *(undefined4 *)(lVar1 + 4 + uVar7 * 0xc);
        local_b0 = *(undefined4 *)(lVar1 + 8 + uVar7 * 0xc);
        uVar7 = (ulonglong)*(ushort *)(lVar9 + 2 + lVar5 * 6);
        local_ac = *(undefined4 *)(lVar1 + uVar7 * 0xc);
        local_a8 = *(undefined4 *)(lVar1 + 4 + uVar7 * 0xc);
        local_a4 = *(undefined4 *)(lVar1 + 8 + uVar7 * 0xc);
        uVar7 = (ulonglong)*(ushort *)(lVar9 + 4 + lVar5 * 6);
        local_a0 = *(undefined4 *)(lVar1 + uVar7 * 0xc);
        local_9c = *(undefined4 *)(lVar1 + 4 + uVar7 * 0xc);
        local_98 = *(undefined4 *)(lVar1 + 8 + uVar7 * 0xc);
        cVar3 = FUN_1402c3c90(&local_b8,&local_128);
        if (cVar3 == '\x01') {
          if ((local_1d8 < piVar12) && (piVar11 <= local_1d8)) {
            lVar9 = (longlong)local_1d8 - (longlong)piVar11;
            if (piVar12 == piVar10) {
              uVar7 = (longlong)piVar12 - (longlong)piVar11 >> 2;
              if (0x3ffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                pcVar2 = (code *)swi(3);
                uVar6 = (*pcVar2)();
                return uVar6;
              }
              uVar7 = uVar7 + 1;
              uVar8 = (longlong)piVar10 - (longlong)piVar11 >> 2;
              if (uVar8 < uVar7) {
                if (0x3fffffffffffffff - (uVar8 >> 1) < uVar8) {
                  uVar8 = 0;
                }
                else {
                  uVar8 = uVar8 + (uVar8 >> 1);
                }
                if (uVar8 < uVar7) {
                  uVar8 = uVar7;
                }
                FUN_140051e60(&local_1d0,uVar8);
                piVar11 = local_1d0;
                piVar12 = local_1c8;
                piVar10 = local_1c0;
              }
            }
            if (piVar12 != (int *)0x0) {
              *piVar12 = piVar11[lVar9 >> 2];
            }
          }
          else {
            if (piVar12 == piVar10) {
              uVar7 = (longlong)piVar12 - (longlong)piVar11 >> 2;
              if (0x3ffffffffffffffe < uVar7) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_1402c36cb;
              }
              uVar7 = uVar7 + 1;
              uVar8 = (longlong)piVar10 - (longlong)piVar11 >> 2;
              if (uVar8 < uVar7) {
                if (0x3fffffffffffffff - (uVar8 >> 1) < uVar8) {
                  uVar8 = 0;
                }
                else {
                  uVar8 = uVar8 + (uVar8 >> 1);
                }
                if (uVar8 < uVar7) {
                  uVar8 = uVar7;
                }
                FUN_140051e60(&local_1d0,uVar8);
                piVar11 = local_1d0;
                piVar12 = local_1c8;
                piVar10 = local_1c0;
              }
            }
            if (piVar12 != (int *)0x0) {
              *piVar12 = iVar4;
            }
          }
          piVar12 = piVar12 + 1;
          local_1c8 = piVar12;
        }
        local_1d8[0] = iVar4 + 1;
      } while (local_1d8[0] < *(int *)(param_2 + 0xb8));
    }
    local_130 = (float)uStack_120 + fVar13;
    fStack_134 = local_128._4_4_ + fVar14;
    local_138 = (float)local_128 + fVar15;
    local_128 = CONCAT44(fStack_134,local_138);
    uStack_120 = CONCAT44(uStack_120._4_4_,local_130);
    if (piVar11 != piVar12) {
      fVar13 = local_1b0[2];
      fVar14 = local_1b0[1];
      fVar15 = *local_1b0;
      piVar10 = piVar11;
      do {
        lVar5 = (longlong)*piVar10;
        lVar9 = *(longlong *)(param_2 + 200);
        lVar1 = *(longlong *)(param_2 + 0xc0);
        uVar7 = (ulonglong)*(ushort *)(lVar9 + lVar5 * 6);
        local_b8 = *(undefined4 *)(lVar1 + uVar7 * 0xc);
        local_b4 = *(undefined4 *)(lVar1 + 4 + uVar7 * 0xc);
        local_b0 = *(undefined4 *)(lVar1 + 8 + uVar7 * 0xc);
        uVar7 = (ulonglong)*(ushort *)(lVar9 + 2 + lVar5 * 6);
        local_ac = *(undefined4 *)(lVar1 + uVar7 * 0xc);
        local_a8 = *(undefined4 *)(lVar1 + 4 + uVar7 * 0xc);
        local_a4 = *(undefined4 *)(lVar1 + 8 + uVar7 * 0xc);
        uVar7 = (ulonglong)*(ushort *)(lVar9 + 4 + lVar5 * 6);
        local_a0 = *(undefined4 *)(lVar1 + uVar7 * 0xc);
        local_9c = *(undefined4 *)(lVar1 + 4 + uVar7 * 0xc);
        local_98 = *(undefined4 *)(lVar1 + 8 + uVar7 * 0xc);
        cVar3 = FUN_1402c3c90(&local_b8,&local_128);
        uVar6 = local_128;
        while (cVar3 != '\0') {
          local_130 = (float)uStack_120 - param_5 * fVar13;
          local_128._4_4_ = (float)((ulonglong)uVar6 >> 0x20);
          fStack_134 = local_128._4_4_ - param_5 * fVar14;
          local_128._0_4_ = (float)uVar6;
          local_138 = (float)local_128 - param_5 * fVar15;
          local_128 = CONCAT44(fStack_134,local_138);
          uStack_120._4_4_ = (undefined4)((ulonglong)uStack_120 >> 0x20);
          uStack_120 = CONCAT44(uStack_120._4_4_,local_130);
          cVar3 = FUN_1402c3c90(&local_b8,&local_128);
          uVar6 = local_128;
        }
        piVar10 = piVar10 + 1;
        local_128 = uVar6;
      } while (piVar10 != piVar12);
      *param_1 = uVar6;
      param_1[1] = uStack_120;
      param_1[2] = local_118;
      param_1[3] = uStack_110;
      param_1[4] = local_108;
      param_1[5] = uStack_100;
      param_1[6] = local_f8;
      param_1[7] = uStack_f0;
      *(undefined4 *)(param_1 + 8) = local_e8;
      *(undefined4 *)((longlong)param_1 + 0x44) = uStack_e4;
      *(undefined4 *)(param_1 + 9) = uStack_e0;
      *(undefined4 *)((longlong)param_1 + 0x4c) = uStack_dc;
      *(undefined4 *)(param_1 + 10) = local_d8;
      *(undefined4 *)((longlong)param_1 + 0x54) = uStack_d4;
      *(undefined4 *)(param_1 + 0xb) = uStack_d0;
      *(undefined4 *)((longlong)param_1 + 0x5c) = uStack_cc;
      *(undefined4 *)(param_1 + 0xc) = local_c8;
      if (piVar11 != (int *)0x0) {
        operator_delete(piVar11);
      }
      return 1;
    }
    FUN_1402bda90(param_2 + 0x50,local_198);
    FUN_1402bda90(&local_128,local_168);
    iVar4 = FUN_1402c21e0(local_198,local_168);
  } while (iVar4 != 0);
LAB_1402c36cb:
  if (piVar11 != (int *)0x0) {
    operator_delete(piVar11);
  }
  return 0;
}



bool FUN_1402c3870(longlong param_1,undefined4 *param_2,float *param_3,longlong *param_4)

{
  char cVar1;
  longlong *plVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  
  fVar5 = *(float *)(param_1 + 0x24) - param_3[1];
  fVar4 = *(float *)(param_1 + 0x20) - *param_3;
  fVar3 = *(float *)(param_1 + 0x28) - param_3[2];
  if (fVar5 * fVar5 + fVar4 * fVar4 + fVar3 * fVar3 <=
      *(float *)(param_1 + 0x2c) * *(float *)(param_1 + 0x2c)) {
    plVar2 = param_4;
    cVar1 = FUN_1402bbb40(param_1 + 0x30,param_3);
    if (cVar1 != '\0') {
      if (*(char *)(param_1 + 0x14) == '\0') {
        *param_2 = *(undefined4 *)(param_1 + 0x10);
        if (plVar2 != (longlong *)0x0) {
          *plVar2 = param_1;
        }
      }
      else {
        cVar1 = FUN_1402c3870(*(undefined8 *)(param_1 + 0xb0),param_2);
        if (cVar1 != '\x01') {
          cVar1 = FUN_1402c3870(*(undefined8 *)(param_1 + 0xb8),param_2,param_3,param_4);
          if (cVar1 != '\x01') {
            cVar1 = FUN_1402c3870(*(undefined8 *)(param_1 + 200),param_2,param_3,param_4);
            if (cVar1 != '\x01') {
              cVar1 = FUN_1402c3870(*(undefined8 *)(param_1 + 0xc0),param_2,param_3,param_4);
              if (cVar1 != '\x01') {
                cVar1 = FUN_1402c3870(*(undefined8 *)(param_1 + 0xd0),param_2,param_3,param_4);
                if (cVar1 != '\x01') {
                  cVar1 = FUN_1402c3870(*(undefined8 *)(param_1 + 0xd8),param_2,param_3,param_4);
                  if (cVar1 != '\x01') {
                    cVar1 = FUN_1402c3870(*(undefined8 *)(param_1 + 0xe8),param_2,param_3,param_4);
                    if (cVar1 != '\x01') {
                      cVar1 = FUN_1402c3870(*(undefined8 *)(param_1 + 0xe0),param_2,param_3,param_4)
                      ;
                      return cVar1 == '\x01';
                    }
                  }
                }
              }
            }
          }
        }
      }
      return true;
    }
  }
  return false;
}



void FUN_1402c39e0(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 local_10;
  
  FUN_1402c3a50(&local_10,param_2,0);
  *param_1 = param_2;
  plVar3 = (longlong *)param_1[1];
  param_1[1] = local_10;
  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;
}



undefined8 * FUN_1402c3a50(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  *param_1 = 0;
  puVar1 = operator_new(0x20);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar1 + 1) = 1;
    *(undefined4 *)((longlong)puVar1 + 0xc) = 1;
    *puVar1 = boost::detail::sp_counted_impl_pd<>::vftable;
    puVar1[2] = param_2;
  }
  *param_1 = puVar1;
  return param_1;
}



void FUN_1402c3ac0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001402c3ac4. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete__(*(void **)(param_1 + 0x10));
  return;
}



longlong FUN_1402c3ad0(longlong param_1,type_info *param_2)

{
  bool bVar1;
  
  bVar1 = type_info::operator==
                    (param_2,(type_info *)&boost::checked_array_deleter<int>::RTTI_Type_Descriptor);
  if (bVar1) {
    return param_1 + 0x18;
  }
  return 0;
}



void FUN_1402c3b10(undefined4 *param_1,longlong param_2)

{
  uint uVar1;
  float fVar2;
  float fVar3;
  
  D3DXVec3TransformCoord(param_1,param_1,param_2);
  fVar3 = (float)param_1[3] * (float)param_1[3] + (float)param_1[4] * (float)param_1[4] +
          (float)param_1[5] * (float)param_1[5];
  fVar2 = (float)(0x5f3759df - ((int)fVar3 >> 1));
  fVar2 = fVar2 * (1.5 - fVar2 * fVar2 * fVar3 * 0.5);
  fVar3 = (1.5 - fVar2 * fVar2 * fVar3 * 0.5) * fVar2 * fVar3;
  if ((DAT_14060819c & 1) == 0) {
    DAT_14060819c = DAT_14060819c | 1;
  }
  DAT_1406081a0 = *(undefined4 *)(param_2 + 0x20);
  DAT_1406081a4 = *(undefined4 *)(param_2 + 0x24);
  DAT_1406081a8 = *(undefined4 *)(param_2 + 0x28);
  param_1[3] = DAT_1406081a0;
  param_1[4] = DAT_1406081a4;
  param_1[5] = DAT_1406081a8;
  uVar1 = DAT_14060817c;
  param_1[3] = fVar3 * (float)param_1[3];
  param_1[4] = fVar3 * (float)param_1[4];
  param_1[5] = fVar3 * (float)param_1[5];
  if ((uVar1 & 1) == 0) {
    DAT_14060817c = uVar1 | 1;
  }
  DAT_140608180 = *(undefined4 *)(param_2 + 0x30);
  DAT_140608184 = *(undefined4 *)(param_2 + 0x34);
  DAT_140608188 = *(undefined4 *)(param_2 + 0x38);
  *param_1 = DAT_140608180;
  param_1[1] = DAT_140608184;
  param_1[2] = DAT_140608188;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1402c3c90(float *param_1,float *param_2)

{
  uint7 uVar2;
  ulonglong uVar1;
  longlong lVar3;
  float *pfVar4;
  uint uVar5;
  int iVar6;
  longlong lVar7;
  float *pfVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  undefined8 local_f8;
  undefined8 local_d8;
  float local_d0;
  float local_cc;
  float local_c8;
  float local_c4;
  undefined8 local_c0;
  float local_b8;
  ulonglong local_b0;
  
  local_b0 = DAT_1405d84f0 ^ (ulonglong)&local_f8;
  fVar16 = param_1[3] - *param_1;
  fVar17 = param_1[4] - param_1[1];
  local_d0 = param_1[5] - param_1[2];
  local_cc = param_1[6] - *param_1;
  local_c8 = param_1[7] - param_1[1];
  local_c4 = param_1[8] - param_1[2];
  local_f8 = CONCAT44(fVar17,fVar16);
  local_d8 = local_f8;
  if ((DAT_140608010 & 1) == 0) {
    DAT_140608010 = DAT_140608010 | 1;
  }
  DAT_140608018._0_4_ = local_c4 * fVar17 - local_c8 * local_d0;
  DAT_140608018._4_4_ = local_d0 * local_cc - local_c4 * fVar16;
  DAT_140608020 = local_c8 * fVar16 - fVar17 * local_cc;
  uVar1 = (ulonglong)(uint)DAT_140608020;
  fVar14 = *param_1 * (float)DAT_140608018 + DAT_140608018._4_4_ * param_1[1] +
           DAT_140608020 * param_1[2];
  fVar13 = *param_2 * (float)DAT_140608018 + DAT_140608018._4_4_ * param_2[1] +
           DAT_140608020 * param_2[2];
  fVar15 = ABS(DAT_140608018._4_4_ * param_2[4] + (float)DAT_140608018 * param_2[3] +
               DAT_140608020 * param_2[5]) * param_2[0xc] +
           ABS((float)DAT_140608018 * param_2[6] + DAT_140608018._4_4_ * param_2[7] +
               DAT_140608020 * param_2[8]) * param_2[0xd] +
           ABS(DAT_140608018._4_4_ * param_2[10] + (float)DAT_140608018 * param_2[9] +
               DAT_140608020 * param_2[0xb]) * param_2[0xe];
  if ((fVar15 + fVar13 < fVar14) || (fVar14 < fVar13 - fVar15)) {
LAB_1402c4372:
    uVar1 = uVar1 & 0xffffffffffffff00;
  }
  else {
    iVar6 = 0;
    pfVar8 = param_2;
    do {
      fVar13 = pfVar8[3];
      fVar14 = pfVar8[4];
      fVar15 = pfVar8[5];
      uVar1 = (ulonglong)(uint)fVar15;
      fVar11 = *param_1 * fVar13 + fVar14 * param_1[1] + fVar15 * param_1[2];
      fVar9 = param_1[4] * fVar14 + param_1[3] * fVar13 + param_1[5] * fVar15;
      fVar12 = fVar9;
      if ((fVar11 <= fVar9) && (fVar12 = fVar11, fVar11 < fVar9)) {
        fVar11 = fVar9;
      }
      fVar10 = param_1[7] * fVar14 + param_1[6] * fVar13 + param_1[8] * fVar15;
      fVar9 = fVar10;
      if ((fVar12 <= fVar10) && (fVar9 = fVar12, fVar11 < fVar10)) {
        fVar11 = fVar10;
      }
      fVar13 = *param_2 * fVar13 + fVar14 * param_2[1] + fVar15 * param_2[2];
      if (iVar6 == 0) {
        fVar14 = param_2[0xc];
      }
      else if (iVar6 == 1) {
        fVar14 = param_2[0xd];
      }
      else if (iVar6 == 2) {
        fVar14 = param_2[0xe];
      }
      else {
        fVar14 = 0.0;
      }
      if (iVar6 == 0) {
        fVar15 = param_2[0xc];
      }
      else if (iVar6 == 1) {
        fVar15 = param_2[0xd];
      }
      else if (iVar6 == 2) {
        fVar15 = param_2[0xe];
      }
      else {
        fVar15 = 0.0;
      }
      if ((fVar15 + fVar13 < fVar9) || (fVar11 < fVar13 - fVar14)) goto LAB_1402c4372;
      iVar6 = iVar6 + 1;
      pfVar8 = pfVar8 + 3;
    } while (iVar6 < 3);
    lVar3 = 0;
    pfVar8 = (float *)&local_d8;
    local_c0 = CONCAT44(local_c8 - fVar17,local_cc - fVar16);
    local_b8 = local_c4 - local_d0;
    uVar5 = DAT_140608010;
    do {
      lVar7 = 0;
      pfVar4 = param_2 + 4;
      do {
        if ((uVar5 & 1) == 0) {
          uVar5 = uVar5 | 1;
          DAT_140608010 = uVar5;
        }
        DAT_140608018._0_4_ = pfVar8[1] * pfVar4[1] - pfVar8[2] * *pfVar4;
        DAT_140608018._4_4_ = pfVar8[2] * pfVar4[-1] - *pfVar8 * pfVar4[1];
        DAT_140608020 = *pfVar8 * *pfVar4 - pfVar8[1] * pfVar4[-1];
        fVar17 = DAT_140608018._4_4_ * param_1[1] + (float)DAT_140608018 * *param_1 +
                 DAT_140608020 * param_1[2];
        fVar13 = DAT_140608018._4_4_ * param_1[4] + (float)DAT_140608018 * param_1[3] +
                 DAT_140608020 * param_1[5];
        fVar16 = fVar13;
        if ((fVar17 <= fVar13) && (fVar16 = fVar17, fVar17 < fVar13)) {
          fVar17 = fVar13;
        }
        fVar14 = DAT_140608018._4_4_ * param_1[7] + (float)DAT_140608018 * param_1[6] +
                 DAT_140608020 * param_1[8];
        fVar13 = fVar14;
        if ((fVar16 <= fVar14) && (fVar13 = fVar16, fVar17 < fVar14)) {
          fVar17 = fVar14;
        }
        fVar16 = (float)DAT_140608018 * *param_2 + DAT_140608018._4_4_ * param_2[1] +
                 DAT_140608020 * param_2[2];
        fVar14 = ABS(DAT_140608018._4_4_ * param_2[4] + (float)DAT_140608018 * param_2[3] +
                     DAT_140608020 * param_2[5]) * param_2[0xc] +
                 ABS((float)DAT_140608018 * param_2[6] + DAT_140608018._4_4_ * param_2[7] +
                     DAT_140608020 * param_2[8]) * param_2[0xd] +
                 ABS(DAT_140608018._4_4_ * param_2[10] + (float)DAT_140608018 * param_2[9] +
                     DAT_140608020 * param_2[0xb]) * param_2[0xe];
        uVar2 = (uint7)(uint3)((uint)DAT_140608020 >> 8);
        if ((fVar14 + fVar16 < fVar13) || (fVar17 < fVar16 - fVar14)) {
          return (ulonglong)uVar2 << 8;
        }
        lVar7 = lVar7 + 1;
        pfVar4 = pfVar4 + 3;
      } while (lVar7 < 3);
      lVar3 = lVar3 + 1;
      pfVar8 = pfVar8 + 3;
    } while (lVar3 < 3);
    uVar1 = CONCAT71(uVar2,1);
  }
  return uVar1;
}



undefined8 * FUN_1402c4380(undefined8 *param_1,uint param_2)

{
  int *piVar1;
  bool bVar2;
  
  bVar2 = DAT_140607be1 != '\0';
  *param_1 = mcoBinaryLoad::vftable;
  if ((bVar2) && (param_1[1] != 0)) {
    piVar1 = (int *)(param_1[1] + 0x10);
    *piVar1 = *piVar1 + -1;
  }
  if (7 < (ulonglong)param_1[5]) {
    operator_delete((void *)param_1[2]);
  }
  param_1[5] = 7;
  param_1[4] = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402c43f0(undefined8 *param_1)

{
  int *piVar1;
  bool bVar2;
  
  bVar2 = DAT_140607be1 != '\0';
  *param_1 = mcoBinaryLoad::vftable;
  if ((bVar2) && (param_1[1] != 0)) {
    piVar1 = (int *)(param_1[1] + 0x10);
    *piVar1 = *piVar1 + -1;
  }
  if (7 < (ulonglong)param_1[5]) {
    operator_delete((void *)param_1[2]);
  }
  param_1[5] = 7;
  param_1[4] = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1402c4450(longlong param_1,wchar_t *param_2)

{
  wchar_t wVar1;
  undefined8 uVar2;
  longlong lVar3;
  ulonglong uVar4;
  wchar_t *pwVar5;
  undefined1 auStackY_868 [32];
  wchar_t local_818 [256];
  wchar_t local_618 [256];
  wchar_t local_418 [256];
  wchar_t local_218 [256];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStackY_868;
  param_1 = param_1 + 0x10;
  FUN_140001710(param_1,&DAT_140477960,0);
  if (DAT_140607be1 == '\0') {
    _wsplitpath_s(param_2,local_818,0x100,local_218,0x100,local_418,0x100,local_618,0x100);
    lVar3 = -1;
    pwVar5 = local_818;
    do {
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      wVar1 = *pwVar5;
      pwVar5 = pwVar5 + 1;
    } while (wVar1 != L'\0');
    if (lVar3 == -2) {
      uVar2 = FUN_140123ce0();
      FUN_1400015e0(param_1,uVar2,0,0xffffffffffffffff);
      FUN_140002aa0(param_1,&DAT_14049a36c,1);
    }
  }
  uVar4 = 0xffffffffffffffff;
  pwVar5 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    wVar1 = *pwVar5;
    pwVar5 = pwVar5 + 1;
  } while (wVar1 != L'\0');
  FUN_140002aa0(param_1,param_2,~uVar4 - 1);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1402c4580(longlong param_1,undefined8 param_2)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  undefined1 auStack_258 [32];
  ushort local_238 [8];
  short local_228;
  undefined1 local_226 [526];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  local_228 = 0;
  memset(local_226,0,0x206);
  local_238[0] = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_238,2);
  if ((ushort)(local_238[0] - 1) < 0x103) {
    (**(code **)(**(longlong **)(param_1 + 8) + 8))
              (*(longlong **)(param_1 + 8),&local_228,(ulonglong)local_238[0] * 2);
    *(undefined2 *)(local_226 + (ulonglong)local_238[0] * 2 + -2) = 0;
  }
  else {
    local_228 = 0;
  }
  uVar2 = 0xffffffffffffffff;
  psVar3 = &local_228;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_2,&local_228,~uVar2 - 1);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1402c4660(longlong param_1,undefined8 param_2)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  undefined1 auStack_158 [32];
  ushort local_138 [8];
  char local_128 [272];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_158;
  local_128[0] = '\0';
  memset(local_128 + 1,0,0x103);
  local_138[0] = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_138,2);
  if ((ushort)(local_138[0] - 1) < 0x103) {
    (**(code **)(**(longlong **)(param_1 + 8) + 8))
              (*(longlong **)(param_1 + 8),local_128,local_138[0]);
    local_128[local_138[0]] = '\0';
  }
  else {
    local_128[0] = '\0';
  }
  uVar2 = 0xffffffffffffffff;
  pcVar3 = local_128;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_140003e50(param_2,local_128,~uVar2 - 1);
  return 0;
}



undefined8 FUN_1402c4740(longlong param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 4,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 8,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0xc,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x10,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x14,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x20,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x24,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x28,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x18,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x1c,4);
  return 0;
}



undefined8 FUN_1402c4840(longlong param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 4,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 8,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0xc,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x10,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x14,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x18,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x1c,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x20,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x24,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x28,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x2c,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x34,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x30,4);
  return 0;
}



undefined8 FUN_1402c4980(longlong param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0xc,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x10,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x14,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x18,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x1c,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x20,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x24,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x28,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x2c,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 4,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 8,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x60,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x30,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x34,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x38,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x48,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x4c,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x50,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x54,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x58,4);
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_2 + 0x5c,4);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1402c4b60(longlong param_1,undefined2 *param_2)

{
  longlong *plVar1;
  undefined1 auStack_258 [32];
  ushort local_238 [8];
  undefined2 local_228 [264];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  local_238[0] = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_238,2);
  if ((ushort)(local_238[0] - 1) < 0x103) {
    (**(code **)(**(longlong **)(param_1 + 8) + 8))
              (*(longlong **)(param_1 + 8),local_228,(ulonglong)local_238[0] * 2);
    local_228[local_238[0]] = 0;
    if (2 < local_238[0]) {
      plVar1 = (longlong *)(param_1 + 0x10);
      if (7 < *(ulonglong *)(param_1 + 0x28)) {
        plVar1 = (longlong *)*plVar1;
      }
      FUN_140123580(param_2,plVar1,local_228);
      return 0;
    }
  }
  *param_2 = 0;
  return 0;
}



undefined8 *
FUN_1402c4c30(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  puVar2 = (undefined8 *)0x0;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  *(undefined4 *)(param_1 + 6) = 0;
  param_1[7] = 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;
  *(undefined4 *)(param_1 + 0x12) = 0;
  param_1[0x1b] = 0;
  param_1[0x1c] = 0;
  param_1[0x1d] = 0;
  *(undefined1 *)(param_1 + 0x1f) = 0;
  *(undefined4 *)((longlong)param_1 + 0xfc) = 0x3f800000;
  FUN_1402ca220(param_1 + 0x20);
  param_1[0x28] = 0;
  param_1[0x29] = 0;
  *(undefined4 *)(param_1 + 0x2a) = 0;
  *(undefined8 *)((longlong)param_1 + 0x154) = 0xb;
  *(undefined4 *)((longlong)param_1 + 0x15c) = 0;
  puVar1 = operator_new(0x140);
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = 0xffffffffffffffff;
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    puVar1[4] = 0;
    *(undefined1 *)(puVar1 + 5) = 0;
    puVar1[6] = 0;
    puVar1[7] = 0;
    puVar1[8] = 0x3f800000;
    puVar1[9] = 0;
    *(undefined1 *)(puVar1 + 10) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x54) = 1;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    puVar1[0xe] = 0;
    puVar1[0x10] = 0;
    puVar1[0x11] = 0;
    puVar1[0x12] = 0;
    puVar1[0x14] = 0;
    puVar1[0x15] = 0;
    puVar1[0x16] = 0;
    puVar1[0x18] = 0;
    puVar1[0x1d] = 0;
    puVar1[0x22] = 0;
    *puVar1 = param_1;
    puVar2 = puVar1;
  }
  FUN_1402c6210(param_1 + 4,puVar2,param_3,param_4,uVar3);
  return param_1;
}



void FUN_1402c4db0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_1402c4ed0();
  if (*(longlong *)(param_1 + 0x100) != 0) {
    FUN_1402c6290();
  }
  if (*(longlong *)(param_1 + 0xd8) != 0) {
    FUN_1402ce6b0(*(longlong *)(param_1 + 0xd8),*(undefined8 *)(param_1 + 0xe0),param_3,param_4,
                  uVar4);
    operator_delete(*(void **)(param_1 + 0xd8));
  }
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x80)) {
    operator_delete(*(void **)(param_1 + 0x68));
  }
  *(undefined8 *)(param_1 + 0x80) = 7;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined2 *)(param_1 + 0x68) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x58)) {
    operator_delete(*(void **)(param_1 + 0x40));
  }
  *(undefined8 *)(param_1 + 0x58) = 7;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined2 *)(param_1 + 0x40) = 0;
  plVar3 = *(longlong **)(param_1 + 0x28);
  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);
      }
    }
  }
  plVar3 = *(longlong **)(param_1 + 0x18);
  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_1402c4ed0(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  param_1[2] = 0;
  plVar3 = (longlong *)param_1[3];
  param_1[3] = 0;
  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);
      }
    }
  }
  FUN_1402ca750(DAT_1406081e0,*param_1);
  FUN_1402cd7e0(DAT_140608260,param_1[1]);
  *param_1 = 0;
  param_1[1] = 0;
  param_1[4] = 0;
  plVar3 = (longlong *)param_1[5];
  param_1[5] = 0;
  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);
      }
    }
  }
  FUN_1402c5150(param_1);
  return;
}



longlong * FUN_1402c4f90(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  void *pvVar5;
  void *local_50;
  longlong *local_48;
  void *local_40;
  longlong *local_38;
  
  FUN_1402cacb0(DAT_1406081e0,&local_40,param_3,param_2,0xfffffffffffffffe);
  if (local_40 == (void *)0x0) {
    lVar4 = FUN_1402cd980(DAT_140608260,param_2);
    if (lVar4 != 0) {
      local_50 = operator_new(0x160);
      if (local_50 == (void *)0x0) {
        pvVar5 = (void *)0x0;
      }
      else {
        pvVar5 = (void *)FUN_1402c4c30(local_50);
      }
      local_50 = pvVar5;
      FUN_1402c63f0(&local_48,pvVar5);
      FUN_140178e90(&local_50,pvVar5,pvVar5);
      plVar3 = local_38;
      pvVar5 = local_50;
      local_50 = local_40;
      local_40 = pvVar5;
      local_38 = local_48;
      local_48 = plVar3;
      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);
          }
        }
      }
      FUN_1402ca850(DAT_1406081e0,local_40);
      FUN_1402c5ab0(local_40,lVar4);
      FUN_1402c5c00(local_40,0,0,1);
      *(int *)((longlong)local_40 + 0x154) = (int)param_3;
      *(undefined8 *)((longlong)local_40 + 0x158) = 0;
    }
    *param_1 = (longlong)local_40;
    param_1[1] = (longlong)local_38;
    if (local_38 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_38 + 1) = (int)local_38[1] + 1;
      UNLOCK();
    }
  }
  else {
    *param_1 = (longlong)local_40;
    param_1[1] = (longlong)local_38;
    if (local_38 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_38 + 1) = (int)local_38[1] + 1;
      UNLOCK();
    }
  }
  plVar3 = local_38;
  if (local_38 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_38 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_38 + 8))(local_38);
      LOCK();
      piVar2 = (int *)((longlong)plVar3 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar3 + 0x10))(plVar3);
      }
    }
  }
  return param_1;
}



void FUN_1402c5150(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong *plVar7;
  
  plVar3 = *(longlong **)(param_1 + 0xe0);
  for (plVar6 = *(longlong **)(param_1 + 0xd8); plVar6 != plVar3; plVar6 = plVar6 + 2) {
    if (*(void **)(*plVar6 + 0xc0) != (void *)0x0) {
      operator_delete__(*(void **)(*plVar6 + 0xc0));
    }
    *(undefined8 *)(*plVar6 + 0xc0) = 0;
    if (*(void **)(*plVar6 + 200) != (void *)0x0) {
      operator_delete__(*(void **)(*plVar6 + 200));
    }
    *(undefined8 *)(*plVar6 + 200) = 0;
  }
  lVar4 = *(longlong *)(param_1 + 0xe0);
  if (*(longlong *)(param_1 + 0xd8) != lVar4) {
    plVar6 = (longlong *)FUN_140333a10(lVar4,lVar4);
    plVar3 = *(longlong **)(param_1 + 0xe0);
    if (plVar6 != plVar3) {
      plVar7 = plVar6 + 1;
      do {
        plVar5 = (longlong *)*plVar7;
        if (plVar5 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar5 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar5 + 8))(plVar5);
            LOCK();
            piVar2 = (int *)((longlong)plVar5 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar5 + 0x10))(plVar5);
            }
          }
        }
        plVar5 = plVar7 + 1;
        plVar7 = plVar7 + 2;
      } while (plVar5 != plVar3);
    }
    *(longlong **)(param_1 + 0xe0) = plVar6;
  }
  *(undefined1 *)(param_1 + 0xf8) = 1;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402c5260(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  ulonglong *puVar6;
  ulonglong *puVar7;
  undefined8 *puVar8;
  undefined1 auVar9 [16];
  undefined1 auVar10 [16];
  longlong *plVar11;
  undefined8 uVar12;
  void *pvVar13;
  ulonglong uVar14;
  __uint64 _Var15;
  float *pfVar16;
  undefined4 *puVar17;
  longlong lVar18;
  int iVar19;
  undefined8 *puVar20;
  uint uVar21;
  ulonglong uVar22;
  ulonglong uVar23;
  ulonglong uVar24;
  float fVar25;
  float fVar26;
  float fVar27;
  float fVar28;
  float fVar29;
  float fVar30;
  undefined1 auStack_138 [32];
  ulonglong local_118;
  longlong *local_110;
  float local_108;
  float local_104;
  float local_100;
  float local_f8;
  float local_f4;
  float local_f0;
  longlong local_e8;
  longlong *local_e0;
  undefined8 local_d8;
  undefined8 local_c8;
  undefined8 uStack_c0;
  undefined8 local_b8;
  undefined8 uStack_b0;
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined4 uStack_a0;
  undefined4 uStack_9c;
  undefined4 local_98;
  undefined4 uStack_94;
  undefined4 uStack_90;
  undefined4 uStack_8c;
  ulonglong local_88;
  
  local_d8 = 0xfffffffffffffffe;
  local_88 = DAT_1405d84f0 ^ (ulonglong)auStack_138;
  lVar18 = *(longlong *)(param_1 + 0xe0);
  if (*(longlong *)(param_1 + 0xd8) != lVar18) {
    uVar12 = FUN_140333a10(lVar18,lVar18);
    FUN_1402ce6b0(uVar12,*(undefined8 *)(param_1 + 0xe0));
    *(undefined8 *)(param_1 + 0xe0) = uVar12;
  }
  uVar24 = 0;
  uVar23 = uVar24;
  if (0 < (int)(*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x10) -
                *(longlong *)(*(longlong *)(param_1 + 0x10) + 8) >> 4)) {
    do {
      pvVar13 = operator_new(0x1b8);
      uVar14 = uVar24;
      if (pvVar13 != (void *)0x0) {
        uVar14 = FUN_1402bc4d0(pvVar13);
      }
      local_118 = uVar14;
      FUN_1402bc460(&local_110,uVar14);
      FUN_140178e90(&local_118,uVar14,uVar14);
      FUN_1402c3300(*(undefined8 *)(param_1 + 0x10),&local_e8,uVar23);
      FUN_1400015e0(local_118,local_e8,0,0xffffffffffffffff);
      *(undefined4 *)(local_118 + 0xb4) = *(undefined4 *)(local_e8 + 0xb4);
      *(undefined4 *)(local_118 + 0xb8) = *(undefined4 *)(local_e8 + 0xb8);
      auVar9._8_8_ = 0;
      auVar9._0_8_ = (longlong)*(int *)(local_118 + 0xb4);
      _Var15 = SUB168(ZEXT816(0xc) * auVar9,0);
      if (SUB168(ZEXT816(0xc) * auVar9,8) != 0) {
        _Var15 = 0xffffffffffffffff;
      }
      pvVar13 = operator_new(_Var15);
      *(void **)(local_118 + 0xc0) = pvVar13;
      iVar19 = *(int *)(local_e8 + 0xb8);
      auVar10._8_8_ = 0;
      auVar10._0_8_ = (longlong)iVar19;
      _Var15 = SUB168(ZEXT816(6) * auVar10,0);
      if (SUB168(ZEXT816(6) * auVar10,8) != 0) {
        _Var15 = 0xffffffffffffffff;
      }
      pvVar13 = operator_new(_Var15);
      if (pvVar13 == (void *)0x0) {
        pvVar13 = (void *)0x0;
      }
      else {
        iVar19 = iVar19 + -1;
        if (-1 < iVar19) {
          puVar17 = (undefined4 *)((longlong)pvVar13 + 2);
          do {
            *puVar17 = 0;
            *(undefined2 *)((longlong)puVar17 + -2) = 0;
            puVar17 = (undefined4 *)((longlong)puVar17 + 6);
            iVar19 = iVar19 + -1;
          } while (-1 < iVar19);
        }
      }
      *(void **)(local_118 + 200) = pvVar13;
      uVar14 = uVar24;
      uVar22 = uVar24;
      if (0 < *(int *)(local_e8 + 0xb4)) {
        do {
          puVar17 = (undefined4 *)
                    FUN_14024fab0(*(longlong *)(local_e8 + 0xc0) + (longlong)(int)uVar22 * 0xc,
                                  param_1 + 0x94);
          lVar18 = *(longlong *)(local_118 + 0xc0);
          *(undefined4 *)(lVar18 + uVar14) = *puVar17;
          *(undefined4 *)(lVar18 + 4 + uVar14) = puVar17[1];
          *(undefined4 *)(lVar18 + 8 + uVar14) = puVar17[2];
          uVar21 = (int)uVar22 + 1;
          uVar14 = uVar14 + 0xc;
          uVar22 = (ulonglong)uVar21;
        } while ((int)uVar21 < *(int *)(local_e8 + 0xb4));
      }
      memcpy(*(void **)(local_118 + 200),*(void **)(local_e8 + 200),
             (longlong)*(int *)(local_e8 + 0xb8) * 6);
      memcpy((void *)(local_118 + 0x50),(void *)(local_e8 + 0x50),100);
      FUN_1402bd690(local_118 + 0x50,param_1 + 0x94);
      fVar25 = 1e+06;
      local_f8 = 1e+06;
      fVar27 = 1e+06;
      local_f4 = 1e+06;
      fVar29 = 1e+06;
      local_f0 = 1e+06;
      fVar30 = -1e+06;
      local_108 = -1e+06;
      fVar28 = -1e+06;
      local_104 = -1e+06;
      fVar26 = -1e+06;
      local_100 = -1e+06;
      lVar18 = (longlong)*(int *)(local_118 + 0xb4);
      if (0 < lVar18) {
        pfVar16 = (float *)(*(longlong *)(local_118 + 0xc0) + 8);
        do {
          fVar3 = pfVar16[-2];
          if (fVar3 < fVar25) {
            fVar25 = fVar3;
          }
          fVar4 = pfVar16[-1];
          if (fVar4 < fVar27) {
            fVar27 = fVar4;
          }
          fVar5 = *pfVar16;
          if (fVar5 < fVar29) {
            fVar29 = fVar5;
          }
          if (fVar30 < fVar3) {
            fVar30 = fVar3;
          }
          if (fVar28 < fVar4) {
            fVar28 = fVar4;
          }
          if (fVar26 < fVar5) {
            fVar26 = fVar5;
          }
          pfVar16 = pfVar16 + 3;
          lVar18 = lVar18 + -1;
          local_108 = fVar30;
          local_104 = fVar28;
          local_100 = fVar26;
          local_f8 = fVar25;
          local_f4 = fVar27;
          local_f0 = fVar29;
        } while (lVar18 != 0);
      }
      *(float *)(local_118 + 0x38) = local_f8;
      *(float *)(local_118 + 0x3c) = local_f4;
      *(float *)(local_118 + 0x40) = local_f0;
      *(float *)(local_118 + 0x44) = local_108;
      *(float *)(local_118 + 0x48) = local_104;
      *(float *)(local_118 + 0x4c) = local_100;
      *(float *)(local_118 + 0xd0) = local_f8;
      *(float *)(local_118 + 0xd4) = local_f4;
      *(float *)(local_118 + 0xd8) = local_f0;
      *(float *)(local_118 + 0xdc) = local_108;
      *(float *)(local_118 + 0xe0) = local_f4;
      *(float *)(local_118 + 0xe4) = local_f0;
      *(float *)(local_118 + 0xe8) = local_f8;
      *(float *)(local_118 + 0xec) = local_f4;
      *(float *)(local_118 + 0xf0) = local_100;
      *(float *)(local_118 + 0xf4) = local_108;
      *(float *)(local_118 + 0xf8) = local_f4;
      *(float *)(local_118 + 0xfc) = local_100;
      *(float *)(local_118 + 0x100) = local_f8;
      *(float *)(local_118 + 0x104) = local_104;
      *(float *)(local_118 + 0x108) = local_f0;
      *(float *)(local_118 + 0x10c) = local_108;
      *(float *)(local_118 + 0x110) = local_104;
      *(float *)(local_118 + 0x114) = local_f0;
      *(float *)(local_118 + 0x118) = local_f8;
      *(float *)(local_118 + 0x11c) = local_104;
      *(float *)(local_118 + 0x120) = local_100;
      *(float *)(local_118 + 0x124) = local_108;
      *(float *)(local_118 + 0x128) = local_104;
      *(float *)(local_118 + 300) = local_100;
      *(undefined4 *)(local_118 + 0x130) = 0x30000;
      *(undefined4 *)(local_118 + 0x134) = 0x30002;
      *(undefined4 *)(local_118 + 0x138) = 0x10000;
      *(undefined4 *)(local_118 + 0x13c) = 0x70004;
      *(undefined4 *)(local_118 + 0x140) = 0x70005;
      *(undefined4 *)(local_118 + 0x144) = 0x60004;
      *(undefined4 *)(local_118 + 0x148) = 0x50000;
      *(undefined4 *)(local_118 + 0x14c) = 0x50001;
      *(undefined4 *)(local_118 + 0x150) = 0x40000;
      *(undefined4 *)(local_118 + 0x154) = 0x70001;
      *(undefined4 *)(local_118 + 0x158) = 0x70003;
      *(undefined4 *)(local_118 + 0x15c) = 0x50001;
      *(undefined4 *)(local_118 + 0x160) = 0x60003;
      *(undefined4 *)(local_118 + 0x164) = 0x60002;
      *(undefined4 *)(local_118 + 0x168) = 0x70003;
      *(undefined4 *)(local_118 + 0x16c) = 0x40002;
      *(undefined4 *)(local_118 + 0x170) = 0x40000;
      *(undefined4 *)(local_118 + 0x174) = 0x60002;
      puVar17 = (undefined4 *)FUN_14024fab0(local_e8 + 0x28,param_1 + 0x94);
      *(undefined4 *)(local_118 + 0x28) = *puVar17;
      *(undefined4 *)(local_118 + 0x2c) = puVar17[1];
      *(undefined4 *)(local_118 + 0x30) = puVar17[2];
      *(undefined4 *)(local_118 + 0x34) = *(undefined4 *)(local_e8 + 0x34);
      D3DXMatrixMultiply(&local_c8,local_e8 + 0x178,param_1 + 0x94);
      *(undefined8 *)(local_118 + 0x178) = local_c8;
      *(undefined8 *)(local_118 + 0x180) = uStack_c0;
      *(undefined8 *)(local_118 + 0x188) = local_b8;
      *(undefined8 *)(local_118 + 400) = uStack_b0;
      *(undefined4 *)(local_118 + 0x198) = local_a8;
      *(undefined4 *)(local_118 + 0x19c) = uStack_a4;
      *(undefined4 *)(local_118 + 0x1a0) = uStack_a0;
      *(undefined4 *)(local_118 + 0x1a4) = uStack_9c;
      *(undefined4 *)(local_118 + 0x1a8) = local_98;
      *(undefined4 *)(local_118 + 0x1ac) = uStack_94;
      *(undefined4 *)(local_118 + 0x1b0) = uStack_90;
      *(undefined4 *)(local_118 + 0x1b4) = uStack_8c;
      puVar6 = *(ulonglong **)(param_1 + 0xe0);
      if ((&local_118 < puVar6) && (puVar7 = *(ulonglong **)(param_1 + 0xd8), puVar7 <= &local_118))
      {
        if (puVar6 == *(ulonglong **)(param_1 + 0xe8)) {
          FUN_1402d8da0(param_1 + 0xd8);
        }
        puVar20 = (undefined8 *)
                  (((longlong)&local_118 - (longlong)puVar7 & 0xfffffffffffffff0U) +
                  *(longlong *)(param_1 + 0xd8));
        puVar8 = *(undefined8 **)(param_1 + 0xe0);
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = *puVar20;
          lVar18 = puVar20[1];
          puVar8[1] = lVar18;
          if (lVar18 != 0) {
            LOCK();
            *(int *)(lVar18 + 8) = *(int *)(lVar18 + 8) + 1;
            UNLOCK();
          }
        }
      }
      else {
        if (puVar6 == *(ulonglong **)(param_1 + 0xe8)) {
          FUN_1402d8da0(param_1 + 0xd8);
        }
        puVar6 = *(ulonglong **)(param_1 + 0xe0);
        if (puVar6 != (ulonglong *)0x0) {
          *puVar6 = local_118;
          puVar6[1] = (ulonglong)local_110;
          if (local_110 != (longlong *)0x0) {
            LOCK();
            *(int *)(local_110 + 1) = (int)local_110[1] + 1;
            UNLOCK();
          }
        }
      }
      plVar11 = local_e0;
      *(longlong *)(param_1 + 0xe0) = *(longlong *)(param_1 + 0xe0) + 0x10;
      if (local_e0 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_e0 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_e0 + 8))(local_e0);
          LOCK();
          piVar2 = (int *)((longlong)plVar11 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar11 + 0x10))(plVar11);
          }
        }
      }
      plVar11 = local_110;
      if (local_110 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_110 + 1;
        lVar18 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar18 == 1) {
          (**(code **)(*local_110 + 8))(local_110);
          LOCK();
          piVar2 = (int *)((longlong)plVar11 + 0xc);
          iVar19 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (iVar19 == 1) {
            (**(code **)(*plVar11 + 0x10))(plVar11);
          }
        }
      }
      uVar21 = (int)uVar23 + 1;
      uVar23 = (ulonglong)uVar21;
    } while ((int)uVar21 <
             (int)(*(longlong *)(*(longlong *)(param_1 + 0x10) + 0x10) -
                   *(longlong *)(*(longlong *)(param_1 + 0x10) + 8) >> 4));
  }
  return;
}



void FUN_1402c5990(longlong param_1,void *param_2)

{
  int iVar1;
  longlong lVar2;
  
  memcpy((void *)(param_1 + 0x94),param_2,0x40);
  if (*(longlong *)(param_1 + 0x10) == 0) {
    return;
  }
  if ((*(char *)(param_1 + 0xf8) == '\0') &&
     (*(longlong *)(param_1 + 0xd8) == *(longlong *)(param_1 + 0xe0))) {
    FUN_1402c5260(param_1);
  }
  if (((*(longlong *)(param_1 + 0x10) != 0) && (*(int *)(param_1 + 0x30) != 0)) &&
     (lVar2 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0xd8), lVar2 != 0)) {
    iVar1 = *(int *)(param_1 + 0x30) + -1;
    if ((iVar1 < 0) ||
       ((int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4) <= iVar1)) {
      lVar2 = 0;
    }
    else {
      lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar1 * 0x10);
    }
    if ((lVar2 != 0) && (lVar2 = *(longlong *)(lVar2 + 0x240), lVar2 != 0)) {
      param_2 = (void *)(param_1 + 0x94);
      *(undefined4 *)(param_1 + 0x144) = *(undefined4 *)(lVar2 + 0x2c);
      *(undefined4 *)(param_1 + 0x148) = *(undefined4 *)(lVar2 + 0x30);
      *(undefined4 *)(param_1 + 0x14c) = *(undefined4 *)(lVar2 + 0x34);
      *(undefined4 *)(param_1 + 0x150) = *(undefined4 *)(lVar2 + 0x38);
      goto LAB_1402c5a94;
    }
  }
  *(undefined4 *)(param_1 + 0x144) = 0;
  *(undefined4 *)(param_1 + 0x148) = 0;
  *(undefined4 *)(param_1 + 0x14c) = 0;
LAB_1402c5a94:
  FUN_1402bb980(param_1 + 0x144,param_2);
  return;
}



void FUN_1402c5ab0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  undefined1 local_20 [8];
  longlong *local_18;
  
  *(undefined8 *)(param_1 + 8) = param_2;
  uVar3 = FUN_1402cdaa0(DAT_140608260,local_20,param_2,param_4,0xfffffffffffffffe);
  FUN_140343ec0(param_1 + 0x10,uVar3);
  if (local_18 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_18 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_18 + 8))(local_18);
      LOCK();
      piVar2 = (int *)((longlong)local_18 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_18 + 0x10))(local_18);
      }
    }
  }
  return;
}



undefined8
FUN_1402c5b20(longlong param_1,short *param_2,undefined4 param_3,undefined1 param_4,char param_5)

{
  short sVar1;
  int iVar2;
  longlong lVar3;
  ulonglong uVar4;
  short *psVar5;
  
  lVar3 = -1;
  psVar5 = param_2;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
  } while (sVar1 != 0);
  if (lVar3 == -2) {
    return 0;
  }
  if (param_5 == '\0') {
    uVar4 = 0xffffffffffffffff;
    psVar5 = param_2;
    do {
      if (uVar4 == 0) break;
      uVar4 = uVar4 - 1;
      sVar1 = *psVar5;
      psVar5 = psVar5 + 1;
    } while (sVar1 != 0);
    iVar2 = FUN_140123e30(param_1 + 0x40,*(undefined8 *)(param_1 + 0x50),param_2,~uVar4 - 1);
    if (iVar2 == 0) {
      return 0;
    }
  }
  uVar4 = 0xffffffffffffffff;
  psVar5 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x40,param_2,~uVar4 - 1);
  if (*(longlong *)(param_1 + 0x10) == 0) {
    return 0;
  }
  lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0xd8);
  if (lVar3 == 0) {
    iVar2 = 0;
  }
  else {
    iVar2 = FUN_1402ce620(lVar3,param_2);
    iVar2 = iVar2 + 1;
  }
  FUN_1402c5c00(param_1,iVar2,param_3,param_4);
  return 1;
}



void FUN_1402c5c00(longlong param_1,int param_2,undefined4 param_3,undefined1 param_4)

{
  float *pfVar1;
  int iVar2;
  longlong lVar3;
  float local_res8 [2];
  float local_res10 [2];
  
  if (*(int *)(param_1 + 0x30) != param_2) {
    FUN_140001710(param_1 + 0x68,&DAT_140477960,0);
  }
  *(int *)(param_1 + 0x30) = param_2;
  FUN_1402cbc20(*(undefined8 *)(param_1 + 0x20),param_2,param_3,param_4);
  if (((*(longlong *)(param_1 + 0x10) != 0) && (*(int *)(param_1 + 0x30) != 0)) &&
     (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0xd8), lVar3 != 0)) {
    iVar2 = *(int *)(param_1 + 0x30) + -1;
    if ((iVar2 < 0) ||
       ((int)(*(longlong *)(lVar3 + 0x30) - *(longlong *)(lVar3 + 0x28) >> 4) <= iVar2)) {
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x28) + (longlong)iVar2 * 0x10);
    }
    if (lVar3 != 0) {
      if (1e-06 <= *(float *)(param_1 + 0x90)) {
        if (1e-06 <= *(float *)(lVar3 + 0x1e4)) {
          local_res8[0] = *(float *)(param_1 + 0x90) / *(float *)(lVar3 + 0x1e4);
        }
        else {
          local_res8[0] = 1.0;
        }
      }
      else {
        local_res8[0] = 1.0;
      }
      pfVar1 = local_res10;
      local_res10[0] = 1e-08;
      if (1e-08 <= local_res8[0]) {
        pfVar1 = local_res8;
      }
      *(float *)(*(longlong *)(param_1 + 0x20) + 0x40) = *pfVar1;
    }
  }
  return;
}



undefined8 FUN_1402c5d10(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  
  if ((((*(longlong *)(param_1 + 0x10) != 0) && (*(int *)(param_1 + 0x30) != 0)) &&
      (lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0xd8), lVar1 != 0)) &&
     ((iVar2 = *(int *)(param_1 + 0x30) + -1, -1 < iVar2 &&
      (iVar2 < (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4))))) {
    return *(undefined8 *)(*(longlong *)(lVar1 + 0x28) + (longlong)iVar2 * 0x10);
  }
  return 0;
}



void FUN_1402c5d60(longlong param_1,short *param_2)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  
  uVar2 = 0xffffffffffffffff;
  psVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x68,param_2,~uVar2 - 1);
  return;
}



void FUN_1402c5d90(longlong param_1,float param_2)

{
  float *pfVar1;
  int iVar2;
  longlong lVar3;
  float local_res8 [2];
  float local_res10 [6];
  
  *(float *)(param_1 + 0x90) = param_2;
  if (((*(longlong *)(param_1 + 0x10) != 0) && (*(int *)(param_1 + 0x30) != 0)) &&
     (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0xd8), lVar3 != 0)) {
    iVar2 = *(int *)(param_1 + 0x30) + -1;
    if ((iVar2 < 0) ||
       ((int)(*(longlong *)(lVar3 + 0x30) - *(longlong *)(lVar3 + 0x28) >> 4) <= iVar2)) {
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x28) + (longlong)iVar2 * 0x10);
    }
    if (lVar3 != 0) {
      if (1e-06 <= param_2) {
        if (1e-06 <= *(float *)(lVar3 + 0x1e4)) {
          local_res8[0] = param_2 / *(float *)(lVar3 + 0x1e4);
        }
        else {
          local_res8[0] = 1.0;
        }
      }
      else {
        local_res8[0] = 1.0;
      }
      pfVar1 = local_res10;
      local_res10[0] = 1e-08;
      if (1e-08 <= local_res8[0]) {
        pfVar1 = local_res8;
      }
      *(float *)(*(longlong *)(param_1 + 0x20) + 0x40) = *pfVar1;
    }
  }
  return;
}



void FUN_1402c5e50(longlong param_1,float param_2)

{
  float *pfVar1;
  int iVar2;
  longlong lVar3;
  float local_res8 [4];
  float local_res18 [4];
  
  if (((*(longlong *)(param_1 + 0x10) != 0) && (*(int *)(param_1 + 0x30) != 0)) &&
     (lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0xd8), lVar3 != 0)) {
    iVar2 = *(int *)(param_1 + 0x30) + -1;
    if ((iVar2 < 0) ||
       ((int)(*(longlong *)(lVar3 + 0x30) - *(longlong *)(lVar3 + 0x28) >> 4) <= iVar2)) {
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x28) + (longlong)iVar2 * 0x10);
    }
    if (lVar3 != 0) {
      local_res18[0] = param_2;
      pfVar1 = local_res8;
      *(float *)(param_1 + 0x90) = param_2 * *(float *)(lVar3 + 0x1e4);
      local_res8[0] = 1e-08;
      if (1e-08 <= param_2) {
        pfVar1 = local_res18;
      }
      *(float *)(*(longlong *)(param_1 + 0x20) + 0x40) = *pfVar1;
    }
  }
  return;
}



float FUN_1402c5ee0(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  
  plVar2 = *(longlong **)(param_1 + 0x20);
  if (((((int)plVar2[1] != 0) &&
       (lVar3 = *(longlong *)(*(longlong *)(*plVar2 + 0x10) + 0xd8), lVar3 != 0)) &&
      (iVar1 = (int)plVar2[1] + -1, -1 < iVar1)) &&
     ((iVar1 < (int)(*(longlong *)(lVar3 + 0x30) - *(longlong *)(lVar3 + 0x28) >> 4) &&
      (lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x28) + (longlong)iVar1 * 0x10), lVar3 != 0)))) {
    return *(float *)(lVar3 + 0x1e4) * *(float *)(plVar2 + 8);
  }
  return 0.0;
}



void FUN_1402c5f40(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x20);
  if (*(int *)(lVar1 + 0x54) == 1) {
    *(undefined8 *)(lVar1 + 0x10) = param_2;
    FUN_1402cc2c0(lVar1);
  }
  *(undefined4 *)(lVar1 + 0x54) = 0;
  return;
}



void FUN_1402c5f70(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong local_30;
  undefined1 local_28 [32];
  
  local_30 = 0;
  FUN_1402cc9c0(*(longlong *)(param_1 + 0x20) + 0xc0,&local_30,param_3,param_4,0xfffffffffffffffe);
  if (((local_30 != 0) && ((local_30 & 1) == 0)) &&
     (*(code **)(local_30 & 0xfffffffffffffffe) != (code *)0x0)) {
    (**(code **)(local_30 & 0xfffffffffffffffe))(local_28,local_28,2);
  }
  local_30 = 0;
  FUN_1402cc9c0(*(longlong *)(param_1 + 0x20) + 0xe8,&local_30);
  if (((local_30 != 0) && ((local_30 & 1) == 0)) &&
     (*(code **)(local_30 & 0xfffffffffffffffe) != (code *)0x0)) {
    (**(code **)(local_30 & 0xfffffffffffffffe))(local_28,local_28,2);
  }
  local_30 = 0;
  FUN_1402cc9c0(*(longlong *)(param_1 + 0x20) + 0x110,&local_30);
  if (((local_30 != 0) && ((local_30 & 1) == 0)) &&
     (*(code **)(local_30 & 0xfffffffffffffffe) != (code *)0x0)) {
    (**(code **)(local_30 & 0xfffffffffffffffe))(local_28,local_28,2);
  }
  return;
}



void FUN_1402c6090(longlong param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  code *pcVar2;
  ulonglong *puVar3;
  undefined8 uVar4;
  undefined1 local_30 [40];
  
  uVar4 = 0xfffffffffffffffe;
  puVar3 = (ulonglong *)FUN_14023abb0(local_30);
  FUN_1402cc9c0(*(longlong *)(param_1 + 0x20) + 0xc0,puVar3);
  uVar1 = *puVar3;
  if (uVar1 != 0) {
    if ((uVar1 & 1) == 0) {
      pcVar2 = *(code **)(uVar1 & 0xfffffffffffffffe);
      if (pcVar2 != (code *)0x0) {
        (*pcVar2)(puVar3 + 1,puVar3 + 1,2,pcVar2,uVar4);
      }
    }
    *puVar3 = 0;
  }
  uVar1 = *param_2;
  if (uVar1 != 0) {
    if ((uVar1 & 1) == 0) {
      if (*(code **)(uVar1 & 0xfffffffffffffffe) != (code *)0x0) {
        (**(code **)(uVar1 & 0xfffffffffffffffe))(param_2 + 1,param_2 + 1,2);
      }
    }
    *param_2 = 0;
  }
  return;
}



void FUN_1402c6140(longlong param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  code *pcVar2;
  ulonglong *puVar3;
  undefined8 uVar4;
  undefined1 local_30 [40];
  
  uVar4 = 0xfffffffffffffffe;
  puVar3 = (ulonglong *)FUN_14023abb0(local_30);
  FUN_1402cc9c0(*(longlong *)(param_1 + 0x20) + 0xe8,puVar3);
  uVar1 = *puVar3;
  if (uVar1 != 0) {
    if ((uVar1 & 1) == 0) {
      pcVar2 = *(code **)(uVar1 & 0xfffffffffffffffe);
      if (pcVar2 != (code *)0x0) {
        (*pcVar2)(puVar3 + 1,puVar3 + 1,2,pcVar2,uVar4);
      }
    }
    *puVar3 = 0;
  }
  uVar1 = *param_2;
  if (uVar1 != 0) {
    if ((uVar1 & 1) == 0) {
      if (*(code **)(uVar1 & 0xfffffffffffffffe) != (code *)0x0) {
        (**(code **)(uVar1 & 0xfffffffffffffffe))(param_2 + 1,param_2 + 1,2);
      }
    }
    *param_2 = 0;
  }
  return;
}



void FUN_1402c61f0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_1402c6290();
  }
  return;
}



void FUN_1402c6210(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_1402c6380(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



void FUN_1402c6290(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  
  puVar7 = (undefined8 *)*param_1;
  puVar3 = puVar7 + param_1[1];
  for (; puVar7 != puVar3; puVar7 = puVar7 + 1) {
    puVar4 = (undefined8 *)*puVar7;
    *puVar7 = 0;
    while (puVar4 != (undefined8 *)0x0) {
      puVar5 = (undefined8 *)*puVar4;
      plVar6 = (longlong *)puVar4[7];
      if (plVar6 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar6 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*plVar6 + 8))(plVar6);
          LOCK();
          piVar2 = (int *)((longlong)plVar6 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar6 + 0x10))(plVar6);
          }
        }
      }
      if (7 < (ulonglong)puVar4[4]) {
        operator_delete((void *)puVar4[1]);
      }
      puVar4[4] = 7;
      puVar4[3] = 0;
      *(undefined2 *)(puVar4 + 1) = 0;
      operator_delete(puVar4);
      puVar4 = puVar5;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



undefined8 * FUN_1402c6380(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;
}



undefined8 * FUN_1402c63f0(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;
}



void FUN_1402c6460(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_1402cbae0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402c6490(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_1402c4db0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402c6b96)
// WARNING: Removing unreachable block (ram,0x0001402c6999)

void FUN_1402c64c0(longlong param_1)

{
  int *piVar1;
  ulonglong *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  longlong lVar5;
  longlong *plVar6;
  undefined8 uVar7;
  undefined8 *puVar8;
  longlong *plVar9;
  longlong lVar10;
  undefined8 *puVar11;
  undefined8 *puVar12;
  int iVar13;
  undefined8 **ppuVar14;
  ulonglong uVar15;
  int iVar16;
  ulonglong uVar17;
  uint uVar18;
  ulonglong local_f8;
  ulonglong local_e8;
  undefined8 *local_c8;
  undefined8 local_c0;
  undefined8 *local_b8;
  undefined8 local_b0;
  undefined1 local_a8 [8];
  longlong *local_a0;
  longlong *local_90;
  undefined8 local_88;
  longlong *local_78;
  undefined1 local_70 [8];
  longlong *local_68;
  longlong *local_58;
  undefined1 local_50 [8];
  longlong *local_48;
  longlong *local_38;
  
  local_88 = 0xfffffffffffffffe;
  puVar2 = (ulonglong *)(param_1 + 0x468);
  uVar15 = *(ulonglong *)(param_1 + 0x470);
  if (*puVar2 != uVar15) {
    uVar7 = FUN_140333a10(uVar15,uVar15);
    FUN_1402ce6b0(uVar7,*(undefined8 *)(param_1 + 0x470));
    *(undefined8 *)(param_1 + 0x470) = uVar7;
  }
  iVar13 = 0;
  iVar16 = (int)(*(longlong *)(param_1 + 0x380) - *(longlong *)(param_1 + 0x378) >> 4);
  if (0 < iVar16) {
    do {
      puVar8 = (undefined8 *)FUN_1402c3300(param_1 + 0x370,local_a8,iVar13);
      puVar12 = *(undefined8 **)(param_1 + 0x470);
      if ((puVar8 < puVar12) && (puVar11 = (undefined8 *)*puVar2, puVar11 <= puVar8)) {
        if (puVar12 == *(undefined8 **)(param_1 + 0x478)) {
          FUN_1402d8da0(puVar2);
        }
        puVar8 = (undefined8 *)
                 (((longlong)puVar8 - (longlong)puVar11 & 0xfffffffffffffff0U) + *puVar2);
      }
      else if (puVar12 == *(undefined8 **)(param_1 + 0x478)) {
        FUN_1402d8da0(puVar2);
      }
      plVar6 = local_a0;
      puVar12 = *(undefined8 **)(param_1 + 0x470);
      if (puVar12 != (undefined8 *)0x0) {
        *puVar12 = *puVar8;
        lVar10 = puVar8[1];
        puVar12[1] = lVar10;
        if (lVar10 != 0) {
          LOCK();
          *(int *)(lVar10 + 8) = *(int *)(lVar10 + 8) + 1;
          UNLOCK();
        }
      }
      *(longlong *)(param_1 + 0x470) = *(longlong *)(param_1 + 0x470) + 0x10;
      if (local_a0 != (longlong *)0x0) {
        LOCK();
        plVar9 = local_a0 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 == 0) {
          (**(code **)(*local_a0 + 8))(local_a0);
          LOCK();
          piVar1 = (int *)((longlong)plVar6 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*plVar6 + 0x10))(plVar6);
          }
        }
      }
      iVar13 = iVar13 + 1;
    } while (iVar13 < iVar16);
  }
  if (*(longlong *)(param_1 + 0x598) == 0) {
    local_b8 = (undefined8 *)0x0;
    local_b0 = 0;
    ppuVar14 = &local_b8;
  }
  else {
    local_c8 = *(undefined8 **)(param_1 + 0x5a8);
    if (local_c8 == (undefined8 *)0x0) {
      local_c0 = 0;
    }
    else {
      local_c0 = *local_c8;
    }
    ppuVar14 = &local_c8;
  }
  puVar12 = *ppuVar14;
  puVar8 = ppuVar14[1];
  while (puVar8 != (undefined8 *)0x0) {
    plVar9 = (longlong *)FUN_1402533e0(puVar8[6],local_50);
    plVar6 = local_48;
    lVar10 = *plVar9;
    if (local_48 != (longlong *)0x0) {
      LOCK();
      plVar9 = local_48 + 1;
      *(int *)plVar9 = (int)*plVar9 + -1;
      UNLOCK();
      if ((int)*plVar9 == 0) {
        (**(code **)(*local_48 + 8))(local_48);
        LOCK();
        piVar1 = (int *)((longlong)plVar6 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*plVar6 + 0x10))(plVar6);
        }
      }
    }
    if (lVar10 != 0) {
      plVar9 = (longlong *)FUN_1402533e0(puVar8[6],local_70);
      plVar6 = local_68;
      lVar10 = *plVar9;
      if (local_68 != (longlong *)0x0) {
        LOCK();
        plVar9 = local_68 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 == 0) {
          (**(code **)(*local_68 + 8))(local_68);
          LOCK();
          piVar1 = (int *)((longlong)plVar6 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*plVar6 + 0x10))(plVar6);
          }
        }
      }
      uVar17 = 0;
      uVar15 = uVar17;
      if (0 < (int)(*(longlong *)(lVar10 + 0xe0) - *(longlong *)(lVar10 + 0xd8) >> 4)) {
        do {
          puVar11 = (undefined8 *)(uVar17 + *(longlong *)(lVar10 + 0xd8));
          puVar3 = *(undefined8 **)(param_1 + 0x470);
          if ((puVar11 < puVar3) && (puVar4 = (undefined8 *)*puVar2, puVar4 <= puVar11)) {
            if (puVar3 == *(undefined8 **)(param_1 + 0x478)) {
              FUN_1402d8da0(puVar2);
            }
            puVar11 = (undefined8 *)
                      (((longlong)puVar11 - (longlong)puVar4 & 0xfffffffffffffff0U) + *puVar2);
          }
          else if (puVar3 == *(undefined8 **)(param_1 + 0x478)) {
            FUN_1402d8da0(puVar2);
          }
          puVar3 = *(undefined8 **)(param_1 + 0x470);
          if (puVar3 != (undefined8 *)0x0) {
            *puVar3 = *puVar11;
            lVar5 = puVar11[1];
            puVar3[1] = lVar5;
            if (lVar5 != 0) {
              LOCK();
              *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
              UNLOCK();
            }
          }
          *(longlong *)(param_1 + 0x470) = *(longlong *)(param_1 + 0x470) + 0x10;
          uVar18 = (int)uVar15 + 1;
          uVar17 = uVar17 + 0x10;
          uVar15 = (ulonglong)uVar18;
        } while ((int)uVar18 <
                 (int)(*(longlong *)(lVar10 + 0xe0) - *(longlong *)(lVar10 + 0xd8) >> 4));
      }
    }
    puVar8 = (undefined8 *)*puVar8;
    while (puVar8 == (undefined8 *)0x0) {
      puVar12 = puVar12 + 1;
      puVar8 = (undefined8 *)*puVar12;
    }
    if (puVar12 == puVar8) {
      puVar8 = (undefined8 *)0x0;
    }
  }
  uVar15 = 0;
  if ((*(longlong *)(param_1 + 0x5c0) != 0) && (*(uint *)(param_1 + 0x5c8) != 0)) {
    plVar6 = *(longlong **)(param_1 + 0x5b8);
    uVar17 = uVar15;
    plVar9 = plVar6;
    do {
      if (*plVar9 != 0) {
        uVar15 = plVar6[uVar17];
        break;
      }
      uVar18 = (int)uVar17 + 1;
      uVar17 = (ulonglong)uVar18;
      plVar9 = plVar9 + 1;
    } while (uVar18 < *(uint *)(param_1 + 0x5c8));
  }
LAB_1402c67f0:
  local_e8 = uVar15;
  uVar15 = 0;
  if (local_e8 != 0) {
    plVar9 = (longlong *)FUN_14027d480(*(undefined8 *)(local_e8 + 8));
    plVar6 = local_90;
    lVar10 = *plVar9;
    if (local_90 != (longlong *)0x0) {
      LOCK();
      plVar9 = local_90 + 1;
      *(int *)plVar9 = (int)*plVar9 + -1;
      UNLOCK();
      if ((int)*plVar9 == 0) {
        (**(code **)(*local_90 + 8))(local_90);
        LOCK();
        piVar1 = (int *)((longlong)plVar6 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*plVar6 + 0x10))(plVar6);
        }
      }
    }
    if (lVar10 != 0) {
      plVar9 = (longlong *)FUN_14027d480(*(undefined8 *)(local_e8 + 8));
      plVar6 = local_78;
      lVar10 = *plVar9;
      if (local_78 != (longlong *)0x0) {
        LOCK();
        plVar9 = local_78 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 == 0) {
          (**(code **)(*local_78 + 8))(local_78);
          LOCK();
          piVar1 = (int *)((longlong)plVar6 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*plVar6 + 0x10))(plVar6);
          }
        }
      }
      uVar17 = 0;
      uVar15 = uVar17;
      if (0 < (int)(*(longlong *)(lVar10 + 0xe0) - *(longlong *)(lVar10 + 0xd8) >> 4)) {
        do {
          puVar12 = (undefined8 *)(uVar17 + *(longlong *)(lVar10 + 0xd8));
          puVar8 = *(undefined8 **)(param_1 + 0x470);
          if ((puVar12 < puVar8) && (puVar11 = (undefined8 *)*puVar2, puVar11 <= puVar12)) {
            if (puVar8 == *(undefined8 **)(param_1 + 0x478)) {
              FUN_1402d8da0(puVar2);
            }
            puVar12 = (undefined8 *)
                      (((longlong)puVar12 - (longlong)puVar11 & 0xfffffffffffffff0U) + *puVar2);
          }
          else if (puVar8 == *(undefined8 **)(param_1 + 0x478)) {
            FUN_1402d8da0(puVar2);
          }
          puVar8 = *(undefined8 **)(param_1 + 0x470);
          if (puVar8 != (undefined8 *)0x0) {
            *puVar8 = *puVar12;
            lVar5 = puVar12[1];
            puVar8[1] = lVar5;
            if (lVar5 != 0) {
              LOCK();
              *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
              UNLOCK();
            }
          }
          *(longlong *)(param_1 + 0x470) = *(longlong *)(param_1 + 0x470) + 0x10;
          uVar18 = (int)uVar15 + 1;
          uVar17 = uVar17 + 0x10;
          uVar15 = (ulonglong)uVar18;
        } while ((int)uVar18 <
                 (int)(*(longlong *)(lVar10 + 0xe0) - *(longlong *)(lVar10 + 0xd8) >> 4));
      }
    }
    uVar17 = 0;
    uVar15 = *(ulonglong *)(local_e8 + 0x18);
    if (*(ulonglong *)(local_e8 + 0x18) == 0) {
      uVar18 = *(uint *)(local_e8 + 0x20) % *(uint *)(param_1 + 0x5c8) + 1;
      lVar10 = (longlong)(int)uVar18 * 8;
      do {
        uVar15 = uVar17;
        if (*(uint *)(param_1 + 0x5c8) <= uVar18) break;
        lVar5 = *(longlong *)(param_1 + 0x5b8);
        if (*(longlong *)(lVar5 + lVar10) != 0) {
          uVar17 = *(ulonglong *)(lVar5 + lVar10);
        }
        uVar18 = uVar18 + 1;
        lVar10 = lVar10 + 8;
        uVar15 = uVar17;
      } while (uVar17 == 0);
    }
    goto LAB_1402c67f0;
  }
  if ((*(longlong *)(param_1 + 0x650) != 0) && (*(uint *)(param_1 + 0x658) != 0)) {
    plVar6 = *(longlong **)(param_1 + 0x648);
    uVar17 = uVar15;
    plVar9 = plVar6;
    do {
      if (*plVar9 != 0) {
        uVar15 = plVar6[uVar17];
        break;
      }
      uVar18 = (int)uVar17 + 1;
      uVar17 = (ulonglong)uVar18;
      plVar9 = plVar9 + 1;
    } while (uVar18 < *(uint *)(param_1 + 0x658));
  }
  do {
    do {
      local_f8 = uVar15;
      if (local_f8 == 0) {
        return;
      }
      plVar9 = (longlong *)FUN_14027d480(*(undefined8 *)(local_f8 + 8));
      plVar6 = local_58;
      lVar10 = *plVar9;
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar9 = local_58 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)plVar6 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*plVar6 + 0x10))(plVar6);
          }
        }
      }
      if (lVar10 != 0) {
        plVar9 = (longlong *)FUN_14027d480(*(undefined8 *)(local_f8 + 8));
        plVar6 = local_38;
        lVar10 = *plVar9;
        if (local_38 != (longlong *)0x0) {
          LOCK();
          plVar9 = local_38 + 1;
          *(int *)plVar9 = (int)*plVar9 + -1;
          UNLOCK();
          if ((int)*plVar9 == 0) {
            (**(code **)(*local_38 + 8))(local_38);
            LOCK();
            piVar1 = (int *)((longlong)plVar6 + 0xc);
            *piVar1 = *piVar1 + -1;
            UNLOCK();
            if (*piVar1 == 0) {
              (**(code **)(*plVar6 + 0x10))(plVar6);
            }
          }
        }
        uVar17 = 0;
        uVar15 = uVar17;
        if (0 < (int)(*(longlong *)(lVar10 + 0xe0) - *(longlong *)(lVar10 + 0xd8) >> 4)) {
          do {
            puVar12 = (undefined8 *)(uVar17 + *(longlong *)(lVar10 + 0xd8));
            puVar8 = *(undefined8 **)(param_1 + 0x470);
            if ((puVar12 < puVar8) && (puVar11 = (undefined8 *)*puVar2, puVar11 <= puVar12)) {
              if (puVar8 == *(undefined8 **)(param_1 + 0x478)) {
                FUN_1402d8da0(puVar2);
              }
              puVar12 = (undefined8 *)
                        (((longlong)puVar12 - (longlong)puVar11 & 0xfffffffffffffff0U) + *puVar2);
            }
            else if (puVar8 == *(undefined8 **)(param_1 + 0x478)) {
              FUN_1402d8da0(puVar2);
            }
            puVar8 = *(undefined8 **)(param_1 + 0x470);
            if (puVar8 != (undefined8 *)0x0) {
              *puVar8 = *puVar12;
              lVar5 = puVar12[1];
              puVar8[1] = lVar5;
              if (lVar5 != 0) {
                LOCK();
                *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
                UNLOCK();
              }
            }
            *(longlong *)(param_1 + 0x470) = *(longlong *)(param_1 + 0x470) + 0x10;
            uVar18 = (int)uVar15 + 1;
            uVar17 = uVar17 + 0x10;
            uVar15 = (ulonglong)uVar18;
          } while ((int)uVar18 <
                   (int)(*(longlong *)(lVar10 + 0xe0) - *(longlong *)(lVar10 + 0xd8) >> 4));
        }
      }
      uVar17 = 0;
      uVar15 = *(ulonglong *)(local_f8 + 0x18);
    } while (*(ulonglong *)(local_f8 + 0x18) != 0);
    uVar18 = *(uint *)(local_f8 + 0x20) % *(uint *)(param_1 + 0x658) + 1;
    lVar10 = (longlong)(int)uVar18 * 8;
    do {
      uVar15 = uVar17;
      if (*(uint *)(param_1 + 0x658) <= uVar18) break;
      lVar5 = *(longlong *)(param_1 + 0x648);
      if (*(longlong *)(lVar10 + lVar5) != 0) {
        uVar17 = *(ulonglong *)(lVar10 + lVar5);
      }
      uVar18 = uVar18 + 1;
      lVar10 = lVar10 + 8;
      uVar15 = uVar17;
    } while (uVar17 == 0);
  } while( true );
}



void FUN_1402c6bd0(longlong param_1,uint param_2)

{
  longlong *plVar1;
  uint *local_28;
  longlong *plStack_20;
  undefined1 local_18 [16];
  
  plVar1 = (longlong *)(param_1 + 0x648);
  if (*plVar1 != 0) {
    for (local_28 = *(uint **)(*plVar1 +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x658)) * 8);
        local_28 != (uint *)0x0; local_28 = *(uint **)(local_28 + 6)) {
      if ((local_28[8] == param_2) && (*local_28 == param_2)) goto LAB_1402c6c16;
    }
  }
  local_28 = (uint *)0x0;
LAB_1402c6c16:
  if (local_28 != (uint *)0x0) {
    plStack_20 = plVar1;
    FUN_1402cd470(*(undefined8 *)(local_28 + 2));
    FUN_1402c6c60(plVar1,local_18,&local_28);
  }
  return;
}



longlong * FUN_1402c6c60(longlong *param_1,longlong *param_2,longlong *param_3)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  uint uVar7;
  longlong lVar8;
  
  lVar6 = *param_3;
  plVar1 = (longlong *)param_3[1];
  if (lVar6 == 0) {
    lVar8 = 0;
  }
  else {
    lVar8 = *(longlong *)(lVar6 + 0x18);
    if (lVar8 == 0) {
      uVar7 = *(uint *)(lVar6 + 0x20) % *(uint *)(plVar1 + 2) + 1;
      lVar6 = (longlong)(int)uVar7 << 3;
      do {
        if (*(uint *)(plVar1 + 2) <= uVar7) break;
        if (*(longlong *)(*plVar1 + lVar6) != 0) {
          lVar8 = *(longlong *)(*plVar1 + lVar6);
        }
        uVar7 = uVar7 + 1;
        lVar6 = lVar6 + 8;
      } while (lVar8 == 0);
    }
  }
  lVar6 = *param_3;
  if (lVar6 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar2 = *param_1;
  uVar4 = (ulonglong)*(uint *)(lVar6 + 0x20) % (ulonglong)*(uint *)(param_1 + 2);
  if (lVar6 != *(longlong *)(lVar2 + uVar4 * 8)) {
    lVar3 = *(longlong *)(lVar2 + uVar4 * 8);
    for (lVar5 = *(longlong *)(lVar3 + 0x18); lVar5 != lVar6; lVar5 = *(longlong *)(lVar5 + 0x18)) {
      lVar3 = lVar5;
    }
    if (lVar3 != 0) {
      *(undefined8 *)(lVar3 + 0x18) = *(undefined8 *)(lVar6 + 0x18);
      goto LAB_1402c6d23;
    }
  }
  *(undefined8 *)(lVar2 + uVar4 * 8) = *(undefined8 *)(lVar6 + 0x18);
LAB_1402c6d23:
  FUN_1402c6e80(param_1,lVar6);
  *param_2 = lVar8;
  param_2[1] = (longlong)plVar1;
  return param_2;
}



ulonglong FUN_1402c6d50(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_14000d450(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_1402c6e80(longlong param_1,longlong param_2)

{
  int *piVar1;
  longlong *plVar2;
  undefined4 uVar3;
  longlong *plVar4;
  
  if (param_2 != 0) {
    plVar4 = *(longlong **)(param_2 + 0x10);
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar2 = plVar4 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        (**(code **)(*plVar4 + 8))(plVar4);
        LOCK();
        piVar1 = (int *)((longlong)plVar4 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    *(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)) {
      uVar3 = FUN_1402cddb0(param_1);
      FUN_1401dfb50(param_1,uVar3);
    }
    if (*(longlong *)(param_1 + 8) == 0) {
      *(undefined8 *)(param_1 + 0x40) = 0;
      plVar4 = *(longlong **)(param_1 + 0x38);
      if (*(longlong **)(param_1 + 0x38) != (longlong *)0x0) {
        do {
          plVar2 = (longlong *)*plVar4;
          free(plVar4);
          plVar4 = plVar2;
        } while (plVar2 != (longlong *)0x0);
        *(undefined8 *)(param_1 + 0x38) = 0;
      }
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



undefined8 * FUN_1402c6f50(undefined8 *param_1)

{
  *param_1 = M3dSMotion::vftable;
  *(undefined4 *)(param_1 + 1) = 0;
  FUN_1402ca220(param_1 + 2);
  param_1[10] = 0;
  _eh_vector_constructor_iterator_
            (param_1 + 0xb,0x10,10,(_func_void_void_ptr *)&LAB_1402c70a0,FUN_14033a390);
  _eh_vector_constructor_iterator_
            (param_1 + 0x1f,0x10,10,(_func_void_void_ptr *)&LAB_1402c70a0,FUN_14033a390);
  param_1[0x33] = 0;
  param_1[0x34] = 0;
  param_1[0x35] = 0;
  param_1[0x3a] = 7;
  param_1[0x39] = 0;
  *(undefined2 *)(param_1 + 0x37) = 0;
  param_1[0x3c] = 0;
  *(undefined4 *)(param_1 + 0x3d) = 0;
  param_1[0x3e] = 0;
  FUN_1402c8a60(param_1 + 0x3f,0,0);
  FUN_1402ca220(param_1 + 0x40);
  param_1[0x48] = 0;
  FUN_1402c8600(param_1 + 0x49);
  param_1[0x54] = 0;
  return param_1;
}



void * FUN_1402c7070(void *param_1,uint param_2)

{
  FUN_1402c7100();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402c70c0(longlong param_1)

{
  if (*(void **)(param_1 + 0x20) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x20));
  }
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  FUN_1402c8740(param_1 + 8);
                    // WARNING: Could not recover jumptable at 0x0001402c70f8. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_1 + 8));
  return;
}



void FUN_1402c7100(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = M3dSMotion::vftable;
  FUN_1402c7270();
  if ((void *)param_1[0x4d] != (void *)0x0) {
    operator_delete((void *)param_1[0x4d]);
  }
  param_1[0x4d] = 0;
  param_1[0x4e] = 0;
  param_1[0x4f] = 0;
  FUN_1402c8740(param_1 + 0x4a);
  operator_delete((void *)param_1[0x4a]);
  if (param_1[0x40] != 0) {
    FUN_14031ee80();
  }
  plVar3 = (longlong *)param_1[0x3f];
  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);
      }
    }
  }
  if (7 < (ulonglong)param_1[0x3a]) {
    operator_delete((void *)param_1[0x37]);
  }
  param_1[0x3a] = 7;
  param_1[0x39] = 0;
  *(undefined2 *)(param_1 + 0x37) = 0;
  if ((void *)param_1[0x33] != (void *)0x0) {
    operator_delete((void *)param_1[0x33]);
  }
  param_1[0x33] = 0;
  param_1[0x34] = 0;
  param_1[0x35] = 0;
  _eh_vector_destructor_iterator_(param_1 + 0x1f,0x10,10,FUN_14033a390);
  _eh_vector_destructor_iterator_(param_1 + 0xb,0x10,10,FUN_14033a390);
  if (param_1[2] != 0) {
    FUN_140167cd0();
  }
  return;
}



void FUN_1402c7270(longlong param_1)

{
  void *pvVar1;
  undefined8 *puVar2;
  undefined2 *puVar3;
  longlong *plVar4;
  
  pvVar1 = *(void **)(param_1 + 0x2a0);
  if (pvVar1 != (void *)0x0) {
    _eh_vector_destructor_iterator_(pvVar1,0x30,*(int *)((longlong)pvVar1 + -8),FUN_1401407c0);
    operator_delete__((void *)((longlong)pvVar1 + -8));
  }
  plVar4 = *(longlong **)(param_1 + 0x198);
  *(undefined8 *)(param_1 + 0x2a0) = 0;
  if (plVar4 != *(longlong **)(param_1 + 0x1a0)) {
    do {
      puVar2 = (undefined8 *)*plVar4;
      if (puVar2 != (undefined8 *)0x0) {
        (**(code **)*puVar2)(puVar2,1);
      }
      *plVar4 = 0;
      plVar4 = plVar4 + 1;
    } while (plVar4 != *(longlong **)(param_1 + 0x1a0));
  }
  pvVar1 = *(void **)(param_1 + 0x240);
  if (pvVar1 != (void *)0x0) {
    *(undefined8 *)((longlong)pvVar1 + 0x14) = 0;
    if (*(ulonglong *)((longlong)pvVar1 + 0x1c) < 8) {
      puVar3 = (undefined2 *)((longlong)pvVar1 + 4);
    }
    else {
      puVar3 = *(undefined2 **)((longlong)pvVar1 + 4);
    }
    *puVar3 = 0;
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x1c)) {
      operator_delete(*(void **)((longlong)pvVar1 + 4));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x1c) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x14) = 0;
    *(undefined2 *)((longlong)pvVar1 + 4) = 0;
    operator_delete(pvVar1);
  }
  *(undefined8 *)(param_1 + 0x240) = 0;
  return;
}



undefined4 FUN_1402c7360(longlong param_1,short *param_2)

{
  short sVar1;
  longlong lVar2;
  undefined4 uVar3;
  
  lVar2 = -1;
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    sVar1 = *param_2;
    param_2 = param_2 + 1;
  } while (sVar1 != 0);
  if (lVar2 == -2) {
    return *(undefined4 *)(param_1 + 0x1e0);
  }
  uVar3 = *(undefined4 *)(param_1 + 0x1e0);
  lVar2 = FUN_1402c7830(param_1);
  if (lVar2 != 0) {
    uVar3 = *(undefined4 *)(lVar2 + 0x2c);
  }
  return uVar3;
}



int FUN_1402c73d0(longlong param_1,undefined4 param_2,int param_3,longlong param_4)

{
  int iVar1;
  int iVar2;
  float fVar3;
  undefined4 uVar4;
  
  iVar1 = (int)(*(float *)(param_1 + 8) * 30.0);
  iVar2 = 0;
  if ((iVar1 < *(int *)(param_1 + 0x50)) &&
     (iVar1 = *(int *)(*(longlong *)(param_1 + 0x58 + (longlong)param_3 * 0x10) +
                      (longlong)iVar1 * 4), iVar1 != 0)) {
    iVar2 = iVar1;
  }
  *(undefined4 *)(param_1 + 8) = param_2;
  if (param_4 == 0) {
    fVar3 = *(float *)(param_1 + 0x1e0);
  }
  else {
    FUN_1402c7360(param_1,param_4);
    fVar3 = (float)FUN_1402c7360(param_1,param_4);
  }
  if (fVar3 < *(float *)(param_1 + 8)) {
    if (param_4 == 0) {
      *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 0x1e0);
      return -1;
    }
    uVar4 = FUN_1402c7360(param_1,param_4);
    *(undefined4 *)(param_1 + 8) = uVar4;
    return -1;
  }
  return iVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402c74b0(longlong param_1,short *param_2,undefined4 param_3)

{
  short sVar1;
  ushort *puVar2;
  ulonglong uVar3;
  ushort *puVar4;
  ulonglong uVar5;
  short *psVar6;
  undefined1 auStack_1c8 [32];
  undefined8 local_1a8;
  undefined1 local_1a0 [24];
  ushort local_188;
  undefined6 uStack_186;
  longlong local_178;
  ulonglong local_170;
  void *local_158 [2];
  longlong local_148;
  ulonglong local_140;
  undefined2 local_130;
  undefined6 uStack_12e;
  undefined8 local_120;
  ulonglong local_118;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined8 local_e8;
  ulonglong local_e0;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  void *local_b8 [2];
  longlong local_a8;
  ulonglong local_a0;
  undefined2 local_90;
  undefined6 uStack_8e;
  undefined8 local_80;
  ulonglong local_78;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  ulonglong local_58;
  
  local_1a8 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_1c8;
  local_170 = 7;
  uVar5 = 0;
  local_178 = 0;
  local_188 = 0;
  uVar3 = 0xffffffffffffffff;
  psVar6 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_188,param_2,~uVar3 - 1);
  if (*(longlong *)(param_1 + 0x30) != 0) {
    puVar4 = &local_188;
    if (7 < local_170) {
      puVar4 = (ushort *)CONCAT62(uStack_186,local_188);
    }
    puVar2 = &local_188;
    if (7 < local_170) {
      puVar2 = (ushort *)CONCAT62(uStack_186,local_188);
    }
    for (; puVar2 != puVar4 + local_178; puVar2 = puVar2 + 1) {
      uVar5 = uVar5 ^ (uVar5 >> 2) + uVar5 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar2;
    }
    uVar5 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x10) +
                          (uVar5 % *(ulonglong *)(param_1 + 0x18)) * 8,&local_188);
  }
  if (7 < local_170) {
    operator_delete((void *)CONCAT62(uStack_186,local_188));
  }
  if (uVar5 == 0) {
    local_e0 = 7;
    local_e8 = 0;
    local_f8 = 0;
    local_d0 = 0;
    local_cc = 0;
    local_c8 = 0;
    uVar5 = 0xffffffffffffffff;
    psVar6 = param_2;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    FUN_140001710(&local_f8,param_2,~uVar5 - 1);
    local_cc = *(undefined4 *)(param_1 + 0x1e0);
    local_c8 = 0;
    local_140 = 7;
    local_148 = 0;
    local_158[0] = (void *)((ulonglong)local_158[0] & 0xffffffffffff0000);
    uVar5 = 0xffffffffffffffff;
    psVar6 = param_2;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    local_d0 = param_3;
    FUN_140001710(local_158,param_2,~uVar5 - 1);
    local_118 = 7;
    local_120 = 0;
    local_130 = 0;
    FUN_1400015e0(&local_130,&local_f8,0,0xffffffffffffffff);
    local_108 = local_d0;
    local_104 = local_cc;
    local_100 = local_c8;
    local_a0 = 7;
    local_a8 = 0;
    local_b8[0] = (void *)((ulonglong)local_b8[0] & 0xffffffffffff0000);
    if (local_140 < 8) {
      memmove(local_b8,local_158,local_148 * 2 + 2);
      local_a0 = local_140;
    }
    else {
      local_b8[0] = local_158[0];
      local_158[0] = (void *)0x0;
      local_a0 = local_140;
    }
    local_a8 = local_148;
    local_148 = 0;
    local_140 = 0;
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    FUN_1400015e0(&local_90,&local_130,0,0xffffffffffffffff);
    local_68 = local_108;
    local_64 = local_104;
    local_60 = local_100;
    if (*(longlong *)(param_1 + 0x30) == 0) {
      FUN_1402c8dc0(param_1 + 0x10,&local_188,local_b8);
    }
    else {
      FUN_1402c8ca0(param_1 + 0x10,local_1a0,local_b8,local_b8);
    }
    if (7 < local_78) {
      operator_delete((void *)CONCAT62(uStack_8e,local_90));
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    if (7 < local_a0) {
      operator_delete(local_b8[0]);
    }
    local_a0 = 7;
    local_a8 = 0;
    local_b8[0] = (void *)((ulonglong)local_b8[0] & 0xffffffffffff0000);
    if (7 < local_118) {
      operator_delete((void *)CONCAT62(uStack_12e,local_130));
    }
    local_118 = 7;
    local_120 = 0;
    local_130 = 0;
    if (7 < local_140) {
      operator_delete(local_158[0]);
    }
    if (7 < local_e0) {
      operator_delete((void *)CONCAT62(uStack_f6,local_f8));
    }
  }
  else {
    *(undefined4 *)(uVar5 + 0x58) = param_3;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_1402c7830(longlong param_1,short *param_2)

{
  short sVar1;
  ushort *puVar2;
  longlong lVar3;
  ulonglong uVar4;
  ushort *puVar5;
  ulonglong uVar6;
  short *psVar7;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  ushort local_40;
  undefined6 uStack_3e;
  longlong local_30;
  ulonglong local_28;
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  local_28 = 7;
  uVar6 = 0;
  local_30 = 0;
  local_40 = 0;
  uVar4 = 0xffffffffffffffff;
  psVar7 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar7;
    psVar7 = psVar7 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_40,param_2,~uVar4 - 1);
  if (*(longlong *)(param_1 + 0x30) != 0) {
    puVar5 = &local_40;
    if (7 < local_28) {
      puVar5 = (ushort *)CONCAT62(uStack_3e,local_40);
    }
    puVar2 = &local_40;
    if (7 < local_28) {
      puVar2 = (ushort *)CONCAT62(uStack_3e,local_40);
    }
    for (; puVar2 != puVar5 + local_30; puVar2 = puVar2 + 1) {
      uVar6 = uVar6 ^ (uVar6 >> 2) + uVar6 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar2;
    }
    uVar6 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x10) +
                          (uVar6 % *(ulonglong *)(param_1 + 0x18)) * 8,&local_40);
  }
  if (7 < local_28) {
    operator_delete((void *)CONCAT62(uStack_3e,local_40));
  }
  if (uVar6 == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = uVar6 + 0x30;
  }
  return lVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402c7960(longlong param_1,short *param_2,undefined4 param_3)

{
  short sVar1;
  ushort *puVar2;
  ulonglong uVar3;
  ushort *puVar4;
  ulonglong uVar5;
  short *psVar6;
  undefined1 auStack_1c8 [32];
  undefined8 local_1a8;
  undefined1 local_1a0 [24];
  ushort local_188;
  undefined6 uStack_186;
  longlong local_178;
  ulonglong local_170;
  void *local_158 [2];
  longlong local_148;
  ulonglong local_140;
  undefined2 local_130;
  undefined6 uStack_12e;
  undefined8 local_120;
  ulonglong local_118;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined8 local_e8;
  ulonglong local_e0;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  void *local_b8 [2];
  longlong local_a8;
  ulonglong local_a0;
  undefined2 local_90;
  undefined6 uStack_8e;
  undefined8 local_80;
  ulonglong local_78;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  ulonglong local_58;
  
  local_1a8 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_1c8;
  local_170 = 7;
  uVar5 = 0;
  local_178 = 0;
  local_188 = 0;
  uVar3 = 0xffffffffffffffff;
  psVar6 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_188,param_2,~uVar3 - 1);
  if (*(longlong *)(param_1 + 0x30) != 0) {
    puVar4 = &local_188;
    if (7 < local_170) {
      puVar4 = (ushort *)CONCAT62(uStack_186,local_188);
    }
    puVar2 = &local_188;
    if (7 < local_170) {
      puVar2 = (ushort *)CONCAT62(uStack_186,local_188);
    }
    for (; puVar2 != puVar4 + local_178; puVar2 = puVar2 + 1) {
      uVar5 = uVar5 ^ (uVar5 >> 2) + uVar5 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar2;
    }
    uVar5 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x10) +
                          (uVar5 % *(ulonglong *)(param_1 + 0x18)) * 8,&local_188);
  }
  if (7 < local_170) {
    operator_delete((void *)CONCAT62(uStack_186,local_188));
  }
  if (uVar5 == 0) {
    local_e0 = 7;
    local_e8 = 0;
    local_f8 = 0;
    local_d0 = 0;
    local_cc = 0;
    local_c8 = 0;
    uVar5 = 0xffffffffffffffff;
    psVar6 = param_2;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    FUN_140001710(&local_f8,param_2,~uVar5 - 1);
    local_d0 = 0;
    local_c8 = 0;
    local_140 = 7;
    local_148 = 0;
    local_158[0] = (void *)((ulonglong)local_158[0] & 0xffffffffffff0000);
    uVar5 = 0xffffffffffffffff;
    psVar6 = param_2;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    local_cc = param_3;
    FUN_140001710(local_158,param_2,~uVar5 - 1);
    local_118 = 7;
    local_120 = 0;
    local_130 = 0;
    FUN_1400015e0(&local_130,&local_f8,0,0xffffffffffffffff);
    local_108 = local_d0;
    local_104 = local_cc;
    local_100 = local_c8;
    local_a0 = 7;
    local_a8 = 0;
    local_b8[0] = (void *)((ulonglong)local_b8[0] & 0xffffffffffff0000);
    if (local_140 < 8) {
      memmove(local_b8,local_158,local_148 * 2 + 2);
      local_a0 = local_140;
    }
    else {
      local_b8[0] = local_158[0];
      local_158[0] = (void *)0x0;
      local_a0 = local_140;
    }
    local_a8 = local_148;
    local_148 = 0;
    local_140 = 0;
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    FUN_1400015e0(&local_90,&local_130,0,0xffffffffffffffff);
    local_68 = local_108;
    local_64 = local_104;
    local_60 = local_100;
    if (*(longlong *)(param_1 + 0x30) == 0) {
      FUN_1402c8dc0(param_1 + 0x10,&local_188,local_b8);
    }
    else {
      FUN_1402c8ca0(param_1 + 0x10,local_1a0,local_b8,local_b8);
    }
    if (7 < local_78) {
      operator_delete((void *)CONCAT62(uStack_8e,local_90));
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    if (7 < local_a0) {
      operator_delete(local_b8[0]);
    }
    local_a0 = 7;
    local_a8 = 0;
    local_b8[0] = (void *)((ulonglong)local_b8[0] & 0xffffffffffff0000);
    if (7 < local_118) {
      operator_delete((void *)CONCAT62(uStack_12e,local_130));
    }
    local_118 = 7;
    local_120 = 0;
    local_130 = 0;
    if (7 < local_140) {
      operator_delete(local_158[0]);
    }
    if (7 < local_e0) {
      operator_delete((void *)CONCAT62(uStack_f6,local_f8));
    }
  }
  else {
    *(undefined4 *)(uVar5 + 0x5c) = param_3;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402c7cd0(longlong param_1,short *param_2,undefined4 param_3)

{
  short sVar1;
  ushort *puVar2;
  ulonglong uVar3;
  ushort *puVar4;
  ulonglong uVar5;
  short *psVar6;
  undefined1 auStack_1c8 [32];
  undefined8 local_1a8;
  undefined1 local_1a0 [24];
  ushort local_188;
  undefined6 uStack_186;
  longlong local_178;
  ulonglong local_170;
  void *local_158 [2];
  longlong local_148;
  ulonglong local_140;
  undefined2 local_130;
  undefined6 uStack_12e;
  undefined8 local_120;
  ulonglong local_118;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined8 local_e8;
  ulonglong local_e0;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  void *local_b8 [2];
  longlong local_a8;
  ulonglong local_a0;
  undefined2 local_90;
  undefined6 uStack_8e;
  undefined8 local_80;
  ulonglong local_78;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  ulonglong local_58;
  
  local_1a8 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_1c8;
  local_170 = 7;
  uVar5 = 0;
  local_178 = 0;
  local_188 = 0;
  uVar3 = 0xffffffffffffffff;
  psVar6 = param_2;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    sVar1 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_188,param_2,~uVar3 - 1);
  if (*(longlong *)(param_1 + 0x30) != 0) {
    puVar4 = &local_188;
    if (7 < local_170) {
      puVar4 = (ushort *)CONCAT62(uStack_186,local_188);
    }
    puVar2 = &local_188;
    if (7 < local_170) {
      puVar2 = (ushort *)CONCAT62(uStack_186,local_188);
    }
    for (; puVar2 != puVar4 + local_178; puVar2 = puVar2 + 1) {
      uVar5 = uVar5 ^ (uVar5 >> 2) + uVar5 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar2;
    }
    uVar5 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x10) +
                          (uVar5 % *(ulonglong *)(param_1 + 0x18)) * 8,&local_188);
  }
  if (7 < local_170) {
    operator_delete((void *)CONCAT62(uStack_186,local_188));
  }
  if (uVar5 == 0) {
    local_e0 = 7;
    local_e8 = 0;
    local_f8 = 0;
    local_d0 = 0;
    local_cc = 0;
    local_c8 = 0;
    uVar5 = 0xffffffffffffffff;
    psVar6 = param_2;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    FUN_140001710(&local_f8,param_2,~uVar5 - 1);
    local_cc = *(undefined4 *)(param_1 + 0x1e0);
    local_d0 = 0;
    local_140 = 7;
    local_148 = 0;
    local_158[0] = (void *)((ulonglong)local_158[0] & 0xffffffffffff0000);
    uVar5 = 0xffffffffffffffff;
    psVar6 = param_2;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar1 = *psVar6;
      psVar6 = psVar6 + 1;
    } while (sVar1 != 0);
    local_c8 = param_3;
    FUN_140001710(local_158,param_2,~uVar5 - 1);
    local_118 = 7;
    local_120 = 0;
    local_130 = 0;
    FUN_1400015e0(&local_130,&local_f8,0,0xffffffffffffffff);
    local_108 = local_d0;
    local_104 = local_cc;
    local_100 = local_c8;
    local_a0 = 7;
    local_a8 = 0;
    local_b8[0] = (void *)((ulonglong)local_b8[0] & 0xffffffffffff0000);
    if (local_140 < 8) {
      memmove(local_b8,local_158,local_148 * 2 + 2);
      local_a0 = local_140;
    }
    else {
      local_b8[0] = local_158[0];
      local_158[0] = (void *)0x0;
      local_a0 = local_140;
    }
    local_a8 = local_148;
    local_148 = 0;
    local_140 = 0;
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    FUN_1400015e0(&local_90,&local_130,0,0xffffffffffffffff);
    local_68 = local_108;
    local_64 = local_104;
    local_60 = local_100;
    if (*(longlong *)(param_1 + 0x30) == 0) {
      FUN_1402c8dc0(param_1 + 0x10,&local_188,local_b8);
    }
    else {
      FUN_1402c8ca0(param_1 + 0x10,local_1a0,local_b8,local_b8);
    }
    if (7 < local_78) {
      operator_delete((void *)CONCAT62(uStack_8e,local_90));
    }
    local_78 = 7;
    local_80 = 0;
    local_90 = 0;
    if (7 < local_a0) {
      operator_delete(local_b8[0]);
    }
    local_a0 = 7;
    local_a8 = 0;
    local_b8[0] = (void *)((ulonglong)local_b8[0] & 0xffffffffffff0000);
    if (7 < local_118) {
      operator_delete((void *)CONCAT62(uStack_12e,local_130));
    }
    local_118 = 7;
    local_120 = 0;
    local_130 = 0;
    if (7 < local_140) {
      operator_delete(local_158[0]);
    }
    if (7 < local_e0) {
      operator_delete((void *)CONCAT62(uStack_f6,local_f8));
    }
  }
  else {
    *(undefined4 *)(uVar5 + 0x60) = param_3;
  }
  return;
}



void FUN_1402c8050(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  undefined1 auVar4 [16];
  __uint64 _Var5;
  void *pvVar6;
  longlong lVar7;
  undefined8 *puVar8;
  longlong *local_20;
  
  puVar8 = (undefined8 *)(param_1 + 0x58);
  lVar7 = 10;
  *(int *)(param_1 + 0x50) = (int)((*(float *)(param_1 + 0x1e0) + 1e-07) * 30.0);
  do {
    auVar4._8_8_ = 0;
    auVar4._0_8_ = (longlong)*(int *)(param_1 + 0x50);
    _Var5 = SUB168(ZEXT816(4) * auVar4,0);
    if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
      _Var5 = 0xffffffffffffffff;
    }
    pvVar6 = operator_new(_Var5);
    FUN_1402c3a50(&local_20,pvVar6,0);
    *puVar8 = pvVar6;
    plVar3 = (longlong *)puVar8[1];
    puVar8[1] = local_20;
    local_20 = plVar3;
    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);
        }
      }
    }
    memset((void *)*puVar8,0,(longlong)*(int *)(param_1 + 0x50) << 2);
    puVar8 = puVar8 + 2;
    lVar7 = lVar7 + -1;
  } while (lVar7 != 0);
  return;
}



void FUN_1402c8150(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  undefined1 auVar4 [16];
  int iVar5;
  __uint64 _Var6;
  void *pvVar7;
  longlong lVar8;
  undefined8 *puVar9;
  longlong *local_20;
  
  iVar5 = (int)((*(float *)(param_1 + 0x1e0) + 1e-07) * 30.0);
  *(int *)(param_1 + 0x54) = iVar5;
  if (0 < iVar5) {
    puVar9 = (undefined8 *)(param_1 + 0xf8);
    lVar8 = 10;
    do {
      auVar4._8_8_ = 0;
      auVar4._0_8_ = (longlong)*(int *)(param_1 + 0x54);
      _Var6 = SUB168(ZEXT816(4) * auVar4,0);
      if (SUB168(ZEXT816(4) * auVar4,8) != 0) {
        _Var6 = 0xffffffffffffffff;
      }
      pvVar7 = operator_new(_Var6);
      FUN_1402c3a50(&local_20,pvVar7,0);
      *puVar9 = pvVar7;
      plVar3 = (longlong *)puVar9[1];
      puVar9[1] = local_20;
      local_20 = plVar3;
      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);
          }
        }
      }
      memset((void *)*puVar9,0,(longlong)*(int *)(param_1 + 0x54) << 2);
      puVar9 = puVar9 + 2;
      lVar8 = lVar8 + -1;
    } while (lVar8 != 0);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402c8260(longlong param_1,float param_2)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  float fVar4;
  
  if ((DAT_1406093e4 & 1) == 0) {
    DAT_1406093e4 = DAT_1406093e4 | 1;
  }
  iVar3 = 0;
  _DAT_1406093d8 = 0;
  _DAT_1406093e0 = 1.0;
  if (0 < *(int *)(param_1 + 0x1e8)) {
    lVar2 = 0;
    do {
      lVar1 = *(longlong *)(param_1 + 0x1f0);
      if ((*(float *)(lVar2 + lVar1) <= param_2) && (param_2 < *(float *)(lVar2 + 4 + lVar1))) {
        lVar2 = (longlong)iVar3 * 0x20;
        fVar4 = (param_2 - *(float *)(lVar2 + lVar1)) /
                (*(float *)(lVar2 + 4 + lVar1) - *(float *)(lVar2 + lVar1));
        _DAT_1406093d8 =
             CONCAT44((*(float *)(lVar2 + 0x18 + lVar1) - *(float *)(lVar2 + 0xc + lVar1)) * fVar4 +
                      *(float *)(lVar2 + 0xc + lVar1),
                      (*(float *)(lVar2 + 0x14 + lVar1) - *(float *)(lVar2 + 8 + lVar1)) * fVar4 +
                      *(float *)(lVar2 + 8 + lVar1));
        _DAT_1406093e0 =
             (*(float *)(lVar2 + 0x1c + lVar1) - *(float *)(lVar2 + 0x10 + lVar1)) * fVar4 +
             *(float *)(lVar2 + 0x10 + lVar1);
        break;
      }
      _DAT_1406093d8 = *(undefined8 *)(lVar2 + 0x14 + lVar1);
      iVar3 = iVar3 + 1;
      _DAT_1406093e0 = *(float *)(lVar2 + 0x1c + lVar1);
      lVar2 = lVar2 + 0x20;
    } while (iVar3 < *(int *)(param_1 + 0x1e8));
  }
  return &DAT_1406093d8;
}



undefined8 FUN_1402c83a0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  longlong local_res10;
  
  plVar3 = *(longlong **)(param_1 + 0x198);
  plVar1 = *(longlong **)(param_1 + 0x1a0);
  local_res10 = param_2;
  if (plVar3 != plVar1) {
    do {
      puVar2 = (undefined8 *)*plVar3;
      if (ABS(*(float *)((longlong)puVar2 + 0xc) - *(float *)(param_2 + 0xc)) < 0.01) {
        if (puVar2 != (undefined8 *)0x0) {
          (**(code **)*puVar2)(puVar2,1);
        }
        *plVar3 = param_2;
        return 0xffffffff;
      }
      plVar3 = plVar3 + 1;
    } while (plVar3 != plVar1);
  }
  if ((&local_res10 < plVar1) && (plVar3 = *(longlong **)(param_1 + 0x198), plVar3 <= &local_res10))
  {
    if (plVar1 == *(longlong **)(param_1 + 0x1a8)) {
      FUN_140195b20(param_1 + 0x198);
    }
    if (*(undefined8 **)(param_1 + 0x1a0) != (undefined8 *)0x0) {
      **(undefined8 **)(param_1 + 0x1a0) =
           *(undefined8 *)
            (*(longlong *)(param_1 + 0x198) + ((longlong)&local_res10 - (longlong)plVar3 >> 3) * 8);
    }
  }
  else {
    if (plVar1 == *(longlong **)(param_1 + 0x1a8)) {
      FUN_140195b20(param_1 + 0x198);
    }
    if (*(longlong **)(param_1 + 0x1a0) != (longlong *)0x0) {
      **(longlong **)(param_1 + 0x1a0) = param_2;
    }
  }
  *(longlong *)(param_1 + 0x1a0) = *(longlong *)(param_1 + 0x1a0) + 8;
  FUN_1402c8b40(*(longlong *)(param_1 + 0x198),*(longlong *)(param_1 + 0x1a0),
                *(longlong *)(param_1 + 0x1a0) - *(longlong *)(param_1 + 0x198) >> 3,0);
  return 1;
}



void FUN_1402c8500(longlong param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  
  puVar1 = operator_new(0xa0);
  if (puVar1 != (undefined4 *)0x0) {
    *puVar1 = 0;
    *(undefined8 *)(puVar1 + 7) = 7;
    *(undefined8 *)(puVar1 + 5) = 0;
    *(undefined2 *)(puVar1 + 1) = 0;
    *(undefined8 *)(puVar1 + 0xb) = 0;
    *(undefined8 *)(puVar1 + 0xd) = 0;
    *(undefined8 *)(puVar1 + 0xf) = 0;
    puVar1[0x11] = 0;
    *(undefined8 *)(puVar1 + 0x1b) = 0;
    puVar1[0x1d] = 0;
    *(undefined8 *)(puVar1 + 0x1e) = 0;
    puVar1[0x20] = 0;
    *(undefined8 *)(puVar1 + 0x21) = 0;
    puVar1[0x23] = 0;
    *(undefined8 *)(puVar1 + 0x24) = 0;
    *(undefined8 *)(puVar1 + 0x26) = 0;
    *(undefined8 *)(puVar1 + 0x12) = 0x3f800000;
    *(undefined8 *)(puVar1 + 0x14) = 0;
    *(undefined8 *)(puVar1 + 0x16) = 0x3f800000;
    *(undefined8 *)(puVar1 + 0x18) = 0;
    puVar1[0x1a] = 0x3f800000;
  }
  *(undefined4 **)(param_1 + 0x240) = puVar1;
  *puVar1 = *param_2;
  FUN_1400015e0(puVar1 + 1,param_2 + 1,0,0xffffffffffffffff);
  puVar1[0xb] = param_2[0xb];
  puVar1[0xc] = param_2[0xc];
  puVar1[0xd] = param_2[0xd];
  puVar1[0xe] = param_2[0xe];
  memcpy(puVar1 + 0xf,param_2 + 0xf,100);
  return;
}



undefined1 * FUN_1402c8600(undefined1 *param_1)

{
  void *pvVar1;
  undefined1 local_res8;
  char *local_res10;
  undefined **local_20 [3];
  
  local_res8 = SUB81(param_1,0);
  *param_1 = local_res8;
  *(undefined8 *)(param_1 + 0x10) = 0;
  pvVar1 = operator_new(0x60);
  if (pvVar1 != (void *)0x0) {
    *(void **)(param_1 + 8) = pvVar1;
    *(void **)pvVar1 = pvVar1;
    *(longlong *)(*(longlong *)(param_1 + 8) + 8) = *(longlong *)(param_1 + 8);
    *(undefined8 *)(param_1 + 0x20) = 0;
    *(undefined8 *)(param_1 + 0x28) = 0;
    *(undefined8 *)(param_1 + 0x30) = 0;
    *(undefined4 *)(param_1 + 0x50) = 0x3f800000;
    FUN_1402c86d0(param_1);
    return param_1;
  }
  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_1405d3608);
}



void FUN_1402c86b0(undefined8 *param_1)

{
  FUN_1402c8740();
                    // WARNING: Could not recover jumptable at 0x0001402c86c6. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete((void *)*param_1);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402c86fb)
// WARNING: Removing unreachable block (ram,0x0001402c8700)

void FUN_1402c86d0(longlong param_1)

{
  undefined8 local_res8 [4];
  
  local_res8[0] = *(undefined8 *)(param_1 + 8);
  if (*(longlong *)(param_1 + 0x20) != *(longlong *)(param_1 + 0x28)) {
    *(longlong *)(param_1 + 0x28) = *(longlong *)(param_1 + 0x20);
  }
  FUN_1402c87e0((undefined8 *)(param_1 + 0x20),*(undefined8 *)(param_1 + 0x20),local_res8);
  *(undefined8 *)(param_1 + 0x40) = 7;
  *(undefined8 *)(param_1 + 0x48) = 8;
  return;
}



void FUN_1402c8740(longlong *param_1)

{
  longlong *plVar1;
  longlong *plVar2;
  
  plVar1 = (longlong *)*param_1;
  plVar2 = (longlong *)*plVar1;
  *plVar1 = (longlong)plVar1;
  *(longlong *)(*param_1 + 8) = *param_1;
  param_1[1] = 0;
  if (plVar2 != (longlong *)*param_1) {
    do {
      plVar1 = (longlong *)*plVar2;
      if (7 < (ulonglong)plVar2[10]) {
        operator_delete((void *)plVar2[7]);
      }
      plVar2[10] = 7;
      plVar2[9] = 0;
      *(undefined2 *)(plVar2 + 7) = 0;
      if (7 < (ulonglong)plVar2[5]) {
        operator_delete((void *)plVar2[2]);
      }
      plVar2[5] = 7;
      plVar2[4] = 0;
      *(undefined2 *)(plVar2 + 2) = 0;
      operator_delete(plVar2);
      plVar2 = plVar1;
    } while (plVar1 != (longlong *)*param_1);
  }
  return;
}



void FUN_1402c87e0(longlong *param_1,undefined8 *param_2,undefined8 *param_3)

{
  ulonglong uVar1;
  void *pvVar2;
  char *pcVar3;
  code *pcVar4;
  longlong lVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  char *local_res20;
  undefined **local_30 [3];
  
  lVar8 = param_1[1];
  lVar5 = lVar8 - *param_1 >> 3;
  if (0x1fffffffffffffffU - lVar5 < 0x10) {
    std::_Xlength_error("vector<T> too long");
    pcVar4 = (code *)swi(3);
    (*pcVar4)();
    return;
  }
  uVar1 = lVar5 + 0x10;
  uVar7 = param_1[2] - *param_1 >> 3;
  if (uVar7 < uVar1) {
    if (0x1fffffffffffffff - (uVar7 >> 1) < uVar7) {
      uVar7 = 0;
    }
    else {
      uVar7 = uVar7 + (uVar7 >> 1);
    }
    if (uVar7 < uVar1) {
      uVar7 = uVar1;
    }
    local_res20 = (char *)0x0;
    if ((uVar7 != 0) &&
       ((0x1fffffffffffffff < uVar7 ||
        (local_res20 = operator_new(uVar7 * 8), local_res20 == (char *)0x0)))) {
      local_res20 = (char *)0x0;
      std::exception::exception((exception *)local_30,&local_res20);
      local_30[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_30,(ThrowInfo *)&DAT_1405d3608);
    }
    pcVar3 = local_res20;
    lVar8 = (longlong)param_2 - *param_1 >> 3;
    FUN_1402c8f10(local_res20 + lVar8 * 8,0x10,param_3);
    FUN_1401fbd90(*param_1,param_2,pcVar3);
    FUN_1401fbd90(param_2,param_1[1],pcVar3 + lVar8 * 8 + 0x80);
    pvVar2 = (void *)*param_1;
    lVar8 = param_1[1];
    if (pvVar2 != (void *)0x0) {
      operator_delete(pvVar2);
    }
    param_1[2] = (longlong)(pcVar3 + uVar7 * 8);
    param_1[1] = (longlong)(pcVar3 + (lVar8 - (longlong)pvVar2 >> 3) * 8 + 0x80);
    *param_1 = (longlong)pcVar3;
  }
  else {
    pcVar3 = (char *)*param_3;
    if ((ulonglong)(lVar8 - (longlong)param_2 >> 3) < 0x10) {
      local_res20 = pcVar3;
      FUN_1401fbd90(param_2,lVar8,param_2 + 0x10,0x1fffffffffffffff,0xfffffffffffffffe);
      FUN_1402c8f10(param_1[1],0x10 - (param_1[1] - (longlong)param_2 >> 3),&local_res20);
      param_1[1] = param_1[1] + 0x80;
      lVar8 = param_1[1];
      for (; param_2 != (undefined8 *)(lVar8 + -0x80); param_2 = param_2 + 1) {
        *param_2 = pcVar3;
      }
    }
    else {
      puVar6 = (undefined8 *)(lVar8 + -0x80);
      lVar5 = FUN_1401fbd90(puVar6,lVar8,lVar8,0x1fffffffffffffff,0xfffffffffffffffe);
      param_1[1] = lVar5;
      if (param_2 != puVar6) {
        lVar8 = lVar8 - (longlong)puVar6;
        do {
          puVar6 = puVar6 + -1;
          *(undefined8 *)(lVar8 + (longlong)puVar6) = *puVar6;
        } while (param_2 != puVar6);
      }
      puVar6 = param_2;
      if (param_2 != param_2 + 0x10) {
        do {
          *puVar6 = pcVar3;
          puVar6 = puVar6 + 1;
        } while (puVar6 != param_2 + 0x10);
      }
    }
  }
  return;
}



undefined8 * FUN_1402c8a60(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  *param_1 = 0;
  puVar1 = operator_new(0x20);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar1 + 1) = 1;
    *(undefined4 *)((longlong)puVar1 + 0xc) = 1;
    *puVar1 = boost::detail::sp_counted_impl_pd<>::vftable;
    puVar1[2] = param_2;
  }
  *param_1 = puVar1;
  return param_1;
}



longlong FUN_1402c8ad0(longlong param_1,type_info *param_2)

{
  bool bVar1;
  
  bVar1 = type_info::operator==
                    (param_2,(type_info *)&boost::checked_array_deleter<>::RTTI_Type_Descriptor);
  if (bVar1) {
    return param_1 + 0x18;
  }
  return 0;
}



undefined8 * FUN_1402c8b10(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_1402c8b40(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_1402c8c0b:
      if (1 < lVar1) {
        FUN_1402c9630(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_1402c9540(param_1,param_2,param_4);
        if (lVar1 < 2) {
          return;
        }
        do {
          FUN_1402c9b50(param_1,param_2,param_4);
          param_2 = param_2 + -8;
        } while (8 < (longlong)(param_2 - param_1 & 0xfffffffffffffff8U));
        return;
      }
      goto LAB_1402c8c0b;
    }
    FUN_1402c8f40(&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_1402c8b40(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_1402c8b40(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



longlong * FUN_1402c8ca0(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  char cVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong *local_38;
  undefined8 *local_30;
  undefined2 local_28;
  
  uVar3 = FUN_14015afa0(param_3);
  puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
  lVar4 = FUN_1402cb0b0(puVar6,param_3);
  if (lVar4 == 0) {
    local_30 = (undefined8 *)0x0;
    local_28 = 0;
    local_38 = param_1;
    FUN_1402c99c0(&local_38);
    puVar1 = local_30;
    if (local_30 + 1 != (undefined8 *)0x0) {
      FUN_1402c9ab0(local_30 + 1,param_4);
    }
    local_28 = CONCAT11(1,(undefined1)local_28);
    cVar2 = FUN_1402c92f0(param_1);
    if (cVar2 != '\0') {
      puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
    }
    *puVar1 = *puVar6;
    *puVar6 = puVar1;
    param_1[4] = param_1[4] + 1;
    puVar5 = (undefined8 *)param_1[6];
    if (puVar6 < (undefined8 *)param_1[6]) {
      puVar5 = puVar6;
    }
    param_1[6] = (longlong)puVar5;
    *param_2 = (longlong)puVar6;
    param_2[1] = (longlong)puVar1;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)puVar6;
    param_2[1] = lVar4;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



longlong * FUN_1402c8dc0(longlong *param_1,longlong *param_2)

{
  undefined8 **ppuVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined8 **ppuVar6;
  undefined8 *local_res8;
  undefined8 *local_res10;
  longlong *local_30;
  undefined8 *local_28;
  undefined2 local_20;
  
  local_28 = (undefined8 *)0x0;
  local_20 = 0;
  local_30 = param_1;
  FUN_1402c99c0(&local_30);
  puVar3 = local_28;
  puVar2 = local_28 + 1;
  local_res8 = puVar2;
  local_res10 = puVar2;
  if (puVar2 != (undefined8 *)0x0) {
    FUN_1402c9ab0(puVar2);
  }
  local_20 = CONCAT11(1,(undefined1)local_20);
  uVar4 = FUN_14015afa0(puVar2);
  if (*param_1 == 0) {
    local_res8 = (undefined8 *)FUN_1402c9710(param_1,1);
    ppuVar1 = (undefined8 **)(param_1 + 1);
    ppuVar6 = &local_res8;
    if (local_res8 <= *ppuVar1) {
      ppuVar6 = ppuVar1;
    }
    *ppuVar1 = *ppuVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else {
    local_res10 = (undefined8 *)0x1;
    if ((ulonglong)param_1[7] < 2) {
      local_res8 = (undefined8 *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      lVar5 = FUN_1402c9710(param_1);
      if (lVar5 != param_1[1]) {
        FUN_1402c97f0(param_1);
      }
    }
  }
  puVar2 = (undefined8 *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar3 = *puVar2;
  *puVar2 = puVar3;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)puVar2;
  *param_2 = (longlong)puVar2;
  param_2[1] = (longlong)puVar3;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



void FUN_1402c8f10(undefined8 *param_1,longlong param_2,undefined8 *param_3)

{
  for (; param_2 != 0; param_2 = param_2 + -1) {
    if (param_1 != (undefined8 *)0x0) {
      *param_1 = *param_3;
    }
    param_1 = param_1 + 1;
  }
  return;
}



undefined8 * FUN_1402c8f40(undefined8 *param_1,longlong *param_2,longlong *param_3)

{
  float fVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  
  plVar9 = param_2 + (((longlong)param_3 - (longlong)param_2 >> 3) -
                      ((longlong)param_3 - (longlong)param_2 >> 0x3f) >> 1);
  FUN_1402c9360(param_2,plVar9,param_3 + -1);
  plVar5 = plVar9 + 1;
  while (plVar4 = plVar9, param_2 < plVar4) {
    if ((*(float *)(plVar4[-1] + 0xc) < *(float *)(*plVar4 + 0xc)) ||
       (plVar9 = plVar4 + -1, *(float *)(*plVar4 + 0xc) < *(float *)(plVar4[-1] + 0xc))) break;
  }
  plVar8 = plVar5;
  plVar9 = plVar4;
  if (plVar5 < param_3) {
    lVar3 = (longlong)param_3 + (7 - (longlong)plVar5);
    if (3 < (longlong)(lVar3 + (ulonglong)((uint)(lVar3 >> 0x3f) & 7)) >> 3) {
      fVar1 = *(float *)(*plVar4 + 0xc);
      do {
        plVar8 = plVar5;
        if ((*(float *)(*plVar5 + 0xc) < fVar1) || (fVar1 < *(float *)(*plVar5 + 0xc)))
        goto LAB_1402c9096;
        if ((*(float *)(plVar5[1] + 0xc) < fVar1) || (fVar1 < *(float *)(plVar5[1] + 0xc))) {
          plVar5 = plVar5 + 1;
          plVar8 = plVar5;
          goto LAB_1402c9096;
        }
        if ((*(float *)(plVar5[2] + 0xc) < fVar1) || (fVar1 < *(float *)(plVar5[2] + 0xc))) {
          plVar5 = plVar5 + 2;
          plVar8 = plVar5;
          goto LAB_1402c9096;
        }
        if ((*(float *)(plVar5[3] + 0xc) < fVar1) || (fVar1 < *(float *)(plVar5[3] + 0xc))) {
          plVar5 = plVar5 + 3;
          plVar8 = plVar5;
          goto LAB_1402c9096;
        }
        plVar5 = plVar5 + 4;
      } while ((longlong)plVar5 < (longlong)(param_3 + -3));
    }
    plVar8 = plVar5;
    if (plVar5 < param_3) {
      do {
        plVar8 = plVar5;
        if ((*(float *)(*plVar5 + 0xc) < *(float *)(*plVar4 + 0xc)) ||
           (*(float *)(*plVar4 + 0xc) < *(float *)(*plVar5 + 0xc))) break;
        plVar5 = plVar5 + 1;
        plVar8 = plVar5;
      } while (plVar5 < param_3);
    }
  }
LAB_1402c9096:
  do {
    plVar7 = plVar8;
    plVar6 = plVar5;
    if (plVar5 < param_3) {
      lVar3 = (longlong)param_3 + (7 - (longlong)plVar5);
      if (3 < (longlong)(lVar3 + (ulonglong)((uint)(lVar3 >> 0x3f) & 7)) >> 3) {
        do {
          fVar1 = *(float *)(*plVar5 + 0xc);
          plVar7 = plVar8;
          if (fVar1 <= *(float *)(*plVar4 + 0xc)) {
            plVar6 = plVar5;
            if (fVar1 < *(float *)(*plVar4 + 0xc)) goto joined_r0x0001402c91ca;
            plVar7 = plVar8 + 1;
            lVar3 = *plVar8;
            *plVar8 = *plVar5;
            *plVar5 = lVar3;
          }
          fVar1 = *(float *)(plVar5[1] + 0xc);
          plVar8 = plVar7;
          if (fVar1 <= *(float *)(*plVar4 + 0xc)) {
            if (fVar1 < *(float *)(*plVar4 + 0xc)) {
              plVar6 = plVar5 + 1;
              goto joined_r0x0001402c91ca;
            }
            plVar8 = plVar7 + 1;
            lVar3 = *plVar7;
            *plVar7 = plVar5[1];
            plVar5[1] = lVar3;
          }
          fVar1 = *(float *)(plVar5[2] + 0xc);
          plVar7 = plVar8;
          if (fVar1 <= *(float *)(*plVar4 + 0xc)) {
            if (fVar1 < *(float *)(*plVar4 + 0xc)) {
              plVar6 = plVar5 + 2;
              goto joined_r0x0001402c91ca;
            }
            plVar7 = plVar8 + 1;
            lVar3 = *plVar8;
            *plVar8 = plVar5[2];
            plVar5[2] = lVar3;
          }
          fVar1 = *(float *)(plVar5[3] + 0xc);
          plVar8 = plVar7;
          if (fVar1 <= *(float *)(*plVar4 + 0xc)) {
            if (fVar1 < *(float *)(*plVar4 + 0xc)) {
              plVar6 = plVar5 + 3;
              goto joined_r0x0001402c91ca;
            }
            plVar8 = plVar7 + 1;
            lVar3 = *plVar7;
            *plVar7 = plVar5[3];
            plVar5[3] = lVar3;
          }
          plVar5 = plVar5 + 4;
        } while ((longlong)plVar5 < (longlong)(param_3 + -3));
      }
      for (; plVar7 = plVar8, plVar6 = plVar5, plVar5 < param_3; plVar5 = plVar5 + 1) {
        fVar1 = *(float *)(*plVar5 + 0xc);
        if (fVar1 <= *(float *)(*plVar4 + 0xc)) {
          if (fVar1 < *(float *)(*plVar4 + 0xc)) break;
          plVar7 = plVar8 + 1;
          lVar3 = *plVar8;
          *plVar8 = *plVar5;
          *plVar5 = lVar3;
        }
        plVar8 = plVar7;
      }
    }
joined_r0x0001402c91ca:
    plVar2 = plVar9;
    if (param_2 < plVar2) {
      plVar9 = plVar2 + -1;
      if (*(float *)(*plVar4 + 0xc) <= *(float *)(plVar2[-1] + 0xc)) {
        if (*(float *)(*plVar4 + 0xc) < *(float *)(plVar2[-1] + 0xc)) goto LAB_1402c920b;
        lVar3 = plVar4[-1];
        plVar4 = plVar4 + -1;
        *plVar4 = *plVar9;
        *plVar9 = lVar3;
      }
      goto joined_r0x0001402c91ca;
    }
LAB_1402c920b:
    if (plVar2 == param_2) {
      if (plVar6 == param_3) {
        *param_1 = plVar4;
        param_1[1] = plVar7;
        return param_1;
      }
      if (plVar7 != plVar6) {
        lVar3 = *plVar4;
        *plVar4 = *plVar7;
        *plVar7 = lVar3;
      }
      lVar3 = *plVar4;
      *plVar4 = *plVar6;
      *plVar6 = lVar3;
      plVar4 = plVar4 + 1;
      plVar5 = plVar6 + 1;
      plVar8 = plVar7 + 1;
      plVar9 = plVar2;
    }
    else {
      plVar9 = plVar2 + -1;
      if (plVar6 == param_3) {
        plVar4 = plVar4 + -1;
        if (plVar9 != plVar4) {
          lVar3 = *plVar9;
          *plVar9 = *plVar4;
          *plVar4 = lVar3;
        }
        lVar3 = *plVar4;
        *plVar4 = plVar7[-1];
        plVar7[-1] = lVar3;
        plVar5 = plVar6;
        plVar8 = plVar7 + -1;
      }
      else {
        lVar3 = *plVar6;
        plVar5 = plVar6 + 1;
        *plVar6 = *plVar9;
        *plVar9 = lVar3;
        plVar8 = plVar7;
      }
    }
  } while( true );
}



undefined8 FUN_1402c92f0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_1402c97f0(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_1402c9360(longlong *param_1,longlong *param_2,longlong *param_3)

{
  float *pfVar1;
  float fVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  
  lVar3 = (longlong)param_3 - (longlong)param_1 >> 3;
  if (lVar3 < 0x29) {
    lVar3 = *param_2;
    fVar2 = *(float *)(*param_1 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *param_2 = *param_1;
      *param_1 = lVar3;
    }
    lVar3 = *param_3;
    fVar2 = *(float *)(*param_2 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *param_3 = *param_2;
      *param_2 = lVar3;
    }
    lVar3 = *param_2;
    fVar2 = *(float *)(*param_1 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *param_2 = *param_1;
      *param_1 = lVar3;
    }
  }
  else {
    lVar3 = lVar3 + 1;
    lVar4 = (longlong)(lVar3 + (ulonglong)((uint)(lVar3 >> 0x3f) & 7)) >> 3;
    lVar3 = param_1[lVar4];
    fVar2 = *(float *)(*param_1 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      param_1[lVar4] = *param_1;
      *param_1 = lVar3;
    }
    lVar3 = param_1[lVar4 * 2];
    fVar2 = *(float *)(param_1[lVar4] + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      param_1[lVar4 * 2] = param_1[lVar4];
      param_1[lVar4] = lVar3;
    }
    lVar3 = param_1[lVar4];
    fVar2 = *(float *)(*param_1 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      param_1[lVar4] = *param_1;
      *param_1 = lVar3;
    }
    lVar3 = *param_2;
    plVar5 = param_2 + -lVar4;
    fVar2 = *(float *)(*plVar5 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *param_2 = *plVar5;
      *plVar5 = lVar3;
    }
    lVar3 = param_2[lVar4];
    fVar2 = *(float *)(*param_2 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      param_2[lVar4] = *param_2;
      *param_2 = lVar3;
    }
    lVar3 = *param_2;
    fVar2 = *(float *)(*plVar5 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *param_2 = *plVar5;
      *plVar5 = lVar3;
    }
    plVar6 = param_3 + lVar4 * -2;
    plVar5 = param_3 + -lVar4;
    lVar3 = *plVar5;
    fVar2 = *(float *)(*plVar6 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *plVar5 = *plVar6;
      *plVar6 = lVar3;
    }
    lVar3 = *param_3;
    fVar2 = *(float *)(*plVar5 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *param_3 = *plVar5;
      *plVar5 = lVar3;
    }
    lVar3 = *plVar5;
    fVar2 = *(float *)(*plVar6 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *plVar5 = *plVar6;
      *plVar6 = lVar3;
    }
    lVar3 = *param_2;
    fVar2 = *(float *)(param_1[lVar4] + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *param_2 = param_1[lVar4];
      param_1[lVar4] = lVar3;
    }
    lVar3 = *plVar5;
    fVar2 = *(float *)(*param_2 + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *plVar5 = *param_2;
      *param_2 = lVar3;
    }
    lVar3 = *param_2;
    fVar2 = *(float *)(param_1[lVar4] + 0xc);
    pfVar1 = (float *)(lVar3 + 0xc);
    if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
      *param_2 = param_1[lVar4];
      param_1[lVar4] = lVar3;
      return;
    }
  }
  return;
}



void FUN_1402c9540(longlong param_1,longlong param_2)

{
  float *pfVar1;
  float fVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  
  lVar9 = param_2 - param_1 >> 3;
  lVar4 = lVar9 - (param_2 - param_1 >> 0x3f) >> 1;
  if (0 < lVar4) {
    lVar7 = lVar4 * 2 + 2;
    do {
      lVar3 = *(longlong *)(param_1 + -8 + lVar4 * 8);
      lVar4 = lVar4 + -1;
      lVar7 = lVar7 + -2;
      lVar8 = lVar4;
      for (lVar6 = lVar7; lVar6 < lVar9; lVar6 = lVar6 * 2 + 2) {
        fVar2 = *(float *)(*(longlong *)(param_1 + -8 + lVar6 * 8) + 0xc);
        pfVar1 = (float *)(*(longlong *)(param_1 + lVar6 * 8) + 0xc);
        if (*pfVar1 <= fVar2 && fVar2 != *pfVar1) {
          lVar6 = lVar6 + -1;
        }
        *(undefined8 *)(param_1 + lVar8 * 8) = *(undefined8 *)(param_1 + lVar6 * 8);
        lVar8 = lVar6;
      }
      if (lVar6 == lVar9) {
        *(undefined8 *)(param_1 + lVar8 * 8) = *(undefined8 *)(param_1 + -8 + lVar9 * 8);
        lVar8 = lVar9 + -1;
      }
      if (lVar4 < lVar8) {
        fVar2 = *(float *)(lVar3 + 0xc);
        do {
          lVar5 = (lVar8 + -1) / 2;
          lVar6 = *(longlong *)(param_1 + lVar5 * 8);
          pfVar1 = (float *)(lVar6 + 0xc);
          if (fVar2 < *pfVar1 || fVar2 == *pfVar1) break;
          *(longlong *)(param_1 + lVar8 * 8) = lVar6;
          lVar8 = lVar5;
        } while (lVar4 < lVar5);
      }
      *(longlong *)(param_1 + lVar8 * 8) = lVar3;
    } while (0 < lVar4);
  }
  return;
}



void FUN_1402c9630(longlong *param_1,longlong *param_2)

{
  float fVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if ((param_1 != param_2) && (plVar4 = param_1 + 1, plVar4 != param_2)) {
    lVar5 = (longlong)plVar4 - (longlong)param_1;
    do {
      lVar2 = *plVar4;
      fVar1 = *(float *)(lVar2 + 0xc);
      plVar3 = plVar4;
      if (*(float *)(*param_1 + 0xc) <= fVar1) {
        while( true ) {
          if (*(float *)(plVar3[-1] + 0xc) <= fVar1) break;
          *plVar3 = plVar3[-1];
          plVar3 = plVar3 + -1;
        }
        *plVar3 = lVar2;
      }
      else {
        memmove(plVar4 + (1 - (lVar5 >> 3)),param_1,(lVar5 >> 3) * 8);
        *param_1 = lVar2;
      }
      plVar4 = plVar4 + 1;
      lVar5 = lVar5 + 8;
    } while (plVar4 != param_2);
  }
  return;
}



undefined * FUN_1402c9710(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_14049ab70;
  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 == &MBISingleton<>::vftable_meta_ptr) {
    return (undefined *)0xfffffffb;
  }
  return *ppuVar4;
}



void FUN_1402c97f0(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  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_140346140(&local_50);
  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;
    }
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  lVar6 = FUN_1402961d0(param_1);
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_140167cd0(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_140167cd0(&local_50);
  }
  return;
}



void FUN_1402c99c0(longlong param_1)

{
  undefined8 *puVar1;
  char *local_res8 [4];
  undefined **local_98 [5];
  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;
  undefined8 local_18;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_140167b70(*(longlong *)(param_1 + 8) + 8);
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar1 = operator_new(0x68);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar1;
    *puVar1 = 0;
    puVar1[1] = uStack_70;
    puVar1[2] = local_68;
    puVar1[3] = uStack_60;
    puVar1[4] = local_58;
    puVar1[5] = uStack_50;
    puVar1[6] = local_48;
    puVar1[7] = uStack_40;
    puVar1[8] = local_38;
    puVar1[9] = uStack_30;
    puVar1[10] = local_28;
    puVar1[0xb] = uStack_20;
    puVar1[0xc] = local_18;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_98,local_res8);
  local_98[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d3608);
}



undefined2 * FUN_1402c9ab0(undefined2 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  param_1[0x14] = 0;
  FUN_1400015e0(param_1 + 0x14,param_2 + 0x28,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x50);
  *(undefined4 *)(param_1 + 0x2a) = *(undefined4 *)(param_2 + 0x54);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x58);
  return param_1;
}



void FUN_1402c9b50(undefined8 *param_1,longlong param_2)

{
  float *pfVar1;
  float fVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  
  lVar3 = *(longlong *)(param_2 + -8);
  *(undefined8 *)(param_2 + -8) = *param_1;
  lVar4 = 2;
  lVar5 = 0;
  lVar7 = (param_2 - (longlong)param_1) + -8 >> 3;
  bVar8 = lVar7 == 2;
  lVar6 = lVar5;
  if (2 < lVar7) {
    do {
      lVar5 = lVar4;
      if (*(float *)(param_1[lVar4] + 0xc) <= *(float *)(param_1[lVar4 + -1] + 0xc) &&
          *(float *)(param_1[lVar4 + -1] + 0xc) != *(float *)(param_1[lVar4] + 0xc)) {
        lVar5 = lVar4 + -1;
      }
      param_1[lVar6] = param_1[lVar5];
      lVar4 = lVar5 * 2 + 2;
      bVar8 = lVar4 == lVar7;
      lVar6 = lVar5;
    } while (lVar4 < lVar7);
  }
  if (bVar8) {
    param_1[lVar5] = param_1[lVar7 + -1];
    lVar5 = lVar7 + -1;
  }
  if (0 < lVar5) {
    fVar2 = *(float *)(lVar3 + 0xc);
    do {
      lVar4 = (lVar5 + -1) / 2;
      pfVar1 = (float *)(param_1[lVar4] + 0xc);
      if (fVar2 < *pfVar1 || fVar2 == *pfVar1) break;
      param_1[lVar5] = param_1[lVar4];
      lVar5 = lVar4;
    } while (0 < lVar4);
  }
  param_1[lVar5] = lVar3;
  return;
}



undefined8 * FUN_1402c9c00(undefined8 *param_1)

{
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *param_1 = M3dSModelTemplate::vftable;
  *(undefined4 *)(param_1 + 5) = 0;
  param_1[6] = 0;
  param_1[10] = 7;
  param_1[9] = 0;
  *(undefined2 *)(param_1 + 7) = 0;
  param_1[0xf] = 7;
  param_1[0xe] = 0;
  *(undefined2 *)(param_1 + 0xc) = 0;
  param_1[0x14] = 7;
  param_1[0x13] = 0;
  *(undefined2 *)(param_1 + 0x11) = 0;
  param_1[0x19] = 7;
  param_1[0x18] = 0;
  *(undefined2 *)(param_1 + 0x16) = 0;
  param_1[0x1b] = 0;
  param_1[0x1c] = 0;
  param_1[0x1d] = 0;
  param_1[0x1e] = 0;
  FUN_1402ca220(param_1 + 0x1f);
  *(undefined4 *)(param_1 + 0x27) = 0;
  param_1[0x28] = 0;
  param_1[0x2c] = 7;
  param_1[0x2b] = 0;
  *(undefined2 *)(param_1 + 0x29) = 0;
  param_1[0x2e] = 0;
  return param_1;
}



void * FUN_1402c9cf0(void *param_1,uint param_2)

{
  FUN_1402c9d20();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402c9d20(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = M3dSModelTemplate::vftable;
  if (7 < (ulonglong)param_1[0x2c]) {
    operator_delete((void *)param_1[0x29]);
  }
  param_1[0x2c] = 7;
  param_1[0x2b] = 0;
  *(undefined2 *)(param_1 + 0x29) = 0;
  if (param_1[0x1f] != 0) {
    FUN_1402c6290();
  }
  plVar3 = (longlong *)param_1[0x1e];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x1c];
  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);
      }
    }
  }
  if (7 < (ulonglong)param_1[0x19]) {
    operator_delete((void *)param_1[0x16]);
  }
  param_1[0x19] = 7;
  param_1[0x18] = 0;
  *(undefined2 *)(param_1 + 0x16) = 0;
  if (7 < (ulonglong)param_1[0x14]) {
    operator_delete((void *)param_1[0x11]);
  }
  param_1[0x14] = 7;
  param_1[0x13] = 0;
  *(undefined2 *)(param_1 + 0x11) = 0;
  if (7 < (ulonglong)param_1[0xf]) {
    operator_delete((void *)param_1[0xc]);
  }
  param_1[0xf] = 7;
  param_1[0xe] = 0;
  *(undefined2 *)(param_1 + 0xc) = 0;
  if (7 < (ulonglong)param_1[10]) {
    operator_delete((void *)param_1[7]);
  }
  param_1[10] = 7;
  param_1[9] = 0;
  *(undefined2 *)(param_1 + 7) = 0;
  FUN_1402c3270(param_1);
  return;
}



void FUN_1402c9eb0(longlong param_1)

{
  void *pvVar1;
  
  FUN_1402cde30(DAT_140608268,*(undefined8 *)(param_1 + 0x170));
  pvVar1 = *(void **)(param_1 + 0x140);
  if (pvVar1 != (void *)0x0) {
    _eh_vector_destructor_iterator_(pvVar1,0xd4,*(int *)((longlong)pvVar1 + -4),FUN_14034ebc0);
    operator_delete__((void *)((longlong)pvVar1 + -4));
  }
  *(undefined8 *)(param_1 + 0x140) = 0;
  return;
}



undefined8 FUN_1402c9f20(longlong param_1,int param_2)

{
  longlong lVar1;
  
  if ((((param_2 != 0) && (lVar1 = *(longlong *)(param_1 + 0xd8), lVar1 != 0)) &&
      (param_2 = param_2 + -1, -1 < param_2)) &&
     (param_2 < (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4))) {
    return *(undefined8 *)(*(longlong *)(lVar1 + 0x28) + (longlong)param_2 * 0x10);
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1402c9f60(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  undefined8 uVar4;
  undefined1 auStack_108 [32];
  undefined4 local_e8;
  undefined8 *local_e0;
  undefined1 local_d8 [8];
  longlong *local_d0;
  undefined8 local_c8;
  undefined **local_b8;
  undefined8 local_b0;
  undefined2 local_a8;
  undefined8 local_98;
  undefined8 local_90;
  undefined1 local_80 [64];
  undefined4 local_40;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  ulonglong local_18;
  
  local_c8 = 0xfffffffffffffffe;
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  *param_1 = 0;
  param_1[1] = 0;
  local_e8 = 1;
  local_b0 = 0;
  local_90 = 7;
  local_98 = 0;
  local_a8 = 0;
  local_b8 = M3dSMdataBLoad::vftable;
  local_e0 = param_1;
  FUN_1402ca220(local_80);
  local_40 = 1;
  local_38 = 0;
  local_30 = 0;
  local_28 = 0;
  local_20 = 0;
  iVar3 = FUN_1402cfea0(&local_b8,param_2);
  if (iVar3 == 0) {
    uVar4 = FUN_1402d00a0(&local_b8,local_d8);
    FUN_140343ec0(param_1,uVar4);
    if (local_d0 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_d0 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_d0 + 8))(local_d0);
        LOCK();
        piVar2 = (int *)((longlong)local_d0 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_d0 + 0x10))(local_d0);
        }
      }
    }
  }
  FUN_1402cf630(&local_b8);
  return param_1;
}



bool FUN_1402ca090(longlong param_1,short *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  short *psVar5;
  longlong *plVar6;
  undefined1 local_20 [8];
  longlong *local_18;
  
  FUN_1402cde30(DAT_140608268,*(undefined8 *)(param_1 + 0x170),param_3,param_4,0xfffffffffffffffe);
  uVar4 = 0xffffffffffffffff;
  psVar5 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar2 = *psVar5;
    psVar5 = psVar5 + 1;
  } while (sVar2 != 0);
  plVar6 = (longlong *)(param_1 + 0x148);
  FUN_140001710(plVar6,param_2,~uVar4 - 1);
  FUN_140002aa0(plVar6,L"_server",7);
  if (7 < *(ulonglong *)(param_1 + 0x160)) {
    plVar6 = (longlong *)*plVar6;
  }
  uVar3 = FUN_1402cdf20(DAT_140608268,plVar6);
  *(undefined8 *)(param_1 + 0x170) = uVar3;
  uVar3 = FUN_1402ce0d0(DAT_140608268,local_20,uVar3);
  FUN_140343ec0(param_1 + 0xd8,uVar3);
  if (local_18 != (longlong *)0x0) {
    LOCK();
    plVar6 = local_18 + 1;
    *(int *)plVar6 = (int)*plVar6 + -1;
    UNLOCK();
    if ((int)*plVar6 == 0) {
      (**(code **)(*local_18 + 8))(local_18);
      LOCK();
      piVar1 = (int *)((longlong)local_18 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_18 + 0x10))(local_18);
      }
    }
  }
  return *(longlong *)(param_1 + 0x170) != 0;
}



undefined8 *
FUN_1402ca190(undefined8 *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = FUN_1402c9710(param_2);
  *param_1 = 0;
  param_1[1] = uVar1;
  *(undefined1 *)(param_1 + 3) = 0;
  if ((undefined1 *)((longlong)param_1 + 0x19) != (undefined1 *)0x0) {
    *(undefined1 *)((longlong)param_1 + 0x19) =
         *(undefined1 *)((ulonglong)*(byte *)(param_2 + 0x18) + 0x19 + param_2);
  }
  param_1[4] = *(undefined8 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 5) = *(undefined4 *)(param_2 + 0x28);
  param_1[6] = 0;
  param_1[7] = 0;
  if (*(longlong *)(param_2 + 0x20) != 0) {
    FUN_1402ca370(param_2,param_1,param_3,param_4,uVar2);
    FUN_140296160(param_1);
  }
  return param_1;
}



undefined8 * FUN_1402ca220(undefined8 *param_1)

{
  longlong lVar1;
  longlong lVar2;
  undefined **ppuVar3;
  
  ppuVar3 = (undefined **)&DAT_14049ab70;
  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 == &MBISingleton<>::vftable_meta_ptr) {
    ppuVar3 = (undefined **)&UNK_14049aca8;
  }
  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_1402ca2a0(longlong *param_1,longlong *param_2)

{
  byte *pbVar1;
  byte *pbVar2;
  longlong *plVar3;
  bool bVar4;
  
  if (param_2 == (longlong *)0x0) {
    pbVar2 = (byte *)0x0;
  }
  else {
    pbVar2 = (byte *)(param_2 + 3);
  }
  if (param_1 == (longlong *)0x0) {
    plVar3 = (longlong *)0x0;
  }
  else {
    plVar3 = param_1 + 3;
  }
  bVar4 = (char)*plVar3 == '\0';
  pbVar1 = (byte *)((ulonglong)bVar4 + 1 + (longlong)plVar3);
  if (pbVar1 != (byte *)0x0) {
    *pbVar1 = pbVar2[(ulonglong)*pbVar2 + 1];
  }
  if (*param_1 != 0) {
    FUN_1402c6290(param_1);
  }
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  *param_2 = 0;
  param_2[1] = 0;
  param_1[4] = param_2[4];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_2[4] = 0;
  *(int *)(param_1 + 5) = (int)param_2[5];
  *(bool *)plVar3 = bVar4;
  return;
}



void FUN_1402ca370(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  undefined8 *puVar10;
  longlong *plVar11;
  ulonglong uVar12;
  char *local_res20;
  longlong *plVar13;
  char *local_d8;
  undefined8 *local_d0;
  undefined8 local_c8;
  undefined8 uStack_c0;
  undefined8 local_b8;
  undefined8 uStack_b0;
  undefined4 local_a8;
  undefined4 uStack_a4;
  undefined4 uStack_a0;
  undefined4 uStack_9c;
  undefined4 local_98;
  undefined4 uStack_94;
  undefined4 uStack_90;
  undefined4 uStack_8c;
  undefined8 local_88;
  undefined **local_80 [3];
  undefined **local_68 [5];
  
  local_88 = 0xfffffffffffffffe;
  lVar1 = param_1[1];
  lVar2 = *param_1;
  plVar13 = param_2;
  FUN_140346140(param_2,param_2,lVar1,param_4,param_2,0,0);
  puVar10 = (undefined8 *)param_1[6];
  do {
    if (puVar10 == (undefined8 *)(lVar2 + lVar1 * 8)) {
      return;
    }
    plVar3 = (longlong *)*puVar10;
    while (plVar3 != (longlong *)0x0) {
      uVar12 = 0;
      if ((ulonglong)plVar3[4] < 8) {
        plVar11 = plVar3 + 1;
      }
      else {
        plVar11 = (longlong *)plVar3[1];
      }
      if ((ulonglong)plVar3[4] < 8) {
        puVar7 = (ushort *)(plVar3 + 1);
      }
      else {
        puVar7 = (ushort *)plVar3[1];
      }
      for (; puVar7 != (ushort *)((longlong)plVar11 + plVar3[3] * 2); puVar7 = puVar7 + 1) {
        uVar12 = uVar12 ^ (ulonglong)*puVar7 + (uVar12 >> 2) + uVar12 * 0x40 + 0x9e3779b9;
      }
      uVar4 = param_2[1];
      lVar5 = *param_2;
      plVar11 = (longlong *)*plVar3;
      puVar8 = operator_new(0x40);
      if (puVar8 == (undefined8 *)0x0) {
        local_d8 = (char *)0x0;
        std::exception::exception((exception *)local_80,&local_d8);
        local_80[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_80,(ThrowInfo *)&DAT_1405d3608);
      }
      local_c8 = 0;
      *puVar8 = 0;
      puVar8[1] = uStack_c0;
      puVar8[2] = local_b8;
      puVar8[3] = uStack_b0;
      *(undefined4 *)(puVar8 + 4) = local_a8;
      *(undefined4 *)((longlong)puVar8 + 0x24) = uStack_a4;
      *(undefined4 *)(puVar8 + 5) = uStack_a0;
      *(undefined4 *)((longlong)puVar8 + 0x2c) = uStack_9c;
      *(undefined4 *)(puVar8 + 6) = local_98;
      *(undefined4 *)((longlong)puVar8 + 0x34) = uStack_94;
      *(undefined4 *)(puVar8 + 7) = uStack_90;
      *(undefined4 *)((longlong)puVar8 + 0x3c) = uStack_8c;
      local_d0 = puVar8 + 1;
      if (local_d0 != (undefined8 *)0x0) {
        puVar8[4] = 7;
        puVar8[3] = 0;
        *(undefined2 *)local_d0 = 0;
        FUN_1400015e0(local_d0,plVar3 + 1,0,0xffffffffffffffff,plVar13,puVar8,1,local_d0);
        puVar8[6] = plVar3[6];
        lVar6 = plVar3[7];
        puVar8[7] = lVar6;
        if (lVar6 != 0) {
          LOCK();
          *(int *)(lVar6 + 8) = *(int *)(lVar6 + 8) + 1;
          UNLOCK();
        }
      }
      *puVar8 = *(undefined8 *)(lVar5 + (uVar12 % uVar4) * 8);
      *(undefined8 **)(lVar5 + (uVar12 % uVar4) * 8) = puVar8;
      for (plVar3 = (longlong *)*plVar3; plVar3 != plVar11; plVar3 = (longlong *)*plVar3) {
        puVar9 = operator_new(0x40);
        if (puVar9 == (undefined8 *)0x0) {
          local_res20 = (char *)0x0;
          std::exception::exception((exception *)local_68,&local_res20);
          local_68[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d3608);
        }
        local_c8 = 0;
        *puVar9 = 0;
        puVar9[1] = uStack_c0;
        puVar9[2] = local_b8;
        puVar9[3] = uStack_b0;
        *(undefined4 *)(puVar9 + 4) = local_a8;
        *(undefined4 *)((longlong)puVar9 + 0x24) = uStack_a4;
        *(undefined4 *)(puVar9 + 5) = uStack_a0;
        *(undefined4 *)((longlong)puVar9 + 0x2c) = uStack_9c;
        *(undefined4 *)(puVar9 + 6) = local_98;
        *(undefined4 *)((longlong)puVar9 + 0x34) = uStack_94;
        *(undefined4 *)(puVar9 + 7) = uStack_90;
        *(undefined4 *)((longlong)puVar9 + 0x3c) = uStack_8c;
        local_d0 = puVar9 + 1;
        if (local_d0 != (undefined8 *)0x0) {
          puVar9[4] = 7;
          puVar9[3] = 0;
          *(undefined2 *)local_d0 = 0;
          FUN_1400015e0(local_d0,plVar3 + 1,0,0xffffffffffffffff,plVar13,puVar9,1,local_d0);
          puVar9[6] = plVar3[6];
          lVar5 = plVar3[7];
          puVar9[7] = lVar5;
          if (lVar5 != 0) {
            LOCK();
            *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
            UNLOCK();
          }
        }
        *puVar9 = *puVar8;
        *puVar8 = puVar8;
      }
    }
    puVar10 = puVar10 + 1;
  } while( true );
}



void FUN_1402ca690(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_1402ca6d0(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



void FUN_1402ca6d0(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  plVar3 = (longlong *)param_1[6];
  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);
      }
    }
  }
  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_1402ca750(longlong param_1,ulonglong param_2)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  longlong lVar5;
  ulonglong *puVar6;
  uint uVar7;
  ulonglong *puVar8;
  
  EnterCriticalSection(DAT_140608270);
  lVar1 = *(longlong *)(param_1 + 0x10);
  puVar8 = (ulonglong *)0x0;
  puVar6 = puVar8;
  if (lVar1 != 0) {
    for (puVar2 = *(ulonglong **)
                   (lVar1 + ((param_2 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x20)) * 8);
        (puVar6 = puVar8, puVar2 != (ulonglong *)0x0 &&
        (((int)puVar2[3] != (int)param_2 || (puVar6 = puVar2, *puVar2 != param_2))));
        puVar2 = (ulonglong *)puVar2[2]) {
    }
  }
  if (puVar6 == (ulonglong *)0x0) goto LAB_1402ca837;
  uVar3 = puVar6[2];
  if (uVar3 == 0) {
    uVar7 = (uint)puVar6[3] % *(uint *)(param_1 + 0x20) + 1;
    lVar5 = (longlong)(int)uVar7 << 3;
    do {
      if (*(uint *)(param_1 + 0x20) <= uVar7) break;
      if (*(longlong *)(lVar5 + lVar1) != 0) {
        puVar8 = *(ulonglong **)(lVar5 + lVar1);
      }
      uVar7 = uVar7 + 1;
      lVar5 = lVar5 + 8;
    } while (puVar8 == (ulonglong *)0x0);
  }
  uVar4 = (ulonglong)(uint)puVar6[3] % (ulonglong)*(uint *)(param_1 + 0x20);
  if (puVar6 == *(ulonglong **)(lVar1 + uVar4 * 8)) {
LAB_1402ca827:
    *(ulonglong *)(lVar1 + uVar4 * 8) = uVar3;
  }
  else {
    puVar8 = *(ulonglong **)(lVar1 + uVar4 * 8);
    for (puVar2 = (ulonglong *)puVar8[2]; puVar2 != puVar6; puVar2 = (ulonglong *)puVar2[2]) {
      puVar8 = puVar2;
    }
    if (puVar8 == (ulonglong *)0x0) goto LAB_1402ca827;
    puVar8[2] = uVar3;
  }
  FUN_1402541a0(param_1 + 0x10,puVar6);
LAB_1402ca837:
                    // WARNING: Could not recover jumptable at 0x0001402ca848. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608270);
  return;
}



void FUN_1402ca850(longlong param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 *local_18 [2];
  
  uVar1 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_140608270);
  *param_2 = *(undefined8 *)(param_1 + 0x58);
  local_18[0] = param_2;
  FUN_1402cafb0(param_1 + 0x10,*(undefined8 *)(param_1 + 0x58),local_18,param_4,uVar1,
                *(undefined8 *)(param_1 + 0x58));
  *(longlong *)(param_1 + 0x58) = *(longlong *)(param_1 + 0x58) + 1;
                    // WARNING: Could not recover jumptable at 0x0001402ca8b0. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608270);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402ca8c0(longlong param_1,longlong *param_2)

{
  void **ppvVar1;
  longlong *plVar2;
  short sVar3;
  uint uVar4;
  longlong lVar5;
  ushort *puVar6;
  void *pvVar7;
  undefined8 *puVar8;
  ulonglong uVar9;
  ushort *puVar10;
  ulonglong uVar11;
  longlong *plVar12;
  short *psVar13;
  longlong lVar14;
  undefined1 auStack_178 [32];
  short *local_158;
  void *local_150;
  longlong *local_148;
  undefined8 local_140;
  longlong local_130;
  undefined1 local_128;
  undefined8 local_120;
  longlong local_110;
  undefined1 local_108 [8];
  void *local_100;
  undefined8 local_f8;
  undefined1 local_e0 [24];
  undefined1 local_c8 [32];
  undefined2 local_a8;
  undefined6 uStack_a6;
  undefined8 local_98;
  ulonglong local_90;
  void *local_80;
  undefined8 local_78;
  undefined8 local_70;
  ushort local_58;
  undefined6 uStack_56;
  longlong local_48;
  ulonglong local_40;
  ulonglong local_30;
  
  local_120 = 0xfffffffffffffffe;
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_178;
  if (*param_2 != 0) {
    uVar4 = *(uint *)(*param_2 + 0x154);
    if ((uVar4 != 0xb) && (FUN_1402c5f70(), uVar4 < 10)) {
      lVar14 = (longlong)(int)uVar4 * 0x38 + 0x60 + param_1;
      local_130 = lVar14;
      FUN_14034ed40();
      local_128 = 1;
      local_158 = (short *)(*(longlong *)(*param_2 + 0x10) + 0x38);
      if (7 < *(ulonglong *)(*(longlong *)(*param_2 + 0x10) + 0x50)) {
        local_158 = *(short **)local_158;
      }
      local_40 = 7;
      uVar11 = 0;
      local_48 = 0;
      local_58 = 0;
      uVar9 = 0xffffffffffffffff;
      psVar13 = local_158;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar3 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar3 != 0);
      FUN_140001710(&local_58,local_158,~uVar9 - 1);
      plVar2 = (longlong *)((longlong)(int)uVar4 * 0x40 + 0x290 + param_1);
      if (plVar2[4] == 0) {
        local_110 = 0;
      }
      else {
        puVar10 = &local_58;
        if (7 < local_40) {
          puVar10 = (ushort *)CONCAT62(uStack_56,local_58);
        }
        puVar6 = &local_58;
        if (7 < local_40) {
          puVar6 = (ushort *)CONCAT62(uStack_56,local_58);
        }
        for (; puVar6 != puVar10 + local_48; puVar6 = puVar6 + 1) {
          uVar11 = uVar11 ^ (uVar11 >> 2) + uVar11 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar6;
        }
        local_110 = FUN_1402cb0b0(*plVar2 + (uVar11 % (ulonglong)plVar2[1]) * 8,&local_58);
      }
      lVar5 = local_110;
      if (7 < local_40) {
        operator_delete((void *)CONCAT62(uStack_56,local_58));
      }
      local_40 = 7;
      local_48 = 0;
      local_58 = 0;
      if (lVar5 == 0) {
        local_150 = (void *)0x0;
        local_148 = (longlong *)0x0;
        local_140 = 0;
        FUN_1402d8da0(&local_150);
        if (local_148 != (longlong *)0x0) {
          *local_148 = *param_2;
          lVar5 = param_2[1];
          local_148[1] = lVar5;
          if (lVar5 != 0) {
            LOCK();
            *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
            UNLOCK();
            lVar14 = local_130;
          }
        }
        plVar12 = local_148 + 2;
        local_148 = plVar12;
        puVar8 = (undefined8 *)FUN_1402cb060(local_108,&local_158,&local_150);
        ppvVar1 = (void **)(puVar8 + 1);
        local_90 = 7;
        local_98 = 0;
        local_a8 = 0;
        uVar11 = 0xffffffffffffffff;
        psVar13 = (short *)*puVar8;
        do {
          if (uVar11 == 0) break;
          uVar11 = uVar11 - 1;
          sVar3 = *psVar13;
          psVar13 = psVar13 + 1;
        } while (sVar3 != 0);
        FUN_140001710(&local_a8,(short *)*puVar8,~uVar11 - 1);
        local_80 = (void *)0x0;
        local_78 = 0;
        local_70 = 0;
        if (&local_80 != ppvVar1) {
          local_80 = *ppvVar1;
          local_78 = puVar8[2];
          local_70 = puVar8[3];
          *ppvVar1 = (void *)0x0;
          puVar8[2] = 0;
          puVar8[3] = 0;
        }
        if (plVar2[4] == 0) {
          FUN_1402cb410(plVar2,local_c8,&local_a8);
        }
        else {
          FUN_1402cb2c0(plVar2,local_e0,&local_a8,&local_a8);
        }
        if (local_80 != (void *)0x0) {
          FUN_1402ce6b0(local_80,local_78);
          operator_delete(local_80);
        }
        local_80 = (void *)0x0;
        local_78 = 0;
        local_70 = 0;
        if (7 < local_90) {
          operator_delete((void *)CONCAT62(uStack_a6,local_a8));
        }
        local_90 = 7;
        local_98 = 0;
        local_a8 = 0;
        if (local_100 != (void *)0x0) {
          FUN_1402ce6b0(local_100,local_f8);
          operator_delete(local_100);
        }
        pvVar7 = local_150;
        if (local_150 != (void *)0x0) {
          FUN_1402ce6b0(local_150,plVar12);
          operator_delete(pvVar7);
        }
      }
      else {
        FUN_1402caf30(lVar5 + 0x30,param_2);
      }
      FUN_14034edd0(lVar14);
    }
  }
  return;
}



void thunk_FUN_1402cac40(void)

{
  FUN_1402cac40();
  return;
}



void FUN_1402cac40(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  if (param_1[5] != 0) {
    FUN_1402ce6b0(param_1[5],param_1[6],param_3,param_4,0xfffffffffffffffe);
    operator_delete((void *)param_1[5]);
  }
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 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;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1402cacb0(longlong param_1,undefined8 *param_2,uint param_3,short *param_4)

{
  int *piVar1;
  short sVar2;
  ushort uVar3;
  ushort *puVar4;
  ulonglong uVar5;
  ushort *puVar6;
  longlong *plVar7;
  short *psVar8;
  longlong lVar9;
  longlong *plVar10;
  longlong lVar11;
  undefined1 auStack_e8 [32];
  undefined4 local_c8;
  longlong *local_c0;
  longlong *local_b8;
  longlong local_b0;
  longlong local_a8;
  longlong local_a0;
  longlong local_98;
  undefined1 local_90;
  undefined8 local_88;
  undefined8 *local_80;
  ushort local_78;
  undefined6 uStack_76;
  longlong local_68;
  ulonglong local_60;
  ulonglong local_50;
  
  local_88 = 0xfffffffffffffffe;
  local_50 = DAT_1405d84f0 ^ (ulonglong)auStack_e8;
  plVar7 = (longlong *)0x0;
  local_c8 = 0;
  local_c0 = (longlong *)0x0;
  local_b8 = (longlong *)0x0;
  if (param_3 == 0xb) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else if (param_3 < 10) {
    local_a0 = (longlong)(int)param_3;
    lVar11 = local_a0 * 0x38 + 0x60 + param_1;
    local_b0 = param_1;
    local_98 = lVar11;
    local_80 = param_2;
    FUN_14034ed40();
    local_90 = 1;
    local_60 = 7;
    local_68 = 0;
    local_78 = 0;
    uVar5 = 0xffffffffffffffff;
    psVar8 = param_4;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      sVar2 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar2 != 0);
    FUN_140001710(&local_78,param_4,~uVar5 - 1);
    lVar9 = local_a0 * 0x40;
    if (*(longlong *)(lVar9 + 0x2b0 + local_b0) == 0) {
      local_a8 = 0;
    }
    else {
      puVar6 = &local_78;
      if (7 < local_60) {
        puVar6 = (ushort *)CONCAT62(uStack_76,local_78);
      }
      puVar4 = &local_78;
      plVar10 = plVar7;
      if (7 < local_60) {
        puVar4 = (ushort *)CONCAT62(uStack_76,local_78);
      }
      for (; puVar4 != puVar6 + local_68; puVar4 = puVar4 + 1) {
        uVar3 = *puVar4;
        plVar10 = (longlong *)
                  ((ulonglong)plVar10 ^
                  ((ulonglong)plVar10 >> 2) + (longlong)plVar10 * 0x40 + 0x9e3779b9 +
                  (ulonglong)uVar3);
      }
      local_a8 = FUN_1402cb0b0(*(longlong *)(lVar9 + 0x290 + local_b0) +
                               ((ulonglong)plVar10 % *(ulonglong *)(lVar9 + 0x298 + local_b0)) * 8,
                               &local_78);
    }
    lVar9 = local_a8;
    if (7 < local_60) {
      operator_delete((void *)CONCAT62(uStack_76,local_78));
    }
    local_60 = 7;
    local_68 = 0;
    local_78 = 0;
    plVar10 = plVar7;
    if (lVar9 != 0) {
      if (*(longlong *)(lVar9 + 0x30) == *(longlong *)(lVar9 + 0x38)) {
        *param_2 = 0;
        param_2[1] = 0;
        local_c8 = 1;
        FUN_14034edd0(lVar11);
        return param_2;
      }
      FUN_140343ec0(&local_c0,*(undefined8 *)(lVar9 + 0x30));
      FUN_140333a10(*(longlong *)(lVar9 + 0x30) + 0x10,*(undefined8 *)(lVar9 + 0x38));
      FUN_1402ce6b0(*(longlong *)(lVar9 + 0x38) + -0x10);
      *(longlong *)(lVar9 + 0x38) = *(longlong *)(lVar9 + 0x38) + -0x10;
      plVar7 = local_c0;
      plVar10 = local_b8;
    }
    *param_2 = plVar7;
    param_2[1] = plVar10;
    plVar7 = (longlong *)0x0;
    if (plVar10 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar10 + 1) = (int)plVar10[1] + 1;
      UNLOCK();
      plVar7 = local_b8;
      lVar11 = local_98;
    }
    local_c8 = 1;
    FUN_14034edd0(lVar11);
    plVar10 = local_b8;
    if (plVar7 != (longlong *)0x0) {
      LOCK();
      plVar7 = plVar7 + 1;
      *(int *)plVar7 = (int)*plVar7 + -1;
      UNLOCK();
      if ((int)*plVar7 == 0) {
        (**(code **)(*local_b8 + 8))(local_b8);
        LOCK();
        piVar1 = (int *)((longlong)plVar10 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_b8 + 0x10))();
        }
      }
    }
  }
  else {
    *param_2 = 0;
    param_2[1] = 0;
  }
  return param_2;
}



void FUN_1402caf20(void)

{
                    // WARNING: Could not recover jumptable at 0x0001402caf27. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608270);
  return;
}



void FUN_1402caf30(ulonglong *param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  longlong lVar3;
  
  puVar1 = (undefined8 *)param_1[1];
  if ((param_2 < puVar1) && (puVar2 = (undefined8 *)*param_1, puVar2 <= param_2)) {
    if (puVar1 == (undefined8 *)param_1[2]) {
      FUN_1402d8da0(param_1);
    }
    param_2 = (undefined8 *)
              (((longlong)param_2 - (longlong)puVar2 & 0xfffffffffffffff0U) + *param_1);
  }
  else if (puVar1 == (undefined8 *)param_1[2]) {
    FUN_1402d8da0(param_1);
  }
  puVar1 = (undefined8 *)param_1[1];
  if (puVar1 != (undefined8 *)0x0) {
    *puVar1 = *param_2;
    lVar3 = param_2[1];
    puVar1[1] = lVar3;
    if (lVar3 != 0) {
      LOCK();
      *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
      UNLOCK();
    }
  }
  param_1[1] = param_1[1] + 0x10;
  return;
}



ulonglong * FUN_1402cafb0(longlong *param_1,ulonglong param_2,ulonglong *param_3)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  uVar1 = (param_2 & 0xffffffff) % uVar4;
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[2]) {
      if (((int)puVar3[3] == (int)param_2) && (*puVar3 == param_2)) {
        puVar3[1] = *param_3;
        return puVar3;
      }
    }
  }
  puVar3 = (ulonglong *)FUN_1402cb580(param_1,param_2,uVar1,param_2 & 0xffffffff);
  puVar3[1] = *param_3;
  return puVar3;
}



undefined8 * FUN_1402cb060(undefined8 *param_1,undefined8 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_1402cb790(param_1 + 1,param_3);
  return param_1;
}



void FUN_1402cb090(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_1402cb190();
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402cb0f9)

longlong * FUN_1402cb0b0(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_1402cb138;
      }
      puVar5 = puVar5 + 1;
      puVar4 = puVar4 + 1;
    }
    uVar6 = 0;
LAB_1402cb138:
    if (uVar6 == 0) {
      if (uVar2 <= uVar1) {
        uVar6 = (uint)(uVar1 != uVar2);
        goto LAB_1402cb14d;
      }
    }
    else {
LAB_1402cb14d:
      if (uVar6 == 0) {
        return param_1;
      }
    }
    param_1 = (longlong *)*param_1;
    if (param_1 == (longlong *)0x0) {
      return (longlong *)0x0;
    }
  } while( true );
}



void FUN_1402cb190(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong lVar8;
  undefined8 *puVar9;
  
  puVar9 = (undefined8 *)*param_1;
  puVar3 = puVar9 + param_1[1];
  for (; puVar9 != puVar3; puVar9 = puVar9 + 1) {
    puVar4 = (undefined8 *)*puVar9;
    *puVar9 = 0;
    while (puVar4 != (undefined8 *)0x0) {
      puVar5 = (undefined8 *)*puVar4;
      lVar8 = puVar4[6];
      if (lVar8 != 0) {
        lVar6 = puVar4[7];
        for (; lVar8 != lVar6; lVar8 = lVar8 + 0x10) {
          plVar7 = *(longlong **)(lVar8 + 8);
          if (plVar7 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar7 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              (**(code **)(*plVar7 + 8))(plVar7);
              LOCK();
              piVar2 = (int *)((longlong)plVar7 + 0xc);
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              if (*piVar2 == 0) {
                (**(code **)(*plVar7 + 0x10))(plVar7);
              }
            }
          }
        }
        operator_delete((void *)puVar4[6]);
      }
      puVar4[6] = 0;
      puVar4[7] = 0;
      puVar4[8] = 0;
      if (7 < (ulonglong)puVar4[4]) {
        operator_delete((void *)puVar4[1]);
      }
      puVar4[4] = 7;
      puVar4[3] = 0;
      *(undefined2 *)(puVar4 + 1) = 0;
      operator_delete(puVar4);
      puVar4 = puVar5;
    }
  }
  operator_delete((void *)*param_1);
  *param_1 = 0;
  return;
}



longlong * FUN_1402cb2c0(longlong *param_1,longlong *param_2,undefined8 param_3,longlong param_4)

{
  undefined8 *puVar1;
  char cVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  longlong *local_48;
  undefined8 *local_40;
  undefined2 local_38;
  
  uVar7 = 0xfffffffffffffffe;
  uVar3 = FUN_14015afa0(param_3);
  puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
  lVar4 = FUN_1402cb0b0(puVar6,param_3);
  if (lVar4 == 0) {
    local_40 = (undefined8 *)0x0;
    local_38 = 0;
    local_48 = param_1;
    FUN_1402cba10(&local_48);
    puVar1 = local_40;
    puVar5 = local_40 + 1;
    if (puVar5 != (undefined8 *)0x0) {
      local_40[4] = 7;
      local_40[3] = 0;
      *(undefined2 *)puVar5 = 0;
      FUN_1400015e0(puVar5,param_4,0,0xffffffffffffffff,uVar7,puVar5);
      FUN_1402cb790(puVar1 + 6,param_4 + 0x28);
    }
    local_38 = CONCAT11(1,(undefined1)local_38);
    cVar2 = FUN_1402cb6e0(param_1);
    if (cVar2 != '\0') {
      puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
    }
    *puVar1 = *puVar6;
    *puVar6 = puVar1;
    param_1[4] = param_1[4] + 1;
    puVar5 = (undefined8 *)param_1[6];
    if (puVar6 < (undefined8 *)param_1[6]) {
      puVar5 = puVar6;
    }
    param_1[6] = (longlong)puVar5;
    *param_2 = (longlong)puVar6;
    param_2[1] = (longlong)puVar1;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)puVar6;
    param_2[1] = lVar4;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



longlong * FUN_1402cb410(longlong *param_1,longlong *param_2,undefined8 param_3)

{
  undefined8 **ppuVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined8 **ppuVar6;
  undefined8 *local_res8;
  undefined8 *local_res10;
  undefined8 uVar7;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  uVar7 = 0xfffffffffffffffe;
  local_38 = (undefined8 *)0x0;
  local_30 = 0;
  local_40 = param_1;
  FUN_1402cba10(&local_40);
  puVar3 = local_38;
  puVar2 = local_38 + 1;
  local_res8 = puVar2;
  local_res10 = puVar2;
  if (puVar2 != (undefined8 *)0x0) {
    local_38[4] = 7;
    local_38[3] = 0;
    *(undefined2 *)puVar2 = 0;
    FUN_1400015e0(puVar2,param_3,0,0xffffffffffffffff,uVar7);
    FUN_1402cb790(puVar3 + 6);
  }
  local_30 = CONCAT11(1,(undefined1)local_30);
  uVar4 = FUN_14015afa0(puVar2);
  if (*param_1 == 0) {
    local_res8 = (undefined8 *)FUN_1402c9710(param_1,1);
    ppuVar1 = (undefined8 **)(param_1 + 1);
    ppuVar6 = &local_res8;
    if (local_res8 <= *ppuVar1) {
      ppuVar6 = ppuVar1;
    }
    *ppuVar1 = *ppuVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else {
    local_res10 = (undefined8 *)0x1;
    if ((ulonglong)param_1[7] < 2) {
      local_res8 = (undefined8 *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      lVar5 = FUN_1402c9710(param_1);
      if (lVar5 != param_1[1]) {
        FUN_1402cb840(param_1);
      }
    }
  }
  puVar2 = (undefined8 *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar3 = *puVar2;
  *puVar2 = puVar3;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)puVar2;
  *param_2 = (longlong)puVar2;
  param_2[1] = (longlong)puVar3;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



undefined8 *
FUN_1402cb580(longlong *param_1,undefined8 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined8 *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_1402cb647;
      lVar7 = uVar6 << 5;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402cb647:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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 = (undefined8 *)param_1[8];
  if (puVar2 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = puVar2[2];
  *puVar2 = param_2;
  *(undefined4 *)(puVar2 + 3) = param_4;
  param_1[1] = param_1[1] + 1;
  puVar2[2] = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined8 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_1402cddb0(param_1);
    FUN_140253ff0(param_1,uVar4);
  }
  return puVar2;
}



undefined8 FUN_1402cb6e0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_1402cb840(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_1402cb750(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_1402cac40(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



longlong * FUN_1402cb790(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  code *pcVar1;
  longlong *plVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  uVar4 = param_2[1] - *param_2 >> 4;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  if (uVar4 != 0) {
    if (0xfffffffffffffff < uVar4) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      plVar2 = (longlong *)(*pcVar1)();
      return plVar2;
    }
    lVar3 = FUN_1402d9030(uVar4);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    param_1[2] = uVar4 * 0x10 + lVar3;
    lVar3 = FUN_1402db170(*param_2,param_2[1],lVar3,param_4,uVar5);
    param_1[1] = lVar3;
  }
  return param_1;
}



void FUN_1402cb840(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  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_140346140(&local_50);
  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;
    }
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  lVar6 = FUN_1402961d0(param_1);
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_1402cb190(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_1402cb190(&local_50);
  }
  return;
}



void FUN_1402cba10(longlong param_1)

{
  undefined8 *puVar1;
  char *local_res8 [4];
  undefined **local_78 [5];
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  undefined8 local_38;
  undefined8 uStack_30;
  undefined8 local_28;
  undefined8 uStack_20;
  undefined8 local_18;
  undefined8 uStack_10;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1402cac40(*(longlong *)(param_1 + 8) + 8);
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar1 = operator_new(0x50);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar1;
    *puVar1 = 0;
    puVar1[1] = uStack_50;
    puVar1[2] = local_48;
    puVar1[3] = uStack_40;
    puVar1[4] = local_38;
    puVar1[5] = uStack_30;
    puVar1[6] = local_28;
    puVar1[7] = uStack_20;
    puVar1[8] = local_18;
    puVar1[9] = uStack_10;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_78,local_res8);
  local_78[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d3608);
}



void FUN_1402cbae0(longlong param_1)

{
  ulonglong uVar1;
  code *pcVar2;
  
  uVar1 = *(ulonglong *)(param_1 + 0x110);
  if (uVar1 != 0) {
    if ((uVar1 & 1) == 0) {
      pcVar2 = *(code **)(uVar1 & 0xfffffffffffffffe);
      if (pcVar2 != (code *)0x0) {
        (*pcVar2)(param_1 + 0x118,param_1 + 0x118,2,pcVar2,0xfffffffffffffffe);
      }
    }
    *(undefined8 *)(param_1 + 0x110) = 0;
  }
  uVar1 = *(ulonglong *)(param_1 + 0xe8);
  if (uVar1 != 0) {
    if ((uVar1 & 1) == 0) {
      if (*(code **)(uVar1 & 0xfffffffffffffffe) != (code *)0x0) {
        (**(code **)(uVar1 & 0xfffffffffffffffe))(param_1 + 0xf0,param_1 + 0xf0,2);
      }
    }
    *(undefined8 *)(param_1 + 0xe8) = 0;
  }
  uVar1 = *(ulonglong *)(param_1 + 0xc0);
  if (uVar1 != 0) {
    if ((uVar1 & 1) == 0) {
      if (*(code **)(uVar1 & 0xfffffffffffffffe) != (code *)0x0) {
        (**(code **)(uVar1 & 0xfffffffffffffffe))(param_1 + 200,param_1 + 200,2);
      }
    }
    *(undefined8 *)(param_1 + 0xc0) = 0;
  }
  if (*(void **)(param_1 + 0xa0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xa0));
  }
  *(undefined8 *)(param_1 + 0xa0) = 0;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  if (*(void **)(param_1 + 0x80) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x80));
  }
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  if (*(void **)(param_1 + 0x60) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x60));
  }
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  return;
}



void FUN_1402cbc20(longlong *param_1,int param_2,undefined4 param_3,undefined1 param_4)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong *plVar4;
  
  *(undefined4 *)(param_1 + 0xb) = param_3;
  if (((int)param_1[1] == -1) || ((int)param_1[1] == 0)) {
    *(undefined1 *)(param_1 + 5) = 0;
    *(int *)(param_1 + 1) = param_2;
    param_1[2] = param_1[6];
    param_1[4] = param_1[6];
    *(undefined4 *)(param_1 + 3) = 0;
    FUN_1402cc2c0();
    return;
  }
  *(undefined1 *)(param_1 + 5) = param_4;
  *(int *)(param_1 + 1) = param_2;
  if ((((param_2 != 0) && (lVar2 = *(longlong *)(*(longlong *)(*param_1 + 0x10) + 0xd8), lVar2 != 0)
       ) && (iVar3 = param_2 + -1, -1 < iVar3)) &&
     ((iVar3 < (int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4) &&
      (lVar1 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10), lVar1 != 0)))) {
    if (((*(int *)((longlong)param_1 + 0xc) == 0) ||
        ((lVar2 == 0 || (iVar3 = *(int *)((longlong)param_1 + 0xc) + -1, iVar3 < 0)))) ||
       ((int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4) <= iVar3)) {
      lVar2 = 0;
    }
    else {
      lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar3 * 0x10);
    }
    *(int *)((longlong)param_1 + 0xc) = param_2;
    param_1[2] = param_1[6];
    param_1[4] = param_1[6];
    *(undefined4 *)(param_1 + 3) = 0;
    FUN_1402cc2c0(param_1);
    if (lVar2 != 0) {
      plVar4 = (longlong *)(lVar1 + 0x1b8);
      if (7 < *(ulonglong *)(lVar1 + 0x1d0)) {
        plVar4 = (longlong *)*plVar4;
      }
      lVar2 = FUN_1402c7830(lVar2,plVar4);
      if (lVar2 == 0) {
        *(undefined4 *)(param_1 + 3) = 0;
        param_1[4] = 0;
        return;
      }
      *(undefined4 *)(param_1 + 3) = *(undefined4 *)(lVar2 + 0x30);
      param_1[4] = (longlong)((double)*(float *)(lVar2 + 0x28) + (double)param_1[2]);
    }
  }
  return;
}



void FUN_1402cbda0(longlong *param_1,double param_2,double param_3)

{
  double dVar1;
  longlong lVar2;
  int iVar3;
  char **ppcVar4;
  longlong lVar5;
  ulonglong uVar6;
  int iVar7;
  undefined8 *puVar8;
  float fVar9;
  float fVar10;
  char *local_res8;
  undefined **local_40 [5];
  
  param_1[6] = (longlong)param_2;
  iVar3 = (int)param_1[1];
  if (iVar3 == -1) {
    param_1[7] = (longlong)param_2;
    *(undefined4 *)((longlong)param_1 + 0x54) = 1;
  }
  else {
    if (*(int *)((longlong)param_1 + 0x54) == 2) {
      param_1[2] = (longlong)(param_3 + (double)param_1[2]);
    }
    else {
      lVar5 = *param_1;
      if (*(longlong *)(lVar5 + 0x10) != 0) {
        if ((((iVar3 != 0) &&
             (lVar2 = *(longlong *)(*(longlong *)(lVar5 + 0x10) + 0xd8), lVar2 != 0)) &&
            (iVar7 = iVar3 + -1, -1 < iVar7)) &&
           ((iVar7 < (int)(*(longlong *)(lVar2 + 0x30) - *(longlong *)(lVar2 + 0x28) >> 4) &&
            (lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0x28) + (longlong)iVar7 * 0x10), lVar2 != 0
            )))) {
          if (param_2 < (double)param_1[2]) {
            param_1[2] = 0;
          }
          dVar1 = (double)param_1[2];
          fVar10 = *(float *)(param_1 + 3);
          *(float *)(param_1 + 9) =
               ((float)((double)param_1[7] - dVar1) + fVar10) * *(float *)(param_1 + 8);
          fVar9 = ((float)(param_2 - dVar1) + fVar10) * *(float *)(param_1 + 8);
          *(float *)((longlong)param_1 + 0x4c) = fVar9;
          uVar6 = (ulonglong)local_res8 >> 0x20;
          local_res8 = (char *)(uVar6 << 0x20);
          ppcVar4 = &local_res8;
          if (0.0 <= fVar9) {
            ppcVar4 = (char **)((longlong)param_1 + 0x4c);
          }
          *(undefined4 *)((longlong)param_1 + 0x4c) = *(undefined4 *)ppcVar4;
          local_res8 = (char *)(uVar6 << 0x20);
          ppcVar4 = (char **)(param_1 + 9);
          if (*(float *)((longlong)param_1 + 0x4c) < *(float *)(param_1 + 9) ||
              *(float *)((longlong)param_1 + 0x4c) == *(float *)(param_1 + 9)) {
            ppcVar4 = (char **)((longlong)param_1 + 0x4c);
          }
          if (*(float *)ppcVar4 <= 0.0 && *(float *)ppcVar4 != 0.0) {
            ppcVar4 = &local_res8;
          }
          *(float *)(param_1 + 9) = *(float *)ppcVar4;
          if ((char)param_1[5] == '\0') {
            puVar8 = (undefined8 *)(lVar5 + 0x68);
            if (7 < *(ulonglong *)(lVar5 + 0x80)) {
              puVar8 = (undefined8 *)*puVar8;
            }
            iVar3 = FUN_1402c73d0(lVar2,*(undefined4 *)((longlong)param_1 + 0x4c),(int)param_1[0xb],
                                  puVar8);
            FUN_1402cc7a0(param_1,*(undefined4 *)((longlong)param_1 + 0x4c),lVar2);
            if ((iVar3 == -1) && (param_1[0x18] != 0)) {
              uVar6 = param_1[0x18];
              if (uVar6 == 0) {
                local_res8 = "call to empty boost::function";
                std::exception::exception((exception *)local_40,&local_res8);
                local_40[0] = boost::bad_function_call::vftable;
                FUN_1402bef70(local_40);
              }
              (**(code **)((uVar6 & 0xfffffffffffffffe) + 8))(param_1 + 0x19,param_1);
            }
            FUN_1402cc860(param_1,*(undefined4 *)((longlong)param_1 + 0x4c),lVar2);
            if (iVar3 == -1) {
              if ((char)param_1[10] == '\0') {
                *(undefined4 *)((longlong)param_1 + 0x54) = 1;
              }
              else {
                *(undefined4 *)(param_1 + 3) = 0;
                param_1[2] = (longlong)param_2;
                FUN_1402cc2c0(param_1);
              }
            }
          }
          else if (dVar1 <= param_2) {
            if ((double)param_1[4] <= param_2 && param_2 != (double)param_1[4]) {
              *(undefined1 *)(param_1 + 5) = 0;
              lVar5 = FUN_1402c9f20(*(undefined8 *)(lVar5 + 0x10),iVar3,iVar3,lVar5,
                                    0xfffffffffffffffe);
              if (lVar5 == 0) {
                return;
              }
              iVar7 = (int)(*(float *)(lVar5 + 8) * 30.0);
              iVar3 = 0;
              if ((iVar7 < *(int *)(lVar5 + 0x50)) &&
                 (iVar7 = *(int *)(*(longlong *)(lVar5 + 0x58 + (longlong)(int)param_1[0xb] * 0x10)
                                  + (longlong)iVar7 * 4), iVar7 != 0)) {
                iVar3 = iVar7;
              }
              *(float *)(lVar5 + 8) = fVar10;
              if (*(float *)(lVar5 + 0x1e0) < fVar10) {
                *(float *)(lVar5 + 8) = *(float *)(lVar5 + 0x1e0);
                iVar3 = -1;
              }
              FUN_1402cc7a0(param_1,*(undefined4 *)((longlong)param_1 + 0x4c),lVar5);
              if ((iVar3 == -1) && (param_1[0x18] != 0)) {
                uVar6 = param_1[0x18];
                if (uVar6 == 0) {
                  local_res8 = "call to empty boost::function";
                  std::exception::exception((exception *)local_40,&local_res8);
                  local_40[0] = boost::bad_function_call::vftable;
                  uVar6 = FUN_1402bef70(local_40);
                }
                (**(code **)((uVar6 & 0xfffffffffffffffe) + 8))(param_1 + 0x19,param_1);
              }
              FUN_1402cc860(param_1,*(undefined4 *)((longlong)param_1 + 0x4c),lVar5);
            }
          }
          else {
            *(undefined1 *)(param_1 + 5) = 0;
          }
          param_1[7] = (longlong)param_2;
          return;
        }
        param_1[7] = (longlong)param_2;
        *(undefined4 *)((longlong)param_1 + 0x54) = 1;
        return;
      }
    }
    param_1[7] = (longlong)param_2;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

float * FUN_1402cc100(longlong *param_1,float *param_2,float param_3,longlong param_4)

{
  float *pfVar1;
  int iVar2;
  longlong lVar3;
  undefined1 auStack_78 [32];
  float local_58;
  float local_54;
  float local_50;
  float local_48;
  float local_44;
  float local_40;
  float local_38;
  float local_34;
  float local_30;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_78;
  local_38 = 0.0;
  local_34 = 0.0;
  local_30 = 0.0;
  if ((char)param_1[5] == '\0') {
    if (*(int *)((longlong)param_1 + 0x54) == 0) {
      if (((((int)param_1[1] != 0) &&
           (lVar3 = *(longlong *)(*(longlong *)(*param_1 + 0x10) + 0xd8), lVar3 != 0)) &&
          (iVar2 = (int)param_1[1] + -1, -1 < iVar2)) &&
         ((iVar2 < (int)(*(longlong *)(lVar3 + 0x30) - *(longlong *)(lVar3 + 0x28) >> 4) &&
          (lVar3 = *(longlong *)(*(longlong *)(lVar3 + 0x28) + (longlong)iVar2 * 0x10), lVar3 != 0))
         )) {
        pfVar1 = (float *)FUN_1402c8260(lVar3,*(undefined4 *)((longlong)param_1 + 0x4c));
        local_48 = *pfVar1;
        local_44 = pfVar1[1];
        local_40 = pfVar1[2];
        pfVar1 = (float *)FUN_1402c8260(lVar3,(int)param_1[9]);
        local_58 = *pfVar1;
        local_54 = pfVar1[1];
        local_50 = pfVar1[2];
        if (1e-06 <= param_3) {
          if (1e-06 <= *(float *)(lVar3 + 0x1e4)) {
            local_30 = param_3 / *(float *)(lVar3 + 0x1e4);
          }
          else {
            local_30 = 1.0;
          }
        }
        else {
          local_30 = 1.0;
        }
        local_38 = (local_58 - local_48) * local_30;
        local_34 = (local_54 - local_44) * local_30;
        local_30 = (local_50 - local_40) * local_30;
        if (param_4 != 0) {
          D3DXVec3TransformNormal(&local_38,&local_38,param_4);
        }
      }
      *param_2 = local_38;
      param_2[1] = local_34;
      param_2[2] = local_30;
    }
    else {
      *param_2 = 0.0;
      param_2[1] = 0.0;
      param_2[2] = 0.0;
    }
  }
  else {
    *param_2 = 0.0;
    param_2[1] = 0.0;
    param_2[2] = 0.0;
  }
  return param_2;
}



void FUN_1402cc2c0(longlong *param_1)

{
  longlong lVar1;
  int iVar2;
  
  if (((((int)param_1[1] != 0) &&
       (lVar1 = *(longlong *)(*(longlong *)(*param_1 + 0x10) + 0xd8), lVar1 != 0)) &&
      (iVar2 = (int)param_1[1] + -1, -1 < iVar2)) &&
     ((iVar2 < (int)(*(longlong *)(lVar1 + 0x30) - *(longlong *)(lVar1 + 0x28) >> 4) &&
      (lVar1 = *(longlong *)(*(longlong *)(lVar1 + 0x28) + (longlong)iVar2 * 0x10), lVar1 != 0)))) {
    FUN_1402cc340(param_1,lVar1);
    FUN_1402cc450(param_1,lVar1);
    FUN_1402cc560(param_1,lVar1);
  }
  return;
}



void FUN_1402cc340(longlong param_1,longlong param_2)

{
  ulonglong *puVar1;
  float fVar2;
  void *_Dst;
  int *piVar3;
  int *piVar4;
  int iVar5;
  int local_res8 [2];
  
  _Dst = *(void **)(param_1 + 0x60);
  puVar1 = (ulonglong *)(param_1 + 0x60);
  if (_Dst != *(void **)(param_1 + 0x68)) {
    memmove(_Dst,*(void **)(param_1 + 0x68),0);
    *(void **)(param_1 + 0x68) = _Dst;
  }
  fVar2 = *(float *)(param_1 + 0x18);
  local_res8[0] = 0;
  if (0 < *(int *)(param_2 + 0x50)) {
    do {
      iVar5 = local_res8[0];
      if ((int)(fVar2 * 30.0) <= local_res8[0]) {
        piVar3 = *(int **)(param_1 + 0x68);
        if ((local_res8 < piVar3) && (piVar4 = (int *)*puVar1, piVar4 <= local_res8)) {
          if (piVar3 == *(int **)(param_1 + 0x70)) {
            FUN_1400556a0(puVar1,1);
          }
          if (*(undefined4 **)(param_1 + 0x68) != (undefined4 *)0x0) {
            **(undefined4 **)(param_1 + 0x68) =
                 *(undefined4 *)(*puVar1 + ((longlong)local_res8 - (longlong)piVar4 >> 2) * 4);
          }
        }
        else {
          if (piVar3 == *(int **)(param_1 + 0x70)) {
            FUN_1400556a0(puVar1,1);
          }
          if (*(int **)(param_1 + 0x68) != (int *)0x0) {
            **(int **)(param_1 + 0x68) = iVar5;
          }
        }
        *(longlong *)(param_1 + 0x68) = *(longlong *)(param_1 + 0x68) + 4;
      }
      local_res8[0] = iVar5 + 1;
    } while (local_res8[0] < *(int *)(param_2 + 0x50));
  }
  return;
}



void FUN_1402cc450(longlong param_1,longlong param_2)

{
  ulonglong *puVar1;
  float fVar2;
  void *_Dst;
  int *piVar3;
  int *piVar4;
  int iVar5;
  int local_res8 [2];
  
  puVar1 = (ulonglong *)(param_1 + 0x80);
  _Dst = (void *)*puVar1;
  if (_Dst != *(void **)(param_1 + 0x88)) {
    memmove(_Dst,*(void **)(param_1 + 0x88),0);
    *(void **)(param_1 + 0x88) = _Dst;
  }
  fVar2 = *(float *)(param_1 + 0x18);
  local_res8[0] = 0;
  if (0 < *(int *)(param_2 + 0x50)) {
    do {
      iVar5 = local_res8[0];
      if ((int)(fVar2 * 30.0) <= local_res8[0]) {
        piVar3 = *(int **)(param_1 + 0x88);
        if ((local_res8 < piVar3) && (piVar4 = (int *)*puVar1, piVar4 <= local_res8)) {
          if (piVar3 == *(int **)(param_1 + 0x90)) {
            FUN_1400556a0(puVar1,1);
          }
          if (*(undefined4 **)(param_1 + 0x88) != (undefined4 *)0x0) {
            **(undefined4 **)(param_1 + 0x88) =
                 *(undefined4 *)(*puVar1 + ((longlong)local_res8 - (longlong)piVar4 >> 2) * 4);
          }
        }
        else {
          if (piVar3 == *(int **)(param_1 + 0x90)) {
            FUN_1400556a0(puVar1,1);
          }
          if (*(int **)(param_1 + 0x88) != (int *)0x0) {
            **(int **)(param_1 + 0x88) = iVar5;
          }
        }
        *(longlong *)(param_1 + 0x88) = *(longlong *)(param_1 + 0x88) + 4;
      }
      local_res8[0] = iVar5 + 1;
    } while (local_res8[0] < *(int *)(param_2 + 0x50));
  }
  return;
}



void FUN_1402cc560(longlong param_1,longlong param_2)

{
  void *_Dst;
  int *piVar1;
  int *piVar2;
  int iVar3;
  longlong lVar4;
  int local_res8 [2];
  
  _Dst = *(void **)(param_1 + 0xa0);
  if (_Dst != *(void **)(param_1 + 0xa8)) {
    memmove(_Dst,*(void **)(param_1 + 0xa8),0);
    *(void **)(param_1 + 0xa8) = _Dst;
  }
  local_res8[0] = 0;
  iVar3 = (int)(*(longlong *)(param_2 + 0x1a0) - *(longlong *)(param_2 + 0x198) >> 3);
  if (0 < iVar3) {
    if (0 < iVar3) goto LAB_1402cc5dd;
    lVar4 = 0;
    while( true ) {
      iVar3 = local_res8[0];
      if (((*(int *)(lVar4 + 8) == 0) || (*(int *)(lVar4 + 8) == *(int *)(param_1 + 0x58))) &&
         (*(float *)(param_1 + 0x18) <= *(float *)(lVar4 + 0xc) &&
          *(float *)(lVar4 + 0xc) != *(float *)(param_1 + 0x18))) {
        piVar1 = *(int **)(param_1 + 0xa8);
        if ((local_res8 < piVar1) && (piVar2 = *(int **)(param_1 + 0xa0), piVar2 <= local_res8)) {
          if (piVar1 == *(int **)(param_1 + 0xb0)) {
            FUN_1400556a0(param_1 + 0xa0,1);
          }
          if (*(undefined4 **)(param_1 + 0xa8) != (undefined4 *)0x0) {
            **(undefined4 **)(param_1 + 0xa8) =
                 *(undefined4 *)
                  (*(longlong *)(param_1 + 0xa0) +
                  ((longlong)local_res8 - (longlong)piVar2 >> 2) * 4);
          }
        }
        else {
          if (piVar1 == *(int **)(param_1 + 0xb0)) {
            FUN_1400556a0(param_1 + 0xa0,1);
          }
          if (*(int **)(param_1 + 0xa8) != (int *)0x0) {
            **(int **)(param_1 + 0xa8) = iVar3;
          }
        }
        *(longlong *)(param_1 + 0xa8) = *(longlong *)(param_1 + 0xa8) + 4;
      }
      local_res8[0] = iVar3 + 1;
      if ((int)(*(longlong *)(param_2 + 0x1a0) - *(longlong *)(param_2 + 0x198) >> 3) <=
          local_res8[0]) break;
LAB_1402cc5dd:
      lVar4 = *(longlong *)(*(longlong *)(param_2 + 0x198) + (longlong)local_res8[0] * 8);
    }
  }
  return;
}



int FUN_1402cc6e0(longlong param_1,longlong param_2)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  
  iVar3 = 0;
  if (param_2 == 0) {
    return 0;
  }
  piVar1 = *(int **)(param_1 + 0x60);
  if (piVar1 != *(int **)(param_1 + 0x68)) {
    do {
      if (*piVar1 < *(int *)(param_2 + 0x50)) {
        uVar2 = *(uint *)(*(longlong *)(param_2 + 0x58 + (longlong)*(int *)(param_1 + 0x58) * 0x10)
                         + (longlong)*piVar1 * 4);
      }
      else {
        uVar2 = 0;
      }
      if ((uVar2 & 1) != 0) {
        iVar3 = iVar3 + 1;
      }
      piVar1 = piVar1 + 1;
    } while (piVar1 != *(int **)(param_1 + 0x68));
  }
  piVar1 = *(int **)(param_1 + 0x80);
  if (piVar1 != *(int **)(param_1 + 0x88)) {
    do {
      if ((*piVar1 < *(int *)(param_2 + 0x54)) &&
         (0 < *(int *)(*(longlong *)(param_2 + 0xf8 + (longlong)*(int *)(param_1 + 0x58) * 0x10) +
                      (longlong)*piVar1 * 4))) {
        iVar3 = iVar3 + 1;
      }
      piVar1 = piVar1 + 1;
    } while (piVar1 != *(int **)(param_1 + 0x88));
  }
  return iVar3;
}



void FUN_1402cc7a0(longlong param_1,float param_2,longlong param_3)

{
  int iVar1;
  int *_Dst;
  int *_Src;
  int local_res10 [2];
  
  _Dst = *(int **)(param_1 + 0x60);
  if (_Dst != *(int **)(param_1 + 0x68)) {
    _Src = _Dst + 1;
    do {
      iVar1 = *_Dst;
      if (iVar1 < *(int *)(param_3 + 0x50)) {
        local_res10[0] =
             *(int *)(*(longlong *)(param_3 + 0x58 + (longlong)*(int *)(param_1 + 0x58) * 0x10) +
                     (longlong)iVar1 * 4);
      }
      else {
        local_res10[0] = 0;
      }
      if ((int)(param_2 * 30.0) < iVar1) {
        _Dst = _Dst + 1;
        _Src = _Src + 1;
      }
      else {
        if ((*(ulonglong *)(param_1 + 0xe8) != 0) && (local_res10[0] != 0)) {
          (**(code **)((*(ulonglong *)(param_1 + 0xe8) & 0xfffffffffffffffe) + 8))
                    (param_1 + 0xf0,local_res10);
        }
        memmove(_Dst,_Src,*(longlong *)(param_1 + 0x68) - (longlong)_Src & 0xfffffffffffffffc);
        *(longlong *)(param_1 + 0x68) = *(longlong *)(param_1 + 0x68) + -4;
      }
    } while (_Dst != *(int **)(param_1 + 0x68));
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402cc860(undefined8 *param_1,float param_2,longlong param_3)

{
  longlong lVar1;
  int *_Dst;
  int *_Src;
  undefined1 auStack_a8 [32];
  undefined8 local_88;
  undefined2 local_78;
  undefined6 uStack_76;
  undefined8 local_68;
  ulonglong local_60;
  undefined4 local_50;
  longlong local_48;
  undefined8 local_40;
  ulonglong local_38;
  
  if (param_3 != 0) {
    local_88 = 0xfffffffffffffffe;
    local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
    _Dst = (int *)param_1[0x14];
    if (_Dst != (int *)param_1[0x15]) {
      _Src = _Dst + 1;
      do {
        if ((int)(*(longlong *)(param_3 + 0x1a0) - *(longlong *)(param_3 + 0x198) >> 3) <= *_Dst) {
          return;
        }
        lVar1 = *(longlong *)(*(longlong *)(param_3 + 0x198) + (longlong)*_Dst * 8);
        if (lVar1 == 0) {
          return;
        }
        if (param_2 < *(float *)(lVar1 + 0xc)) {
          _Dst = _Dst + 1;
          _Src = _Src + 1;
        }
        else {
          if (param_1[0x22] != 0) {
            local_60 = 7;
            local_68 = 0;
            local_78 = 0;
            local_50 = 0;
            local_40 = *param_1;
            local_48 = lVar1;
            (**(code **)((param_1[0x22] & 0xfffffffffffffffe) + 8))(param_1 + 0x23,&local_78);
            if (7 < local_60) {
              operator_delete((void *)CONCAT62(uStack_76,local_78));
            }
          }
          memmove(_Dst,_Src,param_1[0x15] - (longlong)_Src & 0xfffffffffffffffc);
          param_1[0x15] = param_1[0x15] + -4;
        }
      } while (_Dst != (int *)param_1[0x15]);
    }
  }
  return;
}



undefined8
FUN_1402cc9c0(undefined8 param_1,ulonglong *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  ulonglong local_30;
  ulonglong local_28;
  ulonglong local_20;
  ulonglong local_18;
  ulonglong local_10;
  
  local_30 = 0;
  uVar1 = *param_2;
  if (uVar1 != 0) {
    local_30 = uVar1;
    if ((uVar1 & 1) == 0) {
      (**(code **)(uVar1 & 0xfffffffffffffffe))(param_2 + 1,&local_28,0,param_4,0xfffffffffffffffe);
    }
    else {
      local_28 = param_2[1];
      local_20 = param_2[2];
      local_18 = param_2[3];
      local_10 = param_2[4];
    }
  }
  FUN_1402cca70(&local_30,param_1);
  if (((local_30 != 0) && ((local_30 & 1) == 0)) &&
     (*(code **)(local_30 & 0xfffffffffffffffe) != (code *)0x0)) {
    (**(code **)(local_30 & 0xfffffffffffffffe))(&local_28,&local_28,2);
  }
  return param_1;
}



void FUN_1402cca70(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong local_30;
  undefined1 local_28 [32];
  
  if (param_2 != param_1) {
    local_30 = 0;
    FUN_1402ccb00(&local_30,param_1,param_3,param_4,0xfffffffffffffffe);
    FUN_1402ccb00(param_1,param_2);
    FUN_1402ccb00(param_2,&local_30);
    if (((local_30 != 0) && ((local_30 & 1) == 0)) &&
       (*(code **)(local_30 & 0xfffffffffffffffe) != (code *)0x0)) {
      (**(code **)(local_30 & 0xfffffffffffffffe))(local_28,local_28,2);
    }
  }
  return;
}



void FUN_1402ccb00(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  code *pcVar2;
  
  if (param_2 != param_1) {
    uVar1 = *param_2;
    if (uVar1 == 0) {
      uVar1 = *param_1;
      if (uVar1 != 0) {
        if ((uVar1 & 1) == 0) {
          pcVar2 = *(code **)(uVar1 & 0xfffffffffffffffe);
          if (pcVar2 != (code *)0x0) {
            (*pcVar2)(param_1 + 1,param_1 + 1,2,pcVar2,0xfffffffffffffffe);
          }
        }
        *param_1 = 0;
      }
    }
    else {
      *param_1 = uVar1;
      if ((uVar1 & 1) == 0) {
        (**(code **)(uVar1 & 0xfffffffffffffffe))(param_2 + 1,param_1 + 1,1);
      }
      else {
        param_1[1] = param_2[1];
        param_1[2] = param_2[2];
        param_1[3] = param_2[3];
        param_1[4] = param_2[4];
      }
      *param_2 = 0;
    }
  }
  return;
}



undefined8 * FUN_1402ccbb0(undefined8 *param_1)

{
  undefined2 *puVar1;
  int iVar2;
  
  FUN_1402bc770();
  puVar1 = (undefined2 *)((longlong)param_1 + 0x162);
  iVar2 = 0xb;
  *param_1 = M3dSGimmick_Tool::vftable;
  param_1[0x1c] = 0;
  param_1[0x1d] = 0;
  param_1[0x21] = 7;
  param_1[0x20] = 0;
  *(undefined2 *)(param_1 + 0x1e) = 0;
  param_1[0x26] = 7;
  param_1[0x25] = 0;
  *(undefined2 *)(param_1 + 0x23) = 0;
  *(undefined4 *)(param_1 + 0x28) = 0;
  param_1[0x29] = 0;
  param_1[0x2a] = 0;
  *(undefined1 *)(param_1 + 0x2b) = 1;
  *(undefined4 *)((longlong)param_1 + 0x15c) = 0;
  *(undefined1 *)(param_1 + 0x2c) = 1;
  do {
    *(undefined4 *)(puVar1 + 1) = 0;
    *puVar1 = 0;
    puVar1 = puVar1 + 3;
    iVar2 = iVar2 + -1;
  } while (-1 < iVar2);
  *(undefined1 *)((longlong)param_1 + 0x1aa) = 0;
  param_1[0x39] = 0xf;
  param_1[0x38] = 0;
  *(undefined1 *)(param_1 + 0x36) = 0;
  param_1[0x43] = 0;
  param_1[0x44] = 0;
  *(undefined8 *)((longlong)param_1 + 0x20c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x204) = 0;
  param_1[0x3f] = 0;
  param_1[0x3e] = 0;
  *(undefined8 *)((longlong)param_1 + 0x1e4) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1dc) = 0;
  *(undefined4 *)((longlong)param_1 + 0x214) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x40) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x1ec) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x3b) = 0x3f800000;
  return param_1;
}



void * FUN_1402ccce0(void *param_1,uint param_2)

{
  FUN_1402ccd10();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402ccd10(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = M3dSGimmick_Tool::vftable;
  param_1[0x1c] = 0;
  plVar3 = (longlong *)param_1[0x1d];
  param_1[0x1d] = 0;
  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);
      }
    }
  }
  if (0xf < (ulonglong)param_1[0x39]) {
    operator_delete((void *)param_1[0x36]);
  }
  param_1[0x39] = 0xf;
  param_1[0x38] = 0;
  *(undefined1 *)(param_1 + 0x36) = 0;
  if (7 < (ulonglong)param_1[0x26]) {
    operator_delete((void *)param_1[0x23]);
  }
  param_1[0x26] = 7;
  param_1[0x25] = 0;
  *(undefined2 *)(param_1 + 0x23) = 0;
  if (7 < (ulonglong)param_1[0x21]) {
    operator_delete((void *)param_1[0x1e]);
  }
  param_1[0x21] = 7;
  param_1[0x20] = 0;
  *(undefined2 *)(param_1 + 0x1e) = 0;
  plVar3 = (longlong *)param_1[0x1d];
  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);
      }
    }
  }
  FUN_1402bc9e0(param_1);
  return;
}



void FUN_1402cce60(longlong param_1)

{
  short sVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong *plVar6;
  short *psVar7;
  
  FUN_1402bc890(param_1 + 0x90,param_1 + 0x80,param_1 + 0x74,param_1 + 0x68);
  lVar2 = *(longlong *)(param_1 + 0xe0);
  if (lVar2 != 0) {
    plVar6 = (longlong *)(param_1 + 0x118);
    if (7 < *(ulonglong *)(param_1 + 0x130)) {
      plVar6 = (longlong *)*plVar6;
    }
    lVar4 = -1;
    psVar7 = (short *)plVar6;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      sVar1 = *psVar7;
      psVar7 = psVar7 + 1;
    } while (sVar1 != 0);
    if (lVar4 != -2) {
      uVar5 = 0xffffffffffffffff;
      psVar7 = (short *)plVar6;
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        sVar1 = *psVar7;
        psVar7 = psVar7 + 1;
      } while (sVar1 != 0);
      iVar3 = FUN_140123e30(lVar2 + 0x40,*(undefined8 *)(lVar2 + 0x50),plVar6,~uVar5 - 1);
      if (iVar3 != 0) {
        uVar5 = 0xffffffffffffffff;
        psVar7 = (short *)plVar6;
        do {
          if (uVar5 == 0) break;
          uVar5 = uVar5 - 1;
          sVar1 = *psVar7;
          psVar7 = psVar7 + 1;
        } while (sVar1 != 0);
        FUN_140001710(lVar2 + 0x40,plVar6,~uVar5 - 1);
        if (*(longlong *)(lVar2 + 0x10) != 0) {
          lVar4 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
          if (lVar4 == 0) {
            iVar3 = 0;
          }
          else {
            iVar3 = FUN_1402ce620(lVar4,plVar6);
            iVar3 = iVar3 + 1;
          }
          FUN_1402c5c00(lVar2,iVar3,0,1);
        }
      }
    }
    FUN_1402c5990(*(undefined8 *)(param_1 + 0xe0),param_1 + 0x90);
    FUN_1402c5260(*(undefined8 *)(param_1 + 0xe0));
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0xe0) + 0x20) + 0x50) = 0;
  }
  return;
}



void FUN_1402ccf90(void)

{
  void *pvVar1;
  
  pvVar1 = operator_new(0x228);
  if (pvVar1 != (void *)0x0) {
    FUN_1402ccbb0(pvVar1);
    return;
  }
  return;
}



longlong FUN_1402ccfc0(longlong *param_1)

{
  int *piVar1;
  short sVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  undefined8 uVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong *plVar9;
  short *psVar10;
  undefined1 local_20 [8];
  longlong *local_18;
  
  lVar5 = (**(code **)(*param_1 + 0x18))();
  FUN_1402cd110(lVar5,param_1);
  if (param_1[0x1c] != 0) {
    plVar9 = param_1 + 0x1e;
    if (7 < (ulonglong)param_1[0x21]) {
      plVar9 = (longlong *)*plVar9;
    }
    uVar6 = FUN_1402c4f90(local_20,plVar9,8);
    FUN_140343ec0(lVar5 + 0xe0,uVar6);
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar9 = local_18 + 1;
      *(int *)plVar9 = (int)*plVar9 + -1;
      UNLOCK();
      if ((int)*plVar9 == 0) {
        (**(code **)(*local_18 + 8))(local_18);
        LOCK();
        piVar1 = (int *)((longlong)local_18 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_18 + 0x10))(local_18);
        }
      }
    }
    FUN_1402c5990(*(undefined8 *)(lVar5 + 0xe0),lVar5 + 0x90);
    plVar9 = (longlong *)(lVar5 + 0x118);
    if (7 < *(ulonglong *)(lVar5 + 0x130)) {
      plVar9 = (longlong *)*plVar9;
    }
    lVar3 = *(longlong *)(lVar5 + 0xe0);
    lVar7 = -1;
    psVar10 = (short *)plVar9;
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      sVar2 = *psVar10;
      psVar10 = psVar10 + 1;
    } while (sVar2 != 0);
    if (lVar7 != -2) {
      uVar8 = 0xffffffffffffffff;
      psVar10 = (short *)plVar9;
      do {
        if (uVar8 == 0) break;
        uVar8 = uVar8 - 1;
        sVar2 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar2 != 0);
      FUN_140001710(lVar3 + 0x40,plVar9,~uVar8 - 1);
      if (*(longlong *)(lVar3 + 0x10) != 0) {
        lVar7 = *(longlong *)(*(longlong *)(lVar3 + 0x10) + 0xd8);
        if (lVar7 == 0) {
          iVar4 = 0;
        }
        else {
          iVar4 = FUN_1402ce620(lVar7,plVar9);
          iVar4 = iVar4 + 1;
        }
        FUN_1402c5c00(lVar3,iVar4,0,0);
      }
    }
  }
  return lVar5;
}



longlong FUN_1402cd110(longlong param_1,longlong param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  FUN_1402bca50();
  FUN_140343ec0(param_1 + 0xe0,param_2 + 0xe0);
  FUN_1400015e0(param_1 + 0xf0,param_2 + 0xf0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x118,param_2 + 0x118,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x140) = *(undefined4 *)(param_2 + 0x140);
  *(undefined8 *)(param_1 + 0x148) = *(undefined8 *)(param_2 + 0x148);
  *(undefined8 *)(param_1 + 0x150) = *(undefined8 *)(param_2 + 0x150);
  lVar2 = 0xc;
  *(undefined1 *)(param_1 + 0x158) = *(undefined1 *)(param_2 + 0x158);
  *(undefined4 *)(param_1 + 0x15c) = *(undefined4 *)(param_2 + 0x15c);
  *(undefined1 *)(param_1 + 0x160) = *(undefined1 *)(param_2 + 0x160);
  puVar1 = (undefined4 *)(param_1 + 0x162);
  do {
    lVar2 = lVar2 + -1;
    *puVar1 = *(undefined4 *)((param_2 - param_1) + (longlong)puVar1);
    *(undefined2 *)(puVar1 + 1) = *(undefined2 *)((param_2 - param_1) + -2 + (longlong)puVar1 + 6);
    puVar1 = (undefined4 *)((longlong)puVar1 + 6);
  } while (lVar2 != 0);
  *(undefined1 *)(param_1 + 0x1aa) = *(undefined1 *)(param_2 + 0x1aa);
  FUN_140003d90(param_1 + 0x1b0,param_2 + 0x1b0,0,0xffffffffffffffff);
  memcpy((void *)(param_1 + 0x1d8),(void *)(param_2 + 0x1d8),0x40);
  *(undefined4 *)(param_1 + 0x218) = *(undefined4 *)(param_2 + 0x218);
  *(undefined4 *)(param_1 + 0x21c) = *(undefined4 *)(param_2 + 0x21c);
  *(undefined4 *)(param_1 + 0x220) = *(undefined4 *)(param_2 + 0x220);
  *(undefined4 *)(param_1 + 0x224) = *(undefined4 *)(param_2 + 0x224);
  return param_1;
}



void FUN_1402cd270(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  longlong lVar4;
  int iVar5;
  undefined8 uVar6;
  longlong lVar7;
  ulonglong uVar8;
  longlong *plVar9;
  short *psVar10;
  short *psVar11;
  undefined1 local_20 [8];
  longlong *local_18;
  
  FUN_1402cd110();
  if (*(longlong *)(param_2 + 0xe0) != 0) {
    plVar9 = (longlong *)(param_2 + 0xf0);
    if (7 < *(ulonglong *)(param_2 + 0x108)) {
      plVar9 = (longlong *)*plVar9;
    }
    uVar6 = FUN_1402c4f90(local_20,plVar9,8);
    plVar9 = (longlong *)(param_1 + 0xe0);
    FUN_140343ec0(plVar9,uVar6);
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_18 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_18 + 8))(local_18);
        LOCK();
        piVar2 = (int *)((longlong)local_18 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_18 + 0x10))(local_18);
        }
      }
    }
    FUN_1402c5990(*plVar9,param_1 + 0x90);
    psVar10 = (short *)(param_1 + 0x118);
    if (7 < *(ulonglong *)(param_1 + 0x130)) {
      psVar10 = *(short **)psVar10;
    }
    lVar4 = *plVar9;
    lVar7 = -1;
    psVar11 = psVar10;
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      sVar3 = *psVar11;
      psVar11 = psVar11 + 1;
    } while (sVar3 != 0);
    if (lVar7 != -2) {
      uVar8 = 0xffffffffffffffff;
      psVar11 = psVar10;
      do {
        if (uVar8 == 0) break;
        uVar8 = uVar8 - 1;
        sVar3 = *psVar11;
        psVar11 = psVar11 + 1;
      } while (sVar3 != 0);
      FUN_140001710(lVar4 + 0x40,psVar10,~uVar8 - 1);
      if (*(longlong *)(lVar4 + 0x10) != 0) {
        lVar7 = *(longlong *)(*(longlong *)(lVar4 + 0x10) + 0xd8);
        if (lVar7 == 0) {
          iVar5 = 0;
        }
        else {
          iVar5 = FUN_1402ce620(lVar7,psVar10);
          iVar5 = iVar5 + 1;
        }
        FUN_1402c5c00(lVar4,iVar5,0,0);
      }
    }
  }
  return;
}



void FUN_1402cd3a0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x162) = 0x30000;
  *(undefined4 *)(param_1 + 0x166) = 0x30002;
  *(undefined4 *)(param_1 + 0x16a) = 0x10000;
  *(undefined4 *)(param_1 + 0x16e) = 0x70004;
  *(undefined4 *)(param_1 + 0x172) = 0x70005;
  *(undefined4 *)(param_1 + 0x176) = 0x60004;
  *(undefined4 *)(param_1 + 0x17a) = 0x50000;
  *(undefined4 *)(param_1 + 0x17e) = 0x50001;
  *(undefined4 *)(param_1 + 0x182) = 0x40000;
  *(undefined4 *)(param_1 + 0x186) = 0x70001;
  *(undefined4 *)(param_1 + 0x18a) = 0x70003;
  *(undefined4 *)(param_1 + 0x18e) = 0x50001;
  *(undefined4 *)(param_1 + 0x192) = 0x60003;
  *(undefined4 *)(param_1 + 0x196) = 0x60002;
  *(undefined4 *)(param_1 + 0x19a) = 0x70003;
  *(undefined4 *)(param_1 + 0x19e) = 0x40002;
  *(undefined4 *)(param_1 + 0x1a2) = 0x40000;
  *(undefined4 *)(param_1 + 0x1a6) = 0x60002;
  return;
}



void FUN_1402cd470(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  FUN_140001710(param_1 + 0x118,&DAT_140477960,0);
  FUN_140003e50(param_1 + 0x1b0,&DAT_14047e238,0);
  if (*(longlong *)(param_1 + 0xe0) != 0) {
    *(undefined8 *)(param_1 + 0xe0) = 0;
    plVar3 = *(longlong **)(param_1 + 0xe8);
    *(undefined8 *)(param_1 + 0xe8) = 0;
    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_1402cd500(longlong param_1,char param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  *(char *)(param_1 + 0x160) = param_2;
  if ((*(longlong *)(param_1 + 0xe0) != 0) && (param_2 != '\0')) {
    plVar2 = (longlong *)(param_1 + 0x118);
    if (7 < *(ulonglong *)(param_1 + 0x130)) {
      plVar2 = (longlong *)*plVar2;
    }
    FUN_1402c5b20(*(longlong *)(param_1 + 0xe0),plVar2,0,0,1);
    memcpy((void *)(param_1 + 0x1d8),(void *)(param_1 + 0x90),0x40);
    if ((DAT_14060817c & 1) == 0) {
      DAT_14060817c = DAT_14060817c | 1;
    }
    DAT_140608180 = *(undefined4 *)(param_1 + 0x208);
    DAT_140608184 = *(undefined4 *)(param_1 + 0x20c);
    DAT_140608188 = *(undefined4 *)(param_1 + 0x210);
    *(undefined4 *)(param_1 + 0x218) = DAT_140608180;
    *(undefined4 *)(param_1 + 0x21c) = DAT_140608184;
    *(undefined4 *)(param_1 + 0x220) = DAT_140608188;
    FUN_1402c5990(*(undefined8 *)(param_1 + 0xe0),param_1 + 0x90);
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0xe0) + 0x20) + 0x50) = 0;
    lVar1 = *(longlong *)(*(longlong *)(param_1 + 0xe0) + 0x20);
    if (*(int *)(lVar1 + 0x54) == 1) {
      *(undefined8 *)(lVar1 + 0x10) = *(undefined8 *)(param_1 + 0x148);
      FUN_1402cc2c0(lVar1);
    }
    *(undefined4 *)(lVar1 + 0x54) = 0;
  }
  return;
}



void FUN_1402cd640(longlong param_1,undefined1 param_2)

{
  short sVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  ulonglong uVar5;
  longlong *plVar6;
  short *psVar7;
  
  lVar2 = *(longlong *)(param_1 + 0xe0);
  *(undefined1 *)(param_1 + 0x1aa) = param_2;
  if (lVar2 != 0) {
    plVar6 = (longlong *)(param_1 + 0x118);
    if (7 < *(ulonglong *)(param_1 + 0x130)) {
      plVar6 = (longlong *)*plVar6;
    }
    lVar4 = -1;
    psVar7 = (short *)plVar6;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      sVar1 = *psVar7;
      psVar7 = psVar7 + 1;
    } while (sVar1 != 0);
    if (lVar4 != -2) {
      uVar5 = 0xffffffffffffffff;
      psVar7 = (short *)plVar6;
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        sVar1 = *psVar7;
        psVar7 = psVar7 + 1;
      } while (sVar1 != 0);
      FUN_140001710(lVar2 + 0x40,plVar6,~uVar5 - 1);
      if (*(longlong *)(lVar2 + 0x10) != 0) {
        lVar4 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + 0xd8);
        if (lVar4 == 0) {
          iVar3 = 0;
        }
        else {
          iVar3 = FUN_1402ce620(lVar4,plVar6);
          iVar3 = iVar3 + 1;
        }
        FUN_1402c5c00(lVar2,iVar3,0,0);
      }
    }
    *(undefined1 *)(*(longlong *)(*(longlong *)(param_1 + 0xe0) + 0x20) + 0x50) = 0;
    lVar2 = *(longlong *)(*(longlong *)(param_1 + 0xe0) + 0x20);
    if (*(int *)(lVar2 + 0x54) == 1) {
      *(undefined8 *)(lVar2 + 0x10) = *(undefined8 *)(param_1 + 0x148);
      FUN_1402cc2c0(lVar2);
    }
    *(undefined4 *)(lVar2 + 0x54) = 0;
    memcpy((void *)(param_1 + 0x1d8),(void *)(param_1 + 0x90),0x40);
    if ((DAT_14060817c & 1) == 0) {
      DAT_14060817c = DAT_14060817c | 1;
    }
    DAT_140608180 = *(undefined4 *)(param_1 + 0xc0);
    DAT_140608184 = *(undefined4 *)(param_1 + 0xc4);
    DAT_140608188 = *(undefined4 *)(param_1 + 200);
    *(undefined4 *)(param_1 + 0x218) = DAT_140608180;
    *(undefined4 *)(param_1 + 0x21c) = DAT_140608184;
    *(undefined4 *)(param_1 + 0x220) = DAT_140608188;
    FUN_1402c5990(*(undefined8 *)(param_1 + 0xe0),param_1 + 0x1d8);
  }
  return;
}



undefined8 FUN_1402cd7d0(void)

{
  return 0x17;
}



// WARNING: Removing unreachable block (ram,0x0001402cd924)
// WARNING: Removing unreachable block (ram,0x0001402cd8e3)

void FUN_1402cd7e0(longlong param_1,ulonglong param_2)

{
  longlong *plVar1;
  ulonglong uVar2;
  longlong lVar3;
  uint uVar4;
  ulonglong *puVar5;
  ulonglong *puVar6;
  ulonglong *puVar7;
  undefined8 uVar8;
  
  uVar8 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_140608278);
  if (param_2 != 0) {
    plVar1 = (longlong *)(param_1 + 0x10);
    puVar6 = (ulonglong *)0x0;
    puVar5 = puVar6;
    if (*plVar1 != 0) {
      for (puVar7 = *(ulonglong **)
                     (*plVar1 + ((param_2 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x20)) * 8)
          ; (puVar5 = puVar6, puVar7 != (ulonglong *)0x0 &&
            (((int)puVar7[4] != (int)param_2 || (puVar5 = puVar7, *puVar7 != param_2))));
          puVar7 = (ulonglong *)puVar7[3]) {
      }
    }
    if (puVar5 != (ulonglong *)0x0) {
      if (puVar5 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar2 = puVar5[1];
      *(int *)(uVar2 + 0x28) = *(int *)(uVar2 + 0x28) + -1;
      if ((*(int *)(uVar2 + 0x28) < 1) && (FUN_1402c9eb0(uVar2), *(int *)(uVar2 + 0x28) < 1)) {
        if ((puVar5 != (ulonglong *)0x0) && (puVar5[3] == 0)) {
          uVar4 = (uint)puVar5[4] % *(uint *)(param_1 + 0x20) + 1;
          lVar3 = (longlong)(int)uVar4 << 3;
          puVar7 = puVar6;
          do {
            if (*(uint *)(param_1 + 0x20) <= uVar4) break;
            if (*(longlong *)(lVar3 + *plVar1) != 0) {
              puVar7 = *(ulonglong **)(lVar3 + *plVar1);
            }
            uVar4 = uVar4 + 1;
            lVar3 = lVar3 + 8;
          } while (puVar7 == (ulonglong *)0x0);
        }
        uVar4 = (uint)puVar5[4];
        uVar2 = (ulonglong)uVar4 % (ulonglong)*(uint *)(param_1 + 0x20);
        lVar3 = *plVar1;
        if (puVar5 != *(ulonglong **)(lVar3 + uVar2 * 8)) {
          puVar6 = *(ulonglong **)(lVar3 + uVar2 * 8);
          for (puVar7 = (ulonglong *)puVar6[3]; puVar7 != puVar5; puVar7 = (ulonglong *)puVar7[3]) {
            puVar6 = puVar7;
          }
        }
        if (puVar6 == (ulonglong *)0x0) {
          *(ulonglong *)(lVar3 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(param_1 + 0x20)) * 8) =
               puVar5[3];
        }
        else {
          puVar6[3] = puVar5[3];
        }
        FUN_1402c6e80(plVar1,puVar5,lVar3,(ulonglong)uVar4,uVar8);
      }
    }
  }
                    // WARNING: Could not recover jumptable at 0x0001402cd976. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608278);
  return;
}



longlong FUN_1402cd980(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong local_20;
  longlong *local_18;
  
  uVar4 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_140608278);
  lVar3 = FUN_1402cdb70(param_1,param_2);
  if (lVar3 == 0) {
    FUN_1402c9f60(&local_20,param_2);
    if (local_20 == 0) {
      if (local_18 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_18 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_18 + 8))(local_18);
          LOCK();
          piVar2 = (int *)((longlong)local_18 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_18 + 0x10))(local_18);
          }
        }
      }
      LeaveCriticalSection(DAT_140608278);
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(param_1 + 0x58);
      *(longlong *)(param_1 + 0x58) = lVar3 + 1;
      FUN_1402cdce0(param_1,lVar3,&local_20,param_4,uVar4);
      if (local_18 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_18 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_18 + 8))(local_18);
          LOCK();
          piVar2 = (int *)((longlong)local_18 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_18 + 0x10))(local_18);
          }
        }
      }
      LeaveCriticalSection(DAT_140608278);
    }
  }
  else {
    LeaveCriticalSection(DAT_140608278);
  }
  return lVar3;
}



ulonglong * FUN_1402cdaa0(longlong param_1,ulonglong *param_2,ulonglong param_3)

{
  ulonglong uVar1;
  ulonglong *puVar2;
  
  EnterCriticalSection(DAT_140608278);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    for (puVar2 = *(ulonglong **)
                   (*(longlong *)(param_1 + 0x10) +
                   ((param_3 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x20)) * 8);
        puVar2 != (ulonglong *)0x0; puVar2 = (ulonglong *)puVar2[3]) {
      if (((int)puVar2[4] == (int)param_3) && (*puVar2 == param_3)) {
        if (puVar2 != (ulonglong *)0x0) {
          if (puVar2 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          *param_2 = puVar2[1];
          uVar1 = puVar2[2];
          param_2[1] = uVar1;
          if (uVar1 != 0) {
            LOCK();
            *(int *)(uVar1 + 8) = *(int *)(uVar1 + 8) + 1;
            UNLOCK();
          }
          goto LAB_1402cdb45;
        }
        break;
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
LAB_1402cdb45:
  LeaveCriticalSection(DAT_140608278);
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402cdcaa)
// WARNING: Removing unreachable block (ram,0x0001402cdc8a)

undefined8 FUN_1402cdb70(longlong param_1,short *param_2)

{
  short sVar1;
  short sVar2;
  undefined8 uVar3;
  uint uVar4;
  short *psVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined8 *puVar9;
  undefined8 *puVar10;
  undefined8 *puVar5;
  
  EnterCriticalSection(DAT_140608278);
  puVar10 = (undefined8 *)0x0;
  puVar9 = puVar10;
  if ((*(longlong *)(param_1 + 0x18) != 0) && (*(uint *)(param_1 + 0x20) != 0)) {
    puVar5 = puVar10;
    plVar8 = *(longlong **)(param_1 + 0x10);
    do {
      if (*plVar8 != 0) {
        puVar9 = (undefined8 *)(*(longlong **)(param_1 + 0x10))[(longlong)puVar5];
        break;
      }
      uVar4 = (int)puVar5 + 1;
      puVar5 = (undefined8 *)(ulonglong)uVar4;
      plVar8 = plVar8 + 1;
    } while (uVar4 < *(uint *)(param_1 + 0x20));
  }
  do {
    do {
      puVar5 = puVar9;
      if (puVar5 == (undefined8 *)0x0) {
        LeaveCriticalSection(DAT_140608278);
        return 0;
      }
      puVar9 = (undefined8 *)(puVar5[1] + 0x38);
      if (7 < *(ulonglong *)(puVar5[1] + 0x50)) {
        puVar9 = (undefined8 *)*puVar9;
      }
      psVar6 = param_2;
      do {
        sVar1 = *psVar6;
        sVar2 = *(short *)((longlong)psVar6 + ((longlong)puVar9 - (longlong)param_2));
        if (sVar1 != sVar2) break;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      if (sVar1 == sVar2) {
        if (puVar5 != (undefined8 *)0x0) {
          *(int *)(puVar5[1] + 0x28) = *(int *)(puVar5[1] + 0x28) + 1;
          uVar3 = *puVar5;
          LeaveCriticalSection(DAT_140608278);
          return uVar3;
        }
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      puVar9 = puVar10;
    } while ((puVar5 == (undefined8 *)0x0) ||
            (puVar9 = (undefined8 *)puVar5[3], (undefined8 *)puVar5[3] != (undefined8 *)0x0));
    uVar4 = *(uint *)(puVar5 + 4) % *(uint *)(param_1 + 0x20) + 1;
    lVar7 = (longlong)(int)uVar4 << 3;
    puVar9 = puVar10;
    do {
      if (*(uint *)(param_1 + 0x20) <= uVar4) break;
      if (*(longlong *)(lVar7 + *(longlong *)(param_1 + 0x10)) != 0) {
        puVar9 = *(undefined8 **)(lVar7 + *(longlong *)(param_1 + 0x10));
      }
      uVar4 = uVar4 + 1;
      lVar7 = lVar7 + 8;
    } while (puVar9 == (undefined8 *)0x0);
  } while( true );
}



void FUN_1402cdce0(longlong param_1,undefined8 param_2,longlong *param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 uVar4;
  longlong local_28;
  longlong *local_20;
  
  uVar4 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_140608278);
  *(undefined8 *)(*param_3 + 0x30) = param_2;
  *(int *)(*param_3 + 0x28) = *(int *)(*param_3 + 0x28) + 1;
  local_28 = *param_3;
  plVar2 = (longlong *)param_3[1];
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
  }
  local_20 = plVar2;
  FUN_14031a010(param_1 + 0x10,param_2,&local_28,param_4,uVar4,param_2);
  plVar3 = local_20;
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar2 = plVar2 + 1;
    *(int *)plVar2 = (int)*plVar2 + -1;
    UNLOCK();
    if ((int)*plVar2 == 0) {
      (**(code **)(*local_20 + 8))(local_20);
      LOCK();
      piVar1 = (int *)((longlong)plVar3 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_20 + 0x10))();
      }
    }
  }
                    // WARNING: Could not recover jumptable at 0x0001402cdd94. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608278);
  return;
}



void FUN_1402cdda0(void)

{
                    // WARNING: Could not recover jumptable at 0x0001402cdda7. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608278);
  return;
}



uint FUN_1402cddb0(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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_1402cde30(longlong param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  ulonglong *puVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_140608280);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    for (puVar3 = *(ulonglong **)
                   (*(longlong *)(param_1 + 0x10) +
                   ((param_2 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x20)) * 8);
        puVar3 != (ulonglong *)0x0; puVar3 = (ulonglong *)puVar3[3]) {
      if (((int)puVar3[4] == (int)param_2) && (*puVar3 == param_2)) {
        if (puVar3 != (ulonglong *)0x0) {
          if (puVar3 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar1 = puVar3[1];
          *(int *)(uVar1 + 0x48) = *(int *)(uVar1 + 0x48) + -1;
          if (*(int *)(uVar1 + 0x48) < 1) {
            lVar2 = *(longlong *)(uVar1 + 0x30);
            if (*(longlong *)(uVar1 + 0x28) != lVar2) {
              uVar4 = FUN_140333a10(lVar2,lVar2,*(longlong *)(uVar1 + 0x28),param_4,uVar4);
              FUN_1402ce6b0(uVar4,*(undefined8 *)(uVar1 + 0x30));
              *(undefined8 *)(uVar1 + 0x30) = uVar4;
            }
            if (*(int *)(uVar1 + 0x48) < 1) {
              FUN_1402ce3d0(param_1 + 0x10,param_2);
            }
          }
        }
        break;
      }
    }
  }
                    // WARNING: Could not recover jumptable at 0x0001402cdf16. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608280);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_1402cdf20(longlong param_1,undefined8 param_2)

{
  int iVar1;
  longlong lVar2;
  undefined1 auStack_a8 [32];
  undefined8 local_88;
  undefined **local_78;
  longlong local_70;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined8 local_58;
  ulonglong local_50;
  undefined4 local_40;
  undefined8 local_38;
  ulonglong local_20;
  
  local_88 = 0xfffffffffffffffe;
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  EnterCriticalSection(DAT_140608280);
  lVar2 = FUN_1402ce260(param_1,param_2);
  if (lVar2 == 0) {
    local_70 = 0;
    local_50 = 7;
    local_58 = 0;
    local_68 = 0;
    local_78 = M3dSMotionGroupLoad::vftable;
    local_40 = 1;
    local_38 = 0;
    iVar1 = FUN_1402d1fc0(&local_78,param_2);
    if (iVar1 != 0) {
      FUN_140418da0(DAT_140607fd8,L"MotionGroup file not found. - %s",param_2);
      local_78 = mcoBinaryLoad::vftable;
      if ((DAT_140607be1 != '\0') && (local_70 != 0)) {
        *(int *)(local_70 + 0x10) = *(int *)(local_70 + 0x10) + -1;
      }
      if (7 < local_50) {
        operator_delete((void *)CONCAT62(uStack_66,local_68));
      }
      local_50 = 7;
      local_58 = 0;
      local_68 = 0;
      LeaveCriticalSection(DAT_140608280);
      return 0;
    }
    lVar2 = *(longlong *)(param_1 + 0x58);
    *(longlong *)(param_1 + 0x58) = lVar2 + 1;
    FUN_1402ce1a0(param_1,lVar2,local_38);
    local_78 = mcoBinaryLoad::vftable;
    if ((DAT_140607be1 != '\0') && (local_70 != 0)) {
      *(int *)(local_70 + 0x10) = *(int *)(local_70 + 0x10) + -1;
    }
    if (7 < local_50) {
      operator_delete((void *)CONCAT62(uStack_66,local_68));
    }
    local_50 = 7;
    local_58 = 0;
    local_68 = 0;
  }
  LeaveCriticalSection(DAT_140608280);
  return lVar2;
}



ulonglong * FUN_1402ce0d0(longlong param_1,ulonglong *param_2,ulonglong param_3)

{
  ulonglong uVar1;
  ulonglong *puVar2;
  
  EnterCriticalSection(DAT_140608280);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    for (puVar2 = *(ulonglong **)
                   (*(longlong *)(param_1 + 0x10) +
                   ((param_3 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 0x20)) * 8);
        puVar2 != (ulonglong *)0x0; puVar2 = (ulonglong *)puVar2[3]) {
      if (((int)puVar2[4] == (int)param_3) && (*puVar2 == param_3)) {
        if (puVar2 != (ulonglong *)0x0) {
          if (puVar2 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          *param_2 = puVar2[1];
          uVar1 = puVar2[2];
          param_2[1] = uVar1;
          if (uVar1 != 0) {
            LOCK();
            *(int *)(uVar1 + 8) = *(int *)(uVar1 + 8) + 1;
            UNLOCK();
          }
          goto LAB_1402ce175;
        }
        break;
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
LAB_1402ce175:
  LeaveCriticalSection(DAT_140608280);
  return param_2;
}



void FUN_1402ce1a0(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong local_28;
  longlong *local_20 [3];
  
  uVar3 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_140608280);
  *(int *)(param_3 + 0x48) = *(int *)(param_3 + 0x48) + 1;
  local_28 = param_3;
  FUN_1402ce480(local_20,param_3);
  FUN_140178e90(&local_28,param_3,param_3,param_4,uVar3);
  FUN_14031a010(param_1 + 0x10,param_2,&local_28);
  if (local_20[0] != (longlong *)0x0) {
    LOCK();
    plVar1 = local_20[0] + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_20[0] + 8))(local_20[0]);
      LOCK();
      piVar2 = (int *)((longlong)local_20[0] + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_20[0] + 0x10))(local_20[0]);
      }
    }
  }
  LeaveCriticalSection(DAT_140608280);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402ce38c)
// WARNING: Removing unreachable block (ram,0x0001402ce36c)

undefined8 FUN_1402ce260(longlong param_1,wchar_t *param_2)

{
  undefined8 uVar1;
  uint uVar2;
  int iVar3;
  longlong lVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  wchar_t *_Str2;
  undefined8 *puVar8;
  undefined8 *puVar4;
  
  EnterCriticalSection(DAT_140608280);
  puVar8 = (undefined8 *)0x0;
  puVar7 = puVar8;
  if ((*(longlong *)(param_1 + 0x18) != 0) && (*(uint *)(param_1 + 0x20) != 0)) {
    puVar4 = puVar8;
    plVar6 = *(longlong **)(param_1 + 0x10);
    do {
      if (*plVar6 != 0) {
        puVar7 = (undefined8 *)(*(longlong **)(param_1 + 0x10))[(longlong)puVar4];
        break;
      }
      uVar2 = (int)puVar4 + 1;
      puVar4 = (undefined8 *)(ulonglong)uVar2;
      plVar6 = plVar6 + 1;
    } while (uVar2 < *(uint *)(param_1 + 0x20));
  }
  do {
    do {
      puVar4 = puVar7;
      if (puVar4 == (undefined8 *)0x0) {
        LeaveCriticalSection(DAT_140608280);
        return 0;
      }
      _Str2 = (wchar_t *)puVar4[1];
      if (7 < *(ulonglong *)(_Str2 + 0xc)) {
        _Str2 = *(wchar_t **)_Str2;
      }
      iVar3 = _wcsicmp(param_2,_Str2);
      if (iVar3 == 0) {
        if (puVar4 != (undefined8 *)0x0) {
          *(int *)(puVar4[1] + 0x48) = *(int *)(puVar4[1] + 0x48) + 1;
          uVar1 = *puVar4;
          LeaveCriticalSection(DAT_140608280);
          return uVar1;
        }
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      puVar7 = puVar8;
    } while ((puVar4 == (undefined8 *)0x0) ||
            (puVar7 = (undefined8 *)puVar4[3], (undefined8 *)puVar4[3] != (undefined8 *)0x0));
    uVar2 = *(uint *)(puVar4 + 4) % *(uint *)(param_1 + 0x20) + 1;
    lVar5 = (longlong)(int)uVar2 << 3;
    puVar7 = puVar8;
    do {
      if (*(uint *)(param_1 + 0x20) <= uVar2) break;
      if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x10)) != 0) {
        puVar7 = *(undefined8 **)(lVar5 + *(longlong *)(param_1 + 0x10));
      }
      uVar2 = uVar2 + 1;
      lVar5 = lVar5 + 8;
    } while (puVar7 == (undefined8 *)0x0);
  } while( true );
}



void FUN_1402ce3c0(void)

{
                    // WARNING: Could not recover jumptable at 0x0001402ce3c7. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608280);
  return;
}



undefined8 FUN_1402ce3d0(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong *puVar3;
  ulonglong *puVar4;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    puVar4 = *(ulonglong **)
              (lVar1 + ((param_2 & 0xffffffff) % (ulonglong)*(uint *)(param_1 + 2)) * 8);
    puVar3 = (ulonglong *)0x0;
    while (puVar2 = puVar4, puVar2 != (ulonglong *)0x0) {
      if (((int)puVar2[4] == (int)param_2) && (*puVar2 == param_2)) {
        if (puVar3 != (ulonglong *)0x0) {
          puVar3[3] = puVar2[3];
          FUN_1402c6e80(param_1,puVar2);
          return 1;
        }
        *(ulonglong *)(lVar1 + ((ulonglong)(uint)puVar2[4] % (ulonglong)*(uint *)(param_1 + 2)) * 8)
             = puVar2[3];
        FUN_1402c6e80(param_1,puVar2);
        return 1;
      }
      puVar3 = puVar2;
      puVar4 = (ulonglong *)puVar2[3];
    }
  }
  return 0;
}



undefined8 * FUN_1402ce480(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;
}



undefined8 FUN_1402ce4f0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  int iVar5;
  undefined8 uVar6;
  wchar_t *_Str1;
  wchar_t *_Str2;
  
  _Str2 = (wchar_t *)(*param_2 + 0x1b8);
  if (7 < *(ulonglong *)(*param_2 + 0x1d0)) {
    _Str2 = *(wchar_t **)_Str2;
  }
  _Str1 = (wchar_t *)(*param_1 + 0x1b8);
  if (7 < *(ulonglong *)(*param_1 + 0x1d0)) {
    _Str1 = *(wchar_t **)_Str1;
  }
  iVar5 = _wcsicmp(_Str1,_Str2);
  if (iVar5 < 0) {
    plVar3 = (longlong *)param_1[1];
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar3 + 1;
      lVar4 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        (**(code **)(*plVar3 + 8))(plVar3);
        LOCK();
        piVar2 = (int *)((longlong)plVar3 + 0xc);
        iVar5 = *piVar2;
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (iVar5 == 1) {
          (**(code **)(*plVar3 + 0x10))(plVar3);
        }
      }
    }
    plVar3 = (longlong *)param_2[1];
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar3 + 1;
      lVar4 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        (**(code **)(*plVar3 + 8))(plVar3);
        LOCK();
        piVar2 = (int *)((longlong)plVar3 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar3 + 0x10))(plVar3);
        }
      }
    }
    uVar6 = 1;
  }
  else {
    plVar3 = (longlong *)param_1[1];
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar3 + 1;
      lVar4 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        (**(code **)(*plVar3 + 8))(plVar3);
        LOCK();
        piVar2 = (int *)((longlong)plVar3 + 0xc);
        iVar5 = *piVar2;
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (iVar5 == 1) {
          (**(code **)(*plVar3 + 0x10))(plVar3);
        }
      }
    }
    plVar3 = (longlong *)param_2[1];
    if (plVar3 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar3 + 1;
      lVar4 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar4 == 1) {
        (**(code **)(*plVar3 + 8))(plVar3);
        LOCK();
        piVar2 = (int *)((longlong)plVar3 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar3 + 0x10))(plVar3);
        }
      }
    }
    uVar6 = 0;
  }
  return uVar6;
}



int FUN_1402ce620(longlong param_1,wchar_t *param_2)

{
  longlong lVar1;
  int iVar2;
  wchar_t *_Str1;
  int iVar3;
  longlong lVar4;
  
  iVar3 = 0;
  if (0 < (int)(*(longlong *)(param_1 + 0x30) - *(longlong *)(param_1 + 0x28) >> 4)) {
    lVar4 = 0;
    do {
      lVar1 = *(longlong *)(lVar4 + *(longlong *)(param_1 + 0x28));
      _Str1 = (wchar_t *)(lVar1 + 0x1b8);
      if (7 < *(ulonglong *)(lVar1 + 0x1d0)) {
        _Str1 = *(wchar_t **)_Str1;
      }
      iVar2 = _wcsicmp(_Str1,param_2);
      if (iVar2 == 0) {
        return iVar3;
      }
      iVar3 = iVar3 + 1;
      lVar4 = lVar4 + 0x10;
    } while (iVar3 < (int)(*(longlong *)(param_1 + 0x30) - *(longlong *)(param_1 + 0x28) >> 4));
  }
  return -1;
}



void FUN_1402ce6b0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong *plVar4;
  
  if (param_1 != param_2) {
    plVar4 = param_1 + 1;
    do {
      plVar3 = (longlong *)*plVar4;
      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);
          }
        }
      }
      plVar3 = plVar4 + 1;
      plVar4 = plVar4 + 2;
    } while (plVar3 != param_2);
  }
  return;
}



void FUN_1402ce720(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 >> 4;
    if (lVar1 < 0x21) {
LAB_1402ce7eb:
      if (1 < lVar1) {
        FUN_1402ceeb0(param_1,param_2,param_4);
      }
      return;
    }
    if (param_3 < 1) {
      if (0x20 < lVar1) {
        lVar1 = param_2 - param_1 >> 4;
        if (lVar1 < 2) {
          return;
        }
        FUN_1402cedd0(param_1,param_2,param_4);
        if (lVar1 < 2) {
          return;
        }
        do {
          FUN_1402cf4a0(param_1,param_2,param_4);
          param_2 = param_2 + -0x10;
        } while (0x10 < (longlong)(param_2 - param_1 & 0xfffffffffffffff0U));
        return;
      }
      goto LAB_1402ce7eb;
    }
    FUN_1402ce880(&local_18,param_1,param_2);
    lVar1 = local_10;
    param_3 = param_3 / 2 + (param_3 / 2) / 2;
    if ((longlong)(local_18 - param_1 & 0xfffffffffffffff0U) <
        (longlong)(param_2 - local_10 & 0xfffffffffffffff0U)) {
      FUN_1402ce720(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_1402ce720(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



void FUN_1402ce880(ulonglong *param_1,undefined8 *param_2,undefined8 *param_3)

{
  undefined8 uVar1;
  undefined8 *puVar2;
  char cVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  undefined8 local_128;
  longlong local_120;
  undefined8 local_118;
  longlong local_110;
  undefined8 local_108;
  longlong local_100;
  undefined8 local_f8;
  longlong local_f0;
  undefined8 local_e8;
  longlong local_e0;
  undefined8 local_d8;
  longlong local_d0;
  undefined8 local_c8;
  longlong local_c0;
  undefined8 local_b8;
  longlong local_b0;
  undefined8 local_a8;
  longlong local_a0;
  undefined8 local_98;
  longlong local_90;
  undefined8 local_88;
  longlong local_80;
  undefined8 local_78;
  longlong local_70;
  undefined8 local_68;
  longlong local_60;
  undefined8 local_58;
  longlong local_50;
  undefined8 local_48;
  longlong local_40;
  undefined8 local_38;
  longlong local_30;
  
  puVar4 = param_2 + (((longlong)param_3 - (longlong)param_2 >> 4) -
                      ((longlong)param_3 - (longlong)param_2 >> 0x3f) >> 1) * 2;
  FUN_1402cecf0(param_2,puVar4,param_3 + -2);
  puVar7 = puVar4 + 2;
  if (param_2 < puVar4) {
    while( true ) {
      local_a8 = *puVar4;
      local_a0 = puVar4[1];
      if (local_a0 != 0) {
        LOCK();
        *(int *)(local_a0 + 8) = *(int *)(local_a0 + 8) + 1;
        UNLOCK();
      }
      local_108 = puVar4[-2];
      puVar2 = puVar4 + -2;
      local_100 = puVar4[-1];
      if (local_100 != 0) {
        LOCK();
        *(int *)(local_100 + 8) = *(int *)(local_100 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_1402ce4f0(&local_108,&local_a8);
      if (cVar3 != '\0') break;
      local_68 = *puVar2;
      local_60 = puVar4[-1];
      if (local_60 != 0) {
        LOCK();
        *(int *)(local_60 + 8) = *(int *)(local_60 + 8) + 1;
        UNLOCK();
      }
      local_e8 = *puVar4;
      local_e0 = puVar4[1];
      if (local_e0 != 0) {
        LOCK();
        *(int *)(local_e0 + 8) = *(int *)(local_e0 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_1402ce4f0(&local_e8,&local_68);
      if ((cVar3 != '\0') || (puVar4 = puVar2, puVar2 <= param_2)) break;
    }
  }
  puVar2 = puVar7;
  puVar5 = puVar4;
  if (puVar7 < param_3) {
    while( true ) {
      local_88 = *puVar4;
      local_80 = puVar4[1];
      if (local_80 != 0) {
        LOCK();
        *(int *)(local_80 + 8) = *(int *)(local_80 + 8) + 1;
        UNLOCK();
      }
      local_c8 = *puVar7;
      local_c0 = puVar7[1];
      if (local_c0 != 0) {
        LOCK();
        *(int *)(local_c0 + 8) = *(int *)(local_c0 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_1402ce4f0(&local_c8,&local_88);
      puVar2 = puVar7;
      if (cVar3 != '\0') break;
      local_48 = *puVar7;
      local_40 = puVar7[1];
      if (local_40 != 0) {
        LOCK();
        *(int *)(local_40 + 8) = *(int *)(local_40 + 8) + 1;
        UNLOCK();
      }
      local_128 = *puVar4;
      local_120 = puVar4[1];
      if (local_120 != 0) {
        LOCK();
        *(int *)(local_120 + 8) = *(int *)(local_120 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_1402ce4f0(&local_128,&local_48);
      if ((cVar3 != '\0') || (puVar7 = puVar7 + 2, puVar2 = puVar7, param_3 <= puVar7)) break;
    }
  }
joined_r0x0001402cea43:
  do {
    if (param_3 <= puVar7) {
joined_r0x0001402ceb0e:
      while (puVar8 = puVar4, param_2 < puVar8) {
        local_98 = *puVar5;
        local_90 = puVar5[1];
        if (local_90 != 0) {
          LOCK();
          *(int *)(local_90 + 8) = *(int *)(local_90 + 8) + 1;
          UNLOCK();
        }
        local_78 = puVar8[-2];
        puVar4 = puVar8 + -2;
        local_70 = puVar8[-1];
        if (local_70 != 0) {
          LOCK();
          *(int *)(local_70 + 8) = *(int *)(local_70 + 8) + 1;
          UNLOCK();
        }
        cVar3 = FUN_1402ce4f0(&local_78,&local_98);
        if (cVar3 == '\0') {
          local_58 = *puVar4;
          local_50 = puVar8[-1];
          if (local_50 != 0) {
            LOCK();
            *(int *)(local_50 + 8) = *(int *)(local_50 + 8) + 1;
            UNLOCK();
          }
          local_38 = *puVar5;
          local_30 = puVar5[1];
          if (local_30 != 0) {
            LOCK();
            *(int *)(local_30 + 8) = *(int *)(local_30 + 8) + 1;
            UNLOCK();
          }
          cVar3 = FUN_1402ce4f0(&local_38,&local_58);
          if (cVar3 != '\0') break;
          uVar1 = puVar5[-2];
          puVar5[-2] = *puVar4;
          *puVar4 = uVar1;
          uVar1 = puVar8[-1];
          puVar8[-1] = puVar5[-1];
          puVar5[-1] = uVar1;
          puVar5 = puVar5 + -2;
        }
      }
      if (puVar8 == param_2) {
        if (puVar7 == param_3) {
          *param_1 = (ulonglong)puVar5;
          param_1[1] = (ulonglong)puVar2;
          return;
        }
        if (puVar2 != puVar7) {
          uVar1 = *puVar5;
          *puVar5 = *puVar2;
          *puVar2 = uVar1;
          uVar1 = puVar2[1];
          puVar2[1] = puVar5[1];
          puVar5[1] = uVar1;
        }
        uVar1 = *puVar5;
        *puVar5 = *puVar7;
        *puVar7 = uVar1;
        uVar1 = puVar7[1];
        puVar7[1] = puVar5[1];
        puVar5[1] = uVar1;
        puVar7 = puVar7 + 2;
        puVar2 = puVar2 + 2;
        puVar4 = puVar8;
        puVar5 = puVar5 + 2;
      }
      else {
        puVar4 = puVar8 + -2;
        if (puVar7 == param_3) {
          puVar6 = puVar5 + -2;
          if (puVar4 != puVar6) {
            uVar1 = *puVar4;
            *puVar4 = *puVar6;
            *puVar6 = uVar1;
            uVar1 = puVar5[-1];
            puVar5[-1] = puVar8[-1];
            puVar8[-1] = uVar1;
          }
          uVar1 = *puVar6;
          *puVar6 = puVar2[-2];
          puVar2[-2] = uVar1;
          uVar1 = puVar2[-1];
          puVar2[-1] = puVar5[-1];
          puVar5[-1] = uVar1;
          puVar2 = puVar2 + -2;
          puVar5 = puVar6;
        }
        else {
          uVar1 = *puVar7;
          *puVar7 = *puVar4;
          *puVar4 = uVar1;
          uVar1 = puVar8[-1];
          puVar8[-1] = puVar7[1];
          puVar7[1] = uVar1;
          puVar7 = puVar7 + 2;
        }
      }
      goto joined_r0x0001402cea43;
    }
    local_118 = *puVar7;
    local_110 = puVar7[1];
    if (local_110 != 0) {
      LOCK();
      *(int *)(local_110 + 8) = *(int *)(local_110 + 8) + 1;
      UNLOCK();
    }
    local_f8 = *puVar5;
    local_f0 = puVar5[1];
    if (local_f0 != 0) {
      LOCK();
      *(int *)(local_f0 + 8) = *(int *)(local_f0 + 8) + 1;
      UNLOCK();
    }
    cVar3 = FUN_1402ce4f0(&local_f8,&local_118);
    puVar8 = puVar2;
    if (cVar3 == '\0') {
      local_d8 = *puVar5;
      local_d0 = puVar5[1];
      if (local_d0 != 0) {
        LOCK();
        *(int *)(local_d0 + 8) = *(int *)(local_d0 + 8) + 1;
        UNLOCK();
      }
      local_b8 = *puVar7;
      local_b0 = puVar7[1];
      if (local_b0 != 0) {
        LOCK();
        *(int *)(local_b0 + 8) = *(int *)(local_b0 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_1402ce4f0(&local_b8,&local_d8);
      if (cVar3 != '\0') goto joined_r0x0001402ceb0e;
      puVar8 = puVar2 + 2;
      uVar1 = *puVar2;
      *puVar2 = *puVar7;
      *puVar7 = uVar1;
      uVar1 = puVar7[1];
      puVar7[1] = puVar2[1];
      puVar2[1] = uVar1;
    }
    puVar7 = puVar7 + 2;
    puVar2 = puVar8;
  } while( true );
}



void FUN_1402cecf0(longlong param_1,longlong param_2,longlong param_3,undefined1 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = param_3 - param_1 >> 4;
  if (0x28 < lVar1) {
    lVar1 = lVar1 + 1;
    lVar2 = (longlong)(lVar1 + (ulonglong)((uint)(lVar1 >> 0x3f) & 7)) >> 3;
    lVar1 = lVar2 * 0x10 + param_1;
    FUN_1402cf0f0(param_1,lVar1,lVar2 * 0x20 + param_1);
    FUN_1402cf0f0(param_2 + lVar2 * -0x10,param_2,lVar2 * 0x10 + param_2,param_4);
    lVar3 = param_3 + lVar2 * -0x10;
    FUN_1402cf0f0(param_3 + lVar2 * -0x20,lVar3,param_3,param_4);
    FUN_1402cf0f0(lVar1,param_2,lVar3,param_4);
    return;
  }
  FUN_1402cf0f0();
  return;
}



void FUN_1402cedd0(longlong param_1,longlong param_2,undefined1 param_3)

{
  int *piVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined8 local_30;
  longlong *local_28;
  
  lVar6 = param_2 - param_1 >> 4;
  lVar4 = lVar6 - (param_2 - param_1 >> 0x3f) >> 1;
  if (0 < lVar4) {
    puVar5 = (undefined8 *)(lVar4 * 0x10 + param_1);
    do {
      lVar4 = lVar4 + -1;
      local_30 = puVar5[-2];
      plVar2 = (longlong *)puVar5[-1];
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
        UNLOCK();
      }
      local_28 = plVar2;
      FUN_1402cf250(param_1,lVar4,lVar6,&local_30,param_3);
      plVar3 = local_28;
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        plVar2 = plVar2 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          (**(code **)(*local_28 + 8))(local_28);
          LOCK();
          piVar1 = (int *)((longlong)plVar3 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_28 + 0x10))();
          }
        }
      }
      puVar5 = puVar5 + -2;
    } while (0 < lVar4);
  }
  return;
}



void FUN_1402ceeb0(undefined8 *param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 uVar5;
  longlong lVar6;
  undefined8 *puVar7;
  char cVar8;
  undefined8 *puVar9;
  longlong *plVar11;
  undefined8 uVar12;
  undefined8 local_70;
  longlong local_68;
  undefined8 local_60;
  longlong *local_58;
  undefined8 local_50;
  longlong local_48;
  undefined8 local_40;
  longlong *local_38;
  undefined8 *puVar10;
  
  if (param_1 != param_2) {
    uVar12 = 0xfffffffffffffffe;
    puVar7 = param_1;
    while (puVar7 = puVar7 + 2, puVar7 != param_2) {
      uVar3 = *puVar7;
      plVar4 = (longlong *)puVar7[1];
      if (plVar4 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
        UNLOCK();
      }
      local_70 = *param_1;
      local_68 = param_1[1];
      if (local_68 != 0) {
        LOCK();
        *(int *)(local_68 + 8) = *(int *)(local_68 + 8) + 1;
        UNLOCK();
      }
      if (plVar4 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
        UNLOCK();
      }
      local_60 = uVar3;
      local_58 = plVar4;
      cVar8 = FUN_1402ce4f0(&local_60,&local_70);
      puVar9 = puVar7;
      if (cVar8 == '\0') {
        while( true ) {
          puVar10 = puVar9 + -2;
          local_50 = *puVar10;
          local_48 = puVar9[-1];
          if (local_48 != 0) {
            LOCK();
            *(int *)(local_48 + 8) = *(int *)(local_48 + 8) + 1;
            UNLOCK();
          }
          if (plVar4 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
            UNLOCK();
          }
          local_40 = uVar3;
          local_38 = plVar4;
          cVar8 = FUN_1402ce4f0(&local_40,&local_50);
          if (cVar8 == '\0') break;
          uVar5 = *puVar10;
          lVar6 = puVar9[-1];
          if (lVar6 != 0) {
            LOCK();
            *(int *)(lVar6 + 8) = *(int *)(lVar6 + 8) + 1;
            UNLOCK();
          }
          *puVar9 = uVar5;
          plVar11 = (longlong *)puVar9[1];
          puVar9[1] = lVar6;
          puVar9 = puVar10;
          if (plVar11 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar11 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              (**(code **)(*plVar11 + 8))(plVar11);
              LOCK();
              piVar2 = (int *)((longlong)plVar11 + 0xc);
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              if (*piVar2 == 0) {
                (**(code **)(*plVar11 + 0x10))(plVar11);
              }
            }
          }
        }
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
          UNLOCK();
        }
        *puVar9 = uVar3;
        plVar11 = (longlong *)puVar9[1];
        puVar9[1] = plVar4;
      }
      else {
        FUN_1402cf550(param_1,puVar7,puVar7 + 2,param_4,uVar12);
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
          UNLOCK();
        }
        *param_1 = uVar3;
        plVar11 = (longlong *)param_1[1];
        param_1[1] = plVar4;
      }
      if (plVar11 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar11 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*plVar11 + 8))(plVar11);
          LOCK();
          piVar2 = (int *)((longlong)plVar11 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar11 + 0x10))(plVar11);
          }
        }
      }
      if (plVar4 != (longlong *)0x0) {
        LOCK();
        plVar11 = plVar4 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          (**(code **)(*plVar4 + 8))(plVar4);
          LOCK();
          piVar2 = (int *)((longlong)plVar4 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar4 + 0x10))();
          }
        }
      }
    }
  }
  return;
}



void FUN_1402cf0f0(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  undefined8 uVar1;
  char cVar2;
  undefined8 local_68;
  longlong local_60;
  undefined8 local_58;
  longlong local_50;
  undefined8 local_48;
  longlong local_40;
  undefined8 local_38;
  longlong local_30;
  undefined8 local_28;
  longlong local_20;
  undefined8 local_18;
  longlong local_10;
  
  local_68 = *param_1;
  local_60 = param_1[1];
  if (local_60 != 0) {
    LOCK();
    *(int *)(local_60 + 8) = *(int *)(local_60 + 8) + 1;
    UNLOCK();
  }
  local_58 = *param_2;
  local_50 = param_2[1];
  if (local_50 != 0) {
    LOCK();
    *(int *)(local_50 + 8) = *(int *)(local_50 + 8) + 1;
    UNLOCK();
  }
  cVar2 = FUN_1402ce4f0(&local_58,&local_68);
  if (cVar2 != '\0') {
    uVar1 = *param_2;
    *param_2 = *param_1;
    *param_1 = uVar1;
    uVar1 = param_1[1];
    param_1[1] = param_2[1];
    param_2[1] = uVar1;
  }
  local_48 = *param_2;
  local_40 = param_2[1];
  if (local_40 != 0) {
    LOCK();
    *(int *)(local_40 + 8) = *(int *)(local_40 + 8) + 1;
    UNLOCK();
  }
  local_38 = *param_3;
  local_30 = param_3[1];
  if (local_30 != 0) {
    LOCK();
    *(int *)(local_30 + 8) = *(int *)(local_30 + 8) + 1;
    UNLOCK();
  }
  cVar2 = FUN_1402ce4f0(&local_38,&local_48);
  if (cVar2 != '\0') {
    uVar1 = *param_3;
    *param_3 = *param_2;
    *param_2 = uVar1;
    uVar1 = param_2[1];
    param_2[1] = param_3[1];
    param_3[1] = uVar1;
  }
  local_28 = *param_1;
  local_20 = param_1[1];
  if (local_20 != 0) {
    LOCK();
    *(int *)(local_20 + 8) = *(int *)(local_20 + 8) + 1;
    UNLOCK();
  }
  local_18 = *param_2;
  local_10 = param_2[1];
  if (local_10 != 0) {
    LOCK();
    *(int *)(local_10 + 8) = *(int *)(local_10 + 8) + 1;
    UNLOCK();
  }
  cVar2 = FUN_1402ce4f0(&local_18,&local_28);
  if (cVar2 != '\0') {
    uVar1 = *param_2;
    *param_2 = *param_1;
    *param_1 = uVar1;
    uVar1 = param_1[1];
    param_1[1] = param_2[1];
    param_2[1] = uVar1;
  }
  return;
}



void FUN_1402cf250(longlong param_1,longlong param_2,longlong param_3,undefined8 param_4,
                  undefined1 param_5)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 local_38;
  longlong local_30;
  undefined8 local_28;
  longlong local_20;
  
  lVar3 = param_2;
  while( true ) {
    lVar2 = lVar3 * 2 + 2;
    if (param_3 <= lVar2) break;
    local_38 = *(undefined8 *)(param_1 + -0x10 + lVar2 * 0x10);
    local_30 = *(longlong *)(param_1 + -8 + lVar2 * 0x10);
    if (local_30 != 0) {
      LOCK();
      *(int *)(local_30 + 8) = *(int *)(local_30 + 8) + 1;
      UNLOCK();
    }
    local_28 = *(undefined8 *)(param_1 + lVar2 * 0x10);
    local_20 = *(longlong *)(param_1 + 8 + lVar2 * 0x10);
    if (local_20 != 0) {
      LOCK();
      *(int *)(local_20 + 8) = *(int *)(local_20 + 8) + 1;
      UNLOCK();
    }
    cVar1 = FUN_1402ce4f0(&local_28,&local_38);
    if (cVar1 != '\0') {
      lVar2 = lVar3 * 2 + 1;
    }
    FUN_140343ec0(param_1 + lVar3 * 0x10,lVar2 * 0x10 + param_1);
    lVar3 = lVar2;
  }
  if (lVar2 == param_3) {
    FUN_140343ec0(param_1 + lVar3 * 0x10,param_1 + -0x10 + param_3 * 0x10);
    lVar3 = param_3 + -1;
  }
  FUN_1402cf370(param_1,lVar3,param_2,param_4,param_5);
  return;
}



void FUN_1402cf370(longlong param_1,longlong param_2,longlong param_3,undefined8 *param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  char cVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 local_38;
  longlong local_30;
  undefined8 local_28;
  longlong local_20;
  
  while (param_3 < param_2) {
    lVar7 = (param_2 + -1) / 2;
    local_30 = param_4[1];
    local_38 = *param_4;
    if (local_30 != 0) {
      LOCK();
      *(int *)(local_30 + 8) = *(int *)(local_30 + 8) + 1;
      UNLOCK();
    }
    puVar6 = (undefined8 *)(lVar7 * 0x10 + param_1);
    local_28 = *puVar6;
    local_20 = puVar6[1];
    if (local_20 != 0) {
      LOCK();
      *(int *)(local_20 + 8) = *(int *)(local_20 + 8) + 1;
      UNLOCK();
    }
    cVar5 = FUN_1402ce4f0(&local_28,&local_38);
    if (cVar5 == '\0') break;
    FUN_140343ec0(param_1 + param_2 * 0x10,puVar6);
    param_2 = lVar7;
  }
  lVar7 = param_4[1];
  uVar3 = *param_4;
  if (lVar7 != 0) {
    LOCK();
    *(int *)(lVar7 + 8) = *(int *)(lVar7 + 8) + 1;
    UNLOCK();
  }
  *(undefined8 *)(param_1 + param_2 * 0x10) = uVar3;
  plVar4 = *(longlong **)(param_1 + 8 + param_2 * 0x10);
  *(longlong *)(param_1 + 8 + param_2 * 0x10) = lVar7;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



void FUN_1402cf4a0(longlong param_1,longlong param_2,undefined1 param_3)

{
  int *piVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 local_20;
  longlong *local_18;
  
  local_20 = *(undefined8 *)(param_2 + -0x10);
  plVar2 = *(longlong **)(param_2 + -8);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
  }
  local_18 = plVar2;
  FUN_140343ec0((undefined8 *)(param_2 + -0x10),param_1);
  FUN_1402cf250(param_1,0,(param_2 - param_1) + -0x10 >> 4,&local_20,param_3);
  plVar3 = local_18;
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar2 = plVar2 + 1;
    *(int *)plVar2 = (int)*plVar2 + -1;
    UNLOCK();
    if ((int)*plVar2 == 0) {
      (**(code **)(*local_18 + 8))(local_18);
      LOCK();
      piVar1 = (int *)((longlong)plVar3 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_18 + 0x10))();
      }
    }
  }
  return;
}



undefined8 * FUN_1402cf550(longlong param_1,longlong param_2,undefined8 *param_3)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  
  while (param_1 != param_2) {
    lVar3 = *(longlong *)(param_2 + -8);
    uVar4 = *(undefined8 *)(param_2 + -0x10);
    param_2 = param_2 + -0x10;
    puVar6 = param_3 + -2;
    if (lVar3 != 0) {
      LOCK();
      *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
      UNLOCK();
    }
    *puVar6 = uVar4;
    plVar5 = (longlong *)param_3[-1];
    param_3[-1] = lVar3;
    param_3 = puVar6;
    if (plVar5 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar5 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar5 + 8))(plVar5);
        LOCK();
        piVar2 = (int *)((longlong)plVar5 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar5 + 0x10))(plVar5);
        }
      }
    }
  }
  return param_3;
}



void * FUN_1402cf600(void *param_1,uint param_2)

{
  FUN_1402cf630();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402cf630(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = M3dSMdataBLoad::vftable;
  plVar3 = (longlong *)param_1[0x13];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x11];
  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);
      }
    }
  }
  if (param_1[7] != 0) {
    FUN_1402c6290();
  }
  *param_1 = mcoBinaryLoad::vftable;
  if ((DAT_140607be1 != '\0') && (param_1[1] != 0)) {
    piVar2 = (int *)(param_1[1] + 0x10);
    *piVar2 = *piVar2 + -1;
  }
  if (7 < (ulonglong)param_1[5]) {
    operator_delete((void *)param_1[2]);
  }
  param_1[5] = 7;
  param_1[4] = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1402cf720(longlong param_1)

{
  undefined8 *puVar1;
  undefined4 *puVar2;
  int iVar3;
  longlong lVar4;
  undefined1 auVar5 [16];
  void *pvVar6;
  int *piVar7;
  ulonglong uVar8;
  __uint64 _Var9;
  undefined2 *puVar10;
  longlong *plVar11;
  int *piVar12;
  int *piVar13;
  uint uVar14;
  int *piVar15;
  undefined1 auStackY_d88 [32];
  ushort local_d58 [2];
  int local_d54;
  int *local_d50;
  int local_d48;
  int local_d44;
  int local_d40 [2];
  undefined8 local_d38;
  undefined4 local_d30;
  undefined4 local_d2c;
  undefined4 local_d28;
  undefined4 local_d24 [3];
  undefined8 local_d18;
  undefined4 uStack_d10;
  undefined4 uStack_d0c;
  undefined4 uStack_d08;
  undefined4 uStack_d04;
  undefined4 uStack_d00;
  undefined4 uStack_cfc;
  undefined4 uStack_cf8;
  undefined4 uStack_cf4;
  undefined4 uStack_cf0;
  undefined4 local_cec;
  undefined8 local_ce8;
  undefined4 uStack_ce0;
  undefined4 uStack_cdc;
  undefined4 uStack_cd8;
  undefined4 uStack_cd4;
  undefined8 uStack_cd0;
  undefined4 local_cc8;
  undefined8 uStack_cc4;
  undefined4 uStack_cbc;
  undefined4 local_cb8;
  undefined4 local_ca8;
  undefined2 local_ca4;
  undefined6 uStack_ca2;
  undefined8 local_c94;
  ulonglong local_c8c;
  undefined2 local_c78 [264];
  undefined2 local_a68;
  undefined1 local_a66 [510];
  undefined2 local_868 [264];
  undefined2 local_658 [256];
  undefined2 local_458 [256];
  undefined2 local_258 [256];
  ulonglong local_58;
  
  local_d38 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStackY_d88;
  piVar13 = (int *)0x0;
  local_a68 = 0;
  memset(local_a66,0,0x1fe);
  local_d58[0] = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_d58,2);
  if (local_d58[0] == 0) {
    local_258[0] = 0;
  }
  else {
    (**(code **)(**(longlong **)(param_1 + 8) + 8))
              (*(longlong **)(param_1 + 8),local_258,(ulonglong)local_d58[0] * 2);
    local_258[local_d58[0]] = 0;
  }
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_1 + 0x78,4);
  pvVar6 = operator_new(0x178);
  piVar7 = piVar13;
  if (pvVar6 != (void *)0x0) {
    piVar7 = (int *)FUN_1402c9c00(pvVar6);
  }
  FUN_1402d00d0(param_1 + 0x80,piVar7);
  FUN_1402c4b60(param_1,&local_a68);
  local_d48 = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d48,4);
  piVar7 = piVar13;
  if (0 < local_d48) {
    do {
      local_d50 = (int *)((ulonglong)local_d50 & 0xffffffff00000000);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d50,4);
      piVar12 = piVar13;
      if (0 < (int)local_d50) {
        do {
          local_d54 = 0;
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d54,4);
          piVar15 = piVar13;
          if (0 < local_d54) {
            do {
              local_d58[0] = 0;
              (**(code **)(**(longlong **)(param_1 + 8) + 8))
                        (*(longlong **)(param_1 + 8),local_d58,2);
              if (local_d58[0] == 0) {
                local_658[0] = 0;
              }
              else {
                (**(code **)(**(longlong **)(param_1 + 8) + 8))
                          (*(longlong **)(param_1 + 8),local_658,(ulonglong)local_d58[0] * 2);
                local_658[local_d58[0]] = 0;
              }
              local_d58[0] = 0;
              (**(code **)(**(longlong **)(param_1 + 8) + 8))
                        (*(longlong **)(param_1 + 8),local_d58,2);
              if (local_d58[0] == 0) {
                local_458[0] = 0;
              }
              else {
                (**(code **)(**(longlong **)(param_1 + 8) + 8))
                          (*(longlong **)(param_1 + 8),local_458,(ulonglong)local_d58[0] * 2);
                local_458[local_d58[0]] = 0;
              }
              local_d58[0] = 0;
              (**(code **)(**(longlong **)(param_1 + 8) + 8))
                        (*(longlong **)(param_1 + 8),local_d58,2);
              if ((ushort)(local_d58[0] - 1) < 0x103) {
                (**(code **)(**(longlong **)(param_1 + 8) + 8))
                          (*(longlong **)(param_1 + 8),local_c78,(ulonglong)local_d58[0] * 2);
                local_c78[local_d58[0]] = 0;
                if (local_d58[0] < 3) goto LAB_1402cf9e2;
                plVar11 = (longlong *)(param_1 + 0x10);
                if (7 < *(ulonglong *)(param_1 + 0x28)) {
                  plVar11 = (longlong *)*plVar11;
                }
                FUN_140123580(&local_a68,plVar11,local_c78);
              }
              else {
LAB_1402cf9e2:
                local_a68 = 0;
              }
              uVar14 = (int)piVar15 + 1;
              piVar15 = (int *)(ulonglong)uVar14;
            } while ((int)uVar14 < local_d54);
          }
          uVar14 = (int)piVar12 + 1;
          piVar12 = (int *)(ulonglong)uVar14;
        } while ((int)uVar14 < (int)local_d50);
      }
      uVar14 = (int)piVar7 + 1;
      piVar7 = (int *)(ulonglong)uVar14;
    } while ((int)uVar14 < local_d48);
  }
  local_d40[0] = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_d40,4);
  if (local_d40[0] != 0) {
    local_d54 = 0;
    (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d54,4);
    local_d50 = (int *)((ulonglong)local_d50 & 0xffffffff00000000);
    memset(local_868,0,0x208);
    (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d50,4);
    if ((int)local_d50 != 0) {
      FUN_1402c4b60(param_1,local_868);
    }
  }
  *(undefined4 *)(*(longlong *)(param_1 + 0x80) + 0x138) = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))
            (*(longlong **)(param_1 + 8),*(longlong *)(param_1 + 0x80) + 0x138,4);
  iVar3 = *(int *)(*(longlong *)(param_1 + 0x80) + 0x138);
  auVar5._8_8_ = 0;
  auVar5._0_8_ = (longlong)iVar3;
  uVar8 = SUB168(ZEXT816(0xd4) * auVar5,0);
  if (SUB168(ZEXT816(0xd4) * auVar5,8) != 0) {
    uVar8 = 0xffffffffffffffff;
  }
  _Var9 = uVar8 + 4;
  if (0xfffffffffffffffb < uVar8) {
    _Var9 = 0xffffffffffffffff;
  }
  local_d50 = operator_new(_Var9);
  piVar7 = piVar13;
  if (local_d50 != (int *)0x0) {
    *local_d50 = iVar3;
    piVar7 = local_d50 + 1;
    _eh_vector_constructor_iterator_(piVar7,0xd4,iVar3,FUN_14034eb10,FUN_14034ebc0);
  }
  *(int **)(*(longlong *)(param_1 + 0x80) + 0x140) = piVar7;
  piVar7 = piVar13;
  if (0 < *(int *)(*(longlong *)(param_1 + 0x80) + 0x138)) {
    do {
      local_ca8 = 0;
      local_c8c = 7;
      local_c94 = 0;
      local_ca4 = 0;
      local_d30 = 0;
      local_d2c = 0;
      local_d28 = 0;
      local_d24[0] = 0;
      local_d18 = 0;
      uStack_d10 = 0;
      local_ce8 = 0;
      uStack_ce0 = 0;
      uStack_cdc = 0;
      uStack_cd8 = 0;
      uStack_cd4 = 0;
      uStack_cd0 = 0;
      local_cc8 = 0;
      uStack_cc4 = 0;
      uStack_cbc = 0;
      local_cb8 = 0;
      uStack_d0c = 0x3f800000;
      uStack_d08 = 0;
      uStack_d04 = 0;
      uStack_d00 = 0;
      uStack_cfc = 0x3f800000;
      uStack_cf8 = 0;
      uStack_cf4 = 0;
      uStack_cf0 = 0;
      local_cec = 0x3f800000;
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_ca8,4);
      FUN_1402c4580(param_1,&local_ca4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d50,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d30,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d2c,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d28,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_d24,4);
      FUN_1402c4980(param_1,&local_d18);
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x80) + 0x140);
      *(undefined4 *)((longlong)piVar13 + lVar4 + 0x2c) = local_ca8;
      FUN_1400015e0((longlong)piVar13 + lVar4 + 0x30,&local_ca4,0,0xffffffffffffffff);
      *(int *)((longlong)piVar13 + *(longlong *)(*(longlong *)(param_1 + 0x80) + 0x140) + 0xcc) =
           (int)local_d50;
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x80) + 0x140);
      *(undefined4 *)((longlong)piVar13 + lVar4 + 0xbc) = local_d30;
      *(undefined4 *)((longlong)piVar13 + lVar4 + 0xc0) = local_d2c;
      *(undefined4 *)((longlong)piVar13 + lVar4 + 0xc4) = local_d28;
      *(undefined4 *)((longlong)piVar13 + lVar4 + 200) = local_d24[0];
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x80) + 0x140);
      puVar1 = (undefined8 *)((longlong)piVar13 + lVar4 + 0x58);
      *puVar1 = local_d18;
      puVar1[1] = CONCAT44(uStack_d0c,uStack_d10);
      puVar1 = (undefined8 *)((longlong)piVar13 + lVar4 + 0x68);
      *puVar1 = CONCAT44(uStack_d04,uStack_d08);
      puVar1[1] = CONCAT44(uStack_cfc,uStack_d00);
      puVar1 = (undefined8 *)((longlong)piVar13 + lVar4 + 0x78);
      *puVar1 = CONCAT44(uStack_cf4,uStack_cf8);
      puVar1[1] = CONCAT44(local_cec,uStack_cf0);
      puVar1 = (undefined8 *)((longlong)piVar13 + lVar4 + 0x88);
      *puVar1 = local_ce8;
      puVar1[1] = CONCAT44(uStack_cdc,uStack_ce0);
      puVar2 = (undefined4 *)((longlong)piVar13 + lVar4 + 0x98);
      *puVar2 = uStack_cd8;
      puVar2[1] = uStack_cd4;
      puVar2[2] = (undefined4)uStack_cd0;
      puVar2[3] = uStack_cd0._4_4_;
      puVar2 = (undefined4 *)((longlong)piVar13 + lVar4 + 0xa8);
      *puVar2 = local_cc8;
      puVar2[1] = (undefined4)uStack_cc4;
      puVar2[2] = uStack_cc4._4_4_;
      puVar2[3] = uStack_cbc;
      *(undefined4 *)((longlong)piVar13 + lVar4 + 0xb8) = local_cb8;
      local_c94 = 0;
      puVar10 = &local_ca4;
      if (7 < local_c8c) {
        puVar10 = (undefined2 *)CONCAT62(uStack_ca2,local_ca4);
      }
      *puVar10 = 0;
      if (7 < local_c8c) {
        operator_delete((void *)CONCAT62(uStack_ca2,local_ca4));
      }
      uVar14 = (int)piVar7 + 1;
      piVar13 = piVar13 + 0x35;
      piVar7 = (int *)(ulonglong)uVar14;
    } while ((int)uVar14 < *(int *)(*(longlong *)(param_1 + 0x80) + 0x138));
  }
  local_d44 = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_d44,4);
  if (local_d44 == 0) {
    return 0;
  }
  local_d58[0] = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_d58,2);
  if ((ushort)(local_d58[0] - 1) < 0x103) {
    (**(code **)(**(longlong **)(param_1 + 8) + 8))
              (*(longlong **)(param_1 + 8),local_868,(ulonglong)local_d58[0] * 2);
    local_658[(ulonglong)local_d58[0] - 0x108] = 0;
    if (2 < local_d58[0]) {
      plVar11 = (longlong *)(param_1 + 0x10);
      if (7 < *(ulonglong *)(param_1 + 0x28)) {
        plVar11 = (longlong *)*plVar11;
      }
      FUN_140123580(local_c78,plVar11,local_868);
      goto LAB_1402cfe4a;
    }
  }
  local_c78[0] = 0;
LAB_1402cfe4a:
  FUN_1402ca090(*(undefined8 *)(param_1 + 0x80),local_c78);
  return 0;
}



int FUN_1402cfea0(longlong param_1,short *param_2)

{
  short sVar1;
  wchar_t wVar2;
  longlong lVar3;
  char cVar4;
  int iVar5;
  ulonglong uVar6;
  wchar_t *pwVar7;
  wchar_t *pwVar8;
  short *psVar9;
  undefined8 uVar10;
  undefined **local_80;
  longlong local_78;
  undefined4 local_70;
  FILE *local_68;
  longlong local_60 [9];
  
  uVar10 = 0xfffffffffffffffe;
  FUN_1402c4450();
  pwVar8 = (wchar_t *)(param_1 + 0x10);
  uVar6 = 0xffffffffffffffff;
  psVar9 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar9;
    psVar9 = psVar9 + 1;
  } while (sVar1 != 0);
  iVar5 = FUN_140123e30(pwVar8,*(undefined8 *)(param_1 + 0x20),param_2,~uVar6 - 1,uVar10);
  if (iVar5 != 0) {
    FUN_140418da0(DAT_140607fd8,L"Mdata Load Error, %s",param_2);
  }
  pwVar7 = pwVar8;
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    pwVar7 = *(wchar_t **)pwVar8;
  }
  local_78 = 0;
  local_70 = 0;
  local_80 = MagiFileStream::vftable;
  local_68 = (FILE *)0x0;
  _wfopen_s(&local_68,pwVar7,L"rb");
  if (local_68 != (FILE *)0x0) {
    _fseeki64(local_68,0,2);
    local_78 = _ftelli64(local_68);
    _fseeki64(local_68,0,0);
  }
  (*(code *)local_80[7])(&local_80);
  *(undefined ****)(param_1 + 8) = &local_80;
  cVar4 = (*(code *)local_80[7])(&local_80);
  if (cVar4 == '\0') {
    local_80 = MagiFileStream::vftable;
    cVar4 = FUN_140168350(&local_80);
    if (cVar4 != '\0') {
      fclose(local_68);
    }
    iVar5 = -0x7fffbffb;
  }
  else {
    iVar5 = FUN_1402cf720();
    if (iVar5 == 0) {
      if (7 < *(ulonglong *)(param_1 + 0x28)) {
        pwVar8 = *(wchar_t **)pwVar8;
      }
      uVar6 = 0xffffffffffffffff;
      pwVar7 = pwVar8;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        wVar2 = *pwVar7;
        pwVar7 = pwVar7 + 1;
      } while (wVar2 != L'\0');
      FUN_140001710(*(longlong *)(param_1 + 0x80) + 0x38,pwVar8,~uVar6 - 1);
      lVar3 = *(longlong *)(param_1 + 0x80);
      FUN_1402ca190(local_60,param_1 + 0x38);
      FUN_1402ca2a0(lVar3 + 0xf8,local_60);
      if (local_60[0] != 0) {
        FUN_1402c6290(local_60);
      }
      FUN_140343ec0(*(longlong *)(param_1 + 0x80) + 0xe8,param_1 + 0x90);
    }
    local_80 = MagiFileStream::vftable;
    cVar4 = FUN_140168350(&local_80);
    if (cVar4 != '\0') {
      fclose(local_68);
    }
  }
  return iVar5;
}



undefined8 * FUN_1402d00a0(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0x80);
  lVar1 = *(longlong *)(param_1 + 0x88);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



void FUN_1402d00d0(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_1402d0150(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



undefined8 * FUN_1402d0150(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;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

undefined8 FUN_1402d01c0(longlong param_1)

{
  longlong *plVar1;
  char cVar2;
  short sVar3;
  int **ppiVar4;
  int **ppiVar5;
  longlong lVar6;
  code *pcVar7;
  undefined1 auVar8 [16];
  undefined1 auVar9 [16];
  undefined8 uVar10;
  undefined8 uVar11;
  undefined8 uVar12;
  undefined8 uVar13;
  undefined8 uVar14;
  undefined8 uVar15;
  undefined8 uVar16;
  undefined8 uVar17;
  undefined8 uVar18;
  undefined8 uVar19;
  undefined8 uVar20;
  undefined4 uVar21;
  int *piVar22;
  int *piVar23;
  __uint64 _Var24;
  undefined8 *puVar25;
  longlong *plVar26;
  undefined8 uVar27;
  undefined2 *puVar28;
  int iVar29;
  ulonglong uVar30;
  int *piVar31;
  undefined4 *puVar32;
  short *psVar33;
  int *piVar34;
  char *pcVar35;
  int *piVar36;
  undefined8 *puVar37;
  void *pvVar38;
  undefined4 *puVar39;
  uint uVar40;
  uint uVar41;
  int *piVar42;
  short *psVar43;
  char *pcVar44;
  int *piVar45;
  int *piVar46;
  longlong lVar47;
  undefined1 auStackY_7a8 [32];
  uint local_778;
  ushort local_774 [2];
  undefined4 local_770 [2];
  void *local_768;
  uint local_760;
  uint local_75c;
  longlong *local_758;
  int local_750;
  int local_74c;
  int local_748;
  int local_744;
  undefined1 local_740;
  undefined4 local_73c;
  undefined1 local_738;
  int local_734;
  undefined1 local_730;
  undefined4 local_72c;
  int local_728;
  int local_724;
  int *local_720;
  longlong *local_718;
  int local_710;
  int local_70c;
  undefined4 local_708;
  undefined4 local_704;
  int local_700;
  undefined4 local_6fc;
  undefined4 local_6f8 [2];
  ulonglong local_6f0;
  void *local_6e8;
  longlong *local_6e0;
  undefined4 *local_6d8;
  undefined4 *local_6d0;
  undefined4 *local_6c8;
  undefined4 *local_6b8;
  undefined4 *local_6b0;
  undefined4 *local_6a8;
  int local_698 [2];
  int *local_690;
  undefined4 local_688;
  int local_684;
  undefined4 local_680 [2];
  void *local_678;
  longlong *local_670;
  undefined4 local_668 [2];
  void **local_660;
  int *local_658;
  int *local_650;
  int *local_648;
  int *local_638;
  void *local_630;
  longlong *local_628;
  undefined8 local_620;
  undefined4 local_618;
  undefined4 local_614;
  undefined4 local_610;
  undefined4 local_60c;
  int local_608;
  int local_604;
  int local_600;
  int local_5fc [21];
  undefined4 local_5a8;
  undefined4 uStack_5a4;
  undefined4 uStack_5a0;
  undefined4 uStack_59c;
  undefined8 local_598;
  undefined4 uStack_590;
  undefined4 uStack_58c;
  undefined4 uStack_588;
  undefined4 uStack_584;
  undefined4 uStack_580;
  undefined4 uStack_57c;
  undefined4 uStack_578;
  undefined4 uStack_574;
  undefined4 uStack_570;
  undefined4 local_56c;
  undefined8 local_568;
  undefined4 uStack_560;
  undefined4 uStack_55c;
  undefined4 uStack_558;
  undefined4 uStack_554;
  undefined8 uStack_550;
  undefined4 local_548;
  undefined4 uStack_544;
  undefined4 uStack_540;
  undefined4 uStack_53c;
  undefined4 local_538;
  undefined8 local_528;
  undefined4 uStack_520;
  undefined4 uStack_51c;
  undefined4 uStack_518;
  undefined4 uStack_514;
  undefined4 uStack_510;
  undefined4 uStack_50c;
  undefined4 uStack_508;
  undefined4 uStack_504;
  undefined4 uStack_500;
  undefined4 local_4fc;
  undefined8 local_4f8;
  undefined4 uStack_4f0;
  undefined4 uStack_4ec;
  undefined4 uStack_4e8;
  undefined4 uStack_4e4;
  undefined8 uStack_4e0;
  undefined4 local_4d8;
  undefined4 uStack_4d4;
  undefined4 uStack_4d0;
  undefined4 uStack_4cc;
  undefined4 local_4c8;
  undefined8 local_4b8;
  undefined4 uStack_4b0;
  undefined4 uStack_4ac;
  undefined4 uStack_4a8;
  undefined4 uStack_4a4;
  undefined4 uStack_4a0;
  undefined4 uStack_49c;
  undefined4 uStack_498;
  undefined4 uStack_494;
  undefined4 uStack_490;
  undefined4 local_48c;
  undefined8 local_488;
  undefined4 uStack_480;
  undefined4 uStack_47c;
  undefined4 uStack_478;
  undefined4 uStack_474;
  undefined8 uStack_470;
  undefined4 local_468;
  undefined8 uStack_464;
  undefined4 uStack_45c;
  undefined4 local_458;
  undefined4 local_448;
  undefined2 local_444;
  undefined6 uStack_442;
  undefined8 local_434;
  ulonglong local_42c;
  undefined4 local_41c;
  undefined4 local_418;
  undefined4 local_414;
  undefined4 local_410;
  undefined8 local_40c;
  undefined4 uStack_404;
  undefined4 uStack_400;
  undefined4 uStack_3fc;
  undefined4 uStack_3f8;
  undefined4 uStack_3f4;
  undefined4 uStack_3f0;
  undefined4 uStack_3ec;
  undefined4 uStack_3e8;
  undefined4 uStack_3e4;
  undefined4 local_3e0;
  undefined8 local_3dc;
  undefined4 uStack_3d4;
  undefined4 uStack_3d0;
  undefined4 uStack_3cc;
  undefined4 uStack_3c8;
  undefined8 uStack_3c4;
  undefined4 local_3bc;
  undefined8 uStack_3b8;
  undefined4 uStack_3b0;
  undefined4 local_3ac;
  char local_3a8;
  undefined7 uStack_3a7;
  undefined8 local_398;
  ulonglong local_390;
  undefined4 local_380;
  undefined4 local_37c;
  undefined4 local_378;
  undefined4 local_374;
  undefined4 local_370;
  undefined4 local_36c;
  undefined4 local_368;
  undefined4 local_364;
  undefined4 local_360;
  undefined4 local_35c;
  undefined4 local_358;
  undefined4 local_354;
  undefined4 local_350;
  undefined4 local_34c;
  short local_348;
  undefined6 uStack_346;
  undefined8 local_338;
  ulonglong local_330;
  undefined4 local_320;
  undefined4 local_31c;
  undefined4 local_318;
  undefined4 local_314;
  undefined4 local_310;
  undefined4 local_30c;
  undefined4 local_308;
  undefined4 local_2f0;
  undefined4 local_2ec;
  undefined4 local_2e8;
  undefined4 local_2e4;
  undefined4 local_2e0;
  undefined4 local_2dc;
  undefined4 local_2d8;
  undefined2 local_2b8;
  undefined1 local_2b6 [510];
  ulonglong local_b8;
  
  local_620 = 0xfffffffffffffffe;
  local_b8 = DAT_1405d84f0 ^ (ulonglong)auStackY_7a8;
  piVar22 = operator_new(0x50);
  local_6f0 = 7;
  piVar45 = (int *)0x0;
  piVar23 = piVar45;
  if (piVar22 != (int *)0x0) {
    piVar22[6] = 7;
    piVar22[7] = 0;
    piVar22[4] = 0;
    piVar22[5] = 0;
    *(undefined2 *)piVar22 = 0;
    piVar22[10] = 0;
    piVar22[0xb] = 0;
    piVar22[0xc] = 0;
    piVar22[0xd] = 0;
    piVar22[0xe] = 0;
    piVar22[0xf] = 0;
    piVar22[0x12] = 0;
    piVar23 = piVar22;
  }
  *(int **)(param_1 + 0x40) = piVar23;
  local_778 = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_778,4);
  local_330 = 7;
  local_338 = 0;
  local_348 = 0;
  local_710 = 0;
  piVar23 = piVar45;
  if (0 < (int)local_778) {
    do {
      uVar30 = 0xffffffffffffffff;
      FUN_1402c4580(param_1,&local_348);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_710,4);
      local_768 = operator_new(0x2a8);
      piVar22 = piVar45;
      if (local_768 != (void *)0x0) {
        piVar22 = (int *)FUN_1402c6f50(local_768);
      }
      local_720 = piVar22;
      FUN_1402d24f0(&local_718,piVar22);
      FUN_140178e90(&local_720,piVar22,piVar22);
      psVar43 = &local_348;
      psVar33 = &local_348;
      if (7 < local_330) {
        psVar43 = (short *)CONCAT62(uStack_346,local_348);
        psVar33 = (short *)CONCAT62(uStack_346,local_348);
      }
      do {
        if (uVar30 == 0) break;
        uVar30 = uVar30 - 1;
        sVar3 = *psVar43;
        psVar43 = psVar43 + 1;
      } while (sVar3 != 0);
      FUN_140001710(local_720 + 0x6e,psVar33,~uVar30 - 1);
      local_720[0x78] = local_710;
      lVar47 = *(longlong *)(param_1 + 0x40);
      if (local_720 != (int *)0x0) {
        ppiVar4 = *(int ***)(lVar47 + 0x30);
        if ((&local_720 < ppiVar4) && (ppiVar5 = *(int ***)(lVar47 + 0x28), ppiVar5 <= &local_720))
        {
          if (ppiVar4 == *(int ***)(lVar47 + 0x38)) {
            FUN_1403435d0(lVar47 + 0x28);
          }
          puVar37 = (undefined8 *)
                    (((longlong)&local_720 - (longlong)ppiVar5 & 0xfffffffffffffff0U) +
                    *(longlong *)(lVar47 + 0x28));
          puVar25 = *(undefined8 **)(lVar47 + 0x30);
          if (puVar25 != (undefined8 *)0x0) {
            *puVar25 = *puVar37;
            lVar6 = puVar37[1];
            puVar25[1] = lVar6;
            if (lVar6 != 0) {
              LOCK();
              *(int *)(lVar6 + 8) = *(int *)(lVar6 + 8) + 1;
              UNLOCK();
            }
          }
          *(longlong *)(lVar47 + 0x30) = *(longlong *)(lVar47 + 0x30) + 0x10;
        }
        else {
          if (ppiVar4 == *(int ***)(lVar47 + 0x38)) {
            FUN_1403435d0(lVar47 + 0x28);
          }
          puVar25 = *(undefined8 **)(lVar47 + 0x30);
          if (puVar25 != (undefined8 *)0x0) {
            *puVar25 = local_720;
            puVar25[1] = local_718;
            if (local_718 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_718 + 1) = (int)local_718[1] + 1;
              UNLOCK();
            }
          }
          *(longlong *)(lVar47 + 0x30) = *(longlong *)(lVar47 + 0x30) + 0x10;
        }
        local_730 = 0;
        FUN_1402ce720(*(longlong *)(lVar47 + 0x28),*(longlong *)(lVar47 + 0x30),
                      *(longlong *)(lVar47 + 0x30) - *(longlong *)(lVar47 + 0x28) >> 4,0);
      }
      plVar26 = local_718;
      if (local_718 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_718 + 1;
        lVar47 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar47 == 1) {
          (**(code **)(*local_718 + 8))();
          LOCK();
          piVar22 = (int *)((longlong)plVar26 + 0xc);
          iVar29 = *piVar22;
          *piVar22 = *piVar22 + -1;
          UNLOCK();
          if (iVar29 == 1) {
            (**(code **)(*plVar26 + 0x10))();
          }
        }
      }
      uVar40 = (int)piVar23 + 1;
      piVar23 = (int *)(ulonglong)uVar40;
    } while ((int)uVar40 < (int)local_778);
  }
  local_618 = 0;
  local_614 = 0;
  local_610 = 0;
  local_60c = 0;
  local_4b8 = 0;
  uStack_4b0 = 0;
  local_488 = 0;
  uStack_480 = 0;
  uStack_47c = 0;
  uStack_478 = 0;
  uStack_474 = 0;
  uStack_470 = 0;
  local_468 = 0;
  uStack_464 = 0;
  uStack_45c = 0;
  local_458 = 0;
  uStack_4ac = 0x3f800000;
  uStack_4a8 = 0;
  uStack_4a4 = 0;
  uStack_4a0 = 0;
  uStack_49c = 0x3f800000;
  uStack_498 = 0;
  uStack_494 = 0;
  uStack_490 = 0;
  local_48c = 0x3f800000;
  local_448 = 0;
  local_42c = 7;
  local_434 = 0;
  local_444 = 0;
  local_41c = 0;
  local_418 = 0;
  local_414 = 0;
  local_410 = 0;
  local_40c = 0;
  uStack_404 = 0;
  local_3dc = 0;
  uStack_3d4 = 0;
  uStack_3d0 = 0;
  uStack_3cc = 0;
  uStack_3c8 = 0;
  uStack_3c4 = 0;
  local_3bc = 0;
  uStack_3b8 = 0;
  uStack_3b0 = 0;
  local_3ac = 0;
  uStack_400 = 0x3f800000;
  uStack_3fc = 0;
  uStack_3f8 = 0;
  uStack_3f4 = 0;
  uStack_3f0 = 0x3f800000;
  uStack_3ec = 0;
  uStack_3e8 = 0;
  uStack_3e4 = 0;
  local_3e0 = 0x3f800000;
  piVar23 = piVar45;
  piVar22 = piVar45;
  piVar42 = piVar45;
  if (0 < (int)local_778) {
    do {
      lVar47 = *(longlong *)(param_1 + 0x40);
      piVar31 = piVar45;
      if ((-1 < (longlong)piVar42) &&
         ((int)piVar23 < (int)(*(longlong *)(lVar47 + 0x30) - *(longlong *)(lVar47 + 0x28) >> 4))) {
        piVar31 = *(int **)((longlong)piVar22 + *(longlong *)(lVar47 + 0x28));
      }
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_618,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_614,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_610,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_60c,4);
      FUN_1402c4980(param_1,&local_4b8);
      local_41c = local_618;
      local_418 = local_614;
      local_414 = local_610;
      local_410 = local_60c;
      local_40c = local_4b8;
      uStack_404 = uStack_4b0;
      uStack_400 = uStack_4ac;
      uStack_3fc = uStack_4a8;
      uStack_3f8 = uStack_4a4;
      uStack_3f4 = uStack_4a0;
      uStack_3f0 = uStack_49c;
      uStack_3ec = uStack_498;
      uStack_3e8 = uStack_494;
      uStack_3e4 = uStack_490;
      local_3e0 = local_48c;
      local_3dc = local_488;
      uStack_3d4 = uStack_480;
      uStack_3d0 = uStack_47c;
      uStack_3cc = uStack_478;
      uStack_3c8 = uStack_474;
      uStack_3c4 = uStack_470;
      local_3bc = local_468;
      uStack_3b8 = uStack_464;
      uStack_3b0 = uStack_45c;
      local_3ac = local_458;
      FUN_1402c8500(piVar31,&local_448);
      uVar40 = (int)piVar23 + 1;
      piVar23 = (int *)(ulonglong)uVar40;
      piVar22 = piVar22 + 4;
      piVar42 = (int *)((longlong)piVar42 + 1);
    } while ((int)uVar40 < (int)local_778);
    local_6f0 = local_42c;
  }
  local_750 = 0;
  (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_750,4);
  local_760 = 0;
  local_758 = (longlong *)0x0;
  piVar23 = (int *)(ulonglong)local_778;
  if (0 < (int)local_778) {
    local_768 = (void *)0x0;
    piVar22 = piVar45;
    do {
      lVar47 = *(longlong *)(param_1 + 0x40);
      if (((longlong)local_758 < 0) ||
         ((int)(*(longlong *)(lVar47 + 0x30) - *(longlong *)(lVar47 + 0x28) >> 4) <= (int)piVar22))
      {
        local_660 = (void **)0x0;
      }
      else {
        local_660 = *(void ***)((longlong)local_768 + *(longlong *)(lVar47 + 0x28));
      }
      local_5fc[0x11] = 0;
      local_5fc[0x12] = 0;
      local_5fc[0x13] = 0;
      local_5fc[0x14] = 0;
      (**(code **)(**(longlong **)(param_1 + 8) + 8))
                (*(longlong **)(param_1 + 8),local_5fc + 0x11,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))
                (*(longlong **)(param_1 + 8),local_5fc + 0x12,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))
                (*(longlong **)(param_1 + 8),local_5fc + 0x13,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))
                (*(longlong **)(param_1 + 8),local_5fc + 0x14,4);
      iVar29 = local_750;
      auVar8._8_8_ = 0;
      auVar8._0_8_ = (longlong)local_750;
      uVar30 = SUB168(ZEXT816(0x30) * auVar8,0);
      if (SUB168(ZEXT816(0x30) * auVar8,8) != 0) {
        uVar30 = 0xffffffffffffffff;
      }
      _Var24 = uVar30 + 8;
      if (0xfffffffffffffff7 < uVar30) {
        _Var24 = 0xffffffffffffffff;
      }
      local_690 = operator_new(_Var24);
      if (local_690 == (int *)0x0) {
        local_638 = (int *)0x0;
        piVar23 = piVar45;
      }
      else {
        *local_690 = iVar29;
        piVar23 = local_690 + 2;
        local_638 = piVar23;
        _eh_vector_constructor_iterator_
                  (piVar23,0x30,iVar29,(_func_void_void_ptr *)&LAB_14034e920,FUN_1401407c0);
      }
      local_690 = (int *)((ulonglong)local_690 & 0xffffffff00000000);
      piVar22 = piVar45;
      if (0 < local_750) {
        do {
          local_668[0] = 0;
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_668,4);
          local_744 = 0;
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_744,4);
          local_658 = (int *)0x0;
          local_650 = (int *)0x0;
          local_648 = (int *)0x0;
          piVar31 = piVar45;
          piVar42 = piVar45;
          piVar36 = piVar45;
          piVar46 = piVar45;
          iVar29 = (int)piVar22;
          if (0 < local_744) {
            do {
              piVar23 = local_650;
              (**(code **)(**(longlong **)(param_1 + 8) + 8))
                        (*(longlong **)(param_1 + 8),&local_608,4);
              (**(code **)(**(longlong **)(param_1 + 8) + 8))
                        (*(longlong **)(param_1 + 8),&local_604,4);
              (**(code **)(**(longlong **)(param_1 + 8) + 8))
                        (*(longlong **)(param_1 + 8),&local_600,4);
              (**(code **)(**(longlong **)(param_1 + 8) + 8))
                        (*(longlong **)(param_1 + 8),local_5fc,4);
              piVar42 = piVar31;
              if ((&local_608 < piVar23) && (piVar31 <= &local_608)) {
                if (piVar23 == piVar36) {
                  uVar30 = (longlong)piVar23 - (longlong)piVar31 >> 4;
                  if (0xffffffffffffffe < uVar30) {
                    std::_Xlength_error("vector<T> too long");
                    pcVar7 = (code *)swi(3);
                    uVar27 = (*pcVar7)();
                    return uVar27;
                  }
                  piVar22 = (int *)(uVar30 + 1);
                  piVar34 = (int *)((longlong)piVar36 - (longlong)piVar31 >> 4);
                  if (piVar34 < piVar22) {
                    piVar23 = piVar45;
                    if (piVar34 <= (int *)(0xfffffffffffffff - ((ulonglong)piVar34 >> 1))) {
                      piVar23 = (int *)((longlong)piVar34 + ((ulonglong)piVar34 >> 1));
                    }
                    if (piVar23 < piVar22) {
                      piVar23 = piVar22;
                    }
                    FUN_1402d2250(&local_658,piVar23);
                    piVar42 = local_658;
                    piVar23 = local_650;
                    piVar36 = local_648;
                  }
                }
                piVar22 = (int *)(((longlong)&local_608 - (longlong)piVar31 & 0xfffffffffffffff0U) +
                                 (longlong)piVar42);
                if (piVar23 != (int *)0x0) {
                  *piVar23 = *piVar22;
                  piVar23[1] = piVar22[1];
                  piVar23[2] = piVar22[2];
                  iVar29 = piVar22[3];
LAB_1402d0b33:
                  piVar23[3] = iVar29;
                }
              }
              else {
                if (piVar23 == piVar36) {
                  uVar30 = (longlong)piVar23 - (longlong)piVar31 >> 4;
                  if (0xffffffffffffffe < uVar30) {
                    std::_Xlength_error("vector<T> too long");
                    goto LAB_1402d0be2;
                  }
                  piVar22 = (int *)(uVar30 + 1);
                  piVar31 = (int *)((longlong)piVar36 - (longlong)piVar31 >> 4);
                  if (piVar31 < piVar22) {
                    piVar23 = piVar45;
                    if (piVar31 <= (int *)(0xfffffffffffffff - ((ulonglong)piVar31 >> 1))) {
                      piVar23 = (int *)((longlong)piVar31 + ((ulonglong)piVar31 >> 1));
                    }
                    if (piVar23 < piVar22) {
                      piVar23 = piVar22;
                    }
                    FUN_1402d2250(&local_658,piVar23);
                    piVar42 = local_658;
                    piVar23 = local_650;
                    piVar36 = local_648;
                  }
                }
                if (piVar23 != (int *)0x0) {
                  *piVar23 = local_608;
                  piVar23[1] = local_604;
                  piVar23[2] = local_600;
                  iVar29 = local_5fc[0];
                  goto LAB_1402d0b33;
                }
              }
              local_650 = piVar23 + 4;
              uVar40 = (int)piVar46 + 1;
              piVar31 = piVar42;
              piVar46 = (int *)(ulonglong)uVar40;
            } while ((int)uVar40 < local_744);
            iVar29 = (int)local_690;
          }
          piVar23 = local_638;
          FUN_14034e940(local_638 + (longlong)iVar29 * 0xc + 2,&local_658);
          if (piVar42 != (int *)0x0) {
            operator_delete(piVar42);
          }
          uVar40 = iVar29 + 1;
          local_690 = (int *)CONCAT44(local_690._4_4_,uVar40);
          piVar22 = (int *)(ulonglong)uVar40;
        } while ((int)uVar40 < local_750);
      }
      local_660[0x54] = piVar23;
      local_760 = local_760 + 1;
      piVar22 = (int *)(ulonglong)local_760;
      local_758 = (longlong *)((longlong)local_758 + 1);
      local_768 = (void *)((longlong)local_768 + 0x10);
      piVar23 = (int *)(ulonglong)local_778;
    } while ((int)local_760 < (int)local_778);
  }
LAB_1402d0be2:
  uVar40 = (uint)piVar23;
  if (0 < (int)(uint)piVar23) {
    local_660 = &local_678;
    local_768 = (void *)0x0;
    piVar23 = piVar45;
    piVar22 = piVar45;
    do {
      pvVar38 = local_768;
      lVar47 = *(longlong *)(param_1 + 0x40);
      piVar42 = piVar45;
      if ((-1 < (longlong)piVar22) &&
         ((int)piVar23 < (int)(*(longlong *)(lVar47 + 0x30) - *(longlong *)(lVar47 + 0x28) >> 4))) {
        piVar42 = *(int **)((longlong)local_768 + *(longlong *)(lVar47 + 0x28));
      }
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_748,4);
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_684,4);
      local_6e8 = (void *)0x0;
      local_740 = 0;
      FUN_1402c8a60(&local_6e0,0,0);
      iVar29 = local_748;
      if (0 < local_748) {
        auVar9._8_8_ = 0;
        auVar9._0_8_ = (longlong)local_748;
        _Var24 = SUB168(ZEXT816(0x20) * auVar9,0);
        if (SUB168(ZEXT816(0x20) * auVar9,8) != 0) {
          _Var24 = 0xffffffffffffffff;
        }
        local_630 = operator_new(_Var24);
        if (local_630 == (void *)0x0) {
          local_630 = (void *)0x0;
        }
        else {
          iVar29 = iVar29 + -1;
          if (-1 < iVar29) {
            puVar25 = (undefined8 *)((longlong)local_630 + 0x10);
            do {
              puVar25[-2] = 0;
              puVar25[-1] = 0;
              *puVar25 = 0;
              puVar25[1] = 0;
              puVar25 = puVar25 + 4;
              iVar29 = iVar29 + -1;
            } while (-1 < iVar29);
          }
        }
        local_738 = 0;
        FUN_1402c8a60(&local_628,local_630,0);
        plVar26 = local_6e0;
        local_6e8 = local_630;
        local_6e0 = local_628;
        local_628 = plVar26;
        if (plVar26 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar26 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar26 + 8))(plVar26);
            LOCK();
            piVar31 = (int *)((longlong)plVar26 + 0xc);
            *piVar31 = *piVar31 + -1;
            UNLOCK();
            if (*piVar31 == 0) {
              (**(code **)(*plVar26 + 0x10))(plVar26);
            }
          }
        }
        (**(code **)(**(longlong **)(param_1 + 8) + 8))
                  (*(longlong **)(param_1 + 8),local_630,(longlong)local_748 << 5);
      }
      iVar29 = local_684;
      local_678 = local_6e8;
      local_670 = local_6e0;
      if (local_6e0 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_6e0 + 1) = (int)local_6e0[1] + 1;
        UNLOCK();
      }
      piVar42[0x7a] = local_748;
      *(void **)(piVar42 + 0x7c) = local_6e8;
      local_758 = local_6e0;
      if (local_6e0 != *(longlong **)(piVar42 + 0x7e)) {
        if (local_6e0 != (longlong *)0x0) {
          LOCK();
          *(int *)(local_6e0 + 1) = (int)local_6e0[1] + 1;
          UNLOCK();
        }
        plVar26 = *(longlong **)(piVar42 + 0x7e);
        if (plVar26 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar26 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar26 + 8))(plVar26);
            LOCK();
            piVar31 = (int *)((longlong)plVar26 + 0xc);
            *piVar31 = *piVar31 + -1;
            UNLOCK();
            if (*piVar31 == 0) {
              (**(code **)(*plVar26 + 0x10))(plVar26);
            }
          }
        }
        *(longlong **)(piVar42 + 0x7e) = local_758;
        pvVar38 = local_768;
      }
      plVar26 = local_670;
      piVar42[0x79] = iVar29;
      if (local_670 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_670 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_670 + 8))(local_670);
          LOCK();
          piVar42 = (int *)((longlong)plVar26 + 0xc);
          *piVar42 = *piVar42 + -1;
          UNLOCK();
          if (*piVar42 == 0) {
            (**(code **)(*plVar26 + 0x10))(plVar26);
          }
        }
      }
      plVar26 = local_6e0;
      if (local_6e0 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_6e0 + 1;
        lVar47 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar47 == 1) {
          (**(code **)(*local_6e0 + 8))(local_6e0);
          LOCK();
          piVar42 = (int *)((longlong)plVar26 + 0xc);
          iVar29 = *piVar42;
          *piVar42 = *piVar42 + -1;
          UNLOCK();
          if (iVar29 == 1) {
            (**(code **)(*local_6e0 + 0x10))();
          }
        }
      }
      uVar40 = (int)piVar23 + 1;
      piVar23 = (int *)(ulonglong)uVar40;
      piVar22 = (int *)((longlong)piVar22 + 1);
      local_768 = (void *)((longlong)pvVar38 + 0x10);
    } while ((int)uVar40 < (int)local_778);
    local_6f0 = local_42c;
    uVar40 = local_778;
  }
  local_2b8 = 0;
  memset(local_2b6,0,0x1fe);
  local_770[0] = 0;
  local_728 = 0;
  piVar23 = piVar45;
  piVar22 = piVar45;
  piVar42 = piVar45;
  if (0 < (int)uVar40) {
    do {
      lVar47 = *(longlong *)(param_1 + 0x40);
      piVar31 = piVar45;
      if ((-1 < (longlong)piVar22) &&
         ((int)piVar23 < (int)(*(longlong *)(lVar47 + 0x30) - *(longlong *)(lVar47 + 0x28) >> 4))) {
        piVar31 = *(int **)((longlong)piVar42 + *(longlong *)(lVar47 + 0x28));
      }
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_728,4);
      piVar36 = piVar45;
      if (0 < local_728) {
        do {
          local_774[0] = 0;
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_774,2);
          if (local_774[0] == 0) {
            local_2b8 = 0;
          }
          else {
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_2b8,(ulonglong)local_774[0] * 2);
            *(undefined2 *)(local_2b6 + (ulonglong)local_774[0] * 2 + -2) = 0;
          }
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_770,4);
          if (piVar31 != (int *)0x0) {
            FUN_1402c74b0(piVar31,&local_2b8,local_770[0]);
          }
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_770,4);
          if (piVar31 != (int *)0x0) {
            FUN_1402c7960(piVar31,&local_2b8,local_770[0]);
          }
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_770,4);
          if (piVar31 != (int *)0x0) {
            FUN_1402c7cd0(piVar31,&local_2b8,local_770[0]);
          }
          uVar40 = (int)piVar36 + 1;
          piVar36 = (int *)(ulonglong)uVar40;
        } while ((int)uVar40 < local_728);
      }
      uVar41 = (int)piVar23 + 1;
      piVar23 = (int *)(ulonglong)uVar41;
      piVar22 = (int *)((longlong)piVar22 + 1);
      piVar42 = piVar42 + 4;
      uVar40 = local_778;
    } while ((int)uVar41 < (int)local_778);
  }
  local_760 = 0;
  local_768 = (void *)0x0;
  if (0 < (int)uVar40) {
    local_758 = (longlong *)0x0;
    piVar23 = piVar45;
    do {
      lVar47 = *(longlong *)(param_1 + 0x40);
      piVar22 = piVar45;
      if ((-1 < (longlong)local_768) &&
         ((int)piVar23 < (int)(*(longlong *)(lVar47 + 0x30) - *(longlong *)(lVar47 + 0x28) >> 4))) {
        piVar22 = *(int **)((longlong)local_758 + *(longlong *)(lVar47 + 0x28));
      }
      local_74c = 0;
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_74c,4);
      if (piVar22 != (int *)0x0) {
        FUN_1402c8050(piVar22);
        FUN_1402c8150(piVar22);
      }
      plVar26 = (longlong *)(piVar22 + 0x16);
      lVar47 = 10;
      iVar29 = local_74c;
      do {
        piVar23 = piVar45;
        piVar42 = piVar45;
        if (0 < iVar29) {
          do {
            local_708 = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_708,4);
            if ((piVar22 != (int *)0x0) && ((int)piVar42 < piVar22[0x14])) {
              *(undefined4 *)((longlong)piVar23 + *plVar26) = local_708;
            }
            uVar40 = (int)piVar42 + 1;
            piVar23 = piVar23 + 1;
            piVar42 = (int *)(ulonglong)uVar40;
            iVar29 = local_74c;
          } while ((int)uVar40 < local_74c);
        }
        plVar26 = plVar26 + 2;
        lVar47 = lVar47 + -1;
      } while (lVar47 != 0);
      plVar26 = (longlong *)(piVar22 + 0x3e);
      lVar47 = 10;
      do {
        piVar23 = piVar45;
        piVar42 = piVar45;
        if (0 < iVar29) {
          do {
            local_75c = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_75c,4);
            if ((piVar22 != (int *)0x0) && ((int)piVar42 < piVar22[0x15])) {
              *(uint *)((longlong)piVar23 + *plVar26) = local_75c;
            }
            uVar40 = (int)piVar42 + 1;
            piVar23 = piVar23 + 1;
            piVar42 = (int *)(ulonglong)uVar40;
            iVar29 = local_74c;
          } while ((int)uVar40 < local_74c);
        }
        plVar26 = plVar26 + 2;
        lVar47 = lVar47 + -1;
      } while (lVar47 != 0);
      local_760 = local_760 + 1;
      piVar23 = (int *)(ulonglong)local_760;
      local_768 = (void *)((longlong)local_768 + 1);
      local_758 = (longlong *)((longlong)local_758 + 0x10);
      uVar40 = local_778;
    } while ((int)local_760 < (int)local_778);
  }
  local_75c = 0;
  local_758 = (longlong *)0x0;
  piVar23 = piVar45;
  if (0 < (int)uVar40) {
    do {
      lVar47 = *(longlong *)(param_1 + 0x40);
      if (((longlong)local_758 < 0) ||
         ((int)(*(longlong *)(lVar47 + 0x30) - *(longlong *)(lVar47 + 0x28) >> 4) <= (int)piVar23))
      {
        local_768 = (void *)0x0;
      }
      else {
        local_768 = *(void **)(*(longlong *)(lVar47 + 0x28) + (longlong)local_758 * 0x10);
      }
      (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_70c,4);
      piVar23 = piVar45;
      if (0 < local_70c) {
        do {
          local_6f8[0] = 0;
          local_6fc = 0;
          local_700 = 0;
          local_704 = 0x3f800000;
          local_73c = 0;
          local_72c = 0;
          local_390 = 0xf;
          local_398 = 0;
          local_3a8 = '\0';
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_6fc,4);
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_6f8,4);
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_680,4);
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_688,4);
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),local_698,4);
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_700,4);
          (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),&local_704,4);
          FUN_1402c4660(param_1,&local_3a8);
          plVar26 = (longlong *)FUN_1402d26f0(local_6f8[0]);
          if (plVar26 == (longlong *)0x0) {
LAB_1402d1e9a:
            if (0xf < local_390) {
              operator_delete((void *)CONCAT71(uStack_3a7,local_3a8));
            }
            local_390 = 0xf;
            local_398 = 0;
            local_3a8 = '\0';
            puVar28 = &local_444;
            if (7 < local_6f0) {
              puVar28 = (undefined2 *)CONCAT62(uStack_442,local_444);
            }
            *puVar28 = 0;
            if (7 < local_42c) {
              operator_delete((void *)CONCAT62(uStack_442,local_444));
            }
            if (7 < local_330) {
              operator_delete((void *)CONCAT62(uStack_346,local_348));
            }
            return 0x80004005;
          }
          *(undefined4 *)(plVar26 + 1) = local_6fc;
          *(undefined4 *)((longlong)plVar26 + 0xc) = local_680[0];
          *(undefined4 *)(plVar26 + 2) = local_688;
          *(bool *)((longlong)plVar26 + 0x14) = local_698[0] != 0;
          *(bool *)((longlong)plVar26 + 0x16) = local_700 != 0;
          *(undefined4 *)(plVar26 + 3) = local_704;
          pcVar35 = &local_3a8;
          if (0xf < local_390) {
            pcVar35 = (char *)CONCAT71(uStack_3a7,local_3a8);
          }
          uVar30 = 0xffffffffffffffff;
          pcVar44 = pcVar35;
          do {
            if (uVar30 == 0) break;
            uVar30 = uVar30 - 1;
            cVar2 = *pcVar44;
            pcVar44 = pcVar44 + 1;
          } while (cVar2 != '\0');
          FUN_140003e50(plVar26 + 4,pcVar35,~uVar30 - 1);
          iVar29 = (**(code **)(*plVar26 + 8))(plVar26);
          if (iVar29 == 0) {
            local_6b8 = (undefined4 *)0x0;
            local_6b0 = (undefined4 *)0x0;
            local_6a8 = (undefined4 *)0x0;
            local_5fc[9] = 0;
            local_5fc[10] = 0;
            local_5fc[0xb] = 0;
            local_5fc[0xc] = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 9,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 10,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 0xb,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 0xc,4);
            local_724 = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_724,4);
            piVar22 = piVar45;
            if (0 < local_724) {
              do {
                local_320 = 0;
                local_31c = 0;
                local_318 = 0;
                local_314 = 0;
                local_310 = 0;
                local_30c = 0x3f800000;
                local_308 = 0;
                FUN_1402c4740(param_1,&local_320);
                if ((&local_320 < local_6b0) && (local_6b8 <= &local_320)) {
                  lVar47 = (longlong)&local_320 - (longlong)local_6b8;
                  if (local_6b0 == local_6a8) {
                    uVar30 = ((longlong)local_6b0 - (longlong)local_6b8) / 0x2c;
                    if (0x5d1745d1745d173 < uVar30) goto LAB_1402d1e7e;
                    piVar31 = (int *)(uVar30 + 1);
                    piVar42 = (int *)(((longlong)local_6a8 - (longlong)local_6b8) / 0x2c);
                    if (piVar42 < piVar31) {
                      piVar36 = piVar45;
                      if (piVar42 <= (int *)(0x5d1745d1745d174 - ((ulonglong)piVar42 >> 1))) {
                        piVar36 = (int *)((longlong)piVar42 + ((ulonglong)piVar42 >> 1));
                      }
                      if (piVar36 < piVar31) {
                        piVar36 = piVar31;
                      }
                      FUN_1402d2310(&local_6b8,piVar36);
                    }
                  }
                  if (local_6b0 != (undefined4 *)0x0) {
                    memcpy(local_6b0,local_6b8 + (lVar47 / 0x2c) * 0xb,0x2c);
                  }
                }
                else {
                  if (local_6b0 == local_6a8) {
                    uVar30 = ((longlong)local_6b0 - (longlong)local_6b8) / 0x2c;
                    if (0x5d1745d1745d173 < uVar30) {
                      std::_Xlength_error("vector<T> too long");
                      goto LAB_1402d1e9a;
                    }
                    piVar31 = (int *)(uVar30 + 1);
                    piVar42 = (int *)(((longlong)local_6a8 - (longlong)local_6b8) / 0x2c);
                    if (piVar42 < piVar31) {
                      piVar36 = piVar45;
                      if (piVar42 <= (int *)(0x5d1745d1745d174 - ((ulonglong)piVar42 >> 1))) {
                        piVar36 = (int *)((longlong)piVar42 + ((ulonglong)piVar42 >> 1));
                      }
                      if (piVar36 < piVar31) {
                        piVar36 = piVar31;
                      }
                      FUN_1402d2310(&local_6b8,piVar36);
                    }
                  }
                  if (local_6b0 != (undefined4 *)0x0) {
                    memcpy(local_6b0,&local_320,0x2c);
                  }
                }
                local_6b0 = local_6b0 + 0xb;
                uVar40 = (int)piVar22 + 1;
                piVar22 = (int *)(ulonglong)uVar40;
              } while ((int)uVar40 < local_724);
            }
            (**(code **)(*plVar26 + 0x30))(plVar26,&local_6b8);
            puVar32 = local_6b8;
            if (local_6b8 != (undefined4 *)0x0) {
LAB_1402d1df8:
              operator_delete(puVar32);
            }
          }
          else if (iVar29 == 1) {
            local_5a8 = 0;
            uStack_5a4 = 0;
            uStack_5a0 = 0;
            uStack_59c = 0;
            local_598 = 0;
            uStack_590 = 0;
            local_568 = 0;
            uStack_560 = 0;
            uStack_55c = 0;
            uStack_558 = 0;
            uStack_554 = 0;
            uStack_550 = 0;
            local_548 = 0;
            uStack_544 = 0;
            uStack_540 = 0;
            uStack_53c = 0;
            local_538 = 0;
            uStack_58c = 0x3f800000;
            uStack_588 = 0;
            uStack_584 = 0;
            uStack_580 = 0;
            uStack_57c = 0x3f800000;
            uStack_578 = 0;
            uStack_574 = 0;
            uStack_570 = 0;
            local_56c = 0x3f800000;
            local_528 = 0;
            uStack_520 = 0;
            local_4f8 = 0;
            uStack_4f0 = 0;
            uStack_4ec = 0;
            uStack_4e8 = 0;
            uStack_4e4 = 0;
            uStack_4e0 = 0;
            local_4d8 = 0;
            uStack_4d4 = 0;
            uStack_4d0 = 0;
            uStack_4cc = 0;
            local_4c8 = 0;
            uStack_51c = 0x3f800000;
            uStack_518 = 0;
            uStack_514 = 0;
            uStack_510 = 0;
            uStack_50c = 0x3f800000;
            uStack_508 = 0;
            uStack_504 = 0;
            uStack_500 = 0;
            local_4fc = 0x3f800000;
            local_5fc[5] = 0;
            local_5fc[6] = 0;
            local_5fc[7] = 0;
            local_5fc[8] = 0;
            local_6d8 = (undefined4 *)0x0;
            local_6d0 = (undefined4 *)0x0;
            local_6c8 = (undefined4 *)0x0;
            local_5fc[0xd] = 0;
            local_5fc[0xe] = 0;
            local_5fc[0xf] = 0;
            local_5fc[0x10] = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 0xd,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 0xe,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 0xf,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 0x10,4);
            local_734 = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_734,4);
            piVar22 = piVar45;
            if (0 < local_734) {
              do {
                (**(code **)(**(longlong **)(param_1 + 8) + 8))
                          (*(longlong **)(param_1 + 8),local_5fc + 5,4);
                (**(code **)(**(longlong **)(param_1 + 8) + 8))
                          (*(longlong **)(param_1 + 8),local_5fc + 6,4);
                (**(code **)(**(longlong **)(param_1 + 8) + 8))
                          (*(longlong **)(param_1 + 8),local_5fc + 7,4);
                (**(code **)(**(longlong **)(param_1 + 8) + 8))
                          (*(longlong **)(param_1 + 8),local_5fc + 8,4);
                FUN_1402c4980(param_1,&local_528);
                uVar21 = local_4c8;
                uVar20 = uStack_4e0;
                uVar19 = local_4f8;
                uVar18 = local_528;
                local_5a8 = local_5fc[5];
                uStack_5a4 = local_5fc[6];
                uStack_5a0 = local_5fc[7];
                uStack_59c = local_5fc[8];
                uVar27 = CONCAT44(uStack_51c,uStack_520);
                local_598 = local_528;
                uStack_590 = uStack_520;
                uStack_58c = uStack_51c;
                uVar10 = CONCAT44(uStack_514,uStack_518);
                uVar11 = CONCAT44(uStack_50c,uStack_510);
                uStack_588 = uStack_518;
                uStack_584 = uStack_514;
                uStack_580 = uStack_510;
                uStack_57c = uStack_50c;
                uVar12 = CONCAT44(uStack_504,uStack_508);
                uVar13 = CONCAT44(local_4fc,uStack_500);
                uStack_578 = uStack_508;
                uStack_574 = uStack_504;
                uStack_570 = uStack_500;
                local_56c = local_4fc;
                uVar14 = CONCAT44(uStack_4ec,uStack_4f0);
                local_568 = local_4f8;
                uStack_560 = uStack_4f0;
                uStack_55c = uStack_4ec;
                uVar15 = CONCAT44(uStack_4e4,uStack_4e8);
                uStack_558 = uStack_4e8;
                uStack_554 = uStack_4e4;
                uStack_550 = uStack_4e0;
                uVar16 = CONCAT44(uStack_4d4,local_4d8);
                uVar17 = CONCAT44(uStack_4cc,uStack_4d0);
                local_548 = local_4d8;
                uStack_544 = uStack_4d4;
                uStack_540 = uStack_4d0;
                uStack_53c = uStack_4cc;
                local_538 = local_4c8;
                if ((&local_5a8 < local_6d0) && (local_6d8 <= &local_5a8)) {
                  lVar47 = (longlong)&local_5a8 - (longlong)local_6d8;
                  if (local_6d0 == local_6c8) {
                    uVar30 = ((longlong)local_6d0 - (longlong)local_6d8) / 0x74;
                    if (0x234f72c234f72c1 < uVar30) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar7 = (code *)swi(3);
                      uVar27 = (*pcVar7)();
                      return uVar27;
                    }
                    piVar31 = (int *)(uVar30 + 1);
                    piVar42 = (int *)(((longlong)local_6c8 - (longlong)local_6d8) / 0x74);
                    if (piVar42 < piVar31) {
                      piVar36 = piVar45;
                      if (piVar42 <= (int *)(0x234f72c234f72c2 - ((ulonglong)piVar42 >> 1))) {
                        piVar36 = (int *)((longlong)piVar42 + ((ulonglong)piVar42 >> 1));
                      }
                      if (piVar36 < piVar31) {
                        piVar36 = piVar31;
                      }
                      FUN_1402d2400(&local_6d8,piVar36);
                    }
                  }
                  puVar32 = local_6d0;
                  puVar39 = local_6d8 + (lVar47 / 0x74) * 0x1d;
                  if (local_6d0 != (undefined4 *)0x0) {
                    *local_6d0 = *puVar39;
                    local_6d0[1] = puVar39[1];
                    local_6d0[2] = puVar39[2];
                    local_6d0[3] = puVar39[3];
                    memcpy(local_6d0 + 4,puVar39 + 4,100);
                    puVar25 = (undefined8 *)(puVar32 + 4);
LAB_1402d1ab5:
                    FUN_1402bdc00(puVar25);
                  }
                }
                else {
                  if (local_6d0 == local_6c8) {
                    uVar30 = ((longlong)local_6d0 - (longlong)local_6d8) / 0x74;
                    if (0x234f72c234f72c1 < uVar30) {
                      std::_Xlength_error("vector<T> too long");
LAB_1402d1e7e:
                      std::_Xlength_error("vector<T> too long");
                      pcVar7 = (code *)swi(3);
                      uVar27 = (*pcVar7)();
                      return uVar27;
                    }
                    piVar31 = (int *)(uVar30 + 1);
                    piVar42 = (int *)(((longlong)local_6c8 - (longlong)local_6d8) / 0x74);
                    if (piVar42 < piVar31) {
                      piVar36 = piVar45;
                      if (piVar42 <= (int *)(0x234f72c234f72c2 - ((ulonglong)piVar42 >> 1))) {
                        piVar36 = (int *)((longlong)piVar42 + ((ulonglong)piVar42 >> 1));
                      }
                      if (piVar36 < piVar31) {
                        piVar36 = piVar31;
                      }
                      FUN_1402d2400(&local_6d8,piVar36);
                    }
                  }
                  if (local_6d0 != (undefined4 *)0x0) {
                    *local_6d0 = local_5a8;
                    local_6d0[1] = uStack_5a4;
                    local_6d0[2] = uStack_5a0;
                    local_6d0[3] = uStack_59c;
                    puVar25 = (undefined8 *)(local_6d0 + 4);
                    *puVar25 = uVar18;
                    *(undefined8 *)(local_6d0 + 6) = uVar27;
                    *(undefined8 *)(local_6d0 + 8) = uVar10;
                    *(undefined8 *)(local_6d0 + 10) = uVar11;
                    *(undefined8 *)(local_6d0 + 0xc) = uVar12;
                    *(undefined8 *)(local_6d0 + 0xe) = uVar13;
                    *(undefined8 *)(local_6d0 + 0x10) = uVar19;
                    *(undefined8 *)(local_6d0 + 0x12) = uVar14;
                    *(undefined8 *)(local_6d0 + 0x14) = uVar15;
                    *(undefined8 *)(local_6d0 + 0x16) = uVar20;
                    *(undefined8 *)(local_6d0 + 0x18) = uVar16;
                    *(undefined8 *)(local_6d0 + 0x1a) = uVar17;
                    local_6d0[0x1c] = uVar21;
                    goto LAB_1402d1ab5;
                  }
                }
                local_6d0 = local_6d0 + 0x1d;
                uVar40 = (int)piVar22 + 1;
                piVar22 = (int *)(ulonglong)uVar40;
              } while ((int)uVar40 < local_734);
            }
            (**(code **)(*plVar26 + 0x38))(plVar26,&local_6d8);
            if (local_6d8 != (undefined4 *)0x0) {
              std::_Container_base0::_Orphan_all((_Container_base0 *)&local_6d8);
              puVar32 = local_6d8;
              goto LAB_1402d1df8;
            }
          }
          else if (iVar29 == 2) {
            local_5fc[1] = 0;
            local_5fc[2] = 0;
            local_5fc[3] = 0;
            local_5fc[4] = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_73c,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_72c,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 1,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 2,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 3,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),local_5fc + 4,4);
            (**(code **)(*plVar26 + 0x40))(plVar26,local_5fc + 1);
          }
          else if (iVar29 == 3) {
            local_350 = 0;
            local_34c = 0;
            local_380 = 0x3f800000;
            local_37c = 0;
            local_378 = 0;
            local_374 = 0;
            local_370 = 0x3f800000;
            local_36c = 0;
            local_368 = 0;
            local_364 = 0;
            local_360 = 0x3f800000;
            local_35c = 0;
            local_358 = 0;
            local_354 = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_73c,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_72c,4);
            FUN_1402c4840(param_1,&local_380);
            (**(code **)(*plVar26 + 0x48))(plVar26,&local_380);
          }
          else if (iVar29 == 4) {
            local_2f0 = 0;
            local_2ec = 0;
            local_2e8 = 0;
            local_2e4 = 0;
            local_2e0 = 0;
            local_2dc = 0x3f800000;
            local_2d8 = 0;
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_73c,4);
            (**(code **)(**(longlong **)(param_1 + 8) + 8))
                      (*(longlong **)(param_1 + 8),&local_72c,4);
            FUN_1402c4740(param_1,&local_2f0);
            (**(code **)(*plVar26 + 0x50))(plVar26,&local_2f0);
          }
          if (local_768 != (void *)0x0) {
            FUN_1402c83a0(local_768,plVar26);
          }
          if (0xf < local_390) {
            operator_delete((void *)CONCAT71(uStack_3a7,local_3a8));
          }
          uVar40 = (int)piVar23 + 1;
          piVar23 = (int *)(ulonglong)uVar40;
        } while ((int)uVar40 < local_70c);
      }
      local_75c = local_75c + 1;
      piVar23 = (int *)(ulonglong)local_75c;
      local_758 = (longlong *)((longlong)local_758 + 1);
    } while ((int)local_75c < (int)local_778);
  }
  puVar28 = &local_444;
  if (7 < local_6f0) {
    puVar28 = (undefined2 *)CONCAT62(uStack_442,local_444);
  }
  *puVar28 = 0;
  if (7 < local_42c) {
    operator_delete((void *)CONCAT62(uStack_442,local_444));
  }
  if (7 < local_330) {
    operator_delete((void *)CONCAT62(uStack_346,local_348));
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_1402d1fc0(longlong param_1,short *param_2)

{
  short sVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  ulonglong uVar5;
  wchar_t *_Filename;
  short *psVar6;
  undefined1 auStack_a8 [32];
  undefined **local_88;
  longlong local_80;
  undefined4 local_78;
  FILE *local_70;
  undefined8 local_68;
  undefined2 local_60;
  undefined6 uStack_5e;
  undefined8 local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  FUN_1402c4450();
  _Filename = (wchar_t *)(param_1 + 0x10);
  uVar5 = 0xffffffffffffffff;
  psVar6 = param_2;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    sVar1 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar1 != 0);
  iVar3 = FUN_140123e30(_Filename,*(undefined8 *)(param_1 + 0x20),param_2,~uVar5 - 1);
  if (iVar3 != 0) {
    FUN_140418da0(DAT_140607fd8,L"M3dSMotionGroupLoad Error, %s",param_2);
  }
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    _Filename = *(wchar_t **)_Filename;
  }
  local_80 = 0;
  local_78 = 0;
  local_88 = MagiFileStream::vftable;
  local_70 = (FILE *)0x0;
  _wfopen_s(&local_70,_Filename,L"rb");
  if (local_70 != (FILE *)0x0) {
    _fseeki64(local_70,0,2);
    local_80 = _ftelli64(local_70);
    _fseeki64(local_70,0,0);
  }
  (*(code *)local_88[7])(&local_88);
  *(undefined ****)(param_1 + 8) = &local_88;
  cVar2 = (*(code *)local_88[7])(&local_88);
  if (cVar2 == '\0') {
    local_88 = MagiFileStream::vftable;
    cVar2 = FUN_140168350(&local_88);
    if (cVar2 != '\0') {
      fclose(local_70);
    }
    uVar4 = 0x80004005;
  }
  else {
    local_48 = 7;
    local_50 = 0;
    local_60 = 0;
    FUN_1402c4580(param_1,&local_60);
    (**(code **)(**(longlong **)(param_1 + 8) + 8))(*(longlong **)(param_1 + 8),param_1 + 0x38,4);
    uVar4 = FUN_1402d01c0(param_1);
    if (7 < local_48) {
      operator_delete((void *)CONCAT62(uStack_5e,local_60));
    }
    local_48 = 7;
    local_50 = 0;
    local_60 = 0;
    local_88 = MagiFileStream::vftable;
    cVar2 = FUN_140168350(&local_88);
    if (cVar2 != '\0') {
      fclose(local_70);
    }
  }
  return uVar4;
}



void FUN_1402d2190(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x2c;
  if (0x5d1745d1745d173 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x2c;
  if (uVar2 < uVar3) {
    if (0x5d1745d1745d174 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_1402d2310(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402d2310(param_1,uVar2);
  }
  return;
}



void FUN_1402d2250(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 (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) {
    lVar4 = FUN_1402d9030(param_2);
    FUN_1402d2560(*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 * 0x10 + lVar4;
    param_1[1] = (lVar2 - (longlong)pvVar1 & 0xfffffffffffffff0U) + lVar4;
    *param_1 = lVar4;
  }
  return;
}



void FUN_1402d2310(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 (0x5d1745d1745d174 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x2c) < param_2) {
    lVar4 = FUN_1402d2680(param_2);
    FUN_1402d25b0(*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 * 0x2c + lVar4;
    param_1[1] = ((lVar2 - (longlong)pvVar1) / 0x2c) * 0x2c + lVar4;
    *param_1 = lVar4;
  }
  return;
}



void FUN_1402d2400(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 (0x234f72c234f72c2 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x74) < param_2) {
    lVar4 = FUN_1402d2610(param_2);
    FUN_1402d2dd0(*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 * 0x74 + lVar4;
    param_1[1] = ((lVar2 - (longlong)pvVar1) / 0x74) * 0x74 + lVar4;
    *param_1 = lVar4;
  }
  return;
}



undefined8 * FUN_1402d24f0(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;
}



undefined4 * FUN_1402d2560(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 4) {
    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 = param_3 + 4;
  }
  return param_3;
}



void * FUN_1402d25b0(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x2c)) {
    if (param_3 != (void *)0x0) {
      memcpy(param_3,param_1,0x2c);
    }
    param_3 = (void *)((longlong)param_3 + 0x2c);
  }
  return param_3;
}



void * FUN_1402d2610(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x234f72c234f72c3) &&
     (pvVar1 = operator_new(param_1 * 0x74), 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_1405d3608);
}



void * FUN_1402d2680(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x5d1745d1745d175) &&
     (pvVar1 = operator_new(param_1 * 0x2c), 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_1405d3608);
}



undefined8 * FUN_1402d26f0(int param_1)

{
  undefined8 *puVar1;
  undefined **ppuVar2;
  
  if (param_1 == 0) {
    puVar1 = operator_new(0x78);
    if (puVar1 != (undefined8 *)0x0) {
      ppuVar2 = M3dSHitDataWeapon::vftable;
LAB_1402d287d:
      puVar1[1] = 0;
      *(undefined4 *)(puVar1 + 2) = 0;
      *(undefined2 *)((longlong)puVar1 + 0x14) = 0;
      *(undefined1 *)((longlong)puVar1 + 0x16) = 0;
      *(undefined4 *)(puVar1 + 3) = 0x3f800000;
      puVar1[7] = 0xf;
      puVar1[6] = 0;
      *(undefined1 *)(puVar1 + 4) = 0;
      *puVar1 = ppuVar2;
      puVar1[0xd] = 0;
      puVar1[10] = 0;
      puVar1[0xc] = 0;
      puVar1[9] = 0;
      puVar1[0xb] = 0;
      return puVar1;
    }
  }
  else if (param_1 == 1) {
    puVar1 = operator_new(0x78);
    if (puVar1 != (undefined8 *)0x0) {
      ppuVar2 = M3dSHitDataHitBox::vftable;
      goto LAB_1402d287d;
    }
  }
  else if (param_1 == 2) {
    puVar1 = operator_new(0x60);
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      *(undefined4 *)(puVar1 + 2) = 0;
      *(undefined2 *)((longlong)puVar1 + 0x14) = 0;
      *(undefined1 *)((longlong)puVar1 + 0x16) = 0;
      *(undefined4 *)(puVar1 + 3) = 0x3f800000;
      puVar1[7] = 0xf;
      puVar1[6] = 0;
      *(undefined1 *)(puVar1 + 4) = 0;
      *puVar1 = M3dSHitDataSphere::vftable;
      puVar1[10] = 0;
      puVar1[9] = 0;
      puVar1[0xb] = 0;
      return puVar1;
    }
  }
  else if (param_1 == 3) {
    puVar1 = operator_new(0x88);
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      *(undefined4 *)(puVar1 + 2) = 0;
      *(undefined2 *)((longlong)puVar1 + 0x14) = 0;
      *(undefined1 *)((longlong)puVar1 + 0x16) = 0;
      *(undefined4 *)(puVar1 + 3) = 0x3f800000;
      puVar1[7] = 0xf;
      puVar1[6] = 0;
      *(undefined1 *)(puVar1 + 4) = 0;
      *puVar1 = M3dSHitDataCylinder::vftable;
      *(undefined8 *)((longlong)puVar1 + 0x6c) = 0;
      *(undefined8 *)((longlong)puVar1 + 0x74) = 0;
      puVar1[9] = 0x3f800000;
      puVar1[10] = 0;
      puVar1[0xb] = 0x3f800000;
      puVar1[0xc] = 0;
      puVar1[0xd] = 0x3f800000;
      puVar1[0xe] = 0;
      *(undefined8 *)((longlong)puVar1 + 0x7c) = 0;
      *(undefined4 *)((longlong)puVar1 + 0x84) = 0;
      return puVar1;
    }
  }
  else if (param_1 == 4) {
    puVar1 = operator_new(0x80);
    if (puVar1 != (undefined8 *)0x0) {
      puVar1[1] = 0;
      *(undefined4 *)(puVar1 + 2) = 0;
      *(undefined2 *)((longlong)puVar1 + 0x14) = 0;
      *(undefined1 *)((longlong)puVar1 + 0x16) = 0;
      *(undefined4 *)(puVar1 + 3) = 0x3f800000;
      puVar1[7] = 0xf;
      puVar1[6] = 0;
      *(undefined1 *)(puVar1 + 4) = 0;
      *puVar1 = M3dSHitDataCapsule::vftable;
      puVar1[9] = 0;
      puVar1[10] = 0;
      *(undefined4 *)(puVar1 + 0xb) = 0;
      *(undefined8 *)((longlong)puVar1 + 0x5c) = 0x3f800000;
      *(undefined8 *)((longlong)puVar1 + 0x74) = 0;
      return puVar1;
    }
  }
  return (undefined8 *)0x0;
}



undefined8 * FUN_1402d28d0(undefined8 *param_1,uint param_2)

{
  *param_1 = M3dSHitDataWeapon::vftable;
  if ((void *)param_1[0xb] != (void *)0x0) {
    operator_delete((void *)param_1[0xb]);
  }
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  *param_1 = M3dSHitData::vftable;
  if (0xf < (ulonglong)param_1[7]) {
    operator_delete((void *)param_1[4]);
  }
  param_1[7] = 0xf;
  param_1[6] = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  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_1402d2960(longlong param_1,ulonglong *param_2,longlong param_3)

{
  undefined1 *puVar1;
  void *_Dst;
  void *_Src;
  undefined1 *puVar2;
  undefined1 auStack_88 [32];
  undefined1 local_68 [48];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  _Src = *(void **)(param_1 + 0x58);
  if (_Src != *(void **)(param_1 + 0x60)) {
    do {
      memcpy(local_68,_Src,0x2c);
      FUN_1402c3b10(local_68,param_3 + 0x94);
      puVar2 = (undefined1 *)param_2[1];
      if ((local_68 < puVar2) && (puVar1 = (undefined1 *)*param_2, puVar1 <= local_68)) {
        if (puVar2 == (undefined1 *)param_2[2]) {
          FUN_1402d2190(param_2);
        }
        _Dst = (void *)param_2[1];
        puVar2 = (undefined1 *)(((longlong)(local_68 + -(longlong)puVar1) / 0x2c) * 0x2c + *param_2)
        ;
        if (_Dst != (void *)0x0) {
LAB_1402d2a49:
          memcpy(_Dst,puVar2,0x2c);
        }
      }
      else {
        if (puVar2 == (undefined1 *)param_2[2]) {
          FUN_1402d2190(param_2);
        }
        _Dst = (void *)param_2[1];
        if (_Dst != (void *)0x0) {
          puVar2 = local_68;
          goto LAB_1402d2a49;
        }
      }
      param_2[1] = param_2[1] + 0x2c;
      _Src = (void *)((longlong)_Src + 0x2c);
    } while (_Src != *(void **)(param_1 + 0x60));
  }
  return *(longlong *)(param_1 + 0x58) != *(longlong *)(param_1 + 0x60);
}



undefined8 * FUN_1402d2aa0(undefined8 *param_1,uint param_2)

{
  *param_1 = M3dSHitDataHitBox::vftable;
  if ((void *)param_1[0xb] != (void *)0x0) {
    operator_delete((void *)param_1[0xb]);
  }
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  *param_1 = M3dSHitData::vftable;
  if (0xf < (ulonglong)param_1[7]) {
    operator_delete((void *)param_1[4]);
  }
  param_1[7] = 0xf;
  param_1[6] = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1402d2b30(longlong param_1,undefined4 *param_2,longlong param_3)

{
  *param_2 = *(undefined4 *)(param_1 + 0x48);
  param_2[1] = *(undefined4 *)(param_1 + 0x4c);
  param_2[2] = *(undefined4 *)(param_1 + 0x50);
  param_2[3] = *(undefined4 *)(param_1 + 0x54);
  FUN_1402bb980(param_2,param_3 + 0x94);
  return 1;
}



undefined8 * FUN_1402d2b70(undefined8 *param_1,uint param_2)

{
  *param_1 = M3dSHitData::vftable;
  if (0xf < (ulonglong)param_1[7]) {
    operator_delete((void *)param_1[4]);
  }
  param_1[7] = 0xf;
  param_1[6] = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1402d2bd0(longlong param_1,void *param_2,longlong param_3)

{
  memcpy(param_2,(void *)(param_1 + 0x48),0x38);
  FUN_1402c1d50(param_2,param_3 + 0x94);
  return 1;
}



undefined8 FUN_1402d2c20(longlong param_1,void *param_2,longlong param_3)

{
  memcpy(param_2,(void *)(param_1 + 0x48),0x2c);
  FUN_1402c3b10(param_2,param_3 + 0x94);
  return 1;
}



void FUN_1402d2c70(longlong param_1,void *param_2)

{
  memcpy((void *)(param_1 + 0x48),param_2,0x2c);
  return;
}



undefined4 FUN_1402d2c80(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x74);
}



void FUN_1402d2c90(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x78) = param_2;
  return;
}



void FUN_1402d2ca0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x74) = param_2;
  return;
}



undefined8 FUN_1402d2cb0(void)

{
  return 4;
}



void FUN_1402d2cc0(longlong param_1,void *param_2)

{
  memcpy((void *)(param_1 + 0x48),param_2,0x38);
  return;
}



undefined4 FUN_1402d2cd0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x84);
}



undefined4 FUN_1402d2ce0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x80);
}



void FUN_1402d2cf0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x84) = param_2;
  return;
}



void FUN_1402d2d00(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x80) = param_2;
  return;
}



void FUN_1402d2d10(longlong param_1,undefined4 *param_2)

{
  *(undefined4 *)(param_1 + 0x48) = *param_2;
  *(undefined4 *)(param_1 + 0x4c) = param_2[1];
  *(undefined4 *)(param_1 + 0x50) = param_2[2];
  *(undefined4 *)(param_1 + 0x54) = param_2[3];
  return;
}



undefined4 FUN_1402d2d30(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x5c);
}



undefined4 FUN_1402d2d40(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x58);
}



void FUN_1402d2d50(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x5c) = param_2;
  return;
}



void FUN_1402d2d60(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x58) = param_2;
  return;
}



void * FUN_1402d2d70(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x74)) {
    memcpy(param_3,param_1,0x74);
    param_3 = (void *)((longlong)param_3 + 0x74);
  }
  return param_3;
}



undefined4 * FUN_1402d2dd0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  int iVar1;
  
  for (; param_1 != param_2; param_1 = param_1 + 0x1d) {
    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];
      iVar1 = 3;
      do {
        iVar1 = iVar1 + -1;
      } while (-1 < iVar1);
      memcpy(param_3 + 4,param_1 + 4,100);
      FUN_1402bdc00(param_3 + 4);
    }
    param_3 = param_3 + 0x1d;
  }
  return param_3;
}



// WARNING: Removing unreachable block (ram,0x0001402d2edb)
// WARNING: Removing unreachable block (ram,0x0001402d2ee0)

longlong * FUN_1402d2e70(longlong *param_1,longlong *param_2)

{
  void *pvVar1;
  code *pcVar2;
  ulonglong uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (param_1 != param_2) {
    lVar5 = *param_2;
    lVar7 = param_2[1] - lVar5;
    lVar6 = lVar7 >> 0x3f;
    lVar7 = lVar7 / 0x74 + lVar6;
    uVar8 = lVar7 - lVar6;
    if (lVar7 == lVar6) {
      if (*param_1 != param_1[1]) {
        param_1[1] = *param_1;
      }
    }
    else {
      pvVar1 = (void *)*param_1;
      uVar3 = (param_1[1] - (longlong)pvVar1) / 0x74;
      if (uVar3 < uVar8) {
        if ((ulonglong)((param_1[2] - (longlong)pvVar1) / 0x74) < uVar8) {
          if (pvVar1 != (void *)0x0) {
            operator_delete(pvVar1);
          }
          uVar8 = (param_2[1] - *param_2) / 0x74;
          *param_1 = 0;
          param_1[1] = 0;
          param_1[2] = 0;
          if (uVar8 == 0) {
            return param_1;
          }
          if (0x234f72c234f72c2 < uVar8) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            plVar4 = (longlong *)(*pcVar2)();
            return plVar4;
          }
          lVar5 = FUN_1402d2610(uVar8);
          *param_1 = lVar5;
          param_1[1] = lVar5;
          param_1[2] = uVar8 * 0x74 + lVar5;
          lVar6 = *param_2;
        }
        else {
          lVar6 = uVar3 * 0x74 + lVar5;
          FUN_1402d2d70(lVar5,lVar6,pvVar1);
          lVar5 = param_1[1];
        }
        lVar5 = FUN_1402d2dd0(lVar6,param_2[1],lVar5);
        param_1[1] = lVar5;
      }
      else {
        FUN_1402d2d70(lVar5,param_2[1],pvVar1);
        param_1[1] = ((param_2[1] - *param_2) / 0x74) * 0x74 + *param_1;
      }
    }
  }
  return param_1;
}



void FUN_1402d3050(longlong param_1)

{
  FUN_1402d2e70(param_1 + 0x58);
  return;
}



undefined8 FUN_1402d3060(void)

{
  return 1;
}



void * FUN_1402d3070(void *param_1,void *param_2,void *param_3)

{
  for (; param_1 != param_2; param_1 = (void *)((longlong)param_1 + 0x2c)) {
    memcpy(param_3,param_1,0x2c);
    param_3 = (void *)((longlong)param_3 + 0x2c);
  }
  return param_3;
}



// WARNING: Removing unreachable block (ram,0x0001402d313b)
// WARNING: Removing unreachable block (ram,0x0001402d3140)

longlong * FUN_1402d30d0(longlong *param_1,longlong *param_2)

{
  void *pvVar1;
  code *pcVar2;
  ulonglong uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (param_1 != param_2) {
    lVar5 = *param_2;
    lVar7 = param_2[1] - lVar5;
    lVar6 = lVar7 >> 0x3f;
    lVar7 = lVar7 / 0x2c + lVar6;
    uVar8 = lVar7 - lVar6;
    if (lVar7 == lVar6) {
      if (*param_1 != param_1[1]) {
        param_1[1] = *param_1;
      }
    }
    else {
      pvVar1 = (void *)*param_1;
      uVar3 = (param_1[1] - (longlong)pvVar1) / 0x2c;
      if (uVar3 < uVar8) {
        if ((ulonglong)((param_1[2] - (longlong)pvVar1) / 0x2c) < uVar8) {
          if (pvVar1 != (void *)0x0) {
            operator_delete(pvVar1);
          }
          uVar8 = (param_2[1] - *param_2) / 0x2c;
          *param_1 = 0;
          param_1[1] = 0;
          param_1[2] = 0;
          if (uVar8 == 0) {
            return param_1;
          }
          if (0x5d1745d1745d174 < uVar8) {
            std::_Xlength_error("vector<T> too long");
            pcVar2 = (code *)swi(3);
            plVar4 = (longlong *)(*pcVar2)();
            return plVar4;
          }
          lVar5 = FUN_1402d2680(uVar8);
          *param_1 = lVar5;
          param_1[1] = lVar5;
          param_1[2] = uVar8 * 0x2c + lVar5;
          lVar6 = *param_2;
        }
        else {
          lVar6 = uVar3 * 0x2c + lVar5;
          FUN_1402d3070(lVar5,lVar6,pvVar1);
          lVar5 = param_1[1];
        }
        lVar5 = FUN_1402d25b0(lVar6,param_2[1],lVar5);
        param_1[1] = lVar5;
      }
      else {
        FUN_1402d3070(lVar5,param_2[1],pvVar1);
        param_1[1] = ((param_2[1] - *param_2) / 0x2c) * 0x2c + *param_1;
      }
    }
  }
  return param_1;
}



void FUN_1402d32b0(longlong param_1)

{
  FUN_1402d30d0(param_1 + 0x58);
  return;
}



longlong * FUN_1402d32c0(longlong *param_1,uint param_2)

{
  undefined8 *puVar1;
  longlong *plVar2;
  longlong lVar3;
  
  lVar3 = 0x13;
  *param_1 = (longlong)AIBase::vftable;
  plVar2 = param_1;
  do {
    plVar2 = plVar2 + 1;
    puVar1 = (undefined8 *)*plVar2;
    if (puVar1 != (undefined8 *)0x0) {
      (**(code **)*puVar1)(puVar1,1);
      *plVar2 = 0;
    }
    lVar3 = lVar3 + -1;
  } while (lVar3 != 0);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1402d3340(longlong param_1,longlong *param_2)

{
  int iVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  
  puVar2 = operator_new(0x18);
  puVar5 = (undefined8 *)0x0;
  puVar4 = puVar5;
  if (puVar2 != (undefined8 *)0x0) {
    *puVar2 = AIMelee::Stay::vftable;
    puVar4 = puVar2;
  }
  *(undefined8 **)(param_1 + 0x38) = puVar4;
  plVar3 = (longlong *)(**(code **)(*param_2 + 0xe0))(param_2);
  iVar1 = (**(code **)(*plVar3 + 0x10))(plVar3);
  if (iVar1 != 0) {
    puVar2 = operator_new(0x30);
    puVar4 = puVar5;
    if (puVar2 != (undefined8 *)0x0) {
      puVar2[2] = 0;
      puVar2[3] = 0;
      *puVar2 = AIMelee::Patrol::vftable;
      puVar4 = puVar2;
    }
    *(undefined8 **)(param_1 + 0x10) = puVar4;
    puVar2 = operator_new(0x28);
    puVar4 = puVar5;
    if (puVar2 != (undefined8 *)0x0) {
      puVar2[2] = 0;
      *puVar2 = AIMelee::Chase::vftable;
      puVar4 = puVar2;
    }
    *(undefined8 **)(param_1 + 0x30) = puVar4;
    puVar2 = operator_new(0x18);
    puVar4 = puVar5;
    if (puVar2 != (undefined8 *)0x0) {
      puVar2[2] = 0;
      *puVar2 = AIMelee::Return::vftable;
      puVar4 = puVar2;
    }
    *(undefined8 **)(param_1 + 0x28) = puVar4;
  }
  iVar1 = (**(code **)(*plVar3 + 0x48))(plVar3);
  if (iVar1 != 0) {
    puVar2 = operator_new(0x18);
    puVar4 = puVar5;
    if (puVar2 != (undefined8 *)0x0) {
      puVar2[2] = 0;
      *puVar2 = AIMelee::Runaway::vftable;
      puVar4 = puVar2;
    }
    *(undefined8 **)(param_1 + 0x18) = puVar4;
  }
  iVar1 = (**(code **)(*plVar3 + 8))(plVar3);
  if (iVar1 != 0) {
    puVar2 = operator_new(0x10);
    puVar4 = puVar5;
    if (puVar2 != (undefined8 *)0x0) {
      *puVar2 = AIMelee::Attack::vftable;
      puVar4 = puVar2;
    }
    *(undefined8 **)(param_1 + 0x20) = puVar4;
  }
  iVar1 = (**(code **)(*plVar3 + 0x68))(plVar3);
  if (iVar1 != 0) {
    puVar2 = operator_new(0x18);
    puVar4 = puVar5;
    if (puVar2 != (undefined8 *)0x0) {
      puVar2[2] = 0;
      *puVar2 = AIMelee::BackStep::vftable;
      puVar4 = puVar2;
    }
    *(undefined8 **)(param_1 + 0x50) = puVar4;
  }
  iVar1 = (**(code **)(*plVar3 + 0x50))(plVar3);
  if (iVar1 != 0) {
    puVar2 = operator_new(0x20);
    puVar4 = puVar5;
    if (puVar2 != (undefined8 *)0x0) {
      puVar2[2] = 0;
      puVar2[3] = 0;
      *puVar2 = AIMelee::Guard::vftable;
      puVar4 = puVar2;
    }
    *(undefined8 **)(param_1 + 0x58) = puVar4;
  }
  iVar1 = (**(code **)(*plVar3 + 0x30))(plVar3);
  if (iVar1 != 0) {
    puVar2 = operator_new(0x18);
    puVar4 = puVar5;
    if (puVar2 != (undefined8 *)0x0) {
      puVar2[2] = 0;
      *puVar2 = AIMelee::EvasionLeft::vftable;
      puVar4 = puVar2;
    }
    *(undefined8 **)(param_1 + 0x40) = puVar4;
    puVar4 = operator_new(0x18);
    if (puVar4 != (undefined8 *)0x0) {
      puVar4[2] = 0;
      *puVar4 = AIMelee::EvasionRight::vftable;
      puVar5 = puVar4;
    }
    *(undefined8 **)(param_1 + 0x48) = puVar5;
  }
  puVar5 = operator_new(0x28);
  if (puVar5 == (undefined8 *)0x0) {
    *(undefined8 *)(param_1 + 8) = 0;
    return;
  }
  puVar5[2] = 0;
  *puVar5 = AIMelee::Illusion::vftable;
  *(undefined8 **)(param_1 + 8) = puVar5;
  return;
}



undefined8 FUN_1402d3580(undefined4 param_1)

{
  switch(param_1) {
  case 0:
  case 1:
  case 5:
  case 6:
  case 7:
  case 10:
  case 0xb:
  case 0xc:
  case 0xd:
  case 0xe:
  case 0x13:
  case 0x14:
  case 0x15:
  case 0x16:
  case 0x1b:
  case 0x1c:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x20:
  case 0x21:
  case 0x22:
  case 0x23:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2b:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x35:
  case 0x36:
  case 0x37:
  case 0x38:
  case 0x39:
  case 0x3a:
  case 0x3b:
  case 0x3c:
  case 0x3d:
  case 0x3e:
  case 0x42:
  case 0x43:
  case 0x44:
  case 0x4e:
  case 0x4f:
  case 0x55:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
  case 99:
    return 1;
  default:
    return 0;
  }
}



undefined8 FUN_1402d3620(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined8 uVar4;
  
  uVar4 = (**(code **)(**(longlong **)(param_2 + 0xa0) + 0x370))();
  if ((char)uVar4 == '\0') {
    *(undefined1 *)(param_1 + 8) = 1;
    return uVar4;
  }
  *(undefined8 *)(param_1 + 0x10) = param_3;
  *(undefined8 *)(param_1 + 0x18) = param_3;
  lVar3 = *(longlong *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(lVar3 + 0x178);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(lVar3 + 0x17c);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(lVar3 + 0x180);
  uVar1 = *(undefined4 *)(*(longlong *)(param_2 + 0xa0) + 0x520);
  *(undefined4 *)(param_2 + 0xb4) = *(undefined4 *)(param_1 + 0x20);
  *(undefined4 *)(param_2 + 0xb8) = *(undefined4 *)(param_1 + 0x24);
  uVar2 = *(undefined4 *)(param_1 + 0x28);
  *(undefined4 *)(param_2 + 0xbc) = uVar2;
  *(undefined4 *)(param_2 + 0xc0) = uVar1;
  return CONCAT71((uint7)(uint3)((uint)uVar2 >> 8),1);
}



void FUN_1402d36d0(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  
  *(undefined8 *)(param_1 + 0x18) = param_3;
  *(undefined8 *)(param_1 + 0x10) = param_3;
  lVar3 = *(longlong *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(lVar3 + 0x178);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(lVar3 + 0x17c);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(lVar3 + 0x180);
  uVar1 = *(undefined4 *)(*(longlong *)(param_2 + 0xa0) + 0x520);
  *(undefined4 *)(param_2 + 0xb4) = *(undefined4 *)(param_1 + 0x20);
  *(undefined4 *)(param_2 + 0xb8) = *(undefined4 *)(param_1 + 0x24);
  uVar2 = *(undefined4 *)(param_1 + 0x28);
  *(undefined4 *)(param_2 + 0xc0) = uVar1;
  *(undefined4 *)(param_2 + 0xbc) = uVar2;
  return;
}



void FUN_1402d3740(longlong param_1,longlong param_2,double param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  void *local_68;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  plVar1 = *(longlong **)(param_2 + 0xa0);
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar1 + 300));
  if (cVar2 != '\0') {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  local_68 = (void *)0x0;
  local_60 = 0;
  local_58 = 0;
  cVar2 = (**(code **)(*plVar1 + 0x180))(plVar1,&local_68,*(undefined4 *)(plVar1[0x26] + 0x280));
  if (cVar2 == '\0') {
    if ((int)plVar1[0x19c] == 0) {
      if (param_3 - *(double *)(param_1 + 0x10) <= 10.0) {
        if (2.0 < param_3 - *(double *)(param_1 + 0x18)) {
          *(double *)(param_1 + 0x18) = param_3;
          fVar5 = *(float *)(param_1 + 0x28) - *(float *)(plVar1 + 0x30);
          fVar3 = *(float *)(param_1 + 0x24) - *(float *)((longlong)plVar1 + 0x17c);
          fVar4 = *(float *)(param_1 + 0x20) - *(float *)(plVar1 + 0x2f);
          if (fVar4 * fVar4 + fVar3 * fVar3 + fVar5 * fVar5 < 100.0) {
            *(undefined1 *)(param_1 + 8) = 1;
            *(double *)(param_1 + 0x10) = param_3 - 2.5;
            *(undefined1 *)(param_2 + 0xb0) = 1;
            goto LAB_1402d38b5;
          }
          *(int *)(param_1 + 0x20) = (int)plVar1[0x2f];
          *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)((longlong)plVar1 + 0x17c);
          *(int *)(param_1 + 0x28) = (int)plVar1[0x30];
        }
        cVar2 = (**(code **)(*plVar1 + 0x3a8))(plVar1,param_3,param_4);
        if (cVar2 == '\x01') {
          *(undefined1 *)(param_1 + 8) = 1;
        }
      }
      else {
        *(double *)(param_1 + 0x10) = param_3 - 2.5;
        *(undefined1 *)(param_1 + 8) = 1;
      }
    }
    else {
      *(undefined1 *)(param_1 + 8) = 1;
    }
  }
  else {
    *(undefined1 *)(param_1 + 8) = 1;
  }
LAB_1402d38b5:
  if (local_68 != (void *)0x0) {
    operator_delete(local_68);
  }
  return;
}



undefined1 FUN_1402d38e0(longlong param_1,longlong param_2,undefined8 param_3)

{
  char cVar1;
  
  cVar1 = (**(code **)(**(longlong **)(param_2 + 0xa0) + 0x378))();
  if (cVar1 == '\0') {
    *(undefined1 *)(param_1 + 8) = 1;
    return 0;
  }
  *(undefined8 *)(param_1 + 0x10) = param_3;
  return 1;
}



void FUN_1402d3930(longlong param_1,longlong param_2,double param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  double dVar7;
  
  plVar1 = *(longlong **)(param_2 + 0xa0);
  if ((int)plVar1[0x19c] != 0) {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  dVar7 = param_3;
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar1 + 300));
  if ((((cVar2 == '\0') && (dVar7 - *(double *)(param_1 + 0x10) <= 10.0)) &&
      (lVar3 = (**(code **)(*plVar1 + 0x110))(plVar1), lVar3 != 0)) &&
     ((fVar6 = *(float *)(lVar3 + 0x17c) - *(float *)((longlong)plVar1 + 0x17c),
      fVar5 = *(float *)(lVar3 + 0x178) - *(float *)(plVar1 + 0x2f),
      fVar4 = *(float *)(lVar3 + 0x180) - *(float *)(plVar1 + 0x30),
      fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4 <
      *(float *)(plVar1[0x26] + 0x28c) * *(float *)(plVar1[0x26] + 0x28c) &&
      (cVar2 = (**(code **)(*plVar1 + 0x3a0))(plVar1,param_3,param_4), cVar2 != '\x01')))) {
    return;
  }
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



undefined8 FUN_1402d3a40(undefined8 param_1,longlong param_2,undefined8 param_3)

{
  (**(code **)(**(longlong **)(param_2 + 0xa0) + 0x390))(*(longlong **)(param_2 + 0xa0),param_3,0);
  return 1;
}



void FUN_1402d3a70(undefined8 param_1,longlong param_2,undefined8 param_3)

{
                    // WARNING: Could not recover jumptable at 0x0001402d3a82. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_2 + 0xa0) + 0x390))(*(longlong **)(param_2 + 0xa0),param_3,0);
  return;
}



void FUN_1402d3a90(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = *(longlong **)(param_2 + 0xa0);
  if (*(char *)((longlong)plVar1 + 0xc64) == '\0') {
    switch(*(undefined4 *)((longlong)plVar1 + 300)) {
    case 10:
    case 0xb:
    case 0xc:
    case 0xd:
    case 0xe:
    case 0xf:
    case 0x10:
    case 0x11:
    case 0x12:
    case 0x13:
    case 0x14:
    case 0x15:
    case 0x16:
    case 0x17:
    case 0x18:
    case 0x19:
    case 0x1a:
    case 0x35:
    case 0x36:
    case 0x39:
    case 0x3b:
      lVar2 = (**(code **)(*plVar1 + 0x110))(plVar1);
      if (lVar2 != 0) {
        (**(code **)(*plVar1 + 0x390))(plVar1,param_3,param_4);
        return;
      }
    }
    *(undefined1 *)(param_1 + 8) = 1;
  }
  else {
    *(undefined1 *)(param_1 + 8) = 1;
  }
  return;
}



undefined8 FUN_1402d3b70(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  *(undefined1 *)(param_2 + 0xb0) = 0;
  *(undefined8 *)(param_1 + 0x10) = param_3;
  lVar3 = *(longlong *)(param_2 + 0xa0);
  fVar6 = *(float *)(param_2 + 0xb8) - *(float *)(lVar3 + 0x17c);
  fVar4 = *(float *)(param_2 + 0xbc) - *(float *)(lVar3 + 0x180);
  fVar5 = *(float *)(param_2 + 0xb4) - *(float *)(lVar3 + 0x178);
  if (fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4 < 400.0) {
    uVar1 = *(undefined4 *)(lVar3 + 0x534);
    *(undefined4 *)(param_2 + 0xb4) = *(undefined4 *)(lVar3 + 0x16c);
    *(undefined4 *)(param_2 + 0xb8) = *(undefined4 *)(lVar3 + 0x170);
    uVar2 = *(undefined4 *)(lVar3 + 0x174);
    *(undefined4 *)(param_2 + 0xc0) = uVar1;
    *(undefined4 *)(param_2 + 0xbc) = uVar2;
  }
  return 1;
}



void FUN_1402d3c10(longlong param_1,longlong param_2,double param_3,undefined8 param_4)

{
  int iVar1;
  longlong *plVar2;
  char cVar3;
  
  plVar2 = *(longlong **)(param_2 + 0xa0);
  iVar1 = *(int *)((longlong)plVar2 + 300);
  if ((1 < iVar1) && (((iVar1 < 4 || (iVar1 == 0x1e)) || (iVar1 == 0x50)))) {
    cVar3 = (**(code **)(*plVar2 + 0x388))
                      (plVar2,param_3,param_4,param_2 + 0xb4,*(undefined4 *)(param_2 + 0xc0));
    if (cVar3 == '\0') {
      (**(code **)(**(longlong **)(param_2 + 0xa0) + 0xd0))(*(longlong **)(param_2 + 0xa0),0,0);
    }
    else if (param_3 - *(double *)(param_1 + 0x10) <= 5.0) {
      return;
    }
  }
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



undefined8 FUN_1402d3cb0(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  
  *(undefined8 *)(param_1 + 0x10) = param_3;
  lVar3 = *(longlong *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(lVar3 + 0x178);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(lVar3 + 0x17c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(lVar3 + 0x180);
  uVar1 = *(undefined4 *)(*(longlong *)(param_2 + 0xa0) + 0x520);
  *(undefined4 *)(param_2 + 0xb4) = *(undefined4 *)(param_1 + 0x18);
  *(undefined4 *)(param_2 + 0xb8) = *(undefined4 *)(param_1 + 0x1c);
  uVar2 = *(undefined4 *)(param_1 + 0x20);
  *(undefined4 *)(param_2 + 0xc0) = uVar1;
  *(undefined4 *)(param_2 + 0xbc) = uVar2;
  return CONCAT71((uint7)(uint3)((uint)uVar2 >> 8),1);
}



void FUN_1402d3d20(longlong param_1,longlong param_2,double param_3)

{
  longlong lVar1;
  char cVar2;
  longlong lVar3;
  longlong *plVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  plVar4 = *(longlong **)(param_2 + 0xa0);
  if ((int)plVar4[0x19c] != 0) {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar4 + 300));
  if (cVar2 != '\0') {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  lVar3 = (**(code **)(*plVar4 + 0x110))(plVar4);
  if (lVar3 != 0) {
    (**(code **)(**(longlong **)(param_2 + 0xa0) + 0x1b0))(*(longlong **)(param_2 + 0xa0),param_3);
    if (2.0 < param_3 - *(double *)(param_1 + 0x10)) {
      *(double *)(param_1 + 0x10) = param_3;
      lVar1 = *(longlong *)(param_2 + 0xa0);
      fVar6 = *(float *)(param_1 + 0x18) - *(float *)(lVar1 + 0x178);
      fVar7 = *(float *)(param_1 + 0x1c) - *(float *)(lVar1 + 0x17c);
      fVar5 = *(float *)(param_1 + 0x20) - *(float *)(lVar1 + 0x180);
      if (fVar7 * fVar7 + fVar6 * fVar6 + fVar5 * fVar5 < 100.0) {
        *(undefined1 *)(param_2 + 0xb0) = 1;
        goto LAB_1402d3eec;
      }
      *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(lVar1 + 0x178);
      *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(lVar1 + 0x17c);
      *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(lVar1 + 0x180);
    }
    plVar4 = *(longlong **)(param_2 + 0xa0);
    fVar7 = *(float *)(lVar3 + 0x178) - *(float *)(plVar4 + 0x2f);
    fVar8 = *(float *)(lVar3 + 0x17c) - *(float *)((longlong)plVar4 + 0x17c);
    fVar6 = *(float *)(lVar3 + 0x180) - *(float *)(plVar4 + 0x30);
    fVar5 = *(float *)(plVar4[0x26] + 0x284);
    if (((fVar5 * fVar5 <= fVar8 * fVar8 + fVar7 * fVar7 + fVar6 * fVar6) &&
        (fVar6 = *(float *)(lVar3 + 0x17c) - *(float *)((longlong)plVar4 + 0x17c),
        fVar7 = *(float *)(lVar3 + 0x178) - *(float *)(plVar4 + 0x2f),
        fVar8 = *(float *)(lVar3 + 0x180) - *(float *)(plVar4 + 0x30),
        fVar5 = *(float *)(plVar4[0x26] + 0x280),
        fVar6 * fVar6 + fVar7 * fVar7 + fVar8 * fVar8 < fVar5 * fVar5)) &&
       (cVar2 = (**(code **)(*plVar4 + 0x410))(), cVar2 != '\0')) {
      return;
    }
  }
LAB_1402d3eec:
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



undefined8 FUN_1402d3f10(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  (**(code **)(**(longlong **)(param_2 + 0xa0) + 200))(*(longlong **)(param_2 + 0xa0),0x50);
  return 1;
}



void FUN_1402d3f40(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  return;
}



void FUN_1402d3f50(longlong param_1,longlong param_2,double param_3)

{
  char cVar1;
  
  if (*(int *)(*(longlong *)(param_2 + 0xa0) + 0xce0) != 0) {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  cVar1 = FUN_1402d3580(*(undefined4 *)(*(longlong *)(param_2 + 0xa0) + 300));
  if ((cVar1 != '\0') || (2.0 < param_3 - *(double *)(param_1 + 0x10))) {
    *(undefined1 *)(param_1 + 8) = 1;
  }
  return;
}



undefined8 FUN_1402d3fa0(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  (**(code **)(**(longlong **)(param_2 + 0xa0) + 200))(*(longlong **)(param_2 + 0xa0),5);
  return 1;
}



void FUN_1402d3fd0(longlong param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  
  if (*(int *)(*(longlong *)(param_2 + 0xa0) + 0xce0) != 0) {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  iVar2 = *(int *)(*(longlong *)(param_2 + 0xa0) + 300);
  if (iVar2 != 5) {
    cVar1 = FUN_1402d3580(iVar2);
    if ((cVar1 != '\0') || (iVar2 != 5)) {
      *(undefined1 *)(param_1 + 8) = 1;
    }
  }
  return;
}



undefined8 FUN_1402d4020(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  (**(code **)(**(longlong **)(param_2 + 0xa0) + 200))(*(longlong **)(param_2 + 0xa0),6);
  return 1;
}



void FUN_1402d4050(longlong param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  
  if (*(int *)(*(longlong *)(param_2 + 0xa0) + 0xce0) != 0) {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  iVar2 = *(int *)(*(longlong *)(param_2 + 0xa0) + 300);
  if (iVar2 != 6) {
    cVar1 = FUN_1402d3580(iVar2);
    if ((cVar1 != '\0') || (iVar2 != 6)) {
      *(undefined1 *)(param_1 + 8) = 1;
    }
  }
  return;
}



undefined8 FUN_1402d40a0(longlong param_1,longlong param_2,undefined8 param_3)

{
  *(undefined8 *)(param_1 + 0x10) = param_3;
  (**(code **)(**(longlong **)(param_2 + 0xa0) + 200))(*(longlong **)(param_2 + 0xa0),7);
  return 1;
}



void FUN_1402d40d0(longlong param_1,longlong param_2)

{
  char cVar1;
  int iVar2;
  
  if (*(int *)(*(longlong *)(param_2 + 0xa0) + 0xce0) != 0) {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  iVar2 = *(int *)(*(longlong *)(param_2 + 0xa0) + 300);
  if (iVar2 != 7) {
    cVar1 = FUN_1402d3580(iVar2);
    if ((cVar1 != '\0') || (iVar2 != 7)) {
      *(undefined1 *)(param_1 + 8) = 1;
    }
  }
  return;
}



undefined8 FUN_1402d4120(longlong param_1,longlong param_2)

{
  double dVar1;
  longlong lVar2;
  longlong *plVar3;
  float fVar4;
  
  plVar3 = (longlong *)(**(code **)(**(longlong **)(param_2 + 0xa0) + 0xe0))();
  dVar1 = *(double *)(*(longlong *)(param_2 + 0xa0) + 0x510);
  fVar4 = (float)(**(code **)(*plVar3 + 0x58))(plVar3);
  plVar3 = *(longlong **)(param_2 + 0xa0);
  lVar2 = *plVar3;
  *(double *)(param_1 + 0x10) = (double)fVar4 + dVar1;
  (**(code **)(lVar2 + 200))(plVar3,0x30);
  return 1;
}



void FUN_1402d41a0(longlong param_1,longlong param_2)

{
  double dVar1;
  longlong lVar2;
  longlong *plVar3;
  float fVar4;
  
  plVar3 = (longlong *)(**(code **)(**(longlong **)(param_2 + 0xa0) + 0xe0))();
  dVar1 = *(double *)(*(longlong *)(param_2 + 0xa0) + 0x510);
  fVar4 = (float)(**(code **)(*plVar3 + 0x58))(plVar3);
  plVar3 = *(longlong **)(param_2 + 0xa0);
  lVar2 = *plVar3;
  *(double *)(param_1 + 0x10) = (double)fVar4 + dVar1;
                    // WARNING: Could not recover jumptable at 0x0001402d420e. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(lVar2 + 200))(plVar3,0x30);
  return;
}



void FUN_1402d4220(longlong param_1,longlong param_2,double param_3,undefined8 param_4)

{
  double dVar1;
  undefined4 uVar2;
  longlong *plVar3;
  char cVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  plVar3 = *(longlong **)(param_2 + 0xa0);
  if ((int)plVar3[0x19c] != 0) {
    *(undefined1 *)(param_1 + 8) = 1;
    return;
  }
  lVar5 = (**(code **)(*plVar3 + 0x110))(plVar3);
  if (lVar5 == 0) {
switchD_1402d433a_caseD_1d:
  }
  else {
    if (param_3 < *(double *)(param_1 + 0x10) || param_3 == *(double *)(param_1 + 0x10)) {
LAB_1402d4311:
      switch(*(undefined4 *)(lVar5 + 300)) {
      case 0x1d:
      case 0x1f:
      case 0x20:
      case 0x21:
      case 0x22:
      case 0x23:
      case 0x2f:
      case 0x30:
      case 0x32:
        break;
      default:
        fVar8 = *(float *)((longlong)plVar3 + 0x17c) - *(float *)(lVar5 + 0x17c);
        fVar6 = *(float *)(plVar3 + 0x30) - *(float *)(lVar5 + 0x180);
        fVar7 = *(float *)(plVar3 + 0x2f) - *(float *)(lVar5 + 0x178);
        if (fVar8 * fVar8 + fVar7 * fVar7 + fVar6 * fVar6 < 160000.0) {
          if ((0x2e < *(int *)((longlong)plVar3 + 300)) && (*(int *)((longlong)plVar3 + 300) < 0x32)
             ) {
            return;
          }
          goto LAB_1402d43b0;
        }
      }
      goto switchD_1402d433a_caseD_1d;
    }
    if (*(int *)(lVar5 + 300) == 10) {
      *(double *)(param_1 + 0x10) = param_3 + DAT_1405dfc58;
      dVar1 = (double)plVar3[0x166];
      fVar6 = (float)(**(code **)(*plVar3 + 0x360))(plVar3);
      if ((double)fVar6 < param_3 - dVar1) {
        uVar2 = *(undefined4 *)((longlong)plVar3 + 300);
        *(undefined4 *)((longlong)plVar3 + 300) = 2;
        cVar4 = (**(code **)(*plVar3 + 0x390))(plVar3,param_3,param_4);
        if (cVar4 == '\0') {
          *(undefined4 *)((longlong)plVar3 + 300) = uVar2;
        }
      }
      goto LAB_1402d4311;
    }
  }
  (**(code **)(*plVar3 + 0xd0))(plVar3,0,0);
LAB_1402d43b0:
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



undefined8 FUN_1402d43f0(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0xa0) + 0x118))(*(longlong **)(param_2 + 0xa0),0,0);
  return 1;
}



void FUN_1402d4410(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  
  plVar1 = *(longlong **)(param_2 + 0xa0);
  iVar3 = (**(code **)(*plVar1 + 0x128))(plVar1);
  if ((iVar3 != 0) &&
     (cVar2 = (**(code **)(*plVar1 + 0x1b8))(plVar1,param_3,param_4), cVar2 != '\0')) {
    (**(code **)(*plVar1 + 0x118))(plVar1,0,0);
    cVar2 = (**(code **)(*plVar1 + 0x410))(plVar1);
    if (cVar2 != '\0') {
      return;
    }
  }
  *(undefined1 *)(param_1 + 8) = 1;
  return;
}



wchar_t * FUN_1402d44a0(void)

{
  return L"Illusion";
}



wchar_t * FUN_1402d44b0(void)

{
  return L"EvasionRight";
}



undefined8 FUN_1402d44c0(void)

{
  return 7;
}



wchar_t * FUN_1402d44d0(void)

{
  return L"EvasionLeft";
}



undefined8 FUN_1402d44e0(void)

{
  return 9;
}



undefined8 * FUN_1402d44f0(undefined8 *param_1,byte param_2)

{
  *param_1 = AIState::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1402d4520(void)

{
  return 5;
}



undefined8 FUN_1402d4530(void)

{
  return 6;
}



undefined1 FUN_1402d4540(longlong param_1)

{
  return *(undefined1 *)(param_1 + 8);
}



longlong * FUN_1402d4550(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  undefined4 uVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong lVar7;
  float fVar8;
  float fVar9;
  longlong *local_60;
  undefined8 local_58;
  undefined8 local_50;
  
  if (((longlong *)*param_1 == (longlong *)0x0) ||
     (cVar1 = (**(code **)(*(longlong *)*param_1 + 0x28))(), cVar1 != '\0')) {
    plVar5 = (longlong *)0x0;
    fVar9 = 0.0;
    lVar4 = (**(code **)(*(longlong *)param_1[0x14] + 0x110))();
    if (lVar4 == 0) {
      if (*(longlong *)(param_1[0x14] + 0x130) == 0) {
        return (longlong *)0x0;
      }
      local_60 = (longlong *)0x0;
      local_58 = 0;
      local_50 = 0;
      cVar1 = (**(code **)(*(longlong *)param_1[0x14] + 0x180))
                        ((longlong *)param_1[0x14],&local_60,
                         *(undefined4 *)(*(longlong *)(param_1[0x14] + 0x130) + 0x278));
      if (cVar1 == '\0') {
        (**(code **)(*(longlong *)param_1[0x14] + 0x118))((longlong *)param_1[0x14],0,0);
      }
      else {
        lVar7 = ((longlong *)*local_60)[0x25];
        lVar4 = *(longlong *)param_1[0x14];
        uVar2 = (**(code **)(*(longlong *)*local_60 + 0xb0))();
        (**(code **)(lVar4 + 0x118))(param_1[0x14],uVar2,(int)lVar7);
      }
      lVar4 = (**(code **)(*(longlong *)param_1[0x14] + 0x110))();
      if (local_60 != (longlong *)0x0) {
        operator_delete(local_60);
      }
      local_60 = (longlong *)0x0;
      local_58 = 0;
      local_50 = 0;
    }
    plVar6 = (longlong *)param_1[0x14];
    iVar3 = (**(code **)(*plVar6 + 1000))(plVar6,plVar6);
    if (iVar3 != 0) {
      (**(code **)(*(longlong *)param_1[0x14] + 0x120))((longlong *)param_1[0x14],iVar3);
    }
    lVar7 = 0x13;
    plVar6 = param_1;
    do {
      plVar6 = plVar6 + 1;
      if ((*plVar6 != 0) &&
         (fVar8 = (float)(**(code **)(*(longlong *)*plVar6 + 0x10))
                                   ((longlong *)*plVar6,lVar4,param_1,param_2,param_3),
         fVar9 < fVar8)) {
        plVar5 = (longlong *)*plVar6;
        fVar9 = fVar8;
      }
      lVar7 = lVar7 + -1;
    } while (lVar7 != 0);
    if (plVar5 != (longlong *)0x0) {
      cVar1 = (**(code **)(*plVar5 + 0x18))(plVar5,param_1,param_2);
      if (cVar1 == '\x01') {
        *(undefined1 *)(plVar5 + 1) = 0;
      }
      if ((DAT_14060b7c4 & 1) == 0) {
        DAT_14060b7c4 = DAT_14060b7c4 | 1;
        FUN_140418590();
        atexit((_func_5014 *)&LAB_140448470);
      }
      if (DAT_14060a120 == 1000) {
        plVar6 = (longlong *)param_1[0x14];
        lVar4 = *plVar6;
        uVar2 = (**(code **)(*plVar5 + 8))(plVar5);
        (**(code **)(lVar4 + 0x470))(plVar6,uVar2);
      }
    }
  }
  else {
    plVar5 = (longlong *)*param_1;
  }
  return plVar5;
}



undefined8 FUN_1402d47a0(longlong param_1,undefined8 param_2,longlong param_3,double param_4)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  
  plVar4 = *(longlong **)(param_3 + 0xa0);
  cVar1 = FUN_1402d3580(*(undefined4 *)((longlong)plVar4 + 300));
  if (cVar1 == '\0') {
    lVar3 = (**(code **)(*plVar4 + 0xe8))(plVar4);
    if (lVar3 != 0) {
      plVar4 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
      iVar2 = (**(code **)(*plVar4 + 0x10))(plVar4);
      if ((iVar2 != 0) && (5.0 <= param_4 - *(double *)(param_1 + 0x10))) {
        return 0x3e4ccccd;
      }
    }
  }
  return 0;
}



undefined8 FUN_1402d4840(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float local_38;
  float fStack_34;
  float local_30;
  undefined8 local_28;
  float local_20;
  
  plVar5 = *(longlong **)(param_3 + 0xa0);
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar5 + 300));
  if ((cVar2 == '\0') && (5.0 <= param_4 - *(double *)(param_1 + 0x10))) {
    lVar4 = (**(code **)(*plVar5 + 0xe8))(plVar5);
    if (lVar4 != 0) {
      plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
      iVar3 = (**(code **)(*plVar5 + 0x48))(plVar5);
      if (iVar3 != 0) {
        lVar4 = *(longlong *)(param_3 + 0xa0);
        lVar1 = *(longlong *)(param_3 + 0xa0);
        local_38 = *(float *)(lVar4 + 0x154) * 50.0 + *(float *)(lVar4 + 0x178);
        fStack_34 = *(float *)(lVar4 + 0x158) * 50.0 + *(float *)(lVar4 + 0x17c);
        local_30 = *(float *)(lVar4 + 0x15c) * 50.0 + *(float *)(lVar4 + 0x180);
        local_28 = CONCAT44(fStack_34,local_38);
        local_20 = local_30;
        iVar3 = FUN_1402f98b0(lVar1,&local_38,lVar1 + 0x178,&local_28,lVar1 + 0x524,lVar1 + 0x520,1,
                              0x447a0000);
        if (iVar3 == 1) {
          iVar3 = rand();
          plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
          fVar6 = (float)(**(code **)(*plVar5 + 0x78))(plVar5);
          if (((fVar6 <= (float)iVar3 * 3.0517578e-05) && (param_2 != 0)) &&
             (lVar4 = *(longlong *)(param_3 + 0xa0),
             fVar9 = *(float *)(param_2 + 0x17c) - *(float *)(lVar4 + 0x17c),
             fVar8 = *(float *)(param_2 + 0x178) - *(float *)(lVar4 + 0x178),
             fVar7 = *(float *)(param_2 + 0x180) - *(float *)(lVar4 + 0x180),
             fVar6 = *(float *)(*(longlong *)(lVar4 + 0x130) + 0x28c) - 10.0,
             fVar9 * fVar9 + fVar8 * fVar8 + fVar7 * fVar7 < fVar6 * fVar6)) {
            return 0x3f3d70a4;
          }
        }
      }
    }
  }
  return 0;
}



undefined8 FUN_1402d4a60(undefined8 param_1,longlong param_2,longlong param_3,double param_4)

{
  double dVar1;
  longlong *plVar2;
  char cVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  plVar2 = *(longlong **)(param_3 + 0xa0);
  cVar3 = FUN_1402d3580(*(undefined4 *)((longlong)plVar2 + 300));
  if ((((cVar3 == '\0') && (*(char *)((longlong)plVar2 + 0xc64) == '\0')) && (param_2 != 0)) &&
     ((*(int *)(param_2 + 300) != 0x25 && (*(int *)(param_2 + 300) != 0x62)))) {
    if ((int)plVar2[0x19c] != 0) {
      return 0x40000000;
    }
    dVar1 = (double)plVar2[0x166];
    fVar4 = (float)(**(code **)(*plVar2 + 0x360))(plVar2);
    if ((((double)fVar4 <= param_4 - dVar1) &&
        (fVar6 = *(float *)(param_2 + 0x17c) - *(float *)((longlong)plVar2 + 0x17c),
        fVar5 = *(float *)(param_2 + 0x178) - *(float *)(plVar2 + 0x2f),
        fVar4 = *(float *)(param_2 + 0x180) - *(float *)(plVar2 + 0x30),
        fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4 <
        *(float *)(plVar2[0x26] + 0x284) * *(float *)(plVar2[0x26] + 0x284))) &&
       (cVar3 = FUN_1402fa520(plVar2,param_2), cVar3 != '\0')) {
      return 0x40000000;
    }
  }
  return 0;
}



undefined8 FUN_1402d4b80(undefined8 param_1,longlong param_2,longlong param_3)

{
  float fVar1;
  char cVar2;
  longlong *plVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  plVar3 = *(longlong **)(param_3 + 0xa0);
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar3 + 300));
  if (((cVar2 == '\0') && (param_2 != 0)) && (*(char *)(param_3 + 0xb0) != '\x01')) {
    fVar6 = *(float *)(param_2 + 0x17c) - *(float *)((longlong)plVar3 + 0x17c);
    fVar5 = *(float *)(param_2 + 0x178) - *(float *)(plVar3 + 0x2f);
    fVar4 = *(float *)(param_2 + 0x180) - *(float *)(plVar3 + 0x30);
    fVar1 = *(float *)(plVar3[0x26] + 0x28c);
    if ((fVar1 * fVar1 <= fVar6 * fVar6 + fVar5 * fVar5 + fVar4 * fVar4) &&
       (fVar4 = *(float *)(param_2 + 0x17c) - *(float *)((longlong)plVar3 + 0x17c),
       fVar5 = *(float *)(param_2 + 0x178) - *(float *)(plVar3 + 0x2f),
       fVar6 = *(float *)(param_2 + 0x180) - *(float *)(plVar3 + 0x30),
       fVar1 = *(float *)(plVar3[0x26] + 0x280),
       fVar4 * fVar4 + fVar5 * fVar5 + fVar6 * fVar6 < fVar1 * fVar1)) {
      cVar2 = (**(code **)(*plVar3 + 0x1d8))(plVar3);
      if (cVar2 != '\0') {
        return 0x3f19999a;
      }
    }
    return 0;
  }
  return 0;
}



undefined8 FUN_1402d4ca0(undefined8 param_1,longlong param_2,longlong param_3)

{
  float fVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  
  cVar3 = FUN_1402d3580(*(undefined4 *)(*(longlong *)(param_3 + 0xa0) + 300));
  if (cVar3 != '\0') {
    return 0;
  }
  if ((param_2 != 0) &&
     (lVar2 = *(longlong *)(param_3 + 0xa0),
     fVar7 = *(float *)(param_2 + 0x17c) - *(float *)(lVar2 + 0x17c),
     fVar6 = *(float *)(param_2 + 0x178) - *(float *)(lVar2 + 0x178),
     fVar5 = *(float *)(param_2 + 0x180) - *(float *)(lVar2 + 0x180),
     fVar1 = *(float *)(*(longlong *)(lVar2 + 0x130) + 0x28c),
     fVar7 * fVar7 + fVar6 * fVar6 + fVar5 * fVar5 < fVar1 * fVar1)) {
    iVar4 = rand();
    if ((float)iVar4 * 3.0517578e-05 < 0.15) {
      return 0x3f333333;
    }
    if ((float)iVar4 * 3.0517578e-05 < 0.3) {
      return 0x3f3d70a4;
    }
  }
  return 0x3dcccccd;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_1402d4d90(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  float fVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  float fVar6;
  undefined4 uVar7;
  undefined1 auStack_148 [32];
  float local_128;
  uint local_118 [2];
  float local_110;
  float local_10c;
  float local_108;
  float local_100;
  float local_fc;
  float local_f8;
  undefined8 local_f0;
  float local_e8;
  float local_e0;
  float fStack_dc;
  float local_d8;
  undefined1 local_d0 [24];
  undefined1 local_b8 [64];
  ulonglong local_78;
  
  local_78 = DAT_1405d84f0 ^ (ulonglong)auStack_148;
  plVar5 = *(longlong **)(param_3 + 0xa0);
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar5 + 300));
  if ((cVar2 == '\0') && (lVar4 = (**(code **)(*plVar5 + 0xe8))(plVar5), lVar4 != 0)) {
    plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
    iVar3 = (**(code **)(*plVar5 + 0x30))(plVar5);
    if (iVar3 != 0) {
      plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
      fVar6 = (float)(**(code **)(*plVar5 + 0x38))(plVar5);
      if ((double)fVar6 <= param_4 - *(double *)(param_1 + 0x10)) {
        iVar3 = rand();
        plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
        fVar6 = (float)(**(code **)(*plVar5 + 0x40))(plVar5);
        if ((float)iVar3 * 3.0517578e-05 < fVar6) {
          if (param_2 != 0) {
            lVar4 = *(longlong *)(param_3 + 0xa0);
            local_e8 = *(float *)(param_2 + 0x180) - *(float *)(lVar4 + 0x180);
            local_f0._4_4_ = *(float *)(param_2 + 0x17c) - *(float *)(lVar4 + 0x17c);
            local_f0._0_4_ = *(float *)(param_2 + 0x178) - *(float *)(lVar4 + 0x178);
            D3DXVec3Normalize(&local_f0,&local_f0);
            if ((DAT_140608010 & 1) == 0) {
              DAT_140608010 = DAT_140608010 | 1;
            }
            DAT_140608018._4_4_ = (float)local_f0 * 0.0 - local_e8 * 0.0;
            DAT_140608018._0_4_ = local_e8 - local_f0._4_4_ * 0.0;
            DAT_140608020 = local_f0._4_4_ * 0.0 - (float)local_f0;
            if ((DAT_1406081ac & 1) == 0) {
              DAT_1406081ac = DAT_1406081ac | 1;
            }
            D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
            lVar4 = *(longlong *)(param_3 + 0xa0);
            uVar7 = 0;
            fStack_dc = *(float *)(param_2 + 0x17c) - *(float *)(lVar4 + 0x17c);
            local_e0 = *(float *)(param_2 + 0x178) - *(float *)(lVar4 + 0x178);
            local_118[0] = 0;
            local_d8 = *(float *)(param_2 + 0x180) - *(float *)(lVar4 + 0x180);
            fVar6 = *(float *)(*(longlong *)(lVar4 + 0x130) + 0x28c);
            cVar2 = FUN_140197780(&local_e0,fVar6 * 0.2 + fVar6);
            if (cVar2 != '\0') {
              rand();
              uVar7 = 0x3f35c28f;
              local_118[0] = 0x3f35c28f;
            }
            if (((local_118[0] & 0x7f800000) != 0) &&
               (lVar4 = *(longlong *)(param_3 + 0xa0), lVar4 != 0)) {
              local_110 = *(float *)(lVar4 + 0x178);
              local_10c = *(float *)(lVar4 + 0x17c);
              local_108 = *(float *)(lVar4 + 0x180);
              fVar6 = *(float *)(param_2 + 0x178);
              local_fc = *(float *)(param_2 + 0x17c);
              fVar1 = *(float *)(param_2 + 0x180);
              local_e0 = local_110 - fVar6;
              fStack_dc = local_10c - local_fc;
              local_f0 = CONCAT44(fStack_dc,local_e0);
              local_e8 = local_108 - fVar1;
              local_100 = fVar6;
              local_f8 = fVar1;
              local_d8 = local_e8;
              D3DXMatrixRotationY(local_b8,0x3fc90fdb);
              D3DXVec3TransformNormal(&local_f0,&local_f0,local_b8);
              local_10c = *(float *)(lVar4 + 0x17c);
              local_e0 = fVar6 + (float)local_f0;
              local_d8 = fVar1 + local_e8;
              fVar6 = 0.0;
              local_fc = local_10c;
              fStack_dc = local_10c;
              do {
                local_128 = fVar6;
                FUN_140123b20(local_d0,&local_110,&local_e0,&local_100);
                local_118[0] = 0;
                local_128 = (float)((uint)local_128 & 0xffffff00);
                iVar3 = FUN_1402f9640(lVar4,local_118,local_d0,1);
                if (iVar3 != 1) {
                  return 0;
                }
                fVar6 = fVar6 + 0.25;
              } while (fVar6 <= 1.0);
              return uVar7;
            }
            return 0;
          }
        }
        else {
          *(double *)(param_1 + 0x10) = param_4;
        }
        return 0;
      }
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined4 FUN_1402d51f0(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  float fVar1;
  undefined8 uVar2;
  char cVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  float fVar7;
  undefined4 uVar8;
  undefined1 auStack_148 [32];
  float local_128;
  uint local_118 [2];
  undefined8 local_110;
  float local_108;
  float local_100;
  float local_fc;
  float local_f8;
  float local_f0;
  float fStack_ec;
  float local_e8;
  undefined8 local_e0;
  float local_d8;
  undefined1 local_d0 [24];
  undefined1 local_b8 [64];
  ulonglong local_78;
  
  local_78 = DAT_1405d84f0 ^ (ulonglong)auStack_148;
  plVar6 = *(longlong **)(param_3 + 0xa0);
  cVar3 = FUN_1402d3580(*(undefined4 *)((longlong)plVar6 + 300));
  if ((cVar3 == '\0') && (lVar5 = (**(code **)(*plVar6 + 0xe8))(plVar6), lVar5 != 0)) {
    plVar6 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
    iVar4 = (**(code **)(*plVar6 + 0x30))(plVar6);
    if (iVar4 != 0) {
      plVar6 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
      fVar7 = (float)(**(code **)(*plVar6 + 0x38))(plVar6);
      if ((double)fVar7 <= param_4 - *(double *)(param_1 + 0x10)) {
        iVar4 = rand();
        plVar6 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
        fVar7 = (float)(**(code **)(*plVar6 + 0x40))(plVar6);
        if ((float)iVar4 * 3.0517578e-05 < fVar7) {
          if (param_2 != 0) {
            lVar5 = *(longlong *)(param_3 + 0xa0);
            local_d8 = *(float *)(param_2 + 0x180) - *(float *)(lVar5 + 0x180);
            local_e0._4_4_ = *(float *)(param_2 + 0x17c) - *(float *)(lVar5 + 0x17c);
            local_e0._0_4_ = *(float *)(param_2 + 0x178) - *(float *)(lVar5 + 0x178);
            D3DXVec3Normalize(&local_e0,&local_e0);
            if ((DAT_140608010 & 1) == 0) {
              DAT_140608010 = DAT_140608010 | 1;
            }
            DAT_140608018._4_4_ = (float)local_e0 * 0.0 - local_d8 * 0.0;
            DAT_140608018._0_4_ = local_d8 - local_e0._4_4_ * 0.0;
            DAT_140608020 = local_e0._4_4_ * 0.0 - (float)local_e0;
            if ((DAT_1406081ac & 1) == 0) {
              DAT_1406081ac = DAT_1406081ac | 1;
            }
            D3DXVec3Normalize(&DAT_1406081b0,&DAT_140608018);
            lVar5 = *(longlong *)(param_3 + 0xa0);
            local_118[0] = 0;
            local_110 = _DAT_1406081b0;
            uVar2 = local_110;
            local_110._0_4_ = (float)_DAT_1406081b0;
            local_110._4_4_ = (float)((ulonglong)_DAT_1406081b0 >> 0x20);
            local_108 = DAT_1406081b8;
            local_128 = (float)((uint)local_128 & 0xffffff00);
            local_f0 = (float)local_110 * 30.0 + *(float *)(lVar5 + 0x178);
            fStack_ec = local_110._4_4_ * 30.0 + *(float *)(lVar5 + 0x17c);
            local_e8 = DAT_1406081b8 * 30.0 + *(float *)(lVar5 + 0x180);
            local_110 = uVar2;
            iVar4 = FUN_1402f9640(lVar5,local_118,&local_f0,1);
            if (iVar4 != 1) {
              return 0;
            }
            lVar5 = *(longlong *)(param_3 + 0xa0);
            uVar8 = 0;
            fStack_ec = *(float *)(param_2 + 0x17c) - *(float *)(lVar5 + 0x17c);
            local_f0 = *(float *)(param_2 + 0x178) - *(float *)(lVar5 + 0x178);
            local_118[0] = 0;
            local_e8 = *(float *)(param_2 + 0x180) - *(float *)(lVar5 + 0x180);
            fVar7 = *(float *)(*(longlong *)(lVar5 + 0x130) + 0x28c);
            cVar3 = FUN_140197780(&local_f0,fVar7 * 0.2 + fVar7);
            if (cVar3 != '\0') {
              rand();
              uVar8 = 0x3f35c28f;
              local_118[0] = 0x3f35c28f;
            }
            if (((local_118[0] & 0x7f800000) != 0) &&
               (lVar5 = *(longlong *)(param_3 + 0xa0), lVar5 != 0)) {
              local_110 = *(undefined8 *)(lVar5 + 0x178);
              local_108 = *(float *)(lVar5 + 0x180);
              fVar7 = *(float *)(param_2 + 0x178);
              local_fc = *(float *)(param_2 + 0x17c);
              fVar1 = *(float *)(param_2 + 0x180);
              local_f0 = *(float *)(lVar5 + 0x178) - fVar7;
              fStack_ec = *(float *)(lVar5 + 0x17c) - local_fc;
              local_e0 = CONCAT44(fStack_ec,local_f0);
              local_e8 = local_108 - fVar1;
              local_100 = fVar7;
              local_f8 = fVar1;
              local_d8 = local_e8;
              D3DXMatrixRotationY(local_b8,0xbfc90fdb);
              D3DXVec3TransformNormal(&local_e0,&local_e0,local_b8);
              local_fc = *(float *)(lVar5 + 0x17c);
              local_f0 = fVar7 + (float)local_e0;
              local_e8 = fVar1 + local_d8;
              local_110 = CONCAT44(local_fc,(float)local_110);
              fVar7 = 0.0;
              fStack_ec = local_fc;
              do {
                local_128 = fVar7;
                FUN_140123b20(local_d0,&local_110,&local_f0,&local_100);
                local_118[0] = 0;
                local_128 = (float)((uint)local_128 & 0xffffff00);
                iVar4 = FUN_1402f9640(lVar5,local_118,local_d0,1);
                if (iVar4 != 1) {
                  return 0;
                }
                fVar7 = fVar7 + 0.25;
              } while (fVar7 <= 1.0);
              return uVar8;
            }
            return 0;
          }
        }
        else {
          *(double *)(param_1 + 0x10) = param_4;
        }
        return 0;
      }
    }
  }
  return 0;
}



undefined8 FUN_1402d56f0(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  longlong lVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float local_58;
  float fStack_54;
  float local_50;
  undefined8 local_48;
  float local_40;
  
  plVar5 = *(longlong **)(param_3 + 0xa0);
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar5 + 300));
  if (cVar2 == '\0') {
    lVar4 = (**(code **)(*plVar5 + 0xe8))(plVar5);
    if (lVar4 != 0) {
      plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
      iVar3 = (**(code **)(*plVar5 + 0x68))(plVar5);
      if (iVar3 != 0) {
        plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
        fVar6 = (float)(**(code **)(*plVar5 + 0x70))(plVar5);
        if ((double)fVar6 <= param_4 - *(double *)(param_1 + 0x10)) {
          lVar4 = *(longlong *)(param_3 + 0xa0);
          lVar1 = *(longlong *)(param_3 + 0xa0);
          local_58 = *(float *)(lVar4 + 0x154) * 200.0 + *(float *)(lVar4 + 0x178);
          fStack_54 = *(float *)(lVar4 + 0x158) * 200.0 + *(float *)(lVar4 + 0x17c);
          local_50 = *(float *)(lVar4 + 0x15c) * 200.0 + *(float *)(lVar4 + 0x180);
          local_48 = CONCAT44(fStack_54,local_58);
          local_40 = local_50;
          iVar3 = FUN_1402f98b0(lVar1,&local_58,lVar1 + 0x178,&local_48,lVar1 + 0x524,lVar1 + 0x520,
                                1,0x447a0000);
          if (iVar3 == 1) {
            iVar3 = rand();
            plVar5 = (longlong *)(**(code **)(**(longlong **)(param_3 + 0xa0) + 0xe8))();
            fVar6 = (float)(**(code **)(*plVar5 + 0x78))(plVar5);
            if ((float)iVar3 * 3.0517578e-05 < fVar6) {
              if ((param_2 != 0) &&
                 (lVar4 = *(longlong *)(param_3 + 0xa0),
                 fVar9 = *(float *)(param_2 + 0x17c) - *(float *)(lVar4 + 0x17c),
                 fVar8 = *(float *)(param_2 + 0x178) - *(float *)(lVar4 + 0x178),
                 fVar7 = *(float *)(param_2 + 0x180) - *(float *)(lVar4 + 0x180),
                 fVar6 = *(float *)(*(longlong *)(lVar4 + 0x130) + 0x28c),
                 fVar9 * fVar9 + fVar8 * fVar8 + fVar7 * fVar7 < fVar6 * fVar6)) {
                *(double *)(param_1 + 0x10) = param_4;
                return 0x3f400000;
              }
            }
            else {
              *(double *)(param_1 + 0x10) = param_4;
            }
          }
        }
      }
    }
  }
  return 0;
}



undefined8 FUN_1402d5930(longlong param_1,longlong param_2,longlong param_3,double param_4)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  longlong *plVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  plVar1 = *(longlong **)(param_3 + 0xa0);
  cVar2 = FUN_1402d3580(*(undefined4 *)((longlong)plVar1 + 300));
  if ((cVar2 == '\0') && (lVar4 = (**(code **)(*plVar1 + 0xe8))(plVar1), lVar4 != 0)) {
    plVar5 = (longlong *)(**(code **)(*plVar1 + 0xe8))(plVar1);
    iVar3 = (**(code **)(*plVar5 + 0x50))(plVar5);
    if (((iVar3 != 0) &&
        (((10.0 <= param_4 - *(double *)(param_1 + 0x10) &&
          (3.0 <= param_4 - *(double *)(param_1 + 0x18))) &&
         (*(double *)(param_1 + 0x18) = param_4, param_2 != 0)))) &&
       ((fVar8 = *(float *)(param_2 + 0x17c) - *(float *)((longlong)plVar1 + 0x17c),
        fVar6 = *(float *)(param_2 + 0x180) - *(float *)(plVar1 + 0x30),
        fVar7 = *(float *)(param_2 + 0x178) - *(float *)(plVar1 + 0x2f),
        fVar8 * fVar8 + fVar7 * fVar7 + fVar6 * fVar6 < 160000.0 &&
        (iVar3 = rand(), 0.3 <= (float)iVar3 * 3.0517578e-05)))) {
      switch(*(undefined4 *)(param_2 + 300)) {
      case 0x1c:
      case 0x1d:
      case 0x1f:
      case 0x20:
      case 0x21:
      case 0x22:
      case 0x23:
      case 0x24:
      case 0x2f:
      case 0x30:
      case 0x32:
      case 0x60:
      case 0x61:
        break;
      default:
        return 0x3f4ccccd;
      }
    }
  }
  return 0;
}



undefined8 FUN_1402d5af0(undefined8 param_1,undefined8 param_2,longlong param_3)

{
  if (*(char *)(param_3 + 0xb0) == '\x01') {
    return 0x3fc00000;
  }
  return 0;
}



undefined8 FUN_1402d5b10(undefined8 param_1,undefined8 param_2,longlong param_3)

{
  char cVar1;
  int iVar2;
  
  iVar2 = (**(code **)(**(longlong **)(param_3 + 0xa0) + 0x128))();
  if (iVar2 != 0) {
    cVar1 = (**(code **)(**(longlong **)(param_3 + 0xa0) + 0x1e0))();
    if (cVar1 != '\0') {
      return 0x40400000;
    }
  }
  return 0;
}



void ** FUN_1402d5b60(void)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  DAT_140607fb0 = 0;
  pvVar1 = operator_new(0x20);
  if (pvVar1 != (void *)0x0) {
    DAT_140607fa8 = pvVar1;
    *(void **)pvVar1 = pvVar1;
    *(void **)((longlong)DAT_140607fa8 + 8) = DAT_140607fa8;
    return &DAT_140607fa8;
  }
  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_1405d3608);
}



void FUN_1402d5be0(longlong param_1)

{
  uint uVar1;
  undefined8 uVar2;
  
  do {
    if (*(int *)(param_1 + 0x1380) == 0x270) {
      uVar2 = 0;
LAB_1402d5c1d:
      FUN_140275e00(param_1,uVar2);
    }
    else if (0x4df < *(int *)(param_1 + 0x1380)) {
      uVar2 = 1;
      goto LAB_1402d5c1d;
    }
    uVar1 = *(uint *)(param_1 + (longlong)*(int *)(param_1 + 0x1380) * 4);
    *(int *)(param_1 + 0x1380) = *(int *)(param_1 + 0x1380) + 1;
    uVar1 = uVar1 ^ uVar1 >> 0xb;
    uVar1 = uVar1 ^ (uVar1 & 0xff3a58ad) << 7;
    uVar1 = uVar1 ^ (uVar1 & 0xffffdf8c) << 0xf;
    if ((double)(uVar1 >> 0x12 ^ uVar1) * *(double *)(param_1 + 5000) < 1.0) {
      return;
    }
  } while( true );
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined4 * FUN_1402d5c80(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;
  _DAT_140608700 = 0x100000001;
  _DAT_140608708 = 0x100000001;
  _DAT_140608710 = 0x100000001;
  _DAT_140608718 = 0x100000001;
  _DAT_140608720 = 0x100000001;
  _DAT_140608728 = 0x100000001;
  _DAT_140608730 = 0x100000001;
  _DAT_140608738 = 0x100000001;
  _DAT_140608740 = 0x100000001;
  puVar5 = &DAT_1405e74e0;
  if (0xf < DAT_1405e74f8) {
    puVar5 = DAT_1405e74e0;
  }
  FUN_14000ff80(local_98,puVar5);
  DAT_1405e0652 = 0;
  cVar1 = FUN_140010050(local_98,local_60 + 2);
  plVar3 = local_70;
  if (cVar1 == '\0') {
    local_98[0] = TiXmlDocument::vftable;
    if (local_38 != &DAT_140607be8) {
      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_140607be8) {
      operator_delete__(local_58);
    }
    goto LAB_1402d5f19;
  }
  for (; plVar3 != (longlong *)0x0; plVar3 = (longlong *)plVar3[10]) {
    bVar8 = (char *)(plVar3[7] + 0x10) == (char *)0x0;
    lVar4 = 4;
    pcVar6 = (char *)(plVar3[7] + 0x10);
    pcVar7 = "log";
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      bVar8 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar8);
    if (bVar8) goto LAB_1402d5dd6;
  }
  goto LAB_1402d5ea3;
code_r0x0001402d5e34:
  plVar3 = (longlong *)plVar3[10];
  if (plVar3 == (longlong *)0x0) goto LAB_1402d5e99;
  goto LAB_1402d5e26;
LAB_1402d5dd6:
  while (lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3), lVar4 == 0) {
    do {
      plVar3 = (longlong *)plVar3[10];
      if (plVar3 == (longlong *)0x0) goto LAB_1402d5ea3;
      bVar8 = (char *)(plVar3[7] + 0x10) == (char *)0x0;
      lVar4 = 4;
      pcVar6 = (char *)(plVar3[7] + 0x10);
      pcVar7 = "log";
      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) {
    plVar3 = *(longlong **)(lVar4 + 0x28);
    if (plVar3 != (longlong *)0x0) {
LAB_1402d5e26:
      lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3);
      if (lVar4 == 0) goto code_r0x0001402d5e34;
      for (plVar3 = (longlong *)(**(code **)(*plVar3 + 0x30))(plVar3); plVar3 != (longlong *)0x0;
          plVar3 = (longlong *)(**(code **)(*plVar3 + 0x30))(plVar3)) {
        iVar2 = _stricmp((char *)(plVar3[7] + 0x10),"log_type");
        if (iVar2 == 0) {
          FUN_1402d5f40(plVar3);
        }
        do {
          plVar3 = (longlong *)plVar3[10];
          if (plVar3 == (longlong *)0x0) goto LAB_1402d5e99;
          lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3);
        } while (lVar4 == 0);
      }
    }
LAB_1402d5e99:
    FUN_1402d6050();
  }
LAB_1402d5ea3:
  local_98[0] = TiXmlDocument::vftable;
  if (local_38 != &DAT_140607be8) {
    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_140607be8) {
    operator_delete__(local_58);
  }
LAB_1402d5f19:
  return &DAT_140608700;
}



void FUN_1402d5f40(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_r0x0001402d5f8e;
    }
  }
  pcVar8 = (char *)0x0;
joined_r0x0001402d5f8e:
  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_r0x0001402d5fba;
    }
    lVar3 = *(longlong *)(lVar3 + 0x48);
  } while( true );
  pcVar9 = (char *)0x0;
joined_r0x0001402d5fba:
  do {
    if (lVar2 == lVar1) {
LAB_1402d5fe1:
      uVar11 = 1;
      if (pcVar8 != (char *)0x0) {
        iVar4 = atoi(pcVar8);
        uVar11 = (uint)(0 < iVar4);
      }
      if ((pcVar9 != (char *)0x0) && (uVar5 = atoi(pcVar9), uVar5 < 0x12)) {
        (&DAT_140608700)[(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_1402d5fe1;
    lVar2 = *(longlong *)(lVar2 + 0x48);
  } while( true );
}



void FUN_1402d6050(void)

{
  undefined **ppuVar1;
  
  wprintf(L"----------------------\n");
  wprintf(L"LOG Option\n");
  wprintf(L"----------------------\n");
  ppuVar1 = &PTR_u_LOG_CONNECTION_1405db7f0;
  do {
    wprintf(L"%s : %s\n");
    ppuVar1 = ppuVar1 + 1;
  } while ((longlong)ppuVar1 < 0x1405db880);
                    // WARNING: Could not recover jumptable at 0x0001402d60f6. Too many branches
                    // WARNING: Treating indirect jump as call
  wprintf(L"----------------------\n");
  return;
}



void FUN_1402d6100(longlong *param_1)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  longlong lVar4;
  int iVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  undefined1 uVar8;
  short *psVar9;
  short *psVar10;
  undefined8 *puVar11;
  undefined1 local_20 [8];
  longlong *local_18;
  
  psVar9 = (short *)(param_1[0x26] + 0x458);
  if (7 < *(ulonglong *)(param_1[0x26] + 0x470)) {
    psVar9 = *(short **)psVar9;
  }
  uVar7 = 0xffffffffffffffff;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    sVar3 = *psVar9;
    psVar9 = psVar9 + 1;
  } while (sVar3 != 0);
  if (1 < ~uVar7 - 1) {
    uVar8 = 0;
    iVar5 = (**(code **)(*param_1 + 0xb0))(param_1);
    if ((iVar5 == 0x10) || (iVar5 = (**(code **)(*param_1 + 0xb0))(param_1), iVar5 == 0x20)) {
      uVar8 = 1;
    }
    puVar11 = (undefined8 *)(param_1[0x26] + 0x458);
    if (7 < *(ulonglong *)(param_1[0x26] + 0x470)) {
      puVar11 = (undefined8 *)*puVar11;
    }
    uVar6 = FUN_1402ed720(DAT_140608060,local_20,puVar11,uVar8,0);
    FUN_140343ec0(param_1 + 0x236,uVar6);
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_18 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_18 + 8))();
        LOCK();
        piVar2 = (int *)((longlong)local_18 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_18 + 0x10))();
        }
      }
    }
  }
  lVar4 = param_1[0x26];
  psVar9 = (short *)(lVar4 + 0x700);
  psVar10 = psVar9;
  if (7 < *(ulonglong *)(lVar4 + 0x718)) {
    psVar10 = *(short **)psVar9;
  }
  uVar7 = 0xffffffffffffffff;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    sVar3 = *psVar10;
    psVar10 = psVar10 + 1;
  } while (sVar3 != 0);
  if (1 < ~uVar7 - 1) {
    if (7 < *(ulonglong *)(lVar4 + 0x718)) {
      psVar9 = *(short **)psVar9;
    }
    FUN_1402d8740(param_1,psVar9);
  }
  return;
}



undefined8 FUN_1402d6230(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  uint uVar1;
  longlong *plVar2;
  int iVar3;
  uint *puVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  undefined8 uVar8;
  bool bVar9;
  bool bVar10;
  undefined8 uVar11;
  longlong lVar12;
  undefined1 uVar13;
  
  uVar11 = 0xfffffffffffffffe;
  if (*(longlong *)(param_1 + 0x11b0) == 0) {
    uVar11 = 0;
  }
  else {
    lVar5 = 0;
    lVar6 = 0;
    lVar12 = 0;
    bVar10 = false;
    uVar13 = 0;
    plVar2 = *(longlong **)(param_1 + 0x12e8);
    lVar7 = lVar5;
    if (plVar2 != (longlong *)0x0) {
      lVar7 = lVar6;
      if (plVar2 == *(longlong **)(param_1 + 0x12f0)) {
        if (*plVar2 != 0) {
          lVar7 = *plVar2;
          if ((plVar2 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar3 = DAT_1406080a8 + 1, bVar10 = DAT_1406080a8 == 0, lVar7 = lVar5,
             DAT_1406080a8 = iVar3, bVar10)) {
            FUN_140176d60(1);
          }
          lVar12 = lVar7;
          FUN_14034ed40(lVar7);
          bVar10 = true;
          uVar13 = 1;
        }
      }
      else {
        iVar3 = DAT_1406080a8 + 1;
        bVar9 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar3;
        if (bVar9) {
          FUN_140176d60(1);
        }
      }
    }
    uVar8 = *(undefined8 *)(param_1 + 0x11b0);
    uVar1 = *(uint *)(param_1 + 0xfc0);
    if (uVar1 != 0) {
      if (*(longlong *)(param_1 + 0xff0) != 0) {
        for (puVar4 = *(uint **)(*(longlong *)(param_1 + 0xff0) +
                                ((ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 0x1000)) * 8);
            puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 6)) {
          if ((puVar4[8] == uVar1) && (*puVar4 == uVar1)) {
            if (puVar4 != (uint *)0x0) {
              if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              uVar8 = *(undefined8 *)(puVar4 + 2);
            }
            break;
          }
        }
      }
    }
    uVar11 = FUN_14030d840(uVar8,param_2,param_3,uVar8,uVar11,lVar12,uVar13);
    if (bVar10) {
      FUN_14034edd0(lVar7);
    }
  }
  return uVar11;
}



undefined8 FUN_1402d63a0(longlong param_1,uint param_2,undefined4 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  uint *puVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  
  uVar9 = 0xfffffffffffffffe;
  lVar6 = 0;
  lVar4 = 0;
  lVar10 = 0;
  bVar8 = false;
  uVar11 = 0;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar6;
  if (plVar1 != (longlong *)0x0) {
    lVar5 = lVar4;
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      if (*plVar1 != 0) {
        lVar5 = *plVar1;
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar6,
           DAT_1406080a8 = iVar2, bVar8)) {
          FUN_140176d60(1);
        }
        lVar10 = lVar5;
        FUN_14034ed40(lVar5);
        bVar8 = true;
        uVar11 = 1;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar7 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar7) {
        FUN_140176d60(1);
      }
    }
  }
  if (*(longlong *)(param_1 + 0xce8) != 0) {
    for (puVar3 = *(uint **)(*(longlong *)(param_1 + 0xce8) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xcf8)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 4)) {
      if ((puVar3[6] == param_2) && (*puVar3 == param_2)) {
        if (puVar3 != (uint *)0x0) {
          if (puVar3 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          param_2 = puVar3[2];
        }
        break;
      }
    }
  }
  if (*(char *)(param_1 + 0xef4) != '\0') {
    if (*(longlong *)(param_1 + 0xd30) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(param_1 + 0xd30) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xd40)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 4)) {
        if ((puVar3[6] == param_2) && (*puVar3 == param_2)) {
          if (puVar3 != (uint *)0x0) {
            if (puVar3 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            param_2 = puVar3[2];
          }
          break;
        }
      }
    }
  }
  uVar9 = FUN_1402d6230(param_1,param_2,param_3,param_4,uVar9,lVar10,uVar11);
  if (bVar8) {
    FUN_14034edd0(lVar5);
  }
  return uVar9;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402d6550(longlong param_1,ulonglong *param_2)

{
  ulonglong uVar1;
  int iVar2;
  ulonglong *puVar3;
  uint uVar4;
  bool bVar5;
  
  uVar1 = param_2[1];
  uVar4 = (uint)*param_2 ^ *(uint *)((longlong)param_2 + 4) ^ (uint)param_2[1] ^
          *(uint *)((longlong)param_2 + 0xc);
  if (*(longlong *)(param_1 + 0xa58) != 0) {
    for (puVar3 = *(ulonglong **)
                   (*(longlong *)(param_1 + 0xa58) +
                   ((ulonglong)uVar4 % (ulonglong)*(uint *)(param_1 + 0xa68)) * 8);
        puVar3 != (ulonglong *)0x0; puVar3 = (ulonglong *)puVar3[5]) {
      if ((uint)puVar3[6] == uVar4) {
        bVar5 = *puVar3 < *param_2;
        if ((*puVar3 == *param_2) && (bVar5 = puVar3[1] < uVar1, puVar3[1] == uVar1)) {
          iVar2 = 0;
        }
        else {
          iVar2 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);
        }
        if (iVar2 == 0) {
          if (puVar3 == (ulonglong *)0x0) {
            return;
          }
          *(uint *)((longlong)puVar3 + 0x24) = *(uint *)((longlong)param_2 + 0x14);
          return;
        }
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402d6610(longlong param_1,int param_2,int param_3)

{
  longlong *plVar1;
  longlong lVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  undefined1 auStack_48 [32];
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_48;
  plVar1 = (longlong *)(param_1 + 0xa58);
  if (*(longlong *)(param_1 + 0xa60) != 0) {
    uVar4 = 0;
    if (*(uint *)(param_1 + 0xa68) != 0) {
      plVar7 = (longlong *)*plVar1;
      do {
        if (*plVar7 != 0) {
          lVar6 = ((longlong *)*plVar1)[uVar4];
          goto joined_r0x0001402d6665;
        }
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        plVar7 = plVar7 + 1;
      } while (uVar3 < *(uint *)(param_1 + 0xa68));
    }
  }
  lVar6 = 0;
joined_r0x0001402d6665:
  do {
    lVar2 = lVar6;
    if (lVar2 == 0) {
      return;
    }
    lVar6 = 0;
    if ((lVar2 != 0) && (lVar6 = *(longlong *)(lVar2 + 0x28), lVar6 == 0)) {
      uVar3 = *(uint *)(lVar2 + 0x30) % *(uint *)(param_1 + 0xa68) + 1;
      lVar5 = (longlong)(int)uVar3 << 3;
      do {
        if (*(uint *)(param_1 + 0xa68) <= uVar3) break;
        if (*(longlong *)(lVar5 + *plVar1) != 0) {
          lVar6 = *(longlong *)(lVar5 + *plVar1);
        }
        uVar3 = uVar3 + 1;
        lVar5 = lVar5 + 8;
      } while (lVar6 == 0);
    }
    if ((*(int *)(lVar2 + 0x20) == param_2) && (*(int *)(lVar2 + 0x24) == param_3)) {
      local_28 = *(undefined4 *)(lVar2 + 0x10);
      local_24 = *(undefined4 *)(lVar2 + 0x14);
      local_20 = *(undefined4 *)(lVar2 + 0x18);
      local_1c = *(undefined4 *)(lVar2 + 0x1c);
      FUN_1402d91c0(plVar1,&local_28);
      return;
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402d6720(longlong *param_1,undefined4 *param_2)

{
  uint uVar1;
  longlong *plVar2;
  uint *puVar3;
  int iVar4;
  longlong lVar5;
  uint *puVar6;
  uint *puVar7;
  longlong lVar8;
  uint *puVar9;
  longlong *plVar10;
  bool bVar11;
  bool bVar12;
  undefined1 auStack_c8 [32];
  uint local_a8;
  uint uStack_a4;
  longlong local_a0;
  uint local_98;
  undefined8 local_94;
  longlong local_88;
  char local_80;
  undefined8 local_78;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  ulonglong local_48;
  
  local_78 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  lVar8 = 0;
  local_a0 = 0;
  local_88 = 0;
  bVar12 = false;
  local_80 = '\0';
  plVar2 = (longlong *)param_1[0x25d];
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == (longlong *)param_1[0x25e]) {
      lVar5 = *plVar2;
      lVar8 = 0;
      if (lVar5 != 0) {
        if (plVar2 != (longlong *)param_1[0x25e]) {
          iVar4 = DAT_1406080a8 + 1;
          bVar12 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar4;
          if (bVar12) {
            FUN_140176d60(1);
          }
          lVar5 = 0;
        }
        local_80 = 0;
        local_a0 = lVar5;
        local_88 = lVar5;
        FUN_14034ed40(lVar5);
        bVar12 = true;
        local_80 = '\x01';
        lVar8 = lVar5;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  local_70 = *param_2;
  local_6c = param_2[1];
  local_68 = param_2[2];
  local_64 = param_2[3];
  local_60 = *param_2;
  local_5c = param_2[1];
  local_58 = param_2[2];
  local_54 = param_2[3];
  local_50 = param_2[4];
  local_4c = param_2[5];
  FUN_1402d90a0(param_1 + 0x14b,&local_70,&local_60);
  local_70 = param_2[4];
  local_6c = *param_2;
  local_68 = param_2[1];
  local_64 = param_2[2];
  local_60 = param_2[3];
  local_58 = param_2[5];
  local_5c = local_70;
  FUN_1402d9480(param_1 + 0x15d,local_70,&local_6c);
  if (1 < (int)param_2[5]) {
    (**(code **)(*param_1 + 800))(param_1,param_2[4],param_2[5] + -1);
  }
  lVar5 = FUN_14030d840(param_1[0x236],param_2[4],param_2[5]);
  if (lVar5 == 0) {
    if (!bVar12) {
      return;
    }
  }
  else {
    if (*(int *)(lVar5 + 0x58) == 1) {
      (**(code **)(*param_1 + 0x580))(param_1);
    }
    if (*(int *)(lVar5 + 0x80) == 1000) {
      (**(code **)(*param_1 + 0x528))(param_1);
    }
    FUN_1401624a0(param_1 + 0x19d);
    plVar2 = *(longlong **)(param_1[0x236] + 0x50);
    for (plVar10 = *(longlong **)(param_1[0x236] + 0x48); plVar10 != plVar2; plVar10 = plVar10 + 2)
    {
      iVar4 = 0;
      puVar3 = (uint *)*plVar10;
      puVar7 = *(uint **)(puVar3 + 6);
      puVar6 = *(uint **)(puVar3 + 4);
      if (puVar6 != puVar7) {
        do {
          uVar1 = *puVar6;
          if (param_1[0x15d] != 0) {
            for (puVar9 = *(uint **)(param_1[0x15d] +
                                    ((ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 0x15f)) * 8);
                puVar9 != (uint *)0x0; puVar9 = *(uint **)(puVar9 + 8)) {
              if ((puVar9[10] == uVar1) && (*puVar9 == uVar1)) {
                if (puVar9 != (uint *)0x0) {
                  iVar4 = iVar4 + 1;
                }
                break;
              }
            }
          }
          puVar6 = puVar6 + 1;
        } while (puVar6 != puVar7);
      }
      if (iVar4 == (int)((longlong)puVar7 - *(longlong *)(puVar3 + 4) >> 2)) {
        uVar1 = puVar3[1];
        if (param_1[0x19d] != 0) {
          for (puVar7 = *(uint **)(param_1[0x19d] +
                                  ((ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 0x19f)) * 8);
              puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 4)) {
            if ((puVar7[6] == uVar1) && (*puVar7 == uVar1)) {
              if (puVar7 != (uint *)0x0) {
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                if ((int)*puVar3 < (int)puVar7[1]) {
                  if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                    FUN_14000d450(0x80004005);
                  }
                  puVar7[1] = *puVar3;
                  if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                    FUN_14000d450(0x80004005);
                  }
                  puVar7[2] = *(uint *)(*plVar10 + 8);
                }
                goto LAB_1402d6a22;
              }
              break;
            }
          }
        }
        local_a8 = *puVar3;
        uStack_a4 = puVar3[2];
        local_94 = CONCAT44(uStack_a4,local_a8);
        local_98 = uVar1;
        FUN_1402d9570(param_1 + 0x19d,uVar1,&local_94);
      }
LAB_1402d6a22:
    }
    FUN_1401624a0(param_1 + 0x1a6);
    plVar2 = *(longlong **)(param_1[0x236] + 0x70);
    for (plVar10 = *(longlong **)(param_1[0x236] + 0x68); plVar10 != plVar2; plVar10 = plVar10 + 2)
    {
      puVar3 = (uint *)*plVar10;
      uVar1 = puVar3[1];
      if (param_1[0x1a6] != 0) {
        for (puVar7 = *(uint **)(param_1[0x1a6] +
                                ((ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 0x1a8)) * 8);
            puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 4)) {
          if ((puVar7[6] == uVar1) && (*puVar7 == uVar1)) {
            if (puVar7 != (uint *)0x0) {
              if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
              if ((int)*puVar3 < (int)puVar7[1]) {
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                puVar7[1] = *puVar3;
                if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                puVar7[2] = *(uint *)(*plVar10 + 8);
              }
              goto LAB_1402d6b16;
            }
            break;
          }
        }
      }
      local_a8 = *puVar3;
      uStack_a4 = puVar3[2];
      local_94 = CONCAT44(uStack_a4,local_a8);
      local_98 = uVar1;
      FUN_1402d9570(param_1 + 0x1a6,uVar1,&local_94);
LAB_1402d6b16:
    }
    lVar8 = local_a0;
    if (local_80 == '\0') {
      return;
    }
  }
  FUN_14034edd0(lVar8);
  return;
}



void FUN_1402d6b80(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1402d9280(param_1 + 0xa58);
  FUN_14025e7e0(param_1 + 0xa10);
  FUN_1402d9280(param_1 + 0xaa0);
  FUN_1402d98b0(param_1 + 0xae8);
  FUN_1401624a0(param_1 + 0xce8);
  FUN_1401624a0(param_1 + 0xd30);
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_1402d6c90(longlong param_1,uint param_2,uint param_3)

{
  char cVar1;
  undefined8 uVar2;
  uint *puVar3;
  longlong lVar4;
  
  lVar4 = (longlong)(int)param_3;
  if (param_3 < 0x1e) {
    uVar2 = 0;
    cVar1 = FUN_140195920(param_1 + 0x12e8);
    if (cVar1 != '\0') {
      uVar2 = FUN_140195970(param_1 + 0x12e8);
      FUN_14034ed40(uVar2);
    }
    if (*(longlong *)(param_1 + 0x9c8) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(param_1 + 0x9c8) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x9d8)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x20)) {
        if ((puVar3[0x22] == param_2) && (*puVar3 == param_2)) {
          if (puVar3 != (uint *)0x0) {
            if (puVar3 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            puVar3[lVar4 + 1] = 0;
          }
          break;
        }
      }
    }
    if (*(longlong *)(param_1 + 0xa10) != 0) {
      for (puVar3 = *(uint **)(*(longlong *)(param_1 + 0xa10) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa20)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x7a)) {
        if ((puVar3[0x7c] == param_2) && (*puVar3 == param_2)) {
          if (puVar3 != (uint *)0x0) {
            if (puVar3 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            puVar3[lVar4 * 4 + 1] = 0;
            puVar3[lVar4 * 4 + 2] = 0;
            puVar3[lVar4 * 4 + 3] = 0;
            puVar3[lVar4 * 4 + 4] = 0;
          }
          break;
        }
      }
    }
    if (cVar1 != '\0') {
      FUN_14034edd0(uVar2);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402d6e30(longlong param_1,undefined4 param_2,uint param_3,ulonglong *param_4)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong uVar3;
  longlong lVar4;
  ulonglong uVar5;
  ulonglong *puVar6;
  uint uVar7;
  longlong lVar8;
  bool bVar9;
  undefined1 auStack_78 [32];
  undefined8 local_58;
  ulonglong local_50;
  uint local_48;
  uint uStack_44;
  ulonglong local_40;
  
  local_58 = 0xfffffffffffffffe;
  local_40 = DAT_1405d84f0 ^ (ulonglong)auStack_78;
  lVar8 = (longlong)(int)param_3;
  if (param_3 < 0x1e) {
    local_50 = *param_4;
    local_48 = (uint)param_4[1];
    uStack_44 = *(uint *)((longlong)param_4 + 0xc);
    uVar1 = param_4[1];
    uVar7 = (uint)*param_4 ^ *(uint *)((longlong)param_4 + 4) ^ local_48 ^ uStack_44;
    uVar5 = 0;
    if (*(longlong *)(param_1 + 0xa58) != 0) {
      for (puVar6 = *(ulonglong **)
                     (*(longlong *)(param_1 + 0xa58) +
                     ((ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0xa68)) * 8);
          puVar6 != (ulonglong *)0x0; puVar6 = (ulonglong *)puVar6[5]) {
        if ((uint)puVar6[6] == uVar7) {
          bVar9 = *puVar6 < local_50;
          if ((*puVar6 != local_50) ||
             (bVar9 = puVar6[1] < uVar1, uVar3 = uVar5, puVar6[1] != uVar1)) {
            uVar3 = (ulonglong)((1 - (uint)bVar9) - (uint)(bVar9 != 0));
          }
          if ((int)uVar3 == 0) {
            if (puVar6 == (ulonglong *)0x0) {
              return;
            }
            if (puVar6 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            lVar4 = FUN_14030d840(*(undefined8 *)(param_1 + 0x11b0),(int)puVar6[4],
                                  *(undefined4 *)((longlong)puVar6 + 0x24));
            if ((lVar4 != 0) &&
               (cVar2 = FUN_1402d6ff0(param_1,param_2,param_3,*(undefined4 *)(lVar4 + 0x18)),
               cVar2 == '\0')) {
              return;
            }
            local_50 = 0;
            local_48 = local_48 & 0xffffff00;
            cVar2 = FUN_140195920(param_1 + 0x12e8);
            if (cVar2 != '\0') {
              uVar5 = FUN_140195970(param_1 + 0x12e8);
              local_48 = local_48 & 0xffffff00;
              local_50 = uVar5;
              FUN_14034ed40(uVar5);
              local_48 = CONCAT31(local_48._1_3_,1);
            }
            lVar4 = FUN_14025e620(param_1 + 0xa10,param_2);
            *(uint *)(lVar4 + lVar8 * 0x10) = (uint)*param_4;
            *(uint *)(lVar4 + 4 + lVar8 * 0x10) = *(uint *)((longlong)param_4 + 4);
            *(uint *)(lVar4 + 8 + lVar8 * 0x10) = (uint)param_4[1];
            *(uint *)(lVar4 + 0xc + lVar8 * 0x10) = *(uint *)((longlong)param_4 + 0xc);
            if (cVar2 == '\0') {
              return;
            }
            FUN_14034edd0(uVar5);
            return;
          }
        }
      }
    }
  }
  return;
}



undefined1 FUN_1402d6ff0(longlong param_1,undefined4 param_2,uint param_3,undefined4 param_4)

{
  longlong lVar1;
  char cVar2;
  undefined1 uVar3;
  undefined8 uVar4;
  
  if (param_3 < 0x1e) {
    uVar4 = 0;
    cVar2 = FUN_140195920(param_1 + 0x12e8);
    if (cVar2 != '\0') {
      uVar4 = FUN_140195970(param_1 + 0x12e8);
      FUN_14034ed40(uVar4);
    }
    lVar1 = FUN_1402d93c0(param_1 + 0x9c8,param_2);
    *(undefined4 *)(lVar1 + (longlong)(int)param_3 * 4) = param_4;
    if (cVar2 != '\0') {
      FUN_14034edd0(uVar4);
    }
    uVar3 = 1;
  }
  else {
    uVar3 = 0;
  }
  return uVar3;
}



undefined8 FUN_1402d70c0(longlong param_1,longlong param_2)

{
  if (param_2 != 0) {
    if ((((*(int *)(param_2 + 0x1c) != -1) &&
         (*(int *)(param_2 + 0x1c) != *(int *)(param_1 + 0xfc0))) &&
        (*(longlong *)(param_1 + 0xb70) != 0)) &&
       (*(int *)(*(longlong *)(param_1 + 0xb70) + 0xc) != 0)) {
      return 0;
    }
  }
  *(longlong *)(param_1 + 0xb50) = param_2;
  return 1;
}



undefined8 FUN_1402d7100(longlong param_1,longlong param_2)

{
  if (param_2 != 0) {
    if ((((*(int *)(param_2 + 0x1c) != -1) &&
         (*(int *)(param_2 + 0x1c) != *(int *)(param_1 + 0xfc0))) &&
        (*(longlong *)(param_1 + 0xb70) != 0)) &&
       (*(int *)(*(longlong *)(param_1 + 0xb70) + 0xc) != 0)) {
      return 0;
    }
  }
  return 1;
}



ulonglong FUN_1402d7130(longlong *param_1,longlong param_2)

{
  ulonglong uVar1;
  
  if ((((param_2 != 0) && (*(int *)(param_2 + 0x1c) != -1)) &&
      (*(int *)(param_2 + 0x1c) != (int)param_1[0x1f8])) &&
     ((uVar1 = param_1[0x16e], uVar1 != 0 && (*(int *)(uVar1 + 0xc) != 0)))) {
    return uVar1 & 0xffffffffffffff00;
  }
  param_1[0x168] = param_2;
                    // WARNING: Could not recover jumptable at 0x0001402d716b. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar1 = (**(code **)(*param_1 + 200))(param_1,0x44);
  return uVar1;
}



ulonglong FUN_1402d7180(longlong *param_1,longlong param_2)

{
  ulonglong uVar1;
  
  if ((((param_2 != 0) && (*(int *)(param_2 + 0x1c) != -1)) &&
      (*(int *)(param_2 + 0x1c) != (int)param_1[0x1f8])) &&
     ((uVar1 = param_1[0x16e], uVar1 != 0 && (*(int *)(uVar1 + 0xc) != 0)))) {
    return uVar1 & 0xffffffffffffff00;
  }
                    // WARNING: Could not recover jumptable at 0x0001402d71b4. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar1 = (**(code **)(*param_1 + 200))(param_1,0x43);
  return uVar1;
}



undefined8 FUN_1402d71c0(longlong param_1,longlong param_2)

{
  if (param_2 != 0) {
    if ((((*(int *)(param_2 + 0x1c) != -1) &&
         (*(int *)(param_2 + 0x1c) != *(int *)(param_1 + 0xfc0))) &&
        (*(longlong *)(param_1 + 0xb70) != 0)) &&
       (*(int *)(*(longlong *)(param_1 + 0xb70) + 0xc) != 0)) {
      return 0;
    }
  }
  *(longlong *)(param_1 + 0xb48) = param_2;
  return 1;
}



undefined8 FUN_1402d7200(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  
  if ((((param_2 != 0) && (*(int *)(param_2 + 0x1c) != -1)) &&
      (*(int *)(param_2 + 0x1c) != (int)param_1[0x1f8])) &&
     ((param_1[0x16e] != 0 && (*(int *)(param_1[0x16e] + 0xc) != 0)))) {
    return 0;
  }
  param_1[0x16c] = param_2;
  if (param_2 != 0) {
    lVar1 = FUN_1402f2de0(DAT_140608068,*(undefined4 *)(param_2 + 0x5c));
    param_1[0x16e] = lVar1;
    (**(code **)(*param_1 + 0x510))(param_1,*(undefined4 *)(param_2 + 0x5c));
    if (param_1[0x16e] != 0) {
      param_1[0x1f9] = (longlong)((double)*(float *)(param_1[0x16e] + 0x68) + (double)param_1[0xa2])
      ;
      return 1;
    }
  }
  return 0;
}



undefined8 FUN_1402d72b0(longlong *param_1)

{
  longlong lVar1;
  
  if (param_1[0x236] != 0) {
    lVar1 = FUN_14030d840();
    if (lVar1 != 0) {
      (**(code **)(*param_1 + 0x340))(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



ulonglong FUN_1402d72f0(longlong *param_1,undefined8 param_2,undefined8 param_3,undefined1 param_4)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  ulonglong uVar5;
  
  lVar4 = FUN_1402d6230();
  uVar5 = 0;
  if ((lVar4 != 0) &&
     ((((*(int *)(lVar4 + 0x1c) == -1 || (*(int *)(lVar4 + 0x1c) == (int)param_1[0x1f8])) ||
       (uVar5 = param_1[0x16e], uVar5 == 0)) || (*(int *)(uVar5 + 0xc) == 0)))) {
    if (param_1 + 0x16f != (longlong *)0x0) {
      lVar3 = param_1[0x16f];
      uVar5 = *(ulonglong *)(lVar3 + 0x198);
      if (((*(char *)(uVar5 + 0x20) != '\0') ||
          (uVar5 = *(ulonglong *)(lVar3 + 0x1a0), *(char *)(uVar5 + 0x20) != '\0')) ||
         ((uVar5 = *(ulonglong *)(lVar3 + 0x1c8), *(char *)(uVar5 + 0x20) != '\0' ||
          ((uVar5 = *(ulonglong *)(lVar3 + 0x1a8), *(char *)(uVar5 + 0x20) != '\0' ||
           (uVar5 = *(ulonglong *)(lVar3 + 0x1e8), *(char *)(uVar5 + 0x20) != '\0'))))))
      goto LAB_1402d730e;
    }
    iVar1 = *(int *)(lVar4 + 0x58);
    if (iVar1 == 2) {
      iVar2 = *(int *)(lVar4 + 100);
      if ((iVar2 == 1) || (iVar2 == 3)) {
                    // WARNING: Could not recover jumptable at 0x0001402d7432. Too many branches
                    // WARNING: Treating indirect jump as call
        uVar5 = (**(code **)(*param_1 + 0x588))(param_1,lVar4,param_4);
        return uVar5;
      }
      if (iVar2 == 4) {
                    // WARNING: Could not recover jumptable at 0x0001402d7417. Too many branches
                    // WARNING: Treating indirect jump as call
        uVar5 = (**(code **)(*param_1 + 0x598))(param_1);
        return uVar5;
      }
      if (iVar2 == 5) {
                    // WARNING: Could not recover jumptable at 0x0001402d7400. Too many branches
                    // WARNING: Treating indirect jump as call
        uVar5 = (**(code **)(*param_1 + 0x5a0))(param_1);
        return uVar5;
      }
    }
    else if (2 < iVar1) {
      if (iVar1 < 5) {
                    // WARNING: Could not recover jumptable at 0x0001402d73c8. Too many branches
                    // WARNING: Treating indirect jump as call
        uVar5 = (**(code **)(*param_1 + 0x5a8))(param_1);
        return uVar5;
      }
      if (iVar1 == 5) {
                    // WARNING: Could not recover jumptable at 0x0001402d73b1. Too many branches
                    // WARNING: Treating indirect jump as call
        uVar5 = (**(code **)(*param_1 + 0x340))(param_1);
        return uVar5;
      }
    }
    return CONCAT71((uint7)(uint3)((uint)iVar1 >> 8),1);
  }
LAB_1402d730e:
  return uVar5 & 0xffffffffffffff00;
}



ulonglong FUN_1402d7440(longlong *param_1,longlong param_2,undefined4 param_3,undefined4 param_4,
                       undefined4 param_5)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  uint uVar3;
  longlong *plVar4;
  ulonglong uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  longlong local_50;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  double local_30;
  
  lVar7 = 0;
  bVar11 = false;
  plVar4 = (longlong *)param_1[0x25d];
  lVar9 = lVar7;
  if (plVar4 != (longlong *)0x0) {
    if (plVar4 == (longlong *)param_1[0x25e]) {
      lVar8 = *plVar4;
      lVar9 = 0;
      if (lVar8 != 0) {
        if ((plVar4 != (longlong *)param_1[0x25e]) &&
           (uVar3 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, lVar8 = lVar7,
           DAT_1406080a8 = uVar3, bVar11)) {
          FUN_140176d60(1);
        }
        plVar4 = (longlong *)FUN_14034ed40(lVar8);
        bVar11 = true;
        lVar9 = lVar8;
      }
    }
    else {
      uVar3 = DAT_1406080a8 + 1;
      plVar4 = (longlong *)(ulonglong)uVar3;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = uVar3;
      if (bVar10) {
        plVar4 = (longlong *)FUN_140176d60(1);
      }
    }
  }
  uVar5 = 1;
  puVar6 = (undefined8 *)param_1[0x196];
  if (param_2 == 0) {
    if (bVar11) {
      plVar4 = (longlong *)FUN_14034edd0(lVar9);
    }
    uVar5 = (ulonglong)plVar4 & 0xffffffffffffff00;
  }
  else {
    if (puVar6 != (undefined8 *)param_1[0x197]) {
LAB_1402d7534:
      if (*(int *)(puVar6 + 1) != *(int *)(param_2 + 0x18)) goto code_r0x0001402d7539;
      if (*(int *)((longlong)puVar6 + 0xc) <= *(int *)(param_2 + 0x28)) {
        (**(code **)(*param_1 + 0x5e0))(param_1,param_2,0);
        puVar1 = (undefined8 *)param_1[0x197];
        puVar2 = puVar6;
        while (puVar2 = puVar2 + 5, puVar2 != puVar1) {
          *puVar6 = *puVar2;
          puVar6[1] = puVar2[1];
          puVar6[2] = puVar2[2];
          puVar6[3] = puVar2[3];
          puVar6[4] = puVar2[4];
          puVar6 = puVar6 + 5;
        }
        param_1[0x197] = param_1[0x197] + -0x28;
        goto LAB_1402d75bc;
      }
      uVar5 = 0;
      goto LAB_1402d7632;
    }
LAB_1402d75bc:
    local_48 = *(undefined4 *)(param_2 + 0x18);
    local_44 = *(undefined4 *)(param_2 + 0x28);
    local_30 = (double)*(float *)(param_2 + 0x3b0) + (double)param_1[0xa2];
    local_3c = param_5;
    local_50 = param_2;
    local_40 = param_4;
    local_38 = param_3;
    FUN_1402d8b30(param_1 + 0x196,&local_50);
    (**(code **)(*param_1 + 0x5e0))(param_1,param_2,1);
LAB_1402d7632:
    if (bVar11) {
      FUN_14034edd0(lVar9);
    }
  }
  return uVar5;
code_r0x0001402d7539:
  puVar6 = puVar6 + 5;
  if (puVar6 == (undefined8 *)param_1[0x197]) goto LAB_1402d75bc;
  goto LAB_1402d7534;
}



void FUN_1402d7670(undefined8 param_1,int param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001402d7684. Too many branches
                    // WARNING: Treating indirect jump as call
  (*(code *)(IMAGE_DOS_HEADER_140000000.e_magic + *(uint *)(&DAT_1402d7818 + (longlong)param_2 * 4))
  )();
  return;
}



void FUN_1402d78d0(longlong param_1,longlong param_2)

{
  float fVar1;
  DWORD DVar2;
  HANDLE hObject;
  HANDLE pvVar3;
  float *pfVar4;
  uint uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  float *pfVar9;
  
  fVar1 = *(float *)(param_2 + 0x3b4);
  uVar7 = 0;
  *(undefined1 *)(param_1 + 0x605) = 1;
  *(float *)(param_1 + 0x5dc) = fVar1 + *(float *)(param_1 + 0x5dc);
  uVar8 = uVar7;
  uVar6 = uVar7;
  do {
    FUN_1403149b0(param_1,uVar8,*(undefined4 *)(uVar6 + *(longlong *)(param_2 + 0x3f0)));
    uVar5 = (int)uVar8 + 1;
    uVar8 = (ulonglong)uVar5;
    uVar6 = uVar6 + 4;
  } while ((int)uVar5 < 0x47);
  pfVar9 = (float *)(param_1 + 0x734);
  uVar8 = uVar7;
  do {
    fVar1 = *(float *)(uVar8 + *(longlong *)(param_2 + 0x400));
    pfVar4 = pfVar9;
    if (0x44 < (uint)uVar7) {
      if ((DAT_14060813c == 0) &&
         (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                (HANDLE)0x0), hObject != (HANDLE)0x0)) {
        DVar2 = GetCurrentProcessId();
        pvVar3 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar3,DVar2,hObject,0x2000,0,0,0);
        CloseHandle(hObject);
      }
      DAT_14060813c = DAT_14060813c + 1;
      pfVar4 = (float *)&DAT_140608138;
    }
    uVar5 = (uint)uVar7 + 1;
    uVar7 = (ulonglong)uVar5;
    pfVar9 = pfVar9 + 1;
    uVar8 = uVar8 + 4;
    *pfVar4 = fVar1 + *pfVar4;
    *(undefined1 *)(param_1 + 0x607) = 1;
  } while ((int)uVar5 < 0x45);
  *(undefined4 *)(param_1 + 0xd7c) = *(undefined4 *)(param_2 + 0x3d0);
  FUN_1402f8080(param_1);
  FUN_1402f8130(param_1);
  return;
}



undefined8 FUN_1402d7a70(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar4 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar4;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar3 = *plVar1;
      lVar5 = 0;
      if (lVar3 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar3 = lVar4,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar3;
        FUN_14034ed40(lVar3);
        bVar7 = true;
        uVar10 = 1;
        lVar5 = lVar3;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  lVar4 = *(longlong *)(param_1 + 0xcb0);
  while( true ) {
    if (lVar4 == *(longlong *)(param_1 + 0xcb8)) {
      if (bVar7) {
        FUN_14034edd0(lVar5);
      }
      return 0;
    }
    lVar3 = FUN_1402d63a0(param_1,*(undefined4 *)(lVar4 + 8),*(undefined4 *)(lVar4 + 0xc),param_4,
                          uVar8,lVar9,uVar10);
    if ((lVar3 != 0) && (*(char *)(lVar3 + 0x3aa) != '\0')) break;
    lVar4 = lVar4 + 0x28;
  }
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return 1;
}



undefined8 FUN_1402d7b90(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  undefined8 uVar9;
  longlong lVar10;
  undefined1 uVar11;
  
  uVar9 = 0xfffffffffffffffe;
  if (*(char *)(param_1 + 0xcd1) == '\x01') {
LAB_1402d7c91:
    uVar9 = 1;
  }
  else {
    lVar5 = 0;
    lVar10 = 0;
    bVar8 = false;
    uVar11 = 0;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar6 = lVar5;
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
        lVar4 = *plVar1;
        lVar6 = 0;
        if (lVar4 != 0) {
          if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar4 = lVar5,
             DAT_1406080a8 = iVar2, bVar8)) {
            FUN_140176d60(1);
          }
          lVar10 = lVar4;
          FUN_14034ed40(lVar4);
          bVar8 = true;
          uVar11 = 1;
          lVar6 = lVar4;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar7 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar7) {
          FUN_140176d60(1);
        }
      }
    }
    lVar5 = *(longlong *)(param_1 + 0xcb8);
    for (lVar4 = *(longlong *)(param_1 + 0xcb0); lVar4 != lVar5; lVar4 = lVar4 + 0x28) {
      lVar3 = FUN_1402d63a0(param_1,*(undefined4 *)(lVar4 + 8),*(undefined4 *)(lVar4 + 0xc),param_4,
                            uVar9,lVar10,uVar11);
      if ((lVar3 != 0) && (*(char *)(lVar3 + 0x3a9) != '\0')) {
        if (bVar8) {
          FUN_14034edd0(lVar6);
        }
        goto LAB_1402d7c91;
      }
    }
    if (bVar8) {
      FUN_14034edd0(lVar6);
    }
    uVar9 = 0;
  }
  return uVar9;
}



void FUN_1402d7cc0(undefined8 param_1,ulonglong *param_2)

{
  longlong *plVar1;
  int iVar2;
  int **ppiVar3;
  int **ppiVar4;
  undefined8 *puVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  int *piVar9;
  int *piVar10;
  longlong lVar11;
  longlong *plVar12;
  undefined8 *puVar13;
  int *piVar14;
  int *piVar15;
  int *local_40;
  longlong *local_38;
  int *local_30;
  
  lVar8 = FUN_1402933b0(DAT_140607ff0);
  if (lVar8 != 0) {
    piVar15 = (int *)0x0;
    piVar14 = piVar15;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      piVar10 = piVar15;
      plVar12 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar12 != 0) {
          piVar14 = (int *)(*(longlong **)(lVar8 + 0x68))[(longlong)piVar10];
          break;
        }
        uVar6 = (int)piVar10 + 1;
        piVar10 = (int *)(ulonglong)uVar6;
        plVar12 = plVar12 + 1;
      } while (uVar6 < *(uint *)(lVar8 + 0x78));
    }
LAB_1402d7d40:
    if (piVar14 != (int *)0x0) {
      iVar2 = *piVar14;
      piVar10 = piVar14;
      if (iVar2 != 0) {
        local_30 = piVar14;
        piVar9 = operator_new(0x20);
        piVar10 = piVar15;
        if (piVar9 != (int *)0x0) {
          piVar9[0] = 0;
          piVar9[1] = 0;
          piVar9[2] = 0;
          piVar9[3] = 0;
          piVar9[4] = 0;
          piVar9[5] = 0;
          piVar9[6] = 0;
          piVar9[7] = 0;
          piVar10 = piVar9;
        }
        local_40 = piVar10;
        FUN_1402d9e40(&local_38,piVar10);
        FUN_140178e90(&local_40,piVar10,piVar10);
        *local_40 = iVar2;
        uVar7 = FUN_1402970c0(lVar8,L"nSlotID");
        piVar10 = (int *)FUN_140296600(lVar8,iVar2,uVar7,L"nSlotID",1);
        local_40[1] = *piVar10;
        uVar7 = FUN_1402970c0(lVar8,L"nSkillID");
        piVar10 = (int *)FUN_140296600(lVar8,iVar2,uVar7,L"nSkillID",1);
        local_40[2] = *piVar10;
        uVar7 = FUN_1402970c0(lVar8,L"nSkillLv");
        piVar10 = (int *)FUN_140296600(lVar8,iVar2,uVar7,L"nSkillLv",1);
        local_40[3] = *piVar10;
        uVar7 = FUN_1402970c0(lVar8,L"nBeforeSkillID01");
        piVar10 = (int *)FUN_140296600(lVar8,iVar2,uVar7,L"nBeforeSkillID01",1);
        local_40[4] = *piVar10;
        uVar7 = FUN_1402970c0(lVar8,L"nBeforeSkillLevel01");
        piVar10 = (int *)FUN_140296600(lVar8,iVar2,uVar7,L"nBeforeSkillLevel01",1);
        local_40[6] = *piVar10;
        uVar7 = FUN_1402970c0(lVar8,L"nBeforeSkillID02");
        piVar10 = (int *)FUN_140296600(lVar8,iVar2,uVar7,L"nBeforeSkillID02",1);
        local_40[5] = *piVar10;
        uVar7 = FUN_1402970c0(lVar8,L"nBeforeSkillLevel02");
        piVar10 = (int *)FUN_140296600(lVar8,iVar2,uVar7,L"nBeforeSkillLevel02",1);
        local_40[7] = *piVar10;
        ppiVar3 = (int **)param_2[1];
        if ((&local_40 < ppiVar3) && (ppiVar4 = (int **)*param_2, ppiVar4 <= &local_40)) {
          if (ppiVar3 == (int **)param_2[2]) {
            FUN_1402d8da0(param_2);
          }
          puVar13 = (undefined8 *)
                    (((longlong)&local_40 - (longlong)ppiVar4 & 0xfffffffffffffff0U) + *param_2);
          puVar5 = (undefined8 *)param_2[1];
          if (puVar5 != (undefined8 *)0x0) {
            *puVar5 = *puVar13;
            lVar11 = puVar13[1];
            puVar5[1] = lVar11;
            if (lVar11 != 0) {
              LOCK();
              *(int *)(lVar11 + 8) = *(int *)(lVar11 + 8) + 1;
              UNLOCK();
              piVar14 = local_30;
            }
          }
        }
        else {
          if (ppiVar3 == (int **)param_2[2]) {
            FUN_1402d8da0(param_2);
          }
          puVar5 = (undefined8 *)param_2[1];
          if (puVar5 != (undefined8 *)0x0) {
            *puVar5 = local_40;
            puVar5[1] = local_38;
            if (local_38 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_38 + 1) = (int)local_38[1] + 1;
              UNLOCK();
              piVar14 = local_30;
            }
          }
        }
        plVar12 = local_38;
        param_2[1] = param_2[1] + 0x10;
        piVar10 = piVar14;
        if (local_38 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_38 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          piVar10 = local_30;
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_38 + 8))(local_38);
            LOCK();
            piVar14 = (int *)((longlong)plVar12 + 0xc);
            *piVar14 = *piVar14 + -1;
            UNLOCK();
            piVar10 = local_30;
            if (*piVar14 == 0) {
              (**(code **)(*plVar12 + 0x10))(plVar12);
              piVar10 = local_30;
            }
          }
        }
      }
      piVar14 = *(int **)(piVar10 + 6);
      if (piVar14 == (int *)0x0) {
        uVar6 = (uint)piVar10[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar6 << 3;
        piVar14 = piVar15;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar6) break;
          if (*(longlong *)(lVar11 + *(longlong *)(lVar8 + 0x68)) != 0) {
            piVar14 = *(int **)(lVar11 + *(longlong *)(lVar8 + 0x68));
          }
          uVar6 = uVar6 + 1;
          lVar11 = lVar11 + 8;
        } while (piVar14 == (int *)0x0);
      }
      goto LAB_1402d7d40;
    }
  }
  return;
}



void FUN_1402d8040(longlong *param_1)

{
  longlong *plVar1;
  undefined8 *puVar2;
  void *pvVar3;
  int iVar4;
  uint uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  longlong lVar8;
  int *piVar10;
  short *psVar11;
  undefined4 *puVar12;
  longlong lVar13;
  longlong *plVar14;
  undefined4 *puVar15;
  bool bVar16;
  bool bVar17;
  undefined4 local_res8 [2];
  undefined4 *local_c8;
  void *local_a8;
  undefined8 local_a0;
  undefined8 local_98;
  undefined1 local_88 [8];
  longlong *local_80;
  undefined8 local_78;
  undefined1 local_70 [8];
  void *local_68;
  undefined1 local_48 [16];
  longlong *local_38;
  undefined4 *puVar9;
  
  local_78 = 0xfffffffffffffffe;
  iVar4 = (**(code **)(*param_1 + 0xb0))();
  if (((iVar4 == 2) || (iVar4 = (**(code **)(*param_1 + 0xb0))(param_1), iVar4 == 1)) &&
     (lVar8 = FUN_1402933b0(DAT_140607ff0,L"PC_MODE_CHANGE_EFFECT"), lVar8 != 0)) {
    puVar15 = (undefined4 *)0x0;
    local_c8 = (undefined4 *)0x0;
    bVar17 = false;
    puVar2 = (undefined8 *)param_1[0x25d];
    if (puVar2 != (undefined8 *)0x0) {
      if (puVar2 == (undefined8 *)param_1[0x25e]) {
        if ((undefined4 *)*puVar2 != (undefined4 *)0x0) {
          local_c8 = (undefined4 *)*puVar2;
          if ((puVar2 != (undefined8 *)param_1[0x25e]) &&
             (iVar4 = DAT_1406080a8 + 1, bVar17 = DAT_1406080a8 == 0, local_c8 = puVar15,
             DAT_1406080a8 = iVar4, bVar17)) {
            FUN_140176d60(1);
          }
          FUN_14034ed40();
          bVar17 = true;
        }
      }
      else {
        iVar4 = DAT_1406080a8 + 1;
        bVar16 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar4;
        if (bVar16) {
          FUN_140176d60(1);
        }
      }
    }
    FUN_1402f3920(param_1 + 0x1fe);
    FUN_1402d96e0(param_1 + 0x207);
    puVar12 = puVar15;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar9 = puVar15;
      plVar14 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar14 != 0) {
          puVar12 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar9];
          break;
        }
        uVar5 = (int)puVar9 + 1;
        puVar9 = (undefined4 *)(ulonglong)uVar5;
        plVar14 = plVar14 + 1;
      } while (uVar5 < *(uint *)(lVar8 + 0x78));
    }
LAB_1402d8180:
    puVar9 = puVar12;
    if (puVar9 != (undefined4 *)0x0) {
      uVar7 = *puVar9;
      local_res8[0] = uVar7;
      uVar6 = FUN_1402970c0(lVar8,L"nAvatarClass");
      piVar10 = (int *)FUN_140296600(lVar8,uVar7,uVar6,L"nAvatarClass",1);
      if ((*piVar10 == 0) || (*piVar10 == (int)param_1[0x24])) {
        uVar7 = FUN_1402970c0(lVar8,L"szSkillTable");
        psVar11 = (short *)FUN_140296990(lVar8,local_res8[0],uVar7,L"szSkillTable",1);
        if ((psVar11 != (short *)0x0) && (*psVar11 != 0)) {
          FUN_1402ed720(DAT_140608060,local_88,psVar11,0,1);
          puVar12 = (undefined4 *)FUN_140342d30(local_48,local_res8,local_88);
          FUN_14030e3c0(param_1 + 0x1fe,*puVar12,puVar12 + 2);
          plVar14 = local_38;
          if (local_38 != (longlong *)0x0) {
            LOCK();
            plVar1 = local_38 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              (**(code **)(*local_38 + 8))(local_38);
              LOCK();
              piVar10 = (int *)((longlong)plVar14 + 0xc);
              *piVar10 = *piVar10 + -1;
              UNLOCK();
              if (*piVar10 == 0) {
                (**(code **)(*plVar14 + 0x10))(plVar14);
              }
            }
          }
          plVar14 = local_80;
          if (local_80 != (longlong *)0x0) {
            LOCK();
            plVar1 = local_80 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              (**(code **)(*local_80 + 8))(local_80);
              LOCK();
              piVar10 = (int *)((longlong)plVar14 + 0xc);
              *piVar10 = *piVar10 + -1;
              UNLOCK();
              if (*piVar10 == 0) {
                (**(code **)(*plVar14 + 0x10))(plVar14);
              }
            }
          }
        }
        uVar7 = FUN_1402970c0(lVar8,L"szSkillEquipTable");
        psVar11 = (short *)FUN_140296990(lVar8,local_res8[0],uVar7,L"szSkillEquipTable",1);
        if ((psVar11 != (short *)0x0) && (*psVar11 != 0)) {
          local_a8 = (void *)0x0;
          local_a0 = 0;
          local_98 = 0;
          FUN_1402d7cc0(psVar11,&local_a8);
          puVar12 = (undefined4 *)FUN_1402d9450(local_70,local_res8,&local_a8);
          FUN_1402d9620(param_1 + 0x207,*puVar12,puVar12 + 2);
          if (local_68 != (void *)0x0) {
            FUN_1402ce6b0();
            operator_delete(local_68);
          }
          pvVar3 = local_a8;
          if (local_a8 != (void *)0x0) {
            FUN_1402ce6b0(local_a8);
            operator_delete(pvVar3);
          }
        }
      }
      puVar12 = *(undefined4 **)(puVar9 + 6);
      if (*(undefined4 **)(puVar9 + 6) == (undefined4 *)0x0) {
        uVar5 = (uint)puVar9[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar13 = (longlong)(int)uVar5 << 3;
        puVar12 = puVar15;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar5) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar13) != 0) {
            puVar12 = *(undefined4 **)(*(longlong *)(lVar8 + 0x68) + lVar13);
          }
          uVar5 = uVar5 + 1;
          lVar13 = lVar13 + 8;
        } while (puVar12 == (undefined4 *)0x0);
      }
      goto LAB_1402d8180;
    }
    if (bVar17) {
      FUN_14034edd0(local_c8);
    }
  }
  return;
}



void FUN_1402d83d0(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1402ce6b0(*(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;
}



undefined8 FUN_1402d8410(longlong param_1,int param_2,int param_3)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if (param_2 == 0) {
    return 1;
  }
  if (*(longlong *)(param_1 + 0xa60) != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 0xa68) != 0) {
      plVar4 = *(longlong **)(param_1 + 0xa58);
      do {
        if (*plVar4 != 0) {
          lVar5 = (*(longlong **)(param_1 + 0xa58))[uVar2];
          goto LAB_1402d8462;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar4 = plVar4 + 1;
      } while (uVar1 < *(uint *)(param_1 + 0xa68));
    }
  }
  lVar5 = 0;
LAB_1402d8462:
  do {
    do {
      lVar3 = lVar5;
      if (lVar3 == 0) {
        return 0;
      }
      if ((*(int *)(lVar3 + 0x20) == param_2) && (param_3 <= *(int *)(lVar3 + 0x24))) {
        return 1;
      }
      lVar5 = *(longlong *)(lVar3 + 0x28);
    } while (lVar5 != 0);
    uVar1 = *(uint *)(lVar3 + 0x30) % *(uint *)(param_1 + 0xa68) + 1;
    lVar3 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 0xa68) <= uVar1) break;
      if (*(longlong *)(lVar3 + *(longlong *)(param_1 + 0xa58)) != 0) {
        lVar5 = *(longlong *)(lVar3 + *(longlong *)(param_1 + 0xa58));
      }
      uVar1 = uVar1 + 1;
      lVar3 = lVar3 + 8;
    } while (lVar5 == 0);
  } while( true );
}



ulonglong FUN_1402d84d0(longlong param_1,uint param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  longlong *plVar4;
  bool bVar5;
  int iVar6;
  ulonglong extraout_RAX;
  ulonglong uVar7;
  uint *puVar8;
  longlong *plVar9;
  longlong *plVar10;
  bool bVar11;
  bool bVar12;
  longlong local_80;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  longlong *local_50;
  longlong *local_48;
  
  *(uint *)(param_1 + 0xfc0) = param_2;
  local_80 = 0;
  bVar12 = false;
  bVar5 = false;
  plVar10 = *(longlong **)(param_1 + 0x12e8);
  if (plVar10 != (longlong *)0x0) {
    if (plVar10 == *(longlong **)(param_1 + 0x12f0)) {
      if (*plVar10 != 0) {
        local_80 = *plVar10;
        if ((plVar10 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar6 = DAT_1406080a8 + 1, bVar12 = DAT_1406080a8 == 0, local_80 = 0,
           DAT_1406080a8 = iVar6, bVar12)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(local_80);
        bVar12 = true;
        bVar5 = true;
      }
    }
    else {
      iVar6 = DAT_1406080a8 + 1;
      bVar11 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar6;
      if (bVar11) {
        FUN_140176d60(1);
      }
    }
  }
  uVar7 = (ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 0x1048);
  if (*(longlong *)(param_1 + 0x1038) != 0) {
    for (puVar8 = *(uint **)(*(longlong *)(param_1 + 0x1038) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x1048)) * 8);
        puVar8 != (uint *)0x0; puVar8 = *(uint **)(puVar8 + 10)) {
      if ((puVar8[0xc] == param_2) && (*puVar8 == param_2)) {
        if (puVar8 != (uint *)0x0) {
          FUN_1402d98b0(param_1 + 0x1080);
          if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar7 = FUN_1402d8c10(&local_50,puVar8 + 2);
          plVar9 = local_48;
          for (plVar10 = local_50; plVar10 != plVar9; plVar10 = plVar10 + 2) {
            uVar7 = FUN_1402d8410(param_1,*(undefined4 *)(*plVar10 + 0x10),
                                  *(undefined4 *)(*plVar10 + 0x18));
            if (((char)uVar7 != '\0') &&
               (uVar7 = FUN_1402d8410(param_1,*(undefined4 *)(*plVar10 + 0x14),
                                      *(undefined4 *)(*plVar10 + 0x1c)), (char)uVar7 != '\0')) {
              lVar3 = *plVar10;
              local_54 = *(undefined4 *)(lVar3 + 4);
              local_5c = *(undefined4 *)(lVar3 + 8);
              local_58 = *(undefined4 *)(lVar3 + 0xc);
              local_6c = 0;
              local_68 = 0;
              local_64 = 0;
              local_60 = 0;
              uVar7 = FUN_1402d97b0(param_1 + 0x1080,local_54,&local_6c);
            }
          }
          if (local_50 != (longlong *)0x0) {
            if (local_50 != plVar9) {
              plVar10 = local_50 + 1;
              do {
                plVar4 = (longlong *)*plVar10;
                if (plVar4 != (longlong *)0x0) {
                  LOCK();
                  plVar1 = plVar4 + 1;
                  *(int *)plVar1 = (int)*plVar1 + -1;
                  UNLOCK();
                  plVar9 = local_48;
                  if ((int)*plVar1 == 0) {
                    (**(code **)(*plVar4 + 8))(plVar4);
                    LOCK();
                    piVar2 = (int *)((longlong)plVar4 + 0xc);
                    *piVar2 = *piVar2 + -1;
                    UNLOCK();
                    plVar9 = local_48;
                    if (*piVar2 == 0) {
                      (**(code **)(*plVar4 + 0x10))(plVar4);
                      plVar9 = local_48;
                    }
                  }
                }
                plVar4 = plVar10 + 1;
                plVar10 = plVar10 + 2;
                bVar12 = bVar5;
              } while (plVar4 != plVar9);
            }
            operator_delete(local_50);
            uVar7 = extraout_RAX;
          }
        }
        break;
      }
    }
  }
  if (bVar12) {
    uVar7 = FUN_14034edd0(local_80);
  }
  return uVar7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402d8740(longlong param_1)

{
  short sVar1;
  int iVar2;
  int *piVar3;
  uint uVar4;
  undefined4 uVar5;
  longlong lVar6;
  undefined4 *puVar8;
  short *psVar9;
  ulonglong *puVar10;
  longlong lVar11;
  longlong *plVar12;
  ulonglong uVar13;
  short *psVar14;
  int *piVar15;
  int *piVar16;
  undefined1 auStack_118 [32];
  undefined1 local_f8;
  int local_e8 [2];
  undefined8 local_e0;
  int local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined2 local_c0;
  undefined6 uStack_be;
  undefined8 local_b0;
  ulonglong local_a8;
  int local_98;
  int local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined2 local_78;
  undefined6 uStack_76;
  undefined8 local_68;
  ulonglong local_60;
  ulonglong local_48;
  int *piVar7;
  
  local_e0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_118;
  FUN_1402d9b20(param_1 + 0x1258);
  lVar6 = FUN_1402933b0(DAT_140607ff0);
  if (lVar6 != 0) {
    piVar16 = (int *)0x0;
    piVar15 = piVar16;
    if ((*(longlong *)(lVar6 + 0x70) != 0) && (*(uint *)(lVar6 + 0x78) != 0)) {
      piVar7 = piVar16;
      plVar12 = *(longlong **)(lVar6 + 0x68);
      do {
        if (*plVar12 != 0) {
          piVar15 = (int *)(*(longlong **)(lVar6 + 0x68))[(longlong)piVar7];
          break;
        }
        uVar4 = (int)piVar7 + 1;
        piVar7 = (int *)(ulonglong)uVar4;
        plVar12 = plVar12 + 1;
      } while (uVar4 < *(uint *)(lVar6 + 0x78));
    }
LAB_1402d87e0:
    piVar7 = piVar15;
    if (piVar7 != (int *)0x0) {
      iVar2 = *piVar7;
      if (iVar2 != 0) {
        local_a8 = 7;
        local_b0 = 0;
        local_c0 = 0;
        local_e8[0] = iVar2;
        local_d8 = iVar2;
        uVar5 = FUN_1402970c0(lVar6,L"nJob");
        local_f8 = 1;
        puVar8 = (undefined4 *)FUN_140296600(lVar6,iVar2,uVar5,L"nJob");
        local_d4 = *puVar8;
        uVar5 = FUN_1402970c0(lVar6,L"nSkillClass");
        local_f8 = 1;
        puVar8 = (undefined4 *)FUN_140296600(lVar6,iVar2,uVar5,L"nSkillClass");
        local_d0 = *puVar8;
        uVar5 = FUN_1402970c0(lVar6,L"nTier");
        local_f8 = 1;
        puVar8 = (undefined4 *)FUN_140296600(lVar6,iVar2,uVar5,L"nTier");
        local_cc = *puVar8;
        uVar5 = FUN_1402970c0(lVar6,L"nColumn");
        local_f8 = 1;
        puVar8 = (undefined4 *)FUN_140296600(lVar6,iVar2,uVar5,L"nColumn");
        local_c8 = *puVar8;
        uVar5 = FUN_1402970c0(lVar6,L"nSkillID");
        local_f8 = 1;
        puVar8 = (undefined4 *)FUN_140296600(lVar6,iVar2,uVar5,L"nSkillID");
        local_c4 = *puVar8;
        uVar5 = FUN_1402970c0(lVar6,L"szMovie");
        local_f8 = 1;
        psVar9 = (short *)FUN_140296990(lVar6,iVar2,uVar5,L"szMovie");
        uVar13 = 0xffffffffffffffff;
        psVar14 = psVar9;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar1 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar1 != 0);
        FUN_140001710(&local_c0,psVar9,~uVar13 - 1);
        local_90 = local_d8;
        local_8c = local_d4;
        local_88 = local_d0;
        local_84 = local_cc;
        local_80 = local_c8;
        local_7c = local_c4;
        local_60 = 7;
        local_68 = 0;
        local_78 = 0;
        local_98 = iVar2;
        FUN_1400015e0(&local_78,&local_c0,0,0xffffffffffffffff);
        FUN_1402d99f0(param_1 + 0x1258,local_98,&local_90);
        if (7 < local_60) {
          operator_delete((void *)CONCAT62(uStack_76,local_78));
        }
        puVar10 = (ulonglong *)FUN_140148a60(param_1 + 0x12a0);
        piVar15 = (int *)puVar10[1];
        if ((local_e8 < piVar15) && (piVar3 = (int *)*puVar10, piVar3 <= local_e8)) {
          if (piVar15 == (int *)puVar10[2]) {
            FUN_1400556a0(puVar10);
          }
          if ((undefined4 *)puVar10[1] != (undefined4 *)0x0) {
            *(undefined4 *)puVar10[1] =
                 *(undefined4 *)(*puVar10 + ((longlong)local_e8 - (longlong)piVar3 >> 2) * 4);
          }
        }
        else {
          if (piVar15 == (int *)puVar10[2]) {
            FUN_1400556a0(puVar10);
          }
          if ((int *)puVar10[1] != (int *)0x0) {
            *(int *)puVar10[1] = iVar2;
          }
        }
        puVar10[1] = puVar10[1] + 4;
        if (7 < local_a8) {
          operator_delete((void *)CONCAT62(uStack_be,local_c0));
        }
      }
      piVar15 = *(int **)(piVar7 + 6);
      if (*(int **)(piVar7 + 6) == (int *)0x0) {
        uVar4 = (uint)piVar7[8] % *(uint *)(lVar6 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar4 << 3;
        piVar15 = piVar16;
        do {
          if (*(uint *)(lVar6 + 0x78) <= uVar4) break;
          if (*(longlong *)(*(longlong *)(lVar6 + 0x68) + lVar11) != 0) {
            piVar15 = *(int **)(*(longlong *)(lVar6 + 0x68) + lVar11);
          }
          uVar4 = uVar4 + 1;
          lVar11 = lVar11 + 8;
        } while (piVar15 == (int *)0x0);
      }
      goto LAB_1402d87e0;
    }
  }
  return;
}



void FUN_1402d8ab0(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;
}



void FUN_1402d8af0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x38)) {
    operator_delete(*(void **)(param_1 + 0x20));
  }
  *(undefined8 *)(param_1 + 0x38) = 7;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined2 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_1402d8b30(ulonglong *param_1,undefined8 *param_2)

{
  ulonglong uVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  
  puVar4 = (undefined8 *)param_1[1];
  if ((param_2 < puVar4) && ((undefined8 *)*param_1 <= param_2)) {
    lVar2 = ((longlong)param_2 - (longlong)*param_1) / 0x28;
    if (puVar4 == (undefined8 *)param_1[2]) {
      FUN_1402d8c70(param_1);
    }
    puVar4 = (undefined8 *)param_1[1];
    uVar1 = *param_1;
    if (puVar4 == (undefined8 *)0x0) goto LAB_1402d8bf6;
    *puVar4 = *(undefined8 *)(uVar1 + lVar2 * 0x28);
    puVar4[1] = *(undefined8 *)(uVar1 + 8 + lVar2 * 0x28);
    puVar4[2] = *(undefined8 *)(uVar1 + 0x10 + lVar2 * 0x28);
    puVar4[3] = *(undefined8 *)(uVar1 + 0x18 + lVar2 * 0x28);
    uVar3 = *(undefined8 *)(uVar1 + 0x20 + lVar2 * 0x28);
  }
  else {
    if (puVar4 == (undefined8 *)param_1[2]) {
      FUN_1402d8c70(param_1);
    }
    puVar4 = (undefined8 *)param_1[1];
    if (puVar4 == (undefined8 *)0x0) goto LAB_1402d8bf6;
    *puVar4 = *param_2;
    puVar4[1] = param_2[1];
    puVar4[2] = param_2[2];
    puVar4[3] = param_2[3];
    uVar3 = param_2[4];
  }
  puVar4[4] = uVar3;
LAB_1402d8bf6:
  param_1[1] = param_1[1] + 0x28;
  return;
}



undefined8 *
FUN_1402d8c10(undefined8 *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  cVar1 = FUN_1402d8d30(param_1,param_2[1] - *param_2 >> 4,param_3,param_4,0xfffffffffffffffe);
  if (cVar1 != '\0') {
    uVar2 = FUN_1402db170(*param_2,param_2[1],*param_1);
    param_1[1] = uVar2;
  }
  return param_1;
}



void FUN_1402d8c70(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_1402d8e30(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402d8e30(param_1,uVar2);
  }
  return;
}



undefined8 FUN_1402d8d30(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 (0xfffffffffffffff < param_2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      uVar2 = (*pcVar1)();
      return uVar2;
    }
    lVar3 = FUN_1402d9030(param_2);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    param_1[2] = param_2 * 0x10 + lVar3;
    uVar2 = 1;
  }
  return uVar2;
}



void FUN_1402d8da0(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_1402d8f70(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402d8f70(param_1,uVar2);
  }
  return;
}



void FUN_1402d8e30(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 (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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_1402db1e0(*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 * 0x28);
    param_1[1] = (longlong)(pcVar4 + ((lVar2 - (longlong)pvVar1) / 0x28) * 0x28);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



void FUN_1402d8f70(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  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) {
    lVar4 = FUN_1402d9030(param_2);
    FUN_14033ef00(*param_1,param_1[1],lVar4,param_4,uVar5);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_1402ce6b0();
      operator_delete((void *)*param_1);
    }
    param_1[2] = param_2 * 0x10 + lVar4;
    param_1[1] = (lVar1 - lVar2 & 0xfffffffffffffff0U) + lVar4;
    *param_1 = lVar4;
  }
  return;
}



void * FUN_1402d9030(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x1000000000000000) && (pvVar1 = operator_new(param_1 << 4), 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_1405d3608);
}



ulonglong * FUN_1402d90a0(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_1402c6d50(param_1,uVar5,1,uVar5,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + ((ulonglong)uVar4 % uVar5) * 8);
        puVar3 != (ulonglong *)0x0; puVar3 = (ulonglong *)puVar3[5]) {
      if ((uint)puVar3[6] == 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;
          *(undefined4 *)((longlong)puVar3 + 0x14) = param_3[1];
          *(undefined4 *)(puVar3 + 3) = param_3[2];
          *(undefined4 *)((longlong)puVar3 + 0x1c) = param_3[3];
          *(undefined4 *)(puVar3 + 4) = param_3[4];
          *(undefined4 *)((longlong)puVar3 + 0x24) = param_3[5];
          return puVar3;
        }
      }
    }
  }
  puVar3 = (ulonglong *)FUN_1402da240(param_1,param_2,(ulonglong)uVar4 % uVar5,uVar4);
  *(undefined4 *)(puVar3 + 2) = *param_3;
  *(undefined4 *)((longlong)puVar3 + 0x14) = param_3[1];
  *(undefined4 *)(puVar3 + 3) = param_3[2];
  *(undefined4 *)((longlong)puVar3 + 0x1c) = param_3[3];
  *(undefined4 *)(puVar3 + 4) = param_3[4];
  *(undefined4 *)((longlong)puVar3 + 0x24) = param_3[5];
  return puVar3;
}



undefined8 FUN_1402d91c0(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[6] == 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[5] = puVar2[5];
            FUN_1402d9db0(param_1,puVar2);
            return 1;
          }
          *(ulonglong *)
           (lVar1 + ((ulonglong)(uint)puVar2[6] % (ulonglong)*(uint *)(param_1 + 2)) * 8) =
               puVar2[5];
          FUN_1402d9db0(param_1,puVar2);
          return 1;
        }
      }
      puVar3 = puVar2;
      puVar4 = (ulonglong *)puVar2[5];
    }
  }
  return 0;
}



void FUN_1402d9280(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar7 = 0;
  if ((*param_1 != 0) && (uVar8 = uVar7, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(uVar8 + *param_1);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x28);
        *(longlong *)(lVar3 + 0x28) = param_1[8];
        param_1[1] = param_1[1] + -1;
        param_1[8] = lVar3;
        if (((ulonglong)param_1[1] < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          uVar4 = FUN_1402cddb0(param_1);
          FUN_1402da810(param_1,uVar4);
        }
        lVar3 = lVar1;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar5 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar5;
              free(plVar5);
              plVar5 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      uVar8 = uVar8 + 8;
    } 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_1402cddb0(param_1,0);
    FUN_1402c6d50(param_1,uVar4,0);
  }
  param_1[8] = 0;
  plVar5 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar5;
      free(plVar5);
      plVar5 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



uint * FUN_1402d93c0(longlong *param_1,uint param_2)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,(ulonglong)*(uint *)(param_1 + 2),1);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x20)) {
      if ((puVar3[0x22] == param_2) && (*puVar3 == param_2)) goto LAB_1402d941a;
    }
  }
  puVar3 = (uint *)FUN_1402da3d0(param_1,param_2,uVar1,param_2);
LAB_1402d941a:
  return puVar3 + 1;
}



undefined4 * FUN_1402d9450(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_1402d8c10(param_1 + 2,param_3);
  return param_1;
}



uint * FUN_1402d9480(longlong *param_1,uint param_2,uint *param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 8)) {
      if ((puVar2[10] == param_2) && (*puVar2 == param_2)) {
        puVar2[1] = *param_3;
        puVar2[2] = param_3[1];
        puVar2[3] = param_3[2];
        puVar2[4] = param_3[3];
        puVar2[5] = param_3[4];
        puVar2[6] = param_3[5];
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402da540(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  puVar2[1] = *param_3;
  puVar2[2] = param_3[1];
  puVar2[3] = param_3[2];
  puVar2[4] = param_3[3];
  puVar2[5] = param_3[4];
  puVar2[6] = param_3[5];
  return puVar2;
}



uint * FUN_1402d9570(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 4)) {
      if ((puVar2[6] == param_2) && (*puVar2 == param_2)) {
        *(undefined8 *)(puVar2 + 1) = *param_3;
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402da6b0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  *(undefined8 *)(puVar2 + 1) = *param_3;
  return puVar2;
}



uint * FUN_1402d9620(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 10)) {
      if ((puVar2[0xc] == param_2) && (*puVar2 == param_2)) {
        FUN_1402d9bf0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402da9c0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_1402d9bf0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_1402d96e0(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 + 0x28);
        FUN_1402d9f30(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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;
}



uint * FUN_1402d97b0(longlong *param_1,uint param_2,uint *param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 8)) {
      if ((puVar2[10] == param_2) && (*puVar2 == param_2)) {
        puVar2[1] = *param_3;
        puVar2[2] = param_3[1];
        puVar2[3] = param_3[2];
        puVar2[4] = param_3[3];
        puVar2[5] = param_3[4];
        puVar2[6] = param_3[5];
        puVar2[7] = param_3[6];
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402dacd0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  puVar2[1] = *param_3;
  puVar2[2] = param_3[1];
  puVar2[3] = param_3[2];
  puVar2[4] = param_3[3];
  puVar2[5] = param_3[4];
  puVar2[6] = param_3[5];
  puVar2[7] = param_3[6];
  return puVar2;
}



void FUN_1402d98b0(longlong *param_1)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined4 uVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar8;
  ulonglong uVar7;
  
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  uVar7 = 0;
  if ((*param_1 != 0) && (uVar8 = uVar7, (int)param_1[2] != 0)) {
    do {
      lVar3 = *(longlong *)(uVar8 + *param_1);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x20);
        *(longlong *)(lVar3 + 0x20) = param_1[8];
        param_1[1] = param_1[1] + -1;
        param_1[8] = lVar3;
        if (((ulonglong)param_1[1] < (ulonglong)param_1[5]) && ((int)param_1[6] == 0)) {
          uVar4 = FUN_1402cddb0(param_1);
          FUN_1402dab20(param_1,uVar4);
        }
        lVar3 = lVar1;
        if (param_1[1] == 0) {
          param_1[8] = 0;
          plVar5 = (longlong *)param_1[7];
          if ((longlong *)param_1[7] != (longlong *)0x0) {
            do {
              plVar2 = (longlong *)*plVar5;
              free(plVar5);
              plVar5 = plVar2;
            } while (plVar2 != (longlong *)0x0);
            param_1[7] = 0;
          }
        }
      }
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      uVar8 = uVar8 + 8;
    } 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_1402cddb0(param_1,0);
    FUN_1402c6d50(param_1,uVar4,0);
  }
  param_1[8] = 0;
  plVar5 = (longlong *)param_1[7];
  if ((longlong *)param_1[7] != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*plVar5;
      free(plVar5);
      plVar5 = plVar2;
    } while (plVar2 != (longlong *)0x0);
    param_1[7] = 0;
  }
  *(int *)(param_1 + 6) = (int)param_1[6] + -1;
  return;
}



uint * FUN_1402d99f0(longlong *param_1,uint param_2,uint *param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,*(uint *)(param_1 + 2),1,param_4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x12)) {
      if ((puVar3[0x14] == param_2) && (*puVar3 == param_2)) {
        puVar3[2] = *param_3;
        puVar3[3] = param_3[1];
        puVar3[4] = param_3[2];
        puVar3[5] = param_3[3];
        puVar3[6] = param_3[4];
        puVar3[7] = param_3[5];
        FUN_1400015e0(puVar3 + 8,param_3 + 6,0,0xffffffffffffffff);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_1402db000(param_1,param_2,uVar1,param_2);
  puVar3[2] = *param_3;
  puVar3[3] = param_3[1];
  puVar3[4] = param_3[2];
  puVar3[5] = param_3[3];
  puVar3[6] = param_3[4];
  puVar3[7] = param_3[5];
  FUN_1400015e0(puVar3 + 8,param_3 + 6,0,0xffffffffffffffff);
  return puVar3;
}



void FUN_1402d9b20(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 + 0x48);
        FUN_1402da180(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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;
}



longlong * FUN_1402d9bf0(longlong *param_1,longlong *param_2)

{
  char cVar1;
  longlong lVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  longlong lVar5;
  ulonglong uVar6;
  longlong lVar7;
  
  if (param_1 == param_2) {
    return param_1;
  }
  lVar2 = *param_2;
  lVar5 = *param_1;
  uVar4 = param_2[1] - lVar2 >> 4;
  if (uVar4 == 0) {
    lVar2 = param_1[1];
    if (lVar5 != lVar2) {
      lVar2 = FUN_140333a10(lVar2,lVar2);
      FUN_1402ce6b0(lVar2,param_1[1]);
      param_1[1] = lVar2;
      return param_1;
    }
  }
  else {
    uVar6 = param_1[1] - lVar5 >> 4;
    if (uVar6 < uVar4) {
      if ((ulonglong)(param_1[2] - lVar5 >> 4) < uVar4) {
        if (lVar5 != 0) {
          FUN_1402ce6b0(lVar5);
          operator_delete((void *)*param_1);
        }
        cVar1 = FUN_1402d8d30(param_1,param_2[1] - *param_2 >> 4);
        if (cVar1 == '\0') {
          return param_1;
        }
        lVar2 = *param_1;
        lVar5 = param_2[1];
        lVar7 = *param_2;
      }
      else {
        lVar7 = uVar6 * 0x10 + lVar2;
        FUN_140333a10(lVar2,lVar7);
        lVar2 = param_1[1];
        lVar5 = param_2[1];
      }
      lVar2 = FUN_14033ef00(lVar7,lVar5,lVar2);
    }
    else {
      uVar3 = FUN_140333a10(lVar2,param_2[1]);
      FUN_1402ce6b0(uVar3,param_1[1]);
      lVar2 = (param_2[1] - *param_2 & 0xfffffffffffffff0U) + *param_1;
    }
    param_1[1] = lVar2;
  }
  return param_1;
}



void FUN_1402d9d30(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x30) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x28); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x28))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x28) = *(undefined8 *)(param_2 + 0x28);
      FUN_1402d9db0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x28);
  FUN_1402d9db0(param_1,param_2);
  return;
}



void FUN_1402d9db0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0x28) = *(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_1402cddb0();
      FUN_1402da810(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_14000d450(0x80004005);
}



undefined8 * FUN_1402d9e40(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;
}



void FUN_1402d9eb0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x30) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x28); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x28))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x28) = *(undefined8 *)(param_2 + 0x28);
      FUN_1402d9f30(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x28);
  FUN_1402d9f30(param_1,param_2);
  return;
}



void FUN_1402d9f30(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(longlong *)(param_2 + 8) != 0) {
    FUN_1402ce6b0(*(longlong *)(param_2 + 8),*(undefined8 *)(param_2 + 0x10));
    operator_delete(*(void **)(param_2 + 8));
  }
  *(undefined8 *)(param_2 + 8) = 0;
  *(undefined8 *)(param_2 + 0x10) = 0;
  *(undefined8 *)(param_2 + 0x18) = 0;
  *(undefined8 *)(param_2 + 0x28) = *(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_1402cddb0(param_1);
    FUN_1402da810(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_1402d9ff0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x28) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x20); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x20))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x20) = *(undefined8 *)(param_2 + 0x20);
      FUN_1402da070(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x20);
  FUN_1402da070(param_1,param_2);
  return;
}



void FUN_1402da070(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0x20) = *(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_1402cddb0();
      FUN_1402dab20(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_14000d450(0x80004005);
}



void FUN_1402da100(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x50) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x48); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x48))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x48) = *(undefined8 *)(param_2 + 0x48);
      FUN_1402da180(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x48);
  FUN_1402da180(param_1,param_2);
  return;
}



void FUN_1402da180(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (7 < *(ulonglong *)(param_2 + 0x38)) {
    operator_delete(*(void **)(param_2 + 0x20));
  }
  *(undefined8 *)(param_2 + 0x38) = 7;
  *(undefined8 *)(param_2 + 0x30) = 0;
  *(undefined2 *)(param_2 + 0x20) = 0;
  *(undefined8 *)(param_2 + 0x48) = *(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_1402cddb0(param_1);
    FUN_1402dae50(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;
}



undefined4 *
FUN_1402da240(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) < 0x38)
      goto LAB_1402da2f7;
      lVar7 = uVar6 * 0x38;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402da2f7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 7 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[5] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -7;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 10);
  *puVar2 = *param_2;
  puVar2[1] = param_2[1];
  puVar2[2] = param_2[2];
  puVar2[3] = param_2[3];
  puVar2[4] = 0;
  puVar2[5] = 0;
  puVar2[6] = 0;
  puVar2[7] = 0;
  *(undefined8 *)(puVar2 + 8) = 0;
  puVar2[0xc] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 10) = *(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_1402cddb0(param_1);
    FUN_1402da810(param_1,uVar4);
  }
  return puVar2;
}



undefined4 *
FUN_1402da3d0(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) < 0x90)
      goto LAB_1402da49d;
      lVar7 = uVar6 * 0x90;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402da49d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x12 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x10] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x12;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x20);
  *puVar2 = param_2;
  puVar2[0x22] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x20) = *(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_1402cddb0(param_1);
    FUN_1402db240(param_1,uVar4);
  }
  return puVar2;
}



undefined4 *
FUN_1402da540(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) < 0x30)
      goto LAB_1402da5f7;
      lVar7 = uVar6 * 0x30;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402da5f7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 6 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[4] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -6;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 8);
  *puVar2 = param_2;
  puVar2[1] = 0;
  puVar2[2] = 0;
  puVar2[3] = 0;
  puVar2[4] = 0;
  *(undefined8 *)(puVar2 + 5) = 0;
  puVar2[10] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 8) = *(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_1402cddb0(param_1);
    FUN_1402dab20(param_1,uVar4);
  }
  return puVar2;
}



undefined4 *
FUN_1402da6b0(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_1402da777;
      lVar7 = uVar6 << 5;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402da777:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 4);
  *puVar2 = param_2;
  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_1402cddb0(param_1);
    FUN_140253ff0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402da810(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x28);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x30) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x28) = *(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_1402da9c0(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) < 0x38)
      goto LAB_1402daa77;
      lVar7 = uVar6 * 0x38;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402daa77:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 7 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[5] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -7;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 10);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 2) = 0;
  *(undefined8 *)(puVar2 + 4) = 0;
  *(undefined8 *)(puVar2 + 6) = 0;
  puVar2[0xc] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 10) = *(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_1402cddb0(param_1);
    FUN_1402da810(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402dab20(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x20);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x28) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x20) = *(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_1402dacd0(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) < 0x30)
      goto LAB_1402dad87;
      lVar7 = uVar6 * 0x30;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402dad87:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 6 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[4] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -6;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 8);
  *puVar2 = param_2;
  puVar2[1] = 0;
  puVar2[2] = 0;
  puVar2[3] = 0;
  puVar2[4] = 0;
  *(undefined8 *)(puVar2 + 5) = 0;
  puVar2[7] = 0;
  puVar2[10] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 8) = *(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_1402cddb0(param_1);
    FUN_1402dab20(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402dae50(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x48);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x50) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x48) = *(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_1402db000(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) < 0x58)
      goto LAB_1402db0c7;
      lVar7 = uVar6 * 0x58;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402db0c7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0xb + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[9] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0xb;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x12);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 0xe) = 7;
  *(undefined8 *)(puVar2 + 0xc) = 0;
  *(undefined2 *)(puVar2 + 8) = 0;
  puVar2[0x14] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x12) = *(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_1402cddb0(param_1);
    FUN_1402dae50(param_1,uVar4);
  }
  return puVar2;
}



undefined8 * FUN_1402db170(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  longlong lVar1;
  
  for (; param_1 != param_2; param_1 = param_1 + 2) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      lVar1 = param_1[1];
      param_3[1] = lVar1;
      if (lVar1 != 0) {
        LOCK();
        *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
        UNLOCK();
      }
    }
    param_3 = param_3 + 2;
  }
  return param_3;
}



undefined8 * FUN_1402db1e0(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 5) {
    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 = param_3 + 5;
  }
  return param_3;
}



void FUN_1402db240(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x80);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x88) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x80) = *(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_1402db3f0(int param_1)

{
  undefined4 uVar1;
  
  if (param_1 == 1) {
    return 0;
  }
  if (param_1 == 2) {
    return 1;
  }
  if (param_1 == 3) {
    return 2;
  }
  if (param_1 == 4) {
    return 3;
  }
  if (param_1 == 0x65) {
    return 4;
  }
  if (param_1 == 0xc9) {
    return 5;
  }
  if (param_1 == 0x12d) {
    return 6;
  }
  if (param_1 == 0x191) {
    return 7;
  }
  if (param_1 == 0x66) {
    return 8;
  }
  if (param_1 == 0xca) {
    return 9;
  }
  if (param_1 == 0x12e) {
    return 10;
  }
  uVar1 = 0xffffffff;
  if (param_1 == 0x192) {
    uVar1 = 0xb;
  }
  return uVar1;
}



// WARNING: Removing unreachable block (ram,0x0001402db548)
// WARNING: Removing unreachable block (ram,0x0001402db551)
// WARNING: Removing unreachable block (ram,0x0001402db572)
// WARNING: Removing unreachable block (ram,0x0001402db57b)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402db480(void)

{
  undefined8 in_XMM3_Qa;
  
  FUN_1402e1920(0x3f400000,0x3e800000,0x40100000,in_XMM3_Qa,0xfffffffffffffffe);
  _DAT_14060a258 = 0;
  _DAT_14060a260 = 0;
  _DAT_14060a268 = 0x11;
  _DAT_14060a288 = 0;
  _DAT_14060a28c = 10;
  _DAT_14060a290 = 0;
  _DAT_14060a298 = 0;
  _DAT_14060a26c = 0x3f400000;
  _DAT_14060a270 = 0x3e800000;
  _DAT_14060a274 = 0x40100000;
  _DAT_14060a278 = 0x26;
  _DAT_14060a280 = 0;
  _DAT_14060a2a0 = 0;
  _DAT_14060a2a8 = 0;
  _DAT_14060a2b0 = 0x11;
  _DAT_14060a2d0 = 0;
  _DAT_14060a2d4 = 10;
  _DAT_14060a2d8 = 0;
  _DAT_14060a2e0 = 0;
  _DAT_14060a2b4 = 0x3f400000;
  _DAT_14060a2b8 = 0x3e800000;
  _DAT_14060a2bc = 0x40100000;
  _DAT_14060a2c8 = 0;
  _DAT_14060a2e8 = 0;
  _DAT_14060a2f0 = 0;
  _DAT_14060a2f8 = 0x11;
  _DAT_14060a318 = 0;
  _DAT_14060a31c = 10;
  _DAT_14060a320 = 0;
  _DAT_14060a328 = 0;
  _DAT_14060a2fc = 0x3f400000;
  _DAT_14060a300 = 0x3e800000;
  _DAT_14060a304 = 0x40100000;
  _DAT_14060a310 = 0;
  _DAT_14060a330 = 0;
  _DAT_14060a338 = 0;
  _DAT_14060a340 = 0x11;
  _DAT_14060a360 = 0;
  _DAT_14060a364 = 10;
  _DAT_14060a368 = 0;
  _DAT_14060a370 = 0;
  _DAT_14060a344 = 0x3f400000;
  _DAT_14060a348 = 0x3e800000;
  _DAT_14060a34c = 0x40100000;
  _DAT_14060a358 = 0;
  _DAT_14060a378 = 0;
  _DAT_14060a380 = 0;
  _DAT_14060a388 = 0x11;
  _DAT_14060a3a8 = 0;
  _DAT_14060a3ac = 10;
  _DAT_14060a3b0 = 0;
  _DAT_14060a3b8 = 0;
  _DAT_14060a38c = 0x3f400000;
  _DAT_14060a390 = 0x3e800000;
  _DAT_14060a394 = 0x40100000;
  _DAT_14060a3a0 = 0;
  _DAT_14060a3c0 = 0;
  _DAT_14060a3c8 = 0;
  _DAT_14060a3d0 = 0x11;
  _DAT_14060a3f0 = 0;
  _DAT_14060a3f4 = 10;
  _DAT_14060a3f8 = 0;
  _DAT_14060a400 = 0;
  _DAT_14060a3d4 = 0x3f400000;
  _DAT_14060a3d8 = 0x3e800000;
  _DAT_14060a3dc = 0x40100000;
  _DAT_14060a3e8 = 0;
  _DAT_14060a408 = 0;
  _DAT_14060a410 = 0;
  _DAT_14060a418 = 0x11;
  _DAT_14060a438 = 0;
  _DAT_14060a43c = 10;
  _DAT_14060a440 = 0;
  _DAT_14060a448 = 0;
  _DAT_14060a41c = 0x3f400000;
  _DAT_14060a420 = 0x3e800000;
  _DAT_14060a424 = 0x40100000;
  _DAT_14060a430 = 0;
  _DAT_14060a2c0 = _DAT_14060a278;
  _DAT_14060a308 = _DAT_14060a278;
  _DAT_14060a350 = _DAT_14060a278;
  _DAT_14060a398 = _DAT_14060a278;
  _DAT_14060a3e0 = _DAT_14060a278;
  _DAT_14060a428 = _DAT_14060a278;
  FUN_1402db960(&DAT_14060a210);
  return &DAT_14060a210;
}



void thunk_FUN_1402e1c20(void)

{
  FUN_1402e1c20();
  return;
}



void thunk_FUN_1402e1e20(void)

{
  FUN_1402e1e20();
  return;
}



void thunk_FUN_1402e1e40(void)

{
  FUN_1402e1e40();
  return;
}



void thunk_FUN_1402e2000(void)

{
  FUN_1402e2000();
  return;
}



void FUN_1402db860(longlong param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  FUN_1402e1ac0();
  FUN_1402e1d50(param_1 + 0x48);
  FUN_1402e1d50(param_1 + 0x90);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"QUEST");
  FUN_140294650(uVar1,L"QUEST");
  FUN_140292e80(uVar1,L"QUEST",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"QUEST_REQUEST");
  FUN_140294650(uVar1,L"QUEST_REQUEST");
  FUN_140292e80(uVar1,L"QUEST_REQUEST",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"QUEST_COMPLETE");
  FUN_140294650(uVar1,L"QUEST_COMPLETE");
  FUN_140292e80(uVar1,L"QUEST_COMPLETE",uVar2);
  FUN_1402db960(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001402dcc8e)

void FUN_1402db960(void **param_1)

{
  short sVar1;
  int iVar2;
  undefined *puVar3;
  void *pvVar4;
  code *pcVar5;
  uint uVar6;
  undefined4 uVar7;
  int iVar8;
  undefined4 uVar9;
  longlong lVar10;
  undefined4 *puVar11;
  short *psVar12;
  int *piVar13;
  undefined8 uVar14;
  undefined4 *puVar15;
  longlong lVar16;
  ulonglong uVar17;
  wchar_t *pwVar18;
  longlong *plVar19;
  longlong *plVar20;
  void **ppvVar21;
  void **ppvVar22;
  void **ppvVar23;
  void **ppvVar24;
  void **ppvVar25;
  short *psVar26;
  undefined4 uVar27;
  void **ppvVar28;
  undefined **ppuVar29;
  undefined1 auStack_658 [32];
  undefined1 local_638;
  void **local_628;
  void **local_620;
  undefined8 *local_618;
  longlong *local_610;
  undefined8 local_608;
  undefined8 local_600;
  undefined8 local_5f8;
  undefined8 local_5e8;
  undefined8 local_5e0;
  undefined8 local_5d8;
  void ***local_5c8;
  void ***local_5c0;
  void ***local_5b8;
  undefined8 *local_5a8;
  void *local_5a0;
  undefined8 local_598 [3];
  undefined1 local_580 [8];
  undefined1 local_578 [24];
  undefined1 local_560 [8];
  undefined1 local_558 [32];
  undefined8 local_538;
  void *local_530;
  void *local_528;
  longlong local_520;
  ulonglong local_518;
  undefined8 *local_508;
  longlong *local_500;
  longlong local_4f8;
  ulonglong local_4f0;
  void *local_4e0 [2];
  void *local_4d0;
  ulonglong local_4c8;
  undefined4 local_4b8;
  undefined4 local_4b4;
  undefined2 local_4b0 [8];
  undefined8 local_4a0;
  undefined8 local_498;
  undefined4 local_488;
  undefined4 local_484;
  undefined4 local_480;
  undefined4 local_47c;
  undefined4 local_478;
  int local_474;
  undefined4 local_470;
  undefined4 local_46c;
  undefined4 local_468;
  undefined4 local_464;
  undefined4 local_460;
  undefined4 local_45c;
  undefined4 local_458;
  undefined4 local_454;
  undefined4 local_450;
  undefined4 local_44c;
  undefined4 local_448;
  undefined4 local_444;
  undefined4 local_440;
  undefined4 local_43c;
  undefined4 local_438;
  undefined4 local_434;
  undefined4 local_430;
  undefined4 local_42c;
  undefined4 local_428;
  undefined4 local_424;
  undefined4 local_420 [5];
  undefined4 local_40c;
  undefined4 local_408;
  undefined4 local_404;
  void ***local_400;
  void ***local_3f8;
  void ***local_3f0;
  void ***local_3e0;
  void ***local_3d8;
  void ***local_3d0;
  void ***local_3c0;
  void ***local_3b8;
  void ***local_3b0;
  void **local_3a0;
  void **local_398;
  void **local_390;
  void **local_380;
  void **local_378;
  void **local_370;
  undefined4 local_360;
  undefined4 local_35c;
  undefined4 local_358;
  void ***local_350;
  void ***local_348;
  void ***local_340;
  void ***local_330;
  void ***local_328;
  void ***local_320;
  undefined4 local_310;
  undefined4 local_30c;
  undefined4 local_308;
  undefined4 local_304;
  undefined4 local_300;
  undefined1 local_2fc;
  undefined4 local_2f8;
  undefined4 local_2f4;
  undefined4 local_2f0;
  undefined2 local_2e8 [8];
  undefined8 local_2d8;
  undefined8 local_2d0;
  void ***local_2c0;
  void ***local_2b8;
  void ***local_2b0;
  void ***local_2a0;
  void ***local_298;
  void ***local_290;
  undefined4 local_278;
  undefined4 local_274;
  undefined4 local_270 [2];
  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 [280];
  ulonglong local_38;
  
  local_538 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_658;
  local_5a8 = param_1;
  lVar10 = FUN_1402933b0(DAT_140607ff0,L"QUEST");
  if (lVar10 != 0) {
    ppvVar28 = (void **)0x0;
    ppvVar22 = ppvVar28;
    if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
      ppvVar25 = ppvVar28;
      plVar19 = *(longlong **)(lVar10 + 0x68);
      do {
        if (*plVar19 != 0) {
          ppvVar22 = (void **)(*(longlong **)(lVar10 + 0x68))[(longlong)ppvVar25];
          break;
        }
        uVar6 = (int)ppvVar25 + 1;
        ppvVar25 = (void **)(ulonglong)uVar6;
        plVar19 = plVar19 + 1;
      } while (uVar6 < *(uint *)(lVar10 + 0x78));
    }
LAB_1402db9fa:
    local_618 = ppvVar22;
    if (ppvVar22 != (void **)0x0) {
      uVar27 = *(undefined4 *)ppvVar22;
      local_498 = 7;
      local_4a0 = 0;
      local_4b0[0] = 0;
      local_400 = (void ***)0x0;
      local_3f8 = (void ***)0x0;
      local_3f0 = (void ***)0x0;
      local_3e0 = (void ***)0x0;
      local_3d8 = (void ***)0x0;
      local_3d0 = (void ***)0x0;
      local_3c0 = (void ***)0x0;
      local_3b8 = (void ***)0x0;
      local_3b0 = (void ***)0x0;
      local_3a0 = (void **)0x0;
      local_398 = (void **)0x0;
      local_390 = (void **)0x0;
      local_380 = (void **)0x0;
      local_378 = (void **)0x0;
      local_370 = (void **)0x0;
      local_350 = (void ***)0x0;
      local_348 = (void ***)0x0;
      local_340 = (void ***)0x0;
      local_330 = (void ***)0x0;
      local_328 = (void ***)0x0;
      local_320 = (void ***)0x0;
      local_2d0 = 7;
      local_2d8 = 0;
      local_2e8[0] = 0;
      local_2c0 = (void ***)0x0;
      local_2b8 = (void ***)0x0;
      local_2b0 = (void ***)0x0;
      local_2a0 = (void ***)0x0;
      local_298 = (void ***)0x0;
      local_290 = (void ***)0x0;
      local_4b8 = uVar27;
      uVar7 = FUN_1402970c0(lVar10,L"nClass");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nClass");
      local_4b4 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"wszDesc");
      local_638 = 1;
      psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar7,L"wszDesc");
      uVar17 = 0xffffffffffffffff;
      psVar26 = psVar12;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar26;
        psVar26 = psVar26 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_4b0,psVar12,~uVar17 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"nIsStatusReset");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nIsStatusReset");
      if (puVar11 != (undefined4 *)0x0) {
        local_488 = *puVar11;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nItemDelete");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nItemDelete");
      if (puVar11 != (undefined4 *)0x0) {
        local_484 = *puVar11;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nCompleteDeleteAll00");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nCompleteDeleteAll00");
      if (puVar11 != (undefined4 *)0x0) {
        local_480 = *puVar11;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nCompleteDeleteAll01");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nCompleteDeleteAll01");
      if (puVar11 != (undefined4 *)0x0) {
        local_47c = *puVar11;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nCompleteDeleteAll02");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nCompleteDeleteAll02");
      if (puVar11 != (undefined4 *)0x0) {
        local_478 = *puVar11;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nType");
      local_638 = 1;
      piVar13 = (int *)FUN_140296600(lVar10,uVar27,uVar7,L"nType");
      local_474 = *piVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nNoReject");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nNoReject");
      local_470 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nAutoNextQuest");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nAutoNextQuest");
      local_46c = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nAutoComplete");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nAutoComplete");
      local_468 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nInstanceNpcID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nInstanceNpcID");
      local_464 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nExclusiveQuest");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nExclusiveQuest");
      local_460 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nJobLimit");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nJobLimit");
      local_45c = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nLevelLimit");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nLevelLimit");
      local_458 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nMaxLevelLimit");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nMaxLevelLimit");
      local_454 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nQuestItemID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nQuestItemID");
      local_450 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nQuestItemCount");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nQuestItemCount");
      local_44c = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nQuestItemGroup");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nQuestItemGroup");
      local_448 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nQuestItemGroupCount");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nQuestItemGroupCount");
      local_444 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nClassLimit");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nClassLimit");
      local_440 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nQuestStringID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nQuestStringID");
      local_43c = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nQuestGroupStringID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nQuestGroupStringID");
      local_438 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nQuestGroupRequestID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nQuestGroupRequestID");
      local_434 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nQuestGroupCompleteID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nQuestGroupCompleteID");
      local_430 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nUseLoop");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nUseLoop");
      local_42c = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nUseRandom");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nUseRandom");
      local_428 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nConditionType");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nConditionType");
      local_424 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nMissionWorldID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nMissionWorldID");
      local_40c = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nChangeJob");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nChangeJob");
      local_408 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nGold");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nGold");
      local_360 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nExp");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nExp");
      local_35c = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nMileage");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nMileage");
      local_358 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nAllLevelShow");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nAllLevelShow");
      local_310 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nShowLevel");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nShowLevel");
      local_30c = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nNpcInstanceID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nNpcInstanceID");
      local_2f8 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nWorldID");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nWorldID");
      local_308 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nActiveWorld");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nActiveWorld");
      local_304 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nContactActiveWorld");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nContactActiveWorld");
      local_300 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nNotSkip");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nNotSkip");
      local_2f4 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"nSteamAchievement");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nSteamAchievement");
      local_2f0 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"szSteamAchievementAPI");
      local_638 = 1;
      psVar12 = (short *)FUN_140296990(lVar10,uVar27,uVar7,L"szSteamAchievementAPI");
      uVar17 = 0xffffffffffffffff;
      psVar26 = psVar12;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar26;
        psVar26 = psVar26 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_2e8,psVar12,~uVar17 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"nEquipItemConditionType");
      local_638 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nEquipItemConditionType");
      local_404 = *puVar11;
      uVar7 = FUN_1402970c0(lVar10,L"wszEquipItemCondition");
      local_638 = 1;
      uVar14 = FUN_140296b70(lVar10,uVar27,uVar7,L"wszEquipItemCondition");
      uVar7 = FUN_1402970c0(lVar10,L"nClientComplete");
      local_638 = 0;
      piVar13 = (int *)FUN_140296600(lVar10,uVar27,uVar7,L"nClientComplete");
      if (piVar13 != (int *)0x0) {
        local_2fc = *piVar13 == 1;
      }
      local_508 = (void **)0x0;
      local_500 = (longlong *)0x0;
      local_4f8 = 0;
      FUN_140415930(&local_508,uVar14,&DAT_14049c7b8);
      lVar16 = (longlong)local_500 - (longlong)local_508 >> 0x3f;
      ppvVar22 = ppvVar28;
      ppvVar25 = ppvVar28;
      if (((longlong)local_500 - (longlong)local_508) / 0x28 + lVar16 != lVar16) {
        do {
          pwVar18 = (wchar_t *)((longlong)ppvVar22 + (longlong)local_508);
          if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
            pwVar18 = *(wchar_t **)pwVar18;
          }
          iVar8 = _wtoi(pwVar18);
          local_620 = (void **)CONCAT44(local_620._4_4_,iVar8);
          if ((&local_620 < local_3f8) && (local_400 <= &local_620)) {
            lVar16 = (longlong)&local_620 - (longlong)local_400;
            if (local_3f8 == local_3f0) {
              uVar17 = (longlong)local_3f8 - (longlong)local_400 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar24 = (void **)(uVar17 + 1);
              ppvVar21 = (void **)((longlong)local_3f0 - (longlong)local_400 >> 2);
              if (ppvVar21 < ppvVar24) {
                ppvVar23 = ppvVar28;
                if (ppvVar21 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar21 >> 1))) {
                  ppvVar23 = (void **)((longlong)ppvVar21 + ((ulonglong)ppvVar21 >> 1));
                }
                if (ppvVar23 < ppvVar24) {
                  ppvVar23 = ppvVar24;
                }
                FUN_140051e60(&local_400,ppvVar23);
              }
            }
            if (local_3f8 != (void ***)0x0) {
              *(int *)local_3f8 = *(int *)((longlong)local_400 + (lVar16 >> 2) * 4);
            }
          }
          else {
            if (local_3f8 == local_3f0) {
              uVar17 = (longlong)local_3f8 - (longlong)local_400 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar24 = (void **)(uVar17 + 1);
              ppvVar21 = (void **)((longlong)local_3f0 - (longlong)local_400 >> 2);
              if (ppvVar21 < ppvVar24) {
                ppvVar23 = ppvVar28;
                if (ppvVar21 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar21 >> 1))) {
                  ppvVar23 = (void **)((longlong)ppvVar21 + ((ulonglong)ppvVar21 >> 1));
                }
                if (ppvVar23 < ppvVar24) {
                  ppvVar23 = ppvVar24;
                }
                FUN_140051e60(&local_400,ppvVar23);
              }
            }
            if (local_3f8 != (void ***)0x0) {
              *(int *)local_3f8 = iVar8;
            }
          }
          local_3f8 = (void ***)((longlong)local_3f8 + 4);
          ppvVar25 = (void **)(ulonglong)((int)ppvVar25 + 1);
          ppvVar22 = ppvVar22 + 5;
        } while (ppvVar25 < (void **)(((longlong)local_500 - (longlong)local_508) / 0x28));
      }
      ppuVar29 = &PTR_u_nItemValue00_1405db4f0;
      do {
        puVar3 = *ppuVar29;
        uVar7 = FUN_1402970c0(lVar10,puVar3);
        local_638 = 1;
        piVar13 = (int *)FUN_140296600(lVar10,uVar27,uVar7,puVar3);
        iVar8 = *piVar13;
        local_620 = (void **)CONCAT44(local_620._4_4_,iVar8);
        if (iVar8 != 0) {
          if ((&local_620 < local_348) && (local_350 <= &local_620)) {
            lVar16 = (longlong)&local_620 - (longlong)local_350;
            if (local_348 == local_340) {
              uVar17 = (longlong)local_348 - (longlong)local_350 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar25 = (void **)(uVar17 + 1);
              ppvVar22 = (void **)((longlong)local_340 - (longlong)local_350 >> 2);
              if (ppvVar22 < ppvVar25) {
                ppvVar21 = ppvVar28;
                if (ppvVar22 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar22 >> 1))) {
                  ppvVar21 = (void **)((longlong)ppvVar22 + ((ulonglong)ppvVar22 >> 1));
                }
                if (ppvVar21 < ppvVar25) {
                  ppvVar21 = ppvVar25;
                }
                FUN_140051e60(&local_350,ppvVar21);
              }
            }
            if (local_348 != (void ***)0x0) {
              *(int *)local_348 = *(int *)((longlong)local_350 + (lVar16 >> 2) * 4);
            }
          }
          else {
            if (local_348 == local_340) {
              uVar17 = (longlong)local_348 - (longlong)local_350 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_1402ddbff;
              }
              ppvVar25 = (void **)(uVar17 + 1);
              ppvVar22 = (void **)((longlong)local_340 - (longlong)local_350 >> 2);
              if (ppvVar22 < ppvVar25) {
                ppvVar21 = ppvVar28;
                if (ppvVar22 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar22 >> 1))) {
                  ppvVar21 = (void **)((longlong)ppvVar22 + ((ulonglong)ppvVar22 >> 1));
                }
                if (ppvVar21 < ppvVar25) {
                  ppvVar21 = ppvVar25;
                }
                FUN_140051e60(&local_350,ppvVar21);
              }
            }
            if (local_348 != (void ***)0x0) {
              *(int *)local_348 = iVar8;
            }
          }
          local_348 = (void ***)((longlong)local_348 + 4);
        }
        ppuVar29 = ppuVar29 + 1;
      } while ((longlong)ppuVar29 < 0x1405db520);
      puVar11 = local_420;
      ppvVar22 = ppvVar28;
      do {
        pvVar4 = ppvVar22[0x280bb665];
        uVar7 = FUN_1402970c0(lVar10,pvVar4);
        local_638 = 1;
        puVar15 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,pvVar4);
        *puVar11 = *puVar15;
        pvVar4 = ppvVar22[0x280bb68f];
        uVar7 = FUN_1402970c0(lVar10,pvVar4);
        local_638 = 1;
        psVar12 = (short *)FUN_140296990(lVar10,uVar27,uVar7,pvVar4);
        local_518 = 7;
        local_520 = 0;
        local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
        uVar17 = 0xffffffffffffffff;
        psVar26 = psVar12;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar1 = *psVar26;
          psVar26 = psVar26 + 1;
        } while (sVar1 != 0);
        FUN_140001710(&local_530,psVar12,~uVar17 - 1);
        if (local_520 != 0) {
          if ((&local_530 < local_398) && (local_3a0 <= &local_530)) {
            lVar16 = (longlong)&local_530 - (longlong)local_3a0;
            if (local_398 == local_390) {
              uVar17 = ((longlong)local_398 - (longlong)local_3a0) / 0x28;
              if (0x666666666666665 < uVar17) {
LAB_1402ddbff:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar25 = (void **)(((longlong)local_390 - (longlong)local_3a0) / 0x28);
              if (ppvVar25 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar25 <= (void **)(0x666666666666666 - ((ulonglong)ppvVar25 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_14008eb00(&local_3a0,ppvVar24);
              }
            }
            local_628 = local_398;
            local_620 = local_398;
            if (local_398 != (void **)0x0) {
              local_398[3] = (void *)0x7;
              local_398[2] = (void *)0x0;
              ppvVar25 = local_398;
              if ((void *)0x7 < local_398[3]) {
                ppvVar25 = *local_398;
              }
              *(undefined2 *)ppvVar25 = 0;
              FUN_1400015e0(local_398,local_3a0 + (lVar16 / 0x28) * 5,0,0xffffffffffffffff);
            }
          }
          else {
            if (local_398 == local_390) {
              uVar17 = ((longlong)local_398 - (longlong)local_3a0) / 0x28;
              if (0x666666666666665 < uVar17) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_1402ddc1b;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar25 = (void **)(((longlong)local_390 - (longlong)local_3a0) / 0x28);
              if (ppvVar25 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar25 <= (void **)(0x666666666666666 - ((ulonglong)ppvVar25 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_14008eb00(&local_3a0,ppvVar24);
              }
            }
            local_628 = local_398;
            local_620 = local_398;
            if (local_398 != (void **)0x0) {
              local_398[3] = (void *)0x7;
              local_398[2] = (void *)0x0;
              ppvVar25 = local_398;
              if ((void *)0x7 < local_398[3]) {
                ppvVar25 = *local_398;
              }
              *(undefined2 *)ppvVar25 = 0;
              FUN_1400015e0(local_398,&local_530,0,0xffffffffffffffff);
            }
          }
          local_398 = local_398 + 5;
          FUN_140415220(local_4e0,&local_530);
          if ((local_4e0 < local_378) && (local_380 <= local_4e0)) {
            lVar16 = (longlong)local_4e0 - (longlong)local_380;
            if (local_378 == local_370) {
              uVar17 = ((longlong)local_378 - (longlong)local_380) / 0x28;
              if (0x666666666666665 < uVar17) {
LAB_1402ddc1b:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar25 = (void **)(((longlong)local_370 - (longlong)local_380) / 0x28);
              if (ppvVar25 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar25 <= (void **)(0x666666666666666 - ((ulonglong)ppvVar25 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_14012ed90(&local_380,ppvVar24);
              }
            }
            local_628 = local_378;
            local_620 = local_378;
            if (local_378 != (void **)0x0) {
              local_378[3] = (void *)0xf;
              local_378[2] = (void *)0x0;
              ppvVar25 = local_378;
              if ((void *)0xf < local_378[3]) {
                ppvVar25 = *local_378;
              }
              *(undefined1 *)ppvVar25 = 0;
              FUN_140003d90(local_378,local_380 + (lVar16 / 0x28) * 5,0,0xffffffffffffffff);
            }
          }
          else {
            if (local_378 == local_370) {
              uVar17 = ((longlong)local_378 - (longlong)local_380) / 0x28;
              if (uVar17 < 0x666666666666666) {
                ppvVar21 = (void **)(uVar17 + 1);
                ppvVar25 = (void **)(((longlong)local_370 - (longlong)local_380) / 0x28);
                if (ppvVar25 < ppvVar21) {
                  ppvVar24 = ppvVar28;
                  if (ppvVar25 <= (void **)(0x666666666666666 - ((ulonglong)ppvVar25 >> 1))) {
                    ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                  }
                  if (ppvVar24 < ppvVar21) {
                    ppvVar24 = ppvVar21;
                  }
                  FUN_14012ed90(&local_380,ppvVar24);
                }
                goto LAB_1402dcc4b;
              }
              std::_Xlength_error("vector<T> too long");
LAB_1402ddc37:
              std::_Xlength_error("string too long");
              goto LAB_1402ddc45;
            }
LAB_1402dcc4b:
            ppvVar25 = local_378;
            pvVar4 = local_4d0;
            local_628 = local_378;
            local_620 = local_378;
            if (local_378 != (void **)0x0) {
              local_378[3] = (void *)0xf;
              local_378[2] = (void *)0x0;
              ppvVar21 = local_378;
              if ((void *)0xf < local_378[3]) {
                ppvVar21 = *local_378;
              }
              *(undefined1 *)ppvVar21 = 0;
              if (local_378 == local_4e0) {
                FUN_140004090(local_378,local_4d0,0xffffffffffffffff);
                FUN_140004090(ppvVar25,0,0);
              }
              else {
                if (local_4d0 == (void *)0xffffffffffffffff) goto LAB_1402ddc37;
                if (local_378[3] < local_4d0) {
                  FUN_1400041a0(local_378,local_4d0,local_378[2]);
                }
                else if (local_4d0 == (void *)0x0) {
                  local_378[2] = (void *)0x0;
                  ppvVar21 = local_378;
                  if ((void *)0xf < local_378[3]) {
                    ppvVar21 = *local_378;
                  }
                  *(undefined1 *)ppvVar21 = 0;
                }
                if (pvVar4 != (void *)0x0) {
                  ppvVar21 = local_4e0;
                  if (0xf < local_4c8) {
                    ppvVar21 = (void **)CONCAT62(local_4e0[0]._2_6_,local_4e0[0]._0_2_);
                  }
                  ppvVar24 = ppvVar25;
                  if ((void *)0xf < ppvVar25[3]) {
                    ppvVar24 = *ppvVar25;
                  }
                  memcpy(ppvVar24,ppvVar21,(size_t)pvVar4);
                  ppvVar25[2] = pvVar4;
                  if ((void *)0xf < ppvVar25[3]) {
                    ppvVar25 = *ppvVar25;
                  }
                  *(undefined1 *)((longlong)pvVar4 + (longlong)ppvVar25) = 0;
                }
              }
            }
          }
          local_378 = local_378 + 5;
          if (0xf < local_4c8) {
            operator_delete((void *)CONCAT62(local_4e0[0]._2_6_,local_4e0[0]._0_2_));
          }
        }
        if (7 < local_518) {
          operator_delete(local_530);
        }
        puVar11 = puVar11 + 1;
        ppvVar22 = ppvVar22 + 1;
        ppvVar25 = ppvVar28;
      } while ((longlong)ppvVar22 < 0x28);
      do {
        pvVar4 = ppvVar25[0x280bb68c];
        uVar7 = FUN_1402970c0(lVar10,pvVar4);
        local_638 = 1;
        piVar13 = (int *)FUN_140296600(lVar10,uVar27,uVar7,pvVar4);
        iVar8 = *piVar13;
        local_620 = (void **)CONCAT44(local_620._4_4_,iVar8);
        pvVar4 = ppvVar25[0x280bb689];
        uVar7 = FUN_1402970c0(lVar10,pvVar4);
        local_638 = 1;
        piVar13 = (int *)FUN_140296600(lVar10,uVar27,uVar7,pvVar4);
        iVar2 = *piVar13;
        local_628 = (void **)CONCAT44(local_628._4_4_,iVar2);
        if ((iVar8 != 0) && (iVar2 != 0)) {
          if ((&local_620 < local_3d8) && (local_3e0 <= &local_620)) {
            lVar16 = (longlong)&local_620 - (longlong)local_3e0;
            if (local_3d8 == local_3d0) {
              uVar17 = (longlong)local_3d8 - (longlong)local_3e0 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
LAB_1402ddc45:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar22 = (void **)((longlong)local_3d0 - (longlong)local_3e0 >> 2);
              if (ppvVar22 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar22 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar22 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar22 + ((ulonglong)ppvVar22 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_140051e60(&local_3e0,ppvVar24);
              }
            }
            if (local_3d8 != (void ***)0x0) {
              *(int *)local_3d8 = *(int *)((longlong)local_3e0 + (lVar16 >> 2) * 4);
            }
          }
          else {
            if (local_3d8 == local_3d0) {
              uVar17 = (longlong)local_3d8 - (longlong)local_3e0 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar22 = (void **)((longlong)local_3d0 - (longlong)local_3e0 >> 2);
              if (ppvVar22 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar22 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar22 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar22 + ((ulonglong)ppvVar22 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_140051e60(&local_3e0,ppvVar24);
              }
            }
            if (local_3d8 != (void ***)0x0) {
              *(int *)local_3d8 = iVar8;
            }
          }
          local_3d8 = (void ***)((longlong)local_3d8 + 4);
          if ((&local_628 < local_3d8) && (local_3e0 <= &local_628)) {
            lVar16 = (longlong)&local_628 - (longlong)local_3e0;
            if (local_3d8 == local_3d0) {
              uVar17 = (longlong)local_3d8 - (longlong)local_3e0 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar22 = (void **)((longlong)local_3d0 - (longlong)local_3e0 >> 2);
              if (ppvVar22 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar22 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar22 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar22 + ((ulonglong)ppvVar22 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_140051e60(&local_3e0,ppvVar24);
              }
            }
            if (local_3d8 != (void ***)0x0) {
              *(int *)local_3d8 = *(int *)((longlong)local_3e0 + (lVar16 >> 2) * 4);
            }
          }
          else {
            if (local_3d8 == local_3d0) {
              uVar17 = (longlong)local_3d8 - (longlong)local_3e0 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar22 = (void **)((longlong)local_3d0 - (longlong)local_3e0 >> 2);
              if (ppvVar22 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar22 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar22 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar22 + ((ulonglong)ppvVar22 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_140051e60(&local_3e0,ppvVar24);
              }
            }
            if (local_3d8 != (void ***)0x0) {
              *(int *)local_3d8 = iVar2;
            }
          }
          local_3d8 = (void ***)((longlong)local_3d8 + 4);
        }
        ppvVar25 = ppvVar25 + 1;
        ppvVar22 = ppvVar28;
      } while ((longlong)ppvVar25 < 0x18);
      do {
        pvVar4 = ppvVar22[0x280bb694];
        uVar7 = FUN_1402970c0(lVar10,pvVar4);
        local_638 = 1;
        piVar13 = (int *)FUN_140296600(lVar10,uVar27,uVar7,pvVar4);
        iVar8 = *piVar13;
        local_628._0_4_ = iVar8;
        if (iVar8 != 0) {
          if ((&local_628 < local_3b8) && (local_3c0 <= &local_628)) {
            lVar16 = (longlong)&local_628 - (longlong)local_3c0;
            if (local_3b8 == local_3b0) {
              uVar17 = (longlong)local_3b8 - (longlong)local_3c0 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar25 = (void **)((longlong)local_3b0 - (longlong)local_3c0 >> 2);
              if (ppvVar25 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar25 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar25 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_140051e60(&local_3c0,ppvVar24);
              }
            }
            if (local_3b8 != (void ***)0x0) {
              *(int *)local_3b8 = *(int *)((longlong)local_3c0 + (lVar16 >> 2) * 4);
            }
          }
          else {
            if (local_3b8 == local_3b0) {
              uVar17 = (longlong)local_3b8 - (longlong)local_3c0 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar25 = (void **)((longlong)local_3b0 - (longlong)local_3c0 >> 2);
              if (ppvVar25 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar25 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar25 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_140051e60(&local_3c0,ppvVar24);
              }
            }
            if (local_3b8 != (void ***)0x0) {
              *(int *)local_3b8 = iVar8;
            }
          }
          local_3b8 = (void ***)((longlong)local_3b8 + 4);
        }
        pvVar4 = ppvVar22[0x280bb6a4];
        uVar7 = FUN_1402970c0(lVar10,pvVar4);
        local_638 = 1;
        piVar13 = (int *)FUN_140296600(lVar10,uVar27,uVar7,pvVar4);
        iVar8 = *piVar13;
        local_628 = (void **)CONCAT44(local_628._4_4_,iVar8);
        if (iVar8 != 0) {
          if ((&local_628 < local_328) && (local_330 <= &local_628)) {
            lVar16 = (longlong)&local_628 - (longlong)local_330;
            if (local_328 == local_320) {
              uVar17 = (longlong)local_328 - (longlong)local_330 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar25 = (void **)((longlong)local_320 - (longlong)local_330 >> 2);
              if (ppvVar25 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar25 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar25 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_140051e60(&local_330,ppvVar24);
              }
            }
            if (local_328 != (void ***)0x0) {
              *(int *)local_328 = *(int *)((longlong)local_330 + (lVar16 >> 2) * 4);
            }
          }
          else {
            if (local_328 == local_320) {
              uVar17 = (longlong)local_328 - (longlong)local_330 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_1402ddcb5;
              }
              ppvVar21 = (void **)(uVar17 + 1);
              ppvVar25 = (void **)((longlong)local_320 - (longlong)local_330 >> 2);
              if (ppvVar25 < ppvVar21) {
                ppvVar24 = ppvVar28;
                if (ppvVar25 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar25 >> 1))) {
                  ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                }
                if (ppvVar24 < ppvVar21) {
                  ppvVar24 = ppvVar21;
                }
                FUN_140051e60(&local_330,ppvVar24);
              }
            }
            if (local_328 != (void ***)0x0) {
              *(int *)local_328 = iVar8;
            }
          }
          local_328 = (void ***)((longlong)local_328 + 4);
        }
        ppvVar22 = ppvVar22 + 1;
      } while ((longlong)ppvVar22 < 0x50);
      uVar7 = FUN_1402970c0(lVar10,L"wszClassLimit");
      local_638 = 0;
      lVar16 = FUN_140296b70(lVar10,uVar27,uVar7,L"wszClassLimit");
      if (lVar16 != 0) {
        local_530 = (void *)0x0;
        local_528 = (void *)0x0;
        local_520 = 0;
        FUN_140415930(&local_530,lVar16,&DAT_14049c7b8);
        FUN_140051e60(&local_2c0,((longlong)local_528 - (longlong)local_530) / 0x28);
        lVar16 = (longlong)local_528 - (longlong)local_530 >> 0x3f;
        ppvVar22 = ppvVar28;
        ppvVar25 = ppvVar28;
        if (((longlong)local_528 - (longlong)local_530) / 0x28 + lVar16 != lVar16) {
          do {
            pwVar18 = (wchar_t *)((longlong)ppvVar22 + (longlong)local_530);
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              pwVar18 = *(wchar_t **)pwVar18;
            }
            iVar8 = _wtoi(pwVar18);
            local_628 = (void **)CONCAT44(local_628._4_4_,iVar8);
            if (0 < iVar8) {
              if ((&local_628 < local_2b8) && (local_2c0 <= &local_628)) {
                lVar16 = (longlong)&local_628 - (longlong)local_2c0;
                if (local_2b8 == local_2b0) {
                  uVar17 = (longlong)local_2b8 - (longlong)local_2c0 >> 2;
                  if (0x3ffffffffffffffe < uVar17) {
LAB_1402ddcb5:
                    std::_Xlength_error("vector<T> too long");
                    pcVar5 = (code *)swi(3);
                    (*pcVar5)();
                    return;
                  }
                  ppvVar24 = (void **)(uVar17 + 1);
                  ppvVar21 = (void **)((longlong)local_2b0 - (longlong)local_2c0 >> 2);
                  if (ppvVar21 < ppvVar24) {
                    ppvVar23 = ppvVar28;
                    if (ppvVar21 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar21 >> 1))) {
                      ppvVar23 = (void **)((longlong)ppvVar21 + ((ulonglong)ppvVar21 >> 1));
                    }
                    if (ppvVar23 < ppvVar24) {
                      ppvVar23 = ppvVar24;
                    }
                    FUN_140051e60(&local_2c0,ppvVar23);
                  }
                }
                if (local_2b8 != (void ***)0x0) {
                  *(int *)local_2b8 = *(int *)((longlong)local_2c0 + (lVar16 >> 2) * 4);
                }
              }
              else {
                if (local_2b8 == local_2b0) {
                  uVar17 = (longlong)local_2b8 - (longlong)local_2c0 >> 2;
                  if (0x3ffffffffffffffe < uVar17) {
                    std::_Xlength_error("vector<T> too long");
                    goto LAB_1402ddcd1;
                  }
                  ppvVar24 = (void **)(uVar17 + 1);
                  ppvVar21 = (void **)((longlong)local_2b0 - (longlong)local_2c0 >> 2);
                  if (ppvVar21 < ppvVar24) {
                    ppvVar23 = ppvVar28;
                    if (ppvVar21 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar21 >> 1))) {
                      ppvVar23 = (void **)((longlong)ppvVar21 + ((ulonglong)ppvVar21 >> 1));
                    }
                    if (ppvVar23 < ppvVar24) {
                      ppvVar23 = ppvVar24;
                    }
                    FUN_140051e60(&local_2c0,ppvVar23);
                  }
                }
                if (local_2b8 != (void ***)0x0) {
                  *(int *)local_2b8 = iVar8;
                }
              }
              local_2b8 = (void ***)((longlong)local_2b8 + 4);
            }
            ppvVar25 = (void **)(ulonglong)((int)ppvVar25 + 1);
            ppvVar22 = ppvVar22 + 5;
          } while (ppvVar25 < (void **)(((longlong)local_528 - (longlong)local_530) / 0x28));
        }
        if (local_530 != (void *)0x0) {
          std::_Container_base0::_Orphan_all((_Container_base0 *)&local_530);
          FUN_14008d0a0(local_530,local_528);
          operator_delete(local_530);
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"wszClassGroupLimit");
      local_638 = 0;
      lVar16 = FUN_140296b70(lVar10,uVar27,uVar7,L"wszClassGroupLimit");
      if (lVar16 != 0) {
        local_530 = (void *)0x0;
        local_528 = (void *)0x0;
        local_520 = 0;
        FUN_140415930(&local_530,lVar16,&DAT_14049c7b8);
        if (local_530 != local_528) {
          FUN_140051e60(&local_2a0,((longlong)local_528 - (longlong)local_530) / 0x28);
        }
        lVar16 = (longlong)local_528 - (longlong)local_530 >> 0x3f;
        ppvVar22 = ppvVar28;
        param_1 = ppvVar28;
        if (((longlong)local_528 - (longlong)local_530) / 0x28 + lVar16 != lVar16) {
          do {
            pwVar18 = (wchar_t *)((longlong)ppvVar22 + (longlong)local_530);
            if (7 < *(ulonglong *)(pwVar18 + 0xc)) {
              pwVar18 = *(wchar_t **)pwVar18;
            }
            iVar8 = _wtoi(pwVar18);
            local_628 = (void **)CONCAT44(local_628._4_4_,iVar8);
            if (0 < iVar8) {
              if ((&local_628 < local_298) && (local_2a0 <= &local_628)) {
                lVar16 = (longlong)&local_628 - (longlong)local_2a0;
                if (local_298 == local_290) {
                  uVar17 = (longlong)local_298 - (longlong)local_2a0 >> 2;
                  if (0x3ffffffffffffffe < uVar17) {
LAB_1402ddcd1:
                    std::_Xlength_error("vector<T> too long");
                    pcVar5 = (code *)swi(3);
                    (*pcVar5)();
                    return;
                  }
                  ppvVar21 = (void **)(uVar17 + 1);
                  ppvVar25 = (void **)((longlong)local_290 - (longlong)local_2a0 >> 2);
                  if (ppvVar25 < ppvVar21) {
                    ppvVar24 = ppvVar28;
                    if (ppvVar25 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar25 >> 1))) {
                      ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                    }
                    if (ppvVar24 < ppvVar21) {
                      ppvVar24 = ppvVar21;
                    }
                    FUN_140051e60(&local_2a0,ppvVar24);
                  }
                }
                if (local_298 != (void ***)0x0) {
                  *(int *)local_298 = *(int *)((longlong)local_2a0 + (lVar16 >> 2) * 4);
                }
              }
              else {
                if (local_298 == local_290) {
                  uVar17 = (longlong)local_298 - (longlong)local_2a0 >> 2;
                  if (0x3ffffffffffffffe < uVar17) {
                    std::_Xlength_error("vector<T> too long");
                    goto LAB_1402ddced;
                  }
                  ppvVar21 = (void **)(uVar17 + 1);
                  ppvVar25 = (void **)((longlong)local_290 - (longlong)local_2a0 >> 2);
                  if (ppvVar25 < ppvVar21) {
                    ppvVar24 = ppvVar28;
                    if (ppvVar25 <= (void **)(0x3fffffffffffffff - ((ulonglong)ppvVar25 >> 1))) {
                      ppvVar24 = (void **)((longlong)ppvVar25 + ((ulonglong)ppvVar25 >> 1));
                    }
                    if (ppvVar24 < ppvVar21) {
                      ppvVar24 = ppvVar21;
                    }
                    FUN_140051e60(&local_2a0,ppvVar24);
                  }
                }
                if (local_298 != (void ***)0x0) {
                  *(int *)local_298 = iVar8;
                }
              }
              local_298 = (void ***)((longlong)local_298 + 4);
            }
            param_1 = (void **)(ulonglong)((int)param_1 + 1);
            ppvVar22 = ppvVar22 + 5;
          } while (param_1 < (void **)(((longlong)local_528 - (longlong)local_530) / 0x28));
        }
        if (local_530 != (void *)0x0) {
          std::_Container_base0::_Orphan_all((_Container_base0 *)&local_530);
          FUN_14008d0a0(local_530,local_528);
          operator_delete(local_530);
        }
      }
      local_278 = uVar27;
      FUN_1402e3600(local_270,&local_4b8);
      param_1 = (void **)local_5a8;
      FUN_1402e19f0(local_5a8,local_278,local_270);
      FUN_1402defd0(local_270);
      if ((local_474 == 4) || (local_474 == 10)) {
        if (1 < (ulonglong)((longlong)local_3b8 - (longlong)local_3c0 >> 2)) {
          uVar27 = *(undefined4 *)((longlong)local_3c0 + 4);
          uVar7 = *(undefined4 *)local_3c0;
LAB_1402dda52:
          FUN_1402df6d0(param_1,uVar7,uVar27);
        }
LAB_1402dda67:
        if ((local_474 == 0x2c) || (local_474 == 0x2f)) {
          if (1 < (ulonglong)((longlong)local_3b8 - (longlong)local_3c0 >> 2)) {
            uVar27 = *(undefined4 *)((longlong)local_3c0 + 4);
            uVar7 = *(undefined4 *)local_3c0;
            goto LAB_1402ddb29;
          }
        }
        else if ((local_474 == 0x2d) || (local_474 == 0x30)) {
          if (3 < (ulonglong)((longlong)local_3b8 - (longlong)local_3c0 >> 2)) {
            FUN_1402df7b0(param_1,*(undefined4 *)local_3c0,*(undefined4 *)((longlong)local_3c0 + 4))
            ;
            uVar27 = *(undefined4 *)((longlong)local_3c0 + 0xc);
            uVar7 = *(undefined4 *)(local_3c0 + 1);
            goto LAB_1402ddb29;
          }
        }
        else if (((local_474 == 0x2e) || (local_474 == 0x31)) &&
                (5 < (ulonglong)((longlong)local_3b8 - (longlong)local_3c0 >> 2))) {
          FUN_1402df7b0(param_1,*(undefined4 *)local_3c0,*(undefined4 *)((longlong)local_3c0 + 4));
          FUN_1402df7b0(param_1,*(undefined4 *)(local_3c0 + 1),
                        *(undefined4 *)((longlong)local_3c0 + 0xc));
          uVar27 = *(undefined4 *)((longlong)local_3c0 + 0x14);
          uVar7 = *(undefined4 *)(local_3c0 + 2);
LAB_1402ddb29:
          FUN_1402df7b0(param_1,uVar7,uVar27);
        }
      }
      else {
        if ((local_474 == 5) || (local_474 == 0xb)) {
          if (3 < (ulonglong)((longlong)local_3b8 - (longlong)local_3c0 >> 2)) {
            FUN_1402df6d0(param_1,*(undefined4 *)local_3c0,*(undefined4 *)((longlong)local_3c0 + 4))
            ;
            uVar27 = *(undefined4 *)((longlong)local_3c0 + 0xc);
            uVar7 = *(undefined4 *)(local_3c0 + 1);
            goto LAB_1402dda52;
          }
          goto LAB_1402dda67;
        }
        if ((local_474 == 6) || (local_474 == 0xc)) {
          if (5 < (ulonglong)((longlong)local_3b8 - (longlong)local_3c0 >> 2)) {
            FUN_1402df6d0(param_1,*(undefined4 *)local_3c0,*(undefined4 *)((longlong)local_3c0 + 4))
            ;
            FUN_1402df6d0(param_1,*(undefined4 *)(local_3c0 + 1),
                          *(undefined4 *)((longlong)local_3c0 + 0xc));
            uVar27 = *(undefined4 *)((longlong)local_3c0 + 0x14);
            uVar7 = *(undefined4 *)(local_3c0 + 2);
            goto LAB_1402dda52;
          }
          goto LAB_1402dda67;
        }
        if (local_474 != 9) goto LAB_1402dda67;
        if (1 < (ulonglong)((longlong)local_3b8 - (longlong)local_3c0 >> 2)) {
          uVar27 = *(undefined4 *)((longlong)local_3c0 + 4);
          uVar7 = *(undefined4 *)local_3c0;
          goto LAB_1402dda52;
        }
      }
      if ((void **)local_508 != (void **)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_508);
        FUN_14008d0a0(local_508);
        operator_delete(local_508);
      }
      local_508 = (void **)0x0;
      local_500 = (longlong *)0x0;
      local_4f8 = 0;
      FUN_1402defd0(&local_4b8);
      ppvVar22 = (void **)local_618[3];
      if (ppvVar22 == (void **)0x0) {
        uVar6 = *(uint *)(local_618 + 4) % *(uint *)(lVar10 + 0x78) + 1;
        lVar16 = (longlong)(int)uVar6 << 3;
        ppvVar22 = ppvVar28;
        do {
          if (*(uint *)(lVar10 + 0x78) <= uVar6) break;
          if (*(longlong *)(lVar16 + *(longlong *)(lVar10 + 0x68)) != 0) {
            ppvVar22 = *(void ***)(lVar16 + *(longlong *)(lVar10 + 0x68));
          }
          uVar6 = uVar6 + 1;
          lVar16 = lVar16 + 8;
        } while (ppvVar22 == (void **)0x0);
      }
      goto LAB_1402db9fa;
    }
LAB_1402ddced:
    lVar10 = FUN_1402933b0(DAT_140607ff0,L"QUEST_REQUEST");
    if (lVar10 != 0) {
      ppvVar22 = ppvVar28;
      if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
        ppvVar25 = ppvVar28;
        plVar19 = *(longlong **)(lVar10 + 0x68);
        do {
          if (*plVar19 != 0) {
            ppvVar22 = (void **)(*(longlong **)(lVar10 + 0x68))[(longlong)ppvVar25];
            break;
          }
          uVar6 = (int)ppvVar25 + 1;
          ppvVar25 = (void **)(ulonglong)uVar6;
          plVar19 = plVar19 + 1;
        } while (uVar6 < *(uint *)(lVar10 + 0x78));
      }
LAB_1402ddd40:
      ppvVar25 = ppvVar22;
      if (ppvVar25 != (void **)0x0) {
        uVar27 = *(undefined4 *)ppvVar25;
        local_608 = 0;
        local_600 = 0;
        local_5f8 = 0;
        local_5e8 = 0;
        local_5e0 = 0;
        local_5d8 = 0;
        local_5c8 = (void ***)0x0;
        local_5c0 = (void ***)0x0;
        local_5b8 = (void ***)0x0;
        ppvVar22 = ppvVar28;
        do {
          pvVar4 = ppvVar22[0x280bb6ae];
          uVar7 = FUN_1402970c0(lVar10,pvVar4);
          local_638 = 1;
          psVar12 = (short *)FUN_140296990(lVar10,uVar27,uVar7,pvVar4);
          local_4f0 = 7;
          local_4f8 = 0;
          local_508 = (undefined8 *)((ulonglong)local_508 & 0xffffffffffff0000);
          uVar17 = 0xffffffffffffffff;
          psVar26 = psVar12;
          do {
            if (uVar17 == 0) break;
            uVar17 = uVar17 - 1;
            sVar1 = *psVar26;
            psVar26 = psVar26 + 1;
          } while (sVar1 != 0);
          FUN_140001710(&local_508,psVar12,~uVar17 - 1);
          pvVar4 = ppvVar22[0x280bb6c2];
          uVar7 = FUN_1402970c0(lVar10,pvVar4);
          local_638 = 1;
          psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar7,pvVar4);
          local_518 = 7;
          local_520 = 0;
          local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
          uVar17 = 0xffffffffffffffff;
          psVar26 = psVar12;
          do {
            if (uVar17 == 0) break;
            uVar17 = uVar17 - 1;
            sVar1 = *psVar26;
            psVar26 = psVar26 + 1;
          } while (sVar1 != 0);
          FUN_140001710(&local_530,psVar12,~uVar17 - 1);
          pvVar4 = ppvVar22[0x280bb6d6];
          uVar7 = FUN_1402970c0(lVar10,pvVar4);
          local_638 = 1;
          puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,pvVar4);
          uVar7 = *puVar11;
          local_628 = (void **)CONCAT44(local_628._4_4_,uVar7);
          if (local_4f8 == 0) {
            if (7 < local_518) {
              operator_delete(local_530);
            }
LAB_1402ddfad:
            local_518 = 7;
            local_520 = 0;
            local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
            if (7 < local_4f0) {
              operator_delete(local_508);
            }
            break;
          }
          if (local_520 == 0) {
            if (7 < local_518) {
              operator_delete(local_530);
            }
            goto LAB_1402ddfad;
          }
          FUN_14008ec00(&local_608,&local_508);
          FUN_14008ec00(&local_5e8,&local_530);
          if ((&local_628 < local_5c0) && (local_5c8 <= &local_628)) {
            lVar16 = (longlong)&local_628 - (longlong)local_5c8;
            if (local_5c0 == local_5b8) {
              FUN_1400556a0(&local_5c8,1);
            }
            if (local_5c0 != (void ***)0x0) {
              *(undefined4 *)local_5c0 = *(undefined4 *)((longlong)local_5c8 + (lVar16 >> 2) * 4);
            }
          }
          else {
            if (local_5c0 == local_5b8) {
              FUN_1400556a0(&local_5c8,1);
            }
            if (local_5c0 != (void ***)0x0) {
              *(undefined4 *)local_5c0 = uVar7;
            }
          }
          local_5c0 = (void ***)((longlong)local_5c0 + 4);
          if (7 < local_518) {
            operator_delete(local_530);
          }
          local_518 = 7;
          local_520 = 0;
          local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
          if (7 < local_4f0) {
            operator_delete(local_508);
          }
          ppvVar22 = ppvVar22 + 1;
        } while ((longlong)ppvVar22 < 0xa0);
        local_618 = local_598;
        local_5a0._0_4_ = uVar27;
        FUN_14015a040(local_598,&local_608);
        FUN_14015a040(local_578,&local_5e8);
        FUN_14012e520(local_558,&local_5c8);
        FUN_1402e1c40(param_1 + 9,local_5a0._0_4_,local_598);
        FUN_1402df1d0(local_598);
        FUN_1402df1d0(&local_608);
        ppvVar22 = ppvVar25[3];
        if (ppvVar25[3] == (void **)0x0) {
          uVar6 = *(uint *)(ppvVar25 + 4) % *(uint *)(lVar10 + 0x78) + 1;
          lVar16 = (longlong)(int)uVar6 << 3;
          ppvVar22 = ppvVar28;
          do {
            if (*(uint *)(lVar10 + 0x78) <= uVar6) break;
            if (*(longlong *)(lVar16 + *(longlong *)(lVar10 + 0x68)) != 0) {
              ppvVar22 = *(void ***)(lVar16 + *(longlong *)(lVar10 + 0x68));
            }
            uVar6 = uVar6 + 1;
            lVar16 = lVar16 + 8;
          } while (ppvVar22 == (void **)0x0);
        }
        goto LAB_1402ddd40;
      }
      lVar10 = FUN_1402933b0(DAT_140607ff0,L"QUEST_COMPLETE");
      if (lVar10 != 0) {
        ppvVar22 = ppvVar28;
        if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
          ppvVar25 = ppvVar28;
          plVar19 = *(longlong **)(lVar10 + 0x68);
          do {
            if (*plVar19 != 0) {
              ppvVar22 = (void **)(*(longlong **)(lVar10 + 0x68))[(longlong)ppvVar25];
              break;
            }
            uVar6 = (int)ppvVar25 + 1;
            ppvVar25 = (void **)(ulonglong)uVar6;
            plVar19 = plVar19 + 1;
          } while (uVar6 < *(uint *)(lVar10 + 0x78));
        }
        for (; ppvVar22 != (void **)0x0; ppvVar22 = (void **)FUN_14014fea0(lVar10 + 0x68,ppvVar22))
        {
          uVar27 = *(undefined4 *)ppvVar22;
          local_608 = 0;
          local_600 = 0;
          local_5f8 = 0;
          local_5e8 = 0;
          local_5e0 = 0;
          local_5d8 = 0;
          local_5c8 = (void ***)0x0;
          local_5c0 = (void ***)0x0;
          local_5b8 = (void ***)0x0;
          ppvVar25 = ppvVar28;
          do {
            pvVar4 = ppvVar25[0x280bb6ae];
            uVar7 = FUN_1402970c0(lVar10,pvVar4);
            local_638 = 1;
            psVar12 = (short *)FUN_140296990(lVar10,uVar27,uVar7,pvVar4);
            local_4f0 = 7;
            local_4f8 = 0;
            local_508 = (undefined8 *)((ulonglong)local_508 & 0xffffffffffff0000);
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(&local_508,psVar12,~uVar17 - 1);
            pvVar4 = ppvVar25[0x280bb6c2];
            uVar7 = FUN_1402970c0(lVar10,pvVar4);
            local_638 = 1;
            psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar7,pvVar4);
            local_518 = 7;
            local_520 = 0;
            local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(&local_530,psVar12,~uVar17 - 1);
            pvVar4 = ppvVar25[0x280bb6d6];
            uVar7 = FUN_1402970c0(lVar10,pvVar4);
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,pvVar4);
            uVar7 = *puVar11;
            local_628 = (void **)CONCAT44(local_628._4_4_,uVar7);
            if (local_4f8 == 0) {
              if (7 < local_518) {
                operator_delete(local_530);
              }
LAB_1402de32d:
              local_518 = 7;
              local_520 = 0;
              local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
              if (7 < local_4f0) {
                operator_delete(local_508);
              }
              break;
            }
            if (local_520 == 0) {
              if (7 < local_518) {
                operator_delete(local_530);
              }
              goto LAB_1402de32d;
            }
            FUN_14008ec00(&local_608,&local_508);
            FUN_14008ec00(&local_5e8,&local_530);
            if ((&local_628 < local_5c0) && (local_5c8 <= &local_628)) {
              lVar16 = (longlong)&local_628 - (longlong)local_5c8;
              if (local_5c0 == local_5b8) {
                FUN_1400556a0(&local_5c8,1);
              }
              if (local_5c0 != (void ***)0x0) {
                *(undefined4 *)local_5c0 = *(undefined4 *)((longlong)local_5c8 + (lVar16 >> 2) * 4);
              }
            }
            else {
              if (local_5c0 == local_5b8) {
                FUN_1400556a0(&local_5c8,1);
              }
              if (local_5c0 != (void ***)0x0) {
                *(undefined4 *)local_5c0 = uVar7;
              }
            }
            local_5c0 = (void ***)((longlong)local_5c0 + 4);
            if (7 < local_518) {
              operator_delete(local_530);
            }
            local_518 = 7;
            local_520 = 0;
            local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
            if (7 < local_4f0) {
              operator_delete(local_508);
            }
            ppvVar25 = ppvVar25 + 1;
          } while ((longlong)ppvVar25 < 0xa0);
          local_618 = local_598;
          local_5a0._0_4_ = uVar27;
          FUN_14015a040(local_598,&local_608);
          FUN_14015a040(local_578,&local_5e8);
          FUN_14012e520(local_558,&local_5c8);
          FUN_1402e1c40(local_5a8 + 0x12,local_5a0._0_4_,local_598);
          FUN_1402df1d0(local_598);
          FUN_1402df1d0(&local_608);
        }
        lVar10 = FUN_1402933b0(DAT_140607ff0,L"QUEST_GROUP_STRING");
        if (lVar10 != 0) {
          plVar19 = (longlong *)(lVar10 + 0x68);
          local_618 = ppvVar28;
          local_610 = plVar19;
          if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
            ppvVar22 = ppvVar28;
            plVar20 = (longlong *)*plVar19;
            do {
              if (*plVar20 != 0) {
                local_618 = (void **)((longlong *)*plVar19)[(longlong)ppvVar22];
                break;
              }
              uVar6 = (int)ppvVar22 + 1;
              ppvVar22 = (void **)(ulonglong)uVar6;
              plVar20 = plVar20 + 1;
            } while (uVar6 < *(uint *)(lVar10 + 0x78));
          }
          while ((plVar20 = local_610, (void **)local_618 != (void **)0x0 || (local_610 != plVar19))
                ) {
            if ((void **)local_618 == (void **)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar27 = *(undefined4 *)local_618;
            FUN_1402df270(&local_278);
            uVar7 = FUN_1402970c0(lVar10,L"nGroupID");
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nGroupID");
            uVar7 = *puVar11;
            uVar9 = FUN_1402970c0(lVar10,L"nClassID");
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar9,L"nClassID");
            local_278 = *puVar11;
            uVar9 = FUN_1402970c0(lVar10,L"nLevelLimit");
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar9,L"nLevelLimit");
            local_274 = *puVar11;
            uVar9 = FUN_1402970c0(lVar10,L"nNPCID");
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar9,L"nNPCID");
            local_270[0] = *puVar11;
            uVar9 = FUN_1402970c0(lVar10,L"wszTitle");
            local_638 = 1;
            psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar9,L"wszTitle");
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(local_268,psVar12,~uVar17 - 1);
            uVar9 = FUN_1402970c0(lVar10,L"wszSubTitle");
            local_638 = 1;
            psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar9,L"wszSubTitle");
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(local_240,psVar12,~uVar17 - 1);
            uVar9 = FUN_1402970c0(lVar10,L"wszDesc");
            local_638 = 1;
            psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar9,L"wszDesc");
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(local_218,psVar12,~uVar17 - 1);
            uVar9 = FUN_1402970c0(lVar10,L"szSprName");
            local_638 = 1;
            psVar12 = (short *)FUN_140296990(lVar10,uVar27,uVar9,L"szSprName");
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(local_1f0,psVar12,~uVar17 - 1);
            uVar9 = FUN_1402970c0(lVar10,L"wszAccept");
            local_638 = 1;
            psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar9,L"wszAccept");
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(local_1c8,psVar12,~uVar17 - 1);
            uVar9 = FUN_1402970c0(lVar10,L"wszReject");
            local_638 = 1;
            psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar9,L"wszReject");
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(local_1a0,psVar12,~uVar17 - 1);
            uVar9 = FUN_1402970c0(lVar10,L"wszHint");
            local_638 = 1;
            psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar9,L"wszHint");
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(local_178,psVar12,~uVar17 - 1);
            uVar9 = FUN_1402970c0(lVar10,L"wszSummery");
            local_638 = 1;
            psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar9,L"wszSummery");
            uVar17 = 0xffffffffffffffff;
            psVar26 = psVar12;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar1 = *psVar26;
              psVar26 = psVar26 + 1;
            } while (sVar1 != 0);
            FUN_140001710(local_150,psVar12,~uVar17 - 1);
            uVar14 = FUN_1402df4a0(&local_4b8,&local_278);
            FUN_1402df890(local_5a8,uVar7,local_278,uVar14);
            FUN_1402df330(&local_278);
            FUN_14014b590(plVar20,&local_618);
          }
        }
        lVar10 = FUN_1402933b0(DAT_140607ff0,L"QUEST_GROUP_REQUEST");
        if (lVar10 != 0) {
          plVar19 = (longlong *)(lVar10 + 0x68);
          local_508 = ppvVar28;
          local_500 = plVar19;
          if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
            ppvVar22 = ppvVar28;
            plVar20 = (longlong *)*plVar19;
            do {
              if (*plVar20 != 0) {
                local_508 = (void **)((longlong *)*plVar19)[(longlong)ppvVar22];
                break;
              }
              uVar6 = (int)ppvVar22 + 1;
              ppvVar22 = (void **)(ulonglong)uVar6;
              plVar20 = plVar20 + 1;
            } while (uVar6 < *(uint *)(lVar10 + 0x78));
          }
          while ((plVar20 = local_500, (void **)local_508 != (void **)0x0 || (local_500 != plVar19))
                ) {
            if ((void **)local_508 == (void **)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar27 = *(undefined4 *)local_508;
            uVar7 = FUN_1402970c0(lVar10,L"nGroupID");
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nGroupID");
            local_618 = (undefined8 *)CONCAT44(local_618._4_4_,*puVar11);
            uVar7 = FUN_1402970c0(lVar10,L"nClassID");
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nClassID");
            local_620 = (void **)CONCAT44(local_620._4_4_,*puVar11);
            uVar7 = FUN_1402970c0(lVar10,L"nLevelLimit");
            local_638 = 1;
            FUN_140296600(lVar10,uVar27,uVar7,L"nLevelLimit");
            local_608 = 0;
            local_600 = 0;
            local_5f8 = 0;
            local_5e8 = 0;
            local_5e0 = 0;
            local_5d8 = 0;
            local_5c8 = (void ***)0x0;
            local_5c0 = (void ***)0x0;
            local_5b8 = (void ***)0x0;
            ppvVar22 = ppvVar28;
            do {
              pvVar4 = ppvVar22[0x280bb6ae];
              uVar7 = FUN_1402970c0(lVar10,pvVar4);
              local_638 = 1;
              psVar12 = (short *)FUN_140296990(lVar10,uVar27,uVar7,pvVar4);
              local_4c8 = 7;
              local_4d0 = (void *)0x0;
              local_4e0[0]._0_2_ = 0;
              uVar17 = 0xffffffffffffffff;
              psVar26 = psVar12;
              do {
                if (uVar17 == 0) break;
                uVar17 = uVar17 - 1;
                sVar1 = *psVar26;
                psVar26 = psVar26 + 1;
              } while (sVar1 != 0);
              FUN_140001710(local_4e0,psVar12,~uVar17 - 1);
              pvVar4 = ppvVar22[0x280bb6c2];
              uVar7 = FUN_1402970c0(lVar10,pvVar4);
              local_638 = 1;
              psVar12 = (short *)FUN_140296b70(lVar10,uVar27,uVar7,pvVar4);
              local_518 = 7;
              local_520 = 0;
              local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
              uVar17 = 0xffffffffffffffff;
              psVar26 = psVar12;
              do {
                if (uVar17 == 0) break;
                uVar17 = uVar17 - 1;
                sVar1 = *psVar26;
                psVar26 = psVar26 + 1;
              } while (sVar1 != 0);
              FUN_140001710(&local_530,psVar12,~uVar17 - 1);
              pvVar4 = ppvVar22[0x280bb6d6];
              uVar7 = FUN_1402970c0(lVar10,pvVar4);
              local_638 = 1;
              puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,pvVar4);
              local_628 = (void **)CONCAT44(local_628._4_4_,*puVar11);
              if (local_4d0 == (void *)0x0) {
                if (7 < local_518) {
                  operator_delete(local_530);
                }
LAB_1402deabd:
                local_518 = 7;
                local_520 = 0;
                local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
                if (7 < local_4c8) {
                  operator_delete((void *)CONCAT62(local_4e0[0]._2_6_,local_4e0[0]._0_2_));
                }
                break;
              }
              if (local_520 == 0) {
                if (7 < local_518) {
                  operator_delete(local_530);
                }
                goto LAB_1402deabd;
              }
              FUN_14008ec00(&local_608,local_4e0);
              FUN_14008ec00(&local_5e8,&local_530);
              FUN_14012e5c0(&local_5c8,&local_628);
              if (7 < local_518) {
                operator_delete(local_530);
              }
              local_518 = 7;
              local_520 = 0;
              local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
              if (7 < local_4c8) {
                operator_delete((void *)CONCAT62(local_4e0[0]._2_6_,local_4e0[0]._0_2_));
              }
              ppvVar22 = ppvVar22 + 1;
            } while ((longlong)ppvVar22 < 0xa0);
            local_628 = &local_5a0;
            FUN_14015a040(&local_5a0,&local_608);
            FUN_14015a040(local_580,&local_5e8);
            FUN_14012e520(local_560,&local_5c8);
            FUN_1402dfa70(local_5a8,(ulonglong)local_618 & 0xffffffff,
                          (ulonglong)local_620 & 0xffffffff,&local_5a0);
            FUN_1402df1d0(&local_608);
            FUN_14014b590(plVar20,&local_508);
          }
        }
        lVar10 = FUN_1402933b0(DAT_140607ff0,L"QUEST_GROUP_COMPLETE");
        if (lVar10 != 0) {
          plVar19 = (longlong *)(lVar10 + 0x68);
          local_508 = ppvVar28;
          local_500 = plVar19;
          if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
            ppvVar22 = ppvVar28;
            plVar20 = (longlong *)*plVar19;
            do {
              if (*plVar20 != 0) {
                local_508 = (void **)((longlong *)*plVar19)[(longlong)ppvVar22];
                break;
              }
              uVar6 = (int)ppvVar22 + 1;
              ppvVar22 = (void **)(ulonglong)uVar6;
              plVar20 = plVar20 + 1;
            } while (uVar6 < *(uint *)(lVar10 + 0x78));
          }
          while ((plVar20 = local_500, (void **)local_508 != (void **)0x0 || (local_500 != plVar19))
                ) {
            if ((void **)local_508 == (void **)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar27 = *(undefined4 *)local_508;
            uVar7 = FUN_1402970c0(lVar10,L"nGroupID");
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nGroupID");
            local_620 = (void **)CONCAT44(local_620._4_4_,*puVar11);
            uVar7 = FUN_1402970c0(lVar10,L"nClassID");
            local_638 = 1;
            puVar11 = (undefined4 *)FUN_140296600(lVar10,uVar27,uVar7,L"nClassID");
            local_628 = (void **)CONCAT44(local_628._4_4_,*puVar11);
            uVar7 = FUN_1402970c0(lVar10,L"nLevelLimit");
            local_638 = 1;
            FUN_140296600(lVar10,uVar27,uVar7,L"nLevelLimit");
            local_608 = 0;
            local_600 = 0;
            local_5f8 = 0;
            local_5e8 = 0;
            local_5e0 = 0;
            local_5d8 = 0;
            local_5c8 = (void ***)0x0;
            local_5c0 = (void ***)0x0;
            local_5b8 = (void ***)0x0;
            ppvVar22 = ppvVar28;
            do {
              psVar12 = (short *)FUN_140297000(lVar10,uVar27,ppvVar22[0x280bb6ae],1);
              local_4c8 = 7;
              local_4d0 = (void *)0x0;
              local_4e0[0]._0_2_ = 0;
              uVar17 = 0xffffffffffffffff;
              psVar26 = psVar12;
              do {
                if (uVar17 == 0) break;
                uVar17 = uVar17 - 1;
                sVar1 = *psVar26;
                psVar26 = psVar26 + 1;
              } while (sVar1 != 0);
              FUN_140001710(local_4e0,psVar12,~uVar17 - 1);
              psVar12 = (short *)FUN_140297060(lVar10,uVar27,ppvVar22[0x280bb6c2],1);
              local_518 = 7;
              local_520 = 0;
              local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
              uVar17 = 0xffffffffffffffff;
              psVar26 = psVar12;
              do {
                if (uVar17 == 0) break;
                uVar17 = uVar17 - 1;
                sVar1 = *psVar26;
                psVar26 = psVar26 + 1;
              } while (sVar1 != 0);
              FUN_140001710(&local_530,psVar12,~uVar17 - 1);
              puVar11 = (undefined4 *)FUN_140296f40(lVar10,uVar27,ppvVar22[0x280bb6d6],1);
              local_618 = (undefined8 *)CONCAT44(local_618._4_4_,*puVar11);
              if (local_4d0 == (void *)0x0) {
                if (7 < local_518) {
                  operator_delete(local_530);
                }
LAB_1402dee19:
                local_518 = 7;
                local_520 = 0;
                local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
                if (7 < local_4c8) {
                  operator_delete((void *)CONCAT62(local_4e0[0]._2_6_,local_4e0[0]._0_2_));
                }
                break;
              }
              if (local_520 == 0) {
                if (7 < local_518) {
                  operator_delete(local_530);
                }
                goto LAB_1402dee19;
              }
              FUN_14008ec00(&local_608,local_4e0);
              FUN_14008ec00(&local_5e8,&local_530);
              FUN_14012e5c0(&local_5c8,&local_618);
              if (7 < local_518) {
                operator_delete(local_530);
              }
              local_518 = 7;
              local_520 = 0;
              local_530 = (void *)((ulonglong)local_530 & 0xffffffffffff0000);
              if (7 < local_4c8) {
                operator_delete((void *)CONCAT62(local_4e0[0]._2_6_,local_4e0[0]._0_2_));
              }
              ppvVar22 = ppvVar22 + 1;
            } while ((longlong)ppvVar22 < 0xa0);
            local_618 = &local_5a0;
            FUN_14015a040(&local_5a0,&local_608);
            FUN_14015a040(local_580,&local_5e8);
            FUN_14012e520(local_560,&local_5c8);
            FUN_1402dfc10(local_5a8,(ulonglong)local_620 & 0xffffffff,
                          (ulonglong)local_628 & 0xffffffff,&local_5a0);
            FUN_1402df1d0(&local_608);
            FUN_14014b590(plVar20,&local_508);
          }
        }
      }
    }
  }
  return;
}



longlong FUN_1402deee0(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined8 *)(param_1 + 0xc0) = 0;
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined8 *)(param_1 + 0xf8) = 0;
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined8 *)(param_1 + 0x118) = 0;
  *(undefined8 *)(param_1 + 0x120) = 0;
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined8 *)(param_1 + 0x140) = 0;
  *(undefined8 *)(param_1 + 0x148) = 0;
  *(undefined8 *)(param_1 + 0x168) = 0;
  *(undefined8 *)(param_1 + 0x170) = 0;
  *(undefined8 *)(param_1 + 0x178) = 0;
  *(undefined8 *)(param_1 + 0x188) = 0;
  *(undefined8 *)(param_1 + 400) = 0;
  *(undefined8 *)(param_1 + 0x198) = 0;
  *(undefined8 *)(param_1 + 0x1e0) = 0;
  *(undefined8 *)(param_1 + 0x1e8) = 7;
  *(undefined2 *)(param_1 + 0x1d0) = 0;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined8 *)(param_1 + 0x208) = 0;
  *(undefined8 *)(param_1 + 0x218) = 0;
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined8 *)(param_1 + 0x228) = 0;
  return param_1;
}



void FUN_1402defd0(longlong param_1)

{
  if (*(void **)(param_1 + 0x218) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x218));
  }
  *(undefined8 *)(param_1 + 0x218) = 0;
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined8 *)(param_1 + 0x228) = 0;
  if (*(void **)(param_1 + 0x1f8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x1f8));
  }
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined8 *)(param_1 + 0x208) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1e8)) {
    operator_delete(*(void **)(param_1 + 0x1d0));
  }
  *(undefined8 *)(param_1 + 0x1e8) = 7;
  *(undefined8 *)(param_1 + 0x1e0) = 0;
  *(undefined2 *)(param_1 + 0x1d0) = 0;
  if (*(void **)(param_1 + 0x188) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x188));
  }
  *(undefined8 *)(param_1 + 0x188) = 0;
  *(undefined8 *)(param_1 + 400) = 0;
  *(undefined8 *)(param_1 + 0x198) = 0;
  if (*(void **)(param_1 + 0x168) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x168));
  }
  *(undefined8 *)(param_1 + 0x168) = 0;
  *(undefined8 *)(param_1 + 0x170) = 0;
  *(undefined8 *)(param_1 + 0x178) = 0;
  if (*(longlong *)(param_1 + 0x138) != 0) {
    FUN_140129370(*(longlong *)(param_1 + 0x138),*(undefined8 *)(param_1 + 0x140));
    operator_delete(*(void **)(param_1 + 0x138));
  }
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined8 *)(param_1 + 0x140) = 0;
  *(undefined8 *)(param_1 + 0x148) = 0;
  if (*(longlong *)(param_1 + 0x118) != 0) {
    FUN_14008d0a0(*(longlong *)(param_1 + 0x118),*(undefined8 *)(param_1 + 0x120));
    operator_delete(*(void **)(param_1 + 0x118));
  }
  *(undefined8 *)(param_1 + 0x118) = 0;
  *(undefined8 *)(param_1 + 0x120) = 0;
  *(undefined8 *)(param_1 + 0x128) = 0;
  if (*(void **)(param_1 + 0xf8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xf8));
  }
  *(undefined8 *)(param_1 + 0xf8) = 0;
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x108) = 0;
  if (*(void **)(param_1 + 0xd8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xd8));
  }
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  if (*(void **)(param_1 + 0xb8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xb8));
  }
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined8 *)(param_1 + 0xc0) = 0;
  *(undefined8 *)(param_1 + 200) = 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_1402df1c0(longlong param_1)

{
  FUN_1402defd0(param_1 + 8);
  return;
}



void FUN_1402df1d0(longlong *param_1)

{
  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 (param_1[4] != 0) {
    FUN_14008d0a0(param_1[4],param_1[5]);
    operator_delete((void *)param_1[4]);
  }
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  if (*param_1 != 0) {
    FUN_14008d0a0(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1402df260(longlong param_1)

{
  FUN_1402df1d0(param_1 + 8);
  return;
}



longlong FUN_1402df270(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x50) = 7;
  *(undefined2 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 7;
  *(undefined2 *)(param_1 + 0x60) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 7;
  *(undefined2 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0xc0) = 0;
  *(undefined8 *)(param_1 + 200) = 7;
  *(undefined2 *)(param_1 + 0xb0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined8 *)(param_1 + 0xf0) = 7;
  *(undefined2 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined8 *)(param_1 + 0x118) = 7;
  *(undefined2 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined8 *)(param_1 + 0x140) = 7;
  *(undefined2 *)(param_1 + 0x128) = 0;
  return param_1;
}



void FUN_1402df330(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x140)) {
    operator_delete(*(void **)(param_1 + 0x128));
  }
  *(undefined8 *)(param_1 + 0x140) = 7;
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined2 *)(param_1 + 0x128) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x118)) {
    operator_delete(*(void **)(param_1 + 0x100));
  }
  *(undefined8 *)(param_1 + 0x118) = 7;
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined2 *)(param_1 + 0x100) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xf0)) {
    operator_delete(*(void **)(param_1 + 0xd8));
  }
  *(undefined8 *)(param_1 + 0xf0) = 7;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined2 *)(param_1 + 0xd8) = 0;
  if (7 < *(ulonglong *)(param_1 + 200)) {
    operator_delete(*(void **)(param_1 + 0xb0));
  }
  *(undefined8 *)(param_1 + 200) = 7;
  *(undefined8 *)(param_1 + 0xc0) = 0;
  *(undefined2 *)(param_1 + 0xb0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xa0)) {
    operator_delete(*(void **)(param_1 + 0x88));
  }
  *(undefined8 *)(param_1 + 0xa0) = 7;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined2 *)(param_1 + 0x88) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x78)) {
    operator_delete(*(void **)(param_1 + 0x60));
  }
  *(undefined8 *)(param_1 + 0x78) = 7;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined2 *)(param_1 + 0x60) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x50)) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x50) = 7;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined2 *)(param_1 + 0x38) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



undefined4 * FUN_1402df4a0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x14) = 7;
  *(undefined8 *)(param_1 + 0x12) = 0;
  *(undefined2 *)(param_1 + 0xe) = 0;
  FUN_1400015e0(param_1 + 0xe,param_2 + 0xe,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1e) = 7;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  *(undefined2 *)(param_1 + 0x18) = 0;
  FUN_1400015e0(param_1 + 0x18,param_2 + 0x18,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x26) = 0;
  *(undefined2 *)(param_1 + 0x22) = 0;
  FUN_1400015e0(param_1 + 0x22,param_2 + 0x22,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x32) = 7;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined2 *)(param_1 + 0x2c) = 0;
  FUN_1400015e0(param_1 + 0x2c,param_2 + 0x2c,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x3c) = 7;
  *(undefined8 *)(param_1 + 0x3a) = 0;
  *(undefined2 *)(param_1 + 0x36) = 0;
  FUN_1400015e0(param_1 + 0x36,param_2 + 0x36,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x46) = 7;
  *(undefined8 *)(param_1 + 0x44) = 0;
  *(undefined2 *)(param_1 + 0x40) = 0;
  FUN_1400015e0(param_1 + 0x40,param_2 + 0x40,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x50) = 7;
  *(undefined8 *)(param_1 + 0x4e) = 0;
  *(undefined2 *)(param_1 + 0x4a) = 0;
  FUN_1400015e0(param_1 + 0x4a,param_2 + 0x4a,0,0xffffffffffffffff);
  return param_1;
}



ulonglong FUN_1402df630(longlong param_1,uint param_2)

{
  ulonglong in_RAX;
  uint *puVar1;
  
  if ((int)param_2 < 1) {
    return in_RAX & 0xffffffffffffff00;
  }
  if (*(longlong *)(param_1 + 0x1b0) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x1b0) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x1c0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 2)) {
      if ((puVar1[4] == param_2) && (*puVar1 == param_2)) goto LAB_1402df676;
    }
  }
  puVar1 = (uint *)0x0;
LAB_1402df676:
  return CONCAT71((int7)((ulonglong)puVar1 >> 8),puVar1 != (uint *)0x0);
}



ulonglong FUN_1402df680(longlong param_1,uint param_2)

{
  ulonglong in_RAX;
  uint *puVar1;
  
  if ((int)param_2 < 1) {
    return in_RAX & 0xffffffffffffff00;
  }
  if (*(longlong *)(param_1 + 0x1f8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x1f8) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x208)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 2)) {
      if ((puVar1[4] == param_2) && (*puVar1 == param_2)) goto LAB_1402df6c6;
    }
  }
  puVar1 = (uint *)0x0;
LAB_1402df6c6:
  return CONCAT71((int7)((ulonglong)puVar1 >> 8),puVar1 != (uint *)0x0);
}



void FUN_1402df6d0(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  longlong lVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)param_2;
  lVar2 = FUN_140137690();
  if (*(longlong *)(lVar2 + 0x88) == 0) {
    return;
  }
  puVar1 = *(uint **)(*(longlong *)(lVar2 + 0x88) + (uVar3 % (ulonglong)*(uint *)(lVar2 + 0x98)) * 8
                     );
  while( true ) {
    if (puVar1 == (uint *)0x0) {
      return;
    }
    if ((puVar1[0xa8] == param_2) && (*puVar1 == param_2)) break;
    puVar1 = *(uint **)(puVar1 + 0xa6);
  }
  if (puVar1 == (uint *)0x0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x1b0) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x1b0) +
                            (uVar3 % (ulonglong)*(uint *)(param_1 + 0x1c0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 2)) {
      if ((puVar1[4] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          puVar1[1] = puVar1[1] + param_3;
          return;
        }
        break;
      }
    }
  }
  FUN_1402c05f0(param_1 + 0x1b0,uVar3,param_3);
  return;
}



void FUN_1402df7b0(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  longlong lVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)param_2;
  lVar2 = FUN_140137690();
  if (*(longlong *)(lVar2 + 0x40) == 0) {
    return;
  }
  puVar1 = *(uint **)(*(longlong *)(lVar2 + 0x40) + (uVar3 % (ulonglong)*(uint *)(lVar2 + 0x50)) * 8
                     );
  while( true ) {
    if (puVar1 == (uint *)0x0) {
      return;
    }
    if ((puVar1[0xe] == param_2) && (*puVar1 == param_2)) break;
    puVar1 = *(uint **)(puVar1 + 0xc);
  }
  if (puVar1 == (uint *)0x0) {
    return;
  }
  if (*(longlong *)(param_1 + 0x1f8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x1f8) +
                            (uVar3 % (ulonglong)*(uint *)(param_1 + 0x208)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 2)) {
      if ((puVar1[4] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          puVar1[1] = puVar1[1] + param_3;
          return;
        }
        break;
      }
    }
  }
  FUN_1402c05f0(param_1 + 0x1f8,uVar3,param_3);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402df890(longlong param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  uint *puVar2;
  undefined8 uVar3;
  undefined1 auStackY_388 [32];
  undefined1 local_340 [392];
  undefined1 local_1b8 [384];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStackY_388;
  uVar3 = param_4;
  iVar1 = FUN_1402db3f0();
  if (-1 < iVar1) {
    if (*(longlong *)(param_1 + 0x168) != 0) {
      for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x168) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x178)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x62)) {
        if ((puVar2[100] == param_2) && (*puVar2 == param_2)) {
          if (puVar2 != (uint *)0x0) {
            if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            FUN_1402e1300(puVar2 + (longlong)iVar1 * 8 + 2,uVar3);
            uVar3 = param_4;
            goto LAB_1402dfa0b;
          }
          break;
        }
      }
    }
    _eh_vector_constructor_iterator_
              (local_1b8,0x20,0xc,(_func_void_void_ptr *)&LAB_140147020,
               (_func_void_void_ptr *)&LAB_1402e12f0);
    FUN_1402e1300(local_1b8 + (longlong)iVar1 * 0x20,param_4);
    _eh_vector_copy_constructor_iterator_
              (local_340,local_1b8,0x20,0xc,FUN_1402e3a00,(_func_void_void_ptr *)&LAB_1402e12f0);
    FUN_1402e1f30(param_1 + 0x168,param_2,local_340);
    _eh_vector_destructor_iterator_(local_340,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e12f0);
    _eh_vector_destructor_iterator_(local_1b8,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e12f0);
    uVar3 = param_4;
  }
LAB_1402dfa0b:
  FUN_1402df330(uVar3);
  return;
}



void FUN_1402dfa30(void *param_1)

{
  _eh_vector_destructor_iterator_(param_1,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e12f0);
  return;
}



// Library Function - Single Match
//  public: __cdecl Concurrency::details::SubAllocator::~SubAllocator(void) __ptr64
// 
// Library: Visual Studio 2010 Release

void __thiscall Concurrency::details::SubAllocator::~SubAllocator(SubAllocator *this)

{
  _eh_vector_destructor_iterator_(this + 8,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e12f0);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402dfa70(longlong param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  uint *puVar2;
  undefined8 uVar3;
  undefined1 auStackY_388 [32];
  undefined1 local_340 [392];
  undefined1 local_1b8 [384];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStackY_388;
  uVar3 = param_4;
  iVar1 = FUN_1402db3f0();
  if (-1 < iVar1) {
    if (*(longlong *)(param_1 + 0xd8) != 0) {
      for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0xd8) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xe8)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x62)) {
        if ((puVar2[100] == param_2) && (*puVar2 == param_2)) {
          if (puVar2 != (uint *)0x0) {
            if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            FUN_1402e11e0(puVar2 + (longlong)iVar1 * 8 + 2,uVar3);
            uVar3 = param_4;
            goto LAB_1402dfbeb;
          }
          break;
        }
      }
    }
    _eh_vector_constructor_iterator_
              (local_1b8,0x20,0xc,(_func_void_void_ptr *)&LAB_140147020,
               (_func_void_void_ptr *)&LAB_1402e11d0);
    FUN_1402e11e0(local_1b8 + (longlong)iVar1 * 0x20,param_4);
    _eh_vector_copy_constructor_iterator_
              (local_340,local_1b8,0x20,0xc,FUN_1402e3980,(_func_void_void_ptr *)&LAB_1402e11d0);
    FUN_1402e1e60(param_1 + 0xd8,param_2,local_340);
    _eh_vector_destructor_iterator_(local_340,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e11d0);
    _eh_vector_destructor_iterator_(local_1b8,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e11d0);
    uVar3 = param_4;
  }
LAB_1402dfbeb:
  FUN_1402df1d0(uVar3);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402dfc10(longlong param_1,uint param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  uint *puVar2;
  undefined8 uVar3;
  undefined1 auStackY_388 [32];
  undefined1 local_340 [392];
  undefined1 local_1b8 [384];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStackY_388;
  uVar3 = param_4;
  iVar1 = FUN_1402db3f0();
  if (-1 < iVar1) {
    if (*(longlong *)(param_1 + 0x120) != 0) {
      for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x120) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x130)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x62)) {
        if ((puVar2[100] == param_2) && (*puVar2 == param_2)) {
          if (puVar2 != (uint *)0x0) {
            if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            FUN_1402e11e0(puVar2 + (longlong)iVar1 * 8 + 2,uVar3);
            uVar3 = param_4;
            goto LAB_1402dfd8b;
          }
          break;
        }
      }
    }
    _eh_vector_constructor_iterator_
              (local_1b8,0x20,0xc,(_func_void_void_ptr *)&LAB_140147020,
               (_func_void_void_ptr *)&LAB_1402e11d0);
    FUN_1402e11e0(local_1b8 + (longlong)iVar1 * 0x20,param_4);
    _eh_vector_copy_constructor_iterator_
              (local_340,local_1b8,0x20,0xc,FUN_1402e3980,(_func_void_void_ptr *)&LAB_1402e11d0);
    FUN_1402e1e60(param_1 + 0x120,param_2,local_340);
    _eh_vector_destructor_iterator_(local_340,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e11d0);
    _eh_vector_destructor_iterator_(local_1b8,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e11d0);
    uVar3 = param_4;
  }
LAB_1402dfd8b:
  FUN_1402df1d0(uVar3);
  return;
}



void FUN_1402dfdb0(void *param_1)

{
  _eh_vector_destructor_iterator_(param_1,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e11d0);
  return;
}



// Library Function - Single Match
//  public: __cdecl Concurrency::details::SubAllocator::~SubAllocator(void) __ptr64
// 
// Library: Visual Studio 2010 Release

void __thiscall Concurrency::details::SubAllocator::~SubAllocator(SubAllocator *this)

{
  _eh_vector_destructor_iterator_(this + 8,0x20,0xc,(_func_void_void_ptr *)&LAB_1402e11d0);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402dfdf0(int param_1,ulonglong *param_2)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  int *piVar7;
  longlong lVar8;
  longlong *plVar9;
  undefined4 *puVar10;
  undefined4 *puVar11;
  undefined1 auStack_2b8 [32];
  undefined1 local_298;
  undefined4 local_288 [2];
  undefined8 local_280;
  undefined4 local_278 [2];
  undefined2 local_270;
  undefined8 local_260;
  undefined8 local_258;
  int local_218;
  undefined8 local_1c0;
  undefined8 local_1b8;
  undefined8 local_1b0;
  undefined8 local_1a0;
  undefined8 local_198;
  undefined8 local_190;
  undefined8 local_180;
  undefined8 local_178;
  undefined8 local_170;
  undefined8 local_160;
  undefined8 local_158;
  undefined8 local_150;
  undefined8 local_140;
  undefined8 local_138;
  undefined8 local_130;
  undefined8 local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_f0;
  undefined8 local_e8;
  undefined8 local_e0;
  undefined2 local_a8;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_80;
  undefined8 local_78;
  undefined8 local_70;
  undefined8 local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_38;
  undefined4 *puVar6;
  
  local_280 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_2b8;
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"QUEST");
  if (lVar5 != 0) {
    puVar11 = (undefined4 *)0x0;
    puVar10 = puVar11;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar6 = puVar11;
      plVar9 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar9 != 0) {
          puVar10 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar3 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar3;
        plVar9 = plVar9 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_1402dfe90:
    puVar6 = puVar10;
    if (puVar6 != (undefined4 *)0x0) {
      uVar1 = *puVar6;
      local_258 = 7;
      local_260 = 0;
      local_270 = 0;
      local_1c0 = 0;
      local_1b8 = 0;
      local_1b0 = 0;
      local_1a0 = 0;
      local_198 = 0;
      local_190 = 0;
      local_180 = 0;
      local_178 = 0;
      local_170 = 0;
      local_160 = 0;
      local_158 = 0;
      local_150 = 0;
      local_140 = 0;
      local_138 = 0;
      local_130 = 0;
      local_110 = 0;
      local_108 = 0;
      local_100 = 0;
      local_f0 = 0;
      local_e8 = 0;
      local_e0 = 0;
      local_90 = 7;
      local_98 = 0;
      local_a8 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_60 = 0;
      local_58 = 0;
      local_50 = 0;
      local_288[0] = uVar1;
      local_278[0] = uVar1;
      uVar4 = FUN_1402970c0(lVar5,L"nLevelLimit");
      local_298 = 1;
      piVar7 = (int *)FUN_140296600(lVar5,uVar1,uVar4,L"nLevelLimit");
      local_218 = *piVar7;
      if (local_218 < param_1) {
        puVar10 = (undefined4 *)param_2[1];
        if ((local_288 < puVar10) && (puVar2 = (undefined4 *)*param_2, puVar2 <= local_288)) {
          if (puVar10 == (undefined4 *)param_2[2]) {
            FUN_1400556a0(param_2);
          }
          if ((undefined4 *)param_2[1] != (undefined4 *)0x0) {
            *(undefined4 *)param_2[1] =
                 *(undefined4 *)(*param_2 + ((longlong)local_288 - (longlong)puVar2 >> 2) * 4);
          }
        }
        else {
          if (puVar10 == (undefined4 *)param_2[2]) {
            FUN_1400556a0(param_2);
          }
          if ((undefined4 *)param_2[1] != (undefined4 *)0x0) {
            *(undefined4 *)param_2[1] = uVar1;
          }
        }
        param_2[1] = param_2[1] + 4;
      }
      FUN_1402defd0(local_278);
      puVar10 = *(undefined4 **)(puVar6 + 6);
      if (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar6[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar8 = (longlong)(int)uVar3 << 3;
        puVar10 = puVar11;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar8) != 0) {
            puVar10 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar8);
          }
          uVar3 = uVar3 + 1;
          lVar8 = lVar8 + 8;
        } while (puVar10 == (undefined4 *)0x0);
      }
      goto LAB_1402dfe90;
    }
  }
  return;
}



uint FUN_1402e0090(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x90)) {
      if ((puVar1[0x92] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x13];
      }
    }
  }
  return 0;
}



void * FUN_1402e00d0(longlong *param_1,uint param_2,undefined8 *param_3)

{
  void *_Dst;
  void *in_RAX;
  uint *puVar1;
  
  _Dst = (void *)*param_3;
  if (_Dst != (void *)param_3[1]) {
    in_RAX = memmove(_Dst,(void *)param_3[1],0);
    param_3[1] = _Dst;
  }
  if (*param_1 != 0) {
    in_RAX = (void *)((ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 2));
    puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
    if (puVar1 != (uint *)0x0) {
      while ((puVar1[0x92] != param_2 || (*puVar1 != param_2))) {
        puVar1 = *(uint **)(puVar1 + 0x90);
        if (puVar1 == (uint *)0x0) {
          return in_RAX;
        }
      }
      if (puVar1 != (uint *)0x0) {
        in_RAX = (void *)FUN_14012bb70(param_3,puVar1 + 0x40);
      }
    }
  }
  return in_RAX;
}



void * FUN_1402e01a0(longlong *param_1,uint param_2,undefined8 *param_3)

{
  void *_Dst;
  void *in_RAX;
  uint *puVar1;
  
  _Dst = (void *)*param_3;
  if (_Dst != (void *)param_3[1]) {
    in_RAX = memmove(_Dst,(void *)param_3[1],0);
    param_3[1] = _Dst;
  }
  if (*param_1 != 0) {
    in_RAX = (void *)((ulonglong)param_2 / (ulonglong)*(uint *)(param_1 + 2));
    puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8);
    if (puVar1 != (uint *)0x0) {
      while ((puVar1[0x92] != param_2 || (*puVar1 != param_2))) {
        puVar1 = *(uint **)(puVar1 + 0x90);
        if (puVar1 == (uint *)0x0) {
          return in_RAX;
        }
      }
      if (puVar1 != (uint *)0x0) {
        in_RAX = (void *)FUN_14012bb70(param_3,puVar1 + 0x38);
      }
    }
  }
  return in_RAX;
}



undefined * FUN_1402e0270(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetQuestDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf50 & 1) == 0) {
    DAT_14060cf50 = DAT_14060cf50 | 1;
    FUN_1402db480();
    atexit(FUN_140448e60);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetQuestDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_14060a210;
}



void thunk_FUN_1402e22b0(void)

{
  FUN_1402e22b0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402e0310(undefined8 param_1)

{
  short sVar1;
  undefined4 uVar2;
  int iVar3;
  undefined *puVar4;
  code *pcVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  short *psVar10;
  int *piVar11;
  longlong lVar12;
  longlong *plVar13;
  ulonglong uVar14;
  undefined4 *puVar15;
  undefined4 *puVar16;
  undefined **ppuVar17;
  short *psVar18;
  undefined4 *puVar19;
  undefined4 *puVar20;
  undefined1 auStack_138 [32];
  undefined1 local_118;
  undefined4 *local_108;
  undefined8 local_100;
  undefined8 local_f8;
  undefined4 local_e8;
  undefined4 **local_e0;
  undefined4 **local_d8;
  undefined4 **local_d0;
  undefined2 local_c0;
  undefined6 uStack_be;
  undefined8 local_b0;
  ulonglong local_a8;
  undefined4 local_98;
  undefined4 local_90 [2];
  void *local_88 [4];
  undefined2 local_68;
  undefined6 uStack_66;
  undefined8 local_58;
  ulonglong local_50;
  ulonglong local_38;
  undefined4 *puVar9;
  
  local_f8 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_138;
  local_100 = param_1;
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"QUEST_GROUP");
  if (lVar8 != 0) {
    puVar20 = (undefined4 *)0x0;
    puVar15 = puVar20;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar9 = puVar20;
      plVar13 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar13 != 0) {
          puVar15 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar9];
          break;
        }
        uVar6 = (int)puVar9 + 1;
        puVar9 = (undefined4 *)(ulonglong)uVar6;
        plVar13 = plVar13 + 1;
      } while (uVar6 < *(uint *)(lVar8 + 0x78));
    }
LAB_1402e03b0:
    puVar9 = puVar15;
    if (puVar9 != (undefined4 *)0x0) {
      uVar2 = *puVar9;
      local_e0 = (undefined4 **)0x0;
      local_d8 = (undefined4 **)0x0;
      local_d0 = (undefined4 **)0x0;
      local_a8 = 7;
      local_b0 = 0;
      local_c0 = 0;
      local_e8 = uVar2;
      uVar7 = FUN_1402970c0(lVar8,L"wszNpcName");
      local_118 = 1;
      psVar10 = (short *)FUN_140296b70(lVar8,uVar2,uVar7,L"wszNpcName");
      uVar14 = 0xffffffffffffffff;
      psVar18 = psVar10;
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar1 = *psVar18;
        psVar18 = psVar18 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_c0,psVar10,~uVar14 - 1);
      ppuVar17 = &PTR_u_nQuest00_1405db750;
      do {
        puVar4 = *ppuVar17;
        uVar7 = FUN_1402970c0(lVar8,puVar4);
        local_118 = 1;
        piVar11 = (int *)FUN_140296600(lVar8,uVar2,uVar7,puVar4);
        iVar3 = *piVar11;
        local_108 = (undefined4 *)CONCAT44(local_108._4_4_,iVar3);
        if (0 < iVar3) {
          if ((&local_108 < local_d8) && (local_e0 <= &local_108)) {
            lVar12 = (longlong)&local_108 - (longlong)local_e0;
            if (local_d8 == local_d0) {
              uVar14 = (longlong)local_d8 - (longlong)local_e0 >> 2;
              if (0x3ffffffffffffffe < uVar14) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              puVar19 = (undefined4 *)(uVar14 + 1);
              puVar15 = (undefined4 *)((longlong)local_d0 - (longlong)local_e0 >> 2);
              if (puVar15 < puVar19) {
                puVar16 = puVar20;
                if (puVar15 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar15 >> 1))) {
                  puVar16 = (undefined4 *)((longlong)puVar15 + ((ulonglong)puVar15 >> 1));
                }
                if (puVar16 < puVar19) {
                  puVar16 = puVar19;
                }
                FUN_140051e60(&local_e0,puVar16);
              }
            }
            if (local_d8 != (undefined4 **)0x0) {
              *(int *)local_d8 = *(int *)((longlong)local_e0 + (lVar12 >> 2) * 4);
            }
          }
          else {
            if (local_d8 == local_d0) {
              uVar14 = (longlong)local_d8 - (longlong)local_e0 >> 2;
              if (0x3ffffffffffffffe < uVar14) {
                std::_Xlength_error("vector<T> too long");
                return;
              }
              puVar19 = (undefined4 *)(uVar14 + 1);
              puVar15 = (undefined4 *)((longlong)local_d0 - (longlong)local_e0 >> 2);
              if (puVar15 < puVar19) {
                puVar16 = puVar20;
                if (puVar15 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar15 >> 1))) {
                  puVar16 = (undefined4 *)((longlong)puVar15 + ((ulonglong)puVar15 >> 1));
                }
                if (puVar16 < puVar19) {
                  puVar16 = puVar19;
                }
                FUN_140051e60(&local_e0,puVar16);
              }
            }
            if (local_d8 != (undefined4 **)0x0) {
              *(int *)local_d8 = iVar3;
            }
          }
          local_d8 = (undefined4 **)((longlong)local_d8 + 4);
        }
        ppuVar17 = ppuVar17 + 1;
      } while ((longlong)ppuVar17 < 0x1405db7f0);
      local_108 = local_90;
      local_90[0] = local_e8;
      local_98 = uVar2;
      FUN_14012e520(local_88,&local_e0);
      local_50 = 7;
      local_58 = 0;
      local_68 = 0;
      FUN_1400015e0(&local_68,&local_c0,0,0xffffffffffffffff);
      FUN_1402e20f0(local_100,local_98,local_90);
      if (7 < local_50) {
        operator_delete((void *)CONCAT62(uStack_66,local_68));
      }
      local_50 = 7;
      local_58 = 0;
      local_68 = 0;
      if (local_88[0] != (void *)0x0) {
        operator_delete(local_88[0]);
      }
      if (7 < local_a8) {
        operator_delete((void *)CONCAT62(uStack_be,local_c0));
      }
      local_a8 = 7;
      local_b0 = 0;
      local_c0 = 0;
      if (local_e0 != (undefined4 **)0x0) {
        operator_delete(local_e0);
      }
      puVar15 = *(undefined4 **)(puVar9 + 6);
      if (*(undefined4 **)(puVar9 + 6) == (undefined4 *)0x0) {
        uVar6 = (uint)puVar9[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar12 = (longlong)(int)uVar6 << 3;
        puVar15 = puVar20;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar6) break;
          if (*(longlong *)(lVar12 + *(longlong *)(lVar8 + 0x68)) != 0) {
            puVar15 = *(undefined4 **)(lVar12 + *(longlong *)(lVar8 + 0x68));
          }
          uVar6 = uVar6 + 1;
          lVar12 = lVar12 + 8;
        } while (puVar15 == (undefined4 *)0x0);
      }
      goto LAB_1402e03b0;
    }
  }
  return;
}



void FUN_1402e0700(longlong param_1)

{
  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;
  if (*(void **)(param_1 + 8) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 8));
  }
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  return;
}



void FUN_1402e0760(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 (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  return;
}



undefined * FUN_1402e07c0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetQuestGroupDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf48 & 1) == 0) {
    DAT_14060cf48 = DAT_14060cf48 | 1;
    FUN_1402e2020(0x3f400000,0x3e800000,0x40100000);
    FUN_1402e0310(&DAT_14060a1c0);
    atexit((_func_5014 *)&LAB_140448ed0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetQuestGroupDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060a1c0;
}



void thunk_FUN_1402e2540(void)

{
  FUN_1402e2540();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402e0890(undefined8 param_1)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  short *psVar6;
  longlong lVar7;
  longlong *plVar8;
  ulonglong uVar9;
  short *psVar10;
  undefined4 *puVar11;
  undefined4 *puVar12;
  undefined1 auStackY_3b8 [32];
  undefined1 local_370 [40];
  undefined1 local_348 [40];
  undefined1 local_320 [40];
  undefined1 local_2f8 [40];
  undefined1 local_2d0 [40];
  undefined1 local_2a8 [40];
  undefined1 local_280 [40];
  undefined1 local_258 [40];
  undefined1 local_230 [40];
  undefined1 local_208 [48];
  undefined4 local_1d8;
  undefined4 local_1d0 [2];
  undefined1 local_1c8 [200];
  undefined1 local_100 [200];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStackY_3b8;
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"QUEST_TRIGGER");
  if (lVar5 != 0) {
    if (*(longlong *)(lVar5 + 0x70) != 0) {
      uVar9 = 0;
      if (*(uint *)(lVar5 + 0x78) != 0) {
        plVar8 = *(longlong **)(lVar5 + 0x68);
        do {
          if (*plVar8 != 0) {
            puVar11 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[uVar9];
            goto LAB_1402e0940;
          }
          uVar3 = (int)uVar9 + 1;
          uVar9 = (ulonglong)uVar3;
          plVar8 = plVar8 + 1;
        } while (uVar3 < *(uint *)(lVar5 + 0x78));
      }
    }
    puVar11 = (undefined4 *)0x0;
LAB_1402e0940:
    puVar12 = puVar11;
    if (puVar12 != (undefined4 *)0x0) {
      uVar2 = *puVar12;
      _eh_vector_constructor_iterator_
                (local_370,0x28,5,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
      _eh_vector_constructor_iterator_
                (local_2a8,0x28,5,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
      uVar4 = FUN_1402970c0(lVar5,L"szTrigger00");
      psVar6 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szTrigger00");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_370,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"szTrigger01");
      psVar6 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szTrigger01");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_348,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"szTrigger02");
      psVar6 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szTrigger02");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_320,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"szTrigger03");
      psVar6 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szTrigger03");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_2f8,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"szTrigger04");
      psVar6 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szTrigger04");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_2d0,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"wszName00");
      psVar6 = (short *)FUN_140296b70(lVar5,uVar2,uVar4,L"wszName00");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_2a8,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"wszName01");
      psVar6 = (short *)FUN_140296b70(lVar5,uVar2,uVar4,L"wszName01");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_280,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"wszName02");
      psVar6 = (short *)FUN_140296b70(lVar5,uVar2,uVar4,L"wszName02");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_258,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"wszName03");
      psVar6 = (short *)FUN_140296b70(lVar5,uVar2,uVar4,L"wszName03");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_230,psVar6,~uVar9 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"wszName04");
      psVar6 = (short *)FUN_140296b70(lVar5,uVar2,uVar4,L"wszName04");
      uVar9 = 0xffffffffffffffff;
      psVar10 = psVar6;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        sVar1 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_208,psVar6,~uVar9 - 1);
      local_1d8 = uVar2;
      local_1d0[0] = uVar2;
      _eh_vector_copy_constructor_iterator_(local_1c8,local_370,0x28,5,basic_string<>,FUN_14023be90)
      ;
      _eh_vector_copy_constructor_iterator_(local_100,local_2a8,0x28,5,basic_string<>,FUN_14023be90)
      ;
      FUN_1402e23a0(param_1,local_1d8,local_1d0);
      _eh_vector_destructor_iterator_(local_100,0x28,5,FUN_14023be90);
      _eh_vector_destructor_iterator_(local_1c8,0x28,5,FUN_14023be90);
      _eh_vector_destructor_iterator_(local_2a8,0x28,5,FUN_14023be90);
      _eh_vector_destructor_iterator_(local_370,0x28,5,FUN_14023be90);
      puVar11 = *(undefined4 **)(puVar12 + 6);
      if (puVar11 == (undefined4 *)0x0) {
        uVar3 = (uint)puVar12[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar7 = (longlong)(int)uVar3 << 3;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar7 + *(longlong *)(lVar5 + 0x68)) != 0) {
            puVar11 = *(undefined4 **)(lVar7 + *(longlong *)(lVar5 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar7 = lVar7 + 8;
        } while (puVar11 == (undefined4 *)0x0);
      }
      goto LAB_1402e0940;
    }
  }
  return;
}



longlong FUN_1402e0dc0(longlong param_1)

{
  _eh_vector_constructor_iterator_
            ((void *)(param_1 + 8),0x28,5,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  _eh_vector_constructor_iterator_
            ((void *)(param_1 + 0xd0),0x28,5,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  return param_1;
}



void FUN_1402e0e40(longlong param_1)

{
  _eh_vector_destructor_iterator_((void *)(param_1 + 0xd0),0x28,5,FUN_14023be90);
  _eh_vector_destructor_iterator_((void *)(param_1 + 8),0x28,5,FUN_14023be90);
  return;
}



void FUN_1402e0ea0(longlong param_1)

{
  _eh_vector_destructor_iterator_((void *)(param_1 + 0xd8),0x28,5,FUN_14023be90);
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x10),0x28,5,FUN_14023be90);
  return;
}



undefined * FUN_1402e0f00(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetQuestTriggerDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf44 & 1) == 0) {
    DAT_14060cf44 = DAT_14060cf44 | 1;
    FUN_1402e22d0(0x3f400000,0x3e800000,0x40100000);
    FUN_1402e0890(&DAT_14060a170);
    atexit((_func_5014 *)&LAB_140448ee0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetQuestTriggerDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060a170;
}



longlong * FUN_1402e0fc0(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) / 0x28;
  if (uVar1 != 0) {
    lVar7 = *param_1;
    uVar2 = (param_1[1] - lVar7) / 0x28;
    if (uVar2 < uVar1) {
      if ((ulonglong)((param_1[2] - lVar7) / 0x28) < uVar1) {
        if (lVar7 != 0) {
          FUN_140129370(lVar7,param_1[1]);
          operator_delete((void *)*param_1);
        }
        cVar3 = FUN_14015b060(param_1,(param_2[1] - *param_2) / 0x28);
        if (cVar3 == '\0') {
          return param_1;
        }
        lVar5 = *param_1;
        lVar7 = param_2[1];
        lVar6 = *param_2;
      }
      else {
        lVar6 = lVar5 + uVar2 * 0x28;
        FUN_1402e2560(lVar5,lVar6,lVar7);
        lVar5 = param_1[1];
        lVar7 = param_2[1];
      }
      lVar5 = FUN_1402e4bd0(lVar6,lVar7,lVar5);
      param_1[1] = lVar5;
    }
    else {
      uVar4 = FUN_1402e2560(lVar5,param_2[1],lVar7);
      FUN_140129370(uVar4,param_1[1]);
      param_1[1] = *param_1 + ((param_2[1] - *param_2) / 0x28) * 0x28;
    }
    return param_1;
  }
  FUN_1402e1160(param_1);
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x0001402e118b)
// WARNING: Removing unreachable block (ram,0x0001402e1190)

void FUN_1402e1160(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != param_1[1]) {
    FUN_140129370(lVar1,param_1[1]);
    param_1[1] = lVar1;
  }
  return;
}



void FUN_1402e11e0(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (*param_1 <= param_2)) {
    lVar2 = param_2 - *param_1;
    lVar2 = lVar2 / 6 + (lVar2 >> 0x3f);
    if (uVar1 == param_1[2]) {
      FUN_1402e13d0(param_1);
    }
    lVar2 = ((lVar2 >> 4) - (lVar2 >> 0x3f)) * 0x60 + *param_1;
    uVar1 = param_1[1];
    if (uVar1 != 0) {
      FUN_14015a040(uVar1,lVar2,param_3,param_4,uVar3);
      FUN_14015a040(uVar1 + 0x20,lVar2 + 0x20);
      FUN_14012e520(uVar1 + 0x40,lVar2 + 0x40);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_1402e13d0(param_1);
    }
    uVar1 = param_1[1];
    if (uVar1 != 0) {
      FUN_14015a040(uVar1,param_2,param_3,param_4,uVar3);
      FUN_14015a040(uVar1 + 0x20,param_2 + 0x20);
      FUN_14012e520(uVar1 + 0x40,param_2 + 0x40);
    }
  }
  param_1[1] = param_1[1] + 0x60;
  return;
}



void FUN_1402e1300(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (*param_1 <= param_2)) {
    lVar2 = param_2 - *param_1;
    lVar2 = lVar2 + SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar2),8);
    if (uVar1 == param_1[2]) {
      FUN_1402e14f0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1402df4a0(param_1[1],((lVar2 >> 8) - (lVar2 >> 0x3f)) * 0x150 + *param_1,param_3,param_4,
                    uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_1402e14f0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1402df4a0(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x150;
  return;
}



void FUN_1402e13d0(longlong *param_1)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = param_1[1] - *param_1;
  lVar2 = lVar2 / 6 + (lVar2 >> 0x3f);
  uVar4 = (lVar2 >> 4) - (lVar2 >> 0x3f);
  if (0x2aaaaaaaaaaaaa9 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  uVar3 = (param_1[2] - *param_1) / 0x60;
  if (uVar3 < uVar4) {
    if (0x2aaaaaaaaaaaaaa - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
      if (uVar4 != 0) {
        uVar3 = uVar4;
      }
      FUN_1402e1600(param_1,uVar3);
      return;
    }
    uVar3 = uVar3 + (uVar3 >> 1);
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_1402e1600(param_1,uVar3);
  }
  return;
}



void FUN_1402e1490(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0x60) {
      FUN_1402df1d0(lVar2);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1402e14f0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  longlong lVar3;
  ulonglong uVar4;
  
  lVar3 = param_1[1] - *param_1;
  lVar3 = lVar3 + SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar3),8);
  uVar4 = (lVar3 >> 8) - (lVar3 >> 0x3f);
  if (0xc30c30c30c30c2 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  lVar3 = param_1[2] - *param_1;
  lVar3 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar3),8) + lVar3;
  uVar2 = (lVar3 >> 8) - (lVar3 >> 0x3f);
  if (uVar2 < uVar4) {
    if (0xc30c30c30c30c3 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar4) {
      uVar2 = uVar4;
    }
    FUN_1402e1720(param_1,uVar2);
  }
  return;
}



void FUN_1402e15a0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0x150) {
      FUN_1402df330(lVar2);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1402e1600(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  code *pcVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  if (0x2aaaaaaaaaaaaaa < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x60) < param_2) {
    lVar3 = FUN_1402e1840(param_2);
    FUN_1402e4c60(*param_1,param_1[1],lVar3,param_4,uVar6);
    lVar1 = param_1[1];
    lVar5 = *param_1;
    lVar4 = lVar1 - lVar5;
    lVar4 = lVar4 / 6 + (lVar4 >> 0x3f);
    if (lVar5 != 0) {
      for (; lVar5 != lVar1; lVar5 = lVar5 + 0x60) {
        FUN_1402df1d0(lVar5);
      }
      operator_delete((void *)*param_1);
    }
    param_1[2] = param_2 * 0x60 + lVar3;
    param_1[1] = ((lVar4 >> 4) - (lVar4 >> 0x3f)) * 0x60 + lVar3;
    *param_1 = lVar3;
  }
  return;
}



void FUN_1402e1720(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  code *pcVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 uVar6;
  
  uVar6 = 0xfffffffffffffffe;
  if (0xc30c30c30c30c3 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  lVar4 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar4 >> 8) - (lVar4 >> 0x3f)) < param_2) {
    lVar3 = FUN_1402e18b0(param_2);
    FUN_1402e4ea0(*param_1,param_1[1],lVar3,param_4,uVar6);
    lVar1 = param_1[1];
    lVar5 = *param_1;
    lVar4 = lVar1 - lVar5;
    lVar4 = lVar4 + SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar4),8);
    if (lVar5 != 0) {
      for (; lVar5 != lVar1; lVar5 = lVar5 + 0x150) {
        FUN_1402df330(lVar5);
      }
      operator_delete((void *)*param_1);
    }
    param_1[2] = param_2 * 0x150 + lVar3;
    param_1[1] = ((lVar4 >> 8) - (lVar4 >> 0x3f)) * 0x150 + lVar3;
    *param_1 = lVar3;
  }
  return;
}



void * FUN_1402e1840(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0x2aaaaaaaaaaaaab) &&
     (pvVar1 = operator_new(param_1 * 0x60), 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_1405d3608);
}



void * FUN_1402e18b0(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0xc30c30c30c30c4) &&
     (pvVar1 = operator_new(param_1 * 0x150), 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_1405d3608);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402e1920(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060a22c = param_3;
  lVar1 = 0;
  _DAT_14060a220 = 0x11;
  _DAT_14060a244 = 10;
  _DAT_14060a224 = param_1;
  _DAT_14060a228 = param_2;
  param_3 = param_3 * 17.0;
  _DAT_14060a210 = 0;
  _DAT_14060a218 = 0;
  _DAT_14060a240 = 0;
  _DAT_14060a248 = 0;
  _DAT_14060a250 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  _DAT_14060a230 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  _DAT_14060a238 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    _DAT_14060a238 = 0;
  }
  return &DAT_14060a210;
}



uint * FUN_1402e19f0(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x90)) {
      if ((puVar2[0x92] == param_2) && (*puVar2 == param_2)) {
        FUN_1402e25c0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402e3c30(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_1402e25c0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_1402e1ac0(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 + 0x240);
        FUN_1402e2eb0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402e1b90(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x248) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x240); lVar4 != param_2;
        lVar4 = *(longlong *)(lVar4 + 0x240)) {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x240) = *(undefined8 *)(param_2 + 0x240);
      FUN_1402e2eb0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x240);
  FUN_1402e2eb0(param_1,param_2);
  return;
}



void FUN_1402e1c20(void)

{
  FUN_1402e1ac0(&DAT_14060a210);
  return;
}



uint * FUN_1402e1c40(longlong *param_1,uint param_2,uint *param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x1a)) {
      if ((puVar2[0x1c] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 + 2 != param_3) {
          FUN_14015b160(puVar2 + 2,param_3);
        }
        if (puVar2 + 10 != param_3 + 8) {
          FUN_14015b160();
        }
        FUN_14012bb70(puVar2 + 0x12,param_3 + 0x10);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402e3f50(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  if (puVar2 + 2 != param_3) {
    FUN_14015b160(puVar2 + 2,param_3);
  }
  if (puVar2 + 10 != param_3 + 8) {
    FUN_14015b160();
  }
  FUN_14012bb70(puVar2 + 0x12,param_3 + 0x10);
  return puVar2;
}



void FUN_1402e1d50(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 + 0x68);
        FUN_1402e2fd0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402e1e20(void)

{
  FUN_1402e1d50();
  return;
}



void FUN_1402e1e40(void)

{
  FUN_1402e3070();
  return;
}



uint * FUN_1402e1e60(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x62)) {
      if ((puVar2[100] == param_2) && (*puVar2 == param_2)) {
        FUN_1402e2880(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402e4330(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_1402e2880(puVar2 + 2,param_3);
  return puVar2;
}



uint * FUN_1402e1f30(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x62)) {
      if ((puVar2[100] == param_2) && (*puVar2 == param_2)) {
        FUN_1402e2ad0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402e44d0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_1402e2ad0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_1402e2000(void)

{
  FUN_1402e31d0();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402e2020(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060a1dc = param_3;
  lVar1 = 0;
  _DAT_14060a1d0 = 0x11;
  _DAT_14060a1f4 = 10;
  _DAT_14060a1d4 = param_1;
  _DAT_14060a1d8 = param_2;
  param_3 = param_3 * 17.0;
  _DAT_14060a1c0 = 0;
  _DAT_14060a1c8 = 0;
  _DAT_14060a1f0 = 0;
  _DAT_14060a1f8 = 0;
  _DAT_14060a200 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  _DAT_14060a1e0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  _DAT_14060a1e8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    _DAT_14060a1e8 = 0;
  }
  return &DAT_14060a1c0;
}



uint * FUN_1402e20f0(longlong *param_1,uint param_2,uint *param_3)

{
  char cVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  uVar3 = (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x16)) {
      if ((puVar2[0x18] == param_2) && (*puVar2 == param_2)) {
        puVar2[2] = *param_3;
        FUN_14012bb70(puVar2 + 4,param_3 + 2);
        FUN_1400015e0(puVar2 + 0xc,param_3 + 10,0,0xffffffffffffffff);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402e4720(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  puVar2[2] = *param_3;
  FUN_14012bb70(puVar2 + 4,param_3 + 2);
  FUN_1400015e0(puVar2 + 0xc,param_3 + 10,0,0xffffffffffffffff);
  return puVar2;
}



void FUN_1402e21e0(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 + 0x58);
        FUN_1402e33b0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402e22b0(void)

{
  FUN_1402e21e0(&DAT_14060a1c0);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402e22d0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060a18c = param_3;
  lVar1 = 0;
  _DAT_14060a180 = 0x11;
  _DAT_14060a1a4 = 10;
  _DAT_14060a184 = param_1;
  _DAT_14060a188 = param_2;
  param_3 = param_3 * 17.0;
  _DAT_14060a170 = 0;
  _DAT_14060a178 = 0;
  _DAT_14060a1a0 = 0;
  _DAT_14060a1a8 = 0;
  _DAT_14060a1b0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  _DAT_14060a190 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  _DAT_14060a198 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    _DAT_14060a198 = 0;
  }
  return &DAT_14060a170;
}



uint * FUN_1402e23a0(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x68)) {
      if ((puVar2[0x6a] == param_2) && (*puVar2 == param_2)) {
        FUN_1402e2d30(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402e4a50(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_1402e2d30(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_1402e2470(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 + 0x1a0);
        FUN_1402e3510(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402e2540(void)

{
  FUN_1402e2470(&DAT_14060a170);
  return;
}



longlong FUN_1402e2560(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x28) {
    FUN_140003d90(param_3,param_1,0,0xffffffffffffffff);
    param_3 = param_3 + 0x28;
  }
  return param_3;
}



undefined4 * FUN_1402e25c0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  FUN_14012bb70(param_1 + 0x2e,param_2 + 0x2e);
  FUN_14012bb70(param_1 + 0x36,param_2 + 0x36);
  FUN_14012bb70(param_1 + 0x3e,param_2 + 0x3e);
  if (param_1 + 0x46 != param_2 + 0x46) {
    FUN_14015b160();
  }
  FUN_1402e0fc0(param_1 + 0x4e,param_2 + 0x4e);
  param_1[0x56] = param_2[0x56];
  param_1[0x57] = param_2[0x57];
  param_1[0x58] = param_2[0x58];
  FUN_14012bb70(param_1 + 0x5a,param_2 + 0x5a);
  FUN_14012bb70(param_1 + 0x62,param_2 + 0x62);
  param_1[0x6a] = param_2[0x6a];
  param_1[0x6b] = param_2[0x6b];
  param_1[0x6c] = param_2[0x6c];
  param_1[0x6d] = param_2[0x6d];
  param_1[0x6e] = param_2[0x6e];
  *(undefined1 *)(param_1 + 0x6f) = *(undefined1 *)(param_2 + 0x6f);
  param_1[0x70] = param_2[0x70];
  param_1[0x71] = param_2[0x71];
  param_1[0x72] = param_2[0x72];
  FUN_1400015e0(param_1 + 0x74,param_2 + 0x74,0,0xffffffffffffffff);
  FUN_14012bb70(param_1 + 0x7e,param_2 + 0x7e);
  FUN_14012bb70(param_1 + 0x86,param_2 + 0x86);
  return param_1;
}



longlong FUN_1402e2880(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  char cVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong lVar8;
  ulonglong uVar9;
  ulonglong uVar10;
  longlong lVar11;
  longlong lVar12;
  
  plVar7 = (longlong *)(param_1 + 8);
  lVar11 = 0xc;
  lVar12 = param_2 - param_1;
  do {
    plVar2 = (longlong *)(lVar12 + -8 + (longlong)plVar7);
    plVar1 = plVar7 + -1;
    if (plVar1 != plVar2) {
      lVar4 = *plVar2;
      lVar5 = *(longlong *)(lVar12 + (longlong)plVar7) - lVar4;
      lVar5 = lVar5 / 6 + (lVar5 >> 0x3f);
      lVar8 = lVar5 >> 4;
      lVar5 = lVar5 >> 0x3f;
      uVar9 = lVar8 - lVar5;
      if (lVar8 == lVar5) {
        lVar4 = *plVar7;
        if (*plVar1 != lVar4) {
          lVar8 = FUN_1402e4ce0(lVar4,lVar4);
          lVar4 = *plVar7;
          for (lVar5 = lVar8; lVar5 != lVar4; lVar5 = lVar5 + 0x60) {
            FUN_1402df1d0(lVar5);
          }
          *plVar7 = lVar8;
        }
      }
      else {
        lVar5 = *plVar7;
        lVar8 = *plVar1;
        lVar6 = lVar5 - lVar8;
        lVar6 = lVar6 / 6 + (lVar6 >> 0x3f);
        uVar10 = (lVar6 >> 4) - (lVar6 >> 0x3f);
        if (uVar10 < uVar9) {
          if ((ulonglong)
              ((*(longlong *)(lVar12 + (longlong)plVar7 + (param_1 - param_2) + 8) - lVar8) / 0x60)
              < uVar9) {
            if (lVar8 != 0) {
              for (; lVar8 != lVar5; lVar8 = lVar8 + 0x60) {
                FUN_1402df1d0(lVar8);
              }
              operator_delete((void *)*plVar1);
            }
            cVar3 = FUN_1402e2dd0(plVar1,(plVar2[1] - *plVar2) / 0x60);
            if (cVar3 != '\0') {
              lVar4 = FUN_1402e4c60(*plVar2,plVar2[1],*plVar1);
              *plVar7 = lVar4;
            }
          }
          else {
            lVar5 = uVar10 * 0x60 + lVar4;
            FUN_1402e4ce0(lVar4,lVar5,lVar8);
            lVar4 = FUN_1402e4c60(lVar5,*(undefined8 *)(lVar12 + (longlong)plVar7),*plVar7);
            *plVar7 = lVar4;
          }
        }
        else {
          lVar5 = FUN_1402e4ce0(lVar4,*(longlong *)(lVar12 + (longlong)plVar7),lVar8);
          lVar4 = *plVar7;
          for (; lVar5 != lVar4; lVar5 = lVar5 + 0x60) {
            FUN_1402df1d0(lVar5);
          }
          *plVar7 = ((plVar2[1] - *plVar2) / 0x60) * 0x60 + *plVar1;
        }
      }
    }
    plVar7 = plVar7 + 4;
    lVar11 = lVar11 + -1;
  } while (lVar11 != 0);
  return param_1;
}



longlong FUN_1402e2ad0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  char cVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong lVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  longlong lVar12;
  
  plVar8 = (longlong *)(param_1 + 8);
  lVar4 = param_2 - param_1;
  lVar12 = 0xc;
  do {
    plVar2 = (longlong *)(lVar4 + -8 + (longlong)plVar8);
    plVar1 = plVar8 + -1;
    if (plVar1 != plVar2) {
      lVar6 = *plVar2;
      lVar5 = *(longlong *)(lVar4 + (longlong)plVar8) - lVar6;
      lVar5 = lVar5 + SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar5),8);
      lVar9 = lVar5 >> 8;
      lVar5 = lVar5 >> 0x3f;
      uVar10 = lVar9 - lVar5;
      if (lVar9 == lVar5) {
        lVar5 = *plVar8;
        if (*plVar1 != lVar5) {
          lVar9 = FUN_1402e4d70(lVar5,lVar5);
          lVar5 = *plVar8;
          for (lVar6 = lVar9; lVar6 != lVar5; lVar6 = lVar6 + 0x150) {
            FUN_1402df330(lVar6);
          }
          *plVar8 = lVar9;
        }
      }
      else {
        lVar9 = *plVar8;
        lVar7 = *plVar1;
        lVar5 = lVar9 - lVar7;
        lVar5 = lVar5 + SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar5),8);
        uVar11 = (lVar5 >> 8) - (lVar5 >> 0x3f);
        if (uVar11 < uVar10) {
          lVar5 = *(longlong *)(lVar4 + (longlong)plVar8 + (param_1 - param_2) + 8) - lVar7;
          lVar5 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar5),8) + lVar5;
          if ((ulonglong)((lVar5 >> 8) - (lVar5 >> 0x3f)) < uVar10) {
            if (lVar7 != 0) {
              for (; lVar7 != lVar9; lVar7 = lVar7 + 0x150) {
                FUN_1402df330(lVar7);
              }
              operator_delete((void *)*plVar1);
            }
            lVar5 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(plVar2[1] - *plVar2),8) +
                    (plVar2[1] - *plVar2);
            cVar3 = FUN_1402e2e40(plVar1,(lVar5 >> 8) - (lVar5 >> 0x3f));
            if (cVar3 != '\0') {
              lVar5 = FUN_1402e4ea0(*plVar2,plVar2[1],*plVar1);
              *plVar8 = lVar5;
            }
          }
          else {
            lVar5 = uVar11 * 0x150 + lVar6;
            FUN_1402e4d70(lVar6,lVar5,lVar7);
            lVar5 = FUN_1402e4ea0(lVar5,*(undefined8 *)(lVar4 + (longlong)plVar8),*plVar8);
            *plVar8 = lVar5;
          }
        }
        else {
          lVar6 = FUN_1402e4d70(lVar6,*(longlong *)(lVar4 + (longlong)plVar8),lVar7);
          lVar5 = *plVar8;
          for (; lVar6 != lVar5; lVar6 = lVar6 + 0x150) {
            FUN_1402df330(lVar6);
          }
          lVar5 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(plVar2[1] - *plVar2),8) +
                  (plVar2[1] - *plVar2);
          *plVar8 = ((lVar5 >> 8) - (lVar5 >> 0x3f)) * 0x150 + *plVar1;
        }
      }
    }
    plVar8 = plVar8 + 4;
    lVar12 = lVar12 + -1;
  } while (lVar12 != 0);
  return param_1;
}



undefined4 * FUN_1402e2d30(undefined4 *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar3 = 5;
  puVar1 = param_1 + 2;
  *param_1 = *param_2;
  lVar2 = 5;
  do {
    FUN_1400015e0(puVar1,((longlong)param_2 - (longlong)param_1) + (longlong)puVar1,0,
                  0xffffffffffffffff);
    puVar1 = puVar1 + 10;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  puVar1 = param_1 + 0x34;
  do {
    FUN_1400015e0(puVar1,(longlong)puVar1 + ((longlong)param_2 - (longlong)param_1),0,
                  0xffffffffffffffff);
    puVar1 = puVar1 + 10;
    lVar3 = lVar3 + -1;
  } while (lVar3 != 0);
  return param_1;
}



undefined8 FUN_1402e2dd0(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 (0x2aaaaaaaaaaaaaa < param_2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      uVar2 = (*pcVar1)();
      return uVar2;
    }
    lVar3 = FUN_1402e1840(param_2);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    uVar2 = 1;
    param_1[2] = param_2 * 0x60 + lVar3;
  }
  return uVar2;
}



undefined8 FUN_1402e2e40(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 (0xc30c30c30c30c3 < param_2) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      uVar2 = (*pcVar1)();
      return uVar2;
    }
    lVar3 = FUN_1402e18b0(param_2);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    uVar2 = 1;
    param_1[2] = param_2 * 0x150 + lVar3;
  }
  return uVar2;
}



void FUN_1402e2eb0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1402defd0(param_2 + 8);
  *(undefined8 *)(param_2 + 0x240) = *(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_1402cddb0(param_1);
    FUN_1402e3a80(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_1402e2f50(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x70) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x68); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x68))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x68) = *(undefined8 *)(param_2 + 0x68);
      FUN_1402e2fd0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x68);
  FUN_1402e2fd0(param_1,param_2);
  return;
}



void FUN_1402e2fd0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1402df1d0(param_2 + 8);
  *(undefined8 *)(param_2 + 0x68) = *(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_1402cddb0(param_1);
    FUN_1402e3da0(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_1402e3070(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 + 0x188);
        FUN_1402e4280(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402e31d0(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 + 0x188);
        FUN_1402e4670(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402e3330(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x60) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x58); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x58))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x58) = *(undefined8 *)(param_2 + 0x58);
      FUN_1402e33b0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x58);
  FUN_1402e33b0(param_1,param_2);
  return;
}



void FUN_1402e33b0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (7 < *(ulonglong *)(param_2 + 0x48)) {
    operator_delete(*(void **)(param_2 + 0x30));
  }
  *(undefined8 *)(param_2 + 0x48) = 7;
  *(undefined8 *)(param_2 + 0x40) = 0;
  *(undefined2 *)(param_2 + 0x30) = 0;
  if (*(void **)(param_2 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_2 + 0x10));
  }
  *(undefined8 *)(param_2 + 0x10) = 0;
  *(undefined8 *)(param_2 + 0x18) = 0;
  *(undefined8 *)(param_2 + 0x20) = 0;
  *(undefined8 *)(param_2 + 0x58) = *(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_1402cddb0(param_1);
    FUN_14031ffb0(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_1402e3480(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x1a8) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x1a0); lVar4 != param_2;
        lVar4 = *(longlong *)(lVar4 + 0x1a0)) {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x1a0) = *(undefined8 *)(param_2 + 0x1a0);
      FUN_1402e3510(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x1a0);
  FUN_1402e3510(param_1,param_2);
  return;
}



void FUN_1402e3510(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  _eh_vector_destructor_iterator_((void *)(param_2 + 0xd8),0x28,5,FUN_14023be90);
  _eh_vector_destructor_iterator_((void *)(param_2 + 0x10),0x28,5,FUN_14023be90);
  *(undefined8 *)(param_2 + 0x1a0) = *(undefined8 *)(param_1 + 0x40);
  *(longlong *)(param_1 + 0x40) = param_2;
  *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + -1;
  if ((*(ulonglong *)(param_1 + 8) < *(ulonglong *)(param_1 + 0x28)) &&
     (*(int *)(param_1 + 0x30) == 0)) {
    uVar2 = FUN_1402cddb0(param_1);
    FUN_1402e48a0(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;
}



undefined4 * FUN_1402e3600(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_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff,0xfffffffffffffffe);
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  FUN_14012e520(param_1 + 0x2e,param_2 + 0x2e);
  FUN_14012e520(param_1 + 0x36,param_2 + 0x36);
  FUN_14012e520(param_1 + 0x3e,param_2 + 0x3e);
  FUN_14015a040(param_1 + 0x46,param_2 + 0x46);
  FUN_1402e3900(param_1 + 0x4e,param_2 + 0x4e);
  param_1[0x56] = param_2[0x56];
  param_1[0x57] = param_2[0x57];
  param_1[0x58] = param_2[0x58];
  FUN_14012e520(param_1 + 0x5a,param_2 + 0x5a);
  FUN_14012e520(param_1 + 0x62,param_2 + 0x62);
  param_1[0x6a] = param_2[0x6a];
  param_1[0x6b] = param_2[0x6b];
  param_1[0x6c] = param_2[0x6c];
  param_1[0x6d] = param_2[0x6d];
  param_1[0x6e] = param_2[0x6e];
  *(undefined1 *)(param_1 + 0x6f) = *(undefined1 *)(param_2 + 0x6f);
  param_1[0x70] = param_2[0x70];
  param_1[0x71] = param_2[0x71];
  param_1[0x72] = param_2[0x72];
  *(undefined8 *)(param_1 + 0x7a) = 7;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined2 *)(param_1 + 0x74) = 0;
  FUN_1400015e0(param_1 + 0x74,param_2 + 0x74,0,0xffffffffffffffff);
  FUN_14012e520(param_1 + 0x7e,param_2 + 0x7e);
  FUN_14012e520(param_1 + 0x86,param_2 + 0x86);
  return param_1;
}



undefined8 *
FUN_1402e3900(undefined8 *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  cVar1 = FUN_14015b060(param_1,(param_2[1] - *param_2) / 0x28,param_2[1] - *param_2,param_4,
                        0xfffffffffffffffe);
  if (cVar1 != '\0') {
    uVar2 = FUN_1402e4f00(*param_2,param_2[1],*param_1);
    param_1[1] = uVar2;
  }
  return param_1;
}



undefined8 *
FUN_1402e3980(undefined8 *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  cVar1 = FUN_1402e2dd0(param_1,(param_2[1] - *param_2) / 0x60,param_2[1] - *param_2,param_4,
                        0xfffffffffffffffe);
  if (cVar1 != '\0') {
    uVar2 = FUN_1402e4f90(*param_2,param_2[1],*param_1);
    param_1[1] = uVar2;
  }
  return param_1;
}



undefined8 *
FUN_1402e3a00(undefined8 *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  char cVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  lVar4 = param_2[1] - *param_2;
  lVar3 = SUB168(SEXT816(-0x3cf3cf3cf3cf3cf3) * SEXT816(lVar4),8) + lVar4;
  cVar1 = FUN_1402e2e40(param_1,(lVar3 >> 8) - (lVar3 >> 0x3f),lVar4,param_4,0xfffffffffffffffe);
  if (cVar1 != '\0') {
    uVar2 = FUN_1402e5030(*param_2,param_2[1],*param_1);
    param_1[1] = uVar2;
  }
  return param_1;
}



void FUN_1402e3a80(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x240);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x248) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x240) = *(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_1402e3c30(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) < 0x250)
      goto LAB_1402e3cfd;
      lVar7 = uVar6 * 0x250;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402e3cfd:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x4a + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x48] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x4a;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x90);
  *puVar2 = param_2;
  FUN_1402deee0(puVar2 + 2);
  puVar2[0x92] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x90) = *(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_1402cddb0(param_1);
    FUN_1402e3a80(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402e3da0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x68);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x70) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x68) = *(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_1402e3f50(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) < 0x78)
      goto LAB_1402e4017;
      lVar7 = uVar6 * 0x78;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402e4017:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0xf + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0xd] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0xf;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x1a);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 2) = 0;
  *(undefined8 *)(puVar2 + 4) = 0;
  *(undefined8 *)(puVar2 + 6) = 0;
  *(undefined8 *)(puVar2 + 10) = 0;
  *(undefined8 *)(puVar2 + 0xc) = 0;
  *(undefined8 *)(puVar2 + 0xe) = 0;
  *(undefined8 *)(puVar2 + 0x12) = 0;
  *(undefined8 *)(puVar2 + 0x14) = 0;
  *(undefined8 *)(puVar2 + 0x16) = 0;
  puVar2[0x1c] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x1a) = *(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_1402cddb0(param_1);
    FUN_1402e3da0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402e40d0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x188);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 400) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x188) = *(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_1402e4280(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  _eh_vector_destructor_iterator_
            ((void *)(param_2 + 8),0x20,0xc,(_func_void_void_ptr *)&LAB_1402e11d0);
  *(undefined8 *)(param_2 + 0x188) = *(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_1402cddb0(param_1);
    FUN_1402e40d0(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;
}



undefined4 *
FUN_1402e4330(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) < 0x198)
      goto LAB_1402e43fd;
      lVar7 = uVar6 * 0x198;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402e43fd:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x33 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x31] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x33;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x62);
  *puVar2 = param_2;
  _eh_vector_constructor_iterator_
            (puVar2 + 2,0x20,0xc,(_func_void_void_ptr *)&LAB_140147020,
             (_func_void_void_ptr *)&LAB_1402e11d0);
  puVar2[100] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x62) = *(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_1402cddb0(param_1);
    FUN_1402e40d0(param_1,uVar4);
  }
  return puVar2;
}



undefined4 *
FUN_1402e44d0(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) < 0x198)
      goto LAB_1402e459d;
      lVar7 = uVar6 * 0x198;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402e459d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x33 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x31] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x33;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x62);
  *puVar2 = param_2;
  _eh_vector_constructor_iterator_
            (puVar2 + 2,0x20,0xc,(_func_void_void_ptr *)&LAB_140147020,
             (_func_void_void_ptr *)&LAB_1402e12f0);
  puVar2[100] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x62) = *(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_1402cddb0(param_1);
    FUN_1402e40d0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402e4670(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  _eh_vector_destructor_iterator_
            ((void *)(param_2 + 8),0x20,0xc,(_func_void_void_ptr *)&LAB_1402e12f0);
  *(undefined8 *)(param_2 + 0x188) = *(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_1402cddb0(param_1);
    FUN_1402e40d0(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;
}



undefined4 *
FUN_1402e4720(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) < 0x68)
      goto LAB_1402e47e7;
      lVar7 = uVar6 * 0x68;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402e47e7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0xd + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0xb] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0xd;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x16);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 4) = 0;
  *(undefined8 *)(puVar2 + 6) = 0;
  *(undefined8 *)(puVar2 + 8) = 0;
  *(undefined8 *)(puVar2 + 0x12) = 7;
  *(undefined8 *)(puVar2 + 0x10) = 0;
  *(undefined2 *)(puVar2 + 0xc) = 0;
  puVar2[0x18] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x16) = *(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_1402cddb0(param_1);
    FUN_14031ffb0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402e48a0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x1a0);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x1a8) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x1a0) = *(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_1402e4a50(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) < 0x1b0)
      goto LAB_1402e4b1d;
      lVar7 = uVar6 * 0x1b0;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402e4b1d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x36 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x34] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x36;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x68);
  *puVar2 = param_2;
  FUN_1402e0dc0(puVar2 + 2);
  puVar2[0x6a] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x68) = *(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_1402cddb0(param_1);
    FUN_1402e48a0(param_1,uVar4);
  }
  return puVar2;
}



undefined1 * FUN_1402e4bd0(longlong param_1,longlong param_2,undefined1 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  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_140003d90(param_3,param_1,0,0xffffffffffffffff,uVar1);
    }
    param_3 = param_3 + 0x28;
  }
  return param_3;
}



longlong FUN_1402e4c60(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x60) {
    if (param_3 != 0) {
      FUN_14015a040(param_3,param_1);
      FUN_14015a040(param_3 + 0x20,param_1 + 0x20);
      FUN_14012e520(param_3 + 0x40,param_1 + 0x40);
    }
    param_3 = param_3 + 0x60;
  }
  return param_3;
}



longlong FUN_1402e4ce0(longlong param_1,longlong param_2,longlong param_3)

{
  longlong lVar1;
  
  if (param_1 != param_2) {
    lVar1 = param_3 + 0x20;
    do {
      if (param_3 != param_1) {
        FUN_14015b160(param_3,param_1);
      }
      if (lVar1 != param_1 + 0x20) {
        FUN_14015b160(lVar1,param_1 + 0x20);
      }
      FUN_14012bb70(lVar1 + 0x20,param_1 + 0x40);
      param_1 = param_1 + 0x60;
      param_3 = param_3 + 0x60;
      lVar1 = lVar1 + 0x60;
    } while (param_1 != param_2);
  }
  return param_3;
}



undefined4 * FUN_1402e4d70(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;
      FUN_1400015e0(param_3 + 4,puVar2 + 2,0,0xffffffffffffffff);
      FUN_1400015e0(param_3 + 0xe,puVar2 + 0xc);
      FUN_1400015e0(param_3 + 0x18,puVar2 + 0x16);
      FUN_1400015e0(param_3 + 0x22,puVar2 + 0x20);
      FUN_1400015e0(param_3 + 0x2c,puVar2 + 0x2a);
      FUN_1400015e0(param_3 + 0x36,puVar2 + 0x34);
      FUN_1400015e0(param_3 + 0x40,puVar2 + 0x3e);
      FUN_1400015e0(param_3 + 0x4a,puVar2 + 0x48);
      param_3 = param_3 + 0x54;
      puVar1 = puVar2 + 0x52;
      puVar2 = puVar2 + 0x54;
    } while (puVar1 != param_2);
  }
  return param_3;
}



longlong FUN_1402e4ea0(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x150) {
    if (param_3 != 0) {
      FUN_1402df4a0(param_3,param_1);
    }
    param_3 = param_3 + 0x150;
  }
  return param_3;
}



undefined1 * FUN_1402e4f00(longlong param_1,longlong param_2,undefined1 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  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_140003d90(param_3,param_1,0,0xffffffffffffffff,uVar1,param_3,param_3);
    }
    param_3 = param_3 + 0x28;
  }
  return param_3;
}



longlong FUN_1402e4f90(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x60) {
    if (param_3 != 0) {
      FUN_14015a040(param_3,param_1);
      FUN_14015a040(param_3 + 0x20,param_1 + 0x20);
      FUN_14012e520(param_3 + 0x40,param_1 + 0x40);
    }
    param_3 = param_3 + 0x60;
  }
  return param_3;
}



longlong FUN_1402e5030(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x150) {
    if (param_3 != 0) {
      FUN_1402df4a0(param_3,param_1);
    }
    param_3 = param_3 + 0x150;
  }
  return param_3;
}



undefined4 * FUN_1402e50b0(undefined4 *param_1)

{
  *param_1 = 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;
  *(undefined8 *)(param_1 + 0xe) = 7;
  *(undefined8 *)(param_1 + 0xc) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 0x12) = 0;
  param_1[0x13] = 0;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 0x1a) = 0;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  *(undefined8 *)(param_1 + 0x1e) = 0;
  *(undefined1 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x21) = 0;
  *(undefined8 *)(param_1 + 0x23) = 0;
  *(undefined8 *)(param_1 + 0x25) = 0;
  *(undefined8 *)(param_1 + 0x27) = 0;
  *(undefined8 *)(param_1 + 0x29) = 0;
  *(undefined8 *)(param_1 + 0x2b) = 0;
  *(undefined8 *)(param_1 + 0x2d) = 0;
  *(undefined8 *)(param_1 + 0x2f) = 0;
  *(undefined8 *)(param_1 + 0x31) = 0;
  *(undefined8 *)(param_1 + 0x33) = 0;
  *(undefined8 *)(param_1 + 0x36) = 0;
  param_1[0x16] = 1;
  return param_1;
}



undefined8 FUN_1402e5190(longlong param_1,int param_2,longlong *param_3,int param_4)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  longlong *plVar4;
  int iVar5;
  undefined8 uVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  longlong lVar10;
  
  lVar7 = *param_3;
  if (lVar7 == 0) {
    plVar4 = (longlong *)param_3[1];
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar4 + 1;
      lVar7 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar7 == 1) {
        (**(code **)(*plVar4 + 8))(plVar4);
        LOCK();
        piVar2 = (int *)((longlong)plVar4 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    uVar6 = 0;
  }
  else {
    iVar3 = *(int *)(param_1 + 0x4c);
    if (iVar3 < param_4) {
      if (((iVar3 < 1) || (*(int *)(lVar7 + 0x38) <= iVar3)) ||
         (*(char *)((longlong)iVar3 * 0x80 + -0x28 + *(longlong *)(lVar7 + 0x40)) != '\x01')) {
        uVar6 = 0;
        do {
          lVar7 = *param_3;
          iVar3 = *(int *)(param_1 + 0x4c);
          if (iVar3 < 1) {
            lVar9 = 0;
          }
          else if (iVar3 < *(int *)(lVar7 + 0x38)) {
            lVar9 = *(longlong *)((longlong)iVar3 * 0x80 + -0x78 + *(longlong *)(lVar7 + 0x40));
          }
          else {
            lVar9 = -1;
          }
          lVar8 = 0;
          if ((1 < iVar3) && (iVar5 = iVar3 + -1, 0 < iVar5)) {
            if (iVar5 < *(int *)(lVar7 + 0x38)) {
              lVar8 = *(longlong *)((longlong)iVar5 * 0x80 + -0x78 + *(longlong *)(lVar7 + 0x40));
            }
            else {
              lVar8 = -1;
            }
          }
          lVar7 = *(longlong *)(param_1 + 0x50);
          if (lVar9 < *(longlong *)(param_1 + 0x50)) {
            lVar7 = lVar9;
          }
          *(longlong *)(param_1 + 0x50) = lVar7;
          lVar10 = (longlong)param_2;
          if (lVar9 < lVar7 + lVar10) {
            lVar10 = lVar9 - lVar7;
            param_2 = param_2 + ((int)lVar7 - (int)lVar9);
          }
          else {
            param_2 = 0;
          }
          *(longlong *)(param_1 + 0x50) = *(longlong *)(param_1 + 0x50) + lVar10;
          if ((lVar9 == lVar8 || lVar9 - lVar8 < 0) || (*(longlong *)(param_1 + 0x50) < lVar9))
          break;
          *(int *)(param_1 + 0x4c) = iVar3 + 1;
          uVar6 = 1;
        } while (iVar3 + 1 < param_4);
        plVar4 = (longlong *)param_3[1];
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar4 + 1;
          lVar7 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)lVar7 == 1) {
            (**(code **)(*plVar4 + 8))(plVar4);
            LOCK();
            piVar2 = (int *)((longlong)plVar4 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar4 + 0x10))(plVar4);
            }
          }
        }
      }
      else {
        FUN_14033a390(param_3);
        uVar6 = 2;
      }
    }
    else {
      plVar4 = (longlong *)param_3[1];
      if (plVar4 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar4 + 1;
        lVar7 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)lVar7 == 1) {
          (**(code **)(*plVar4 + 8))(plVar4);
          LOCK();
          piVar2 = (int *)((longlong)plVar4 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar4 + 0x10))(plVar4);
          }
        }
      }
      uVar6 = 2;
    }
  }
  return uVar6;
}



int FUN_1402e5360(longlong param_1)

{
  if (*(float **)(param_1 + 0xd8) == (float *)0x0) {
    return 1;
  }
  return (int)((float)*(int *)(param_1 + 0x84) * **(float **)(param_1 + 0xd8) +
              (float)*(int *)(param_1 + 0xa8));
}



int FUN_1402e53a0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0xd8) == 0) {
    return 1;
  }
  return (int)((float)*(int *)(param_1 + 0x88) * *(float *)(*(longlong *)(param_1 + 0xd8) + 4) +
              (float)*(int *)(param_1 + 0xac));
}



// WARNING: Removing unreachable block (ram,0x0001402e5489)
// WARNING: Removing unreachable block (ram,0x0001402e5492)
// WARNING: Removing unreachable block (ram,0x0001402e54b3)
// WARNING: Removing unreachable block (ram,0x0001402e54bc)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_1402e53e0(void)

{
  DAT_14060aa60 = 0;
  _DAT_14060aa68 = 0;
  DAT_14060aa70 = 0x11;
  _DAT_14060aa90 = 0;
  _DAT_14060aa94 = 10;
  _DAT_14060aa98 = 0;
  _DAT_14060aaa0 = 0;
  _DAT_14060aa74 = 0x3f400000;
  _DAT_14060aa78 = 0x3e800000;
  _DAT_14060aa7c = 0x40100000;
  _DAT_14060aa80 = 0x26;
  _DAT_14060aa88 = 0;
  _DAT_14060aaa8 = 0;
  _DAT_14060aab0 = 0;
  _DAT_14060aab8 = 0x11;
  _DAT_14060aad8 = 0;
  _DAT_14060aadc = 10;
  _DAT_14060aae0 = 0;
  _DAT_14060aae8 = 0;
  _DAT_14060aabc = 0x3f400000;
  _DAT_14060aac0 = 0x3e800000;
  _DAT_14060aac4 = 0x40100000;
  _DAT_14060aad0 = 0;
  _DAT_14060aac8 = _DAT_14060aa80;
  FUN_1402ca220(&DAT_14060aaf0,0x26,0x3f400000,0x3e800000,0xfffffffffffffffe);
  _DAT_14060ab30 = 0;
  _DAT_14060ab38 = 0;
  _DAT_14060ab40 = 0;
  FUN_1402e5580();
  return &DAT_14060aa60;
}



void thunk_FUN_1402e9500(void)

{
  FUN_1402e9500();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

void FUN_1402e5580(void)

{
  short sVar1;
  ushort uVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined *puVar5;
  code *pcVar6;
  ushort *puVar7;
  uint uVar8;
  undefined4 uVar9;
  int iVar10;
  longlong lVar11;
  longlong lVar12;
  short *psVar13;
  uint *puVar14;
  undefined4 *puVar15;
  int *piVar16;
  float *pfVar17;
  undefined4 *puVar18;
  longlong lVar19;
  longlong *plVar20;
  ulonglong uVar21;
  ulonglong uVar22;
  wchar_t *pwVar23;
  ushort *puVar24;
  ulonglong uVar25;
  ulonglong uVar26;
  ulonglong uVar27;
  ulonglong uVar28;
  undefined2 *puVar29;
  undefined4 *puVar30;
  undefined4 *puVar31;
  short *******pppppppsVar32;
  ulonglong uVar33;
  ulonglong uVar34;
  short *psVar35;
  undefined4 *puVar36;
  short *******pppppppsVar37;
  undefined **ppuVar38;
  undefined4 *puVar39;
  undefined1 auStack_9a8 [32];
  undefined1 local_988;
  uint local_978 [2];
  undefined4 *local_970;
  void *local_968;
  longlong local_960;
  undefined8 local_958;
  void *local_948;
  longlong local_940;
  undefined8 local_938;
  void *local_928;
  longlong local_920;
  undefined8 local_918;
  void *local_908;
  longlong local_900;
  undefined8 local_8f8;
  void *local_8e8;
  longlong local_8e0;
  undefined8 local_8d8;
  void *local_8c8;
  longlong local_8c0;
  undefined8 local_8b8;
  void *local_8a8;
  longlong local_8a0;
  undefined8 local_898;
  void *local_888;
  longlong local_880;
  undefined8 local_878;
  longlong local_868;
  longlong local_860;
  undefined8 local_858;
  undefined1 local_850 [24];
  ushort local_838;
  undefined6 uStack_836;
  longlong local_828;
  ulonglong local_820;
  undefined2 local_810;
  undefined6 uStack_80e;
  undefined8 local_800;
  ulonglong local_7f8;
  undefined2 local_7e8;
  undefined6 uStack_7e6;
  undefined8 local_7d8;
  ulonglong local_7d0;
  undefined2 local_7c0;
  undefined6 uStack_7be;
  undefined8 local_7b0;
  ulonglong local_7a8;
  undefined2 local_798;
  undefined6 uStack_796;
  undefined8 local_788;
  ulonglong local_780;
  undefined2 local_770;
  undefined6 uStack_76e;
  undefined8 local_760;
  ulonglong local_758;
  undefined2 local_748;
  undefined6 uStack_746;
  undefined8 local_738;
  ulonglong local_730;
  undefined2 local_720;
  undefined6 uStack_71e;
  undefined8 local_710;
  ulonglong local_708;
  undefined4 local_6f8 [2];
  short *******local_6f0 [3];
  ulonglong local_6d8;
  undefined1 local_6c8 [40];
  undefined1 local_6a0 [16];
  longlong local_690;
  uint local_678;
  undefined4 local_674;
  undefined4 local_670;
  undefined4 local_66c;
  undefined4 local_668;
  undefined4 local_664;
  undefined4 local_660;
  undefined4 local_65c;
  undefined4 local_658;
  undefined4 local_654;
  undefined1 local_650 [40];
  undefined1 local_628 [40];
  undefined4 local_600;
  undefined4 local_5fc;
  undefined4 local_5f8;
  undefined4 local_5f4;
  undefined4 local_5f0;
  undefined4 local_5ec;
  undefined4 local_5e8;
  undefined4 local_5e4;
  undefined4 local_5e0;
  undefined4 local_5dc;
  undefined4 local_5d8;
  undefined4 local_5d4;
  undefined4 local_5d0;
  undefined4 local_5cc;
  undefined4 local_5c8;
  undefined4 local_5c4;
  uint *local_5c0;
  uint *local_5b8;
  uint *local_5b0;
  uint *local_5a0;
  uint *local_598;
  uint *local_590;
  uint *local_580;
  uint *local_578;
  uint *local_570;
  uint *local_560;
  uint *local_558;
  uint *local_550;
  undefined4 local_540;
  uint *local_538;
  uint *local_530;
  uint *local_528;
  uint *local_518;
  uint *local_510;
  uint *local_508;
  uint *local_4f8;
  uint *local_4f0;
  uint *local_4e8;
  int *local_4d8;
  int *local_4d0;
  int *local_4c8;
  undefined4 local_4b8 [10];
  undefined4 local_490;
  undefined4 local_48c;
  uint *local_488;
  uint *local_480;
  uint *local_478;
  uint *local_468;
  uint *local_460;
  uint *local_458;
  uint *local_448;
  uint *local_440;
  uint *local_438;
  undefined4 local_428;
  undefined4 local_424;
  undefined4 local_420;
  uint *local_418;
  uint *local_410;
  uint *local_408;
  undefined4 local_3f8;
  undefined2 local_3e8;
  undefined6 uStack_3e6;
  undefined8 local_3d8;
  ulonglong local_3d0;
  undefined2 local_3c0;
  undefined6 uStack_3be;
  undefined8 local_3b0;
  ulonglong local_3a8;
  undefined4 local_398;
  undefined2 local_390;
  undefined6 uStack_38e;
  undefined8 local_380;
  ulonglong local_378;
  undefined4 local_368;
  undefined4 local_358;
  undefined1 local_350 [776];
  ulonglong local_48;
  
  local_858 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_9a8;
  lVar11 = FUN_1402933b0(DAT_140607ff0,L"NPC_INSTANCE_STRING");
  if ((lVar11 != 0) &&
     (local_868 = lVar11, lVar12 = FUN_1402933b0(DAT_140607ff0,L"NPC_INSTANCE"), lVar12 != 0)) {
    puVar15 = (undefined4 *)0x0;
    local_860 = lVar12;
    if ((*(longlong *)(lVar12 + 0x70) != 0) && (*(uint *)(lVar12 + 0x78) != 0)) {
      puVar18 = puVar15;
      plVar20 = *(longlong **)(lVar12 + 0x68);
      do {
        if (*plVar20 != 0) {
          puVar15 = (undefined4 *)(*(longlong **)(lVar12 + 0x68))[(longlong)puVar18];
          break;
        }
        uVar8 = (int)puVar18 + 1;
        puVar18 = (undefined4 *)(ulonglong)uVar8;
        plVar20 = plVar20 + 1;
      } while (uVar8 < *(uint *)(lVar12 + 0x78));
    }
LAB_1402e5646:
    uVar22 = 0;
    if (puVar15 != (undefined4 *)0x0) {
      uVar3 = *puVar15;
      local_970 = puVar15;
      FUN_1402e8290(local_6f8);
      local_6f8[0] = uVar3;
      uVar9 = FUN_1402970c0(lVar11,L"wszDesc");
      local_988 = 1;
      psVar13 = (short *)FUN_140296b70(lVar11,uVar3,uVar9,L"wszDesc");
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_6c8,psVar13,~uVar21 - 1);
      uVar9 = FUN_1402970c0(lVar12,L"szName");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szName");
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_6f0,psVar13,~uVar21 - 1);
      uVar9 = FUN_1402970c0(lVar12,L"szGroupName");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szGroupName");
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_6a0,psVar13,~uVar21 - 1);
      uVar9 = FUN_1402970c0(lVar12,L"nGroup");
      local_988 = 1;
      puVar14 = (uint *)FUN_140296600(lVar12,uVar3,uVar9,L"nGroup");
      local_678 = *puVar14;
      uVar9 = FUN_1402970c0(lVar12,L"nNPCRole");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nNPCRole");
      local_664 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nNpcID");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nNpcID");
      local_674 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nLevel");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nLevel");
      local_670 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nHPClass");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nHPClass");
      local_66c = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nMPClass");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nMPClass");
      local_668 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"fHPRevision");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar12,uVar3,uVar9,L"fHPRevision");
      local_660 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"fMPRevision");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar12,uVar3,uVar9,L"fMPRevision");
      local_65c = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"fMove01Speed");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar12,uVar3,uVar9,L"fMove01Speed");
      local_658 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"fMove02Speed");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar12,uVar3,uVar9,L"fMove02Speed");
      local_654 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"szAI");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szAI");
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_650,psVar13,~uVar21 - 1);
      uVar9 = FUN_1402970c0(lVar12,L"szSpriteName");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szSpriteName");
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_628,psVar13,~uVar21 - 1);
      uVar9 = FUN_1402970c0(lVar12,L"nSkillFrantz00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nSkillFrantz00");
      local_600 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nSkillAngela00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nSkillAngela00");
      local_5fc = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nSkillTude00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nSkillTude00");
      local_5f8 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nSkillNatacha00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nSkillNatacha00");
      local_5f4 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nskillGroupFrantz00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nskillGroupFrantz00");
      local_5f0 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nskillGroupAngela00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nskillGroupAngela00");
      local_5ec = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nskillGroupTude00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nskillGroupTude00");
      local_5e8 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nskillGroupNatacha00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nskillGroupNatacha00");
      local_5e4 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nskillGroupGuild00");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nskillGroupGuild00");
      local_5e0 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nShopType");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nShopType");
      local_5dc = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nShopTitleStringID");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nShopTitleStringID");
      local_5d8 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nShopSubType");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nShopSubType");
      local_5d4 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nSummaryDialog");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nSummaryDialog");
      local_540 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nLookAtType");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nLookAtType");
      local_490 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"fLookAtRange");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar12,uVar3,uVar9,L"fLookAtRange");
      local_48c = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nTradeShopTitle");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nTradeShopTitle");
      local_428 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nRuneMachineGroup");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nRuneMachineGroup");
      local_420 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nTradeWindowType");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nTradeWindowType");
      local_424 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nHairCutShopTitle");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nHairCutShopTitle");
      local_5d0 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nHairDyeingShopTitle");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nHairDyeingShopTitle");
      local_5cc = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nHairCutShopGroup");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nHairCutShopGroup");
      local_5c8 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nDyeingShopGroup");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nDyeingShopGroup");
      local_5c4 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"nfortuneGroup");
      local_988 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,L"nfortuneGroup");
      local_3f8 = *puVar15;
      uVar9 = FUN_1402970c0(lVar12,L"szShopType");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szShopType");
      local_780 = 7;
      local_788 = 0;
      local_798 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_798,psVar13,~uVar21 - 1);
      local_948 = (void *)0x0;
      local_940 = 0;
      local_938 = 0;
      puVar29 = &local_798;
      if (7 < local_780) {
        puVar29 = (undefined2 *)CONCAT62(uStack_796,local_798);
      }
      FUN_140415930(&local_948,puVar29,&DAT_14049c7b8);
      lVar11 = local_940 - (longlong)local_948 >> 0x3f;
      uVar21 = uVar22;
      uVar26 = uVar22;
      if ((local_940 - (longlong)local_948) / 0x28 + lVar11 != lVar11) {
        do {
          pwVar23 = (wchar_t *)((longlong)local_948 + uVar21);
          if (7 < *(ulonglong *)(pwVar23 + 0xc)) {
            pwVar23 = *(wchar_t **)pwVar23;
          }
          uVar8 = _wtoi(pwVar23);
          local_978[0] = uVar8;
          if ((local_978 < local_5b8) && (local_5c0 <= local_978)) {
            lVar11 = (longlong)local_978 - (longlong)local_5c0;
            if (local_5b8 == local_5b0) {
              uVar33 = (longlong)local_5b8 - (longlong)local_5c0 >> 2;
              if (0x3ffffffffffffffe < uVar33) {
                std::_Xlength_error("vector<T> too long");
                pcVar6 = (code *)swi(3);
                (*pcVar6)();
                return;
              }
              uVar33 = uVar33 + 1;
              uVar25 = (longlong)local_5b0 - (longlong)local_5c0 >> 2;
              if (uVar25 < uVar33) {
                uVar34 = uVar22;
                if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                  uVar34 = uVar25 + (uVar25 >> 1);
                }
                if (uVar34 < uVar33) {
                  uVar34 = uVar33;
                }
                FUN_140051e60(&local_5c0,uVar34);
              }
            }
            if (local_5b8 != (uint *)0x0) {
              *local_5b8 = local_5c0[lVar11 >> 2];
            }
          }
          else {
            if (local_5b8 == local_5b0) {
              uVar33 = (longlong)local_5b8 - (longlong)local_5c0 >> 2;
              if (0x3ffffffffffffffe < uVar33) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_1402e80fd;
              }
              uVar33 = uVar33 + 1;
              uVar25 = (longlong)local_5b0 - (longlong)local_5c0 >> 2;
              if (uVar25 < uVar33) {
                uVar34 = uVar22;
                if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                  uVar34 = uVar25 + (uVar25 >> 1);
                }
                if (uVar34 < uVar33) {
                  uVar34 = uVar33;
                }
                FUN_140051e60(&local_5c0,uVar34);
              }
            }
            if (local_5b8 != (uint *)0x0) {
              *local_5b8 = uVar8;
            }
          }
          local_5b8 = local_5b8 + 1;
          uVar26 = (ulonglong)((int)uVar26 + 1);
          uVar21 = uVar21 + 0x28;
        } while (uVar26 < (ulonglong)((local_940 - (longlong)local_948) / 0x28));
      }
      uVar9 = FUN_1402970c0(lVar12,L"szShopCategory");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szShopCategory");
      local_7d0 = 7;
      local_7d8 = 0;
      local_7e8 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_7e8,psVar13,~uVar21 - 1);
      local_968 = (void *)0x0;
      local_960 = 0;
      local_958 = 0;
      puVar29 = &local_7e8;
      if (7 < local_7d0) {
        puVar29 = (undefined2 *)CONCAT62(uStack_7e6,local_7e8);
      }
      FUN_140415930(&local_968,puVar29,&DAT_14049c7b8);
      lVar11 = local_960 - (longlong)local_968 >> 0x3f;
      uVar21 = uVar22;
      uVar26 = uVar22;
      if ((local_960 - (longlong)local_968) / 0x28 + lVar11 != lVar11) {
        do {
          pwVar23 = (wchar_t *)((longlong)local_968 + uVar21);
          if (7 < *(ulonglong *)(pwVar23 + 0xc)) {
            pwVar23 = *(wchar_t **)pwVar23;
          }
          uVar8 = _wtoi(pwVar23);
          local_978[0] = uVar8;
          if (uVar8 != 0) {
            if ((local_978 < local_598) && (local_5a0 <= local_978)) {
              lVar11 = (longlong)local_978 - (longlong)local_5a0;
              if (local_598 == local_590) {
                uVar33 = (longlong)local_598 - (longlong)local_5a0 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
LAB_1402e80fd:
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_590 - (longlong)local_5a0 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_5a0,uVar34);
                }
              }
              if (local_598 != (uint *)0x0) {
                *local_598 = local_5a0[lVar11 >> 2];
              }
            }
            else {
              if (local_598 == local_590) {
                uVar33 = (longlong)local_598 - (longlong)local_5a0 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_1402e8119;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_590 - (longlong)local_5a0 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_5a0,uVar34);
                }
              }
              if (local_598 != (uint *)0x0) {
                *local_598 = uVar8;
              }
            }
            local_598 = local_598 + 1;
          }
          uVar26 = (ulonglong)((int)uVar26 + 1);
          uVar21 = uVar21 + 0x28;
        } while (uVar26 < (ulonglong)((local_960 - (longlong)local_968) / 0x28));
      }
      uVar9 = FUN_1402970c0(lVar12,L"szTradeShopCategory");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szTradeShopCategory");
      local_3d0 = 7;
      local_3d8 = 0;
      local_3e8 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_3e8,psVar13,~uVar21 - 1);
      local_8a8 = (void *)0x0;
      local_8a0 = 0;
      local_898 = 0;
      puVar29 = &local_3e8;
      if (7 < local_3d0) {
        puVar29 = (undefined2 *)CONCAT62(uStack_3e6,local_3e8);
      }
      FUN_140415930((_Container_base0 *)&local_8a8,puVar29,&DAT_14049c7b8);
      lVar11 = local_8a0 - (longlong)local_8a8 >> 0x3f;
      uVar21 = uVar22;
      uVar26 = uVar22;
      if ((local_8a0 - (longlong)local_8a8) / 0x28 + lVar11 != lVar11) {
        do {
          pwVar23 = (wchar_t *)(uVar21 + (longlong)local_8a8);
          if (7 < *(ulonglong *)(pwVar23 + 0xc)) {
            pwVar23 = *(wchar_t **)pwVar23;
          }
          uVar8 = _wtoi(pwVar23);
          local_978[0] = uVar8;
          if (uVar8 != 0) {
            if ((local_978 < local_558) && (local_560 <= local_978)) {
              lVar11 = (longlong)local_978 - (longlong)local_560;
              if (local_558 == local_550) {
                uVar33 = (longlong)local_558 - (longlong)local_560 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
LAB_1402e8119:
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_550 - (longlong)local_560 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_560,uVar34);
                }
              }
              if (local_558 != (uint *)0x0) {
                *local_558 = local_560[lVar11 >> 2];
              }
            }
            else {
              if (local_558 == local_550) {
                uVar33 = (longlong)local_558 - (longlong)local_560 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_1402e8135;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_550 - (longlong)local_560 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_560,uVar34);
                }
              }
              if (local_558 != (uint *)0x0) {
                *local_558 = uVar8;
              }
            }
            local_558 = local_558 + 1;
          }
          uVar26 = (ulonglong)((int)uVar26 + 1);
          uVar21 = uVar21 + 0x28;
        } while (uVar26 < (ulonglong)((local_8a0 - (longlong)local_8a8) / 0x28));
      }
      uVar9 = FUN_1402970c0(lVar12,L"szShopSubCategory");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szShopSubCategory");
      local_708 = 7;
      local_710 = 0;
      local_720 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_720,psVar13,~uVar21 - 1);
      local_888 = (void *)0x0;
      local_880 = 0;
      local_878 = 0;
      puVar29 = &local_720;
      if (7 < local_708) {
        puVar29 = (undefined2 *)CONCAT62(uStack_71e,local_720);
      }
      FUN_140415930(&local_888,puVar29,&DAT_14049c7b8);
      lVar11 = local_880 - (longlong)local_888 >> 0x3f;
      uVar21 = uVar22;
      uVar26 = uVar22;
      if ((local_880 - (longlong)local_888) / 0x28 + lVar11 != lVar11) {
        do {
          pwVar23 = (wchar_t *)(uVar21 + (longlong)local_888);
          if (7 < *(ulonglong *)(pwVar23 + 0xc)) {
            pwVar23 = *(wchar_t **)pwVar23;
          }
          uVar8 = _wtoi(pwVar23);
          local_978[0] = uVar8;
          if (uVar8 != 0) {
            if ((local_978 < local_578) && (local_580 <= local_978)) {
              lVar11 = (longlong)local_978 - (longlong)local_580;
              if (local_578 == local_570) {
                uVar33 = (longlong)local_578 - (longlong)local_580 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
LAB_1402e8135:
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_570 - (longlong)local_580 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_580,uVar34);
                }
              }
              if (local_578 != (uint *)0x0) {
                *local_578 = local_580[lVar11 >> 2];
              }
            }
            else {
              if (local_578 == local_570) {
                uVar33 = (longlong)local_578 - (longlong)local_580 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_1402e8151;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_570 - (longlong)local_580 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_580,uVar34);
                }
              }
              if (local_578 != (uint *)0x0) {
                *local_578 = uVar8;
              }
            }
            local_578 = local_578 + 1;
          }
          uVar26 = (ulonglong)((int)uVar26 + 1);
          uVar21 = uVar21 + 0x28;
        } while (uVar26 < (ulonglong)((local_880 - (longlong)local_888) / 0x28));
      }
      uVar9 = FUN_1402970c0(lVar12,L"szNpcItemMixCategory");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szNpcItemMixCategory");
      local_758 = 7;
      local_760 = 0;
      local_770 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_770,psVar13,~uVar21 - 1);
      local_908 = (void *)0x0;
      local_900 = 0;
      local_8f8 = 0;
      puVar29 = &local_770;
      if (7 < local_758) {
        puVar29 = (undefined2 *)CONCAT62(uStack_76e,local_770);
      }
      FUN_140415930(&local_908,puVar29,&DAT_14049c7b8);
      local_978[0] = 0xffffffff;
      if ((local_978 < local_480) && (local_488 <= local_978)) {
        lVar11 = (longlong)local_978 - (longlong)local_488;
        if (local_480 == local_478) {
          uVar21 = (longlong)local_480 - (longlong)local_488 >> 2;
          if (0x3ffffffffffffffe < uVar21) {
LAB_1402e8151:
            std::_Xlength_error("vector<T> too long");
            pcVar6 = (code *)swi(3);
            (*pcVar6)();
            return;
          }
          uVar21 = uVar21 + 1;
          uVar26 = (longlong)local_478 - (longlong)local_488 >> 2;
          if (uVar26 < uVar21) {
            uVar33 = uVar22;
            if (uVar26 <= 0x3fffffffffffffff - (uVar26 >> 1)) {
              uVar33 = uVar26 + (uVar26 >> 1);
            }
            if (uVar33 < uVar21) {
              uVar33 = uVar21;
            }
            FUN_140051e60(&local_488,uVar33);
          }
        }
        if (local_480 != (uint *)0x0) {
          *local_480 = local_488[lVar11 >> 2];
        }
      }
      else {
        if (local_480 == local_478) {
          uVar21 = (longlong)local_480 - (longlong)local_488 >> 2;
          if (0x3ffffffffffffffe < uVar21) {
            std::_Xlength_error("vector<T> too long");
            pcVar6 = (code *)swi(3);
            (*pcVar6)();
            return;
          }
          uVar21 = uVar21 + 1;
          uVar26 = (longlong)local_478 - (longlong)local_488 >> 2;
          if (uVar26 < uVar21) {
            uVar33 = uVar22;
            if (uVar26 <= 0x3fffffffffffffff - (uVar26 >> 1)) {
              uVar33 = uVar26 + (uVar26 >> 1);
            }
            if (uVar33 < uVar21) {
              uVar33 = uVar21;
            }
            FUN_140051e60(&local_488,uVar33);
          }
        }
        if (local_480 != (uint *)0x0) {
          *local_480 = 0xffffffff;
        }
      }
      local_480 = local_480 + 1;
      lVar11 = local_900 - (longlong)local_908 >> 0x3f;
      uVar21 = uVar22;
      uVar26 = uVar22;
      if ((local_900 - (longlong)local_908) / 0x28 + lVar11 != lVar11) {
        do {
          pwVar23 = (wchar_t *)(uVar21 + (longlong)local_908);
          if (7 < *(ulonglong *)(pwVar23 + 0xc)) {
            pwVar23 = *(wchar_t **)pwVar23;
          }
          uVar8 = _wtoi(pwVar23);
          local_978[0] = uVar8;
          if (uVar8 != 0) {
            if ((local_978 < local_480) && (local_488 <= local_978)) {
              lVar11 = (longlong)local_978 - (longlong)local_488;
              if (local_480 == local_478) {
                uVar33 = (longlong)local_480 - (longlong)local_488 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_478 - (longlong)local_488 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_488,uVar34);
                }
              }
              if (local_480 != (uint *)0x0) {
                *local_480 = local_488[lVar11 >> 2];
              }
            }
            else {
              if (local_480 == local_478) {
                uVar33 = (longlong)local_480 - (longlong)local_488 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_1402e8189;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_478 - (longlong)local_488 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_488,uVar34);
                }
              }
              if (local_480 != (uint *)0x0) {
                *local_480 = uVar8;
              }
            }
            local_480 = local_480 + 1;
          }
          uVar26 = (ulonglong)((int)uVar26 + 1);
          uVar21 = uVar21 + 0x28;
        } while (uVar26 < (ulonglong)((local_900 - (longlong)local_908) / 0x28));
      }
      uVar9 = FUN_1402970c0(lVar12,L"szMixGroup");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szMixGroup");
      local_730 = 7;
      local_738 = 0;
      local_748 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_748,psVar13,~uVar21 - 1);
      local_928 = (void *)0x0;
      local_920 = 0;
      local_918 = 0;
      puVar29 = &local_748;
      if (7 < local_730) {
        puVar29 = (undefined2 *)CONCAT62(uStack_746,local_748);
      }
      FUN_140415930(&local_928,puVar29,&DAT_14049c7b8);
      lVar11 = local_920 - (longlong)local_928 >> 0x3f;
      uVar21 = uVar22;
      uVar26 = uVar22;
      if ((local_920 - (longlong)local_928) / 0x28 + lVar11 != lVar11) {
        do {
          pwVar23 = (wchar_t *)((longlong)local_928 + uVar21);
          if (7 < *(ulonglong *)(pwVar23 + 0xc)) {
            pwVar23 = *(wchar_t **)pwVar23;
          }
          uVar8 = _wtoi(pwVar23);
          local_978[0] = uVar8;
          if (uVar8 != 0) {
            if ((local_978 < local_460) && (local_468 <= local_978)) {
              lVar11 = (longlong)local_978 - (longlong)local_468;
              if (local_460 == local_458) {
                uVar33 = (longlong)local_460 - (longlong)local_468 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
LAB_1402e8189:
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_458 - (longlong)local_468 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_468,uVar34);
                }
              }
              if (local_460 != (uint *)0x0) {
                *local_460 = local_468[lVar11 >> 2];
              }
            }
            else {
              if (local_460 == local_458) {
                uVar33 = (longlong)local_460 - (longlong)local_468 >> 2;
                if (0x3ffffffffffffffe < uVar33) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_1402e81a5;
                }
                uVar33 = uVar33 + 1;
                uVar25 = (longlong)local_458 - (longlong)local_468 >> 2;
                if (uVar25 < uVar33) {
                  uVar34 = uVar22;
                  if (uVar25 <= 0x3fffffffffffffff - (uVar25 >> 1)) {
                    uVar34 = uVar25 + (uVar25 >> 1);
                  }
                  if (uVar34 < uVar33) {
                    uVar34 = uVar33;
                  }
                  FUN_140051e60(&local_468,uVar34);
                }
              }
              if (local_460 != (uint *)0x0) {
                *local_460 = uVar8;
              }
            }
            local_460 = local_460 + 1;
          }
          uVar26 = (ulonglong)((int)uVar26 + 1);
          uVar21 = uVar21 + 0x28;
        } while (uVar26 < (ulonglong)((local_920 - (longlong)local_928) / 0x28));
      }
      uVar9 = FUN_1402970c0(lVar12,L"szCostumeGroup");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szCostumeGroup");
      local_7a8 = 7;
      local_7b0 = 0;
      local_7c0 = 0;
      uVar21 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_7c0,psVar13,~uVar21 - 1);
      local_8e8 = (void *)0x0;
      local_8e0 = 0;
      local_8d8 = 0;
      puVar29 = &local_7c0;
      if (7 < local_7a8) {
        puVar29 = (undefined2 *)CONCAT62(uStack_7be,local_7c0);
      }
      FUN_140415930(&local_8e8,puVar29,&DAT_14049c7b8);
      lVar11 = local_8e0 - (longlong)local_8e8 >> 0x3f;
      uVar21 = uVar22;
      uVar26 = uVar22;
      uVar33 = uVar22;
      uVar25 = uVar22;
      if ((local_8e0 - (longlong)local_8e8) / 0x28 + lVar11 != lVar11) {
        do {
          pwVar23 = (wchar_t *)(uVar21 + (longlong)local_8e8);
          if (7 < *(ulonglong *)(pwVar23 + 0xc)) {
            pwVar23 = *(wchar_t **)pwVar23;
          }
          uVar8 = _wtoi(pwVar23);
          local_978[0] = uVar8;
          if (uVar8 != 0) {
            if ((local_978 < local_440) && (local_448 <= local_978)) {
              lVar11 = (longlong)local_978 - (longlong)local_448;
              if (local_440 == local_438) {
                uVar34 = (longlong)local_440 - (longlong)local_448 >> 2;
                if (0x3ffffffffffffffe < uVar34) {
LAB_1402e81a5:
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar34 = uVar34 + 1;
                uVar27 = (longlong)local_438 - (longlong)local_448 >> 2;
                if (uVar27 < uVar34) {
                  uVar28 = uVar22;
                  if (uVar27 <= 0x3fffffffffffffff - (uVar27 >> 1)) {
                    uVar28 = uVar27 + (uVar27 >> 1);
                  }
                  if (uVar28 < uVar34) {
                    uVar28 = uVar34;
                  }
                  FUN_140051e60(&local_448,uVar28);
                }
              }
              if (local_440 != (uint *)0x0) {
                *local_440 = local_448[lVar11 >> 2];
              }
            }
            else {
              if (local_440 == local_438) {
                uVar34 = (longlong)local_440 - (longlong)local_448 >> 2;
                if (0x3ffffffffffffffe < uVar34) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar34 = uVar34 + 1;
                uVar27 = (longlong)local_438 - (longlong)local_448 >> 2;
                if (uVar27 < uVar34) {
                  uVar28 = uVar22;
                  if (uVar27 <= 0x3fffffffffffffff - (uVar27 >> 1)) {
                    uVar28 = uVar27 + (uVar27 >> 1);
                  }
                  if (uVar28 < uVar34) {
                    uVar28 = uVar34;
                  }
                  FUN_140051e60(&local_448,uVar28);
                }
              }
              if (local_440 != (uint *)0x0) {
                *local_440 = uVar8;
              }
            }
            local_440 = local_440 + 1;
          }
          uVar33 = (ulonglong)((int)uVar33 + 1);
          uVar21 = uVar21 + 0x28;
        } while (uVar33 < (ulonglong)((local_8e0 - (longlong)local_8e8) / 0x28));
      }
      do {
        uVar4 = *(undefined8 *)((longlong)&PTR_u_nRandomQuestGroup00_1405dabf8 + uVar26);
        uVar9 = FUN_1402970c0(lVar12,uVar4);
        local_988 = 1;
        piVar16 = (int *)FUN_140296600(lVar12,uVar3,uVar9,uVar4);
        if (piVar16 != (int *)0x0) {
          if (0 < *piVar16) {
            if ((piVar16 < local_4d0) && (local_4d8 <= piVar16)) {
              lVar11 = (longlong)piVar16 - (longlong)local_4d8;
              if (local_4d0 == local_4c8) {
                uVar21 = (longlong)local_4d0 - (longlong)local_4d8 >> 2;
                if (0x3ffffffffffffffe < uVar21) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar21 = uVar21 + 1;
                uVar33 = (longlong)local_4c8 - (longlong)local_4d8 >> 2;
                if (uVar33 < uVar21) {
                  uVar34 = uVar22;
                  if (uVar33 <= 0x3fffffffffffffff - (uVar33 >> 1)) {
                    uVar34 = uVar33 + (uVar33 >> 1);
                  }
                  if (uVar34 < uVar21) {
                    uVar34 = uVar21;
                  }
                  FUN_140051e60(&local_4d8,uVar34);
                }
              }
              if (local_4d0 != (int *)0x0) {
                iVar10 = local_4d8[lVar11 >> 2];
LAB_1402e723c:
                *local_4d0 = iVar10;
              }
            }
            else {
              if (local_4d0 == local_4c8) {
                uVar21 = (longlong)local_4d0 - (longlong)local_4d8 >> 2;
                if (0x3ffffffffffffffe < uVar21) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar21 = uVar21 + 1;
                uVar33 = (longlong)local_4c8 - (longlong)local_4d8 >> 2;
                if (uVar33 < uVar21) {
                  uVar34 = uVar22;
                  if (uVar33 <= 0x3fffffffffffffff - (uVar33 >> 1)) {
                    uVar34 = uVar33 + (uVar33 >> 1);
                  }
                  if (uVar34 < uVar21) {
                    uVar34 = uVar21;
                  }
                  FUN_140051e60(&local_4d8,uVar34);
                }
              }
              if (local_4d0 != (int *)0x0) {
                iVar10 = *piVar16;
                goto LAB_1402e723c;
              }
            }
            local_4d0 = local_4d0 + 1;
          }
          uVar4 = *(undefined8 *)((longlong)&PTR_u_fRandomProbability00_1405daee8 + uVar26);
          uVar9 = FUN_1402970c0(lVar12,uVar4);
          local_988 = 1;
          pfVar17 = (float *)FUN_1402967b0(lVar12,uVar3,uVar9,uVar4);
          if (0 < (int)(*pfVar17 * 100.0)) {
            uVar8 = (int)uVar25 + (int)(*pfVar17 * 100.0);
            uVar25 = (ulonglong)uVar8;
            local_978[0] = uVar8;
            if ((local_978 < local_4f0) && (local_4f8 <= local_978)) {
              lVar11 = (longlong)local_978 - (longlong)local_4f8;
              if (local_4f0 == local_4e8) {
                uVar21 = (longlong)local_4f0 - (longlong)local_4f8 >> 2;
                if (0x3ffffffffffffffe < uVar21) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar21 = uVar21 + 1;
                uVar33 = (longlong)local_4e8 - (longlong)local_4f8 >> 2;
                if (uVar33 < uVar21) {
                  uVar34 = uVar22;
                  if (uVar33 <= 0x3fffffffffffffff - (uVar33 >> 1)) {
                    uVar34 = uVar33 + (uVar33 >> 1);
                  }
                  if (uVar34 < uVar21) {
                    uVar34 = uVar21;
                  }
                  FUN_140051e60(&local_4f8,uVar34);
                }
              }
              if (local_4f0 != (uint *)0x0) {
                *local_4f0 = local_4f8[lVar11 >> 2];
              }
            }
            else {
              if (local_4f0 == local_4e8) {
                uVar21 = (longlong)local_4f0 - (longlong)local_4f8 >> 2;
                if (0x3ffffffffffffffe < uVar21) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                uVar21 = uVar21 + 1;
                uVar33 = (longlong)local_4e8 - (longlong)local_4f8 >> 2;
                if (uVar33 < uVar21) {
                  uVar34 = uVar22;
                  if (uVar33 <= 0x3fffffffffffffff - (uVar33 >> 1)) {
                    uVar34 = uVar33 + (uVar33 >> 1);
                  }
                  if (uVar34 < uVar21) {
                    uVar34 = uVar21;
                  }
                  FUN_140051e60(&local_4f8,uVar34);
                }
              }
              if (local_4f0 != (uint *)0x0) {
                *local_4f0 = uVar8;
              }
            }
            local_4f0 = local_4f0 + 1;
          }
        }
        uVar26 = uVar26 + 8;
      } while ((longlong)uVar26 < 0x28);
      if ((((99 < (int)uVar25) && (local_4d8 != local_4d0)) && (local_4f8 != local_4f0)) &&
         ((((longlong)local_4f0 - (longlong)local_4f8 ^ (longlong)local_4d0 - (longlong)local_4d8) &
          0xfffffffffffffffcU) == 0)) {
        FUN_1402e9140(&DAT_14060ab30,local_6f8);
      }
      ppuVar38 = &PTR_u_nQuestGroup00_1405db160;
      do {
        puVar5 = *ppuVar38;
        uVar9 = FUN_1402970c0(lVar12,puVar5);
        local_988 = 1;
        puVar14 = (uint *)FUN_140296600(lVar12,uVar3,uVar9,puVar5);
        uVar8 = *puVar14;
        local_978[0] = uVar8;
        if (0 < (int)uVar8) {
          if ((local_978 < local_530) && (local_538 <= local_978)) {
            lVar11 = (longlong)local_978 - (longlong)local_538;
            if (local_530 == local_528) {
              uVar21 = (longlong)local_530 - (longlong)local_538 >> 2;
              if (0x3ffffffffffffffe < uVar21) {
                std::_Xlength_error("vector<T> too long");
                pcVar6 = (code *)swi(3);
                (*pcVar6)();
                return;
              }
              uVar21 = uVar21 + 1;
              uVar26 = (longlong)local_528 - (longlong)local_538 >> 2;
              if (uVar26 < uVar21) {
                uVar33 = uVar22;
                if (uVar26 <= 0x3fffffffffffffff - (uVar26 >> 1)) {
                  uVar33 = uVar26 + (uVar26 >> 1);
                }
                if (uVar33 < uVar21) {
                  uVar33 = uVar21;
                }
                FUN_140051e60(&local_538,uVar33);
              }
            }
            if (local_530 != (uint *)0x0) {
              *local_530 = local_538[lVar11 >> 2];
            }
          }
          else {
            if (local_530 == local_528) {
              uVar21 = (longlong)local_530 - (longlong)local_538 >> 2;
              if (0x3ffffffffffffffe < uVar21) {
                std::_Xlength_error("vector<T> too long");
                pcVar6 = (code *)swi(3);
                (*pcVar6)();
                return;
              }
              uVar21 = uVar21 + 1;
              uVar26 = (longlong)local_528 - (longlong)local_538 >> 2;
              if (uVar26 < uVar21) {
                uVar33 = uVar22;
                if (uVar26 <= 0x3fffffffffffffff - (uVar26 >> 1)) {
                  uVar33 = uVar26 + (uVar26 >> 1);
                }
                if (uVar33 < uVar21) {
                  uVar33 = uVar21;
                }
                FUN_140051e60(&local_538,uVar33);
              }
            }
            if (local_530 != (uint *)0x0) {
              *local_530 = uVar8;
            }
          }
          local_530 = local_530 + 1;
        }
        ppuVar38 = ppuVar38 + 1;
      } while ((longlong)ppuVar38 < 0x1405db1b0);
      ppuVar38 = &PTR_u_nShopID00_1405db030;
      do {
        puVar5 = *ppuVar38;
        uVar9 = FUN_1402970c0(lVar12,puVar5);
        local_988 = 1;
        puVar14 = (uint *)FUN_140296600(lVar12,uVar3,uVar9,puVar5);
        uVar8 = *puVar14;
        local_978[0] = uVar8;
        if (0 < (int)uVar8) {
          if ((local_978 < local_510) && (local_518 <= local_978)) {
            lVar11 = (longlong)local_978 - (longlong)local_518;
            if (local_510 == local_508) {
              uVar21 = (longlong)local_510 - (longlong)local_518 >> 2;
              if (0x3ffffffffffffffe < uVar21) {
                std::_Xlength_error("vector<T> too long");
                pcVar6 = (code *)swi(3);
                (*pcVar6)();
                return;
              }
              uVar21 = uVar21 + 1;
              uVar26 = (longlong)local_508 - (longlong)local_518 >> 2;
              if (uVar26 < uVar21) {
                uVar33 = uVar22;
                if (uVar26 <= 0x3fffffffffffffff - (uVar26 >> 1)) {
                  uVar33 = uVar26 + (uVar26 >> 1);
                }
                if (uVar33 < uVar21) {
                  uVar33 = uVar21;
                }
                FUN_140051e60(&local_518,uVar33);
              }
            }
            if (local_510 != (uint *)0x0) {
              *local_510 = local_518[lVar11 >> 2];
            }
          }
          else {
            if (local_510 == local_508) {
              uVar21 = (longlong)local_510 - (longlong)local_518 >> 2;
              if (0x3ffffffffffffffe < uVar21) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_1402e8231;
              }
              uVar21 = uVar21 + 1;
              uVar26 = (longlong)local_508 - (longlong)local_518 >> 2;
              if (uVar26 < uVar21) {
                uVar33 = uVar22;
                if (uVar26 <= 0x3fffffffffffffff - (uVar26 >> 1)) {
                  uVar33 = uVar26 + (uVar26 >> 1);
                }
                if (uVar33 < uVar21) {
                  uVar33 = uVar21;
                }
                FUN_140051e60(&local_518,uVar33);
              }
            }
            if (local_510 != (uint *)0x0) {
              *local_510 = uVar8;
            }
          }
          local_510 = local_510 + 1;
        }
        ppuVar38 = ppuVar38 + 1;
      } while ((longlong)ppuVar38 < 0x1405db098);
      puVar15 = local_4b8;
      ppuVar38 = &PTR_u_nMissionGroup00_1405db1b0;
      do {
        puVar5 = *ppuVar38;
        uVar9 = FUN_1402970c0(lVar12,puVar5);
        local_988 = 1;
        puVar18 = (undefined4 *)FUN_140296600(lVar12,uVar3,uVar9,puVar5);
        *puVar15 = *puVar18;
        ppuVar38 = ppuVar38 + 1;
        puVar15 = puVar15 + 1;
      } while ((longlong)ppuVar38 < 0x1405db200);
      puVar18 = (undefined4 *)0x0;
      uVar9 = FUN_1402970c0(lVar12,L"szNpcItemMixSubCategory");
      local_988 = 1;
      psVar13 = (short *)FUN_140296990(lVar12,uVar3,uVar9,L"szNpcItemMixSubCategory");
      local_7f8 = 7;
      local_800 = 0;
      local_810 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar35 = psVar13;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar35;
        psVar35 = psVar35 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_810,psVar13,~uVar22 - 1);
      local_8c8 = (void *)0x0;
      local_8c0 = 0;
      local_8b8 = 0;
      puVar29 = &local_810;
      if (7 < local_7f8) {
        puVar29 = (undefined2 *)CONCAT62(uStack_80e,local_810);
      }
      FUN_140415930(&local_8c8,puVar29,&DAT_14049c7b8);
      lVar11 = local_8c0 - (longlong)local_8c8 >> 0x3f;
      puVar15 = puVar18;
      puVar39 = puVar18;
      if ((local_8c0 - (longlong)local_8c8) / 0x28 + lVar11 != lVar11) {
        do {
          pwVar23 = (wchar_t *)((longlong)puVar15 + (longlong)local_8c8);
          if (7 < *(ulonglong *)(pwVar23 + 0xc)) {
            pwVar23 = *(wchar_t **)pwVar23;
          }
          uVar8 = _wtoi(pwVar23);
          local_978[0] = uVar8;
          if (uVar8 != 0) {
            if ((local_978 < local_410) && (local_418 <= local_978)) {
              lVar11 = (longlong)local_978 - (longlong)local_418;
              if (local_410 == local_408) {
                uVar22 = (longlong)local_410 - (longlong)local_418 >> 2;
                if (0x3ffffffffffffffe < uVar22) {
LAB_1402e8231:
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  (*pcVar6)();
                  return;
                }
                puVar36 = (undefined4 *)(uVar22 + 1);
                puVar30 = (undefined4 *)((longlong)local_408 - (longlong)local_418 >> 2);
                if (puVar30 < puVar36) {
                  puVar31 = puVar18;
                  if (puVar30 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar30 >> 1))) {
                    puVar31 = (undefined4 *)((longlong)puVar30 + ((ulonglong)puVar30 >> 1));
                  }
                  if (puVar31 < puVar36) {
                    puVar31 = puVar36;
                  }
                  FUN_140051e60(&local_418,puVar31);
                }
              }
              if (local_410 != (uint *)0x0) {
                *local_410 = local_418[lVar11 >> 2];
              }
            }
            else {
              if (local_410 == local_408) {
                uVar22 = (longlong)local_410 - (longlong)local_418 >> 2;
                if (0x3ffffffffffffffe < uVar22) {
                  std::_Xlength_error("vector<T> too long");
                  return;
                }
                puVar36 = (undefined4 *)(uVar22 + 1);
                puVar30 = (undefined4 *)((longlong)local_408 - (longlong)local_418 >> 2);
                if (puVar30 < puVar36) {
                  puVar31 = puVar18;
                  if (puVar30 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar30 >> 1))) {
                    puVar31 = (undefined4 *)((longlong)puVar30 + ((ulonglong)puVar30 >> 1));
                  }
                  if (puVar31 < puVar36) {
                    puVar31 = puVar36;
                  }
                  FUN_140051e60(&local_418,puVar31);
                }
              }
              if (local_410 != (uint *)0x0) {
                *local_410 = uVar8;
              }
            }
            local_410 = local_410 + 1;
          }
          puVar39 = (undefined4 *)(ulonglong)((int)puVar39 + 1);
          puVar15 = puVar15 + 10;
        } while (puVar39 < (undefined4 *)((local_8c0 - (longlong)local_8c8) / 0x28));
      }
      local_358 = local_6f8[0];
      FUN_1402e9de0(local_350,local_6f8);
      FUN_1402e9430(&DAT_14060aaa8,local_358,local_350);
      FUN_1402e8400();
      pppppppsVar32 = (short *******)local_6f0;
      if (7 < local_6d8) {
        pppppppsVar32 = local_6f0[0];
      }
      local_820 = 7;
      local_828 = 0;
      local_838 = 0;
      uVar22 = 0xffffffffffffffff;
      pppppppsVar37 = pppppppsVar32;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *(short *)pppppppsVar37;
        pppppppsVar37 = (short *******)((longlong)pppppppsVar37 + 2);
      } while (sVar1 != 0);
      FUN_140001710(&local_838,pppppppsVar32,~uVar22 - 1);
      puVar15 = puVar18;
      if (DAT_14060ab10 != 0) {
        puVar24 = &local_838;
        if (7 < local_820) {
          puVar24 = (ushort *)CONCAT62(uStack_836,local_838);
        }
        puVar7 = &local_838;
        if (7 < local_820) {
          puVar7 = (ushort *)CONCAT62(uStack_836,local_838);
        }
        for (; puVar7 != puVar24 + local_828; puVar7 = puVar7 + 1) {
          uVar2 = *puVar7;
          puVar15 = (undefined4 *)
                    ((ulonglong)puVar15 ^
                    ((ulonglong)puVar15 >> 2) + (longlong)puVar15 * 0x40 + 0x9e3779b9 +
                    (ulonglong)uVar2);
          lVar12 = local_860;
        }
        puVar15 = (undefined4 *)
                  FUN_1402cb0b0(DAT_14060aaf0 + ((ulonglong)puVar15 % DAT_14060aaf8) * 8,&local_838)
        ;
      }
      if (7 < local_820) {
        operator_delete((void *)CONCAT62(uStack_836,local_838));
      }
      local_820 = 7;
      local_828 = 0;
      local_838 = 0;
      if (puVar15 == (undefined4 *)0x0) {
        local_378 = 7;
        local_380 = 0;
        local_390 = 0;
        FUN_1400015e0(&local_390,local_6f0,0,0xffffffffffffffff);
        local_368 = local_6f8[0];
        local_3a8 = 7;
        local_3b0 = 0;
        local_3c0 = 0;
        FUN_14008ff90(&local_3c0,&local_390);
        local_398 = local_368;
        if (DAT_14060ab10 == 0) {
          FUN_1401500f0(&DAT_14060aaf0,&local_838,&local_3c0);
        }
        else {
          FUN_14014ffb0(&DAT_14060aaf0,local_850,&local_3c0,&local_3c0);
        }
        if (7 < local_3a8) {
          operator_delete((void *)CONCAT62(uStack_3be,local_3c0));
        }
        local_3a8 = 7;
        local_3b0 = 0;
        local_3c0 = 0;
        if (7 < local_378) {
          operator_delete((void *)CONCAT62(uStack_38e,local_390));
        }
      }
      else {
        pppppppsVar32 = (short *******)local_6f0;
        if (7 < local_6d8) {
          pppppppsVar32 = local_6f0[0];
        }
        FUN_140418da0(DAT_140607fd8,&DAT_1404c7f70,local_6f8[0],pppppppsVar32);
      }
      if ((0 < (int)local_678) && (local_690 != 0)) {
        if (DAT_14060aa60 != 0) {
          for (puVar14 = *(uint **)(DAT_14060aa60 +
                                   ((ulonglong)local_678 % (ulonglong)DAT_14060aa70) * 8);
              puVar14 != (uint *)0x0; puVar14 = *(uint **)(puVar14 + 0xc)) {
            if ((puVar14[0xe] == local_678) && (*puVar14 == local_678)) {
              if (puVar14 != (uint *)0x0) goto LAB_1402e7d51;
              break;
            }
          }
        }
        FUN_140147fa0(&DAT_14060aa60,local_678,local_6a0);
      }
LAB_1402e7d51:
      if (local_8c8 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_8c8);
        FUN_14008d0a0(local_8c8);
        operator_delete(local_8c8);
      }
      local_8c8 = (void *)0x0;
      local_8c0 = 0;
      local_8b8 = 0;
      if (7 < local_7f8) {
        operator_delete((void *)CONCAT62(uStack_80e,local_810));
      }
      local_7f8 = 7;
      local_800 = 0;
      local_810 = 0;
      if (local_8e8 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_8e8);
        FUN_14008d0a0(local_8e8);
        operator_delete(local_8e8);
      }
      local_8e8 = (void *)0x0;
      local_8e0 = 0;
      local_8d8 = 0;
      if (7 < local_7a8) {
        operator_delete((void *)CONCAT62(uStack_7be,local_7c0));
      }
      local_7a8 = 7;
      local_7b0 = 0;
      local_7c0 = 0;
      if (local_928 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_928);
        FUN_14008d0a0(local_928);
        operator_delete(local_928);
      }
      local_928 = (void *)0x0;
      local_920 = 0;
      local_918 = 0;
      if (7 < local_730) {
        operator_delete((void *)CONCAT62(uStack_746,local_748));
      }
      local_730 = 7;
      local_738 = 0;
      local_748 = 0;
      if (local_908 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_908);
        FUN_14008d0a0(local_908);
        operator_delete(local_908);
      }
      local_908 = (void *)0x0;
      local_900 = 0;
      local_8f8 = 0;
      if (7 < local_758) {
        operator_delete((void *)CONCAT62(uStack_76e,local_770));
      }
      local_758 = 7;
      local_760 = 0;
      local_770 = 0;
      if (local_888 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_888);
        FUN_14008d0a0(local_888);
        operator_delete(local_888);
      }
      local_888 = (void *)0x0;
      local_880 = 0;
      local_878 = 0;
      if (7 < local_708) {
        operator_delete((void *)CONCAT62(uStack_71e,local_720));
      }
      local_708 = 7;
      local_710 = 0;
      local_720 = 0;
      if (local_8a8 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_8a8);
        FUN_14008d0a0(local_8a8);
        operator_delete(local_8a8);
      }
      local_8a8 = (void *)0x0;
      local_8a0 = 0;
      local_898 = 0;
      if (7 < local_3d0) {
        operator_delete((void *)CONCAT62(uStack_3e6,local_3e8));
      }
      local_3d0 = 7;
      local_3d8 = 0;
      local_3e8 = 0;
      if (local_968 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_968);
        FUN_14008d0a0(local_968);
        operator_delete(local_968);
      }
      local_968 = (void *)0x0;
      local_960 = 0;
      local_958 = 0;
      if (7 < local_7d0) {
        operator_delete((void *)CONCAT62(uStack_7e6,local_7e8));
      }
      local_7d0 = 7;
      local_7d8 = 0;
      local_7e8 = 0;
      if (local_948 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_948);
        FUN_14008d0a0(local_948);
        operator_delete(local_948);
      }
      local_948 = (void *)0x0;
      local_940 = 0;
      local_938 = 0;
      if (7 < local_780) {
        operator_delete((void *)CONCAT62(uStack_796,local_798));
      }
      local_780 = 7;
      local_788 = 0;
      local_798 = 0;
      FUN_1402e8400(local_6f8);
      puVar15 = *(undefined4 **)(local_970 + 6);
      lVar11 = local_868;
      if (puVar15 == (undefined4 *)0x0) {
        uVar8 = (uint)local_970[8] % *(uint *)(lVar12 + 0x78) + 1;
        lVar19 = (longlong)(int)uVar8 << 3;
        puVar15 = puVar18;
        do {
          if (*(uint *)(lVar12 + 0x78) <= uVar8) break;
          if (*(longlong *)(lVar19 + *(longlong *)(lVar12 + 0x68)) != 0) {
            puVar15 = *(undefined4 **)(lVar19 + *(longlong *)(lVar12 + 0x68));
          }
          uVar8 = uVar8 + 1;
          lVar19 = lVar19 + 8;
        } while (puVar15 == (undefined4 *)0x0);
      }
      goto LAB_1402e5646;
    }
  }
  return;
}



longlong FUN_1402e8290(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 7;
  *(undefined2 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined2 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined8 *)(param_1 + 0xc0) = 7;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined8 *)(param_1 + 0x140) = 0;
  *(undefined8 *)(param_1 + 0x148) = 0;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined8 *)(param_1 + 0x160) = 0;
  *(undefined8 *)(param_1 + 0x168) = 0;
  *(undefined8 *)(param_1 + 0x178) = 0;
  *(undefined8 *)(param_1 + 0x180) = 0;
  *(undefined8 *)(param_1 + 0x188) = 0;
  *(undefined8 *)(param_1 + 0x198) = 0;
  *(undefined8 *)(param_1 + 0x1a0) = 0;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  *(undefined8 *)(param_1 + 0x1c0) = 0;
  *(undefined8 *)(param_1 + 0x1c8) = 0;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  *(undefined8 *)(param_1 + 0x1e0) = 0;
  *(undefined8 *)(param_1 + 0x1e8) = 0;
  *(undefined8 *)(param_1 + 0x1f0) = 0;
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined8 *)(param_1 + 0x208) = 0;
  *(undefined8 *)(param_1 + 0x210) = 0;
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined8 *)(param_1 + 0x228) = 0;
  *(undefined8 *)(param_1 + 0x230) = 0;
  *(undefined8 *)(param_1 + 0x270) = 0;
  *(undefined8 *)(param_1 + 0x278) = 0;
  *(undefined8 *)(param_1 + 0x280) = 0;
  *(undefined8 *)(param_1 + 0x290) = 0;
  *(undefined8 *)(param_1 + 0x298) = 0;
  *(undefined8 *)(param_1 + 0x2a0) = 0;
  *(undefined8 *)(param_1 + 0x2b0) = 0;
  *(undefined8 *)(param_1 + 0x2b8) = 0;
  *(undefined8 *)(param_1 + 0x2c0) = 0;
  *(undefined8 *)(param_1 + 0x2e0) = 0;
  *(undefined8 *)(param_1 + 0x2e8) = 0;
  *(undefined8 *)(param_1 + 0x2f0) = 0;
  return param_1;
}



void FUN_1402e8400(longlong param_1)

{
  if (*(void **)(param_1 + 0x2e0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x2e0));
  }
  *(undefined8 *)(param_1 + 0x2e0) = 0;
  *(undefined8 *)(param_1 + 0x2e8) = 0;
  *(undefined8 *)(param_1 + 0x2f0) = 0;
  if (*(void **)(param_1 + 0x2b0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x2b0));
  }
  *(undefined8 *)(param_1 + 0x2b0) = 0;
  *(undefined8 *)(param_1 + 0x2b8) = 0;
  *(undefined8 *)(param_1 + 0x2c0) = 0;
  if (*(void **)(param_1 + 0x290) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x290));
  }
  *(undefined8 *)(param_1 + 0x290) = 0;
  *(undefined8 *)(param_1 + 0x298) = 0;
  *(undefined8 *)(param_1 + 0x2a0) = 0;
  if (*(void **)(param_1 + 0x270) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x270));
  }
  *(undefined8 *)(param_1 + 0x270) = 0;
  *(undefined8 *)(param_1 + 0x278) = 0;
  *(undefined8 *)(param_1 + 0x280) = 0;
  if (*(void **)(param_1 + 0x220) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x220));
  }
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined8 *)(param_1 + 0x228) = 0;
  *(undefined8 *)(param_1 + 0x230) = 0;
  if (*(void **)(param_1 + 0x200) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x200));
  }
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined8 *)(param_1 + 0x208) = 0;
  *(undefined8 *)(param_1 + 0x210) = 0;
  if (*(void **)(param_1 + 0x1e0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x1e0));
  }
  *(undefined8 *)(param_1 + 0x1e0) = 0;
  *(undefined8 *)(param_1 + 0x1e8) = 0;
  *(undefined8 *)(param_1 + 0x1f0) = 0;
  if (*(void **)(param_1 + 0x1c0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x1c0));
  }
  *(undefined8 *)(param_1 + 0x1c0) = 0;
  *(undefined8 *)(param_1 + 0x1c8) = 0;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  if (*(void **)(param_1 + 0x198) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x198));
  }
  *(undefined8 *)(param_1 + 0x198) = 0;
  *(undefined8 *)(param_1 + 0x1a0) = 0;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  if (*(void **)(param_1 + 0x178) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x178));
  }
  *(undefined8 *)(param_1 + 0x178) = 0;
  *(undefined8 *)(param_1 + 0x180) = 0;
  *(undefined8 *)(param_1 + 0x188) = 0;
  if (*(void **)(param_1 + 0x158) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x158));
  }
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined8 *)(param_1 + 0x160) = 0;
  *(undefined8 *)(param_1 + 0x168) = 0;
  if (*(void **)(param_1 + 0x138) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x138));
  }
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined8 *)(param_1 + 0x140) = 0;
  *(undefined8 *)(param_1 + 0x148) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xe8)) {
    operator_delete(*(void **)(param_1 + 0xd0));
  }
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xc0)) {
    operator_delete(*(void **)(param_1 + 0xa8));
  }
  *(undefined8 *)(param_1 + 0xc0) = 7;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  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_1402e86c0(longlong param_1)

{
  FUN_1402e8400(param_1 + 8);
  return;
}



void FUN_1402e86d0(longlong param_1,undefined8 param_2)

{
  undefined8 *local_18;
  undefined8 *local_10;
  
  if (*(longlong *)(param_1 + 0xb0) == 0) {
    local_18 = (undefined8 *)0x0;
  }
  else {
    local_18 = *(undefined8 **)(param_1 + 0xc0);
    if (local_18 != (undefined8 *)0x0) {
      local_10 = (undefined8 *)*local_18;
      goto joined_r0x0001402e8726;
    }
  }
  local_10 = (undefined8 *)0x0;
joined_r0x0001402e8726:
  while (local_10 != (undefined8 *)0x0) {
    FUN_14012e5c0(param_2,local_10 + 6);
    for (local_10 = (undefined8 *)*local_10; local_10 == (undefined8 *)0x0;
        local_10 = (undefined8 *)*local_10) {
      local_10 = local_18 + 1;
      local_18 = local_18 + 1;
    }
    if (local_18 == local_10) {
      local_10 = (undefined8 *)0x0;
    }
  }
  return;
}



undefined8 * FUN_1402e8780(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetNpcInstanceDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf40 & 1) == 0) {
    DAT_14060cf40 = DAT_14060cf40 | 1;
    FUN_1402e53e0();
    atexit(FUN_140448ef0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetNpcInstanceDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_14060aa60;
}



void thunk_FUN_1402e96b0(void)

{
  FUN_1402e96b0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402e8820(void)

{
  short sVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  code *pcVar4;
  uint uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong lVar8;
  int *piVar10;
  short *psVar11;
  longlong lVar12;
  longlong *plVar13;
  undefined4 *puVar14;
  undefined4 *puVar15;
  undefined4 *puVar16;
  ulonglong uVar17;
  undefined4 *puVar18;
  short *psVar19;
  undefined4 *puVar20;
  undefined1 auStack_198 [32];
  undefined1 local_178;
  undefined4 *local_168;
  undefined8 local_160;
  undefined4 local_158;
  undefined8 local_154;
  undefined8 local_14c;
  int local_144;
  undefined4 **local_140;
  undefined4 **local_138;
  undefined4 **local_130;
  undefined4 **local_120;
  undefined4 **local_118;
  undefined4 **local_110;
  undefined2 local_100;
  undefined6 uStack_fe;
  undefined8 local_f0;
  ulonglong local_e8;
  int local_d8;
  undefined4 local_c8;
  undefined4 local_c0;
  int local_bc;
  int local_b8;
  int local_b4;
  int local_b0;
  int local_ac;
  void *local_a8 [4];
  void *local_88;
  undefined8 local_80;
  undefined8 local_78;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined8 local_58;
  ulonglong local_50;
  int local_40;
  ulonglong local_38;
  undefined4 *puVar9;
  
  local_160 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_198;
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"NPC_TRADE_SHOP");
  if (lVar8 != 0) {
    puVar16 = (undefined4 *)0x0;
    puVar20 = puVar16;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar9 = puVar16;
      plVar13 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar13 != 0) {
          puVar20 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar9];
          break;
        }
        uVar5 = (int)puVar9 + 1;
        puVar9 = (undefined4 *)(ulonglong)uVar5;
        plVar13 = plVar13 + 1;
      } while (uVar5 < *(uint *)(lVar8 + 0x78));
    }
LAB_1402e88ad:
    puVar9 = puVar20;
    if (puVar9 != (undefined4 *)0x0) {
      uVar2 = *puVar9;
      local_154 = 0;
      local_14c = 0;
      local_144 = 0;
      local_140 = (undefined4 **)0x0;
      local_138 = (undefined4 **)0x0;
      local_130 = (undefined4 **)0x0;
      local_120 = (undefined4 **)0x0;
      local_118 = (undefined4 **)0x0;
      local_110 = (undefined4 **)0x0;
      local_e8 = 7;
      local_f0 = 0;
      local_100 = 0;
      local_d8 = 0;
      puVar20 = puVar16;
      local_158 = uVar2;
      do {
        uVar3 = *(undefined8 *)(puVar20 + 0x50176c8a);
        uVar6 = FUN_1402970c0(lVar8,uVar3);
        local_178 = 1;
        piVar10 = (int *)FUN_140296600(lVar8,uVar2,uVar6,uVar3);
        iVar7 = *piVar10;
        local_168._0_4_ = iVar7;
        if (0 < iVar7) {
          if ((&local_168 < local_138) && (local_140 <= &local_168)) {
            lVar12 = (longlong)&local_168 - (longlong)local_140;
            if (local_138 == local_130) {
              uVar17 = (longlong)local_138 - (longlong)local_140 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar4 = (code *)swi(3);
                (*pcVar4)();
                return;
              }
              puVar18 = (undefined4 *)(uVar17 + 1);
              puVar14 = (undefined4 *)((longlong)local_130 - (longlong)local_140 >> 2);
              if (puVar14 < puVar18) {
                puVar15 = puVar16;
                if (puVar14 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar14 >> 1))) {
                  puVar15 = (undefined4 *)((longlong)puVar14 + ((ulonglong)puVar14 >> 1));
                }
                if (puVar15 < puVar18) {
                  puVar15 = puVar18;
                }
                FUN_140051e60(&local_140,puVar15);
              }
            }
            if (local_138 != (undefined4 **)0x0) {
              *(int *)local_138 = *(int *)((longlong)local_140 + (lVar12 >> 2) * 4);
            }
          }
          else {
            if (local_138 == local_130) {
              uVar17 = (longlong)local_138 - (longlong)local_140 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar4 = (code *)swi(3);
                (*pcVar4)();
                return;
              }
              puVar18 = (undefined4 *)(uVar17 + 1);
              puVar14 = (undefined4 *)((longlong)local_130 - (longlong)local_140 >> 2);
              if (puVar14 < puVar18) {
                puVar15 = puVar16;
                if (puVar14 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar14 >> 1))) {
                  puVar15 = (undefined4 *)((longlong)puVar14 + ((ulonglong)puVar14 >> 1));
                }
                if (puVar15 < puVar18) {
                  puVar15 = puVar18;
                }
                FUN_140051e60(&local_140,puVar15);
              }
            }
            if (local_138 != (undefined4 **)0x0) {
              *(int *)local_138 = iVar7;
            }
          }
          local_138 = (undefined4 **)((longlong)local_138 + 4);
        }
        uVar3 = *(undefined8 *)(puVar20 + 0x50176ca8);
        uVar6 = FUN_1402970c0(lVar8,uVar3);
        local_178 = 1;
        piVar10 = (int *)FUN_140296600(lVar8,uVar2,uVar6,uVar3);
        iVar7 = *piVar10;
        local_168 = (undefined4 *)CONCAT44(local_168._4_4_,iVar7);
        if (0 < iVar7) {
          if ((&local_168 < local_118) && (local_120 <= &local_168)) {
            lVar12 = (longlong)&local_168 - (longlong)local_120;
            if (local_118 == local_110) {
              uVar17 = (longlong)local_118 - (longlong)local_120 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                pcVar4 = (code *)swi(3);
                (*pcVar4)();
                return;
              }
              puVar18 = (undefined4 *)(uVar17 + 1);
              puVar14 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
              if (puVar14 < puVar18) {
                puVar15 = puVar16;
                if (puVar14 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar14 >> 1))) {
                  puVar15 = (undefined4 *)((longlong)puVar14 + ((ulonglong)puVar14 >> 1));
                }
                if (puVar15 < puVar18) {
                  puVar15 = puVar18;
                }
                FUN_140051e60(&local_120,puVar15);
              }
            }
            if (local_118 != (undefined4 **)0x0) {
              *(int *)local_118 = *(int *)((longlong)local_120 + (lVar12 >> 2) * 4);
            }
          }
          else {
            if (local_118 == local_110) {
              uVar17 = (longlong)local_118 - (longlong)local_120 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                return;
              }
              puVar18 = (undefined4 *)(uVar17 + 1);
              puVar14 = (undefined4 *)((longlong)local_110 - (longlong)local_120 >> 2);
              if (puVar14 < puVar18) {
                puVar15 = puVar16;
                if (puVar14 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar14 >> 1))) {
                  puVar15 = (undefined4 *)((longlong)puVar14 + ((ulonglong)puVar14 >> 1));
                }
                if (puVar15 < puVar18) {
                  puVar15 = puVar18;
                }
                FUN_140051e60(&local_120,puVar15);
              }
            }
            if (local_118 != (undefined4 **)0x0) {
              *(int *)local_118 = iVar7;
            }
          }
          local_118 = (undefined4 **)((longlong)local_118 + 4);
        }
        puVar20 = puVar20 + 2;
      } while ((longlong)puVar20 < 0x28);
      uVar6 = FUN_1402970c0(lVar8,L"nDuelPoint");
      local_178 = 1;
      piVar10 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nDuelPoint");
      if (0 < *piVar10) {
        local_144 = *piVar10;
      }
      uVar6 = FUN_1402970c0(lVar8,L"nItemCount");
      local_178 = 1;
      piVar10 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nItemCount");
      iVar7 = local_14c._4_4_;
      if (0 < *piVar10) {
        iVar7 = *piVar10;
      }
      local_14c._4_4_ = iVar7;
      uVar6 = FUN_1402970c0(lVar8,L"nItemID");
      local_178 = 1;
      piVar10 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nItemID");
      if (0 < *piVar10) {
        local_14c._0_4_ = *piVar10;
      }
      uVar6 = FUN_1402970c0(lVar8,L"nGroupID");
      local_178 = 1;
      piVar10 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nGroupID");
      iVar7 = local_154._4_4_;
      if (0 < *piVar10) {
        iVar7 = *piVar10;
      }
      local_154._4_4_ = iVar7;
      uVar6 = FUN_1402970c0(lVar8,L"nType");
      local_178 = 1;
      piVar10 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nType");
      if (-1 < *piVar10) {
        local_154._0_4_ = *piVar10;
      }
      uVar6 = FUN_1402970c0(lVar8,L"wszDesc");
      local_178 = 1;
      psVar11 = (short *)FUN_140296b70(lVar8,uVar2,uVar6,L"wszDesc");
      uVar17 = 0xffffffffffffffff;
      psVar19 = psVar11;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar1 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_100,psVar11,~uVar17 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"nSortNumber");
      local_178 = 1;
      piVar10 = (int *)FUN_140296600(lVar8,uVar2,uVar6,L"nSortNumber");
      if (-1 < *piVar10) {
        local_d8 = *piVar10;
      }
      local_168 = &local_c0;
      local_c0 = local_158;
      local_bc = (int)local_154;
      local_b8 = local_154._4_4_;
      local_b4 = (int)local_14c;
      local_b0 = local_14c._4_4_;
      local_ac = local_144;
      local_c8 = uVar2;
      FUN_14012e520(local_a8,&local_140);
      FUN_14012e520(&local_88,&local_120);
      local_50 = 7;
      local_58 = 0;
      local_68 = 0;
      FUN_1400015e0(&local_68,&local_100,0,0xffffffffffffffff);
      local_40 = local_d8;
      FUN_1402e95f0(local_c8);
      if (7 < local_50) {
        operator_delete((void *)CONCAT62(uStack_66,local_68));
      }
      local_50 = 7;
      local_58 = 0;
      local_68 = 0;
      if (local_88 != (void *)0x0) {
        operator_delete(local_88);
      }
      local_88 = (void *)0x0;
      local_80 = 0;
      local_78 = 0;
      if (local_a8[0] != (void *)0x0) {
        operator_delete(local_a8[0]);
      }
      if (7 < local_e8) {
        operator_delete((void *)CONCAT62(uStack_fe,local_100));
      }
      local_e8 = 7;
      local_f0 = 0;
      local_100 = 0;
      if (local_120 != (undefined4 **)0x0) {
        operator_delete(local_120);
      }
      local_120 = (undefined4 **)0x0;
      local_118 = (undefined4 **)0x0;
      local_110 = (undefined4 **)0x0;
      if (local_140 != (undefined4 **)0x0) {
        operator_delete(local_140);
      }
      puVar20 = *(undefined4 **)(puVar9 + 6);
      if (*(undefined4 **)(puVar9 + 6) == (undefined4 *)0x0) {
        uVar5 = (uint)puVar9[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar12 = (longlong)(int)uVar5 << 3;
        puVar20 = puVar16;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar5) break;
          if (*(longlong *)(lVar12 + *(longlong *)(lVar8 + 0x68)) != 0) {
            puVar20 = *(undefined4 **)(lVar12 + *(longlong *)(lVar8 + 0x68));
          }
          uVar5 = uVar5 + 1;
          lVar12 = lVar12 + 8;
        } while (puVar20 == (undefined4 *)0x0);
      }
      goto LAB_1402e88ad;
    }
  }
  return;
}



void FUN_1402e8f60(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  if (*(void **)(param_1 + 0x38) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  if (*(void **)(param_1 + 0x18) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x18));
  }
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  return;
}



void FUN_1402e8fe0(longlong param_1)

{
  FUN_1402e8f60(param_1 + 8);
  return;
}



undefined8 * FUN_1402e8ff0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetNpcTradeShopDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf3c & 1) == 0) {
    DAT_14060cf3c = DAT_14060cf3c | 1;
    FUN_1402e9520(0x3f400000,0x3e800000,0x40100000);
    FUN_1402e8820();
    atexit((_func_5014 *)&LAB_140448f40);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetNpcTradeShopDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_1406086b0;
}



uint FUN_1402e90a0(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x24)) {
      if ((puVar1[0x26] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[7];
      }
    }
  }
  return 0;
}



void FUN_1402e90e0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0x308) {
      FUN_1402e8400(lVar2);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1402e9140(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (*param_1 <= param_2)) {
    lVar2 = param_2 - *param_1;
    lVar2 = lVar2 + SUB168(SEXT816(-0x5717c0a8e83f5717) * SEXT816(lVar2),8);
    if (uVar1 == param_1[2]) {
      FUN_1402e9210(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1402e9de0(param_1[1],((lVar2 >> 9) - (lVar2 >> 0x3f)) * 0x308 + *param_1,param_3,param_4,
                    uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_1402e9210(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1402e9de0(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x308;
  return;
}



void FUN_1402e9210(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  longlong lVar3;
  ulonglong uVar4;
  
  lVar3 = param_1[1] - *param_1;
  lVar3 = lVar3 + SUB168(SEXT816(-0x5717c0a8e83f5717) * SEXT816(lVar3),8);
  uVar4 = (lVar3 >> 9) - (lVar3 >> 0x3f);
  if (0x54741fab8be053 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  lVar3 = param_1[2] - *param_1;
  lVar3 = SUB168(SEXT816(-0x5717c0a8e83f5717) * SEXT816(lVar3),8) + lVar3;
  uVar2 = (lVar3 >> 9) - (lVar3 >> 0x3f);
  if (uVar2 < uVar4) {
    if (0x54741fab8be054 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar4) {
      uVar2 = uVar4;
    }
    FUN_1402e92c0(param_1,uVar2);
  }
  return;
}



void FUN_1402e92c0(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 (0x54741fab8be054 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  lVar4 = SUB168(SEXT816(-0x5717c0a8e83f5717) * 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 * 0x308), 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_1405d3608);
    }
    pcVar3 = local_res10;
    FUN_1402eab70(*param_1,param_1[1],local_res10,param_4,uVar6);
    lVar1 = param_1[1];
    lVar5 = *param_1;
    lVar4 = lVar1 - lVar5;
    lVar4 = lVar4 + SUB168(SEXT816(-0x5717c0a8e83f5717) * SEXT816(lVar4),8);
    if (lVar5 != 0) {
      for (; lVar5 != lVar1; lVar5 = lVar5 + 0x308) {
        FUN_1402e8400(lVar5);
      }
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x308);
    param_1[1] = (longlong)(pcVar3 + ((lVar4 >> 9) - (lVar4 >> 0x3f)) * 0x308);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



uint * FUN_1402e9430(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0xc4)) {
      if ((puVar2[0xc6] == param_2) && (*puVar2 == param_2)) {
        FUN_1402e96d0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402ea330(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_1402e96d0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_1402e9500(void)

{
  FUN_1402e9ae0();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_1402e9520(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_1406086cc = param_3;
  lVar1 = 0;
  DAT_1406086c0 = 0x11;
  DAT_1406086e4 = 10;
  _DAT_1406086c4 = param_1;
  _DAT_1406086c8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_1406086b0 = 0;
  DAT_1406086b8 = 0;
  DAT_1406086e0 = 0;
  DAT_1406086e8 = 0;
  DAT_1406086f0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_1406086d0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_1406086d8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_1406086d8 = 0;
  }
  return &DAT_1406086b0;
}



uint * FUN_1402e95f0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_1406086c0;
  if (DAT_1406086b0 == 0) {
    cVar2 = FUN_1402ea540((ulonglong)DAT_1406086c0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_1406086b0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x24)) {
      if ((puVar3[0x26] == param_1) && (*puVar3 == param_1)) {
        FUN_1402e9a60(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_1402ea900(param_1,uVar1,param_1);
  FUN_1402e9a60(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_1402e96b0(void)

{
  FUN_1402e9c40();
  return;
}



undefined4 * FUN_1402e96d0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff);
  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];
  FUN_1400015e0(param_1 + 0x2a,param_2 + 0x2a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x34,param_2 + 0x34,0,0xffffffffffffffff);
  param_1[0x3e] = param_2[0x3e];
  param_1[0x3f] = param_2[0x3f];
  param_1[0x40] = param_2[0x40];
  param_1[0x41] = param_2[0x41];
  param_1[0x42] = param_2[0x42];
  param_1[0x43] = param_2[0x43];
  param_1[0x44] = param_2[0x44];
  param_1[0x45] = param_2[0x45];
  param_1[0x46] = param_2[0x46];
  param_1[0x47] = param_2[0x47];
  param_1[0x48] = param_2[0x48];
  param_1[0x49] = param_2[0x49];
  param_1[0x4a] = param_2[0x4a];
  param_1[0x4b] = param_2[0x4b];
  param_1[0x4c] = param_2[0x4c];
  param_1[0x4d] = param_2[0x4d];
  FUN_14012bb70(param_1 + 0x4e,param_2 + 0x4e);
  FUN_14012bb70(param_1 + 0x56,param_2 + 0x56);
  FUN_14012bb70(param_1 + 0x5e,param_2 + 0x5e);
  FUN_14012bb70(param_1 + 0x66,param_2 + 0x66);
  param_1[0x6e] = param_2[0x6e];
  FUN_14012bb70(param_1 + 0x70,param_2 + 0x70);
  FUN_14012bb70(param_1 + 0x78,param_2 + 0x78);
  FUN_14012bb70(param_1 + 0x80,param_2 + 0x80);
  FUN_14012bb70(param_1 + 0x88,param_2 + 0x88);
  param_1[0x90] = param_2[0x90];
  param_1[0x91] = param_2[0x91];
  param_1[0x92] = param_2[0x92];
  param_1[0x93] = param_2[0x93];
  param_1[0x94] = param_2[0x94];
  param_1[0x95] = param_2[0x95];
  param_1[0x96] = param_2[0x96];
  param_1[0x97] = param_2[0x97];
  param_1[0x98] = param_2[0x98];
  param_1[0x99] = param_2[0x99];
  param_1[0x9a] = param_2[0x9a];
  param_1[0x9b] = param_2[0x9b];
  FUN_14012bb70(param_1 + 0x9c,param_2 + 0x9c);
  FUN_14012bb70(param_1 + 0xa4,param_2 + 0xa4);
  FUN_14012bb70(param_1 + 0xac,param_2 + 0xac);
  param_1[0xb4] = param_2[0xb4];
  param_1[0xb5] = param_2[0xb5];
  param_1[0xb6] = param_2[0xb6];
  FUN_14012bb70(param_1 + 0xb8,param_2 + 0xb8);
  param_1[0xc0] = param_2[0xc0];
  return param_1;
}



undefined4 * FUN_1402e9a60(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];
  param_1[5] = param_2[5];
  FUN_14012bb70();
  FUN_14012bb70(param_1 + 0xe,param_2 + 0xe);
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff);
  param_1[0x20] = param_2[0x20];
  return param_1;
}



void FUN_1402e9ae0(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 + 0x310);
        FUN_1402ea4a0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402e9c40(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_1406086e0 = DAT_1406086e0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_1406086b0;
  if ((DAT_1406086b0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_1406086c0, DAT_1406086c0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x90);
        FUN_1402eaac0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_1406086b0;
        uVar4 = DAT_1406086c0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_1406086b0 = (void *)0x0;
  DAT_1406086b8 = 0;
  if (DAT_1406086e0 == 0) {
    uVar5 = FUN_1402ea870(0);
    FUN_1402ea540(uVar5,0);
  }
  DAT_1406086f0 = 0;
  _Memory = DAT_1406086e8;
  if (DAT_1406086e8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_1406086e8 = (longlong *)0x0;
    DAT_1406086e0 = DAT_1406086e0 + -1;
    return;
  }
  DAT_1406086e0 = DAT_1406086e0 + -1;
  return;
}



void FUN_1402e9d40(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x98) % (ulonglong)DAT_1406086c0;
  if (param_1 != *(longlong *)(DAT_1406086b0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_1406086b0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x90); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x90))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x90) = *(undefined8 *)(param_1 + 0x90);
      FUN_1402eaac0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_1406086b0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x90);
  FUN_1402eaac0(param_1);
  return;
}



undefined4 * FUN_1402e9de0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(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_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1c) = 7;
  *(undefined8 *)(param_1 + 0x1a) = 0;
  *(undefined2 *)(param_1 + 0x16) = 0;
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff);
  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];
  *(undefined8 *)(param_1 + 0x30) = 7;
  *(undefined8 *)(param_1 + 0x2e) = 0;
  *(undefined2 *)(param_1 + 0x2a) = 0;
  FUN_1400015e0(param_1 + 0x2a,param_2 + 0x2a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x3a) = 7;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined2 *)(param_1 + 0x34) = 0;
  FUN_1400015e0(param_1 + 0x34,param_2 + 0x34,0,0xffffffffffffffff);
  param_1[0x3e] = param_2[0x3e];
  param_1[0x3f] = param_2[0x3f];
  param_1[0x40] = param_2[0x40];
  param_1[0x41] = param_2[0x41];
  param_1[0x42] = param_2[0x42];
  param_1[0x43] = param_2[0x43];
  param_1[0x44] = param_2[0x44];
  param_1[0x45] = param_2[0x45];
  param_1[0x46] = param_2[0x46];
  param_1[0x47] = param_2[0x47];
  param_1[0x48] = param_2[0x48];
  param_1[0x49] = param_2[0x49];
  param_1[0x4a] = param_2[0x4a];
  param_1[0x4b] = param_2[0x4b];
  param_1[0x4c] = param_2[0x4c];
  param_1[0x4d] = param_2[0x4d];
  FUN_14012e520(param_1 + 0x4e,param_2 + 0x4e);
  FUN_14012e520(param_1 + 0x56,param_2 + 0x56);
  FUN_14012e520(param_1 + 0x5e,param_2 + 0x5e);
  FUN_14012e520(param_1 + 0x66,param_2 + 0x66);
  param_1[0x6e] = param_2[0x6e];
  FUN_14012e520(param_1 + 0x70,param_2 + 0x70);
  FUN_14012e520(param_1 + 0x78,param_2 + 0x78);
  FUN_14012e520(param_1 + 0x80,param_2 + 0x80);
  FUN_14012e520(param_1 + 0x88,param_2 + 0x88);
  memcpy(param_1 + 0x90,param_2 + 0x90,0x28);
  param_1[0x9a] = param_2[0x9a];
  param_1[0x9b] = param_2[0x9b];
  FUN_14012e520(param_1 + 0x9c,param_2 + 0x9c);
  FUN_14012e520(param_1 + 0xa4,param_2 + 0xa4);
  FUN_14012e520(param_1 + 0xac,param_2 + 0xac);
  param_1[0xb4] = param_2[0xb4];
  param_1[0xb5] = param_2[0xb5];
  param_1[0xb6] = param_2[0xb6];
  FUN_14012e520(param_1 + 0xb8,param_2 + 0xb8);
  param_1[0xc0] = param_2[0xc0];
  return param_1;
}



void FUN_1402ea180(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x310);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x318) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x310) = *(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_1402ea330(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) < 800)
      goto LAB_1402ea3fd;
      lVar7 = uVar6 * 800;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402ea3fd:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 100 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x62] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -100;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0xc4);
  *puVar2 = param_2;
  FUN_1402e8290(puVar2 + 2);
  puVar2[0xc6] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0xc4) = *(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_1402cddb0(param_1);
    FUN_1402ea180(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402ea4a0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1402e8400(param_2 + 8);
  *(undefined8 *)(param_2 + 0x310) = *(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_1402cddb0(param_1);
    FUN_1402ea180(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;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_1402ea540(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_1406086b0 != (void *)0x0) {
    operator_delete__(DAT_1406086b0);
    DAT_1406086b0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_1406086b0 = operator_new(_Var1);
    if (DAT_1406086b0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_1406086b0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_1406086cc;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_1406086c8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_1406086d8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_1406086d8 = 0;
  }
  DAT_1406086d0 = (longlong)fVar4 + lVar2;
  DAT_1406086c0 = param_1;
  return CONCAT71((int7)(DAT_1406086d8 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1402ea690(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_1402ea870(DAT_1406086b8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_1406086c0) {
    if (DAT_1406086b0 == (void *)0x0) {
      FUN_1402ea540(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_1406086c0;
      if (DAT_1406086c0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_1406086b0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x90);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x98) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x90) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_1406086c0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_1406086b0);
      fVar10 = (float)param_1 * _DAT_1406086cc;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406086d0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_1406086c8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406086b0 = _Dst;
      DAT_1406086c0 = param_1;
      DAT_1406086d8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_1406086d8 = uVar6;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_1402ea870(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_1406086c4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_1402ea900(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_1406086f0 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_1406086e4);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xa0)
      goto LAB_1402ea9d4;
      lVar7 = uVar8 * 0xa0;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_1402ea9d4:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_1406086e8;
    puVar4 = puVar6 + (ulonglong)(DAT_1406086e4 - 1) * 0x14 + 2;
    DAT_1406086e8 = puVar6;
    uVar2 = DAT_1406086e4;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x12] = DAT_1406086f0;
      puVar4 = puVar6 + -0x14;
      DAT_1406086f0 = puVar6;
    }
  }
  puVar6 = DAT_1406086f0;
  if (DAT_1406086f0 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_1406086f0[0x12];
  *(undefined4 *)DAT_1406086f0 = param_1;
  DAT_1406086f0 = (undefined8 *)uVar3;
  puVar6[1] = 0;
  puVar6[2] = 0;
  puVar6[3] = 0;
  puVar6[4] = 0;
  puVar6[5] = 0;
  puVar6[6] = 0;
  puVar6[8] = 0;
  puVar6[9] = 0;
  puVar6[10] = 0;
  puVar6[0xf] = 7;
  puVar6[0xe] = 0;
  *(undefined2 *)(puVar6 + 0xc) = 0;
  *(undefined4 *)(puVar6 + 0x11) = 0;
  *(undefined4 *)(puVar6 + 0x13) = param_3;
  DAT_1406086b8 = DAT_1406086b8 + 1;
  puVar6[0x12] = *(undefined8 *)(DAT_1406086b0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_1406086b0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_1406086d0 < DAT_1406086b8) && (DAT_1406086e0 == 0)) {
    uVar5 = FUN_1402ea870();
    FUN_1402ea690(uVar5);
  }
  return puVar6;
}



void FUN_1402eaac0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_1402e8f60(param_1 + 8);
    *(longlong *)(param_1 + 0x90) = DAT_1406086f0;
    DAT_1406086b8 = DAT_1406086b8 - 1;
    DAT_1406086f0 = param_1;
    if ((DAT_1406086b8 < DAT_1406086d8) && (DAT_1406086e0 == 0)) {
      uVar2 = FUN_1402ea870(DAT_1406086b8);
      FUN_1402ea690(uVar2);
    }
    if ((DAT_1406086b8 == 0) &&
       (DAT_1406086f0 = 0, _Memory = DAT_1406086e8, DAT_1406086e8 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_1406086e8 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



longlong FUN_1402eab70(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x308) {
    if (param_3 != 0) {
      FUN_1402e9de0(param_3,param_1);
    }
    param_3 = param_3 + 0x308;
  }
  return param_3;
}



void FUN_1402eabd0(undefined8 param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"MISSION");
  FUN_140294650(uVar1,L"MISSION");
  FUN_140292e80(uVar1,L"MISSION",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"MISSION_REWARD");
  FUN_140294650(uVar1,L"MISSION_REWARD");
  FUN_140292e80(uVar1,L"MISSION_REWARD",uVar2);
  FUN_1402eac70(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001402ead38)
// WARNING: Removing unreachable block (ram,0x0001402ead40)

void FUN_1402eac70(longlong *param_1)

{
  float fVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  ulonglong *puVar7;
  uint uVar8;
  undefined4 uVar9;
  int iVar10;
  longlong lVar11;
  ulonglong uVar12;
  float *pfVar13;
  int *piVar14;
  longlong *plVar15;
  int *piVar16;
  longlong *plVar17;
  longlong lVar18;
  undefined1 auStack_108 [32];
  undefined1 local_e8;
  int *local_d8;
  longlong *local_d0;
  longlong *local_c0;
  ulonglong *local_b8;
  undefined8 local_a8;
  undefined8 uStack_a0;
  undefined8 local_98;
  undefined8 uStack_90;
  undefined8 local_88;
  undefined8 uStack_80;
  undefined8 local_78;
  undefined8 uStack_70;
  undefined8 local_68;
  undefined8 uStack_60;
  ulonglong local_58;
  
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  local_d0 = param_1;
  lVar11 = FUN_1402933b0(DAT_140607ff0,L"MISSION");
  *param_1 = lVar11;
  if (lVar11 != 0) {
    lVar11 = FUN_1402933b0(DAT_140607ff0);
    param_1[1] = lVar11;
    if (lVar11 != 0) {
      local_b8 = (ulonglong *)(param_1 + 2);
      if (param_1[2] != param_1[3]) {
        param_1[3] = param_1[2];
      }
      lVar11 = param_1[1];
      plVar17 = (longlong *)(lVar11 + 0x68);
      local_c0 = plVar17;
      if (*(longlong *)(lVar11 + 0x70) != 0) {
        uVar12 = 0;
        if (*(uint *)(lVar11 + 0x78) != 0) {
          plVar15 = (longlong *)*plVar17;
          do {
            if (*plVar15 != 0) {
              piVar16 = (int *)((longlong *)*plVar17)[uVar12];
              goto LAB_1402eadad;
            }
            uVar8 = (int)uVar12 + 1;
            uVar12 = (ulonglong)uVar8;
            plVar15 = plVar15 + 1;
          } while (uVar8 < *(uint *)(lVar11 + 0x78));
        }
      }
      piVar16 = (int *)0x0;
LAB_1402eadad:
      piVar14 = piVar16;
      if (piVar14 != (int *)0x0) {
        iVar2 = *piVar14;
        if (0 < iVar2) {
          iVar10 = 0;
          piVar16 = (int *)&uStack_80;
          lVar18 = 10;
          lVar11 = 0;
          local_d8 = piVar14;
          do {
            uVar3 = *(undefined8 *)((longlong)&PTR_u_fRatio00_1405daf60 + lVar11);
            lVar4 = param_1[1];
            uVar9 = FUN_1402970c0(lVar4,uVar3);
            local_e8 = 1;
            pfVar13 = (float *)FUN_1402967b0(lVar4,iVar2,uVar9,uVar3);
            if ((pfVar13 != (float *)0x0) && (0.0 < *pfVar13)) {
              lVar4 = local_d0[1];
              uVar3 = *(undefined8 *)((longlong)&PTR_u_nItemCode00_1405daf10 + lVar11);
              uVar9 = FUN_1402970c0(lVar4,uVar3);
              local_e8 = 1;
              piVar14 = (int *)FUN_140296600(lVar4,iVar2,uVar9,uVar3);
              fVar1 = *pfVar13;
              piVar16[-10] = *piVar14;
              iVar10 = (int)(fVar1 * 100.0) + iVar10;
              *piVar16 = iVar10;
            }
            puVar7 = local_b8;
            param_1 = local_d0;
            piVar14 = local_d8;
            lVar11 = lVar11 + 8;
            piVar16 = piVar16 + 1;
            lVar18 = lVar18 + -1;
          } while (lVar18 != 0);
          puVar5 = (undefined8 *)local_b8[1];
          if ((&local_a8 < puVar5) && (puVar6 = (undefined8 *)*local_b8, puVar6 <= &local_a8)) {
            if (puVar5 == (undefined8 *)local_b8[2]) {
              FUN_1402eb0e0(local_b8);
            }
            if ((void *)puVar7[1] != (void *)0x0) {
              memcpy((void *)puVar7[1],
                     (void *)((((longlong)&local_a8 - (longlong)puVar6) / 0x50) * 0x50 + *puVar7),
                     0x50);
            }
          }
          else {
            if (puVar5 == (undefined8 *)local_b8[2]) {
              FUN_1402eb0e0(local_b8);
            }
            puVar5 = (undefined8 *)puVar7[1];
            if (puVar5 != (undefined8 *)0x0) {
              *puVar5 = local_a8;
              puVar5[1] = uStack_a0;
              puVar5[2] = local_98;
              puVar5[3] = uStack_90;
              puVar5[4] = local_88;
              puVar5[5] = uStack_80;
              puVar5[6] = local_78;
              puVar5[7] = uStack_70;
              puVar5[8] = local_68;
              puVar5[9] = uStack_60;
            }
          }
          puVar7[1] = puVar7[1] + 0x50;
          plVar17 = local_c0;
        }
        piVar16 = *(int **)(piVar14 + 6);
        if (piVar16 == (int *)0x0) {
          uVar8 = (uint)piVar14[8] % *(uint *)(plVar17 + 2) + 1;
          lVar11 = (longlong)(int)uVar8 << 3;
          do {
            if (*(uint *)(plVar17 + 2) <= uVar8) break;
            if (*(longlong *)(*plVar17 + lVar11) != 0) {
              piVar16 = *(int **)(*plVar17 + lVar11);
            }
            uVar8 = uVar8 + 1;
            lVar11 = lVar11 + 8;
          } while (piVar16 == (int *)0x0);
        }
        goto LAB_1402eadad;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402eb020(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetMissionDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf38 & 1) == 0) {
    DAT_14060cf38 = DAT_14060cf38 | 1;
    _DAT_140608678 = 0;
    DAT_140608688 = 0;
    _DAT_140608690 = 0;
    _DAT_140608698 = 0;
    FUN_1402eac70(&DAT_140608678);
    atexit(FUN_140448f50);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetMissionDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_140608678;
}



void FUN_1402eb0e0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x50;
  if (0x333333333333332 < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x50;
  if (uVar2 < uVar3) {
    if (0x333333333333333 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_140053f90(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140053f90(param_1,uVar2);
  }
  return;
}



void FUN_1402eb1a0(void)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  plVar3 = DAT_14060a4d8;
  if (DAT_14060a4d8 != (longlong *)0x0) {
    LOCK();
    plVar1 = DAT_14060a4d8 + 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);
      }
    }
  }
  plVar3 = DAT_14060a4c8;
  if (DAT_14060a4c8 != (longlong *)0x0) {
    LOCK();
    plVar1 = DAT_14060a4c8 + 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);
      }
    }
  }
  plVar3 = DAT_14060a4b8;
  if (DAT_14060a4b8 != (longlong *)0x0) {
    LOCK();
    plVar1 = DAT_14060a4b8 + 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);
      }
    }
  }
  plVar3 = DAT_14060a4a8;
  if (DAT_14060a4a8 != (longlong *)0x0) {
    LOCK();
    plVar1 = DAT_14060a4a8 + 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_1402eb280(undefined8 param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined1 local_48 [8];
  longlong *local_40;
  undefined1 local_38 [8];
  longlong *local_30;
  undefined1 local_28 [8];
  longlong *local_20;
  undefined1 local_18 [8];
  longlong *local_10;
  
  FUN_1402ed720(DAT_140608060,local_48,L"FRANTZ_SKILL",0,0);
  if (local_40 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_40 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_40 + 8))(local_40);
      LOCK();
      piVar2 = (int *)((longlong)local_40 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_40 + 0x10))(local_40);
      }
    }
  }
  FUN_1402ed720(DAT_140608060,local_38,L"ANGELA_SKILL",0,0);
  if (local_30 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_30 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_30 + 8))(local_30);
      LOCK();
      piVar2 = (int *)((longlong)local_30 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_30 + 0x10))(local_30);
      }
    }
  }
  FUN_1402ed720(DAT_140608060,local_28,L"TUDE_SKILL",0,0);
  if (local_20 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_20 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_20 + 8))(local_20);
      LOCK();
      piVar2 = (int *)((longlong)local_20 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_20 + 0x10))(local_20);
      }
    }
  }
  FUN_1402ed720(DAT_140608060,local_18,L"NATASHA_SKILL",0,0);
  if (local_10 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_10 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_10 + 8))(local_10);
      LOCK();
      piVar2 = (int *)((longlong)local_10 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_10 + 0x10))(local_10);
      }
    }
  }
  uVar3 = DAT_140607ff0;
  uVar4 = FUN_140294ca0(DAT_140607ff0,L"FRANTZ_SKILL_TREE");
  FUN_140294650(uVar3,L"FRANTZ_SKILL_TREE");
  FUN_140292e80(uVar3,L"FRANTZ_SKILL_TREE",uVar4);
  uVar3 = DAT_140607ff0;
  uVar4 = FUN_140294ca0(DAT_140607ff0,L"ANGELA_SKILL_TREE");
  FUN_140294650(uVar3,L"ANGELA_SKILL_TREE");
  FUN_140292e80(uVar3,L"ANGELA_SKILL_TREE",uVar4);
  uVar3 = DAT_140607ff0;
  uVar4 = FUN_140294ca0(DAT_140607ff0,L"TUDE_SKILL_TREE");
  FUN_140294650(uVar3,L"TUDE_SKILL_TREE");
  FUN_140292e80(uVar3,L"TUDE_SKILL_TREE",uVar4);
  uVar3 = DAT_140607ff0;
  uVar4 = FUN_140294ca0(DAT_140607ff0,L"NATASHA_SKILL_TREE");
  FUN_140294650(uVar3,L"NATASHA_SKILL_TREE");
  FUN_140292e80(uVar3,L"NATASHA_SKILL_TREE",uVar4);
  FUN_1402eb4c0(param_1);
  return;
}



void FUN_1402eb4c0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  undefined1 local_50 [8];
  longlong *local_48;
  undefined1 local_40 [8];
  longlong *local_38;
  undefined1 local_30 [8];
  longlong *local_28;
  undefined1 local_20 [8];
  longlong *local_18;
  
  lVar3 = DAT_140608060;
  EnterCriticalSection(DAT_140608290);
  FUN_1402edc80(lVar3 + 0x10);
  LeaveCriticalSection(DAT_140608290);
  uVar4 = FUN_1402ed720(DAT_140608060,local_50,L"FRANTZ_SKILL",0,0);
  FUN_140343ec0(param_1,uVar4);
  if (local_48 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_48 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_48 + 8))(local_48);
      LOCK();
      piVar2 = (int *)((longlong)local_48 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_48 + 0x10))(local_48);
      }
    }
  }
  uVar4 = FUN_1402ed720(DAT_140608060,local_40,L"ANGELA_SKILL",0,0);
  FUN_140343ec0(param_1 + 0x10,uVar4);
  if (local_38 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_38 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_38 + 8))(local_38);
      LOCK();
      piVar2 = (int *)((longlong)local_38 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_38 + 0x10))(local_38);
      }
    }
  }
  uVar4 = FUN_1402ed720(DAT_140608060,local_30,L"TUDE_SKILL",0,0);
  FUN_140343ec0(param_1 + 0x20,uVar4);
  if (local_28 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_28 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_28 + 8))(local_28);
      LOCK();
      piVar2 = (int *)((longlong)local_28 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_28 + 0x10))(local_28);
      }
    }
  }
  uVar4 = FUN_1402ed720(DAT_140608060,local_20,L"NATASHA_SKILL",0,0);
  FUN_140343ec0(param_1 + 0x30,uVar4);
  if (local_18 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_18 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_18 + 8))(local_18);
      LOCK();
      piVar2 = (int *)((longlong)local_18 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_18 + 0x10))(local_18);
      }
    }
  }
  uVar4 = FUN_1402933b0(DAT_140607ff0,L"FRANTZ_SKILL_TREE");
  *(undefined8 *)(param_1 + 0x40) = uVar4;
  uVar4 = FUN_1402933b0(DAT_140607ff0,L"ANGELA_SKILL_TREE");
  *(undefined8 *)(param_1 + 0x48) = uVar4;
  uVar4 = FUN_1402933b0(DAT_140607ff0,L"TUDE_SKILL_TREE");
  *(undefined8 *)(param_1 + 0x50) = uVar4;
  uVar4 = FUN_1402933b0(DAT_140607ff0,L"NATASHA_SKILL_TREE");
  *(undefined8 *)(param_1 + 0x58) = uVar4;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402eb6e0(longlong param_1,int param_2,int param_3,int param_4,undefined8 param_5)

{
  undefined4 uVar1;
  int iVar2;
  uint uVar3;
  undefined4 uVar4;
  int iVar5;
  ulonglong uVar6;
  int *piVar7;
  undefined4 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  int *piVar11;
  longlong lVar12;
  int iVar13;
  undefined4 *puVar14;
  undefined1 auStack_78 [32];
  undefined1 local_58;
  int local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  ulonglong local_30;
  
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_78;
  if (((param_2 == 1) || (param_2 == 0x65)) || (param_2 == 0x66)) {
    lVar12 = *(longlong *)(param_1 + 0x40);
  }
  else if (((param_2 == 2) || (param_2 == 0xc9)) || (param_2 == 0xca)) {
    lVar12 = *(longlong *)(param_1 + 0x48);
  }
  else if (((param_2 == 3) || (param_2 == 0x12d)) || (param_2 == 0x12e)) {
    lVar12 = *(longlong *)(param_1 + 0x50);
  }
  else {
    if (((param_2 != 4) && (param_2 != 0x191)) && (param_2 != 0x192)) {
      return;
    }
    lVar12 = *(longlong *)(param_1 + 0x58);
  }
  if (lVar12 != 0) {
    if (*(longlong *)(lVar12 + 0x70) != 0) {
      uVar6 = 0;
      if (*(uint *)(lVar12 + 0x78) != 0) {
        plVar10 = *(longlong **)(lVar12 + 0x68);
        do {
          if (*plVar10 != 0) {
            puVar8 = (undefined4 *)(*(longlong **)(lVar12 + 0x68))[uVar6];
            goto LAB_1402eb7c7;
          }
          uVar3 = (int)uVar6 + 1;
          uVar6 = (ulonglong)uVar3;
          plVar10 = plVar10 + 1;
        } while (uVar3 < *(uint *)(lVar12 + 0x78));
      }
    }
    puVar8 = (undefined4 *)0x0;
LAB_1402eb7c7:
    puVar14 = puVar8;
    if (puVar14 != (undefined4 *)0x0) {
      uVar1 = *puVar14;
      uVar4 = FUN_1402970c0(lVar12,L"nSkillID");
      local_58 = 1;
      piVar7 = (int *)FUN_140296600(lVar12,uVar1,uVar4,L"nSkillID");
      if (*piVar7 == param_3) {
        uVar4 = FUN_1402970c0(lVar12,L"nSkillLevel");
        local_58 = 0;
        piVar7 = (int *)FUN_140296600(lVar12,uVar1,uVar4,L"nSkillLevel");
        if ((piVar7 == (int *)0x0) || (*piVar7 == param_4)) {
          iVar13 = 0;
          uVar4 = FUN_1402970c0(lVar12,L"nBeforeSkillID00");
          local_58 = 1;
          puVar8 = (undefined4 *)FUN_140296600(lVar12,uVar1,uVar4,L"nBeforeSkillID00");
          local_44 = *puVar8;
          uVar4 = FUN_1402970c0(lVar12,L"nBeforeSkillLevel00");
          local_58 = 1;
          piVar7 = (int *)FUN_140296600(lVar12,uVar1,uVar4,L"nBeforeSkillLevel00");
          local_48 = *piVar7;
          uVar4 = FUN_1402970c0(lVar12,L"nBeforeSkillID01");
          local_58 = 1;
          puVar8 = (undefined4 *)FUN_140296600(lVar12,uVar1,uVar4,L"nBeforeSkillID01");
          local_3c = *puVar8;
          uVar4 = FUN_1402970c0(lVar12,L"nBeforeSkillLevel01");
          local_58 = 1;
          puVar8 = (undefined4 *)FUN_140296600(lVar12,uVar1,uVar4,L"nBeforeSkillLevel01");
          local_40 = *puVar8;
          uVar4 = FUN_1402970c0(lVar12,L"nBeforeSkillID02");
          local_58 = 1;
          puVar8 = (undefined4 *)FUN_140296600(lVar12,uVar1,uVar4,L"nBeforeSkillID02");
          local_34 = *puVar8;
          uVar4 = FUN_1402970c0(lVar12,L"nBeforeSkillLevel02");
          local_58 = 1;
          puVar8 = (undefined4 *)FUN_140296600(lVar12,uVar1,uVar4,L"nBeforeSkillLevel02");
          uVar3 = 0;
          piVar7 = &local_48;
          local_38 = *puVar8;
          iVar5 = DAT_1406080c0;
          do {
            piVar11 = piVar7;
            if (2 < uVar3) {
              if (iVar5 == 0) {
                FUN_140176d60(0);
                iVar5 = DAT_1406080c0;
              }
              iVar5 = iVar5 + 1;
              piVar11 = &DAT_14060cfc0;
              DAT_1406080c0 = iVar5;
            }
            iVar2 = *piVar11;
            piVar11 = piVar7;
            if (2 < uVar3) {
              if (iVar5 == 0) {
                FUN_140176d60(0);
                iVar5 = DAT_1406080c0;
              }
              iVar5 = iVar5 + 1;
              piVar11 = &DAT_14060cfc0;
              DAT_1406080c0 = iVar5;
            }
            iVar13 = iVar13 + iVar2 + piVar11[1];
            uVar3 = uVar3 + 1;
            piVar7 = piVar7 + 2;
          } while ((int)uVar3 < 3);
          if (0 < iVar13) {
            FUN_1402ecd80(param_5);
          }
        }
      }
      puVar8 = *(undefined4 **)(puVar14 + 6);
      if (puVar8 == (undefined4 *)0x0) {
        uVar3 = (uint)puVar14[8] % *(uint *)(lVar12 + 0x78) + 1;
        lVar9 = (longlong)(int)uVar3 << 3;
        do {
          if (*(uint *)(lVar12 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar9 + *(longlong *)(lVar12 + 0x68)) != 0) {
            puVar8 = *(undefined4 **)(lVar9 + *(longlong *)(lVar12 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_1402eb7c7;
    }
  }
  return;
}



undefined8 FUN_1402eba60(undefined8 *param_1,int param_2)

{
  if (((param_2 == 1) || (param_2 == 0x65)) || (param_2 == 0x66)) {
    return *param_1;
  }
  if (((param_2 != 2) && (param_2 != 0xc9)) && (param_2 != 0xca)) {
    if (((param_2 != 3) && (param_2 != 0x12d)) && (param_2 != 0x12e)) {
      if (((param_2 != 4) && (param_2 != 0x191)) && (param_2 != 0x192)) {
        return 0;
      }
      return param_1[6];
    }
    return param_1[4];
  }
  return param_1[2];
}



undefined4 * FUN_1402ebad0(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];
  *(undefined1 *)(param_1 + 4) = *(undefined1 *)(param_2 + 4);
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  FUN_1400015e0(param_1 + 0x26,param_2 + 0x26,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x30,param_2 + 0x30,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x3a,param_2 + 0x3a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x44,param_2 + 0x44,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x4e,param_2 + 0x4e,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x58,param_2 + 0x58,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x62,param_2 + 0x62,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x6c,param_2 + 0x6c,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x76,param_2 + 0x76,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x80,param_2 + 0x80,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x8a,param_2 + 0x8a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x94,param_2 + 0x94,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x9e,param_2 + 0x9e,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xa8,param_2 + 0xa8,0,0xffffffffffffffff);
  FUN_1402ecc10(param_1 + 0xb2,param_2 + 0xb2);
  FUN_1402ecc10(param_1 + 0xba,param_2 + 0xba);
  FUN_1402ebda0(param_1 + 0xc2,param_2 + 0xc2);
  FUN_1402ebe10(param_1 + 0xea,param_2 + 0xea);
  return param_1;
}



longlong FUN_1402ebda0(longlong param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = 4;
  lVar1 = param_1;
  do {
    FUN_1400015e0(lVar1,lVar1 + (param_2 - param_1),0,0xffffffffffffffff);
    lVar1 = lVar1 + 0x28;
    lVar2 = lVar2 + -1;
  } while (lVar2 != 0);
  return param_1;
}



undefined1 * FUN_1402ebe10(undefined1 *param_1,undefined1 *param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  longlong *plVar4;
  
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x28);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x2c);
  *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(param_2 + 0x34);
  *(undefined4 *)(param_1 + 0x38) = *(undefined4 *)(param_2 + 0x38);
  *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_2 + 0x3c);
  *(undefined4 *)(param_1 + 0x40) = *(undefined4 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x44) = *(undefined4 *)(param_2 + 0x44);
  *(undefined8 *)(param_1 + 0x48) = *(undefined8 *)(param_2 + 0x48);
  lVar3 = *(longlong *)(param_2 + 0x50);
  if (lVar3 != *(longlong *)(param_1 + 0x50)) {
    if (lVar3 != 0) {
      LOCK();
      *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
      UNLOCK();
    }
    plVar4 = *(longlong **)(param_1 + 0x50);
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar4 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar4 + 8))(plVar4);
        LOCK();
        piVar2 = (int *)((longlong)plVar4 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    *(longlong *)(param_1 + 0x50) = lVar3;
  }
  *(undefined8 *)(param_1 + 0x58) = *(undefined8 *)(param_2 + 0x58);
  lVar3 = *(longlong *)(param_2 + 0x60);
  if (lVar3 != *(longlong *)(param_1 + 0x60)) {
    if (lVar3 != 0) {
      LOCK();
      *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
      UNLOCK();
    }
    plVar4 = *(longlong **)(param_1 + 0x60);
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar4 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar4 + 8))(plVar4);
        LOCK();
        piVar2 = (int *)((longlong)plVar4 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    *(longlong *)(param_1 + 0x60) = lVar3;
  }
  return param_1;
}



void FUN_1402ebf60(undefined8 param_1,undefined8 param_2,int param_3)

{
  ulonglong uVar1;
  longlong lVar2;
  ushort uVar3;
  uint uVar4;
  longlong *plVar5;
  ulonglong uVar6;
  longlong lVar7;
  longlong *plVar8;
  longlong lVar9;
  wchar_t *pwVar10;
  ushort *puVar11;
  longlong lVar12;
  wchar_t *pwVar13;
  ushort *puVar14;
  longlong lVar15;
  bool bVar16;
  
  plVar5 = (longlong *)FUN_1402eba60();
  if (plVar5 == (longlong *)0x0) {
    return;
  }
  if (plVar5[1] != 0) {
    uVar6 = 0;
    if (*(uint *)(plVar5 + 2) != 0) {
      plVar8 = (longlong *)*plVar5;
      do {
        if (*plVar8 != 0) {
          lVar12 = ((longlong *)*plVar5)[uVar6];
          goto joined_r0x0001402ebfb5;
        }
        uVar4 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar4;
        plVar8 = plVar8 + 1;
      } while (uVar4 < *(uint *)(plVar5 + 2));
    }
  }
  lVar12 = 0;
joined_r0x0001402ebfb5:
  if (lVar12 == 0) {
    return;
  }
  lVar15 = 0;
  if ((lVar12 != 0) && (lVar15 = *(longlong *)(lVar12 + 0x18), lVar15 == 0)) {
    uVar4 = *(uint *)(lVar12 + 0x20) % *(uint *)(plVar5 + 2) + 1;
    lVar7 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(plVar5 + 2) <= uVar4) break;
      if (*(longlong *)(*plVar5 + lVar7) != 0) {
        lVar15 = *(longlong *)(*plVar5 + lVar7);
      }
      uVar4 = uVar4 + 1;
      lVar7 = lVar7 + 8;
    } while (lVar15 == 0);
  }
  lVar7 = *(longlong *)(lVar12 + 8);
  if (*(longlong *)(lVar7 + 0x38) != 0) {
    uVar4 = 0;
    lVar12 = 0;
    if (*(uint *)(lVar7 + 0x40) != 0) {
      plVar8 = *(longlong **)(lVar7 + 0x30);
      do {
        if (*plVar8 != 0) {
          lVar12 = (*(longlong **)(lVar7 + 0x30))[lVar12];
          goto joined_r0x0001402ec05a;
        }
        uVar4 = uVar4 + 1;
        lVar12 = lVar12 + 1;
        plVar8 = plVar8 + 1;
      } while (uVar4 < *(uint *)(lVar7 + 0x40));
    }
  }
  lVar12 = 0;
joined_r0x0001402ec05a:
  do {
    lVar2 = lVar12;
    lVar12 = lVar15;
    if (lVar2 == 0) goto joined_r0x0001402ebfb5;
    lVar12 = 0;
    if ((lVar2 != 0) && (lVar12 = *(longlong *)(lVar2 + 0x418), lVar12 == 0)) {
      uVar4 = *(uint *)(lVar2 + 0x420) % *(uint *)(lVar7 + 0x40) + 1;
      lVar9 = (longlong)(int)uVar4 << 3;
      do {
        if (*(uint *)(lVar7 + 0x40) <= uVar4) break;
        if (*(longlong *)(lVar9 + *(longlong *)(lVar7 + 0x30)) != 0) {
          lVar12 = *(longlong *)(lVar9 + *(longlong *)(lVar7 + 0x30));
        }
        uVar4 = uVar4 + 1;
        lVar9 = lVar9 + 8;
      } while (lVar12 == 0);
    }
    if (*(int *)(lVar2 + 0x30) == 1) {
      if (param_3 == 0) {
        pwVar10 = (wchar_t *)(lVar2 + 0xa0);
        uVar6 = *(ulonglong *)(lVar2 + 0xb0);
        if (7 < *(ulonglong *)(lVar2 + 0xb8)) {
          pwVar10 = *(wchar_t **)pwVar10;
        }
        pwVar13 = L"TYPE_ALL";
        uVar1 = 8;
        if (uVar6 < 8) {
          uVar1 = uVar6;
        }
        for (; uVar1 != 0; uVar1 = uVar1 - 1) {
          if (*pwVar10 != *pwVar13) {
            uVar4 = 1;
            if ((ushort)*pwVar10 < (ushort)*pwVar13) {
              uVar4 = 0xffffffff;
            }
            goto LAB_1402ec10e;
          }
          pwVar10 = pwVar10 + 1;
          pwVar13 = pwVar13 + 1;
        }
        uVar4 = 0;
LAB_1402ec10e:
        if (uVar4 != 0) goto LAB_1402ec1b3;
        if (7 < uVar6) {
          bVar16 = uVar6 == 8;
          goto LAB_1402ec1b0;
        }
        goto joined_r0x0001402ec05a;
      }
      if (param_3 == 1) {
        puVar11 = (ushort *)(lVar2 + 0xa0);
        uVar6 = *(ulonglong *)(lVar2 + 0xb0);
        if (7 < *(ulonglong *)(lVar2 + 0xb8)) {
          puVar11 = *(ushort **)puVar11;
        }
        puVar14 = &DAT_1404c8368;
        uVar1 = 6;
        if (uVar6 < 6) {
          uVar1 = uVar6;
        }
        for (; uVar1 != 0; uVar1 = uVar1 - 1) {
          uVar3 = *puVar14;
          if (*puVar11 != uVar3) goto LAB_1402ec2a2;
          puVar11 = puVar11 + 1;
          puVar14 = puVar14 + 1;
        }
      }
      else if (param_3 == 2) {
        puVar11 = (ushort *)(lVar2 + 0xa0);
        uVar6 = *(ulonglong *)(lVar2 + 0xb0);
        if (7 < *(ulonglong *)(lVar2 + 0xb8)) {
          puVar11 = *(ushort **)puVar11;
        }
        puVar14 = &DAT_1404c8378;
        uVar1 = 6;
        if (uVar6 < 6) {
          uVar1 = uVar6;
        }
        for (; uVar1 != 0; uVar1 = uVar1 - 1) {
          uVar3 = *puVar14;
          if (*puVar11 != uVar3) goto LAB_1402ec2a2;
          puVar11 = puVar11 + 1;
          puVar14 = puVar14 + 1;
        }
      }
      else {
        if (param_3 != 3) goto joined_r0x0001402ec05a;
        puVar11 = (ushort *)(lVar2 + 0xa0);
        uVar6 = *(ulonglong *)(lVar2 + 0xb0);
        if (7 < *(ulonglong *)(lVar2 + 0xb8)) {
          puVar11 = *(ushort **)puVar11;
        }
        puVar14 = &DAT_1404c8388;
        uVar1 = 6;
        if (uVar6 < 6) {
          uVar1 = uVar6;
        }
        for (; uVar1 != 0; uVar1 = uVar1 - 1) {
          uVar3 = *puVar14;
          if (*puVar11 != uVar3) goto LAB_1402ec2a2;
          puVar11 = puVar11 + 1;
          puVar14 = puVar14 + 1;
        }
      }
      uVar4 = 0;
      goto LAB_1402ec19c;
    }
  } while( true );
LAB_1402ec2a2:
  uVar4 = 1;
  if (*puVar11 < uVar3) {
    uVar4 = 0xffffffff;
  }
LAB_1402ec19c:
  if (uVar4 == 0) {
    if (uVar6 < 6) goto joined_r0x0001402ec05a;
    bVar16 = uVar6 == 6;
LAB_1402ec1b0:
    uVar4 = (uint)!bVar16;
  }
LAB_1402ec1b3:
  if (uVar4 == 0) {
    FUN_1402ece70();
  }
  goto joined_r0x0001402ec05a;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402ec2c0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetSkillDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf34 & 1) == 0) {
    DAT_14060cf34 = DAT_14060cf34 | 1;
    _DAT_14060a4a0 = 0;
    DAT_14060a4a8 = 0;
    _DAT_14060a4b0 = 0;
    DAT_14060a4b8 = 0;
    _DAT_14060a4c0 = 0;
    DAT_14060a4c8 = 0;
    _DAT_14060a4d0 = 0;
    DAT_14060a4d8 = 0;
    FUN_1402eb4c0(&DAT_14060a4a0);
    atexit((_func_5014 *)&LAB_140448f90);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetSkillDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_14060a4a0;
}



void FUN_1402ec3a0(undefined8 param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"FRANTZ_ATTACK");
  FUN_140294650(uVar1,L"FRANTZ_ATTACK");
  FUN_140292e80(uVar1,L"FRANTZ_ATTACK",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"ANGELA_ATTACK");
  FUN_140294650(uVar1,L"ANGELA_ATTACK");
  FUN_140292e80(uVar1,L"ANGELA_ATTACK",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"TUDE_ATTACK");
  FUN_140294650(uVar1,L"TUDE_ATTACK");
  FUN_140292e80(uVar1,L"TUDE_ATTACK",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"NATASHA_ATTACK");
  FUN_140294650(uVar1,L"NATASHA_ATTACK");
  FUN_140292e80(uVar1,L"NATASHA_ATTACK",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"TUDE_AVATAR01_ATTACK");
  FUN_140294650(uVar1,L"TUDE_AVATAR01_ATTACK");
  FUN_140292e80(uVar1,L"TUDE_AVATAR01_ATTACK",uVar2);
  uVar1 = DAT_140607ff0;
  uVar2 = FUN_140294ca0(DAT_140607ff0,L"NATASHA_AVATAR01_ATTACK");
  FUN_140294650(uVar1,L"NATASHA_AVATAR01_ATTACK");
  FUN_140292e80(uVar1,L"NATASHA_AVATAR01_ATTACK",uVar2);
  FUN_1402ec530(param_1);
  return;
}



void FUN_1402ec530(undefined8 *param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar1 = FUN_1402933b0(DAT_140607ff0,L"FRANTZ_ATTACK");
  uVar2 = DAT_140607ff0;
  *param_1 = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"ANGELA_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[1] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"TUDE_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[2] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"NATASHA_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[3] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"FRANTZ_AVATAR01_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[4] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"ANGELA_AVATAR01_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[6] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"TUDE_AVATAR01_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[8] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"NATASHA_AVATAR01_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[10] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"FRANTZ_AVATAR02_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[5] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"ANGELA_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[7] = uVar1;
  uVar1 = FUN_1402933b0(uVar2,L"TUDE_AVATAR01_ATTACK");
  uVar2 = DAT_140607ff0;
  param_1[9] = uVar1;
  uVar2 = FUN_1402933b0(uVar2,L"NATASHA_ATTACK");
  param_1[0xb] = uVar2;
  return;
}



undefined * FUN_1402ec660(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetAttackDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf30 & 1) == 0) {
    DAT_14060cf30 = DAT_14060cf30 | 1;
    FUN_1402ec530(&DAT_14060cdf0);
    atexit((_func_5014 *)&DAT_140448fa0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetAttackDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_14060cdf0;
}



void FUN_1402ec700(undefined8 *param_1,int param_2,int param_3,undefined4 *param_4,
                  undefined4 *param_5)

{
  undefined8 uVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  int iVar4;
  
  iVar4 = param_2 + 10;
  if (param_3 != 0) {
    if (param_3 == 1) {
      param_2 = param_2 + 100;
    }
    else if (param_3 == 2) {
      param_2 = param_2 + 200;
    }
    else if (param_3 == 3) {
      param_2 = param_2 + 300;
    }
    else {
      if (param_3 != 4) goto LAB_1402ec760;
      param_2 = param_2 + 400;
    }
    iVar4 = param_2 + 10;
  }
LAB_1402ec760:
  uVar1 = *param_1;
  uVar2 = FUN_1402970c0(uVar1,L"nSkill00");
  puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill00",1);
  if (puVar3 != (undefined4 *)0x0) {
    *param_4 = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill01");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill01",1);
    param_4[1] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill02");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill02",1);
    param_4[2] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill03");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill03",1);
    param_4[3] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill04");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill04",1);
    param_4[4] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill05");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill05",1);
    param_4[5] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill06");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill06",1);
    param_4[6] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill07");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill07",1);
    param_4[7] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill08");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill08",1);
    param_4[8] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill09");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,param_2,uVar2,L"nSkill09",1);
    param_4[9] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill00");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill00",1);
    *param_5 = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill01");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill01",1);
    param_5[1] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill02");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill02",1);
    param_5[2] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill03");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill03",1);
    param_5[3] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill04");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill04",1);
    param_5[4] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill05");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill05",1);
    param_5[5] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill06");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill06",1);
    param_5[6] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill07");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill07",1);
    param_5[7] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill08");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill08",1);
    param_5[8] = *puVar3;
    uVar1 = *param_1;
    uVar2 = FUN_1402970c0(uVar1,L"nSkill09");
    puVar3 = (undefined4 *)FUN_140296600(uVar1,iVar4,uVar2,L"nSkill09",1);
    param_5[9] = *puVar3;
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402ecb70(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetBaseSkillDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf2c & 1) == 0) {
    DAT_14060cf2c = DAT_14060cf2c | 1;
    _DAT_14060cde0 = FUN_1402933b0(DAT_140607ff0,L"BASE_SKILL");
    atexit((_func_5014 *)&DAT_140448fb0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetBaseSkillDB",uVar3,pcVar4,DVar5
                 );
  }
  return &DAT_14060cde0;
}



longlong * FUN_1402ecc10(longlong *param_1,longlong *param_2)

{
  size_t _Size;
  void *_Dst;
  char cVar1;
  longlong lVar2;
  void *pvVar3;
  ulonglong uVar4;
  void *_Src;
  ulonglong uVar5;
  
  if (param_1 == param_2) {
    return param_1;
  }
  pvVar3 = (void *)*param_2;
  uVar4 = param_2[1] - (longlong)pvVar3 >> 2;
  if (uVar4 == 0) {
    pvVar3 = (void *)*param_1;
    if (pvVar3 != (void *)param_1[1]) {
      memmove(pvVar3,(void *)param_1[1],0);
      param_1[1] = (longlong)pvVar3;
      return param_1;
    }
  }
  else {
    _Dst = (void *)*param_1;
    uVar5 = param_1[1] - (longlong)_Dst >> 2;
    if (uVar4 <= uVar5) {
      memmove(_Dst,pvVar3,param_2[1] - (longlong)pvVar3 & 0xfffffffffffffffc);
      param_1[1] = *param_1 + (param_2[1] - *param_2 >> 2) * 4;
      return param_1;
    }
    if ((ulonglong)(param_1[2] - (longlong)_Dst >> 2) < uVar4) {
      if (_Dst != (void *)0x0) {
        operator_delete(_Dst);
      }
      cVar1 = FUN_14008d170(param_1,param_2[1] - *param_2 >> 2);
      if (cVar1 == '\0') {
        return param_1;
      }
      _Src = (void *)*param_2;
      pvVar3 = (void *)*param_1;
      lVar2 = param_2[1] - (longlong)_Src;
    }
    else {
      _Src = (void *)((longlong)pvVar3 + uVar5 * 4);
      FUN_1402bc5f0(pvVar3,_Src,_Dst);
      pvVar3 = (void *)param_1[1];
      lVar2 = param_2[1] - (longlong)_Src;
    }
    _Size = (lVar2 >> 2) * 4;
    pvVar3 = memmove(pvVar3,_Src,_Size);
    param_1[1] = (longlong)((longlong)pvVar3 + _Size);
  }
  return param_1;
}



void FUN_1402ecd80(longlong *param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  puVar1 = (undefined4 *)param_1[1];
  if ((param_2 < puVar1) && ((undefined4 *)*param_1 <= param_2)) {
    lVar3 = (longlong)param_2 - *param_1;
    lVar3 = lVar3 / 6 + (lVar3 >> 0x3f);
    lVar3 = (lVar3 >> 2) - (lVar3 >> 0x3f);
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_1402ecf30(param_1);
    }
    puVar1 = (undefined4 *)param_1[1];
    lVar2 = *param_1;
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *(undefined4 *)(lVar2 + lVar3 * 0x18);
      puVar1[1] = *(undefined4 *)(lVar2 + 4 + lVar3 * 0x18);
      puVar1[2] = *(undefined4 *)(lVar2 + 8 + lVar3 * 0x18);
      puVar1[3] = *(undefined4 *)(lVar2 + 0xc + lVar3 * 0x18);
      puVar1[4] = *(undefined4 *)(lVar2 + 0x10 + lVar3 * 0x18);
      puVar1[5] = *(undefined4 *)(lVar2 + 0x14 + lVar3 * 0x18);
      param_1[1] = param_1[1] + 0x18;
      return;
    }
  }
  else {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_1402ecf30(param_1);
    }
    puVar1 = (undefined4 *)param_1[1];
    if (puVar1 != (undefined4 *)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];
    }
  }
  param_1[1] = param_1[1] + 0x18;
  return;
}



void FUN_1402ece70(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_1402ecff0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1402ed220(param_1[1],((longlong)(param_2 - uVar2) / 0x410) * 0x410 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_1402ecff0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_1402ed220(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x410;
  return;
}



void FUN_1402ecf30(longlong *param_1)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = param_1[1] - *param_1;
  lVar2 = lVar2 / 6 + (lVar2 >> 0x3f);
  uVar4 = (lVar2 >> 2) - (lVar2 >> 0x3f);
  if (0xaaaaaaaaaaaaaa9 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  uVar3 = (param_1[2] - *param_1) / 0x18;
  if (uVar3 < uVar4) {
    if (0xaaaaaaaaaaaaaaa - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
      if (uVar4 != 0) {
        uVar3 = uVar4;
      }
      FUN_14008e930(param_1,uVar3);
      return;
    }
    uVar3 = uVar3 + (uVar3 >> 1);
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_14008e930(param_1,uVar3);
  }
  return;
}



void FUN_1402ecff0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  
  uVar3 = (param_1[1] - *param_1) / 0x410;
  if (0x3f03f03f03f03e < uVar3) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar3 = uVar3 + 1;
  uVar2 = (param_1[2] - *param_1) / 0x410;
  if (uVar2 < uVar3) {
    if (0x3f03f03f03f03f - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
      if (uVar3 != 0) {
        uVar2 = uVar3;
      }
      FUN_1402ed0b0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_1402ed0b0(param_1,uVar2);
  }
  return;
}



void FUN_1402ed0b0(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 (0x3f03f03f03f03f < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar2 = (code *)swi(3);
    (*pcVar2)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x410) < param_2) {
    local_res10 = (char *)0x0;
    if ((param_2 != 0) && (local_res10 = operator_new(param_2 * 0x410), 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_1405d3608);
    }
    pcVar3 = local_res10;
    FUN_1402ed6c0(*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 + 0x410) {
        FUN_1401dfef0(lVar5);
      }
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar3 + param_2 * 0x410);
    param_1[1] = (longlong)(pcVar3 + (lVar4 / 0x410) * 0x410);
    *param_1 = (longlong)pcVar3;
  }
  return;
}



undefined4 * FUN_1402ed220(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];
  *(undefined1 *)(param_1 + 4) = *(undefined1 *)(param_2 + 4);
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  *(undefined8 *)(param_1 + 0x2c) = 7;
  *(undefined8 *)(param_1 + 0x2a) = 0;
  *(undefined2 *)(param_1 + 0x26) = 0;
  FUN_1400015e0(param_1 + 0x26,param_2 + 0x26,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x36) = 7;
  *(undefined8 *)(param_1 + 0x34) = 0;
  *(undefined2 *)(param_1 + 0x30) = 0;
  FUN_1400015e0(param_1 + 0x30,param_2 + 0x30,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x40) = 7;
  *(undefined8 *)(param_1 + 0x3e) = 0;
  *(undefined2 *)(param_1 + 0x3a) = 0;
  FUN_1400015e0(param_1 + 0x3a,param_2 + 0x3a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x4a) = 7;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined2 *)(param_1 + 0x44) = 0;
  FUN_1400015e0(param_1 + 0x44,param_2 + 0x44,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x54) = 7;
  *(undefined8 *)(param_1 + 0x52) = 0;
  *(undefined2 *)(param_1 + 0x4e) = 0;
  FUN_1400015e0(param_1 + 0x4e,param_2 + 0x4e,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x5e) = 7;
  *(undefined8 *)(param_1 + 0x5c) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  FUN_1400015e0(param_1 + 0x58,param_2 + 0x58,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x68) = 7;
  *(undefined8 *)(param_1 + 0x66) = 0;
  *(undefined2 *)(param_1 + 0x62) = 0;
  FUN_1400015e0(param_1 + 0x62,param_2 + 0x62,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x72) = 7;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined2 *)(param_1 + 0x6c) = 0;
  FUN_1400015e0(param_1 + 0x6c,param_2 + 0x6c,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x7c) = 7;
  *(undefined8 *)(param_1 + 0x7a) = 0;
  *(undefined2 *)(param_1 + 0x76) = 0;
  FUN_1400015e0(param_1 + 0x76,param_2 + 0x76,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x86) = 7;
  *(undefined8 *)(param_1 + 0x84) = 0;
  *(undefined2 *)(param_1 + 0x80) = 0;
  FUN_1400015e0(param_1 + 0x80,param_2 + 0x80,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x90) = 7;
  *(undefined8 *)(param_1 + 0x8e) = 0;
  *(undefined2 *)(param_1 + 0x8a) = 0;
  FUN_1400015e0(param_1 + 0x8a,param_2 + 0x8a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x9a) = 7;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined2 *)(param_1 + 0x94) = 0;
  FUN_1400015e0(param_1 + 0x94,param_2 + 0x94,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0xa4) = 7;
  *(undefined8 *)(param_1 + 0xa2) = 0;
  *(undefined2 *)(param_1 + 0x9e) = 0;
  FUN_1400015e0(param_1 + 0x9e,param_2 + 0x9e,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0xae) = 7;
  *(undefined8 *)(param_1 + 0xac) = 0;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  FUN_1400015e0(param_1 + 0xa8,param_2 + 0xa8,0,0xffffffffffffffff);
  FUN_1402bc360(param_1 + 0xb2,param_2 + 0xb2);
  FUN_1402bc360(param_1 + 0xba,param_2 + 0xba);
  _eh_vector_copy_constructor_iterator_
            (param_1 + 0xc2,param_2 + 0xc2,0x28,4,basic_string<>,FUN_14023be90);
  FUN_1402ed610(param_1 + 0xea,param_2 + 0xea);
  return param_1;
}



undefined1 * FUN_1402ed610(undefined1 *param_1,undefined1 *param_2)

{
  longlong lVar1;
  
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x28);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x2c);
  *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(param_2 + 0x34);
  *(undefined4 *)(param_1 + 0x38) = *(undefined4 *)(param_2 + 0x38);
  *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_2 + 0x3c);
  *(undefined4 *)(param_1 + 0x40) = *(undefined4 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x44) = *(undefined4 *)(param_2 + 0x44);
  *(undefined8 *)(param_1 + 0x48) = *(undefined8 *)(param_2 + 0x48);
  lVar1 = *(longlong *)(param_2 + 0x50);
  *(longlong *)(param_1 + 0x50) = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  *(undefined8 *)(param_1 + 0x58) = *(undefined8 *)(param_2 + 0x58);
  lVar1 = *(longlong *)(param_2 + 0x60);
  *(longlong *)(param_1 + 0x60) = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_1;
}



longlong FUN_1402ed6c0(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x410) {
    if (param_3 != 0) {
      FUN_1402ed220(param_3,param_1);
    }
    param_3 = param_3 + 0x410;
  }
  return param_3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 *
FUN_1402ed720(longlong param_1,undefined8 *param_2,short *param_3,undefined1 param_4,
             undefined1 param_5)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  short sVar4;
  longlong lVar5;
  ushort *puVar6;
  void *pvVar7;
  undefined8 uVar8;
  undefined8 *puVar9;
  ulonglong uVar10;
  ushort *puVar11;
  short *psVar12;
  undefined1 auStack_148 [32];
  undefined4 local_128;
  short *local_120 [2];
  longlong local_110;
  undefined8 local_108;
  undefined8 *local_100;
  undefined1 local_f8 [16];
  longlong *local_e8;
  undefined1 local_e0 [24];
  undefined1 local_c8 [24];
  ushort local_b0;
  undefined6 uStack_ae;
  longlong local_a0;
  ulonglong local_98;
  undefined2 local_88;
  undefined6 uStack_86;
  undefined8 local_78;
  ulonglong local_70;
  undefined8 local_60;
  longlong *local_58;
  ulonglong local_48;
  
  local_108 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_148;
  local_128 = 0;
  local_120[0] = param_3;
  local_100 = param_2;
  EnterCriticalSection(DAT_140608290);
  *param_2 = 0;
  param_2[1] = 0;
  local_128 = 1;
  local_98 = 7;
  local_a0 = 0;
  local_b0 = 0;
  uVar10 = 0xffffffffffffffff;
  psVar12 = param_3;
  do {
    if (uVar10 == 0) break;
    uVar10 = uVar10 - 1;
    sVar4 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar4 != 0);
  FUN_140001710(&local_b0,param_3,~uVar10 - 1);
  if (*(longlong *)(param_1 + 0x30) == 0) {
    local_110 = 0;
  }
  else {
    puVar11 = &local_b0;
    if (7 < local_98) {
      puVar11 = (ushort *)CONCAT62(uStack_ae,local_b0);
    }
    puVar6 = &local_b0;
    if (7 < local_98) {
      puVar6 = (ushort *)CONCAT62(uStack_ae,local_b0);
    }
    uVar10 = 0;
    for (; puVar6 != puVar11 + local_a0; puVar6 = puVar6 + 1) {
      uVar10 = uVar10 ^ (uVar10 >> 2) + uVar10 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar6;
    }
    local_110 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x10) +
                              (uVar10 % *(ulonglong *)(param_1 + 0x18)) * 8,&local_b0);
  }
  lVar5 = local_110;
  uVar8 = 0;
  if (7 < local_98) {
    operator_delete((void *)CONCAT62(uStack_ae,local_b0));
  }
  local_98 = 7;
  local_a0 = 0;
  local_b0 = 0;
  if (lVar5 == 0) {
    pvVar7 = operator_new(0x148);
    if (pvVar7 != (void *)0x0) {
      uVar8 = FUN_14030af10(pvVar7);
    }
    FUN_1402edc00(param_2,uVar8);
    FUN_14030b730(*param_2,param_3,param_4,param_5);
    puVar9 = (undefined8 *)FUN_1402f3af0(local_f8,local_120,param_2);
    local_70 = 7;
    local_78 = 0;
    local_88 = 0;
    uVar10 = 0xffffffffffffffff;
    psVar12 = (short *)*puVar9;
    do {
      if (uVar10 == 0) break;
      uVar10 = uVar10 - 1;
      sVar4 = *psVar12;
      psVar12 = psVar12 + 1;
    } while (sVar4 != 0);
    FUN_140001710(&local_88,(short *)*puVar9,~uVar10 - 1);
    local_60 = puVar9[1];
    local_58 = (longlong *)puVar9[2];
    if (local_58 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_58 + 1) = (int)local_58[1] + 1;
      UNLOCK();
    }
    if (*(longlong *)(param_1 + 0x30) == 0) {
      FUN_1402edee0(param_1 + 0x10,local_c8,&local_88);
    }
    else {
      FUN_1402edd80(param_1 + 0x10,local_e0,&local_88,&local_88);
    }
    plVar3 = local_58;
    if (local_58 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_58 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_58 + 8))(local_58);
        LOCK();
        piVar2 = (int *)((longlong)plVar3 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar3 + 0x10))(plVar3);
        }
      }
    }
    if (7 < local_70) {
      operator_delete((void *)CONCAT62(uStack_86,local_88));
    }
    local_70 = 7;
    local_78 = 0;
    local_88 = 0;
    if (local_e8 != (longlong *)0x0) {
      LOCK();
      plVar3 = local_e8 + 1;
      *(int *)plVar3 = (int)*plVar3 + -1;
      UNLOCK();
      if ((int)*plVar3 == 0) {
        (**(code **)(*local_e8 + 8))(local_e8);
        LOCK();
        piVar2 = (int *)((longlong)local_e8 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_e8 + 0x10))(local_e8);
        }
      }
    }
  }
  else {
    FUN_140343ec0(param_2,lVar5 + 0x30);
  }
  LeaveCriticalSection(DAT_140608290);
  return param_2;
}



void thunk_FUN_1402ca6d0(void)

{
  FUN_1402ca6d0();
  return;
}



void FUN_1402eda20(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 *puVar6;
  longlong *plVar7;
  longlong *plVar8;
  undefined8 *puVar9;
  undefined8 **ppuVar10;
  longlong *plVar11;
  undefined8 *local_48;
  undefined8 local_40;
  undefined8 *local_38;
  undefined8 local_30;
  
  if (*(longlong *)(param_1 + 0x30) == 0) {
    local_38 = (undefined8 *)0x0;
    local_30 = 0;
    ppuVar10 = &local_38;
  }
  else {
    local_48 = *(undefined8 **)(param_1 + 0x40);
    if (local_48 == (undefined8 *)0x0) {
      local_40 = 0;
      ppuVar10 = &local_48;
    }
    else {
      ppuVar10 = &local_48;
      local_40 = *local_48;
    }
  }
  puVar9 = *ppuVar10;
  puVar6 = ppuVar10[1];
  while (puVar6 != (undefined8 *)0x0) {
    lVar3 = puVar6[6];
    FUN_1402f3920(lVar3);
    lVar4 = *(longlong *)(lVar3 + 0x50);
    if (*(longlong *)(lVar3 + 0x48) != lVar4) {
      plVar7 = (longlong *)FUN_140333a10(lVar4,lVar4);
      plVar8 = *(longlong **)(lVar3 + 0x50);
      if (plVar7 != plVar8) {
        plVar11 = plVar7 + 1;
        do {
          plVar5 = (longlong *)*plVar11;
          if (plVar5 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar5 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              (**(code **)(*plVar5 + 8))(plVar5);
              LOCK();
              piVar2 = (int *)((longlong)plVar5 + 0xc);
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              if (*piVar2 == 0) {
                (**(code **)(*plVar5 + 0x10))(plVar5);
              }
            }
          }
          plVar5 = plVar11 + 1;
          plVar11 = plVar11 + 2;
        } while (plVar5 != plVar8);
      }
      *(longlong **)(lVar3 + 0x50) = plVar7;
    }
    lVar4 = *(longlong *)(lVar3 + 0x70);
    if (*(longlong *)(lVar3 + 0x68) != lVar4) {
      plVar7 = (longlong *)FUN_140333a10(lVar4,lVar4);
      plVar8 = *(longlong **)(lVar3 + 0x70);
      if (plVar7 != plVar8) {
        plVar11 = plVar7 + 1;
        do {
          plVar5 = (longlong *)*plVar11;
          if (plVar5 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar5 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              (**(code **)(*plVar5 + 8))(plVar5);
              LOCK();
              piVar2 = (int *)((longlong)plVar5 + 0xc);
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              if (*piVar2 == 0) {
                (**(code **)(*plVar5 + 0x10))(plVar5);
              }
            }
          }
          plVar5 = plVar11 + 1;
          plVar11 = plVar11 + 2;
        } while (plVar5 != plVar8);
      }
      *(longlong **)(lVar3 + 0x70) = plVar7;
    }
    plVar8 = (longlong *)(lVar3 + 0x118);
    if (7 < *(ulonglong *)(lVar3 + 0x130)) {
      plVar8 = (longlong *)*plVar8;
    }
    FUN_14030b730(lVar3,plVar8,*(undefined1 *)(lVar3 + 0x140),*(undefined1 *)(lVar3 + 0x141));
    for (puVar6 = (undefined8 *)*puVar6; puVar6 == (undefined8 *)0x0; puVar6 = (undefined8 *)*puVar6
        ) {
      puVar6 = puVar9 + 1;
      puVar9 = puVar9 + 1;
    }
    if (puVar9 == puVar6) {
      puVar6 = (undefined8 *)0x0;
    }
  }
  return;
}



void FUN_1402edbf0(void)

{
                    // WARNING: Could not recover jumptable at 0x0001402edbf7. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608290);
  return;
}



void FUN_1402edc00(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_1402ee070(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



void FUN_1402edc80(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  
  if (param_1[4] != 0) {
    puVar7 = (undefined8 *)*param_1;
    puVar3 = puVar7 + param_1[1];
    for (; puVar7 != puVar3; puVar7 = puVar7 + 1) {
      puVar4 = (undefined8 *)*puVar7;
      *puVar7 = 0;
      while (puVar4 != (undefined8 *)0x0) {
        puVar5 = (undefined8 *)*puVar4;
        plVar6 = (longlong *)puVar4[7];
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar6 + 0x10))(plVar6);
            }
          }
        }
        if (7 < (ulonglong)puVar4[4]) {
          operator_delete((void *)puVar4[1]);
        }
        puVar4[4] = 7;
        puVar4[3] = 0;
        *(undefined2 *)(puVar4 + 1) = 0;
        operator_delete(puVar4);
        puVar4 = puVar5;
      }
    }
    param_1[4] = 0;
    param_1[6] = puVar3;
  }
  return;
}



longlong * FUN_1402edd80(longlong *param_1,longlong *param_2,undefined8 param_3,longlong param_4)

{
  char cVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar6;
  undefined8 uVar7;
  longlong *local_48;
  longlong *local_40;
  undefined2 local_38;
  
  uVar7 = 0xfffffffffffffffe;
  uVar2 = FUN_14015afa0(param_3);
  plVar5 = (longlong *)(*param_1 + (uVar2 % (ulonglong)param_1[1]) * 8);
  lVar3 = FUN_1402cb0b0(plVar5,param_3);
  if (lVar3 == 0) {
    local_40 = (longlong *)0x0;
    local_38 = 0;
    local_48 = param_1;
    FUN_1402ee350(&local_48);
    plVar6 = local_40;
    plVar4 = local_40 + 1;
    if (plVar4 != (longlong *)0x0) {
      local_40[4] = 7;
      local_40[3] = 0;
      *(undefined2 *)plVar4 = 0;
      FUN_1400015e0(plVar4,param_4,0,0xffffffffffffffff,uVar7,plVar4);
      plVar6[6] = *(longlong *)(param_4 + 0x28);
      lVar3 = *(longlong *)(param_4 + 0x30);
      plVar6[7] = lVar3;
      if (lVar3 != 0) {
        LOCK();
        *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
        UNLOCK();
        plVar6 = local_40;
      }
    }
    local_38 = CONCAT11(1,(undefined1)local_38);
    cVar1 = FUN_1402ee0e0(param_1);
    if (cVar1 != '\0') {
      plVar5 = (longlong *)(*param_1 + (uVar2 % (ulonglong)param_1[1]) * 8);
    }
    *plVar6 = *plVar5;
    *plVar5 = (longlong)plVar6;
    param_1[4] = param_1[4] + 1;
    plVar4 = (longlong *)param_1[6];
    if (plVar5 < (longlong *)param_1[6]) {
      plVar4 = plVar5;
    }
    param_1[6] = (longlong)plVar4;
    *param_2 = (longlong)plVar5;
    param_2[1] = (longlong)plVar6;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)plVar5;
    param_2[1] = lVar3;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



longlong * FUN_1402edee0(longlong *param_1,longlong *param_2,longlong param_3)

{
  undefined8 *puVar1;
  ulonglong *puVar2;
  longlong *plVar3;
  ulonglong uVar4;
  longlong lVar5;
  ulonglong *puVar6;
  undefined8 *puVar7;
  ulonglong local_res20;
  undefined8 uVar8;
  longlong *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  uVar8 = 0xfffffffffffffffe;
  local_38 = (undefined8 *)0x0;
  local_30 = 0;
  local_40 = param_1;
  FUN_1402ee350(&local_40);
  puVar7 = local_38;
  puVar1 = local_38 + 1;
  if (puVar1 != (undefined8 *)0x0) {
    local_38[4] = 7;
    local_38[3] = 0;
    *(undefined2 *)puVar1 = 0;
    FUN_1400015e0(puVar1,param_3,0,0xffffffffffffffff,uVar8);
    puVar7[6] = *(undefined8 *)(param_3 + 0x28);
    lVar5 = *(longlong *)(param_3 + 0x30);
    puVar7[7] = lVar5;
    if (lVar5 != 0) {
      LOCK();
      *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
      UNLOCK();
      puVar7 = local_38;
    }
  }
  local_30 = CONCAT11(1,(undefined1)local_30);
  uVar4 = FUN_14015afa0(puVar1);
  if (*param_1 == 0) {
    local_res20 = FUN_1402c9710(param_1,1);
    puVar2 = (ulonglong *)(param_1 + 1);
    puVar6 = &local_res20;
    if (local_res20 <= *puVar2) {
      puVar6 = puVar2;
    }
    *puVar2 = *puVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else if (((ulonglong)param_1[7] < 2) && (lVar5 = FUN_1402c9710(param_1), lVar5 != param_1[1])) {
    FUN_1402ee180(param_1);
  }
  plVar3 = (longlong *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar7 = *plVar3;
  *plVar3 = (longlong)puVar7;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)plVar3;
  *param_2 = (longlong)plVar3;
  param_2[1] = (longlong)puVar7;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



undefined8 * FUN_1402ee070(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;
}



undefined8 FUN_1402ee0e0(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_1402ee180(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_1402ee150(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14030b0e0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402ee180(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  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_140346140(&local_50);
  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;
    }
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  lVar6 = FUN_1402961d0(param_1);
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_1402c6290(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_1402c6290(&local_50);
  }
  return;
}



void FUN_1402ee350(longlong param_1)

{
  undefined8 *puVar1;
  char *local_res8 [4];
  undefined **local_68 [5];
  undefined8 uStack_40;
  undefined8 local_38;
  undefined8 uStack_30;
  undefined8 local_28;
  undefined8 uStack_20;
  undefined8 local_18;
  undefined8 uStack_10;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1402ca6d0(*(longlong *)(param_1 + 8) + 8);
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar1 = operator_new(0x40);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar1;
    *puVar1 = 0;
    puVar1[1] = uStack_40;
    puVar1[2] = local_38;
    puVar1[3] = uStack_30;
    puVar1[4] = local_28;
    puVar1[5] = uStack_20;
    puVar1[6] = local_18;
    puVar1[7] = uStack_10;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_68,local_res8);
  local_68[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d3608);
}



void FUN_1402ee410(undefined8 param_1)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  uint uVar4;
  longlong lVar5;
  undefined4 extraout_var;
  longlong lVar7;
  undefined4 extraout_var_00;
  undefined4 extraout_var_01;
  longlong *plVar8;
  undefined4 *puVar9;
  undefined8 *puVar10;
  longlong local_1c8;
  longlong *local_1c0;
  longlong local_1b8;
  longlong *local_1b0;
  longlong local_1a8;
  longlong *local_1a0;
  undefined4 *local_198;
  undefined4 *local_188;
  undefined4 *local_178;
  undefined1 local_168 [8];
  longlong *local_160;
  undefined1 local_158 [8];
  longlong *local_150;
  undefined1 local_148 [8];
  longlong *local_140;
  undefined1 local_138 [8];
  longlong *local_130;
  undefined1 local_128 [8];
  longlong *local_120;
  undefined1 local_118 [8];
  longlong *local_110;
  undefined1 local_108 [8];
  longlong *local_100;
  undefined1 local_f8 [8];
  longlong *local_f0;
  undefined8 local_e8;
  undefined1 local_e0 [8];
  longlong *local_d8;
  undefined1 local_d0 [8];
  longlong *local_c8;
  undefined1 local_c0 [8];
  longlong *local_b8;
  undefined1 local_b0 [8];
  longlong *local_a8;
  undefined1 local_a0 [8];
  longlong *local_98;
  undefined1 local_90 [8];
  longlong *local_88;
  undefined1 local_80 [8];
  longlong *local_78;
  undefined1 local_70 [8];
  longlong *local_68;
  undefined1 local_60 [8];
  longlong *local_58;
  undefined1 local_50 [8];
  longlong *local_48;
  undefined1 local_40 [8];
  longlong *local_38;
  undefined1 local_30 [8];
  longlong *local_28;
  undefined1 local_20 [8];
  longlong *local_18;
  ulonglong uVar6;
  
  local_e8 = 0xfffffffffffffffe;
  FUN_140418da0(DAT_140607fd8,L"mcoCharacterTableManager Loading... - %s",&DAT_1404a4d58);
  lVar5 = FUN_1402933b0(DAT_140607ff0,&DAT_1404a4d58);
  if (lVar5 != 0) {
    iVar3 = _wcsicmp(L"ENEMY",L"PC");
    uVar6 = CONCAT44(extraout_var,iVar3);
    if (iVar3 == 0) {
      if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
        plVar8 = *(longlong **)(lVar5 + 0x68);
        do {
          if (*plVar8 != 0) {
            puVar9 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[uVar6];
            goto LAB_1402ee4c2;
          }
          uVar4 = (int)uVar6 + 1;
          uVar6 = (ulonglong)uVar4;
          plVar8 = plVar8 + 1;
        } while (uVar4 < *(uint *)(lVar5 + 0x78));
      }
      puVar9 = (undefined4 *)0x0;
LAB_1402ee4c2:
      local_198 = puVar9;
      if (local_198 != (undefined4 *)0x0) {
        FUN_1402eed80(param_1,&local_1a8,*local_198);
        puVar10 = (undefined8 *)(local_1a8 + 0x430);
        if (7 < *(ulonglong *)(local_1a8 + 0x448)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef230(param_1,local_148,puVar10);
        plVar8 = local_140;
        if (local_140 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_140 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_140 + 8))(local_140);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1a8 + 0x390);
        if (7 < *(ulonglong *)(local_1a8 + 0x3a8)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef5a0(param_1,local_b0,puVar10);
        plVar8 = local_a8;
        if (local_a8 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_a8 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_a8 + 8))(local_a8);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1a8 + 0x598);
        if (7 < *(ulonglong *)(local_1a8 + 0x5b0)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef8d0(param_1,local_128,puVar10);
        plVar8 = local_120;
        if (local_120 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_120 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_120 + 8))(local_120);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1a8 + 0x408);
        if (7 < *(ulonglong *)(local_1a8 + 0x420)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402efc00(param_1,local_30,puVar10);
        plVar8 = local_28;
        if (local_28 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_28 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_28 + 8))(local_28);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1a8 + 0x4a8);
        if (7 < *(ulonglong *)(local_1a8 + 0x4c0)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402eff30(param_1,local_108,puVar10);
        plVar8 = local_100;
        if (local_100 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_100 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_100 + 8))(local_100);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1a8 + 0x4d0);
        if (7 < *(ulonglong *)(local_1a8 + 0x4e8)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402f02a0(param_1,local_90,puVar10);
        plVar8 = local_88;
        if (local_88 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_88 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_88 + 8))(local_88);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1a8 + 0x5e8);
        if (7 < *(ulonglong *)(local_1a8 + 0x600)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402f0610(param_1,local_168,puVar10);
        plVar8 = local_160;
        if (local_160 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_160 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_160 + 8))(local_160);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        plVar8 = local_1a0;
        if (local_1a0 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_1a0 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_1a0 + 8))(local_1a0);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar9 = *(undefined4 **)(local_198 + 6);
        if (puVar9 == (undefined4 *)0x0) {
          uVar4 = (uint)local_198[8] % *(uint *)(lVar5 + 0x78) + 1;
          lVar7 = (longlong)(int)uVar4 << 3;
          do {
            if (*(uint *)(lVar5 + 0x78) <= uVar4) break;
            if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar7) != 0) {
              puVar9 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar7);
            }
            uVar4 = uVar4 + 1;
            lVar7 = lVar7 + 8;
          } while (puVar9 == (undefined4 *)0x0);
        }
        goto LAB_1402ee4c2;
      }
    }
    iVar3 = _wcsicmp(L"ENEMY",L"ENEMY");
    uVar6 = CONCAT44(extraout_var_00,iVar3);
    if (iVar3 == 0) {
      if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
        plVar8 = *(longlong **)(lVar5 + 0x68);
        do {
          if (*plVar8 != 0) {
            puVar9 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[uVar6];
            goto LAB_1402ee7b0;
          }
          uVar4 = (int)uVar6 + 1;
          uVar6 = (ulonglong)uVar4;
          plVar8 = plVar8 + 1;
        } while (uVar4 < *(uint *)(lVar5 + 0x78));
      }
      puVar9 = (undefined4 *)0x0;
LAB_1402ee7b0:
      local_178 = puVar9;
      if (local_178 != (undefined4 *)0x0) {
        FUN_1402eeee0(param_1,&local_1c8,*local_178);
        puVar10 = (undefined8 *)(local_1c8 + 0x430);
        if (7 < *(ulonglong *)(local_1c8 + 0x448)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef230(param_1,local_50,puVar10);
        plVar8 = local_48;
        if (local_48 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_48 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_48 + 8))(local_48);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1c8 + 0x390);
        if (7 < *(ulonglong *)(local_1c8 + 0x3a8)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef5a0(param_1,local_d0,puVar10);
        plVar8 = local_c8;
        if (local_c8 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_c8 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_c8 + 8))(local_c8);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1c8 + 0x598);
        if (7 < *(ulonglong *)(local_1c8 + 0x5b0)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef8d0(param_1,local_70,puVar10);
        plVar8 = local_68;
        if (local_68 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_68 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_68 + 8))(local_68);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1c8 + 0x408);
        if (7 < *(ulonglong *)(local_1c8 + 0x420)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402efc00(param_1,local_158,puVar10);
        plVar8 = local_150;
        if (local_150 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_150 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_150 + 8))(local_150);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1c8 + 0x4a8);
        if (7 < *(ulonglong *)(local_1c8 + 0x4c0)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402eff30(param_1,local_138,puVar10);
        plVar8 = local_130;
        if (local_130 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_130 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_130 + 8))(local_130);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1c8 + 0x4d0);
        if (7 < *(ulonglong *)(local_1c8 + 0x4e8)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402f02a0(param_1,local_118,puVar10);
        plVar8 = local_110;
        if (local_110 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_110 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_110 + 8))(local_110);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1c8 + 0x5e8);
        if (7 < *(ulonglong *)(local_1c8 + 0x600)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402f0610(param_1,local_f8,puVar10);
        plVar8 = local_f0;
        if (local_f0 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_f0 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_f0 + 8))(local_f0);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        plVar8 = local_1c0;
        if (local_1c0 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_1c0 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_1c0 + 8))(local_1c0);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar9 = *(undefined4 **)(local_178 + 6);
        if (puVar9 == (undefined4 *)0x0) {
          uVar4 = (uint)local_178[8] % *(uint *)(lVar5 + 0x78) + 1;
          lVar7 = (longlong)(int)uVar4 << 3;
          do {
            if (*(uint *)(lVar5 + 0x78) <= uVar4) break;
            if (*(longlong *)(lVar7 + *(longlong *)(lVar5 + 0x68)) != 0) {
              puVar9 = *(undefined4 **)(lVar7 + *(longlong *)(lVar5 + 0x68));
            }
            uVar4 = uVar4 + 1;
            lVar7 = lVar7 + 8;
          } while (puVar9 == (undefined4 *)0x0);
        }
        goto LAB_1402ee7b0;
      }
    }
    iVar3 = _wcsicmp(L"ENEMY",L"PET");
    uVar6 = CONCAT44(extraout_var_01,iVar3);
    if (iVar3 == 0) {
      if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
        plVar8 = *(longlong **)(lVar5 + 0x68);
        do {
          if (*plVar8 != 0) {
            puVar9 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[uVar6];
            goto LAB_1402eeaa0;
          }
          uVar4 = (int)uVar6 + 1;
          uVar6 = (ulonglong)uVar4;
          plVar8 = plVar8 + 1;
        } while (uVar4 < *(uint *)(lVar5 + 0x78));
      }
      puVar9 = (undefined4 *)0x0;
LAB_1402eeaa0:
      local_188 = puVar9;
      if (local_188 != (undefined4 *)0x0) {
        FUN_1402ef030(param_1,&local_1b8,*local_188);
        puVar10 = (undefined8 *)(local_1b8 + 0x430);
        if (7 < *(ulonglong *)(local_1b8 + 0x448)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef230(param_1,local_e0,puVar10);
        plVar8 = local_d8;
        if (local_d8 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_d8 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_d8 + 8))(local_d8);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1b8 + 0x390);
        if (7 < *(ulonglong *)(local_1b8 + 0x3a8)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef5a0(param_1,local_c0,puVar10);
        plVar8 = local_b8;
        if (local_b8 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_b8 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_b8 + 8))(local_b8);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1b8 + 0x598);
        if (7 < *(ulonglong *)(local_1b8 + 0x5b0)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402ef8d0(param_1,local_a0,puVar10);
        plVar8 = local_98;
        if (local_98 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_98 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_98 + 8))(local_98);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1b8 + 0x408);
        if (7 < *(ulonglong *)(local_1b8 + 0x420)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402efc00(param_1,local_80,puVar10);
        plVar8 = local_78;
        if (local_78 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_78 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_78 + 8))(local_78);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1b8 + 0x4a8);
        if (7 < *(ulonglong *)(local_1b8 + 0x4c0)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402eff30(param_1,local_60,puVar10);
        plVar8 = local_58;
        if (local_58 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_58 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_58 + 8))(local_58);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1b8 + 0x4d0);
        if (7 < *(ulonglong *)(local_1b8 + 0x4e8)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402f02a0(param_1,local_40,puVar10);
        plVar8 = local_38;
        if (local_38 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_38 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_38 + 8))(local_38);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar10 = (undefined8 *)(local_1b8 + 0x5e8);
        if (7 < *(ulonglong *)(local_1b8 + 0x600)) {
          puVar10 = (undefined8 *)*puVar10;
        }
        FUN_1402f0610(param_1,local_20,puVar10);
        plVar8 = local_18;
        if (local_18 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_18 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_18 + 8))(local_18);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        plVar8 = local_1b0;
        if (local_1b0 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_1b0 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_1b0 + 8))(local_1b0);
            LOCK();
            piVar2 = (int *)((longlong)plVar8 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar8 + 0x10))(plVar8);
            }
          }
        }
        puVar9 = *(undefined4 **)(local_188 + 6);
        if (puVar9 == (undefined4 *)0x0) {
          uVar4 = (uint)local_188[8] % *(uint *)(lVar5 + 0x78) + 1;
          lVar7 = (longlong)(int)uVar4 << 3;
          do {
            if (*(uint *)(lVar5 + 0x78) <= uVar4) break;
            if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar7) != 0) {
              puVar9 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar7);
            }
            uVar4 = uVar4 + 1;
            lVar7 = lVar7 + 8;
          } while (puVar9 == (undefined4 *)0x0);
        }
        goto LAB_1402eeaa0;
      }
    }
    FUN_140418da0(DAT_140607fd8,L"mcoCharacterTableManager Load OK... - %s",&DAT_1404a4d58);
  }
  return;
}



undefined8 * FUN_1402eed80(longlong param_1,undefined8 *param_2,uint param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined4 *puVar5;
  uint *puVar6;
  uint local_res18 [2];
  undefined8 uVar7;
  undefined1 local_40 [16];
  longlong *local_30;
  
  uVar7 = 0xfffffffffffffffe;
  uVar4 = 0;
  local_res18[0] = param_3;
  EnterCriticalSection(DAT_140608298);
  *param_2 = 0;
  param_2[1] = 0;
  if (*(longlong *)(param_1 + 0x10) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(param_1 + 0x10) +
                            ((ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x20)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 6)) {
      if ((puVar6[8] == param_3) && (*puVar6 == param_3)) {
        if (puVar6 != (uint *)0x0) {
          if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          FUN_140343ec0(param_2,puVar6 + 2);
          goto LAB_1402eeeb2;
        }
        break;
      }
    }
  }
  pvVar3 = operator_new(0x970);
  if (pvVar3 != (void *)0x0) {
    uVar4 = FUN_140321230(pvVar3);
  }
  FUN_1402f3a70(param_2,uVar4);
  FUN_140322210(*param_2,param_3,&DAT_1404a3500,param_4,uVar7);
  puVar5 = (undefined4 *)FUN_140342d30(local_40,local_res18,param_2);
  FUN_14030e3c0(param_1 + 0x10,*puVar5,puVar5 + 2);
  if (local_30 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_30 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_30 + 8))(local_30);
      LOCK();
      piVar2 = (int *)((longlong)local_30 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_30 + 0x10))(local_30);
      }
    }
  }
LAB_1402eeeb2:
  LeaveCriticalSection(DAT_140608298);
  return param_2;
}



undefined8 * FUN_1402eeee0(longlong param_1,undefined8 *param_2,uint param_3)

{
  longlong *plVar1;
  int *piVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined4 *puVar5;
  uint *puVar6;
  uint local_res18 [2];
  undefined1 local_40 [16];
  longlong *local_30;
  
  uVar4 = 0;
  local_res18[0] = param_3;
  EnterCriticalSection(DAT_140608298);
  *param_2 = 0;
  param_2[1] = 0;
  if (*(longlong *)(param_1 + 0x58) != 0) {
    for (puVar6 = *(uint **)(*(longlong *)(param_1 + 0x58) +
                            ((ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0x68)) * 8);
        puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 6)) {
      if ((puVar6[8] == param_3) && (*puVar6 == param_3)) {
        if (puVar6 != (uint *)0x0) {
          if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          FUN_140343ec0(param_2,puVar6 + 2);
          goto LAB_1402ef00b;
        }
        break;
      }
    }
  }
  pvVar3 = operator_new(0x970);
  if (pvVar3 != (void *)0x0) {
    uVar4 = FUN_140321230(pvVar3);
  }
  FUN_1402f3a70(param_2,uVar4);
  FUN_140325780(*param_2,param_3);
  puVar5 = (undefined4 *)FUN_140342d30(local_40,local_res18,param_2);
  FUN_14030e3c0(param_1 + 0x58,*puVar5,puVar5 + 2);
  if (local_30 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_30 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_30 + 8))(local_30);
      LOCK();
      piVar2 = (int *)((longlong)local_30 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_30 + 0x10))(local_30);
      }
    }
  }
LAB_1402ef00b:
  LeaveCriticalSection(DAT_140608298);
  return param_2;
}



undefined8 * FUN_1402ef030(longlong param_1,undefined8 *param_2,uint param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  void *pvVar3;
  undefined8 uVar4;
  undefined4 *puVar5;
  uint *puVar6;
  longlong *plVar7;
  uint local_res18 [2];
  undefined4 local_res20;
  undefined8 uVar8;
  undefined8 local_80;
  longlong *local_78;
  undefined8 local_70;
  longlong *local_68;
  undefined8 local_60;
  longlong *local_58;
  undefined1 local_50 [16];
  longlong *local_40;
  
  uVar8 = 0xfffffffffffffffe;
  uVar4 = 0;
  local_res20 = 0;
  local_80 = 0;
  local_78 = (longlong *)0x0;
  if ((int)param_3 < 1) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    local_res18[0] = param_3;
    EnterCriticalSection(DAT_140608298);
    if (*(longlong *)(param_1 + 0xe8) != 0) {
      for (puVar6 = *(uint **)(*(longlong *)(param_1 + 0xe8) +
                              ((ulonglong)param_3 % (ulonglong)*(uint *)(param_1 + 0xf8)) * 8);
          puVar6 != (uint *)0x0; puVar6 = *(uint **)(puVar6 + 6)) {
        if ((puVar6[8] == param_3) && (*puVar6 == param_3)) {
          if (puVar6 != (uint *)0x0) {
            if (puVar6 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            local_80 = *(undefined8 *)(puVar6 + 2);
            local_68 = *(longlong **)(puVar6 + 4);
            local_78 = local_68;
            local_60 = local_80;
            local_58 = local_68;
            if (local_68 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_68 + 1) = (int)local_68[1] + 1;
              UNLOCK();
            }
            goto LAB_1402ef1b1;
          }
          break;
        }
      }
    }
    pvVar3 = operator_new(0x970);
    if (pvVar3 != (void *)0x0) {
      uVar4 = FUN_140321230(pvVar3);
    }
    local_70 = uVar4;
    FUN_1402f3b20(&local_68,uVar4);
    FUN_140178e90(&local_70,uVar4,uVar4,param_4,uVar8);
    local_80 = local_70;
    local_78 = local_68;
    FUN_1403280d0(local_70,param_3);
    puVar5 = (undefined4 *)FUN_140342d30(local_50,local_res18,&local_80);
    FUN_14030e3c0(param_1 + 0xe8,*puVar5,puVar5 + 2);
    if (local_40 != (longlong *)0x0) {
      LOCK();
      plVar7 = local_40 + 1;
      *(int *)plVar7 = (int)*plVar7 + -1;
      UNLOCK();
      local_68 = local_78;
      if ((int)*plVar7 == 0) {
        (**(code **)(*local_40 + 8))(local_40);
        LOCK();
        piVar1 = (int *)((longlong)local_40 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        local_68 = local_78;
        if (*piVar1 == 0) {
          (**(code **)(*local_40 + 0x10))(local_40);
          local_68 = local_78;
        }
      }
    }
LAB_1402ef1b1:
    *param_2 = local_80;
    param_2[1] = local_68;
    plVar7 = (longlong *)0x0;
    if (local_68 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_68 + 1) = (int)local_68[1] + 1;
      UNLOCK();
      plVar7 = local_78;
    }
    local_res20 = 1;
    LeaveCriticalSection(DAT_140608298);
    plVar2 = local_78;
    if (plVar7 != (longlong *)0x0) {
      LOCK();
      plVar7 = plVar7 + 1;
      *(int *)plVar7 = (int)*plVar7 + -1;
      UNLOCK();
      if ((int)*plVar7 == 0) {
        (**(code **)(*local_78 + 8))(local_78);
        LOCK();
        piVar1 = (int *)((longlong)plVar2 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_78 + 0x10))();
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402ef53d)

ulonglong * FUN_1402ef230(longlong param_1,ulonglong *param_2,wchar_t *param_3,undefined8 param_4)

{
  int *piVar1;
  ulonglong uVar2;
  uint uVar3;
  int iVar4;
  undefined4 uVar5;
  void *pvVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *pwVar10;
  void *pvVar11;
  wchar_t *pwVar12;
  longlong *plVar13;
  bool bVar14;
  void *local_res20;
  undefined8 uVar15;
  void *local_a0;
  longlong *local_98;
  void *local_90;
  longlong *local_88;
  void *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  
  uVar15 = 0xfffffffffffffffe;
  pvVar11 = (void *)0x0;
  local_90 = (void *)0x0;
  local_88 = (longlong *)0x0;
  bVar14 = param_3 == (wchar_t *)0x0;
  if (bVar14) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    pwVar10 = param_3;
    pwVar12 = L"";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar14 = *pwVar10 == *pwVar12;
      pwVar10 = pwVar10 + 1;
      pwVar12 = pwVar12 + 1;
    } while (bVar14);
    if (bVar14) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar13 = (longlong *)(param_1 + 0x130);
      local_78 = pvVar11;
      plStack_70 = plVar13;
      if ((*(longlong *)(param_1 + 0x138) != 0) && (*(uint *)(param_1 + 0x140) != 0)) {
        pvVar6 = pvVar11;
        plVar9 = (longlong *)*plVar13;
        do {
          if (*plVar9 != 0) {
            local_78 = (void *)((longlong *)*plVar13)[(longlong)pvVar6];
            break;
          }
          uVar3 = (int)pvVar6 + 1;
          pvVar6 = (void *)(ulonglong)uVar3;
          plVar9 = plVar9 + 1;
        } while (uVar3 < *(uint *)(param_1 + 0x140));
      }
LAB_1402ef304:
      pvVar6 = local_78;
      if (local_78 != (void *)0x0) {
        if (local_78 == (void *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar10 = (wchar_t *)(*(longlong *)((longlong)local_78 + 8) + 0x40);
        if (7 < *(ulonglong *)(*(longlong *)((longlong)local_78 + 8) + 0x58)) {
          pwVar10 = *(wchar_t **)pwVar10;
        }
        iVar4 = _wcsicmp(param_3,pwVar10);
        if (iVar4 == 0) {
          if (pvVar6 != (void *)0x0) {
            lVar8 = *(longlong *)((longlong)pvVar6 + 8);
            FUN_14034ed40(lVar8);
            *(int *)(lVar8 + 0xa8) = *(int *)(lVar8 + 0xa8) + 1;
            FUN_14034edd0(lVar8);
            *param_2 = *(ulonglong *)((longlong)pvVar6 + 8);
            uVar2 = *(ulonglong *)((longlong)pvVar6 + 0x10);
            param_2[1] = uVar2;
            if (uVar2 != 0) {
              LOCK();
              *(int *)(uVar2 + 8) = *(int *)(uVar2 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = pvVar11;
        if ((pvVar6 != (void *)0x0) &&
           (local_78 = *(void **)((longlong)pvVar6 + 0x18),
           *(void **)((longlong)pvVar6 + 0x18) == (void *)0x0)) {
          uVar3 = *(uint *)((longlong)pvVar6 + 0x20) % *(uint *)(param_1 + 0x140) + 1;
          lVar8 = (longlong)(int)uVar3 << 3;
          local_78 = pvVar11;
          do {
            if (*(uint *)(param_1 + 0x140) <= uVar3) break;
            if (*(longlong *)(*plVar13 + lVar8) != 0) {
              local_78 = *(void **)(*plVar13 + lVar8);
            }
            uVar3 = uVar3 + 1;
            lVar8 = lVar8 + 8;
          } while (local_78 == (void *)0x0);
        }
        goto LAB_1402ef304;
      }
      pvVar6 = operator_new(0xb0);
      local_res20 = pvVar6;
      if (pvVar6 != (void *)0x0) {
        uVar5 = FUN_1403c0cc0();
        FUN_14034ec60(pvVar6,uVar5,1,param_4,uVar15);
        *(undefined8 *)((longlong)pvVar6 + 0x58) = 7;
        *(undefined8 *)((longlong)pvVar6 + 0x50) = 0;
        *(undefined2 *)((longlong)pvVar6 + 0x40) = 0;
        FUN_1402ca220((longlong)pvVar6 + 0x68);
        *(undefined4 *)((longlong)pvVar6 + 0xa8) = 0;
        pvVar11 = pvVar6;
      }
      local_a0 = pvVar11;
      FUN_1402f3b90(&local_98,pvVar11);
      FUN_140178e90(&local_a0,pvVar11,pvVar11);
      plVar9 = local_98;
      pvVar11 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_14032e750(local_a0,param_3);
      FUN_14034ed40(pvVar11);
      *(int *)((longlong)pvVar11 + 0xa8U) = *(int *)((longlong)pvVar11 + 0xa8U) + 1;
      FUN_14034edd0(pvVar11);
      local_res20 = (void *)(*(longlong *)(param_1 + 0x570) + 1);
      *(void **)(param_1 + 0x570) = local_res20;
      *(void **)((longlong)pvVar11 + 0x38) = local_res20;
      puVar7 = (undefined8 *)FUN_1402f3af0(local_68,&local_res20,&local_90);
      FUN_14031a010(plVar13,*puVar7,puVar7 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar13 = local_58 + 1;
        *(int *)plVar13 = (int)*plVar13 + -1;
        UNLOCK();
        plVar9 = local_98;
        pvVar11 = local_a0;
        if ((int)*plVar13 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          plVar9 = local_98;
          pvVar11 = local_a0;
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
            plVar9 = local_98;
            pvVar11 = local_a0;
          }
        }
      }
      *param_2 = (ulonglong)pvVar11;
      param_2[1] = (ulonglong)plVar9;
      plVar13 = (longlong *)0x0;
      if (plVar9 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar9 + 1) = (int)plVar9[1] + 1;
        UNLOCK();
        plVar13 = local_98;
      }
      LeaveCriticalSection(DAT_140608298);
      plVar9 = local_98;
      if (plVar13 != (longlong *)0x0) {
        LOCK();
        plVar13 = plVar13 + 1;
        *(int *)plVar13 = (int)*plVar13 + -1;
        UNLOCK();
        if ((int)*plVar13 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)plVar9 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402ef86f)

ulonglong * FUN_1402ef5a0(longlong param_1,ulonglong *param_2,wchar_t *param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *pwVar10;
  longlong *plVar11;
  wchar_t *pwVar12;
  bool bVar13;
  longlong local_res20;
  undefined8 uVar14;
  longlong *local_a0;
  longlong *local_98;
  longlong *local_90;
  longlong *local_88;
  longlong *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  
  uVar14 = 0xfffffffffffffffe;
  plVar11 = (longlong *)0x0;
  local_90 = (longlong *)0x0;
  local_88 = (longlong *)0x0;
  bVar13 = param_3 == (wchar_t *)0x0;
  if (bVar13) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    pwVar10 = param_3;
    pwVar12 = L"";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar13 = *pwVar10 == *pwVar12;
      pwVar10 = pwVar10 + 1;
      pwVar12 = pwVar12 + 1;
    } while (bVar13);
    if (bVar13) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar2 = (longlong *)(param_1 + 0x178);
      local_78 = plVar11;
      plStack_70 = plVar2;
      if ((*(longlong *)(param_1 + 0x180) != 0) && (*(uint *)(param_1 + 0x188) != 0)) {
        plVar6 = plVar11;
        plVar9 = (longlong *)*plVar2;
        do {
          if (*plVar9 != 0) {
            local_78 = (longlong *)((longlong *)*plVar2)[(longlong)plVar6];
            break;
          }
          uVar4 = (int)plVar6 + 1;
          plVar6 = (longlong *)(ulonglong)uVar4;
          plVar9 = plVar9 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x188));
      }
LAB_1402ef674:
      plVar6 = local_78;
      if (local_78 != (longlong *)0x0) {
        if (local_78 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar10 = (wchar_t *)(local_78[1] + 8);
        if (7 < *(ulonglong *)(local_78[1] + 0x20)) {
          pwVar10 = *(wchar_t **)pwVar10;
        }
        iVar5 = _wcsicmp(param_3,pwVar10);
        if (iVar5 == 0) {
          if (plVar6 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar6[1] + 0x50) = *(int *)(plVar6[1] + 0x50) + 1;
            UNLOCK();
            *param_2 = plVar6[1];
            uVar3 = plVar6[2];
            param_2[1] = uVar3;
            if (uVar3 != 0) {
              LOCK();
              *(int *)(uVar3 + 8) = *(int *)(uVar3 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = plVar11;
        if ((plVar6 != (longlong *)0x0) &&
           (local_78 = (longlong *)plVar6[3], (longlong *)plVar6[3] == (longlong *)0x0)) {
          uVar4 = *(uint *)(plVar6 + 4) % *(uint *)(param_1 + 0x188) + 1;
          lVar8 = (longlong)(int)uVar4 << 3;
          local_78 = plVar11;
          do {
            if (*(uint *)(param_1 + 0x188) <= uVar4) break;
            if (*(longlong *)(*plVar2 + lVar8) != 0) {
              local_78 = *(longlong **)(*plVar2 + lVar8);
            }
            uVar4 = uVar4 + 1;
            lVar8 = lVar8 + 8;
          } while (local_78 == (longlong *)0x0);
        }
        goto LAB_1402ef674;
      }
      plVar6 = operator_new(0x58);
      if (plVar6 != (longlong *)0x0) {
        plVar6[4] = 7;
        plVar6[3] = 0;
        *(undefined2 *)(plVar6 + 1) = 0;
        plVar6[6] = 0;
        plVar6[7] = 0;
        plVar6[8] = 0;
        *(undefined4 *)(plVar6 + 10) = 0;
        plVar11 = plVar6;
      }
      local_a0 = plVar11;
      FUN_1402f3c00(&local_98,plVar11);
      FUN_140178e90(&local_a0,plVar11,plVar11,param_4,uVar14);
      plVar11 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_140332ee0(local_a0,param_3);
      LOCK();
      *(int *)(plVar11 + 10) = (int)plVar11[10] + 1;
      UNLOCK();
      local_res20 = *(longlong *)(param_1 + 0x578) + 1;
      *(longlong *)(param_1 + 0x578) = local_res20;
      *local_a0 = local_res20;
      puVar7 = (undefined8 *)FUN_1402f3af0(local_68,&local_res20,&local_90);
      FUN_14031a010(plVar2,*puVar7,puVar7 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar11 = local_58 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar11 = local_98;
      *param_2 = (ulonglong)local_a0;
      param_2[1] = (ulonglong)local_98;
      if (local_98 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_98 + 1) = (int)local_98[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar2 = local_98;
      if (plVar11 != (longlong *)0x0) {
        LOCK();
        plVar11 = plVar11 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)plVar2 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402efba5)

ulonglong * FUN_1402ef8d0(longlong param_1,ulonglong *param_2,wchar_t *param_3)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  longlong *plVar8;
  wchar_t *pwVar9;
  wchar_t *pwVar10;
  longlong *plVar11;
  bool bVar12;
  void *local_res20;
  ulonglong local_a0;
  longlong *local_98;
  ulonglong local_90;
  longlong *local_88;
  ulonglong local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  ulonglong uVar4;
  
  uVar5 = 0;
  local_90 = 0;
  local_88 = (longlong *)0x0;
  bVar12 = param_3 == (wchar_t *)0x0;
  if (bVar12) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar7 = 1;
    pwVar9 = param_3;
    pwVar10 = L"";
    do {
      if (lVar7 == 0) break;
      lVar7 = lVar7 + -1;
      bVar12 = *pwVar9 == *pwVar10;
      pwVar9 = pwVar9 + 1;
      pwVar10 = pwVar10 + 1;
    } while (bVar12);
    if (bVar12) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar11 = (longlong *)(param_1 + 0x1c0);
      local_78 = uVar5;
      plStack_70 = plVar11;
      if ((*(longlong *)(param_1 + 0x1c8) != 0) && (*(uint *)(param_1 + 0x1d0) != 0)) {
        uVar4 = uVar5;
        plVar8 = (longlong *)*plVar11;
        do {
          if (*plVar8 != 0) {
            local_78 = ((longlong *)*plVar11)[uVar4];
            break;
          }
          uVar2 = (int)uVar4 + 1;
          uVar4 = (ulonglong)uVar2;
          plVar8 = plVar8 + 1;
        } while (uVar2 < *(uint *)(param_1 + 0x1d0));
      }
LAB_1402ef9a4:
      uVar4 = local_78;
      if (local_78 != 0) {
        if (local_78 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar9 = (wchar_t *)(*(longlong *)(local_78 + 8) + 0x48);
        if (7 < *(ulonglong *)(*(longlong *)(local_78 + 8) + 0x60)) {
          pwVar9 = *(wchar_t **)pwVar9;
        }
        iVar3 = _wcsicmp(param_3,pwVar9);
        if (iVar3 == 0) {
          if (uVar4 != 0) {
            lVar7 = *(longlong *)(uVar4 + 8);
            FUN_14034ed40(lVar7);
            *(int *)(lVar7 + 0x40) = *(int *)(lVar7 + 0x40) + 1;
            FUN_14034edd0(lVar7);
            *param_2 = *(ulonglong *)(uVar4 + 8);
            uVar5 = *(ulonglong *)(uVar4 + 0x10);
            param_2[1] = uVar5;
            if (uVar5 != 0) {
              LOCK();
              *(int *)(uVar5 + 8) = *(int *)(uVar5 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = uVar5;
        if ((uVar4 != 0) &&
           (local_78 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
          uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x1d0) + 1;
          lVar7 = (longlong)(int)uVar2 << 3;
          local_78 = uVar5;
          do {
            if (*(uint *)(param_1 + 0x1d0) <= uVar2) break;
            if (*(longlong *)(lVar7 + *plVar11) != 0) {
              local_78 = *(ulonglong *)(lVar7 + *plVar11);
            }
            uVar2 = uVar2 + 1;
            lVar7 = lVar7 + 8;
          } while (local_78 == 0);
        }
        goto LAB_1402ef9a4;
      }
      local_res20 = operator_new(0x3f0);
      if (local_res20 != (void *)0x0) {
        uVar5 = FUN_14032b310(local_res20);
      }
      local_a0 = uVar5;
      FUN_1402f3c70(&local_98,uVar5);
      FUN_140178e90(&local_a0,uVar5,uVar5);
      plVar8 = local_98;
      uVar5 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_14032b9a0(local_a0,param_3);
      FUN_14034ed40(uVar5);
      *(int *)(uVar5 + 0x40) = *(int *)(uVar5 + 0x40) + 1;
      FUN_14034edd0(uVar5);
      local_res20 = (void *)(*(longlong *)(param_1 + 0x580) + 1);
      *(void **)(param_1 + 0x580) = local_res20;
      *(void **)(uVar5 + 0x38) = local_res20;
      puVar6 = (undefined8 *)FUN_1402f3af0(local_68,&local_res20,&local_90);
      FUN_14031a010(plVar11,*puVar6,puVar6 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar11 = local_58 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        plVar8 = local_98;
        uVar5 = local_a0;
        if ((int)*plVar11 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          plVar8 = local_98;
          uVar5 = local_a0;
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
            plVar8 = local_98;
            uVar5 = local_a0;
          }
        }
      }
      *param_2 = uVar5;
      param_2[1] = (ulonglong)plVar8;
      plVar11 = (longlong *)0x0;
      if (plVar8 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar8 + 1) = (int)plVar8[1] + 1;
        UNLOCK();
        plVar11 = local_98;
      }
      LeaveCriticalSection(DAT_140608298);
      plVar8 = local_98;
      if (plVar11 != (longlong *)0x0) {
        LOCK();
        plVar11 = plVar11 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)plVar8 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402efecf)

ulonglong * FUN_1402efc00(longlong param_1,ulonglong *param_2,wchar_t *param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *pwVar10;
  longlong *plVar11;
  wchar_t *pwVar12;
  bool bVar13;
  longlong local_res20;
  undefined8 uVar14;
  longlong *local_a0;
  longlong *local_98;
  longlong *local_90;
  longlong *local_88;
  longlong *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  
  uVar14 = 0xfffffffffffffffe;
  plVar11 = (longlong *)0x0;
  local_90 = (longlong *)0x0;
  local_88 = (longlong *)0x0;
  bVar13 = param_3 == (wchar_t *)0x0;
  if (bVar13) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    pwVar10 = param_3;
    pwVar12 = L"";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar13 = *pwVar10 == *pwVar12;
      pwVar10 = pwVar10 + 1;
      pwVar12 = pwVar12 + 1;
    } while (bVar13);
    if (bVar13) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar2 = (longlong *)(param_1 + 0x208);
      local_78 = plVar11;
      plStack_70 = plVar2;
      if ((*(longlong *)(param_1 + 0x210) != 0) && (*(uint *)(param_1 + 0x218) != 0)) {
        plVar6 = plVar11;
        plVar9 = (longlong *)*plVar2;
        do {
          if (*plVar9 != 0) {
            local_78 = (longlong *)((longlong *)*plVar2)[(longlong)plVar6];
            break;
          }
          uVar4 = (int)plVar6 + 1;
          plVar6 = (longlong *)(ulonglong)uVar4;
          plVar9 = plVar9 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x218));
      }
LAB_1402efcd4:
      plVar6 = local_78;
      if (local_78 != (longlong *)0x0) {
        if (local_78 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar10 = (wchar_t *)(local_78[1] + 8);
        if (7 < *(ulonglong *)(local_78[1] + 0x20)) {
          pwVar10 = *(wchar_t **)pwVar10;
        }
        iVar5 = _wcsicmp(param_3,pwVar10);
        if (iVar5 == 0) {
          if (plVar6 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar6[1] + 0x50) = *(int *)(plVar6[1] + 0x50) + 1;
            UNLOCK();
            *param_2 = plVar6[1];
            uVar3 = plVar6[2];
            param_2[1] = uVar3;
            if (uVar3 != 0) {
              LOCK();
              *(int *)(uVar3 + 8) = *(int *)(uVar3 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = plVar11;
        if ((plVar6 != (longlong *)0x0) &&
           (local_78 = (longlong *)plVar6[3], (longlong *)plVar6[3] == (longlong *)0x0)) {
          uVar4 = *(uint *)(plVar6 + 4) % *(uint *)(param_1 + 0x218) + 1;
          lVar8 = (longlong)(int)uVar4 << 3;
          local_78 = plVar11;
          do {
            if (*(uint *)(param_1 + 0x218) <= uVar4) break;
            if (*(longlong *)(*plVar2 + lVar8) != 0) {
              local_78 = *(longlong **)(*plVar2 + lVar8);
            }
            uVar4 = uVar4 + 1;
            lVar8 = lVar8 + 8;
          } while (local_78 == (longlong *)0x0);
        }
        goto LAB_1402efcd4;
      }
      plVar6 = operator_new(0x58);
      if (plVar6 != (longlong *)0x0) {
        plVar6[4] = 7;
        plVar6[3] = 0;
        *(undefined2 *)(plVar6 + 1) = 0;
        plVar6[6] = 0;
        plVar6[7] = 0;
        plVar6[8] = 0;
        *(undefined4 *)(plVar6 + 10) = 0;
        plVar11 = plVar6;
      }
      local_a0 = plVar11;
      FUN_1402f3ce0(&local_98,plVar11);
      FUN_140178e90(&local_a0,plVar11,plVar11,param_4,uVar14);
      plVar11 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_14032eb70(local_a0,param_3);
      LOCK();
      *(int *)(plVar11 + 10) = (int)plVar11[10] + 1;
      UNLOCK();
      local_res20 = *(longlong *)(param_1 + 0x588) + 1;
      *(longlong *)(param_1 + 0x588) = local_res20;
      *local_a0 = local_res20;
      puVar7 = (undefined8 *)FUN_1402f3af0(local_68,&local_res20,&local_90);
      FUN_14031a010(plVar2,*puVar7,puVar7 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar11 = local_58 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar11 = local_98;
      *param_2 = (ulonglong)local_a0;
      param_2[1] = (ulonglong)local_98;
      if (local_98 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_98 + 1) = (int)local_98[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar2 = local_98;
      if (plVar11 != (longlong *)0x0) {
        LOCK();
        plVar11 = plVar11 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)plVar2 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f0244)

ulonglong * FUN_1402eff30(longlong param_1,ulonglong *param_2,wchar_t *param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  undefined4 uVar6;
  longlong *plVar7;
  undefined8 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  wchar_t *pwVar11;
  longlong *plVar12;
  wchar_t *pwVar13;
  bool bVar14;
  wchar_t *local_res18;
  undefined4 local_res20;
  undefined8 uVar15;
  longlong *local_a0;
  longlong *local_98;
  longlong *local_90;
  longlong *local_88;
  longlong *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  
  uVar15 = 0xfffffffffffffffe;
  plVar12 = (longlong *)0x0;
  local_res20 = 0;
  local_90 = (longlong *)0x0;
  local_88 = (longlong *)0x0;
  bVar14 = param_3 == (wchar_t *)0x0;
  if (bVar14) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar9 = 1;
    pwVar11 = param_3;
    pwVar13 = L"";
    do {
      if (lVar9 == 0) break;
      lVar9 = lVar9 + -1;
      bVar14 = *pwVar11 == *pwVar13;
      pwVar11 = pwVar11 + 1;
      pwVar13 = pwVar13 + 1;
    } while (bVar14);
    if (bVar14) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      local_res18 = param_3;
      EnterCriticalSection(DAT_140608298);
      plVar2 = (longlong *)(param_1 + 0x250);
      local_78 = plVar12;
      plStack_70 = plVar2;
      if ((*(longlong *)(param_1 + 600) != 0) && (*(uint *)(param_1 + 0x260) != 0)) {
        plVar7 = plVar12;
        plVar10 = (longlong *)*plVar2;
        do {
          if (*plVar10 != 0) {
            local_78 = (longlong *)((longlong *)*plVar2)[(longlong)plVar7];
            break;
          }
          uVar4 = (int)plVar7 + 1;
          plVar7 = (longlong *)(ulonglong)uVar4;
          plVar10 = plVar10 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x260));
      }
LAB_1402f0006:
      plVar7 = local_78;
      if (local_78 != (longlong *)0x0) {
        if (local_78 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar11 = (wchar_t *)(local_78[1] + 8);
        if (7 < *(ulonglong *)(local_78[1] + 0x20)) {
          pwVar11 = *(wchar_t **)pwVar11;
        }
        iVar5 = _wcsicmp(local_res18,pwVar11);
        if (iVar5 == 0) {
          if (plVar7 != (longlong *)0x0) {
            lVar9 = plVar7[1];
            FUN_14034ed40(lVar9 + 0x58);
            *(int *)(lVar9 + 0x50) = *(int *)(lVar9 + 0x50) + 1;
            FUN_14034edd0(lVar9 + 0x58);
            *param_2 = plVar7[1];
            uVar3 = plVar7[2];
            param_2[1] = uVar3;
            if (uVar3 != 0) {
              LOCK();
              *(int *)(uVar3 + 8) = *(int *)(uVar3 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = plVar12;
        if ((plVar7 != (longlong *)0x0) &&
           (local_78 = (longlong *)plVar7[3], (longlong *)plVar7[3] == (longlong *)0x0)) {
          uVar4 = *(uint *)(plVar7 + 4) % *(uint *)(param_1 + 0x260) + 1;
          lVar9 = (longlong)(int)uVar4 << 3;
          local_78 = plVar12;
          do {
            if (*(uint *)(param_1 + 0x260) <= uVar4) break;
            if (*(longlong *)(lVar9 + *plVar2) != 0) {
              local_78 = *(longlong **)(lVar9 + *plVar2);
            }
            uVar4 = uVar4 + 1;
            lVar9 = lVar9 + 8;
          } while (local_78 == (longlong *)0x0);
        }
        goto LAB_1402f0006;
      }
      plVar7 = operator_new(0x90);
      if (plVar7 != (longlong *)0x0) {
        plVar7[4] = 7;
        plVar7[3] = 0;
        *(undefined2 *)(plVar7 + 1) = 0;
        plVar7[6] = 0;
        plVar7[7] = 0;
        plVar7[8] = 0;
        *(undefined4 *)(plVar7 + 10) = 0;
        local_a0 = plVar7;
        uVar6 = FUN_1403c0cc0();
        FUN_14034ec60(plVar7 + 0xb,uVar6,1,param_4,uVar15);
        plVar12 = plVar7;
      }
      local_a0 = plVar12;
      FUN_1402f3d50(&local_98,plVar12);
      FUN_140178e90(&local_a0,plVar12,plVar12);
      plVar7 = local_98;
      plVar12 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_140343210(local_a0,local_res18);
      FUN_14034ed40(plVar12 + 0xb);
      *(int *)(plVar12 + 10) = (int)plVar12[10] + 1;
      FUN_14034edd0(plVar12 + 0xb);
      local_res18 = (wchar_t *)(*(longlong *)(param_1 + 0x590) + 1);
      *(wchar_t **)(param_1 + 0x590) = local_res18;
      *plVar12 = (longlong)local_res18;
      puVar8 = (undefined8 *)FUN_1402f3af0(local_68,&local_res18,&local_90);
      FUN_14031a010(plVar2,*puVar8,puVar8 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar2 = local_58 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        plVar7 = local_98;
        plVar12 = local_a0;
        if ((int)*plVar2 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          plVar7 = local_98;
          plVar12 = local_a0;
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
            plVar7 = local_98;
            plVar12 = local_a0;
          }
        }
      }
      *param_2 = (ulonglong)plVar12;
      param_2[1] = (ulonglong)plVar7;
      plVar12 = (longlong *)0x0;
      if (plVar7 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar7 + 1) = (int)plVar7[1] + 1;
        UNLOCK();
        plVar12 = local_98;
      }
      local_res20 = 1;
      LeaveCriticalSection(DAT_140608298);
      plVar2 = local_98;
      if (plVar12 != (longlong *)0x0) {
        LOCK();
        plVar12 = plVar12 + 1;
        *(int *)plVar12 = (int)*plVar12 + -1;
        UNLOCK();
        if ((int)*plVar12 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)plVar2 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f05b4)

ulonglong * FUN_1402f02a0(longlong param_1,ulonglong *param_2,wchar_t *param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  undefined4 uVar6;
  longlong *plVar7;
  undefined8 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  wchar_t *pwVar11;
  longlong *plVar12;
  wchar_t *pwVar13;
  bool bVar14;
  wchar_t *local_res18;
  undefined4 local_res20;
  undefined8 uVar15;
  longlong *local_a0;
  longlong *local_98;
  longlong *local_90;
  longlong *local_88;
  longlong *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  
  uVar15 = 0xfffffffffffffffe;
  plVar12 = (longlong *)0x0;
  local_res20 = 0;
  local_90 = (longlong *)0x0;
  local_88 = (longlong *)0x0;
  bVar14 = param_3 == (wchar_t *)0x0;
  if (bVar14) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar9 = 1;
    pwVar11 = param_3;
    pwVar13 = L"";
    do {
      if (lVar9 == 0) break;
      lVar9 = lVar9 + -1;
      bVar14 = *pwVar11 == *pwVar13;
      pwVar11 = pwVar11 + 1;
      pwVar13 = pwVar13 + 1;
    } while (bVar14);
    if (bVar14) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      local_res18 = param_3;
      EnterCriticalSection(DAT_140608298);
      plVar2 = (longlong *)(param_1 + 0x298);
      local_78 = plVar12;
      plStack_70 = plVar2;
      if ((*(longlong *)(param_1 + 0x2a0) != 0) && (*(uint *)(param_1 + 0x2a8) != 0)) {
        plVar7 = plVar12;
        plVar10 = (longlong *)*plVar2;
        do {
          if (*plVar10 != 0) {
            local_78 = (longlong *)((longlong *)*plVar2)[(longlong)plVar7];
            break;
          }
          uVar4 = (int)plVar7 + 1;
          plVar7 = (longlong *)(ulonglong)uVar4;
          plVar10 = plVar10 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x2a8));
      }
LAB_1402f0376:
      plVar7 = local_78;
      if (local_78 != (longlong *)0x0) {
        if (local_78 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar11 = (wchar_t *)(local_78[1] + 8);
        if (7 < *(ulonglong *)(local_78[1] + 0x20)) {
          pwVar11 = *(wchar_t **)pwVar11;
        }
        iVar5 = _wcsicmp(local_res18,pwVar11);
        if (iVar5 == 0) {
          if (plVar7 != (longlong *)0x0) {
            lVar9 = plVar7[1];
            FUN_14034ed40(lVar9 + 0x58);
            *(int *)(lVar9 + 0x50) = *(int *)(lVar9 + 0x50) + 1;
            FUN_14034edd0(lVar9 + 0x58);
            *param_2 = plVar7[1];
            uVar3 = plVar7[2];
            param_2[1] = uVar3;
            if (uVar3 != 0) {
              LOCK();
              *(int *)(uVar3 + 8) = *(int *)(uVar3 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = plVar12;
        if ((plVar7 != (longlong *)0x0) &&
           (local_78 = (longlong *)plVar7[3], (longlong *)plVar7[3] == (longlong *)0x0)) {
          uVar4 = *(uint *)(plVar7 + 4) % *(uint *)(param_1 + 0x2a8) + 1;
          lVar9 = (longlong)(int)uVar4 << 3;
          local_78 = plVar12;
          do {
            if (*(uint *)(param_1 + 0x2a8) <= uVar4) break;
            if (*(longlong *)(lVar9 + *plVar2) != 0) {
              local_78 = *(longlong **)(lVar9 + *plVar2);
            }
            uVar4 = uVar4 + 1;
            lVar9 = lVar9 + 8;
          } while (local_78 == (longlong *)0x0);
        }
        goto LAB_1402f0376;
      }
      plVar7 = operator_new(0x90);
      if (plVar7 != (longlong *)0x0) {
        plVar7[4] = 7;
        plVar7[3] = 0;
        *(undefined2 *)(plVar7 + 1) = 0;
        plVar7[6] = 0;
        plVar7[7] = 0;
        plVar7[8] = 0;
        *(undefined4 *)(plVar7 + 10) = 0;
        local_a0 = plVar7;
        uVar6 = FUN_1403c0cc0();
        FUN_14034ec60(plVar7 + 0xb,uVar6,1,param_4,uVar15);
        plVar12 = plVar7;
      }
      local_a0 = plVar12;
      FUN_1402f3d50(&local_98,plVar12);
      FUN_140178e90(&local_a0,plVar12,plVar12);
      plVar7 = local_98;
      plVar12 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_140343210(local_a0,local_res18);
      FUN_14034ed40(plVar12 + 0xb);
      *(int *)(plVar12 + 10) = (int)plVar12[10] + 1;
      FUN_14034edd0(plVar12 + 0xb);
      local_res18 = (wchar_t *)(*(longlong *)(param_1 + 0x598) + 1);
      *(wchar_t **)(param_1 + 0x598) = local_res18;
      *plVar12 = (longlong)local_res18;
      puVar8 = (undefined8 *)FUN_1402f3af0(local_68,&local_res18,&local_90);
      FUN_14031a010(plVar2,*puVar8,puVar8 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar2 = local_58 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        plVar7 = local_98;
        plVar12 = local_a0;
        if ((int)*plVar2 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          plVar7 = local_98;
          plVar12 = local_a0;
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
            plVar7 = local_98;
            plVar12 = local_a0;
          }
        }
      }
      *param_2 = (ulonglong)plVar12;
      param_2[1] = (ulonglong)plVar7;
      plVar12 = (longlong *)0x0;
      if (plVar7 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar7 + 1) = (int)plVar7[1] + 1;
        UNLOCK();
        plVar12 = local_98;
      }
      local_res20 = 1;
      LeaveCriticalSection(DAT_140608298);
      plVar2 = local_98;
      if (plVar12 != (longlong *)0x0) {
        LOCK();
        plVar12 = plVar12 + 1;
        *(int *)plVar12 = (int)*plVar12 + -1;
        UNLOCK();
        if ((int)*plVar12 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)plVar2 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f08c3)

ulonglong * FUN_1402f0610(longlong param_1,ulonglong *param_2,wchar_t *param_3)

{
  int *piVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  void *pvVar7;
  longlong *plVar8;
  undefined8 *puVar9;
  longlong lVar10;
  longlong *plVar11;
  wchar_t *pwVar12;
  wchar_t *pwVar13;
  bool bVar14;
  longlong local_res20;
  longlong *local_a0;
  longlong *local_98;
  longlong *local_90;
  longlong *local_88;
  longlong *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  longlong *plVar6;
  
  plVar8 = (longlong *)0x0;
  local_90 = (longlong *)0x0;
  local_88 = (longlong *)0x0;
  bVar14 = param_3 == (wchar_t *)0x0;
  if (bVar14) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar10 = 1;
    pwVar12 = param_3;
    pwVar13 = L"";
    do {
      if (lVar10 == 0) break;
      lVar10 = lVar10 + -1;
      bVar14 = *pwVar12 == *pwVar13;
      pwVar12 = pwVar12 + 1;
      pwVar13 = pwVar13 + 1;
    } while (bVar14);
    if (bVar14) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar2 = (longlong *)(param_1 + 0x2e0);
      local_78 = plVar8;
      plStack_70 = plVar2;
      if ((*(longlong *)(param_1 + 0x2e8) != 0) && (*(uint *)(param_1 + 0x2f0) != 0)) {
        plVar6 = plVar8;
        plVar11 = (longlong *)*plVar2;
        do {
          if (*plVar11 != 0) {
            local_78 = (longlong *)((longlong *)*plVar2)[(longlong)plVar6];
            break;
          }
          uVar4 = (int)plVar6 + 1;
          plVar6 = (longlong *)(ulonglong)uVar4;
          plVar11 = plVar11 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x2f0));
      }
LAB_1402f06e4:
      plVar6 = local_78;
      if (local_78 != (longlong *)0x0) {
        if (local_78 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar12 = (wchar_t *)(local_78[1] + 8);
        if (7 < *(ulonglong *)(local_78[1] + 0x20)) {
          pwVar12 = *(wchar_t **)pwVar12;
        }
        iVar5 = _wcsicmp(param_3,pwVar12);
        if (iVar5 == 0) {
          if (plVar6 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar6[1] + 0x78) = *(int *)(plVar6[1] + 0x78) + 1;
            UNLOCK();
            *param_2 = plVar6[1];
            uVar3 = plVar6[2];
            param_2[1] = uVar3;
            if (uVar3 != 0) {
              LOCK();
              *(int *)(uVar3 + 8) = *(int *)(uVar3 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = plVar8;
        if ((plVar6 != (longlong *)0x0) &&
           (local_78 = (longlong *)plVar6[3], (longlong *)plVar6[3] == (longlong *)0x0)) {
          uVar4 = *(uint *)(plVar6 + 4) % *(uint *)(param_1 + 0x2f0) + 1;
          lVar10 = (longlong)(int)uVar4 << 3;
          local_78 = plVar8;
          do {
            if (*(uint *)(param_1 + 0x2f0) <= uVar4) break;
            if (*(longlong *)(*plVar2 + lVar10) != 0) {
              local_78 = *(longlong **)(*plVar2 + lVar10);
            }
            uVar4 = uVar4 + 1;
            lVar10 = lVar10 + 8;
          } while (local_78 == (longlong *)0x0);
        }
        goto LAB_1402f06e4;
      }
      pvVar7 = operator_new(0x80);
      if (pvVar7 != (void *)0x0) {
        plVar8 = (longlong *)FUN_1403437e0(pvVar7);
      }
      local_a0 = plVar8;
      FUN_1402f3dc0(&local_98,plVar8);
      FUN_140178e90(&local_a0,plVar8,plVar8);
      plVar8 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_1403438a0(local_a0,param_3);
      LOCK();
      *(int *)(plVar8 + 0xf) = (int)plVar8[0xf] + 1;
      UNLOCK();
      local_res20 = *(longlong *)(param_1 + 0x5a0) + 1;
      *(longlong *)(param_1 + 0x5a0) = local_res20;
      *local_a0 = local_res20;
      puVar9 = (undefined8 *)FUN_1402f3af0(local_68,&local_res20,&local_90);
      FUN_14031a010(plVar2,*puVar9,puVar9 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar8 = local_58 + 1;
        *(int *)plVar8 = (int)*plVar8 + -1;
        UNLOCK();
        if ((int)*plVar8 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar8 = local_98;
      *param_2 = (ulonglong)local_a0;
      param_2[1] = (ulonglong)local_98;
      if (local_98 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_98 + 1) = (int)local_98[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar2 = local_98;
      if (plVar8 != (longlong *)0x0) {
        LOCK();
        plVar8 = plVar8 + 1;
        *(int *)plVar8 = (int)*plVar8 + -1;
        UNLOCK();
        if ((int)*plVar8 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)plVar2 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f0c1f)
// WARNING: Removing unreachable block (ram,0x0001402f0beb)

ulonglong * FUN_1402f0920(longlong param_1,ulonglong *param_2,wchar_t *param_3,int param_4)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  void *pvVar5;
  ulonglong uVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *pwVar10;
  wchar_t *pwVar11;
  longlong *plVar12;
  bool bVar13;
  longlong local_a8 [3];
  longlong *local_90;
  ulonglong local_88;
  longlong *local_80;
  ulonglong local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  ulonglong uVar4;
  
  local_a8[1] = 0xfffffffffffffffe;
  uVar6 = 0;
  local_88 = 0;
  local_80 = (longlong *)0x0;
  bVar13 = param_3 == (wchar_t *)0x0;
  if (bVar13) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    pwVar10 = param_3;
    pwVar11 = L"";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar13 = *pwVar10 == *pwVar11;
      pwVar10 = pwVar10 + 1;
      pwVar11 = pwVar11 + 1;
    } while (bVar13);
    if (bVar13) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar12 = (longlong *)(param_1 + 0x400);
      local_78 = uVar6;
      plStack_70 = plVar12;
      if ((*(longlong *)(param_1 + 0x408) != 0) && (*(uint *)(param_1 + 0x410) != 0)) {
        uVar4 = uVar6;
        plVar9 = (longlong *)*plVar12;
        do {
          if (*plVar9 != 0) {
            local_78 = ((longlong *)*plVar12)[uVar4];
            break;
          }
          uVar2 = (int)uVar4 + 1;
          uVar4 = (ulonglong)uVar2;
          plVar9 = plVar9 + 1;
        } while (uVar2 < *(uint *)(param_1 + 0x410));
      }
LAB_1402f09f6:
      uVar4 = local_78;
      if (local_78 != 0) {
        if (local_78 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar10 = (wchar_t *)(*(longlong *)(local_78 + 8) + 0x48);
        if (7 < *(ulonglong *)(*(longlong *)(local_78 + 8) + 0x60)) {
          pwVar10 = *(wchar_t **)pwVar10;
        }
        iVar3 = _wcsicmp(param_3,pwVar10);
        if ((iVar3 == 0) && (param_4 == *(int *)(*(longlong *)(uVar4 + 8) + 0x70))) {
          if (uVar4 != 0) {
            LOCK();
            piVar1 = (int *)(*(longlong *)(uVar4 + 8) + 0x74);
            *piVar1 = *piVar1 + 1;
            UNLOCK();
            *param_2 = *(ulonglong *)(uVar4 + 8);
            uVar6 = *(ulonglong *)(uVar4 + 0x10);
            param_2[1] = uVar6;
            if (uVar6 != 0) {
              LOCK();
              *(int *)(uVar6 + 8) = *(int *)(uVar6 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = uVar6;
        if ((uVar4 != 0) &&
           (local_78 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
          uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x410) + 1;
          lVar8 = (longlong)(int)uVar2 << 3;
          local_78 = uVar6;
          do {
            if (*(uint *)(param_1 + 0x410) <= uVar2) break;
            if (*(longlong *)(*plVar12 + lVar8) != 0) {
              local_78 = *(ulonglong *)(*plVar12 + lVar8);
            }
            uVar2 = uVar2 + 1;
            lVar8 = lVar8 + 8;
          } while (local_78 == 0);
        }
        goto LAB_1402f09f6;
      }
      pvVar5 = operator_new(0x80);
      if (pvVar5 != (void *)0x0) {
        uVar6 = FUN_140344620(pvVar5);
      }
      local_a8[2] = uVar6;
      FUN_1402f3e30(&local_90,uVar6);
      FUN_140178e90(local_a8 + 2,uVar6,uVar6);
      lVar8 = local_a8[2];
      local_88 = local_a8[2];
      local_80 = local_90;
      FUN_1403446e0(local_a8[2],param_3,param_4);
      LOCK();
      *(int *)(lVar8 + 0x74U) = *(int *)(lVar8 + 0x74U) + 1;
      UNLOCK();
      local_a8[0] = *(longlong *)(param_1 + 0x5a8) + 1;
      *(longlong *)(param_1 + 0x5a8) = local_a8[0];
      *(longlong *)(local_a8[2] + 0x78) = local_a8[0];
      puVar7 = (undefined8 *)FUN_1402f3af0(local_68,local_a8,&local_88);
      FUN_14031a010(plVar12,*puVar7,puVar7 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar12 = local_58 + 1;
        *(int *)plVar12 = (int)*plVar12 + -1;
        UNLOCK();
        if ((int)*plVar12 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar12 = local_90;
      *param_2 = local_a8[2];
      param_2[1] = (ulonglong)local_90;
      if (local_90 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_90 + 1) = (int)local_90[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar9 = local_90;
      if (plVar12 != (longlong *)0x0) {
        LOCK();
        plVar12 = plVar12 + 1;
        *(int *)plVar12 = (int)*plVar12 + -1;
        UNLOCK();
        if ((int)*plVar12 == 0) {
          (**(code **)(*local_90 + 8))(local_90);
          LOCK();
          piVar1 = (int *)((longlong)plVar9 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_90 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f0f4f)
// WARNING: Removing unreachable block (ram,0x0001402f0f1b)

ulonglong * FUN_1402f0c50(longlong param_1,ulonglong *param_2,wchar_t *param_3,int param_4)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  void *pvVar5;
  ulonglong uVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *pwVar10;
  wchar_t *pwVar11;
  longlong *plVar12;
  bool bVar13;
  longlong local_a8 [3];
  longlong *local_90;
  ulonglong local_88;
  longlong *local_80;
  ulonglong local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  ulonglong uVar4;
  
  local_a8[1] = 0xfffffffffffffffe;
  uVar6 = 0;
  local_88 = 0;
  local_80 = (longlong *)0x0;
  bVar13 = param_3 == (wchar_t *)0x0;
  if (bVar13) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    pwVar10 = param_3;
    pwVar11 = L"";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar13 = *pwVar10 == *pwVar11;
      pwVar10 = pwVar10 + 1;
      pwVar11 = pwVar11 + 1;
    } while (bVar13);
    if (bVar13) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar12 = (longlong *)(param_1 + 0x370);
      local_78 = uVar6;
      plStack_70 = plVar12;
      if ((*(longlong *)(param_1 + 0x378) != 0) && (*(uint *)(param_1 + 0x380) != 0)) {
        uVar4 = uVar6;
        plVar9 = (longlong *)*plVar12;
        do {
          if (*plVar9 != 0) {
            local_78 = ((longlong *)*plVar12)[uVar4];
            break;
          }
          uVar2 = (int)uVar4 + 1;
          uVar4 = (ulonglong)uVar2;
          plVar9 = plVar9 + 1;
        } while (uVar2 < *(uint *)(param_1 + 0x380));
      }
LAB_1402f0d26:
      uVar4 = local_78;
      if (local_78 != 0) {
        if (local_78 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar10 = (wchar_t *)(*(longlong *)(local_78 + 8) + 0x48);
        if (7 < *(ulonglong *)(*(longlong *)(local_78 + 8) + 0x60)) {
          pwVar10 = *(wchar_t **)pwVar10;
        }
        iVar3 = _wcsicmp(param_3,pwVar10);
        if ((iVar3 == 0) && (param_4 == *(int *)(*(longlong *)(uVar4 + 8) + 0x70))) {
          if (uVar4 != 0) {
            LOCK();
            piVar1 = (int *)(*(longlong *)(uVar4 + 8) + 0x74);
            *piVar1 = *piVar1 + 1;
            UNLOCK();
            *param_2 = *(ulonglong *)(uVar4 + 8);
            uVar6 = *(ulonglong *)(uVar4 + 0x10);
            param_2[1] = uVar6;
            if (uVar6 != 0) {
              LOCK();
              *(int *)(uVar6 + 8) = *(int *)(uVar6 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = uVar6;
        if ((uVar4 != 0) &&
           (local_78 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
          uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x380) + 1;
          lVar8 = (longlong)(int)uVar2 << 3;
          local_78 = uVar6;
          do {
            if (*(uint *)(param_1 + 0x380) <= uVar2) break;
            if (*(longlong *)(*plVar12 + lVar8) != 0) {
              local_78 = *(ulonglong *)(*plVar12 + lVar8);
            }
            uVar2 = uVar2 + 1;
            lVar8 = lVar8 + 8;
          } while (local_78 == 0);
        }
        goto LAB_1402f0d26;
      }
      pvVar5 = operator_new(0x80);
      if (pvVar5 != (void *)0x0) {
        uVar6 = FUN_140344620(pvVar5);
      }
      local_a8[2] = uVar6;
      FUN_1402f3ea0(&local_90,uVar6);
      FUN_140178e90(local_a8 + 2,uVar6,uVar6);
      lVar8 = local_a8[2];
      local_88 = local_a8[2];
      local_80 = local_90;
      FUN_140344c80(local_a8[2],param_3,param_4);
      LOCK();
      *(int *)(lVar8 + 0x74U) = *(int *)(lVar8 + 0x74U) + 1;
      UNLOCK();
      local_a8[0] = *(longlong *)(param_1 + 0x5a8) + 1;
      *(longlong *)(param_1 + 0x5a8) = local_a8[0];
      *(longlong *)(local_a8[2] + 0x78) = local_a8[0];
      puVar7 = (undefined8 *)FUN_1402f3af0(local_68,local_a8,&local_88);
      FUN_14031a010(plVar12,*puVar7,puVar7 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar12 = local_58 + 1;
        *(int *)plVar12 = (int)*plVar12 + -1;
        UNLOCK();
        if ((int)*plVar12 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar12 = local_90;
      *param_2 = local_a8[2];
      param_2[1] = (ulonglong)local_90;
      if (local_90 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_90 + 1) = (int)local_90[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar9 = local_90;
      if (plVar12 != (longlong *)0x0) {
        LOCK();
        plVar12 = plVar12 + 1;
        *(int *)plVar12 = (int)*plVar12 + -1;
        UNLOCK();
        if ((int)*plVar12 == 0) {
          (**(code **)(*local_90 + 8))(local_90);
          LOCK();
          piVar1 = (int *)((longlong)plVar9 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_90 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f1250)

ulonglong * FUN_1402f0f80(longlong param_1,ulonglong *param_2,wchar_t *param_3)

{
  int *piVar1;
  longlong *plVar2;
  ulonglong uVar3;
  uint uVar4;
  int iVar5;
  void *pvVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *pwVar10;
  void *pvVar11;
  wchar_t *pwVar12;
  bool bVar13;
  longlong local_res20;
  void *local_a0;
  longlong *local_98;
  void *local_90;
  longlong *local_88;
  void *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  
  pvVar11 = (void *)0x0;
  local_90 = (void *)0x0;
  local_88 = (longlong *)0x0;
  bVar13 = param_3 == (wchar_t *)0x0;
  if (bVar13) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    pwVar10 = param_3;
    pwVar12 = L"";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar13 = *pwVar10 == *pwVar12;
      pwVar10 = pwVar10 + 1;
      pwVar12 = pwVar12 + 1;
    } while (bVar13);
    if (bVar13) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar2 = (longlong *)(param_1 + 0x3b8);
      local_78 = pvVar11;
      plStack_70 = plVar2;
      if ((*(longlong *)(param_1 + 0x3c0) != 0) && (*(uint *)(param_1 + 0x3c8) != 0)) {
        pvVar6 = pvVar11;
        plVar9 = (longlong *)*plVar2;
        do {
          if (*plVar9 != 0) {
            local_78 = (void *)((longlong *)*plVar2)[(longlong)pvVar6];
            break;
          }
          uVar4 = (int)pvVar6 + 1;
          pvVar6 = (void *)(ulonglong)uVar4;
          plVar9 = plVar9 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x3c8));
      }
LAB_1402f1054:
      pvVar6 = local_78;
      if (local_78 != (void *)0x0) {
        if (local_78 == (void *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar10 = (wchar_t *)(*(longlong *)((longlong)local_78 + 8) + 0x40);
        if (7 < *(ulonglong *)(*(longlong *)((longlong)local_78 + 8) + 0x58)) {
          pwVar10 = *(wchar_t **)pwVar10;
        }
        iVar5 = _wcsicmp(param_3,pwVar10);
        if (iVar5 == 0) {
          if (pvVar6 != (void *)0x0) {
            LOCK();
            piVar1 = (int *)(*(longlong *)((longlong)pvVar6 + 8) + 0x68);
            *piVar1 = *piVar1 + 1;
            UNLOCK();
            *param_2 = *(ulonglong *)((longlong)pvVar6 + 8);
            uVar3 = *(ulonglong *)((longlong)pvVar6 + 0x10);
            param_2[1] = uVar3;
            if (uVar3 != 0) {
              LOCK();
              *(int *)(uVar3 + 8) = *(int *)(uVar3 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = pvVar11;
        if ((pvVar6 != (void *)0x0) &&
           (local_78 = *(void **)((longlong)pvVar6 + 0x18),
           *(void **)((longlong)pvVar6 + 0x18) == (void *)0x0)) {
          uVar4 = *(uint *)((longlong)pvVar6 + 0x20) % *(uint *)(param_1 + 0x3c8) + 1;
          lVar8 = (longlong)(int)uVar4 << 3;
          local_78 = pvVar11;
          do {
            if (*(uint *)(param_1 + 0x3c8) <= uVar4) break;
            if (*(longlong *)(lVar8 + *plVar2) != 0) {
              local_78 = *(void **)(lVar8 + *plVar2);
            }
            uVar4 = uVar4 + 1;
            lVar8 = lVar8 + 8;
          } while (local_78 == (void *)0x0);
        }
        goto LAB_1402f1054;
      }
      pvVar6 = operator_new(0x78);
      if (pvVar6 != (void *)0x0) {
        FUN_1402ca220(pvVar6);
        *(undefined8 *)((longlong)pvVar6 + 0x58) = 7;
        *(undefined8 *)((longlong)pvVar6 + 0x50) = 0;
        *(undefined2 *)((longlong)pvVar6 + 0x40) = 0;
        *(undefined4 *)((longlong)pvVar6 + 0x68) = 0;
        *(undefined8 *)((longlong)pvVar6 + 0x70) = 0;
        pvVar11 = pvVar6;
      }
      local_a0 = pvVar11;
      FUN_1402f3f10(&local_98,pvVar11);
      FUN_140178e90(&local_a0,pvVar11,pvVar11);
      pvVar11 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_1403454d0(local_a0,param_3);
      LOCK();
      *(int *)((longlong)pvVar11 + 0x68U) = *(int *)((longlong)pvVar11 + 0x68U) + 1;
      UNLOCK();
      local_res20 = *(longlong *)(param_1 + 0x5b0) + 1;
      *(longlong *)(param_1 + 0x5b0) = local_res20;
      *(longlong *)((longlong)local_a0 + 0x70) = local_res20;
      puVar7 = (undefined8 *)FUN_1402f3af0(local_68,&local_res20,&local_90);
      FUN_14031a010(plVar2,*puVar7,puVar7 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar2 = local_58 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar1 = (int *)((longlong)local_58 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar2 = local_98;
      *param_2 = (ulonglong)local_a0;
      param_2[1] = (ulonglong)local_98;
      if (local_98 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_98 + 1) = (int)local_98[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar9 = local_98;
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        plVar2 = plVar2 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar1 = (int *)((longlong)plVar9 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f1562)

undefined8 * FUN_1402f12b0(longlong param_1,undefined8 *param_2,wchar_t *param_3)

{
  longlong *plVar1;
  uint uVar2;
  int iVar3;
  void *pvVar5;
  int *piVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  wchar_t *pwVar10;
  wchar_t *pwVar11;
  bool bVar12;
  longlong local_res20;
  int *local_a0;
  longlong *local_98;
  int *local_90;
  longlong *local_88;
  int *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  int *piVar4;
  
  piVar6 = (int *)0x0;
  local_90 = (int *)0x0;
  local_88 = (longlong *)0x0;
  bVar12 = param_3 == (wchar_t *)0x0;
  if (bVar12) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    pwVar10 = param_3;
    pwVar11 = L"";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar12 = *pwVar10 == *pwVar11;
      pwVar10 = pwVar10 + 1;
      pwVar11 = pwVar11 + 1;
    } while (bVar12);
    if (bVar12) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar1 = (longlong *)(param_1 + 0x498);
      local_78 = piVar6;
      plStack_70 = plVar1;
      if ((*(longlong *)(param_1 + 0x4a0) != 0) && (*(uint *)(param_1 + 0x4a8) != 0)) {
        piVar4 = piVar6;
        plVar9 = (longlong *)*plVar1;
        do {
          if (*plVar9 != 0) {
            local_78 = (int *)((longlong *)*plVar1)[(longlong)piVar4];
            break;
          }
          uVar2 = (int)piVar4 + 1;
          piVar4 = (int *)(ulonglong)uVar2;
          plVar9 = plVar9 + 1;
        } while (uVar2 < *(uint *)(param_1 + 0x4a8));
      }
LAB_1402f1384:
      piVar4 = local_78;
      if (local_78 != (int *)0x0) {
        if (local_78 == (int *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar10 = (wchar_t *)(*(longlong *)(local_78 + 2) + 0x10);
        if (7 < *(ulonglong *)(*(longlong *)(local_78 + 2) + 0x28)) {
          pwVar10 = *(wchar_t **)pwVar10;
        }
        iVar3 = _wcsicmp(param_3,pwVar10);
        if (iVar3 == 0) {
          if (piVar4 != (int *)0x0) {
            LOCK();
            **(int **)(piVar4 + 2) = **(int **)(piVar4 + 2) + 1;
            UNLOCK();
            *param_2 = *(undefined8 *)(piVar4 + 2);
            lVar8 = *(longlong *)(piVar4 + 4);
            param_2[1] = lVar8;
            if (lVar8 != 0) {
              LOCK();
              *(int *)(lVar8 + 8) = *(int *)(lVar8 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = piVar6;
        if ((piVar4 != (int *)0x0) &&
           (local_78 = *(int **)(piVar4 + 6), *(int **)(piVar4 + 6) == (int *)0x0)) {
          uVar2 = (uint)piVar4[8] % *(uint *)(param_1 + 0x4a8) + 1;
          lVar8 = (longlong)(int)uVar2 << 3;
          local_78 = piVar6;
          do {
            if (*(uint *)(param_1 + 0x4a8) <= uVar2) break;
            if (*(longlong *)(*plVar1 + lVar8) != 0) {
              local_78 = *(int **)(*plVar1 + lVar8);
            }
            uVar2 = uVar2 + 1;
            lVar8 = lVar8 + 8;
          } while (local_78 == (int *)0x0);
        }
        goto LAB_1402f1384;
      }
      pvVar5 = operator_new(0x80);
      if (pvVar5 != (void *)0x0) {
        piVar6 = (int *)FUN_14032d000(pvVar5);
      }
      local_a0 = piVar6;
      FUN_1402f3f80(&local_98,piVar6);
      FUN_140178e90(&local_a0,piVar6,piVar6);
      piVar6 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_14032d0c0(local_a0,param_3);
      LOCK();
      *piVar6 = *piVar6 + 1;
      UNLOCK();
      local_res20 = *(longlong *)(param_1 + 0x5b8) + 1;
      *(longlong *)(param_1 + 0x5b8) = local_res20;
      *(longlong *)(local_a0 + 2) = local_res20;
      puVar7 = (undefined8 *)FUN_1402f3af0(local_68,&local_res20,&local_90);
      FUN_14031a010(plVar1,*puVar7,puVar7 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_58 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar6 = (int *)((longlong)local_58 + 0xc);
          *piVar6 = *piVar6 + -1;
          UNLOCK();
          if (*piVar6 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar1 = local_98;
      *param_2 = local_a0;
      param_2[1] = local_98;
      if (local_98 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_98 + 1) = (int)local_98[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar9 = local_98;
      if (plVar1 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar6 = (int *)((longlong)plVar9 + 0xc);
          *piVar6 = *piVar6 + -1;
          UNLOCK();
          if (*piVar6 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f18a5)

undefined8 * FUN_1402f15c0(longlong param_1,undefined8 *param_2,wchar_t *param_3)

{
  longlong *plVar1;
  uint uVar2;
  int iVar3;
  int *piVar4;
  undefined8 *puVar5;
  longlong lVar6;
  longlong *plVar7;
  wchar_t *pwVar8;
  int *piVar9;
  wchar_t *pwVar10;
  bool bVar11;
  int *local_a8;
  undefined8 local_a0;
  int *local_98;
  longlong *local_90;
  int *local_88;
  longlong *local_80;
  int *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  
  local_a0 = 0xfffffffffffffffe;
  piVar9 = (int *)0x0;
  local_88 = (int *)0x0;
  local_80 = (longlong *)0x0;
  bVar11 = param_3 == (wchar_t *)0x0;
  if (bVar11) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar6 = 1;
    pwVar8 = param_3;
    pwVar10 = L"";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar11 = *pwVar8 == *pwVar10;
      pwVar8 = pwVar8 + 1;
      pwVar10 = pwVar10 + 1;
    } while (bVar11);
    if (bVar11) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar1 = (longlong *)(param_1 + 0x4e0);
      local_78 = piVar9;
      plStack_70 = plVar1;
      if ((*(longlong *)(param_1 + 0x4e8) != 0) && (*(uint *)(param_1 + 0x4f0) != 0)) {
        piVar4 = piVar9;
        plVar7 = (longlong *)*plVar1;
        do {
          if (*plVar7 != 0) {
            local_78 = (int *)((longlong *)*plVar1)[(longlong)piVar4];
            break;
          }
          uVar2 = (int)piVar4 + 1;
          piVar4 = (int *)(ulonglong)uVar2;
          plVar7 = plVar7 + 1;
        } while (uVar2 < *(uint *)(param_1 + 0x4f0));
      }
LAB_1402f1694:
      piVar4 = local_78;
      if (local_78 != (int *)0x0) {
        if (local_78 == (int *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar8 = (wchar_t *)(*(longlong *)(local_78 + 2) + 0x10);
        if (7 < *(ulonglong *)(*(longlong *)(local_78 + 2) + 0x28)) {
          pwVar8 = *(wchar_t **)pwVar8;
        }
        iVar3 = _wcsicmp(param_3,pwVar8);
        if (iVar3 == 0) {
          if (piVar4 != (int *)0x0) {
            LOCK();
            **(int **)(piVar4 + 2) = **(int **)(piVar4 + 2) + 1;
            UNLOCK();
            *param_2 = *(undefined8 *)(piVar4 + 2);
            lVar6 = *(longlong *)(piVar4 + 4);
            param_2[1] = lVar6;
            if (lVar6 != 0) {
              LOCK();
              *(int *)(lVar6 + 8) = *(int *)(lVar6 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = piVar9;
        if ((piVar4 != (int *)0x0) &&
           (local_78 = *(int **)(piVar4 + 6), *(int **)(piVar4 + 6) == (int *)0x0)) {
          uVar2 = (uint)piVar4[8] % *(uint *)(param_1 + 0x4f0) + 1;
          lVar6 = (longlong)(int)uVar2 << 3;
          local_78 = piVar9;
          do {
            if (*(uint *)(param_1 + 0x4f0) <= uVar2) break;
            if (*(longlong *)(*plVar1 + lVar6) != 0) {
              local_78 = *(int **)(*plVar1 + lVar6);
            }
            uVar2 = uVar2 + 1;
            lVar6 = lVar6 + 8;
          } while (local_78 == (int *)0x0);
        }
        goto LAB_1402f1694;
      }
      piVar4 = operator_new(0x50);
      local_a8 = piVar4;
      if (piVar4 != (int *)0x0) {
        *piVar4 = 0;
        piVar4[2] = 0;
        piVar4[3] = 0;
        piVar4[10] = 7;
        piVar4[0xb] = 0;
        piVar4[8] = 0;
        piVar4[9] = 0;
        *(undefined2 *)(piVar4 + 4) = 0;
        piVar4[0xe] = 0;
        piVar4[0x10] = 0;
        piVar4[0x11] = 0;
        FUN_140321180(piVar4 + 0x12,0,0);
        piVar9 = piVar4;
      }
      local_98 = piVar9;
      FUN_1402f3ff0(&local_90,piVar9);
      FUN_140178e90(&local_98,piVar9,piVar9);
      piVar9 = local_98;
      local_88 = local_98;
      local_80 = local_90;
      FUN_140320a10(local_98,param_3);
      LOCK();
      *piVar9 = *piVar9 + 1;
      UNLOCK();
      local_a8 = (int *)(*(longlong *)(param_1 + 0x5c0) + 1);
      *(int **)(param_1 + 0x5c0) = local_a8;
      *(int **)(local_98 + 2) = local_a8;
      puVar5 = (undefined8 *)FUN_1402f3af0(local_68,&local_a8,&local_88);
      FUN_14031a010(plVar1,*puVar5,puVar5 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_58 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar9 = (int *)((longlong)local_58 + 0xc);
          *piVar9 = *piVar9 + -1;
          UNLOCK();
          if (*piVar9 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar1 = local_90;
      *param_2 = local_98;
      param_2[1] = local_90;
      if (local_90 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_90 + 1) = (int)local_90[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar7 = local_90;
      if (plVar1 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_90 + 8))(local_90);
          LOCK();
          piVar9 = (int *)((longlong)plVar7 + 0xc);
          *piVar9 = *piVar9 + -1;
          UNLOCK();
          if (*piVar9 == 0) {
            (**(code **)(*local_90 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001402f1bd1)

undefined8 * FUN_1402f1900(longlong param_1,undefined8 *param_2,wchar_t *param_3,undefined8 param_4)

{
  longlong *plVar1;
  uint uVar2;
  int iVar3;
  int *piVar4;
  undefined8 *puVar5;
  longlong lVar6;
  longlong *plVar7;
  wchar_t *pwVar8;
  int *piVar9;
  wchar_t *pwVar10;
  bool bVar11;
  longlong local_res20;
  undefined8 uVar12;
  int *local_a0;
  longlong *local_98;
  int *local_90;
  longlong *local_88;
  int *local_78;
  longlong *plStack_70;
  undefined1 local_68 [16];
  longlong *local_58;
  
  uVar12 = 0xfffffffffffffffe;
  piVar9 = (int *)0x0;
  local_90 = (int *)0x0;
  local_88 = (longlong *)0x0;
  bVar11 = param_3 == (wchar_t *)0x0;
  if (bVar11) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar6 = 1;
    pwVar8 = param_3;
    pwVar10 = L"";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar11 = *pwVar8 == *pwVar10;
      pwVar8 = pwVar8 + 1;
      pwVar10 = pwVar10 + 1;
    } while (bVar11);
    if (bVar11) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_140608298);
      plVar1 = (longlong *)(param_1 + 0x528);
      local_78 = piVar9;
      plStack_70 = plVar1;
      if ((*(longlong *)(param_1 + 0x530) != 0) && (*(uint *)(param_1 + 0x538) != 0)) {
        piVar4 = piVar9;
        plVar7 = (longlong *)*plVar1;
        do {
          if (*plVar7 != 0) {
            local_78 = (int *)((longlong *)*plVar1)[(longlong)piVar4];
            break;
          }
          uVar2 = (int)piVar4 + 1;
          piVar4 = (int *)(ulonglong)uVar2;
          plVar7 = plVar7 + 1;
        } while (uVar2 < *(uint *)(param_1 + 0x538));
      }
LAB_1402f19d4:
      piVar4 = local_78;
      if (local_78 != (int *)0x0) {
        if (local_78 == (int *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        pwVar8 = (wchar_t *)(*(longlong *)(local_78 + 2) + 0x10);
        if (7 < *(ulonglong *)(*(longlong *)(local_78 + 2) + 0x28)) {
          pwVar8 = *(wchar_t **)pwVar8;
        }
        iVar3 = _wcsicmp(param_3,pwVar8);
        if (iVar3 == 0) {
          if (piVar4 != (int *)0x0) {
            LOCK();
            **(int **)(piVar4 + 2) = **(int **)(piVar4 + 2) + 1;
            UNLOCK();
            *param_2 = *(undefined8 *)(piVar4 + 2);
            lVar6 = *(longlong *)(piVar4 + 4);
            param_2[1] = lVar6;
            if (lVar6 != 0) {
              LOCK();
              *(int *)(lVar6 + 8) = *(int *)(lVar6 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_140608298);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        local_78 = piVar9;
        if ((piVar4 != (int *)0x0) &&
           (local_78 = *(int **)(piVar4 + 6), *(int **)(piVar4 + 6) == (int *)0x0)) {
          uVar2 = (uint)piVar4[8] % *(uint *)(param_1 + 0x538) + 1;
          lVar6 = (longlong)(int)uVar2 << 3;
          local_78 = piVar9;
          do {
            if (*(uint *)(param_1 + 0x538) <= uVar2) break;
            if (*(longlong *)(*plVar1 + lVar6) != 0) {
              local_78 = *(int **)(*plVar1 + lVar6);
            }
            uVar2 = uVar2 + 1;
            lVar6 = lVar6 + 8;
          } while (local_78 == (int *)0x0);
        }
        goto LAB_1402f19d4;
      }
      piVar4 = operator_new(0x58);
      if (piVar4 != (int *)0x0) {
        *piVar4 = 0;
        piVar4[2] = 0;
        piVar4[3] = 0;
        piVar4[10] = 7;
        piVar4[0xb] = 0;
        piVar4[8] = 0;
        piVar4[9] = 0;
        *(undefined2 *)(piVar4 + 4) = 0;
        piVar4[0xe] = 0;
        piVar4[0xf] = 0;
        piVar4[0x10] = 0;
        piVar4[0x11] = 0;
        piVar4[0x12] = 0;
        piVar4[0x13] = 0;
        piVar9 = piVar4;
      }
      local_a0 = piVar9;
      FUN_1402f4060(&local_98,piVar9);
      FUN_140178e90(&local_a0,piVar9,piVar9,param_4,uVar12);
      piVar9 = local_a0;
      local_90 = local_a0;
      local_88 = local_98;
      FUN_140344040(local_a0,param_3);
      LOCK();
      *piVar9 = *piVar9 + 1;
      UNLOCK();
      local_res20 = *(longlong *)(param_1 + 0x5c8) + 1;
      *(longlong *)(param_1 + 0x5c8) = local_res20;
      *(longlong *)(local_a0 + 2) = local_res20;
      puVar5 = (undefined8 *)FUN_1402f3af0(local_68,&local_res20,&local_90);
      FUN_14031a010(plVar1,*puVar5,puVar5 + 1);
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_58 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar9 = (int *)((longlong)local_58 + 0xc);
          *piVar9 = *piVar9 + -1;
          UNLOCK();
          if (*piVar9 == 0) {
            (**(code **)(*local_58 + 0x10))(local_58);
          }
        }
      }
      plVar1 = local_98;
      *param_2 = local_a0;
      param_2[1] = local_98;
      if (local_98 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_98 + 1) = (int)local_98[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_140608298);
      plVar7 = local_98;
      if (plVar1 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar1 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_98 + 8))(local_98);
          LOCK();
          piVar9 = (int *)((longlong)plVar7 + 0xc);
          *piVar9 = *piVar9 + -1;
          UNLOCK();
          if (*piVar9 == 0) {
            (**(code **)(*local_98 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



void FUN_1402f1c30(longlong param_1,short *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  short *psVar2;
  short *psVar3;
  undefined1 uVar4;
  undefined8 uVar5;
  
  uVar4 = &stack0x00000000 == (undefined1 *)0x38;
  uVar5 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_140608298);
  lVar1 = 6;
  psVar2 = param_2;
  psVar3 = &DAT_1404a4d58;
  do {
    if (lVar1 == 0) break;
    lVar1 = lVar1 + -1;
    uVar4 = *psVar2 == *psVar3;
    psVar2 = psVar2 + 1;
    psVar3 = psVar3 + 1;
  } while ((bool)uVar4);
  if ((bool)uVar4) {
    FUN_1402f3920(param_1 + 0x58);
    FUN_1402ee410(param_1);
  }
  FUN_1402f1d00(param_1,param_2,param_3,param_4,uVar5);
  FUN_1402f1fa0(param_1,param_2);
  FUN_1402f2260(param_1,param_2);
  FUN_1402f24e0(param_1,param_2);
  FUN_1402f27a0(param_1,param_2);
  FUN_1402f2970(param_1,param_2);
  FUN_1402f2b40(param_1,param_2);
                    // WARNING: Could not recover jumptable at 0x0001402f1cf0. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608298);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402f1f5f)
// WARNING: Removing unreachable block (ram,0x0001402f1ef1)
// WARNING: Removing unreachable block (ram,0x0001402f1ea7)

void FUN_1402f1d00(longlong param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  longlong lVar5;
  longlong *plVar6;
  ulonglong uVar7;
  wchar_t *pwVar8;
  ulonglong uVar9;
  wchar_t *pwVar10;
  bool bVar11;
  undefined8 uVar12;
  undefined1 local_30 [8];
  longlong *local_28;
  ulonglong uVar4;
  
  if (param_2 == (wchar_t *)0x0) {
    return;
  }
  bVar11 = &stack0x00000000 == (undefined1 *)0x58;
  uVar12 = 0xfffffffffffffffe;
  lVar5 = 1;
  pwVar8 = param_2;
  pwVar10 = L"";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar11 = *pwVar8 == *pwVar10;
    pwVar8 = pwVar8 + 1;
    pwVar10 = pwVar10 + 1;
  } while (bVar11);
  if (bVar11) {
    return;
  }
  EnterCriticalSection(DAT_140608298);
  uVar9 = 0;
  uVar7 = uVar9;
  if ((*(longlong *)(param_1 + 0x138) != 0) && (*(uint *)(param_1 + 0x140) != 0)) {
    uVar4 = uVar9;
    plVar6 = *(longlong **)(param_1 + 0x130);
    do {
      if (*plVar6 != 0) {
        uVar7 = (*(longlong **)(param_1 + 0x130))[uVar4];
        break;
      }
      uVar2 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar2;
      plVar6 = plVar6 + 1;
    } while (uVar2 < *(uint *)(param_1 + 0x140));
  }
LAB_1402f1da0:
  uVar4 = uVar7;
  if (uVar4 != 0) {
    pwVar8 = (wchar_t *)(*(longlong *)(uVar4 + 8) + 0x40);
    if (7 < *(ulonglong *)(*(longlong *)(uVar4 + 8) + 0x58)) {
      pwVar8 = *(wchar_t **)pwVar8;
    }
    iVar3 = _wcsicmp(param_2,pwVar8);
    if (iVar3 == 0) {
      if (uVar4 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_140167bf0(*(longlong *)(uVar4 + 8) + 0x68);
      if ((uVar4 == 0) || (*(longlong *)(uVar4 + 0x18) != 0)) goto LAB_1402f1eb2;
      uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x140) + 1;
      lVar5 = (longlong)(int)uVar2 << 3;
      uVar7 = uVar9;
      goto LAB_1402f1e80;
    }
    uVar7 = uVar9;
    if ((uVar4 != 0) && (uVar7 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
      uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x140) + 1;
      lVar5 = (longlong)(int)uVar2 << 3;
      uVar7 = uVar9;
      do {
        if (*(uint *)(param_1 + 0x140) <= uVar2) break;
        if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x130)) != 0) {
          uVar7 = *(ulonglong *)(lVar5 + *(longlong *)(param_1 + 0x130));
        }
        uVar2 = uVar2 + 1;
        lVar5 = lVar5 + 8;
      } while (uVar7 == 0);
    }
    goto LAB_1402f1da0;
  }
  goto LAB_1402f1f6a;
  while( true ) {
    if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x130)) != 0) {
      uVar7 = *(ulonglong *)(lVar5 + *(longlong *)(param_1 + 0x130));
    }
    uVar2 = uVar2 + 1;
    lVar5 = lVar5 + 8;
    if (uVar7 != 0) break;
LAB_1402f1e80:
    if (*(uint *)(param_1 + 0x140) <= uVar2) break;
  }
LAB_1402f1eb2:
  uVar2 = *(uint *)(uVar4 + 0x20);
  uVar7 = (ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x140);
  lVar5 = *(longlong *)(param_1 + 0x130);
  if (uVar4 != *(ulonglong *)(lVar5 + uVar7 * 8)) {
    uVar9 = *(ulonglong *)(lVar5 + uVar7 * 8);
    for (uVar7 = *(ulonglong *)(uVar9 + 0x18); uVar7 != uVar4; uVar7 = *(ulonglong *)(uVar7 + 0x18))
    {
      uVar9 = uVar7;
    }
  }
  if (uVar9 == 0) {
    *(undefined8 *)(lVar5 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x140)) * 8) =
         *(undefined8 *)(uVar4 + 0x18);
  }
  else {
    *(undefined8 *)(uVar9 + 0x18) = *(undefined8 *)(uVar4 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0x130,uVar4,(ulonglong)uVar2,param_4,uVar12);
  FUN_1402ef230(param_1,local_30,param_2);
  if (local_28 != (longlong *)0x0) {
    LOCK();
    plVar6 = local_28 + 1;
    *(int *)plVar6 = (int)*plVar6 + -1;
    UNLOCK();
    if ((int)*plVar6 == 0) {
      (**(code **)(*local_28 + 8))(local_28);
      LOCK();
      piVar1 = (int *)((longlong)local_28 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_28 + 0x10))(local_28);
      }
    }
  }
LAB_1402f1f6a:
  LeaveCriticalSection(DAT_140608298);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402f221f)
// WARNING: Removing unreachable block (ram,0x0001402f21b1)
// WARNING: Removing unreachable block (ram,0x0001402f2167)

void FUN_1402f1fa0(longlong param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong lVar2;
  uint uVar3;
  int iVar4;
  longlong lVar6;
  longlong *plVar7;
  ulonglong uVar8;
  wchar_t *pwVar9;
  ulonglong uVar10;
  wchar_t *pwVar11;
  bool bVar12;
  undefined8 uVar13;
  undefined1 local_40 [8];
  longlong *local_38;
  ulonglong uVar5;
  
  if (param_2 == (wchar_t *)0x0) {
    return;
  }
  bVar12 = &stack0x00000000 == (undefined1 *)0x68;
  uVar13 = 0xfffffffffffffffe;
  lVar6 = 1;
  pwVar9 = param_2;
  pwVar11 = L"";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar12 = *pwVar9 == *pwVar11;
    pwVar9 = pwVar9 + 1;
    pwVar11 = pwVar11 + 1;
  } while (bVar12);
  if (bVar12) {
    return;
  }
  EnterCriticalSection(DAT_140608298);
  uVar10 = 0;
  uVar8 = uVar10;
  if ((*(longlong *)(param_1 + 0x180) != 0) && (*(uint *)(param_1 + 0x188) != 0)) {
    uVar5 = uVar10;
    plVar7 = *(longlong **)(param_1 + 0x178);
    do {
      if (*plVar7 != 0) {
        uVar8 = (*(longlong **)(param_1 + 0x178))[uVar5];
        break;
      }
      uVar3 = (int)uVar5 + 1;
      uVar5 = (ulonglong)uVar3;
      plVar7 = plVar7 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0x188));
  }
LAB_1402f2040:
  uVar5 = uVar8;
  if (uVar5 != 0) {
    pwVar9 = (wchar_t *)(*(longlong *)(uVar5 + 8) + 8);
    if (7 < *(ulonglong *)(*(longlong *)(uVar5 + 8) + 0x20)) {
      pwVar9 = *(wchar_t **)pwVar9;
    }
    iVar4 = _wcsicmp(param_2,pwVar9);
    if (iVar4 == 0) {
      if (uVar5 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar6 = *(longlong *)(uVar5 + 8);
      lVar2 = *(longlong *)(lVar6 + 0x38);
      if (*(longlong *)(lVar6 + 0x30) != lVar2) {
        uVar13 = FUN_140333a10(lVar2,lVar2,*(longlong *)(lVar6 + 0x30),param_4,uVar13);
        FUN_1402ce6b0(uVar13);
        *(undefined8 *)(lVar6 + 0x38) = uVar13;
      }
      if ((uVar5 == 0) || (*(longlong *)(uVar5 + 0x18) != 0)) goto LAB_1402f2172;
      uVar3 = *(uint *)(uVar5 + 0x20) % *(uint *)(param_1 + 0x188) + 1;
      lVar6 = (longlong)(int)uVar3 << 3;
      uVar8 = uVar10;
      goto LAB_1402f2140;
    }
    uVar8 = uVar10;
    if ((uVar5 != 0) && (uVar8 = *(ulonglong *)(uVar5 + 0x18), *(ulonglong *)(uVar5 + 0x18) == 0)) {
      uVar3 = *(uint *)(uVar5 + 0x20) % *(uint *)(param_1 + 0x188) + 1;
      lVar6 = (longlong)(int)uVar3 << 3;
      uVar8 = uVar10;
      do {
        if (*(uint *)(param_1 + 0x188) <= uVar3) break;
        if (*(longlong *)(*(longlong *)(param_1 + 0x178) + lVar6) != 0) {
          uVar8 = *(ulonglong *)(*(longlong *)(param_1 + 0x178) + lVar6);
        }
        uVar3 = uVar3 + 1;
        lVar6 = lVar6 + 8;
      } while (uVar8 == 0);
    }
    goto LAB_1402f2040;
  }
  goto LAB_1402f222a;
  while( true ) {
    if (*(longlong *)(*(longlong *)(param_1 + 0x178) + lVar6) != 0) {
      uVar8 = *(ulonglong *)(*(longlong *)(param_1 + 0x178) + lVar6);
    }
    uVar3 = uVar3 + 1;
    lVar6 = lVar6 + 8;
    if (uVar8 != 0) break;
LAB_1402f2140:
    if (*(uint *)(param_1 + 0x188) <= uVar3) break;
  }
LAB_1402f2172:
  uVar8 = (ulonglong)*(uint *)(uVar5 + 0x20) % (ulonglong)*(uint *)(param_1 + 0x188);
  lVar6 = *(longlong *)(param_1 + 0x178);
  if (uVar5 != *(ulonglong *)(lVar6 + uVar8 * 8)) {
    uVar10 = *(ulonglong *)(lVar6 + uVar8 * 8);
    for (uVar8 = *(ulonglong *)(uVar10 + 0x18); uVar8 != uVar5; uVar8 = *(ulonglong *)(uVar8 + 0x18)
        ) {
      uVar10 = uVar8;
    }
  }
  if (uVar10 == 0) {
    *(undefined8 *)
     (lVar6 + ((ulonglong)*(uint *)(uVar5 + 0x20) % (ulonglong)*(uint *)(param_1 + 0x188)) * 8) =
         *(undefined8 *)(uVar5 + 0x18);
  }
  else {
    *(undefined8 *)(uVar10 + 0x18) = *(undefined8 *)(uVar5 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0x178,uVar5);
  FUN_1402ef5a0(param_1,local_40,param_2);
  if (local_38 != (longlong *)0x0) {
    LOCK();
    plVar7 = local_38 + 1;
    *(int *)plVar7 = (int)*plVar7 + -1;
    UNLOCK();
    if ((int)*plVar7 == 0) {
      (**(code **)(*local_38 + 8))(local_38);
      LOCK();
      piVar1 = (int *)((longlong)local_38 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_38 + 0x10))(local_38);
      }
    }
  }
LAB_1402f222a:
  LeaveCriticalSection(DAT_140608298);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402f249f)

void FUN_1402f2260(longlong param_1,wchar_t *param_2)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  longlong lVar5;
  longlong *plVar6;
  ulonglong uVar7;
  wchar_t *pwVar8;
  ulonglong uVar9;
  wchar_t *pwVar10;
  bool bVar11;
  undefined8 uVar12;
  undefined1 local_30 [8];
  longlong *local_28;
  ulonglong uVar4;
  
  if (param_2 == (wchar_t *)0x0) {
    return;
  }
  bVar11 = &stack0x00000000 == (undefined1 *)0x58;
  uVar12 = 0xfffffffffffffffe;
  lVar5 = 1;
  pwVar8 = param_2;
  pwVar10 = L"";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar11 = *pwVar8 == *pwVar10;
    pwVar8 = pwVar8 + 1;
    pwVar10 = pwVar10 + 1;
  } while (bVar11);
  if (bVar11) {
    return;
  }
  EnterCriticalSection(DAT_140608298);
  uVar9 = 0;
  uVar7 = uVar9;
  if ((*(longlong *)(param_1 + 0x1c8) != 0) && (*(uint *)(param_1 + 0x1d0) != 0)) {
    uVar4 = uVar9;
    plVar6 = *(longlong **)(param_1 + 0x1c0);
    do {
      if (*plVar6 != 0) {
        uVar7 = (*(longlong **)(param_1 + 0x1c0))[uVar4];
        break;
      }
      uVar2 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar2;
      plVar6 = plVar6 + 1;
    } while (uVar2 < *(uint *)(param_1 + 0x1d0));
  }
LAB_1402f22f2:
  uVar4 = uVar7;
  if (uVar4 != 0) {
    pwVar8 = (wchar_t *)(*(longlong *)(uVar4 + 8) + 0x48);
    if (7 < *(ulonglong *)(*(longlong *)(uVar4 + 8) + 0x60)) {
      pwVar8 = *(wchar_t **)pwVar8;
    }
    iVar3 = _wcsicmp(param_2,pwVar8);
    if (iVar3 == 0) {
      bVar11 = uVar4 != 0;
      if (!bVar11) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      if ((uVar4 == 0) || (*(longlong *)(uVar4 + 0x18) != 0)) goto LAB_1402f23e2;
      uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x1d0) + 1;
      lVar5 = (longlong)(int)uVar2 << 3;
      uVar7 = uVar9;
      goto LAB_1402f23c0;
    }
    uVar7 = uVar9;
    if ((uVar4 != 0) && (uVar7 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
      uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x1d0) + 1;
      lVar5 = (longlong)(int)uVar2 << 3;
      uVar7 = uVar9;
      do {
        if (*(uint *)(param_1 + 0x1d0) <= uVar2) break;
        if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x1c0)) != 0) {
          uVar7 = *(ulonglong *)(lVar5 + *(longlong *)(param_1 + 0x1c0));
        }
        uVar2 = uVar2 + 1;
        lVar5 = lVar5 + 8;
      } while (uVar7 == 0);
    }
    goto LAB_1402f22f2;
  }
  goto LAB_1402f24aa;
  while( true ) {
    if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x1c0)) != 0) {
      uVar7 = *(ulonglong *)(lVar5 + *(longlong *)(param_1 + 0x1c0));
    }
    uVar2 = uVar2 + 1;
    lVar5 = lVar5 + 8;
    if (uVar7 != 0) break;
LAB_1402f23c0:
    if (*(uint *)(param_1 + 0x1d0) <= uVar2) break;
  }
LAB_1402f23e2:
  if (!bVar11) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = *(uint *)(uVar4 + 0x20);
  uVar7 = (ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x1d0);
  lVar5 = *(longlong *)(param_1 + 0x1c0);
  if (uVar4 != *(ulonglong *)(lVar5 + uVar7 * 8)) {
    uVar9 = *(ulonglong *)(lVar5 + uVar7 * 8);
    for (uVar7 = *(ulonglong *)(uVar9 + 0x18); uVar7 != uVar4; uVar7 = *(ulonglong *)(uVar7 + 0x18))
    {
      uVar9 = uVar7;
    }
  }
  if (!bVar11) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (uVar9 == 0) {
    *(undefined8 *)(lVar5 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x1d0)) * 8) =
         *(undefined8 *)(uVar4 + 0x18);
  }
  else {
    *(undefined8 *)(uVar9 + 0x18) = *(undefined8 *)(uVar4 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0x1c0,uVar4,(ulonglong)uVar2,bVar11,uVar12);
  FUN_1402ef230(param_1,local_30,param_2);
  if (local_28 != (longlong *)0x0) {
    LOCK();
    plVar6 = local_28 + 1;
    *(int *)plVar6 = (int)*plVar6 + -1;
    UNLOCK();
    if ((int)*plVar6 == 0) {
      (**(code **)(*local_28 + 8))(local_28);
      LOCK();
      piVar1 = (int *)((longlong)local_28 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_28 + 0x10))(local_28);
      }
    }
  }
LAB_1402f24aa:
  LeaveCriticalSection(DAT_140608298);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402f275f)
// WARNING: Removing unreachable block (ram,0x0001402f26f1)
// WARNING: Removing unreachable block (ram,0x0001402f26a7)

void FUN_1402f24e0(longlong param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong lVar2;
  uint uVar3;
  int iVar4;
  longlong lVar6;
  longlong *plVar7;
  ulonglong uVar8;
  wchar_t *pwVar9;
  ulonglong uVar10;
  wchar_t *pwVar11;
  bool bVar12;
  undefined8 uVar13;
  undefined1 local_40 [8];
  longlong *local_38;
  ulonglong uVar5;
  
  if (param_2 == (wchar_t *)0x0) {
    return;
  }
  bVar12 = &stack0x00000000 == (undefined1 *)0x68;
  uVar13 = 0xfffffffffffffffe;
  lVar6 = 1;
  pwVar9 = param_2;
  pwVar11 = L"";
  do {
    if (lVar6 == 0) break;
    lVar6 = lVar6 + -1;
    bVar12 = *pwVar9 == *pwVar11;
    pwVar9 = pwVar9 + 1;
    pwVar11 = pwVar11 + 1;
  } while (bVar12);
  if (bVar12) {
    return;
  }
  EnterCriticalSection(DAT_140608298);
  uVar10 = 0;
  uVar8 = uVar10;
  if ((*(longlong *)(param_1 + 0x210) != 0) && (*(uint *)(param_1 + 0x218) != 0)) {
    uVar5 = uVar10;
    plVar7 = *(longlong **)(param_1 + 0x208);
    do {
      if (*plVar7 != 0) {
        uVar8 = (*(longlong **)(param_1 + 0x208))[uVar5];
        break;
      }
      uVar3 = (int)uVar5 + 1;
      uVar5 = (ulonglong)uVar3;
      plVar7 = plVar7 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0x218));
  }
LAB_1402f2580:
  uVar5 = uVar8;
  if (uVar5 != 0) {
    pwVar9 = (wchar_t *)(*(longlong *)(uVar5 + 8) + 8);
    if (7 < *(ulonglong *)(*(longlong *)(uVar5 + 8) + 0x20)) {
      pwVar9 = *(wchar_t **)pwVar9;
    }
    iVar4 = _wcsicmp(param_2,pwVar9);
    if (iVar4 == 0) {
      if (uVar5 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar6 = *(longlong *)(uVar5 + 8);
      lVar2 = *(longlong *)(lVar6 + 0x38);
      if (*(longlong *)(lVar6 + 0x30) != lVar2) {
        uVar13 = FUN_140333a10(lVar2,lVar2,*(longlong *)(lVar6 + 0x30),param_4,uVar13);
        FUN_1402ce6b0(uVar13);
        *(undefined8 *)(lVar6 + 0x38) = uVar13;
      }
      if ((uVar5 == 0) || (*(longlong *)(uVar5 + 0x18) != 0)) goto LAB_1402f26b2;
      uVar3 = *(uint *)(uVar5 + 0x20) % *(uint *)(param_1 + 0x218) + 1;
      lVar6 = (longlong)(int)uVar3 << 3;
      uVar8 = uVar10;
      goto LAB_1402f2680;
    }
    uVar8 = uVar10;
    if ((uVar5 != 0) && (uVar8 = *(ulonglong *)(uVar5 + 0x18), *(ulonglong *)(uVar5 + 0x18) == 0)) {
      uVar3 = *(uint *)(uVar5 + 0x20) % *(uint *)(param_1 + 0x218) + 1;
      lVar6 = (longlong)(int)uVar3 << 3;
      uVar8 = uVar10;
      do {
        if (*(uint *)(param_1 + 0x218) <= uVar3) break;
        if (*(longlong *)(*(longlong *)(param_1 + 0x208) + lVar6) != 0) {
          uVar8 = *(ulonglong *)(*(longlong *)(param_1 + 0x208) + lVar6);
        }
        uVar3 = uVar3 + 1;
        lVar6 = lVar6 + 8;
      } while (uVar8 == 0);
    }
    goto LAB_1402f2580;
  }
  goto LAB_1402f276a;
  while( true ) {
    if (*(longlong *)(*(longlong *)(param_1 + 0x208) + lVar6) != 0) {
      uVar8 = *(ulonglong *)(*(longlong *)(param_1 + 0x208) + lVar6);
    }
    uVar3 = uVar3 + 1;
    lVar6 = lVar6 + 8;
    if (uVar8 != 0) break;
LAB_1402f2680:
    if (*(uint *)(param_1 + 0x218) <= uVar3) break;
  }
LAB_1402f26b2:
  uVar8 = (ulonglong)*(uint *)(uVar5 + 0x20) % (ulonglong)*(uint *)(param_1 + 0x218);
  lVar6 = *(longlong *)(param_1 + 0x208);
  if (uVar5 != *(ulonglong *)(lVar6 + uVar8 * 8)) {
    uVar10 = *(ulonglong *)(lVar6 + uVar8 * 8);
    for (uVar8 = *(ulonglong *)(uVar10 + 0x18); uVar8 != uVar5; uVar8 = *(ulonglong *)(uVar8 + 0x18)
        ) {
      uVar10 = uVar8;
    }
  }
  if (uVar10 == 0) {
    *(undefined8 *)
     (lVar6 + ((ulonglong)*(uint *)(uVar5 + 0x20) % (ulonglong)*(uint *)(param_1 + 0x218)) * 8) =
         *(undefined8 *)(uVar5 + 0x18);
  }
  else {
    *(undefined8 *)(uVar10 + 0x18) = *(undefined8 *)(uVar5 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0x208,uVar5);
  FUN_1402efc00(param_1,local_40,param_2);
  if (local_38 != (longlong *)0x0) {
    LOCK();
    plVar7 = local_38 + 1;
    *(int *)plVar7 = (int)*plVar7 + -1;
    UNLOCK();
    if ((int)*plVar7 == 0) {
      (**(code **)(*local_38 + 8))(local_38);
      LOCK();
      piVar1 = (int *)((longlong)local_38 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_38 + 0x10))(local_38);
      }
    }
  }
LAB_1402f276a:
  LeaveCriticalSection(DAT_140608298);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402f2931)

void FUN_1402f27a0(longlong param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  uint uVar3;
  int iVar4;
  longlong lVar6;
  longlong *plVar7;
  ulonglong uVar8;
  wchar_t *pwVar9;
  ulonglong uVar10;
  wchar_t *pwVar11;
  bool bVar12;
  undefined8 uVar13;
  ulonglong local_58;
  longlong *plStack_50;
  undefined1 local_48 [8];
  longlong *local_40;
  undefined1 local_38 [32];
  ulonglong uVar5;
  
  if (param_2 != (wchar_t *)0x0) {
    bVar12 = &stack0x00000000 == (undefined1 *)0x88;
    uVar13 = 0xfffffffffffffffe;
    lVar6 = 1;
    pwVar9 = param_2;
    pwVar11 = L"";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar12 = *pwVar9 == *pwVar11;
      pwVar9 = pwVar9 + 1;
      pwVar11 = pwVar11 + 1;
    } while (bVar12);
    if (!bVar12) {
      EnterCriticalSection(DAT_140608298);
      plVar2 = (longlong *)(param_1 + 0x250);
      uVar10 = 0;
      uVar8 = uVar10;
      plStack_50 = plVar2;
      if ((*(longlong *)(param_1 + 600) != 0) && (*(uint *)(param_1 + 0x260) != 0)) {
        uVar5 = uVar10;
        plVar7 = (longlong *)*plVar2;
        do {
          if (*plVar7 != 0) {
            uVar8 = ((longlong *)*plVar2)[uVar5];
            break;
          }
          uVar3 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar3;
          plVar7 = plVar7 + 1;
        } while (uVar3 < *(uint *)(param_1 + 0x260));
      }
LAB_1402f2833:
      uVar5 = uVar8;
      local_58 = uVar5;
      if (uVar5 != 0) {
        pwVar9 = (wchar_t *)(*(longlong *)(uVar5 + 8) + 8);
        if (7 < *(ulonglong *)(*(longlong *)(uVar5 + 8) + 0x20)) {
          pwVar9 = *(wchar_t **)pwVar9;
        }
        iVar4 = _wcsicmp(param_2,pwVar9);
        if (iVar4 == 0) {
          if (uVar5 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          FUN_140343190(*(undefined8 *)(uVar5 + 8));
          FUN_1402c6c60(plVar2,local_38,&local_58,param_4,uVar13);
          FUN_1402eff30(param_1,local_48,param_2);
          if (local_40 != (longlong *)0x0) {
            LOCK();
            plVar2 = local_40 + 1;
            *(int *)plVar2 = (int)*plVar2 + -1;
            UNLOCK();
            if ((int)*plVar2 == 0) {
              (**(code **)(*local_40 + 8))(local_40);
              LOCK();
              piVar1 = (int *)((longlong)local_40 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*local_40 + 0x10))(local_40);
              }
            }
          }
          goto LAB_1402f293c;
        }
        uVar8 = uVar10;
        if ((uVar5 != 0) &&
           (uVar8 = *(ulonglong *)(uVar5 + 0x18), *(ulonglong *)(uVar5 + 0x18) == 0)) {
          uVar3 = *(uint *)(uVar5 + 0x20) % *(uint *)(param_1 + 0x260) + 1;
          lVar6 = (longlong)(int)uVar3 << 3;
          uVar8 = uVar10;
          do {
            if (*(uint *)(param_1 + 0x260) <= uVar3) break;
            if (*(longlong *)(*plVar2 + lVar6) != 0) {
              uVar8 = *(ulonglong *)(*plVar2 + lVar6);
            }
            uVar3 = uVar3 + 1;
            lVar6 = lVar6 + 8;
          } while (uVar8 == 0);
        }
        goto LAB_1402f2833;
      }
LAB_1402f293c:
      LeaveCriticalSection(DAT_140608298);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402f2b01)

void FUN_1402f2970(longlong param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong *plVar2;
  uint uVar3;
  int iVar4;
  longlong lVar6;
  longlong *plVar7;
  ulonglong uVar8;
  wchar_t *pwVar9;
  ulonglong uVar10;
  wchar_t *pwVar11;
  bool bVar12;
  undefined8 uVar13;
  ulonglong local_58;
  longlong *plStack_50;
  undefined1 local_48 [8];
  longlong *local_40;
  undefined1 local_38 [32];
  ulonglong uVar5;
  
  if (param_2 != (wchar_t *)0x0) {
    bVar12 = &stack0x00000000 == (undefined1 *)0x88;
    uVar13 = 0xfffffffffffffffe;
    lVar6 = 1;
    pwVar9 = param_2;
    pwVar11 = L"";
    do {
      if (lVar6 == 0) break;
      lVar6 = lVar6 + -1;
      bVar12 = *pwVar9 == *pwVar11;
      pwVar9 = pwVar9 + 1;
      pwVar11 = pwVar11 + 1;
    } while (bVar12);
    if (!bVar12) {
      EnterCriticalSection(DAT_140608298);
      plVar2 = (longlong *)(param_1 + 0x298);
      uVar10 = 0;
      uVar8 = uVar10;
      plStack_50 = plVar2;
      if ((*(longlong *)(param_1 + 0x2a0) != 0) && (*(uint *)(param_1 + 0x2a8) != 0)) {
        uVar5 = uVar10;
        plVar7 = (longlong *)*plVar2;
        do {
          if (*plVar7 != 0) {
            uVar8 = ((longlong *)*plVar2)[uVar5];
            break;
          }
          uVar3 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar3;
          plVar7 = plVar7 + 1;
        } while (uVar3 < *(uint *)(param_1 + 0x2a8));
      }
LAB_1402f2a03:
      uVar5 = uVar8;
      local_58 = uVar5;
      if (uVar5 != 0) {
        pwVar9 = (wchar_t *)(*(longlong *)(uVar5 + 8) + 8);
        if (7 < *(ulonglong *)(*(longlong *)(uVar5 + 8) + 0x20)) {
          pwVar9 = *(wchar_t **)pwVar9;
        }
        iVar4 = _wcsicmp(param_2,pwVar9);
        if (iVar4 == 0) {
          if (uVar5 == 0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          FUN_140343190(*(undefined8 *)(uVar5 + 8));
          FUN_1402c6c60(plVar2,local_38,&local_58,param_4,uVar13);
          FUN_1402f02a0(param_1,local_48,param_2);
          if (local_40 != (longlong *)0x0) {
            LOCK();
            plVar2 = local_40 + 1;
            *(int *)plVar2 = (int)*plVar2 + -1;
            UNLOCK();
            if ((int)*plVar2 == 0) {
              (**(code **)(*local_40 + 8))(local_40);
              LOCK();
              piVar1 = (int *)((longlong)local_40 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*local_40 + 0x10))(local_40);
              }
            }
          }
          goto LAB_1402f2b0c;
        }
        uVar8 = uVar10;
        if ((uVar5 != 0) &&
           (uVar8 = *(ulonglong *)(uVar5 + 0x18), *(ulonglong *)(uVar5 + 0x18) == 0)) {
          uVar3 = *(uint *)(uVar5 + 0x20) % *(uint *)(param_1 + 0x2a8) + 1;
          lVar6 = (longlong)(int)uVar3 << 3;
          uVar8 = uVar10;
          do {
            if (*(uint *)(param_1 + 0x2a8) <= uVar3) break;
            if (*(longlong *)(*plVar2 + lVar6) != 0) {
              uVar8 = *(ulonglong *)(*plVar2 + lVar6);
            }
            uVar3 = uVar3 + 1;
            lVar6 = lVar6 + 8;
          } while (uVar8 == 0);
        }
        goto LAB_1402f2a03;
      }
LAB_1402f2b0c:
      LeaveCriticalSection(DAT_140608298);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402f2d9f)
// WARNING: Removing unreachable block (ram,0x0001402f2d31)
// WARNING: Removing unreachable block (ram,0x0001402f2ce7)

void FUN_1402f2b40(longlong param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  longlong lVar5;
  longlong *plVar6;
  ulonglong uVar7;
  wchar_t *pwVar8;
  ulonglong uVar9;
  wchar_t *pwVar10;
  bool bVar11;
  undefined8 uVar12;
  undefined1 local_30 [8];
  longlong *local_28;
  ulonglong uVar4;
  
  if (param_2 == (wchar_t *)0x0) {
    return;
  }
  bVar11 = &stack0x00000000 == (undefined1 *)0x58;
  uVar12 = 0xfffffffffffffffe;
  lVar5 = 1;
  pwVar8 = param_2;
  pwVar10 = L"";
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    bVar11 = *pwVar8 == *pwVar10;
    pwVar8 = pwVar8 + 1;
    pwVar10 = pwVar10 + 1;
  } while (bVar11);
  if (bVar11) {
    return;
  }
  EnterCriticalSection(DAT_140608298);
  uVar9 = 0;
  uVar7 = uVar9;
  if ((*(longlong *)(param_1 + 0x2e8) != 0) && (*(uint *)(param_1 + 0x2f0) != 0)) {
    uVar4 = uVar9;
    plVar6 = *(longlong **)(param_1 + 0x2e0);
    do {
      if (*plVar6 != 0) {
        uVar7 = (*(longlong **)(param_1 + 0x2e0))[uVar4];
        break;
      }
      uVar2 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar2;
      plVar6 = plVar6 + 1;
    } while (uVar2 < *(uint *)(param_1 + 0x2f0));
  }
LAB_1402f2be0:
  uVar4 = uVar7;
  if (uVar4 != 0) {
    pwVar8 = (wchar_t *)(*(longlong *)(uVar4 + 8) + 8);
    if (7 < *(ulonglong *)(*(longlong *)(uVar4 + 8) + 0x20)) {
      pwVar8 = *(wchar_t **)pwVar8;
    }
    iVar3 = _wcsicmp(param_2,pwVar8);
    if (iVar3 == 0) {
      if (uVar4 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_1402f3920(*(longlong *)(uVar4 + 8) + 0x30);
      if ((uVar4 == 0) || (*(longlong *)(uVar4 + 0x18) != 0)) goto LAB_1402f2cf2;
      uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x2f0) + 1;
      lVar5 = (longlong)(int)uVar2 << 3;
      uVar7 = uVar9;
      goto LAB_1402f2cc0;
    }
    uVar7 = uVar9;
    if ((uVar4 != 0) && (uVar7 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
      uVar2 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x2f0) + 1;
      lVar5 = (longlong)(int)uVar2 << 3;
      uVar7 = uVar9;
      do {
        if (*(uint *)(param_1 + 0x2f0) <= uVar2) break;
        if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x2e0)) != 0) {
          uVar7 = *(ulonglong *)(lVar5 + *(longlong *)(param_1 + 0x2e0));
        }
        uVar2 = uVar2 + 1;
        lVar5 = lVar5 + 8;
      } while (uVar7 == 0);
    }
    goto LAB_1402f2be0;
  }
  goto LAB_1402f2daa;
  while( true ) {
    if (*(longlong *)(lVar5 + *(longlong *)(param_1 + 0x2e0)) != 0) {
      uVar7 = *(ulonglong *)(lVar5 + *(longlong *)(param_1 + 0x2e0));
    }
    uVar2 = uVar2 + 1;
    lVar5 = lVar5 + 8;
    if (uVar7 != 0) break;
LAB_1402f2cc0:
    if (*(uint *)(param_1 + 0x2f0) <= uVar2) break;
  }
LAB_1402f2cf2:
  uVar2 = *(uint *)(uVar4 + 0x20);
  uVar7 = (ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x2f0);
  lVar5 = *(longlong *)(param_1 + 0x2e0);
  if (uVar4 != *(ulonglong *)(lVar5 + uVar7 * 8)) {
    uVar9 = *(ulonglong *)(lVar5 + uVar7 * 8);
    for (uVar7 = *(ulonglong *)(uVar9 + 0x18); uVar7 != uVar4; uVar7 = *(ulonglong *)(uVar7 + 0x18))
    {
      uVar9 = uVar7;
    }
  }
  if (uVar9 == 0) {
    *(undefined8 *)(lVar5 + ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x2f0)) * 8) =
         *(undefined8 *)(uVar4 + 0x18);
  }
  else {
    *(undefined8 *)(uVar9 + 0x18) = *(undefined8 *)(uVar4 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0x2e0,uVar4,(ulonglong)uVar2,param_4,uVar12);
  FUN_1402f0610(param_1,local_30,param_2);
  if (local_28 != (longlong *)0x0) {
    LOCK();
    plVar6 = local_28 + 1;
    *(int *)plVar6 = (int)*plVar6 + -1;
    UNLOCK();
    if ((int)*plVar6 == 0) {
      (**(code **)(*local_28 + 8))(local_28);
      LOCK();
      piVar1 = (int *)((longlong)local_28 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_28 + 0x10))(local_28);
      }
    }
  }
LAB_1402f2daa:
  LeaveCriticalSection(DAT_140608298);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402f2e5c)

undefined8 FUN_1402f2de0(longlong param_1,uint param_2)

{
  undefined8 uVar1;
  uint *puVar2;
  
  EnterCriticalSection(DAT_140608298);
  if (*(longlong *)(param_1 + 0x328) != 0) {
    for (puVar2 = *(uint **)(*(longlong *)(param_1 + 0x328) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x338)) * 8);
        puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 6)) {
      if ((puVar2[8] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 != (uint *)0x0) {
          uVar1 = *(undefined8 *)(puVar2 + 2);
          LeaveCriticalSection(DAT_140608298);
          return uVar1;
        }
        break;
      }
    }
  }
  LeaveCriticalSection(DAT_140608298);
  return 0;
}



void FUN_1402f2e90(longlong param_1)

{
  int *piVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong local_38;
  
  EnterCriticalSection(DAT_140608298);
  if (*(longlong *)(param_1 + 0x18) != 0) {
    uVar5 = 0;
    if (*(uint *)(param_1 + 0x20) != 0) {
      plVar2 = *(longlong **)(param_1 + 0x10);
      plVar7 = plVar2;
      do {
        if (*plVar7 != 0) {
          lVar8 = plVar2[uVar5];
          goto LAB_1402f2f20;
        }
        uVar4 = (int)uVar5 + 1;
        uVar5 = (ulonglong)uVar4;
        plVar7 = plVar7 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0x20));
    }
  }
  lVar8 = 0;
LAB_1402f2f20:
  do {
    do {
      local_38 = lVar8;
      if (local_38 == 0) {
        LeaveCriticalSection(DAT_140608298);
        return;
      }
      if (local_38 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar8 = *(longlong *)(local_38 + 8);
      plVar2 = *(longlong **)(local_38 + 0x10);
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
        UNLOCK();
      }
      if (*(int *)(lVar8 + 0x940) == 1) {
        plVar7 = (longlong *)(lVar8 + 0x948);
        if (7 < *(ulonglong *)(lVar8 + 0x960)) {
          plVar7 = (longlong *)*plVar7;
        }
        FUN_140322210(lVar8,*(undefined4 *)(lVar8 + 0x8e0),plVar7);
      }
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        plVar7 = plVar2 + 1;
        *(int *)plVar7 = (int)*plVar7 + -1;
        UNLOCK();
        if ((int)*plVar7 == 0) {
          (**(code **)(*plVar2 + 8))(plVar2);
          LOCK();
          piVar1 = (int *)((longlong)plVar2 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*plVar2 + 0x10))();
          }
        }
      }
      lVar8 = local_38;
    } while ((local_38 == 0) || (lVar8 = *(longlong *)(local_38 + 0x18), lVar8 != 0));
    uVar4 = *(uint *)(local_38 + 0x20) % *(uint *)(param_1 + 0x20) + 1;
    lVar6 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(param_1 + 0x20) <= uVar4) break;
      lVar3 = *(longlong *)(param_1 + 0x10);
      if (*(longlong *)(lVar6 + lVar3) != 0) {
        lVar8 = *(longlong *)(lVar6 + lVar3);
      }
      uVar4 = uVar4 + 1;
      lVar6 = lVar6 + 8;
    } while (lVar8 == 0);
  } while( true );
}



void FUN_1402f3050(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *plVar5;
  uint uVar6;
  ulonglong uVar7;
  longlong *plVar8;
  longlong lVar9;
  longlong lVar10;
  longlong *plVar11;
  longlong local_b8;
  longlong local_a8;
  
  EnterCriticalSection(DAT_140608298);
  if (*(longlong *)(param_1 + 600) != 0) {
    uVar7 = 0;
    if (*(uint *)(param_1 + 0x260) != 0) {
      plVar3 = *(longlong **)(param_1 + 0x250);
      plVar8 = plVar3;
      do {
        if (*plVar8 != 0) {
          lVar10 = plVar3[uVar7];
          goto LAB_1402f30e3;
        }
        uVar6 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar6;
        plVar8 = plVar8 + 1;
      } while (uVar6 < *(uint *)(param_1 + 0x260));
    }
  }
  lVar10 = 0;
LAB_1402f30e3:
  local_b8 = lVar10;
  if (local_b8 != 0) {
    if (local_b8 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    lVar9 = *(longlong *)(local_b8 + 8);
    lVar10 = lVar9 + 0x58;
    FUN_14034ed40(lVar10);
    FUN_14034ed40(lVar10);
    lVar4 = *(longlong *)(lVar9 + 0x38);
    if (*(longlong *)(lVar9 + 0x30) != lVar4) {
      plVar8 = (longlong *)FUN_140333a10(lVar4,lVar4);
      plVar3 = *(longlong **)(lVar9 + 0x38);
      if (plVar8 != plVar3) {
        plVar11 = plVar8 + 1;
        do {
          plVar5 = (longlong *)*plVar11;
          if (plVar5 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar5 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              (**(code **)(*plVar5 + 8))(plVar5);
              LOCK();
              piVar2 = (int *)((longlong)plVar5 + 0xc);
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              if (*piVar2 == 0) {
                (**(code **)(*plVar5 + 0x10))(plVar5);
              }
            }
          }
          plVar5 = plVar11 + 1;
          plVar11 = plVar11 + 2;
        } while (plVar5 != plVar3);
      }
      *(longlong **)(lVar9 + 0x38) = plVar8;
    }
    FUN_14034edd0(lVar10);
    FUN_140343210(lVar9);
    FUN_14034edd0(lVar10);
    lVar10 = local_b8;
    if ((local_b8 != 0) && (lVar10 = *(longlong *)(local_b8 + 0x18), lVar10 == 0)) {
      uVar6 = *(uint *)(local_b8 + 0x20) % *(uint *)(param_1 + 0x260) + 1;
      lVar9 = (longlong)(int)uVar6 << 3;
      do {
        if (*(uint *)(param_1 + 0x260) <= uVar6) break;
        lVar4 = *(longlong *)(param_1 + 0x250);
        if (*(longlong *)(lVar9 + lVar4) != 0) {
          lVar10 = *(longlong *)(lVar9 + lVar4);
        }
        uVar6 = uVar6 + 1;
        lVar9 = lVar9 + 8;
      } while (lVar10 == 0);
    }
    goto LAB_1402f30e3;
  }
  if (*(longlong *)(param_1 + 0x2a0) != 0) {
    uVar7 = 0;
    if (*(uint *)(param_1 + 0x2a8) != 0) {
      plVar3 = *(longlong **)(param_1 + 0x298);
      plVar8 = plVar3;
      do {
        if (*plVar8 != 0) {
          lVar10 = plVar3[uVar7];
          goto LAB_1402f3277;
        }
        uVar6 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar6;
        plVar8 = plVar8 + 1;
      } while (uVar6 < *(uint *)(param_1 + 0x2a8));
    }
  }
  lVar10 = 0;
LAB_1402f3277:
  do {
    do {
      local_a8 = lVar10;
      if (local_a8 == 0) {
        LeaveCriticalSection(DAT_140608298);
        return;
      }
      if (local_a8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar9 = *(longlong *)(local_a8 + 8);
      lVar10 = lVar9 + 0x58;
      FUN_14034ed40(lVar10);
      FUN_14034ed40(lVar10);
      lVar4 = *(longlong *)(lVar9 + 0x38);
      if (*(longlong *)(lVar9 + 0x30) != lVar4) {
        plVar8 = (longlong *)FUN_140333a10(lVar4,lVar4);
        plVar3 = *(longlong **)(lVar9 + 0x38);
        if (plVar8 != plVar3) {
          plVar11 = plVar8 + 1;
          do {
            plVar5 = (longlong *)*plVar11;
            if (plVar5 != (longlong *)0x0) {
              LOCK();
              plVar1 = plVar5 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                (**(code **)(*plVar5 + 8))(plVar5);
                LOCK();
                piVar2 = (int *)((longlong)plVar5 + 0xc);
                *piVar2 = *piVar2 + -1;
                UNLOCK();
                if (*piVar2 == 0) {
                  (**(code **)(*plVar5 + 0x10))(plVar5);
                }
              }
            }
            plVar5 = plVar11 + 1;
            plVar11 = plVar11 + 2;
          } while (plVar5 != plVar3);
        }
        *(longlong **)(lVar9 + 0x38) = plVar8;
      }
      FUN_14034edd0(lVar10);
      FUN_140343210(lVar9);
      FUN_14034edd0(lVar10);
      lVar10 = local_a8;
    } while ((local_a8 == 0) || (lVar10 = *(longlong *)(local_a8 + 0x18), lVar10 != 0));
    uVar6 = *(uint *)(local_a8 + 0x20) % *(uint *)(param_1 + 0x2a8) + 1;
    lVar9 = (longlong)(int)uVar6 << 3;
    do {
      if (*(uint *)(param_1 + 0x2a8) <= uVar6) break;
      lVar4 = *(longlong *)(param_1 + 0x298);
      if (*(longlong *)(lVar9 + lVar4) != 0) {
        lVar10 = *(longlong *)(lVar9 + lVar4);
      }
      uVar6 = uVar6 + 1;
      lVar9 = lVar9 + 8;
    } while (lVar10 == 0);
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x0001402f3727)
// WARNING: Removing unreachable block (ram,0x0001402f34fc)

void FUN_1402f33f0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 uVar5;
  longlong *plVar6;
  uint uVar7;
  ulonglong uVar8;
  longlong lVar9;
  longlong *plVar10;
  longlong lVar11;
  longlong *plVar12;
  longlong local_68;
  
  EnterCriticalSection(DAT_140608298);
  if (*(longlong *)(param_1 + 0x138) != 0) {
    uVar8 = 0;
    if (*(uint *)(param_1 + 0x140) != 0) {
      plVar3 = *(longlong **)(param_1 + 0x130);
      plVar10 = plVar3;
      do {
        if (*plVar10 != 0) {
          lVar11 = plVar3[uVar8];
          goto LAB_1402f3483;
        }
        uVar7 = (int)uVar8 + 1;
        uVar8 = (ulonglong)uVar7;
        plVar10 = plVar10 + 1;
      } while (uVar7 < *(uint *)(param_1 + 0x140));
    }
  }
  lVar11 = 0;
LAB_1402f3483:
  lVar9 = lVar11;
  if (lVar9 != 0) {
    lVar11 = *(longlong *)(lVar9 + 8);
    FUN_140167bf0(lVar11 + 0x68);
    FUN_14032e750(lVar11);
    lVar11 = *(longlong *)(lVar9 + 0x18);
    if (lVar11 == 0) {
      uVar7 = *(uint *)(lVar9 + 0x20) % *(uint *)(param_1 + 0x140) + 1;
      lVar9 = (longlong)(int)uVar7 << 3;
      do {
        if (*(uint *)(param_1 + 0x140) <= uVar7) break;
        lVar4 = *(longlong *)(param_1 + 0x130);
        if (*(longlong *)(lVar9 + lVar4) != 0) {
          lVar11 = *(longlong *)(lVar9 + lVar4);
        }
        uVar7 = uVar7 + 1;
        lVar9 = lVar9 + 8;
      } while (lVar11 == 0);
    }
    goto LAB_1402f3483;
  }
  if (*(longlong *)(param_1 + 0x1c8) != 0) {
    uVar8 = 0;
    if (*(uint *)(param_1 + 0x1d0) != 0) {
      plVar3 = *(longlong **)(param_1 + 0x1c0);
      plVar10 = plVar3;
      do {
        if (*plVar10 != 0) {
          lVar11 = plVar3[uVar8];
          goto LAB_1402f3560;
        }
        uVar7 = (int)uVar8 + 1;
        uVar8 = (ulonglong)uVar7;
        plVar10 = plVar10 + 1;
      } while (uVar7 < *(uint *)(param_1 + 0x1d0));
    }
  }
  lVar11 = 0;
LAB_1402f3560:
  lVar9 = lVar11;
  if (lVar9 != 0) {
    if (lVar9 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    uVar5 = *(undefined8 *)(lVar9 + 8);
    FUN_14034ed40(uVar5);
    FUN_14032b9a0(uVar5);
    FUN_14034edd0(uVar5);
    lVar11 = lVar9;
    if ((lVar9 != 0) && (lVar11 = *(longlong *)(lVar9 + 0x18), lVar11 == 0)) {
      uVar7 = *(uint *)(lVar9 + 0x20) % *(uint *)(param_1 + 0x1d0) + 1;
      lVar9 = (longlong)(int)uVar7 << 3;
      do {
        if (*(uint *)(param_1 + 0x1d0) <= uVar7) break;
        lVar4 = *(longlong *)(param_1 + 0x1c0);
        if (*(longlong *)(lVar9 + lVar4) != 0) {
          lVar11 = *(longlong *)(lVar9 + lVar4);
        }
        uVar7 = uVar7 + 1;
        lVar9 = lVar9 + 8;
      } while (lVar11 == 0);
    }
    goto LAB_1402f3560;
  }
  if (*(longlong *)(param_1 + 0x210) != 0) {
    uVar8 = 0;
    if (*(uint *)(param_1 + 0x218) != 0) {
      plVar3 = *(longlong **)(param_1 + 0x208);
      plVar10 = plVar3;
      do {
        if (*plVar10 != 0) {
          lVar11 = plVar3[uVar8];
          goto LAB_1402f3653;
        }
        uVar7 = (int)uVar8 + 1;
        uVar8 = (ulonglong)uVar7;
        plVar10 = plVar10 + 1;
      } while (uVar7 < *(uint *)(param_1 + 0x218));
    }
  }
  lVar11 = 0;
LAB_1402f3653:
  do {
    do {
      local_68 = lVar11;
      if (local_68 == 0) {
        LeaveCriticalSection(DAT_140608298);
        return;
      }
      lVar11 = *(longlong *)(local_68 + 8);
      lVar9 = *(longlong *)(lVar11 + 0x38);
      if (*(longlong *)(lVar11 + 0x30) != lVar9) {
        plVar10 = (longlong *)FUN_140333a10(lVar9,lVar9);
        plVar3 = *(longlong **)(lVar11 + 0x38);
        if (plVar10 != plVar3) {
          plVar12 = plVar10 + 1;
          do {
            plVar6 = (longlong *)*plVar12;
            if (plVar6 != (longlong *)0x0) {
              LOCK();
              plVar1 = plVar6 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              if ((int)*plVar1 == 0) {
                (**(code **)(*plVar6 + 8))(plVar6);
                LOCK();
                piVar2 = (int *)((longlong)plVar6 + 0xc);
                *piVar2 = *piVar2 + -1;
                UNLOCK();
                if (*piVar2 == 0) {
                  (**(code **)(*plVar6 + 0x10))(plVar6);
                }
              }
            }
            plVar6 = plVar12 + 1;
            plVar12 = plVar12 + 2;
          } while (plVar6 != plVar3);
        }
        *(longlong **)(lVar11 + 0x38) = plVar10;
      }
      FUN_14032eb70(lVar11);
      lVar11 = *(longlong *)(local_68 + 0x18);
    } while (lVar11 != 0);
    uVar7 = *(uint *)(local_68 + 0x20) % *(uint *)(param_1 + 0x218) + 1;
    lVar9 = (longlong)(int)uVar7 << 3;
    do {
      if (*(uint *)(param_1 + 0x218) <= uVar7) break;
      lVar4 = *(longlong *)(param_1 + 0x208);
      if (*(longlong *)(lVar9 + lVar4) != 0) {
        lVar11 = *(longlong *)(lVar9 + lVar4);
      }
      uVar7 = uVar7 + 1;
      lVar9 = lVar9 + 8;
    } while (lVar11 == 0);
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x0001402f386e)

void FUN_1402f3770(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong lVar7;
  
  EnterCriticalSection(DAT_140608298);
  if (*(longlong *)(param_1 + 0x2e8) != 0) {
    uVar4 = 0;
    if (*(uint *)(param_1 + 0x2f0) != 0) {
      plVar1 = *(longlong **)(param_1 + 0x2e0);
      plVar6 = plVar1;
      do {
        if (*plVar6 != 0) {
          lVar7 = plVar1[uVar4];
          goto LAB_1402f3800;
        }
        uVar3 = (int)uVar4 + 1;
        uVar4 = (ulonglong)uVar3;
        plVar6 = plVar6 + 1;
      } while (uVar3 < *(uint *)(param_1 + 0x2f0));
    }
  }
  lVar7 = 0;
LAB_1402f3800:
  do {
    do {
      lVar5 = lVar7;
      if (lVar5 == 0) {
                    // WARNING: Could not recover jumptable at 0x0001402f3894. Too many branches
                    // WARNING: Treating indirect jump as call
        LeaveCriticalSection(DAT_140608298);
        return;
      }
      lVar7 = *(longlong *)(lVar5 + 8);
      FUN_1402f3920(lVar7 + 0x30);
      FUN_1403438a0(lVar7);
      lVar7 = *(longlong *)(lVar5 + 0x18);
    } while (lVar7 != 0);
    uVar3 = *(uint *)(lVar5 + 0x20) % *(uint *)(param_1 + 0x2f0) + 1;
    lVar5 = (longlong)(int)uVar3 << 3;
    do {
      if (*(uint *)(param_1 + 0x2f0) <= uVar3) break;
      lVar2 = *(longlong *)(param_1 + 0x2e0);
      if (*(longlong *)(lVar2 + lVar5) != 0) {
        lVar7 = *(longlong *)(lVar2 + lVar5);
      }
      uVar3 = uVar3 + 1;
      lVar5 = lVar5 + 8;
    } while (lVar7 == 0);
  } while( true );
}



undefined8 FUN_1402f38a0(undefined8 param_1,undefined4 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined1 local_18 [8];
  longlong *local_10;
  
  puVar4 = (undefined8 *)FUN_1402ef030(param_1,local_18,param_2);
  uVar3 = *puVar4;
  if (local_10 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_10 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_10 + 8))(local_10);
      LOCK();
      piVar2 = (int *)((longlong)local_10 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_10 + 0x10))(local_10);
      }
    }
    return uVar3;
  }
  return uVar3;
}



void FUN_1402f3910(void)

{
                    // WARNING: Could not recover jumptable at 0x0001402f3917. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140608298);
  return;
}



void FUN_1402f3920(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 + 0x18);
        FUN_1402c6e80(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402f39f0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1402c6e80(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x18);
  FUN_1402c6e80(param_1,param_2);
  return;
}



void FUN_1402f3a70(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_1402f3b20(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



undefined8 * FUN_1402f3af0(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  longlong lVar1;
  
  *param_1 = *param_2;
  param_1[1] = *param_3;
  lVar1 = param_3[1];
  param_1[2] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_1;
}



undefined8 * FUN_1402f3b20(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;
}



undefined8 * FUN_1402f3b90(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;
}



undefined8 * FUN_1402f3c00(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;
}



undefined8 * FUN_1402f3c70(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;
}



undefined8 * FUN_1402f3ce0(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;
}



undefined8 * FUN_1402f3d50(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;
}



undefined8 * FUN_1402f3dc0(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;
}



undefined8 * FUN_1402f3e30(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;
}



undefined8 * FUN_1402f3ea0(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;
}



undefined8 * FUN_1402f3f10(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;
}



undefined8 * FUN_1402f3f80(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;
}



undefined8 * FUN_1402f3ff0(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;
}



undefined8 * FUN_1402f4060(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;
}



void FUN_1402f40d0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_1403218b0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402f4100(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (*(longlong *)((longlong)pvVar1 + 0x68) != 0) {
      FUN_140167cd0((longlong)pvVar1 + 0x68);
    }
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x58)) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x40));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x58) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x50) = 0;
    *(undefined2 *)((longlong)pvVar1 + 0x40) = 0;
    FUN_14034edf0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402f4160(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14032b8b0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402f4190(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_140343110(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402f41c0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x60)) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x48));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x60) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x58) = 0;
    *(undefined2 *)((longlong)pvVar1 + 0x48) = 0;
    FUN_1402fccc0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402f4210(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x60)) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x48));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x60) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x58) = 0;
    *(undefined2 *)((longlong)pvVar1 + 0x48) = 0;
    FUN_1402f4460(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402f4260(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)(param_1 + 0x10);
  if (plVar1 != (longlong *)0x0) {
    if (7 < (ulonglong)plVar1[0xb]) {
      operator_delete((void *)plVar1[8]);
    }
    plVar1[0xb] = 7;
    plVar1[10] = 0;
    *(undefined2 *)(plVar1 + 8) = 0;
    if (*plVar1 != 0) {
      FUN_1402f4570(plVar1);
    }
    operator_delete(plVar1);
  }
  return;
}



void FUN_1402f42b0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_140320990(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402f42e0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_140343fc0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1402f4310(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (*(longlong *)((longlong)param_1 + 0x68) != 0) {
      FUN_140167cd0();
    }
    if (7 < *(ulonglong *)((longlong)param_1 + 0x58)) {
      operator_delete(*(void **)((longlong)param_1 + 0x40));
    }
    *(undefined8 *)((longlong)param_1 + 0x58) = 7;
    *(undefined8 *)((longlong)param_1 + 0x50) = 0;
    *(undefined2 *)((longlong)param_1 + 0x40) = 0;
    FUN_14034edf0(param_1);
    operator_delete(param_1);
  }
  return;
}



void FUN_1402f43c0(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)param_1 + 0x60)) {
      operator_delete(*(void **)((longlong)param_1 + 0x48));
    }
    *(undefined8 *)((longlong)param_1 + 0x60) = 7;
    *(undefined8 *)((longlong)param_1 + 0x58) = 0;
    *(undefined2 *)((longlong)param_1 + 0x48) = 0;
    FUN_1402f4460(param_1);
    operator_delete(param_1);
  }
  return;
}



void FUN_1402f4410(longlong *param_1)

{
  if (param_1 != (longlong *)0x0) {
    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 (*param_1 != 0) {
      FUN_1402f4570(param_1);
    }
    operator_delete(param_1);
  }
  return;
}



void FUN_1402f4460(void)

{
  FUN_1402f44a0();
  return;
}



void FUN_1402f4480(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_1402f4570();
  }
  return;
}



void FUN_1402f44a0(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 + 0x98);
        FUN_1402f4640(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402f4570(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[10]) {
        operator_delete((void *)puVar2[7]);
      }
      puVar2[10] = 7;
      puVar2[9] = 0;
      *(undefined2 *)(puVar2 + 7) = 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;
}



void FUN_1402f4640(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1402f4740(param_2 + 8);
  *(undefined8 *)(param_2 + 0x98) = *(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_1402cddb0(param_1);
    FUN_1402f47d0(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_1402f46e0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x50)) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x50) = 7;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined2 *)(param_1 + 0x38) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_1402f4740(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x80)) {
    operator_delete(*(void **)(param_1 + 0x68));
  }
  *(undefined8 *)(param_1 + 0x80) = 7;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined2 *)(param_1 + 0x68) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x58)) {
    operator_delete(*(void **)(param_1 + 0x40));
  }
  *(undefined8 *)(param_1 + 0x58) = 7;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined2 *)(param_1 + 0x40) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



void FUN_1402f47d0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x98);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0xa0) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x98) = *(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;
}



// WARNING: Removing unreachable block (ram,0x0001402f4c74)
// WARNING: Removing unreachable block (ram,0x0001402f4c7d)
// WARNING: Removing unreachable block (ram,0x0001402f4c9e)
// WARNING: Removing unreachable block (ram,0x0001402f4ca7)

undefined8 * FUN_1402f4980(undefined8 *param_1,short *param_2,undefined4 param_3,undefined8 param_4)

{
  short sVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  ulonglong uVar6;
  undefined8 *puVar7;
  uint uVar8;
  short *psVar9;
  
  puVar7 = (undefined8 *)0x0;
  param_1[1] = 0;
  param_1[2] = 0;
  *(undefined8 *)((longlong)param_1 + 0x24) = 0;
  *(undefined4 *)((longlong)param_1 + 0x2c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x34) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0x3c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x44) = 0;
  *(undefined4 *)((longlong)param_1 + 0x4c) = 0;
  *(undefined1 *)(param_1 + 10) = 0;
  param_1[0x14] = 0;
  param_1[0x15] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  param_1[0x19] = 0;
  *param_1 = mcoCharacter::vftable;
  param_1[0x1d] = 7;
  param_1[0x1c] = 0;
  *(undefined2 *)(param_1 + 0x1a) = 0;
  uVar6 = 0xffffffffffffffff;
  psVar9 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar9;
    psVar9 = psVar9 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x1a,param_2,~uVar6 - 1,param_4,0xfffffffffffffffe);
  param_1[0x22] = 7;
  param_1[0x21] = 0;
  *(undefined2 *)(param_1 + 0x1f) = 0;
  FUN_140001710(param_1 + 0x1f,&DAT_140477960,0);
  *(undefined4 *)(param_1 + 0x24) = param_3;
  *(undefined8 *)((longlong)param_1 + 0x124) = 0;
  *(undefined4 *)((longlong)param_1 + 300) = 0;
  param_1[0x26] = 0;
  param_1[0x27] = 0;
  param_1[0x28] = 0;
  param_1[0x29] = 0;
  *(undefined1 *)(param_1 + 0x2a) = 1;
  *(undefined8 *)((longlong)param_1 + 0x154) = 0;
  *(undefined8 *)((longlong)param_1 + 0x15c) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x164) = 0;
  param_1[0x2d] = 0x3f800000;
  param_1[0x2e] = 0;
  param_1[0x2f] = 0;
  param_1[0x30] = 0;
  param_1[0x31] = 0;
  param_1[0x32] = 0;
  *(undefined4 *)(param_1 + 0x33) = 0;
  param_1[0xa2] = 0;
  param_1[0xa3] = 0;
  param_1[0xa4] = 0xffffffffffffffff;
  param_1[0xa5] = 0;
  param_1[0xa6] = 0xffffffffffffffff;
  *(undefined4 *)(param_1 + 0xa7) = 0xffffffff;
  *(undefined8 *)((longlong)param_1 + 0x53c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x544) = 0;
  *(undefined8 *)((longlong)param_1 + 0x54c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x554) = 0;
  *(undefined8 *)((longlong)param_1 + 0x55c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x564) = 0;
  *(undefined8 *)((longlong)param_1 + 0x56c) = 0;
  *(undefined4 *)((longlong)param_1 + 0x574) = 0;
  param_1[0xaf] = 0;
  param_1[0xb0] = 0;
  param_1[0xb1] = 0;
  param_1[0xb3] = 0;
  param_1[0xb4] = 0;
  *(undefined4 *)(param_1 + 0xb5) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5ac) = 1000;
  *(undefined8 *)((longlong)param_1 + 0x5b4) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5bc) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5c4) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5cc) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5d4) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5dc) = 0;
  *(undefined4 *)((longlong)param_1 + 0x5e4) = 0;
  *(undefined4 *)(param_1 + 0xbd) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0x5ec) = 0x3f800000;
  param_1[0xbe] = 0x3f800000;
  param_1[0xbf] = 0;
  param_1[0xc0] = 0x10000;
  *(undefined4 *)(param_1 + 0xc1) = 0;
  *(undefined2 *)((longlong)param_1 + 0x60c) = 0;
  param_1[0xc2] = 0;
  *(undefined1 *)(param_1 + 0x111) = 0;
  *(undefined1 *)(param_1 + 0x115) = 0;
  param_1[0x139] = 0;
  param_1[0x13a] = 0;
  *(undefined4 *)(param_1 + 0x13b) = 0x11;
  *(undefined4 *)(param_1 + 0x13f) = 0;
  *(undefined4 *)((longlong)param_1 + 0x9fc) = 10;
  param_1[0x140] = 0;
  param_1[0x141] = 0;
  *(undefined4 *)((longlong)param_1 + 0x9dc) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x13c) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x9e4) = 0x40100000;
  param_1[0x13d] = 0x26;
  param_1[0x13e] = 4;
  param_1[0x13e] = 0;
  param_1[0x142] = 0;
  param_1[0x143] = 0;
  *(undefined4 *)(param_1 + 0x144) = 0x11;
  *(undefined4 *)(param_1 + 0x148) = 0;
  *(undefined4 *)((longlong)param_1 + 0xa44) = 10;
  param_1[0x149] = 0;
  param_1[0x14a] = 0;
  *(undefined4 *)((longlong)param_1 + 0xa24) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x145) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xa2c) = 0x40100000;
  param_1[0x146] = 0x26;
  param_1[0x147] = 0;
  param_1[0x14b] = 0;
  param_1[0x14c] = 0;
  *(undefined4 *)(param_1 + 0x14d) = 0x11;
  *(undefined4 *)(param_1 + 0x151) = 0;
  *(undefined4 *)((longlong)param_1 + 0xa8c) = 10;
  param_1[0x152] = 0;
  param_1[0x153] = 0;
  *(undefined4 *)((longlong)param_1 + 0xa6c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x14e) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xa74) = 0x40100000;
  param_1[0x14f] = 0x26;
  param_1[0x150] = 0;
  param_1[0x154] = 0;
  param_1[0x155] = 0;
  *(undefined4 *)(param_1 + 0x156) = 0x11;
  *(undefined4 *)(param_1 + 0x15a) = 0;
  *(undefined4 *)((longlong)param_1 + 0xad4) = 10;
  param_1[0x15b] = 0;
  param_1[0x15c] = 0;
  *(undefined4 *)((longlong)param_1 + 0xab4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x157) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xabc) = 0x40100000;
  param_1[0x158] = 0x26;
  param_1[0x159] = 0;
  param_1[0x15d] = 0;
  param_1[0x15e] = 0;
  *(undefined4 *)(param_1 + 0x15f) = 0x11;
  *(undefined4 *)(param_1 + 0x163) = 0;
  *(undefined4 *)((longlong)param_1 + 0xb1c) = 10;
  param_1[0x164] = 0;
  param_1[0x165] = 0;
  *(undefined4 *)((longlong)param_1 + 0xafc) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x160) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xb04) = 0x40100000;
  param_1[0x161] = 0x26;
  param_1[0x162] = 0;
  param_1[0x166] = 0;
  param_1[0x167] = 0;
  param_1[0x168] = 0;
  param_1[0x169] = 0;
  param_1[0x16a] = 0;
  param_1[0x16b] = 0;
  param_1[0x16c] = 0;
  param_1[0x16d] = 0;
  param_1[0x16e] = 0;
  param_1[0x171] = 0;
  param_1[0x172] = 0;
  param_1[0x173] = 0;
  param_1[0x174] = 0;
  param_1[0x175] = 0;
  param_1[0x176] = 0;
  param_1[0x177] = 0;
  param_1[0x178] = 0;
  param_1[0x179] = 0;
  param_1[0x17a] = 0;
  param_1[0x17b] = 0;
  param_1[0x17c] = 0;
  param_1[0x17d] = 0;
  param_1[0x17e] = 0;
  param_1[0x17f] = 0;
  param_1[0x180] = 0;
  param_1[0x181] = 0;
  param_1[0x182] = 0;
  param_1[0x183] = 0;
  param_1[0x184] = 0;
  param_1[0x185] = 0;
  param_1[0x186] = 0;
  param_1[0x187] = 0;
  param_1[0x188] = 0;
  param_1[0x189] = 0;
  param_1[0x18a] = 0;
  *(undefined4 *)(param_1 + 0x18b) = 1;
  *(undefined4 *)((longlong)param_1 + 0xc5c) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x18c) = 0x3f800000;
  *(undefined1 *)((longlong)param_1 + 0xc64) = 0;
  param_1[0x18d] = 0;
  *(undefined4 *)(param_1 + 0x18e) = 0;
  param_1[0x192] = 7;
  param_1[0x191] = 0;
  *(undefined2 *)(param_1 + 399) = 0;
  param_1[0x194] = 0;
  *(undefined4 *)(param_1 + 0x195) = 0;
  param_1[0x196] = 0;
  param_1[0x197] = 0;
  param_1[0x198] = 0;
  *(undefined2 *)(param_1 + 0x19a) = 0;
  *(undefined8 *)((longlong)param_1 + 0xcd4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xcdc) = 0;
  param_1[0x19d] = 0;
  param_1[0x19e] = 0;
  *(undefined4 *)(param_1 + 0x19f) = 0x11;
  *(undefined4 *)(param_1 + 0x1a3) = 0;
  *(undefined4 *)((longlong)param_1 + 0xd1c) = 10;
  param_1[0x1a4] = 0;
  param_1[0x1a5] = 0;
  *(undefined4 *)((longlong)param_1 + 0xcfc) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x1a0) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xd04) = 0x40100000;
  param_1[0x1a1] = 0x26;
  param_1[0x1a2] = 0;
  param_1[0x1a6] = 0;
  param_1[0x1a7] = 0;
  *(undefined4 *)(param_1 + 0x1a8) = 0x11;
  *(undefined4 *)(param_1 + 0x1ac) = 0;
  *(undefined4 *)((longlong)param_1 + 0xd64) = 10;
  param_1[0x1ad] = 0;
  param_1[0x1ae] = 0;
  *(undefined4 *)((longlong)param_1 + 0xd44) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x1a9) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xd4c) = 0x40100000;
  param_1[0x1aa] = 0x26;
  param_1[0x1ab] = 0;
  param_1[0x1af] = 0;
  *(undefined4 *)(param_1 + 0x1b0) = 0x3f800000;
  param_1[0x1b1] = 0;
  param_1[0x1b2] = 0;
  param_1[0x1b3] = 0;
  param_1[0x1b4] = 0;
  *(undefined4 *)(param_1 + 0x1b5) = 0;
  param_1[0x1ba] = 0;
  *(undefined4 *)(param_1 + 0x1bb) = 0;
  *(undefined8 *)((longlong)param_1 + 0xddc) = 0;
  *(undefined4 *)((longlong)param_1 + 0xde4) = 0;
  param_1[0x1bd] = 0;
  *(undefined4 *)(param_1 + 0x1be) = 0;
  *(undefined8 *)((longlong)param_1 + 0xdf4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xdfc) = 0;
  *(undefined8 *)((longlong)param_1 + 0xdac) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xdb4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xdbc) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xdc4) = 0;
  *(undefined4 *)((longlong)param_1 + 0xdcc) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xe04) = 0;
  *(undefined4 *)((longlong)param_1 + 0xe0c) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe34) = 0;
  *(undefined4 *)((longlong)param_1 + 0xe3c) = 0;
  param_1[0x1c8] = 0;
  *(undefined4 *)(param_1 + 0x1c9) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe4c) = 0;
  *(undefined4 *)((longlong)param_1 + 0xe54) = 0;
  param_1[0x1cb] = 0;
  param_1[0x1cc] = 0;
  param_1[0x1c2] = 0x3f800000;
  param_1[0x1c3] = 0;
  param_1[0x1c4] = 0x3f800000;
  param_1[0x1c5] = 0;
  *(undefined4 *)(param_1 + 0x1c6) = 0x3f800000;
  param_1[0x1cd] = 0;
  *(undefined4 *)(param_1 + 0x1ce) = 0;
  param_1[0x1d3] = 0;
  *(undefined4 *)(param_1 + 0x1d4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xea4) = 0;
  *(undefined4 *)((longlong)param_1 + 0xeac) = 0;
  param_1[0x1d6] = 0;
  *(undefined4 *)(param_1 + 0x1d7) = 0;
  *(undefined8 *)((longlong)param_1 + 0xebc) = 0;
  *(undefined8 *)((longlong)param_1 + 0xec4) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe74) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xe7c) = 0;
  *(undefined8 *)((longlong)param_1 + 0xe84) = 0x3f800000;
  *(undefined8 *)((longlong)param_1 + 0xe8c) = 0;
  *(undefined4 *)((longlong)param_1 + 0xe94) = 0x3f800000;
  *(undefined4 *)((longlong)param_1 + 0xecc) = 0x44bb8000;
  param_1[0x1da] = 0;
  param_1[0x1db] = 0;
  *(undefined2 *)((longlong)param_1 + 0xee4) = 0;
  *(undefined4 *)(param_1 + 0x1dd) = 0;
  *(undefined1 *)((longlong)param_1 + 0xeec) = 1;
  *(undefined4 *)(param_1 + 0x1de) = 1;
  *(undefined1 *)((longlong)param_1 + 0xef4) = 0;
  *(undefined4 *)((longlong)param_1 + 0xefc) = 1;
  param_1[0x1e0] = 0;
  param_1[0x1e1] = 0;
  param_1[0x1e2] = 0;
  param_1[0x1e4] = 0;
  param_1[0x1e5] = 0;
  param_1[0x1e6] = 0;
  *(undefined4 *)(param_1 + 0x1e8) = 0;
  param_1[0x1e9] = 0;
  param_1[0x1ea] = 0;
  param_1[0x1eb] = 0;
  param_1[0x1ed] = 0;
  param_1[0x1ee] = 0;
  param_1[0x1ef] = 0;
  param_1[0x1f1] = 0;
  param_1[0x1f2] = 0;
  param_1[499] = 0;
  *(undefined4 *)(param_1 + 0x1f5) = 0;
  *(undefined1 *)((longlong)param_1 + 0xfac) = 1;
  *(undefined4 *)(param_1 + 0x1f6) = 0;
  *(undefined4 *)((longlong)param_1 + 0xfb4) = 0;
  *(undefined4 *)(param_1 + 0x1f7) = 0;
  *(undefined4 *)((longlong)param_1 + 0xfbc) = 0;
  *(undefined4 *)(param_1 + 0x1f8) = 0;
  param_1[0x1f9] = 0;
  *(undefined4 *)(param_1 + 0x1fa) = 0;
  *(undefined1 *)((longlong)param_1 + 0xfd4) = 0;
  *(undefined4 *)(param_1 + 0x1fb) = 0;
  *(undefined1 *)(param_1 + 0x1fd) = 0;
  *(undefined4 *)((longlong)param_1 + 0xfec) = 0;
  param_1[0x1fe] = 0;
  param_1[0x1ff] = 0;
  *(undefined4 *)(param_1 + 0x200) = 0x11;
  *(undefined4 *)(param_1 + 0x204) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1024) = 10;
  param_1[0x205] = 0;
  param_1[0x206] = 0;
  *(undefined4 *)((longlong)param_1 + 0x1004) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x201) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x100c) = 0x40100000;
  param_1[0x202] = 0x26;
  param_1[0x203] = 0;
  param_1[0x207] = 0;
  param_1[0x208] = 0;
  *(undefined4 *)(param_1 + 0x209) = 0x11;
  *(undefined4 *)(param_1 + 0x20d) = 0;
  *(undefined4 *)((longlong)param_1 + 0x106c) = 10;
  param_1[0x20e] = 0;
  param_1[0x20f] = 0;
  *(undefined4 *)((longlong)param_1 + 0x104c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x20a) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1054) = 0x40100000;
  param_1[0x20b] = 0x26;
  param_1[0x20c] = 0;
  param_1[0x210] = 0;
  param_1[0x211] = 0;
  *(undefined4 *)(param_1 + 0x212) = 0x11;
  *(undefined4 *)(param_1 + 0x216) = 0;
  *(undefined4 *)((longlong)param_1 + 0x10b4) = 10;
  param_1[0x217] = 0;
  param_1[0x218] = 0;
  *(undefined4 *)((longlong)param_1 + 0x1094) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x213) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x109c) = 0x40100000;
  param_1[0x214] = 0x26;
  param_1[0x215] = 0;
  *(undefined1 *)(param_1 + 0x219) = 0;
  *(undefined8 *)((longlong)param_1 + 0x10cc) = 0xffffffffffffffff;
  *(undefined8 *)((longlong)param_1 + 0x10d4) = 0xffffffffffffffff;
  *(undefined8 *)((longlong)param_1 + 0x10dc) = 0xffffffffffffffff;
  param_1[0x21d] = 0;
  param_1[0x21e] = 0;
  param_1[0x21f] = 0;
  param_1[0x220] = 0;
  param_1[0x221] = 0;
  param_1[0x222] = 0;
  *(undefined4 *)(param_1 + 0x223) = 0x11;
  *(undefined4 *)(param_1 + 0x227) = 0;
  *(undefined4 *)((longlong)param_1 + 0x113c) = 10;
  param_1[0x228] = 0;
  param_1[0x229] = 0;
  *(undefined4 *)((longlong)param_1 + 0x111c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x224) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1124) = 0x40100000;
  param_1[0x225] = 0x26;
  param_1[0x226] = 0;
  param_1[0x22a] = 0;
  param_1[0x22b] = 0;
  *(undefined4 *)(param_1 + 0x22c) = 0x11;
  *(undefined4 *)(param_1 + 0x230) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1184) = 10;
  param_1[0x231] = 0;
  param_1[0x232] = 0;
  *(undefined4 *)((longlong)param_1 + 0x1164) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x22d) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x116c) = 0x40100000;
  param_1[0x22e] = 0x26;
  param_1[0x22f] = 0;
  param_1[0x233] = 0;
  param_1[0x234] = 0;
  *(undefined1 *)(param_1 + 0x235) = 0;
  param_1[0x236] = 0;
  param_1[0x237] = 0;
  param_1[0x238] = 0;
  param_1[0x239] = 0;
  param_1[0x23a] = 0;
  param_1[0x23c] = 0;
  param_1[0x23d] = 0;
  param_1[0x23e] = 0;
  param_1[0x240] = 0;
  param_1[0x241] = 0;
  param_1[0x242] = 0;
  param_1[0x244] = 0;
  param_1[0x245] = 0;
  *(undefined1 *)(param_1 + 0x246) = 0;
  *(undefined8 *)((longlong)param_1 + 0x1234) = 0;
  *(undefined4 *)((longlong)param_1 + 0x123c) = 0xbf800000;
  *(undefined4 *)(param_1 + 0x248) = 0xbf800000;
  *(undefined4 *)((longlong)param_1 + 0x1244) = 0xbf800000;
  *(undefined1 *)(param_1 + 0x249) = 0;
  *(undefined4 *)((longlong)param_1 + 0x124c) = 0;
  *(undefined1 *)(param_1 + 0x24a) = 0;
  param_1[0x24b] = 0;
  param_1[0x24c] = 0;
  *(undefined4 *)(param_1 + 0x24d) = 0x11;
  *(undefined4 *)(param_1 + 0x251) = 0;
  *(undefined4 *)((longlong)param_1 + 0x128c) = 10;
  param_1[0x252] = 0;
  param_1[0x253] = 0;
  *(undefined4 *)((longlong)param_1 + 0x126c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x24e) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1274) = 0x40100000;
  param_1[0x24f] = 0x26;
  param_1[0x250] = 0;
  param_1[0x254] = 0;
  param_1[0x255] = 0;
  *(undefined4 *)(param_1 + 0x256) = 0x11;
  *(undefined4 *)(param_1 + 0x25a) = 0;
  *(undefined4 *)((longlong)param_1 + 0x12d4) = 10;
  param_1[0x25b] = 0;
  param_1[0x25c] = 0;
  *(undefined4 *)((longlong)param_1 + 0x12b4) = 0x3f400000;
  *(undefined4 *)(param_1 + 599) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x12bc) = 0x40100000;
  param_1[600] = 0x26;
  param_1[0x259] = 0;
  param_1[0x25d] = 0;
  uVar2 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x25f,uVar2,1);
  memset(param_1 + 0x34,0,0x370);
  FUN_1402f6f40(param_1);
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCreate::vftable;
    puVar5 = puVar4;
  }
  param_1[0x34] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateRespawn::vftable;
    puVar5 = puVar4;
  }
  param_1[0x35] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateStay::vftable;
    puVar5 = puVar4;
  }
  param_1[0x36] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateMove::vftable;
    puVar5 = puVar4;
  }
  param_1[0x37] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateTargetMove::vftable;
    puVar5 = puVar4;
  }
  param_1[0x38] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateChargeMove::vftable;
    puVar5 = puVar4;
  }
  param_1[0x4c] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateChargeMoveAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x4d] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateChargeAutoMoveAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x4e] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateSideLeftMove::vftable;
    puVar5 = puVar4;
  }
  param_1[0x39] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateSideRightMove::vftable;
    puVar5 = puVar4;
  }
  param_1[0x3a] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateBackStep::vftable;
    puVar5 = puVar4;
  }
  param_1[0x3b] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateJump::vftable;
    puVar5 = puVar4;
  }
  param_1[0x3c] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateJump2::vftable;
    puVar5 = puVar4;
  }
  param_1[0x3d] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x3e] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateSnapAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x3f] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateBackSnapAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x40] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateAttackReady::vftable;
    puVar5 = puVar4;
  }
  param_1[0x41] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateStandUpAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x42] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateMidairDownAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x43] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateMidairAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x44] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateMidairNormalAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x45] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateRisingAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x46] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateJumpAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x48] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateJumpDownAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x49] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateJumping::vftable;
    puVar5 = puVar4;
  }
  param_1[0x47] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateRollingJumpDownAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x4a] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateChargeAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x4b] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateFall::vftable;
    puVar5 = puVar4;
  }
  param_1[0x4f] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateDamageFall::vftable;
    puVar5 = puVar4;
  }
  param_1[0x50] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateDamage::vftable;
    puVar5 = puVar4;
  }
  param_1[0x51] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateDownBegin::vftable;
    puVar5 = puVar4;
  }
  param_1[0x53] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateDown::vftable;
    puVar5 = puVar4;
  }
  param_1[0x54] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateDownUP::vftable;
    puVar5 = puVar4;
  }
  param_1[0x55] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateDownDamage::vftable;
    puVar5 = puVar4;
  }
  param_1[0x56] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateSkyDamage::vftable;
    puVar5 = puVar4;
  }
  param_1[0x57] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateRisingDamage::vftable;
    puVar5 = puVar4;
  }
  param_1[0x58] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateDeath::vftable;
    puVar5 = puVar4;
  }
  param_1[0x59] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateTriggerAction::vftable;
    puVar5 = puVar4;
  }
  param_1[0x5c] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStatePickUp::vftable;
    puVar5 = puVar4;
  }
  param_1[0x5d] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateBeHeldUp::vftable;
    puVar5 = puVar4;
  }
  param_1[0x5e] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateThrown::vftable;
    puVar5 = puVar4;
  }
  param_1[0x5f] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateGesture::vftable;
    puVar5 = puVar4;
  }
  param_1[0x60] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateIdle::vftable;
    puVar5 = puVar4;
  }
  param_1[0x61] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateEventAction::vftable;
    puVar5 = puVar4;
  }
  param_1[0x62] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateGuard::vftable;
    puVar5 = puVar4;
  }
  param_1[99] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateGuardStay::vftable;
    puVar5 = puVar4;
  }
  param_1[100] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateGuardStayJust::vftable;
    puVar5 = puVar4;
  }
  param_1[0x65] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateGuardBreak::vftable;
    puVar5 = puVar4;
  }
  param_1[0x66] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateHoldUp::vftable;
    puVar5 = puVar4;
  }
  param_1[0x67] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateLevelUp::vftable;
    puVar5 = puVar4;
  }
  param_1[0x68] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCatchReady::vftable;
    puVar5 = puVar4;
  }
  param_1[0x69] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCatchStay::vftable;
    puVar5 = puVar4;
  }
  param_1[0x6a] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCatchFail::vftable;
    puVar5 = puVar4;
  }
  param_1[0x6b] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCatchFail::vftable;
    puVar5 = puVar4;
  }
  param_1[0x6c] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCatchUp::vftable;
    puVar5 = puVar4;
  }
  param_1[0x6d] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCatchMove::vftable;
    puVar5 = puVar4;
  }
  param_1[0x6e] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCatchAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x6f] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCaught::vftable;
    puVar5 = puVar4;
  }
  param_1[0x70] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCaughtGuard::vftable;
    puVar5 = puVar4;
  }
  param_1[0x71] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateCaughtDamage::vftable;
    puVar5 = puVar4;
  }
  param_1[0x72] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateSummon::vftable;
    puVar5 = puVar4;
  }
  param_1[0x76] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateHealing::vftable;
    puVar5 = puVar4;
  }
  param_1[0x77] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateBuff::vftable;
    puVar5 = puVar4;
  }
  param_1[0x78] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateShoot::vftable;
    puVar5 = puVar4;
  }
  param_1[0x92] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateShoot_Ex::vftable;
    puVar5 = puVar4;
  }
  param_1[0x93] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateShield::vftable;
    puVar5 = puVar4;
  }
  param_1[0x79] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateWarp::vftable;
    puVar5 = puVar4;
  }
  param_1[0x7a] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateWarpUp::vftable;
    puVar5 = puVar4;
  }
  param_1[0x7b] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateTrapFall::vftable;
    puVar5 = puVar4;
  }
  param_1[0x7c] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateTurn::vftable;
    puVar5 = puVar4;
  }
  param_1[0x7d] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateRush::vftable;
    puVar5 = puVar4;
  }
  param_1[0x7f] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateRushReady::vftable;
    puVar5 = puVar4;
  }
  param_1[0x7e] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateRushEnd::vftable;
    puVar5 = puVar4;
  }
  param_1[0x80] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateEvasion::vftable;
    puVar5 = puVar4;
  }
  param_1[0x81] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateSelfDestruct::vftable;
    puVar5 = puVar4;
  }
  param_1[0x82] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateRisingDamageFail::vftable;
    puVar5 = puVar4;
  }
  param_1[0x83] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateMenace::vftable;
    puVar5 = puVar4;
  }
  param_1[0x84] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateNullMotion::vftable;
    puVar5 = puVar4;
  }
  param_1[0x52] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateWeakDown::vftable;
    puVar5 = puVar4;
  }
  param_1[0x94] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateWeakDownUp::vftable;
    puVar5 = puVar4;
  }
  param_1[0x95] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateDisAppear::vftable;
    puVar5 = puVar4;
  }
  param_1[0x96] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateBounceDamage::vftable;
    puVar5 = puVar4;
  }
  param_1[0x97] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStatePetPickUpItem::vftable;
    puVar5 = puVar4;
  }
  param_1[0x85] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStatePetFollowOwner::vftable;
    puVar5 = puVar4;
  }
  param_1[0x86] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStatePetJumpFollowOwner::vftable;
    puVar5 = puVar4;
  }
  param_1[0x87] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStatePetJumpPickUpItem::vftable;
    puVar5 = puVar4;
  }
  param_1[0x88] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateActiveSkillOneself::vftable;
    puVar5 = puVar4;
  }
  param_1[0x73] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateEmpty::vftable;
    puVar5 = puVar4;
  }
  param_1[0x74] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateFreezing::vftable;
    puVar5 = puVar4;
  }
  param_1[0x8b] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateStun::vftable;
    puVar5 = puVar4;
  }
  param_1[0x89] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateSleep::vftable;
    puVar5 = puVar4;
  }
  param_1[0x8a] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateStone::vftable;
    puVar5 = puVar4;
  }
  param_1[0x8d] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateHold::vftable;
    puVar5 = puVar4;
  }
  param_1[0x8c] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStatePolymorph::vftable;
    puVar5 = puVar4;
  }
  param_1[0x98] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStatePolymorphEnd::vftable;
    puVar5 = puVar4;
  }
  param_1[0x99] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateEmotion::vftable;
    puVar5 = puVar4;
  }
  param_1[0x9a] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateMovingAttack::vftable;
    puVar5 = puVar4;
  }
  param_1[0x9c] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateFishingStart::vftable;
    puVar5 = puVar4;
  }
  param_1[0x9d] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateFishingStay::vftable;
    puVar5 = puVar4;
  }
  param_1[0x9e] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateFishingGet::vftable;
    puVar5 = puVar4;
  }
  param_1[0x9f] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateFishingEnd::vftable;
    puVar5 = puVar4;
  }
  param_1[0xa0] = puVar5;
  puVar4 = operator_new(0x10);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    puVar4[1] = param_1;
    *puVar4 = mcoStateFishingAgain::vftable;
    puVar5 = puVar4;
  }
  param_1[0xa1] = puVar5;
  puVar4 = operator_new(0x70);
  puVar5 = puVar7;
  if (puVar4 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar4 + 1) = 0x3dcccccd;
    puVar4[2] = 0;
    puVar4[3] = 0;
    puVar4[4] = 0;
    puVar4[5] = 0;
    puVar4[6] = 0x3f800000;
    puVar4[7] = 0;
    puVar4[8] = 0;
    *(undefined8 *)((longlong)puVar4 + 0x5c) = 0;
    puVar4[0xd] = 0;
    *puVar4 = param_1;
    puVar5 = puVar4;
  }
  FUN_1402fc900(param_1 + 0x1da,puVar5);
  puVar5 = param_1 + 0x16f;
  iVar3 = DAT_140608140;
  do {
    puVar4 = puVar5;
    if (1 < (uint)puVar7) {
      if (iVar3 == 0) {
        FUN_140176d60(0);
        iVar3 = DAT_140608140;
      }
      iVar3 = iVar3 + 1;
      puVar4 = &DAT_140608148;
      DAT_140608140 = iVar3;
    }
    *puVar4 = 0;
    uVar8 = (uint)puVar7 + 1;
    puVar7 = (undefined8 *)(ulonglong)uVar8;
    puVar5 = puVar5 + 1;
  } while ((int)uVar8 < 2);
  return param_1;
}



void * FUN_1402f68d0(void *param_1,uint param_2)

{
  FUN_1402f6970();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void thunk_FUN_1402fca50(void)

{
  FUN_1402fca50();
  return;
}



void thunk_FUN_1402fca70(void)

{
  FUN_1402fca70();
  return;
}



void thunk_FUN_1402fca90(void)

{
  FUN_1402fca90();
  return;
}



void thunk_FUN_1402fcab0(void)

{
  FUN_1402fcab0();
  return;
}



void thunk_FUN_1402fccc0(void)

{
  FUN_1402fccc0();
  return;
}



void thunk_FUN_1402fce40(void)

{
  FUN_1402fce40();
  return;
}



void thunk_FUN_1402fce60(void)

{
  FUN_1402fce60();
  return;
}



void FUN_1402f6970(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *param_1 = mcoCharacter::vftable;
  FUN_14034edf0(param_1 + 0x25f);
  FUN_140195a40(param_1 + 0x25d);
  FUN_140148af0(param_1 + 0x254);
  FUN_1402fce60(param_1 + 0x24b);
  if ((void *)param_1[0x240] != (void *)0x0) {
    operator_delete((void *)param_1[0x240]);
  }
  param_1[0x240] = 0;
  param_1[0x241] = 0;
  param_1[0x242] = 0;
  if ((void *)param_1[0x23c] != (void *)0x0) {
    operator_delete((void *)param_1[0x23c]);
  }
  param_1[0x23c] = 0;
  param_1[0x23d] = 0;
  param_1[0x23e] = 0;
  if ((void *)param_1[0x238] != (void *)0x0) {
    operator_delete((void *)param_1[0x238]);
  }
  param_1[0x238] = 0;
  param_1[0x239] = 0;
  param_1[0x23a] = 0;
  plVar3 = (longlong *)param_1[0x237];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x234];
  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);
      }
    }
  }
  FUN_1402fce40(param_1 + 0x22a);
  FUN_1402fccc0(param_1 + 0x221);
  plVar3 = (longlong *)param_1[0x220];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x21e];
  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);
      }
    }
  }
  FUN_1402fcab0(param_1 + 0x210);
  FUN_1402fca90(param_1 + 0x207);
  FUN_14030e480(param_1 + 0x1fe);
  if ((void *)param_1[0x1f1] != (void *)0x0) {
    operator_delete((void *)param_1[0x1f1]);
  }
  param_1[0x1f1] = 0;
  param_1[0x1f2] = 0;
  param_1[499] = 0;
  if ((void *)param_1[0x1ed] != (void *)0x0) {
    operator_delete((void *)param_1[0x1ed]);
  }
  param_1[0x1ed] = 0;
  param_1[0x1ee] = 0;
  param_1[0x1ef] = 0;
  if ((void *)param_1[0x1e9] != (void *)0x0) {
    operator_delete((void *)param_1[0x1e9]);
  }
  param_1[0x1e9] = 0;
  param_1[0x1ea] = 0;
  param_1[0x1eb] = 0;
  if ((void *)param_1[0x1e4] != (void *)0x0) {
    operator_delete((void *)param_1[0x1e4]);
  }
  param_1[0x1e4] = 0;
  param_1[0x1e5] = 0;
  param_1[0x1e6] = 0;
  if ((void *)param_1[0x1e0] != (void *)0x0) {
    operator_delete((void *)param_1[0x1e0]);
  }
  param_1[0x1e0] = 0;
  param_1[0x1e1] = 0;
  param_1[0x1e2] = 0;
  plVar3 = (longlong *)param_1[0x1db];
  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);
      }
    }
  }
  FUN_1401625e0(param_1 + 0x1a6);
  FUN_1401625e0(param_1 + 0x19d);
  if ((void *)param_1[0x196] != (void *)0x0) {
    operator_delete((void *)param_1[0x196]);
  }
  param_1[0x196] = 0;
  param_1[0x197] = 0;
  param_1[0x198] = 0;
  if (7 < (ulonglong)param_1[0x192]) {
    operator_delete((void *)param_1[399]);
  }
  param_1[0x192] = 7;
  param_1[0x191] = 0;
  *(undefined2 *)(param_1 + 399) = 0;
  plVar3 = (longlong *)param_1[0x18a];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x188];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x186];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x184];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x182];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x180];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x17e];
  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);
      }
    }
  }
  FUN_1402fcab0(param_1 + 0x15d);
  FUN_1402fca70(param_1 + 0x154);
  FUN_1402fca70(param_1 + 0x14b);
  FUN_14025e6b0(param_1 + 0x142);
  FUN_1402fca50(param_1 + 0x139);
  if (param_1[0xaf] != 0) {
    FUN_14023ae30(param_1[0xaf],param_1[0xb0]);
    operator_delete((void *)param_1[0xaf]);
  }
  param_1[0xaf] = 0;
  param_1[0xb0] = 0;
  param_1[0xb1] = 0;
  plVar3 = (longlong *)param_1[0x29];
  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);
      }
    }
  }
  plVar3 = (longlong *)param_1[0x27];
  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);
      }
    }
  }
  if (7 < (ulonglong)param_1[0x22]) {
    operator_delete((void *)param_1[0x1f]);
  }
  param_1[0x22] = 7;
  param_1[0x21] = 0;
  *(undefined2 *)(param_1 + 0x1f) = 0;
  if (7 < (ulonglong)param_1[0x1d]) {
    operator_delete((void *)param_1[0x1a]);
  }
  param_1[0x1d] = 7;
  param_1[0x1c] = 0;
  *(undefined2 *)(param_1 + 0x1a) = 0;
  *param_1 = mcoCNavigationActor::vftable;
  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;
  return;
}



void FUN_1402f6f40(longlong param_1)

{
  memset((void *)(param_1 + 0x618),0,0x11c);
  memset((void *)(param_1 + 0x734),0,0x114);
  *(undefined8 *)(param_1 + 0x848) = 0;
  *(undefined8 *)(param_1 + 0x850) = 0;
  *(undefined8 *)(param_1 + 0x858) = 0;
  *(undefined8 *)(param_1 + 0x860) = 0;
  *(undefined8 *)(param_1 + 0x868) = 0;
  *(undefined8 *)(param_1 + 0x870) = 0;
  *(undefined8 *)(param_1 + 0x878) = 0;
  *(undefined8 *)(param_1 + 0x880) = 0;
  *(undefined4 *)(param_1 + 0x8a9) = 0;
  *(undefined8 *)(param_1 + 0x88c) = 0;
  *(undefined8 *)(param_1 + 0x894) = 0;
  *(undefined8 *)(param_1 + 0x89c) = 0;
  *(undefined4 *)(param_1 + 0x8a4) = 0;
  memset((void *)(param_1 + 0x8b0),0,0x3c);
  memset((void *)(param_1 + 0x8ec),0,0x50);
  memset((void *)(param_1 + 0x93c),0,0x3c);
  memset((void *)(param_1 + 0x978),0,0x50);
  *(undefined2 *)(param_1 + 0x606) = 0x101;
  *(undefined1 *)(param_1 + 0x609) = 1;
  *(undefined2 *)(param_1 + 0x60a) = 0x101;
  *(undefined1 *)(param_1 + 0x888) = 1;
  return;
}



void FUN_1402f7040(longlong *param_1)

{
  int *piVar1;
  int iVar2;
  void *pvVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  undefined8 uVar6;
  uint uVar7;
  undefined8 *puVar8;
  longlong lVar9;
  bool bVar10;
  bool bVar11;
  undefined8 *local_c8;
  undefined1 local_b8 [8];
  longlong *local_b0;
  undefined1 local_a8 [8];
  longlong *local_a0;
  undefined1 local_98 [8];
  longlong *local_90;
  undefined1 local_88 [8];
  longlong *local_80;
  undefined1 local_78 [8];
  longlong *local_70;
  undefined1 local_68 [8];
  longlong *local_60;
  undefined1 local_58 [8];
  longlong *local_50;
  undefined8 local_48;
  undefined1 local_40 [8];
  longlong *local_38;
  
  local_48 = 0xfffffffffffffffe;
  puVar8 = (undefined8 *)0x0;
  local_c8 = (undefined8 *)0x0;
  bVar11 = false;
  plVar5 = (longlong *)param_1[0x25d];
  if (plVar5 != (longlong *)0x0) {
    if (plVar5 == (longlong *)param_1[0x25e]) {
      if ((undefined8 *)*plVar5 != (undefined8 *)0x0) {
        local_c8 = (undefined8 *)*plVar5;
        if ((plVar5 != (longlong *)param_1[0x25e]) &&
           (iVar2 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, local_c8 = puVar8,
           DAT_1406080a8 = iVar2, bVar11)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar11 = true;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1402f7990(param_1);
  iVar2 = (**(code **)(*param_1 + 0xb0))(param_1);
  if (iVar2 != 8) {
    if ((param_1[0x16f] != 0) &&
       (puVar4 = (undefined8 *)param_1[0x16f], puVar4 != (undefined8 *)0x0)) {
      (**(code **)*puVar4)(puVar4,1);
    }
    param_1[0x16f] = 0;
    if ((param_1[0x170] != 0) &&
       (puVar4 = (undefined8 *)param_1[0x170], puVar4 != (undefined8 *)0x0)) {
      (**(code **)*puVar4)(puVar4,1);
    }
    param_1[0x170] = 0;
    pvVar3 = operator_new(0x458);
    puVar4 = puVar8;
    if (pvVar3 != (void *)0x0) {
      puVar4 = (undefined8 *)FUN_14032a400(pvVar3,param_1);
    }
    param_1[0x16f] = (longlong)puVar4;
    pvVar3 = operator_new(0x458);
    puVar4 = puVar8;
    if (pvVar3 != (void *)0x0) {
      puVar4 = (undefined8 *)FUN_14032a400(pvVar3,param_1);
    }
    param_1[0x170] = (longlong)puVar4;
    uVar7 = 1;
    lVar9 = 0x180;
    iVar2 = DAT_140608178;
    do {
      if (uVar7 - 1 < 0xe) {
        if (uVar7 < 0xf) {
          plVar5 = (longlong *)(param_1[0x16f] + lVar9);
        }
        else {
          if (iVar2 == 0) {
            FUN_140176d60();
            iVar2 = DAT_140608178;
          }
          DAT_140608178 = iVar2 + 1;
          plVar5 = &DAT_140608170;
          iVar2 = DAT_140608178;
        }
        *(undefined4 *)(*plVar5 + 0x40) = 0;
      }
      if (uVar7 - 1 < 0xe) {
        if (uVar7 < 0xf) {
          plVar5 = (longlong *)(param_1[0x170] + lVar9);
        }
        else {
          if (iVar2 == 0) {
            FUN_140176d60();
            iVar2 = DAT_140608178;
          }
          DAT_140608178 = iVar2 + 1;
          plVar5 = &DAT_140608170;
          iVar2 = DAT_140608178;
        }
        *(undefined4 *)(*plVar5 + 0x40) = 1;
      }
      uVar7 = uVar7 + 1;
      lVar9 = lVar9 + 8;
    } while ((int)uVar7 < 0xf);
    puVar4 = (undefined8 *)param_1[0x171];
    if (puVar4 != (undefined8 *)0x0) {
      (**(code **)*puVar4)(puVar4,1);
    }
    param_1[0x171] = 0;
    puVar4 = operator_new(0x78);
    if (puVar4 != (undefined8 *)0x0) {
      *puVar4 = mcoCharacterAttribute::vftable;
      puVar4[1] = 0;
      puVar4[2] = 0;
      puVar4[3] = 0;
      *(undefined4 *)(puVar4 + 4) = 0;
      *(undefined8 *)((longlong)puVar4 + 0x24) = 0;
      *(undefined8 *)((longlong)puVar4 + 0x2c) = 0;
      *(undefined8 *)((longlong)puVar4 + 0x34) = 0;
      *(undefined4 *)((longlong)puVar4 + 0x3c) = 0;
      puVar4[8] = 0;
      puVar4[9] = 0;
      puVar4[10] = 0;
      *(undefined4 *)(puVar4 + 0xb) = 0;
      *(undefined8 *)((longlong)puVar4 + 0x5c) = 0;
      *(undefined8 *)((longlong)puVar4 + 100) = 0;
      *(undefined8 *)((longlong)puVar4 + 0x6c) = 0;
      *(undefined4 *)((longlong)puVar4 + 0x74) = 0;
      puVar8 = puVar4;
    }
    param_1[0x171] = (longlong)puVar8;
  }
  puVar8 = (undefined8 *)(param_1[0x26] + 0x430);
  if (7 < *(ulonglong *)(param_1[0x26] + 0x448)) {
    puVar8 = (undefined8 *)*puVar8;
  }
  uVar6 = FUN_1402ef230(DAT_140608068,local_68,puVar8);
  FUN_140343ec0(param_1 + 0x17d,uVar6);
  if (local_60 != (longlong *)0x0) {
    LOCK();
    plVar5 = local_60 + 1;
    *(int *)plVar5 = (int)*plVar5 + -1;
    UNLOCK();
    if ((int)*plVar5 == 0) {
      (**(code **)(*local_60 + 8))(local_60);
      LOCK();
      piVar1 = (int *)((longlong)local_60 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_60 + 0x10))(local_60);
      }
    }
  }
  puVar8 = (undefined8 *)(param_1[0x26] + 0x390);
  if (7 < *(ulonglong *)(param_1[0x26] + 0x3a8)) {
    puVar8 = (undefined8 *)*puVar8;
  }
  uVar6 = FUN_1402ef5a0(DAT_140608068,local_88,puVar8);
  FUN_140343ec0(param_1 + 0x17f,uVar6);
  if (local_80 != (longlong *)0x0) {
    LOCK();
    plVar5 = local_80 + 1;
    *(int *)plVar5 = (int)*plVar5 + -1;
    UNLOCK();
    if ((int)*plVar5 == 0) {
      (**(code **)(*local_80 + 8))(local_80);
      LOCK();
      piVar1 = (int *)((longlong)local_80 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_80 + 0x10))(local_80);
      }
    }
  }
  puVar8 = (undefined8 *)(param_1[0x26] + 0x598);
  if (7 < *(ulonglong *)(param_1[0x26] + 0x5b0)) {
    puVar8 = (undefined8 *)*puVar8;
  }
  uVar6 = FUN_1402ef8d0(DAT_140608068,local_b8,puVar8);
  FUN_140343ec0(param_1 + 0x181,uVar6);
  if (local_b0 != (longlong *)0x0) {
    LOCK();
    plVar5 = local_b0 + 1;
    *(int *)plVar5 = (int)*plVar5 + -1;
    UNLOCK();
    if ((int)*plVar5 == 0) {
      (**(code **)(*local_b0 + 8))(local_b0);
      LOCK();
      piVar1 = (int *)((longlong)local_b0 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_b0 + 0x10))(local_b0);
      }
    }
  }
  if (DAT_140607ccc == '\0') {
    puVar8 = (undefined8 *)(param_1[0x26] + 0x408);
    if (7 < *(ulonglong *)(param_1[0x26] + 0x420)) {
      puVar8 = (undefined8 *)*puVar8;
    }
    uVar6 = FUN_1402efc00(DAT_140608068,local_a8,puVar8);
    FUN_140343ec0(param_1 + 0x183,uVar6);
    if (local_a0 != (longlong *)0x0) {
      LOCK();
      plVar5 = local_a0 + 1;
      *(int *)plVar5 = (int)*plVar5 + -1;
      UNLOCK();
      if ((int)*plVar5 == 0) {
        (**(code **)(*local_a0 + 8))(local_a0);
        LOCK();
        piVar1 = (int *)((longlong)local_a0 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_a0 + 0x10))(local_a0);
        }
      }
    }
    puVar8 = (undefined8 *)(param_1[0x26] + 0x4a8);
    if (7 < *(ulonglong *)(param_1[0x26] + 0x4c0)) {
      puVar8 = (undefined8 *)*puVar8;
    }
    uVar6 = FUN_1402eff30(DAT_140608068,local_98,puVar8);
    FUN_140343ec0(param_1 + 0x185,uVar6);
    if (local_90 != (longlong *)0x0) {
      LOCK();
      plVar5 = local_90 + 1;
      *(int *)plVar5 = (int)*plVar5 + -1;
      UNLOCK();
      if ((int)*plVar5 == 0) {
        (**(code **)(*local_90 + 8))(local_90);
        LOCK();
        piVar1 = (int *)((longlong)local_90 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_90 + 0x10))(local_90);
        }
      }
    }
    puVar8 = (undefined8 *)(param_1[0x26] + 0x4d0);
    if (7 < *(ulonglong *)(param_1[0x26] + 0x4e8)) {
      puVar8 = (undefined8 *)*puVar8;
    }
    uVar6 = FUN_1402f02a0(DAT_140608068,local_78,puVar8);
    FUN_140343ec0(param_1 + 0x187,uVar6);
    if (local_70 != (longlong *)0x0) {
      LOCK();
      plVar5 = local_70 + 1;
      *(int *)plVar5 = (int)*plVar5 + -1;
      UNLOCK();
      if ((int)*plVar5 == 0) {
        (**(code **)(*local_70 + 8))(local_70);
        LOCK();
        piVar1 = (int *)((longlong)local_70 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_70 + 0x10))(local_70);
        }
      }
    }
    puVar8 = (undefined8 *)(param_1[0x26] + 0x5e8);
    if (7 < *(ulonglong *)(param_1[0x26] + 0x600)) {
      puVar8 = (undefined8 *)*puVar8;
    }
    uVar6 = FUN_1402f0610(DAT_140608068,local_58,puVar8);
    FUN_140343ec0(param_1 + 0x189,uVar6);
    if (local_50 != (longlong *)0x0) {
      LOCK();
      plVar5 = local_50 + 1;
      *(int *)plVar5 = (int)*plVar5 + -1;
      UNLOCK();
      if ((int)*plVar5 == 0) {
        (**(code **)(*local_50 + 8))(local_50);
        LOCK();
        piVar1 = (int *)((longlong)local_50 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_50 + 0x10))(local_50);
        }
      }
    }
  }
  puVar8 = (undefined8 *)(param_1[0x26] + 0x688);
  if (7 < *(ulonglong *)(param_1[0x26] + 0x6a0)) {
    puVar8 = (undefined8 *)*puVar8;
  }
  uVar6 = FUN_1402f0f80(DAT_140608068,local_40,puVar8);
  FUN_140343ec0(param_1 + 0x233,uVar6);
  if (local_38 != (longlong *)0x0) {
    LOCK();
    plVar5 = local_38 + 1;
    *(int *)plVar5 = (int)*plVar5 + -1;
    UNLOCK();
    if ((int)*plVar5 == 0) {
      (**(code **)(*local_38 + 8))(local_38);
      LOCK();
      piVar1 = (int *)((longlong)local_38 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_38 + 0x10))(local_38);
      }
    }
  }
  (**(code **)(*param_1 + 0xf0))(param_1);
  FUN_1402d8040(param_1);
  *(undefined4 *)((longlong)param_1 + 0xecc) = 0x44bb8000;
  if (bVar11) {
    FUN_14034edd0(local_c8);
  }
  return;
}



void FUN_1402f7620(longlong param_1)

{
  int *piVar1;
  ulonglong *puVar2;
  undefined8 *puVar3;
  int iVar4;
  DWORD DVar5;
  HANDLE pvVar6;
  HANDLE pvVar7;
  longlong *plVar8;
  longlong *plVar9;
  uint uVar10;
  longlong lVar11;
  ulonglong uVar12;
  bool bVar13;
  bool bVar14;
  ulonglong local_30;
  
  uVar12 = 0;
  local_30 = 0;
  bVar14 = false;
  puVar2 = *(ulonglong **)(param_1 + 0x12e8);
  if (puVar2 != (ulonglong *)0x0) {
    if (puVar2 == *(ulonglong **)(param_1 + 0x12f0)) {
      if (*puVar2 != 0) {
        local_30 = *puVar2;
        if ((puVar2 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar14 = DAT_1406080a8 == 0, local_30 = uVar12,
           DAT_1406080a8 = iVar4, bVar14)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40();
        bVar14 = true;
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar13 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar13) {
        FUN_140176d60(1);
      }
    }
  }
  plVar9 = (longlong *)(param_1 + 0x1a0);
  lVar11 = 0x6e;
  do {
    puVar3 = (undefined8 *)*plVar9;
    if (puVar3 != (undefined8 *)0x0) {
      (**(code **)*puVar3)(puVar3,1);
    }
    *plVar9 = 0;
    plVar9 = plVar9 + 1;
    lVar11 = lVar11 + -1;
  } while (lVar11 != 0);
  *(undefined8 *)(param_1 + 0x140) = 0;
  plVar9 = *(longlong **)(param_1 + 0x148);
  *(undefined8 *)(param_1 + 0x148) = 0;
  if (plVar9 != (longlong *)0x0) {
    LOCK();
    plVar8 = plVar9 + 1;
    *(int *)plVar8 = (int)*plVar8 + -1;
    UNLOCK();
    if ((int)*plVar8 == 0) {
      (**(code **)(*plVar9 + 8))(plVar9);
      LOCK();
      piVar1 = (int *)((longlong)plVar9 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*plVar9 + 0x10))(plVar9);
      }
    }
  }
  FUN_1402fc980(param_1 + 0x9c8);
  FUN_14025e7e0(param_1 + 0xa10);
  plVar9 = (longlong *)(param_1 + 0xb78);
  do {
    uVar10 = (uint)uVar12;
    plVar8 = plVar9;
    if (1 < uVar10) {
      if ((DAT_140608140 == 0) &&
         (pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                               (HANDLE)0x0), pvVar6 != (HANDLE)0x0)) {
        DVar5 = GetCurrentProcessId();
        pvVar7 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar7,DVar5,pvVar6,0x2000,0,0,0);
        CloseHandle(pvVar6);
      }
      DAT_140608140 = DAT_140608140 + 1;
      plVar8 = &DAT_140608148;
    }
    if (*plVar8 != 0) {
      plVar8 = plVar9;
      if (1 < uVar10) {
        if ((DAT_140608140 == 0) &&
           (pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                 (HANDLE)0x0), pvVar6 != (HANDLE)0x0)) {
          DVar5 = GetCurrentProcessId();
          pvVar7 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar7,DVar5,pvVar6,0x2000,0,0,0);
          CloseHandle(pvVar6);
        }
        DAT_140608140 = DAT_140608140 + 1;
        plVar8 = &DAT_140608148;
      }
      puVar3 = (undefined8 *)*plVar8;
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
    }
    plVar8 = plVar9;
    if (1 < uVar10) {
      if ((DAT_140608140 == 0) &&
         (pvVar6 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                               (HANDLE)0x0), pvVar6 != (HANDLE)0x0)) {
        DVar5 = GetCurrentProcessId();
        pvVar7 = GetCurrentProcess();
        MiniDumpWriteDump(pvVar7,DVar5,pvVar6,0x2000,0,0,0);
        CloseHandle(pvVar6);
      }
      DAT_140608140 = DAT_140608140 + 1;
      plVar8 = &DAT_140608148;
    }
    *plVar8 = 0;
    uVar12 = (ulonglong)(uVar10 + 1);
    plVar9 = plVar9 + 1;
  } while ((int)(uVar10 + 1) < 2);
  puVar3 = *(undefined8 **)(param_1 + 0xb88);
  if (puVar3 != (undefined8 *)0x0) {
    (**(code **)*puVar3)(puVar3,1);
  }
  *(undefined8 *)(param_1 + 0xb88) = 0;
  if (bVar14) {
    FUN_14034edd0(local_30);
  }
  return;
}



void FUN_1402f7990(longlong *param_1)

{
  undefined4 uVar1;
  DWORD DVar2;
  HANDLE hObject;
  HANDLE pvVar3;
  longlong *plVar4;
  int iVar5;
  uint uVar6;
  longlong *plVar7;
  longlong lVar8;
  
  if (param_1[0x26] != 0) {
    uVar6 = 0x14;
    lVar8 = 0x7fc;
    plVar7 = param_1 + 0xcd;
    iVar5 = DAT_140608134;
    do {
      uVar1 = *(undefined4 *)(lVar8 + param_1[0x26]);
      plVar4 = plVar7;
      if (0x46 < uVar6) {
        if (iVar5 == 0) {
          FUN_140176d60(0);
          iVar5 = DAT_140608134;
        }
        DAT_140608134 = iVar5 + 1;
        plVar4 = (longlong *)&DAT_140608130;
        iVar5 = DAT_140608134;
      }
      uVar6 = uVar6 + 1;
      plVar7 = (longlong *)((longlong)plVar7 + 4);
      lVar8 = lVar8 + 4;
      *(undefined4 *)plVar4 = uVar1;
    } while ((int)uVar6 < 0x1c);
    uVar6 = 0x21;
    lVar8 = 0x81c;
    plVar7 = param_1 + 0xf7;
    do {
      uVar1 = *(undefined4 *)(param_1[0x26] + lVar8);
      plVar4 = plVar7;
      if (0x44 < uVar6) {
        if ((DAT_14060813c == 0) &&
           (hObject = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                  (HANDLE)0x0), hObject != (HANDLE)0x0)) {
          DVar2 = GetCurrentProcessId();
          pvVar3 = GetCurrentProcess();
          MiniDumpWriteDump(pvVar3,DVar2,hObject,0x2000,0,0,0);
          CloseHandle(hObject);
        }
        DAT_14060813c = DAT_14060813c + 1;
        plVar4 = (longlong *)&DAT_140608138;
      }
      uVar6 = uVar6 + 1;
      plVar7 = (longlong *)((longlong)plVar7 + 4);
      lVar8 = lVar8 + 4;
      *(undefined4 *)plVar4 = uVar1;
    } while ((int)uVar6 < 0x2f);
    lVar8 = (**(code **)(*param_1 + 0x270))(param_1);
    if (lVar8 != 0) {
      *(undefined4 *)((longlong)param_1 + 0x88c) = *(undefined4 *)(lVar8 + 0x90);
      *(undefined4 *)(param_1 + 0x112) = *(undefined4 *)(lVar8 + 0x94);
      *(undefined4 *)(param_1 + 0x113) = *(undefined4 *)(lVar8 + 0x98);
      *(undefined4 *)((longlong)param_1 + 0x89c) = *(undefined4 *)(lVar8 + 0x9c);
      *(undefined4 *)(param_1 + 0x114) = *(undefined4 *)(lVar8 + 0xa0);
      *(undefined4 *)((longlong)param_1 + 0x8a4) = *(undefined4 *)(lVar8 + 0xa4);
    }
  }
  return;
}



ulonglong FUN_1402f7ba0(longlong *param_1,undefined4 param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  short *psVar4;
  ulonglong uVar5;
  float fVar6;
  undefined4 local_res10 [6];
  
  local_res10[0] = param_2;
  if (*(char *)((longlong)param_1 + 0xef4) != '\0') {
    uVar5 = FUN_1402fb160(param_1,L"nPhysicalAtk");
    return uVar5;
  }
  iVar1 = (**(code **)(*param_1 + 0xb0))();
  if (iVar1 != 0x10) {
    iVar1 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (iVar1 != 0x20) {
      psVar4 = (short *)(param_1[0x26] + 0x480);
      if (7 < *(ulonglong *)(param_1[0x26] + 0x498)) {
        psVar4 = *(short **)psVar4;
      }
      if ((psVar4 != (short *)0x0) && (*psVar4 != 0)) {
        uVar2 = FUN_14031d6d0();
        uVar5 = FUN_14031ceb0(uVar2,psVar4,local_res10);
        return uVar5;
      }
      return 0;
    }
  }
  lVar3 = (**(code **)(*param_1 + 0x288))(param_1);
  if (*(longlong *)(lVar3 + 0xd8) == 0) {
    return 0;
  }
  fVar6 = ((float)*(int *)(lVar3 + 0x8c) * *(float *)(*(longlong *)(lVar3 + 0xd8) + 8) +
          *(float *)(lVar3 + 0xb0)) * (*(float *)(lVar3 + 0xc4) + 1.0);
  uVar5 = (ulonglong)(uint)fVar6;
  if (fVar6 < 1.0) {
    uVar5 = 0x3f800000;
  }
  return uVar5;
}



ulonglong FUN_1402f7ca0(longlong *param_1,undefined4 param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  short *psVar4;
  ulonglong uVar5;
  float fVar6;
  undefined4 local_res10 [6];
  
  local_res10[0] = param_2;
  if (*(char *)((longlong)param_1 + 0xef4) != '\0') {
    uVar5 = FUN_1402fb160(param_1,L"nPhysicalDef");
    return uVar5;
  }
  iVar1 = (**(code **)(*param_1 + 0xb0))();
  if (iVar1 != 0x10) {
    iVar1 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (iVar1 != 0x20) {
      psVar4 = (short *)(param_1[0x26] + 0x480);
      if (7 < *(ulonglong *)(param_1[0x26] + 0x498)) {
        psVar4 = *(short **)psVar4;
      }
      if ((psVar4 != (short *)0x0) && (*psVar4 != 0)) {
        uVar2 = FUN_14031d6d0();
        uVar5 = FUN_14031d050(uVar2,psVar4,local_res10);
        return uVar5;
      }
      return 0;
    }
  }
  lVar3 = (**(code **)(*param_1 + 0x288))(param_1);
  if (*(longlong *)(lVar3 + 0xd8) == 0) {
    return 0;
  }
  fVar6 = ((float)*(int *)(lVar3 + 0x90) * *(float *)(*(longlong *)(lVar3 + 0xd8) + 0xc) +
          *(float *)(lVar3 + 0xb4)) * (*(float *)(lVar3 + 200) + 1.0);
  uVar5 = (ulonglong)(uint)fVar6;
  if (fVar6 < 1.0) {
    uVar5 = 0x3f800000;
  }
  return uVar5;
}



ulonglong FUN_1402f7da0(longlong *param_1,undefined4 param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  short *psVar4;
  ulonglong uVar5;
  float fVar6;
  undefined4 local_res10 [6];
  
  local_res10[0] = param_2;
  if (*(char *)((longlong)param_1 + 0xef4) != '\0') {
    uVar5 = FUN_1402fb160(param_1,L"nMagicalAtk");
    return uVar5;
  }
  iVar1 = (**(code **)(*param_1 + 0xb0))();
  if (iVar1 != 0x10) {
    iVar1 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (iVar1 != 0x20) {
      psVar4 = (short *)(param_1[0x26] + 0x480);
      if (7 < *(ulonglong *)(param_1[0x26] + 0x498)) {
        psVar4 = *(short **)psVar4;
      }
      if ((psVar4 != (short *)0x0) && (*psVar4 != 0)) {
        uVar2 = FUN_14031d6d0();
        uVar5 = FUN_14031d390(uVar2,psVar4,local_res10);
        return uVar5;
      }
      return 0;
    }
  }
  lVar3 = (**(code **)(*param_1 + 0x288))(param_1);
  if (*(longlong *)(lVar3 + 0xd8) == 0) {
    return 0;
  }
  fVar6 = ((float)*(int *)(lVar3 + 0x94) * *(float *)(*(longlong *)(lVar3 + 0xd8) + 0x10) +
          *(float *)(lVar3 + 0xb8)) * (*(float *)(lVar3 + 0xcc) + 1.0);
  uVar5 = (ulonglong)(uint)fVar6;
  if (fVar6 < 1.0) {
    uVar5 = 0x3f800000;
  }
  return uVar5;
}



ulonglong FUN_1402f7ea0(longlong *param_1,undefined4 param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  short *psVar4;
  ulonglong uVar5;
  float fVar6;
  undefined4 local_res10 [6];
  
  local_res10[0] = param_2;
  if (*(char *)((longlong)param_1 + 0xef4) != '\0') {
    uVar5 = FUN_1402fb160(param_1,L"nMagicalDef");
    return uVar5;
  }
  iVar1 = (**(code **)(*param_1 + 0xb0))();
  if (iVar1 != 0x10) {
    iVar1 = (**(code **)(*param_1 + 0xb0))(param_1);
    if (iVar1 != 0x20) {
      psVar4 = (short *)(param_1[0x26] + 0x480);
      if (7 < *(ulonglong *)(param_1[0x26] + 0x498)) {
        psVar4 = *(short **)psVar4;
      }
      if ((psVar4 != (short *)0x0) && (*psVar4 != 0)) {
        uVar2 = FUN_14031d6d0();
        uVar5 = FUN_14031d530(uVar2,psVar4,local_res10);
        return uVar5;
      }
      return 0;
    }
  }
  lVar3 = (**(code **)(*param_1 + 0x288))(param_1);
  if (*(longlong *)(lVar3 + 0xd8) == 0) {
    return 0;
  }
  fVar6 = ((float)*(int *)(lVar3 + 0x98) * *(float *)(*(longlong *)(lVar3 + 0xd8) + 0x14) +
          *(float *)(lVar3 + 0xbc)) * (*(float *)(lVar3 + 0xd0) + 1.0);
  uVar5 = (ulonglong)(uint)fVar6;
  if (fVar6 < 1.0) {
    uVar5 = 0x3f800000;
  }
  return uVar5;
}



undefined1 FUN_1402f7fa0(longlong param_1,undefined4 param_2,char param_3)

{
  char cVar1;
  
  if (param_3 == '\0') {
    cVar1 = (**(code **)(**(longlong **)(param_1 + 0x1a0 + (longlong)*(int *)(param_1 + 300) * 8) +
                        8))();
    if (cVar1 == '\0') {
      return 0;
    }
  }
  *(undefined4 *)(param_1 + 300) = param_2;
  return 1;
}



void FUN_1402f7ff0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x54c) = param_2;
  return;
}



void FUN_1402f8000(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x53c) = param_2;
  *(undefined4 *)(param_1 + 0x540) = param_3;
  *(undefined4 *)(param_1 + 0xcd8) = param_2;
  *(undefined4 *)(param_1 + 0xcdc) = param_3;
  return;
}



void FUN_1402f8020(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x544) = param_2;
  *(undefined4 *)(param_1 + 0x548) = param_3;
  return;
}



void FUN_1402f8030(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x550) = param_2;
  *(undefined4 *)(param_1 + 0x554) = param_3;
  return;
}



void FUN_1402f8040(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x560) = param_2;
  *(undefined4 *)(param_1 + 0x564) = param_3;
  return;
}



void FUN_1402f8050(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x558) = param_2;
  *(undefined4 *)(param_1 + 0x55c) = param_3;
  return;
}



void FUN_1402f8060(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x568) = param_2;
  *(undefined4 *)(param_1 + 0x56c) = param_3;
  return;
}



void FUN_1402f8070(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x570) = param_2;
  *(undefined4 *)(param_1 + 0x574) = param_3;
  return;
}



void FUN_1402f8080(longlong param_1)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  float fVar4;
  
  if (*(char *)(param_1 + 0xef4) == '\0') {
    iVar1 = *(int *)(*(longlong *)(param_1 + 0x130) + 0x204);
    fVar4 = *(float *)(*(longlong *)(param_1 + 0x130) + 0x210);
    iVar2 = FUN_1402f8580();
    if (iVar1 - 1U < 3) {
      fVar4 = (float)(int)(&DAT_140607c2c)[iVar1] + (float)(iVar2 + -1) * fVar4;
    }
    else {
      fVar4 = 10.0;
    }
    *(float *)(param_1 + 0x59c) = fVar4;
    *(undefined1 *)(param_1 + 0x10c8) = 1;
    return;
  }
  uVar3 = FUN_1402fb160(param_1,&DAT_1404cad68);
  *(undefined1 *)(param_1 + 0x10c8) = 1;
  *(undefined4 *)(param_1 + 0x59c) = uVar3;
  return;
}



void FUN_1402f8130(longlong param_1)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  float fVar4;
  
  if (*(char *)(param_1 + 0xef4) == '\0') {
    iVar1 = *(int *)(*(longlong *)(param_1 + 0x130) + 0x208);
    fVar4 = *(float *)(*(longlong *)(param_1 + 0x130) + 0x214);
    iVar2 = FUN_1402f8580();
    if (iVar1 - 1U < 3) {
      fVar4 = (float)*(int *)(&DAT_140607c3c + (longlong)iVar1 * 4) + (float)(iVar2 + -1) * fVar4;
    }
    else {
      fVar4 = 10.0;
    }
    *(float *)(param_1 + 0x5a4) = fVar4;
    *(undefined1 *)(param_1 + 0x10c8) = 1;
    return;
  }
  uVar3 = FUN_1402fb160(param_1,&DAT_1404b72b8);
  *(undefined1 *)(param_1 + 0x10c8) = 1;
  *(undefined4 *)(param_1 + 0x5a4) = uVar3;
  return;
}



void FUN_1402f81e0(longlong *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  longlong lVar4;
  int *piVar5;
  float fVar6;
  float fVar7;
  int local_res8 [6];
  
  local_res8[2] = param_2;
  local_res8[0] = 1;
  local_res8[4] = 100;
  piVar5 = local_res8;
  if (0 < param_2) {
    piVar5 = local_res8 + 2;
  }
  piVar3 = local_res8 + 4;
  if (*piVar5 < 0x65) {
    piVar3 = piVar5;
  }
  iVar1 = *piVar3;
  iVar2 = (**(code **)(*param_1 + 0xb0))();
  if (iVar2 < 1) {
LAB_1402f8560:
    param_1[0xb3] = 0;
    param_1[0xb4] = 0;
  }
  else {
    if (iVar2 < 3) {
      lVar4 = param_1[0x26];
      fVar7 = 10.0;
      if (*(int *)(lVar4 + 0x204) - 1U < 3) {
        fVar6 = (float)(iVar1 + -1) * *(float *)(lVar4 + 0x210) +
                (float)(int)(&DAT_140607c2c)[*(int *)(lVar4 + 0x204)];
      }
      else {
        fVar6 = 10.0;
      }
      *(float *)((longlong)param_1 + 0x59c) = fVar6;
      if (*(int *)(lVar4 + 0x208) - 1U < 3) {
        fVar7 = (float)(iVar1 + -1) * *(float *)(lVar4 + 0x214) +
                (float)*(int *)(&DAT_140607c3c + (longlong)*(int *)(lVar4 + 0x208) * 4);
      }
      *(float *)((longlong)param_1 + 0x5a4) = fVar7;
      *(float *)(param_1 + 0xb3) =
           (*(float *)((longlong)param_1 + 0x8ec) + *(float *)((longlong)param_1 + 0x734) + 1.0 +
           0.0001) * ((float)((int)param_1[0x116] + (int)param_1[0xc3]) + fVar6) +
           (float)(int)param_1[0x10d] + (float)*(int *)((longlong)param_1 + 0x88c);
      param_1[0xb6] = 0;
      *(float *)(param_1 + 0xb4) =
           (*(float *)(param_1 + 0x11e) + *(float *)(param_1 + 0xe7) + 1.0 + 0.0001) *
           ((float)(*(int *)((longlong)param_1 + 0x8b4) + *(int *)((longlong)param_1 + 0x61c)) +
           fVar7) + (float)*(int *)((longlong)param_1 + 0x86c) + (float)(int)param_1[0x112];
    }
    else {
      if (iVar2 != 4) {
        if ((iVar2 == 0x10) || (iVar2 == 0x20)) {
          lVar4 = (**(code **)(*param_1 + 0x280))(param_1);
          if (lVar4 == 0) {
            return;
          }
          iVar2 = FUN_1402e5360();
          fVar7 = (float)iVar2;
          *(float *)((longlong)param_1 + 0x59c) = fVar7;
          iVar2 = FUN_1402e53a0();
          *(float *)((longlong)param_1 + 0x5a4) = (float)iVar2;
          *(float *)(param_1 + 0xb3) =
               (*(float *)((longlong)param_1 + 0x8ec) + *(float *)((longlong)param_1 + 0x734) + 1.0
               + 0.0001) * ((float)((int)param_1[0x116] + (int)param_1[0xc3]) + fVar7) +
               (float)(int)param_1[0x10d] + (float)*(int *)((longlong)param_1 + 0x88c);
          *(float *)(param_1 + 0xb4) =
               (*(float *)(param_1 + 0x11e) + *(float *)(param_1 + 0xe7) + 1.0 + 0.0001) *
               ((float)(*(int *)((longlong)param_1 + 0x8b4) + *(int *)((longlong)param_1 + 0x61c)) +
               (float)iVar2) + (float)*(int *)((longlong)param_1 + 0x86c) +
               (float)(int)param_1[0x112];
          if (param_1[0x26] != 0) {
            param_1[0xb6] = 0;
          }
          *(int *)(lVar4 + 0x4c) = iVar1;
          return;
        }
        goto LAB_1402f8560;
      }
      fVar7 = (float)*(int *)(param_1[0x26] + 0x7a4) * *(float *)((longlong)param_1 + 0xc5c);
      *(float *)(param_1 + 0xb3) = fVar7;
      *(float *)((longlong)param_1 + 0x59c) = fVar7;
      iVar2 = *(int *)(param_1[0x26] + 0x7a8);
      *(int *)((longlong)param_1 + 0x124c) = iVar1;
      fVar7 = (float)iVar2 * *(float *)((longlong)param_1 + 0xc5c);
      *(float *)(param_1 + 0xb4) = fVar7;
      *(float *)((longlong)param_1 + 0x5a4) = fVar7;
    }
    lVar4 = (**(code **)(*param_1 + 0x270))(param_1);
    if (lVar4 != 0) {
      lVar4 = (**(code **)(*param_1 + 0x270))(param_1);
      *(int *)(lVar4 + 0x5c) = iVar1;
      return;
    }
  }
  return;
}



int FUN_1402f8580(longlong *param_1)

{
  int iVar1;
  longlong lVar2;
  
  lVar2 = (**(code **)(*param_1 + 0x278))();
  if (lVar2 != 0) {
    lVar2 = (**(code **)(*param_1 + 0x278))();
    return *(int *)(lVar2 + 0x5c);
  }
  lVar2 = (**(code **)(*param_1 + 0x288))(param_1);
  if (lVar2 != 0) {
    lVar2 = (**(code **)(*param_1 + 0x288))(param_1);
    return *(int *)(lVar2 + 0x4c);
  }
  iVar1 = *(int *)((longlong)param_1 + 0x124c);
  if (iVar1 == 0) {
    iVar1 = *(int *)(param_1[0x26] + 0x1f0);
  }
  return iVar1;
}



float FUN_1402f85f0(longlong param_1)

{
  float *pfVar1;
  float fVar2;
  
  fVar2 = 0.0;
  for (pfVar1 = *(float **)(param_1 + 0x11c0); pfVar1 != *(float **)(param_1 + 0x11c8);
      pfVar1 = pfVar1 + 1) {
    fVar2 = fVar2 + *pfVar1;
  }
  return fVar2 + *(float *)(param_1 + 0x598);
}



float FUN_1402f8630(longlong param_1)

{
  float fVar1;
  longlong *plVar2;
  int iVar3;
  float *pfVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  bool bVar9;
  float fVar10;
  
  fVar10 = 0.0;
  lVar5 = 0;
  bVar9 = false;
  plVar2 = *(longlong **)(param_1 + 0x12e8);
  lVar7 = lVar5;
  if (plVar2 != (longlong *)0x0) {
    if (plVar2 == *(longlong **)(param_1 + 0x12f0)) {
      lVar6 = *plVar2;
      lVar7 = 0;
      if (lVar6 != 0) {
        if ((plVar2 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar3 = DAT_1406080a8 + 1, bVar9 = DAT_1406080a8 == 0, lVar6 = lVar5,
           DAT_1406080a8 = iVar3, bVar9)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar6);
        bVar9 = true;
        lVar7 = lVar6;
      }
    }
    else {
      iVar3 = DAT_1406080a8 + 1;
      bVar8 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar3;
      if (bVar8) {
        FUN_140176d60(1);
      }
    }
  }
  for (pfVar4 = *(float **)(param_1 + 0x11e0); pfVar4 != *(float **)(param_1 + 0x11e8);
      pfVar4 = pfVar4 + 1) {
    fVar10 = fVar10 + *pfVar4;
  }
  fVar1 = *(float *)(param_1 + 0x5a0);
  if (bVar9) {
    FUN_14034edd0(lVar7);
  }
  return fVar10 + fVar1;
}



void FUN_1402f8720(longlong *param_1,float param_2)

{
  if ((*(int *)((longlong)param_1 + 300) != 0x25) && (param_2 != 0.0)) {
    (**(code **)(*param_1 + 0x2b8))();
  }
  return;
}



void FUN_1402f8750(longlong *param_1,float param_2)

{
  if ((*(int *)((longlong)param_1 + 300) != 0x25) && (param_2 != 0.0)) {
    (**(code **)(*param_1 + 0x2c0))();
  }
  return;
}



void FUN_1402f8780(longlong *param_1)

{
  if (((int)param_1[0x1fb] != 1) && ((int)param_1[0x1fb] != 2)) {
    (**(code **)(*param_1 + 0x2c8))();
  }
  return;
}



void FUN_1402f87b0(longlong param_1)

{
  int iVar1;
  int *piVar2;
  int *piVar3;
  int local_res8 [8];
  
  if (((*(int *)(param_1 + 0xfd8) != 1) && (*(int *)(param_1 + 0xfd8) != 2)) &&
     (*(longlong *)(param_1 + 0xc48) != 0)) {
    piVar3 = (int *)(param_1 + 0x5a8);
    iVar1 = FUN_140343e70();
    *piVar3 = *piVar3 + iVar1;
    local_res8[0] = *(int *)(param_1 + 0x5ac);
    piVar2 = local_res8;
    if (*piVar3 < *(int *)(param_1 + 0x5ac)) {
      piVar2 = piVar3;
    }
    iVar1 = *piVar2;
    local_res8[0] = 0;
    *piVar3 = iVar1;
    piVar2 = local_res8;
    if (-1 < iVar1) {
      piVar2 = piVar3;
    }
    iVar1 = *piVar2;
    *(undefined1 *)(param_1 + 0x10c8) = 1;
    *piVar3 = iVar1;
  }
  return;
}



void FUN_1402f8830(longlong *param_1,float param_2,float param_3,char param_4)

{
  if (param_4 == '\0') {
    if ((*(int *)((longlong)param_1 + 300) != 0x25) && (param_2 != 0.0)) {
      (**(code **)(*param_1 + 0x2b8))();
    }
    if ((*(int *)((longlong)param_1 + 300) != 0x25) && (param_3 != 0.0)) {
      (**(code **)(*param_1 + 0x2c0))(param_1,param_3);
    }
  }
  return;
}



void FUN_1402f88a0(longlong param_1,float param_2)

{
  float fVar1;
  float *pfVar2;
  float local_res8 [2];
  float local_res10 [6];
  
  local_res10[0] = param_2;
  pfVar2 = local_res10;
  local_res8[0] =
       ((float)(*(int *)(param_1 + 0x8b0) + *(int *)(param_1 + 0x618)) + *(float *)(param_1 + 0x59c)
       ) * (*(float *)(param_1 + 0x8ec) + *(float *)(param_1 + 0x734) + 1.0 + 0.0001) +
       (float)*(int *)(param_1 + 0x868) + (float)*(int *)(param_1 + 0x88c);
  if (local_res8[0] <= param_2) {
    pfVar2 = local_res8;
  }
  *(float *)(param_1 + 0x598) = *pfVar2;
  local_res10[0] = 0.0;
  pfVar2 = local_res10;
  if (0.0 < *(float *)(param_1 + 0x598) || *(float *)(param_1 + 0x598) == 0.0) {
    pfVar2 = (float *)(param_1 + 0x598);
  }
  fVar1 = *pfVar2;
  *(undefined1 *)(param_1 + 0x10c8) = 1;
  *(float *)(param_1 + 0x598) = fVar1;
  return;
}



void FUN_1402f8960(longlong param_1,float param_2)

{
  float fVar1;
  float *pfVar2;
  float local_res8 [2];
  float local_res10 [6];
  
  local_res10[0] = param_2;
  pfVar2 = local_res10;
  local_res8[0] =
       ((float)(*(int *)(param_1 + 0x8b4) + *(int *)(param_1 + 0x61c)) + *(float *)(param_1 + 0x5a4)
       ) * (*(float *)(param_1 + 0x8f0) + *(float *)(param_1 + 0x738) + 1.0 + 0.0001) +
       (float)*(int *)(param_1 + 0x86c) + (float)*(int *)(param_1 + 0x890);
  if (local_res8[0] <= param_2) {
    pfVar2 = local_res8;
  }
  *(float *)(param_1 + 0x5a0) = *pfVar2;
  local_res10[0] = 0.0;
  pfVar2 = local_res10;
  if (0.0 < *(float *)(param_1 + 0x5a0) || *(float *)(param_1 + 0x5a0) == 0.0) {
    pfVar2 = (float *)(param_1 + 0x5a0);
  }
  fVar1 = *pfVar2;
  *(undefined1 *)(param_1 + 0x10c8) = 1;
  *(float *)(param_1 + 0x5a0) = fVar1;
  return;
}



void FUN_1402f8a20(longlong param_1)

{
  longlong *plVar1;
  void *_Dst;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  _Dst = *(void **)(param_1 + 0x11c0);
  if (_Dst != *(void **)(param_1 + 0x11c8)) {
    memmove(_Dst,*(void **)(param_1 + 0x11c8),0);
    *(void **)(param_1 + 0x11c8) = _Dst;
  }
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_1402f8b30(longlong param_1)

{
  longlong *plVar1;
  void *_Dst;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  _Dst = *(void **)(param_1 + 0x11e0);
  if (_Dst != *(void **)(param_1 + 0x11e8)) {
    memmove(_Dst,*(void **)(param_1 + 0x11e8),0);
    *(void **)(param_1 + 0x11e8) = _Dst;
  }
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_1402f8c40(longlong param_1,float param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  float local_res10 [2];
  
  if (param_2 != 0.0) {
    lVar4 = 0;
    bVar8 = false;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar6 = lVar4;
    local_res10[0] = param_2;
    if (plVar1 != (longlong *)0x0) {
      plVar2 = *(longlong **)(param_1 + 0x12f0);
      if (plVar1 == plVar2) {
        lVar5 = *plVar1;
        lVar6 = 0;
        if (lVar5 != 0) {
          if ((plVar1 != plVar2) &&
             (iVar3 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar4,
             DAT_1406080a8 = iVar3, bVar8)) {
            FUN_140176d60(1,plVar2,param_3,param_4,0xfffffffffffffffe,0,0);
          }
          FUN_14034ed40(lVar5);
          bVar8 = true;
          lVar6 = lVar5;
        }
      }
      else {
        iVar3 = DAT_1406080a8 + 1;
        bVar7 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar3;
        if (bVar7) {
          FUN_140176d60(1,plVar2,param_3,param_4,0xfffffffffffffffe,0,0);
        }
      }
    }
    FUN_14008ea70(param_1 + 0x11c0,local_res10);
    if (bVar8) {
      FUN_14034edd0(lVar6);
    }
  }
  return;
}



void FUN_1402f8d30(longlong param_1,float param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  longlong *plVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  float local_res10 [2];
  
  if (param_2 != 0.0) {
    lVar4 = 0;
    bVar8 = false;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar6 = lVar4;
    local_res10[0] = param_2;
    if (plVar1 != (longlong *)0x0) {
      plVar2 = *(longlong **)(param_1 + 0x12f0);
      if (plVar1 == plVar2) {
        lVar5 = *plVar1;
        lVar6 = 0;
        if (lVar5 != 0) {
          if ((plVar1 != plVar2) &&
             (iVar3 = DAT_1406080a8 + 1, bVar8 = DAT_1406080a8 == 0, lVar5 = lVar4,
             DAT_1406080a8 = iVar3, bVar8)) {
            FUN_140176d60(1,plVar2,param_3,param_4,0xfffffffffffffffe,0,0);
          }
          FUN_14034ed40(lVar5);
          bVar8 = true;
          lVar6 = lVar5;
        }
      }
      else {
        iVar3 = DAT_1406080a8 + 1;
        bVar7 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar3;
        if (bVar7) {
          FUN_140176d60(1,plVar2,param_3,param_4,0xfffffffffffffffe,0,0);
        }
      }
    }
    FUN_14008ea70(param_1 + 0x11e0,local_res10);
    if (bVar8) {
      FUN_14034edd0(lVar6);
    }
  }
  return;
}



void FUN_1402f8e20(longlong param_1,int param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  int local_res10 [2];
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  if (param_2 != 0) {
    uVar8 = 0xfffffffffffffffe;
    lVar3 = 0;
    lVar9 = 0;
    bVar7 = false;
    uVar10 = 0;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    lVar5 = lVar3;
    local_res10[0] = param_2;
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
        lVar4 = *plVar1;
        lVar5 = 0;
        if (lVar4 != 0) {
          if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
             (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
             DAT_1406080a8 = iVar2, bVar7)) {
            FUN_140176d60(1);
          }
          lVar9 = lVar4;
          FUN_14034ed40(lVar4);
          bVar7 = true;
          uVar10 = 1;
          lVar5 = lVar4;
        }
      }
      else {
        iVar2 = DAT_1406080a8 + 1;
        bVar6 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar2;
        if (bVar6) {
          FUN_140176d60(1);
        }
      }
    }
    FUN_14012e5c0(param_1 + 0x1200,local_res10,param_3,param_4,uVar8,lVar9,uVar10);
    if (bVar7) {
      FUN_14034edd0(lVar5);
    }
  }
  return;
}



undefined4 FUN_1402f8f10(longlong param_1)

{
  if ((*(longlong *)(param_1 + 0xb70) != 0) && (*(int *)(param_1 + 0xfc0) != 0)) {
    return *(undefined4 *)(*(longlong *)(param_1 + 0xb70) + 0xa8);
  }
  if (*(longlong *)(param_1 + 0x130) != 0) {
    return *(undefined4 *)(*(longlong *)(param_1 + 0x130) + 0x2a0);
  }
  return 0;
}



float FUN_1402f8f50(longlong *param_1)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  float fVar5;
  
  if (*(char *)((longlong)param_1 + 0xef4) != '\0') {
    lVar1 = param_1[0x24];
    uVar2 = (**(code **)(*param_1 + 0x200))();
    uVar3 = FUN_1402f8580(param_1);
    uVar4 = FUN_1403080d0();
    fVar5 = (float)FUN_140307d40(uVar4,uVar3,uVar2,(int)lVar1,(int)param_1[0x1df]);
    return fVar5 * *(float *)(param_1 + 0x1b0);
  }
  if ((param_1[0x16e] != 0) && ((int)param_1[0x1f8] != 0)) {
    return *(float *)(param_1[0x16e] + 0xac) * *(float *)(param_1 + 0x1b0);
  }
  if (param_1[0x26] != 0) {
    return *(float *)(param_1[0x26] + 0x2a4) * *(float *)(param_1 + 0x1b0);
  }
  return 0.0;
}



int FUN_1402f9020(longlong *param_1)

{
  float fVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = (**(code **)(*param_1 + 0xb0))();
  if (iVar2 < 1) {
    return 0;
  }
  if (2 < iVar2) {
    if (iVar2 == 4) {
      fVar1 = *(float *)(param_1[0x26] + 0x7c8);
      fVar3 = (float)(**(code **)(*param_1 + 0x300))(param_1);
      return (int)(fVar3 * fVar1);
    }
    if (iVar2 != 8) {
      return 0;
    }
  }
  return *(int *)((longlong)param_1 + 0x5bc);
}



int FUN_1402f9090(longlong *param_1)

{
  float fVar1;
  int iVar2;
  float fVar3;
  
  iVar2 = (**(code **)(*param_1 + 0xb0))();
  if (iVar2 < 1) {
    return 0;
  }
  if (2 < iVar2) {
    if (iVar2 == 4) {
      fVar1 = *(float *)(param_1[0x26] + 0x7cc);
      fVar3 = (float)(**(code **)(*param_1 + 0x300))(param_1);
      return (int)(fVar3 * fVar1);
    }
    if (iVar2 != 8) {
      return 0;
    }
  }
  return (int)param_1[0xb8];
}



undefined4 FUN_1402f9100(longlong *param_1)

{
  int iVar1;
  
  iVar1 = (**(code **)(*param_1 + 0xb0))();
  if (iVar1 < 1) {
    return 0;
  }
  if (2 < iVar1) {
    if (iVar1 == 4) {
      return *(undefined4 *)(param_1[0x26] + 0x7d8);
    }
    if (iVar1 != 8) {
      return 0;
    }
  }
  return *(undefined4 *)((longlong)param_1 + 0x5c4);
}



undefined4 FUN_1402f9160(longlong *param_1)

{
  int iVar1;
  
  iVar1 = (**(code **)(*param_1 + 0xb0))();
  if (iVar1 < 1) {
    return 0;
  }
  if (2 < iVar1) {
    if (iVar1 == 4) {
      return *(undefined4 *)(param_1[0x26] + 0x7e0);
    }
    if (iVar1 != 8) {
      return 0;
    }
  }
  return (int)param_1[0xb9];
}



float FUN_1402f91c0(longlong *param_1)

{
  int iVar1;
  
  iVar1 = (**(code **)(*param_1 + 0xb0))();
  if (iVar1 != 4) {
    return *(float *)(param_1 + 0x122) + *(float *)(param_1 + 0x102);
  }
  return *(float *)(param_1[0x26] + 0x7d4);
}



undefined8 FUN_1402f9210(longlong *param_1,float param_2,float param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  int iVar6;
  undefined4 extraout_XMM0_Da;
  undefined4 extraout_XMM0_Da_00;
  undefined4 extraout_XMM0_Db;
  undefined4 extraout_XMM0_Db_00;
  float fVar7;
  
  if (1.0 <= param_3) {
    return 0;
  }
  fVar7 = 0.0;
  iVar6 = (**(code **)(*param_1 + 0xb0))();
  if (iVar6 < 1) goto LAB_1402f92ce;
  if (2 < iVar6) {
    if (iVar6 == 4) {
      fVar7 = *(float *)(param_1 + 0xbc) + *(float *)((longlong)param_1 + 0x5dc) +
              *(float *)((longlong)param_1 + 0x5e4) + *(float *)(param_1 + 0x121) +
              *(float *)(param_1[0x26] + 2000);
      goto LAB_1402f92ce;
    }
    if (iVar6 != 8) goto LAB_1402f92ce;
  }
  fVar1 = *(float *)(param_1 + 0xbc);
  fVar2 = *(float *)((longlong)param_1 + 0x5dc);
  fVar3 = *(float *)((longlong)param_1 + 0x5e4);
  fVar4 = *(float *)(param_1[0x26] + 2000);
  fVar5 = *(float *)(param_1 + 0x121);
  fVar7 = (float)(**(code **)(*param_1 + 0x2f8))(param_1);
  fVar7 = fVar7 + fVar4 * 0.01 + fVar1 + fVar2 + fVar3 + fVar5 + param_2;
LAB_1402f92ce:
  FUN_140414fe0();
  if (((double)CONCAT44(extraout_XMM0_Db,extraout_XMM0_Da) <= (double)fVar7 &&
       (double)fVar7 != (double)CONCAT44(extraout_XMM0_Db,extraout_XMM0_Da)) &&
     (FUN_140414fe0(),
     (double)param_3 <= (double)CONCAT44(extraout_XMM0_Db_00,extraout_XMM0_Da_00) &&
     (double)CONCAT44(extraout_XMM0_Db_00,extraout_XMM0_Da_00) != (double)param_3)) {
    return 1;
  }
  return 0;
}



undefined8 FUN_1402f9360(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined1 auVar3 [16];
  undefined1 auVar4 [16];
  undefined8 extraout_XMM0_Qb;
  
  iVar1 = 1;
  if (0 < *(int *)(param_1 + 0x5d0) - *(int *)(param_1 + 0x5cc)) {
    iVar1 = rand();
    iVar1 = (int)((float)(*(int *)(param_1 + 0x5d0) - *(int *)(param_1 + 0x5cc)) *
                  (float)iVar1 * 3.0517578e-05 + (float)*(int *)(param_1 + 0x5cc));
  }
  uVar2 = FUN_1402f8580(param_1);
  auVar3._0_8_ = FUN_1402f7ba0(param_1,uVar2);
  auVar3._8_8_ = extraout_XMM0_Qb;
  auVar4._4_12_ = auVar3._4_12_;
  auVar4._0_4_ = (float)auVar3._0_8_ + (float)iVar1;
  return auVar4._0_8_;
}



undefined8 FUN_1402f93f0(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined1 auVar3 [16];
  undefined1 auVar4 [16];
  undefined8 extraout_XMM0_Qb;
  
  iVar1 = 1;
  if (0 < *(int *)(param_1 + 0x5d8) - *(int *)(param_1 + 0x5d4)) {
    iVar1 = rand();
    iVar1 = (int)((float)(*(int *)(param_1 + 0x5d8) - *(int *)(param_1 + 0x5d4)) *
                  (float)iVar1 * 3.0517578e-05 + (float)*(int *)(param_1 + 0x5d4));
  }
  uVar2 = FUN_1402f8580(param_1);
  auVar3._0_8_ = FUN_1402f7da0(param_1,uVar2);
  auVar3._8_8_ = extraout_XMM0_Qb;
  auVar4._4_12_ = auVar3._4_12_;
  auVar4._0_4_ = (float)auVar3._0_8_ + (float)iVar1;
  return auVar4._0_8_;
}



undefined8 FUN_1402f9480(longlong *param_1,undefined4 param_2)

{
  longlong lVar1;
  
  if ((param_1[0x16e] == 0) && ((int)param_1[0x1f8] == 0)) {
    lVar1 = FUN_1402f2de0(DAT_140608068);
    param_1[0x16e] = lVar1;
    (**(code **)(*param_1 + 0x510))(param_1,param_2);
    if (param_1[0x16e] != 0) {
      param_1[0x1f9] = (longlong)((double)*(float *)(param_1[0x16e] + 0x68) + (double)param_1[0xa2])
      ;
      return 1;
    }
  }
  return 0;
}



void FUN_1402f9510(longlong param_1)

{
  *(undefined8 *)(param_1 + 0xfc8) = 0;
  return;
}



undefined8 FUN_1402f9520(longlong param_1,undefined4 *param_2,undefined4 param_3)

{
  undefined4 uVar1;
  
  *(undefined4 *)(param_1 + 400) = *param_2;
  *(undefined4 *)(param_1 + 0x194) = param_2[1];
  uVar1 = param_2[2];
  *(undefined4 *)(param_1 + 0x538) = param_3;
  *(undefined4 *)(param_1 + 0x198) = uVar1;
  return CONCAT71((uint7)(uint3)((uint)uVar1 >> 8),1);
}



undefined4 FUN_1402f9550(longlong param_1)

{
  if (*(longlong *)(param_1 + 0xb78) != 0) {
    return *(undefined4 *)(*(longlong *)(param_1 + 0xb78) + 0x1f8);
  }
  return 0x3f800000;
}



void FUN_1402f9580(longlong param_1,undefined8 *param_2,float param_3)

{
  int iVar1;
  int *piVar2;
  
  piVar2 = (int *)*param_2;
  if (piVar2 != (int *)param_2[1]) {
    do {
      iVar1 = *piVar2;
      if (iVar1 == 3) {
        *(float *)(param_1 + 0x744) = param_3 + *(float *)(param_1 + 0x744);
      }
      else if (iVar1 == 4) {
        *(float *)(param_1 + 0x748) = param_3 + *(float *)(param_1 + 0x748);
      }
      else if (iVar1 == 5) {
        *(float *)(param_1 + 0x74c) = param_3 + *(float *)(param_1 + 0x74c);
      }
      else if (iVar1 == 6) {
        *(float *)(param_1 + 0x750) = param_3 + *(float *)(param_1 + 0x750);
      }
      piVar2 = piVar2 + 1;
    } while (piVar2 != (int *)param_2[1]);
  }
  if ((void *)*param_2 != (void *)0x0) {
    operator_delete((void *)*param_2);
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  return;
}



void FUN_1402f9630(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0xcd8) = param_2;
  *(undefined4 *)(param_1 + 0xcdc) = param_3;
  return;
}



int FUN_1402f9640(float param_1,float *param_2,float *param_3,char param_4,char param_5)

{
  undefined4 uVar1;
  int iVar2;
  float *pfVar3;
  longlong *in_RCX;
  longlong lVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  float local_38;
  int local_34;
  undefined4 local_30 [2];
  
  if (in_RCX[0x1b1] == 0) {
    return 0;
  }
  if (((((char)in_RCX[0xc0] == '\0') &&
       (param_1 = *param_3, param_1 == *(float *)((longlong)in_RCX + 0x123c))) &&
      (param_1 = param_3[1], param_1 == *(float *)(in_RCX + 0x248))) &&
     ((param_1 = param_3[2], param_1 == *(float *)((longlong)in_RCX + 0x1244) &&
      ((char)in_RCX[0x249] == param_4)))) {
    *param_2 = *(float *)(in_RCX + 0x247);
    *(undefined1 *)(in_RCX + 0x1fd) = 1;
    return 1;
  }
  iVar2 = 0;
  *param_2 = 0.0;
  local_30[0] = *(undefined4 *)((longlong)in_RCX + 0x524);
  local_34 = (int)in_RCX[0xa4];
  FUN_1402fa050(param_1,param_3);
  (**(code **)(*in_RCX + 0xb0))(in_RCX);
  uVar1 = (**(code **)(*in_RCX + 0x80))(in_RCX);
  lVar5 = in_RCX[0x1b1];
  *param_2 = -1e+07;
  if ((*(int *)(lVar5 + 0xb8) == 0) ||
     (iVar2 = FUN_1402be1a0(lVar5,param_2,local_30,&local_34,param_3,uVar1), iVar2 != 1)) {
    *param_2 = param_3[1];
    return iVar2;
  }
  local_38 = -1e+07;
  FUN_1402be8a0(lVar5,&local_38,param_3,in_RCX + 0x1b2,in_RCX + 0x1b4);
  pfVar3 = &local_38;
  if (local_38 < *param_2 || local_38 == *param_2) {
    pfVar3 = param_2;
  }
  fVar7 = *pfVar3;
  lVar5 = (longlong)local_34;
  *param_2 = fVar7;
  iVar2 = local_34;
  if (((((char)in_RCX[0xc0] == '\0') && (*(longlong *)(in_RCX[0x1b1] + 0xc0) != 0)) &&
      (lVar4 = *(longlong *)(in_RCX[0x1b1] + 0xc0),
      local_34 < (int)(*(longlong *)(lVar4 + 0x98) - *(longlong *)(lVar4 + 0x90) >> 3))) &&
     ((-1 < local_34 && (lVar4 = *(longlong *)(*(longlong *)(lVar4 + 0x90) + lVar5 * 8), lVar4 != 0)
      ))) {
    fVar6 = (float)FUN_1402f8f10(in_RCX);
    iVar2 = (int)lVar5;
    if ((*(float *)(lVar4 + 0xec) <= fVar6) ||
       ((*(char *)(lVar4 + 0x100) == '\0' ||
        (fVar7 < *(float *)((longlong)in_RCX + 0x17c) ||
         fVar7 == *(float *)((longlong)in_RCX + 0x17c))))) goto LAB_1402f981d;
LAB_1402f9837:
    iVar2 = 2;
  }
  else {
LAB_1402f981d:
    if (param_4 != '\0') {
      fVar7 = fVar7 - *(float *)((longlong)in_RCX + 0x17c);
      fVar6 = (float)FUN_1402f8f10(in_RCX);
      if (fVar6 < fVar7) goto LAB_1402f9837;
    }
    if (param_5 == '\x01') {
      *(int *)(in_RCX + 0xa4) = iVar2;
      *(undefined4 *)((longlong)in_RCX + 0x524) = local_30[0];
      *(float *)(in_RCX + 0x247) = *param_2;
      *(float *)((longlong)in_RCX + 0x123c) = *param_3;
      *(float *)(in_RCX + 0x248) = param_3[1];
      fVar7 = param_3[2];
      *(char *)(in_RCX + 0x249) = param_4;
      *(float *)((longlong)in_RCX + 0x1244) = fVar7;
      *(undefined1 *)(in_RCX + 0x1fd) = 0;
    }
    iVar2 = 1;
  }
  return iVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1402f98b0(longlong *param_1,float *param_2,float *param_3,float *param_4,
                       float *param_5,int *param_6,char param_7,float param_8)

{
  undefined4 uVar1;
  uint uVar2;
  float *pfVar3;
  ulonglong uVar4;
  longlong lVar5;
  int iVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  undefined1 auStack_128 [32];
  float *local_108;
  undefined4 local_100;
  float local_f8;
  int local_f4;
  float local_f0 [2];
  float local_e8;
  undefined8 local_e0;
  float local_d8;
  float local_d0;
  float fStack_cc;
  float local_c8;
  float local_c0 [2];
  int *local_b8;
  float *local_b0;
  float local_a8;
  float local_a4;
  float local_a0;
  ulonglong local_98;
  
  local_98 = DAT_1405d84f0 ^ (ulonglong)auStack_128;
  local_b0 = param_5;
  local_b8 = param_6;
  if (param_1[0x1b1] == 0) {
    return 0;
  }
  fVar9 = param_3[1];
  local_a8 = *param_4 - *param_3;
  local_a0 = param_4[2] - param_3[2];
  fVar7 = param_4[1] - fVar9;
  fVar10 = local_a8 * local_a8 + fVar7 * fVar7 + local_a0 * local_a0;
  local_e8 = (float)(0x5f3759df - ((int)fVar10 >> 1));
  fVar7 = local_e8 * (1.5 - local_e8 * local_e8 * fVar10 * 0.5);
  fVar10 = (1.5 - fVar7 * fVar7 * fVar10 * 0.5) * fVar7 * fVar10;
  if (param_8 < fVar10) {
    return 0;
  }
  local_a4 = param_4[1] - fVar9;
  D3DXVec3Normalize(&local_a8,&local_a8);
  local_f8 = *(float *)((longlong)param_1 + 0x524);
  fVar7 = 40.0;
  local_a8 = local_a8 * 40.0;
  local_a4 = local_a4 * 40.0;
  local_e8 = (float)param_1[0xa4];
  local_d8 = param_3[2];
  local_a0 = local_a0 * 40.0;
  local_e0 = *(undefined8 *)param_3;
  fStack_cc = local_a4 + param_3[1];
  local_c8 = local_a0 + param_3[2];
  local_d0 = local_a8 + *param_3;
  if (40.0 < fVar10) {
    do {
      fVar9 = local_d8;
      iVar6 = local_f4;
      FUN_1402fa050(param_1,&local_d0);
      (**(code **)(*param_1 + 0xb0))(param_1);
      uVar1 = (**(code **)(*param_1 + 0x80))(param_1);
      lVar5 = param_1[0x1b1];
      local_f0[0] = -1e+07;
      if (*(int *)(lVar5 + 0xb8) == 0) {
        uVar4 = 0;
        local_f4 = iVar6;
LAB_1402f9c4b:
        *param_2 = (float)local_e0;
        param_2[1] = local_e0._4_4_;
        param_2[2] = fVar9;
        if (((*param_3 == (float)local_e0) && (param_3[1] == local_e0._4_4_)) &&
           (param_3[2] == local_d8)) goto LAB_1402f9ec6;
        if (((((char)param_1[0xc0] == '\0') && (*(longlong *)(param_1[0x1b1] + 0xc0) != 0)) &&
            ((lVar5 = *(longlong *)(param_1[0x1b1] + 0xc0),
             local_f4 < (int)(*(longlong *)(lVar5 + 0x98) - *(longlong *)(lVar5 + 0x90) >> 3) &&
             ((-1 < local_f4 &&
              (lVar5 = *(longlong *)(*(longlong *)(lVar5 + 0x90) + (longlong)local_f4 * 8),
              lVar5 != 0)))))) &&
           ((fVar9 = (float)FUN_1402f8f10(param_1), fVar9 < *(float *)(lVar5 + 0xec) &&
            ((*(char *)(lVar5 + 0x100) != '\0' &&
             (param_3[1] <= fStack_cc && fStack_cc != param_3[1])))))) goto LAB_1402f9eb9;
        if (param_7 != '\0') {
          if ((param_1[0x16e] == 0) || ((int)param_1[0x1f8] == 0)) {
            if (param_1[0x26] == 0) {
              fVar9 = 0.0;
            }
            else {
              fVar9 = *(float *)(param_1[0x26] + 0x2a0);
            }
          }
          else {
            fVar9 = *(float *)(param_1[0x16e] + 0xa8);
          }
          if (fVar9 < fStack_cc - param_3[1]) goto LAB_1402f9eb9;
        }
        *local_b0 = local_f8;
        *local_b8 = (int)local_e8;
        goto LAB_1402f9ef7;
      }
      local_108 = &local_d0;
      local_100 = uVar1;
      uVar2 = FUN_1402be1a0(lVar5,local_f0,local_c0,&local_f4);
      uVar4 = (ulonglong)uVar2;
      if (uVar2 != 1) goto LAB_1402f9c4b;
      local_108 = (float *)(param_1 + 0x1b4);
      local_f8 = -1e+07;
      FUN_1402be8a0(lVar5,&local_f8,&local_d0,param_1 + 0x1b2);
      pfVar3 = &local_f8;
      if (local_f8 <= local_f0[0]) {
        pfVar3 = local_f0;
      }
      fVar9 = *pfVar3;
      local_d8 = local_c8;
      local_e8 = (float)local_f4;
      fVar8 = local_d0 + local_a8;
      fVar7 = fVar7 + 40.0;
      local_c8 = local_c8 + local_a0;
      local_e0 = CONCAT44(fVar9,local_d0);
      local_f8 = local_c0[0];
      fStack_cc = local_a4 + fVar9;
      local_d0 = fVar8;
    } while (fVar7 < fVar10);
  }
  iVar6 = local_f4;
  local_e0._0_4_ = *param_4;
  local_d8 = param_4[2];
  local_e0._4_4_ = fVar9;
  FUN_1402fa050(param_1,&local_e0);
  (**(code **)(*param_1 + 0xb0))(param_1);
  uVar1 = (**(code **)(*param_1 + 0x80))(param_1);
  lVar5 = param_1[0x1b1];
  local_f0[0] = -1e+07;
  if (*(int *)(lVar5 + 0xb8) == 0) {
    uVar4 = 0;
    fVar9 = local_e0._4_4_;
  }
  else {
    local_108 = (float *)&local_e0;
    local_100 = uVar1;
    uVar2 = FUN_1402be1a0(lVar5,local_f0,local_c0,&local_f4);
    uVar4 = (ulonglong)uVar2;
    fVar9 = local_e0._4_4_;
    iVar6 = local_f4;
    if (uVar2 == 1) {
      local_108 = (float *)(param_1 + 0x1b4);
      local_f8 = -1e+07;
      FUN_1402be8a0(lVar5,&local_f8,&local_e0,param_1 + 0x1b2);
      pfVar3 = &local_f8;
      if (local_f8 <= local_f0[0]) {
        pfVar3 = local_f0;
      }
      uVar4 = 1;
      fVar9 = *pfVar3;
      iVar6 = local_f4;
    }
  }
  if ((((((char)param_1[0xc0] != '\0') || (*(longlong *)(param_1[0x1b1] + 0xc0) == 0)) ||
       (iVar6 < 0)) ||
      ((lVar5 = *(longlong *)(param_1[0x1b1] + 0xc0),
       (int)(*(longlong *)(lVar5 + 0x98) - *(longlong *)(lVar5 + 0x90) >> 3) <= iVar6 ||
       (lVar5 = *(longlong *)(*(longlong *)(lVar5 + 0x90) + (longlong)iVar6 * 8), lVar5 == 0)))) ||
     ((fVar7 = (float)FUN_1402f8f10(param_1), *(float *)(lVar5 + 0xec) <= fVar7 ||
      ((*(char *)(lVar5 + 0x100) == '\0' || (fVar9 < param_3[1] || fVar9 == param_3[1])))))) {
    if (param_7 != '\0') {
      if ((param_1[0x16e] == 0) || ((int)param_1[0x1f8] == 0)) {
        if (param_1[0x26] == 0) {
          fVar7 = 0.0;
        }
        else {
          fVar7 = *(float *)(param_1[0x26] + 0x2a0);
        }
      }
      else {
        fVar7 = *(float *)(param_1[0x16e] + 0xa8);
      }
      if (fVar7 < fVar9 - param_3[1]) goto LAB_1402f9eb9;
    }
    if ((int)uVar4 == 1) {
      *param_2 = *param_4;
      param_2[1] = param_4[1];
      param_2[2] = param_4[2];
      param_2[1] = fVar9;
      *local_b0 = local_c0[0];
      *local_b8 = iVar6;
LAB_1402f9ef7:
      uVar4 = 1;
    }
    else {
LAB_1402f9ec6:
      uVar4 = uVar4 & 0xffffffff;
    }
  }
  else {
LAB_1402f9eb9:
    uVar4 = 2;
  }
  return uVar4;
}



ulonglong FUN_1402f9f60(longlong *param_1,float *param_2,undefined8 param_3)

{
  longlong lVar1;
  byte bVar2;
  ulonglong uVar3;
  float fVar4;
  float local_38 [8];
  
  uVar3 = (**(code **)(*param_1 + 0x568))();
  if ((char)uVar3 == '\x01') {
    return uVar3 & 0xffffffffffffff00;
  }
  *param_2 = 0.0;
  FUN_1402fa1d0(param_1,param_3);
  lVar1 = param_1[0x1b1];
  fVar4 = 0.0;
  local_38[0] = 0.0;
  if ((int)(*(longlong *)(lVar1 + 0x10) - *(longlong *)(lVar1 + 8) >> 4) == 0) {
    return 0;
  }
  bVar2 = FUN_1402bdda0(lVar1,local_38,param_3,param_1 + 0x1b2,(longlong)param_1 + 0xe04);
  if (bVar2 != 0) {
    if ((param_1[0x16e] == 0) || ((int)param_1[0x1f8] == 0)) {
      if (param_1[0x26] != 0) {
        fVar4 = *(float *)(param_1[0x26] + 0x294);
      }
    }
    else {
      fVar4 = *(float *)(param_1[0x16e] + 0x9c);
    }
    *param_2 = local_38[0] - fVar4;
  }
  return (ulonglong)bVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402fa050(longlong param_1,undefined4 *param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  float *pfVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float local_28;
  float local_24 [9];
  
  lVar2 = *(longlong *)(param_1 + 0x130);
  if (lVar2 != 0) {
    lVar3 = *(longlong *)(param_1 + 0xb70);
    if ((lVar3 == 0) || (*(int *)(param_1 + 0xfc0) == 0)) {
      fVar6 = *(float *)(lVar2 + 0x294);
    }
    else {
      fVar6 = *(float *)(lVar3 + 0x9c);
    }
    local_28 = *(float *)(lVar2 + 0x2a8);
    local_24[0] = fVar6 * 0.5;
    pfVar4 = local_24;
    if (fVar6 * 0.5 <= *(float *)(lVar2 + 0x2a8)) {
      pfVar4 = &local_28;
    }
    fVar6 = *pfVar4;
    if ((lVar3 == 0) || (*(int *)(param_1 + 0xfc0) == 0)) {
      fVar7 = *(float *)(lVar2 + 0x294);
    }
    else {
      fVar7 = *(float *)(lVar3 + 0x9c);
    }
    fVar5 = (float)param_2[1];
    uVar1 = param_2[2];
    *(undefined4 *)(param_1 + 0xd90) = *param_2;
    *(float *)(param_1 + 0xd94) = fVar7 * 0.5 + fVar5;
    *(undefined4 *)(param_1 + 0xd98) = uVar1;
    *(float *)(param_1 + 0xd9c) = fVar6 + 150.0;
    uVar1 = param_2[2];
    if ((lVar3 == 0) || (*(int *)(param_1 + 0xfc0) == 0)) {
      fVar6 = *(float *)(lVar2 + 0x294);
    }
    else {
      fVar6 = *(float *)(lVar3 + 0x9c);
    }
    fVar7 = (float)param_2[1];
    *(undefined4 *)(param_1 + 0xda0) = *param_2;
    fVar5 = fVar7 - 150.0;
    *(float *)(param_1 + 0xda4) = ((fVar7 + fVar6) - fVar5) * 0.5 + fVar5;
    *(undefined4 *)(param_1 + 0xda8) = uVar1;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402fa1d0(longlong param_1,undefined4 *param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  
  lVar2 = *(longlong *)(param_1 + 0xb70);
  fVar5 = 0.0;
  if ((lVar2 == 0) || (*(int *)(param_1 + 0xfc0) == 0)) {
    if (*(longlong *)(param_1 + 0x130) == 0) {
      fVar4 = 0.0;
    }
    else {
      fVar4 = *(float *)(*(longlong *)(param_1 + 0x130) + 0x294);
    }
  }
  else {
    fVar4 = *(float *)(lVar2 + 0x9c);
  }
  uVar1 = param_2[2];
  fVar3 = (float)param_2[1];
  *(undefined4 *)(param_1 + 0xd90) = *param_2;
  *(float *)(param_1 + 0xd94) = fVar4 * 0.5 + fVar3;
  *(undefined4 *)(param_1 + 0xd98) = uVar1;
  uVar1 = param_2[2];
  if ((lVar2 == 0) || (*(int *)(param_1 + 0xfc0) == 0)) {
    if (*(longlong *)(param_1 + 0x130) != 0) {
      fVar5 = *(float *)(*(longlong *)(param_1 + 0x130) + 0x294);
    }
  }
  else {
    fVar5 = *(float *)(lVar2 + 0x9c);
  }
  fVar4 = (float)param_2[1];
  *(undefined4 *)(param_1 + 0xe04) = *param_2;
  fVar3 = (fVar5 + fVar4) - 70.0;
  *(float *)(param_1 + 0xe08) = ((fVar5 + fVar4) - fVar3) * 0.5 + fVar3;
  *(undefined4 *)(param_1 + 0xe0c) = uVar1;
  return;
}



undefined8 FUN_1402fa300(longlong param_1)

{
  int iVar1;
  int iVar2;
  float fVar3;
  float fVar4;
  undefined4 local_res8 [2];
  float local_58;
  undefined4 local_54;
  float local_50;
  float local_48;
  undefined4 local_44;
  float local_40;
  float local_38;
  undefined4 local_34;
  float local_30;
  float local_28;
  undefined4 local_24;
  float local_20;
  
  local_58 = *(float *)(param_1 + 0x178);
  local_54 = *(undefined4 *)(param_1 + 0x17c);
  local_res8[0] = 0;
  local_50 = *(float *)(param_1 + 0x180);
  local_48 = *(float *)(param_1 + 0x178);
  iVar2 = 0;
  local_44 = *(undefined4 *)(param_1 + 0x17c);
  local_40 = *(float *)(param_1 + 0x180);
  local_38 = *(float *)(param_1 + 0x178);
  local_34 = *(undefined4 *)(param_1 + 0x17c);
  local_30 = *(float *)(param_1 + 0x180);
  local_28 = *(float *)(param_1 + 0x178);
  local_24 = *(undefined4 *)(param_1 + 0x17c);
  local_20 = *(float *)(param_1 + 0x180);
  while ((((iVar1 = FUN_1402f9640(param_1,local_res8,&local_28,0,1), fVar3 = local_28,
           fVar4 = local_20, iVar1 != 1 &&
           (iVar1 = FUN_1402f9640(param_1,local_res8,&local_38,0,1), fVar3 = local_38,
           fVar4 = local_30, iVar1 != 1)) &&
          (iVar1 = FUN_1402f9640(param_1,local_res8,&local_48,0,1), fVar3 = local_48,
          fVar4 = local_40, iVar1 != 1)) &&
         (iVar1 = FUN_1402f9640(param_1,local_res8,&local_58,0,1), fVar3 = local_58,
         fVar4 = local_50, iVar1 != 1))) {
    iVar2 = iVar2 + 1;
    local_28 = local_28 - 10.0;
    local_38 = local_38 + 10.0;
    local_40 = local_40 - 10.0;
    local_50 = local_50 + 10.0;
    if (99 < iVar2) {
      return 0;
    }
  }
  *(float *)(param_1 + 0x180) = fVar4;
  *(float *)(param_1 + 0x178) = fVar3;
  return 1;
}



void FUN_1402fa4c0(longlong *param_1,longlong param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  
  param_1[0x1b1] = param_2;
  if (param_2 != 0) {
    lVar2 = *(longlong *)(param_2 + 0xc0);
    param_1[1] = lVar2;
    param_1[2] = 0;
    param_1[5] = 0;
    *(undefined4 *)((longlong)param_1 + 0x24) = 0;
    if (lVar2 != 0) {
      uVar1 = (**(code **)(*param_1 + 0x50))(param_1);
      lVar2 = FUN_1402bf6b0(param_1[1],uVar1);
      param_1[2] = lVar2;
    }
  }
  return;
}



undefined8 FUN_1402fa520(longlong *param_1,longlong param_2)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  int iVar4;
  longlong lVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  
  if ((int)param_1[0x19c] != 0) {
    return 1;
  }
  if (param_2 != 0) {
    fVar7 = *(float *)(param_2 + 0x178) - *(float *)(param_1 + 0x2f);
    fVar6 = *(float *)(param_2 + 0x180) - *(float *)(param_1 + 0x30);
    iVar4 = 0;
    lVar5 = 0;
    fVar8 = *(float *)(param_2 + 0x17c) - *(float *)((longlong)param_1 + 0x17c);
    lVar2 = param_1[0x17f];
    fVar6 = fVar8 * fVar8 + fVar7 * fVar7 + fVar6 * fVar6;
    if (0 < (int)(*(longlong *)(lVar2 + 0x38) - *(longlong *)(lVar2 + 0x30) >> 4)) {
      lVar3 = 0;
      do {
        if ((lVar5 < 0) ||
           ((int)(*(longlong *)(lVar2 + 0x38) - *(longlong *)(lVar2 + 0x30) >> 4) <= iVar4)) {
          lVar2 = 0;
        }
        else {
          lVar2 = *(longlong *)(*(longlong *)(lVar2 + 0x30) + lVar3);
        }
        cVar1 = (**(code **)(*param_1 + 0x490))(param_1,*(undefined4 *)(lVar2 + 8));
        if (((cVar1 != '\0') && (*(float *)(lVar2 + 0x14) * *(float *)(lVar2 + 0x14) <= fVar6)) &&
           (fVar6 <= *(float *)(lVar2 + 0x18) * *(float *)(lVar2 + 0x18))) {
          return 1;
        }
        lVar2 = param_1[0x17f];
        iVar4 = iVar4 + 1;
        lVar5 = lVar5 + 1;
        lVar3 = lVar3 + 0x10;
      } while (iVar4 < (int)(*(longlong *)(lVar2 + 0x38) - *(longlong *)(lVar2 + 0x30) >> 4));
    }
    return 0;
  }
  return 0;
}



undefined8 FUN_1402fa660(longlong *param_1)

{
  longlong lVar1;
  int *piVar2;
  int iVar3;
  
  lVar1 = param_1[0x189];
  if (lVar1 != 0) {
    iVar3 = 0;
    if (*(longlong *)(lVar1 + 0x30) != 0) {
      for (piVar2 = *(int **)(*(longlong *)(lVar1 + 0x30) +
                             (4U % (ulonglong)*(uint *)(lVar1 + 0x40)) * 8); piVar2 != (int *)0x0;
          piVar2 = *(int **)(piVar2 + 6)) {
        if ((piVar2[8] == 4) && (*piVar2 == 4)) {
          if (piVar2 != (int *)0x0) {
            iVar3 = *(int *)(*(longlong *)(piVar2 + 2) + 8);
          }
          break;
        }
      }
    }
    if (-iVar3 <= (int)param_1[0xb5]) {
      (**(code **)(*param_1 + 0x2a8))(param_1,4);
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return 1;
    }
  }
  return 0;
}



undefined8 FUN_1402fa700(longlong *param_1)

{
  int *piVar1;
  longlong lVar2;
  int iVar3;
  
  lVar2 = (**(code **)(*param_1 + 0x170))();
  if ((lVar2 == 0) && (lVar2 = param_1[0x189], lVar2 != 0)) {
    iVar3 = 0;
    if (*(longlong *)(lVar2 + 0x30) != 0) {
      for (piVar1 = *(int **)(*(longlong *)(lVar2 + 0x30) +
                             (5U % (ulonglong)*(uint *)(lVar2 + 0x40)) * 8); piVar1 != (int *)0x0;
          piVar1 = *(int **)(piVar1 + 6)) {
        if ((piVar1[8] == 5) && (*piVar1 == 5)) {
          if (piVar1 != (int *)0x0) {
            iVar3 = *(int *)(*(longlong *)(piVar1 + 2) + 8);
          }
          break;
        }
      }
    }
    if (-iVar3 <= (int)param_1[0xb5]) {
      (**(code **)(*param_1 + 0x2a8))(param_1,5);
      (**(code **)(*param_1 + 0xd0))(param_1,0,0);
      return 1;
    }
  }
  return 0;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_1402fa7c0(void)

{
  if ((DAT_14060939c & 1) == 0) {
    DAT_14060939c = DAT_14060939c | 1;
    _DAT_140609390 = 0;
    _DAT_140609394 = 0;
    _DAT_140609398 = 0;
  }
  return &DAT_140609390;
}



void FUN_1402fa800(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_140051700(param_1 + 0xf48,param_2,param_3,param_4,uVar8,lVar9,uVar10);
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_1402fa8f0(longlong param_1,ulonglong *param_2)

{
  longlong *plVar1;
  ulonglong *puVar2;
  ulonglong *puVar3;
  ulonglong *puVar4;
  int iVar5;
  ulonglong *puVar6;
  longlong lVar7;
  longlong lVar8;
  bool bVar9;
  bool bVar10;
  
  lVar7 = 0;
  bVar10 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar8 = *plVar1;
      lVar7 = 0;
      if (lVar8 != 0) {
        if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
          iVar5 = DAT_1406080a8 + 1;
          bVar10 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar5;
          if (bVar10) {
            FUN_140176d60(1);
          }
          lVar8 = 0;
        }
        FUN_14034ed40(lVar8);
        bVar10 = true;
        lVar7 = lVar8;
      }
    }
    else {
      iVar5 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar5;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  puVar2 = *(ulonglong **)(param_1 + 0xf50);
  for (puVar6 = *(ulonglong **)(param_1 + 0xf48); puVar6 != puVar2; puVar6 = puVar6 + 2) {
    bVar9 = *puVar6 < *param_2;
    if ((*puVar6 == *param_2) && (bVar9 = puVar6[1] < param_2[1], puVar6[1] == param_2[1])) {
      iVar5 = 0;
    }
    else {
      iVar5 = (1 - (uint)bVar9) - (uint)(bVar9 != 0);
    }
    puVar4 = puVar6;
    if (iVar5 == 0) goto joined_r0x0001402fa9d7;
  }
LAB_1402faa11:
  if (bVar10) {
    FUN_14034edd0(lVar7);
  }
  return;
joined_r0x0001402fa9d7:
  while (puVar3 = puVar4 + 2, puVar3 != puVar2) {
    *(int *)puVar6 = (int)*puVar3;
    *(undefined4 *)((longlong)puVar6 + 4) = *(undefined4 *)((longlong)puVar4 + 0x14);
    *(int *)(puVar6 + 1) = (int)puVar3[1];
    *(undefined4 *)((longlong)puVar6 + 0xc) = *(undefined4 *)((longlong)puVar4 + 0x1c);
    puVar6 = puVar6 + 2;
    puVar4 = puVar3;
  }
  *(longlong *)(param_1 + 0xf50) = *(longlong *)(param_1 + 0xf50) + -0x10;
  goto LAB_1402faa11;
}



void FUN_1402faa40(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0xfa8) = param_2;
  return;
}



void FUN_1402faa50(longlong param_1,undefined4 *param_2)

{
  *(undefined4 *)(param_1 + 0xfb0) = *param_2;
  *(undefined4 *)(param_1 + 0xfb4) = param_2[1];
  *(undefined4 *)(param_1 + 0xfb8) = param_2[2];
  *(undefined4 *)(param_1 + 0xfbc) = param_2[3];
  return;
}



void FUN_1402faa80(longlong param_1,undefined4 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  undefined4 local_res10 [2];
  undefined8 uVar8;
  longlong lVar9;
  undefined1 uVar10;
  
  uVar8 = 0xfffffffffffffffe;
  lVar3 = 0;
  lVar9 = 0;
  bVar7 = false;
  uVar10 = 0;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  local_res10[0] = param_2;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        lVar9 = lVar4;
        FUN_14034ed40(lVar4);
        bVar7 = true;
        uVar10 = 1;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_14008e4d0(param_1 + 0xf88,local_res10,param_3,param_4,uVar8,lVar9,uVar10);
  if (bVar7) {
    FUN_14034edd0(lVar5);
  }
  return;
}



void FUN_1402fab60(longlong param_1,int param_2)

{
  longlong *plVar1;
  int iVar2;
  int *_Dst;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  bool bVar7;
  
  lVar3 = 0;
  bVar7 = false;
  plVar1 = *(longlong **)(param_1 + 0x12e8);
  lVar5 = lVar3;
  if (plVar1 != (longlong *)0x0) {
    if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
      lVar4 = *plVar1;
      lVar5 = 0;
      if (lVar4 != 0) {
        if ((plVar1 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar7 = DAT_1406080a8 == 0, lVar4 = lVar3,
           DAT_1406080a8 = iVar2, bVar7)) {
          FUN_140176d60(1);
        }
        FUN_14034ed40(lVar4);
        bVar7 = true;
        lVar5 = lVar4;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar6 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar6) {
        FUN_140176d60(1);
      }
    }
  }
  _Dst = *(int **)(param_1 + 0xf88);
  do {
    if (_Dst == *(int **)(param_1 + 0xf90)) {
LAB_1402fac3f:
      if (bVar7) {
        FUN_14034edd0(lVar5);
      }
      return;
    }
    if (*_Dst == param_2) {
      memmove(_Dst,_Dst + 1,
              (longlong)*(int **)(param_1 + 0xf90) - (longlong)(_Dst + 1) & 0xfffffffffffffffc);
      *(longlong *)(param_1 + 0xf90) = *(longlong *)(param_1 + 0xf90) + -4;
      goto LAB_1402fac3f;
    }
    _Dst = _Dst + 1;
  } while( true );
}



void FUN_1402fac70(longlong param_1,double param_2,undefined8 param_3,undefined4 param_4)

{
  longlong *plVar1;
  float *pfVar2;
  int *_Dst;
  int iVar3;
  float *pfVar4;
  undefined8 in_RDX;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  bool bVar8;
  float fVar9;
  float local_res8 [2];
  float local_res18 [4];
  
  if (*(char *)(param_1 + 0x1230) == '\0') {
    lVar5 = 0;
    bVar8 = false;
    plVar1 = *(longlong **)(param_1 + 0x12e8);
    if (plVar1 != (longlong *)0x0) {
      if (plVar1 == *(longlong **)(param_1 + 0x12f0)) {
        lVar6 = *plVar1;
        lVar5 = 0;
        if (lVar6 != 0) {
          if (plVar1 != *(longlong **)(param_1 + 0x12f0)) {
            iVar3 = DAT_1406080a8 + 1;
            bVar8 = DAT_1406080a8 == 0;
            DAT_1406080a8 = iVar3;
            if (bVar8) {
              FUN_140176d60(1,lVar6,param_3,param_4,0xfffffffffffffffe);
            }
            lVar6 = 0;
          }
          FUN_14034ed40(lVar6);
          bVar8 = true;
          lVar5 = lVar6;
        }
      }
      else {
        iVar3 = DAT_1406080a8 + 1;
        bVar7 = DAT_1406080a8 == 0;
        DAT_1406080a8 = iVar3;
        if (bVar7) {
          FUN_140176d60(1,in_RDX,param_3,param_4,0xfffffffffffffffe);
        }
      }
    }
    if (((*(longlong *)(param_1 + 0x11c0) != *(longlong *)(param_1 + 0x11c8)) ||
        (*(longlong *)(param_1 + 0x11e0) != *(longlong *)(param_1 + 0x11e8))) ||
       (*(longlong *)(param_1 + 0x1200) != *(longlong *)(param_1 + 0x1208))) {
      *(undefined1 *)(param_1 + 0x10c8) = 1;
    }
    pfVar2 = *(float **)(param_1 + 0x11c0);
    if (pfVar2 != *(float **)(param_1 + 0x11c8)) {
      local_res18[0] = 0.0;
      do {
        fVar9 = *pfVar2 + *(float *)(param_1 + 0x598);
        *(float *)(param_1 + 0x598) = fVar9;
        local_res8[0] =
             ((float)(*(int *)(param_1 + 0x618) + *(int *)(param_1 + 0x8b0)) +
             *(float *)(param_1 + 0x59c)) *
             (*(float *)(param_1 + 0x8ec) + *(float *)(param_1 + 0x734) + 1.0 + 0.0001) +
             (float)*(int *)(param_1 + 0x868) + (float)*(int *)(param_1 + 0x88c);
        pfVar4 = (float *)(param_1 + 0x598);
        if (local_res8[0] <= fVar9) {
          pfVar4 = local_res8;
        }
        *(float *)(param_1 + 0x598) = *pfVar4;
        pfVar4 = local_res18;
        if (0.0 < *(float *)(param_1 + 0x598) || *(float *)(param_1 + 0x598) == 0.0) {
          pfVar4 = (float *)(param_1 + 0x598);
        }
        *(float *)(param_1 + 0x598) = *pfVar4;
        memmove(pfVar2,pfVar2 + 1,
                *(longlong *)(param_1 + 0x11c8) - (longlong)(pfVar2 + 1) & 0xfffffffffffffffc);
        *(longlong *)(param_1 + 0x11c8) = *(longlong *)(param_1 + 0x11c8) + -4;
      } while (pfVar2 != *(float **)(param_1 + 0x11c8));
    }
    pfVar2 = *(float **)(param_1 + 0x11e0);
    if (pfVar2 != *(float **)(param_1 + 0x11e8)) {
      local_res18[0] = 0.0;
      do {
        fVar9 = *pfVar2 + *(float *)(param_1 + 0x5a0);
        *(float *)(param_1 + 0x5a0) = fVar9;
        local_res8[0] =
             (*(float *)(param_1 + 0x738) + *(float *)(param_1 + 0x8f0) + 1.0 + 0.0001) *
             ((float)(*(int *)(param_1 + 0x61c) + *(int *)(param_1 + 0x8b4)) +
             *(float *)(param_1 + 0x5a4)) + (float)*(int *)(param_1 + 0x86c) +
             (float)*(int *)(param_1 + 0x890);
        pfVar4 = (float *)(param_1 + 0x5a0);
        if (local_res8[0] <= fVar9) {
          pfVar4 = local_res8;
        }
        *(float *)(param_1 + 0x5a0) = *pfVar4;
        pfVar4 = local_res18;
        if (0.0 < *(float *)(param_1 + 0x5a0) || *(float *)(param_1 + 0x5a0) == 0.0) {
          pfVar4 = (float *)(param_1 + 0x5a0);
        }
        *(float *)(param_1 + 0x5a0) = *pfVar4;
        memmove(pfVar2,pfVar2 + 1,
                *(longlong *)(param_1 + 0x11e8) - (longlong)(pfVar2 + 1) & 0xfffffffffffffffc);
        *(longlong *)(param_1 + 0x11e8) = *(longlong *)(param_1 + 0x11e8) + -4;
      } while (pfVar2 != *(float **)(param_1 + 0x11e8));
    }
    _Dst = *(int **)(param_1 + 0x1200);
    if (_Dst != *(int **)(param_1 + 0x1208)) {
      local_res18[0] = 0.0;
      pfVar2 = (float *)(param_1 + 0x5a8);
      do {
        *pfVar2 = (float)((int)*pfVar2 + *_Dst);
        local_res8[0] = *(float *)(param_1 + 0x5ac);
        pfVar4 = local_res8;
        if ((int)*pfVar2 < (int)*(float *)(param_1 + 0x5ac)) {
          pfVar4 = pfVar2;
        }
        fVar9 = *pfVar4;
        *pfVar2 = fVar9;
        pfVar4 = local_res18;
        if (-1 < (int)fVar9) {
          pfVar4 = pfVar2;
        }
        *pfVar2 = *pfVar4;
        memmove(_Dst,_Dst + 1,
                *(longlong *)(param_1 + 0x1208) - (longlong)(_Dst + 1) & 0xfffffffffffffffc);
        *(longlong *)(param_1 + 0x1208) = *(longlong *)(param_1 + 0x1208) + -4;
      } while (_Dst != *(int **)(param_1 + 0x1208));
    }
    if (bVar8) {
      FUN_14034edd0(lVar5);
    }
  }
  else {
    param_2 = param_2 - *(double *)(param_1 + 0x1228);
    if (*(double *)(param_1 + 0x1220) <= param_2 && param_2 != *(double *)(param_1 + 0x1220)) {
      *(undefined1 *)(param_1 + 0x1230) = 0;
    }
  }
  return;
}



void FUN_1402fb060(longlong param_1)

{
  float fVar1;
  float fVar2;
  
  fVar1 = 1.0;
  fVar2 = 0.0001;
  if (((float)(*(int *)(param_1 + 0x8b4) + *(int *)(param_1 + 0x61c)) + *(float *)(param_1 + 0x5a4))
      * (*(float *)(param_1 + 0x8f0) + *(float *)(param_1 + 0x738) + 1.0 + 0.0001) +
      (float)*(int *)(param_1 + 0x86c) + (float)*(int *)(param_1 + 0x890) <
      *(float *)(param_1 + 0x5a0)) {
    FUN_1402f8960();
  }
  if (((float)(*(int *)(param_1 + 0x8b0) + *(int *)(param_1 + 0x618)) + *(float *)(param_1 + 0x59c))
      * (*(float *)(param_1 + 0x8ec) + *(float *)(param_1 + 0x734) + fVar1 + fVar2) +
      (float)*(int *)(param_1 + 0x868) + (float)*(int *)(param_1 + 0x88c) <
      *(float *)(param_1 + 0x598)) {
    FUN_1402f88a0();
  }
  return;
}



void FUN_1402fb150(longlong param_1,undefined8 param_2)

{
  *(undefined8 *)(param_1 + 0x510) = param_2;
  FUN_1402fac70();
  return;
}



void FUN_1402fb160(longlong *param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  
  lVar1 = param_1[0x24];
  uVar2 = (**(code **)(*param_1 + 0x200))();
  uVar3 = FUN_1402f8580(param_1);
  uVar4 = FUN_1403080d0();
  FUN_1403079c0(uVar4,param_2,uVar3,uVar2,(int)lVar1,(int)param_1[0x1df]);
  return;
}



void FUN_1402fb1e0(longlong param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0xfd8) = param_2;
  *(undefined8 *)(param_1 + 0xfe0) = *(undefined8 *)(param_1 + 0x510);
  return;
}



undefined8 FUN_1402fb200(longlong param_1)

{
  switch(*(undefined4 *)(param_1 + 300)) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 5:
  case 6:
  case 10:
  case 0x1e:
  case 0x2f:
    return 1;
  default:
    return 0;
  }
}



bool FUN_1402fb270(longlong param_1)

{
  if ((*(char *)(param_1 + 0x600) == '\0') && (*(char *)(param_1 + 0x601) == '\0')) {
    return *(int *)(param_1 + 300) != 0x24;
  }
  return false;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1402fb290(longlong param_1,undefined4 param_2)

{
  int *piVar1;
  ulonglong *puVar2;
  longlong *plVar3;
  int iVar4;
  uint uVar5;
  undefined8 uVar6;
  longlong lVar8;
  longlong *plVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  undefined8 *puVar12;
  char cVar13;
  ulonglong uVar14;
  bool bVar15;
  undefined1 auStack_168 [32];
  ulonglong local_148;
  char local_140;
  undefined1 local_138 [8];
  longlong *local_130;
  undefined8 local_128;
  undefined4 local_118;
  undefined4 local_114;
  undefined4 local_110;
  undefined4 local_10c;
  undefined4 local_108;
  undefined2 local_100;
  undefined6 uStack_fe;
  undefined8 local_f0;
  ulonglong local_e8;
  undefined2 local_d8;
  undefined6 uStack_d6;
  undefined8 local_c8;
  ulonglong local_c0;
  undefined1 local_a8 [32];
  void *local_88;
  ulonglong local_70;
  undefined2 local_60;
  undefined6 uStack_5e;
  undefined8 local_50;
  ulonglong local_48;
  ulonglong local_38;
  ulonglong uVar7;
  
  local_128 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_168;
  uVar14 = 0;
  uVar10 = 0;
  local_148 = 0;
  cVar13 = '\0';
  local_140 = '\0';
  puVar2 = *(ulonglong **)(param_1 + 0x12e8);
  uVar11 = uVar14;
  if (puVar2 != (ulonglong *)0x0) {
    uVar11 = uVar10;
    if (puVar2 == *(ulonglong **)(param_1 + 0x12f0)) {
      if (*puVar2 != 0) {
        uVar11 = *puVar2;
        if ((puVar2 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar15 = DAT_1406080a8 == 0, uVar11 = uVar14,
           DAT_1406080a8 = iVar4, bVar15)) {
          FUN_140176d60(1);
        }
        local_140 = 0;
        local_148 = uVar11;
        FUN_14034ed40(uVar11);
        cVar13 = '\x01';
        local_140 = '\x01';
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar15 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1402fcd70(param_1 + 0x1150);
  puVar12 = (undefined8 *)(*(longlong *)(param_1 + 0x130) + 0x660);
  if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x130) + 0x678)) {
    puVar12 = (undefined8 *)*puVar12;
  }
  uVar6 = FUN_1402f0920(DAT_140608068,local_138,puVar12,param_2);
  FUN_140343ec0((longlong *)(param_1 + 0x10f8),uVar6);
  if (local_130 != (longlong *)0x0) {
    LOCK();
    plVar3 = local_130 + 1;
    lVar8 = *plVar3;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    uVar11 = local_148;
    cVar13 = local_140;
    if ((int)lVar8 == 1) {
      (**(code **)(*local_130 + 8))(local_130);
      LOCK();
      piVar1 = (int *)((longlong)local_130 + 0xc);
      iVar4 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      uVar11 = local_148;
      cVar13 = local_140;
      if (iVar4 == 1) {
        (**(code **)(*local_130 + 0x10))(local_130);
        uVar11 = local_148;
        cVar13 = local_140;
      }
    }
  }
  plVar3 = *(longlong **)(param_1 + 0x10f8);
  if (plVar3 == (longlong *)0x0) {
    if (cVar13 != '\0') {
      FUN_14034edd0(uVar11);
    }
    uVar6 = 0;
  }
  else {
    uVar10 = uVar14;
    if ((plVar3[1] != 0) && (*(uint *)(plVar3 + 2) != 0)) {
      uVar7 = uVar14;
      plVar9 = (longlong *)*plVar3;
      do {
        if (*plVar9 != 0) {
          uVar10 = ((longlong *)*plVar3)[uVar7];
          break;
        }
        uVar5 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar5;
        plVar9 = plVar9 + 1;
      } while (uVar5 < *(uint *)(plVar3 + 2));
    }
LAB_1402fb440:
    uVar7 = uVar10;
    if (uVar7 != 0) {
      local_e8 = 7;
      local_f0 = 0;
      local_100 = 0;
      local_c0 = 7;
      local_c8 = 0;
      local_d8 = 0;
      local_118 = *(undefined4 *)(uVar7 + 8);
      local_10c = *(undefined4 *)(uVar7 + 0x10);
      local_108 = *(undefined4 *)(uVar7 + 0x14);
      local_110 = *(undefined4 *)(uVar7 + 0xc);
      FUN_1400015e0(&local_100,uVar7 + 0x18,0,0xffffffffffffffff);
      FUN_1400015e0(&local_d8,uVar7 + 0x40,0);
      local_114 = 0;
      FUN_1402fce80(local_a8,uVar7,&local_118);
      FUN_1402fcce0(param_1 + 0x1150);
      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(local_88);
      }
      if (7 < local_c0) {
        operator_delete((void *)CONCAT62(uStack_d6,local_d8));
      }
      local_c0 = 7;
      local_c8 = 0;
      local_d8 = 0;
      if (7 < local_e8) {
        operator_delete((void *)CONCAT62(uStack_fe,local_100));
      }
      uVar10 = *(ulonglong *)(uVar7 + 0x68);
      if (*(ulonglong *)(uVar7 + 0x68) == 0) {
        uVar5 = *(uint *)(uVar7 + 0x70) % *(uint *)(plVar3 + 2) + 1;
        lVar8 = (longlong)(int)uVar5 << 3;
        uVar10 = uVar14;
        do {
          if (*(uint *)(plVar3 + 2) <= uVar5) break;
          if (*(longlong *)(*plVar3 + lVar8) != 0) {
            uVar10 = *(ulonglong *)(*plVar3 + lVar8);
          }
          uVar5 = uVar5 + 1;
          lVar8 = lVar8 + 8;
        } while (uVar10 == 0);
      }
      goto LAB_1402fb440;
    }
    if (cVar13 != '\0') {
      FUN_14034edd0(uVar11);
    }
    uVar6 = 1;
  }
  return uVar6;
}



void FUN_1402fb5c0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x58)) {
    operator_delete(*(void **)(param_1 + 0x40));
  }
  *(undefined8 *)(param_1 + 0x58) = 7;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined2 *)(param_1 + 0x40) = 0;
  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;
}



void FUN_1402fb620(longlong param_1)

{
  FUN_1402fb5c0(param_1 + 8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1402fb630(longlong param_1,undefined4 param_2)

{
  int *piVar1;
  ulonglong *puVar2;
  longlong *plVar3;
  int iVar4;
  uint uVar5;
  undefined8 uVar6;
  longlong lVar8;
  longlong *plVar9;
  ulonglong uVar10;
  ulonglong uVar11;
  undefined8 *puVar12;
  char cVar13;
  ulonglong uVar14;
  bool bVar15;
  undefined1 auStack_158 [32];
  ulonglong local_138;
  char local_130;
  undefined1 local_128 [8];
  longlong *local_120;
  undefined8 local_118;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined8 local_e8;
  ulonglong local_e0;
  undefined2 local_d0;
  undefined6 uStack_ce;
  undefined8 local_c0;
  ulonglong local_b8;
  undefined1 local_a8 [24];
  void *local_90;
  ulonglong local_78;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined8 local_58;
  ulonglong local_50;
  ulonglong local_38;
  ulonglong uVar7;
  
  local_118 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_158;
  uVar14 = 0;
  uVar10 = 0;
  local_138 = 0;
  cVar13 = '\0';
  local_130 = '\0';
  puVar2 = *(ulonglong **)(param_1 + 0x12e8);
  uVar11 = uVar14;
  if (puVar2 != (ulonglong *)0x0) {
    uVar11 = uVar10;
    if (puVar2 == *(ulonglong **)(param_1 + 0x12f0)) {
      if (*puVar2 != 0) {
        uVar11 = *puVar2;
        if ((puVar2 != *(ulonglong **)(param_1 + 0x12f0)) &&
           (iVar4 = DAT_1406080a8 + 1, bVar15 = DAT_1406080a8 == 0, uVar11 = uVar14,
           DAT_1406080a8 = iVar4, bVar15)) {
          FUN_140176d60(1);
        }
        local_130 = 0;
        local_138 = uVar11;
        FUN_14034ed40(uVar11);
        cVar13 = '\x01';
        local_130 = '\x01';
      }
    }
    else {
      iVar4 = DAT_1406080a8 + 1;
      bVar15 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar4;
      if (bVar15) {
        FUN_140176d60(1);
      }
    }
  }
  FUN_1402fcbf0(param_1 + 0x1108);
  puVar12 = (undefined8 *)(*(longlong *)(param_1 + 0x130) + 0x638);
  if (7 < *(ulonglong *)(*(longlong *)(param_1 + 0x130) + 0x650)) {
    puVar12 = (undefined8 *)*puVar12;
  }
  uVar6 = FUN_1402f0c50(DAT_140608068,local_128,puVar12,param_2);
  FUN_140343ec0((longlong *)(param_1 + 0x10e8),uVar6);
  if (local_120 != (longlong *)0x0) {
    LOCK();
    plVar3 = local_120 + 1;
    lVar8 = *plVar3;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    uVar11 = local_138;
    cVar13 = local_130;
    if ((int)lVar8 == 1) {
      (**(code **)(*local_120 + 8))(local_120);
      LOCK();
      piVar1 = (int *)((longlong)local_120 + 0xc);
      iVar4 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      uVar11 = local_138;
      cVar13 = local_130;
      if (iVar4 == 1) {
        (**(code **)(*local_120 + 0x10))(local_120);
        uVar11 = local_138;
        cVar13 = local_130;
      }
    }
  }
  plVar3 = *(longlong **)(param_1 + 0x10e8);
  if (plVar3 == (longlong *)0x0) {
    if (cVar13 != '\0') {
      FUN_14034edd0(uVar11);
    }
    uVar6 = 0;
  }
  else {
    uVar10 = uVar14;
    if ((plVar3[1] != 0) && (*(uint *)(plVar3 + 2) != 0)) {
      uVar7 = uVar14;
      plVar9 = (longlong *)*plVar3;
      do {
        if (*plVar9 != 0) {
          uVar10 = ((longlong *)*plVar3)[uVar7];
          break;
        }
        uVar5 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar5;
        plVar9 = plVar9 + 1;
      } while (uVar5 < *(uint *)(plVar3 + 2));
    }
LAB_1402fb7e0:
    uVar7 = uVar10;
    if (uVar7 != 0) {
      local_e0 = 7;
      local_e8 = 0;
      local_f8 = 0;
      local_b8 = 7;
      local_c0 = 0;
      local_d0 = 0;
      local_108 = *(undefined4 *)(uVar7 + 8);
      local_100 = *(undefined4 *)(uVar7 + 0x10);
      FUN_1400015e0(&local_f8,uVar7 + 0x48,0,0xffffffffffffffff);
      FUN_1400015e0(&local_d0,uVar7 + 0x70,0);
      local_104 = 0;
      FUN_1402fceb0(local_a8,uVar7,&local_108);
      FUN_1402fcad0(param_1 + 0x1108);
      if (7 < local_50) {
        operator_delete((void *)CONCAT62(uStack_66,local_68));
      }
      local_50 = 7;
      local_58 = 0;
      local_68 = 0;
      if (7 < local_78) {
        operator_delete(local_90);
      }
      if (7 < local_b8) {
        operator_delete((void *)CONCAT62(uStack_ce,local_d0));
      }
      local_b8 = 7;
      local_c0 = 0;
      local_d0 = 0;
      if (7 < local_e0) {
        operator_delete((void *)CONCAT62(uStack_f6,local_f8));
      }
      uVar10 = *(ulonglong *)(uVar7 + 0x98);
      if (*(ulonglong *)(uVar7 + 0x98) == 0) {
        uVar5 = *(uint *)(uVar7 + 0xa0) % *(uint *)(plVar3 + 2) + 1;
        lVar8 = (longlong)(int)uVar5 << 3;
        uVar10 = uVar14;
        do {
          if (*(uint *)(plVar3 + 2) <= uVar5) break;
          if (*(longlong *)(*plVar3 + lVar8) != 0) {
            uVar10 = *(ulonglong *)(*plVar3 + lVar8);
          }
          uVar5 = uVar5 + 1;
          lVar8 = lVar8 + 8;
        } while (uVar10 == 0);
      }
      goto LAB_1402fb7e0;
    }
    if (cVar13 != '\0') {
      FUN_14034edd0(uVar11);
    }
    uVar6 = 1;
  }
  return uVar6;
}



undefined8 FUN_1402fb960(longlong param_1)

{
  uint uVar1;
  char cVar2;
  longlong lVar3;
  undefined8 uVar4;
  uint *puVar5;
  bool bVar6;
  
  if ((*(longlong *)(param_1 + 0x1198) != 0) && (lVar3 = FUN_140345830(), lVar3 != 0)) {
    uVar4 = 0;
    cVar2 = FUN_140195920(param_1 + 0x12e8);
    bVar6 = cVar2 != '\0';
    if (bVar6) {
      uVar4 = FUN_140195970(param_1 + 0x12e8);
      FUN_14034ed40(uVar4);
    }
    uVar1 = *(uint *)(lVar3 + 0x30);
    if (*(longlong *)(param_1 + 0x1108) != 0) {
      for (puVar5 = *(uint **)(*(longlong *)(param_1 + 0x1108) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 0x1118)) * 8);
          puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0x1a)) {
        if ((puVar5[0x1c] == uVar1) && (*puVar5 == uVar1)) {
          if (puVar5 != (uint *)0x0) {
            if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if ((int)puVar5[3] < *(int *)(lVar3 + 0x34)) {
              if (bVar6) {
                FUN_14034edd0(uVar4);
              }
              return 2;
            }
            if (bVar6) {
              FUN_14034edd0(uVar4);
            }
            return 1;
          }
          break;
        }
      }
    }
    if (bVar6) {
      FUN_14034edd0(uVar4);
    }
  }
  return 0;
}



// WARNING: Removing unreachable block (ram,0x0001402fbbbb)
// WARNING: Removing unreachable block (ram,0x0001402fbba6)

void FUN_1402fbab0(longlong param_1)

{
  uint uVar1;
  char cVar2;
  longlong lVar3;
  undefined8 uVar4;
  uint *puVar5;
  
  if ((*(longlong *)(param_1 + 0x1198) != 0) && (lVar3 = FUN_140345830(), lVar3 != 0)) {
    uVar4 = 0;
    cVar2 = FUN_140195920(param_1 + 0x12e8);
    if (cVar2 != '\0') {
      uVar4 = FUN_140195970(param_1 + 0x12e8);
      FUN_14034ed40(uVar4);
    }
    uVar1 = *(uint *)(lVar3 + 0x30);
    if (*(longlong *)(param_1 + 0x1108) != 0) {
      for (puVar5 = *(uint **)(*(longlong *)(param_1 + 0x1108) +
                              ((ulonglong)uVar1 % (ulonglong)*(uint *)(param_1 + 0x1118)) * 8);
          puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0x1a)) {
        if ((puVar5[0x1c] == uVar1) && (*puVar5 == uVar1)) {
          if (puVar5 != (uint *)0x0) {
            if (puVar5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            puVar5[3] = puVar5[3] - *(int *)(lVar3 + 0x34);
            if ((int)puVar5[3] < 0) {
              puVar5[3] = 0;
            }
          }
          break;
        }
      }
    }
    if (cVar2 != '\0') {
      FUN_14034edd0(uVar4);
    }
  }
  return;
}



void FUN_1402fbc00(longlong param_1,undefined8 param_2,uint *param_3)

{
  uint uVar1;
  longlong lVar2;
  ulonglong uVar3;
  uint *puVar4;
  uint *puVar5;
  
  if ((*(longlong *)(param_1 + 0x1198) != 0) && (lVar2 = FUN_140345830(), lVar2 != 0)) {
    uVar1 = *(uint *)(lVar2 + 0x30);
    lVar2 = **(longlong **)(param_1 + 0x10e8);
    if (lVar2 != 0) {
      for (puVar5 = *(uint **)(lVar2 + ((ulonglong)uVar1 %
                                       (ulonglong)*(uint *)(*(longlong **)(param_1 + 0x10e8) + 2)) *
                                       8); puVar5 != (uint *)0x0; puVar5 = *(uint **)(puVar5 + 0x26)
          ) {
        if ((puVar5[0x28] == uVar1) && (*puVar5 == uVar1)) {
          if (puVar5 != (uint *)0x0) {
            puVar4 = puVar5 + 6;
            if (7 < *(ulonglong *)(puVar5 + 0xc)) {
              puVar4 = *(uint **)puVar4;
            }
            if (puVar4 == (uint *)0x0) {
              return;
            }
            goto LAB_1402fbc72;
          }
          break;
        }
      }
    }
    puVar4 = (uint *)&DAT_140477960;
LAB_1402fbc72:
    uVar3 = 0xffffffffffffffff;
    *param_3 = uVar1;
    puVar5 = puVar4;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      uVar1 = *puVar5;
      puVar5 = (uint *)((longlong)puVar5 + 2);
    } while ((short)uVar1 != 0);
    FUN_140001710(param_2,puVar4,~uVar3 - 1);
  }
  return;
}



void FUN_1402fbcc0(longlong param_1)

{
  uint uVar1;
  longlong lVar3;
  longlong *plVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar2;
  
  uVar6 = 0;
  uVar5 = uVar6;
  if ((*(longlong *)(param_1 + 0x1158) != 0) && (*(uint *)(param_1 + 0x1160) != 0)) {
    uVar2 = uVar6;
    plVar4 = *(longlong **)(param_1 + 0x1150);
    do {
      if (*plVar4 != 0) {
        uVar5 = (*(longlong **)(param_1 + 0x1150))[uVar2];
        break;
      }
      uVar1 = (int)uVar2 + 1;
      uVar2 = (ulonglong)uVar1;
      plVar4 = plVar4 + 1;
    } while (uVar1 < *(uint *)(param_1 + 0x1160));
  }
  do {
    do {
      uVar2 = uVar5;
      if (uVar2 == 0) {
        return;
      }
      *(undefined4 *)(uVar2 + 0xc) = 0;
      uVar5 = *(ulonglong *)(uVar2 + 0x70);
    } while (*(ulonglong *)(uVar2 + 0x70) != 0);
    uVar1 = *(uint *)(uVar2 + 0x78) % *(uint *)(param_1 + 0x1160) + 1;
    lVar3 = (longlong)(int)uVar1 << 3;
    uVar5 = uVar6;
    do {
      if (*(uint *)(param_1 + 0x1160) <= uVar1) break;
      if (*(longlong *)(lVar3 + *(longlong *)(param_1 + 0x1150)) != 0) {
        uVar5 = *(ulonglong *)(lVar3 + *(longlong *)(param_1 + 0x1150));
      }
      uVar1 = uVar1 + 1;
      lVar3 = lVar3 + 8;
    } while (uVar5 == 0);
  } while( true );
}



undefined8 FUN_1402fbd60(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  int iVar2;
  longlong *plVar3;
  uint *puVar4;
  uint uVar5;
  longlong lVar6;
  longlong lVar7;
  uint uVar8;
  bool bVar9;
  bool bVar10;
  undefined8 uVar11;
  longlong lVar12;
  undefined1 uVar13;
  
  uVar11 = 0xfffffffffffffffe;
  plVar3 = (longlong *)FUN_14032f6c0();
  if (*plVar3 != 0) {
    for (puVar4 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0x3a)) {
      if ((puVar4[0x3c] == param_2) && (*puVar4 == param_2)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar8 = puVar4[4];
          goto LAB_1402fbde5;
        }
        break;
      }
    }
  }
  uVar8 = 0;
LAB_1402fbde5:
  plVar3 = (longlong *)FUN_14032f6c0();
  if (*plVar3 != 0) {
    for (puVar4 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0x3a)) {
      if ((puVar4[0x3c] == param_2) && (*puVar4 == param_2)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar5 = puVar4[3];
          goto LAB_1402fbe3e;
        }
        break;
      }
    }
  }
  uVar5 = 0;
LAB_1402fbe3e:
  lVar6 = 0;
  lVar12 = 0;
  bVar10 = false;
  uVar13 = 0;
  plVar3 = *(longlong **)(param_1 + 0x12e8);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
      lVar7 = *plVar3;
      lVar6 = 0;
      if (lVar7 != 0) {
        if (plVar3 != *(longlong **)(param_1 + 0x12f0)) {
          iVar2 = DAT_1406080a8 + 1;
          bVar10 = DAT_1406080a8 == 0;
          DAT_1406080a8 = iVar2;
          if (bVar10) {
            FUN_140176d60(1);
          }
          lVar7 = 0;
        }
        lVar12 = lVar7;
        FUN_14034ed40(lVar7);
        bVar10 = true;
        uVar13 = 1;
        lVar6 = lVar7;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar9 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar9) {
        FUN_140176d60(1);
      }
    }
  }
  plVar3 = (longlong *)(param_1 + 0x1150);
  uVar1 = (ulonglong)uVar5 % (ulonglong)*(uint *)(param_1 + 0x1160);
  if (*plVar3 != 0) {
    for (puVar4 = *(uint **)(*plVar3 + uVar1 * 8); puVar4 != (uint *)0x0;
        puVar4 = *(uint **)(puVar4 + 0x1c)) {
      if ((puVar4[0x1e] == uVar5) && (*puVar4 == uVar5)) goto LAB_1402fbf12;
    }
  }
  puVar4 = (uint *)FUN_1402fd1a0(plVar3,uVar5,uVar1,uVar5,uVar11,lVar12,uVar13);
LAB_1402fbf12:
  lVar7 = *plVar3;
  if ((int)(puVar4[3] - uVar8) < 0) {
    uVar1 = (ulonglong)uVar5 % (ulonglong)*(uint *)(param_1 + 0x1160);
    if (lVar7 != 0) {
      for (puVar4 = *(uint **)(lVar7 + uVar1 * 8); puVar4 != (uint *)0x0;
          puVar4 = *(uint **)(puVar4 + 0x1c)) {
        if ((puVar4[0x1e] == uVar5) && (*puVar4 == uVar5)) goto LAB_1402fbf54;
      }
    }
    puVar4 = (uint *)FUN_1402fd1a0(plVar3,uVar5,uVar1,uVar5,uVar11,lVar12,uVar13);
LAB_1402fbf54:
    puVar4[3] = 0;
    if (bVar10) {
      FUN_14034edd0(lVar6);
    }
    uVar11 = 0;
  }
  else {
    uVar1 = (ulonglong)uVar5 % (ulonglong)*(uint *)(param_1 + 0x1160);
    if (lVar7 != 0) {
      for (puVar4 = *(uint **)(lVar7 + uVar1 * 8); puVar4 != (uint *)0x0;
          puVar4 = *(uint **)(puVar4 + 0x1c)) {
        if ((puVar4[0x1e] == uVar5) && (*puVar4 == uVar5)) goto LAB_1402fbfa2;
      }
    }
    puVar4 = (uint *)FUN_1402fd1a0(plVar3,uVar5,uVar1,uVar5,uVar11,lVar12,uVar13);
LAB_1402fbfa2:
    puVar4[3] = puVar4[3] - uVar8;
    if (bVar10) {
      FUN_14034edd0(lVar6);
    }
    uVar11 = 1;
  }
  return uVar11;
}



// WARNING: Removing unreachable block (ram,0x0001402fc09c)

undefined8 FUN_1402fbfd0(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  int iVar2;
  longlong *plVar3;
  uint *puVar4;
  uint *puVar5;
  uint uVar6;
  longlong lVar7;
  longlong lVar8;
  uint uVar9;
  bool bVar10;
  bool bVar11;
  undefined8 uVar12;
  longlong lVar13;
  undefined1 uVar14;
  
  uVar12 = 0xfffffffffffffffe;
  plVar3 = (longlong *)FUN_14032f6c0();
  if (*plVar3 != 0) {
    for (puVar4 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0x3a)) {
      if ((puVar4[0x3c] == param_2) && (*puVar4 == param_2)) {
        if (puVar4 != (uint *)0x0) {
          if (puVar4 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar9 = puVar4[4];
          goto LAB_1402fc058;
        }
        break;
      }
    }
  }
  uVar9 = 0;
LAB_1402fc058:
  lVar8 = 0;
  plVar3 = (longlong *)FUN_14032f6c0();
  uVar6 = 0;
  if (*plVar3 != 0) {
    for (puVar4 = *(uint **)(*plVar3 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar3 + 2)) * 8);
        puVar4 != (uint *)0x0; puVar4 = *(uint **)(puVar4 + 0x3a)) {
      if ((puVar4[0x3c] == param_2) && (*puVar4 == param_2)) {
        if (puVar4 != (uint *)0x0) {
          uVar6 = puVar4[3];
        }
        break;
      }
    }
  }
  lVar13 = 0;
  bVar11 = false;
  uVar14 = 0;
  plVar3 = *(longlong **)(param_1 + 0x12e8);
  if (plVar3 != (longlong *)0x0) {
    if (plVar3 == *(longlong **)(param_1 + 0x12f0)) {
      lVar7 = *plVar3;
      if (lVar7 != 0) {
        if ((plVar3 != *(longlong **)(param_1 + 0x12f0)) &&
           (iVar2 = DAT_1406080a8 + 1, bVar11 = DAT_1406080a8 == 0, lVar7 = lVar8,
           DAT_1406080a8 = iVar2, bVar11)) {
          FUN_140176d60(1);
        }
        lVar13 = lVar7;
        FUN_14034ed40(lVar7);
        bVar11 = true;
        uVar14 = 1;
        lVar8 = lVar7;
      }
    }
    else {
      iVar2 = DAT_1406080a8 + 1;
      bVar10 = DAT_1406080a8 == 0;
      DAT_1406080a8 = iVar2;
      if (bVar10) {
        FUN_140176d60(1);
      }
    }
  }
  plVar3 = (longlong *)(param_1 + 0x1150);
  uVar1 = (ulonglong)uVar6 % (ulonglong)*(uint *)(param_1 + 0x1160);
  if (*plVar3 != 0) {
    for (puVar4 = *(uint **)(*plVar3 + uVar1 * 8); puVar4 != (uint *)0x0;
        puVar4 = *(uint **)(puVar4 + 0x1c)) {
      if ((puVar4[0x1e] == uVar6) && (*puVar4 == uVar6)) goto LAB_1402fc185;
    }
  }
  puVar4 = (uint *)FUN_1402fd1a0(plVar3,uVar6,uVar1,uVar6,uVar12,lVar13,uVar14);
LAB_1402fc185:
  uVar1 = (ulonglong)uVar6 % (ulonglong)*(uint *)(param_1 + 0x1160);
  if (*plVar3 != 0) {
    for (puVar5 = *(uint **)(*plVar3 + uVar1 * 8); puVar5 != (uint *)0x0;
        puVar5 = *(uint **)(puVar5 + 0x1c)) {
      if ((puVar5[0x1e] == uVar6) && (*puVar5 == uVar6)) goto LAB_1402fc1c2;
    }
  }
  puVar5 = (uint *)FUN_1402fd1a0(plVar3,uVar6,uVar1,uVar6,uVar12,lVar13,uVar14);
LAB_1402fc1c2:
  if ((int)puVar5[4] < (int)(uVar9 + puVar4[3])) {
    if (bVar11) {
      FUN_14034edd0(lVar8);
    }
    uVar12 = 0;
  }
  else {
    uVar1 = (ulonglong)uVar6 % (ulonglong)*(uint *)(param_1 + 0x1160);
    if (*plVar3 != 0) {
      for (puVar4 = *(uint **)(*plVar3 + uVar1 * 8); puVar4 != (uint *)0x0;
          puVar4 = *(uint **)(puVar4 + 0x1c)) {
        if ((puVar4[0x1e] == uVar6) && (*puVar4 == uVar6)) goto LAB_1402fc222;
      }
    }
    puVar4 = (uint *)FUN_1402fd1a0(plVar3,uVar6,uVar1,uVar6,uVar12,lVar13,uVar14);
LAB_1402fc222:
    puVar4[3] = puVar4[3] + uVar9;
    if (bVar11) {
      FUN_14034edd0(lVar8);
    }
    uVar12 = 1;
  }
  return uVar12;
}



int FUN_1402fc250(longlong param_1)

{
  float fVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  float fVar6;
  
  uVar5 = FUN_1402f8580();
  fVar1 = *(float *)(param_1 + 0x73c);
  iVar2 = *(int *)(param_1 + 0x620);
  iVar3 = *(int *)(param_1 + 0x5cc);
  iVar4 = *(int *)(param_1 + 0x870);
  fVar6 = (float)FUN_1402f7ba0(param_1,uVar5);
  return (int)((fVar6 + (float)(int)((fVar1 + 1.0) * (float)iVar2 + (float)iVar3 + (float)iVar4) +
               (float)(*(int *)(param_1 + 0x8b8) + *(int *)(param_1 + 0x628))) *
               (*(float *)(param_1 + 0x8f4) + *(float *)(param_1 + 0x744) + 1.0) +
               (float)*(int *)(param_1 + 0x878) + (float)*(int *)(param_1 + 0x898));
}



int FUN_1402fc320(longlong param_1)

{
  float fVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 uVar5;
  float fVar6;
  
  uVar5 = FUN_1402f8580();
  fVar1 = *(float *)(param_1 + 0x73c);
  iVar2 = *(int *)(param_1 + 0x620);
  iVar3 = *(int *)(param_1 + 0x5d0);
  iVar4 = *(int *)(param_1 + 0x870);
  fVar6 = (float)FUN_1402f7ba0(param_1,uVar5);
  return (int)((fVar6 + (float)(int)((fVar1 + 1.0) * (float)iVar2 + (float)iVar3 + (float)iVar4) +
               (float)(*(int *)(param_1 + 0x8b8) + *(int *)(param_1 + 0x628))) *
               (*(float *)(param_1 + 0x8f4) + *(float *)(param_1 + 0x744) + 1.0) +
               (float)*(int *)(param_1 + 0x878) + (float)*(int *)(param_1 + 0x898));
}



void FUN_1402fc3f0(longlong param_1,double param_2)

{
  int iVar1;
  
  iVar1 = rand();
  *(double *)(param_1 + 0xb30) = (param_2 - (double)((float)iVar1 * 3.0517578e-05 * 3.0)) + 1.5;
  return;
}



void FUN_1402fc450(longlong param_1,undefined4 param_2,char param_3)

{
  *(undefined4 *)(param_1 + 0xfec) = param_2;
  if (param_3 != '\0') {
    *(undefined1 *)(param_1 + 0x60d) = 1;
  }
  return;
}



void FUN_1402fc470(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x11a8) = param_2;
  return;
}



// WARNING: Removing unreachable block (ram,0x0001402fc898)
// WARNING: Removing unreachable block (ram,0x0001402fc872)
// WARNING: Removing unreachable block (ram,0x0001402fc84c)
// WARNING: Removing unreachable block (ram,0x0001402fc812)
// WARNING: Removing unreachable block (ram,0x0001402fc7ec)
// WARNING: Removing unreachable block (ram,0x0001402fc7c6)
// WARNING: Removing unreachable block (ram,0x0001402fc7a0)
// WARNING: Removing unreachable block (ram,0x0001402fc77a)
// WARNING: Removing unreachable block (ram,0x0001402fc754)
// WARNING: Removing unreachable block (ram,0x0001402fc732)
// WARNING: Removing unreachable block (ram,0x0001402fc710)
// WARNING: Removing unreachable block (ram,0x0001402fc6ee)
// WARNING: Removing unreachable block (ram,0x0001402fc6cc)
// WARNING: Removing unreachable block (ram,0x0001402fc6aa)
// WARNING: Removing unreachable block (ram,0x0001402fc688)
// WARNING: Removing unreachable block (ram,0x0001402fc666)
// WARNING: Removing unreachable block (ram,0x0001402fc630)
// WARNING: Removing unreachable block (ram,0x0001402fc5ba)
// WARNING: Removing unreachable block (ram,0x0001402fc55c)
// WARNING: Removing unreachable block (ram,0x0001402fc531)
// WARNING: Removing unreachable block (ram,0x0001402fc4fa)
// WARNING: Removing unreachable block (ram,0x0001402fc4d1)
// WARNING: Removing unreachable block (ram,0x0001402fc4e5)
// WARNING: Removing unreachable block (ram,0x0001402fc517)
// WARNING: Removing unreachable block (ram,0x0001402fc545)
// WARNING: Removing unreachable block (ram,0x0001402fc58c)
// WARNING: Removing unreachable block (ram,0x0001402fc605)
// WARNING: Removing unreachable block (ram,0x0001402fc653)
// WARNING: Removing unreachable block (ram,0x0001402fc677)
// WARNING: Removing unreachable block (ram,0x0001402fc699)
// WARNING: Removing unreachable block (ram,0x0001402fc6bb)
// WARNING: Removing unreachable block (ram,0x0001402fc6dd)
// WARNING: Removing unreachable block (ram,0x0001402fc6ff)
// WARNING: Removing unreachable block (ram,0x0001402fc721)
// WARNING: Removing unreachable block (ram,0x0001402fc743)
// WARNING: Removing unreachable block (ram,0x0001402fc765)
// WARNING: Removing unreachable block (ram,0x0001402fc78d)
// WARNING: Removing unreachable block (ram,0x0001402fc7b3)
// WARNING: Removing unreachable block (ram,0x0001402fc7d9)
// WARNING: Removing unreachable block (ram,0x0001402fc7ff)
// WARNING: Removing unreachable block (ram,0x0001402fc839)
// WARNING: Removing unreachable block (ram,0x0001402fc85f)
// WARNING: Removing unreachable block (ram,0x0001402fc885)
// WARNING: Removing unreachable block (ram,0x0001402fc8b0)

void FUN_1402fc480(longlong *param_1,int *param_2,int *param_3,int *param_4,int *param_5)

{
  int iVar1;
  int iVar2;
  float fVar3;
  
  *param_5 = 0;
  *param_4 = 0;
  *param_3 = 0;
  *param_2 = 0;
  iVar1 = FUN_1402fc250();
  *param_2 = *param_2 + iVar1;
  iVar1 = FUN_1402fc320(param_1);
  *param_2 = *param_2 + iVar1;
  iVar1 = FUN_14023c4a0(param_1);
  *param_2 = *param_2 + iVar1;
  iVar2 = FUN_14023c390(param_1);
  iVar1 = *param_2;
  *param_2 = iVar1 + iVar2;
  iVar1 = (int)param_1[0x109] + *(int *)((longlong)param_1 + 0x64c) + iVar1 + iVar2;
  *param_2 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xc9];
  *param_2 = iVar1;
  *param_2 = *(int *)((longlong)param_1 + 0x84c) + (int)param_1[0xca] + iVar1;
  iVar1 = (int)(longlong)((float)(int)param_1[0x10a] * 100.0 + *(float *)(param_1 + 0xec) * 100.0) +
          *param_3;
  *param_3 = iVar1;
  iVar1 = (int)(longlong)
               ((float)*(int *)((longlong)param_1 + 0x854) * 100.0 +
               *(float *)((longlong)param_1 + 0x764) * 100.0) + iVar1;
  *param_3 = iVar1;
  iVar1 = (int)(longlong)
               (*(float *)(param_1 + 0xbc) * 100.0 + *(float *)((longlong)param_1 + 0x5dc) * 100.0 +
                *(float *)((longlong)param_1 + 0x5e4) * 100.0 + *(float *)(param_1 + 0x121) * 100.0)
          + iVar1;
  *param_3 = iVar1;
  *param_3 = (int)(longlong)
                  (*(float *)((longlong)param_1 + 0x90c) * 100.0 +
                  *(float *)((longlong)param_1 + 0x80c) * 100.0) + iVar1;
  fVar3 = (float)(**(code **)(*param_1 + 0x308))(param_1);
  *param_3 = *param_3 + (int)(longlong)(fVar3 * 100.0);
  iVar1 = *param_4 + (int)param_1[0xd1];
  *param_4 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x68c);
  *param_4 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd2];
  *param_4 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x694);
  *param_4 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd3];
  *param_4 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x69c);
  *param_4 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd4];
  *param_4 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x6a4);
  *param_4 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd5];
  *param_4 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x6ac);
  *param_4 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd6];
  *param_4 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x6b4);
  *param_4 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd7];
  *param_4 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x6bc);
  *param_4 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd8];
  *param_4 = iVar1;
  *param_4 = iVar1 + *(int *)((longlong)param_1 + 0x6c4);
  iVar1 = *param_5 + (int)param_1[0xcd];
  *param_5 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x66c);
  *param_5 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xce];
  *param_5 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x674);
  *param_5 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xcf];
  *param_5 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x67c);
  *param_5 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd0];
  *param_5 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x684);
  *param_5 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xd9];
  *param_5 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x6cc);
  *param_5 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xda];
  *param_5 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x6d4);
  *param_5 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xdb];
  *param_5 = iVar1;
  iVar1 = iVar1 + *(int *)((longlong)param_1 + 0x6dc);
  *param_5 = iVar1;
  iVar1 = iVar1 + (int)param_1[0xdc];
  *param_5 = iVar1;
  *param_5 = iVar1 + *(int *)((longlong)param_1 + 0x6e4);
  return;
}



void FUN_1402fc8c0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14023ae30(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_1402fc900(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_1402fd210(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



void FUN_1402fc980(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 + 0x80);
        FUN_1402fcf50(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402fca50(void)

{
  FUN_1402fc980();
  return;
}



void FUN_1402fca70(void)

{
  FUN_1402d9280();
  return;
}



void FUN_1402fca90(void)

{
  FUN_1402d96e0();
  return;
}



void FUN_1402fcab0(void)

{
  FUN_1402d98b0();
  return;
}



uint * FUN_1402fcad0(longlong *param_1,uint param_2,uint *param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,*(uint *)(param_1 + 2),1,param_4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(*param_1 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x1a)) {
      if ((puVar3[0x1c] == param_2) && (*puVar3 == param_2)) {
        puVar3[2] = *param_3;
        puVar3[3] = param_3[1];
        puVar3[4] = param_3[2];
        FUN_1400015e0(puVar3 + 6,param_3 + 4,0,0xffffffffffffffff);
        FUN_1400015e0(puVar3 + 0x10,param_3 + 0xe,0,0xffffffffffffffff);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_1402fd280(param_1,param_2,uVar1,param_2);
  puVar3[2] = *param_3;
  puVar3[3] = param_3[1];
  puVar3[4] = param_3[2];
  FUN_1400015e0(puVar3 + 6,param_3 + 4,0,0xffffffffffffffff);
  FUN_1400015e0(puVar3 + 0x10,param_3 + 0xe,0,0xffffffffffffffff);
  return puVar3;
}



void FUN_1402fcbf0(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 + 0x68);
        FUN_1402fcfe0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402fccc0(void)

{
  FUN_1402fcbf0();
  return;
}



uint * FUN_1402fcce0(longlong *param_1,uint param_2,undefined8 param_3)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x1c)) {
      if ((puVar1[0x1e] == param_2) && (*puVar1 == param_2)) {
        FUN_1402fcee0(puVar1 + 2,param_3);
        return puVar1;
      }
    }
  }
  puVar1 = (uint *)FUN_1402fd1a0(param_1,param_2,
                                 (ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2),param_2,
                                 0xfffffffffffffffe);
  FUN_1402fcee0(puVar1 + 2,param_3);
  return puVar1;
}



void FUN_1402fcd70(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 + 0x70);
        FUN_1402fd100(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_1402fce40(void)

{
  FUN_1402fcd70();
  return;
}



void FUN_1402fce60(void)

{
  FUN_1402d9b20();
  return;
}



undefined4 * FUN_1402fce80(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_1402fd730(param_1 + 2,param_3);
  return param_1;
}



undefined4 * FUN_1402fceb0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_1402fd7d0(param_1 + 2,param_3);
  return param_1;
}



undefined4 * FUN_1402fcee0(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];
  FUN_1400015e0(param_1 + 6,param_2 + 6,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x10,param_2 + 0x10,0,0xffffffffffffffff);
  return param_1;
}



void FUN_1402fcf50(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 != 0) {
    *(undefined8 *)(param_2 + 0x80) = *(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_1402cddb0();
      FUN_1402db240(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_14000d450(0x80004005);
}



void FUN_1402fcfe0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1402f46e0(param_2 + 8);
  *(undefined8 *)(param_2 + 0x68) = *(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_1402cddb0(param_1);
    FUN_1402e3da0(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_1402fd080(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x78) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x70); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x70))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x70) = *(undefined8 *)(param_2 + 0x70);
      FUN_1402fd100(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x70);
  FUN_1402fd100(param_1,param_2);
  return;
}



void FUN_1402fd100(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1402fb5c0(param_2 + 8);
  *(undefined8 *)(param_2 + 0x70) = *(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_1402cddb0(param_1);
    FUN_1402fd400(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_1402fd1a0(longlong *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  
  if (*param_1 == 0) {
    cVar1 = FUN_1402c6d50(param_1,(int)param_1[2],1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_1402fd5b0(param_1,param_2,param_3,param_4);
  return;
}



undefined8 * FUN_1402fd210(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;
}



undefined4 *
FUN_1402fd280(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) < 0x78)
      goto LAB_1402fd347;
      lVar7 = uVar6 * 0x78;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402fd347:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0xf + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0xd] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0xf;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x1a);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 0xc) = 7;
  *(undefined8 *)(puVar2 + 10) = 0;
  *(undefined2 *)(puVar2 + 6) = 0;
  *(undefined8 *)(puVar2 + 0x16) = 7;
  *(undefined8 *)(puVar2 + 0x14) = 0;
  *(undefined2 *)(puVar2 + 0x10) = 0;
  puVar2[0x1c] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x1a) = *(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_1402cddb0(param_1);
    FUN_1402e3da0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1402fd400(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x70);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x78) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x70) = *(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_1402fd5b0(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) < 0x80)
      goto LAB_1402fd677;
      lVar7 = uVar6 << 7;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1402fd677:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x10 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0xe] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x10;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x1c);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 0xe) = 7;
  *(undefined8 *)(puVar2 + 0xc) = 0;
  *(undefined2 *)(puVar2 + 8) = 0;
  *(undefined8 *)(puVar2 + 0x18) = 7;
  *(undefined8 *)(puVar2 + 0x16) = 0;
  *(undefined2 *)(puVar2 + 0x12) = 0;
  puVar2[0x1e] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x1c) = *(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_1402cddb0(param_1);
    FUN_1402fd400(param_1,uVar4);
  }
  return puVar2;
}



undefined4 * FUN_1402fd730(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_1400015e0(param_1 + 6,param_2 + 6,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x16) = 7;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  FUN_1400015e0(param_1 + 0x10,param_2 + 0x10,0,0xffffffffffffffff);
  return param_1;
}



undefined4 * FUN_1402fd7d0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x14) = 7;
  *(undefined8 *)(param_1 + 0x12) = 0;
  *(undefined2 *)(param_1 + 0xe) = 0;
  FUN_1400015e0(param_1 + 0xe,param_2 + 0xe,0,0xffffffffffffffff);
  return param_1;
}



void FUN_1402fd860(longlong param_1,undefined4 *param_2)

{
  *(undefined4 *)(param_1 + 0x154) = *param_2;
  *(undefined4 *)(param_1 + 0x158) = param_2[1];
  *(undefined4 *)(param_1 + 0x15c) = param_2[2];
  return;
}



undefined4 FUN_1402fd880(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x124);
}



undefined8 * FUN_1402fd890(undefined8 *param_1,byte param_2)

{
  *param_1 = mcoState::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x0001402fd966)
// WARNING: Removing unreachable block (ram,0x0001402fd96f)
// WARNING: Removing unreachable block (ram,0x0001402fd990)
// WARNING: Removing unreachable block (ram,0x0001402fd999)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_1402fd8c0(void)

{
  DAT_14060a940 = 0;
  _DAT_14060a948 = 0;
  DAT_14060a950 = 0x11;
  _DAT_14060a970 = 0;
  _DAT_14060a974 = 10;
  _DAT_14060a978 = 0;
  _DAT_14060a980 = 0;
  _DAT_14060a954 = 0x3f400000;
  _DAT_14060a958 = 0x3e800000;
  _DAT_14060a95c = 0x40100000;
  _DAT_14060a960 = 0x26;
  _DAT_14060a968 = 0;
  DAT_14060a988 = 0;
  _DAT_14060a990 = 0;
  DAT_14060a998 = 0x11;
  _DAT_14060a9b8 = 0;
  _DAT_14060a9bc = 10;
  _DAT_14060a9c0 = 0;
  _DAT_14060a9c8 = 0;
  _DAT_14060a99c = 0x3f400000;
  _DAT_14060a9a0 = 0x3e800000;
  _DAT_14060a9a4 = 0x40100000;
  _DAT_14060a9b0 = 0;
  _DAT_14060a9d0 = 0;
  _DAT_14060a9d8 = 0;
  _DAT_14060a9e0 = 0x11;
  _DAT_14060aa00 = 0;
  _DAT_14060aa04 = 10;
  _DAT_14060aa08 = 0;
  _DAT_14060aa10 = 0;
  _DAT_14060a9e4 = 0x3f400000;
  _DAT_14060a9e8 = 0x3e800000;
  _DAT_14060a9ec = 0x40100000;
  _DAT_14060a9f8 = 0;
  _DAT_14060aa18 = 0;
  _DAT_14060aa20 = 0;
  _DAT_14060aa28 = 0x11;
  _DAT_14060aa48 = 0;
  _DAT_14060aa4c = 10;
  _DAT_14060aa50 = 0;
  _DAT_14060aa58 = 0;
  _DAT_14060aa2c = 0x3f400000;
  _DAT_14060aa30 = 0x3e800000;
  _DAT_14060aa34 = 0x40100000;
  _DAT_14060aa40 = 0;
  _DAT_14060a9a8 = _DAT_14060a960;
  _DAT_14060a9f0 = _DAT_14060a960;
  _DAT_14060aa38 = _DAT_14060a960;
  FUN_1402fdb10(0x5f000000,0x26,0,0x3e800000,0xfffffffffffffffe);
  return &DAT_14060a940;
}



void thunk_FUN_140303bc0(void)

{
  FUN_140303bc0();
  return;
}



void thunk_FUN_140303cf0(void)

{
  FUN_140303cf0();
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1402fdb10(void)

{
  int *piVar1;
  short sVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined4 uVar5;
  longlong lVar6;
  longlong lVar7;
  undefined4 *puVar8;
  undefined8 uVar9;
  short *psVar10;
  uint *puVar11;
  short *psVar12;
  short *psVar13;
  longlong lVar14;
  longlong lVar15;
  int iVar16;
  longlong *plVar17;
  ulonglong uVar18;
  short *psVar19;
  undefined1 auStack_12c8 [32];
  undefined1 local_12a8;
  longlong local_1298;
  undefined4 local_1290;
  undefined4 *local_1288;
  undefined8 local_1278;
  undefined4 local_1268 [2];
  undefined1 local_1260 [40];
  undefined1 local_1238 [40];
  undefined1 local_1210 [40];
  undefined1 local_11e8 [40];
  undefined1 local_11c0 [40];
  undefined1 local_1198 [40];
  undefined1 local_1170 [40];
  undefined1 local_1148 [40];
  uint local_1120;
  uint local_111c;
  undefined1 local_1118 [16];
  longlong local_1108;
  undefined1 local_10f0 [16];
  longlong local_10e0;
  undefined4 local_10c8;
  undefined4 local_10c4;
  undefined1 local_10c0 [40];
  undefined4 local_1098;
  undefined4 local_1094;
  undefined4 local_1090;
  undefined4 local_108c;
  undefined1 local_1088 [40];
  undefined4 local_1060;
  undefined4 local_105c;
  undefined4 local_1058;
  undefined4 local_1054;
  undefined4 local_1050;
  undefined4 local_104c;
  undefined4 local_1048;
  undefined4 local_1044;
  undefined4 local_1040;
  undefined4 local_103c;
  undefined4 local_1038;
  undefined4 local_1034;
  undefined4 local_1030;
  undefined4 local_102c;
  undefined4 local_1028;
  undefined1 local_1020 [40];
  undefined4 local_ff8;
  undefined4 local_ff4;
  undefined4 local_ff0;
  undefined4 local_fec;
  undefined4 local_fe8;
  undefined4 local_fe4;
  undefined4 local_fe0;
  undefined4 local_fdc;
  undefined4 local_fd8;
  undefined4 local_fd4;
  undefined4 local_fd0;
  undefined4 local_fcc;
  undefined4 local_fc8;
  undefined4 local_fc4;
  undefined4 local_fc0;
  undefined4 local_fbc;
  undefined4 local_fb8;
  undefined4 local_fb4;
  undefined4 local_fb0;
  undefined4 local_fac;
  undefined4 local_fa8;
  undefined4 local_fa4;
  undefined4 local_fa0;
  undefined4 local_f9c;
  undefined4 local_f98;
  undefined4 local_f94;
  undefined4 local_f90;
  undefined4 local_f8c;
  undefined4 local_f88;
  undefined4 local_f84;
  undefined4 local_f80;
  undefined4 local_f7c;
  undefined4 local_f78;
  undefined4 local_f74;
  undefined4 local_f70;
  undefined4 local_f6c;
  undefined4 local_f68;
  undefined4 local_f64;
  undefined4 local_f60;
  undefined4 local_f5c;
  undefined4 local_f58;
  undefined4 local_f54;
  undefined4 local_f50;
  undefined4 local_f4c;
  undefined4 local_f48;
  undefined4 local_f44;
  undefined4 local_f40;
  undefined4 local_f3c;
  undefined4 local_f38;
  undefined4 local_f34;
  undefined4 local_f30;
  undefined4 local_f2c;
  undefined1 local_f28 [40];
  undefined4 local_f00;
  undefined4 local_efc;
  undefined4 local_ef8;
  undefined4 local_ef4;
  undefined4 local_ef0;
  undefined4 local_eec;
  undefined1 local_ee8 [40];
  undefined1 local_ec0 [40];
  undefined1 local_e98 [40];
  undefined4 local_e70;
  undefined4 local_e6c;
  undefined4 local_e68;
  undefined4 local_e64;
  undefined4 local_e60;
  undefined4 local_e5c;
  undefined4 local_e58;
  undefined4 local_e54;
  undefined4 local_e50;
  undefined4 local_e4c;
  undefined4 local_e48;
  undefined4 local_e44;
  undefined4 local_e40;
  undefined1 local_e38 [40];
  undefined1 local_e10 [40];
  undefined4 local_de8;
  undefined1 local_de0 [40];
  undefined1 local_db8 [40];
  undefined1 local_d90 [40];
  undefined1 local_d68 [40];
  undefined1 local_d40 [40];
  undefined1 local_d18 [40];
  undefined1 local_cf0 [40];
  undefined1 local_cc8 [40];
  undefined1 local_ca0 [40];
  undefined4 local_c78;
  undefined4 local_c74;
  undefined4 local_c70;
  undefined4 local_c6c;
  undefined1 local_c68 [40];
  undefined1 local_c40 [40];
  undefined1 local_c18 [40];
  undefined1 local_bf0 [40];
  undefined4 local_bc8;
  undefined4 local_bc4;
  undefined4 local_bc0;
  undefined4 local_bbc;
  undefined1 local_bb8 [40];
  undefined1 local_b90 [40];
  undefined1 local_b68 [40];
  undefined4 local_b40;
  undefined4 local_b3c;
  undefined4 local_b38;
  undefined4 local_b34;
  undefined4 local_b30;
  undefined4 local_b2c;
  undefined4 local_b28;
  undefined4 local_b24;
  undefined4 local_b20;
  undefined4 local_b1c;
  undefined4 local_b18;
  undefined4 local_b14;
  undefined4 local_b10;
  undefined1 local_b08 [40];
  undefined1 local_ae0 [40];
  undefined1 local_ab8 [40];
  undefined1 local_a90 [40];
  undefined1 local_a68 [40];
  undefined1 local_a40 [40];
  undefined1 local_a18 [40];
  undefined1 local_9f0 [40];
  undefined1 local_9c8 [40];
  undefined1 local_9a0 [40];
  undefined4 local_978;
  undefined4 local_974;
  undefined4 local_970;
  undefined4 local_96c;
  undefined4 local_968;
  undefined4 local_964;
  undefined4 local_960;
  undefined4 local_95c;
  undefined4 local_958;
  undefined4 local_954;
  undefined4 local_948;
  undefined1 local_940 [2328];
  ulonglong local_28;
  undefined8 local_20;
  
  local_20 = 0x1402fdb28;
  local_1278 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_12c8;
  lVar6 = FUN_1402933b0(DAT_140607ff0,L"ENEMY_STRING");
  if ((lVar6 != 0) && (lVar7 = FUN_1402933b0(DAT_140607ff0,&DAT_1404a4d58), lVar7 != 0)) {
    if (*(longlong *)(lVar7 + 0x70) != 0) {
      uVar18 = 0;
      if (*(uint *)(lVar7 + 0x78) != 0) {
        plVar17 = *(longlong **)(lVar7 + 0x68);
        do {
          if (*plVar17 != 0) {
            puVar8 = (undefined4 *)(*(longlong **)(lVar7 + 0x68))[uVar18];
            goto LAB_1402fdbda;
          }
          uVar4 = (int)uVar18 + 1;
          uVar18 = (ulonglong)uVar4;
          plVar17 = plVar17 + 1;
        } while (uVar4 < *(uint *)(lVar7 + 0x78));
      }
    }
    puVar8 = (undefined4 *)0x0;
LAB_1402fdbda:
    if (puVar8 != (undefined4 *)0x0) {
      uVar3 = *puVar8;
      local_1288 = puVar8;
      FUN_1403003e0(local_1268);
      local_1268[0] = uVar3;
      uVar5 = FUN_1402970c0(lVar7,L"nNameTextID");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nNameTextID");
      uVar9 = FUN_140160a70();
      psVar10 = (short *)FUN_140160960(uVar9,*puVar8);
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1238,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szCharacter");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szCharacter");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1210,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szAI");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szAI");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_11e8,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"nGroup");
      local_12a8 = 1;
      puVar11 = (uint *)FUN_140296600(lVar7,uVar3,uVar5,L"nGroup");
      local_1120 = *puVar11;
      uVar5 = FUN_1402970c0(lVar6,L"wszGroupName");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296b70(lVar6,uVar3,uVar5,L"wszGroupName");
      uVar5 = FUN_1402970c0(lVar6,L"wszSubGroupName");
      local_12a8 = 1;
      psVar12 = (short *)FUN_140296b70(lVar6,uVar3,uVar5,L"wszSubGroupName");
      uVar5 = FUN_1402970c0(lVar7,L"szModelFile");
      local_12a8 = 1;
      psVar13 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szModelFile");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar13;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_11c0,psVar13,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szSubModelFile");
      local_12a8 = 1;
      psVar13 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szSubModelFile");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar13;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1198,psVar13,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szSubModelDummy");
      local_12a8 = 1;
      psVar13 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szSubModelDummy");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar13;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1170,psVar13,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szSubModelGroup");
      local_12a8 = 1;
      psVar13 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szSubModelGroup");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar13;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1148,psVar13,~uVar18 - 1);
      if (psVar10 != (short *)0x0) {
        uVar18 = 0xffffffffffffffff;
        psVar19 = psVar10;
        do {
          if (uVar18 == 0) break;
          uVar18 = uVar18 - 1;
          sVar2 = *psVar19;
          psVar19 = psVar19 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_1118,psVar10,~uVar18 - 1);
      }
      if (psVar12 != (short *)0x0) {
        uVar18 = 0xffffffffffffffff;
        psVar19 = psVar12;
        do {
          if (uVar18 == 0) break;
          uVar18 = uVar18 - 1;
          sVar2 = *psVar19;
          psVar19 = psVar19 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_10f0,psVar12,~uVar18 - 1);
      }
      uVar5 = FUN_1402970c0(lVar7,L"nSubGroup");
      local_12a8 = 1;
      puVar11 = (uint *)FUN_140296600(lVar7,uVar3,uVar5,L"nSubGroup");
      local_111c = *puVar11;
      uVar5 = FUN_1402970c0(lVar7,L"nType");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nType");
      local_10c8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemBox");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemBox");
      local_10c4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szItemBoxRespawnMotion");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szItemBoxRespawnMotion");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_10c0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"fItemBoxCloseTimeMin");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fItemBoxCloseTimeMin");
      local_1098 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fItemBoxCloseTimeMax");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fItemBoxCloseTimeMax");
      local_1094 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nLevel");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nLevel");
      local_1090 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nGender");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nGender");
      local_108c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szSkin");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szSkin");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1088,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,&DAT_1404cad68);
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,&DAT_1404cad68);
      local_1060 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,&DAT_1404b72b8);
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,&DAT_1404b72b8);
      local_105c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,&DAT_1404cbef0);
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,&DAT_1404cbef0);
      local_1058 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fLuck");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fLuck");
      local_1054 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fMinPhysicalAttack");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMinPhysicalAttack");
      local_1050 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fPhysicalAttack");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fPhysicalAttack");
      local_104c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fMinMagicAttack");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMinMagicAttack");
      local_1048 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fMagicAttack");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMagicAttack");
      local_1044 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fMinAttributeAttack");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMinAttributeAttack");
      local_1040 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fAttributeAttack");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fAttributeAttack");
      local_103c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fDefense");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fDefense");
      local_1038 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fMagicDefense");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMagicDefense");
      local_1034 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fCritical");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fCritical");
      local_1030 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fResistanceCritical");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fResistanceCritical");
      local_102c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fMagicResistance");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMagicResistance");
      local_1028 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nWeaponDurabilityDecrease");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nWeaponDurabilityDecrease");
      local_f30 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nArmorDurabiltyDecrease");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nArmorDurabiltyDecrease");
      local_f2c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szMaterial");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szMaterial");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_f28,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"fScaleMin");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fScaleMin");
      local_f00 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fScaleMax");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fScaleMax");
      local_efc = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fPhysicalGuard");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fPhysicalGuard");
      local_ef8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fMagicGuard");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMagicGuard");
      local_ef4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fCounteroffensive");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fCounteroffensive");
      local_ef0 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fDownDamage");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fDownDamage");
      local_eec = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szLeftHandDummyName");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szLeftHandDummyName");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_ee8,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szRightHandDummyName");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szRightHandDummyName");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_ec0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szDeathReleaseEquipDummy");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szDeathReleaseEquipDummy");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_e98,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"fMoveSpeed");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMoveSpeed");
      local_e70 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fAttackSpeed");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fAttackSpeed");
      local_e6c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fStature");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fStature");
      local_e68 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fJumpHeight");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fJumpHeight");
      local_e64 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fMoveHeight");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fMoveHeight");
      local_e60 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fWeight");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fWeight");
      local_e5c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fWideRadius");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fWideRadius");
      local_e58 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fInvestigationRange");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fInvestigationRange");
      local_e54 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fPatrolRange");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fPatrolRange");
      local_e50 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fChaseRange");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fChaseRange");
      local_e4c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fAttackRange");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fAttackRange");
      local_e48 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fKeepDistance");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fKeepDistance");
      local_e44 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fAttackDelay");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fAttackDelay");
      local_e40 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szBackStepMotion");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szBackStepMotion");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_e38,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szAIScript");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szAIScript");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_e10,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"fRisingDamageWeight");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fRisingDamageWeight");
      local_de8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szComboTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szComboTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_de0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szNullMotionTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szNullMotionTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_db8,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szAttackTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szAttackTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_d90,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szDownMotionTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szDownMotionTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_d68,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szSoulRedTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szSoulRedTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_d40,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szSoulBlueTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szSoulBlueTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_d18,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szDamageSoundTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szDamageSoundTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_cf0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szBasicMotionTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szBasicMotionTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_cc8,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szCorpsePiece");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szCorpsePiece");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_ca0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"fGuardBreakDamage");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fGuardBreakDamage");
      local_c78 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fGuardDamage");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fGuardDamage");
      local_c74 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nCorpseWeapon");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nCorpseWeapon");
      local_c70 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fLongAttackRange");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fLongAttackRange");
      local_c6c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szSkillTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szSkillTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_c68,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szSpecialTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szSpecialTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_c40,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szWeaknessTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szWeaknessTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_c18,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szCatchTable");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szCatchTable");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_bf0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"nComboType");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nComboType");
      local_bc8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nNoDamageMotion");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nNoDamageMotion");
      local_bc4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nNameTextID");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nNameTextID");
      local_bc0 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fWeaknessDamagePercent");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fWeaknessDamagePercent");
      local_bbc = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szDeathMotion");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szDeathMotion");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_bb8,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szColor");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szColor");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_b90,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szGlowColor");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szGlowColor");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_b68,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"fGlowSpeed");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fGlowSpeed");
      local_b40 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nEffectID");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nEffectID");
      local_b3c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nCostumeID");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nCostumeID");
      local_b38 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nEventPartID");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nEventPartID");
      local_b34 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nRespawnGod");
      local_12a8 = 0;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nRespawnGod");
      local_b30 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szFaceSprite");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szFaceSprite");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1020,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"fHeadPos");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fHeadPos");
      local_ff8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nQuestItemDropGroup");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nQuestItemDropGroup");
      local_ff4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nEventItemDropGroup");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nEventItemDropGroup");
      local_ff0 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nChampionItemDropGroup");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nChampionItemDropGroup");
      local_fec = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fEnemyGold");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fEnemyGold");
      local_fe8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fGoldprobability");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fGoldprobability");
      local_fe4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fEnemyExp");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fEnemyExp");
      local_fe0 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nInstanceItemDropGroup");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nInstanceItemDropGroup");
      local_fdc = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nRareCardItemDropGroup");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nRareCardItemDropGroup");
      local_fd8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropCount00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropCount00");
      local_fd4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropGroup00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropGroup00");
      local_fc8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropCount01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropCount01");
      local_fd0 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropGroup01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropGroup01");
      local_fc4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropCount02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropCount02");
      local_fcc = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropGroup02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropGroup02");
      local_fc0 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropCount00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropCount00");
      local_fbc = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropGroup00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropGroup00");
      local_fb0 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropCount01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropCount01");
      local_fb8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropGroup01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropGroup01");
      local_fac = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropCount02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropCount02");
      local_fb4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropGroup02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropGroup02");
      local_fa8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenDummy");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenDummy");
      local_f40 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenEffectID");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenEffectID");
      local_f3c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropGroup00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropGroup00");
      local_fa4 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropGroup01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropGroup01");
      local_fa0 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropGroup02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropGroup02");
      local_f9c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropCount00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropCount00");
      local_f98 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropCount01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropCount01");
      local_f94 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropCount02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropCount02");
      local_f90 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenQuestItemDropGroup00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenQuestItemDropGroup00");
      local_f8c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropGroupF00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropGroupF00");
      local_f88 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropGroupF01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropGroupF01");
      local_f84 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropGroupF02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropGroupF02");
      local_f80 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropGroupF00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropGroupF00");
      local_f70 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropGroupF01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropGroupF01");
      local_f6c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropGroupF02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropGroupF02");
      local_f68 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropGroupF00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropGroupF00");
      local_f58 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropGroupF01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropGroupF01");
      local_f54 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropGroupF02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropGroupF02");
      local_f50 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropCountF00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropCountF00");
      local_f7c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropCountF01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropCountF01");
      local_f78 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nItemDropCountF02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nItemDropCountF02");
      local_f74 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropCountF00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropCountF00");
      local_f64 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropCountF01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropCountF01");
      local_f60 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nFatigueItemDropCountF02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nFatigueItemDropCountF02");
      local_f5c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropCountF00");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropCountF00");
      local_f4c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropCountF01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropCountF01");
      local_f48 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nHiddenItemDropCountF02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nHiddenItemDropCountF02");
      local_f44 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nNoDrop");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nNoDrop");
      local_f38 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nCaught");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nCaught");
      local_f34 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fRisingDamageWeight");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fRisingDamageWeight");
      local_de8 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nAttributeResistanceFire");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nAttributeResistanceFire");
      local_b2c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nAttributeResistanceWater");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nAttributeResistanceWater");
      local_b28 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nAttributeResistanceLight");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nAttributeResistanceLight");
      local_b24 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nAttributeResistanceDarkness");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nAttributeResistanceDarkness");
      local_b20 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nAttributeResistanceEarth");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nAttributeResistanceEarth");
      local_b1c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nAttributeResistanceWindy");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nAttributeResistanceWindy");
      local_b18 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nAttributeResistanceToxication");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nAttributeResistanceToxication");
      local_b14 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"nAttributeResistanceLightning");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nAttributeResistanceLightning");
      local_b10 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance01");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance01");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_b08,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance02");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance02");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_ae0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance03");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance03");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_ab8,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance04");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance04");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_a90,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance05");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance05");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_a68,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance06");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance06");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_a40,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance07");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance07");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_a18,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance08");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance08");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_9f0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance09");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance09");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_9c8,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szConditionResistance10");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szConditionResistance10");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_9a0,psVar10,~uVar18 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue01");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue01");
      local_978 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue02");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue02");
      local_974 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue03");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue03");
      local_970 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue04");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue04");
      local_96c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue05");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue05");
      local_968 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue06");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue06");
      local_964 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue07");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue07");
      local_960 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue08");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue08");
      local_95c = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue09");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue09");
      local_958 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"fConditionResistanceValue10");
      local_12a8 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fConditionResistanceValue10");
      local_954 = *puVar8;
      uVar5 = FUN_1402970c0(lVar7,L"wszName");
      local_12a8 = 1;
      psVar10 = (short *)FUN_140296b70(lVar7,uVar3,uVar5,L"wszName");
      uVar18 = 0xffffffffffffffff;
      psVar19 = psVar10;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1260,psVar10,~uVar18 - 1);
      local_948 = uVar3;
      FUN_140304f60(local_940,local_1268);
      FUN_140303af0(&DAT_14060a9d0,local_948,local_940);
      FUN_140300830(local_940);
      lVar14 = (**(code **)(PTR_PTR_1405d8520 + 0x18))();
      lVar14 = lVar14 + 0x18;
      local_1298 = lVar14;
      if (psVar10 == (short *)0x0) {
        iVar16 = 0;
LAB_140300255:
        FUN_140306fd0(&local_1298,psVar10,iVar16);
        lVar14 = local_1298;
      }
      else {
        if (((ulonglong)psVar10 & 0xffffffffffff0000) != 0) {
          lVar14 = -1;
          psVar19 = psVar10;
          do {
            if (lVar14 == 0) break;
            lVar14 = lVar14 + -1;
            sVar2 = *psVar19;
            psVar19 = psVar19 + 1;
          } while (sVar2 != 0);
          iVar16 = ~(uint)lVar14 - 1;
          goto LAB_140300255;
        }
        lVar15 = FUN_140306ad0((ulonglong)psVar10 & 0xffff,0);
        if (lVar15 != 0) {
          FUN_140306d00(&local_1298,lVar15,(ulonglong)psVar10 & 0xffff);
          lVar14 = local_1298;
        }
      }
      local_1290 = uVar3;
      FUN_140303be0(&DAT_14060aa18,lVar14,uVar3);
      LOCK();
      piVar1 = (int *)(lVar14 + -8);
      iVar16 = *piVar1;
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (iVar16 + -1 < 1) {
        (**(code **)(**(longlong **)(lVar14 + -0x18) + 8))();
      }
      if ((0 < (int)local_1120) && (local_1108 != 0)) {
        if (DAT_14060a988 != 0) {
          for (puVar11 = *(uint **)(DAT_14060a988 +
                                   ((ulonglong)local_1120 % (ulonglong)DAT_14060a998) * 8);
              puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xc)) {
            if ((puVar11[0xe] == local_1120) && (*puVar11 == local_1120)) {
              if (puVar11 != (uint *)0x0) goto LAB_1403002f8;
              break;
            }
          }
        }
        FUN_140147fa0(&DAT_14060a988,local_1120,local_1118);
      }
LAB_1403002f8:
      if ((0 < (int)local_111c) && (local_10e0 != 0)) {
        if (DAT_14060a940 != 0) {
          for (puVar11 = *(uint **)(DAT_14060a940 +
                                   ((ulonglong)local_111c % (ulonglong)DAT_14060a950) * 8);
              puVar11 != (uint *)0x0; puVar11 = *(uint **)(puVar11 + 0xc)) {
            if ((puVar11[0xe] == local_111c) && (*puVar11 == local_111c)) {
              if (puVar11 != (uint *)0x0) goto LAB_140300355;
              break;
            }
          }
        }
        FUN_140147fa0(&DAT_14060a940,local_111c,local_10f0);
      }
LAB_140300355:
      FUN_140300830(local_1268);
      puVar8 = *(undefined4 **)(local_1288 + 6);
      if (puVar8 == (undefined4 *)0x0) {
        uVar4 = (uint)local_1288[8] % *(uint *)(lVar7 + 0x78) + 1;
        lVar14 = (longlong)(int)uVar4 << 3;
        do {
          if (*(uint *)(lVar7 + 0x78) <= uVar4) break;
          if (*(longlong *)(lVar14 + *(longlong *)(lVar7 + 0x68)) != 0) {
            puVar8 = *(undefined4 **)(lVar14 + *(longlong *)(lVar7 + 0x68));
          }
          uVar4 = uVar4 + 1;
          lVar14 = lVar14 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_1402fdbda;
    }
  }
  return;
}



longlong FUN_1403003e0(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x48) = 7;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined2 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x98) = 7;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined2 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0xc0) = 7;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  *(undefined8 *)(param_1 + 0x110) = 7;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined2 *)(param_1 + 0xf8) = 0;
  *(undefined8 *)(param_1 + 0x138) = 7;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 0x120) = 0;
  *(undefined8 *)(param_1 + 0x168) = 7;
  *(undefined8 *)(param_1 + 0x160) = 0;
  *(undefined2 *)(param_1 + 0x150) = 0;
  *(undefined8 *)(param_1 + 400) = 7;
  *(undefined8 *)(param_1 + 0x188) = 0;
  *(undefined2 *)(param_1 + 0x178) = 0;
  *(undefined8 *)(param_1 + 0x1c0) = 7;
  *(undefined8 *)(param_1 + 0x1b8) = 0;
  *(undefined2 *)(param_1 + 0x1a8) = 0;
  *(undefined8 *)(param_1 + 0x1f8) = 7;
  *(undefined8 *)(param_1 + 0x1f0) = 0;
  *(undefined2 *)(param_1 + 0x1e0) = 0;
  *(undefined8 *)(param_1 + 0x260) = 7;
  *(undefined8 *)(param_1 + 600) = 0;
  *(undefined2 *)(param_1 + 0x248) = 0;
  *(undefined8 *)(param_1 + 0x358) = 7;
  *(undefined8 *)(param_1 + 0x350) = 0;
  *(undefined2 *)(param_1 + 0x340) = 0;
  *(undefined8 *)(param_1 + 0x398) = 7;
  *(undefined8 *)(param_1 + 0x390) = 0;
  *(undefined2 *)(param_1 + 0x380) = 0;
  *(undefined8 *)(param_1 + 0x3c0) = 7;
  *(undefined8 *)(param_1 + 0x3b8) = 0;
  *(undefined2 *)(param_1 + 0x3a8) = 0;
  *(undefined8 *)(param_1 + 1000) = 7;
  *(undefined8 *)(param_1 + 0x3e0) = 0;
  *(undefined2 *)(param_1 + 0x3d0) = 0;
  *(undefined8 *)(param_1 + 0x448) = 7;
  *(undefined8 *)(param_1 + 0x440) = 0;
  *(undefined2 *)(param_1 + 0x430) = 0;
  *(undefined8 *)(param_1 + 0x470) = 7;
  *(undefined8 *)(param_1 + 0x468) = 0;
  *(undefined2 *)(param_1 + 0x458) = 0;
  *(undefined8 *)(param_1 + 0x4a0) = 7;
  *(undefined8 *)(param_1 + 0x498) = 0;
  *(undefined2 *)(param_1 + 0x488) = 0;
  *(undefined8 *)(param_1 + 0x4c8) = 7;
  *(undefined8 *)(param_1 + 0x4c0) = 0;
  *(undefined2 *)(param_1 + 0x4b0) = 0;
  *(undefined8 *)(param_1 + 0x4f0) = 7;
  *(undefined8 *)(param_1 + 0x4e8) = 0;
  *(undefined2 *)(param_1 + 0x4d8) = 0;
  *(undefined8 *)(param_1 + 0x518) = 7;
  *(undefined8 *)(param_1 + 0x510) = 0;
  *(undefined2 *)(param_1 + 0x500) = 0;
  *(undefined8 *)(param_1 + 0x540) = 7;
  *(undefined8 *)(param_1 + 0x538) = 0;
  *(undefined2 *)(param_1 + 0x528) = 0;
  *(undefined8 *)(param_1 + 0x568) = 7;
  *(undefined8 *)(param_1 + 0x560) = 0;
  *(undefined2 *)(param_1 + 0x550) = 0;
  *(undefined8 *)(param_1 + 0x590) = 7;
  *(undefined8 *)(param_1 + 0x588) = 0;
  *(undefined2 *)(param_1 + 0x578) = 0;
  *(undefined8 *)(param_1 + 0x5b8) = 7;
  *(undefined8 *)(param_1 + 0x5b0) = 0;
  *(undefined2 *)(param_1 + 0x5a0) = 0;
  *(undefined8 *)(param_1 + 0x5d8) = 0;
  *(undefined8 *)(param_1 + 0x5e0) = 7;
  *(undefined2 *)(param_1 + 0x5c8) = 0;
  *(undefined8 *)(param_1 + 0x610) = 0;
  *(undefined8 *)(param_1 + 0x618) = 7;
  *(undefined2 *)(param_1 + 0x600) = 0;
  *(undefined8 *)(param_1 + 0x638) = 0;
  *(undefined8 *)(param_1 + 0x640) = 7;
  *(undefined2 *)(param_1 + 0x628) = 0;
  *(undefined8 *)(param_1 + 0x660) = 0;
  *(undefined8 *)(param_1 + 0x668) = 7;
  *(undefined2 *)(param_1 + 0x650) = 0;
  *(undefined8 *)(param_1 + 0x688) = 0;
  *(undefined8 *)(param_1 + 0x690) = 7;
  *(undefined2 *)(param_1 + 0x678) = 0;
  *(undefined8 *)(param_1 + 0x6c0) = 0;
  *(undefined8 *)(param_1 + 0x6c8) = 7;
  *(undefined2 *)(param_1 + 0x6b0) = 0;
  *(undefined8 *)(param_1 + 0x6e8) = 0;
  *(undefined8 *)(param_1 + 0x6f0) = 7;
  *(undefined2 *)(param_1 + 0x6d8) = 0;
  *(undefined8 *)(param_1 + 0x710) = 0;
  *(undefined8 *)(param_1 + 0x718) = 7;
  *(undefined2 *)(param_1 + 0x700) = 0;
  *(undefined8 *)(param_1 + 0x770) = 0;
  *(undefined8 *)(param_1 + 0x778) = 7;
  *(undefined2 *)(param_1 + 0x760) = 0;
  *(undefined8 *)(param_1 + 0x798) = 0;
  *(undefined8 *)(param_1 + 0x7a0) = 7;
  *(undefined2 *)(param_1 + 0x788) = 0;
  *(undefined8 *)(param_1 + 0x7c0) = 0;
  *(undefined8 *)(param_1 + 0x7c8) = 7;
  *(undefined2 *)(param_1 + 0x7b0) = 0;
  *(undefined8 *)(param_1 + 0x7e8) = 0;
  *(undefined8 *)(param_1 + 0x7f0) = 7;
  *(undefined2 *)(param_1 + 0x7d8) = 0;
  *(undefined8 *)(param_1 + 0x810) = 0;
  *(undefined8 *)(param_1 + 0x818) = 7;
  *(undefined2 *)(param_1 + 0x800) = 0;
  *(undefined8 *)(param_1 + 0x838) = 0;
  *(undefined8 *)(param_1 + 0x840) = 7;
  *(undefined2 *)(param_1 + 0x828) = 0;
  *(undefined8 *)(param_1 + 0x860) = 0;
  *(undefined8 *)(param_1 + 0x868) = 7;
  *(undefined2 *)(param_1 + 0x850) = 0;
  *(undefined8 *)(param_1 + 0x888) = 0;
  *(undefined8 *)(param_1 + 0x890) = 7;
  *(undefined2 *)(param_1 + 0x878) = 0;
  *(undefined8 *)(param_1 + 0x8b0) = 0;
  *(undefined8 *)(param_1 + 0x8b8) = 7;
  *(undefined2 *)(param_1 + 0x8a0) = 0;
  *(undefined8 *)(param_1 + 0x8d8) = 0;
  *(undefined8 *)(param_1 + 0x8e0) = 7;
  *(undefined2 *)(param_1 + 0x8c8) = 0;
  return param_1;
}



void FUN_140300830(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x8e0)) {
    operator_delete(*(void **)(param_1 + 0x8c8));
  }
  *(undefined8 *)(param_1 + 0x8e0) = 7;
  *(undefined8 *)(param_1 + 0x8d8) = 0;
  *(undefined2 *)(param_1 + 0x8c8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x8b8)) {
    operator_delete(*(void **)(param_1 + 0x8a0));
  }
  *(undefined8 *)(param_1 + 0x8b8) = 7;
  *(undefined8 *)(param_1 + 0x8b0) = 0;
  *(undefined2 *)(param_1 + 0x8a0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x890)) {
    operator_delete(*(void **)(param_1 + 0x878));
  }
  *(undefined8 *)(param_1 + 0x890) = 7;
  *(undefined8 *)(param_1 + 0x888) = 0;
  *(undefined2 *)(param_1 + 0x878) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x868)) {
    operator_delete(*(void **)(param_1 + 0x850));
  }
  *(undefined8 *)(param_1 + 0x868) = 7;
  *(undefined8 *)(param_1 + 0x860) = 0;
  *(undefined2 *)(param_1 + 0x850) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x840)) {
    operator_delete(*(void **)(param_1 + 0x828));
  }
  *(undefined8 *)(param_1 + 0x840) = 7;
  *(undefined8 *)(param_1 + 0x838) = 0;
  *(undefined2 *)(param_1 + 0x828) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x818)) {
    operator_delete(*(void **)(param_1 + 0x800));
  }
  *(undefined8 *)(param_1 + 0x818) = 7;
  *(undefined8 *)(param_1 + 0x810) = 0;
  *(undefined2 *)(param_1 + 0x800) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x7f0)) {
    operator_delete(*(void **)(param_1 + 0x7d8));
  }
  *(undefined8 *)(param_1 + 0x7f0) = 7;
  *(undefined8 *)(param_1 + 0x7e8) = 0;
  *(undefined2 *)(param_1 + 0x7d8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x7c8)) {
    operator_delete(*(void **)(param_1 + 0x7b0));
  }
  *(undefined8 *)(param_1 + 0x7c8) = 7;
  *(undefined8 *)(param_1 + 0x7c0) = 0;
  *(undefined2 *)(param_1 + 0x7b0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x7a0)) {
    operator_delete(*(void **)(param_1 + 0x788));
  }
  *(undefined8 *)(param_1 + 0x7a0) = 7;
  *(undefined8 *)(param_1 + 0x798) = 0;
  *(undefined2 *)(param_1 + 0x788) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x778)) {
    operator_delete(*(void **)(param_1 + 0x760));
  }
  *(undefined8 *)(param_1 + 0x778) = 7;
  *(undefined8 *)(param_1 + 0x770) = 0;
  *(undefined2 *)(param_1 + 0x760) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x718)) {
    operator_delete(*(void **)(param_1 + 0x700));
  }
  *(undefined8 *)(param_1 + 0x718) = 7;
  *(undefined8 *)(param_1 + 0x710) = 0;
  *(undefined2 *)(param_1 + 0x700) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x6f0)) {
    operator_delete(*(void **)(param_1 + 0x6d8));
  }
  *(undefined8 *)(param_1 + 0x6f0) = 7;
  *(undefined8 *)(param_1 + 0x6e8) = 0;
  *(undefined2 *)(param_1 + 0x6d8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x6c8)) {
    operator_delete(*(void **)(param_1 + 0x6b0));
  }
  *(undefined8 *)(param_1 + 0x6c8) = 7;
  *(undefined8 *)(param_1 + 0x6c0) = 0;
  *(undefined2 *)(param_1 + 0x6b0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x690)) {
    operator_delete(*(void **)(param_1 + 0x678));
  }
  *(undefined8 *)(param_1 + 0x690) = 7;
  *(undefined8 *)(param_1 + 0x688) = 0;
  *(undefined2 *)(param_1 + 0x678) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x668)) {
    operator_delete(*(void **)(param_1 + 0x650));
  }
  *(undefined8 *)(param_1 + 0x668) = 7;
  *(undefined8 *)(param_1 + 0x660) = 0;
  *(undefined2 *)(param_1 + 0x650) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x640)) {
    operator_delete(*(void **)(param_1 + 0x628));
  }
  *(undefined8 *)(param_1 + 0x640) = 7;
  *(undefined8 *)(param_1 + 0x638) = 0;
  *(undefined2 *)(param_1 + 0x628) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x618)) {
    operator_delete(*(void **)(param_1 + 0x600));
  }
  *(undefined8 *)(param_1 + 0x618) = 7;
  *(undefined8 *)(param_1 + 0x610) = 0;
  *(undefined2 *)(param_1 + 0x600) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x5e0)) {
    operator_delete(*(void **)(param_1 + 0x5c8));
  }
  *(undefined8 *)(param_1 + 0x5e0) = 7;
  *(undefined8 *)(param_1 + 0x5d8) = 0;
  *(undefined2 *)(param_1 + 0x5c8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x5b8)) {
    operator_delete(*(void **)(param_1 + 0x5a0));
  }
  *(undefined8 *)(param_1 + 0x5b8) = 7;
  *(undefined8 *)(param_1 + 0x5b0) = 0;
  *(undefined2 *)(param_1 + 0x5a0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x590)) {
    operator_delete(*(void **)(param_1 + 0x578));
  }
  *(undefined8 *)(param_1 + 0x590) = 7;
  *(undefined8 *)(param_1 + 0x588) = 0;
  *(undefined2 *)(param_1 + 0x578) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x568)) {
    operator_delete(*(void **)(param_1 + 0x550));
  }
  *(undefined8 *)(param_1 + 0x568) = 7;
  *(undefined8 *)(param_1 + 0x560) = 0;
  *(undefined2 *)(param_1 + 0x550) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x540)) {
    operator_delete(*(void **)(param_1 + 0x528));
  }
  *(undefined8 *)(param_1 + 0x540) = 7;
  *(undefined8 *)(param_1 + 0x538) = 0;
  *(undefined2 *)(param_1 + 0x528) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x518)) {
    operator_delete(*(void **)(param_1 + 0x500));
  }
  *(undefined8 *)(param_1 + 0x518) = 7;
  *(undefined8 *)(param_1 + 0x510) = 0;
  *(undefined2 *)(param_1 + 0x500) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x4f0)) {
    operator_delete(*(void **)(param_1 + 0x4d8));
  }
  *(undefined8 *)(param_1 + 0x4f0) = 7;
  *(undefined8 *)(param_1 + 0x4e8) = 0;
  *(undefined2 *)(param_1 + 0x4d8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x4c8)) {
    operator_delete(*(void **)(param_1 + 0x4b0));
  }
  *(undefined8 *)(param_1 + 0x4c8) = 7;
  *(undefined8 *)(param_1 + 0x4c0) = 0;
  *(undefined2 *)(param_1 + 0x4b0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x4a0)) {
    operator_delete(*(void **)(param_1 + 0x488));
  }
  *(undefined8 *)(param_1 + 0x4a0) = 7;
  *(undefined8 *)(param_1 + 0x498) = 0;
  *(undefined2 *)(param_1 + 0x488) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x470)) {
    operator_delete(*(void **)(param_1 + 0x458));
  }
  *(undefined8 *)(param_1 + 0x470) = 7;
  *(undefined8 *)(param_1 + 0x468) = 0;
  *(undefined2 *)(param_1 + 0x458) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x448)) {
    operator_delete(*(void **)(param_1 + 0x430));
  }
  *(undefined8 *)(param_1 + 0x448) = 7;
  *(undefined8 *)(param_1 + 0x440) = 0;
  *(undefined2 *)(param_1 + 0x430) = 0;
  if (7 < *(ulonglong *)(param_1 + 1000)) {
    operator_delete(*(void **)(param_1 + 0x3d0));
  }
  *(undefined8 *)(param_1 + 1000) = 7;
  *(undefined8 *)(param_1 + 0x3e0) = 0;
  *(undefined2 *)(param_1 + 0x3d0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x3c0)) {
    operator_delete(*(void **)(param_1 + 0x3a8));
  }
  *(undefined8 *)(param_1 + 0x3c0) = 7;
  *(undefined8 *)(param_1 + 0x3b8) = 0;
  *(undefined2 *)(param_1 + 0x3a8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x398)) {
    operator_delete(*(void **)(param_1 + 0x380));
  }
  *(undefined8 *)(param_1 + 0x398) = 7;
  *(undefined8 *)(param_1 + 0x390) = 0;
  *(undefined2 *)(param_1 + 0x380) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x358)) {
    operator_delete(*(void **)(param_1 + 0x340));
  }
  *(undefined8 *)(param_1 + 0x358) = 7;
  *(undefined8 *)(param_1 + 0x350) = 0;
  *(undefined2 *)(param_1 + 0x340) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x260)) {
    operator_delete(*(void **)(param_1 + 0x248));
  }
  *(undefined8 *)(param_1 + 0x260) = 7;
  *(undefined8 *)(param_1 + 600) = 0;
  *(undefined2 *)(param_1 + 0x248) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1f8)) {
    operator_delete(*(void **)(param_1 + 0x1e0));
  }
  *(undefined8 *)(param_1 + 0x1f8) = 7;
  *(undefined8 *)(param_1 + 0x1f0) = 0;
  *(undefined2 *)(param_1 + 0x1e0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1c0)) {
    operator_delete(*(void **)(param_1 + 0x1a8));
  }
  *(undefined8 *)(param_1 + 0x1c0) = 7;
  *(undefined8 *)(param_1 + 0x1b8) = 0;
  *(undefined2 *)(param_1 + 0x1a8) = 0;
  if (7 < *(ulonglong *)(param_1 + 400)) {
    operator_delete(*(void **)(param_1 + 0x178));
  }
  *(undefined8 *)(param_1 + 400) = 7;
  *(undefined8 *)(param_1 + 0x188) = 0;
  *(undefined2 *)(param_1 + 0x178) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x168)) {
    operator_delete(*(void **)(param_1 + 0x150));
  }
  *(undefined8 *)(param_1 + 0x168) = 7;
  *(undefined8 *)(param_1 + 0x160) = 0;
  *(undefined2 *)(param_1 + 0x150) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x138)) {
    operator_delete(*(void **)(param_1 + 0x120));
  }
  *(undefined8 *)(param_1 + 0x138) = 7;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 0x120) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x110)) {
    operator_delete(*(void **)(param_1 + 0xf8));
  }
  *(undefined8 *)(param_1 + 0x110) = 7;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined2 *)(param_1 + 0xf8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xe8)) {
    operator_delete(*(void **)(param_1 + 0xd0));
  }
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xc0)) {
    operator_delete(*(void **)(param_1 + 0xa8));
  }
  *(undefined8 *)(param_1 + 0xc0) = 7;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x98)) {
    operator_delete(*(void **)(param_1 + 0x80));
  }
  *(undefined8 *)(param_1 + 0x98) = 7;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined2 *)(param_1 + 0x80) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  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_140301090(longlong param_1)

{
  FUN_140300830(param_1 + 8);
  return;
}



void FUN_1403010a0(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;
}



uint FUN_1403010d0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x6b];
      }
    }
  }
  return 0;
}



uint FUN_140301120(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x6a];
      }
    }
  }
  return 0;
}



uint FUN_140301170(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x91];
      }
    }
  }
  return 0;
}



uint FUN_1403011d0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x92];
      }
    }
  }
  return 0;
}



uint FUN_140301230(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xd1];
      }
    }
  }
  return 0;
}



uint * FUN_140301280(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x6c;
        if (7 < *(ulonglong *)(puVar1 + 0x72)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint FUN_1403012e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x76];
      }
    }
  }
  return 0;
}



uint FUN_140301340(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x77];
      }
    }
  }
  return 0;
}



uint * FUN_1403013a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0xd2;
        if (7 < *(ulonglong *)(puVar1 + 0xd8)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint FUN_140301400(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xdc];
      }
    }
  }
  return 0;
}



uint FUN_140301460(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xdd];
      }
    }
  }
  return 0;
}



uint FUN_1403014c0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xde];
      }
    }
  }
  return 0;
}



uint FUN_140301520(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xdf];
      }
    }
  }
  return 0;
}



uint FUN_140301580(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xe0];
      }
    }
  }
  return 0;
}



uint FUN_1403015e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xe1];
      }
    }
  }
  return 0;
}



uint * FUN_140301640(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0xe2;
        if (7 < *(ulonglong *)(puVar1 + 0xe8)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_1403016a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0xec;
        if (7 < *(ulonglong *)(puVar1 + 0xf2)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140301700(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0xf6;
        if (7 < *(ulonglong *)(puVar1 + 0xfc)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint FUN_140301760(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x100];
      }
    }
  }
  return 0;
}



uint FUN_1403017c0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x101];
      }
    }
  }
  return 0;
}



uint FUN_140301820(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x102];
      }
    }
  }
  return 0;
}



uint FUN_140301880(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x103];
      }
    }
  }
  return 0;
}



uint FUN_1403018e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x104];
      }
    }
  }
  return 0;
}



uint FUN_140301940(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x105];
      }
    }
  }
  return 0;
}



uint FUN_1403019a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x106];
      }
    }
  }
  return 0;
}



uint FUN_140301a00(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x107];
      }
    }
  }
  return 0;
}



uint FUN_140301a60(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x108];
      }
    }
  }
  return 0;
}



uint FUN_140301ac0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x109];
      }
    }
  }
  return 0;
}



uint FUN_140301b20(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x10a];
      }
    }
  }
  return 0;
}



uint FUN_140301b80(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x10b];
      }
    }
  }
  return 0;
}



uint FUN_140301be0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x10c];
      }
    }
  }
  return 0;
}



uint * FUN_140301c40(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x10e;
        if (7 < *(ulonglong *)(puVar1 + 0x114)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140301ca0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x118;
        if (7 < *(ulonglong *)(puVar1 + 0x11e)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint FUN_140301d00(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x122];
      }
    }
  }
  return 0;
}



uint * FUN_140301d60(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x124;
        if (7 < *(ulonglong *)(puVar1 + 0x12a)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140301dc0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x12e;
        if (7 < *(ulonglong *)(puVar1 + 0x134)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140301e20(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x138;
        if (7 < *(ulonglong *)(puVar1 + 0x13e)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140301e80(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x142;
        if (7 < *(ulonglong *)(puVar1 + 0x148)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140301ee0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x14c;
        if (7 < *(ulonglong *)(puVar1 + 0x152)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140301f40(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x156;
        if (7 < *(ulonglong *)(puVar1 + 0x15c)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140301fa0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x160;
        if (7 < *(ulonglong *)(puVar1 + 0x166)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140302000(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x16a;
        if (7 < *(ulonglong *)(puVar1 + 0x170)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140302060(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x174;
        if (7 < *(ulonglong *)(puVar1 + 0x17a)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint FUN_1403020c0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x17e];
      }
    }
  }
  return 0;
}



uint FUN_140302120(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x17f];
      }
    }
  }
  return 0;
}



uint FUN_140302180(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x181];
      }
    }
  }
  return 0;
}



uint * FUN_1403021e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x182;
        if (7 < *(ulonglong *)(puVar1 + 0x188)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140302240(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x18c;
        if (7 < *(ulonglong *)(puVar1 + 0x192)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_1403022a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x196;
        if (7 < *(ulonglong *)(puVar1 + 0x19c)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140302300(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x1a0;
        if (7 < *(ulonglong *)(puVar1 + 0x1a6)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint FUN_140302360(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1ad];
      }
    }
  }
  return 0;
}



uint * FUN_1403023c0(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x1ae;
        if (7 < *(ulonglong *)(puVar1 + 0x1b4)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140302420(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x1b8;
        if (7 < *(ulonglong *)(puVar1 + 0x1be)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint * FUN_140302480(longlong param_1,uint param_2)

{
  uint *puVar1;
  uint *puVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)&DAT_140477960;
        }
        puVar2 = puVar1 + 0x1c2;
        if (7 < *(ulonglong *)(puVar1 + 0x1c8)) {
          puVar2 = *(uint **)puVar2;
        }
        return puVar2;
      }
    }
  }
  return (uint *)&DAT_140477960;
}



uint FUN_1403024e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1cc];
      }
    }
  }
  return 0;
}



uint FUN_140302540(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1cd];
      }
    }
  }
  return 0;
}



uint FUN_140302590(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1ce];
      }
    }
  }
  return 0;
}



uint FUN_1403025e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1cf];
      }
    }
  }
  return 0;
}



uint FUN_140302630(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1d0];
      }
    }
  }
  return 0;
}



wchar_t * FUN_140302680(longlong param_1,uint param_2)

{
  uint *puVar1;
  wchar_t *pwVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return L"undefined";
        }
        pwVar2 = (wchar_t *)(puVar1 + 0x18);
        if (7 < *(ulonglong *)(puVar1 + 0x1e)) {
          pwVar2 = *(wchar_t **)pwVar2;
        }
        return pwVar2;
      }
    }
  }
  return L"undefined";
}



wchar_t * FUN_1403026e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  wchar_t *pwVar2;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return L"undefined";
        }
        pwVar2 = (wchar_t *)(puVar1 + 0x22);
        if (7 < *(ulonglong *)(puVar1 + 0x28)) {
          pwVar2 = *(wchar_t **)pwVar2;
        }
        return pwVar2;
      }
    }
  }
  return L"undefined";
}



uint FUN_140302740(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0x43480000;
        }
        return puVar1[0x9e];
      }
    }
  }
  return 0x43480000;
}



undefined8 FUN_1403027a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return CONCAT71((int7)((ulonglong)puVar1 >> 8),puVar1[0xcf] != 0);
      }
    }
  }
  return 0;
}



uint FUN_140302800(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1d2];
      }
    }
  }
  return 0;
}



uint FUN_140302850(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1d3];
      }
    }
  }
  return 0;
}



uint FUN_1403028a0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1d4];
      }
    }
  }
  return 0;
}



uint FUN_1403028f0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1d5];
      }
    }
  }
  return 0;
}



uint FUN_140302940(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1d6];
      }
    }
  }
  return 0;
}



uint FUN_140302990(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1d7];
      }
    }
  }
  return 0;
}



uint FUN_1403029e0(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0x1d8];
      }
    }
  }
  return 0;
}



wchar_t * FUN_140302a30(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          if (param_3 == 0) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x1e0) < 8) {
              return (wchar_t *)(puVar1 + 0x1da);
            }
            return *(wchar_t **)(puVar1 + 0x1da);
          }
          if (param_3 == 1) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x1ea) < 8) {
              return (wchar_t *)(puVar1 + 0x1e4);
            }
            return *(wchar_t **)(puVar1 + 0x1e4);
          }
          if (param_3 == 2) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 500) < 8) {
              return (wchar_t *)(puVar1 + 0x1ee);
            }
            return *(wchar_t **)(puVar1 + 0x1ee);
          }
          if (param_3 == 3) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x1fe) < 8) {
              return (wchar_t *)(puVar1 + 0x1f8);
            }
            return *(wchar_t **)(puVar1 + 0x1f8);
          }
          if (param_3 == 4) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x208) < 8) {
              return (wchar_t *)(puVar1 + 0x202);
            }
            return *(wchar_t **)(puVar1 + 0x202);
          }
          if (param_3 == 5) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x212) < 8) {
              return (wchar_t *)(puVar1 + 0x20c);
            }
            return *(wchar_t **)(puVar1 + 0x20c);
          }
          if (param_3 == 6) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x21c) < 8) {
              return (wchar_t *)(puVar1 + 0x216);
            }
            return *(wchar_t **)(puVar1 + 0x216);
          }
          if (param_3 == 7) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x226) < 8) {
              return (wchar_t *)(puVar1 + 0x220);
            }
            return *(wchar_t **)(puVar1 + 0x220);
          }
          if (param_3 == 8) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x230) < 8) {
              return (wchar_t *)(puVar1 + 0x22a);
            }
            return *(wchar_t **)(puVar1 + 0x22a);
          }
          if (param_3 == 9) {
            if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            if (*(ulonglong *)(puVar1 + 0x23a) < 8) {
              return (wchar_t *)(puVar1 + 0x234);
            }
            return *(wchar_t **)(puVar1 + 0x234);
          }
        }
        break;
      }
    }
  }
  return L"not_found";
}



uint FUN_140302c60(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        if (param_3 == 0) {
          if (puVar1 != (uint *)0x0) {
            return puVar1[0x23e];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (param_3 == 1) {
          if (puVar1 != (uint *)0x0) {
            return puVar1[0x23f];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (param_3 == 2) {
          if (puVar1 != (uint *)0x0) {
            return puVar1[0x240];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (param_3 == 3) {
          if (puVar1 != (uint *)0x0) {
            return puVar1[0x241];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (param_3 == 4) {
          if (puVar1 != (uint *)0x0) {
            return puVar1[0x242];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (param_3 == 5) {
          if (puVar1 != (uint *)0x0) {
            return puVar1[0x243];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (param_3 != 6) {
          if (param_3 == 7) {
            if (puVar1 != (uint *)0x0) {
              return puVar1[0x245];
            }
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (param_3 == 8) {
            if (puVar1 != (uint *)0x0) {
              return puVar1[0x246];
            }
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          if (param_3 != 9) {
            return 0;
          }
          if (puVar1 != (uint *)0x0) {
            return puVar1[0x247];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (puVar1 != (uint *)0x0) {
          return puVar1[0x244];
        }
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
    }
  }
  return 0;
}



uint FUN_140302e20(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xcc];
      }
    }
  }
  return 0;
}



uint FUN_140302e70(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[0xcd];
      }
    }
  }
  return 0;
}



uint FUN_140302ec0(longlong param_1,uint param_2,int param_3)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x248)) {
      if ((puVar1[0x24a] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        if (param_3 == 0) {
          if (puVar1 != (uint *)0x0) {
            return puVar1[0xb3];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (param_3 == 1) {
          if (puVar1 != (uint *)0x0) {
            return puVar1[0xb4];
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        if (param_3 != 2) {
          return 0;
        }
        if (puVar1 != (uint *)0x0) {
          return puVar1[0xb5];
        }
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
    }
  }
  return 0;
}



undefined8 * FUN_140302f80(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetMonsterDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf4c & 1) == 0) {
    DAT_14060cf4c = DAT_14060cf4c | 1;
    FUN_1402fd8c0();
    atexit(FUN_140448fc0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetMonsterDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_14060a940;
}



void thunk_FUN_140303ea0(void)

{
  FUN_140303ea0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140303020(void)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  short *psVar7;
  undefined4 *puVar8;
  undefined8 uVar9;
  undefined8 uVar10;
  undefined8 uVar11;
  longlong lVar12;
  longlong *plVar13;
  ulonglong uVar14;
  short *psVar15;
  undefined4 *puVar16;
  undefined1 auStack_298 [32];
  undefined1 local_278;
  undefined8 local_268;
  undefined2 local_258;
  undefined6 uStack_256;
  undefined8 local_248;
  ulonglong local_240;
  undefined4 local_230;
  undefined4 local_22c;
  undefined4 local_228;
  undefined4 local_224;
  undefined4 local_220;
  undefined4 local_21c;
  undefined4 local_218;
  undefined4 local_214;
  undefined4 local_210;
  undefined4 local_20c;
  undefined4 local_208;
  undefined4 local_204;
  undefined4 local_200;
  undefined4 local_1fc;
  undefined4 local_1f8;
  undefined4 local_1f4;
  undefined4 local_1f0;
  undefined4 local_1ec;
  undefined2 local_1e8;
  undefined6 uStack_1e6;
  undefined8 local_1d8;
  ulonglong local_1d0;
  undefined4 local_1c0;
  undefined4 local_1bc;
  undefined4 local_1b8;
  undefined4 local_1b4;
  undefined4 local_1b0;
  undefined4 local_1ac;
  undefined4 local_1a8;
  undefined4 local_1a4;
  undefined4 local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined2 local_190;
  undefined6 uStack_18e;
  undefined8 local_180;
  ulonglong local_178;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_148;
  undefined1 local_140 [264];
  ulonglong local_38;
  undefined4 *puVar6;
  
  local_268 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_298;
  lVar5 = FUN_1402933b0(DAT_140607ff0,&DAT_1404aed90);
  if (lVar5 != 0) {
    puVar16 = (undefined4 *)0x0;
    puVar8 = puVar16;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar6 = puVar16;
      plVar13 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar13 != 0) {
          puVar8 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar3 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar3;
        plVar13 = plVar13 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_1403030c0:
    puVar6 = puVar8;
    if (puVar6 != (undefined4 *)0x0) {
      uVar2 = *puVar6;
      local_240 = 7;
      local_248 = 0;
      local_258 = 0;
      local_1d0 = 7;
      local_1d8 = 0;
      local_1e8 = 0;
      local_178 = 7;
      local_180 = 0;
      local_190 = 0;
      uVar4 = FUN_1402970c0(lVar5,L"szName");
      local_278 = 1;
      psVar7 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szName");
      uVar14 = 0xffffffffffffffff;
      psVar15 = psVar7;
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar1 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_258,psVar7,~uVar14 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"nMelee");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nMelee");
      local_230 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nPatrol");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nPatrol");
      local_22c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nLongRange");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nLongRange");
      local_228 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nSingleMagic");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nSingleMagic");
      local_224 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nRangeMagic");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nRangeMagic");
      local_220 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nSideStep");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nSideStep");
      local_21c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fSideStepDelay");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fSideStepDelay");
      local_218 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fSideStepPriority");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fSideStepPriority");
      local_214 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nRunaway");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nRunaway");
      local_210 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nGuard");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nGuard");
      local_20c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fGuardDuration");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fGuardDuration");
      local_208 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nBackStep");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nBackStep");
      local_204 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fBackStepDelay");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fBackStepDelay");
      local_200 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fBackStepPriority");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fBackStepPriority");
      local_1fc = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nGuardCountAttack_Combo");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nGuardCountAttack_Combo");
      local_1f8 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nGuardCountAttack_Damage");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nGuardCountAttack_Damage");
      local_1f4 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fGuardProbability");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fGuardProbability");
      local_1f0 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nGuardCountComboID");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nGuardCountComboID");
      local_1ec = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"szStandUpAttackMotionName");
      local_278 = 1;
      psVar7 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szStandUpAttackMotionName");
      uVar14 = 0xffffffffffffffff;
      psVar15 = psVar7;
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar1 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_1e8,psVar7,~uVar14 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"fHPCheck");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fHPCheck");
      local_1c0 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fMPCheck");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fMPCheck");
      local_1bc = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"szHPCheckAction");
      local_278 = 1;
      uVar9 = FUN_140296990(lVar5,uVar2,uVar4,L"szHPCheckAction");
      uVar4 = FUN_1402970c0(lVar5,L"szMPCheckAction");
      local_278 = 1;
      uVar10 = FUN_140296990(lVar5,uVar2,uVar4,L"szMPCheckAction");
      uVar4 = FUN_1402970c0(lVar5,L"szAfterDown");
      local_278 = 1;
      uVar11 = FUN_140296990(lVar5,uVar2,uVar4,L"szAfterDown");
      local_1b8 = FUN_14034e7c0(uVar9);
      local_1b4 = FUN_14034e7c0(uVar10);
      local_1b0 = FUN_14034e7c0(uVar11);
      uVar4 = FUN_1402970c0(lVar5,L"fGuardBlockPercent");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fGuardBlockPercent");
      local_1ac = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fGuardCheckTime");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fGuardCheckTime");
      local_1a8 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fGuardBlockPlus");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fGuardBlockPlus");
      local_1a4 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fRisingDamageFail");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fRisingDamageFail");
      local_1a0 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fRisingDamageFailDelay");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fRisingDamageFailDelay");
      local_19c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fStandUpAttackPriority");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fStandUpAttackPriority");
      local_198 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fCatchCounterPriority");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fCatchCounterPriority");
      local_194 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"szCatchCounterMotion");
      local_278 = 1;
      psVar7 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szCatchCounterMotion");
      uVar14 = 0xffffffffffffffff;
      psVar15 = psVar7;
      do {
        if (uVar14 == 0) break;
        uVar14 = uVar14 - 1;
        sVar1 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_190,psVar7,~uVar14 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"fGuarBreakPriority");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fGuarBreakPriority");
      local_168 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nGuardBreakCount");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nGuardBreakCount");
      local_164 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"fCountAttackPriority");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar2,uVar4,L"fCountAttackPriority");
      local_160 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nCountDamageCnt");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nCountDamageCnt");
      local_15c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nCountAttackComboID");
      local_278 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nCountAttackComboID");
      local_158 = *puVar8;
      local_148 = uVar2;
      FUN_140305ce0(local_140,&local_258);
      FUN_140303de0(local_148);
      FUN_140303990(local_140);
      if (7 < local_178) {
        operator_delete((void *)CONCAT62(uStack_18e,local_190));
      }
      local_178 = 7;
      local_180 = 0;
      local_190 = 0;
      if (7 < local_1d0) {
        operator_delete((void *)CONCAT62(uStack_1e6,local_1e8));
      }
      local_1d0 = 7;
      local_1d8 = 0;
      local_1e8 = 0;
      if (7 < local_240) {
        operator_delete((void *)CONCAT62(uStack_256,local_258));
      }
      puVar8 = *(undefined4 **)(puVar6 + 6);
      if (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar6[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar12 = (longlong)(int)uVar3 << 3;
        puVar8 = puVar16;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar12 + *(longlong *)(lVar5 + 0x68)) != 0) {
            puVar8 = *(undefined4 **)(lVar12 + *(longlong *)(lVar5 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar12 = lVar12 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_1403030c0;
    }
  }
  return;
}



void FUN_140303990(undefined8 *param_1)

{
  if (7 < (ulonglong)param_1[0x1c]) {
    operator_delete((void *)param_1[0x19]);
  }
  param_1[0x1c] = 7;
  param_1[0x1b] = 0;
  *(undefined2 *)(param_1 + 0x19) = 0;
  if (7 < (ulonglong)param_1[0x11]) {
    operator_delete((void *)param_1[0xe]);
  }
  param_1[0x11] = 7;
  param_1[0x10] = 0;
  *(undefined2 *)(param_1 + 0xe) = 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;
}



void FUN_140303a30(longlong param_1)

{
  FUN_140303990(param_1 + 8);
  return;
}



undefined8 * FUN_140303a40(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetEnemyAIDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf28 & 1) == 0) {
    DAT_14060cf28 = DAT_14060cf28 | 1;
    FUN_140303d10(0x3f400000,0x3e800000,0x40100000);
    FUN_140303020();
    atexit((_func_5014 *)&LAB_140449000);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetEnemyAIDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_140608630;
}



uint * FUN_140303af0(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x248)) {
      if ((puVar2[0x24a] == param_2) && (*puVar2 == param_2)) {
        FUN_140303ec0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140306070(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_140303ec0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_140303bc0(void)

{
  FUN_140304b10();
  return;
}



undefined8 * FUN_140303be0(longlong *param_1,ushort *param_2,undefined4 param_3,undefined8 param_4)

{
  ushort uVar1;
  short sVar2;
  short sVar3;
  ulonglong uVar4;
  char cVar5;
  short *psVar6;
  undefined8 *puVar7;
  ushort *puVar8;
  ulonglong uVar9;
  longlong lVar10;
  
  uVar9 = 0;
  if (param_2 == (ushort *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar1 = *param_2;
  puVar8 = param_2;
  while (uVar1 != 0) {
    uVar9 = (ulonglong)((int)uVar9 * 0x21 + (uint)uVar1);
    puVar8 = puVar8 + 1;
    uVar1 = *puVar8;
  }
  uVar4 = uVar9 % (ulonglong)*(uint *)(param_1 + 2);
  if (*param_1 == 0) {
    cVar5 = FUN_1402c6d50(param_1,*(uint *)(param_1 + 2),1,param_4,0xfffffffffffffffe);
    if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar7 = *(undefined8 **)(*param_1 + uVar4 * 8); puVar7 != (undefined8 *)0x0;
        puVar7 = (undefined8 *)puVar7[2]) {
      if (*(int *)(puVar7 + 3) == (int)uVar9) {
        psVar6 = (short *)*puVar7;
        lVar10 = (longlong)param_2 - (longlong)psVar6;
        do {
          sVar2 = *psVar6;
          sVar3 = *(short *)((longlong)psVar6 + lVar10);
          if (sVar2 != sVar3) break;
          psVar6 = psVar6 + 1;
        } while (sVar3 != 0);
        if (sVar2 == sVar3) {
          *(undefined4 *)(puVar7 + 1) = param_3;
          return puVar7;
        }
      }
    }
  }
  puVar7 = (undefined8 *)FUN_140306280(param_1,param_2,uVar4,uVar9);
  *(undefined4 *)(puVar7 + 1) = param_3;
  return puVar7;
}



void FUN_140303cf0(void)

{
  FUN_140304c70();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140303d10(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060864c = param_3;
  lVar1 = 0;
  DAT_140608640 = 0x11;
  DAT_140608664 = 10;
  _DAT_140608644 = param_1;
  _DAT_140608648 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608630 = 0;
  DAT_140608638 = 0;
  DAT_140608660 = 0;
  DAT_140608668 = 0;
  DAT_140608670 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608650 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608658 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608658 = 0;
  }
  return &DAT_140608630;
}



uint * FUN_140303de0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608640;
  if (DAT_140608630 == 0) {
    cVar2 = FUN_1403064a0((ulonglong)DAT_140608640,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608630 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x44)) {
      if ((puVar3[0x46] == param_1) && (*puVar3 == param_1)) {
        FUN_140304970(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140306860(param_1,uVar1,param_1);
  FUN_140304970(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140303ea0(void)

{
  FUN_140304dc0();
  return;
}



undefined4 * FUN_140303ec0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1400015e0(param_1 + 2,param_2 + 2,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x20,param_2 + 0x20,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x2a,param_2 + 0x2a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x34,param_2 + 0x34,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x3e,param_2 + 0x3e,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x48,param_2 + 0x48,0,0xffffffffffffffff);
  param_1[0x52] = param_2[0x52];
  param_1[0x53] = param_2[0x53];
  FUN_1400015e0(param_1 + 0x54,param_2 + 0x54,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x5e,param_2 + 0x5e,0,0xffffffffffffffff);
  param_1[0x68] = param_2[0x68];
  param_1[0x69] = param_2[0x69];
  FUN_1400015e0(param_1 + 0x6a,param_2 + 0x6a,0,0xffffffffffffffff);
  param_1[0x74] = param_2[0x74];
  param_1[0x75] = param_2[0x75];
  param_1[0x76] = param_2[0x76];
  param_1[0x77] = param_2[0x77];
  FUN_1400015e0(param_1 + 0x78,param_2 + 0x78,0,0xffffffffffffffff);
  param_1[0x82] = param_2[0x82];
  param_1[0x83] = param_2[0x83];
  param_1[0x84] = param_2[0x84];
  param_1[0x85] = param_2[0x85];
  param_1[0x86] = param_2[0x86];
  param_1[0x87] = param_2[0x87];
  param_1[0x88] = param_2[0x88];
  param_1[0x89] = param_2[0x89];
  param_1[0x8a] = param_2[0x8a];
  param_1[0x8b] = param_2[0x8b];
  param_1[0x8c] = param_2[0x8c];
  param_1[0x8d] = param_2[0x8d];
  param_1[0x8e] = param_2[0x8e];
  param_1[0x8f] = param_2[0x8f];
  param_1[0x90] = param_2[0x90];
  FUN_1400015e0(param_1 + 0x92,param_2 + 0x92,0,0xffffffffffffffff);
  param_1[0x9c] = param_2[0x9c];
  param_1[0x9d] = param_2[0x9d];
  param_1[0x9e] = param_2[0x9e];
  param_1[0x9f] = param_2[0x9f];
  param_1[0xa0] = param_2[0xa0];
  param_1[0xa1] = param_2[0xa1];
  param_1[0xa2] = param_2[0xa2];
  param_1[0xa3] = param_2[0xa3];
  param_1[0xa4] = param_2[0xa4];
  param_1[0xa5] = param_2[0xa5];
  param_1[0xa6] = param_2[0xa6];
  param_1[0xa7] = param_2[0xa7];
  param_1[0xa8] = param_2[0xa8];
  param_1[0xa9] = param_2[0xa9];
  param_1[0xaa] = param_2[0xaa];
  param_1[0xab] = param_2[0xab];
  param_1[0xac] = param_2[0xac];
  param_1[0xad] = param_2[0xad];
  param_1[0xae] = param_2[0xae];
  param_1[0xaf] = param_2[0xaf];
  param_1[0xb0] = param_2[0xb0];
  param_1[0xb1] = param_2[0xb1];
  param_1[0xb2] = param_2[0xb2];
  param_1[0xb3] = param_2[0xb3];
  param_1[0xb4] = param_2[0xb4];
  param_1[0xb5] = param_2[0xb5];
  param_1[0xb6] = param_2[0xb6];
  param_1[0xb7] = param_2[0xb7];
  param_1[0xb8] = param_2[0xb8];
  param_1[0xb9] = param_2[0xb9];
  param_1[0xba] = param_2[0xba];
  param_1[0xbb] = param_2[0xbb];
  param_1[0xbc] = param_2[0xbc];
  param_1[0xbd] = param_2[0xbd];
  param_1[0xbe] = param_2[0xbe];
  param_1[0xbf] = param_2[0xbf];
  param_1[0xc0] = param_2[0xc0];
  param_1[0xc1] = param_2[0xc1];
  param_1[0xc2] = param_2[0xc2];
  param_1[0xc3] = param_2[0xc3];
  param_1[0xc4] = param_2[0xc4];
  param_1[0xc5] = param_2[0xc5];
  param_1[0xc6] = param_2[0xc6];
  param_1[199] = param_2[199];
  param_1[200] = param_2[200];
  param_1[0xc9] = param_2[0xc9];
  param_1[0xca] = param_2[0xca];
  param_1[0xcb] = param_2[0xcb];
  param_1[0xcc] = param_2[0xcc];
  param_1[0xcd] = param_2[0xcd];
  param_1[0xce] = param_2[0xce];
  param_1[0xcf] = param_2[0xcf];
  FUN_1400015e0(param_1 + 0xd0,param_2 + 0xd0,0,0xffffffffffffffff);
  param_1[0xda] = param_2[0xda];
  param_1[0xdb] = param_2[0xdb];
  param_1[0xdc] = param_2[0xdc];
  param_1[0xdd] = param_2[0xdd];
  param_1[0xde] = param_2[0xde];
  param_1[0xdf] = param_2[0xdf];
  FUN_1400015e0(param_1 + 0xe0,param_2 + 0xe0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xea,param_2 + 0xea,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xf4,param_2 + 0xf4,0,0xffffffffffffffff);
  param_1[0xfe] = param_2[0xfe];
  param_1[0xff] = param_2[0xff];
  param_1[0x100] = param_2[0x100];
  param_1[0x101] = param_2[0x101];
  param_1[0x102] = param_2[0x102];
  param_1[0x103] = param_2[0x103];
  param_1[0x104] = param_2[0x104];
  param_1[0x105] = param_2[0x105];
  param_1[0x106] = param_2[0x106];
  param_1[0x107] = param_2[0x107];
  param_1[0x108] = param_2[0x108];
  param_1[0x109] = param_2[0x109];
  param_1[0x10a] = param_2[0x10a];
  FUN_1400015e0(param_1 + 0x10c,param_2 + 0x10c,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x116,param_2 + 0x116,0,0xffffffffffffffff);
  param_1[0x120] = param_2[0x120];
  FUN_1400015e0(param_1 + 0x122,param_2 + 0x122,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 300,param_2 + 300,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x136,param_2 + 0x136,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x140,param_2 + 0x140,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x14a,param_2 + 0x14a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x154,param_2 + 0x154,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x15e,param_2 + 0x15e,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x168,param_2 + 0x168,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x172,param_2 + 0x172,0,0xffffffffffffffff);
  param_1[0x17c] = param_2[0x17c];
  param_1[0x17d] = param_2[0x17d];
  param_1[0x17e] = param_2[0x17e];
  param_1[0x17f] = param_2[0x17f];
  FUN_1400015e0(param_1 + 0x180,param_2 + 0x180,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x18a,param_2 + 0x18a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x194,param_2 + 0x194,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x19e,param_2 + 0x19e,0,0xffffffffffffffff);
  param_1[0x1a8] = param_2[0x1a8];
  param_1[0x1a9] = param_2[0x1a9];
  param_1[0x1aa] = param_2[0x1aa];
  param_1[0x1ab] = param_2[0x1ab];
  FUN_1400015e0(param_1 + 0x1ac,param_2 + 0x1ac,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1b6,param_2 + 0x1b6,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1c0,param_2 + 0x1c0,0,0xffffffffffffffff);
  param_1[0x1ca] = param_2[0x1ca];
  param_1[0x1cb] = param_2[0x1cb];
  param_1[0x1cc] = param_2[0x1cc];
  param_1[0x1cd] = param_2[0x1cd];
  param_1[0x1ce] = param_2[0x1ce];
  param_1[0x1cf] = param_2[0x1cf];
  param_1[0x1d0] = param_2[0x1d0];
  param_1[0x1d1] = param_2[0x1d1];
  param_1[0x1d2] = param_2[0x1d2];
  param_1[0x1d3] = param_2[0x1d3];
  param_1[0x1d4] = param_2[0x1d4];
  param_1[0x1d5] = param_2[0x1d5];
  param_1[0x1d6] = param_2[0x1d6];
  FUN_1400015e0(param_1 + 0x1d8,param_2 + 0x1d8,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1e2,param_2 + 0x1e2,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1ec,param_2 + 0x1ec,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1f6,param_2 + 0x1f6,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x200,param_2 + 0x200,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x20a,param_2 + 0x20a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x214,param_2 + 0x214,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x21e,param_2 + 0x21e,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x228,param_2 + 0x228,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x232,param_2 + 0x232,0,0xffffffffffffffff);
  param_1[0x23c] = param_2[0x23c];
  param_1[0x23d] = param_2[0x23d];
  param_1[0x23e] = param_2[0x23e];
  param_1[0x23f] = param_2[0x23f];
  param_1[0x240] = param_2[0x240];
  param_1[0x241] = param_2[0x241];
  param_1[0x242] = param_2[0x242];
  param_1[0x243] = param_2[0x243];
  param_1[0x244] = param_2[0x244];
  param_1[0x245] = param_2[0x245];
  return param_1;
}



longlong FUN_140304970(longlong param_1,longlong param_2)

{
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x28);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x2c);
  *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(param_2 + 0x30);
  *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(param_2 + 0x34);
  *(undefined4 *)(param_1 + 0x38) = *(undefined4 *)(param_2 + 0x38);
  *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(param_2 + 0x3c);
  *(undefined4 *)(param_1 + 0x40) = *(undefined4 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x44) = *(undefined4 *)(param_2 + 0x44);
  *(undefined4 *)(param_1 + 0x48) = *(undefined4 *)(param_2 + 0x48);
  *(undefined4 *)(param_1 + 0x4c) = *(undefined4 *)(param_2 + 0x4c);
  *(undefined4 *)(param_1 + 0x50) = *(undefined4 *)(param_2 + 0x50);
  *(undefined4 *)(param_1 + 0x54) = *(undefined4 *)(param_2 + 0x54);
  *(undefined4 *)(param_1 + 0x58) = *(undefined4 *)(param_2 + 0x58);
  *(undefined4 *)(param_1 + 0x5c) = *(undefined4 *)(param_2 + 0x5c);
  *(undefined4 *)(param_1 + 0x60) = *(undefined4 *)(param_2 + 0x60);
  *(undefined4 *)(param_1 + 100) = *(undefined4 *)(param_2 + 100);
  *(undefined4 *)(param_1 + 0x68) = *(undefined4 *)(param_2 + 0x68);
  *(undefined4 *)(param_1 + 0x6c) = *(undefined4 *)(param_2 + 0x6c);
  FUN_1400015e0(param_1 + 0x70,param_2 + 0x70,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x98) = *(undefined4 *)(param_2 + 0x98);
  *(undefined4 *)(param_1 + 0x9c) = *(undefined4 *)(param_2 + 0x9c);
  *(undefined4 *)(param_1 + 0xa0) = *(undefined4 *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0xa4) = *(undefined4 *)(param_2 + 0xa4);
  *(undefined4 *)(param_1 + 0xa8) = *(undefined4 *)(param_2 + 0xa8);
  *(undefined4 *)(param_1 + 0xac) = *(undefined4 *)(param_2 + 0xac);
  *(undefined4 *)(param_1 + 0xb0) = *(undefined4 *)(param_2 + 0xb0);
  *(undefined4 *)(param_1 + 0xb4) = *(undefined4 *)(param_2 + 0xb4);
  *(undefined4 *)(param_1 + 0xb8) = *(undefined4 *)(param_2 + 0xb8);
  *(undefined4 *)(param_1 + 0xbc) = *(undefined4 *)(param_2 + 0xbc);
  *(undefined4 *)(param_1 + 0xc0) = *(undefined4 *)(param_2 + 0xc0);
  *(undefined4 *)(param_1 + 0xc4) = *(undefined4 *)(param_2 + 0xc4);
  FUN_1400015e0(param_1 + 200,param_2 + 200,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0xf0) = *(undefined4 *)(param_2 + 0xf0);
  *(undefined4 *)(param_1 + 0xf4) = *(undefined4 *)(param_2 + 0xf4);
  *(undefined4 *)(param_1 + 0xf8) = *(undefined4 *)(param_2 + 0xf8);
  *(undefined4 *)(param_1 + 0xfc) = *(undefined4 *)(param_2 + 0xfc);
  *(undefined4 *)(param_1 + 0x100) = *(undefined4 *)(param_2 + 0x100);
  return param_1;
}



void FUN_140304b10(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 + 0x920);
        FUN_1403061e0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140304c70(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_1403063f0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_140304d40(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x18) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x10); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x10))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x10) = *(undefined8 *)(param_2 + 0x10);
      FUN_1403063f0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x10);
  FUN_1403063f0(param_1,param_2);
  return;
}



void FUN_140304dc0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608660 = DAT_140608660 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608630;
  if ((DAT_140608630 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608640, DAT_140608640 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x110);
        FUN_140306a20(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608630;
        uVar4 = DAT_140608640;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608630 = (void *)0x0;
  DAT_140608638 = 0;
  if (DAT_140608660 == 0) {
    uVar5 = FUN_1403067d0(0);
    FUN_1403064a0(uVar5,0);
  }
  DAT_140608670 = 0;
  _Memory = DAT_140608668;
  if (DAT_140608668 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608668 = (longlong *)0x0;
    DAT_140608660 = DAT_140608660 + -1;
    return;
  }
  DAT_140608660 = DAT_140608660 + -1;
  return;
}



void FUN_140304ec0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x118) % (ulonglong)DAT_140608640;
  if (param_1 != *(longlong *)(DAT_140608630 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608630 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x110); lVar3 != param_1;
        lVar3 = *(longlong *)(lVar3 + 0x110)) {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x110) = *(undefined8 *)(param_1 + 0x110);
      FUN_140306a20(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608630 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x110);
  FUN_140306a20(param_1);
  return;
}



undefined4 * FUN_140304f60(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(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_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1c) = 7;
  *(undefined8 *)(param_1 + 0x1a) = 0;
  *(undefined2 *)(param_1 + 0x16) = 0;
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x26) = 7;
  *(undefined8 *)(param_1 + 0x24) = 0;
  *(undefined2 *)(param_1 + 0x20) = 0;
  FUN_1400015e0(param_1 + 0x20,param_2 + 0x20,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x30) = 7;
  *(undefined8 *)(param_1 + 0x2e) = 0;
  *(undefined2 *)(param_1 + 0x2a) = 0;
  FUN_1400015e0(param_1 + 0x2a,param_2 + 0x2a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x3a) = 7;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined2 *)(param_1 + 0x34) = 0;
  FUN_1400015e0(param_1 + 0x34,param_2 + 0x34,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x44) = 7;
  *(undefined8 *)(param_1 + 0x42) = 0;
  *(undefined2 *)(param_1 + 0x3e) = 0;
  FUN_1400015e0(param_1 + 0x3e,param_2 + 0x3e,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x4e) = 7;
  *(undefined8 *)(param_1 + 0x4c) = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  FUN_1400015e0(param_1 + 0x48,param_2 + 0x48,0,0xffffffffffffffff);
  param_1[0x52] = param_2[0x52];
  param_1[0x53] = param_2[0x53];
  *(undefined8 *)(param_1 + 0x5a) = 7;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined2 *)(param_1 + 0x54) = 0;
  FUN_1400015e0(param_1 + 0x54,param_2 + 0x54,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 100) = 7;
  *(undefined8 *)(param_1 + 0x62) = 0;
  *(undefined2 *)(param_1 + 0x5e) = 0;
  FUN_1400015e0(param_1 + 0x5e,param_2 + 0x5e,0,0xffffffffffffffff);
  param_1[0x68] = param_2[0x68];
  param_1[0x69] = param_2[0x69];
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x6e) = 0;
  *(undefined2 *)(param_1 + 0x6a) = 0;
  FUN_1400015e0(param_1 + 0x6a,param_2 + 0x6a,0,0xffffffffffffffff);
  param_1[0x74] = param_2[0x74];
  param_1[0x75] = param_2[0x75];
  param_1[0x76] = param_2[0x76];
  param_1[0x77] = param_2[0x77];
  *(undefined8 *)(param_1 + 0x7e) = 7;
  *(undefined8 *)(param_1 + 0x7c) = 0;
  *(undefined2 *)(param_1 + 0x78) = 0;
  FUN_1400015e0(param_1 + 0x78,param_2 + 0x78,0,0xffffffffffffffff);
  param_1[0x82] = param_2[0x82];
  param_1[0x83] = param_2[0x83];
  param_1[0x84] = param_2[0x84];
  param_1[0x85] = param_2[0x85];
  param_1[0x86] = param_2[0x86];
  param_1[0x87] = param_2[0x87];
  param_1[0x88] = param_2[0x88];
  param_1[0x89] = param_2[0x89];
  param_1[0x8a] = param_2[0x8a];
  param_1[0x8b] = param_2[0x8b];
  param_1[0x8c] = param_2[0x8c];
  param_1[0x8d] = param_2[0x8d];
  param_1[0x8e] = param_2[0x8e];
  param_1[0x8f] = param_2[0x8f];
  param_1[0x90] = param_2[0x90];
  *(undefined8 *)(param_1 + 0x98) = 7;
  *(undefined8 *)(param_1 + 0x96) = 0;
  *(undefined2 *)(param_1 + 0x92) = 0;
  FUN_1400015e0(param_1 + 0x92,param_2 + 0x92,0,0xffffffffffffffff);
  param_1[0x9c] = param_2[0x9c];
  param_1[0x9d] = param_2[0x9d];
  param_1[0x9e] = param_2[0x9e];
  param_1[0x9f] = param_2[0x9f];
  param_1[0xa0] = param_2[0xa0];
  param_1[0xa1] = param_2[0xa1];
  param_1[0xa2] = param_2[0xa2];
  param_1[0xa3] = param_2[0xa3];
  param_1[0xa4] = param_2[0xa4];
  param_1[0xa5] = param_2[0xa5];
  param_1[0xa6] = param_2[0xa6];
  param_1[0xa7] = param_2[0xa7];
  param_1[0xa8] = param_2[0xa8];
  param_1[0xa9] = param_2[0xa9];
  param_1[0xaa] = param_2[0xaa];
  param_1[0xab] = param_2[0xab];
  param_1[0xac] = param_2[0xac];
  param_1[0xad] = param_2[0xad];
  param_1[0xae] = param_2[0xae];
  param_1[0xaf] = param_2[0xaf];
  param_1[0xb0] = param_2[0xb0];
  param_1[0xb1] = param_2[0xb1];
  param_1[0xb2] = param_2[0xb2];
  param_1[0xb3] = param_2[0xb3];
  param_1[0xb4] = param_2[0xb4];
  param_1[0xb5] = param_2[0xb5];
  param_1[0xb6] = param_2[0xb6];
  param_1[0xb7] = param_2[0xb7];
  param_1[0xb8] = param_2[0xb8];
  param_1[0xb9] = param_2[0xb9];
  param_1[0xba] = param_2[0xba];
  param_1[0xbb] = param_2[0xbb];
  param_1[0xbc] = param_2[0xbc];
  param_1[0xbd] = param_2[0xbd];
  param_1[0xbe] = param_2[0xbe];
  param_1[0xbf] = param_2[0xbf];
  param_1[0xc0] = param_2[0xc0];
  param_1[0xc1] = param_2[0xc1];
  param_1[0xc2] = param_2[0xc2];
  param_1[0xc3] = param_2[0xc3];
  param_1[0xc4] = param_2[0xc4];
  param_1[0xc5] = param_2[0xc5];
  param_1[0xc6] = param_2[0xc6];
  param_1[199] = param_2[199];
  param_1[200] = param_2[200];
  param_1[0xc9] = param_2[0xc9];
  param_1[0xca] = param_2[0xca];
  param_1[0xcb] = param_2[0xcb];
  param_1[0xcc] = param_2[0xcc];
  param_1[0xcd] = param_2[0xcd];
  param_1[0xce] = param_2[0xce];
  param_1[0xcf] = param_2[0xcf];
  *(undefined8 *)(param_1 + 0xd6) = 7;
  *(undefined8 *)(param_1 + 0xd4) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  FUN_1400015e0(param_1 + 0xd0,param_2 + 0xd0,0,0xffffffffffffffff);
  param_1[0xda] = param_2[0xda];
  param_1[0xdb] = param_2[0xdb];
  param_1[0xdc] = param_2[0xdc];
  param_1[0xdd] = param_2[0xdd];
  param_1[0xde] = param_2[0xde];
  param_1[0xdf] = param_2[0xdf];
  *(undefined8 *)(param_1 + 0xe6) = 7;
  *(undefined8 *)(param_1 + 0xe4) = 0;
  *(undefined2 *)(param_1 + 0xe0) = 0;
  FUN_1400015e0(param_1 + 0xe0,param_2 + 0xe0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0xf0) = 7;
  *(undefined8 *)(param_1 + 0xee) = 0;
  *(undefined2 *)(param_1 + 0xea) = 0;
  FUN_1400015e0(param_1 + 0xea,param_2 + 0xea,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0xfa) = 7;
  *(undefined8 *)(param_1 + 0xf8) = 0;
  *(undefined2 *)(param_1 + 0xf4) = 0;
  FUN_1400015e0(param_1 + 0xf4,param_2 + 0xf4,0,0xffffffffffffffff);
  param_1[0xfe] = param_2[0xfe];
  param_1[0xff] = param_2[0xff];
  param_1[0x100] = param_2[0x100];
  param_1[0x101] = param_2[0x101];
  param_1[0x102] = param_2[0x102];
  param_1[0x103] = param_2[0x103];
  param_1[0x104] = param_2[0x104];
  param_1[0x105] = param_2[0x105];
  param_1[0x106] = param_2[0x106];
  param_1[0x107] = param_2[0x107];
  param_1[0x108] = param_2[0x108];
  param_1[0x109] = param_2[0x109];
  param_1[0x10a] = param_2[0x10a];
  *(undefined8 *)(param_1 + 0x112) = 7;
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined2 *)(param_1 + 0x10c) = 0;
  FUN_1400015e0(param_1 + 0x10c,param_2 + 0x10c,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x11c) = 7;
  *(undefined8 *)(param_1 + 0x11a) = 0;
  *(undefined2 *)(param_1 + 0x116) = 0;
  FUN_1400015e0(param_1 + 0x116,param_2 + 0x116,0,0xffffffffffffffff);
  param_1[0x120] = param_2[0x120];
  *(undefined8 *)(param_1 + 0x128) = 7;
  *(undefined8 *)(param_1 + 0x126) = 0;
  *(undefined2 *)(param_1 + 0x122) = 0;
  FUN_1400015e0(param_1 + 0x122,param_2 + 0x122,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x132) = 7;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 300) = 0;
  FUN_1400015e0(param_1 + 300,param_2 + 300,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x13c) = 7;
  *(undefined8 *)(param_1 + 0x13a) = 0;
  *(undefined2 *)(param_1 + 0x136) = 0;
  FUN_1400015e0(param_1 + 0x136,param_2 + 0x136,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x146) = 7;
  *(undefined8 *)(param_1 + 0x144) = 0;
  *(undefined2 *)(param_1 + 0x140) = 0;
  FUN_1400015e0(param_1 + 0x140,param_2 + 0x140,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x150) = 7;
  *(undefined8 *)(param_1 + 0x14e) = 0;
  *(undefined2 *)(param_1 + 0x14a) = 0;
  FUN_1400015e0(param_1 + 0x14a,param_2 + 0x14a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x15a) = 7;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined2 *)(param_1 + 0x154) = 0;
  FUN_1400015e0(param_1 + 0x154,param_2 + 0x154,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x164) = 7;
  *(undefined8 *)(param_1 + 0x162) = 0;
  *(undefined2 *)(param_1 + 0x15e) = 0;
  FUN_1400015e0(param_1 + 0x15e,param_2 + 0x15e,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x16e) = 7;
  *(undefined8 *)(param_1 + 0x16c) = 0;
  *(undefined2 *)(param_1 + 0x168) = 0;
  FUN_1400015e0(param_1 + 0x168,param_2 + 0x168,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x178) = 7;
  *(undefined8 *)(param_1 + 0x176) = 0;
  *(undefined2 *)(param_1 + 0x172) = 0;
  FUN_1400015e0(param_1 + 0x172,param_2 + 0x172,0,0xffffffffffffffff);
  param_1[0x17c] = param_2[0x17c];
  param_1[0x17d] = param_2[0x17d];
  param_1[0x17e] = param_2[0x17e];
  param_1[0x17f] = param_2[0x17f];
  *(undefined8 *)(param_1 + 0x186) = 7;
  *(undefined8 *)(param_1 + 0x184) = 0;
  *(undefined2 *)(param_1 + 0x180) = 0;
  FUN_1400015e0(param_1 + 0x180,param_2 + 0x180,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 400) = 7;
  *(undefined8 *)(param_1 + 0x18e) = 0;
  *(undefined2 *)(param_1 + 0x18a) = 0;
  FUN_1400015e0(param_1 + 0x18a,param_2 + 0x18a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x19a) = 7;
  *(undefined8 *)(param_1 + 0x198) = 0;
  *(undefined2 *)(param_1 + 0x194) = 0;
  FUN_1400015e0(param_1 + 0x194,param_2 + 0x194,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1a4) = 7;
  *(undefined8 *)(param_1 + 0x1a2) = 0;
  *(undefined2 *)(param_1 + 0x19e) = 0;
  FUN_1400015e0(param_1 + 0x19e,param_2 + 0x19e,0,0xffffffffffffffff);
  param_1[0x1a8] = param_2[0x1a8];
  param_1[0x1a9] = param_2[0x1a9];
  param_1[0x1aa] = param_2[0x1aa];
  param_1[0x1ab] = param_2[0x1ab];
  *(undefined8 *)(param_1 + 0x1b2) = 7;
  *(undefined8 *)(param_1 + 0x1b0) = 0;
  *(undefined2 *)(param_1 + 0x1ac) = 0;
  FUN_1400015e0(param_1 + 0x1ac,param_2 + 0x1ac,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1bc) = 7;
  *(undefined8 *)(param_1 + 0x1ba) = 0;
  *(undefined2 *)(param_1 + 0x1b6) = 0;
  FUN_1400015e0(param_1 + 0x1b6,param_2 + 0x1b6,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1c6) = 7;
  *(undefined8 *)(param_1 + 0x1c4) = 0;
  *(undefined2 *)(param_1 + 0x1c0) = 0;
  FUN_1400015e0(param_1 + 0x1c0,param_2 + 0x1c0,0,0xffffffffffffffff);
  param_1[0x1ca] = param_2[0x1ca];
  param_1[0x1cb] = param_2[0x1cb];
  param_1[0x1cc] = param_2[0x1cc];
  param_1[0x1cd] = param_2[0x1cd];
  param_1[0x1ce] = param_2[0x1ce];
  param_1[0x1cf] = param_2[0x1cf];
  param_1[0x1d0] = param_2[0x1d0];
  param_1[0x1d1] = param_2[0x1d1];
  param_1[0x1d2] = param_2[0x1d2];
  param_1[0x1d3] = param_2[0x1d3];
  param_1[0x1d4] = param_2[0x1d4];
  param_1[0x1d5] = param_2[0x1d5];
  param_1[0x1d6] = param_2[0x1d6];
  *(undefined8 *)(param_1 + 0x1de) = 7;
  *(undefined8 *)(param_1 + 0x1dc) = 0;
  *(undefined2 *)(param_1 + 0x1d8) = 0;
  FUN_1400015e0(param_1 + 0x1d8,param_2 + 0x1d8,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1e8) = 7;
  *(undefined8 *)(param_1 + 0x1e6) = 0;
  *(undefined2 *)(param_1 + 0x1e2) = 0;
  FUN_1400015e0(param_1 + 0x1e2,param_2 + 0x1e2,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1f2) = 7;
  *(undefined8 *)(param_1 + 0x1f0) = 0;
  *(undefined2 *)(param_1 + 0x1ec) = 0;
  FUN_1400015e0(param_1 + 0x1ec,param_2 + 0x1ec,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1fc) = 7;
  *(undefined8 *)(param_1 + 0x1fa) = 0;
  *(undefined2 *)(param_1 + 0x1f6) = 0;
  FUN_1400015e0(param_1 + 0x1f6,param_2 + 0x1f6,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x206) = 7;
  *(undefined8 *)(param_1 + 0x204) = 0;
  *(undefined2 *)(param_1 + 0x200) = 0;
  FUN_1400015e0(param_1 + 0x200,param_2 + 0x200,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x210) = 7;
  *(undefined8 *)(param_1 + 0x20e) = 0;
  *(undefined2 *)(param_1 + 0x20a) = 0;
  FUN_1400015e0(param_1 + 0x20a,param_2 + 0x20a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x21a) = 7;
  *(undefined8 *)(param_1 + 0x218) = 0;
  *(undefined2 *)(param_1 + 0x214) = 0;
  FUN_1400015e0(param_1 + 0x214,param_2 + 0x214,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x224) = 7;
  *(undefined8 *)(param_1 + 0x222) = 0;
  *(undefined2 *)(param_1 + 0x21e) = 0;
  FUN_1400015e0(param_1 + 0x21e,param_2 + 0x21e,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x22e) = 7;
  *(undefined8 *)(param_1 + 0x22c) = 0;
  *(undefined2 *)(param_1 + 0x228) = 0;
  FUN_1400015e0(param_1 + 0x228,param_2 + 0x228,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x238) = 7;
  *(undefined8 *)(param_1 + 0x236) = 0;
  *(undefined2 *)(param_1 + 0x232) = 0;
  FUN_1400015e0(param_1 + 0x232,param_2 + 0x232,0,0xffffffffffffffff);
  param_1[0x23c] = param_2[0x23c];
  param_1[0x23d] = param_2[0x23d];
  param_1[0x23e] = param_2[0x23e];
  param_1[0x23f] = param_2[0x23f];
  param_1[0x240] = param_2[0x240];
  param_1[0x241] = param_2[0x241];
  param_1[0x242] = param_2[0x242];
  param_1[0x243] = param_2[0x243];
  param_1[0x244] = param_2[0x244];
  param_1[0x245] = param_2[0x245];
  return param_1;
}



undefined2 * FUN_140305ce0(undefined2 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(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);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x22) = *(undefined4 *)(param_2 + 0x44);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x48);
  *(undefined4 *)(param_1 + 0x26) = *(undefined4 *)(param_2 + 0x4c);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x50);
  *(undefined4 *)(param_1 + 0x2a) = *(undefined4 *)(param_2 + 0x54);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x58);
  *(undefined4 *)(param_1 + 0x2e) = *(undefined4 *)(param_2 + 0x5c);
  *(undefined4 *)(param_1 + 0x30) = *(undefined4 *)(param_2 + 0x60);
  *(undefined4 *)(param_1 + 0x32) = *(undefined4 *)(param_2 + 100);
  *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(param_2 + 0x68);
  *(undefined4 *)(param_1 + 0x36) = *(undefined4 *)(param_2 + 0x6c);
  *(undefined8 *)(param_1 + 0x44) = 7;
  *(undefined8 *)(param_1 + 0x40) = 0;
  param_1[0x38] = 0;
  FUN_1400015e0(param_1 + 0x38,param_2 + 0x70,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x4c) = *(undefined4 *)(param_2 + 0x98);
  *(undefined4 *)(param_1 + 0x4e) = *(undefined4 *)(param_2 + 0x9c);
  *(undefined4 *)(param_1 + 0x50) = *(undefined4 *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0x52) = *(undefined4 *)(param_2 + 0xa4);
  *(undefined4 *)(param_1 + 0x54) = *(undefined4 *)(param_2 + 0xa8);
  *(undefined4 *)(param_1 + 0x56) = *(undefined4 *)(param_2 + 0xac);
  *(undefined4 *)(param_1 + 0x58) = *(undefined4 *)(param_2 + 0xb0);
  *(undefined4 *)(param_1 + 0x5a) = *(undefined4 *)(param_2 + 0xb4);
  *(undefined4 *)(param_1 + 0x5c) = *(undefined4 *)(param_2 + 0xb8);
  *(undefined4 *)(param_1 + 0x5e) = *(undefined4 *)(param_2 + 0xbc);
  *(undefined4 *)(param_1 + 0x60) = *(undefined4 *)(param_2 + 0xc0);
  *(undefined4 *)(param_1 + 0x62) = *(undefined4 *)(param_2 + 0xc4);
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x6c) = 0;
  param_1[100] = 0;
  FUN_1400015e0(param_1 + 100,param_2 + 200,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x78) = *(undefined4 *)(param_2 + 0xf0);
  *(undefined4 *)(param_1 + 0x7a) = *(undefined4 *)(param_2 + 0xf4);
  *(undefined4 *)(param_1 + 0x7c) = *(undefined4 *)(param_2 + 0xf8);
  *(undefined4 *)(param_1 + 0x7e) = *(undefined4 *)(param_2 + 0xfc);
  *(undefined4 *)(param_1 + 0x80) = *(undefined4 *)(param_2 + 0x100);
  return param_1;
}



void FUN_140305ec0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x920);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x928) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x920) = *(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_140306070(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) < 0x930)
      goto LAB_14030613d;
      lVar7 = uVar6 * 0x930;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14030613d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x126 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x124] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x126;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x248);
  *puVar2 = param_2;
  FUN_1403003e0(puVar2 + 2);
  puVar2[0x24a] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x248) = *(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_1402cddb0(param_1);
    FUN_140305ec0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1403061e0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140300830(param_2 + 8);
  *(undefined8 *)(param_2 + 0x920) = *(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_1402cddb0(param_1);
    FUN_140305ec0(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;
}



longlong FUN_140306280(longlong *param_1,undefined8 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined1 auVar2 [16];
  undefined4 uVar3;
  longlong *plVar4;
  ulonglong uVar5;
  longlong lVar6;
  
  if (param_1[8] == 0) {
    uVar5 = CONCAT44(0,*(uint *)((longlong)param_1 + 0x34));
    if (uVar5 == 0) {
      lVar6 = 0;
    }
    else {
      auVar2._8_8_ = 0;
      auVar2._0_8_ = uVar5;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar2,0) < 0x20)
      goto LAB_140306347;
      lVar6 = uVar5 << 5;
    }
    if ((-lVar6 - 1U < 0x10) || (plVar4 = malloc(lVar6 + 0x10), plVar4 == (longlong *)0x0)) {
LAB_140306347:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar4 = param_1[7];
    param_1[7] = (longlong)plVar4;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar4 = plVar4 + (ulonglong)(iVar1 - 1) * 4 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar4[2] = param_1[8];
      param_1[8] = (longlong)plVar4;
      plVar4 = plVar4 + -4;
    }
  }
  lVar6 = param_1[8];
  if (lVar6 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(lVar6 + 0x10);
  FUN_1403070c0(lVar6,param_2);
  *(undefined4 *)(lVar6 + 0x18) = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(lVar6 + 0x10) = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(longlong *)(*param_1 + (param_3 & 0xffffffff) * 8) = lVar6;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar3 = FUN_1402cddb0(param_1);
    FUN_140253ff0(param_1,uVar3);
  }
  return lVar6;
}



void FUN_1403063f0(longlong param_1,longlong *param_2)

{
  int *piVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined4 uVar5;
  longlong *_Memory;
  
  if (param_2 != (longlong *)0x0) {
    lVar3 = *param_2;
    LOCK();
    piVar1 = (int *)(lVar3 + -8);
    iVar2 = *piVar1;
    *piVar1 = *piVar1 + -1;
    UNLOCK();
    if (iVar2 + -1 < 1) {
      (**(code **)(**(longlong **)(lVar3 + -0x18) + 8))();
    }
    param_2[2] = *(longlong *)(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)) {
      uVar5 = FUN_1402cddb0(param_1);
      FUN_140253ff0(param_1,uVar5);
    }
    if (*(longlong *)(param_1 + 8) == 0) {
      _Memory = *(longlong **)(param_1 + 0x38);
      *(undefined8 *)(param_1 + 0x40) = 0;
      if (_Memory != (longlong *)0x0) {
        do {
          plVar4 = (longlong *)*_Memory;
          free(_Memory);
          _Memory = plVar4;
        } while (plVar4 != (longlong *)0x0);
        *(undefined8 *)(param_1 + 0x38) = 0;
      }
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_1403064a0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608630 != (void *)0x0) {
    operator_delete__(DAT_140608630);
    DAT_140608630 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608630 = operator_new(_Var1);
    if (DAT_140608630 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608630,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060864c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608648;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608658 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608658 = 0;
  }
  DAT_140608650 = (longlong)fVar4 + lVar2;
  DAT_140608640 = param_1;
  return CONCAT71((int7)(DAT_140608658 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403065f0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_1403067d0(DAT_140608638,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608640) {
    if (DAT_140608630 == (void *)0x0) {
      FUN_1403064a0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608640;
      if (DAT_140608640 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608630);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x110);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x118) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x110) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608640;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608630);
      fVar10 = (float)param_1 * _DAT_14060864c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608650 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608648;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608630 = _Dst;
      DAT_140608640 = param_1;
      DAT_140608658 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608658 = uVar6;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_1403067d0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608644;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140306860(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608670 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608664);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x120)
      goto LAB_140306934;
      lVar7 = uVar8 * 0x120;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140306934:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608668;
    puVar4 = puVar6 + (ulonglong)(DAT_140608664 - 1) * 0x24 + 2;
    DAT_140608668 = puVar6;
    uVar2 = DAT_140608664;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x22] = DAT_140608670;
      puVar4 = puVar6 + -0x24;
      DAT_140608670 = puVar6;
    }
  }
  puVar6 = DAT_140608670;
  if (DAT_140608670 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608670[0x22];
  *(undefined4 *)DAT_140608670 = param_1;
  DAT_140608670 = (undefined8 *)uVar3;
  puVar6[4] = 7;
  puVar6[3] = 0;
  *(undefined2 *)(puVar6 + 1) = 0;
  puVar6[0x12] = 7;
  puVar6[0x11] = 0;
  *(undefined2 *)(puVar6 + 0xf) = 0;
  puVar6[0x1d] = 7;
  puVar6[0x1c] = 0;
  *(undefined2 *)(puVar6 + 0x1a) = 0;
  *(undefined4 *)(puVar6 + 0x23) = param_3;
  DAT_140608638 = DAT_140608638 + 1;
  puVar6[0x22] = *(undefined8 *)(DAT_140608630 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608630 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608650 < DAT_140608638) && (DAT_140608660 == 0)) {
    uVar5 = FUN_1403067d0();
    FUN_1403065f0(uVar5);
  }
  return puVar6;
}



void FUN_140306a20(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_140303990(param_1 + 8);
    *(longlong *)(param_1 + 0x110) = DAT_140608670;
    DAT_140608638 = DAT_140608638 - 1;
    DAT_140608670 = param_1;
    if ((DAT_140608638 < DAT_140608658) && (DAT_140608660 == 0)) {
      uVar2 = FUN_1403067d0(DAT_140608638);
      FUN_1403065f0(uVar2);
    }
    if ((DAT_140608638 == 0) &&
       (DAT_140608670 = 0, _Memory = DAT_140608668, DAT_140608668 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608668 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



HMODULE FUN_140306ad0(uint param_1,WORD param_2)

{
  HMODULE hModule;
  HRSRC pHVar1;
  longlong lVar2;
  int iVar3;
  
  hModule = ATL::CAtlBaseModule::GetHInstanceAt((CAtlBaseModule *)&DAT_1405f2410,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_140306b90(hModule,pHVar1,param_1), lVar2 != 0))
    break;
    hModule = ATL::CAtlBaseModule::GetHInstanceAt((CAtlBaseModule *)&DAT_1405f2410,iVar3);
  }
  return hModule;
}



ushort * FUN_140306b90(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;
}



void FUN_140306c30(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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  return;
}



void FUN_140306c80(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_14000d450(0x8007000e);
    }
    if ((eVar2 == 0x16) || (eVar2 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar2 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140306d59)

undefined8 FUN_140306d00(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_140306b90(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_140306f70(param_1,uVar5);
  }
  FUN_140306c80(*param_1,uVar5,puVar4 + 1,*puVar4);
  uVar1 = *(uint *)(*param_1 + -0xc);
  if (uVar2 != uVar1 && (int)uVar1 <= (int)uVar5) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  *(uint *)(*param_1 + -0x10) = (uint)uVar2;
  *(undefined2 *)(*param_1 + (ulonglong)uVar2 * 2) = 0;
  return 1;
}



void FUN_140306de0(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_14000d450(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;
}



void FUN_140306e60(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_140306f10();
  }
  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_140306f10(void)

{
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x8007000e);
}



void FUN_140306f20(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_140306f10();
    }
    *param_1 = lVar1 + 0x18;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_140306f10();
}



void FUN_140306f70(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_140306e60(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_140306f20(param_1,iVar2);
  }
  return;
}



void FUN_140306fd0(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_140306de0();
    return;
  }
  if (param_2 == (void *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  lVar2 = *param_1;
  uVar1 = *(uint *)(lVar2 + -0x10);
  uVar3 = (longlong)param_2 - lVar2 >> 1;
  if (param_3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  if ((int)(1U - *(int *)(lVar2 + -8) | *(int *)(lVar2 + -0xc) - param_3) < 0) {
    FUN_140306f70(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_14000d450(0x80070057);
}



longlong * FUN_1403070c0(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_1405d8520 + 0x18))();
  *param_1 = lVar2 + 0x18;
  if (param_2 == (short *)0x0) {
    iVar3 = 0;
  }
  else {
    if (((ulonglong)param_2 & 0xffffffffffff0000) == 0) {
      lVar2 = FUN_140306ad0((ulonglong)param_2 & 0xffff,0);
      if (lVar2 == 0) {
        return param_1;
      }
      FUN_140306d00(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_140306fd0(param_1,param_2,iVar3,param_4,uVar5);
  return param_1;
}



void thunk_FUN_1403082c0(void)

{
  FUN_1403082c0();
  return;
}



void FUN_140307180(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined4 *puVar9;
  undefined8 uVar10;
  longlong lVar11;
  longlong *plVar12;
  undefined4 *puVar13;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  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;
  undefined4 local_11c;
  undefined4 local_118;
  void *local_110;
  undefined8 local_108;
  undefined8 local_100;
  undefined8 local_e8;
  undefined4 local_e0;
  undefined1 local_d8 [136];
  void *local_50;
  undefined4 *puVar8;
  
  local_e8 = 0xfffffffffffffffe;
  lVar7 = FUN_1402933b0(DAT_140607ff0,L"DUEL_STATUS_TRANS");
  if (lVar7 != 0) {
    puVar13 = (undefined4 *)0x0;
    puVar9 = puVar13;
    if ((*(longlong *)(lVar7 + 0x70) != 0) && (*(uint *)(lVar7 + 0x78) != 0)) {
      puVar8 = puVar13;
      plVar12 = *(longlong **)(lVar7 + 0x68);
      do {
        if (*plVar12 != 0) {
          puVar9 = (undefined4 *)(*(longlong **)(lVar7 + 0x68))[(longlong)puVar8];
          break;
        }
        uVar2 = (int)puVar8 + 1;
        puVar8 = (undefined4 *)(ulonglong)uVar2;
        plVar12 = plVar12 + 1;
      } while (uVar2 < *(uint *)(lVar7 + 0x78));
    }
LAB_140307202:
    puVar8 = puVar9;
    if (puVar8 != (undefined4 *)0x0) {
      uVar1 = *puVar8;
      uVar3 = FUN_1402970c0(lVar7,L"nClassType");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar3,L"nClassType",1);
      uVar3 = *puVar9;
      uVar4 = FUN_1402970c0(lVar7,L"nLevleMin");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar4,L"nLevleMin",1);
      uVar4 = *puVar9;
      uVar5 = FUN_1402970c0(lVar7,L"nLevelMax");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar5,L"nLevelMax",1);
      uVar5 = *puVar9;
      local_110 = (void *)0x0;
      local_108 = 0;
      local_100 = 0;
      uVar6 = FUN_1402970c0(lVar7,L"nHPinput");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nHPinput",1);
      local_18c = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,&DAT_1404cad68);
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,&DAT_1404cad68,1);
      local_188 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,&DAT_1404b72b8);
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,&DAT_1404b72b8,1);
      local_184 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nPhysicalAtk");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nPhysicalAtk",1);
      local_180 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nPhysicalDef");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nPhysicalDef",1);
      local_17c = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nMagicalAtk");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nMagicalAtk",1);
      local_178 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nMagicalDef");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nMagicalDef",1);
      local_174 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nLightRes");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nLightRes",1);
      local_170 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nDarknessRes");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nDarknessRes",1);
      local_16c = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nEarthRes");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nEarthRes",1);
      local_168 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nWaterRes");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nWaterRes",1);
      local_164 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nFireRes");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nFireRes",1);
      local_160 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nWindRes");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nWindRes",1);
      local_15c = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nToxicationRes");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nToxicationRes",1);
      local_158 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"nLightningRes");
      puVar9 = (undefined4 *)FUN_140296600(lVar7,uVar1,uVar6,L"nLightningRes",1);
      local_154 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fWeight");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fWeight",1);
      local_150 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_BLOODING");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_BLOODING",1);
      local_14c = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_COLD");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_COLD",1);
      local_148 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_FIRE");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_FIRE",1);
      local_144 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_STUN");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_STUN",1);
      local_140 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_STONE");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_STONE",1);
      local_13c = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_FREEZE");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_FREEZE",1);
      local_138 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_SLOW");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_SLOW",1);
      local_134 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_TOXICATION");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_TOXICATION",1);
      local_130 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_SICKNESS");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_SICKNESS",1);
      local_12c = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_SLEEP");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_SLEEP",1);
      local_128 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_CHAOS");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_CHAOS",1);
      local_124 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_LIGHTNING");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_LIGHTNING",1);
      local_120 = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_DARKNESS");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_DARKNESS",1);
      local_11c = *puVar9;
      uVar6 = FUN_1402970c0(lVar7,L"fConRes_HOLD");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar7,uVar1,uVar6,L"fConRes_HOLD",1);
      local_118 = *puVar9;
      local_198 = uVar3;
      local_194 = uVar4;
      local_190 = uVar5;
      uVar3 = FUN_1402970c0(lVar7,L"szTransType");
      uVar10 = FUN_140296990(lVar7,uVar1,uVar3,L"szTransType",1);
      FUN_140416000(&local_110,uVar10);
      local_e0 = uVar1;
      FUN_140308570(local_d8,&local_198);
      FUN_140308200(local_e0);
      if (local_50 != (void *)0x0) {
        operator_delete(local_50);
      }
      if (local_110 != (void *)0x0) {
        operator_delete(local_110);
      }
      puVar9 = *(undefined4 **)(puVar8 + 6);
      if (*(undefined4 **)(puVar8 + 6) == (undefined4 *)0x0) {
        uVar2 = (uint)puVar8[8] % *(uint *)(lVar7 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar2 << 3;
        puVar9 = puVar13;
        do {
          if (*(uint *)(lVar7 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar11 + *(longlong *)(lVar7 + 0x68)) != 0) {
            puVar9 = *(undefined4 **)(lVar11 + *(longlong *)(lVar7 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar11 = lVar11 + 8;
        } while (puVar9 == (undefined4 *)0x0);
      }
      goto LAB_140307202;
    }
  }
  return;
}



void FUN_140307940(longlong param_1)

{
  if (*(void **)(param_1 + 0x88) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x88));
  }
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  return;
}



void FUN_140307980(longlong param_1)

{
  if (*(void **)(param_1 + 0x90) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x90));
  }
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  return;
}



// WARNING: Removing unreachable block (ram,0x000140307d06)

void FUN_1403079c0(longlong *param_1,wchar_t *param_2,int param_3,int param_4,int param_5,
                  int param_6)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong *plVar5;
  int *piVar6;
  longlong lVar7;
  
  if (param_1[1] != 0) {
    uVar3 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar7 = ((longlong *)*param_1)[uVar3];
          goto LAB_140307a44;
        }
        uVar1 = (int)uVar3 + 1;
        uVar3 = (ulonglong)uVar1;
        plVar5 = plVar5 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar7 = 0;
LAB_140307a44:
  do {
    do {
      lVar4 = lVar7;
      if (lVar4 == 0) {
        return;
      }
      if (((param_4 + param_5 * 10 == *(int *)(lVar4 + 8)) && (*(int *)(lVar4 + 0xc) <= param_3)) &&
         (param_3 <= *(int *)(lVar4 + 0x10))) {
        piVar6 = *(int **)(lVar4 + 0x90);
        lVar7 = 0;
        iVar2 = (int)(*(longlong *)(lVar4 + 0x98) - (longlong)piVar6 >> 2);
        if (0 < iVar2) {
          do {
            if (*piVar6 == param_6) {
              iVar2 = _wcsicmp(param_2,L"nHPinput");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nHP");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nMP");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nPhysicalAtk");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nPhysicalDef");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nMagicalAtk");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nMagicalDef");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nLightRes");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nDarknessRes");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nEarthRes");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nWaterRes");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nFireRes");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nWindRes");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nToxicationRes");
              if (iVar2 == 0) {
                return;
              }
              iVar2 = _wcsicmp(param_2,L"nLightningRes");
              if (iVar2 == 0) {
                return;
              }
              break;
            }
            lVar7 = lVar7 + 1;
            piVar6 = piVar6 + 1;
          } while (lVar7 < iVar2);
        }
      }
      lVar7 = *(longlong *)(lVar4 + 0xb0);
    } while (lVar7 != 0);
    uVar1 = *(uint *)(lVar4 + 0xb8) % *(uint *)(param_1 + 2) + 1;
    lVar4 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar1) break;
      if (*(longlong *)(lVar4 + *param_1) != 0) {
        lVar7 = *(longlong *)(lVar4 + *param_1);
      }
      uVar1 = uVar1 + 1;
      lVar4 = lVar4 + 8;
    } while (lVar7 == 0);
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x000140308090)

undefined4 FUN_140307d40(longlong *param_1,int param_2,int param_3,int param_4,int param_5)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong *plVar5;
  int *piVar6;
  longlong lVar7;
  
  if (param_1[1] != 0) {
    uVar3 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar7 = ((longlong *)*param_1)[uVar3];
          goto LAB_140307dc0;
        }
        uVar1 = (int)uVar3 + 1;
        uVar3 = (ulonglong)uVar1;
        plVar5 = plVar5 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar7 = 0;
LAB_140307dc0:
  do {
    do {
      lVar4 = lVar7;
      if (lVar4 == 0) {
        return 0xbf800000;
      }
      if (((param_3 + param_4 * 10 == *(int *)(lVar4 + 8)) && (*(int *)(lVar4 + 0xc) <= param_2)) &&
         (param_2 <= *(int *)(lVar4 + 0x10))) {
        piVar6 = *(int **)(lVar4 + 0x90);
        lVar7 = 0;
        iVar2 = (int)(*(longlong *)(lVar4 + 0x98) - (longlong)piVar6 >> 2);
        if (0 < iVar2) {
          do {
            if (*piVar6 == param_5) {
              iVar2 = _wcsicmp(L"fWeight",L"fWeight");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x50);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_BLOODING");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x54);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_COLD");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x58);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_FIRE");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x5c);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_STUN");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x60);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_STONE");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 100);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_FREEZE");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x68);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_SLOW");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x6c);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_TOXICATION");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x70);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_SICKNESS");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x74);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_SLEEP");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x78);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_CHAOS");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x7c);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_LIGHTNING");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x80);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_DARKNESS");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x84);
              }
              iVar2 = _wcsicmp(L"fWeight",L"fConRes_HOLD");
              if (iVar2 == 0) {
                return *(undefined4 *)(lVar4 + 0x88);
              }
              break;
            }
            lVar7 = lVar7 + 1;
            piVar6 = piVar6 + 1;
          } while (lVar7 < iVar2);
        }
      }
      lVar7 = *(longlong *)(lVar4 + 0xb0);
    } while (lVar7 != 0);
    uVar1 = *(uint *)(lVar4 + 0xb8) % *(uint *)(param_1 + 2) + 1;
    lVar4 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar1) break;
      if (*(longlong *)(lVar4 + *param_1) != 0) {
        lVar7 = *(longlong *)(lVar4 + *param_1);
      }
      uVar1 = uVar1 + 1;
      lVar4 = lVar4 + 8;
    } while (lVar7 == 0);
  } while( true );
}



undefined8 * FUN_1403080d0(void)

{
  undefined8 in_XMM3_Qa;
  
  if ((DAT_14060cf24 & 1) == 0) {
    DAT_14060cf24 = DAT_14060cf24 | 1;
    FUN_140308130(0x3f400000,0x3e800000,0x40100000,in_XMM3_Qa,0xfffffffffffffffe);
    FUN_140307180();
    atexit((_func_5014 *)&LAB_140449010);
  }
  return &DAT_1406085e0;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140308130(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_1406085fc = param_3;
  lVar1 = 0;
  DAT_1406085f0 = 0x11;
  DAT_140608614 = 10;
  _DAT_1406085f4 = param_1;
  _DAT_1406085f8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_1406085e0 = 0;
  DAT_1406085e8 = 0;
  DAT_140608610 = 0;
  DAT_140608618 = 0;
  DAT_140608620 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608600 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608608 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608608 = 0;
  }
  return &DAT_1406085e0;
}



uint * FUN_140308200(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_1406085f0;
  if (DAT_1406085e0 == 0) {
    cVar2 = FUN_140308660((ulonglong)DAT_1406085f0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_1406085e0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x2c)) {
      if ((puVar3[0x2e] == param_1) && (*puVar3 == param_1)) {
        FUN_1403082e0(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140308a20(param_1,uVar1,param_1);
  FUN_1403082e0(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_1403082c0(void)

{
  FUN_1403083d0();
  return;
}



undefined4 * FUN_1403082e0(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  FUN_14012bb70();
  return param_1;
}



void FUN_1403083d0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608610 = DAT_140608610 + 1;
  uVar7 = 0;
  pvVar6 = DAT_1406085e0;
  if ((DAT_1406085e0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_1406085f0, DAT_1406085f0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xb0);
        FUN_140308bc0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_1406085e0;
        uVar4 = DAT_1406085f0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_1406085e0 = (void *)0x0;
  DAT_1406085e8 = 0;
  if (DAT_140608610 == 0) {
    uVar5 = FUN_140308990(0);
    FUN_140308660(uVar5,0);
  }
  DAT_140608620 = 0;
  _Memory = DAT_140608618;
  if (DAT_140608618 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608618 = (longlong *)0x0;
    DAT_140608610 = DAT_140608610 + -1;
    return;
  }
  DAT_140608610 = DAT_140608610 + -1;
  return;
}



void FUN_1403084d0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0xb8) % (ulonglong)DAT_1406085f0;
  if (param_1 != *(longlong *)(DAT_1406085e0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_1406085e0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xb0); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xb0))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xb0) = *(undefined8 *)(param_1 + 0xb0);
      FUN_140308bc0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_1406085e0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xb0);
  FUN_140308bc0(param_1);
  return;
}



undefined4 * FUN_140308570(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  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];
  FUN_14012e520();
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_140308660(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_1406085e0 != (void *)0x0) {
    operator_delete__(DAT_1406085e0);
    DAT_1406085e0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_1406085e0 = operator_new(_Var1);
    if (DAT_1406085e0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_1406085e0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_1406085fc;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_1406085f8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608608 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608608 = 0;
  }
  DAT_140608600 = (longlong)fVar4 + lVar2;
  DAT_1406085f0 = param_1;
  return CONCAT71((int7)(DAT_140608608 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403087b0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140308990(DAT_1406085e8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_1406085f0) {
    if (DAT_1406085e0 == (void *)0x0) {
      FUN_140308660(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_1406085f0;
      if (DAT_1406085f0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_1406085e0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xb0);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0xb8) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xb0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_1406085f0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_1406085e0);
      fVar10 = (float)param_1 * _DAT_1406085fc;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608600 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_1406085f8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406085e0 = _Dst;
      DAT_1406085f0 = param_1;
      DAT_140608608 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608608 = uVar6;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_140308990(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_1406085f4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140308a20(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608620 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608614);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xc0)
      goto LAB_140308af1;
      lVar7 = uVar8 * 0xc0;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140308af1:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608618;
    puVar4 = puVar6 + (ulonglong)(DAT_140608614 - 1) * 0x18 + 2;
    DAT_140608618 = puVar6;
    uVar2 = DAT_140608614;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x16] = DAT_140608620;
      puVar4 = puVar6 + -0x18;
      DAT_140608620 = puVar6;
    }
  }
  puVar6 = DAT_140608620;
  if (DAT_140608620 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608620[0x16];
  *(undefined4 *)DAT_140608620 = param_1;
  DAT_140608620 = (undefined8 *)uVar3;
  puVar6[0x12] = 0;
  puVar6[0x13] = 0;
  puVar6[0x14] = 0;
  *(undefined4 *)(puVar6 + 0x17) = param_3;
  DAT_1406085e8 = DAT_1406085e8 + 1;
  puVar6[0x16] = *(undefined8 *)(DAT_1406085e0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_1406085e0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608600 < DAT_1406085e8) && (DAT_140608610 == 0)) {
    uVar5 = FUN_140308990();
    FUN_1403087b0(uVar5);
  }
  return puVar6;
}



void FUN_140308bc0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(void **)(param_1 + 0x90) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x90));
  }
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  *(longlong *)(param_1 + 0xb0) = DAT_140608620;
  DAT_1406085e8 = DAT_1406085e8 - 1;
  DAT_140608620 = param_1;
  if ((DAT_1406085e8 < DAT_140608608) && (DAT_140608610 == 0)) {
    uVar2 = FUN_140308990(DAT_1406085e8);
    FUN_1403087b0(uVar2);
  }
  if (DAT_1406085e8 == 0) {
    DAT_140608620 = 0;
    _Memory = DAT_140608618;
    if (DAT_140608618 != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608618 = (longlong *)0x0;
    }
  }
  return;
}



char * FUN_140308ca0(void)

{
  return "boost::format_error: format generic failure";
}



char * FUN_140308cb0(void)

{
  return "boost::bad_format_string: format-string is ill-formed";
}



char * FUN_140308cc0(void)

{
  return "boost::too_few_args: format-string referred to more arguments than were passed";
}



exception * FUN_140308cd0(exception *param_1,uint param_2)

{
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void __thiscall std::exception::~exception(exception *this)

{
                    // WARNING: Could not recover jumptable at 0x000140308d10. Too many branches
                    // WARNING: Treating indirect jump as call
  ~exception(this);
  return;
}



char * FUN_140308d20(void)

{
  return "boost::too_many_args: format-string referred to less arguments than were passed";
}



void FUN_140308d30(ulonglong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined **local_30 [3];
  undefined8 local_18;
  undefined8 local_10;
  
  if ((param_1 & 1) != 0) {
    std::exception::exception((exception *)local_30);
    local_30[0] = boost::io::bad_format_string::vftable;
    local_18 = param_2;
    local_10 = param_3;
    FUN_14030dc30(local_30);
  }
  return;
}



char * FUN_140308d80(void)

{
  return "bad lexical cast: source type value could not be interpreted as target";
}



void FUN_140308d90(bad_cast *param_1)

{
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
                    // WARNING: Could not recover jumptable at 0x000140308d9a. Too many branches
                    // WARNING: Treating indirect jump as call
  std::bad_cast::~bad_cast(param_1);
  return;
}



bad_cast * FUN_140308db0(bad_cast *param_1,uint param_2)

{
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
  std::bad_cast::~bad_cast(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

void FUN_140308df0(undefined4 param_1,undefined8 param_2,undefined1 *param_3)

{
  longlong lVar1;
  float fVar2;
  short sVar3;
  void *pvVar4;
  undefined4 uVar5;
  int iVar6;
  void *pvVar7;
  longlong lVar8;
  facet *pfVar9;
  short *psVar10;
  float *pfVar11;
  int *piVar12;
  ulonglong uVar13;
  longlong lVar14;
  wchar_t *pwVar15;
  int iVar16;
  wchar_t *pwVar17;
  int iVar18;
  int iVar19;
  uint uVar20;
  uint uVar21;
  uint uVar22;
  undefined8 ******ppppppuVar23;
  undefined2 *puVar24;
  undefined1 uVar25;
  undefined1 auStack_378 [32];
  undefined1 local_358;
  undefined4 local_348;
  int local_344;
  undefined8 local_340;
  int local_338 [2];
  undefined ***local_330;
  undefined ***local_328;
  undefined8 local_320;
  wchar_t local_318;
  undefined6 uStack_316;
  ulonglong local_308;
  ulonglong local_300;
  undefined2 local_2f0;
  undefined6 uStack_2ee;
  undefined8 local_2e0;
  ulonglong local_2d8;
  undefined8 *****local_2c8 [3];
  ulonglong local_2b0;
  void *local_298;
  void *local_290;
  undefined8 local_288;
  void *local_278;
  undefined8 local_270;
  undefined8 local_268;
  undefined8 local_258;
  undefined2 local_240;
  undefined6 uStack_23e;
  undefined8 local_230;
  ulonglong local_228;
  undefined **local_210 [4];
  undefined8 *local_1f0;
  undefined8 local_1a0;
  char local_198;
  char local_188;
  facet *local_180;
  void *local_178;
  void *local_170;
  undefined8 local_168;
  void *local_158;
  undefined8 local_150;
  undefined8 local_148;
  undefined8 local_138;
  undefined2 local_120;
  undefined6 uStack_11e;
  undefined8 local_110;
  ulonglong local_108;
  undefined **local_f0 [4];
  undefined8 *local_d0;
  undefined8 local_80;
  char local_78;
  char local_68;
  facet *local_60;
  ulonglong local_58;
  
  local_320 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_378;
  local_348 = param_1;
  local_340 = param_2;
  pvVar7 = operator_new(0x11c);
  FUN_1402c39e0(param_3 + 0x48,pvVar7);
  operator_new(0x114);
  FUN_140146f90(param_3 + 0x58);
  memset(*(void **)(param_3 + 0x48),0,0x11c);
  memset(*(void **)(param_3 + 0x58),0,0x114);
  local_344 = 0;
  local_330 = local_210;
  local_328 = local_f0;
  do {
    iVar16 = 0;
    lVar14 = -1;
    local_344 = local_344 + 1;
    lVar8 = FUN_14030e250(&local_298,L"szParamName%02d");
    if (*(char *)(lVar8 + 0x54) != '\0') {
      FUN_140310390(lVar8);
    }
    FUN_140311190(lVar8,&local_344);
    *(int *)(lVar8 + 0x4c) = *(int *)(lVar8 + 0x4c) + 1;
    iVar19 = *(int *)(lVar8 + 0x4c);
    if ((*(longlong *)(lVar8 + 0x40) != 0) && (iVar19 < *(int *)(lVar8 + 0x50))) {
      do {
        uVar13 = (ulonglong)iVar19;
        if ((iVar19 < 0) && (uVar13 != 0)) {
          lVar1 = -((-uVar13 - 1 >> 5) * 4 + 4);
        }
        else {
          lVar1 = (uVar13 >> 5) * 4;
        }
        if ((*(uint *)(*(longlong *)(lVar8 + 0x20) + lVar1) & 1 << ((byte)iVar19 & 0x1f)) == 0)
        break;
        iVar19 = iVar19 + 1;
        *(int *)(lVar8 + 0x4c) = iVar19;
      } while (iVar19 < *(int *)(lVar8 + 0x50));
    }
    FUN_14030e390(local_2c8);
    if (local_188 != '\0') {
      if ((local_180 != (facet *)0x0) &&
         (pfVar9 = std::locale::facet::_Decref(local_180), pfVar9 != (facet *)0x0)) {
        (*(code *)**(undefined8 **)pfVar9)(pfVar9);
      }
      local_188 = '\0';
    }
    local_210[0] = boost::io::basic_altstringbuf<>::vftable;
    if (local_198 != '\0') {
      operator_delete((void *)*local_1f0);
    }
    local_198 = '\0';
    std::basic_streambuf<>::setg
              ((basic_streambuf<> *)local_210,(wchar_t *)0x0,(wchar_t *)0x0,(wchar_t *)0x0);
    std::basic_streambuf<>::setp((basic_streambuf<> *)local_210,(wchar_t *)0x0,(wchar_t *)0x0);
    local_1a0 = 0;
    std::basic_streambuf<>::~basic_streambuf<>((basic_streambuf<> *)local_210);
    if (7 < local_228) {
      operator_delete((void *)CONCAT62(uStack_23e,local_240));
    }
    local_228 = 7;
    local_230 = 0;
    local_240 = 0;
    local_258 = 0;
    if (local_278 != (void *)0x0) {
      operator_delete(local_278);
    }
    pvVar4 = local_290;
    local_278 = (void *)0x0;
    local_270 = 0;
    local_268 = 0;
    pvVar7 = local_298;
    if (local_298 != (void *)0x0) {
      for (; pvVar7 != pvVar4; pvVar7 = (void *)((longlong)pvVar7 + 0x98)) {
        FUN_14030faa0(pvVar7);
      }
      operator_delete(local_298);
    }
    local_298 = (void *)0x0;
    local_290 = (void *)0x0;
    local_288 = 0;
    local_338[0] = local_344;
    lVar8 = FUN_14030e250(&local_178,L"fParamValue%02d");
    if (*(char *)(lVar8 + 0x54) != '\0') {
      FUN_140310390(lVar8);
    }
    FUN_140311190(lVar8,local_338);
    *(int *)(lVar8 + 0x4c) = *(int *)(lVar8 + 0x4c) + 1;
    iVar19 = *(int *)(lVar8 + 0x4c);
    if ((*(longlong *)(lVar8 + 0x40) != 0) && (iVar19 < *(int *)(lVar8 + 0x50))) {
      do {
        uVar13 = (ulonglong)iVar19;
        if ((iVar19 < 0) && (uVar13 != 0)) {
          lVar1 = -((-uVar13 - 1 >> 5) * 4 + 4);
        }
        else {
          lVar1 = (uVar13 >> 5) * 4;
        }
        if ((*(uint *)(*(longlong *)(lVar8 + 0x20) + lVar1) & 1 << ((byte)iVar19 & 0x1f)) == 0)
        break;
        iVar19 = iVar19 + 1;
        *(int *)(lVar8 + 0x4c) = iVar19;
      } while (iVar19 < *(int *)(lVar8 + 0x50));
    }
    FUN_14030e390(&local_2f0);
    if (local_68 != '\0') {
      if ((local_60 != (facet *)0x0) &&
         (pfVar9 = std::locale::facet::_Decref(local_60), pfVar9 != (facet *)0x0)) {
        (*(code *)**(undefined8 **)pfVar9)(pfVar9);
      }
      local_68 = '\0';
    }
    local_f0[0] = boost::io::basic_altstringbuf<>::vftable;
    if (local_78 != '\0') {
      operator_delete((void *)*local_d0);
    }
    local_78 = '\0';
    std::basic_streambuf<>::setg
              ((basic_streambuf<> *)local_f0,(wchar_t *)0x0,(wchar_t *)0x0,(wchar_t *)0x0);
    std::basic_streambuf<>::setp((basic_streambuf<> *)local_f0,(wchar_t *)0x0,(wchar_t *)0x0);
    local_80 = 0;
    std::basic_streambuf<>::~basic_streambuf<>((basic_streambuf<> *)local_f0);
    if (7 < local_108) {
      operator_delete((void *)CONCAT62(uStack_11e,local_120));
    }
    local_108 = 7;
    local_110 = 0;
    local_120 = 0;
    local_138 = 0;
    if (local_158 != (void *)0x0) {
      operator_delete(local_158);
    }
    pvVar4 = local_170;
    local_158 = (void *)0x0;
    local_150 = 0;
    local_148 = 0;
    pvVar7 = local_178;
    if (local_178 != (void *)0x0) {
      for (; pvVar7 != pvVar4; pvVar7 = (void *)((longlong)pvVar7 + 0x98)) {
        FUN_14030faa0(pvVar7);
      }
      operator_delete(local_178);
    }
    local_178 = (void *)0x0;
    local_170 = (void *)0x0;
    local_168 = 0;
    ppppppuVar23 = local_2c8;
    if (7 < local_2b0) {
      ppppppuVar23 = (undefined8 ******)local_2c8[0];
    }
    uVar5 = FUN_1402970c0(param_2,ppppppuVar23);
    local_358 = 1;
    psVar10 = (short *)FUN_140296990(param_2,param_1,uVar5);
    local_300 = 7;
    local_308 = 0;
    local_318 = L'\0';
    do {
      if (lVar14 == 0) break;
      lVar14 = lVar14 + -1;
      sVar3 = *psVar10;
      psVar10 = psVar10 + 1;
    } while (sVar3 != 0);
    FUN_140001710(&local_318);
    if (local_308 == 0) {
      if (7 < local_300) {
        operator_delete((void *)CONCAT62(uStack_316,local_318));
      }
      local_300 = 7;
      local_308 = 0;
      local_318 = L'\0';
      if (7 < local_2d8) {
        operator_delete((void *)CONCAT62(uStack_2ee,local_2f0));
      }
      local_2d8 = 7;
      local_2e0 = 0;
      local_2f0 = 0;
      if (7 < local_2b0) {
        operator_delete(local_2c8[0]);
      }
    }
    else {
      iVar19 = -1;
      iVar18 = -1;
      uVar5 = 0;
      uVar25 = 0;
      puVar24 = &local_2f0;
      if (7 < local_2d8) {
        puVar24 = (undefined2 *)CONCAT62(uStack_2ee,local_2f0);
      }
      FUN_1402970c0(local_340,puVar24);
      local_358 = 1;
      pfVar11 = (float *)FUN_1402967b0(local_340,local_348);
      fVar2 = *pfVar11;
      pwVar15 = &local_318;
      if (7 < local_300) {
        pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
      }
      uVar13 = 8;
      if (local_308 < 8) {
        uVar13 = local_308;
      }
      pwVar17 = L"CRITICAL";
      for (; uVar13 != 0; uVar13 = uVar13 - 1) {
        if (*pwVar15 != *pwVar17) {
          uVar20 = 1;
          if ((ushort)*pwVar15 < (ushort)*pwVar17) {
            uVar20 = 0xffffffff;
          }
          goto LAB_1403093e9;
        }
        pwVar15 = pwVar15 + 1;
        pwVar17 = pwVar17 + 1;
      }
      uVar20 = 0;
LAB_1403093e9:
      if (uVar20 == 0) {
        if (local_308 < 8) {
          uVar20 = 0xffffffff;
        }
        else {
          uVar20 = (uint)(local_308 != 8);
        }
      }
      if (uVar20 == 0) {
        *(float *)(param_3 + 0xc) = fVar2;
        iVar19 = -1;
        iVar18 = -1;
LAB_14030aa54:
        *(undefined4 *)(param_3 + 0x18) = uVar5;
        *(int *)(param_3 + 0x1c) = iVar16;
        *param_3 = uVar25;
        if (iVar19 != -1) {
          iVar16 = (int)fVar2;
          *(int *)(*(longlong *)(param_3 + 0x48) + (longlong)iVar19 * 4) = iVar16;
          switch(iVar19) {
          case 0x1c:
            *(int *)(*(longlong *)(param_3 + 0x48) + 0x90) = iVar16;
            break;
          case 0x1d:
            *(int *)(*(longlong *)(param_3 + 0x48) + 0x94) = iVar16;
            break;
          case 0x1e:
            *(int *)(*(longlong *)(param_3 + 0x48) + 0x98) = iVar16;
            break;
          case 0x1f:
            *(int *)(*(longlong *)(param_3 + 0x48) + 0x9c) = iVar16;
            break;
          case 0x20:
            *(int *)(*(longlong *)(param_3 + 0x48) + 0xa0) = iVar16;
            break;
          case 0x21:
            *(int *)(*(longlong *)(param_3 + 0x48) + 0xa4) = iVar16;
            break;
          case 0x22:
            *(int *)(*(longlong *)(param_3 + 0x48) + 0xa8) = iVar16;
            break;
          case 0x23:
            *(int *)(*(longlong *)(param_3 + 0x48) + 0xac) = iVar16;
          }
        }
        if (iVar18 != -1) {
          *(float *)(*(longlong *)(param_3 + 0x58) + (longlong)iVar18 * 4) = fVar2;
        }
        if (7 < local_300) {
          operator_delete((void *)CONCAT62(uStack_316,local_318));
        }
        local_300 = 7;
        local_308 = 0;
        local_318 = L'\0';
        if (7 < local_2d8) {
          operator_delete((void *)CONCAT62(uStack_2ee,local_2f0));
        }
      }
      else {
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 7;
        if (local_308 < 7) {
          uVar13 = local_308;
        }
        pwVar17 = L"CASTING";
        uVar20 = 0;
        for (; uVar21 = uVar20, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar21 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar21 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar21 == 0) {
          if (local_308 < 7) {
            uVar21 = 0xffffffff;
          }
          else {
            uVar21 = (uint)(local_308 != 7);
          }
        }
        if (uVar21 == 0) {
          *(float *)(param_3 + 4) = fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 6;
        if (local_308 < 6) {
          uVar13 = local_308;
        }
        pwVar17 = L"SHIELD";
        for (; uVar21 = uVar20, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar21 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar21 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar21 == 0) {
          if (local_308 < 6) {
            uVar21 = 0xffffffff;
          }
          else {
            uVar21 = (uint)(local_308 != 6);
          }
        }
        if (uVar21 == 0) {
          *(int *)(param_3 + 0x2c) = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0xb;
        if (local_308 < 0xb) {
          uVar13 = local_308;
        }
        pwVar17 = L"CATCH_LEVEL";
        for (; uVar21 = uVar20, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar21 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar21 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar21 == 0) {
          if (local_308 < 0xb) {
            uVar21 = 0xffffffff;
          }
          else {
            uVar21 = (uint)(local_308 != 0xb);
          }
        }
        if (uVar21 == 0) {
          *(int *)(param_3 + 0x20) = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 8;
        if (local_308 < 8) {
          uVar13 = local_308;
        }
        pwVar17 = L"DURATION";
        for (; uVar21 = uVar20, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar21 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar21 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar21 == 0) {
          if (local_308 < 8) {
            uVar21 = 0xffffffff;
          }
          else {
            uVar21 = (uint)(local_308 != 8);
          }
        }
        if (uVar21 == 0) {
          *(float *)(param_3 + 8) = fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x15;
        if (local_308 < 0x15) {
          uVar13 = local_308;
        }
        pwVar17 = L"CONDITION_PROBABILITY";
        uVar21 = 0;
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0x15) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0x15);
          }
        }
        if (uVar22 == 0) {
          *(float *)(param_3 + 0x44) = fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 6;
        if (local_308 < 6) {
          uVar13 = local_308;
        }
        pwVar17 = L"ADD_HP";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 6) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 6);
          }
        }
        if (uVar22 == 0) {
          *(int *)(param_3 + 0x10) = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 6;
        if (local_308 < 6) {
          uVar13 = local_308;
        }
        pwVar17 = L"ADD_MP";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 6) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 6);
          }
        }
        if (uVar22 == 0) {
          *(int *)(param_3 + 0x14) = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0xb;
        if (local_308 < 0xb) {
          uVar13 = local_308;
        }
        pwVar17 = L"SUPER_ARMOR";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0xb) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0xb);
          }
        }
        if (uVar22 == 0) {
          param_3[2] = 1;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 8;
        if (local_308 < 8) {
          uVar13 = local_308;
        }
        pwVar17 = L"GOD_MODE";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 8) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 8);
          }
        }
        if (uVar22 == 0) {
          param_3[1] = 1;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 7;
        if (local_308 < 7) {
          uVar13 = local_308;
        }
        pwVar17 = L"NOGUARD";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 7) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 7);
          }
        }
        if (uVar22 == 0) {
          *(int *)(param_3 + 0x28) = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 7;
        if (local_308 < 7) {
          uVar13 = local_308;
        }
        pwVar17 = L"MASTERY";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 7) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 7);
          }
        }
        if (uVar22 == 0) {
          *(int *)(param_3 + 0x24) = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 5;
        if (local_308 < 5) {
          uVar13 = local_308;
        }
        pwVar17 = L"SHOOT";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 5) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 5);
          }
        }
        if (uVar22 == 0) {
          *(int *)(param_3 + 0x40) = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x17;
        if (local_308 < 0x17) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_BLEEDING";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0x17) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0x17);
          }
        }
        if (uVar22 == 0) {
          uVar5 = 1;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x14;
        if (local_308 < 0x14) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_CHAOS";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0x14) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0x14);
          }
        }
        if (uVar22 == 0) {
          uVar5 = 0xb;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x13;
        if (local_308 < 0x13) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_COLD";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0x13) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0x13);
          }
        }
        if (uVar22 == 0) {
          uVar5 = 2;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x13;
        if (local_308 < 0x13) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_FIRE";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0x13) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0x13);
          }
        }
        if (uVar22 == 0) {
          uVar5 = 3;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x17;
        if (local_308 < 0x17) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_FREEZING";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0x17) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0x17);
          }
        }
        if (uVar22 == 0) {
          uVar5 = 6;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x13;
        if (local_308 < 0x13) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_HOLD";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0x13) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0x13);
          }
        }
        if (uVar22 == 0) {
          uVar5 = 0xe;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x17;
        if (local_308 < 0x17) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_SICKNESS";
        for (; uVar22 = uVar21, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar22 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar22 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar22 == 0) {
          if (local_308 < 0x17) {
            uVar22 = 0xffffffff;
          }
          else {
            uVar22 = (uint)(local_308 != 0x17);
          }
        }
        if (uVar22 == 0) {
          uVar5 = 9;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x14;
        if (local_308 < 0x14) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_SLEEP";
        for (; uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar21 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar21 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar21 == 0) {
          if (local_308 < 0x14) {
            uVar21 = 0xffffffff;
          }
          else {
            uVar21 = (uint)(local_308 != 0x14);
          }
        }
        if (uVar21 == 0) {
          uVar5 = 10;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        pwVar15 = &local_318;
        if (7 < local_300) {
          pwVar15 = (wchar_t *)CONCAT62(uStack_316,local_318);
        }
        uVar13 = 0x13;
        if (local_308 < 0x13) {
          uVar13 = local_308;
        }
        pwVar17 = L"ANTI_CONDITION_SLOW";
        for (; uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar17) {
            uVar20 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar17) {
              uVar20 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar17 = pwVar17 + 1;
        }
        if (uVar20 == 0) {
          if (local_308 < 0x13) {
            uVar20 = 0xffffffff;
          }
          else {
            uVar20 = (uint)(local_308 != 0x13);
          }
        }
        if (uVar20 == 0) {
          uVar5 = 7;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          uVar5 = 5;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          uVar5 = 4;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          uVar5 = 8;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          uVar5 = 0xd;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          uVar5 = 0xc;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          uVar25 = 1;
          iVar16 = (int)fVar2;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x1e;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x1f;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x1c;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x1d;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x20;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x21;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x22;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x23;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x16;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x17;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x14;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x15;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x18;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x19;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x1a;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x1b;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x11;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x36;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 4;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 5;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 6;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 7;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 8;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 9;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x34;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar19 = 0x35;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x31;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 4;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 5;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 6;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 7;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 1;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x21;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x2c;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x2b;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x22;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x23;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x26;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x2e;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x29;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x2a;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x27;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x25;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x24;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x28;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x2d;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x20;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x12;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x1c;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x13;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x14;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x17;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x1f;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x1a;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x1b;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x18;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x16;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x15;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x19;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x1d;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x1e;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x32;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          iVar18 = 0x33;
          goto LAB_14030aa54;
        }
        iVar6 = FUN_140123e30(&local_318,local_308);
        if (iVar6 == 0) {
          lVar8 = 0;
          piVar12 = (int *)(param_3 + 0x30);
          do {
            if (*piVar12 < 1) {
              *(int *)(param_3 + lVar8 * 4 + 0x30) = (int)fVar2;
              break;
            }
            lVar8 = lVar8 + 1;
            piVar12 = piVar12 + 1;
          } while (lVar8 < 4);
          goto LAB_14030aa54;
        }
        if (7 < local_300) {
          operator_delete((void *)CONCAT62(uStack_316,local_318));
        }
        local_300 = 7;
        local_308 = 0;
        local_318 = L'\0';
        if (7 < local_2d8) {
          operator_delete((void *)CONCAT62(uStack_2ee,local_2f0));
        }
      }
      local_2d8 = 7;
      local_2e0 = 0;
      local_2f0 = 0;
      param_2 = local_340;
      param_1 = local_348;
      if (7 < local_2b0) {
        operator_delete(local_2c8[0]);
        param_2 = local_340;
        param_1 = local_348;
      }
    }
    if (3 < local_344) {
      return;
    }
  } while( true );
}



void FUN_14030ac20(longlong param_1)

{
  facet *pfVar1;
  
  if (*(char *)(param_1 + 0x110) != '\0') {
    if (*(facet **)(param_1 + 0x118) != (facet *)0x0) {
      pfVar1 = std::locale::facet::_Decref(*(facet **)(param_1 + 0x118));
      if (pfVar1 != (facet *)0x0) {
        (*(code *)**(undefined8 **)pfVar1)(pfVar1,1);
      }
    }
    *(undefined1 *)(param_1 + 0x110) = 0;
  }
  FUN_14030da30(param_1 + 0x88);
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  if (*(void **)(param_1 + 0x20) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x20));
  }
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  FUN_14030d9d0(param_1);
  return;
}



undefined8 FUN_14030ace0(wchar_t *param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  iVar1 = _wcsicmp(param_1,L"STAY");
  if (iVar1 == 0) {
    return 1;
  }
  iVar1 = _wcsicmp(param_1,L"RUN");
  if (iVar1 == 0) {
    return 2;
  }
  iVar1 = _wcsicmp(param_1,L"JUMP");
  if (iVar1 == 0) {
    return 3;
  }
  iVar1 = _wcsicmp(param_1,L"JUMP2");
  if (iVar1 == 0) {
    return 4;
  }
  iVar1 = _wcsicmp(param_1,L"ATTACK");
  if (iVar1 == 0) {
    return 5;
  }
  iVar1 = _wcsicmp(param_1,L"MIDAIR");
  if (iVar1 == 0) {
    return 6;
  }
  iVar1 = _wcsicmp(param_1,L"DAMAGE");
  if (iVar1 == 0) {
    return 7;
  }
  iVar1 = _wcsicmp(param_1,L"BIG_DAMAGE");
  if (iVar1 == 0) {
    return 8;
  }
  iVar1 = _wcsicmp(param_1,L"DOWN");
  if (iVar1 == 0) {
    return 9;
  }
  iVar1 = _wcsicmp(param_1,L"GUARD");
  if (iVar1 == 0) {
    return 10;
  }
  iVar1 = _wcsicmp(param_1,L"CATCH");
  if (iVar1 == 0) {
    return 0xb;
  }
  iVar1 = _wcsicmp(param_1,L"CAUGHT");
  if (iVar1 == 0) {
    return 0xc;
  }
  iVar1 = _wcsicmp(param_1,L"BUFF");
  if (iVar1 == 0) {
    return 0xd;
  }
  iVar1 = _wcsicmp(param_1,L"ACTIVE_SKILL_ONESELF");
  if (iVar1 == 0) {
    return 0xf;
  }
  iVar1 = _wcsicmp(param_1,L"CASTING");
  if (iVar1 != 0) {
    iVar1 = _wcsicmp(param_1,L"CHARGE");
    if (iVar1 != 0) {
      iVar1 = _wcsicmp(param_1,L"DOWN_ATTACK");
      if (iVar1 == 0) {
        return 0x10;
      }
      iVar1 = _wcsicmp(param_1,L"GROUND");
      uVar2 = 0;
      if (iVar1 == 0) {
        uVar2 = 0x11;
      }
      return uVar2;
    }
  }
  return 0xe;
}



// WARNING: Removing unreachable block (ram,0x00014030af6d)
// WARNING: Removing unreachable block (ram,0x00014030af76)
// WARNING: Removing unreachable block (ram,0x00014030af94)
// WARNING: Removing unreachable block (ram,0x00014030af9d)

undefined8 * FUN_14030af10(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 2) = 0x11;
  *param_1 = 0;
  param_1[1] = 0;
  *(undefined4 *)(param_1 + 6) = 0;
  *(undefined4 *)((longlong)param_1 + 0x34) = 10;
  param_1[7] = 0;
  param_1[8] = 0;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0x3f400000;
  *(undefined4 *)(param_1 + 3) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1c) = 0x40100000;
  param_1[4] = 0x26;
  param_1[5] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  param_1[0xf] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  *(undefined4 *)(param_1 + 0x13) = 0x11;
  *(undefined4 *)(param_1 + 0x17) = 0;
  *(undefined4 *)((longlong)param_1 + 0xbc) = 10;
  param_1[0x18] = 0;
  param_1[0x19] = 0;
  *(undefined4 *)((longlong)param_1 + 0x9c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x14) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xa4) = 0x40100000;
  param_1[0x15] = 0x26;
  param_1[0x16] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  *(undefined4 *)(param_1 + 0x1c) = 0x11;
  *(undefined4 *)(param_1 + 0x20) = 0;
  *(undefined4 *)((longlong)param_1 + 0x104) = 10;
  param_1[0x21] = 0;
  param_1[0x22] = 0;
  *(undefined4 *)((longlong)param_1 + 0xe4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x1d) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0xec) = 0x40100000;
  param_1[0x1e] = 0x26;
  param_1[0x1f] = 0;
  param_1[0x26] = 7;
  param_1[0x25] = 0;
  *(undefined2 *)(param_1 + 0x23) = 0;
  *(undefined2 *)(param_1 + 0x28) = 0;
  return param_1;
}



void thunk_FUN_14030e480(void)

{
  FUN_14030e480();
  return;
}



void FUN_14030b0e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  FUN_14030b1b0();
  if (7 < *(ulonglong *)(param_1 + 0x130)) {
    operator_delete(*(void **)(param_1 + 0x118));
  }
  *(undefined8 *)(param_1 + 0x130) = 7;
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined2 *)(param_1 + 0x118) = 0;
  FUN_14030e480(param_1 + 0xd0);
  FUN_140148110(param_1 + 0x88);
  if (*(longlong *)(param_1 + 0x68) != 0) {
    FUN_1402ce6b0(*(longlong *)(param_1 + 0x68),*(undefined8 *)(param_1 + 0x70),param_3,param_4,
                  uVar1);
    operator_delete(*(void **)(param_1 + 0x68));
  }
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  if (*(longlong *)(param_1 + 0x48) != 0) {
    FUN_1402ce6b0(*(longlong *)(param_1 + 0x48),*(undefined8 *)(param_1 + 0x50));
    operator_delete(*(void **)(param_1 + 0x48));
  }
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  FUN_14030e480(param_1);
  return;
}



void FUN_14030b1b0(longlong param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  
  FUN_1402f3920();
  lVar1 = *(longlong *)(param_1 + 0x50);
  if (*(longlong *)(param_1 + 0x48) != lVar1) {
    uVar2 = FUN_140333a10(lVar1,lVar1);
    FUN_1402ce6b0(uVar2,*(undefined8 *)(param_1 + 0x50));
    *(undefined8 *)(param_1 + 0x50) = uVar2;
  }
  lVar1 = *(longlong *)(param_1 + 0x70);
  if (*(longlong *)(param_1 + 0x68) != lVar1) {
    uVar2 = FUN_140333a10(lVar1,lVar1);
    FUN_1402ce6b0(uVar2,*(undefined8 *)(param_1 + 0x70));
    *(undefined8 *)(param_1 + 0x70) = uVar2;
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014030b330)
// WARNING: Removing unreachable block (ram,0x00014030b3c6)

void FUN_14030b220(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  wchar_t *pwVar2;
  wchar_t *pwVar3;
  undefined4 uVar4;
  wchar_t *pwVar5;
  wchar_t *pwVar6;
  wchar_t *pwVar7;
  uint uVar8;
  uint uVar9;
  ulonglong uVar10;
  uint uVar11;
  wchar_t *local_40;
  wchar_t *local_38;
  undefined8 local_30;
  
  local_40 = (wchar_t *)0x0;
  local_38 = (wchar_t *)0x0;
  local_30 = 0;
  FUN_140415930(&local_40,param_3,&DAT_14049c7b8,param_4,0xfffffffffffffffe);
  pwVar3 = local_38;
  pwVar2 = local_40;
  if (local_40 == local_38) {
    if (local_40 == (wchar_t *)0x0) {
      return;
    }
  }
  else {
    uVar8 = 0;
    *param_2 = 0;
    uVar1 = *(ulonglong *)(local_40 + 8);
    pwVar5 = local_40;
    if (7 < *(ulonglong *)(local_40 + 0xc)) {
      pwVar5 = *(wchar_t **)local_40;
    }
    uVar10 = 7;
    if (uVar1 < 7) {
      uVar10 = uVar1;
    }
    pwVar6 = L"ONESELF";
    for (; uVar9 = uVar8, uVar10 != 0; uVar10 = uVar10 - 1) {
      if (*pwVar5 != *pwVar6) {
        uVar9 = 1;
        if ((ushort)*pwVar5 < (ushort)*pwVar6) {
          uVar9 = 0xffffffff;
        }
        break;
      }
      pwVar5 = pwVar5 + 1;
      pwVar6 = pwVar6 + 1;
    }
    if (uVar9 == 0) {
      if (uVar1 < 7) {
        uVar9 = 0xffffffff;
      }
      else {
        uVar9 = (uint)(uVar1 != 7);
      }
    }
    uVar11 = 0;
    if (uVar9 == 0) {
      *param_1 = 1;
    }
    else {
      pwVar5 = local_40;
      if (7 < *(ulonglong *)(local_40 + 0xc)) {
        pwVar5 = *(wchar_t **)local_40;
      }
      uVar10 = 5;
      if (uVar1 < 5) {
        uVar10 = uVar1;
      }
      pwVar6 = L"ENEMY";
      for (; uVar10 != 0; uVar10 = uVar10 - 1) {
        if (*pwVar5 != *pwVar6) {
          uVar8 = 1;
          if ((ushort)*pwVar5 < (ushort)*pwVar6) {
            uVar8 = 0xffffffff;
          }
          break;
        }
        pwVar5 = pwVar5 + 1;
        pwVar6 = pwVar6 + 1;
      }
      if (uVar8 == 0) {
        if (uVar1 < 5) {
          uVar8 = 0xffffffff;
        }
        else {
          uVar8 = (uint)(uVar1 != 5);
        }
      }
      if (uVar8 == 0) {
        *param_1 = 2;
      }
      else {
        pwVar5 = local_40;
        if (7 < *(ulonglong *)(local_40 + 0xc)) {
          pwVar5 = *(wchar_t **)local_40;
        }
        uVar10 = 5;
        if (uVar1 < 5) {
          uVar10 = uVar1;
        }
        pwVar6 = L"PARTY";
        for (; uVar8 = uVar11, uVar10 != 0; uVar10 = uVar10 - 1) {
          if (*pwVar5 != *pwVar6) {
            uVar8 = 1;
            if ((ushort)*pwVar5 < (ushort)*pwVar6) {
              uVar8 = 0xffffffff;
            }
            break;
          }
          pwVar5 = pwVar5 + 1;
          pwVar6 = pwVar6 + 1;
        }
        if (uVar8 == 0) {
          if (uVar1 < 5) {
            uVar8 = 0xffffffff;
          }
          else {
            uVar8 = (uint)(uVar1 != 5);
          }
        }
        if (uVar8 == 0) {
          *param_1 = 3;
        }
      }
    }
    if (1 < (ulonglong)(((longlong)local_38 - (longlong)local_40) / 0x28)) {
      pwVar5 = local_40 + 0x14;
      uVar1 = *(ulonglong *)(local_40 + 0x1c);
      pwVar6 = pwVar5;
      if (7 < *(ulonglong *)(local_40 + 0x20)) {
        pwVar6 = *(wchar_t **)pwVar5;
      }
      uVar10 = 3;
      if (uVar1 < 3) {
        uVar10 = uVar1;
      }
      pwVar7 = L"ALL";
      for (; uVar10 != 0; uVar10 = uVar10 - 1) {
        if (*pwVar6 != *pwVar7) {
          uVar11 = 1;
          if ((ushort)*pwVar6 < (ushort)*pwVar7) {
            uVar11 = 0xffffffff;
          }
          break;
        }
        pwVar6 = pwVar6 + 1;
        pwVar7 = pwVar7 + 1;
      }
      if (uVar11 == 0) {
        if (uVar1 < 3) {
          uVar11 = 0xffffffff;
        }
        else {
          uVar11 = (uint)(uVar1 != 3);
        }
      }
      if (uVar11 == 0) {
        *param_2 = 0xffffffff;
      }
      else {
        if (7 < *(ulonglong *)(local_40 + 0x20)) {
          pwVar5 = *(wchar_t **)pwVar5;
        }
        uVar4 = FUN_14030f430(pwVar5);
        *param_2 = uVar4;
      }
    }
  }
  FUN_14008d0a0(pwVar2,pwVar3);
  operator_delete(pwVar2);
  return;
}



undefined8 FUN_14030b530(wchar_t *param_1,int *param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  int iVar2;
  wchar_t *_Str;
  undefined8 uVar3;
  void *local_30;
  longlong local_28;
  undefined8 local_20;
  
  uVar3 = 0xfffffffffffffffe;
  iVar2 = wcsncmp(param_1,L"ACTIVE",6);
  if (iVar2 == 0) {
    uVar3 = 2;
  }
  else {
    iVar2 = wcsncmp(param_1,L"BUFF",4);
    if (iVar2 == 0) {
      uVar3 = 3;
    }
    else {
      iVar2 = wcsncmp(param_1,L"DEBUFF",6);
      if (iVar2 == 0) {
        uVar3 = 4;
      }
      else {
        iVar2 = wcsncmp(param_1,L"WAKEUP",6);
        if (iVar2 == 0) {
          local_30 = (void *)0x0;
          local_28 = 0;
          local_20 = 0;
          FUN_140415930(&local_30,param_1,&DAT_14049c7b8,param_4,uVar3);
          pvVar1 = local_30;
          if ((local_28 - (longlong)local_30) / 0x28 == 2) {
            _Str = (wchar_t *)((longlong)local_30 + 0x28);
            if (7 < *(ulonglong *)((longlong)local_30 + 0x40)) {
              _Str = *(wchar_t **)_Str;
            }
            iVar2 = _wtoi(_Str);
            *param_2 = iVar2;
          }
          if (pvVar1 != (void *)0x0) {
            FUN_14008d0a0(pvVar1,local_28);
            operator_delete(pvVar1);
          }
          uVar3 = 5;
        }
        else {
          uVar3 = 0;
        }
      }
    }
  }
  return uVar3;
}



undefined8 FUN_14030b670(wchar_t *param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  if (param_1 == (wchar_t *)0x0) {
    return 0;
  }
  iVar1 = _wcsicmp(param_1,L"ACTIVE_SHIELD");
  if (iVar1 == 0) {
    return 2;
  }
  iVar1 = _wcsicmp(param_1,L"ACTIVE_SPECIAL");
  if (iVar1 == 0) {
    return 1;
  }
  iVar1 = _wcsicmp(param_1,L"ACTIVE_NORMAL");
  if (iVar1 == 0) {
    return 3;
  }
  iVar1 = _wcsicmp(param_1,L"ACTIVE_SUMMON");
  if (iVar1 == 0) {
    return 4;
  }
  iVar1 = _wcsicmp(param_1,L"ACTIVE_HEALING");
  uVar2 = 0;
  if (iVar1 == 0) {
    uVar2 = 5;
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14030b730(longlong *param_1,short *param_2,char param_3,char param_4)

{
  longlong *plVar1;
  short sVar2;
  undefined4 uVar3;
  undefined4 **ppuVar4;
  undefined4 **ppuVar5;
  code *pcVar6;
  undefined8 *puVar7;
  uint uVar8;
  undefined4 uVar9;
  int iVar10;
  longlong lVar11;
  undefined8 *puVar12;
  longlong lVar13;
  uint *puVar14;
  short *psVar15;
  void *pvVar16;
  undefined4 *puVar17;
  short *psVar18;
  short *psVar19;
  wchar_t *pwVar20;
  undefined8 uVar21;
  int *piVar22;
  longlong lVar23;
  undefined4 *puVar24;
  undefined4 *puVar25;
  undefined4 *puVar26;
  ulonglong uVar27;
  longlong *plVar28;
  undefined8 *puVar29;
  longlong *plVar30;
  ulonglong uVar31;
  undefined2 *puVar32;
  undefined8 *puVar33;
  undefined1 auStack_8f8 [32];
  undefined1 local_8d8;
  char local_8c8;
  uint local_8c4;
  char local_8c0;
  uint *local_8b8;
  longlong *local_8b0;
  undefined4 *local_8a8;
  longlong *local_8a0;
  undefined4 local_898;
  undefined4 local_894;
  undefined4 *local_890;
  longlong *local_888;
  undefined4 *local_880;
  longlong *local_878;
  longlong *local_870;
  short *local_868;
  undefined4 local_860 [2];
  uint *local_858;
  longlong *local_850;
  undefined4 *local_848;
  undefined4 *local_838;
  undefined4 *local_828;
  undefined4 *local_818;
  longlong local_808;
  uint *local_800;
  longlong *local_7f8;
  undefined8 *local_7f0;
  undefined8 *local_7e8;
  undefined8 local_7e0;
  undefined8 *local_7d0;
  undefined8 *local_7c8;
  undefined8 local_7c0;
  undefined8 local_7b0;
  undefined1 local_7a8 [16];
  longlong *local_798;
  undefined1 local_790 [16];
  longlong *local_780;
  undefined2 local_778;
  undefined6 uStack_776;
  undefined8 local_768;
  ulonglong local_760;
  undefined2 local_750;
  undefined6 uStack_74e;
  longlong local_740;
  ulonglong local_738;
  undefined2 local_728;
  undefined6 uStack_726;
  longlong local_718;
  ulonglong local_710;
  undefined2 local_700;
  undefined6 uStack_6fe;
  undefined8 local_6f0;
  ulonglong local_6e8;
  undefined2 local_6d8;
  undefined6 uStack_6d6;
  undefined8 local_6c8;
  ulonglong local_6c0;
  undefined2 local_6b0;
  undefined6 uStack_6ae;
  undefined8 local_6a0;
  ulonglong local_698;
  undefined2 local_688;
  undefined6 uStack_686;
  undefined8 local_678;
  ulonglong local_670;
  undefined4 local_658;
  undefined4 uStack_654;
  undefined4 uStack_650;
  undefined4 uStack_64c;
  undefined1 local_648;
  undefined4 local_644;
  uint local_640;
  undefined4 local_63c;
  undefined4 local_630;
  undefined4 local_62c;
  uint local_628;
  undefined4 local_624;
  undefined4 local_620;
  undefined4 local_61c;
  undefined4 local_618;
  undefined4 local_614;
  undefined4 local_610;
  undefined4 local_60c;
  undefined4 local_608;
  undefined4 local_604;
  int local_600;
  undefined4 local_5fc;
  uint local_5f8;
  undefined4 local_5f4;
  undefined4 local_5f0;
  undefined4 local_5e8;
  undefined1 local_5e4 [4];
  undefined1 local_5e0 [4];
  undefined4 local_5dc;
  undefined4 local_5d8;
  undefined4 local_5d4;
  undefined4 local_5d0;
  undefined4 local_5cc;
  undefined4 local_5c8;
  undefined1 local_5c0 [40];
  undefined1 local_598 [40];
  undefined1 local_570 [40];
  undefined1 local_548 [40];
  undefined1 local_520 [40];
  undefined1 local_4f8 [40];
  undefined1 local_4d0 [40];
  undefined1 local_4a8 [40];
  undefined1 local_480 [40];
  undefined1 local_458 [40];
  undefined1 local_430 [80];
  undefined1 local_3e0 [40];
  undefined1 local_3b8 [40];
  undefined4 *local_390;
  undefined4 *local_388;
  undefined4 *local_380;
  undefined4 *local_370;
  undefined4 *local_368;
  undefined4 *local_360;
  undefined1 local_350 [40];
  undefined1 local_328 [40];
  undefined1 local_300 [40];
  undefined1 local_2d8 [40];
  undefined1 local_2b0 [104];
  undefined1 local_248 [512];
  ulonglong local_48;
  
  local_7b0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_8f8;
  local_8c8 = param_4;
  local_8c0 = param_3;
  local_870 = param_1;
  local_868 = param_2;
  lVar11 = FUN_1402933b0(DAT_140607ff0);
  uVar21 = 0;
  if (lVar11 != 0) {
    puVar12 = (undefined8 *)FUN_1404154c0(&local_688,L"%s%s",param_2,L"_STRING");
    if (7 < (ulonglong)puVar12[3]) {
      puVar12 = (undefined8 *)*puVar12;
    }
    lVar13 = FUN_1402933b0(DAT_140607ff0,puVar12);
    local_808 = lVar13;
    if (7 < local_670) {
      operator_delete((void *)CONCAT62(uStack_686,local_688));
    }
    local_670 = 7;
    uVar21 = 0;
    local_678 = 0;
    local_688 = 0;
    if (lVar13 != 0) {
      uVar27 = 0xffffffffffffffff;
      psVar15 = param_2;
      do {
        if (uVar27 == 0) break;
        uVar27 = uVar27 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x23,param_2,~uVar27 - 1);
      *(char *)(param_1 + 0x28) = param_3;
      *(char *)((longlong)param_1 + 0x141) = local_8c8;
      puVar17 = (undefined4 *)0x0;
      local_8b8 = (uint *)0x0;
      local_8b0 = (longlong *)0x0;
      FUN_1402f3920(param_1);
      if ((*(longlong *)(lVar11 + 0x70) != 0) && (*(uint *)(lVar11 + 0x78) != 0)) {
        puVar26 = puVar17;
        plVar28 = *(longlong **)(lVar11 + 0x68);
        do {
          if (*plVar28 != 0) {
            puVar17 = (undefined4 *)(*(longlong **)(lVar11 + 0x68))[(longlong)puVar26];
            break;
          }
          uVar8 = (int)puVar26 + 1;
          puVar26 = (undefined4 *)(ulonglong)uVar8;
          plVar28 = plVar28 + 1;
        } while (uVar8 < *(uint *)(lVar11 + 0x78));
      }
LAB_14030b8a0:
      local_818 = puVar17;
      if (local_818 != (undefined4 *)0x0) {
        uVar3 = *local_818;
        uVar9 = FUN_1402970c0(lVar11,L"nSkillID");
        local_8d8 = 1;
        puVar14 = (uint *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillID");
        uVar8 = *puVar14;
        local_8c4 = uVar8;
        uVar9 = FUN_1402970c0(lVar13,L"wszName");
        local_8d8 = 1;
        psVar15 = (short *)FUN_140296b70(lVar13,uVar3,uVar9,L"wszName");
        if (*local_870 != 0) {
          for (puVar14 = *(uint **)(*local_870 +
                                   ((ulonglong)uVar8 % (ulonglong)*(uint *)(local_870 + 2)) * 8);
              puVar14 != (uint *)0x0; puVar14 = *(uint **)(puVar14 + 6)) {
            if ((puVar14[8] == uVar8) && (*puVar14 == uVar8)) {
              if (puVar14 != (uint *)0x0) {
                if (puVar14 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
                  FUN_14000d450(0x80004005);
                }
                local_8b8 = *(uint **)(puVar14 + 2);
                local_7f8 = *(longlong **)(puVar14 + 4);
                plVar28 = local_8b0;
                local_8b0 = local_7f8;
                local_800 = local_8b8;
                if (local_7f8 != (longlong *)0x0) {
                  LOCK();
                  *(int *)(local_7f8 + 1) = (int)local_7f8[1] + 1;
                  UNLOCK();
                  uVar8 = local_8c4;
                }
                goto LAB_14030ba5f;
              }
              break;
            }
          }
        }
        pvVar16 = operator_new(0x78);
        if (pvVar16 == (void *)0x0) {
          puVar14 = (uint *)0x0;
        }
        else {
          puVar14 = (uint *)FUN_14030d780(pvVar16);
        }
        local_858 = puVar14;
        FUN_140311440(&local_850,puVar14);
        FUN_140178e90(&local_858,puVar14,puVar14);
        puVar14 = local_858;
        plVar28 = local_8b0;
        local_858 = local_8b8;
        local_8b8 = puVar14;
        local_8b0 = local_850;
        local_850 = plVar28;
        if (plVar28 != (longlong *)0x0) {
          LOCK();
          plVar30 = plVar28 + 1;
          *(int *)plVar30 = (int)*plVar30 + -1;
          UNLOCK();
          uVar8 = local_8c4;
          if ((int)*plVar30 == 0) {
            (**(code **)(*plVar28 + 8))(plVar28);
            LOCK();
            piVar22 = (int *)((longlong)plVar28 + 0xc);
            *piVar22 = *piVar22 + -1;
            UNLOCK();
            uVar8 = local_8c4;
            if (*piVar22 == 0) {
              (**(code **)(*plVar28 + 0x10))(plVar28);
              uVar8 = local_8c4;
            }
          }
        }
        *puVar14 = uVar8;
        if (psVar15 != (short *)0x0) {
          uVar27 = 0xffffffffffffffff;
          psVar18 = psVar15;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar18;
            psVar18 = psVar18 + 1;
          } while (sVar2 != 0);
          FUN_140001710(puVar14 + 2,psVar15,~uVar27 - 1);
        }
        puVar17 = (undefined4 *)FUN_140342d30(local_7a8,&local_8c4,&local_8b8);
        FUN_14030e3c0(local_870,*puVar17,puVar17 + 2);
        plVar28 = local_798;
LAB_14030ba5f:
        if (plVar28 != (longlong *)0x0) {
          LOCK();
          plVar30 = plVar28 + 1;
          *(int *)plVar30 = (int)*plVar30 + -1;
          UNLOCK();
          uVar8 = local_8c4;
          if ((int)*plVar30 == 0) {
            (**(code **)(*plVar28 + 8))(plVar28);
            LOCK();
            piVar22 = (int *)((longlong)plVar28 + 0xc);
            *piVar22 = *piVar22 + -1;
            UNLOCK();
            uVar8 = local_8c4;
            if (*piVar22 == 0) {
              (**(code **)(*plVar28 + 0x10))(plVar28);
              uVar8 = local_8c4;
            }
          }
        }
        FUN_1403141c0(&local_658);
        local_658 = 0;
        uStack_654 = 0;
        uStack_650 = 0;
        uStack_64c = 0;
        local_644 = uVar3;
        local_640 = uVar8;
        if (psVar15 != (short *)0x0) {
          uVar27 = 0xffffffffffffffff;
          psVar18 = psVar15;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar18;
            psVar18 = psVar18 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_598,psVar15,~uVar27 - 1);
        }
        uVar9 = FUN_1402970c0(lVar11,L"nAwakeningMode");
        local_8d8 = 0;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nAwakeningMode");
        if (puVar17 != (undefined4 *)0x0) {
          local_63c = *puVar17;
        }
        uVar9 = FUN_1402970c0(lVar11,L"szStateTrue");
        local_8d8 = 1;
        psVar18 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szStateTrue");
        local_738 = 7;
        local_740 = 0;
        local_750 = 0;
        uVar27 = 0xffffffffffffffff;
        psVar15 = psVar18;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_750,psVar18,~uVar27 - 1);
        uVar9 = FUN_1402970c0(lVar11,L"szStateFalse");
        local_8d8 = 1;
        psVar18 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szStateFalse");
        local_710 = 7;
        local_718 = 0;
        local_728 = 0;
        uVar27 = 0xffffffffffffffff;
        psVar15 = psVar18;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_728,psVar18,~uVar27 - 1);
        if (local_740 != 0) {
          local_7d0 = (undefined8 *)0x0;
          local_7c8 = (undefined8 *)0x0;
          local_7c0 = 0;
          puVar32 = &local_750;
          if (7 < local_738) {
            puVar32 = (undefined2 *)CONCAT62(uStack_74e,local_750);
          }
          FUN_140415930(&local_7d0,puVar32,&DAT_14049c7b8);
          puVar7 = local_7c8;
          puVar33 = local_7d0;
          for (puVar12 = local_7d0; puVar12 != puVar7; puVar12 = puVar12 + 5) {
            puVar29 = puVar12;
            if (7 < (ulonglong)puVar12[3]) {
              puVar29 = (undefined8 *)*puVar12;
            }
            uVar9 = FUN_14030ace0(puVar29);
            local_894 = uVar9;
            if ((&local_894 < local_388) && (local_390 <= &local_894)) {
              lVar13 = (longlong)&local_894 - (longlong)local_390;
              if (local_388 == local_380) {
                uVar27 = (longlong)local_388 - (longlong)local_390 >> 2;
                if (0x3ffffffffffffffe < uVar27) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  uVar21 = (*pcVar6)();
                  return uVar21;
                }
                uVar27 = uVar27 + 1;
                uVar31 = (longlong)local_380 - (longlong)local_390 >> 2;
                if (uVar31 < uVar27) {
                  if (0x3fffffffffffffff - (uVar31 >> 1) < uVar31) {
                    uVar31 = 0;
                  }
                  else {
                    uVar31 = uVar31 + (uVar31 >> 1);
                  }
                  if (uVar31 < uVar27) {
                    uVar31 = uVar27;
                  }
                  FUN_14030db30(&local_390,uVar31);
                }
              }
              if (local_388 != (undefined4 *)0x0) {
                *local_388 = local_390[lVar13 >> 2];
              }
            }
            else {
              if (local_388 == local_380) {
                uVar27 = (longlong)local_388 - (longlong)local_390 >> 2;
                if (0x3ffffffffffffffe < uVar27) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_14030cc5f;
                }
                uVar27 = uVar27 + 1;
                uVar31 = (longlong)local_380 - (longlong)local_390 >> 2;
                if (uVar31 < uVar27) {
                  if (0x3fffffffffffffff - (uVar31 >> 1) < uVar31) {
                    uVar31 = 0;
                  }
                  else {
                    uVar31 = uVar31 + (uVar31 >> 1);
                  }
                  if (uVar31 < uVar27) {
                    uVar31 = uVar27;
                  }
                  FUN_14030db30(&local_390,uVar31);
                }
              }
              if (local_388 != (undefined4 *)0x0) {
                *local_388 = uVar9;
              }
            }
            local_388 = local_388 + 1;
          }
          puVar12 = puVar33;
          if (puVar33 != (undefined8 *)0x0) {
            for (; puVar12 != puVar7; puVar12 = puVar12 + 5) {
              if (7 < (ulonglong)puVar12[3]) {
                operator_delete((void *)*puVar12);
              }
              puVar12[3] = 7;
              puVar12[2] = 0;
              *(undefined2 *)puVar12 = 0;
            }
            operator_delete(puVar33);
          }
        }
        if (local_718 != 0) {
          local_7f0 = (undefined8 *)0x0;
          local_7e8 = (undefined8 *)0x0;
          local_7e0 = 0;
          puVar32 = &local_728;
          if (7 < local_710) {
            puVar32 = (undefined2 *)CONCAT62(uStack_726,local_728);
          }
          FUN_140415930(&local_7f0,puVar32,&DAT_14049c7b8);
          puVar7 = local_7e8;
          puVar33 = local_7f0;
          for (puVar12 = local_7f0; puVar12 != puVar7; puVar12 = puVar12 + 5) {
            puVar29 = puVar12;
            if (7 < (ulonglong)puVar12[3]) {
              puVar29 = (undefined8 *)*puVar12;
            }
            uVar9 = FUN_14030ace0(puVar29);
            local_898 = uVar9;
            if ((&local_898 < local_368) && (local_370 <= &local_898)) {
              lVar13 = (longlong)&local_898 - (longlong)local_370;
              if (local_368 == local_360) {
                uVar27 = (longlong)local_368 - (longlong)local_370 >> 2;
                if (0x3ffffffffffffffe < uVar27) {
LAB_14030cc5f:
                  std::_Xlength_error("vector<T> too long");
                  pcVar6 = (code *)swi(3);
                  uVar21 = (*pcVar6)();
                  return uVar21;
                }
                uVar27 = uVar27 + 1;
                uVar31 = (longlong)local_360 - (longlong)local_370 >> 2;
                if (uVar31 < uVar27) {
                  if (0x3fffffffffffffff - (uVar31 >> 1) < uVar31) {
                    uVar31 = 0;
                  }
                  else {
                    uVar31 = uVar31 + (uVar31 >> 1);
                  }
                  if (uVar31 < uVar27) {
                    uVar31 = uVar27;
                  }
                  FUN_14030db30(&local_370,uVar31);
                }
              }
              if (local_368 != (undefined4 *)0x0) {
                *local_368 = local_370[lVar13 >> 2];
              }
            }
            else {
              if (local_368 == local_360) {
                uVar27 = (longlong)local_368 - (longlong)local_370 >> 2;
                if (0x3ffffffffffffffe < uVar27) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_14030cc7b;
                }
                uVar27 = uVar27 + 1;
                uVar31 = (longlong)local_360 - (longlong)local_370 >> 2;
                if (uVar31 < uVar27) {
                  if (0x3fffffffffffffff - (uVar31 >> 1) < uVar31) {
                    uVar31 = 0;
                  }
                  else {
                    uVar31 = uVar31 + (uVar31 >> 1);
                  }
                  if (uVar31 < uVar27) {
                    uVar31 = uVar27;
                  }
                  FUN_14030db30(&local_370,uVar31);
                }
              }
              if (local_368 != (undefined4 *)0x0) {
                *local_368 = uVar9;
              }
            }
            local_368 = local_368 + 1;
          }
          puVar12 = puVar33;
          if (puVar33 != (undefined8 *)0x0) {
            for (; puVar12 != puVar7; puVar12 = puVar12 + 5) {
              if (7 < (ulonglong)puVar12[3]) {
                operator_delete((void *)*puVar12);
              }
              puVar12[3] = 7;
              puVar12[2] = 0;
              *(undefined2 *)puVar12 = 0;
            }
            operator_delete(puVar33);
          }
        }
        uVar9 = FUN_1402970c0(lVar11,L"nSkillLevel");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillLevel");
        local_630 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,L"nLearnLevel");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nLearnLevel");
        local_62c = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,&DAT_14049f890);
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar9,&DAT_14049f890);
        local_5d4 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,&DAT_14049f888);
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar9,&DAT_14049f888);
        local_5d0 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,&DAT_1404cedb8);
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,&DAT_1404cedb8);
        local_5d8 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,L"fHPPercent");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar9,L"fHPPercent");
        local_5cc = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,L"nAttributeGroup");
        local_8d8 = 0;
        puVar14 = (uint *)FUN_140296600(lVar11,uVar3,uVar9,L"nAttributeGroup");
        lVar13 = local_808;
        uVar9 = FUN_1402970c0(local_808,L"wszAttribute");
        local_8d8 = 0;
        psVar15 = (short *)FUN_140296b70(lVar13,uVar3,uVar9,L"wszAttribute");
        if ((puVar14 != (uint *)0x0) && (psVar15 != (short *)0x0)) {
          local_628 = *puVar14;
          plVar28 = local_870 + 0x11;
          lVar23 = *plVar28;
          if (lVar23 != 0) {
            for (puVar14 = *(uint **)(lVar23 + ((ulonglong)local_628 %
                                               (ulonglong)*(uint *)(local_870 + 0x13)) * 8);
                puVar14 != (uint *)0x0; puVar14 = *(uint **)(puVar14 + 0xc)) {
              if ((puVar14[0xe] == local_628) && (*puVar14 == local_628)) {
                if (puVar14 != (uint *)0x0) goto LAB_14030c1d8;
                break;
              }
            }
          }
          puVar14 = (uint *)0x0;
LAB_14030c1d8:
          if (puVar14 == (uint *)0x0) {
            local_698 = 7;
            local_6a0 = 0;
            local_6b0 = 0;
            uVar27 = 0xffffffffffffffff;
            psVar18 = psVar15;
            do {
              if (uVar27 == 0) break;
              uVar27 = uVar27 - 1;
              sVar2 = *psVar18;
              psVar18 = psVar18 + 1;
            } while (sVar2 != 0);
            FUN_140001710(&local_6b0,psVar15,~uVar27 - 1);
            FUN_140147fa0(plVar28,local_628,&local_6b0);
            if (7 < local_698) {
              operator_delete((void *)CONCAT62(uStack_6ae,local_6b0));
            }
          }
        }
        uVar9 = FUN_1402970c0(lVar11,L"szSkillMotion1");
        local_8d8 = 1;
        psVar19 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillMotion1");
        uVar27 = 0xffffffffffffffff;
        psVar18 = psVar19;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar18;
          psVar18 = psVar18 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_570,psVar19,~uVar27 - 1);
        uVar9 = FUN_1402970c0(lVar11,L"szSkillMotion2");
        local_8d8 = 1;
        psVar19 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillMotion2");
        uVar27 = 0xffffffffffffffff;
        psVar18 = psVar19;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar18;
          psVar18 = psVar18 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_548,psVar19,~uVar27 - 1);
        uVar9 = FUN_1402970c0(lVar11,L"szSkillMotion3");
        local_8d8 = 1;
        psVar18 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillMotion3");
        if (psVar18 != (short *)0x0) {
          uVar27 = 0xffffffffffffffff;
          psVar19 = psVar18;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar19;
            psVar19 = psVar19 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_520,psVar18,~uVar27 - 1);
        }
        uVar9 = FUN_1402970c0(lVar11,L"szSkillMotion4");
        local_8d8 = 1;
        psVar18 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillMotion4");
        if (psVar18 != (short *)0x0) {
          uVar27 = 0xffffffffffffffff;
          psVar19 = psVar18;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar19;
            psVar19 = psVar19 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_4f8,psVar18,~uVar27 - 1);
        }
        uVar9 = FUN_1402970c0(lVar11,L"nSkillMotionCategory1");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillMotionCategory1");
        local_624 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,L"nSkillMotionCategory2");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillMotionCategory2");
        local_620 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,L"nSkillMotionCategory3");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillMotionCategory3");
        if (puVar17 != (undefined4 *)0x0) {
          local_61c = *puVar17;
        }
        uVar9 = FUN_1402970c0(lVar11,L"nSkillMotionCategory4");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillMotionCategory4");
        if (puVar17 != (undefined4 *)0x0) {
          local_618 = *puVar17;
        }
        uVar9 = FUN_1402970c0(lVar11,L"szSkillMotion1SG");
        local_8d8 = 1;
        psVar19 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillMotion1SG");
        uVar27 = 0xffffffffffffffff;
        psVar18 = psVar19;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar18;
          psVar18 = psVar18 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_4d0,psVar19,~uVar27 - 1);
        uVar9 = FUN_1402970c0(lVar11,L"szSkillMotion2SG");
        local_8d8 = 1;
        psVar19 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillMotion2SG");
        uVar27 = 0xffffffffffffffff;
        psVar18 = psVar19;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar18;
          psVar18 = psVar18 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_4a8,psVar19,~uVar27 - 1);
        uVar9 = FUN_1402970c0(lVar11,L"szSkillMotion3SG");
        local_8d8 = 1;
        psVar18 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillMotion3SG");
        if (psVar18 != (short *)0x0) {
          uVar27 = 0xffffffffffffffff;
          psVar19 = psVar18;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar19;
            psVar19 = psVar19 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_480,psVar18,~uVar27 - 1);
        }
        uVar9 = FUN_1402970c0(lVar11,L"szSkillMotion4SG");
        local_8d8 = 1;
        psVar18 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillMotion4SG");
        if (psVar18 != (short *)0x0) {
          uVar27 = 0xffffffffffffffff;
          psVar19 = psVar18;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar19;
            psVar19 = psVar19 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_458,psVar18,~uVar27 - 1);
        }
        uVar9 = FUN_1402970c0(lVar11,L"nSkillMotionCategory1SG");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillMotionCategory1SG");
        local_614 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,L"nSkillMotionCategory2SG");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillMotionCategory2SG");
        local_610 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,L"nSkillMotionCategory3SG");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillMotionCategory3SG");
        if (puVar17 != (undefined4 *)0x0) {
          local_60c = *puVar17;
        }
        uVar9 = FUN_1402970c0(lVar11,L"nSkillMotionCategory4SG");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillMotionCategory4SG");
        if (puVar17 != (undefined4 *)0x0) {
          local_608 = *puVar17;
        }
        uVar9 = FUN_1402970c0(lVar11,L"szIcon");
        local_8d8 = 1;
        psVar19 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szIcon");
        uVar27 = 0xffffffffffffffff;
        psVar18 = psVar19;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar18;
          psVar18 = psVar18 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_430,psVar19,~uVar27 - 1);
        uVar9 = FUN_1402970c0(lVar11,L"nCost");
        local_8d8 = 1;
        puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nCost");
        local_604 = *puVar17;
        uVar9 = FUN_1402970c0(lVar11,L"szSkillType");
        local_8d8 = 1;
        pwVar20 = (wchar_t *)FUN_140296990(lVar11,uVar3,uVar9,L"szSkillType");
        puVar26 = (undefined4 *)0x0;
        local_5fc = 0;
        iVar10 = wcsncmp(pwVar20,L"PASSIVE",7);
        if (iVar10 == 0) {
          local_600 = 1;
        }
        else {
          local_600 = FUN_14030b530(pwVar20);
        }
        if (local_600 == 0) {
          if (7 < local_710) {
            operator_delete((void *)CONCAT62(uStack_726,local_728));
          }
          local_710 = 7;
          local_718 = 0;
          local_728 = 0;
          if (7 < local_738) {
            operator_delete((void *)CONCAT62(uStack_74e,local_750));
          }
        }
        else {
          uVar9 = FUN_1402970c0(lVar11,L"szCharacterType");
          local_8d8 = 1;
          psVar18 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szCharacterType");
          if (psVar18 != (short *)0x0) {
            uVar27 = 0xffffffffffffffff;
            psVar19 = psVar18;
            do {
              if (uVar27 == 0) break;
              uVar27 = uVar27 - 1;
              sVar2 = *psVar19;
              psVar19 = psVar19 + 1;
            } while (sVar2 != 0);
            FUN_140001710(local_5c0,psVar18,~uVar27 - 1);
          }
          uVar9 = FUN_1402970c0(lVar11,L"szCatchType");
          local_8d8 = 1;
          pwVar20 = (wchar_t *)FUN_140296990(lVar11,uVar3,uVar9,L"szCatchType");
          iVar10 = _wcsicmp(pwVar20,L"CATCH");
          local_5f8 = (uint)(iVar10 == 0);
          uVar9 = FUN_1402970c0(lVar11,L"nAutoEquipSlotID");
          local_8d8 = 1;
          puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nAutoEquipSlotID");
          local_5e8 = *puVar17;
          if (local_600 == 2) {
            uVar9 = FUN_1402970c0(lVar11,L"szSkillActiveType");
            local_8d8 = 1;
            uVar21 = FUN_140296990(lVar11,uVar3,uVar9,L"szSkillActiveType");
            local_5f4 = FUN_14030b670(uVar21);
          }
          uVar9 = FUN_1402970c0(lVar11,L"nUIPage");
          local_8d8 = 0;
          puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nUIPage");
          if (puVar17 == (undefined4 *)0x0) {
            local_5f0 = 0;
          }
          else {
            local_5f0 = *puVar17;
          }
          uVar9 = FUN_1402970c0(lVar11,L"nInvincibility");
          local_8d8 = 0;
          piVar22 = (int *)FUN_140296600(lVar11,uVar3,uVar9,L"nInvincibility");
          if (piVar22 != (int *)0x0) {
            local_648 = *piVar22 != 0;
          }
          uVar9 = FUN_1402970c0(lVar11,L"szTarget");
          local_8d8 = 1;
          uVar21 = FUN_140296990(lVar11,uVar3,uVar9,L"szTarget");
          FUN_14030b220(local_5e4,local_5e0,uVar21);
          uVar9 = FUN_1402970c0(lVar11,L"fCoolTime");
          local_8d8 = 1;
          puVar17 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar9,L"fCoolTime");
          local_5c8 = *puVar17;
          uVar9 = FUN_1402970c0(lVar13,L"wszDescription");
          local_8d8 = 1;
          psVar19 = (short *)FUN_140296b70(lVar13,uVar3,uVar9,L"wszDescription");
          uVar27 = 0xffffffffffffffff;
          psVar18 = psVar19;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar18;
            psVar18 = psVar18 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_3b8,psVar19,~uVar27 - 1);
          uVar9 = FUN_1402970c0(lVar13,L"wszDescription1");
          local_8d8 = 1;
          psVar19 = (short *)FUN_140296b70(lVar13,uVar3,uVar9,L"wszDescription1");
          uVar27 = 0xffffffffffffffff;
          psVar18 = psVar19;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar18;
            psVar18 = psVar18 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_350,psVar19,~uVar27 - 1);
          uVar9 = FUN_1402970c0(lVar13,L"wszDescription2");
          local_8d8 = 1;
          psVar19 = (short *)FUN_140296b70(lVar13,uVar3,uVar9,L"wszDescription2");
          uVar27 = 0xffffffffffffffff;
          psVar18 = psVar19;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar18;
            psVar18 = psVar18 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_328,psVar19,~uVar27 - 1);
          uVar9 = FUN_1402970c0(lVar13,L"wszDescription3");
          local_8d8 = 1;
          psVar19 = (short *)FUN_140296b70(lVar13,uVar3,uVar9,L"wszDescription3");
          uVar27 = 0xffffffffffffffff;
          psVar18 = psVar19;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar18;
            psVar18 = psVar18 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_300,psVar19,~uVar27 - 1);
          uVar9 = FUN_1402970c0(lVar13,L"wszDescription4");
          local_8d8 = 1;
          psVar19 = (short *)FUN_140296b70(lVar13,uVar3,uVar9,L"wszDescription4");
          uVar27 = 0xffffffffffffffff;
          psVar18 = psVar19;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar18;
            psVar18 = psVar18 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_2d8,psVar19,~uVar27 - 1);
          if (psVar15 != (short *)0x0) {
            uVar27 = 0xffffffffffffffff;
            psVar18 = psVar15;
            do {
              if (uVar27 == 0) break;
              uVar27 = uVar27 - 1;
              sVar2 = *psVar18;
              psVar18 = psVar18 + 1;
            } while (sVar2 != 0);
            FUN_140001710(local_3e0,psVar15,~uVar27 - 1);
          }
          uVar9 = FUN_1402970c0(lVar11,L"nSkillFinalID");
          local_8d8 = 0;
          puVar17 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillFinalID");
          if (puVar17 != (undefined4 *)0x0) {
            local_5dc = *puVar17;
          }
          FUN_140308df0(uVar3,lVar11,local_2b0);
          FUN_14030e4a0(local_8b8 + 0xc,local_630,&local_658);
          if (7 < local_710) {
            operator_delete((void *)CONCAT62(uStack_726,local_728));
          }
          local_710 = 7;
          local_718 = 0;
          local_728 = 0;
          if (7 < local_738) {
            operator_delete((void *)CONCAT62(uStack_74e,local_750));
          }
        }
        local_738 = 7;
        local_740 = 0;
        local_750 = 0;
        FUN_1401dfef0(&local_658);
        puVar17 = *(undefined4 **)(local_818 + 6);
        if (*(undefined4 **)(local_818 + 6) == (undefined4 *)0x0) {
          uVar8 = (uint)local_818[8] % *(uint *)(lVar11 + 0x78) + 1;
          lVar23 = (longlong)(int)uVar8 << 3;
          do {
            puVar17 = puVar26;
            if (*(uint *)(lVar11 + 0x78) <= uVar8) break;
            if (*(longlong *)(lVar23 + *(longlong *)(lVar11 + 0x68)) != 0) {
              puVar26 = *(undefined4 **)(lVar23 + *(longlong *)(lVar11 + 0x68));
            }
            uVar8 = uVar8 + 1;
            lVar23 = lVar23 + 8;
            puVar17 = puVar26;
          } while (puVar26 == (undefined4 *)0x0);
        }
        goto LAB_14030b8a0;
      }
LAB_14030cc7b:
      psVar15 = local_868;
      if (local_8c0 == '\0') {
        puVar17 = (undefined4 *)0x0;
        if (local_8c8 == '\0') {
          local_6c0 = 7;
          local_6c8 = 0;
          local_6d8 = 0;
          uVar27 = 0xffffffffffffffff;
          psVar18 = local_868;
          do {
            if (uVar27 == 0) break;
            uVar27 = uVar27 - 1;
            sVar2 = *psVar18;
            psVar18 = psVar18 + 1;
          } while (sVar2 != 0);
          FUN_140001710(&local_6d8,local_868,~uVar27 - 1);
          FUN_140002aa0(&local_6d8,L"_TREE",5);
          puVar32 = &local_6d8;
          if (7 < local_6c0) {
            puVar32 = (undefined2 *)CONCAT62(uStack_6d6,local_6d8);
          }
          FUN_1402933b0(DAT_140607ff0,puVar32);
          if (7 < local_6c0) {
            operator_delete((void *)CONCAT62(uStack_6d6,local_6d8));
          }
        }
        local_760 = 7;
        local_768 = 0;
        local_778 = 0;
        uVar27 = 0xffffffffffffffff;
        psVar18 = psVar15;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar18;
          psVar18 = psVar18 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_778,psVar15,~uVar27 - 1);
        FUN_140002aa0(&local_778,L"_CHANGE",7);
        puVar32 = &local_778;
        if (7 < local_760) {
          puVar32 = (undefined2 *)CONCAT62(uStack_776,local_778);
        }
        lVar11 = FUN_1402933b0(DAT_140607ff0,puVar32);
        plVar28 = local_870;
        if (lVar11 != 0) {
          puVar26 = puVar17;
          if ((*(longlong *)(lVar11 + 0x70) != 0) && (*(uint *)(lVar11 + 0x78) != 0)) {
            puVar25 = puVar17;
            plVar30 = *(longlong **)(lVar11 + 0x68);
            do {
              if (*plVar30 != 0) {
                puVar26 = (undefined4 *)(*(longlong **)(lVar11 + 0x68))[(longlong)puVar25];
                break;
              }
              uVar8 = (int)puVar25 + 1;
              puVar25 = (undefined4 *)(ulonglong)uVar8;
              plVar30 = plVar30 + 1;
            } while (uVar8 < *(uint *)(lVar11 + 0x78));
          }
LAB_14030cde6:
          if (puVar26 != (undefined4 *)0x0) {
            uVar3 = *puVar26;
            local_828 = puVar26;
            puVar24 = operator_new(0x30);
            puVar25 = puVar17;
            if (puVar24 != (undefined4 *)0x0) {
              *(undefined8 *)(puVar24 + 4) = 0;
              *(undefined8 *)(puVar24 + 6) = 0;
              *(undefined8 *)(puVar24 + 8) = 0;
              puVar25 = puVar24;
            }
            local_8a8 = puVar25;
            FUN_14030f730(&local_8a0,puVar25);
            FUN_140178e90(&local_8a8,puVar25,puVar25);
            *local_8a8 = uVar3;
            uVar9 = FUN_1402970c0(lVar11,L"nSkillID");
            local_8d8 = 1;
            puVar25 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillID");
            local_8a8[1] = *puVar25;
            uVar9 = FUN_1402970c0(lVar11,L"nTargetSkillID");
            local_8d8 = 1;
            puVar25 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nTargetSkillID");
            local_8a8[2] = *puVar25;
            local_8a8[3] = 0;
            uVar9 = FUN_1402970c0(lVar11,L"szChangeType");
            local_8d8 = 1;
            FUN_140296990(lVar11,uVar3,uVar9,L"szChangeType");
            puVar25 = puVar17;
            do {
              uVar8 = (int)puVar25 + 1;
              puVar25 = (undefined4 *)(ulonglong)uVar8;
              FUN_14012f380(local_248,L"nConditionSkillID%02d",uVar8);
              uVar9 = FUN_1402970c0(lVar11,local_248);
              local_8d8 = 1;
              piVar22 = (int *)FUN_140296600(lVar11,uVar3,uVar9,local_248);
              if ((piVar22 != (int *)0x0) && (0 < *piVar22)) {
                FUN_14012e5c0(local_8a8 + 4);
              }
            } while ((int)uVar8 < 4);
            ppuVar4 = (undefined4 **)plVar28[10];
            if ((&local_8a8 < ppuVar4) &&
               (ppuVar5 = (undefined4 **)plVar28[9], ppuVar5 <= &local_8a8)) {
              if (ppuVar4 == (undefined4 **)plVar28[0xb]) {
                FUN_1403435d0(plVar28 + 9);
              }
              puVar33 = (undefined8 *)
                        (((longlong)&local_8a8 - (longlong)ppuVar5 & 0xfffffffffffffff0U) +
                        plVar28[9]);
              puVar12 = (undefined8 *)plVar28[10];
              if (puVar12 != (undefined8 *)0x0) {
                *puVar12 = *puVar33;
                lVar13 = puVar33[1];
                puVar12[1] = lVar13;
                if (lVar13 != 0) {
                  LOCK();
                  *(int *)(lVar13 + 8) = *(int *)(lVar13 + 8) + 1;
                  UNLOCK();
                  puVar26 = local_828;
                }
              }
            }
            else {
              if (ppuVar4 == (undefined4 **)plVar28[0xb]) {
                FUN_1403435d0(plVar28 + 9);
              }
              puVar12 = (undefined8 *)plVar28[10];
              if (puVar12 != (undefined8 *)0x0) {
                *puVar12 = local_8a8;
                puVar12[1] = local_8a0;
                if (local_8a0 != (longlong *)0x0) {
                  LOCK();
                  *(int *)(local_8a0 + 1) = (int)local_8a0[1] + 1;
                  UNLOCK();
                  puVar26 = local_828;
                }
              }
            }
            plVar30 = local_8a0;
            plVar28[10] = plVar28[10] + 0x10;
            puVar25 = puVar26;
            if (local_8a0 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_8a0 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              puVar25 = local_828;
              if ((int)*plVar1 == 0) {
                (**(code **)(*local_8a0 + 8))(local_8a0);
                LOCK();
                piVar22 = (int *)((longlong)plVar30 + 0xc);
                *piVar22 = *piVar22 + -1;
                UNLOCK();
                puVar25 = local_828;
                if (*piVar22 == 0) {
                  (**(code **)(*plVar30 + 0x10))(plVar30);
                  puVar25 = local_828;
                }
              }
            }
            puVar26 = *(undefined4 **)(puVar25 + 6);
            if (puVar26 == (undefined4 *)0x0) {
              uVar8 = (uint)puVar25[8] % *(uint *)(lVar11 + 0x78) + 1;
              lVar13 = (longlong)(int)uVar8 << 3;
              puVar26 = puVar17;
              do {
                if (*(uint *)(lVar11 + 0x78) <= uVar8) break;
                if (*(longlong *)(lVar13 + *(longlong *)(lVar11 + 0x68)) != 0) {
                  puVar26 = *(undefined4 **)(lVar13 + *(longlong *)(lVar11 + 0x68));
                }
                uVar8 = uVar8 + 1;
                lVar13 = lVar13 + 8;
              } while (puVar26 == (undefined4 *)0x0);
            }
            goto LAB_14030cde6;
          }
          local_828 = (undefined4 *)0x0;
          psVar15 = local_868;
        }
        uVar27 = 0xffffffffffffffff;
        psVar18 = psVar15;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar18;
          psVar18 = psVar18 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_778,psVar15,~uVar27 - 1);
        FUN_140002aa0(&local_778,L"_CHANGE_PVP",0xb);
        puVar32 = &local_778;
        if (7 < local_760) {
          puVar32 = (undefined2 *)CONCAT62(uStack_776,local_778);
        }
        lVar11 = FUN_1402933b0(DAT_140607ff0,puVar32);
        if (lVar11 != 0) {
          puVar26 = puVar17;
          if ((*(longlong *)(lVar11 + 0x70) != 0) && (*(uint *)(lVar11 + 0x78) != 0)) {
            puVar25 = puVar17;
            plVar30 = *(longlong **)(lVar11 + 0x68);
            do {
              if (*plVar30 != 0) {
                puVar26 = (undefined4 *)(*(longlong **)(lVar11 + 0x68))[(longlong)puVar25];
                break;
              }
              uVar8 = (int)puVar25 + 1;
              puVar25 = (undefined4 *)(ulonglong)uVar8;
              plVar30 = plVar30 + 1;
            } while (uVar8 < *(uint *)(lVar11 + 0x78));
          }
LAB_14030d110:
          if (puVar26 != (undefined4 *)0x0) {
            uVar3 = *puVar26;
            local_848 = puVar26;
            puVar25 = operator_new(0xc);
            local_890 = puVar25;
            FUN_14030f7a0(&local_888,puVar25);
            FUN_140178e90(&local_890,puVar25,puVar25);
            *local_890 = uVar3;
            uVar9 = FUN_1402970c0(lVar11,L"nSkillID");
            local_8d8 = 1;
            puVar25 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nSkillID");
            local_890[1] = *puVar25;
            uVar9 = FUN_1402970c0(lVar11,L"nTargetSkillID");
            local_8d8 = 1;
            puVar25 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar9,L"nTargetSkillID");
            local_890[2] = *puVar25;
            ppuVar4 = (undefined4 **)plVar28[0xe];
            if ((&local_890 < ppuVar4) &&
               (ppuVar5 = (undefined4 **)plVar28[0xd], ppuVar5 <= &local_890)) {
              if (ppuVar4 == (undefined4 **)plVar28[0xf]) {
                FUN_1403435d0(plVar28 + 0xd);
              }
              puVar33 = (undefined8 *)
                        (((longlong)&local_890 - (longlong)ppuVar5 & 0xfffffffffffffff0U) +
                        plVar28[0xd]);
              puVar12 = (undefined8 *)plVar28[0xe];
              if (puVar12 != (undefined8 *)0x0) {
                *puVar12 = *puVar33;
                lVar13 = puVar33[1];
                puVar12[1] = lVar13;
                if (lVar13 != 0) {
                  LOCK();
                  *(int *)(lVar13 + 8) = *(int *)(lVar13 + 8) + 1;
                  UNLOCK();
                  puVar26 = local_848;
                }
              }
            }
            else {
              if (ppuVar4 == (undefined4 **)plVar28[0xf]) {
                FUN_1403435d0(plVar28 + 0xd);
              }
              puVar12 = (undefined8 *)plVar28[0xe];
              if (puVar12 != (undefined8 *)0x0) {
                *puVar12 = local_890;
                puVar12[1] = local_888;
                if (local_888 != (longlong *)0x0) {
                  LOCK();
                  *(int *)(local_888 + 1) = (int)local_888[1] + 1;
                  UNLOCK();
                  puVar26 = local_848;
                }
              }
            }
            plVar30 = local_888;
            plVar28[0xe] = plVar28[0xe] + 0x10;
            puVar25 = puVar26;
            if (local_888 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_888 + 1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              puVar25 = local_848;
              if ((int)*plVar1 == 0) {
                (**(code **)(*local_888 + 8))(local_888);
                LOCK();
                piVar22 = (int *)((longlong)plVar30 + 0xc);
                *piVar22 = *piVar22 + -1;
                UNLOCK();
                puVar25 = local_848;
                if (*piVar22 == 0) {
                  (**(code **)(*plVar30 + 0x10))(plVar30);
                  puVar25 = local_848;
                }
              }
            }
            puVar26 = *(undefined4 **)(puVar25 + 6);
            if (puVar26 == (undefined4 *)0x0) {
              uVar8 = (uint)puVar25[8] % *(uint *)(lVar11 + 0x78) + 1;
              lVar13 = (longlong)(int)uVar8 << 3;
              puVar26 = puVar17;
              do {
                if (*(uint *)(lVar11 + 0x78) <= uVar8) break;
                if (*(longlong *)(*(longlong *)(lVar11 + 0x68) + lVar13) != 0) {
                  puVar26 = *(undefined4 **)(*(longlong *)(lVar11 + 0x68) + lVar13);
                }
                uVar8 = uVar8 + 1;
                lVar13 = lVar13 + 8;
              } while (puVar26 == (undefined4 *)0x0);
            }
            goto LAB_14030d110;
          }
          local_848 = (undefined4 *)0x0;
          psVar15 = local_868;
        }
        local_6e8 = 7;
        local_6f0 = 0;
        local_700 = 0;
        if (DAT_140607be1 == '\0') {
          uVar21 = FUN_140123ce0();
          FUN_1400015e0(&local_700,uVar21,0,0xffffffffffffffff);
          FUN_140002aa0(&local_700,&DAT_14049a36c,1);
        }
        uVar27 = 0xffffffffffffffff;
        psVar18 = psVar15;
        do {
          if (uVar27 == 0) break;
          uVar27 = uVar27 - 1;
          sVar2 = *psVar18;
          psVar18 = psVar18 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_778,psVar15,~uVar27 - 1);
        FUN_140002aa0(&local_778,L"_FINAL",6);
        puVar32 = &local_778;
        if (7 < local_760) {
          puVar32 = (undefined2 *)CONCAT62(uStack_776,local_778);
        }
        lVar11 = FUN_1402933b0(DAT_140607ff0,puVar32);
        if (lVar11 != 0) {
          if ((*(longlong *)(lVar11 + 0x70) != 0) && (*(uint *)(lVar11 + 0x78) != 0)) {
            puVar26 = puVar17;
            plVar30 = *(longlong **)(lVar11 + 0x68);
            do {
              if (*plVar30 != 0) {
                puVar17 = (undefined4 *)(*(longlong **)(lVar11 + 0x68))[(longlong)puVar26];
                break;
              }
              uVar8 = (int)puVar26 + 1;
              puVar26 = (undefined4 *)(ulonglong)uVar8;
              plVar30 = plVar30 + 1;
            } while (uVar8 < *(uint *)(lVar11 + 0x78));
          }
LAB_14030d3d0:
          puVar26 = (undefined4 *)0x0;
          local_838 = puVar17;
          if (puVar17 != (undefined4 *)0x0) {
            uVar3 = *puVar17;
            local_860[0] = uVar3;
            puVar25 = operator_new(0x68);
            if (puVar25 != (undefined4 *)0x0) {
              *(undefined8 *)(puVar25 + 8) = 7;
              *(undefined8 *)(puVar25 + 6) = 0;
              *(undefined2 *)(puVar25 + 2) = 0;
              *(undefined8 *)(puVar25 + 0x14) = 7;
              *(undefined8 *)(puVar25 + 0x12) = 0;
              *(undefined2 *)(puVar25 + 0xe) = 0;
              puVar26 = puVar25;
            }
            local_880 = puVar26;
            FUN_14030f810(&local_878,puVar26);
            FUN_140178e90(&local_880,puVar26,puVar26);
            *local_880 = uVar3;
            uVar9 = FUN_1402970c0(lVar11,L"szName");
            local_8d8 = 1;
            psVar18 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szName");
            uVar27 = 0xffffffffffffffff;
            psVar15 = psVar18;
            do {
              if (uVar27 == 0) break;
              uVar27 = uVar27 - 1;
              sVar2 = *psVar15;
              psVar15 = psVar15 + 1;
            } while (sVar2 != 0);
            FUN_140001710(local_880 + 2,psVar18,~uVar27 - 1);
            uVar9 = FUN_1402970c0(lVar11,L"nBGRender");
            local_8d8 = 1;
            piVar22 = (int *)FUN_140296600(lVar11,uVar3,uVar9,L"nBGRender");
            *(bool *)(local_880 + 0xc) = *piVar22 != 0;
            uVar9 = FUN_1402970c0(lVar11,L"szBGColor");
            local_8d8 = 1;
            pwVar20 = (wchar_t *)FUN_140296990(lVar11,uVar3,uVar9,L"szBGColor");
            if (pwVar20 != (wchar_t *)0x0) {
              swscanf_s(pwVar20,L"%x");
            }
            uVar9 = FUN_1402970c0(lVar11,L"szEventCameraFileName");
            local_8d8 = 1;
            psVar15 = (short *)FUN_140296990(lVar11,uVar3,uVar9,L"szEventCameraFileName");
            if (psVar15 != (short *)0x0) {
              uVar27 = 0xffffffffffffffff;
              psVar18 = psVar15;
              do {
                if (uVar27 == 0) break;
                uVar27 = uVar27 - 1;
                sVar2 = *psVar18;
                psVar18 = psVar18 + 1;
              } while (sVar2 != 0);
              if (5 < ~uVar27 - 1) {
                FUN_1400015e0(local_880 + 0xe,&local_700,0,0xffffffffffffffff);
                uVar27 = 0xffffffffffffffff;
                psVar18 = psVar15;
                do {
                  if (uVar27 == 0) break;
                  uVar27 = uVar27 - 1;
                  sVar2 = *psVar18;
                  psVar18 = psVar18 + 1;
                } while (sVar2 != 0);
                FUN_140002aa0(local_880 + 0xe,psVar15,~uVar27 - 1);
                FUN_1404151b0(local_880 + 0xe);
              }
            }
            uVar9 = FUN_1402970c0(lVar11,L"fDuration");
            local_8d8 = 1;
            puVar26 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar9,L"fDuration");
            local_880[0x18] = *puVar26;
            puVar26 = (undefined4 *)FUN_140342d30(local_790,local_860,&local_880);
            FUN_14030e3c0(plVar28 + 0x1a,*puVar26,puVar26 + 2);
            plVar30 = local_780;
            if (local_780 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_780 + 1;
              lVar13 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              puVar17 = local_838;
              if ((int)lVar13 == 1) {
                (**(code **)(*local_780 + 8))(local_780);
                LOCK();
                piVar22 = (int *)((longlong)plVar30 + 0xc);
                iVar10 = *piVar22;
                *piVar22 = *piVar22 + -1;
                UNLOCK();
                puVar17 = local_838;
                if (iVar10 == 1) {
                  (**(code **)(*plVar30 + 0x10))(plVar30);
                  puVar17 = local_838;
                }
              }
            }
            plVar30 = local_878;
            puVar26 = puVar17;
            if (local_878 != (longlong *)0x0) {
              LOCK();
              plVar1 = local_878 + 1;
              lVar13 = *plVar1;
              *(int *)plVar1 = (int)*plVar1 + -1;
              UNLOCK();
              puVar26 = local_838;
              if ((int)lVar13 == 1) {
                (**(code **)(*local_878 + 8))(local_878);
                LOCK();
                piVar22 = (int *)((longlong)plVar30 + 0xc);
                iVar10 = *piVar22;
                *piVar22 = *piVar22 + -1;
                UNLOCK();
                puVar26 = local_838;
                if (iVar10 == 1) {
                  (**(code **)(*plVar30 + 0x10))(plVar30);
                  puVar26 = local_838;
                }
              }
            }
            puVar17 = *(undefined4 **)(puVar26 + 6);
            if (puVar17 == (undefined4 *)0x0) {
              uVar8 = (uint)puVar26[8] % *(uint *)(lVar11 + 0x78) + 1;
              lVar13 = (longlong)(int)uVar8 << 3;
              puVar17 = (undefined4 *)0x0;
              do {
                if (*(uint *)(lVar11 + 0x78) <= uVar8) break;
                if (*(longlong *)(*(longlong *)(lVar11 + 0x68) + lVar13) != 0) {
                  puVar17 = *(undefined4 **)(*(longlong *)(lVar11 + 0x68) + lVar13);
                }
                uVar8 = uVar8 + 1;
                lVar13 = lVar13 + 8;
              } while (puVar17 == (undefined4 *)0x0);
            }
            goto LAB_14030d3d0;
          }
        }
        if (7 < local_6e8) {
          operator_delete((void *)CONCAT62(uStack_6fe,local_700));
        }
        local_6e8 = 7;
        local_6f0 = 0;
        local_700 = 0;
        if (7 < local_760) {
          operator_delete((void *)CONCAT62(uStack_776,local_778));
        }
        local_760 = 7;
        local_768 = 0;
        local_778 = 0;
      }
      plVar28 = local_8b0;
      if (local_8b0 != (longlong *)0x0) {
        LOCK();
        plVar30 = local_8b0 + 1;
        lVar11 = *plVar30;
        *(int *)plVar30 = (int)*plVar30 + -1;
        UNLOCK();
        if ((int)lVar11 == 1) {
          (**(code **)(*local_8b0 + 8))(local_8b0);
          LOCK();
          piVar22 = (int *)((longlong)plVar28 + 0xc);
          *piVar22 = *piVar22 + -1;
          UNLOCK();
          if (*piVar22 == 0) {
            (**(code **)(*local_8b0 + 0x10))();
          }
        }
      }
      uVar21 = 1;
    }
  }
  return uVar21;
}



// WARNING: Removing unreachable block (ram,0x00014030d7ec)
// WARNING: Removing unreachable block (ram,0x00014030d7f5)
// WARNING: Removing unreachable block (ram,0x00014030d813)
// WARNING: Removing unreachable block (ram,0x00014030d81c)

longlong FUN_14030d780(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x40) = 0x11;
  *(undefined4 *)(param_1 + 0x60) = 0;
  *(undefined4 *)(param_1 + 100) = 10;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined4 *)(param_1 + 0x44) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x48) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x4c) = 0x40100000;
  *(undefined8 *)(param_1 + 0x50) = 0x26;
  *(undefined8 *)(param_1 + 0x58) = 0;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014030d8c5)

uint * FUN_14030d840(longlong *param_1,uint param_2,uint param_3)

{
  longlong lVar1;
  uint *puVar2;
  
  if (*param_1 != 0) {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 6)) {
      if ((puVar2[8] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 == (uint *)0x0) {
          return (uint *)0x0;
        }
        lVar1 = *(longlong *)(*(longlong *)(puVar2 + 2) + 0x30);
        if (lVar1 == 0) {
          return (uint *)0x0;
        }
        puVar2 = *(uint **)(lVar1 + ((ulonglong)param_3 %
                                    (ulonglong)*(uint *)(*(longlong *)(puVar2 + 2) + 0x40)) * 8);
        while( true ) {
          if (puVar2 == (uint *)0x0) {
            return (uint *)0x0;
          }
          if ((puVar2[0x108] == param_3) && (*puVar2 == param_3)) break;
          puVar2 = *(uint **)(puVar2 + 0x106);
        }
        if (puVar2 == (uint *)0x0) {
          return (uint *)0x0;
        }
        return puVar2 + 2;
      }
    }
  }
  return (uint *)0x0;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14030d8e0(void)

{
  if ((DAT_14060b7c8 & 1) == 0) {
    DAT_14060b7c8 = DAT_14060b7c8 | 1;
    FUN_14030e590(0x3f400000,0x3e800000,0x40100000);
    DAT_1406085b8 = 0;
    DAT_1406085c0 = 0;
    _DAT_1406085c8 = 0;
    atexit(FUN_140449020);
  }
  return &DAT_140608570;
}



void FUN_14030d950(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_1402ce6b0(*param_1,param_1[1]);
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_14030d990(char *param_1)

{
  facet *pfVar1;
  
  if (*param_1 != '\0') {
    if (*(facet **)(param_1 + 8) != (facet *)0x0) {
      pfVar1 = std::locale::facet::_Decref(*(facet **)(param_1 + 8));
      if (pfVar1 != (facet *)0x0) {
        (*(code *)**(undefined8 **)pfVar1)(pfVar1,1);
      }
    }
    *param_1 = '\0';
  }
  return;
}



void FUN_14030d9d0(longlong *param_1)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar2 = *param_1;
  if (lVar2 != 0) {
    lVar1 = param_1[1];
    for (; lVar2 != lVar1; lVar2 = lVar2 + 0x98) {
      FUN_14030faa0(lVar2);
    }
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



void FUN_14030da30(basic_streambuf<> *param_1)

{
  *(undefined ***)param_1 = boost::io::basic_altstringbuf<>::vftable;
  if (param_1[0x78] != (basic_streambuf<>)0x0) {
    operator_delete((void *)**(undefined8 **)(param_1 + 0x20));
  }
  param_1[0x78] = (basic_streambuf<>)0x0;
  **(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;
  *(undefined8 *)(param_1 + 0x70) = 0;
                    // WARNING: Could not recover jumptable at 0x00014030da90. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(param_1);
  return;
}



void * FUN_14030daa0(void *param_1,uint param_2)

{
  FUN_14030da30();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14030dad0(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 + 2;
      puVar2 = puVar2 + 8;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_14030db30(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_14008d1e0(param_2);
    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_14030dbf0(longlong param_1,longlong param_2)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x98) {
    FUN_14030faa0(param_1);
  }
  return;
}



void FUN_14030dc30(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined1 local_b0 [88];
  undefined1 local_58 [88];
  
  uVar1 = FUN_14030eb70(local_58,param_1,param_3,param_4,0xfffffffffffffffe);
  FUN_14030ebf0(local_b0,uVar1);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_b0,(ThrowInfo *)&DAT_1405d3988);
}



longlong *
FUN_14030dc70(longlong param_1,longlong *param_2,longlong param_3,int param_4,uint param_5)

{
  ulonglong uVar1;
  longlong lVar2;
  int iVar3;
  
  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_4 == 2) {
        lVar2 = *(longlong *)(param_1 + 0x70) - uVar1;
      }
      else {
        if (param_4 != 0) goto LAB_14030ddba;
        lVar2 = **(longlong **)(param_1 + 0x28) - uVar1;
      }
      param_3 = param_3 + (lVar2 >> 1);
      uVar1 = uVar1 + param_3 * 2;
      if ((**(ulonglong **)(param_1 + 0x28) <= uVar1) && (uVar1 <= *(ulonglong *)(param_1 + 0x70)))
      {
        **(int **)(param_1 + 0x60) = **(int **)(param_1 + 0x60) - (int)param_3;
        **(longlong **)(param_1 + 0x48) =
             **(longlong **)(param_1 + 0x48) + (longlong)(int)param_3 * 2;
        goto LAB_14030ddbe;
      }
    }
  }
  else {
    if (param_4 == 2) {
      param_3 = param_3 + (*(longlong *)(param_1 + 0x70) - lVar2 >> 1);
    }
    else if (param_4 == 0) {
      param_3 = param_3 + (**(longlong **)(param_1 + 0x20) - lVar2 >> 1);
    }
    else if ((param_4 != 1) || ((param_5 & 2) != 0)) goto LAB_14030ddba;
    uVar1 = lVar2 + param_3 * 2;
    if ((**(ulonglong **)(param_1 + 0x20) <= uVar1) && (uVar1 <= *(ulonglong *)(param_1 + 0x70))) {
      **(int **)(param_1 + 0x58) = **(int **)(param_1 + 0x58) - (int)param_3;
      **(longlong **)(param_1 + 0x40) = **(longlong **)(param_1 + 0x40) + (longlong)(int)param_3 * 2
      ;
      if (((param_5 & 2) != 0) && (**(longlong **)(param_1 + 0x48) != 0)) {
        iVar3 = (int)(**(longlong **)(param_1 + 0x40) - **(longlong **)(param_1 + 0x48) >> 1);
        **(int **)(param_1 + 0x60) = **(int **)(param_1 + 0x60) - iVar3;
        **(longlong **)(param_1 + 0x48) = **(longlong **)(param_1 + 0x48) + (longlong)iVar3 * 2;
      }
      goto LAB_14030ddbe;
    }
  }
LAB_14030ddba:
  param_3 = -1;
LAB_14030ddbe:
  *param_2 = param_3;
  param_2[1] = 0;
  *(undefined4 *)(param_2 + 2) = 0;
  return param_2;
}



longlong * FUN_14030dde0(longlong param_1,longlong *param_2,longlong *param_3,uint param_4)

{
  ulonglong uVar1;
  int iVar2;
  longlong lVar3;
  
  uVar1 = **(ulonglong **)(param_1 + 0x48);
  lVar3 = (longlong)(int)param_3[1] + *param_3;
  if ((uVar1 != 0) && (*(ulonglong *)(param_1 + 0x70) < uVar1)) {
    *(ulonglong *)(param_1 + 0x70) = uVar1;
  }
  if (lVar3 == -1) {
LAB_14030decb:
    lVar3 = -1;
  }
  else {
    if (((param_4 & 1) == 0) || (**(longlong **)(param_1 + 0x40) == 0)) {
      if (((param_4 & 2) == 0) ||
         (((uVar1 = **(ulonglong **)(param_1 + 0x48), uVar1 == 0 || (lVar3 < 0)) ||
          (*(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x20) >> 1 < lVar3))))
      goto LAB_14030decb;
      iVar2 = (int)((longlong)(**(longlong **)(param_1 + 0x20) - uVar1) >> 1) + (int)lVar3;
    }
    else {
      if ((lVar3 < 0) ||
         (*(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x20) >> 1 < lVar3))
      goto LAB_14030decb;
      iVar2 = (int)(**(longlong **)(param_1 + 0x20) - **(longlong **)(param_1 + 0x40) >> 1) +
              (int)lVar3;
      **(int **)(param_1 + 0x58) = **(int **)(param_1 + 0x58) - iVar2;
      **(longlong **)(param_1 + 0x40) = **(longlong **)(param_1 + 0x40) + (longlong)iVar2 * 2;
      if (((param_4 & 2) == 0) || (**(longlong **)(param_1 + 0x48) == 0)) goto LAB_14030decf;
      iVar2 = (int)(**(longlong **)(param_1 + 0x40) - **(longlong **)(param_1 + 0x48) >> 1);
    }
    **(int **)(param_1 + 0x60) = **(int **)(param_1 + 0x60) - iVar2;
    **(longlong **)(param_1 + 0x48) = **(longlong **)(param_1 + 0x48) + (longlong)iVar2 * 2;
  }
LAB_14030decf:
  *param_2 = lVar3;
  param_2[1] = 0;
  *(undefined4 *)(param_2 + 2) = 0;
  return param_2;
}



undefined2 FUN_14030def0(longlong param_1)

{
  undefined2 *puVar1;
  undefined2 *puVar2;
  
  puVar1 = (undefined2 *)**(longlong **)(param_1 + 0x40);
  if (puVar1 == (undefined2 *)0x0) {
    return 0xffff;
  }
  if (puVar1 < puVar1 + **(int **)(param_1 + 0x58)) {
    return *puVar1;
  }
  if ((((*(byte *)(param_1 + 0x7c) & 1) != 0) &&
      (puVar2 = (undefined2 *)**(undefined8 **)(param_1 + 0x48), puVar2 != (undefined2 *)0x0)) &&
     ((puVar1 < puVar2 || (puVar1 < *(undefined2 **)(param_1 + 0x70))))) {
    if (*(undefined2 **)(param_1 + 0x70) < puVar2) {
      *(undefined2 **)(param_1 + 0x70) = puVar2;
    }
    **(int **)(param_1 + 0x58) =
         (int)(*(longlong *)(param_1 + 0x70) - **(longlong **)(param_1 + 0x40) >> 1);
    return *(undefined2 *)**(undefined8 **)(param_1 + 0x40);
  }
  return 0xffff;
}



short FUN_14030df90(longlong param_1,short param_2)

{
  ulonglong uVar1;
  
  uVar1 = **(ulonglong **)(param_1 + 0x40);
  if (((uVar1 != 0) && (**(ulonglong **)(param_1 + 0x20) < uVar1)) &&
     (((*(byte *)(param_1 + 0x7c) & 2) != 0 ||
      ((param_2 == -1 || (param_2 == *(short *)(uVar1 - 2))))))) {
    **(int **)(param_1 + 0x58) = **(int **)(param_1 + 0x58) + 1;
    **(longlong **)(param_1 + 0x40) = **(longlong **)(param_1 + 0x40) + -2;
    if (param_2 != -1) {
      *(short *)**(undefined8 **)(param_1 + 0x40) = param_2;
      return param_2;
    }
    return 0;
  }
  return -1;
}



wchar_t FUN_14030dff0(basic_streambuf<> *param_1,wchar_t param_2)

{
  basic_streambuf<> bVar1;
  void *_Src;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  void *_Dst;
  undefined8 *puVar6;
  ulonglong uVar7;
  void *pvVar8;
  int iVar9;
  void *pvVar10;
  
  if (param_2 == L'\xffff') {
    return L'\0';
  }
  uVar7 = **(ulonglong **)(param_1 + 0x48);
  if ((uVar7 != 0) && (uVar7 < uVar7 + (longlong)**(int **)(param_1 + 0x60) * 2)) {
    std::basic_streambuf<>::sputc(param_1,param_2);
    return param_2;
  }
  if (((byte)param_1[0x7c] & 2) == 0) {
    return L'\xffff';
  }
  pvVar8 = (void *)0x0;
  if (uVar7 != 0) {
    pvVar8 = (void *)((longlong)
                      (((longlong)**(int **)(param_1 + 0x60) * 2 - **(longlong **)(param_1 + 0x20))
                      + uVar7) >> 1);
  }
  uVar7 = (ulonglong)pvVar8 >> 1;
  if (uVar7 < 0x100) {
    uVar7 = 0x100;
  }
  _Src = (void *)**(undefined8 **)(param_1 + 0x20);
  for (; _Dst = (void *)0x0, pvVar10 = pvVar8, uVar7 != 0; uVar7 = uVar7 >> 1) {
    if (pvVar8 <= (void *)(-uVar7 - 1)) {
      _Dst = (void *)0x0;
      if (uVar7 != 0) {
        pvVar10 = (void *)(uVar7 + (longlong)pvVar8);
        _Dst = (void *)FUN_140001ae0(pvVar10);
      }
      break;
    }
  }
  if (pvVar8 != (void *)0x0) {
    memcpy(_Dst,_Src,(longlong)pvVar8 * 2);
  }
  if (param_1[0x78] != (basic_streambuf<>)0x0) {
    operator_delete(_Src);
  }
  param_1[0x78] = (basic_streambuf<>)0x1;
  if (pvVar8 == (void *)0x0) {
    *(void **)(param_1 + 0x70) = _Dst;
    **(undefined8 **)(param_1 + 0x28) = _Dst;
    **(undefined8 **)(param_1 + 0x48) = _Dst;
    **(undefined4 **)(param_1 + 0x60) = (int)((longlong)pvVar10 * 2 >> 1);
    bVar1 = param_1[0x7c];
    **(undefined8 **)(param_1 + 0x20) = _Dst;
    puVar6 = *(undefined8 **)(param_1 + 0x40);
    if (((byte)bVar1 & 1) != 0) {
      *puVar6 = _Dst;
      **(undefined4 **)(param_1 + 0x58) = 1;
      goto LAB_14030e220;
    }
  }
  else {
    *(void **)(param_1 + 0x70) =
         (void *)((longlong)_Dst + (*(longlong *)(param_1 + 0x70) - (longlong)_Src >> 1) * 2);
    lVar2 = **(longlong **)(param_1 + 0x28);
    lVar3 = **(longlong **)(param_1 + 0x48);
    lVar4 = **(longlong **)(param_1 + 0x40);
    lVar5 = **(longlong **)(param_1 + 0x20);
    pvVar8 = (void *)((longlong)_Dst + (lVar2 - (longlong)_Src >> 1) * 2);
    **(longlong **)(param_1 + 0x28) = (longlong)pvVar8;
    **(longlong **)(param_1 + 0x48) = (longlong)pvVar8;
    **(undefined4 **)(param_1 + 0x60) =
         (int)(((longlong)pvVar10 * 2 - (longlong)pvVar8) + (longlong)_Dst >> 1);
    iVar9 = (int)(lVar3 - lVar2 >> 1);
    **(int **)(param_1 + 0x60) = **(int **)(param_1 + 0x60) - iVar9;
    **(longlong **)(param_1 + 0x48) = **(longlong **)(param_1 + 0x48) + (longlong)iVar9 * 2;
    if (((byte)param_1[0x7c] & 1) != 0) {
      lVar2 = **(longlong **)(param_1 + 0x48);
      pvVar8 = (void *)((longlong)_Dst + (longlong)(int)(lVar4 - lVar5 >> 1) * 2);
      **(undefined8 **)(param_1 + 0x20) = _Dst;
      **(longlong **)(param_1 + 0x40) = (longlong)pvVar8;
      **(undefined4 **)(param_1 + 0x58) = (int)((lVar2 - (longlong)pvVar8) + 2 >> 1);
      goto LAB_14030e220;
    }
    **(undefined8 **)(param_1 + 0x20) = _Dst;
    puVar6 = *(undefined8 **)(param_1 + 0x40);
  }
  *puVar6 = 0;
  **(undefined4 **)(param_1 + 0x58) = (int)((longlong)_Dst >> 1);
LAB_14030e220:
  std::basic_streambuf<>::sputc(param_1,param_2);
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_14030e250(undefined8 *param_1,short *param_2)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  undefined1 auStack_88 [32];
  undefined4 local_68 [2];
  undefined8 local_60;
  undefined8 *local_58;
  undefined2 local_50;
  undefined6 uStack_4e;
  undefined8 local_40;
  ulonglong local_38;
  ulonglong local_28;
  
  local_60 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  local_68[0] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  local_58 = param_1;
  FUN_14008d100(param_1 + 4,0,local_68);
  param_1[8] = 0;
  param_1[9] = 0;
  *(undefined4 *)(param_1 + 10) = 0;
  *(undefined1 *)((longlong)param_1 + 0x54) = 0;
  param_1[0xe] = 7;
  param_1[0xd] = 0;
  *(undefined2 *)(param_1 + 0xb) = 0;
  *(undefined1 *)(param_1 + 0x10) = 0xff;
  std::basic_streambuf<>::basic_streambuf<>((basic_streambuf<> *)(param_1 + 0x11));
  param_1[0x11] = boost::io::basic_altstringbuf<>::vftable;
  param_1[0x1f] = 0;
  *(undefined1 *)(param_1 + 0x20) = 0;
  *(undefined4 *)((longlong)param_1 + 0x104) = 3;
  *(undefined1 *)(param_1 + 0x22) = 0;
  if (param_2 != (short *)0x0) {
    local_38 = 7;
    local_40 = 0;
    local_50 = 0;
    uVar2 = 0xffffffffffffffff;
    psVar3 = param_2;
    do {
      if (uVar2 == 0) break;
      uVar2 = uVar2 - 1;
      sVar1 = *psVar3;
      psVar3 = psVar3 + 1;
    } while (sVar1 != 0);
    FUN_140001710(&local_50,param_2,~uVar2 - 1);
    FUN_14030ec10(param_1,&local_50);
    if (7 < local_38) {
      operator_delete((void *)CONCAT62(uStack_4e,local_50));
    }
  }
  return param_1;
}



undefined8 FUN_14030e390(undefined8 param_1,undefined8 param_2)

{
  FUN_14030f0b0(param_2,param_1);
  return param_1;
}



uint * FUN_14030e3c0(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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)) {
        FUN_140343ec0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1403112f0(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_140343ec0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_14030e480(void)

{
  FUN_1402f3920();
  return;
}



uint * FUN_14030e4a0(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x106)) {
      if ((puVar2[0x108] == param_2) && (*puVar2 == param_2)) {
        FUN_1402ebad0(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140311660(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_1402ebad0(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_14030e570(void)

{
  FUN_14030f5d0();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14030e590(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060858c = param_3;
  lVar1 = 0;
  DAT_140608580 = 0x11;
  _DAT_1406085a4 = 10;
  _DAT_140608584 = param_1;
  _DAT_140608588 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608570 = 0;
  DAT_140608578 = 0;
  DAT_1406085a0 = 0;
  DAT_1406085a8 = 0;
  DAT_1406085b0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  _DAT_140608590 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608598 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608598 = 0;
  }
  return &DAT_140608570;
}



void FUN_14030e660(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_1406085a0 = DAT_1406085a0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608570;
  if ((DAT_140608570 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608580, DAT_140608580 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x48);
        FUN_14030f9d0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608570;
        uVar4 = DAT_140608580;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608570 = (void *)0x0;
  DAT_140608578 = 0;
  if (DAT_1406085a0 == 0) {
    uVar5 = FUN_14030f940(0);
    FUN_14030f880(uVar5);
  }
  DAT_1406085b0 = 0;
  _Memory = DAT_1406085a8;
  if (DAT_1406085a8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_1406085a8 = (longlong *)0x0;
    DAT_1406085a0 = DAT_1406085a0 + -1;
    return;
  }
  DAT_1406085a0 = DAT_1406085a0 + -1;
  return;
}



void FUN_14030e760(void)

{
  FUN_14030e660();
  return;
}



undefined8 * FUN_14030e780(undefined8 *param_1)

{
  FUN_14030e7c0();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[5] = boost::exception_detail::clone_impl<>::vftable;
  param_1[10] = boost::exception_detail::clone_impl<>::vftable;
  return param_1;
}



exception * FUN_14030e7c0(exception *param_1,exception *param_2)

{
  longlong *plVar1;
  
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::bad_format_string::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  plVar1 = *(longlong **)(param_2 + 0x30);
  *(longlong **)(param_1 + 0x30) = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))();
  }
  *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(param_2 + 0x38);
  *(undefined8 *)(param_1 + 0x40) = *(undefined8 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x48) = *(undefined4 *)(param_2 + 0x48);
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



exception * FUN_14030e860(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::bad_format_string::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  return param_1;
}



exception * FUN_14030e8a0(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::format_error::vftable;
  return param_1;
}



exception * FUN_14030e8d0(exception *param_1,uint param_2)

{
  *(undefined ***)(param_1 + 0x50) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



exception * FUN_14030e940(exception *param_1,uint param_2)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14030e9a0(exception *param_1)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
                    // WARNING: Could not recover jumptable at 0x00014030e9d5. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



void FUN_14030e9e0(exception *param_1)

{
  *(undefined ***)(param_1 + 0x50) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
                    // WARNING: Could not recover jumptable at 0x00014030ea20. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



undefined8 *
FUN_14030ea30(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x58);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_14030e7c0(puVar1,param_1 + -0x50,param_3,param_4,uVar2);
    *puVar1 = boost::exception_detail::clone_impl<>::vftable;
    puVar1[5] = boost::exception_detail::clone_impl<>::vftable;
    puVar1[10] = boost::exception_detail::clone_impl<>::vftable;
  }
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    puVar1 = puVar1 + 10;
  }
  return puVar1;
}



void FUN_14030eab0(longlong param_1)

{
  undefined **local_60 [3];
  undefined8 local_48;
  undefined8 local_40;
  undefined **local_38;
  longlong *local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined4 local_18;
  undefined **local_10;
  
  std::exception::exception((exception *)local_60,(exception *)(param_1 + -0x50));
  local_60[0] = boost::io::bad_format_string::vftable;
  local_48 = *(undefined8 *)(param_1 + -0x38);
  local_40 = *(undefined8 *)(param_1 + -0x30);
  local_38 = boost::exception::vftable;
  local_30 = *(longlong **)(param_1 + -0x20);
  if (local_30 != (longlong *)0x0) {
    (**(code **)(*local_30 + 0x18))();
  }
  local_28 = *(undefined8 *)(param_1 + -0x18);
  local_20 = *(undefined8 *)(param_1 + -0x10);
  local_18 = *(undefined4 *)(param_1 + -8);
  local_60[0] = boost::exception_detail::clone_impl<>::vftable;
  local_38 = boost::exception_detail::clone_impl<>::vftable;
  local_10 = boost::exception_detail::clone_impl<>::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_60,(ThrowInfo *)&DAT_1405d3988);
}



exception * FUN_14030eb70(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::bad_format_string::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0xffffffff;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



undefined8 FUN_14030ebf0(undefined8 param_1)

{
  FUN_14030fd10();
  return param_1;
}



longlong * FUN_14030ec10(longlong *param_1,undefined8 *param_2)

{
  uint uVar1;
  uint uVar2;
  bool bVar3;
  bool bVar4;
  char cVar5;
  wchar_t wVar6;
  int iVar7;
  undefined8 uVar8;
  ctype<wchar_t> *this;
  facet *pfVar9;
  longlong lVar10;
  undefined8 *puVar11;
  undefined8 *puVar12;
  ulonglong uVar13;
  longlong *plVar14;
  ulonglong uVar15;
  longlong *plVar16;
  longlong *plVar17;
  longlong lVar18;
  longlong lVar19;
  int iVar20;
  int iVar21;
  int local_res20;
  longlong local_138;
  ctype<wchar_t> *local_130;
  longlong local_128;
  facet *local_120;
  undefined8 local_118;
  undefined **local_110 [3];
  longlong local_f8;
  undefined8 local_f0;
  undefined4 local_e8 [2];
  undefined2 local_e0;
  undefined8 local_d0;
  undefined8 local_c8;
  undefined2 local_b8;
  undefined8 local_a8;
  undefined8 local_a0;
  undefined8 local_90;
  undefined8 local_88;
  wchar_t local_80;
  undefined4 local_7c;
  undefined8 local_78;
  undefined1 local_70;
  undefined8 local_60;
  undefined4 local_58;
  
  local_118 = 0xfffffffffffffffe;
  uVar8 = FUN_1403102a0(param_1,&local_120);
  this = (ctype<wchar_t> *)FUN_140313ff0(uVar8);
  local_130 = this;
  if ((local_120 != (facet *)0x0) &&
     (pfVar9 = std::locale::facet::_Decref(local_120), pfVar9 != (facet *)0x0)) {
    (*(code *)**(undefined8 **)pfVar9)(pfVar9,1);
  }
  wVar6 = std::ctype<wchar_t>::widen(this,'%');
  bVar3 = true;
  iVar21 = -1;
  iVar7 = FUN_1403107b0(param_2,wVar6,this,(char)param_1[0x10]);
  FUN_140310580(param_1,(longlong)iVar7);
  lVar19 = 0;
  local_res20 = 0;
  lVar18 = 0;
  bVar4 = false;
  iVar20 = 0;
  lVar10 = FUN_14030fb40(param_2,wVar6,0);
  iVar7 = 0;
  if (lVar10 != -1) {
    do {
      if (iVar20 == 0) {
        plVar14 = param_1 + 0xb;
      }
      else {
        plVar14 = (longlong *)((longlong)(iVar20 + -1) * 0x98 + 0x30 + *param_1);
      }
      uVar15 = param_2[3];
      puVar11 = param_2;
      puVar12 = param_2;
      if (7 < uVar15) {
        puVar11 = (undefined8 *)*param_2;
        puVar12 = (undefined8 *)*param_2;
      }
      if (*(short *)((longlong)puVar12 + lVar10 * 2 + 2) ==
          *(short *)((longlong)puVar11 + lVar10 * 2)) {
        puVar12 = param_2;
        if (7 < uVar15) {
          puVar12 = (undefined8 *)*param_2;
        }
        puVar11 = param_2;
        if (7 < uVar15) {
          puVar11 = (undefined8 *)*param_2;
        }
        plVar16 = plVar14;
        if (7 < (ulonglong)plVar14[3]) {
          plVar16 = (longlong *)*plVar14;
        }
        plVar17 = plVar14;
        if (7 < (ulonglong)plVar14[3]) {
          plVar17 = (longlong *)*plVar14;
        }
        FUN_140312310(plVar14,(longlong)plVar17 + plVar14[2] * 2,(longlong)plVar16 + plVar14[2] * 2,
                      (longlong)puVar11 + lVar18 * 2,(longlong)puVar12 + lVar10 * 2 + 2);
        lVar10 = lVar10 + 2;
        lVar18 = lVar10;
      }
      else {
        if (lVar10 != lVar18) {
          puVar12 = param_2;
          if (7 < uVar15) {
            puVar12 = (undefined8 *)*param_2;
          }
          puVar11 = param_2;
          if (7 < uVar15) {
            puVar11 = (undefined8 *)*param_2;
          }
          plVar16 = plVar14;
          if (7 < (ulonglong)plVar14[3]) {
            plVar16 = (longlong *)*plVar14;
          }
          plVar17 = plVar14;
          if (7 < (ulonglong)plVar14[3]) {
            plVar17 = (longlong *)*plVar14;
          }
          FUN_140312310(plVar14,(longlong)plVar17 + plVar14[2] * 2,
                        (longlong)plVar16 + plVar14[2] * 2,(longlong)puVar11 + lVar18 * 2,
                        (longlong)puVar12 + lVar10 * 2);
          lVar18 = lVar10;
        }
        puVar12 = param_2;
        if (7 < (ulonglong)param_2[3]) {
          puVar12 = (undefined8 *)*param_2;
        }
        local_138 = (longlong)puVar12 + (lVar10 + 1) * 2;
        puVar12 = param_2;
        if (7 < (ulonglong)param_2[3]) {
          puVar12 = (undefined8 *)*param_2;
        }
        local_128 = (longlong)puVar12 + param_2[2] * 2;
        cVar5 = FUN_1403109c0(&local_138,&local_128,(longlong)iVar20 * 0x98 + *param_1,local_130,
                              lVar10 + 1,(char)param_1[0x10]);
        puVar12 = param_2;
        if (7 < (ulonglong)param_2[3]) {
          puVar12 = (undefined8 *)*param_2;
        }
        lVar10 = local_138 - (longlong)puVar12 >> 1;
        if (cVar5 != '\0') {
          lVar18 = *param_1;
          uVar1 = *(uint *)(lVar19 + 0x90 + lVar18);
          if ((uVar1 & 1) != 0) {
            uVar2 = *(uint *)(lVar19 + 0x6c + lVar18);
            if ((uVar2 & 0x40) == 0) {
              *(uint *)(lVar19 + 0x90 + lVar18) = uVar1 & 0xfffffffd;
              *(undefined2 *)(lVar19 + 0x68 + lVar18) = 0x30;
              *(uint *)(lVar19 + 0x6c + lVar18) = uVar2 & 0xffffff3f | 0x100;
            }
            else {
              *(uint *)(lVar19 + 0x90 + lVar18) = uVar1 & 0xfffffffe;
            }
          }
          uVar1 = *(uint *)(lVar19 + 0x90 + lVar18);
          if (((uVar1 & 2) != 0) && ((*(byte *)(lVar19 + 0x6c + lVar18) & 0x20) != 0)) {
            *(uint *)(lVar19 + 0x90 + lVar18) = uVar1 & 0xfffffffd;
          }
          iVar7 = *(int *)(lVar19 + *param_1);
          lVar18 = lVar10;
          if (iVar7 != -3) {
            if (iVar7 == -1) {
              bVar3 = false;
            }
            else if (iVar7 == -2) {
              bVar4 = true;
            }
            else if (iVar21 < iVar7) {
              iVar21 = iVar7;
            }
            local_res20 = local_res20 + 1;
            iVar20 = iVar20 + 1;
            lVar19 = lVar19 + 0x98;
          }
        }
      }
      lVar10 = FUN_14030fb40(param_2,wVar6,lVar10);
    } while (lVar10 != -1);
    iVar7 = local_res20;
    if (iVar20 != 0) {
      plVar14 = (longlong *)((longlong)(iVar20 + -1) * 0x98 + 0x30 + *param_1);
      goto LAB_14030ef74;
    }
  }
  local_res20 = iVar7;
  plVar14 = param_1 + 0xb;
LAB_14030ef74:
  FUN_140310940(plVar14,param_2,lVar18,param_2[2]);
  if (!bVar3) {
    if ((-1 < iVar21) && ((*(byte *)(param_1 + 0x10) & 1) != 0)) {
      std::exception::exception((exception *)local_110);
      local_110[0] = boost::io::bad_format_string::vftable;
      local_f8 = (longlong)iVar21;
      local_f0 = 0;
      FUN_14030dc30(local_110);
    }
    uVar13 = 0;
    iVar21 = 0;
    lVar18 = (longlong)local_res20;
    uVar15 = uVar13;
    if (0 < local_res20) {
      do {
        if (*(int *)(uVar13 + *param_1) == -1) {
          *(int *)(uVar13 + *param_1) = (int)uVar15;
          uVar15 = (ulonglong)((int)uVar15 + 1);
        }
        iVar21 = (int)uVar15;
        uVar13 = uVar13 + 0x98;
        lVar18 = lVar18 + -1;
      } while (lVar18 != 0);
    }
    iVar21 = iVar21 + -1;
  }
  local_80 = std::ctype<wchar_t>::widen(local_130,' ');
  local_e8[0] = 0xffffffff;
  local_c8 = 7;
  local_d0 = 0;
  local_e0 = 0;
  local_a0 = 7;
  local_a8 = 0;
  local_b8 = 0;
  local_70 = 0;
  local_90 = 0;
  local_88 = 6;
  local_7c = 0x201;
  local_78 = 0;
  local_60 = 0x7fffffffffffffff;
  local_58 = 0;
  FUN_14030fc30(param_1,(longlong)local_res20,local_e8);
  if (bVar4) {
    *(uint *)(param_1 + 9) = *(uint *)(param_1 + 9) | 4;
  }
  *(int *)(param_1 + 10) = iVar21 + 1;
  if (bVar3) {
    *(uint *)(param_1 + 9) = *(uint *)(param_1 + 9) | 1;
  }
  else {
    *(uint *)(param_1 + 9) = *(uint *)(param_1 + 9) & 0xfffffffe;
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 **** FUN_14030f0b0(longlong *param_1,undefined8 ****param_2)

{
  int iVar1;
  undefined8 ***pppuVar2;
  char cVar3;
  undefined8 uVar4;
  longlong lVar5;
  undefined8 ****ppppuVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined1 auStack_168 [32];
  undefined4 local_148;
  undefined **local_140 [3];
  longlong local_128;
  longlong local_120;
  undefined8 local_118;
  undefined1 local_110 [88];
  undefined1 local_b8 [80];
  undefined8 ***local_68 [2];
  undefined8 **local_58;
  undefined8 **local_50;
  ulonglong local_40;
  
  local_118 = 0xfffffffffffffffe;
  local_40 = DAT_1405d84f0 ^ (ulonglong)auStack_168;
  uVar7 = 0;
  local_148 = 0;
  if ((param_1[1] - *param_1) / 0x98 == 0) {
    param_2[3] = (undefined8 ***)0x7;
    param_2[2] = (undefined8 ***)0x0;
    *(undefined2 *)param_2 = 0;
    FUN_1400015e0(param_2,param_1 + 0xb,0,0xffffffffffffffff);
  }
  else {
    iVar1 = *(int *)((longlong)param_1 + 0x4c);
    lVar5 = param_1[10];
    if ((iVar1 < (int)lVar5) && ((*(byte *)(param_1 + 0x10) & 2) != 0)) {
      std::exception::exception((exception *)local_140);
      local_140[0] = boost::io::too_few_args::vftable;
      local_128 = (longlong)iVar1;
      local_120 = (longlong)(int)lVar5;
      uVar4 = FUN_140312620(local_b8,local_140);
      FUN_1403126a0(local_110,uVar4);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_110,(ThrowInfo *)&DAT_1405d3a60);
    }
    local_50 = (undefined8 ***)0x7;
    local_58 = (undefined8 ***)0x0;
    local_68[0] = (undefined8 ***)((ulonglong)local_68[0] & 0xffffffffffff0000);
    lVar5 = FUN_140310500(param_1);
    if ((lVar5 != 7) && (cVar3 = FUN_140001910(local_68,lVar5,1), cVar3 != '\0')) {
      local_58 = (undefined8 ***)0x0;
      ppppuVar6 = local_68;
      if ((undefined8 ***)0x7 < local_50) {
        ppppuVar6 = (undefined8 ****)local_68[0];
      }
      *(undefined2 *)ppppuVar6 = 0;
    }
    FUN_140002c00(local_68,param_1 + 0xb,0,0xffffffffffffffff);
    lVar5 = param_1[1] - *param_1 >> 0x3f;
    uVar8 = uVar7;
    if ((param_1[1] - *param_1) / 0x98 + lVar5 != lVar5) {
      do {
        lVar5 = *param_1;
        FUN_140002c00(local_68,uVar7 + 8 + lVar5,0,0xffffffffffffffff);
        if ((*(int *)(uVar7 + lVar5) == -2) &&
           (pppuVar2 = *(undefined8 ****)(uVar7 + 0x58 + lVar5), local_58 < pppuVar2)) {
          FUN_140123f40(local_68,(longlong)pppuVar2 - (longlong)local_58);
        }
        FUN_140002c00(local_68,uVar7 + 0x30 + lVar5,0,0xffffffffffffffff);
        uVar8 = (ulonglong)((int)uVar8 + 1);
        uVar7 = uVar7 + 0x98;
      } while (uVar8 < (ulonglong)((param_1[1] - *param_1) / 0x98));
    }
    *(undefined1 *)((longlong)param_1 + 0x54) = 1;
    param_2[3] = (undefined8 ***)0x7;
    param_2[2] = (undefined8 ***)0x0;
    *(undefined2 *)param_2 = 0;
    if (param_2 != local_68) {
      if ((undefined8 ***)0x7 < param_2[3]) {
        operator_delete(*param_2);
      }
      param_2[3] = (undefined8 ***)0x7;
      param_2[2] = (undefined8 ***)0x0;
      *(undefined2 *)param_2 = 0;
      if (local_50 < (undefined8 ***)0x8) {
        memmove(param_2,local_68,(longlong)local_58 * 2 + 2);
      }
      else {
        *param_2 = local_68[0];
        local_68[0] = (undefined8 ****)0x0;
      }
      param_2[2] = (undefined8 ***)local_58;
      param_2[3] = (undefined8 ***)local_50;
      local_58 = (undefined8 ***)0x0;
      local_50 = (undefined8 ***)0x0;
    }
    if ((undefined8 ***)0x7 < local_50) {
      operator_delete(local_68[0]);
    }
  }
  return param_2;
}



longlong FUN_14030f380(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  int iVar3;
  
  if (*(char *)(param_1 + 0x54) != '\0') {
    FUN_140310390();
  }
  FUN_140311190(param_1,param_2);
  *(int *)(param_1 + 0x4c) = *(int *)(param_1 + 0x4c) + 1;
  iVar3 = *(int *)(param_1 + 0x4c);
  if ((*(longlong *)(param_1 + 0x40) != 0) && (iVar3 < *(int *)(param_1 + 0x50))) {
    do {
      uVar2 = (ulonglong)iVar3;
      if ((iVar3 < 0) && (uVar2 != 0)) {
        lVar1 = -((-uVar2 - 1 >> 5) * 4 + 4);
      }
      else {
        lVar1 = (uVar2 >> 5) * 4;
      }
      if ((*(uint *)(*(longlong *)(param_1 + 0x20) + lVar1) & 1 << ((byte)iVar3 & 0x1f)) == 0) {
        return param_1;
      }
      iVar3 = iVar3 + 1;
      *(int *)(param_1 + 0x4c) = iVar3;
    } while (iVar3 < *(int *)(param_1 + 0x50));
  }
  return param_1;
}



int FUN_14030f430(short *param_1)

{
  uint *puVar1;
  short sVar2;
  bool bVar3;
  ushort uVar4;
  basic_istream<> *pbVar5;
  undefined8 uVar6;
  ulonglong uVar7;
  short *psVar8;
  int local_res8 [2];
  undefined **local_178 [3];
  TypeDescriptor *local_160;
  TypeDescriptor *local_158;
  undefined8 local_150;
  longlong local_148 [3];
  uint auStack_130 [2];
  undefined8 auStack_128 [10];
  undefined **local_d8 [4];
  undefined8 *local_b8;
  undefined8 *local_98;
  undefined4 *local_80;
  short *local_68;
  short *local_60;
  undefined1 local_58 [80];
  
  local_150 = 0xfffffffffffffffe;
  std::basic_streambuf<>::basic_streambuf<>((basic_streambuf<> *)local_d8);
  local_d8[0] = boost::detail::lexical_stream_limited_src<>::vftable;
  uVar7 = 0xffffffffffffffff;
  psVar8 = param_1;
  do {
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    sVar2 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar2 != 0);
  local_60 = param_1 + (~uVar7 - 1);
  *local_b8 = param_1;
  *local_98 = param_1;
  *local_80 = (int)((longlong)local_60 - (longlong)param_1 >> 1);
  local_68 = param_1;
  std::basic_istream<>::basic_istream<>
            ((basic_istream<> *)local_148,(basic_streambuf<> *)local_d8,false);
  puVar1 = (uint *)((longlong)auStack_130 + (longlong)*(int *)(local_148[0] + 4));
  *puVar1 = *puVar1 & 0xfffffffe;
  *(undefined8 *)((longlong)auStack_128 + (longlong)*(int *)(local_148[0] + 4)) = 6;
  pbVar5 = std::basic_istream<>::operator>>((basic_istream<> *)local_148,local_res8);
  pbVar5 = pbVar5 + *(int *)(*(longlong *)pbVar5 + 4);
  if (((byte)pbVar5[0x10] & 6) != 0) {
    pbVar5 = (basic_istream<> *)0x0;
  }
  if (pbVar5 != (basic_istream<> *)0x0) {
    uVar4 = std::basic_istream<>::get((basic_istream<> *)local_148);
    if (uVar4 == 0xffff) {
      bVar3 = true;
      goto LAB_14030f525;
    }
  }
  bVar3 = false;
LAB_14030f525:
  std::basic_istream<>::_vbase_destructor_((basic_istream<> *)local_148);
  if (bVar3) {
    std::basic_streambuf<>::~basic_streambuf<>((basic_streambuf<> *)local_d8);
    return local_res8[0];
  }
  std::bad_cast::bad_cast((bad_cast *)local_178,"bad cast");
  local_178[0] = boost::bad_lexical_cast::vftable;
  local_160 = &.PEB_W::RTTI_Type_Descriptor;
  local_158 = &.H::RTTI_Type_Descriptor;
  uVar6 = FUN_140312bd0(local_58,local_178);
  FUN_140312c50(local_148,uVar6);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_148,(ThrowInfo *)&DAT_1405d3b38);
}



void FUN_14030f5d0(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 + 0x418);
        FUN_1403117e0(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_14030f6a0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x420) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x418); lVar4 != param_2;
        lVar4 = *(longlong *)(lVar4 + 0x418)) {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x418) = *(undefined8 *)(param_2 + 0x418);
      FUN_1403117e0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x418);
  FUN_1403117e0(param_1,param_2);
  return;
}



undefined8 * FUN_14030f730(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;
}



undefined8 * FUN_14030f7a0(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;
}



undefined8 * FUN_14030f810(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;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_14030f880(uint param_1)

{
  longlong lVar1;
  longlong lVar2;
  float fVar3;
  float fVar4;
  
  if (DAT_140608570 != (void *)0x0) {
    operator_delete__(DAT_140608570);
    DAT_140608570 = (void *)0x0;
  }
  lVar1 = 0;
  DAT_140608580 = param_1;
  fVar4 = (float)param_1 * _DAT_14060858c;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  fVar3 = (float)param_1 * _DAT_140608588;
  lVar2 = 0;
  _DAT_140608590 = (longlong)fVar4 + lVar1;
  if ((9.223372e+18 < fVar3) && (fVar3 = fVar3 - 9.223372e+18, fVar3 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608598 = (longlong)fVar3 + lVar2;
  if ((ulonglong)((longlong)fVar3 + lVar2) < 0x11) {
    DAT_140608598 = 0;
  }
  return CONCAT71((int7)(DAT_140608598 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_14030f940(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608584;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_14030f9d0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (7 < *(ulonglong *)(param_1 + 0x38)) {
    operator_delete(*(void **)(param_1 + 0x20));
  }
  *(undefined8 *)(param_1 + 0x38) = 7;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined2 *)(param_1 + 0x20) = 0;
  *(longlong *)(param_1 + 0x48) = DAT_1406085b0;
  DAT_140608578 = DAT_140608578 - 1;
  DAT_1406085b0 = param_1;
  if ((DAT_140608578 < DAT_140608598) && (DAT_1406085a0 == 0)) {
    uVar2 = FUN_14030f940(DAT_140608578);
    FUN_140311930(uVar2);
  }
  if (DAT_140608578 == 0) {
    DAT_1406085b0 = 0;
    _Memory = DAT_1406085a8;
    if (DAT_1406085a8 != (longlong *)0x0) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_1406085a8 = (longlong *)0x0;
    }
  }
  return;
}



void FUN_14030faa0(longlong param_1)

{
  facet *pfVar1;
  
  if (*(char *)(param_1 + 0x78) != '\0') {
    if (*(facet **)(param_1 + 0x80) != (facet *)0x0) {
      pfVar1 = std::locale::facet::_Decref(*(facet **)(param_1 + 0x80));
      if (pfVar1 != (facet *)0x0) {
        (*(code *)**(undefined8 **)pfVar1)(pfVar1,1);
      }
    }
    *(undefined1 *)(param_1 + 0x78) = 0;
  }
  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 __thiscall std::basic_streambuf<>::~basic_streambuf<>(basic_streambuf<> *this)

{
                    // WARNING: Could not recover jumptable at 0x00014030fb30. Too many branches
                    // WARNING: Treating indirect jump as call
  ~basic_streambuf<>(this);
  return;
}



longlong FUN_14030fb40(undefined8 *param_1,ushort param_2,ulonglong param_3)

{
  undefined8 *puVar1;
  longlong lVar2;
  int iVar3;
  ushort *puVar4;
  ushort *puVar5;
  ushort *puVar6;
  ushort *puVar7;
  longlong lVar8;
  ushort local_res10 [4];
  
  local_res10[0] = param_2;
  if ((param_3 < (ulonglong)param_1[2]) && (lVar8 = param_1[2] - param_3, lVar8 != 0)) {
    puVar1 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar1 = (undefined8 *)*param_1;
    }
    puVar5 = (ushort *)((longlong)puVar1 + param_3 * 2);
    for (; lVar2 = lVar8, puVar4 = puVar5, lVar8 != 0; lVar8 = lVar8 + (-1 - (lVar2 >> 1))) {
      while (*puVar4 != param_2) {
        puVar4 = puVar4 + 1;
        lVar2 = lVar2 + -1;
        if (lVar2 == 0) {
          return -1;
        }
      }
      if (puVar4 == (ushort *)0x0) {
        return -1;
      }
      lVar2 = 1;
      puVar6 = local_res10;
      puVar7 = puVar4;
      while (*puVar7 == *puVar6) {
        puVar7 = puVar7 + 1;
        puVar6 = puVar6 + 1;
        lVar2 = lVar2 + -1;
        if (lVar2 == 0) goto LAB_14030fbdb;
      }
      iVar3 = 1;
      if (*puVar7 < *puVar6) {
        iVar3 = -1;
      }
      if (iVar3 == 0) {
LAB_14030fbdb:
        if (7 < (ulonglong)param_1[3]) {
          param_1 = (undefined8 *)*param_1;
        }
        return (longlong)puVar4 - (longlong)param_1 >> 1;
      }
      lVar2 = (longlong)puVar4 - (longlong)puVar5;
      puVar5 = puVar4 + 1;
    }
  }
  return -1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14030fc30(longlong *param_1,ulonglong param_2,undefined8 param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong lVar4;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined8 local_40;
  ulonglong local_38;
  
  local_48 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  lVar1 = param_1[1];
  uVar2 = (lVar1 - *param_1) / 0x98;
  local_40 = param_3;
  if (uVar2 < param_2) {
    FUN_14030fe40(param_1,lVar1,param_2 - uVar2,param_3);
  }
  else if ((param_2 < uVar2) && (param_2 * 0x98 + *param_1 != lVar1)) {
    lVar3 = FUN_140312cc0(lVar1,lVar1);
    lVar1 = param_1[1];
    for (lVar4 = lVar3; lVar4 != lVar1; lVar4 = lVar4 + 0x98) {
      FUN_14030faa0(lVar4);
    }
    param_1[1] = lVar3;
  }
  FUN_14030faa0(param_3);
  return;
}



undefined8 * FUN_14030fd10(undefined8 *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_14030e7c0();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[5] = boost::exception_detail::clone_impl<>::vftable;
  param_1[10] = boost::exception_detail::clone_impl<>::vftable;
  if (param_2 != 0) {
    param_2 = param_2 + 0x28;
  }
  plVar1 = *(longlong **)(param_2 + 8);
  if ((longlong *)param_1[6] != (longlong *)0x0) {
    (**(code **)(*(longlong *)param_1[6] + 0x20))();
  }
  param_1[6] = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))(plVar1);
  }
  param_1[7] = *(undefined8 *)(param_2 + 0x10);
  param_1[8] = *(undefined8 *)(param_2 + 0x18);
  *(undefined4 *)(param_1 + 9) = *(undefined4 *)(param_2 + 0x20);
  return param_1;
}



void FUN_14030fdb0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (*(void **)((longlong)pvVar1 + 0x10) != (void *)0x0) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x10));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x10) = 0;
    *(undefined8 *)((longlong)pvVar1 + 0x18) = 0;
    *(undefined8 *)((longlong)pvVar1 + 0x20) = 0;
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14030fdf0(longlong param_1)

{
  FUN_1403118c0(*(undefined8 *)(param_1 + 0x10));
  return;
}



basic_streambuf<> * FUN_14030fe00(basic_streambuf<> *param_1,uint param_2)

{
  std::basic_streambuf<>::~basic_streambuf<>(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

void FUN_14030fe40(longlong *param_1,longlong param_2,char *param_3,undefined8 param_4)

{
  char *pcVar1;
  code *pcVar2;
  void *pvVar3;
  longlong lVar4;
  longlong lVar5;
  char *pcVar6;
  longlong lVar7;
  undefined1 auStack_148 [32];
  undefined4 local_128;
  char *local_120;
  longlong *local_118;
  void *local_110;
  undefined8 local_108;
  undefined **local_100 [3];
  undefined1 local_e8 [160];
  ulonglong local_48;
  
  local_108 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_148;
  if (param_3 != (char *)0x0) {
    lVar5 = (param_1[1] - *param_1) / 0x98;
    local_120 = param_3;
    local_118 = param_1;
    if ((char *)(0x1af286bca1af286U - lVar5) < param_3) {
      std::_Xlength_error("vector<T> too long");
      pcVar2 = (code *)swi(3);
      (*pcVar2)();
      return;
    }
    pcVar1 = param_3 + lVar5;
    lVar5 = param_1[2] - *param_1;
    lVar5 = lVar5 / 0x26 + (lVar5 >> 0x3f);
    pcVar6 = (char *)((lVar5 >> 2) - (lVar5 >> 0x3f));
    if (pcVar6 < pcVar1) {
      if ((char *)(0x1af286bca1af286 - ((ulonglong)pcVar6 >> 1)) < pcVar6) {
        pcVar6 = (char *)0x0;
      }
      else {
        pcVar6 = pcVar6 + ((ulonglong)pcVar6 >> 1);
      }
      if (pcVar6 < pcVar1) {
        pcVar6 = pcVar1;
      }
      local_110 = (void *)0x0;
      if ((pcVar6 != (char *)0x0) &&
         (((char *)0x1af286bca1af286 < pcVar6 ||
          (local_110 = operator_new((longlong)pcVar6 * 0x98), local_110 == (void *)0x0)))) {
        local_120 = (char *)0x0;
        std::exception::exception((exception *)local_100,&local_120);
        local_100[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_100,(ThrowInfo *)&DAT_1405d3608);
      }
      pvVar3 = local_110;
      lVar5 = (param_2 - *param_1) / 0x26 + (param_2 - *param_1 >> 0x3f);
      lVar5 = (lVar5 >> 2) - (lVar5 >> 0x3f);
      local_128 = 0;
      local_118 = (longlong *)lVar5;
      FUN_140312f70((void *)(lVar5 * 0x98 + (longlong)local_110),param_3,param_4);
      local_128 = 1;
      FUN_140313c30(*param_1,param_2,pvVar3);
      local_128 = 2;
      FUN_140313c30(param_2,param_1[1],
                    (void *)((longlong)(param_3 + lVar5) * 0x98 + (longlong)pvVar3));
      lVar5 = *param_1;
      lVar4 = param_1[1];
      if (lVar5 != 0) {
        FUN_14030dbf0(lVar5,param_1[1]);
        operator_delete((void *)*param_1);
      }
      param_1[2] = (longlong)((longlong)pcVar6 * 0x98 + (longlong)pvVar3);
      param_1[1] = (longlong)
                   ((longlong)(param_3 + (lVar4 - lVar5) / 0x98) * 0x98 + (longlong)pvVar3);
      *param_1 = (longlong)pvVar3;
    }
    else {
      if ((char *)((param_1[1] - param_2) / 0x98) < param_3) {
        FUN_1403101a0(local_e8,param_4);
        FUN_140313c30(param_2,param_1[1],(longlong)param_3 * 0x98 + param_2);
        FUN_140312f70(param_1[1],(longlong)param_3 - (param_1[1] - param_2) / 0x98,local_e8);
        param_1[1] = param_1[1] + (longlong)param_3 * 0x98;
        FUN_140312da0(param_2,param_1[1] + (longlong)param_3 * -0x98,local_e8);
      }
      else {
        FUN_1403101a0(local_e8,param_4);
        lVar5 = param_1[1];
        lVar7 = lVar5 + (longlong)param_3 * -0x98;
        lVar4 = FUN_140313c30(lVar7,lVar5,lVar5);
        param_1[1] = lVar4;
        FUN_140312e80(param_2,lVar7,lVar5);
        FUN_140312da0(param_2,(longlong)param_3 * 0x98 + param_2,local_e8);
      }
      FUN_14030faa0(local_e8);
    }
  }
  return;
}



undefined4 * FUN_1403101a0(undefined4 *param_1,undefined4 *param_2)

{
  facet *this;
  
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(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_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x16) = *(undefined8 *)(param_2 + 0x16);
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined2 *)(param_1 + 0x1a) = *(undefined2 *)(param_2 + 0x1a);
  param_1[0x1b] = param_2[0x1b];
  param_1[0x1c] = param_2[0x1c];
  param_1[0x1d] = param_2[0x1d];
  *(undefined1 *)(param_1 + 0x1e) = 0;
  if (*(char *)(param_2 + 0x1e) != '\0') {
    if ((undefined8 *)(param_1 + 0x20) != (undefined8 *)0x0) {
      this = *(facet **)(param_2 + 0x20);
      *(facet **)(param_1 + 0x20) = this;
      std::locale::facet::_Incref(this);
    }
    *(undefined1 *)(param_1 + 0x1e) = 1;
  }
  *(undefined8 *)(param_1 + 0x22) = *(undefined8 *)(param_2 + 0x22);
  param_1[0x24] = param_2[0x24];
  return param_1;
}



undefined8 * FUN_1403102a0(longlong param_1,undefined8 *param_2)

{
  _Locimp *this;
  facet *pfVar1;
  facet *pfVar2;
  bool bVar3;
  
  bVar3 = *(char *)(param_1 + 0x110) == '\0';
  if (bVar3) {
    pfVar2 = (facet *)std::locale::_Init();
    this = std::locale::_Getgloballocale();
    std::locale::facet::_Incref((facet *)this);
  }
  else {
    pfVar2 = *(facet **)(param_1 + 0x118);
    std::locale::facet::_Incref(pfVar2);
  }
  *param_2 = pfVar2;
  std::locale::facet::_Incref(pfVar2);
  if ((bVar3) && (pfVar2 != (facet *)0x0)) {
    pfVar1 = std::locale::facet::_Decref(pfVar2);
    if (pfVar1 != (facet *)0x0) {
      (*(code *)**(undefined8 **)pfVar1)(pfVar1,1);
    }
  }
  if ((!bVar3) && (pfVar2 != (facet *)0x0)) {
    pfVar2 = std::locale::facet::_Decref(pfVar2);
    if (pfVar2 != (facet *)0x0) {
      (*(code *)**(undefined8 **)pfVar2)(pfVar2,1);
    }
  }
  return param_2;
}



longlong * FUN_140310390(longlong *param_1)

{
  longlong lVar1;
  int iVar2;
  ulonglong uVar3;
  uint uVar4;
  longlong lVar5;
  
  uVar4 = 0;
  lVar5 = param_1[1] - *param_1 >> 0x3f;
  if ((param_1[1] - *param_1) / 0x98 + lVar5 != lVar5) {
    lVar5 = 0;
    do {
      if (param_1[8] == 0) {
LAB_14031042b:
        FUN_140001870(lVar5 + 8 + *param_1,0,0xffffffffffffffff);
      }
      else {
        iVar2 = *(int *)(lVar5 + *param_1);
        uVar3 = (ulonglong)iVar2;
        if (iVar2 < 0) goto LAB_14031042b;
        if (((longlong)uVar3 < 0) && (uVar3 != 0)) {
          lVar1 = -((-uVar3 - 1 >> 5) * 4 + 4);
        }
        else {
          lVar1 = (uVar3 >> 5) * 4;
        }
        if ((*(uint *)(param_1[4] + lVar1) & 1 << ((byte)iVar2 & 0x1f)) == 0) goto LAB_14031042b;
      }
      uVar4 = uVar4 + 1;
      lVar5 = lVar5 + 0x98;
    } while ((ulonglong)uVar4 < (ulonglong)((param_1[1] - *param_1) / 0x98));
  }
  *(undefined4 *)((longlong)param_1 + 0x4c) = 0;
  *(undefined1 *)((longlong)param_1 + 0x54) = 0;
  if ((param_1[8] != 0) && (0 < (int)param_1[10])) {
    do {
      iVar2 = *(int *)((longlong)param_1 + 0x4c);
      uVar3 = (ulonglong)iVar2;
      if ((iVar2 < 0) && (uVar3 != 0)) {
        lVar5 = -((-uVar3 - 1 >> 5) * 4 + 4);
      }
      else {
        lVar5 = (uVar3 >> 5) * 4;
      }
    } while (((*(uint *)(param_1[4] + lVar5) & 1 << ((byte)iVar2 & 0x1f)) != 0) &&
            (*(int *)((longlong)param_1 + 0x4c) = iVar2 + 1, iVar2 + 1 < (int)param_1[10]));
  }
  return param_1;
}



longlong FUN_140310500(undefined8 *param_1)

{
  longlong lVar1;
  ulonglong *puVar2;
  longlong lVar3;
  longlong lVar4;
  int *piVar5;
  uint uVar6;
  ulonglong local_res8;
  ulonglong local_res10 [3];
  
  lVar4 = param_1[0xd];
  piVar5 = (int *)*param_1;
  uVar6 = 0;
  lVar1 = param_1[1] - (longlong)piVar5 >> 0x3f;
  lVar3 = (param_1[1] - (longlong)piVar5) / 0x98 + lVar1;
  if (lVar3 != lVar1) {
    do {
      local_res10[0] = lVar4 + *(longlong *)(piVar5 + 6);
      if (*piVar5 == -2) {
        local_res8 = *(ulonglong *)(piVar5 + 0x16);
        puVar2 = &local_res8;
        if (*(ulonglong *)(piVar5 + 0x16) <= local_res10[0]) {
          puVar2 = local_res10;
        }
        local_res10[0] = *puVar2;
      }
      lVar4 = local_res10[0] + *(longlong *)(piVar5 + 0x10);
      uVar6 = uVar6 + 1;
      piVar5 = piVar5 + 0x26;
    } while ((ulonglong)uVar6 < (ulonglong)(lVar3 - lVar1));
  }
  return lVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140310580(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  wchar_t wVar2;
  undefined8 uVar3;
  ctype<wchar_t> *this;
  facet *pfVar4;
  longlong lVar5;
  longlong lVar6;
  undefined1 auStack_f8 [32];
  facet *local_d8;
  undefined8 local_d0;
  undefined4 local_c8 [2];
  undefined2 local_c0;
  undefined6 uStack_be;
  undefined8 local_b0;
  ulonglong local_a8;
  undefined2 local_98;
  undefined6 uStack_96;
  undefined8 local_88;
  ulonglong local_80;
  undefined8 local_70;
  undefined8 local_68;
  wchar_t local_60;
  undefined4 local_5c;
  undefined8 local_58;
  char local_50;
  facet *local_48;
  undefined8 local_40;
  undefined4 local_38;
  ulonglong local_28;
  
  local_d0 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_f8;
  uVar3 = FUN_1403102a0(param_1,&local_d8);
  this = (ctype<wchar_t> *)FUN_140313ff0(uVar3);
  wVar2 = std::ctype<wchar_t>::widen(this,' ');
  if ((local_d8 != (facet *)0x0) &&
     (pfVar4 = std::locale::facet::_Decref(local_d8), pfVar4 != (facet *)0x0)) {
    (*(code *)**(undefined8 **)pfVar4)(pfVar4,1);
  }
  lVar1 = param_1[1] - *param_1 >> 0x3f;
  lVar5 = (param_1[1] - *param_1) / 0x98 + lVar1;
  lVar6 = 0;
  if (lVar5 == lVar1) {
    local_c8[0] = 0xffffffff;
    local_a8 = 7;
    local_b0 = 0;
    local_c0 = 0;
    local_80 = 7;
    local_88 = 0;
    local_98 = 0;
    local_50 = '\0';
    local_70 = 0;
    local_68 = 6;
    local_5c = 0x201;
    local_58 = 0;
    local_40 = 0x7fffffffffffffff;
    local_38 = 0;
    local_60 = wVar2;
    FUN_1403123c0(param_1,param_2,local_c8);
    if (((local_50 != '\0') && (local_48 != (facet *)0x0)) &&
       (pfVar4 = std::locale::facet::_Decref(local_48), pfVar4 != (facet *)0x0)) {
      (*(code *)**(undefined8 **)pfVar4)(pfVar4,1);
    }
    if (7 < local_80) {
      operator_delete((void *)CONCAT62(uStack_96,local_98));
    }
    if (7 < local_a8) {
      operator_delete((void *)CONCAT62(uStack_be,local_c0));
    }
  }
  else {
    if ((ulonglong)(lVar5 - lVar1) < param_2) {
      local_c8[0] = 0xffffffff;
      local_a8 = 7;
      local_b0 = 0;
      local_c0 = 0;
      local_80 = 7;
      local_88 = 0;
      local_98 = 0;
      local_50 = '\0';
      local_70 = 0;
      local_68 = 6;
      local_5c = 0x201;
      local_58 = 0;
      local_40 = 0x7fffffffffffffff;
      local_38 = 0;
      local_60 = wVar2;
      FUN_14030fc30(param_1,param_2,local_c8);
    }
    FUN_14008e270(param_1 + 4);
    for (; param_2 != 0; param_2 = param_2 - 1) {
      FUN_1403124e0(lVar6 + *param_1,wVar2);
      lVar6 = lVar6 + 0x98;
    }
  }
  FUN_140001870(param_1 + 0xb,0,0xffffffffffffffff);
  return;
}



int FUN_1403107b0(undefined8 *param_1,ulonglong param_2,ctype<wchar_t> *param_3,ulonglong param_4)

{
  ulonglong uVar1;
  bool bVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  ulonglong uVar6;
  wchar_t *pwVar7;
  int iVar8;
  undefined **local_50 [3];
  longlong local_38;
  ulonglong local_30;
  
  iVar8 = 0;
  local_38 = FUN_14030fb40(param_1,param_2,0,param_4,0xfffffffffffffffe);
  while( true ) {
    if (local_38 == -1) {
      return iVar8;
    }
    uVar6 = param_1[2];
    if (uVar6 <= local_38 + 1U) break;
    uVar1 = param_1[3];
    puVar3 = param_1;
    puVar5 = param_1;
    if (7 < uVar1) {
      puVar3 = (undefined8 *)*param_1;
      puVar5 = (undefined8 *)*param_1;
    }
    if (*(short *)((longlong)puVar5 + local_38 * 2 + 2) ==
        *(short *)((longlong)puVar3 + local_38 * 2)) {
      uVar6 = local_38 + 2;
    }
    else {
      puVar3 = param_1;
      puVar5 = param_1;
      if (7 < uVar1) {
        puVar3 = (undefined8 *)*param_1;
        puVar5 = (undefined8 *)*param_1;
      }
      puVar4 = param_1;
      if (7 < uVar1) {
        puVar4 = (undefined8 *)*param_1;
      }
      pwVar7 = (wchar_t *)((longlong)puVar4 + (local_38 + 1U) * 2);
      while ((pwVar7 != (wchar_t *)((longlong)puVar3 + uVar6 * 2) &&
             (bVar2 = std::ctype<wchar_t>::is(param_3,4,*pwVar7), bVar2))) {
        pwVar7 = pwVar7 + 1;
      }
      uVar6 = (longlong)pwVar7 - (longlong)puVar5 >> 1;
      if (uVar6 < (ulonglong)param_1[2]) {
        puVar5 = param_1;
        if (7 < (ulonglong)param_1[3]) {
          puVar5 = (undefined8 *)*param_1;
        }
        if (*(short *)((longlong)puVar5 + uVar6 * 2) == (short)param_2) {
          uVar6 = uVar6 + 1;
        }
      }
      iVar8 = iVar8 + 1;
    }
    local_38 = FUN_14030fb40(param_1,param_2 & 0xffff,uVar6);
  }
  if ((param_4 & 1) != 0) {
    std::exception::exception((exception *)local_50);
    local_50[0] = boost::io::bad_format_string::vftable;
    local_30 = uVar6;
    FUN_14030dc30(local_50);
  }
  return iVar8 + 1;
}



void FUN_140310940(longlong *param_1,undefined8 *param_2,longlong param_3,longlong param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 *puVar5;
  longlong *plVar6;
  
  puVar5 = param_2;
  if (7 < (ulonglong)param_2[3]) {
    puVar5 = (undefined8 *)*param_2;
  }
  lVar1 = (longlong)puVar5 + param_4 * 2;
  if (7 < (ulonglong)param_2[3]) {
    param_2 = (undefined8 *)*param_2;
  }
  lVar2 = (longlong)param_2 + param_3 * 2;
  plVar6 = param_1;
  if (7 < (ulonglong)param_1[3]) {
    plVar6 = (longlong *)*param_1;
  }
  lVar4 = param_1[2];
  lVar3 = (longlong)plVar6 + lVar4 * 2;
  if ((ulonglong)param_1[3] < 8) {
    FUN_140312310(param_1,(longlong)param_1 + lVar4 * 2,lVar3,lVar2,lVar1);
    return;
  }
  FUN_140312310(param_1,*param_1 + lVar4 * 2,lVar3,lVar2,lVar1);
  return;
}



undefined8
FUN_1403109c0(ulonglong *param_1,ulonglong *param_2,int *param_3,ctype<wchar_t> *param_4,
             wchar_t *param_5,byte param_6)

{
  bool bVar1;
  int iVar2;
  bool bVar3;
  char cVar4;
  wchar_t wVar5;
  ulonglong *puVar6;
  ulonglong uVar7;
  wchar_t *pwVar8;
  longlong lVar9;
  int iVar11;
  ctype<wchar_t> *this;
  wchar_t *pwVar12;
  longlong lVar13;
  undefined1 local_res10 [8];
  undefined **local_60 [3];
  wchar_t *local_48;
  longlong local_40;
  wchar_t *pwVar10;
  
  *param_3 = -1;
  bVar1 = false;
  pwVar12 = (wchar_t *)*param_1;
  lVar13 = ((longlong)*param_2 - (longlong)pwVar12 >> 1) + (longlong)param_5;
  this = param_4;
  if ((wchar_t *)*param_2 <= pwVar12) {
    if ((param_6 & 1) == 0) {
      return 0;
    }
    std::exception::exception((exception *)local_60);
    local_60[0] = boost::io::bad_format_string::vftable;
    local_48 = param_5;
    local_40 = lVar13;
    FUN_14030dc30(local_60);
    pwVar12 = param_5;
  }
  wVar5 = std::ctype<wchar_t>::widen(this,'|');
  if (*pwVar12 == wVar5) {
    bVar1 = true;
    *param_1 = *param_1 + 2;
    if (*param_2 <= *param_1) {
      FUN_140308d30(param_6,((longlong)(*param_1 - (longlong)pwVar12) >> 1) + (longlong)param_5,
                    lVar13);
      return 0;
    }
  }
  pwVar10 = (wchar_t *)*param_1;
  wVar5 = std::ctype<wchar_t>::widen(param_4,'0');
  if ((*pwVar10 == wVar5) ||
     (bVar3 = std::ctype<wchar_t>::is(param_4,4,*(wchar_t *)*param_1), !bVar3)) {
LAB_140310bcd:
    if (*param_1 != *param_2) {
      do {
        cVar4 = std::ctype<wchar_t>::narrow(param_4,*(wchar_t *)*param_1,'\0');
        switch(cVar4) {
        case ' ':
          param_3[0x24] = param_3[0x24] | 2;
          break;
        default:
          goto switchD_140310c1b_caseD_21;
        case '#':
          param_3[0x1b] = param_3[0x1b] | 0x18;
          break;
        case '\'':
        case 'h':
        case 'l':
          break;
        case '+':
          param_3[0x1b] = param_3[0x1b] | 0x20;
          break;
        case '-':
          param_3[0x1b] = param_3[0x1b] | 0x40;
          break;
        case '0':
          param_3[0x24] = param_3[0x24] | 1;
          break;
        case '=':
          param_3[0x24] = param_3[0x24] | 4;
          break;
        case '_':
          param_3[0x1b] = param_3[0x1b] | 0x100;
        }
        *param_1 = *param_1 + 2;
      } while (*param_1 != *param_2);
    }
    uVar7 = *param_1;
    if (uVar7 < *param_2) {
switchD_140310c1b_caseD_21:
      pwVar10 = (wchar_t *)*param_1;
      wVar5 = std::ctype<wchar_t>::widen(param_4,'*');
      if (*pwVar10 == wVar5) {
        pwVar10 = (wchar_t *)*param_2;
        pwVar8 = (wchar_t *)(*param_1 + 2);
        if (pwVar8 != pwVar10) {
          do {
            bVar3 = std::ctype<wchar_t>::is(param_4,4,*pwVar8);
            if (!bVar3) break;
            pwVar8 = pwVar8 + 1;
          } while (pwVar8 != pwVar10);
          if ((pwVar8 != pwVar10) &&
             (wVar5 = std::ctype<wchar_t>::widen(param_4,'$'), *pwVar8 == wVar5)) {
            pwVar8 = pwVar8 + 1;
          }
        }
        *param_1 = (ulonglong)pwVar8;
      }
      if (((wchar_t *)*param_1 != (wchar_t *)*param_2) &&
         (bVar3 = std::ctype<wchar_t>::is(param_4,4,*(wchar_t *)*param_1), bVar3)) {
        puVar6 = (ulonglong *)FUN_140312560(local_res10,param_1,param_2,param_3 + 0x16,param_4);
        *param_1 = *puVar6;
      }
      goto LAB_140310d1c;
    }
    goto LAB_14031107c;
  }
  iVar11 = 0;
  pwVar10 = (wchar_t *)*param_1;
  iVar2 = 0;
  if (pwVar10 != (wchar_t *)*param_2) {
    do {
      iVar11 = iVar2;
      bVar3 = std::ctype<wchar_t>::is(param_4,4,*pwVar10);
      if (!bVar3) break;
      cVar4 = std::ctype<wchar_t>::narrow(param_4,*pwVar10,'\0');
      iVar11 = cVar4 + -0x30 + iVar11 * 10;
      pwVar10 = pwVar10 + 1;
      iVar2 = iVar11;
    } while (pwVar10 != (wchar_t *)*param_2);
  }
  *param_1 = (ulonglong)pwVar10;
  if ((wchar_t *)*param_2 <= pwVar10) {
    FUN_140308d30(param_6,(longlong)param_5 + ((longlong)pwVar10 - (longlong)pwVar12 >> 1),lVar13);
    return 0;
  }
  wVar5 = std::ctype<wchar_t>::widen(param_4,'%');
  if (*pwVar10 == wVar5) {
    *param_3 = iVar11 + -1;
    *param_1 = *param_1 + 2;
    if (!bVar1) {
      return 1;
    }
    FUN_140308d30(param_6,((longlong)(*param_1 - (longlong)pwVar12) >> 1) + (longlong)param_5);
  }
  pwVar10 = (wchar_t *)*param_1;
  wVar5 = std::ctype<wchar_t>::widen(param_4,'$');
  if (*pwVar10 == wVar5) {
    *param_3 = iVar11 + -1;
    *param_1 = *param_1 + 2;
    goto LAB_140310bcd;
  }
  *(longlong *)(param_3 + 0x16) = (longlong)iVar11;
  *param_3 = -1;
LAB_140310d1c:
  pwVar10 = (wchar_t *)*param_1;
  if ((wchar_t *)*param_2 <= pwVar10) {
LAB_140310d25:
    lVar9 = (longlong)pwVar10 - (longlong)pwVar12;
    goto LAB_140311085;
  }
  wVar5 = std::ctype<wchar_t>::widen(param_4,'.');
  if (*pwVar10 == wVar5) {
    *param_1 = *param_1 + 2;
    pwVar10 = (wchar_t *)*param_1;
    if ((pwVar10 != (wchar_t *)*param_2) &&
       (wVar5 = std::ctype<wchar_t>::widen(param_4,'*'), *pwVar10 == wVar5)) {
      pwVar10 = (wchar_t *)*param_2;
      pwVar8 = (wchar_t *)(*param_1 + 2);
      if (pwVar8 != pwVar10) {
        do {
          bVar3 = std::ctype<wchar_t>::is(param_4,4,*pwVar8);
          if (!bVar3) break;
          pwVar8 = pwVar8 + 1;
        } while (pwVar8 != pwVar10);
        if ((pwVar8 != pwVar10) &&
           (wVar5 = std::ctype<wchar_t>::widen(param_4,'$'), *pwVar8 == wVar5)) {
          pwVar8 = pwVar8 + 1;
        }
      }
      *param_1 = (ulonglong)pwVar8;
    }
    if (((wchar_t *)*param_1 == (wchar_t *)*param_2) ||
       (bVar3 = std::ctype<wchar_t>::is(param_4,4,*(wchar_t *)*param_1), !bVar3)) {
      param_3[0x18] = 0;
      param_3[0x19] = 0;
      goto LAB_140310e0d;
    }
    puVar6 = (ulonglong *)FUN_140312560(local_res10,param_1,param_2,param_3 + 0x18,param_4);
    *param_1 = *puVar6;
    bVar3 = true;
  }
  else {
LAB_140310e0d:
    bVar3 = false;
  }
  if (*param_1 != *param_2) {
    do {
      pwVar10 = (wchar_t *)*param_1;
      wVar5 = std::ctype<wchar_t>::widen(param_4,'l');
      if (((*pwVar10 != wVar5) &&
          (pwVar10 = (wchar_t *)*param_1, wVar5 = std::ctype<wchar_t>::widen(param_4,'L'),
          *pwVar10 != wVar5)) &&
         (pwVar10 = (wchar_t *)*param_1, wVar5 = std::ctype<wchar_t>::widen(param_4,'h'),
         *pwVar10 != wVar5)) break;
      *param_1 = *param_1 + 2;
    } while (*param_1 != *param_2);
  }
  pwVar10 = (wchar_t *)*param_1;
  if ((wchar_t *)*param_2 <= pwVar10) goto LAB_140310d25;
  if ((bVar1) && (wVar5 = std::ctype<wchar_t>::widen(param_4,'|'), *pwVar10 == wVar5))
  goto LAB_140310e8d;
  cVar4 = std::ctype<wchar_t>::narrow(param_4,*(wchar_t *)*param_1,'\0');
  switch(cVar4) {
  case 'C':
  case 'c':
    param_3[0x22] = 1;
    param_3[0x23] = 0;
    break;
  default:
    FUN_140308d30(param_6,((longlong)(*param_1 - (longlong)pwVar12) >> 1) + (longlong)param_5,lVar13
                 );
    break;
  case 'E':
    param_3[0x1b] = param_3[0x1b] | 4;
  case 'e':
    param_3[0x1b] = param_3[0x1b] & 0xffffd3ff;
    param_3[0x1b] = param_3[0x1b] | 0x1200;
    break;
  case 'G':
    param_3[0x1b] = param_3[0x1b] | 4;
    break;
  case 'S':
  case 's':
    if (bVar3) {
      *(undefined8 *)(param_3 + 0x22) = *(undefined8 *)(param_3 + 0x18);
    }
    param_3[0x18] = 6;
    param_3[0x19] = 0;
    break;
  case 'T':
    *param_1 = *param_1 + 2;
    pwVar10 = (wchar_t *)*param_1;
    if (pwVar10 < (wchar_t *)*param_2) {
      wVar5 = *pwVar10;
      goto LAB_140310faa;
    }
    FUN_140308d30(param_6,((longlong)pwVar10 - (longlong)pwVar12 >> 1) + (longlong)param_5,lVar13);
    goto LAB_140310fae;
  case 'X':
    param_3[0x1b] = param_3[0x1b] | 4;
  case 'p':
  case 'x':
    param_3[0x1b] = param_3[0x1b] & 0xfffff9ff;
    param_3[0x1b] = param_3[0x1b] | 0x800;
    break;
  case 'f':
    param_3[0x1b] = param_3[0x1b] & 0xffffefff;
    param_3[0x1b] = param_3[0x1b] | 0x2000;
  case 'd':
  case 'i':
  case 'u':
    param_3[0x1b] = param_3[0x1b] & 0xfffff3ff;
    param_3[0x1b] = param_3[0x1b] | 0x200;
    break;
  case 'g':
    param_3[0x1b] = param_3[0x1b] & 0xffffc3ffU | 0x200;
    break;
  case 'n':
    *param_3 = -3;
    break;
  case 'o':
    param_3[0x1b] = param_3[0x1b] & 0xfffff5ff;
    param_3[0x1b] = param_3[0x1b] | 0x400;
    break;
  case 't':
    wVar5 = std::ctype<wchar_t>::widen(param_4,' ');
LAB_140310faa:
    *(wchar_t *)(param_3 + 0x1a) = wVar5;
LAB_140310fae:
    param_3[0x24] = param_3[0x24] | 8;
    *param_3 = -2;
  }
  *param_1 = *param_1 + 2;
  pwVar10 = (wchar_t *)*param_1;
  if (bVar1) {
    if ((pwVar10 == (wchar_t *)*param_2) ||
       (wVar5 = std::ctype<wchar_t>::widen(param_4,'|'), *pwVar10 != wVar5)) {
      uVar7 = *param_1;
LAB_14031107c:
      lVar9 = uVar7 - (longlong)pwVar12;
LAB_140311085:
      FUN_140308d30(param_6,(lVar9 >> 1) + (longlong)param_5,lVar13);
    }
    else {
LAB_140310e8d:
      *param_1 = *param_1 + 2;
    }
  }
  return 1;
}



void FUN_140311190(longlong *param_1,undefined8 param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong *plVar3;
  uint uVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  undefined **local_e8 [3];
  longlong local_d0;
  longlong local_c8;
  undefined8 local_c0;
  undefined1 local_b8 [88];
  undefined1 local_60 [88];
  
  local_c0 = 0xfffffffffffffffe;
  iVar1 = *(int *)((longlong)param_1 + 0x4c);
  lVar6 = param_1[10];
  if (iVar1 < (int)lVar6) {
    uVar4 = 0;
    lVar6 = *param_1;
    lVar5 = param_1[1] - lVar6 >> 0x3f;
    if ((param_1[1] - lVar6) / 0x98 + lVar5 != lVar5) {
      uVar7 = 0;
      lVar5 = 0;
      do {
        if (*(int *)(lVar5 + lVar6) == *(int *)((longlong)param_1 + 0x4c)) {
          if ((char)param_1[0x22] == '\0') {
            plVar3 = (longlong *)0x0;
          }
          else {
            plVar3 = param_1 + 0x23;
          }
          lVar6 = uVar7 * 0x98 + lVar6;
          FUN_1403126c0(param_2,lVar6,lVar6 + 8,param_1 + 0x11,plVar3);
        }
        uVar4 = uVar4 + 1;
        lVar5 = lVar5 + 0x98;
        lVar6 = *param_1;
        uVar7 = (ulonglong)uVar4;
      } while (uVar7 < (ulonglong)((param_1[1] - lVar6) / 0x98));
    }
  }
  else if ((*(byte *)(param_1 + 0x10) & 4) != 0) {
    std::exception::exception((exception *)local_e8);
    local_e8[0] = boost::io::too_many_args::vftable;
    local_d0 = (longlong)iVar1;
    local_c8 = (longlong)(int)lVar6;
    uVar2 = FUN_1403136f0(local_60,local_e8);
    FUN_140313770(local_b8,uVar2);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_b8,(ThrowInfo *)&DAT_1405d3c10);
  }
  return;
}



undefined4 *
FUN_1403112f0(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_1403113a7;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_1403113a7:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 6);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 2) = 0;
  *(undefined8 *)(puVar2 + 4) = 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_1402cddb0(param_1);
    FUN_1401dfb50(param_1,uVar4);
  }
  return puVar2;
}



undefined8 * FUN_140311440(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;
}



void FUN_1403114b0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x418);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x420) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x418) = *(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_140311660(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) < 0x428)
      goto LAB_14031172d;
      lVar7 = uVar6 * 0x428;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14031172d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x85 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x83] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x85;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x106);
  *puVar2 = param_2;
  FUN_1403141c0(puVar2 + 2);
  puVar2[0x108] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x106) = *(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_1402cddb0(param_1);
    FUN_1403114b0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_1403117e0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1401dfef0(param_2 + 8);
  *(undefined8 *)(param_2 + 0x418) = *(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_1402cddb0(param_1);
    FUN_1403114b0(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_140311880(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (*(void **)((longlong)param_1 + 0x10) != (void *)0x0) {
      operator_delete(*(void **)((longlong)param_1 + 0x10));
    }
    *(undefined8 *)((longlong)param_1 + 0x10) = 0;
    *(undefined8 *)((longlong)param_1 + 0x18) = 0;
    *(undefined8 *)((longlong)param_1 + 0x20) = 0;
    operator_delete(param_1);
  }
  return;
}



void FUN_1403118c0(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)param_1 + 0x50)) {
      operator_delete(*(void **)((longlong)param_1 + 0x38));
    }
    *(undefined8 *)((longlong)param_1 + 0x50) = 7;
    *(undefined8 *)((longlong)param_1 + 0x48) = 0;
    *(undefined2 *)((longlong)param_1 + 0x38) = 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;
    operator_delete(param_1);
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140311930(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_14030f940(DAT_140608578,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608580) {
    if (DAT_140608570 == (void *)0x0) {
      FUN_14030f880(param_1);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608580;
      if (DAT_140608580 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608570);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x48);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x50) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x48) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608580;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608570);
      fVar10 = (float)param_1 * _DAT_14060858c;
      _DAT_140608590 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        _DAT_140608590 = -0x8000000000000000;
      }
      _DAT_140608590 = (longlong)fVar10 + _DAT_140608590;
      fVar10 = (float)param_1 * _DAT_140608588;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608570 = _Dst;
      DAT_140608580 = param_1;
      DAT_140608598 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608598 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_140311b10(undefined8 *param_1)

{
  FUN_140311b50();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[5] = boost::exception_detail::clone_impl<>::vftable;
  param_1[10] = boost::exception_detail::clone_impl<>::vftable;
  return param_1;
}



exception * FUN_140311b50(exception *param_1,exception *param_2)

{
  longlong *plVar1;
  
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::too_few_args::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  plVar1 = *(longlong **)(param_2 + 0x30);
  *(longlong **)(param_1 + 0x30) = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))();
  }
  *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(param_2 + 0x38);
  *(undefined8 *)(param_1 + 0x40) = *(undefined8 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x48) = *(undefined4 *)(param_2 + 0x48);
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



exception * FUN_140311bf0(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::too_few_args::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  return param_1;
}



undefined8 * FUN_140311c30(undefined8 *param_1)

{
  FUN_140311c70();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[5] = boost::exception_detail::clone_impl<>::vftable;
  param_1[10] = boost::exception_detail::clone_impl<>::vftable;
  return param_1;
}



bad_cast * FUN_140311c70(bad_cast *param_1,bad_cast *param_2)

{
  longlong *plVar1;
  
  std::bad_cast::bad_cast(param_1,param_2);
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  plVar1 = *(longlong **)(param_2 + 0x30);
  *(longlong **)(param_1 + 0x30) = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))();
  }
  *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(param_2 + 0x38);
  *(undefined8 *)(param_1 + 0x40) = *(undefined8 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x48) = *(undefined4 *)(param_2 + 0x48);
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



bad_cast * FUN_140311d10(bad_cast *param_1,bad_cast *param_2)

{
  std::bad_cast::bad_cast(param_1,param_2);
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  return param_1;
}



exception * FUN_140311d50(exception *param_1,uint param_2)

{
  *(undefined ***)(param_1 + 0x50) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



exception * FUN_140311dc0(exception *param_1,uint param_2)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



bad_cast * FUN_140311e20(bad_cast *param_1,uint param_2)

{
  *(undefined ***)(param_1 + 0x50) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
  std::bad_cast::~bad_cast(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



bad_cast * FUN_140311e90(bad_cast *param_1,uint param_2)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
  std::bad_cast::~bad_cast(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140311f00(exception *param_1)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
                    // WARNING: Could not recover jumptable at 0x000140311f35. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



void FUN_140311f40(exception *param_1)

{
  *(undefined ***)(param_1 + 0x50) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
                    // WARNING: Could not recover jumptable at 0x000140311f80. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



undefined8 *
FUN_140311f90(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x58);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_140311b50(puVar1,param_1 + -0x50,param_3,param_4,uVar2);
    *puVar1 = boost::exception_detail::clone_impl<>::vftable;
    puVar1[5] = boost::exception_detail::clone_impl<>::vftable;
    puVar1[10] = boost::exception_detail::clone_impl<>::vftable;
  }
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    puVar1 = puVar1 + 10;
  }
  return puVar1;
}



void FUN_140312010(longlong param_1)

{
  undefined **local_60 [3];
  undefined8 local_48;
  undefined8 local_40;
  undefined **local_38;
  longlong *local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined4 local_18;
  undefined **local_10;
  
  std::exception::exception((exception *)local_60,(exception *)(param_1 + -0x50));
  local_60[0] = boost::io::too_few_args::vftable;
  local_48 = *(undefined8 *)(param_1 + -0x38);
  local_40 = *(undefined8 *)(param_1 + -0x30);
  local_38 = boost::exception::vftable;
  local_30 = *(longlong **)(param_1 + -0x20);
  if (local_30 != (longlong *)0x0) {
    (**(code **)(*local_30 + 0x18))();
  }
  local_28 = *(undefined8 *)(param_1 + -0x18);
  local_20 = *(undefined8 *)(param_1 + -0x10);
  local_18 = *(undefined4 *)(param_1 + -8);
  local_60[0] = boost::exception_detail::clone_impl<>::vftable;
  local_38 = boost::exception_detail::clone_impl<>::vftable;
  local_10 = boost::exception_detail::clone_impl<>::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_60,(ThrowInfo *)&DAT_1405d3a60);
}



void FUN_1403120d0(bad_cast *param_1)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
                    // WARNING: Could not recover jumptable at 0x00014031210f. Too many branches
                    // WARNING: Treating indirect jump as call
  std::bad_cast::~bad_cast(param_1);
  return;
}



void FUN_140312120(bad_cast *param_1)

{
  *(undefined ***)(param_1 + 0x50) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
                    // WARNING: Could not recover jumptable at 0x00014031216a. Too many branches
                    // WARNING: Treating indirect jump as call
  std::bad_cast::~bad_cast(param_1);
  return;
}



undefined8 *
FUN_140312180(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x58);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_140311c70(puVar1,param_1 + -0x50,param_3,param_4,uVar2);
    *puVar1 = boost::exception_detail::clone_impl<>::vftable;
    puVar1[5] = boost::exception_detail::clone_impl<>::vftable;
    puVar1[10] = boost::exception_detail::clone_impl<>::vftable;
  }
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    puVar1 = puVar1 + 10;
  }
  return puVar1;
}



void FUN_140312200(longlong param_1)

{
  undefined **local_60 [3];
  undefined8 local_48;
  undefined8 local_40;
  undefined **local_38;
  longlong *local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined4 local_18;
  undefined **local_10;
  
  std::bad_cast::bad_cast((bad_cast *)local_60,(bad_cast *)(param_1 + -0x50));
  local_60[0] = boost::bad_lexical_cast::vftable;
  local_48 = *(undefined8 *)(param_1 + -0x38);
  local_40 = *(undefined8 *)(param_1 + -0x30);
  local_38 = boost::exception::vftable;
  local_30 = *(longlong **)(param_1 + -0x20);
  if (local_30 != (longlong *)0x0) {
    (**(code **)(*local_30 + 0x18))();
  }
  local_28 = *(undefined8 *)(param_1 + -0x18);
  local_20 = *(undefined8 *)(param_1 + -0x10);
  local_18 = *(undefined4 *)(param_1 + -8);
  local_60[0] = boost::exception_detail::clone_impl<>::vftable;
  local_38 = boost::exception_detail::clone_impl<>::vftable;
  local_10 = boost::exception_detail::clone_impl<>::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_60,(ThrowInfo *)&DAT_1405d3b38);
}



void FUN_1403122c0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14030e570((longlong)pvVar1 + 0x30);
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x20)) {
      operator_delete(*(void **)((longlong)pvVar1 + 8));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x20) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x18) = 0;
    *(undefined2 *)((longlong)pvVar1 + 8) = 0;
    operator_delete(pvVar1);
  }
  return;
}



undefined8 *
FUN_140312310(undefined8 *param_1,longlong param_2,longlong param_3,longlong param_4,
             longlong param_5)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong lVar3;
  
  if (param_4 != param_5) {
    puVar1 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar1 = (undefined8 *)*param_1;
    }
    lVar2 = 0;
    lVar3 = lVar2;
    if (param_3 != 0) {
      lVar3 = param_3 - param_2 >> 1;
    }
    if (param_2 != 0) {
      lVar2 = param_2 - (longlong)puVar1 >> 1;
    }
    FUN_14012e650(param_1,lVar2,lVar3,param_4,param_5 - param_4 >> 1);
    return param_1;
  }
  puVar1 = param_1;
  if (7 < (ulonglong)param_1[3]) {
    puVar1 = (undefined8 *)*param_1;
  }
  lVar2 = 0;
  lVar3 = lVar2;
  if (param_3 != 0) {
    lVar3 = param_3 - param_2 >> 1;
  }
  if (param_2 != 0) {
    lVar2 = param_2 - (longlong)puVar1 >> 1;
  }
  FUN_140001870(param_1,lVar2,lVar3);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403123c0(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong lVar2;
  facet *pfVar3;
  longlong lVar4;
  undefined1 auStack_108 [32];
  undefined8 local_e8;
  undefined1 local_d8 [8];
  void *local_d0;
  ulonglong local_b8;
  undefined2 local_a8;
  undefined6 uStack_a6;
  undefined8 local_98;
  ulonglong local_90;
  char local_60;
  facet *local_58;
  ulonglong local_38;
  
  local_e8 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  FUN_1403101a0(local_d8,param_3);
  lVar1 = param_1[1];
  if (*param_1 != lVar1) {
    lVar2 = FUN_140312cc0(lVar1,lVar1);
    lVar1 = param_1[1];
    for (lVar4 = lVar2; lVar4 != lVar1; lVar4 = lVar4 + 0x98) {
      FUN_14030faa0(lVar4);
    }
    param_1[1] = lVar2;
  }
  FUN_14030fe40(param_1,*param_1,param_2,local_d8);
  if (local_60 != '\0') {
    if ((local_58 != (facet *)0x0) &&
       (pfVar3 = std::locale::facet::_Decref(local_58), pfVar3 != (facet *)0x0)) {
      (*(code *)**(undefined8 **)pfVar3)(pfVar3,1);
    }
    local_60 = '\0';
  }
  if (7 < local_90) {
    operator_delete((void *)CONCAT62(uStack_a6,local_a8));
  }
  local_90 = 7;
  local_98 = 0;
  local_a8 = 0;
  if (7 < local_b8) {
    operator_delete(local_d0);
  }
  return;
}



void FUN_1403124e0(undefined4 *param_1,undefined2 param_2)

{
  *param_1 = 0xffffffff;
  *(undefined8 *)(param_1 + 0x22) = 0x7fffffffffffffff;
  param_1[0x24] = 0;
  FUN_140001870(param_1 + 2,0,0xffffffffffffffff);
  FUN_140001870(param_1 + 0xc,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x16) = 0;
  *(undefined2 *)(param_1 + 0x1a) = param_2;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  *(undefined8 *)(param_1 + 0x18) = 6;
  param_1[0x1b] = 0x201;
  return;
}



longlong *
FUN_140312560(longlong *param_1,longlong *param_2,longlong *param_3,longlong *param_4,
             ctype<wchar_t> *param_5)

{
  longlong lVar1;
  bool bVar2;
  char cVar3;
  
  *param_4 = 0;
  lVar1 = *param_2;
  *param_1 = lVar1;
  if (lVar1 == *param_3) {
    return param_1;
  }
  do {
    bVar2 = std::ctype<wchar_t>::is(param_5,4,*(wchar_t *)*param_1);
    if (!bVar2) {
      return param_1;
    }
    cVar3 = std::ctype<wchar_t>::narrow(param_5,*(wchar_t *)*param_1,'\0');
    *param_1 = *param_1 + 2;
    *param_4 = (longlong)(cVar3 + -0x30) + *param_4 * 10;
  } while (*param_1 != *param_3);
  return param_1;
}



exception * FUN_140312620(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::too_few_args::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0xffffffff;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



undefined8 FUN_1403126a0(undefined8 param_1)

{
  FUN_140313230();
  return param_1;
}



void FUN_1403126c0(int *param_1,longlong param_2,undefined8 *param_3,longlong param_4,
                  undefined8 param_5)

{
  longlong *plVar1;
  int *piVar2;
  uint uVar3;
  wchar_t *pwVar4;
  ulonglong uVar5;
  bool bVar6;
  short sVar7;
  wchar_t wVar8;
  ulonglong *puVar9;
  undefined8 *puVar10;
  short *psVar11;
  ulonglong uVar12;
  byte bVar13;
  ulonglong uVar14;
  ulonglong local_res10;
  ulonglong local_res18;
  ulonglong local_168;
  ulonglong local_160;
  ulonglong local_158;
  ulonglong local_150;
  undefined1 local_148 [8];
  longlong *local_140;
  longlong local_138;
  basic_ios<> local_130 [16];
  uint auStack_120 [4];
  ulonglong auStack_110 [6];
  undefined2 auStack_e0 [12];
  undefined8 local_c8;
  undefined1 local_b8 [8];
  longlong *local_b0;
  longlong local_a8;
  basic_ios<> local_a0 [32];
  undefined8 auStack_80 [6];
  undefined2 auStack_50 [12];
  
  local_c8 = 0xfffffffffffffffe;
  FUN_140313540(local_148,param_4);
  FUN_140313630(param_2 + 0x58,local_130 + (longlong)*(int *)(local_138 + 4) + -8,param_5);
  uVar3 = *(uint *)((longlong)auStack_120 + (longlong)*(int *)(local_138 + 4));
  local_res18 = CONCAT44(local_res18._4_4_,uVar3);
  uVar12 = *(ulonglong *)((longlong)auStack_110 + (longlong)*(int *)(local_138 + 4));
  if (((uVar3 >> 8 & 1) == 0) || (uVar12 == 0)) {
    bVar6 = false;
  }
  else {
    bVar6 = true;
  }
  local_res10 = uVar12;
  FUN_140001870(param_3,0,0xffffffffffffffff);
  if (bVar6) {
    std::basic_ostream<>::operator<<((basic_ostream<> *)&local_138,*param_1);
    pwVar4 = (wchar_t *)**(undefined8 **)(param_4 + 0x28);
    uVar12 = **(longlong **)(param_4 + 0x48) - (longlong)pwVar4 >> 1;
    bVar13 = 0;
    if (((*(byte *)(param_2 + 0x90) & 2) != 0) &&
       (((**(longlong **)(param_4 + 0x48) - **(longlong **)(param_4 + 0x28) & 0xfffffffffffffffeU)
         == 0 || ((wVar8 = std::basic_ios<>::widen
                                     (local_130 + (longlong)*(int *)(local_138 + 4) + -8,'+'),
                  *pwVar4 != wVar8 &&
                  (wVar8 = std::basic_ios<>::widen
                                     (local_130 + (longlong)*(int *)(local_138 + 4) + -8,'-'),
                  *pwVar4 != wVar8)))))) {
      bVar13 = 1;
    }
    if (((uVar12 == local_res10) && ((longlong)local_res10 <= *(longlong *)(param_2 + 0x88))) &&
       (bVar13 == 0)) {
      FUN_140001710(param_3,pwVar4,uVar12);
    }
    else {
      FUN_140001710(param_3,pwVar4,uVar12);
      FUN_140313790(param_4);
      FUN_140313540(local_b8,param_4);
      FUN_140313630(param_2 + 0x58,(basic_ostream<> *)&local_a8 + *(int *)(local_a8 + 4),param_5);
      *(undefined8 *)((longlong)auStack_80 + (longlong)*(int *)(local_a8 + 4)) = 0;
      if (bVar13 != 0) {
        FUN_140313a00((basic_ostream<> *)&local_a8);
      }
      std::basic_ostream<>::operator<<((basic_ostream<> *)&local_a8,*param_1);
      if (((**(longlong **)(param_4 + 0x48) - **(longlong **)(param_4 + 0x28) & 0xfffffffffffffffeU)
           == 0) && ((*(byte *)(param_2 + 0x90) & 2) != 0)) {
        bVar13 = 1;
        FUN_140313a00((basic_ostream<> *)&local_a8);
      }
      local_168 = **(ulonglong **)(param_4 + 0x28);
      local_res18 = (longlong)(**(longlong **)(param_4 + 0x48) - local_168) >> 1;
      local_158 = *(ulonglong *)(param_2 + 0x88);
      puVar9 = &local_res18;
      if (*(ulonglong *)(param_2 + 0x88) <= local_res18) {
        puVar9 = &local_158;
      }
      uVar5 = *puVar9;
      local_150 = uVar5;
      if (uVar5 < local_res10) {
        local_160 = (bVar13 != 0) + uVar12;
        puVar9 = &local_150;
        if (local_160 <= uVar5) {
          puVar9 = &local_160;
        }
        uVar14 = (ulonglong)bVar13;
        uVar12 = uVar14;
        if (uVar14 < *puVar9) {
          psVar11 = (short *)(local_168 + uVar14 * 2);
          do {
            puVar10 = param_3;
            if (7 < (ulonglong)param_3[3]) {
              puVar10 = (undefined8 *)*param_3;
            }
            if (*psVar11 !=
                *(short *)((longlong)puVar10 + ((ulonglong)(bVar13 != 0) * -2 - local_168) +
                          (longlong)psVar11)) break;
            uVar12 = uVar12 + 1;
            psVar11 = psVar11 + 1;
          } while (uVar12 < *puVar9);
        }
        if (uVar5 <= uVar12) {
          uVar12 = uVar14;
        }
        FUN_140001710(param_3,local_168,uVar12);
        FUN_140123f40(param_3,local_res10 - uVar5,
                      *(undefined2 *)((longlong)auStack_50 + (longlong)*(int *)(local_a8 + 4)));
        FUN_140002aa0(param_3,local_168 + uVar12 * 2,uVar5 - uVar12);
      }
      else {
        FUN_140001710(param_3,local_168,uVar5);
      }
      *(code **)((basic_ostream<> *)&local_a8 + *(int *)(local_a8 + 4)) = _vftable__exref;
      if (local_b0 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_b0 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_b0 + 8))(local_b0);
          LOCK();
          piVar2 = (int *)((longlong)local_b0 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_b0 + 0x10))(local_b0);
          }
        }
      }
      std::basic_ios<>::~basic_ios<>(local_a0);
    }
  }
  else {
    if (0 < (longlong)uVar12) {
      *(undefined8 *)((longlong)auStack_110 + (longlong)*(int *)(local_138 + 4)) = 0;
    }
    std::basic_ostream<>::operator<<((basic_ostream<> *)&local_138,*param_1);
    pwVar4 = (wchar_t *)**(undefined8 **)(param_4 + 0x28);
    local_res10 = local_res10 & 0xffffffffffff0000;
    if (((*(byte *)(param_2 + 0x90) & 2) != 0) &&
       (((**(longlong **)(param_4 + 0x48) - (longlong)pwVar4 & 0xfffffffffffffffeU) == 0 ||
        ((wVar8 = std::basic_ios<>::widen(local_130 + (longlong)*(int *)(local_138 + 4) + -8,'+'),
         *pwVar4 != wVar8 &&
         (wVar8 = std::basic_ios<>::widen(local_130 + (longlong)*(int *)(local_138 + 4) + -8,'-'),
         *pwVar4 != wVar8)))))) {
      wVar8 = std::basic_ios<>::widen(local_130 + (longlong)*(int *)(local_138 + 4) + -8,' ');
      local_res10 = (ulonglong)(ushort)wVar8;
    }
    local_168 = **(longlong **)(param_4 + 0x48) - **(longlong **)(param_4 + 0x28) >> 1;
    sVar7 = (short)local_res10;
    local_res10 = *(longlong *)(param_2 + 0x88) - (ulonglong)((short)local_res10 != 0);
    puVar9 = &local_168;
    if (local_res10 <= local_168) {
      puVar9 = &local_res10;
    }
    FUN_140313850(param_3,pwVar4,*puVar9,uVar12,
                  *(undefined2 *)((longlong)auStack_e0 + (longlong)*(int *)(local_138 + 4)),
                  (undefined4)local_res18,sVar7,(byte)(*(uint *)(param_2 + 0x90) >> 2) & 1);
  }
  FUN_140313790(param_4);
  *(code **)(local_130 + (longlong)*(int *)(local_138 + 4) + -8) = _vftable__exref;
  if (local_140 != (longlong *)0x0) {
    LOCK();
    plVar1 = local_140 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*local_140 + 8))(local_140);
      LOCK();
      piVar2 = (int *)((longlong)local_140 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_140 + 0x10))(local_140);
      }
    }
  }
  std::basic_ios<>::~basic_ios<>(local_130);
  return;
}



bad_cast * FUN_140312bd0(bad_cast *param_1,bad_cast *param_2)

{
  std::bad_cast::bad_cast(param_1,param_2);
  *(undefined ***)param_1 = boost::bad_lexical_cast::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0xffffffff;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



undefined8 FUN_140312c50(undefined8 param_1)

{
  FUN_1403132d0();
  return param_1;
}



void FUN_140312c70(void *param_1)

{
  if (param_1 != (void *)0x0) {
    FUN_14030e570((longlong)param_1 + 0x30);
    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;
    operator_delete(param_1);
  }
  return;
}



undefined4 * FUN_140312cc0(undefined2 *param_1,undefined2 *param_2,undefined4 *param_3)

{
  undefined2 *puVar1;
  undefined4 *puVar2;
  undefined2 *puVar3;
  
  if (param_1 != param_2) {
    puVar2 = param_3 + 0x1a;
    puVar3 = param_1 + 0x34;
    do {
      *param_3 = *(undefined4 *)(puVar3 + -0x34);
      FUN_1400015e0(puVar2 + -0x18,puVar3 + -0x30,0,0xffffffffffffffff);
      FUN_1400015e0(puVar2 + -0xe,puVar3 + -0x1c);
      *(undefined8 *)(puVar2 + -4) = *(undefined8 *)(puVar3 + -8);
      *(undefined8 *)(puVar2 + -2) = *(undefined8 *)(puVar3 + -4);
      *(undefined2 *)puVar2 = *puVar3;
      puVar2[1] = *(undefined4 *)(puVar3 + 2);
      puVar2[2] = *(undefined4 *)(puVar3 + 4);
      puVar2[3] = *(undefined4 *)(puVar3 + 6);
      FUN_140313c90(puVar2 + 4,puVar3 + 8);
      *(undefined8 *)(puVar2 + 8) = *(undefined8 *)(puVar3 + 0x10);
      puVar2[10] = *(undefined4 *)(puVar3 + 0x14);
      puVar1 = puVar3 + 0x18;
      param_3 = param_3 + 0x26;
      puVar2 = puVar2 + 0x26;
      puVar3 = puVar3 + 0x4c;
    } while (puVar1 != param_2);
  }
  return param_3;
}



void FUN_140312da0(undefined2 *param_1,undefined2 *param_2,undefined4 *param_3)

{
  undefined2 *puVar1;
  undefined2 *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0x34;
    do {
      *(undefined4 *)(puVar2 + -0x34) = *param_3;
      FUN_1400015e0(puVar2 + -0x30,param_3 + 2,0,0xffffffffffffffff);
      FUN_1400015e0(puVar2 + -0x1c,param_3 + 0xc);
      *(undefined8 *)(puVar2 + -8) = *(undefined8 *)(param_3 + 0x16);
      *(undefined8 *)(puVar2 + -4) = *(undefined8 *)(param_3 + 0x18);
      *puVar2 = *(undefined2 *)(param_3 + 0x1a);
      *(undefined4 *)(puVar2 + 2) = param_3[0x1b];
      *(undefined4 *)(puVar2 + 4) = param_3[0x1c];
      *(undefined4 *)(puVar2 + 6) = param_3[0x1d];
      FUN_140313c90(puVar2 + 8,param_3 + 0x1e);
      *(undefined8 *)(puVar2 + 0x10) = *(undefined8 *)(param_3 + 0x22);
      *(undefined4 *)(puVar2 + 0x14) = param_3[0x24];
      puVar1 = puVar2 + 0x18;
      puVar2 = puVar2 + 0x4c;
    } while (puVar1 != param_2);
  }
  return;
}



undefined4 * FUN_140312e80(undefined2 *param_1,undefined2 *param_2,undefined4 *param_3)

{
  undefined2 *puVar1;
  undefined4 *puVar2;
  undefined2 *puVar3;
  
  if (param_1 != param_2) {
    puVar2 = param_3 + 0x1a;
    puVar3 = param_2 + 0x34;
    do {
      param_3 = param_3 + -0x26;
      puVar1 = puVar3 + -0x80;
      *param_3 = *(undefined4 *)(puVar3 + -0x80);
      FUN_1400015e0(puVar2 + -0x3e,puVar3 + -0x7c,0,0xffffffffffffffff);
      FUN_1400015e0(puVar2 + -0x34,puVar3 + -0x68);
      *(undefined8 *)(puVar2 + -0x2a) = *(undefined8 *)(puVar3 + -0x54);
      *(undefined8 *)(puVar2 + -0x28) = *(undefined8 *)(puVar3 + -0x50);
      *(undefined2 *)(puVar2 + -0x26) = puVar3[-0x4c];
      puVar2[-0x25] = *(undefined4 *)(puVar3 + -0x4a);
      puVar2[-0x24] = *(undefined4 *)(puVar3 + -0x48);
      puVar2[-0x23] = *(undefined4 *)(puVar3 + -0x46);
      FUN_140313c90(puVar2 + -0x22,puVar3 + -0x44);
      *(undefined8 *)(puVar2 + -0x1e) = *(undefined8 *)(puVar3 + -0x3c);
      puVar2[-0x1c] = *(undefined4 *)(puVar3 + -0x38);
      puVar2 = puVar2 + -0x26;
      puVar3 = puVar3 + -0x4c;
    } while (puVar1 != param_1);
  }
  return param_3;
}



void FUN_140312f70(longlong param_1,longlong param_2,undefined8 param_3)

{
  for (; param_2 != 0; param_2 = param_2 + -1) {
    if (param_1 != 0) {
      FUN_1403101a0(param_1,param_3);
    }
    param_1 = param_1 + 0x98;
  }
  return;
}



undefined8 * FUN_140312fd0(undefined8 *param_1)

{
  FUN_140313010();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[5] = boost::exception_detail::clone_impl<>::vftable;
  param_1[10] = boost::exception_detail::clone_impl<>::vftable;
  return param_1;
}



exception * FUN_140313010(exception *param_1,exception *param_2)

{
  longlong *plVar1;
  
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::too_many_args::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  plVar1 = *(longlong **)(param_2 + 0x30);
  *(longlong **)(param_1 + 0x30) = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))();
  }
  *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(param_2 + 0x38);
  *(undefined8 *)(param_1 + 0x40) = *(undefined8 *)(param_2 + 0x40);
  *(undefined4 *)(param_1 + 0x48) = *(undefined4 *)(param_2 + 0x48);
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



exception * FUN_1403130b0(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::too_many_args::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  return param_1;
}



void FUN_1403130f0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  *(code **)((basic_ios<> *)(param_1 + 0x18) +
            (longlong)*(int *)(*(longlong *)(param_1 + 0x10) + 4) + -8) = _vftable__exref;
  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);
      }
    }
  }
                    // WARNING: Could not recover jumptable at 0x000140313150. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_ios<>::~basic_ios<>((basic_ios<> *)(param_1 + 0x18));
  return;
}



exception * FUN_140313160(exception *param_1,uint param_2)

{
  *(undefined ***)(param_1 + 0x50) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



exception * FUN_1403131d0(exception *param_1,uint param_2)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
  std::exception::~exception(param_1);
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140313230(undefined8 *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_140311b50();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[5] = boost::exception_detail::clone_impl<>::vftable;
  param_1[10] = boost::exception_detail::clone_impl<>::vftable;
  if (param_2 != 0) {
    param_2 = param_2 + 0x28;
  }
  plVar1 = *(longlong **)(param_2 + 8);
  if ((longlong *)param_1[6] != (longlong *)0x0) {
    (**(code **)(*(longlong *)param_1[6] + 0x20))();
  }
  param_1[6] = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))(plVar1);
  }
  param_1[7] = *(undefined8 *)(param_2 + 0x10);
  param_1[8] = *(undefined8 *)(param_2 + 0x18);
  *(undefined4 *)(param_1 + 9) = *(undefined4 *)(param_2 + 0x20);
  return param_1;
}



undefined8 * FUN_1403132d0(undefined8 *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_140311c70();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[5] = boost::exception_detail::clone_impl<>::vftable;
  param_1[10] = boost::exception_detail::clone_impl<>::vftable;
  if (param_2 != 0) {
    param_2 = param_2 + 0x28;
  }
  plVar1 = *(longlong **)(param_2 + 8);
  if ((longlong *)param_1[6] != (longlong *)0x0) {
    (**(code **)(*(longlong *)param_1[6] + 0x20))();
  }
  param_1[6] = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))(plVar1);
  }
  param_1[7] = *(undefined8 *)(param_2 + 0x10);
  param_1[8] = *(undefined8 *)(param_2 + 0x18);
  *(undefined4 *)(param_1 + 9) = *(undefined4 *)(param_2 + 0x20);
  return param_1;
}



void FUN_140313370(exception *param_1)

{
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
                    // WARNING: Could not recover jumptable at 0x0001403133a5. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



void FUN_1403133b0(exception *param_1)

{
  *(undefined ***)(param_1 + 0x50) = boost::exception_detail::clone_base::vftable;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception::vftable;
  if (*(longlong **)(param_1 + 0x30) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + 0x30) + 0x20))();
  }
                    // WARNING: Could not recover jumptable at 0x0001403133f0. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



undefined8 *
FUN_140313400(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  puVar1 = operator_new(0x58);
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    FUN_140313010(puVar1,param_1 + -0x50,param_3,param_4,uVar2);
    *puVar1 = boost::exception_detail::clone_impl<>::vftable;
    puVar1[5] = boost::exception_detail::clone_impl<>::vftable;
    puVar1[10] = boost::exception_detail::clone_impl<>::vftable;
  }
  if (puVar1 == (undefined8 *)0x0) {
    puVar1 = (undefined8 *)0x0;
  }
  else {
    puVar1 = puVar1 + 10;
  }
  return puVar1;
}



void FUN_140313480(longlong param_1)

{
  undefined **local_60 [3];
  undefined8 local_48;
  undefined8 local_40;
  undefined **local_38;
  longlong *local_30;
  undefined8 local_28;
  undefined8 local_20;
  undefined4 local_18;
  undefined **local_10;
  
  std::exception::exception((exception *)local_60,(exception *)(param_1 + -0x50));
  local_60[0] = boost::io::too_many_args::vftable;
  local_48 = *(undefined8 *)(param_1 + -0x38);
  local_40 = *(undefined8 *)(param_1 + -0x30);
  local_38 = boost::exception::vftable;
  local_30 = *(longlong **)(param_1 + -0x20);
  if (local_30 != (longlong *)0x0) {
    (**(code **)(*local_30 + 0x18))();
  }
  local_28 = *(undefined8 *)(param_1 + -0x18);
  local_20 = *(undefined8 *)(param_1 + -0x10);
  local_18 = *(undefined4 *)(param_1 + -8);
  local_60[0] = boost::exception_detail::clone_impl<>::vftable;
  local_38 = boost::exception_detail::clone_impl<>::vftable;
  local_10 = boost::exception_detail::clone_impl<>::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_60,(ThrowInfo *)&DAT_1405d3c10);
}



undefined8 * FUN_140313540(undefined8 *param_1,undefined8 param_2)

{
  param_1[2] = &DAT_1404cf4f0;
  std::basic_ios<>::basic_ios<>((basic_ios<> *)(param_1 + 3));
  *param_1 = param_2;
  FUN_140313e10(param_1 + 1,param_2,0);
  FUN_140178e90(param_1,param_2);
  std::basic_ostream<>::basic_ostream<>
            ((basic_ostream<> *)(param_1 + 2),(basic_streambuf<> *)*param_1,false);
  *(undefined ***)((longlong)*(int *)(param_1[2] + 4) + 0x10 + (longlong)param_1) =
       boost::io::basic_oaltstringstream<>::vftable;
  return param_1;
}



void * FUN_1403135f0(longlong param_1,uint param_2)

{
  void *pvVar1;
  
  pvVar1 = (void *)(param_1 + -0x18);
  FUN_1403130f0(pvVar1);
  if ((param_2 & 1) != 0) {
    operator_delete(pvVar1);
  }
  return pvVar1;
}



void FUN_140313630(longlong *param_1,basic_ios<> *param_2,longlong param_3)

{
  facet *pfVar1;
  facet *local_res8;
  
  if (*param_1 != -1) {
    *(longlong *)(param_2 + 0x28) = *param_1;
  }
  if (param_1[1] != -1) {
    *(longlong *)(param_2 + 0x20) = param_1[1];
  }
  if ((short)param_1[2] != 0) {
    *(short *)(param_2 + 0x58) = (short)param_1[2];
  }
  *(uint *)(param_2 + 0x18) = (uint)*(ushort *)((longlong)param_1 + 0x14);
  std::basic_ios<>::clear(param_2,(int)param_1[3],false);
  std::ios_base::exceptions((ios_base *)param_2,*(int *)((longlong)param_1 + 0x1c));
  if (((((char)param_1[4] != '\0') || (param_3 != 0)) &&
      (std::basic_ios<>::imbue(param_2,(locale *)&local_res8), local_res8 != (facet *)0x0)) &&
     (pfVar1 = std::locale::facet::_Decref(local_res8), pfVar1 != (facet *)0x0)) {
    (*(code *)**(undefined8 **)pfVar1)(pfVar1,1);
  }
  return;
}



exception * FUN_1403136f0(exception *param_1,exception *param_2)

{
  std::exception::exception(param_1,param_2);
  *(undefined ***)param_1 = boost::io::too_many_args::vftable;
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_2 + 0x18);
  *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0xffffffff;
  *(undefined ***)param_1 = boost::exception_detail::error_info_injector<>::vftable;
  *(undefined ***)(param_1 + 0x28) = boost::exception_detail::error_info_injector<>::vftable;
  return param_1;
}



undefined8 FUN_140313770(undefined8 param_1)

{
  FUN_140313d70();
  return param_1;
}



void FUN_140313790(longlong *param_1)

{
  undefined8 local_48;
  undefined8 uStack_40;
  undefined4 local_38;
  uint uStack_34;
  undefined4 local_28;
  undefined4 uStack_24;
  undefined4 uStack_20;
  undefined4 uStack_1c;
  longlong local_18;
  
  if ((*(longlong *)param_1[9] != 0) && (*(longlong *)param_1[9] != *(longlong *)param_1[5])) {
    local_48 = 0;
    uStack_40 = 0;
    local_38 = 0;
    local_28 = 0;
    uStack_24 = 0;
    uStack_20 = 0;
    uStack_1c = 0;
    local_18 = (ulonglong)uStack_34 << 0x20;
    (**(code **)(*param_1 + 0x58))(param_1,&local_48,&local_28,2);
  }
  if ((*(longlong *)param_1[8] != 0) && (*(longlong *)param_1[8] != *(longlong *)param_1[4])) {
    local_48 = 0;
    uStack_40 = 0;
    local_38 = 0;
    local_28 = 0;
    uStack_24 = 0;
    uStack_20 = 0;
    uStack_1c = 0;
    local_18 = (ulonglong)uStack_34 << 0x20;
    (**(code **)(*param_1 + 0x58))(param_1,&local_48,&local_28,1);
  }
  return;
}



void FUN_140313850(undefined8 *param_1,undefined8 param_2,ulonglong param_3,ulonglong param_4,
                  undefined2 param_5,byte param_6,short param_7,char param_8)

{
  ulonglong uVar1;
  longlong lVar2;
  char cVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  longlong lVar6;
  longlong lVar7;
  
  FUN_140001870(param_1,0,0xffffffffffffffff);
  if (((longlong)param_4 < 1) || (param_4 <= param_3)) {
    uVar1 = param_1[2];
    uVar5 = (param_7 != 0) + param_3;
    if ((uVar1 <= uVar5) &&
       ((param_1[3] != uVar5 && (cVar3 = FUN_140001910(param_1,uVar5,1), cVar3 != '\0')))) {
      param_1[2] = uVar1;
      puVar4 = param_1;
      if (7 < (ulonglong)param_1[3]) {
        puVar4 = (undefined8 *)*param_1;
      }
      *(undefined2 *)((longlong)puVar4 + uVar1 * 2) = 0;
    }
    if (param_7 != 0) {
      FUN_140123f40(param_1,1,param_7);
    }
    if (param_3 == 0) {
      return;
    }
    FUN_140002aa0(param_1,param_2,param_3);
    return;
  }
  uVar1 = param_1[2];
  lVar6 = (param_4 - (param_7 != 0)) - param_3;
  if (((uVar1 <= param_4) && (param_1[3] != param_4)) &&
     (cVar3 = FUN_140001910(param_1,param_4,1), cVar3 != '\0')) {
    param_1[2] = uVar1;
    puVar4 = param_1;
    if (7 < (ulonglong)param_1[3]) {
      puVar4 = (undefined8 *)*param_1;
    }
    *(undefined2 *)((longlong)puVar4 + uVar1 * 2) = 0;
  }
  if (param_8 == '\0') {
    lVar2 = 0;
    lVar7 = lVar6;
    if ((param_6 & 0x40) != 0) goto LAB_14031391b;
  }
  else {
    lVar2 = lVar6 / 2;
    lVar7 = lVar6 - lVar6 / 2;
  }
  lVar6 = lVar2;
  if (lVar7 != 0) {
    FUN_140123f40(param_1,lVar7,param_5);
  }
LAB_14031391b:
  if (param_7 != 0) {
    FUN_140123f40(param_1,1,param_7);
  }
  if (param_3 != 0) {
    FUN_140002aa0(param_1,param_2,param_3);
  }
  if (lVar6 != 0) {
    FUN_140123f40(param_1,lVar6,param_5);
  }
  return;
}



basic_ostream<> * FUN_140313a00(basic_ostream<> *param_1)

{
  basic_streambuf<> *this;
  bool bVar1;
  ushort uVar2;
  wchar_t wVar3;
  undefined8 uVar4;
  ctype<wchar_t> *this_00;
  facet *pfVar5;
  int iVar6;
  longlong lVar7;
  int iVar8;
  facet *local_res20;
  
  iVar6 = 0;
  if (*(longlong **)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x48) !=
      (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x48) + 8)
    )();
  }
  if ((*(int *)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x10) == 0) &&
     (*(basic_ostream<> **)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x50) !=
      (basic_ostream<> *)0x0)) {
    std::basic_ostream<>::flush
              (*(basic_ostream<> **)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x50))
    ;
  }
  if (*(int *)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x10) == 0) {
    uVar4 = std::ios_base::getloc((ios_base *)(param_1 + *(int *)(*(longlong *)param_1 + 4)));
    this_00 = (ctype<wchar_t> *)FUN_140313ff0(uVar4);
    if ((local_res20 != (facet *)0x0) &&
       (pfVar5 = std::locale::facet::_Decref(local_res20), pfVar5 != (facet *)0x0)) {
      (*(code *)**(undefined8 **)pfVar5)(pfVar5,1);
    }
    if (*(longlong *)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x28) < 2) {
      lVar7 = 0;
    }
    else {
      lVar7 = *(longlong *)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x28) + -1;
    }
    iVar8 = 4;
    if ((*(uint *)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x18) & 0x1c0) == 0x40)
    {
LAB_140313b50:
      this = *(basic_streambuf<> **)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x48);
      wVar3 = std::ctype<wchar_t>::widen(this_00,' ');
      uVar2 = std::basic_streambuf<>::sputc(this,wVar3);
      if (uVar2 == 0xffff) {
        iVar6 = iVar8;
      }
      for (; (iVar6 == 0 && (0 < lVar7)); lVar7 = lVar7 + -1) {
        uVar2 = std::basic_streambuf<>::sputc
                          (*(basic_streambuf<> **)
                            (param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x48),
                           *(wchar_t *)
                            (param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x58));
        if (uVar2 == 0xffff) {
          iVar6 = iVar8;
        }
      }
    }
    else {
      while (iVar6 == 0) {
        if (lVar7 < 1) goto LAB_140313b50;
        uVar2 = std::basic_streambuf<>::sputc
                          (*(basic_streambuf<> **)
                            (param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x48),
                           *(wchar_t *)
                            (param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x58));
        if (uVar2 == 0xffff) {
          iVar6 = iVar8;
        }
        lVar7 = lVar7 + -1;
      }
    }
  }
  *(undefined8 *)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x28) = 0;
  std::basic_ios<>::setstate
            ((basic_ios<> *)(param_1 + *(int *)(*(longlong *)param_1 + 4)),iVar6,false);
  bVar1 = std::uncaught_exception();
  if (!bVar1) {
    std::basic_ostream<>::_Osfx(param_1);
  }
  if (*(longlong **)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x48) !=
      (longlong *)0x0) {
    (**(code **)(**(longlong **)(param_1 + (longlong)*(int *)(*(longlong *)param_1 + 4) + 0x48) +
                0x10))();
  }
  return param_1;
}



longlong FUN_140313c30(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x98) {
    if (param_3 != 0) {
      FUN_1403101a0(param_3,param_1);
    }
    param_3 = param_3 + 0x98;
  }
  return param_3;
}



void FUN_140313c90(char *param_1,char *param_2)

{
  facet *pfVar1;
  facet *pfVar2;
  
  if (*param_1 == '\0') {
    if (*param_2 == '\0') {
      return;
    }
    pfVar2 = *(facet **)(param_2 + 8);
    std::locale::facet::_Incref(pfVar2);
    if (param_1 + 8 != (char *)0x0) {
      *(facet **)(param_1 + 8) = pfVar2;
      std::locale::facet::_Incref(pfVar2);
    }
    *param_1 = '\x01';
  }
  else {
    if (*param_2 == '\0') {
      if ((*(facet **)(param_1 + 8) != (facet *)0x0) &&
         (pfVar2 = std::locale::facet::_Decref(*(facet **)(param_1 + 8)), pfVar2 != (facet *)0x0)) {
        (*(code *)**(undefined8 **)pfVar2)(pfVar2,1);
      }
      *param_1 = '\0';
      return;
    }
    pfVar2 = *(facet **)(param_2 + 8);
    std::locale::facet::_Incref(pfVar2);
    if (*(facet **)(param_1 + 8) != pfVar2) {
      pfVar1 = std::locale::facet::_Decref(*(facet **)(param_1 + 8));
      if (pfVar1 != (facet *)0x0) {
        (*(code *)**(undefined8 **)pfVar1)(pfVar1,1);
      }
      *(facet **)(param_1 + 8) = pfVar2;
      std::locale::facet::_Incref(pfVar2);
    }
  }
  if ((pfVar2 != (facet *)0x0) &&
     (pfVar2 = std::locale::facet::_Decref(pfVar2), pfVar2 != (facet *)0x0)) {
    (*(code *)**(undefined8 **)pfVar2)(pfVar2,1);
  }
  return;
}



undefined8 * FUN_140313d70(undefined8 *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_140313010();
  *param_1 = boost::exception_detail::clone_impl<>::vftable;
  param_1[5] = boost::exception_detail::clone_impl<>::vftable;
  param_1[10] = boost::exception_detail::clone_impl<>::vftable;
  if (param_2 != 0) {
    param_2 = param_2 + 0x28;
  }
  plVar1 = *(longlong **)(param_2 + 8);
  if ((longlong *)param_1[6] != (longlong *)0x0) {
    (**(code **)(*(longlong *)param_1[6] + 0x20))();
  }
  param_1[6] = plVar1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x18))(plVar1);
  }
  param_1[7] = *(undefined8 *)(param_2 + 0x10);
  param_1[8] = *(undefined8 *)(param_2 + 0x18);
  *(undefined4 *)(param_1 + 9) = *(undefined4 *)(param_2 + 0x20);
  return param_1;
}



undefined8 * FUN_140313e10(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  *param_1 = 0;
  puVar1 = operator_new(0x20);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar1 + 1) = 1;
    *(undefined4 *)((longlong)puVar1 + 0xc) = 1;
    *puVar1 = boost::detail::sp_counted_impl_pd<>::vftable;
    puVar1[2] = param_2;
  }
  *param_1 = puVar1;
  return param_1;
}



longlong FUN_140313e70(longlong param_1,type_info *param_2)

{
  bool bVar1;
  
  bVar1 = type_info::operator==
                    (param_2,(type_info *)
                             &boost::io::basic_oaltstringstream<>::No_Op::RTTI_Type_Descriptor);
  if (bVar1) {
    return param_1 + 0x18;
  }
  return 0;
}



void FUN_140313eb0(longlong param_1)

{
  FUN_140311dc0(param_1 + -0x28);
  return;
}



void FUN_140313ec0(longlong param_1)

{
  FUN_14030e8d0(param_1 + -0x50);
  return;
}



void FUN_140313ed0(longlong param_1)

{
  FUN_140311e20(param_1 + -0x28);
  return;
}



void FUN_140313ee0(longlong param_1)

{
  FUN_140311d50(param_1 + -0x28);
  return;
}



void FUN_140313ef0(longlong param_1)

{
  FUN_140311e20(param_1 + -0x50);
  return;
}



void FUN_140313f00(longlong param_1)

{
  FUN_140311d50(param_1 + -0x50);
  return;
}



void FUN_140313f10(longlong param_1)

{
  FUN_140313160(param_1 + -0x28);
  return;
}



void FUN_140313f20(longlong param_1)

{
  FUN_140311e90(param_1 + -0x28);
  return;
}



void FUN_140313f30(longlong param_1)

{
  FUN_14030e940(param_1 + -0x28);
  return;
}



void FUN_140313f40(longlong param_1)

{
  FUN_14030e8d0(param_1 + -0x28);
  return;
}



void FUN_140313f50(longlong param_1)

{
  FUN_140313160(param_1 + -0x50);
  return;
}



void FUN_140313f60(longlong param_1)

{
  FUN_1403131d0(param_1 + -0x28);
  return;
}



void FUN_140313f70(longlong *param_1)

{
  longlong *plVar1;
  bool bVar2;
  
  bVar2 = std::uncaught_exception();
  if (!bVar2) {
    std::basic_ostream<>::_Osfx((basic_ostream<> *)*param_1);
  }
  plVar1 = *(longlong **)((longlong)*(int *)(*(longlong *)*param_1 + 4) + 0x48 + *param_1);
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x10))();
  }
  return;
}



void FUN_140313fc0(longlong *param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)((longlong)*(int *)(*(longlong *)*param_1 + 4) + 0x48 + *param_1);
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x10))();
  }
  return;
}



facet * FUN_140313ff0(locale *param_1)

{
  longlong lVar1;
  __uint64 _Var2;
  _Locimp *p_Var3;
  facet *pfVar4;
  _Lockit local_res8 [8];
  facet *local_res10;
  bad_cast local_20 [24];
  
  std::_Lockit::_Lockit(local_res8,0);
  local_res10 = DAT_1406082a0;
  _Var2 = std::locale::id::operator_unsigned___int64((id *)id_exref);
  lVar1 = *(longlong *)param_1;
  if (_Var2 < *(ulonglong *)(lVar1 + 0x18)) {
    pfVar4 = *(facet **)(*(longlong *)(lVar1 + 0x10) + _Var2 * 8);
    if (pfVar4 != (facet *)0x0) goto LAB_1403140d3;
  }
  else {
    pfVar4 = (facet *)0x0;
  }
  if (*(char *)(lVar1 + 0x24) == '\0') {
LAB_14031406e:
    if (pfVar4 != (facet *)0x0) goto LAB_1403140d3;
  }
  else {
    p_Var3 = std::locale::_Getgloballocale();
    if (_Var2 < *(ulonglong *)(p_Var3 + 0x18)) {
      pfVar4 = *(facet **)(*(longlong *)(p_Var3 + 0x10) + _Var2 * 8);
      goto LAB_14031406e;
    }
  }
  pfVar4 = local_res10;
  if (local_res10 == (facet *)0x0) {
    _Var2 = std::ctype<wchar_t>::_Getcat(&local_res10,param_1);
    pfVar4 = local_res10;
    if (_Var2 == 0xffffffffffffffff) {
      std::bad_cast::bad_cast(local_20,"bad cast");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_20,(ThrowInfo *)&DAT_1405d3c48);
    }
    DAT_1406082a0 = local_res10;
    std::locale::facet::_Incref(local_res10);
    Facet_Register(pfVar4);
  }
LAB_1403140d3:
  std::_Lockit::~_Lockit(local_res8);
  return pfVar4;
}



void FUN_140314100(undefined8 *param_1)

{
  facet *pfVar1;
  
  if ((facet *)*param_1 != (facet *)0x0) {
    pfVar1 = std::locale::facet::_Decref((facet *)*param_1);
    if (pfVar1 != (facet *)0x0) {
      (*(code *)**(undefined8 **)pfVar1)(pfVar1,1);
    }
  }
  return;
}



undefined2 *
FUN_140314130(undefined2 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = 0;
  *(undefined1 *)(param_1 + 1) = 0;
  *(undefined8 *)(param_1 + 2) = 0;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined8 *)(param_1 + 10) = 0;
  *(undefined8 *)(param_1 + 0xe) = 0;
  *(undefined8 *)(param_1 + 0x12) = 0;
  *(undefined4 *)(param_1 + 0x16) = 0;
  *(undefined4 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x22) = 0x3f333333;
  *(undefined8 *)(param_1 + 0x24) = 0;
  FUN_1402c3a50(param_1 + 0x28,0,0,param_4,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x2c) = 0;
  FUN_14015b420(param_1 + 0x30,0,0);
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  return param_1;
}



undefined4 * FUN_1403141c0(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined1 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 5) = 0;
  *(undefined8 *)(param_1 + 7) = 0;
  *(undefined8 *)(param_1 + 9) = 0;
  *(undefined8 *)(param_1 + 0xb) = 0;
  *(undefined8 *)(param_1 + 0xd) = 0;
  *(undefined8 *)(param_1 + 0xf) = 0;
  *(undefined8 *)(param_1 + 0x15) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x1b) = 0;
  *(undefined8 *)(param_1 + 0x1d) = 0;
  *(undefined8 *)(param_1 + 0x1f) = 0;
  *(undefined8 *)(param_1 + 0x21) = 0;
  *(undefined8 *)(param_1 + 0x23) = 0;
  *(undefined8 *)(param_1 + 0x2c) = 7;
  *(undefined8 *)(param_1 + 0x2a) = 0;
  *(undefined2 *)(param_1 + 0x26) = 0;
  *(undefined8 *)(param_1 + 0x36) = 7;
  *(undefined8 *)(param_1 + 0x34) = 0;
  *(undefined2 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x40) = 7;
  *(undefined8 *)(param_1 + 0x3e) = 0;
  *(undefined2 *)(param_1 + 0x3a) = 0;
  *(undefined8 *)(param_1 + 0x4a) = 7;
  *(undefined8 *)(param_1 + 0x48) = 0;
  *(undefined2 *)(param_1 + 0x44) = 0;
  *(undefined8 *)(param_1 + 0x54) = 7;
  *(undefined8 *)(param_1 + 0x52) = 0;
  *(undefined2 *)(param_1 + 0x4e) = 0;
  *(undefined8 *)(param_1 + 0x5e) = 7;
  *(undefined8 *)(param_1 + 0x5c) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x68) = 7;
  *(undefined8 *)(param_1 + 0x66) = 0;
  *(undefined2 *)(param_1 + 0x62) = 0;
  *(undefined8 *)(param_1 + 0x72) = 7;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined2 *)(param_1 + 0x6c) = 0;
  *(undefined8 *)(param_1 + 0x7c) = 7;
  *(undefined8 *)(param_1 + 0x7a) = 0;
  *(undefined2 *)(param_1 + 0x76) = 0;
  *(undefined8 *)(param_1 + 0x86) = 7;
  *(undefined8 *)(param_1 + 0x84) = 0;
  *(undefined2 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x90) = 7;
  *(undefined8 *)(param_1 + 0x8e) = 0;
  *(undefined2 *)(param_1 + 0x8a) = 0;
  *(undefined8 *)(param_1 + 0x9a) = 7;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined2 *)(param_1 + 0x94) = 0;
  *(undefined8 *)(param_1 + 0xa4) = 7;
  *(undefined8 *)(param_1 + 0xa2) = 0;
  *(undefined2 *)(param_1 + 0x9e) = 0;
  *(undefined8 *)(param_1 + 0xae) = 7;
  *(undefined8 *)(param_1 + 0xac) = 0;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0xb2) = 0;
  *(undefined8 *)(param_1 + 0xb4) = 0;
  *(undefined8 *)(param_1 + 0xb6) = 0;
  *(undefined8 *)(param_1 + 0xba) = 0;
  *(undefined8 *)(param_1 + 0xbc) = 0;
  *(undefined8 *)(param_1 + 0xbe) = 0;
  _eh_vector_constructor_iterator_
            (param_1 + 0xc2,0x28,4,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  FUN_140314130(param_1 + 0xea);
  return param_1;
}



undefined8 FUN_140314400(longlong param_1,int param_2)

{
  undefined8 uVar1;
  
  if (param_2 < 1) {
    return 0;
  }
  if (*(int *)(param_1 + 8) < param_2) {
    return 0xffffffffffffffff;
  }
  FUN_14034ed40(param_1 + 0x1c0);
  uVar1 = *(undefined8 *)(*(longlong *)(param_1 + 0x10) + -8 + (longlong)param_2 * 8);
  FUN_14034edd0(param_1 + 0x1c0);
  return uVar1;
}



undefined4 FUN_140314470(longlong param_1,int param_2)

{
  undefined4 uVar1;
  
  if ((0 < param_2) && (param_2 <= *(int *)(param_1 + 8))) {
    FUN_14034ed40(param_1 + 0x1c0);
    uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 0x50) + -4 + (longlong)param_2 * 4);
    FUN_14034edd0(param_1 + 0x1c0);
    return uVar1;
  }
  return 0;
}



float FUN_1403144d0(float param_1,float param_2,float param_3,float param_4)

{
  float *pfVar1;
  bool bVar2;
  bool bVar3;
  float local_res8 [2];
  float local_res10 [4];
  float local_res20 [2];
  
  local_res20[0] = param_4;
  local_res8[0] = sinf((param_2 * 3.1415927) / 180.0);
  pfVar1 = local_res10;
  if (0.0 <= param_2) {
    local_res10[0] = 0.01;
    bVar3 = local_res8[0] == 0.01;
    bVar2 = 0.01 < local_res8[0];
  }
  else {
    local_res10[0] = -0.01;
    bVar3 = local_res8[0] == -0.01;
    bVar2 = local_res8[0] < -0.01;
  }
  if (bVar2 || bVar3) {
    pfVar1 = local_res8;
  }
  local_res8[0] = sqrtf((param_1 * 2.0 * param_3) / (*pfVar1 * *pfVar1));
  pfVar1 = local_res20;
  if (local_res8[0] <= param_4) {
    pfVar1 = local_res8;
  }
  return *pfVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1403145b0(uint *param_1,uint *param_2,longlong *param_3,uint param_4)

{
  byte *pbVar1;
  longlong lVar2;
  ulonglong uVar3;
  int *piVar4;
  longlong lVar5;
  byte bVar6;
  undefined1 auStack_48 [32];
  byte local_28 [16];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_48;
  lVar2 = *param_3;
  local_28[1] = 0;
  local_28[2] = 0;
  local_28[3] = 0;
  local_28[4] = 0;
  local_28[5] = 0;
  local_28[6] = 0;
  local_28[7] = 0;
  local_28[8] = 0;
  local_28[9] = 0;
  local_28[10] = 0;
  local_28[0xb] = 0;
  lVar5 = 0;
  local_28[0] = 0;
  piVar4 = (int *)(&DAT_140477e44 + (longlong)(int)(param_4 % 5) * 0x30);
  do {
    pbVar1 = (byte *)(lVar2 + lVar5);
    lVar5 = lVar5 + 6;
    bVar6 = (byte)param_4;
    local_28[piVar4[-1]] = *pbVar1 ^ bVar6;
    local_28[*piVar4] = *(byte *)(lVar2 + -5 + lVar5) ^ bVar6;
    local_28[piVar4[1]] = *(byte *)(lVar2 + -4 + lVar5) ^ bVar6;
    local_28[piVar4[2]] = *(byte *)(lVar2 + -3 + lVar5) ^ bVar6;
    local_28[piVar4[3]] = *(byte *)(lVar2 + -2 + lVar5) ^ bVar6;
    local_28[piVar4[4]] = *(byte *)(lVar2 + -1 + lVar5) ^ bVar6;
    piVar4 = piVar4 + 6;
  } while (lVar5 < 0xc);
  *param_1 = (((uint)local_28[3] * 0x100 + (uint)local_28[2]) * 0x100 + (uint)local_28[1]) * 0x100 +
             (uint)local_28[0];
  *param_2 = (((uint)local_28[7] * 0x100 + (uint)local_28[6]) * 0x100 + (uint)local_28[5]) * 0x100 +
             (uint)local_28[4];
  *param_1 = *param_1 ^ 0x754d993;
  *param_2 = *param_2 ^ 0xc1d1193;
  if (*param_2 + *param_1 ==
      ((((uint)local_28[0xb] * 0x100 + (uint)local_28[10]) * 0x100 + (uint)local_28[9]) * 0x100 +
       (uint)local_28[8] ^ 0xd7204c7)) {
    uVar3 = CONCAT71((uint7)(uint3)(*param_1 >> 8),1);
  }
  else {
    uVar3 = FUN_140418da0(DAT_140607fd8,L"Error DamageDecode False");
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140314750(uint *param_1,uint *param_2,longlong param_3,uint param_4)

{
  ulonglong uVar1;
  int *piVar2;
  byte *pbVar3;
  byte bVar4;
  longlong lVar5;
  undefined1 auStack_48 [32];
  byte local_28 [16];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_48;
  local_28[1] = 0;
  local_28[2] = 0;
  local_28[3] = 0;
  local_28[4] = 0;
  local_28[5] = 0;
  local_28[6] = 0;
  local_28[7] = 0;
  local_28[8] = 0;
  local_28[9] = 0;
  local_28[10] = 0;
  local_28[0xb] = 0;
  local_28[0] = 0;
  lVar5 = 2;
  piVar2 = (int *)(&DAT_140477e44 + (longlong)(int)(param_4 % 5) * 0x30);
  pbVar3 = (byte *)(param_3 + 1);
  do {
    bVar4 = (byte)param_4;
    local_28[piVar2[-1]] = pbVar3[-1] ^ bVar4;
    local_28[*piVar2] = bVar4 ^ *pbVar3;
    local_28[piVar2[1]] = pbVar3[1] ^ bVar4;
    local_28[piVar2[2]] = pbVar3[2] ^ bVar4;
    local_28[piVar2[3]] = pbVar3[3] ^ bVar4;
    lVar5 = lVar5 + -1;
    local_28[piVar2[4]] = pbVar3[4] ^ bVar4;
    piVar2 = piVar2 + 6;
    pbVar3 = pbVar3 + 6;
  } while (lVar5 != 0);
  *param_1 = (((uint)local_28[3] * 0x100 + (uint)local_28[2]) * 0x100 + (uint)local_28[1]) * 0x100 +
             (uint)local_28[0];
  *param_2 = (((uint)local_28[7] * 0x100 + (uint)local_28[6]) * 0x100 + (uint)local_28[5]) * 0x100 +
             (uint)local_28[4];
  *param_1 = *param_1 ^ 0x754d993;
  *param_2 = *param_2 ^ 0xc1d1193;
  if (*param_2 + *param_1 !=
      ((((uint)local_28[0xb] * 0x100 + (uint)local_28[10]) * 0x100 + (uint)local_28[9]) * 0x100 +
       (uint)local_28[8] ^ 0xd7204c7)) {
    uVar1 = FUN_140418da0(DAT_140607fd8,L"Error DamageDecode False");
    return uVar1 & 0xffffffffffffff00;
  }
  return CONCAT71((uint7)(uint3)(*param_1 >> 8),1);
}



void FUN_140314900(longlong param_1,uint param_2,float param_3)

{
  float *pfVar1;
  
  if (param_2 < 0x45) {
    pfVar1 = (float *)(param_1 + 0x734 + (longlong)(int)param_2 * 4);
  }
  else {
    if (DAT_14060813c == 0) {
      FUN_140176d60(0);
    }
    DAT_14060813c = DAT_14060813c + 1;
    pfVar1 = (float *)&DAT_140608138;
  }
  *pfVar1 = param_3 + *pfVar1;
  *(undefined1 *)(param_1 + 0x607) = 1;
  return;
}



void FUN_140314970(longlong param_1,float param_2)

{
  undefined4 *puVar1;
  undefined4 local_res10 [6];
  
  param_2 = param_2 + *(float *)(param_1 + 0x7f8);
  puVar1 = local_res10;
  *(float *)(param_1 + 0x7f8) = param_2;
  local_res10[0] = 0x3e4ccccd;
  if (param_2 <= 0.2) {
    puVar1 = (undefined4 *)(param_1 + 0x7f8);
  }
  *(undefined4 *)(param_1 + 0x7f8) = *puVar1;
  *(undefined1 *)(param_1 + 0x607) = 1;
  return;
}



void FUN_1403149b0(longlong param_1,uint param_2,int param_3)

{
  int *piVar1;
  int *piVar2;
  
  piVar2 = &DAT_140608130;
  if (param_2 < 0x47) {
    piVar1 = (int *)(param_1 + 0x618 + (longlong)(int)param_2 * 4);
  }
  else {
    if (DAT_140608134 == 0) {
      FUN_140176d60(0);
    }
    DAT_140608134 = DAT_140608134 + 1;
    piVar1 = &DAT_140608130;
  }
  if (param_2 < 0x47) {
    piVar2 = (int *)(param_1 + 0x618 + (longlong)(int)param_2 * 4);
  }
  else {
    if (DAT_140608134 == 0) {
      FUN_140176d60(0);
    }
    DAT_140608134 = DAT_140608134 + 1;
  }
  *piVar2 = param_3 + *piVar1;
  *(undefined1 *)(param_1 + 0x606) = 1;
  return;
}



float FUN_140314a60(longlong param_1)

{
  float fVar1;
  
  if (*(longlong *)(param_1 + 0xb78) == 0) {
    fVar1 = 1.0;
  }
  else {
    fVar1 = *(float *)(*(longlong *)(param_1 + 0xb78) + 0x1f8);
  }
  return (*(float *)(param_1 + 0x5f8) + *(float *)(param_1 + 0x5e8)) *
         (*(float *)(param_1 + 0x7f8) + 1.0 + *(float *)(param_1 + 0x938) +
         *(float *)(param_1 + 0x840)) * fVar1;
}



void FUN_140314ac0(undefined8 param_1)

{
  FUN_1402f8580();
  FUN_140314d00(param_1);
  return;
}



void FUN_140314b90(undefined8 param_1)

{
  FUN_1402f8580();
  FUN_140314c60(param_1);
  return;
}



int FUN_140314c60(longlong *param_1)

{
  undefined4 uVar1;
  int iVar2;
  float fVar3;
  
  uVar1 = FUN_1402f8580();
  fVar3 = (float)FUN_1402f7ea0(param_1,uVar1);
  iVar2 = (**(code **)(*param_1 + 0x2e8))(param_1);
  return (int)((fVar3 + (float)iVar2 +
               (float)(*(int *)((longlong)param_1 + 0x8c4) + *(int *)((longlong)param_1 + 0x63c))) *
               (*(float *)(param_1 + 0xea) + 1.0 + *(float *)(param_1 + 0x120)) +
               (float)*(int *)((longlong)param_1 + 0x884) +
              (float)*(int *)((longlong)param_1 + 0x8a4));
}



int FUN_140314d00(longlong *param_1)

{
  undefined4 uVar1;
  int iVar2;
  float fVar3;
  
  uVar1 = FUN_1402f8580();
  fVar3 = (float)FUN_1402f7ca0(param_1,uVar1);
  iVar2 = (**(code **)(*param_1 + 0x2e0))(param_1);
  return (int)((fVar3 + (float)iVar2 + (float)((int)param_1[0x118] + (int)param_1[199])) *
               (*(float *)((longlong)param_1 + 0x74c) + 1.0 + *(float *)((longlong)param_1 + 0x8fc))
               + (float)(int)param_1[0x110] + (float)*(int *)((longlong)param_1 + 0x89c));
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140314da0(void)

{
  ushort ******ppppppuVar1;
  short sVar2;
  undefined4 uVar3;
  undefined *puVar4;
  code *pcVar5;
  uint uVar6;
  undefined4 uVar7;
  int iVar8;
  float fVar9;
  longlong lVar10;
  longlong lVar11;
  short *psVar12;
  short *psVar13;
  undefined8 uVar14;
  undefined4 *puVar15;
  int *piVar16;
  wchar_t *pwVar17;
  longlong *plVar18;
  ulonglong uVar19;
  ushort ******ppppppuVar20;
  wchar_t *pwVar21;
  short *psVar22;
  short *psVar23;
  ushort ******ppppppuVar24;
  wchar_t *pwVar25;
  short *psVar26;
  undefined **ppuVar27;
  longlong lVar28;
  double dVar29;
  undefined1 auStack_868 [32];
  undefined1 *local_848;
  float local_838 [2];
  short *local_830;
  short *local_828;
  wchar_t *local_820;
  wchar_t *local_818;
  undefined8 local_810;
  wchar_t *local_800;
  wchar_t *local_7f8;
  undefined8 local_7f0;
  wchar_t *local_7e0;
  wchar_t *local_7d8;
  undefined8 local_7d0;
  wchar_t *local_7c0;
  wchar_t *local_7b8;
  undefined8 local_7b0;
  longlong local_7a0;
  undefined8 local_798;
  undefined1 local_788;
  undefined1 local_787;
  undefined4 local_784;
  undefined4 local_780;
  undefined4 local_77c;
  undefined4 local_778;
  undefined4 local_774;
  undefined8 local_770;
  undefined8 local_768;
  undefined8 local_760;
  undefined8 local_758;
  undefined8 local_750;
  undefined8 local_748;
  undefined8 local_740;
  undefined8 local_738;
  undefined8 local_730;
  undefined4 local_728;
  undefined4 local_6f4;
  undefined4 local_6f0;
  undefined4 local_6e8;
  undefined4 local_6e4;
  undefined4 local_6e0;
  undefined4 local_6dc;
  undefined4 local_6d8;
  undefined4 local_6d4;
  undefined4 local_6d0;
  uint local_668;
  undefined1 local_660 [40];
  ushort *****local_638 [2];
  longlong local_628;
  ulonglong local_620;
  ushort *****local_610 [2];
  longlong local_600;
  ulonglong local_5f8;
  ushort *****local_5e8 [2];
  longlong local_5d8;
  ulonglong local_5d0;
  undefined1 local_5c0 [40];
  undefined1 local_598 [40];
  undefined1 local_570 [40];
  undefined1 local_548 [40];
  undefined1 local_520 [40];
  undefined1 local_4f8 [40];
  undefined1 local_4d0 [40];
  undefined1 local_4a8 [40];
  undefined1 local_480 [40];
  undefined1 local_458 [40];
  float *local_430;
  float *local_428;
  float *local_420;
  float *local_410;
  float *local_408;
  float *local_400;
  undefined4 local_3e8;
  undefined1 local_3e0 [920];
  ulonglong local_48;
  
  local_798 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_868;
  lVar10 = FUN_1402933b0(DAT_140607ff0,L"ADD_EFFECT_STRING");
  if ((lVar10 != 0) &&
     (local_7a0 = lVar10, lVar11 = FUN_1402933b0(DAT_140607ff0,L"ADD_EFFECT"), lVar11 != 0)) {
    psVar23 = (short *)0x0;
    if ((*(longlong *)(lVar11 + 0x70) != 0) && (*(uint *)(lVar11 + 0x78) != 0)) {
      psVar13 = psVar23;
      plVar18 = *(longlong **)(lVar11 + 0x68);
      do {
        if (*plVar18 != 0) {
          psVar13 = (short *)(*(longlong **)(lVar11 + 0x68))[(longlong)psVar13];
          goto LAB_140314e64;
        }
        uVar6 = (int)psVar13 + 1;
        psVar13 = (short *)(ulonglong)uVar6;
        plVar18 = plVar18 + 1;
      } while (uVar6 < *(uint *)(lVar11 + 0x78));
    }
    local_828 = (short *)0x0;
    psVar13 = local_828;
LAB_140314e64:
    local_828 = psVar13;
    if (local_828 != (short *)0x0) {
      uVar3 = *(undefined4 *)local_828;
      FUN_140318e70(&local_788);
      uVar7 = FUN_1402970c0(lVar10,L"wszName");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296b70(lVar10,uVar3,uVar7,L"wszName");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_660,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"wszDescription");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296b70(lVar10,uVar3,uVar7,L"wszDescription");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_480,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"wszScrollDesc");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296b70(lVar10,uVar3,uVar7,L"wszScrollDesc");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_458,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"szMdataName00");
      local_848._0_1_ = 1;
      psVar13 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szMdataName00");
      uVar7 = FUN_1402970c0(lVar11,L"szMdataName01");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szMdataName01");
      uVar7 = FUN_1402970c0(lVar11,L"szMdataName02");
      local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
      local_830 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szMdataName02");
      if ((psVar13 != (short *)0x0) && (*psVar13 != 0)) {
        if (DAT_140607be1 == '\0') {
          uVar14 = FUN_140123ce0();
          FUN_1400015e0(local_638,uVar14,0,0xffffffffffffffff);
          FUN_140002aa0(local_638,&DAT_14049a36c,1);
        }
        uVar19 = 0xffffffffffffffff;
        psVar22 = psVar13;
        do {
          if (uVar19 == 0) break;
          uVar19 = uVar19 - 1;
          sVar2 = *psVar22;
          psVar22 = psVar22 + 1;
        } while (sVar2 != 0);
        FUN_140002aa0(local_638,psVar13,~uVar19 - 1);
        ppppppuVar20 = local_638;
        if (7 < local_620) {
          ppppppuVar20 = (ushort ******)local_638[0];
        }
        ppppppuVar1 = (ushort ******)((longlong)ppppppuVar20 + local_628 * 2);
        ppppppuVar24 = local_638;
        if (7 < local_620) {
          ppppppuVar24 = (ushort ******)local_638[0];
        }
        if (ppppppuVar24 != ppppppuVar1) {
          lVar10 = (longlong)ppppppuVar20 - (longlong)ppppppuVar24;
          do {
            iVar8 = tolower((uint)*(ushort *)ppppppuVar24);
            *(short *)((longlong)ppppppuVar24 + lVar10) = (short)iVar8;
            ppppppuVar24 = (ushort ******)((longlong)ppppppuVar24 + 2);
          } while (ppppppuVar24 != ppppppuVar1);
        }
      }
      if ((psVar12 != (short *)0x0) && (*psVar12 != 0)) {
        if (DAT_140607be1 == '\0') {
          uVar14 = FUN_140123ce0();
          FUN_1400015e0(local_610,uVar14,0,0xffffffffffffffff);
          FUN_140002aa0(local_610,&DAT_14049a36c,1);
        }
        uVar19 = 0xffffffffffffffff;
        psVar13 = psVar12;
        do {
          if (uVar19 == 0) break;
          uVar19 = uVar19 - 1;
          sVar2 = *psVar13;
          psVar13 = psVar13 + 1;
        } while (sVar2 != 0);
        FUN_140002aa0(local_610,psVar12,~uVar19 - 1);
        ppppppuVar20 = local_610;
        if (7 < local_5f8) {
          ppppppuVar20 = (ushort ******)local_610[0];
        }
        ppppppuVar1 = (ushort ******)((longlong)ppppppuVar20 + local_600 * 2);
        ppppppuVar24 = local_610;
        if (7 < local_5f8) {
          ppppppuVar24 = (ushort ******)local_610[0];
        }
        if (ppppppuVar24 != ppppppuVar1) {
          lVar10 = (longlong)ppppppuVar20 - (longlong)ppppppuVar24;
          do {
            iVar8 = tolower((uint)*(ushort *)ppppppuVar24);
            *(short *)((longlong)ppppppuVar24 + lVar10) = (short)iVar8;
            ppppppuVar24 = (ushort ******)((longlong)ppppppuVar24 + 2);
          } while (ppppppuVar24 != ppppppuVar1);
        }
      }
      psVar13 = local_830;
      if ((local_830 != (short *)0x0) && (*local_830 != 0)) {
        if (DAT_140607be1 == '\0') {
          uVar14 = FUN_140123ce0();
          FUN_1400015e0(local_5e8,uVar14,0,0xffffffffffffffff);
          FUN_140002aa0(local_5e8,&DAT_14049a36c,1);
        }
        uVar19 = 0xffffffffffffffff;
        psVar12 = psVar13;
        do {
          if (uVar19 == 0) break;
          uVar19 = uVar19 - 1;
          sVar2 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar2 != 0);
        FUN_140002aa0(local_5e8,psVar13,~uVar19 - 1);
        ppppppuVar20 = local_5e8;
        if (7 < local_5d0) {
          ppppppuVar20 = (ushort ******)local_5e8[0];
        }
        ppppppuVar1 = (ushort ******)((longlong)ppppppuVar20 + local_5d8 * 2);
        ppppppuVar24 = local_5e8;
        if (7 < local_5d0) {
          ppppppuVar24 = (ushort ******)local_5e8[0];
        }
        if (ppppppuVar24 != ppppppuVar1) {
          lVar10 = (longlong)ppppppuVar20 - (longlong)ppppppuVar24;
          do {
            iVar8 = tolower((uint)*(ushort *)ppppppuVar24);
            *(short *)((longlong)ppppppuVar24 + lVar10) = (short)iVar8;
            ppppppuVar24 = (ushort ******)((longlong)ppppppuVar24 + 2);
          } while (ppppppuVar24 != ppppppuVar1);
        }
      }
      uVar7 = FUN_1402970c0(lVar11,L"szDummyName00");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szDummyName00");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_5c0,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"szDummyName01");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szDummyName01");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_598,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"szMotionName00");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szMotionName00");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_570,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"szMotionName01");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szMotionName01");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_548,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"szStartMotionName02");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szStartMotionName02");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_520,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"szStayMotionName02");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szStayMotionName02");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_4f8,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"szEndMotionName02");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szEndMotionName02");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_4d0,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"szIcon");
      local_848._0_1_ = 1;
      psVar12 = (short *)FUN_140296990(lVar11,uVar3,uVar7,L"szIcon");
      uVar19 = 0xffffffffffffffff;
      psVar13 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_4a8,psVar12,~uVar19 - 1);
      uVar7 = FUN_1402970c0(lVar11,L"fMdtaScale02");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar7,L"fMdtaScale02");
      local_6d0 = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"nPrint");
      local_848._0_1_ = 1;
      piVar16 = (int *)FUN_140296600(lVar11,uVar3,uVar7,L"nPrint");
      local_788 = *piVar16 != 0;
      uVar7 = FUN_1402970c0(lVar11,L"nStackOption");
      local_848._0_1_ = 1;
      piVar16 = (int *)FUN_140296600(lVar11,uVar3,uVar7,L"nStackOption");
      local_787 = *piVar16 != 0;
      uVar7 = FUN_1402970c0(lVar11,L"nType");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar7,L"nType");
      local_784 = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"nGroup");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar7,L"nGroup");
      local_77c = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"nGroupLv");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar7,L"nGroupLv");
      local_778 = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"nSubAddEffectID");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar7,L"nSubAddEffectID");
      local_774 = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"fValue00");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar7,L"fValue00");
      local_6e8 = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"fValue01");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar7,L"fValue01");
      local_6e4 = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"fValue02");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar7,L"fValue02");
      local_6e0 = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"fValue03");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar7,L"fValue03");
      local_6dc = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"fValue04");
      local_848._0_1_ = 1;
      puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar7,L"fValue04");
      local_6d8 = *puVar15;
      uVar7 = FUN_1402970c0(lVar11,L"fValue05");
      local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
      puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar3,uVar7,L"fValue05");
      local_6d4 = *puVar15;
      ppuVar27 = &PTR_u_szDesc00_1405da610;
      psVar13 = psVar23;
      do {
        puVar4 = *ppuVar27;
        uVar7 = FUN_1402970c0(lVar11,puVar4);
        local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
        lVar10 = FUN_140296990(lVar11,uVar3,uVar7,puVar4);
        if (lVar10 != 0) {
          local_848 = &local_788;
          FUN_1403162a0(lVar10,psVar13,lVar11,uVar3);
        }
        uVar6 = (int)psVar13 + 1;
        psVar13 = (short *)(ulonglong)uVar6;
        ppuVar27 = ppuVar27 + 1;
      } while ((int)uVar6 < 6);
      local_760 = 0;
      local_758 = 0;
      local_750 = 0;
      local_748 = 0;
      local_740 = 0;
      local_738 = 0;
      local_730 = 0;
      local_728 = 0;
      local_770 = 0;
      local_768 = 0;
      uVar7 = FUN_1402970c0(lVar11,L"szClearGroup");
      local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
      uVar14 = FUN_140296990(lVar11,uVar3,uVar7,L"szClearGroup");
      local_7c0 = (wchar_t *)0x0;
      local_7b8 = (wchar_t *)0x0;
      local_7b0 = 0;
      FUN_140415930(&local_7c0,uVar14,&DAT_14049c7b8);
      if (local_7c0 != local_7b8) {
        lVar10 = (longlong)local_7b8 - (longlong)local_7c0 >> 0x3f;
        lVar28 = ((longlong)local_7b8 - (longlong)local_7c0) / 0x28 + lVar10;
        if (lVar28 != lVar10) {
          piVar16 = (int *)&local_770;
          psVar13 = psVar23;
          pwVar25 = local_7c0;
          do {
            if (3 < (uint)psVar13) break;
            pwVar21 = pwVar25;
            if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
              pwVar21 = *(wchar_t **)pwVar25;
            }
            iVar8 = _wtoi(pwVar21);
            *piVar16 = iVar8;
            psVar13 = (short *)(ulonglong)((uint)psVar13 + 1);
            pwVar25 = pwVar25 + 0x14;
            piVar16 = piVar16 + 1;
          } while (psVar13 < (short *)(lVar28 - lVar10));
        }
      }
      uVar7 = FUN_1402970c0(lVar11,L"szBlockGroup");
      local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
      uVar14 = FUN_140296990(lVar11,uVar3,uVar7,L"szBlockGroup");
      local_800 = (wchar_t *)0x0;
      local_7f8 = (wchar_t *)0x0;
      local_7f0 = 0;
      FUN_140415930(&local_800,uVar14,&DAT_14049c7b8);
      if (local_800 != local_7f8) {
        lVar10 = (longlong)local_7f8 - (longlong)local_800 >> 0x3f;
        lVar28 = ((longlong)local_7f8 - (longlong)local_800) / 0x28 + lVar10;
        if (lVar28 != lVar10) {
          piVar16 = (int *)&local_760;
          psVar13 = psVar23;
          pwVar25 = local_800;
          do {
            if (0xe < (uint)psVar13) break;
            pwVar21 = pwVar25;
            if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
              pwVar21 = *(wchar_t **)pwVar25;
            }
            iVar8 = _wtoi(pwVar21);
            *piVar16 = iVar8;
            psVar13 = (short *)(ulonglong)((uint)psVar13 + 1);
            pwVar25 = pwVar25 + 0x14;
            piVar16 = piVar16 + 1;
          } while (psVar13 < (short *)(lVar28 - lVar10));
        }
      }
      uVar7 = FUN_1402970c0(lVar11,L"szWildCardParam");
      local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
      uVar14 = FUN_140296990(lVar11,uVar3,uVar7,L"szWildCardParam");
      local_7e0 = (wchar_t *)0x0;
      local_7d8 = (wchar_t *)0x0;
      local_7d0 = 0;
      FUN_140415930(&local_7e0,uVar14,&DAT_14049c7b8);
      if ((local_7e0 != local_7d8) &&
         (psVar13 = (short *)(((longlong)local_7d8 - (longlong)local_7e0) / 0x28),
         pwVar25 = local_7e0, psVar12 = psVar23, local_830 = psVar13, psVar13 != (short *)0x0)) {
        do {
          pwVar21 = pwVar25;
          if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
            pwVar21 = *(wchar_t **)pwVar25;
          }
          fVar9 = (float)_wtoi(pwVar21);
          local_838[0] = fVar9;
          if ((local_838 < local_408) && (local_410 <= local_838)) {
            lVar10 = (longlong)local_838 - (longlong)local_410;
            if (local_408 == local_400) {
              uVar19 = (longlong)local_408 - (longlong)local_410 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              psVar26 = (short *)(uVar19 + 1);
              psVar22 = (short *)((longlong)local_400 - (longlong)local_410 >> 2);
              psVar13 = local_830;
              if (psVar22 < psVar26) {
                psVar13 = psVar23;
                if (psVar22 <= (short *)(0x3fffffffffffffff - ((ulonglong)psVar22 >> 1))) {
                  psVar13 = (short *)((longlong)psVar22 + ((ulonglong)psVar22 >> 1));
                }
                if (psVar13 < psVar26) {
                  psVar13 = psVar26;
                }
                FUN_140051e60(&local_410,psVar13);
                psVar13 = local_830;
              }
            }
            if (local_408 != (float *)0x0) {
              *local_408 = local_410[lVar10 >> 2];
            }
          }
          else {
            if (local_408 == local_400) {
              uVar19 = (longlong)local_408 - (longlong)local_410 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14031614d;
              }
              psVar26 = (short *)(uVar19 + 1);
              psVar22 = (short *)((longlong)local_400 - (longlong)local_410 >> 2);
              psVar13 = local_830;
              if (psVar22 < psVar26) {
                psVar13 = psVar23;
                if (psVar22 <= (short *)(0x3fffffffffffffff - ((ulonglong)psVar22 >> 1))) {
                  psVar13 = (short *)((longlong)psVar22 + ((ulonglong)psVar22 >> 1));
                }
                if (psVar13 < psVar26) {
                  psVar13 = psVar26;
                }
                FUN_140051e60(&local_410,psVar13);
                psVar13 = local_830;
              }
            }
            if (local_408 != (float *)0x0) {
              *local_408 = fVar9;
            }
          }
          local_408 = local_408 + 1;
          psVar12 = (short *)(ulonglong)((int)psVar12 + 1);
          pwVar25 = pwVar25 + 0x14;
        } while (psVar12 < psVar13);
      }
      uVar7 = FUN_1402970c0(lVar11,L"szWildCardValue");
      local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
      uVar14 = FUN_140296990(lVar11,uVar3,uVar7,L"szWildCardValue");
      local_820 = (wchar_t *)0x0;
      local_818 = (wchar_t *)0x0;
      local_810 = 0;
      FUN_140415930(&local_820,uVar14,&DAT_14049c7b8);
      if ((local_820 != local_818) &&
         (psVar13 = (short *)(((longlong)local_818 - (longlong)local_820) / 0x28),
         pwVar25 = local_820, psVar12 = psVar23, local_830 = psVar13, psVar13 != (short *)0x0)) {
        do {
          pwVar21 = pwVar25;
          if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
            pwVar21 = *(wchar_t **)pwVar25;
          }
          dVar29 = _wtof(pwVar21);
          fVar9 = (float)dVar29;
          local_838[0] = fVar9;
          if ((local_838 < local_428) && (local_430 <= local_838)) {
            lVar10 = (longlong)local_838 - (longlong)local_430;
            if (local_428 == local_420) {
              uVar19 = (longlong)local_428 - (longlong)local_430 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
LAB_14031614d:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              psVar26 = (short *)(uVar19 + 1);
              psVar22 = (short *)((longlong)local_420 - (longlong)local_430 >> 2);
              psVar13 = local_830;
              if (psVar22 < psVar26) {
                psVar13 = psVar23;
                if (psVar22 <= (short *)(0x3fffffffffffffff - ((ulonglong)psVar22 >> 1))) {
                  psVar13 = (short *)((longlong)psVar22 + ((ulonglong)psVar22 >> 1));
                }
                if (psVar13 < psVar26) {
                  psVar13 = psVar26;
                }
                FUN_14030db30(&local_430,psVar13);
                psVar13 = local_830;
              }
            }
            if (local_428 != (float *)0x0) {
              *local_428 = local_430[lVar10 >> 2];
            }
          }
          else {
            if (local_428 == local_420) {
              uVar19 = (longlong)local_428 - (longlong)local_430 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                return;
              }
              psVar26 = (short *)(uVar19 + 1);
              psVar22 = (short *)((longlong)local_420 - (longlong)local_430 >> 2);
              psVar13 = local_830;
              if (psVar22 < psVar26) {
                psVar13 = psVar23;
                if (psVar22 <= (short *)(0x3fffffffffffffff - ((ulonglong)psVar22 >> 1))) {
                  psVar13 = (short *)((longlong)psVar22 + ((ulonglong)psVar22 >> 1));
                }
                if (psVar13 < psVar26) {
                  psVar13 = psVar26;
                }
                FUN_14030db30(&local_430,psVar13);
                psVar13 = local_830;
              }
            }
            if (local_428 != (float *)0x0) {
              *local_428 = fVar9;
            }
          }
          local_428 = local_428 + 1;
          psVar12 = (short *)(ulonglong)((int)psVar12 + 1);
          pwVar25 = pwVar25 + 0x14;
        } while (psVar12 < psVar13);
      }
      pwVar21 = local_818;
      pwVar25 = local_820;
      uVar7 = FUN_1402970c0(lVar11,L"szTarget");
      local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
      pwVar17 = (wchar_t *)FUN_140296990(lVar11,uVar3,uVar7,L"szTarget");
      if (pwVar17 != (wchar_t *)0x0) {
        iVar8 = _wcsicmp(pwVar17,L"");
        if (iVar8 == 0) {
          local_668 = 1;
        }
        else {
          iVar8 = _wcsicmp(pwVar17,L"OneSelf");
          if (iVar8 == 0) {
            local_668 = 1;
          }
          else {
            iVar8 = _wcsicmp(pwVar17,L"Party");
            if (iVar8 == 0) {
              local_668 = 2;
            }
            else {
              iVar8 = _wcsicmp(pwVar17,L"Enemy");
              if (iVar8 == 0) {
                local_668 = 3;
              }
              else {
                iVar8 = _wcsicmp(pwVar17,L"AllExceptMe");
                if (iVar8 == 0) {
                  local_668 = 4;
                }
                else {
                  iVar8 = _wcsicmp(pwVar17,L"All");
                  if (iVar8 == 0) {
                    local_668 = 5;
                  }
                  else {
                    iVar8 = _wcsicmp(pwVar17,L"None");
                    local_668 = (uint)(iVar8 != 0);
                  }
                }
              }
            }
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar11,L"szPetTarget");
      local_848 = (undefined1 *)CONCAT71(local_848._1_7_,1);
      pwVar17 = (wchar_t *)FUN_140296990(lVar11,uVar3,uVar7,L"szPetTarget");
      if ((pwVar17 == (wchar_t *)0x0) || (iVar8 = _wcsicmp(pwVar17,L"NONE"), iVar8 == 0)) {
        local_6f4 = 0;
      }
      else {
        iVar8 = _wcsicmp(pwVar17,L"MYPET");
        if (iVar8 == 0) {
          local_6f4 = 1;
        }
        else {
          iVar8 = _wcsicmp(pwVar17,L"PARTYPET");
          if (iVar8 == 0) {
            local_6f4 = 2;
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar11,L"nSubType");
      local_848._0_1_ = 1;
      piVar16 = (int *)FUN_140296600(lVar11,uVar3,uVar7,L"nSubType");
      if (*piVar16 < 1) {
        local_780 = 0x3e;
      }
      uVar7 = FUN_1402970c0(lVar11,L"nPetPassive");
      local_848 = (undefined1 *)((ulonglong)local_848._1_7_ << 8);
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar3,uVar7,L"nPetPassive");
      if (puVar15 != (undefined4 *)0x0) {
        local_6f0 = *puVar15;
      }
      local_3e8 = uVar3;
      FUN_140317a60(local_3e0,&local_788);
      FUN_140318ce0(local_3e8);
      FUN_140319090(local_3e0);
      pwVar17 = pwVar25;
      if (pwVar25 != (wchar_t *)0x0) {
        for (; pwVar17 != pwVar21; pwVar17 = pwVar17 + 0x14) {
          if (7 < *(ulonglong *)(pwVar17 + 0xc)) {
            operator_delete(*(void **)pwVar17);
          }
          pwVar17[0xc] = L'\a';
          pwVar17[0xd] = L'\0';
          pwVar17[0xe] = L'\0';
          pwVar17[0xf] = L'\0';
          pwVar17[8] = L'\0';
          pwVar17[9] = L'\0';
          pwVar17[10] = L'\0';
          pwVar17[0xb] = L'\0';
          *pwVar17 = L'\0';
        }
        operator_delete(pwVar25);
      }
      pwVar17 = local_7d8;
      pwVar21 = local_7e0;
      pwVar25 = local_7e0;
      if (local_7e0 != (wchar_t *)0x0) {
        for (; pwVar25 != pwVar17; pwVar25 = pwVar25 + 0x14) {
          if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
            operator_delete(*(void **)pwVar25);
          }
          pwVar25[0xc] = L'\a';
          pwVar25[0xd] = L'\0';
          pwVar25[0xe] = L'\0';
          pwVar25[0xf] = L'\0';
          pwVar25[8] = L'\0';
          pwVar25[9] = L'\0';
          pwVar25[10] = L'\0';
          pwVar25[0xb] = L'\0';
          *pwVar25 = L'\0';
        }
        operator_delete(pwVar21);
      }
      pwVar17 = local_7f8;
      pwVar21 = local_800;
      pwVar25 = local_800;
      if (local_800 != (wchar_t *)0x0) {
        for (; pwVar25 != pwVar17; pwVar25 = pwVar25 + 0x14) {
          if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
            operator_delete(*(void **)pwVar25);
          }
          pwVar25[0xc] = L'\a';
          pwVar25[0xd] = L'\0';
          pwVar25[0xe] = L'\0';
          pwVar25[0xf] = L'\0';
          pwVar25[8] = L'\0';
          pwVar25[9] = L'\0';
          pwVar25[10] = L'\0';
          pwVar25[0xb] = L'\0';
          *pwVar25 = L'\0';
        }
        operator_delete(pwVar21);
      }
      pwVar17 = local_7b8;
      pwVar21 = local_7c0;
      pwVar25 = local_7c0;
      if (local_7c0 != (wchar_t *)0x0) {
        for (; pwVar25 != pwVar17; pwVar25 = pwVar25 + 0x14) {
          if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
            operator_delete(*(void **)pwVar25);
          }
          pwVar25[0xc] = L'\a';
          pwVar25[0xd] = L'\0';
          pwVar25[0xe] = L'\0';
          pwVar25[0xf] = L'\0';
          pwVar25[8] = L'\0';
          pwVar25[9] = L'\0';
          pwVar25[10] = L'\0';
          pwVar25[0xb] = L'\0';
          *pwVar25 = L'\0';
        }
        operator_delete(pwVar21);
      }
      FUN_140319090(&local_788);
      lVar10 = local_7a0;
      psVar13 = *(short **)(local_828 + 0xc);
      if (*(short **)(local_828 + 0xc) == (short *)0x0) {
        uVar6 = *(uint *)(local_828 + 0x10) % *(uint *)(lVar11 + 0x78) + 1;
        lVar28 = (longlong)(int)uVar6 << 3;
        psVar13 = psVar23;
        do {
          if (*(uint *)(lVar11 + 0x78) <= uVar6) break;
          if (*(longlong *)(*(longlong *)(lVar11 + 0x68) + lVar28) != 0) {
            psVar13 = *(short **)(*(longlong *)(lVar11 + 0x68) + lVar28);
          }
          uVar6 = uVar6 + 1;
          lVar28 = lVar28 + 8;
        } while (psVar13 == (short *)0x0);
      }
      goto LAB_140314e64;
    }
  }
  return;
}



void FUN_1403161a0(longlong param_1)

{
  FUN_140319090(param_1 + 8);
  return;
}



uint FUN_1403161b0(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
      if ((puVar1[0xea] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[3];
      }
    }
  }
  return 0;
}



undefined8 * FUN_1403161f0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetAddEffectDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf20 & 1) == 0) {
    DAT_14060cf20 = DAT_14060cf20 | 1;
    FUN_140318da0(0x3f400000,0x3e800000,0x40100000);
    FUN_140314da0();
    atexit((_func_5014 *)&LAB_140449100);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetAddEffectDB",uVar3,pcVar4,DVar5
                 );
  }
  return &DAT_1406084d0;
}



void FUN_1403162a0(wchar_t *param_1,int param_2,undefined8 param_3,undefined4 param_4,
                  longlong param_5)

{
  undefined *puVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 *puVar4;
  float *pfVar5;
  
  iVar2 = _wcsicmp(param_1,L"HP");
  if (iVar2 == 0) {
    puVar1 = (&PTR_u_fValue00_1405da5e0)[param_2];
    uVar3 = FUN_1402970c0(param_3,puVar1);
    puVar4 = (undefined4 *)FUN_1402967b0(param_3,param_4,uVar3,puVar1,1);
    *(undefined4 *)(param_5 + 0xbc) = *puVar4;
  }
  else {
    iVar2 = _wcsicmp(param_1,L"MP");
    if (iVar2 == 0) {
      puVar1 = (&PTR_u_fValue00_1405da5e0)[param_2];
      uVar3 = FUN_1402970c0(param_3,puVar1);
      puVar4 = (undefined4 *)FUN_1402967b0(param_3,param_4,uVar3,puVar1,1);
      *(undefined4 *)(param_5 + 0xc0) = *puVar4;
    }
    else {
      iVar2 = _wcsicmp(param_1,L"INTERVAL_TIME");
      if (iVar2 == 0) {
        puVar4 = (undefined4 *)FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],1)
        ;
        *(undefined4 *)(param_5 + 0xc4) = *puVar4;
      }
      else {
        iVar2 = _wcsicmp(param_1,L"END_CONDITION");
        if (iVar2 == 0) {
          pfVar5 = (float *)FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],1);
          *(int *)(param_5 + 0x80) = (int)*pfVar5;
        }
        else {
          iVar2 = _wcsicmp(param_1,L"END_CONDITION_VALUE");
          if (iVar2 == 0) {
            pfVar5 = (float *)FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],1);
            *(int *)(param_5 + 0x84) = (int)*pfVar5;
          }
          else {
            iVar2 = _wcsicmp(param_1,L"REVIVAL_CONDITION");
            if (iVar2 == 0) {
              pfVar5 = (float *)FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],1
                                             );
              *(int *)(param_5 + 0x88) = (int)*pfVar5;
            }
            else {
              iVar2 = _wcsicmp(param_1,L"HP_MP");
              if (iVar2 == 0) {
                puVar4 = (undefined4 *)
                         FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],1);
                *(undefined4 *)(param_5 + 200) = *puVar4;
              }
              else {
                iVar2 = _wcsicmp(param_1,L"HP_MIN");
                if (iVar2 == 0) {
                  puVar4 = (undefined4 *)
                           FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],1);
                  *(undefined4 *)(param_5 + 0xcc) = *puVar4;
                }
                else {
                  iVar2 = _wcsicmp(param_1,L"HP_MAX");
                  if (iVar2 == 0) {
                    puVar4 = (undefined4 *)
                             FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],1);
                    *(undefined4 *)(param_5 + 0xd0) = *puVar4;
                  }
                  else {
                    iVar2 = _wcsicmp(param_1,L"EXP");
                    if (iVar2 == 0) {
                      puVar4 = (undefined4 *)
                               FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],1)
                      ;
                      *(undefined4 *)(param_5 + 0xd4) = *puVar4;
                    }
                    else {
                      iVar2 = _wcsicmp(param_1,L"COUNT");
                      if (iVar2 == 0) {
                        puVar4 = (undefined4 *)
                                 FUN_140296fa0(param_3,param_4,(&PTR_u_fValue00_1405da5e0)[param_2],
                                               1);
                        *(undefined4 *)(param_5 + 0xd8) = *puVar4;
                      }
                      else {
                        iVar2 = _wcsicmp(param_1,L"DAMAGE");
                        if (iVar2 == 0) {
                          puVar4 = (undefined4 *)
                                   FUN_140296fa0(param_3,param_4,
                                                 (&PTR_u_fValue00_1405da5e0)[param_2],1);
                          *(undefined4 *)(param_5 + 0xdc) = *puVar4;
                        }
                        else {
                          iVar2 = _wcsicmp(param_1,L"DAMAGE_PERCENT");
                          if (iVar2 == 0) {
                            puVar4 = (undefined4 *)
                                     FUN_140296fa0(param_3,param_4,
                                                   (&PTR_u_fValue00_1405da5e0)[param_2],1);
                            *(undefined4 *)(param_5 + 0xe0) = *puVar4;
                          }
                          else {
                            iVar2 = _wcsicmp(param_1,L"HP_RECOVERY_PERCENT");
                            if (iVar2 == 0) {
                              puVar4 = (undefined4 *)
                                       FUN_140296fa0(param_3,param_4,
                                                     (&PTR_u_fValue00_1405da5e0)[param_2],1);
                              *(undefined4 *)(param_5 + 0xe4) = *puVar4;
                            }
                            else {
                              iVar2 = _wcsicmp(param_1,L"TYPE_VALUE");
                              if (iVar2 == 0) {
                                pfVar5 = (float *)FUN_140296fa0(param_3,param_4,
                                                                (&PTR_u_fValue00_1405da5e0)[param_2]
                                                                ,1);
                                *(int *)(param_5 + 0x78) = (int)*pfVar5;
                              }
                              else {
                                iVar2 = _wcsicmp(param_1,L"CONDITION");
                                if (iVar2 == 0) {
                                  puVar4 = (undefined4 *)
                                           FUN_140296fa0(param_3,param_4,
                                                         (&PTR_u_fValue00_1405da5e0)[param_2],1);
                                  *(undefined4 *)(param_5 + 0xe8) = *puVar4;
                                }
                                else {
                                  iVar2 = _wcsicmp(param_1,L"ANTI_CONDITION_LEVEL");
                                  if (iVar2 == 0) {
                                    puVar4 = (undefined4 *)
                                             FUN_140296fa0(param_3,param_4,
                                                           (&PTR_u_fValue00_1405da5e0)[param_2],1);
                                    *(undefined4 *)(param_5 + 0xec) = *puVar4;
                                  }
                                  else {
                                    iVar2 = _wcsicmp(param_1,L"VALUE");
                                    if (iVar2 == 0) {
                                      puVar4 = (undefined4 *)
                                               FUN_140296fa0(param_3,param_4,
                                                             (&PTR_u_fValue00_1405da5e0)[param_2],1)
                                      ;
                                      *(undefined4 *)(param_5 + 0xf0) = *puVar4;
                                    }
                                    else {
                                      iVar2 = _wcsicmp(param_1,L"TIME");
                                      if ((iVar2 != 0) &&
                                         (iVar2 = _wcsicmp(param_1,L"Super_TIME"), iVar2 != 0)) {
                                        iVar2 = _wcsicmp(param_1,L"PROBABILITY");
                                        if ((iVar2 == 0) ||
                                           ((iVar2 = _wcsicmp(param_1,L"Damage_PROBABILITY"),
                                            iVar2 == 0 ||
                                            (iVar2 = _wcsicmp(param_1,L"Attack_PROBABILITY"),
                                            iVar2 == 0)))) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0xf8) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"Range");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0xfc) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"MASTERY");
                                        if (iVar2 == 0) {
                                          pfVar5 = (float *)FUN_140296fa0(param_3,param_4,
                                                                          (&PTR_u_fValue00_1405da5e0
                                                                          )[param_2],1);
                                          *(int *)(param_5 + 0x7c) = (int)*pfVar5;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"PHYSICAL");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0x100) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"MAGIC");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0x104) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"ANTI_COUNT");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0x108) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_LEVEL");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0x10c) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"LIGHT");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 100) = 0x2e;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"DARKNESS");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 100) = 0x2f;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"FIRE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 100) = 0x2c;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"WATER");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 100) = 0x2d;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"EARTH");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 100) = 0x30;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"WINDY");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 100) = 0x31;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"TOXICATION");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 100) = 0x32;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"LIGHTNING");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 100) = 0x33;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"LIGHT_RESISTANCE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x68) = 0x16;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"DARKNESS_RESISTANCE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x68) = 0x17;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"FIRE_RESISTANCE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x68) = 0x14;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"WATER_RESISTANCE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x68) = 0x15;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"EARTH_RESISTANCE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x68) = 0x18;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"WINDY_RESISTANCE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x68) = 0x19;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"TOXICATION_RESISTANCE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x68) = 0x1a;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"LIGHTNING_RESISTANCE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x68) = 0x1b;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_BLOODING");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x21;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_COLD");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x22;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_FIRE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x23;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_STUN");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x24;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_STONE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x25;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_FREEZE");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x26;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_SLOW");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x27;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_TOXICATION");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x28;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_SICKNESS");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x29;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_SLEEP");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x2a;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_CHAOS");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x2b;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_LIGHTNING");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x2c;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_DARKNESS");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x2d;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"CONDITION_HOLD");
                                        if (iVar2 == 0) {
                                          *(undefined4 *)(param_5 + 0x6c) = 0x2e;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"ATTRIBUTE_GROUP_ID");
                                        if (iVar2 == 0) {
                                          pfVar5 = (float *)FUN_140296fa0(param_3,param_4,
                                                                          (&PTR_u_fValue00_1405da5e0
                                                                          )[param_2],1);
                                          *(int *)(param_5 + 0x74) = (int)*pfVar5;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"ATTACK_INCREASE");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0x110) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"USINGMANA_DECREASE");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0x114) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"USINGCOOLTIME_DECREASE");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0x118) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"GIMMICK_GROUP");
                                        if (iVar2 == 0) {
                                          pfVar5 = (float *)FUN_140296fa0(param_3,param_4,
                                                                          (&PTR_u_fValue00_1405da5e0
                                                                          )[param_2],1);
                                          *(int *)(param_5 + 0x8c) = (int)*pfVar5;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"GIMMICK_ID");
                                        if (iVar2 == 0) {
                                          pfVar5 = (float *)FUN_140296fa0(param_3,param_4,
                                                                          (&PTR_u_fValue00_1405da5e0
                                                                          )[param_2],1);
                                          *(int *)(param_5 + 0x90) = (int)*pfVar5;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"GIMMICK_REMOVE_TIME");
                                        if (iVar2 == 0) {
                                          puVar4 = (undefined4 *)
                                                   FUN_140296fa0(param_3,param_4,
                                                                 (&PTR_u_fValue00_1405da5e0)
                                                                 [param_2],1);
                                          *(undefined4 *)(param_5 + 0x11c) = *puVar4;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"SUMMON");
                                        if (iVar2 == 0) {
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"WARP");
                                        if (iVar2 == 0) {
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"RUSH");
                                        if (iVar2 == 0) {
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"WIRE_PULLER_ID");
                                        if (iVar2 == 0) {
                                          pfVar5 = (float *)FUN_140296fa0(param_3,param_4,
                                                                          (&PTR_u_fValue00_1405da5e0
                                                                          )[param_2],1);
                                          *(int *)(param_5 + 0x9c) = (int)*pfVar5;
                                          return;
                                        }
                                        iVar2 = _wcsicmp(param_1,L"COOLDOWN_TIME");
                                        if (iVar2 == 0) {
                                          return;
                                        }
                                        if (*param_1 == L'\0') {
                                          return;
                                        }
                                        FUN_140418da0(DAT_140607fd8,L"mcoAddEffectDB::SetParam : %s"
                                                      ,param_1);
                                        return;
                                      }
                                      puVar4 = (undefined4 *)
                                               FUN_140296fa0(param_3,param_4,
                                                             (&PTR_u_fValue00_1405da5e0)[param_2],1)
                                      ;
                                      *(undefined4 *)(param_5 + 0xf4) = *puVar4;
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return;
}



void thunk_FUN_140317800(void)

{
  FUN_140317800();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140317070(void)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  longlong lVar6;
  undefined4 *puVar8;
  short *psVar9;
  longlong lVar10;
  longlong *plVar11;
  ulonglong uVar12;
  short *psVar13;
  undefined4 *puVar14;
  undefined1 auStack_1b8 [32];
  undefined1 local_198;
  undefined8 local_188;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  undefined4 local_160;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined2 local_150;
  undefined6 uStack_14e;
  undefined8 local_140;
  ulonglong local_138;
  undefined2 local_128;
  undefined6 uStack_126;
  undefined8 local_118;
  ulonglong local_110;
  undefined2 local_100;
  undefined6 uStack_fe;
  undefined8 local_f0;
  ulonglong local_e8;
  undefined4 local_d8;
  undefined1 local_d0 [168];
  ulonglong local_28;
  undefined4 *puVar7;
  
  local_188 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_1b8;
  lVar5 = FUN_1402933b0(DAT_140607ff0,L"CHARACTER_TITLE");
  if ((lVar5 != 0) && (lVar6 = FUN_1402933b0(DAT_140607ff0,L"CHARACTER_TITLE_STRING"), lVar6 != 0))
  {
    puVar14 = (undefined4 *)0x0;
    puVar8 = puVar14;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar7 = puVar14;
      plVar11 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar11 != 0) {
          puVar8 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar7];
          break;
        }
        uVar3 = (int)puVar7 + 1;
        puVar7 = (undefined4 *)(ulonglong)uVar3;
        plVar11 = plVar11 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_140317123:
    puVar7 = puVar8;
    if (puVar7 != (undefined4 *)0x0) {
      uVar2 = *puVar7;
      local_138 = 7;
      local_140 = 0;
      local_150 = 0;
      local_110 = 7;
      local_118 = 0;
      local_128 = 0;
      local_e8 = 7;
      local_f0 = 0;
      local_100 = 0;
      uVar4 = FUN_1402970c0(lVar5,L"nTitleType");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nTitleType");
      local_178 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nAddEffectID00");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nAddEffectID00");
      local_174 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nAddEffectID01");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nAddEffectID01");
      local_170 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nAddEffectID02");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nAddEffectID02");
      local_16c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nAddEffectID03");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nAddEffectID03");
      local_168 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nAddEffectID04");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nAddEffectID04");
      local_164 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nAddEffectID05");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nAddEffectID05");
      local_160 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nTitleCategory");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nTitleCategory");
      local_15c = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nRechargeAble");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nRechargeAble");
      local_158 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nRemainTime");
      local_198 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nRemainTime");
      local_154 = *puVar8;
      uVar4 = FUN_1402970c0(lVar6,L"wszTitleName");
      local_198 = 1;
      psVar9 = (short *)FUN_140296b70(lVar6,uVar2,uVar4,L"wszTitleName");
      uVar12 = 0xffffffffffffffff;
      psVar13 = psVar9;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_150,psVar9,~uVar12 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"szTitleSpriteName");
      local_198 = 1;
      psVar9 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szTitleSpriteName");
      uVar12 = 0xffffffffffffffff;
      psVar13 = psVar9;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_128,psVar9,~uVar12 - 1);
      uVar4 = FUN_1402970c0(lVar6,L"wszTitleDesc");
      local_198 = 1;
      psVar9 = (short *)FUN_140296b70(lVar6,uVar2,uVar4,L"wszTitleDesc");
      uVar12 = 0xffffffffffffffff;
      psVar13 = psVar9;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_100,psVar9,~uVar12 - 1);
      local_d8 = uVar2;
      FUN_140317f80(local_d0,&local_178);
      FUN_140317740(local_d8);
      FUN_14012d9d0(local_d0);
      if (7 < local_e8) {
        operator_delete((void *)CONCAT62(uStack_fe,local_100));
      }
      local_e8 = 7;
      local_f0 = 0;
      local_100 = 0;
      if (7 < local_110) {
        operator_delete((void *)CONCAT62(uStack_126,local_128));
      }
      local_110 = 7;
      local_118 = 0;
      local_128 = 0;
      if (7 < local_138) {
        operator_delete((void *)CONCAT62(uStack_14e,local_150));
      }
      puVar8 = *(undefined4 **)(puVar7 + 6);
      if (*(undefined4 **)(puVar7 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar7[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar10 = (longlong)(int)uVar3 << 3;
        puVar8 = puVar14;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar10) != 0) {
            puVar8 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar10);
          }
          uVar3 = uVar3 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_140317123;
    }
  }
  return;
}



void FUN_140317500(longlong param_1)

{
  FUN_14012d9d0(param_1 + 8);
  return;
}



undefined8 * FUN_140317510(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetDesignateDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf1c & 1) == 0) {
    DAT_14060cf1c = DAT_14060cf1c | 1;
    FUN_140317670(0x3f400000,0x3e800000,0x40100000);
    FUN_140317070();
    atexit((_func_5014 *)&LAB_140449110);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetDesignateDB",uVar3,pcVar4,DVar5
                 );
  }
  return &DAT_140608520;
}



undefined8 FUN_1403175c0(uint param_1)

{
  uint *puVar1;
  int iVar2;
  longlong *plVar3;
  float fVar4;
  
  if ((0x39 < (int)param_1) && ((((int)param_1 < 0x3d || (param_1 == 0x44)) || (param_1 == 0x94))))
  {
    plVar3 = (longlong *)FUN_1403161f0();
    if (*plVar3 != 0) {
      for (puVar1 = *(uint **)(*plVar3 + ((ulonglong)param_1 % (ulonglong)*(uint *)(plVar3 + 2)) * 8
                              ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
        if ((puVar1[0xea] == param_1) && (*puVar1 == param_1)) {
          if (puVar1 != (uint *)0x0) {
            fVar4 = (float)puVar1[0x40];
            goto LAB_14031762b;
          }
          break;
        }
      }
    }
    fVar4 = 0.0;
LAB_14031762b:
    iVar2 = rand();
    if (fVar4 < (float)iVar2 * 3.0517578e-05) {
      return 0;
    }
  }
  return 1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140317670(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060853c = param_3;
  lVar1 = 0;
  DAT_140608530 = 0x11;
  DAT_140608554 = 10;
  _DAT_140608534 = param_1;
  _DAT_140608538 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608520 = 0;
  DAT_140608528 = 0;
  DAT_140608550 = 0;
  DAT_140608558 = 0;
  DAT_140608560 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608540 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608548 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608548 = 0;
  }
  return &DAT_140608520;
}



uint * FUN_140317740(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608530;
  if (DAT_140608520 == 0) {
    cVar2 = FUN_140318060((ulonglong)DAT_140608530,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608520 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x2a)) {
      if ((puVar3[0x2c] == param_1) && (*puVar3 == param_1)) {
        FUN_140317820(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140318420(param_1,uVar1,param_1);
  FUN_140317820(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140317800(void)

{
  FUN_1403178c0();
  return;
}



undefined4 * FUN_140317820(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  FUN_1400015e0(param_1 + 10,param_2 + 10,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x14,param_2 + 0x14,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1e,param_2 + 0x1e,0,0xffffffffffffffff);
  return param_1;
}



void FUN_1403178c0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608550 = DAT_140608550 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608520;
  if ((DAT_140608520 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608530, DAT_140608530 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xa8);
        FUN_1403185d0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608520;
        uVar4 = DAT_140608530;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608520 = (void *)0x0;
  DAT_140608528 = 0;
  if (DAT_140608550 == 0) {
    uVar5 = FUN_140318390(0);
    FUN_140318060(uVar5,0);
  }
  DAT_140608560 = 0;
  _Memory = DAT_140608558;
  if (DAT_140608558 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608558 = (longlong *)0x0;
    DAT_140608550 = DAT_140608550 + -1;
    return;
  }
  DAT_140608550 = DAT_140608550 + -1;
  return;
}



void FUN_1403179c0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0xb0) % (ulonglong)DAT_140608530;
  if (param_1 != *(longlong *)(DAT_140608520 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608520 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xa8); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xa8))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xa8) = *(undefined8 *)(param_1 + 0xa8);
      FUN_1403185d0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608520 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xa8);
  FUN_1403185d0(param_1);
  return;
}



undefined1 * FUN_140317a60(undefined1 *param_1,undefined1 *param_2)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  memcpy(param_1 + 0x28,param_2 + 0x28,0x3c);
  *(undefined4 *)(param_1 + 100) = *(undefined4 *)(param_2 + 100);
  *(undefined4 *)(param_1 + 0x68) = *(undefined4 *)(param_2 + 0x68);
  *(undefined4 *)(param_1 + 0x6c) = *(undefined4 *)(param_2 + 0x6c);
  *(undefined4 *)(param_1 + 0x70) = *(undefined4 *)(param_2 + 0x70);
  *(undefined4 *)(param_1 + 0x74) = *(undefined4 *)(param_2 + 0x74);
  *(undefined4 *)(param_1 + 0x78) = *(undefined4 *)(param_2 + 0x78);
  *(undefined4 *)(param_1 + 0x7c) = *(undefined4 *)(param_2 + 0x7c);
  *(undefined4 *)(param_1 + 0x80) = *(undefined4 *)(param_2 + 0x80);
  *(undefined4 *)(param_1 + 0x84) = *(undefined4 *)(param_2 + 0x84);
  *(undefined4 *)(param_1 + 0x88) = *(undefined4 *)(param_2 + 0x88);
  *(undefined4 *)(param_1 + 0x8c) = *(undefined4 *)(param_2 + 0x8c);
  *(undefined4 *)(param_1 + 0x90) = *(undefined4 *)(param_2 + 0x90);
  *(undefined4 *)(param_1 + 0x94) = *(undefined4 *)(param_2 + 0x94);
  *(undefined4 *)(param_1 + 0x98) = *(undefined4 *)(param_2 + 0x98);
  *(undefined4 *)(param_1 + 0x9c) = *(undefined4 *)(param_2 + 0x9c);
  *(undefined4 *)(param_1 + 0xa0) = *(undefined4 *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0xa4) = *(undefined4 *)(param_2 + 0xa4);
  *(undefined4 *)(param_1 + 0xa8) = *(undefined4 *)(param_2 + 0xa8);
  *(undefined4 *)(param_1 + 0xac) = *(undefined4 *)(param_2 + 0xac);
  *(undefined4 *)(param_1 + 0xb0) = *(undefined4 *)(param_2 + 0xb0);
  *(undefined4 *)(param_1 + 0xb4) = *(undefined4 *)(param_2 + 0xb4);
  *(undefined4 *)(param_1 + 0xb8) = *(undefined4 *)(param_2 + 0xb8);
  *(undefined4 *)(param_1 + 0xbc) = *(undefined4 *)(param_2 + 0xbc);
  *(undefined4 *)(param_1 + 0xc0) = *(undefined4 *)(param_2 + 0xc0);
  *(undefined4 *)(param_1 + 0xc4) = *(undefined4 *)(param_2 + 0xc4);
  *(undefined4 *)(param_1 + 200) = *(undefined4 *)(param_2 + 200);
  *(undefined4 *)(param_1 + 0xcc) = *(undefined4 *)(param_2 + 0xcc);
  *(undefined4 *)(param_1 + 0xd0) = *(undefined4 *)(param_2 + 0xd0);
  *(undefined4 *)(param_1 + 0xd4) = *(undefined4 *)(param_2 + 0xd4);
  *(undefined4 *)(param_1 + 0xd8) = *(undefined4 *)(param_2 + 0xd8);
  *(undefined4 *)(param_1 + 0xdc) = *(undefined4 *)(param_2 + 0xdc);
  *(undefined4 *)(param_1 + 0xe0) = *(undefined4 *)(param_2 + 0xe0);
  *(undefined4 *)(param_1 + 0xe4) = *(undefined4 *)(param_2 + 0xe4);
  *(undefined4 *)(param_1 + 0xe8) = *(undefined4 *)(param_2 + 0xe8);
  *(undefined4 *)(param_1 + 0xec) = *(undefined4 *)(param_2 + 0xec);
  *(undefined4 *)(param_1 + 0xf0) = *(undefined4 *)(param_2 + 0xf0);
  *(undefined4 *)(param_1 + 0xf4) = *(undefined4 *)(param_2 + 0xf4);
  *(undefined4 *)(param_1 + 0xf8) = *(undefined4 *)(param_2 + 0xf8);
  *(undefined4 *)(param_1 + 0xfc) = *(undefined4 *)(param_2 + 0xfc);
  *(undefined4 *)(param_1 + 0x100) = *(undefined4 *)(param_2 + 0x100);
  *(undefined4 *)(param_1 + 0x104) = *(undefined4 *)(param_2 + 0x104);
  *(undefined4 *)(param_1 + 0x108) = *(undefined4 *)(param_2 + 0x108);
  *(undefined4 *)(param_1 + 0x10c) = *(undefined4 *)(param_2 + 0x10c);
  *(undefined4 *)(param_1 + 0x110) = *(undefined4 *)(param_2 + 0x110);
  *(undefined4 *)(param_1 + 0x114) = *(undefined4 *)(param_2 + 0x114);
  *(undefined4 *)(param_1 + 0x118) = *(undefined4 *)(param_2 + 0x118);
  *(undefined4 *)(param_1 + 0x11c) = *(undefined4 *)(param_2 + 0x11c);
  *(undefined4 *)(param_1 + 0x120) = *(undefined4 *)(param_2 + 0x120);
  *(undefined8 *)(param_1 + 0x140) = 7;
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined2 *)(param_1 + 0x128) = 0;
  FUN_1400015e0(param_1 + 0x128,param_2 + 0x128,0,0xffffffffffffffff,uVar1);
  *(undefined8 *)(param_1 + 0x168) = 7;
  *(undefined8 *)(param_1 + 0x160) = 0;
  *(undefined2 *)(param_1 + 0x150) = 0;
  FUN_1400015e0(param_1 + 0x150,param_2 + 0x150,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 400) = 7;
  *(undefined8 *)(param_1 + 0x188) = 0;
  *(undefined2 *)(param_1 + 0x178) = 0;
  FUN_1400015e0(param_1 + 0x178,param_2 + 0x178,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1b8) = 7;
  *(undefined8 *)(param_1 + 0x1b0) = 0;
  *(undefined2 *)(param_1 + 0x1a0) = 0;
  FUN_1400015e0(param_1 + 0x1a0,param_2 + 0x1a0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x1e0) = 7;
  *(undefined8 *)(param_1 + 0x1d8) = 0;
  *(undefined2 *)(param_1 + 0x1c8) = 0;
  FUN_1400015e0(param_1 + 0x1c8,param_2 + 0x1c8,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x208) = 7;
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined2 *)(param_1 + 0x1f0) = 0;
  FUN_1400015e0(param_1 + 0x1f0,param_2 + 0x1f0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x230) = 7;
  *(undefined8 *)(param_1 + 0x228) = 0;
  *(undefined2 *)(param_1 + 0x218) = 0;
  FUN_1400015e0(param_1 + 0x218,param_2 + 0x218,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 600) = 7;
  *(undefined8 *)(param_1 + 0x250) = 0;
  *(undefined2 *)(param_1 + 0x240) = 0;
  FUN_1400015e0(param_1 + 0x240,param_2 + 0x240,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x280) = 7;
  *(undefined8 *)(param_1 + 0x278) = 0;
  *(undefined2 *)(param_1 + 0x268) = 0;
  FUN_1400015e0(param_1 + 0x268,param_2 + 0x268,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x2a8) = 7;
  *(undefined8 *)(param_1 + 0x2a0) = 0;
  *(undefined2 *)(param_1 + 0x290) = 0;
  FUN_1400015e0(param_1 + 0x290,param_2 + 0x290,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x2d0) = 7;
  *(undefined8 *)(param_1 + 0x2c8) = 0;
  *(undefined2 *)(param_1 + 0x2b8) = 0;
  FUN_1400015e0(param_1 + 0x2b8,param_2 + 0x2b8,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x2f8) = 7;
  *(undefined8 *)(param_1 + 0x2f0) = 0;
  *(undefined2 *)(param_1 + 0x2e0) = 0;
  FUN_1400015e0(param_1 + 0x2e0,param_2 + 0x2e0,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 800) = 7;
  *(undefined8 *)(param_1 + 0x318) = 0;
  *(undefined2 *)(param_1 + 0x308) = 0;
  FUN_1400015e0(param_1 + 0x308,param_2 + 0x308,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x348) = 7;
  *(undefined8 *)(param_1 + 0x340) = 0;
  *(undefined2 *)(param_1 + 0x330) = 0;
  FUN_1400015e0(param_1 + 0x330,param_2 + 0x330,0,0xffffffffffffffff);
  FUN_1402bc360(param_1 + 0x358,param_2 + 0x358);
  FUN_14012e520(param_1 + 0x378,param_2 + 0x378);
  return param_1;
}



undefined4 * FUN_140317f80(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  *(undefined8 *)(param_1 + 0x10) = 7;
  *(undefined8 *)(param_1 + 0xe) = 0;
  *(undefined2 *)(param_1 + 10) = 0;
  FUN_1400015e0(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_1400015e0(param_1 + 0x14,param_2 + 0x14,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x24) = 7;
  *(undefined8 *)(param_1 + 0x22) = 0;
  *(undefined2 *)(param_1 + 0x1e) = 0;
  FUN_1400015e0(param_1 + 0x1e,param_2 + 0x1e,0,0xffffffffffffffff);
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_140318060(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608520 != (void *)0x0) {
    operator_delete__(DAT_140608520);
    DAT_140608520 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608520 = operator_new(_Var1);
    if (DAT_140608520 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608520,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060853c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608538;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608548 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608548 = 0;
  }
  DAT_140608540 = (longlong)fVar4 + lVar2;
  DAT_140608530 = param_1;
  return CONCAT71((int7)(DAT_140608548 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403181b0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140318390(DAT_140608528,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608530) {
    if (DAT_140608520 == (void *)0x0) {
      FUN_140318060(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608530;
      if (DAT_140608530 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608520);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xa8);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0xb0) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xa8) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608530;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608520);
      fVar10 = (float)param_1 * _DAT_14060853c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608540 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608538;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608520 = _Dst;
      DAT_140608530 = param_1;
      DAT_140608548 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608548 = uVar6;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_140318390(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608534;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_140318420(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608560 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608554);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xb8)
      goto LAB_1403184f1;
      lVar8 = uVar7 * 0xb8;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_1403184f1:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608558;
    puVar4 = puVar6 + (ulonglong)(DAT_140608554 - 1) * 0x17 + 2;
    DAT_140608558 = puVar6;
    uVar2 = DAT_140608554;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x15] = DAT_140608560;
      puVar4 = puVar6 + -0x17;
      DAT_140608560 = puVar6;
    }
  }
  puVar6 = DAT_140608560;
  if (DAT_140608560 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608560[0x15];
  *(undefined4 *)DAT_140608560 = param_1;
  DAT_140608560 = (undefined8 *)uVar3;
  puVar6[9] = 7;
  puVar6[8] = 0;
  *(undefined2 *)(puVar6 + 6) = 0;
  puVar6[0xe] = 7;
  puVar6[0xd] = 0;
  *(undefined2 *)(puVar6 + 0xb) = 0;
  puVar6[0x13] = 7;
  puVar6[0x12] = 0;
  *(undefined2 *)(puVar6 + 0x10) = 0;
  *(undefined4 *)(puVar6 + 0x16) = param_3;
  DAT_140608528 = DAT_140608528 + 1;
  puVar6[0x15] = *(undefined8 *)(DAT_140608520 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608520 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608540 < DAT_140608528) && (DAT_140608550 == 0)) {
    uVar5 = FUN_140318390();
    FUN_1403181b0(uVar5);
  }
  return puVar6;
}



void FUN_1403185d0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_14012d9d0(param_1 + 8);
    *(longlong *)(param_1 + 0xa8) = DAT_140608560;
    DAT_140608528 = DAT_140608528 - 1;
    DAT_140608560 = param_1;
    if ((DAT_140608528 < DAT_140608548) && (DAT_140608550 == 0)) {
      uVar2 = FUN_140318390(DAT_140608528);
      FUN_1403181b0(uVar2);
    }
    if ((DAT_140608528 == 0) &&
       (DAT_140608560 = 0, _Memory = DAT_140608558, DAT_140608558 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608558 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



undefined8 * FUN_140318680(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608510 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608504);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x3b0)
      goto LAB_140318752;
      lVar8 = uVar7 * 0x3b0;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140318752:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608508;
    puVar4 = puVar6 + (ulonglong)(DAT_140608504 - 1) * 0x76 + 2;
    DAT_140608508 = puVar6;
    uVar2 = DAT_140608504;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x74] = DAT_140608510;
      puVar4 = puVar6 + -0x76;
      DAT_140608510 = puVar6;
    }
  }
  puVar6 = DAT_140608510;
  if (DAT_140608510 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608510[0x74];
  *(undefined4 *)DAT_140608510 = param_1;
  DAT_140608510 = (undefined8 *)uVar3;
  FUN_140318e70(puVar6 + 1);
  *(undefined4 *)(puVar6 + 0x75) = param_3;
  DAT_1406084d8 = DAT_1406084d8 + 1;
  puVar6[0x74] = *(undefined8 *)(DAT_1406084d0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_1406084d0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_1406084f0 < DAT_1406084d8) && (DAT_140608500 == 0)) {
    uVar5 = FUN_140319780();
    FUN_1403193a0(uVar5);
  }
  return puVar6;
}



void FUN_140318800(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x3a8) % (ulonglong)DAT_1406084e0;
  if (param_1 != *(longlong *)(DAT_1406084d0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_1406084d0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x3a0); lVar3 != param_1;
        lVar3 = *(longlong *)(lVar3 + 0x3a0)) {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x3a0) = *(undefined8 *)(param_1 + 0x3a0);
      FUN_140319580(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_1406084d0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x3a0);
  FUN_140319580(param_1);
  return;
}



undefined1 * FUN_1403188a0(undefined1 *param_1,undefined1 *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  lVar2 = 0xf;
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  puVar1 = (undefined4 *)(param_1 + 0x28);
  do {
    lVar2 = lVar2 + -1;
    *puVar1 = *(undefined4 *)(((longlong)param_2 - (longlong)param_1) + (longlong)puVar1);
    puVar1 = puVar1 + 1;
  } while (lVar2 != 0);
  *(undefined4 *)(param_1 + 100) = *(undefined4 *)(param_2 + 100);
  *(undefined4 *)(param_1 + 0x68) = *(undefined4 *)(param_2 + 0x68);
  *(undefined4 *)(param_1 + 0x6c) = *(undefined4 *)(param_2 + 0x6c);
  *(undefined4 *)(param_1 + 0x70) = *(undefined4 *)(param_2 + 0x70);
  *(undefined4 *)(param_1 + 0x74) = *(undefined4 *)(param_2 + 0x74);
  *(undefined4 *)(param_1 + 0x78) = *(undefined4 *)(param_2 + 0x78);
  *(undefined4 *)(param_1 + 0x7c) = *(undefined4 *)(param_2 + 0x7c);
  *(undefined4 *)(param_1 + 0x80) = *(undefined4 *)(param_2 + 0x80);
  *(undefined4 *)(param_1 + 0x84) = *(undefined4 *)(param_2 + 0x84);
  *(undefined4 *)(param_1 + 0x88) = *(undefined4 *)(param_2 + 0x88);
  *(undefined4 *)(param_1 + 0x8c) = *(undefined4 *)(param_2 + 0x8c);
  *(undefined4 *)(param_1 + 0x90) = *(undefined4 *)(param_2 + 0x90);
  *(undefined4 *)(param_1 + 0x94) = *(undefined4 *)(param_2 + 0x94);
  *(undefined4 *)(param_1 + 0x98) = *(undefined4 *)(param_2 + 0x98);
  *(undefined4 *)(param_1 + 0x9c) = *(undefined4 *)(param_2 + 0x9c);
  *(undefined4 *)(param_1 + 0xa0) = *(undefined4 *)(param_2 + 0xa0);
  *(undefined4 *)(param_1 + 0xa4) = *(undefined4 *)(param_2 + 0xa4);
  *(undefined4 *)(param_1 + 0xa8) = *(undefined4 *)(param_2 + 0xa8);
  *(undefined4 *)(param_1 + 0xac) = *(undefined4 *)(param_2 + 0xac);
  *(undefined4 *)(param_1 + 0xb0) = *(undefined4 *)(param_2 + 0xb0);
  *(undefined4 *)(param_1 + 0xb4) = *(undefined4 *)(param_2 + 0xb4);
  *(undefined4 *)(param_1 + 0xb8) = *(undefined4 *)(param_2 + 0xb8);
  *(undefined4 *)(param_1 + 0xbc) = *(undefined4 *)(param_2 + 0xbc);
  *(undefined4 *)(param_1 + 0xc0) = *(undefined4 *)(param_2 + 0xc0);
  *(undefined4 *)(param_1 + 0xc4) = *(undefined4 *)(param_2 + 0xc4);
  *(undefined4 *)(param_1 + 200) = *(undefined4 *)(param_2 + 200);
  *(undefined4 *)(param_1 + 0xcc) = *(undefined4 *)(param_2 + 0xcc);
  *(undefined4 *)(param_1 + 0xd0) = *(undefined4 *)(param_2 + 0xd0);
  *(undefined4 *)(param_1 + 0xd4) = *(undefined4 *)(param_2 + 0xd4);
  *(undefined4 *)(param_1 + 0xd8) = *(undefined4 *)(param_2 + 0xd8);
  *(undefined4 *)(param_1 + 0xdc) = *(undefined4 *)(param_2 + 0xdc);
  *(undefined4 *)(param_1 + 0xe0) = *(undefined4 *)(param_2 + 0xe0);
  *(undefined4 *)(param_1 + 0xe4) = *(undefined4 *)(param_2 + 0xe4);
  *(undefined4 *)(param_1 + 0xe8) = *(undefined4 *)(param_2 + 0xe8);
  *(undefined4 *)(param_1 + 0xec) = *(undefined4 *)(param_2 + 0xec);
  *(undefined4 *)(param_1 + 0xf0) = *(undefined4 *)(param_2 + 0xf0);
  *(undefined4 *)(param_1 + 0xf4) = *(undefined4 *)(param_2 + 0xf4);
  *(undefined4 *)(param_1 + 0xf8) = *(undefined4 *)(param_2 + 0xf8);
  *(undefined4 *)(param_1 + 0xfc) = *(undefined4 *)(param_2 + 0xfc);
  *(undefined4 *)(param_1 + 0x100) = *(undefined4 *)(param_2 + 0x100);
  *(undefined4 *)(param_1 + 0x104) = *(undefined4 *)(param_2 + 0x104);
  *(undefined4 *)(param_1 + 0x108) = *(undefined4 *)(param_2 + 0x108);
  *(undefined4 *)(param_1 + 0x10c) = *(undefined4 *)(param_2 + 0x10c);
  *(undefined4 *)(param_1 + 0x110) = *(undefined4 *)(param_2 + 0x110);
  *(undefined4 *)(param_1 + 0x114) = *(undefined4 *)(param_2 + 0x114);
  *(undefined4 *)(param_1 + 0x118) = *(undefined4 *)(param_2 + 0x118);
  *(undefined4 *)(param_1 + 0x11c) = *(undefined4 *)(param_2 + 0x11c);
  *(undefined4 *)(param_1 + 0x120) = *(undefined4 *)(param_2 + 0x120);
  FUN_1400015e0(param_1 + 0x128,param_2 + 0x128,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x150,param_2 + 0x150,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x178,param_2 + 0x178,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1a0,param_2 + 0x1a0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1c8,param_2 + 0x1c8,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1f0,param_2 + 0x1f0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x218,param_2 + 0x218,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x240,param_2 + 0x240,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x268,param_2 + 0x268,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x290,param_2 + 0x290,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x2b8,param_2 + 0x2b8,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x2e0,param_2 + 0x2e0,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x308,param_2 + 0x308,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x330,param_2 + 0x330,0,0xffffffffffffffff);
  FUN_1402bc630(param_1 + 0x358,param_2 + 0x358);
  FUN_14012bb70(param_1 + 0x378,param_2 + 0x378);
  return param_1;
}



uint * FUN_140318ce0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_1406084e0;
  if (DAT_1406084d0 == 0) {
    cVar2 = FUN_140319630((ulonglong)DAT_1406084e0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_1406084d0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0xe8)) {
      if ((puVar3[0xea] == param_1) && (*puVar3 == param_1)) {
        FUN_1403188a0(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140318680(param_1,uVar1,param_1);
  FUN_1403188a0(puVar3 + 2,param_2);
  return puVar3;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140318da0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_1406084ec = param_3;
  lVar1 = 0;
  DAT_1406084e0 = 0x11;
  DAT_140608504 = 10;
  _DAT_1406084e4 = param_1;
  _DAT_1406084e8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_1406084d0 = 0;
  DAT_1406084d8 = 0;
  DAT_140608500 = 0;
  DAT_140608508 = 0;
  DAT_140608510 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_1406084f0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_1406084f8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_1406084f8 = 0;
  }
  return &DAT_1406084d0;
}



undefined2 * FUN_140318e70(undefined2 *param_1)

{
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x7c) = 0x3f800000;
  *(undefined4 *)(param_1 + 10) = 0;
  *(undefined8 *)(param_1 + 0x32) = 0;
  *(undefined4 *)(param_1 + 0x36) = 0;
  *(undefined8 *)(param_1 + 0x3a) = 0;
  *(undefined8 *)(param_1 + 0x3e) = 0;
  *(undefined8 *)(param_1 + 0x42) = 0;
  *(undefined8 *)(param_1 + 0x4a) = 0;
  *(undefined8 *)(param_1 + 0x5e) = 0;
  *(undefined8 *)(param_1 + 0x62) = 0;
  *(undefined8 *)(param_1 + 0x66) = 0;
  *(undefined8 *)(param_1 + 0x6a) = 0;
  *(undefined4 *)(param_1 + 0x6e) = 0;
  *(undefined8 *)(param_1 + 0x74) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x84) = 0;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined4 *)(param_1 + 0x8c) = 0;
  *(undefined4 *)(param_1 + 0x90) = 1;
  *(undefined8 *)(param_1 + 0x9c) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 7;
  param_1[0x94] = 0;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined8 *)(param_1 + 0xb4) = 7;
  param_1[0xa8] = 0;
  *(undefined8 *)(param_1 + 0xc4) = 0;
  *(undefined8 *)(param_1 + 200) = 7;
  param_1[0xbc] = 0;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xdc) = 7;
  param_1[0xd0] = 0;
  *(undefined8 *)(param_1 + 0xec) = 0;
  *(undefined8 *)(param_1 + 0xf0) = 7;
  param_1[0xe4] = 0;
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x104) = 7;
  param_1[0xf8] = 0;
  *(undefined8 *)(param_1 + 0x114) = 0;
  *(undefined8 *)(param_1 + 0x118) = 7;
  param_1[0x10c] = 0;
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined8 *)(param_1 + 300) = 7;
  param_1[0x120] = 0;
  *(undefined8 *)(param_1 + 0x13c) = 0;
  *(undefined8 *)(param_1 + 0x140) = 7;
  param_1[0x134] = 0;
  *(undefined8 *)(param_1 + 0x150) = 0;
  *(undefined8 *)(param_1 + 0x154) = 7;
  param_1[0x148] = 0;
  *(undefined8 *)(param_1 + 0x164) = 0;
  *(undefined8 *)(param_1 + 0x168) = 7;
  param_1[0x15c] = 0;
  *(undefined8 *)(param_1 + 0x178) = 0;
  *(undefined8 *)(param_1 + 0x17c) = 7;
  param_1[0x170] = 0;
  *(undefined8 *)(param_1 + 0x18c) = 0;
  *(undefined8 *)(param_1 + 400) = 7;
  param_1[0x184] = 0;
  *(undefined8 *)(param_1 + 0x1a0) = 0;
  *(undefined8 *)(param_1 + 0x1a4) = 7;
  param_1[0x198] = 0;
  *(undefined8 *)(param_1 + 0x1ac) = 0;
  *(undefined8 *)(param_1 + 0x1b0) = 0;
  *(undefined8 *)(param_1 + 0x1b4) = 0;
  *(undefined8 *)(param_1 + 0x1bc) = 0;
  *(undefined8 *)(param_1 + 0x1c0) = 0;
  *(undefined8 *)(param_1 + 0x1c4) = 0;
  return param_1;
}



void FUN_140319090(longlong param_1)

{
  if (*(void **)(param_1 + 0x378) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x378));
  }
  *(undefined8 *)(param_1 + 0x378) = 0;
  *(undefined8 *)(param_1 + 0x380) = 0;
  *(undefined8 *)(param_1 + 0x388) = 0;
  if (*(void **)(param_1 + 0x358) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x358));
  }
  *(undefined8 *)(param_1 + 0x358) = 0;
  *(undefined8 *)(param_1 + 0x360) = 0;
  *(undefined8 *)(param_1 + 0x368) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x348)) {
    operator_delete(*(void **)(param_1 + 0x330));
  }
  *(undefined8 *)(param_1 + 0x348) = 7;
  *(undefined8 *)(param_1 + 0x340) = 0;
  *(undefined2 *)(param_1 + 0x330) = 0;
  if (7 < *(ulonglong *)(param_1 + 800)) {
    operator_delete(*(void **)(param_1 + 0x308));
  }
  *(undefined8 *)(param_1 + 800) = 7;
  *(undefined8 *)(param_1 + 0x318) = 0;
  *(undefined2 *)(param_1 + 0x308) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2f8)) {
    operator_delete(*(void **)(param_1 + 0x2e0));
  }
  *(undefined8 *)(param_1 + 0x2f8) = 7;
  *(undefined8 *)(param_1 + 0x2f0) = 0;
  *(undefined2 *)(param_1 + 0x2e0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2d0)) {
    operator_delete(*(void **)(param_1 + 0x2b8));
  }
  *(undefined8 *)(param_1 + 0x2d0) = 7;
  *(undefined8 *)(param_1 + 0x2c8) = 0;
  *(undefined2 *)(param_1 + 0x2b8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x2a8)) {
    operator_delete(*(void **)(param_1 + 0x290));
  }
  *(undefined8 *)(param_1 + 0x2a8) = 7;
  *(undefined8 *)(param_1 + 0x2a0) = 0;
  *(undefined2 *)(param_1 + 0x290) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x280)) {
    operator_delete(*(void **)(param_1 + 0x268));
  }
  *(undefined8 *)(param_1 + 0x280) = 7;
  *(undefined8 *)(param_1 + 0x278) = 0;
  *(undefined2 *)(param_1 + 0x268) = 0;
  if (7 < *(ulonglong *)(param_1 + 600)) {
    operator_delete(*(void **)(param_1 + 0x240));
  }
  *(undefined8 *)(param_1 + 600) = 7;
  *(undefined8 *)(param_1 + 0x250) = 0;
  *(undefined2 *)(param_1 + 0x240) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x230)) {
    operator_delete(*(void **)(param_1 + 0x218));
  }
  *(undefined8 *)(param_1 + 0x230) = 7;
  *(undefined8 *)(param_1 + 0x228) = 0;
  *(undefined2 *)(param_1 + 0x218) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x208)) {
    operator_delete(*(void **)(param_1 + 0x1f0));
  }
  *(undefined8 *)(param_1 + 0x208) = 7;
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined2 *)(param_1 + 0x1f0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1e0)) {
    operator_delete(*(void **)(param_1 + 0x1c8));
  }
  *(undefined8 *)(param_1 + 0x1e0) = 7;
  *(undefined8 *)(param_1 + 0x1d8) = 0;
  *(undefined2 *)(param_1 + 0x1c8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1b8)) {
    operator_delete(*(void **)(param_1 + 0x1a0));
  }
  *(undefined8 *)(param_1 + 0x1b8) = 7;
  *(undefined8 *)(param_1 + 0x1b0) = 0;
  *(undefined2 *)(param_1 + 0x1a0) = 0;
  if (7 < *(ulonglong *)(param_1 + 400)) {
    operator_delete(*(void **)(param_1 + 0x178));
  }
  *(undefined8 *)(param_1 + 400) = 7;
  *(undefined8 *)(param_1 + 0x188) = 0;
  *(undefined2 *)(param_1 + 0x178) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x168)) {
    operator_delete(*(void **)(param_1 + 0x150));
  }
  *(undefined8 *)(param_1 + 0x168) = 7;
  *(undefined8 *)(param_1 + 0x160) = 0;
  *(undefined2 *)(param_1 + 0x150) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x140)) {
    operator_delete(*(void **)(param_1 + 0x128));
  }
  *(undefined8 *)(param_1 + 0x140) = 7;
  *(undefined8 *)(param_1 + 0x138) = 0;
  *(undefined2 *)(param_1 + 0x128) = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403193a0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140319780(DAT_1406084d8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_1406084e0) {
    if (DAT_1406084d0 == (void *)0x0) {
      FUN_140319630(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_1406084e0;
      if (DAT_1406084e0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_1406084d0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x3a0);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x3a8) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x3a0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_1406084e0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_1406084d0);
      fVar10 = (float)param_1 * _DAT_1406084ec;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406084f0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_1406084e8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406084d0 = _Dst;
      DAT_1406084e0 = param_1;
      DAT_1406084f8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_1406084f8 = uVar6;
      }
    }
  }
  return;
}



void FUN_140319580(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_140319090(param_1 + 8);
    *(longlong *)(param_1 + 0x3a0) = DAT_140608510;
    DAT_1406084d8 = DAT_1406084d8 - 1;
    DAT_140608510 = param_1;
    if ((DAT_1406084d8 < DAT_1406084f8) && (DAT_140608500 == 0)) {
      uVar2 = FUN_140319780(DAT_1406084d8);
      FUN_1403193a0(uVar2);
    }
    if ((DAT_1406084d8 == 0) &&
       (DAT_140608510 = 0, _Memory = DAT_140608508, DAT_140608508 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608508 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_140319630(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_1406084d0 != (void *)0x0) {
    operator_delete__(DAT_1406084d0);
    DAT_1406084d0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_1406084d0 = operator_new(_Var1);
    if (DAT_1406084d0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_1406084d0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_1406084ec;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_1406084e8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_1406084f8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_1406084f8 = 0;
  }
  DAT_1406084f0 = (longlong)fVar4 + lVar2;
  DAT_1406084e0 = param_1;
  return CONCAT71((int7)(DAT_1406084f8 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_140319780(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_1406084e4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_140319810(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608500 = DAT_140608500 + 1;
  uVar7 = 0;
  pvVar6 = DAT_1406084d0;
  if ((DAT_1406084d0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_1406084e0, DAT_1406084e0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x3a0);
        FUN_140319580(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_1406084d0;
        uVar4 = DAT_1406084e0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_1406084d0 = (void *)0x0;
  DAT_1406084d8 = 0;
  if (DAT_140608500 == 0) {
    uVar5 = FUN_140319780(0);
    FUN_140319630(uVar5,0);
  }
  DAT_140608510 = 0;
  _Memory = DAT_140608508;
  if (DAT_140608508 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608508 = (longlong *)0x0;
    DAT_140608500 = DAT_140608500 + -1;
    return;
  }
  DAT_140608500 = DAT_140608500 + -1;
  return;
}



void FUN_140319910(void)

{
  FUN_140319810();
  return;
}



void thunk_FUN_140319910(void)

{
  FUN_140319910();
  return;
}



undefined8 * FUN_140319940(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0x20);
  lVar1 = *(longlong *)(param_1 + 0x28);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



undefined8 * FUN_140319960(longlong param_1,undefined8 *param_2,short *param_3)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  short sVar4;
  uint uVar5;
  short *psVar7;
  void *pvVar8;
  undefined8 *puVar9;
  longlong lVar10;
  longlong *plVar11;
  short *psVar12;
  undefined8 *puVar13;
  bool bVar14;
  undefined8 local_res20;
  undefined8 *local_40;
  longlong *local_38;
  undefined1 local_30 [16];
  longlong *local_20;
  undefined8 *puVar6;
  
  bVar14 = &stack0x00000000 == (undefined1 *)0x68;
  lVar10 = 1;
  psVar7 = param_3;
  psVar12 = &DAT_140477960;
  do {
    if (lVar10 == 0) break;
    lVar10 = lVar10 + -1;
    bVar14 = *psVar7 == *psVar12;
    psVar7 = psVar7 + 1;
    psVar12 = psVar12 + 1;
  } while (bVar14);
  if (bVar14) {
    puVar13 = (undefined8 *)0x0;
  }
  else {
    plVar1 = (longlong *)(param_1 + 0x50);
    puVar9 = (undefined8 *)0x0;
    puVar13 = puVar9;
    if ((*(longlong *)(param_1 + 0x58) != 0) && (*(uint *)(param_1 + 0x60) != 0)) {
      puVar6 = puVar9;
      plVar11 = (longlong *)*plVar1;
      do {
        if (*plVar11 != 0) {
          puVar13 = (undefined8 *)((longlong *)*plVar1)[(longlong)puVar6];
          break;
        }
        uVar5 = (int)puVar6 + 1;
        puVar6 = (undefined8 *)(ulonglong)uVar5;
        plVar11 = plVar11 + 1;
      } while (uVar5 < *(uint *)(param_1 + 0x60));
    }
LAB_1403199e0:
    puVar6 = puVar13;
    if (puVar6 != (undefined8 *)0x0) {
      puVar13 = (undefined8 *)(puVar6[1] + 0x10);
      if (7 < *(ulonglong *)(puVar6[1] + 0x28)) {
        puVar13 = (undefined8 *)*puVar13;
      }
      psVar7 = param_3;
      do {
        sVar3 = *psVar7;
        sVar4 = *(short *)((longlong)psVar7 + ((longlong)puVar13 - (longlong)param_3));
        if (sVar3 != sVar4) break;
        psVar7 = psVar7 + 1;
      } while (sVar4 != 0);
      if (sVar3 == sVar4) {
        LOCK();
        *(int *)(puVar6[1] + 8) = *(int *)(puVar6[1] + 8) + 1;
        UNLOCK();
        *param_2 = *puVar6;
        return (undefined8 *)puVar6[1];
      }
      puVar13 = (undefined8 *)puVar6[3];
      if ((undefined8 *)puVar6[3] == (undefined8 *)0x0) {
        uVar5 = *(uint *)(puVar6 + 4) % *(uint *)(param_1 + 0x60) + 1;
        lVar10 = (longlong)(int)uVar5 << 3;
        puVar13 = puVar9;
        do {
          if (*(uint *)(param_1 + 0x60) <= uVar5) break;
          if (*(longlong *)(lVar10 + *plVar1) != 0) {
            puVar13 = *(undefined8 **)(lVar10 + *plVar1);
          }
          uVar5 = uVar5 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar13 == (undefined8 *)0x0);
      }
      goto LAB_1403199e0;
    }
    *(longlong *)(param_1 + 8) = *(longlong *)(param_1 + 8) + 1;
    local_res20 = *(undefined8 *)(param_1 + 8);
    pvVar8 = operator_new(0x80);
    if (pvVar8 != (void *)0x0) {
      puVar9 = (undefined8 *)FUN_14031af70(pvVar8);
    }
    local_40 = puVar9;
    FUN_14031a0d0(&local_38,puVar9);
    FUN_140178e90(&local_40,puVar9,puVar9);
    FUN_140348c00(local_40,param_3);
    LOCK();
    *(int *)(local_40 + 1) = *(int *)(local_40 + 1) + 1;
    UNLOCK();
    puVar13 = (undefined8 *)FUN_1402f3af0(local_30,&local_res20,&local_40);
    FUN_14031a010(plVar1,*puVar13,puVar13 + 1);
    if (local_20 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_20 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_20 + 8))(local_20);
        LOCK();
        piVar2 = (int *)((longlong)local_20 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_20 + 0x10))(local_20);
        }
      }
    }
    puVar13 = local_40;
    *param_2 = local_res20;
    if (local_38 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_38 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_38 + 8))(local_38);
        LOCK();
        piVar2 = (int *)((longlong)local_38 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*local_38 + 0x10))(local_38);
        }
      }
    }
  }
  return puVar13;
}



undefined8 * FUN_140319b90(longlong param_1,undefined8 *param_2,short *param_3)

{
  int *piVar1;
  longlong *plVar2;
  short sVar3;
  short sVar4;
  uint uVar5;
  short *psVar7;
  void *pvVar8;
  undefined8 *puVar9;
  longlong lVar10;
  longlong *plVar11;
  short *psVar12;
  undefined8 *puVar13;
  bool bVar14;
  undefined8 local_res20;
  undefined8 *local_40;
  longlong *local_38;
  undefined1 local_30 [16];
  longlong *local_20;
  undefined8 *puVar6;
  
  bVar14 = &stack0x00000000 == (undefined1 *)0x68;
  lVar10 = 1;
  psVar7 = param_3;
  psVar12 = &DAT_140477960;
  do {
    if (lVar10 == 0) break;
    lVar10 = lVar10 + -1;
    bVar14 = *psVar7 == *psVar12;
    psVar7 = psVar7 + 1;
    psVar12 = psVar12 + 1;
  } while (bVar14);
  if (bVar14) {
    puVar13 = (undefined8 *)0x0;
  }
  else {
    plVar2 = (longlong *)(param_1 + 0x98);
    puVar9 = (undefined8 *)0x0;
    puVar13 = puVar9;
    if ((*(longlong *)(param_1 + 0xa0) != 0) && (*(uint *)(param_1 + 0xa8) != 0)) {
      puVar6 = puVar9;
      plVar11 = (longlong *)*plVar2;
      do {
        if (*plVar11 != 0) {
          puVar13 = (undefined8 *)((longlong *)*plVar2)[(longlong)puVar6];
          break;
        }
        uVar5 = (int)puVar6 + 1;
        puVar6 = (undefined8 *)(ulonglong)uVar5;
        plVar11 = plVar11 + 1;
      } while (uVar5 < *(uint *)(param_1 + 0xa8));
    }
LAB_140319c11:
    puVar6 = puVar13;
    if (puVar6 != (undefined8 *)0x0) {
      puVar13 = (undefined8 *)(puVar6[1] + 0x10);
      if (7 < *(ulonglong *)(puVar6[1] + 0x28)) {
        puVar13 = (undefined8 *)*puVar13;
      }
      psVar7 = param_3;
      do {
        sVar3 = *psVar7;
        sVar4 = *(short *)((longlong)psVar7 + ((longlong)puVar13 - (longlong)param_3));
        if (sVar3 != sVar4) break;
        psVar7 = psVar7 + 1;
      } while (sVar4 != 0);
      if (sVar3 == sVar4) {
        LOCK();
        *(int *)(puVar6[1] + 8) = *(int *)(puVar6[1] + 8) + 1;
        UNLOCK();
        *param_2 = *puVar6;
        return (undefined8 *)puVar6[1];
      }
      puVar13 = (undefined8 *)puVar6[3];
      if ((undefined8 *)puVar6[3] == (undefined8 *)0x0) {
        uVar5 = *(uint *)(puVar6 + 4) % *(uint *)(param_1 + 0xa8) + 1;
        lVar10 = (longlong)(int)uVar5 << 3;
        puVar13 = puVar9;
        do {
          if (*(uint *)(param_1 + 0xa8) <= uVar5) break;
          if (*(longlong *)(lVar10 + *plVar2) != 0) {
            puVar13 = *(undefined8 **)(lVar10 + *plVar2);
          }
          uVar5 = uVar5 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar13 == (undefined8 *)0x0);
      }
      goto LAB_140319c11;
    }
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 1;
    local_res20 = *(undefined8 *)(param_1 + 0x10);
    pvVar8 = operator_new(0x80);
    if (pvVar8 != (void *)0x0) {
      puVar9 = (undefined8 *)FUN_14031af70(pvVar8);
    }
    local_40 = puVar9;
    FUN_14031a140(&local_38,puVar9);
    FUN_140178e90(&local_40,puVar9,puVar9);
    FUN_14031b030(local_40,param_3);
    LOCK();
    *(int *)(local_40 + 1) = *(int *)(local_40 + 1) + 1;
    UNLOCK();
    *local_40 = local_res20;
    puVar13 = (undefined8 *)FUN_1402f3af0(local_30,&local_res20,&local_40);
    FUN_14031a010(plVar2,*puVar13,puVar13 + 1);
    if (local_20 != (longlong *)0x0) {
      LOCK();
      plVar2 = local_20 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        (**(code **)(*local_20 + 8))(local_20);
        LOCK();
        piVar1 = (int *)((longlong)local_20 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_20 + 0x10))(local_20);
        }
      }
    }
    puVar13 = local_40;
    *param_2 = local_res20;
    if (local_38 != (longlong *)0x0) {
      LOCK();
      plVar2 = local_38 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        (**(code **)(*local_38 + 8))(local_38);
        LOCK();
        piVar1 = (int *)((longlong)local_38 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_38 + 0x10))(local_38);
        }
      }
    }
  }
  return puVar13;
}



undefined8 * FUN_140319dd0(longlong param_1,undefined8 *param_2,short *param_3)

{
  int *piVar1;
  longlong *plVar2;
  short sVar3;
  short sVar4;
  uint uVar5;
  short *psVar7;
  void *pvVar8;
  undefined8 *puVar9;
  longlong lVar10;
  longlong *plVar11;
  short *psVar12;
  undefined8 *puVar13;
  bool bVar14;
  undefined8 local_res20;
  undefined8 *local_40;
  longlong *local_38;
  undefined1 local_30 [16];
  longlong *local_20;
  undefined8 *puVar6;
  
  bVar14 = &stack0x00000000 == (undefined1 *)0x68;
  lVar10 = 1;
  psVar7 = param_3;
  psVar12 = &DAT_140477960;
  do {
    if (lVar10 == 0) break;
    lVar10 = lVar10 + -1;
    bVar14 = *psVar7 == *psVar12;
    psVar7 = psVar7 + 1;
    psVar12 = psVar12 + 1;
  } while (bVar14);
  if (bVar14) {
    puVar13 = (undefined8 *)0x0;
  }
  else {
    plVar2 = (longlong *)(param_1 + 0xe0);
    puVar9 = (undefined8 *)0x0;
    puVar13 = puVar9;
    if ((*(longlong *)(param_1 + 0xe8) != 0) && (*(uint *)(param_1 + 0xf0) != 0)) {
      puVar6 = puVar9;
      plVar11 = (longlong *)*plVar2;
      do {
        if (*plVar11 != 0) {
          puVar13 = (undefined8 *)((longlong *)*plVar2)[(longlong)puVar6];
          break;
        }
        uVar5 = (int)puVar6 + 1;
        puVar6 = (undefined8 *)(ulonglong)uVar5;
        plVar11 = plVar11 + 1;
      } while (uVar5 < *(uint *)(param_1 + 0xf0));
    }
LAB_140319e51:
    puVar6 = puVar13;
    if (puVar6 != (undefined8 *)0x0) {
      puVar13 = (undefined8 *)(puVar6[1] + 0x10);
      if (7 < *(ulonglong *)(puVar6[1] + 0x28)) {
        puVar13 = (undefined8 *)*puVar13;
      }
      psVar7 = param_3;
      do {
        sVar3 = *psVar7;
        sVar4 = *(short *)((longlong)psVar7 + ((longlong)puVar13 - (longlong)param_3));
        if (sVar3 != sVar4) break;
        psVar7 = psVar7 + 1;
      } while (sVar4 != 0);
      if (sVar3 == sVar4) {
        LOCK();
        *(int *)(puVar6[1] + 8) = *(int *)(puVar6[1] + 8) + 1;
        UNLOCK();
        *param_2 = *puVar6;
        return (undefined8 *)puVar6[1];
      }
      puVar13 = (undefined8 *)puVar6[3];
      if ((undefined8 *)puVar6[3] == (undefined8 *)0x0) {
        uVar5 = *(uint *)(puVar6 + 4) % *(uint *)(param_1 + 0xf0) + 1;
        lVar10 = (longlong)(int)uVar5 << 3;
        puVar13 = puVar9;
        do {
          if (*(uint *)(param_1 + 0xf0) <= uVar5) break;
          if (*(longlong *)(lVar10 + *plVar2) != 0) {
            puVar13 = *(undefined8 **)(lVar10 + *plVar2);
          }
          uVar5 = uVar5 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar13 == (undefined8 *)0x0);
      }
      goto LAB_140319e51;
    }
    *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + 1;
    local_res20 = *(undefined8 *)(param_1 + 0x18);
    pvVar8 = operator_new(0x80);
    if (pvVar8 != (void *)0x0) {
      puVar9 = (undefined8 *)FUN_14031af70(pvVar8);
    }
    local_40 = puVar9;
    FUN_14031a1b0(&local_38,puVar9);
    FUN_140178e90(&local_40,puVar9,puVar9);
    FUN_1403490a0(local_40,param_3);
    LOCK();
    *(int *)(local_40 + 1) = *(int *)(local_40 + 1) + 1;
    UNLOCK();
    *local_40 = local_res20;
    puVar13 = (undefined8 *)FUN_1402f3af0(local_30,&local_res20,&local_40);
    FUN_14031a010(plVar2,*puVar13,puVar13 + 1);
    if (local_20 != (longlong *)0x0) {
      LOCK();
      plVar2 = local_20 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        (**(code **)(*local_20 + 8))(local_20);
        LOCK();
        piVar1 = (int *)((longlong)local_20 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_20 + 0x10))(local_20);
        }
      }
    }
    puVar13 = local_40;
    *param_2 = local_res20;
    if (local_38 != (longlong *)0x0) {
      LOCK();
      plVar2 = local_38 + 1;
      *(int *)plVar2 = (int)*plVar2 + -1;
      UNLOCK();
      if ((int)*plVar2 == 0) {
        (**(code **)(*local_38 + 8))(local_38);
        LOCK();
        piVar1 = (int *)((longlong)local_38 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_38 + 0x10))(local_38);
        }
      }
    }
  }
  return puVar13;
}



ulonglong * FUN_14031a010(longlong *param_1,ulonglong param_2,undefined8 param_3)

{
  ulonglong uVar1;
  char cVar2;
  ulonglong *puVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)*(uint *)(param_1 + 2);
  uVar1 = (param_2 & 0xffffffff) % uVar4;
  if (*param_1 == 0) {
    cVar2 = FUN_1402c6d50(param_1,uVar4,1,uVar4,0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(ulonglong **)(*param_1 + uVar1 * 8); puVar3 != (ulonglong *)0x0;
        puVar3 = (ulonglong *)puVar3[3]) {
      if (((int)puVar3[4] == (int)param_2) && (*puVar3 == param_2)) {
        FUN_140343ec0(puVar3 + 1,param_3);
        return puVar3;
      }
    }
  }
  puVar3 = (ulonglong *)FUN_14031a270(param_1,param_2,uVar1,param_2 & 0xffffffff);
  FUN_140343ec0(puVar3 + 1,param_3);
  return puVar3;
}



undefined8 * FUN_14031a0d0(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;
}



undefined8 * FUN_14031a140(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;
}



undefined8 * FUN_14031a1b0(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;
}



void FUN_14031a220(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14030e480((longlong)pvVar1 + 0x38);
    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);
  }
  return;
}



undefined8 *
FUN_14031a270(longlong *param_1,undefined8 param_2,ulonglong param_3,undefined4 param_4)

{
  int iVar1;
  undefined8 *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_14031a327;
      lVar7 = uVar6 * 0x28;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14031a327:
                    // WARNING: Subroutine does not return
      FUN_14000d450(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 = (undefined8 *)param_1[8];
  if (puVar2 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = puVar2[3];
  *puVar2 = param_2;
  puVar2[1] = 0;
  puVar2[2] = 0;
  *(undefined4 *)(puVar2 + 4) = param_4;
  param_1[1] = param_1[1] + 1;
  puVar2[3] = *(undefined8 *)(*param_1 + (param_3 & 0xffffffff) * 8);
  *(undefined8 **)(*param_1 + (param_3 & 0xffffffff) * 8) = puVar2;
  if (((ulonglong)param_1[4] < (ulonglong)param_1[1]) && ((int)param_1[6] == 0)) {
    uVar4 = FUN_1402cddb0(param_1);
    FUN_1401dfb50(param_1,uVar4);
  }
  return puVar2;
}



void FUN_14031a3c0(void *param_1)

{
  if (param_1 != (void *)0x0) {
    FUN_14030e480((longlong)param_1 + 0x38);
    if (7 < *(ulonglong *)((longlong)param_1 + 0x28)) {
      operator_delete(*(void **)((longlong)param_1 + 0x10));
    }
    *(undefined8 *)((longlong)param_1 + 0x28) = 7;
    *(undefined8 *)((longlong)param_1 + 0x20) = 0;
    *(undefined2 *)((longlong)param_1 + 0x10) = 0;
    operator_delete(param_1);
  }
  return;
}



undefined8 FUN_14031a410(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 6)) {
      if ((puVar1[8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return *(undefined8 *)(puVar1 + 2);
      }
    }
  }
  return 0;
}



// WARNING: Removing unreachable block (ram,0x00014031a521)

undefined4 FUN_14031a450(longlong *param_1,int param_2,int param_3)

{
  undefined4 *puVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  
  if (param_1[1] != 0) {
    uVar3 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar5 = (longlong *)*param_1;
      do {
        if (*plVar5 != 0) {
          lVar6 = ((longlong *)*param_1)[uVar3];
          goto LAB_14031a4b5;
        }
        uVar2 = (int)uVar3 + 1;
        uVar3 = (ulonglong)uVar2;
        plVar5 = plVar5 + 1;
      } while (uVar2 < *(uint *)(param_1 + 2));
    }
  }
  lVar6 = 0;
LAB_14031a4b5:
  do {
    do {
      lVar4 = lVar6;
      if (lVar4 == 0) {
        return 0;
      }
      puVar1 = *(undefined4 **)(lVar4 + 8);
      if ((puVar1[5] == param_2) && (puVar1[6] == param_3)) {
        return *puVar1;
      }
      lVar6 = *(longlong *)(lVar4 + 0x18);
    } while (lVar6 != 0);
    uVar2 = *(uint *)(lVar4 + 0x20) % *(uint *)(param_1 + 2) + 1;
    lVar4 = (longlong)(int)uVar2 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar2) break;
      if (*(longlong *)(lVar4 + *param_1) != 0) {
        lVar6 = *(longlong *)(lVar4 + *param_1);
      }
      uVar2 = uVar2 + 1;
      lVar4 = lVar4 + 8;
    } while (lVar6 == 0);
  } while( true );
}



void FUN_14031a540(longlong *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 *puVar8;
  undefined8 local_res8;
  undefined8 local_res10;
  undefined8 local_res18 [2];
  longlong local_30;
  longlong *local_28;
  
  puVar6 = (undefined8 *)0x0;
  local_res8 = 0;
  puVar8 = (undefined8 *)(param_2 + 0x1d0);
  if (7 < *(ulonglong *)(param_2 + 0x1e8)) {
    puVar8 = (undefined8 *)*puVar8;
  }
  puVar5 = puVar6;
  if (puVar8 != (undefined8 *)0x0) {
    puVar5 = (undefined8 *)
             FUN_140319b90(DAT_140608110,&local_res8,puVar8,param_4,0xfffffffffffffffe);
  }
  *param_1 = (longlong)puVar5;
  if (puVar5 != (undefined8 *)0x0) {
    *puVar5 = local_res8;
    local_res10 = 0;
    puVar8 = (undefined8 *)(param_2 + 0x180);
    if (7 < *(ulonglong *)(param_2 + 0x198)) {
      puVar8 = (undefined8 *)*puVar8;
    }
    puVar5 = puVar6;
    if (puVar8 != (undefined8 *)0x0) {
      puVar5 = (undefined8 *)FUN_140319960(DAT_140608110,&local_res10);
    }
    param_1[1] = (longlong)puVar5;
    if (puVar5 != (undefined8 *)0x0) {
      *puVar5 = local_res10;
      local_res18[0] = 0;
      puVar8 = (undefined8 *)(param_2 + 0x1f8);
      if (7 < *(ulonglong *)(param_2 + 0x210)) {
        puVar8 = (undefined8 *)*puVar8;
      }
      if (puVar8 != (undefined8 *)0x0) {
        puVar6 = (undefined8 *)FUN_140319dd0(DAT_140608110,local_res18);
      }
      uVar3 = local_res18[0];
      param_1[2] = (longlong)puVar6;
      if (puVar6 != (undefined8 *)0x0) {
        FUN_140319940(DAT_140608110,&local_30);
        if ((local_30 != 0) && (lVar7 = FUN_14031a410(local_30,(int)param_1[3]), lVar7 != 0)) {
          *(undefined4 *)(param_1 + 0x13) = *(undefined4 *)(lVar7 + 0x20);
        }
        plVar4 = local_28;
        *(undefined8 *)param_1[2] = uVar3;
        if (local_28 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_28 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_28 + 8))(local_28);
            LOCK();
            piVar2 = (int *)((longlong)plVar4 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*local_28 + 0x10))();
            }
          }
        }
      }
    }
  }
  return;
}



ulonglong FUN_14031a6a0(longlong param_1,short *param_2,char param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  uint uVar3;
  ulonglong uVar4;
  longlong *plVar5;
  ulonglong uVar6;
  uint *puVar7;
  longlong lVar8;
  short *psVar9;
  wchar_t *_Src;
  longlong *local_18;
  
  if (param_3 == '\0') {
    *(int *)(param_1 + 0x18) = (int)*param_2;
    *(int *)(param_1 + 0x1c) = (int)param_2[1];
    *(undefined8 *)(param_1 + 0x20) = *(undefined8 *)(param_2 + 2);
    *(undefined8 *)(param_1 + 0x28) = *(undefined8 *)(param_2 + 6);
    *(undefined8 *)(param_1 + 0x30) = *(undefined8 *)(param_2 + 10);
    *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(param_2 + 0xe);
    *(undefined4 *)(param_1 + 0x40) = *(undefined4 *)(param_2 + 0x12);
    uVar6 = 0xffffffffffffffff;
    psVar9 = param_2 + 0x14;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      sVar2 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x48,param_2 + 0x14,~uVar6 - 1,param_4,0xfffffffffffffffe);
    *(short *)(param_1 + 0x70) = param_2[0x24];
    *(undefined4 *)(param_1 + 0x74) = *(undefined4 *)(param_2 + 0x25);
    *(undefined4 *)(param_1 + 0x78) = *(undefined4 *)(param_2 + 0x27);
    *(undefined8 *)(param_1 + 0x80) = *(undefined8 *)(param_2 + 0x29);
    *(undefined4 *)(param_1 + 0x88) = *(undefined4 *)(param_2 + 0x2d);
    *(undefined4 *)(param_1 + 0x8c) = *(undefined4 *)(param_2 + 0x2f);
    *(undefined4 *)(param_1 + 0x90) = *(undefined4 *)(param_2 + 0x31);
    *(int *)(param_1 + 0x9c) = (int)param_2[0x33];
    *(undefined4 *)(param_1 + 0xa0) = *(undefined4 *)(param_2 + 0x34);
    *(undefined8 *)(param_1 + 0xa4) = *(undefined8 *)(param_2 + 0x36);
    *(undefined8 *)(param_1 + 0xac) = *(undefined8 *)(param_2 + 0x3a);
    *(undefined8 *)(param_1 + 0xb4) = *(undefined8 *)(param_2 + 0x3e);
    *(undefined8 *)(param_1 + 0xbc) = *(undefined8 *)(param_2 + 0x42);
    *(undefined8 *)(param_1 + 0xc4) = *(undefined8 *)(param_2 + 0x46);
    *(undefined8 *)(param_1 + 0xcc) = *(undefined8 *)(param_2 + 0x4a);
    *(undefined8 *)(param_1 + 0xd4) = *(undefined8 *)(param_2 + 0x4e);
    plVar5 = (longlong *)FUN_140319940(DAT_140608110);
    uVar3 = *(uint *)(param_1 + 0x18);
    uVar4 = (ulonglong)*(uint *)((longlong *)*plVar5 + 2);
    uVar6 = uVar3 / uVar4;
    lVar8 = *(longlong *)*plVar5;
    if (lVar8 != 0) {
      for (puVar7 = *(uint **)(lVar8 + ((ulonglong)uVar3 % uVar4) * 8); puVar7 != (uint *)0x0;
          puVar7 = *(uint **)(puVar7 + 6)) {
        if ((puVar7[8] == uVar3) && (*puVar7 == uVar3)) {
          if (puVar7 != (uint *)0x0) {
            if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            lVar8 = *(longlong *)(puVar7 + 2);
            goto LAB_14031a928;
          }
          break;
        }
      }
    }
    lVar8 = 0;
LAB_14031a928:
    if (local_18 != (longlong *)0x0) {
      LOCK();
      plVar5 = local_18 + 1;
      *(int *)plVar5 = (int)*plVar5 + -1;
      UNLOCK();
      if ((int)*plVar5 == 0) {
        uVar6 = (**(code **)(*local_18 + 8))(local_18);
        LOCK();
        piVar1 = (int *)((longlong)local_18 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          uVar6 = (**(code **)(*local_18 + 0x10))(local_18);
        }
      }
    }
    if (lVar8 != 0) {
      *(undefined4 *)(param_1 + 0x94) = *(undefined4 *)(lVar8 + 0x2c);
      uVar6 = FUN_14031a540(param_1,lVar8);
    }
  }
  else {
    *param_2 = *(short *)(param_1 + 0x18);
    param_2[1] = *(short *)(param_1 + 0x1c);
    *(undefined8 *)(param_2 + 2) = *(undefined8 *)(param_1 + 0x20);
    *(undefined8 *)(param_2 + 6) = *(undefined8 *)(param_1 + 0x28);
    *(undefined8 *)(param_2 + 10) = *(undefined8 *)(param_1 + 0x30);
    *(undefined8 *)(param_2 + 0xe) = *(undefined8 *)(param_1 + 0x38);
    *(undefined4 *)(param_2 + 0x12) = *(undefined4 *)(param_1 + 0x40);
    _Src = (wchar_t *)(param_1 + 0x48);
    if (7 < *(ulonglong *)(param_1 + 0x60)) {
      _Src = *(wchar_t **)_Src;
    }
    wcscpy_s(param_2 + 0x14,0x10,_Src);
    param_2[0x24] = *(short *)(param_1 + 0x70);
    *(undefined4 *)(param_2 + 0x25) = *(undefined4 *)(param_1 + 0x74);
    *(undefined4 *)(param_2 + 0x27) = *(undefined4 *)(param_1 + 0x78);
    *(undefined8 *)(param_2 + 0x29) = *(undefined8 *)(param_1 + 0x80);
    *(undefined4 *)(param_2 + 0x2d) = *(undefined4 *)(param_1 + 0x88);
    *(undefined4 *)(param_2 + 0x2f) = *(undefined4 *)(param_1 + 0x8c);
    *(undefined4 *)(param_2 + 0x31) = *(undefined4 *)(param_1 + 0x90);
    param_2[0x33] = *(short *)(param_1 + 0x9c);
    *(undefined4 *)(param_2 + 0x34) = *(undefined4 *)(param_1 + 0xa0);
    *(undefined8 *)(param_2 + 0x36) = *(undefined8 *)(param_1 + 0xa4);
    *(undefined8 *)(param_2 + 0x3a) = *(undefined8 *)(param_1 + 0xac);
    *(undefined8 *)(param_2 + 0x3e) = *(undefined8 *)(param_1 + 0xb4);
    *(undefined8 *)(param_2 + 0x42) = *(undefined8 *)(param_1 + 0xbc);
    *(undefined8 *)(param_2 + 0x46) = *(undefined8 *)(param_1 + 0xc4);
    *(undefined8 *)(param_2 + 0x4a) = *(undefined8 *)(param_1 + 0xcc);
    uVar6 = *(ulonglong *)(param_1 + 0xd4);
    *(ulonglong *)(param_2 + 0x4e) = uVar6;
  }
  return uVar6;
}



undefined4 FUN_14031a980(longlong param_1,longlong *param_2)

{
  uint uVar1;
  longlong *plVar2;
  uint *puVar3;
  int iVar4;
  longlong lVar5;
  undefined4 uVar6;
  
  plVar2 = (longlong *)*param_2;
  uVar6 = 0;
  if (plVar2 != (longlong *)0x0) {
    uVar1 = *(uint *)(param_1 + 0x18);
    if (*plVar2 != 0) {
      for (puVar3 = *(uint **)(*plVar2 + ((ulonglong)uVar1 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
          puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 6)) {
        if ((puVar3[8] == uVar1) && (*puVar3 == uVar1)) {
          if (puVar3 == (uint *)0x0) {
            return 0;
          }
          lVar5 = *(longlong *)(puVar3 + 2);
          if (lVar5 == 0) {
            return 0;
          }
          if (((*(int *)(lVar5 + 0x20) == 1) || (*(int *)(lVar5 + 0x20) == 2)) &&
             (*(int *)(lVar5 + 0x24) <= *(int *)(param_1 + 0x90))) {
            iVar4 = FUN_14031a450(plVar2,*(undefined4 *)(param_1 + 0x1c),
                                  *(int *)(param_1 + 0x74) + 1);
            if (iVar4 == 0) {
              return 0;
            }
            *(int *)(param_1 + 0x18) = iVar4;
            lVar5 = FUN_14031a410(*param_2,iVar4);
            if (lVar5 == 0) {
              return 0;
            }
            *(int *)(param_1 + 0x74) = *(int *)(param_1 + 0x74) + 1;
            iVar4 = *(int *)(lVar5 + 0x2c);
            if (*(int *)(lVar5 + 0x2c) < 0) {
              iVar4 = 0;
            }
            uVar6 = *(undefined4 *)(param_1 + 0x18);
            *(int *)(param_1 + 0x8c) = iVar4;
            *(undefined4 *)(param_1 + 0x94) = *(undefined4 *)(lVar5 + 0x2c);
          }
          return uVar6;
        }
      }
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_14031aa70(longlong param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int local_38;
  undefined8 local_34;
  undefined8 local_2c;
  undefined8 local_24;
  undefined4 local_1c;
  ulonglong local_18;
  
  piVar4 = &local_38;
  local_18 = DAT_1405d84f0 ^ (ulonglong)&local_38;
  iVar5 = 0;
  local_1c = 0;
  local_38 = *(int *)(param_1 + 0xa4);
  local_34 = *(undefined8 *)(param_1 + 0xa8);
  local_2c = *(undefined8 *)(param_1 + 0xb0);
  local_24 = *(undefined8 *)(param_1 + 0xb8);
  iVar3 = 0;
  iVar6 = -1;
  while( true ) {
    iVar1 = *piVar4;
    iVar2 = iVar1;
    iVar7 = iVar3;
    if (((iVar1 <= iVar5) && (iVar2 = iVar5, iVar7 = iVar6, iVar1 == iVar5)) && (iVar6 != -1))
    break;
    iVar5 = iVar2;
    iVar3 = iVar3 + 1;
    piVar4 = piVar4 + 1;
    iVar6 = iVar7;
    if (7 < iVar3) {
      return iVar7;
    }
  }
  return 7;
}



undefined4 FUN_14031ab40(longlong *param_1,uint param_2)

{
  longlong lVar1;
  uint *puVar2;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    if (*(longlong *)(lVar1 + 0x38) != 0) {
      for (puVar2 = *(uint **)(*(longlong *)(lVar1 + 0x38) +
                              ((ulonglong)param_2 % (ulonglong)*(uint *)(lVar1 + 0x48)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 6)) {
        if ((puVar2[8] == param_2) && (*puVar2 == param_2)) goto LAB_14031ab7c;
      }
    }
    puVar2 = (uint *)0x0;
LAB_14031ab7c:
    if ((puVar2 != (uint *)0x0) && (*(longlong *)(puVar2 + 2) != 0)) {
      return *(undefined4 *)(*(longlong *)(puVar2 + 2) + 0x30);
    }
  }
  return 0;
}



ulonglong FUN_14031aba0(longlong param_1,int param_2,undefined1 *param_3,int param_4)

{
  uint uVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  ulonglong uVar7;
  byte bVar8;
  int iVar9;
  longlong lVar10;
  longlong lVar11;
  
  bVar8 = 0;
  *param_3 = 0;
  if (param_4 == 3) {
    if ((DAT_14060b7f4 & 1) == 0) {
      DAT_14060b7f4 = DAT_14060b7f4 | 1;
      FUN_14015b4b0();
      atexit((_func_5014 *)&LAB_140448930);
    }
    if ((DAT_140609450 != 0) &&
       (uVar1 = *(int *)(param_1 + 0x5c) + 1, (int)DAT_140609450 < (int)uVar1)) goto LAB_14031ac18;
  }
  if ((DAT_14060b7f4 & 1) == 0) {
    DAT_14060b7f4 = DAT_14060b7f4 | 1;
    FUN_14015b4b0();
    atexit((_func_5014 *)&LAB_140448930);
  }
  if ((DAT_140609430 == 0) || (uVar1 = *(int *)(param_1 + 0x5c) + 1, (int)uVar1 <= DAT_140609430)) {
    do {
      lVar2 = FUN_140314400(DAT_140608098,*(undefined4 *)(param_1 + 0x5c));
      lVar3 = 0;
      if (1 < *(int *)(param_1 + 0x5c)) {
        lVar3 = FUN_140314400(DAT_140608098,*(int *)(param_1 + 0x5c) + -1);
      }
      lVar4 = *(longlong *)(param_1 + 0x60);
      if (lVar2 < *(longlong *)(param_1 + 0x60)) {
        lVar4 = lVar2;
      }
      *(longlong *)(param_1 + 0x60) = lVar4;
      lVar5 = (longlong)param_2;
      if (lVar2 < lVar4 + lVar5) {
        lVar5 = lVar2 - lVar4;
        param_2 = param_2 + ((int)lVar4 - (int)lVar2);
      }
      else {
        param_2 = 0;
      }
      *(longlong *)(param_1 + 0x60) = lVar4 + lVar5;
      lVar10 = lVar2 - lVar3;
      if (lVar10 < 1) {
LAB_14031ada3:
        return (ulonglong)bVar8;
      }
      lVar6 = (longlong)(*(int *)(param_1 + 0x5c) + 0x13);
      lVar11 = (lVar4 - lVar3) * lVar6;
      uVar7 = lVar11 % lVar10;
      iVar9 = (int)((((lVar4 + lVar5) - lVar3) * lVar6) / lVar10) - (int)(lVar11 / lVar10);
      *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + iVar9;
      *(int *)(param_1 + 0x70) = *(int *)(param_1 + 0x70) + iVar9;
      *param_3 = 0 < iVar9;
      if (*(longlong *)(param_1 + 0x60) < lVar2) goto LAB_14031ada3;
      *(int *)(param_1 + 0x5c) = *(int *)(param_1 + 0x5c) + 1;
      if (param_4 == 3) {
        if ((DAT_14060b7f4 & 1) == 0) {
          DAT_14060b7f4 = DAT_14060b7f4 | 1;
          FUN_14015b4b0(DAT_14060b7f4,uVar7);
          atexit((_func_5014 *)&LAB_140448930);
        }
        uVar7 = (ulonglong)DAT_140609450;
        if ((DAT_140609450 != 0) &&
           (iVar9 = *(int *)(param_1 + 0x5c) + 1, (int)DAT_140609450 < iVar9)) break;
      }
      if ((DAT_14060b7f4 & 1) == 0) {
        DAT_14060b7f4 = DAT_14060b7f4 | 1;
        FUN_14015b4b0(DAT_14060b7f4,uVar7);
        atexit((_func_5014 *)&LAB_140448930);
      }
      bVar8 = 1;
    } while ((DAT_140609430 == 0) ||
            (bVar8 = 1, iVar9 = DAT_140609430, *(int *)(param_1 + 0x5c) <= DAT_140609430));
    return CONCAT71((uint7)(uint3)((uint)iVar9 >> 8),1);
  }
LAB_14031ac18:
  return (ulonglong)(uVar1 >> 8) << 8;
}



void FUN_14031adc0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  int *piVar4;
  longlong lVar5;
  int *piVar6;
  
  piVar6 = (int *)(param_1 + 0xd4);
  lVar5 = 10;
  do {
    if (*piVar6 != 0) {
      piVar4 = (int *)param_2[1];
      if ((piVar6 < piVar4) && ((int *)*param_2 <= piVar6)) {
        lVar3 = (longlong)piVar6 - *param_2;
        lVar3 = lVar3 / 6 + (lVar3 >> 0x3f);
        lVar3 = (lVar3 >> 1) - (lVar3 >> 0x3f);
        if (piVar4 == (int *)param_2[2]) {
          FUN_1400565a0(param_2,1);
        }
        piVar4 = (int *)param_2[1];
        lVar1 = *param_2;
        if (piVar4 != (int *)0x0) {
          *piVar4 = *(int *)(lVar1 + lVar3 * 0xc);
          piVar4[1] = *(int *)(lVar1 + 4 + lVar3 * 0xc);
          iVar2 = *(int *)(lVar1 + 8 + lVar3 * 0xc);
LAB_14031ae8a:
          piVar4[2] = iVar2;
        }
      }
      else {
        if (piVar4 == (int *)param_2[2]) {
          FUN_1400565a0(param_2,1);
        }
        piVar4 = (int *)param_2[1];
        if (piVar4 != (int *)0x0) {
          *piVar4 = *piVar6;
          piVar4[1] = piVar6[1];
          iVar2 = piVar6[2];
          goto LAB_14031ae8a;
        }
      }
      param_2[1] = param_2[1] + 0xc;
    }
    piVar6 = piVar6 + 3;
    lVar5 = lVar5 + -1;
    if (lVar5 == 0) {
      return;
    }
  } while( true );
}



longlong FUN_14031aec0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong *plVar2;
  uint *puVar3;
  uint uVar4;
  ulonglong uVar5;
  
  uVar5 = 0;
  puVar3 = (uint *)(param_1 + 0xd4);
  do {
    uVar4 = *puVar3;
    if (uVar4 != 0) {
      plVar2 = (longlong *)FUN_1403161f0();
      if (*plVar2 != 0) {
        for (puVar1 = *(uint **)(*plVar2 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(plVar2 + 2)) * 8
                                ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xe8)) {
          if ((puVar1[0xea] == uVar4) && (*puVar1 == uVar4)) {
            if (puVar1 != (uint *)0x0) {
              uVar4 = puVar1[5];
              goto LAB_14031af2b;
            }
            break;
          }
        }
      }
      uVar4 = 0xffffffff;
LAB_14031af2b:
      if (param_2 == uVar4) {
        return param_1 + 0xd4 + uVar5 * 0xc;
      }
    }
    uVar4 = (int)uVar5 + 1;
    uVar5 = (ulonglong)uVar4;
    puVar3 = puVar3 + 3;
    if (9 < uVar4) {
      return 0;
    }
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x00014031afe3)
// WARNING: Removing unreachable block (ram,0x00014031afec)
// WARNING: Removing unreachable block (ram,0x00014031b00a)
// WARNING: Removing unreachable block (ram,0x00014031b013)

undefined8 * FUN_14031af70(undefined8 *param_1)

{
  *param_1 = 0;
  *(undefined4 *)(param_1 + 1) = 0;
  param_1[5] = 7;
  param_1[4] = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  *(undefined4 *)(param_1 + 9) = 0x11;
  *(undefined4 *)(param_1 + 0xd) = 0;
  *(undefined4 *)((longlong)param_1 + 0x6c) = 10;
  param_1[0xe] = 0;
  param_1[0xf] = 0;
  *(undefined4 *)((longlong)param_1 + 0x4c) = 0x3f400000;
  *(undefined4 *)(param_1 + 10) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x54) = 0x40100000;
  param_1[0xb] = 0x26;
  param_1[0xc] = 0;
  return param_1;
}



undefined8 FUN_14031b030(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  short sVar4;
  undefined4 uVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  undefined8 *puVar10;
  undefined4 *puVar11;
  short *psVar12;
  longlong lVar13;
  undefined8 uVar14;
  ulonglong uVar15;
  longlong *plVar16;
  undefined8 *puVar17;
  short *psVar18;
  undefined8 *puVar19;
  undefined8 *local_50;
  longlong *local_48;
  undefined8 *local_40;
  undefined1 local_30 [16];
  longlong *local_20;
  undefined8 *puVar9;
  
  uVar15 = 0xffffffffffffffff;
  psVar18 = param_2;
  do {
    if (uVar15 == 0) break;
    uVar15 = uVar15 - 1;
    sVar4 = *psVar18;
    psVar18 = psVar18 + 1;
  } while (sVar4 != 0);
  FUN_140001710(param_1 + 0x10,param_2,~uVar15 - 1);
  lVar8 = FUN_1402933b0(DAT_140607ff0,param_2);
  uVar14 = 0;
  if (lVar8 != 0) {
    puVar17 = (undefined8 *)0x0;
    puVar19 = puVar17;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar9 = puVar17;
      plVar16 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar16 != 0) {
          puVar19 = (undefined8 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar9];
          break;
        }
        uVar6 = (int)puVar9 + 1;
        puVar9 = (undefined8 *)(ulonglong)uVar6;
        plVar16 = plVar16 + 1;
      } while (uVar6 < *(uint *)(lVar8 + 0x78));
    }
LAB_14031b0d0:
    if (puVar19 != (undefined8 *)0x0) {
      uVar5 = *(undefined4 *)puVar19;
      local_40 = puVar19;
      puVar10 = operator_new(0x88);
      puVar9 = puVar17;
      if (puVar10 != (undefined8 *)0x0) {
        *puVar10 = 0;
        puVar10[1] = 0;
        puVar10[2] = 0;
        puVar10[3] = 0;
        puVar10[4] = 0;
        puVar10[5] = 0;
        puVar10[6] = 0;
        puVar10[10] = 7;
        puVar10[9] = 0;
        *(undefined2 *)(puVar10 + 7) = 0;
        puVar10[0xf] = 7;
        puVar10[0xe] = 0;
        *(undefined2 *)(puVar10 + 0xc) = 0;
        puVar9 = puVar10;
      }
      local_50 = puVar9;
      FUN_14031b750(&local_48,puVar9);
      FUN_140178e90(&local_50,puVar9,puVar9);
      uVar7 = FUN_1402970c0(lVar8,&DAT_14049f290);
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,&DAT_14049f290,1);
      *(undefined4 *)local_50 = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nRewardType");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nRewardType",1);
      *(undefined4 *)((longlong)local_50 + 4) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nLevel");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nLevel",1);
      *(undefined4 *)(local_50 + 1) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nMinScore");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nMinScore",1);
      *(undefined4 *)((longlong)local_50 + 0xc) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nMaxScore");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nMaxScore",1);
      *(undefined4 *)(local_50 + 2) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nVitalValue");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nVitalValue",1);
      *(undefined4 *)((longlong)local_50 + 0x14) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nIntelligenceValue");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nIntelligenceValue",1);
      *(undefined4 *)(local_50 + 3) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nStrengthValue");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nStrengthValue",1);
      *(undefined4 *)((longlong)local_50 + 0x1c) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nTemperValue");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nTemperValue",1);
      *(undefined4 *)(local_50 + 4) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nCharmValue");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nCharmValue",1);
      *(undefined4 *)((longlong)local_50 + 0x24) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nResilientValue");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nResilientValue",0);
      if (puVar11 == (undefined4 *)0x0) {
        *(undefined4 *)(local_50 + 5) = 0;
      }
      else {
        *(undefined4 *)(local_50 + 5) = *puVar11;
      }
      uVar7 = FUN_1402970c0(lVar8,L"nEloquenceValue");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nEloquenceValue",0);
      if (puVar11 == (undefined4 *)0x0) {
        *(undefined4 *)((longlong)local_50 + 0x2c) = 0;
      }
      else {
        *(undefined4 *)((longlong)local_50 + 0x2c) = *puVar11;
      }
      uVar7 = FUN_1402970c0(lVar8,L"nRewardItemGroup");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nRewardItemGroup",1);
      *(undefined4 *)(local_50 + 6) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nStringID");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nStringID",1);
      *(undefined4 *)((longlong)local_50 + 0x34) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"wszRewardName");
      psVar12 = (short *)FUN_140296b70(lVar8,uVar5,uVar7,L"wszRewardName",1);
      uVar15 = 0xffffffffffffffff;
      psVar18 = psVar12;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar4 = *psVar18;
        psVar18 = psVar18 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_50 + 7,psVar12,~uVar15 - 1);
      uVar7 = FUN_1402970c0(lVar8,L"szEndingSWF");
      psVar12 = (short *)FUN_140296990(lVar8,uVar5,uVar7,L"szEndingSWF",1);
      uVar15 = 0xffffffffffffffff;
      psVar18 = psVar12;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar4 = *psVar18;
        psVar18 = psVar18 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_50 + 0xc,psVar12,~uVar15 - 1);
      puVar11 = (undefined4 *)FUN_140342d30(local_30,local_50,&local_50);
      FUN_14030e3c0(param_1 + 0x38,*puVar11,puVar11 + 2);
      plVar16 = local_20;
      if (local_20 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_20 + 1;
        lVar13 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar19 = local_40;
        if ((int)lVar13 == 1) {
          (**(code **)(*local_20 + 8))(local_20);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar19 = local_40;
          if (iVar3 == 1) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar19 = local_40;
          }
        }
      }
      plVar16 = local_48;
      puVar9 = puVar19;
      if (local_48 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_48 + 1;
        lVar13 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar9 = local_40;
        if ((int)lVar13 == 1) {
          (**(code **)(*local_48 + 8))(local_48);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar9 = local_40;
          if (iVar3 == 1) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar9 = local_40;
          }
        }
      }
      puVar19 = (undefined8 *)puVar9[3];
      if (puVar19 == (undefined8 *)0x0) {
        uVar6 = *(uint *)(puVar9 + 4) % *(uint *)(lVar8 + 0x78) + 1;
        lVar13 = (longlong)(int)uVar6 << 3;
        puVar19 = puVar17;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar6) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar13) != 0) {
            puVar19 = *(undefined8 **)(*(longlong *)(lVar8 + 0x68) + lVar13);
          }
          uVar6 = uVar6 + 1;
          lVar13 = lVar13 + 8;
        } while (puVar19 == (undefined8 *)0x0);
      }
      goto LAB_14031b0d0;
    }
    uVar14 = 1;
  }
  return uVar14;
}



undefined4 FUN_14031b5e0(longlong param_1,longlong param_2,undefined4 param_3)

{
  undefined4 *puVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  bool bVar7;
  
  if (*(longlong *)(param_1 + 0x40) != 0) {
    uVar3 = 0;
    if (*(uint *)(param_1 + 0x48) != 0) {
      plVar5 = *(longlong **)(param_1 + 0x38);
      do {
        if (*plVar5 != 0) {
          lVar6 = (*(longlong **)(param_1 + 0x38))[uVar3];
          goto LAB_14031b630;
        }
        uVar2 = (int)uVar3 + 1;
        uVar3 = (ulonglong)uVar2;
        plVar5 = plVar5 + 1;
      } while (uVar2 < *(uint *)(param_1 + 0x48));
    }
  }
  lVar6 = 0;
LAB_14031b630:
  do {
    lVar4 = lVar6;
    if (lVar4 == 0) {
      return 0;
    }
    puVar1 = *(undefined4 **)(lVar4 + 8);
    if ((param_2 < (int)puVar1[3]) || ((int)puVar1[4] < param_2)) goto switchD_14031b65e_default;
    switch(param_3) {
    case 0:
      bVar7 = puVar1[5] == 1;
      break;
    case 1:
      bVar7 = puVar1[6] == 1;
      break;
    case 2:
      bVar7 = puVar1[7] == 1;
      break;
    case 3:
      bVar7 = puVar1[8] == 1;
      break;
    case 4:
      bVar7 = puVar1[9] == 1;
      break;
    case 5:
      bVar7 = puVar1[10] == 1;
      break;
    case 6:
      bVar7 = puVar1[0xb] == 1;
      break;
    case 7:
      if ((((puVar1[5] == 0) && (puVar1[6] == 0)) && (puVar1[7] == 0)) &&
         (((puVar1[8] == 0 && (puVar1[9] == 0)) && (puVar1[10] == 0)))) {
        bVar7 = puVar1[0xb] == 0;
        break;
      }
    default:
      goto switchD_14031b65e_default;
    }
    if (bVar7) {
      return *puVar1;
    }
switchD_14031b65e_default:
    lVar6 = *(longlong *)(lVar4 + 0x18);
    if (lVar6 == 0) {
      uVar2 = *(uint *)(lVar4 + 0x20) % *(uint *)(param_1 + 0x48) + 1;
      lVar4 = (longlong)(int)uVar2 << 3;
      do {
        if (*(uint *)(param_1 + 0x48) <= uVar2) break;
        if (*(longlong *)(lVar4 + *(longlong *)(param_1 + 0x38)) != 0) {
          lVar6 = *(longlong *)(lVar4 + *(longlong *)(param_1 + 0x38));
        }
        uVar2 = uVar2 + 1;
        lVar4 = lVar4 + 8;
      } while (lVar6 == 0);
    }
  } while( true );
}



undefined8 * FUN_14031b750(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;
}



void FUN_14031b7c0(longlong param_1)

{
  FUN_14031b7d0(*(undefined8 *)(param_1 + 0x10));
  return;
}



void FUN_14031b7d0(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)param_1 + 0x78)) {
      operator_delete(*(void **)((longlong)param_1 + 0x60));
    }
    *(undefined8 *)((longlong)param_1 + 0x78) = 7;
    *(undefined8 *)((longlong)param_1 + 0x70) = 0;
    *(undefined2 *)((longlong)param_1 + 0x60) = 0;
    if (7 < *(ulonglong *)((longlong)param_1 + 0x50)) {
      operator_delete(*(void **)((longlong)param_1 + 0x38));
    }
    *(undefined8 *)((longlong)param_1 + 0x50) = 7;
    *(undefined8 *)((longlong)param_1 + 0x48) = 0;
    *(undefined2 *)((longlong)param_1 + 0x38) = 0;
    operator_delete(param_1);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014031b908)
// WARNING: Removing unreachable block (ram,0x00014031b911)
// WARNING: Removing unreachable block (ram,0x00014031b932)
// WARNING: Removing unreachable block (ram,0x00014031b93b)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14031b840(void)

{
  undefined8 in_R9;
  
  FUN_14031e3e0(0x3f400000,0x3e800000,0x40100000,in_R9,0xfffffffffffffffe);
  DAT_140608488 = 0;
  _DAT_140608490 = 0;
  DAT_140608498 = 0x11;
  _DAT_1406084b8 = 0;
  _DAT_1406084bc = 10;
  _DAT_1406084c0 = 0;
  _DAT_1406084c8 = 0;
  _DAT_14060849c = 0x3f400000;
  _DAT_1406084a0 = 0x3e800000;
  _DAT_1406084a4 = 0x40100000;
  _DAT_1406084a8 = 0x26;
  _DAT_1406084b0 = 0;
  FUN_14031b990();
  return &DAT_140608440;
}



void thunk_FUN_14031e570(void)

{
  FUN_14031e570();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14031b990(void)

{
  ulonglong *puVar1;
  short sVar2;
  undefined4 uVar3;
  int iVar4;
  code *pcVar5;
  char cVar6;
  uint uVar7;
  undefined4 uVar8;
  longlong lVar9;
  int *piVar11;
  short *psVar12;
  undefined8 *puVar13;
  uint *puVar14;
  undefined4 *puVar15;
  longlong lVar16;
  longlong *plVar17;
  undefined4 *puVar18;
  undefined4 *puVar19;
  undefined4 *puVar20;
  ulonglong uVar21;
  undefined4 *puVar22;
  short *psVar23;
  undefined1 auStack_658 [32];
  undefined1 local_638;
  undefined4 local_628 [2];
  undefined8 *local_620;
  undefined8 *local_618;
  undefined8 local_610;
  undefined4 local_608;
  uint local_604;
  undefined4 local_600;
  undefined8 **local_5f8;
  undefined8 **local_5f0;
  undefined8 **local_5e8;
  undefined8 *local_5d8;
  undefined8 *local_5d0;
  undefined8 *local_5c8;
  undefined2 local_5b8 [8];
  undefined8 local_5a8;
  undefined8 local_5a0;
  undefined2 local_590 [8];
  undefined8 local_580;
  undefined8 local_578;
  undefined2 local_568 [8];
  undefined8 local_558;
  undefined8 local_550;
  undefined8 local_538 [2];
  longlong local_528;
  ulonglong local_520;
  undefined4 local_508;
  undefined1 local_500 [200];
  undefined1 local_438 [512];
  undefined1 local_238 [512];
  ulonglong local_38;
  undefined4 *puVar10;
  
  local_610 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_658;
  lVar9 = FUN_1402933b0(DAT_140607ff0,L"FORTUNE");
  if (lVar9 != 0) {
    puVar20 = (undefined4 *)0x0;
    puVar15 = puVar20;
    if ((*(longlong *)(lVar9 + 0x70) != 0) && (*(uint *)(lVar9 + 0x78) != 0)) {
      puVar10 = puVar20;
      plVar17 = *(longlong **)(lVar9 + 0x68);
      do {
        if (*plVar17 != 0) {
          puVar15 = (undefined4 *)(*(longlong **)(lVar9 + 0x68))[(longlong)puVar10];
          break;
        }
        uVar7 = (int)puVar10 + 1;
        puVar10 = (undefined4 *)(ulonglong)uVar7;
        plVar17 = plVar17 + 1;
      } while (uVar7 < *(uint *)(lVar9 + 0x78));
    }
LAB_14031ba22:
    puVar10 = puVar15;
    if (puVar10 != (undefined4 *)0x0) {
      uVar3 = *puVar10;
      local_5f8 = (undefined8 **)0x0;
      local_5f0 = (undefined8 **)0x0;
      local_5e8 = (undefined8 **)0x0;
      local_5d8 = (undefined8 *)0x0;
      local_5d0 = (undefined8 *)0x0;
      local_5c8 = (undefined8 *)0x0;
      local_5a0 = 7;
      local_5a8 = 0;
      local_5b8[0] = 0;
      local_578 = 7;
      local_580 = 0;
      local_590[0] = 0;
      local_550 = 7;
      local_558 = 0;
      local_568[0] = 0;
      puVar15 = puVar20;
      local_628[0] = uVar3;
      do {
        FUN_14012f380(local_438,L"nAddEffectID%02d",puVar15);
        uVar8 = FUN_1402970c0(lVar9,local_438);
        local_638 = 1;
        piVar11 = (int *)FUN_140296600(lVar9,uVar3,uVar8,local_438);
        iVar4 = *piVar11;
        local_620 = (undefined8 *)CONCAT44(local_620._4_4_,iVar4);
        if (0 < iVar4) {
          if ((&local_620 < local_5f0) && (local_5f8 <= &local_620)) {
            lVar16 = (longlong)&local_620 - (longlong)local_5f8;
            if (local_5f0 == local_5e8) {
              uVar21 = (longlong)local_5f0 - (longlong)local_5f8 >> 2;
              if (0x3ffffffffffffffe < uVar21) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              puVar22 = (undefined4 *)(uVar21 + 1);
              puVar18 = (undefined4 *)((longlong)local_5e8 - (longlong)local_5f8 >> 2);
              if (puVar18 < puVar22) {
                puVar19 = puVar20;
                if (puVar18 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar18 >> 1))) {
                  puVar19 = (undefined4 *)((longlong)puVar18 + ((ulonglong)puVar18 >> 1));
                }
                if (puVar19 < puVar22) {
                  puVar19 = puVar22;
                }
                FUN_140051e60(&local_5f8,puVar19);
              }
            }
            if (local_5f0 != (undefined8 **)0x0) {
              *(int *)local_5f0 = *(int *)((longlong)local_5f8 + (lVar16 >> 2) * 4);
            }
          }
          else {
            if (local_5f0 == local_5e8) {
              uVar21 = (longlong)local_5f0 - (longlong)local_5f8 >> 2;
              if (0x3ffffffffffffffe < uVar21) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14031c203;
              }
              puVar22 = (undefined4 *)(uVar21 + 1);
              puVar18 = (undefined4 *)((longlong)local_5e8 - (longlong)local_5f8 >> 2);
              if (puVar18 < puVar22) {
                puVar19 = puVar20;
                if (puVar18 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar18 >> 1))) {
                  puVar19 = (undefined4 *)((longlong)puVar18 + ((ulonglong)puVar18 >> 1));
                }
                if (puVar19 < puVar22) {
                  puVar19 = puVar22;
                }
                FUN_140051e60(&local_5f8,puVar19);
              }
            }
            if (local_5f0 != (undefined8 **)0x0) {
              *(int *)local_5f0 = iVar4;
            }
          }
          local_5f0 = (undefined8 **)((longlong)local_5f0 + 4);
        }
        FUN_14012f380(local_238,L"wszAddEffectDesc%02d",puVar15);
        uVar8 = FUN_1402970c0(lVar9,local_238);
        local_638 = 1;
        psVar12 = (short *)FUN_140296b70(lVar9,uVar3,uVar8,local_238);
        local_520 = 7;
        local_528 = 0;
        local_538[0]._0_2_ = 0;
        uVar21 = 0xffffffffffffffff;
        psVar23 = psVar12;
        do {
          if (uVar21 == 0) break;
          uVar21 = uVar21 - 1;
          sVar2 = *psVar23;
          psVar23 = psVar23 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_538,psVar12,~uVar21 - 1);
        if (local_528 != 0) {
          if ((local_538 < local_5d0) && (local_5d8 <= local_538)) {
            lVar16 = (longlong)local_538 - (longlong)local_5d8;
            if (local_5d0 == local_5c8) {
              uVar21 = ((longlong)local_5d0 - (longlong)local_5d8) / 0x28;
              if (0x666666666666665 < uVar21) {
LAB_14031c203:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                (*pcVar5)();
                return;
              }
              puVar22 = (undefined4 *)(uVar21 + 1);
              puVar18 = (undefined4 *)(((longlong)local_5c8 - (longlong)local_5d8) / 0x28);
              if (puVar18 < puVar22) {
                puVar19 = puVar20;
                if (puVar18 <= (undefined4 *)(0x666666666666666 - ((ulonglong)puVar18 >> 1))) {
                  puVar19 = (undefined4 *)((longlong)puVar18 + ((ulonglong)puVar18 >> 1));
                }
                if (puVar19 < puVar22) {
                  puVar19 = puVar22;
                }
                FUN_14008eb00(&local_5d8,puVar19);
              }
            }
            local_620 = local_5d0;
            local_618 = local_5d0;
            if (local_5d0 != (undefined8 *)0x0) {
              local_5d0[3] = 7;
              local_5d0[2] = 0;
              puVar13 = local_5d0;
              if (7 < (ulonglong)local_5d0[3]) {
                puVar13 = (undefined8 *)*local_5d0;
              }
              *(undefined2 *)puVar13 = 0;
              FUN_1400015e0(local_5d0,local_5d8 + (lVar16 / 0x28) * 5,0,0xffffffffffffffff);
            }
          }
          else {
            if (local_5d0 == local_5c8) {
              uVar21 = ((longlong)local_5d0 - (longlong)local_5d8) / 0x28;
              if (0x666666666666665 < uVar21) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14031c21f;
              }
              puVar22 = (undefined4 *)(uVar21 + 1);
              puVar18 = (undefined4 *)(((longlong)local_5c8 - (longlong)local_5d8) / 0x28);
              if (puVar18 < puVar22) {
                puVar19 = puVar20;
                if (puVar18 <= (undefined4 *)(0x666666666666666 - ((ulonglong)puVar18 >> 1))) {
                  puVar19 = (undefined4 *)((longlong)puVar18 + ((ulonglong)puVar18 >> 1));
                }
                if (puVar19 < puVar22) {
                  puVar19 = puVar22;
                }
                FUN_14008eb00(&local_5d8,puVar19);
              }
            }
            local_620 = local_5d0;
            local_618 = local_5d0;
            if (local_5d0 != (undefined8 *)0x0) {
              local_5d0[3] = 7;
              local_5d0[2] = 0;
              puVar13 = local_5d0;
              if (7 < (ulonglong)local_5d0[3]) {
                puVar13 = (undefined8 *)*local_5d0;
              }
              *(undefined2 *)puVar13 = 0;
              FUN_1400015e0(local_5d0,local_538,0,0xffffffffffffffff);
            }
          }
          local_5d0 = local_5d0 + 5;
        }
        if (7 < local_520) {
          operator_delete((void *)CONCAT62(local_538[0]._2_6_,(undefined2)local_538[0]));
        }
        uVar7 = (int)puVar15 + 1;
        puVar15 = (undefined4 *)(ulonglong)uVar7;
      } while ((int)uVar7 < 3);
      local_608 = uVar3;
      uVar8 = FUN_1402970c0(lVar9,L"nFortuneType");
      local_638 = 1;
      puVar14 = (uint *)FUN_140296600(lVar9,uVar3,uVar8,L"nFortuneType");
      local_604 = *puVar14;
      uVar8 = FUN_1402970c0(lVar9,L"nFortuneProbability");
      local_638 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar9,uVar3,uVar8,L"nFortuneProbability");
      local_600 = *puVar15;
      uVar8 = FUN_1402970c0(lVar9,L"wszImage");
      local_638 = 1;
      psVar12 = (short *)FUN_140296b70(lVar9,uVar3,uVar8,L"wszImage");
      uVar21 = 0xffffffffffffffff;
      psVar23 = psVar12;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar2 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_5b8,psVar12,~uVar21 - 1);
      uVar8 = FUN_1402970c0(lVar9,L"wszDesc");
      local_638 = 1;
      psVar12 = (short *)FUN_140296b70(lVar9,uVar3,uVar8,L"wszDesc");
      uVar21 = 0xffffffffffffffff;
      psVar23 = psVar12;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar2 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_590,psVar12,~uVar21 - 1);
      uVar8 = FUN_1402970c0(lVar9,L"wszFortuneRollDesc");
      local_638 = 1;
      psVar12 = (short *)FUN_140296b70(lVar9,uVar3,uVar8,L"wszFortuneRollDesc");
      uVar21 = 0xffffffffffffffff;
      psVar23 = psVar12;
      do {
        if (uVar21 == 0) break;
        uVar21 = uVar21 - 1;
        sVar2 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_568,psVar12,~uVar21 - 1);
      local_508 = local_608;
      FUN_14031f1f0(local_500,&local_608);
      FUN_14031e4b0(local_508);
      FUN_14031c280(local_500);
      uVar7 = local_604;
      uVar21 = (ulonglong)local_604 % (ulonglong)DAT_140608498;
      if (DAT_140608488 == 0) {
        cVar6 = FUN_1402c6d50(&DAT_140608488,(ulonglong)DAT_140608498,1);
        if (cVar6 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar14 = *(uint **)(DAT_140608488 + uVar21 * 8); puVar14 != (uint *)0x0;
            puVar14 = *(uint **)(puVar14 + 10)) {
          if ((puVar14[0xc] == local_604) && (*puVar14 == local_604)) goto LAB_14031c078;
        }
      }
      puVar14 = (uint *)FUN_1402da9c0(&DAT_140608488,uVar7,uVar21,uVar7);
LAB_14031c078:
      puVar1 = (ulonglong *)(puVar14 + 2);
      puVar15 = *(undefined4 **)(puVar14 + 4);
      if ((local_628 < puVar15) && (puVar18 = (undefined4 *)*puVar1, puVar18 <= local_628)) {
        if (puVar15 == *(undefined4 **)(puVar14 + 6)) {
          uVar21 = (longlong)puVar15 - (longlong)puVar18 >> 2;
          if (0x3ffffffffffffffe < uVar21) {
LAB_14031c21f:
            std::_Xlength_error("vector<T> too long");
            pcVar5 = (code *)swi(3);
            (*pcVar5)();
            return;
          }
          if ((ulonglong)((longlong)*(undefined4 **)(puVar14 + 6) - (longlong)puVar18 >> 2) <
              uVar21 + 1) {
            FUN_140051e60(puVar1);
          }
        }
        if (*(undefined4 **)(puVar14 + 4) != (undefined4 *)0x0) {
          **(undefined4 **)(puVar14 + 4) =
               *(undefined4 *)(*puVar1 + ((longlong)local_628 - (longlong)puVar18 >> 2) * 4);
        }
      }
      else {
        if (puVar15 == *(undefined4 **)(puVar14 + 6)) {
          uVar21 = (longlong)((longlong)puVar15 - *puVar1) >> 2;
          if (0x3ffffffffffffffe < uVar21) {
            std::_Xlength_error("vector<T> too long");
            pcVar5 = (code *)swi(3);
            (*pcVar5)();
            return;
          }
          if ((ulonglong)((longlong)((longlong)*(undefined4 **)(puVar14 + 6) - *puVar1) >> 2) <
              uVar21 + 1) {
            FUN_140051e60(puVar1);
          }
        }
        if (*(undefined4 **)(puVar14 + 4) != (undefined4 *)0x0) {
          **(undefined4 **)(puVar14 + 4) = uVar3;
        }
      }
      *(longlong *)(puVar14 + 4) = *(longlong *)(puVar14 + 4) + 4;
      FUN_14031c280(&local_608);
      puVar15 = *(undefined4 **)(puVar10 + 6);
      if (*(undefined4 **)(puVar10 + 6) == (undefined4 *)0x0) {
        uVar7 = (uint)puVar10[8] % *(uint *)(lVar9 + 0x78) + 1;
        lVar16 = (longlong)(int)uVar7 << 3;
        puVar15 = puVar20;
        do {
          if (*(uint *)(lVar9 + 0x78) <= uVar7) break;
          if (*(longlong *)(lVar16 + *(longlong *)(lVar9 + 0x68)) != 0) {
            puVar15 = *(undefined4 **)(lVar16 + *(longlong *)(lVar9 + 0x68));
          }
          uVar7 = uVar7 + 1;
          lVar16 = lVar16 + 8;
        } while (puVar15 == (undefined4 *)0x0);
      }
      goto LAB_14031ba22;
    }
  }
  return;
}



void FUN_14031c280(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0xb8)) {
    operator_delete(*(void **)(param_1 + 0xa0));
  }
  *(undefined8 *)(param_1 + 0xb8) = 7;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined2 *)(param_1 + 0xa0) = 0;
  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 (*(longlong *)(param_1 + 0x30) != 0) {
    FUN_14008d0a0(*(longlong *)(param_1 + 0x30),*(undefined8 *)(param_1 + 0x38));
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  if (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_14031c360(longlong param_1)

{
  FUN_14031c280(param_1 + 8);
  return;
}



undefined8 * FUN_14031c370(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetFortuneDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf18 & 1) == 0) {
    DAT_14060cf18 = DAT_14060cf18 | 1;
    FUN_14031b840();
    atexit(FUN_140449120);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetFortuneDB",uVar3,pcVar4,DVar5);
  }
  return &DAT_140608440;
}



void thunk_FUN_14031e720(void)

{
  FUN_14031e720();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14031c410(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined4 *puVar6;
  undefined8 *puVar7;
  undefined4 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  int iVar11;
  undefined4 *puVar12;
  undefined1 auStack_d8 [32];
  undefined1 local_b8;
  undefined8 local_a8;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80 [7];
  undefined4 auStack_64 [5];
  ulonglong local_50;
  ulonglong local_28;
  
  local_a8 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_d8;
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"EventCoupon");
  if (lVar4 != 0) {
    if (*(longlong *)(lVar4 + 0x70) != 0) {
      uVar5 = 0;
      if (*(uint *)(lVar4 + 0x78) != 0) {
        plVar10 = *(longlong **)(lVar4 + 0x68);
        do {
          if (*plVar10 != 0) {
            puVar6 = (undefined4 *)(*(longlong **)(lVar4 + 0x68))[uVar5];
            goto LAB_14031c4a0;
          }
          uVar2 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar2;
          plVar10 = plVar10 + 1;
        } while (uVar2 < *(uint *)(lVar4 + 0x78));
      }
    }
    puVar6 = (undefined4 *)0x0;
LAB_14031c4a0:
    puVar12 = puVar6;
    if (puVar12 != (undefined4 *)0x0) {
      uVar1 = *puVar12;
      uVar3 = FUN_1402970c0(lVar4,&DAT_14049f290);
      local_b8 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,&DAT_14049f290);
      local_a0 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nGroup");
      local_b8 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nGroup");
      local_9c = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nType");
      local_b8 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nType");
      local_98 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nLogType");
      local_b8 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nLogType");
      local_90 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nValue");
      local_b8 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nValue");
      local_94 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nMinLV");
      local_b8 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nMinLV");
      local_8c = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nMaxLV");
      local_b8 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nMaxLV");
      local_88 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nGiveType");
      local_b8 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nGiveType");
      local_84 = *puVar6;
      iVar11 = 0;
      puVar6 = local_80 + 3;
      do {
        puVar7 = (undefined8 *)FUN_1404154c0(local_80 + 6,L"nRewardItem%02d",iVar11);
        if (7 < (ulonglong)puVar7[3]) {
          puVar7 = (undefined8 *)*puVar7;
        }
        uVar3 = FUN_1402970c0(lVar4,puVar7);
        local_b8 = 1;
        puVar8 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,puVar7);
        puVar6[-3] = *puVar8;
        if (7 < local_50) {
          operator_delete((void *)CONCAT44(auStack_64[0],local_80[6]));
        }
        puVar7 = (undefined8 *)FUN_1404154c0(local_80 + 6,L"nRewardItemCount%02d",iVar11);
        if (7 < (ulonglong)puVar7[3]) {
          puVar7 = (undefined8 *)*puVar7;
        }
        uVar3 = FUN_1402970c0(lVar4,puVar7);
        local_b8 = 1;
        puVar8 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,puVar7);
        *puVar6 = *puVar8;
        if (7 < local_50) {
          operator_delete((void *)CONCAT44(auStack_64[0],local_80[6]));
        }
        iVar11 = iVar11 + 1;
        puVar6 = puVar6 + 1;
      } while (iVar11 < 3);
      local_80[6] = uVar1;
      memcpy(auStack_64,&local_a0,0x38);
      FUN_14031e660(uVar1);
      puVar6 = *(undefined4 **)(puVar12 + 6);
      if (puVar6 == (undefined4 *)0x0) {
        uVar2 = (uint)puVar12[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar9 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar9 + *(longlong *)(lVar4 + 0x68)) != 0) {
            puVar6 = *(undefined4 **)(lVar9 + *(longlong *)(lVar4 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar6 == (undefined4 *)0x0);
      }
      goto LAB_14031c4a0;
    }
  }
  return;
}



uint * FUN_14031c7a0(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x10)) {
      if ((puVar1[0x12] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return (uint *)0x0;
        }
        return puVar1 + 1;
      }
    }
  }
  return (uint *)0x0;
}



void FUN_14031c7e0(longlong *param_1,undefined8 param_2)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if (param_1[1] != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar4 = (longlong *)*param_1;
      do {
        if (*plVar4 != 0) {
          lVar5 = ((longlong *)*param_1)[uVar2];
          goto LAB_14031c822;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar4 = plVar4 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar5 = 0;
LAB_14031c822:
  do {
    do {
      lVar3 = lVar5;
      if (lVar3 == 0) {
        return;
      }
      if ((lVar3 != -4) && (*(int *)(lVar3 + 8) == 0xb)) {
        FUN_14012e5c0(param_2);
      }
      lVar5 = *(longlong *)(lVar3 + 0x40);
    } while (lVar5 != 0);
    uVar1 = *(uint *)(lVar3 + 0x48) % *(uint *)(param_1 + 2) + 1;
    lVar3 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar1) break;
      if (*(longlong *)(lVar3 + *param_1) != 0) {
        lVar5 = *(longlong *)(lVar3 + *param_1);
      }
      uVar1 = uVar1 + 1;
      lVar3 = lVar3 + 8;
    } while (lVar5 == 0);
  } while( true );
}



void FUN_14031c8a0(longlong *param_1,undefined8 param_2)

{
  uint uVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong lVar5;
  
  if (param_1[1] != 0) {
    uVar2 = 0;
    if (*(uint *)(param_1 + 2) != 0) {
      plVar4 = (longlong *)*param_1;
      do {
        if (*plVar4 != 0) {
          lVar5 = ((longlong *)*param_1)[uVar2];
          goto LAB_14031c8e2;
        }
        uVar1 = (int)uVar2 + 1;
        uVar2 = (ulonglong)uVar1;
        plVar4 = plVar4 + 1;
      } while (uVar1 < *(uint *)(param_1 + 2));
    }
  }
  lVar5 = 0;
LAB_14031c8e2:
  do {
    do {
      lVar3 = lVar5;
      if (lVar3 == 0) {
        return;
      }
      if (((lVar3 != -4) && (*(int *)(lVar3 + 8) == 0xb)) && (*(int *)(lVar3 + 0xc) == 1)) {
        FUN_14012e5c0(param_2);
      }
      lVar5 = *(longlong *)(lVar3 + 0x40);
    } while (lVar5 != 0);
    uVar1 = *(uint *)(lVar3 + 0x48) % *(uint *)(param_1 + 2) + 1;
    lVar3 = (longlong)(int)uVar1 << 3;
    do {
      if (*(uint *)(param_1 + 2) <= uVar1) break;
      if (*(longlong *)(lVar3 + *param_1) != 0) {
        lVar5 = *(longlong *)(lVar3 + *param_1);
      }
      uVar1 = uVar1 + 1;
      lVar3 = lVar3 + 8;
    } while (lVar5 == 0);
  } while( true );
}



undefined8 * FUN_14031c960(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetEventCouponDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf14 & 1) == 0) {
    DAT_14060cf14 = DAT_14060cf14 | 1;
    FUN_14031e590(0x3f400000,0x3e800000,0x40100000);
    FUN_14031c410();
    atexit((_func_5014 *)&LAB_140449140);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetEventCouponDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_1406083f0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14031ca10(void)

{
  wchar_t wVar1;
  undefined4 uVar2;
  longlong lVar3;
  undefined4 *puVar4;
  ulonglong uVar5;
  longlong lVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  wchar_t *pwVar9;
  undefined4 *puVar10;
  int iVar11;
  longlong lVar12;
  undefined1 auStack_198 [32];
  undefined1 local_178;
  undefined4 *local_168;
  undefined4 *local_160;
  undefined4 *local_158;
  longlong local_148;
  longlong local_140;
  wchar_t *local_138 [4];
  wchar_t *local_118;
  undefined8 local_110;
  undefined1 local_108 [24];
  undefined4 local_f0;
  undefined4 local_ec;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  void *local_d8 [2];
  longlong local_c8;
  ulonglong local_c0;
  void *local_b0;
  undefined8 local_a8;
  undefined8 local_a0;
  void *local_88 [2];
  longlong local_78;
  ulonglong local_70;
  void *local_60;
  undefined8 local_58;
  undefined8 local_50;
  ulonglong local_38;
  
  local_110 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_198;
  local_138[0] = L"FRANTZ_ATTACK_DEFENSE_CLASS";
  local_138[1] = L"TUDE_ATTACK_DEFENSE_CLASS";
  local_138[2] = L"ANGELA_ATTACK_DEFENSE_CLASS";
  local_138[3] = L"NATASHA_ATTACK_DEFENSE_CLASS";
  local_118 = L"PET_ATTACK_DEFENSE_CLASS";
  local_148 = 0;
  do {
    lVar6 = local_148;
    puVar7 = (undefined4 *)0x0;
    lVar3 = FUN_1402933b0(DAT_140607ff0,local_138[local_148]);
    local_140 = lVar3;
    if (lVar3 != 0) {
      local_168 = (undefined4 *)0x0;
      local_160 = (undefined4 *)0x0;
      local_158 = (undefined4 *)0x0;
      iVar11 = 1;
      lVar12 = 100;
      puVar10 = puVar7;
      do {
        puVar8 = local_160;
        uVar2 = FUN_1402970c0(lVar3,L"fAttack");
        local_178 = 1;
        puVar4 = (undefined4 *)FUN_1402967b0(lVar3,iVar11,uVar2,L"fAttack");
        local_f0 = *puVar4;
        uVar2 = FUN_1402970c0(lVar3,L"fDefense");
        local_178 = 1;
        puVar4 = (undefined4 *)FUN_1402967b0(lVar3,iVar11,uVar2,L"fDefense");
        local_ec = *puVar4;
        uVar2 = FUN_1402970c0(lVar3,L"fRangeAttack");
        local_178 = 1;
        puVar4 = (undefined4 *)FUN_1402967b0(lVar3,iVar11,uVar2,L"fRangeAttack");
        local_e8 = *puVar4;
        uVar2 = FUN_1402970c0(lVar3,L"fRangeDefense");
        local_178 = 1;
        puVar4 = (undefined4 *)FUN_1402967b0(lVar3,iVar11,uVar2,L"fRangeDefense");
        local_e4 = *puVar4;
        uVar2 = FUN_1402970c0(lVar3,L"fMagicAttack");
        local_178 = 1;
        puVar4 = (undefined4 *)FUN_1402967b0(lVar3,iVar11,uVar2,L"fMagicAttack");
        local_e0 = *puVar4;
        uVar2 = FUN_1402970c0(lVar3,L"fMagicDefense");
        local_178 = 1;
        puVar4 = (undefined4 *)FUN_1402967b0(lVar3,iVar11,uVar2,L"fMagicDefense");
        local_dc = *puVar4;
        if ((&local_f0 < puVar8) && (puVar7 <= &local_f0)) {
          lVar6 = ((longlong)&local_f0 - (longlong)puVar7) / 6 +
                  ((longlong)&local_f0 - (longlong)puVar7 >> 0x3f);
          lVar6 = (lVar6 >> 2) - (lVar6 >> 0x3f);
          if (puVar8 == puVar10) {
            FUN_14031e1c0(&local_168);
            puVar7 = local_168;
            puVar8 = local_160;
            puVar10 = local_158;
          }
          lVar3 = local_140;
          if (puVar8 != (undefined4 *)0x0) {
            *puVar8 = puVar7[lVar6 * 6];
            puVar8[1] = puVar7[lVar6 * 6 + 1];
            puVar8[2] = puVar7[lVar6 * 6 + 2];
            puVar8[3] = puVar7[lVar6 * 6 + 3];
            puVar8[4] = puVar7[lVar6 * 6 + 4];
            puVar8[5] = puVar7[lVar6 * 6 + 5];
          }
        }
        else {
          if (puVar8 == puVar10) {
            FUN_14031e1c0();
            puVar7 = local_168;
            puVar8 = local_160;
            puVar10 = local_158;
          }
          if (puVar8 != (undefined4 *)0x0) {
            *puVar8 = local_f0;
            puVar8[1] = local_ec;
            puVar8[2] = local_e8;
            puVar8[3] = local_e4;
            puVar8[4] = local_e0;
            puVar8[5] = local_dc;
          }
        }
        lVar6 = local_148;
        local_160 = puVar8 + 6;
        iVar11 = iVar11 + 1;
        lVar12 = lVar12 + -1;
      } while (lVar12 != 0);
      local_c0 = 7;
      local_c8 = 0;
      local_d8[0] = (void *)((ulonglong)local_d8[0] & 0xffffffffffff0000);
      uVar5 = 0xffffffffffffffff;
      pwVar9 = local_138[local_148];
      do {
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        wVar1 = *pwVar9;
        pwVar9 = pwVar9 + 1;
      } while (wVar1 != L'\0');
      FUN_140001710(local_d8,local_138[local_148],~uVar5 - 1);
      FUN_14031f2d0(&local_b0,&local_168);
      local_70 = 7;
      local_78 = 0;
      local_88[0] = (void *)((ulonglong)local_88[0] & 0xffffffffffff0000);
      if (local_c0 < 8) {
        memmove(local_88,local_d8,local_c8 * 2 + 2);
        local_70 = local_c0;
      }
      else {
        local_88[0] = local_d8[0];
        local_d8[0] = (void *)0x0;
        local_70 = local_c0;
      }
      local_78 = local_c8;
      local_c8 = 0;
      local_c0 = 0;
      local_60 = local_b0;
      local_58 = local_a8;
      local_50 = local_a0;
      local_b0 = (void *)0x0;
      local_a8 = 0;
      local_a0 = 0;
      if (DAT_1406083d0 == 0) {
        FUN_14031f0b0(local_108,local_88);
      }
      else {
        FUN_14031ef50(&local_f0,local_88,local_88);
      }
      if (local_60 != (void *)0x0) {
        operator_delete(local_60);
      }
      local_60 = (void *)0x0;
      local_58 = 0;
      local_50 = 0;
      if (7 < local_70) {
        operator_delete(local_88[0]);
      }
      local_70 = 7;
      local_78 = 0;
      local_88[0] = (void *)((ulonglong)local_88[0] & 0xffffffffffff0000);
      if (local_b0 != (void *)0x0) {
        operator_delete(local_b0);
      }
      local_b0 = (void *)0x0;
      local_a8 = 0;
      local_a0 = 0;
      if (7 < local_c0) {
        operator_delete(local_d8[0]);
      }
      local_c0 = 7;
      local_c8 = 0;
      local_d8[0] = (void *)((ulonglong)local_d8[0] & 0xffffffffffff0000);
      if (puVar7 != (undefined4 *)0x0) {
        operator_delete(puVar7);
      }
    }
    local_148 = lVar6 + 1;
    if (4 < local_148) {
      return;
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_14031ceb0(longlong *param_1,short *param_2,int *param_3)

{
  short sVar1;
  int iVar2;
  ushort *puVar3;
  longlong lVar4;
  undefined4 *puVar5;
  ulonglong uVar6;
  ushort *puVar7;
  short *psVar8;
  ulonglong uVar9;
  undefined4 uVar10;
  undefined1 auStack_98 [32];
  undefined1 local_78;
  undefined8 local_68;
  ushort local_60;
  undefined6 uStack_5e;
  longlong local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  local_48 = 7;
  uVar9 = 0;
  local_50 = 0;
  local_60 = 0;
  uVar6 = 0xffffffffffffffff;
  psVar8 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_60,param_2,~uVar6 - 1);
  if (param_1[4] != 0) {
    puVar7 = &local_60;
    if (7 < local_48) {
      puVar7 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    puVar3 = &local_60;
    if (7 < local_48) {
      puVar3 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    for (; puVar3 != puVar7 + local_50; puVar3 = puVar3 + 1) {
      uVar9 = uVar9 ^ (uVar9 >> 2) + uVar9 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar3;
    }
    uVar9 = FUN_1402cb0b0(*param_1 + (uVar9 % (ulonglong)param_1[1]) * 8,&local_60);
  }
  if (7 < local_48) {
    operator_delete((void *)CONCAT62(uStack_5e,local_60));
  }
  local_48 = 7;
  local_50 = 0;
  local_60 = 0;
  if (uVar9 == 0) {
    lVar4 = FUN_1402933b0(DAT_140607ff0,param_2);
    if (lVar4 == 0) {
      uVar10 = 0;
    }
    else {
      iVar2 = *param_3;
      uVar10 = FUN_1402970c0(lVar4,L"fAttack");
      local_78 = 1;
      puVar5 = (undefined4 *)FUN_1402967b0(lVar4,iVar2,uVar10,L"fAttack");
      uVar10 = *puVar5;
    }
  }
  else {
    uVar10 = *(undefined4 *)(*(longlong *)(uVar9 + 0x30) + (longlong)(*param_3 + -1) * 0x18);
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_14031d050(longlong *param_1,short *param_2,int *param_3)

{
  short sVar1;
  int iVar2;
  ushort *puVar3;
  longlong lVar4;
  undefined4 *puVar5;
  ulonglong uVar6;
  ushort *puVar7;
  short *psVar8;
  ulonglong uVar9;
  undefined4 uVar10;
  undefined1 auStack_98 [32];
  undefined1 local_78;
  undefined8 local_68;
  ushort local_60;
  undefined6 uStack_5e;
  longlong local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  local_48 = 7;
  uVar9 = 0;
  local_50 = 0;
  local_60 = 0;
  uVar6 = 0xffffffffffffffff;
  psVar8 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_60,param_2,~uVar6 - 1);
  if (param_1[4] != 0) {
    puVar7 = &local_60;
    if (7 < local_48) {
      puVar7 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    puVar3 = &local_60;
    if (7 < local_48) {
      puVar3 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    for (; puVar3 != puVar7 + local_50; puVar3 = puVar3 + 1) {
      uVar9 = uVar9 ^ (uVar9 >> 2) + uVar9 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar3;
    }
    uVar9 = FUN_1402cb0b0(*param_1 + (uVar9 % (ulonglong)param_1[1]) * 8,&local_60);
  }
  if (7 < local_48) {
    operator_delete((void *)CONCAT62(uStack_5e,local_60));
  }
  local_48 = 7;
  local_50 = 0;
  local_60 = 0;
  if (uVar9 == 0) {
    lVar4 = FUN_1402933b0(DAT_140607ff0,param_2);
    if (lVar4 == 0) {
      uVar10 = 0;
    }
    else {
      iVar2 = *param_3;
      uVar10 = FUN_1402970c0(lVar4,L"fDefense");
      local_78 = 1;
      puVar5 = (undefined4 *)FUN_1402967b0(lVar4,iVar2,uVar10,L"fDefense");
      uVar10 = *puVar5;
    }
  }
  else {
    uVar10 = *(undefined4 *)(*(longlong *)(uVar9 + 0x30) + 4 + (longlong)(*param_3 + -1) * 0x18);
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_14031d1f0(longlong *param_1,short *param_2,int *param_3)

{
  short sVar1;
  int iVar2;
  ushort *puVar3;
  longlong lVar4;
  undefined4 *puVar5;
  ulonglong uVar6;
  ushort *puVar7;
  short *psVar8;
  ulonglong uVar9;
  undefined4 uVar10;
  undefined1 auStack_98 [32];
  undefined1 local_78;
  undefined8 local_68;
  ushort local_60;
  undefined6 uStack_5e;
  longlong local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  local_48 = 7;
  uVar9 = 0;
  local_50 = 0;
  local_60 = 0;
  uVar6 = 0xffffffffffffffff;
  psVar8 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_60,param_2,~uVar6 - 1);
  if (param_1[4] != 0) {
    puVar7 = &local_60;
    if (7 < local_48) {
      puVar7 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    puVar3 = &local_60;
    if (7 < local_48) {
      puVar3 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    for (; puVar3 != puVar7 + local_50; puVar3 = puVar3 + 1) {
      uVar9 = uVar9 ^ (uVar9 >> 2) + uVar9 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar3;
    }
    uVar9 = FUN_1402cb0b0(*param_1 + (uVar9 % (ulonglong)param_1[1]) * 8,&local_60);
  }
  if (7 < local_48) {
    operator_delete((void *)CONCAT62(uStack_5e,local_60));
  }
  local_48 = 7;
  local_50 = 0;
  local_60 = 0;
  if (uVar9 == 0) {
    lVar4 = FUN_1402933b0(DAT_140607ff0,param_2);
    if (lVar4 == 0) {
      uVar10 = 0;
    }
    else {
      iVar2 = *param_3;
      uVar10 = FUN_1402970c0(lVar4,L"fRangeAttack");
      local_78 = 1;
      puVar5 = (undefined4 *)FUN_1402967b0(lVar4,iVar2,uVar10,L"fRangeAttack");
      uVar10 = *puVar5;
    }
  }
  else {
    uVar10 = *(undefined4 *)(*(longlong *)(uVar9 + 0x30) + 8 + (longlong)(*param_3 + -1) * 0x18);
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_14031d390(longlong *param_1,short *param_2,int *param_3)

{
  short sVar1;
  int iVar2;
  ushort *puVar3;
  longlong lVar4;
  undefined4 *puVar5;
  ulonglong uVar6;
  ushort *puVar7;
  short *psVar8;
  ulonglong uVar9;
  undefined4 uVar10;
  undefined1 auStack_98 [32];
  undefined1 local_78;
  undefined8 local_68;
  ushort local_60;
  undefined6 uStack_5e;
  longlong local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  local_48 = 7;
  uVar9 = 0;
  local_50 = 0;
  local_60 = 0;
  uVar6 = 0xffffffffffffffff;
  psVar8 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_60,param_2,~uVar6 - 1);
  if (param_1[4] != 0) {
    puVar7 = &local_60;
    if (7 < local_48) {
      puVar7 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    puVar3 = &local_60;
    if (7 < local_48) {
      puVar3 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    for (; puVar3 != puVar7 + local_50; puVar3 = puVar3 + 1) {
      uVar9 = uVar9 ^ (uVar9 >> 2) + uVar9 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar3;
    }
    uVar9 = FUN_1402cb0b0(*param_1 + (uVar9 % (ulonglong)param_1[1]) * 8,&local_60);
  }
  if (7 < local_48) {
    operator_delete((void *)CONCAT62(uStack_5e,local_60));
  }
  local_48 = 7;
  local_50 = 0;
  local_60 = 0;
  if (uVar9 == 0) {
    lVar4 = FUN_1402933b0(DAT_140607ff0,param_2);
    if (lVar4 == 0) {
      uVar10 = 0;
    }
    else {
      iVar2 = *param_3;
      uVar10 = FUN_1402970c0(lVar4,L"fMagicAttack");
      local_78 = 1;
      puVar5 = (undefined4 *)FUN_1402967b0(lVar4,iVar2,uVar10,L"fMagicAttack");
      uVar10 = *puVar5;
    }
  }
  else {
    uVar10 = *(undefined4 *)(*(longlong *)(uVar9 + 0x30) + 0x10 + (longlong)(*param_3 + -1) * 0x18);
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_14031d530(longlong *param_1,short *param_2,int *param_3)

{
  short sVar1;
  int iVar2;
  ushort *puVar3;
  longlong lVar4;
  undefined4 *puVar5;
  ulonglong uVar6;
  ushort *puVar7;
  short *psVar8;
  ulonglong uVar9;
  undefined4 uVar10;
  undefined1 auStack_98 [32];
  undefined1 local_78;
  undefined8 local_68;
  ushort local_60;
  undefined6 uStack_5e;
  longlong local_50;
  ulonglong local_48;
  ulonglong local_38;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  local_48 = 7;
  uVar9 = 0;
  local_50 = 0;
  local_60 = 0;
  uVar6 = 0xffffffffffffffff;
  psVar8 = param_2;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar8;
    psVar8 = psVar8 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_60,param_2,~uVar6 - 1);
  if (param_1[4] != 0) {
    puVar7 = &local_60;
    if (7 < local_48) {
      puVar7 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    puVar3 = &local_60;
    if (7 < local_48) {
      puVar3 = (ushort *)CONCAT62(uStack_5e,local_60);
    }
    for (; puVar3 != puVar7 + local_50; puVar3 = puVar3 + 1) {
      uVar9 = uVar9 ^ (uVar9 >> 2) + uVar9 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar3;
    }
    uVar9 = FUN_1402cb0b0(*param_1 + (uVar9 % (ulonglong)param_1[1]) * 8,&local_60);
  }
  if (7 < local_48) {
    operator_delete((void *)CONCAT62(uStack_5e,local_60));
  }
  local_48 = 7;
  local_50 = 0;
  local_60 = 0;
  if (uVar9 == 0) {
    lVar4 = FUN_1402933b0(DAT_140607ff0,param_2);
    if (lVar4 == 0) {
      uVar10 = 0;
    }
    else {
      iVar2 = *param_3;
      uVar10 = FUN_1402970c0(lVar4,L"fMagicDefense");
      local_78 = 1;
      puVar5 = (undefined4 *)FUN_1402967b0(lVar4,iVar2,uVar10,L"fMagicDefense");
      uVar10 = *puVar5;
    }
  }
  else {
    uVar10 = *(undefined4 *)(*(longlong *)(uVar9 + 0x30) + 0x14 + (longlong)(*param_3 + -1) * 0x18);
  }
  return uVar10;
}



undefined8 * FUN_14031d6d0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetAttackDefenseClassDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf10 & 1) == 0) {
    DAT_14060cf10 = DAT_14060cf10 | 1;
    FUN_14031e820();
    FUN_14031ca10();
    atexit(FUN_140449150);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetAttackDefenseClassDB",uVar3,
                  pcVar4,DVar5);
  }
  return &DAT_1406083b0;
}



uint * FUN_14031d780(longlong param_1,int param_2,uint param_3)

{
  longlong lVar1;
  uint *puVar2;
  
  if (param_2 - 1U < 0xe) {
    lVar1 = *(longlong *)(param_1 + (longlong)param_2 * 0x48);
    if (lVar1 != 0) {
      for (puVar2 = *(uint **)(lVar1 + ((ulonglong)param_3 %
                                       (ulonglong)
                                       *(uint *)(param_1 + 0x10 + (longlong)param_2 * 0x48)) * 8);
          puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 0x16)) {
        if ((puVar2[0x18] == param_3) && (*puVar2 == param_3)) goto LAB_14031d7c6;
      }
    }
    puVar2 = (uint *)0x0;
LAB_14031d7c6:
    if (puVar2 != (uint *)0x0) {
      return puVar2 + 2;
    }
  }
  return (uint *)0x0;
}



void FUN_14031d7e0(void)

{
  undefined4 uVar1;
  code *pcVar2;
  undefined4 uVar3;
  int iVar4;
  longlong lVar5;
  longlong *plVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  longlong lVar11;
  uint uVar12;
  wchar_t *pwVar13;
  ulonglong uVar14;
  undefined4 *puVar15;
  ulonglong uVar16;
  undefined4 **ppuVar17;
  longlong lVar18;
  undefined4 **ppuVar19;
  undefined4 **ppuVar20;
  wchar_t *pwVar21;
  ulonglong uVar22;
  bool bVar23;
  undefined4 *local_res10;
  int local_res18;
  longlong local_res20;
  undefined8 local_1e8;
  undefined1 uStack_1df;
  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_1b0;
  undefined4 **local_1a8;
  undefined4 *local_198;
  wchar_t *local_190;
  wchar_t *local_188;
  undefined8 local_180;
  undefined4 local_170;
  undefined1 local_168;
  undefined1 local_167;
  undefined1 local_166;
  undefined1 local_165;
  undefined1 local_164;
  undefined1 local_163;
  undefined1 local_162;
  undefined1 local_161;
  undefined1 local_160;
  undefined1 local_15f;
  undefined4 local_15c;
  undefined4 local_158;
  undefined4 local_154;
  undefined4 local_150;
  undefined4 local_14c;
  undefined4 local_148;
  undefined4 local_144;
  undefined4 local_140;
  undefined4 local_13c;
  void *local_138 [4];
  wchar_t *local_118;
  undefined4 *local_110;
  undefined4 *local_108;
  undefined4 *local_100;
  undefined8 local_f8;
  
  local_f8 = 0xfffffffffffffffe;
  local_res18 = 1;
  do {
    iVar4 = local_res18;
    puVar7 = (undefined4 *)0x0;
    local_118 = L"CONDITION_NONE" + (longlong)local_res18 * 0x20;
    lVar5 = FUN_1402933b0(DAT_140607ff0,local_118);
    local_res20 = lVar5;
    if (lVar5 != 0) {
      if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
        plVar6 = *(longlong **)(lVar5 + 0x68);
        puVar8 = puVar7;
        puVar15 = puVar7;
        do {
          if (*plVar6 != 0) {
            puVar7 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar15];
            break;
          }
          uVar12 = (int)puVar8 + 1;
          puVar8 = (undefined4 *)(ulonglong)uVar12;
          puVar15 = (undefined4 *)((longlong)puVar15 + 1);
          plVar6 = plVar6 + 1;
        } while (uVar12 < *(uint *)(lVar5 + 0x78));
      }
LAB_14031d8df:
      ppuVar17 = (undefined4 **)0x0;
      local_198 = puVar7;
      if (puVar7 != (undefined4 *)0x0) {
        uVar1 = *puVar7;
        local_1dc = 0;
        local_1d8 = 0;
        local_1d4 = 0;
        local_1d0 = 0x3f800000;
        local_1cc = 0;
        local_1c8 = 0;
        local_1c4 = 0;
        local_1c0 = 0;
        local_1bc = 0;
        local_1b8 = (undefined4 **)0x0;
        local_1b0 = (undefined4 **)0x0;
        local_1a8 = (undefined4 **)0x0;
        uVar3 = FUN_1402970c0(lVar5,L"nLevel");
        local_res10 = (undefined4 *)FUN_140296600(lVar5,uVar1,uVar3,L"nLevel",0);
        uVar3 = FUN_1402970c0(lVar5,L"fDamagePerSecond");
        puVar7 = (undefined4 *)FUN_1402967b0(lVar5,uVar1,uVar3,L"fDamagePerSecond",0);
        uVar3 = FUN_1402970c0(lVar5,L"fDuration");
        puVar8 = (undefined4 *)FUN_1402967b0(lVar5,uVar1,uVar3,L"fDuration",0);
        uVar3 = FUN_1402970c0(lVar5,L"fSpeed");
        puVar15 = (undefined4 *)FUN_1402967b0(lVar5,uVar1,uVar3,L"fSpeed",0);
        uVar3 = FUN_1402970c0(lVar5,L"fValueOfDiminution");
        puVar9 = (undefined4 *)FUN_1402967b0(lVar5,uVar1,uVar3,L"fValueOfDiminution",0);
        uVar3 = FUN_1402970c0(local_res20,L"fStartFog");
        local_100 = (undefined4 *)FUN_1402967b0(local_res20,uVar1,uVar3,L"fStartFog",0);
        uVar3 = FUN_1402970c0(local_res20,L"fEndFog");
        local_110 = (undefined4 *)FUN_1402967b0(local_res20,uVar1,uVar3,L"fEndFog",0);
        uVar3 = FUN_1402970c0(local_res20,L"fRange");
        local_108 = (undefined4 *)FUN_1402967b0(local_res20,uVar1,uVar3,L"fRange",0);
        uVar3 = FUN_1402970c0(local_res20,L"fDamageInterval");
        puVar10 = (undefined4 *)FUN_1402967b0(local_res20,uVar1,uVar3,L"fDamageInterval",0);
        lVar5 = local_res20;
        bVar23 = local_res10 != (undefined4 *)0x0;
        if (bVar23) {
          local_1dc = *local_res10;
        }
        local_1e8 = (ulonglong)bVar23;
        if (puVar7 != (undefined4 *)0x0) {
          local_1d8 = *puVar7;
          local_1e8._0_2_ = CONCAT11(1,bVar23);
          local_1e8 = (ulonglong)(ushort)local_1e8;
        }
        if (puVar8 != (undefined4 *)0x0) {
          local_1d4 = *puVar8;
          local_1e8._0_3_ = CONCAT12(1,(ushort)local_1e8);
          local_1e8 = (ulonglong)(uint3)local_1e8;
        }
        if (puVar15 != (undefined4 *)0x0) {
          local_1d0 = *puVar15;
          local_1e8._0_4_ = CONCAT13(1,(uint3)local_1e8);
          local_1e8 = (ulonglong)(uint)local_1e8;
        }
        if (puVar9 != (undefined4 *)0x0) {
          local_1cc = *puVar9;
          local_1e8._0_5_ = CONCAT14(1,(uint)local_1e8);
          local_1e8 = (ulonglong)(uint5)local_1e8;
        }
        if (local_100 != (undefined4 *)0x0) {
          local_1c8 = *local_100;
          local_1e8._0_6_ = CONCAT15(1,(uint5)local_1e8);
          local_1e8 = (ulonglong)(uint6)local_1e8;
        }
        if (local_110 != (undefined4 *)0x0) {
          local_1c4 = *local_110;
          local_1e8._0_7_ = CONCAT16(1,(uint6)local_1e8);
          local_1e8 = (ulonglong)(uint7)local_1e8;
        }
        bVar23 = local_108 != (undefined4 *)0x0;
        if (bVar23) {
          local_1c0 = *local_108;
          local_1e8 = CONCAT17(1,(uint7)local_1e8);
        }
        if (puVar10 != (undefined4 *)0x0) {
          local_1bc = *puVar10;
        }
        uStack_1df = 0;
        uVar3 = FUN_1402970c0(local_res20,L"szState");
        lVar11 = FUN_140296990(lVar5,uVar1,uVar3,L"szState",0);
        ppuVar19 = ppuVar17;
        if (lVar11 != 0) {
          uVar22 = 0;
          local_190 = (wchar_t *)0x0;
          local_188 = (wchar_t *)0x0;
          local_180 = 0;
          FUN_140415930(&local_190,lVar11,&DAT_14049c7b8);
          lVar5 = (longlong)local_188 - (longlong)local_190 >> 0x3f;
          lVar11 = ((longlong)local_188 - (longlong)local_190) / 0x28 + lVar5;
          ppuVar20 = ppuVar17;
          pwVar21 = local_190;
          if (lVar11 != lVar5) {
            do {
              pwVar13 = pwVar21;
              if (7 < *(ulonglong *)(pwVar21 + 0xc)) {
                pwVar13 = *(wchar_t **)pwVar21;
              }
              iVar4 = _wtoi(pwVar13);
              local_res10 = (undefined4 *)CONCAT44(local_res10._4_4_,iVar4);
              if (iVar4 != 0) {
                if ((&local_res10 < ppuVar17) && (ppuVar19 <= &local_res10)) {
                  lVar18 = (longlong)&local_res10 - (longlong)ppuVar19;
                  if (ppuVar17 == ppuVar20) {
                    uVar14 = (longlong)ppuVar17 - (longlong)ppuVar19 >> 2;
                    if (0x3ffffffffffffffe < uVar14) {
                      std::_Xlength_error("vector<T> too long");
                      pcVar2 = (code *)swi(3);
                      (*pcVar2)();
                      return;
                    }
                    uVar14 = uVar14 + 1;
                    uVar16 = (longlong)ppuVar20 - (longlong)ppuVar19 >> 2;
                    if (uVar16 < uVar14) {
                      if (0x3fffffffffffffff - (uVar16 >> 1) < uVar16) {
                        uVar16 = 0;
                      }
                      else {
                        uVar16 = uVar16 + (uVar16 >> 1);
                      }
                      if (uVar16 < uVar14) {
                        uVar16 = uVar14;
                      }
                      FUN_140051e60(&local_1b8,uVar16);
                      ppuVar17 = local_1b0;
                      ppuVar19 = local_1b8;
                      ppuVar20 = local_1a8;
                    }
                  }
                  if (ppuVar17 != (undefined4 **)0x0) {
                    *(int *)ppuVar17 = *(int *)((longlong)ppuVar19 + (lVar18 >> 2) * 4);
                  }
                }
                else {
                  if (ppuVar17 == ppuVar20) {
                    uVar14 = (longlong)ppuVar17 - (longlong)ppuVar19 >> 2;
                    if (0x3ffffffffffffffe < uVar14) {
                      std::_Xlength_error("vector<T> too long");
                      return;
                    }
                    uVar14 = uVar14 + 1;
                    uVar16 = (longlong)ppuVar20 - (longlong)ppuVar19 >> 2;
                    if (uVar16 < uVar14) {
                      if (0x3fffffffffffffff - (uVar16 >> 1) < uVar16) {
                        uVar16 = 0;
                      }
                      else {
                        uVar16 = uVar16 + (uVar16 >> 1);
                      }
                      if (uVar16 < uVar14) {
                        uVar16 = uVar14;
                      }
                      FUN_140051e60(&local_1b8,uVar16);
                      ppuVar17 = local_1b0;
                      ppuVar19 = local_1b8;
                      ppuVar20 = local_1a8;
                    }
                  }
                  if (ppuVar17 != (undefined4 **)0x0) {
                    *(int *)ppuVar17 = iVar4;
                  }
                }
                ppuVar17 = (undefined4 **)((longlong)ppuVar17 + 4);
                local_1b0 = ppuVar17;
              }
              uVar22 = (ulonglong)((int)uVar22 + 1);
              pwVar21 = pwVar21 + 0x14;
            } while (uVar22 < (ulonglong)(lVar11 - lVar5));
            bVar23 = local_1e8._7_1_;
          }
          pwVar13 = local_188;
          uStack_1df = 1;
          lVar5 = local_res20;
          pwVar21 = local_190;
          if (local_190 != (wchar_t *)0x0) {
            for (; pwVar21 != pwVar13; pwVar21 = pwVar21 + 0x14) {
              if (7 < *(ulonglong *)(pwVar21 + 0xc)) {
                operator_delete(*(void **)pwVar21);
              }
              pwVar21[0xc] = L'\a';
              pwVar21[0xd] = L'\0';
              pwVar21[0xe] = L'\0';
              pwVar21[0xf] = L'\0';
              pwVar21[8] = L'\0';
              pwVar21[9] = L'\0';
              pwVar21[10] = L'\0';
              pwVar21[0xb] = L'\0';
              *pwVar21 = L'\0';
            }
            operator_delete(local_190);
            lVar5 = local_res20;
          }
        }
        local_168 = (undefined1)local_1e8;
        local_167 = local_1e8._1_1_;
        local_166 = local_1e8._2_1_;
        local_165 = local_1e8._3_1_;
        local_164 = local_1e8._4_1_;
        local_163 = local_1e8._5_1_;
        local_162 = local_1e8._6_1_;
        local_15f = uStack_1df;
        local_15c = local_1dc;
        local_170 = uVar1;
        local_161 = bVar23;
        local_160 = puVar10 != (undefined4 *)0x0;
        local_158 = local_1d8;
        local_154 = local_1d4;
        local_150 = local_1d0;
        local_14c = local_1cc;
        local_148 = local_1c8;
        local_144 = local_1c4;
        local_140 = local_1c0;
        local_13c = local_1bc;
        FUN_14012e520(local_138,&local_1b8);
        FUN_14031e740(&DAT_14060a500 + (longlong)local_res18 * 0x48,local_170,&local_168);
        if (local_138[0] != (void *)0x0) {
          operator_delete(local_138[0]);
        }
        if (ppuVar19 != (undefined4 **)0x0) {
          operator_delete(ppuVar19);
        }
        puVar7 = *(undefined4 **)(local_198 + 6);
        if (puVar7 == (undefined4 *)0x0) {
          uVar12 = (uint)local_198[8] % *(uint *)(lVar5 + 0x78) + 1;
          lVar11 = (longlong)(int)uVar12 << 3;
          puVar7 = (undefined4 *)0x0;
          do {
            if (*(uint *)(lVar5 + 0x78) <= uVar12) break;
            if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar11) != 0) {
              puVar7 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar11);
            }
            uVar12 = uVar12 + 1;
            lVar11 = lVar11 + 8;
          } while (puVar7 == (undefined4 *)0x0);
        }
        goto LAB_14031d8df;
      }
      FUN_140294650(DAT_140607ff0,local_118);
      iVar4 = local_res18;
    }
    local_res18 = iVar4 + 1;
    if (0xe < local_res18) {
      return;
    }
  } while( true );
}



void FUN_14031e080(longlong param_1)

{
  if (*(void **)(param_1 + 0x30) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  return;
}



void FUN_14031e0b0(longlong param_1)

{
  if (*(void **)(param_1 + 0x38) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  return;
}



undefined * FUN_14031e0e0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  
  DVar1 = timeGetTime();
  if ((DAT_14060cf0c & 1) == 0) {
    DAT_14060cf0c = DAT_14060cf0c | 1;
    _eh_vector_constructor_iterator_
              (&DAT_14060a500,0x48,0xf,(_func_void_void_ptr *)&LAB_1401629c0,
               (_func_void_void_ptr *)&LAB_14031d770);
    FUN_14031d7e0();
    atexit((_func_5014 *)&LAB_140449170);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetConditionDB");
  }
  return &DAT_14060a500;
}



void FUN_14031e1a0(void)

{
  if (DAT_1406083b0 != 0) {
    FUN_14031ee80(&DAT_1406083b0);
  }
  return;
}



void FUN_14031e1c0(longlong *param_1)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = param_1[1] - *param_1;
  lVar2 = lVar2 / 6 + (lVar2 >> 0x3f);
  uVar4 = (lVar2 >> 2) - (lVar2 >> 0x3f);
  if (0xaaaaaaaaaaaaaa9 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  uVar3 = (param_1[2] - *param_1) / 0x18;
  if (uVar3 < uVar4) {
    if (0xaaaaaaaaaaaaaaa - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
      if (uVar4 != 0) {
        uVar3 = uVar4;
      }
      FUN_14031e280(param_1,uVar3);
      return;
    }
    uVar3 = uVar3 + (uVar3 >> 1);
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_14031e280(param_1,uVar3);
  }
  return;
}



void FUN_14031e280(longlong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  code *pcVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  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) {
    lVar3 = FUN_14031e370(param_2);
    FUN_14008feb0(*param_1,param_1[1],lVar3,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] = lVar3 + param_2 * 0x18;
    param_1[1] = lVar3 + ((lVar4 >> 2) - (lVar4 >> 0x3f)) * 0x18;
    *param_1 = lVar3;
  }
  return;
}



void * FUN_14031e370(ulonglong param_1)

{
  void *pvVar1;
  char *local_res8 [4];
  undefined **local_28 [5];
  
  if (param_1 == 0) {
    return (void *)0x0;
  }
  if ((param_1 < 0xaaaaaaaaaaaaaab) &&
     (pvVar1 = operator_new(param_1 * 0x18), 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_1405d3608);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14031e3e0(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060845c = param_3;
  lVar1 = 0;
  DAT_140608450 = 0x11;
  DAT_140608474 = 10;
  _DAT_140608454 = param_1;
  _DAT_140608458 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608440 = 0;
  DAT_140608448 = 0;
  DAT_140608470 = 0;
  DAT_140608478 = 0;
  DAT_140608480 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608460 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608468 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608468 = 0;
  }
  return &DAT_140608440;
}



uint * FUN_14031e4b0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608450;
  if (DAT_140608440 == 0) {
    cVar2 = FUN_14031f390((ulonglong)DAT_140608450,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608440 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x34)) {
      if ((puVar3[0x36] == param_1) && (*puVar3 == param_1)) {
        FUN_14031e8e0(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_14031f750(param_1,uVar1,param_1);
  FUN_14031e8e0(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_14031e570(void)

{
  FUN_14031ea10();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_14031e590(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060840c = param_3;
  lVar1 = 0;
  DAT_140608400 = 0x11;
  DAT_140608424 = 10;
  _DAT_140608404 = param_1;
  _DAT_140608408 = param_2;
  param_3 = param_3 * 17.0;
  DAT_1406083f0 = 0;
  DAT_1406083f8 = 0;
  DAT_140608420 = 0;
  DAT_140608428 = 0;
  DAT_140608430 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608410 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608418 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608418 = 0;
  }
  return &DAT_1406083f0;
}



uint * FUN_14031e660(uint param_1,void *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608400;
  if (DAT_1406083f0 == 0) {
    cVar2 = FUN_14031f9d0((ulonglong)DAT_140608400,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_1406083f0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x10)) {
      if ((puVar3[0x12] == param_1) && (*puVar3 == param_1)) {
        memcpy(puVar3 + 1,param_2,0x38);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_14031fd90(param_1,uVar1,param_1);
  memcpy(puVar3 + 1,param_2,0x38);
  return puVar3;
}



void FUN_14031e720(void)

{
  FUN_14031ebb0();
  return;
}



uint * FUN_14031e740(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x16)) {
      if ((puVar2[0x18] == param_2) && (*puVar2 == param_2)) {
        FUN_14031e970(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140320160(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_14031e970(puVar2 + 2,param_3);
  return puVar2;
}



void FUN_14031e800(void)

{
  FUN_14031ed30();
  return;
}



undefined8 * FUN_14031e820(void)

{
  longlong lVar1;
  longlong lVar2;
  undefined **ppuVar3;
  
  ppuVar3 = (undefined **)&DAT_14049ab70;
  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 == &MBISingleton<>::vftable_meta_ptr) {
    ppuVar3 = (undefined **)&UNK_14049aca8;
  }
  DAT_1406083b8 = *ppuVar3;
  DAT_1406083d8 = 0x3f800000;
  DAT_1406083b0 = 0;
  DAT_1406083c8 = 0;
  DAT_1406083d0 = 0;
  DAT_1406083e0 = 0;
  DAT_1406083e8 = 0;
  return &DAT_1406083b0;
}



void FUN_14031e8c0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14031ee80();
  }
  return;
}



undefined4 * FUN_14031e8e0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  FUN_14012bb70(param_1 + 4,param_2 + 4);
  if (param_1 + 0xc != param_2 + 0xc) {
    FUN_14015b160();
  }
  FUN_1400015e0(param_1 + 0x14,param_2 + 0x14,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1e,param_2 + 0x1e,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff);
  return param_1;
}



undefined1 * FUN_14031e970(undefined1 *param_1,undefined1 *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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  *(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x28);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x2c);
  FUN_14012bb70();
  return param_1;
}



void FUN_14031ea10(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608470 = DAT_140608470 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608440;
  if ((DAT_140608440 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608450, DAT_140608450 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xd0);
        FUN_14031f920(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608440;
        uVar4 = DAT_140608450;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608440 = (void *)0x0;
  DAT_140608448 = 0;
  if (DAT_140608470 == 0) {
    uVar5 = FUN_14031f6c0(0);
    FUN_14031f390(uVar5,0);
  }
  DAT_140608480 = 0;
  _Memory = DAT_140608478;
  if (DAT_140608478 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608478 = (longlong *)0x0;
    DAT_140608470 = DAT_140608470 + -1;
    return;
  }
  DAT_140608470 = DAT_140608470 + -1;
  return;
}



void FUN_14031eb10(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0xd8) % (ulonglong)DAT_140608450;
  if (param_1 != *(longlong *)(DAT_140608440 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608440 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xd0); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xd0))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xd0) = *(undefined8 *)(param_1 + 0xd0);
      FUN_14031f920(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608440 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xd0);
  FUN_14031f920(param_1);
  return;
}



void FUN_14031ebb0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608420 = DAT_140608420 + 1;
  uVar7 = 0;
  pvVar6 = DAT_1406083f0;
  if ((DAT_1406083f0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608400, DAT_140608400 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x40);
        FUN_14031ff00(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_1406083f0;
        uVar4 = DAT_140608400;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_1406083f0 = (void *)0x0;
  DAT_1406083f8 = 0;
  if (DAT_140608420 == 0) {
    uVar5 = FUN_14031fd00(0);
    FUN_14031f9d0(uVar5,0);
  }
  DAT_140608430 = 0;
  _Memory = DAT_140608428;
  if (DAT_140608428 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608428 = (longlong *)0x0;
    DAT_140608420 = DAT_140608420 + -1;
    return;
  }
  DAT_140608420 = DAT_140608420 + -1;
  return;
}



void FUN_14031ecb0(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x48) % (ulonglong)DAT_140608400;
  if (param_1 != *(longlong *)(DAT_1406083f0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_1406083f0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x40); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x40))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x40) = *(undefined8 *)(param_1 + 0x40);
      FUN_14031ff00(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_1406083f0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x40);
  FUN_14031ff00(param_1);
  return;
}



void FUN_14031ed30(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 + 0x58);
        FUN_140320300(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_14031ee00(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x60) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x58); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x58))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x58) = *(undefined8 *)(param_2 + 0x58);
      FUN_140320300(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x58);
  FUN_140320300(param_1,param_2);
  return;
}



void FUN_14031ee80(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 ((void *)puVar2[6] != (void *)0x0) {
        operator_delete((void *)puVar2[6]);
      }
      puVar2[6] = 0;
      puVar2[7] = 0;
      puVar2[8] = 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_14031ef50(longlong *param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  char cVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  undefined8 *local_48;
  undefined8 *local_40;
  undefined2 local_38;
  
  uVar7 = 0xfffffffffffffffe;
  uVar4 = FUN_14015afa0(param_2);
  puVar6 = (undefined8 *)(DAT_1406083b0 + (uVar4 % DAT_1406083b8) * 8);
  lVar5 = FUN_1402cb0b0(puVar6);
  if (lVar5 == 0) {
    local_48 = &DAT_1406083b0;
    local_40 = (undefined8 *)0x0;
    local_38 = 0;
    FUN_1403206f0(&local_48);
    puVar2 = local_40;
    puVar1 = local_40 + 1;
    if (puVar1 != (undefined8 *)0x0) {
      local_40[4] = 7;
      local_40[3] = 0;
      *(undefined2 *)puVar1 = 0;
      FUN_1400015e0(puVar1,param_3,0,0xffffffffffffffff,uVar7,puVar1);
      FUN_14031f2d0(puVar2 + 6);
    }
    local_38 = CONCAT11(1,(undefined1)local_38);
    cVar3 = FUN_1403203b0(DAT_1406083d0 + 1);
    if (cVar3 != '\0') {
      puVar6 = (undefined8 *)(DAT_1406083b0 + (uVar4 % DAT_1406083b8) * 8);
    }
    *puVar2 = *puVar6;
    *puVar6 = puVar2;
    DAT_1406083d0 = DAT_1406083d0 + 1;
    if (puVar6 < DAT_1406083e0) {
      DAT_1406083e0 = puVar6;
    }
    *param_1 = (longlong)puVar6;
    param_1[1] = (longlong)puVar2;
    *(undefined1 *)(param_1 + 2) = 1;
  }
  else {
    *param_1 = (longlong)puVar6;
    param_1[1] = lVar5;
    *(undefined1 *)(param_1 + 2) = 0;
  }
  return param_1;
}



longlong * FUN_14031f0b0(longlong *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  ulonglong uVar3;
  undefined8 **ppuVar4;
  undefined8 *local_res8;
  undefined8 uVar5;
  undefined8 *local_40;
  undefined8 *local_38;
  undefined2 local_30;
  
  uVar5 = 0xfffffffffffffffe;
  local_40 = &DAT_1406083b0;
  local_38 = (undefined8 *)0x0;
  local_30 = 0;
  FUN_1403206f0(&local_40);
  puVar2 = local_38;
  puVar1 = local_38 + 1;
  local_res8 = puVar1;
  if (puVar1 != (undefined8 *)0x0) {
    local_38[4] = 7;
    local_38[3] = 0;
    *(undefined2 *)puVar1 = 0;
    FUN_1400015e0(puVar1,param_2,0,0xffffffffffffffff,uVar5);
    FUN_14031f2d0(puVar2 + 6);
  }
  local_30 = CONCAT11(1,(undefined1)local_30);
  uVar3 = FUN_14015afa0(puVar1);
  if (DAT_1406083b0 == 0) {
    local_res8 = (undefined8 *)FUN_140320460(1);
    ppuVar4 = &local_res8;
    if (local_res8 <= DAT_1406083b8) {
      ppuVar4 = &DAT_1406083b8;
    }
    DAT_1406083b8 = *ppuVar4;
    FUN_140346140(&DAT_1406083b0);
    FUN_140320820();
  }
  else {
    FUN_1403203b0();
  }
  DAT_1406083e0 = (undefined8 *)(DAT_1406083b0 + (uVar3 % (ulonglong)DAT_1406083b8) * 8);
  *puVar2 = *DAT_1406083e0;
  *DAT_1406083e0 = puVar2;
  DAT_1406083d0 = DAT_1406083d0 + 1;
  *param_1 = (longlong)DAT_1406083e0;
  param_1[1] = (longlong)puVar2;
  *(undefined1 *)(param_1 + 2) = 1;
  return param_1;
}



undefined4 *
FUN_14031f1f0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  FUN_14012e520(param_1 + 4,param_2 + 4,param_3,param_4,0xfffffffffffffffe);
  FUN_14015a040(param_1 + 0xc,param_2 + 0xc);
  *(undefined8 *)(param_1 + 0x1a) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 0x14) = 0;
  FUN_1400015e0(param_1 + 0x14,param_2 + 0x14,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x24) = 7;
  *(undefined8 *)(param_1 + 0x22) = 0;
  *(undefined2 *)(param_1 + 0x1e) = 0;
  FUN_1400015e0(param_1 + 0x1e,param_2 + 0x1e,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x2e) = 7;
  *(undefined8 *)(param_1 + 0x2c) = 0;
  *(undefined2 *)(param_1 + 0x28) = 0;
  FUN_1400015e0(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff);
  return param_1;
}



longlong * FUN_14031f2d0(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  code *pcVar1;
  longlong *plVar2;
  longlong lVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  
  uVar5 = 0xfffffffffffffffe;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  lVar3 = (param_2[1] - *param_2) / 6 + (param_2[1] - *param_2 >> 0x3f);
  uVar4 = (lVar3 >> 2) - (lVar3 >> 0x3f);
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  if (uVar4 != 0) {
    if (0xaaaaaaaaaaaaaaa < uVar4) {
      std::_Xlength_error("vector<T> too long");
      pcVar1 = (code *)swi(3);
      plVar2 = (longlong *)(*pcVar1)();
      return plVar2;
    }
    lVar3 = FUN_14031e370(uVar4);
    *param_1 = lVar3;
    param_1[1] = lVar3;
    param_1[2] = lVar3 + uVar4 * 0x18;
    lVar3 = FUN_1403208a0(*param_2,param_2[1],lVar3,param_4,uVar5);
    param_1[1] = lVar3;
  }
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_14031f390(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608440 != (void *)0x0) {
    operator_delete__(DAT_140608440);
    DAT_140608440 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608440 = operator_new(_Var1);
    if (DAT_140608440 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608440,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060845c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608458;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608468 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608468 = 0;
  }
  DAT_140608460 = (longlong)fVar4 + lVar2;
  DAT_140608450 = param_1;
  return CONCAT71((int7)(DAT_140608468 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14031f4e0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_14031f6c0(DAT_140608448,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608450) {
    if (DAT_140608440 == (void *)0x0) {
      FUN_14031f390(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608450;
      if (DAT_140608450 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608440);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xd0);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0xd8) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xd0) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608450;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608440);
      fVar10 = (float)param_1 * _DAT_14060845c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608460 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608458;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608440 = _Dst;
      DAT_140608450 = param_1;
      DAT_140608468 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608468 = uVar6;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_14031f6c0(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608454;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_14031f750(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608480 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608474);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xe0)
      goto LAB_14031f821;
      lVar8 = uVar7 * 0xe0;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_14031f821:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608478;
    puVar4 = puVar6 + (ulonglong)(DAT_140608474 - 1) * 0x1c + 2;
    DAT_140608478 = puVar6;
    uVar2 = DAT_140608474;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x1a] = DAT_140608480;
      puVar4 = puVar6 + -0x1c;
      DAT_140608480 = puVar6;
    }
  }
  puVar6 = DAT_140608480;
  if (DAT_140608480 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608480[0x1a];
  *(undefined4 *)DAT_140608480 = param_1;
  DAT_140608480 = (undefined8 *)uVar3;
  puVar6[3] = 0;
  puVar6[4] = 0;
  puVar6[5] = 0;
  puVar6[7] = 0;
  puVar6[8] = 0;
  puVar6[9] = 0;
  puVar6[0xe] = 7;
  puVar6[0xd] = 0;
  *(undefined2 *)(puVar6 + 0xb) = 0;
  puVar6[0x13] = 7;
  puVar6[0x12] = 0;
  *(undefined2 *)(puVar6 + 0x10) = 0;
  puVar6[0x18] = 7;
  puVar6[0x17] = 0;
  *(undefined2 *)(puVar6 + 0x15) = 0;
  *(undefined4 *)(puVar6 + 0x1b) = param_3;
  DAT_140608448 = DAT_140608448 + 1;
  puVar6[0x1a] = *(undefined8 *)(DAT_140608440 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608440 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608460 < DAT_140608448) && (DAT_140608470 == 0)) {
    uVar5 = FUN_14031f6c0();
    FUN_14031f4e0(uVar5);
  }
  return puVar6;
}



void FUN_14031f920(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_14031c280(param_1 + 8);
    *(longlong *)(param_1 + 0xd0) = DAT_140608480;
    DAT_140608448 = DAT_140608448 - 1;
    DAT_140608480 = param_1;
    if ((DAT_140608448 < DAT_140608468) && (DAT_140608470 == 0)) {
      uVar2 = FUN_14031f6c0(DAT_140608448);
      FUN_14031f4e0(uVar2);
    }
    if ((DAT_140608448 == 0) &&
       (DAT_140608480 = 0, _Memory = DAT_140608478, DAT_140608478 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608478 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_14031f9d0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_1406083f0 != (void *)0x0) {
    operator_delete__(DAT_1406083f0);
    DAT_1406083f0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_1406083f0 = operator_new(_Var1);
    if (DAT_1406083f0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_1406083f0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060840c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608408;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608418 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608418 = 0;
  }
  DAT_140608410 = (longlong)fVar4 + lVar2;
  DAT_140608400 = param_1;
  return CONCAT71((int7)(DAT_140608418 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14031fb20(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_14031fd00(DAT_1406083f8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608400) {
    if (DAT_1406083f0 == (void *)0x0) {
      FUN_14031f9d0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608400;
      if (DAT_140608400 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_1406083f0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x40);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x48) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x40) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608400;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_1406083f0);
      fVar10 = (float)param_1 * _DAT_14060840c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608410 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608408;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406083f0 = _Dst;
      DAT_140608400 = param_1;
      DAT_140608418 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608418 = uVar6;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_14031fd00(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608404;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 * FUN_14031fd90(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (DAT_140608430 == (undefined8 *)0x0) {
    uVar8 = CONCAT44(0,DAT_140608424);
    if (uVar8 == 0) {
      lVar7 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar8;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x50)
      goto LAB_14031fe69;
      lVar7 = uVar8 * 0x50;
    }
    if ((-lVar7 - 1U < 0x10) || (puVar6 = malloc(lVar7 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_14031fe69:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608428;
    puVar4 = puVar6 + (ulonglong)(DAT_140608424 - 1) * 10 + 2;
    DAT_140608428 = puVar6;
    uVar2 = DAT_140608424;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[8] = DAT_140608430;
      puVar4 = puVar6 + -10;
      DAT_140608430 = puVar6;
    }
  }
  puVar6 = DAT_140608430;
  if (DAT_140608430 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608430[8];
  *(undefined4 *)DAT_140608430 = param_1;
  DAT_140608430 = (undefined8 *)uVar3;
  *(undefined4 *)(puVar6 + 9) = param_3;
  DAT_1406083f8 = DAT_1406083f8 + 1;
  puVar6[8] = *(undefined8 *)(DAT_1406083f0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_1406083f0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608410 < DAT_1406083f8) && (DAT_140608420 == 0)) {
    uVar5 = FUN_14031fd00();
    FUN_14031fb20(uVar5);
  }
  return puVar6;
}



void FUN_14031ff00(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x40) = DAT_140608430;
    DAT_1406083f8 = DAT_1406083f8 - 1;
    DAT_140608430 = param_1;
    if ((DAT_1406083f8 < DAT_140608418) && (DAT_140608420 == 0)) {
      uVar2 = FUN_14031fd00(DAT_1406083f8);
      FUN_14031fb20(uVar2);
    }
    if ((DAT_1406083f8 == 0) &&
       (DAT_140608430 = 0, _Memory = DAT_140608428, DAT_140608428 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608428 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_14031ffb0(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_1402cddb0(param_1,param_1[1],param_3,param_4,0xfffffffffffffffe);
  }
  if (param_2 != *(uint *)(param_1 + 2)) {
    if (*param_1 == 0) {
      FUN_1402c6d50(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_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_2) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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 + 0x58);
            uVar2 = (ulonglong)*(uint *)(lVar3 + 0x60) % (ulonglong)param_2;
            *(undefined8 *)(lVar3 + 0x58) = *(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_140320160(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) < 0x68)
      goto LAB_140320227;
      lVar7 = uVar6 * 0x68;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_140320227:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0xd + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0xb] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0xd;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x16);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 2) = 0;
  *(undefined2 *)(puVar2 + 4) = 0;
  *(undefined8 *)(puVar2 + 5) = 0;
  puVar2[7] = 0;
  *(undefined8 *)(puVar2 + 8) = 0x3f800000;
  *(undefined8 *)(puVar2 + 10) = 0;
  *(undefined8 *)(puVar2 + 0xc) = 0;
  *(undefined8 *)(puVar2 + 0xe) = 0;
  *(undefined8 *)(puVar2 + 0x10) = 0;
  *(undefined8 *)(puVar2 + 0x12) = 0;
  puVar2[0x18] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x16) = *(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_1402cddb0(param_1);
    FUN_14031ffb0(param_1,uVar4);
  }
  return puVar2;
}



void FUN_140320300(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(void **)(param_2 + 0x38) != (void *)0x0) {
    operator_delete(*(void **)(param_2 + 0x38));
  }
  *(undefined8 *)(param_2 + 0x38) = 0;
  *(undefined8 *)(param_2 + 0x40) = 0;
  *(undefined8 *)(param_2 + 0x48) = 0;
  *(undefined8 *)(param_2 + 0x58) = *(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_1402cddb0(param_1);
    FUN_14031ffb0(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;
}



undefined8 FUN_1403203b0(ulonglong param_1)

{
  longlong lVar1;
  ulonglong *puVar2;
  ulonglong local_res8;
  ulonglong local_res10 [3];
  
  local_res8 = param_1;
  if (DAT_1406083e8 <= param_1) {
    local_res10[0] = (DAT_1406083d0 >> 1) + DAT_1406083d0;
    puVar2 = local_res10;
    if (local_res10[0] <= param_1) {
      puVar2 = &local_res8;
    }
    lVar1 = FUN_140320460(*puVar2);
    if (lVar1 != DAT_1406083b8) {
      FUN_140320540(lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140320420(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_1403207c0(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



undefined * FUN_140320460(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  undefined **ppuVar4;
  double dVar5;
  
  dVar5 = (double)param_1;
  if (param_1 < 0) {
    dVar5 = dVar5 + 1.8446744073709552e+19;
  }
  dVar5 = floor(dVar5 / (double)DAT_1406083d8);
  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_14049ab70;
  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 == &MBISingleton<>::vftable_meta_ptr) {
    return (undefined *)0xfffffffb;
  }
  return *ppuVar4;
}



void FUN_140320540(ulonglong param_1)

{
  undefined8 *puVar1;
  ushort uVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  longlong lVar6;
  undefined8 uVar7;
  ushort *puVar8;
  ushort *puVar9;
  undefined8 *puVar10;
  ulonglong local_50;
  ulonglong local_48;
  longlong local_38;
  longlong local_30;
  
  uVar7 = DAT_1406083d0;
  puVar1 = (undefined8 *)(DAT_1406083b0 + DAT_1406083b8 * 8);
  local_50 = 0;
  local_48 = param_1;
  FUN_140346140(&local_50);
  lVar6 = DAT_1406083b0;
  local_38 = DAT_1406083b0;
  DAT_1406083b0 = 0;
  local_30 = DAT_1406083b8;
  uVar4 = DAT_1406083b0;
  lVar5 = DAT_1406083b8;
  for (puVar10 = DAT_1406083e0; puVar10 != puVar1; puVar10 = puVar10 + 1) {
    puVar3 = (undefined8 *)*puVar10;
    DAT_1406083b0 = uVar4;
    DAT_1406083b8 = lVar5;
    while (puVar3 != (undefined8 *)0x0) {
      puVar8 = (ushort *)(puVar3 + 1);
      puVar9 = puVar8;
      if (7 < (ulonglong)puVar3[4]) {
        puVar9 = *(ushort **)puVar8;
      }
      uVar4 = 0;
      if (7 < (ulonglong)puVar3[4]) {
        puVar8 = *(ushort **)puVar8;
      }
      for (; puVar8 != puVar9 + puVar3[3]; puVar8 = puVar8 + 1) {
        uVar2 = *puVar8;
        uVar4 = uVar4 ^ (ulonglong)uVar2 + (uVar4 >> 2) + uVar4 * 0x40 + 0x9e3779b9;
      }
      *puVar10 = *puVar3;
      *puVar3 = *(undefined8 *)(local_50 + (uVar4 % local_48) * 8);
      *(undefined8 **)(local_50 + (uVar4 % local_48) * 8) = puVar3;
      puVar3 = (undefined8 *)*puVar10;
    }
    uVar4 = DAT_1406083b0;
    lVar5 = DAT_1406083b8;
  }
  DAT_1406083b0 = local_50;
  DAT_1406083b8 = local_48;
  DAT_1406083d0 = uVar7;
  local_50 = uVar4;
  local_48 = lVar5;
  FUN_140320820();
  if (lVar6 != 0) {
    FUN_14031ee80(&local_38);
  }
  if (local_50 != 0) {
    FUN_14031ee80(&local_50);
  }
  return;
}



void FUN_1403206f0(longlong param_1)

{
  undefined8 *puVar1;
  char *local_res8 [4];
  undefined **local_78 [5];
  undefined8 uStack_50;
  undefined8 local_48;
  undefined8 uStack_40;
  undefined8 local_38;
  undefined8 uStack_30;
  undefined8 local_28;
  undefined8 uStack_20;
  undefined8 local_18;
  undefined8 uStack_10;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_1403207c0(*(longlong *)(param_1 + 8) + 8);
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar1 = operator_new(0x50);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar1;
    *puVar1 = 0;
    puVar1[1] = uStack_50;
    puVar1[2] = local_48;
    puVar1[3] = uStack_40;
    puVar1[4] = local_38;
    puVar1[5] = uStack_30;
    puVar1[6] = local_28;
    puVar1[7] = uStack_20;
    puVar1[8] = local_18;
    puVar1[9] = uStack_10;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_78,local_res8);
  local_78[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d3608);
}



void FUN_1403207c0(undefined8 *param_1)

{
  if ((void *)param_1[5] != (void *)0x0) {
    operator_delete((void *)param_1[5]);
  }
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 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;
}



void FUN_140320820(void)

{
  if (DAT_1406083d0 == 0) {
    DAT_1406083e0 = DAT_1406083b0 + DAT_1406083b8;
  }
  else {
    DAT_1406083e0 = DAT_1406083b0;
    if (*DAT_1406083b0 == 0) {
      do {
        DAT_1406083e0 = DAT_1406083e0 + 1;
      } while (*DAT_1406083e0 == 0);
      DAT_1406083e8 = FUN_140320900();
      return;
    }
  }
  DAT_1406083e8 = FUN_140320900();
  return;
}



undefined4 * FUN_1403208a0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 6) {
    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];
      param_3[5] = param_1[5];
    }
    param_3 = param_3 + 6;
  }
  return param_3;
}



longlong FUN_140320900(void)

{
  longlong lVar1;
  double dVar2;
  
  dVar2 = (double)DAT_1406083b8;
  if (DAT_1406083b8 < 0) {
    dVar2 = dVar2 + 1.8446744073709552e+19;
  }
  dVar2 = ceil(dVar2 * (double)DAT_1406083d8);
  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_140320990(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  plVar3 = *(longlong **)(param_1 + 0x48);
  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);
      }
    }
  }
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



undefined8 FUN_140320a10(longlong param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  undefined1 auVar3 [16];
  uint uVar4;
  undefined4 uVar5;
  longlong lVar6;
  __uint64 _Var7;
  void *pvVar8;
  undefined8 *puVar9;
  undefined4 *puVar10;
  int *piVar11;
  ulonglong uVar12;
  longlong *plVar13;
  int iVar14;
  longlong lVar15;
  int *piVar16;
  short *psVar17;
  
  lVar6 = FUN_1402933b0(DAT_140607ff0);
  if (lVar6 == 0) {
    return 0;
  }
  uVar12 = 0xffffffffffffffff;
  psVar17 = param_2;
  do {
    if (uVar12 == 0) break;
    uVar12 = uVar12 - 1;
    sVar2 = *psVar17;
    psVar17 = psVar17 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x10,param_2,~uVar12 - 1);
  iVar14 = (int)*(undefined8 *)(lVar6 + 0x70);
  *(int *)(param_1 + 0x38) = iVar14;
  auVar3._8_8_ = 0;
  auVar3._0_8_ = (longlong)iVar14;
  _Var7 = SUB168(ZEXT816(0x80) * auVar3,0);
  if (SUB168(ZEXT816(0x80) * auVar3,8) != 0) {
    _Var7 = 0xffffffffffffffff;
  }
  pvVar8 = operator_new(_Var7);
  plVar1 = (longlong *)(param_1 + 0x40);
  FUN_140321110(plVar1,pvVar8);
  if (*(longlong *)(lVar6 + 0x70) != 0) {
    uVar12 = 0;
    if (*(uint *)(lVar6 + 0x78) != 0) {
      plVar13 = *(longlong **)(lVar6 + 0x68);
      do {
        if (*plVar13 != 0) {
          piVar11 = (int *)(*(longlong **)(lVar6 + 0x68))[uVar12];
          goto LAB_140320ad6;
        }
        uVar4 = (int)uVar12 + 1;
        uVar12 = (ulonglong)uVar4;
        plVar13 = plVar13 + 1;
      } while (uVar4 < *(uint *)(lVar6 + 0x78));
    }
  }
  piVar11 = (int *)0x0;
LAB_140320ad6:
  do {
    do {
      piVar16 = piVar11;
      if (piVar16 == (int *)0x0) {
        return 1;
      }
      iVar14 = *piVar16;
      lVar15 = (longlong)iVar14 * 0x80;
      *(int *)(*plVar1 + -0x80 + lVar15) = iVar14;
      uVar5 = FUN_1402970c0(lVar6,L"i64Exp");
      puVar9 = (undefined8 *)FUN_140296d50(lVar6,iVar14,uVar5);
      *(undefined8 *)(*plVar1 + -0x78 + lVar15) = *puVar9;
      uVar5 = FUN_1402970c0(lVar6,L"nVitalMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nVitalMax",1);
      *(undefined4 *)(*plVar1 + -0x70 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nIntelligenceMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nIntelligenceMax",1);
      *(undefined4 *)(*plVar1 + -0x6c + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nStrengthMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nStrengthMax",1);
      *(undefined4 *)(*plVar1 + -0x68 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nResilientMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nResilientMax",1);
      *(undefined4 *)(*plVar1 + -100 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nEloquenceMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nEloquenceMax",1);
      *(undefined4 *)(*plVar1 + -0x60 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nCharmMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nCharmMax",1);
      *(undefined4 *)(*plVar1 + -0x5c + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nTemperMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nTemperMax",1);
      *(undefined4 *)(*plVar1 + -0x58 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"fHeightMax");
      puVar10 = (undefined4 *)FUN_1402967b0(lVar6,iVar14,uVar5,L"fHeightMax",1);
      *(undefined4 *)(*plVar1 + -0x54 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"fWeightMax");
      puVar10 = (undefined4 *)FUN_1402967b0(lVar6,iVar14,uVar5,L"fWeightMax",1);
      *(undefined4 *)(*plVar1 + -0x50 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nGetExpMin");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nGetExpMin",1);
      *(undefined4 *)(*plVar1 + -0x4c + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nGetExpMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nGetExpMax",1);
      *(undefined4 *)(*plVar1 + -0x48 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nLevelLimit");
      piVar11 = (int *)FUN_140296600(lVar6,iVar14,uVar5,L"nLevelLimit",1);
      *(bool *)(*plVar1 + -0x28 + lVar15) = *piVar11 == 1;
      uVar5 = FUN_1402970c0(lVar6,L"nVitality");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nVitality",1);
      *(undefined4 *)(*plVar1 + -0x24 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nIntelligence");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nIntelligence",1);
      *(undefined4 *)(*plVar1 + -0x20 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nStrength");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nStrength",1);
      *(undefined4 *)(*plVar1 + -0x1c + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nResilient");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nResilient",1);
      *(undefined4 *)(*plVar1 + -0x18 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nEloquence");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nEloquence",1);
      *(undefined4 *)(*plVar1 + -0x14 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nCharm");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nCharm",1);
      *(undefined4 *)(*plVar1 + -0x10 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nTemper");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nTemper",1);
      *(undefined4 *)(*plVar1 + -0xc + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"fHeight");
      puVar10 = (undefined4 *)FUN_1402967b0(lVar6,iVar14,uVar5,L"fHeight",1);
      *(undefined4 *)(*plVar1 + -8 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"fWeight");
      puVar10 = (undefined4 *)FUN_1402967b0(lVar6,iVar14,uVar5,L"fWeight",1);
      *(undefined4 *)(*plVar1 + -4 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nHPMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nHPMax",1);
      *(undefined4 *)(*plVar1 + -0x44 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nMPMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nMPMax",1);
      *(undefined4 *)(*plVar1 + -0x40 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nPhysicalAtkMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nPhysicalAtkMax",1);
      *(undefined4 *)(*plVar1 + -0x3c + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nPhysicalDefMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nPhysicalDefMax",1);
      *(undefined4 *)(*plVar1 + -0x38 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nMagicalAtkMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nMagicalAtkMax",1);
      *(undefined4 *)(*plVar1 + -0x34 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"nMagicalDefMax");
      puVar10 = (undefined4 *)FUN_140296600(lVar6,iVar14,uVar5,L"nMagicalDefMax",1);
      *(undefined4 *)(*plVar1 + -0x30 + lVar15) = *puVar10;
      uVar5 = FUN_1402970c0(lVar6,L"fLoyaltyMax");
      puVar10 = (undefined4 *)FUN_1402967b0(lVar6,iVar14,uVar5,L"fLoyaltyMax",1);
      *(undefined4 *)(*plVar1 + -0x2c + lVar15) = *puVar10;
      piVar11 = *(int **)(piVar16 + 6);
    } while (piVar11 != (int *)0x0);
    uVar4 = (uint)piVar16[8] % *(uint *)(lVar6 + 0x78) + 1;
    lVar15 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(lVar6 + 0x78) <= uVar4) break;
      if (*(longlong *)(*(longlong *)(lVar6 + 0x68) + lVar15) != 0) {
        piVar11 = *(int **)(*(longlong *)(lVar6 + 0x68) + lVar15);
      }
      uVar4 = uVar4 + 1;
      lVar15 = lVar15 + 8;
    } while (piVar11 == (int *)0x0);
  } while( true );
}



void FUN_140321110(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  undefined8 local_10;
  
  FUN_140321180(&local_10,param_2,0);
  *param_1 = param_2;
  plVar3 = (longlong *)param_1[1];
  param_1[1] = local_10;
  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;
}



undefined8 * FUN_140321180(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  *param_1 = 0;
  puVar1 = operator_new(0x20);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar1 + 1) = 1;
    *(undefined4 *)((longlong)puVar1 + 0xc) = 1;
    *puVar1 = boost::detail::sp_counted_impl_pd<>::vftable;
    puVar1[2] = param_2;
  }
  *param_1 = puVar1;
  return param_1;
}



longlong FUN_1403211f0(longlong param_1,type_info *param_2)

{
  bool bVar1;
  
  bVar1 = type_info::operator==
                    (param_2,(type_info *)&boost::checked_array_deleter<>::RTTI_Type_Descriptor);
  if (bVar1) {
    return param_1 + 0x18;
  }
  return 0;
}



undefined2 * FUN_140321230(undefined2 *param_1)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  param_1[0x14] = 0;
  *(undefined8 *)(param_1 + 0x34) = 7;
  *(undefined8 *)(param_1 + 0x30) = 0;
  param_1[0x28] = 0;
  *(undefined8 *)(param_1 + 0x48) = 7;
  *(undefined8 *)(param_1 + 0x44) = 0;
  param_1[0x3c] = 0;
  *(undefined8 *)(param_1 + 0x5c) = 7;
  *(undefined8 *)(param_1 + 0x58) = 0;
  param_1[0x50] = 0;
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x6c) = 0;
  param_1[100] = 0;
  *(undefined8 *)(param_1 + 0x84) = 7;
  *(undefined8 *)(param_1 + 0x80) = 0;
  param_1[0x78] = 0;
  *(undefined8 *)(param_1 + 0x98) = 7;
  *(undefined8 *)(param_1 + 0x94) = 0;
  param_1[0x8c] = 0;
  *(undefined1 *)(param_1 + 0xa0) = 0;
  *(undefined8 *)(param_1 + 0xa2) = 0;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0xb8) = 7;
  *(undefined8 *)(param_1 + 0xb4) = 0;
  param_1[0xac] = 0;
  *(undefined8 *)(param_1 + 0xcc) = 7;
  *(undefined8 *)(param_1 + 200) = 0;
  param_1[0xc0] = 0;
  *(undefined8 *)(param_1 + 0xe0) = 7;
  *(undefined8 *)(param_1 + 0xdc) = 0;
  param_1[0xd4] = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined8 *)(param_1 + 0xec) = 0;
  *(undefined8 *)(param_1 + 0xf0) = 0;
  *(undefined8 *)(param_1 + 0xf8) = 0;
  *(undefined8 *)(param_1 + 0xfc) = 0;
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x104) = 0;
  *(undefined4 *)(param_1 + 0x108) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x10a) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x10c) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x10e) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x110) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x112) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x114) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x116) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x118) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x11a) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x11c) = 0x3f800000;
  *(undefined8 *)(param_1 + 300) = 7;
  *(undefined8 *)(param_1 + 0x128) = 0;
  param_1[0x120] = 0;
  *(undefined4 *)(param_1 + 0x134) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x136) = 0x3f800000;
  *(undefined8 *)(param_1 + 0x13a) = 0;
  *(undefined8 *)(param_1 + 0x13e) = 0;
  *(undefined8 *)(param_1 + 0x142) = 0;
  *(undefined8 *)(param_1 + 0x146) = 0;
  *(undefined4 *)(param_1 + 0x14a) = 0x43200000;
  *(undefined8 *)(param_1 + 0x150) = 0;
  *(undefined4 *)(param_1 + 0x154) = 0x41a00000;
  *(undefined8 *)(param_1 + 0x164) = 7;
  *(undefined8 *)(param_1 + 0x160) = 0;
  param_1[0x158] = 0;
  *(undefined8 *)(param_1 + 0x16c) = 0;
  *(undefined8 *)(param_1 + 0x1a0) = 0;
  *(undefined8 *)(param_1 + 0x1a4) = 0;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  *(undefined8 *)(param_1 + 0x1ac) = 0;
  *(undefined8 *)(param_1 + 0x1c0) = 7;
  *(undefined8 *)(param_1 + 0x1bc) = 0;
  param_1[0x1b4] = 0;
  *(undefined8 *)(param_1 + 0x1d4) = 7;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  param_1[0x1c8] = 0;
  *(undefined8 *)(param_1 + 0x1e8) = 7;
  *(undefined8 *)(param_1 + 0x1e4) = 0;
  param_1[0x1dc] = 0;
  *(undefined8 *)(param_1 + 0x1fc) = 7;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  param_1[0x1f0] = 0;
  *(undefined8 *)(param_1 + 0x210) = 7;
  *(undefined8 *)(param_1 + 0x20c) = 0;
  param_1[0x204] = 0;
  *(undefined8 *)(param_1 + 0x224) = 7;
  *(undefined8 *)(param_1 + 0x220) = 0;
  param_1[0x218] = 0;
  *(undefined8 *)(param_1 + 0x238) = 7;
  *(undefined8 *)(param_1 + 0x234) = 0;
  param_1[0x22c] = 0;
  *(undefined8 *)(param_1 + 0x24c) = 7;
  *(undefined8 *)(param_1 + 0x248) = 0;
  param_1[0x240] = 0;
  *(undefined8 *)(param_1 + 0x260) = 7;
  *(undefined8 *)(param_1 + 0x25c) = 0;
  param_1[0x254] = 0;
  *(undefined8 *)(param_1 + 0x274) = 7;
  *(undefined8 *)(param_1 + 0x270) = 0;
  param_1[0x268] = 0;
  *(undefined8 *)(param_1 + 0x288) = 7;
  *(undefined8 *)(param_1 + 0x284) = 0;
  param_1[0x27c] = 0;
  *(undefined8 *)(param_1 + 0x29c) = 7;
  *(undefined8 *)(param_1 + 0x298) = 0;
  param_1[0x290] = 0;
  *(undefined8 *)(param_1 + 0x2b0) = 7;
  *(undefined8 *)(param_1 + 0x2ac) = 0;
  param_1[0x2a4] = 0;
  *(undefined8 *)(param_1 + 0x2c4) = 7;
  *(undefined8 *)(param_1 + 0x2c0) = 0;
  param_1[0x2b8] = 0;
  *(undefined8 *)(param_1 + 0x2d8) = 7;
  *(undefined8 *)(param_1 + 0x2d4) = 0;
  param_1[0x2cc] = 0;
  *(undefined8 *)(param_1 + 0x2ec) = 7;
  *(undefined8 *)(param_1 + 0x2e8) = 0;
  param_1[0x2e0] = 0;
  *(undefined8 *)(param_1 + 0x300) = 7;
  *(undefined8 *)(param_1 + 0x2fc) = 0;
  param_1[0x2f4] = 0;
  *(undefined8 *)(param_1 + 0x314) = 7;
  *(undefined8 *)(param_1 + 0x310) = 0;
  param_1[0x308] = 0;
  *(undefined8 *)(param_1 + 0x328) = 7;
  *(undefined8 *)(param_1 + 0x324) = 0;
  param_1[0x31c] = 0;
  *(undefined8 *)(param_1 + 0x33c) = 7;
  *(undefined8 *)(param_1 + 0x338) = 0;
  param_1[0x330] = 0;
  *(undefined8 *)(param_1 + 0x350) = 7;
  *(undefined8 *)(param_1 + 0x34c) = 0;
  param_1[0x344] = 0;
  *(undefined8 *)(param_1 + 0x364) = 7;
  *(undefined8 *)(param_1 + 0x360) = 0;
  param_1[0x358] = 0;
  *(undefined8 *)(param_1 + 0x378) = 7;
  *(undefined8 *)(param_1 + 0x374) = 0;
  param_1[0x36c] = 0;
  *(undefined8 *)(param_1 + 0x38c) = 7;
  *(undefined8 *)(param_1 + 0x388) = 0;
  param_1[0x380] = 0;
  *(undefined8 *)(param_1 + 0x394) = 0;
  *(undefined8 *)(param_1 + 0x398) = 0;
  *(undefined8 *)(param_1 + 0x39c) = 0;
  *(undefined8 *)(param_1 + 0x3a4) = 0;
  *(undefined8 *)(param_1 + 0x3a8) = 0;
  *(undefined8 *)(param_1 + 0x3ac) = 0;
  *(undefined8 *)(param_1 + 0x3b4) = 0;
  *(undefined8 *)(param_1 + 0x3b8) = 0;
  *(undefined8 *)(param_1 + 0x3bc) = 0;
  *(undefined8 *)(param_1 + 0x3c4) = 0;
  *(undefined1 *)(param_1 + 0x3d0) = 0;
  *(undefined8 *)(param_1 + 0x3d2) = 0;
  *(undefined4 *)(param_1 + 0x3d6) = 0;
  *(undefined4 *)(param_1 + 0x3da) = 0;
  *(undefined8 *)(param_1 + 0x3de) = 0;
  *(undefined8 *)(param_1 + 0x3e2) = 0;
  *(undefined8 *)(param_1 + 0x3e6) = 0;
  *(undefined8 *)(param_1 + 0x3ea) = 0;
  *(undefined8 *)(param_1 + 0x3ee) = 0;
  *(undefined8 *)(param_1 + 0x3f2) = 0;
  *(undefined4 *)(param_1 + 0x3f6) = 0x3e99999a;
  *(undefined8 *)(param_1 + 0x3f8) = 0x3f333333;
  *(undefined4 *)(param_1 + 0x3fc) = 0;
  *(undefined8 *)(param_1 + 0x42a) = 0;
  *(undefined8 *)(param_1 + 0x42e) = 0;
  *(undefined8 *)(param_1 + 0x440) = 7;
  *(undefined8 *)(param_1 + 0x43c) = 0;
  param_1[0x434] = 0;
  *(undefined8 *)(param_1 + 0x454) = 7;
  *(undefined8 *)(param_1 + 0x450) = 0;
  param_1[0x448] = 0;
  *(undefined8 *)(param_1 + 0x468) = 7;
  *(undefined8 *)(param_1 + 0x464) = 0;
  param_1[0x45c] = 0;
  *(undefined4 *)(param_1 + 0x470) = 0;
  *(undefined8 *)(param_1 + 0x474) = 0;
  *(undefined4 *)(param_1 + 0x478) = 0;
  *(undefined4 *)(param_1 + 0x47c) = 0;
  *(undefined8 *)(param_1 + 0x48c) = 7;
  *(undefined8 *)(param_1 + 0x488) = 0;
  param_1[0x480] = 0;
  *(undefined8 *)(param_1 + 0x494) = 0;
  *(undefined8 *)(param_1 + 0x498) = 0;
  *(undefined8 *)(param_1 + 0x49c) = 0;
  *(undefined4 *)(param_1 + 0x4a0) = 0;
  *(undefined8 *)(param_1 + 0x4b0) = 7;
  *(undefined8 *)(param_1 + 0x4ac) = 0;
  param_1[0x4a4] = 0;
  *(undefined8 *)(param_1 + 0x14c) = 0;
  *(undefined8 *)(param_1 + 0x3fe) = 0;
  *(undefined8 *)(param_1 + 0x402) = 0;
  *(undefined8 *)(param_1 + 0x406) = 0;
  *(undefined8 *)(param_1 + 0x40a) = 0;
  memset(param_1 + 0x40e,0,0x38);
  memset(param_1 + 0x170,0,0x30);
  memset(param_1 + 0x188,0,0x30);
  *(undefined8 *)(param_1 + 0x3c8) = 0;
  *(undefined8 *)(param_1 + 0x3cc) = 0;
  return param_1;
}



void FUN_1403218b0(undefined8 *param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  param_1[0x126] = 0;
  plVar3 = (longlong *)param_1[0x127];
  param_1[0x127] = 0;
  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);
      }
    }
  }
  if (7 < (ulonglong)param_1[300]) {
    operator_delete((void *)param_1[0x129]);
  }
  param_1[300] = 7;
  param_1[299] = 0;
  *(undefined2 *)(param_1 + 0x129) = 0;
  plVar3 = (longlong *)param_1[0x127];
  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);
      }
    }
  }
  if (7 < (ulonglong)param_1[0x123]) {
    operator_delete((void *)param_1[0x120]);
  }
  param_1[0x123] = 7;
  param_1[0x122] = 0;
  *(undefined2 *)(param_1 + 0x120) = 0;
  if (7 < (ulonglong)param_1[0x11a]) {
    operator_delete((void *)param_1[0x117]);
  }
  param_1[0x11a] = 7;
  param_1[0x119] = 0;
  *(undefined2 *)(param_1 + 0x117) = 0;
  if (7 < (ulonglong)param_1[0x115]) {
    operator_delete((void *)param_1[0x112]);
  }
  param_1[0x115] = 7;
  param_1[0x114] = 0;
  *(undefined2 *)(param_1 + 0x112) = 0;
  if (7 < (ulonglong)param_1[0x110]) {
    operator_delete((void *)param_1[0x10d]);
  }
  param_1[0x110] = 7;
  param_1[0x10f] = 0;
  *(undefined2 *)(param_1 + 0x10d) = 0;
  if (param_1[0xed] != 0) {
    FUN_14008d0a0(param_1[0xed],param_1[0xee]);
    operator_delete((void *)param_1[0xed]);
  }
  param_1[0xed] = 0;
  param_1[0xee] = 0;
  param_1[0xef] = 0;
  if (param_1[0xe9] != 0) {
    FUN_14008d0a0(param_1[0xe9],param_1[0xea]);
    operator_delete((void *)param_1[0xe9]);
  }
  param_1[0xe9] = 0;
  param_1[0xea] = 0;
  param_1[0xeb] = 0;
  if (param_1[0xe5] != 0) {
    FUN_14008d0a0(param_1[0xe5],param_1[0xe6]);
    operator_delete((void *)param_1[0xe5]);
  }
  param_1[0xe5] = 0;
  param_1[0xe6] = 0;
  param_1[0xe7] = 0;
  if (7 < (ulonglong)param_1[0xe3]) {
    operator_delete((void *)param_1[0xe0]);
  }
  param_1[0xe3] = 7;
  param_1[0xe2] = 0;
  *(undefined2 *)(param_1 + 0xe0) = 0;
  if (7 < (ulonglong)param_1[0xde]) {
    operator_delete((void *)param_1[0xdb]);
  }
  param_1[0xde] = 7;
  param_1[0xdd] = 0;
  *(undefined2 *)(param_1 + 0xdb) = 0;
  if (7 < (ulonglong)param_1[0xd9]) {
    operator_delete((void *)param_1[0xd6]);
  }
  param_1[0xd9] = 7;
  param_1[0xd8] = 0;
  *(undefined2 *)(param_1 + 0xd6) = 0;
  if (7 < (ulonglong)param_1[0xd4]) {
    operator_delete((void *)param_1[0xd1]);
  }
  param_1[0xd4] = 7;
  param_1[0xd3] = 0;
  *(undefined2 *)(param_1 + 0xd1) = 0;
  if (7 < (ulonglong)param_1[0xcf]) {
    operator_delete((void *)param_1[0xcc]);
  }
  param_1[0xcf] = 7;
  param_1[0xce] = 0;
  *(undefined2 *)(param_1 + 0xcc) = 0;
  if (7 < (ulonglong)param_1[0xca]) {
    operator_delete((void *)param_1[199]);
  }
  param_1[0xca] = 7;
  param_1[0xc9] = 0;
  *(undefined2 *)(param_1 + 199) = 0;
  if (7 < (ulonglong)param_1[0xc5]) {
    operator_delete((void *)param_1[0xc2]);
  }
  param_1[0xc5] = 7;
  param_1[0xc4] = 0;
  *(undefined2 *)(param_1 + 0xc2) = 0;
  if (7 < (ulonglong)param_1[0xc0]) {
    operator_delete((void *)param_1[0xbd]);
  }
  param_1[0xc0] = 7;
  param_1[0xbf] = 0;
  *(undefined2 *)(param_1 + 0xbd) = 0;
  if (7 < (ulonglong)param_1[0xbb]) {
    operator_delete((void *)param_1[0xb8]);
  }
  param_1[0xbb] = 7;
  param_1[0xba] = 0;
  *(undefined2 *)(param_1 + 0xb8) = 0;
  if (7 < (ulonglong)param_1[0xb6]) {
    operator_delete((void *)param_1[0xb3]);
  }
  param_1[0xb6] = 7;
  param_1[0xb5] = 0;
  *(undefined2 *)(param_1 + 0xb3) = 0;
  if (7 < (ulonglong)param_1[0xb1]) {
    operator_delete((void *)param_1[0xae]);
  }
  param_1[0xb1] = 7;
  param_1[0xb0] = 0;
  *(undefined2 *)(param_1 + 0xae) = 0;
  if (7 < (ulonglong)param_1[0xac]) {
    operator_delete((void *)param_1[0xa9]);
  }
  param_1[0xac] = 7;
  param_1[0xab] = 0;
  *(undefined2 *)(param_1 + 0xa9) = 0;
  if (7 < (ulonglong)param_1[0xa7]) {
    operator_delete((void *)param_1[0xa4]);
  }
  param_1[0xa7] = 7;
  param_1[0xa6] = 0;
  *(undefined2 *)(param_1 + 0xa4) = 0;
  if (7 < (ulonglong)param_1[0xa2]) {
    operator_delete((void *)param_1[0x9f]);
  }
  param_1[0xa2] = 7;
  param_1[0xa1] = 0;
  *(undefined2 *)(param_1 + 0x9f) = 0;
  if (7 < (ulonglong)param_1[0x9d]) {
    operator_delete((void *)param_1[0x9a]);
  }
  param_1[0x9d] = 7;
  param_1[0x9c] = 0;
  *(undefined2 *)(param_1 + 0x9a) = 0;
  if (7 < (ulonglong)param_1[0x98]) {
    operator_delete((void *)param_1[0x95]);
  }
  param_1[0x98] = 7;
  param_1[0x97] = 0;
  *(undefined2 *)(param_1 + 0x95) = 0;
  if (7 < (ulonglong)param_1[0x93]) {
    operator_delete((void *)param_1[0x90]);
  }
  param_1[0x93] = 7;
  param_1[0x92] = 0;
  *(undefined2 *)(param_1 + 0x90) = 0;
  if (7 < (ulonglong)param_1[0x8e]) {
    operator_delete((void *)param_1[0x8b]);
  }
  param_1[0x8e] = 7;
  param_1[0x8d] = 0;
  *(undefined2 *)(param_1 + 0x8b) = 0;
  if (7 < (ulonglong)param_1[0x89]) {
    operator_delete((void *)param_1[0x86]);
  }
  param_1[0x89] = 7;
  param_1[0x88] = 0;
  *(undefined2 *)(param_1 + 0x86) = 0;
  if (7 < (ulonglong)param_1[0x84]) {
    operator_delete((void *)param_1[0x81]);
  }
  param_1[0x84] = 7;
  param_1[0x83] = 0;
  *(undefined2 *)(param_1 + 0x81) = 0;
  if (7 < (ulonglong)param_1[0x7f]) {
    operator_delete((void *)param_1[0x7c]);
  }
  param_1[0x7f] = 7;
  param_1[0x7e] = 0;
  *(undefined2 *)(param_1 + 0x7c) = 0;
  if (7 < (ulonglong)param_1[0x7a]) {
    operator_delete((void *)param_1[0x77]);
  }
  param_1[0x7a] = 7;
  param_1[0x79] = 0;
  *(undefined2 *)(param_1 + 0x77) = 0;
  if (7 < (ulonglong)param_1[0x75]) {
    operator_delete((void *)param_1[0x72]);
  }
  param_1[0x75] = 7;
  param_1[0x74] = 0;
  *(undefined2 *)(param_1 + 0x72) = 0;
  if (7 < (ulonglong)param_1[0x70]) {
    operator_delete((void *)param_1[0x6d]);
  }
  param_1[0x70] = 7;
  param_1[0x6f] = 0;
  *(undefined2 *)(param_1 + 0x6d) = 0;
  if ((void *)param_1[0x69] != (void *)0x0) {
    operator_delete((void *)param_1[0x69]);
  }
  param_1[0x69] = 0;
  param_1[0x6a] = 0;
  param_1[0x6b] = 0;
  if (7 < (ulonglong)param_1[0x59]) {
    operator_delete((void *)param_1[0x56]);
  }
  param_1[0x59] = 7;
  param_1[0x58] = 0;
  *(undefined2 *)(param_1 + 0x56) = 0;
  if (7 < (ulonglong)param_1[0x4b]) {
    operator_delete((void *)param_1[0x48]);
  }
  param_1[0x4b] = 7;
  param_1[0x4a] = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  if (param_1[0x3a] != 0) {
    FUN_14008d0a0(param_1[0x3a],param_1[0x3b]);
    operator_delete((void *)param_1[0x3a]);
  }
  param_1[0x3a] = 0;
  param_1[0x3b] = 0;
  param_1[0x3c] = 0;
  if (7 < (ulonglong)param_1[0x38]) {
    operator_delete((void *)param_1[0x35]);
  }
  param_1[0x38] = 7;
  param_1[0x37] = 0;
  *(undefined2 *)(param_1 + 0x35) = 0;
  if (7 < (ulonglong)param_1[0x33]) {
    operator_delete((void *)param_1[0x30]);
  }
  param_1[0x33] = 7;
  param_1[0x32] = 0;
  *(undefined2 *)(param_1 + 0x30) = 0;
  if (7 < (ulonglong)param_1[0x2e]) {
    operator_delete((void *)param_1[0x2b]);
  }
  param_1[0x2e] = 7;
  param_1[0x2d] = 0;
  *(undefined2 *)(param_1 + 0x2b) = 0;
  if (7 < (ulonglong)param_1[0x26]) {
    operator_delete((void *)param_1[0x23]);
  }
  param_1[0x26] = 7;
  param_1[0x25] = 0;
  *(undefined2 *)(param_1 + 0x23) = 0;
  if (7 < (ulonglong)param_1[0x21]) {
    operator_delete((void *)param_1[0x1e]);
  }
  param_1[0x21] = 7;
  param_1[0x20] = 0;
  *(undefined2 *)(param_1 + 0x1e) = 0;
  if (7 < (ulonglong)param_1[0x1c]) {
    operator_delete((void *)param_1[0x19]);
  }
  param_1[0x1c] = 7;
  param_1[0x1b] = 0;
  *(undefined2 *)(param_1 + 0x19) = 0;
  if (7 < (ulonglong)param_1[0x17]) {
    operator_delete((void *)param_1[0x14]);
  }
  param_1[0x17] = 7;
  param_1[0x16] = 0;
  *(undefined2 *)(param_1 + 0x14) = 0;
  if (7 < (ulonglong)param_1[0x12]) {
    operator_delete((void *)param_1[0xf]);
  }
  param_1[0x12] = 7;
  param_1[0x11] = 0;
  *(undefined2 *)(param_1 + 0xf) = 0;
  if (7 < (ulonglong)param_1[0xd]) {
    operator_delete((void *)param_1[10]);
  }
  param_1[0xd] = 7;
  param_1[0xc] = 0;
  *(undefined2 *)(param_1 + 10) = 0;
  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;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140322210(longlong param_1,undefined4 param_2,short *param_3)

{
  float fVar1;
  short sVar2;
  undefined4 uVar3;
  int iVar4;
  longlong lVar5;
  short *psVar6;
  undefined8 uVar7;
  short *psVar8;
  undefined4 *puVar9;
  wchar_t *pwVar10;
  float *pfVar11;
  short **ppsVar12;
  ulonglong uVar13;
  longlong lVar14;
  ushort *puVar15;
  ushort *puVar16;
  longlong lVar17;
  ushort *puVar18;
  ushort *puVar19;
  wchar_t *pwVar20;
  wchar_t *pwVar21;
  bool bVar22;
  undefined1 auStack_c8 [32];
  undefined1 local_a8;
  short *local_98;
  undefined4 local_90 [2];
  undefined8 local_88;
  undefined2 local_80;
  undefined6 uStack_7e;
  undefined8 local_70;
  ulonglong local_68;
  ulonglong local_58;
  
  local_88 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  local_98 = param_3;
  lVar5 = FUN_1402933b0(DAT_140607ff0,param_3);
  if (lVar5 != 0) {
    FUN_14012baa0(param_1 + 0x348);
    puVar19 = (ushort *)(param_1 + 0x28);
    FUN_140001710(puVar19,&DAT_140477960,0);
    puVar18 = (ushort *)(param_1 + 0x78);
    FUN_140001710(puVar18,&DAT_140477960,0);
    lVar17 = param_1 + 0x50;
    FUN_140001710(lVar17,&DAT_140477960,0);
    uVar13 = 0xffffffffffffffff;
    do {
      if (uVar13 == 0) break;
      uVar13 = uVar13 - 1;
      sVar2 = *param_3;
      param_3 = param_3 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x948,local_98,~uVar13 - 1);
    *(undefined4 *)(param_1 + 0x940) = 1;
    uVar3 = FUN_1402970c0(lVar5,L"wszName");
    local_a8 = 1;
    psVar6 = (short *)FUN_140296b70(lVar5,param_2,uVar3,L"wszName");
    if (psVar6 != (short *)0x0) {
      uVar13 = 0xffffffffffffffff;
      psVar8 = psVar6;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar8;
        psVar8 = psVar8 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1,psVar6,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szModelFile");
      local_a8 = 1;
      local_98 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szModelFile");
      if (local_98 != (short *)0x0) {
        uVar13 = 0xffffffffffffffff;
        psVar6 = local_98;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar6;
          psVar6 = psVar6 + 1;
        } while (sVar2 != 0);
        if (1 < ~uVar13 - 1) {
          if (DAT_140607be1 == '\0') {
            uVar7 = FUN_140123ce0();
            FUN_1400015e0(puVar19,uVar7,0,0xffffffffffffffff);
            FUN_140002aa0(puVar19,&DAT_14049a36c,1);
          }
          uVar13 = 0xffffffffffffffff;
          psVar6 = local_98;
          do {
            if (uVar13 == 0) break;
            uVar13 = uVar13 - 1;
            sVar2 = *psVar6;
            psVar6 = psVar6 + 1;
          } while (sVar2 != 0);
          FUN_140002aa0(puVar19,local_98,~uVar13 - 1);
        }
      }
      uVar3 = FUN_1402970c0(lVar5,L"szSimpleModelFile");
      local_a8 = 1;
      local_98 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szSimpleModelFile");
      if (local_98 != (short *)0x0) {
        uVar13 = 0xffffffffffffffff;
        psVar6 = local_98;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar6;
          psVar6 = psVar6 + 1;
        } while (sVar2 != 0);
        if (1 < ~uVar13 - 1) {
          if (DAT_140607be1 == '\0') {
            uVar7 = FUN_140123ce0();
            FUN_1400015e0(lVar17,uVar7,0,0xffffffffffffffff);
            FUN_140002aa0(lVar17,&DAT_14049a36c,1);
          }
          uVar13 = 0xffffffffffffffff;
          psVar6 = local_98;
          do {
            if (uVar13 == 0) break;
            uVar13 = uVar13 - 1;
            sVar2 = *psVar6;
            psVar6 = psVar6 + 1;
          } while (sVar2 != 0);
          FUN_140002aa0(lVar17,local_98,~uVar13 - 1);
        }
      }
      uVar3 = FUN_1402970c0(lVar5,L"szSubModelFile");
      local_a8 = 1;
      local_98 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szSubModelFile");
      if (local_98 != (short *)0x0) {
        uVar13 = 0xffffffffffffffff;
        psVar6 = local_98;
        do {
          if (uVar13 == 0) break;
          uVar13 = uVar13 - 1;
          sVar2 = *psVar6;
          psVar6 = psVar6 + 1;
        } while (sVar2 != 0);
        if (1 < ~uVar13 - 1) {
          if (DAT_140607be1 == '\0') {
            uVar7 = FUN_140123ce0();
            FUN_1400015e0(puVar18,uVar7,0,0xffffffffffffffff);
            FUN_140002aa0(puVar18,&DAT_14049a36c,1);
          }
          uVar13 = 0xffffffffffffffff;
          psVar6 = local_98;
          do {
            if (uVar13 == 0) break;
            uVar13 = uVar13 - 1;
            sVar2 = *psVar6;
            psVar6 = psVar6 + 1;
          } while (sVar2 != 0);
          FUN_140002aa0(puVar18,local_98,~uVar13 - 1);
        }
      }
      uVar3 = FUN_1402970c0(lVar5,L"szSubModelDummy");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szSubModelDummy");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0xf0,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szSubModelGroup");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szSubModelGroup");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x118,psVar8,~uVar13 - 1);
      puVar16 = puVar19;
      if (7 < *(ulonglong *)(param_1 + 0x40)) {
        puVar16 = *(ushort **)puVar19;
      }
      puVar15 = puVar19;
      if (7 < *(ulonglong *)(param_1 + 0x40)) {
        puVar15 = *(ushort **)puVar19;
      }
      lVar17 = *(longlong *)(param_1 + 0x38);
      if (7 < *(ulonglong *)(param_1 + 0x40)) {
        puVar19 = *(ushort **)puVar19;
      }
      if (puVar19 != puVar15 + lVar17) {
        lVar14 = (longlong)puVar16 - (longlong)puVar19;
        do {
          iVar4 = tolower((uint)*puVar19);
          *(short *)((longlong)puVar19 + lVar14) = (short)iVar4;
          puVar19 = puVar19 + 1;
        } while (puVar19 != puVar15 + lVar17);
      }
      puVar19 = (ushort *)(param_1 + 0x50);
      puVar16 = puVar18;
      if (7 < *(ulonglong *)(param_1 + 0x90)) {
        puVar16 = *(ushort **)puVar18;
      }
      puVar15 = puVar18;
      if (7 < *(ulonglong *)(param_1 + 0x90)) {
        puVar15 = *(ushort **)puVar18;
      }
      lVar17 = *(longlong *)(param_1 + 0x88);
      if (7 < *(ulonglong *)(param_1 + 0x90)) {
        puVar18 = *(ushort **)puVar18;
      }
      if (puVar18 != puVar15 + lVar17) {
        lVar14 = (longlong)puVar16 - (longlong)puVar18;
        do {
          iVar4 = tolower((uint)*puVar18);
          *(short *)((longlong)puVar18 + lVar14) = (short)iVar4;
          puVar18 = puVar18 + 1;
        } while (puVar18 != puVar15 + lVar17);
      }
      puVar18 = puVar19;
      if (7 < *(ulonglong *)(param_1 + 0x68)) {
        puVar18 = *(ushort **)puVar19;
      }
      puVar16 = puVar19;
      if (7 < *(ulonglong *)(param_1 + 0x68)) {
        puVar16 = *(ushort **)puVar19;
      }
      lVar17 = *(longlong *)(param_1 + 0x60);
      if (7 < *(ulonglong *)(param_1 + 0x68)) {
        puVar19 = *(ushort **)puVar19;
      }
      if (puVar19 != puVar16 + lVar17) {
        lVar14 = (longlong)puVar18 - (longlong)puVar19;
        do {
          iVar4 = tolower((uint)*puVar19);
          *(short *)((longlong)puVar19 + lVar14) = (short)iVar4;
          puVar19 = puVar19 + 1;
        } while (puVar19 != puVar16 + lVar17);
      }
      uVar3 = FUN_1402970c0(lVar5,&DAT_14049f290);
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,&DAT_14049f290);
      *(undefined4 *)(param_1 + 0x8e0) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nGender");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nGender");
      *(undefined4 *)(param_1 + 500) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nJob");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nJob");
      *(undefined4 *)(param_1 + 0x1f8) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nStartWorldID");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nStartWorldID");
      *(undefined4 *)(param_1 + 0x1fc) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nHPClass");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nHPClass");
      *(undefined4 *)(param_1 + 0x204) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nMPClass");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nMPClass");
      *(undefined4 *)(param_1 + 0x208) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nSPClass");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nSPClass");
      *(undefined4 *)(param_1 + 0x20c) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fHPRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fHPRevision");
      *(undefined4 *)(param_1 + 0x210) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fMPRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fMPRevision");
      *(undefined4 *)(param_1 + 0x214) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fHPRecoveryRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fHPRecoveryRevision");
      *(undefined4 *)(param_1 + 0x21c) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fMPRecoveryRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fMPRecoveryRevision");
      *(undefined4 *)(param_1 + 0x220) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fSPRecoveryRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fSPRecoveryRevision");
      *(undefined4 *)(param_1 + 0x224) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fMeleeAttackRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fMeleeAttackRevision");
      *(undefined4 *)(param_1 + 0x228) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fRangeAttackRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fRangeAttackRevision");
      *(undefined4 *)(param_1 + 0x22c) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fMagicAttackRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fMagicAttackRevision");
      *(undefined4 *)(param_1 + 0x230) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fMeleeDefenseRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fMeleeDefenseRevision");
      *(undefined4 *)(param_1 + 0x234) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fMagicDefenseRevision");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fMagicDefenseRevision");
      *(undefined4 *)(param_1 + 0x238) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fCritical");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fCritical");
      *(undefined4 *)(param_1 + 2000) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"szSkin");
      local_a8 = 1;
      pwVar10 = (wchar_t *)FUN_140296990(lVar5,param_2,uVar3,L"szSkin");
      uVar3 = FUN_1402970c0(lVar5,L"szLeftHandDummyName");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szLeftHandDummyName");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x158,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szRightHandDummyName");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szRightHandDummyName");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x180,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szCatchDummyName");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szCatchDummyName");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x1a8,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"fMove01Speed");
      local_a8 = 1;
      uVar7 = FUN_1402967b0(lVar5,param_2,uVar3,L"fMove01Speed");
      FUN_14008ea70(param_1 + 0x348,uVar7);
      uVar3 = FUN_1402970c0(lVar5,L"fStature");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fStature");
      *(undefined4 *)(param_1 + 0x294) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fJumpHeight");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fJumpHeight");
      *(undefined4 *)(param_1 + 0x298) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fJump2Height");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fJump2Height");
      *(undefined4 *)(param_1 + 0x29c) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fMoveHeight");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fMoveHeight");
      *(undefined4 *)(param_1 + 0x2a0) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fWeight");
      local_a8 = 1;
      pfVar11 = (float *)FUN_1402967b0(lVar5,param_2,uVar3,L"fWeight");
      fVar1 = *pfVar11;
      local_98 = (short *)CONCAT44(local_98._4_4_,fVar1);
      uVar3 = FUN_1402970c0(lVar5,L"fWideRadius");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fWideRadius");
      *(undefined4 *)(param_1 + 0x2a8) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fRebirthInvincibility");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fRebirthInvincibility");
      *(undefined4 *)(param_1 + 0x344) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fDownDamage");
      local_a8 = 0;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fDownDamage");
      if (puVar9 != (undefined4 *)0x0) {
        *(undefined4 *)(param_1 + 0x154) = *puVar9;
      }
      uVar3 = FUN_1402970c0(lVar5,L"szCommandTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szCommandTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x368,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szNullMotionTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szNullMotionTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x430,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szAttackTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szAttackTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x3b8,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szDownMotionTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szDownMotionTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x408,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szSkillTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szSkillTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x458,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szAttackDefenseClassTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szAttackDefenseClassTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x480,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szDamageSoundTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szDamageSoundTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x4f8,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szSkillSlotTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szSkillSlotTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x520,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szStateMotionTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szStateMotionTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x548,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szFirstCommandTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szFirstCommandTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x570,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szBasicMotionTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szBasicMotionTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x598,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szChargeAttackTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szChargeAttackTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x5c0,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szSpecialGaugeTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szSpecialGaugeTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x5e8,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szAttackLimitTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szAttackLimitTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x638,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szGimmickLimitTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szGimmickLimitTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x660,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szAttackBulletTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szAttackBulletTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x688,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szPartsTable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szPartsTable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x6d8,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szMySkillUITable");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szMySkillUITable");
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x700,psVar8,~uVar13 - 1);
      uVar3 = FUN_1402970c0(lVar5,L"szEquipIgnoreDummy");
      local_a8 = 1;
      uVar7 = FUN_140296990(lVar5,param_2,uVar3,L"szEquipIgnoreDummy");
      FUN_140123dc0(param_1 + 0x728);
      FUN_140415b90(param_1 + 0x728,uVar7,&DAT_14049c7b8);
      uVar3 = FUN_1402970c0(lVar5,L"fHeadPos");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fHeadPos");
      *(undefined4 *)(param_1 + 0x2d8) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"fRisingDamageWeight");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_1402967b0(lVar5,param_2,uVar3,L"fRisingDamageWeight");
      *(undefined4 *)(param_1 + 0x2dc) = *puVar9;
      local_90[0] = 0x3f800000;
      ppsVar12 = (short **)local_90;
      if (1.0 <= fVar1) {
        ppsVar12 = &local_98;
      }
      *(undefined4 *)(param_1 + 0x2a4) = *(undefined4 *)ppsVar12;
      bVar22 = true;
      *(undefined4 *)(param_1 + 0x7e8) = 0;
      lVar17 = 6;
      pwVar20 = pwVar10;
      pwVar21 = L"STEEL";
      do {
        if (lVar17 == 0) break;
        lVar17 = lVar17 + -1;
        bVar22 = *pwVar20 == *pwVar21;
        pwVar20 = pwVar20 + 1;
        pwVar21 = pwVar21 + 1;
      } while (bVar22);
      if (bVar22) {
        *(undefined4 *)(param_1 + 0x7e8) = 1;
      }
      else {
        lVar17 = 5;
        pwVar20 = pwVar10;
        pwVar21 = L"SKIN";
        do {
          if (lVar17 == 0) break;
          lVar17 = lVar17 + -1;
          bVar22 = *pwVar20 == *pwVar21;
          pwVar20 = pwVar20 + 1;
          pwVar21 = pwVar21 + 1;
        } while (bVar22);
        if (bVar22) {
          *(undefined4 *)(param_1 + 0x7e8) = 2;
        }
        else {
          lVar17 = 5;
          pwVar20 = pwVar10;
          pwVar21 = L"WOOD";
          do {
            if (lVar17 == 0) break;
            lVar17 = lVar17 + -1;
            bVar22 = *pwVar20 == *pwVar21;
            pwVar20 = pwVar20 + 1;
            pwVar21 = pwVar21 + 1;
          } while (bVar22);
          if (bVar22) {
            *(undefined4 *)(param_1 + 0x7e8) = 3;
          }
          else {
            lVar17 = 6;
            pwVar20 = L"STONE";
            do {
              if (lVar17 == 0) break;
              lVar17 = lVar17 + -1;
              bVar22 = *pwVar10 == *pwVar20;
              pwVar10 = pwVar10 + 1;
              pwVar20 = pwVar20 + 1;
            } while (bVar22);
            uVar3 = 0;
            if (bVar22) {
              uVar3 = 4;
            }
            *(undefined4 *)(param_1 + 0x7e8) = uVar3;
          }
        }
      }
      uVar3 = FUN_1402970c0(lVar5,L"nAttributeResistanceFire");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nAttributeResistanceFire");
      *(undefined4 *)(param_1 + 0x7fc) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nAttributeResistanceWater");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nAttributeResistanceWater");
      *(undefined4 *)(param_1 + 0x800) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nAttributeResistanceLight");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nAttributeResistanceLight");
      *(undefined4 *)(param_1 + 0x804) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nAttributeResistanceDarkness");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nAttributeResistanceDarkness");
      *(undefined4 *)(param_1 + 0x808) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nAttributeResistanceEarth");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nAttributeResistanceEarth");
      *(undefined4 *)(param_1 + 0x80c) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nAttributeResistanceWindy");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nAttributeResistanceWindy");
      *(undefined4 *)(param_1 + 0x810) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nAttributeResistanceToxication");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nAttributeResistanceToxication");
      *(undefined4 *)(param_1 + 0x814) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nAttributeResistanceLightning");
      local_a8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nAttributeResistanceLightning");
      *(undefined4 *)(param_1 + 0x818) = *puVar9;
      uVar3 = FUN_1402970c0(lVar5,L"nClassGroup");
      local_a8 = 0;
      puVar9 = (undefined4 *)FUN_140296600(lVar5,param_2,uVar3,L"nClassGroup");
      if (puVar9 != (undefined4 *)0x0) {
        *(undefined4 *)(param_1 + 0x200) = *puVar9;
      }
      param_1 = param_1 + 0x768;
      FUN_140123dc0(param_1);
      uVar3 = FUN_1402970c0(lVar5,L"szJobIcon00");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szJobIcon00");
      local_68 = 7;
      local_70 = 0;
      local_80 = 0;
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_80,psVar8,~uVar13 - 1);
      FUN_140165f30(param_1,&local_80);
      if (7 < local_68) {
        operator_delete((void *)CONCAT62(uStack_7e,local_80));
      }
      uVar3 = FUN_1402970c0(lVar5,L"szJobIcon01");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szJobIcon01");
      local_68 = 7;
      local_70 = 0;
      local_80 = 0;
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_80,psVar8,~uVar13 - 1);
      FUN_140165f30(param_1,&local_80);
      if (7 < local_68) {
        operator_delete((void *)CONCAT62(uStack_7e,local_80));
      }
      uVar3 = FUN_1402970c0(lVar5,L"szJobIcon02");
      local_a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,param_2,uVar3,L"szJobIcon02");
      local_68 = 7;
      local_70 = 0;
      local_80 = 0;
      uVar13 = 0xffffffffffffffff;
      psVar6 = psVar8;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar6;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_80,psVar8,~uVar13 - 1);
      FUN_140165f30(param_1,&local_80);
      if (7 < local_68) {
        operator_delete((void *)CONCAT62(uStack_7e,local_80));
      }
      return 1;
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140323730(longlong param_1,uint *param_2)

{
  wchar_t wVar1;
  short sVar2;
  ushort *puVar3;
  undefined1 uVar4;
  int iVar5;
  uint uVar6;
  int iVar7;
  longlong lVar8;
  undefined8 uVar9;
  short *psVar10;
  short **ppsVar11;
  short *psVar12;
  short *psVar13;
  short *psVar14;
  undefined8 uVar15;
  undefined8 uVar16;
  ulonglong uVar17;
  uint *puVar18;
  ushort *****pppppuVar19;
  uint *puVar20;
  wchar_t *pwVar21;
  ushort *puVar22;
  undefined2 *puVar23;
  wchar_t *pwVar24;
  ushort *puVar25;
  wchar_t *pwVar26;
  undefined4 *puVar27;
  int iVar28;
  longlong lVar29;
  bool bVar30;
  uint uVar31;
  undefined4 uVar32;
  uint uVar33;
  undefined1 auStack_368 [32];
  short *local_348;
  undefined8 local_340;
  ushort ****local_338;
  longlong local_330;
  ulonglong local_328;
  ulonglong local_320;
  undefined2 local_310;
  undefined6 uStack_30e;
  undefined8 local_300;
  ulonglong local_2f8;
  undefined2 local_2e8;
  undefined6 uStack_2e6;
  undefined8 local_2d8;
  ulonglong local_2d0;
  void *local_2c0 [3];
  ulonglong local_2a8;
  undefined1 local_298 [288];
  undefined1 local_178 [288];
  ulonglong local_58;
  
  local_340 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_368;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  puVar20 = (uint *)0x0;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) goto LAB_1403237bc;
        break;
      }
    }
  }
  puVar18 = puVar20;
LAB_1403237bc:
  pwVar24 = L"undefined";
  if (puVar18 == (uint *)0x0) {
    pwVar21 = L"undefined";
  }
  else {
    if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    pwVar21 = (wchar_t *)(puVar18 + 0xe);
    if (7 < *(ulonglong *)(puVar18 + 0x14)) {
      pwVar21 = *(wchar_t **)pwVar21;
    }
  }
  uVar17 = 0xffffffffffffffff;
  pwVar26 = pwVar21;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    wVar1 = *pwVar26;
    pwVar26 = pwVar26 + 1;
  } while (wVar1 != L'\0');
  FUN_140001710(param_1,pwVar21,~uVar17 - 1);
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          pwVar21 = (wchar_t *)(puVar18 + 0x2c);
          if (7 < *(ulonglong *)(puVar18 + 0x32)) {
            pwVar21 = *(wchar_t **)pwVar21;
          }
          if (pwVar21 == (wchar_t *)0x0) goto LAB_1403238fc;
          goto LAB_14032388f;
        }
        break;
      }
    }
  }
  pwVar21 = L"undefined";
LAB_14032388f:
  uVar17 = 0xffffffffffffffff;
  pwVar26 = pwVar21;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    wVar1 = *pwVar26;
    pwVar26 = pwVar26 + 1;
  } while (wVar1 != L'\0');
  if (1 < ~uVar17 - 1) {
    if (DAT_140607be1 == '\0') {
      uVar9 = FUN_140123ce0();
      FUN_1400015e0(param_1 + 0x28,uVar9,0,0xffffffffffffffff);
      FUN_140002aa0(param_1 + 0x28,&DAT_14049a36c,1);
    }
    uVar17 = 0xffffffffffffffff;
    pwVar26 = pwVar21;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      wVar1 = *pwVar26;
      pwVar26 = pwVar26 + 1;
    } while (wVar1 != L'\0');
    FUN_140002aa0(param_1 + 0x28,pwVar21,~uVar17 - 1);
  }
LAB_1403238fc:
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          pwVar21 = (wchar_t *)(puVar18 + 0x36);
          if (7 < *(ulonglong *)(puVar18 + 0x3c)) {
            pwVar21 = *(wchar_t **)pwVar21;
          }
          if (pwVar21 != (wchar_t *)0x0) goto LAB_14032397b;
          goto LAB_1403239e8;
        }
        break;
      }
    }
  }
  pwVar21 = L"undefined";
LAB_14032397b:
  uVar17 = 0xffffffffffffffff;
  pwVar26 = pwVar21;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    wVar1 = *pwVar26;
    pwVar26 = pwVar26 + 1;
  } while (wVar1 != L'\0');
  if (1 < ~uVar17 - 1) {
    if (DAT_140607be1 == '\0') {
      uVar9 = FUN_140123ce0();
      FUN_1400015e0(param_1 + 0x78,uVar9,0,0xffffffffffffffff);
      FUN_140002aa0(param_1 + 0x78,&DAT_14049a36c,1);
    }
    uVar17 = 0xffffffffffffffff;
    pwVar26 = pwVar21;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      wVar1 = *pwVar26;
      pwVar26 = pwVar26 + 1;
    } while (wVar1 != L'\0');
    FUN_140002aa0(param_1 + 0x78,pwVar21,~uVar17 - 1);
  }
LAB_1403239e8:
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          pwVar21 = (wchar_t *)(puVar18 + 0x40);
          if (7 < *(ulonglong *)(puVar18 + 0x46)) {
            pwVar21 = *(wchar_t **)pwVar21;
          }
          goto LAB_140323a62;
        }
        break;
      }
    }
  }
  pwVar21 = L"undefined";
LAB_140323a62:
  uVar17 = 0xffffffffffffffff;
  pwVar26 = pwVar21;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    wVar1 = *pwVar26;
    pwVar26 = pwVar26 + 1;
  } while (wVar1 != L'\0');
  FUN_140001710(param_1 + 0xf0,pwVar21,~uVar17 - 1);
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          pwVar24 = (wchar_t *)(puVar18 + 0x4a);
          if (7 < *(ulonglong *)(puVar18 + 0x50)) {
            pwVar24 = *(wchar_t **)pwVar24;
          }
        }
        break;
      }
    }
  }
  uVar17 = 0xffffffffffffffff;
  pwVar21 = pwVar24;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    wVar1 = *pwVar21;
    pwVar21 = pwVar21 + 1;
  } while (wVar1 != L'\0');
  FUN_140001710(param_1 + 0x118,pwVar24,~uVar17 - 1);
  puVar25 = (ushort *)(param_1 + 0x28);
  puVar22 = puVar25;
  puVar3 = puVar25;
  if (7 < *(ulonglong *)(param_1 + 0x40)) {
    puVar22 = *(ushort **)puVar25;
    puVar3 = *(ushort **)puVar25;
  }
  lVar8 = *(longlong *)(param_1 + 0x38);
  if (7 < *(ulonglong *)(param_1 + 0x40)) {
    puVar25 = *(ushort **)puVar25;
  }
  if (puVar25 != puVar22 + lVar8) {
    lVar29 = (longlong)puVar3 - (longlong)puVar25;
    do {
      iVar5 = tolower((uint)*puVar25);
      *(short *)((longlong)puVar25 + lVar29) = (short)iVar5;
      puVar25 = puVar25 + 1;
    } while (puVar25 != puVar22 + lVar8);
  }
  puVar25 = (ushort *)(param_1 + 0x78);
  puVar22 = puVar25;
  puVar3 = puVar25;
  if (7 < *(ulonglong *)(param_1 + 0x90)) {
    puVar22 = *(ushort **)puVar25;
    puVar3 = *(ushort **)puVar25;
  }
  lVar8 = *(longlong *)(param_1 + 0x88);
  if (7 < *(ulonglong *)(param_1 + 0x90)) {
    puVar25 = *(ushort **)puVar25;
  }
  if (puVar25 != puVar22 + lVar8) {
    lVar29 = (longlong)puVar3 - (longlong)puVar25;
    do {
      iVar5 = tolower((uint)*puVar25);
      *(short *)(lVar29 + (longlong)puVar25) = (short)iVar5;
      puVar25 = puVar25 + 1;
    } while (puVar25 != puVar22 + lVar8);
  }
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar6 = 0;
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x54];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x8ec) = uVar31;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x78];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x1f0) = uVar31;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x79];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 500) = uVar31;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          pwVar24 = (wchar_t *)(puVar18 + 0x7a);
          if (7 < *(ulonglong *)(puVar18 + 0x80)) {
            pwVar24 = *(wchar_t **)pwVar24;
          }
          goto LAB_140323da7;
        }
        break;
      }
    }
  }
  pwVar24 = L"";
LAB_140323da7:
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x84];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x7a4) = uVar31;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x85];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x7a8) = uVar31;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x86];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x7ac) = uVar31;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) goto LAB_140323f51;
        break;
      }
    }
  }
  puVar18 = puVar20;
LAB_140323f51:
  uVar33 = 0;
  if (puVar18 == (uint *)0x0) {
    uVar31 = 0;
  }
  else {
    if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    uVar31 = puVar18[0x87];
  }
  *(uint *)(param_1 + 0x7e0) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x88];
          goto LAB_140323ff8;
        }
        break;
      }
    }
  }
  uVar31 = 0;
LAB_140323ff8:
  *(uint *)(param_1 + 0x7b0) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x89];
          goto LAB_140324073;
        }
        break;
      }
    }
  }
  uVar31 = 0;
LAB_140324073:
  *(uint *)(param_1 + 0x7b4) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x8a];
          goto LAB_1403240ee;
        }
        break;
      }
    }
  }
  uVar31 = 0;
LAB_1403240ee:
  *(uint *)(param_1 + 0x7b8) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x8b];
          goto LAB_140324169;
        }
        break;
      }
    }
  }
  uVar31 = 0;
LAB_140324169:
  *(uint *)(param_1 + 0x7bc) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x8c];
          goto LAB_1403241e4;
        }
        break;
      }
    }
  }
  uVar31 = 0;
LAB_1403241e4:
  *(uint *)(param_1 + 0x7c0) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x8d];
          goto LAB_14032425f;
        }
        break;
      }
    }
  }
  uVar31 = 0;
LAB_14032425f:
  *(uint *)(param_1 + 0x7c4) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x8e];
          goto LAB_1403242da;
        }
        break;
      }
    }
  }
  uVar31 = 0;
LAB_1403242da:
  *(uint *)(param_1 + 0x7c8) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar18[0x8f];
          goto LAB_140324355;
        }
        break;
      }
    }
  }
  uVar31 = 0;
LAB_140324355:
  *(uint *)(param_1 + 0x7cc) = uVar31;
  uVar31 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar31 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar31) && (*puVar18 == uVar31)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar33 = puVar18[0x90];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 2000) = uVar33;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301170(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x7d4) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403011d0(uVar9);
  *(undefined4 *)(param_1 + 0x7d8) = uVar32;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 0x248)) {
      if ((puVar18[0x24a] == uVar33) && (*puVar18 == uVar33)) {
        if (puVar18 != (uint *)0x0) {
          if (puVar18 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar6 = puVar18[0xd0];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x7f4) = uVar6;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301230(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x7f8) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403010d0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x8f8) = uVar32;
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301280(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x900,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403012e0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x928) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301340(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x92c) = uVar32;
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140302680(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0xa0,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_1403013a0(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x240,psVar10,~uVar17 - 1);
  FUN_1404151b0(param_1 + 0x240);
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301400(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x268) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301460(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x26c) = uVar32;
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_1403026e0(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 200,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  uVar4 = FUN_1403027a0(uVar9,*param_2);
  *(undefined1 *)(param_1 + 0x140) = uVar4;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403014c0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x144) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301520(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x148) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301580(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x150) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403015e0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x154) = uVar32;
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301640(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x158,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_1403016a0(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x180,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  lVar8 = FUN_140301700(uVar9,*param_2);
  if (lVar8 != 0) {
    local_338 = (ushort ****)0x0;
    local_330 = 0;
    local_328 = 0;
    FUN_140415930(&local_338,lVar8,&DAT_14049c7b8);
    FUN_140123dc0(param_1 + 0x1d0);
    iVar7 = (int)(local_330 - (longlong)local_338 >> 0x3f);
    iVar5 = (int)((local_330 - (longlong)local_338) / 0x28) + iVar7;
    if (iVar5 != iVar7 && -1 < iVar5 - iVar7) {
      do {
        FUN_14008ec00(param_1 + 0x1d0,local_338 + (longlong)(int)puVar20 * 5);
        uVar33 = (int)puVar20 + 1;
        puVar20 = (uint *)(ulonglong)uVar33;
      } while ((int)uVar33 < (int)((local_330 - (longlong)local_338) / 0x28));
    }
    if ((ushort *****)local_338 != (ushort *****)0x0) {
      std::_Container_base0::_Orphan_all((_Container_base0 *)&local_338);
      FUN_14008d0a0(local_338,local_330);
      operator_delete(local_338);
    }
  }
  iVar5 = 0;
  uVar9 = FUN_140302f80();
  local_348._0_4_ = FUN_140301760(uVar9,*param_2);
  FUN_14008ea70(param_1 + 0x348,&local_348);
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403017c0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x7dc) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301820(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x294) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301880(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x298) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403018e0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x2a0) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301940(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x2a4) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403019a0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x2a8) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301a00(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x278) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301a60(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x27c) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301ac0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x280) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301b20(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x284) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301b80(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x28c) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301be0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x290) = uVar32;
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301c40(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x610,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301ca0(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x2b0,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302740(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x2d8) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140301d00(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x2dc) = uVar32;
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301d60(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x390,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301dc0(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x430,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301e20(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x3b8,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301e80(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x408,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301ee0(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x4a8,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301f40(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x4d0,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140301fa0(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x4f8,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140302000(uVar9,*param_2);
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x598,psVar10,~uVar17 - 1);
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140302060(uVar9,*param_2);
  local_2f8 = 7;
  local_300 = 0;
  local_310 = 0;
  uVar17 = 0xffffffffffffffff;
  psVar12 = psVar10;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar2 != 0);
  FUN_140001710(&local_310,psVar10,~uVar17 - 1);
  puVar23 = &local_310;
  if (7 < local_2f8) {
    puVar23 = (undefined2 *)CONCAT62(uStack_30e,local_310);
  }
  FUN_140415930(param_1 + 0x748,puVar23,&DAT_14049c7b8);
  local_348 = (short *)CONCAT44(local_348._4_4_,0x3f800000);
  bVar30 = *(float *)(param_1 + 0x2a4) == 1.0;
  ppsVar11 = &local_348;
  if (1.0 < *(float *)(param_1 + 0x2a4) || bVar30) {
    ppsVar11 = (short **)(param_1 + 0x2a4);
  }
  *(undefined4 *)(param_1 + 0x2a4) = *(undefined4 *)ppsVar11;
  *(undefined4 *)(param_1 + 0x7e8) = 0;
  lVar8 = 6;
  pwVar21 = pwVar24;
  pwVar26 = L"STEEL";
  do {
    if (lVar8 == 0) break;
    lVar8 = lVar8 + -1;
    bVar30 = *pwVar21 == *pwVar26;
    pwVar21 = pwVar21 + 1;
    pwVar26 = pwVar26 + 1;
  } while (bVar30);
  if (bVar30) {
    *(undefined4 *)(param_1 + 0x7e8) = 1;
  }
  else {
    lVar8 = 5;
    pwVar21 = pwVar24;
    pwVar26 = L"SKIN";
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar30 = *pwVar21 == *pwVar26;
      pwVar21 = pwVar21 + 1;
      pwVar26 = pwVar26 + 1;
    } while (bVar30);
    if (bVar30) {
      *(undefined4 *)(param_1 + 0x7e8) = 2;
    }
    else {
      lVar8 = 5;
      pwVar21 = pwVar24;
      pwVar26 = L"WOOD";
      do {
        if (lVar8 == 0) break;
        lVar8 = lVar8 + -1;
        bVar30 = *pwVar21 == *pwVar26;
        pwVar21 = pwVar21 + 1;
        pwVar26 = pwVar26 + 1;
      } while (bVar30);
      if (bVar30) {
        *(undefined4 *)(param_1 + 0x7e8) = 3;
      }
      else {
        lVar8 = 6;
        pwVar21 = L"STONE";
        do {
          if (lVar8 == 0) break;
          lVar8 = lVar8 + -1;
          bVar30 = *pwVar24 == *pwVar21;
          pwVar24 = pwVar24 + 1;
          pwVar21 = pwVar21 + 1;
        } while (bVar30);
        uVar32 = 0;
        if (bVar30) {
          uVar32 = 4;
        }
        *(undefined4 *)(param_1 + 0x7e8) = uVar32;
      }
    }
  }
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403020c0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x7ec) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302120(uVar9);
  *(undefined4 *)(param_1 + 0x7f0) = uVar32;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar6 = 0;
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar20 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0x248)) {
      if ((puVar20[0x24a] == uVar33) && (*puVar20 == uVar33)) {
        if (puVar20 != (uint *)0x0) {
          if (puVar20 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar20[0x1d1];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x7fc) = uVar31;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302800(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x800) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302850(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x804) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403028a0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x808) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403028f0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x80c) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302940(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x810) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302990(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x814) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403029e0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x818) = uVar32;
  iVar7 = 0;
  do {
    iVar28 = iVar7 + 1;
    local_348._0_4_ = iVar28;
    uVar9 = FUN_14030e250(local_298,L"wszConditionResistance%1$02d");
    uVar9 = FUN_14030f380(uVar9,&local_348);
    FUN_14030e390(local_2c0,uVar9);
    FUN_14030ac20(local_298);
    local_348 = (short *)CONCAT44(local_348._4_4_,iVar28);
    uVar9 = FUN_14030e250(local_178,L"fConditionResistanceValue%1$02d");
    uVar9 = FUN_14030f380(uVar9,&local_348);
    FUN_14030e390(&local_2e8,uVar9);
    FUN_14030ac20(local_178);
    uVar9 = FUN_140302f80();
    psVar12 = (short *)FUN_140302a30(uVar9,*param_2,iVar7);
    if (psVar12 != (short *)0x0) {
      local_320 = 7;
      local_328 = 0;
      local_338 = (ushort ****)((ulonglong)local_338 & 0xffffffffffff0000);
      uVar17 = 0xffffffffffffffff;
      psVar10 = psVar12;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar10;
        psVar10 = psVar10 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_338,psVar12,~uVar17 - 1);
      uVar9 = FUN_140302f80();
      uVar32 = FUN_140302c60(uVar9,*param_2,iVar7);
      pppppuVar19 = &local_338;
      if (7 < local_320) {
        pppppuVar19 = (ushort *****)local_338;
      }
      uVar17 = 0x12;
      if (local_328 < 0x12) {
        uVar17 = local_328;
      }
      pwVar24 = L"CONDITION_BLEEDING";
      for (; uVar33 = uVar6, uVar17 != 0; uVar17 = uVar17 - 1) {
        if (*(wchar_t *)pppppuVar19 != *pwVar24) {
          uVar33 = 1;
          if ((ushort)*(wchar_t *)pppppuVar19 < (ushort)*pwVar24) {
            uVar33 = 0xffffffff;
          }
          break;
        }
        pppppuVar19 = (ushort *****)((longlong)pppppuVar19 + 2);
        pwVar24 = pwVar24 + 1;
      }
      if (uVar33 == 0) {
        if (local_328 < 0x12) {
          uVar33 = 0xffffffff;
        }
        else {
          uVar33 = (uint)(local_328 != 0x12);
        }
      }
      if (uVar33 == 0) {
        *(undefined4 *)(param_1 + 0x81c) = uVar32;
      }
      else {
        pppppuVar19 = &local_338;
        if (7 < local_320) {
          pppppuVar19 = (ushort *****)local_338;
        }
        uVar17 = 0xf;
        if (local_328 < 0xf) {
          uVar17 = local_328;
        }
        pwVar24 = L"CONDITION_CHAOS";
        for (; uVar33 = uVar6, uVar17 != 0; uVar17 = uVar17 - 1) {
          if (*(wchar_t *)pppppuVar19 != *pwVar24) {
            uVar33 = 1;
            if ((ushort)*(wchar_t *)pppppuVar19 < (ushort)*pwVar24) {
              uVar33 = 0xffffffff;
            }
            break;
          }
          pppppuVar19 = (ushort *****)((longlong)pppppuVar19 + 2);
          pwVar24 = pwVar24 + 1;
        }
        if (uVar33 == 0) {
          if (local_328 < 0xf) {
            uVar33 = 0xffffffff;
          }
          else {
            uVar33 = (uint)(local_328 != 0xf);
          }
        }
        if (uVar33 == 0) {
          *(undefined4 *)(param_1 + 0x844) = uVar32;
        }
        else {
          pppppuVar19 = &local_338;
          if (7 < local_320) {
            pppppuVar19 = (ushort *****)local_338;
          }
          uVar17 = 0xe;
          if (local_328 < 0xe) {
            uVar17 = local_328;
          }
          pwVar24 = L"CONDITION_COLD";
          for (; uVar33 = uVar6, uVar17 != 0; uVar17 = uVar17 - 1) {
            if (*(wchar_t *)pppppuVar19 != *pwVar24) {
              uVar33 = 1;
              if ((ushort)*(wchar_t *)pppppuVar19 < (ushort)*pwVar24) {
                uVar33 = 0xffffffff;
              }
              break;
            }
            pppppuVar19 = (ushort *****)((longlong)pppppuVar19 + 2);
            pwVar24 = pwVar24 + 1;
          }
          if (uVar33 == 0) {
            if (local_328 < 0xe) {
              uVar33 = 0xffffffff;
            }
            else {
              uVar33 = (uint)(local_328 != 0xe);
            }
          }
          if (uVar33 == 0) {
            *(undefined4 *)(param_1 + 0x820) = uVar32;
          }
          else {
            iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_FIRE",0xe);
            if (iVar7 == 0) {
              *(undefined4 *)(param_1 + 0x824) = uVar32;
            }
            else {
              iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_FREEZE",0x10);
              if (iVar7 == 0) {
                *(undefined4 *)(param_1 + 0x830) = uVar32;
              }
              else {
                iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_HOLD",0xe);
                if (iVar7 == 0) {
                  *(undefined4 *)(param_1 + 0x850) = uVar32;
                }
                else {
                  iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_SICKNESS",0x12);
                  if (iVar7 == 0) {
                    *(undefined4 *)(param_1 + 0x83c) = uVar32;
                  }
                  else {
                    iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_SLEEP",0xf);
                    if (iVar7 == 0) {
                      *(undefined4 *)(param_1 + 0x840) = uVar32;
                    }
                    else {
                      iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_SLOW",0xe);
                      if (iVar7 == 0) {
                        *(undefined4 *)(param_1 + 0x834) = uVar32;
                      }
                      else {
                        iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_STONE",0xf);
                        if (iVar7 == 0) {
                          *(undefined4 *)(param_1 + 0x82c) = uVar32;
                        }
                        else {
                          iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_STUN",0xe);
                          if (iVar7 == 0) {
                            *(undefined4 *)(param_1 + 0x828) = uVar32;
                          }
                          else {
                            iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_TOXICATION",0x14)
                            ;
                            if (iVar7 == 0) {
                              *(undefined4 *)(param_1 + 0x838) = uVar32;
                            }
                            else {
                              iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_LIGHTNING",0x13
                                                   );
                              if (iVar7 == 0) {
                                *(undefined4 *)(param_1 + 0x848) = uVar32;
                              }
                              else {
                                iVar7 = FUN_140123e30(&local_338,local_328,L"CONDITION_DARKNESS",
                                                      0x12);
                                if (iVar7 == 0) {
                                  *(undefined4 *)(param_1 + 0x84c) = uVar32;
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      if (7 < local_320) {
        operator_delete(local_338);
      }
    }
    if (7 < local_2d0) {
      operator_delete((void *)CONCAT62(uStack_2e6,local_2e8));
    }
    local_2d0 = 7;
    local_2d8 = 0;
    local_2e8 = 0;
    if (7 < local_2a8) {
      operator_delete(local_2c0[0]);
    }
    iVar7 = iVar28;
  } while (iVar28 < 10);
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar20 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0x248)) {
      if ((puVar20[0x24a] == uVar33) && (*puVar20 == uVar33)) {
        if (puVar20 != (uint *)0x0) {
          if (puVar20 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar20[0x180];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x854) = uVar31;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302180(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x288) = uVar32;
  uVar9 = FUN_140302f80();
  psVar12 = (short *)FUN_1403021e0(uVar9,*param_2);
  local_348 = psVar12;
  uVar9 = FUN_140302f80();
  psVar10 = (short *)FUN_140302240(uVar9,*param_2);
  uVar9 = FUN_140302f80();
  psVar13 = (short *)FUN_1403022a0(uVar9,*param_2);
  FUN_140302f80();
  psVar14 = (short *)FUN_140302300();
  if (psVar12 != (short *)0x0) {
    uVar17 = 0xffffffffffffffff;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      sVar2 = *psVar12;
      psVar12 = psVar12 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x458,local_348,~uVar17 - 1);
  }
  if (psVar10 != (short *)0x0) {
    uVar17 = 0xffffffffffffffff;
    psVar12 = psVar10;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      sVar2 = *psVar12;
      psVar12 = psVar12 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x868,psVar10,~uVar17 - 1);
  }
  if (psVar13 != (short *)0x0) {
    uVar17 = 0xffffffffffffffff;
    psVar12 = psVar13;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      sVar2 = *psVar12;
      psVar12 = psVar12 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x890,psVar13,~uVar17 - 1);
  }
  if (psVar14 != (short *)0x0) {
    uVar17 = 0xffffffffffffffff;
    psVar12 = psVar14;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      sVar2 = *psVar12;
      psVar12 = psVar12 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x8b8,psVar14,~uVar17 - 1);
  }
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar20 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0x248)) {
      if ((puVar20[0x24a] == uVar33) && (*puVar20 == uVar33)) {
        if (puVar20 != (uint *)0x0) {
          if (puVar20 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar20[0x1aa];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x858) = uVar31;
  *(uint *)(param_1 + 0x8e0) = *param_2;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  uVar31 = uVar6;
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar20 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0x248)) {
      if ((puVar20[0x24a] == uVar33) && (*puVar20 == uVar33)) {
        if (puVar20 != (uint *)0x0) {
          if (puVar20 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar31 = puVar20[0x1ab];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x85c) = uVar31;
  uVar33 = *param_2;
  lVar8 = FUN_140302f80();
  if (*(longlong *)(lVar8 + 0x90) != 0) {
    for (puVar20 = *(uint **)(*(longlong *)(lVar8 + 0x90) +
                             ((ulonglong)uVar33 % (ulonglong)*(uint *)(lVar8 + 0xa0)) * 8);
        puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0x248)) {
      if ((puVar20[0x24a] == uVar33) && (*puVar20 == uVar33)) {
        if (puVar20 != (uint *)0x0) {
          if (puVar20 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar6 = puVar20[0x1ac];
        }
        break;
      }
    }
  }
  *(uint *)(param_1 + 0x8e4) = uVar6;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302360(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x860) = uVar32;
  uVar9 = FUN_140302f80();
  psVar12 = (short *)FUN_1403023c0(uVar9,*param_2);
  if (psVar12 != (short *)0x0) {
    uVar17 = 0xffffffffffffffff;
    psVar10 = psVar12;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      sVar2 = *psVar10;
      psVar10 = psVar10 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x6b0,psVar12,~uVar17 - 1);
  }
  uVar9 = FUN_140302f80();
  uVar9 = FUN_140302420(uVar9,*param_2);
  uVar15 = FUN_140302f80();
  uVar15 = FUN_140302480(uVar15,*param_2);
  uVar16 = FUN_140302f80();
  uVar32 = FUN_1403024e0(uVar16,*param_2);
  *(undefined4 *)(param_1 + 0x340) = uVar32;
  FUN_140327e90(param_1 + 0x2e0,uVar9);
  FUN_140327e90(param_1 + 0x310,uVar15);
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302540(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x8e8) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302590(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x8f0) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_1403025e0(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x8f4) = uVar32;
  uVar9 = FUN_140302f80();
  iVar7 = FUN_140302630(uVar9,*param_2);
  *(bool *)(param_1 + 0x7a0) = iVar7 == 1;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302e20(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x788) = uVar32;
  uVar9 = FUN_140302f80();
  uVar32 = FUN_140302e70(uVar9,*param_2);
  *(undefined4 *)(param_1 + 0x78c) = uVar32;
  puVar27 = (undefined4 *)(param_1 + 0x790);
  do {
    uVar9 = FUN_140302f80();
    uVar32 = FUN_140302ec0(uVar9,*param_2,iVar5);
    *puVar27 = uVar32;
    iVar5 = iVar5 + 1;
    puVar27 = puVar27 + 1;
  } while (iVar5 < 4);
  if (7 < local_2f8) {
    operator_delete((void *)CONCAT62(uStack_30e,local_310));
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140325780(longlong param_1,undefined4 param_2)

{
  short sVar1;
  wchar_t wVar2;
  void *pvVar3;
  ushort *****pppppuVar4;
  void *pvVar5;
  int iVar6;
  undefined4 uVar7;
  uint uVar8;
  undefined8 uVar9;
  longlong lVar10;
  short *psVar11;
  short *psVar12;
  undefined4 *puVar13;
  wchar_t *pwVar14;
  int *piVar15;
  longlong lVar16;
  wchar_t **ppwVar17;
  facet *pfVar18;
  short *psVar19;
  undefined8 uVar20;
  undefined8 *puVar21;
  undefined4 *puVar22;
  ulonglong uVar23;
  ushort *puVar24;
  ushort *puVar25;
  undefined2 *puVar26;
  ushort ******ppppppuVar27;
  ushort *puVar28;
  wchar_t *pwVar29;
  int iVar30;
  wchar_t *pwVar31;
  short *psVar32;
  ushort *puVar33;
  longlong lVar34;
  bool bVar35;
  undefined1 auStack_378 [32];
  undefined1 local_358;
  wchar_t *local_348;
  undefined8 local_340;
  undefined ***local_338;
  undefined ***local_330;
  ushort *****local_328;
  longlong local_320;
  ulonglong local_318;
  ulonglong local_310;
  undefined2 local_300;
  undefined6 uStack_2fe;
  undefined8 local_2f0;
  ulonglong local_2e8;
  undefined2 local_2d8;
  undefined6 uStack_2d6;
  undefined8 local_2c8;
  ulonglong local_2c0;
  undefined2 local_2b0;
  undefined6 uStack_2ae;
  undefined8 local_2a0;
  ulonglong local_298;
  void *local_288;
  void *local_280;
  undefined8 local_278;
  void *local_268;
  undefined8 local_260;
  undefined8 local_258;
  undefined8 local_248;
  undefined2 local_230;
  undefined6 uStack_22e;
  undefined8 local_220;
  ulonglong local_218;
  undefined **local_200 [4];
  undefined8 *local_1e0;
  undefined8 local_190;
  char local_188;
  char local_178;
  facet *local_170;
  void *local_168;
  void *local_160;
  undefined8 local_158;
  void *local_148;
  undefined8 local_140;
  undefined8 local_138;
  undefined8 local_128;
  undefined2 local_110;
  undefined6 uStack_10e;
  undefined8 local_100;
  ulonglong local_f8;
  undefined **local_e0 [4];
  undefined8 *local_c0;
  undefined8 local_70;
  char local_68;
  char local_58;
  facet *local_50;
  ulonglong local_48;
  
  local_340 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_378;
  local_348 = (wchar_t *)CONCAT44(local_348._4_4_,param_2);
  FUN_140001710(param_1 + 0x948,&DAT_1404a4d58,5);
  *(undefined4 *)(param_1 + 0x940) = 2;
  pvVar3 = *(void **)(param_1 + 0x348);
  if (pvVar3 != *(void **)(param_1 + 0x350)) {
    memmove(pvVar3,*(void **)(param_1 + 0x350),0);
    *(void **)(param_1 + 0x350) = pvVar3;
  }
  puVar33 = (ushort *)(param_1 + 0x28);
  FUN_140001710(puVar33,&DAT_140477960,0);
  puVar28 = (ushort *)(param_1 + 0x78);
  FUN_140001710(puVar28,&DAT_140477960,0);
  FUN_140001710(param_1 + 0x700,&DAT_140477960,0);
  iVar6 = _wcsicmp(L"ENEMY",L"ENEMY");
  if (iVar6 == 0) {
    uVar9 = FUN_140323730(param_1,&local_348);
  }
  else {
    lVar10 = FUN_1402933b0(DAT_140607ff0,&DAT_1404a4d58);
    uVar9 = 0;
    if (lVar10 != 0) {
      uVar7 = FUN_1402970c0(lVar10,L"wszName");
      local_358 = 1;
      psVar11 = (short *)FUN_140296b70(lVar10,param_2,uVar7,L"wszName");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szModelFile");
      local_358 = 1;
      psVar12 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szModelFile");
      if (psVar12 != (short *)0x0) {
        uVar23 = 0xffffffffffffffff;
        psVar11 = psVar12;
        do {
          if (uVar23 == 0) break;
          uVar23 = uVar23 - 1;
          sVar1 = *psVar11;
          psVar11 = psVar11 + 1;
        } while (sVar1 != 0);
        if (1 < ~uVar23 - 1) {
          if (DAT_140607be1 == '\0') {
            uVar9 = FUN_140123ce0();
            FUN_1400015e0(puVar33,uVar9,0,0xffffffffffffffff);
            FUN_140002aa0(puVar33,&DAT_14049a36c,1);
          }
          uVar23 = 0xffffffffffffffff;
          psVar11 = psVar12;
          do {
            if (uVar23 == 0) break;
            uVar23 = uVar23 - 1;
            sVar1 = *psVar11;
            psVar11 = psVar11 + 1;
          } while (sVar1 != 0);
          FUN_140002aa0(puVar33,psVar12,~uVar23 - 1);
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"szSubModelFile");
      local_358 = 1;
      psVar12 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szSubModelFile");
      if (psVar12 != (short *)0x0) {
        uVar23 = 0xffffffffffffffff;
        psVar11 = psVar12;
        do {
          if (uVar23 == 0) break;
          uVar23 = uVar23 - 1;
          sVar1 = *psVar11;
          psVar11 = psVar11 + 1;
        } while (sVar1 != 0);
        if (1 < ~uVar23 - 1) {
          if (DAT_140607be1 == '\0') {
            uVar9 = FUN_140123ce0();
            FUN_1400015e0(puVar28,uVar9,0,0xffffffffffffffff);
            FUN_140002aa0(puVar28,&DAT_14049a36c,1);
          }
          uVar23 = 0xffffffffffffffff;
          psVar11 = psVar12;
          do {
            if (uVar23 == 0) break;
            uVar23 = uVar23 - 1;
            sVar1 = *psVar11;
            psVar11 = psVar11 + 1;
          } while (sVar1 != 0);
          FUN_140002aa0(puVar28,psVar12,~uVar23 - 1);
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"szSubModelDummy");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szSubModelDummy");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0xf0,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szSubModelGroup");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szSubModelGroup");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x118,psVar11,~uVar23 - 1);
      puVar25 = puVar33;
      if (7 < *(ulonglong *)(param_1 + 0x40)) {
        puVar25 = *(ushort **)puVar33;
      }
      puVar24 = puVar33;
      if (7 < *(ulonglong *)(param_1 + 0x40)) {
        puVar24 = *(ushort **)puVar33;
      }
      lVar16 = *(longlong *)(param_1 + 0x38);
      if (7 < *(ulonglong *)(param_1 + 0x40)) {
        puVar33 = *(ushort **)puVar33;
      }
      if (puVar33 != puVar24 + lVar16) {
        lVar34 = (longlong)puVar25 - (longlong)puVar33;
        do {
          iVar6 = tolower((uint)*puVar33);
          *(short *)(lVar34 + (longlong)puVar33) = (short)iVar6;
          puVar33 = puVar33 + 1;
        } while (puVar33 != puVar24 + lVar16);
      }
      puVar33 = puVar28;
      if (7 < *(ulonglong *)(param_1 + 0x90)) {
        puVar33 = *(ushort **)puVar28;
      }
      puVar25 = puVar28;
      if (7 < *(ulonglong *)(param_1 + 0x90)) {
        puVar25 = *(ushort **)puVar28;
      }
      lVar16 = *(longlong *)(param_1 + 0x88);
      if (7 < *(ulonglong *)(param_1 + 0x90)) {
        puVar28 = *(ushort **)puVar28;
      }
      if (puVar28 != puVar25 + lVar16) {
        lVar34 = (longlong)puVar33 - (longlong)puVar28;
        do {
          iVar6 = tolower((uint)*puVar28);
          *(short *)(lVar34 + (longlong)puVar28) = (short)iVar6;
          puVar28 = puVar28 + 1;
        } while (puVar28 != puVar25 + lVar16);
      }
      uVar7 = FUN_1402970c0(lVar10,L"nGroup");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nGroup");
      *(undefined4 *)(param_1 + 0x8ec) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nLevel");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nLevel");
      *(undefined4 *)(param_1 + 0x1f0) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nGender");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nGender");
      *(undefined4 *)(param_1 + 500) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szSkin");
      local_358 = 1;
      pwVar14 = (wchar_t *)FUN_140296990(lVar10,param_2,uVar7,L"szSkin");
      local_348 = pwVar14;
      uVar7 = FUN_1402970c0(lVar10,&DAT_1404cad68);
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,&DAT_1404cad68);
      *(undefined4 *)(param_1 + 0x7a4) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,&DAT_1404b72b8);
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,&DAT_1404b72b8);
      *(undefined4 *)(param_1 + 0x7a8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,&DAT_1404cbef0);
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,&DAT_1404cbef0);
      *(undefined4 *)(param_1 + 0x7ac) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fLuck");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fLuck");
      *(undefined4 *)(param_1 + 0x7e0) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fMinPhysicalAttack");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fMinPhysicalAttack");
      *(undefined4 *)(param_1 + 0x7b0) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fPhysicalAttack");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fPhysicalAttack");
      *(undefined4 *)(param_1 + 0x7b4) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fMinMagicAttack");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fMinMagicAttack");
      *(undefined4 *)(param_1 + 0x7b8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fMagicAttack");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fMagicAttack");
      *(undefined4 *)(param_1 + 0x7bc) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fMinAttributeAttack");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fMinAttributeAttack");
      *(undefined4 *)(param_1 + 0x7c0) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fAttributeAttack");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fAttributeAttack");
      *(undefined4 *)(param_1 + 0x7c4) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fDefense");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fDefense");
      *(undefined4 *)(param_1 + 0x7c8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fMagicDefense");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fMagicDefense");
      *(undefined4 *)(param_1 + 0x7cc) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fCritical");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fCritical");
      *(undefined4 *)(param_1 + 2000) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fResistanceCritical");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fResistanceCritical");
      *(undefined4 *)(param_1 + 0x7d4) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fMagicResistance");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fMagicResistance");
      *(undefined4 *)(param_1 + 0x7d8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nWeaponDurabilityDecrease");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nWeaponDurabilityDecrease");
      *(undefined4 *)(param_1 + 0x7f4) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nArmorDurabiltyDecrease");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nArmorDurabiltyDecrease");
      *(undefined4 *)(param_1 + 0x7f8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nItemBox");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nItemBox");
      *(undefined4 *)(param_1 + 0x8f8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szItemBoxRespawnMotion");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szItemBoxRespawnMotion");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x900,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"fItemBoxCloseTimeMin");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fItemBoxCloseTimeMin");
      *(undefined4 *)(param_1 + 0x928) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fItemBoxCloseTimeMax");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fItemBoxCloseTimeMax");
      *(undefined4 *)(param_1 + 0x92c) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szCharacter");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szCharacter");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0xa0,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szMaterial");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szMaterial");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x240,psVar11,~uVar23 - 1);
      FUN_1404151b0(param_1 + 0x240);
      uVar7 = FUN_1402970c0(lVar10,L"fScaleMin");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fScaleMin");
      *(undefined4 *)(param_1 + 0x268) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fScaleMax");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fScaleMax");
      *(undefined4 *)(param_1 + 0x26c) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szAI");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szAI");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 200,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"nCaught");
      local_358 = 1;
      piVar15 = (int *)FUN_140296600(lVar10,param_2,uVar7,L"nCaught");
      *(bool *)(param_1 + 0x140) = *piVar15 != 0;
      uVar7 = FUN_1402970c0(lVar10,L"fPhysicalGuard");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fPhysicalGuard");
      *(undefined4 *)(param_1 + 0x144) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fMagicGuard");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fMagicGuard");
      *(undefined4 *)(param_1 + 0x148) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fCounteroffensive");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fCounteroffensive");
      *(undefined4 *)(param_1 + 0x150) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fDownDamage");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fDownDamage");
      *(undefined4 *)(param_1 + 0x154) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szLeftHandDummyName");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szLeftHandDummyName");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x158,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szRightHandDummyName");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szRightHandDummyName");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x180,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szDeathReleaseEquipDummy");
      local_358 = 1;
      lVar16 = FUN_140296990(lVar10,param_2,uVar7,L"szDeathReleaseEquipDummy");
      if (lVar16 != 0) {
        local_328 = (ushort *****)0x0;
        local_320 = 0;
        local_318 = 0;
        FUN_140415930(&local_328,lVar16,&DAT_14049c7b8);
        FUN_140123dc0(param_1 + 0x1d0);
        pppppuVar4 = local_328;
        iVar30 = 0;
        iVar6 = (int)((local_320 - (longlong)local_328) / 0x28);
        if (0 < iVar6) {
          do {
            FUN_14008ec00(param_1 + 0x1d0,pppppuVar4 + (longlong)iVar30 * 5);
            iVar30 = iVar30 + 1;
          } while (iVar30 < iVar6);
        }
        pwVar14 = local_348;
        if ((ushort ******)pppppuVar4 != (ushort ******)0x0) {
          FUN_14008d0a0(pppppuVar4,local_320);
          operator_delete(pppppuVar4);
          pwVar14 = local_348;
        }
      }
      iVar6 = 0;
      uVar7 = FUN_1402970c0(lVar10,L"fMoveSpeed");
      local_358 = 1;
      uVar9 = FUN_1402967b0(lVar10,param_2,uVar7,L"fMoveSpeed");
      FUN_14008ea70(param_1 + 0x348,uVar9);
      uVar7 = FUN_1402970c0(lVar10,L"fAttackSpeed");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fAttackSpeed");
      *(undefined4 *)(param_1 + 0x7dc) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fStature");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fStature");
      *(undefined4 *)(param_1 + 0x294) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fJumpHeight");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fJumpHeight");
      *(undefined4 *)(param_1 + 0x298) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fMoveHeight");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fMoveHeight");
      *(undefined4 *)(param_1 + 0x2a0) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fWeight");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fWeight");
      *(undefined4 *)(param_1 + 0x2a4) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fWideRadius");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fWideRadius");
      *(undefined4 *)(param_1 + 0x2a8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fInvestigationRange");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fInvestigationRange");
      *(undefined4 *)(param_1 + 0x278) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fPatrolRange");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fPatrolRange");
      *(undefined4 *)(param_1 + 0x27c) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fChaseRange");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fChaseRange");
      *(undefined4 *)(param_1 + 0x280) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fAttackRange");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fAttackRange");
      *(undefined4 *)(param_1 + 0x284) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fKeepDistance");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fKeepDistance");
      *(undefined4 *)(param_1 + 0x28c) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fAttackDelay");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fAttackDelay");
      *(undefined4 *)(param_1 + 0x290) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szBackStepMotion");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szBackStepMotion");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x610,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szAIScript");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szAIScript");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x2b0,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"fHeadPos");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fHeadPos");
      *(undefined4 *)(param_1 + 0x2d8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fRisingDamageWeight");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fRisingDamageWeight");
      *(undefined4 *)(param_1 + 0x2dc) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szComboTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szComboTable");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x390,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szNullMotionTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szNullMotionTable");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x430,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szAttackTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szAttackTable");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x3b8,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szDownMotionTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szDownMotionTable");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x408,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szSoulRedTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szSoulRedTable");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x4a8,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szSoulBlueTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szSoulBlueTable");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x4d0,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szDamageSoundTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szDamageSoundTable");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x4f8,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szBasicMotionTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szBasicMotionTable");
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(param_1 + 0x598,psVar11,~uVar23 - 1);
      uVar7 = FUN_1402970c0(lVar10,L"szCorpsePiece");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szCorpsePiece");
      local_298 = 7;
      local_2a0 = 0;
      local_2b0 = 0;
      uVar23 = 0xffffffffffffffff;
      psVar12 = psVar11;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar1 = *psVar12;
        psVar12 = psVar12 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_2b0,psVar11,~uVar23 - 1);
      puVar26 = &local_2b0;
      if (7 < local_298) {
        puVar26 = (undefined2 *)CONCAT62(uStack_2ae,local_2b0);
      }
      FUN_140415930(param_1 + 0x748,puVar26,&DAT_14049c7b8);
      local_348 = (wchar_t *)CONCAT44(local_348._4_4_,0x3f800000);
      bVar35 = *(float *)(param_1 + 0x2a4) == 1.0;
      ppwVar17 = &local_348;
      if (1.0 < *(float *)(param_1 + 0x2a4) || bVar35) {
        ppwVar17 = (wchar_t **)(param_1 + 0x2a4);
      }
      *(undefined4 *)(param_1 + 0x2a4) = *(undefined4 *)ppwVar17;
      uVar7 = 0;
      *(undefined4 *)(param_1 + 0x7e8) = 0;
      lVar16 = 6;
      pwVar29 = pwVar14;
      pwVar31 = L"STEEL";
      do {
        if (lVar16 == 0) break;
        lVar16 = lVar16 + -1;
        bVar35 = *pwVar29 == *pwVar31;
        pwVar29 = pwVar29 + 1;
        pwVar31 = pwVar31 + 1;
      } while (bVar35);
      if (bVar35) {
        *(undefined4 *)(param_1 + 0x7e8) = 1;
      }
      else {
        lVar16 = 5;
        pwVar29 = pwVar14;
        pwVar31 = L"SKIN";
        do {
          if (lVar16 == 0) break;
          lVar16 = lVar16 + -1;
          bVar35 = *pwVar29 == *pwVar31;
          pwVar29 = pwVar29 + 1;
          pwVar31 = pwVar31 + 1;
        } while (bVar35);
        if (bVar35) {
          *(undefined4 *)(param_1 + 0x7e8) = 2;
        }
        else {
          lVar16 = 5;
          pwVar29 = pwVar14;
          pwVar31 = L"WOOD";
          do {
            if (lVar16 == 0) break;
            lVar16 = lVar16 + -1;
            bVar35 = *pwVar29 == *pwVar31;
            pwVar29 = pwVar29 + 1;
            pwVar31 = pwVar31 + 1;
          } while (bVar35);
          if (bVar35) {
            *(undefined4 *)(param_1 + 0x7e8) = 3;
          }
          else {
            lVar16 = 6;
            pwVar29 = L"STONE";
            do {
              if (lVar16 == 0) break;
              lVar16 = lVar16 + -1;
              bVar35 = *pwVar14 == *pwVar29;
              pwVar14 = pwVar14 + 1;
              pwVar29 = pwVar29 + 1;
            } while (bVar35);
            if (bVar35) {
              uVar7 = 4;
            }
            *(undefined4 *)(param_1 + 0x7e8) = uVar7;
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar10,L"fGuardBreakDamage");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fGuardBreakDamage");
      *(undefined4 *)(param_1 + 0x7ec) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fGuardDamage");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fGuardDamage");
      *(undefined4 *)(param_1 + 0x7f0) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nAttributeResistanceFire");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nAttributeResistanceFire");
      *(undefined4 *)(param_1 + 0x7fc) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nAttributeResistanceWater");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nAttributeResistanceWater");
      *(undefined4 *)(param_1 + 0x800) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nAttributeResistanceLight");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nAttributeResistanceLight");
      *(undefined4 *)(param_1 + 0x804) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nAttributeResistanceDarkness");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nAttributeResistanceDarkness");
      *(undefined4 *)(param_1 + 0x808) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nAttributeResistanceEarth");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nAttributeResistanceEarth");
      *(undefined4 *)(param_1 + 0x80c) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nAttributeResistanceWindy");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nAttributeResistanceWindy");
      *(undefined4 *)(param_1 + 0x810) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nAttributeResistanceToxication");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nAttributeResistanceToxication");
      *(undefined4 *)(param_1 + 0x814) = *puVar13;
      FUN_1402970c0(lVar10,L"nAttributeResistanceLightning");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2);
      *(undefined4 *)(param_1 + 0x818) = *puVar13;
      local_338 = local_200;
      local_330 = local_e0;
      do {
        iVar6 = iVar6 + 1;
        local_348 = (wchar_t *)CONCAT44(local_348._4_4_,iVar6);
        lVar16 = FUN_14030e250(&local_288,L"szConditionResistance%1$02d");
        if (*(char *)(lVar16 + 0x54) != '\0') {
          FUN_140310390(lVar16);
        }
        FUN_140311190(lVar16,&local_348);
        *(int *)(lVar16 + 0x4c) = *(int *)(lVar16 + 0x4c) + 1;
        iVar30 = *(int *)(lVar16 + 0x4c);
        if ((*(longlong *)(lVar16 + 0x40) != 0) && (iVar30 < *(int *)(lVar16 + 0x50))) {
          do {
            uVar23 = (ulonglong)iVar30;
            if ((iVar30 < 0) && (uVar23 != 0)) {
              lVar34 = -((-uVar23 - 1 >> 5) * 4 + 4);
            }
            else {
              lVar34 = (uVar23 >> 5) * 4;
            }
            if ((*(uint *)(*(longlong *)(lVar16 + 0x20) + lVar34) & 1 << ((byte)iVar30 & 0x1f)) == 0
               ) break;
            iVar30 = iVar30 + 1;
            *(int *)(lVar16 + 0x4c) = iVar30;
          } while (iVar30 < *(int *)(lVar16 + 0x50));
        }
        FUN_14030e390(&local_300);
        if (local_178 != '\0') {
          if ((local_170 != (facet *)0x0) &&
             (pfVar18 = std::locale::facet::_Decref(local_170), pfVar18 != (facet *)0x0)) {
            (*(code *)**(undefined8 **)pfVar18)(pfVar18);
          }
          local_178 = '\0';
        }
        local_200[0] = boost::io::basic_altstringbuf<>::vftable;
        if (local_188 != '\0') {
          operator_delete((void *)*local_1e0);
        }
        local_188 = '\0';
        std::basic_streambuf<>::setg
                  ((basic_streambuf<> *)local_200,(wchar_t *)0x0,(wchar_t *)0x0,(wchar_t *)0x0);
        std::basic_streambuf<>::setp((basic_streambuf<> *)local_200,(wchar_t *)0x0,(wchar_t *)0x0);
        local_190 = 0;
        std::basic_streambuf<>::~basic_streambuf<>((basic_streambuf<> *)local_200);
        if (7 < local_218) {
          operator_delete((void *)CONCAT62(uStack_22e,local_230));
        }
        local_218 = 7;
        local_220 = 0;
        local_230 = 0;
        local_248 = 0;
        if (local_268 != (void *)0x0) {
          operator_delete(local_268);
        }
        pvVar5 = local_280;
        local_268 = (void *)0x0;
        local_260 = 0;
        local_258 = 0;
        pvVar3 = local_288;
        if (local_288 != (void *)0x0) {
          for (; pvVar3 != pvVar5; pvVar3 = (void *)((longlong)pvVar3 + 0x98)) {
            FUN_14030faa0(pvVar3);
          }
          operator_delete(local_288);
        }
        local_288 = (void *)0x0;
        local_280 = (void *)0x0;
        local_278 = 0;
        local_348 = (wchar_t *)CONCAT44(local_348._4_4_,iVar6);
        lVar16 = FUN_14030e250(&local_168,L"fConditionResistanceValue%1$02d");
        if (*(char *)(lVar16 + 0x54) != '\0') {
          FUN_140310390(lVar16);
        }
        FUN_140311190(lVar16,&local_348);
        *(int *)(lVar16 + 0x4c) = *(int *)(lVar16 + 0x4c) + 1;
        iVar30 = *(int *)(lVar16 + 0x4c);
        if ((*(longlong *)(lVar16 + 0x40) != 0) && (iVar30 < *(int *)(lVar16 + 0x50))) {
          do {
            uVar23 = (ulonglong)iVar30;
            if ((iVar30 < 0) && (uVar23 != 0)) {
              lVar34 = -((-uVar23 - 1 >> 5) * 4 + 4);
            }
            else {
              lVar34 = (uVar23 >> 5) * 4;
            }
            if ((*(uint *)(*(longlong *)(lVar16 + 0x20) + lVar34) & 1 << ((byte)iVar30 & 0x1f)) == 0
               ) break;
            iVar30 = iVar30 + 1;
            *(int *)(lVar16 + 0x4c) = iVar30;
          } while (iVar30 < *(int *)(lVar16 + 0x50));
        }
        FUN_14030e390(&local_2d8);
        if (local_58 != '\0') {
          if ((local_50 != (facet *)0x0) &&
             (pfVar18 = std::locale::facet::_Decref(local_50), pfVar18 != (facet *)0x0)) {
            (*(code *)**(undefined8 **)pfVar18)(pfVar18);
          }
          local_58 = '\0';
        }
        local_e0[0] = boost::io::basic_altstringbuf<>::vftable;
        if (local_68 != '\0') {
          operator_delete((void *)*local_c0);
        }
        local_68 = '\0';
        std::basic_streambuf<>::setg
                  ((basic_streambuf<> *)local_e0,(wchar_t *)0x0,(wchar_t *)0x0,(wchar_t *)0x0);
        std::basic_streambuf<>::setp((basic_streambuf<> *)local_e0,(wchar_t *)0x0,(wchar_t *)0x0);
        local_70 = 0;
        std::basic_streambuf<>::~basic_streambuf<>((basic_streambuf<> *)local_e0);
        if (7 < local_f8) {
          operator_delete((void *)CONCAT62(uStack_10e,local_110));
        }
        local_f8 = 7;
        local_100 = 0;
        local_110 = 0;
        local_128 = 0;
        if (local_148 != (void *)0x0) {
          operator_delete(local_148);
        }
        pvVar5 = local_160;
        local_148 = (void *)0x0;
        local_140 = 0;
        local_138 = 0;
        pvVar3 = local_168;
        if (local_168 != (void *)0x0) {
          for (; pvVar3 != pvVar5; pvVar3 = (void *)((longlong)pvVar3 + 0x98)) {
            FUN_14030faa0(pvVar3);
          }
          operator_delete(local_168);
        }
        local_168 = (void *)0x0;
        local_160 = (void *)0x0;
        local_158 = 0;
        puVar26 = &local_300;
        if (7 < local_2e8) {
          puVar26 = (undefined2 *)CONCAT62(uStack_2fe,local_300);
        }
        FUN_1402970c0(lVar10,puVar26);
        local_358 = 1;
        psVar12 = (short *)FUN_140296990(lVar10,param_2);
        if (psVar12 != (short *)0x0) {
          local_310 = 7;
          local_318 = 0;
          local_328 = (ushort *****)((ulonglong)local_328 & 0xffffffffffff0000);
          uVar23 = 0xffffffffffffffff;
          psVar11 = psVar12;
          do {
            if (uVar23 == 0) break;
            uVar23 = uVar23 - 1;
            sVar1 = *psVar11;
            psVar11 = psVar11 + 1;
          } while (sVar1 != 0);
          FUN_140001710(&local_328,psVar12,~uVar23 - 1);
          puVar26 = &local_2d8;
          if (7 < local_2c0) {
            puVar26 = (undefined2 *)CONCAT62(uStack_2d6,local_2d8);
          }
          uVar7 = FUN_1402970c0(lVar10,puVar26);
          local_358 = 1;
          puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,puVar26);
          uVar7 = *puVar13;
          ppppppuVar27 = &local_328;
          if (7 < local_310) {
            ppppppuVar27 = (ushort ******)local_328;
          }
          uVar23 = 0x12;
          if (local_318 < 0x12) {
            uVar23 = local_318;
          }
          pwVar14 = L"CONDITION_BLEEDING";
          for (; uVar23 != 0; uVar23 = uVar23 - 1) {
            if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
              uVar8 = 1;
              if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                uVar8 = 0xffffffff;
              }
              goto LAB_1403271e5;
            }
            ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
            pwVar14 = pwVar14 + 1;
          }
          uVar8 = 0;
LAB_1403271e5:
          if (uVar8 == 0) {
            if (local_318 < 0x12) {
              uVar8 = 0xffffffff;
            }
            else {
              uVar8 = (uint)(local_318 != 0x12);
            }
          }
          if (uVar8 == 0) {
            *(undefined4 *)(param_1 + 0x81c) = uVar7;
          }
          else {
            ppppppuVar27 = &local_328;
            if (7 < local_310) {
              ppppppuVar27 = (ushort ******)local_328;
            }
            uVar23 = 0xf;
            if (local_318 < 0xf) {
              uVar23 = local_318;
            }
            pwVar14 = L"CONDITION_CHAOS";
            for (; uVar23 != 0; uVar23 = uVar23 - 1) {
              if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                uVar8 = 1;
                if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                  uVar8 = 0xffffffff;
                }
                goto LAB_140327269;
              }
              ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
              pwVar14 = pwVar14 + 1;
            }
            uVar8 = 0;
LAB_140327269:
            if (uVar8 == 0) {
              if (local_318 < 0xf) {
                uVar8 = 0xffffffff;
              }
              else {
                uVar8 = (uint)(local_318 != 0xf);
              }
            }
            if (uVar8 == 0) {
              *(undefined4 *)(param_1 + 0x844) = uVar7;
            }
            else {
              ppppppuVar27 = &local_328;
              if (7 < local_310) {
                ppppppuVar27 = (ushort ******)local_328;
              }
              uVar23 = 0xe;
              if (local_318 < 0xe) {
                uVar23 = local_318;
              }
              pwVar14 = L"CONDITION_COLD";
              for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                  uVar8 = 1;
                  if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                    uVar8 = 0xffffffff;
                  }
                  goto LAB_1403272eb;
                }
                ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                pwVar14 = pwVar14 + 1;
              }
              uVar8 = 0;
LAB_1403272eb:
              if (uVar8 == 0) {
                if (local_318 < 0xe) {
                  uVar8 = 0xffffffff;
                }
                else {
                  uVar8 = (uint)(local_318 != 0xe);
                }
              }
              if (uVar8 == 0) {
                *(undefined4 *)(param_1 + 0x820) = uVar7;
              }
              else {
                ppppppuVar27 = &local_328;
                if (7 < local_310) {
                  ppppppuVar27 = (ushort ******)local_328;
                }
                uVar23 = 0xe;
                if (local_318 < 0xe) {
                  uVar23 = local_318;
                }
                pwVar14 = L"CONDITION_FIRE";
                for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                  if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                    uVar8 = 1;
                    if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                      uVar8 = 0xffffffff;
                    }
                    goto LAB_14032736d;
                  }
                  ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                  pwVar14 = pwVar14 + 1;
                }
                uVar8 = 0;
LAB_14032736d:
                if (uVar8 == 0) {
                  if (local_318 < 0xe) {
                    uVar8 = 0xffffffff;
                  }
                  else {
                    uVar8 = (uint)(local_318 != 0xe);
                  }
                }
                if (uVar8 == 0) {
                  *(undefined4 *)(param_1 + 0x824) = uVar7;
                }
                else {
                  ppppppuVar27 = &local_328;
                  if (7 < local_310) {
                    ppppppuVar27 = (ushort ******)local_328;
                  }
                  uVar23 = 0x10;
                  if (local_318 < 0x10) {
                    uVar23 = local_318;
                  }
                  pwVar14 = L"CONDITION_FREEZE";
                  for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                    if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                      uVar8 = 1;
                      if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                        uVar8 = 0xffffffff;
                      }
                      goto LAB_1403273ef;
                    }
                    ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                    pwVar14 = pwVar14 + 1;
                  }
                  uVar8 = 0;
LAB_1403273ef:
                  if (uVar8 == 0) {
                    if (local_318 < 0x10) {
                      uVar8 = 0xffffffff;
                    }
                    else {
                      uVar8 = (uint)(local_318 != 0x10);
                    }
                  }
                  if (uVar8 == 0) {
                    *(undefined4 *)(param_1 + 0x830) = uVar7;
                  }
                  else {
                    ppppppuVar27 = &local_328;
                    if (7 < local_310) {
                      ppppppuVar27 = (ushort ******)local_328;
                    }
                    uVar23 = 0xe;
                    if (local_318 < 0xe) {
                      uVar23 = local_318;
                    }
                    pwVar14 = L"CONDITION_HOLD";
                    for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                      if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                        uVar8 = 1;
                        if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                          uVar8 = 0xffffffff;
                        }
                        goto LAB_140327471;
                      }
                      ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                      pwVar14 = pwVar14 + 1;
                    }
                    uVar8 = 0;
LAB_140327471:
                    if (uVar8 == 0) {
                      if (local_318 < 0xe) {
                        uVar8 = 0xffffffff;
                      }
                      else {
                        uVar8 = (uint)(local_318 != 0xe);
                      }
                    }
                    if (uVar8 == 0) {
                      *(undefined4 *)(param_1 + 0x850) = uVar7;
                    }
                    else {
                      ppppppuVar27 = &local_328;
                      if (7 < local_310) {
                        ppppppuVar27 = (ushort ******)local_328;
                      }
                      uVar23 = 0x12;
                      if (local_318 < 0x12) {
                        uVar23 = local_318;
                      }
                      pwVar14 = L"CONDITION_SICKNESS";
                      for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                        if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                          uVar8 = 1;
                          if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                            uVar8 = 0xffffffff;
                          }
                          goto LAB_1403274f9;
                        }
                        ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                        pwVar14 = pwVar14 + 1;
                      }
                      uVar8 = 0;
LAB_1403274f9:
                      if (uVar8 == 0) {
                        if (local_318 < 0x12) {
                          uVar8 = 0xffffffff;
                        }
                        else {
                          uVar8 = (uint)(local_318 != 0x12);
                        }
                      }
                      if (uVar8 == 0) {
                        *(undefined4 *)(param_1 + 0x83c) = uVar7;
                      }
                      else {
                        ppppppuVar27 = &local_328;
                        if (7 < local_310) {
                          ppppppuVar27 = (ushort ******)local_328;
                        }
                        uVar23 = 0xf;
                        if (local_318 < 0xf) {
                          uVar23 = local_318;
                        }
                        pwVar14 = L"CONDITION_SLEEP";
                        for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                          if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                            uVar8 = 1;
                            if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                              uVar8 = 0xffffffff;
                            }
                            goto LAB_14032757b;
                          }
                          ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                          pwVar14 = pwVar14 + 1;
                        }
                        uVar8 = 0;
LAB_14032757b:
                        if (uVar8 == 0) {
                          if (local_318 < 0xf) {
                            uVar8 = 0xffffffff;
                          }
                          else {
                            uVar8 = (uint)(local_318 != 0xf);
                          }
                        }
                        if (uVar8 == 0) {
                          *(undefined4 *)(param_1 + 0x840) = uVar7;
                        }
                        else {
                          ppppppuVar27 = &local_328;
                          if (7 < local_310) {
                            ppppppuVar27 = (ushort ******)local_328;
                          }
                          uVar23 = 0xe;
                          if (local_318 < 0xe) {
                            uVar23 = local_318;
                          }
                          pwVar14 = L"CONDITION_SLOW";
                          for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                            if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                              uVar8 = 1;
                              if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                                uVar8 = 0xffffffff;
                              }
                              goto LAB_1403275fd;
                            }
                            ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                            pwVar14 = pwVar14 + 1;
                          }
                          uVar8 = 0;
LAB_1403275fd:
                          if (uVar8 == 0) {
                            if (local_318 < 0xe) {
                              uVar8 = 0xffffffff;
                            }
                            else {
                              uVar8 = (uint)(local_318 != 0xe);
                            }
                          }
                          if (uVar8 == 0) {
                            *(undefined4 *)(param_1 + 0x834) = uVar7;
                          }
                          else {
                            ppppppuVar27 = &local_328;
                            if (7 < local_310) {
                              ppppppuVar27 = (ushort ******)local_328;
                            }
                            uVar23 = 0xf;
                            if (local_318 < 0xf) {
                              uVar23 = local_318;
                            }
                            pwVar14 = L"CONDITION_STONE";
                            for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                              if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                                uVar8 = 1;
                                if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                                  uVar8 = 0xffffffff;
                                }
                                goto LAB_14032767f;
                              }
                              ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                              pwVar14 = pwVar14 + 1;
                            }
                            uVar8 = 0;
LAB_14032767f:
                            if (uVar8 == 0) {
                              if (local_318 < 0xf) {
                                uVar8 = 0xffffffff;
                              }
                              else {
                                uVar8 = (uint)(local_318 != 0xf);
                              }
                            }
                            if (uVar8 == 0) {
                              *(undefined4 *)(param_1 + 0x82c) = uVar7;
                            }
                            else {
                              ppppppuVar27 = &local_328;
                              if (7 < local_310) {
                                ppppppuVar27 = (ushort ******)local_328;
                              }
                              uVar23 = 0xe;
                              if (local_318 < 0xe) {
                                uVar23 = local_318;
                              }
                              pwVar14 = L"CONDITION_STUN";
                              for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                                if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                                  uVar8 = 1;
                                  if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                                    uVar8 = 0xffffffff;
                                  }
                                  goto LAB_140327701;
                                }
                                ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                                pwVar14 = pwVar14 + 1;
                              }
                              uVar8 = 0;
LAB_140327701:
                              if (uVar8 == 0) {
                                if (local_318 < 0xe) {
                                  uVar8 = 0xffffffff;
                                }
                                else {
                                  uVar8 = (uint)(local_318 != 0xe);
                                }
                              }
                              if (uVar8 == 0) {
                                *(undefined4 *)(param_1 + 0x828) = uVar7;
                              }
                              else {
                                ppppppuVar27 = &local_328;
                                if (7 < local_310) {
                                  ppppppuVar27 = (ushort ******)local_328;
                                }
                                uVar23 = 0x14;
                                if (local_318 < 0x14) {
                                  uVar23 = local_318;
                                }
                                pwVar14 = L"CONDITION_TOXICATION";
                                for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                                  if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                                    uVar8 = 1;
                                    if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                                      uVar8 = 0xffffffff;
                                    }
                                    goto LAB_140327789;
                                  }
                                  ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                                  pwVar14 = pwVar14 + 1;
                                }
                                uVar8 = 0;
LAB_140327789:
                                if (uVar8 == 0) {
                                  if (local_318 < 0x14) {
                                    uVar8 = 0xffffffff;
                                  }
                                  else {
                                    uVar8 = (uint)(local_318 != 0x14);
                                  }
                                }
                                if (uVar8 == 0) {
                                  *(undefined4 *)(param_1 + 0x838) = uVar7;
                                }
                                else {
                                  ppppppuVar27 = &local_328;
                                  if (7 < local_310) {
                                    ppppppuVar27 = (ushort ******)local_328;
                                  }
                                  uVar23 = 0x13;
                                  if (local_318 < 0x13) {
                                    uVar23 = local_318;
                                  }
                                  pwVar14 = L"CONDITION_LIGHTNING";
                                  for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                                    if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                                      uVar8 = 1;
                                      if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                                        uVar8 = 0xffffffff;
                                      }
                                      goto LAB_14032780b;
                                    }
                                    ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                                    pwVar14 = pwVar14 + 1;
                                  }
                                  uVar8 = 0;
LAB_14032780b:
                                  if (uVar8 == 0) {
                                    if (local_318 < 0x13) {
                                      uVar8 = 0xffffffff;
                                    }
                                    else {
                                      uVar8 = (uint)(local_318 != 0x13);
                                    }
                                  }
                                  if (uVar8 == 0) {
                                    *(undefined4 *)(param_1 + 0x848) = uVar7;
                                  }
                                  else {
                                    ppppppuVar27 = &local_328;
                                    if (7 < local_310) {
                                      ppppppuVar27 = (ushort ******)local_328;
                                    }
                                    uVar23 = 0x12;
                                    if (local_318 < 0x12) {
                                      uVar23 = local_318;
                                    }
                                    pwVar14 = L"CONDITION_DARKNESS";
                                    for (; uVar23 != 0; uVar23 = uVar23 - 1) {
                                      if (*(wchar_t *)ppppppuVar27 != *pwVar14) {
                                        uVar8 = 1;
                                        if ((ushort)*(wchar_t *)ppppppuVar27 < (ushort)*pwVar14) {
                                          uVar8 = 0xffffffff;
                                        }
                                        goto LAB_14032788a;
                                      }
                                      ppppppuVar27 = (ushort ******)((longlong)ppppppuVar27 + 2);
                                      pwVar14 = pwVar14 + 1;
                                    }
                                    uVar8 = 0;
LAB_14032788a:
                                    if (uVar8 == 0) {
                                      if (local_318 < 0x12) {
                                        uVar8 = 0xffffffff;
                                      }
                                      else {
                                        uVar8 = (uint)(local_318 != 0x12);
                                      }
                                    }
                                    if (uVar8 == 0) {
                                      *(undefined4 *)(param_1 + 0x84c) = uVar7;
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          if (7 < local_310) {
            operator_delete(local_328);
          }
        }
        if (7 < local_2c0) {
          operator_delete((void *)CONCAT62(uStack_2d6,local_2d8));
        }
        local_2c0 = 7;
        local_2c8 = 0;
        local_2d8 = 0;
        if (7 < local_2e8) {
          operator_delete((void *)CONCAT62(uStack_2fe,local_300));
        }
      } while (iVar6 < 10);
      uVar7 = FUN_1402970c0(lVar10,L"nCorpseWeapon");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nCorpseWeapon");
      *(undefined4 *)(param_1 + 0x854) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fLongAttackRange");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fLongAttackRange");
      *(undefined4 *)(param_1 + 0x288) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szSkillTable");
      local_358 = 1;
      pwVar14 = (wchar_t *)FUN_140296990(lVar10,param_2,uVar7,L"szSkillTable");
      local_348 = pwVar14;
      uVar7 = FUN_1402970c0(lVar10,L"szSpecialTable");
      local_358 = 1;
      psVar12 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szSpecialTable");
      uVar7 = FUN_1402970c0(lVar10,L"szWeaknessTable");
      local_358 = 1;
      psVar11 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szWeaknessTable");
      uVar7 = FUN_1402970c0(lVar10,L"szCatchTable");
      local_358 = 1;
      psVar19 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szCatchTable");
      if (pwVar14 != (wchar_t *)0x0) {
        uVar23 = 0xffffffffffffffff;
        do {
          if (uVar23 == 0) break;
          uVar23 = uVar23 - 1;
          wVar2 = *pwVar14;
          pwVar14 = pwVar14 + 1;
        } while (wVar2 != L'\0');
        FUN_140001710(param_1 + 0x458,local_348,~uVar23 - 1);
      }
      if (psVar12 != (short *)0x0) {
        uVar23 = 0xffffffffffffffff;
        psVar32 = psVar12;
        do {
          if (uVar23 == 0) break;
          uVar23 = uVar23 - 1;
          sVar1 = *psVar32;
          psVar32 = psVar32 + 1;
        } while (sVar1 != 0);
        FUN_140001710(param_1 + 0x868,psVar12,~uVar23 - 1);
      }
      if (psVar11 != (short *)0x0) {
        uVar23 = 0xffffffffffffffff;
        psVar12 = psVar11;
        do {
          if (uVar23 == 0) break;
          uVar23 = uVar23 - 1;
          sVar1 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar1 != 0);
        FUN_140001710(param_1 + 0x890,psVar11,~uVar23 - 1);
      }
      if (psVar19 != (short *)0x0) {
        uVar23 = 0xffffffffffffffff;
        psVar12 = psVar19;
        do {
          if (uVar23 == 0) break;
          uVar23 = uVar23 - 1;
          sVar1 = *psVar12;
          psVar12 = psVar12 + 1;
        } while (sVar1 != 0);
        FUN_140001710(param_1 + 0x8b8,psVar19,~uVar23 - 1);
      }
      uVar7 = FUN_1402970c0(lVar10,L"nComboType");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nComboType");
      *(undefined4 *)(param_1 + 0x858) = *puVar13;
      *(undefined4 *)(param_1 + 0x8e0) = param_2;
      uVar7 = FUN_1402970c0(lVar10,L"nNoDamageMotion");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nNoDamageMotion");
      *(undefined4 *)(param_1 + 0x85c) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nNameTextID");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nNameTextID");
      *(undefined4 *)(param_1 + 0x8e4) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"fWeaknessDamagePercent");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fWeaknessDamagePercent");
      *(undefined4 *)(param_1 + 0x860) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"szDeathMotion");
      local_358 = 1;
      psVar12 = (short *)FUN_140296990(lVar10,param_2,uVar7,L"szDeathMotion");
      if (psVar12 != (short *)0x0) {
        uVar23 = 0xffffffffffffffff;
        psVar11 = psVar12;
        do {
          if (uVar23 == 0) break;
          uVar23 = uVar23 - 1;
          sVar1 = *psVar11;
          psVar11 = psVar11 + 1;
        } while (sVar1 != 0);
        FUN_140001710(param_1 + 0x6b0,psVar12,~uVar23 - 1);
      }
      uVar7 = FUN_1402970c0(lVar10,L"szColor");
      local_358 = 1;
      uVar9 = FUN_140296990(lVar10,param_2,uVar7,L"szColor");
      uVar7 = FUN_1402970c0(lVar10,L"szGlowColor");
      local_358 = 1;
      uVar20 = FUN_140296990(lVar10,param_2,uVar7,L"szGlowColor");
      uVar7 = FUN_1402970c0(lVar10,L"fGlowSpeed");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_1402967b0(lVar10,param_2,uVar7,L"fGlowSpeed");
      if (puVar13 != (undefined4 *)0x0) {
        *(undefined4 *)(param_1 + 0x340) = *puVar13;
      }
      FUN_140327e90(param_1 + 0x2e0,uVar9);
      FUN_140327e90(param_1 + 0x310,uVar20);
      uVar7 = FUN_1402970c0(lVar10,L"nEffectID");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nEffectID");
      *(undefined4 *)(param_1 + 0x8e8) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nCostumeID");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nCostumeID");
      *(undefined4 *)(param_1 + 0x8f0) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nEventPartID");
      local_358 = 1;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nEventPartID");
      *(undefined4 *)(param_1 + 0x8f4) = *puVar13;
      uVar7 = FUN_1402970c0(lVar10,L"nRespawnGod");
      local_358 = 0;
      piVar15 = (int *)FUN_140296600(lVar10,param_2,uVar7,L"nRespawnGod");
      if (piVar15 != (int *)0x0) {
        *(bool *)(param_1 + 0x7a0) = *piVar15 == 1;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nHiddenDummy");
      local_358 = 0;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nHiddenDummy");
      if (puVar13 != (undefined4 *)0x0) {
        *(undefined4 *)(param_1 + 0x788) = *puVar13;
      }
      uVar7 = FUN_1402970c0(lVar10,L"nHiddenEffectID");
      local_358 = 0;
      puVar13 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,L"nHiddenEffectID");
      if (puVar13 != (undefined4 *)0x0) {
        *(undefined4 *)(param_1 + 0x78c) = *puVar13;
      }
      iVar6 = 0;
      puVar13 = (undefined4 *)(param_1 + 0x790);
      do {
        puVar21 = (undefined8 *)FUN_1404154c0(&local_300,L"nHiddenItemDropGroup%02d",iVar6);
        if (7 < (ulonglong)puVar21[3]) {
          puVar21 = (undefined8 *)*puVar21;
        }
        uVar7 = FUN_1402970c0(lVar10,puVar21);
        local_358 = 0;
        puVar22 = (undefined4 *)FUN_140296600(lVar10,param_2,uVar7,puVar21);
        if (7 < local_2e8) {
          operator_delete((void *)CONCAT62(uStack_2fe,local_300));
        }
        local_2e8 = 7;
        local_2f0 = 0;
        local_300 = 0;
        if (puVar22 != (undefined4 *)0x0) {
          *puVar13 = *puVar22;
        }
        iVar6 = iVar6 + 1;
        puVar13 = puVar13 + 1;
      } while (iVar6 < 4);
      if (7 < local_298) {
        operator_delete((void *)CONCAT62(uStack_2ae,local_2b0));
      }
      uVar9 = 1;
    }
  }
  return uVar9;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140327e90(longlong param_1,longlong param_2)

{
  uint uVar1;
  wchar_t *pwVar2;
  wchar_t *pwVar3;
  wchar_t *pwVar4;
  float *pfVar5;
  uint *puVar6;
  undefined1 auStack_108 [32];
  float local_e8;
  float local_e4;
  float local_e0;
  undefined4 local_dc;
  float local_d8;
  float local_d4;
  float local_d0;
  float local_cc;
  longlong local_c8;
  wchar_t *local_c0;
  wchar_t *local_b8;
  undefined8 local_b0;
  undefined8 local_a0;
  undefined8 local_98;
  undefined4 local_90;
  float local_88 [12];
  ulonglong local_58;
  
  if (param_2 != 0) {
    local_a0 = 0xfffffffffffffffe;
    local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
    local_c0 = (wchar_t *)0x0;
    local_b8 = (wchar_t *)0x0;
    local_b0 = 0;
    FUN_140415930(&local_c0,param_2,&DAT_14049c7b8);
    pwVar2 = local_c0;
    local_98 = 0;
    local_90 = 0;
    if (((longlong)local_b8 - (longlong)local_c0) / 0x28 == 3) {
      local_dc = 0x3f800000;
      pfVar5 = local_88 + 2;
      puVar6 = (uint *)&local_98;
      param_1 = param_1 - (longlong)(local_88 + 2);
      local_c8 = 3;
      pwVar4 = local_c0;
      do {
        pwVar3 = pwVar4;
        if (7 < *(ulonglong *)(pwVar4 + 0xc)) {
          pwVar3 = *(wchar_t **)pwVar4;
        }
        swscanf_s(pwVar3,L"%x");
        uVar1 = *puVar6;
        local_e8 = (float)(uVar1 >> 0x10 & 0xff) / 255.0;
        local_e4 = (float)(uVar1 >> 8 & 0xff) / 255.0;
        local_e0 = (float)(uVar1 & 0xff) / 255.0;
        pfVar5[-2] = local_e8;
        pfVar5[-1] = local_e4;
        *pfVar5 = local_e0;
        pfVar5[1] = 1.0;
        local_cc = pfVar5[1];
        local_d0 = *pfVar5;
        local_d4 = pfVar5[-1];
        local_d8 = pfVar5[-2];
        *(float *)(param_1 + (longlong)pfVar5) = local_d8;
        *(float *)(param_1 + 4 + (longlong)pfVar5) = local_d4;
        *(float *)(param_1 + 8 + (longlong)pfVar5) = local_d0;
        *(float *)(param_1 + 0xc + (longlong)pfVar5) = local_cc;
        pwVar4 = pwVar4 + 0x14;
        puVar6 = puVar6 + 1;
        pfVar5 = pfVar5 + 4;
        local_c8 = local_c8 + -1;
      } while (local_c8 != 0);
      local_c8 = 0;
    }
    pwVar3 = local_b8;
    pwVar4 = pwVar2;
    if (pwVar2 != (wchar_t *)0x0) {
      for (; pwVar4 != pwVar3; pwVar4 = pwVar4 + 0x14) {
        if (7 < *(ulonglong *)(pwVar4 + 0xc)) {
          operator_delete(*(void **)pwVar4);
        }
        pwVar4[0xc] = L'\a';
        pwVar4[0xd] = L'\0';
        pwVar4[0xe] = L'\0';
        pwVar4[0xf] = L'\0';
        pwVar4[8] = L'\0';
        pwVar4[9] = L'\0';
        pwVar4[10] = L'\0';
        pwVar4[0xb] = L'\0';
        *pwVar4 = L'\0';
      }
      operator_delete(pwVar2);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403280d0(longlong param_1,uint param_2)

{
  longlong lVar1;
  short sVar2;
  int *piVar3;
  wchar_t *pwVar4;
  wchar_t *pwVar5;
  undefined4 uVar6;
  int iVar7;
  longlong lVar8;
  short *psVar9;
  undefined8 uVar10;
  undefined4 *puVar11;
  short **ppsVar12;
  void *pvVar13;
  int *piVar14;
  float *pfVar15;
  short *psVar16;
  undefined2 *puVar17;
  uint *puVar18;
  ulonglong uVar19;
  longlong lVar20;
  ushort *puVar21;
  ushort *puVar22;
  ulonglong uVar23;
  wchar_t *pwVar24;
  wchar_t *pwVar25;
  ushort *puVar26;
  ushort *puVar27;
  double dVar28;
  undefined1 auStack_128 [32];
  undefined1 local_108;
  short *local_f8;
  int local_f0 [2];
  wchar_t *local_e8;
  wchar_t *local_e0;
  undefined8 local_d8;
  longlong local_c8;
  wchar_t *local_c0;
  wchar_t *local_b8;
  undefined8 local_b0;
  wchar_t *local_a0;
  wchar_t *local_98;
  undefined8 local_90;
  undefined8 local_80;
  undefined2 local_78;
  undefined6 uStack_76;
  undefined8 local_68;
  ulonglong local_60;
  ulonglong local_50;
  
  local_80 = 0xfffffffffffffffe;
  local_50 = DAT_1405d84f0 ^ (ulonglong)auStack_128;
  uVar23 = (ulonglong)param_2;
  lVar8 = FUN_1402933b0(DAT_140607ff0);
  if (lVar8 != 0) {
    if (*(longlong *)(lVar8 + 0x68) != 0) {
      for (puVar18 = *(uint **)(*(longlong *)(lVar8 + 0x68) +
                               (uVar23 % (ulonglong)*(uint *)(lVar8 + 0x78)) * 8);
          puVar18 != (uint *)0x0; puVar18 = *(uint **)(puVar18 + 6)) {
        if ((puVar18[8] == param_2) && (*puVar18 == param_2)) {
          if (puVar18 == (uint *)0x0) {
            return 0;
          }
          FUN_140001710(param_1 + 0x948,&DAT_1404ac540,3);
          *(undefined4 *)(param_1 + 0x940) = 3;
          FUN_14012baa0(param_1 + 0x348);
          puVar26 = (ushort *)(param_1 + 0x28);
          FUN_140001710(puVar26,&DAT_140477960,0);
          puVar27 = (ushort *)(param_1 + 0x78);
          FUN_140001710(puVar27,&DAT_140477960,0);
          lVar1 = param_1 + 0x50;
          FUN_140001710(lVar1,&DAT_140477960,0);
          *(undefined4 *)(param_1 + 0x1f0) = 1;
          uVar6 = FUN_1402970c0(lVar8,L"wszName");
          local_108 = 1;
          psVar9 = (short *)FUN_140296b70(lVar8,param_2,uVar6,L"wszName");
          uVar19 = 0xffffffffffffffff;
          psVar16 = psVar9;
          goto code_r0x000140328221;
        }
      }
    }
  }
  return 0;
  while( true ) {
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
    if (sVar2 == 0) break;
code_r0x000140328221:
    if (uVar19 == 0) break;
  }
  FUN_140001710(param_1,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szModelFile");
  local_108 = 1;
  local_f8 = (short *)FUN_140296990(lVar8,uVar23,uVar6,L"szModelFile");
  if (local_f8 != (short *)0x0) {
    uVar19 = 0xffffffffffffffff;
    psVar16 = local_f8;
    do {
      if (uVar19 == 0) break;
      uVar19 = uVar19 - 1;
      sVar2 = *psVar16;
      psVar16 = psVar16 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar19 - 1) {
      if (DAT_140607be1 == '\0') {
        uVar10 = FUN_140123ce0();
        FUN_1400015e0(puVar26,uVar10,0,0xffffffffffffffff);
        FUN_140002aa0(puVar26,&DAT_14049a36c,1);
      }
      uVar19 = 0xffffffffffffffff;
      psVar16 = local_f8;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar16;
        psVar16 = psVar16 + 1;
      } while (sVar2 != 0);
      FUN_140002aa0(puVar26,local_f8,~uVar19 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"szSimpleModelFile");
  local_108 = 1;
  local_f8 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szSimpleModelFile");
  if (local_f8 != (short *)0x0) {
    uVar19 = 0xffffffffffffffff;
    psVar16 = local_f8;
    do {
      if (uVar19 == 0) break;
      uVar19 = uVar19 - 1;
      sVar2 = *psVar16;
      psVar16 = psVar16 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar19 - 1) {
      if (DAT_140607be1 == '\0') {
        uVar10 = FUN_140123ce0();
        FUN_1400015e0(lVar1,uVar10,0,0xffffffffffffffff);
        FUN_140002aa0(lVar1,&DAT_14049a36c,1);
      }
      uVar19 = 0xffffffffffffffff;
      psVar16 = local_f8;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar16;
        psVar16 = psVar16 + 1;
      } while (sVar2 != 0);
      FUN_140002aa0(lVar1,local_f8,~uVar19 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"szSubModelFile");
  local_108 = 1;
  local_f8 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szSubModelFile");
  if (local_f8 != (short *)0x0) {
    uVar19 = 0xffffffffffffffff;
    psVar16 = local_f8;
    do {
      if (uVar19 == 0) break;
      uVar19 = uVar19 - 1;
      sVar2 = *psVar16;
      psVar16 = psVar16 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar19 - 1) {
      if (DAT_140607be1 == '\0') {
        uVar10 = FUN_140123ce0();
        FUN_1400015e0(puVar27,uVar10,0,0xffffffffffffffff);
        FUN_140002aa0(puVar27,&DAT_14049a36c,1);
      }
      uVar19 = 0xffffffffffffffff;
      psVar16 = local_f8;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar16;
        psVar16 = psVar16 + 1;
      } while (sVar2 != 0);
      FUN_140002aa0(puVar27,local_f8,~uVar19 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"szSubModelDummy");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szSubModelDummy");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0xf0,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szSubModelGroup");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szSubModelGroup");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x118,psVar9,~uVar19 - 1);
  puVar22 = puVar26;
  if (7 < *(ulonglong *)(param_1 + 0x40)) {
    puVar22 = *(ushort **)puVar26;
  }
  puVar21 = puVar26;
  if (7 < *(ulonglong *)(param_1 + 0x40)) {
    puVar21 = *(ushort **)puVar26;
  }
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (7 < *(ulonglong *)(param_1 + 0x40)) {
    puVar26 = *(ushort **)puVar26;
  }
  if (puVar26 != puVar21 + lVar1) {
    lVar20 = (longlong)puVar22 - (longlong)puVar26;
    do {
      iVar7 = tolower((uint)*puVar26);
      *(short *)((longlong)puVar26 + lVar20) = (short)iVar7;
      puVar26 = puVar26 + 1;
    } while (puVar26 != puVar21 + lVar1);
  }
  puVar26 = (ushort *)(param_1 + 0x50);
  puVar22 = puVar27;
  if (7 < *(ulonglong *)(param_1 + 0x90)) {
    puVar22 = *(ushort **)puVar27;
  }
  puVar21 = puVar27;
  if (7 < *(ulonglong *)(param_1 + 0x90)) {
    puVar21 = *(ushort **)puVar27;
  }
  lVar1 = *(longlong *)(param_1 + 0x88);
  if (7 < *(ulonglong *)(param_1 + 0x90)) {
    puVar27 = *(ushort **)puVar27;
  }
  if (puVar27 != puVar21 + lVar1) {
    lVar20 = (longlong)puVar22 - (longlong)puVar27;
    do {
      iVar7 = tolower((uint)*puVar27);
      *(short *)((longlong)puVar27 + lVar20) = (short)iVar7;
      puVar27 = puVar27 + 1;
    } while (puVar27 != puVar21 + lVar1);
  }
  puVar27 = puVar26;
  if (7 < *(ulonglong *)(param_1 + 0x68)) {
    puVar27 = *(ushort **)puVar26;
  }
  puVar22 = puVar26;
  if (7 < *(ulonglong *)(param_1 + 0x68)) {
    puVar22 = *(ushort **)puVar26;
  }
  lVar1 = *(longlong *)(param_1 + 0x60);
  if (7 < *(ulonglong *)(param_1 + 0x68)) {
    puVar26 = *(ushort **)puVar26;
  }
  if (puVar26 != puVar22 + lVar1) {
    lVar20 = (longlong)puVar27 - (longlong)puVar26;
    do {
      iVar7 = tolower((uint)*puVar26);
      *(short *)((longlong)puVar26 + lVar20) = (short)iVar7;
      puVar26 = puVar26 + 1;
    } while (puVar26 != puVar22 + lVar1);
  }
  uVar6 = FUN_1402970c0(lVar8,L"szLeftHandDummyName");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szLeftHandDummyName");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x158,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szRightHandDummyName");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szRightHandDummyName");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x180,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szCatchDummyName");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szCatchDummyName");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x1a8,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"fMove01Speed");
  local_108 = 1;
  uVar10 = FUN_1402967b0(lVar8,uVar23,uVar6,L"fMove01Speed");
  FUN_14008ea70(param_1 + 0x348,uVar10);
  uVar6 = FUN_1402970c0(lVar8,L"fJumpHeight");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fJumpHeight");
  *(undefined4 *)(param_1 + 0x298) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fJump2Height");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fJump2Height");
  *(undefined4 *)(param_1 + 0x29c) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fMoveHeight");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fMoveHeight");
  *(undefined4 *)(param_1 + 0x2a0) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fWeight");
  local_108 = 0;
  ppsVar12 = (short **)FUN_1402967b0(lVar8,param_2,uVar6,L"fWeight");
  uVar6 = FUN_1402970c0(lVar8,L"fWideRadius");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fWideRadius");
  *(undefined4 *)(param_1 + 0x2a8) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fKeepDistance");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fKeepDistance");
  *(undefined4 *)(param_1 + 0x28c) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fAttackRange");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fAttackRange");
  *(undefined4 *)(param_1 + 0x284) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fLongAttackRange");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fLongAttackRange");
  *(undefined4 *)(param_1 + 0x288) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fChaseRange");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fChaseRange");
  *(undefined4 *)(param_1 + 0x280) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fInvestigationRange");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fInvestigationRange");
  *(undefined4 *)(param_1 + 0x278) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fAttackDelay");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fAttackDelay");
  *(undefined4 *)(param_1 + 0x290) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"szComboTable");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szComboTable");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x390,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szNullMotionTable");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szNullMotionTable");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x430,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szAttackTable");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szAttackTable");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x3b8,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szDownMotionTable");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szDownMotionTable");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x408,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szBasicMotionTable");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,uVar23,uVar6,L"szBasicMotionTable");
  uVar19 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 0x598,psVar9,~uVar19 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"fHeadPos");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fHeadPos");
  *(undefined4 *)(param_1 + 0x2d8) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fRisingDamageWeight");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fRisingDamageWeight");
  *(undefined4 *)(param_1 + 0x2dc) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fScale");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fScale");
  *(undefined4 *)(param_1 + 0x270) = *puVar11;
  if (ppsVar12 != (short **)0x0) {
    local_f8 = (short *)CONCAT44(local_f8._4_4_,0x3f800000);
    if (*(float *)ppsVar12 <= 1.0 && *(float *)ppsVar12 != 1.0) {
      ppsVar12 = &local_f8;
    }
    *(float *)(param_1 + 0x2a4) = *(float *)ppsVar12;
  }
  uVar6 = FUN_1402970c0(lVar8,L"nInvenCount");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nInvenCount");
  *(undefined4 *)(param_1 + 0x274) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nAttributeResistanceFire");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nAttributeResistanceFire");
  *(undefined4 *)(param_1 + 0x7fc) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nAttributeResistanceWater");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nAttributeResistanceWater");
  *(undefined4 *)(param_1 + 0x800) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nAttributeResistanceLight");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nAttributeResistanceLight");
  *(undefined4 *)(param_1 + 0x804) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nAttributeResistanceDarkness");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nAttributeResistanceDarkness");
  *(undefined4 *)(param_1 + 0x808) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nAttributeResistanceEarth");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nAttributeResistanceEarth");
  *(undefined4 *)(param_1 + 0x80c) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nAttributeResistanceWindy");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nAttributeResistanceWindy");
  *(undefined4 *)(param_1 + 0x810) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nAttributeResistanceToxication");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nAttributeResistanceToxication");
  *(undefined4 *)(param_1 + 0x814) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nAttributeResistanceLightning");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nAttributeResistanceLightning");
  *(undefined4 *)(param_1 + 0x818) = *puVar11;
  pvVar13 = operator_new(0x270);
  if (pvVar13 == (void *)0x0) {
    uVar10 = 0;
  }
  else {
    uVar10 = FUN_140329f50(pvVar13);
  }
  FUN_14032a090(param_1 + 0x930,uVar10);
  uVar6 = FUN_1402970c0(lVar8,L"nPetType");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nPetType");
  **(undefined4 **)(param_1 + 0x930) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nPetLevelMin");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nPetLevelMin");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 4) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nPetLevelMax");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nPetLevelMax");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 8) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nPetGrade");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nPetGrade");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0xc) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nNextID");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nNextID");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x10) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nIsDelete");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nIsDelete");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x260) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nSuicide");
  local_108 = 0;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nSuicide");
  if (piVar14 != (int *)0x0) {
    *(bool *)(*(longlong *)(param_1 + 0x930) + 0x14) = *piVar14 == 1;
  }
  uVar6 = FUN_1402970c0(lVar8,L"nUnlimit");
  local_108 = 0;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nUnlimit");
  if (piVar14 != (int *)0x0) {
    *(bool *)(*(longlong *)(param_1 + 0x930) + 0x15) = *piVar14 == 1;
  }
  uVar6 = FUN_1402970c0(lVar8,L"nGrowingLimit");
  local_108 = 0;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nGrowingLimit");
  if (piVar14 != (int *)0x0) {
    *(bool *)(*(longlong *)(param_1 + 0x930) + 0x16) = *piVar14 == 1;
  }
  uVar6 = FUN_1402970c0(lVar8,L"nVital_Growth");
  local_108 = 1;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nVital_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x17) = *piVar14 == 1;
  uVar6 = FUN_1402970c0(lVar8,L"nIntelligence_Growth");
  local_108 = 1;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nIntelligence_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x18) = *piVar14 == 1;
  uVar6 = FUN_1402970c0(lVar8,L"nStrength_Growth");
  local_108 = 1;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nStrength_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x19) = *piVar14 == 1;
  uVar6 = FUN_1402970c0(lVar8,L"nResilient_Growth");
  local_108 = 1;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nResilient_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x1a) = *piVar14 == 1;
  uVar6 = FUN_1402970c0(lVar8,L"nEloquence_Growth");
  local_108 = 1;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nEloquence_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x1b) = *piVar14 == 1;
  uVar6 = FUN_1402970c0(lVar8,L"nCharm_Growth");
  local_108 = 1;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nCharm_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x1c) = *piVar14 == 1;
  uVar6 = FUN_1402970c0(lVar8,L"nTemper_Growth");
  local_108 = 1;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nTemper_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x1d) = *piVar14 == 1;
  uVar6 = FUN_1402970c0(lVar8,L"fHeight_Growth");
  local_108 = 1;
  pfVar15 = (float *)FUN_1402967b0(lVar8,param_2,uVar6,L"fHeight_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x1e) = 0.1 < *pfVar15;
  uVar6 = FUN_1402970c0(lVar8,L"fWeight_Growth");
  local_108 = 1;
  pfVar15 = (float *)FUN_1402967b0(lVar8,param_2,uVar6,L"fWeight_Growth");
  *(bool *)(*(longlong *)(param_1 + 0x930) + 0x1f) = 0.1 < *pfVar15;
  uVar6 = FUN_1402970c0(lVar8,L"fExpFactor");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fExpFactor");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x20) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fPickUpRange");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,uVar23,uVar6,L"fPickUpRange");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x24) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fBetrayalTime");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fBetrayalTime");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x28) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fPetEatGold");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fPetEatGold");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x2c) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nTransferID");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nTransferID");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x30) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nDeathDropItemID");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nDeathDropItemID");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x34) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nDeathNameID");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nDeathNameID");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x38) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nItemPickUp");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nItemPickUp");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x40) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nRebirthID");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nRebirthID");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x44) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nRebirthValue");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nRebirthValue");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x48) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"szPetEatItemTable");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szPetEatItemTable");
  uVar23 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar23 == 0) break;
    uVar23 = uVar23 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x138,psVar9,~uVar23 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szPetExpTable");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szPetExpTable");
  uVar23 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar23 == 0) break;
    uVar23 = uVar23 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x160,psVar9,~uVar23 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szIcon");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szIcon");
  uVar23 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar23 == 0) break;
    uVar23 = uVar23 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x70,psVar9,~uVar23 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szBigIcon");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szBigIcon");
  uVar23 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar23 == 0) break;
    uVar23 = uVar23 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x98,psVar9,~uVar23 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szPetEatIcon");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szPetEatIcon");
  uVar23 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar23 == 0) break;
    uVar23 = uVar23 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(*(longlong *)(param_1 + 0x930) + 0xc0,psVar9,~uVar23 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szBetrayalIcon");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szBetrayalIcon");
  uVar23 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar23 == 0) break;
    uVar23 = uVar23 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(*(longlong *)(param_1 + 0x930) + 0xe8,psVar9,~uVar23 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"szAI");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szAI");
  uVar23 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar23 == 0) break;
    uVar23 = uVar23 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 200,psVar9,~uVar23 - 1);
  uVar6 = FUN_1402970c0(lVar8,L"nCashVit");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nCashVit");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x4c) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nCashInt");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nCashInt");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x50) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nCashStr");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nCashStr");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x54) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nCashRes");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nCashRes");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x58) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nCashElo");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nCashElo");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x5c) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nCashCha");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nCashCha");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x60) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"nCashTem");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nCashTem");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 100) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fCashHei");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fCashHei");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x68) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"fCashWei");
  local_108 = 1;
  puVar11 = (undefined4 *)FUN_1402967b0(lVar8,param_2,uVar6,L"fCashWei");
  *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x6c) = *puVar11;
  uVar6 = FUN_1402970c0(lVar8,L"szSkillTable");
  local_108 = 0;
  psVar16 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szSkillTable");
  if (psVar16 != (short *)0x0) {
    uVar23 = 0xffffffffffffffff;
    psVar9 = psVar16;
    do {
      if (uVar23 == 0) break;
      uVar23 = uVar23 - 1;
      sVar2 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar23 - 1) {
      uVar23 = 0xffffffffffffffff;
      psVar9 = psVar16;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar2 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar2 != 0);
      FUN_140001710(param_1 + 0x458,psVar16,~uVar23 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"szPetSkillAiTable");
  local_108 = 0;
  psVar16 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szPetSkillAiTable");
  if (psVar16 != (short *)0x0) {
    uVar23 = 0xffffffffffffffff;
    psVar9 = psVar16;
    do {
      if (uVar23 == 0) break;
      uVar23 = uVar23 - 1;
      sVar2 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar23 - 1) {
      uVar23 = 0xffffffffffffffff;
      psVar9 = psVar16;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar2 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar2 != 0);
      FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x200,psVar16,~uVar23 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"szCameraPos");
  local_108 = 1;
  uVar10 = FUN_140296990(lVar8,param_2,uVar6,L"szCameraPos");
  local_c0 = (wchar_t *)0x0;
  local_b8 = (wchar_t *)0x0;
  local_b0 = 0;
  FUN_140415b90(&local_c0,uVar10,&DAT_14049c7b8);
  pwVar25 = local_c0;
  pwVar24 = local_c0;
  if (7 < *(ulonglong *)(local_c0 + 0xc)) {
    pwVar24 = *(wchar_t **)local_c0;
  }
  lVar1 = *(longlong *)(param_1 + 0x930);
  dVar28 = _wtof(pwVar24);
  *(float *)(lVar1 + 0x228) = (float)dVar28;
  pwVar24 = pwVar25 + 0x14;
  if (7 < *(ulonglong *)(pwVar25 + 0x20)) {
    pwVar24 = *(wchar_t **)pwVar24;
  }
  lVar1 = *(longlong *)(param_1 + 0x930);
  dVar28 = _wtof(pwVar24);
  *(float *)(lVar1 + 0x22c) = (float)dVar28;
  pwVar24 = pwVar25 + 0x28;
  if (7 < *(ulonglong *)(pwVar25 + 0x34)) {
    pwVar24 = *(wchar_t **)pwVar24;
  }
  lVar1 = *(longlong *)(param_1 + 0x930);
  dVar28 = _wtof(pwVar24);
  *(float *)(lVar1 + 0x230) = (float)dVar28;
  uVar6 = FUN_1402970c0(lVar8,L"szCameraDir");
  local_108 = 1;
  uVar10 = FUN_140296990(lVar8,param_2,uVar6,L"szCameraDir");
  local_a0 = (wchar_t *)0x0;
  local_98 = (wchar_t *)0x0;
  local_90 = 0;
  FUN_140415b90(&local_a0,uVar10,&DAT_14049c7b8);
  pwVar25 = local_a0;
  pwVar24 = local_a0;
  if (7 < *(ulonglong *)(local_a0 + 0xc)) {
    pwVar24 = *(wchar_t **)local_a0;
  }
  lVar1 = *(longlong *)(param_1 + 0x930);
  dVar28 = _wtof(pwVar24);
  *(float *)(lVar1 + 0x234) = (float)dVar28;
  pwVar24 = pwVar25 + 0x14;
  if (7 < *(ulonglong *)(pwVar25 + 0x20)) {
    pwVar24 = *(wchar_t **)pwVar24;
  }
  lVar1 = *(longlong *)(param_1 + 0x930);
  dVar28 = _wtof(pwVar24);
  *(float *)(lVar1 + 0x238) = (float)dVar28;
  pwVar24 = pwVar25 + 0x28;
  if (7 < *(ulonglong *)(pwVar25 + 0x34)) {
    pwVar24 = *(wchar_t **)pwVar24;
  }
  lVar1 = *(longlong *)(param_1 + 0x930);
  dVar28 = _wtof(pwVar24);
  *(float *)(lVar1 + 0x23c) = (float)dVar28;
  uVar6 = FUN_1402970c0(lVar8,L"szCostumeGroup");
  local_108 = 1;
  psVar9 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szCostumeGroup");
  local_60 = 7;
  local_68 = 0;
  local_78 = 0;
  uVar23 = 0xffffffffffffffff;
  psVar16 = psVar9;
  do {
    if (uVar23 == 0) break;
    uVar23 = uVar23 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  FUN_140001710(&local_78,psVar9,~uVar23 - 1);
  local_e8 = (wchar_t *)0x0;
  local_e0 = (wchar_t *)0x0;
  local_d8 = 0;
  puVar17 = &local_78;
  if (7 < local_60) {
    puVar17 = (undefined2 *)CONCAT62(uStack_76,local_78);
  }
  FUN_140415930(&local_e8,puVar17);
  lVar1 = ((longlong)local_e0 - (longlong)local_e8) / 0x28;
  local_c8 = lVar1;
  FUN_140051e60(*(longlong *)(param_1 + 0x930) + 0x240,lVar1);
  local_f8 = (short *)((ulonglong)local_f8 & 0xffffffff00000000);
  pwVar24 = local_e8;
  if (0 < (int)lVar1) {
    do {
      pwVar25 = pwVar24;
      if (7 < *(ulonglong *)(pwVar24 + 0xc)) {
        pwVar25 = *(wchar_t **)pwVar24;
      }
      iVar7 = _wtoi(pwVar25);
      lVar1 = *(longlong *)(param_1 + 0x930);
      piVar14 = *(int **)(lVar1 + 0x248);
      local_f0[0] = iVar7;
      if ((local_f0 < piVar14) && (piVar3 = *(int **)(lVar1 + 0x240), piVar3 <= local_f0)) {
        if (piVar14 == *(int **)(lVar1 + 0x250)) {
          FUN_1400556a0(lVar1 + 0x240,1);
        }
        if (*(undefined4 **)(lVar1 + 0x248) != (undefined4 *)0x0) {
          **(undefined4 **)(lVar1 + 0x248) =
               *(undefined4 *)
                (*(longlong *)(lVar1 + 0x240) + ((longlong)local_f0 - (longlong)piVar3 >> 2) * 4);
        }
      }
      else {
        if (piVar14 == *(int **)(lVar1 + 0x250)) {
          FUN_1400556a0(lVar1 + 0x240,1);
        }
        if (*(int **)(lVar1 + 0x248) != (int *)0x0) {
          **(int **)(lVar1 + 0x248) = iVar7;
        }
      }
      *(longlong *)(lVar1 + 0x248) = *(longlong *)(lVar1 + 0x248) + 4;
      iVar7 = (int)local_f8 + 1;
      local_f8 = (short *)CONCAT44(local_f8._4_4_,iVar7);
      pwVar25 = local_a0;
      pwVar24 = pwVar24 + 0x14;
    } while (iVar7 < (int)local_c8);
  }
  uVar6 = FUN_1402970c0(lVar8,L"nDeathMessage");
  local_108 = 0;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nDeathMessage");
  if (puVar11 != (undefined4 *)0x0) {
    *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x3c) = *puVar11;
  }
  uVar6 = FUN_1402970c0(lVar8,L"nGroupID");
  local_108 = 0;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nGroupID");
  if (puVar11 != (undefined4 *)0x0) {
    *(undefined4 *)(param_1 + 0x200) = *puVar11;
  }
  uVar6 = FUN_1402970c0(lVar8,L"nRebirthCoolTime");
  local_108 = 0;
  puVar11 = (undefined4 *)FUN_140296600(lVar8,param_2,uVar6,L"nRebirthCoolTime");
  if (puVar11 != (undefined4 *)0x0) {
    *(undefined4 *)(*(longlong *)(param_1 + 0x930) + 0x264) = *puVar11;
  }
  uVar6 = FUN_1402970c0(lVar8,L"szDeadFX");
  local_108 = 0;
  psVar16 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szDeadFX");
  if (psVar16 != (short *)0x0) {
    uVar23 = 0xffffffffffffffff;
    psVar9 = psVar16;
    do {
      if (uVar23 == 0) break;
      uVar23 = uVar23 - 1;
      sVar2 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar23 - 1) {
      uVar23 = 0xffffffffffffffff;
      psVar9 = psVar16;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar2 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar2 != 0);
      FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x188,psVar16,~uVar23 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"szDeadDummy");
  local_108 = 0;
  psVar16 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szDeadDummy");
  if (psVar16 != (short *)0x0) {
    uVar23 = 0xffffffffffffffff;
    psVar9 = psVar16;
    do {
      if (uVar23 == 0) break;
      uVar23 = uVar23 - 1;
      sVar2 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar23 - 1) {
      uVar23 = 0xffffffffffffffff;
      psVar9 = psVar16;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar2 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar2 != 0);
      FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x1b0,psVar16,~uVar23 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"szDeadEffectMotion");
  local_108 = 0;
  psVar16 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szDeadEffectMotion");
  if (psVar16 != (short *)0x0) {
    uVar23 = 0xffffffffffffffff;
    psVar9 = psVar16;
    do {
      if (uVar23 == 0) break;
      uVar23 = uVar23 - 1;
      sVar2 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar23 - 1) {
      uVar23 = 0xffffffffffffffff;
      psVar9 = psVar16;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar2 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar2 != 0);
      FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x1d8,psVar16,~uVar23 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"szDeadIcon");
  local_108 = 0;
  psVar16 = (short *)FUN_140296990(lVar8,param_2,uVar6,L"szDeadIcon");
  if (psVar16 != (short *)0x0) {
    uVar23 = 0xffffffffffffffff;
    psVar9 = psVar16;
    do {
      if (uVar23 == 0) break;
      uVar23 = uVar23 - 1;
      sVar2 = *psVar9;
      psVar9 = psVar9 + 1;
    } while (sVar2 != 0);
    if (1 < ~uVar23 - 1) {
      uVar23 = 0xffffffffffffffff;
      psVar9 = psVar16;
      do {
        if (uVar23 == 0) break;
        uVar23 = uVar23 - 1;
        sVar2 = *psVar9;
        psVar9 = psVar9 + 1;
      } while (sVar2 != 0);
      FUN_140001710(*(longlong *)(param_1 + 0x930) + 0x110,psVar16,~uVar23 - 1);
    }
  }
  uVar6 = FUN_1402970c0(lVar8,L"nPetGroup");
  local_108 = 0;
  puVar17 = (undefined2 *)FUN_140296600(lVar8,param_2,uVar6,L"nPetGroup");
  if (puVar17 != (undefined2 *)0x0) {
    *(undefined2 *)(*(longlong *)(param_1 + 0x930) + 0x268) = *puVar17;
  }
  uVar6 = FUN_1402970c0(lVar8,L"nChaseType");
  local_108 = 0;
  piVar14 = (int *)FUN_140296600(lVar8,param_2,uVar6,L"nChaseType");
  pwVar5 = local_e0;
  pwVar24 = local_e8;
  if (piVar14 == (int *)0x0) {
    *(undefined1 *)(*(longlong *)(param_1 + 0x930) + 0x26a) = 1;
  }
  else {
    *(bool *)(*(longlong *)(param_1 + 0x930) + 0x26a) = *piVar14 == 0;
  }
  pwVar4 = local_e8;
  if (local_e8 != (wchar_t *)0x0) {
    for (; pwVar4 != pwVar5; pwVar4 = pwVar4 + 0x14) {
      if (7 < *(ulonglong *)(pwVar4 + 0xc)) {
        operator_delete(*(void **)pwVar4);
      }
      pwVar4[0xc] = L'\a';
      pwVar4[0xd] = L'\0';
      pwVar4[0xe] = L'\0';
      pwVar4[0xf] = L'\0';
      pwVar4[8] = L'\0';
      pwVar4[9] = L'\0';
      pwVar4[10] = L'\0';
      pwVar4[0xb] = L'\0';
      *pwVar4 = L'\0';
    }
    operator_delete(pwVar24);
  }
  if (7 < local_60) {
    operator_delete((void *)CONCAT62(uStack_76,local_78));
  }
  pwVar5 = local_98;
  local_60 = 7;
  local_68 = 0;
  local_78 = 0;
  for (pwVar24 = pwVar25; pwVar24 != pwVar5; pwVar24 = pwVar24 + 0x14) {
    if (7 < *(ulonglong *)(pwVar24 + 0xc)) {
      operator_delete(*(void **)pwVar24);
    }
    pwVar24[0xc] = L'\a';
    pwVar24[0xd] = L'\0';
    pwVar24[0xe] = L'\0';
    pwVar24[0xf] = L'\0';
    pwVar24[8] = L'\0';
    pwVar24[9] = L'\0';
    pwVar24[10] = L'\0';
    pwVar24[0xb] = L'\0';
    *pwVar24 = L'\0';
  }
  operator_delete(pwVar25);
  pwVar5 = local_b8;
  pwVar24 = local_c0;
  for (pwVar25 = local_c0; pwVar25 != pwVar5; pwVar25 = pwVar25 + 0x14) {
    if (7 < *(ulonglong *)(pwVar25 + 0xc)) {
      operator_delete(*(void **)pwVar25);
    }
    pwVar25[0xc] = L'\a';
    pwVar25[0xd] = L'\0';
    pwVar25[0xe] = L'\0';
    pwVar25[0xf] = L'\0';
    pwVar25[8] = L'\0';
    pwVar25[9] = L'\0';
    pwVar25[10] = L'\0';
    pwVar25[0xb] = L'\0';
    *pwVar25 = L'\0';
  }
  operator_delete(pwVar24);
  return 1;
}



longlong FUN_140329f50(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x88) = 7;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined2 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined8 *)(param_1 + 0xb0) = 7;
  *(undefined2 *)(param_1 + 0x98) = 0;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  *(undefined8 *)(param_1 + 0xd8) = 7;
  *(undefined2 *)(param_1 + 0xc0) = 0;
  *(undefined8 *)(param_1 + 0xf8) = 0;
  *(undefined8 *)(param_1 + 0x100) = 7;
  *(undefined2 *)(param_1 + 0xe8) = 0;
  *(undefined8 *)(param_1 + 0x120) = 0;
  *(undefined8 *)(param_1 + 0x128) = 7;
  *(undefined2 *)(param_1 + 0x110) = 0;
  *(undefined8 *)(param_1 + 0x148) = 0;
  *(undefined8 *)(param_1 + 0x150) = 7;
  *(undefined2 *)(param_1 + 0x138) = 0;
  *(undefined8 *)(param_1 + 0x170) = 0;
  *(undefined8 *)(param_1 + 0x178) = 7;
  *(undefined2 *)(param_1 + 0x160) = 0;
  *(undefined8 *)(param_1 + 0x198) = 0;
  *(undefined8 *)(param_1 + 0x1a0) = 7;
  *(undefined2 *)(param_1 + 0x188) = 0;
  *(undefined8 *)(param_1 + 0x1c0) = 0;
  *(undefined8 *)(param_1 + 0x1c8) = 7;
  *(undefined2 *)(param_1 + 0x1b0) = 0;
  *(undefined8 *)(param_1 + 0x1e8) = 0;
  *(undefined8 *)(param_1 + 0x1f0) = 7;
  *(undefined2 *)(param_1 + 0x1d8) = 0;
  *(undefined8 *)(param_1 + 0x210) = 0;
  *(undefined8 *)(param_1 + 0x218) = 7;
  *(undefined2 *)(param_1 + 0x200) = 0;
  *(undefined8 *)(param_1 + 0x240) = 0;
  *(undefined8 *)(param_1 + 0x248) = 0;
  *(undefined8 *)(param_1 + 0x250) = 0;
  return param_1;
}



undefined8 * FUN_14032a080(undefined8 *param_1)

{
  if (7 < (ulonglong)param_1[3]) {
    return (undefined8 *)*param_1;
  }
  return param_1;
}



void FUN_14032a090(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_14032a110(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



undefined8 * FUN_14032a110(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;
}



void FUN_14032a180(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14032a1b0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14032a1b0(longlong param_1)

{
  if (*(void **)(param_1 + 0x240) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x240));
  }
  *(undefined8 *)(param_1 + 0x240) = 0;
  *(undefined8 *)(param_1 + 0x248) = 0;
  *(undefined8 *)(param_1 + 0x250) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x218)) {
    operator_delete(*(void **)(param_1 + 0x200));
  }
  *(undefined8 *)(param_1 + 0x218) = 7;
  *(undefined8 *)(param_1 + 0x210) = 0;
  *(undefined2 *)(param_1 + 0x200) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1f0)) {
    operator_delete(*(void **)(param_1 + 0x1d8));
  }
  *(undefined8 *)(param_1 + 0x1f0) = 7;
  *(undefined8 *)(param_1 + 0x1e8) = 0;
  *(undefined2 *)(param_1 + 0x1d8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1c8)) {
    operator_delete(*(void **)(param_1 + 0x1b0));
  }
  *(undefined8 *)(param_1 + 0x1c8) = 7;
  *(undefined8 *)(param_1 + 0x1c0) = 0;
  *(undefined2 *)(param_1 + 0x1b0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1a0)) {
    operator_delete(*(void **)(param_1 + 0x188));
  }
  *(undefined8 *)(param_1 + 0x1a0) = 7;
  *(undefined8 *)(param_1 + 0x198) = 0;
  *(undefined2 *)(param_1 + 0x188) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x178)) {
    operator_delete(*(void **)(param_1 + 0x160));
  }
  *(undefined8 *)(param_1 + 0x178) = 7;
  *(undefined8 *)(param_1 + 0x170) = 0;
  *(undefined2 *)(param_1 + 0x160) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x150)) {
    operator_delete(*(void **)(param_1 + 0x138));
  }
  *(undefined8 *)(param_1 + 0x150) = 7;
  *(undefined8 *)(param_1 + 0x148) = 0;
  *(undefined2 *)(param_1 + 0x138) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x128)) {
    operator_delete(*(void **)(param_1 + 0x110));
  }
  *(undefined8 *)(param_1 + 0x128) = 7;
  *(undefined8 *)(param_1 + 0x120) = 0;
  *(undefined2 *)(param_1 + 0x110) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x100)) {
    operator_delete(*(void **)(param_1 + 0xe8));
  }
  *(undefined8 *)(param_1 + 0x100) = 7;
  *(undefined8 *)(param_1 + 0xf8) = 0;
  *(undefined2 *)(param_1 + 0xe8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xd8)) {
    operator_delete(*(void **)(param_1 + 0xc0));
  }
  *(undefined8 *)(param_1 + 0xd8) = 7;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  *(undefined2 *)(param_1 + 0xc0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xb0)) {
    operator_delete(*(void **)(param_1 + 0x98));
  }
  *(undefined8 *)(param_1 + 0xb0) = 7;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined2 *)(param_1 + 0x98) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x88)) {
    operator_delete(*(void **)(param_1 + 0x70));
  }
  *(undefined8 *)(param_1 + 0x88) = 7;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined2 *)(param_1 + 0x70) = 0;
  return;
}



undefined8 * FUN_14032a400(undefined8 *param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  
  *param_1 = mcoCharacterCondition::vftable;
  puVar3 = (undefined8 *)0x0;
  param_1[0x3e] = 0;
  *(undefined4 *)(param_1 + 0x3f) = 0x3f800000;
  _eh_vector_constructor_iterator_
            (param_1 + 0x40,0x28,0xf,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  param_1[1] = param_2;
  memset(param_1 + 0x11,0,0x3c);
  memset((void *)((longlong)param_1 + 0xc4),0,0x3c);
  memset(param_1 + 0x20,0,0x78);
  memset(param_1 + 0x2f,0,0x78);
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionToxication::vftable;
    puVar2 = puVar1;
  }
  param_1[0x37] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionStone::vftable;
    puVar2 = puVar1;
  }
  param_1[0x34] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionFreezing::vftable;
    puVar2 = puVar1;
  }
  param_1[0x35] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionCold::vftable;
    puVar2 = puVar1;
  }
  param_1[0x31] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionSleep::vftable;
    puVar2 = puVar1;
  }
  param_1[0x39] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionSickness::vftable;
    puVar2 = puVar1;
  }
  param_1[0x38] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionStun::vftable;
    puVar2 = puVar1;
  }
  param_1[0x33] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionBlooding::vftable;
    puVar2 = puVar1;
  }
  param_1[0x30] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionChaos::vftable;
    puVar2 = puVar1;
  }
  param_1[0x3a] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionFire::vftable;
    puVar2 = puVar1;
  }
  param_1[0x32] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionSlow::vftable;
    puVar2 = puVar1;
  }
  param_1[0x36] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionLightning::vftable;
    puVar2 = puVar1;
  }
  param_1[0x3b] = puVar2;
  puVar1 = operator_new(0x78);
  puVar2 = puVar3;
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1[1];
    puVar1[2] = 0;
    *(undefined4 *)(puVar1 + 3) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar1 + 4) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar1 + 0x2c) = 0;
    puVar1[7] = 0;
    *(undefined4 *)(puVar1 + 8) = 0;
    puVar1[9] = 0;
    puVar1[10] = 0;
    puVar1[0xb] = 0;
    puVar1[0xc] = 0;
    puVar1[0xd] = 0;
    *puVar1 = mcoConditionDarkness::vftable;
    puVar2 = puVar1;
  }
  param_1[0x3c] = puVar2;
  puVar2 = operator_new(0x78);
  if (puVar2 != (undefined8 *)0x0) {
    puVar2[1] = param_1[1];
    puVar2[2] = 0;
    *(undefined4 *)(puVar2 + 3) = 0;
    *(undefined4 *)((longlong)puVar2 + 0x1c) = 0x3f800000;
    *(undefined1 *)(puVar2 + 4) = 0;
    *(undefined8 *)((longlong)puVar2 + 0x24) = 0;
    *(undefined8 *)((longlong)puVar2 + 0x2c) = 0;
    puVar2[7] = 0;
    *(undefined4 *)(puVar2 + 8) = 0;
    puVar2[9] = 0;
    puVar2[10] = 0;
    puVar2[0xb] = 0;
    puVar2[0xc] = 0;
    puVar2[0xd] = 0;
    *puVar2 = mcoConditionHold::vftable;
    puVar3 = puVar2;
  }
  param_1[0x3d] = puVar3;
  return param_1;
}



void * FUN_14032aa30(void *param_1,uint param_2)

{
  FUN_14032aa80();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14032aa60(void *param_1)

{
  _eh_vector_destructor_iterator_(param_1,0x28,0xf,FUN_14023be90);
  return;
}



void FUN_14032aa80(undefined8 *param_1)

{
  undefined8 *puVar1;
  int iVar2;
  longlong *plVar3;
  longlong *plVar4;
  uint uVar5;
  
  uVar5 = 0;
  *param_1 = mcoCharacterCondition::vftable;
  plVar4 = param_1 + 0x2f;
  iVar2 = DAT_140608178;
  do {
    plVar3 = plVar4;
    if (0xe < uVar5) {
      if (iVar2 == 0) {
        FUN_140176d60(0);
        iVar2 = DAT_140608178;
      }
      iVar2 = iVar2 + 1;
      plVar3 = &DAT_140608170;
      DAT_140608178 = iVar2;
    }
    if (*plVar3 != 0) {
      plVar3 = plVar4;
      if (0xe < uVar5) {
        if (iVar2 == 0) {
          FUN_140176d60(0);
          iVar2 = DAT_140608178;
        }
        iVar2 = iVar2 + 1;
        plVar3 = &DAT_140608170;
        DAT_140608178 = iVar2;
      }
      puVar1 = (undefined8 *)*plVar3;
      if (puVar1 != (undefined8 *)0x0) {
        *puVar1 = mcoCondition::vftable;
        if ((void *)puVar1[0xb] != (void *)0x0) {
          operator_delete((void *)puVar1[0xb]);
        }
        puVar1[0xb] = 0;
        puVar1[0xc] = 0;
        puVar1[0xd] = 0;
        operator_delete(puVar1);
        iVar2 = DAT_140608178;
      }
    }
    plVar3 = plVar4;
    if (0xe < uVar5) {
      if (iVar2 == 0) {
        FUN_140176d60(0);
        iVar2 = DAT_140608178;
      }
      iVar2 = iVar2 + 1;
      plVar3 = &DAT_140608170;
      DAT_140608178 = iVar2;
    }
    uVar5 = uVar5 + 1;
    plVar4 = plVar4 + 1;
    *plVar3 = 0;
  } while ((int)uVar5 < 0xf);
  _eh_vector_destructor_iterator_(param_1 + 0x40,0x28,0xf,FUN_14023be90);
  return;
}



void FUN_14032abd0(longlong param_1,int param_2,undefined4 param_3)

{
  float fVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong *plVar4;
  
  if (param_2 - 1U < 0xe) {
    uVar2 = FUN_14031e0e0();
    lVar3 = FUN_14031d780(uVar2,param_2,param_3);
    if (lVar3 != 0) {
      fVar1 = *(float *)(lVar3 + 0x14);
      plVar4 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
      *(double *)(*plVar4 + 0x10) = (double)fVar1 + *(double *)(*plVar4 + 0x10);
    }
  }
  return;
}



void FUN_14032ac50(longlong param_1,uint param_2,double param_3)

{
  longlong lVar1;
  longlong *plVar2;
  double dVar3;
  
  if (param_2 - 1 < 0xe) {
    if (param_2 < 0xf) {
      plVar2 = (longlong *)(param_1 + 0x178 + (longlong)(int)param_2 * 8);
    }
    else {
      if (DAT_140608178 == 0) {
        FUN_140176d60(0);
      }
      DAT_140608178 = DAT_140608178 + 1;
      plVar2 = &DAT_140608170;
    }
    lVar1 = *plVar2;
    dVar3 = (double)*(float *)(lVar1 + 0x30) + *(double *)(lVar1 + 0x38);
    if (dVar3 <= param_3) {
      *(double *)(lVar1 + 0x10) = dVar3;
      return;
    }
    *(double *)(lVar1 + 0x10) = param_3;
  }
  return;
}



undefined8 FUN_14032ace0(longlong param_1,uint param_2,undefined4 param_3)

{
  undefined4 uVar1;
  double dVar2;
  float fVar3;
  undefined8 uVar4;
  char *pcVar5;
  longlong *plVar6;
  undefined8 *puVar7;
  undefined4 *puVar8;
  
  if (param_2 - 1 < 0xe) {
    if (param_2 < 0xf) {
      puVar8 = (undefined4 *)(param_1 + 0xc4 + (longlong)(int)param_2 * 4);
    }
    else {
      if (DAT_140608190 == 0) {
        FUN_140176d60(0);
      }
      DAT_140608190 = DAT_140608190 + 1;
      puVar8 = &DAT_14060818c;
    }
    *puVar8 = param_3;
    if (param_2 < 0xf) {
      puVar7 = (undefined8 *)(param_1 + 0x100 + (longlong)(int)param_2 * 8);
    }
    else {
      if (DAT_140609388 == 0) {
        FUN_140176d60(0);
      }
      DAT_140609388 = DAT_140609388 + 1;
      puVar7 = &DAT_140609380;
    }
    *puVar7 = *(undefined8 *)(param_1 + 0x1f0);
    uVar4 = FUN_14031e0e0();
    pcVar5 = (char *)FUN_14031d780(uVar4,param_2,param_3);
    if (pcVar5 != (char *)0x0) {
      uVar4 = *(undefined8 *)(param_1 + 0x1f0);
      plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
      *(undefined8 *)(*plVar6 + 0x38) = uVar4;
      if (pcVar5[1] != '\0') {
        uVar1 = *(undefined4 *)(pcVar5 + 0x10);
        plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
        *(undefined4 *)(*plVar6 + 0x18) = uVar1;
      }
      if (pcVar5[2] != '\0') {
        fVar3 = *(float *)(pcVar5 + 0x14);
        dVar2 = *(double *)(param_1 + 0x1f0);
        plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
        *(double *)(*plVar6 + 0x10) = (double)fVar3 + dVar2;
      }
      if (pcVar5[3] != '\0') {
        uVar1 = *(undefined4 *)(pcVar5 + 0x18);
        plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
        *(undefined4 *)(*plVar6 + 0x1c) = uVar1;
      }
      if (pcVar5[4] != '\0') {
        uVar1 = *(undefined4 *)(pcVar5 + 0x1c);
        plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
        *(undefined4 *)(*plVar6 + 0x50) = uVar1;
      }
      if (pcVar5[9] != '\0') {
        puVar7 = (undefined8 *)FUN_14023bf00(param_1 + 0x178,param_2);
        FUN_140349e80(*puVar7,pcVar5 + 0x30);
      }
      if (pcVar5[5] != '\0') {
        uVar1 = *(undefined4 *)(pcVar5 + 0x20);
        plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
        *(undefined4 *)(*plVar6 + 0x24) = uVar1;
      }
      if (pcVar5[6] != '\0') {
        uVar1 = *(undefined4 *)(pcVar5 + 0x24);
        plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
        *(undefined4 *)(*plVar6 + 0x28) = uVar1;
      }
      if (pcVar5[7] != '\0') {
        uVar1 = *(undefined4 *)(pcVar5 + 0x28);
        plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
        *(undefined4 *)(*plVar6 + 0x2c) = uVar1;
      }
      if (pcVar5[8] != '\0') {
        uVar1 = *(undefined4 *)(pcVar5 + 0x2c);
        plVar6 = (longlong *)FUN_14023bf00(param_1 + 0x178,param_2);
        *(undefined4 *)(*plVar6 + 0x54) = uVar1;
      }
      if (*pcVar5 != '\0') {
        puVar8 = (undefined4 *)FUN_14027c330(param_1 + 0x88,param_2);
        *puVar8 = *(undefined4 *)(pcVar5 + 0xc);
      }
      puVar7 = (undefined8 *)FUN_14023bf00(param_1 + 0x178,param_2);
      (**(code **)(*(longlong *)*puVar7 + 8))();
      return 1;
    }
  }
  return 0;
}



undefined4 FUN_14032af50(longlong param_1,uint param_2)

{
  if (0xd < param_2 - 1) {
    return 0;
  }
  if (param_2 < 0xf) {
    return *(undefined4 *)(param_1 + 0xc4 + (longlong)(int)param_2 * 4);
  }
  if (DAT_140608190 == 0) {
    FUN_140176d60(0);
  }
  DAT_140608190 = DAT_140608190 + 1;
  return DAT_14060818c;
}



uint FUN_14032afb0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  uint uVar4;
  
  *(undefined8 *)(param_1 + 0x1f0) = param_2;
  *(undefined4 *)(param_1 + 0x1f8) = 0x3f800000;
  uVar4 = 1;
  do {
    if (uVar4 < 0xf) {
      puVar3 = (undefined8 *)(param_1 + 0x178 + (longlong)(int)uVar4 * 8);
    }
    else {
      if (DAT_140608178 == 0) {
        FUN_140176d60(0);
      }
      DAT_140608178 = DAT_140608178 + 1;
      puVar3 = &DAT_140608170;
    }
    cVar1 = (**(code **)(*(longlong *)*puVar3 + 0x18))((longlong *)*puVar3,param_2,param_3);
    if (cVar1 != '\0') {
      return uVar4;
    }
    if (uVar4 < 0xf) {
      plVar2 = (longlong *)(param_1 + 0x178 + (longlong)(int)uVar4 * 8);
    }
    else {
      if (DAT_140608178 == 0) {
        FUN_140176d60(0);
      }
      DAT_140608178 = DAT_140608178 + 1;
      plVar2 = &DAT_140608170;
    }
    uVar4 = uVar4 + 1;
    *(float *)(param_1 + 0x1f8) = *(float *)(*plVar2 + 0x1c) * *(float *)(param_1 + 0x1f8);
  } while ((int)uVar4 < 0xf);
  return 0;
}



ulonglong FUN_14032b0a0(longlong param_1,uint param_2)

{
  if (0xd < param_2 - 1) {
    return (ulonglong)(uint3)(param_2 - 1 >> 8) << 8;
  }
  if (param_2 < 0xf) {
    return (ulonglong)*(byte *)(*(longlong *)(param_1 + 0x178 + (longlong)(int)param_2 * 8) + 0x20);
  }
  if (DAT_140608178 == 0) {
    FUN_140176d60(0);
  }
  DAT_140608178 = DAT_140608178 + 1;
  return (ulonglong)*(byte *)(DAT_140608170 + 0x20);
}



uint FUN_14032b110(longlong param_1,uint param_2)

{
  int iVar1;
  undefined4 *puVar2;
  longlong lVar3;
  undefined4 *puVar4;
  
  lVar3 = (longlong)(int)param_2;
  if (0xe < (int)param_2) {
    return 0;
  }
  puVar4 = &DAT_14060818c;
  if (param_2 < 0xf) {
    puVar2 = (undefined4 *)(param_1 + 0xc4 + lVar3 * 4);
  }
  else {
    if (DAT_140608190 == 0) {
      FUN_140176d60(0);
    }
    DAT_140608190 = DAT_140608190 + 1;
    puVar2 = &DAT_14060818c;
  }
  iVar1 = DAT_140608190;
  *puVar2 = 0;
  if (param_2 < 0xf) {
    puVar4 = (undefined4 *)(param_1 + 0x88 + lVar3 * 4);
  }
  else {
    if (iVar1 == 0) {
      FUN_140176d60(0);
      iVar1 = DAT_140608190;
    }
    DAT_140608190 = iVar1 + 1;
  }
  *puVar4 = 0;
  if (param_2 < 0xf) {
    (**(code **)(**(longlong **)(param_1 + 0x178 + lVar3 * 8) + 0x10))();
    return param_2;
  }
  if (DAT_140608178 == 0) {
    FUN_140176d60(0);
  }
  DAT_140608178 = DAT_140608178 + 1;
  (**(code **)(*DAT_140608170 + 0x10))();
  return param_2;
}



undefined8 FUN_14032b210(longlong param_1)

{
  undefined8 *puVar1;
  uint uVar2;
  undefined8 *puVar3;
  
  if (param_1 != -0x178) {
    puVar3 = (undefined8 *)(param_1 + 0x180);
    uVar2 = 1;
    do {
      puVar1 = puVar3;
      if (0xe < uVar2) {
        if (DAT_140608178 == 0) {
          FUN_140176d60(0);
        }
        DAT_140608178 = DAT_140608178 + 1;
        puVar1 = &DAT_140608170;
      }
      (**(code **)(*(longlong *)*puVar1 + 0x10))();
      uVar2 = uVar2 + 1;
      puVar3 = puVar3 + 1;
    } while ((int)uVar2 < 0xf);
    return 1;
  }
  return 0;
}



undefined4 FUN_14032b2a0(longlong param_1,uint param_2)

{
  if (0xd < param_2 - 1) {
    return 0;
  }
  if (param_2 < 0xf) {
    return *(undefined4 *)(*(longlong *)(param_1 + 0x178 + (longlong)(int)param_2 * 8) + 0x2c);
  }
  if (DAT_140608178 == 0) {
    FUN_140176d60(0);
  }
  DAT_140608178 = DAT_140608178 + 1;
  return *(undefined4 *)(DAT_140608170 + 0x2c);
}



// WARNING: Removing unreachable block (ram,0x00014032b3c8)
// WARNING: Removing unreachable block (ram,0x00014032b3d1)
// WARNING: Removing unreachable block (ram,0x00014032b3f2)
// WARNING: Removing unreachable block (ram,0x00014032b3fb)

longlong FUN_14032b310(longlong param_1)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1,uVar1,1);
  *(undefined4 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x60) = 7;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined4 *)(param_1 + 0xa0) = 0x11;
  *(undefined4 *)(param_1 + 0xc0) = 0;
  *(undefined4 *)(param_1 + 0xc4) = 10;
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  *(undefined4 *)(param_1 + 0xa4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0xa8) = 0x3e800000;
  *(undefined4 *)(param_1 + 0xac) = 0x40100000;
  *(undefined8 *)(param_1 + 0xb0) = 0x26;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined4 *)(param_1 + 0xe8) = 0x11;
  *(undefined4 *)(param_1 + 0x108) = 0;
  *(undefined4 *)(param_1 + 0x10c) = 10;
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined8 *)(param_1 + 0x118) = 0;
  *(undefined4 *)(param_1 + 0xec) = 0x3f400000;
  *(undefined4 *)(param_1 + 0xf0) = 0x3e800000;
  *(undefined4 *)(param_1 + 0xf4) = 0x40100000;
  *(undefined8 *)(param_1 + 0xf8) = 0x26;
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x120) = 0;
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined4 *)(param_1 + 0x130) = 0x11;
  *(undefined4 *)(param_1 + 0x150) = 0;
  *(undefined4 *)(param_1 + 0x154) = 10;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined8 *)(param_1 + 0x160) = 0;
  *(undefined4 *)(param_1 + 0x134) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x138) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x13c) = 0x40100000;
  *(undefined8 *)(param_1 + 0x140) = 0x26;
  *(undefined8 *)(param_1 + 0x148) = 0;
  *(undefined8 *)(param_1 + 0x168) = 0;
  *(undefined8 *)(param_1 + 0x170) = 0;
  *(undefined4 *)(param_1 + 0x178) = 0x11;
  *(undefined4 *)(param_1 + 0x198) = 0;
  *(undefined4 *)(param_1 + 0x19c) = 10;
  *(undefined8 *)(param_1 + 0x1a0) = 0;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  *(undefined4 *)(param_1 + 0x17c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x180) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x184) = 0x40100000;
  *(undefined8 *)(param_1 + 0x188) = 0x26;
  *(undefined8 *)(param_1 + 400) = 0;
  *(undefined8 *)(param_1 + 0x1b0) = 0;
  *(undefined8 *)(param_1 + 0x1b8) = 0;
  *(undefined4 *)(param_1 + 0x1c0) = 0x11;
  *(undefined4 *)(param_1 + 0x1e0) = 0;
  *(undefined4 *)(param_1 + 0x1e4) = 10;
  *(undefined8 *)(param_1 + 0x1e8) = 0;
  *(undefined8 *)(param_1 + 0x1f0) = 0;
  *(undefined4 *)(param_1 + 0x1c4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x1c8) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x1cc) = 0x40100000;
  *(undefined8 *)(param_1 + 0x1d0) = 0x26;
  *(undefined8 *)(param_1 + 0x1d8) = 0;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined8 *)(param_1 + 0x200) = 0;
  *(undefined4 *)(param_1 + 0x208) = 0x11;
  *(undefined4 *)(param_1 + 0x228) = 0;
  *(undefined4 *)(param_1 + 0x22c) = 10;
  *(undefined8 *)(param_1 + 0x230) = 0;
  *(undefined8 *)(param_1 + 0x238) = 0;
  *(undefined4 *)(param_1 + 0x20c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x210) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x214) = 0x40100000;
  *(undefined8 *)(param_1 + 0x218) = 0x26;
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined8 *)(param_1 + 0x240) = 0;
  *(undefined8 *)(param_1 + 0x248) = 0;
  *(undefined4 *)(param_1 + 0x250) = 0x11;
  *(undefined4 *)(param_1 + 0x270) = 0;
  *(undefined4 *)(param_1 + 0x274) = 10;
  *(undefined8 *)(param_1 + 0x278) = 0;
  *(undefined8 *)(param_1 + 0x280) = 0;
  *(undefined4 *)(param_1 + 0x254) = 0x3f400000;
  *(undefined4 *)(param_1 + 600) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x25c) = 0x40100000;
  *(undefined8 *)(param_1 + 0x260) = 0x26;
  *(undefined8 *)(param_1 + 0x268) = 0;
  *(undefined8 *)(param_1 + 0x288) = 0;
  *(undefined8 *)(param_1 + 0x290) = 0;
  *(undefined4 *)(param_1 + 0x298) = 0x11;
  *(undefined4 *)(param_1 + 0x2b8) = 0;
  *(undefined4 *)(param_1 + 700) = 10;
  *(undefined8 *)(param_1 + 0x2c0) = 0;
  *(undefined8 *)(param_1 + 0x2c8) = 0;
  *(undefined4 *)(param_1 + 0x29c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x2a0) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x2a4) = 0x40100000;
  *(undefined8 *)(param_1 + 0x2a8) = 0x26;
  *(undefined8 *)(param_1 + 0x2b0) = 0;
  *(undefined8 *)(param_1 + 0x2d0) = 0;
  *(undefined8 *)(param_1 + 0x2d8) = 0;
  *(undefined4 *)(param_1 + 0x2e0) = 0x11;
  *(undefined4 *)(param_1 + 0x300) = 0;
  *(undefined4 *)(param_1 + 0x304) = 10;
  *(undefined8 *)(param_1 + 0x308) = 0;
  *(undefined8 *)(param_1 + 0x310) = 0;
  *(undefined4 *)(param_1 + 0x2e4) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x2e8) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x2ec) = 0x40100000;
  *(undefined8 *)(param_1 + 0x2f0) = 0x26;
  *(undefined8 *)(param_1 + 0x2f8) = 0;
  *(undefined8 *)(param_1 + 0x318) = 0;
  *(undefined8 *)(param_1 + 800) = 0;
  *(undefined4 *)(param_1 + 0x328) = 0x11;
  *(undefined4 *)(param_1 + 0x348) = 0;
  *(undefined4 *)(param_1 + 0x34c) = 10;
  *(undefined8 *)(param_1 + 0x350) = 0;
  *(undefined8 *)(param_1 + 0x358) = 0;
  *(undefined4 *)(param_1 + 0x32c) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x330) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x334) = 0x40100000;
  *(undefined8 *)(param_1 + 0x338) = 0x26;
  *(undefined8 *)(param_1 + 0x340) = 0;
  *(undefined8 *)(param_1 + 0x360) = 0;
  *(undefined8 *)(param_1 + 0x368) = 0;
  *(undefined4 *)(param_1 + 0x370) = 0x11;
  *(undefined4 *)(param_1 + 0x390) = 0;
  *(undefined4 *)(param_1 + 0x394) = 10;
  *(undefined8 *)(param_1 + 0x398) = 0;
  *(undefined8 *)(param_1 + 0x3a0) = 0;
  *(undefined4 *)(param_1 + 0x374) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x378) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x37c) = 0x40100000;
  *(undefined8 *)(param_1 + 0x380) = 0x26;
  *(undefined8 *)(param_1 + 0x388) = 0;
  *(undefined8 *)(param_1 + 0x3a8) = 0;
  *(undefined8 *)(param_1 + 0x3b0) = 0;
  *(undefined4 *)(param_1 + 0x3b8) = 0x11;
  *(undefined4 *)(param_1 + 0x3d8) = 0;
  *(undefined4 *)(param_1 + 0x3dc) = 10;
  *(undefined8 *)(param_1 + 0x3e0) = 0;
  *(undefined8 *)(param_1 + 1000) = 0;
  *(undefined4 *)(param_1 + 0x3bc) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x3c0) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x3c4) = 0x40100000;
  *(undefined8 *)(param_1 + 0x3c8) = 0x26;
  *(undefined8 *)(param_1 + 0x3d0) = 0;
  return param_1;
}



void FUN_14032b8b0(longlong param_1)

{
  FUN_140148110(param_1 + 0x3a8);
  FUN_140148110(param_1 + 0x360);
  FUN_140148110(param_1 + 0x318);
  FUN_140148110(param_1 + 0x2d0);
  FUN_140148110(param_1 + 0x288);
  FUN_140148110(param_1 + 0x240);
  FUN_140148110(param_1 + 0x1f8);
  FUN_140148110(param_1 + 0x1b0);
  FUN_140148110(param_1 + 0x168);
  FUN_140148110(param_1 + 0x120);
  FUN_140148110(param_1 + 0xd8);
  FUN_14032ce50(param_1 + 0x90);
  if (*(void **)(param_1 + 0x70) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x70));
  }
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x60)) {
    operator_delete(*(void **)(param_1 + 0x48));
  }
  *(undefined8 *)(param_1 + 0x60) = 7;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  FUN_14034edf0(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14032b9a0(longlong param_1,short *param_2)

{
  short sVar1;
  wchar_t wVar2;
  int iVar3;
  int *piVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  char cVar8;
  uint uVar9;
  undefined4 uVar10;
  undefined4 uVar11;
  undefined4 *puVar13;
  int *piVar14;
  short *psVar15;
  undefined8 **ppuVar16;
  short *psVar17;
  wchar_t *pwVar18;
  wchar_t *pwVar19;
  uint *puVar20;
  longlong lVar21;
  ulonglong uVar22;
  longlong *plVar23;
  ulonglong uVar24;
  undefined2 *puVar25;
  undefined4 *puVar26;
  wchar_t *pwVar27;
  ulonglong uVar28;
  undefined1 auStack_218 [32];
  undefined1 local_1f8;
  int local_1e8 [2];
  undefined4 *local_1e0;
  wchar_t *local_1d8;
  longlong local_1d0;
  undefined8 *local_1c8;
  undefined8 *local_1c0;
  undefined8 local_1b8;
  short *local_1a8;
  longlong local_1a0;
  undefined1 local_198;
  undefined8 local_190;
  undefined2 local_188;
  undefined6 uStack_186;
  undefined8 local_178;
  ulonglong local_170;
  undefined2 local_160;
  undefined6 uStack_15e;
  undefined8 local_150;
  ulonglong local_148;
  undefined2 local_138;
  undefined6 uStack_136;
  undefined8 local_128;
  ulonglong local_120;
  undefined2 local_110;
  undefined6 uStack_10e;
  undefined8 local_100;
  ulonglong local_f8;
  undefined2 local_e8;
  undefined6 uStack_e6;
  undefined8 local_d8;
  ulonglong local_d0;
  undefined2 local_c0;
  undefined6 uStack_be;
  undefined8 local_b0;
  ulonglong local_a8;
  undefined2 local_98;
  undefined6 uStack_96;
  undefined8 local_88;
  ulonglong local_80;
  undefined2 local_70;
  undefined6 uStack_6e;
  undefined8 local_60;
  ulonglong local_58;
  ulonglong local_48;
  undefined4 *puVar12;
  
  local_190 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_218;
  local_1a0 = param_1;
  FUN_14034ed40();
  local_198 = 1;
  uVar22 = 0xffffffffffffffff;
  psVar17 = param_2;
  do {
    if (uVar22 == 0) break;
    uVar22 = uVar22 - 1;
    sVar1 = *psVar17;
    psVar17 = psVar17 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x48,param_2,~uVar22 - 1);
  local_1d0 = FUN_1402933b0(DAT_140607ff0,param_2);
  if (local_1d0 != 0) {
    puVar26 = (undefined4 *)0x0;
    puVar13 = puVar26;
    if ((*(longlong *)(local_1d0 + 0x70) != 0) && (*(uint *)(local_1d0 + 0x78) != 0)) {
      puVar12 = puVar26;
      plVar23 = *(longlong **)(local_1d0 + 0x68);
      do {
        if (*plVar23 != 0) {
          puVar13 = (undefined4 *)(*(longlong **)(local_1d0 + 0x68))[(longlong)puVar12];
          break;
        }
        uVar9 = (int)puVar12 + 1;
        puVar12 = (undefined4 *)(ulonglong)uVar9;
        plVar23 = plVar23 + 1;
      } while (uVar9 < *(uint *)(local_1d0 + 0x78));
    }
LAB_14032ba6a:
    lVar21 = local_1d0;
    local_1e0 = puVar13;
    if (puVar13 != (undefined4 *)0x0) {
      uVar11 = *puVar13;
      local_1d8 = (wchar_t *)CONCAT44(local_1d8._4_4_,uVar11);
      uVar10 = FUN_1402970c0(local_1d0,L"nWeaponCommandID");
      local_1f8 = 1;
      piVar14 = (int *)FUN_140296600(lVar21,uVar11,uVar10,L"nWeaponCommandID");
      iVar3 = *piVar14;
      local_1e8[0] = iVar3;
      uVar10 = FUN_1402970c0(lVar21,L"szStayMotion");
      local_1f8 = 1;
      psVar15 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szStayMotion");
      local_58 = 7;
      local_60 = 0;
      local_70 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar17 = psVar15;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_70,psVar15,~uVar22 - 1);
      uVar10 = FUN_1402970c0(lVar21,L"szWalkMotion");
      local_1f8 = 1;
      psVar15 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szWalkMotion");
      local_a8 = 7;
      local_b0 = 0;
      local_c0 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar17 = psVar15;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_c0,psVar15,~uVar22 - 1);
      uVar10 = FUN_1402970c0(lVar21,L"szRunMotion");
      local_1f8 = 1;
      psVar15 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szRunMotion");
      local_170 = 7;
      local_178 = 0;
      local_188 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar17 = psVar15;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_188,psVar15,~uVar22 - 1);
      uVar10 = FUN_1402970c0(lVar21,L"szJump01");
      local_1f8 = 1;
      psVar15 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szJump01");
      local_f8 = 7;
      local_100 = 0;
      local_110 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar17 = psVar15;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_110,psVar15,~uVar22 - 1);
      uVar10 = FUN_1402970c0(lVar21,L"szJump02");
      local_1f8 = 1;
      psVar15 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szJump02");
      local_120 = 7;
      local_128 = 0;
      local_138 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar17 = psVar15;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_138,psVar15,~uVar22 - 1);
      uVar10 = FUN_1402970c0(lVar21,L"szJump03");
      local_1f8 = 1;
      psVar15 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szJump03");
      local_d0 = 7;
      local_d8 = 0;
      local_e8 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar17 = psVar15;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_e8,psVar15,~uVar22 - 1);
      uVar10 = FUN_1402970c0(lVar21,L"szJump04");
      local_1f8 = 1;
      psVar15 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szJump04");
      local_148 = 7;
      local_150 = 0;
      local_160 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar17 = psVar15;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_160,psVar15,~uVar22 - 1);
      uVar10 = FUN_1402970c0(lVar21,L"szSkyDown");
      local_1f8 = 1;
      psVar15 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szSkyDown");
      local_80 = 7;
      local_88 = 0;
      local_98 = 0;
      uVar22 = 0xffffffffffffffff;
      psVar17 = psVar15;
      do {
        if (uVar22 == 0) break;
        uVar22 = uVar22 - 1;
        sVar1 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_98,psVar15,~uVar22 - 1);
      uVar10 = FUN_1402970c0(lVar21,L"szLobbyRunMotion");
      local_1f8 = 0;
      local_1a8 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szLobbyRunMotion");
      piVar14 = *(int **)(param_1 + 0x78);
      if ((local_1e8 < piVar14) && (piVar4 = *(int **)(param_1 + 0x70), piVar4 <= local_1e8)) {
        if (piVar14 == *(int **)(param_1 + 0x80)) {
          FUN_1400556a0(param_1 + 0x70,1);
        }
        if (*(undefined4 **)(param_1 + 0x78) != (undefined4 *)0x0) {
          **(undefined4 **)(param_1 + 0x78) =
               *(undefined4 *)
                (*(longlong *)(param_1 + 0x70) + ((longlong)local_1e8 - (longlong)piVar4 >> 2) * 4);
        }
      }
      else {
        if (piVar14 == *(int **)(param_1 + 0x80)) {
          FUN_1400556a0(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;
      local_1c8 = (undefined8 *)0x0;
      local_1c0 = (undefined8 *)0x0;
      local_1b8 = 0;
      puVar25 = &local_70;
      if (7 < local_58) {
        puVar25 = (undefined2 *)CONCAT62(uStack_6e,local_70);
      }
      FUN_140415b90(&local_1c8,puVar25,&DAT_14049c7b8);
      uVar9 = iVar3 - 1;
      uVar22 = (ulonglong)uVar9;
      ppuVar16 = (undefined8 **)FUN_140148a60(param_1 + 0x90);
      if (ppuVar16 != &local_1c8) {
        FUN_14015b160(ppuVar16);
      }
      uVar24 = (ulonglong)uVar9 % (ulonglong)*(uint *)(param_1 + 0xe8);
      if (*(longlong *)(param_1 + 0xd8) == 0) {
        cVar8 = FUN_1402c6d50(param_1 + 0xd8,(ulonglong)*(uint *)(param_1 + 0xe8),1);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar20 = *(uint **)(*(longlong *)(param_1 + 0xd8) + uVar24 * 8);
            puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0xc)) {
          if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032bf0c;
        }
      }
      puVar20 = (uint *)FUN_140151880(param_1 + 0xd8,uVar22,uVar24,uVar22);
LAB_14032bf0c:
      FUN_1400015e0(puVar20 + 2,&local_c0,0,0xffffffffffffffff);
      uVar24 = uVar22 % (ulonglong)*(uint *)(param_1 + 0x130);
      if (*(longlong *)(param_1 + 0x120) == 0) {
        cVar8 = FUN_1402c6d50(param_1 + 0x120,(ulonglong)*(uint *)(param_1 + 0x130),1);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar20 = *(uint **)(*(longlong *)(param_1 + 0x120) + uVar24 * 8);
            puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0xc)) {
          if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032bf87;
        }
      }
      puVar20 = (uint *)FUN_140151880(param_1 + 0x120,uVar9,uVar24,uVar9);
LAB_14032bf87:
      FUN_1400015e0(puVar20 + 2,&local_188,0,0xffffffffffffffff);
      uVar24 = (ulonglong)uVar9 % (ulonglong)*(uint *)(param_1 + 0x1c0);
      if (*(longlong *)(param_1 + 0x1b0) == 0) {
        cVar8 = FUN_1402c6d50(param_1 + 0x1b0,(ulonglong)*(uint *)(param_1 + 0x1c0),1);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar20 = *(uint **)(*(longlong *)(param_1 + 0x1b0) + uVar24 * 8);
            puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0xc)) {
          if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c002;
        }
      }
      puVar20 = (uint *)FUN_140151880(param_1 + 0x1b0,uVar22,uVar24,uVar22);
LAB_14032c002:
      FUN_1400015e0(puVar20 + 2,&local_110,0,0xffffffffffffffff);
      uVar24 = uVar22 % (ulonglong)*(uint *)(param_1 + 0x208);
      if (*(longlong *)(param_1 + 0x1f8) == 0) {
        cVar8 = FUN_1402c6d50(param_1 + 0x1f8,(ulonglong)*(uint *)(param_1 + 0x208),1);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar20 = *(uint **)(*(longlong *)(param_1 + 0x1f8) + uVar24 * 8);
            puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0xc)) {
          if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c07d;
        }
      }
      puVar20 = (uint *)FUN_140151880(param_1 + 0x1f8,uVar9,uVar24,uVar9);
LAB_14032c07d:
      FUN_1400015e0(puVar20 + 2,&local_138,0,0xffffffffffffffff);
      uVar24 = (ulonglong)uVar9 % (ulonglong)*(uint *)(param_1 + 0x250);
      if (*(longlong *)(param_1 + 0x240) == 0) {
        cVar8 = FUN_1402c6d50(param_1 + 0x240,(ulonglong)*(uint *)(param_1 + 0x250),1);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar20 = *(uint **)(*(longlong *)(param_1 + 0x240) + uVar24 * 8);
            puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0xc)) {
          if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c0f8;
        }
      }
      puVar20 = (uint *)FUN_140151880(param_1 + 0x240,uVar22,uVar24,uVar22);
LAB_14032c0f8:
      FUN_1400015e0(puVar20 + 2,&local_e8,0,0xffffffffffffffff);
      uVar24 = (ulonglong)uVar9 % (ulonglong)*(uint *)(param_1 + 0x298);
      if (*(longlong *)(param_1 + 0x288) == 0) {
        cVar8 = FUN_1402c6d50(param_1 + 0x288,(ulonglong)*(uint *)(param_1 + 0x298),1);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar20 = *(uint **)(*(longlong *)(param_1 + 0x288) + uVar24 * 8);
            puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0xc)) {
          if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c173;
        }
      }
      puVar20 = (uint *)FUN_140151880(param_1 + 0x288,uVar9,uVar24,uVar9);
LAB_14032c173:
      FUN_1400015e0(puVar20 + 2,&local_160,0,0xffffffffffffffff);
      uVar24 = (ulonglong)uVar9 % (ulonglong)*(uint *)(param_1 + 0x2e0);
      if (*(longlong *)(param_1 + 0x2d0) == 0) {
        cVar8 = FUN_1402c6d50(param_1 + 0x2d0,(ulonglong)*(uint *)(param_1 + 0x2e0),1);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x8007000e);
        }
      }
      else {
        for (puVar20 = *(uint **)(*(longlong *)(param_1 + 0x2d0) + uVar24 * 8);
            puVar20 != (uint *)0x0; puVar20 = *(uint **)(puVar20 + 0xc)) {
          if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c1ee;
        }
      }
      puVar20 = (uint *)FUN_140151880(param_1 + 0x2d0,uVar22,uVar24,uVar22);
LAB_14032c1ee:
      FUN_1400015e0(puVar20 + 2,&local_98,0,0xffffffffffffffff);
      uVar10 = FUN_1402970c0(lVar21,L"szGuardStay");
      local_1f8 = 0;
      psVar17 = (short *)FUN_140296990(lVar21,uVar11,uVar10,L"szGuardStay");
      uVar10 = FUN_1402970c0(lVar21,L"szGuard");
      local_1f8 = 0;
      pwVar18 = (wchar_t *)FUN_140296990(lVar21,uVar11,uVar10,L"szGuard");
      uVar11 = FUN_1402970c0(lVar21,L"szGuardBreak");
      local_1f8 = 0;
      pwVar19 = (wchar_t *)
                FUN_140296990(lVar21,(ulonglong)local_1d8 & 0xffffffff,uVar11,L"szGuardBreak");
      uVar28 = (ulonglong)*(uint *)(param_1 + 0x328);
      lVar21 = *(longlong *)(param_1 + 0x318);
      uVar24 = uVar22 % uVar28;
      local_1d8 = pwVar19;
      if (psVar17 == (short *)0x0) {
        if (lVar21 == 0) {
LAB_14032c358:
          cVar8 = FUN_1402c6d50(param_1 + 0x318,uVar28,1);
          if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x8007000e);
          }
        }
        else {
          for (puVar20 = *(uint **)(lVar21 + uVar24 * 8); puVar20 != (uint *)0x0;
              puVar20 = *(uint **)(puVar20 + 0xc)) {
            if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c388;
          }
          if (lVar21 == 0) goto LAB_14032c358;
        }
        puVar20 = (uint *)FUN_140151880(param_1 + 0x318,uVar9,uVar24,uVar9);
LAB_14032c388:
        FUN_140001710(puVar20 + 2,L"guard01_stay01",0xe);
      }
      else {
        if (lVar21 == 0) {
LAB_14032c2d7:
          cVar8 = FUN_1402c6d50(param_1 + 0x318,uVar28,1);
          if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x8007000e);
          }
        }
        else {
          for (puVar20 = *(uint **)(lVar21 + uVar24 * 8); puVar20 != (uint *)0x0;
              puVar20 = *(uint **)(puVar20 + 0xc)) {
            if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c307;
          }
          if (lVar21 == 0) goto LAB_14032c2d7;
        }
        puVar20 = (uint *)FUN_140151880(param_1 + 0x318,uVar22,uVar24,uVar9);
LAB_14032c307:
        uVar24 = 0xffffffffffffffff;
        psVar15 = psVar17;
        do {
          if (uVar24 == 0) break;
          uVar24 = uVar24 - 1;
          sVar1 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar1 != 0);
        FUN_140001710(puVar20 + 2,psVar17,~uVar24 - 1);
        pwVar19 = local_1d8;
      }
      uVar28 = (ulonglong)*(uint *)(param_1 + 0x370);
      lVar21 = *(longlong *)(param_1 + 0x360);
      uVar24 = uVar22 % uVar28;
      if (pwVar18 == (wchar_t *)0x0) {
        if (lVar21 == 0) {
LAB_14032c45b:
          cVar8 = FUN_1402c6d50(param_1 + 0x360,uVar28,1);
          if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x8007000e);
          }
        }
        else {
          for (puVar20 = *(uint **)(lVar21 + uVar24 * 8); puVar20 != (uint *)0x0;
              puVar20 = *(uint **)(puVar20 + 0xc)) {
            if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c48b;
          }
          if (lVar21 == 0) goto LAB_14032c45b;
        }
        puVar20 = (uint *)FUN_140151880(param_1 + 0x360,uVar22,uVar24,uVar22);
LAB_14032c48b:
        lVar21 = 7;
        pwVar18 = L"guard01";
      }
      else {
        if (lVar21 == 0) {
LAB_14032c3e7:
          cVar8 = FUN_1402c6d50(param_1 + 0x360,uVar28,1);
          if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x8007000e);
          }
        }
        else {
          for (puVar20 = *(uint **)(lVar21 + uVar24 * 8); puVar20 != (uint *)0x0;
              puVar20 = *(uint **)(puVar20 + 0xc)) {
            if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c417;
          }
          if (lVar21 == 0) goto LAB_14032c3e7;
        }
        puVar20 = (uint *)FUN_140151880(param_1 + 0x360,uVar22,uVar24,uVar22);
LAB_14032c417:
        uVar24 = 0xffffffffffffffff;
        pwVar27 = pwVar18;
        do {
          if (uVar24 == 0) break;
          uVar24 = uVar24 - 1;
          wVar2 = *pwVar27;
          pwVar27 = pwVar27 + 1;
        } while (wVar2 != L'\0');
        lVar21 = ~uVar24 - 1;
      }
      FUN_140001710(puVar20 + 2,pwVar18,lVar21);
      uVar28 = (ulonglong)*(uint *)(param_1 + 0x3b8);
      lVar21 = *(longlong *)(param_1 + 0x3a8);
      uVar24 = (ulonglong)uVar9 % uVar28;
      if (pwVar19 == (wchar_t *)0x0) {
        if (lVar21 == 0) {
LAB_14032c55b:
          cVar8 = FUN_1402c6d50(param_1 + 0x3a8,uVar28,1);
          if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x8007000e);
          }
        }
        else {
          for (puVar20 = *(uint **)(lVar21 + uVar24 * 8); puVar20 != (uint *)0x0;
              puVar20 = *(uint **)(puVar20 + 0xc)) {
            if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c58b;
          }
          if (lVar21 == 0) goto LAB_14032c55b;
        }
        puVar20 = (uint *)FUN_140151880(param_1 + 0x3a8,uVar22,uVar24,uVar22);
LAB_14032c58b:
        lVar21 = 0xf;
        pwVar19 = L"guard01_break01";
      }
      else {
        if (lVar21 == 0) {
LAB_14032c4e7:
          cVar8 = FUN_1402c6d50(param_1 + 0x3a8,uVar28,1);
          if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x8007000e);
          }
        }
        else {
          for (puVar20 = *(uint **)(lVar21 + uVar24 * 8); puVar20 != (uint *)0x0;
              puVar20 = *(uint **)(puVar20 + 0xc)) {
            if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c517;
          }
          if (lVar21 == 0) goto LAB_14032c4e7;
        }
        puVar20 = (uint *)FUN_140151880(param_1 + 0x3a8,uVar22,uVar24,uVar22);
LAB_14032c517:
        uVar24 = 0xffffffffffffffff;
        pwVar18 = pwVar19;
        do {
          if (uVar24 == 0) break;
          uVar24 = uVar24 - 1;
          wVar2 = *pwVar18;
          pwVar18 = pwVar18 + 1;
        } while (wVar2 != L'\0');
        lVar21 = ~uVar24 - 1;
      }
      FUN_140001710(puVar20 + 2,pwVar19,lVar21);
      psVar17 = local_1a8;
      uVar28 = (ulonglong)*(uint *)(param_1 + 0x178);
      lVar21 = *(longlong *)(param_1 + 0x168);
      uVar24 = uVar22 % uVar28;
      if (local_1a8 == (short *)0x0) {
        if (lVar21 == 0) {
LAB_14032c667:
          cVar8 = FUN_1402c6d50(param_1 + 0x168,uVar28,1);
          if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x8007000e);
          }
        }
        else {
          for (puVar20 = *(uint **)(lVar21 + uVar24 * 8); puVar20 != (uint *)0x0;
              puVar20 = *(uint **)(puVar20 + 0xc)) {
            if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c697;
          }
          if (lVar21 == 0) goto LAB_14032c667;
        }
        puVar20 = (uint *)FUN_140151880(param_1 + 0x168,uVar22,uVar24,uVar22);
LAB_14032c697:
        FUN_1400015e0(puVar20 + 2,&local_188,0,0xffffffffffffffff);
      }
      else {
        if (lVar21 == 0) {
LAB_14032c5ea:
          cVar8 = FUN_1402c6d50(param_1 + 0x168,uVar28,1);
          if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x8007000e);
          }
        }
        else {
          for (puVar20 = *(uint **)(lVar21 + uVar24 * 8); puVar20 != (uint *)0x0;
              puVar20 = *(uint **)(puVar20 + 0xc)) {
            if ((puVar20[0xe] == uVar9) && (*puVar20 == uVar9)) goto LAB_14032c61a;
          }
          if (lVar21 == 0) goto LAB_14032c5ea;
        }
        puVar20 = (uint *)FUN_140151880(param_1 + 0x168,uVar9,uVar24,uVar9);
LAB_14032c61a:
        uVar22 = 0xffffffffffffffff;
        psVar15 = psVar17;
        do {
          if (uVar22 == 0) break;
          uVar22 = uVar22 - 1;
          sVar1 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar1 != 0);
        FUN_140001710(puVar20 + 2,psVar17,~uVar22 - 1);
      }
      puVar7 = local_1c0;
      puVar6 = local_1c8;
      puVar5 = local_1c8;
      if (local_1c8 != (undefined8 *)0x0) {
        for (; puVar5 != puVar7; puVar5 = puVar5 + 5) {
          if (7 < (ulonglong)puVar5[3]) {
            operator_delete((void *)*puVar5);
          }
          puVar5[3] = 7;
          puVar5[2] = 0;
          *(undefined2 *)puVar5 = 0;
        }
        operator_delete(puVar6);
      }
      if (7 < local_80) {
        operator_delete((void *)CONCAT62(uStack_96,local_98));
      }
      local_80 = 7;
      local_88 = 0;
      local_98 = 0;
      if (7 < local_148) {
        operator_delete((void *)CONCAT62(uStack_15e,local_160));
      }
      local_148 = 7;
      local_150 = 0;
      local_160 = 0;
      if (7 < local_d0) {
        operator_delete((void *)CONCAT62(uStack_e6,local_e8));
      }
      local_d0 = 7;
      local_d8 = 0;
      local_e8 = 0;
      if (7 < local_120) {
        operator_delete((void *)CONCAT62(uStack_136,local_138));
      }
      local_120 = 7;
      local_128 = 0;
      local_138 = 0;
      if (7 < local_f8) {
        operator_delete((void *)CONCAT62(uStack_10e,local_110));
      }
      local_f8 = 7;
      local_100 = 0;
      local_110 = 0;
      if (7 < local_170) {
        operator_delete((void *)CONCAT62(uStack_186,local_188));
      }
      local_170 = 7;
      local_178 = 0;
      local_188 = 0;
      if (7 < local_a8) {
        operator_delete((void *)CONCAT62(uStack_be,local_c0));
      }
      local_a8 = 7;
      local_b0 = 0;
      local_c0 = 0;
      if (7 < local_58) {
        operator_delete((void *)CONCAT62(uStack_6e,local_70));
      }
      puVar13 = *(undefined4 **)(local_1e0 + 6);
      if (puVar13 == (undefined4 *)0x0) {
        uVar9 = (uint)local_1e0[8] % *(uint *)(local_1d0 + 0x78) + 1;
        lVar21 = (longlong)(int)uVar9 << 3;
        puVar13 = puVar26;
        do {
          if (*(uint *)(local_1d0 + 0x78) <= uVar9) break;
          if (*(longlong *)(lVar21 + *(longlong *)(local_1d0 + 0x68)) != 0) {
            puVar13 = *(undefined4 **)(lVar21 + *(longlong *)(local_1d0 + 0x68));
          }
          uVar9 = uVar9 + 1;
          lVar21 = lVar21 + 8;
        } while (puVar13 == (undefined4 *)0x0);
      }
      goto LAB_14032ba6a;
    }
  }
  FUN_14034edd0(param_1);
  return 1;
}



undefined8 * FUN_14032c930(longlong param_1,undefined8 *param_2,int param_3)

{
  uint *puVar1;
  uint uVar2;
  undefined8 local_40;
  undefined8 local_38;
  undefined8 local_30;
  
  uVar2 = param_3 - 1;
  FUN_14034ed40();
  local_40 = 0;
  local_38 = 0;
  local_30 = 0;
  if (*(longlong *)(param_1 + 0x90) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x90) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0xa0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 10)) {
      if ((puVar1[0xc] == uVar2) && (*puVar1 == uVar2)) {
        if (puVar1 != (uint *)0x0) {
          if (puVar1 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          FUN_14015a040(param_2,puVar1 + 2);
          goto LAB_14032ca0b;
        }
        break;
      }
    }
  }
  *param_2 = 0;
  param_2[1] = 0;
  param_2[2] = 0;
  if (param_2 != &local_40) {
    *param_2 = 0;
    param_2[1] = 0;
    param_2[2] = 0;
  }
LAB_14032ca0b:
  FUN_14034edd0(param_1);
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x00014032cab1)

uint * FUN_14032ca30(longlong param_1,int param_2)

{
  uint *puVar1;
  uint uVar2;
  uint *puVar3;
  
  uVar2 = param_2 - 1;
  FUN_14034ed40();
  if (*(longlong *)(param_1 + 0x120) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x120) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x130)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xc)) {
      if ((puVar1[0xe] == uVar2) && (*puVar1 == uVar2)) {
        if (puVar1 != (uint *)0x0) {
          puVar3 = puVar1 + 2;
          if (7 < *(ulonglong *)(puVar1 + 8)) {
            puVar3 = *(uint **)puVar3;
          }
          FUN_14034edd0(param_1);
          return puVar3;
        }
        break;
      }
    }
  }
  FUN_14034edd0(param_1);
  return (uint *)&DAT_140477960;
}



// WARNING: Removing unreachable block (ram,0x00014032cb61)

uint * FUN_14032cae0(longlong param_1,int param_2)

{
  uint *puVar1;
  uint uVar2;
  uint *puVar3;
  
  uVar2 = param_2 - 1;
  FUN_14034ed40();
  if (*(longlong *)(param_1 + 0x1b0) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x1b0) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x1c0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xc)) {
      if ((puVar1[0xe] == uVar2) && (*puVar1 == uVar2)) {
        if (puVar1 != (uint *)0x0) {
          puVar3 = puVar1 + 2;
          if (7 < *(ulonglong *)(puVar1 + 8)) {
            puVar3 = *(uint **)puVar3;
          }
          FUN_14034edd0(param_1);
          return puVar3;
        }
        break;
      }
    }
  }
  FUN_14034edd0(param_1);
  return (uint *)&DAT_140477960;
}



// WARNING: Removing unreachable block (ram,0x00014032cc11)

uint * FUN_14032cb90(longlong param_1,int param_2)

{
  uint *puVar1;
  uint uVar2;
  uint *puVar3;
  
  uVar2 = param_2 - 1;
  FUN_14034ed40();
  if (*(longlong *)(param_1 + 0x1f8) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x1f8) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x208)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xc)) {
      if ((puVar1[0xe] == uVar2) && (*puVar1 == uVar2)) {
        if (puVar1 != (uint *)0x0) {
          puVar3 = puVar1 + 2;
          if (7 < *(ulonglong *)(puVar1 + 8)) {
            puVar3 = *(uint **)puVar3;
          }
          FUN_14034edd0(param_1);
          return puVar3;
        }
        break;
      }
    }
  }
  FUN_14034edd0(param_1);
  return (uint *)&DAT_140477960;
}



// WARNING: Removing unreachable block (ram,0x00014032ccc1)

uint * FUN_14032cc40(longlong param_1,int param_2)

{
  uint *puVar1;
  uint uVar2;
  uint *puVar3;
  
  uVar2 = param_2 - 1;
  FUN_14034ed40();
  if (*(longlong *)(param_1 + 0x240) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x240) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x250)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xc)) {
      if ((puVar1[0xe] == uVar2) && (*puVar1 == uVar2)) {
        if (puVar1 != (uint *)0x0) {
          puVar3 = puVar1 + 2;
          if (7 < *(ulonglong *)(puVar1 + 8)) {
            puVar3 = *(uint **)puVar3;
          }
          FUN_14034edd0(param_1);
          return puVar3;
        }
        break;
      }
    }
  }
  FUN_14034edd0(param_1);
  return (uint *)&DAT_140477960;
}



// WARNING: Removing unreachable block (ram,0x00014032cd71)

uint * FUN_14032ccf0(longlong param_1,int param_2)

{
  uint *puVar1;
  uint uVar2;
  uint *puVar3;
  
  uVar2 = param_2 - 1;
  FUN_14034ed40();
  if (*(longlong *)(param_1 + 0x288) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x288) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x298)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xc)) {
      if ((puVar1[0xe] == uVar2) && (*puVar1 == uVar2)) {
        if (puVar1 != (uint *)0x0) {
          puVar3 = puVar1 + 2;
          if (7 < *(ulonglong *)(puVar1 + 8)) {
            puVar3 = *(uint **)puVar3;
          }
          FUN_14034edd0(param_1);
          return puVar3;
        }
        break;
      }
    }
  }
  FUN_14034edd0(param_1);
  return (uint *)&DAT_140477960;
}



// WARNING: Removing unreachable block (ram,0x00014032ce21)

uint * FUN_14032cda0(longlong param_1,int param_2)

{
  uint *puVar1;
  uint uVar2;
  uint *puVar3;
  
  uVar2 = param_2 - 1;
  FUN_14034ed40();
  if (*(longlong *)(param_1 + 0x2d0) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x2d0) +
                            ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x2e0)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0xc)) {
      if ((puVar1[0xe] == uVar2) && (*puVar1 == uVar2)) {
        if (puVar1 != (uint *)0x0) {
          puVar3 = puVar1 + 2;
          if (7 < *(ulonglong *)(puVar1 + 8)) {
            puVar3 = *(uint **)puVar3;
          }
          FUN_14034edd0(param_1);
          return puVar3;
        }
        break;
      }
    }
  }
  FUN_14034edd0(param_1);
  return (uint *)&DAT_140477960;
}



void FUN_14032ce50(void)

{
  FUN_14032ce70();
  return;
}



void FUN_14032ce70(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 + 0x28);
        FUN_14032cf40(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_1402cddb0(param_1,0);
    FUN_1402c6d50(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_14032cf40(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(longlong *)(param_2 + 8) != 0) {
    FUN_14008d0a0(*(longlong *)(param_2 + 8),*(undefined8 *)(param_2 + 0x10));
    operator_delete(*(void **)(param_2 + 8));
  }
  *(undefined8 *)(param_2 + 8) = 0;
  *(undefined8 *)(param_2 + 0x10) = 0;
  *(undefined8 *)(param_2 + 0x18) = 0;
  *(undefined8 *)(param_2 + 0x28) = *(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_1402cddb0(param_1);
    FUN_1402da810(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;
}



// WARNING: Removing unreachable block (ram,0x00014032d073)
// WARNING: Removing unreachable block (ram,0x00014032d07c)
// WARNING: Removing unreachable block (ram,0x00014032d09a)
// WARNING: Removing unreachable block (ram,0x00014032d0a3)

undefined4 * FUN_14032d000(undefined4 *param_1)

{
  *param_1 = 0;
  *(undefined8 *)(param_1 + 2) = 0;
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 0xe) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  param_1[0x12] = 0x11;
  param_1[0x1a] = 0;
  param_1[0x1b] = 10;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  *(undefined8 *)(param_1 + 0x1e) = 0;
  param_1[0x13] = 0x3f400000;
  param_1[0x14] = 0x3e800000;
  param_1[0x15] = 0x40100000;
  *(undefined8 *)(param_1 + 0x16) = 0x26;
  *(undefined8 *)(param_1 + 0x18) = 0;
  return param_1;
}



undefined8 FUN_14032d0c0(longlong param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  int iVar3;
  uint uVar4;
  undefined4 uVar5;
  longlong lVar6;
  undefined4 *puVar7;
  longlong lVar8;
  undefined8 uVar9;
  ulonglong uVar10;
  longlong *plVar11;
  int *piVar12;
  int *piVar13;
  short *psVar14;
  undefined4 local_res18 [2];
  undefined4 *local_50;
  longlong *local_48;
  int *local_40;
  undefined1 local_30 [16];
  longlong *local_20;
  
  lVar6 = FUN_1402933b0();
  uVar9 = 0;
  if (lVar6 != 0) {
    uVar10 = 0xffffffffffffffff;
    psVar14 = param_2;
    do {
      if (uVar10 == 0) break;
      uVar10 = uVar10 - 1;
      sVar2 = *psVar14;
      psVar14 = psVar14 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1 + 0x10,param_2,~uVar10 - 1);
    if (*(longlong *)(lVar6 + 0x70) != 0) {
      uVar10 = 0;
      if (*(uint *)(lVar6 + 0x78) != 0) {
        plVar11 = *(longlong **)(lVar6 + 0x68);
        do {
          if (*plVar11 != 0) {
            piVar12 = (int *)(*(longlong **)(lVar6 + 0x68))[uVar10];
            goto LAB_14032d155;
          }
          uVar4 = (int)uVar10 + 1;
          uVar10 = (ulonglong)uVar4;
          plVar11 = plVar11 + 1;
        } while (uVar4 < *(uint *)(lVar6 + 0x78));
      }
    }
    piVar12 = (int *)0x0;
LAB_14032d155:
    if (piVar12 != (int *)0x0) {
      iVar3 = *piVar12;
      piVar13 = piVar12;
      if (iVar3 != 0) {
        local_40 = piVar12;
        uVar5 = FUN_1402970c0(lVar6,&DAT_14049f290);
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,&DAT_14049f290,1);
        local_res18[0] = *puVar7;
        puVar7 = operator_new(0x8c);
        local_50 = puVar7;
        FUN_14032d9b0(&local_48,puVar7);
        FUN_140178e90(&local_50,puVar7,puVar7);
        uVar5 = FUN_1402970c0(lVar6,L"fProbability");
        puVar7 = (undefined4 *)FUN_1402967b0(lVar6,iVar3,uVar5,L"fProbability",1);
        *local_50 = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nVitChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nVitChangeMin",1);
        local_50[1] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nVitChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nVitChangeMax",1);
        local_50[2] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nIntChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nIntChangeMin",1);
        local_50[3] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nIntChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nIntChangeMax",1);
        local_50[4] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nStrChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nStrChangeMin",1);
        local_50[5] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nStrChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nStrChangeMax",1);
        local_50[6] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nResChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nResChangeMin",1);
        local_50[7] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nResChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nResChangeMax",1);
        local_50[8] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nEloChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nEloChangeMin",1);
        local_50[9] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nEloChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nEloChangeMax",1);
        local_50[10] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nChaChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nChaChangeMin",1);
        local_50[0xb] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nChaChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nChaChangeMax",1);
        local_50[0xc] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nTemChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nTemChangeMin",1);
        local_50[0xd] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nTemChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nTemChangeMax",1);
        local_50[0xe] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"fHeiChangeMin");
        puVar7 = (undefined4 *)FUN_1402967b0(lVar6,iVar3,uVar5,L"fHeiChangeMin",0);
        if (puVar7 != (undefined4 *)0x0) {
          local_50[0xf] = *puVar7;
        }
        uVar5 = FUN_1402970c0(lVar6,L"fHeiChangeMax");
        puVar7 = (undefined4 *)FUN_1402967b0(lVar6,iVar3,uVar5,L"fHeiChangeMax",0);
        if (puVar7 != (undefined4 *)0x0) {
          local_50[0x10] = *puVar7;
        }
        uVar5 = FUN_1402970c0(lVar6,L"fWeiChangeMin");
        puVar7 = (undefined4 *)FUN_1402967b0(lVar6,iVar3,uVar5,L"fWeiChangeMin",0);
        if (puVar7 != (undefined4 *)0x0) {
          local_50[0x11] = *puVar7;
        }
        uVar5 = FUN_1402970c0(lVar6,L"fWeiChangeMax");
        puVar7 = (undefined4 *)FUN_1402967b0(lVar6,iVar3,uVar5,L"fWeiChangeMax",0);
        if (puVar7 != (undefined4 *)0x0) {
          local_50[0x12] = *puVar7;
        }
        uVar5 = FUN_1402970c0(lVar6,L"nHpChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nHpChangeMin",1);
        local_50[0x13] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nHpChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nHpChangeMax",1);
        local_50[0x14] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nMpChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nMpChangeMin",1);
        local_50[0x15] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nMpChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nMpChangeMax",1);
        local_50[0x16] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nPhysicalAtkChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nPhysicalAtkChangeMin",1);
        local_50[0x17] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nPhysicalAtkChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nPhysicalAtkChangeMax",1);
        local_50[0x18] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nPhysicalDefChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nPhysicalDefChangeMin",1);
        local_50[0x19] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nPhysicalDefChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nPhysicalDefChangeMax",1);
        local_50[0x1a] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nMagicalAtkChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nMagicalAtkChangeMin",1);
        local_50[0x1b] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nMagicalAtkChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nMagicalAtkChangeMax",1);
        local_50[0x1c] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nMagicalDefChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nMagicalDefChangeMin",1);
        local_50[0x1d] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nMagicalDefChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nMagicalDefChangeMax",1);
        local_50[0x1e] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nExpChangeMin");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nExpChangeMin",1);
        local_50[0x1f] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"nExpChangeMax");
        puVar7 = (undefined4 *)FUN_140296600(lVar6,iVar3,uVar5,L"nExpChangeMax",1);
        local_50[0x20] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"fLoyaltyChangeMin");
        puVar7 = (undefined4 *)FUN_1402967b0(lVar6,iVar3,uVar5,L"fLoyaltyChangeMin",1);
        local_50[0x21] = *puVar7;
        uVar5 = FUN_1402970c0(lVar6,L"fLoyaltyChangeMax");
        puVar7 = (undefined4 *)FUN_1402967b0(lVar6,iVar3,uVar5,L"fLoyaltyChangeMax",1);
        local_50[0x22] = *puVar7;
        puVar7 = (undefined4 *)FUN_140342d30(local_30,local_res18,&local_50);
        FUN_14030e3c0(param_1 + 0x38,*puVar7,puVar7 + 2);
        plVar11 = local_20;
        if (local_20 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_20 + 1;
          lVar8 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          piVar12 = local_40;
          if ((int)lVar8 == 1) {
            (**(code **)(*local_20 + 8))(local_20);
            LOCK();
            piVar12 = (int *)((longlong)plVar11 + 0xc);
            iVar3 = *piVar12;
            *piVar12 = *piVar12 + -1;
            UNLOCK();
            piVar12 = local_40;
            if (iVar3 == 1) {
              (**(code **)(*plVar11 + 0x10))(plVar11);
              piVar12 = local_40;
            }
          }
        }
        plVar11 = local_48;
        piVar13 = piVar12;
        if (local_48 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_48 + 1;
          lVar8 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          piVar13 = local_40;
          if ((int)lVar8 == 1) {
            (**(code **)(*local_48 + 8))(local_48);
            LOCK();
            piVar12 = (int *)((longlong)plVar11 + 0xc);
            iVar3 = *piVar12;
            *piVar12 = *piVar12 + -1;
            UNLOCK();
            piVar13 = local_40;
            if (iVar3 == 1) {
              (**(code **)(*plVar11 + 0x10))(plVar11);
              piVar13 = local_40;
            }
          }
        }
      }
      piVar12 = *(int **)(piVar13 + 6);
      if (piVar12 == (int *)0x0) {
        uVar4 = (uint)piVar13[8] % *(uint *)(lVar6 + 0x78) + 1;
        lVar8 = (longlong)(int)uVar4 << 3;
        do {
          if (*(uint *)(lVar6 + 0x78) <= uVar4) break;
          if (*(longlong *)(*(longlong *)(lVar6 + 0x68) + lVar8) != 0) {
            piVar12 = *(int **)(*(longlong *)(lVar6 + 0x68) + lVar8);
          }
          uVar4 = uVar4 + 1;
          lVar8 = lVar8 + 8;
        } while (piVar12 == (int *)0x0);
      }
      goto LAB_14032d155;
    }
    uVar9 = 1;
  }
  return uVar9;
}



undefined8 * FUN_14032d9b0(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;
}



void FUN_14032da20(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014032da24. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_1 + 0x10));
  return;
}



void FUN_14032da30(longlong *param_1,longlong param_2,undefined4 param_3,undefined4 param_4,
                  undefined4 *param_5,float param_6,undefined4 param_7,undefined4 param_8)

{
  longlong lVar1;
  undefined4 uVar2;
  
  lVar1 = *param_1;
  param_1[2] = param_2;
  *(undefined4 *)((longlong)param_1 + 0x5c) = param_7;
  *(undefined4 *)(param_1 + 1) = param_7;
  *(undefined4 *)(param_1 + 3) = param_3;
  *(undefined4 *)((longlong)param_1 + 0x1c) = param_4;
  *(undefined4 *)((longlong)param_1 + 0x24) = *(undefined4 *)(lVar1 + 0x178);
  *(undefined4 *)(param_1 + 5) = *(undefined4 *)(lVar1 + 0x17c);
  *(undefined4 *)((longlong)param_1 + 0x2c) = *(undefined4 *)(lVar1 + 0x180);
  *(float *)(param_1 + 5) = param_6 + *(float *)(param_1 + 5);
  *(undefined4 *)(param_1 + 6) = *param_5;
  *(undefined4 *)((longlong)param_1 + 0x34) = param_5[1];
  *(undefined4 *)(param_1 + 7) = param_5[2];
  uVar2 = FUN_1403144d0(param_3,param_4,*(undefined4 *)(lVar1 + 0xecc),0x453b8000);
  *(undefined4 *)(param_1 + 4) = uVar2;
  *(undefined4 *)(lVar1 + 0xee0) = uVar2;
  *(undefined4 *)(param_1 + 0xc) = param_8;
  return;
}



longlong FUN_14032daf0(longlong *param_1,double param_2)

{
  longlong *plVar1;
  char cVar2;
  int iVar3;
  float *pfVar4;
  uint7 uVar6;
  longlong lVar5;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float local_res8;
  float local_resc;
  float local_68;
  float fStack_64;
  float local_60;
  float local_58;
  float fStack_54;
  float local_50;
  
  fVar8 = (*(float *)((longlong)param_1 + 0x1c) * 3.1415927) / 180.0;
  fVar9 = (float)(param_2 - (double)param_1[2]);
  fVar7 = cosf(fVar8);
  plVar1 = (longlong *)*param_1;
  fVar10 = fVar7 * *(float *)(param_1 + 4) * fVar9;
  local_res8 = fVar10;
  fVar7 = sinf(fVar8);
  pfVar4 = (float *)(param_1 + 3);
  local_resc = fVar7 * *(float *)(param_1 + 4) * fVar9 -
               fVar9 * fVar9 * *(float *)((longlong)plVar1 + 0xecc) * 0.5;
  if (local_resc < *pfVar4 || local_resc == *pfVar4) {
    pfVar4 = &local_resc;
  }
  fVar7 = *(float *)(param_1 + 6);
  fVar8 = *(float *)((longlong)plVar1 + 0x17c);
  local_60 = *(float *)(plVar1 + 0x30);
  local_68 = *(float *)(plVar1 + 0x2f);
  if (1e-06 < fVar7 * fVar7 +
              *(float *)((longlong)param_1 + 0x34) * *(float *)((longlong)param_1 + 0x34) +
              *(float *)(param_1 + 7) * *(float *)(param_1 + 7)) {
    local_58 = fVar7 * fVar10 + *(float *)((longlong)param_1 + 0x24);
    local_60 = fVar10 * *(float *)(param_1 + 7) + *(float *)((longlong)param_1 + 0x2c);
    fStack_54 = fVar10 * *(float *)((longlong)param_1 + 0x34) + *(float *)(param_1 + 5);
    local_50 = local_60;
    local_68 = local_58;
  }
  fVar7 = *pfVar4 + *(float *)(param_1 + 5);
  fStack_64 = fVar7;
  iVar3 = (**(code **)(*plVar1 + 0xb0))(plVar1);
  if ((iVar3 - 1U < 2) && (*(float *)(param_1 + 0xc) + *(float *)(param_1 + 1) < fVar7)) {
    fVar7 = fVar8 - 1.0;
    fStack_64 = fVar7;
  }
  local_res8 = 100000.0;
  if ((*(longlong *)(*param_1 + 0xd88) == 0) ||
     (cVar2 = FUN_1402f9f60(*param_1,&local_res8,&local_68), fVar7 = fStack_64, cVar2 == '\0')) {
    *(float *)(*param_1 + 0x17c) = fVar7;
  }
  lVar5 = *param_1;
  iVar3 = FUN_1402f98b0(lVar5,&local_58,lVar5 + 0x178,&local_68,lVar5 + 0x524,lVar5 + 0x520,0,
                        0x447a0000);
  if ((iVar3 == 1) && (fStack_54 <= *(float *)((longlong)param_1 + 0x5c) + 10.0)) {
    *(float *)(*param_1 + 0x178) = local_58;
    *(float *)(*param_1 + 0x180) = local_50;
    *(float *)((longlong)param_1 + 0x5c) = fStack_54;
  }
  pfVar4 = (float *)(*param_1 + 0x17c);
  uVar6 = (uint7)((ulonglong)*param_1 >> 8);
  if (fVar8 < *pfVar4 || fVar8 == *pfVar4) {
    lVar5 = (ulonglong)uVar6 << 8;
  }
  else {
    lVar5 = CONCAT71(uVar6,1);
  }
  return lVar5;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_14032dd70(ulonglong *param_1,double param_2)

{
  int iVar1;
  float *pfVar2;
  float *pfVar3;
  ulonglong uVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  undefined1 auStack_a8 [32];
  longlong local_88;
  longlong local_80;
  undefined1 local_78;
  undefined4 local_70;
  float local_68;
  float local_64;
  float local_60;
  float fStack_5c;
  float local_58;
  undefined8 local_50;
  float local_48;
  ulonglong local_40;
  
  local_40 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  fVar6 = (*(float *)((longlong)param_1 + 0x1c) * 3.1415927) / 180.0;
  fVar7 = (float)(param_2 - (double)param_1[2]);
  fVar5 = cosf(fVar6);
  uVar4 = *param_1;
  fVar8 = fVar5 * *(float *)(param_1 + 4) * fVar7;
  local_68 = fVar8;
  fVar6 = sinf(fVar6);
  fVar5 = *(float *)(param_1 + 6);
  local_50 = *(undefined8 *)(uVar4 + 0x178);
  local_48 = *(float *)(uVar4 + 0x180);
  local_64 = fVar6 * *(float *)(param_1 + 4) * fVar7 -
             fVar7 * fVar7 * *(float *)(uVar4 + 0xecc) * 0.5;
  if (1e-06 < fVar5 * fVar5 +
              *(float *)((longlong)param_1 + 0x34) * *(float *)((longlong)param_1 + 0x34) +
              *(float *)(param_1 + 7) * *(float *)(param_1 + 7)) {
    local_60 = fVar5 * fVar8 + *(float *)((longlong)param_1 + 0x24);
    local_58 = fVar8 * *(float *)(param_1 + 7) + *(float *)((longlong)param_1 + 0x2c);
    fStack_5c = fVar8 * *(float *)((longlong)param_1 + 0x34) + *(float *)(param_1 + 5);
    local_50 = CONCAT44(fStack_5c,local_60);
    local_48 = local_58;
  }
  pfVar2 = (float *)(param_1 + 3);
  if (local_64 < *(float *)(param_1 + 3) || local_64 == *(float *)(param_1 + 3)) {
    pfVar2 = &local_64;
  }
  pfVar3 = &local_68;
  local_68 = *(float *)((longlong)param_1 + 0x5c) - 30.0;
  local_50 = CONCAT44(*pfVar2 + *(float *)(param_1 + 5),(undefined4)local_50);
  if (local_68 <= *pfVar2 + *(float *)(param_1 + 5)) {
    pfVar3 = (float *)((longlong)&local_50 + 4);
  }
  local_50._4_4_ = *pfVar3;
  local_80 = uVar4 + 0x520;
  local_88 = uVar4 + 0x524;
  local_70 = 0x447a0000;
  local_78 = 0;
  iVar1 = FUN_1402f98b0(uVar4,&local_60,uVar4 + 0x178,&local_50);
  if ((iVar1 != 1) || (*(float *)((longlong)param_1 + 0x5c) + 10.0 < fStack_5c)) {
    local_88 = CONCAT71(local_88._1_7_,1);
    local_68 = 100000.0;
    iVar1 = FUN_1402f9640(*param_1,&local_68,*param_1 + 0x178,0);
    if (iVar1 != 1) {
      local_68 = *(float *)((longlong)param_1 + 0x5c);
    }
    uVar4 = *param_1;
    *(float *)((longlong)param_1 + 0x5c) = local_68;
    if (local_50._4_4_ < local_68) {
      *(float *)(uVar4 + 0x17c) = local_68;
      *(undefined1 *)(*param_1 + 0x600) = 0;
      *(undefined1 *)(*param_1 + 0x601) = 0;
      uVar4 = *param_1;
      *(undefined1 *)(uVar4 + 0xee4) = 0;
      return CONCAT71((int7)(uVar4 >> 8),1);
    }
    *(float *)(uVar4 + 0x17c) = local_50._4_4_;
  }
  else {
    *(float *)(*param_1 + 0x178) = local_60;
    *(float *)(*param_1 + 0x180) = local_58;
    *(float *)((longlong)param_1 + 0x5c) = fStack_5c;
    uVar4 = *param_1;
    if (local_50._4_4_ < fStack_5c) {
      *(float *)(uVar4 + 0x17c) = fStack_5c;
      *(undefined1 *)(*param_1 + 0x600) = 0;
      *(undefined1 *)(*param_1 + 0x601) = 0;
      uVar4 = *param_1;
      *(undefined1 *)(uVar4 + 0xee4) = 0;
      return CONCAT71((int7)(uVar4 >> 8),1);
    }
    *(float *)(uVar4 + 0x17c) = local_50._4_4_;
  }
  return uVar4 & 0xffffffffffffff00;
}



void FUN_14032e070(longlong *param_1,float *param_2,float *param_3,longlong param_4,
                  undefined4 param_5,undefined4 param_6,float param_7,undefined4 param_8)

{
  float *pfVar1;
  float fVar2;
  undefined4 uVar3;
  float fVar4;
  float fVar5;
  
  *(undefined4 *)(param_1 + 1) = param_8;
  param_1[2] = param_4;
  *(float *)((longlong)param_1 + 0x24) = *param_2;
  *(float *)(param_1 + 5) = param_2[1];
  fVar2 = param_2[2];
  *(undefined4 *)(param_1 + 3) = param_5;
  *(undefined4 *)((longlong)param_1 + 0x1c) = param_6;
  *(float *)((longlong)param_1 + 0x2c) = fVar2;
  uVar3 = FUN_1403144d0(param_5,param_6,param_7,0x453b8000);
  *(undefined4 *)(param_1 + 4) = uVar3;
  *(undefined4 *)(*param_1 + 0xee0) = uVar3;
  fVar5 = (param_3[1] - param_2[1]) * (param_3[1] - param_2[1]) +
          (*param_3 - *param_2) * (*param_3 - *param_2) +
          (param_3[2] - param_2[2]) * (param_3[2] - param_2[2]);
  fVar2 = (float)(0x5f3759df - ((int)fVar5 >> 1));
  fVar2 = fVar2 * (1.5 - fVar2 * fVar2 * fVar5 * 0.5);
  fVar4 = sinf((*(float *)((longlong)param_1 + 0x1c) * 3.1415927) / 180.0);
  param_7 = (fVar4 * *(float *)(param_1 + 4) * 2.0) / param_7;
  *(float *)(param_1 + 9) = param_7;
  *(undefined4 *)(param_1 + 6) = 0;
  *(undefined4 *)((longlong)param_1 + 0x34) = 0;
  *(float *)((longlong)param_1 + 0x4c) =
       ((1.5 - fVar2 * fVar2 * fVar5 * 0.5) * fVar2 * fVar5) / param_7;
  *(undefined4 *)(param_1 + 7) = 0;
  pfVar1 = (float *)(param_1 + 10);
  *(float *)((longlong)param_1 + 0x3c) = *param_3;
  *(float *)(param_1 + 8) = param_3[1];
  *(float *)((longlong)param_1 + 0x44) = param_3[2];
  fVar2 = param_3[2];
  fVar4 = param_2[2];
  *pfVar1 = *param_3 - *param_2;
  *(undefined4 *)((longlong)param_1 + 0x54) = 0;
  *(float *)(param_1 + 0xb) = fVar2 - fVar4;
  D3DXVec3Normalize(pfVar1,pfVar1);
  param_1[0xd] = param_4;
  return;
}



longlong FUN_14032e2b0(longlong *param_1,double param_2,double param_3,float param_4,char param_5)

{
  float *pfVar1;
  float fVar2;
  char cVar3;
  int iVar4;
  uint7 uVar6;
  longlong lVar5;
  float fVar7;
  float fVar8;
  undefined4 local_res20 [2];
  float local_68;
  float fStack_64;
  float local_60;
  float local_58;
  float fStack_54;
  float local_50;
  
  lVar5 = *param_1;
  fVar2 = *(float *)(lVar5 + 0x17c);
  fVar8 = (float)(param_2 - (double)param_1[2]);
  fVar7 = (float)((double)*(float *)((longlong)param_1 + 0x4c) * param_3);
  local_60 = fVar7 * *(float *)(param_1 + 0xb) + *(float *)(lVar5 + 0x180);
  local_58 = fVar7 * *(float *)(param_1 + 10) + *(float *)(lVar5 + 0x178);
  fStack_54 = fVar7 * *(float *)((longlong)param_1 + 0x54) + fVar2;
  local_50 = local_60;
  local_68 = local_58;
  fStack_64 = fStack_54;
  fVar7 = sinf((*(float *)((longlong)param_1 + 0x1c) * 3.1415927) / 180.0);
  local_res20[0] = 0x4b189680;
  fStack_64 = (fVar7 * *(float *)(param_1 + 4) * fVar8 - fVar8 * fVar8 * param_4 * 0.5) +
              *(float *)(param_1 + 5);
  if ((*(longlong *)(lVar5 + 0xd88) == 0) ||
     (cVar3 = FUN_1402f9f60(lVar5,local_res20,&local_68), cVar3 == '\0')) {
    *(float *)(*param_1 + 0x17c) = fStack_64;
  }
  if (param_5 == '\0') {
    local_58 = local_68;
    fStack_54 = fStack_64;
    local_50 = local_60;
  }
  else {
    lVar5 = *param_1;
    iVar4 = FUN_1402f98b0(lVar5,&local_58,lVar5 + 0x178,&local_68,lVar5 + 0x524,lVar5 + 0x520,0,
                          0x447a0000);
    if (iVar4 != 1) goto LAB_14032e45a;
  }
  *(float *)((longlong)param_1 + 0x5c) = fStack_54;
  *(float *)(*param_1 + 0x178) = local_58;
  *(float *)(*param_1 + 0x180) = local_50;
LAB_14032e45a:
  param_1[0xd] = (longlong)param_2;
  pfVar1 = (float *)(*param_1 + 0x17c);
  uVar6 = (uint7)((ulonglong)*param_1 >> 8);
  if (fVar2 < *pfVar1 || fVar2 == *pfVar1) {
    lVar5 = (ulonglong)uVar6 << 8;
  }
  else {
    lVar5 = CONCAT71(uVar6,1);
  }
  return lVar5;
}



undefined8
FUN_14032e4a0(longlong *param_1,double param_2,double param_3,float param_4,float param_5)

{
  longlong lVar1;
  int iVar2;
  undefined8 uVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  undefined4 uVar7;
  float local_68;
  float fStack_64;
  float local_60;
  float local_58;
  float fStack_54;
  float local_50;
  
  lVar1 = *param_1;
  fVar6 = (float)(param_2 - (double)param_1[2]);
  fVar4 = (float)((double)*(float *)((longlong)param_1 + 0x4c) * param_3);
  fVar5 = fVar4 * *(float *)(param_1 + 0xb) + *(float *)(lVar1 + 0x180);
  local_58 = fVar4 * *(float *)(param_1 + 10) + *(float *)(lVar1 + 0x178);
  fStack_54 = fVar4 * *(float *)((longlong)param_1 + 0x54) + *(float *)(lVar1 + 0x17c);
  local_60 = fVar5;
  local_50 = fVar5;
  local_68 = local_58;
  fStack_64 = fStack_54;
  fVar4 = sinf((*(float *)((longlong)param_1 + 0x1c) * 3.1415927) / 180.0);
  fVar4 = (fVar4 * *(float *)(param_1 + 4) * fVar6 - fVar6 * fVar6 * param_4 * 0.5) +
          *(float *)(param_1 + 5);
  fStack_64 = fVar4;
  if (param_5._0_1_ == '\0') {
    param_5 = 0.0;
    local_58 = local_68;
    local_50 = fVar5;
    fStack_54 = fVar4;
    iVar2 = FUN_1402f9640(lVar1,&param_5,lVar1 + 0x178,0,1);
    fStack_64 = fVar4;
    if (iVar2 != 1) goto LAB_14032e5e9;
LAB_14032e5ee:
    *(float *)(*param_1 + 0x178) = local_58;
    *(float *)(*param_1 + 0x180) = local_50;
    *(float *)(*param_1 + 0x17c) = fVar4;
    *(float *)((longlong)param_1 + 0x5c) = param_5;
    if (fVar4 < param_5) {
      uVar3 = 1;
      *(float *)(*param_1 + 0x17c) = param_5;
      goto LAB_14032e716;
    }
  }
  else {
    iVar2 = FUN_1402f98b0(lVar1,&local_58,lVar1 + 0x178,&local_68,lVar1 + 0x524,lVar1 + 0x520,0,
                          0x447a0000);
    if (iVar2 == 1) {
LAB_14032e5e9:
      param_5 = fStack_54;
      fVar4 = fStack_64;
      goto LAB_14032e5ee;
    }
    param_5 = 0.0;
    iVar2 = FUN_1402f9640(*param_1,&param_5,*param_1 + 0x178,0,1);
    uVar7 = param_5;
    if (iVar2 != 1) {
      uVar7 = *(undefined4 *)((longlong)param_1 + 0x5c);
    }
    *(float *)(*param_1 + 0x17c) = fStack_64;
    if (fStack_64 < *(float *)((longlong)param_1 + 0x5c)) {
      iVar2 = (**(code **)(*(longlong *)*param_1 + 0xb0))();
      if ((iVar2 != 1) && (iVar2 = (**(code **)(*(longlong *)*param_1 + 0xb0))(), iVar2 != 2)) {
        lVar1 = *param_1;
        *(undefined4 *)(lVar1 + 0x178) = *(undefined4 *)((longlong)param_1 + 0x3c);
        *(int *)(lVar1 + 0x17c) = (int)param_1[8];
        *(undefined4 *)(lVar1 + 0x180) = *(undefined4 *)((longlong)param_1 + 0x44);
      }
      uVar3 = 1;
      *(undefined4 *)(*param_1 + 0x17c) = uVar7;
      goto LAB_14032e716;
    }
  }
  uVar3 = 0;
LAB_14032e716:
  param_1[0xd] = (longlong)param_2;
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14032e750(longlong param_1,short *param_2)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined8 uVar6;
  short *psVar8;
  short *psVar9;
  longlong lVar10;
  ulonglong uVar11;
  longlong *plVar12;
  short *psVar13;
  undefined4 *puVar14;
  undefined4 *puVar15;
  undefined1 auStack_f8 [32];
  undefined1 local_d8;
  undefined8 local_c8;
  undefined1 local_a8 [32];
  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;
  undefined4 *puVar7;
  
  local_c8 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_f8;
  uVar11 = 0xffffffffffffffff;
  psVar13 = param_2;
  do {
    if (uVar11 == 0) break;
    uVar11 = uVar11 - 1;
    sVar1 = *psVar13;
    psVar13 = psVar13 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x40,param_2,~uVar11 - 1);
  lVar5 = FUN_1402933b0(DAT_140607ff0,param_2);
  if (lVar5 == 0) {
    FUN_140418da0(DAT_140607fd8,L"Invalid Table mcoCharacterNullMotion %s",param_2);
    uVar6 = 0;
  }
  else {
    puVar15 = (undefined4 *)0x0;
    puVar14 = puVar15;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar7 = puVar15;
      plVar12 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar12 != 0) {
          puVar14 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar7];
          break;
        }
        uVar3 = (int)puVar7 + 1;
        puVar7 = (undefined4 *)(ulonglong)uVar3;
        plVar12 = plVar12 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_14032e810:
    puVar7 = puVar14;
    if (puVar7 != (undefined4 *)0x0) {
      uVar2 = *puVar7;
      uVar4 = FUN_1402970c0(lVar5,L"szCurrentMotion");
      local_d8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szCurrentMotion");
      uVar4 = FUN_1402970c0(lVar5,L"szNextMotion");
      local_d8 = 1;
      psVar9 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szNextMotion");
      local_70 = 7;
      local_78 = 0;
      local_88 = 0;
      uVar11 = 0xffffffffffffffff;
      psVar13 = psVar8;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar1 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_88,psVar8,~uVar11 - 1);
      local_48 = 7;
      local_50 = 0;
      local_60 = 0;
      uVar11 = 0xffffffffffffffff;
      psVar13 = psVar9;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar1 = *psVar13;
        psVar13 = psVar13 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_60,psVar9,~uVar11 - 1);
      if (*(longlong *)(param_1 + 0x88) == 0) {
        FUN_140167ec0(param_1 + 0x68,local_a8,&local_88);
      }
      else {
        FUN_140167da0();
      }
      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));
      }
      puVar14 = *(undefined4 **)(puVar7 + 6);
      if (*(undefined4 **)(puVar7 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar7[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar10 = (longlong)(int)uVar3 << 3;
        puVar14 = puVar15;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar10) != 0) {
            puVar14 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar10);
          }
          uVar3 = uVar3 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar14 == (undefined4 *)0x0);
      }
      goto LAB_14032e810;
    }
    uVar6 = 1;
  }
  return uVar6;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_14032e9f0(longlong param_1,short *param_2)

{
  short sVar1;
  ushort *puVar2;
  ulonglong uVar3;
  ushort *puVar4;
  short *psVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  undefined1 auStack_88 [32];
  longlong local_68;
  undefined1 local_60;
  undefined8 local_58;
  ushort local_50;
  undefined6 uStack_4e;
  longlong local_40;
  ulonglong local_38;
  ulonglong local_28;
  
  local_58 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  if (param_2 != (short *)0x0) {
    local_68 = param_1;
    FUN_14034ed40();
    local_60 = 1;
    local_38 = 7;
    uVar7 = 0;
    local_40 = 0;
    local_50 = 0;
    uVar3 = 0xffffffffffffffff;
    psVar5 = param_2;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      sVar1 = *psVar5;
      psVar5 = psVar5 + 1;
    } while (sVar1 != 0);
    FUN_140001710(&local_50,param_2,~uVar3 - 1);
    if (*(longlong *)(param_1 + 0x88) != 0) {
      puVar4 = &local_50;
      if (7 < local_38) {
        puVar4 = (ushort *)CONCAT62(uStack_4e,local_50);
      }
      puVar2 = &local_50;
      if (7 < local_38) {
        puVar2 = (ushort *)CONCAT62(uStack_4e,local_50);
      }
      for (; puVar2 != puVar4 + local_40; puVar2 = puVar2 + 1) {
        uVar7 = uVar7 ^ (uVar7 >> 2) + uVar7 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar2;
      }
      uVar7 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x68) +
                            (uVar7 % *(ulonglong *)(param_1 + 0x70)) * 8,&local_50);
    }
    if (7 < local_38) {
      operator_delete((void *)CONCAT62(uStack_4e,local_50));
    }
    local_38 = 7;
    local_40 = 0;
    local_50 = 0;
    if (uVar7 != 0) {
      puVar6 = (undefined8 *)(uVar7 + 0x30);
      if (7 < *(ulonglong *)(uVar7 + 0x48)) {
        puVar6 = (undefined8 *)*puVar6;
      }
      FUN_14034edd0(param_1);
      return puVar6;
    }
    FUN_14034edd0(param_1);
  }
  return (undefined8 *)0x0;
}



undefined8 FUN_14032eb70(longlong param_1,short *param_2)

{
  int *piVar1;
  int iVar2;
  short sVar3;
  longlong **pplVar4;
  longlong **pplVar5;
  undefined8 *puVar6;
  uint uVar7;
  undefined4 uVar8;
  longlong lVar9;
  short *psVar11;
  short *psVar12;
  short *psVar13;
  short *psVar14;
  undefined4 *puVar15;
  longlong *plVar16;
  longlong lVar17;
  undefined8 uVar18;
  ulonglong uVar19;
  longlong *plVar20;
  short *psVar21;
  undefined8 *puVar22;
  longlong *plVar23;
  undefined4 uVar24;
  code *in_stack_ffffffffffffff68;
  longlong *local_70;
  longlong *local_68;
  longlong *local_60;
  longlong *plVar10;
  
  uVar19 = 0xffffffffffffffff;
  psVar11 = param_2;
  do {
    if (uVar19 == 0) break;
    uVar19 = uVar19 - 1;
    sVar3 = *psVar11;
    psVar11 = psVar11 + 1;
  } while (sVar3 != 0);
  FUN_140001710(param_1 + 8,param_2,~uVar19 - 1);
  lVar9 = FUN_1402933b0(DAT_140607ff0,param_2);
  uVar18 = 0;
  if (lVar9 != 0) {
    plVar23 = (longlong *)0x0;
    plVar20 = plVar23;
    if ((*(longlong *)(lVar9 + 0x70) != 0) && (*(uint *)(lVar9 + 0x78) != 0)) {
      plVar10 = plVar23;
      plVar16 = *(longlong **)(lVar9 + 0x68);
      do {
        if (*plVar16 != 0) {
          plVar20 = (longlong *)(*(longlong **)(lVar9 + 0x68))[(longlong)plVar10];
          break;
        }
        uVar7 = (int)plVar10 + 1;
        plVar10 = (longlong *)(ulonglong)uVar7;
        plVar16 = plVar16 + 1;
      } while (uVar7 < *(uint *)(lVar9 + 0x78));
    }
LAB_14032ec26:
    if (plVar20 != (longlong *)0x0) {
      uVar24 = (undefined4)*plVar20;
      local_60 = plVar20;
      uVar8 = FUN_1402970c0(lVar9,L"szMotion1");
      uVar18 = CONCAT71((int7)((ulonglong)in_stack_ffffffffffffff68 >> 8),1);
      psVar11 = (short *)FUN_140296990(lVar9,uVar24,uVar8,L"szMotion1",uVar18);
      uVar8 = FUN_1402970c0(lVar9,L"szMotion2");
      uVar18 = CONCAT71((int7)((ulonglong)uVar18 >> 8),1);
      psVar12 = (short *)FUN_140296990(lVar9,uVar24,uVar8,L"szMotion2",uVar18);
      uVar8 = FUN_1402970c0(lVar9,L"szMotion3");
      uVar18 = CONCAT71((int7)((ulonglong)uVar18 >> 8),1);
      psVar13 = (short *)FUN_140296990(lVar9,uVar24,uVar8,L"szMotion3",uVar18);
      uVar8 = FUN_1402970c0(lVar9,L"szDamageMotion");
      uVar19 = CONCAT71((int7)((ulonglong)uVar18 >> 8),1);
      psVar14 = (short *)FUN_140296990(lVar9,uVar24,uVar8,L"szDamageMotion",uVar19);
      uVar8 = FUN_1402970c0(lVar9,L"fTime");
      in_stack_ffffffffffffff68 = (code *)(uVar19 & 0xffffffffffffff00);
      puVar15 = (undefined4 *)FUN_1402967b0(lVar9,uVar24,uVar8,L"fTime",in_stack_ffffffffffffff68);
      plVar16 = operator_new(0xa8);
      plVar10 = plVar23;
      if (plVar16 != (longlong *)0x0) {
        *plVar16 = 0;
        in_stack_ffffffffffffff68 = FUN_14023be90;
        _eh_vector_constructor_iterator_
                  (plVar16 + 1,0x28,3,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
        plVar16[0x13] = 7;
        plVar16[0x12] = 0;
        *(undefined2 *)(plVar16 + 0x10) = 0;
        plVar10 = plVar16;
      }
      local_70 = plVar10;
      FUN_14032efc0(&local_68,plVar10);
      FUN_140178e90(&local_70,plVar10,plVar10);
      *(undefined4 *)local_70 = uVar24;
      uVar19 = 0xffffffffffffffff;
      psVar21 = psVar11;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar3 = *psVar21;
        psVar21 = psVar21 + 1;
      } while (sVar3 != 0);
      FUN_140001710(local_70 + 1,psVar11,~uVar19 - 1);
      uVar19 = 0xffffffffffffffff;
      psVar11 = psVar12;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar3 = *psVar11;
        psVar11 = psVar11 + 1;
      } while (sVar3 != 0);
      FUN_140001710(local_70 + 6,psVar12,~uVar19 - 1);
      uVar19 = 0xffffffffffffffff;
      psVar11 = psVar13;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar3 = *psVar11;
        psVar11 = psVar11 + 1;
      } while (sVar3 != 0);
      FUN_140001710(local_70 + 0xb,psVar13,~uVar19 - 1);
      uVar19 = 0xffffffffffffffff;
      psVar11 = psVar14;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar3 = *psVar11;
        psVar11 = psVar11 + 1;
      } while (sVar3 != 0);
      FUN_140001710(local_70 + 0x10,psVar14,~uVar19 - 1);
      if (puVar15 == (undefined4 *)0x0) {
        uVar24 = 0x3f800000;
      }
      else {
        uVar24 = *puVar15;
      }
      *(undefined4 *)((longlong)local_70 + 4) = uVar24;
      pplVar4 = *(longlong ***)(param_1 + 0x38);
      if ((&local_70 < pplVar4) && (pplVar5 = *(longlong ***)(param_1 + 0x30), pplVar5 <= &local_70)
         ) {
        if (pplVar4 == *(longlong ***)(param_1 + 0x40)) {
          FUN_1403435d0(param_1 + 0x30);
        }
        puVar22 = (undefined8 *)
                  (((longlong)&local_70 - (longlong)pplVar5 & 0xfffffffffffffff0U) +
                  *(longlong *)(param_1 + 0x30));
        puVar6 = *(undefined8 **)(param_1 + 0x38);
        if (puVar6 != (undefined8 *)0x0) {
          *puVar6 = *puVar22;
          lVar17 = puVar22[1];
          puVar6[1] = lVar17;
          if (lVar17 != 0) {
            LOCK();
            *(int *)(lVar17 + 8) = *(int *)(lVar17 + 8) + 1;
            UNLOCK();
            plVar20 = local_60;
          }
        }
      }
      else {
        if (pplVar4 == *(longlong ***)(param_1 + 0x40)) {
          FUN_1403435d0(param_1 + 0x30);
        }
        puVar6 = *(undefined8 **)(param_1 + 0x38);
        if (puVar6 != (undefined8 *)0x0) {
          *puVar6 = local_70;
          puVar6[1] = local_68;
          if (local_68 != (longlong *)0x0) {
            LOCK();
            *(int *)(local_68 + 1) = (int)local_68[1] + 1;
            UNLOCK();
            plVar20 = local_60;
          }
        }
      }
      plVar10 = local_68;
      *(longlong *)(param_1 + 0x38) = *(longlong *)(param_1 + 0x38) + 0x10;
      plVar16 = plVar20;
      if (local_68 != (longlong *)0x0) {
        LOCK();
        plVar20 = local_68 + 1;
        lVar17 = *plVar20;
        *(int *)plVar20 = (int)*plVar20 + -1;
        UNLOCK();
        plVar16 = local_60;
        if ((int)lVar17 == 1) {
          (**(code **)(*local_68 + 8))(local_68);
          LOCK();
          piVar1 = (int *)((longlong)plVar10 + 0xc);
          iVar2 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          plVar16 = local_60;
          if (iVar2 == 1) {
            (**(code **)(*plVar10 + 0x10))(plVar10);
            plVar16 = local_60;
          }
        }
      }
      plVar20 = (longlong *)plVar16[3];
      if (plVar20 == (longlong *)0x0) {
        uVar7 = *(uint *)(plVar16 + 4) % *(uint *)(lVar9 + 0x78) + 1;
        lVar17 = (longlong)(int)uVar7 << 3;
        plVar20 = plVar23;
        do {
          if (*(uint *)(lVar9 + 0x78) <= uVar7) break;
          if (*(longlong *)(*(longlong *)(lVar9 + 0x68) + lVar17) != 0) {
            plVar20 = *(longlong **)(*(longlong *)(lVar9 + 0x68) + lVar17);
          }
          uVar7 = uVar7 + 1;
          lVar17 = lVar17 + 8;
        } while (plVar20 == (longlong *)0x0);
      }
      goto LAB_14032ec26;
    }
    uVar18 = 1;
  }
  return uVar18;
}



undefined8 FUN_14032ef90(longlong param_1,int param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x30);
  if (puVar1 == *(undefined8 **)(param_1 + 0x38)) {
    return 0;
  }
  if ((-1 < param_2) &&
     (param_2 < (int)((longlong)*(undefined8 **)(param_1 + 0x38) - (longlong)puVar1 >> 4))) {
    return puVar1[(longlong)param_2 * 2];
  }
  return *puVar1;
}



undefined8 * FUN_14032efc0(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;
}



void FUN_14032f030(longlong param_1)

{
  FUN_14032f040(*(undefined8 *)(param_1 + 0x10));
  return;
}



void FUN_14032f040(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)param_1 + 0x98)) {
      operator_delete(*(void **)((longlong)param_1 + 0x80));
    }
    *(undefined8 *)((longlong)param_1 + 0x98) = 7;
    *(undefined8 *)((longlong)param_1 + 0x90) = 0;
    *(undefined2 *)((longlong)param_1 + 0x80) = 0;
    _eh_vector_destructor_iterator_((void *)((longlong)param_1 + 8),0x28,3,FUN_14023be90);
    operator_delete(param_1);
  }
  return;
}



void thunk_FUN_140330e10(void)

{
  FUN_140330e10();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14032f0c0(void)

{
  ushort *puVar1;
  short sVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined4 uVar5;
  int iVar6;
  longlong lVar7;
  short *psVar9;
  undefined4 *puVar10;
  short *psVar11;
  longlong *plVar12;
  ulonglong uVar13;
  ushort *puVar14;
  ushort *puVar15;
  longlong lVar16;
  short *psVar17;
  undefined4 *puVar18;
  undefined1 auStack_258 [32];
  undefined1 local_238;
  undefined8 local_228;
  undefined4 local_218;
  undefined8 local_214;
  undefined4 local_20c;
  undefined4 local_208;
  ushort local_200;
  undefined6 uStack_1fe;
  longlong local_1f0;
  ulonglong local_1e8;
  undefined2 local_1d8 [8];
  undefined8 local_1c8;
  undefined8 local_1c0;
  undefined2 local_1b0 [8];
  undefined8 local_1a0;
  undefined8 local_198;
  undefined2 local_188 [8];
  undefined8 local_178;
  undefined8 local_170;
  undefined2 local_160 [8];
  undefined8 local_150;
  undefined8 local_148;
  undefined4 local_138;
  undefined1 local_130 [232];
  ulonglong local_48;
  undefined4 *puVar8;
  
  local_228 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  lVar7 = FUN_1402933b0(DAT_140607ff0,L"GIMMICK_SUMMON");
  if (lVar7 != 0) {
    puVar18 = (undefined4 *)0x0;
    puVar10 = puVar18;
    if ((*(longlong *)(lVar7 + 0x70) != 0) && (*(uint *)(lVar7 + 0x78) != 0)) {
      puVar8 = puVar18;
      plVar12 = *(longlong **)(lVar7 + 0x68);
      do {
        if (*plVar12 != 0) {
          puVar10 = (undefined4 *)(*(longlong **)(lVar7 + 0x68))[(longlong)puVar8];
          break;
        }
        uVar4 = (int)puVar8 + 1;
        puVar8 = (undefined4 *)(ulonglong)uVar4;
        plVar12 = plVar12 + 1;
      } while (uVar4 < *(uint *)(lVar7 + 0x78));
    }
LAB_14032f160:
    puVar8 = puVar10;
    if (puVar8 != (undefined4 *)0x0) {
      uVar3 = *puVar8;
      local_214 = 0;
      local_20c = 0;
      local_208 = 0;
      local_1e8 = 7;
      local_1f0 = 0;
      local_200 = 0;
      local_1c0 = 7;
      local_1c8 = 0;
      local_1d8[0] = 0;
      local_198 = 7;
      local_1a0 = 0;
      local_1b0[0] = 0;
      local_170 = 7;
      local_178 = 0;
      local_188[0] = 0;
      local_148 = 7;
      local_150 = 0;
      local_160[0] = 0;
      local_218 = uVar3;
      uVar5 = FUN_1402970c0(lVar7,L"szGimmickMdata");
      local_238 = 1;
      psVar9 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szGimmickMdata");
      uVar5 = FUN_1402970c0(lVar7,L"nUseGimmickID");
      local_238 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nUseGimmickID");
      local_214 = CONCAT44(local_214._4_4_,*puVar10);
      uVar5 = FUN_1402970c0(lVar7,L"nUseGimmickCount");
      local_238 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nUseGimmickCount");
      local_214 = CONCAT44(*puVar10,(undefined4)local_214);
      uVar5 = FUN_1402970c0(lVar7,L"nGimmickTemplateID");
      local_238 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar3,uVar5,L"nGimmickTemplateID");
      local_20c = *puVar10;
      uVar5 = FUN_1402970c0(lVar7,L"fSuccessPro");
      local_238 = 1;
      puVar10 = (undefined4 *)FUN_1402967b0(lVar7,uVar3,uVar5,L"fSuccessPro");
      local_208 = *puVar10;
      uVar5 = FUN_1402970c0(lVar7,L"szStartMotion");
      local_238 = 1;
      psVar11 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szStartMotion");
      uVar13 = 0xffffffffffffffff;
      psVar17 = psVar11;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1d8,psVar11,~uVar13 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szMotion");
      local_238 = 1;
      psVar11 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szMotion");
      uVar13 = 0xffffffffffffffff;
      psVar17 = psVar11;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_1b0,psVar11,~uVar13 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szBreakMotion");
      local_238 = 1;
      psVar11 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szBreakMotion");
      uVar13 = 0xffffffffffffffff;
      psVar17 = psVar11;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_188,psVar11,~uVar13 - 1);
      uVar5 = FUN_1402970c0(lVar7,L"szFailMotion");
      local_238 = 1;
      psVar11 = (short *)FUN_140296990(lVar7,uVar3,uVar5,L"szFailMotion");
      uVar13 = 0xffffffffffffffff;
      psVar17 = psVar11;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_160,psVar11,~uVar13 - 1);
      if (DAT_140607be1 == '\0') {
        if ((DAT_140607c18 == (undefined4 *)0x0) &&
           (puVar10 = operator_new(0x28), DAT_140607c18 = puVar18, puVar10 != (undefined4 *)0x0)) {
          *(undefined8 *)(puVar10 + 6) = 7;
          *(undefined8 *)(puVar10 + 4) = 0;
          *(undefined2 *)puVar10 = 0;
          DAT_140607c18 = puVar10;
        }
        FUN_1400015e0(&local_200,DAT_140607c18,0,0xffffffffffffffff);
        FUN_140002aa0(&local_200,&DAT_14049a36c,1);
      }
      uVar13 = 0xffffffffffffffff;
      psVar17 = psVar9;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar2 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar2 != 0);
      FUN_140002aa0(&local_200,psVar9,~uVar13 - 1);
      puVar14 = &local_200;
      if (7 < local_1e8) {
        puVar14 = (ushort *)CONCAT62(uStack_1fe,local_200);
      }
      puVar1 = puVar14 + local_1f0;
      puVar15 = &local_200;
      if (7 < local_1e8) {
        puVar15 = (ushort *)CONCAT62(uStack_1fe,local_200);
      }
      if (puVar15 != puVar1) {
        lVar16 = (longlong)puVar14 - (longlong)puVar15;
        do {
          iVar6 = tolower((uint)*puVar15);
          *(short *)(lVar16 + (longlong)puVar15) = (short)iVar6;
          puVar15 = puVar15 + 1;
        } while (puVar15 != puVar1);
      }
      local_138 = uVar3;
      FUN_140331f80(local_130,&local_218);
      FUN_140330c50(local_138);
      FUN_14032f580(local_130);
      FUN_14032f580(&local_218);
      puVar10 = *(undefined4 **)(puVar8 + 6);
      if (*(undefined4 **)(puVar8 + 6) == (undefined4 *)0x0) {
        uVar4 = (uint)puVar8[8] % *(uint *)(lVar7 + 0x78) + 1;
        lVar16 = (longlong)(int)uVar4 << 3;
        puVar10 = puVar18;
        do {
          if (*(uint *)(lVar7 + 0x78) <= uVar4) break;
          if (*(longlong *)(lVar16 + *(longlong *)(lVar7 + 0x68)) != 0) {
            puVar10 = *(undefined4 **)(lVar16 + *(longlong *)(lVar7 + 0x68));
          }
          uVar4 = uVar4 + 1;
          lVar16 = lVar16 + 8;
        } while (puVar10 == (undefined4 *)0x0);
      }
      goto LAB_14032f160;
    }
  }
  return;
}



void FUN_14032f580(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0xd0)) {
    operator_delete(*(void **)(param_1 + 0xb8));
  }
  *(undefined8 *)(param_1 + 0xd0) = 7;
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined2 *)(param_1 + 0xb8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xa8)) {
    operator_delete(*(void **)(param_1 + 0x90));
  }
  *(undefined8 *)(param_1 + 0xa8) = 7;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  *(undefined2 *)(param_1 + 0x90) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x80)) {
    operator_delete(*(void **)(param_1 + 0x68));
  }
  *(undefined8 *)(param_1 + 0x80) = 7;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined2 *)(param_1 + 0x68) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x58)) {
    operator_delete(*(void **)(param_1 + 0x40));
  }
  *(undefined8 *)(param_1 + 0x58) = 7;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined2 *)(param_1 + 0x40) = 0;
  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;
}



void FUN_14032f670(longlong param_1)

{
  FUN_14032f580(param_1 + 8);
  return;
}



uint FUN_14032f680(longlong *param_1,uint param_2)

{
  uint *puVar1;
  
  if (*param_1 != 0) {
    for (puVar1 = *(uint **)(*param_1 + ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 2)) * 8
                            ); puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x3a)) {
      if ((puVar1[0x3c] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return puVar1[3];
      }
    }
  }
  return 0;
}



undefined8 * FUN_14032f6c0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetGimmickSummonDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf08 & 1) == 0) {
    DAT_14060cf08 = DAT_14060cf08 | 1;
    FUN_140330b80(0x3f400000,0x3e800000,0x40100000);
    FUN_14032f0c0();
    atexit((_func_5014 *)&LAB_140449190);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetGimmickSummonDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_140608360;
}



void thunk_FUN_1403310c0(void)

{
  FUN_1403310c0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14032f780(void)

{
  short sVar1;
  undefined4 uVar2;
  code *pcVar3;
  wchar_t *_Str1;
  wchar_t **ppwVar4;
  uint uVar5;
  undefined4 uVar6;
  int iVar7;
  longlong lVar8;
  undefined8 uVar9;
  wchar_t *pwVar11;
  wchar_t *pwVar12;
  wchar_t *pwVar13;
  wchar_t *pwVar14;
  short *psVar15;
  undefined4 *puVar16;
  short *psVar17;
  longlong *plVar18;
  ulonglong uVar19;
  longlong lVar20;
  ulonglong uVar21;
  longlong lVar22;
  short *psVar23;
  longlong lVar24;
  bool bVar25;
  undefined1 auStack_4b8 [32];
  undefined1 local_498;
  wchar_t *local_488;
  undefined4 *local_480;
  undefined4 local_478 [2];
  wchar_t *local_470;
  wchar_t *local_468;
  wchar_t *local_460;
  wchar_t *local_458;
  undefined8 local_450;
  undefined8 local_440;
  undefined2 local_438;
  undefined6 uStack_436;
  undefined8 local_428;
  ulonglong local_420;
  undefined4 local_408;
  undefined4 local_404;
  undefined4 local_400;
  undefined4 local_3fc;
  undefined4 local_3f8;
  undefined4 local_3f4;
  undefined4 local_3f0;
  undefined4 local_3ec;
  undefined4 local_3e8;
  undefined4 local_3e4;
  undefined4 local_3e0;
  undefined4 local_3dc;
  undefined4 local_3d8;
  undefined4 local_3d4;
  undefined4 local_3d0;
  undefined4 local_3cc;
  undefined4 local_3c8;
  undefined4 local_3c4;
  undefined4 local_3c0;
  undefined4 local_3bc;
  undefined4 local_3b8;
  undefined4 local_3b4;
  undefined1 local_3b0 [40];
  undefined1 local_388 [40];
  undefined1 local_360 [40];
  undefined1 local_338 [40];
  undefined1 local_310 [40];
  undefined1 local_2e8 [40];
  undefined1 local_2c0 [40];
  undefined1 local_298 [40];
  undefined1 local_270 [40];
  wchar_t **local_248;
  wchar_t **local_240;
  wchar_t **local_238;
  undefined1 local_228 [8];
  undefined1 local_220 [488];
  ulonglong local_38;
  undefined4 *puVar10;
  
  local_440 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_4b8;
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"GIMMICK_TEMPLATE_TABLE");
  if (lVar8 != 0) {
    local_420 = 7;
    puVar16 = (undefined4 *)0x0;
    local_428 = 0;
    local_438 = 0;
    if (DAT_140607be1 == '\0') {
      uVar9 = FUN_140123ce0();
      FUN_1400015e0(&local_438,uVar9,0,0xffffffffffffffff);
      FUN_140002aa0(&local_438,&DAT_14049a36c,1);
    }
    else {
      FUN_140001710(&local_438,&DAT_140477960,0);
    }
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar10 = puVar16;
      plVar18 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar18 != 0) {
          puVar16 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar10];
          break;
        }
        uVar5 = (int)puVar10 + 1;
        puVar10 = (undefined4 *)(ulonglong)uVar5;
        plVar18 = plVar18 + 1;
      } while (uVar5 < *(uint *)(lVar8 + 0x78));
    }
LAB_14032f87b:
    local_480 = puVar16;
    if (puVar16 != (undefined4 *)0x0) {
      uVar2 = *puVar16;
      local_478[0] = uVar2;
      FUN_140332d70(&local_408);
      local_408 = uVar2;
      uVar6 = FUN_1402970c0(lVar8,L"szGimmickTypeName");
      local_498 = 1;
      local_488 = (wchar_t *)FUN_140296990(lVar8,uVar2,uVar6,L"szGimmickTypeName");
      uVar6 = FUN_1402970c0(lVar8,L"szAbleToAttack");
      local_498 = 1;
      pwVar11 = (wchar_t *)FUN_140296990(lVar8,uVar2,uVar6,L"szAbleToAttack");
      uVar6 = FUN_1402970c0(lVar8,L"szRemoveTypeName");
      local_498 = 1;
      pwVar12 = (wchar_t *)FUN_140296990(lVar8,uVar2,uVar6,L"szRemoveTypeName");
      uVar6 = FUN_1402970c0(lVar8,L"szAbleToDamage");
      local_498 = 1;
      pwVar13 = (wchar_t *)FUN_140296990(lVar8,uVar2,uVar6,L"szAbleToDamage");
      uVar6 = FUN_1402970c0(lVar8,L"szAbleToCollision");
      local_498 = 1;
      pwVar14 = (wchar_t *)FUN_140296990(lVar8,uVar2,uVar6,L"szAbleToCollision");
      uVar6 = FUN_1402970c0(lVar8,L"szCollisionEvent");
      local_498 = 1;
      local_468 = (wchar_t *)FUN_140296990(lVar8,uVar2,uVar6,L"szCollisionEvent");
      uVar6 = FUN_1402970c0(lVar8,L"szDamageEvent");
      local_498 = 1;
      local_470 = (wchar_t *)FUN_140296990(lVar8,uVar2,uVar6,L"szDamageEvent");
      uVar6 = FUN_1402970c0(lVar8,L"szSubModelFile");
      local_498 = 1;
      psVar15 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szSubModelFile");
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_2e8,psVar15,~uVar19 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"szSubModelAni");
      local_498 = 1;
      psVar15 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szSubModelAni");
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_298,psVar15,~uVar19 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"szSubModelDummy");
      local_498 = 1;
      psVar15 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szSubModelDummy");
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_2c0,psVar15,~uVar19 - 1);
      _Str1 = local_488;
      iVar7 = _wcsicmp(local_488,L"GIMMICK_TYPE_NORMAL");
      if (iVar7 == 0) {
        local_404 = 0;
      }
      else {
        iVar7 = _wcsicmp(_Str1,L"GIMMICK_TYPE_SWAMP");
        if (iVar7 == 0) {
          local_404 = 1;
        }
        else {
          iVar7 = _wcsicmp(_Str1,L"GIMMICK_TYPE_AIM");
          if (iVar7 == 0) {
            local_404 = 2;
          }
        }
      }
      iVar7 = _wcsicmp(pwVar11,L"GIMMICK_ABLE_ATTACK_TYPE_PLAYER");
      if (iVar7 == 0) {
        local_3e8 = 0;
      }
      else {
        iVar7 = _wcsicmp(pwVar11,L"GIMMICK_ABLE_ATTACK_TYPE_ALL");
        if (iVar7 == 0) {
          local_3e8 = 2;
        }
        else {
          iVar7 = _wcsicmp(pwVar11,L"GIMMICK_ABLE_ATTACK_TYPE_ENEMY");
          if (iVar7 == 0) {
            local_3e8 = 1;
          }
        }
      }
      iVar7 = _wcsicmp(pwVar12,L"GIMMICK_REMOVE_TYPE_BREAK");
      if (iVar7 == 0) {
        local_3e4 = 0;
      }
      else {
        iVar7 = _wcsicmp(pwVar12,L"GIMMICK_REMOVE_TYPE_ANIMATION");
        if (iVar7 == 0) {
          local_3e4 = 1;
        }
        else {
          iVar7 = _wcsicmp(pwVar12,L"GIMMICK_REMOVE_TYPE_NOWAY");
          if (iVar7 == 0) {
            local_3e4 = 2;
          }
          else {
            iVar7 = _wcsicmp(pwVar12,L"GIMMICK_REMOVE_TYPE_CANNOT");
            if (iVar7 == 0) {
              local_3e4 = 4;
            }
            else {
              iVar7 = _wcsicmp(pwVar12,L"GiMMICK_REMOVE_TYPE_BREAK_AND_ANIMATION");
              if (iVar7 == 0) {
                local_3e4 = 3;
              }
            }
          }
        }
      }
      iVar7 = _wcsicmp(pwVar13,L"GIMMICK_ABLE_DAMAGE_TYPE_PLAYER");
      bVar25 = iVar7 == 0;
      if (bVar25) {
        local_3e0 = 0;
      }
      else {
        iVar7 = _wcsicmp(pwVar13,L"GIMMICK_ABLE_DAMAGE_TYPE_ALL");
        bVar25 = iVar7 == 0;
        if (bVar25) {
          local_3e0 = 2;
        }
        else {
          iVar7 = _wcsicmp(pwVar13,L"GIMMICK_ABLE_DAMAGE_TYPE_ENEMY");
          bVar25 = iVar7 == 0;
          if (bVar25) {
            local_3e0 = 1;
          }
          else {
            iVar7 = _wcsicmp(pwVar13,L"GIMMICK_ABLE_DAMAGE_TYPE_NONE");
            bVar25 = iVar7 == 0;
            if (bVar25) {
              local_3e0 = 3;
            }
          }
        }
      }
      pwVar11 = local_468;
      lVar20 = 0x23;
      pwVar12 = pwVar14;
      pwVar13 = L"GIMMICK_ABLE_COLLISION_TYPE_PLAYER";
      do {
        if (lVar20 == 0) break;
        lVar20 = lVar20 + -1;
        bVar25 = *pwVar12 == *pwVar13;
        pwVar12 = pwVar12 + 1;
        pwVar13 = pwVar13 + 1;
      } while (bVar25);
      if (bVar25) {
        local_3dc = 1;
        uVar6 = local_3dc;
      }
      else {
        lVar20 = 0x20;
        pwVar12 = pwVar14;
        pwVar13 = L"GIMMICK_ABLE_COLLISION_TYPE_ALL";
        do {
          if (lVar20 == 0) break;
          lVar20 = lVar20 + -1;
          bVar25 = *pwVar12 == *pwVar13;
          pwVar12 = pwVar12 + 1;
          pwVar13 = pwVar13 + 1;
        } while (bVar25);
        if (bVar25) {
          local_3dc = 0;
          uVar6 = local_3dc;
        }
        else {
          lVar20 = 0x22;
          pwVar12 = pwVar14;
          pwVar13 = L"GIMMICK_ABLE_COLLISION_TYPE_ENEMY";
          do {
            if (lVar20 == 0) break;
            lVar20 = lVar20 + -1;
            bVar25 = *pwVar12 == *pwVar13;
            pwVar12 = pwVar12 + 1;
            pwVar13 = pwVar13 + 1;
          } while (bVar25);
          uVar6 = 2;
          if (!bVar25) {
            lVar20 = 0x21;
            pwVar12 = L"GIMMICK_ABLE_COLLISION_TYPE_NONE";
            do {
              if (lVar20 == 0) break;
              lVar20 = lVar20 + -1;
              bVar25 = *pwVar14 == *pwVar12;
              pwVar14 = pwVar14 + 1;
              pwVar12 = pwVar12 + 1;
            } while (bVar25);
            uVar6 = local_3dc;
            if (bVar25) {
              uVar6 = 3;
            }
          }
        }
      }
      local_3dc = uVar6;
      iVar7 = _wcsicmp(local_468,L"GIMMICK_COLLISION_EVENT_TOUCH");
      if (iVar7 == 0) {
        local_3d8 = 1;
      }
      else {
        iVar7 = _wcsicmp(pwVar11,L"GIMMICK_COLLISION_EVENT_ATTACK");
        if (iVar7 == 0) {
          local_3d8 = 2;
        }
        else {
          iVar7 = _wcsicmp(pwVar11,L"GIMMICK_COLLISION_EVENT_NONE");
          if (iVar7 == 0) {
            local_3d8 = 0;
          }
          else {
            lVar20 = 0x25;
            bVar25 = false;
            pwVar14 = L"GIMMICK_COLLISION_EVENT_TOUCH_REMOVE";
            do {
              if (lVar20 == 0) break;
              lVar20 = lVar20 + -1;
              bVar25 = *pwVar11 == *pwVar14;
              pwVar11 = pwVar11 + 1;
              pwVar14 = pwVar14 + 1;
            } while (bVar25);
            if (bVar25) {
              local_3d8 = 3;
            }
          }
        }
      }
      pwVar14 = local_470;
      iVar7 = _wcsicmp(local_470,L"GIMMICK_DAMAGE_EVENT_ATTACK");
      if (iVar7 == 0) {
        local_3d4 = 1;
      }
      else {
        iVar7 = _wcsicmp(pwVar14,L"GIMMICK_COLLISION_EVENT_NONE");
        if (iVar7 == 0) {
          local_3d4 = 0;
        }
      }
      uVar6 = FUN_1402970c0(lVar8,L"nDamageAngle");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nDamageAngle");
      local_400 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"fHitRange");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_1402967b0(lVar8,uVar2,uVar6,L"fHitRange");
      local_3c4 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"nLureID");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nLureID");
      local_3b4 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"szRemoveAnimation");
      local_498 = 1;
      psVar15 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szRemoveAnimation");
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_3b0,psVar15,~uVar19 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"szCrashHitAttribute");
      local_498 = 1;
      psVar15 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szCrashHitAttribute");
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_388,psVar15,~uVar19 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"szTouchAnimation");
      local_498 = 1;
      psVar15 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szTouchAnimation");
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_360,psVar15,~uVar19 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"nItemDropGroup");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nItemDropGroup");
      local_3fc = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"nQuestItemDropGroup");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nQuestItemDropGroup");
      local_3f8 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"nInstanceItemDropGroup");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nInstanceItemDropGroup");
      local_3f4 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"nAddEffectID00");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nAddEffectID00");
      local_3f0 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"nAddEffectID01");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nAddEffectID01");
      local_3ec = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"szGimmickDamageMotion");
      local_498 = 1;
      psVar15 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szGimmickDamageMotion");
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      FUN_140001710(local_270,psVar15,~uVar19 - 1);
      uVar6 = FUN_1402970c0(lVar8,L"szAttackEffect");
      local_498 = 1;
      psVar15 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szAttackEffect");
      uVar6 = FUN_1402970c0(lVar8,L"szDamageEffect");
      local_498 = 1;
      psVar17 = (short *)FUN_140296990(lVar8,uVar2,uVar6,L"szDamageEffect");
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      if (5 < ~uVar19 - 1) {
        FUN_1400015e0(local_338,&local_438,0,0xffffffffffffffff);
        uVar19 = 0xffffffffffffffff;
        psVar23 = psVar15;
        do {
          if (uVar19 == 0) break;
          uVar19 = uVar19 - 1;
          sVar1 = *psVar23;
          psVar23 = psVar23 + 1;
        } while (sVar1 != 0);
        FUN_140002aa0(local_338,psVar15,~uVar19 - 1);
      }
      uVar19 = 0xffffffffffffffff;
      psVar23 = psVar17;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar1 = *psVar23;
        psVar23 = psVar23 + 1;
      } while (sVar1 != 0);
      if (5 < ~uVar19 - 1) {
        FUN_1400015e0(local_310,&local_438,0,0xffffffffffffffff);
        uVar19 = 0xffffffffffffffff;
        psVar23 = psVar17;
        do {
          if (uVar19 == 0) break;
          uVar19 = uVar19 - 1;
          sVar1 = *psVar23;
          psVar23 = psVar23 + 1;
        } while (sVar1 != 0);
        FUN_140002aa0(local_310,psVar17,~uVar19 - 1);
      }
      uVar6 = FUN_1402970c0(lVar8,L"fPushWeight");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_1402967b0(lVar8,uVar2,uVar6,L"fPushWeight");
      local_3c0 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"fPushDuration");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_1402967b0(lVar8,uVar2,uVar6,L"fPushDuration");
      local_3bc = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"fAttackDelay");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_1402967b0(lVar8,uVar2,uVar6,L"fAttackDelay");
      local_3b8 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"nDurability");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nDurability");
      local_3d0 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,&DAT_1404d27b0);
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,&DAT_1404d27b0);
      local_3cc = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"nAmorDurabiltyDecrease");
      local_498 = 1;
      puVar16 = (undefined4 *)FUN_140296600(lVar8,uVar2,uVar6,L"nAmorDurabiltyDecrease");
      local_3c8 = *puVar16;
      uVar6 = FUN_1402970c0(lVar8,L"szShootID");
      local_498 = 0;
      lVar20 = FUN_140296990(lVar8,uVar2,uVar6,L"szShootID");
      ppwVar4 = local_248;
      if (lVar20 != 0) {
        if (local_248 != local_240) {
          memmove(local_248,local_240,0);
          local_240 = ppwVar4;
        }
        uVar5 = 0;
        local_460 = (wchar_t *)0x0;
        local_458 = (wchar_t *)0x0;
        local_450 = 0;
        FUN_140415930(&local_460,lVar20,&DAT_14049c7b8);
        pwVar14 = local_458;
        lVar20 = (longlong)local_458 - (longlong)local_460 >> 0x3f;
        lVar24 = ((longlong)local_458 - (longlong)local_460) / 0x28 + lVar20;
        pwVar11 = local_460;
        if (lVar24 != lVar20) {
          do {
            pwVar12 = pwVar11;
            if (7 < *(ulonglong *)(pwVar11 + 0xc)) {
              pwVar12 = *(wchar_t **)pwVar11;
            }
            iVar7 = _wtoi(pwVar12);
            local_488 = (wchar_t *)CONCAT44(local_488._4_4_,iVar7);
            if ((&local_488 < local_240) && (local_248 <= &local_488)) {
              lVar22 = (longlong)&local_488 - (longlong)local_248;
              if (local_240 == local_238) {
                uVar19 = (longlong)local_240 - (longlong)local_248 >> 2;
                if (0x3ffffffffffffffe < uVar19) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar3 = (code *)swi(3);
                  (*pcVar3)();
                  return;
                }
                uVar19 = uVar19 + 1;
                uVar21 = (longlong)local_238 - (longlong)local_248 >> 2;
                if (uVar21 < uVar19) {
                  if (0x3fffffffffffffff - (uVar21 >> 1) < uVar21) {
                    uVar21 = 0;
                  }
                  else {
                    uVar21 = uVar21 + (uVar21 >> 1);
                  }
                  if (uVar21 < uVar19) {
                    uVar21 = uVar19;
                  }
                  FUN_140051e60(&local_248,uVar21);
                }
              }
              if (local_240 != (wchar_t **)0x0) {
                *(int *)local_240 = *(int *)((longlong)local_248 + (lVar22 >> 2) * 4);
              }
            }
            else {
              if (local_240 == local_238) {
                uVar19 = (longlong)local_240 - (longlong)local_248 >> 2;
                if (0x3ffffffffffffffe < uVar19) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_140330547;
                }
                uVar19 = uVar19 + 1;
                uVar21 = (longlong)local_238 - (longlong)local_248 >> 2;
                if (uVar21 < uVar19) {
                  if (0x3fffffffffffffff - (uVar21 >> 1) < uVar21) {
                    uVar21 = 0;
                  }
                  else {
                    uVar21 = uVar21 + (uVar21 >> 1);
                  }
                  if (uVar21 < uVar19) {
                    uVar21 = uVar19;
                  }
                  FUN_140051e60(&local_248,uVar21);
                }
              }
              if (local_240 != (wchar_t **)0x0) {
                *(int *)local_240 = iVar7;
              }
            }
            local_240 = (wchar_t **)((longlong)local_240 + 4);
            uVar5 = uVar5 + 1;
            pwVar11 = pwVar11 + 0x14;
          } while ((ulonglong)uVar5 < (ulonglong)(lVar24 - lVar20));
        }
        pwVar12 = local_460;
        pwVar11 = local_460;
        if (local_460 != (wchar_t *)0x0) {
          for (; pwVar11 != pwVar14; pwVar11 = pwVar11 + 0x14) {
            if (7 < *(ulonglong *)(pwVar11 + 0xc)) {
              operator_delete(*(void **)pwVar11);
            }
            pwVar11[0xc] = L'\a';
            pwVar11[0xd] = L'\0';
            pwVar11[0xe] = L'\0';
            pwVar11[0xf] = L'\0';
            pwVar11[8] = L'\0';
            pwVar11[9] = L'\0';
            pwVar11[10] = L'\0';
            pwVar11[0xb] = L'\0';
            *pwVar11 = L'\0';
          }
          operator_delete(pwVar12);
        }
      }
      puVar16 = (undefined4 *)FUN_1403310e0(local_228,local_478,&local_408);
      FUN_140330f00(*puVar16);
      FUN_140330590(local_220);
      FUN_140330590(&local_408);
      puVar16 = *(undefined4 **)(local_480 + 6);
      if (puVar16 == (undefined4 *)0x0) {
        puVar16 = (undefined4 *)0x0;
        uVar5 = (uint)local_480[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar20 = (longlong)(int)uVar5 << 3;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar5) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar20) != 0) {
            puVar16 = *(undefined4 **)(*(longlong *)(lVar8 + 0x68) + lVar20);
          }
          uVar5 = uVar5 + 1;
          lVar20 = lVar20 + 8;
        } while (puVar16 == (undefined4 *)0x0);
      }
      goto LAB_14032f87b;
    }
LAB_140330547:
    if (7 < local_420) {
      operator_delete((void *)CONCAT62(uStack_436,local_438));
    }
  }
  return;
}



void FUN_140330590(longlong param_1)

{
  if (*(void **)(param_1 + 0x1c0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x1c0));
  }
  *(undefined8 *)(param_1 + 0x1c0) = 0;
  *(undefined8 *)(param_1 + 0x1c8) = 0;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1b0)) {
    operator_delete(*(void **)(param_1 + 0x198));
  }
  *(undefined8 *)(param_1 + 0x1b0) = 7;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  *(undefined2 *)(param_1 + 0x198) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x188)) {
    operator_delete(*(void **)(param_1 + 0x170));
  }
  *(undefined8 *)(param_1 + 0x188) = 7;
  *(undefined8 *)(param_1 + 0x180) = 0;
  *(undefined2 *)(param_1 + 0x170) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x160)) {
    operator_delete(*(void **)(param_1 + 0x148));
  }
  *(undefined8 *)(param_1 + 0x160) = 7;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined2 *)(param_1 + 0x148) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x138)) {
    operator_delete(*(void **)(param_1 + 0x120));
  }
  *(undefined8 *)(param_1 + 0x138) = 7;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 0x120) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x110)) {
    operator_delete(*(void **)(param_1 + 0xf8));
  }
  *(undefined8 *)(param_1 + 0x110) = 7;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined2 *)(param_1 + 0xf8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xe8)) {
    operator_delete(*(void **)(param_1 + 0xd0));
  }
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xc0)) {
    operator_delete(*(void **)(param_1 + 0xa8));
  }
  *(undefined8 *)(param_1 + 0xc0) = 7;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x98)) {
    operator_delete(*(void **)(param_1 + 0x80));
  }
  *(undefined8 *)(param_1 + 0x98) = 7;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined2 *)(param_1 + 0x80) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  return;
}



void FUN_140330780(longlong param_1)

{
  FUN_140330590(param_1 + 8);
  return;
}



undefined8 * FUN_140330790(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetGimmickTemplateDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf04 & 1) == 0) {
    DAT_14060cf04 = DAT_14060cf04 | 1;
    FUN_140330e30(0x3f400000,0x3e800000,0x40100000);
    FUN_14032f780();
    atexit((_func_5014 *)&LAB_1404491a0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetGimmickTemplateDB",uVar3,pcVar4
                  ,DVar5);
  }
  return &DAT_140608310;
}



void thunk_FUN_1403313a0(void)

{
  FUN_1403313a0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140330850(void)

{
  undefined4 uVar1;
  uint uVar2;
  undefined4 uVar3;
  longlong lVar4;
  ulonglong uVar5;
  undefined4 *puVar6;
  longlong lVar7;
  longlong *plVar8;
  undefined8 *puVar9;
  int iVar10;
  undefined4 *puVar11;
  undefined1 auStack_b8 [32];
  undefined1 local_98;
  undefined8 local_88;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined8 local_6c;
  undefined8 local_64;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 auStack_54 [5];
  ulonglong local_40;
  ulonglong local_28;
  
  local_88 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"GIMMICK_LURE");
  if (lVar4 != 0) {
    if (*(longlong *)(lVar4 + 0x70) != 0) {
      uVar5 = 0;
      if (*(uint *)(lVar4 + 0x78) != 0) {
        plVar8 = *(longlong **)(lVar4 + 0x68);
        do {
          if (*plVar8 != 0) {
            puVar6 = (undefined4 *)(*(longlong **)(lVar4 + 0x68))[uVar5];
            goto LAB_1403308e0;
          }
          uVar2 = (int)uVar5 + 1;
          uVar5 = (ulonglong)uVar2;
          plVar8 = plVar8 + 1;
        } while (uVar2 < *(uint *)(lVar4 + 0x78));
      }
    }
    puVar6 = (undefined4 *)0x0;
LAB_1403308e0:
    puVar11 = puVar6;
    if (puVar11 != (undefined4 *)0x0) {
      uVar1 = *puVar11;
      local_6c = 0;
      local_64 = 0;
      local_5c = 0;
      local_80 = uVar1;
      uVar3 = FUN_1402970c0(lVar4,L"nType");
      local_98 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nType");
      local_7c = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"fCheckDelay");
      local_98 = 1;
      puVar6 = (undefined4 *)FUN_1402967b0(lVar4,uVar1,uVar3,L"fCheckDelay");
      local_78 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"nLurePriority");
      local_98 = 1;
      puVar6 = (undefined4 *)FUN_140296600(lVar4,uVar1,uVar3,L"nLurePriority");
      local_74 = *puVar6;
      uVar3 = FUN_1402970c0(lVar4,L"fMinLength");
      local_98 = 1;
      puVar6 = (undefined4 *)FUN_1402967b0(lVar4,uVar1,uVar3,L"fMinLength");
      local_70 = *puVar6;
      iVar10 = 0;
      puVar9 = &local_6c;
      do {
        FUN_1404154c0(&local_58,L"fEnemyType%02d",iVar10);
        puVar6 = &local_58;
        if (7 < local_40) {
          puVar6 = (undefined4 *)CONCAT44(auStack_54[0],local_58);
        }
        uVar3 = FUN_1402970c0(lVar4,puVar6);
        local_98 = 1;
        puVar6 = (undefined4 *)FUN_1402967b0(lVar4,uVar1,uVar3,puVar6);
        *(undefined4 *)puVar9 = *puVar6;
        if (7 < local_40) {
          operator_delete((void *)CONCAT44(auStack_54[0],local_58));
        }
        iVar10 = iVar10 + 1;
        puVar9 = (undefined8 *)((longlong)puVar9 + 4);
      } while (iVar10 < 5);
      local_58 = uVar1;
      memcpy(auStack_54,&local_80,0x28);
      FUN_1403311e0(uVar1);
      puVar6 = *(undefined4 **)(puVar11 + 6);
      if (puVar6 == (undefined4 *)0x0) {
        uVar2 = (uint)puVar11[8] % *(uint *)(lVar4 + 0x78) + 1;
        lVar7 = (longlong)(int)uVar2 << 3;
        do {
          if (*(uint *)(lVar4 + 0x78) <= uVar2) break;
          if (*(longlong *)(lVar7 + *(longlong *)(lVar4 + 0x68)) != 0) {
            puVar6 = *(undefined4 **)(lVar7 + *(longlong *)(lVar4 + 0x68));
          }
          uVar2 = uVar2 + 1;
          lVar7 = lVar7 + 8;
        } while (puVar6 == (undefined4 *)0x0);
      }
      goto LAB_1403308e0;
    }
  }
  return;
}



undefined8 * FUN_140330ad0(void)

{
  DWORD DVar1;
  DWORD DVar2;
  undefined8 uVar3;
  char *pcVar4;
  DWORD DVar5;
  
  uVar3 = 0xfffffffffffffffe;
  pcVar4 = "GetGimmickLureDB";
  DVar1 = timeGetTime();
  DVar5 = DVar1;
  if ((DAT_14060cf00 & 1) == 0) {
    DAT_14060cf00 = DAT_14060cf00 | 1;
    FUN_140331110(0x3f400000,0x3e800000,0x40100000);
    FUN_140330850();
    atexit((_func_5014 *)&LAB_1404491b0);
  }
  DVar2 = timeGetTime();
  if (0x32 < DVar2 - DVar1) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar2 - DVar1,"GetGimmickLureDB",uVar3,pcVar4,
                  DVar5);
  }
  return &DAT_1406082c0;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140330b80(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060837c = param_3;
  lVar1 = 0;
  DAT_140608370 = 0x11;
  DAT_140608394 = 10;
  _DAT_140608374 = param_1;
  _DAT_140608378 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608360 = 0;
  DAT_140608368 = 0;
  DAT_140608390 = 0;
  DAT_140608398 = 0;
  DAT_1406083a0 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608380 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608388 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608388 = 0;
  }
  return &DAT_140608360;
}



uint * FUN_140330c50(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608370;
  if (DAT_140608360 == 0) {
    cVar2 = FUN_1403316b0((ulonglong)DAT_140608370,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608360 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x3a)) {
      if ((puVar3[0x3c] == param_1) && (*puVar3 == param_1)) {
        FUN_1403313c0(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140332280(param_1,uVar1,param_1);
  FUN_1403313c0(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140330d10(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608390 = DAT_140608390 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608360;
  if ((DAT_140608360 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608370, DAT_140608370 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0xe8);
        FUN_140331890(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608360;
        uVar4 = DAT_140608370;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608360 = (void *)0x0;
  DAT_140608368 = 0;
  if (DAT_140608390 == 0) {
    uVar5 = FUN_140331800(0);
    FUN_1403316b0(uVar5,0);
  }
  DAT_1406083a0 = 0;
  _Memory = DAT_140608398;
  if (DAT_140608398 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608398 = (longlong *)0x0;
    DAT_140608390 = DAT_140608390 + -1;
    return;
  }
  DAT_140608390 = DAT_140608390 + -1;
  return;
}



void FUN_140330e10(void)

{
  FUN_140330d10();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140330e30(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_14060832c = param_3;
  lVar1 = 0;
  DAT_140608320 = 0x11;
  DAT_140608344 = 10;
  _DAT_140608324 = param_1;
  _DAT_140608328 = param_2;
  param_3 = param_3 * 17.0;
  DAT_140608310 = 0;
  DAT_140608318 = 0;
  DAT_140608340 = 0;
  DAT_140608348 = 0;
  DAT_140608350 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_140608330 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_140608338 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_140608338 = 0;
  }
  return &DAT_140608310;
}



uint * FUN_140330f00(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_140608320;
  if (DAT_140608310 == 0) {
    cVar2 = FUN_1403319e0((ulonglong)DAT_140608320,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_140608310 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0x7a)) {
      if ((puVar3[0x7c] == param_1) && (*puVar3 == param_1)) {
        FUN_140331470(puVar3 + 2,param_2);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_140332650(param_1,uVar1,param_1);
  FUN_140331470(puVar3 + 2,param_2);
  return puVar3;
}



void FUN_140330fc0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_140608340 = DAT_140608340 + 1;
  uVar7 = 0;
  pvVar6 = DAT_140608310;
  if ((DAT_140608310 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_140608320, DAT_140608320 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x1e8);
        FUN_140331bc0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_140608310;
        uVar4 = DAT_140608320;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_140608310 = (void *)0x0;
  DAT_140608318 = 0;
  if (DAT_140608340 == 0) {
    uVar5 = FUN_140331b30(0);
    FUN_1403319e0(uVar5,0);
  }
  DAT_140608350 = 0;
  _Memory = DAT_140608348;
  if (DAT_140608348 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_140608348 = (longlong *)0x0;
    DAT_140608340 = DAT_140608340 + -1;
    return;
  }
  DAT_140608340 = DAT_140608340 + -1;
  return;
}



void FUN_1403310c0(void)

{
  FUN_140330fc0();
  return;
}



undefined4 * FUN_1403310e0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140332b30(param_1 + 2,param_3);
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140331110(undefined4 param_1,float param_2,float param_3)

{
  longlong lVar1;
  longlong lVar2;
  
  _DAT_1406082dc = param_3;
  lVar1 = 0;
  DAT_1406082d0 = 0x11;
  DAT_1406082f4 = 10;
  _DAT_1406082d4 = param_1;
  _DAT_1406082d8 = param_2;
  param_3 = param_3 * 17.0;
  DAT_1406082c0 = 0;
  DAT_1406082c8 = 0;
  DAT_1406082f0 = 0;
  DAT_1406082f8 = 0;
  DAT_140608300 = 0;
  if ((9.223372e+18 < param_3) && (param_3 = param_3 - 9.223372e+18, param_3 < 9.223372e+18)) {
    lVar1 = -0x8000000000000000;
  }
  param_2 = param_2 * 17.0;
  lVar2 = 0;
  DAT_1406082e0 = (longlong)param_3 + lVar1;
  if ((9.223372e+18 < param_2) && (param_2 = param_2 - 9.223372e+18, param_2 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  DAT_1406082e8 = (longlong)param_2 + lVar2;
  if ((ulonglong)((longlong)param_2 + lVar2) < 0x11) {
    DAT_1406082e8 = 0;
  }
  return &DAT_1406082c0;
}



uint * FUN_1403311e0(uint param_1,void *param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  char cVar2;
  uint *puVar3;
  
  uVar1 = (ulonglong)param_1 % (ulonglong)DAT_1406082d0;
  if (DAT_1406082c0 == 0) {
    cVar2 = FUN_140331cf0((ulonglong)DAT_1406082d0,CONCAT71((int7)(uVar1 >> 8),1),param_3,param_4,
                          0xfffffffffffffffe);
    if (cVar2 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar3 = *(uint **)(DAT_1406082c0 + uVar1 * 8); puVar3 != (uint *)0x0;
        puVar3 = *(uint **)(puVar3 + 0xc)) {
      if ((puVar3[0xe] == param_1) && (*puVar3 == param_1)) {
        memcpy(puVar3 + 1,param_2,0x28);
        return puVar3;
      }
    }
  }
  puVar3 = (uint *)FUN_1403329b0(param_1,uVar1,param_1);
  memcpy(puVar3 + 1,param_2,0x28);
  return puVar3;
}



void FUN_1403312a0(void)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  uint uVar4;
  undefined4 uVar5;
  void *pvVar6;
  longlong *_Memory;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  
  DAT_1406082f0 = DAT_1406082f0 + 1;
  uVar7 = 0;
  pvVar6 = DAT_1406082c0;
  if ((DAT_1406082c0 != (void *)0x0) && (uVar9 = uVar7, uVar4 = DAT_1406082d0, DAT_1406082d0 != 0))
  {
    do {
      lVar3 = *(longlong *)(uVar7 + (longlong)pvVar6);
      while (lVar3 != 0) {
        lVar1 = *(longlong *)(lVar3 + 0x30);
        FUN_140331ed0(lVar3);
        lVar3 = lVar1;
        pvVar6 = DAT_1406082c0;
        uVar4 = DAT_1406082d0;
      }
      uVar8 = (int)uVar9 + 1;
      uVar7 = uVar7 + 8;
      uVar9 = (ulonglong)uVar8;
    } while (uVar8 < uVar4);
  }
  operator_delete__(pvVar6);
  DAT_1406082c0 = (void *)0x0;
  DAT_1406082c8 = 0;
  if (DAT_1406082f0 == 0) {
    uVar5 = FUN_140331e40(0);
    FUN_140331cf0(uVar5,0);
  }
  DAT_140608300 = 0;
  _Memory = DAT_1406082f8;
  if (DAT_1406082f8 != (longlong *)0x0) {
    do {
      plVar2 = (longlong *)*_Memory;
      free(_Memory);
      _Memory = plVar2;
    } while (plVar2 != (longlong *)0x0);
    DAT_1406082f8 = (longlong *)0x0;
    DAT_1406082f0 = DAT_1406082f0 + -1;
    return;
  }
  DAT_1406082f0 = DAT_1406082f0 + -1;
  return;
}



void FUN_1403313a0(void)

{
  FUN_1403312a0();
  return;
}



undefined4 * FUN_1403313c0(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];
  FUN_1400015e0(param_1 + 6,param_2 + 6,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x10,param_2 + 0x10,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1a,param_2 + 0x1a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x24,param_2 + 0x24,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x2e,param_2 + 0x2e,0,0xffffffffffffffff);
  return param_1;
}



undefined4 * FUN_140331470(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];
  param_1[5] = param_2[5];
  param_1[6] = param_2[6];
  param_1[7] = param_2[7];
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x20,param_2 + 0x20,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x2a,param_2 + 0x2a,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x34,param_2 + 0x34,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x3e,param_2 + 0x3e,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x48,param_2 + 0x48,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x52,param_2 + 0x52,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x5c,param_2 + 0x5c,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x66,param_2 + 0x66,0,0xffffffffffffffff);
  FUN_14012bb70(param_1 + 0x70,param_2 + 0x70);
  return param_1;
}



void FUN_140331610(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0xf0) % (ulonglong)DAT_140608370;
  if (param_1 != *(longlong *)(DAT_140608360 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608360 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0xe8); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0xe8))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0xe8) = *(undefined8 *)(param_1 + 0xe8);
      FUN_140331890(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608360 + uVar2 * 8) = *(undefined8 *)(param_1 + 0xe8);
  FUN_140331890(param_1);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_1403316b0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608360 != (void *)0x0) {
    operator_delete__(DAT_140608360);
    DAT_140608360 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608360 = operator_new(_Var1);
    if (DAT_140608360 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608360,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060837c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608378;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608388 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608388 = 0;
  }
  DAT_140608380 = (longlong)fVar4 + lVar2;
  DAT_140608370 = param_1;
  return CONCAT71((int7)(DAT_140608388 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_140331800(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608374;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_140331890(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_14032f580(param_1 + 8);
    *(longlong *)(param_1 + 0xe8) = DAT_1406083a0;
    DAT_140608368 = DAT_140608368 - 1;
    DAT_1406083a0 = param_1;
    if ((DAT_140608368 < DAT_140608388) && (DAT_140608390 == 0)) {
      uVar2 = FUN_140331800(DAT_140608368);
      FUN_1403320a0(uVar2);
    }
    if ((DAT_140608368 == 0) &&
       (DAT_1406083a0 = 0, _Memory = DAT_140608398, DAT_140608398 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608398 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_140331940(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x1f0) % (ulonglong)DAT_140608320;
  if (param_1 != *(longlong *)(DAT_140608310 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_140608310 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x1e8); lVar3 != param_1;
        lVar3 = *(longlong *)(lVar3 + 0x1e8)) {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x1e8) = *(undefined8 *)(param_1 + 0x1e8);
      FUN_140331bc0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_140608310 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x1e8);
  FUN_140331bc0(param_1);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_1403319e0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_140608310 != (void *)0x0) {
    operator_delete__(DAT_140608310);
    DAT_140608310 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_140608310 = operator_new(_Var1);
    if (DAT_140608310 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_140608310,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_14060832c;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_140608328;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_140608338 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_140608338 = 0;
  }
  DAT_140608330 = (longlong)fVar4 + lVar2;
  DAT_140608320 = param_1;
  return CONCAT71((int7)(DAT_140608338 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_140331b30(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_140608324;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_140331bc0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    FUN_140330590(param_1 + 8);
    *(longlong *)(param_1 + 0x1e8) = DAT_140608350;
    DAT_140608318 = DAT_140608318 - 1;
    DAT_140608350 = param_1;
    if ((DAT_140608318 < DAT_140608338) && (DAT_140608340 == 0)) {
      uVar2 = FUN_140331b30(DAT_140608318);
      FUN_140332470(uVar2);
    }
    if ((DAT_140608318 == 0) &&
       (DAT_140608350 = 0, _Memory = DAT_140608348, DAT_140608348 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_140608348 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_140331c70(longlong param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  longlong lVar3;
  
  if (param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar2 = (ulonglong)*(uint *)(param_1 + 0x38) % (ulonglong)DAT_1406082d0;
  if (param_1 != *(longlong *)(DAT_1406082c0 + uVar2 * 8)) {
    lVar1 = *(longlong *)(DAT_1406082c0 + uVar2 * 8);
    for (lVar3 = *(longlong *)(lVar1 + 0x30); lVar3 != param_1; lVar3 = *(longlong *)(lVar3 + 0x30))
    {
      lVar1 = lVar3;
    }
    if (lVar1 != 0) {
      *(undefined8 *)(lVar1 + 0x30) = *(undefined8 *)(param_1 + 0x30);
      FUN_140331ed0(param_1);
      return;
    }
  }
  *(undefined8 *)(DAT_1406082c0 + uVar2 * 8) = *(undefined8 *)(param_1 + 0x30);
  FUN_140331ed0(param_1);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_140331cf0(uint param_1,char param_2)

{
  __uint64 _Var1;
  longlong lVar2;
  longlong lVar3;
  float fVar4;
  float fVar5;
  
  if (DAT_1406082c0 != (void *)0x0) {
    operator_delete__(DAT_1406082c0);
    DAT_1406082c0 = (void *)0x0;
  }
  if (param_2 != '\0') {
    _Var1 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
    if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
      _Var1 = 0xffffffffffffffff;
    }
    DAT_1406082c0 = operator_new(_Var1);
    if (DAT_1406082c0 == (void *)0x0) {
      return 0;
    }
    if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    memset(DAT_1406082c0,0,(ulonglong)param_1 << 3);
  }
  fVar4 = (float)param_1 * _DAT_1406082dc;
  lVar2 = 0;
  if ((9.223372e+18 < fVar4) && (fVar4 = fVar4 - 9.223372e+18, fVar4 < 9.223372e+18)) {
    lVar2 = -0x8000000000000000;
  }
  fVar5 = (float)param_1 * _DAT_1406082d8;
  lVar3 = 0;
  if ((9.223372e+18 < fVar5) && (fVar5 = fVar5 - 9.223372e+18, fVar5 < 9.223372e+18)) {
    lVar3 = -0x8000000000000000;
  }
  DAT_1406082e8 = (longlong)fVar5 + lVar3;
  if ((ulonglong)((longlong)fVar5 + lVar3) < 0x11) {
    DAT_1406082e8 = 0;
  }
  DAT_1406082e0 = (longlong)fVar4 + lVar2;
  DAT_1406082d0 = param_1;
  return CONCAT71((int7)(DAT_1406082e8 >> 8),1);
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

uint FUN_140331e40(longlong param_1)

{
  uint uVar1;
  longlong lVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  float fVar6;
  
  fVar6 = (float)param_1;
  if (param_1 < 0) {
    fVar6 = fVar6 + 1.8446744e+19;
  }
  fVar6 = fVar6 / _DAT_1406082d4;
  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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



void FUN_140331ed0(longlong param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong *_Memory;
  
  if (param_1 != 0) {
    *(longlong *)(param_1 + 0x30) = DAT_140608300;
    DAT_1406082c8 = DAT_1406082c8 - 1;
    DAT_140608300 = param_1;
    if ((DAT_1406082c8 < DAT_1406082e8) && (DAT_1406082f0 == 0)) {
      uVar2 = FUN_140331e40(DAT_1406082c8);
      FUN_1403327d0(uVar2);
    }
    if ((DAT_1406082c8 == 0) &&
       (DAT_140608300 = 0, _Memory = DAT_1406082f8, DAT_1406082f8 != (longlong *)0x0)) {
      do {
        plVar1 = (longlong *)*_Memory;
        free(_Memory);
        _Memory = plVar1;
      } while (plVar1 != (longlong *)0x0);
      DAT_1406082f8 = (longlong *)0x0;
    }
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



undefined4 * FUN_140331f80(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_1400015e0(param_1 + 6,param_2 + 6,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x16) = 7;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  FUN_1400015e0(param_1 + 0x10,param_2 + 0x10,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x1e) = 0;
  *(undefined2 *)(param_1 + 0x1a) = 0;
  FUN_1400015e0(param_1 + 0x1a,param_2 + 0x1a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x2a) = 7;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined2 *)(param_1 + 0x24) = 0;
  FUN_1400015e0(param_1 + 0x24,param_2 + 0x24,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x34) = 7;
  *(undefined8 *)(param_1 + 0x32) = 0;
  *(undefined2 *)(param_1 + 0x2e) = 0;
  FUN_1400015e0(param_1 + 0x2e,param_2 + 0x2e,0,0xffffffffffffffff);
  return param_1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403320a0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140331800(DAT_140608368,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608370) {
    if (DAT_140608360 == (void *)0x0) {
      FUN_1403316b0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608370;
      if (DAT_140608370 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608360);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0xe8);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0xf0) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0xe8) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608370;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608360);
      fVar10 = (float)param_1 * _DAT_14060837c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608380 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608378;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608360 = _Dst;
      DAT_140608370 = param_1;
      DAT_140608388 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608388 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_140332280(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_1406083a0 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608394);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0xf8)
      goto LAB_140332351;
      lVar8 = uVar7 * 0xf8;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140332351:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608398;
    puVar4 = puVar6 + (ulonglong)(DAT_140608394 - 1) * 0x1f + 2;
    DAT_140608398 = puVar6;
    uVar2 = DAT_140608394;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x1d] = DAT_1406083a0;
      puVar4 = puVar6 + -0x1f;
      DAT_1406083a0 = puVar6;
    }
  }
  puVar6 = DAT_1406083a0;
  if (DAT_1406083a0 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_1406083a0[0x1d];
  *(undefined4 *)DAT_1406083a0 = param_1;
  DAT_1406083a0 = (undefined8 *)uVar3;
  puVar6[1] = 0;
  puVar6[2] = 0;
  *(undefined4 *)(puVar6 + 3) = 0;
  puVar6[7] = 7;
  puVar6[6] = 0;
  *(undefined2 *)(puVar6 + 4) = 0;
  puVar6[0xc] = 7;
  puVar6[0xb] = 0;
  *(undefined2 *)(puVar6 + 9) = 0;
  puVar6[0x11] = 7;
  puVar6[0x10] = 0;
  *(undefined2 *)(puVar6 + 0xe) = 0;
  puVar6[0x16] = 7;
  puVar6[0x15] = 0;
  *(undefined2 *)(puVar6 + 0x13) = 0;
  puVar6[0x1b] = 7;
  puVar6[0x1a] = 0;
  *(undefined2 *)(puVar6 + 0x18) = 0;
  *(undefined4 *)(puVar6 + 0x1e) = param_3;
  DAT_140608368 = DAT_140608368 + 1;
  puVar6[0x1d] = *(undefined8 *)(DAT_140608360 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608360 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608380 < DAT_140608368) && (DAT_140608390 == 0)) {
    uVar5 = FUN_140331800();
    FUN_1403320a0(uVar5);
  }
  return puVar6;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140332470(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140331b30(DAT_140608318,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_140608320) {
    if (DAT_140608310 == (void *)0x0) {
      FUN_1403319e0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_140608320;
      if (DAT_140608320 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_140608310);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x1e8);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x1f0) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x1e8) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_140608320;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_140608310);
      fVar10 = (float)param_1 * _DAT_14060832c;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608330 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_140608328;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_140608310 = _Dst;
      DAT_140608320 = param_1;
      DAT_140608338 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_140608338 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_140332650(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608350 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_140608344);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x1f8)
      goto LAB_140332722;
      lVar8 = uVar7 * 0x1f8;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140332722:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_140608348;
    puVar4 = puVar6 + (ulonglong)(DAT_140608344 - 1) * 0x3f + 2;
    DAT_140608348 = puVar6;
    uVar2 = DAT_140608344;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[0x3d] = DAT_140608350;
      puVar4 = puVar6 + -0x3f;
      DAT_140608350 = puVar6;
    }
  }
  puVar6 = DAT_140608350;
  if (DAT_140608350 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608350[0x3d];
  *(undefined4 *)DAT_140608350 = param_1;
  DAT_140608350 = (undefined8 *)uVar3;
  FUN_140332d70(puVar6 + 1);
  *(undefined4 *)(puVar6 + 0x3e) = param_3;
  DAT_140608318 = DAT_140608318 + 1;
  puVar6[0x3d] = *(undefined8 *)(DAT_140608310 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_140608310 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_140608330 < DAT_140608318) && (DAT_140608340 == 0)) {
    uVar5 = FUN_140331b30();
    FUN_140332470(uVar5);
  }
  return puVar6;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403327d0(uint param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  ulonglong uVar2;
  __uint64 _Var3;
  void *_Dst;
  uint uVar4;
  longlong lVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  uint uVar8;
  ulonglong uVar9;
  float fVar10;
  
  uVar6 = 0;
  if (param_1 == 0) {
    param_1 = FUN_140331e40(DAT_1406082c8,param_2,param_3,param_4,0xfffffffffffffffe);
  }
  if (param_1 != DAT_1406082d0) {
    if (DAT_1406082c0 == (void *)0x0) {
      FUN_140331cf0(param_1,0);
    }
    else {
      _Var3 = SUB168(ZEXT816(8) * ZEXT416(param_1),0);
      if (SUB168(ZEXT816(8) * ZEXT416(param_1),8) != 0) {
        _Var3 = 0xffffffffffffffff;
      }
      _Dst = operator_new(_Var3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x8007000e);
      }
      if (0x1fffffff < param_1) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      memset(_Dst,0,(ulonglong)param_1 << 3);
      uVar7 = uVar6;
      uVar9 = uVar6;
      uVar4 = DAT_1406082d0;
      if (DAT_1406082d0 != 0) {
        do {
          lVar5 = *(longlong *)(uVar7 + (longlong)DAT_1406082c0);
          while (lVar5 != 0) {
            lVar1 = *(longlong *)(lVar5 + 0x30);
            uVar2 = (ulonglong)*(uint *)(lVar5 + 0x38) % (ulonglong)param_1;
            *(undefined8 *)(lVar5 + 0x30) = *(undefined8 *)((longlong)_Dst + uVar2 * 8);
            *(longlong *)((longlong)_Dst + uVar2 * 8) = lVar5;
            lVar5 = lVar1;
            uVar4 = DAT_1406082d0;
          }
          uVar8 = (int)uVar9 + 1;
          uVar7 = uVar7 + 8;
          uVar9 = (ulonglong)uVar8;
        } while (uVar8 < uVar4);
      }
      operator_delete__(DAT_1406082c0);
      fVar10 = (float)param_1 * _DAT_1406082dc;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406082e0 = (longlong)fVar10 + lVar5;
      fVar10 = (float)param_1 * _DAT_1406082d8;
      lVar5 = 0;
      if ((9.223372e+18 < fVar10) && (fVar10 = fVar10 - 9.223372e+18, fVar10 < 9.223372e+18)) {
        lVar5 = -0x8000000000000000;
      }
      DAT_1406082c0 = _Dst;
      DAT_1406082d0 = param_1;
      DAT_1406082e8 = (longlong)fVar10 + lVar5;
      if ((ulonglong)((longlong)fVar10 + lVar5) < 0x11) {
        DAT_1406082e8 = uVar6;
      }
    }
  }
  return;
}



undefined8 * FUN_1403329b0(undefined4 param_1,ulonglong param_2,undefined4 param_3)

{
  undefined1 auVar1 [16];
  uint uVar2;
  undefined8 uVar3;
  undefined8 *puVar4;
  undefined4 uVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  longlong lVar8;
  
  if (DAT_140608300 == (undefined8 *)0x0) {
    uVar7 = CONCAT44(0,DAT_1406082f4);
    if (uVar7 == 0) {
      lVar8 = 0;
    }
    else {
      auVar1._8_8_ = 0;
      auVar1._0_8_ = uVar7;
      if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xffffffffffffffff)) / auVar1,0) < 0x40)
      goto LAB_140332a79;
      lVar8 = uVar7 << 6;
    }
    if ((-lVar8 - 1U < 0x10) || (puVar6 = malloc(lVar8 + 0x10), puVar6 == (undefined8 *)0x0)) {
LAB_140332a79:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *puVar6 = DAT_1406082f8;
    puVar4 = puVar6 + (ulonglong)(DAT_1406082f4 - 1) * 8 + 2;
    DAT_1406082f8 = puVar6;
    uVar2 = DAT_1406082f4;
    while (puVar6 = puVar4, uVar2 = uVar2 - 1, -1 < (int)uVar2) {
      puVar6[6] = DAT_140608300;
      puVar4 = puVar6 + -8;
      DAT_140608300 = puVar6;
    }
  }
  puVar6 = DAT_140608300;
  if (DAT_140608300 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar3 = DAT_140608300[6];
  *(undefined4 *)DAT_140608300 = param_1;
  DAT_140608300 = (undefined8 *)uVar3;
  *(undefined8 *)((longlong)puVar6 + 4) = 0;
  *(undefined8 *)((longlong)puVar6 + 0xc) = 0;
  *(undefined8 *)((longlong)puVar6 + 0x14) = 0;
  *(undefined8 *)((longlong)puVar6 + 0x1c) = 0;
  *(undefined8 *)((longlong)puVar6 + 0x24) = 0;
  *(undefined4 *)(puVar6 + 7) = param_3;
  DAT_1406082c8 = DAT_1406082c8 + 1;
  puVar6[6] = *(undefined8 *)(DAT_1406082c0 + (param_2 & 0xffffffff) * 8);
  *(undefined8 **)(DAT_1406082c0 + (param_2 & 0xffffffff) * 8) = puVar6;
  if ((DAT_1406082e0 < DAT_1406082c8) && (DAT_1406082f0 == 0)) {
    uVar5 = FUN_140331e40();
    FUN_1403327d0(uVar5);
  }
  return puVar6;
}



undefined4 * FUN_140332b30(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];
  param_1[5] = param_2[5];
  *(undefined8 *)(param_1 + 6) = *(undefined8 *)(param_2 + 6);
  param_1[8] = param_2[8];
  param_1[9] = param_2[9];
  param_1[10] = param_2[10];
  param_1[0xb] = param_2[0xb];
  param_1[0xc] = param_2[0xc];
  param_1[0xd] = param_2[0xd];
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  param_1[0x10] = param_2[0x10];
  param_1[0x11] = param_2[0x11];
  param_1[0x12] = param_2[0x12];
  param_1[0x13] = param_2[0x13];
  param_1[0x14] = param_2[0x14];
  param_1[0x15] = param_2[0x15];
  *(undefined8 *)(param_1 + 0x1c) = 7;
  *(undefined8 *)(param_1 + 0x1a) = 0;
  *(undefined2 *)(param_1 + 0x16) = 0;
  FUN_1400015e0(param_1 + 0x16,param_2 + 0x16,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x26) = 7;
  *(undefined8 *)(param_1 + 0x24) = 0;
  *(undefined2 *)(param_1 + 0x20) = 0;
  FUN_1400015e0(param_1 + 0x20,param_2 + 0x20,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x30) = 7;
  *(undefined8 *)(param_1 + 0x2e) = 0;
  *(undefined2 *)(param_1 + 0x2a) = 0;
  FUN_1400015e0(param_1 + 0x2a,param_2 + 0x2a,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x3a) = 7;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined2 *)(param_1 + 0x34) = 0;
  FUN_1400015e0(param_1 + 0x34,param_2 + 0x34,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x44) = 7;
  *(undefined8 *)(param_1 + 0x42) = 0;
  *(undefined2 *)(param_1 + 0x3e) = 0;
  FUN_1400015e0(param_1 + 0x3e,param_2 + 0x3e,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x4e) = 7;
  *(undefined8 *)(param_1 + 0x4c) = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  FUN_1400015e0(param_1 + 0x48,param_2 + 0x48,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x58) = 7;
  *(undefined8 *)(param_1 + 0x56) = 0;
  *(undefined2 *)(param_1 + 0x52) = 0;
  FUN_1400015e0(param_1 + 0x52,param_2 + 0x52,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x62) = 7;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined2 *)(param_1 + 0x5c) = 0;
  FUN_1400015e0(param_1 + 0x5c,param_2 + 0x5c,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x6c) = 7;
  *(undefined8 *)(param_1 + 0x6a) = 0;
  *(undefined2 *)(param_1 + 0x66) = 0;
  FUN_1400015e0(param_1 + 0x66,param_2 + 0x66,0,0xffffffffffffffff);
  FUN_14012e520(param_1 + 0x70,param_2 + 0x70);
  return param_1;
}



undefined8 *
FUN_140332d70(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 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;
  param_1[0xe] = 7;
  param_1[0xd] = 0;
  *(undefined2 *)(param_1 + 0xb) = 0;
  param_1[0x13] = 7;
  param_1[0x12] = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  param_1[0x18] = 7;
  param_1[0x17] = 0;
  *(undefined2 *)(param_1 + 0x15) = 0;
  param_1[0x1d] = 7;
  param_1[0x1c] = 0;
  *(undefined2 *)(param_1 + 0x1a) = 0;
  param_1[0x22] = 7;
  param_1[0x21] = 0;
  *(undefined2 *)(param_1 + 0x1f) = 0;
  param_1[0x27] = 7;
  param_1[0x26] = 0;
  *(undefined2 *)(param_1 + 0x24) = 0;
  param_1[0x2c] = 7;
  param_1[0x2b] = 0;
  *(undefined2 *)(param_1 + 0x29) = 0;
  param_1[0x31] = 7;
  param_1[0x30] = 0;
  *(undefined2 *)(param_1 + 0x2e) = 0;
  param_1[0x36] = 7;
  param_1[0x35] = 0;
  *(undefined2 *)(param_1 + 0x33) = 0;
  param_1[0x38] = 0;
  param_1[0x39] = 0;
  param_1[0x3a] = 0;
  param_1[3] = 0;
  FUN_140001710(param_1 + 0x1a,&DAT_140477960,0,param_4,0xfffffffffffffffe);
  FUN_140001710(param_1 + 0x1f,&DAT_140477960,0);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140332ee0(longlong param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  int iVar3;
  int **ppiVar4;
  int **ppiVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 *puVar8;
  uint uVar9;
  undefined4 uVar10;
  longlong lVar11;
  int *piVar12;
  int *piVar13;
  undefined2 *puVar14;
  longlong lVar15;
  short *psVar16;
  undefined8 uVar17;
  ulonglong uVar18;
  longlong *plVar19;
  wchar_t *_Str;
  int *piVar20;
  undefined8 *puVar21;
  undefined1 auStack_308 [32];
  undefined1 local_2e8;
  int *local_2d8;
  longlong *local_2d0;
  int *local_2c8;
  int *local_2c0;
  longlong local_2b0;
  undefined8 *local_2a8;
  undefined8 *local_2a0;
  undefined8 local_298;
  undefined8 local_288;
  undefined2 local_280;
  undefined6 uStack_27e;
  undefined8 local_270;
  ulonglong local_268;
  int local_258;
  undefined1 local_248 [512];
  ulonglong local_48;
  
  local_288 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_308;
  uVar18 = 0xffffffffffffffff;
  psVar16 = param_2;
  do {
    if (uVar18 == 0) break;
    uVar18 = uVar18 - 1;
    sVar2 = *psVar16;
    psVar16 = psVar16 + 1;
  } while (sVar2 != 0);
  local_2b0 = param_1;
  FUN_140001710(param_1 + 8,param_2,~uVar18 - 1);
  lVar11 = FUN_1402933b0(DAT_140607ff0);
  uVar17 = 0;
  if (lVar11 != 0) {
    piVar20 = (int *)0x0;
    local_2c8 = piVar20;
    if ((*(longlong *)(lVar11 + 0x70) != 0) && (*(uint *)(lVar11 + 0x78) != 0)) {
      piVar13 = piVar20;
      plVar19 = *(longlong **)(lVar11 + 0x68);
      do {
        if (*plVar19 != 0) {
          local_2c8 = (int *)(*(longlong **)(lVar11 + 0x68))[(longlong)piVar13];
          break;
        }
        uVar9 = (int)piVar13 + 1;
        piVar13 = (int *)(ulonglong)uVar9;
        plVar19 = plVar19 + 1;
      } while (uVar9 < *(uint *)(lVar11 + 0x78));
    }
LAB_140332f91:
    local_2c0 = local_2c8;
    if (local_2c8 != (int *)0x0) {
      iVar3 = *local_2c8;
      piVar13 = local_2c8;
      if (iVar3 != 0) {
        piVar12 = operator_new(0x68);
        piVar13 = piVar20;
        if (piVar12 != (int *)0x0) {
          piVar12[10] = 0;
          piVar12[0xb] = 0;
          piVar12[0xc] = 0;
          piVar12[0xd] = 0;
          piVar12[0xe] = 0;
          piVar12[0xf] = 0;
          piVar12[0x12] = 0;
          piVar12[0x13] = 0;
          piVar12[0x14] = 0;
          piVar12[0x15] = 0;
          piVar12[0x16] = 0;
          piVar12[0x17] = 0;
          piVar13 = piVar12;
        }
        local_2d8 = piVar13;
        FUN_140333840(&local_2d0,piVar13);
        FUN_140178e90(&local_2d8,piVar13,piVar13);
        uVar10 = FUN_1402970c0(lVar11,&DAT_14049f290);
        local_2e8 = 1;
        piVar13 = (int *)FUN_140296600(lVar11,iVar3,uVar10,&DAT_14049f290);
        local_2d8[1] = *piVar13;
        local_2d8[2] = 0;
        uVar10 = FUN_1402970c0(lVar11,L"nComboType");
        local_2e8 = 0;
        piVar13 = (int *)FUN_140296600(lVar11,iVar3,uVar10,L"nComboType");
        if (piVar13 != (int *)0x0) {
          local_2d8[2] = *piVar13;
        }
        local_2d8[3] = 0;
        uVar10 = FUN_1402970c0(lVar11,L"nFixDirect");
        local_2e8 = 0;
        piVar13 = (int *)FUN_140296600(lVar11,iVar3,uVar10,L"nFixDirect");
        if (piVar13 != (int *)0x0) {
          local_2d8[3] = *piVar13;
        }
        uVar10 = FUN_1402970c0(lVar11,L"fMinAttackRange");
        local_2e8 = 1;
        piVar13 = (int *)FUN_1402967b0(lVar11,iVar3,uVar10,L"fMinAttackRange");
        local_2d8[5] = *piVar13;
        uVar10 = FUN_1402970c0(lVar11,L"fAttackRange");
        local_2e8 = 1;
        piVar13 = (int *)FUN_1402967b0(lVar11,iVar3,uVar10,L"fAttackRange");
        local_2d8[6] = *piVar13;
        uVar10 = FUN_1402970c0(lVar11,L"fPriority");
        local_2e8 = 1;
        piVar13 = (int *)FUN_1402967b0(lVar11,iVar3,uVar10,L"fPriority");
        local_2d8[4] = *piVar13;
        local_2d8[7] = 0;
        uVar10 = FUN_1402970c0(lVar11,L"fChaseTime");
        local_2e8 = 0;
        piVar13 = (int *)FUN_1402967b0(lVar11,iVar3,uVar10,L"fChaseTime");
        if (piVar13 != (int *)0x0) {
          local_2d8[7] = *piVar13;
        }
        local_2d8[8] = 0;
        uVar10 = FUN_1402970c0(lVar11,L"fCoolTime");
        local_2e8 = 0;
        piVar13 = (int *)FUN_1402967b0(lVar11,iVar3,uVar10,L"fCoolTime");
        if (piVar13 != (int *)0x0) {
          local_2d8[8] = *piVar13;
        }
        *(undefined2 *)local_2d8 = 0;
        uVar10 = FUN_1402970c0(lVar11,L"nPetLevelMin");
        local_2e8 = 0;
        puVar14 = (undefined2 *)FUN_140296600(lVar11,iVar3,uVar10,L"nPetLevelMin");
        if (puVar14 != (undefined2 *)0x0) {
          *(undefined2 *)local_2d8 = *puVar14;
        }
        *(undefined2 *)((longlong)local_2d8 + 2) = 0;
        uVar10 = FUN_1402970c0(lVar11,L"nPetLevelMax");
        local_2e8 = 0;
        puVar14 = (undefined2 *)FUN_140296600(lVar11,iVar3,uVar10,L"nPetLevelMax");
        if (puVar14 != (undefined2 *)0x0) {
          *(undefined2 *)((longlong)local_2d8 + 2) = *puVar14;
        }
        uVar10 = FUN_1402970c0(lVar11,L"szTargetMotion");
        local_2e8 = 1;
        lVar15 = FUN_140296990(lVar11,iVar3,uVar10,L"szTargetMotion");
        piVar13 = piVar20;
        if (lVar15 != 0) {
          FUN_140415b90(local_2d8 + 10,lVar15,&DAT_14049c7b8);
        }
        do {
          uVar9 = (int)piVar13 + 1;
          FUN_14012f380(local_248,L"szCombo%d",(int *)(ulonglong)uVar9);
          uVar10 = FUN_1402970c0(lVar11,local_248);
          local_2e8 = 1;
          psVar16 = (short *)FUN_140296990(lVar11,iVar3,uVar10,local_248);
          if (*psVar16 != 0) {
            local_2a8 = (undefined8 *)0x0;
            local_2a0 = (undefined8 *)0x0;
            local_298 = 0;
            FUN_140415b90(&local_2a8,psVar16,&DAT_14049c7b8);
            puVar6 = local_2a8;
            local_268 = 7;
            local_270 = 0;
            local_280 = 0;
            FUN_1400015e0(&local_280,local_2a8,0,0xffffffffffffffff);
            puVar21 = local_2a0;
            local_258 = 0;
            if (((longlong)local_2a0 - (longlong)puVar6) / 0x28 == 2) {
              _Str = (wchar_t *)(puVar6 + 5);
              if (7 < (ulonglong)puVar6[8]) {
                _Str = *(wchar_t **)_Str;
              }
              local_258 = _wtoi(_Str);
            }
            FUN_140333570(local_2d8 + 0x12);
            if (7 < local_268) {
              operator_delete((void *)CONCAT62(uStack_27e,local_280));
            }
            local_268 = 7;
            local_270 = 0;
            local_280 = 0;
            puVar8 = puVar6;
            if (puVar6 != (undefined8 *)0x0) {
              for (; puVar8 != puVar21; puVar8 = puVar8 + 5) {
                if (7 < (ulonglong)puVar8[3]) {
                  operator_delete((void *)*puVar8);
                }
                puVar8[3] = 7;
                puVar8[2] = 0;
                *(undefined2 *)puVar8 = 0;
              }
              operator_delete(puVar6);
            }
          }
          lVar15 = local_2b0;
          piVar13 = (int *)(ulonglong)uVar9;
        } while ((int)uVar9 < 0xc);
        ppiVar4 = *(int ***)(local_2b0 + 0x38);
        if ((&local_2d8 < ppiVar4) &&
           (ppiVar5 = *(int ***)(local_2b0 + 0x30), ppiVar5 <= &local_2d8)) {
          if (ppiVar4 == *(int ***)(local_2b0 + 0x40)) {
            FUN_1403435d0(local_2b0 + 0x30);
          }
          puVar21 = (undefined8 *)
                    (((longlong)&local_2d8 - (longlong)ppiVar5 & 0xfffffffffffffff0U) +
                    *(longlong *)(lVar15 + 0x30));
          puVar6 = *(undefined8 **)(lVar15 + 0x38);
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = *puVar21;
            lVar7 = puVar21[1];
            puVar6[1] = lVar7;
            if (lVar7 != 0) {
              LOCK();
              *(int *)(lVar7 + 8) = *(int *)(lVar7 + 8) + 1;
              UNLOCK();
LAB_140333489:
              local_2c8 = local_2c0;
            }
          }
        }
        else {
          if (ppiVar4 == *(int ***)(local_2b0 + 0x40)) {
            FUN_1403435d0(local_2b0 + 0x30);
          }
          puVar6 = *(undefined8 **)(lVar15 + 0x38);
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = local_2d8;
            puVar6[1] = local_2d0;
            if (local_2d0 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_2d0 + 1) = (int)local_2d0[1] + 1;
              UNLOCK();
              goto LAB_140333489;
            }
          }
        }
        plVar19 = local_2d0;
        *(longlong *)(lVar15 + 0x38) = *(longlong *)(lVar15 + 0x38) + 0x10;
        piVar13 = local_2c8;
        if (local_2d0 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_2d0 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          piVar13 = local_2c0;
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_2d0 + 8))(local_2d0);
            LOCK();
            piVar12 = (int *)((longlong)plVar19 + 0xc);
            *piVar12 = *piVar12 + -1;
            UNLOCK();
            piVar13 = local_2c0;
            if (*piVar12 == 0) {
              (**(code **)(*plVar19 + 0x10))(plVar19);
              piVar13 = local_2c0;
            }
          }
        }
      }
      local_2c8 = *(int **)(piVar13 + 6);
      if (local_2c8 == (int *)0x0) {
        uVar9 = (uint)piVar13[8] % *(uint *)(lVar11 + 0x78) + 1;
        lVar15 = (longlong)(int)uVar9 << 3;
        local_2c8 = piVar20;
        do {
          if (*(uint *)(lVar11 + 0x78) <= uVar9) break;
          if (*(longlong *)(lVar15 + *(longlong *)(lVar11 + 0x68)) != 0) {
            local_2c8 = *(int **)(lVar15 + *(longlong *)(lVar11 + 0x68));
          }
          uVar9 = uVar9 + 1;
          lVar15 = lVar15 + 8;
        } while (local_2c8 == (int *)0x0);
      }
      goto LAB_140332f91;
    }
    FUN_1403338b0(*(longlong *)(local_2b0 + 0x30),*(longlong *)(local_2b0 + 0x38),
                  *(longlong *)(local_2b0 + 0x38) - *(longlong *)(local_2b0 + 0x30) >> 4,0);
    uVar17 = 1;
  }
  return uVar17;
}



void FUN_140333570(ulonglong *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  undefined2 *puVar2;
  longlong lVar3;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (*param_1 <= param_2)) {
    lVar3 = param_2 - *param_1;
    lVar3 = lVar3 / 6 + (lVar3 >> 0x3f);
    if (uVar1 == param_1[2]) {
      FUN_140333680(param_1);
    }
    lVar3 = ((lVar3 >> 3) - (lVar3 >> 0x3f)) * 0x30 + *param_1;
    puVar2 = (undefined2 *)param_1[1];
    if (puVar2 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar2 + 0xc) = 7;
      *(undefined8 *)(puVar2 + 8) = 0;
      *puVar2 = 0;
      FUN_1400015e0(puVar2,lVar3,0,0xffffffffffffffff,uVar4);
      *(undefined4 *)(puVar2 + 0x14) = *(undefined4 *)(lVar3 + 0x28);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140333680(param_1);
    }
    puVar2 = (undefined2 *)param_1[1];
    if (puVar2 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar2 + 0xc) = 7;
      *(undefined8 *)(puVar2 + 8) = 0;
      *puVar2 = 0;
      FUN_1400015e0(puVar2,param_2,0,0xffffffffffffffff,uVar4);
      *(undefined4 *)(puVar2 + 0x14) = *(undefined4 *)(param_2 + 0x28);
    }
  }
  param_1[1] = param_1[1] + 0x30;
  return;
}



void FUN_140333680(longlong *param_1)

{
  code *pcVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = param_1[1] - *param_1;
  lVar2 = lVar2 / 6 + (lVar2 >> 0x3f);
  uVar4 = (lVar2 >> 3) - (lVar2 >> 0x3f);
  if (0x555555555555554 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  uVar3 = (param_1[2] - *param_1) / 0x30;
  if (uVar3 < uVar4) {
    if (0x555555555555555 - (uVar3 >> 1) < uVar3) {
      uVar3 = 0;
      if (uVar4 != 0) {
        uVar3 = uVar4;
      }
      FUN_140333740(param_1,uVar3);
      return;
    }
    uVar3 = uVar3 + (uVar3 >> 1);
    if (uVar3 < uVar4) {
      uVar3 = uVar4;
    }
    FUN_140333740(param_1,uVar3);
  }
  return;
}



void FUN_140333740(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  code *pcVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  undefined8 uVar7;
  
  uVar7 = 0xfffffffffffffffe;
  if (0x555555555555555 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  if ((ulonglong)((param_1[2] - *param_1) / 0x30) < param_2) {
    lVar4 = FUN_14023b110(param_2);
    FUN_14023b9c0(*param_1,param_1[1],lVar4);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    lVar6 = lVar1 - lVar2;
    lVar5 = lVar6 / 6 + (lVar6 >> 0x3f);
    if (lVar2 != 0) {
      FUN_14023ae30(lVar2,lVar1,lVar6,lVar1,uVar7);
      operator_delete((void *)*param_1);
    }
    param_1[2] = param_2 * 0x30 + lVar4;
    param_1[1] = ((lVar5 >> 3) - (lVar5 >> 0x3f)) * 0x30 + lVar4;
    *param_1 = lVar4;
  }
  return;
}



undefined8 * FUN_140333840(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;
}



void FUN_1403338b0(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 >> 4;
    if (lVar1 < 0x21) {
LAB_14033397b:
      if (1 < lVar1) {
        FUN_140334070(param_1,param_2,param_4);
      }
      return;
    }
    if (param_3 < 1) {
      if (0x20 < lVar1) {
        lVar1 = param_2 - param_1 >> 4;
        if (lVar1 < 2) {
          return;
        }
        FUN_140333e60(param_1,param_2,param_4);
        if (lVar1 < 2) {
          return;
        }
        do {
          FUN_1403343f0(param_1,param_2,param_4);
          param_2 = param_2 + -0x10;
        } while (0x10 < (longlong)(param_2 - param_1 & 0xfffffffffffffff0U));
        return;
      }
      goto LAB_14033397b;
    }
    FUN_140333ad0(&local_18,param_1,param_2);
    lVar1 = local_10;
    param_3 = param_3 / 2 + (param_3 / 2) / 2;
    if ((longlong)(local_18 - param_1 & 0xfffffffffffffff0U) <
        (longlong)(param_2 - local_10 & 0xfffffffffffffff0U)) {
      FUN_1403338b0(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_1403338b0(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



undefined8 * FUN_140333a10(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong *plVar5;
  
  for (; param_1 != param_2; param_1 = param_1 + 2) {
    lVar3 = param_1[1];
    uVar4 = *param_1;
    if (lVar3 != 0) {
      LOCK();
      *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
      UNLOCK();
    }
    *param_3 = uVar4;
    plVar5 = (longlong *)param_3[1];
    param_3[1] = lVar3;
    if (plVar5 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar5 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar5 + 8))(plVar5);
        LOCK();
        piVar2 = (int *)((longlong)plVar5 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar5 + 0x10))(plVar5);
        }
      }
    }
    param_3 = param_3 + 2;
  }
  return param_3;
}



void FUN_140333ab0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_140333d00();
  }
  return;
}



undefined8 * FUN_140333ad0(undefined8 *param_1,longlong *param_2,longlong *param_3)

{
  int iVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong *plVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  
  plVar3 = param_2 + (((longlong)param_3 - (longlong)param_2 >> 4) -
                      ((longlong)param_3 - (longlong)param_2 >> 0x3f) >> 1) * 2;
  FUN_140333d80(param_2,plVar3,param_3 + -2);
  plVar7 = plVar3 + 2;
  while (plVar6 = plVar3, param_2 < plVar6) {
    if ((*(int *)(plVar6[-2] + 4) < *(int *)(*plVar6 + 4)) ||
       (plVar3 = plVar6 + -2, *(int *)(*plVar6 + 4) < *(int *)(plVar6[-2] + 4))) break;
  }
  plVar3 = plVar7;
  plVar4 = plVar6;
  if (plVar7 < param_3) {
    do {
      plVar3 = plVar7;
      if ((*(int *)(*plVar7 + 4) < *(int *)(*plVar6 + 4)) ||
         (*(int *)(*plVar6 + 4) < *(int *)(*plVar7 + 4))) break;
      plVar7 = plVar7 + 2;
      plVar3 = plVar7;
    } while (plVar7 < param_3);
  }
joined_r0x000140333b73:
  do {
    if (param_3 <= plVar7) {
joined_r0x000140333bbf:
      while (plVar8 = plVar6, param_2 < plVar8) {
        plVar6 = plVar8 + -2;
        if (*(int *)(*plVar4 + 4) <= *(int *)(plVar8[-2] + 4)) {
          if (*(int *)(*plVar4 + 4) < *(int *)(plVar8[-2] + 4)) break;
          lVar2 = plVar4[-2];
          plVar4[-2] = *plVar6;
          *plVar6 = lVar2;
          lVar2 = plVar8[-1];
          plVar8[-1] = plVar4[-1];
          plVar4[-1] = lVar2;
          plVar4 = plVar4 + -2;
        }
      }
      if (plVar8 == param_2) {
        if (plVar7 == param_3) {
          *param_1 = plVar4;
          param_1[1] = plVar3;
          return param_1;
        }
        if (plVar3 != plVar7) {
          lVar2 = *plVar4;
          *plVar4 = *plVar3;
          *plVar3 = lVar2;
          lVar2 = plVar3[1];
          plVar3[1] = plVar4[1];
          plVar4[1] = lVar2;
        }
        lVar2 = *plVar4;
        *plVar4 = *plVar7;
        *plVar7 = lVar2;
        lVar2 = plVar7[1];
        plVar7[1] = plVar4[1];
        plVar4[1] = lVar2;
        plVar7 = plVar7 + 2;
        plVar3 = plVar3 + 2;
        plVar6 = plVar8;
        plVar4 = plVar4 + 2;
      }
      else {
        plVar6 = plVar8 + -2;
        if (plVar7 == param_3) {
          plVar5 = plVar4 + -2;
          if (plVar6 != plVar5) {
            lVar2 = *plVar6;
            *plVar6 = *plVar5;
            *plVar5 = lVar2;
            lVar2 = plVar4[-1];
            plVar4[-1] = plVar8[-1];
            plVar8[-1] = lVar2;
          }
          lVar2 = *plVar5;
          *plVar5 = plVar3[-2];
          plVar3[-2] = lVar2;
          lVar2 = plVar3[-1];
          plVar3[-1] = plVar4[-1];
          plVar4[-1] = lVar2;
          plVar3 = plVar3 + -2;
          plVar4 = plVar5;
        }
        else {
          lVar2 = *plVar7;
          *plVar7 = *plVar6;
          *plVar6 = lVar2;
          lVar2 = plVar8[-1];
          plVar8[-1] = plVar7[1];
          plVar7[1] = lVar2;
          plVar7 = plVar7 + 2;
        }
      }
      goto joined_r0x000140333b73;
    }
    iVar1 = *(int *)(*plVar7 + 4);
    plVar8 = plVar3;
    if (iVar1 <= *(int *)(*plVar4 + 4)) {
      if (iVar1 < *(int *)(*plVar4 + 4)) goto joined_r0x000140333bbf;
      plVar8 = plVar3 + 2;
      lVar2 = *plVar3;
      *plVar3 = *plVar7;
      *plVar7 = lVar2;
      lVar2 = plVar7[1];
      plVar7[1] = plVar3[1];
      plVar3[1] = lVar2;
    }
    plVar7 = plVar7 + 2;
    plVar3 = plVar8;
  } while( true );
}



void * FUN_140333d00(void *param_1)

{
  if (*(longlong *)((longlong)param_1 + 0x48) != 0) {
    FUN_14023ae30(*(longlong *)((longlong)param_1 + 0x48),*(undefined8 *)((longlong)param_1 + 0x50))
    ;
    operator_delete(*(void **)((longlong)param_1 + 0x48));
  }
  *(undefined8 *)((longlong)param_1 + 0x48) = 0;
  *(undefined8 *)((longlong)param_1 + 0x50) = 0;
  *(undefined8 *)((longlong)param_1 + 0x58) = 0;
  if (*(longlong *)((longlong)param_1 + 0x28) != 0) {
    FUN_14008d0a0(*(longlong *)((longlong)param_1 + 0x28),*(undefined8 *)((longlong)param_1 + 0x30))
    ;
    operator_delete(*(void **)((longlong)param_1 + 0x28));
  }
  *(undefined8 *)((longlong)param_1 + 0x28) = 0;
  *(undefined8 *)((longlong)param_1 + 0x30) = 0;
  *(undefined8 *)((longlong)param_1 + 0x38) = 0;
  operator_delete(param_1);
  return param_1;
}



void FUN_140333d80(longlong param_1,longlong param_2,longlong param_3,undefined1 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = param_3 - param_1 >> 4;
  if (0x28 < lVar1) {
    lVar1 = lVar1 + 1;
    lVar2 = (longlong)(lVar1 + (ulonglong)((uint)(lVar1 >> 0x3f) & 7)) >> 3;
    lVar1 = lVar2 * 0x10 + param_1;
    FUN_140334230(param_1,lVar1,lVar2 * 0x20 + param_1);
    FUN_140334230(param_2 + lVar2 * -0x10,param_2,lVar2 * 0x10 + param_2,param_4);
    lVar3 = param_3 + lVar2 * -0x10;
    FUN_140334230(param_3 + lVar2 * -0x20,lVar3,param_3,param_4);
    FUN_140334230(lVar1,param_2,lVar3,param_4);
    return;
  }
  FUN_140334230();
  return;
}



void FUN_140333e60(longlong param_1,longlong param_2,undefined1 param_3)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  undefined8 *puVar8;
  longlong lVar9;
  undefined8 local_60;
  longlong *local_58;
  undefined8 local_50;
  longlong local_48;
  undefined8 local_40;
  longlong local_38;
  
  lVar7 = param_2 - param_1 >> 4;
  lVar4 = lVar7 - (param_2 - param_1 >> 0x3f) >> 1;
  if (0 < lVar4) {
    lVar9 = lVar4 * 2 + 2;
    puVar8 = (undefined8 *)(lVar4 * 0x10 + param_1);
    do {
      lVar4 = lVar4 + -1;
      lVar9 = lVar9 + -2;
      local_60 = puVar8[-2];
      local_58 = (longlong *)puVar8[-1];
      lVar6 = lVar4;
      lVar5 = lVar9;
      if (local_58 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_58 + 1) = (int)local_58[1] + 1;
        UNLOCK();
      }
      for (; lVar5 < lVar7; lVar5 = lVar5 * 2 + 2) {
        if (*(int *)(*(longlong *)(param_1 + lVar5 * 0x10) + 4) <
            *(int *)(*(longlong *)(param_1 + -0x10 + lVar5 * 0x10) + 4)) {
          lVar5 = lVar5 + -1;
        }
        local_50 = *(undefined8 *)(param_1 + lVar5 * 0x10);
        local_48 = *(longlong *)(param_1 + 8 + lVar5 * 0x10);
        if (local_48 != 0) {
          LOCK();
          *(int *)(local_48 + 8) = *(int *)(local_48 + 8) + 1;
          UNLOCK();
        }
        *(undefined8 *)(param_1 + lVar6 * 0x10) = local_50;
        plVar3 = *(longlong **)(param_1 + 8 + lVar6 * 0x10);
        *(longlong *)(param_1 + 8 + lVar6 * 0x10) = local_48;
        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);
            }
          }
        }
        lVar6 = lVar5;
      }
      if (lVar5 == lVar7) {
        local_40 = *(undefined8 *)(param_1 + -0x10 + lVar7 * 0x10);
        local_38 = *(longlong *)(param_1 + -8 + lVar7 * 0x10);
        if (local_38 != 0) {
          LOCK();
          *(int *)(local_38 + 8) = *(int *)(local_38 + 8) + 1;
          UNLOCK();
        }
        *(undefined8 *)(param_1 + lVar6 * 0x10) = local_40;
        plVar3 = *(longlong **)(param_1 + 8 + lVar6 * 0x10);
        *(longlong *)(param_1 + 8 + lVar6 * 0x10) = local_38;
        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);
            }
          }
        }
        lVar6 = lVar7 + -1;
      }
      FUN_1403342b0(param_1,lVar6,lVar4,&local_60,param_3);
      plVar3 = local_58;
      if (local_58 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_58 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_58 + 8))(local_58);
          LOCK();
          piVar2 = (int *)((longlong)plVar3 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*local_58 + 0x10))();
          }
        }
      }
      puVar8 = puVar8 + -2;
    } while (0 < lVar4);
  }
  return;
}



void FUN_140334070(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong *plVar6;
  longlong *plVar7;
  longlong *plVar8;
  longlong *plVar9;
  undefined8 uVar10;
  
  if (param_1 != param_2) {
    uVar10 = 0xfffffffffffffffe;
    plVar9 = param_1;
    while (plVar7 = plVar9 + 2, plVar7 != param_2) {
      lVar2 = *plVar7;
      plVar3 = (longlong *)plVar9[3];
      if (plVar3 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
        UNLOCK();
      }
      plVar8 = plVar7;
      if (*(int *)(lVar2 + 4) < *(int *)(*param_1 + 4)) {
        FUN_1402cf550(param_1,plVar7,plVar9 + 4,param_4,uVar10);
        if (plVar3 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
          UNLOCK();
        }
        *param_1 = lVar2;
        plVar9 = (longlong *)param_1[1];
        param_1[1] = (longlong)plVar3;
      }
      else {
        while( true ) {
          plVar9 = plVar8 + -2;
          lVar4 = *plVar9;
          if (*(int *)(lVar4 + 4) <= *(int *)(lVar2 + 4)) break;
          lVar5 = plVar8[-1];
          if (lVar5 != 0) {
            LOCK();
            *(int *)(lVar5 + 8) = *(int *)(lVar5 + 8) + 1;
            UNLOCK();
          }
          *plVar8 = lVar4;
          plVar6 = (longlong *)plVar8[1];
          plVar8[1] = lVar5;
          plVar8 = plVar9;
          if (plVar6 != (longlong *)0x0) {
            LOCK();
            plVar9 = plVar6 + 1;
            *(int *)plVar9 = (int)*plVar9 + -1;
            UNLOCK();
            if ((int)*plVar9 == 0) {
              (**(code **)(*plVar6 + 8))(plVar6);
              LOCK();
              piVar1 = (int *)((longlong)plVar6 + 0xc);
              *piVar1 = *piVar1 + -1;
              UNLOCK();
              if (*piVar1 == 0) {
                (**(code **)(*plVar6 + 0x10))(plVar6);
              }
            }
          }
        }
        if (plVar3 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar3 + 1) = (int)plVar3[1] + 1;
          UNLOCK();
        }
        *plVar8 = lVar2;
        plVar9 = (longlong *)plVar8[1];
        plVar8[1] = (longlong)plVar3;
      }
      if (plVar9 != (longlong *)0x0) {
        LOCK();
        plVar8 = plVar9 + 1;
        *(int *)plVar8 = (int)*plVar8 + -1;
        UNLOCK();
        if ((int)*plVar8 == 0) {
          (**(code **)(*plVar9 + 8))(plVar9);
          LOCK();
          piVar1 = (int *)((longlong)plVar9 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*plVar9 + 0x10))(plVar9);
          }
        }
      }
      plVar9 = plVar7;
      if (plVar3 != (longlong *)0x0) {
        LOCK();
        plVar7 = plVar3 + 1;
        *(int *)plVar7 = (int)*plVar7 + -1;
        UNLOCK();
        if ((int)*plVar7 == 0) {
          (**(code **)(*plVar3 + 8))(plVar3);
          LOCK();
          piVar1 = (int *)((longlong)plVar3 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*plVar3 + 0x10))();
          }
        }
      }
    }
  }
  return;
}



void FUN_140334230(longlong *param_1,longlong *param_2,longlong *param_3)

{
  longlong lVar1;
  
  lVar1 = *param_2;
  if (*(int *)(lVar1 + 4) < *(int *)(*param_1 + 4)) {
    *param_2 = *param_1;
    *param_1 = lVar1;
    lVar1 = param_1[1];
    param_1[1] = param_2[1];
    param_2[1] = lVar1;
  }
  lVar1 = *param_3;
  if (*(int *)(lVar1 + 4) < *(int *)(*param_2 + 4)) {
    *param_3 = *param_2;
    *param_2 = lVar1;
    lVar1 = param_2[1];
    param_2[1] = param_3[1];
    param_3[1] = lVar1;
  }
  lVar1 = *param_2;
  if (*(int *)(lVar1 + 4) < *(int *)(*param_1 + 4)) {
    *param_2 = *param_1;
    *param_1 = lVar1;
    lVar1 = param_1[1];
    param_1[1] = param_2[1];
    param_2[1] = lVar1;
  }
  return;
}



void FUN_1403342b0(longlong param_1,longlong param_2,longlong param_3,longlong *param_4)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  longlong lVar6;
  
  while (param_3 < param_2) {
    lVar6 = (param_2 + -1) / 2;
    lVar3 = *(longlong *)(param_1 + lVar6 * 0x10);
    if (*(int *)(*param_4 + 4) <= *(int *)(lVar3 + 4)) break;
    lVar4 = *(longlong *)(param_1 + 8 + lVar6 * 0x10);
    if (lVar4 != 0) {
      LOCK();
      *(int *)(lVar4 + 8) = *(int *)(lVar4 + 8) + 1;
      UNLOCK();
    }
    *(longlong *)(param_1 + param_2 * 0x10) = lVar3;
    plVar5 = *(longlong **)(param_1 + 8 + param_2 * 0x10);
    *(longlong *)(param_1 + 8 + param_2 * 0x10) = lVar4;
    param_2 = lVar6;
    if (plVar5 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar5 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar5 + 8))(plVar5);
        LOCK();
        piVar2 = (int *)((longlong)plVar5 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar5 + 0x10))(plVar5);
        }
      }
    }
  }
  lVar3 = param_4[1];
  lVar6 = *param_4;
  if (lVar3 != 0) {
    LOCK();
    *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
    UNLOCK();
  }
  *(longlong *)(param_1 + param_2 * 0x10) = lVar6;
  plVar5 = *(longlong **)(param_1 + 8 + param_2 * 0x10);
  *(longlong *)(param_1 + 8 + param_2 * 0x10) = lVar3;
  if (plVar5 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar5 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*plVar5 + 8))(plVar5);
      LOCK();
      piVar2 = (int *)((longlong)plVar5 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar5 + 0x10))(plVar5);
      }
    }
  }
  return;
}



void FUN_1403343f0(longlong param_1,longlong param_2,undefined1 param_3)

{
  int *piVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  bool bVar8;
  undefined8 local_30;
  longlong *local_28;
  
  local_30 = *(undefined8 *)(param_2 + -0x10);
  plVar2 = *(longlong **)(param_2 + -8);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
  }
  local_28 = plVar2;
  FUN_140343ec0((undefined8 *)(param_2 + -0x10),param_1);
  lVar7 = (param_2 - param_1) + -0x10 >> 4;
  lVar5 = 0;
  lVar4 = 2;
  bVar8 = lVar7 == 2;
  lVar6 = lVar5;
  if (2 < lVar7) {
    do {
      lVar5 = lVar4;
      if (*(int *)(*(longlong *)(param_1 + lVar4 * 0x10) + 4) <
          *(int *)(*(longlong *)(param_1 + -0x10 + lVar4 * 0x10) + 4)) {
        lVar5 = lVar4 + -1;
      }
      FUN_140343ec0(param_1 + lVar6 * 0x10,lVar5 * 0x10 + param_1);
      lVar4 = lVar5 * 2 + 2;
      bVar8 = lVar4 == lVar7;
      lVar6 = lVar5;
    } while (lVar4 < lVar7);
  }
  if (bVar8) {
    FUN_140343ec0(param_1 + lVar5 * 0x10,param_1 + -0x10 + lVar7 * 0x10);
    lVar5 = lVar7 + -1;
  }
  FUN_1403342b0(param_1,lVar5,0,&local_30,param_3);
  plVar3 = local_28;
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar2 = plVar2 + 1;
    *(int *)plVar2 = (int)*plVar2 + -1;
    UNLOCK();
    if ((int)*plVar2 == 0) {
      (**(code **)(*local_28 + 8))(local_28);
      LOCK();
      piVar1 = (int *)((longlong)plVar3 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_28 + 0x10))();
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140334520(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  undefined4 uVar4;
  uint uVar5;
  undefined4 uVar6;
  longlong lVar7;
  short *psVar9;
  longlong lVar10;
  ulonglong uVar11;
  undefined4 *puVar12;
  longlong *plVar13;
  short *psVar14;
  undefined4 *puVar15;
  undefined1 auStack_138 [32];
  undefined1 local_118;
  undefined4 *local_108;
  undefined4 *local_f8;
  undefined1 local_e8 [8];
  longlong *local_e0;
  undefined1 local_d8 [8];
  longlong *local_d0;
  undefined8 local_c8;
  undefined1 local_c0 [24];
  undefined1 local_a8 [24];
  void *local_90 [2];
  longlong local_80;
  ulonglong local_78;
  undefined4 local_68;
  void *local_60 [2];
  longlong local_50;
  ulonglong local_48;
  undefined4 local_38;
  ulonglong local_30;
  undefined4 *puVar8;
  
  local_c8 = 0xfffffffffffffffe;
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_138;
  lVar7 = FUN_1402933b0(DAT_140607ff0,&DAT_1404aed90);
  if (lVar7 != 0) {
    puVar15 = (undefined4 *)0x0;
    puVar12 = puVar15;
    if ((*(longlong *)(lVar7 + 0x70) != 0) && (*(uint *)(lVar7 + 0x78) != 0)) {
      puVar8 = puVar15;
      plVar13 = *(longlong **)(lVar7 + 0x68);
      do {
        if (*plVar13 != 0) {
          puVar12 = (undefined4 *)(*(longlong **)(lVar7 + 0x68))[(longlong)puVar8];
          break;
        }
        uVar5 = (int)puVar8 + 1;
        puVar8 = (undefined4 *)(ulonglong)uVar5;
        plVar13 = plVar13 + 1;
      } while (uVar5 < *(uint *)(lVar7 + 0x78));
    }
LAB_1403345b5:
    local_f8 = puVar12;
    if (puVar12 != (undefined4 *)0x0) {
      uVar4 = *puVar12;
      uVar6 = FUN_1402970c0(lVar7,L"szName");
      local_118 = 1;
      psVar9 = (short *)FUN_140296990(lVar7,uVar4,uVar6,L"szName");
      local_78 = 7;
      local_80 = 0;
      local_90[0] = (void *)((ulonglong)local_90[0] & 0xffffffffffff0000);
      uVar11 = 0xffffffffffffffff;
      psVar14 = psVar9;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar3 = *psVar14;
        psVar14 = psVar14 + 1;
      } while (sVar3 != 0);
      FUN_140001710(local_90,psVar9,~uVar11 - 1);
      local_48 = 7;
      local_50 = 0;
      local_60[0] = (void *)((ulonglong)local_60[0] & 0xffffffffffff0000);
      local_68 = uVar4;
      if (local_78 < 8) {
        memmove(local_60,local_90,local_80 * 2 + 2);
        local_48 = local_78;
      }
      else {
        local_60[0] = local_90[0];
        local_90[0] = (void *)0x0;
        local_48 = local_78;
      }
      local_50 = local_80;
      local_80 = 0;
      local_78 = 0;
      local_38 = local_68;
      if (*(longlong *)(param_1 + 0xb8) == 0) {
        FUN_1401500f0(param_1 + 0x98,local_a8,local_60);
      }
      else {
        FUN_14014ffb0(param_1 + 0x98,local_c0,local_60,local_60);
      }
      if (7 < local_48) {
        operator_delete(local_60[0]);
      }
      local_48 = 7;
      local_50 = 0;
      local_60[0] = (void *)((ulonglong)local_60[0] & 0xffffffffffff0000);
      if (7 < local_78) {
        operator_delete(local_90[0]);
      }
      FUN_140334cf0(param_1,local_d8,psVar9);
      plVar13 = local_d0;
      puVar8 = puVar12;
      if (local_d0 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_d0 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar8 = local_f8;
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_d0 + 8))(local_d0);
          LOCK();
          piVar2 = (int *)((longlong)plVar13 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar8 = local_f8;
          if (*piVar2 == 0) {
            (**(code **)(*plVar13 + 0x10))(plVar13);
            puVar8 = local_f8;
          }
        }
      }
      puVar12 = *(undefined4 **)(puVar8 + 6);
      if (puVar12 == (undefined4 *)0x0) {
        uVar5 = (uint)puVar8[8] % *(uint *)(lVar7 + 0x78) + 1;
        lVar10 = (longlong)(int)uVar5 << 3;
        puVar12 = puVar15;
        do {
          if (*(uint *)(lVar7 + 0x78) <= uVar5) break;
          if (*(longlong *)(lVar10 + *(longlong *)(lVar7 + 0x68)) != 0) {
            puVar12 = *(undefined4 **)(lVar10 + *(longlong *)(lVar7 + 0x68));
          }
          uVar5 = uVar5 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar12 == (undefined4 *)0x0);
      }
      goto LAB_1403345b5;
    }
    lVar7 = FUN_1402933b0(DAT_140607ff0,&DAT_1404d2988);
    if (lVar7 != 0) {
      puVar12 = puVar15;
      if ((*(longlong *)(lVar7 + 0x70) != 0) && (*(uint *)(lVar7 + 0x78) != 0)) {
        puVar8 = puVar15;
        plVar13 = *(longlong **)(lVar7 + 0x68);
        do {
          if (*plVar13 != 0) {
            puVar12 = (undefined4 *)(*(longlong **)(lVar7 + 0x68))[(longlong)puVar8];
            break;
          }
          uVar5 = (int)puVar8 + 1;
          puVar8 = (undefined4 *)(ulonglong)uVar5;
          plVar13 = plVar13 + 1;
        } while (uVar5 < *(uint *)(lVar7 + 0x78));
      }
LAB_1403347c3:
      local_108 = puVar12;
      if (puVar12 != (undefined4 *)0x0) {
        uVar4 = *puVar12;
        uVar6 = FUN_1402970c0(lVar7,L"szName");
        local_118 = 0;
        lVar10 = FUN_140296990(lVar7,uVar4,uVar6,L"szName");
        puVar8 = puVar12;
        if ((lVar10 != 0) &&
           (FUN_140334b50(param_1,local_e8,lVar10), plVar13 = local_e0, local_e0 != (longlong *)0x0)
           ) {
          LOCK();
          plVar1 = local_e0 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          puVar8 = local_108;
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_e0 + 8))(local_e0);
            LOCK();
            piVar2 = (int *)((longlong)plVar13 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            puVar8 = local_108;
            if (*piVar2 == 0) {
              (**(code **)(*plVar13 + 0x10))(plVar13);
              puVar8 = local_108;
            }
          }
        }
        puVar12 = *(undefined4 **)(puVar8 + 6);
        if (puVar12 == (undefined4 *)0x0) {
          uVar5 = (uint)puVar8[8] % *(uint *)(lVar7 + 0x78) + 1;
          lVar10 = (longlong)(int)uVar5 << 3;
          puVar12 = puVar15;
          do {
            if (*(uint *)(lVar7 + 0x78) <= uVar5) break;
            if (*(longlong *)(*(longlong *)(lVar7 + 0x68) + lVar10) != 0) {
              puVar12 = *(undefined4 **)(*(longlong *)(lVar7 + 0x68) + lVar10);
            }
            uVar5 = uVar5 + 1;
            lVar10 = lVar10 + 8;
          } while (puVar12 == (undefined4 *)0x0);
        }
        goto LAB_1403347c3;
      }
      FUN_140418da0(DAT_140607fd8,L"mcoAiTableManager Load OK...");
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_1403348d0(longlong param_1,short *param_2)

{
  short sVar1;
  ushort *puVar2;
  undefined4 uVar3;
  ulonglong uVar4;
  ushort *puVar5;
  short *psVar6;
  ulonglong uVar7;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  ushort local_40;
  undefined6 uStack_3e;
  longlong local_30;
  ulonglong local_28;
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  local_28 = 7;
  uVar7 = 0;
  local_30 = 0;
  local_40 = 0;
  uVar4 = 0xffffffffffffffff;
  psVar6 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar6;
    psVar6 = psVar6 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_40,param_2,~uVar4 - 1);
  if (*(longlong *)(param_1 + 0xb8) != 0) {
    puVar5 = &local_40;
    if (7 < local_28) {
      puVar5 = (ushort *)CONCAT62(uStack_3e,local_40);
    }
    puVar2 = &local_40;
    if (7 < local_28) {
      puVar2 = (ushort *)CONCAT62(uStack_3e,local_40);
    }
    for (; puVar2 != puVar5 + local_30; puVar2 = puVar2 + 1) {
      uVar7 = uVar7 ^ (uVar7 >> 2) + uVar7 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar2;
    }
    uVar7 = FUN_1402cb0b0(*(longlong *)(param_1 + 0x98) +
                          (uVar7 % *(ulonglong *)(param_1 + 0xa0)) * 8,&local_40);
  }
  if (7 < local_28) {
    operator_delete((void *)CONCAT62(uStack_3e,local_40));
  }
  if (uVar7 == 0) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined4 *)(uVar7 + 0x30);
  }
  return uVar3;
}



undefined4 FUN_140334a10(short *param_1)

{
  short sVar1;
  short sVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined4 uVar5;
  longlong lVar6;
  ulonglong uVar7;
  longlong lVar8;
  longlong *plVar9;
  short *psVar10;
  undefined4 *puVar11;
  undefined4 *puVar12;
  
  lVar6 = FUN_1402933b0(DAT_140607ff0,&DAT_1404d2988);
  if (lVar6 == 0) {
    return 0;
  }
  if (*(longlong *)(lVar6 + 0x70) != 0) {
    uVar7 = 0;
    if (*(uint *)(lVar6 + 0x78) != 0) {
      plVar9 = *(longlong **)(lVar6 + 0x68);
      do {
        if (*plVar9 != 0) {
          puVar11 = (undefined4 *)(*(longlong **)(lVar6 + 0x68))[uVar7];
          goto LAB_140334a80;
        }
        uVar4 = (int)uVar7 + 1;
        uVar7 = (ulonglong)uVar4;
        plVar9 = plVar9 + 1;
      } while (uVar4 < *(uint *)(lVar6 + 0x78));
    }
  }
  puVar11 = (undefined4 *)0x0;
LAB_140334a80:
  do {
    do {
      puVar12 = puVar11;
      if (puVar12 == (undefined4 *)0x0) {
        return 0;
      }
      uVar3 = *puVar12;
      uVar5 = FUN_1402970c0(lVar6,L"szName");
      lVar8 = FUN_140296990(lVar6,uVar3,uVar5,L"szName",1);
      psVar10 = param_1;
      do {
        sVar1 = *psVar10;
        sVar2 = *(short *)((longlong)psVar10 + (lVar8 - (longlong)param_1));
        if (sVar1 != sVar2) break;
        psVar10 = psVar10 + 1;
      } while (sVar2 != 0);
      if (sVar1 == sVar2) {
        return uVar3;
      }
      puVar11 = *(undefined4 **)(puVar12 + 6);
    } while (puVar11 != (undefined4 *)0x0);
    uVar4 = (uint)puVar12[8] % *(uint *)(lVar6 + 0x78) + 1;
    lVar8 = (longlong)(int)uVar4 << 3;
    do {
      if (*(uint *)(lVar6 + 0x78) <= uVar4) break;
      if (*(longlong *)(lVar8 + *(longlong *)(lVar6 + 0x68)) != 0) {
        puVar11 = *(undefined4 **)(lVar8 + *(longlong *)(lVar6 + 0x68));
      }
      uVar4 = uVar4 + 1;
      lVar8 = lVar8 + 8;
    } while (puVar11 == (undefined4 *)0x0);
  } while( true );
}



undefined8 *
FUN_140334b50(longlong param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong lVar2;
  longlong *plVar3;
  uint uVar4;
  void *pvVar5;
  undefined8 uVar6;
  uint *puVar7;
  longlong *plVar8;
  undefined8 uVar9;
  undefined8 local_50;
  longlong *local_48;
  undefined8 local_40;
  longlong *local_38;
  undefined8 local_30;
  longlong *local_28;
  
  uVar9 = 0xfffffffffffffffe;
  uVar6 = 0;
  local_50 = 0;
  local_48 = (longlong *)0x0;
  uVar4 = FUN_140334a10(param_3);
  if (uVar4 == 0) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar2 = *(longlong *)(param_1 + 8);
    if (lVar2 != 0) {
      for (puVar7 = *(uint **)(lVar2 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(param_1 + 0x18)) * 8
                              ); puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 6)) {
        if ((puVar7[8] == uVar4) && (*puVar7 == uVar4)) {
          if (puVar7 != (uint *)0x0) {
            if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar6 = *(undefined8 *)(puVar7 + 2);
            local_38 = *(longlong **)(puVar7 + 4);
            local_50 = uVar6;
            local_48 = local_38;
            local_30 = uVar6;
            local_28 = local_38;
            if (local_38 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_38 + 1) = (int)local_38[1] + 1;
              UNLOCK();
            }
            goto LAB_140334c83;
          }
          break;
        }
      }
    }
    pvVar5 = operator_new(0x140);
    if (pvVar5 != (void *)0x0) {
      uVar6 = FUN_140349fb0(pvVar5);
    }
    local_40 = uVar6;
    FUN_140334e90(&local_38,uVar6);
    FUN_140178e90(&local_40,uVar6,uVar6,param_4,uVar9);
    uVar6 = local_40;
    local_50 = local_40;
    local_48 = local_38;
    FUN_14034a160(local_40,uVar4);
    FUN_14030e3c0((longlong *)(param_1 + 8),uVar4,&local_50);
LAB_140334c83:
    plVar3 = local_48;
    *param_2 = uVar6;
    param_2[1] = local_38;
    plVar8 = (longlong *)0x0;
    if (local_38 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_38 + 1) = (int)local_38[1] + 1;
      UNLOCK();
      plVar8 = local_48;
    }
    if (plVar8 != (longlong *)0x0) {
      LOCK();
      plVar8 = plVar8 + 1;
      *(int *)plVar8 = (int)*plVar8 + -1;
      UNLOCK();
      if ((int)*plVar8 == 0) {
        (**(code **)(*local_48 + 8))(local_48);
        LOCK();
        piVar1 = (int *)((longlong)plVar3 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_48 + 0x10))();
        }
      }
    }
  }
  return param_2;
}



undefined8 *
FUN_140334cf0(longlong param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  longlong lVar2;
  longlong *plVar3;
  uint uVar4;
  void *pvVar5;
  undefined8 uVar6;
  uint *puVar7;
  longlong *plVar8;
  undefined8 uVar9;
  undefined8 local_50;
  longlong *local_48;
  undefined8 local_40;
  longlong *local_38;
  undefined8 local_30;
  longlong *local_28;
  
  uVar9 = 0xfffffffffffffffe;
  uVar6 = 0;
  local_50 = 0;
  local_48 = (longlong *)0x0;
  uVar4 = FUN_1403348d0();
  if (uVar4 == 0) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar2 = *(longlong *)(param_1 + 0x50);
    if (lVar2 != 0) {
      for (puVar7 = *(uint **)(lVar2 + ((ulonglong)uVar4 % (ulonglong)*(uint *)(param_1 + 0x60)) * 8
                              ); puVar7 != (uint *)0x0; puVar7 = *(uint **)(puVar7 + 6)) {
        if ((puVar7[8] == uVar4) && (*puVar7 == uVar4)) {
          if (puVar7 != (uint *)0x0) {
            if (puVar7 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            uVar6 = *(undefined8 *)(puVar7 + 2);
            local_38 = *(longlong **)(puVar7 + 4);
            local_50 = uVar6;
            local_48 = local_38;
            local_30 = uVar6;
            local_28 = local_38;
            if (local_38 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_38 + 1) = (int)local_38[1] + 1;
              UNLOCK();
            }
            goto LAB_140334e23;
          }
          break;
        }
      }
    }
    pvVar5 = operator_new(0x118);
    if (pvVar5 != (void *)0x0) {
      uVar6 = FUN_14034ac30(pvVar5);
    }
    local_40 = uVar6;
    FUN_140334f00(&local_38,uVar6);
    FUN_140178e90(&local_40,uVar6,uVar6,param_4,uVar9);
    uVar6 = local_40;
    local_50 = local_40;
    local_48 = local_38;
    FUN_14034ada0(local_40,uVar4);
    FUN_14030e3c0((longlong *)(param_1 + 0x50),uVar4,&local_50);
LAB_140334e23:
    plVar3 = local_48;
    *param_2 = uVar6;
    param_2[1] = local_38;
    plVar8 = (longlong *)0x0;
    if (local_38 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_38 + 1) = (int)local_38[1] + 1;
      UNLOCK();
      plVar8 = local_48;
    }
    if (plVar8 != (longlong *)0x0) {
      LOCK();
      plVar8 = plVar8 + 1;
      *(int *)plVar8 = (int)*plVar8 + -1;
      UNLOCK();
      if ((int)*plVar8 == 0) {
        (**(code **)(*local_48 + 8))(local_48);
        LOCK();
        piVar1 = (int *)((longlong)plVar3 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_48 + 0x10))();
        }
      }
    }
  }
  return param_2;
}



undefined8 * FUN_140334e90(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;
}



undefined8 * FUN_140334f00(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;
}



void FUN_140334f70(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14034a080(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140334fa0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14034acf0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140335163)
// WARNING: Removing unreachable block (ram,0x00014033513f)
// WARNING: Removing unreachable block (ram,0x000140335128)

undefined8 * FUN_140334fd0(longlong param_1,undefined8 *param_2,short *param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  short sVar3;
  uint uVar4;
  short *psVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong *plVar9;
  undefined8 *puVar10;
  short *psVar11;
  bool bVar12;
  undefined8 local_res18 [2];
  undefined8 uVar13;
  undefined8 *local_60;
  longlong *local_58;
  undefined1 local_50 [16];
  longlong *local_40;
  undefined8 *puVar5;
  
  uVar13 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  bVar12 = param_3 == (short *)0x0;
  if (!bVar12) {
    lVar8 = 1;
    psVar6 = param_3;
    psVar11 = &DAT_140477960;
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar12 = *psVar6 == *psVar11;
      psVar6 = psVar6 + 1;
      psVar11 = psVar11 + 1;
    } while (bVar12);
    if (!bVar12) {
      puVar10 = (undefined8 *)0x0;
      puVar7 = puVar10;
      if ((*(longlong *)(param_1 + 0x138) != 0) && (*(uint *)(param_1 + 0x140) != 0)) {
        puVar5 = puVar10;
        plVar9 = *(longlong **)(param_1 + 0x130);
        do {
          if (*plVar9 != 0) {
            puVar7 = (undefined8 *)(*(longlong **)(param_1 + 0x130))[(longlong)puVar5];
            break;
          }
          uVar4 = (int)puVar5 + 1;
          puVar5 = (undefined8 *)(ulonglong)uVar4;
          plVar9 = plVar9 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x140));
      }
      do {
        do {
          puVar5 = puVar7;
          if (puVar5 == (undefined8 *)0x0) {
            *(longlong *)(param_1 + 0x28) = *(longlong *)(param_1 + 0x28) + 1;
            local_res18[0] = *(undefined8 *)(param_1 + 0x28);
            *param_2 = local_res18[0];
            puVar7 = operator_new(0x50);
            if (puVar7 != (undefined8 *)0x0) {
              puVar7[3] = 7;
              puVar7[2] = 0;
              *(undefined2 *)puVar7 = 0;
              puVar7[5] = 0;
              puVar7[6] = 0;
              puVar7[7] = 0;
              *(undefined4 *)(puVar7 + 9) = 0;
              puVar10 = puVar7;
            }
            local_60 = puVar10;
            FUN_1403389a0(&local_58,puVar10);
            FUN_140178e90(&local_60,puVar10,puVar10,param_4,uVar13);
            FUN_14033dbb0(local_60,param_3);
            LOCK();
            *(int *)(local_60 + 9) = *(int *)(local_60 + 9) + 1;
            UNLOCK();
            puVar7 = (undefined8 *)FUN_1402f3af0(local_50,local_res18,&local_60);
            FUN_14031a010(param_1 + 0x130,*puVar7,puVar7 + 1);
            if (local_40 != (longlong *)0x0) {
              LOCK();
              plVar9 = local_40 + 1;
              *(int *)plVar9 = (int)*plVar9 + -1;
              UNLOCK();
              if ((int)*plVar9 == 0) {
                (**(code **)(*local_40 + 8))(local_40);
                LOCK();
                piVar1 = (int *)((longlong)local_40 + 0xc);
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                if (*piVar1 == 0) {
                  (**(code **)(*local_40 + 0x10))(local_40);
                }
              }
            }
            puVar7 = local_60;
            if (local_58 != (longlong *)0x0) {
              LOCK();
              plVar9 = local_58 + 1;
              *(int *)plVar9 = (int)*plVar9 + -1;
              UNLOCK();
              if ((int)*plVar9 == 0) {
                (**(code **)(*local_58 + 8))(local_58);
                LOCK();
                piVar1 = (int *)((longlong)local_58 + 0xc);
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                if (*piVar1 == 0) {
                  (**(code **)(*local_58 + 0x10))(local_58);
                }
              }
            }
            LeaveCriticalSection(DAT_1406082a8);
            return puVar7;
          }
          puVar7 = (undefined8 *)puVar5[1];
          if (7 < (ulonglong)puVar7[3]) {
            puVar7 = (undefined8 *)*puVar7;
          }
          psVar6 = param_3;
          do {
            sVar2 = *psVar6;
            sVar3 = *(short *)((longlong)psVar6 + ((longlong)puVar7 - (longlong)param_3));
            if (sVar2 != sVar3) break;
            psVar6 = psVar6 + 1;
          } while (sVar3 != 0);
          if (sVar2 == sVar3) {
            if (puVar5 != (undefined8 *)0x0) {
              *param_2 = *puVar5;
              LOCK();
              *(int *)(puVar5[1] + 0x48) = *(int *)(puVar5[1] + 0x48) + 1;
              UNLOCK();
              puVar7 = (undefined8 *)puVar5[1];
              LeaveCriticalSection(DAT_1406082a8);
              return puVar7;
            }
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          puVar7 = puVar10;
        } while ((puVar5 == (undefined8 *)0x0) ||
                (puVar7 = (undefined8 *)puVar5[3], (undefined8 *)puVar5[3] != (undefined8 *)0x0));
        uVar4 = *(uint *)(puVar5 + 4) % *(uint *)(param_1 + 0x140) + 1;
        lVar8 = (longlong)(int)uVar4 << 3;
        puVar7 = puVar10;
        do {
          if (*(uint *)(param_1 + 0x140) <= uVar4) break;
          if (*(longlong *)(*(longlong *)(param_1 + 0x130) + lVar8) != 0) {
            puVar7 = *(undefined8 **)(*(longlong *)(param_1 + 0x130) + lVar8);
          }
          uVar4 = uVar4 + 1;
          lVar8 = lVar8 + 8;
        } while (puVar7 == (undefined8 *)0x0);
      } while( true );
    }
  }
  LeaveCriticalSection(DAT_1406082a8);
  return (undefined8 *)0x0;
}



void FUN_1403352a0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  plVar3 = *(longlong **)(param_1 + 0x10);
  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;
}



// WARNING: Removing unreachable block (ram,0x000140335556)
// WARNING: Removing unreachable block (ram,0x000140335511)
// WARNING: Removing unreachable block (ram,0x0001403354ca)

void FUN_1403352e0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  short sVar4;
  short sVar5;
  longlong *plVar6;
  uint uVar7;
  short *psVar9;
  longlong *plVar10;
  longlong *plVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  longlong *plVar14;
  longlong lVar15;
  undefined1 local_res20 [8];
  undefined8 uVar16;
  ulonglong uVar8;
  
  uVar16 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  plVar3 = (longlong *)(param_1 + 0x130);
  uVar13 = 0;
  uVar12 = uVar13;
  if ((*(longlong *)(param_1 + 0x138) != 0) && (*(uint *)(param_1 + 0x140) != 0)) {
    uVar8 = uVar13;
    plVar11 = (longlong *)*plVar3;
    do {
      if (*plVar11 != 0) {
        uVar12 = ((longlong *)*plVar3)[uVar8];
        break;
      }
      uVar7 = (int)uVar8 + 1;
      uVar8 = (ulonglong)uVar7;
      plVar11 = plVar11 + 1;
    } while (uVar7 < *(uint *)(param_1 + 0x140));
  }
LAB_140335351:
  uVar8 = uVar12;
  if (uVar8 == 0) goto LAB_140335561;
  psVar9 = *(short **)(uVar8 + 8);
  if (7 < *(ulonglong *)(psVar9 + 0xc)) {
    psVar9 = *(short **)psVar9;
  }
  lVar15 = param_2 - (longlong)psVar9;
  do {
    sVar4 = *psVar9;
    sVar5 = *(short *)((longlong)psVar9 + lVar15);
    if (sVar4 != sVar5) break;
    psVar9 = psVar9 + 1;
  } while (sVar5 != 0);
  if (sVar4 != sVar5) {
    uVar12 = uVar13;
    if ((uVar8 != 0) && (uVar12 = *(ulonglong *)(uVar8 + 0x18), *(ulonglong *)(uVar8 + 0x18) == 0))
    {
      uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x140) + 1;
      lVar15 = (longlong)(int)uVar7 << 3;
      uVar12 = uVar13;
      do {
        if (*(uint *)(param_1 + 0x140) <= uVar7) break;
        if (*(longlong *)(lVar15 + *plVar3) != 0) {
          uVar12 = *(ulonglong *)(lVar15 + *plVar3);
        }
        uVar7 = uVar7 + 1;
        lVar15 = lVar15 + 8;
      } while (uVar12 == 0);
    }
    goto LAB_140335351;
  }
  if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar15 = *(longlong *)(uVar8 + 8);
  if (*(longlong *)(lVar15 + 0x28) != *(longlong *)(lVar15 + 0x30)) {
    plVar10 = (longlong *)FUN_140333a10();
    plVar11 = *(longlong **)(lVar15 + 0x30);
    if (plVar10 != plVar11) {
      plVar14 = plVar10 + 1;
      do {
        plVar6 = (longlong *)*plVar14;
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar6 + 0x10))(plVar6);
            }
          }
        }
        plVar6 = plVar14 + 1;
        plVar14 = plVar14 + 2;
      } while (plVar6 != plVar11);
    }
    *(longlong **)(lVar15 + 0x30) = plVar10;
  }
  if ((uVar8 != 0) && (*(longlong *)(uVar8 + 0x18) == 0)) {
    uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x140) + 1;
    lVar15 = (longlong)(int)uVar7 << 3;
    uVar12 = uVar13;
    do {
      if (*(uint *)(param_1 + 0x140) <= uVar7) break;
      if (*(longlong *)(lVar15 + *plVar3) != 0) {
        uVar12 = *(ulonglong *)(lVar15 + *plVar3);
      }
      uVar7 = uVar7 + 1;
      lVar15 = lVar15 + 8;
    } while (uVar12 == 0);
  }
  uVar7 = *(uint *)(uVar8 + 0x20);
  uVar12 = (ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x140);
  lVar15 = *plVar3;
  if (uVar8 != *(ulonglong *)(lVar15 + uVar12 * 8)) {
    uVar13 = *(ulonglong *)(lVar15 + uVar12 * 8);
    for (uVar12 = *(ulonglong *)(uVar13 + 0x18); uVar12 != uVar8;
        uVar12 = *(ulonglong *)(uVar12 + 0x18)) {
      uVar13 = uVar12;
    }
  }
  if (uVar13 == 0) {
    *(undefined8 *)(lVar15 + ((ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x140)) * 8) =
         *(undefined8 *)(uVar8 + 0x18);
  }
  else {
    *(undefined8 *)(uVar13 + 0x18) = *(undefined8 *)(uVar8 + 0x18);
  }
  FUN_1402c6e80(plVar3,uVar8,lVar15,(ulonglong)uVar7,uVar16);
  FUN_140334fd0(param_1,local_res20,param_2);
LAB_140335561:
                    // WARNING: Could not recover jumptable at 0x000140335578. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403356eb)
// WARNING: Removing unreachable block (ram,0x0001403356c8)

undefined8 FUN_140335580(longlong param_1,short *param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  short sVar3;
  uint uVar4;
  short *psVar6;
  void *pvVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  longlong lVar10;
  longlong *plVar11;
  short *psVar12;
  bool bVar13;
  undefined8 local_res10;
  undefined8 uVar14;
  undefined8 *local_50;
  longlong *local_48;
  undefined1 local_40 [16];
  longlong *local_30;
  undefined8 *puVar5;
  
  uVar14 = 0xfffffffffffffffe;
  bVar13 = param_2 == (short *)0x0;
  if (!bVar13) {
    lVar10 = 1;
    psVar6 = param_2;
    psVar12 = &DAT_140477960;
    do {
      if (lVar10 == 0) break;
      lVar10 = lVar10 + -1;
      bVar13 = *psVar6 == *psVar12;
      psVar6 = psVar6 + 1;
      psVar12 = psVar12 + 1;
    } while (bVar13);
    if (!bVar13) {
      EnterCriticalSection(DAT_1406082a8);
      puVar8 = (undefined8 *)0x0;
      puVar9 = puVar8;
      if ((*(longlong *)(param_1 + 0x60) != 0) && (*(uint *)(param_1 + 0x68) != 0)) {
        puVar5 = puVar8;
        plVar11 = *(longlong **)(param_1 + 0x58);
        do {
          if (*plVar11 != 0) {
            puVar9 = (undefined8 *)(*(longlong **)(param_1 + 0x58))[(longlong)puVar5];
            break;
          }
          uVar4 = (int)puVar5 + 1;
          puVar5 = (undefined8 *)(ulonglong)uVar4;
          plVar11 = plVar11 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x68));
      }
      do {
        do {
          puVar5 = puVar9;
          if (puVar5 == (undefined8 *)0x0) {
            *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 1;
            local_res10 = *(undefined8 *)(param_1 + 0x10);
            pvVar7 = operator_new(0x78);
            if (pvVar7 != (void *)0x0) {
              puVar8 = (undefined8 *)FUN_140342050(pvVar7);
            }
            local_50 = puVar8;
            FUN_140338a10(&local_48,puVar8);
            FUN_140178e90(&local_50,puVar8,puVar8,param_4,uVar14);
            FUN_14034b130(local_50,param_2);
            LOCK();
            *(int *)(local_50 + 0xe) = *(int *)(local_50 + 0xe) + 1;
            UNLOCK();
            puVar9 = (undefined8 *)FUN_1402f3af0(local_40,&local_res10,&local_50);
            FUN_14031a010(param_1 + 0x58,*puVar9,puVar9 + 1);
            if (local_30 != (longlong *)0x0) {
              LOCK();
              plVar11 = local_30 + 1;
              *(int *)plVar11 = (int)*plVar11 + -1;
              UNLOCK();
              if ((int)*plVar11 == 0) {
                (**(code **)(*local_30 + 8))(local_30);
                LOCK();
                piVar1 = (int *)((longlong)local_30 + 0xc);
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                if (*piVar1 == 0) {
                  (**(code **)(*local_30 + 0x10))(local_30);
                }
              }
            }
            if (local_48 != (longlong *)0x0) {
              LOCK();
              plVar11 = local_48 + 1;
              *(int *)plVar11 = (int)*plVar11 + -1;
              UNLOCK();
              if ((int)*plVar11 == 0) {
                (**(code **)(*local_48 + 8))(local_48);
                LOCK();
                piVar1 = (int *)((longlong)local_48 + 0xc);
                *piVar1 = *piVar1 + -1;
                UNLOCK();
                if (*piVar1 == 0) {
                  (**(code **)(*local_48 + 0x10))(local_48);
                }
              }
            }
            LeaveCriticalSection(DAT_1406082a8);
            return local_res10;
          }
          puVar9 = (undefined8 *)puVar5[1];
          if (7 < (ulonglong)puVar9[3]) {
            puVar9 = (undefined8 *)*puVar9;
          }
          psVar6 = param_2;
          do {
            sVar2 = *psVar6;
            sVar3 = *(short *)((longlong)psVar6 + ((longlong)puVar9 - (longlong)param_2));
            if (sVar2 != sVar3) break;
            psVar6 = psVar6 + 1;
          } while (sVar3 != 0);
          if (sVar2 == sVar3) {
            if (puVar5 != (undefined8 *)0x0) {
              LOCK();
              *(int *)(puVar5[1] + 0x70) = *(int *)(puVar5[1] + 0x70) + 1;
              UNLOCK();
              uVar14 = *puVar5;
              LeaveCriticalSection(DAT_1406082a8);
              return uVar14;
            }
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          puVar9 = puVar8;
        } while ((puVar5 == (undefined8 *)0x0) ||
                (puVar9 = (undefined8 *)puVar5[3], (undefined8 *)puVar5[3] != (undefined8 *)0x0));
        uVar4 = *(uint *)(puVar5 + 4) % *(uint *)(param_1 + 0x68) + 1;
        lVar10 = (longlong)(int)uVar4 << 3;
        puVar9 = puVar8;
        do {
          if (*(uint *)(param_1 + 0x68) <= uVar4) break;
          if (*(longlong *)(lVar10 + *(longlong *)(param_1 + 0x58)) != 0) {
            puVar9 = *(undefined8 **)(lVar10 + *(longlong *)(param_1 + 0x58));
          }
          uVar4 = uVar4 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar9 == (undefined8 *)0x0);
      } while( true );
    }
  }
  return 0;
}



// WARNING: Removing unreachable block (ram,0x000140335a0e)
// WARNING: Removing unreachable block (ram,0x0001403359d0)
// WARNING: Removing unreachable block (ram,0x000140335984)

void FUN_140335810(longlong param_1,longlong param_2)

{
  short sVar1;
  short sVar2;
  uint uVar3;
  short *psVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong lVar9;
  undefined8 uVar10;
  ulonglong uVar4;
  
  uVar10 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  uVar8 = 0;
  uVar7 = uVar8;
  if ((*(longlong *)(param_1 + 0x60) != 0) && (*(uint *)(param_1 + 0x68) != 0)) {
    uVar4 = uVar8;
    plVar6 = *(longlong **)(param_1 + 0x58);
    do {
      if (*plVar6 != 0) {
        uVar7 = (*(longlong **)(param_1 + 0x58))[uVar4];
        break;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      plVar6 = plVar6 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0x68));
  }
LAB_140335880:
  uVar4 = uVar7;
  if (uVar4 != 0) {
    psVar5 = *(short **)(uVar4 + 8);
    if (7 < *(ulonglong *)(psVar5 + 0xc)) {
      psVar5 = *(short **)psVar5;
    }
    lVar9 = param_2 - (longlong)psVar5;
    do {
      sVar1 = *psVar5;
      sVar2 = *(short *)((longlong)psVar5 + lVar9);
      if (sVar1 != sVar2) break;
      psVar5 = psVar5 + 1;
    } while (sVar2 != 0);
    if (sVar1 == sVar2) {
      if (uVar4 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_1402f3920(*(longlong *)(uVar4 + 8) + 0x28);
      if ((uVar4 == 0) || (*(longlong *)(uVar4 + 0x18) != 0)) goto LAB_14033598f;
      uVar3 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x68) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      uVar7 = uVar8;
      goto LAB_140335961;
    }
    uVar7 = uVar8;
    if ((uVar4 != 0) && (uVar7 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
      uVar3 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x68) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      uVar7 = uVar8;
      do {
        if (*(uint *)(param_1 + 0x68) <= uVar3) break;
        if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0x58)) != 0) {
          uVar7 = *(ulonglong *)(lVar9 + *(longlong *)(param_1 + 0x58));
        }
        uVar3 = uVar3 + 1;
        lVar9 = lVar9 + 8;
      } while (uVar7 == 0);
    }
    goto LAB_140335880;
  }
  goto LAB_140335a19;
  while( true ) {
    if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0x58)) != 0) {
      uVar7 = *(ulonglong *)(lVar9 + *(longlong *)(param_1 + 0x58));
    }
    uVar3 = uVar3 + 1;
    lVar9 = lVar9 + 8;
    if (uVar7 != 0) break;
LAB_140335961:
    if (*(uint *)(param_1 + 0x68) <= uVar3) break;
  }
LAB_14033598f:
  uVar3 = *(uint *)(uVar4 + 0x20);
  uVar7 = (ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x68);
  lVar9 = *(longlong *)(param_1 + 0x58);
  if (uVar4 != *(ulonglong *)(lVar9 + uVar7 * 8)) {
    uVar8 = *(ulonglong *)(lVar9 + uVar7 * 8);
    for (uVar7 = *(ulonglong *)(uVar8 + 0x18); uVar7 != uVar4; uVar7 = *(ulonglong *)(uVar7 + 0x18))
    {
      uVar8 = uVar7;
    }
  }
  if (uVar8 == 0) {
    *(undefined8 *)(lVar9 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x68)) * 8) =
         *(undefined8 *)(uVar4 + 0x18);
  }
  else {
    *(undefined8 *)(uVar8 + 0x18) = *(undefined8 *)(uVar4 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0x58,uVar4,lVar9,(ulonglong)uVar3,uVar10);
  FUN_140335580(param_1,param_2);
LAB_140335a19:
                    // WARNING: Could not recover jumptable at 0x000140335a38. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140335bc3)
// WARNING: Removing unreachable block (ram,0x000140335b9f)
// WARNING: Removing unreachable block (ram,0x000140335b8a)

undefined8 * FUN_140335a40(longlong param_1,undefined8 *param_2,short *param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  short sVar3;
  uint uVar4;
  short *psVar6;
  void *pvVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  longlong lVar10;
  longlong *plVar11;
  short *psVar12;
  bool bVar13;
  undefined8 local_res20;
  undefined8 uVar14;
  undefined8 *local_60;
  longlong *local_58;
  undefined1 local_50 [16];
  longlong *local_40;
  undefined8 *puVar5;
  
  bVar13 = &stack0x00000000 == (undefined1 *)0x88;
  uVar14 = 0xfffffffffffffffe;
  lVar10 = 1;
  psVar6 = param_3;
  psVar12 = &DAT_140477960;
  do {
    if (lVar10 == 0) break;
    lVar10 = lVar10 + -1;
    bVar13 = *psVar6 == *psVar12;
    psVar6 = psVar6 + 1;
    psVar12 = psVar12 + 1;
  } while (bVar13);
  if (bVar13) {
    puVar9 = (undefined8 *)0x0;
  }
  else {
    EnterCriticalSection(DAT_1406082a8);
    puVar8 = (undefined8 *)0x0;
    puVar9 = puVar8;
    if ((*(longlong *)(param_1 + 0xa8) != 0) && (*(uint *)(param_1 + 0xb0) != 0)) {
      puVar5 = puVar8;
      plVar11 = *(longlong **)(param_1 + 0xa0);
      do {
        if (*plVar11 != 0) {
          puVar9 = (undefined8 *)(*(longlong **)(param_1 + 0xa0))[(longlong)puVar5];
          break;
        }
        uVar4 = (int)puVar5 + 1;
        puVar5 = (undefined8 *)(ulonglong)uVar4;
        plVar11 = plVar11 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0xb0));
    }
LAB_140335ad0:
    puVar5 = puVar9;
    if (puVar5 != (undefined8 *)0x0) {
      puVar9 = (undefined8 *)puVar5[1];
      if (7 < (ulonglong)puVar9[3]) {
        puVar9 = (undefined8 *)*puVar9;
      }
      psVar6 = param_3;
      do {
        sVar2 = *psVar6;
        sVar3 = *(short *)((longlong)psVar6 + ((longlong)puVar9 - (longlong)param_3));
        if (sVar2 != sVar3) break;
        psVar6 = psVar6 + 1;
      } while (sVar3 != 0);
      if (sVar2 == sVar3) {
        if (puVar5 != (undefined8 *)0x0) {
          LOCK();
          *(int *)(puVar5[1] + 0x70) = *(int *)(puVar5[1] + 0x70) + 1;
          UNLOCK();
          *param_2 = *puVar5;
          puVar9 = (undefined8 *)puVar5[1];
          LeaveCriticalSection(DAT_1406082a8);
          return puVar9;
        }
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      puVar9 = puVar8;
      if ((puVar5 != (undefined8 *)0x0) &&
         (puVar9 = (undefined8 *)puVar5[3], (undefined8 *)puVar5[3] == (undefined8 *)0x0)) {
        uVar4 = *(uint *)(puVar5 + 4) % *(uint *)(param_1 + 0xb0) + 1;
        lVar10 = (longlong)(int)uVar4 << 3;
        puVar9 = puVar8;
        do {
          if (*(uint *)(param_1 + 0xb0) <= uVar4) break;
          if (*(longlong *)(lVar10 + *(longlong *)(param_1 + 0xa0)) != 0) {
            puVar9 = *(undefined8 **)(lVar10 + *(longlong *)(param_1 + 0xa0));
          }
          uVar4 = uVar4 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar9 == (undefined8 *)0x0);
      }
      goto LAB_140335ad0;
    }
    *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x18) + 1;
    local_res20 = *(undefined8 *)(param_1 + 0x18);
    pvVar7 = operator_new(0x78);
    if (pvVar7 != (void *)0x0) {
      puVar8 = (undefined8 *)FUN_140342050(pvVar7);
    }
    local_60 = puVar8;
    FUN_140338a80(&local_58,puVar8);
    FUN_140178e90(&local_60,puVar8,puVar8,param_4,uVar14);
    FUN_140342110(local_60,param_3);
    LOCK();
    *(int *)(local_60 + 0xe) = *(int *)(local_60 + 0xe) + 1;
    UNLOCK();
    puVar9 = (undefined8 *)FUN_1402f3af0(local_50,&local_res20,&local_60);
    FUN_14031a010(param_1 + 0xa0,*puVar9,puVar9 + 1);
    if (local_40 != (longlong *)0x0) {
      LOCK();
      plVar11 = local_40 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      if ((int)*plVar11 == 0) {
        (**(code **)(*local_40 + 8))(local_40);
        LOCK();
        piVar1 = (int *)((longlong)local_40 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_40 + 0x10))(local_40);
        }
      }
    }
    puVar9 = local_60;
    *param_2 = local_res20;
    if (local_58 != (longlong *)0x0) {
      LOCK();
      plVar11 = local_58 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      if ((int)*plVar11 == 0) {
        (**(code **)(*local_58 + 8))(local_58);
        LOCK();
        piVar1 = (int *)((longlong)local_58 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_58 + 0x10))(local_58);
        }
      }
    }
    LeaveCriticalSection(DAT_1406082a8);
  }
  return puVar9;
}



// WARNING: Removing unreachable block (ram,0x000140335f0b)
// WARNING: Removing unreachable block (ram,0x000140335ec0)
// WARNING: Removing unreachable block (ram,0x000140335e76)

void FUN_140335cf0(longlong param_1,longlong param_2)

{
  short sVar1;
  short sVar2;
  uint uVar3;
  short *psVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong lVar9;
  undefined1 local_res8 [8];
  undefined8 uVar10;
  ulonglong uVar4;
  
  uVar10 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  uVar8 = 0;
  uVar7 = uVar8;
  if ((*(longlong *)(param_1 + 0xa8) != 0) && (*(uint *)(param_1 + 0xb0) != 0)) {
    uVar4 = uVar8;
    plVar6 = *(longlong **)(param_1 + 0xa0);
    do {
      if (*plVar6 != 0) {
        uVar7 = (*(longlong **)(param_1 + 0xa0))[uVar4];
        break;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      plVar6 = plVar6 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0xb0));
  }
LAB_140335d62:
  uVar4 = uVar7;
  if (uVar4 != 0) {
    psVar5 = *(short **)(uVar4 + 8);
    if (7 < *(ulonglong *)(psVar5 + 0xc)) {
      psVar5 = *(short **)psVar5;
    }
    lVar9 = param_2 - (longlong)psVar5;
    do {
      sVar1 = *psVar5;
      sVar2 = *(short *)((longlong)psVar5 + lVar9);
      if (sVar1 != sVar2) break;
      psVar5 = psVar5 + 1;
    } while (sVar2 != 0);
    if (sVar1 == sVar2) {
      if (uVar4 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_1402f3920(*(longlong *)(uVar4 + 8) + 0x28);
      if ((uVar4 == 0) || (*(longlong *)(uVar4 + 0x18) != 0)) goto LAB_140335e81;
      uVar3 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0xb0) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      uVar7 = uVar8;
      goto LAB_140335e50;
    }
    uVar7 = uVar8;
    if ((uVar4 != 0) && (uVar7 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
      uVar3 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0xb0) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      uVar7 = uVar8;
      do {
        if (*(uint *)(param_1 + 0xb0) <= uVar3) break;
        if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0xa0)) != 0) {
          uVar7 = *(ulonglong *)(lVar9 + *(longlong *)(param_1 + 0xa0));
        }
        uVar3 = uVar3 + 1;
        lVar9 = lVar9 + 8;
      } while (uVar7 == 0);
    }
    goto LAB_140335d62;
  }
  goto LAB_140335f16;
  while( true ) {
    if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0xa0)) != 0) {
      uVar7 = *(ulonglong *)(lVar9 + *(longlong *)(param_1 + 0xa0));
    }
    uVar3 = uVar3 + 1;
    lVar9 = lVar9 + 8;
    if (uVar7 != 0) break;
LAB_140335e50:
    if (*(uint *)(param_1 + 0xb0) <= uVar3) break;
  }
LAB_140335e81:
  uVar3 = *(uint *)(uVar4 + 0x20);
  uVar7 = (ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0xb0);
  lVar9 = *(longlong *)(param_1 + 0xa0);
  if (uVar4 != *(ulonglong *)(lVar9 + uVar7 * 8)) {
    uVar8 = *(ulonglong *)(lVar9 + uVar7 * 8);
    for (uVar7 = *(ulonglong *)(uVar8 + 0x18); uVar7 != uVar4; uVar7 = *(ulonglong *)(uVar7 + 0x18))
    {
      uVar8 = uVar7;
    }
  }
  if (uVar8 == 0) {
    *(undefined8 *)(lVar9 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0xb0)) * 8) =
         *(undefined8 *)(uVar4 + 0x18);
  }
  else {
    *(undefined8 *)(uVar8 + 0x18) = *(undefined8 *)(uVar4 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0xa0,uVar4,lVar9,(ulonglong)uVar3,uVar10);
  if (param_2 != 0) {
    FUN_140335a40(param_1,local_res8,param_2);
  }
LAB_140335f16:
                    // WARNING: Could not recover jumptable at 0x000140335f35. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403360af)
// WARNING: Removing unreachable block (ram,0x00014033608b)

undefined2 * FUN_140335f40(longlong param_1,undefined8 *param_2,short *param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  short sVar3;
  uint uVar4;
  short *psVar6;
  undefined2 *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  undefined2 *puVar11;
  short *psVar12;
  bool bVar13;
  undefined8 local_res20;
  undefined8 uVar14;
  undefined2 *local_60;
  longlong *local_58;
  undefined1 local_50 [16];
  longlong *local_40;
  undefined2 *puVar5;
  
  bVar13 = &stack0x00000000 == (undefined1 *)0x88;
  uVar14 = 0xfffffffffffffffe;
  lVar9 = 1;
  psVar6 = param_3;
  psVar12 = &DAT_140477960;
  do {
    if (lVar9 == 0) break;
    lVar9 = lVar9 + -1;
    bVar13 = *psVar6 == *psVar12;
    psVar6 = psVar6 + 1;
    psVar12 = psVar12 + 1;
  } while (bVar13);
  if (bVar13) {
    puVar7 = (undefined2 *)0x0;
  }
  else {
    EnterCriticalSection(DAT_1406082a8);
    puVar11 = (undefined2 *)0x0;
    puVar7 = puVar11;
    if ((*(longlong *)(param_1 + 0xf0) != 0) && (*(uint *)(param_1 + 0xf8) != 0)) {
      puVar5 = puVar11;
      plVar10 = *(longlong **)(param_1 + 0xe8);
      do {
        if (*plVar10 != 0) {
          puVar7 = (undefined2 *)(*(longlong **)(param_1 + 0xe8))[(longlong)puVar5];
          break;
        }
        uVar4 = (int)puVar5 + 1;
        puVar5 = (undefined2 *)(ulonglong)uVar4;
        plVar10 = plVar10 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0xf8));
    }
LAB_140335fd0:
    puVar5 = puVar7;
    if (puVar5 != (undefined2 *)0x0) {
      puVar8 = *(undefined8 **)(puVar5 + 4);
      if (7 < (ulonglong)puVar8[3]) {
        puVar8 = (undefined8 *)*puVar8;
      }
      psVar6 = param_3;
      do {
        sVar2 = *psVar6;
        sVar3 = *(short *)((longlong)psVar6 + ((longlong)puVar8 - (longlong)param_3));
        if (sVar2 != sVar3) break;
        psVar6 = psVar6 + 1;
      } while (sVar3 != 0);
      if (sVar2 == sVar3) {
        if (puVar5 != (undefined2 *)0x0) {
          LOCK();
          *(int *)(*(longlong *)(puVar5 + 4) + 0x48) =
               *(int *)(*(longlong *)(puVar5 + 4) + 0x48) + 1;
          UNLOCK();
          puVar7 = *(undefined2 **)(puVar5 + 4);
          LeaveCriticalSection(DAT_1406082a8);
          return puVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      puVar7 = puVar11;
      if ((puVar5 != (undefined2 *)0x0) &&
         (puVar7 = *(undefined2 **)(puVar5 + 0xc),
         *(undefined2 **)(puVar5 + 0xc) == (undefined2 *)0x0)) {
        uVar4 = *(uint *)(puVar5 + 0x10) % *(uint *)(param_1 + 0xf8) + 1;
        lVar9 = (longlong)(int)uVar4 << 3;
        puVar7 = puVar11;
        do {
          if (*(uint *)(param_1 + 0xf8) <= uVar4) break;
          if (*(longlong *)(*(longlong *)(param_1 + 0xe8) + lVar9) != 0) {
            puVar7 = *(undefined2 **)(*(longlong *)(param_1 + 0xe8) + lVar9);
          }
          uVar4 = uVar4 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar7 == (undefined2 *)0x0);
      }
      goto LAB_140335fd0;
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + 1;
    local_res20 = *(undefined8 *)(param_1 + 0x20);
    puVar7 = operator_new(0x50);
    if (puVar7 != (undefined2 *)0x0) {
      *(undefined8 *)(puVar7 + 0xc) = 7;
      *(undefined8 *)(puVar7 + 8) = 0;
      *puVar7 = 0;
      *(undefined8 *)(puVar7 + 0x14) = 0;
      *(undefined8 *)(puVar7 + 0x18) = 0;
      *(undefined8 *)(puVar7 + 0x1c) = 0;
      *(undefined4 *)(puVar7 + 0x24) = 0;
      puVar11 = puVar7;
    }
    local_60 = puVar11;
    FUN_140338af0(&local_58,puVar11);
    FUN_140178e90(&local_60,puVar11,puVar11,param_4,uVar14);
    FUN_14034b6c0(local_60,param_3);
    LOCK();
    *(int *)(local_60 + 0x24) = *(int *)(local_60 + 0x24) + 1;
    UNLOCK();
    puVar8 = (undefined8 *)FUN_1402f3af0(local_50,&local_res20,&local_60);
    FUN_14031a010(param_1 + 0xe8,*puVar8,puVar8 + 1);
    if (local_40 != (longlong *)0x0) {
      LOCK();
      plVar10 = local_40 + 1;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      if ((int)*plVar10 == 0) {
        (**(code **)(*local_40 + 8))(local_40);
        LOCK();
        piVar1 = (int *)((longlong)local_40 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_40 + 0x10))(local_40);
        }
      }
    }
    puVar7 = local_60;
    *param_2 = local_res20;
    if (local_58 != (longlong *)0x0) {
      LOCK();
      plVar10 = local_58 + 1;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      if ((int)*plVar10 == 0) {
        (**(code **)(*local_58 + 8))(local_58);
        LOCK();
        piVar1 = (int *)((longlong)local_58 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_58 + 0x10))(local_58);
        }
      }
    }
    LeaveCriticalSection(DAT_1406082a8);
  }
  return puVar7;
}



// WARNING: Removing unreachable block (ram,0x00014033647b)
// WARNING: Removing unreachable block (ram,0x000140336431)
// WARNING: Removing unreachable block (ram,0x0001403363ec)

void FUN_1403361f0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  short sVar4;
  short sVar5;
  longlong *plVar6;
  uint uVar7;
  short *psVar9;
  longlong *plVar10;
  longlong *plVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  longlong *plVar14;
  longlong lVar15;
  undefined1 local_res20 [8];
  undefined8 uVar16;
  ulonglong uVar8;
  
  uVar16 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  plVar3 = (longlong *)(param_1 + 0xe8);
  uVar13 = 0;
  uVar12 = uVar13;
  if ((*(longlong *)(param_1 + 0xf0) != 0) && (*(uint *)(param_1 + 0xf8) != 0)) {
    uVar8 = uVar13;
    plVar11 = (longlong *)*plVar3;
    do {
      if (*plVar11 != 0) {
        uVar12 = ((longlong *)*plVar3)[uVar8];
        break;
      }
      uVar7 = (int)uVar8 + 1;
      uVar8 = (ulonglong)uVar7;
      plVar11 = plVar11 + 1;
    } while (uVar7 < *(uint *)(param_1 + 0xf8));
  }
LAB_140336270:
  uVar8 = uVar12;
  if (uVar8 == 0) goto LAB_140336486;
  psVar9 = *(short **)(uVar8 + 8);
  if (7 < *(ulonglong *)(psVar9 + 0xc)) {
    psVar9 = *(short **)psVar9;
  }
  lVar15 = param_2 - (longlong)psVar9;
  do {
    sVar4 = *psVar9;
    sVar5 = *(short *)((longlong)psVar9 + lVar15);
    if (sVar4 != sVar5) break;
    psVar9 = psVar9 + 1;
  } while (sVar5 != 0);
  if (sVar4 != sVar5) {
    uVar12 = uVar13;
    if ((uVar8 != 0) && (uVar12 = *(ulonglong *)(uVar8 + 0x18), *(ulonglong *)(uVar8 + 0x18) == 0))
    {
      uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0xf8) + 1;
      lVar15 = (longlong)(int)uVar7 << 3;
      uVar12 = uVar13;
      do {
        if (*(uint *)(param_1 + 0xf8) <= uVar7) break;
        if (*(longlong *)(lVar15 + *plVar3) != 0) {
          uVar12 = *(ulonglong *)(lVar15 + *plVar3);
        }
        uVar7 = uVar7 + 1;
        lVar15 = lVar15 + 8;
      } while (uVar12 == 0);
    }
    goto LAB_140336270;
  }
  if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar15 = *(longlong *)(uVar8 + 8);
  if (*(longlong *)(lVar15 + 0x28) != *(longlong *)(lVar15 + 0x30)) {
    plVar10 = (longlong *)FUN_140333a10();
    plVar11 = *(longlong **)(lVar15 + 0x30);
    if (plVar10 != plVar11) {
      plVar14 = plVar10 + 1;
      do {
        plVar6 = (longlong *)*plVar14;
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar6 + 0x10))(plVar6);
            }
          }
        }
        plVar6 = plVar14 + 1;
        plVar14 = plVar14 + 2;
      } while (plVar6 != plVar11);
    }
    *(longlong **)(lVar15 + 0x30) = plVar10;
  }
  if ((uVar8 != 0) && (*(longlong *)(uVar8 + 0x18) == 0)) {
    uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0xf8) + 1;
    lVar15 = (longlong)(int)uVar7 << 3;
    uVar12 = uVar13;
    do {
      if (*(uint *)(param_1 + 0xf8) <= uVar7) break;
      if (*(longlong *)(lVar15 + *plVar3) != 0) {
        uVar12 = *(ulonglong *)(lVar15 + *plVar3);
      }
      uVar7 = uVar7 + 1;
      lVar15 = lVar15 + 8;
    } while (uVar12 == 0);
  }
  uVar7 = *(uint *)(uVar8 + 0x20);
  uVar12 = (ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0xf8);
  lVar15 = *plVar3;
  if (uVar8 != *(ulonglong *)(lVar15 + uVar12 * 8)) {
    uVar13 = *(ulonglong *)(lVar15 + uVar12 * 8);
    for (uVar12 = *(ulonglong *)(uVar13 + 0x18); uVar12 != uVar8;
        uVar12 = *(ulonglong *)(uVar12 + 0x18)) {
      uVar13 = uVar12;
    }
  }
  if (uVar13 == 0) {
    *(undefined8 *)(lVar15 + ((ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0xf8)) * 8) =
         *(undefined8 *)(uVar8 + 0x18);
  }
  else {
    *(undefined8 *)(uVar13 + 0x18) = *(undefined8 *)(uVar8 + 0x18);
  }
  FUN_1402c6e80(plVar3,uVar8,lVar15,(ulonglong)uVar7,uVar16);
  if (param_2 != 0) {
    FUN_140335f40(param_1,local_res20,param_2);
  }
LAB_140336486:
                    // WARNING: Could not recover jumptable at 0x00014033649d. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014033661e)
// WARNING: Removing unreachable block (ram,0x0001403365fa)

int * FUN_1403364b0(longlong param_1,undefined8 *param_2,short *param_3,undefined8 param_4)

{
  short sVar1;
  short sVar2;
  uint uVar3;
  int *piVar4;
  short *psVar6;
  void *pvVar7;
  int *piVar8;
  longlong lVar9;
  longlong *plVar10;
  short *psVar11;
  undefined8 *puVar12;
  bool bVar13;
  undefined8 local_res20;
  undefined8 uVar14;
  int *local_60;
  longlong *local_58;
  undefined1 local_50 [16];
  longlong *local_40;
  int *piVar5;
  
  bVar13 = &stack0x00000000 == (undefined1 *)0x88;
  uVar14 = 0xfffffffffffffffe;
  lVar9 = 1;
  psVar6 = param_3;
  psVar11 = &DAT_140477960;
  do {
    if (lVar9 == 0) break;
    lVar9 = lVar9 + -1;
    bVar13 = *psVar6 == *psVar11;
    psVar6 = psVar6 + 1;
    psVar11 = psVar11 + 1;
  } while (bVar13);
  if (bVar13) {
    piVar4 = (int *)0x0;
  }
  else {
    EnterCriticalSection(DAT_1406082a8);
    piVar8 = (int *)0x0;
    piVar4 = piVar8;
    if ((*(longlong *)(param_1 + 0x180) != 0) && (*(uint *)(param_1 + 0x188) != 0)) {
      piVar5 = piVar8;
      plVar10 = *(longlong **)(param_1 + 0x178);
      do {
        if (*plVar10 != 0) {
          piVar4 = (int *)(*(longlong **)(param_1 + 0x178))[(longlong)piVar5];
          break;
        }
        uVar3 = (int)piVar5 + 1;
        piVar5 = (int *)(ulonglong)uVar3;
        plVar10 = plVar10 + 1;
      } while (uVar3 < *(uint *)(param_1 + 0x188));
    }
LAB_140336540:
    piVar5 = piVar4;
    if (piVar5 != (int *)0x0) {
      puVar12 = (undefined8 *)(*(longlong *)(piVar5 + 2) + 8);
      if (7 < *(ulonglong *)(*(longlong *)(piVar5 + 2) + 0x20)) {
        puVar12 = (undefined8 *)*puVar12;
      }
      psVar6 = param_3;
      do {
        sVar1 = *psVar6;
        sVar2 = *(short *)((longlong)psVar6 + ((longlong)puVar12 - (longlong)param_3));
        if (sVar1 != sVar2) break;
        psVar6 = psVar6 + 1;
      } while (sVar2 != 0);
      if (sVar1 == sVar2) {
        if (piVar5 != (int *)0x0) {
          LOCK();
          **(int **)(piVar5 + 2) = **(int **)(piVar5 + 2) + 1;
          UNLOCK();
          piVar4 = *(int **)(piVar5 + 2);
          LeaveCriticalSection(DAT_1406082a8);
          return piVar4;
        }
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      piVar4 = piVar8;
      if ((piVar5 != (int *)0x0) &&
         (piVar4 = *(int **)(piVar5 + 6), *(int **)(piVar5 + 6) == (int *)0x0)) {
        uVar3 = (uint)piVar5[8] % *(uint *)(param_1 + 0x188) + 1;
        lVar9 = (longlong)(int)uVar3 << 3;
        piVar4 = piVar8;
        do {
          if (*(uint *)(param_1 + 0x188) <= uVar3) break;
          if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0x178)) != 0) {
            piVar4 = *(int **)(lVar9 + *(longlong *)(param_1 + 0x178));
          }
          uVar3 = uVar3 + 1;
          lVar9 = lVar9 + 8;
        } while (piVar4 == (int *)0x0);
      }
      goto LAB_140336540;
    }
    *(longlong *)(param_1 + 0x30) = *(longlong *)(param_1 + 0x30) + 1;
    local_res20 = *(undefined8 *)(param_1 + 0x30);
    pvVar7 = operator_new(0x78);
    if (pvVar7 != (void *)0x0) {
      piVar8 = (int *)FUN_14033f7b0(pvVar7);
    }
    local_60 = piVar8;
    FUN_140338b60(&local_58,piVar8);
    FUN_140178e90(&local_60,piVar8,piVar8,param_4,uVar14);
    FUN_14033f870(local_60,param_3);
    LOCK();
    *local_60 = *local_60 + 1;
    UNLOCK();
    puVar12 = (undefined8 *)FUN_1402f3af0(local_50,&local_res20,&local_60);
    FUN_14031a010(param_1 + 0x178,*puVar12,puVar12 + 1);
    if (local_40 != (longlong *)0x0) {
      LOCK();
      plVar10 = local_40 + 1;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      if ((int)*plVar10 == 0) {
        (**(code **)(*local_40 + 8))(local_40);
        LOCK();
        piVar4 = (int *)((longlong)local_40 + 0xc);
        *piVar4 = *piVar4 + -1;
        UNLOCK();
        if (*piVar4 == 0) {
          (**(code **)(*local_40 + 0x10))(local_40);
        }
      }
    }
    piVar4 = local_60;
    *param_2 = local_res20;
    if (local_58 != (longlong *)0x0) {
      LOCK();
      plVar10 = local_58 + 1;
      *(int *)plVar10 = (int)*plVar10 + -1;
      UNLOCK();
      if ((int)*plVar10 == 0) {
        (**(code **)(*local_58 + 8))(local_58);
        LOCK();
        piVar8 = (int *)((longlong)local_58 + 0xc);
        *piVar8 = *piVar8 + -1;
        UNLOCK();
        if (*piVar8 == 0) {
          (**(code **)(*local_58 + 0x10))(local_58);
        }
      }
    }
    LeaveCriticalSection(DAT_1406082a8);
  }
  return piVar4;
}



// WARNING: Removing unreachable block (ram,0x00014033696b)
// WARNING: Removing unreachable block (ram,0x000140336920)
// WARNING: Removing unreachable block (ram,0x0001403368d6)

void FUN_140336750(longlong param_1,longlong param_2)

{
  short sVar1;
  short sVar2;
  uint uVar3;
  short *psVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong lVar9;
  undefined1 local_res8 [8];
  undefined8 uVar10;
  ulonglong uVar4;
  
  uVar10 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  uVar8 = 0;
  uVar7 = uVar8;
  if ((*(longlong *)(param_1 + 0x180) != 0) && (*(uint *)(param_1 + 0x188) != 0)) {
    uVar4 = uVar8;
    plVar6 = *(longlong **)(param_1 + 0x178);
    do {
      if (*plVar6 != 0) {
        uVar7 = (*(longlong **)(param_1 + 0x178))[uVar4];
        break;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      plVar6 = plVar6 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0x188));
  }
LAB_1403367c2:
  uVar4 = uVar7;
  if (uVar4 != 0) {
    psVar5 = (short *)(*(longlong *)(uVar4 + 8) + 8);
    if (7 < *(ulonglong *)(*(longlong *)(uVar4 + 8) + 0x20)) {
      psVar5 = *(short **)psVar5;
    }
    lVar9 = param_2 - (longlong)psVar5;
    do {
      sVar1 = *psVar5;
      sVar2 = *(short *)((longlong)psVar5 + lVar9);
      if (sVar1 != sVar2) break;
      psVar5 = psVar5 + 1;
    } while (sVar2 != 0);
    if (sVar1 == sVar2) {
      if (uVar4 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_1402f3920(*(longlong *)(uVar4 + 8) + 0x30);
      if ((uVar4 == 0) || (*(longlong *)(uVar4 + 0x18) != 0)) goto LAB_1403368e1;
      uVar3 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x188) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      uVar7 = uVar8;
      goto LAB_1403368b0;
    }
    uVar7 = uVar8;
    if ((uVar4 != 0) && (uVar7 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
      uVar3 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x188) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      uVar7 = uVar8;
      do {
        if (*(uint *)(param_1 + 0x188) <= uVar3) break;
        if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0x178)) != 0) {
          uVar7 = *(ulonglong *)(lVar9 + *(longlong *)(param_1 + 0x178));
        }
        uVar3 = uVar3 + 1;
        lVar9 = lVar9 + 8;
      } while (uVar7 == 0);
    }
    goto LAB_1403367c2;
  }
  goto LAB_140336976;
  while( true ) {
    if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0x178)) != 0) {
      uVar7 = *(ulonglong *)(lVar9 + *(longlong *)(param_1 + 0x178));
    }
    uVar3 = uVar3 + 1;
    lVar9 = lVar9 + 8;
    if (uVar7 != 0) break;
LAB_1403368b0:
    if (*(uint *)(param_1 + 0x188) <= uVar3) break;
  }
LAB_1403368e1:
  uVar3 = *(uint *)(uVar4 + 0x20);
  uVar7 = (ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x188);
  lVar9 = *(longlong *)(param_1 + 0x178);
  if (uVar4 != *(ulonglong *)(lVar9 + uVar7 * 8)) {
    uVar8 = *(ulonglong *)(lVar9 + uVar7 * 8);
    for (uVar7 = *(ulonglong *)(uVar8 + 0x18); uVar7 != uVar4; uVar7 = *(ulonglong *)(uVar7 + 0x18))
    {
      uVar8 = uVar7;
    }
  }
  if (uVar8 == 0) {
    *(undefined8 *)(lVar9 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x188)) * 8) =
         *(undefined8 *)(uVar4 + 0x18);
  }
  else {
    *(undefined8 *)(uVar8 + 0x18) = *(undefined8 *)(uVar4 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0x178,uVar4,lVar9,(ulonglong)uVar3,uVar10);
  if (param_2 != 0) {
    FUN_1403364b0(param_1,local_res8,param_2);
  }
LAB_140336976:
                    // WARNING: Could not recover jumptable at 0x000140336995. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140336b0f)
// WARNING: Removing unreachable block (ram,0x000140336aeb)

ulonglong FUN_1403369a0(longlong param_1,undefined8 *param_2,short *param_3,undefined8 param_4)

{
  int *piVar1;
  short sVar2;
  short sVar3;
  uint uVar4;
  ulonglong uVar5;
  short *psVar7;
  void *pvVar8;
  ulonglong uVar9;
  longlong lVar10;
  longlong *plVar11;
  short *psVar12;
  undefined8 *puVar13;
  bool bVar14;
  undefined8 local_res20;
  undefined8 uVar15;
  ulonglong local_60;
  longlong *local_58;
  undefined1 local_50 [16];
  longlong *local_40;
  ulonglong uVar6;
  
  bVar14 = &stack0x00000000 == (undefined1 *)0x88;
  uVar15 = 0xfffffffffffffffe;
  lVar10 = 1;
  psVar7 = param_3;
  psVar12 = &DAT_140477960;
  do {
    if (lVar10 == 0) break;
    lVar10 = lVar10 + -1;
    bVar14 = *psVar7 == *psVar12;
    psVar7 = psVar7 + 1;
    psVar12 = psVar12 + 1;
  } while (bVar14);
  if (bVar14) {
    uVar5 = 0;
  }
  else {
    EnterCriticalSection(DAT_1406082a8);
    uVar9 = 0;
    uVar5 = uVar9;
    if ((*(longlong *)(param_1 + 0x1c8) != 0) && (*(uint *)(param_1 + 0x1d0) != 0)) {
      uVar6 = uVar9;
      plVar11 = *(longlong **)(param_1 + 0x1c0);
      do {
        if (*plVar11 != 0) {
          uVar5 = (*(longlong **)(param_1 + 0x1c0))[uVar6];
          break;
        }
        uVar4 = (int)uVar6 + 1;
        uVar6 = (ulonglong)uVar4;
        plVar11 = plVar11 + 1;
      } while (uVar4 < *(uint *)(param_1 + 0x1d0));
    }
LAB_140336a30:
    uVar6 = uVar5;
    if (uVar6 != 0) {
      puVar13 = (undefined8 *)(*(longlong *)(uVar6 + 8) + 8);
      if (7 < *(ulonglong *)(*(longlong *)(uVar6 + 8) + 0x20)) {
        puVar13 = (undefined8 *)*puVar13;
      }
      psVar7 = param_3;
      do {
        sVar2 = *psVar7;
        sVar3 = *(short *)((longlong)psVar7 + ((longlong)puVar13 - (longlong)param_3));
        if (sVar2 != sVar3) break;
        psVar7 = psVar7 + 1;
      } while (sVar3 != 0);
      if (sVar2 == sVar3) {
        if (uVar6 != 0) {
          LOCK();
          piVar1 = (int *)(*(longlong *)(uVar6 + 8) + 4);
          *piVar1 = *piVar1 + 1;
          UNLOCK();
          uVar5 = *(ulonglong *)(uVar6 + 8);
          LeaveCriticalSection(DAT_1406082a8);
          return uVar5;
        }
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar5 = uVar9;
      if ((uVar6 != 0) && (uVar5 = *(ulonglong *)(uVar6 + 0x18), *(ulonglong *)(uVar6 + 0x18) == 0))
      {
        uVar4 = *(uint *)(uVar6 + 0x20) % *(uint *)(param_1 + 0x1d0) + 1;
        lVar10 = (longlong)(int)uVar4 << 3;
        uVar5 = uVar9;
        do {
          if (*(uint *)(param_1 + 0x1d0) <= uVar4) break;
          if (*(longlong *)(lVar10 + *(longlong *)(param_1 + 0x1c0)) != 0) {
            uVar5 = *(ulonglong *)(lVar10 + *(longlong *)(param_1 + 0x1c0));
          }
          uVar4 = uVar4 + 1;
          lVar10 = lVar10 + 8;
        } while (uVar5 == 0);
      }
      goto LAB_140336a30;
    }
    *(longlong *)(param_1 + 0x38) = *(longlong *)(param_1 + 0x38) + 1;
    local_res20 = *(undefined8 *)(param_1 + 0x38);
    pvVar8 = operator_new(0x78);
    if (pvVar8 != (void *)0x0) {
      uVar9 = FUN_140340b50(pvVar8);
    }
    local_60 = uVar9;
    FUN_140338bd0(&local_58,uVar9);
    FUN_140178e90(&local_60,uVar9,uVar9,param_4,uVar15);
    FUN_140340c10(local_60,param_3);
    LOCK();
    *(int *)(local_60 + 4) = *(int *)(local_60 + 4) + 1;
    UNLOCK();
    puVar13 = (undefined8 *)FUN_1402f3af0(local_50,&local_res20,&local_60);
    FUN_14031a010(param_1 + 0x1c0,*puVar13,puVar13 + 1);
    if (local_40 != (longlong *)0x0) {
      LOCK();
      plVar11 = local_40 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      if ((int)*plVar11 == 0) {
        (**(code **)(*local_40 + 8))(local_40);
        LOCK();
        piVar1 = (int *)((longlong)local_40 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_40 + 0x10))(local_40);
        }
      }
    }
    uVar5 = local_60;
    *param_2 = local_res20;
    if (local_58 != (longlong *)0x0) {
      LOCK();
      plVar11 = local_58 + 1;
      *(int *)plVar11 = (int)*plVar11 + -1;
      UNLOCK();
      if ((int)*plVar11 == 0) {
        (**(code **)(*local_58 + 8))(local_58);
        LOCK();
        piVar1 = (int *)((longlong)local_58 + 0xc);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          (**(code **)(*local_58 + 0x10))(local_58);
        }
      }
    }
    LeaveCriticalSection(DAT_1406082a8);
  }
  return uVar5;
}



// WARNING: Removing unreachable block (ram,0x000140336e5b)
// WARNING: Removing unreachable block (ram,0x000140336e10)
// WARNING: Removing unreachable block (ram,0x000140336dc6)

void FUN_140336c40(longlong param_1,longlong param_2)

{
  short sVar1;
  short sVar2;
  uint uVar3;
  short *psVar5;
  longlong *plVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  longlong lVar9;
  undefined1 local_res8 [8];
  undefined8 uVar10;
  ulonglong uVar4;
  
  uVar10 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  uVar8 = 0;
  uVar7 = uVar8;
  if ((*(longlong *)(param_1 + 0x1c8) != 0) && (*(uint *)(param_1 + 0x1d0) != 0)) {
    uVar4 = uVar8;
    plVar6 = *(longlong **)(param_1 + 0x1c0);
    do {
      if (*plVar6 != 0) {
        uVar7 = (*(longlong **)(param_1 + 0x1c0))[uVar4];
        break;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      plVar6 = plVar6 + 1;
    } while (uVar3 < *(uint *)(param_1 + 0x1d0));
  }
LAB_140336cb2:
  uVar4 = uVar7;
  if (uVar4 != 0) {
    psVar5 = (short *)(*(longlong *)(uVar4 + 8) + 8);
    if (7 < *(ulonglong *)(*(longlong *)(uVar4 + 8) + 0x20)) {
      psVar5 = *(short **)psVar5;
    }
    lVar9 = param_2 - (longlong)psVar5;
    do {
      sVar1 = *psVar5;
      sVar2 = *(short *)((longlong)psVar5 + lVar9);
      if (sVar1 != sVar2) break;
      psVar5 = psVar5 + 1;
    } while (sVar2 != 0);
    if (sVar1 == sVar2) {
      if (uVar4 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_1402f3920(*(longlong *)(uVar4 + 8) + 0x30);
      if ((uVar4 == 0) || (*(longlong *)(uVar4 + 0x18) != 0)) goto LAB_140336dd1;
      uVar3 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x1d0) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      uVar7 = uVar8;
      goto LAB_140336da0;
    }
    uVar7 = uVar8;
    if ((uVar4 != 0) && (uVar7 = *(ulonglong *)(uVar4 + 0x18), *(ulonglong *)(uVar4 + 0x18) == 0)) {
      uVar3 = *(uint *)(uVar4 + 0x20) % *(uint *)(param_1 + 0x1d0) + 1;
      lVar9 = (longlong)(int)uVar3 << 3;
      uVar7 = uVar8;
      do {
        if (*(uint *)(param_1 + 0x1d0) <= uVar3) break;
        if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0x1c0)) != 0) {
          uVar7 = *(ulonglong *)(lVar9 + *(longlong *)(param_1 + 0x1c0));
        }
        uVar3 = uVar3 + 1;
        lVar9 = lVar9 + 8;
      } while (uVar7 == 0);
    }
    goto LAB_140336cb2;
  }
  goto LAB_140336e66;
  while( true ) {
    if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0x1c0)) != 0) {
      uVar7 = *(ulonglong *)(lVar9 + *(longlong *)(param_1 + 0x1c0));
    }
    uVar3 = uVar3 + 1;
    lVar9 = lVar9 + 8;
    if (uVar7 != 0) break;
LAB_140336da0:
    if (*(uint *)(param_1 + 0x1d0) <= uVar3) break;
  }
LAB_140336dd1:
  uVar3 = *(uint *)(uVar4 + 0x20);
  uVar7 = (ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x1d0);
  lVar9 = *(longlong *)(param_1 + 0x1c0);
  if (uVar4 != *(ulonglong *)(lVar9 + uVar7 * 8)) {
    uVar8 = *(ulonglong *)(lVar9 + uVar7 * 8);
    for (uVar7 = *(ulonglong *)(uVar8 + 0x18); uVar7 != uVar4; uVar7 = *(ulonglong *)(uVar7 + 0x18))
    {
      uVar8 = uVar7;
    }
  }
  if (uVar8 == 0) {
    *(undefined8 *)(lVar9 + ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x1d0)) * 8) =
         *(undefined8 *)(uVar4 + 0x18);
  }
  else {
    *(undefined8 *)(uVar8 + 0x18) = *(undefined8 *)(uVar4 + 0x18);
  }
  FUN_1402c6e80(param_1 + 0x1c0,uVar4,lVar9,(ulonglong)uVar3,uVar10);
  if (param_2 != 0) {
    FUN_1403369a0(param_1,local_res8,param_2);
  }
LAB_140336e66:
                    // WARNING: Could not recover jumptable at 0x000140336e85. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140337041)
// WARNING: Removing unreachable block (ram,0x000140337009)

undefined8 * FUN_140336e90(longlong param_1,undefined8 *param_2,undefined8 *param_3,short *param_4)

{
  short sVar1;
  short sVar2;
  longlong *plVar3;
  uint uVar4;
  short *psVar6;
  int *piVar7;
  longlong lVar8;
  longlong *plVar9;
  int *piVar10;
  undefined8 *puVar11;
  short *psVar12;
  bool bVar13;
  undefined8 local_88;
  undefined8 local_80;
  int *local_78;
  longlong *local_70;
  int *local_68;
  longlong *local_60;
  undefined1 local_58 [16];
  longlong *local_48;
  int *piVar5;
  
  local_80 = 0xfffffffffffffffe;
  piVar10 = (int *)0x0;
  local_68 = (int *)0x0;
  local_60 = (longlong *)0x0;
  bVar13 = param_4 == (short *)0x0;
  if (bVar13) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    psVar6 = param_4;
    psVar12 = &DAT_140477960;
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar13 = *psVar6 == *psVar12;
      psVar6 = psVar6 + 1;
      psVar12 = psVar12 + 1;
    } while (bVar13);
    if (bVar13) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_1406082a8);
      piVar7 = piVar10;
      if ((*(longlong *)(param_1 + 0x210) != 0) && (*(uint *)(param_1 + 0x218) != 0)) {
        piVar5 = piVar10;
        plVar9 = *(longlong **)(param_1 + 0x208);
        do {
          if (*plVar9 != 0) {
            piVar7 = (int *)(*(longlong **)(param_1 + 0x208))[(longlong)piVar5];
            break;
          }
          uVar4 = (int)piVar5 + 1;
          piVar5 = (int *)(ulonglong)uVar4;
          plVar9 = plVar9 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x218));
      }
LAB_140336f50:
      piVar5 = piVar7;
      if (piVar5 != (int *)0x0) {
        puVar11 = (undefined8 *)(*(longlong *)(piVar5 + 2) + 8);
        if (7 < *(ulonglong *)(*(longlong *)(piVar5 + 2) + 0x20)) {
          puVar11 = (undefined8 *)*puVar11;
        }
        psVar6 = param_4;
        do {
          sVar1 = *psVar6;
          sVar2 = *(short *)((longlong)psVar6 + ((longlong)puVar11 - (longlong)param_4));
          if (sVar1 != sVar2) break;
          psVar6 = psVar6 + 1;
        } while (sVar2 != 0);
        if (sVar1 == sVar2) {
          if (piVar5 != (int *)0x0) {
            LOCK();
            **(int **)(piVar5 + 2) = **(int **)(piVar5 + 2) + 1;
            UNLOCK();
            *param_2 = *(undefined8 *)(piVar5 + 2);
            lVar8 = *(longlong *)(piVar5 + 4);
            param_2[1] = lVar8;
            if (lVar8 != 0) {
              LOCK();
              *(int *)(lVar8 + 8) = *(int *)(lVar8 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_1406082a8);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        piVar7 = piVar10;
        if ((piVar5 != (int *)0x0) &&
           (piVar7 = *(int **)(piVar5 + 6), *(int **)(piVar5 + 6) == (int *)0x0)) {
          uVar4 = (uint)piVar5[8] % *(uint *)(param_1 + 0x218) + 1;
          lVar8 = (longlong)(int)uVar4 << 3;
          piVar7 = piVar10;
          do {
            if (*(uint *)(param_1 + 0x218) <= uVar4) break;
            if (*(longlong *)(lVar8 + *(longlong *)(param_1 + 0x208)) != 0) {
              piVar7 = *(int **)(lVar8 + *(longlong *)(param_1 + 0x208));
            }
            uVar4 = uVar4 + 1;
            lVar8 = lVar8 + 8;
          } while (piVar7 == (int *)0x0);
        }
        goto LAB_140336f50;
      }
      *(longlong *)(param_1 + 0x40) = *(longlong *)(param_1 + 0x40) + 1;
      local_88 = *(undefined8 *)(param_1 + 0x40);
      piVar7 = operator_new(0x50);
      if (piVar7 != (int *)0x0) {
        *piVar7 = 0;
        piVar7[8] = 7;
        piVar7[9] = 0;
        piVar7[6] = 0;
        piVar7[7] = 0;
        *(undefined2 *)(piVar7 + 2) = 0;
        piVar7[0xc] = 0;
        piVar7[0xd] = 0;
        piVar7[0xe] = 0;
        piVar7[0xf] = 0;
        piVar7[0x10] = 0;
        piVar7[0x11] = 0;
        piVar10 = piVar7;
      }
      local_78 = piVar10;
      FUN_140338d50(&local_70,piVar10);
      FUN_140178e90(&local_78,piVar10,piVar10);
      piVar10 = local_78;
      local_68 = local_78;
      local_60 = local_70;
      FUN_14033a780(local_78,param_4);
      LOCK();
      *piVar10 = *piVar10 + 1;
      UNLOCK();
      puVar11 = (undefined8 *)FUN_1402f3af0(local_58,&local_88,&local_68);
      FUN_14031a010(param_1 + 0x208,*puVar11,puVar11 + 1);
      if (local_48 != (longlong *)0x0) {
        LOCK();
        plVar9 = local_48 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 == 0) {
          (**(code **)(*local_48 + 8))(local_48);
          LOCK();
          piVar10 = (int *)((longlong)local_48 + 0xc);
          *piVar10 = *piVar10 + -1;
          UNLOCK();
          if (*piVar10 == 0) {
            (**(code **)(*local_48 + 0x10))(local_48);
          }
        }
      }
      plVar9 = local_70;
      *param_3 = local_88;
      *param_2 = local_78;
      param_2[1] = local_70;
      if (local_70 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_70 + 1) = (int)local_70[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_1406082a8);
      plVar3 = local_70;
      if (plVar9 != (longlong *)0x0) {
        LOCK();
        plVar9 = plVar9 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 == 0) {
          (**(code **)(*local_70 + 8))(local_70);
          LOCK();
          piVar10 = (int *)((longlong)plVar3 + 0xc);
          *piVar10 = *piVar10 + -1;
          UNLOCK();
          if (*piVar10 == 0) {
            (**(code **)(*local_70 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x000140337460)
// WARNING: Removing unreachable block (ram,0x0001403373f1)
// WARNING: Removing unreachable block (ram,0x0001403373a7)

void FUN_1403371b0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  short sVar4;
  short sVar5;
  longlong *plVar6;
  uint uVar7;
  short *psVar9;
  longlong *plVar10;
  longlong *plVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  longlong *plVar14;
  longlong lVar15;
  undefined8 uVar16;
  undefined1 local_70 [8];
  undefined1 local_68 [8];
  longlong *local_60;
  ulonglong uVar8;
  
  uVar16 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  plVar3 = (longlong *)(param_1 + 0x208);
  uVar13 = 0;
  uVar12 = uVar13;
  if ((*(longlong *)(param_1 + 0x210) != 0) && (*(uint *)(param_1 + 0x218) != 0)) {
    uVar8 = uVar13;
    plVar11 = (longlong *)*plVar3;
    do {
      if (*plVar11 != 0) {
        uVar12 = ((longlong *)*plVar3)[uVar8];
        break;
      }
      uVar7 = (int)uVar8 + 1;
      uVar8 = (ulonglong)uVar7;
      plVar11 = plVar11 + 1;
    } while (uVar7 < *(uint *)(param_1 + 0x218));
  }
LAB_140337221:
  uVar8 = uVar12;
  if (uVar8 == 0) goto LAB_14033746b;
  psVar9 = (short *)(*(longlong *)(uVar8 + 8) + 8);
  if (7 < *(ulonglong *)(*(longlong *)(uVar8 + 8) + 0x20)) {
    psVar9 = *(short **)psVar9;
  }
  lVar15 = param_2 - (longlong)psVar9;
  do {
    sVar4 = *psVar9;
    sVar5 = *(short *)((longlong)psVar9 + lVar15);
    if (sVar4 != sVar5) break;
    psVar9 = psVar9 + 1;
  } while (sVar5 != 0);
  if (sVar4 != sVar5) {
    uVar12 = uVar13;
    if ((uVar8 != 0) && (uVar12 = *(ulonglong *)(uVar8 + 0x18), *(ulonglong *)(uVar8 + 0x18) == 0))
    {
      uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x218) + 1;
      lVar15 = (longlong)(int)uVar7 << 3;
      uVar12 = uVar13;
      do {
        if (*(uint *)(param_1 + 0x218) <= uVar7) break;
        if (*(longlong *)(lVar15 + *plVar3) != 0) {
          uVar12 = *(ulonglong *)(lVar15 + *plVar3);
        }
        uVar7 = uVar7 + 1;
        lVar15 = lVar15 + 8;
      } while (uVar12 == 0);
    }
    goto LAB_140337221;
  }
  if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar15 = *(longlong *)(uVar8 + 8);
  if (*(longlong *)(lVar15 + 0x30) != *(longlong *)(lVar15 + 0x38)) {
    plVar10 = (longlong *)FUN_140333a10();
    plVar11 = *(longlong **)(lVar15 + 0x38);
    if (plVar10 != plVar11) {
      plVar14 = plVar10 + 1;
      do {
        plVar6 = (longlong *)*plVar14;
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar6 + 0x10))(plVar6);
            }
          }
        }
        plVar6 = plVar14 + 1;
        plVar14 = plVar14 + 2;
      } while (plVar6 != plVar11);
    }
    *(longlong **)(lVar15 + 0x38) = plVar10;
  }
  if ((uVar8 != 0) && (*(longlong *)(uVar8 + 0x18) == 0)) {
    uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x218) + 1;
    lVar15 = (longlong)(int)uVar7 << 3;
    uVar12 = uVar13;
    do {
      if (*(uint *)(param_1 + 0x218) <= uVar7) break;
      if (*(longlong *)(lVar15 + *plVar3) != 0) {
        uVar12 = *(ulonglong *)(lVar15 + *plVar3);
      }
      uVar7 = uVar7 + 1;
      lVar15 = lVar15 + 8;
    } while (uVar12 == 0);
  }
  uVar7 = *(uint *)(uVar8 + 0x20);
  uVar12 = (ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x218);
  lVar15 = *plVar3;
  if (uVar8 != *(ulonglong *)(lVar15 + uVar12 * 8)) {
    uVar13 = *(ulonglong *)(lVar15 + uVar12 * 8);
    for (uVar12 = *(ulonglong *)(uVar13 + 0x18); uVar12 != uVar8;
        uVar12 = *(ulonglong *)(uVar12 + 0x18)) {
      uVar13 = uVar12;
    }
  }
  if (uVar13 == 0) {
    *(undefined8 *)(lVar15 + ((ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x218)) * 8) =
         *(undefined8 *)(uVar8 + 0x18);
  }
  else {
    *(undefined8 *)(uVar13 + 0x18) = *(undefined8 *)(uVar8 + 0x18);
  }
  FUN_1402c6e80(plVar3,uVar8,lVar15,(ulonglong)uVar7,uVar16);
  FUN_140336e90(param_1,local_68,local_70,param_2);
  if (local_60 != (longlong *)0x0) {
    LOCK();
    plVar3 = local_60 + 1;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    if ((int)*plVar3 == 0) {
      (**(code **)(*local_60 + 8))(local_60);
      LOCK();
      piVar2 = (int *)((longlong)local_60 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_60 + 0x10))(local_60);
      }
    }
  }
LAB_14033746b:
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140337642)
// WARNING: Removing unreachable block (ram,0x00014033760a)

undefined8 * FUN_140337490(longlong param_1,undefined8 *param_2,undefined8 *param_3,short *param_4)

{
  int *piVar1;
  short sVar2;
  short sVar3;
  longlong *plVar4;
  uint uVar5;
  short *psVar7;
  undefined1 *puVar8;
  longlong lVar9;
  longlong *plVar10;
  undefined1 *puVar11;
  undefined8 *puVar12;
  short *psVar13;
  bool bVar14;
  undefined8 local_88;
  undefined8 local_80;
  undefined1 *local_78;
  longlong *local_70;
  undefined1 *local_68;
  longlong *local_60;
  undefined1 local_58 [16];
  longlong *local_48;
  undefined1 *puVar6;
  
  local_80 = 0xfffffffffffffffe;
  puVar11 = (undefined1 *)0x0;
  local_68 = (undefined1 *)0x0;
  local_60 = (longlong *)0x0;
  bVar14 = param_4 == (short *)0x0;
  if (bVar14) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar9 = 1;
    psVar7 = param_4;
    psVar13 = &DAT_140477960;
    do {
      if (lVar9 == 0) break;
      lVar9 = lVar9 + -1;
      bVar14 = *psVar7 == *psVar13;
      psVar7 = psVar7 + 1;
      psVar13 = psVar13 + 1;
    } while (bVar14);
    if (bVar14) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_1406082a8);
      puVar8 = puVar11;
      if ((*(longlong *)(param_1 + 600) != 0) && (*(uint *)(param_1 + 0x260) != 0)) {
        puVar6 = puVar11;
        plVar10 = *(longlong **)(param_1 + 0x250);
        do {
          if (*plVar10 != 0) {
            puVar8 = (undefined1 *)(*(longlong **)(param_1 + 0x250))[(longlong)puVar6];
            break;
          }
          uVar5 = (int)puVar6 + 1;
          puVar6 = (undefined1 *)(ulonglong)uVar5;
          plVar10 = plVar10 + 1;
        } while (uVar5 < *(uint *)(param_1 + 0x260));
      }
LAB_140337550:
      puVar6 = puVar8;
      if (puVar6 != (undefined1 *)0x0) {
        puVar12 = (undefined8 *)(*(longlong *)(puVar6 + 8) + 8);
        if (7 < *(ulonglong *)(*(longlong *)(puVar6 + 8) + 0x20)) {
          puVar12 = (undefined8 *)*puVar12;
        }
        psVar7 = param_4;
        do {
          sVar2 = *psVar7;
          sVar3 = *(short *)((longlong)psVar7 + ((longlong)puVar12 - (longlong)param_4));
          if (sVar2 != sVar3) break;
          psVar7 = psVar7 + 1;
        } while (sVar3 != 0);
        if (sVar2 == sVar3) {
          if (puVar6 != (undefined1 *)0x0) {
            LOCK();
            *(int *)(*(longlong *)(puVar6 + 8) + 4) = *(int *)(*(longlong *)(puVar6 + 8) + 4) + 1;
            UNLOCK();
            *param_2 = *(undefined8 *)(puVar6 + 8);
            lVar9 = *(longlong *)(puVar6 + 0x10);
            param_2[1] = lVar9;
            if (lVar9 != 0) {
              LOCK();
              *(int *)(lVar9 + 8) = *(int *)(lVar9 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_1406082a8);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        puVar8 = puVar11;
        if ((puVar6 != (undefined1 *)0x0) &&
           (puVar8 = *(undefined1 **)(puVar6 + 0x18),
           *(undefined1 **)(puVar6 + 0x18) == (undefined1 *)0x0)) {
          uVar5 = *(uint *)(puVar6 + 0x20) % *(uint *)(param_1 + 0x260) + 1;
          lVar9 = (longlong)(int)uVar5 << 3;
          puVar8 = puVar11;
          do {
            if (*(uint *)(param_1 + 0x260) <= uVar5) break;
            if (*(longlong *)(lVar9 + *(longlong *)(param_1 + 0x250)) != 0) {
              puVar8 = *(undefined1 **)(lVar9 + *(longlong *)(param_1 + 0x250));
            }
            uVar5 = uVar5 + 1;
            lVar9 = lVar9 + 8;
          } while (puVar8 == (undefined1 *)0x0);
        }
        goto LAB_140337550;
      }
      *(longlong *)(param_1 + 0x48) = *(longlong *)(param_1 + 0x48) + 1;
      local_88 = *(undefined8 *)(param_1 + 0x48);
      puVar8 = operator_new(0x50);
      if (puVar8 != (undefined1 *)0x0) {
        *puVar8 = 0;
        *(undefined4 *)(puVar8 + 4) = 0;
        *(undefined8 *)(puVar8 + 0x20) = 7;
        *(undefined8 *)(puVar8 + 0x18) = 0;
        *(undefined2 *)(puVar8 + 8) = 0;
        *(undefined8 *)(puVar8 + 0x30) = 0;
        *(undefined8 *)(puVar8 + 0x38) = 0;
        *(undefined8 *)(puVar8 + 0x40) = 0;
        puVar11 = puVar8;
      }
      local_78 = puVar11;
      FUN_140338dc0(&local_70,puVar11);
      FUN_140178e90(&local_78,puVar11,puVar11);
      puVar11 = local_78;
      local_68 = local_78;
      local_60 = local_70;
      FUN_140339190(local_78,param_4);
      LOCK();
      *(int *)(puVar11 + 4) = *(int *)(puVar11 + 4) + 1;
      UNLOCK();
      puVar12 = (undefined8 *)FUN_1402f3af0(local_58,&local_88,&local_68);
      FUN_14031a010(param_1 + 0x250,*puVar12,puVar12 + 1);
      if (local_48 != (longlong *)0x0) {
        LOCK();
        plVar10 = local_48 + 1;
        *(int *)plVar10 = (int)*plVar10 + -1;
        UNLOCK();
        if ((int)*plVar10 == 0) {
          (**(code **)(*local_48 + 8))(local_48);
          LOCK();
          piVar1 = (int *)((longlong)local_48 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_48 + 0x10))(local_48);
          }
        }
      }
      plVar10 = local_70;
      *param_3 = local_88;
      *param_2 = local_78;
      param_2[1] = local_70;
      if (local_70 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_70 + 1) = (int)local_70[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_1406082a8);
      plVar4 = local_70;
      if (plVar10 != (longlong *)0x0) {
        LOCK();
        plVar10 = plVar10 + 1;
        *(int *)plVar10 = (int)*plVar10 + -1;
        UNLOCK();
        if ((int)*plVar10 == 0) {
          (**(code **)(*local_70 + 8))(local_70);
          LOCK();
          piVar1 = (int *)((longlong)plVar4 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_70 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x000140337a70)
// WARNING: Removing unreachable block (ram,0x000140337a01)
// WARNING: Removing unreachable block (ram,0x0001403379b7)

void FUN_1403377c0(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  short sVar4;
  short sVar5;
  longlong *plVar6;
  uint uVar7;
  short *psVar9;
  longlong *plVar10;
  longlong *plVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  longlong *plVar14;
  longlong lVar15;
  undefined8 uVar16;
  undefined1 local_70 [8];
  undefined1 local_68 [8];
  longlong *local_60;
  ulonglong uVar8;
  
  uVar16 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  plVar3 = (longlong *)(param_1 + 0x250);
  uVar13 = 0;
  uVar12 = uVar13;
  if ((*(longlong *)(param_1 + 600) != 0) && (*(uint *)(param_1 + 0x260) != 0)) {
    uVar8 = uVar13;
    plVar11 = (longlong *)*plVar3;
    do {
      if (*plVar11 != 0) {
        uVar12 = ((longlong *)*plVar3)[uVar8];
        break;
      }
      uVar7 = (int)uVar8 + 1;
      uVar8 = (ulonglong)uVar7;
      plVar11 = plVar11 + 1;
    } while (uVar7 < *(uint *)(param_1 + 0x260));
  }
LAB_140337831:
  uVar8 = uVar12;
  if (uVar8 == 0) goto LAB_140337a7b;
  psVar9 = (short *)(*(longlong *)(uVar8 + 8) + 8);
  if (7 < *(ulonglong *)(*(longlong *)(uVar8 + 8) + 0x20)) {
    psVar9 = *(short **)psVar9;
  }
  lVar15 = param_2 - (longlong)psVar9;
  do {
    sVar4 = *psVar9;
    sVar5 = *(short *)((longlong)psVar9 + lVar15);
    if (sVar4 != sVar5) break;
    psVar9 = psVar9 + 1;
  } while (sVar5 != 0);
  if (sVar4 != sVar5) {
    uVar12 = uVar13;
    if ((uVar8 != 0) && (uVar12 = *(ulonglong *)(uVar8 + 0x18), *(ulonglong *)(uVar8 + 0x18) == 0))
    {
      uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x260) + 1;
      lVar15 = (longlong)(int)uVar7 << 3;
      uVar12 = uVar13;
      do {
        if (*(uint *)(param_1 + 0x260) <= uVar7) break;
        if (*(longlong *)(lVar15 + *plVar3) != 0) {
          uVar12 = *(ulonglong *)(lVar15 + *plVar3);
        }
        uVar7 = uVar7 + 1;
        lVar15 = lVar15 + 8;
      } while (uVar12 == 0);
    }
    goto LAB_140337831;
  }
  if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar15 = *(longlong *)(uVar8 + 8);
  if (*(longlong *)(lVar15 + 0x30) != *(longlong *)(lVar15 + 0x38)) {
    plVar10 = (longlong *)FUN_140333a10();
    plVar11 = *(longlong **)(lVar15 + 0x38);
    if (plVar10 != plVar11) {
      plVar14 = plVar10 + 1;
      do {
        plVar6 = (longlong *)*plVar14;
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar6 + 0x10))(plVar6);
            }
          }
        }
        plVar6 = plVar14 + 1;
        plVar14 = plVar14 + 2;
      } while (plVar6 != plVar11);
    }
    *(longlong **)(lVar15 + 0x38) = plVar10;
  }
  if ((uVar8 != 0) && (*(longlong *)(uVar8 + 0x18) == 0)) {
    uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x260) + 1;
    lVar15 = (longlong)(int)uVar7 << 3;
    uVar12 = uVar13;
    do {
      if (*(uint *)(param_1 + 0x260) <= uVar7) break;
      if (*(longlong *)(lVar15 + *plVar3) != 0) {
        uVar12 = *(ulonglong *)(lVar15 + *plVar3);
      }
      uVar7 = uVar7 + 1;
      lVar15 = lVar15 + 8;
    } while (uVar12 == 0);
  }
  uVar7 = *(uint *)(uVar8 + 0x20);
  uVar12 = (ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x260);
  lVar15 = *plVar3;
  if (uVar8 != *(ulonglong *)(lVar15 + uVar12 * 8)) {
    uVar13 = *(ulonglong *)(lVar15 + uVar12 * 8);
    for (uVar12 = *(ulonglong *)(uVar13 + 0x18); uVar12 != uVar8;
        uVar12 = *(ulonglong *)(uVar12 + 0x18)) {
      uVar13 = uVar12;
    }
  }
  if (uVar13 == 0) {
    *(undefined8 *)(lVar15 + ((ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x260)) * 8) =
         *(undefined8 *)(uVar8 + 0x18);
  }
  else {
    *(undefined8 *)(uVar13 + 0x18) = *(undefined8 *)(uVar8 + 0x18);
  }
  FUN_1402c6e80(plVar3,uVar8,lVar15,(ulonglong)uVar7,uVar16);
  FUN_140337490(param_1,local_68,local_70,param_2);
  if (local_60 != (longlong *)0x0) {
    LOCK();
    plVar3 = local_60 + 1;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    if ((int)*plVar3 == 0) {
      (**(code **)(*local_60 + 8))(local_60);
      LOCK();
      piVar2 = (int *)((longlong)local_60 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_60 + 0x10))(local_60);
      }
    }
  }
LAB_140337a7b:
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



void FUN_140337aa0(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  EnterCriticalSection(DAT_1406082a8);
  if (*(longlong *)(param_1 + 0x2e0) != 0) {
    FUN_1402f3920();
    *(undefined8 *)(param_1 + 0x2e0) = 0;
    plVar3 = *(longlong **)(param_1 + 0x2e8);
    *(undefined8 *)(param_1 + 0x2e8) = 0;
    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);
        }
      }
    }
  }
                    // WARNING: Could not recover jumptable at 0x000140337b23. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140337bc1)
// WARNING: Removing unreachable block (ram,0x000140337bca)
// WARNING: Removing unreachable block (ram,0x000140337be8)
// WARNING: Removing unreachable block (ram,0x000140337bf1)

undefined8 FUN_140337b30(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  EnterCriticalSection(DAT_1406082a8);
  puVar1 = operator_new(0x48);
  puVar2 = (undefined8 *)0x0;
  if (puVar1 != (undefined8 *)0x0) {
    *puVar1 = 0;
    puVar1[1] = 0;
    *(undefined4 *)(puVar1 + 2) = 0x11;
    *(undefined4 *)(puVar1 + 6) = 0;
    *(undefined4 *)((longlong)puVar1 + 0x34) = 10;
    puVar1[7] = 0;
    puVar1[8] = 0;
    *(undefined4 *)((longlong)puVar1 + 0x14) = 0x3f400000;
    *(undefined4 *)(puVar1 + 3) = 0x3e800000;
    *(undefined4 *)((longlong)puVar1 + 0x1c) = 0x40100000;
    puVar1[4] = 0x26;
    puVar1[5] = 0;
    puVar2 = puVar1;
  }
  FUN_1403387a0(param_1 + 0x2e0,puVar2);
  FUN_14033b140(*(undefined8 *)(param_1 + 0x2e0));
  LeaveCriticalSection(DAT_1406082a8);
  return 1;
}



undefined8 * FUN_140337c40(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  *param_2 = *(undefined8 *)(param_1 + 0x2e0);
  lVar1 = *(longlong *)(param_1 + 0x2e8);
  param_2[1] = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_2;
}



void FUN_140337c70(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  EnterCriticalSection(DAT_1406082a8);
  if (*(longlong *)(param_1 + 0x2f0) != 0) {
    FUN_1402f3920(*(longlong *)(param_1 + 0x2f0) + 0x30);
    *(undefined8 *)(param_1 + 0x2f0) = 0;
    plVar3 = *(longlong **)(param_1 + 0x2f8);
    *(undefined8 *)(param_1 + 0x2f8) = 0;
    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);
        }
      }
    }
  }
                    // WARNING: Could not recover jumptable at 0x000140337cf7. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



undefined1 FUN_140337d00(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  pvVar1 = operator_new(0x78);
  uVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    uVar2 = FUN_14033f7b0(pvVar1);
  }
  FUN_140338820(param_1 + 0x2f0,uVar2,param_3,param_4,uVar3);
  FUN_14034bed0(*(undefined8 *)(param_1 + 0x2f0));
  LeaveCriticalSection(DAT_1406082a8);
  return 1;
}



void FUN_140337d70(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  EnterCriticalSection(DAT_1406082a8);
  if (*(longlong *)(param_1 + 0x300) != 0) {
    FUN_1402f3920(*(longlong *)(param_1 + 0x300) + 0x30);
    *(undefined8 *)(param_1 + 0x300) = 0;
    plVar3 = *(longlong **)(param_1 + 0x308);
    *(undefined8 *)(param_1 + 0x308) = 0;
    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);
        }
      }
    }
  }
                    // WARNING: Could not recover jumptable at 0x000140337df7. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



undefined1 FUN_140337e00(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  pvVar1 = operator_new(0x78);
  uVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    uVar2 = FUN_14033f7b0(pvVar1);
  }
  FUN_1403388a0(param_1 + 0x300,uVar2,param_3,param_4,uVar3);
  FUN_14034c2c0(*(undefined8 *)(param_1 + 0x300));
  LeaveCriticalSection(DAT_1406082a8);
  return 1;
}



undefined8 FUN_140337e70(longlong param_1,uint param_2)

{
  longlong lVar1;
  uint *puVar2;
  undefined8 uVar3;
  
  EnterCriticalSection(DAT_1406082a8);
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x300) + 0x30);
  uVar3 = 0;
  if (lVar1 != 0) {
    for (puVar2 = *(uint **)(lVar1 + ((ulonglong)param_2 %
                                     (ulonglong)*(uint *)(*(longlong *)(param_1 + 0x300) + 0x40)) *
                                     8); puVar2 != (uint *)0x0; puVar2 = *(uint **)(puVar2 + 6)) {
      if ((puVar2[8] == param_2) && (*puVar2 == param_2)) {
        if (puVar2 != (uint *)0x0) {
          if (puVar2 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
          uVar3 = *(undefined8 *)(puVar2 + 2);
        }
        break;
      }
    }
  }
  LeaveCriticalSection(DAT_1406082a8);
  return uVar3;
}



// WARNING: Removing unreachable block (ram,0x0001403380c1)
// WARNING: Removing unreachable block (ram,0x000140338089)

undefined8 * FUN_140337f10(longlong param_1,undefined8 *param_2,undefined8 *param_3,short *param_4)

{
  short sVar1;
  short sVar2;
  longlong *plVar3;
  uint uVar4;
  short *psVar6;
  int *piVar7;
  longlong lVar8;
  longlong *plVar9;
  int *piVar10;
  undefined8 *puVar11;
  short *psVar12;
  bool bVar13;
  undefined8 local_88;
  undefined8 local_80;
  int *local_78;
  longlong *local_70;
  int *local_68;
  longlong *local_60;
  undefined1 local_58 [16];
  longlong *local_48;
  int *piVar5;
  
  local_80 = 0xfffffffffffffffe;
  piVar10 = (int *)0x0;
  local_68 = (int *)0x0;
  local_60 = (longlong *)0x0;
  bVar13 = param_4 == (short *)0x0;
  if (bVar13) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    lVar8 = 1;
    psVar6 = param_4;
    psVar12 = &DAT_140477960;
    do {
      if (lVar8 == 0) break;
      lVar8 = lVar8 + -1;
      bVar13 = *psVar6 == *psVar12;
      psVar6 = psVar6 + 1;
      psVar12 = psVar12 + 1;
    } while (bVar13);
    if (bVar13) {
      *param_2 = 0;
      param_2[1] = 0;
    }
    else {
      EnterCriticalSection(DAT_1406082a8);
      piVar7 = piVar10;
      if ((*(longlong *)(param_1 + 0x2a0) != 0) && (*(uint *)(param_1 + 0x2a8) != 0)) {
        piVar5 = piVar10;
        plVar9 = *(longlong **)(param_1 + 0x298);
        do {
          if (*plVar9 != 0) {
            piVar7 = (int *)(*(longlong **)(param_1 + 0x298))[(longlong)piVar5];
            break;
          }
          uVar4 = (int)piVar5 + 1;
          piVar5 = (int *)(ulonglong)uVar4;
          plVar9 = plVar9 + 1;
        } while (uVar4 < *(uint *)(param_1 + 0x2a8));
      }
LAB_140337fd0:
      piVar5 = piVar7;
      if (piVar5 != (int *)0x0) {
        puVar11 = (undefined8 *)(*(longlong *)(piVar5 + 2) + 8);
        if (7 < *(ulonglong *)(*(longlong *)(piVar5 + 2) + 0x20)) {
          puVar11 = (undefined8 *)*puVar11;
        }
        psVar6 = param_4;
        do {
          sVar1 = *psVar6;
          sVar2 = *(short *)((longlong)psVar6 + ((longlong)puVar11 - (longlong)param_4));
          if (sVar1 != sVar2) break;
          psVar6 = psVar6 + 1;
        } while (sVar2 != 0);
        if (sVar1 == sVar2) {
          if (piVar5 != (int *)0x0) {
            LOCK();
            **(int **)(piVar5 + 2) = **(int **)(piVar5 + 2) + 1;
            UNLOCK();
            *param_2 = *(undefined8 *)(piVar5 + 2);
            lVar8 = *(longlong *)(piVar5 + 4);
            param_2[1] = lVar8;
            if (lVar8 != 0) {
              LOCK();
              *(int *)(lVar8 + 8) = *(int *)(lVar8 + 8) + 1;
              UNLOCK();
            }
            LeaveCriticalSection(DAT_1406082a8);
            return param_2;
          }
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        piVar7 = piVar10;
        if ((piVar5 != (int *)0x0) &&
           (piVar7 = *(int **)(piVar5 + 6), *(int **)(piVar5 + 6) == (int *)0x0)) {
          uVar4 = (uint)piVar5[8] % *(uint *)(param_1 + 0x2a8) + 1;
          lVar8 = (longlong)(int)uVar4 << 3;
          piVar7 = piVar10;
          do {
            if (*(uint *)(param_1 + 0x2a8) <= uVar4) break;
            if (*(longlong *)(lVar8 + *(longlong *)(param_1 + 0x298)) != 0) {
              piVar7 = *(int **)(lVar8 + *(longlong *)(param_1 + 0x298));
            }
            uVar4 = uVar4 + 1;
            lVar8 = lVar8 + 8;
          } while (piVar7 == (int *)0x0);
        }
        goto LAB_140337fd0;
      }
      *(longlong *)(param_1 + 0x48) = *(longlong *)(param_1 + 0x48) + 1;
      local_88 = *(undefined8 *)(param_1 + 0x48);
      piVar7 = operator_new(0x50);
      if (piVar7 != (int *)0x0) {
        *piVar7 = 0;
        piVar7[8] = 7;
        piVar7[9] = 0;
        piVar7[6] = 0;
        piVar7[7] = 0;
        *(undefined2 *)(piVar7 + 2) = 0;
        piVar7[0xc] = 0;
        piVar7[0xd] = 0;
        piVar7[0xe] = 0;
        piVar7[0xf] = 0;
        piVar7[0x10] = 0;
        piVar7[0x11] = 0;
        piVar10 = piVar7;
      }
      local_78 = piVar10;
      FUN_140338f80(&local_70,piVar10);
      FUN_140178e90(&local_78,piVar10,piVar10);
      piVar10 = local_78;
      local_68 = local_78;
      local_60 = local_70;
      FUN_140339d10(local_78,param_4);
      LOCK();
      *piVar10 = *piVar10 + 1;
      UNLOCK();
      puVar11 = (undefined8 *)FUN_1402f3af0(local_58,&local_88,&local_68);
      FUN_14031a010(param_1 + 0x298,*puVar11,puVar11 + 1);
      if (local_48 != (longlong *)0x0) {
        LOCK();
        plVar9 = local_48 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 == 0) {
          (**(code **)(*local_48 + 8))(local_48);
          LOCK();
          piVar10 = (int *)((longlong)local_48 + 0xc);
          *piVar10 = *piVar10 + -1;
          UNLOCK();
          if (*piVar10 == 0) {
            (**(code **)(*local_48 + 0x10))(local_48);
          }
        }
      }
      plVar9 = local_70;
      *param_3 = local_88;
      *param_2 = local_78;
      param_2[1] = local_70;
      if (local_70 != (longlong *)0x0) {
        LOCK();
        *(int *)(local_70 + 1) = (int)local_70[1] + 1;
        UNLOCK();
      }
      LeaveCriticalSection(DAT_1406082a8);
      plVar3 = local_70;
      if (plVar9 != (longlong *)0x0) {
        LOCK();
        plVar9 = plVar9 + 1;
        *(int *)plVar9 = (int)*plVar9 + -1;
        UNLOCK();
        if ((int)*plVar9 == 0) {
          (**(code **)(*local_70 + 8))(local_70);
          LOCK();
          piVar10 = (int *)((longlong)plVar3 + 0xc);
          *piVar10 = *piVar10 + -1;
          UNLOCK();
          if (*piVar10 == 0) {
            (**(code **)(*local_70 + 0x10))();
          }
        }
      }
    }
  }
  return param_2;
}



// WARNING: Removing unreachable block (ram,0x0001403384e0)
// WARNING: Removing unreachable block (ram,0x000140338471)
// WARNING: Removing unreachable block (ram,0x000140338427)

void FUN_140338230(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  short sVar4;
  short sVar5;
  longlong *plVar6;
  uint uVar7;
  short *psVar9;
  longlong *plVar10;
  longlong *plVar11;
  ulonglong uVar12;
  ulonglong uVar13;
  longlong *plVar14;
  longlong lVar15;
  undefined8 uVar16;
  undefined1 local_70 [8];
  undefined1 local_68 [8];
  longlong *local_60;
  ulonglong uVar8;
  
  uVar16 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  plVar3 = (longlong *)(param_1 + 0x298);
  uVar13 = 0;
  uVar12 = uVar13;
  if ((*(longlong *)(param_1 + 0x2a0) != 0) && (*(uint *)(param_1 + 0x2a8) != 0)) {
    uVar8 = uVar13;
    plVar11 = (longlong *)*plVar3;
    do {
      if (*plVar11 != 0) {
        uVar12 = ((longlong *)*plVar3)[uVar8];
        break;
      }
      uVar7 = (int)uVar8 + 1;
      uVar8 = (ulonglong)uVar7;
      plVar11 = plVar11 + 1;
    } while (uVar7 < *(uint *)(param_1 + 0x2a8));
  }
LAB_1403382a1:
  uVar8 = uVar12;
  if (uVar8 == 0) goto LAB_1403384eb;
  psVar9 = (short *)(*(longlong *)(uVar8 + 8) + 8);
  if (7 < *(ulonglong *)(*(longlong *)(uVar8 + 8) + 0x20)) {
    psVar9 = *(short **)psVar9;
  }
  lVar15 = param_2 - (longlong)psVar9;
  do {
    sVar4 = *psVar9;
    sVar5 = *(short *)((longlong)psVar9 + lVar15);
    if (sVar4 != sVar5) break;
    psVar9 = psVar9 + 1;
  } while (sVar5 != 0);
  if (sVar4 != sVar5) {
    uVar12 = uVar13;
    if ((uVar8 != 0) && (uVar12 = *(ulonglong *)(uVar8 + 0x18), *(ulonglong *)(uVar8 + 0x18) == 0))
    {
      uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x2a8) + 1;
      lVar15 = (longlong)(int)uVar7 << 3;
      uVar12 = uVar13;
      do {
        if (*(uint *)(param_1 + 0x2a8) <= uVar7) break;
        if (*(longlong *)(lVar15 + *plVar3) != 0) {
          uVar12 = *(ulonglong *)(lVar15 + *plVar3);
        }
        uVar7 = uVar7 + 1;
        lVar15 = lVar15 + 8;
      } while (uVar12 == 0);
    }
    goto LAB_1403382a1;
  }
  if (uVar8 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar15 = *(longlong *)(uVar8 + 8);
  if (*(longlong *)(lVar15 + 0x30) != *(longlong *)(lVar15 + 0x38)) {
    plVar10 = (longlong *)FUN_140333a10();
    plVar11 = *(longlong **)(lVar15 + 0x38);
    if (plVar10 != plVar11) {
      plVar14 = plVar10 + 1;
      do {
        plVar6 = (longlong *)*plVar14;
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar6 + 0x10))(plVar6);
            }
          }
        }
        plVar6 = plVar14 + 1;
        plVar14 = plVar14 + 2;
      } while (plVar6 != plVar11);
    }
    *(longlong **)(lVar15 + 0x38) = plVar10;
  }
  if ((uVar8 != 0) && (*(longlong *)(uVar8 + 0x18) == 0)) {
    uVar7 = *(uint *)(uVar8 + 0x20) % *(uint *)(param_1 + 0x2a8) + 1;
    lVar15 = (longlong)(int)uVar7 << 3;
    uVar12 = uVar13;
    do {
      if (*(uint *)(param_1 + 0x2a8) <= uVar7) break;
      if (*(longlong *)(lVar15 + *plVar3) != 0) {
        uVar12 = *(ulonglong *)(lVar15 + *plVar3);
      }
      uVar7 = uVar7 + 1;
      lVar15 = lVar15 + 8;
    } while (uVar12 == 0);
  }
  uVar7 = *(uint *)(uVar8 + 0x20);
  uVar12 = (ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x2a8);
  lVar15 = *plVar3;
  if (uVar8 != *(ulonglong *)(lVar15 + uVar12 * 8)) {
    uVar13 = *(ulonglong *)(lVar15 + uVar12 * 8);
    for (uVar12 = *(ulonglong *)(uVar13 + 0x18); uVar12 != uVar8;
        uVar12 = *(ulonglong *)(uVar12 + 0x18)) {
      uVar13 = uVar12;
    }
  }
  if (uVar13 == 0) {
    *(undefined8 *)(lVar15 + ((ulonglong)uVar7 % (ulonglong)*(uint *)(param_1 + 0x2a8)) * 8) =
         *(undefined8 *)(uVar8 + 0x18);
  }
  else {
    *(undefined8 *)(uVar13 + 0x18) = *(undefined8 *)(uVar8 + 0x18);
  }
  FUN_1402c6e80(plVar3,uVar8,lVar15,(ulonglong)uVar7,uVar16);
  FUN_140337f10(param_1,local_68,local_70,param_2);
  if (local_60 != (longlong *)0x0) {
    LOCK();
    plVar3 = local_60 + 1;
    *(int *)plVar3 = (int)*plVar3 + -1;
    UNLOCK();
    if ((int)*plVar3 == 0) {
      (**(code **)(*local_60 + 8))(local_60);
      LOCK();
      piVar2 = (int *)((longlong)local_60 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*local_60 + 0x10))(local_60);
      }
    }
  }
LAB_1403384eb:
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



void FUN_140338510(longlong param_1)

{
  longlong *plVar1;
  int *piVar2;
  longlong *plVar3;
  
  EnterCriticalSection(DAT_1406082a8);
  if (*(longlong *)(param_1 + 0x310) != 0) {
    FUN_1402f3920(*(longlong *)(param_1 + 0x310) + 0x30);
    *(undefined8 *)(param_1 + 0x310) = 0;
    plVar3 = *(longlong **)(param_1 + 0x318);
    *(undefined8 *)(param_1 + 0x318) = 0;
    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);
        }
      }
    }
  }
                    // WARNING: Could not recover jumptable at 0x000140338597. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



undefined1 FUN_1403385a0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  void *pvVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  EnterCriticalSection(DAT_1406082a8);
  pvVar1 = operator_new(0x78);
  uVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    uVar2 = FUN_14033f7b0(pvVar1);
  }
  FUN_140338920(param_1 + 0x310,uVar2,param_3,param_4,uVar3);
  FUN_14034cb60(*(undefined8 *)(param_1 + 0x310));
  LeaveCriticalSection(DAT_1406082a8);
  return 1;
}



void FUN_140338610(undefined8 param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  wchar_t *pwVar2;
  wchar_t *pwVar3;
  undefined1 uVar4;
  undefined8 uVar5;
  
  uVar4 = &stack0x00000000 == (undefined1 *)0x38;
  uVar5 = 0xfffffffffffffffe;
  FUN_1403352e0();
  FUN_140335810(param_1,param_2,param_3,param_4,uVar5);
  FUN_140335cf0(param_1,param_2);
  FUN_1403361f0(param_1,param_2);
  FUN_140336750(param_1,param_2);
  FUN_140336c40(param_1,param_2);
  FUN_1403371b0(param_1,param_2);
  FUN_1403377c0(param_1,param_2);
  FUN_140338230(param_1,param_2);
  lVar1 = 0xf;
  pwVar2 = param_2;
  pwVar3 = L"CHAMPION_ENEMY";
  do {
    if (lVar1 == 0) break;
    lVar1 = lVar1 + -1;
    uVar4 = *pwVar2 == *pwVar3;
    pwVar2 = pwVar2 + 1;
    pwVar3 = pwVar3 + 1;
  } while ((bool)uVar4);
  if ((bool)uVar4) {
    EnterCriticalSection(DAT_1406082a8);
    FUN_140337aa0(param_1);
    FUN_140337b30(param_1);
  }
  else {
    lVar1 = 0xe;
    pwVar2 = param_2;
    pwVar3 = L"ENEMY_HEALING";
    do {
      if (lVar1 == 0) break;
      lVar1 = lVar1 + -1;
      uVar4 = *pwVar2 == *pwVar3;
      pwVar2 = pwVar2 + 1;
      pwVar3 = pwVar3 + 1;
    } while ((bool)uVar4);
    if ((bool)uVar4) {
      EnterCriticalSection(DAT_1406082a8);
      FUN_140337c70(param_1);
      FUN_140337d00(param_1);
    }
    else {
      lVar1 = 0xd;
      pwVar2 = param_2;
      pwVar3 = L"ENEMY_SUMMON";
      do {
        if (lVar1 == 0) break;
        lVar1 = lVar1 + -1;
        uVar4 = *pwVar2 == *pwVar3;
        pwVar2 = pwVar2 + 1;
        pwVar3 = pwVar3 + 1;
      } while ((bool)uVar4);
      if ((bool)uVar4) {
        EnterCriticalSection(DAT_1406082a8);
        FUN_140337d70(param_1);
        FUN_140337e00(param_1);
      }
      else {
        lVar1 = 0xe;
        pwVar2 = L"ENEMY_COSTUME";
        do {
          if (lVar1 == 0) break;
          lVar1 = lVar1 + -1;
          uVar4 = *param_2 == *pwVar2;
          param_2 = param_2 + 1;
          pwVar2 = pwVar2 + 1;
        } while ((bool)uVar4);
        if (!(bool)uVar4) {
          return;
        }
        EnterCriticalSection(DAT_1406082a8);
        FUN_140338510(param_1);
        FUN_1403385a0(param_1);
      }
    }
  }
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



void FUN_140338790(void)

{
                    // WARNING: Could not recover jumptable at 0x000140338797. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082a8);
  return;
}



void FUN_1403387a0(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_140338e30(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



void FUN_140338820(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_140338ea0(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



void FUN_1403388a0(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_140338f10(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



void FUN_140338920(undefined8 *param_1,undefined8 param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 local_18;
  longlong *local_10;
  
  local_18 = param_2;
  FUN_140338ff0(&local_10);
  FUN_140178e90(&local_18,param_2,param_2);
  uVar3 = *param_1;
  *param_1 = local_18;
  plVar4 = (longlong *)param_1[1];
  param_1[1] = local_10;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      local_18 = uVar3;
      local_10 = plVar4;
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



undefined8 * FUN_1403389a0(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;
}



undefined8 * FUN_140338a10(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;
}



undefined8 * FUN_140338a80(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;
}



undefined8 * FUN_140338af0(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;
}



undefined8 * FUN_140338b60(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;
}



undefined8 * FUN_140338bd0(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;
}



void FUN_140338c40(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_140339060();
  }
  return;
}



void FUN_140338c60(longlong param_1)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  if (puVar1 != (undefined8 *)0x0) {
    FUN_14030e480(puVar1 + 5);
    if (7 < (ulonglong)puVar1[3]) {
      operator_delete((void *)*puVar1);
    }
    puVar1[3] = 7;
    puVar1[2] = 0;
    *(undefined2 *)puVar1 = 0;
    operator_delete(puVar1);
  }
  return;
}



void FUN_140338d00(void *param_1)

{
  if (param_1 != (void *)0x0) {
    FUN_14030e480((longlong)param_1 + 0x30);
    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;
    operator_delete(param_1);
  }
  return;
}



undefined8 * FUN_140338d50(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;
}



undefined8 * FUN_140338dc0(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;
}



undefined8 * FUN_140338e30(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;
}



undefined8 * FUN_140338ea0(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;
}



undefined8 * FUN_140338f10(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;
}



undefined8 * FUN_140338f80(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;
}



undefined8 * FUN_140338ff0(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;
}



undefined8 *
FUN_140339060(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  if (param_1[5] != 0) {
    FUN_1402ce6b0(param_1[5],param_1[6],param_3,param_4,0xfffffffffffffffe);
    operator_delete((void *)param_1[5]);
  }
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  if (7 < (ulonglong)param_1[3]) {
    operator_delete((void *)*param_1);
  }
  param_1[3] = 7;
  param_1[2] = 0;
  *(undefined2 *)param_1 = 0;
  operator_delete(param_1);
  return param_1;
}



void FUN_1403390e0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14033a700(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140339110(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14030e480(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140339140(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14030e480((longlong)pvVar1 + 0x30);
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x20)) {
      operator_delete(*(void **)((longlong)pvVar1 + 8));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x20) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x18) = 0;
    *(undefined2 *)((longlong)pvVar1 + 8) = 0;
    operator_delete(pvVar1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140339190(undefined1 *param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  int iVar3;
  int **ppiVar4;
  int **ppiVar5;
  undefined8 *puVar6;
  undefined1 *puVar7;
  uint uVar8;
  undefined4 uVar9;
  longlong lVar10;
  int *piVar11;
  int *piVar12;
  short *psVar13;
  short *psVar14;
  wchar_t *pwVar15;
  undefined8 uVar16;
  ulonglong uVar17;
  longlong *plVar18;
  longlong lVar19;
  undefined2 *puVar20;
  int *piVar21;
  wchar_t *pwVar22;
  uint uVar23;
  wchar_t *pwVar24;
  undefined8 *puVar25;
  int *piVar26;
  undefined8 *puVar27;
  undefined1 uVar28;
  bool bVar29;
  undefined1 auStack_e8 [32];
  undefined1 local_c8;
  int *local_b8;
  longlong *local_b0;
  int *local_a8;
  undefined1 *local_98;
  undefined8 *local_90;
  undefined8 *local_88;
  undefined8 local_80;
  undefined8 local_70;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined8 local_58;
  ulonglong local_50;
  ulonglong local_40;
  
  local_70 = 0xfffffffffffffffe;
  local_40 = DAT_1405d84f0 ^ (ulonglong)auStack_e8;
  uVar17 = 0xffffffffffffffff;
  psVar14 = param_2;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar14;
    psVar14 = psVar14 + 1;
  } while (sVar2 != 0);
  local_98 = param_1;
  FUN_140001710(param_1 + 8,param_2,~uVar17 - 1);
  lVar10 = FUN_1402933b0(DAT_140607ff0);
  uVar16 = 0;
  if (lVar10 != 0) {
    piVar21 = (int *)0x0;
    piVar26 = piVar21;
    if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
      piVar12 = piVar21;
      plVar18 = *(longlong **)(lVar10 + 0x68);
      do {
        if (*plVar18 != 0) {
          piVar26 = (int *)(*(longlong **)(lVar10 + 0x68))[(longlong)piVar12];
          break;
        }
        uVar8 = (int)piVar12 + 1;
        piVar12 = (int *)(ulonglong)uVar8;
        plVar18 = plVar18 + 1;
      } while (uVar8 < *(uint *)(lVar10 + 0x78));
    }
LAB_140339243:
    if (piVar26 != (int *)0x0) {
      iVar3 = *piVar26;
      piVar12 = piVar26;
      if (iVar3 != 0) {
        local_a8 = piVar26;
        piVar11 = operator_new(0x128);
        piVar12 = piVar21;
        if (piVar11 != (int *)0x0) {
          piVar11[2] = 0;
          piVar11[3] = 0;
          piVar11[4] = 0;
          piVar11[8] = 0;
          piVar11[0xb] = 0;
          piVar11[0xc] = 0;
          piVar11[0xe] = 0;
          piVar11[0xf] = 0;
          piVar11[0x16] = 7;
          piVar11[0x17] = 0;
          piVar11[0x14] = 0;
          piVar11[0x15] = 0;
          *(undefined2 *)(piVar11 + 0x10) = 0;
          piVar11[0x20] = 7;
          piVar11[0x21] = 0;
          piVar11[0x1e] = 0;
          piVar11[0x1f] = 0;
          *(undefined2 *)(piVar11 + 0x1a) = 0;
          piVar11[0x2a] = 7;
          piVar11[0x2b] = 0;
          piVar11[0x28] = 0;
          piVar11[0x29] = 0;
          *(undefined2 *)(piVar11 + 0x24) = 0;
          piVar11[0x34] = 7;
          piVar11[0x35] = 0;
          piVar11[0x32] = 0;
          piVar11[0x33] = 0;
          *(undefined2 *)(piVar11 + 0x2e) = 0;
          piVar11[0x3e] = 7;
          piVar11[0x3f] = 0;
          piVar11[0x3c] = 0;
          piVar11[0x3d] = 0;
          *(undefined2 *)(piVar11 + 0x38) = 0;
          piVar11[0x42] = 0;
          piVar11[0x43] = 0;
          piVar11[0x44] = 0;
          piVar11[0x45] = 0;
          piVar11[0x46] = 0;
          piVar11[0x47] = 0;
          piVar11[5] = 0;
          piVar11[6] = 0;
          piVar11[7] = 0;
          piVar12 = piVar11;
        }
        local_b8 = piVar12;
        FUN_140339b40(&local_b0,piVar12);
        FUN_140178e90(&local_b8,piVar12,piVar12);
        uVar9 = FUN_1402970c0(lVar10,&DAT_14049f290);
        local_c8 = 1;
        piVar12 = (int *)FUN_140296600(lVar10,iVar3,uVar9,&DAT_14049f290);
        *local_b8 = *piVar12;
        uVar9 = FUN_1402970c0(lVar10,L"fStartFrame");
        local_c8 = 1;
        piVar12 = (int *)FUN_1402967b0(lVar10,iVar3,uVar9,L"fStartFrame");
        local_b8[9] = *piVar12;
        uVar9 = FUN_1402970c0(lVar10,L"fEndFrame");
        local_c8 = 1;
        piVar12 = (int *)FUN_1402967b0(lVar10,iVar3,uVar9,L"fEndFrame");
        local_b8[10] = *piVar12;
        uVar9 = FUN_1402970c0(lVar10,L"szCheckMotion");
        local_c8 = 1;
        psVar13 = (short *)FUN_140296990(lVar10,iVar3,uVar9,L"szCheckMotion");
        uVar17 = 0xffffffffffffffff;
        psVar14 = psVar13;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_b8 + 0x10,psVar13,~uVar17 - 1);
        uVar9 = FUN_1402970c0(lVar10,L"szDownMotion");
        local_c8 = 1;
        psVar13 = (short *)FUN_140296990(lVar10,iVar3,uVar9,L"szDownMotion");
        uVar17 = 0xffffffffffffffff;
        psVar14 = psVar13;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_b8 + 0x1a,psVar13,~uVar17 - 1);
        uVar9 = FUN_1402970c0(lVar10,L"szDownUpMotion");
        local_c8 = 1;
        psVar13 = (short *)FUN_140296990(lVar10,iVar3,uVar9,L"szDownUpMotion");
        uVar17 = 0xffffffffffffffff;
        psVar14 = psVar13;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_b8 + 0x2e,psVar13,~uVar17 - 1);
        uVar9 = FUN_1402970c0(lVar10,L"szDownUpAttackMotion");
        local_c8 = 1;
        psVar13 = (short *)FUN_140296990(lVar10,iVar3,uVar9,L"szDownUpAttackMotion");
        uVar17 = 0xffffffffffffffff;
        psVar14 = psVar13;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_b8 + 0x38,psVar13,~uVar17 - 1);
        uVar9 = FUN_1402970c0(lVar10,L"fDownUpAttackPriority");
        local_c8 = 1;
        piVar12 = (int *)FUN_1402967b0(lVar10,iVar3,uVar9,L"fDownUpAttackPriority");
        local_b8[0xd] = *piVar12;
        uVar9 = FUN_1402970c0(lVar10,L"nHitCount");
        local_c8 = 0;
        piVar12 = (int *)FUN_140296600(lVar10,iVar3,uVar9,L"nHitCount");
        if (piVar12 != (int *)0x0) {
          local_b8[2] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"nFeatureID");
        local_c8 = 0;
        piVar12 = (int *)FUN_140296600(lVar10,iVar3,uVar9,L"nFeatureID");
        if (piVar12 != (int *)0x0) {
          local_b8[3] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"fMinDownTime");
        local_c8 = 0;
        piVar12 = (int *)FUN_1402967b0(lVar10,iVar3,uVar9,L"fMinDownTime");
        if (piVar12 != (int *)0x0) {
          local_b8[0xb] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"fMaxDownTime");
        local_c8 = 0;
        piVar12 = (int *)FUN_1402967b0(lVar10,iVar3,uVar9,L"fMaxDownTime");
        if (piVar12 != (int *)0x0) {
          local_b8[0xc] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"szDownLoopMotion");
        local_c8 = 0;
        psVar14 = (short *)FUN_140296990(lVar10,iVar3,uVar9,L"szDownLoopMotion");
        if (psVar14 != (short *)0x0) {
          uVar17 = 0xffffffffffffffff;
          psVar13 = psVar14;
          do {
            if (uVar17 == 0) break;
            uVar17 = uVar17 - 1;
            sVar2 = *psVar13;
            psVar13 = psVar13 + 1;
          } while (sVar2 != 0);
          FUN_140001710(local_b8 + 0x24,psVar14,~uVar17 - 1);
        }
        uVar9 = FUN_1402970c0(lVar10,L"fWeekHitDamage");
        local_c8 = 0;
        piVar12 = (int *)FUN_1402967b0(lVar10,iVar3,uVar9,L"fWeekHitDamage");
        if (piVar12 != (int *)0x0) {
          local_b8[0xe] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"szCollisions");
        local_c8 = 1;
        psVar13 = (short *)FUN_140296990(lVar10,iVar3,uVar9,L"szCollisions");
        local_50 = 7;
        local_58 = 0;
        local_68 = 0;
        uVar17 = 0xffffffffffffffff;
        psVar14 = psVar13;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_68,psVar13,~uVar17 - 1);
        local_90 = (undefined8 *)0x0;
        local_88 = (undefined8 *)0x0;
        local_80 = 0;
        puVar20 = &local_68;
        if (7 < local_50) {
          puVar20 = (undefined2 *)CONCAT62(uStack_66,local_68);
        }
        FUN_140415930(&local_90,puVar20,&DAT_14049c7b8);
        puVar27 = local_90;
        lVar19 = ((longlong)local_88 - (longlong)local_90) / 0x28;
        FUN_14008eb00(local_b8 + 0x42,lVar19);
        uVar8 = (uint)lVar19;
        uVar28 = uVar8 == 0;
        piVar12 = piVar21;
        if (0 < (int)uVar8) {
          do {
            FUN_14008ec00(local_b8 + 0x42,puVar27 + (longlong)(int)piVar12 * 5);
            uVar23 = (int)piVar12 + 1;
            uVar28 = uVar23 == uVar8;
            piVar12 = (int *)(ulonglong)uVar23;
          } while ((int)uVar23 < (int)uVar8);
        }
        uVar9 = FUN_1402970c0(lVar10,L"szState");
        local_c8 = 1;
        pwVar15 = (wchar_t *)FUN_140296990(lVar10,iVar3,uVar9,L"szState");
        lVar19 = 7;
        pwVar22 = pwVar15;
        pwVar24 = L"MOTION";
        do {
          if (lVar19 == 0) break;
          lVar19 = lVar19 + -1;
          uVar28 = *pwVar22 == *pwVar24;
          pwVar22 = pwVar22 + 1;
          pwVar24 = pwVar24 + 1;
        } while ((bool)uVar28);
        if ((bool)uVar28) {
LAB_140339817:
          local_b8[1] = 3;
        }
        else {
          lVar19 = 4;
          bVar29 = false;
          pwVar22 = pwVar15;
          pwVar24 = L"ALL";
          do {
            if (lVar19 == 0) break;
            lVar19 = lVar19 + -1;
            bVar29 = *pwVar22 == *pwVar24;
            pwVar22 = pwVar22 + 1;
            pwVar24 = pwVar24 + 1;
          } while (bVar29);
          if (bVar29) {
            local_b8[1] = 1;
          }
          else {
            lVar19 = 0xb;
            pwVar22 = L"MOTION_HIT";
            do {
              if (lVar19 == 0) break;
              lVar19 = lVar19 + -1;
              bVar29 = *pwVar15 == *pwVar22;
              pwVar15 = pwVar15 + 1;
              pwVar22 = pwVar22 + 1;
            } while (bVar29);
            if (!bVar29) goto LAB_140339817;
            local_b8[1] = 4;
            *local_98 = 1;
          }
        }
        uVar9 = FUN_1402970c0(lVar10,L"szActType");
        local_c8 = 0;
        pwVar15 = (wchar_t *)FUN_140296990(lVar10,iVar3,uVar9,L"szActType");
        bVar29 = pwVar15 == (wchar_t *)0x0;
        if (!bVar29) {
          lVar19 = 10;
          pwVar22 = L"ITEM_PICK";
          do {
            if (lVar19 == 0) break;
            lVar19 = lVar19 + -1;
            bVar29 = *pwVar15 == *pwVar22;
            pwVar15 = pwVar15 + 1;
            pwVar22 = pwVar22 + 1;
          } while (bVar29);
          if (bVar29) {
            local_b8[4] = 1;
          }
        }
        uVar9 = FUN_1402970c0(lVar10,L"nAct01");
        local_c8 = 0;
        piVar12 = (int *)FUN_140296600(lVar10,iVar3,uVar9,L"nAct01");
        if (piVar12 != (int *)0x0) {
          local_b8[5] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"nAct02");
        local_c8 = 0;
        piVar12 = (int *)FUN_140296600(lVar10,iVar3,uVar9,L"nAct02");
        if (piVar12 != (int *)0x0) {
          local_b8[6] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"nAct03");
        local_c8 = 0;
        piVar12 = (int *)FUN_140296600(lVar10,iVar3,uVar9,L"nAct03");
        if (piVar12 != (int *)0x0) {
          local_b8[7] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"nActCount");
        local_c8 = 0;
        piVar12 = (int *)FUN_140296600(lVar10,iVar3,uVar9,L"nActCount");
        if (piVar12 != (int *)0x0) {
          local_b8[8] = *piVar12;
        }
        uVar9 = FUN_1402970c0(lVar10,L"fActPriority");
        local_c8 = 0;
        piVar12 = (int *)FUN_1402967b0(lVar10,iVar3,uVar9,L"fActPriority");
        puVar7 = local_98;
        if (piVar12 != (int *)0x0) {
          local_b8[0xf] = *piVar12;
        }
        ppiVar4 = *(int ***)(local_98 + 0x38);
        if ((&local_b8 < ppiVar4) && (ppiVar5 = *(int ***)(local_98 + 0x30), ppiVar5 <= &local_b8))
        {
          if (ppiVar4 == *(int ***)(local_98 + 0x40)) {
            FUN_1403435d0(local_98 + 0x30);
          }
          puVar25 = (undefined8 *)
                    (((longlong)&local_b8 - (longlong)ppiVar5 & 0xfffffffffffffff0U) +
                    *(longlong *)(puVar7 + 0x30));
          puVar6 = *(undefined8 **)(puVar7 + 0x38);
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = *puVar25;
            lVar19 = puVar25[1];
            puVar6[1] = lVar19;
            if (lVar19 != 0) {
              LOCK();
              *(int *)(lVar19 + 8) = *(int *)(lVar19 + 8) + 1;
              UNLOCK();
              puVar27 = local_90;
              piVar26 = local_a8;
            }
          }
        }
        else {
          if (ppiVar4 == *(int ***)(local_98 + 0x40)) {
            FUN_1403435d0(local_98 + 0x30);
          }
          puVar6 = *(undefined8 **)(puVar7 + 0x38);
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = local_b8;
            puVar6[1] = local_b0;
            if (local_b0 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_b0 + 1) = (int)local_b0[1] + 1;
              UNLOCK();
              puVar27 = local_90;
              piVar26 = local_a8;
            }
          }
        }
        puVar25 = local_88;
        *(longlong *)(puVar7 + 0x38) = *(longlong *)(puVar7 + 0x38) + 0x10;
        puVar6 = puVar27;
        if (puVar27 != (undefined8 *)0x0) {
          for (; puVar6 != puVar25; puVar6 = puVar6 + 5) {
            if (7 < (ulonglong)puVar6[3]) {
              operator_delete((void *)*puVar6);
            }
            puVar6[3] = 7;
            puVar6[2] = 0;
            *(undefined2 *)puVar6 = 0;
          }
          operator_delete(puVar27);
        }
        if (7 < local_50) {
          operator_delete((void *)CONCAT62(uStack_66,local_68));
        }
        plVar18 = local_b0;
        local_50 = 7;
        local_58 = 0;
        local_68 = 0;
        piVar12 = piVar26;
        if (local_b0 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_b0 + 1;
          lVar19 = *plVar1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          piVar12 = local_a8;
          if ((int)lVar19 == 1) {
            (**(code **)(*local_b0 + 8))(local_b0);
            LOCK();
            piVar26 = (int *)((longlong)plVar18 + 0xc);
            iVar3 = *piVar26;
            *piVar26 = *piVar26 + -1;
            UNLOCK();
            piVar12 = local_a8;
            if (iVar3 == 1) {
              (**(code **)(*plVar18 + 0x10))(plVar18);
              piVar12 = local_a8;
            }
          }
        }
      }
      piVar26 = *(int **)(piVar12 + 6);
      if (piVar26 == (int *)0x0) {
        uVar8 = (uint)piVar12[8] % *(uint *)(lVar10 + 0x78) + 1;
        lVar19 = (longlong)(int)uVar8 << 3;
        piVar26 = piVar21;
        do {
          if (*(uint *)(lVar10 + 0x78) <= uVar8) break;
          if (*(longlong *)(*(longlong *)(lVar10 + 0x68) + lVar19) != 0) {
            piVar26 = *(int **)(*(longlong *)(lVar10 + 0x68) + lVar19);
          }
          uVar8 = uVar8 + 1;
          lVar19 = lVar19 + 8;
        } while (piVar26 == (int *)0x0);
      }
      goto LAB_140339243;
    }
    uVar16 = 1;
  }
  return uVar16;
}



undefined8 * FUN_140339b40(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;
}



void FUN_140339bb0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_140339be0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140339be0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x108) != 0) {
    FUN_14008d0a0(*(longlong *)(param_1 + 0x108),*(undefined8 *)(param_1 + 0x110));
    operator_delete(*(void **)(param_1 + 0x108));
  }
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined8 *)(param_1 + 0x110) = 0;
  *(undefined8 *)(param_1 + 0x118) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xf8)) {
    operator_delete(*(void **)(param_1 + 0xe0));
  }
  *(undefined8 *)(param_1 + 0xf8) = 7;
  *(undefined8 *)(param_1 + 0xf0) = 0;
  *(undefined2 *)(param_1 + 0xe0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xd0)) {
    operator_delete(*(void **)(param_1 + 0xb8));
  }
  *(undefined8 *)(param_1 + 0xd0) = 7;
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined2 *)(param_1 + 0xb8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xa8)) {
    operator_delete(*(void **)(param_1 + 0x90));
  }
  *(undefined8 *)(param_1 + 0xa8) = 7;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  *(undefined2 *)(param_1 + 0x90) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x80)) {
    operator_delete(*(void **)(param_1 + 0x68));
  }
  *(undefined8 *)(param_1 + 0x80) = 7;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined2 *)(param_1 + 0x68) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x58)) {
    operator_delete(*(void **)(param_1 + 0x40));
  }
  *(undefined8 *)(param_1 + 0x58) = 7;
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined2 *)(param_1 + 0x40) = 0;
  return;
}



undefined8 FUN_140339d10(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  short sVar4;
  undefined4 uVar5;
  undefined4 **ppuVar6;
  undefined4 **ppuVar7;
  undefined8 *puVar8;
  uint uVar9;
  undefined4 uVar10;
  longlong lVar11;
  void *pvVar12;
  undefined4 *puVar13;
  wchar_t *pwVar14;
  short *psVar15;
  undefined8 uVar16;
  ulonglong uVar17;
  longlong *plVar18;
  longlong lVar19;
  wchar_t *pwVar20;
  wchar_t *pwVar21;
  short *psVar22;
  undefined8 *puVar23;
  undefined4 *puVar24;
  ulonglong *puVar25;
  bool bVar26;
  undefined4 *local_40;
  longlong *local_38;
  undefined4 *local_30;
  
  lVar11 = FUN_1402933b0();
  uVar16 = 0;
  if (lVar11 != 0) {
    uVar17 = 0xffffffffffffffff;
    psVar22 = param_2;
    do {
      if (uVar17 == 0) break;
      uVar17 = uVar17 - 1;
      sVar4 = *psVar22;
      psVar22 = psVar22 + 1;
    } while (sVar4 != 0);
    FUN_140001710(param_1 + 8,param_2,~uVar17 - 1);
    puVar25 = (ulonglong *)(param_1 + 0x30);
    FUN_140343660(puVar25,(longlong)*(int *)(lVar11 + 0x70));
    if (*(longlong *)(lVar11 + 0x70) != 0) {
      uVar17 = 0;
      if (*(uint *)(lVar11 + 0x78) != 0) {
        plVar18 = *(longlong **)(lVar11 + 0x68);
        do {
          if (*plVar18 != 0) {
            puVar24 = (undefined4 *)(*(longlong **)(lVar11 + 0x68))[uVar17];
            goto LAB_140339dc0;
          }
          uVar9 = (int)uVar17 + 1;
          uVar17 = (ulonglong)uVar9;
          plVar18 = plVar18 + 1;
        } while (uVar9 < *(uint *)(lVar11 + 0x78));
      }
    }
    puVar24 = (undefined4 *)0x0;
LAB_140339dc0:
    if (puVar24 != (undefined4 *)0x0) {
      uVar5 = *puVar24;
      local_30 = puVar24;
      pvVar12 = operator_new(0x140);
      if (pvVar12 == (void *)0x0) {
        puVar13 = (undefined4 *)0x0;
      }
      else {
        puVar13 = (undefined4 *)FUN_14033a640(pvVar12);
      }
      local_40 = puVar13;
      FUN_14033a450(&local_38,puVar13);
      FUN_140178e90(&local_40,puVar13,puVar13);
      uVar10 = FUN_1402970c0(lVar11,&DAT_14049f290);
      puVar13 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,&DAT_14049f290,1);
      *local_40 = *puVar13;
      uVar10 = FUN_1402970c0(lVar11,L"szType");
      pwVar14 = (wchar_t *)FUN_140296990(lVar11,uVar5,uVar10,L"szType",1);
      bVar26 = pwVar14 == (wchar_t *)0x0;
      if (!bVar26) {
        lVar19 = 7;
        pwVar20 = pwVar14;
        pwVar21 = L"NORMAL";
        do {
          if (lVar19 == 0) break;
          lVar19 = lVar19 + -1;
          bVar26 = *pwVar20 == *pwVar21;
          pwVar20 = pwVar20 + 1;
          pwVar21 = pwVar21 + 1;
        } while (bVar26);
        if (bVar26) {
          local_40[1] = 0;
        }
        else {
          lVar19 = 5;
          pwVar20 = pwVar14;
          pwVar21 = L"KEEP";
          do {
            if (lVar19 == 0) break;
            lVar19 = lVar19 + -1;
            bVar26 = *pwVar20 == *pwVar21;
            pwVar20 = pwVar20 + 1;
            pwVar21 = pwVar21 + 1;
          } while (bVar26);
          if (bVar26) {
            local_40[1] = 1;
          }
          else {
            lVar19 = 8;
            pwVar20 = L"SWALLOW";
            do {
              if (lVar19 == 0) break;
              lVar19 = lVar19 + -1;
              bVar26 = *pwVar14 == *pwVar20;
              pwVar14 = pwVar14 + 1;
              pwVar20 = pwVar20 + 1;
            } while (bVar26);
            if (bVar26) {
              local_40[1] = 2;
            }
          }
        }
      }
      uVar10 = FUN_1402970c0(lVar11,L"nCancelHitCount");
      puVar13 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,L"nCancelHitCount",1);
      local_40[2] = *puVar13;
      uVar10 = FUN_1402970c0(lVar11,L"nCancelKeyInputCount");
      puVar13 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,L"nCancelKeyInputCount",1);
      local_40[3] = *puVar13;
      uVar10 = FUN_1402970c0(lVar11,L"nCount");
      puVar13 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,L"nCount",1);
      local_40[4] = *puVar13;
      uVar10 = FUN_1402970c0(lVar11,L"nStartCameraID");
      puVar13 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,L"nStartCameraID",0);
      if (puVar13 != (undefined4 *)0x0) {
        local_40[5] = *puVar13;
      }
      uVar10 = FUN_1402970c0(lVar11,L"nEndCameraID");
      puVar13 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,L"nEndCameraID",0);
      if (puVar13 != (undefined4 *)0x0) {
        local_40[6] = *puVar13;
      }
      uVar10 = FUN_1402970c0(lVar11,L"fCancelHitPriority");
      puVar13 = (undefined4 *)FUN_1402967b0(lVar11,uVar5,uVar10,L"fCancelHitPriority",1);
      local_40[7] = *puVar13;
      uVar10 = FUN_1402970c0(lVar11,L"fCancelKeyPriority");
      puVar13 = (undefined4 *)FUN_1402967b0(lVar11,uVar5,uVar10,L"fCancelKeyPriority",1);
      local_40[8] = *puVar13;
      uVar10 = FUN_1402970c0(lVar11,L"szDummy");
      psVar15 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szDummy",1);
      uVar17 = 0xffffffffffffffff;
      psVar22 = psVar15;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar4 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_40 + 10,psVar15,~uVar17 - 1);
      uVar10 = FUN_1402970c0(lVar11,L"szCheckMotion");
      psVar15 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szCheckMotion",1);
      uVar17 = 0xffffffffffffffff;
      psVar22 = psVar15;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar4 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_40 + 0x14,psVar15,~uVar17 - 1);
      uVar10 = FUN_1402970c0(lVar11,L"szCatchMotion");
      psVar15 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szCatchMotion",1);
      uVar17 = 0xffffffffffffffff;
      psVar22 = psVar15;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar4 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_40 + 0x1e,psVar15,~uVar17 - 1);
      uVar10 = FUN_1402970c0(lVar11,L"szSuccessMotion");
      psVar15 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szSuccessMotion",1);
      uVar17 = 0xffffffffffffffff;
      psVar22 = psVar15;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar4 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_40 + 0x28,psVar15,~uVar17 - 1);
      uVar10 = FUN_1402970c0(lVar11,L"szFailMotion");
      psVar15 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szFailMotion",1);
      uVar17 = 0xffffffffffffffff;
      psVar22 = psVar15;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar4 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_40 + 0x3c,psVar15,~uVar17 - 1);
      uVar10 = FUN_1402970c0(lVar11,L"szEndMotion");
      psVar15 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szEndMotion",1);
      uVar17 = 0xffffffffffffffff;
      psVar22 = psVar15;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar4 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_40 + 0x32,psVar15,~uVar17 - 1);
      uVar10 = FUN_1402970c0(lVar11,L"szCancelMotion");
      psVar15 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szCancelMotion",1);
      uVar17 = 0xffffffffffffffff;
      psVar22 = psVar15;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar4 = *psVar22;
        psVar22 = psVar22 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_40 + 0x46,psVar15,~uVar17 - 1);
      ppuVar6 = *(undefined4 ***)(param_1 + 0x38);
      if ((&local_40 < ppuVar6) && (ppuVar7 = (undefined4 **)*puVar25, ppuVar7 <= &local_40)) {
        if (ppuVar6 == *(undefined4 ***)(param_1 + 0x40)) {
          FUN_1403435d0(puVar25);
        }
        puVar23 = (undefined8 *)
                  (((longlong)&local_40 - (longlong)ppuVar7 & 0xfffffffffffffff0U) + *puVar25);
        puVar8 = *(undefined8 **)(param_1 + 0x38);
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = *puVar23;
          lVar19 = puVar23[1];
          puVar8[1] = lVar19;
          if (lVar19 != 0) {
            LOCK();
            *(int *)(lVar19 + 8) = *(int *)(lVar19 + 8) + 1;
            UNLOCK();
            puVar24 = local_30;
          }
        }
      }
      else {
        if (ppuVar6 == *(undefined4 ***)(param_1 + 0x40)) {
          FUN_1403435d0(puVar25);
        }
        puVar8 = *(undefined8 **)(param_1 + 0x38);
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = local_40;
          puVar8[1] = local_38;
          if (local_38 != (longlong *)0x0) {
            LOCK();
            *(int *)(local_38 + 1) = (int)local_38[1] + 1;
            UNLOCK();
            puVar24 = local_30;
          }
        }
      }
      plVar18 = local_38;
      *(longlong *)(param_1 + 0x38) = *(longlong *)(param_1 + 0x38) + 0x10;
      puVar13 = puVar24;
      if (local_38 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_38 + 1;
        lVar19 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar13 = local_30;
        if ((int)lVar19 == 1) {
          (**(code **)(*local_38 + 8))(local_38);
          LOCK();
          piVar2 = (int *)((longlong)plVar18 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar13 = local_30;
          if (iVar3 == 1) {
            (**(code **)(*plVar18 + 0x10))(plVar18);
            puVar13 = local_30;
          }
        }
      }
      puVar24 = *(undefined4 **)(puVar13 + 6);
      if (puVar24 == (undefined4 *)0x0) {
        uVar9 = (uint)puVar13[8] % *(uint *)(lVar11 + 0x78) + 1;
        lVar19 = (longlong)(int)uVar9 << 3;
        do {
          if (*(uint *)(lVar11 + 0x78) <= uVar9) break;
          if (*(longlong *)(*(longlong *)(lVar11 + 0x68) + lVar19) != 0) {
            puVar24 = *(undefined4 **)(*(longlong *)(lVar11 + 0x68) + lVar19);
          }
          uVar9 = uVar9 + 1;
          lVar19 = lVar19 + 8;
        } while (puVar24 == (undefined4 *)0x0);
      }
      goto LAB_140339dc0;
    }
    uVar16 = 1;
  }
  return uVar16;
}



void FUN_14033a390(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;
}



longlong FUN_14033a3d0(longlong param_1,longlong param_2)

{
  short sVar1;
  short sVar2;
  longlong lVar3;
  longlong *plVar4;
  short *psVar5;
  longlong lVar6;
  
  plVar4 = *(longlong **)(param_1 + 0x30);
  do {
    if (plVar4 == *(longlong **)(param_1 + 0x38)) {
      return 0;
    }
    lVar3 = *plVar4;
    psVar5 = (short *)(lVar3 + 0x50);
    if (7 < *(ulonglong *)(lVar3 + 0x68)) {
      psVar5 = *(short **)psVar5;
    }
    lVar6 = param_2 - (longlong)psVar5;
    do {
      sVar1 = *psVar5;
      sVar2 = *(short *)((longlong)psVar5 + lVar6);
      if (sVar1 != sVar2) break;
      psVar5 = psVar5 + 1;
    } while (sVar2 != 0);
    if (sVar1 == sVar2) {
      return lVar3;
    }
    plVar4 = plVar4 + 2;
  } while( true );
}



undefined8 * FUN_14033a450(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;
}



void FUN_14033a4c0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14033a4f0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14033a4f0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x130)) {
    operator_delete(*(void **)(param_1 + 0x118));
  }
  *(undefined8 *)(param_1 + 0x130) = 7;
  *(undefined8 *)(param_1 + 0x128) = 0;
  *(undefined2 *)(param_1 + 0x118) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x108)) {
    operator_delete(*(void **)(param_1 + 0xf0));
  }
  *(undefined8 *)(param_1 + 0x108) = 7;
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(undefined2 *)(param_1 + 0xf0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xe0)) {
    operator_delete(*(void **)(param_1 + 200));
  }
  *(undefined8 *)(param_1 + 0xe0) = 7;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined2 *)(param_1 + 200) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xb8)) {
    operator_delete(*(void **)(param_1 + 0xa0));
  }
  *(undefined8 *)(param_1 + 0xb8) = 7;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined2 *)(param_1 + 0xa0) = 0;
  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;
}



undefined8 * FUN_14033a640(undefined8 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  param_1[7] = 0;
  param_1[8] = 7;
  *(undefined2 *)(param_1 + 5) = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 7;
  *(undefined2 *)(param_1 + 10) = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 7;
  *(undefined2 *)(param_1 + 0xf) = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 7;
  *(undefined2 *)(param_1 + 0x14) = 0;
  param_1[0x1b] = 0;
  param_1[0x1c] = 7;
  *(undefined2 *)(param_1 + 0x19) = 0;
  param_1[0x20] = 0;
  param_1[0x21] = 7;
  *(undefined2 *)(param_1 + 0x1e) = 0;
  param_1[0x25] = 0;
  param_1[0x26] = 7;
  *(undefined2 *)(param_1 + 0x23) = 0;
  return param_1;
}



void FUN_14033a700(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  if (*(longlong *)(param_1 + 0x30) != 0) {
    FUN_1402ce6b0(*(longlong *)(param_1 + 0x30),*(undefined8 *)(param_1 + 0x38),param_3,param_4,
                  0xfffffffffffffffe);
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 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;
}



undefined8 FUN_14033a780(longlong param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  int *piVar3;
  int **ppiVar4;
  int **ppiVar5;
  undefined8 *puVar6;
  int *piVar7;
  uint uVar8;
  undefined4 uVar9;
  int iVar10;
  int iVar11;
  longlong lVar12;
  int *piVar13;
  int *piVar14;
  longlong lVar15;
  wchar_t *pwVar16;
  undefined8 uVar17;
  ulonglong uVar18;
  longlong *plVar19;
  wchar_t *pwVar20;
  wchar_t *_Str;
  int *piVar21;
  wchar_t *pwVar22;
  short *psVar23;
  undefined8 *puVar24;
  undefined1 uVar25;
  int local_res18 [2];
  int local_res20;
  int *local_b8;
  longlong *local_b0;
  int *local_a8;
  longlong local_a0;
  int *local_98;
  wchar_t *local_88;
  wchar_t *local_80;
  undefined8 local_78;
  wchar_t *local_68;
  wchar_t *local_60;
  undefined8 local_58;
  undefined8 local_48;
  
  local_48 = 0xfffffffffffffffe;
  uVar18 = 0xffffffffffffffff;
  psVar23 = param_2;
  do {
    if (uVar18 == 0) break;
    uVar18 = uVar18 - 1;
    sVar2 = *psVar23;
    psVar23 = psVar23 + 1;
  } while (sVar2 != 0);
  FUN_140001710(param_1 + 8,param_2,~uVar18 - 1);
  lVar12 = FUN_1402933b0(DAT_140607ff0);
  uVar17 = 0;
  if (lVar12 != 0) {
    piVar21 = (int *)0x0;
    local_a8 = piVar21;
    local_a0 = lVar12;
    if ((*(longlong *)(lVar12 + 0x70) != 0) && (*(uint *)(lVar12 + 0x78) != 0)) {
      piVar14 = piVar21;
      plVar19 = *(longlong **)(lVar12 + 0x68);
      do {
        if (*plVar19 != 0) {
          local_a8 = (int *)(*(longlong **)(lVar12 + 0x68))[(longlong)piVar14];
          break;
        }
        uVar8 = (int)piVar14 + 1;
        piVar14 = (int *)(ulonglong)uVar8;
        plVar19 = plVar19 + 1;
      } while (uVar8 < *(uint *)(lVar12 + 0x78));
    }
LAB_14033a834:
    if (local_a8 != (int *)0x0) {
      iVar11 = *local_a8;
      piVar14 = local_a8;
      if (iVar11 != 0) {
        local_res20 = iVar11;
        local_98 = local_a8;
        piVar13 = operator_new(0x48);
        piVar14 = piVar21;
        if (piVar13 != (int *)0x0) {
          piVar13[0] = 0;
          piVar13[1] = 0;
          piVar13[2] = 0;
          piVar13[3] = 0;
          piVar13[4] = 0;
          piVar13[5] = 0;
          piVar13[9] = 0;
          piVar13[10] = 0;
          piVar13[0xb] = 0;
          piVar13[0xc] = 0;
          piVar13[0xd] = 0;
          piVar13[0xe] = 0;
          piVar13[0xf] = 0;
          piVar13[6] = 0;
          piVar13[7] = 0;
          piVar13[8] = 0;
          piVar14 = piVar13;
        }
        local_b8 = piVar14;
        FUN_14033afd0(&local_b0,piVar14);
        FUN_140178e90(&local_b8,piVar14,piVar14);
        uVar9 = FUN_1402970c0(lVar12,&DAT_14049f290);
        piVar14 = (int *)FUN_140296600(lVar12,iVar11,uVar9,&DAT_14049f290,1);
        local_b8[3] = *piVar14;
        uVar9 = FUN_1402970c0(lVar12,L"fPriority");
        piVar14 = (int *)FUN_1402967b0(lVar12,iVar11,uVar9,L"fPriority",1);
        *local_b8 = *piVar14;
        uVar9 = FUN_1402970c0(lVar12,L"fValue");
        piVar14 = (int *)FUN_1402967b0(lVar12,iVar11,uVar9,L"fValue",1);
        local_b8[1] = *piVar14;
        uVar9 = FUN_1402970c0(lVar12,L"fCoolTime");
        piVar14 = (int *)FUN_1402967b0(lVar12,iVar11,uVar9,L"fCoolTime",1);
        local_b8[2] = *piVar14;
        uVar9 = FUN_1402970c0(lVar12,L"nCount");
        piVar14 = (int *)FUN_140296600(lVar12,iVar11,uVar9,L"nCount",1);
        local_b8[5] = *piVar14;
        iVar10 = local_b8[5];
        if (iVar10 == 0) {
          iVar10 = 99999;
        }
        local_b8[5] = iVar10;
        uVar9 = FUN_1402970c0(lVar12,L"szComboID");
        lVar15 = FUN_140296990(lVar12,iVar11,uVar9,L"szComboID",0);
        uVar25 = lVar15 == 0;
        if (!(bool)uVar25) {
          local_88 = (wchar_t *)0x0;
          local_80 = (wchar_t *)0x0;
          local_78 = 0;
          FUN_140415930(&local_88,lVar15,&DAT_14049c7b8);
          pwVar22 = local_80;
          pwVar16 = local_88;
          lVar15 = ((longlong)local_80 - (longlong)local_88) / 0x28;
          FUN_140051e60(local_b8 + 10,lVar15);
          iVar11 = (int)lVar15;
          pwVar20 = pwVar16;
          piVar14 = piVar21;
          if (0 < iVar11) {
            do {
              pwVar20 = pwVar16;
              if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
                pwVar20 = *(wchar_t **)pwVar16;
              }
              iVar10 = _wtoi(pwVar20);
              piVar7 = local_b8;
              piVar13 = *(int **)(local_b8 + 0xc);
              local_res18[0] = iVar10;
              if ((local_res18 < piVar13) &&
                 (piVar3 = *(int **)(local_b8 + 10), piVar3 <= local_res18)) {
                if (piVar13 == *(int **)(local_b8 + 0xe)) {
                  FUN_1400556a0(local_b8 + 10,1);
                }
                if (*(undefined4 **)(piVar7 + 0xc) != (undefined4 *)0x0) {
                  **(undefined4 **)(piVar7 + 0xc) =
                       *(undefined4 *)
                        (*(longlong *)(piVar7 + 10) +
                        ((longlong)local_res18 - (longlong)piVar3 >> 2) * 4);
                }
              }
              else {
                if (piVar13 == *(int **)(local_b8 + 0xe)) {
                  FUN_1400556a0(local_b8 + 10,1);
                }
                if (*(int **)(piVar7 + 0xc) != (int *)0x0) {
                  **(int **)(piVar7 + 0xc) = iVar10;
                }
              }
              *(longlong *)(piVar7 + 0xc) = *(longlong *)(piVar7 + 0xc) + 4;
              uVar8 = (int)piVar14 + 1;
              pwVar16 = pwVar16 + 0x14;
              pwVar20 = local_88;
              lVar12 = local_a0;
              piVar14 = (int *)(ulonglong)uVar8;
            } while ((int)uVar8 < iVar11);
          }
          uVar25 = pwVar20 == (wchar_t *)0x0;
          iVar11 = local_res20;
          pwVar16 = pwVar20;
          if (!(bool)uVar25) {
            for (; uVar25 = pwVar16 == pwVar22, !(bool)uVar25; pwVar16 = pwVar16 + 0x14) {
              if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
                operator_delete(*(void **)pwVar16);
              }
              pwVar16[0xc] = L'\a';
              pwVar16[0xd] = L'\0';
              pwVar16[0xe] = L'\0';
              pwVar16[0xf] = L'\0';
              pwVar16[8] = L'\0';
              pwVar16[9] = L'\0';
              pwVar16[10] = L'\0';
              pwVar16[0xb] = L'\0';
              *pwVar16 = L'\0';
            }
            operator_delete(pwVar20);
            iVar11 = local_res20;
          }
        }
        uVar9 = FUN_1402970c0(lVar12,L"szMODE");
        pwVar16 = (wchar_t *)FUN_140296990(lVar12,iVar11,uVar9,L"szMODE",1);
        lVar15 = 9;
        pwVar22 = pwVar16;
        pwVar20 = L"HP_RATIO";
        do {
          if (lVar15 == 0) break;
          lVar15 = lVar15 + -1;
          uVar25 = *pwVar22 == *pwVar20;
          pwVar22 = pwVar22 + 1;
          pwVar20 = pwVar20 + 1;
        } while ((bool)uVar25);
        if ((bool)uVar25) {
          local_b8[4] = 1;
        }
        else {
          lVar15 = 7;
          pwVar22 = L"DAMAGE";
          do {
            if (lVar15 == 0) break;
            lVar15 = lVar15 + -1;
            uVar25 = *pwVar16 == *pwVar22;
            pwVar16 = pwVar16 + 1;
            pwVar22 = pwVar22 + 1;
          } while ((bool)uVar25);
          if ((bool)uVar25) {
            local_b8[4] = 2;
          }
        }
        uVar9 = FUN_1402970c0(lVar12,L"szFeatureID");
        lVar15 = FUN_140296990(lVar12,iVar11,uVar9,L"szFeatureID",0);
        if (lVar15 != 0) {
          local_68 = (wchar_t *)0x0;
          local_60 = (wchar_t *)0x0;
          local_58 = 0;
          FUN_140415930(&local_68,lVar15,&DAT_14049c7b8);
          pwVar22 = local_60;
          pwVar16 = local_68;
          iVar10 = (int)(((longlong)local_60 - (longlong)local_68) / 0x28);
          pwVar20 = local_68;
          piVar14 = piVar21;
          if (0 < iVar10) {
            do {
              uVar8 = (uint)piVar14;
              iVar11 = local_res20;
              if (2 < (int)uVar8) break;
              _Str = pwVar20;
              if (7 < *(ulonglong *)(pwVar20 + 0xc)) {
                _Str = *(wchar_t **)pwVar20;
              }
              iVar11 = _wtoi(_Str);
              if (uVar8 < 3) {
                piVar14 = local_b8 + (longlong)(int)uVar8 + 6;
              }
              else {
                if (DAT_1406081e8 == 0) {
                  FUN_140176d60(0);
                }
                DAT_1406081e8 = DAT_1406081e8 + 1;
                piVar14 = &DAT_1406081ec;
              }
              *piVar14 = iVar11;
              pwVar20 = pwVar20 + 0x14;
              piVar14 = (int *)(ulonglong)(uVar8 + 1);
              iVar11 = local_res20;
            } while ((int)(uVar8 + 1) < iVar10);
          }
          lVar12 = local_a0;
          pwVar20 = pwVar16;
          if (pwVar16 != (wchar_t *)0x0) {
            for (; pwVar20 != pwVar22; pwVar20 = pwVar20 + 0x14) {
              if (7 < *(ulonglong *)(pwVar20 + 0xc)) {
                operator_delete(*(void **)pwVar20);
              }
              pwVar20[0xc] = L'\a';
              pwVar20[0xd] = L'\0';
              pwVar20[0xe] = L'\0';
              pwVar20[0xf] = L'\0';
              pwVar20[8] = L'\0';
              pwVar20[9] = L'\0';
              pwVar20[10] = L'\0';
              pwVar20[0xb] = L'\0';
              *pwVar20 = L'\0';
            }
            operator_delete(pwVar16);
            lVar12 = local_a0;
          }
        }
        uVar9 = FUN_1402970c0(lVar12,L"nNextFeatureID");
        piVar14 = (int *)FUN_140296600(lVar12,iVar11,uVar9,L"nNextFeatureID",0);
        if (piVar14 != (int *)0x0) {
          local_b8[9] = *piVar14;
        }
        ppiVar4 = *(int ***)(param_1 + 0x38);
        if ((&local_b8 < ppiVar4) && (ppiVar5 = *(int ***)(param_1 + 0x30), ppiVar5 <= &local_b8)) {
          if (ppiVar4 == *(int ***)(param_1 + 0x40)) {
            FUN_1403435d0(param_1 + 0x30);
          }
          puVar24 = (undefined8 *)
                    (((longlong)&local_b8 - (longlong)ppiVar5 & 0xfffffffffffffff0U) +
                    *(longlong *)(param_1 + 0x30));
          puVar6 = *(undefined8 **)(param_1 + 0x38);
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = *puVar24;
            lVar15 = puVar24[1];
            puVar6[1] = lVar15;
            if (lVar15 != 0) {
              LOCK();
              *(int *)(lVar15 + 8) = *(int *)(lVar15 + 8) + 1;
              UNLOCK();
LAB_14033adb3:
              local_a8 = local_98;
            }
          }
        }
        else {
          if (ppiVar4 == *(int ***)(param_1 + 0x40)) {
            FUN_1403435d0(param_1 + 0x30);
          }
          puVar6 = *(undefined8 **)(param_1 + 0x38);
          if (puVar6 != (undefined8 *)0x0) {
            *puVar6 = local_b8;
            puVar6[1] = local_b0;
            if (local_b0 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_b0 + 1) = (int)local_b0[1] + 1;
              UNLOCK();
              goto LAB_14033adb3;
            }
          }
        }
        plVar19 = local_b0;
        *(longlong *)(param_1 + 0x38) = *(longlong *)(param_1 + 0x38) + 0x10;
        piVar14 = local_a8;
        if (local_b0 != (longlong *)0x0) {
          LOCK();
          plVar1 = local_b0 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          piVar14 = local_98;
          if ((int)*plVar1 == 0) {
            (**(code **)(*local_b0 + 8))(local_b0);
            LOCK();
            piVar13 = (int *)((longlong)plVar19 + 0xc);
            *piVar13 = *piVar13 + -1;
            UNLOCK();
            piVar14 = local_98;
            if (*piVar13 == 0) {
              (**(code **)(*plVar19 + 0x10))(plVar19);
              piVar14 = local_98;
            }
          }
        }
      }
      local_a8 = *(int **)(piVar14 + 6);
      if (local_a8 == (int *)0x0) {
        uVar8 = (uint)piVar14[8] % *(uint *)(lVar12 + 0x78) + 1;
        lVar15 = (longlong)(int)uVar8 << 3;
        local_a8 = piVar21;
        do {
          if (*(uint *)(lVar12 + 0x78) <= uVar8) break;
          if (*(longlong *)(*(longlong *)(lVar12 + 0x68) + lVar15) != 0) {
            local_a8 = *(int **)(*(longlong *)(lVar12 + 0x68) + lVar15);
          }
          uVar8 = uVar8 + 1;
          lVar15 = lVar15 + 8;
        } while (local_a8 == (int *)0x0);
      }
      goto LAB_14033a834;
    }
    uVar17 = 1;
  }
  return uVar17;
}



undefined8 FUN_14033ae70(float param_1,float param_2,float param_3,longlong param_4)

{
  longlong lVar1;
  int iVar2;
  
  lVar1 = *(longlong *)(param_4 + 0x18);
  if (*(int *)(lVar1 + 0x10) == 2) {
    param_1 = param_1 + *(float *)(param_4 + 0x10);
    *(float *)(param_4 + 0x10) = param_1;
    if (param_1 <= param_3 * *(float *)(lVar1 + 4)) {
      return 2;
    }
    *(undefined4 *)(param_4 + 0x10) = 0;
  }
  else {
    if (*(int *)(lVar1 + 0x10) != 1) {
      return 2;
    }
    if (param_3 * *(float *)(lVar1 + 4) <= param_2) {
      return 2;
    }
  }
  iVar2 = rand();
  if (**(float **)(param_4 + 0x18) <= (float)iVar2 * 3.0517578e-05) {
    return 1;
  }
  return 0;
}



undefined8 FUN_14033af00(longlong param_1,int param_2)

{
  int *piVar1;
  uint uVar2;
  undefined8 uVar3;
  int iVar4;
  
  uVar3 = 1;
  uVar2 = 0;
  iVar4 = DAT_1406081e8;
  do {
    if (uVar2 < 3) {
      piVar1 = (int *)(*(longlong *)(param_1 + 0x18) + 0x18 + (longlong)(int)uVar2 * 4);
    }
    else {
      if (iVar4 == 0) {
        FUN_140176d60(0);
        iVar4 = DAT_1406081e8;
      }
      DAT_1406081e8 = iVar4 + 1;
      piVar1 = &DAT_1406081ec;
      iVar4 = DAT_1406081e8;
    }
    if (*piVar1 != 0) {
      uVar3 = 0;
      if (uVar2 < 3) {
        piVar1 = (int *)(*(longlong *)(param_1 + 0x18) + 0x18 + (longlong)(int)uVar2 * 4);
      }
      else {
        if (iVar4 == 0) {
          FUN_140176d60(0);
          iVar4 = DAT_1406081e8;
        }
        DAT_1406081e8 = iVar4 + 1;
        piVar1 = &DAT_1406081ec;
        iVar4 = DAT_1406081e8;
      }
      if (*piVar1 == param_2) {
        return 1;
      }
    }
    uVar2 = uVar2 + 1;
    if (2 < (int)uVar2) {
      return uVar3;
    }
  } while( true );
}



undefined8 * FUN_14033afd0(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;
}



void FUN_14033b040(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (*(void **)((longlong)pvVar1 + 0x28) != (void *)0x0) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x28));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x28) = 0;
    *(undefined8 *)((longlong)pvVar1 + 0x30) = 0;
    *(undefined8 *)((longlong)pvVar1 + 0x38) = 0;
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14033b080(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (*(void **)((longlong)param_1 + 0x28) != (void *)0x0) {
      operator_delete(*(void **)((longlong)param_1 + 0x28));
    }
    *(undefined8 *)((longlong)param_1 + 0x28) = 0;
    *(undefined8 *)((longlong)param_1 + 0x30) = 0;
    *(undefined8 *)((longlong)param_1 + 0x38) = 0;
    operator_delete(param_1);
  }
  return;
}



ulonglong FUN_14033b0c0(longlong param_1,longlong param_2)

{
  short sVar1;
  short sVar2;
  short *psVar3;
  short *psVar4;
  longlong lVar5;
  
  psVar3 = *(short **)(param_1 + 0xd8);
  if (*(short **)(param_1 + 0xd0) == psVar3) {
LAB_14033b0d3:
    return CONCAT71((int7)((ulonglong)psVar3 >> 8),1);
  }
  psVar3 = *(short **)(param_1 + 0xd0);
  do {
    if (psVar3 == *(short **)(param_1 + 0xd8)) {
      return (ulonglong)psVar3 & 0xffffffffffffff00;
    }
    psVar4 = psVar3;
    if (7 < *(ulonglong *)(psVar3 + 0xc)) {
      psVar4 = *(short **)psVar3;
    }
    lVar5 = param_2 - (longlong)psVar4;
    do {
      sVar1 = *psVar4;
      sVar2 = *(short *)((longlong)psVar4 + lVar5);
      if (sVar1 != sVar2) break;
      psVar4 = psVar4 + 1;
    } while (sVar2 != 0);
    if (sVar1 == sVar2) goto LAB_14033b0d3;
    psVar3 = psVar3 + 0x14;
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14033b140(undefined8 param_1)

{
  longlong *plVar1;
  short sVar2;
  int *piVar3;
  int *piVar4;
  code *pcVar5;
  int iVar6;
  undefined4 *puVar7;
  undefined8 *puVar8;
  uint uVar9;
  undefined4 uVar10;
  int iVar11;
  longlong lVar12;
  void *pvVar13;
  undefined4 *puVar14;
  short *psVar15;
  wchar_t *pwVar16;
  undefined8 uVar17;
  longlong *plVar18;
  ulonglong uVar19;
  undefined4 *puVar20;
  longlong lVar21;
  undefined4 *puVar22;
  undefined2 *puVar23;
  undefined4 *puVar24;
  undefined4 *puVar25;
  wchar_t *pwVar26;
  wchar_t *pwVar27;
  short *psVar28;
  undefined8 *puVar29;
  undefined4 uVar30;
  undefined4 *puVar31;
  bool bVar32;
  undefined1 auStack_2a8 [32];
  undefined1 local_288;
  undefined4 *local_278;
  longlong *local_270;
  undefined4 local_268;
  int local_264;
  int local_260;
  int local_25c;
  int local_258;
  int local_254;
  int local_250 [2];
  undefined4 *local_248;
  undefined8 *local_240;
  undefined8 *local_238;
  undefined8 local_230;
  void *local_220;
  longlong local_218;
  undefined8 local_210;
  undefined8 *local_200;
  undefined8 *local_1f8;
  undefined8 local_1f0;
  void *local_1e0;
  longlong local_1d8;
  undefined8 local_1d0;
  undefined8 *local_1c0;
  undefined8 *local_1b8;
  undefined8 local_1b0;
  undefined8 *local_1a0;
  undefined8 *local_198;
  undefined8 local_190;
  undefined4 *local_180;
  undefined8 local_170;
  undefined8 local_168;
  undefined1 local_160 [16];
  longlong *local_150;
  undefined2 local_148;
  undefined6 uStack_146;
  undefined8 local_138;
  ulonglong local_130;
  undefined2 local_120;
  undefined6 uStack_11e;
  undefined8 local_110;
  ulonglong local_108;
  undefined2 local_f8;
  undefined6 uStack_f6;
  undefined8 local_e8;
  ulonglong local_e0;
  undefined2 local_d0;
  undefined6 uStack_ce;
  undefined8 local_c0;
  ulonglong local_b8;
  undefined2 local_a8;
  undefined6 uStack_a6;
  undefined8 local_98;
  ulonglong local_90;
  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_30;
  
  local_168 = 0xfffffffffffffffe;
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_2a8;
  local_170 = param_1;
  lVar12 = FUN_1402933b0(DAT_140607ff0,L"CHAMPION_ENEMY");
  uVar17 = 0;
  if (lVar12 != 0) {
    puVar25 = (undefined4 *)0x0;
    local_248 = puVar25;
    if ((*(longlong *)(lVar12 + 0x70) != 0) && (*(uint *)(lVar12 + 0x78) != 0)) {
      puVar14 = puVar25;
      plVar18 = *(longlong **)(lVar12 + 0x68);
      do {
        if (*plVar18 != 0) {
          local_248 = (undefined4 *)(*(longlong **)(lVar12 + 0x68))[(longlong)puVar14];
          break;
        }
        uVar9 = (int)puVar14 + 1;
        puVar14 = (undefined4 *)(ulonglong)uVar9;
        plVar18 = plVar18 + 1;
      } while (uVar9 < *(uint *)(lVar12 + 0x78));
    }
LAB_14033b1da:
    if (local_248 != (undefined4 *)0x0) {
      uVar30 = *local_248;
      local_268 = uVar30;
      local_180 = local_248;
      pvVar13 = operator_new(0x248);
      puVar14 = puVar25;
      if (pvVar13 != (void *)0x0) {
        puVar14 = (undefined4 *)FUN_14033d5a0(pvVar13);
      }
      local_278 = puVar14;
      FUN_14033d320(&local_270,puVar14);
      FUN_140178e90(&local_278,puVar14,puVar14);
      uVar10 = FUN_1402970c0(lVar12,&DAT_14049f290);
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,&DAT_14049f290);
      *local_278 = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nMinLv");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nMinLv");
      local_278[1] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nMaxLv");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nMaxLv");
      local_278[2] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"wszChampionName");
      local_288 = 1;
      psVar15 = (short *)FUN_140296b70(lVar12,uVar30,uVar10,L"wszChampionName");
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_278 + 0x74,psVar15,~uVar19 - 1);
      uVar10 = FUN_1402970c0(lVar12,L"szTrueNameTextID");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szTrueNameTextID");
      local_40 = 7;
      local_48 = 0;
      local_58 = 0;
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_58,psVar15,~uVar19 - 1);
      local_1e0 = (void *)0x0;
      local_1d8 = 0;
      local_1d0 = 0;
      puVar23 = &local_58;
      if (7 < local_40) {
        puVar23 = (undefined2 *)CONCAT62(uStack_56,local_58);
      }
      FUN_140415930(&local_1e0,puVar23,&DAT_14049c7b8);
      FUN_140051e60(local_278 + 4,(local_1d8 - (longlong)local_1e0) / 0x28);
      iVar6 = (int)(local_1d8 - (longlong)local_1e0 >> 0x3f);
      iVar11 = (int)((local_1d8 - (longlong)local_1e0) / 0x28) + iVar6;
      puVar14 = puVar25;
      puVar31 = puVar25;
      if (iVar11 != iVar6 && -1 < iVar11 - iVar6) {
        do {
          pwVar16 = (wchar_t *)((longlong)puVar14 + (longlong)local_1e0);
          if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
            pwVar16 = *(wchar_t **)pwVar16;
          }
          iVar11 = _wtoi(pwVar16);
          puVar7 = local_278;
          piVar3 = *(int **)(local_278 + 6);
          local_25c = iVar11;
          if ((&local_25c < piVar3) && (piVar4 = *(int **)(local_278 + 4), piVar4 <= &local_25c)) {
            if (piVar3 == *(int **)(local_278 + 8)) {
              uVar19 = (longlong)piVar3 - (longlong)piVar4 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                uVar17 = (*pcVar5)();
                return uVar17;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)((longlong)*(int **)(local_278 + 8) - (longlong)piVar4 >> 2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 4,puVar24);
              }
            }
            if (*(undefined4 **)(puVar7 + 6) != (undefined4 *)0x0) {
              **(undefined4 **)(puVar7 + 6) =
                   *(undefined4 *)
                    (*(longlong *)(puVar7 + 4) + ((longlong)&local_25c - (longlong)piVar4 >> 2) * 4)
              ;
            }
          }
          else {
            if (piVar3 == *(int **)(local_278 + 8)) {
              uVar19 = (longlong)piVar3 - *(longlong *)(local_278 + 4) >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14033d253;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 8) - *(longlong *)(local_278 + 4) >> 2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 4,puVar24);
              }
            }
            if (*(int **)(puVar7 + 6) != (int *)0x0) {
              **(int **)(puVar7 + 6) = iVar11;
            }
          }
          *(longlong *)(puVar7 + 6) = *(longlong *)(puVar7 + 6) + 4;
          uVar9 = (int)puVar31 + 1;
          puVar14 = puVar14 + 10;
          puVar31 = (undefined4 *)(ulonglong)uVar9;
          uVar30 = local_268;
        } while ((int)uVar9 < (int)((local_1d8 - (longlong)local_1e0) / 0x28));
      }
      uVar10 = FUN_1402970c0(lVar12,L"szFalseNameTextID");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szFalseNameTextID");
      local_90 = 7;
      local_98 = 0;
      local_a8 = 0;
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_a8,psVar15,~uVar19 - 1);
      local_220 = (void *)0x0;
      local_218 = 0;
      local_210 = 0;
      puVar23 = &local_a8;
      if (7 < local_90) {
        puVar23 = (undefined2 *)CONCAT62(uStack_a6,local_a8);
      }
      FUN_140415930(&local_220,puVar23,&DAT_14049c7b8);
      FUN_140051e60(local_278 + 0xc,(local_218 - (longlong)local_220) / 0x28);
      iVar6 = (int)(local_218 - (longlong)local_220 >> 0x3f);
      iVar11 = (int)((local_218 - (longlong)local_220) / 0x28) + iVar6;
      puVar14 = puVar25;
      puVar31 = puVar25;
      if (iVar11 != iVar6 && -1 < iVar11 - iVar6) {
        do {
          pwVar16 = (wchar_t *)((longlong)local_220 + (longlong)puVar14);
          if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
            pwVar16 = *(wchar_t **)pwVar16;
          }
          iVar11 = _wtoi(pwVar16);
          puVar7 = local_278;
          piVar3 = *(int **)(local_278 + 0xe);
          local_250[0] = iVar11;
          if ((local_250 < piVar3) && (piVar4 = *(int **)(local_278 + 0xc), piVar4 <= local_250)) {
            if (piVar3 == *(int **)(local_278 + 0x10)) {
              uVar19 = (longlong)piVar3 - (longlong)piVar4 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
LAB_14033d253:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                uVar17 = (*pcVar5)();
                return uVar17;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x10) - (longlong)piVar4 >> 2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0xc,puVar24);
              }
            }
            if (*(undefined4 **)(puVar7 + 0xe) != (undefined4 *)0x0) {
              **(undefined4 **)(puVar7 + 0xe) =
                   *(undefined4 *)
                    (*(longlong *)(puVar7 + 0xc) + ((longlong)local_250 - (longlong)piVar4 >> 2) * 4
                    );
            }
          }
          else {
            if (piVar3 == *(int **)(local_278 + 0x10)) {
              uVar19 = (longlong)piVar3 - *(longlong *)(local_278 + 0xc) >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14033d26f;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x10) - *(longlong *)(local_278 + 0xc) >> 2
                        );
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0xc,puVar24);
              }
            }
            if (*(int **)(puVar7 + 0xe) != (int *)0x0) {
              **(int **)(puVar7 + 0xe) = iVar11;
            }
          }
          *(longlong *)(puVar7 + 0xe) = *(longlong *)(puVar7 + 0xe) + 4;
          uVar9 = (int)puVar31 + 1;
          puVar14 = puVar14 + 10;
          puVar31 = (undefined4 *)(ulonglong)uVar9;
          uVar30 = local_268;
        } while ((int)uVar9 < (int)((local_218 - (longlong)local_220) / 0x28));
      }
      uVar10 = FUN_1402970c0(lVar12,L"szTrueEnemyName");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szTrueEnemyName");
      local_e0 = 7;
      local_e8 = 0;
      local_f8 = 0;
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_f8,psVar15,~uVar19 - 1);
      puVar23 = &local_f8;
      if (7 < local_e0) {
        puVar23 = (undefined2 *)CONCAT62(uStack_f6,local_f8);
      }
      FUN_140415930(local_278 + 0x34,puVar23,&DAT_14049c7b8);
      uVar10 = FUN_1402970c0(lVar12,L"szTrueZone");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szTrueZone");
      local_130 = 7;
      local_138 = 0;
      local_148 = 0;
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_148,psVar15,~uVar19 - 1);
      local_1a0 = (undefined8 *)0x0;
      local_198 = (undefined8 *)0x0;
      local_190 = 0;
      puVar23 = &local_148;
      if (7 < local_130) {
        puVar23 = (undefined2 *)CONCAT62(uStack_146,local_148);
      }
      FUN_140415930(&local_1a0,puVar23,&DAT_14049c7b8);
      FUN_140051e60(local_278 + 0x14,((longlong)local_198 - (longlong)local_1a0) / 0x28);
      iVar6 = (int)((longlong)local_198 - (longlong)local_1a0 >> 0x3f);
      iVar11 = (int)(((longlong)local_198 - (longlong)local_1a0) / 0x28) + iVar6;
      puVar14 = puVar25;
      puVar31 = puVar25;
      if (iVar11 != iVar6 && -1 < iVar11 - iVar6) {
        do {
          pwVar16 = (wchar_t *)((longlong)local_1a0 + (longlong)puVar14);
          if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
            pwVar16 = *(wchar_t **)pwVar16;
          }
          iVar11 = _wtoi(pwVar16);
          puVar7 = local_278;
          piVar3 = *(int **)(local_278 + 0x16);
          local_264 = iVar11;
          if ((&local_264 < piVar3) && (piVar4 = *(int **)(local_278 + 0x14), piVar4 <= &local_264))
          {
            if (piVar3 == *(int **)(local_278 + 0x18)) {
              uVar19 = (longlong)piVar3 - (longlong)piVar4 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
LAB_14033d26f:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                uVar17 = (*pcVar5)();
                return uVar17;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x18) - (longlong)piVar4 >> 2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0x14,puVar24);
              }
            }
            if (*(undefined4 **)(puVar7 + 0x16) != (undefined4 *)0x0) {
              **(undefined4 **)(puVar7 + 0x16) =
                   *(undefined4 *)
                    (*(longlong *)(puVar7 + 0x14) +
                    ((longlong)&local_264 - (longlong)piVar4 >> 2) * 4);
            }
          }
          else {
            if (piVar3 == *(int **)(local_278 + 0x18)) {
              uVar19 = (longlong)piVar3 - *(longlong *)(local_278 + 0x14) >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14033d28b;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x18) - *(longlong *)(local_278 + 0x14) >>
                        2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0x14,puVar24);
              }
            }
            if (*(int **)(puVar7 + 0x16) != (int *)0x0) {
              **(int **)(puVar7 + 0x16) = iVar11;
            }
          }
          *(longlong *)(puVar7 + 0x16) = *(longlong *)(puVar7 + 0x16) + 4;
          uVar9 = (int)puVar31 + 1;
          puVar14 = puVar14 + 10;
          puVar31 = (undefined4 *)(ulonglong)uVar9;
          uVar30 = local_268;
        } while ((int)uVar9 < (int)(((longlong)local_198 - (longlong)local_1a0) / 0x28));
      }
      uVar10 = FUN_1402970c0(lVar12,L"szFalseZone");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szFalseZone");
      local_b8 = 7;
      local_c0 = 0;
      local_d0 = 0;
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_d0,psVar15,~uVar19 - 1);
      local_1c0 = (undefined8 *)0x0;
      local_1b8 = (undefined8 *)0x0;
      local_1b0 = 0;
      puVar23 = &local_d0;
      if (7 < local_b8) {
        puVar23 = (undefined2 *)CONCAT62(uStack_ce,local_d0);
      }
      FUN_140415930(&local_1c0,puVar23,&DAT_14049c7b8);
      FUN_140051e60(local_278 + 0x1c,((longlong)local_1b8 - (longlong)local_1c0) / 0x28);
      iVar6 = (int)((longlong)local_1b8 - (longlong)local_1c0 >> 0x3f);
      iVar11 = (int)(((longlong)local_1b8 - (longlong)local_1c0) / 0x28) + iVar6;
      puVar14 = puVar25;
      puVar31 = puVar25;
      if (iVar11 != iVar6 && -1 < iVar11 - iVar6) {
        do {
          pwVar16 = (wchar_t *)((longlong)puVar14 + (longlong)local_1c0);
          if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
            pwVar16 = *(wchar_t **)pwVar16;
          }
          iVar11 = _wtoi(pwVar16);
          puVar7 = local_278;
          piVar3 = *(int **)(local_278 + 0x1e);
          local_254 = iVar11;
          if ((&local_254 < piVar3) && (piVar4 = *(int **)(local_278 + 0x1c), piVar4 <= &local_254))
          {
            if (piVar3 == *(int **)(local_278 + 0x20)) {
              uVar19 = (longlong)piVar3 - (longlong)piVar4 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
LAB_14033d28b:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                uVar17 = (*pcVar5)();
                return uVar17;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x20) - (longlong)piVar4 >> 2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0x1c,puVar24);
              }
            }
            if (*(undefined4 **)(puVar7 + 0x1e) != (undefined4 *)0x0) {
              **(undefined4 **)(puVar7 + 0x1e) =
                   *(undefined4 *)
                    (*(longlong *)(puVar7 + 0x1c) +
                    ((longlong)local_250 + (-4 - (longlong)piVar4) >> 2) * 4);
            }
          }
          else {
            if (piVar3 == *(int **)(local_278 + 0x20)) {
              uVar19 = (longlong)piVar3 - *(longlong *)(local_278 + 0x1c) >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14033d2a7;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x20) - *(longlong *)(local_278 + 0x1c) >>
                        2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0x1c,puVar24);
              }
            }
            if (*(int **)(puVar7 + 0x1e) != (int *)0x0) {
              **(int **)(puVar7 + 0x1e) = iVar11;
            }
          }
          *(longlong *)(puVar7 + 0x1e) = *(longlong *)(puVar7 + 0x1e) + 4;
          uVar9 = (int)puVar31 + 1;
          puVar14 = puVar14 + 10;
          puVar31 = (undefined4 *)(ulonglong)uVar9;
          uVar30 = local_268;
        } while ((int)uVar9 < (int)(((longlong)local_1b8 - (longlong)local_1c0) / 0x28));
      }
      uVar10 = FUN_1402970c0(lVar12,L"szTrueGroup");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szTrueGroup");
      local_68 = 7;
      local_70 = 0;
      local_80 = 0;
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_80,psVar15,~uVar19 - 1);
      local_200 = (undefined8 *)0x0;
      local_1f8 = (undefined8 *)0x0;
      local_1f0 = 0;
      puVar23 = &local_80;
      if (7 < local_68) {
        puVar23 = (undefined2 *)CONCAT62(uStack_7e,local_80);
      }
      FUN_140415930(&local_200,puVar23,&DAT_14049c7b8);
      FUN_140051e60(local_278 + 0x24,((longlong)local_1f8 - (longlong)local_200) / 0x28);
      iVar6 = (int)((longlong)local_1f8 - (longlong)local_200 >> 0x3f);
      iVar11 = (int)(((longlong)local_1f8 - (longlong)local_200) / 0x28) + iVar6;
      puVar14 = puVar25;
      puVar31 = puVar25;
      if (iVar11 != iVar6 && -1 < iVar11 - iVar6) {
        do {
          pwVar16 = (wchar_t *)((longlong)puVar14 + (longlong)local_200);
          if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
            pwVar16 = *(wchar_t **)pwVar16;
          }
          iVar11 = _wtoi(pwVar16);
          puVar7 = local_278;
          piVar3 = *(int **)(local_278 + 0x26);
          local_260 = iVar11;
          if ((&local_260 < piVar3) && (piVar4 = *(int **)(local_278 + 0x24), piVar4 <= &local_260))
          {
            if (piVar3 == *(int **)(local_278 + 0x28)) {
              uVar19 = (longlong)piVar3 - (longlong)piVar4 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
LAB_14033d2a7:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                uVar17 = (*pcVar5)();
                return uVar17;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x28) - (longlong)piVar4 >> 2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0x24,puVar24);
              }
            }
            if (*(undefined4 **)(puVar7 + 0x26) != (undefined4 *)0x0) {
              **(undefined4 **)(puVar7 + 0x26) =
                   *(undefined4 *)
                    (*(longlong *)(puVar7 + 0x24) +
                    ((longlong)&local_260 - (longlong)piVar4 >> 2) * 4);
            }
          }
          else {
            if (piVar3 == *(int **)(local_278 + 0x28)) {
              uVar19 = (longlong)piVar3 - *(longlong *)(local_278 + 0x24) >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14033d2c3;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x28) - *(longlong *)(local_278 + 0x24) >>
                        2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0x24,puVar24);
              }
            }
            if (*(int **)(puVar7 + 0x26) != (int *)0x0) {
              **(int **)(puVar7 + 0x26) = iVar11;
            }
          }
          *(longlong *)(puVar7 + 0x26) = *(longlong *)(puVar7 + 0x26) + 4;
          uVar9 = (int)puVar31 + 1;
          puVar14 = puVar14 + 10;
          puVar31 = (undefined4 *)(ulonglong)uVar9;
          uVar30 = local_268;
        } while ((int)uVar9 < (int)(((longlong)local_1f8 - (longlong)local_200) / 0x28));
      }
      uVar10 = FUN_1402970c0(lVar12,L"szFalseGroup");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szFalseGroup");
      local_108 = 7;
      local_110 = 0;
      local_120 = 0;
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_120,psVar15,~uVar19 - 1);
      local_240 = (undefined8 *)0x0;
      local_238 = (undefined8 *)0x0;
      local_230 = 0;
      puVar23 = &local_120;
      if (7 < local_108) {
        puVar23 = (undefined2 *)CONCAT62(uStack_11e,local_120);
      }
      FUN_140415930(&local_240,puVar23,&DAT_14049c7b8);
      FUN_140051e60(local_278 + 0x2c,((longlong)local_238 - (longlong)local_240) / 0x28);
      iVar6 = (int)((longlong)local_238 - (longlong)local_240 >> 0x3f);
      iVar11 = (int)(((longlong)local_238 - (longlong)local_240) / 0x28) + iVar6;
      puVar14 = puVar25;
      puVar31 = puVar25;
      if (iVar11 != iVar6 && -1 < iVar11 - iVar6) {
        do {
          pwVar16 = (wchar_t *)((longlong)puVar14 + (longlong)local_240);
          if (7 < *(ulonglong *)(pwVar16 + 0xc)) {
            pwVar16 = *(wchar_t **)pwVar16;
          }
          iVar11 = _wtoi(pwVar16);
          puVar7 = local_278;
          piVar3 = *(int **)(local_278 + 0x2e);
          local_258 = iVar11;
          if ((&local_258 < piVar3) && (piVar4 = *(int **)(local_278 + 0x2c), piVar4 <= &local_258))
          {
            if (piVar3 == *(int **)(local_278 + 0x30)) {
              uVar19 = (longlong)piVar3 - (longlong)piVar4 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
LAB_14033d2c3:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                uVar17 = (*pcVar5)();
                return uVar17;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x30) - (longlong)piVar4 >> 2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0x2c,puVar24);
              }
            }
            if (*(undefined4 **)(puVar7 + 0x2e) != (undefined4 *)0x0) {
              **(undefined4 **)(puVar7 + 0x2e) =
                   *(undefined4 *)
                    (*(longlong *)(puVar7 + 0x2c) +
                    ((longlong)&local_258 - (longlong)piVar4 >> 2) * 4);
            }
          }
          else {
            if (piVar3 == *(int **)(local_278 + 0x30)) {
              uVar19 = (longlong)piVar3 - *(longlong *)(local_278 + 0x2c) >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14033d2df;
              }
              puVar20 = (undefined4 *)(uVar19 + 1);
              puVar22 = (undefined4 *)
                        ((longlong)*(int **)(local_278 + 0x30) - *(longlong *)(local_278 + 0x2c) >>
                        2);
              if (puVar22 < puVar20) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar20) {
                  puVar24 = puVar20;
                }
                FUN_140051e60(local_278 + 0x2c,puVar24);
              }
            }
            if (*(int **)(puVar7 + 0x2e) != (int *)0x0) {
              **(int **)(puVar7 + 0x2e) = iVar11;
            }
          }
          *(longlong *)(puVar7 + 0x2e) = *(longlong *)(puVar7 + 0x2e) + 4;
          uVar9 = (int)puVar31 + 1;
          puVar14 = puVar14 + 10;
          puVar31 = (undefined4 *)(ulonglong)uVar9;
          uVar30 = local_268;
        } while ((int)uVar9 < (int)(((longlong)local_238 - (longlong)local_240) / 0x28));
      }
      uVar10 = FUN_1402970c0(lVar12,L"fEnemyExp");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fEnemyExp");
      local_278[0x3c] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,&DAT_14049f888);
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,&DAT_14049f888);
      local_278[0x3d] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fPhysicalAttack");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fPhysicalAttack");
      local_278[0x3e] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fMagicAttack");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fMagicAttack");
      local_278[0x3f] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fDefense");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fDefense");
      local_278[0x40] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fMagicDefense");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fMagicDefense");
      local_278[0x41] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fCritical");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fCritical");
      local_278[0x42] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fMoveSpeed");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fMoveSpeed");
      local_278[0x43] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fAttackSpeed");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fAttackSpeed");
      local_278[0x44] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fResistanceCritical");
      local_288 = 0;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fResistanceCritical");
      if (puVar14 != (undefined4 *)0x0) {
        local_278[0x45] = *puVar14;
      }
      uVar10 = FUN_1402970c0(lVar12,L"nResistanceFire");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nResistanceFire");
      local_278[0x46] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nResistanceWater");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nResistanceWater");
      local_278[0x47] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nResistanceLight");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nResistanceLight");
      local_278[0x48] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nResistanceDark");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nResistanceDark");
      local_278[0x49] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nResistanceEarth");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nResistanceEarth");
      local_278[0x4a] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nResistanceWindy");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nResistanceWindy");
      local_278[0x4b] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nResistanceToxication");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nResistanceToxication");
      local_278[0x4c] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nResistanceLightning");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nResistanceLightning");
      local_278[0x4d] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nAttackFire");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nAttackFire");
      local_278[0x4e] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nAttackWater");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nAttackWater");
      local_278[0x4f] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nAttackLight");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nAttackLight");
      local_278[0x50] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nAttackDark");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nAttackDark");
      local_278[0x51] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nAttackEarth");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nAttackEarth");
      local_278[0x52] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nAttackToxication");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nAttackToxication");
      local_278[0x54] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nAttackLightning");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nAttackLightning");
      local_278[0x55] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nCaught");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nCaught");
      local_278[0x61] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fGold");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fGold");
      local_278[0x56] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fWeight");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fWeight");
      local_278[0x57] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fRisingDamageWeight");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fRisingDamageWeight");
      local_278[0x58] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fAttackReduce");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fAttackReduce");
      local_278[0x59] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nItemDropGroup");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nItemDropGroup");
      local_278[0x5a] = *puVar14;
      local_278[0x5b] = 0;
      local_278[0x5c] = 0;
      uVar10 = FUN_1402970c0(lVar12,L"nFatigueItemDropGroup");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nFatigueItemDropGroup");
      local_278[0x5d] = *puVar14;
      local_278[0x5e] = 0;
      local_278[0x5f] = 0;
      uVar10 = FUN_1402970c0(lVar12,L"nComboType");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nComboType");
      local_278[0x60] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nEffectID");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nEffectID");
      local_278[0x62] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fRisingDamageFail");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fRisingDamageFail");
      local_278[99] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fRisingDamageFailDelay");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fRisingDamageFailDelay");
      local_278[100] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fSkillProbability");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar30,uVar10,L"fSkillProbability");
      local_278[0x65] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"szCondition");
      local_288 = 1;
      pwVar16 = (wchar_t *)FUN_140296990(lVar12,uVar30,uVar10,L"szCondition");
      bVar32 = pwVar16 == (wchar_t *)0x0;
      if (!bVar32) {
        lVar21 = 9;
        pwVar26 = pwVar16;
        pwVar27 = L"BLOODING";
        do {
          if (lVar21 == 0) break;
          lVar21 = lVar21 + -1;
          bVar32 = *pwVar26 == *pwVar27;
          pwVar26 = pwVar26 + 1;
          pwVar27 = pwVar27 + 1;
        } while (bVar32);
        if (bVar32) {
          local_278[0x66] = 1;
        }
        else {
          lVar21 = 6;
          pwVar26 = pwVar16;
          pwVar27 = L"CHAOS";
          do {
            if (lVar21 == 0) break;
            lVar21 = lVar21 + -1;
            bVar32 = *pwVar26 == *pwVar27;
            pwVar26 = pwVar26 + 1;
            pwVar27 = pwVar27 + 1;
          } while (bVar32);
          if (bVar32) {
            local_278[0x66] = 0xb;
          }
          else {
            lVar21 = 5;
            pwVar26 = pwVar16;
            pwVar27 = L"COLD";
            do {
              if (lVar21 == 0) break;
              lVar21 = lVar21 + -1;
              bVar32 = *pwVar26 == *pwVar27;
              pwVar26 = pwVar26 + 1;
              pwVar27 = pwVar27 + 1;
            } while (bVar32);
            if (bVar32) {
              local_278[0x66] = 2;
            }
            else {
              lVar21 = 5;
              pwVar26 = pwVar16;
              pwVar27 = L"FIRE";
              do {
                if (lVar21 == 0) break;
                lVar21 = lVar21 + -1;
                bVar32 = *pwVar26 == *pwVar27;
                pwVar26 = pwVar26 + 1;
                pwVar27 = pwVar27 + 1;
              } while (bVar32);
              if (bVar32) {
                local_278[0x66] = 3;
              }
              else {
                lVar21 = 9;
                pwVar26 = pwVar16;
                pwVar27 = L"FREEZING";
                do {
                  if (lVar21 == 0) break;
                  lVar21 = lVar21 + -1;
                  bVar32 = *pwVar26 == *pwVar27;
                  pwVar26 = pwVar26 + 1;
                  pwVar27 = pwVar27 + 1;
                } while (bVar32);
                if (bVar32) {
                  local_278[0x66] = 6;
                }
                else {
                  lVar21 = 5;
                  pwVar26 = pwVar16;
                  pwVar27 = L"HOLD";
                  do {
                    if (lVar21 == 0) break;
                    lVar21 = lVar21 + -1;
                    bVar32 = *pwVar26 == *pwVar27;
                    pwVar26 = pwVar26 + 1;
                    pwVar27 = pwVar27 + 1;
                  } while (bVar32);
                  if (bVar32) {
                    local_278[0x66] = 0xe;
                  }
                  else {
                    lVar21 = 9;
                    pwVar26 = pwVar16;
                    pwVar27 = L"SICKNESS";
                    do {
                      if (lVar21 == 0) break;
                      lVar21 = lVar21 + -1;
                      bVar32 = *pwVar26 == *pwVar27;
                      pwVar26 = pwVar26 + 1;
                      pwVar27 = pwVar27 + 1;
                    } while (bVar32);
                    if (bVar32) {
                      local_278[0x66] = 9;
                    }
                    else {
                      lVar21 = 6;
                      pwVar26 = pwVar16;
                      pwVar27 = L"SLEEP";
                      do {
                        if (lVar21 == 0) break;
                        lVar21 = lVar21 + -1;
                        bVar32 = *pwVar26 == *pwVar27;
                        pwVar26 = pwVar26 + 1;
                        pwVar27 = pwVar27 + 1;
                      } while (bVar32);
                      if (bVar32) {
                        local_278[0x66] = 10;
                      }
                      else {
                        lVar21 = 5;
                        pwVar26 = pwVar16;
                        pwVar27 = L"SLOW";
                        do {
                          if (lVar21 == 0) break;
                          lVar21 = lVar21 + -1;
                          bVar32 = *pwVar26 == *pwVar27;
                          pwVar26 = pwVar26 + 1;
                          pwVar27 = pwVar27 + 1;
                        } while (bVar32);
                        if (bVar32) {
                          local_278[0x66] = 7;
                        }
                        else {
                          lVar21 = 6;
                          pwVar26 = pwVar16;
                          pwVar27 = L"STONE";
                          do {
                            if (lVar21 == 0) break;
                            lVar21 = lVar21 + -1;
                            bVar32 = *pwVar26 == *pwVar27;
                            pwVar26 = pwVar26 + 1;
                            pwVar27 = pwVar27 + 1;
                          } while (bVar32);
                          if (bVar32) {
                            local_278[0x66] = 5;
                          }
                          else {
                            lVar21 = 5;
                            pwVar26 = pwVar16;
                            pwVar27 = L"STUN";
                            do {
                              if (lVar21 == 0) break;
                              lVar21 = lVar21 + -1;
                              bVar32 = *pwVar26 == *pwVar27;
                              pwVar26 = pwVar26 + 1;
                              pwVar27 = pwVar27 + 1;
                            } while (bVar32);
                            if (bVar32) {
                              local_278[0x66] = 4;
                            }
                            else {
                              lVar21 = 0xb;
                              pwVar26 = pwVar16;
                              pwVar27 = L"TOXICATION";
                              do {
                                if (lVar21 == 0) break;
                                lVar21 = lVar21 + -1;
                                bVar32 = *pwVar26 == *pwVar27;
                                pwVar26 = pwVar26 + 1;
                                pwVar27 = pwVar27 + 1;
                              } while (bVar32);
                              if (bVar32) {
                                local_278[0x66] = 8;
                              }
                              else {
                                lVar21 = 9;
                                pwVar26 = pwVar16;
                                pwVar27 = L"DARKNESS";
                                do {
                                  if (lVar21 == 0) break;
                                  lVar21 = lVar21 + -1;
                                  bVar32 = *pwVar26 == *pwVar27;
                                  pwVar26 = pwVar26 + 1;
                                  pwVar27 = pwVar27 + 1;
                                } while (bVar32);
                                if (bVar32) {
                                  local_278[0x66] = 0xd;
                                }
                                else {
                                  lVar21 = 10;
                                  pwVar26 = L"LIGHTNING";
                                  do {
                                    if (lVar21 == 0) break;
                                    lVar21 = lVar21 + -1;
                                    bVar32 = *pwVar16 == *pwVar26;
                                    pwVar16 = pwVar16 + 1;
                                    pwVar26 = pwVar26 + 1;
                                  } while (bVar32);
                                  if (bVar32) {
                                    local_278[0x66] = 0xc;
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      uVar10 = FUN_1402970c0(lVar12,L"nConditionLevel");
      local_288 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nConditionLevel");
      local_278[0x67] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"szSkillTable");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szSkillTable");
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_278 + 0x7e,psVar15,~uVar19 - 1);
      uVar10 = FUN_1402970c0(lVar12,L"szSpecialTable");
      local_288 = 1;
      psVar15 = (short *)FUN_140296990(lVar12,uVar30,uVar10,L"szSpecialTable");
      uVar19 = 0xffffffffffffffff;
      psVar28 = psVar15;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar28;
        psVar28 = psVar28 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_278 + 0x88,psVar15,~uVar19 - 1);
      uVar10 = FUN_1402970c0(lVar12,L"nQuestItemDropGroup");
      local_288 = 0;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar30,uVar10,L"nQuestItemDropGroup");
      if (puVar14 != (undefined4 *)0x0) {
        local_278[0x69] = *puVar14;
      }
      puVar14 = (undefined4 *)FUN_140342d30(local_160,local_278,&local_278);
      FUN_14030e3c0(local_170,*puVar14,puVar14 + 2);
      plVar18 = local_150;
      puVar14 = local_248;
      if (local_150 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_150 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar14 = local_180;
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_150 + 8))(local_150);
          LOCK();
          piVar3 = (int *)((longlong)plVar18 + 0xc);
          *piVar3 = *piVar3 + -1;
          UNLOCK();
          puVar14 = local_180;
          if (*piVar3 == 0) {
            (**(code **)(*plVar18 + 0x10))(plVar18);
            puVar14 = local_180;
          }
        }
      }
      if (local_240 != (undefined8 *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_240);
        puVar8 = local_238;
        for (puVar29 = local_240; puVar29 != puVar8; puVar29 = puVar29 + 5) {
          if (7 < (ulonglong)puVar29[3]) {
            operator_delete((void *)*puVar29);
          }
          puVar29[3] = 7;
          puVar29[2] = 0;
          *(undefined2 *)puVar29 = 0;
        }
        operator_delete(local_240);
      }
      local_240 = (undefined8 *)0x0;
      local_238 = (undefined8 *)0x0;
      local_230 = 0;
      if (7 < local_108) {
        operator_delete((void *)CONCAT62(uStack_11e,local_120));
      }
      local_108 = 7;
      local_110 = 0;
      local_120 = 0;
      if (local_200 != (undefined8 *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_200);
        puVar8 = local_1f8;
        for (puVar29 = local_200; puVar29 != puVar8; puVar29 = puVar29 + 5) {
          if (7 < (ulonglong)puVar29[3]) {
            operator_delete((void *)*puVar29);
          }
          puVar29[3] = 7;
          puVar29[2] = 0;
          *(undefined2 *)puVar29 = 0;
        }
        operator_delete(local_200);
      }
      local_200 = (undefined8 *)0x0;
      local_1f8 = (undefined8 *)0x0;
      local_1f0 = 0;
      if (7 < local_68) {
        operator_delete((void *)CONCAT62(uStack_7e,local_80));
      }
      local_68 = 7;
      local_70 = 0;
      local_80 = 0;
      if (local_1c0 != (undefined8 *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_1c0);
        puVar8 = local_1b8;
        for (puVar29 = local_1c0; puVar29 != puVar8; puVar29 = puVar29 + 5) {
          if (7 < (ulonglong)puVar29[3]) {
            operator_delete((void *)*puVar29);
          }
          puVar29[3] = 7;
          puVar29[2] = 0;
          *(undefined2 *)puVar29 = 0;
        }
        operator_delete(local_1c0);
      }
      local_1c0 = (undefined8 *)0x0;
      local_1b8 = (undefined8 *)0x0;
      local_1b0 = 0;
      if (7 < local_b8) {
        operator_delete((void *)CONCAT62(uStack_ce,local_d0));
      }
      local_b8 = 7;
      local_c0 = 0;
      local_d0 = 0;
      if (local_1a0 != (undefined8 *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_1a0);
        puVar8 = local_198;
        for (puVar29 = local_1a0; puVar29 != puVar8; puVar29 = puVar29 + 5) {
          if (7 < (ulonglong)puVar29[3]) {
            operator_delete((void *)*puVar29);
          }
          puVar29[3] = 7;
          puVar29[2] = 0;
          *(undefined2 *)puVar29 = 0;
        }
        operator_delete(local_1a0);
      }
      local_1a0 = (undefined8 *)0x0;
      local_198 = (undefined8 *)0x0;
      local_190 = 0;
      if (7 < local_130) {
        operator_delete((void *)CONCAT62(uStack_146,local_148));
      }
      local_130 = 7;
      local_138 = 0;
      local_148 = 0;
      if (7 < local_e0) {
        operator_delete((void *)CONCAT62(uStack_f6,local_f8));
      }
      local_e0 = 7;
      local_e8 = 0;
      local_f8 = 0;
      if (local_220 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_220);
        FUN_14008d0a0(local_220);
        operator_delete(local_220);
      }
      local_220 = (void *)0x0;
      local_218 = 0;
      local_210 = 0;
      if (7 < local_90) {
        operator_delete((void *)CONCAT62(uStack_a6,local_a8));
      }
      local_90 = 7;
      local_98 = 0;
      local_a8 = 0;
      if (local_1e0 != (void *)0x0) {
        std::_Container_base0::_Orphan_all((_Container_base0 *)&local_1e0);
        FUN_14008d0a0(local_1e0);
        operator_delete(local_1e0);
      }
      local_1e0 = (void *)0x0;
      local_1d8 = 0;
      local_1d0 = 0;
      if (7 < local_40) {
        operator_delete((void *)CONCAT62(uStack_56,local_58));
      }
      plVar18 = local_270;
      local_40 = 7;
      local_48 = 0;
      local_58 = 0;
      if (local_270 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_270 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar14 = local_180;
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_270 + 8))(local_270);
          LOCK();
          piVar3 = (int *)((longlong)plVar18 + 0xc);
          *piVar3 = *piVar3 + -1;
          UNLOCK();
          puVar14 = local_180;
          if (*piVar3 == 0) {
            (**(code **)(*plVar18 + 0x10))(plVar18);
            puVar14 = local_180;
          }
        }
      }
      local_248 = *(undefined4 **)(puVar14 + 6);
      if (local_248 == (undefined4 *)0x0) {
        uVar9 = (uint)puVar14[8] % *(uint *)(lVar12 + 0x78) + 1;
        lVar21 = (longlong)(int)uVar9 << 3;
        local_248 = puVar25;
        do {
          if (*(uint *)(lVar12 + 0x78) <= uVar9) break;
          if (*(longlong *)(lVar21 + *(longlong *)(lVar12 + 0x68)) != 0) {
            local_248 = *(undefined4 **)(lVar21 + *(longlong *)(lVar12 + 0x68));
          }
          uVar9 = uVar9 + 1;
          lVar21 = lVar21 + 8;
        } while (local_248 == (undefined4 *)0x0);
      }
      goto LAB_14033b1da;
    }
LAB_14033d2df:
    uVar17 = 1;
  }
  return uVar17;
}



undefined8 * FUN_14033d320(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;
}



void FUN_14033d390(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14033d3c0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14033d3c0(longlong param_1)

{
  if (7 < *(ulonglong *)(param_1 + 0x238)) {
    operator_delete(*(void **)(param_1 + 0x220));
  }
  *(undefined8 *)(param_1 + 0x238) = 7;
  *(undefined8 *)(param_1 + 0x230) = 0;
  *(undefined2 *)(param_1 + 0x220) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x210)) {
    operator_delete(*(void **)(param_1 + 0x1f8));
  }
  *(undefined8 *)(param_1 + 0x210) = 7;
  *(undefined8 *)(param_1 + 0x208) = 0;
  *(undefined2 *)(param_1 + 0x1f8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1e8)) {
    operator_delete(*(void **)(param_1 + 0x1d0));
  }
  *(undefined8 *)(param_1 + 0x1e8) = 7;
  *(undefined8 *)(param_1 + 0x1e0) = 0;
  *(undefined2 *)(param_1 + 0x1d0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1c0)) {
    operator_delete(*(void **)(param_1 + 0x1a8));
  }
  *(undefined8 *)(param_1 + 0x1c0) = 7;
  *(undefined8 *)(param_1 + 0x1b8) = 0;
  *(undefined2 *)(param_1 + 0x1a8) = 0;
  if (*(longlong *)(param_1 + 0xd0) != 0) {
    FUN_14008d0a0(*(longlong *)(param_1 + 0xd0),*(undefined8 *)(param_1 + 0xd8));
    operator_delete(*(void **)(param_1 + 0xd0));
  }
  *(undefined8 *)(param_1 + 0xd0) = 0;
  *(undefined8 *)(param_1 + 0xd8) = 0;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  if (*(void **)(param_1 + 0xb0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xb0));
  }
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined8 *)(param_1 + 0xc0) = 0;
  if (*(void **)(param_1 + 0x90) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x90));
  }
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined8 *)(param_1 + 0x98) = 0;
  *(undefined8 *)(param_1 + 0xa0) = 0;
  if (*(void **)(param_1 + 0x70) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x70));
  }
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x78) = 0;
  *(undefined8 *)(param_1 + 0x80) = 0;
  if (*(void **)(param_1 + 0x50) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x50));
  }
  *(undefined8 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined8 *)(param_1 + 0x60) = 0;
  if (*(void **)(param_1 + 0x30) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  if (*(void **)(param_1 + 0x10) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined8 *)(param_1 + 0x20) = 0;
  return;
}



undefined8 * FUN_14033d5a0(undefined8 *param_1)

{
  *param_1 = 0;
  *(undefined4 *)(param_1 + 1) = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 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] = 0;
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  param_1[0x16] = 0;
  param_1[0x17] = 0;
  param_1[0x18] = 0;
  param_1[0x1a] = 0;
  param_1[0x1b] = 0;
  param_1[0x1c] = 0;
  param_1[0x1e] = 0;
  param_1[0x1f] = 0;
  param_1[0x20] = 0;
  param_1[0x21] = 0;
  param_1[0x22] = 0;
  param_1[0x23] = 0;
  param_1[0x24] = 0;
  param_1[0x25] = 0;
  param_1[0x27] = 0;
  param_1[0x28] = 0;
  param_1[0x29] = 0;
  param_1[0x2b] = 0;
  param_1[0x2c] = 0;
  param_1[0x30] = 0;
  param_1[0x31] = 0;
  param_1[0x32] = 0;
  param_1[0x33] = 0;
  *(undefined4 *)((longlong)param_1 + 0x1a4) = 0;
  param_1[0x37] = 0;
  param_1[0x38] = 7;
  *(undefined2 *)(param_1 + 0x35) = 0;
  param_1[0x3c] = 0;
  param_1[0x3d] = 7;
  *(undefined2 *)(param_1 + 0x3a) = 0;
  param_1[0x41] = 0;
  param_1[0x42] = 7;
  *(undefined2 *)(param_1 + 0x3f) = 0;
  param_1[0x46] = 0;
  param_1[0x47] = 7;
  *(undefined2 *)(param_1 + 0x44) = 0;
  param_1[0x2d] = 0;
  *(undefined4 *)(param_1 + 0x2e) = 0;
  return param_1;
}



undefined4 FUN_14033d710(longlong param_1,undefined8 param_2)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong local_res8;
  
  EnterCriticalSection(DAT_1406082b0);
  FUN_1403070c0(&local_res8,param_2);
  lVar4 = FUN_14033da60(param_1 + 0x60,local_res8);
  LOCK();
  piVar1 = (int *)(local_res8 + -8);
  iVar2 = *piVar1;
  *piVar1 = *piVar1 + -1;
  UNLOCK();
  if (iVar2 + -1 < 1) {
    (**(code **)(**(longlong **)(local_res8 + -0x18) + 8))();
  }
  if (lVar4 == 0) {
    LeaveCriticalSection(DAT_1406082b0);
    uVar3 = 0;
  }
  else {
    if (lVar4 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    uVar3 = *(undefined4 *)(lVar4 + 8);
    LeaveCriticalSection(DAT_1406082b0);
  }
  return uVar3;
}



undefined8 * FUN_14033d7d0(longlong param_1,undefined8 *param_2,undefined8 *param_3)

{
  longlong *plVar1;
  uint uVar2;
  int *piVar3;
  longlong *plVar4;
  int *local_b8;
  longlong *local_b0;
  undefined4 local_a8;
  uint local_a4;
  int *local_a0;
  longlong *local_98;
  longlong local_90;
  undefined8 local_88;
  longlong *local_80;
  int *local_78;
  longlong *local_70;
  undefined8 local_68;
  undefined1 local_60 [16];
  longlong *local_50;
  
  local_68 = 0xfffffffffffffffe;
  piVar3 = (int *)0x0;
  local_a8 = 0;
  EnterCriticalSection(DAT_1406082b0);
  local_b8 = (int *)0x0;
  local_b0 = (longlong *)0x0;
  uVar2 = FUN_14033d710(param_1);
  local_a4 = uVar2;
  if (uVar2 == 0) {
    *param_2 = 0;
    param_2[1] = 0;
  }
  else {
    if (*(longlong *)(param_1 + 0x18) != 0) {
      for (plVar4 = *(longlong **)
                     (*(longlong *)(param_1 + 0x18) +
                     ((ulonglong)uVar2 % (ulonglong)*(uint *)(param_1 + 0x28)) * 8);
          plVar4 != (longlong *)0x0; plVar4 = (longlong *)plVar4[3]) {
        if ((*(uint *)(plVar4 + 4) == uVar2) && (*plVar4 == (longlong)(int)uVar2)) {
          if (plVar4 != (longlong *)0x0) {
            if (plVar4 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
            local_b8 = (int *)plVar4[1];
            local_b0 = (longlong *)plVar4[2];
            if (local_b0 != (longlong *)0x0) {
              LOCK();
              *(int *)(local_b0 + 1) = (int)local_b0[1] + 1;
              UNLOCK();
            }
            LOCK();
            *local_b8 = *local_b8 + 1;
            UNLOCK();
            local_78 = local_b8;
            local_70 = local_b0;
            goto LAB_14033d9ca;
          }
          break;
        }
      }
    }
    local_a0 = operator_new(0x2e8);
    if (local_a0 != (int *)0x0) {
      piVar3 = (int *)FUN_14034d150(local_a0);
    }
    local_a0 = piVar3;
    FUN_14033db10(&local_98,piVar3);
    FUN_140178e90(&local_a0,piVar3,piVar3);
    piVar3 = local_a0;
    local_b8 = local_a0;
    local_b0 = local_98;
    FUN_14034d5d0(local_a0,uVar2);
    LOCK();
    *piVar3 = *piVar3 + 1;
    UNLOCK();
    piVar3 = (int *)FUN_140342d30(local_60,&local_a4,&local_b8);
    local_90 = (longlong)*piVar3;
    local_88 = *(undefined8 *)(piVar3 + 2);
    plVar4 = *(longlong **)(piVar3 + 4);
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
      UNLOCK();
    }
    local_80 = plVar4;
    FUN_14031a010(param_1 + 0x18,local_90,&local_88);
    plVar1 = local_80;
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar4 = plVar4 + 1;
      *(int *)plVar4 = (int)*plVar4 + -1;
      UNLOCK();
      if ((int)*plVar4 == 0) {
        (**(code **)(*local_80 + 8))(local_80);
        LOCK();
        piVar3 = (int *)((longlong)plVar1 + 0xc);
        *piVar3 = *piVar3 + -1;
        UNLOCK();
        if (*piVar3 == 0) {
          (**(code **)(*local_80 + 0x10))();
        }
      }
    }
    if (local_50 != (longlong *)0x0) {
      LOCK();
      plVar4 = local_50 + 1;
      *(int *)plVar4 = (int)*plVar4 + -1;
      UNLOCK();
      if ((int)*plVar4 == 0) {
        (**(code **)(*local_50 + 8))(local_50);
        LOCK();
        piVar3 = (int *)((longlong)local_50 + 0xc);
        *piVar3 = *piVar3 + -1;
        UNLOCK();
        if (*piVar3 == 0) {
          (**(code **)(*local_50 + 0x10))(local_50);
        }
      }
    }
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 1;
    *param_3 = *(undefined8 *)(param_1 + 0x10);
LAB_14033d9ca:
    plVar4 = local_b0;
    *param_2 = local_b8;
    param_2[1] = local_b0;
    if (local_b0 != (longlong *)0x0) {
      LOCK();
      *(int *)(local_b0 + 1) = (int)local_b0[1] + 1;
      UNLOCK();
    }
    local_a8 = 1;
    if (local_b0 != (longlong *)0x0) {
      LOCK();
      plVar1 = local_b0 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*local_b0 + 8))(local_b0);
        LOCK();
        piVar3 = (int *)((longlong)plVar4 + 0xc);
        *piVar3 = *piVar3 + -1;
        UNLOCK();
        if (*piVar3 == 0) {
          (**(code **)(*local_b0 + 0x10))();
        }
      }
    }
  }
  LeaveCriticalSection(DAT_1406082b0);
  return param_2;
}



void FUN_14033da50(void)

{
                    // WARNING: Could not recover jumptable at 0x00014033da57. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_1406082b0);
  return;
}



undefined8 * FUN_14033da60(longlong *param_1,ushort *param_2)

{
  ushort uVar1;
  short sVar2;
  short sVar3;
  short *psVar4;
  ushort *puVar5;
  undefined8 *puVar6;
  longlong lVar7;
  ulonglong uVar8;
  
  if (param_2 == (ushort *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar8 = 0;
  uVar1 = *param_2;
  puVar5 = param_2;
  while (uVar1 != 0) {
    puVar5 = puVar5 + 1;
    uVar8 = (ulonglong)((int)uVar8 * 0x21 + (uint)uVar1);
    uVar1 = *puVar5;
  }
  if ((*param_1 == 0) ||
     (puVar6 = *(undefined8 **)(*param_1 + (uVar8 % (ulonglong)*(uint *)(param_1 + 2)) * 8),
     puVar6 == (undefined8 *)0x0)) {
    return (undefined8 *)0x0;
  }
  do {
    if (*(int *)(puVar6 + 3) == (int)uVar8) {
      psVar4 = (short *)*puVar6;
      lVar7 = (longlong)param_2 - (longlong)psVar4;
      do {
        sVar2 = *psVar4;
        sVar3 = *(short *)((longlong)psVar4 + lVar7);
        if (sVar2 != sVar3) break;
        psVar4 = psVar4 + 1;
      } while (sVar3 != 0);
      if (sVar2 == sVar3) {
        return puVar6;
      }
    }
    puVar6 = (undefined8 *)puVar6[2];
    if (puVar6 == (undefined8 *)0x0) {
      return (undefined8 *)0x0;
    }
  } while( true );
}



undefined8 * FUN_14033db10(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;
}



void FUN_14033db80(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14034d320(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14033dbb0(longlong param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  int *piVar3;
  int *piVar4;
  undefined4 **ppuVar5;
  undefined4 **ppuVar6;
  undefined8 *puVar7;
  code *pcVar8;
  uint uVar9;
  undefined4 uVar10;
  int iVar11;
  longlong lVar12;
  undefined4 *puVar13;
  undefined4 *puVar14;
  wchar_t *pwVar15;
  short *psVar16;
  short *psVar17;
  undefined8 uVar18;
  ulonglong uVar19;
  longlong *plVar20;
  longlong lVar21;
  wchar_t *pwVar22;
  undefined4 *puVar23;
  longlong lVar24;
  undefined2 *puVar25;
  undefined4 *puVar26;
  undefined4 *puVar27;
  undefined4 *puVar28;
  wchar_t *pwVar29;
  undefined8 *puVar30;
  undefined4 uVar31;
  bool bVar32;
  undefined1 uVar33;
  undefined1 auStack_108 [32];
  undefined1 local_e8;
  undefined4 *local_d8;
  longlong *local_d0;
  undefined4 *local_c8;
  int local_c0;
  undefined4 local_bc;
  longlong local_b8;
  undefined4 *local_b0;
  longlong local_a0;
  wchar_t *local_98;
  wchar_t *local_90;
  undefined8 local_88;
  undefined8 local_78;
  undefined2 local_70;
  undefined6 uStack_6e;
  undefined8 local_60;
  ulonglong local_58;
  ulonglong local_48;
  
  local_78 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  local_b8 = param_1;
  lVar12 = FUN_1402933b0();
  uVar18 = 0;
  if (lVar12 != 0) {
    uVar19 = 0xffffffffffffffff;
    psVar17 = param_2;
    do {
      if (uVar19 == 0) break;
      uVar19 = uVar19 - 1;
      sVar2 = *psVar17;
      psVar17 = psVar17 + 1;
    } while (sVar2 != 0);
    FUN_140001710(param_1,param_2,~uVar19 - 1);
    puVar28 = (undefined4 *)0x0;
    local_c8 = puVar28;
    if ((*(longlong *)(lVar12 + 0x70) != 0) && (*(uint *)(lVar12 + 0x78) != 0)) {
      puVar14 = puVar28;
      plVar20 = *(longlong **)(lVar12 + 0x68);
      do {
        if (*plVar20 != 0) {
          local_c8 = (undefined4 *)(*(longlong **)(lVar12 + 0x68))[(longlong)puVar14];
          break;
        }
        uVar9 = (int)puVar14 + 1;
        puVar14 = (undefined4 *)(ulonglong)uVar9;
        plVar20 = plVar20 + 1;
      } while (uVar9 < *(uint *)(lVar12 + 0x78));
    }
LAB_14033dc70:
    local_b0 = local_c8;
    if (local_c8 != (undefined4 *)0x0) {
      uVar31 = *local_c8;
      local_bc = uVar31;
      puVar13 = operator_new(0xa0);
      puVar14 = puVar28;
      if (puVar13 != (undefined4 *)0x0) {
        *(undefined8 *)(puVar13 + 3) = 0;
        *(undefined8 *)(puVar13 + 6) = 0;
        puVar13[8] = 0;
        *(undefined8 *)(puVar13 + 0xe) = 0;
        puVar13[0x10] = 0;
        puVar13[0x12] = 0;
        puVar13[0x14] = 0;
        *(undefined8 *)(puVar13 + 0x1c) = 7;
        *(undefined8 *)(puVar13 + 0x1a) = 0;
        *(undefined2 *)(puVar13 + 0x16) = 0;
        *(undefined8 *)(puVar13 + 0x20) = 0;
        *(undefined8 *)(puVar13 + 0x22) = 0;
        *(undefined8 *)(puVar13 + 0x24) = 0;
        puVar14 = puVar13;
      }
      local_d8 = puVar14;
      FUN_14033e830(&local_d0,puVar14);
      FUN_140178e90(&local_d8,puVar14,puVar14);
      uVar10 = FUN_1402970c0(lVar12,&DAT_14049f290);
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,&DAT_14049f290);
      *local_d8 = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nGroupID");
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nGroupID");
      local_d8[1] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nNextGroupID");
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nNextGroupID");
      local_d8[2] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nTimeChange");
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nTimeChange");
      local_d8[9] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nStepCount");
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nStepCount");
      local_d8[10] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nTargetSetID");
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nTargetSetID");
      local_d8[0xb] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"nComboSetID");
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nComboSetID");
      local_d8[0xc] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fHpRatio");
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar31,uVar10,L"fHpRatio");
      local_d8[0x11] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"fDamageChange");
      local_e8 = 0;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar31,uVar10,L"fDamageChange");
      if (puVar14 != (undefined4 *)0x0) {
        local_d8[0x14] = *puVar14;
      }
      uVar10 = FUN_1402970c0(lVar12,L"nHPType");
      local_e8 = 0;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nHPType");
      if (puVar14 != (undefined4 *)0x0) {
        local_d8[6] = *puVar14;
      }
      uVar10 = FUN_1402970c0(lVar12,L"nGimmickID");
      local_e8 = 0;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nGimmickID");
      if (puVar14 != (undefined4 *)0x0) {
        local_d8[3] = *puVar14;
      }
      uVar10 = FUN_1402970c0(lVar12,L"szDistType");
      local_e8 = 0;
      pwVar15 = (wchar_t *)FUN_140296990(lVar12,uVar31,uVar10,L"szDistType");
      bVar32 = pwVar15 == (wchar_t *)0x0;
      if (!bVar32) {
        lVar21 = 10;
        pwVar22 = pwVar15;
        pwVar29 = L"DIST_NEAR";
        do {
          if (lVar21 == 0) break;
          lVar21 = lVar21 + -1;
          bVar32 = *pwVar22 == *pwVar29;
          pwVar22 = pwVar22 + 1;
          pwVar29 = pwVar29 + 1;
        } while (bVar32);
        if (bVar32) {
          local_d8[7] = 1;
        }
        else {
          lVar21 = 9;
          pwVar22 = L"DIST_FAR";
          do {
            if (lVar21 == 0) break;
            lVar21 = lVar21 + -1;
            bVar32 = *pwVar15 == *pwVar22;
            pwVar15 = pwVar15 + 1;
            pwVar22 = pwVar22 + 1;
          } while (bVar32);
          if (bVar32) {
            local_d8[7] = 2;
          }
        }
        uVar10 = FUN_1402970c0(lVar12,L"fDist");
        local_e8 = 0;
        puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar31,uVar10,L"fDist");
        local_d8[0x12] = *puVar14;
      }
      uVar10 = FUN_1402970c0(lVar12,L"fDelayReduce");
      local_e8 = 1;
      puVar14 = (undefined4 *)FUN_1402967b0(lVar12,uVar31,uVar10,L"fDelayReduce");
      local_d8[0x13] = *puVar14;
      uVar10 = FUN_1402970c0(lVar12,L"szNextID");
      local_e8 = 1;
      psVar16 = (short *)FUN_140296990(lVar12,uVar31,uVar10,L"szNextID");
      local_58 = 7;
      local_60 = 0;
      local_70 = 0;
      uVar19 = 0xffffffffffffffff;
      psVar17 = psVar16;
      do {
        if (uVar19 == 0) break;
        uVar19 = uVar19 - 1;
        sVar2 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_70,psVar16,~uVar19 - 1);
      uVar10 = FUN_1402970c0(lVar12,L"szHitBox");
      local_e8 = 0;
      psVar17 = (short *)FUN_140296990(lVar12,uVar31,uVar10,L"szHitBox");
      if (psVar17 != (short *)0x0) {
        uVar19 = 0xffffffffffffffff;
        psVar16 = psVar17;
        do {
          if (uVar19 == 0) break;
          uVar19 = uVar19 - 1;
          sVar2 = *psVar16;
          psVar16 = psVar16 + 1;
        } while (sVar2 != 0);
        FUN_140001710(local_d8 + 0x16,psVar17,~uVar19 - 1);
        uVar10 = FUN_1402970c0(lVar12,L"nHitBoxNextID");
        local_e8 = 0;
        puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nHitBoxNextID");
        uVar33 = puVar14 == (undefined4 *)0x0;
        if (!(bool)uVar33) {
          local_d8[0xd] = *puVar14;
          uVar10 = FUN_1402970c0(lVar12,L"szBoxType");
          local_e8 = 0;
          pwVar15 = (wchar_t *)FUN_140296990(lVar12,uVar31,uVar10,L"szBoxType");
          lVar21 = 8;
          pwVar22 = pwVar15;
          pwVar29 = L"BOX_HIT";
          do {
            if (lVar21 == 0) break;
            lVar21 = lVar21 + -1;
            uVar33 = *pwVar22 == *pwVar29;
            pwVar22 = pwVar22 + 1;
            pwVar29 = pwVar29 + 1;
          } while ((bool)uVar33);
          if ((bool)uVar33) {
            local_d8[8] = 1;
          }
          else {
            lVar21 = 9;
            pwVar22 = L"BOX_TRAP";
            do {
              if (lVar21 == 0) break;
              lVar21 = lVar21 + -1;
              uVar33 = *pwVar15 == *pwVar22;
              pwVar15 = pwVar15 + 1;
              pwVar22 = pwVar22 + 1;
            } while ((bool)uVar33);
            if ((bool)uVar33) {
              local_d8[8] = 2;
            }
          }
        }
      }
      uVar10 = FUN_1402970c0(lVar12,L"nWarpID");
      local_e8 = 0;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nWarpID");
      if (puVar14 != (undefined4 *)0x0) {
        local_d8[0xe] = *puVar14;
      }
      uVar10 = FUN_1402970c0(lVar12,L"nRushID");
      local_e8 = 0;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nRushID");
      if (puVar14 != (undefined4 *)0x0) {
        local_d8[0xf] = *puVar14;
      }
      uVar10 = FUN_1402970c0(lVar12,L"nWeakID");
      local_e8 = 0;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nWeakID");
      if (puVar14 != (undefined4 *)0x0) {
        local_d8[4] = *puVar14;
      }
      uVar10 = FUN_1402970c0(lVar12,L"nSelfDistruct");
      local_e8 = 0;
      puVar14 = (undefined4 *)FUN_140296600(lVar12,uVar31,uVar10,L"nSelfDistruct");
      if (puVar14 != (undefined4 *)0x0) {
        local_d8[0x10] = *puVar14;
      }
      local_98 = (wchar_t *)0x0;
      local_90 = (wchar_t *)0x0;
      local_88 = 0;
      puVar25 = &local_70;
      if (7 < local_58) {
        puVar25 = (undefined2 *)CONCAT62(uStack_6e,local_70);
      }
      FUN_140415930(&local_98,puVar25,&DAT_14049c7b8);
      pwVar15 = local_98;
      lVar21 = ((longlong)local_90 - (longlong)local_98) / 0x28;
      local_a0 = lVar21;
      FUN_140051e60(local_d8 + 0x20,lVar21);
      uVar33 = (int)lVar21 == 0;
      puVar14 = puVar28;
      if (0 < (int)lVar21) {
        do {
          pwVar22 = pwVar15;
          if (7 < *(ulonglong *)(pwVar15 + 0xc)) {
            pwVar22 = *(wchar_t **)pwVar15;
          }
          iVar11 = _wtoi(pwVar22);
          puVar13 = local_d8;
          piVar3 = *(int **)(local_d8 + 0x22);
          local_c0 = iVar11;
          if ((&local_c0 < piVar3) && (piVar4 = *(int **)(local_d8 + 0x20), piVar4 <= &local_c0)) {
            if (piVar3 == *(int **)(local_d8 + 0x24)) {
              uVar19 = (longlong)piVar3 - (longlong)piVar4 >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                pcVar8 = (code *)swi(3);
                uVar18 = (*pcVar8)();
                return uVar18;
              }
              puVar23 = (undefined4 *)(uVar19 + 1);
              puVar26 = (undefined4 *)((longlong)*(int **)(local_d8 + 0x24) - (longlong)piVar4 >> 2)
              ;
              if (puVar26 < puVar23) {
                puVar27 = puVar28;
                if (puVar26 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar26 >> 1))) {
                  puVar27 = (undefined4 *)((longlong)puVar26 + ((ulonglong)puVar26 >> 1));
                }
                if (puVar27 < puVar23) {
                  puVar27 = puVar23;
                }
                FUN_140051e60(local_d8 + 0x20,puVar27);
              }
            }
            if (*(undefined4 **)(puVar13 + 0x22) != (undefined4 *)0x0) {
              **(undefined4 **)(puVar13 + 0x22) =
                   *(undefined4 *)
                    (*(longlong *)(puVar13 + 0x20) +
                    ((longlong)&local_c0 - (longlong)piVar4 >> 2) * 4);
            }
          }
          else {
            if (piVar3 == *(int **)(local_d8 + 0x24)) {
              uVar19 = (longlong)piVar3 - *(longlong *)(local_d8 + 0x20) >> 2;
              if (0x3ffffffffffffffe < uVar19) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14033e6d3;
              }
              puVar23 = (undefined4 *)(uVar19 + 1);
              puVar26 = (undefined4 *)
                        ((longlong)*(int **)(local_d8 + 0x24) - *(longlong *)(local_d8 + 0x20) >> 2)
              ;
              if (puVar26 < puVar23) {
                puVar27 = puVar28;
                if (puVar26 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar26 >> 1))) {
                  puVar27 = (undefined4 *)((longlong)puVar26 + ((ulonglong)puVar26 >> 1));
                }
                if (puVar27 < puVar23) {
                  puVar27 = puVar23;
                }
                FUN_140051e60(local_d8 + 0x20,puVar27);
              }
            }
            if (*(int **)(puVar13 + 0x22) != (int *)0x0) {
              **(int **)(puVar13 + 0x22) = iVar11;
            }
          }
          *(longlong *)(puVar13 + 0x22) = *(longlong *)(puVar13 + 0x22) + 4;
          uVar9 = (int)puVar14 + 1;
          pwVar15 = pwVar15 + 0x14;
          uVar33 = uVar9 == (uint)local_a0;
          puVar14 = (undefined4 *)(ulonglong)uVar9;
          uVar31 = local_bc;
        } while ((int)uVar9 < (int)(uint)local_a0);
      }
      uVar10 = FUN_1402970c0(lVar12,L"szMode");
      local_e8 = 1;
      pwVar15 = (wchar_t *)FUN_140296990(lVar12,uVar31,uVar10,L"szMode");
      lVar21 = local_b8;
      lVar24 = 10;
      pwVar22 = pwVar15;
      pwVar29 = L"TIME_PLAY";
      do {
        if (lVar24 == 0) break;
        lVar24 = lVar24 + -1;
        uVar33 = *pwVar22 == *pwVar29;
        pwVar22 = pwVar22 + 1;
        pwVar29 = pwVar29 + 1;
      } while ((bool)uVar33);
      if ((bool)uVar33) {
        local_d8[5] = 1;
      }
      else {
        lVar24 = 0xf;
        pwVar22 = pwVar15;
        pwVar29 = L"TIME_LOOP_PLAY";
        do {
          if (lVar24 == 0) break;
          lVar24 = lVar24 + -1;
          uVar33 = *pwVar22 == *pwVar29;
          pwVar22 = pwVar22 + 1;
          pwVar29 = pwVar29 + 1;
        } while ((bool)uVar33);
        if ((bool)uVar33) {
          local_d8[5] = 2;
        }
        else {
          lVar24 = 10;
          pwVar22 = pwVar15;
          pwVar29 = L"TIME_SKIP";
          do {
            if (lVar24 == 0) break;
            lVar24 = lVar24 + -1;
            uVar33 = *pwVar22 == *pwVar29;
            pwVar22 = pwVar22 + 1;
            pwVar29 = pwVar29 + 1;
          } while ((bool)uVar33);
          if ((bool)uVar33) {
            local_d8[5] = 3;
          }
          else {
            lVar24 = 6;
            pwVar22 = pwVar15;
            pwVar29 = L"EVENT";
            do {
              if (lVar24 == 0) break;
              lVar24 = lVar24 + -1;
              uVar33 = *pwVar22 == *pwVar29;
              pwVar22 = pwVar22 + 1;
              pwVar29 = pwVar29 + 1;
            } while ((bool)uVar33);
            if ((bool)uVar33) {
              local_d8[5] = 4;
            }
            else {
              lVar24 = 0xb;
              pwVar22 = pwVar15;
              pwVar29 = L"EVENT_TIME";
              do {
                if (lVar24 == 0) break;
                lVar24 = lVar24 + -1;
                uVar33 = *pwVar22 == *pwVar29;
                pwVar22 = pwVar22 + 1;
                pwVar29 = pwVar29 + 1;
              } while ((bool)uVar33);
              if ((bool)uVar33) {
                local_d8[5] = 5;
              }
              else {
                lVar24 = 8;
                pwVar22 = pwVar15;
                pwVar29 = L"SPECIAL";
                do {
                  if (lVar24 == 0) break;
                  lVar24 = lVar24 + -1;
                  uVar33 = *pwVar22 == *pwVar29;
                  pwVar22 = pwVar22 + 1;
                  pwVar29 = pwVar29 + 1;
                } while ((bool)uVar33);
                if ((bool)uVar33) {
                  local_d8[5] = 6;
                }
                else {
                  lVar24 = 0xc;
                  pwVar22 = L"EVENT_SCENE";
                  do {
                    if (lVar24 == 0) break;
                    lVar24 = lVar24 + -1;
                    uVar33 = *pwVar15 == *pwVar22;
                    pwVar15 = pwVar15 + 1;
                    pwVar22 = pwVar22 + 1;
                  } while ((bool)uVar33);
                  puVar14 = puVar28;
                  if ((bool)uVar33) {
                    puVar14 = (undefined4 *)0x7;
                  }
                  local_d8[5] = (int)puVar14;
                }
              }
            }
          }
        }
      }
      ppuVar5 = *(undefined4 ***)(local_b8 + 0x30);
      if ((&local_d8 < ppuVar5) &&
         (ppuVar6 = *(undefined4 ***)(local_b8 + 0x28), ppuVar6 <= &local_d8)) {
        if (ppuVar5 == *(undefined4 ***)(local_b8 + 0x38)) {
          FUN_1403435d0(local_b8 + 0x28);
        }
        puVar30 = (undefined8 *)
                  (((longlong)&local_d8 - (longlong)ppuVar6 & 0xfffffffffffffff0U) +
                  *(longlong *)(lVar21 + 0x28));
        puVar7 = *(undefined8 **)(lVar21 + 0x30);
        puVar14 = local_c8;
        if (puVar7 != (undefined8 *)0x0) {
          *puVar7 = *puVar30;
          lVar24 = puVar30[1];
          puVar7[1] = lVar24;
          if (lVar24 != 0) {
            LOCK();
            *(int *)(lVar24 + 8) = *(int *)(lVar24 + 8) + 1;
            UNLOCK();
            puVar14 = local_b0;
          }
        }
      }
      else {
        if (ppuVar5 == *(undefined4 ***)(local_b8 + 0x38)) {
          FUN_1403435d0(local_b8 + 0x28);
        }
        puVar7 = *(undefined8 **)(lVar21 + 0x30);
        puVar14 = local_c8;
        if (puVar7 != (undefined8 *)0x0) {
          *puVar7 = local_d8;
          puVar7[1] = local_d0;
          if (local_d0 != (longlong *)0x0) {
            LOCK();
            *(int *)(local_d0 + 1) = (int)local_d0[1] + 1;
            UNLOCK();
            puVar14 = local_b0;
          }
        }
      }
      pwVar29 = local_90;
      pwVar22 = local_98;
      *(longlong *)(lVar21 + 0x30) = *(longlong *)(lVar21 + 0x30) + 0x10;
      pwVar15 = local_98;
      if (local_98 != (wchar_t *)0x0) {
        for (; pwVar15 != pwVar29; pwVar15 = pwVar15 + 0x14) {
          if (7 < *(ulonglong *)(pwVar15 + 0xc)) {
            operator_delete(*(void **)pwVar15);
          }
          pwVar15[0xc] = L'\a';
          pwVar15[0xd] = L'\0';
          pwVar15[0xe] = L'\0';
          pwVar15[0xf] = L'\0';
          pwVar15[8] = L'\0';
          pwVar15[9] = L'\0';
          pwVar15[10] = L'\0';
          pwVar15[0xb] = L'\0';
          *pwVar15 = L'\0';
        }
        operator_delete(pwVar22);
      }
      if (7 < local_58) {
        operator_delete((void *)CONCAT62(uStack_6e,local_70));
      }
      plVar20 = local_d0;
      local_58 = 7;
      local_60 = 0;
      local_70 = 0;
      if (local_d0 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_d0 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar14 = local_b0;
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_d0 + 8))(local_d0);
          LOCK();
          piVar3 = (int *)((longlong)plVar20 + 0xc);
          *piVar3 = *piVar3 + -1;
          UNLOCK();
          puVar14 = local_b0;
          if (*piVar3 == 0) {
            (**(code **)(*plVar20 + 0x10))(plVar20);
            puVar14 = local_b0;
          }
        }
      }
      local_c8 = *(undefined4 **)(puVar14 + 6);
      if (local_c8 == (undefined4 *)0x0) {
        uVar9 = (uint)puVar14[8] % *(uint *)(lVar12 + 0x78) + 1;
        lVar21 = (longlong)(int)uVar9 << 3;
        local_c8 = puVar28;
        do {
          if (*(uint *)(lVar12 + 0x78) <= uVar9) break;
          if (*(longlong *)(lVar21 + *(longlong *)(lVar12 + 0x68)) != 0) {
            local_c8 = *(undefined4 **)(lVar21 + *(longlong *)(lVar12 + 0x68));
          }
          uVar9 = uVar9 + 1;
          lVar21 = lVar21 + 8;
        } while (local_c8 == (undefined4 *)0x0);
      }
      goto LAB_14033dc70;
    }
LAB_14033e6d3:
    FUN_14033e8a0(*(longlong *)(local_b8 + 0x28),*(longlong *)(local_b8 + 0x30),
                  *(longlong *)(local_b8 + 0x30) - *(longlong *)(local_b8 + 0x28) >> 4,0);
    uVar18 = 1;
  }
  return uVar18;
}



undefined8 FUN_14033e720(undefined8 *param_1,undefined8 *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  
  if (*(int *)*param_1 < *(int *)*param_2) {
    plVar4 = (longlong *)param_1[1];
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar4 + 1;
      lVar5 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar5 == 1) {
        (**(code **)(*plVar4 + 8))(plVar4);
        LOCK();
        piVar2 = (int *)((longlong)plVar4 + 0xc);
        iVar3 = *piVar2;
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (iVar3 == 1) {
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    plVar4 = (longlong *)param_2[1];
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar4 + 1;
      lVar5 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar5 == 1) {
        (**(code **)(*plVar4 + 8))(plVar4);
        LOCK();
        piVar2 = (int *)((longlong)plVar4 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    uVar6 = 1;
  }
  else {
    plVar4 = (longlong *)param_1[1];
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar4 + 1;
      lVar5 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar5 == 1) {
        (**(code **)(*plVar4 + 8))(plVar4);
        LOCK();
        piVar2 = (int *)((longlong)plVar4 + 0xc);
        iVar3 = *piVar2;
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (iVar3 == 1) {
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    plVar4 = (longlong *)param_2[1];
    if (plVar4 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar4 + 1;
      lVar5 = *plVar1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)lVar5 == 1) {
        (**(code **)(*plVar4 + 8))(plVar4);
        LOCK();
        piVar2 = (int *)((longlong)plVar4 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    uVar6 = 0;
  }
  return uVar6;
}



undefined8 * FUN_14033e830(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;
}



void FUN_14033e8a0(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 >> 4;
    if (lVar1 < 0x21) {
LAB_14033e96b:
      if (1 < lVar1) {
        FUN_14033f110(param_1,param_2,param_4);
      }
      return;
    }
    if (param_3 < 1) {
      if (0x20 < lVar1) {
        lVar1 = param_2 - param_1 >> 4;
        if (lVar1 < 2) {
          return;
        }
        FUN_14033f030(param_1,param_2,param_4);
        if (lVar1 < 2) {
          return;
        }
        do {
          FUN_14033f700(param_1,param_2,param_4);
          param_2 = param_2 + -0x10;
        } while (0x10 < (longlong)(param_2 - param_1 & 0xfffffffffffffff0U));
        return;
      }
      goto LAB_14033e96b;
    }
    FUN_14033ea90(&local_18,param_1,param_2);
    lVar1 = local_10;
    param_3 = param_3 / 2 + (param_3 / 2) / 2;
    if ((longlong)(local_18 - param_1 & 0xfffffffffffffff0U) <
        (longlong)(param_2 - local_10 & 0xfffffffffffffff0U)) {
      FUN_14033e8a0(param_1,local_18,param_3,param_4);
      param_1 = lVar1;
    }
    else {
      FUN_14033e8a0(local_10,param_2,param_3,param_4);
      param_2 = local_18;
    }
    lVar1 = param_2 - param_1;
  } while( true );
}



void FUN_14033ea00(longlong param_1)

{
  FUN_14033ea10(*(undefined8 *)(param_1 + 0x10));
  return;
}



void FUN_14033ea10(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (*(void **)((longlong)param_1 + 0x80) != (void *)0x0) {
      operator_delete(*(void **)((longlong)param_1 + 0x80));
    }
    *(undefined8 *)((longlong)param_1 + 0x80) = 0;
    *(undefined8 *)((longlong)param_1 + 0x88) = 0;
    *(undefined8 *)((longlong)param_1 + 0x90) = 0;
    if (7 < *(ulonglong *)((longlong)param_1 + 0x70)) {
      operator_delete(*(void **)((longlong)param_1 + 0x58));
    }
    *(undefined8 *)((longlong)param_1 + 0x70) = 7;
    *(undefined8 *)((longlong)param_1 + 0x68) = 0;
    *(undefined2 *)((longlong)param_1 + 0x58) = 0;
    operator_delete(param_1);
  }
  return;
}



void FUN_14033ea90(ulonglong *param_1,undefined8 *param_2,undefined8 *param_3)

{
  undefined8 uVar1;
  undefined8 *puVar2;
  char cVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  undefined8 local_128;
  longlong local_120;
  undefined8 local_118;
  longlong local_110;
  undefined8 local_108;
  longlong local_100;
  undefined8 local_f8;
  longlong local_f0;
  undefined8 local_e8;
  longlong local_e0;
  undefined8 local_d8;
  longlong local_d0;
  undefined8 local_c8;
  longlong local_c0;
  undefined8 local_b8;
  longlong local_b0;
  undefined8 local_a8;
  longlong local_a0;
  undefined8 local_98;
  longlong local_90;
  undefined8 local_88;
  longlong local_80;
  undefined8 local_78;
  longlong local_70;
  undefined8 local_68;
  longlong local_60;
  undefined8 local_58;
  longlong local_50;
  undefined8 local_48;
  longlong local_40;
  undefined8 local_38;
  longlong local_30;
  
  puVar4 = param_2 + (((longlong)param_3 - (longlong)param_2 >> 4) -
                      ((longlong)param_3 - (longlong)param_2 >> 0x3f) >> 1) * 2;
  FUN_14033ef50(param_2,puVar4,param_3 + -2);
  puVar7 = puVar4 + 2;
  if (param_2 < puVar4) {
    while( true ) {
      local_a8 = *puVar4;
      local_a0 = puVar4[1];
      if (local_a0 != 0) {
        LOCK();
        *(int *)(local_a0 + 8) = *(int *)(local_a0 + 8) + 1;
        UNLOCK();
      }
      local_108 = puVar4[-2];
      puVar2 = puVar4 + -2;
      local_100 = puVar4[-1];
      if (local_100 != 0) {
        LOCK();
        *(int *)(local_100 + 8) = *(int *)(local_100 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_14033e720(&local_108,&local_a8);
      if (cVar3 != '\0') break;
      local_68 = *puVar2;
      local_60 = puVar4[-1];
      if (local_60 != 0) {
        LOCK();
        *(int *)(local_60 + 8) = *(int *)(local_60 + 8) + 1;
        UNLOCK();
      }
      local_e8 = *puVar4;
      local_e0 = puVar4[1];
      if (local_e0 != 0) {
        LOCK();
        *(int *)(local_e0 + 8) = *(int *)(local_e0 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_14033e720(&local_e8,&local_68);
      if ((cVar3 != '\0') || (puVar4 = puVar2, puVar2 <= param_2)) break;
    }
  }
  puVar2 = puVar7;
  puVar5 = puVar4;
  if (puVar7 < param_3) {
    while( true ) {
      local_88 = *puVar4;
      local_80 = puVar4[1];
      if (local_80 != 0) {
        LOCK();
        *(int *)(local_80 + 8) = *(int *)(local_80 + 8) + 1;
        UNLOCK();
      }
      local_c8 = *puVar7;
      local_c0 = puVar7[1];
      if (local_c0 != 0) {
        LOCK();
        *(int *)(local_c0 + 8) = *(int *)(local_c0 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_14033e720(&local_c8,&local_88);
      puVar2 = puVar7;
      if (cVar3 != '\0') break;
      local_48 = *puVar7;
      local_40 = puVar7[1];
      if (local_40 != 0) {
        LOCK();
        *(int *)(local_40 + 8) = *(int *)(local_40 + 8) + 1;
        UNLOCK();
      }
      local_128 = *puVar4;
      local_120 = puVar4[1];
      if (local_120 != 0) {
        LOCK();
        *(int *)(local_120 + 8) = *(int *)(local_120 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_14033e720(&local_128,&local_48);
      if ((cVar3 != '\0') || (puVar7 = puVar7 + 2, puVar2 = puVar7, param_3 <= puVar7)) break;
    }
  }
joined_r0x00014033ec53:
  do {
    if (param_3 <= puVar7) {
joined_r0x00014033ed1e:
      while (puVar8 = puVar4, param_2 < puVar8) {
        local_98 = *puVar5;
        local_90 = puVar5[1];
        if (local_90 != 0) {
          LOCK();
          *(int *)(local_90 + 8) = *(int *)(local_90 + 8) + 1;
          UNLOCK();
        }
        local_78 = puVar8[-2];
        puVar4 = puVar8 + -2;
        local_70 = puVar8[-1];
        if (local_70 != 0) {
          LOCK();
          *(int *)(local_70 + 8) = *(int *)(local_70 + 8) + 1;
          UNLOCK();
        }
        cVar3 = FUN_14033e720(&local_78,&local_98);
        if (cVar3 == '\0') {
          local_58 = *puVar4;
          local_50 = puVar8[-1];
          if (local_50 != 0) {
            LOCK();
            *(int *)(local_50 + 8) = *(int *)(local_50 + 8) + 1;
            UNLOCK();
          }
          local_38 = *puVar5;
          local_30 = puVar5[1];
          if (local_30 != 0) {
            LOCK();
            *(int *)(local_30 + 8) = *(int *)(local_30 + 8) + 1;
            UNLOCK();
          }
          cVar3 = FUN_14033e720(&local_38,&local_58);
          if (cVar3 != '\0') break;
          uVar1 = puVar5[-2];
          puVar5[-2] = *puVar4;
          *puVar4 = uVar1;
          uVar1 = puVar8[-1];
          puVar8[-1] = puVar5[-1];
          puVar5[-1] = uVar1;
          puVar5 = puVar5 + -2;
        }
      }
      if (puVar8 == param_2) {
        if (puVar7 == param_3) {
          *param_1 = (ulonglong)puVar5;
          param_1[1] = (ulonglong)puVar2;
          return;
        }
        if (puVar2 != puVar7) {
          uVar1 = *puVar5;
          *puVar5 = *puVar2;
          *puVar2 = uVar1;
          uVar1 = puVar2[1];
          puVar2[1] = puVar5[1];
          puVar5[1] = uVar1;
        }
        uVar1 = *puVar5;
        *puVar5 = *puVar7;
        *puVar7 = uVar1;
        uVar1 = puVar7[1];
        puVar7[1] = puVar5[1];
        puVar5[1] = uVar1;
        puVar7 = puVar7 + 2;
        puVar2 = puVar2 + 2;
        puVar4 = puVar8;
        puVar5 = puVar5 + 2;
      }
      else {
        puVar4 = puVar8 + -2;
        if (puVar7 == param_3) {
          puVar6 = puVar5 + -2;
          if (puVar4 != puVar6) {
            uVar1 = *puVar4;
            *puVar4 = *puVar6;
            *puVar6 = uVar1;
            uVar1 = puVar5[-1];
            puVar5[-1] = puVar8[-1];
            puVar8[-1] = uVar1;
          }
          uVar1 = *puVar6;
          *puVar6 = puVar2[-2];
          puVar2[-2] = uVar1;
          uVar1 = puVar2[-1];
          puVar2[-1] = puVar5[-1];
          puVar5[-1] = uVar1;
          puVar2 = puVar2 + -2;
          puVar5 = puVar6;
        }
        else {
          uVar1 = *puVar7;
          *puVar7 = *puVar4;
          *puVar4 = uVar1;
          uVar1 = puVar8[-1];
          puVar8[-1] = puVar7[1];
          puVar7[1] = uVar1;
          puVar7 = puVar7 + 2;
        }
      }
      goto joined_r0x00014033ec53;
    }
    local_118 = *puVar7;
    local_110 = puVar7[1];
    if (local_110 != 0) {
      LOCK();
      *(int *)(local_110 + 8) = *(int *)(local_110 + 8) + 1;
      UNLOCK();
    }
    local_f8 = *puVar5;
    local_f0 = puVar5[1];
    if (local_f0 != 0) {
      LOCK();
      *(int *)(local_f0 + 8) = *(int *)(local_f0 + 8) + 1;
      UNLOCK();
    }
    cVar3 = FUN_14033e720(&local_f8,&local_118);
    puVar8 = puVar2;
    if (cVar3 == '\0') {
      local_d8 = *puVar5;
      local_d0 = puVar5[1];
      if (local_d0 != 0) {
        LOCK();
        *(int *)(local_d0 + 8) = *(int *)(local_d0 + 8) + 1;
        UNLOCK();
      }
      local_b8 = *puVar7;
      local_b0 = puVar7[1];
      if (local_b0 != 0) {
        LOCK();
        *(int *)(local_b0 + 8) = *(int *)(local_b0 + 8) + 1;
        UNLOCK();
      }
      cVar3 = FUN_14033e720(&local_b8,&local_d8);
      if (cVar3 != '\0') goto joined_r0x00014033ed1e;
      puVar8 = puVar2 + 2;
      uVar1 = *puVar2;
      *puVar2 = *puVar7;
      *puVar7 = uVar1;
      uVar1 = puVar7[1];
      puVar7[1] = puVar2[1];
      puVar2[1] = uVar1;
    }
    puVar7 = puVar7 + 2;
    puVar2 = puVar8;
  } while( true );
}



undefined8 * FUN_14033ef00(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  longlong lVar1;
  
  for (; param_1 != param_2; param_1 = param_1 + 2) {
    if (param_3 != (undefined8 *)0x0) {
      *param_3 = *param_1;
      lVar1 = param_1[1];
      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_14033ef50(longlong param_1,longlong param_2,longlong param_3,undefined1 param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar1 = param_3 - param_1 >> 4;
  if (0x28 < lVar1) {
    lVar1 = lVar1 + 1;
    lVar2 = (longlong)(lVar1 + (ulonglong)((uint)(lVar1 >> 0x3f) & 7)) >> 3;
    lVar1 = lVar2 * 0x10 + param_1;
    FUN_14033f350(param_1,lVar1,lVar2 * 0x20 + param_1);
    FUN_14033f350(param_2 + lVar2 * -0x10,param_2,lVar2 * 0x10 + param_2,param_4);
    lVar3 = param_3 + lVar2 * -0x10;
    FUN_14033f350(param_3 + lVar2 * -0x20,lVar3,param_3,param_4);
    FUN_14033f350(lVar1,param_2,lVar3,param_4);
    return;
  }
  FUN_14033f350();
  return;
}



void FUN_14033f030(longlong param_1,longlong param_2,undefined1 param_3)

{
  int *piVar1;
  longlong *plVar2;
  longlong *plVar3;
  longlong lVar4;
  undefined8 *puVar5;
  longlong lVar6;
  undefined8 local_30;
  longlong *local_28;
  
  lVar6 = param_2 - param_1 >> 4;
  lVar4 = lVar6 - (param_2 - param_1 >> 0x3f) >> 1;
  if (0 < lVar4) {
    puVar5 = (undefined8 *)(lVar4 * 0x10 + param_1);
    do {
      lVar4 = lVar4 + -1;
      local_30 = puVar5[-2];
      plVar2 = (longlong *)puVar5[-1];
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
        UNLOCK();
      }
      local_28 = plVar2;
      FUN_14033f4b0(param_1,lVar4,lVar6,&local_30,param_3);
      plVar3 = local_28;
      if (plVar2 != (longlong *)0x0) {
        LOCK();
        plVar2 = plVar2 + 1;
        *(int *)plVar2 = (int)*plVar2 + -1;
        UNLOCK();
        if ((int)*plVar2 == 0) {
          (**(code **)(*local_28 + 8))(local_28);
          LOCK();
          piVar1 = (int *)((longlong)plVar3 + 0xc);
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          if (*piVar1 == 0) {
            (**(code **)(*local_28 + 0x10))();
          }
        }
      }
      puVar5 = puVar5 + -2;
    } while (0 < lVar4);
  }
  return;
}



void FUN_14033f110(undefined8 *param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  undefined8 uVar5;
  longlong lVar6;
  undefined8 *puVar7;
  char cVar8;
  undefined8 *puVar9;
  longlong *plVar11;
  undefined8 uVar12;
  undefined8 local_70;
  longlong local_68;
  undefined8 local_60;
  longlong *local_58;
  undefined8 local_50;
  longlong local_48;
  undefined8 local_40;
  longlong *local_38;
  undefined8 *puVar10;
  
  if (param_1 != param_2) {
    uVar12 = 0xfffffffffffffffe;
    puVar7 = param_1;
    while (puVar7 = puVar7 + 2, puVar7 != param_2) {
      uVar3 = *puVar7;
      plVar4 = (longlong *)puVar7[1];
      if (plVar4 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
        UNLOCK();
      }
      local_70 = *param_1;
      local_68 = param_1[1];
      if (local_68 != 0) {
        LOCK();
        *(int *)(local_68 + 8) = *(int *)(local_68 + 8) + 1;
        UNLOCK();
      }
      if (plVar4 != (longlong *)0x0) {
        LOCK();
        *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
        UNLOCK();
      }
      local_60 = uVar3;
      local_58 = plVar4;
      cVar8 = FUN_14033e720(&local_60,&local_70);
      puVar9 = puVar7;
      if (cVar8 == '\0') {
        while( true ) {
          puVar10 = puVar9 + -2;
          local_50 = *puVar10;
          local_48 = puVar9[-1];
          if (local_48 != 0) {
            LOCK();
            *(int *)(local_48 + 8) = *(int *)(local_48 + 8) + 1;
            UNLOCK();
          }
          if (plVar4 != (longlong *)0x0) {
            LOCK();
            *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
            UNLOCK();
          }
          local_40 = uVar3;
          local_38 = plVar4;
          cVar8 = FUN_14033e720(&local_40,&local_50);
          if (cVar8 == '\0') break;
          uVar5 = *puVar10;
          lVar6 = puVar9[-1];
          if (lVar6 != 0) {
            LOCK();
            *(int *)(lVar6 + 8) = *(int *)(lVar6 + 8) + 1;
            UNLOCK();
          }
          *puVar9 = uVar5;
          plVar11 = (longlong *)puVar9[1];
          puVar9[1] = lVar6;
          puVar9 = puVar10;
          if (plVar11 != (longlong *)0x0) {
            LOCK();
            plVar1 = plVar11 + 1;
            *(int *)plVar1 = (int)*plVar1 + -1;
            UNLOCK();
            if ((int)*plVar1 == 0) {
              (**(code **)(*plVar11 + 8))(plVar11);
              LOCK();
              piVar2 = (int *)((longlong)plVar11 + 0xc);
              *piVar2 = *piVar2 + -1;
              UNLOCK();
              if (*piVar2 == 0) {
                (**(code **)(*plVar11 + 0x10))(plVar11);
              }
            }
          }
        }
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
          UNLOCK();
        }
        *puVar9 = uVar3;
        plVar11 = (longlong *)puVar9[1];
        puVar9[1] = plVar4;
      }
      else {
        FUN_1402cf550(param_1,puVar7,puVar7 + 2,param_4,uVar12);
        if (plVar4 != (longlong *)0x0) {
          LOCK();
          *(int *)(plVar4 + 1) = (int)plVar4[1] + 1;
          UNLOCK();
        }
        *param_1 = uVar3;
        plVar11 = (longlong *)param_1[1];
        param_1[1] = plVar4;
      }
      if (plVar11 != (longlong *)0x0) {
        LOCK();
        plVar1 = plVar11 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        if ((int)*plVar1 == 0) {
          (**(code **)(*plVar11 + 8))(plVar11);
          LOCK();
          piVar2 = (int *)((longlong)plVar11 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar11 + 0x10))(plVar11);
          }
        }
      }
      if (plVar4 != (longlong *)0x0) {
        LOCK();
        plVar11 = plVar4 + 1;
        *(int *)plVar11 = (int)*plVar11 + -1;
        UNLOCK();
        if ((int)*plVar11 == 0) {
          (**(code **)(*plVar4 + 8))(plVar4);
          LOCK();
          piVar2 = (int *)((longlong)plVar4 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          if (*piVar2 == 0) {
            (**(code **)(*plVar4 + 0x10))();
          }
        }
      }
    }
  }
  return;
}



void FUN_14033f350(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)

{
  undefined8 uVar1;
  char cVar2;
  undefined8 local_68;
  longlong local_60;
  undefined8 local_58;
  longlong local_50;
  undefined8 local_48;
  longlong local_40;
  undefined8 local_38;
  longlong local_30;
  undefined8 local_28;
  longlong local_20;
  undefined8 local_18;
  longlong local_10;
  
  local_68 = *param_1;
  local_60 = param_1[1];
  if (local_60 != 0) {
    LOCK();
    *(int *)(local_60 + 8) = *(int *)(local_60 + 8) + 1;
    UNLOCK();
  }
  local_58 = *param_2;
  local_50 = param_2[1];
  if (local_50 != 0) {
    LOCK();
    *(int *)(local_50 + 8) = *(int *)(local_50 + 8) + 1;
    UNLOCK();
  }
  cVar2 = FUN_14033e720(&local_58,&local_68);
  if (cVar2 != '\0') {
    uVar1 = *param_2;
    *param_2 = *param_1;
    *param_1 = uVar1;
    uVar1 = param_1[1];
    param_1[1] = param_2[1];
    param_2[1] = uVar1;
  }
  local_48 = *param_2;
  local_40 = param_2[1];
  if (local_40 != 0) {
    LOCK();
    *(int *)(local_40 + 8) = *(int *)(local_40 + 8) + 1;
    UNLOCK();
  }
  local_38 = *param_3;
  local_30 = param_3[1];
  if (local_30 != 0) {
    LOCK();
    *(int *)(local_30 + 8) = *(int *)(local_30 + 8) + 1;
    UNLOCK();
  }
  cVar2 = FUN_14033e720(&local_38,&local_48);
  if (cVar2 != '\0') {
    uVar1 = *param_3;
    *param_3 = *param_2;
    *param_2 = uVar1;
    uVar1 = param_2[1];
    param_2[1] = param_3[1];
    param_3[1] = uVar1;
  }
  local_28 = *param_1;
  local_20 = param_1[1];
  if (local_20 != 0) {
    LOCK();
    *(int *)(local_20 + 8) = *(int *)(local_20 + 8) + 1;
    UNLOCK();
  }
  local_18 = *param_2;
  local_10 = param_2[1];
  if (local_10 != 0) {
    LOCK();
    *(int *)(local_10 + 8) = *(int *)(local_10 + 8) + 1;
    UNLOCK();
  }
  cVar2 = FUN_14033e720(&local_18,&local_28);
  if (cVar2 != '\0') {
    uVar1 = *param_2;
    *param_2 = *param_1;
    *param_1 = uVar1;
    uVar1 = param_1[1];
    param_1[1] = param_2[1];
    param_2[1] = uVar1;
  }
  return;
}



void FUN_14033f4b0(longlong param_1,longlong param_2,longlong param_3,undefined8 param_4,
                  undefined1 param_5)

{
  char cVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 local_38;
  longlong local_30;
  undefined8 local_28;
  longlong local_20;
  
  lVar3 = param_2;
  while( true ) {
    lVar2 = lVar3 * 2 + 2;
    if (param_3 <= lVar2) break;
    local_38 = *(undefined8 *)(param_1 + -0x10 + lVar2 * 0x10);
    local_30 = *(longlong *)(param_1 + -8 + lVar2 * 0x10);
    if (local_30 != 0) {
      LOCK();
      *(int *)(local_30 + 8) = *(int *)(local_30 + 8) + 1;
      UNLOCK();
    }
    local_28 = *(undefined8 *)(param_1 + lVar2 * 0x10);
    local_20 = *(longlong *)(param_1 + 8 + lVar2 * 0x10);
    if (local_20 != 0) {
      LOCK();
      *(int *)(local_20 + 8) = *(int *)(local_20 + 8) + 1;
      UNLOCK();
    }
    cVar1 = FUN_14033e720(&local_28,&local_38);
    if (cVar1 != '\0') {
      lVar2 = lVar3 * 2 + 1;
    }
    FUN_140343ec0(param_1 + lVar3 * 0x10,lVar2 * 0x10 + param_1);
    lVar3 = lVar2;
  }
  if (lVar2 == param_3) {
    FUN_140343ec0(param_1 + lVar3 * 0x10,param_1 + -0x10 + param_3 * 0x10);
    lVar3 = param_3 + -1;
  }
  FUN_14033f5d0(param_1,lVar3,param_2,param_4,param_5);
  return;
}



void FUN_14033f5d0(longlong param_1,longlong param_2,longlong param_3,undefined8 *param_4)

{
  longlong *plVar1;
  int *piVar2;
  undefined8 uVar3;
  longlong *plVar4;
  char cVar5;
  undefined8 *puVar6;
  longlong lVar7;
  undefined8 local_38;
  longlong local_30;
  undefined8 local_28;
  longlong local_20;
  
  while (param_3 < param_2) {
    lVar7 = (param_2 + -1) / 2;
    local_30 = param_4[1];
    local_38 = *param_4;
    if (local_30 != 0) {
      LOCK();
      *(int *)(local_30 + 8) = *(int *)(local_30 + 8) + 1;
      UNLOCK();
    }
    puVar6 = (undefined8 *)(lVar7 * 0x10 + param_1);
    local_28 = *puVar6;
    local_20 = puVar6[1];
    if (local_20 != 0) {
      LOCK();
      *(int *)(local_20 + 8) = *(int *)(local_20 + 8) + 1;
      UNLOCK();
    }
    cVar5 = FUN_14033e720(&local_28,&local_38);
    if (cVar5 == '\0') break;
    FUN_140343ec0(param_1 + param_2 * 0x10,puVar6);
    param_2 = lVar7;
  }
  lVar7 = param_4[1];
  uVar3 = *param_4;
  if (lVar7 != 0) {
    LOCK();
    *(int *)(lVar7 + 8) = *(int *)(lVar7 + 8) + 1;
    UNLOCK();
  }
  *(undefined8 *)(param_1 + param_2 * 0x10) = uVar3;
  plVar4 = *(longlong **)(param_1 + 8 + param_2 * 0x10);
  *(longlong *)(param_1 + 8 + param_2 * 0x10) = lVar7;
  if (plVar4 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar4 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*plVar4 + 8))(plVar4);
      LOCK();
      piVar2 = (int *)((longlong)plVar4 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar4 + 0x10))(plVar4);
      }
    }
  }
  return;
}



void FUN_14033f700(longlong param_1,longlong param_2,undefined1 param_3)

{
  int *piVar1;
  longlong *plVar2;
  longlong *plVar3;
  undefined8 local_20;
  longlong *local_18;
  
  local_20 = *(undefined8 *)(param_2 + -0x10);
  plVar2 = *(longlong **)(param_2 + -8);
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
    UNLOCK();
  }
  local_18 = plVar2;
  FUN_140343ec0((undefined8 *)(param_2 + -0x10),param_1);
  FUN_14033f4b0(param_1,0,(param_2 - param_1) + -0x10 >> 4,&local_20,param_3);
  plVar3 = local_18;
  if (plVar2 != (longlong *)0x0) {
    LOCK();
    plVar2 = plVar2 + 1;
    *(int *)plVar2 = (int)*plVar2 + -1;
    UNLOCK();
    if ((int)*plVar2 == 0) {
      (**(code **)(*local_18 + 8))(local_18);
      LOCK();
      piVar1 = (int *)((longlong)plVar3 + 0xc);
      *piVar1 = *piVar1 + -1;
      UNLOCK();
      if (*piVar1 == 0) {
        (**(code **)(*local_18 + 0x10))();
      }
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014033f81f)
// WARNING: Removing unreachable block (ram,0x00014033f828)
// WARNING: Removing unreachable block (ram,0x00014033f846)
// WARNING: Removing unreachable block (ram,0x00014033f84f)

undefined4 * FUN_14033f7b0(undefined4 *param_1)

{
  *param_1 = 0;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  *(undefined8 *)(param_1 + 0xc) = 0;
  *(undefined8 *)(param_1 + 0xe) = 0;
  param_1[0x10] = 0x11;
  param_1[0x18] = 0;
  param_1[0x19] = 10;
  *(undefined8 *)(param_1 + 0x1a) = 0;
  *(undefined8 *)(param_1 + 0x1c) = 0;
  param_1[0x11] = 0x3f400000;
  param_1[0x12] = 0x3e800000;
  param_1[0x13] = 0x40100000;
  *(undefined8 *)(param_1 + 0x14) = 0x26;
  *(undefined8 *)(param_1 + 0x16) = 0;
  return param_1;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_14033f870(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int *piVar2;
  short sVar3;
  undefined4 uVar4;
  uint uVar5;
  undefined4 uVar6;
  longlong lVar7;
  undefined8 *puVar9;
  undefined4 *puVar10;
  short *psVar11;
  wchar_t *pwVar12;
  float *pfVar13;
  short *psVar14;
  ulonglong uVar15;
  longlong *plVar16;
  longlong lVar17;
  wchar_t *pwVar18;
  wchar_t *pwVar19;
  undefined8 *puVar20;
  bool bVar21;
  undefined1 auStack_1578 [32];
  undefined1 local_1558;
  undefined8 *local_1548;
  longlong *local_1540;
  undefined8 *local_1538;
  undefined8 *local_1530;
  longlong local_1520;
  undefined8 local_1518;
  undefined1 local_1510 [16];
  longlong *local_1500;
  undefined1 local_14f8 [4];
  float local_14f4;
  undefined4 local_14f0;
  undefined4 local_14ec;
  undefined4 local_14e8;
  undefined4 local_14e4;
  undefined4 local_14e0;
  undefined8 local_14dc;
  undefined2 local_14d0;
  undefined6 uStack_14ce;
  undefined8 local_14c0;
  ulonglong local_14b8;
  undefined2 local_14a8;
  undefined6 uStack_14a6;
  undefined8 local_1498;
  ulonglong local_1490;
  wchar_t local_1478 [256];
  wchar_t local_1278 [256];
  wchar_t local_1078 [256];
  wchar_t local_e78 [256];
  wchar_t local_c78 [256];
  wchar_t local_a78 [256];
  wchar_t local_878 [256];
  wchar_t local_678 [256];
  wchar_t local_478 [256];
  wchar_t local_278 [256];
  ulonglong local_78;
  undefined8 *puVar8;
  
  local_1518 = 0xfffffffffffffffe;
  local_78 = DAT_1405d84f0 ^ (ulonglong)auStack_1578;
  uVar15 = 0xffffffffffffffff;
  psVar11 = param_2;
  do {
    if (uVar15 == 0) break;
    uVar15 = uVar15 - 1;
    sVar3 = *psVar11;
    psVar11 = psVar11 + 1;
  } while (sVar3 != 0);
  local_1520 = param_1;
  FUN_140001710(param_1 + 8,param_2,~uVar15 - 1);
  lVar7 = FUN_1402933b0(DAT_140607ff0,param_2);
  puVar20 = (undefined8 *)0x0;
  local_1538 = puVar20;
  if ((*(longlong *)(lVar7 + 0x70) != 0) && (*(uint *)(lVar7 + 0x78) != 0)) {
    puVar8 = puVar20;
    plVar16 = *(longlong **)(lVar7 + 0x68);
    do {
      if (*plVar16 != 0) {
        local_1538 = (undefined8 *)(*(longlong **)(lVar7 + 0x68))[(longlong)puVar8];
        break;
      }
      uVar5 = (int)puVar8 + 1;
      puVar8 = (undefined8 *)(ulonglong)uVar5;
      plVar16 = plVar16 + 1;
    } while (uVar5 < *(uint *)(lVar7 + 0x78));
  }
  do {
    do {
      if (local_1538 == (undefined8 *)0x0) {
        return 1;
      }
      uVar4 = *(undefined4 *)local_1538;
      local_1530 = local_1538;
      puVar9 = operator_new(0x100);
      puVar8 = puVar20;
      if (puVar9 != (undefined8 *)0x0) {
        *puVar9 = 0;
        puVar9[1] = 0;
        puVar9[2] = 0;
        puVar9[3] = 0;
        *(undefined4 *)(puVar9 + 4) = 0;
        puVar9[8] = 7;
        puVar9[7] = 0;
        *(undefined2 *)(puVar9 + 5) = 0;
        puVar9[0xd] = 7;
        puVar9[0xc] = 0;
        *(undefined2 *)(puVar9 + 10) = 0;
        puVar9[0x12] = 7;
        puVar9[0x11] = 0;
        *(undefined2 *)(puVar9 + 0xf) = 0;
        puVar9[0x17] = 7;
        puVar9[0x16] = 0;
        *(undefined2 *)(puVar9 + 0x14) = 0;
        puVar9[0x1c] = 0;
        puVar9[0x1d] = 0;
        puVar9[0x1e] = 0;
        puVar8 = puVar9;
      }
      local_1548 = puVar8;
      FUN_1403406b0(&local_1540,puVar8);
      FUN_140178e90(&local_1548,puVar8,puVar8);
      uVar6 = FUN_1402970c0(lVar7,&DAT_14049f290);
      local_1558 = 1;
      puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar4,uVar6,&DAT_14049f290);
      *(undefined4 *)local_1548 = *puVar10;
      uVar6 = FUN_1402970c0(lVar7,L"nLuaTempID");
      local_1558 = 0;
      puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar4,uVar6,L"nLuaTempID");
      if (puVar10 != (undefined4 *)0x0) {
        *(undefined4 *)(local_1548 + 2) = *puVar10;
        uVar6 = FUN_1402970c0(lVar7,L"nLuaTempType");
        local_1558 = 1;
        puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar4,uVar6,L"nLuaTempType");
        *(undefined4 *)((longlong)local_1548 + 0x14) = *puVar10;
      }
      uVar6 = FUN_1402970c0(lVar7,L"nFixDirect");
      local_1558 = 0;
      puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar4,uVar6,L"nFixDirect");
      if (puVar10 != (undefined4 *)0x0) {
        *(undefined4 *)((longlong)local_1548 + 0xc) = *puVar10;
      }
      uVar6 = FUN_1402970c0(lVar7,L"nCameraSet");
      local_1558 = 0;
      puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar4,uVar6,L"nCameraSet");
      if (puVar10 != (undefined4 *)0x0) {
        *(undefined4 *)((longlong)local_1548 + 0x1c) = *puVar10;
      }
      uVar6 = FUN_1402970c0(lVar7,L"nCutOffCancel");
      local_1558 = 0;
      puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar4,uVar6,L"nCutOffCancel");
      if (puVar10 != (undefined4 *)0x0) {
        *(undefined4 *)(local_1548 + 4) = *puVar10;
      }
      uVar6 = FUN_1402970c0(lVar7,L"szTarget01");
      local_1558 = 0;
      psVar11 = (short *)FUN_140296990(lVar7,uVar4,uVar6,L"szTarget01");
      if (psVar11 != (short *)0x0) {
        uVar15 = 0xffffffffffffffff;
        psVar14 = psVar11;
        do {
          if (uVar15 == 0) break;
          uVar15 = uVar15 - 1;
          sVar3 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar3 != 0);
        FUN_140001710(local_1548 + 5,psVar11,~uVar15 - 1);
        if (local_1548[7] != 0) {
          *(undefined4 *)(local_1548 + 1) = 1;
        }
      }
      uVar6 = FUN_1402970c0(lVar7,L"szTarget02");
      local_1558 = 0;
      psVar11 = (short *)FUN_140296990(lVar7,uVar4,uVar6,L"szTarget02");
      if (psVar11 != (short *)0x0) {
        uVar15 = 0xffffffffffffffff;
        psVar14 = psVar11;
        do {
          if (uVar15 == 0) break;
          uVar15 = uVar15 - 1;
          sVar3 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar3 != 0);
        FUN_140001710(local_1548 + 10,psVar11,~uVar15 - 1);
        if (local_1548[0xc] != 0) {
          *(undefined4 *)(local_1548 + 1) = 1;
        }
      }
      uVar6 = FUN_1402970c0(lVar7,L"szUpTarget01");
      local_1558 = 0;
      psVar11 = (short *)FUN_140296990(lVar7,uVar4,uVar6,L"szUpTarget01");
      if (psVar11 != (short *)0x0) {
        uVar15 = 0xffffffffffffffff;
        psVar14 = psVar11;
        do {
          if (uVar15 == 0) break;
          uVar15 = uVar15 - 1;
          sVar3 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar3 != 0);
        FUN_140001710(local_1548 + 0xf,psVar11,~uVar15 - 1);
        if (local_1548[0x11] != 0) {
          *(undefined4 *)(local_1548 + 1) = 1;
        }
      }
      uVar6 = FUN_1402970c0(lVar7,L"szUpTarget02");
      local_1558 = 0;
      psVar11 = (short *)FUN_140296990(lVar7,uVar4,uVar6,L"szUpTarget02");
      if (psVar11 != (short *)0x0) {
        uVar15 = 0xffffffffffffffff;
        psVar14 = psVar11;
        do {
          if (uVar15 == 0) break;
          uVar15 = uVar15 - 1;
          sVar3 = *psVar14;
          psVar14 = psVar14 + 1;
        } while (sVar3 != 0);
        FUN_140001710(local_1548 + 0x14,psVar11,~uVar15 - 1);
        if (local_1548[0x16] != 0) {
          *(undefined4 *)(local_1548 + 1) = 1;
        }
      }
      uVar6 = FUN_1402970c0(lVar7,L"szArmorState");
      local_1558 = 0;
      pwVar12 = (wchar_t *)FUN_140296990(lVar7,uVar4,uVar6,L"szArmorState");
      if (pwVar12 == (wchar_t *)0x0) {
        uVar15 = 0;
        if (local_1540 != (longlong *)0x0) {
          LOCK();
          plVar16 = local_1540 + 1;
          lVar7 = *plVar16;
          *(int *)plVar16 = (int)*plVar16 + -1;
          UNLOCK();
          uVar5 = (int)lVar7 - 1;
          uVar15 = (ulonglong)uVar5;
          if (uVar5 == 0) {
            uVar15 = (**(code **)(*local_1540 + 8))(local_1540);
            LOCK();
            piVar2 = (int *)((longlong)local_1540 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              uVar15 = (**(code **)(*local_1540 + 0x10))(local_1540);
            }
          }
        }
        return uVar15 & 0xffffffffffffff00;
      }
      lVar17 = 0x13;
      bVar21 = false;
      pwVar18 = pwVar12;
      pwVar19 = L"ARMOR_NOT_MATERIAL";
      do {
        if (lVar17 == 0) break;
        lVar17 = lVar17 + -1;
        bVar21 = *pwVar18 == *pwVar19;
        pwVar18 = pwVar18 + 1;
        pwVar19 = pwVar19 + 1;
      } while (bVar21);
      if (bVar21) {
        *(undefined4 *)(local_1548 + 3) = 1;
      }
      else {
        lVar17 = 10;
        pwVar18 = pwVar12;
        pwVar19 = L"ARMOR_GOD";
        do {
          if (lVar17 == 0) break;
          lVar17 = lVar17 + -1;
          bVar21 = *pwVar18 == *pwVar19;
          pwVar18 = pwVar18 + 1;
          pwVar19 = pwVar19 + 1;
        } while (bVar21);
        if (bVar21) {
          *(undefined4 *)(local_1548 + 3) = 3;
        }
        else {
          lVar17 = 0x15;
          pwVar18 = pwVar12;
          pwVar19 = L"ARMOR_GOD_MATERIAL_A";
          do {
            if (lVar17 == 0) break;
            lVar17 = lVar17 + -1;
            bVar21 = *pwVar18 == *pwVar19;
            pwVar18 = pwVar18 + 1;
            pwVar19 = pwVar19 + 1;
          } while (bVar21);
          if (bVar21) {
            *(undefined4 *)(local_1548 + 3) = 4;
          }
          else {
            lVar17 = 0x15;
            pwVar18 = pwVar12;
            pwVar19 = L"ARMOR_GOD_MATERIAL_B";
            do {
              if (lVar17 == 0) break;
              lVar17 = lVar17 + -1;
              bVar21 = *pwVar18 == *pwVar19;
              pwVar18 = pwVar18 + 1;
              pwVar19 = pwVar19 + 1;
            } while (bVar21);
            if (bVar21) {
              *(undefined4 *)(local_1548 + 3) = 5;
            }
            else {
              lVar17 = 0x11;
              pwVar18 = pwVar12;
              pwVar19 = L"ARMOR_MATERIAL_A";
              do {
                if (lVar17 == 0) break;
                lVar17 = lVar17 + -1;
                bVar21 = *pwVar18 == *pwVar19;
                pwVar18 = pwVar18 + 1;
                pwVar19 = pwVar19 + 1;
              } while (bVar21);
              if (bVar21) {
                *(undefined4 *)(local_1548 + 3) = 6;
              }
              else {
                lVar17 = 0x11;
                pwVar18 = pwVar12;
                pwVar19 = L"ARMOR_MATERIAL_B";
                do {
                  if (lVar17 == 0) break;
                  lVar17 = lVar17 + -1;
                  bVar21 = *pwVar18 == *pwVar19;
                  pwVar18 = pwVar18 + 1;
                  pwVar19 = pwVar19 + 1;
                } while (bVar21);
                if (bVar21) {
                  *(undefined4 *)(local_1548 + 3) = 7;
                }
                else {
                  lVar17 = 0x11;
                  pwVar18 = pwVar12;
                  pwVar19 = L"ARMOR_MATERIAL_C";
                  do {
                    if (lVar17 == 0) break;
                    lVar17 = lVar17 + -1;
                    bVar21 = *pwVar18 == *pwVar19;
                    pwVar18 = pwVar18 + 1;
                    pwVar19 = pwVar19 + 1;
                  } while (bVar21);
                  if (bVar21) {
                    *(undefined4 *)(local_1548 + 3) = 8;
                  }
                  else {
                    lVar17 = 0x11;
                    pwVar18 = pwVar12;
                    pwVar19 = L"ARMOR_MATERIAL_D";
                    do {
                      if (lVar17 == 0) break;
                      lVar17 = lVar17 + -1;
                      bVar21 = *pwVar18 == *pwVar19;
                      pwVar18 = pwVar18 + 1;
                      pwVar19 = pwVar19 + 1;
                    } while (bVar21);
                    if (bVar21) {
                      *(undefined4 *)(local_1548 + 3) = 9;
                    }
                    else {
                      lVar17 = 0x13;
                      pwVar18 = pwVar12;
                      pwVar19 = L"ARMOR_MATERIAL_D_A";
                      do {
                        if (lVar17 == 0) break;
                        lVar17 = lVar17 + -1;
                        bVar21 = *pwVar18 == *pwVar19;
                        pwVar18 = pwVar18 + 1;
                        pwVar19 = pwVar19 + 1;
                      } while (bVar21);
                      if (bVar21) {
                        *(undefined4 *)(local_1548 + 3) = 10;
                      }
                      else {
                        lVar17 = 0x13;
                        pwVar18 = L"ARMOR_MATERIAL_D_B";
                        do {
                          if (lVar17 == 0) break;
                          lVar17 = lVar17 + -1;
                          bVar21 = *pwVar12 == *pwVar18;
                          pwVar12 = pwVar12 + 1;
                          pwVar18 = pwVar18 + 1;
                        } while (bVar21);
                        if (bVar21) {
                          *(undefined4 *)(local_1548 + 3) = 0xb;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      lVar17 = 4;
      do {
        swprintf_s(local_1078,0x100,L"fPriority%02d");
        uVar6 = FUN_1402970c0(lVar7,local_1078);
        local_1558 = 0;
        pfVar13 = (float *)FUN_1402967b0(lVar7,uVar4,uVar6,local_1078);
        if (pfVar13 != (float *)0x0) {
          swprintf_s(local_c78,0x100,L"fNearDist%02d");
          swprintf_s(local_478,0x100,L"fFarDist%02d");
          swprintf_s(local_1278,0x100,L"fRange%02d");
          swprintf_s(local_e78,0x100,L"fDelay%02d");
          swprintf_s(local_a78,0x100,L"szMotion%02d");
          swprintf_s(local_1478,0x100,L"szBox%02d");
          swprintf_s(local_678,0x100,L"nAttackFeatureID%02d");
          swprintf_s(local_278,0x100,L"fWarpDelay%02d");
          local_14f8[0] = 0;
          local_14f0 = 0;
          local_14ec = 0;
          local_14e8 = 0;
          local_14e4 = 0;
          local_14e0 = 0x3f800000;
          local_14dc = 0;
          local_14b8 = 7;
          local_14c0 = 0;
          local_14d0 = 0;
          local_1490 = 7;
          local_1498 = 0;
          local_14a8 = 0;
          local_14f4 = *pfVar13;
          if (0.0001 < local_14f4) {
            uVar6 = FUN_1402970c0(lVar7,local_1478);
            local_1558 = 0;
            psVar11 = (short *)FUN_140296990(lVar7,uVar4,uVar6,local_1478);
            if (psVar11 != (short *)0x0) {
              uVar15 = 0xffffffffffffffff;
              psVar14 = psVar11;
              do {
                if (uVar15 == 0) break;
                uVar15 = uVar15 - 1;
                sVar3 = *psVar14;
                psVar14 = psVar14 + 1;
              } while (sVar3 != 0);
              FUN_140001710(&local_14a8,psVar11,~uVar15 - 1);
              swprintf_s(local_878,0x100,L"nBoxType%02d");
              uVar6 = FUN_1402970c0(lVar7,local_878);
              local_1558 = 0;
              puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar4,uVar6,local_878);
              if (puVar10 != (undefined4 *)0x0) {
                local_14dc = CONCAT44(*puVar10,(undefined4)local_14dc);
              }
            }
            uVar6 = FUN_1402970c0(lVar7,local_c78);
            local_1558 = 1;
            puVar10 = (undefined4 *)FUN_1402967b0(lVar7,uVar4,uVar6,local_c78);
            local_14f0 = *puVar10;
            uVar6 = FUN_1402970c0(lVar7,local_478);
            local_1558 = 1;
            puVar10 = (undefined4 *)FUN_1402967b0(lVar7,uVar4,uVar6,local_478);
            local_14ec = *puVar10;
            uVar6 = FUN_1402970c0(lVar7,local_1278);
            local_1558 = 1;
            puVar10 = (undefined4 *)FUN_1402967b0(lVar7,uVar4,uVar6,local_1278);
            local_14e8 = *puVar10;
            uVar6 = FUN_1402970c0(lVar7,local_e78);
            local_1558 = 1;
            puVar10 = (undefined4 *)FUN_1402967b0(lVar7,uVar4,uVar6,local_e78);
            local_14e4 = *puVar10;
            uVar6 = FUN_1402970c0(lVar7,local_a78);
            local_1558 = 1;
            psVar14 = (short *)FUN_140296990(lVar7,uVar4,uVar6,local_a78);
            uVar15 = 0xffffffffffffffff;
            psVar11 = psVar14;
            do {
              if (uVar15 == 0) break;
              uVar15 = uVar15 - 1;
              sVar3 = *psVar11;
              psVar11 = psVar11 + 1;
            } while (sVar3 != 0);
            FUN_140001710(&local_14d0,psVar14,~uVar15 - 1);
            uVar6 = FUN_1402970c0(lVar7,local_678);
            local_1558 = 1;
            puVar10 = (undefined4 *)FUN_140296600(lVar7,uVar4,uVar6,local_678);
            local_14dc = CONCAT44(local_14dc._4_4_,*puVar10);
            uVar6 = FUN_1402970c0(lVar7,local_278);
            local_1558 = 0;
            puVar10 = (undefined4 *)FUN_1402967b0(lVar7,uVar4,uVar6,local_278);
            if (puVar10 != (undefined4 *)0x0) {
              local_14e0 = *puVar10;
            }
            FUN_1403403e0(local_1548 + 0x1c,local_14f8);
            if (7 < local_1490) {
              operator_delete((void *)CONCAT62(uStack_14a6,local_14a8));
            }
            local_1490 = 7;
            local_1498 = 0;
            local_14a8 = 0;
            if (7 < local_14b8) {
              operator_delete((void *)CONCAT62(uStack_14ce,local_14d0));
            }
          }
        }
        lVar17 = lVar17 + -1;
      } while (lVar17 != 0);
      puVar10 = (undefined4 *)FUN_140342d30(local_1510,local_1548,&local_1548);
      FUN_14030e3c0(local_1520 + 0x30,*puVar10,puVar10 + 2);
      plVar16 = local_1500;
      puVar8 = local_1538;
      if (local_1500 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_1500 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar8 = local_1530;
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_1500 + 8))(local_1500);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar8 = local_1530;
          if (*piVar2 == 0) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar8 = local_1530;
          }
        }
      }
      plVar16 = local_1540;
      if (local_1540 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_1540 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar8 = local_1530;
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_1540 + 8))(local_1540);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar8 = local_1530;
          if (*piVar2 == 0) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar8 = local_1530;
          }
        }
      }
      local_1538 = (undefined8 *)puVar8[3];
    } while (local_1538 != (undefined8 *)0x0);
    uVar5 = *(uint *)(puVar8 + 4) % *(uint *)(lVar7 + 0x78) + 1;
    lVar17 = (longlong)(int)uVar5 << 3;
    local_1538 = puVar20;
    do {
      if (*(uint *)(lVar7 + 0x78) <= uVar5) break;
      if (*(longlong *)(lVar17 + *(longlong *)(lVar7 + 0x68)) != 0) {
        local_1538 = *(undefined8 **)(lVar17 + *(longlong *)(lVar7 + 0x68));
      }
      uVar5 = uVar5 + 1;
      lVar17 = lVar17 + 8;
    } while (local_1538 == (undefined8 *)0x0);
  } while( true );
}



void FUN_1403403e0(ulonglong *param_1,ulonglong param_2,undefined8 param_3,undefined8 param_4)

{
  ulonglong uVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = param_1[1];
  if ((param_2 < uVar1) && (*param_1 <= param_2)) {
    lVar2 = param_2 - *param_1;
    lVar2 = lVar2 + SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar2),8);
    if (uVar1 == param_1[2]) {
      FUN_1403404b0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140340720(param_1[1],((lVar2 >> 6) - (lVar2 >> 0x3f)) * 0x78 + *param_1,param_3,param_4,
                    uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_1403404b0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140340720(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x78;
  return;
}



void FUN_1403404b0(longlong *param_1)

{
  code *pcVar1;
  ulonglong uVar2;
  longlong lVar3;
  ulonglong uVar4;
  
  lVar3 = param_1[1] - *param_1;
  lVar3 = lVar3 + SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar3),8);
  uVar4 = (lVar3 >> 6) - (lVar3 >> 0x3f);
  if (0x222222222222221 < uVar4) {
    std::_Xlength_error("vector<T> too long");
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  uVar4 = uVar4 + 1;
  lVar3 = param_1[2] - *param_1;
  lVar3 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar3),8) + lVar3;
  uVar2 = (lVar3 >> 6) - (lVar3 >> 0x3f);
  if (uVar2 < uVar4) {
    if (0x222222222222222 - (uVar2 >> 1) < uVar2) {
      uVar2 = 0;
    }
    else {
      uVar2 = uVar2 + (uVar2 >> 1);
    }
    if (uVar2 < uVar4) {
      uVar2 = uVar4;
    }
    FUN_140340560(param_1,uVar2);
  }
  return;
}



void FUN_140340560(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 (0x222222222222222 < param_2) {
    std::_Xlength_error("vector<T> too long");
    pcVar3 = (code *)swi(3);
    (*pcVar3)();
    return;
  }
  lVar5 = SUB168(SEXT816(-0x7777777777777777) * SEXT816(param_1[2] - *param_1),8) +
          (param_1[2] - *param_1);
  if ((ulonglong)((lVar5 >> 6) - (lVar5 >> 0x3f)) < param_2) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x78);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140340810(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    lVar6 = lVar1 - lVar2;
    lVar5 = lVar6 + SUB168(SEXT816(-0x7777777777777777) * SEXT816(lVar6),8);
    if (lVar2 != 0) {
      FUN_1403409c0(lVar2,lVar1,lVar6,lVar1,uVar7);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x78);
    param_1[1] = (longlong)(pcVar4 + ((lVar5 >> 6) - (lVar5 >> 0x3f)) * 0x78);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



undefined8 * FUN_1403406b0(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;
}



undefined1 * FUN_140340720(undefined1 *param_1,undefined1 *param_2)

{
  *param_1 = *param_2;
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined8 *)(param_1 + 0x40) = 7;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined2 *)(param_1 + 0x28) = 0;
  FUN_1400015e0(param_1 + 0x28,param_2 + 0x28,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x68) = 7;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined2 *)(param_1 + 0x50) = 0;
  FUN_1400015e0(param_1 + 0x50,param_2 + 0x50,0,0xffffffffffffffff);
  return param_1;
}



void FUN_1403407e0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_140340870(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



longlong FUN_140340810(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x78) {
    if (param_3 != 0) {
      FUN_140340720(param_3,param_1);
    }
    param_3 = param_3 + 0x78;
  }
  return param_3;
}



void FUN_140340870(longlong param_1)

{
  if (*(longlong *)(param_1 + 0xe0) != 0) {
    FUN_1403409c0(*(longlong *)(param_1 + 0xe0),*(undefined8 *)(param_1 + 0xe8));
    operator_delete(*(void **)(param_1 + 0xe0));
  }
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined8 *)(param_1 + 0xf0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xb8)) {
    operator_delete(*(void **)(param_1 + 0xa0));
  }
  *(undefined8 *)(param_1 + 0xb8) = 7;
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined2 *)(param_1 + 0xa0) = 0;
  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;
}



void FUN_140340960(longlong param_1)

{
  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;
}



void FUN_1403409c0(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 0xd;
    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 + 0xf;
    } while (puVar1 != param_2);
  }
  return;
}



void FUN_140340a40(longlong param_1,float *param_2,float *param_3,float *param_4)

{
  float fVar1;
  float fVar2;
  float *pfVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  
  if (*(int *)(param_1 + 4) == 0) {
    fVar6 = param_3[1];
    fVar1 = param_4[1];
    fVar4 = param_3[2];
    fVar5 = param_4[2];
    *param_2 = *param_3 - *param_4;
    param_2[1] = fVar6 - fVar1;
    param_2[2] = fVar4 - fVar5;
  }
  else if (*(int *)(param_1 + 4) == 1) {
    pfVar3 = *(float **)(param_1 + 0x100);
    fVar6 = 0.0;
    if (pfVar3 != *(float **)(param_1 + 0x108)) {
      do {
        fVar1 = pfVar3[2];
        fVar4 = *pfVar3 - *param_4;
        fVar5 = fVar1 - param_4[2];
        fVar4 = fVar5 * fVar5 + fVar4 * fVar4;
        if (fVar6 < fVar4) {
          fVar6 = param_3[1];
          fVar5 = pfVar3[1];
          fVar2 = param_3[2];
          *param_2 = *param_3 - *pfVar3;
          param_2[1] = fVar6 - fVar5;
          param_2[2] = fVar2 - fVar1;
          param_2[1] = param_3[1];
          fVar6 = fVar4;
        }
        pfVar3 = pfVar3 + 0xe;
      } while (pfVar3 != *(float **)(param_1 + 0x108));
      return;
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140340bc3)
// WARNING: Removing unreachable block (ram,0x000140340bcc)
// WARNING: Removing unreachable block (ram,0x000140340bea)
// WARNING: Removing unreachable block (ram,0x000140340bf3)

undefined1 * FUN_140340b50(undefined1 *param_1)

{
  *param_1 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x40) = 0x11;
  *(undefined4 *)(param_1 + 0x60) = 0;
  *(undefined4 *)(param_1 + 100) = 10;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined4 *)(param_1 + 0x44) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x48) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x4c) = 0x40100000;
  *(undefined8 *)(param_1 + 0x50) = 0x26;
  *(undefined8 *)(param_1 + 0x58) = 0;
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140340c10(longlong param_1,short *param_2)

{
  longlong *plVar1;
  short sVar2;
  int *piVar3;
  int *piVar4;
  code *pcVar5;
  uint uVar6;
  undefined4 uVar7;
  int iVar8;
  longlong lVar9;
  undefined8 *puVar11;
  undefined4 *puVar12;
  short *psVar13;
  wchar_t *pwVar14;
  short *psVar15;
  undefined8 uVar16;
  ulonglong uVar17;
  longlong *plVar18;
  undefined8 *puVar19;
  longlong lVar20;
  wchar_t *pwVar21;
  undefined8 *puVar22;
  undefined2 *puVar23;
  undefined8 *puVar24;
  undefined8 *puVar25;
  wchar_t *pwVar26;
  short *psVar27;
  undefined4 uVar28;
  bool bVar29;
  undefined1 auStack_3b8 [32];
  undefined1 local_398;
  undefined8 *local_388;
  longlong *local_380;
  int local_378;
  int local_374;
  undefined8 *local_370;
  longlong local_368;
  undefined4 local_360;
  undefined8 *local_358;
  wchar_t *local_348;
  wchar_t *local_340;
  undefined8 local_338;
  longlong local_328;
  wchar_t *local_320;
  wchar_t *local_318;
  undefined8 local_310;
  undefined8 local_300;
  undefined1 local_2f8 [16];
  longlong *local_2e8;
  undefined2 local_2e0;
  undefined6 uStack_2de;
  undefined8 local_2d0;
  ulonglong local_2c8;
  undefined2 local_2b8;
  undefined6 uStack_2b6;
  undefined8 local_2a8;
  ulonglong local_2a0;
  undefined1 local_290 [4];
  undefined4 local_28c;
  undefined2 local_280;
  undefined6 uStack_27e;
  undefined8 local_270;
  ulonglong local_268;
  undefined1 local_258 [512];
  ulonglong local_58;
  undefined8 *puVar10;
  
  local_300 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_3b8;
  uVar17 = 0xffffffffffffffff;
  psVar15 = param_2;
  do {
    if (uVar17 == 0) break;
    uVar17 = uVar17 - 1;
    sVar2 = *psVar15;
    psVar15 = psVar15 + 1;
  } while (sVar2 != 0);
  local_328 = param_1;
  FUN_140001710(param_1 + 8,param_2,~uVar17 - 1);
  lVar9 = FUN_1402933b0(DAT_140607ff0,param_2);
  puVar25 = (undefined8 *)0x0;
  local_370 = puVar25;
  if ((*(longlong *)(lVar9 + 0x70) != 0) && (*(uint *)(lVar9 + 0x78) != 0)) {
    puVar10 = puVar25;
    plVar18 = *(longlong **)(lVar9 + 0x68);
    do {
      if (*plVar18 != 0) {
        local_370 = (undefined8 *)(*(longlong **)(lVar9 + 0x68))[(longlong)puVar10];
        break;
      }
      uVar6 = (int)puVar10 + 1;
      puVar10 = (undefined8 *)(ulonglong)uVar6;
      plVar18 = plVar18 + 1;
    } while (uVar6 < *(uint *)(lVar9 + 0x78));
  }
  do {
    do {
      if (local_370 == (undefined8 *)0x0) {
        return 1;
      }
      uVar28 = *(undefined4 *)local_370;
      local_360 = uVar28;
      local_358 = local_370;
      puVar11 = operator_new(0x120);
      puVar10 = puVar25;
      if (puVar11 != (undefined8 *)0x0) {
        *puVar11 = 0;
        puVar11[1] = 0;
        puVar11[2] = 0;
        *(undefined4 *)(puVar11 + 3) = 0;
        puVar11[7] = 7;
        puVar11[6] = 0;
        *(undefined2 *)(puVar11 + 4) = 0;
        puVar11[0xc] = 7;
        puVar11[0xb] = 0;
        *(undefined2 *)(puVar11 + 9) = 0;
        puVar11[0x11] = 7;
        puVar11[0x10] = 0;
        *(undefined2 *)(puVar11 + 0xe) = 0;
        puVar11[0x16] = 7;
        puVar11[0x15] = 0;
        *(undefined2 *)(puVar11 + 0x13) = 0;
        puVar11[0x18] = 0;
        puVar11[0x19] = 0;
        puVar11[0x1a] = 0;
        puVar11[0x1c] = 0;
        puVar11[0x1d] = 0;
        puVar11[0x1e] = 0;
        puVar11[0x20] = 0;
        puVar11[0x21] = 0;
        puVar11[0x22] = 0;
        puVar10 = puVar11;
      }
      local_388 = puVar10;
      FUN_140341d70(&local_380,puVar10);
      FUN_140178e90(&local_388,puVar10,puVar10);
      uVar7 = FUN_1402970c0(lVar9,&DAT_14049f290);
      local_398 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar9,uVar28,uVar7,&DAT_14049f290);
      *(undefined4 *)local_388 = *puVar12;
      uVar7 = FUN_1402970c0(lVar9,L"nCount");
      local_398 = 1;
      puVar12 = (undefined4 *)FUN_140296600(lVar9,uVar28,uVar7,L"nCount");
      *(undefined4 *)(local_388 + 1) = *puVar12;
      uVar7 = FUN_1402970c0(lVar9,L"szStart");
      local_398 = 1;
      psVar13 = (short *)FUN_140296990(lVar9,uVar28,uVar7,L"szStart");
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_388 + 4,psVar13,~uVar17 - 1);
      uVar7 = FUN_1402970c0(lVar9,L"szPlay");
      local_398 = 1;
      psVar13 = (short *)FUN_140296990(lVar9,uVar28,uVar7,L"szPlay");
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_388 + 9,psVar13,~uVar17 - 1);
      uVar7 = FUN_1402970c0(lVar9,L"szEnd");
      local_398 = 1;
      psVar13 = (short *)FUN_140296990(lVar9,uVar28,uVar7,L"szEnd");
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_388 + 0xe,psVar13,~uVar17 - 1);
      uVar7 = FUN_1402970c0(lVar9,L"szFinish");
      local_398 = 1;
      psVar13 = (short *)FUN_140296990(lVar9,uVar28,uVar7,L"szFinish");
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(local_388 + 0x13,psVar13,~uVar17 - 1);
      uVar7 = FUN_1402970c0(lVar9,L"fRange");
      local_398 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar9,uVar28,uVar7,L"fRange");
      *(undefined4 *)(local_388 + 2) = *puVar12;
      uVar7 = FUN_1402970c0(lVar9,L"fDelay");
      local_398 = 1;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar9,uVar28,uVar7,L"fDelay");
      *(undefined4 *)((longlong)local_388 + 0x14) = *puVar12;
      uVar7 = FUN_1402970c0(lVar9,L"fAngle");
      local_398 = 0;
      puVar12 = (undefined4 *)FUN_1402967b0(lVar9,uVar28,uVar7,L"fAngle");
      if (puVar12 != (undefined4 *)0x0) {
        *(undefined4 *)(local_388 + 3) = *puVar12;
      }
      uVar7 = FUN_1402970c0(lVar9,L"nCameraSet");
      local_398 = 0;
      puVar12 = (undefined4 *)FUN_140296600(lVar9,uVar28,uVar7,L"nCameraSet");
      if (puVar12 != (undefined4 *)0x0) {
        *(undefined4 *)((longlong)local_388 + 0xc) = *puVar12;
        uVar7 = FUN_1402970c0(lVar9,L"szFeatureID");
        local_398 = 1;
        psVar13 = (short *)FUN_140296990(lVar9,uVar28,uVar7,L"szFeatureID");
        local_2a0 = 7;
        local_2a8 = 0;
        local_2b8 = 0;
        uVar17 = 0xffffffffffffffff;
        psVar15 = psVar13;
        do {
          if (uVar17 == 0) break;
          uVar17 = uVar17 - 1;
          sVar2 = *psVar15;
          psVar15 = psVar15 + 1;
        } while (sVar2 != 0);
        FUN_140001710(&local_2b8,psVar13,~uVar17 - 1);
        local_320 = (wchar_t *)0x0;
        local_318 = (wchar_t *)0x0;
        local_310 = 0;
        puVar23 = &local_2b8;
        if (7 < local_2a0) {
          puVar23 = (undefined2 *)CONCAT62(uStack_2b6,local_2b8);
        }
        FUN_140415930(&local_320,puVar23,&DAT_14049c7b8);
        pwVar21 = local_318;
        pwVar14 = local_320;
        lVar20 = ((longlong)local_318 - (longlong)local_320) / 0x28;
        local_368 = lVar20;
        FUN_140051e60(local_388 + 0x1c,lVar20);
        pwVar26 = pwVar14;
        puVar10 = puVar25;
        if (0 < (int)lVar20) {
          do {
            pwVar21 = pwVar14;
            if (7 < *(ulonglong *)(pwVar14 + 0xc)) {
              pwVar21 = *(wchar_t **)pwVar14;
            }
            iVar8 = _wtoi(pwVar21);
            puVar11 = local_388;
            piVar3 = (int *)local_388[0x1d];
            local_378 = iVar8;
            if ((&local_378 < piVar3) && (piVar4 = (int *)local_388[0x1c], piVar4 <= &local_378)) {
              if (piVar3 == (int *)local_388[0x1e]) {
                uVar17 = (longlong)piVar3 - (longlong)piVar4 >> 2;
                if (0x3ffffffffffffffe < uVar17) {
                  std::_Xlength_error("vector<T> too long");
                  pcVar5 = (code *)swi(3);
                  uVar16 = (*pcVar5)();
                  return uVar16;
                }
                puVar19 = (undefined8 *)(uVar17 + 1);
                puVar22 = (undefined8 *)((longlong)local_388[0x1e] - (longlong)piVar4 >> 2);
                if (puVar22 < puVar19) {
                  puVar24 = puVar25;
                  if (puVar22 <= (undefined8 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                    puVar24 = (undefined8 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                  }
                  if (puVar24 < puVar19) {
                    puVar24 = puVar19;
                  }
                  FUN_140051e60(local_388 + 0x1c,puVar24);
                }
              }
              if ((undefined4 *)puVar11[0x1d] != (undefined4 *)0x0) {
                *(undefined4 *)puVar11[0x1d] =
                     *(undefined4 *)
                      (puVar11[0x1c] + ((longlong)&local_378 - (longlong)piVar4 >> 2) * 4);
              }
            }
            else {
              if (piVar3 == (int *)local_388[0x1e]) {
                uVar17 = (longlong)piVar3 - local_388[0x1c] >> 2;
                if (0x3ffffffffffffffe < uVar17) {
                  std::_Xlength_error("vector<T> too long");
                  goto LAB_140341803;
                }
                puVar19 = (undefined8 *)(uVar17 + 1);
                puVar22 = (undefined8 *)((longlong)local_388[0x1e] - local_388[0x1c] >> 2);
                if (puVar22 < puVar19) {
                  puVar24 = puVar25;
                  if (puVar22 <= (undefined8 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                    puVar24 = (undefined8 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                  }
                  if (puVar24 < puVar19) {
                    puVar24 = puVar19;
                  }
                  FUN_140051e60(local_388 + 0x1c,puVar24);
                }
              }
              if ((int *)puVar11[0x1d] != (int *)0x0) {
                *(int *)puVar11[0x1d] = iVar8;
              }
            }
            puVar11[0x1d] = puVar11[0x1d] + 4;
            uVar6 = (int)puVar10 + 1;
            puVar10 = (undefined8 *)(ulonglong)uVar6;
            pwVar14 = pwVar14 + 0x14;
            pwVar21 = local_318;
            pwVar26 = local_320;
            uVar28 = local_360;
          } while ((int)uVar6 < (int)local_368);
        }
        pwVar14 = pwVar26;
        if (pwVar26 != (wchar_t *)0x0) {
          for (; pwVar14 != pwVar21; pwVar14 = pwVar14 + 0x14) {
            if (7 < *(ulonglong *)(pwVar14 + 0xc)) {
              operator_delete(*(void **)pwVar14);
            }
            pwVar14[0xc] = L'\a';
            pwVar14[0xd] = L'\0';
            pwVar14[0xe] = L'\0';
            pwVar14[0xf] = L'\0';
            pwVar14[8] = L'\0';
            pwVar14[9] = L'\0';
            pwVar14[10] = L'\0';
            pwVar14[0xb] = L'\0';
            *pwVar14 = L'\0';
          }
          operator_delete(pwVar26);
        }
        if (7 < local_2a0) {
          operator_delete((void *)CONCAT62(uStack_2b6,local_2b8));
        }
      }
      uVar7 = FUN_1402970c0(lVar9,L"szType");
      local_398 = 0;
      pwVar14 = (wchar_t *)FUN_140296990(lVar9,uVar28,uVar7,L"szType");
      bVar29 = pwVar14 == (wchar_t *)0x0;
      if (!bVar29) {
        lVar20 = 0xd;
        pwVar21 = pwVar14;
        pwVar26 = L"TARGET_ENEMY";
        do {
          if (lVar20 == 0) break;
          lVar20 = lVar20 + -1;
          bVar29 = *pwVar21 == *pwVar26;
          pwVar21 = pwVar21 + 1;
          pwVar26 = pwVar26 + 1;
        } while (bVar29);
        if (bVar29) {
          *(undefined4 *)((longlong)local_388 + 4) = 0;
        }
        else {
          lVar20 = 0xb;
          pwVar21 = pwVar14;
          pwVar26 = L"TARGET_BOX";
          do {
            if (lVar20 == 0) break;
            lVar20 = lVar20 + -1;
            bVar29 = *pwVar21 == *pwVar26;
            pwVar21 = pwVar21 + 1;
            pwVar26 = pwVar26 + 1;
          } while (bVar29);
          if (bVar29) {
            *(undefined4 *)((longlong)local_388 + 4) = 1;
          }
          else {
            lVar20 = 0xd;
            pwVar21 = L"TARGET_RANGE";
            do {
              if (lVar20 == 0) break;
              lVar20 = lVar20 + -1;
              bVar29 = *pwVar14 == *pwVar21;
              pwVar14 = pwVar14 + 1;
              pwVar21 = pwVar21 + 1;
            } while (bVar29);
            if (bVar29) {
              *(undefined4 *)((longlong)local_388 + 4) = 2;
            }
          }
        }
      }
      FUN_140341a40(local_388 + 0x20,4);
      puVar10 = puVar25;
      do {
        uVar6 = (int)puVar10 + 1;
        puVar10 = (undefined8 *)(ulonglong)uVar6;
        FUN_14012f380(local_258,L"szPoint%02d",puVar10);
        uVar7 = FUN_1402970c0(lVar9,local_258);
        local_398 = 0;
        psVar15 = (short *)FUN_140296990(lVar9,uVar28,uVar7,local_258);
        bVar29 = *(int *)((longlong)local_388 + 4) == 0;
        if (!bVar29) {
          lVar20 = 1;
          psVar13 = psVar15;
          psVar27 = &DAT_140477960;
          do {
            if (lVar20 == 0) break;
            lVar20 = lVar20 + -1;
            bVar29 = *psVar13 == *psVar27;
            psVar13 = psVar13 + 1;
            psVar27 = psVar27 + 1;
          } while (bVar29);
          if (!bVar29) {
            local_268 = 7;
            local_270 = 0;
            local_280 = 0;
            uVar17 = 0xffffffffffffffff;
            psVar13 = psVar15;
            do {
              if (uVar17 == 0) break;
              uVar17 = uVar17 - 1;
              sVar2 = *psVar13;
              psVar13 = psVar13 + 1;
            } while (sVar2 != 0);
            FUN_140001710(&local_280,psVar15,~uVar17 - 1);
            local_28c = 0;
            FUN_140341b90(local_388 + 0x20,local_290);
            if (7 < local_268) {
              operator_delete((void *)CONCAT62(uStack_27e,local_280));
            }
          }
        }
      } while ((int)uVar6 < 4);
      uVar7 = FUN_1402970c0(lVar9,L"szRandID");
      local_398 = 1;
      psVar13 = (short *)FUN_140296990(lVar9,uVar28,uVar7,L"szRandID");
      local_2c8 = 7;
      local_2d0 = 0;
      local_2e0 = 0;
      uVar17 = 0xffffffffffffffff;
      psVar15 = psVar13;
      do {
        if (uVar17 == 0) break;
        uVar17 = uVar17 - 1;
        sVar2 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_2e0,psVar13,~uVar17 - 1);
      local_348 = (wchar_t *)0x0;
      local_340 = (wchar_t *)0x0;
      local_338 = 0;
      puVar23 = &local_2e0;
      if (7 < local_2c8) {
        puVar23 = (undefined2 *)CONCAT62(uStack_2de,local_2e0);
      }
      FUN_140415930(&local_348,puVar23,&DAT_14049c7b8);
      pwVar14 = local_348;
      lVar20 = ((longlong)local_340 - (longlong)local_348) / 0x28;
      local_368 = lVar20;
      FUN_140051e60(local_388 + 0x18,lVar20);
      puVar10 = puVar25;
      if (0 < (int)lVar20) {
        do {
          pwVar21 = pwVar14;
          if (7 < *(ulonglong *)(pwVar14 + 0xc)) {
            pwVar21 = *(wchar_t **)pwVar14;
          }
          iVar8 = _wtoi(pwVar21);
          puVar11 = local_388;
          piVar3 = (int *)local_388[0x19];
          local_374 = iVar8;
          if ((&local_374 < piVar3) && (piVar4 = (int *)local_388[0x18], piVar4 <= &local_374)) {
            if (piVar3 == (int *)local_388[0x1a]) {
              uVar17 = (longlong)piVar3 - (longlong)piVar4 >> 2;
              if (0x3ffffffffffffffe < uVar17) {
LAB_140341803:
                std::_Xlength_error("vector<T> too long");
                pcVar5 = (code *)swi(3);
                uVar16 = (*pcVar5)();
                return uVar16;
              }
              puVar19 = (undefined8 *)(uVar17 + 1);
              puVar22 = (undefined8 *)((longlong)local_388[0x1a] - (longlong)piVar4 >> 2);
              if (puVar22 < puVar19) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined8 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined8 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar19) {
                  puVar24 = puVar19;
                }
                FUN_140051e60(local_388 + 0x18,puVar24);
              }
            }
            if ((undefined4 *)puVar11[0x19] != (undefined4 *)0x0) {
              *(undefined4 *)puVar11[0x19] =
                   *(undefined4 *)
                    (puVar11[0x18] + ((longlong)&local_374 - (longlong)piVar4 >> 2) * 4);
            }
          }
          else {
            if (piVar3 == (int *)local_388[0x1a]) {
              uVar17 = (longlong)piVar3 - local_388[0x18] >> 2;
              if (0x3ffffffffffffffe < uVar17) {
                std::_Xlength_error("vector<T> too long");
                return 1;
              }
              puVar19 = (undefined8 *)(uVar17 + 1);
              puVar22 = (undefined8 *)((longlong)local_388[0x1a] - local_388[0x18] >> 2);
              if (puVar22 < puVar19) {
                puVar24 = puVar25;
                if (puVar22 <= (undefined8 *)(0x3fffffffffffffff - ((ulonglong)puVar22 >> 1))) {
                  puVar24 = (undefined8 *)((longlong)puVar22 + ((ulonglong)puVar22 >> 1));
                }
                if (puVar24 < puVar19) {
                  puVar24 = puVar19;
                }
                FUN_140051e60(local_388 + 0x18,puVar24);
              }
            }
            if ((int *)puVar11[0x19] != (int *)0x0) {
              *(int *)puVar11[0x19] = iVar8;
            }
          }
          puVar11[0x19] = puVar11[0x19] + 4;
          uVar6 = (int)puVar10 + 1;
          pwVar14 = pwVar14 + 0x14;
          puVar10 = (undefined8 *)(ulonglong)uVar6;
        } while ((int)uVar6 < (int)local_368);
      }
      puVar12 = (undefined4 *)FUN_140342d30(local_2f8,local_388,&local_388);
      FUN_14030e3c0(local_328 + 0x30,*puVar12,puVar12 + 2);
      plVar18 = local_2e8;
      puVar10 = local_370;
      if (local_2e8 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_2e8 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar10 = local_358;
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_2e8 + 8))(local_2e8);
          LOCK();
          piVar3 = (int *)((longlong)plVar18 + 0xc);
          *piVar3 = *piVar3 + -1;
          UNLOCK();
          puVar10 = local_358;
          if (*piVar3 == 0) {
            (**(code **)(*plVar18 + 0x10))(plVar18);
            puVar10 = local_358;
          }
        }
      }
      pwVar26 = local_340;
      pwVar21 = local_348;
      pwVar14 = local_348;
      if (local_348 != (wchar_t *)0x0) {
        for (; pwVar14 != pwVar26; pwVar14 = pwVar14 + 0x14) {
          if (7 < *(ulonglong *)(pwVar14 + 0xc)) {
            operator_delete(*(void **)pwVar14);
          }
          pwVar14[0xc] = L'\a';
          pwVar14[0xd] = L'\0';
          pwVar14[0xe] = L'\0';
          pwVar14[0xf] = L'\0';
          pwVar14[8] = L'\0';
          pwVar14[9] = L'\0';
          pwVar14[10] = L'\0';
          pwVar14[0xb] = L'\0';
          *pwVar14 = L'\0';
        }
        operator_delete(pwVar21);
      }
      if (7 < local_2c8) {
        operator_delete((void *)CONCAT62(uStack_2de,local_2e0));
      }
      plVar18 = local_380;
      local_2c8 = 7;
      local_2d0 = 0;
      local_2e0 = 0;
      if (local_380 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_380 + 1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar10 = local_358;
        if ((int)*plVar1 == 0) {
          (**(code **)(*local_380 + 8))(local_380);
          LOCK();
          piVar3 = (int *)((longlong)plVar18 + 0xc);
          *piVar3 = *piVar3 + -1;
          UNLOCK();
          puVar10 = local_358;
          if (*piVar3 == 0) {
            (**(code **)(*plVar18 + 0x10))(plVar18);
            puVar10 = local_358;
          }
        }
      }
      local_370 = (undefined8 *)puVar10[3];
    } while (local_370 != (undefined8 *)0x0);
    uVar6 = *(uint *)(puVar10 + 4) % *(uint *)(lVar9 + 0x78) + 1;
    lVar20 = (longlong)(int)uVar6 << 3;
    local_370 = puVar25;
    do {
      if (*(uint *)(lVar9 + 0x78) <= uVar6) break;
      if (*(longlong *)(lVar20 + *(longlong *)(lVar9 + 0x68)) != 0) {
        local_370 = *(undefined8 **)(lVar20 + *(longlong *)(lVar9 + 0x68));
      }
      uVar6 = uVar6 + 1;
      lVar20 = lVar20 + 8;
    } while (local_370 == (undefined8 *)0x0);
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x000140341a03)
// WARNING: Removing unreachable block (ram,0x000140341995)
// WARNING: Removing unreachable block (ram,0x0001403418d1)

undefined8 FUN_140341860(longlong param_1,uint param_2)

{
  longlong *plVar1;
  int *piVar2;
  uint uVar3;
  uint *puVar4;
  longlong lVar5;
  longlong *plVar6;
  uint *puVar7;
  undefined8 uVar8;
  longlong lVar9;
  uint *puVar10;
  double dVar11;
  double dVar12;
  
  puVar10 = (uint *)0x0;
  puVar7 = puVar10;
  if (*(longlong *)(param_1 + 0x30) != 0) {
    for (puVar4 = *(uint **)(*(longlong *)(param_1 + 0x30) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x40)) * 8);
        (puVar7 = puVar10, puVar4 != (uint *)0x0 &&
        ((puVar4[8] != param_2 || (puVar7 = puVar4, *puVar4 != param_2))));
        puVar4 = *(uint **)(puVar4 + 6)) {
    }
  }
  if (puVar7 == (uint *)0x0) {
LAB_140341a14:
    uVar8 = 0;
  }
  else {
    lVar5 = *(longlong *)(puVar7 + 2);
    plVar6 = *(longlong **)(puVar7 + 4);
    if (plVar6 != (longlong *)0x0) {
      LOCK();
      *(int *)(plVar6 + 1) = (int)plVar6[1] + 1;
      UNLOCK();
    }
    if (*(longlong *)(lVar5 + 0xc0) == *(longlong *)(lVar5 + 200)) {
      uVar8 = *(undefined8 *)(puVar7 + 2);
    }
    else {
      lVar9 = *(longlong *)(lVar5 + 200) - *(longlong *)(lVar5 + 0xc0) >> 2;
      dVar11 = (double)FUN_140414fe0();
      dVar12 = (double)lVar9;
      if (lVar9 < 0) {
        dVar12 = dVar12 + 1.8446744073709552e+19;
      }
      uVar3 = *(uint *)(*(longlong *)(lVar5 + 0xc0) + (longlong)(int)(dVar11 * dVar12) * 4);
      puVar7 = puVar10;
      if (*(longlong *)(param_1 + 0x30) != 0) {
        for (puVar4 = *(uint **)(*(longlong *)(param_1 + 0x30) +
                                ((ulonglong)uVar3 % (ulonglong)*(uint *)(param_1 + 0x40)) * 8);
            (puVar7 = puVar10, puVar4 != (uint *)0x0 &&
            ((puVar4[8] != uVar3 || (puVar7 = puVar4, *puVar4 != uVar3))));
            puVar4 = *(uint **)(puVar4 + 6)) {
        }
      }
      if (puVar7 == (uint *)0x0) {
        if (plVar6 != (longlong *)0x0) {
          LOCK();
          plVar1 = plVar6 + 1;
          *(int *)plVar1 = (int)*plVar1 + -1;
          UNLOCK();
          if ((int)*plVar1 == 0) {
            (**(code **)(*plVar6 + 8))(plVar6);
            LOCK();
            piVar2 = (int *)((longlong)plVar6 + 0xc);
            *piVar2 = *piVar2 + -1;
            UNLOCK();
            if (*piVar2 == 0) {
              (**(code **)(*plVar6 + 0x10))();
            }
          }
        }
        goto LAB_140341a14;
      }
      uVar8 = *(undefined8 *)(puVar7 + 2);
    }
    if (plVar6 != (longlong *)0x0) {
      LOCK();
      plVar1 = plVar6 + 1;
      *(int *)plVar1 = (int)*plVar1 + -1;
      UNLOCK();
      if ((int)*plVar1 == 0) {
        (**(code **)(*plVar6 + 8))(plVar6);
        LOCK();
        piVar2 = (int *)((longlong)plVar6 + 0xc);
        *piVar2 = *piVar2 + -1;
        UNLOCK();
        if (*piVar2 == 0) {
          (**(code **)(*plVar6 + 0x10))();
        }
      }
    }
  }
  return uVar8;
}



void FUN_140341a40(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140341e10(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140341ff0(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_140341b90(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_140341cb0(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];
      puVar1[2] = puVar2[2];
      *(undefined8 *)(puVar1 + 10) = 7;
      *(undefined8 *)(puVar1 + 8) = 0;
      *(undefined2 *)(puVar1 + 4) = 0;
      FUN_1400015e0(puVar1 + 4,puVar2 + 4,0,0xffffffffffffffff,uVar3);
    }
  }
  else {
    if (puVar1 == (undefined4 *)param_1[2]) {
      FUN_140341cb0(param_1);
    }
    puVar1 = (undefined4 *)param_1[1];
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = *param_2;
      puVar1[1] = param_2[1];
      puVar1[2] = param_2[2];
      *(undefined8 *)(puVar1 + 10) = 7;
      *(undefined8 *)(puVar1 + 8) = 0;
      *(undefined2 *)(puVar1 + 4) = 0;
      FUN_1400015e0(puVar1 + 4,param_2 + 4,0,0xffffffffffffffff,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x38;
  return;
}



void FUN_140341cb0(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_140341a40(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140341a40(param_1,uVar2);
  }
  return;
}



undefined8 * FUN_140341d70(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;
}



void FUN_140341de0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_140341eb0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



undefined4 * FUN_140341e10(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];
      param_3[2] = param_1[2];
      *(undefined8 *)(param_3 + 10) = 7;
      *(undefined8 *)(param_3 + 8) = 0;
      *(undefined2 *)(param_3 + 4) = 0;
      FUN_1400015e0(param_3 + 4,param_1 + 4,0,0xffffffffffffffff,uVar1);
    }
    param_3 = param_3 + 0xe;
  }
  return param_3;
}



void FUN_140341eb0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x100) != 0) {
    FUN_140341ff0(*(longlong *)(param_1 + 0x100),*(undefined8 *)(param_1 + 0x108));
    operator_delete(*(void **)(param_1 + 0x100));
  }
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined8 *)(param_1 + 0x110) = 0;
  if (*(void **)(param_1 + 0xe0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xe0));
  }
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined8 *)(param_1 + 0xe8) = 0;
  *(undefined8 *)(param_1 + 0xf0) = 0;
  if (*(void **)(param_1 + 0xc0) != (void *)0x0) {
    operator_delete(*(void **)(param_1 + 0xc0));
  }
  *(undefined8 *)(param_1 + 0xc0) = 0;
  *(undefined8 *)(param_1 + 200) = 0;
  *(undefined8 *)(param_1 + 0xd0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xb0)) {
    operator_delete(*(void **)(param_1 + 0x98));
  }
  *(undefined8 *)(param_1 + 0xb0) = 7;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  *(undefined2 *)(param_1 + 0x98) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x88)) {
    operator_delete(*(void **)(param_1 + 0x70));
  }
  *(undefined8 *)(param_1 + 0x88) = 7;
  *(undefined8 *)(param_1 + 0x80) = 0;
  *(undefined2 *)(param_1 + 0x70) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x60)) {
    operator_delete(*(void **)(param_1 + 0x48));
  }
  *(undefined8 *)(param_1 + 0x60) = 7;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x38)) {
    operator_delete(*(void **)(param_1 + 0x20));
  }
  *(undefined8 *)(param_1 + 0x38) = 7;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined2 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_140341ff0(ulonglong *param_1,ulonglong *param_2)

{
  ulonglong *puVar1;
  ulonglong *puVar2;
  
  if (param_1 != param_2) {
    puVar2 = param_1 + 5;
    do {
      if (7 < *puVar2) {
        operator_delete((void *)puVar2[-3]);
      }
      *puVar2 = 7;
      puVar2[-1] = 0;
      *(undefined2 *)(puVar2 + -3) = 0;
      puVar1 = puVar2 + 2;
      puVar2 = puVar2 + 7;
    } while (puVar1 != param_2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403420bb)
// WARNING: Removing unreachable block (ram,0x0001403420c4)
// WARNING: Removing unreachable block (ram,0x0001403420e2)
// WARNING: Removing unreachable block (ram,0x0001403420eb)

undefined2 * FUN_140342050(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;
  *(undefined4 *)(param_1 + 0x1c) = 0x11;
  *(undefined4 *)(param_1 + 0x2c) = 0;
  *(undefined4 *)(param_1 + 0x2e) = 10;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x34) = 0;
  *(undefined4 *)(param_1 + 0x1e) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x20) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x22) = 0x40100000;
  *(undefined8 *)(param_1 + 0x24) = 0x26;
  *(undefined8 *)(param_1 + 0x28) = 0;
  *(undefined4 *)(param_1 + 0x38) = 0;
  return param_1;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140342110(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  short sVar4;
  undefined4 uVar5;
  uint uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  longlong lVar9;
  undefined4 *puVar10;
  undefined4 *puVar11;
  short *psVar12;
  wchar_t *pwVar13;
  undefined8 uVar14;
  ulonglong uVar15;
  longlong *plVar16;
  longlong lVar17;
  longlong lVar18;
  short *psVar19;
  wchar_t *pwVar20;
  short *psVar21;
  wchar_t *pwVar22;
  undefined4 *puVar23;
  bool bVar24;
  undefined1 auStack_1b38 [32];
  undefined1 local_1b18;
  undefined4 *local_1b08;
  longlong *local_1b00;
  undefined4 *local_1af8;
  undefined4 *local_1af0;
  longlong local_1ae0;
  undefined8 local_1ad8;
  undefined1 local_1ad0 [16];
  longlong *local_1ac0;
  undefined1 local_1ab8 [4];
  undefined4 local_1ab4;
  undefined4 local_1ab0;
  undefined4 local_1aac;
  undefined8 local_1aa8;
  undefined8 local_1aa0;
  undefined8 local_1a98;
  undefined4 local_1a90;
  undefined2 local_1a88;
  undefined6 uStack_1a86;
  undefined8 local_1a78;
  ulonglong local_1a70;
  wchar_t local_1a58 [256];
  wchar_t local_1858 [256];
  wchar_t local_1658 [256];
  wchar_t local_1458 [256];
  wchar_t local_1258 [256];
  wchar_t local_1058 [256];
  wchar_t local_e58 [256];
  wchar_t local_c58 [256];
  wchar_t local_a58 [256];
  wchar_t local_858 [256];
  wchar_t local_658 [256];
  wchar_t local_458 [256];
  wchar_t local_258 [256];
  ulonglong local_58;
  
  local_1ad8 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_1b38;
  uVar15 = 0xffffffffffffffff;
  psVar12 = param_2;
  do {
    if (uVar15 == 0) break;
    uVar15 = uVar15 - 1;
    sVar4 = *psVar12;
    psVar12 = psVar12 + 1;
  } while (sVar4 != 0);
  local_1ae0 = param_1;
  FUN_140001710(param_1,param_2,~uVar15 - 1);
  lVar9 = FUN_1402933b0(DAT_140607ff0,param_2);
  uVar14 = 0;
  if (lVar9 != 0) {
    puVar23 = (undefined4 *)0x0;
    local_1af8 = puVar23;
    if ((*(longlong *)(lVar9 + 0x70) != 0) && (*(uint *)(lVar9 + 0x78) != 0)) {
      puVar11 = puVar23;
      plVar16 = *(longlong **)(lVar9 + 0x68);
      do {
        if (*plVar16 != 0) {
          local_1af8 = (undefined4 *)(*(longlong **)(lVar9 + 0x68))[(longlong)puVar11];
          break;
        }
        uVar6 = (int)puVar11 + 1;
        puVar11 = (undefined4 *)(ulonglong)uVar6;
        plVar16 = plVar16 + 1;
      } while (uVar6 < *(uint *)(lVar9 + 0x78));
    }
LAB_1403421e0:
    if (local_1af8 != (undefined4 *)0x0) {
      uVar5 = *local_1af8;
      local_1af0 = local_1af8;
      puVar10 = operator_new(0x30);
      puVar11 = puVar23;
      if (puVar10 != (undefined4 *)0x0) {
        puVar10[1] = 0;
        puVar10[3] = 0;
        *(undefined8 *)(puVar10 + 4) = 0;
        *(undefined8 *)(puVar10 + 6) = 0;
        *(undefined8 *)(puVar10 + 8) = 0;
        puVar11 = puVar10;
      }
      local_1b08 = puVar11;
      FUN_140342d50(&local_1b00,puVar11);
      FUN_140178e90(&local_1b08,puVar11,puVar11);
      uVar7 = FUN_1402970c0(lVar9,&DAT_14049f290);
      local_1b18 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar5,uVar7,&DAT_14049f290);
      *local_1b08 = *puVar11;
      uVar7 = FUN_1402970c0(lVar9,L"szType");
      local_1b18 = 0;
      psVar12 = (short *)FUN_140296990(lVar9,uVar5,uVar7,L"szType");
      bVar24 = psVar12 == (short *)0x0;
      if (!bVar24) {
        lVar17 = 5;
        psVar19 = psVar12;
        psVar21 = &DAT_1404d3e18;
        do {
          if (lVar17 == 0) break;
          lVar17 = lVar17 + -1;
          bVar24 = *psVar19 == *psVar21;
          psVar19 = psVar19 + 1;
          psVar21 = psVar21 + 1;
        } while (bVar24);
        if (bVar24) {
          local_1b08[1] = 1;
        }
        else {
          lVar17 = 5;
          psVar19 = psVar12;
          psVar21 = &DAT_1404d3e28;
          do {
            if (lVar17 == 0) break;
            lVar17 = lVar17 + -1;
            bVar24 = *psVar19 == *psVar21;
            psVar19 = psVar19 + 1;
            psVar21 = psVar21 + 1;
          } while (bVar24);
          if (bVar24) {
            local_1b08[1] = 0;
          }
          else {
            lVar17 = 5;
            psVar19 = &DAT_1404ceb70;
            do {
              if (lVar17 == 0) break;
              lVar17 = lVar17 + -1;
              bVar24 = *psVar12 == *psVar19;
              psVar12 = psVar12 + 1;
              psVar19 = psVar19 + 1;
            } while (bVar24);
            if (bVar24) {
              local_1b08[1] = 2;
            }
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar9,L"fAddRange");
      local_1b18 = 0;
      puVar11 = (undefined4 *)FUN_1402967b0(lVar9,uVar5,uVar7,L"fAddRange");
      if (puVar11 != (undefined4 *)0x0) {
        local_1b08[3] = *puVar11;
      }
      lVar17 = 5;
      do {
        swprintf_s(local_c58,0x100,L"nComboID%02d");
        swprintf_s(local_1458,0x100,L"fPriority%02d");
        swprintf_s(local_1a58,0x100,L"szArmorType%02d");
        swprintf_s(local_458,0x100,L"nDamageAccumulation%02d");
        swprintf_s(local_658,0x100,L"szHitBox%02d");
        swprintf_s(local_1058,0x100,L"nCameraBox%02d");
        swprintf_s(local_858,0x100,L"nMotionCategory%02d");
        swprintf_s(local_258,0x100,L"szAttackDir%02d");
        swprintf_s(local_1858,0x100,L"nLuaTempID%02d");
        swprintf_s(local_1658,0x100,L"nLuaTempType%02d");
        swprintf_s(local_1258,0x100,L"szAngle%02d");
        swprintf_s(local_e58,0x100,L"fMinAngle%02d");
        swprintf_s(local_a58,0x100,L"fMaxAngle%02d");
        local_1ab8[0] = 0;
        local_1ab4 = 0;
        local_1ab0 = 0;
        local_1aac = 0;
        local_1aa8 = 0;
        local_1aa0 = 0;
        local_1a98 = 0;
        local_1a90 = 0;
        local_1a70 = 7;
        local_1a78 = 0;
        local_1a88 = 0;
        uVar7 = FUN_1402970c0(lVar9,local_1458);
        local_1b18 = 0;
        puVar11 = (undefined4 *)FUN_1402967b0(lVar9,uVar5,uVar7,local_1458);
        if (puVar11 != (undefined4 *)0x0) {
          local_1ab4 = *puVar11;
          uVar7 = FUN_1402970c0(lVar9,local_c58);
          local_1b18 = 0;
          puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar5,uVar7,local_c58);
          if (puVar11 != (undefined4 *)0x0) {
            local_1aa8 = CONCAT44(local_1aa8._4_4_,*puVar11);
            uVar7 = FUN_1402970c0(lVar9,local_1a58);
            local_1b18 = 0;
            pwVar13 = (wchar_t *)FUN_140296990(lVar9,uVar5,uVar7,local_1a58);
            bVar24 = pwVar13 == (wchar_t *)0x0;
            if (!bVar24) {
              uVar7 = (undefined4)((ulonglong)local_1aa0 >> 0x20);
              lVar18 = 0x13;
              pwVar20 = pwVar13;
              pwVar22 = L"ARMOR_NOT_MATERIAL";
              do {
                if (lVar18 == 0) break;
                lVar18 = lVar18 + -1;
                bVar24 = *pwVar20 == *pwVar22;
                pwVar20 = pwVar20 + 1;
                pwVar22 = pwVar22 + 1;
              } while (bVar24);
              if (bVar24) {
                local_1aa0 = CONCAT44(uVar7,1);
              }
              else {
                lVar18 = 10;
                pwVar20 = pwVar13;
                pwVar22 = L"ARMOR_GOD";
                do {
                  if (lVar18 == 0) break;
                  lVar18 = lVar18 + -1;
                  bVar24 = *pwVar20 == *pwVar22;
                  pwVar20 = pwVar20 + 1;
                  pwVar22 = pwVar22 + 1;
                } while (bVar24);
                if (bVar24) {
                  uVar8 = 3;
LAB_1403426bd:
                  local_1aa0 = CONCAT44(uVar7,uVar8);
                }
                else {
                  lVar18 = 0x15;
                  pwVar20 = pwVar13;
                  pwVar22 = L"ARMOR_GOD_MATERIAL_A";
                  do {
                    if (lVar18 == 0) break;
                    lVar18 = lVar18 + -1;
                    bVar24 = *pwVar20 == *pwVar22;
                    pwVar20 = pwVar20 + 1;
                    pwVar22 = pwVar22 + 1;
                  } while (bVar24);
                  if (bVar24) {
                    local_1aa0 = CONCAT44(uVar7,4);
                  }
                  else {
                    lVar18 = 0x15;
                    pwVar20 = pwVar13;
                    pwVar22 = L"ARMOR_GOD_MATERIAL_B";
                    do {
                      if (lVar18 == 0) break;
                      lVar18 = lVar18 + -1;
                      bVar24 = *pwVar20 == *pwVar22;
                      pwVar20 = pwVar20 + 1;
                      pwVar22 = pwVar22 + 1;
                    } while (bVar24);
                    if (bVar24) {
                      local_1aa0 = CONCAT44(uVar7,5);
                    }
                    else {
                      lVar18 = 0x11;
                      pwVar20 = pwVar13;
                      pwVar22 = L"ARMOR_MATERIAL_A";
                      do {
                        if (lVar18 == 0) break;
                        lVar18 = lVar18 + -1;
                        bVar24 = *pwVar20 == *pwVar22;
                        pwVar20 = pwVar20 + 1;
                        pwVar22 = pwVar22 + 1;
                      } while (bVar24);
                      if (bVar24) {
                        local_1aa0 = CONCAT44(uVar7,6);
                      }
                      else {
                        lVar18 = 0x11;
                        pwVar20 = pwVar13;
                        pwVar22 = L"ARMOR_MATERIAL_B";
                        do {
                          if (lVar18 == 0) break;
                          lVar18 = lVar18 + -1;
                          bVar24 = *pwVar20 == *pwVar22;
                          pwVar20 = pwVar20 + 1;
                          pwVar22 = pwVar22 + 1;
                        } while (bVar24);
                        if (bVar24) {
                          local_1aa0 = CONCAT44(uVar7,7);
                        }
                        else {
                          lVar18 = 0x11;
                          pwVar20 = pwVar13;
                          pwVar22 = L"ARMOR_MATERIAL_C";
                          do {
                            if (lVar18 == 0) break;
                            lVar18 = lVar18 + -1;
                            bVar24 = *pwVar20 == *pwVar22;
                            pwVar20 = pwVar20 + 1;
                            pwVar22 = pwVar22 + 1;
                          } while (bVar24);
                          if (bVar24) {
                            local_1aa0 = CONCAT44(uVar7,8);
                          }
                          else {
                            lVar18 = 0x11;
                            pwVar20 = pwVar13;
                            pwVar22 = L"ARMOR_MATERIAL_D";
                            do {
                              if (lVar18 == 0) break;
                              lVar18 = lVar18 + -1;
                              bVar24 = *pwVar20 == *pwVar22;
                              pwVar20 = pwVar20 + 1;
                              pwVar22 = pwVar22 + 1;
                            } while (bVar24);
                            if (bVar24) {
                              local_1aa0 = CONCAT44(uVar7,9);
                            }
                            else {
                              lVar18 = 0x13;
                              pwVar20 = pwVar13;
                              pwVar22 = L"ARMOR_MATERIAL_D_A";
                              do {
                                if (lVar18 == 0) break;
                                lVar18 = lVar18 + -1;
                                bVar24 = *pwVar20 == *pwVar22;
                                pwVar20 = pwVar20 + 1;
                                pwVar22 = pwVar22 + 1;
                              } while (bVar24);
                              if (!bVar24) {
                                lVar18 = 0x13;
                                pwVar20 = L"ARMOR_MATERIAL_D_B";
                                do {
                                  if (lVar18 == 0) break;
                                  lVar18 = lVar18 + -1;
                                  bVar24 = *pwVar13 == *pwVar20;
                                  pwVar13 = pwVar13 + 1;
                                  pwVar20 = pwVar20 + 1;
                                } while (bVar24);
                                uVar8 = 0;
                                if (bVar24) {
                                  uVar8 = 0xb;
                                }
                                goto LAB_1403426bd;
                              }
                              local_1aa0 = CONCAT44(uVar7,10);
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
              uVar7 = FUN_1402970c0(lVar9,local_658);
              local_1b18 = 0;
              psVar12 = (short *)FUN_140296990(lVar9,uVar5,uVar7,local_658);
              if (psVar12 != (short *)0x0) {
                uVar15 = 0xffffffffffffffff;
                psVar19 = psVar12;
                do {
                  if (uVar15 == 0) break;
                  uVar15 = uVar15 - 1;
                  sVar4 = *psVar19;
                  psVar19 = psVar19 + 1;
                } while (sVar4 != 0);
                FUN_140001710(&local_1a88,psVar12,~uVar15 - 1);
              }
              uVar7 = FUN_1402970c0(lVar9,local_1058);
              local_1b18 = 0;
              puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar5,uVar7,local_1058);
              if (puVar11 != (undefined4 *)0x0) {
                local_1a90 = *puVar11;
              }
              uVar7 = FUN_1402970c0(lVar9,local_858);
              local_1b18 = 0;
              puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar5,uVar7,local_858);
              if (puVar11 != (undefined4 *)0x0) {
                local_1aa8 = CONCAT44(*puVar11,(undefined4)local_1aa8);
              }
              uVar7 = FUN_1402970c0(lVar9,local_1858);
              local_1b18 = 0;
              puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar5,uVar7,local_1858);
              if (puVar11 != (undefined4 *)0x0) {
                local_1aa0 = CONCAT44(*puVar11,(undefined4)local_1aa0);
                uVar7 = FUN_1402970c0(lVar9,local_1658);
                local_1b18 = 1;
                puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar5,uVar7,local_1658);
                local_1a98 = CONCAT44(local_1a98._4_4_,*puVar11);
              }
              uVar7 = FUN_1402970c0(lVar9,local_1258);
              local_1b18 = 0;
              pwVar13 = (wchar_t *)FUN_140296990(lVar9,uVar5,uVar7,local_1258);
              bVar24 = pwVar13 == (wchar_t *)0x0;
              if (!bVar24) {
                lVar18 = 3;
                pwVar20 = pwVar13;
                pwVar22 = L"IN";
                do {
                  if (lVar18 == 0) break;
                  lVar18 = lVar18 + -1;
                  bVar24 = *pwVar20 == *pwVar22;
                  pwVar20 = pwVar20 + 1;
                  pwVar22 = pwVar22 + 1;
                } while (bVar24);
                if (bVar24) {
                  local_1a98 = CONCAT44(1,(undefined4)local_1a98);
                }
                else {
                  lVar18 = 4;
                  pwVar20 = pwVar13;
                  pwVar22 = L"OUT";
                  do {
                    if (lVar18 == 0) break;
                    lVar18 = lVar18 + -1;
                    bVar24 = *pwVar20 == *pwVar22;
                    pwVar20 = pwVar20 + 1;
                    pwVar22 = pwVar22 + 1;
                  } while (bVar24);
                  if (bVar24) {
                    local_1a98 = CONCAT44(2,(undefined4)local_1a98);
                  }
                  else {
                    lVar18 = 6;
                    pwVar20 = L"RANGE";
                    do {
                      if (lVar18 == 0) break;
                      lVar18 = lVar18 + -1;
                      bVar24 = *pwVar13 == *pwVar20;
                      pwVar13 = pwVar13 + 1;
                      pwVar20 = pwVar20 + 1;
                    } while (bVar24);
                    if (bVar24) {
                      local_1a98._4_4_ = 3;
                    }
                  }
                }
                uVar7 = FUN_1402970c0(lVar9,local_e58);
                local_1b18 = 1;
                puVar11 = (undefined4 *)FUN_1402967b0(lVar9,uVar5,uVar7,local_e58);
                local_1ab0 = *puVar11;
                uVar7 = FUN_1402970c0(lVar9,local_a58);
                local_1b18 = 1;
                puVar11 = (undefined4 *)FUN_1402967b0(lVar9,uVar5,uVar7,local_a58);
                local_1aac = *puVar11;
              }
              uVar7 = FUN_1402970c0(lVar9,L"nWeaponChangeID");
              local_1b18 = 0;
              puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar5,uVar7,L"nWeaponChangeID");
              if (puVar11 != (undefined4 *)0x0) {
                local_1b08[2] = *puVar11;
              }
              FUN_140342a60(local_1b08 + 4,local_1ab8);
            }
          }
        }
        if (7 < local_1a70) {
          operator_delete((void *)CONCAT62(uStack_1a86,local_1a88));
        }
        lVar17 = lVar17 + -1;
      } while (lVar17 != 0);
      puVar11 = (undefined4 *)FUN_140342d30(local_1ad0,local_1b08,&local_1b08);
      FUN_14030e3c0(local_1ae0 + 0x28,*puVar11,puVar11 + 2);
      plVar16 = local_1ac0;
      puVar11 = local_1af8;
      if (local_1ac0 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_1ac0 + 1;
        lVar17 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar11 = local_1af0;
        if ((int)lVar17 == 1) {
          (**(code **)(*local_1ac0 + 8))(local_1ac0);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar11 = local_1af0;
          if (iVar3 == 1) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar11 = local_1af0;
          }
        }
      }
      plVar16 = local_1b00;
      if (local_1b00 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_1b00 + 1;
        lVar17 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar11 = local_1af0;
        if ((int)lVar17 == 1) {
          (**(code **)(*local_1b00 + 8))(local_1b00);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar11 = local_1af0;
          if (iVar3 == 1) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar11 = local_1af0;
          }
        }
      }
      local_1af8 = *(undefined4 **)(puVar11 + 6);
      if (local_1af8 == (undefined4 *)0x0) {
        uVar6 = (uint)puVar11[8] % *(uint *)(lVar9 + 0x78) + 1;
        lVar17 = (longlong)(int)uVar6 << 3;
        local_1af8 = puVar23;
        do {
          if (*(uint *)(lVar9 + 0x78) <= uVar6) break;
          if (*(longlong *)(lVar17 + *(longlong *)(lVar9 + 0x68)) != 0) {
            local_1af8 = *(undefined4 **)(lVar17 + *(longlong *)(lVar9 + 0x68));
          }
          uVar6 = uVar6 + 1;
          lVar17 = lVar17 + 8;
        } while (local_1af8 == (undefined4 *)0x0);
      }
      goto LAB_1403421e0;
    }
    uVar14 = 1;
  }
  return uVar14;
}



void FUN_140342a60(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_140342b20(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140342dc0(param_1[1],((longlong)(param_2 - uVar2) / 0x58) * 0x58 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_140342b20(param_1);
    }
    if (param_1[1] != 0) {
      FUN_140342dc0(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x58;
  return;
}



void FUN_140342b20(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_140342be0(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140342be0(param_1,uVar2);
  }
  return;
}



void FUN_140342be0(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 (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) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x58);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_140342ee0(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_140342ff0(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x58);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0x58) * 0x58);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



undefined4 * FUN_140342d30(undefined4 *param_1,undefined4 *param_2,undefined8 *param_3)

{
  longlong lVar1;
  
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 2) = *param_3;
  lVar1 = param_3[1];
  *(longlong *)(param_1 + 4) = lVar1;
  if (lVar1 != 0) {
    LOCK();
    *(int *)(lVar1 + 8) = *(int *)(lVar1 + 8) + 1;
    UNLOCK();
  }
  return param_1;
}



undefined8 * FUN_140342d50(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;
}



undefined1 * FUN_140342dc0(undefined1 *param_1,undefined1 *param_2)

{
  *param_1 = *param_2;
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(param_2 + 4);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(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);
  *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_2 + 0x1c);
  *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_2 + 0x20);
  *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(param_2 + 0x28);
  *(undefined8 *)(param_1 + 0x48) = 7;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined2 *)(param_1 + 0x30) = 0;
  FUN_1400015e0(param_1 + 0x30,param_2 + 0x30,0,0xffffffffffffffff);
  return param_1;
}



void FUN_140342e40(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (*(longlong *)((longlong)pvVar1 + 0x10) != 0) {
      FUN_140342ff0(*(longlong *)((longlong)pvVar1 + 0x10),*(undefined8 *)((longlong)pvVar1 + 0x18))
      ;
      operator_delete(*(void **)((longlong)pvVar1 + 0x10));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x10) = 0;
    *(undefined8 *)((longlong)pvVar1 + 0x18) = 0;
    *(undefined8 *)((longlong)pvVar1 + 0x20) = 0;
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140342e90(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (*(longlong *)((longlong)param_1 + 0x10) != 0) {
      FUN_140342ff0(*(longlong *)((longlong)param_1 + 0x10),
                    *(undefined8 *)((longlong)param_1 + 0x18));
      operator_delete(*(void **)((longlong)param_1 + 0x10));
    }
    *(undefined8 *)((longlong)param_1 + 0x10) = 0;
    *(undefined8 *)((longlong)param_1 + 0x18) = 0;
    *(undefined8 *)((longlong)param_1 + 0x20) = 0;
    operator_delete(param_1);
  }
  return;
}



undefined1 * FUN_140342ee0(undefined1 *param_1,undefined1 *param_2,undefined1 *param_3)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  for (; param_1 != param_2; param_1 = param_1 + 0x58) {
    if (param_3 != (undefined1 *)0x0) {
      *param_3 = *param_1;
      *(undefined4 *)(param_3 + 4) = *(undefined4 *)(param_1 + 4);
      *(undefined4 *)(param_3 + 8) = *(undefined4 *)(param_1 + 8);
      *(undefined4 *)(param_3 + 0xc) = *(undefined4 *)(param_1 + 0xc);
      *(undefined4 *)(param_3 + 0x10) = *(undefined4 *)(param_1 + 0x10);
      *(undefined4 *)(param_3 + 0x14) = *(undefined4 *)(param_1 + 0x14);
      *(undefined4 *)(param_3 + 0x18) = *(undefined4 *)(param_1 + 0x18);
      *(undefined4 *)(param_3 + 0x1c) = *(undefined4 *)(param_1 + 0x1c);
      *(undefined4 *)(param_3 + 0x20) = *(undefined4 *)(param_1 + 0x20);
      *(undefined4 *)(param_3 + 0x24) = *(undefined4 *)(param_1 + 0x24);
      *(undefined4 *)(param_3 + 0x28) = *(undefined4 *)(param_1 + 0x28);
      *(undefined8 *)(param_3 + 0x48) = 7;
      *(undefined8 *)(param_3 + 0x40) = 0;
      *(undefined2 *)(param_3 + 0x30) = 0;
      FUN_1400015e0(param_3 + 0x30,param_1 + 0x30,0,0xffffffffffffffff,uVar1);
    }
    param_3 = param_3 + 0x58;
  }
  return param_3;
}



void FUN_140342fb0(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;
  return;
}



void FUN_140342ff0(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;
      puVar1 = puVar2 + 2;
      puVar2 = puVar2 + 0xb;
    } while (puVar1 != param_2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403430cc)

uint * FUN_140343050(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  EnterCriticalSection(DAT_1406082b8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x10) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x20)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 0x6e)) {
      if ((puVar1[0x70] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 != (uint *)0x0) {
          LeaveCriticalSection(DAT_1406082b8);
          return puVar1 + 2;
        }
        break;
      }
    }
  }
  LeaveCriticalSection(DAT_1406082b8);
  return (uint *)0x0;
}



void FUN_140343110(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  FUN_14034edf0(param_1 + 0x58);
  if (*(longlong *)(param_1 + 0x30) != 0) {
    FUN_1402ce6b0(*(longlong *)(param_1 + 0x30),*(undefined8 *)(param_1 + 0x38),param_3,param_4,
                  uVar1);
    operator_delete(*(void **)(param_1 + 0x30));
  }
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 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_140343190(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong lVar4;
  
  uVar3 = 0xfffffffffffffffe;
  lVar1 = param_1 + 0x58;
  lVar4 = lVar1;
  FUN_14034ed40(lVar1);
  lVar2 = *(longlong *)(param_1 + 0x38);
  if (*(longlong *)(param_1 + 0x30) != lVar2) {
    uVar3 = FUN_140333a10(lVar2,lVar2,*(longlong *)(param_1 + 0x30),param_4,uVar3,lVar4,1);
    FUN_1402ce6b0(uVar3,*(undefined8 *)(param_1 + 0x38));
    *(undefined8 *)(param_1 + 0x38) = uVar3;
  }
  FUN_14034edd0(lVar1);
  return;
}



undefined8 FUN_140343210(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  short sVar4;
  undefined4 uVar5;
  undefined8 **ppuVar6;
  undefined8 **ppuVar7;
  uint uVar8;
  undefined4 uVar9;
  longlong lVar10;
  undefined8 uVar11;
  undefined8 *puVar13;
  undefined4 *puVar14;
  longlong lVar15;
  ulonglong uVar16;
  longlong *plVar17;
  undefined8 *puVar18;
  short *psVar19;
  undefined8 *puVar20;
  undefined8 *local_50;
  longlong *local_48;
  undefined8 *local_40;
  longlong local_30;
  undefined1 local_28;
  undefined8 *puVar12;
  
  local_30 = param_1 + 0x58;
  FUN_14034ed40();
  local_28 = 1;
  uVar16 = 0xffffffffffffffff;
  psVar19 = param_2;
  do {
    if (uVar16 == 0) break;
    uVar16 = uVar16 - 1;
    sVar4 = *psVar19;
    psVar19 = psVar19 + 1;
  } while (sVar4 != 0);
  FUN_140001710(param_1 + 8,param_2,~uVar16 - 1);
  lVar10 = FUN_1402933b0(DAT_140607ff0,param_2);
  if (lVar10 == 0) {
    FUN_14034edd0(param_1 + 0x58);
    uVar11 = 0;
  }
  else {
    puVar20 = (undefined8 *)0x0;
    puVar18 = puVar20;
    if ((*(longlong *)(lVar10 + 0x70) != 0) && (*(uint *)(lVar10 + 0x78) != 0)) {
      puVar12 = puVar20;
      plVar17 = *(longlong **)(lVar10 + 0x68);
      do {
        if (*plVar17 != 0) {
          puVar18 = (undefined8 *)(*(longlong **)(lVar10 + 0x68))[(longlong)puVar12];
          break;
        }
        uVar8 = (int)puVar12 + 1;
        puVar12 = (undefined8 *)(ulonglong)uVar8;
        plVar17 = plVar17 + 1;
      } while (uVar8 < *(uint *)(lVar10 + 0x78));
    }
LAB_1403432d0:
    local_40 = puVar18;
    if (puVar18 != (undefined8 *)0x0) {
      uVar5 = *(undefined4 *)puVar18;
      puVar13 = operator_new(0x10);
      puVar12 = puVar20;
      if (puVar13 != (undefined8 *)0x0) {
        *puVar13 = 0;
        puVar13[1] = 0;
        puVar12 = puVar13;
      }
      local_50 = puVar12;
      FUN_140343770(&local_48,puVar12);
      FUN_140178e90(&local_50,puVar12,puVar12);
      *(undefined4 *)local_50 = uVar5;
      uVar9 = FUN_1402970c0(lVar10,L"fPriority");
      puVar14 = (undefined4 *)FUN_1402967b0(lVar10,uVar5,uVar9,L"fPriority",1);
      *(undefined4 *)((longlong)local_50 + 4) = *puVar14;
      uVar9 = FUN_1402970c0(lVar10,L"nMin");
      puVar14 = (undefined4 *)FUN_140296600(lVar10,uVar5,uVar9,L"nMin",1);
      *(undefined4 *)(local_50 + 1) = *puVar14;
      uVar9 = FUN_1402970c0(lVar10,L"nMax");
      puVar14 = (undefined4 *)FUN_140296600(lVar10,uVar5,uVar9,L"nMax",1);
      *(undefined4 *)((longlong)local_50 + 0xc) = *puVar14;
      ppuVar6 = *(undefined8 ***)(param_1 + 0x38);
      if ((&local_50 < ppuVar6) &&
         (ppuVar7 = *(undefined8 ***)(param_1 + 0x30), ppuVar7 <= &local_50)) {
        if (ppuVar6 == *(undefined8 ***)(param_1 + 0x40)) {
          FUN_1403435d0(param_1 + 0x30);
        }
        puVar13 = (undefined8 *)
                  (((longlong)&local_50 - (longlong)ppuVar7 & 0xfffffffffffffff0U) +
                  *(longlong *)(param_1 + 0x30));
        puVar12 = *(undefined8 **)(param_1 + 0x38);
        if (puVar12 != (undefined8 *)0x0) {
          *puVar12 = *puVar13;
          lVar15 = puVar13[1];
          puVar12[1] = lVar15;
          if (lVar15 != 0) {
            LOCK();
            *(int *)(lVar15 + 8) = *(int *)(lVar15 + 8) + 1;
            UNLOCK();
            puVar18 = local_40;
          }
        }
      }
      else {
        if (ppuVar6 == *(undefined8 ***)(param_1 + 0x40)) {
          FUN_1403435d0(param_1 + 0x30);
        }
        puVar12 = *(undefined8 **)(param_1 + 0x38);
        if (puVar12 != (undefined8 *)0x0) {
          *puVar12 = local_50;
          puVar12[1] = local_48;
          if (local_48 != (longlong *)0x0) {
            LOCK();
            *(int *)(local_48 + 1) = (int)local_48[1] + 1;
            UNLOCK();
            puVar18 = local_40;
          }
        }
      }
      plVar17 = local_48;
      *(longlong *)(param_1 + 0x38) = *(longlong *)(param_1 + 0x38) + 0x10;
      puVar12 = puVar18;
      if (local_48 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_48 + 1;
        lVar15 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar12 = local_40;
        if ((int)lVar15 == 1) {
          (**(code **)(*local_48 + 8))(local_48);
          LOCK();
          piVar2 = (int *)((longlong)plVar17 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar12 = local_40;
          if (iVar3 == 1) {
            (**(code **)(*plVar17 + 0x10))(plVar17);
            puVar12 = local_40;
          }
        }
      }
      puVar18 = (undefined8 *)puVar12[3];
      if (puVar18 == (undefined8 *)0x0) {
        uVar8 = *(uint *)(puVar12 + 4) % *(uint *)(lVar10 + 0x78) + 1;
        lVar15 = (longlong)(int)uVar8 << 3;
        puVar18 = puVar20;
        do {
          if (*(uint *)(lVar10 + 0x78) <= uVar8) break;
          if (*(longlong *)(lVar15 + *(longlong *)(lVar10 + 0x68)) != 0) {
            puVar18 = *(undefined8 **)(lVar15 + *(longlong *)(lVar10 + 0x68));
          }
          uVar8 = uVar8 + 1;
          lVar15 = lVar15 + 8;
        } while (puVar18 == (undefined8 *)0x0);
      }
      goto LAB_1403432d0;
    }
    FUN_14034edd0(local_30);
    uVar11 = 1;
  }
  return uVar11;
}



int FUN_140343510(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  int iVar4;
  int iVar5;
  longlong *plVar6;
  float fVar7;
  
  lVar1 = param_1 + 0x58;
  FUN_14034ed40(lVar1,param_2,param_3,param_4,0xfffffffffffffffe);
  iVar4 = rand();
  fVar7 = 0.0;
  plVar6 = *(longlong **)(param_1 + 0x30);
  while( true ) {
    if (plVar6 == *(longlong **)(param_1 + 0x38)) {
      FUN_14034edd0(lVar1);
      return 0;
    }
    lVar3 = *plVar6;
    if ((fVar7 <= (float)iVar4 * 3.0517578e-05) &&
       ((float)iVar4 * 3.0517578e-05 < fVar7 + *(float *)(lVar3 + 4))) break;
    fVar7 = *(float *)(lVar3 + 4);
    plVar6 = plVar6 + 2;
  }
  iVar5 = rand();
  iVar4 = *(int *)(lVar3 + 8);
  iVar2 = *(int *)(lVar3 + 0xc);
  FUN_14034edd0(lVar1);
  return (int)((float)(iVar2 - iVar4) * (float)iVar5 * 3.0517578e-05) + iVar4;
}



void FUN_1403435d0(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_140343660(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_140343660(param_1,uVar2);
  }
  return;
}



void FUN_140343660(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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14033ef00(*param_1,param_1[1],local_res10,param_4,uVar5);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_1402ce6b0();
      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;
}



undefined8 * FUN_140343770(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;
}



// WARNING: Removing unreachable block (ram,0x00014034384c)
// WARNING: Removing unreachable block (ram,0x000140343855)
// WARNING: Removing unreachable block (ram,0x000140343873)
// WARNING: Removing unreachable block (ram,0x00014034387c)

longlong FUN_1403437e0(longlong param_1)

{
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x18) = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined8 *)(param_1 + 0x30) = 0;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x40) = 0x11;
  *(undefined4 *)(param_1 + 0x60) = 0;
  *(undefined4 *)(param_1 + 100) = 10;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined8 *)(param_1 + 0x70) = 0;
  *(undefined4 *)(param_1 + 0x44) = 0x3f400000;
  *(undefined4 *)(param_1 + 0x48) = 0x3e800000;
  *(undefined4 *)(param_1 + 0x4c) = 0x40100000;
  *(undefined8 *)(param_1 + 0x50) = 0x26;
  *(undefined8 *)(param_1 + 0x58) = 0;
  *(undefined4 *)(param_1 + 0x78) = 0;
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403438a0(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  short sVar4;
  undefined4 uVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  undefined4 *puVar9;
  short *psVar10;
  longlong lVar11;
  undefined8 uVar12;
  ulonglong uVar13;
  longlong *plVar14;
  wchar_t *pwVar15;
  wchar_t *pwVar16;
  wchar_t *pwVar17;
  undefined4 *puVar18;
  undefined4 *puVar19;
  uint uVar20;
  short *psVar21;
  undefined1 auStack_d8 [32];
  undefined1 local_b8;
  undefined4 *local_a8;
  longlong *local_a0;
  undefined4 *local_98;
  undefined8 local_88;
  undefined1 local_80 [16];
  longlong *local_70;
  wchar_t local_68;
  undefined6 uStack_66;
  ulonglong local_58;
  ulonglong local_50;
  ulonglong local_40;
  
  local_88 = 0xfffffffffffffffe;
  local_40 = DAT_1405d84f0 ^ (ulonglong)auStack_d8;
  uVar13 = 0xffffffffffffffff;
  psVar21 = param_2;
  do {
    if (uVar13 == 0) break;
    uVar13 = uVar13 - 1;
    sVar4 = *psVar21;
    psVar21 = psVar21 + 1;
  } while (sVar4 != 0);
  FUN_140001710(param_1 + 8,param_2,~uVar13 - 1);
  lVar8 = FUN_1402933b0(DAT_140607ff0,param_2);
  uVar12 = 0;
  if (lVar8 != 0) {
    FUN_1402f3920(param_1 + 0x30);
    puVar18 = (undefined4 *)0x0;
    puVar19 = puVar18;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar9 = puVar18;
      plVar14 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar14 != 0) {
          puVar19 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar9];
          break;
        }
        uVar6 = (int)puVar9 + 1;
        puVar9 = (undefined4 *)(ulonglong)uVar6;
        plVar14 = plVar14 + 1;
      } while (uVar6 < *(uint *)(lVar8 + 0x78));
    }
LAB_140343960:
    if (puVar19 != (undefined4 *)0x0) {
      uVar5 = *puVar19;
      local_98 = puVar19;
      puVar9 = operator_new(0xc);
      local_a8 = puVar9;
      FUN_140343f50(&local_a0,puVar9);
      FUN_140178e90(&local_a8,puVar9,puVar9);
      *local_a8 = uVar5;
      uVar7 = FUN_1402970c0(lVar8,L"szSituation");
      local_b8 = 1;
      psVar10 = (short *)FUN_140296990(lVar8,uVar5,uVar7,L"szSituation");
      local_50 = 7;
      local_58 = 0;
      local_68 = L'\0';
      uVar13 = 0xffffffffffffffff;
      psVar21 = psVar10;
      do {
        if (uVar13 == 0) break;
        uVar13 = uVar13 - 1;
        sVar4 = *psVar21;
        psVar21 = psVar21 + 1;
      } while (sVar4 != 0);
      FUN_140001710(&local_68,psVar10,~uVar13 - 1);
      pwVar17 = (wchar_t *)CONCAT62(uStack_66,local_68);
      pwVar15 = &local_68;
      if (7 < local_50) {
        pwVar15 = pwVar17;
      }
      uVar13 = 6;
      if (local_58 < 6) {
        uVar13 = local_58;
      }
      pwVar16 = L"DAMAGE";
      for (; uVar6 = 0, uVar13 != 0; uVar13 = uVar13 - 1) {
        if (*pwVar15 != *pwVar16) {
          uVar6 = 1;
          if ((ushort)*pwVar15 < (ushort)*pwVar16) {
            uVar6 = 0xffffffff;
          }
          break;
        }
        pwVar15 = pwVar15 + 1;
        pwVar16 = pwVar16 + 1;
      }
      if (uVar6 == 0) {
        if (local_58 < 6) {
          uVar6 = 0xffffffff;
        }
        else {
          uVar6 = (uint)(local_58 != 6);
        }
      }
      if (uVar6 == 0) {
        local_a8[1] = 0;
      }
      else {
        pwVar15 = &local_68;
        if (7 < local_50) {
          pwVar15 = pwVar17;
        }
        uVar13 = 5;
        if (local_58 < 5) {
          uVar13 = local_58;
        }
        pwVar16 = L"GUARD";
        uVar6 = 0;
        for (; uVar20 = uVar6, uVar13 != 0; uVar13 = uVar13 - 1) {
          if (*pwVar15 != *pwVar16) {
            uVar20 = 1;
            if ((ushort)*pwVar15 < (ushort)*pwVar16) {
              uVar20 = 0xffffffff;
            }
            break;
          }
          pwVar15 = pwVar15 + 1;
          pwVar16 = pwVar16 + 1;
        }
        if (uVar20 == 0) {
          if (local_58 < 5) {
            uVar20 = 0xffffffff;
          }
          else {
            uVar20 = (uint)(local_58 != 5);
          }
        }
        if (uVar20 == 0) {
          local_a8[1] = 1;
        }
        else {
          pwVar15 = &local_68;
          if (7 < local_50) {
            pwVar15 = pwVar17;
          }
          uVar13 = 10;
          if (local_58 < 10) {
            uVar13 = local_58;
          }
          pwVar16 = L"JUST_GUARD";
          for (; uVar20 = uVar6, uVar13 != 0; uVar13 = uVar13 - 1) {
            if (*pwVar15 != *pwVar16) {
              uVar20 = 1;
              if ((ushort)*pwVar15 < (ushort)*pwVar16) {
                uVar20 = 0xffffffff;
              }
              break;
            }
            pwVar15 = pwVar15 + 1;
            pwVar16 = pwVar16 + 1;
          }
          if (uVar20 == 0) {
            if (local_58 < 10) {
              uVar20 = 0xffffffff;
            }
            else {
              uVar20 = (uint)(local_58 != 10);
            }
          }
          if (uVar20 == 0) {
            local_a8[1] = 2;
          }
          else {
            pwVar15 = &local_68;
            if (7 < local_50) {
              pwVar15 = pwVar17;
            }
            uVar13 = 5;
            if (local_58 < 5) {
              uVar13 = local_58;
            }
            pwVar16 = L"CATCH";
            for (; uVar20 = uVar6, uVar13 != 0; uVar13 = uVar13 - 1) {
              if (*pwVar15 != *pwVar16) {
                uVar20 = 1;
                if ((ushort)*pwVar15 < (ushort)*pwVar16) {
                  uVar20 = 0xffffffff;
                }
                break;
              }
              pwVar15 = pwVar15 + 1;
              pwVar16 = pwVar16 + 1;
            }
            if (uVar20 == 0) {
              if (local_58 < 5) {
                uVar20 = 0xffffffff;
              }
              else {
                uVar20 = (uint)(local_58 != 5);
              }
            }
            if (uVar20 == 0) {
              local_a8[1] = 3;
            }
            else {
              pwVar15 = &local_68;
              if (7 < local_50) {
                pwVar15 = pwVar17;
              }
              uVar13 = 0xd;
              if (local_58 < 0xd) {
                uVar13 = local_58;
              }
              pwVar16 = L"ATTACK_CANCEL";
              for (; uVar20 = uVar6, uVar13 != 0; uVar13 = uVar13 - 1) {
                if (*pwVar15 != *pwVar16) {
                  uVar20 = 1;
                  if ((ushort)*pwVar15 < (ushort)*pwVar16) {
                    uVar20 = 0xffffffff;
                  }
                  break;
                }
                pwVar15 = pwVar15 + 1;
                pwVar16 = pwVar16 + 1;
              }
              if (uVar20 == 0) {
                if (local_58 < 0xd) {
                  uVar20 = 0xffffffff;
                }
                else {
                  uVar20 = (uint)(local_58 != 0xd);
                }
              }
              if (uVar20 == 0) {
                local_a8[1] = 4;
              }
              else {
                pwVar15 = &local_68;
                if (7 < local_50) {
                  pwVar15 = pwVar17;
                }
                uVar13 = 0xd;
                if (local_58 < 0xd) {
                  uVar13 = local_58;
                }
                pwVar17 = L"DAMAGE_CANCEL";
                for (; uVar13 != 0; uVar13 = uVar13 - 1) {
                  if (*pwVar15 != *pwVar17) {
                    uVar6 = 1;
                    if ((ushort)*pwVar15 < (ushort)*pwVar17) {
                      uVar6 = 0xffffffff;
                    }
                    break;
                  }
                  pwVar15 = pwVar15 + 1;
                  pwVar17 = pwVar17 + 1;
                }
                if (uVar6 == 0) {
                  if (local_58 < 0xd) {
                    uVar6 = 0xffffffff;
                  }
                  else {
                    uVar6 = (uint)(local_58 != 0xd);
                  }
                }
                if (uVar6 == 0) {
                  local_a8[1] = 5;
                }
              }
            }
          }
        }
      }
      uVar7 = FUN_1402970c0(lVar8,L"nSgUp");
      local_b8 = 1;
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nSgUp");
      local_a8[2] = *puVar9;
      puVar9 = (undefined4 *)FUN_140342d30(local_80,local_a8 + 1,&local_a8);
      FUN_14030e3c0(param_1 + 0x30,*puVar9,puVar9 + 2);
      plVar14 = local_70;
      if (local_70 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_70 + 1;
        lVar11 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar19 = local_98;
        if ((int)lVar11 == 1) {
          (**(code **)(*local_70 + 8))(local_70);
          LOCK();
          piVar2 = (int *)((longlong)plVar14 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar19 = local_98;
          if (iVar3 == 1) {
            (**(code **)(*plVar14 + 0x10))(plVar14);
            puVar19 = local_98;
          }
        }
      }
      if (7 < local_50) {
        operator_delete((void *)CONCAT62(uStack_66,local_68));
      }
      plVar14 = local_a0;
      local_50 = 7;
      local_58 = 0;
      local_68 = L'\0';
      puVar9 = puVar19;
      if (local_a0 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_a0 + 1;
        lVar11 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar9 = local_98;
        if ((int)lVar11 == 1) {
          (**(code **)(*local_a0 + 8))(local_a0);
          LOCK();
          piVar2 = (int *)((longlong)plVar14 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar9 = local_98;
          if (iVar3 == 1) {
            (**(code **)(*plVar14 + 0x10))(plVar14);
            puVar9 = local_98;
          }
        }
      }
      puVar19 = *(undefined4 **)(puVar9 + 6);
      if (puVar19 == (undefined4 *)0x0) {
        uVar6 = (uint)puVar9[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar11 = (longlong)(int)uVar6 << 3;
        puVar19 = puVar18;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar6) break;
          if (*(longlong *)(lVar11 + *(longlong *)(lVar8 + 0x68)) != 0) {
            puVar19 = *(undefined4 **)(lVar11 + *(longlong *)(lVar8 + 0x68));
          }
          uVar6 = uVar6 + 1;
          lVar11 = lVar11 + 8;
        } while (puVar19 == (undefined4 *)0x0);
      }
      goto LAB_140343960;
    }
    uVar12 = 1;
  }
  return uVar12;
}



undefined4 FUN_140343e70(longlong param_1,uint param_2)

{
  uint *puVar1;
  
  if (*(longlong *)(param_1 + 0x30) != 0) {
    for (puVar1 = *(uint **)(*(longlong *)(param_1 + 0x30) +
                            ((ulonglong)param_2 % (ulonglong)*(uint *)(param_1 + 0x40)) * 8);
        puVar1 != (uint *)0x0; puVar1 = *(uint **)(puVar1 + 6)) {
      if ((puVar1[8] == param_2) && (*puVar1 == param_2)) {
        if (puVar1 == (uint *)0x0) {
          return 0;
        }
        return *(undefined4 *)(*(longlong *)(puVar1 + 2) + 8);
      }
    }
  }
  return 0;
}



undefined8 * FUN_140343ec0(undefined8 *param_1,undefined8 *param_2)

{
  longlong *plVar1;
  int *piVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong *plVar5;
  
  lVar3 = param_2[1];
  uVar4 = *param_2;
  if (lVar3 != 0) {
    LOCK();
    *(int *)(lVar3 + 8) = *(int *)(lVar3 + 8) + 1;
    UNLOCK();
  }
  *param_1 = uVar4;
  plVar5 = (longlong *)param_1[1];
  param_1[1] = lVar3;
  if (plVar5 != (longlong *)0x0) {
    LOCK();
    plVar1 = plVar5 + 1;
    *(int *)plVar1 = (int)*plVar1 + -1;
    UNLOCK();
    if ((int)*plVar1 == 0) {
      (**(code **)(*plVar5 + 8))(plVar5);
      LOCK();
      piVar2 = (int *)((longlong)plVar5 + 0xc);
      *piVar2 = *piVar2 + -1;
      UNLOCK();
      if (*piVar2 == 0) {
        (**(code **)(*plVar5 + 0x10))(plVar5);
      }
    }
    return param_1;
  }
  return param_1;
}



undefined8 * FUN_140343f50(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;
}



void FUN_140343fc0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  if (*(longlong *)(param_1 + 0x38) != 0) {
    FUN_1402ce6b0(*(longlong *)(param_1 + 0x38),*(undefined8 *)(param_1 + 0x40),param_3,param_4,
                  0xfffffffffffffffe);
    operator_delete(*(void **)(param_1 + 0x38));
  }
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined8 *)(param_1 + 0x48) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x28)) {
    operator_delete(*(void **)(param_1 + 0x10));
  }
  *(undefined8 *)(param_1 + 0x28) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  return;
}



undefined8 FUN_140344040(longlong param_1)

{
  longlong *plVar1;
  int iVar2;
  undefined4 uVar3;
  void **ppvVar4;
  void **ppvVar5;
  undefined8 *puVar6;
  undefined1 uVar7;
  uint uVar8;
  undefined4 uVar9;
  longlong lVar10;
  ulonglong uVar11;
  void *pvVar12;
  int *piVar13;
  undefined8 uVar14;
  undefined8 uVar15;
  undefined2 *puVar16;
  undefined4 *puVar17;
  short *psVar18;
  longlong *plVar19;
  longlong lVar20;
  undefined4 *puVar21;
  short *psVar22;
  undefined8 *puVar23;
  bool bVar24;
  void *local_40;
  longlong *local_38;
  undefined4 *local_30;
  
  lVar10 = FUN_1402933b0(DAT_140607ff0);
  uVar14 = 0;
  if (lVar10 != 0) {
    if (*(longlong *)(lVar10 + 0x70) != 0) {
      uVar11 = 0;
      if (*(uint *)(lVar10 + 0x78) != 0) {
        plVar19 = *(longlong **)(lVar10 + 0x68);
        do {
          if (*plVar19 != 0) {
            puVar21 = (undefined4 *)(*(longlong **)(lVar10 + 0x68))[uVar11];
            goto LAB_1403440ba;
          }
          uVar8 = (int)uVar11 + 1;
          uVar11 = (ulonglong)uVar8;
          plVar19 = plVar19 + 1;
        } while (uVar8 < *(uint *)(lVar10 + 0x78));
      }
    }
    puVar21 = (undefined4 *)0x0;
LAB_1403440ba:
    if (puVar21 != (undefined4 *)0x0) {
      uVar3 = *puVar21;
      local_30 = puVar21;
      pvVar12 = operator_new(0x24);
      local_40 = pvVar12;
      FUN_1403445b0(&local_38,pvVar12);
      FUN_140178e90(&local_40,pvVar12,pvVar12);
      uVar9 = FUN_1402970c0(lVar10,L"nConditionType");
      piVar13 = (int *)FUN_140296600(lVar10,uVar3,uVar9,L"nConditionType",1);
      *(bool *)local_40 = *piVar13 != 0;
      uVar9 = FUN_1402970c0(lVar10,L"szPetCondition");
      uVar14 = FUN_140296990(lVar10,uVar3,uVar9,L"szPetCondition",1);
      uVar9 = FUN_1402970c0(lVar10,L"szMasterCondition");
      uVar15 = FUN_140296990(lVar10,uVar3,uVar9,L"szMasterCondition",1);
      uVar7 = FUN_140344500(uVar14,uVar15);
      *(undefined1 *)((longlong)local_40 + 1) = uVar7;
      uVar7 = FUN_140344500(uVar15);
      *(undefined1 *)((longlong)local_40 + 2) = uVar7;
      uVar9 = FUN_1402970c0(lVar10,L"nPetLevelMin");
      puVar16 = (undefined2 *)FUN_140296600(lVar10,uVar3,uVar9,L"nPetLevelMin",1);
      *(undefined2 *)((longlong)local_40 + 4) = *puVar16;
      uVar9 = FUN_1402970c0(lVar10,L"nPetLevelMax");
      puVar16 = (undefined2 *)FUN_140296600(lVar10,uVar3,uVar9,L"nPetLevelMax",1);
      *(undefined2 *)((longlong)local_40 + 6) = *puVar16;
      uVar9 = FUN_1402970c0(lVar10,&DAT_14049f290);
      puVar17 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar9,&DAT_14049f290,1);
      *(undefined4 *)((longlong)local_40 + 8) = *puVar17;
      uVar9 = FUN_1402970c0(lVar10,L"nUsingPetSkill");
      puVar17 = (undefined4 *)FUN_140296600(lVar10,uVar3,uVar9,L"nUsingPetSkill",1);
      *(undefined4 *)((longlong)local_40 + 0xc) = *puVar17;
      uVar9 = FUN_1402970c0(lVar10,L"nSkillLevel");
      puVar16 = (undefined2 *)FUN_140296600(lVar10,uVar3,uVar9,L"nSkillLevel",1);
      *(undefined2 *)((longlong)local_40 + 0x10) = *puVar16;
      uVar9 = FUN_1402970c0(lVar10,L"nNextLevel");
      puVar16 = (undefined2 *)FUN_140296600(lVar10,uVar3,uVar9,L"nNextLevel",1);
      *(undefined2 *)((longlong)local_40 + 0x12) = *puVar16;
      uVar9 = FUN_1402970c0(lVar10,L"fPetConditionValue");
      puVar17 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar9,L"fPetConditionValue",1);
      *(undefined4 *)((longlong)local_40 + 0x14) = *puVar17;
      uVar9 = FUN_1402970c0(lVar10,L"fMasterConditionValue");
      puVar17 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar9,L"fMasterConditionValue",1);
      *(undefined4 *)((longlong)local_40 + 0x18) = *puVar17;
      uVar9 = FUN_1402970c0(lVar10,L"szTarget");
      psVar18 = (short *)FUN_140296990(lVar10,uVar3,uVar9,L"szTarget",0);
      bVar24 = psVar18 == (short *)0x0;
      if (!bVar24) {
        lVar20 = 7;
        psVar22 = &DAT_1404d41c0;
        do {
          if (lVar20 == 0) break;
          lVar20 = lVar20 + -1;
          bVar24 = *psVar18 == *psVar22;
          psVar18 = psVar18 + 1;
          psVar22 = psVar22 + 1;
        } while (bVar24);
        *(uint *)((longlong)local_40 + 0x1c) = (uint)bVar24;
        uVar9 = FUN_1402970c0(lVar10,L"fTargetValue");
        puVar17 = (undefined4 *)FUN_1402967b0(lVar10,uVar3,uVar9,L"fTargetValue",0);
        if (puVar17 != (undefined4 *)0x0) {
          *(undefined4 *)((longlong)local_40 + 0x20) = *puVar17;
        }
      }
      ppvVar4 = *(void ***)(param_1 + 0x40);
      if ((&local_40 < ppvVar4) && (ppvVar5 = *(void ***)(param_1 + 0x38), ppvVar5 <= &local_40)) {
        if (ppvVar4 == *(void ***)(param_1 + 0x48)) {
          FUN_1403435d0(param_1 + 0x38);
        }
        puVar23 = (undefined8 *)
                  (((longlong)&local_40 - (longlong)ppvVar5 & 0xfffffffffffffff0U) +
                  *(longlong *)(param_1 + 0x38));
        puVar6 = *(undefined8 **)(param_1 + 0x40);
        if (puVar6 != (undefined8 *)0x0) {
          *puVar6 = *puVar23;
          lVar20 = puVar23[1];
          puVar6[1] = lVar20;
          if (lVar20 != 0) {
            LOCK();
            *(int *)(lVar20 + 8) = *(int *)(lVar20 + 8) + 1;
            UNLOCK();
            puVar21 = local_30;
          }
        }
      }
      else {
        if (ppvVar4 == *(void ***)(param_1 + 0x48)) {
          FUN_1403435d0(param_1 + 0x38);
        }
        puVar6 = *(undefined8 **)(param_1 + 0x40);
        if (puVar6 != (undefined8 *)0x0) {
          *puVar6 = local_40;
          puVar6[1] = local_38;
          if (local_38 != (longlong *)0x0) {
            LOCK();
            *(int *)(local_38 + 1) = (int)local_38[1] + 1;
            UNLOCK();
            puVar21 = local_30;
          }
        }
      }
      plVar19 = local_38;
      *(longlong *)(param_1 + 0x40) = *(longlong *)(param_1 + 0x40) + 0x10;
      puVar17 = puVar21;
      if (local_38 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_38 + 1;
        lVar20 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar17 = local_30;
        if ((int)lVar20 == 1) {
          (**(code **)(*local_38 + 8))(local_38);
          LOCK();
          piVar13 = (int *)((longlong)plVar19 + 0xc);
          iVar2 = *piVar13;
          *piVar13 = *piVar13 + -1;
          UNLOCK();
          puVar17 = local_30;
          if (iVar2 == 1) {
            (**(code **)(*plVar19 + 0x10))(plVar19);
            puVar17 = local_30;
          }
        }
      }
      puVar21 = *(undefined4 **)(puVar17 + 6);
      if (puVar21 == (undefined4 *)0x0) {
        uVar8 = (uint)puVar17[8] % *(uint *)(lVar10 + 0x78) + 1;
        lVar20 = (longlong)(int)uVar8 << 3;
        do {
          if (*(uint *)(lVar10 + 0x78) <= uVar8) break;
          if (*(longlong *)(*(longlong *)(lVar10 + 0x68) + lVar20) != 0) {
            puVar21 = *(undefined4 **)(*(longlong *)(lVar10 + 0x68) + lVar20);
          }
          uVar8 = uVar8 + 1;
          lVar20 = lVar20 + 8;
        } while (puVar21 == (undefined4 *)0x0);
      }
      goto LAB_1403440ba;
    }
    uVar14 = 1;
  }
  return uVar14;
}



undefined8 FUN_140344500(wchar_t *param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  wchar_t *pwVar3;
  wchar_t *pwVar4;
  undefined1 in_ZF;
  bool bVar5;
  
  lVar2 = 9;
  pwVar3 = param_1;
  pwVar4 = L"HP_RATIO";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    in_ZF = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while ((bool)in_ZF);
  if ((bool)in_ZF) {
    return 1;
  }
  lVar2 = 7;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"DAMAGE";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 2;
  }
  lVar2 = 6;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"RANGE";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 3;
  }
  lVar2 = 6;
  bVar5 = false;
  pwVar3 = L"STATE";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *param_1 == *pwVar3;
    param_1 = param_1 + 1;
    pwVar3 = pwVar3 + 1;
  } while (bVar5);
  uVar1 = 0;
  if (bVar5) {
    uVar1 = 4;
  }
  return uVar1;
}



undefined8 * FUN_1403445b0(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;
}



// WARNING: Removing unreachable block (ram,0x00014034467a)
// WARNING: Removing unreachable block (ram,0x000140344683)
// WARNING: Removing unreachable block (ram,0x0001403446a1)
// WARNING: Removing unreachable block (ram,0x0001403446aa)

undefined8 * FUN_140344620(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 2) = 0x11;
  *(undefined4 *)((longlong)param_1 + 0x34) = 10;
  *param_1 = 0;
  param_1[1] = 0;
  *(undefined4 *)(param_1 + 6) = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  *(undefined4 *)((longlong)param_1 + 0x14) = 0x3f400000;
  *(undefined4 *)(param_1 + 3) = 0x3e800000;
  *(undefined4 *)((longlong)param_1 + 0x1c) = 0x40100000;
  param_1[4] = 0x26;
  param_1[5] = 0;
  param_1[0xc] = 7;
  param_1[0xb] = 0;
  *(undefined2 *)(param_1 + 9) = 0;
  *(undefined4 *)((longlong)param_1 + 0x74) = 0;
  param_1[0xf] = 0;
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403446e0(longlong param_1,short *param_2,undefined4 param_3)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined4 *puVar7;
  short *psVar8;
  longlong lVar9;
  undefined8 uVar10;
  ulonglong uVar11;
  longlong *plVar12;
  undefined4 *puVar13;
  short *psVar14;
  undefined1 auStack_358 [32];
  undefined1 local_338;
  undefined4 local_328 [2];
  undefined8 local_320;
  undefined4 local_318;
  undefined4 local_314;
  undefined4 local_310;
  undefined4 local_30c;
  undefined2 local_308;
  undefined6 uStack_306;
  undefined8 local_2f8;
  ulonglong local_2f0;
  undefined2 local_2e0;
  undefined6 uStack_2de;
  undefined8 local_2d0;
  ulonglong local_2c8;
  undefined1 local_2b8 [24];
  void *local_2a0;
  ulonglong local_288;
  undefined2 local_278;
  undefined6 uStack_276;
  undefined8 local_268;
  ulonglong local_260;
  undefined1 local_248 [512];
  ulonglong local_48;
  undefined4 *puVar6;
  
  local_320 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_358;
  FUN_14012f380(local_248,L"%s%02d",param_2,param_3);
  lVar5 = FUN_1402933b0(DAT_140607ff0,local_248);
  uVar10 = 0;
  if (lVar5 != 0) {
    uVar11 = 0xffffffffffffffff;
    psVar14 = param_2;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar14;
      psVar14 = psVar14 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x48,param_2,~uVar11 - 1);
    *(undefined4 *)(param_1 + 0x70) = param_3;
    FUN_1402fcbf0(param_1);
    puVar13 = (undefined4 *)0x0;
    puVar7 = puVar13;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar6 = puVar13;
      plVar12 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar12 != 0) {
          puVar7 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar3 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar3;
        plVar12 = plVar12 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_1403447b1:
    puVar6 = puVar7;
    if (puVar6 != (undefined4 *)0x0) {
      uVar2 = *puVar6;
      local_2f0 = 7;
      local_2f8 = 0;
      local_308 = 0;
      local_2c8 = 7;
      local_2d0 = 0;
      local_2e0 = 0;
      local_328[0] = uVar2;
      local_318 = uVar2;
      uVar4 = FUN_1402970c0(lVar5,L"nMaxLimitCount");
      local_338 = 1;
      puVar7 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nMaxLimitCount");
      local_314 = *puVar7;
      uVar4 = FUN_1402970c0(lVar5,L"nUIArea");
      local_338 = 1;
      puVar7 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nUIArea");
      local_310 = *puVar7;
      uVar4 = FUN_1402970c0(lVar5,L"nStringID");
      local_338 = 1;
      puVar7 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nStringID");
      local_30c = *puVar7;
      uVar4 = FUN_1402970c0(lVar5,L"szUIIcon");
      local_338 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szUIIcon");
      uVar11 = 0xffffffffffffffff;
      psVar14 = psVar8;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar1 = *psVar14;
        psVar14 = psVar14 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_308,psVar8,~uVar11 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"szUIIcon_BG");
      local_338 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szUIIcon_BG");
      uVar11 = 0xffffffffffffffff;
      psVar14 = psVar8;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar1 = *psVar14;
        psVar14 = psVar14 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_2e0,psVar8,~uVar11 - 1);
      puVar7 = (undefined4 *)FUN_140344ad0(local_2b8,local_328,&local_318);
      FUN_140344a10(param_1,*puVar7,puVar7 + 2);
      if (7 < local_260) {
        operator_delete((void *)CONCAT62(uStack_276,local_278));
      }
      local_260 = 7;
      local_268 = 0;
      local_278 = 0;
      if (7 < local_288) {
        operator_delete(local_2a0);
      }
      if (7 < local_2c8) {
        operator_delete((void *)CONCAT62(uStack_2de,local_2e0));
      }
      local_2c8 = 7;
      local_2d0 = 0;
      local_2e0 = 0;
      if (7 < local_2f0) {
        operator_delete((void *)CONCAT62(uStack_306,local_308));
      }
      puVar7 = *(undefined4 **)(puVar6 + 6);
      if (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar6[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar9 = (longlong)(int)uVar3 << 3;
        puVar7 = puVar13;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar9) != 0) {
            puVar7 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar9);
          }
          uVar3 = uVar3 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar7 == (undefined4 *)0x0);
      }
      goto LAB_1403447b1;
    }
    uVar10 = 1;
  }
  return uVar10;
}



void FUN_140344a00(longlong param_1)

{
  FUN_1402f46e0(param_1 + 8);
  return;
}



uint * FUN_140344a10(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x1a)) {
      if ((puVar2[0x1c] == param_2) && (*puVar2 == param_2)) {
        FUN_140344b00(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_1402fd280(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_140344b00(puVar2 + 2,param_3);
  return puVar2;
}



undefined4 * FUN_140344ad0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140344be0(param_1 + 2,param_3);
  return param_1;
}



undefined4 * FUN_140344b00(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];
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0xe,param_2 + 0xe,0,0xffffffffffffffff);
  return param_1;
}



void FUN_140344b60(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0x70) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x68); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x68))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x68) = *(undefined8 *)(param_2 + 0x68);
      FUN_1402fcfe0(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x68);
  FUN_1402fcfe0(param_1,param_2);
  return;
}



undefined4 * FUN_140344be0(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];
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined8 *)(param_1 + 0x14) = 7;
  *(undefined8 *)(param_1 + 0x12) = 0;
  *(undefined2 *)(param_1 + 0xe) = 0;
  FUN_1400015e0(param_1 + 0xe,param_2 + 0xe,0,0xffffffffffffffff);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140344c80(longlong param_1,short *param_2,undefined4 param_3)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  undefined4 *puVar7;
  short *psVar8;
  int *piVar9;
  longlong lVar10;
  undefined8 uVar11;
  ulonglong uVar12;
  longlong *plVar13;
  undefined4 *puVar14;
  short *psVar15;
  undefined1 auStack_3c8 [32];
  undefined1 local_3a8;
  undefined4 local_398 [2];
  undefined8 local_390;
  undefined4 local_388;
  undefined4 local_384;
  undefined4 local_380;
  undefined2 local_378;
  undefined6 uStack_376;
  undefined8 local_368;
  ulonglong local_360;
  float local_350;
  undefined4 local_34c;
  undefined2 local_348;
  undefined6 uStack_346;
  undefined8 local_338;
  ulonglong local_330;
  undefined2 local_320;
  undefined6 uStack_31e;
  undefined8 local_310;
  ulonglong local_308;
  undefined1 local_2f8 [8];
  undefined1 local_2f0 [152];
  undefined1 local_258 [512];
  ulonglong local_58;
  undefined4 *puVar6;
  
  local_390 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_3c8;
  FUN_14012f380(local_258,L"%s%02d",param_2,param_3);
  lVar5 = FUN_1402933b0(DAT_140607ff0,local_258);
  uVar11 = 0;
  if (lVar5 != 0) {
    uVar12 = 0xffffffffffffffff;
    psVar15 = param_2;
    do {
      if (uVar12 == 0) break;
      uVar12 = uVar12 - 1;
      sVar1 = *psVar15;
      psVar15 = psVar15 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x48,param_2,~uVar12 - 1);
    *(undefined4 *)(param_1 + 0x70) = param_3;
    FUN_1402f44a0(param_1);
    puVar14 = (undefined4 *)0x0;
    puVar7 = puVar14;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar6 = puVar14;
      plVar13 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar13 != 0) {
          puVar7 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar3 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar3;
        plVar13 = plVar13 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_140344d63:
    puVar6 = puVar7;
    if (puVar6 != (undefined4 *)0x0) {
      uVar2 = *puVar6;
      local_360 = 7;
      local_368 = 0;
      local_378 = 0;
      local_330 = 7;
      local_338 = 0;
      local_348 = 0;
      local_308 = 7;
      local_310 = 0;
      local_320 = 0;
      local_398[0] = uVar2;
      local_388 = uVar2;
      uVar4 = FUN_1402970c0(lVar5,L"nType");
      local_3a8 = 1;
      puVar7 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nType");
      local_384 = *puVar7;
      uVar4 = FUN_1402970c0(lVar5,L"nMaxLimitCount");
      local_3a8 = 1;
      puVar7 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nMaxLimitCount");
      local_380 = *puVar7;
      uVar4 = FUN_1402970c0(lVar5,L"szReloadMotion");
      local_3a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szReloadMotion");
      uVar12 = 0xffffffffffffffff;
      psVar15 = psVar8;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_378,psVar8,~uVar12 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"nReloadFrame");
      local_3a8 = 1;
      piVar9 = (int *)FUN_140296600(lVar5,uVar2,uVar4,L"nReloadFrame");
      local_350 = (float)*piVar9 / 30.0;
      uVar4 = FUN_1402970c0(lVar5,L"nReloadCount");
      local_3a8 = 1;
      puVar7 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nReloadCount");
      local_34c = *puVar7;
      uVar4 = FUN_1402970c0(lVar5,L"szUIIcon");
      local_3a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szUIIcon");
      uVar12 = 0xffffffffffffffff;
      psVar15 = psVar8;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_348,psVar8,~uVar12 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"szUIIcon_BG");
      local_3a8 = 1;
      psVar8 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szUIIcon_BG");
      uVar12 = 0xffffffffffffffff;
      psVar15 = psVar8;
      do {
        if (uVar12 == 0) break;
        uVar12 = uVar12 - 1;
        sVar1 = *psVar15;
        psVar15 = psVar15 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_320,psVar8,~uVar12 - 1);
      puVar7 = (undefined4 *)FUN_140345130(local_2f8,local_398,&local_388);
      FUN_140345060(param_1,*puVar7,puVar7 + 2);
      FUN_1402f4740(local_2f0);
      if (7 < local_308) {
        operator_delete((void *)CONCAT62(uStack_31e,local_320));
      }
      local_308 = 7;
      local_310 = 0;
      local_320 = 0;
      if (7 < local_330) {
        operator_delete((void *)CONCAT62(uStack_346,local_348));
      }
      local_330 = 7;
      local_338 = 0;
      local_348 = 0;
      if (7 < local_360) {
        operator_delete((void *)CONCAT62(uStack_376,local_378));
      }
      puVar7 = *(undefined4 **)(puVar6 + 6);
      if (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar6[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar10 = (longlong)(int)uVar3 << 3;
        puVar7 = puVar14;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(*(longlong *)(lVar5 + 0x68) + lVar10) != 0) {
            puVar7 = *(undefined4 **)(*(longlong *)(lVar5 + 0x68) + lVar10);
          }
          uVar3 = uVar3 + 1;
          lVar10 = lVar10 + 8;
        } while (puVar7 == (undefined4 *)0x0);
      }
      goto LAB_140344d63;
    }
    uVar11 = 1;
  }
  return uVar11;
}



void FUN_140345050(longlong param_1)

{
  FUN_1402f4740(param_1 + 8);
  return;
}



uint * FUN_140345060(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_1402c6d50(param_1,uVar3,1,uVar3,0xfffffffffffffffe);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  else {
    for (puVar2 = *(uint **)(*param_1 + ((ulonglong)param_2 % uVar3) * 8); puVar2 != (uint *)0x0;
        puVar2 = *(uint **)(puVar2 + 0x26)) {
      if ((puVar2[0x28] == param_2) && (*puVar2 == param_2)) {
        FUN_140345160(puVar2 + 2,param_3);
        return puVar2;
      }
    }
  }
  puVar2 = (uint *)FUN_140345270(param_1,param_2,(ulonglong)param_2 % uVar3,param_2);
  FUN_140345160(puVar2 + 2,param_3);
  return puVar2;
}



undefined4 * FUN_140345130(undefined4 *param_1,undefined4 *param_2,undefined8 param_3)

{
  *param_1 = *param_2;
  FUN_140345410(param_1 + 2,param_3);
  return param_1;
}



undefined4 * FUN_140345160(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff);
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  FUN_1400015e0(param_1 + 0x10,param_2 + 0x10,0,0xffffffffffffffff);
  FUN_1400015e0(param_1 + 0x1a,param_2 + 0x1a,0,0xffffffffffffffff);
  return param_1;
}



void FUN_1403451e0(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong lVar4;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar1 = *param_1;
  uVar3 = (ulonglong)*(uint *)(param_2 + 0xa0) % (ulonglong)*(uint *)(param_1 + 2);
  if (param_2 != *(longlong *)(lVar1 + uVar3 * 8)) {
    lVar2 = *(longlong *)(lVar1 + uVar3 * 8);
    for (lVar4 = *(longlong *)(lVar2 + 0x98); lVar4 != param_2; lVar4 = *(longlong *)(lVar4 + 0x98))
    {
      lVar2 = lVar4;
    }
    if (lVar2 != 0) {
      *(undefined8 *)(lVar2 + 0x98) = *(undefined8 *)(param_2 + 0x98);
      FUN_1402f4640(param_1,param_2);
      return;
    }
  }
  *(undefined8 *)(lVar1 + uVar3 * 8) = *(undefined8 *)(param_2 + 0x98);
  FUN_1402f4640(param_1,param_2);
  return;
}



undefined4 *
FUN_140345270(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) < 0xa8)
      goto LAB_14034533d;
      lVar7 = uVar6 * 0xa8;
    }
    if ((-lVar7 - 1U < 0x10) || (plVar5 = malloc(lVar7 + 0x10), plVar5 == (longlong *)0x0)) {
LAB_14034533d:
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    *plVar5 = param_1[7];
    param_1[7] = (longlong)plVar5;
    iVar1 = *(int *)((longlong)param_1 + 0x34);
    plVar5 = plVar5 + (ulonglong)(iVar1 - 1) * 0x15 + 2;
    while (iVar1 = iVar1 + -1, -1 < iVar1) {
      plVar5[0x13] = param_1[8];
      param_1[8] = (longlong)plVar5;
      plVar5 = plVar5 + -0x15;
    }
  }
  puVar2 = (undefined4 *)param_1[8];
  if (puVar2 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  param_1[8] = *(longlong *)(puVar2 + 0x26);
  *puVar2 = param_2;
  *(undefined8 *)(puVar2 + 0xc) = 7;
  *(undefined8 *)(puVar2 + 10) = 0;
  *(undefined2 *)(puVar2 + 6) = 0;
  *(undefined8 *)(puVar2 + 0x18) = 7;
  *(undefined8 *)(puVar2 + 0x16) = 0;
  *(undefined2 *)(puVar2 + 0x12) = 0;
  *(undefined8 *)(puVar2 + 0x22) = 7;
  *(undefined8 *)(puVar2 + 0x20) = 0;
  *(undefined2 *)(puVar2 + 0x1c) = 0;
  puVar2[0x28] = param_4;
  param_1[1] = param_1[1] + 1;
  *(undefined8 *)(puVar2 + 0x26) = *(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_1402cddb0(param_1);
    FUN_1402f47d0(param_1,uVar4);
  }
  return puVar2;
}



undefined4 * FUN_140345410(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  param_1[2] = param_2[2];
  *(undefined8 *)(param_1 + 10) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *(undefined2 *)(param_1 + 4) = 0;
  FUN_1400015e0(param_1 + 4,param_2 + 4,0,0xffffffffffffffff,0xfffffffffffffffe);
  param_1[0xe] = param_2[0xe];
  param_1[0xf] = param_2[0xf];
  *(undefined8 *)(param_1 + 0x16) = 7;
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined2 *)(param_1 + 0x10) = 0;
  FUN_1400015e0(param_1 + 0x10,param_2 + 0x10,0,0xffffffffffffffff);
  *(undefined8 *)(param_1 + 0x20) = 7;
  *(undefined8 *)(param_1 + 0x1e) = 0;
  *(undefined2 *)(param_1 + 0x1a) = 0;
  FUN_1400015e0(param_1 + 0x1a,param_2 + 0x1a,0,0xffffffffffffffff);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403454d0(longlong param_1,short *param_2)

{
  short sVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined4 uVar4;
  longlong lVar5;
  short *psVar7;
  undefined4 *puVar8;
  void **_Src;
  longlong lVar9;
  undefined8 uVar10;
  ulonglong uVar11;
  longlong *plVar12;
  undefined4 *puVar13;
  short *psVar14;
  undefined1 auStack_1a8 [32];
  undefined1 local_188;
  undefined8 local_178;
  undefined1 local_170 [56];
  void *local_138 [2];
  void *local_128;
  void *local_120;
  undefined4 local_110;
  undefined2 local_108;
  undefined6 uStack_106;
  undefined8 local_f8;
  ulonglong local_f0;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8 [2];
  undefined2 local_d0;
  undefined6 uStack_ce;
  undefined8 local_c0;
  ulonglong local_b8;
  undefined4 local_a8;
  undefined4 local_a4;
  void *local_98 [3];
  ulonglong local_80;
  undefined2 local_68;
  undefined6 uStack_66;
  undefined8 local_58;
  ulonglong local_50;
  ulonglong local_38;
  undefined4 *puVar6;
  
  local_178 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_1a8;
  lVar5 = FUN_1402933b0();
  uVar10 = 0;
  if (lVar5 != 0) {
    uVar11 = 0xffffffffffffffff;
    psVar14 = param_2;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar14;
      psVar14 = psVar14 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x40,param_2,~uVar11 - 1);
    FUN_1403459f0(param_1);
    puVar13 = (undefined4 *)0x0;
    puVar8 = puVar13;
    if ((*(longlong *)(lVar5 + 0x70) != 0) && (*(uint *)(lVar5 + 0x78) != 0)) {
      puVar6 = puVar13;
      plVar12 = *(longlong **)(lVar5 + 0x68);
      do {
        if (*plVar12 != 0) {
          puVar8 = (undefined4 *)(*(longlong **)(lVar5 + 0x68))[(longlong)puVar6];
          break;
        }
        uVar3 = (int)puVar6 + 1;
        puVar6 = (undefined4 *)(ulonglong)uVar3;
        plVar12 = plVar12 + 1;
      } while (uVar3 < *(uint *)(lVar5 + 0x78));
    }
LAB_140345582:
    puVar6 = puVar8;
    if (puVar6 != (undefined4 *)0x0) {
      uVar2 = *puVar6;
      local_b8 = 7;
      local_c0 = 0;
      local_d0 = 0;
      local_d8[0] = uVar2;
      uVar4 = FUN_1402970c0(lVar5,L"szName");
      local_188 = 1;
      psVar7 = (short *)FUN_140296990(lVar5,uVar2,uVar4,L"szName");
      uVar11 = 0xffffffffffffffff;
      psVar14 = psVar7;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar1 = *psVar14;
        psVar14 = psVar14 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_d0,psVar7,~uVar11 - 1);
      uVar4 = FUN_1402970c0(lVar5,L"nUseBulletID");
      local_188 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nUseBulletID");
      local_a8 = *puVar8;
      uVar4 = FUN_1402970c0(lVar5,L"nUseBulletCount");
      local_188 = 1;
      puVar8 = (undefined4 *)FUN_140296600(lVar5,uVar2,uVar4,L"nUseBulletCount");
      local_a4 = *puVar8;
      _Src = (void **)FUN_140345960(local_98,&local_d0,local_d8);
      local_120 = (void *)0x7;
      local_128 = (void *)0x0;
      uVar11 = (ulonglong)local_138[0] >> 0x10;
      local_138[0] = (void *)(uVar11 << 0x10);
      if (local_138 != _Src) {
        local_120 = (void *)0x7;
        local_128 = (void *)0x0;
        local_138[0] = (void *)(uVar11 << 0x10);
        if (_Src[3] < (void *)0x8) {
          memmove(local_138,_Src,((longlong)_Src[2] + 1) * 2);
        }
        else {
          local_138[0] = *_Src;
          *_Src = (void *)0x0;
        }
        local_128 = _Src[2];
        local_120 = _Src[3];
        _Src[2] = (void *)0x0;
        _Src[3] = (void *)0x0;
      }
      local_110 = *(undefined4 *)(_Src + 5);
      local_f0 = 7;
      local_f8 = 0;
      local_108 = 0;
      FUN_1400015e0(&local_108,_Src + 6,0,0xffffffffffffffff);
      local_e0 = *(undefined4 *)(_Src + 0xb);
      local_dc = *(undefined4 *)((longlong)_Src + 0x5c);
      if (*(longlong *)(param_1 + 0x20) == 0) {
        FUN_140345bf0(param_1,local_170,local_138);
      }
      else {
        FUN_140345ad0();
      }
      if (7 < local_f0) {
        operator_delete((void *)CONCAT62(uStack_106,local_108));
      }
      local_f0 = 7;
      local_f8 = 0;
      local_108 = 0;
      if ((void *)0x7 < local_120) {
        operator_delete(local_138[0]);
      }
      local_120 = (void *)0x7;
      local_128 = (void *)0x0;
      local_138[0] = (void *)((ulonglong)local_138[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_80) {
        operator_delete(local_98[0]);
      }
      if (7 < local_b8) {
        operator_delete((void *)CONCAT62(uStack_ce,local_d0));
      }
      puVar8 = *(undefined4 **)(puVar6 + 6);
      if (*(undefined4 **)(puVar6 + 6) == (undefined4 *)0x0) {
        uVar3 = (uint)puVar6[8] % *(uint *)(lVar5 + 0x78) + 1;
        lVar9 = (longlong)(int)uVar3 << 3;
        puVar8 = puVar13;
        do {
          if (*(uint *)(lVar5 + 0x78) <= uVar3) break;
          if (*(longlong *)(lVar9 + *(longlong *)(lVar5 + 0x68)) != 0) {
            puVar8 = *(undefined4 **)(lVar9 + *(longlong *)(lVar5 + 0x68));
          }
          uVar3 = uVar3 + 1;
          lVar9 = lVar9 + 8;
        } while (puVar8 == (undefined4 *)0x0);
      }
      goto LAB_140345582;
    }
    uVar10 = 1;
  }
  return uVar10;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_140345830(longlong *param_1,short *param_2)

{
  short sVar1;
  ushort *puVar2;
  longlong lVar3;
  ulonglong uVar4;
  ushort *puVar5;
  ulonglong uVar6;
  short *psVar7;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  ushort local_40;
  undefined6 uStack_3e;
  longlong local_30;
  ulonglong local_28;
  ulonglong local_18;
  
  local_48 = 0xfffffffffffffffe;
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  local_28 = 7;
  uVar6 = 0;
  local_30 = 0;
  local_40 = 0;
  uVar4 = 0xffffffffffffffff;
  psVar7 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    sVar1 = *psVar7;
    psVar7 = psVar7 + 1;
  } while (sVar1 != 0);
  FUN_140001710(&local_40,param_2,~uVar4 - 1);
  if (param_1[4] != 0) {
    puVar5 = &local_40;
    if (7 < local_28) {
      puVar5 = (ushort *)CONCAT62(uStack_3e,local_40);
    }
    puVar2 = &local_40;
    if (7 < local_28) {
      puVar2 = (ushort *)CONCAT62(uStack_3e,local_40);
    }
    for (; puVar2 != puVar5 + local_30; puVar2 = puVar2 + 1) {
      uVar6 = uVar6 ^ (uVar6 >> 2) + uVar6 * 0x40 + 0x9e3779b9 + (ulonglong)*puVar2;
    }
    uVar6 = FUN_1402cb0b0(*param_1 + (uVar6 % (ulonglong)param_1[1]) * 8,&local_40);
  }
  if (7 < local_28) {
    operator_delete((void *)CONCAT62(uStack_3e,local_40));
  }
  if (uVar6 == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = uVar6 + 0x30;
  }
  return lVar3;
}



undefined2 * FUN_140345960(undefined2 *param_1,undefined8 param_2,undefined4 *param_3)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined4 *)(param_1 + 0x14) = *param_3;
  *(undefined8 *)(param_1 + 0x24) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  param_1[0x18] = 0;
  FUN_1400015e0(param_1 + 0x18,param_3 + 2,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x2c) = param_3[0xc];
  *(undefined4 *)(param_1 + 0x2e) = param_3[0xd];
  return param_1;
}



void FUN_1403459f0(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[10]) {
          operator_delete((void *)puVar2[7]);
        }
        puVar2[10] = 7;
        puVar2[9] = 0;
        *(undefined2 *)(puVar2 + 7) = 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;
}



longlong * FUN_140345ad0(longlong *param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  char cVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  longlong *local_38;
  undefined8 *local_30;
  undefined2 local_28;
  
  uVar3 = FUN_14015afa0(param_3);
  puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
  lVar4 = FUN_1402cb0b0(puVar6,param_3);
  if (lVar4 == 0) {
    local_30 = (undefined8 *)0x0;
    local_28 = 0;
    local_38 = param_1;
    FUN_140345fc0(&local_38);
    puVar1 = local_30;
    if (local_30 + 1 != (undefined8 *)0x0) {
      FUN_1403460b0(local_30 + 1,param_4);
    }
    local_28 = CONCAT11(1,(undefined1)local_28);
    cVar2 = FUN_140345d40(param_1);
    if (cVar2 != '\0') {
      puVar6 = (undefined8 *)(*param_1 + (uVar3 % (ulonglong)param_1[1]) * 8);
    }
    *puVar1 = *puVar6;
    *puVar6 = puVar1;
    param_1[4] = param_1[4] + 1;
    puVar5 = (undefined8 *)param_1[6];
    if (puVar6 < (undefined8 *)param_1[6]) {
      puVar5 = puVar6;
    }
    param_1[6] = (longlong)puVar5;
    *param_2 = (longlong)puVar6;
    param_2[1] = (longlong)puVar1;
    *(undefined1 *)(param_2 + 2) = 1;
  }
  else {
    *param_2 = (longlong)puVar6;
    param_2[1] = lVar4;
    *(undefined1 *)(param_2 + 2) = 0;
  }
  return param_2;
}



longlong * FUN_140345bf0(longlong *param_1,longlong *param_2)

{
  undefined8 **ppuVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  ulonglong uVar4;
  longlong lVar5;
  undefined8 **ppuVar6;
  undefined8 *local_res8;
  undefined8 *local_res10;
  longlong *local_30;
  undefined8 *local_28;
  undefined2 local_20;
  
  local_28 = (undefined8 *)0x0;
  local_20 = 0;
  local_30 = param_1;
  FUN_140345fc0(&local_30);
  puVar3 = local_28;
  puVar2 = local_28 + 1;
  local_res8 = puVar2;
  local_res10 = puVar2;
  if (puVar2 != (undefined8 *)0x0) {
    FUN_1403460b0(puVar2);
  }
  local_20 = CONCAT11(1,(undefined1)local_20);
  uVar4 = FUN_14015afa0(puVar2);
  if (*param_1 == 0) {
    local_res8 = (undefined8 *)FUN_1402c9710(param_1,1);
    ppuVar1 = (undefined8 **)(param_1 + 1);
    ppuVar6 = &local_res8;
    if (local_res8 <= *ppuVar1) {
      ppuVar6 = ppuVar1;
    }
    *ppuVar1 = *ppuVar6;
    FUN_140346140(param_1);
    FUN_140296160(param_1);
  }
  else {
    local_res10 = (undefined8 *)0x1;
    if ((ulonglong)param_1[7] < 2) {
      local_res8 = (undefined8 *)(((ulonglong)param_1[4] >> 1) + param_1[4]);
      lVar5 = FUN_1402c9710(param_1);
      if (lVar5 != param_1[1]) {
        FUN_140345df0(param_1);
      }
    }
  }
  puVar2 = (undefined8 *)(*param_1 + (uVar4 % (ulonglong)param_1[1]) * 8);
  *puVar3 = *puVar2;
  *puVar2 = puVar3;
  param_1[4] = param_1[4] + 1;
  param_1[6] = (longlong)puVar2;
  *param_2 = (longlong)puVar2;
  param_2[1] = (longlong)puVar3;
  *(undefined1 *)(param_2 + 2) = 1;
  return param_2;
}



undefined8 FUN_140345d40(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_1402c9710(param_1,*puVar2);
    if (lVar1 != *(longlong *)(param_1 + 8)) {
      FUN_140345df0(param_1,lVar1);
      return 1;
    }
  }
  return 0;
}



void FUN_140345db0(longlong param_1)

{
  if (*(longlong *)(param_1 + 8) != 0) {
    if (*(char *)(param_1 + 0x11) != '\0') {
      FUN_14023ba90(*(longlong *)(param_1 + 8) + 8);
    }
    operator_delete(*(void **)(param_1 + 8));
  }
  return;
}



void FUN_140345df0(longlong *param_1,ulonglong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  ushort *puVar4;
  longlong *plVar5;
  longlong lVar6;
  ushort *puVar7;
  undefined8 *puVar8;
  longlong lVar9;
  ulonglong uVar10;
  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_140346140(&local_50);
  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;
    }
  }
  local_50 = lVar9;
  local_48 = lVar6;
  local_38 = lVar2;
  lVar6 = FUN_1402961d0(param_1);
  param_1[7] = lVar6;
  if (lVar2 != 0) {
    FUN_1402f4570(&local_38);
    lVar9 = local_50;
  }
  if (lVar9 != 0) {
    FUN_1402f4570(&local_50);
  }
  return;
}



void FUN_140345fc0(longlong param_1)

{
  undefined8 *puVar1;
  char *local_res8 [4];
  undefined **local_98 [5];
  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;
  undefined8 local_18;
  
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_14023ba90(*(longlong *)(param_1 + 8) + 8);
    *(undefined1 *)(param_1 + 0x11) = 0;
    return;
  }
  *(undefined2 *)(param_1 + 0x10) = 0;
  puVar1 = operator_new(0x68);
  if (puVar1 != (undefined8 *)0x0) {
    *(undefined8 **)(param_1 + 8) = puVar1;
    *puVar1 = 0;
    puVar1[1] = uStack_70;
    puVar1[2] = local_68;
    puVar1[3] = uStack_60;
    puVar1[4] = local_58;
    puVar1[5] = uStack_50;
    puVar1[6] = local_48;
    puVar1[7] = uStack_40;
    puVar1[8] = local_38;
    puVar1[9] = uStack_30;
    puVar1[10] = local_28;
    puVar1[0xb] = uStack_20;
    puVar1[0xc] = local_18;
    *(undefined1 *)(param_1 + 0x10) = 1;
    return;
  }
  local_res8[0] = (char *)0x0;
  std::exception::exception((exception *)local_98,local_res8);
  local_98[0] = std::bad_alloc::vftable;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d3608);
}



undefined2 * FUN_1403460b0(undefined2 *param_1,longlong param_2)

{
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  FUN_1400015e0(param_1,param_2,0,0xffffffffffffffff,0xfffffffffffffffe);
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_2 + 0x28);
  *(undefined8 *)(param_1 + 0x24) = 7;
  *(undefined8 *)(param_1 + 0x20) = 0;
  param_1[0x18] = 0;
  FUN_1400015e0(param_1 + 0x18,param_2 + 0x30,0,0xffffffffffffffff);
  *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_2 + 0x58);
  *(undefined4 *)(param_1 + 0x2e) = *(undefined4 *)(param_2 + 0x5c);
  return param_1;
}



void FUN_140346140(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_1405d3608);
  }
  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;
}



ulonglong FUN_140346230(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if (param_2 != 3) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_140346250(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 8) + 0xb0))();
  if ((int)uVar2 == 4) {
    uVar2 = 0;
    switch(param_2 + -0x1e) {
    case 0:
    case 7:
    case 0xc:
    case 0x16:
    case 0x26:
    case 0x44:
      goto switchD_1403462b0_caseD_0;
    }
  }
  else if (param_2 != 3) {
switchD_1403462b0_caseD_0:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return uVar2 & 0xffffffffffffff00;
}



ulonglong FUN_140346310(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if (param_2 != 2) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_140346330(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if (param_2 != 0x66) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_140346350(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0xd:
  case 0x16:
  case 0x17:
  case 0x18:
  case 0x1b:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x30:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346400(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 2:
  case 10:
  case 0xd:
  case 0x16:
  case 0x17:
  case 0x18:
  case 0x19:
  case 0x1a:
  case 0x1b:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x30:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403464b0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0xd:
  case 0x16:
  case 0x17:
  case 0x18:
  case 0x19:
  case 0x1a:
  case 0x1b:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x30:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346560(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 2:
  case 0x1b:
  case 0x1d:
  case 0x20:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x62:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346610(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 2:
  case 0x1b:
  case 0x1d:
  case 0x1f:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403466c0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 2:
  case 0x1b:
  case 0x1d:
  case 0x20:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x62:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346770(longlong param_1,undefined4 param_2)

{
  switch(param_2) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 5:
  case 6:
  case 8:
  case 10:
  case 0x1e:
  case 0x20:
  case 0x25:
  case 0x29:
  case 0x62:
    return 0;
  case 9:
  case 0xf:
  case 0x10:
  case 0x11:
  case 0x1b:
  case 0x1d:
  case 0x23:
  case 0x2a:
  case 0x34:
  case 0x55:
  case 0x57:
  case 0x58:
  case 0x59:
    *(undefined4 *)(*(longlong *)(param_1 + 8) + 300) = param_2;
  }
  return 1;
}



undefined8 FUN_140346820(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0xf) {
  case 0:
  case 1:
  case 2:
  case 4:
  case 0xe:
  case 0x14:
  case 0x19:
  case 0x1b:
  case 0x25:
  case 0x46:
  case 0x48:
  case 0x49:
  case 0x4a:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403468b0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0xd:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x42:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
  case 99:
  case 100:
  case 0x65:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346960(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0xb:
  case 0xc:
  case 0xd:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x42:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346a10(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0xd:
  case 0x16:
  case 0x17:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x20:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x62:
  case 0x68:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346ac0(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x25) {
  case 0:
  case 0xf:
  case 0x17:
  case 0x30:
  case 0x31:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x3d:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



ulonglong FUN_140346b40(longlong param_1,int param_2)

{
  ulonglong in_RAX;
  
  if ((((param_2 == 0x2a) || (param_2 == 0x34)) || (param_2 == 0x3c)) ||
     ((0x54 < param_2 && (param_2 < 0x5a)))) {
    in_RAX = *(ulonglong *)(param_1 + 8);
    *(int *)(in_RAX + 300) = param_2;
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_140346b70(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x10) {
  case 0:
  case 1:
  case 2:
  case 0xb:
  case 0x13:
  case 0x24:
  case 0x2c:
  case 0x55:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346c10(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x10) {
  case 0:
  case 1:
  case 2:
  case 0xb:
  case 0x13:
  case 0x24:
  case 0x2c:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346c80(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x10) {
  case 0:
  case 1:
  case 0xb:
  case 0xd:
  case 0x13:
  case 0x24:
  case 0x2c:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346cf0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x20:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x30:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346da0(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0xf) {
  case 0:
  case 1:
  case 2:
  case 4:
  case 0xe:
  case 0x14:
  case 0x1b:
  case 0x25:
  case 0x46:
  case 0x48:
  case 0x49:
  case 0x4a:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140346e30(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 2:
  case 10:
  case 0xd:
  case 0x16:
  case 0x17:
  case 0x18:
  case 0x19:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x30:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
  case 0x68:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



bool FUN_140346ee0(longlong param_1,undefined4 param_2)

{
  switch(param_2) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
  case 8:
  case 10:
  case 0x1b:
  case 0x1e:
  case 0x20:
  case 0x29:
  case 0x2a:
  case 0x52:
  case 0x68:
    return false;
  default:
    return true;
  case 9:
    return *(int *)(*(longlong *)(param_1 + 8) + 0x5b8) < 2;
  }
}



undefined8 FUN_140346fa0(undefined8 param_1,undefined4 param_2)

{
  switch(param_2) {
  case 0x20:
  case 0x23:
  case 0x34:
  case 0x3c:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
    return 1;
  default:
    return 0;
  }
}



undefined8 FUN_140347010(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0xe:
  case 0x1d:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x42:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403470c0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0x1d:
  case 0x20:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347170(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0xe:
  case 0x21:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347220(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0x1d:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403472d0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0x1d:
  case 0x22:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347380(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0x1c:
  case 0x20:
  case 0x23:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347430(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x1c) {
  case 0:
  case 4:
  case 7:
  case 9:
  case 0xe:
  case 0x18:
  case 0x1d:
  case 0x20:
  case 0x33:
  case 0x39:
  case 0x3a:
  case 0x3b:
  case 0x3c:
  case 0x3d:
  case 0x46:
  case 0x47:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



ulonglong FUN_1403474c0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((-1 < param_2) && (((param_2 < 2 || (param_2 == 0x25)) || (param_2 == 0x34)))) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_1403474f0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x25:
  case 0x2a:
  case 0x34:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403475a0(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x20) {
  case 0:
  case 2:
  case 4:
  case 5:
  case 0xb:
  case 0x42:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347630(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0x1c:
  case 0x20:
  case 0x22:
  case 0x23:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403476d0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347780(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x25:
  case 0x2a:
  case 0x2e:
  case 0x34:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



ulonglong FUN_140347830(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((1 < param_2) && ((param_2 < 4 || (param_2 == 0xe)))) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(int *)(lVar1 + 300) = param_2;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



ulonglong FUN_140347850(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((1 < param_2) && (param_2 < 4)) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(int *)(lVar1 + 300) = param_2;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



ulonglong FUN_140347870(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if (param_2 != 0x30) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(undefined4 *)(lVar1 + 300) = 0x30;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



undefined8 FUN_140347890(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x1b) {
  case 0:
  case 2:
  case 3:
  case 4:
  case 9:
  case 10:
  case 0xf:
  case 0x15:
  case 0x18:
  case 0x1b:
  case 0x21:
  case 0x22:
  case 0x45:
  case 0x47:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347920(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 2:
  case 3:
  case 5:
  case 6:
  case 10:
  case 0x1e:
  case 0x2f:
    return 0;
  default:
    *(undefined4 *)(*(longlong *)(param_1 + 8) + 300) = param_2;
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
}



ulonglong FUN_1403479a0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((param_2 != 0x25) && (param_2 != 0x62)) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(int *)(lVar1 + 300) = param_2;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



undefined8 FUN_1403479c0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x36:
  case 0x37:
  case 0x38:
  case 0x39:
  case 0x3c:
  case 0x3d:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347a70(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x37:
  case 0x38:
  case 0x3a:
  case 0x3b:
  case 0x3c:
  case 0x3d:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347b20(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x1b) {
  case 0:
  case 2:
  case 3:
  case 4:
  case 9:
  case 10:
  case 0xf:
  case 0x18:
  case 0x1b:
  case 0x21:
  case 0x22:
  case 0x47:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



ulonglong FUN_140347bb0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((0x35 < param_2) && (param_2 < 0x39)) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_140347bd0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x36:
  case 0x37:
  case 0x3b:
  case 0x3c:
  case 0x3d:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347c80(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x36:
  case 0x37:
  case 0x38:
  case 0x3c:
  case 0x3d:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347d30(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x1d) {
  case 0:
  case 3:
  case 5:
  case 7:
  case 0xe:
  case 0x20:
  case 0x21:
  case 0x46:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



ulonglong FUN_140347dc0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((1 < param_2) && ((param_2 < 4 || ((4 < param_2 && ((param_2 < 7 || (param_2 == 10)))))))) {
    return in_RAX & 0xffffffffffffff00;
  }
  *(int *)(*(longlong *)(param_1 + 8) + 300) = param_2;
  lVar1 = *(longlong *)(param_1 + 8);
  *(int *)(lVar1 + 300) = param_2;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



undefined8 FUN_140347e00(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x20) {
  case 0:
  case 2:
  case 4:
  case 0xb:
  case 0x1c:
  case 0x43:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347e90(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x1d:
  case 0x25:
  case 0x34:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140347f40(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0xd:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x30:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
  case 100:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



ulonglong FUN_140347ff0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((-1 < param_2) && (param_2 < 2)) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_140348010(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((-1 < param_2) &&
     ((((param_2 < 2 || (param_2 == 0x25)) || (param_2 == 0x34)) || (param_2 == 0x47)))) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_140348040(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x1e:
  case 0x25:
  case 0x34:
  case 0x4a:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403480d0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140348180(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x25:
  case 0x2a:
  case 0x33:
  case 0x34:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140348230(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 3:
  case 0x25:
  case 0x32:
  case 0x49:
  case 0x4b:
  case 0x4c:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403482e0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 0x25:
  case 0x4b:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140348390(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 3:
  case 0x25:
  case 0x4a:
  case 0x4b:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140348440(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0x1d:
  case 0x20:
  case 0x25:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    return 0;
  default:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
}



ulonglong FUN_1403484d0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if (param_2 != 0x25) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(undefined4 *)(lVar1 + 300) = 0x25;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



ulonglong FUN_1403484f0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((param_2 != 2) && (param_2 != 0x24)) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(int *)(lVar1 + 300) = param_2;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



undefined8 FUN_140348510(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 8);
  *(undefined4 *)(lVar1 + 300) = param_2;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



ulonglong FUN_140348520(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((1 < param_2) && ((param_2 < 4 || ((4 < param_2 && (param_2 < 7)))))) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(int *)(lVar1 + 300) = param_2;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



undefined8 FUN_140348550(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0xe:
  case 0x1d:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140348600(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 10:
  case 0xe:
  case 0x1d:
  case 0x1f:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x33:
  case 0x34:
  case 0x3c:
  case 0x3d:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x62:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



ulonglong FUN_1403486b0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((-1 < param_2) && ((param_2 < 2 || (param_2 == 0x25)))) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



undefined8 FUN_1403486d0(longlong param_1,int param_2)

{
  longlong lVar1;
  
  switch(param_2 + -0x1c) {
  case 0:
  case 4:
  case 7:
  case 8:
  case 9:
  case 0x1d:
  case 0x20:
  case 0x39:
  case 0x3a:
  case 0x3b:
  case 0x3c:
  case 0x3d:
  case 0x47:
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140348760(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 3:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x42:
  case 0x52:
  case 0x53:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
  case 99:
  case 0x68:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140348810(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 3:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x42:
  case 0x51:
  case 0x53:
  case 0x54:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_1403488c0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 3:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x42:
  case 0x51:
  case 0x52:
  case 0x54:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
  case 99:
  case 0x68:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined8 FUN_140348970(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 3:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x42:
  case 0x51:
  case 0x52:
  case 0x53:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
  case 99:
  case 0x68:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



undefined1 FUN_140348a20(undefined8 param_1,int param_2)

{
  if (((param_2 != 0x1e) && (param_2 != 0x25)) && (param_2 != 0x62)) {
    return 0;
  }
  return 1;
}



undefined8 FUN_140348a40(undefined8 param_1,undefined4 param_2)

{
  switch(param_2) {
  case 0x1d:
  case 0x1e:
  case 0x22:
  case 0x23:
  case 0x24:
  case 0x25:
  case 0x62:
  case 99:
    return 1;
  default:
    return 0;
  }
}



undefined8 FUN_140348ac0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  
  switch(param_2) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 0x1b:
  case 0x1d:
  case 0x1e:
  case 0x1f:
  case 0x22:
  case 0x24:
  case 0x25:
  case 0x2a:
  case 0x2f:
  case 0x30:
  case 0x32:
  case 0x33:
  case 0x34:
  case 0x42:
  case 0x50:
  case 0x51:
  case 0x53:
  case 0x54:
  case 0x55:
  case 0x56:
  case 0x57:
  case 0x58:
  case 0x59:
  case 0x60:
  case 0x61:
  case 0x62:
  case 99:
    lVar1 = *(longlong *)(param_1 + 8);
    *(undefined4 *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  default:
    return 0;
  }
}



ulonglong FUN_140348b70(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((0x6b < param_2) && (param_2 < 0x6e)) {
    lVar1 = *(longlong *)(param_1 + 8);
    *(int *)(lVar1 + 300) = param_2;
    return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
  }
  return in_RAX & 0xffffffffffffff00;
}



ulonglong FUN_140348b90(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if (param_2 != 0x6a) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(undefined4 *)(lVar1 + 300) = 0x6a;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



ulonglong FUN_140348bb0(longlong param_1,int param_2)

{
  longlong lVar1;
  ulonglong in_RAX;
  
  if ((param_2 != 0x6a) && (param_2 != 0x6c)) {
    return in_RAX & 0xffffffffffffff00;
  }
  lVar1 = *(longlong *)(param_1 + 8);
  *(int *)(lVar1 + 300) = param_2;
  return CONCAT71((int7)((ulonglong)lVar1 >> 8),1);
}



undefined8 * FUN_140348bd0(undefined8 *param_1,byte param_2)

{
  *param_1 = mcoCharacterAttribute::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_140348c00(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  short sVar4;
  undefined4 uVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  undefined8 *puVar10;
  undefined4 *puVar11;
  short *psVar12;
  longlong lVar13;
  undefined8 uVar14;
  ulonglong uVar15;
  longlong *plVar16;
  undefined8 *puVar17;
  undefined8 *puVar18;
  short *psVar19;
  undefined8 *local_50;
  longlong *local_48;
  undefined8 *local_40;
  undefined1 local_30 [16];
  longlong *local_20;
  undefined8 *puVar9;
  
  uVar15 = 0xffffffffffffffff;
  psVar19 = param_2;
  do {
    if (uVar15 == 0) break;
    uVar15 = uVar15 - 1;
    sVar4 = *psVar19;
    psVar19 = psVar19 + 1;
  } while (sVar4 != 0);
  FUN_140001710(param_1 + 0x10,param_2,~uVar15 - 1);
  lVar8 = FUN_1402933b0(DAT_140607ff0,param_2);
  uVar14 = 0;
  if (lVar8 != 0) {
    puVar18 = (undefined8 *)0x0;
    puVar17 = puVar18;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar9 = puVar18;
      plVar16 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar16 != 0) {
          puVar17 = (undefined8 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar9];
          break;
        }
        uVar6 = (int)puVar9 + 1;
        puVar9 = (undefined8 *)(ulonglong)uVar6;
        plVar16 = plVar16 + 1;
      } while (uVar6 < *(uint *)(lVar8 + 0x78));
    }
LAB_140348c90:
    if (puVar17 != (undefined8 *)0x0) {
      uVar5 = *(undefined4 *)puVar17;
      local_40 = puVar17;
      puVar10 = operator_new(0x68);
      puVar9 = puVar18;
      if (puVar10 != (undefined8 *)0x0) {
        *puVar10 = 0;
        puVar10[1] = 0;
        *(undefined4 *)(puVar10 + 2) = 0;
        puVar10[6] = 7;
        puVar10[5] = 0;
        *(undefined2 *)(puVar10 + 3) = 0;
        puVar10[0xb] = 7;
        puVar10[10] = 0;
        *(undefined2 *)(puVar10 + 8) = 0;
        puVar9 = puVar10;
      }
      local_50 = puVar9;
      FUN_140348fb0(&local_48,puVar9);
      FUN_140178e90(&local_50,puVar9,puVar9);
      uVar7 = FUN_1402970c0(lVar8,&DAT_14049f290);
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,&DAT_14049f290,1);
      *(undefined4 *)local_50 = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nCommandType");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nCommandType",1);
      *(undefined4 *)(local_50 + 1) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nConsumeAction");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nConsumeAction",1);
      *(undefined4 *)((longlong)local_50 + 4) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nCommandResultGroupID");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nCommandResultGroupID",1);
      *(undefined4 *)((longlong)local_50 + 0xc) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nSoundID");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nSoundID",0);
      if (puVar11 != (undefined4 *)0x0) {
        *(undefined4 *)(local_50 + 2) = *puVar11;
      }
      uVar7 = FUN_1402970c0(lVar8,L"wszCommandName");
      psVar12 = (short *)FUN_140296b70(lVar8,uVar5,uVar7,L"wszCommandName",1);
      uVar15 = 0xffffffffffffffff;
      psVar19 = psVar12;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar4 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_50 + 3,psVar12,~uVar15 - 1);
      uVar7 = FUN_1402970c0(lVar8,L"szIconName");
      psVar12 = (short *)FUN_140296990(lVar8,uVar5,uVar7,L"szIconName",1);
      uVar15 = 0xffffffffffffffff;
      psVar19 = psVar12;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar4 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_50 + 8,psVar12,~uVar15 - 1);
      puVar11 = (undefined4 *)FUN_140342d30(local_30,local_50,&local_50);
      FUN_14030e3c0(param_1 + 0x38,*puVar11,puVar11 + 2);
      plVar16 = local_20;
      if (local_20 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_20 + 1;
        lVar13 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar17 = local_40;
        if ((int)lVar13 == 1) {
          (**(code **)(*local_20 + 8))(local_20);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar17 = local_40;
          if (iVar3 == 1) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar17 = local_40;
          }
        }
      }
      plVar16 = local_48;
      puVar9 = puVar17;
      if (local_48 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_48 + 1;
        lVar13 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar9 = local_40;
        if ((int)lVar13 == 1) {
          (**(code **)(*local_48 + 8))(local_48);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar9 = local_40;
          if (iVar3 == 1) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar9 = local_40;
          }
        }
      }
      puVar17 = (undefined8 *)puVar9[3];
      if (puVar17 == (undefined8 *)0x0) {
        uVar6 = *(uint *)(puVar9 + 4) % *(uint *)(lVar8 + 0x78) + 1;
        lVar13 = (longlong)(int)uVar6 << 3;
        puVar17 = puVar18;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar6) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar13) != 0) {
            puVar17 = *(undefined8 **)(*(longlong *)(lVar8 + 0x68) + lVar13);
          }
          uVar6 = uVar6 + 1;
          lVar13 = lVar13 + 8;
        } while (puVar17 == (undefined8 *)0x0);
      }
      goto LAB_140348c90;
    }
    uVar14 = 1;
  }
  return uVar14;
}



undefined8 * FUN_140348fb0(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;
}



void FUN_140349020(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x58)) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x40));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x58) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x50) = 0;
    *(undefined2 *)((longlong)pvVar1 + 0x40) = 0;
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0x30)) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x18));
    }
    *(undefined8 *)((longlong)pvVar1 + 0x30) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0x28) = 0;
    *(undefined2 *)((longlong)pvVar1 + 0x18) = 0;
    operator_delete(pvVar1);
  }
  return;
}



undefined8 FUN_1403490a0(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int *piVar2;
  int iVar3;
  short sVar4;
  undefined4 uVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  undefined8 *puVar10;
  undefined4 *puVar11;
  short *psVar12;
  longlong lVar13;
  undefined8 uVar14;
  ulonglong uVar15;
  longlong *plVar16;
  undefined8 *puVar17;
  undefined8 *puVar18;
  short *psVar19;
  undefined8 *local_50;
  longlong *local_48;
  undefined8 *local_40;
  undefined1 local_30 [16];
  longlong *local_20;
  undefined8 *puVar9;
  
  uVar15 = 0xffffffffffffffff;
  psVar19 = param_2;
  do {
    if (uVar15 == 0) break;
    uVar15 = uVar15 - 1;
    sVar4 = *psVar19;
    psVar19 = psVar19 + 1;
  } while (sVar4 != 0);
  FUN_140001710(param_1 + 0x10,param_2,~uVar15 - 1);
  lVar8 = FUN_1402933b0(DAT_140607ff0,param_2);
  uVar14 = 0;
  if (lVar8 != 0) {
    puVar17 = (undefined8 *)0x0;
    puVar18 = puVar17;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar9 = puVar17;
      plVar16 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar16 != 0) {
          puVar18 = (undefined8 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar9];
          break;
        }
        uVar6 = (int)puVar9 + 1;
        puVar9 = (undefined8 *)(ulonglong)uVar6;
        plVar16 = plVar16 + 1;
      } while (uVar6 < *(uint *)(lVar8 + 0x78));
    }
LAB_140349140:
    if (puVar18 != (undefined8 *)0x0) {
      uVar5 = *(undefined4 *)puVar18;
      local_40 = puVar18;
      puVar10 = operator_new(0xb8);
      puVar9 = puVar17;
      if (puVar10 != (undefined8 *)0x0) {
        *puVar10 = 0;
        puVar10[1] = 0;
        puVar10[2] = 0;
        puVar10[3] = 0;
        puVar10[4] = 0;
        puVar10[5] = 0;
        puVar10[6] = 0;
        puVar10[7] = 0;
        puVar10[8] = 0;
        puVar10[9] = 0;
        puVar10[10] = 0;
        puVar10[0xb] = 0;
        puVar10[0xc] = 0;
        puVar10[0xd] = 0;
        puVar10[0xe] = 0;
        puVar10[0xf] = 0;
        puVar10[0x10] = 0;
        puVar10[0x15] = 7;
        puVar10[0x14] = 0;
        *(undefined2 *)(puVar10 + 0x12) = 0;
        puVar9 = puVar10;
      }
      local_50 = puVar9;
      FUN_140349a60(&local_48,puVar9);
      FUN_140178e90(&local_50,puVar9,puVar9);
      uVar7 = FUN_1402970c0(lVar8,&DAT_14049f290);
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,&DAT_14049f290,1);
      *(undefined4 *)local_50 = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nGroupID");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nGroupID",1);
      *(undefined4 *)((longlong)local_50 + 4) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nSubGroupID");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nSubGroupID",1);
      *(undefined4 *)(local_50 + 1) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nActionType");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nActionType",1);
      *(undefined4 *)((longlong)local_50 + 0x4c) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nConsumeAction");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nConsumeAction",1);
      *(undefined4 *)((longlong)local_50 + 0xc) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nStringID");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nStringID",1);
      *(undefined4 *)(local_50 + 2) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nVital");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nVital",1);
      *(undefined4 *)(local_50 + 10) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nIntelligence");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nIntelligence",1);
      *(undefined4 *)((longlong)local_50 + 0x54) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nStrength");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nStrength",1);
      *(undefined4 *)(local_50 + 0xb) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nTemper");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nTemper",1);
      *(undefined4 *)((longlong)local_50 + 0x5c) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nCharm");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nCharm",1);
      *(undefined4 *)(local_50 + 0xc) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nResilient");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nResilient",1);
      *(undefined4 *)((longlong)local_50 + 100) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nEloquence");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nEloquence",1);
      *(undefined4 *)(local_50 + 0xd) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nExhaust");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nExhaust",1);
      *(undefined4 *)((longlong)local_50 + 0x6c) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nAngry");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nAngry",1);
      *(undefined4 *)(local_50 + 0xe) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nNormal");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nNormal",1);
      *(undefined4 *)((longlong)local_50 + 0x74) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nGood");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nGood",1);
      *(undefined4 *)(local_50 + 0xf) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nSadness");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nSadness",1);
      *(undefined4 *)((longlong)local_50 + 0x7c) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nVIT_Min");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nVIT_Min",1);
      *(undefined4 *)((longlong)local_50 + 0x14) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nVIT_Max");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nVIT_Max",1);
      *(undefined4 *)(local_50 + 3) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nINT_Min");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nINT_Min",1);
      *(undefined4 *)((longlong)local_50 + 0x1c) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nINT_Max");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nINT_Max",1);
      *(undefined4 *)(local_50 + 4) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nSTR_Min");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nSTR_Min",1);
      *(undefined4 *)((longlong)local_50 + 0x24) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nSTR_Max");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nSTR_Max",1);
      *(undefined4 *)(local_50 + 5) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nTEM_Min");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nTEM_Min",1);
      *(undefined4 *)((longlong)local_50 + 0x2c) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nTEM_Max");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nTEM_Max",1);
      *(undefined4 *)(local_50 + 6) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nCHA_Min");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nCHA_Min",1);
      *(undefined4 *)((longlong)local_50 + 0x34) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nCHA_Max");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nCHA_Max",1);
      *(undefined4 *)(local_50 + 7) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nRES_Min");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nRES_Min",1);
      *(undefined4 *)((longlong)local_50 + 0x3c) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nRES_Max");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nRES_Max",1);
      *(undefined4 *)(local_50 + 8) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nELO_Min");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nELO_Min",1);
      *(undefined4 *)((longlong)local_50 + 0x44) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"nELO_Max");
      puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar5,uVar7,L"nELO_Max",1);
      *(undefined4 *)(local_50 + 9) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"fHeight");
      puVar11 = (undefined4 *)FUN_1402967b0(lVar8,uVar5,uVar7,L"fHeight",1);
      *(undefined4 *)(local_50 + 0x10) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"fWeight");
      puVar11 = (undefined4 *)FUN_1402967b0(lVar8,uVar5,uVar7,L"fWeight",1);
      *(undefined4 *)((longlong)local_50 + 0x84) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"fProbability");
      puVar11 = (undefined4 *)FUN_1402967b0(lVar8,uVar5,uVar7,L"fProbability",1);
      *(undefined4 *)(local_50 + 0x11) = *puVar11;
      uVar7 = FUN_1402970c0(lVar8,L"szAction");
      psVar12 = (short *)FUN_140296990(lVar8,uVar5,uVar7,L"szAction",1);
      uVar15 = 0xffffffffffffffff;
      psVar19 = psVar12;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar4 = *psVar19;
        psVar19 = psVar19 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_50 + 0x12,psVar12,~uVar15 - 1);
      puVar11 = (undefined4 *)FUN_140342d30(local_30,local_50,&local_50);
      FUN_14030e3c0(param_1 + 0x38,*puVar11,puVar11 + 2);
      plVar16 = local_20;
      if (local_20 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_20 + 1;
        lVar13 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar18 = local_40;
        if ((int)lVar13 == 1) {
          (**(code **)(*local_20 + 8))(local_20);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar18 = local_40;
          if (iVar3 == 1) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar18 = local_40;
          }
        }
      }
      plVar16 = local_48;
      puVar9 = puVar18;
      if (local_48 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_48 + 1;
        lVar13 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar9 = local_40;
        if ((int)lVar13 == 1) {
          (**(code **)(*local_48 + 8))(local_48);
          LOCK();
          piVar2 = (int *)((longlong)plVar16 + 0xc);
          iVar3 = *piVar2;
          *piVar2 = *piVar2 + -1;
          UNLOCK();
          puVar9 = local_40;
          if (iVar3 == 1) {
            (**(code **)(*plVar16 + 0x10))(plVar16);
            puVar9 = local_40;
          }
        }
      }
      puVar18 = (undefined8 *)puVar9[3];
      if (puVar18 == (undefined8 *)0x0) {
        uVar6 = *(uint *)(puVar9 + 4) % *(uint *)(lVar8 + 0x78) + 1;
        lVar13 = (longlong)(int)uVar6 << 3;
        puVar18 = puVar17;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar6) break;
          if (*(longlong *)(lVar13 + *(longlong *)(lVar8 + 0x68)) != 0) {
            puVar18 = *(undefined8 **)(lVar13 + *(longlong *)(lVar8 + 0x68));
          }
          uVar6 = uVar6 + 1;
          lVar13 = lVar13 + 8;
        } while (puVar18 == (undefined8 *)0x0);
      }
      goto LAB_140349140;
    }
    uVar14 = 1;
  }
  return uVar14;
}



undefined8 * FUN_140349a60(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;
}



void FUN_140349ad0(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    if (7 < *(ulonglong *)((longlong)pvVar1 + 0xa8)) {
      operator_delete(*(void **)((longlong)pvVar1 + 0x90));
    }
    *(undefined8 *)((longlong)pvVar1 + 0xa8) = 7;
    *(undefined8 *)((longlong)pvVar1 + 0xa0) = 0;
    *(undefined2 *)((longlong)pvVar1 + 0x90) = 0;
    operator_delete(pvVar1);
  }
  return;
}



undefined8 thunk_FUN_140349f10(longlong param_1)

{
  longlong *plVar1;
  float *pfVar2;
  float fVar3;
  undefined4 uVar4;
  float fVar5;
  
  plVar1 = *(longlong **)(param_1 + 8);
  fVar3 = 0.0;
  uVar4 = 0;
  if ((plVar1 != (longlong *)0x0) && (*(int *)((longlong)plVar1 + 300) != 0x25)) {
    fVar5 = 0.0;
    for (pfVar2 = (float *)plVar1[0x238]; pfVar2 != (float *)plVar1[0x239]; pfVar2 = pfVar2 + 1) {
      fVar5 = fVar5 + *pfVar2;
    }
    fVar5 = fVar5 + *(float *)(plVar1 + 0xb3);
    if (1.0 < fVar5) {
      fVar3 = *(float *)(param_1 + 0x18);
      if (fVar5 - fVar3 <= 1.0) {
        fVar3 = fVar5 - 1.0;
      }
      uVar4 = 0x80000000;
      fVar3 = -fVar3;
      (**(code **)(*plVar1 + 0x290))(plVar1,fVar3);
    }
  }
  return CONCAT44(uVar4,fVar3);
}



void FUN_140349b80(longlong param_1)

{
  if (*(char *)(param_1 + 0x20) == '\0') {
    *(undefined1 *)(param_1 + 0x20) = 1;
    *(float *)(param_1 + 0x30) = (float)(*(double *)(param_1 + 0x10) - *(double *)(param_1 + 0x38));
  }
  return;
}



undefined8 FUN_140349ba0(longlong *param_1,double param_2)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  
  param_1[9] = (longlong)param_2;
  if ((char)param_1[4] != '\0') {
    if ((double)param_1[2] <= param_2) {
      if ((int)param_1[8] != 1) {
        (**(code **)(*param_1 + 0x10))();
        return 1;
      }
      param_1[2] = (longlong)((double)*(float *)(param_1 + 6) + param_2);
      return 1;
    }
    if ((double)param_1[2] - DAT_1405dfc58 <= param_2) {
      iVar2 = rand();
      iVar3 = rand();
      lVar1 = param_1[1];
      *(float *)(lVar1 + 0xc68) = (float)iVar2 * 3.0517578e-05 * 10.0;
      *(undefined4 *)(lVar1 + 0xc6c) = 0;
      *(float *)(lVar1 + 0xc70) = (float)iVar3 * 3.0517578e-05 * 10.0;
    }
  }
  return 0;
}



void FUN_140349c80(longlong param_1)

{
  undefined8 uVar1;
  undefined1 local_28 [32];
  
  *(undefined1 *)(param_1 + 0x20) = 1;
  *(float *)(param_1 + 0x30) = (float)(*(double *)(param_1 + 0x10) - *(double *)(param_1 + 0x38));
  uVar1 = FUN_14012e520(local_28,param_1 + 0x58);
  FUN_1402f9580(*(undefined8 *)(param_1 + 8),uVar1,*(uint *)(param_1 + 0x50) ^ 0x80000000);
  return;
}



void FUN_140349cd0(longlong param_1)

{
  void *_Dst;
  undefined8 uVar1;
  undefined1 local_28 [32];
  
  *(undefined4 *)(param_1 + 0x1c) = 0x3f800000;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined1 *)(param_1 + 0x20) = 0;
  uVar1 = FUN_14012e520(local_28,param_1 + 0x58);
  FUN_1402f9580(*(undefined8 *)(param_1 + 8),uVar1,*(undefined4 *)(param_1 + 0x50));
  _Dst = *(void **)(param_1 + 0x58);
  if (_Dst != *(void **)(param_1 + 0x60)) {
    memmove(_Dst,*(void **)(param_1 + 0x60),0);
    *(void **)(param_1 + 0x60) = _Dst;
  }
  *(undefined4 *)(param_1 + 0x50) = 0;
  return;
}



void FUN_140349d80(longlong param_1)

{
  *(undefined1 *)(param_1 + 0x20) = 1;
  *(float *)(param_1 + 0x30) = (float)(*(double *)(param_1 + 0x10) - *(double *)(param_1 + 0x38));
  return;
}



undefined8 FUN_140349da0(longlong *param_1,double param_2)

{
  param_1[9] = (longlong)param_2;
  if (((char)param_1[4] != '\0') && ((double)param_1[2] <= param_2)) {
    if ((int)param_1[8] != 1) {
      (**(code **)(*param_1 + 0x10))();
      return 1;
    }
    param_1[2] = (longlong)((double)*(float *)(param_1 + 6) + param_2);
    return 1;
  }
  return 0;
}



void FUN_140349df0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x1c) = 0x3f800000;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined1 *)(param_1 + 0x20) = 0;
  return;
}



void FUN_140349e10(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 8);
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined1 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x1c) = 0x3f800000;
  *(undefined4 *)(lVar1 + 0xc68) = 0;
  *(undefined4 *)(lVar1 + 0xc6c) = 0;
  *(undefined4 *)(lVar1 + 0xc70) = 0;
                    // WARNING: Could not recover jumptable at 0x000140349e6b. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_1 + 8) + 0x108))(*(longlong **)(param_1 + 8),0);
  return;
}



void FUN_140349e80(longlong param_1,longlong *param_2)

{
  void *_Dst;
  longlong lVar1;
  
  _Dst = *(void **)(param_1 + 0x58);
  if (_Dst != *(void **)(param_1 + 0x60)) {
    memmove(_Dst,*(void **)(param_1 + 0x60),0);
    *(void **)(param_1 + 0x60) = _Dst;
  }
  lVar1 = *param_2;
  if (lVar1 != param_2[1]) {
    do {
      FUN_14012e5c0(param_1 + 0x58,lVar1);
      lVar1 = lVar1 + 4;
    } while (lVar1 != param_2[1]);
  }
  return;
}



undefined8 FUN_140349f10(longlong param_1)

{
  longlong *plVar1;
  float *pfVar2;
  float fVar3;
  undefined4 uVar4;
  float fVar5;
  
  plVar1 = *(longlong **)(param_1 + 8);
  fVar3 = 0.0;
  uVar4 = 0;
  if ((plVar1 != (longlong *)0x0) && (*(int *)((longlong)plVar1 + 300) != 0x25)) {
    fVar5 = 0.0;
    for (pfVar2 = (float *)plVar1[0x238]; pfVar2 != (float *)plVar1[0x239]; pfVar2 = pfVar2 + 1) {
      fVar5 = fVar5 + *pfVar2;
    }
    fVar5 = fVar5 + *(float *)(plVar1 + 0xb3);
    if (1.0 < fVar5) {
      fVar3 = *(float *)(param_1 + 0x18);
      if (fVar5 - fVar3 <= 1.0) {
        fVar3 = fVar5 - 1.0;
      }
      uVar4 = 0x80000000;
      fVar3 = -fVar3;
      (**(code **)(*plVar1 + 0x290))(plVar1,fVar3);
    }
  }
  return CONCAT44(uVar4,fVar3);
}



undefined8 * FUN_140349fb0(undefined8 *param_1)

{
  param_1[4] = 7;
  param_1[3] = 0;
  *(undefined2 *)(param_1 + 1) = 0;
  *param_1 = mcoAiPetTable::vftable;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  *(undefined8 *)((longlong)param_1 + 0x5c) = 0;
  *(undefined8 *)((longlong)param_1 + 100) = 0;
  *(undefined8 *)((longlong)param_1 + 0x6c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x74) = 0;
  *(undefined8 *)((longlong)param_1 + 0x7c) = 0;
  param_1[0x11] = 0;
  *(undefined4 *)(param_1 + 0x12) = 0;
  param_1[0x16] = 7;
  param_1[0x15] = 0;
  *(undefined2 *)(param_1 + 0x13) = 0;
  *(undefined4 *)(param_1 + 0x18) = 0;
  param_1[0x19] = 0;
  param_1[0x1a] = 0;
  *(undefined4 *)(param_1 + 0x1b) = 0;
  param_1[0x1f] = 7;
  param_1[0x1e] = 0;
  *(undefined2 *)(param_1 + 0x1c) = 0;
  param_1[0x21] = 0;
  param_1[0x22] = 0;
  param_1[0x26] = 7;
  param_1[0x25] = 0;
  *(undefined2 *)(param_1 + 0x23) = 0;
  return param_1;
}



void FUN_14034a080(undefined8 *param_1)

{
  *param_1 = mcoAiPetTable::vftable;
  if (7 < (ulonglong)param_1[0x26]) {
    operator_delete((void *)param_1[0x23]);
  }
  param_1[0x26] = 7;
  param_1[0x25] = 0;
  *(undefined2 *)(param_1 + 0x23) = 0;
  if (7 < (ulonglong)param_1[0x1f]) {
    operator_delete((void *)param_1[0x1c]);
  }
  param_1[0x1f] = 7;
  param_1[0x1e] = 0;
  *(undefined2 *)(param_1 + 0x1c) = 0;
  if (7 < (ulonglong)param_1[0x16]) {
    operator_delete((void *)param_1[0x13]);
  }
  param_1[0x16] = 7;
  param_1[0x15] = 0;
  *(undefined2 *)(param_1 + 0x13) = 0;
  *param_1 = mcoAiTable::vftable;
  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;
  return;
}



undefined8 FUN_14034a160(longlong param_1,undefined4 param_2)

{
  short sVar1;
  undefined4 uVar2;
  longlong lVar3;
  short *psVar4;
  undefined4 *puVar5;
  undefined8 uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  short *psVar9;
  uint *puVar10;
  ulonglong uVar11;
  
  lVar3 = FUN_1402933b0(DAT_140607ff0,&DAT_1404d2988);
  if (lVar3 == 0) {
    return 0;
  }
  uVar2 = FUN_1402970c0(lVar3,L"szName");
  psVar4 = (short *)FUN_140296990(lVar3,param_2,uVar2,L"szName",1);
  uVar11 = 0xffffffffffffffff;
  psVar9 = psVar4;
  do {
    if (uVar11 == 0) break;
    uVar11 = uVar11 - 1;
    sVar1 = *psVar9;
    psVar9 = psVar9 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 8,psVar4,~uVar11 - 1);
  uVar2 = FUN_1402970c0(lVar3,L"nMelee");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nMelee",1);
  *(undefined4 *)(param_1 + 0x30) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nPatrol");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nPatrol",1);
  *(undefined4 *)(param_1 + 0x34) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nLongRange");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nLongRange",1);
  *(undefined4 *)(param_1 + 0x38) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nSingleMagic");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nSingleMagic",1);
  *(undefined4 *)(param_1 + 0x3c) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nRangeMagic");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nRangeMagic",1);
  *(undefined4 *)(param_1 + 0x40) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nSideStep");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nSideStep",1);
  *(undefined4 *)(param_1 + 0x50) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fSideStepDelay");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fSideStepDelay",1);
  *(undefined4 *)(param_1 + 0x54) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fSideStepPriority");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fSideStepPriority",1);
  *(undefined4 *)(param_1 + 0x58) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nRunaway");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nRunaway",1);
  *(undefined4 *)(param_1 + 0x44) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nGuard");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nGuard",1);
  *(undefined4 *)(param_1 + 0x68) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fGuardDuration");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fGuardDuration",1);
  *(undefined4 *)(param_1 + 0x6c) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nBackStep");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nBackStep",1);
  *(undefined4 *)(param_1 + 0x5c) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fBackStepDelay");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fBackStepDelay",1);
  *(undefined4 *)(param_1 + 0x60) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fBackStepPriority");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fBackStepPriority",1);
  *(undefined4 *)(param_1 + 100) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nGuardCountAttack_Combo");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nGuardCountAttack_Combo",1);
  *(undefined4 *)(param_1 + 0x70) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nGuardCountAttack_Damage");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nGuardCountAttack_Damage",1);
  *(undefined4 *)(param_1 + 0x74) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fGuardProbability");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fGuardProbability",1);
  *(undefined4 *)(param_1 + 0x78) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nGuardCountComboID");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nGuardCountComboID",1);
  *(undefined4 *)(param_1 + 0x7c) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"szStandUpAttackMotionName");
  psVar4 = (short *)FUN_140296990(lVar3,param_2,uVar2,L"szStandUpAttackMotionName",1);
  uVar11 = 0xffffffffffffffff;
  psVar9 = psVar4;
  do {
    if (uVar11 == 0) break;
    uVar11 = uVar11 - 1;
    sVar1 = *psVar9;
    psVar9 = psVar9 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0x98,psVar4,~uVar11 - 1);
  uVar2 = FUN_1402970c0(lVar3,L"fHPCheck");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fHPCheck",1);
  *(undefined4 *)(param_1 + 0xc4) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"szHPCheckAction");
  uVar6 = FUN_140296990(lVar3,param_2,uVar2,L"szHPCheckAction",1);
  uVar2 = FUN_1402970c0(lVar3,L"fMPCheck");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fMPCheck",1);
  *(undefined4 *)(param_1 + 0xc0) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"szMPCheckAction");
  uVar7 = FUN_140296990(lVar3,param_2,uVar2,L"szMPCheckAction",1);
  uVar2 = FUN_1402970c0(lVar3,L"szAfterDown");
  uVar8 = FUN_140296990(lVar3,param_2,uVar2,L"szAfterDown",1);
  uVar2 = FUN_14034e7c0(uVar6);
  *(undefined4 *)(param_1 + 200) = uVar2;
  uVar2 = FUN_14034e7c0(uVar7);
  *(undefined4 *)(param_1 + 0xcc) = uVar2;
  uVar2 = FUN_14034e7c0(uVar8);
  *(undefined4 *)(param_1 + 0xd0) = uVar2;
  uVar2 = FUN_1402970c0(lVar3,L"fGuardBlockPercent");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fGuardBlockPercent",1);
  *(undefined4 *)(param_1 + 0x80) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fGuardCheckTime");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fGuardCheckTime",1);
  *(undefined4 *)(param_1 + 0x84) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fGuardBlockPlus");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fGuardBlockPlus",1);
  *(undefined4 *)(param_1 + 0x88) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fRisingDamageFail");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fRisingDamageFail",1);
  *(undefined4 *)(param_1 + 0x8c) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fRisingDamageFailDelay");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fRisingDamageFailDelay",1);
  *(undefined4 *)(param_1 + 0x90) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fStandUpAttackPriority");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fStandUpAttackPriority",1);
  *(undefined4 *)(param_1 + 0xd4) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"fCatchCounterPriority");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fCatchCounterPriority",1);
  *(undefined4 *)(param_1 + 0xd8) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"szCatchCounterMotion");
  psVar4 = (short *)FUN_140296990(lVar3,param_2,uVar2,L"szCatchCounterMotion",1);
  uVar11 = 0xffffffffffffffff;
  psVar9 = psVar4;
  do {
    if (uVar11 == 0) break;
    uVar11 = uVar11 - 1;
    sVar1 = *psVar9;
    psVar9 = psVar9 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1 + 0xe0,psVar4,~uVar11 - 1);
  uVar2 = FUN_1402970c0(lVar3,L"fGuarBreakPriority");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fGuarBreakPriority",1);
  *(undefined4 *)(param_1 + 0x10c) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nGuardBreakCount");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nGuardBreakCount",1);
  *(undefined4 *)(param_1 + 0x108) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nUnderAttack");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nUnderAttack",1);
  *(undefined4 *)(param_1 + 0x48) = *puVar5;
  uVar2 = FUN_1402970c0(lVar3,L"nMovingAttack");
  puVar5 = (undefined4 *)FUN_140296600(lVar3,param_2,uVar2,L"nMovingAttack",0);
  if (puVar5 != (undefined4 *)0x0) {
    *(undefined4 *)(param_1 + 0x4c) = *puVar5;
  }
  uVar2 = FUN_1402970c0(lVar3,L"fMovingAttackDelay");
  puVar5 = (undefined4 *)FUN_1402967b0(lVar3,param_2,uVar2,L"fMovingAttackDelay",0);
  if (puVar5 != (undefined4 *)0x0) {
    *(undefined4 *)(param_1 + 0x114) = *puVar5;
  }
  uVar2 = FUN_1402970c0(lVar3,L"szMovingAttack");
  psVar9 = (short *)FUN_140296990(lVar3,param_2,uVar2,L"szMovingAttack",0);
  if (psVar9 != (short *)0x0) {
    uVar11 = 0xffffffffffffffff;
    psVar4 = psVar9;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar4;
      psVar4 = psVar4 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x118,psVar9,~uVar11 - 1);
  }
  uVar2 = FUN_1402970c0(lVar3,L"fMovingAttackCoolTime");
  puVar10 = (uint *)FUN_1402967b0(lVar3,param_2,uVar2,L"fMovingAttackCoolTime",0);
  uVar11 = 0;
  if (puVar10 != (uint *)0x0) {
    uVar11 = (ulonglong)*puVar10;
    *(uint *)(param_1 + 0x110) = *puVar10;
  }
  return CONCAT71((int7)(uVar11 >> 8),1);
}



longlong * FUN_14034aa10(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 0x118);
  if (7 < *(ulonglong *)(param_1 + 0x130)) {
    plVar1 = (longlong *)*plVar1;
  }
  return plVar1;
}



undefined4 FUN_14034aa30(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x110);
}



undefined4 FUN_14034aa40(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x114);
}



undefined4 FUN_14034aa50(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x4c);
}



undefined4 FUN_14034aa60(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x48);
}



undefined4 FUN_14034aa70(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x10c);
}



undefined4 FUN_14034aa80(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x108);
}



undefined4 FUN_14034aa90(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xd8);
}



longlong * FUN_14034aaa0(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 0xe0);
  if (7 < *(ulonglong *)(param_1 + 0xf8)) {
    plVar1 = (longlong *)*plVar1;
  }
  return plVar1;
}



undefined4 FUN_14034aac0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xd4);
}



undefined4 FUN_14034aad0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xd0);
}



undefined4 FUN_14034aae0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xcc);
}



undefined4 FUN_14034aaf0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 200);
}



undefined4 FUN_14034ab00(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xc0);
}



undefined4 FUN_14034ab10(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xc4);
}



undefined4 FUN_14034ab20(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x90);
}



undefined4 FUN_14034ab30(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x8c);
}



longlong * FUN_14034ab40(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 0x98);
  if (7 < *(ulonglong *)(param_1 + 0xb0)) {
    plVar1 = (longlong *)*plVar1;
  }
  return plVar1;
}



undefined4 FUN_14034ab60(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x7c);
}



undefined4 FUN_14034ab70(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x78);
}



undefined4 FUN_14034ab80(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x74);
}



undefined4 FUN_14034ab90(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x70);
}



undefined4 FUN_14034aba0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 100);
}



undefined4 FUN_14034abb0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x60);
}



undefined4 FUN_14034abc0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x5c);
}



undefined4 FUN_14034abd0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x6c);
}



undefined4 FUN_14034abe0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x44);
}



undefined4 FUN_14034abf0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x54);
}



undefined4 FUN_14034ac00(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x50);
}



undefined4 FUN_14034ac10(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x3c);
}



undefined4 FUN_14034ac20(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x30);
}



undefined8 * FUN_14034ac30(undefined8 *param_1)

{
  param_1[4] = 7;
  param_1[3] = 0;
  *(undefined2 *)(param_1 + 1) = 0;
  *param_1 = mcoAiEnemyTable::vftable;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[9] = 0;
  *(undefined8 *)((longlong)param_1 + 0x54) = 0;
  *(undefined8 *)((longlong)param_1 + 0x5c) = 0;
  *(undefined8 *)((longlong)param_1 + 100) = 0;
  *(undefined8 *)((longlong)param_1 + 0x6c) = 0;
  *(undefined8 *)((longlong)param_1 + 0x74) = 0;
  param_1[0x10] = 0;
  *(undefined4 *)(param_1 + 0x11) = 0;
  param_1[0x15] = 7;
  param_1[0x14] = 0;
  *(undefined2 *)(param_1 + 0x12) = 0;
  *(undefined4 *)(param_1 + 0x17) = 0;
  param_1[0x18] = 0;
  param_1[0x19] = 0;
  *(undefined4 *)(param_1 + 0x1a) = 0;
  param_1[0x1e] = 7;
  param_1[0x1d] = 0;
  *(undefined2 *)(param_1 + 0x1b) = 0;
  param_1[0x20] = 0;
  param_1[0x21] = 0;
  *(undefined4 *)(param_1 + 0x22) = 0;
  return param_1;
}



void FUN_14034acf0(undefined8 *param_1)

{
  *param_1 = mcoAiEnemyTable::vftable;
  if (7 < (ulonglong)param_1[0x1e]) {
    operator_delete((void *)param_1[0x1b]);
  }
  param_1[0x1e] = 7;
  param_1[0x1d] = 0;
  *(undefined2 *)(param_1 + 0x1b) = 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 = mcoAiTable::vftable;
  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;
  return;
}



ulonglong FUN_14034ada0(longlong param_1,uint param_2)

{
  uint uVar1;
  longlong *plVar2;
  uint *puVar3;
  
  plVar2 = (longlong *)FUN_140303a40();
  if (*plVar2 != 0) {
    for (puVar3 = *(uint **)(*plVar2 + ((ulonglong)param_2 % (ulonglong)*(uint *)(plVar2 + 2)) * 8);
        puVar3 != (uint *)0x0; puVar3 = *(uint **)(puVar3 + 0x44)) {
      if ((puVar3[0x46] == param_2) && (*puVar3 == param_2)) goto LAB_14034adea;
    }
  }
  puVar3 = (uint *)0x0;
LAB_14034adea:
  if ((puVar3 != (uint *)0x0) && (puVar3 + 2 != (uint *)0x0)) {
    FUN_1400015e0(param_1 + 8,puVar3 + 2,0,0xffffffffffffffff);
    *(uint *)(param_1 + 0x30) = puVar3[0xc];
    *(uint *)(param_1 + 0x34) = puVar3[0xd];
    *(uint *)(param_1 + 0x38) = puVar3[0xe];
    *(uint *)(param_1 + 0x3c) = puVar3[0xf];
    *(uint *)(param_1 + 0x40) = puVar3[0x10];
    *(uint *)(param_1 + 0x48) = puVar3[0x11];
    *(uint *)(param_1 + 0x4c) = puVar3[0x12];
    *(uint *)(param_1 + 0x50) = puVar3[0x13];
    *(uint *)(param_1 + 0x44) = puVar3[0x14];
    *(uint *)(param_1 + 0x60) = puVar3[0x15];
    *(uint *)(param_1 + 100) = puVar3[0x16];
    *(uint *)(param_1 + 0x54) = puVar3[0x17];
    *(uint *)(param_1 + 0x58) = puVar3[0x18];
    *(uint *)(param_1 + 0x5c) = puVar3[0x19];
    *(uint *)(param_1 + 0x68) = puVar3[0x1a];
    *(uint *)(param_1 + 0x6c) = puVar3[0x1b];
    *(uint *)(param_1 + 0x70) = puVar3[0x1c];
    *(uint *)(param_1 + 0x74) = puVar3[0x1d];
    FUN_1400015e0(param_1 + 0x90,puVar3 + 0x1e,0,0xffffffffffffffff);
    *(uint *)(param_1 + 0xbc) = puVar3[0x28];
    *(uint *)(param_1 + 0xb8) = puVar3[0x29];
    *(uint *)(param_1 + 0xc0) = puVar3[0x2a];
    *(uint *)(param_1 + 0xc4) = puVar3[0x2b];
    *(uint *)(param_1 + 200) = puVar3[0x2c];
    *(uint *)(param_1 + 0x78) = puVar3[0x2d];
    *(uint *)(param_1 + 0x7c) = puVar3[0x2e];
    *(uint *)(param_1 + 0x80) = puVar3[0x2f];
    *(uint *)(param_1 + 0x84) = puVar3[0x30];
    *(uint *)(param_1 + 0x88) = puVar3[0x31];
    *(uint *)(param_1 + 0xcc) = puVar3[0x32];
    *(uint *)(param_1 + 0xd0) = puVar3[0x33];
    FUN_1400015e0(param_1 + 0xd8,puVar3 + 0x34,0,0xffffffffffffffff);
    *(uint *)(param_1 + 0x104) = puVar3[0x3e];
    *(uint *)(param_1 + 0x100) = puVar3[0x3f];
    *(uint *)(param_1 + 0x108) = puVar3[0x40];
    *(uint *)(param_1 + 0x10c) = puVar3[0x41];
    uVar1 = puVar3[0x42];
    *(uint *)(param_1 + 0x110) = uVar1;
    return CONCAT71((uint7)(uint3)(uVar1 >> 8),1);
  }
  return (ulonglong)puVar3 & 0xffffffffffffff00;
}



undefined8 FUN_14034afa0(void)

{
  return 0;
}



undefined4 FUN_14034afb0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x104);
}



undefined4 FUN_14034afc0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x100);
}



undefined4 FUN_14034afd0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xd0);
}



longlong * FUN_14034afe0(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 0xd8);
  if (7 < *(ulonglong *)(param_1 + 0xf0)) {
    plVar1 = (longlong *)*plVar1;
  }
  return plVar1;
}



undefined4 FUN_14034b000(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xcc);
}



undefined4 FUN_14034b010(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xc4);
}



undefined4 FUN_14034b020(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xc0);
}



undefined4 FUN_14034b030(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xb8);
}



undefined4 FUN_14034b040(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0xbc);
}



undefined4 FUN_14034b050(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x88);
}



longlong * FUN_14034b060(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 0x90);
  if (7 < *(ulonglong *)(param_1 + 0xa8)) {
    plVar1 = (longlong *)*plVar1;
  }
  return plVar1;
}



undefined4 FUN_14034b080(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x70);
}



undefined4 FUN_14034b090(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x6c);
}



undefined4 FUN_14034b0a0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x54);
}



undefined4 FUN_14034b0b0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x7c);
}



undefined4 FUN_14034b0c0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x60);
}



undefined4 FUN_14034b0d0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x50);
}



undefined4 FUN_14034b0e0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x4c);
}



undefined4 FUN_14034b0f0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x40);
}



undefined4 FUN_14034b100(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x38);
}



undefined4 FUN_14034b110(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x34);
}



longlong * FUN_14034b120(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_1 + 8);
  if (7 < *(ulonglong *)(param_1 + 0x20)) {
    plVar1 = (longlong *)*plVar1;
  }
  return plVar1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14034b130(longlong param_1,short *param_2)

{
  longlong *plVar1;
  int iVar2;
  short sVar3;
  undefined4 uVar4;
  int *piVar5;
  int *piVar6;
  uint uVar7;
  undefined4 uVar8;
  longlong lVar9;
  undefined4 *puVar10;
  undefined4 *puVar11;
  undefined8 uVar12;
  ulonglong uVar13;
  longlong *plVar14;
  undefined8 *puVar15;
  undefined4 *puVar16;
  short *psVar17;
  longlong lVar18;
  undefined1 auStack_4c8 [32];
  undefined1 local_4a8;
  int local_498;
  undefined4 uStack_494;
  undefined4 *local_490;
  longlong *local_488;
  undefined4 *local_480;
  longlong local_470;
  undefined8 local_468;
  undefined1 local_460 [16];
  longlong *local_450;
  wchar_t local_448 [256];
  wchar_t local_248 [256];
  ulonglong local_48;
  
  local_468 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_4c8;
  uVar13 = 0xffffffffffffffff;
  psVar17 = param_2;
  do {
    if (uVar13 == 0) break;
    uVar13 = uVar13 - 1;
    sVar3 = *psVar17;
    psVar17 = psVar17 + 1;
  } while (sVar3 != 0);
  local_470 = param_1;
  FUN_140001710(param_1,param_2,~uVar13 - 1);
  lVar9 = FUN_1402933b0(DAT_140607ff0,param_2);
  uVar12 = 0;
  if (lVar9 != 0) {
    puVar16 = (undefined4 *)0x0;
    if ((*(longlong *)(lVar9 + 0x70) != 0) && (*(uint *)(lVar9 + 0x78) != 0)) {
      puVar11 = puVar16;
      plVar14 = *(longlong **)(lVar9 + 0x68);
      do {
        if (*plVar14 != 0) {
          puVar16 = (undefined4 *)(*(longlong **)(lVar9 + 0x68))[(longlong)puVar11];
          break;
        }
        uVar7 = (int)puVar11 + 1;
        puVar11 = (undefined4 *)(ulonglong)uVar7;
        plVar14 = plVar14 + 1;
      } while (uVar7 < *(uint *)(lVar9 + 0x78));
    }
LAB_14034b1e6:
    puVar11 = (undefined4 *)0x0;
    if (puVar16 != (undefined4 *)0x0) {
      uVar4 = *puVar16;
      local_480 = puVar16;
      puVar10 = operator_new(0x28);
      if (puVar10 != (undefined4 *)0x0) {
        *(undefined8 *)(puVar10 + 2) = 0;
        *(undefined8 *)(puVar10 + 4) = 0;
        *(undefined8 *)(puVar10 + 6) = 0;
        puVar11 = puVar10;
      }
      local_490 = puVar11;
      FUN_14034b5d0(&local_488,puVar11);
      FUN_140178e90(&local_490,puVar11,puVar11);
      uVar8 = FUN_1402970c0(lVar9,&DAT_14049f290);
      local_4a8 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar9,uVar4,uVar8,&DAT_14049f290);
      *local_490 = *puVar11;
      lVar18 = 5;
      do {
        swprintf_s(local_448,0x100,L"szTargetSet%02d");
        swprintf_s(local_248,0x100,L"fPriority%02d");
        uVar8 = FUN_1402970c0(lVar9,local_448);
        local_4a8 = 1;
        uVar12 = FUN_140296990(lVar9,uVar4,uVar8,local_448);
        local_498 = FUN_14034b4c0(uVar12);
        if (local_498 != 0) {
          uVar8 = FUN_1402970c0(lVar9,local_248);
          local_4a8 = 1;
          puVar10 = (undefined4 *)FUN_1402967b0(lVar9,uVar4,uVar8,local_248);
          puVar11 = local_490;
          uStack_494 = *puVar10;
          piVar5 = *(int **)(local_490 + 4);
          if ((&local_498 < piVar5) && (piVar6 = *(int **)(local_490 + 2), piVar6 <= &local_498)) {
            if (piVar5 == *(int **)(local_490 + 6)) {
              FUN_140147240(local_490 + 2);
            }
            puVar15 = *(undefined8 **)(puVar11 + 4);
            if (puVar15 != (undefined8 *)0x0) {
              uVar12 = *(undefined8 *)
                        (*(longlong *)(puVar11 + 2) +
                        ((longlong)&local_498 - (longlong)piVar6 >> 3) * 8);
LAB_14034b38b:
              *puVar15 = uVar12;
            }
          }
          else {
            if (piVar5 == *(int **)(local_490 + 6)) {
              FUN_140147240(local_490 + 2);
            }
            puVar15 = *(undefined8 **)(puVar11 + 4);
            if (puVar15 != (undefined8 *)0x0) {
              uVar12 = CONCAT44(uStack_494,local_498);
              goto LAB_14034b38b;
            }
          }
          *(longlong *)(puVar11 + 4) = *(longlong *)(puVar11 + 4) + 8;
        }
        lVar18 = lVar18 + -1;
      } while (lVar18 != 0);
      puVar11 = (undefined4 *)FUN_140342d30(local_460,local_490,&local_490);
      FUN_14030e3c0(local_470 + 0x28,*puVar11,puVar11 + 2);
      plVar14 = local_450;
      if (local_450 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_450 + 1;
        lVar18 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar16 = local_480;
        if ((int)lVar18 == 1) {
          (**(code **)(*local_450 + 8))(local_450);
          LOCK();
          piVar5 = (int *)((longlong)plVar14 + 0xc);
          iVar2 = *piVar5;
          *piVar5 = *piVar5 + -1;
          UNLOCK();
          puVar16 = local_480;
          if (iVar2 == 1) {
            (**(code **)(*plVar14 + 0x10))(plVar14);
            puVar16 = local_480;
          }
        }
      }
      plVar14 = local_488;
      puVar11 = puVar16;
      if (local_488 != (longlong *)0x0) {
        LOCK();
        plVar1 = local_488 + 1;
        lVar18 = *plVar1;
        *(int *)plVar1 = (int)*plVar1 + -1;
        UNLOCK();
        puVar11 = local_480;
        if ((int)lVar18 == 1) {
          (**(code **)(*local_488 + 8))(local_488);
          LOCK();
          piVar5 = (int *)((longlong)plVar14 + 0xc);
          iVar2 = *piVar5;
          *piVar5 = *piVar5 + -1;
          UNLOCK();
          puVar11 = local_480;
          if (iVar2 == 1) {
            (**(code **)(*plVar14 + 0x10))(plVar14);
            puVar11 = local_480;
          }
        }
      }
      puVar16 = *(undefined4 **)(puVar11 + 6);
      if (puVar16 == (undefined4 *)0x0) {
        uVar7 = (uint)puVar11[8] % *(uint *)(lVar9 + 0x78) + 1;
        lVar18 = (longlong)(int)uVar7 << 3;
        puVar16 = (undefined4 *)0x0;
        do {
          if (*(uint *)(lVar9 + 0x78) <= uVar7) break;
          if (*(longlong *)(lVar18 + *(longlong *)(lVar9 + 0x68)) != 0) {
            puVar16 = *(undefined4 **)(lVar18 + *(longlong *)(lVar9 + 0x68));
          }
          uVar7 = uVar7 + 1;
          lVar18 = lVar18 + 8;
        } while (puVar16 == (undefined4 *)0x0);
      }
      goto LAB_14034b1e6;
    }
    uVar12 = 1;
  }
  return uVar12;
}



undefined8 FUN_14034b4c0(wchar_t *param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  wchar_t *pwVar3;
  wchar_t *pwVar4;
  undefined1 in_ZF;
  bool bVar5;
  
  lVar2 = 7;
  pwVar3 = param_1;
  pwVar4 = L"NORMAL";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    in_ZF = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while ((bool)in_ZF);
  if ((bool)in_ZF) {
    return 1;
  }
  lVar2 = 9;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"FAR_DIST";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 2;
  }
  lVar2 = 10;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"NEAR_DIST";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 3;
  }
  lVar2 = 0xc;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"HP_RECOVERY";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 4;
  }
  lVar2 = 8;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"HIGH_HP";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 5;
  }
  lVar2 = 7;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"LOW_HP";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 6;
  }
  lVar2 = 8;
  bVar5 = false;
  pwVar3 = L"HOSTILE";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *param_1 == *pwVar3;
    param_1 = param_1 + 1;
    pwVar3 = pwVar3 + 1;
  } while (bVar5);
  uVar1 = 0;
  if (bVar5) {
    uVar1 = 7;
  }
  return uVar1;
}



undefined8 * FUN_14034b5d0(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;
}



void FUN_14034b640(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (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;
}



void FUN_14034b680(void *param_1)

{
  if (param_1 != (void *)0x0) {
    if (*(void **)((longlong)param_1 + 8) != (void *)0x0) {
      operator_delete(*(void **)((longlong)param_1 + 8));
    }
    *(undefined8 *)((longlong)param_1 + 8) = 0;
    *(undefined8 *)((longlong)param_1 + 0x10) = 0;
    *(undefined8 *)((longlong)param_1 + 0x18) = 0;
    operator_delete(param_1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14034b6c0(longlong param_1,LPCWSTR param_2)

{
  int *piVar1;
  int iVar2;
  WCHAR WVar3;
  short sVar4;
  undefined4 uVar5;
  longlong **pplVar6;
  longlong **pplVar7;
  undefined8 *puVar8;
  uint uVar9;
  undefined4 uVar10;
  longlong lVar11;
  undefined8 uVar12;
  longlong *plVar14;
  undefined4 *puVar15;
  short *psVar16;
  short *psVar17;
  wchar_t *pwVar18;
  float *pfVar19;
  ulonglong uVar20;
  longlong lVar21;
  wchar_t *pwVar22;
  LPCWSTR pWVar23;
  wchar_t *pwVar24;
  undefined8 *puVar25;
  longlong *plVar26;
  longlong *plVar27;
  bool bVar28;
  undefined1 auStack_cb8 [32];
  undefined1 local_c98;
  longlong *local_c88;
  longlong *local_c80;
  longlong *local_c78;
  undefined8 local_c68;
  wchar_t local_c58 [256];
  wchar_t local_a58 [256];
  wchar_t local_858 [256];
  wchar_t local_658 [256];
  wchar_t local_458 [256];
  wchar_t local_258 [256];
  ulonglong local_58;
  longlong *plVar13;
  
  local_c68 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_cb8;
  uVar20 = 0xffffffffffffffff;
  pWVar23 = param_2;
  do {
    if (uVar20 == 0) break;
    uVar20 = uVar20 - 1;
    WVar3 = *pWVar23;
    pWVar23 = pWVar23 + 1;
  } while (WVar3 != L'\0');
  FUN_140001710(param_1,param_2,~uVar20 - 1);
  lVar11 = FUN_1402933b0(DAT_140607ff0,param_2);
  if (lVar11 == 0) {
    MessageBoxW((HWND)0x0,param_2,L"CameraSet Error.",0);
    uVar12 = 0;
  }
  else {
    plVar27 = (longlong *)0x0;
    plVar26 = plVar27;
    if ((*(longlong *)(lVar11 + 0x70) != 0) && (*(uint *)(lVar11 + 0x78) != 0)) {
      plVar13 = plVar27;
      plVar14 = *(longlong **)(lVar11 + 0x68);
      do {
        if (*plVar14 != 0) {
          plVar26 = (longlong *)(*(longlong **)(lVar11 + 0x68))[(longlong)plVar13];
          break;
        }
        uVar9 = (int)plVar13 + 1;
        plVar13 = (longlong *)(ulonglong)uVar9;
        plVar14 = plVar14 + 1;
      } while (uVar9 < *(uint *)(lVar11 + 0x78));
    }
LAB_14034b7a0:
    if (plVar26 != (longlong *)0x0) {
      uVar5 = (undefined4)*plVar26;
      local_c78 = plVar26;
      plVar14 = operator_new(0xe8);
      plVar13 = plVar27;
      if (plVar14 != (longlong *)0x0) {
        *plVar14 = 0;
        plVar14[1] = 0;
        plVar14[2] = 0;
        plVar14[6] = 7;
        plVar14[5] = 0;
        *(undefined2 *)(plVar14 + 3) = 0;
        plVar14[0xb] = 7;
        plVar14[10] = 0;
        *(undefined2 *)(plVar14 + 8) = 0;
        plVar13 = plVar14;
      }
      local_c88 = plVar13;
      FUN_14034be60(&local_c80,plVar13);
      FUN_140178e90(&local_c88,plVar13,plVar13);
      uVar10 = FUN_1402970c0(lVar11,&DAT_14049f290);
      local_c98 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,&DAT_14049f290);
      *(undefined4 *)local_c88 = *puVar15;
      uVar10 = FUN_1402970c0(lVar11,L"szCameraBox");
      local_c98 = 1;
      psVar16 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szCameraBox");
      uVar20 = 0xffffffffffffffff;
      psVar17 = psVar16;
      do {
        if (uVar20 == 0) break;
        uVar20 = uVar20 - 1;
        sVar4 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar4 != 0);
      FUN_140001710(local_c88 + 3,psVar16,~uVar20 - 1);
      uVar10 = FUN_1402970c0(lVar11,L"szCameraPos");
      local_c98 = 0;
      psVar17 = (short *)FUN_140296990(lVar11,uVar5,uVar10,L"szCameraPos");
      if (psVar17 != (short *)0x0) {
        uVar20 = 0xffffffffffffffff;
        psVar16 = psVar17;
        do {
          if (uVar20 == 0) break;
          uVar20 = uVar20 - 1;
          sVar4 = *psVar16;
          psVar16 = psVar16 + 1;
        } while (sVar4 != 0);
        FUN_140001710(local_c88 + 8,psVar17,~uVar20 - 1);
      }
      uVar10 = FUN_1402970c0(lVar11,L"szCameraMode");
      local_c98 = 0;
      pwVar18 = (wchar_t *)FUN_140296990(lVar11,uVar5,uVar10,L"szCameraMode");
      bVar28 = pwVar18 == (wchar_t *)0x0;
      if (!bVar28) {
        lVar21 = 10;
        pwVar22 = pwVar18;
        pwVar24 = L"MODE_TIME";
        do {
          if (lVar21 == 0) break;
          lVar21 = lVar21 + -1;
          bVar28 = *pwVar22 == *pwVar24;
          pwVar22 = pwVar22 + 1;
          pwVar24 = pwVar24 + 1;
        } while (bVar28);
        if (bVar28) {
          *(undefined4 *)((longlong)local_c88 + 4) = 2;
        }
        else {
          lVar21 = 10;
          pwVar22 = pwVar18;
          pwVar24 = L"MODE_DIST";
          do {
            if (lVar21 == 0) break;
            lVar21 = lVar21 + -1;
            bVar28 = *pwVar22 == *pwVar24;
            pwVar22 = pwVar22 + 1;
            pwVar24 = pwVar24 + 1;
          } while (bVar28);
          if (bVar28) {
            *(undefined4 *)((longlong)local_c88 + 4) = 1;
          }
          else {
            lVar21 = 0xb;
            pwVar22 = L"MODE_ANGLE";
            do {
              if (lVar21 == 0) break;
              lVar21 = lVar21 + -1;
              bVar28 = *pwVar18 == *pwVar22;
              pwVar18 = pwVar18 + 1;
              pwVar22 = pwVar22 + 1;
            } while (bVar28);
            if (bVar28) {
              *(undefined4 *)((longlong)local_c88 + 4) = 3;
            }
          }
        }
      }
      uVar10 = FUN_1402970c0(lVar11,L"nSelectID");
      local_c98 = 1;
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,L"nSelectID");
      *(undefined4 *)(local_c88 + 1) = *puVar15;
      uVar10 = FUN_1402970c0(lVar11,L"szControl");
      local_c98 = 0;
      pwVar18 = (wchar_t *)FUN_140296990(lVar11,uVar5,uVar10,L"szControl");
      bVar28 = pwVar18 == (wchar_t *)0x0;
      if (!bVar28) {
        lVar21 = 5;
        pwVar22 = pwVar18;
        pwVar24 = L"NONE";
        do {
          if (lVar21 == 0) break;
          lVar21 = lVar21 + -1;
          bVar28 = *pwVar22 == *pwVar24;
          pwVar22 = pwVar22 + 1;
          pwVar24 = pwVar24 + 1;
        } while (bVar28);
        if (bVar28) {
          *(undefined4 *)((longlong)local_c88 + 0xc) = 0;
        }
        else {
          lVar21 = 8;
          pwVar22 = pwVar18;
          pwVar24 = L"DEFAULT";
          do {
            if (lVar21 == 0) break;
            lVar21 = lVar21 + -1;
            bVar28 = *pwVar22 == *pwVar24;
            pwVar22 = pwVar22 + 1;
            pwVar24 = pwVar24 + 1;
          } while (bVar28);
          if (bVar28) {
            *(undefined4 *)((longlong)local_c88 + 0xc) = 1;
          }
          else {
            lVar21 = 5;
            pwVar22 = pwVar18;
            pwVar24 = L"AUTO";
            do {
              if (lVar21 == 0) break;
              lVar21 = lVar21 + -1;
              bVar28 = *pwVar22 == *pwVar24;
              pwVar22 = pwVar22 + 1;
              pwVar24 = pwVar24 + 1;
            } while (bVar28);
            if (bVar28) {
              *(undefined4 *)((longlong)local_c88 + 0xc) = 2;
            }
            else {
              lVar21 = 5;
              pwVar22 = L"SKIP";
              do {
                if (lVar21 == 0) break;
                lVar21 = lVar21 + -1;
                bVar28 = *pwVar18 == *pwVar22;
                pwVar18 = pwVar18 + 1;
                pwVar22 = pwVar22 + 1;
              } while (bVar28);
              if (bVar28) {
                *(undefined4 *)((longlong)local_c88 + 0xc) = 3;
              }
            }
          }
        }
      }
      uVar10 = FUN_1402970c0(lVar11,L"nMotionEnd");
      local_c98 = 0;
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,L"nMotionEnd");
      if (puVar15 != (undefined4 *)0x0) {
        *(undefined4 *)(local_c88 + 2) = *puVar15;
      }
      uVar10 = FUN_1402970c0(lVar11,L"nOnlySelect");
      local_c98 = 0;
      puVar15 = (undefined4 *)FUN_140296600(lVar11,uVar5,uVar10,L"nOnlySelect");
      plVar13 = plVar27;
      if (puVar15 != (undefined4 *)0x0) {
        *(undefined4 *)((longlong)local_c88 + 0x14) = *puVar15;
      }
      do {
        swprintf_s(local_c58,0x100,L"fNearDist%02d");
        swprintf_s(local_858,0x100,L"fFarDist%02d");
        swprintf_s(local_458,0x100,L"fTargetHeight%02d");
        swprintf_s(local_258,0x100,L"fCheckHeight%02d");
        swprintf_s(local_a58,0x100,L"fStartTime%02d");
        swprintf_s(local_658,0x100,L"fEndTime%02d");
        uVar10 = FUN_1402970c0(lVar11,local_858);
        local_c98 = 1;
        puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar5,uVar10,local_858);
        *(undefined4 *)((longlong)plVar13 + 0x6c + (longlong)local_c88) = *puVar15;
        uVar10 = FUN_1402970c0(lVar11,local_c58);
        local_c98 = 1;
        puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar5,uVar10,local_c58);
        *(undefined4 *)((longlong)(plVar13 + 0xd) + (longlong)local_c88) = *puVar15;
        uVar10 = FUN_1402970c0(lVar11,local_458);
        local_c98 = 1;
        puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar5,uVar10,local_458);
        *(undefined4 *)((longlong)(plVar13 + 0xe) + (longlong)local_c88) = *puVar15;
        uVar10 = FUN_1402970c0(lVar11,local_a58);
        local_c98 = 1;
        pfVar19 = (float *)FUN_1402967b0(lVar11,uVar5,uVar10,local_a58);
        *(double *)((longlong)(plVar13 + 0xf) + (longlong)local_c88) = (double)*pfVar19;
        uVar10 = FUN_1402970c0(lVar11,local_658);
        local_c98 = 1;
        pfVar19 = (float *)FUN_1402967b0(lVar11,uVar5,uVar10,local_658);
        *(double *)((longlong)(plVar13 + 0x10) + (longlong)local_c88) = (double)*pfVar19;
        uVar10 = FUN_1402970c0(lVar11,local_258);
        local_c98 = 0;
        puVar15 = (undefined4 *)FUN_1402967b0(lVar11,uVar5,uVar10,local_258);
        if (puVar15 == (undefined4 *)0x0) {
          uVar10 = 0xbf800000;
        }
        else {
          uVar10 = *puVar15;
        }
        *(undefined4 *)((longlong)plVar13 + 0x74 + (longlong)local_c88) = uVar10;
        plVar13 = plVar13 + 4;
      } while ((longlong)plVar13 < 0x80);
      pplVar6 = *(longlong ***)(param_1 + 0x30);
      if ((&local_c88 < pplVar6) &&
         (pplVar7 = *(longlong ***)(param_1 + 0x28), pplVar7 <= &local_c88)) {
        if (pplVar6 == *(longlong ***)(param_1 + 0x38)) {
          FUN_1403435d0(param_1 + 0x28);
        }
        puVar25 = (undefined8 *)
                  (((longlong)&local_c88 - (longlong)pplVar7 & 0xfffffffffffffff0U) +
                  *(longlong *)(param_1 + 0x28));
        puVar8 = *(undefined8 **)(param_1 + 0x30);
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = *puVar25;
          lVar21 = puVar25[1];
          puVar8[1] = lVar21;
          if (lVar21 != 0) {
            LOCK();
            *(int *)(lVar21 + 8) = *(int *)(lVar21 + 8) + 1;
            UNLOCK();
            plVar26 = local_c78;
          }
        }
      }
      else {
        if (pplVar6 == *(longlong ***)(param_1 + 0x38)) {
          FUN_1403435d0(param_1 + 0x28);
        }
        puVar8 = *(undefined8 **)(param_1 + 0x30);
        if (puVar8 != (undefined8 *)0x0) {
          *puVar8 = local_c88;
          puVar8[1] = local_c80;
          if (local_c80 != (longlong *)0x0) {
            LOCK();
            *(int *)(local_c80 + 1) = (int)local_c80[1] + 1;
            UNLOCK();
            plVar26 = local_c78;
          }
        }
      }
      plVar13 = local_c80;
      *(longlong *)(param_1 + 0x30) = *(longlong *)(param_1 + 0x30) + 0x10;
      plVar14 = plVar26;
      if (local_c80 != (longlong *)0x0) {
        LOCK();
        plVar26 = local_c80 + 1;
        lVar21 = *plVar26;
        *(int *)plVar26 = (int)*plVar26 + -1;
        UNLOCK();
        plVar14 = local_c78;
        if ((int)lVar21 == 1) {
          (**(code **)(*local_c80 + 8))(local_c80);
          LOCK();
          piVar1 = (int *)((longlong)plVar13 + 0xc);
          iVar2 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          plVar14 = local_c78;
          if (iVar2 == 1) {
            (**(code **)(*plVar13 + 0x10))(plVar13);
            plVar14 = local_c78;
          }
        }
      }
      plVar26 = (longlong *)plVar14[3];
      if (plVar26 == (longlong *)0x0) {
        uVar9 = *(uint *)(plVar14 + 4) % *(uint *)(lVar11 + 0x78) + 1;
        lVar21 = (longlong)(int)uVar9 << 3;
        plVar26 = plVar27;
        do {
          if (*(uint *)(lVar11 + 0x78) <= uVar9) break;
          if (*(longlong *)(*(longlong *)(lVar11 + 0x68) + lVar21) != 0) {
            plVar26 = *(longlong **)(*(longlong *)(lVar11 + 0x68) + lVar21);
          }
          uVar9 = uVar9 + 1;
          lVar21 = lVar21 + 8;
        } while (plVar26 == (longlong *)0x0);
      }
      goto LAB_14034b7a0;
    }
    uVar12 = 1;
  }
  return uVar12;
}



undefined8 * FUN_14034be60(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;
}



undefined8 FUN_14034bed0(longlong param_1)

{
  int *piVar1;
  int iVar2;
  short sVar3;
  undefined4 uVar4;
  longlong *plVar5;
  uint uVar6;
  undefined4 uVar7;
  longlong lVar8;
  undefined4 *puVar9;
  short *psVar10;
  undefined4 *puVar11;
  longlong lVar12;
  undefined8 uVar13;
  longlong *plVar14;
  ulonglong uVar15;
  undefined4 *puVar16;
  short *psVar17;
  undefined4 *puVar18;
  undefined4 local_res10 [2];
  undefined4 *local_80;
  longlong *local_78;
  undefined4 *local_70;
  longlong *local_68;
  undefined4 *local_60;
  undefined1 local_50 [16];
  longlong *local_40;
  
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ENEMY_HEALING");
  uVar13 = 0;
  if (lVar8 != 0) {
    puVar18 = (undefined4 *)0x0;
    puVar16 = puVar18;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar11 = puVar18;
      plVar14 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar14 != 0) {
          puVar16 = (undefined4 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar11];
          break;
        }
        uVar6 = (int)puVar11 + 1;
        puVar11 = (undefined4 *)(ulonglong)uVar6;
        plVar14 = plVar14 + 1;
      } while (uVar6 < *(uint *)(lVar8 + 0x78));
    }
LAB_14034bf52:
    if (puVar16 != (undefined4 *)0x0) {
      uVar4 = *puVar16;
      local_80 = (undefined4 *)0x0;
      local_78 = (longlong *)0x0;
      local_res10[0] = uVar4;
      local_60 = puVar16;
      puVar9 = operator_new(0x38);
      puVar11 = puVar18;
      if (puVar9 != (undefined4 *)0x0) {
        *(undefined8 *)(puVar9 + 6) = 7;
        *(undefined8 *)(puVar9 + 4) = 0;
        *(undefined2 *)puVar9 = 0;
        puVar11 = puVar9;
      }
      local_70 = puVar11;
      FUN_14034c1d0(&local_68,puVar11);
      FUN_140178e90(&local_70,puVar11,puVar11);
      plVar14 = local_68;
      puVar11 = local_70;
      local_70 = (undefined4 *)0x0;
      local_80 = puVar11;
      local_78 = local_68;
      local_68 = (longlong *)0x0;
      uVar7 = FUN_1402970c0(lVar8,L"szName");
      psVar10 = (short *)FUN_140296990(lVar8,uVar4,uVar7,L"szName",1);
      uVar15 = 0xffffffffffffffff;
      psVar17 = psVar10;
      do {
        if (uVar15 == 0) break;
        uVar15 = uVar15 - 1;
        sVar3 = *psVar17;
        psVar17 = psVar17 + 1;
      } while (sVar3 != 0);
      FUN_140001710(puVar11,psVar10,~uVar15 - 1);
      uVar7 = FUN_1402970c0(lVar8,L"nHealingMP");
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar4,uVar7,L"nHealingMP",1);
      puVar11[0xb] = *puVar9;
      uVar7 = FUN_1402970c0(lVar8,L"nHealingHP");
      puVar9 = (undefined4 *)FUN_140296600(lVar8,uVar4,uVar7,L"nHealingHP",1);
      puVar11[10] = *puVar9;
      uVar7 = FUN_1402970c0(lVar8,L"fHealingRange");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar8,uVar4,uVar7,L"fHealingRange",1);
      puVar11[0xc] = *puVar9;
      uVar7 = FUN_1402970c0(lVar8,L"fHpRatio");
      puVar9 = (undefined4 *)FUN_1402967b0(lVar8,uVar4,uVar7,L"fHpRatio",1);
      puVar11[0xd] = *puVar9;
      puVar11 = (undefined4 *)FUN_140342d30(local_50,local_res10,&local_80);
      FUN_14030e3c0(param_1 + 0x30,*puVar11,puVar11 + 2);
      plVar5 = local_40;
      if (local_40 != (longlong *)0x0) {
        LOCK();
        plVar14 = local_40 + 1;
        lVar12 = *plVar14;
        *(int *)plVar14 = (int)*plVar14 + -1;
        UNLOCK();
        puVar16 = local_60;
        plVar14 = local_78;
        if ((int)lVar12 == 1) {
          (**(code **)(*local_40 + 8))(local_40);
          LOCK();
          piVar1 = (int *)((longlong)plVar5 + 0xc);
          iVar2 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          puVar16 = local_60;
          plVar14 = local_78;
          if (iVar2 == 1) {
            (**(code **)(*plVar5 + 0x10))(plVar5);
            puVar16 = local_60;
            plVar14 = local_78;
          }
        }
      }
      plVar5 = local_78;
      puVar11 = puVar16;
      if (plVar14 != (longlong *)0x0) {
        LOCK();
        plVar14 = plVar14 + 1;
        lVar12 = *plVar14;
        *(int *)plVar14 = (int)*plVar14 + -1;
        UNLOCK();
        puVar11 = local_60;
        if ((int)lVar12 == 1) {
          (**(code **)(*local_78 + 8))(local_78);
          LOCK();
          piVar1 = (int *)((longlong)plVar5 + 0xc);
          iVar2 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          puVar11 = local_60;
          if (iVar2 == 1) {
            (**(code **)(*local_78 + 0x10))();
            puVar11 = local_60;
          }
        }
      }
      puVar16 = *(undefined4 **)(puVar11 + 6);
      if (puVar16 == (undefined4 *)0x0) {
        uVar6 = (uint)puVar11[8] % *(uint *)(lVar8 + 0x78) + 1;
        lVar12 = (longlong)(int)uVar6 << 3;
        puVar16 = puVar18;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar6) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar12) != 0) {
            puVar16 = *(undefined4 **)(*(longlong *)(lVar8 + 0x68) + lVar12);
          }
          uVar6 = uVar6 + 1;
          lVar12 = lVar12 + 8;
        } while (puVar16 == (undefined4 *)0x0);
      }
      goto LAB_14034bf52;
    }
    uVar13 = 1;
  }
  return uVar13;
}



undefined8 * FUN_14034c1d0(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;
}



void FUN_14034c240(longlong param_1)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  if (puVar1 != (undefined8 *)0x0) {
    if (7 < (ulonglong)puVar1[3]) {
      operator_delete((void *)*puVar1);
    }
    puVar1[3] = 7;
    puVar1[2] = 0;
    *(undefined2 *)puVar1 = 0;
    operator_delete(puVar1);
  }
  return;
}



void FUN_14034c280(undefined8 *param_1)

{
  if (param_1 != (undefined8 *)0x0) {
    if (7 < (ulonglong)param_1[3]) {
      operator_delete((void *)*param_1);
    }
    param_1[3] = 7;
    param_1[2] = 0;
    *(undefined2 *)param_1 = 0;
    operator_delete(param_1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14034c2c0(longlong param_1)

{
  ulonglong *puVar1;
  short sVar2;
  undefined4 uVar3;
  int *piVar4;
  int *piVar5;
  code *pcVar6;
  longlong *plVar7;
  uint uVar8;
  undefined4 uVar9;
  int iVar10;
  undefined4 *puVar11;
  short *psVar12;
  wchar_t *pwVar13;
  undefined4 *puVar14;
  longlong lVar15;
  undefined8 uVar16;
  longlong *plVar17;
  ulonglong uVar18;
  longlong lVar19;
  wchar_t *pwVar20;
  undefined4 *puVar21;
  undefined2 *puVar22;
  undefined4 *puVar23;
  undefined4 *puVar24;
  undefined4 *puVar25;
  short *psVar26;
  wchar_t *pwVar27;
  undefined4 *puVar28;
  undefined1 uVar29;
  undefined1 auStack_158 [32];
  undefined1 local_138;
  int local_128 [2];
  undefined4 *local_120;
  longlong *local_118;
  undefined4 local_110 [2];
  undefined4 *local_108;
  longlong *local_100;
  longlong local_f8;
  undefined4 *local_f0;
  longlong local_e0;
  longlong *local_d8;
  wchar_t *local_d0;
  wchar_t *local_c8;
  undefined8 local_c0;
  longlong local_b0;
  undefined8 local_a8;
  undefined1 local_a0 [16];
  longlong *local_90;
  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_a8 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_158;
  local_e0 = param_1;
  local_f8 = FUN_1402933b0(DAT_140607ff0,L"ENEMY_SUMMON");
  uVar16 = 0;
  if (local_f8 != 0) {
    puVar25 = (undefined4 *)0x0;
    puVar28 = puVar25;
    if ((*(longlong *)(local_f8 + 0x70) != 0) && (*(uint *)(local_f8 + 0x78) != 0)) {
      puVar14 = puVar25;
      plVar17 = *(longlong **)(local_f8 + 0x68);
      do {
        if (*plVar17 != 0) {
          puVar28 = (undefined4 *)(*(longlong **)(local_f8 + 0x68))[(longlong)puVar14];
          break;
        }
        uVar8 = (int)puVar14 + 1;
        puVar14 = (undefined4 *)(ulonglong)uVar8;
        plVar17 = plVar17 + 1;
      } while (uVar8 < *(uint *)(local_f8 + 0x78));
    }
LAB_14034c360:
    lVar15 = local_f8;
    if (puVar28 != (undefined4 *)0x0) {
      uVar3 = *puVar28;
      local_120 = (undefined4 *)0x0;
      local_118 = (longlong *)0x0;
      local_110[0] = uVar3;
      local_f0 = puVar28;
      puVar11 = operator_new(0xa0);
      puVar14 = puVar25;
      if (puVar11 != (undefined4 *)0x0) {
        *(undefined8 *)(puVar11 + 6) = 7;
        *(undefined8 *)(puVar11 + 4) = 0;
        *(undefined2 *)puVar11 = 0;
        *(undefined8 *)(puVar11 + 0x14) = 7;
        *(undefined8 *)(puVar11 + 0x12) = 0;
        *(undefined2 *)(puVar11 + 0xe) = 0;
        *(undefined8 *)(puVar11 + 0x18) = 0;
        *(undefined8 *)(puVar11 + 0x1a) = 0;
        *(undefined8 *)(puVar11 + 0x1c) = 0;
        *(undefined8 *)(puVar11 + 0x20) = 0;
        *(undefined8 *)(puVar11 + 0x22) = 0;
        *(undefined8 *)(puVar11 + 0x24) = 0;
        puVar14 = puVar11;
      }
      local_108 = puVar14;
      FUN_14034ca10(&local_100,puVar14);
      FUN_140178e90(&local_108,puVar14,puVar14);
      puVar14 = local_108;
      local_108 = (undefined4 *)0x0;
      local_120 = puVar14;
      local_d8 = local_100;
      local_118 = local_100;
      local_100 = (longlong *)0x0;
      uVar9 = FUN_1402970c0(lVar15,L"szName");
      local_138 = 1;
      psVar12 = (short *)FUN_140296990(lVar15,uVar3,uVar9,L"szName");
      uVar18 = 0xffffffffffffffff;
      psVar26 = psVar12;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar26;
        psVar26 = psVar26 + 1;
      } while (sVar2 != 0);
      FUN_140001710(puVar14,psVar12,~uVar18 - 1);
      uVar9 = FUN_1402970c0(lVar15,L"nSummonMP");
      local_138 = 1;
      puVar11 = (undefined4 *)FUN_140296600(lVar15,uVar3,uVar9,L"nSummonMP");
      puVar14[0xb] = *puVar11;
      uVar9 = FUN_1402970c0(lVar15,L"szEventBoxName");
      local_138 = 1;
      psVar12 = (short *)FUN_140296990(lVar15,uVar3,uVar9,L"szEventBoxName");
      uVar18 = 0xffffffffffffffff;
      psVar26 = psVar12;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar26;
        psVar26 = psVar26 + 1;
      } while (sVar2 != 0);
      FUN_140001710(puVar14 + 0xe,psVar12,~uVar18 - 1);
      uVar9 = FUN_1402970c0(lVar15,L"szEnemyNum");
      local_138 = 1;
      psVar12 = (short *)FUN_140296990(lVar15,uVar3,uVar9,L"szEnemyNum");
      local_48 = 7;
      local_50 = 0;
      local_60 = 0;
      uVar18 = 0xffffffffffffffff;
      psVar26 = psVar12;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        sVar2 = *psVar26;
        psVar26 = psVar26 + 1;
      } while (sVar2 != 0);
      FUN_140001710(&local_60,psVar12,~uVar18 - 1);
      uVar9 = FUN_1402970c0(lVar15,L"szEnemyName");
      local_138 = 1;
      psVar12 = (short *)FUN_140296990(lVar15,uVar3,uVar9,L"szEnemyName");
      local_70 = 7;
      local_78 = 0;
      local_88 = 0;
      uVar18 = 0xffffffffffffffff;
      uVar29 = false;
      psVar26 = psVar12;
      do {
        if (uVar18 == 0) break;
        uVar18 = uVar18 - 1;
        uVar29 = *psVar26 == 0;
        psVar26 = psVar26 + 1;
      } while (!(bool)uVar29);
      FUN_140001710(&local_88,psVar12,~uVar18 - 1);
      uVar9 = FUN_1402970c0(lVar15,L"szMode");
      local_138 = 1;
      pwVar13 = (wchar_t *)FUN_140296990(lVar15,uVar3,uVar9,L"szMode");
      lVar19 = 0xb;
      pwVar20 = pwVar13;
      pwVar27 = L"SUMMON_BOX";
      do {
        if (lVar19 == 0) break;
        lVar19 = lVar19 + -1;
        uVar29 = *pwVar20 == *pwVar27;
        pwVar20 = pwVar20 + 1;
        pwVar27 = pwVar27 + 1;
      } while ((bool)uVar29);
      if ((bool)uVar29) {
        puVar14[10] = 0;
      }
      else {
        lVar19 = 0xc;
        pwVar20 = pwVar13;
        pwVar27 = L"SUMMON_SELF";
        do {
          if (lVar19 == 0) break;
          lVar19 = lVar19 + -1;
          uVar29 = *pwVar20 == *pwVar27;
          pwVar20 = pwVar20 + 1;
          pwVar27 = pwVar27 + 1;
        } while ((bool)uVar29);
        if ((bool)uVar29) {
          puVar14[10] = 1;
        }
        else {
          lVar19 = 0xe;
          pwVar20 = L"SUMMON_TARGET";
          do {
            if (lVar19 == 0) break;
            lVar19 = lVar19 + -1;
            uVar29 = *pwVar13 == *pwVar20;
            pwVar13 = pwVar13 + 1;
            pwVar20 = pwVar20 + 1;
          } while ((bool)uVar29);
          if ((bool)uVar29) {
            puVar14[10] = 2;
          }
        }
      }
      uVar9 = FUN_1402970c0(lVar15,L"fMinRange");
      local_138 = 1;
      puVar11 = (undefined4 *)FUN_1402967b0(lVar15,uVar3,uVar9,L"fMinRange");
      puVar14[0xc] = *puVar11;
      uVar9 = FUN_1402970c0(lVar15,L"fMaxRange");
      local_138 = 1;
      puVar11 = (undefined4 *)FUN_1402967b0(lVar15,uVar3,uVar9,L"fMaxRange");
      puVar14[0xd] = *puVar11;
      local_d0 = (wchar_t *)0x0;
      local_c8 = (wchar_t *)0x0;
      local_c0 = 0;
      puVar22 = &local_60;
      if (7 < local_48) {
        puVar22 = (undefined2 *)CONCAT62(uStack_5e,local_60);
      }
      FUN_140415930(&local_d0,puVar22,&DAT_14049c7b8);
      puVar22 = &local_88;
      if (7 < local_70) {
        puVar22 = (undefined2 *)CONCAT62(uStack_86,local_88);
      }
      FUN_140415930(puVar14 + 0x20,puVar22,&DAT_14049c7b8);
      local_b0 = ((longlong)local_c8 - (longlong)local_d0) / 0x28;
      if (0 < (int)local_b0) {
        puVar1 = (ulonglong *)(puVar14 + 0x18);
        pwVar13 = local_d0;
        puVar11 = puVar25;
        do {
          pwVar20 = pwVar13;
          if (7 < *(ulonglong *)(pwVar13 + 0xc)) {
            pwVar20 = *(wchar_t **)pwVar13;
          }
          iVar10 = _wtoi(pwVar20);
          piVar4 = *(int **)(puVar14 + 0x1a);
          local_128[0] = iVar10;
          if ((local_128 < piVar4) && (piVar5 = (int *)*puVar1, piVar5 <= local_128)) {
            if (piVar4 == *(int **)(puVar14 + 0x1c)) {
              uVar18 = (longlong)piVar4 - (longlong)piVar5 >> 2;
              if (0x3ffffffffffffffe < uVar18) {
                std::_Xlength_error("vector<T> too long");
                pcVar6 = (code *)swi(3);
                uVar16 = (*pcVar6)();
                return uVar16;
              }
              puVar21 = (undefined4 *)(uVar18 + 1);
              puVar23 = (undefined4 *)((longlong)*(int **)(puVar14 + 0x1c) - (longlong)piVar5 >> 2);
              if (puVar23 < puVar21) {
                puVar24 = puVar25;
                if (puVar23 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar23 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar23 + ((ulonglong)puVar23 >> 1));
                }
                if (puVar24 < puVar21) {
                  puVar24 = puVar21;
                }
                FUN_140051e60(puVar1,puVar24);
              }
            }
            if (*(undefined4 **)(puVar14 + 0x1a) != (undefined4 *)0x0) {
              **(undefined4 **)(puVar14 + 0x1a) =
                   *(undefined4 *)(*puVar1 + ((longlong)local_128 - (longlong)piVar5 >> 2) * 4);
            }
          }
          else {
            if (piVar4 == *(int **)(puVar14 + 0x1c)) {
              uVar18 = (longlong)((longlong)piVar4 - *puVar1) >> 2;
              if (0x3ffffffffffffffe < uVar18) {
                std::_Xlength_error("vector<T> too long");
                goto LAB_14034c9dd;
              }
              puVar21 = (undefined4 *)(uVar18 + 1);
              puVar23 = (undefined4 *)
                        ((longlong)((longlong)*(int **)(puVar14 + 0x1c) - *puVar1) >> 2);
              if (puVar23 < puVar21) {
                puVar24 = puVar25;
                if (puVar23 <= (undefined4 *)(0x3fffffffffffffff - ((ulonglong)puVar23 >> 1))) {
                  puVar24 = (undefined4 *)((longlong)puVar23 + ((ulonglong)puVar23 >> 1));
                }
                if (puVar24 < puVar21) {
                  puVar24 = puVar21;
                }
                FUN_140051e60(puVar1,puVar24);
              }
            }
            if (*(int **)(puVar14 + 0x1a) != (int *)0x0) {
              **(int **)(puVar14 + 0x1a) = iVar10;
            }
          }
          *(longlong *)(puVar14 + 0x1a) = *(longlong *)(puVar14 + 0x1a) + 4;
          uVar8 = (int)puVar11 + 1;
          puVar11 = (undefined4 *)(ulonglong)uVar8;
          pwVar13 = pwVar13 + 0x14;
        } while ((int)uVar8 < (int)local_b0);
      }
      puVar14 = (undefined4 *)FUN_140342d30(local_a0,local_110,&local_120);
      FUN_14030e3c0(local_e0 + 0x30,*puVar14,puVar14 + 2);
      plVar7 = local_90;
      plVar17 = local_d8;
      if (local_90 != (longlong *)0x0) {
        LOCK();
        plVar17 = local_90 + 1;
        lVar15 = *plVar17;
        *(int *)plVar17 = (int)*plVar17 + -1;
        UNLOCK();
        plVar17 = local_118;
        puVar28 = local_f0;
        if ((int)lVar15 == 1) {
          (**(code **)(*local_90 + 8))(local_90);
          LOCK();
          piVar4 = (int *)((longlong)plVar7 + 0xc);
          iVar10 = *piVar4;
          *piVar4 = *piVar4 + -1;
          UNLOCK();
          plVar17 = local_118;
          puVar28 = local_f0;
          if (iVar10 == 1) {
            (**(code **)(*plVar7 + 0x10))(plVar7);
            plVar17 = local_118;
            puVar28 = local_f0;
          }
        }
      }
      pwVar27 = local_c8;
      pwVar20 = local_d0;
      pwVar13 = local_d0;
      if (local_d0 != (wchar_t *)0x0) {
        for (; pwVar13 != pwVar27; pwVar13 = pwVar13 + 0x14) {
          if (7 < *(ulonglong *)(pwVar13 + 0xc)) {
            operator_delete(*(void **)pwVar13);
          }
          pwVar13[0xc] = L'\a';
          pwVar13[0xd] = L'\0';
          pwVar13[0xe] = L'\0';
          pwVar13[0xf] = L'\0';
          pwVar13[8] = L'\0';
          pwVar13[9] = L'\0';
          pwVar13[10] = L'\0';
          pwVar13[0xb] = L'\0';
          *pwVar13 = L'\0';
        }
        operator_delete(pwVar20);
      }
      if (7 < local_70) {
        operator_delete((void *)CONCAT62(uStack_86,local_88));
      }
      local_70 = 7;
      local_78 = 0;
      local_88 = 0;
      if (7 < local_48) {
        operator_delete((void *)CONCAT62(uStack_5e,local_60));
      }
      plVar7 = local_118;
      local_48 = 7;
      local_50 = 0;
      local_60 = 0;
      puVar14 = puVar28;
      if (plVar17 != (longlong *)0x0) {
        LOCK();
        plVar17 = plVar17 + 1;
        lVar15 = *plVar17;
        *(int *)plVar17 = (int)*plVar17 + -1;
        UNLOCK();
        puVar14 = local_f0;
        if ((int)lVar15 == 1) {
          (**(code **)(*local_118 + 8))(local_118);
          LOCK();
          piVar4 = (int *)((longlong)plVar7 + 0xc);
          iVar10 = *piVar4;
          *piVar4 = *piVar4 + -1;
          UNLOCK();
          puVar14 = local_f0;
          if (iVar10 == 1) {
            (**(code **)(*local_118 + 0x10))();
            puVar14 = local_f0;
          }
        }
      }
      puVar28 = *(undefined4 **)(puVar14 + 6);
      if (puVar28 == (undefined4 *)0x0) {
        uVar8 = (uint)puVar14[8] % *(uint *)(local_f8 + 0x78) + 1;
        lVar15 = (longlong)(int)uVar8 << 3;
        puVar28 = puVar25;
        do {
          if (*(uint *)(local_f8 + 0x78) <= uVar8) break;
          if (*(longlong *)(*(longlong *)(local_f8 + 0x68) + lVar15) != 0) {
            puVar28 = *(undefined4 **)(*(longlong *)(local_f8 + 0x68) + lVar15);
          }
          uVar8 = uVar8 + 1;
          lVar15 = lVar15 + 8;
        } while (puVar28 == (undefined4 *)0x0);
      }
      goto LAB_14034c360;
    }
LAB_14034c9dd:
    uVar16 = 1;
  }
  return uVar16;
}



undefined8 * FUN_14034ca10(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;
}



void FUN_14034ca80(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x10);
  if (pvVar1 != (void *)0x0) {
    FUN_14034cab0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14034cab0(undefined8 *param_1)

{
  if (param_1[0x10] != 0) {
    FUN_14008d0a0(param_1[0x10],param_1[0x11]);
    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 (7 < (ulonglong)param_1[10]) {
    operator_delete((void *)param_1[7]);
  }
  param_1[10] = 7;
  param_1[9] = 0;
  *(undefined2 *)(param_1 + 7) = 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;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14034cb60(longlong param_1)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  longlong *plVar4;
  uint uVar5;
  undefined4 uVar6;
  DWORD DVar7;
  longlong lVar8;
  undefined8 *puVar9;
  undefined8 uVar10;
  undefined4 *puVar11;
  undefined8 *puVar12;
  undefined4 *puVar13;
  HANDLE pvVar14;
  HANDLE pvVar15;
  longlong lVar16;
  longlong *plVar17;
  undefined8 *puVar18;
  undefined8 *puVar19;
  undefined8 *puVar20;
  undefined1 auStackY_508 [32];
  undefined8 *local_4b0;
  longlong *local_4a8;
  undefined4 local_4a0 [2];
  undefined8 *local_498;
  longlong *local_490;
  undefined8 *local_488;
  longlong *local_478;
  longlong local_470;
  undefined8 *local_468;
  undefined8 local_460;
  undefined1 local_458 [16];
  longlong *local_448;
  wchar_t local_438 [256];
  wchar_t local_238 [256];
  ulonglong local_38;
  
  local_460 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStackY_508;
  local_470 = param_1;
  lVar8 = FUN_1402933b0(DAT_140607ff0,L"ENEMY_COSTUME");
  uVar10 = 0;
  if (lVar8 != 0) {
    puVar18 = (undefined8 *)0x0;
    puVar19 = puVar18;
    if ((*(longlong *)(lVar8 + 0x70) != 0) && (*(uint *)(lVar8 + 0x78) != 0)) {
      puVar20 = puVar18;
      plVar17 = *(longlong **)(lVar8 + 0x68);
      do {
        if (*plVar17 != 0) {
          puVar19 = (undefined8 *)(*(longlong **)(lVar8 + 0x68))[(longlong)puVar20];
          break;
        }
        uVar5 = (int)puVar20 + 1;
        puVar20 = (undefined8 *)(ulonglong)uVar5;
        plVar17 = plVar17 + 1;
      } while (uVar5 < *(uint *)(lVar8 + 0x78));
    }
LAB_14034cc03:
    if (puVar19 != (undefined8 *)0x0) {
      uVar3 = *(undefined4 *)puVar19;
      local_4b0 = (undefined8 *)0x0;
      local_4a8 = (longlong *)0x0;
      local_4a0[0] = uVar3;
      local_488 = puVar19;
      puVar9 = operator_new(0x34);
      puVar20 = puVar18;
      if (puVar9 != (undefined8 *)0x0) {
        *puVar9 = 0;
        puVar9[1] = 0;
        puVar9[2] = 0;
        puVar9[3] = 0;
        puVar9[4] = 0;
        *(undefined4 *)(puVar9 + 5) = 0;
        *(undefined8 *)((longlong)puVar9 + 0x2c) = 0;
        puVar20 = puVar9;
      }
      local_498 = puVar20;
      FUN_14034d0e0(&local_490,puVar20);
      FUN_140178e90(&local_498,puVar20,puVar20);
      puVar20 = local_498;
      local_468 = local_498;
      local_498 = (undefined8 *)0x0;
      local_4b0 = puVar20;
      local_478 = local_490;
      local_4a8 = local_490;
      local_490 = (longlong *)0x0;
      uVar6 = FUN_1402970c0(lVar8,L"wszParts");
      uVar10 = FUN_140296b70(lVar8,uVar3,uVar6,L"wszParts");
      uVar6 = FUN_14034d010(uVar10);
      *(undefined4 *)((longlong)puVar20 + 4) = uVar6;
      puVar20 = puVar20 + 1;
      puVar9 = puVar18;
      do {
        uVar5 = (uint)puVar9 + 1;
        swprintf_s(local_438,0x100,L"nPartID%02d");
        uVar6 = FUN_1402970c0(lVar8,local_438);
        puVar11 = (undefined4 *)FUN_140296600(lVar8,uVar3,uVar6,local_438);
        uVar6 = *puVar11;
        puVar12 = puVar20;
        if (8 < (uint)puVar9) {
          if ((DAT_140609378 == 0) &&
             (pvVar14 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), pvVar14 != (HANDLE)0x0)) {
            DVar7 = GetCurrentProcessId();
            pvVar15 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar15,DVar7,pvVar14,0x2000);
            CloseHandle(pvVar14);
          }
          DAT_140609378 = DAT_140609378 + 1;
          puVar12 = (undefined8 *)&DAT_140609374;
        }
        *(undefined4 *)puVar12 = uVar6;
        puVar9 = (undefined8 *)(ulonglong)uVar5;
        puVar20 = (undefined8 *)((longlong)puVar20 + 4);
      } while ((int)uVar5 < 9);
      puVar11 = (undefined4 *)((longlong)local_468 + 0x2c);
      puVar20 = puVar18;
      do {
        uVar5 = (uint)puVar20 + 1;
        swprintf_s(local_238,0x100,L"nWeaponID%02d");
        uVar6 = FUN_1402970c0(lVar8,local_238);
        puVar13 = (undefined4 *)FUN_140296600(lVar8,uVar3,uVar6,local_238);
        uVar6 = *puVar13;
        puVar13 = puVar11;
        if (1 < (uint)puVar20) {
          if ((DAT_140609370 == 0) &&
             (pvVar14 = CreateFileW(L"test.dmp",0x40000000,0,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,
                                    (HANDLE)0x0), pvVar14 != (HANDLE)0x0)) {
            DVar7 = GetCurrentProcessId();
            pvVar15 = GetCurrentProcess();
            MiniDumpWriteDump(pvVar15,DVar7,pvVar14,0x2000);
            CloseHandle(pvVar14);
          }
          DAT_140609370 = DAT_140609370 + 1;
          puVar13 = &DAT_14060936c;
        }
        *puVar13 = uVar6;
        puVar20 = (undefined8 *)(ulonglong)uVar5;
        puVar11 = puVar11 + 1;
      } while ((int)uVar5 < 2);
      puVar11 = (undefined4 *)FUN_140342d30(local_458,local_4a0,&local_4b0);
      FUN_14030e3c0(local_470 + 0x30,*puVar11,puVar11 + 2);
      plVar4 = local_448;
      plVar17 = local_478;
      if (local_448 != (longlong *)0x0) {
        LOCK();
        plVar17 = local_448 + 1;
        lVar16 = *plVar17;
        *(int *)plVar17 = (int)*plVar17 + -1;
        UNLOCK();
        plVar17 = local_4a8;
        puVar19 = local_488;
        if ((int)lVar16 == 1) {
          (**(code **)(*local_448 + 8))(local_448);
          LOCK();
          piVar1 = (int *)((longlong)plVar4 + 0xc);
          iVar2 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          plVar17 = local_4a8;
          puVar19 = local_488;
          if (iVar2 == 1) {
            (**(code **)(*plVar4 + 0x10))(plVar4);
            plVar17 = local_4a8;
            puVar19 = local_488;
          }
        }
      }
      plVar4 = local_4a8;
      puVar20 = puVar19;
      if (plVar17 != (longlong *)0x0) {
        LOCK();
        plVar17 = plVar17 + 1;
        lVar16 = *plVar17;
        *(int *)plVar17 = (int)*plVar17 + -1;
        UNLOCK();
        puVar20 = local_488;
        if ((int)lVar16 == 1) {
          (**(code **)(*local_4a8 + 8))(local_4a8);
          LOCK();
          piVar1 = (int *)((longlong)plVar4 + 0xc);
          iVar2 = *piVar1;
          *piVar1 = *piVar1 + -1;
          UNLOCK();
          puVar20 = local_488;
          if (iVar2 == 1) {
            (**(code **)(*local_4a8 + 0x10))();
            puVar20 = local_488;
          }
        }
      }
      puVar19 = (undefined8 *)puVar20[3];
      if (puVar19 == (undefined8 *)0x0) {
        uVar5 = *(uint *)(puVar20 + 4) % *(uint *)(lVar8 + 0x78) + 1;
        lVar16 = (longlong)(int)uVar5 << 3;
        puVar19 = puVar18;
        do {
          if (*(uint *)(lVar8 + 0x78) <= uVar5) break;
          if (*(longlong *)(*(longlong *)(lVar8 + 0x68) + lVar16) != 0) {
            puVar19 = *(undefined8 **)(*(longlong *)(lVar8 + 0x68) + lVar16);
          }
          uVar5 = uVar5 + 1;
          lVar16 = lVar16 + 8;
        } while (puVar19 == (undefined8 *)0x0);
      }
      goto LAB_14034cc03;
    }
    uVar10 = 1;
  }
  return uVar10;
}



undefined8 FUN_14034d010(wchar_t *param_1)

{
  longlong lVar1;
  wchar_t *pwVar2;
  wchar_t *pwVar3;
  bool bVar4;
  
  bVar4 = param_1 == (wchar_t *)0x0;
  if (!bVar4) {
    lVar1 = 8;
    pwVar2 = param_1;
    pwVar3 = L"MONSTER";
    do {
      if (lVar1 == 0) break;
      lVar1 = lVar1 + -1;
      bVar4 = *pwVar2 == *pwVar3;
      pwVar2 = pwVar2 + 1;
      pwVar3 = pwVar3 + 1;
    } while (bVar4);
    if (!bVar4) {
      lVar1 = 7;
      pwVar2 = param_1;
      pwVar3 = L"FRANTZ";
      do {
        if (lVar1 == 0) break;
        lVar1 = lVar1 + -1;
        bVar4 = *pwVar2 == *pwVar3;
        pwVar2 = pwVar2 + 1;
        pwVar3 = pwVar3 + 1;
      } while (bVar4);
      if (bVar4) {
        return 1;
      }
      lVar1 = 7;
      bVar4 = false;
      pwVar2 = param_1;
      pwVar3 = L"ANGELA";
      do {
        if (lVar1 == 0) break;
        lVar1 = lVar1 + -1;
        bVar4 = *pwVar2 == *pwVar3;
        pwVar2 = pwVar2 + 1;
        pwVar3 = pwVar3 + 1;
      } while (bVar4);
      if (bVar4) {
        return 2;
      }
      lVar1 = 5;
      bVar4 = false;
      pwVar2 = param_1;
      pwVar3 = L"TUDE";
      do {
        if (lVar1 == 0) break;
        lVar1 = lVar1 + -1;
        bVar4 = *pwVar2 == *pwVar3;
        pwVar2 = pwVar2 + 1;
        pwVar3 = pwVar3 + 1;
      } while (bVar4);
      if (bVar4) {
        return 3;
      }
      lVar1 = 8;
      bVar4 = false;
      pwVar2 = L"NATASHA";
      do {
        if (lVar1 == 0) break;
        lVar1 = lVar1 + -1;
        bVar4 = *param_1 == *pwVar2;
        param_1 = param_1 + 1;
        pwVar2 = pwVar2 + 1;
      } while (bVar4);
      if (bVar4) {
        return 4;
      }
    }
  }
  return 0;
}



undefined8 * FUN_14034d0e0(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;
}



undefined4 * FUN_14034d150(undefined4 *param_1)

{
  *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;
  *(undefined8 *)(param_1 + 0xc) = 0;
  *(undefined8 *)(param_1 + 0xe) = 0;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined8 *)(param_1 + 0x13) = 0;
  param_1[0x15] = 0;
  *(undefined8 *)(param_1 + 0x1c) = 7;
  *(undefined8 *)(param_1 + 0x1a) = 0;
  *(undefined2 *)(param_1 + 0x16) = 0;
  *(undefined8 *)(param_1 + 0x26) = 7;
  *(undefined8 *)(param_1 + 0x24) = 0;
  *(undefined2 *)(param_1 + 0x20) = 0;
  *(undefined8 *)(param_1 + 0x30) = 7;
  *(undefined8 *)(param_1 + 0x2e) = 0;
  *(undefined2 *)(param_1 + 0x2a) = 0;
  *(undefined8 *)(param_1 + 0x3a) = 7;
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined2 *)(param_1 + 0x34) = 0;
  *(undefined8 *)(param_1 + 0x44) = 7;
  *(undefined8 *)(param_1 + 0x42) = 0;
  *(undefined2 *)(param_1 + 0x3e) = 0;
  *(undefined8 *)(param_1 + 0x4e) = 7;
  *(undefined8 *)(param_1 + 0x4c) = 0;
  *(undefined2 *)(param_1 + 0x48) = 0;
  *(undefined8 *)(param_1 + 0x58) = 7;
  *(undefined8 *)(param_1 + 0x56) = 0;
  *(undefined2 *)(param_1 + 0x52) = 0;
  *(undefined8 *)(param_1 + 0x62) = 7;
  *(undefined8 *)(param_1 + 0x60) = 0;
  *(undefined2 *)(param_1 + 0x5c) = 0;
  *(undefined8 *)(param_1 + 0x6c) = 7;
  *(undefined8 *)(param_1 + 0x6a) = 0;
  *(undefined2 *)(param_1 + 0x66) = 0;
  *(undefined8 *)(param_1 + 0x76) = 7;
  *(undefined8 *)(param_1 + 0x74) = 0;
  *(undefined2 *)(param_1 + 0x70) = 0;
  *(undefined8 *)(param_1 + 0x80) = 7;
  *(undefined8 *)(param_1 + 0x7e) = 0;
  *(undefined2 *)(param_1 + 0x7a) = 0;
  *(undefined8 *)(param_1 + 0x8a) = 7;
  *(undefined8 *)(param_1 + 0x88) = 0;
  *(undefined2 *)(param_1 + 0x84) = 0;
  _eh_vector_constructor_iterator_
            (param_1 + 0x94,0x28,3,(_func_void_void_ptr *)&LAB_1400030e0,FUN_14023be90);
  *(undefined8 *)(param_1 + 0xb2) = 0;
  *(undefined8 *)(param_1 + 0xb4) = 0;
  *(undefined8 *)(param_1 + 0xb6) = 0;
  *(undefined8 *)(param_1 + 0x8e) = 0;
  param_1[0x90] = 0;
  *(undefined8 *)(param_1 + 0x91) = 0;
  param_1[0x93] = 0;
  return param_1;
}



void FUN_14034d320(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  if (*(longlong *)(param_1 + 0x2c8) != 0) {
    FUN_1401297b0(*(longlong *)(param_1 + 0x2c8),*(undefined8 *)(param_1 + 0x2d0),param_3,param_4,
                  0xfffffffffffffffe);
    operator_delete(*(void **)(param_1 + 0x2c8));
  }
  *(undefined8 *)(param_1 + 0x2c8) = 0;
  *(undefined8 *)(param_1 + 0x2d0) = 0;
  *(undefined8 *)(param_1 + 0x2d8) = 0;
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x250),0x28,3,FUN_14023be90);
  if (7 < *(ulonglong *)(param_1 + 0x228)) {
    operator_delete(*(void **)(param_1 + 0x210));
  }
  *(undefined8 *)(param_1 + 0x228) = 7;
  *(undefined8 *)(param_1 + 0x220) = 0;
  *(undefined2 *)(param_1 + 0x210) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x200)) {
    operator_delete(*(void **)(param_1 + 0x1e8));
  }
  *(undefined8 *)(param_1 + 0x200) = 7;
  *(undefined8 *)(param_1 + 0x1f8) = 0;
  *(undefined2 *)(param_1 + 0x1e8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1d8)) {
    operator_delete(*(void **)(param_1 + 0x1c0));
  }
  *(undefined8 *)(param_1 + 0x1d8) = 7;
  *(undefined8 *)(param_1 + 0x1d0) = 0;
  *(undefined2 *)(param_1 + 0x1c0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1b0)) {
    operator_delete(*(void **)(param_1 + 0x198));
  }
  *(undefined8 *)(param_1 + 0x1b0) = 7;
  *(undefined8 *)(param_1 + 0x1a8) = 0;
  *(undefined2 *)(param_1 + 0x198) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x188)) {
    operator_delete(*(void **)(param_1 + 0x170));
  }
  *(undefined8 *)(param_1 + 0x188) = 7;
  *(undefined8 *)(param_1 + 0x180) = 0;
  *(undefined2 *)(param_1 + 0x170) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x160)) {
    operator_delete(*(void **)(param_1 + 0x148));
  }
  *(undefined8 *)(param_1 + 0x160) = 7;
  *(undefined8 *)(param_1 + 0x158) = 0;
  *(undefined2 *)(param_1 + 0x148) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x138)) {
    operator_delete(*(void **)(param_1 + 0x120));
  }
  *(undefined8 *)(param_1 + 0x138) = 7;
  *(undefined8 *)(param_1 + 0x130) = 0;
  *(undefined2 *)(param_1 + 0x120) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x110)) {
    operator_delete(*(void **)(param_1 + 0xf8));
  }
  *(undefined8 *)(param_1 + 0x110) = 7;
  *(undefined8 *)(param_1 + 0x108) = 0;
  *(undefined2 *)(param_1 + 0xf8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xe8)) {
    operator_delete(*(void **)(param_1 + 0xd0));
  }
  *(undefined8 *)(param_1 + 0xe8) = 7;
  *(undefined8 *)(param_1 + 0xe0) = 0;
  *(undefined2 *)(param_1 + 0xd0) = 0;
  if (7 < *(ulonglong *)(param_1 + 0xc0)) {
    operator_delete(*(void **)(param_1 + 0xa8));
  }
  *(undefined8 *)(param_1 + 0xc0) = 7;
  *(undefined8 *)(param_1 + 0xb8) = 0;
  *(undefined2 *)(param_1 + 0xa8) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x98)) {
    operator_delete(*(void **)(param_1 + 0x80));
  }
  *(undefined8 *)(param_1 + 0x98) = 7;
  *(undefined8 *)(param_1 + 0x90) = 0;
  *(undefined2 *)(param_1 + 0x80) = 0;
  if (7 < *(ulonglong *)(param_1 + 0x70)) {
    operator_delete(*(void **)(param_1 + 0x58));
  }
  *(undefined8 *)(param_1 + 0x70) = 7;
  *(undefined8 *)(param_1 + 0x68) = 0;
  *(undefined2 *)(param_1 + 0x58) = 0;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14034d5d0(longlong param_1,undefined4 param_2)

{
  short sVar1;
  wchar_t wVar2;
  undefined4 uVar3;
  longlong lVar4;
  undefined4 *puVar5;
  float *pfVar6;
  short *psVar7;
  short *psVar8;
  wchar_t *pwVar9;
  undefined8 uVar10;
  ulonglong uVar11;
  longlong lVar12;
  undefined8 *puVar13;
  wchar_t *pwVar14;
  undefined2 *puVar15;
  uint uVar16;
  wchar_t *pwVar17;
  wchar_t *pwVar18;
  int iVar19;
  undefined1 uVar20;
  float fVar21;
  undefined1 auStack_538 [32];
  undefined1 local_518;
  uint local_508;
  wchar_t *local_500;
  wchar_t *local_4f8;
  undefined8 local_4f0;
  float *local_4e0;
  undefined8 local_4d8;
  undefined2 local_4d0;
  undefined6 uStack_4ce;
  longlong local_4c0;
  ulonglong local_4b8;
  int local_4a8 [2];
  undefined2 local_4a0;
  undefined6 uStack_49e;
  undefined8 local_490;
  ulonglong local_488;
  undefined2 local_478;
  undefined6 uStack_476;
  undefined8 local_468;
  ulonglong local_460;
  wchar_t local_448 [256];
  wchar_t local_248 [256];
  ulonglong local_48;
  
  local_4d8 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_538;
  lVar4 = FUN_1402933b0(DAT_140607ff0,L"ENEMY_BOSS_AI");
  if (lVar4 == 0) {
LAB_14034e3cf:
    uVar10 = 0;
  }
  else {
    uVar3 = FUN_1402970c0(lVar4,L"nMove");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_140296600(lVar4,param_2,uVar3,L"nMove");
    *(undefined4 *)(param_1 + 0x40) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"nFix");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_140296600(lVar4,param_2,uVar3,L"nFix");
    *(undefined4 *)(param_1 + 0x44) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"nHitFlash");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_140296600(lVar4,param_2,uVar3,L"nHitFlash");
    *(undefined4 *)(param_1 + 0x48) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"nTargetDirect");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_140296600(lVar4,param_2,uVar3,L"nTargetDirect");
    *(undefined4 *)(param_1 + 0x54) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fHitFlashDamage");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fHitFlashDamage");
    *(undefined4 *)(param_1 + 4) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fLineDist");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fLineDist");
    *(undefined4 *)(param_1 + 8) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fStayDelay");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fStayDelay");
    *(undefined4 *)(param_1 + 0xc) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,&DAT_1404d50e0);
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,&DAT_1404d50e0);
    *(undefined4 *)(param_1 + 0x10) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fTurnAngle");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fTurnAngle");
    *(undefined4 *)(param_1 + 0x14) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fTurnRange");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fTurnRange");
    *(undefined4 *)(param_1 + 0x18) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fRushSpeed");
    local_518 = 1;
    pfVar6 = (float *)FUN_1402967b0(lVar4,param_2,uVar3,L"fRushSpeed");
    fVar21 = *pfVar6 - 1.0;
    *(float *)(param_1 + 0x1c) = fVar21;
    if (fVar21 <= 0.0) {
      fVar21 = 0.01;
    }
    *(float *)(param_1 + 0x1c) = fVar21;
    uVar3 = FUN_1402970c0(lVar4,L"fSelfDestructRange");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fSelfDestructRange");
    *(undefined4 *)(param_1 + 0x20) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fWeakPointDamage");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fWeakPointDamage");
    *(undefined4 *)(param_1 + 0x24) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fDamageShakeTime");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fDamageShakeTime");
    *(undefined4 *)(param_1 + 0x28) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fDamageShakeShock");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fDamageShakeShock");
    *(undefined4 *)(param_1 + 0x2c) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fDamageShakeRand");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fDamageShakeRand");
    *(undefined4 *)(param_1 + 0x30) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fDamageRadialTime");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fDamageRadialTime");
    *(undefined4 *)(param_1 + 0x34) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fDamageRadialRumble");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fDamageRadialRumble");
    *(undefined4 *)(param_1 + 0x38) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"fAddMoveHeight");
    local_518 = 1;
    puVar5 = (undefined4 *)FUN_1402967b0(lVar4,param_2,uVar3,L"fAddMoveHeight");
    *(undefined4 *)(param_1 + 0x3c) = *puVar5;
    uVar3 = FUN_1402970c0(lVar4,L"szName");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szName");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x58,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szTargetSet");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szTargetSet");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x80,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szAttackFeature");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szAttackFeature");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0xa8,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szComboSet");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szComboSet");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0xd0,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szCameraSet");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szCameraSet");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0xf8,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szWarp");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szWarp");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x170,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szRageMotion");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szRageMotion");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x120,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szRushSet");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szRushSet");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x198,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szSelfDestMotion");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szSelfDestMotion");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x1c0,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szRadialDummy");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szRadialDummy");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x210,psVar7,~uVar11 - 1);
    uVar3 = FUN_1402970c0(lVar4,L"szRageMaterial");
    local_518 = 0;
    psVar8 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szRageMaterial");
    uVar20 = psVar8 == (short *)0x0;
    if (!(bool)uVar20) {
      uVar11 = 0xffffffffffffffff;
      uVar20 = false;
      psVar7 = psVar8;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        uVar20 = *psVar7 == 0;
        psVar7 = psVar7 + 1;
      } while (!(bool)uVar20);
      FUN_140001710(param_1 + 0x148,psVar8,~uVar11 - 1);
    }
    uVar3 = FUN_1402970c0(lVar4,L"szRageArmorState");
    local_518 = 1;
    pwVar9 = (wchar_t *)FUN_140296990(lVar4,param_2,uVar3,L"szRageArmorState");
    lVar12 = 0x13;
    pwVar17 = pwVar9;
    pwVar14 = L"ARMOR_NOT_MATERIAL";
    do {
      if (lVar12 == 0) break;
      lVar12 = lVar12 + -1;
      uVar20 = *pwVar17 == *pwVar14;
      pwVar17 = pwVar17 + 1;
      pwVar14 = pwVar14 + 1;
    } while ((bool)uVar20);
    if ((bool)uVar20) {
      *(undefined4 *)(param_1 + 0x4c) = 1;
    }
    else {
      lVar12 = 10;
      pwVar17 = pwVar9;
      pwVar14 = L"ARMOR_GOD";
      do {
        if (lVar12 == 0) break;
        lVar12 = lVar12 + -1;
        uVar20 = *pwVar17 == *pwVar14;
        pwVar17 = pwVar17 + 1;
        pwVar14 = pwVar14 + 1;
      } while ((bool)uVar20);
      if ((bool)uVar20) {
        *(undefined4 *)(param_1 + 0x4c) = 3;
      }
      else {
        lVar12 = 0x15;
        pwVar17 = pwVar9;
        pwVar14 = L"ARMOR_GOD_MATERIAL_A";
        do {
          if (lVar12 == 0) break;
          lVar12 = lVar12 + -1;
          uVar20 = *pwVar17 == *pwVar14;
          pwVar17 = pwVar17 + 1;
          pwVar14 = pwVar14 + 1;
        } while ((bool)uVar20);
        if ((bool)uVar20) {
          *(undefined4 *)(param_1 + 0x4c) = 4;
        }
        else {
          lVar12 = 0x15;
          pwVar17 = pwVar9;
          pwVar14 = L"ARMOR_GOD_MATERIAL_B";
          do {
            if (lVar12 == 0) break;
            lVar12 = lVar12 + -1;
            uVar20 = *pwVar17 == *pwVar14;
            pwVar17 = pwVar17 + 1;
            pwVar14 = pwVar14 + 1;
          } while ((bool)uVar20);
          if ((bool)uVar20) {
            *(undefined4 *)(param_1 + 0x4c) = 5;
          }
          else {
            lVar12 = 0x11;
            pwVar17 = pwVar9;
            pwVar14 = L"ARMOR_MATERIAL_A";
            do {
              if (lVar12 == 0) break;
              lVar12 = lVar12 + -1;
              uVar20 = *pwVar17 == *pwVar14;
              pwVar17 = pwVar17 + 1;
              pwVar14 = pwVar14 + 1;
            } while ((bool)uVar20);
            if ((bool)uVar20) {
              *(undefined4 *)(param_1 + 0x4c) = 6;
            }
            else {
              lVar12 = 0x11;
              pwVar17 = pwVar9;
              pwVar14 = L"ARMOR_MATERIAL_B";
              do {
                if (lVar12 == 0) break;
                lVar12 = lVar12 + -1;
                uVar20 = *pwVar17 == *pwVar14;
                pwVar17 = pwVar17 + 1;
                pwVar14 = pwVar14 + 1;
              } while ((bool)uVar20);
              if ((bool)uVar20) {
                *(undefined4 *)(param_1 + 0x4c) = 7;
              }
              else {
                lVar12 = 0x11;
                pwVar17 = pwVar9;
                pwVar14 = L"ARMOR_MATERIAL_C";
                do {
                  if (lVar12 == 0) break;
                  lVar12 = lVar12 + -1;
                  uVar20 = *pwVar17 == *pwVar14;
                  pwVar17 = pwVar17 + 1;
                  pwVar14 = pwVar14 + 1;
                } while ((bool)uVar20);
                if ((bool)uVar20) {
                  *(undefined4 *)(param_1 + 0x4c) = 8;
                }
                else {
                  lVar12 = 0x11;
                  pwVar17 = pwVar9;
                  pwVar14 = L"ARMOR_MATERIAL_D";
                  do {
                    if (lVar12 == 0) break;
                    lVar12 = lVar12 + -1;
                    uVar20 = *pwVar17 == *pwVar14;
                    pwVar17 = pwVar17 + 1;
                    pwVar14 = pwVar14 + 1;
                  } while ((bool)uVar20);
                  if ((bool)uVar20) {
                    *(undefined4 *)(param_1 + 0x4c) = 9;
                  }
                  else {
                    lVar12 = 0x13;
                    pwVar17 = pwVar9;
                    pwVar14 = L"ARMOR_MATERIAL_D_A";
                    do {
                      if (lVar12 == 0) break;
                      lVar12 = lVar12 + -1;
                      uVar20 = *pwVar17 == *pwVar14;
                      pwVar17 = pwVar17 + 1;
                      pwVar14 = pwVar14 + 1;
                    } while ((bool)uVar20);
                    if ((bool)uVar20) {
                      *(undefined4 *)(param_1 + 0x4c) = 10;
                    }
                    else {
                      lVar12 = 0x13;
                      pwVar17 = L"ARMOR_MATERIAL_D_B";
                      do {
                        if (lVar12 == 0) break;
                        lVar12 = lVar12 + -1;
                        uVar20 = *pwVar9 == *pwVar17;
                        pwVar9 = pwVar9 + 1;
                        pwVar17 = pwVar17 + 1;
                      } while ((bool)uVar20);
                      if ((bool)uVar20) {
                        *(undefined4 *)(param_1 + 0x4c) = 0xb;
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    uVar16 = 0;
    do {
      if (uVar16 < 3) {
        puVar13 = (undefined8 *)(param_1 + 0x250 + (longlong)(int)uVar16 * 0x28);
      }
      else {
        if (DAT_140609360 == 0) {
          FUN_140176d60(0);
        }
        DAT_140609360 = DAT_140609360 + 1;
        puVar13 = &DAT_1405f0468;
      }
      FUN_140001710(puVar13,&DAT_140477960,0);
      local_508 = uVar16 + 1;
      swprintf_s(local_448,0x100,L"szWideRadius%02d");
      uVar3 = FUN_1402970c0(lVar4,local_448);
      local_518 = 1;
      psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,local_448);
      local_4b8 = 7;
      local_4c0 = 0;
      local_4d0 = 0;
      uVar11 = 0xffffffffffffffff;
      psVar8 = psVar7;
      do {
        if (uVar11 == 0) break;
        uVar11 = uVar11 - 1;
        sVar1 = *psVar8;
        psVar8 = psVar8 + 1;
      } while (sVar1 != 0);
      FUN_140001710(&local_4d0,psVar7,~uVar11 - 1);
      if (local_4c0 == 0) {
        if (7 < local_4b8) {
          operator_delete((void *)CONCAT62(uStack_4ce,local_4d0));
        }
      }
      else {
        local_500 = (wchar_t *)0x0;
        local_4f8 = (wchar_t *)0x0;
        local_4f0 = 0;
        puVar15 = &local_4d0;
        if (7 < local_4b8) {
          puVar15 = (undefined2 *)CONCAT62(uStack_4ce,local_4d0);
        }
        FUN_140415930(&local_500,puVar15);
        pwVar17 = local_4f8;
        pwVar9 = local_500;
        if (((longlong)local_4f8 - (longlong)local_500) / 0x28 != 3) {
          if (local_500 != (wchar_t *)0x0) {
            FUN_14008d0a0(local_500,local_4f8);
            operator_delete(pwVar9);
          }
          if (7 < local_4b8) {
            operator_delete((void *)CONCAT62(uStack_4ce,local_4d0));
          }
          goto LAB_14034e3cf;
        }
        if (uVar16 < 3) {
          puVar13 = (undefined8 *)(param_1 + 0x250 + (longlong)(int)uVar16 * 0x28);
        }
        else {
          if (DAT_140609360 == 0) {
            FUN_140176d60(0);
          }
          DAT_140609360 = DAT_140609360 + 1;
          puVar13 = &DAT_1405f0468;
        }
        FUN_1400015e0(puVar13,pwVar9,0,0xffffffffffffffff);
        pwVar14 = pwVar9 + 0x14;
        if (7 < *(ulonglong *)(pwVar9 + 0x20)) {
          pwVar14 = *(wchar_t **)pwVar14;
        }
        if (uVar16 < 3) {
          local_4e0 = (float *)(param_1 + 0x244 + (longlong)(int)uVar16 * 4);
        }
        else {
          if (DAT_140609368 == 0) {
            FUN_140176d60(0);
          }
          DAT_140609368 = DAT_140609368 + 1;
          local_4e0 = (float *)&DAT_140609364;
        }
        iVar19 = _wtoi(pwVar14);
        *local_4e0 = (float)iVar19;
        pwVar14 = pwVar9 + 0x28;
        if (7 < *(ulonglong *)(pwVar9 + 0x34)) {
          pwVar14 = *(wchar_t **)pwVar14;
        }
        if (uVar16 < 3) {
          pfVar6 = (float *)(param_1 + 0x238 + (longlong)(int)uVar16 * 4);
        }
        else {
          if (DAT_140609368 == 0) {
            FUN_140176d60(0);
          }
          DAT_140609368 = DAT_140609368 + 1;
          pfVar6 = (float *)&DAT_140609364;
        }
        iVar19 = _wtoi(pwVar14);
        *pfVar6 = (float)iVar19;
        *(int *)(param_1 + 0x50) = *(int *)(param_1 + 0x50) + 1;
        if (pwVar9 != (wchar_t *)0x0) {
          FUN_14008d0a0(pwVar9,pwVar17);
          operator_delete(pwVar9);
        }
        if (7 < local_4b8) {
          operator_delete((void *)CONCAT62(uStack_4ce,local_4d0));
        }
      }
      uVar16 = local_508;
    } while ((int)local_508 < 3);
    uVar3 = FUN_1402970c0(lVar4,L"szWeakPoint");
    local_518 = 1;
    psVar7 = (short *)FUN_140296990(lVar4,param_2,uVar3,L"szWeakPoint");
    uVar11 = 0xffffffffffffffff;
    psVar8 = psVar7;
    do {
      if (uVar11 == 0) break;
      uVar11 = uVar11 - 1;
      sVar1 = *psVar8;
      psVar8 = psVar8 + 1;
    } while (sVar1 != 0);
    FUN_140001710(param_1 + 0x1e8,psVar7,~uVar11 - 1);
    iVar19 = 0;
    do {
      iVar19 = iVar19 + 1;
      swprintf_s(local_248,0x100,L"szFixPos%02d");
      uVar3 = FUN_1402970c0(lVar4,local_248);
      local_518 = 0;
      lVar12 = FUN_140296990(lVar4,param_2,uVar3,local_248);
      if (lVar12 != 0) {
        local_500 = (wchar_t *)0x0;
        local_4f8 = (wchar_t *)0x0;
        local_4f0 = 0;
        FUN_140415930(&local_500,lVar12,&DAT_14049c7b8);
        pwVar17 = local_4f8;
        pwVar9 = local_500;
        if ((local_500 == local_4f8) ||
           ((ulonglong)(((longlong)local_4f8 - (longlong)local_500) / 0x28) < 3)) {
          pwVar14 = local_500;
          if (local_500 == (wchar_t *)0x0) goto LAB_14034e395;
          for (; pwVar14 != pwVar17; pwVar14 = pwVar14 + 0x14) {
            if (7 < *(ulonglong *)(pwVar14 + 0xc)) {
              operator_delete(*(void **)pwVar14);
            }
            pwVar14[0xc] = L'\a';
            pwVar14[0xd] = L'\0';
            pwVar14[0xe] = L'\0';
            pwVar14[0xf] = L'\0';
            pwVar14[8] = L'\0';
            pwVar14[9] = L'\0';
            pwVar14[10] = L'\0';
            pwVar14[0xb] = L'\0';
            *pwVar14 = L'\0';
          }
        }
        else {
          local_4a8[0] = 0;
          local_488 = 7;
          local_490 = 0;
          local_4a0 = 0;
          local_460 = 7;
          local_468 = 0;
          local_478 = 0;
          pwVar14 = local_500;
          if (7 < *(ulonglong *)(local_500 + 0xc)) {
            pwVar14 = *(wchar_t **)local_500;
          }
          local_4a8[0] = _wtoi(pwVar14);
          pwVar14 = pwVar9 + 0x14;
          if (7 < *(ulonglong *)(pwVar9 + 0x20)) {
            pwVar14 = *(wchar_t **)pwVar14;
          }
          uVar11 = 0xffffffffffffffff;
          pwVar18 = pwVar14;
          do {
            if (uVar11 == 0) break;
            uVar11 = uVar11 - 1;
            wVar2 = *pwVar18;
            pwVar18 = pwVar18 + 1;
          } while (wVar2 != L'\0');
          FUN_140001710(&local_4a0,pwVar14,~uVar11 - 1);
          pwVar14 = pwVar9 + 0x28;
          if (7 < *(ulonglong *)(pwVar9 + 0x34)) {
            pwVar14 = *(wchar_t **)pwVar14;
          }
          uVar11 = 0xffffffffffffffff;
          pwVar18 = pwVar14;
          do {
            if (uVar11 == 0) break;
            uVar11 = uVar11 - 1;
            wVar2 = *pwVar18;
            pwVar18 = pwVar18 + 1;
          } while (wVar2 != L'\0');
          FUN_140001710(&local_478,pwVar14,~uVar11 - 1);
          FUN_14034e400(param_1 + 0x2c8,local_4a8);
          if (7 < local_460) {
            operator_delete((void *)CONCAT62(uStack_476,local_478));
          }
          local_460 = 7;
          local_468 = 0;
          local_478 = 0;
          if (7 < local_488) {
            operator_delete((void *)CONCAT62(uStack_49e,local_4a0));
          }
          local_488 = 7;
          local_490 = 0;
          local_4a0 = 0;
          pwVar14 = pwVar9;
          do {
            if (7 < *(ulonglong *)(pwVar14 + 0xc)) {
              operator_delete(*(void **)pwVar14);
            }
            pwVar14[0xc] = L'\a';
            pwVar14[0xd] = L'\0';
            pwVar14[0xe] = L'\0';
            pwVar14[0xf] = L'\0';
            pwVar14[8] = L'\0';
            pwVar14[9] = L'\0';
            pwVar14[10] = L'\0';
            pwVar14[0xb] = L'\0';
            *pwVar14 = L'\0';
            pwVar14 = pwVar14 + 0x14;
          } while (pwVar14 != pwVar17);
        }
        operator_delete(pwVar9);
      }
LAB_14034e395:
    } while (iVar19 < 6);
    uVar10 = 1;
  }
  return uVar10;
}



void FUN_14034e400(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_14034e4c0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_14034e6d0(param_1[1],((longlong)(param_2 - uVar2) / 0x58) * 0x58 + *param_1,param_3,
                    param_4,uVar3);
    }
  }
  else {
    if (uVar1 == param_1[2]) {
      FUN_14034e4c0(param_1);
    }
    if (param_1[1] != 0) {
      FUN_14034e6d0(param_1[1],param_2,param_3,param_4,uVar3);
    }
  }
  param_1[1] = param_1[1] + 0x58;
  return;
}



void FUN_14034e4c0(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_14034e580(param_1,uVar2);
      return;
    }
    uVar2 = uVar2 + (uVar2 >> 1);
    if (uVar2 < uVar3) {
      uVar2 = uVar3;
    }
    FUN_14034e580(param_1,uVar2);
  }
  return;
}



void FUN_14034e580(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 (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) {
    local_res10 = (char *)0x0;
    if (param_2 != 0) {
      local_res10 = operator_new(param_2 * 0x58);
      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_1405d3608);
      }
    }
    pcVar4 = local_res10;
    FUN_14034e760(*param_1,param_1[1],local_res10);
    lVar1 = param_1[1];
    lVar2 = *param_1;
    if (lVar2 != 0) {
      FUN_1401297b0(lVar2,lVar1,lVar1 - lVar2,lVar1,uVar5);
      operator_delete((void *)*param_1);
    }
    param_1[2] = (longlong)(pcVar4 + param_2 * 0x58);
    param_1[1] = (longlong)(pcVar4 + ((lVar1 - lVar2) / 0x58) * 0x58);
    *param_1 = (longlong)pcVar4;
  }
  return;
}



undefined4 * FUN_14034e6d0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 8) = 7;
  *(undefined8 *)(param_1 + 6) = 0;
  *(undefined2 *)(param_1 + 2) = 0;
  FUN_1400015e0(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_1400015e0(param_1 + 0xc,param_2 + 0xc,0,0xffffffffffffffff);
  return param_1;
}



longlong FUN_14034e760(longlong param_1,longlong param_2,longlong param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 0x58) {
    if (param_3 != 0) {
      FUN_14034e6d0(param_3,param_1);
    }
    param_3 = param_3 + 0x58;
  }
  return param_3;
}



undefined8 FUN_14034e7c0(wchar_t *param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  wchar_t *pwVar3;
  wchar_t *pwVar4;
  undefined1 in_ZF;
  bool bVar5;
  
  lVar2 = 5;
  pwVar3 = param_1;
  pwVar4 = L"NONE";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    in_ZF = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while ((bool)in_ZF);
  if ((bool)in_ZF) {
    return 0;
  }
  lVar2 = 7;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"ATTACK";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 1;
  }
  lVar2 = 7;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"RUNWAY";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 2;
  }
  lVar2 = 0xb;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"HPRECOVERY";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 4;
  }
  lVar2 = 0xe;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"MUSTKILLSKILL";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 3;
  }
  lVar2 = 0xd;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"SELFDESTRUCT";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 5;
  }
  lVar2 = 6;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"HELP,";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 6;
  }
  lVar2 = 7;
  bVar5 = false;
  pwVar3 = param_1;
  pwVar4 = L"MELEE,";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *pwVar3 == *pwVar4;
    pwVar3 = pwVar3 + 1;
    pwVar4 = pwVar4 + 1;
  } while (bVar5);
  if (bVar5) {
    return 8;
  }
  lVar2 = 0xc;
  bVar5 = false;
  pwVar3 = L"MPRECOVERY,";
  do {
    if (lVar2 == 0) break;
    lVar2 = lVar2 + -1;
    bVar5 = *param_1 == *pwVar3;
    param_1 = param_1 + 1;
    pwVar3 = pwVar3 + 1;
  } while (bVar5);
  uVar1 = 0;
  if (bVar5) {
    uVar1 = 7;
  }
  return uVar1;
}



undefined2 * FUN_14034e910(void)

{
  return &DAT_140477960;
}



// WARNING: Removing unreachable block (ram,0x00014034e990)

longlong * FUN_14034e940(longlong *param_1,longlong *param_2)

{
  undefined4 *puVar1;
  longlong lVar2;
  code *pcVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  ulonglong uVar8;
  ulonglong uVar9;
  
  if (param_1 != param_2) {
    puVar7 = (undefined4 *)param_2[1];
    puVar6 = (undefined4 *)*param_2;
    puVar1 = (undefined4 *)*param_1;
    uVar9 = (longlong)puVar7 - (longlong)puVar6 >> 4;
    if (uVar9 == 0) {
      if (puVar1 != (undefined4 *)param_1[1]) {
        param_1[1] = (longlong)puVar1;
        return param_1;
      }
    }
    else {
      uVar8 = param_1[1] - (longlong)puVar1 >> 4;
      if (uVar8 < uVar9) {
        if ((ulonglong)(param_1[2] - (longlong)puVar1 >> 4) < uVar9) {
          if (puVar1 != (undefined4 *)0x0) {
            operator_delete(puVar1);
          }
          lVar4 = param_2[1];
          lVar2 = *param_2;
          *param_1 = 0;
          param_1[1] = 0;
          uVar9 = lVar4 - lVar2 >> 4;
          param_1[2] = 0;
          if (uVar9 == 0) {
            return param_1;
          }
          if (0xfffffffffffffff < uVar9) {
            std::_Xlength_error("vector<T> too long");
            pcVar3 = (code *)swi(3);
            plVar5 = (longlong *)(*pcVar3)();
            return plVar5;
          }
          lVar4 = FUN_1402d9030(uVar9);
          *param_1 = lVar4;
          param_1[1] = lVar4;
          param_1[2] = uVar9 * 0x10 + lVar4;
          puVar7 = (undefined4 *)*param_2;
        }
        else {
          puVar7 = puVar6 + uVar8 * 4;
          FUN_14034ead0(puVar6,puVar7,puVar1);
          lVar4 = param_1[1];
        }
        lVar4 = FUN_1402d2560(puVar7,param_2[1],lVar4);
      }
      else {
        for (; puVar6 != puVar7; puVar6 = puVar6 + 4) {
          *puVar1 = *puVar6;
          puVar1[1] = puVar6[1];
          puVar1[2] = puVar6[2];
          puVar1[3] = puVar6[3];
          puVar1 = puVar1 + 4;
        }
        lVar4 = (param_2[1] - *param_2 & 0xfffffffffffffff0U) + *param_1;
      }
      param_1[1] = lVar4;
    }
  }
  return param_1;
}



void FUN_14034ead0(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)

{
  for (; param_1 != param_2; param_1 = param_1 + 4) {
    *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;
}



undefined4 * FUN_14034eb10(undefined4 *param_1)

{
  *param_1 = 0;
  *(undefined8 *)(param_1 + 7) = 7;
  *(undefined8 *)(param_1 + 5) = 0;
  *(undefined2 *)(param_1 + 1) = 0;
  param_1[0xb] = 0;
  *(undefined8 *)(param_1 + 0x12) = 7;
  *(undefined8 *)(param_1 + 0x10) = 0;
  *(undefined2 *)(param_1 + 0xc) = 0;
  *(undefined8 *)(param_1 + 0x16) = 0;
  param_1[0x18] = 0;
  *(undefined8 *)(param_1 + 0x22) = 0;
  param_1[0x24] = 0;
  *(undefined8 *)(param_1 + 0x25) = 0;
  param_1[0x27] = 0;
  *(undefined8 *)(param_1 + 0x28) = 0;
  param_1[0x2a] = 0;
  *(undefined8 *)(param_1 + 0x2b) = 0;
  *(undefined8 *)(param_1 + 0x2d) = 0;
  *(undefined8 *)(param_1 + 0x19) = 0x3f800000;
  *(undefined8 *)(param_1 + 0x1b) = 0;
  *(undefined8 *)(param_1 + 0x1d) = 0x3f800000;
  *(undefined8 *)(param_1 + 0x1f) = 0;
  param_1[0x21] = 0x3f800000;
  *(undefined8 *)(param_1 + 0x2f) = 0;
  *(undefined8 *)(param_1 + 0x31) = 0;
  memset(param_1 + 0x16,0,100);
  *(undefined8 *)(param_1 + 0x33) = 0;
  return param_1;
}



void FUN_14034ebc0(longlong param_1)

{
  undefined2 *puVar1;
  
  *(undefined8 *)(param_1 + 0x40) = 0;
  if (*(ulonglong *)(param_1 + 0x48) < 8) {
    puVar1 = (undefined2 *)(param_1 + 0x30);
  }
  else {
    puVar1 = *(undefined2 **)(param_1 + 0x30);
  }
  *puVar1 = 0;
  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;
  *(undefined8 *)(param_1 + 0x14) = 0;
  if (*(ulonglong *)(param_1 + 0x1c) < 8) {
    puVar1 = (undefined2 *)(param_1 + 4);
  }
  else {
    puVar1 = *(undefined2 **)(param_1 + 4);
  }
  *puVar1 = 0;
  if (7 < *(ulonglong *)(param_1 + 0x1c)) {
    operator_delete(*(void **)(param_1 + 4));
  }
  *(undefined8 *)(param_1 + 0x14) = 0;
  *(undefined8 *)(param_1 + 0x1c) = 7;
  *(undefined2 *)(param_1 + 4) = 0;
  return;
}



undefined4 * FUN_14034ec60(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_14034f860();
  if (iVar1 == 1) {
    param_2 = 0;
  }
  if ((param_3 != '\0') && (lVar3 = FUN_14034f9d0(), *(longlong *)(lVar3 + 0x50) != 0)) {
    lVar3 = FUN_14034f9d0();
    iVar1 = (**(code **)(lVar3 + 0x50))(param_1 + 2,param_2,0x1000000);
    if (iVar1 != 0) {
      return param_1;
    }
    FUN_14034f420(local_58,L"InitializeCriticalSectionEx Failure!",
                  L"Proud::CriticalSection::CriticalSection");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (param_2 == 0) {
    InitializeCriticalSection((LPCRITICAL_SECTION)(param_1 + 2));
  }
  else {
    BVar2 = InitializeCriticalSectionAndSpinCount((LPCRITICAL_SECTION)(param_1 + 2),param_2);
    if (BVar2 == 0) {
      FUN_14034f420(local_58,L"InitializeCriticalSectionEx Failure!",
                    L"Proud::CriticalSection::CriticalSection");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  return param_1;
}



void FUN_14034ed40(int *param_1)

{
  if (*param_1 != 0x3faf713) {
    FUN_14034fa20(
                 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 0x00014034ed66. Too many branches
                    // WARNING: Treating indirect jump as call
  EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 2));
  return;
}



void FUN_14034ed70(int *param_1)

{
  if (*param_1 == 0x3faf713) {
    EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 2));
  }
  return;
}



bool FUN_14034ed90(int *param_1)

{
  BOOL BVar1;
  
  if (*param_1 != 0x3faf713) {
    FUN_14034fa20(
                 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;
}



void FUN_14034edd0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014034edd4. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection((LPCRITICAL_SECTION)(param_1 + 8));
  return;
}



bool FUN_14034ede0(int *param_1)

{
  return *param_1 == 0x3faf713;
}



void FUN_14034edf0(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_14034f420(local_58,L"Critical section is still in use! Destruction may cause problems!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    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_14034ee70(longlong param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  return *(ulonglong *)(param_1 + 0x18) == (ulonglong)DVar1;
}



void FUN_14034ee90(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_14000d450(0x80070057);
  }
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  if (param_3 == (void *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  pvVar1 = (void *)*param_1;
  if (pvVar1 == param_3) {
    if (param_2 <= param_4) {
      *param_1 = (longlong)param_3;
      goto LAB_14034ef21;
    }
    pvVar1 = calloc((longlong)param_2,1);
  }
  else {
    if (param_2 <= param_4) {
      free(pvVar1);
      *param_1 = (longlong)param_3;
      goto LAB_14034ef21;
    }
    pvVar1 = _recalloc(pvVar1,(longlong)param_2,1);
    if (pvVar1 == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  *param_1 = (longlong)pvVar1;
LAB_14034ef21:
  if (*param_1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
  return;
}



void FUN_14034ef40(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_14034ee90(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_14034ee90(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_14012a1b0();
      pcVar1 = (code *)swi(3);
      (*pcVar1)();
      return;
    }
  }
  return;
}



undefined * FUN_14034f080(longlong param_1)

{
  undefined *puVar1;
  
  puVar1 = *(undefined **)(param_1 + 0x40);
  if (*(undefined **)(param_1 + 0x40) == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8008;
  }
  return puVar1;
}



void FUN_14034f090(exception *param_1)

{
  *(undefined ***)param_1 = Proud::Exception::vftable;
  FUN_14000d2c0(param_1 + 0x40);
                    // WARNING: Could not recover jumptable at 0x00014034f0c2. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(param_1);
  return;
}



exception * FUN_14034f0d0(exception *param_1,undefined8 param_2)

{
  std::exception::exception(param_1);
  *(undefined ***)param_1 = Proud::Exception::vftable;
  FUN_14034fe70();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1405d8008;
  *(undefined8 *)(param_1 + 0x20) = param_2;
  *(undefined4 *)(param_1 + 0x18) = 0;
  *(undefined4 *)(param_1 + 0x38) = 4;
  return param_1;
}



void FUN_14034f130(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_14034f190(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_14035b110(0x8007000e);
  }
  return param_2;
}



longlong * FUN_14034f220(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_14034fe70();
  puVar2 = PTR_DAT_1405d8008;
  local_res8 = PTR_DAT_1405d8008;
  iVar3 = FUN_14034fd90();
  if (puVar2 == (undefined *)0x0) {
    iVar5 = 0;
  }
  else if (puVar2 == PTR_DAT_1405d8008) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar2 + -8);
  }
  iVar4 = iVar3;
  if (iVar3 <= iVar5) {
    if (puVar2 == (undefined *)0x0) {
      iVar4 = 0;
    }
    else if (puVar2 == PTR_DAT_1405d8008) {
      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_1405d8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)(puVar2 + -8);
  }
  if (iVar4 < iVar5) {
    FUN_140057890(&local_res8);
  }
  FUN_140057970(&local_res8);
  puVar2 = local_res8;
  puVar6 = local_res8;
  if (local_res8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar6,param_2,iVar3,param_4,uVar7);
  iVar5 = FUN_14034fd90();
  iVar3 = 0;
  if (0 < iVar5) {
    iVar3 = iVar5;
  }
  if (puVar2 == (undefined *)0x0) {
    iVar5 = 0;
  }
  else if (puVar2 == PTR_DAT_1405d8008) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar2 + -8);
  }
  if (iVar5 <= iVar3) {
    if (puVar2 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar2 == PTR_DAT_1405d8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar2 + -8);
    }
  }
  if (((puVar2 != PTR_DAT_1405d8008) && (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_1405d8008;
  }
  *param_1 = (longlong)puVar6;
  if (puVar2 != puVar6) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    FUN_14000d2c0(param_1);
    *param_1 = (longlong)puVar2;
    if (((puVar2 != PTR_DAT_1405d8008) && (puVar2 != (undefined *)0x0)) &&
       (puVar2 != (undefined *)0x8)) {
      *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
    }
    FUN_14034edd0(uVar7);
  }
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8008)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar7);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

exception * FUN_14034f420(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_1405d84f0 ^ (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_14034fe70();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1405d8008;
  FUN_14034fe70();
  puVar2 = PTR_DAT_1405d8010;
  local_908 = PTR_DAT_1405d8010;
  if (param_2 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  iVar3 = vswprintf_s(local_858,0x400,param_2,(va_list)&local_res18);
  iVar4 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) {
    iVar4 = *(int *)(puVar2 + -8);
  }
  iVar5 = iVar3;
  if (((iVar3 <= iVar4) && (iVar5 = 0, puVar2 != (undefined *)0x0)) && (puVar2 != PTR_DAT_1405d8010)
     ) {
    iVar5 = *(int *)(puVar2 + -8);
  }
  iVar4 = 1;
  if (1 < iVar5) {
    iVar4 = iVar5;
  }
  iVar5 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar5 = 0, puVar2 != PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(puVar2 + -8);
  }
  if (iVar5 < iVar4) {
    FUN_140002d30(&local_908);
  }
  FUN_140002e10(&local_908);
  puVar2 = local_908;
  puVar6 = local_908;
  if (local_908 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,local_858,iVar3);
  puVar6 = puVar2;
  if (puVar2 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(puVar6);
  iVar4 = 0;
  if (0 < iVar3) {
    iVar4 = iVar3;
  }
  iVar3 = 0;
  if ((puVar2 != (undefined *)0x0) && (iVar3 = 0, puVar2 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if ((iVar4 < iVar3) || (iVar4 = 0, puVar2 == (undefined *)0x0)) {
LAB_14034f592:
    if (puVar2 != PTR_DAT_1405d8010) {
      puVar6 = PTR_DAT_1405d8010;
      if (puVar2 == (undefined *)0x0) goto LAB_14034f5c0;
      if ((int *)(puVar2 + -8) != (int *)0x0) {
        *(int *)(puVar2 + -8) = iVar4;
        *(undefined2 *)(puVar2 + (longlong)iVar4 * 2) = 0;
      }
    }
  }
  else if (puVar2 != PTR_DAT_1405d8010) {
    iVar4 = *(int *)(puVar2 + -8);
    goto LAB_14034f592;
  }
  puVar6 = PTR_DAT_1405d8010;
  if (puVar2 != (undefined *)0x0) {
    puVar6 = puVar2;
  }
LAB_14034f5c0:
  local_8e8 = local_8e0;
  FUN_14034ef40(&local_8e8,puVar6,3);
  FUN_14034f220(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_1405d8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    puVar6 = (undefined *)FUN_14034fe70();
    local_908 = puVar6;
    FUN_14034ed40(puVar6);
    local_900 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(puVar6);
  }
  return param_1;
}



exception *
FUN_14034f670(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_14034fe70();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1405d8008;
  uVar1 = (**(code **)(*param_2 + 8))(param_2);
  FUN_14034f220(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_14034f6f0(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_14034fe70();
  *(undefined **)(param_1 + 0x40) = PTR_DAT_1405d8008;
  plVar3 = (longlong *)FUN_14034f190(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_14035b120(*puVar1);
      puVar1[1] = uVar4;
    }
    uVar4 = puVar1[1];
  }
  FUN_14034f220(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_14034f7d0(void)

{
  undefined1 local_58 [88];
  
  FUN_14034f420(local_58,L"An invalid argument is detected!");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14034f800(void)

{
  undefined1 local_58 [88];
  
  FUN_14034f420(local_58,L"Array index out of range!");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14034f830(undefined8 param_1)

{
  undefined1 local_58 [88];
  
  FUN_14034f420(local_58,L"32bit integer out of range! %s",param_1);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



DWORD FUN_14034f860(void)

{
  _SYSTEM_INFO local_38;
  
  GetSystemInfo(&local_38);
  return local_38.dwNumberOfProcessors;
}



undefined8 * FUN_14034f880(undefined8 *param_1)

{
  HMODULE hModule;
  FARPROC pFVar1;
  undefined1 local_58 [80];
  
  hModule = LoadLibraryA("kernel32.dll");
  param_1[0xc] = hModule;
  if (hModule == (HMODULE)0x0) {
    FUN_14034f420(local_58,L"Cannot find kernel32.dll handle!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f9d0(void)

{
  if ((DAT_1405f0568 & 1) == 0) {
    DAT_1405f0568 = DAT_1405f0568 | 1;
    FUN_14034f880(&DAT_1405f0500);
  }
  return &DAT_1405f0500;
}



void FUN_14034fa20(wchar_t *param_1)

{
  if (DAT_1405f0648 == 0) {
    OutputDebugStringW(param_1);
                    // WARNING: Could not recover jumptable at 0x00014034fa50. Too many branches
                    // WARNING: Treating indirect jump as call
    MessageBoxW((HWND)0x0,param_1,L"ProudNet",0x10);
    return;
  }
  if (DAT_1405f0648 == 2) {
                    // WARNING: Could not recover jumptable at 0x00014034fa61. Too many branches
                    // WARNING: Treating indirect jump as call
    OutputDebugStringW(param_1);
    return;
  }
                    // WARNING: Could not recover jumptable at 0x00014034fa77. Too many branches
                    // WARNING: Treating indirect jump as call
  wcscpy_s((wchar_t *)0x0,1000,param_1);
  return;
}



undefined8 FUN_14034fa80(void)

{
  HANDLE pvVar1;
  bool bVar2;
  undefined4 local_res8 [8];
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  LOCK();
  bVar2 = DAT_1405f0580 == 0;
  if (bVar2) {
    DAT_1405f0580 = 1;
  }
  UNLOCK();
  if (bVar2) {
    local_res8[0] = 2;
    if ((DAT_1405f0568 & 1) == 0) {
      DAT_1405f0568 = DAT_1405f0568 | 1;
      FUN_14034f880(&DAT_1405f0500);
    }
    if (DAT_1405f0508 != (code *)0x0) {
      if ((DAT_1405f0568 & 1) == 0) {
        DAT_1405f0568 = DAT_1405f0568 | 1;
        FUN_14034f880(&DAT_1405f0500);
      }
      pvVar1 = GetProcessHeap();
      (*DAT_1405f0508)(pvVar1,0,local_res8,4,uVar3);
    }
  }
  return 1;
}



bool FUN_14034fb20(void)

{
  if ((DAT_1405f0568 & 1) == 0) {
    DAT_1405f0568 = DAT_1405f0568 | 1;
    FUN_14034f880(&DAT_1405f0500);
  }
  return DAT_1405f0520 != 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_14034fb60(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_1405d84f0 ^ (ulonglong)auStack_58;
  local_38 = &DAT_1405f05c8;
  local_30 = '\0';
  cVar1 = FUN_14034ede0(&DAT_1405f05c8);
  cVar3 = '\0';
  if ((cVar1 != '\0') && (cVar3 = local_30, DAT_1405d8000 != '\0')) {
    local_30 = '\x01';
    FUN_14034ed40(&DAT_1405f05c8);
    cVar3 = '\x01';
  }
  if ((DAT_1405f0588 & 1) == 0) {
    DAT_1405f0588 = DAT_1405f0588 | 1;
    _DAT_1405f0584 = 0;
    iVar2 = GetLocaleInfoA(0x800,5,local_20,7);
    if (iVar2 != 0) {
      _DAT_1405f0584 = atoi(local_20);
    }
  }
  DAT_1405d8000 = 0;
  if (cVar3 != '\0') {
    FUN_14034edd0(&DAT_1405f05c8);
  }
  return &DAT_1405f0584;
}



// 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_14034fb60(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_1405d84f0 ^ (ulonglong)auStack_58;
  puStack_38 = &DAT_1405f05c8;
  cStack_30 = '\0';
  cVar1 = FUN_14034ede0(&DAT_1405f05c8);
  cVar3 = '\0';
  if ((cVar1 != '\0') && (cVar3 = cStack_30, DAT_1405d8000 != '\0')) {
    cStack_30 = '\x01';
    FUN_14034ed40(&DAT_1405f05c8);
    cVar3 = '\x01';
  }
  if ((DAT_1405f0588 & 1) == 0) {
    DAT_1405f0588 = DAT_1405f0588 | 1;
    _DAT_1405f0584 = 0;
    iVar2 = GetLocaleInfoA(0x800,5,aCStack_20,7);
    if (iVar2 != 0) {
      _DAT_1405f0584 = atoi(aCStack_20);
    }
  }
  DAT_1405d8000 = 0;
  if (cVar3 != '\0') {
    FUN_14034edd0(&DAT_1405f05c8);
  }
  return &DAT_1405f0584;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_14034fc50(undefined8 *param_1)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined1 auStack_258 [32];
  undefined4 local_238;
  WCHAR local_228 [264];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  local_238 = 0;
  GetModuleFileNameW((HMODULE)0x0,local_228,0x104);
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8010;
  uVar1 = FUN_14034fcf0(local_228);
  uVar2 = FUN_140002f00(param_1,uVar1);
  FUN_14034fd20(uVar2,local_228,uVar1);
  FUN_140002fe0(param_1);
  return param_1;
}



int FUN_14034fcf0(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_14034fd20(void *param_1,void *param_2,int param_3)

{
  memcpy(param_1,param_2,(longlong)(param_3 + 1) * 2);
  return;
}



int FUN_14034fd30(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 0x00014034fd50. 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 0x00014034fd60. Too many branches
                    // WARNING: Treating indirect jump as call
  pwVar1 = wcsstr(_Str,_SubStr);
  return pwVar1;
}



longlong FUN_14034fd70(longlong param_1)

{
  return param_1 + 2;
}



int __cdecl iswspace(wint_t _C)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x00014034fd80. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = iswspace(_C);
  return iVar1;
}



int FUN_14034fd90(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_14034fdc0(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_14034fdf0(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 0x00014034fe10. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = vsprintf_s(_DstBuf,_SizeInBytes,_Format,_ArgList);
  return iVar1;
}



char * FUN_14034fe20(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 0x00014034fe40. 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 0x00014034fe50. Too many branches
                    // WARNING: Treating indirect jump as call
  puVar1 = _mbsinc(_Ptr);
  return puVar1;
}



void FUN_14034fe60(char param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014034fe63. Too many branches
                    // WARNING: Treating indirect jump as call
  _ismbcspace((int)param_1);
  return;
}



undefined * FUN_14034fe70(void)

{
  undefined4 uVar1;
  undefined8 in_R9;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  if ((DAT_1405f0638 & 1) == 0) {
    DAT_1405f0638 = DAT_1405f0638 | 1;
    uVar1 = FUN_1403c0cc0();
    FUN_14034ec60(&DAT_1405f0600,uVar1,1,in_R9,uVar2);
    atexit((_func_5014 *)&LAB_140449270);
  }
  DAT_1405f0630 = 1;
  return &DAT_1405f0600;
}



undefined8 * FUN_14034fed0(undefined8 *param_1)

{
  *param_1 = Proud::CFastHeap::vftable;
  return param_1;
}



void FUN_14034fee0(undefined8 *param_1)

{
  *param_1 = Proud::CFastHeap::vftable;
  return;
}



void FUN_14034fef0(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 0x00014034ff15. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapAlloc(hHeap,0,dwBytes);
  return;
}



void FUN_14034ff20(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 0x00014034ff54. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapReAlloc(pvVar1,0,param_1,lVar2);
  return;
}



void FUN_14034ff60(LPVOID param_1)

{
  HANDLE hHeap;
  
  hHeap = GetProcessHeap();
                    // WARNING: Could not recover jumptable at 0x00014034ff7c. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapFree(hHeap,0,param_1);
  return;
}



undefined8 * FUN_14034ff90(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_14034ffc0(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_140350870(pvVar1,param_1,param_2,param_4,uVar2);
  }
  return uVar2;
}



double FUN_140350020(void)

{
  return (double)DAT_1405d8098 * DAT_1405d8090;
}



undefined * FUN_140350040(void)

{
  return &DAT_1405f0650;
}



undefined8 * FUN_140350050(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_140350080(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_14034fee0(param_1);
  return;
}



void FUN_140350100(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_140350140(longlong param_1)

{
  undefined1 local_58 [88];
  
  if (*(short *)(param_1 + -0x10) != 0x71a) {
    FUN_14034f420(local_58,L"Not a fastheap allocated block!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  return;
}



void FUN_140350180(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 0x000140350193. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapAlloc(*(HANDLE *)(param_1 + 8),0,dwBytes);
  return;
}



void FUN_1403501a0(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 0x0001403501b6. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapReAlloc(*(undefined8 *)(param_1 + 8),0,param_2,lVar1);
  return;
}



void FUN_1403501c0(longlong param_1,LPVOID param_2)

{
  if (*(HANDLE *)(param_1 + 8) == (HANDLE)0x0) {
    FUN_14034fa20(
                 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 0x0001403501da. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapFree(*(HANDLE *)(param_1 + 8),0,param_2);
  return;
}



undefined8 FUN_1403501f0(longlong param_1)

{
  HeapValidate(*(HANDLE *)(param_1 + 8),0,(LPCVOID)0x0);
  return 0xfffffffe;
}



undefined8 * FUN_140350210(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_140350270(undefined8 param_1,uint param_2)

{
  FUN_140350080();
  if ((param_2 & 1) != 0) {
    FUN_14034ff60(param_1);
  }
  return param_1;
}



undefined8 FUN_1403502a0(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_14034f830(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_140350300(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_14034f7d0();
  }
  if (*(int *)(param_1 + 0x40) != 2) {
    FUN_14034fa20(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_14034f830(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_140350392;
    }
  }
  puVar5 = (undefined2 *)
           (**(code **)**(undefined8 **)(param_1 + 0x48))
                     (*(undefined8 **)(param_1 + 0x48),lVar7 + 0x10);
  if (puVar5 == (undefined2 *)0x0) {
    FUN_14034f420(local_58,L"CRT malloc returned NULL at %s!",L"Proud::CFastHeapImpl::Alloc");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
LAB_140350392:
  *(longlong *)(puVar5 + 4) = lVar7;
  *puVar5 = 0x71a;
  return puVar5 + 8;
}



short * FUN_1403503f0(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_14034fa20(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_14034f7d0();
  }
  uVar9 = (ulonglong)param_1[0xc] >> 7;
  uVar11 = ((param_3 - 1) / uVar9 + 1) * uVar9;
  if (*(longlong *)(param_2 + -8) == 0) {
LAB_1403504b8:
    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_14034f830(L"Proud::CFastHeapImpl::GetAllocByGroundSize",uVar3 % uVar9);
    }
    if (0x7f < uVar4) goto LAB_1403504b8;
    plVar10 = *(longlong **)(param_1[0xd] + (longlong)SUB164(auVar2 / auVar1,0) * 8);
  }
  plVar5 = (longlong *)FUN_1403502a0(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_1403505cd;
    }
    psVar7 = (short *)(**(code **)(*plVar5 + 8))(plVar5,uVar11 + 0x10);
    uVar9 = uVar11;
    if (*(ulonglong *)(param_2 + -8) < uVar11) {
      uVar9 = *(ulonglong *)(param_2 + -8);
    }
    FUN_14000d3f0(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_14034f420(local_68,L"CRT malloc returned NULL at %s!",L"Proud::CFastHeapImpl::Realloc");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (*(ulonglong *)(param_2 + -8) < param_3) {
        param_3 = *(ulonglong *)(param_2 + -8);
      }
    }
    else {
      if (plVar10 == plVar5) goto LAB_1403505cd;
      psVar7 = (short *)(**(code **)(*plVar5 + 8))(plVar5,uVar11 + 0x10);
      param_3 = uVar11;
      if (*(ulonglong *)(param_2 + -8) < uVar11) {
        param_3 = *(ulonglong *)(param_2 + -8);
      }
    }
    FUN_14000d3f0(psVar7,psVar6,param_3 + 0x10);
    *(ulonglong *)(psVar7 + 4) = uVar11;
    lVar8 = *plVar10;
  }
  (**(code **)(lVar8 + 0x10))(plVar10,psVar6);
  psVar6 = psVar7;
LAB_1403505cd:
  return psVar6 + 8;
}



void FUN_140350600(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_14034fa20(
                 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_14034f420(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_1405d36c0);
  }
  *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_14034f830(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_140350688;
  }
  plVar7 = *(longlong **)(param_1 + 0x48);
LAB_140350688:
                    // WARNING: Could not recover jumptable at 0x000140350692. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*plVar7 + 0x10))(plVar7,psVar1);
  return;
}



undefined8 * FUN_1403506c0(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_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    uVar1 = FUN_14034fcf0(L"FATAL: HeapCreate failed!");
    uVar4 = FUN_140002f00(&local_res10,uVar1);
    FUN_14034fd20(uVar4,L"FATAL: HeapCreate failed!",uVar1);
    FUN_140002fe0(&local_res10);
    FUN_140352d80(&local_res10);
  }
  local_res8[0] = 2;
  lVar5 = FUN_14034f9d0();
  if (*(longlong *)(lVar5 + 8) != 0) {
    lVar5 = FUN_14034f9d0();
    (**(code **)(lVar5 + 8))(puVar2[1],0,local_res8,4);
  }
  *(undefined1 *)(puVar2 + 2) = param_1;
  return puVar2;
}



undefined8 * FUN_1403507a0(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_14034ede0(&DAT_1405f06b0);
  if (cVar2 != '\0') {
    if (DAT_1405d8280 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_14034ed40(&DAT_1405f06b0);
    }
  }
  if ((DAT_1405f06a8 & 1) == 0) {
    DAT_1405f06a8 = DAT_1405f06a8 | 1;
    DAT_1405f06a0 = FUN_1403506c0(1);
    atexit(FUN_140449290);
  }
  DAT_1405d8280 = 0;
  if (bVar1) {
    FUN_14034edd0(&DAT_1405f06b0);
  }
  return &DAT_1405f06a0;
}



undefined8 FUN_140350850(void)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_1403507a0();
  return *puVar1;
}



undefined8 * FUN_140350870(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_14034fed0();
  *param_1 = Proud::CFastHeapImpl::vftable;
  FUN_140352e50(param_1 + 9);
  FUN_1403507a0();
  if (param_2 < 0x80) {
    FUN_14034f420(local_a0,L"bad AccelBlockSizeLimit value");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (param_1[9] == 0) {
    puVar1 = (undefined8 *)FUN_1403507a0();
    param_1[9] = *puVar1;
  }
  param_1[0xc] = param_2;
  pvVar2 = malloc(0x400);
  param_1[0xd] = pvVar2;
  if (pvVar2 == (void *)0x0) {
    FUN_14034f420(local_58,L"Cannot allocate FastHeap buckets! FATAL!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  lVar4 = 0;
  do {
    uVar3 = FUN_140352dc0(param_3);
    *(undefined8 *)(lVar4 + param_1[0xd]) = uVar3;
    lVar4 = lVar4 + 8;
  } while (lVar4 < 0x400);
  *(undefined4 *)(param_1 + 8) = 2;
  return param_1;
}



void FUN_140350980(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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  return;
}



void FUN_1403509d0(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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  return;
}



undefined8 * FUN_140350a20(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_140350a50(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_140350a90(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_140350b40(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_14000d450(0x80004005);
  }
  if (param_2 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (param_4 == (undefined8 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (param_5 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  lVar9 = *param_1;
  pcVar8 = (char *)*param_4;
  uVar10 = 0;
  if ((*param_2 != '/') && (*param_2 != '\\')) goto LAB_140350c49;
  cVar1 = *pcVar8;
  if ((cVar1 == '/') || (cVar1 == '\\')) {
    pcVar4 = pcVar8 + 1;
  }
  else {
    if ((cVar1 != '.') ||
       (((cVar1 = pcVar8[1], cVar1 != '/' && (cVar1 != '\\')) && (cVar1 != '\0'))))
    goto LAB_140350c49;
    lVar9 = lVar9 + -1;
    uVar7 = 0;
    lVar5 = lVar9;
    uVar6 = param_3 - 1;
    do {
      uVar3 = uVar6;
      lVar2 = lVar5;
      if (uVar3 == 0) goto LAB_140350c30;
      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_140350c30:
    pcVar4 = pcVar8 + 2;
    if (param_3 != uVar7 + 1) {
      lVar9 = lVar9 + 1;
      goto LAB_140350c49;
    }
  }
  pcVar8 = pcVar4;
  uVar10 = 1;
LAB_140350c49:
  *param_1 = lVar9;
  *param_4 = pcVar8;
  *param_5 = param_3;
  return uVar10;
}



int FUN_140350c70(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_14000d450(0x80004005);
  }
  if (param_2 == (byte *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (param_1 == param_2) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_14000d450(0x80004005);
              }
              FUN_140350980(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_140350e89;
              }
            }
            sVar11 = (size_t)(uVar6 + 1);
          }
          goto LAB_140350e89;
        }
LAB_140350f15:
        iVar2 = FUN_140350a90(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_1403509d0(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_140351025;
            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_140350fe4;
              sVar5 = bVar4 - 0x57;
            }
            if (sVar5 < 0) goto LAB_140350fe4;
            bVar4 = param_1[2];
            if (bVar4 == 0) goto LAB_140351025;
            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_140350fe4;
              sVar1 = bVar4 - 0x57;
            }
            if (sVar1 < 0) goto LAB_140350fe4;
            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_140350e89:
        if ((-1 < (char)param_5) || ((param_5 & 2) != 0)) goto LAB_140350f15;
        if (bVar4 == 0x5c) {
          if ((((int)sVar11 != 0) || ((param_5 >> 8 & 1) != 0)) &&
             ((iVar10 != 0 && ((uVar7 == 0 || (uVar6 < 7)))))) {
            bVar4 = 0x2f;
          }
          goto LAB_140350f15;
        }
        if ((((bVar4 != 0x2e) || (uVar6 == 0)) || ((param_5 & 8) != 0)) ||
           (iVar2 = FUN_140350b40(&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_140350f15;
      }
      _MaxCount = (size_t)local_58;
      bVar4 = *local_res8;
      uVar6 = local_58;
      if (bVar4 == 0) goto LAB_140351025;
      sVar8 = (size_t)local_54;
      param_1 = local_res8;
    } while( true );
  }
LAB_140351032:
  if (uVar6 < param_4) {
    *param_2 = 0;
  }
LAB_140350fe4:
  if (param_3 != (int *)0x0) {
    *param_3 = uVar6 + 1;
  }
  if (param_4 < uVar6 + 1) {
    iVar2 = 0;
  }
  return iVar2;
LAB_140351025:
  iVar2 = iVar10;
  param_3 = local_res18;
  if (iVar2 == 0) goto LAB_140350fe4;
  goto LAB_140351032;
}



undefined8 FUN_140351040(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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x2464) = (uint)sVar2;
  return 1;
}



void FUN_1403510f0(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;
}



void FUN_140351150(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_14034ed40(lVar3);
  uVar5 = 1;
  *(undefined1 *)(param_1 + 0x80) = 1;
  FUN_140357460(param_1 + 0x88);
  if ((*(longlong **)(param_1 + 0x10) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x10) != 0))
  {
    FUN_1403552c0();
    lVar3 = lVar2;
    while( true ) {
      local_28 = Proud::AddrPort::vftable;
      local_18 = 0;
      local_30 = 0;
      local_20 = DAT_1405d83d0;
      local_1c = DAT_1405d83d4;
      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_1403551f0(lVar2,0,&local_30,param_4,uVar4,lVar3,uVar5);
      if ((cVar1 != '\0') || (DAT_1405f0950 != '\0')) break;
      Sleep(10);
    }
  }
  FUN_14034edd0(lVar3);
  return;
}



void FUN_140351260(undefined8 *param_1)

{
  free((void *)*param_1);
  *param_1 = 0;
  return;
}



wchar_t * FUN_140351280(wchar_t *param_1)

{
  errno_t eVar1;
  
  FUN_1403510f0();
  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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  return param_1;
}



void FUN_140351310(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_1405d8008)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if (puVar2 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1405d8008;
  }
  if (*(undefined8 **)(param_1 + 0x10) != (undefined8 *)0x0) {
    uVar1 = **(undefined8 **)(param_1 + 0x10);
  }
  FUN_140356460(uVar1,puVar2 + *(int *)(param_1 + 0x28),(iVar3 - *(int *)(param_1 + 0x28)) + 1);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_140351360(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 = 0x140351376;
  local_11c8 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_1218;
  iVar3 = 0;
  local_11e8 = param_4;
  local_11d0 = param_3;
  if (param_1 == (short *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (param_2 == (undefined2 *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_140350a50(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_140350a50(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_140350c70(puVar4,puVar5,&local_11e4,local_11e8);
          if (iVar3 != 0) {
            local_11b8 = local_11b0;
            FUN_14012a1d0(&local_11b8,puVar5,3);
            FUN_140306c30(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_1403515b0(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 = 0x1403515c0;
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_1098;
  eVar1 = _wcslwr_s(param_1,0x21);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  eVar1 = wcscpy_s(&local_1068,0x824,param_1 + 0x122);
  if (eVar1 != 0) {
    if (eVar1 == 0xc) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  local_1078 = param_2;
  iVar2 = FUN_140351360(&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_14000d450(0x8007000e);
      }
      if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80070057);
      }
      if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
    }
    local_1078 = param_2;
    iVar2 = FUN_140351360(&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_14000d450(0x8007000e);
        }
        if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80070057);
        }
        if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
      }
      local_1078 = param_2;
      iVar2 = FUN_140351360(&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_14000d450(0x8007000e);
          }
          if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80070057);
          }
          if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(0x80004005);
          }
        }
        local_1078 = param_2;
        iVar2 = FUN_140351360(&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_14000d450(0x8007000e);
            }
            if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80070057);
            }
            if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
              FUN_14000d450(0x80004005);
            }
          }
          local_1078 = param_2;
          FUN_140351360(local_1066,param_1 + 0xa26,param_1 + 0x1234,0x7ff);
        }
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403518e0(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_1405d84f0 ^ (ulonglong)auStack_448;
  if (param_2 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  iVar1 = vsprintf_s(local_428,0x400,param_2,param_3);
  uVar2 = FUN_140057a60(param_1,iVar1);
  FUN_14034fdc0(uVar2,local_428,iVar1);
  FUN_140057b50(param_1);
  return;
}



void FUN_140351970(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_1405d8008)) && (0 < *(int *)(puVar4 + -8))
     ) {
    puVar7 = (undefined *)*param_1;
    if (puVar7 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (puVar7 == PTR_DAT_1405d8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar7 + -8);
    }
    iVar3 = *(int *)(puVar4 + -8) + iVar5;
    if (puVar7 == (undefined *)0x0) {
      iVar2 = 0;
    }
    else if (puVar7 == PTR_DAT_1405d8008) {
      iVar2 = 0;
    }
    else {
      iVar2 = *(int *)(puVar7 + -8);
    }
    if (iVar3 <= iVar2) {
      if (puVar7 == (undefined *)0x0) {
        iVar3 = 0;
      }
      else if (puVar7 == PTR_DAT_1405d8008) {
        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_1405d8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar7 + -8);
    }
    if (iVar3 < iVar2) {
      FUN_140057890(param_1,iVar2);
    }
    FUN_140057970(param_1);
    puVar4 = (undefined *)*param_2;
    puVar7 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1405d8008;
    }
    if (puVar4 == (undefined *)0x0) {
      uVar6 = 0;
    }
    else if (puVar4 == PTR_DAT_1405d8008) {
      uVar6 = 0;
    }
    else {
      uVar6 = *(undefined4 *)(puVar4 + -8);
    }
    if (puVar4 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1405d8008;
    }
    FUN_14034fdc0(puVar7 + iVar5,puVar4,uVar6);
    puVar4 = (undefined *)*param_2;
    if (puVar4 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar4 == PTR_DAT_1405d8008) {
      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_1405d8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar4 + -8);
    }
    if (iVar5 <= iVar2) {
      if (puVar4 == (undefined *)0x0) {
        iVar2 = 0;
      }
      else if (puVar4 == PTR_DAT_1405d8008) {
        iVar2 = 0;
      }
      else {
        iVar2 = *(int *)(puVar4 + -8);
      }
    }
    if (((puVar4 != PTR_DAT_1405d8008) && (puVar4 != (undefined *)0x0)) &&
       (piVar1 = (int *)(puVar4 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar2;
      *(undefined1 *)((longlong)iVar2 + 8 + (longlong)piVar1) = 0;
    }
  }
  return;
}



void FUN_140351b00(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_1403518e0(param_1,param_2,&local_res18);
  return;
}



void FUN_140351b30(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_1403556b0(lVar1);
        FUN_14034ff60(lVar1);
      }
      FUN_14034ff60(param_1);
    }
  }
  return;
}



void FUN_140351ba0(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_1403556b0(lVar1);
        FUN_14034ff60(lVar1);
      }
      FUN_14034ff60(plVar2);
    }
  }
  return;
}



undefined4 FUN_140351c30(longlong param_1)

{
  undefined *puVar1;
  undefined4 uVar2;
  int iVar3;
  undefined8 uVar4;
  undefined *local_res8;
  
  puVar1 = PTR_u_www_nettention_co_kr_1405d8288;
  FUN_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  uVar2 = FUN_14034fcf0(puVar1);
  uVar4 = FUN_140002f00(&local_res8,uVar2);
  FUN_14034fd20(uVar4,puVar1,uVar2);
  FUN_140002fe0(&local_res8);
  uVar4 = 0;
  if (*(undefined8 **)(param_1 + 0x10) != (undefined8 *)0x0) {
    uVar4 = **(undefined8 **)(param_1 + 0x10);
  }
  iVar3 = FUN_140355d00(uVar4,&local_res8,DAT_1405d8290);
  if ((iVar3 != 0) && (iVar3 != 0x2733)) {
    return 0;
  }
  return 1;
}



void FUN_140351ce0(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_14034ede0(piVar1);
  if (cVar3 == '\0') {
    return;
  }
  FUN_14034ed40(piVar1);
  puVar2 = *(undefined **)(param_1 + 2);
  if ((((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) &&
      (*(int *)(puVar2 + -8) != 0)) ||
     ((*param_1 != 3 || (DVar4 = GetTickCount(), DVar4 - param_1[1] < 0x7531)))) goto LAB_140351fa1;
  FUN_140003100(param_1 + 2,param_2);
  *param_1 = 0;
  DVar4 = GetTickCount();
  param_1[1] = DVar4;
  FUN_14034fe70();
  pWVar10 = (LPCWSTR)PTR_DAT_1405d8010;
  local_res8 = (LPCWSTR)PTR_DAT_1405d8010;
  iVar5 = FUN_14034fcf0(L"**ErrorReport** ");
  iVar11 = 0;
  if ((pWVar10 != (LPCWSTR)0x0) && (pWVar10 != (LPCWSTR)PTR_DAT_1405d8010)) {
    iVar11 = *(int *)((longlong)pWVar10 + -8);
  }
  iVar6 = iVar5;
  if (iVar5 <= iVar11) {
    iVar6 = 0;
    if ((pWVar10 != (LPCWSTR)0x0) && (iVar6 = 0, pWVar10 != (LPCWSTR)PTR_DAT_1405d8010)) {
      iVar6 = *(int *)((longlong)pWVar10 + -8);
    }
  }
  iVar11 = 1;
  if (1 < iVar6) {
    iVar11 = iVar6;
  }
  iVar6 = 0;
  if ((pWVar10 != (LPCWSTR)0x0) && (pWVar10 != (LPCWSTR)PTR_DAT_1405d8010)) {
    iVar6 = *(int *)((longlong)pWVar10 + -8);
  }
  if (iVar6 < iVar11) {
    if (pWVar10 == (LPCWSTR)0x0) {
      pWVar10 = (LPCWSTR)PTR_DAT_1405d8010;
    }
    local_res8 = pWVar10;
    if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (iVar11 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      iVar6 = 0;
      if ((pWVar10 != (LPCWSTR)0x0) && (iVar6 = 0, pWVar10 != (LPCWSTR)PTR_DAT_1405d8010)) {
        iVar6 = *(int *)(pWVar10 + -4);
      }
      if (iVar11 != iVar6) {
        piVar7 = (int *)FUN_14034fef0((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_1405d8010)) {
          iVar6 = *(int *)(pWVar10 + -4);
        }
        pWVar9 = (LPCWSTR)PTR_DAT_1405d8010;
        if (iVar11 < iVar6) {
LAB_140351e71:
          if (pWVar10 != (LPCWSTR)0x0) {
            pWVar9 = pWVar10;
          }
        }
        else {
          iVar11 = 0;
          if (pWVar10 != (LPCWSTR)0x0) {
            if (pWVar10 != (LPCWSTR)PTR_DAT_1405d8010) {
              iVar11 = *(int *)(pWVar10 + -4);
            }
            goto LAB_140351e71;
          }
        }
        FUN_14034fd20(piVar7 + 2,pWVar9,iVar11);
        FUN_1400031d0(&local_res8);
        local_res8 = (LPCWSTR)(piVar7 + 2);
      }
    }
  }
  FUN_140002e10(&local_res8);
  pWVar10 = local_res8;
  pWVar9 = local_res8;
  if (local_res8 == (LPCWSTR)0x0) {
    pWVar9 = (LPCWSTR)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(pWVar9,L"**ErrorReport** ",iVar5);
  pWVar9 = pWVar10;
  if (pWVar10 == (LPCWSTR)0x0) {
    pWVar9 = (LPCWSTR)PTR_DAT_1405d8010;
  }
  iVar5 = FUN_14034fcf0(pWVar9);
  iVar11 = 0;
  if (0 < iVar5) {
    iVar11 = iVar5;
  }
  iVar5 = 0;
  if ((pWVar10 != (LPCWSTR)0x0) && (pWVar10 != (LPCWSTR)PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(pWVar10 + -4);
  }
  if ((iVar11 < iVar5) || (iVar11 = 0, pWVar10 == (LPCWSTR)0x0)) {
LAB_140351f09:
    if (((pWVar10 != (LPCWSTR)PTR_DAT_1405d8010) && (pWVar10 != (LPCWSTR)0x0)) &&
       (pWVar10 + -4 != (LPCWSTR)0x0)) {
      *(int *)(pWVar10 + -4) = iVar11;
      pWVar10[iVar11] = L'\0';
    }
  }
  else if (pWVar10 != (LPCWSTR)PTR_DAT_1405d8010) {
    iVar11 = *(int *)(pWVar10 + -4);
    goto LAB_140351f09;
  }
  FUN_140017520(&local_res8,param_2);
  FUN_140017790(&local_res8,&DAT_1404765b0);
  pWVar10 = local_res8;
  pWVar9 = local_res8;
  if (local_res8 == (LPCWSTR)0x0) {
    pWVar9 = (LPCWSTR)PTR_DAT_1405d8010;
  }
  OutputDebugStringW(pWVar9);
  if (((pWVar10 != (LPCWSTR)0x0) && (pWVar10 != (LPCWSTR)PTR_DAT_1405d8010)) &&
     (pWVar10 + -4 != (LPCWSTR)0x0)) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    pWVar9 = pWVar10 + -2;
    *(int *)pWVar9 = *(int *)pWVar9 + -1;
    if (*(int *)pWVar9 == 0) {
      FUN_14034ff60(pWVar10 + -4);
    }
    FUN_14034edd0(uVar8);
  }
LAB_140351fa1:
  FUN_14034edd0(piVar1);
  return;
}



void FUN_140351fd0(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  FUN_140351150();
  FUN_1403574e0(param_1 + 0x88);
  FUN_14034edf0(param_1 + 0x30);
  FUN_14000d2c0(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_1403556b0(lVar2);
      FUN_14034ff60(lVar2);
    }
    FUN_14034ff60(plVar1);
  }
  FUN_1400031d0(param_1 + 8);
  return;
}



undefined8 * FUN_140352090(undefined8 *param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8008;
  FUN_14000d220(param_1,param_2);
  FUN_140351970(param_1,param_3);
  return param_1;
}



void FUN_140352100(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_1405d8010)) &&
     (*(int *)(puVar2 + -8) != 0)) {
    local_res8 = (longlong *)FUN_14034fef0(0x400);
    if (local_res8 == (longlong *)0x0) {
      lVar5 = 0;
    }
    else {
      lVar5 = FUN_140355800(local_res8,0,param_1 + 6,param_4,uVar6);
    }
    if (lVar5 == 0) {
      local_res8 = (longlong *)0x0;
    }
    else {
      local_res8 = (longlong *)FUN_14034fef0(0x10);
      local_res8[1] = 1;
      *local_res8 = lVar5;
    }
    plVar1 = local_res8;
    FUN_140351ba0(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_1403556b0(lVar5);
          FUN_14034ff60(lVar5);
        }
        FUN_14034ff60(plVar3);
      }
    }
    if (*(undefined8 **)(param_1 + 4) == (undefined8 *)0x0) {
      uVar6 = 0;
    }
    else {
      uVar6 = **(undefined8 **)(param_1 + 4);
    }
    cVar4 = FUN_140357380(uVar6);
    if (cVar4 == '\0') {
      local_res10 = 0;
      FUN_140351ba0(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_140354aa0(uVar6,0);
      cVar4 = FUN_140351c30(param_1);
      if (cVar4 == '\0') {
        local_res18 = 0;
        FUN_140351ba0(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_140352270(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 = 0x14035228c;
  local_2bf0 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_2c58;
  local_2bf8 = param_1;
  FUN_140354b20(local_2ac8);
  plVar1 = (longlong *)(param_1 + 4);
  uVar20 = 0;
  uVar22 = 0;
  uVar15 = uVar20;
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar15 = *(ulonglong *)*plVar1;
  }
  FUN_140354b40(local_2ac8,uVar15);
  uVar15 = uVar20;
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar15 = *(ulonglong *)*plVar1;
  }
  FUN_140354ba0(local_2ac8,uVar15);
  FUN_140354c00(local_2ac8,0);
  uVar15 = uVar20;
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar15 = *(ulonglong *)*plVar1;
  }
  cVar7 = FUN_140354c60(local_2ac8,uVar15,local_2c08);
  if (cVar7 == '\0') {
    return;
  }
  uVar19 = 0;
  if (local_2c08[0] != 0) {
    cVar7 = FUN_140351c30(param_1);
    if (cVar7 != '\0') {
      return;
    }
    local_2c18 = (undefined *)0x0;
    FUN_140351ba0(plVar1,&local_2c18);
    *param_1 = 3;
    return;
  }
  uVar15 = uVar20;
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar15 = *(ulonglong *)*plVar1;
  }
  FUN_140354aa0(uVar15,1);
  param_1[10] = 0;
  FUN_1403510f0(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_14000d450(0x8007000e);
    }
    if ((eVar8 == 0x16) || (eVar8 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar8 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  puVar16 = *(undefined **)(param_1 + 2);
  if (*(undefined **)(param_1 + 2) == (undefined *)0x0) {
    puVar16 = PTR_DAT_1405d8010;
  }
  FUN_140351040(local_24a8,puVar16);
  FUN_1403515b0(local_24a8,0);
  FUN_14000d470(param_1 + 2,&DAT_140477960);
  puVar16 = PTR_s_GET__PNReport_ReportError_php_Te_1405d8298;
  FUN_14034fe70();
  puVar18 = (uint *)PTR_DAT_1405d8008;
  local_2c30 = (uint *)PTR_DAT_1405d8008;
  uVar9 = FUN_14034fd90(puVar16);
  uVar15 = uVar20;
  if ((puVar18 != (uint *)0x0) && (uVar15 = 0, puVar18 != (uint *)PTR_DAT_1405d8008)) {
    uVar15 = (ulonglong)*(uint *)((longlong)puVar18 + -8);
  }
  uVar10 = uVar9;
  if ((((int)uVar9 <= (int)uVar15) && (uVar10 = uVar19, puVar18 != (uint *)0x0)) &&
     (puVar18 != (uint *)PTR_DAT_1405d8008)) {
    uVar10 = *(uint *)((longlong)puVar18 + -8);
  }
  uVar21 = 1;
  if (1 < (int)uVar10) {
    uVar21 = uVar10;
  }
  uVar10 = uVar19;
  if ((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1405d8008)) {
    uVar10 = *(uint *)((longlong)puVar18 + -8);
  }
  uVar14 = 0;
  if ((int)uVar10 < (int)uVar21) {
    if (puVar18 == (uint *)0x0) {
      puVar18 = (uint *)PTR_DAT_1405d8008;
    }
    local_2c30 = puVar18;
    if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar21 == 0) {
      FUN_14000d2c0(&local_2c30);
    }
    else {
      uVar10 = uVar19;
      if ((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1405d8008)) {
        uVar10 = puVar18[-2];
      }
      if (uVar21 != uVar10) {
        puVar11 = (uint *)FUN_14034fef0((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_1405d8008)) {
          uVar10 = puVar18[-2];
        }
        puVar12 = (uint *)PTR_DAT_1405d8008;
        if ((int)uVar21 < (int)uVar10) {
LAB_140352510:
          if (puVar18 != (uint *)0x0) {
            puVar12 = puVar18;
          }
        }
        else {
          uVar21 = uVar19;
          if (puVar18 != (uint *)0x0) {
            if (puVar18 != (uint *)PTR_DAT_1405d8008) {
              uVar21 = puVar18[-2];
            }
            goto LAB_140352510;
          }
        }
        FUN_14034fdc0(puVar11 + 2,puVar12,uVar21);
        FUN_14000d2c0(&local_2c30);
        local_2c30 = puVar11 + 2;
      }
    }
  }
  FUN_140057970(&local_2c30);
  puVar18 = local_2c30;
  puVar11 = local_2c30;
  if (local_2c30 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar11,puVar16,uVar9);
  puVar11 = puVar18;
  if (puVar18 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1405d8008;
  }
  uVar10 = FUN_14034fd90(puVar11);
  uVar9 = uVar22;
  if (0 < (int)uVar10) {
    uVar9 = uVar10;
  }
  uVar10 = uVar14;
  if ((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1405d8008)) {
    uVar10 = puVar18[-2];
  }
  if (((int)uVar9 < (int)uVar10) || (uVar9 = uVar14, puVar18 == (uint *)0x0)) {
LAB_1403525a1:
    if (((puVar18 != (uint *)PTR_DAT_1405d8008) && (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_1405d8008) {
    uVar9 = puVar18[-2];
    goto LAB_1403525a1;
  }
  local_2be8 = local_2be0;
  FUN_14034ef40(&local_2be8,local_2060,3);
  puVar6 = local_2be8;
  FUN_14034fe70();
  puVar11 = (uint *)PTR_DAT_1405d8008;
  local_2c38 = (uint *)PTR_DAT_1405d8008;
  uVar9 = FUN_14034fd90(puVar6);
  uVar15 = uVar20;
  if ((puVar11 != (uint *)0x0) && (uVar15 = 0, puVar11 != (uint *)PTR_DAT_1405d8008)) {
    uVar15 = (ulonglong)*(uint *)((longlong)puVar11 + -8);
  }
  uVar10 = uVar9;
  if ((((int)uVar9 <= (int)uVar15) && (uVar10 = uVar14, puVar11 != (uint *)0x0)) &&
     (uVar10 = uVar22, puVar11 != (uint *)PTR_DAT_1405d8008)) {
    uVar10 = *(uint *)((longlong)puVar11 + -8);
  }
  uVar21 = 1;
  if (1 < (int)uVar10) {
    uVar21 = uVar10;
  }
  uVar10 = uVar22;
  if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) {
    uVar10 = *(uint *)((longlong)puVar11 + -8);
  }
  if ((int)uVar10 < (int)uVar21) {
    if (puVar11 == (uint *)0x0) {
      puVar11 = (uint *)PTR_DAT_1405d8008;
    }
    local_2c38 = puVar11;
    if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar21 == 0) {
      FUN_14000d2c0(&local_2c38);
    }
    else {
      uVar10 = uVar14;
      if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) {
        uVar10 = puVar11[-2];
      }
      if (uVar21 != uVar10) {
        puVar12 = (uint *)FUN_14034fef0((longlong)(int)uVar21 + 9);
        if (puVar12 != (uint *)0x0) {
          *puVar12 = 0;
          puVar12[1] = 1;
        }
        *puVar12 = uVar21;
        if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) {
          uVar14 = puVar11[-2];
        }
        puVar17 = (uint *)PTR_DAT_1405d8008;
        if ((int)uVar21 < (int)uVar14) {
LAB_1403526d4:
          if (puVar11 != (uint *)0x0) {
            puVar17 = puVar11;
          }
        }
        else {
          uVar21 = uVar19;
          if (puVar11 != (uint *)0x0) {
            if (puVar11 != (uint *)PTR_DAT_1405d8008) {
              uVar21 = puVar11[-2];
            }
            goto LAB_1403526d4;
          }
        }
        FUN_14034fdc0(puVar12 + 2,puVar17,uVar21);
        FUN_14000d2c0(&local_2c38);
        local_2c38 = puVar12 + 2;
      }
    }
  }
  FUN_140057970(&local_2c38);
  puVar11 = local_2c38;
  puVar12 = local_2c38;
  if (local_2c38 == (uint *)0x0) {
    puVar12 = (uint *)PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar12,puVar6,uVar9);
  puVar12 = puVar11;
  if (puVar11 == (uint *)0x0) {
    puVar12 = (uint *)PTR_DAT_1405d8008;
  }
  uVar9 = FUN_14034fd90(puVar12);
  uVar19 = uVar22;
  if (0 < (int)uVar9) {
    uVar19 = uVar9;
  }
  uVar9 = uVar22;
  if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) {
    uVar9 = puVar11[-2];
  }
  if (((int)uVar9 <= (int)uVar19) && (uVar19 = uVar22, puVar11 != (uint *)0x0)) {
    if (puVar11 == (uint *)PTR_DAT_1405d8008) goto LAB_140352782;
    uVar19 = puVar11[-2];
  }
  if (((puVar11 != (uint *)PTR_DAT_1405d8008) && (puVar11 != (uint *)0x0)) &&
     (puVar12 = puVar11 + -2, puVar12 != (uint *)0x0)) {
    *puVar12 = uVar19;
    *(undefined1 *)((longlong)(int)uVar19 + 8 + (longlong)puVar12) = 0;
  }
LAB_140352782:
  if (local_2be8 != local_2be0) {
    free(local_2be8);
  }
  FUN_14034fe70();
  local_2c10 = PTR_DAT_1405d8008;
  local_2b58 = local_2b50;
  FUN_14034ef40(&local_2b58,PTR_u_www_nettention_co_kr_1405d8288,3);
  FUN_140351b00(&local_2c10,PTR_s_HTTP_1_1_User_Agent__Mozilla_5_0_1405d82a0,local_2b58);
  if (local_2b58 != local_2b50) {
    free(local_2b58);
  }
  uVar13 = FUN_140352090(&local_2c18,&local_2c30,&local_2c38);
  uVar13 = FUN_140352090(&local_2c00,uVar13,&local_2c10);
  puVar4 = local_2bf8;
  FUN_14000d220(local_2bf8 + 8,uVar13);
  if (((local_2c00 != (undefined *)0x0) && (local_2c00 != PTR_DAT_1405d8008)) &&
     (local_2c00 + -8 != (undefined *)0x0)) {
    uVar13 = FUN_14034fe70();
    local_2c28 = uVar13;
    FUN_14034ed40(uVar13);
    local_2c20 = 1;
    piVar3 = (int *)(local_2c00 + -4);
    *piVar3 = *piVar3 + -1;
    if (*piVar3 == 0) {
      FUN_14034ff60(local_2c00 + -8);
    }
    FUN_14034edd0(uVar13);
  }
  local_2c00 = PTR_DAT_1405d8008;
  if (((local_2c18 != (undefined *)0x0) && (local_2c18 != PTR_DAT_1405d8008)) &&
     (local_2c18 + -8 != (undefined *)0x0)) {
    uVar13 = FUN_14034fe70();
    local_2c28 = uVar13;
    FUN_14034ed40(uVar13);
    local_2c20 = 1;
    piVar3 = (int *)(local_2c18 + -4);
    *piVar3 = *piVar3 + -1;
    if (*piVar3 == 0) {
      FUN_14034ff60(local_2c18 + -8);
    }
    FUN_14034edd0(uVar13);
  }
  puVar5 = local_2bf8;
  puVar16 = *(undefined **)(puVar4 + 8);
  if ((puVar16 != (undefined *)0x0) && (puVar16 != PTR_DAT_1405d8008)) {
    uVar22 = *(uint *)(puVar16 + -8);
  }
  if (puVar16 == (undefined *)0x0) {
    puVar16 = PTR_DAT_1405d8008;
  }
  if ((ulonglong *)*plVar1 != (ulonglong *)0x0) {
    uVar20 = *(ulonglong *)*plVar1;
  }
  FUN_140356460(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_1405d8008)) &&
     (puVar2 = local_2c10 + -8, puVar2 != (undefined *)0x0)) {
    uVar13 = FUN_14034fe70();
    local_2c28 = uVar13;
    FUN_14034ed40(uVar13);
    local_2c20 = 1;
    piVar3 = (int *)(puVar16 + -4);
    *piVar3 = *piVar3 + -1;
    if (*piVar3 == 0) {
      FUN_14034ff60(puVar2);
    }
    FUN_14034edd0(uVar13);
  }
  if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar11 + -2 != (uint *)0x0)) {
    uVar13 = FUN_14034fe70();
    local_2c28 = uVar13;
    FUN_14034ed40(uVar13);
    local_2c20 = 1;
    puVar12 = puVar11 + -1;
    *puVar12 = *puVar12 - 1;
    if (*puVar12 == 0) {
      FUN_14034ff60(puVar11 + -2);
    }
    FUN_14034edd0(uVar13);
  }
  if (((puVar18 != (uint *)0x0) && (puVar18 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar18 + -2 != (uint *)0x0)) {
    uVar13 = FUN_14034fe70();
    local_2c28 = uVar13;
    FUN_14034ed40(uVar13);
    local_2c20 = 1;
    puVar11 = puVar18 + -1;
    *puVar11 = *puVar11 - 1;
    if (*puVar11 == 0) {
      FUN_14034ff60(puVar18 + -2);
    }
    FUN_14034edd0(uVar13);
  }
  return;
}



void FUN_140352a50(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_1405d83d0;
  local_1c = DAT_1405d83d4;
  if (*(undefined8 **)(param_1 + 4) != (undefined8 *)0x0) {
    uVar3 = **(undefined8 **)(param_1 + 4);
  }
  cVar2 = FUN_1403551f0(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_1405d8008) {
          iVar4 = 0;
        }
        else {
          iVar4 = *(int *)(puVar1 + -8);
        }
      }
      if ((int)param_1[10] < iVar4 + 1) {
        FUN_140351310(param_1);
      }
      else {
        *param_1 = 3;
        local_res8 = 0;
        FUN_140351ba0(param_1 + 4,&local_res8);
      }
    }
    else {
      *param_1 = 3;
      local_res8 = 0;
      FUN_140351ba0(param_1 + 4,&local_res8);
    }
  }
  return;
}



void FUN_140352b40(int *param_1)

{
  int iVar1;
  
  FUN_14034ed40(param_1 + 0xc);
  iVar1 = *param_1;
  if (iVar1 == 0) {
    FUN_140352100(param_1);
  }
  else if (iVar1 == 1) {
    FUN_140352270(param_1);
  }
  else if (iVar1 == 2) {
    FUN_140352a50(param_1);
  }
  FUN_14034edd0(param_1 + 0xc);
  return;
}



void FUN_140352bc0(longlong param_1)

{
  char cVar1;
  DWORD DVar2;
  
  DVar2 = GetCurrentThreadId();
  FUN_140357920(DVar2,"ErrReporter");
  cVar1 = *(char *)(param_1 + 0x80);
  while (cVar1 == '\0') {
    FUN_140352b40(param_1);
    Sleep(5);
    cVar1 = *(char *)(param_1 + 0x80);
  }
  return;
}



undefined8 *
FUN_140352c10(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_14034fe70();
  param_1[1] = PTR_DAT_1405d8010;
  param_1[2] = 0;
  param_1[3] = Proud::CReportSocketDg::vftable;
  FUN_14034fe70();
  param_1[4] = PTR_DAT_1405d8008;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 6,uVar1,1,param_4,uVar2);
  FUN_1403573d0(param_1 + 0x11,FUN_140352bc0,param_1);
  *param_1 = 3;
  *(undefined1 *)(param_1 + 0x10) = 0;
  FUN_1403575d0(param_1 + 0x11);
  return param_1;
}



undefined * FUN_140352cc0(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_14034ede0(&DAT_1405f07c8);
  if (cVar2 != '\0') {
    if (DAT_1405d8340 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_14034ed40(&DAT_1405f07c8);
    }
  }
  if ((DAT_1405f07c0 & 1) == 0) {
    DAT_1405f07c0 = DAT_1405f07c0 | 1;
    FUN_140352c10(&DAT_1405f0700);
    atexit((_func_5014 *)&LAB_1404492e0);
  }
  DAT_1405d8340 = 0;
  if (bVar1) {
    FUN_14034edd0(&DAT_1405f07c8);
  }
  return &DAT_1405f0700;
}



void FUN_140352d80(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = FUN_140352cc0();
  FUN_140351ce0(uVar1,param_1,param_3,param_4,uVar2);
  FUN_1400031d0(param_1);
  return;
}



undefined8
FUN_140352dc0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  lVar1 = FUN_14034fef0(0x80);
  if (lVar1 == 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = FUN_140357ed0(lVar1,param_1,param_3,param_4,uVar2);
  }
  return uVar2;
}



void FUN_140352e00(undefined8 *param_1)

{
  *param_1 = Proud::CLookasideAllocator::vftable;
  return;
}



undefined8 * FUN_140352e10(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_140352e40(undefined8 *param_1)

{
  *param_1 = Proud::CLookasideAllocator::vftable;
  return param_1;
}



undefined8 * FUN_140352e50(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_140352e70(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_140352eb0(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_140352ee0(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_140352f10(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_1405d84f0 ^ (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_1403530f0(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_14034ede0(&DAT_1405f0898);
  if (cVar2 != '\0') {
    if (DAT_1405d8380 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_14034ed40(&DAT_1405f0898);
    }
  }
  if ((DAT_1405f0804 & 1) == 0) {
    DAT_1405f0804 = DAT_1405f0804 | 1;
    FUN_140354d30(&DAT_1405f0800);
    atexit((_func_5014 *)&LAB_1404492f0);
  }
  DAT_1405d8380 = 0;
  if (bVar1) {
    FUN_14034edd0(&DAT_1405f0898);
  }
  return &DAT_1405f0800;
}



void FUN_1403531b0(undefined8 *param_1,longlong param_2)

{
  int iVar1;
  
  if (0 < param_2) {
    iVar1 = 0;
    do {
      if (param_1 != (undefined8 *)0x0) {
        FUN_14034fe70();
        *param_1 = PTR_DAT_1405d8008;
      }
      iVar1 = iVar1 + 1;
      param_1 = param_1 + 1;
    } while (iVar1 < param_2);
  }
  return;
}



undefined8 * FUN_140353210(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_1405d8008;
  }
  uVar1 = Ordinal_11(puVar2);
  *(undefined2 *)((longlong)param_1 + 0xc) = param_3;
  *(undefined4 *)(param_1 + 1) = uVar1;
  FUN_14000d2c0(param_2);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140353280(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_1405d84f0 ^ (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_1405d8010;
  }
  local_a8 = local_a0;
  local_b8 = param_2;
  FUN_14034ef40(&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_14000d2c0(longlong *param_1)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  puVar2 = (undefined *)*param_1;
  if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1405d8008)) ||
     (puVar2 + -8 == (undefined *)0x0)) {
    *param_1 = (longlong)PTR_DAT_1405d8008;
  }
  else {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar3);
    *param_1 = (longlong)PTR_DAT_1405d8008;
  }
  return;
}



void FUN_140353360(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_14034fd90(param_2);
    puVar8 = (undefined *)*param_1;
    iVar7 = 0;
    iVar6 = 0;
    iVar3 = 0;
    iVar4 = iVar6;
    if ((puVar8 != (undefined *)0x0) && (iVar4 = iVar3, puVar8 != PTR_DAT_1405d8008)) {
      iVar4 = *(int *)(puVar8 + -8);
    }
    iVar5 = iVar4 + iVar1;
    if ((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1405d8008)) {
      iVar3 = *(int *)(puVar8 + -8);
    }
    iVar2 = iVar5;
    if (((iVar5 <= iVar3) && (iVar2 = iVar6, puVar8 != (undefined *)0x0)) &&
       (puVar8 != PTR_DAT_1405d8008)) {
      iVar2 = *(int *)(puVar8 + -8);
    }
    iVar3 = 1;
    if (1 < iVar2) {
      iVar3 = iVar2;
    }
    if ((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1405d8008)) {
      iVar7 = *(int *)(puVar8 + -8);
    }
    if (iVar7 < iVar3) {
      FUN_140057890(param_1);
    }
    FUN_140057970(param_1);
    puVar8 = (undefined *)*param_1;
    if ((undefined *)*param_1 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1405d8008;
    }
    FUN_14034fdc0(puVar8 + iVar4,param_2,iVar1);
    FUN_140057ae0(param_1,iVar5);
  }
  return;
}



longlong * FUN_140353450(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_1405d8008;
  }
  iVar4 = FUN_14034fe60(*_Ptr);
  while (iVar4 != 0) {
    _Ptr = _mbsinc(_Ptr);
    iVar4 = FUN_14034fe60(*_Ptr);
  }
  puVar2 = (uchar *)*param_1;
  puVar6 = puVar2;
  if (puVar2 == (uchar *)0x0) {
    puVar6 = PTR_DAT_1405d8008;
  }
  if (_Ptr != puVar6) {
    iVar4 = (int)puVar2;
    if (puVar2 == (uchar *)0x0) {
      iVar4 = (int)PTR_DAT_1405d8008;
    }
    iVar4 = (int)_Ptr - iVar4;
    if (puVar2 == (uchar *)0x0) {
      iVar5 = 0;
    }
    else if (puVar2 == PTR_DAT_1405d8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar2 + -8);
    }
    if (puVar2 == (uchar *)0x0) {
      iVar7 = 0;
    }
    else if (puVar2 == PTR_DAT_1405d8008) {
      iVar7 = 0;
    }
    else {
      iVar7 = *(int *)(puVar2 + -8);
    }
    if (iVar5 <= iVar7) {
      if (puVar2 == (uchar *)0x0) {
        iVar5 = 0;
      }
      else if (puVar2 == PTR_DAT_1405d8008) {
        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_1405d8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar2 + -8);
    }
    if (iVar5 < iVar7) {
      FUN_140057890(param_1,iVar7);
    }
    FUN_140057970(param_1);
    puVar3 = (undefined *)*param_1;
    _Dst = puVar3;
    if (puVar3 == (undefined *)0x0) {
      _Dst = PTR_DAT_1405d8008;
    }
    if (puVar3 == (undefined *)0x0) {
      iVar5 = 0;
    }
    else if (puVar3 == PTR_DAT_1405d8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar3 + -8);
    }
    iVar5 = iVar5 - iVar4;
    if (puVar3 == (undefined *)0x0) {
      iVar7 = 0;
    }
    else if (puVar3 == PTR_DAT_1405d8008) {
      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_1405d8008) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar3 + -8);
    }
    if (iVar5 <= iVar4) {
      if (puVar3 == (undefined *)0x0) {
        iVar4 = 0;
      }
      else if (puVar3 == PTR_DAT_1405d8008) {
        iVar4 = 0;
      }
      else {
        iVar4 = *(int *)(puVar3 + -8);
      }
    }
    if (((puVar3 != PTR_DAT_1405d8008) && (puVar3 != (undefined *)0x0)) &&
       (piVar1 = (int *)(puVar3 + -8), piVar1 != (int *)0x0)) {
      *piVar1 = iVar4;
      *(undefined1 *)((longlong)iVar4 + 8 + (longlong)piVar1) = 0;
    }
  }
  return param_1;
}



void FUN_140353610(longlong *param_1,int param_2)

{
  int *piVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  
  FUN_140057a60();
  puVar2 = (undefined *)*param_1;
  iVar3 = 0;
  if (0 < param_2) {
    iVar3 = param_2;
  }
  if (puVar2 == (undefined *)0x0) {
    iVar4 = 0;
  }
  else if (puVar2 == PTR_DAT_1405d8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)(puVar2 + -8);
  }
  if (iVar4 <= iVar3) {
    if (puVar2 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar2 == PTR_DAT_1405d8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar2 + -8);
    }
  }
  if (((puVar2 != PTR_DAT_1405d8008) && (puVar2 != (undefined *)0x0)) &&
     (piVar1 = (int *)(puVar2 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar3;
    *(undefined1 *)((longlong)iVar3 + 8 + (longlong)piVar1) = 0;
  }
  return;
}



void FUN_140353690(longlong param_1,longlong param_2)

{
  ulonglong uVar1;
  uint uVar2;
  ulonglong uVar3;
  
  if (0 < param_2) {
    uVar1 = 0;
    uVar3 = uVar1;
    do {
      FUN_14000d2c0(param_1 + uVar1 * 8);
      uVar2 = (int)uVar3 + 1;
      uVar3 = (ulonglong)uVar2;
      uVar1 = (ulonglong)(int)uVar2;
    } while ((longlong)uVar1 < param_2);
  }
  return;
}



longlong * FUN_1403536e0(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_1405d8008;
  }
  puVar4 = (uchar *)0x0;
  uVar1 = *_Ptr;
  if (uVar1 != '\0') {
    do {
      iVar2 = FUN_14034fe60(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_1405d8008;
      }
      FUN_140353610(param_1,(int)puVar4 - (int)puVar3);
    }
  }
  return param_1;
}



void FUN_140353770(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_14034f7d0();
  }
  iVar4 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar4) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_140385ff0(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_14034fef0(lVar8 << 3);
        }
        else {
          uVar5 = (**(code **)(*plVar2 + 8))(plVar2,lVar8 << 3);
        }
        *(undefined8 *)(param_1 + 0x10) = uVar5;
        FUN_1403531b0(uVar5,(longlong)param_2);
      }
      else {
        lVar3 = *(longlong *)(param_1 + 0x10);
        if (plVar2 == (longlong *)0x0) {
          puVar6 = (undefined8 *)FUN_14034fef0(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_14034fe70();
              *puVar9 = PTR_DAT_1405d8008;
              FUN_14000d220(puVar9,lVar3 + lVar8 * 8);
            }
            iVar7 = iVar7 + 1;
            puVar9 = puVar9 + 1;
            lVar8 = (longlong)iVar7;
          } while (lVar8 < iVar1);
        }
        FUN_1403531b0(puVar6 + *(int *)(param_1 + 0x18),
                      (longlong)(param_2 - *(int *)(param_1 + 0x18)));
        if (puVar6 == (undefined8 *)0x0) {
          FUN_14034f420(local_88,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_88,(ThrowInfo *)&DAT_1405d36c0);
        }
        FUN_140353690(lVar3,(longlong)*(int *)(param_1 + 0x18));
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_14034ff60(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_1403531b0(*(longlong *)(param_1 + 0x10) + (longlong)iVar4 * 8,
                      (longlong)(param_2 - iVar4));
      }
    }
    else {
      FUN_140353690(*(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_140353960(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_1405d84f0 ^ (ulonglong)auStack_188;
  local_168 = 0;
  uVar5 = *(undefined4 *)(param_1 + 8);
  local_148 = param_2;
  FUN_14034fe70();
  local_160 = PTR_DAT_1405d8008;
  uVar2 = *(undefined2 *)(param_1 + 0xc);
  uVar6 = Ordinal_12(uVar5);
  FUN_140351b00(&local_160,"%s:%d",uVar6,uVar2);
  puVar3 = local_160;
  puVar7 = local_160;
  if (local_160 == (undefined *)0x0) {
    puVar7 = PTR_DAT_1405d8008;
  }
  local_138 = local_130;
  FUN_14012a1d0(&local_138,puVar7,3);
  puVar4 = local_138;
  FUN_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  uVar5 = FUN_14034fcf0(puVar4);
  uVar6 = FUN_140002f00(param_2,uVar5);
  FUN_14034fd20(uVar6,puVar4,uVar5);
  FUN_140002fe0(param_2);
  local_168 = 1;
  if (local_138 != local_130) {
    free(local_138);
  }
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8008)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    puVar7 = (undefined *)FUN_14034fe70();
    local_160 = puVar7;
    FUN_14034ed40(puVar7);
    local_158 = 1;
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar3 + -8);
    }
    FUN_14034edd0(puVar7);
  }
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140353ad0(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_1405d84f0 ^ (ulonglong)auStack_188;
  local_168 = 0;
  uVar4 = *(undefined4 *)(param_1 + 8);
  local_148 = param_2;
  FUN_14034fe70();
  local_160 = PTR_DAT_1405d8008;
  uVar5 = Ordinal_12(uVar4);
  FUN_14034f220(&local_160,uVar5);
  puVar2 = local_160;
  puVar6 = local_160;
  if (local_160 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8008;
  }
  local_138 = local_130;
  FUN_14012a1d0(&local_138,puVar6,3);
  puVar3 = local_138;
  FUN_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  uVar4 = FUN_14034fcf0(puVar3);
  uVar5 = FUN_140002f00(param_2,uVar4);
  FUN_14034fd20(uVar5,puVar3,uVar4);
  FUN_140002fe0(param_2);
  local_168 = 1;
  if (local_138 != local_130) {
    free(local_138);
  }
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8008)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    puVar6 = (undefined *)FUN_14034fe70();
    local_160 = puVar6;
    FUN_14034ed40(puVar6);
    local_158 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(puVar6);
  }
  return param_2;
}



undefined8 * FUN_140353c30(longlong param_1,undefined8 *param_2)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  uVar2 = Ordinal_12(*(undefined4 *)(param_1 + 8));
  FUN_14034fe70();
  *param_2 = PTR_DAT_1405d8008;
  uVar1 = FUN_14034fd90(uVar2);
  uVar3 = FUN_140057a60(param_2,uVar1);
  FUN_14034fdc0(uVar3,uVar2,uVar1);
  FUN_140057b50(param_2);
  return param_2;
}



undefined8 * FUN_140353cb0(undefined8 *param_1,undefined8 param_2,undefined2 param_3)

{
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8008;
  FUN_14034f220(param_1,param_2);
  *(undefined2 *)(param_1 + 1) = param_3;
  return param_1;
}



undefined8 *
FUN_140353d20(undefined8 *param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined *local_res18;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8008;
  uVar2 = FUN_140353c30(param_2,&local_res18,param_3,param_4,uVar2);
  FUN_14000d220(param_1,uVar2);
  if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1405d8008)) &&
     (local_res18 + -8 != (undefined *)0x0)) {
    uVar2 = FUN_14034fe70();
    FUN_14034ed40(uVar2);
    piVar1 = (int *)(local_res18 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18 + -8);
    }
    FUN_14034edd0(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_140353de0(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_1405d84f0 ^ (ulonglong)auStack_188;
  local_168 = 0;
  local_148 = param_2;
  FUN_14034fe70();
  local_160 = PTR_DAT_1405d8008;
  puVar6 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8008;
  }
  FUN_140351b00(&local_160,"%s:%d",puVar6,(short)param_1[1]);
  puVar6 = local_160;
  puVar5 = local_160;
  if (local_160 == (undefined *)0x0) {
    puVar5 = PTR_DAT_1405d8008;
  }
  local_138 = local_130;
  FUN_14012a1d0(&local_138,puVar5,3);
  puVar2 = local_138;
  FUN_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  uVar3 = FUN_14034fcf0(puVar2);
  uVar4 = FUN_140002f00(param_2,uVar3);
  FUN_14034fd20(uVar4,puVar2,uVar3);
  FUN_140002fe0(param_2);
  local_168 = 1;
  if (local_138 != local_130) {
    free(local_138);
  }
  if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1405d8008)) &&
     (puVar6 + -8 != (undefined *)0x0)) {
    puVar5 = (undefined *)FUN_14034fe70();
    local_160 = puVar5;
    FUN_14034ed40(puVar5);
    local_158 = 1;
    piVar1 = (int *)(puVar6 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar6 + -8);
    }
    FUN_14034edd0(puVar5);
  }
  return param_2;
}



void FUN_140353f50(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_14034f220(param_1);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140353f90(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_1405d84f0 ^ (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_14034fe70();
    local_1e0 = PTR_DAT_1405d8008;
    uVar11 = uVar10;
    if (0 < *(short *)(lVar6 + 0x12)) {
      do {
        FUN_14034fe70();
        local_1e8 = PTR_DAT_1405d8008;
        if (0 < (longlong)uVar11) {
          FUN_140353360(&local_1e0,&DAT_14049aa7c);
        }
        FUN_140351b00(&local_1e8,&DAT_14044d0b0,
                      *(undefined1 *)(**(longlong **)(lVar6 + 0x18) + uVar11));
        FUN_140351970(&local_1e0,&local_1e8);
        puVar2 = local_1e8;
        if (((local_1e8 != (undefined *)0x0) && (local_1e8 != PTR_DAT_1405d8008)) &&
           (puVar8 = local_1e8 + -8, puVar8 != (undefined *)0x0)) {
          uVar7 = FUN_14034fe70();
          local_1d8 = uVar7;
          FUN_14034ed40(uVar7);
          local_1d0 = 1;
          piVar1 = (int *)(puVar2 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar8);
          }
          FUN_14034edd0(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_1405d8008;
    }
    local_1b8 = local_1b0;
    FUN_14012a1d0(&local_1b8,puVar8,3);
    puVar3 = local_1b8;
    FUN_14034fe70();
    *param_1 = PTR_DAT_1405d8010;
    uVar5 = FUN_14034fcf0(puVar3);
    uVar7 = FUN_140002f00(param_1,uVar5);
    FUN_14034fd20(uVar7,puVar3,uVar5);
    FUN_140002fe0(param_1);
    if (local_1b8 != local_1b0) {
      free(local_1b8);
    }
    if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8008)) &&
       (puVar2 + -8 != (undefined *)0x0)) {
      uVar7 = FUN_14034fe70();
      local_1d8 = uVar7;
      FUN_14034ed40(uVar7);
      local_1d0 = 1;
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar2 + -8);
      }
      FUN_14034edd0(uVar7);
    }
  }
  else {
    FUN_14034fe70();
    *param_1 = PTR_DAT_1405d8010;
    uVar5 = FUN_14034fcf0(&DAT_140477960);
    uVar7 = FUN_140002f00(param_1,uVar5);
    FUN_14034fd20(uVar7,&DAT_140477960,uVar5);
    FUN_140002fe0(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_140354230(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_1405d84f0 ^ (ulonglong)auStack_e8;
  local_b0 = param_1;
  uVar4 = FUN_1403c0cc0();
  FUN_14034ec60(param_1,uVar4,1);
  *(undefined ***)(param_1 + 0x38) = Proud::AddrPort::vftable;
  *(undefined4 *)(param_1 + 0x40) = 0;
  *(undefined2 *)(param_1 + 0x44) = 0;
  FUN_1403530f0();
  FUN_140353f90(&local_c8);
  puVar2 = local_c8;
  puVar6 = local_c8;
  if (local_c8 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  local_a8 = local_a0;
  FUN_14034ef40(&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_1405d8010)) &&
     (puVar6 = local_c8 + -8, puVar6 != (undefined *)0x0)) {
    puVar5 = (undefined *)FUN_14034fe70();
    local_c8 = puVar5;
    FUN_14034ed40(puVar5);
    local_c0 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar6);
    }
    FUN_14034edd0(puVar5);
  }
  return param_1;
}



undefined8 FUN_140354370(longlong *param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined *puVar3;
  
  uVar2 = FUN_1403536e0();
  uVar2 = FUN_140353450(uVar2);
  FUN_14000d220(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_1405d8008;
    }
    iVar1 = FUN_14034fdf0(puVar3,&DAT_14047e238);
    if (iVar1 != 0) {
      puVar3 = (undefined *)*param_1;
      if ((undefined *)*param_1 == (undefined *)0x0) {
        puVar3 = PTR_DAT_1405d8008;
      }
      iVar1 = FUN_14034fdf0(puVar3,"0.0.0.0");
      if (iVar1 != 0) {
        puVar3 = (undefined *)*param_1;
        if ((undefined *)*param_1 == (undefined *)0x0) {
          puVar3 = PTR_DAT_1405d8008;
        }
        iVar1 = FUN_14034fdf0(puVar3,"255.255.255.255");
        if (iVar1 != 0) {
          return 1;
        }
      }
    }
  }
  return 0;
}



undefined * FUN_140354420(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_14034ede0(&DAT_1405f0860);
  if (cVar2 != '\0') {
    if (DAT_1405d83c0 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_14034ed40(&DAT_1405f0860);
    }
  }
  if ((DAT_1405f0858 & 1) == 0) {
    DAT_1405f0858 = DAT_1405f0858 | 1;
    FUN_140354230(&DAT_1405f0810);
    atexit((_func_5014 *)&LAB_140449320);
  }
  DAT_1405d83c0 = 0;
  if (bVar1) {
    FUN_14034edd0(&DAT_1405f0860);
  }
  return &DAT_1405f0810;
}



undefined8 * FUN_1403544e0(undefined8 *param_1)

{
  undefined2 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  
  lVar3 = FUN_140354420();
  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_140354510(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_1405d84f0 ^ (ulonglong)auStack_128;
  local_f8 = param_1;
  FUN_1403530f0();
  FUN_140353770(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_14034fe70();
      local_108 = PTR_DAT_1405d8008;
      uVar12 = uVar10;
      if (0 < *(short *)(lVar5 + 0x12)) {
        do {
          FUN_14034fe70();
          local_100 = PTR_DAT_1405d8008;
          if (0 < (longlong)uVar12) {
            FUN_140353360(&local_108,&DAT_14049aa7c);
          }
          FUN_140351b00(&local_100,&DAT_14044d0b0,
                        *(undefined1 *)
                         (*(longlong *)(lVar15 + *(longlong *)(lVar5 + 0x18)) + uVar12));
          FUN_140351970(&local_108,&local_100);
          puVar3 = local_100;
          if (((local_100 != (undefined *)0x0) && (local_100 != PTR_DAT_1405d8008)) &&
             (puVar1 = local_100 + -8, puVar1 != (undefined *)0x0)) {
            uVar6 = FUN_14034fe70();
            local_e8 = uVar6;
            FUN_14034ed40(uVar6);
            local_e0 = 1;
            piVar2 = (int *)(puVar3 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(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_14034f7d0();
      }
      iVar11 = *(int *)(param_1 + 0x18);
      FUN_140353770(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_1403a2c90(lVar8);
          lVar7 = FUN_1403a2c90(lVar8);
          FUN_14000d220(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_1403a2c90(param_1);
      FUN_14000d220(lVar8 + (longlong)iVar4 * 8,&local_108);
      if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8008)) &&
         (puVar3 + -8 != (undefined *)0x0)) {
        uVar6 = FUN_14034fe70();
        local_d8 = uVar6;
        FUN_14034ed40(uVar6);
        local_d0 = 1;
        piVar2 = (int *)(puVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar3 + -8);
        }
        FUN_14034edd0(uVar6);
        local_d0 = 0;
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1403547c0(void)

{
  ulonglong uVar1;
  undefined1 auStack_1d8 [32];
  undefined1 local_1b8 [416];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (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_140354840(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_140354860(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_1405d84f0 ^ (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_1405d83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  }
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_140354900(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_1405d84f0 ^ (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_1405d83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  }
  return param_2;
}



undefined1 FUN_1403549a0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x21);
}



void FUN_1403549b0(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x21) = param_2;
  return;
}



void FUN_1403549c0(longlong param_1,undefined8 param_2)

{
  undefined1 local_58 [88];
  
  if (*(longlong *)(param_1 + 0x2e8) != 0) {
    FUN_14034f420(local_58,&DAT_14044d150);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  *(undefined8 *)(param_1 + 0x2e8) = param_2;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140354a00(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_1405d84f0 ^ (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_1405f0900;
  local_16 = 0x485f8000;
  local_12 = 0x92a1;
  WSAIoctl(*(undefined8 *)(param_1 + 0x3d0),0xc8000006,&local_20,0x10);
  return;
}



void FUN_140354aa0(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_140354ad0(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_140354b20(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[0x82] = 0;
  param_1[0x104] = 0;
  return param_1;
}



void FUN_140354b40(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_140354ba0(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_140354c00(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_140354c60(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_140354d30(undefined8 param_1)

{
  FUN_1403547c0();
  return param_1;
}



undefined8 * FUN_140354d60(undefined8 *param_1)

{
  *param_1 = Proud::IHasOverlappedIo::vftable;
  *(undefined1 *)(param_1 + 8) = 0;
  *(undefined1 *)(param_1 + 0x10) = 0;
  return param_1;
}



void FUN_140354d80(undefined8 *param_1)

{
  *param_1 = Proud::IHasOverlappedIo::vftable;
  return;
}



undefined8 * FUN_140354d90(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_140354dc0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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_140354ea0(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_14034ed40();
  if (*(char *)(param_1 + 0x80) == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  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_14034f420(local_50,&DAT_14044d258,uVar1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  *(undefined1 *)(param_1 + 0x80) = 0;
  *(int *)(param_1 + 0x310) = *(int *)(param_1 + 0x310) + 1;
  FUN_14034edd0(lVar3);
  return;
}



undefined8 FUN_140354f80(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_140352eb0(param_3 + 2,param_1 + 0x2f0);
    return 1;
  }
  return 0;
}



undefined8 FUN_140355050(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_140352eb0(param_3 + 2,param_1 + 0x2f0);
    return 1;
  }
  return 0;
}



undefined8 FUN_140355120(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_140352eb0(param_3 + 2,param_1 + 0x2f0);
    return 1;
  }
  return 0;
}



undefined8 FUN_1403551f0(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_1403552c0(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_14034ed70();
  if (*(char *)(param_1 + 0x80) == '\0') {
    *(undefined1 *)(param_1 + 0x80) = 1;
    FUN_140358460(*(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_140359380(*(undefined8 *)(param_1 + 0x3c8),param_1,2,param_4,uVar2,lVar1,uVar3);
        }
        if (*(char *)(param_1 + 0x280) != '\0') {
          *(undefined8 *)(param_1 + 0x240) = 0x80;
          FUN_140359380(*(undefined8 *)(param_1 + 0x3c8),param_1,1,param_4,uVar2,lVar1,uVar3);
        }
      }
      FUN_1403595d0(*(undefined8 *)(param_1 + 0x3c8),param_1);
      *(undefined8 *)(param_1 + 0x3c8) = 0;
    }
  }
  FUN_14034edd0(lVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403553b0(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_1405d84f0 ^ (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_140352eb0(param_3,local_58);
  FUN_140352eb0(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_1405d83d0;
  uVar2 = DAT_1405d83d4;
  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_1405d83d4;
  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_1405d83d0;
    *(undefined2 *)(param_3 + 0xc) = uVar2;
  }
  return;
}



undefined8 FUN_140355540(longlong param_1)

{
  if (*(int *)(param_1 + 0x218) == 0) {
    return 0;
  }
  return *(undefined8 *)(param_1 + 0x210);
}



undefined1 FUN_140355560(longlong param_1)

{
  longlong lVar1;
  undefined1 uVar2;
  char cVar3;
  
  lVar1 = param_1 + 0x28;
  cVar3 = FUN_14034ede0(lVar1);
  if (cVar3 == '\0') {
    return 1;
  }
  FUN_14034ed40(lVar1);
  uVar2 = *(undefined1 *)(param_1 + 0x80);
  FUN_14034edd0(lVar1);
  return uVar2;
}



void FUN_1403555b0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_140354dc0(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_1403555d0(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 0x0001403555f7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void FUN_140355610(longlong param_1)

{
  FUN_1403530f0();
  *(undefined1 *)(param_1 + 0x314) = 0;
  *(undefined4 *)(param_1 + 0x310) = 0;
  *(undefined8 *)(param_1 + 0x3c8) = 0;
  FUN_14034ed40(param_1 + 0x28);
  *(undefined1 *)(param_1 + 0x80) = 0;
  FUN_14034edd0(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_1403556b0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1403552c0();
  *(undefined ***)(param_1 + 0x2c0) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x2d0) != 0) {
    if (*(longlong **)(param_1 + 0x2c8) == (longlong *)0x0) {
      FUN_14034ff60(*(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_14034ff60();
    }
    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_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,*(longlong *)(param_1 + 0x150));
    }
  }
  FUN_14034edf0(param_1 + 0x28);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_140354dc0(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



undefined8 * FUN_1403557a0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140355800(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_1403c0cc0();
  FUN_14034ec60(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_140355610(param_1);
  if (param_2 == 0) {
    uVar2 = 1;
  }
  else if (param_2 == 1) {
    uVar2 = 2;
  }
  else {
    if (param_2 != 2) {
      FUN_14034fa20(L"Invalid Parameter in Socket ctor!");
      goto LAB_1403559c4;
    }
    uVar2 = 3;
  }
  uVar3 = WSASocketW(2,uVar2,0,0,0,1,uVar3);
  param_1[0x7a] = uVar3;
LAB_1403559c4:
  if (param_1[0x7a] != -1) {
    return param_1;
  }
  uVar1 = Ordinal_111();
  FUN_14034f420(local_50,&DAT_14044d258,uVar1);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
}



undefined8 *
FUN_140355a20(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_1403c0cc0();
  FUN_14034ec60(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_140355610(param_1);
  return param_1;
}



void FUN_140355bb0(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_14034fe70();
    local_28 = PTR_DAT_1405d8010;
    FUN_140017720(&local_28,&DAT_14044d3b8,param_3,param_2);
    FUN_14034fe70();
    puVar2 = local_28;
    local_res20 = PTR_DAT_1405d8010;
    if (PTR_DAT_1405d8010 == (undefined *)0x0) {
      local_res20 = (undefined *)0x0;
    }
    if (local_28 != PTR_DAT_1405d8010) {
      uVar3 = FUN_14034fe70();
      local_18 = uVar3;
      FUN_14034ed40(uVar3);
      local_10 = 1;
      FUN_1400031d0(&local_res20);
      local_res20 = puVar2;
      if (((puVar2 != PTR_DAT_1405d8010) && (puVar2 != (undefined *)0x0)) &&
         (puVar2 != (undefined *)0x8)) {
        *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
      }
      FUN_14034edd0(uVar3);
    }
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res20);
    if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) &&
       (puVar2 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      local_18 = uVar3;
      FUN_14034ed40(uVar3);
      local_10 = 1;
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar2 + -8);
      }
      FUN_14034edd0(uVar3);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_140355d00(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_1405d84f0 ^ (ulonglong)auStack_128;
  puVar10 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar10 = PTR_DAT_1405d8010;
  }
  local_d8 = local_d0;
  local_f8 = param_2;
  FUN_14034ef40(&local_d8,puVar10,3);
  puVar1 = local_d8;
  FUN_14034fe70();
  puVar11 = (uint *)PTR_DAT_1405d8008;
  local_108 = (uint *)PTR_DAT_1405d8008;
  uVar3 = FUN_14034fd90();
  if (puVar11 == (uint *)0x0) {
    iVar4 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1405d8008) {
    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_1405d8008) {
      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_1405d8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)((longlong)puVar11 + -8);
  }
  if ((int)uVar12 <= iVar4) goto LAB_140355ea1;
  if (puVar11 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1405d8008;
  }
  local_108 = puVar11;
  if ((int)uVar12 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (uVar12 == 0) {
    FUN_14000d2c0(&local_108);
    goto LAB_140355ea1;
  }
  if (puVar11 == (uint *)0x0) {
    uVar5 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1405d8008) {
    uVar5 = 0;
  }
  else {
    uVar5 = puVar11[-2];
  }
  if (uVar12 == uVar5) goto LAB_140355ea1;
  puVar7 = (uint *)FUN_14034fef0();
  if (puVar7 != (uint *)0x0) {
    *puVar7 = 0;
    puVar7[1] = 1;
  }
  *puVar7 = uVar12;
  if (puVar11 == (uint *)0x0) {
    uVar5 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1405d8008) {
    uVar5 = 0;
  }
  else {
    uVar5 = puVar11[-2];
  }
  puVar9 = (uint *)PTR_DAT_1405d8008;
  if ((int)uVar12 < (int)uVar5) {
LAB_140355e7b:
    if (puVar11 != (uint *)0x0) {
      puVar9 = puVar11;
    }
  }
  else {
    if (puVar11 != (uint *)0x0) {
      if (puVar11 == (uint *)PTR_DAT_1405d8008) {
        uVar12 = 0;
      }
      else {
        uVar12 = puVar11[-2];
      }
      goto LAB_140355e7b;
    }
    uVar12 = 0;
  }
  FUN_14034fdc0(puVar7 + 2,puVar9,uVar12);
  FUN_14000d2c0(&local_108);
  local_108 = puVar7 + 2;
LAB_140355ea1:
  FUN_140057970(&local_108);
  puVar11 = local_108;
  puVar7 = local_108;
  if (local_108 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar7,puVar1,uVar3);
  uVar5 = FUN_14034fd90();
  uVar3 = 0;
  if (0 < (int)uVar5) {
    uVar3 = uVar5;
  }
  if (puVar11 == (uint *)0x0) {
    uVar5 = 0;
  }
  else if (puVar11 == (uint *)PTR_DAT_1405d8008) {
    uVar5 = 0;
  }
  else {
    uVar5 = puVar11[-2];
  }
  if ((int)uVar5 <= (int)uVar3) {
    if (puVar11 == (uint *)0x0) {
      uVar3 = 0;
    }
    else if (puVar11 == (uint *)PTR_DAT_1405d8008) {
      uVar3 = 0;
    }
    else {
      uVar3 = puVar11[-2];
    }
  }
  if (((puVar11 != (uint *)PTR_DAT_1405d8008) && (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_1405d8008;
  }
  iVar4 = Ordinal_11(puVar7);
  local_e8 = CONCAT44(iVar4,(undefined4)local_e8);
  if (iVar4 == -1) {
    puVar7 = puVar11;
    if (puVar11 == (uint *)0x0) {
      puVar7 = (uint *)PTR_DAT_1405d8008;
    }
    lVar8 = Ordinal_52(puVar7);
    if (lVar8 == 0) {
      uVar6 = Ordinal_111();
      FUN_140355bb0(param_1,uVar6,L"Proud::CFastSocket::Connect");
      if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) &&
         (puVar11 + -2 != (uint *)0x0)) {
        puVar9 = (uint *)FUN_14034fe70();
        local_108 = puVar9;
        FUN_14034ed40(puVar9);
        local_100 = 1;
        puVar7 = puVar11 + -1;
        *puVar7 = *puVar7 - 1;
        if (*puVar7 == 0) {
          FUN_14034ff60(puVar11 + -2);
        }
        FUN_14034edd0(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_140355bb0(param_1,uVar6,L"Proud::CFastSocket::Connect");
    if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) &&
       (puVar11 + -2 != (uint *)0x0)) {
      puVar9 = (uint *)FUN_14034fe70();
      local_108 = puVar9;
      FUN_14034ed40(puVar9);
      local_100 = 1;
      puVar7 = puVar11 + -1;
      *puVar7 = *puVar7 - 1;
      if (*puVar7 == 0) {
        FUN_14034ff60(puVar11 + -2);
      }
      FUN_14034edd0(puVar9);
    }
    FUN_1400031d0(param_2);
  }
  else {
    if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) &&
       (puVar11 + -2 != (uint *)0x0)) {
      puVar9 = (uint *)FUN_14034fe70();
      local_108 = puVar9;
      FUN_14034ed40(puVar9);
      local_100 = 1;
      puVar7 = puVar11 + -1;
      *puVar7 = *puVar7 - 1;
      if (*puVar7 == 0) {
        FUN_14034ff60(puVar11 + -2);
      }
      FUN_14034edd0(puVar9);
    }
    FUN_1400031d0(param_2);
    uVar6 = 0;
  }
  return uVar6;
}



undefined4 FUN_140356130(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_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    uVar1 = FUN_14034fcf0(L"WARNING: IssueRecv is duplicated!");
    uVar3 = FUN_140002f00(&local_res8,uVar1);
    FUN_14034fd20(uVar3,L"WARNING: IssueRecv is duplicated!",uVar1);
    FUN_140002fe0(&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res8);
  }
  if (param_2 < 1) {
    return 0x2726;
  }
  FUN_1400179d0(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_140355bb0(param_1,uVar1,L"Proud::CFastSocket::IssueRecv");
      return uVar1;
    }
  }
  return 0;
}



int FUN_1403562a0(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_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    uVar1 = FUN_14034fcf0(L"WARNING: IssueRecvFrom is duplicated!");
    uVar3 = FUN_140002f00(&local_res8,uVar1);
    FUN_14034fd20(uVar3,L"WARNING: IssueRecvFrom is duplicated!",uVar1);
    FUN_140002fe0(&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res8);
  }
  if (0 < param_2) {
    FUN_1400179d0(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_140355bb0(param_1,iVar2,L"Proud::CFastSocket::IssueRecvFrom");
        return iVar2;
      }
    }
    return 0;
  }
  return 0x2726;
}



undefined4 FUN_140356460(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_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    uVar2 = FUN_14034fcf0(L"WARNING: IssueSend is duplicated!");
    uVar5 = FUN_140002f00(&local_res8,uVar2);
    FUN_14034fd20(uVar5,L"WARNING: IssueSend is duplicated!",uVar2);
    FUN_140002fe0(&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res8);
  }
  if ((int)param_3 < 1) {
    return 0x2726;
  }
  FUN_1400179d0(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_140355bb0(param_1,uVar2,L"Proud::CFastSocket::IssueSend");
    return uVar2;
  }
  *(bool *)(param_1 + 0x3c2) = iVar3 == 0;
  return 0;
}



undefined4 FUN_140356640(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_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    uVar2 = FUN_14034fcf0(L"WARNING: IssueSend is duplicated!");
    uVar5 = FUN_140002f00(&local_res10,uVar2);
    FUN_14034fd20(uVar5,L"WARNING: IssueSend is duplicated!",uVar2);
    FUN_140002fe0(&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_14034f7d0();
      }
      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_14034f830(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_140355bb0(param_1,uVar2,L"Proud::CFastSocket::IssueSend_NoCopy");
        return uVar2;
      }
      *(bool *)(param_1 + 0x3c2) = iVar3 == 0;
      return 0;
    }
  }
  return 0x2726;
}



void FUN_140356810(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = Ordinal_13(*(undefined8 *)(param_1 + 0x3d0),0x7fffffff);
  if (iVar1 != 0) {
    uVar2 = Ordinal_111();
    FUN_140355bb0(param_1,uVar2,L"Proud::CFastSocket::Listen");
  }
  return;
}



ulonglong FUN_140356850(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_140355bb0(param_1,uVar1,L"Proud::CFastSocket::SetSendBufferSize");
    uVar2 = uVar2 & 0xffffffff;
  }
  return uVar2;
}



ulonglong FUN_1403568b0(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_140355bb0(param_1,uVar1,L"Proud::CFastSocket::SetRecvBufferSize");
    uVar2 = uVar2 & 0xffffffff;
  }
  return uVar2;
}



int FUN_140356910(longlong param_1,longlong param_2)

{
  undefined4 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined *local_res8;
  
  if (*(char *)(param_1 + 0x100) != '\0') {
    FUN_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    uVar1 = FUN_14034fcf0(L"WARNING: AcceptEx is duplicated!");
    uVar3 = FUN_140002f00(&local_res8,uVar1);
    FUN_14034fd20(uVar3,L"WARNING: AcceptEx is duplicated!",uVar1);
    FUN_140002fe0(&local_res8);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res8);
  }
  if (DAT_1405f0900 == (code *)0x0) {
    FUN_140354a00(param_1);
  }
  *(undefined1 *)(param_1 + 0x100) = 0;
  FUN_1400179d0(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_1405f0900)(*(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_140355bb0(param_1,iVar2,L"Proud::CFastSocket::AcceptEx");
      return iVar2;
    }
  }
  return 0;
}



undefined4 FUN_140356a80(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_140355bb0(param_1,uVar2,L"Proud::CFastSocket::EnableBroadcastOption");
    return uVar2;
  }
  *(char *)(param_1 + 0x20) = param_2;
  return 0;
}



int FUN_140356b00(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_14034fe70();
    local_res20 = PTR_DAT_1405d8010;
    uVar2 = FUN_14034fcf0(L"Cannot change TTL!");
    uVar3 = FUN_140002f00(&local_res20,uVar2);
    pwVar4 = L"Cannot change TTL!";
  }
  else {
    FUN_14034fe70();
    local_res20 = PTR_DAT_1405d8010;
    uVar2 = FUN_14034fcf0(L"This socket doesn\'t support TTL change!");
    uVar3 = FUN_140002f00(&local_res20,uVar2);
    pwVar4 = L"This socket doesn\'t support TTL change!";
  }
  FUN_14034fd20(uVar3,pwVar4,uVar2);
  FUN_140002fe0(&local_res20);
  (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
            (*(longlong **)(param_1 + 0x18),param_1,&local_res20);
  return iVar1;
}



ulonglong FUN_140356c00(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_14034fe70();
    local_res10[0] = PTR_DAT_1405d8010;
    uVar2 = FUN_14034fcf0(L"Sending to 255.255.255.255 is not permitted!");
    uVar3 = FUN_140002f00(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_14034fe70();
    local_res10[0] = PTR_DAT_1405d8010;
    uVar2 = FUN_14034fcf0(L"Sending to prohibited port is not permitted!");
    uVar3 = FUN_140002f00(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_14034fe70();
    local_res10[0] = PTR_DAT_1405d8010;
    uVar2 = FUN_14034fcf0(L"Sending to 0.0.0.0 is not permitted!");
    uVar3 = FUN_140002f00(local_res10,uVar2);
    pwVar5 = L"Sending to 0.0.0.0 is not permitted!";
  }
  FUN_14034fd20(uVar3,pwVar5,uVar2);
  FUN_140002fe0(local_res10);
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
                    (*(longlong **)(param_1 + 0x18),param_1,local_res10);
  return uVar4 & 0xffffffffffffff00;
}



ulonglong FUN_140356d10(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_14034fe70();
    local_res18 = PTR_DAT_1405d8010;
    uVar1 = FUN_14034fcf0(L"This socket doesn\'t support TTL change!");
    uVar3 = FUN_140002f00(&local_res18,uVar1);
    FUN_14034fd20(uVar3,L"This socket doesn\'t support TTL change!",uVar1);
    FUN_140002fe0(&local_res18);
    (**(code **)(**(longlong **)(param_1 + 0x18) + 8))
              (*(longlong **)(param_1 + 0x18),param_1,&local_res18);
    uVar2 = uVar2 & 0xffffffff;
  }
  return uVar2;
}



void FUN_140356dc0(longlong param_1)

{
  if (*(char *)(param_1 + 0x30c) != '\0') {
    *(undefined1 *)(param_1 + 0x30c) = 0;
    FUN_140356b00(param_1,*(undefined4 *)(param_1 + 0x308));
  }
  return;
}



undefined4 FUN_140356df0(longlong param_1,undefined4 param_2)

{
  char cVar1;
  undefined4 uVar2;
  
  cVar1 = FUN_1403581a0(*(undefined8 *)(param_1 + 0x3d0),0,param_2);
  if (cVar1 == '\0') {
    uVar2 = Ordinal_111();
    FUN_140355bb0(param_1,uVar2,L"Proud::CFastSocket::Bind");
    return 0;
  }
  return 1;
}



undefined8 FUN_140356e40(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_140356e6d;
  }
  param_2 = (char *)0x0;
LAB_140356e6d:
  cVar1 = FUN_1403581a0(*(undefined8 *)(param_1 + 0x3d0),param_2);
  if (cVar1 == '\0') {
    uVar2 = Ordinal_111();
    FUN_140355bb0(param_1,uVar2,L"Proud::CFastSocket::Bind");
    return 0;
  }
  return 1;
}



undefined4 FUN_140356eb0(longlong param_1,longlong param_2)

{
  char cVar1;
  undefined4 uVar2;
  
  cVar1 = FUN_140358130(*(undefined8 *)(param_1 + 0x3d0),*(undefined4 *)(param_2 + 8),
                        *(undefined2 *)(param_2 + 0xc));
  if (cVar1 == '\0') {
    uVar2 = Ordinal_111();
    FUN_140355bb0(param_1,uVar2,L"Proud::CFastSocket::Bind");
    return 0;
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_140356f00(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_1405d84f0 ^ (ulonglong)auStack_b8;
  if (*(char *)(param_1 + 0x280) != '\0') {
    FUN_14034fe70();
    local_68 = PTR_DAT_1405d8010;
    uVar3 = FUN_14034fcf0(L"WARNING: IssueSendTo is duplicated!");
    uVar5 = FUN_140002f00(&local_68,uVar3);
    FUN_14034fd20(uVar5,L"WARNING: IssueSendTo is duplicated!",uVar3);
    FUN_140002fe0(&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_14034f7d0();
      }
      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_140352e70(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_140356c00(param_1,&local_58);
      if (cVar2 == '\0') {
        return 0x271d;
      }
      if (((-1 < param_4) && (iVar4 = FUN_140356d10(param_1,&local_60), iVar4 == 0)) &&
         (iVar4 = FUN_140356b00(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_140355bb0(param_1,iVar4,L"Proud::CFastSocket::IssueSendTo_NoCopy_TempTtl");
          return iVar4;
        }
        return 0;
      }
                    // WARNING: Subroutine does not return
      FUN_14034f830(L"Proud::CFastSocket::IssueSendTo_NoCopy_TempTtl");
    }
  }
  return 0x2726;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_140357140(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_1405d84f0 ^ (ulonglong)auStack_c8;
  uVar7 = (ulonglong)(int)param_3;
  if (*(char *)(param_1 + 0x280) != '\0') {
    FUN_14034fe70();
    local_70 = PTR_DAT_1405d8010;
    uVar3 = FUN_14034fcf0(L"WARNING: IssueSendTo is duplicated!");
    uVar5 = FUN_140002f00(&local_70,uVar3);
    FUN_14034fd20(uVar5,L"WARNING: IssueSendTo is duplicated!",uVar3);
    FUN_140002fe0(&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_1400179d0(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_140352e70(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_140356c00(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_140355bb0(param_1,iVar4,L"Proud::CFastSocket::IssueSendTo");
      }
    }
  }
  return iVar4;
}



undefined4 FUN_140357380(longlong param_1)

{
  char cVar1;
  undefined4 uVar2;
  
  cVar1 = FUN_1403581a0(*(undefined8 *)(param_1 + 0x3d0),0,0);
  if (cVar1 == '\0') {
    uVar2 = Ordinal_111();
    FUN_140355bb0(param_1,uVar2,L"Proud::CFastSocket::Bind");
    return 0;
  }
  return 1;
}



undefined8 * FUN_1403573d0(undefined8 *param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_14035a060(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_140357430(longlong param_1)

{
  (**(code **)(param_1 + 0x10))(*(undefined8 *)(param_1 + 0x18));
  SetEvent(*(HANDLE *)(param_1 + 0x20));
  return 0x14d;
}



void FUN_140357460(undefined8 *param_1)

{
  char cVar1;
  DWORD DVar2;
  
  if ((HANDLE)*param_1 != (HANDLE)0xffffffffffffffff) {
    DVar2 = WaitForSingleObject((HANDLE)*param_1,1);
    if (DVar2 == 0x102) {
      cVar1 = FUN_140359f50(param_1 + 4,0x32);
      while ((cVar1 == '\0' && (DAT_1405f0950 == '\0'))) {
        cVar1 = FUN_140359f50(param_1 + 4,0x32);
      }
    }
    CloseHandle((HANDLE)*param_1);
  }
  *(undefined4 *)(param_1 + 1) = 0;
  *param_1 = 0xffffffffffffffff;
  return;
}



void FUN_1403574e0(longlong param_1)

{
  FUN_140357460();
  FUN_14035a020(param_1 + 0x20);
  return;
}



MMRESULT * FUN_140357510(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_140357550(UINT *param_1)

{
                    // WARNING: Could not recover jumptable at 0x000140357552. Too many branches
                    // WARNING: Treating indirect jump as call
  timeKillEvent(*param_1);
  return;
}



void thunk_FUN_140359a60(undefined8 *param_1)

{
  *param_1 = Proud::CRandom::vftable;
  FUN_14034edf0();
  return;
}



undefined8 * FUN_140357570(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_1403575d0(longlong *param_1)

{
  HANDLE pvVar1;
  undefined1 local_58 [80];
  
  if (*param_1 != -1) {
    FUN_14034f420(local_58,L"Thread is already started!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  ResetEvent((HANDLE)param_1[4]);
  pvVar1 = CreateThread((LPSECURITY_ATTRIBUTES)0x0,0,FUN_140357430,param_1,0,(LPDWORD)(param_1 + 1))
  ;
  *param_1 = (longlong)pvVar1;
  return;
}



undefined8
FUN_140357640(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined *puVar2;
  
  uVar1 = 0xfffffffffffffffe;
  puVar2 = &DAT_1405f0958;
  FUN_14034ed40(&DAT_1405f0958);
  FUN_14035a110(&DAT_1405f0990,param_1,param_3,param_4,uVar1,puVar2,1);
  FUN_14034edd0(&DAT_1405f0958);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1403576a0(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_1405d84f0 ^ (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_14012a1d0(&local_128,local_148,3);
    FUN_14000d470(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_140357770(undefined8 param_1,longlong *param_2)

{
  int *piVar1;
  undefined *puVar2;
  undefined *puVar3;
  char cVar4;
  undefined4 uVar5;
  undefined8 uVar6;
  undefined *local_res20;
  
  FUN_14034fe70();
  local_res20 = PTR_DAT_1405d8010;
  cVar4 = FUN_1403576a0(param_1,&local_res20);
  if (cVar4 == '\0') {
    FUN_14034fe70();
    *param_2 = (longlong)PTR_DAT_1405d8010;
    uVar5 = FUN_14034fcf0(&DAT_14044db98);
    uVar6 = FUN_140002f00(param_2,uVar5);
    FUN_14034fd20(uVar6,&DAT_14044db98,uVar5);
    FUN_140002fe0(param_2);
    puVar3 = local_res20;
    if (local_res20 == (undefined *)0x0) {
      return param_2;
    }
    if (local_res20 == PTR_DAT_1405d8010) {
      return param_2;
    }
    puVar2 = local_res20 + -8;
    if (puVar2 == (undefined *)0x0) {
      return param_2;
    }
    uVar6 = FUN_14034fe70();
    FUN_14034ed40(uVar6);
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2);
    }
  }
  else {
    FUN_14034fe70();
    puVar2 = local_res20;
    puVar3 = PTR_DAT_1405d8010;
    *param_2 = (longlong)PTR_DAT_1405d8010;
    if (puVar3 == (undefined *)0x0) {
      *param_2 = (longlong)PTR_DAT_1405d8010;
    }
    if (local_res20 != (undefined *)*param_2) {
      uVar6 = FUN_14034fe70();
      FUN_14034ed40(uVar6);
      FUN_1400031d0(param_2);
      *param_2 = (longlong)puVar2;
      if (((puVar2 != PTR_DAT_1405d8010) && (puVar2 != (undefined *)0x0)) &&
         (puVar2 != (undefined *)0x8)) {
        *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
      }
      FUN_14034edd0(uVar6);
    }
    if (puVar2 == (undefined *)0x0) {
      return param_2;
    }
    if (puVar2 == PTR_DAT_1405d8010) {
      return param_2;
    }
    if (puVar2 + -8 == (undefined *)0x0) {
      return param_2;
    }
    uVar6 = FUN_14034fe70();
    FUN_14034ed40(uVar6);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
  }
  FUN_14034edd0(uVar6);
  return param_2;
}



void FUN_140357920(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_140357980(undefined8 *param_1,undefined8 param_2,undefined2 param_3)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(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_1403579f0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001403579f7. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_1 + 8) + 0x18))();
  return;
}



ulonglong FUN_140357a00(longlong param_1)

{
  int *piVar1;
  int iVar2;
  ulonglong uVar3;
  int iVar4;
  LPVOID pvVar5;
  
  if (*(int *)(param_1 + 0x14) == 0) {
    return 0;
  }
  pvVar5 = TlsGetValue((DWORD)DAT_1405f13b0);
  iVar4 = DAT_1405f13a8;
  if (pvVar5 == (LPVOID)0x0) {
    LOCK();
    piVar1 = (int *)(param_1 + 0x40);
    iVar2 = *piVar1;
    *piVar1 = *piVar1 + 1;
    UNLOCK();
    uVar3 = (longlong)(iVar2 + 1) % (longlong)iVar4;
    TlsSetValue((DWORD)DAT_1405f13b0,(LPVOID)((longlong)(int)uVar3 + 1));
    return uVar3 & 0xffffffff;
  }
  return (longlong)pvVar5 - 1U & 0xffffffff;
}



undefined2 * FUN_140357a80(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_14034ed40();
    }
    *(undefined1 *)(param_1 + 0x15) = 1;
    uVar8 = bVar5;
    if (((*(int *)(*param_1 + 0x14) == 0) && (*(longlong *)(*param_1 + 0x18) != 0)) &&
       (cVar3 = FUN_14034ee70(), cVar3 == '\0')) {
      FUN_14034fa20();
    }
    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_14034f7d0();
      }
      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_14034edd0(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_14034edd0(plVar1);
      return (undefined2 *)(lVar2 + 0x20);
    }
    *(undefined1 *)(param_1 + 0x15) = 0;
    if (bVar5) {
      FUN_14034edd0(plVar1);
    }
  }
  else {
    FUN_14034fa20(L"CLookasideAllocator.Alloc() is called after the allocator is already disposed!")
    ;
  }
  return (undefined2 *)0x0;
}



void FUN_140357c10(longlong *param_1,longlong param_2)

{
  char cVar1;
  bool bVar2;
  
  if ((int)param_1[8] != 2) {
    FUN_14034fa20(
                 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_14034ed40(param_1 + 0xe);
  }
  *(undefined1 *)(param_1 + 0x15) = 1;
  if ((*(int *)(*param_1 + 0x14) == 0) && (*(longlong *)(*param_1 + 0x18) != 0)) {
    cVar1 = FUN_14034ee70();
    if (cVar1 == '\0') {
      FUN_14034fa20(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_14034fa20(
                 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_14034edd0(param_1 + 0xe);
  }
  return;
}



void FUN_140357d00(longlong *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = param_1 + 0xe;
  FUN_14034ed70(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_14034edd0(plVar1);
  FUN_14034edf0(plVar1);
  return;
}



void FUN_140357da0(longlong param_1,undefined8 param_2)

{
  int iVar1;
  
  iVar1 = FUN_140357a00();
  FUN_140357a80(*(undefined8 *)(*(longlong *)(param_1 + 0x48) + (longlong)iVar1 * 8),param_2);
  return;
}



void FUN_140357de0(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_1405f13a8) &&
       (*(longlong *)(lVar1 + 0x68) == *(longlong *)(param_2 + -0x18))) {
      FUN_140357c10(lVar1,param_2 + -0x20);
      return;
    }
  }
  FUN_14034fa20(
               L"Not a CLookasideAllocator or owner CFastHeap allocated block! Refer to technical notes for more help."
               );
  return;
}



void FUN_140357e30(void)

{
  undefined4 uVar1;
  DWORD DVar2;
  
  if ((DAT_1405f13f0 & 1) == 0) {
    DAT_1405f13f0 = DAT_1405f13f0 | 1;
    uVar1 = FUN_1403c0cc0();
    FUN_14034ec60(&DAT_1405f13b8,uVar1,1);
    atexit((_func_5014 *)&LAB_140449360);
  }
  FUN_14034ed40(&DAT_1405f13b8);
  if (DAT_1405f13a8 == 0) {
    DAT_1405f13a8 = FUN_14034f860();
  }
  if (DAT_1405f13b0 == 0) {
    DVar2 = TlsAlloc();
    DAT_1405f13b0 = (ulonglong)DVar2;
  }
  FUN_14034edd0(&DAT_1405f13b8);
  return;
}



undefined8 * FUN_140357ed0(undefined8 *param_1,longlong *param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  longlong lVar3;
  void *pvVar4;
  undefined8 *puVar5;
  undefined8 *puVar6;
  undefined8 *puVar7;
  ushort uVar8;
  
  FUN_140352e40();
  *param_1 = Proud::CLookasideAllocatorImpl::vftable;
  plVar1 = param_1 + 1;
  FUN_140352e50(plVar1);
  FUN_140357e30(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_1405f064d != '\0') {
    *(undefined4 *)((longlong)param_1 + 0x14) = 1;
  }
  if (*plVar1 == 0) {
    lVar3 = FUN_140350850();
    *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_140357980(pvVar4,param_1,0);
    }
    *(undefined8 **)param_1[9] = puVar5;
  }
  else {
    pvVar4 = malloc((ulonglong)DAT_1405f13a8 << 3);
    param_1[9] = pvVar4;
    uVar8 = 0;
    if (DAT_1405f13a8 != 0) {
      do {
        puVar6 = operator_new(0xc0);
        puVar7 = puVar5;
        if (puVar6 != (undefined8 *)0x0) {
          uVar2 = FUN_1403c0cc0();
          FUN_14034ec60(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_1405f13a8);
    }
  }
  return param_1;
}



void FUN_140358040(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_140357d00(pvVar1);
      operator_delete(pvVar1);
    }
  }
  else {
    uVar3 = 0;
    uVar2 = DAT_1405f13a8;
    if (DAT_1405f13a8 != 0) {
      do {
        pvVar1 = *(void **)(param_1[9] + (ulonglong)uVar3 * 8);
        if (pvVar1 != (void *)0x0) {
          FUN_140357d00(pvVar1);
          operator_delete(pvVar1);
          uVar2 = DAT_1405f13a8;
        }
        uVar3 = uVar3 + 1;
      } while (uVar3 < uVar2);
    }
  }
  free((void *)param_1[9]);
  FUN_140352e00(param_1);
  return;
}



undefined8 FUN_140358100(undefined8 param_1,uint param_2)

{
  FUN_140358040();
  if ((param_2 & 1) != 0) {
    FUN_14034ff60(param_1);
  }
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

bool FUN_140358130(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_1405d84f0 ^ (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_1403581a0(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_140358130(param_1,iVar1,param_3);
  return uVar2;
}



longlong * FUN_140358200(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_14034fe70();
    *param_1 = (longlong)PTR_DAT_1405d8008;
    uVar4 = FUN_14034fd90(&DAT_14047e238);
    uVar6 = FUN_140057a60(param_1,uVar4);
    FUN_14034fdc0(uVar6,&DAT_14047e238,uVar4,param_4,uVar10);
    FUN_140057b50(param_1);
  }
  else {
    FUN_14034fe70();
    local_res20 = PTR_DAT_1405d8008;
    uVar9 = uVar7;
    if (0 < *(short *)(lVar5 + 0x12)) {
      do {
        FUN_14034fe70();
        local_res18 = PTR_DAT_1405d8008;
        if (0 < (longlong)uVar7) {
          FUN_140353360(&local_res20,&DAT_14049aa7c);
        }
        FUN_140351b00(&local_res18,&DAT_14044d0b0,
                      *(undefined1 *)(**(longlong **)(lVar5 + 0x18) + uVar7));
        FUN_140351970(&local_res20,&local_res18);
        puVar3 = local_res18;
        if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1405d8008)) &&
           (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
          uVar10 = FUN_14034fe70();
          FUN_14034ed40(uVar10);
          piVar2 = (int *)(puVar3 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(uVar10);
        }
        uVar8 = (int)uVar9 + 1;
        uVar9 = (ulonglong)uVar8;
        uVar7 = uVar7 + 1;
      } while ((int)uVar8 < (int)*(short *)(lVar5 + 0x12));
    }
    puVar1 = local_res20;
    FUN_14034fe70();
    puVar3 = PTR_DAT_1405d8008;
    *param_1 = (longlong)PTR_DAT_1405d8008;
    if (puVar3 == (undefined *)0x0) {
      *param_1 = (longlong)PTR_DAT_1405d8008;
    }
    if (puVar1 != (undefined *)*param_1) {
      uVar10 = FUN_14034fe70();
      FUN_14034ed40(uVar10);
      FUN_14000d2c0(param_1);
      *param_1 = (longlong)puVar1;
      if (((puVar1 != PTR_DAT_1405d8008) && (puVar1 != (undefined *)0x0)) &&
         (puVar1 != (undefined *)0x8)) {
        *(int *)(puVar1 + -4) = *(int *)(puVar1 + -4) + 1;
      }
      FUN_14034edd0(uVar10);
    }
    if (((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1405d8008)) &&
       (puVar1 + -8 != (undefined *)0x0)) {
      uVar10 = FUN_14034fe70();
      FUN_14034ed40(uVar10);
      piVar2 = (int *)(puVar1 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1 + -8);
      }
      FUN_14034edd0(uVar10);
    }
  }
  return param_1;
}



void FUN_140358460(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_14034fe70();
    local_res20 = PTR_DAT_1405d8010;
    uVar2 = FUN_14034fcf0(
                         L"FATAL: Socket which has behavior of some waits in closesocket() has been detected!"
                         );
    uVar3 = FUN_140002f00(&local_res20,uVar2);
    FUN_14034fd20(uVar3,
                  L"FATAL: Socket which has behavior of some waits in closesocket() has been detected!"
                  ,uVar2);
    FUN_140002fe0(&local_res20);
    FUN_140352d80(&local_res20);
  }
  return;
}



void FUN_140358500(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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      *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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                L"Proud::CListNode<class Proud::CFastSocket>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void thunk_FUN_140358500(void)

{
  FUN_140358500();
  return;
}



longlong * FUN_140358600(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_14000d450(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_14034ff60();
  param_1[3] = param_1[3] + -1;
  return param_2;
}



longlong FUN_1403586a0(longlong *param_1,longlong *param_2)

{
  longlong lVar1;
  
  if (param_2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_14034ff60(param_2);
  param_1[3] = param_1[3] + -1;
  return lVar1;
}



undefined8 FUN_140358730(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_14035a290(param_1);
    local_res20 = param_1 + 0x50;
    puVar1 = (undefined8 *)(param_1 + 0x38);
    iVar11 = 0;
    do {
      local_a8 = param_1 + 0x50;
      FUN_14034ed40(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_1405d83d0;
      local_64 = DAT_1405d83d4;
      for (; puVar2 != (undefined8 *)0x0; puVar2 = (undefined8 *)puVar2[1]) {
        cVar7 = FUN_1403551f0(puVar2,0,&local_78);
        if (cVar7 != '\0') {
          *(undefined4 *)(param_2 + 2) = 1;
          puVar10 = puVar2 + 0x48;
LAB_140358a99:
          FUN_140354840(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_140354dc0(puVar2[2],puVar2);
          }
          if (puVar2[2] != 0) {
            FUN_140354dc0(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_140358b4a;
        }
        cVar7 = FUN_140354f80(puVar2,0,&local_78);
        if (cVar7 != '\0') {
          *(undefined4 *)(param_2 + 2) = 2;
          *(undefined4 *)(param_2 + 4) = *(undefined4 *)((longlong)puVar2 + 0x304);
          FUN_140352eb0(param_2 + 5,puVar2 + 0x5e);
          puVar10 = puVar2 + 0x30;
          goto LAB_140358a99;
        }
        cVar7 = FUN_140355050(puVar2,0,&local_78);
        if (cVar7 != '\0') {
          *(undefined4 *)(param_2 + 2) = 3;
          puVar10 = puVar2 + 0x18;
          goto LAB_140358a99;
        }
        cVar7 = FUN_140355120(puVar2,0,&local_78);
        if (cVar7 != '\0') {
          *(undefined4 *)(param_2 + 2) = 4;
          puVar10 = puVar2 + 0x68;
          goto LAB_140358a99;
        }
      }
      if (*(longlong *)(param_1 + 0xa0) != 0) {
        FUN_140358600(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_140358b4a:
        FUN_14034edd0(lVar9);
        return 1;
      }
      FUN_14034edd0(param_1 + 0x50);
      local_a0 = 0;
      if ((param_3 == 0) ||
         ((param_3 != 0xffffffff &&
          (dVar13 = (double)FUN_14035a290(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_1405d83d4;
  uVar4 = DAT_1405d83d0;
  *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_14034f9d0();
  (**(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_1405d83d0;
    *(undefined2 *)((longlong)param_2 + 0x34) = DAT_1405d83d4;
    *(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_140352eb0(param_2 + 5,local_a8 + 0x2f0);
      FUN_140354840(lVar9,0,0);
      goto LAB_1403588e1;
    }
    if (local_res20 == local_a8 + 0x240) {
      *(undefined4 *)(param_2 + 2) = 1;
      FUN_140354840(local_a8 + 0x240,0,0);
      goto LAB_1403588e1;
    }
    if (local_res20 == local_a8 + 0xc0) {
      *(undefined4 *)(param_2 + 2) = 3;
      FUN_140354840(local_a8 + 0xc0,0,0);
      goto LAB_1403588e1;
    }
    if (local_res20 == local_a8 + 0x340) {
      *(undefined4 *)(param_2 + 2) = 4;
      FUN_140354840(local_a8 + 0x340,0,0);
      goto LAB_1403588e1;
    }
  }
  *(undefined4 *)(param_2 + 2) = 0;
  param_2[3] = local_res20;
LAB_1403588e1:
  *(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_140358b80(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_1405d84f0 ^ (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_14035a290(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_14034ed40(local_1d8);
        local_1d0 = 1;
        local_238 = *(int *)(param_1 + 0x48) * 3 + 3;
        puVar13 = (undefined8 *)*plVar18;
        local_268 = 0x4044caf8;
        uStack_264 = 1;
        local_258 = local_258 & 0xffffffff00000000;
        local_270 = 0;
        puVar3 = puVar13;
        local_260 = DAT_1405d83d0;
        local_25c = DAT_1405d83d4;
        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_1405d83d0;
          local_1f4 = DAT_1405d83d4;
          cVar10 = FUN_1403551f0(puVar3,0,&local_270);
          if (cVar10 == '\0') {
            cVar10 = FUN_140354f80(puVar3,0,&local_270);
            if (cVar10 != '\0') {
              local_218 = 2;
              local_208 = *(undefined4 *)((longlong)puVar3 + 0x304);
              FUN_140352eb0(&local_200);
              puVar14 = puVar3 + 0x30;
              goto LAB_140358fb8;
            }
            cVar10 = FUN_140355050(puVar3,0,&local_270);
            if (cVar10 != '\0') {
              local_218 = 3;
              puVar14 = puVar3 + 0x18;
              goto LAB_140358fb8;
            }
            cVar10 = FUN_140355120(puVar3,0,&local_270);
            if (cVar10 != '\0') {
              local_218 = 4;
              puVar14 = puVar3 + 0x68;
              goto LAB_140358fb8;
            }
          }
          else {
            local_218 = 1;
            puVar14 = puVar3 + 0x48;
LAB_140358fb8:
            FUN_140354840(puVar14,0,0);
            local_228 = puVar3[0x5d];
            local_220 = CONCAT44((int)((ulonglong)local_270 >> 0x20),(undefined4)local_258);
            if (puVar3[2] != 0) {
              FUN_140354dc0();
            }
            if (puVar3[2] != 0) {
              FUN_140354dc0(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_14034f800();
            }
            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_140359233;
          }
          puVar3 = (undefined8 *)puVar3[1];
        } while (puVar3 != puVar13);
        lVar12 = *(longlong *)(param_1 + 0xa0);
        uVar8 = DAT_1405d83d0;
        uVar9 = DAT_1405d83d4;
        while (DAT_1405d83d0 = uVar8, DAT_1405d83d4 = uVar9, lVar12 != 0) {
          plVar4 = *(longlong **)(param_1 + 0x90);
          if (plVar4 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
            FUN_14000d450(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_14034ff60();
          }
          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_14034f800();
          }
          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_140359233;
          param_3 = local_1e8;
          param_2 = local_1f0;
          uVar8 = DAT_1405d83d0;
          uVar9 = DAT_1405d83d4;
          lVar12 = *(longlong *)(param_1 + 0xa0);
        }
        if (*param_3 != 0) {
LAB_140359233:
          FUN_14034edd0(local_230);
          return 1;
        }
        FUN_14034edd0(param_1 + 0x50);
        local_1d0 = 0;
        uVar16 = (ulonglong)local_234;
        if ((local_234 == 0) ||
           ((local_234 != 0xffffffff &&
            (dVar20 = (double)FUN_14035a290(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_14034f9d0();
    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_1405d83d0;
        local_23c = DAT_1405d83d4;
        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_14034f800();
          }
          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_14034f800();
            }
          }
          else {
            if (lVar2 == 0) {
LAB_140358db5:
              local_260 = 0;
              local_258 = lVar12;
            }
            else if (lVar12 == lVar2 + 0x180) {
              local_260 = 2;
              local_250 = *(undefined4 *)(lVar2 + 0x304);
              FUN_140352eb0(&local_248,lVar2 + 0x2f0);
              FUN_140354840(lVar2 + 0x180,0,0);
            }
            else if (lVar12 == lVar2 + 0x240) {
              local_260 = 1;
              FUN_140354840(lVar2 + 0x240,0,0);
            }
            else if (lVar12 == lVar2 + 0xc0) {
              local_260 = 3;
              FUN_140354840(lVar2 + 0xc0,0,0);
            }
            else {
              if (lVar12 != lVar2 + 0x340) goto LAB_140358db5;
              local_260 = 4;
              FUN_140354840(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_14034f800();
            }
          }
          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_140359280(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_14034ed40(param_1 + 0x50);
    uVar1 = *(undefined8 *)(param_1 + 0x98);
    plVar2 = *(longlong **)(param_1 + 0x88);
    if (plVar2 == (longlong *)0x0) {
      puVar3 = (undefined8 *)FUN_14034fef0(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_14034edd0(param_1 + 0x50);
  }
  else {
    PostQueuedCompletionStatus(*(HANDLE *)(param_1 + 0x28),0,param_2,param_3);
  }
  return;
}



void FUN_140359380(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  undefined8 uVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  undefined4 uStack_c;
  
  FUN_14034ed40(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_14034fef0(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_14034edd0(param_1 + 0x50);
  return;
}



void FUN_140359460(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_14034ff60();
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



longlong FUN_1403594e0(longlong param_1,undefined8 param_2,char param_3)

{
  undefined4 uVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  longlong lVar4;
  undefined1 local_50 [72];
  
  FUN_14035a1b0();
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined8 *)(param_1 + 0x40) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(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_14034f9d0();
    if (*plVar2 != 0) {
      puVar3 = (undefined8 *)FUN_14034f9d0();
      lVar4 = (*(code *)*puVar3)(0xffffffffffffffff,0,0,0);
      *(longlong *)(param_1 + 0x28) = lVar4;
      if (lVar4 == 0) {
        FUN_14034f420(local_50,L"Cannot create IOCP object!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
  }
  FUN_14035a200(param_1);
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014035966a)
// WARNING: Removing unreachable block (ram,0x000140359675)

void FUN_1403595d0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_14034ed40(param_1 + 0x50);
  puVar2 = *(undefined8 **)(param_1 + 0x90);
  while (puVar2 != (undefined8 *)0x0) {
    if (puVar2[2] == param_2) {
      puVar1 = (undefined8 *)*puVar2;
      FUN_1403586a0(param_1 + 0x88,puVar2);
      puVar2 = puVar1;
    }
    else {
      puVar2 = (undefined8 *)*puVar2;
    }
  }
  if (*(longlong *)(param_2 + 0x10) != 0) {
    FUN_140354dc0(*(longlong *)(param_2 + 0x10),param_2,param_3,param_4,uVar3);
  }
  *(undefined8 *)(param_2 + 0x3c8) = 0;
  FUN_14034edd0(param_1 + 0x50);
  return;
}



void FUN_1403596c0(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_1403595d0(param_1,*(undefined8 *)(param_1 + 0x38));
        iVar1 = *(int *)(param_1 + 0x48);
      }
      FUN_140359460(param_1 + 0x88);
      FUN_14034edf0(param_1 + 0x50);
      FUN_140358500(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_14034ff60();
    }
    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_14000d450(0x80004005);
}



void FUN_1403597c0(longlong param_1,undefined8 param_2)

{
  int *piVar1;
  undefined *puVar2;
  DWORD DVar3;
  undefined *local_res8;
  undefined *local_res18;
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  FUN_14034fe70();
  local_res18 = PTR_DAT_1405d8010;
  DVar3 = GetLastError();
  FUN_140017720(&local_res18,&DAT_14044d3b8,param_2,DVar3,uVar4);
  FUN_14034fe70();
  puVar2 = local_res18;
  local_res8 = PTR_DAT_1405d8010;
  if (PTR_DAT_1405d8010 == (undefined *)0x0) {
    local_res8 = (undefined *)0x0;
  }
  if (local_res18 != PTR_DAT_1405d8010) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    FUN_1400031d0(&local_res8);
    local_res8 = puVar2;
    if (((puVar2 != PTR_DAT_1405d8010) && (puVar2 != (undefined *)0x0)) &&
       (puVar2 != (undefined *)0x8)) {
      *(int *)(puVar2 + -4) = *(int *)(puVar2 + -4) + 1;
    }
    FUN_14034edd0(uVar4);
  }
  (**(code **)(**(longlong **)(param_1 + 0x30) + 8))
            (*(longlong **)(param_1 + 0x30),param_1,&local_res8);
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_1403598f0(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_14034f420(local_50,&DAT_14044e340,param_3,param_4,0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (param_2[0x79] != 0) {
    FUN_14034f420(local_50,&DAT_14044e320,param_3,param_4,0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*(longlong *)(param_1 + 0x28) != 0) {
    puVar1 = (undefined8 *)FUN_14034f9d0();
    lVar2 = (*(code *)*puVar1)(param_2[0x7a],*(undefined8 *)(param_1 + 0x28),param_2,0);
    if (lVar2 == 0) {
      FUN_1403597c0(param_1,L"Proud::CompletionPort::AssociateSocket");
    }
  }
  FUN_14034ed40(param_1 + 0x50);
  puVar1 = (undefined8 *)(param_1 + 0x38);
  if (param_2[2] != 0) {
    FUN_140354dc0(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_14034edd0(param_1 + 0x50);
  return;
}



undefined8 * FUN_140359a20(undefined8 *param_1)

{
  undefined4 uVar1;
  
  *param_1 = Proud::CRandom::vftable;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x13c,uVar1,1);
  *(undefined4 *)(param_1 + 0x13b) = 0xfffffffe;
  return param_1;
}



void FUN_140359a60(undefined8 *param_1)

{
  *param_1 = Proud::CRandom::vftable;
  FUN_14034edf0();
  return;
}



undefined8 * FUN_140359a80(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CRandom::vftable;
  FUN_14034edf0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140359ad0(longlong param_1,uint param_2)

{
  uint *puVar1;
  int iVar2;
  
  FUN_14034ed40(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_14034edd0(param_1 + 0x9e0);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140359b40(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_1405d84f0 ^ (ulonglong)auStackY_78;
  lVar1 = param_1 + 0x9e0;
  local_30 = lVar1;
  FUN_14034ed40(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_140359ad0(param_1,DVar2 << 0x10 | (uint)uVar5);
  FUN_14034edd0(lVar1);
  return;
}



uint FUN_140359c50(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_140359b40();
  }
  *(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_140359dc0(longlong param_1)

{
  int *piVar1;
  uint uVar2;
  
  FUN_14034ed40(param_1 + 0x9e0);
  piVar1 = (int *)(param_1 + 0x9d8);
  *piVar1 = *piVar1 + -1;
  if (*piVar1 < 0) {
    uVar2 = FUN_140359c50(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_14034edd0(param_1 + 0x9e0);
  return uVar2;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined * FUN_140359e60(void)

{
  char cVar1;
  undefined4 uVar2;
  char cVar3;
  undefined8 in_R9;
  undefined8 uVar4;
  undefined *puVar5;
  char cVar6;
  
  uVar4 = 0xfffffffffffffffe;
  puVar5 = &DAT_1405f1e20;
  cVar6 = '\0';
  cVar1 = FUN_14034ede0(&DAT_1405f1e20);
  cVar3 = '\0';
  if ((cVar1 != '\0') && (cVar3 = cVar6, DAT_1405d84c0 != '\0')) {
    cVar6 = '\x01';
    FUN_14034ed40(&DAT_1405f1e20);
    cVar3 = '\x01';
  }
  if ((DAT_1405f1e18 & 1) == 0) {
    DAT_1405f1e18 = DAT_1405f1e18 | 1;
    _DAT_1405f1400 = Proud::CRandom::vftable;
    uVar2 = FUN_1403c0cc0();
    FUN_14034ec60(&DAT_1405f1de0,uVar2,1,in_R9,uVar4,puVar5,cVar6);
    _DAT_1405f1dd8 = 0xfffffffe;
    atexit((_func_5014 *)&LAB_140449380);
  }
  DAT_1405d84c0 = 0;
  if (cVar3 != '\0') {
    FUN_14034edd0(&DAT_1405f1e20);
  }
  return &DAT_1405f1400;
}



void FUN_140359f30(void)

{
  undefined8 uVar1;
  
  uVar1 = FUN_140359e60();
  FUN_140359dc0(uVar1);
  return;
}



bool FUN_140359f50(undefined8 *param_1,DWORD param_2)

{
  DWORD DVar1;
  
  DVar1 = WaitForSingleObject((HANDLE)*param_1,param_2);
  return DVar1 == 0;
}



bool FUN_140359f70(undefined8 *param_1)

{
  DWORD DVar1;
  
  DVar1 = WaitForSingleObject((HANDLE)*param_1,0xffffffff);
  return DVar1 == 0;
}



DWORD FUN_140359f90(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_14034f420(local_258,&DAT_14044e430);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_258,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14035a020(undefined8 *param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014035a023. Too many branches
                    // WARNING: Treating indirect jump as call
  CloseHandle((HANDLE)*param_1);
  return;
}



undefined8 * FUN_14035a030(undefined8 *param_1)

{
  HANDLE pvVar1;
  
  pvVar1 = CreateEventW((LPSECURITY_ATTRIBUTES)0x0,0,0,(LPCWSTR)0x0);
  *param_1 = pvVar1;
  return param_1;
}



undefined8 * FUN_14035a060(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_14035a090(void)

{
  FUN_140359dc0();
  return;
}



int FUN_14035a0c0(undefined8 param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  double dVar3;
  
  uVar1 = FUN_140359dc0();
  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_14035a110(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_140359dc0(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_14035a1b0(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_14035a200(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_14035a250(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_14035a290(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_14035a2f0(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_14035a350(longlong param_1)

{
  return *(undefined1 *)(param_1 + 1);
}



void Ordinal_151(void)

{
                    // WARNING: Could not recover jumptable at 0x00014035a356. 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 0x00014035a35c. Too many branches
                    // WARNING: Treating indirect jump as call
  GetAcceptExSockaddrs
            (lpOutputBuffer,dwReceiveDataLength,dwLocalAddressLength,dwRemoteAddressLength,
             LocalSockaddr,LocalSockaddrLength,RemoteSockaddr,RemoteSockaddrLength);
  return;
}



void * __cdecl operator_new(__uint64 param_1)

{
  void *pvVar1;
  
                    // WARNING: Could not recover jumptable at 0x00014035a412. Too many branches
                    // WARNING: Treating indirect jump as call
  pvVar1 = operator_new(param_1);
  return pvVar1;
}



// 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_1405d84f0) && ((short)(_StackCookie >> 0x30) == 0)) {
    return;
  }
                    // WARNING: Subroutine does not return
  __report_gsfailure(_StackCookie);
}



void __cdecl operator_delete(void *param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014035a3a0. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(param_1);
  return;
}



// 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;
}



void * __cdecl operator_new(__uint64 param_1)

{
  void *pvVar1;
  
                    // WARNING: Could not recover jumptable at 0x00014035a412. Too many branches
                    // WARNING: Treating indirect jump as call
  pvVar1 = operator_new(param_1);
  return pvVar1;
}



char * __thiscall std::exception::what(exception *this)

{
  char *pcVar1;
  
                    // WARNING: Could not recover jumptable at 0x00014035a418. Too many branches
                    // WARNING: Treating indirect jump as call
  pcVar1 = what(this);
  return pcVar1;
}



// 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_14060d4a8);
  if (local_res10 == (PVOID)0xffffffffffffffff) {
    p_Var1 = _onexit(_Func);
  }
  else {
    _lock(8);
    local_res10 = DecodePointer(DAT_14060d4a8);
    local_res18[0] = DecodePointer(DAT_14060d4a0);
    pvVar2 = EncodePointer(_Func);
    p_Var1 = (_onexit_t)__dllonexit(pvVar2,&local_res10,local_res18);
    DAT_14060d4a8 = EncodePointer(local_res10);
    DAT_14060d4a0 = 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_14035a4f4(void)

{
  atexit(FUN_14035ac0c);
  _DAT_1405f1e74 = DAT_1405f2404;
  _DAT_1405f1e70 =
       __wgetmainargs(&DAT_1405f1e58,&DAT_1405f1e68,&DAT_1405f1e60,DAT_1405f2400,&DAT_1405f1e74);
  if (_DAT_1405f1e70 < 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_14060d490 == (void *)0x0;
    pvVar3 = pvVar1;
    if (!bVar8) {
      pvVar6 = DAT_14060d490;
      pvVar3 = DAT_14060d490;
    }
    DAT_14060d490 = pvVar3;
    UNLOCK();
    if (bVar8) goto LAB_14035a5a2;
    if (pvVar6 == pvVar1) break;
    Sleep(1000);
  }
  bVar2 = true;
LAB_14035a5a2:
  if (DAT_14060d488 == 1) {
    _amsg_exit(0x1f);
  }
  else if (DAT_14060d488 == 0) {
    DAT_14060d488 = 1;
    iVar4 = _initterm_e(&DAT_14044b7e8,&DAT_14044b800);
    if (iVar4 != 0) {
      return 0xff;
    }
  }
  else {
    DAT_1405f1e7c = 1;
  }
  if (DAT_14060d488 == 1) {
    _initterm(&DAT_14044ade8,&DAT_14044b7e0);
    DAT_14060d488 = 2;
  }
  if (!bVar2) {
    LOCK();
    DAT_14060d490 = (void *)0x0;
    UNLOCK();
  }
  if ((DAT_14060d498 != (code *)0x0) &&
     (BVar5 = _IsNonwritableInCurrentImage((PBYTE)&DAT_14060d498), BVar5 != 0)) {
    (*DAT_14060d498)(0,2);
  }
  *(undefined8 *)__winitenv_exref = DAT_1405f1e60;
  uVar7 = FUN_1400012f0(DAT_1405f1e58,DAT_1405f1e68,DAT_1405f1e60);
  DAT_1405f1e78 = (uint)uVar7;
  if (DAT_1405f1e5c != 0) {
    if (DAT_1405f1e7c == 0) {
      _cexit();
      uVar7 = (ulonglong)DAT_1405f1e78;
    }
    return uVar7;
  }
                    // WARNING: Subroutine does not return
  exit(DAT_1405f1e78);
}



// WARNING: Removing unreachable block (ram,0x00014035a6ee)

undefined8 FUN_14035a6dc(void)

{
  DAT_1405f1e5c = 0;
  __set_app_type(1);
  DAT_14060d4a0 = EncodePointer((PVOID)0xffffffffffffffff);
  DAT_14060d4a8 = DAT_14060d4a0;
  *(undefined4 *)_fmode_exref = DAT_1405f240c;
  *(undefined4 *)_commode_exref = DAT_1405f2408;
  FUN_14035abd4();
  FUN_14035ad20();
  if (DAT_1405d851c == 0) {
    __setusermatherr(FUN_14035ad20);
  }
  if (DAT_1405d8518 == -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 0x00014035a7be. 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 0x00014035a7c4. 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 0x00014035a7ca. 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 0x00014035a7d0. 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_14035a85c(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 0x00014035a8ec. 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 0x00014035a8f2. 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 0x00014035a8f8. 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 0x00014035a8fe. 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_1405f1f30);
  local_30 = DAT_1405f2028;
  local_38 = RtlLookupFunctionEntry(DAT_1405f2028,&local_28,(PUNWIND_HISTORY_TABLE)0x0);
  if (local_38 == (PRUNTIME_FUNCTION)0x0) {
    _DAT_1405f1fc8 = local_res8;
    DAT_1405f2028 = unaff_retaddr;
  }
  else {
    RtlVirtualUnwind(0,local_28,local_30,local_38,(PCONTEXT)&DAT_1405f1f30,&local_48,&local_40,
                     (PKNONVOLATILE_CONTEXT_POINTERS)0x0);
  }
  _DAT_1405f1ea0 = DAT_1405f2028;
  _DAT_1405f1fb0 = local_res8[0];
  _DAT_1405f1e90 = 0xc0000409;
  _DAT_1405f1e94 = 1;
  local_20 = DAT_1405d84f0;
  local_18 = DAT_1405d84f8;
  DAT_1405f1f28 = IsDebuggerPresent();
  __crt_debugger_hook(1);
  SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)0x0);
  UnhandledExceptionFilter((_EXCEPTION_POINTERS *)&PTR_DAT_14044e4a0);
  if (DAT_1405f1f28 == 0) {
    __crt_debugger_hook(1);
  }
  hProcess = GetCurrentProcess();
  TerminateProcess(hProcess,0xc0000409);
  return;
}



void __cdecl _unlock(int _File)

{
                    // WARNING: Could not recover jumptable at 0x00014035ab5e. Too many branches
                    // WARNING: Treating indirect jump as call
  _unlock(_File);
  return;
}



void __dllonexit(void)

{
                    // WARNING: Could not recover jumptable at 0x00014035ab64. Too many branches
                    // WARNING: Treating indirect jump as call
  __dllonexit();
  return;
}



void __cdecl _lock(int _File)

{
                    // WARNING: Could not recover jumptable at 0x00014035ab6a. Too many branches
                    // WARNING: Treating indirect jump as call
  _lock(_File);
  return;
}



undefined8 FUN_14035ab70(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_14035abb4(void)

{
  SetUnhandledExceptionFilter(FUN_14035ab70);
  return 0;
}



void __cdecl _amsg_exit(int param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014035abcc. Too many branches
                    // WARNING: Treating indirect jump as call
  _amsg_exit(param_1);
  return;
}



void FUN_14035abd4(void)

{
  undefined8 *puVar1;
  
  for (puVar1 = &DAT_14052b1c8; puVar1 < &DAT_14052b1c8; puVar1 = puVar1 + 1) {
    if ((code *)*puVar1 != (code *)0x0) {
      (*(code *)*puVar1)();
    }
  }
  return;
}



void FUN_14035ac0c(void)

{
  undefined8 *puVar1;
  
  for (puVar1 = &DAT_14052b1d8; puVar1 < &DAT_14052b1d8; 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 0x00014035ac44. 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 0x00014035ad12. Too many branches
                    // WARNING: Treating indirect jump as call
  _initterm();
  return;
}



void _initterm_e(void)

{
                    // WARNING: Could not recover jumptable at 0x00014035ad18. Too many branches
                    // WARNING: Treating indirect jump as call
  _initterm_e();
  return;
}



undefined8 FUN_14035ad20(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_1405d84f0 == 0x2b992ddfa232) {
    GetSystemTimeAsFileTime(&local_res8);
    _Var1 = local_res8;
    DVar2 = GetCurrentProcessId();
    DVar3 = GetCurrentThreadId();
    DVar4 = GetTickCount();
    QueryPerformanceCounter(&local_res10);
    DAT_1405d84f0 =
         (local_res10.QuadPart ^
         (ulonglong)_Var1 ^ (ulonglong)DVar2 ^ (ulonglong)DVar3 ^ (ulonglong)DVar4) & 0xffffffffffff
    ;
    if (DAT_1405d84f0 == 0x2b992ddfa232) {
      DAT_1405d84f0 = 0x2b992ddfa233;
    }
  }
  DAT_1405d84f8 = ~DAT_1405d84f0;
  return;
}



void __cdecl terminate(void)

{
                    // WARNING: Could not recover jumptable at 0x00014035add8. 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 0x00014035adde. 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 0x00014035ade4. Too many branches
                    // WARNING: Treating indirect jump as call
  _type_info_dtor_internal_method(this);
  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_14044e4d0;
  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_140607fc0 = 1;
    }
  }
  return this;
}



void FUN_14035af48(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 0x00014035af7b. 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 0x00014035afa0. 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_14044e4e0;
  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_14035b010(longlong param_1)

{
  LOCK();
  *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x20) + 1;
  UNLOCK();
  return param_1 + 0x10;
}



undefined8 * FUN_14035b01c(undefined8 *param_1,byte param_2)

{
  *param_1 = &PTR_Allocate_14044e508;
  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;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14035b110(undefined8 param_1)

{
                    // WARNING: Could not recover jumptable at 0x00014035b112. Too many branches
                    // WARNING: Treating indirect jump as call
  (*_DAT_1405d8550)(param_1,0);
  return;
}



LPSTR FUN_14035b120(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_14035b110(DVar3);
    }
    lpMultiByteStr = operator_new((longlong)iVar2);
    if (lpMultiByteStr == (LPSTR)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14035b110(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_14035b110(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_14044e560;
  if (*(longlong **)(this + 0x10) != (longlong *)0x0) {
    (**(code **)(**(longlong **)(this + 0x10) + 0x10))();
  }
  if (*(HLOCAL *)(this + 0x18) != (HLOCAL)0x0) {
    LocalFree(*(HLOCAL *)(this + 0x18));
  }
  return;
}



void FUN_14035b270(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_14044e560;
  local_20 = param_1;
  local_18 = param_2;
                    // WARNING: Subroutine does not return
  _CxxThrowException(&local_28,(ThrowInfo *)&DAT_1405d3518);
}



// 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_14044e560;
  *(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_14035b2f0(undefined8 *param_1,uint param_2)

{
  *param_1 = &PTR_FUN_14044e560;
  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 FUN_14035b350(longlong param_1)

{
  undefined1 local_58 [88];
  
  if ((*(int *)(param_1 + 0x2c) == 0) &&
     ((*(int *)(param_1 + 0x28) < 2 || (4 < *(int *)(param_1 + 0x28))))) {
    FUN_14034f420(local_58,L"RMI messaging cannot have Engine level priority!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  return;
}



undefined1 * FUN_14035b390(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_1405d8138;
  uVar1 = DAT_1405d8148;
  *(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_14035b3e0(undefined8 *param_1)

{
  *param_1 = Proud::INetCoreEvent::vftable;
  return;
}



undefined8 * FUN_14035b3f0(undefined8 *param_1)

{
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8010;
  *(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_14035b460(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  
  uVar1 = 0xfffffffffffffffe;
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8010;
  FUN_14034fe70();
  param_1[1] = PTR_DAT_1405d8010;
  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_1405d8145;
  *(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_14012c550(param_1 + 0x11,0,0,param_4,uVar1);
  return param_1;
}



void FUN_14035b550(void)

{
  HANDLE hProcess;
  
  MessageBoxW((HWND)0x0,L"Library and header files version mismatch!",L"ProudNet",0x10);
  hProcess = GetCurrentProcess();
                    // WARNING: Could not recover jumptable at 0x00014035b582. Too many branches
                    // WARNING: Treating indirect jump as call
  TerminateProcess(hProcess,1);
  return;
}



undefined8 * FUN_14035b590(void)

{
  bool bVar1;
  char cVar2;
  undefined8 uVar3;
  undefined1 local_20 [24];
  
  bVar1 = false;
  cVar2 = FUN_14034ede0(&DAT_1405f2620);
  if (cVar2 != '\0') {
    if (DAT_1405d8880 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_14034ed40(&DAT_1405f2620);
    }
  }
  if ((DAT_1405f2618 & 1) == 0) {
    DAT_1405f2618 = DAT_1405f2618 | 1;
    uVar3 = FUN_140352e50(local_20);
    DAT_1405f2610 = FUN_140352dc0(uVar3);
    atexit(FUN_140449400);
  }
  DAT_1405d8880 = 0;
  if (bVar1) {
    FUN_14034edd0(&DAT_1405f2620);
  }
  return &DAT_1405f2610;
}



void FUN_14035b640(undefined8 param_1)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_14035b590();
                    // WARNING: Could not recover jumptable at 0x00014035b65c. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)*puVar1 + 0x10))((longlong *)*puVar1,param_1);
  return;
}



wchar_t * FUN_14035b660(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_14035b860(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_14035ba60(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_14035bc60(undefined4 param_1)

{
  int *piVar1;
  
  piVar1 = (int *)thunk_FUN_14034fb60();
  if (*piVar1 == 0x52) {
    FUN_14035b660(param_1);
    return;
  }
  if (*piVar1 != 0x56) {
    FUN_14035b860();
    return;
  }
  FUN_14035ba60(param_1);
  return;
}



undefined8 * FUN_14035bca0(undefined8 *param_1)

{
  FUN_14034fe70();
  param_1[2] = PTR_DAT_1405d8010;
  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_14034fe70();
  param_1[0xb] = PTR_DAT_1405d8010;
  *param_1 = 0;
  param_1[1] = 0;
  *(undefined4 *)(param_1 + 4) = DAT_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x24) = DAT_1405d83d4;
  *(undefined4 *)(param_1 + 10) = 0;
  return param_1;
}



longlong FUN_14035bd40(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  
  iVar1 = *(int *)(param_2 + 0x18);
  if (-1 < iVar1) {
    FUN_1400179d0(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_14000d3f0(uVar2,uVar3,(longlong)iVar1);
    return param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



// WARNING: Removing unreachable block (ram,0x00014035be96)
// WARNING: Removing unreachable block (ram,0x00014035bea4)

void FUN_14035bda0(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_14034ed40(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034ed40(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_14034edd0(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034edd0(uVar3);
    }
    if (uVar4 != 0) {
      FUN_14012c7d0(uVar4);
    }
  }
  return;
}



longlong *
FUN_14035bed0(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_14034fef0(0x60);
  puVar3 = puVar5;
  if (lVar2 != 0) {
    puVar3 = (undefined4 *)FUN_14035bca0(lVar2);
  }
  FUN_14012c880(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_1400179d0(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_14000d3f0(puVar5,puVar4,(longlong)iVar1);
    return param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



undefined8 * FUN_14035bff0(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_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  iVar2 = *param_1;
  piVar3 = (int *)thunk_FUN_14034fb60();
  if (*piVar3 == 0x52) {
    uVar4 = FUN_14035b660(iVar2);
  }
  else if (*piVar3 == 0x56) {
    uVar4 = FUN_14035ba60(iVar2);
  }
  else {
    uVar4 = FUN_14035b860();
  }
  FUN_140017720(param_2,L"Error=%s",uVar4);
  if ((*param_1 != param_1[1]) && (param_1[1] != 0)) {
    FUN_14034fe70();
    local_res18 = PTR_DAT_1405d8010;
    iVar2 = param_1[1];
    piVar3 = (int *)thunk_FUN_14034fb60();
    if (*piVar3 == 0x52) {
      uVar4 = FUN_14035b660(iVar2);
    }
    else if (*piVar3 == 0x56) {
      uVar4 = FUN_14035ba60(iVar2);
    }
    else {
      uVar4 = FUN_14035b860();
    }
    FUN_140017720(&local_res18,L", Detail=%s",uVar4);
    FUN_140017520(param_2,&local_res18);
    puVar6 = local_res18;
    if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_60 = uVar4;
      FUN_14034ed40(uVar4);
      local_58 = 1;
      piVar3 = (int *)(puVar6 + -4);
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar4);
    }
  }
  if (param_1[2] != 0) {
    FUN_14034fe70();
    local_res20 = PTR_DAT_1405d8010;
    FUN_140017720(&local_res20,L", SocketError=%d",param_1[2]);
    FUN_140017520(param_2,&local_res20);
    puVar6 = local_res20;
    if (((local_res20 != (undefined *)0x0) && (local_res20 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_res20 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_80 = uVar4;
      FUN_14034ed40(uVar4);
      local_78 = 1;
      piVar3 = (int *)(puVar6 + -4);
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar4);
    }
  }
  if (param_1[3] != 0) {
    FUN_14034fe70();
    local_d0 = PTR_DAT_1405d8010;
    FUN_140017720(&local_d0,L", HostID=%d",param_1[3]);
    FUN_140017520(param_2,&local_d0);
    if ((param_1[8] != -1) && (param_1[8] != 0)) {
      FUN_14034fe70();
      local_c8 = PTR_DAT_1405d8010;
      plVar5 = (longlong *)(*(code *)**(undefined8 **)(param_1 + 6))(param_1 + 6,&local_b0);
      puVar6 = (undefined *)*plVar5;
      if ((undefined *)*plVar5 == (undefined *)0x0) {
        puVar6 = PTR_DAT_1405d8010;
      }
      FUN_140017720(&local_c8,L", remoteAddr=%s",puVar6);
      if (((local_b0 != (undefined *)0x0) && (local_b0 != PTR_DAT_1405d8010)) &&
         (local_b0 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_a0 = uVar4;
        FUN_14034ed40(uVar4);
        local_98 = 1;
        piVar3 = (int *)(local_b0 + -4);
        *piVar3 = *piVar3 + -1;
        if (*piVar3 == 0) {
          FUN_14034ff60(local_b0 + -8);
        }
        FUN_14034edd0(uVar4);
      }
      FUN_140017520(param_2,&local_c8);
      puVar6 = local_c8;
      if (((local_c8 != (undefined *)0x0) && (local_c8 != PTR_DAT_1405d8010)) &&
         (puVar1 = local_c8 + -8, puVar1 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_90 = uVar4;
        FUN_14034ed40(uVar4);
        local_88 = 1;
        piVar3 = (int *)(puVar6 + -4);
        *piVar3 = *piVar3 + -1;
        if (*piVar3 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar4);
      }
    }
    puVar6 = local_d0;
    if (((local_d0 != (undefined *)0x0) && (local_d0 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_d0 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_70 = uVar4;
      FUN_14034ed40(uVar4);
      local_68 = 1;
      piVar3 = (int *)(puVar6 + -4);
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar4);
    }
  }
  puVar6 = *(undefined **)(param_1 + 4);
  if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1405d8010)) && (0 < *(int *)(puVar6 + -8))
     ) {
    FUN_1403070c0(&local_c0);
    FUN_140017790(param_2,&DAT_14047edb0);
    FUN_140017790(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_14034fe70();
    local_d8 = PTR_DAT_1405d8010;
    FUN_140017720(&local_d8,L", HRESULT = %d",param_1[0x14]);
    FUN_140017520(param_2,&local_d8);
    puVar6 = local_d8;
    if (((local_d8 != (undefined *)0x0) && (local_d8 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_d8 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_50 = uVar4;
      FUN_14034ed40(uVar4);
      local_48 = 1;
      piVar3 = (int *)(puVar6 + -4);
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar4);
    }
  }
  puVar6 = *(undefined **)(param_1 + 0x16);
  if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1405d8010)) && (0 < *(int *)(puVar6 + -8))
     ) {
    FUN_1403070c0(&local_b8);
    FUN_140017790(param_2,&DAT_14047edb0);
    FUN_140017790(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_14035c470(undefined8 *param_1)

{
  *param_1 = Proud::IRmiHost::vftable;
  return;
}



void FUN_14035c480(undefined8 *param_1)

{
  *param_1 = Proud::ICompletionContext::vftable;
  return;
}



undefined8 * FUN_14035c490(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_14035c4c0(undefined8 *param_1)

{
  *param_1 = Proud::ICompletionPortEventSink::vftable;
  return;
}



undefined8 * FUN_14035c4d0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::ICompletionPortEventSink::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void thunk_FUN_14034ff60(LPVOID param_1)

{
  HANDLE hHeap;
  
  hHeap = GetProcessHeap();
                    // WARNING: Could not recover jumptable at 0x00014034ff7c. Too many branches
                    // WARNING: Treating indirect jump as call
  HeapFree(hHeap,0,param_1);
  return;
}



void FUN_14035c510(undefined8 *param_1)

{
  *param_1 = Proud::ISendDest_S::vftable;
  return;
}



undefined8 * FUN_14035c520(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_14035c550(undefined8 *param_1)

{
  *param_1 = Proud::IUserTaskQueueOwner::vftable;
  return;
}



undefined8 * FUN_14035c560(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_14035c590(undefined8 *param_1)

{
  *param_1 = Proud::IVizAgentDg::vftable;
  return;
}



undefined8 * FUN_14035c5a0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IVizAgentDg::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



longlong FUN_14035c5d0(longlong param_1)

{
  return param_1 + 0x128;
}



void thunk_FUN_140386a50(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_14034f800();
      }
      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_140386afd:
        if ((uVar8 <= uVar9) || ((uVar3 <= uVar9 && (uVar9 <= uVar8)))) goto LAB_140386bd2;
        if (uVar3 <= uVar4) goto LAB_140386b1a;
      }
      else {
        if (uVar9 <= uVar8) goto LAB_140386bd2;
        if (uVar4 <= uVar3) goto LAB_140386afd;
LAB_140386b1a:
        if ((uVar4 <= uVar8) && (uVar8 <= uVar9)) {
LAB_140386bd2:
          FUN_14034f420(auStack_78,PTR_u_Duplicated_RMI_ID_is_found__Revi_1405d9000);
                    // WARNING: Subroutine does not return
          _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      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_140394870(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_1403a2c90(param_1 + 0x30);
        lVar6 = FUN_1403a2c90(param_1 + 0x30);
        *(undefined8 *)(lVar6 + lVar11) = *(undefined8 *)(lVar5 + -8 + lVar11);
        lVar11 = lVar11 + -8;
        lVar13 = lVar13 + -1;
      } while (-1 < lVar13);
    }
    lVar13 = FUN_1403a2c90(param_1 + 0x30);
    *(longlong **)(lVar13 + (longlong)iVar12 * 8) = param_2;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



undefined8 FUN_14035c5f0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x758);
}



void FUN_14035c600(longlong param_1)

{
  FUN_1403555d0(param_1 + 0x3d0);
  return;
}



undefined8 FUN_14035c610(void)

{
  return 0xfa14;
}



undefined1 FUN_14035c620(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x380);
}



void FUN_14035c630(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x380) = param_2;
  return;
}



void FUN_14035c640(longlong param_1)

{
  FUN_14035a290(param_1 + 0x6b8);
  return;
}



void FUN_14035c650(longlong param_1,int param_2)

{
  undefined1 local_58 [88];
  
  if (param_2 == 3) {
    FUN_14034f420(local_58,L"Not supported value yet!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  *(int *)(param_1 + 0x180) = param_2;
  return;
}



void FUN_14035c690(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_14034f7d0();
}



void FUN_14035c6c0(longlong *param_1,int param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014035c6d3. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x178))(param_1,(double)param_2 / 1000.0);
  return;
}



undefined4 FUN_14035c6e0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x178);
}



void FUN_14035c6f0(longlong param_1,undefined8 param_2)

{
  char cVar1;
  undefined1 local_58 [80];
  
  cVar1 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x90))();
  if (cVar1 != '\0') {
    FUN_14034f420(local_58,PTR_u_Already_async_callback_may_occur_1405d9010);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  *(undefined8 *)(param_1 + 0x6b0) = param_2;
  return;
}



undefined4 FUN_14035c750(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x22c);
}



void FUN_14035c760(longlong param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  iVar1 = DAT_1405d8190;
  if (param_2 < DAT_1405d8190) {
    iVar1 = param_2;
  }
  iVar2 = 0;
  if (0 < iVar1) {
    iVar2 = iVar1;
  }
  *(int *)(param_1 + 0x194) = iVar2;
  return;
}



undefined1 FUN_14035c780(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x198);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14035c790(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_1405d84f0 ^ (ulonglong)auStack_c8;
  FUN_140388f20(local_98);
  local_20 = param_1;
  FUN_140385b50(local_98);
  FUN_140388f60(local_98);
  return;
}



void FUN_14035c800(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_14035c8e0(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_1405d83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  return param_2;
}



undefined8 * FUN_14035c960(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_1405d83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  return param_2;
}



undefined8 * FUN_14035c9e0(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_1405d83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  return param_2;
}



int FUN_14035ca60(longlong param_1)

{
  int iVar1;
  short *psVar2;
  longlong lVar3;
  
  iVar1 = 0;
  lVar3 = 2;
  psVar2 = (short *)(param_1 + 0x24);
  do {
    if ((*(int *)(psVar2 + -2) != DAT_1405d83d0) || (*psVar2 != DAT_1405d83d4)) {
      iVar1 = iVar1 + 1;
    }
    psVar2 = psVar2 + 0x18;
    lVar3 = lVar3 + -1;
  } while (lVar3 != 0);
  return iVar1;
}



void FUN_14035caa0(longlong param_1)

{
  FUN_1403555d0(param_1 + 0x148);
  FUN_1403555d0(param_1 + 0x120);
  return;
}



undefined1 FUN_14035cae0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 8);
}



void FUN_14035caf0(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_14035cc60;
    }
    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_1405d83d0;
    uVar6 = DAT_1405d83d4;
  } 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_1405d83d0;
    uVar6 = DAT_1405d83d4;
  } 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_1405d83d0;
    uVar6 = DAT_1405d83d4;
    if (1 < (longlong)uVar7) break;
LAB_14035cc60:
    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_1405d83d0;
    uVar6 = DAT_1405d83d4;
  } 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_14035cd50(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_1405d83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  return param_2;
}



undefined8 * FUN_14035cdd0(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_1405d83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  return param_2;
}



undefined8 * FUN_14035ce50(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_14035ce80(undefined1 *param_1)

{
  *param_1 = 1;
  return param_1;
}



int FUN_14035ce90(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_14034f7d0();
    }
    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;
}



void FUN_14035cf30(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if (*(longlong **)(param_2 + 0x120) != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if (*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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_14035d020(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_14034f7d0();
    }
    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 FUN_14035d0c0(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;
}



void FUN_14035d100(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_14034f420(local_58,L"CFastMap consistency error #0!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    lVar1 = *(longlong *)(param_1 + 0x10);
    lVar3 = lVar1;
    while (lVar3 != 0) {
      lVar2 = *(longlong *)(lVar3 + 0x10);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x18) != lVar3)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #1!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar3 == lVar1) && (*(longlong *)(lVar3 + 0x18) != 0)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #2!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar3 == *(longlong *)(param_1 + 0x18)) && (lVar2 != 0)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #3!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar2;
    }
    if (iVar4 != *(int *)(param_1 + 0x20)) {
      for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 0x10)) {
      }
      FUN_14034f420(local_58,L"CFastMap consistency error #4!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  return;
}



void FUN_14035d230(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if (*(longlong **)(param_2 + 0xa0) != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if (*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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_14035d320(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_14034f7d0();
    }
    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;
}



int FUN_14035d3c0(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_14034f7d0();
    }
    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_14035d460(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined4 local_res8 [2];
  
  cVar1 = FUN_1403840e0(param_1,local_res8,4);
  if (cVar1 != '\0') {
    *(undefined4 *)(param_2 + 8) = local_res8[0];
  }
  cVar1 = FUN_1403840e0(param_1,local_res8,2);
  if (cVar1 != '\0') {
    *(undefined2 *)(param_2 + 0xc) = (undefined2)local_res8[0];
  }
  return param_1;
}



undefined1 FUN_14035d4c0(longlong param_1)

{
  char cVar1;
  
  cVar1 = FUN_1403953f0();
  if ((cVar1 != '\0') && ((*(char *)(param_1 + 0x3f8) != '\0' || (*(int *)(param_1 + 1000) != 0))))
  {
    return 1;
  }
  return 0;
}



ulonglong FUN_14035d500(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_14034ed40(uVar2);
  if (DAT_1405f064f != '\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_14034edd0(uVar2);
  return uVar1 & 0xffffffff;
}



ulonglong FUN_14035d590(longlong param_1)

{
  ulonglong in_RAX;
  ulonglong uVar1;
  
  if (*(longlong *)(param_1 + 0x3e0) == 0) {
    return in_RAX & 0xffffffffffffff00;
  }
  uVar1 = FUN_140388770();
  return uVar1;
}



undefined8 * FUN_14035d5c0(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IRmiHost::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



bool FUN_14035d5f0(longlong param_1)

{
  return *(longlong *)(param_1 + 0x3f8) == 0;
}



ulonglong FUN_14035d600(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_14034ed40(uVar2);
  if (DAT_1405f064f != '\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_14034edd0(uVar2);
  return uVar1 & 0xffffffff;
}



void FUN_14035d690(longlong param_1,int param_2)

{
  int iVar1;
  undefined8 uVar2;
  
  if (param_2 < 0x81) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  uVar2 = FUN_140350040();
  FUN_14034ed40(uVar2);
  iVar1 = param_2;
  if (param_2 < DAT_1405d8140) {
    iVar1 = DAT_1405d8140;
  }
  DAT_1405d8140 = iVar1;
  FUN_14034edd0(uVar2);
  *(int *)(param_1 + 0x184) = param_2;
  return;
}



void FUN_14035d700(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_14034fa20(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_14034ed40(uVar1);
    if (DAT_1405f064f != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::SetDefaultTimeoutTimeSec");
    }
    FUN_140385fa0(param_1 + -0xa8,param_2);
    *(double *)(param_1 + 0x188) = param_2;
    FUN_14034edd0(uVar1);
  }
  else {
    FUN_14034fa20(L"Too short timeout value. It may cause unfair disconnection.",in_RDX,param_3,
                  param_4,0xfffffffffffffffe);
  }
  return;
}



undefined8 FUN_14035d7f0(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_14034ed40(uVar1);
  if (DAT_1405f064f != '\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_14034f7d0();
  }
  *(int *)(param_1 + 400) = param_2;
  FUN_14034edd0(uVar1);
  return 1;
}



undefined8 * FUN_14035d890(longlong param_1,undefined8 *param_2)

{
  if ((*(longlong **)(param_1 + 0x6a0) != (longlong *)0x0) &&
     (**(longlong **)(param_1 + 0x6a0) != 0)) {
    FUN_140354860();
    return param_2;
  }
  *param_2 = Proud::AddrPort::vftable;
  *(undefined4 *)(param_2 + 1) = DAT_1405d83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  return param_2;
}



undefined1 FUN_14035d8f0(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_14034ed40(uVar3);
  lVar1 = *(longlong *)(param_1 + 0x78);
  uVar2 = (**(code **)(lVar1 + 0x18))
                    ((longlong *)(param_1 + 0x78),param_2,lVar1,param_4,uVar4,uVar5,1);
  FUN_14034edd0(uVar3);
  return uVar2;
}



bool FUN_14035d960(longlong param_1)

{
  return *(longlong *)(param_1 + 0x3e0) != 0;
}



void FUN_14035d970(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_14034ed40(uVar2);
  if (DAT_1405f064f != '\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_14034f420(local_50,L"Cannot set AllowEmptyP2PGroup after the server has started.");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  *(undefined1 *)(param_1 + 0x1758) = param_2;
  FUN_14034edd0(uVar2);
  return;
}



void FUN_14035da50(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_140399130(pvVar1,param_1 + 0x118,param_2,param_3,param_4);
    }
    *(undefined8 *)(param_1 + 0x58) = uVar2;
  }
  return;
}



bool FUN_14035dad0(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_14034ed40(uVar1);
  if (DAT_1405f064f != '\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_14034edd0(uVar1);
  }
  else {
    FUN_14034edd0(uVar1);
  }
  return lVar2 != 0;
}



ulonglong FUN_14035db90(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_14035dcb0(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 0x00014035dcd7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void FUN_14035dcf0(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_14035ce90();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_14034fef0(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_14034fef0(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_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_14034ff60(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_14035de80(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1403596c0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14035deb0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_14038e820(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14035dee0(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 0x00014035df07. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void FUN_14035df20(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 0x00014035df47. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void FUN_14035df60(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_14034fef0((longlong)iVar5 << 2);
      }
      else {
        lVar4 = (**(code **)(*plVar2 + 8))(plVar2,(longlong)iVar5 << 2);
      }
    }
    else {
      if (plVar2 == (longlong *)0x0) {
        lVar4 = FUN_14034ff20(*(undefined8 *)(param_1 + 0x10),(longlong)iVar5 << 2);
      }
      else {
        lVar4 = (**(code **)(*plVar2 + 0x10))
                          (plVar2,*(undefined8 *)(param_1 + 0x10),(longlong)iVar5 << 2);
      }
      if (lVar4 == 0) {
        FUN_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    *(longlong *)(param_1 + 0x10) = lVar4;
    *(int *)(param_1 + 0x1c) = iVar5;
  }
  return;
}



void FUN_14035e020(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_140394590(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_14035e050(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 0x00014035e077. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 * FUN_14035e090(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14035e0f0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14035e150(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14035e1b0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14035e210(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_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14035e270(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14035e2d0(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_1403a2c90(param_1);
        lVar3 = lVar3 + (longlong)param_3 * 0x18;
        lVar4 = FUN_1403a2c90(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_14035e7a0(param_1,*(int *)(param_1 + 0x18) - param_3);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_14035e390(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_14034f7d0();
  }
  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_14034f7d0();
    }
    pvVar4 = operator_new(lVar7 << 5);
    puVar2 = param_1 + 4;
    if (100 < (ulonglong)param_1[2]) {
      puVar2 = (undefined8 *)*param_1;
    }
    FUN_14035d0c0(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_14035e580(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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      param_1[1] = lVar3;
    }
    if (lVar3 == 0) {
      if (*param_1 != lVar1) {
        FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      *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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                L"Proud::CListNode<class Proud::CRemoteClient_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14035e690(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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      param_1[1] = lVar3;
    }
    if (lVar3 == 0) {
      if (*param_1 != lVar1) {
        FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      *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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                L"Proud::CListNode<class Proud::CUdpSocket_S>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14035e7a0(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_14035d320();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_14034fef0(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_14034fef0(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_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_14034ff60(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_14035e910(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_14034f7d0();
  }
  iVar8 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar8) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar8 = FUN_14035d3c0(param_1);
      plVar1 = *(longlong **)(param_1 + 8);
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          puVar5 = (undefined8 *)FUN_14034fef0((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_14034fef0((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_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_14034ff60(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_14035eb50(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_14034f420(local_58,L"CFastMap consistency error #0!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    lVar1 = *(longlong *)(param_1 + 0x10);
    lVar3 = lVar1;
    while (lVar3 != 0) {
      lVar2 = *(longlong *)(lVar3 + 8);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x10) != lVar3)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #1!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar3 == lVar1) && (*(longlong *)(lVar3 + 0x10) != 0)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #2!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar3 == *(longlong *)(param_1 + 0x18)) && (lVar2 != 0)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #3!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar2;
    }
    if (iVar4 != *(int *)(param_1 + 0x20)) {
      for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 8)) {
      }
      FUN_14034f420(local_58,L"CFastMap consistency error #4!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  return;
}



void FUN_14035ec80(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_14034f420(local_58,L"CFastMap consistency error #0!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    lVar1 = *(longlong *)(param_1 + 0x10);
    lVar3 = lVar1;
    while (lVar3 != 0) {
      lVar2 = *(longlong *)(lVar3 + 0x18);
      if ((lVar2 != 0) && (*(longlong *)(lVar2 + 0x20) != lVar3)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #1!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar3 == lVar1) && (*(longlong *)(lVar3 + 0x20) != 0)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #2!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar3 == *(longlong *)(param_1 + 0x18)) && (lVar2 != 0)) {
        FUN_14034f420(local_58,L"CFastMap consistency error #3!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      iVar4 = iVar4 + 1;
      lVar3 = lVar2;
    }
    if (iVar4 != *(int *)(param_1 + 0x20)) {
      for (; lVar1 != 0; lVar1 = *(longlong *)(lVar1 + 0x18)) {
      }
      FUN_14034f420(local_58,L"CFastMap consistency error #4!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  return;
}



void FUN_14035edb0(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_14035e7a0(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_1403a2c90(param_1);
        lVar2 = lVar8 * -0x18 + lVar2;
        lVar3 = FUN_1403a2c90(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_1403a2c90(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_14034f7d0();
}



void FUN_14035eed0(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_14034f7d0();
  }
  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_14034f7d0();
  }
  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_14035f030(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_14035e910(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_1403a2c90(param_1);
        lVar1 = lVar1 + lVar7 * -0x10;
        lVar2 = FUN_1403a2c90(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_1403a2c90(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_14034f7d0();
}



void FUN_14035f140(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_1403d7ac0();
  }
  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_14034fef0((ulonglong)param_2 << 3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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_14034ff60(*(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_14035eb50(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_14035f390(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_1403d7ac0();
  }
  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_14034fef0((ulonglong)param_2 << 3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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_14034ff60(*(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_14035d100(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_14035f5e0(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_14034ff60();
    *(undefined8 *)(param_1 + 8) = 0;
  }
  if (param_3 != '\0') {
    _Size = (ulonglong)param_2 << 3;
    _Dst = (void *)FUN_14034fef0(_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_14035f6d0(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_14035d020();
      plVar1 = *(longlong **)(param_1 + 8);
      lVar3 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_14034fef0(lVar3 << 2);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar3 << 2);
        }
      }
      else {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_14034ff20(*(undefined8 *)(param_1 + 0x10),lVar3 << 2);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,*(undefined8 *)(param_1 + 0x10),lVar3 << 2);
        }
        if (lVar3 == 0) {
          FUN_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      *(longlong *)(param_1 + 0x10) = lVar3;
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_14035f7a0(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_1403d7ac0();
  }
  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_14034fef0((ulonglong)param_2 << 3);
      if (_Dst == (void *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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_14034ff60(*(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_14035ec80(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_14035f9f0(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 0x00014035fa17. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void * FUN_14035fa30(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_1405d3608);
}



void FUN_14035faa0(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_14035faa0(param_1,iVar7 + -2,uVar5 & 0xffffffff);
        uVar5 = uVar9;
        local_28 = uVar4;
      }
      else {
        FUN_14035faa0(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_14035fbb0(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_140399790();
}



longlong FUN_14035fbe0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = param_1[1];
  if (lVar1 == 0) {
    lVar1 = *param_1;
    if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    if (*(int *)(lVar1 + 0x18) != 0) {
      return *(longlong *)(lVar1 + 0x10);
    }
    lVar1 = 0;
  }
  return lVar1;
}



undefined4 FUN_14035fc20(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_140399790();
}



void FUN_14035fc50(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 0x00014035fc77. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 FUN_14035fc90(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_14035fcf0(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_14035fd48;
    }
  }
  lVar2 = 0;
LAB_14035fd48:
  if (lVar2 != 0) {
    return *(undefined8 *)(lVar2 + 0x10);
  }
  return 0;
}



undefined8 * FUN_14035fd60(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_1405d83d0;
  puVar2 = param_1 + 0xe;
  *(undefined2 *)((longlong)param_1 + 0x24) = DAT_1405d83d4;
  *(undefined4 *)(param_1 + 6) = DAT_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x34) = DAT_1405d83d4;
  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_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x54) = DAT_1405d83d4;
  *(undefined4 *)(param_1 + 0xc) = DAT_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 100) = DAT_1405d83d4;
  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_1405d83d0;
    puVar2 = puVar2 + 9;
    iVar3 = iVar3 + -1;
    *puVar1 = DAT_1405d83d4;
    *(undefined4 *)(puVar1 + 6) = DAT_1405d83d0;
    puVar1[8] = DAT_1405d83d4;
    *(undefined4 *)(puVar1 + 0xe) = DAT_1405d83d0;
    puVar1[0x10] = DAT_1405d83d4;
    *(undefined4 *)(puVar1 + 0x16) = DAT_1405d83d0;
    puVar1[0x18] = DAT_1405d83d4;
    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_14035ff70(longlong *param_1)

{
  if (*param_1 != 0) {
    if (*(int *)((longlong)param_1 + 0xc) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 1) = 0;
  }
  return;
}



void thunk_FUN_14035e580(void)

{
  FUN_14035e580();
  return;
}



void thunk_FUN_14035e690(void)

{
  FUN_14035e690();
  return;
}



undefined4 * FUN_14035ffc0(longlong *param_1,longlong param_2,undefined4 param_3)

{
  undefined4 *puVar1;
  longlong lVar2;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (param_1[1] <= param_2) {
    FUN_14035eed0(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_14034f7d0();
}



void FUN_140360040(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_14035f6d0(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_14000d3f0(lVar1 + lVar2 * 4,param_3,(longlong)param_4 << 2);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_140360100(longlong param_1,longlong param_2,char param_3)

{
  undefined4 uVar1;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(longlong **)(param_1 + 0x50) == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar1);
  }
  return;
}



void FUN_140360170(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_14000d450(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_140360100(param_1,param_2,param_3);
  FUN_14035d100(param_1);
  return;
}



undefined1 FUN_140360270(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined1 uVar2;
  ulonglong local_res18 [2];
  
  cVar1 = FUN_140384780(param_1,local_res18);
  if (cVar1 == '\0') {
    return 0;
  }
  if ((-1 < (int)local_res18[0]) && ((int)local_res18[0] <= DAT_1405d8140)) {
    FUN_1400179d0(param_2,local_res18[0] & 0xffffffff);
    if (*(int *)(param_2 + 0x18) == 0) {
      uVar2 = FUN_1403840e0(param_1,0,local_res18[0] & 0xffffffff);
      return uVar2;
    }
    uVar2 = FUN_1403840e0(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_140360310(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_1405d84f0 ^ (ulonglong)local_18;
  if ((ulonglong)param_1[2] < 0x65) {
    plVar4 = param_1 + 4;
  }
  else {
    plVar4 = (longlong *)*param_1;
  }
  FUN_14035faa0(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_1403603c0;
    *puVar3 = 0xcccc;
    puVar9 = auStack_38 + lVar1;
  }
  else {
    puVar3 = malloc(uVar5);
    puVar12 = (undefined4 *)0x0;
    if (puVar3 == (undefined4 *)0x0) goto LAB_1403603c0;
    *puVar3 = 0xdddd;
    puVar9 = auStack_38;
  }
  puVar12 = puVar3 + 4;
LAB_1403603c0:
  uVar5 = param_1[1];
  uVar13 = 0;
  uVar6 = uVar13;
  uVar10 = uVar13;
  uVar11 = uVar13;
  if (uVar5 != 0) {
    do {
      if (uVar10 == 0) {
LAB_140360407:
        if (((longlong)uVar6 < 0) || (param_1[1] <= (longlong)uVar6)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar9 + -8) = &UNK_140360484;
          FUN_14034f7d0();
        }
        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_14036047e;
          FUN_14034f7d0();
        }
        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_140360407;
      }
      uVar6 = uVar6 + 1;
      uVar10 = uVar11;
    } while (uVar6 < uVar5);
  }
  *(undefined8 *)(puVar9 + -8) = 0x140360447;
  FUN_14035eed0(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_1403604db;
        FUN_14034f7d0();
      }
      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) = 0x1403604b4;
    free(puVar12 + -4);
  }
  *(undefined8 *)(puVar9 + -8) = 0x1403604c0;
  return;
}



void FUN_1403604e0(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_1403604e0(param_1,uVar10 - 2,local_res18);
        local_res18 = uVar10;
        local_28 = uVar7;
      }
      else {
        FUN_1403604e0(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_1403606a0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined1 local_50 [80];
  
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_14034f420(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8,param_3,param_4,
                  0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*(int *)(param_1 + 0xc8c) < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(undefined4 *)(param_1 + 0xc88) = 0;
  if (*(longlong *)(param_1 + 0xc80) != 0) {
    if (*(int *)(param_1 + 0xc8c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0xc88) = 0;
  }
  return;
}



void FUN_140360720(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_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0xc88);
  if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  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_14034f7d0();
}



void FUN_1403607b0(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_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar2 = *(int *)(param_2 + 0xc88);
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar3 = *(int *)(param_1 + 0xc88);
  iVar5 = iVar3 + iVar2;
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if ((-1 < iVar5) && (iVar5 <= *(int *)(param_1 + 0xc8c))) {
    *(int *)(param_1 + 0xc88) = iVar5;
    if (*(longlong *)(param_1 + 0xc80) == 0) {
      FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (*(longlong *)(param_2 + 0xc80) == 0) {
      FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    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_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        if (((longlong)uVar7 < 0) || (*(int *)(param_2 + 0xc88) <= (int)uVar6)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        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_14034f7d0();
}



void FUN_140360960(longlong param_1)

{
  FUN_140399690(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return;
}



void FUN_1403609b0(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_1405d8010;
    }
    FUN_1403935f0(*(longlong *)(param_1 + 0x1790),0,puVar1,param_4,0xfffffffffffffffe);
  }
  FUN_1400031d0(param_3);
  return;
}



undefined4 FUN_140360a00(longlong param_1,longlong param_2)

{
  ushort uVar1;
  uint uVar2;
  longlong lVar3;
  ulonglong uVar4;
  char cVar5;
  
  if ((*(int *)(param_2 + 8) == 0) || (cVar5 = FUN_140352ee0(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_140360a83;
        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_140360a83:
    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_140360b10(longlong param_1)

{
  FUN_1400031d0(param_1 + 8);
  return;
}



void FUN_140360b20(void)

{
  FUN_14039c160();
  return;
}



void FUN_140360b40(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_14034f7d0();
  }
  FUN_14035eed0(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_14034f7d0();
      }
      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_140360bd0(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_14035eb50();
  lVar4 = *(longlong *)(param_1 + 0x10);
  while (lVar4 != 0) {
    plVar1 = *(longlong **)(param_1 + 0x50);
    lVar5 = *(longlong *)(lVar4 + 8);
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_14034ff60(*(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_14035eb50(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035eb50(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_140360d00(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_14035ec80();
  lVar4 = *(longlong *)(param_1 + 0x10);
  while (lVar4 != 0) {
    plVar1 = *(longlong **)(param_1 + 0x50);
    lVar5 = *(longlong *)(lVar4 + 0x18);
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_14034ff60(*(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_14035ec80(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035ec80(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_140360e30(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1403555d0((longlong)pvVar1 + 0x148);
    FUN_1403555d0((longlong)pvVar1 + 0x120);
    operator_delete(pvVar1);
  }
  FUN_14034ff60(param_1);
  return;
}



void FUN_140360e90(longlong param_1)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_1 + 0x38);
  if (pvVar1 != (void *)0x0) {
    FUN_140394c00(pvVar1);
    operator_delete(pvVar1);
  }
  FUN_14034edf0(param_1);
  FUN_14034ff60(param_1);
  return;
}



undefined4 * FUN_140360ee0(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_14034fef0(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_14035eb50(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_14035eb50(param_1);
    FUN_14035eb50(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_14035eb50(param_1);
  FUN_14035eb50(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_1403d7ac0(param_1);
    FUN_14035f140(param_1,uVar4);
  }
  FUN_14035eb50(param_1);
  return puVar5;
}



undefined4 * FUN_140361020(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_14034fef0(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_14035ec80(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_14035ec80(param_1);
    FUN_14035ec80(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_14035ec80(param_1);
  FUN_14035ec80(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_1403d7ac0(param_1);
    FUN_14035f7a0(param_1,uVar4);
  }
  FUN_14035ec80(param_1);
  return puVar5;
}



undefined8 * FUN_140361160(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_14034fef0(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_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar4);
  }
  FUN_14035d100(param_1);
  return puVar5;
}



longlong * FUN_1403612a0(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_14034fef0(0x48);
    if (lVar2 != 0) {
      uVar1 = FUN_1403c0cc0();
      FUN_14034ec60(lVar2,uVar1,1,param_4,uVar3);
    }
    *param_1 = lVar2;
    FUN_14034ed40(lVar2);
    *(undefined8 *)(*param_1 + 0x40) = 1;
    *(longlong *)(*param_1 + 0x38) = param_2;
    FUN_14034edd0(lVar2);
  }
  return param_1;
}



undefined8 * FUN_140361340(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_140361360(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_14035fa30(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_140361500(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_140399790();
    }
    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_140399790(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_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  FUN_140360720(param_1,lVar3);
  return param_1;
}



undefined8 FUN_1403615c0(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_14035f6d0(param_3);
  uVar5 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_14034ed40(uVar5);
  if (DAT_1405f064f != '\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_14034edd0(uVar5);
            return 1;
          }
          uVar1 = *puVar10;
          iVar2 = *(int *)(param_3 + 0x18);
          lVar9 = (longlong)iVar2;
          if (iVar2 < 0) break;
          iVar8 = *(int *)(param_3 + 0x18);
          FUN_14035f6d0(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_14034f7d0();
      }
    }
  }
  FUN_14034edd0(uVar5);
  return 0;
}



void FUN_140361750(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_14034ed40(uVar3);
  if (DAT_1405f064f != '\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_1405f2490);
    }
  }
  FUN_14034edd0(uVar3);
  return;
}



longlong FUN_140361850(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_1403618c0(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_14034edd0(uVar4);
          return uVar1;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar4);
  return 0xbff0000000000000;
}



undefined8 FUN_1403619d0(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_14034edd0(uVar4);
          return uVar1;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar4);
  return 0xbff0000000000000;
}



int FUN_140361ae0(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_14034ed40(uVar1);
  if (DAT_1405f064f != '\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_14000d450(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_14034edd0(uVar1);
  return iVar3;
}



undefined8 FUN_140361be0(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_14034ed40(uVar4);
  uVar7 = 1;
  if (DAT_1405f064f != '\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_140361cba;
      if (*puVar2 == param_2) break;
      puVar2 = *(uint **)(puVar2 + 4);
    }
    if (*(longlong *)(puVar2 + 2) != 0) {
      FUN_140399ee0(*(longlong *)(puVar2 + 2),param_3,uVar3,(ulonglong)uVar1,uVar5,uVar6,uVar7);
      FUN_14034edd0(uVar4);
      return 1;
    }
  }
LAB_140361cba:
  FUN_14034edd0(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,0x0001403621cb)
// WARNING: Removing unreachable block (ram,0x00014036206f)
// WARNING: Removing unreachable block (ram,0x00014036232b)

void FUN_140361ce0(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_1405d84f0 ^ (ulonglong)&local_88;
  uVar5 = (**(code **)(*param_1 + 0x58))();
  local_70 = uVar5;
  FUN_14034ed40(uVar5);
  local_68 = 1;
  if (DAT_1405f064f != '\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_140361dce:
        puVar17 = (undefined8 *)(puVar8 + 4);
        puVar14 = puVar11;
      }
    }
    else {
      puVar8 = malloc(uVar1);
      puVar17 = (undefined8 *)0x0;
      puVar14 = auStack_a8;
      if (puVar8 != (undefined4 *)0x0) {
        *puVar8 = 0xdddd;
        goto LAB_140361dce;
      }
    }
    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_140361e1f;
          FUN_14034f800();
        }
        plVar18 = *(longlong **)(param_1[0xdb] + lVar10 * 8);
        lVar16 = 0;
        if (plVar18 != (longlong *)0x0) {
          lVar16 = *plVar18;
        }
        *(undefined8 *)(puVar14 + -8) = 0x140361e0a;
        FUN_1403a0550(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) = 0x140361e6c;
      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_140361e96:
        plVar18 = (longlong *)(puVar8 + 4);
      }
    }
    else {
      *(undefined8 *)(puVar14 + -8) = 0x140361e88;
      puVar8 = malloc(uVar1);
      plVar18 = (longlong *)0x0;
      if (puVar8 != (undefined4 *)0x0) {
        *puVar8 = 0xdddd;
        goto LAB_140361e96;
      }
    }
    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) = 0x140361ec7;
      FUN_1403a0550(lVar16 + 0xc0);
      *plVar9 = lVar16;
      plVar9 = plVar9 + 1;
    }
  }
  local_60 = param_1[0x2e1];
  local_78 = (longlong *)0x0;
  if ((int)local_60 < 1) goto LAB_140361f96;
  lVar10 = (longlong)(int)local_60 * 8;
  uVar1 = lVar10 + 0x10;
  if (uVar1 < 0x401) {
    uVar7 = lVar10 + 0x1f;
    if (uVar7 <= uVar1) {
      uVar7 = 0xffffffffffffff0;
    }
    *(undefined8 *)(puVar14 + -8) = 0x140361f21;
    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_140361f4f:
      local_78 = plVar9 + 2;
    }
  }
  else {
    *(undefined8 *)(puVar14 + -8) = 0x140361f40;
    plVar9 = malloc(uVar1);
    local_78 = plVar9;
    if (plVar9 != (longlong *)0x0) {
      *(undefined4 *)plVar9 = 0xdddd;
      goto LAB_140361f4f;
    }
  }
  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) = 0x140361f85;
    FUN_1403a0550(lVar16 + 0xc0);
    *plVar9 = lVar16;
    plVar9 = plVar9 + 1;
  }
LAB_140361f96:
  pcVar2 = *(code **)(param_1[0x23] + 8);
  *(undefined8 *)(puVar14 + -8) = 0x140361fa3;
  uVar19 = (*pcVar2)();
  *(undefined8 *)(puVar14 + -8) = 0x140361faf;
  FUN_14034edd0(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) = 0x140361fe1;
        uVar5 = (*pcVar2)();
        local_80 = 0;
        local_88 = uVar5;
        if (lVar10 == 0) {
          local_80 = 1;
          *(undefined8 *)(puVar14 + -8) = 0x14036203b;
          FUN_14034ed40(uVar5);
          *(undefined8 *)(puVar14 + -8) = 0x140362047;
          FUN_1403a08c0(lVar16,uVar19);
          *(undefined8 *)(puVar14 + -8) = 0x14036204f;
          FUN_14034edd0(uVar5);
          local_80 = '\0';
          *(undefined8 *)(puVar14 + -8) = 0x14036205f;
          FUN_1403a0560(lVar16 + 0x40);
          *puVar17 = puVar17[lVar6 + -1];
LAB_140362067:
          lVar6 = lVar6 + -1;
        }
        else {
          *(undefined8 *)(puVar14 + -8) = 0x140361ff9;
          local_80 = FUN_14034ed90();
          if (local_80 != '\0') {
            *(undefined8 *)(puVar14 + -8) = 0x14036200f;
            FUN_1403a08c0(lVar16,uVar19);
            *(undefined8 *)(puVar14 + -8) = 0x140362017;
            FUN_14034edd0(uVar5);
            local_80 = '\0';
            *(undefined8 *)(puVar14 + -8) = 0x140362027;
            FUN_1403a0560(lVar16 + 0x40);
            puVar17[lVar10] = puVar17[lVar6 + -1];
            goto LAB_140362067;
          }
        }
        lVar10 = lVar10 + 1;
      } while (lVar10 < lVar6);
    }
    if (*(int *)(puVar17 + -2) == 0xdddd) {
      *(undefined8 *)(puVar14 + -8) = 0x1403620a2;
      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) = 0x1403620e2;
        uVar5 = (*pcVar2)();
        local_80 = 0;
        local_88 = uVar5;
        if (lVar10 == 0) {
          local_80 = 1;
          *(undefined8 *)(puVar14 + -8) = 0x14036216c;
          FUN_14034ed40(uVar5);
          uVar3 = *(undefined8 *)(lVar16 + 0x748);
          *(undefined8 *)(puVar14 + -8) = 0x14036217d;
          FUN_14039ffd0(uVar3,uVar19);
          if ((*(longlong **)(lVar16 + 0x760) != (longlong *)0x0) &&
             (lVar4 = **(longlong **)(lVar16 + 0x760), lVar4 != 0)) {
            uVar3 = *(undefined8 *)(lVar4 + 0x168);
            *(undefined8 *)(puVar14 + -8) = 0x1403621a2;
            FUN_14039d900(uVar3,uVar19);
          }
          *(undefined8 *)(puVar14 + -8) = 0x1403621aa;
          FUN_14034edd0(uVar5);
          local_80 = '\0';
          *(undefined8 *)(puVar14 + -8) = 0x1403621bc;
          FUN_1403a0560(lVar16 + 0xc0);
          *plVar18 = plVar18[lVar6 + -1];
LAB_1403621c4:
          lVar6 = lVar6 + -1;
        }
        else {
          *(undefined8 *)(puVar14 + -8) = 0x1403620fa;
          local_80 = FUN_14034ed90();
          if (local_80 != '\0') {
            uVar3 = *(undefined8 *)(lVar16 + 0x748);
            *(undefined8 *)(puVar14 + -8) = 0x140362119;
            FUN_14039ffd0(uVar3,uVar19);
            if ((*(longlong **)(lVar16 + 0x760) != (longlong *)0x0) &&
               (lVar4 = **(longlong **)(lVar16 + 0x760), lVar4 != 0)) {
              uVar3 = *(undefined8 *)(lVar4 + 0x168);
              *(undefined8 *)(puVar14 + -8) = 0x14036213e;
              FUN_14039d900(uVar3,uVar19);
            }
            *(undefined8 *)(puVar14 + -8) = 0x140362146;
            FUN_14034edd0(uVar5);
            local_80 = '\0';
            *(undefined8 *)(puVar14 + -8) = 0x140362158;
            FUN_1403a0560(lVar16 + 0xc0);
            plVar18[lVar10] = plVar18[lVar6 + -1];
            goto LAB_1403621c4;
          }
        }
        lVar10 = lVar10 + 1;
      } while (lVar10 < lVar6);
    }
    if ((int)plVar18[-2] == 0xdddd) {
      *(undefined8 *)(puVar14 + -8) = 0x1403621fe;
      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) = 0x140362242;
        uVar5 = (*pcVar2)();
        local_80 = 0;
        local_88 = uVar5;
        if (lVar10 == 0) {
          local_80 = 1;
          *(undefined8 *)(puVar14 + -8) = 0x1403622cc;
          FUN_14034ed40(uVar5);
          uVar3 = *(undefined8 *)(lVar16 + 0x748);
          *(undefined8 *)(puVar14 + -8) = 0x1403622dd;
          FUN_14039ffd0(uVar3,uVar19);
          if ((*(longlong **)(lVar16 + 0x760) != (longlong *)0x0) &&
             (lVar4 = **(longlong **)(lVar16 + 0x760), lVar4 != 0)) {
            uVar3 = *(undefined8 *)(lVar4 + 0x168);
            *(undefined8 *)(puVar14 + -8) = 0x140362302;
            FUN_14039d900(uVar3,uVar19);
          }
          *(undefined8 *)(puVar14 + -8) = 0x14036230a;
          FUN_14034edd0(uVar5);
          local_80 = '\0';
          *(undefined8 *)(puVar14 + -8) = 0x14036231c;
          FUN_1403a0560(lVar16 + 0xc0);
          *plVar18 = plVar18[lVar6 + -1];
LAB_140362324:
          lVar6 = lVar6 + -1;
        }
        else {
          *(undefined8 *)(puVar14 + -8) = 0x14036225a;
          local_80 = FUN_14034ed90();
          if (local_80 != '\0') {
            uVar3 = *(undefined8 *)(lVar16 + 0x748);
            *(undefined8 *)(puVar14 + -8) = 0x140362279;
            FUN_14039ffd0(uVar3,uVar19);
            if ((*(longlong **)(lVar16 + 0x760) != (longlong *)0x0) &&
               (lVar4 = **(longlong **)(lVar16 + 0x760), lVar4 != 0)) {
              uVar3 = *(undefined8 *)(lVar4 + 0x168);
              *(undefined8 *)(puVar14 + -8) = 0x14036229e;
              FUN_14039d900(uVar3,uVar19);
            }
            *(undefined8 *)(puVar14 + -8) = 0x1403622a6;
            FUN_14034edd0(uVar5);
            local_80 = '\0';
            *(undefined8 *)(puVar14 + -8) = 0x1403622b8;
            FUN_1403a0560(lVar16 + 0xc0);
            plVar18[lVar10] = plVar18[lVar6 + -1];
            goto LAB_140362324;
          }
        }
        lVar10 = lVar10 + 1;
      } while (lVar10 < lVar6);
    }
    if ((int)plVar18[-2] == 0xdddd) {
      *(undefined8 *)(puVar14 + -8) = 0x14036235e;
      free(plVar18 + -2);
    }
  }
  *(undefined8 *)(puVar14 + -8) = 0x14036236b;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x000140362542)
// WARNING: Removing unreachable block (ram,0x000140362549)
// WARNING: Removing unreachable block (ram,0x000140362555)
// WARNING: Removing unreachable block (ram,0x000140362562)
// WARNING: Removing unreachable block (ram,0x00014036255a)
// WARNING: Removing unreachable block (ram,0x000140362569)
// WARNING: Removing unreachable block (ram,0x00014036257a)

undefined1
FUN_1403623a0(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_1405d84f0 ^ (ulonglong)auStack_178;
  local_158 = param_8;
  local_140 = param_1;
  local_138 = param_2;
  FUN_14035b460(&local_118);
  if (local_118 == (undefined *)0x0) {
    local_118 = PTR_DAT_1405d8010;
  }
  if ((undefined *)*param_2 != local_118) {
    uVar4 = FUN_14034fe70();
    local_128 = uVar4;
    FUN_14034ed40(uVar4);
    puVar2 = local_118;
    local_120 = 1;
    if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1405d8010)) &&
       (puVar9 = local_118 + -8, puVar9 != (undefined *)0x0)) {
      uVar5 = FUN_14034fe70();
      local_150 = uVar5;
      FUN_14034ed40(uVar5);
      local_148 = 1;
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar9);
      }
      FUN_14034edd0(uVar5);
    }
    local_118 = (undefined *)*param_2;
    if (((local_118 != PTR_DAT_1405d8010) && (local_118 != (undefined *)0x0)) &&
       (local_118 != (undefined *)0x8)) {
      *(int *)(local_118 + -4) = *(int *)(local_118 + -4) + 1;
    }
    FUN_14034edd0(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_14034f7d0();
        }
        FUN_14012c550(&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_14034f7d0();
    }
    if (param_5 != 0) {
      lVar10 = (longlong)local_e8;
      FUN_14012c550(&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_14034ff60(local_80);
    }
    else {
      (**(code **)(*local_88 + 0x18))();
    }
  }
  local_100 = Proud::CFastArray<int,0>::vftable;
  if (local_f0 != 0) {
    if (local_f8 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    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_1405d8010)) &&
     (puVar9 = local_118 + -8, puVar9 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    local_150 = uVar4;
    FUN_14034ed40(uVar4);
    local_148 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar9);
    }
    FUN_14034edd0(uVar4);
  }
  local_118 = PTR_DAT_1405d8010;
  FUN_1400031d0(param_2);
  return uVar3;
}



void FUN_1403626d0(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_14034ed40(uVar1);
  if (DAT_1405f064f != '\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_1403946e0(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_1405f2490);
      }
    }
  }
  FUN_14034edd0(uVar1);
  return;
}



void FUN_1403627c0(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_14034ed40(uVar2);
  if (DAT_1405f064f != '\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_140394590(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_1405f2490);
    }
  }
  FUN_14034edd0(uVar2);
  return;
}



void FUN_1403628b0(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_14034ed40(uVar1);
  if (DAT_1405f064f != '\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_14034edd0(uVar1);
  return;
}



void FUN_140362a70(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_14034ed40(uVar2);
  if (DAT_1405f064f != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetUdpListenerLocalAddrs");
  }
  if (*(int *)(param_1 + 0x179c) == 1) {
    FUN_14035e910(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_14034f800();
        }
        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_14034f800();
          }
          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_140354860(uVar4,local_60);
          FUN_14035f030(param_2,*(undefined4 *)(param_2 + 0x18),uVar4,1);
        }
        iVar5 = iVar5 + 1;
        lVar6 = lVar6 + 1;
      } while (iVar5 < *(int *)(param_1 + 0x638));
    }
    FUN_14034edd0(uVar2);
    return;
  }
  FUN_14034f420(local_50,
                L"Cannot call GetUdpListenerLocalAddrs unless ServerUdpAssignMode_Static is used!");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_140362bf0(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_14035e390(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_14034f7d0();
      }
      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_14034f7d0();
      }
      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_14034f7d0();
      }
      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_140362d20:
          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_140362d22;
                break;
              }
              puVar5 = *(uint **)(puVar5 + 4);
              if (puVar5 == (uint *)0x0) break;
            }
          }
          goto LAB_140362d20;
        }
        ppuVar6 = &PTR_vftable_1405d95c0;
      }
LAB_140362d22:
      if ((longlong)param_2[1] <= lVar9) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_140362d90(longlong *param_1,uint param_2,undefined2 *param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_14034ed40(uVar3);
  if (DAT_1405f064f != '\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_14034edd0(uVar3);
          return true;
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  if (param_2 != 1) {
    FUN_14034edd0(uVar3);
  }
  else {
    *param_3 = (short)param_1[0x188];
    *(short *)(param_1 + 0x188) = (short)param_1[0x188] + 1;
    FUN_14034edd0(uVar3);
  }
  return param_2 == 1;
}



void FUN_140362eb0(longlong *param_1,uint param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_14034ed40(uVar3);
  if (DAT_1405f064f != '\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_140362f7e;
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  if (param_2 == 1) {
    *(short *)(param_1 + 0x188) = (short)param_1[0x188] + -1;
  }
LAB_140362f7e:
  FUN_14034edd0(uVar3);
  return;
}



// WARNING: Type propagation algorithm not settling

bool FUN_140362fa0(longlong *param_1,uint param_2,undefined2 *param_3)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_14034ed40(uVar3);
  if (DAT_1405f064f != '\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_14034edd0(uVar3);
          return true;
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  if (param_2 != 1) {
    FUN_14034edd0(uVar3);
  }
  else {
    *param_3 = *(undefined2 *)((longlong)param_1 + 0xc42);
    FUN_14034edd0(uVar3);
  }
  return param_2 == 1;
}



// WARNING: Type propagation algorithm not settling

bool FUN_1403630c0(longlong *param_1,uint param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(*param_1 + 0x58))();
  FUN_14034ed40(uVar3);
  if (DAT_1405f064f != '\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_14034edd0(uVar3);
          return true;
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  if (param_2 != 1) {
    FUN_14034edd0(uVar3);
  }
  else {
    *(short *)((longlong)param_1 + 0xc42) = *(short *)((longlong)param_1 + 0xc42) + 1;
    FUN_14034edd0(uVar3);
  }
  return param_2 == 1;
}



undefined8 FUN_1403631c0(longlong param_1,uint param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  uint *puVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_14034ed40(uVar2);
  if (DAT_1405f064f != '\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_14034edd0(uVar2);
          return 1;
        }
        break;
      }
      puVar3 = *(uint **)(puVar3 + 4);
      if (puVar3 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar2);
  return 0;
}



undefined8 FUN_1403632c0(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_14034ed40(uVar3);
  uVar8 = 1;
  if (DAT_1405f064f != '\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_14036343e;
            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_14036343e;
            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_1405f2490,local_res10,
                     uVar6,uVar7,uVar8);
LAB_14036343e:
          FUN_14034edd0(uVar3);
          return 1;
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar3);
  return 0;
}



void FUN_140363470(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_14034edd0(uVar4);
  return;
}



undefined4 FUN_140363580(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_14012c550(&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_14034ff60(local_30);
    }
    else {
      (**(code **)(*local_38 + 0x18))(local_38,local_30);
    }
  }
  return uVar1;
}



void FUN_140363660(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_14034ed40(uVar2);
  if (DAT_1405f064f != '\0') {
    (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
              (param_1 + -0xa8,L"Proud::CNetServerImpl::GetUdpSocketAddrList");
  }
  if (*(int *)(param_1 + 0x179c) == 1) {
    FUN_14035e910(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_14034f800();
        }
        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_140354860(uVar4,local_60);
        FUN_14035f030(param_2,*(undefined4 *)(param_2 + 0x18),uVar4,1);
        iVar5 = iVar5 + 1;
        lVar6 = lVar6 + 1;
      } while (iVar5 < *(int *)(param_1 + 0x638));
    }
    FUN_14034edd0(uVar2);
    return;
  }
  FUN_14034f420(local_50,
                L"Cannot call GetUdpSocketAddrList unless ServerUdpAssignMode_Static is used!");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
}



ulonglong FUN_1403637b0(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_140363810(longlong param_1,uint param_2)

{
  longlong *plVar1;
  uint *puVar2;
  ulonglong uVar3;
  
  plVar1 = (longlong *)(param_1 + -0x120);
  if (DAT_1405f064f != '\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_1403638e0(void)

{
  FUN_140360bd0();
  return;
}



void FUN_140363900(longlong *param_1)

{
  if (*param_1 != 0) {
    *(longlong *)(*param_1 + 8) = *(longlong *)(*param_1 + 8) + -1;
    if (*(longlong *)(*param_1 + 8) == 0) {
      FUN_140360e30(*param_1);
    }
  }
  return;
}



longlong * FUN_140363940(longlong *param_1,longlong *param_2,longlong param_3)

{
  longlong lVar1;
  
  if (param_3 != 0) {
    FUN_140350140(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_1403639c0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_14034ed40(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_14034edd0(lVar1);
      FUN_140360e90(*param_1);
    }
    else {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



undefined8 FUN_140363a40(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_14039c290(param_1,lVar1,param_3);
        return 1;
      }
    }
  }
  return 0;
}



void FUN_140363ad0(void)

{
  FUN_140360d00();
  return;
}



void FUN_140363af0(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_14034ff60(puVar1[2]);
    }
    else {
      (**(code **)(*(longlong *)puVar1[1] + 0x18))();
    }
  }
  (**(code **)(*plVar2 + 0x18))(plVar2,puVar1);
                    // WARNING: Could not recover jumptable at 0x000140363b68. 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,0x000140363c66)
// WARNING: Removing unreachable block (ram,0x000140363c74)

void FUN_140363b70(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_14034ed40(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034ed40(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_14034edd0(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034edd0(uVar3);
    }
    if (uVar4 != 0) {
      FUN_140360e90(uVar4);
    }
  }
  return;
}



undefined8 FUN_140363ca0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035eb50(param_1);
  uVar2 = FUN_140360ee0(param_1,param_2,param_3,param_4);
  FUN_14035eb50(param_1);
  return uVar2;
}



undefined8 * FUN_140363d20(undefined8 *param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_14034fe70();
  *param_1 = PTR_DAT_1405d8010;
  FUN_140003100(param_1,param_2);
  FUN_140017520(param_1,param_3);
  return param_1;
}



void FUN_140363d90(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_1405d8198 + *(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_1405d8198 + *(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_1405d8198 + *(double *)(lVar1 + 0x1b0);
          }
          lVar3 = *plVar11;
          if ((*(int *)(lVar2 + 0x78) < 1) || (**(int **)(lVar2 + 0x70) != *(int *)(lVar3 + 0x6f8)))
          {
            dVar13 = *(double *)(lVar3 + 0x1b0);
          }
          else {
            dVar13 = DAT_1405d8198 + *(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_140363d90(param_1,uVar10 - 2);
        local_res18 = uVar10;
        local_res20 = uVar8;
      }
      else {
        FUN_140363d90(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_140364020(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_14034ff60(plVar4);
          }
        }
      }
      uVar2 = (int)plVar3 + 1;
      plVar3 = (longlong *)(ulonglong)uVar2;
      param_1 = param_1 + 1;
    } while ((int)uVar2 < param_3);
  }
  return;
}



void FUN_140364100(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_1403574e0(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(puVar1);
    }
  }
  return;
}



void FUN_140364170(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_14034ff60();
    }
    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_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,*(longlong *)(param_1 + 0x70));
    }
  }
  FUN_140363ad0(param_1 + 8);
  return;
}



void FUN_140364200(_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_140361360(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_1405d3608);
    }
    *(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_1403642f0(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_140364340(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_140017520(param_1,uVar2);
  if (((local_res10[0] != (undefined *)0x0) && (local_res10[0] != PTR_DAT_1405d8010)) &&
     (local_res10[0] + -8 != (undefined *)0x0)) {
    uVar2 = FUN_14034fe70();
    FUN_14034ed40(uVar2);
    piVar1 = (int *)(local_res10[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res10[0] + -8);
    }
    FUN_14034edd0(uVar2);
  }
  return;
}



undefined8 FUN_1403643d0(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_140385b50(param_1,0);
  }
  iVar14 = *param_2;
  cVar5 = FUN_140384a90(param_2,local_168);
  if (cVar5 == '\0') {
switchD_140364463_default:
    FUN_140383db0(param_2,(int)((iVar14 >> 0x1f & 7U) + iVar14) >> 3);
    uVar11 = 0;
  }
  else {
    local_280 = param_3;
    switch(local_168[0]) {
    case 0xfa01:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_1403840e0(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_1405d8888);
      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_1405d8888,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        FUN_1403a1b80(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        local_358 = (undefined8 **)FUN_1400174a0(&local_res20,&local_148,iVar14 + -2);
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        }
        if ((undefined8 ***)*local_358 != local_res20) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          pppuVar15 = local_res20;
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          if ((((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
              (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) &&
             (ppppuVar13 = (undefined8 ****)(local_res20 + -1), ppppuVar13 != (undefined8 ****)0x0))
          {
            ppuVar10 = (undefined **)FUN_14034fe70();
            local_2d0 = ppuVar10;
            FUN_14034ed40(ppuVar10);
            local_2c8 = CONCAT31(local_2c8._1_3_,1);
            piVar1 = (int *)((longlong)pppuVar15 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(ppppuVar13);
            }
            FUN_14034edd0(ppuVar10);
          }
          local_res20 = (undefined8 ***)*local_358;
          if (((local_res20 != (undefined8 ***)PTR_DAT_1405d8010) &&
              ((undefined8 ****)local_res20 != (undefined8 ****)0x0)) &&
             ((undefined8 ****)local_res20 != (undefined8 ****)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(ppuVar9);
        }
        if (((local_148 != (undefined *)0x0) && (local_148 != PTR_DAT_1405d8010)) &&
           (local_148 + -8 != (undefined *)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)(local_148 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_148 + -8);
          }
          FUN_14034edd0(ppuVar9);
        }
        local_350 = &local_230;
        local_148 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_230 = (undefined8 ***)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_230 = (undefined8 ****)0x0;
        }
        if (local_res20 != (undefined8 ***)PTR_DAT_1405d8010) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          FUN_1400031d0(&local_230);
          local_230 = local_res20;
          if (((local_res20 != (undefined8 ***)PTR_DAT_1405d8010) &&
              ((undefined8 ****)local_res20 != (undefined8 ****)0x0)) &&
             ((undefined8 ****)local_res20 != (undefined8 ****)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(ppuVar9);
        }
        puVar3 = PTR_DAT_1405d8888;
        FUN_14034fe70();
        local_170 = PTR_DAT_1405d8010;
        uVar6 = FUN_14034fcf0(puVar3);
        uVar11 = FUN_140002f00(&local_170,uVar6);
        FUN_14034fd20(uVar11,puVar3,uVar6);
        FUN_140002fe0(&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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa01,PTR_DAT_1405d8888,ppppuVar13);
        pppuVar15 = local_res20;
        if ((((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
            (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_res20 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppppuVar13);
          }
          FUN_14034edd0(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_1405d8888;
        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_1405d8888);
      }
      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_1405d8888;
LAB_140367ea5:
        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_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_res20);
      cVar5 = FUN_1403840e0(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_1405d8890);
      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_1405d8890,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_358 = (undefined8 **)PTR_DAT_1405d8010;
        local_158[0] = local_res20._0_4_;
        FUN_1403a1a60(&local_358,local_158);
        FUN_140017790(&local_358,&DAT_14047edb0);
        uVar11 = FUN_14035bc60((ulonglong)local_res10[0] & 0xffffffff);
        FUN_140017790(&local_358,uVar11);
        FUN_140017790(&local_358,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ***)local_358 != (undefined8 ***)0x0) &&
           (local_358 != (undefined8 **)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_358 + -1);
        }
        local_2e8 = (undefined **)FUN_1400174a0(&local_358,&local_140,iVar14 + -2);
        if ((undefined8 ***)local_358 == (undefined8 ***)0x0) {
          local_358 = (undefined8 **)PTR_DAT_1405d8010;
        }
        if ((undefined8 **)*local_2e8 != local_358) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          ppuVar4 = local_358;
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          if ((((undefined8 ***)local_358 != (undefined8 ***)0x0) &&
              (local_358 != (undefined8 **)PTR_DAT_1405d8010)) &&
             (pppuVar15 = (undefined8 ***)(local_358 + -1), pppuVar15 != (undefined8 ***)0x0)) {
            ppuVar10 = (undefined **)FUN_14034fe70();
            local_2d0 = ppuVar10;
            FUN_14034ed40(ppuVar10);
            local_2c8 = CONCAT31(local_2c8._1_3_,1);
            piVar1 = (int *)((longlong)ppuVar4 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(pppuVar15);
            }
            FUN_14034edd0(ppuVar10);
          }
          local_358 = (undefined8 **)*local_2e8;
          if (((local_358 != (undefined8 **)PTR_DAT_1405d8010) &&
              ((undefined8 ***)local_358 != (undefined8 ***)0x0)) &&
             ((undefined8 ***)local_358 != (undefined8 ***)0x8)) {
            *(int *)((longlong)local_358 + -4) = *(int *)((longlong)local_358 + -4) + 1;
          }
          FUN_14034edd0(ppuVar9);
        }
        if (((local_140 != (undefined *)0x0) && (local_140 != PTR_DAT_1405d8010)) &&
           (local_140 + -8 != (undefined *)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)(local_140 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_140 + -8);
          }
          FUN_14034edd0(ppuVar9);
        }
        local_350 = &local_250;
        local_140 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_250 = (undefined8 **)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_250 = (undefined8 ***)0x0;
        }
        if (local_358 != (undefined8 **)PTR_DAT_1405d8010) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          FUN_1400031d0(&local_250);
          local_250 = local_358;
          if (((local_358 != (undefined8 **)PTR_DAT_1405d8010) &&
              ((undefined8 ***)local_358 != (undefined8 ***)0x0)) &&
             ((undefined8 ***)local_358 != (undefined8 ***)0x8)) {
            *(int *)((longlong)local_358 + -4) = *(int *)((longlong)local_358 + -4) + 1;
          }
          FUN_14034edd0(ppuVar9);
        }
        puVar3 = PTR_DAT_1405d8890;
        FUN_14034fe70();
        local_200 = PTR_DAT_1405d8010;
        uVar6 = FUN_14034fcf0(puVar3);
        uVar11 = FUN_140002f00(&local_200,uVar6);
        FUN_14034fd20(uVar11,puVar3,uVar6);
        FUN_140002fe0(&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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa02,PTR_DAT_1405d8890,pppuVar15);
        ppuVar4 = local_358;
        if ((((undefined8 ***)local_358 != (undefined8 ***)0x0) &&
            (local_358 != (undefined8 **)PTR_DAT_1405d8010)) &&
           (pppuVar15 = (undefined8 ***)(local_358 + -1), pppuVar15 != (undefined8 ***)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)((longlong)ppuVar4 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(pppuVar15);
          }
          FUN_14034edd0(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_1405d8890;
        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_1405d8890);
      }
      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_1405d8890;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa03:
      FUN_14035b390(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_1405d8898);
      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_1405d8898,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        ppppuVar13 = (undefined8 ****)PTR_DAT_1405d8010;
        local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
        local_res20 = (undefined8 ***)FUN_1400174a0(local_res10,&local_150,0xfffffffe);
        if (ppppuVar13 == (undefined8 ****)0x0) {
          ppppuVar13 = (undefined8 ****)PTR_DAT_1405d8010;
        }
        local_res10[0] = ppppuVar13;
        if ((undefined8 ****)*local_res20 != ppppuVar13) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          if (((ppppuVar13 != (undefined8 ****)0x0) &&
              (ppppuVar13 != (undefined8 ****)PTR_DAT_1405d8010)) &&
             (ppppuVar13 + -1 != (undefined8 ****)0x0)) {
            ppuVar10 = (undefined **)FUN_14034fe70();
            local_2d0 = ppuVar10;
            FUN_14034ed40(ppuVar10);
            local_2c8 = CONCAT31(local_2c8._1_3_,1);
            piVar1 = (int *)((longlong)ppppuVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(ppppuVar13 + -1);
            }
            FUN_14034edd0(ppuVar10);
          }
          ppppuVar13 = (undefined8 ****)*local_res20;
          if (((ppppuVar13 != (undefined8 ****)PTR_DAT_1405d8010) &&
              (ppppuVar13 != (undefined8 ****)0x0)) && (ppppuVar13 != (undefined8 ****)0x8)) {
            *(int *)((longlong)ppppuVar13 + -4) = *(int *)((longlong)ppppuVar13 + -4) + 1;
          }
          local_res10[0] = ppppuVar13;
          FUN_14034edd0(ppuVar9);
        }
        if (((local_150 != (undefined *)0x0) && (local_150 != PTR_DAT_1405d8010)) &&
           (local_150 + -8 != (undefined *)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)(local_150 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_150 + -8);
          }
          FUN_14034edd0(ppuVar9);
        }
        local_res20 = &local_248;
        local_150 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_248 = (undefined8 ***)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_248 = (undefined8 ****)0x0;
        }
        if (ppppuVar13 != (undefined8 ****)PTR_DAT_1405d8010) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          FUN_1400031d0(&local_248);
          if (((ppppuVar13 != (undefined8 ****)PTR_DAT_1405d8010) &&
              (ppppuVar13 != (undefined8 ****)0x0)) && (ppppuVar13 != (undefined8 ****)0x8)) {
            *(int *)((longlong)ppppuVar13 + -4) = *(int *)((longlong)ppppuVar13 + -4) + 1;
          }
          local_248 = ppppuVar13;
          FUN_14034edd0(ppuVar9);
        }
        puVar3 = PTR_DAT_1405d8898;
        FUN_14034fe70();
        local_1a8 = PTR_DAT_1405d8010;
        uVar6 = FUN_14034fcf0(puVar3);
        uVar11 = FUN_140002f00(&local_1a8,uVar6);
        FUN_14034fd20(uVar11,puVar3,uVar6);
        FUN_140002fe0(&local_1a8);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa03,&local_1a8,&local_248);
        ppppuVar16 = ppppuVar13;
        if (ppppuVar13 == (undefined8 ****)0x0) {
          ppppuVar16 = (undefined8 ****)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa03,PTR_DAT_1405d8898,ppppuVar16);
        if (((ppppuVar13 != (undefined8 ****)0x0) &&
            (ppppuVar13 != (undefined8 ****)PTR_DAT_1405d8010)) &&
           (ppppuVar13 + -1 != (undefined8 ****)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)((longlong)ppppuVar13 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppppuVar13 + -1);
          }
          FUN_14034edd0(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_1405d8898;
        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_1405d8898);
      }
      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_1405d8898;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa04:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_358);
      FUN_140384b70(param_2,&local_2e8);
      cVar5 = FUN_1403840e0(param_2,&local_res20,4);
      if (cVar5 != '\0') {
        local_2d8[0] = local_res20._0_4_;
      }
      cVar5 = FUN_1403840e0(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_1405d88a0);
      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_1405d88a0,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        local_1b0 = local_358._0_4_;
        FUN_1403a1a60(&local_res20,&local_1b0);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        local_210[0] = local_2e8._0_4_;
        FUN_1403a1a60(&local_res20,local_210);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        FUN_1403a1ac0(&local_res20,local_2d8);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        FUN_1403a18c0(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        local_350 = (undefined8 ***)FUN_1400174a0(&local_res20,&local_138,iVar14 + -2);
        if ((undefined8 ****)local_res20 == (undefined8 ****)0x0) {
          local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        }
        if ((undefined8 ***)*local_350 != local_res20) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          pppuVar15 = local_res20;
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          if ((((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
              (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) &&
             (ppppuVar13 = (undefined8 ****)(local_res20 + -1), ppppuVar13 != (undefined8 ****)0x0))
          {
            ppuVar10 = (undefined **)FUN_14034fe70();
            local_2d0 = ppuVar10;
            FUN_14034ed40(ppuVar10);
            local_2c8 = CONCAT31(local_2c8._1_3_,1);
            piVar1 = (int *)((longlong)pppuVar15 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(ppppuVar13);
            }
            FUN_14034edd0(ppuVar10);
          }
          local_res20 = (undefined8 ***)*local_350;
          if (((local_res20 != (undefined8 ***)PTR_DAT_1405d8010) &&
              ((undefined8 ****)local_res20 != (undefined8 ****)0x0)) &&
             ((undefined8 ****)local_res20 != (undefined8 ****)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(ppuVar9);
        }
        if (((local_138 != (undefined *)0x0) && (local_138 != PTR_DAT_1405d8010)) &&
           (local_138 + -8 != (undefined *)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)(local_138 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_138 + -8);
          }
          FUN_14034edd0(ppuVar9);
        }
        local_350 = &local_258;
        local_138 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_258 = (undefined8 ***)PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_258 = (undefined8 ****)0x0;
        }
        if (local_res20 != (undefined8 ***)PTR_DAT_1405d8010) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          FUN_1400031d0(&local_258);
          local_258 = local_res20;
          if (((local_res20 != (undefined8 ***)PTR_DAT_1405d8010) &&
              ((undefined8 ****)local_res20 != (undefined8 ****)0x0)) &&
             ((undefined8 ****)local_res20 != (undefined8 ****)0x8)) {
            *(int *)((longlong)local_res20 + -4) = *(int *)((longlong)local_res20 + -4) + 1;
          }
          FUN_14034edd0(ppuVar9);
        }
        puVar3 = PTR_DAT_1405d88a0;
        FUN_14034fe70();
        local_1f0 = PTR_DAT_1405d8010;
        uVar6 = FUN_14034fcf0(puVar3);
        uVar11 = FUN_140002f00(&local_1f0,uVar6);
        FUN_14034fd20(uVar11,puVar3,uVar6);
        FUN_140002fe0(&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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa04,PTR_DAT_1405d88a0,ppppuVar13);
        pppuVar15 = local_res20;
        if ((((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
            (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_res20 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_2f8 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_2f0 = CONCAT31(local_2f0._1_3_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppppuVar13);
          }
          FUN_14034edd0(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_1405d88a0;
        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_1405d88a0);
      }
      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_1405d88a0;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa05:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_358);
      FUN_140384b70(param_2,&local_res20);
      local_2f8 = Proud::AddrPort::vftable;
      DVar7 = 0;
      local_2f0 = 0;
      local_2ec = 0;
      cVar5 = FUN_1403840e0(param_2,local_res10,4);
      if (cVar5 != '\0') {
        local_2f0 = local_res10[0]._0_4_;
      }
      cVar5 = FUN_1403840e0(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_1403840e0(param_2,local_res10,4);
      if (cVar5 != '\0') {
        local_2c8 = local_res10[0]._0_4_;
      }
      cVar5 = FUN_1403840e0(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_1403840e0(param_2,local_res10,4);
      if (cVar5 != '\0') {
        local_238 = local_res10[0]._0_4_;
      }
      cVar5 = FUN_1403840e0(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_1403840e0(param_2,local_res10,4);
      if (cVar5 != '\0') {
        local_2e0 = local_res10[0]._0_4_;
      }
      cVar5 = FUN_1403840e0(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_1405d88a8);
      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_1405d88a8,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
        local_17c = local_358._0_4_;
        FUN_1403a1a60(local_res10,&local_17c);
        FUN_140017790(local_res10,&DAT_14047edb0);
        local_1ac = local_res20._0_4_;
        FUN_1403a1a60(local_res10,&local_1ac);
        FUN_140017790(local_res10,&DAT_14047edb0);
        uVar11 = (*(code *)*local_2f8)(&local_2f8,&local_350);
        FUN_140017520(local_res10,uVar11);
        pppuVar15 = local_350;
        if ((((undefined8 ****)local_350 != (undefined8 ****)0x0) &&
            (local_350 != (undefined8 ***)PTR_DAT_1405d8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_350 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          uVar11 = FUN_14034fe70();
          local_320 = uVar11;
          FUN_14034ed40(uVar11);
          local_318 = (undefined *)CONCAT71(local_318._1_7_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppppuVar13);
          }
          FUN_14034edd0(uVar11);
        }
        FUN_140017790(local_res10,&DAT_14047edb0);
        uVar11 = (*(code *)*local_2d0)(&local_2d0,&local_350);
        FUN_140017520(local_res10,uVar11);
        pppuVar15 = local_350;
        if ((((undefined8 ****)local_350 != (undefined8 ****)0x0) &&
            (local_350 != (undefined8 ***)PTR_DAT_1405d8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_350 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          uVar11 = FUN_14034fe70();
          local_320 = uVar11;
          FUN_14034ed40(uVar11);
          local_318 = (undefined *)CONCAT71(local_318._1_7_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppppuVar13);
          }
          FUN_14034edd0(uVar11);
        }
        FUN_140017790(local_res10,&DAT_14047edb0);
        uVar11 = (*(code *)*local_240)(&local_240,&local_350);
        FUN_140017520(local_res10,uVar11);
        pppuVar15 = local_350;
        if ((((undefined8 ****)local_350 != (undefined8 ****)0x0) &&
            (local_350 != (undefined8 ***)PTR_DAT_1405d8010)) &&
           (ppppuVar13 = (undefined8 ****)(local_350 + -1), ppppuVar13 != (undefined8 ****)0x0)) {
          uVar11 = FUN_14034fe70();
          local_320 = uVar11;
          FUN_14034ed40(uVar11);
          local_318 = (undefined *)CONCAT71(local_318._1_7_,1);
          piVar1 = (int *)((longlong)pppuVar15 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppppuVar13);
          }
          FUN_14034edd0(uVar11);
        }
        FUN_140017790(local_res10,&DAT_14047edb0);
        uVar11 = (*(code *)*local_2e8)(&local_2e8,&local_350);
        FUN_140017520(local_res10,uVar11);
        if ((((undefined8 ****)local_350 != (undefined8 ****)0x0) &&
            (local_350 != (undefined8 ***)PTR_DAT_1405d8010)) &&
           ((undefined8 ****)(local_350 + -1) != (undefined8 ****)0x0)) {
          uVar11 = FUN_14034fe70();
          local_320 = uVar11;
          FUN_14034ed40(uVar11);
          local_318 = (undefined *)CONCAT71(local_318._1_7_,1);
          piVar1 = (int *)((longlong)local_350 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_350 + -1);
          }
          FUN_14034edd0(uVar11);
        }
        FUN_140017790(local_res10,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_1400174a0(local_res10,local_d0,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_d0);
        local_350 = &local_228;
        FUN_14034fe70();
        local_228 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_228,local_res10);
        uVar11 = FUN_140003060(local_90,PTR_DAT_1405d88a8,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa05,PTR_DAT_1405d88a8,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_1405d88a8;
        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_1405d88a8);
      }
      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_1405d88a8;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa06:
      FUN_14035b390(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_140360270(param_2,&local_348);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_1405d88b0);
      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_1405d88b0,&DAT_140477960);
          goto LAB_140365d77;
        }
      }
      else {
        DVar7 = DVar8;
        if ((char)param_1[3] == '\0') {
          FUN_14034fe70();
          local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
          FUN_1403a1d60(local_res10,&local_348);
          FUN_140017790(local_res10,&DAT_14047edb0);
          iVar14 = 0;
          if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
             (local_res10[0] != (undefined8 ***)PTR_DAT_1405d8010)) {
            iVar14 = *(int *)(local_res10[0] + -1);
          }
          uVar11 = FUN_1400174a0(local_res10,local_c0,iVar14 + -2);
          FUN_140003100(local_res10,uVar11);
          FUN_1400031d0(local_c0);
          local_res20 = &local_1e0;
          FUN_14034fe70();
          local_1e0 = (undefined8 **)PTR_DAT_1405d8010;
          FUN_140003100(&local_1e0,local_res10);
          uVar11 = FUN_140003060(local_80,PTR_DAT_1405d88b0,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_1405d8010;
          }
          (**(code **)(*(longlong *)param_1[2] + 0x70))
                    ((longlong *)param_1[2],iVar2,0xfa06,PTR_DAT_1405d88b0,ppppuVar13);
          FUN_1400031d0(local_res10);
LAB_140365d77:
          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_1405d88b0;
            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_1405d88b0);
      }
      if (((char)param_1[3] == '\0') && (*(char *)((longlong)param_1 + 0x1a) != '\0')) {
        local_320 = CONCAT44(local_320._4_4_,0xfa06);
        local_318 = PTR_DAT_1405d88b0;
        local_310 = iVar2;
        local_308 = param_3;
        DVar8 = GetTickCount();
        local_300 = DVar8 - DVar7;
        (**(code **)(*param_1 + 0x18))(param_1,&local_320);
      }
      FUN_1403555d0(&local_348);
      break;
    case 0xfa07:
      FUN_14035b390(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_1405d88b8);
      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_1405d88b8,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
        uVar11 = FUN_1400174a0(local_res10,local_c8,0xfffffffe);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_c8);
        local_res20 = &local_198;
        FUN_14034fe70();
        local_198 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_198,local_res10);
        uVar11 = FUN_140003060(local_70,PTR_DAT_1405d88b8,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa07,PTR_DAT_1405d88b8,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_1405d88b8;
        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_1405d88b8);
      }
      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_1405d88b8;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa08:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_1403840e0(param_2,local_res10,1);
      local_res20 = (undefined8 ***)CONCAT44(local_res20._4_4_,(uint)(byte)local_res10[0]);
      FUN_14034fe70();
      local_358 = (undefined8 **)PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_2,&local_358);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_1405d88c0);
      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_1405d88c0,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
        uVar11 = FUN_1403a1680((ulonglong)local_res20 & 0xffffffff);
        FUN_140017790(local_res10,uVar11);
        FUN_140017790(local_res10,&DAT_14047edb0);
        FUN_1403a1d20(local_res10,&local_358);
        FUN_140017790(local_res10,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_1400174a0(local_res10,local_110,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_110);
        local_350 = &local_1d0;
        FUN_14034fe70();
        local_1d0 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_1d0,local_res10);
        uVar11 = FUN_140003060(local_b8,PTR_DAT_1405d88c0,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa08,PTR_DAT_1405d88c0,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_1405d88c0;
        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_1405d88c0);
      }
      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_1405d88c0;
        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_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_1403840e0(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_14034fe70();
      local_358 = (undefined8 **)PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_2,&local_358);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_1405d88c8);
      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_1405d88c8,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        FUN_1403a1a60(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        FUN_1403a1d20(&local_res20,&local_358);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_1400174a0(&local_res20,local_100,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_100);
        local_350 = &local_160;
        FUN_14034fe70();
        local_160 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_160,&local_res20);
        uVar11 = FUN_140003060(local_50,PTR_DAT_1405d88c8,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa09,PTR_DAT_1405d88c8,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_1405d88c8;
        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_1405d88c8);
      }
      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_1405d88c8;
        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_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_14034fe70();
      local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_2,&local_res20);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_1405d88d0);
      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_1405d88d0,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
        FUN_1403a1d20(local_res10,&local_res20);
        FUN_140017790(local_res10,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_1400174a0(local_res10,local_f0,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_f0);
        local_350 = &local_1c0;
        FUN_14034fe70();
        local_1c0 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_1c0,local_res10);
        uVar11 = FUN_140003060(local_40,PTR_DAT_1405d88d0,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0a,PTR_DAT_1405d88d0,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_1405d88d0;
        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_1405d88d0);
      }
      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_1405d88d0;
        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_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,local_res10);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_1405d88d8);
      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_1405d88d8,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        local_1a0[0] = local_res10[0]._0_4_;
        FUN_1403a1a60(&local_res20,local_1a0);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_1400174a0(&local_res20,local_e0,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_e0);
        local_350 = &local_188;
        FUN_14034fe70();
        local_188 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_188,&local_res20);
        uVar11 = FUN_140003060(local_a8,PTR_DAT_1405d88d8,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0b,PTR_DAT_1405d88d8,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_1405d88d8;
        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_1405d88d8);
      }
      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_1405d88d8;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa0c:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,local_res10);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_1405d88e0);
      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_1405d88e0,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        local_190[0] = local_res10[0]._0_4_;
        FUN_1403a1a60(&local_res20,local_190);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_1400174a0(&local_res20,local_d8,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_d8);
        local_350 = &local_220;
        FUN_14034fe70();
        local_220 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_220,&local_res20);
        uVar11 = FUN_140003060(local_58,PTR_DAT_1405d88e0,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0c,PTR_DAT_1405d88e0,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_1405d88e0;
        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_1405d88e0);
      }
      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_1405d88e0;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa0d:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_14034fe70();
      local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
      thunk_FUN_140385220(param_2,&local_res20);
      (**(code **)(*(longlong *)param_1[2] + 0x48))
                ((longlong *)param_1[2],param_2,PTR_DAT_1405d88e8);
      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_1405d88e8,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
        FUN_1403a1d20(local_res10,&local_res20);
        FUN_140017790(local_res10,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_1400174a0(local_res10,local_118,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_118);
        local_350 = &local_218;
        FUN_14034fe70();
        local_218 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_218,local_res10);
        uVar11 = FUN_140003060(local_98,PTR_DAT_1405d88e8,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0d,PTR_DAT_1405d88e8,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_1405d88e8;
        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_1405d88e8);
      }
      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_1405d88e8;
        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_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_1403840e0(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_1405d88f0);
      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_1405d88f0,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
        FUN_1403a1bf0(local_res10,&local_res20);
        FUN_140017790(local_res10,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res10[0] != (undefined8 ****)0x0) &&
           (local_res10[0] != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res10[0] + -1);
        }
        uVar11 = FUN_1400174a0(local_res10,local_e8,iVar14 + -2);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_e8);
        local_350 = &local_208;
        FUN_14034fe70();
        local_208 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_208,local_res10);
        uVar11 = FUN_140003060(local_68,PTR_DAT_1405d88f0,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0e,PTR_DAT_1405d88f0,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_1405d88f0;
        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_1405d88f0);
      }
      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_1405d88f0;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa0f:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_res20);
      cVar5 = FUN_1403840e0(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_1405d88f8);
      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_1405d88f8,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_358 = (undefined8 **)PTR_DAT_1405d8010;
        local_180 = local_res20._0_4_;
        FUN_1403a1a60(&local_358,&local_180);
        FUN_140017790(&local_358,&DAT_14047edb0);
        FUN_1403a1ac0(&local_358,local_res10);
        FUN_140017790(&local_358,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ***)local_358 != (undefined8 ***)0x0) &&
           (local_358 != (undefined8 **)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_358 + -1);
        }
        uVar11 = FUN_1400174a0(&local_358,local_108,iVar14 + -2);
        FUN_140003100(&local_358,uVar11);
        FUN_1400031d0(local_108);
        local_350 = &local_1f8;
        FUN_14034fe70();
        local_1f8 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_1f8,&local_358);
        uVar11 = FUN_140003060(local_88,PTR_DAT_1405d88f8,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa0f,PTR_DAT_1405d88f8,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_1405d88f8;
        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_1405d88f8);
      }
      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_1405d88f8;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa10:
      FUN_14035b390(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_1405d8900);
      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_1405d8900,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res10[0] = (undefined8 ***)PTR_DAT_1405d8010;
        uVar11 = FUN_1400174a0(local_res10,local_130,0xfffffffe);
        FUN_140003100(local_res10,uVar11);
        FUN_1400031d0(local_130);
        local_res20 = &local_1e8;
        FUN_14034fe70();
        local_1e8 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_1e8,local_res10);
        uVar11 = FUN_140003060(local_48,PTR_DAT_1405d8900,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa10,PTR_DAT_1405d8900,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_1405d8900;
        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_1405d8900);
      }
      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_1405d8900;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa11:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_1403840e0(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_1405d8908);
      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_1405d8908,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        FUN_1403a18c0(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_1400174a0(&local_res20,local_f8,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_f8);
        local_350 = &local_1d8;
        FUN_14034fe70();
        local_1d8 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_1d8,&local_res20);
        uVar11 = FUN_140003060(local_78,PTR_DAT_1405d8908,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa11,PTR_DAT_1405d8908,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_1405d8908;
        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_1405d8908);
      }
      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_1405d8908;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa12:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      FUN_140384b70(param_2,&local_358);
      cVar5 = FUN_1403840e0(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_1403840e0(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_1405d8910);
      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_1405d8910,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_2e8 = (undefined **)PTR_DAT_1405d8010;
        local_178[0] = local_358._0_4_;
        FUN_1403a1a60(&local_2e8,local_178);
        FUN_140017790(&local_2e8,&DAT_14047edb0);
        FUN_1403a1ac0(&local_2e8,&local_res20);
        FUN_140017790(&local_2e8,&DAT_14047edb0);
        FUN_1403a1ac0(&local_2e8,local_res10);
        FUN_140017790(&local_2e8,&DAT_14047edb0);
        iVar14 = 0;
        if ((local_2e8 != (undefined **)0x0) && (local_2e8 != (undefined **)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_2e8 + -1);
        }
        uVar11 = FUN_1400174a0(&local_2e8,local_128,iVar14 + -2);
        FUN_140003100(&local_2e8,uVar11);
        FUN_1400031d0(local_128);
        local_350 = &local_1c8;
        FUN_14034fe70();
        local_1c8 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_1c8,&local_2e8);
        uVar11 = FUN_140003060(local_b0,PTR_DAT_1405d8910,0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfa12,uVar11,&local_1c8);
        ppuVar9 = local_2e8;
        if (local_2e8 == (undefined **)0x0) {
          ppuVar9 = (undefined **)PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa12,PTR_DAT_1405d8910,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_1405d8910;
        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_1405d8910);
      }
      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_1405d8910;
        goto LAB_140367ea5;
      }
      break;
    case 0xfa13:
      FUN_14035b390(local_2b8);
      local_2b4 = param_2[10];
      local_2b8[0] = (undefined1)param_2[0x10];
      cVar5 = FUN_1403840e0(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_1405d8918);
      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_1405d8918,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_res20 = (undefined8 ***)PTR_DAT_1405d8010;
        FUN_1403a1ac0(&local_res20,local_res10);
        FUN_140017790(&local_res20,&DAT_14047edb0);
        iVar14 = 0;
        if (((undefined8 ****)local_res20 != (undefined8 ****)0x0) &&
           (local_res20 != (undefined8 ***)PTR_DAT_1405d8010)) {
          iVar14 = *(int *)(local_res20 + -1);
        }
        uVar11 = FUN_1400174a0(&local_res20,local_120,iVar14 + -2);
        FUN_140003100(&local_res20,uVar11);
        FUN_1400031d0(local_120);
        local_350 = &local_1b8;
        FUN_14034fe70();
        local_1b8 = (undefined8 **)PTR_DAT_1405d8010;
        FUN_140003100(&local_1b8,&local_res20);
        uVar11 = FUN_140003060(local_a0,PTR_DAT_1405d8918,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_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfa13,PTR_DAT_1405d8918,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_1405d8918;
        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_1405d8918);
      }
      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_1405d8918;
        goto LAB_140367ea5;
      }
      break;
    default:
      goto switchD_140364463_default;
    }
    uVar11 = 1;
  }
  return uVar11;
}



undefined1
FUN_140367f50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbf7);
  FUN_140058470(local_30,*param_4);
  FUN_140058870(local_30,*param_5);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_8 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_9 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8930,0xfbf7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1403680e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbf7);
  FUN_140058470(local_30,*param_5);
  FUN_140058870(local_30,*param_6);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_8 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_9 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_10 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_10 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8930,0xfbf7);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_140368280(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbf8);
  FUN_140058470(local_30,*param_4);
  uVar1 = *(undefined2 *)(param_5 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_5 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8938,0xfbf8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1403683b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbf8);
  FUN_140058470(local_30,*param_5);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8938,0xfbf8);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1403684f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbf9);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8940,0xfbf9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403685e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbf9);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8940,0xfbf9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403686e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfa);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8948,0xfbfa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403687d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfa);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8948,0xfbfa);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403688d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfb);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_8 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_9 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8950,0xfbfb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_140368a60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfb);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_8 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_9 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_10 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_10 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8950,0xfbfb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1 FUN_140368c00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8958,0xfbfc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140368cc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfc);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8958,0xfbfc);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140368d90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8960,0xfbfd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140368e50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfd);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8960,0xfbfd);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140368f20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfe);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8968,0xfbfe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140368fe0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbfe);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8968,0xfbfe);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403690b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbff);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8970,0xfbff);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140369170(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfbff);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8970,0xfbff);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369240(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc00);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8978,0xfc00);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369320(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc00);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8978,0xfc00);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140369400(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc01);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8980,0xfc01);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403694c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc01);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8980,0xfc01);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140369590(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc02);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8988,0xfc02);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140369650(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc02);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8988,0xfc02);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369720(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc03);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8990,0xfc03);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369800(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc03);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8990,0xfc03);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403698e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc04);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d8998,0xfc04);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403699c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc04);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d8998,0xfc04);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369aa0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc05);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d89a0,0xfc05);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369b80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc05);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d89a0,0xfc05);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140369c60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc06);
  FUN_1403a1760(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d89a8,0xfc06);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369d40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc06);
  FUN_1403a1760(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d89a8,0xfc06);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369e20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc07);
  FUN_140058870(local_30,*param_4);
  FUN_1403a1760(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d89b0,0xfc07);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140369f10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfc07);
  FUN_140058870(local_30,*param_5);
  FUN_1403a1760(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d89b0,0xfc07);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined8 FUN_14036a000(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_14034ed40(uVar4);
  uVar8 = 1;
  if (DAT_1405f064f != '\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_14034edd0(uVar4);
  return 1;
}



undefined8 FUN_14036a0f0(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_14034edd0(uVar4);
  return 1;
}



undefined8
FUN_14036a1e0(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_14034ed40(uVar2);
  if (DAT_1405f064f != '\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_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    puVar5 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8010;
    }
    FUN_140017720(&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_1405d8010;
    }
    FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),*param_4,puVar4);
    if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1405d8010)) &&
       (puVar5 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      FUN_14034ed40(uVar3);
      piVar1 = (int *)(puVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar5 + -8);
      }
      FUN_14034edd0(uVar3);
    }
  }
  FUN_14034edd0(uVar2);
  return 1;
}



undefined8
FUN_14036a320(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_14034ed40(uVar3);
  local_f8 = 1;
  if (DAT_1405f064f != '\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_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    FUN_140017720(&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_140363d20(&local_108,&local_res8,param_5);
    puVar8 = (undefined *)*plVar6;
    if ((undefined *)*plVar6 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1405d8010;
    }
    FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),2,puVar8);
    if (((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1405d8010)) &&
       (local_108 + -8 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_88 = uVar4;
      FUN_14034ed40(uVar4);
      local_80 = 1;
      piVar1 = (int *)(local_108 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_108 + -8);
      }
      FUN_14034edd0(uVar4);
    }
    puVar8 = local_res8;
    if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
       (puVar2 = local_res8 + -8, puVar2 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_68 = uVar4;
      FUN_14034ed40(uVar4);
      local_60 = 1;
      piVar1 = (int *)(puVar8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar2);
      }
      FUN_14034edd0(uVar4);
    }
  }
  if ((*(int *)(*(longlong *)(param_1 + 0x20) + 0x1804) < *param_4) &&
     (lVar5 = FUN_140361850(*(longlong *)(param_1 + 0x20),param_2), lVar5 != 0)) {
    FUN_14034fe70();
    local_res20 = PTR_DAT_1405d8010;
    puVar7 = (undefined8 *)(*(longlong *)(lVar5 + 0x748) + 0x128);
    plVar6 = (longlong *)(**(code **)*puVar7)(puVar7,&local_110);
    puVar8 = (undefined *)*plVar6;
    if ((undefined *)*plVar6 == (undefined *)0x0) {
      puVar8 = PTR_DAT_1405d8010;
    }
    FUN_140017720(&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_1405d8010)) &&
       (local_110 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      local_48 = uVar3;
      FUN_14034ed40(uVar3);
      local_40 = 1;
      piVar1 = (int *)(local_110 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_110 + -8);
      }
      FUN_14034edd0(uVar3);
    }
    *(int *)(*(longlong *)(param_1 + 0x20) + 0x1804) = *param_4;
    uVar3 = FUN_140363d20(&local_118,&local_res20,param_5);
    FUN_140003100(*(longlong *)(param_1 + 0x20) + 0x1808,uVar3);
    if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1405d8010)) &&
       (local_118 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      local_78 = uVar3;
      FUN_14034ed40(uVar3);
      local_70 = 1;
      piVar1 = (int *)(local_118 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_118 + -8);
      }
      FUN_14034edd0(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_1405d8010)) &&
       (puVar2 = local_res20 + -8, puVar2 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      local_58 = uVar3;
      FUN_14034ed40(uVar3);
      local_50 = 1;
      piVar1 = (int *)(puVar8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar2);
      }
      FUN_14034edd0(uVar3);
      uVar3 = local_100;
    }
  }
  FUN_14034edd0(uVar3);
  return 1;
}



undefined8 FUN_14036a6c0(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_1405f2490);
        }
        break;
      }
      piVar5 = *(int **)(piVar5 + 4);
      if (piVar5 == (int *)0x0) break;
    }
  }
  FUN_14034edd0(uVar4);
  return 1;
}



undefined8 FUN_14036a800(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_14034ed40(uVar5);
  uVar10 = 1;
  if (DAT_1405f064f != '\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_14034f7d0();
          }
          FUN_1400179d0(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_14000d3f0(uVar9,uVar8,(longlong)iVar2);
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
          (**(code **)(*plVar7 + 0xf0))(plVar7,(ulonglong)param_2,&DAT_1405f2490);
        }
        break;
      }
      puVar6 = *(uint **)(puVar6 + 4);
      if (puVar6 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar5);
  return 1;
}



undefined8 FUN_14036a960(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_14034ed40(uVar4);
  uVar8 = 1;
  if (DAT_1405f064f != '\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_14034edd0(uVar4);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014036ab5f)

undefined8
FUN_14036aa50(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_14034ed40(uVar1);
  if (DAT_1405f064f != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),L"Proud::CNetServerImpl::C2SStub::ReportP2PPeerPing");
  }
  lVar2 = FUN_140361850(*(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_14034edd0(uVar1);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014036ad12)

undefined8
FUN_14036ab90(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_14034ed40(uVar3);
  if (DAT_1405f064f != '\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_14034edd0(uVar3);
  return 1;
}



undefined8 FUN_14036ad40(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_14034edd0(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,0x00014036b290)

void FUN_14036ae30(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_1405d84f0 ^ (ulonglong)local_db8;
  uVar6 = (**(code **)(*param_1 + 0x58))();
  local_d48 = uVar6;
  FUN_14034ed40(uVar6);
  local_d40 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::PurgeTooOldUnmatureClient");
  }
  if ((int)param_1[0x2e1] < 1) {
    FUN_14034edd0(uVar6);
    goto LAB_14036b348;
  }
  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_14036af28:
      puVar14 = (undefined8 *)(puVar8 + 4);
      puVar11 = puVar10;
    }
  }
  else {
    puVar8 = malloc(_Size);
    puVar14 = (undefined8 *)0x0;
    puVar11 = auStack_dd8;
    if (puVar8 != (undefined4 *)0x0) {
      *puVar8 = 0xdddd;
      goto LAB_14036af28;
    }
  }
  *(undefined8 *)(puVar11 + -8) = 0x14036af38;
  dVar5 = (double)FUN_14035a290(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_1405f0688 < dVar5 - *(double *)(lVar2 + 0x690)) && (*(char *)(lVar2 + 0x698) == '\0'))
    {
      *(undefined8 *)(puVar11 + -8) = 0x14036af8c;
      FUN_1403a0550(lVar2 + 0xc0);
      puVar14[lVar12] = lVar2;
      lVar12 = lVar12 + 1;
    }
  }
  *(undefined8 *)(puVar11 + -8) = 0x14036afa4;
  FUN_14034edd0(uVar6);
  local_d40 = 0;
  while ((0 < lVar12 && (lVar13 = 0, 0 < lVar12))) {
    do {
      lVar2 = puVar14[lVar13];
      pcVar3 = *(code **)(*(longlong *)(lVar2 + 0x108) + 0x10);
      *(undefined8 *)(puVar11 + -8) = 0x14036afd2;
      uVar6 = (*pcVar3)();
      local_d88 = 0;
      local_d90 = uVar6;
      if (lVar13 == 0) {
        local_d88 = 1;
        *(undefined8 *)(puVar11 + -8) = 0x14036b14d;
        FUN_14034ed40(uVar6);
        *(undefined8 *)(puVar11 + -8) = 0x14036b156;
        FUN_1403841b0(local_db8);
        *(undefined8 *)(puVar11 + -8) = 0x14036b160;
        FUN_140383c40(local_db8);
        *(undefined8 *)(puVar11 + -8) = 0x14036b16e;
        FUN_140384310(local_db8,0x800);
        *(undefined8 *)(puVar11 + -8) = 0x14036b179;
        FUN_140384310(local_db8,0);
        *(undefined8 *)(puVar11 + -8) = 0x14036b185;
        FUN_140058870(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) = 0x14036b32f;
            FUN_140399790();
          }
        }
        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_14036b329;
            FUN_140399790();
          }
          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) = 0x14036b220;
        FUN_1403a03a0(uVar4,&local_cd8);
        if (local_58 == (undefined4 *)0x0) {
          *(undefined8 *)(puVar11 + -8) = 0x14036b310;
          FUN_14034f420(local_d20,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
          *(undefined8 *)(puVar11 + -8) = 0x14036b323;
          _CxxThrowException(local_d20,(ThrowInfo *)&DAT_1405d36c0);
        }
        if (local_4c < 0) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar11 + -8) = &UNK_14036b2fc;
          FUN_14034f7d0();
        }
        *(undefined1 *)(lVar2 + 0x698) = 1;
        *(undefined8 *)(puVar11 + -8) = 0x14036b24d;
        FUN_14034edd0(uVar6);
        local_d88 = '\0';
        *(undefined8 *)(puVar11 + -8) = 0x14036b25f;
        FUN_1403a0560(lVar2 + 0xc0);
        *puVar14 = puVar14[lVar12 + -1];
        lVar12 = lVar12 + -1;
        local_d80 = &local_db0;
        *(undefined8 *)(puVar11 + -8) = 0x14036b27e;
        FUN_140399690(&local_db0);
        if ((local_da8 != 0) && (local_d9c < 0)) {
                    // WARNING: Subroutine does not return
          *(undefined8 *)(puVar11 + -8) = 0x14036b2f6;
          FUN_14034f7d0();
        }
      }
      else {
        *(undefined8 *)(puVar11 + -8) = 0x14036afee;
        local_d88 = FUN_14034ed90();
        if (local_d88 != '\0') {
          *(undefined8 *)(puVar11 + -8) = 0x14036b005;
          FUN_1403841b0(local_db8);
          *(undefined8 *)(puVar11 + -8) = 0x14036b00f;
          FUN_140383c40(local_db8);
          *(undefined8 *)(puVar11 + -8) = 0x14036b01d;
          FUN_140384310(local_db8,0x800);
          *(undefined8 *)(puVar11 + -8) = 0x14036b028;
          FUN_140384310(local_db8,0);
          *(undefined8 *)(puVar11 + -8) = 0x14036b034;
          FUN_140058870(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) = 0x14036b2f0;
              FUN_140399790();
            }
          }
          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_14036b2ea;
              FUN_140399790();
            }
            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) = 0x14036b0ca;
          FUN_1403a03a0(uVar4,&local_cd8);
          if (local_58 == (undefined4 *)0x0) {
            *(undefined8 *)(puVar11 + -8) = 0x14036b2d1;
            FUN_14034f420(local_d20,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar11 + -8) = 0x14036b2e4;
            _CxxThrowException(local_d20,(ThrowInfo *)&DAT_1405d36c0);
          }
          if (local_4c < 0) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar11 + -8) = &UNK_14036b2bd;
            FUN_14034f7d0();
          }
          *(undefined1 *)(lVar2 + 0x698) = 1;
          *(undefined8 *)(puVar11 + -8) = 0x14036b0f7;
          FUN_14034edd0(uVar6);
          local_d88 = '\0';
          *(undefined8 *)(puVar11 + -8) = 0x14036b109;
          FUN_1403a0560(lVar2 + 0xc0);
          puVar14[lVar13] = puVar14[lVar12 + -1];
          lVar12 = lVar12 + -1;
          local_d80 = &local_db0;
          *(undefined8 *)(puVar11 + -8) = 0x14036b129;
          FUN_140399690(&local_db0);
          if ((local_da8 != 0) && (local_d9c < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar11 + -8) = 0x14036b2b7;
            FUN_14034f7d0();
          }
        }
      }
      lVar13 = lVar13 + 1;
    } while (lVar13 < lVar12);
  }
  if ((puVar14 != (undefined8 *)0x0) && (*(int *)(puVar14 + -2) == 0xdddd)) {
    *(undefined8 *)(puVar11 + -8) = 0x14036b347;
    free(puVar14 + -2);
  }
LAB_14036b348:
  *(undefined8 *)(puVar11 + -8) = 0x14036b357;
  return;
}



longlong * FUN_14036b390(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_14034ed40(uVar3);
  uVar10 = 1;
  if (DAT_1405f064f != '\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_14036b451;
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  plVar4 = plVar6;
LAB_14036b451:
  if (plVar4 == (longlong *)0x0) {
    if (param_2 == 1) {
      plVar6 = param_1 + 0x108;
      goto LAB_14036b46b;
    }
  }
  else {
    plVar6 = plVar4 + 0x51;
LAB_14036b46b:
    if (plVar6 != (longlong *)0x0) {
      cVar2 = FUN_1403953f0(plVar6);
      if ((cVar2 == '\0') || (((char)plVar6[0x7f] == '\0' && ((int)plVar6[0x7d] == 0)))) {
        FUN_140017720(param_3,L"key not exists");
        FUN_14034edd0(uVar3);
        return (longlong *)0x0;
      }
      goto LAB_14036b4d2;
    }
  }
  pwVar7 = L"not NULL";
  if (plVar4 == (longlong *)0x0) {
    pwVar7 = L"NULL";
  }
  FUN_140017720(param_3,L"%d remote rc is %s in netserver!",param_2,pwVar7,uVar8,uVar9,uVar10);
LAB_14036b4d2:
  FUN_14034edd0(uVar3);
  return plVar6;
}



undefined8 FUN_14036b500(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_14034ed40(uVar6);
  if (DAT_1405f064f != '\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_14034fe70();
            local_res8 = PTR_DAT_1405d8010;
            FUN_140017720(&local_res8,&DAT_140452aa0,param_2);
            puVar5 = local_res8;
            puVar9 = local_res8;
            if (local_res8 == (undefined *)0x0) {
              puVar9 = PTR_DAT_1405d8010;
            }
            FUN_1403935f0(*(undefined8 *)(param_1 + 0x1748),0,puVar9);
            if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1405d8010)) &&
               (puVar5 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_14034fe70();
              FUN_14034ed40(uVar7);
              piVar1 = (int *)(puVar5 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(puVar5 + -8);
              }
              FUN_14034edd0(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_1405f2490);
          }
          FUN_14034edd0(uVar6);
          return 1;
        }
        break;
      }
      puVar8 = *(uint **)(puVar8 + 4);
      if (puVar8 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar6);
  return 0;
}



double FUN_14036b6f0(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_14034ed40(uVar5);
  if (DAT_1405f064f != '\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_14000d450(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_14034edd0(uVar5);
                  return dVar1 + dVar2;
                }
                dVar1 = *(double *)(lVar10 + 0x188);
                FUN_14034edd0(uVar5);
                return dVar1;
              }
              lVar9 = lVar9 + 1;
              piVar7 = piVar7 + 0xc;
            } while (lVar9 < 2);
          }
        }
        break;
      }
      puVar8 = *(uint **)(puVar8 + 4);
      if (puVar8 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar5);
  return 0.0;
}



undefined8 * FUN_14036b8f0(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  int iVar2;
  
  iVar2 = FUN_14035a0c0(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_1403aca30(param_2,lVar1 + (longlong)iVar2 * 8);
    return param_2;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f800();
}



void thunk_FUN_140363ad0(void)

{
  FUN_140363ad0();
  return;
}



void thunk_FUN_140360b20(void)

{
  FUN_140360b20();
  return;
}



// WARNING: Removing unreachable block (ram,0x00014036bbdd)
// WARNING: Removing unreachable block (ram,0x00014036bb4a)

undefined8 FUN_14036b980(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_14034ed40(uVar3);
  if (DAT_1405f064f != '\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_14036ba61;
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  plVar9 = plVar11;
LAB_14036ba61:
  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_14036bab1;
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  plVar8 = plVar11;
LAB_14036bab1:
  if ((plVar9 == (longlong *)0x0) || (plVar8 == (longlong *)0x0)) {
    FUN_14034edd0(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_14034edd0(uVar3);
    uVar3 = 1;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong * FUN_14036bc20(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_1405d84f0 ^ (ulonglong)auStack_128;
  local_108 = 0;
  plVar4 = *(longlong **)(param_1 + 0x6a0);
  if ((plVar4 == (longlong *)0x0) || (*plVar4 == 0)) {
    FUN_14034fe70();
    *param_2 = (longlong)PTR_DAT_1405d8008;
    FUN_14000d220(param_2,&DAT_1405f08d0);
    *(undefined2 *)(param_2 + 1) = DAT_1405f08d8;
  }
  else {
    uVar3 = FUN_140354860(*plVar4,local_d8);
    FUN_140353d20(&local_100,uVar3);
    uVar3 = FUN_1403544e0(local_c8);
    plVar4 = (longlong *)FUN_140353c30(uVar3,&local_108);
    puVar5 = (undefined *)*plVar4;
    if ((undefined *)*plVar4 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8008;
    }
    FUN_140353f50(&local_100,puVar5);
    puVar5 = (undefined *)CONCAT44(uStack_104,local_108);
    if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1405d8008)) &&
       (puVar5 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      local_f0 = uVar3;
      FUN_14034ed40(uVar3);
      local_e8 = 1;
      piVar1 = (int *)(puVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar5 + -8);
      }
      FUN_14034edd0(uVar3);
    }
    puVar5 = *(undefined **)(param_1 + 0x170);
    if (*(undefined **)(param_1 + 0x170) == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8008;
    }
    FUN_140353f50(&local_100,puVar5);
    puVar5 = *(undefined **)(param_1 + 0x168);
    if (*(undefined **)(param_1 + 0x168) == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8008;
    }
    FUN_140353f50(&local_100,puVar5);
    cVar2 = FUN_140354370(&local_100);
    if (cVar2 == '\0') {
      plVar4 = (longlong *)FUN_140353f90(&local_108);
      puVar5 = (undefined *)*plVar4;
      if ((undefined *)*plVar4 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1405d8010;
      }
      local_b8 = local_b0;
      FUN_14034ef40(&local_b8,puVar5,3);
      FUN_14034f220(&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_1405d8010)) &&
         (puVar5 + -8 != (undefined *)0x0)) {
        uVar3 = FUN_14034fe70();
        local_f0 = uVar3;
        FUN_14034ed40(uVar3);
        local_e8 = 1;
        piVar1 = (int *)(puVar5 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar5 + -8);
        }
        FUN_14034edd0(uVar3);
      }
    }
    FUN_14034fe70();
    puVar5 = PTR_DAT_1405d8008;
    *param_2 = (longlong)PTR_DAT_1405d8008;
    if (puVar5 == (undefined *)0x0) {
      *param_2 = (longlong)PTR_DAT_1405d8008;
    }
    if (local_100 != (undefined *)*param_2) {
      uVar3 = FUN_14034fe70();
      local_f0 = uVar3;
      FUN_14034ed40(uVar3);
      local_e8 = 1;
      FUN_14000d2c0(param_2);
      *param_2 = (longlong)local_100;
      if (((local_100 != PTR_DAT_1405d8008) && (local_100 != (undefined *)0x0)) &&
         (local_100 != (undefined *)0x8)) {
        *(int *)(local_100 + -4) = *(int *)(local_100 + -4) + 1;
      }
      FUN_14034edd0(uVar3);
    }
    *(undefined2 *)(param_2 + 1) = local_f8;
    if (((local_100 != (undefined *)0x0) && (local_100 != PTR_DAT_1405d8008)) &&
       (local_100 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      local_f0 = uVar3;
      FUN_14034ed40(uVar3);
      local_e8 = 1;
      piVar1 = (int *)(local_100 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_100 + -8);
      }
      FUN_14034edd0(uVar3);
    }
  }
  return param_2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14036bf20(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_1405d84f0 ^ (ulonglong)auStack_d78;
  if (((DAT_1405d80f8 * 1.5 < param_3 - (double)param_2[0x37]) &&
      (param_3 - (double)param_2[0x33] < DAT_1405d80f8)) &&
     (DAT_1405d80f8 < param_3 - (double)param_2[0x34])) {
    param_2[0x34] = (longlong)param_3;
    FUN_1403841b0(local_d38);
    FUN_140383c40(local_d38);
    FUN_140058870(local_d38,0x1d);
    uVar2 = (**(code **)(param_2[0x21] + 0x10))();
    local_d10 = uVar2;
    FUN_14034ed40(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_140399790();
      }
    }
    else {
      local_d20 = *(undefined4 *)(local_d30 + 0x18);
    }
    lVar3 = local_d28;
    if (local_d28 == 0) {
      if (local_d30 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_1405d81cc;
    uStack_ca0 = local_d20;
    uVar1 = (**(code **)(*param_2 + 0x10))(param_2);
    FUN_1403a1dc0(param_2 + 0xe0,uVar1,&local_ca8,&local_d58);
    if (local_28 == (undefined4 *)0x0) {
      FUN_14034f420(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_1c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_14034edd0(uVar2);
    local_d58 = &local_d30;
    FUN_140399690(&local_d30);
    if ((local_d28 != 0) && (local_d1c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14036c160(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_1405d84f0 ^ (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_14035dcf0(param_2 + 0x18,0);
    goto LAB_14036c71e;
  }
  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_14000d450(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_140399840(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_14039a5b0(lVar6);
      if (0.0 <= dVar18) {
        dVar18 = (double)FUN_14039a5b0(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_14036c297:
      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_14036c297;
    }
  }
  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) = 0x14036c4a1;
      FUN_14000d450(0x80004005);
    }
    *(undefined4 *)(puVar10 + 0x20) = 0;
    uVar17 = *(undefined8 *)(uVar8 + 0x10);
    *(undefined8 *)(puVar10 + -8) = 0x14036c4be;
    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_14036c50d;
        FUN_14000d450(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) = 0x14036c2e5;
  FUN_140363d90(plVar13,uVar14,0);
  *(undefined8 *)(puVar10 + -8) = 0x14036c2f1;
  FUN_14035dcf0(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_14036c462;
        FUN_14034f800();
      }
      *(undefined4 *)(uVar7 + *(longlong *)(param_2 + 0x1c)) = *(undefined4 *)(*plVar15 + 0x6f8);
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_14036c45c;
        FUN_14034f800();
      }
      *(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_14036c456;
        FUN_14034f800();
      }
      *(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_14036c450;
        FUN_14034f800();
      }
      lVar6 = *(longlong *)(param_2 + 0x1c);
      lVar2 = *plVar15;
      *(undefined8 *)(puVar10 + -8) = 0x14036c384;
      uVar3 = FUN_140399840(lVar2);
      *(undefined1 *)(uVar7 + 0x11 + lVar6) = uVar3;
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_14036c44a;
        FUN_14034f800();
      }
      *(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_14036c444;
        FUN_14034f800();
      }
      lVar6 = *(longlong *)(param_2 + 0x1c);
      uVar1 = *param_2;
      lVar2 = *plVar15;
      *(undefined8 *)(puVar10 + -8) = 0x14036c3c0;
      uVar17 = FUN_14039a5b0(lVar2,uVar1);
      *(undefined8 *)(uVar7 + 0x20 + lVar6) = uVar17;
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_14036c43e;
        FUN_14034f800();
      }
      *(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_14036c438;
        FUN_14034f800();
      }
      *(longlong *)(*(longlong *)(param_2 + 0x1c) + 0x30 + uVar7) = plVar15[2];
      if ((int)param_2[0x1e] <= iVar11) {
                    // WARNING: Subroutine does not return
        *(undefined **)(puVar10 + -8) = &UNK_14036c432;
        FUN_14034f800();
      }
      *(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) = 0x14036c482;
    free(plVar13 + -2);
  }
LAB_14036c71e:
  *(undefined8 *)(puVar10 + -8) = 0x14036c72a;
  return;
}



void FUN_14036c760(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_14036c160(param_1,0);
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
    else {
      FUN_14036c160(param_1,**(undefined8 **)(lVar1 + 8));
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
  }
  return;
}



void FUN_14036c7c0(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_14034ed40(uVar1);
  if (DAT_1405f064f != '\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_14036c160(param_1,uVar2);
  }
  FUN_14034edd0(uVar1);
  return;
}



void FUN_14036c870(longlong param_1)

{
  undefined *puVar1;
  undefined8 uVar2;
  undefined *local_res8;
  
  puVar1 = *(undefined **)(param_1 + 0x1808);
  if (((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1405d8010)) &&
     (*(int *)(puVar1 + -8) != 0)) {
    FUN_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    FUN_140003100(&local_res8,param_1 + 0x1808);
    FUN_140352d80(&local_res8);
  }
  uVar2 = (**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
  *(undefined4 *)(param_1 + 0x1804) = 0;
  *(undefined8 *)(param_1 + 0x1810) = uVar2;
  FUN_14000d470(param_1 + 0x1808,&DAT_140477960);
  LOCK();
  *(undefined4 *)(param_1 + 0x1840) = 0;
  UNLOCK();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14036c910(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_14036c160(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_1405d8158 < 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_1405f2490,
                 &local_res20);
    }
    lVar1 = 0;
    if (lVar2 != 0) {
      lVar1 = *(longlong *)(lVar2 + 0x18);
    }
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_14036cb40(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_14012c550(&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_14034fe70();
    local_58 = PTR_DAT_1405d8010;
    local_60 = *param_4;
    local_5c = param_4[1];
    FUN_14000d470(&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_1405f2490,&local_48,&local_60);
    FUN_1400031d0(&local_58);
    local_48 = Proud::CFastArray<>::vftable;
    if (local_38 != (undefined8 *)0x0) {
      if (local_40 == (longlong *)0x0) {
        FUN_14034ff60(local_38);
      }
      else {
        (**(code **)(*local_40 + 0x18))();
      }
    }
  }
  return;
}



void FUN_14036ccc0(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_14034fe70();
  local_48 = (uint *)PTR_DAT_1405d8010;
  uVar1 = FUN_14034fcf0(param_4);
  uVar9 = 0;
  uVar7 = 0;
  if ((local_48 != (uint *)0x0) && (uVar7 = 0, local_48 != (uint *)PTR_DAT_1405d8010)) {
    uVar7 = local_48[-2];
  }
  uVar2 = uVar1;
  if ((((int)uVar1 <= (int)uVar7) && (uVar2 = uVar9, local_48 != (uint *)0x0)) &&
     (local_48 != (uint *)PTR_DAT_1405d8010)) {
    uVar2 = local_48[-2];
  }
  uVar7 = 1;
  if (1 < (int)uVar2) {
    uVar7 = uVar2;
  }
  uVar2 = uVar9;
  if ((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1405d8010)) {
    uVar2 = local_48[-2];
  }
  uVar8 = 0;
  if ((int)uVar2 < (int)uVar7) {
    if (local_48 == (uint *)0x0) {
      local_48 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar7 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar7 == 0) {
      FUN_1400031d0(&local_48);
    }
    else {
      uVar2 = uVar9;
      if ((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1405d8010)) {
        uVar2 = local_48[-2];
      }
      if (uVar7 != uVar2) {
        puVar3 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar2 = local_48[-2];
        }
        puVar6 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar7 < (int)uVar2) {
LAB_14036cdf0:
          if (local_48 != (uint *)0x0) {
            puVar6 = local_48;
          }
        }
        else {
          uVar7 = uVar9;
          if (local_48 != (uint *)0x0) {
            if (local_48 != (uint *)PTR_DAT_1405d8010) {
              uVar7 = local_48[-2];
            }
            goto LAB_14036cdf0;
          }
        }
        FUN_14034fd20(puVar3 + 2,puVar6,uVar7);
        FUN_1400031d0(&local_48);
        local_48 = puVar3 + 2;
      }
    }
  }
  FUN_140002e10(&local_48);
  puVar3 = local_48;
  if (local_48 == (uint *)0x0) {
    puVar3 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar3,param_4,uVar1);
  puVar3 = local_48;
  if (local_48 == (uint *)0x0) {
    puVar3 = (uint *)PTR_DAT_1405d8010;
  }
  uVar1 = FUN_14034fcf0(puVar3);
  uVar7 = 0;
  if (0 < (int)uVar1) {
    uVar7 = uVar1;
  }
  uVar1 = uVar8;
  if ((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1405d8010)) {
    uVar1 = local_48[-2];
  }
  if (((int)uVar1 <= (int)uVar7) && (uVar7 = uVar8, local_48 != (uint *)0x0)) {
    if (local_48 == (uint *)PTR_DAT_1405d8010) goto LAB_14036cea7;
    uVar7 = local_48[-2];
  }
  if (((local_48 != (uint *)PTR_DAT_1405d8010) && (local_48 != (uint *)0x0)) &&
     (local_48 + -2 != (uint *)0x0)) {
    local_48[-2] = uVar7;
    *(undefined2 *)((longlong)local_48 + (longlong)(int)uVar7 * 2) = 0;
  }
LAB_14036cea7:
  plVar5 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x68);
  (**(code **)(*plVar5 + 0x50))(plVar5,1,&DAT_1405f2490,local_res10,&local_48,local_res8);
  puVar3 = local_48;
  if (((local_48 != (uint *)0x0) && (local_48 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar6 = local_48 + -2, puVar6 != (uint *)0x0)) {
    uVar4 = FUN_14034fe70();
    local_38 = uVar4;
    FUN_14034ed40(uVar4);
    local_30 = 1;
    puVar3 = puVar3 + -1;
    *puVar3 = *puVar3 - 1;
    if (*puVar3 == 0) {
      FUN_14034ff60(puVar6);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_14036cf50(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_14034ed40(uVar6);
  if (DAT_1405f064f != '\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_14034f800();
      }
      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_14034f800();
      }
      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_14034f7d0();
      }
      iVar13 = *(int *)(param_2 + 0x18);
      FUN_1403abea0(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_1403a2c90(param_2);
          lVar9 = FUN_1403a2c90(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_1403a2c90(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_14034edd0(uVar6);
  return;
}



void FUN_14036d110(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_14034ed40(uVar6);
  if (DAT_1405f064f != '\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_14034f800();
      }
      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_14034f800();
      }
      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_14034f7d0();
      }
      iVar13 = *(int *)(param_2 + 0x18);
      FUN_1403abea0(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_1403a2c90(param_2);
          lVar9 = FUN_1403a2c90(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_1403a2c90(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_14034edd0(uVar6);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14036d2d0(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_1405d84f0 ^ (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_140357640(&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_1403841b0(local_d48);
    FUN_140383c40(local_d48);
    FUN_140384310(local_d48,0x800);
    FUN_140384310(local_d48,0);
    FUN_140058870(local_d48,0xb);
    local_cc8 = *(longlong **)(param_2 + 0x728);
    uStack_cc0 = *(undefined4 *)(param_2 + 0x730);
    uStack_cbc = *(undefined4 *)(param_2 + 0x734);
    FUN_140090370(local_d48,&local_cc8);
    uVar3 = (**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
    local_cb8 = uVar3;
    FUN_14034ed40(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_140399790();
      }
    }
    else {
      local_d30 = *(undefined4 *)(local_d40 + 0x18);
    }
    lVar4 = local_d38;
    if (local_d38 == 0) {
      if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_1403a03a0(*(undefined8 *)(param_2 + 0x748),&local_ca8,&local_cc8);
    if (local_28 == (undefined4 *)0x0) {
      FUN_14034f420(local_d18,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d18,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_1c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_14034edd0(uVar3);
    local_cc8 = &local_d40;
    FUN_140399690(&local_d40);
    if ((local_d38 != 0) && (local_d2c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x00014036d58b)
// WARNING: Removing unreachable block (ram,0x00014036d594)
// WARNING: Removing unreachable block (ram,0x00014036d5b2)
// WARNING: Removing unreachable block (ram,0x00014036d5bb)

undefined1 * FUN_14036d530(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_14036d5e0(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_14000d450(0x80004005);
    }
    lVar11 = *plVar6;
    uVar7 = (**(code **)(*(longlong *)(lVar11 + 0x108) + 0x10))();
    cVar5 = FUN_14034ee70(uVar7);
    if (cVar5 == '\x01') {
      FUN_14034fe70();
      local_res8 = PTR_DAT_1405d8010;
      FUN_140017720(&local_res8,L"RemoteClient DeadLock - %s",uVar8,param_4,uVar13);
      puVar4 = local_res8;
      puVar10 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1405d8010;
      }
      FUN_14034fa20(puVar10);
      uVar8 = local_res10;
      if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
         (puVar4 + -8 != (undefined *)0x0)) {
        uVar8 = FUN_14034fe70();
        FUN_14034ed40(uVar8);
        piVar1 = (int *)(puVar4 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar4 + -8);
        }
        FUN_14034edd0(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_14034ee70(uVar7);
      if (cVar5 == '\x01') {
        FUN_14034fe70();
        local_res8 = PTR_DAT_1405d8010;
        FUN_140017720(&local_res8,L"UDPSocket DeadLock - %s",uVar8);
        puVar4 = local_res8;
        puVar10 = local_res8;
        if (local_res8 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        FUN_14034fa20(puVar10);
        if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
           (puVar4 + -8 != (undefined *)0x0)) {
          uVar8 = FUN_14034fe70();
          FUN_14034ed40(uVar8);
          piVar1 = (int *)(puVar4 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar4 + -8);
          }
          FUN_14034edd0(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_14034f800();
        }
        plVar6 = *(longlong **)(*(longlong *)(param_1 + 0x6d8) + lVar11 * 8);
        lVar9 = 0;
        if (plVar6 != (longlong *)0x0) {
          lVar9 = *plVar6;
        }
        uVar8 = (**(code **)(*(longlong *)(lVar9 + 0x88) + 0x10))();
        cVar5 = FUN_14034ee70(uVar8);
        if (cVar5 == '\x01') {
          FUN_14034fe70();
          local_res8 = PTR_DAT_1405d8010;
          FUN_140017720(&local_res8,L"UDPSocket DeadLock - %s",uVar13);
          puVar4 = local_res8;
          puVar10 = local_res8;
          if (local_res8 == (undefined *)0x0) {
            puVar10 = PTR_DAT_1405d8010;
          }
          FUN_14034fa20(puVar10);
          uVar13 = local_res10;
          if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
             (puVar4 + -8 != (undefined *)0x0)) {
            uVar13 = FUN_14034fe70();
            FUN_14034ed40(uVar13);
            piVar1 = (int *)(puVar4 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar4 + -8);
            }
            FUN_14034edd0(uVar13);
            uVar13 = local_res10;
          }
        }
        iVar12 = iVar12 + 1;
        lVar11 = lVar11 + 1;
      } while (lVar11 < iVar2);
    }
  }
  cVar5 = FUN_14034ee70(param_1 + 0x798);
  if (cVar5 == '\x01') {
    FUN_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    FUN_140017720(&local_res8,L"NetServer tcpIssueQueueCS DeadLock!! - %s",uVar13);
    puVar4 = local_res8;
    puVar10 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1405d8010;
    }
    FUN_14034fa20(puVar10);
    if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
       (puVar4 + -8 != (undefined *)0x0)) {
      uVar13 = FUN_14034fe70();
      FUN_14034ed40(uVar13);
      piVar1 = (int *)(puVar4 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar4 + -8);
      }
      FUN_14034edd0(uVar13);
    }
  }
  cVar5 = FUN_14034ee70(param_1 + 2000);
  if (cVar5 == '\x01') {
    FUN_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    FUN_140017720(&local_res8,L"NetServer udpIssueQueueCS DeadLock!! - %s",local_res10);
    puVar4 = local_res8;
    puVar10 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar10 = PTR_DAT_1405d8010;
    }
    FUN_14034fa20(puVar10);
    if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
       (puVar4 + -8 != (undefined *)0x0)) {
      uVar13 = FUN_14034fe70();
      FUN_14034ed40(uVar13);
      piVar1 = (int *)(puVar4 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar4 + -8);
      }
      FUN_14034edd0(uVar13);
    }
  }
  return;
}



longlong * FUN_14036da30(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_140360e30(lVar1);
    }
  }
  return param_1;
}



void FUN_14036daa0(longlong *param_1)

{
  longlong *plVar1;
  
  if (*param_1 != 0) {
    plVar1 = (longlong *)(*param_1 + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140363af0(param_1,*param_1);
    }
  }
  return;
}



void FUN_14036dac0(undefined8 *param_1)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_1403d8da0(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 0x00014036db07. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_14034ff60();
  }
  return;
}



undefined8 * FUN_14036db20(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_1403d8da0(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14036db90(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_14034f7d0();
  }
  iVar5 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar5) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar5 = FUN_140385ff0(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_14034fef0(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_14034fef0(lVar8 << 3);
        }
        else {
          lVar7 = (**(code **)(*plVar1 + 8))(plVar1,lVar8 << 3);
        }
        FUN_140364020(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_14034f420(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
        }
        FUN_1403d8da0(uVar2,(longlong)*(int *)(param_1 + 0x18));
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_14034ff60(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_1403d8da0(*(longlong *)(param_1 + 0x10) + lVar7 * 8,(longlong)(iVar5 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_14036dd80(_Container_base12 *param_1)

{
  FUN_140176fd0();
  std::_Container_base12::_Orphan_all(param_1);
  operator_delete(*(void **)param_1);
  *(undefined8 *)param_1 = 0;
                    // WARNING: Could not recover jumptable at 0x00014036ddbc. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12(param_1);
  return;
}



void thunk_FUN_1403638e0(void)

{
  FUN_1403638e0();
  return;
}



longlong * FUN_14036dde0(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_140363940(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_14034f420(local_50,PTR_u_Collection_object_can_use_fast_h_1405d81d0);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14036dec0(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_140363af0(plVar2,*plVar2,param_3,param_4,0xfffffffffffffffe);
    }
  }
  FUN_140399690(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return;
}



undefined1
FUN_14036df30(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_1403841b0(local_48);
  FUN_140383c40(local_48);
  FUN_140017c50(local_48,0xfbf5);
  FUN_140058470(local_48,*param_4);
  FUN_140058470(local_48,*param_5);
  iVar1 = *(int *)(param_6 + 0x18);
  FUN_140385580(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_140399790(0,lVar6);
      }
LAB_14036dfe2:
      FUN_1400178c0(&local_38,lVar6,iVar1);
    }
    else {
      if (local_38 != 0) goto LAB_14036dfe2;
      if (local_40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar6);
      }
      FUN_140017a90(local_40,lVar6,iVar1);
    }
    FUN_140017b00(local_48);
  }
  FUN_140058470(local_48,*param_7);
  iVar1 = *(int *)(param_8 + 0x18);
  FUN_140385580(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_140399790(0,lVar6);
      }
LAB_14036e05f:
      FUN_1400178c0(&local_38,lVar6,iVar1);
    }
    else {
      if (local_38 != 0) goto LAB_14036e05f;
      if (local_40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar6);
      }
      FUN_140017a90(local_40,lVar6,iVar1);
    }
    FUN_140017b00(local_48);
  }
  iVar1 = *(int *)(param_9 + 0x18);
  FUN_140385580(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_140399790(0,lVar6);
      }
LAB_14036e0cd:
      FUN_1400178c0(&local_38,lVar6,iVar1);
    }
    else {
      if (local_38 != 0) goto LAB_14036e0cd;
      if (local_40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar6);
      }
      FUN_140017a90(local_40,lVar6,iVar1);
    }
    FUN_140017b00(local_48);
  }
  FUN_140058470(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_140399790();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_1400179d0(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_14036e199;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_11;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_14036e199:
  FUN_140017b00(local_48);
  FUN_140058870(local_48,*param_12);
  FUN_140017c50(local_48,*param_13);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_48,PTR_DAT_1405d8920,0xfbf5);
  FUN_140399690(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar5;
}



undefined1
FUN_14036e250(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_1403841b0(local_58);
  FUN_140383c40(local_58);
  FUN_140017c50(local_58,0xfbf5);
  FUN_140058470(local_58,*param_5);
  FUN_140058470(local_58,*param_6);
  iVar1 = *(int *)(param_7 + 0x18);
  FUN_140385580(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_140399790(0,lVar6);
      }
LAB_14036e30b:
      FUN_1400178c0(&local_48,lVar6,iVar1);
    }
    else {
      if (local_48 != 0) goto LAB_14036e30b;
      if (local_50 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar6);
      }
      FUN_140017a90(local_50,lVar6,iVar1);
    }
    FUN_140017b00(local_58);
  }
  FUN_140058470(local_58,*param_8);
  iVar1 = *(int *)(param_9 + 0x18);
  FUN_140385580(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_140399790(0,lVar6);
      }
LAB_14036e388:
      FUN_1400178c0(&local_48,lVar6,iVar1);
    }
    else {
      if (local_48 != 0) goto LAB_14036e388;
      if (local_50 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar6);
      }
      FUN_140017a90(local_50,lVar6,iVar1);
    }
    FUN_140017b00(local_58);
  }
  iVar1 = *(int *)(param_10 + 0x18);
  FUN_140385580(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_140399790(0,lVar6);
      }
LAB_14036e3f6:
      FUN_1400178c0(&local_48,lVar6,iVar1);
    }
    else {
      if (local_48 != 0) goto LAB_14036e3f6;
      if (local_50 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar6);
      }
      FUN_140017a90(local_50,lVar6,iVar1);
    }
    FUN_140017b00(local_58);
  }
  FUN_140058470(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_140399790();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_1400179d0(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_14036e4c8;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_12;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14036e4c8:
  FUN_140017b00(local_58);
  FUN_140058870(local_58,*param_13);
  FUN_140017c50(local_58,*param_14);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_58,PTR_DAT_1405d8920,0xfbf5);
  FUN_140399690(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar5;
}



undefined1
FUN_14036e580(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_1403841b0(local_48);
  FUN_140383c40(local_48);
  FUN_140017c50(local_48,0xfbf6);
  FUN_140058470(local_48,*param_4);
  FUN_140058470(local_48,*param_5);
  iVar1 = *(int *)(param_6 + 0x18);
  FUN_140385580(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_140399790(0,lVar6);
      }
LAB_14036e632:
      FUN_1400178c0(&local_38,lVar6,iVar1);
    }
    else {
      if (local_38 != 0) goto LAB_14036e632;
      if (local_40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar6);
      }
      FUN_140017a90(local_40,lVar6,iVar1);
    }
    FUN_140017b00(local_48);
  }
  FUN_140058470(local_48,*param_7);
  FUN_140058470(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_140399790();
    }
  }
  else if (local_38 == 0) {
    if (local_40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(local_40 + 0x18);
    FUN_1400179d0(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_14036e70e;
  }
  lVar6 = (longlong)local_30;
  local_30 = local_30 + 0x10;
  if ((local_30 < 0) || (local_2c < local_30)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(undefined8 *)(local_38 + lVar6) = *param_9;
  ((undefined8 *)(local_38 + lVar6))[1] = uVar2;
LAB_14036e70e:
  FUN_140017b00(local_48);
  FUN_140058870(local_48,*param_10);
  FUN_140017c50(local_48,*param_11);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_48,PTR_DAT_1405d8928,0xfbf6);
  FUN_140399690(&local_40);
  if ((local_38 != 0) && (local_2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar5;
}



undefined1
FUN_14036e7c0(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_1403841b0(local_58);
  FUN_140383c40(local_58);
  FUN_140017c50(local_58,0xfbf6);
  FUN_140058470(local_58,*param_5);
  FUN_140058470(local_58,*param_6);
  iVar1 = *(int *)(param_7 + 0x18);
  FUN_140385580(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_140399790(0,lVar6);
      }
LAB_14036e87b:
      FUN_1400178c0(&local_48,lVar6,iVar1);
    }
    else {
      if (local_48 != 0) goto LAB_14036e87b;
      if (local_50 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar6);
      }
      FUN_140017a90(local_50,lVar6,iVar1);
    }
    FUN_140017b00(local_58);
  }
  FUN_140058470(local_58,*param_8);
  FUN_140058470(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_140399790();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(local_50 + 0x18);
    FUN_1400179d0(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_14036e957;
  }
  lVar6 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(undefined8 *)(local_48 + lVar6) = *param_10;
  ((undefined8 *)(local_48 + lVar6))[1] = uVar2;
LAB_14036e957:
  FUN_140017b00(local_58);
  FUN_140058870(local_58,*param_11);
  FUN_140017c50(local_58,*param_12);
  uVar5 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_58,PTR_DAT_1405d8928,0xfbf6);
  FUN_140399690(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar5;
}



undefined8 FUN_14036ea10(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_14034ed40(uVar5);
  local_30 = 1;
  if (DAT_1405f064f != '\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_14034fe70();
              local_res8 = PTR_DAT_1405d8010;
              uVar6 = 0;
              if (*(longlong *)(lVar3 + 0x740) != 0) {
                uVar6 = *(ulonglong *)(*(longlong *)(lVar3 + 0x740) + 8);
                uVar5 = local_38;
              }
              FUN_140017720(&local_res8,&DAT_140453250,*(undefined4 *)(lVar3 + 0x6f8),
                            uVar6 & 0xffffffff);
              puVar4 = local_res8;
              puVar9 = local_res8;
              if (local_res8 == (undefined *)0x0) {
                puVar9 = PTR_DAT_1405d8010;
              }
              FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),0,puVar9);
              if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
                 (puVar4 + -8 != (undefined *)0x0)) {
                uVar7 = FUN_14034fe70();
                local_28 = uVar7;
                FUN_14034ed40(uVar7);
                local_20 = 1;
                piVar1 = (int *)(puVar4 + -4);
                *piVar1 = *piVar1 + -1;
                if (*piVar1 == 0) {
                  FUN_14034ff60(puVar4 + -8);
                }
                FUN_14034edd0(uVar7);
              }
            }
            *(undefined1 *)(lVar3 + 0x700) = 0;
            *(undefined1 *)(lVar3 + 0x702) = 1;
            local_48 = 0;
            FUN_1403aca30(lVar3 + 0x740,&local_48);
          }
          else {
            FUN_14036d2d0(*(undefined8 *)(param_1 + 0x20),lVar3);
          }
        }
        break;
      }
      puVar8 = *(uint **)(puVar8 + 4);
      if (puVar8 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar5);
  return 1;
}



void FUN_14036ec20(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_14036ecb8;
      if ((*(uint *)(lVar1 + 8) == *(uint *)(param_2 + 0x710)) &&
         (*(ushort *)(lVar1 + 0xc) == *(ushort *)(param_2 + 0x714))) break;
      lVar1 = *(longlong *)(lVar1 + 0x18);
    }
    FUN_14039c290(param_1 + 0x388,lVar1,0);
  }
LAB_14036ecb8:
  if (*(longlong *)(param_2 + 0x120) != 0) {
    FUN_14035cf30(*(longlong *)(param_2 + 0x120),param_2);
  }
  if (*(longlong *)(*(longlong *)(param_2 + 0x748) + 0x110) != 0) {
    FUN_1403552c0();
  }
  if ((*(longlong **)(param_2 + 0x740) != (longlong *)0x0) &&
     (**(longlong **)(param_2 + 0x740) != 0)) {
    FUN_1403a1e90(param_2 + 0x700);
  }
  FUN_140363a40(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_14036ed80;
      if (*puVar2 == *(uint *)(param_2 + 0x6f8)) break;
      puVar2 = *(uint **)(puVar2 + 4);
    }
    FUN_140360170(param_1 + 0xc78,puVar2,0);
  }
LAB_14036ed80:
  plVar3 = *(longlong **)(param_1 + 0x478);
  lVar1 = *plVar3;
  uVar5 = (**(code **)(*(longlong *)(param_1 + 0x118) + 8))();
  (**(code **)(lVar1 + 0x10))(plVar3,uVar5,*(undefined4 *)(param_2 + 0x6f8));
  FUN_140363a40(param_1 + 0x388,param_2 + 0x708,0);
  return;
}



void FUN_14036ede0(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_14036c160(param_1,uVar3);
    }
    if (*(longlong *)(param_1 + 0x17f0) != 0) {
      FUN_14034fe70();
      local_res10 = PTR_DAT_1405d8010;
      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_1405d8010;
      }
      FUN_140017720(&local_res10,&DAT_140453360,*(undefined4 *)(param_2 + 0x6f8),puVar7);
      if (((local_res18 != (undefined *)0x0) && (local_res18 != PTR_DAT_1405d8010)) &&
         (local_res18 + -8 != (undefined *)0x0)) {
        uVar3 = FUN_14034fe70();
        FUN_14034ed40(uVar3);
        piVar1 = (int *)(local_res18 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_res18 + -8);
        }
        FUN_14034edd0(uVar3);
      }
      puVar7 = local_res10;
      puVar6 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar6 = PTR_DAT_1405d8010;
      }
      FUN_1403935f0(*(undefined8 *)(param_1 + 0x17f0),1,puVar6);
      if (((puVar7 != (undefined *)0x0) && (puVar7 != PTR_DAT_1405d8010)) &&
         (puVar7 + -8 != (undefined *)0x0)) {
        uVar3 = FUN_14034fe70();
        FUN_14034ed40(uVar3);
        piVar1 = (int *)(puVar7 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar7 + -8);
        }
        FUN_14034edd0(uVar3);
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14036ef70(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_1405d84f0 ^ (ulonglong)auStack_d78;
  FUN_1403841b0(local_d58);
  FUN_140383c40(local_d58);
  FUN_140384310(local_d58,0x800);
  FUN_140384310(local_d58,0);
  FUN_140058870(local_d58,9);
  iVar1 = *(int *)(param_3 + 0x18);
  FUN_140385580(local_d58,(longlong)iVar1);
  if (*(int *)(param_3 + 0x18) == 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = *(undefined8 *)(param_3 + 0x10);
  }
  if (iVar1 == 0) goto LAB_14036f060;
  local_d54 = 0;
  if (local_d50 == 0) {
    if (local_d48 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,uVar2);
    }
LAB_14036f032:
    FUN_1400178c0(&local_d48,uVar2,iVar1);
  }
  else {
    if (local_d48 != 0) goto LAB_14036f032;
    if (local_d50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,uVar2);
    }
    FUN_140017a90(local_d50,uVar2,iVar1);
  }
  FUN_140017b00(local_d58);
LAB_14036f060:
  uVar2 = (**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
  local_d20 = uVar2;
  FUN_14034ed40(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_140399790();
    }
  }
  else {
    local_d40 = *(undefined4 *)(local_d50 + 0x18);
  }
  lVar3 = local_d48;
  if (local_d48 == 0) {
    if (local_d50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_1403a03a0(*(undefined8 *)(param_2 + 0x748),&local_cb8,&local_d30);
  if (local_38 == (undefined4 *)0x0) {
    FUN_14034f420(local_d08,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d08,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_14034edd0(uVar2);
  local_d30 = &local_d50;
  FUN_140399690(&local_d50);
  if ((local_d48 != 0) && (local_d3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



void FUN_14036f1c0(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_14036c870(param_1);
    }
  }
  return;
}



undefined8 * FUN_14036f200(undefined8 *param_1)

{
  longlong *plVar1;
  undefined4 uVar2;
  int iVar3;
  void *pvVar4;
  longlong lVar5;
  longlong lVar6;
  bool bVar7;
  longlong local_res10;
  
  LOCK();
  bVar7 = DAT_1405f2680 == 0;
  if (bVar7) {
    DAT_1405f2680 = 1;
  }
  UNLOCK();
  if (bVar7) {
    pvVar4 = operator_new(0xc0);
    if (pvVar4 == (void *)0x0) {
      lVar5 = 0;
    }
    else {
      lVar5 = FUN_140394ea0(pvVar4);
    }
    if (lVar5 == 0) {
      lVar6 = 0;
      local_res10 = 0;
    }
    else {
      lVar6 = FUN_14034fef0(0x48);
      if (lVar6 != 0) {
        local_res10 = lVar6;
        uVar2 = FUN_1403c0cc0();
        FUN_14034ec60(lVar6,uVar2,1);
      }
      local_res10 = lVar6;
      FUN_14034ed40(lVar6);
      *(undefined8 *)(lVar6 + 0x40) = 1;
      *(longlong *)(lVar6 + 0x38) = lVar5;
      FUN_14034edd0(lVar6);
    }
    FUN_140363b70(&DAT_1405f2688,&local_res10);
    if (lVar6 != 0) {
      FUN_14034ed40(lVar6);
      plVar1 = (longlong *)(lVar6 + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(lVar6);
        FUN_140360e90(lVar6);
      }
      else {
        FUN_14034edd0(lVar6);
      }
    }
    LOCK();
    UNLOCK();
    DAT_1405f2680 = 2;
  }
  else {
    LOCK();
    iVar3 = DAT_1405f2680;
    if (DAT_1405f2680 == 9999) {
      DAT_1405f2680 = 999;
      iVar3 = 9999;
    }
    UNLOCK();
    while (iVar3 != 2) {
      Sleep(5);
      LOCK();
      iVar3 = DAT_1405f2680;
      if (DAT_1405f2680 == 9999) {
        DAT_1405f2680 = 999;
        iVar3 = 9999;
      }
      UNLOCK();
    }
  }
  *param_1 = 0;
  FUN_140363b70(param_1,&DAT_1405f2688);
  return param_1;
}



void FUN_14036f390(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_14000d450(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_14034ff60(plVar1);
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f7a0(param_1,uVar3);
  }
  return;
}



undefined8 * FUN_14036f460(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_14034fef0(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_14035ec80(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_14035ec80(param_1);
    FUN_14035ec80(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_14035ec80(param_1);
  FUN_14035ec80(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_1403d7ac0(param_1);
    FUN_14035f7a0(param_1,uVar3);
  }
  FUN_14035ec80(param_1);
  return puVar4;
}



void FUN_14036f5c0(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_1403574e0(pvVar2);
          operator_delete(pvVar2);
        }
        FUN_14034ff60(puVar1);
      }
      iVar3 = iVar3 + 1;
      param_1 = param_1 + 1;
    } while (iVar3 < param_2);
  }
  return;
}



longlong * FUN_14036f660(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_140360e30(lVar1);
    }
    *(undefined4 *)(param_1 + 4) = param_3;
    return param_1;
  }
  *(undefined4 *)(param_1 + 4) = param_3;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014036fd87)
// WARNING: Removing unreachable block (ram,0x00014036fd8f)
// WARNING: Removing unreachable block (ram,0x00014036fd93)
// WARNING: Removing unreachable block (ram,0x00014036fd9d)

void FUN_14036f6f0(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_1405d3608);
    }
    *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_140364200(&local_138,local_res10);
    FUN_140364200(&local_138,local_res18);
    lVar13 = local_118;
    while (lVar16 = 0, uVar11 = local_128, lVar13 != 0) {
      uVar7 = FUN_140361340(&local_138,local_d0);
      plVar8 = (longlong *)FUN_1403642f0(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_140361340(&local_138,local_68);
      plVar8 = (longlong *)FUN_1403642f0(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_14036f978;
            }
            while( true ) {
              lVar13 = local_118;
              if (iVar12 < iVar15) goto LAB_14036f978;
              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_14036f978:
        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_140361360(&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_1405d3608);
              }
              *(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_140361360(&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_1405d3608);
              }
              *(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_140361360(&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_1405d3608);
            }
            *(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_140361360(&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_1405d3608);
            }
            *(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_14036fe60(longlong param_1,uint param_2)

{
  longlong lVar1;
  ulonglong uVar2;
  undefined8 uVar3;
  uint *puVar4;
  
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_14034ed40(uVar3);
  if (DAT_1405f064f != '\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_14036ede0(lVar1);
        }
        break;
      }
      puVar4 = *(uint **)(puVar4 + 4);
      if (puVar4 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar3);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014036ffee)

longlong * FUN_14036ff50(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_140370083;
      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_140360e30(lVar4);
        }
      }
      if (local_res8 == 0) {
        return param_2;
      }
      plVar1 = (longlong *)(local_res8 + 8);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 != 0) {
        return param_2;
      }
      FUN_140360e30(local_res8);
      return param_2;
    }
  }
LAB_140370083:
  *param_2 = 0;
  return param_2;
}



void FUN_1403700a0(undefined8 *param_1)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14036f5c0(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 0x0001403700e7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_14034ff60();
  }
  return;
}



undefined8 * FUN_140370100(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14036f5c0(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140370170(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_14035ec80();
  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_14034ff60(plVar1);
    }
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60(lVar5);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar5);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar5 = lVar6;
  }
  FUN_14034ff60(*(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_14035ec80(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar3 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035ec80(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_1403702f0(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_140360e30(*(undefined8 *)(param_2 + 8));
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar2);
  }
  return;
}



void FUN_1403703a0(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_14000d450(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_1403702f0(param_1,param_2,param_3);
  FUN_14035d100(param_1);
  return;
}



undefined8 FUN_1403704a0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035ec80(param_1);
  uVar2 = FUN_14036f460(param_1,param_2,param_3,param_4);
  FUN_14035ec80(param_1);
  return uVar2;
}


undefined DAT_140453610;
undefined DAT_140453790;
undefined DAT_140453890;
int DAT_1405d8194;
undefined DAT_1405d81b0;
undefined DAT_1405d80d0;
undefined DAT_140454090;
double DAT_1405d81a0;
undefined DAT_1405d3570;
undefined8 DAT_1405d81a8;
undefined DAT_140454b40;
undefined UNK_14037a62b;
undefined UNK_14037a639;
undefined UNK_14037a83a;
undefined UNK_14037a840;
undefined UNK_14037a84c;
undefined UNK_14037acc5;
undefined UNK_14037acf2;
undefined UNK_14037ad1f;
undefined UNK_14037ad2b;
pointer[43] vftable;
pointer[69] vftable;
pointer[26] vftable;
undefined4 DAT_1405d8110;
pointer[28] vftable;
pointer PTR_vftable_1405d83c8;
double DAT_1405d80a8;
double DAT_1405d80e0;
undefined DAT_140455638;
undefined DAT_140455670;
undefined DAT_1405f2550;
undefined DAT_1404559b8;
undefined DAT_140455d00;
undefined DAT_140455e00;
undefined *PTR_u_Cannot_use_internal_buffer_becau_1405d94e0;
undefined *PTR_u_Cannot_use_external_buffer_becau_1405d94d8;
undefined DAT_140456410;
undefined DAT_140456620;
pointer[27] vftable;
undefined *PTR_u_Wrong_RMI_ID_is_found._RMI_ID_sh_1405d9008;
undefined DAT_140456e60;
undefined8 *DAT_1405f28a0;
undefined DAT_1405f28a8;
undefined DAT_1404578d0;
undefined DAT_140457a20;
undefined DAT_140457b80;
undefined UNK_14038bf63;
undefined UNK_14038c364;
undefined UNK_14038c391;
undefined UNK_14038c3be;
undefined UNK_14038c3ca;
undefined UNK_14038c3f7;
undefined UNK_14038c43a;
undefined DAT_140457fe8;
undefined1 DAT_1405f2520;
undefined1 DAT_1405f2540;
undefined UNK_14038c877;
undefined UNK_14038cbaa;
undefined UNK_14038cbe1;
undefined8 DAT_1405d8180;
undefined8 DAT_1405d80f8;
undefined4 DAT_1405d806c;
undefined8 DAT_1405d80a8;
undefined8 DAT_1405d80b0;
undefined8 DAT_1405d8150;
undefined8 DAT_1405d80d8;
undefined DAT_140458910;
undefined DAT_140458950;
undefined4 DAT_1405d8068;
undefined DAT_140458cd0;
undefined *PTR_u_exception_due_to_not_using_Inter_1405d94c0;
undefined DAT_1404591d0;
undefined FUN_14038bc60;
undefined FUN_140392710;
undefined FUN_140390890;
undefined FUN_1403908c0;
undefined DAT_1404ad0dc;
undefined DAT_1404595d8;
undefined LAB_140394630;
undefined LAB_140394e90;
undefined DAT_14045a050;
undefined DAT_14045c250;
undefined DAT_14045c650;
undefined DAT_14045ca50;
undefined DAT_14045ce50;
undefined1 DAT_14045d250;
undefined DAT_14045a250;
undefined DAT_14045a650;
undefined DAT_14045aa50;
undefined DAT_14045ae50;
undefined DAT_14045a150;
undefined DAT_14045b250;
undefined DAT_14045b650;
undefined DAT_14045ba50;
undefined DAT_14045be50;
undefined DAT_14045d278;
undefined DAT_14045d280;
undefined DAT_14045d288;
undefined DAT_14045d27c;
undefined DAT_14045d284;
undefined DAT_14045d28c;
undefined DAT_14045d3c8;
undefined DAT_14045d400;
undefined DAT_14045d430;
undefined DAT_1405f0698;
char DAT_1405d9480;
uint DAT_1405f2780;
undefined LAB_1404494c0;
undefined DAT_1405f26c0;
undefined DAT_1405f2788;
undefined4 DAT_1405d93f0;
undefined4 DAT_1405d93f4;
undefined4 DAT_1405d93f8;
undefined4 DAT_1405d93fc;
undefined *PTR_u_RequestLogin_1405d9340;
undefined *PTR_u_NotifyCommon_ReceiveRmi_1405d9350;
undefined *PTR_u_NotifyCli_ConnectionState_1405d9358;
undefined *PTR_u_NotifyCli_Peers_Clear_1405d9360;
undefined *PTR_u_NotifyCli_Peers_AddOrEdit_1405d9368;
undefined *PTR_u_NotifySrv_ClientEmpty_1405d9370;
undefined *PTR_u_NotifySrv_Clients_AddOrEdit_1405d9378;
undefined *PTR_u_NotifySrv_Clients_Remove_1405d9380;
undefined *PTR_u_NotifyLoginFailed_1405d93e8;
undefined *PTR_u_NotifyLoginOk_1405d93e0;
undefined *PTR_u_NotifyCommon_SendRmi_1405d9348;
short *DAT_1405f2888;
undefined DAT_1405f2850;
undefined2 *DAT_1405f2888;
undefined *PTR_u_error:_ArrayPtr_is_null!_1405d94b0;
undefined DAT_14045e510;
int DAT_1405d8148;
pointer[10] vftable;
undefined8 DAT_1405f28a0;
int DAT_1405d8118;
undefined FUN_14039be40;
undefined LAB_14039bd90;
undefined DAT_1405d8120;
char DAT_1405d8144;
undefined DAT_1405d8128;
undefined4 DAT_1405d8048;
int DAT_1405d80ec;
undefined4 DAT_1405d804c;
undefined DAT_14045f690;
undefined DAT_14045f738;
undefined DAT_14045f860;
undefined DAT_14045f8d0;
undefined LAB_1403a2780;
undefined DAT_14045f990;
undefined4 DAT_1405d8050;
undefined4 DAT_1405d8054;
undefined DAT_14045fcf8;
undefined DAT_14045fd40;
undefined DAT_14045fd78;
undefined DAT_14045fdb8;
pointer PTR_s_LibTomMath_140466e30;
pointer PTR_DAT_140466fc0;
pointer PTR_s_fortuna_140467040;
undefined DAT_14060d240;
undefined DAT_14060d280;
undefined DAT_14060d2c0;
undefined8 DAT_14060d300;
undefined FUN_140449600;
char DAT_1405d97c0;
uint DAT_1405f3980;
undefined DAT_1405f2920;
undefined DAT_1405f3988;
undefined *DAT_14060d390;
undefined4 DAT_1405d8070;
undefined4 DAT_1405f0644;
undefined4 DAT_1405d8190;
undefined *PTR_u_exception_due_to_using_external_b_1405d94c8;
undefined LAB_1403a7c80;
undefined LAB_1403a7c90;
undefined FUN_1403cbce0;
undefined FUN_1403cbcd0;
undefined DAT_140460ce0;
undefined DAT_1404610e0;
undefined DAT_1404614e0;
undefined DAT_1404618e0;
undefined DAT_140460430;
undefined DAT_140460c30;
undefined DAT_140460cb0;
undefined DAT_140463380;
undefined LAB_1403aa4f0;
undefined4 DAT_1405d80e8;
double DAT_1405d8078;
undefined8 UNK_00000100;
undefined4 UNK_00000284;
undefined8 UNK_000002b8;
undefined8 DAT_1405d8130;
int UNK_00000140;
short UNK_00000144;
undefined UNK_1403acdde;
undefined UNK_1403acde4;
undefined UNK_1403ace3d;
double DAT_1405d8058;
undefined DAT_1405d8168;
double DAT_1405d8100;
undefined *PTR_DAT_1405d98a0;
undefined *PTR_DAT_1405d9898;
undefined *PTR_DAT_1405d9890;
undefined *PTR_DAT_1405d9888;
undefined *PTR_DAT_1405d9880;
undefined *PTR_DAT_1405d9878;
undefined *PTR_DAT_1405d9870;
undefined *PTR_DAT_1405d9868;
undefined *PTR_DAT_1405d9860;
undefined *PTR_DAT_1405d9858;
undefined *PTR_DAT_1405d9850;
undefined *PTR_DAT_1405d9848;
undefined *PTR_DAT_1405d9840;
undefined *PTR_DAT_1405d9838;
undefined *PTR_DAT_1405d9830;
undefined *PTR_DAT_1405d9828;
undefined *PTR_DAT_1405d9820;
undefined *PTR_DAT_1405d9818;
undefined *PTR_DAT_1405d9810;
undefined *PTR_DAT_1405d98c0;
undefined *PTR_DAT_1405d98b8;
undefined *PTR_DAT_1405d98b0;
undefined *PTR_DAT_1405d98a8;
undefined *PTR_DAT_1405d98c8;
undefined *PTR_DAT_1405d98d0;
undefined *PTR_DAT_1405d98d8;
undefined *PTR_DAT_1405d98e0;
undefined *PTR_DAT_1405d98e8;
undefined *PTR_DAT_1405d98f8;
undefined *PTR_DAT_1405d9900;
undefined *PTR_DAT_1405d9908;
undefined *PTR_DAT_1405d9910;
undefined *PTR_DAT_1405d9918;
undefined *PTR_DAT_1405d9920;
undefined *PTR_DAT_1405d9928;
undefined *PTR_DAT_1405d9930;
undefined *PTR_DAT_1405d9938;
undefined *PTR_DAT_1405d9940;
undefined *PTR_DAT_1405d9948;
undefined *PTR_DAT_1405d9950;
undefined *PTR_DAT_1405d9958;
undefined *PTR_DAT_1405d9960;
undefined *PTR_DAT_1405d9968;
undefined *PTR_DAT_1405d9970;
undefined *PTR_DAT_1405d9978;
undefined8 DAT_1405d80f0;
undefined DAT_1405d8108;
undefined DAT_140464f50;
int DAT_1405f39c0;
undefined DAT_1405f39c8;
undefined *PTR_DAT_1405d98f0;
pointer PTR_vftable_1405da130;
undefined DAT_1404656d0;
undefined DAT_140465748;
undefined8 DAT_1405d8080;
undefined DAT_1405d81b8;
undefined8 UNK_00000000;
undefined DAT_140465ca0;
undefined *PTR_u_Cannot_send_messages_unless_conn_1405d9980;
longlong DAT_1405d8090;
pointer[57] vftable;
undefined8 DAT_1405d8090;
undefined8 DAT_1405d8100;
undefined8 DAT_1405d81a0;
undefined DAT_1404666f0;
pointer[13] vftable;
pointer[11] vftable;
undefined DAT_140466a40;
int DAT_1405d8088;
undefined8 DAT_1405f0690;
undefined8 DAT_1405d8078;
undefined1 UNK_00000000;
char DAT_1405f064c;
int DAT_1405d814c;
double DAT_1405d8180;
undefined8 DAT_1405f4400;
undefined8 DAT_1405f3a00;
undefined4 DAT_140466e10;
undefined DAT_140466e14;
longlong DAT_14060d300;
undefined *DAT_14060d360;
undefined *DAT_14060d310;
undefined *DAT_14060d320;
undefined *DAT_14060d338;
undefined *DAT_14060d3c0;
undefined *DAT_14060d3f8;
undefined *DAT_14060d400;
undefined *DAT_14060d418;
undefined *DAT_14060d3c8;
undefined *DAT_14060d3e0;
undefined *DAT_14060d330;
undefined *DAT_14060d368;
undefined *DAT_14060d480;
undefined1 DAT_140468180;
undefined DAT_140468280;
undefined DAT_140468380;
undefined DAT_1404670e0;
undefined DAT_1404670e2;
undefined DAT_1404670e4;
undefined DAT_1404670e6;
pointer PTR_FUN_1404670e8;
undefined1 DAT_140467c60;
undefined DAT_140467b10;
undefined DAT_140467b90;
undefined DAT_140468480;
undefined DAT_140468500;
undefined DAT_1404683a6;
undefined DAT_1404683e6;
undefined DAT_140468630;
undefined DAT_140468670;
pointer PTR_DAT_1405d9de0;
pointer PTR_DAT_1405d9e00;
undefined DAT_1405d9e20;
undefined DAT_140467c80;
undefined DAT_140468100;
char DAT_1405d9e80;
uint DAT_1405f6a90;
undefined LAB_140449660;
undefined DAT_1405f6a00;
undefined DAT_1405f6a98;
double DAT_1405d8060;
undefined DAT_1404688c0;
undefined DAT_1404689e0;
undefined DAT_140469008;
undefined DAT_1405d81c0;
undefined DAT_1404690f0;
undefined DAT_1404691d8;
undefined DAT_1404692a8;
char DAT_1405d8147;
undefined4 DAT_1405d8074;
uint DAT_1405d8074;
undefined LAB_1403ce400;
undefined LAB_1403d70f0;
longlong DAT_1405d8078;
pointer PTR_DAT_14044cb20;
undefined DAT_14044cb28;
undefined DAT_14044cb2c;
undefined DAT_14047e32c;
undefined4 DAT_1405f6ae0;
undefined2 DAT_1405f6ae4;
undefined *DAT_1405f6ad0;
undefined DAT_140469c08;
undefined4 UNK_00000000;
undefined DAT_140469e90;
undefined DAT_140469ff0;
int DAT_1405d808c;
undefined DAT_1405f0640;
undefined DAT_14046a0c0;
undefined DAT_14046a108;
undefined DAT_1405f24a0;
undefined DAT_1405f24b0;
undefined DAT_1405f24c0;
undefined DAT_1405f24d0;
undefined DAT_1405f24e0;
undefined DAT_1405f24d8;
undefined DAT_1405f24e4;
undefined DAT_1405f24a8;
undefined DAT_1405f24b8;
undefined DAT_1405f24c8;
undefined8 UNK_1405f2498;
undefined4 UNK_1405f24d4;
undefined4 UNK_1405f24dc;
undefined4 UNK_1405f24e8;
undefined4 UNK_1405f24ec;
undefined1 DAT_1405d89b8;
double DAT_1405d80f0;
double DAT_1405f0690;
undefined DAT_1405d8170;
undefined DAT_14046a660;
undefined4 DAT_1405f2518;
char DAT_1405da1e1;
undefined8 DAT_1405f2510;
char DAT_1405da1e2;
undefined DAT_1405da228;
int DAT_1405da248;
undefined DAT_1405da240;
int DAT_1405da24c;
double DAT_1405da200;
double DAT_1405da1f0;
double DAT_1405da1f8;
longlong DAT_1405da1e8;
double DAT_1405da238;
uint DAT_1405f6d58;
undefined4 DAT_1405da214;
undefined4 DAT_1405f6d60;
undefined DAT_1405da230;
int DAT_1405f6d60;
undefined *DAT_14060d3a0;
undefined *DAT_14060d358;
undefined *DAT_14060d440;
undefined *DAT_14060d3b8;
undefined *DAT_14060d408;
undefined *DAT_14060d3a8;
undefined *DAT_14060d398;
undefined DAT_14046a9a0;
undefined *PTR_s_0123456789ABCDEFGHIJKLMNOPQRSTUV_1405da250;
int DAT_1405da260;
int DAT_1405da258;
int DAT_1405da264;
int DAT_1405da25c;
undefined4 DAT_14046f6b0;
undefined DAT_14046c760;
undefined DAT_14046cb60;
undefined DAT_14046cf60;
undefined DAT_14046d360;
undefined DAT_14046e360;
undefined DAT_14046e760;
undefined DAT_14046eb60;
undefined DAT_14046ef60;
undefined4 DAT_14046f364;
undefined DAT_14046f37c;
undefined DAT_14046f380;
undefined DAT_14046ab60;
undefined DAT_14046bb60;
undefined DAT_14046bf60;
undefined DAT_14046c360;
undefined DAT_14046b360;
undefined DAT_14046b760;
undefined DAT_14046d760;
undefined DAT_14046db60;
undefined DAT_14046df60;
undefined *DAT_14060d448;
undefined DAT_1405f3a28;
undefined DAT_1405f440c;
undefined4 DAT_1405f6d50;
undefined2 DAT_1405f6d54;
undefined DAT_1405f6af0;
undefined DAT_1405d8160;
undefined FUN_1403eb010;
int DAT_1405f6d5c;
undefined FUN_1403f2af0;
undefined FUN_1403e6260;
undefined FUN_1403f2c80;
undefined FUN_1403ef700;
undefined FUN_1403f2da0;
undefined FUN_1403f2f00;
undefined4 DAT_14046fab0;
undefined4 DAT_14046fab4;
undefined4 DAT_14046fd00;
undefined4 DAT_14046fd04;
undefined *DAT_14060d370;
undefined *DAT_14060d378;
undefined FUN_1403f30f0;
undefined FUN_1403f3430;
undefined *PTR_DAT_1405da268;
undefined FUN_1403f8ac8;
undefined FUN_1403f8ae8;
undefined DAT_1404700b0;
undefined DAT_1404708b0;
undefined DAT_140470930;
pointer PTR_FUN_1404709a8;
undefined DAT_1404709a0;
undefined DAT_1404709a2;
undefined DAT_1404709a4;
undefined DAT_1404709a6;
undefined DAT_140473240;
undefined1 DAT_140473340;
undefined DAT_140473440;
undefined UNK_1404708ce;
undefined DAT_14047090e;
undefined DAT_140470b50;
undefined DAT_140470b90;
undefined DAT_140470bd0;
undefined DAT_140470fd0;
undefined DAT_1404713d0;
undefined DAT_1404717d0;
undefined DAT_140471bd0;
undefined DAT_140471fd0;
undefined DAT_1404723d0;
undefined DAT_1404727d0;
undefined1 DAT_140472d20;
undefined DAT_140472bd0;
undefined DAT_140472c50;
undefined DAT_140473540;
undefined DAT_1404735c0;
pointer PTR_DAT_1405da270;
pointer PTR_DAT_1405da290;
undefined DAT_1405da2b0;
undefined DAT_140472d40;
undefined DAT_1404731c0;
undefined DAT_140473668;
undefined DAT_14047e244;
undefined DAT_1404b7eec;
undefined FUN_1403fc220;
undefined DAT_14047369c;
undefined DAT_1404736a8;
undefined LAB_1403fc560;
undefined DAT_1404736e0;
undefined DAT_140473710;
undefined DAT_140473c3c;
undefined *PTR_DAT_1404738f0;
undefined DAT_140473930;
undefined FUN_1403fd420;
undefined DAT_1404765ac;
undefined DAT_140473d4c;
undefined *PTR_s_running_140473ae0;
undefined FUN_1403fdc70;
undefined DAT_14047417c;
undefined DAT_140474184;
undefined DAT_14047418c;
undefined DAT_14047419c;
undefined DAT_1404741a0;
undefined DAT_1404741a8;
undefined DAT_1404741ac;
undefined DAT_1404741b4;
undefined DAT_140474008;
undefined DAT_140474010;
undefined *PTR_DAT_140474028;
undefined FUN_1403ff8e0;
undefined FUN_1404008f0;
undefined DAT_1404744d8;
undefined DAT_1404744e0;
undefined1 DAT_14049a5e4;
undefined DAT_140474a1c;
undefined DAT_140474a44;
undefined DAT_140474a5c;
undefined DAT_140474ab0;
undefined DAT_1404748e0;
undefined *PTR_DAT_1404748e8;
undefined FUN_1404024a0;
undefined DAT_140474b14;
undefined DAT_140474b54;
undefined DAT_140474b58;
undefined DAT_140474b5c;
undefined DAT_140474b60;
undefined DAT_140475320;
undefined *PTR_DAT_1404751b0;
undefined LAB_140403f20;
undefined DAT_140474c68;
undefined DAT_140474c70;
undefined DAT_140474c74;
undefined DAT_140474c78;
undefined DAT_1404757b8;
undefined DAT_140474c80;
undefined DAT_1404748cc;
undefined FUN_140411fa0;
undefined FUN_140412cd0;
undefined FUN_140406700;
undefined FUN_1404061b0;
undefined *PTR_FUN_1404746e8;
undefined DAT_140475298;
undefined DAT_140475330;
undefined DAT_140475928;
undefined DAT_14047594c;
undefined DAT_1404757e0;
undefined DAT_1404757e1;
undefined DAT_140475b2c;
undefined8 *DAT_1405f6d68;
undefined4 DAT_140608750;
int DAT_1405ecf50;
int DAT_140608288;
longlong DAT_140607cf8;
undefined DAT_140607dc4;
undefined DAT_140607dc0;
undefined DAT_140607dbc;
undefined DAT_14049b9cc;
ulonglong DAT_140609eb0;
undefined DAT_140609e98;
ulonglong DAT_140609e88;
undefined DAT_140609ea8;
undefined DAT_140609e70;
ulonglong DAT_140609e60;
undefined DAT_140609e80;
undefined DAT_140609e48;
ulonglong DAT_140609e38;
undefined DAT_140609e58;
undefined DAT_140609e20;
ulonglong DAT_140609e10;
undefined DAT_140609e30;
undefined DAT_140609df8;
ulonglong DAT_140609de8;
undefined DAT_140609e08;
undefined DAT_140609dd0;
ulonglong DAT_140609dc0;
undefined DAT_140609de0;
undefined DAT_140609da8;
ulonglong DAT_140609d98;
undefined DAT_140609db8;
undefined DAT_140609d80;
ulonglong DAT_140609d70;
undefined DAT_140609d90;
undefined DAT_140609d58;
ulonglong DAT_140609d48;
undefined DAT_140609d68;
undefined DAT_140609d30;
ulonglong DAT_140609d20;
undefined DAT_140609d40;
undefined DAT_140609d08;
ulonglong DAT_140609cf8;
undefined DAT_140609d18;
undefined DAT_140609ce0;
undefined DAT_140609cf0;
ulonglong DAT_14060a160;
undefined DAT_14060a148;
undefined DAT_14060a158;
ulonglong DAT_140609ee8;
undefined DAT_140609ed0;
undefined DAT_140609ee0;
undefined DAT_140609ef8;
undefined DAT_14060a128;
undefined8 DAT_140609cf8;
undefined8 DAT_140609ce0;
undefined8 DAT_140609d20;
undefined8 DAT_140609d48;
undefined8 DAT_140609d70;
undefined8 DAT_140609d98;
undefined8 DAT_140609dc0;
undefined8 DAT_140609de8;
undefined8 DAT_140609e10;
undefined8 DAT_140609e38;
undefined8 DAT_140609e60;
undefined8 DAT_140609e88;
undefined8 DAT_140609eb0;
undefined8 DAT_140609e98;
undefined4 DAT_140609ec0;
undefined8 DAT_14060a148;
undefined8 DAT_140609ee8;
undefined DAT_14060a130;
undefined DAT_14060a138;
undefined8 DAT_14060a160;
void *DAT_140607f90;
void *DAT_140607f88;
void *DAT_140607f70;
void *DAT_140607f68;
longlong DAT_140607fb0;
longlong *DAT_140607fa8;
longlong DAT_140607f90;
undefined8 *DAT_140607f88;
undefined DAT_140351557;
undefined DAT_14036c583;
undefined DAT_14036c4c7;
undefined DAT_14036ca52;
undefined DAT_14037d74e;
undefined DAT_1404555e0;
undefined DAT_14038a2ec;
undefined DAT_14038f9e3;
undefined DAT_14038ff47;
undefined DAT_140391983;
undefined DAT_140396b62;
undefined DAT_140396e16;
undefined DAT_14039710d;
undefined DAT_140397332;
undefined DAT_1403a4b80;
undefined DAT_1403a4e08;
undefined DAT_1403bc019;
undefined DAT_1403bbf15;
undefined DAT_1403bbf1a;
undefined DAT_1403bbf1f;
undefined DAT_1403be56f;
undefined DAT_1403d223c;
undefined DAT_1403d21fc;
undefined DAT_1403d69b2;
undefined DAT_1403d6b0f;
undefined DAT_1403d812d;
undefined DAT_1403fbcf1;
undefined DAT_140313bb1;
undefined DAT_140331d59;
undefined DAT_140331a49;
undefined DAT_140331719;
undefined DAT_14031fa39;
undefined DAT_14031f3f9;
undefined DAT_140319425;
undefined DAT_1403180c9;
undefined DAT_140306509;
undefined DAT_1402ea5a9;
undefined DAT_1402c6db4;
undefined DAT_140159379;
undefined DAT_140158d19;
undefined DAT_1401586d9;
undefined DAT_140158109;
undefined DAT_140157ac9;
undefined DAT_1401574f9;
undefined DAT_140156509;
undefined DAT_140155b09;
undefined DAT_140155539;
undefined DAT_140154f19;
undefined DAT_1401548a9;
undefined DAT_140153e99;
undefined DAT_140153879;
undefined DAT_140152f39;
undefined DAT_140152879;
undefined DAT_14014f339;
undefined DAT_14014f009;
undefined DAT_14014ecf9;
undefined DAT_14014e849;
undefined DAT_14014cc99;
undefined DAT_14000426c;
undefined DAT_140001a71;
undefined DAT_140332855;
undefined DAT_1403324f5;
undefined DAT_140332125;
undefined DAT_140320032;
undefined DAT_14031fba5;
undefined DAT_14031f565;
undefined DAT_140318235;
undefined DAT_1403119b3;
undefined DAT_140311532;
undefined DAT_140308835;
undefined DAT_140306675;
undefined DAT_140305f42;
undefined DAT_1402fd482;
undefined DAT_1402f4852;
undefined DAT_1402ea202;
undefined DAT_1402e4922;
undefined DAT_1402e4152;
undefined DAT_1402e3e22;
undefined DAT_1402e3b02;
undefined DAT_1402db2c2;
undefined DAT_1402daed2;
undefined DAT_1402daba2;
undefined DAT_1402da892;
undefined DAT_14025ec72;
undefined DAT_14025e932;
undefined DAT_140254072;
undefined DAT_1402481c2;
undefined DAT_14020e122;
undefined DAT_1401e5f62;
undefined DAT_1401e5c42;
undefined DAT_1401e575f;
undefined DAT_1401dfbd2;
undefined DAT_1401670c2;
undefined DAT_1401594e5;
undefined DAT_140158e85;
undefined DAT_140158845;
undefined DAT_140158275;
undefined DAT_140157c35;
undefined DAT_140157665;
undefined DAT_1401571b5;
undefined DAT_140156e75;
undefined DAT_140156b35;
undefined DAT_140156675;
undefined DAT_1401561c5;
undefined DAT_140155c75;
undefined DAT_1401556a5;
undefined DAT_140155085;
undefined DAT_140154a15;
undefined DAT_1401544d2;
undefined DAT_140154005;
undefined DAT_1401539e5;
undefined DAT_140153552;
undefined DAT_1401530a5;
undefined DAT_1401529e5;
undefined DAT_140151f22;
undefined DAT_140151a72;
undefined DAT_140151752;
undefined DAT_1401512b5;
undefined DAT_140150f82;
undefined DAT_14012c1ad;

undefined8 * FUN_140370520(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_14034fef0(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_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar3);
  }
  FUN_14035d100(param_1);
  return puVar4;
}



void FUN_140370670(longlong param_1,longlong *param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if ((*param_2 != 0) &&
     (*(longlong *)(*param_2 + 8) = *(longlong *)(*param_2 + 8) + -1,
     *(longlong *)(*param_2 + 8) == 0)) {
    FUN_140360e30(*param_2);
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140370d03)
// WARNING: Removing unreachable block (ram,0x000140370d0b)
// WARNING: Removing unreachable block (ram,0x000140370d0f)
// WARNING: Removing unreachable block (ram,0x000140370d19)

void FUN_140370720(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_1405d3608);
    }
    *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_140364200(&local_128,local_res10);
    FUN_140364200(&local_128,local_res18);
    lVar10 = local_108;
    while (lVar14 = 0, uVar8 = local_118, lVar10 != 0) {
      uVar5 = FUN_140361340(&local_128,local_70);
      plVar6 = (longlong *)FUN_1403642f0(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_140361340(&local_128,local_58);
      plVar6 = (longlong *)FUN_1403642f0(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_1403708e7:
          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_140370935;
                  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_1403708e7;
            }
          } while (iVar12 < iVar9);
        }
LAB_140370935:
        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_140361360(&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_1405d3608);
              }
              *(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_140361360(&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_1405d3608);
              }
              *(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_140361360(&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_1405d3608);
            }
            *(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_140361360(&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_1405d3608);
            }
            *(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_140370de0(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_14034ed40(local_48);
  local_40 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),
               L"Proud::CNetServerImpl::C2SStub::NotifyP2PHolepunchSuccess");
  }
  local_res8 = (longlong *)0x0;
  plVar3 = (longlong *)
           FUN_14036ff50(*(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_140360e30(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_14035caf0(*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_14035caf0(*local_res8,*param_5,&local_a8,&local_c8);
    plVar3 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
    (**(code **)(*plVar3 + 0x90))
              (plVar3,*param_4,&DAT_1405f2490,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_1405f2490,param_4,param_5,param_6,param_7,param_8,param_9);
    if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
      FUN_14034fe70();
      local_100 = PTR_DAT_1405d8010;
      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_1405d8010;
      }
      puVar9 = (undefined *)*plVar4;
      if ((undefined *)*plVar4 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1405d8010;
      }
      puVar8 = (undefined *)*plVar5;
      if ((undefined *)*plVar5 == (undefined *)0x0) {
        puVar8 = PTR_DAT_1405d8010;
      }
      puVar7 = (undefined *)*plVar6;
      if ((undefined *)*plVar6 == (undefined *)0x0) {
        puVar7 = PTR_DAT_1405d8010;
      }
      FUN_140017720(&local_100,&DAT_140453610,*param_4,*param_5,puVar7,puVar8,puVar9,puVar10);
      if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1405d8010)) &&
         (local_f8 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_98 = uVar11;
        FUN_14034ed40(uVar11);
        local_90 = 1;
        piVar1 = (int *)(local_f8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_f8 + -8);
        }
        FUN_14034edd0(uVar11);
        local_90 = 0;
      }
      local_f8 = PTR_DAT_1405d8010;
      if (((local_e8 != (undefined *)0x0) && (local_e8 != PTR_DAT_1405d8010)) &&
         (local_e8 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_68 = uVar11;
        FUN_14034ed40(uVar11);
        local_60 = 1;
        piVar1 = (int *)(local_e8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_e8 + -8);
        }
        FUN_14034edd0(uVar11);
        local_60 = 0;
      }
      local_e8 = PTR_DAT_1405d8010;
      if (((local_f0 != (undefined *)0x0) && (local_f0 != PTR_DAT_1405d8010)) &&
         (local_f0 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_88 = uVar11;
        FUN_14034ed40(uVar11);
        local_80 = 1;
        piVar1 = (int *)(local_f0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_f0 + -8);
        }
        FUN_14034edd0(uVar11);
        local_80 = 0;
      }
      local_f0 = PTR_DAT_1405d8010;
      if (((local_e0 != (undefined *)0x0) && (local_e0 != PTR_DAT_1405d8010)) &&
         (local_e0 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_78 = uVar11;
        FUN_14034ed40(uVar11);
        local_70 = 1;
        piVar1 = (int *)(local_e0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_e0 + -8);
        }
        FUN_14034edd0(uVar11);
        local_70 = 0;
      }
      puVar10 = local_100;
      puVar9 = local_100;
      if (local_100 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1405d8010;
      }
      local_e0 = PTR_DAT_1405d8010;
      FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),1,puVar9);
      if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
         (puVar10 + -8 != (undefined *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_58 = uVar11;
        FUN_14034ed40(uVar11);
        local_50 = 1;
        piVar1 = (int *)(puVar10 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar10 + -8);
        }
        FUN_14034edd0(uVar11);
        local_50 = 0;
      }
      local_100 = PTR_DAT_1405d8010;
    }
  }
  if (local_res8 != (longlong *)0x0) {
    plVar3 = local_res8 + 1;
    *plVar3 = *plVar3 + -1;
    if (*plVar3 == 0) {
      FUN_140360e30(local_res8);
    }
  }
  FUN_14034edd0(local_48);
  return 1;
}



undefined8
FUN_140371310(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_14034ed40(uVar7);
  if (DAT_1405f064f != '\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_14036ff50(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_1405d83d4;
            uVar4 = DAT_1405d83d0;
            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_1405d83d4;
              uVar4 = DAT_1405d83d0;
              *(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_1405f2490,local_res10,param_5);
            if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
              FUN_14034fe70();
              local_res20 = PTR_DAT_1405d8010;
              FUN_140017720(&local_res20,&DAT_140453790,local_res10[0],*param_4);
              puVar6 = local_res20;
              puVar12 = local_res20;
              if (local_res20 == (undefined *)0x0) {
                puVar12 = PTR_DAT_1405d8010;
              }
              FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),1,puVar12);
              if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1405d8010)) &&
                 (puVar6 + -8 != (undefined *)0x0)) {
                uVar8 = FUN_14034fe70();
                FUN_14034ed40(uVar8);
                piVar1 = (int *)(puVar6 + -4);
                *piVar1 = *piVar1 + -1;
                if (*piVar1 == 0) {
                  FUN_14034ff60(puVar6 + -8);
                }
                FUN_14034edd0(uVar8);
              }
              local_res20 = PTR_DAT_1405d8010;
            }
          }
          if ((local_res8 != (longlong *)0x0) &&
             (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
            FUN_140360e30(local_res8);
          }
        }
        break;
      }
      puVar9 = *(uint **)(puVar9 + 4);
      if (puVar9 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar7);
  return 1;
}



undefined8 FUN_1403715e0(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_14034ed40(uVar8);
  uVar14 = 1;
  if (DAT_1405f064f != '\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_14036ff50(lVar3 + 0x2d8,&local_res8,local_res10[0],(ulonglong)uVar2,uVar12,uVar13,
                        uVar14);
          uVar6 = DAT_1405d83d4;
          uVar5 = DAT_1405d83d0;
          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_1405d83d4;
              uVar5 = DAT_1405d83d0;
              *(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_1405f2490,local_res10);
            plVar10 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
            (**(code **)(*plVar10 + 0x110))(plVar10,local_res10[0],&DAT_1405f2490,param_4);
            if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
              FUN_14034fe70();
              local_res20 = PTR_DAT_1405d8010;
              FUN_140017720(&local_res20,&DAT_140453890,local_res10[0],*param_4);
              puVar7 = local_res20;
              puVar11 = local_res20;
              if (local_res20 == (undefined *)0x0) {
                puVar11 = PTR_DAT_1405d8010;
              }
              FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),1,puVar11);
              if (((puVar7 != (undefined *)0x0) && (puVar7 != PTR_DAT_1405d8010)) &&
                 (puVar7 + -8 != (undefined *)0x0)) {
                uVar12 = FUN_14034fe70();
                FUN_14034ed40(uVar12);
                piVar1 = (int *)(puVar7 + -4);
                *piVar1 = *piVar1 + -1;
                if (*piVar1 == 0) {
                  FUN_14034ff60(puVar7 + -8);
                }
                FUN_14034edd0(uVar12);
              }
              local_res20 = PTR_DAT_1405d8010;
            }
          }
          if ((local_res8 != (longlong *)0x0) &&
             (local_res8[1] = local_res8[1] + -1, uVar8 = uVar13, local_res8[1] == 0)) {
            FUN_140360e30(local_res8);
          }
        }
        break;
      }
      puVar9 = *(uint **)(puVar9 + 4);
      if (puVar9 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar8);
  return 1;
}



void FUN_1403718a0(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_14035e7a0(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_14034f7d0();
      }
      iVar19 = iVar24;
      if (iVar24 < (int)lVar25) {
        do {
          lVar20 = (longlong)iVar24;
          if (iVar24 == iVar19) {
LAB_1403719d8:
            bVar27 = false;
          }
          else {
            if ((iVar19 < 0) || (param_2[1] <= (longlong)iVar19)) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            if (param_2[1] <= lVar20) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            if ((ulonglong)param_2[2] < 0x65) {
              plVar7 = param_2 + (lVar20 + 1) * 4;
            }
            else {
              plVar7 = (longlong *)(lVar20 * 0x20 + *param_2);
            }
            plVar7 = (longlong *)FUN_14036ff50(param_1 + 0x2d8,&local_e0,(int)*plVar7);
            uVar16 = uVar16 | 1;
            if ((longlong *)*plVar7 == (longlong *)0x0) {
              lVar26 = 0;
              goto LAB_1403719d8;
            }
            lVar26 = *(longlong *)*plVar7;
            if (lVar26 == 0) goto LAB_1403719d8;
            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_1403555d0((longlong)pvVar3 + 0x148);
                FUN_1403555d0((longlong)pvVar3 + 0x120);
                operator_delete(pvVar3);
              }
              FUN_14034ff60(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_14035edb0(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_14034f800();
                }
                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_14034f800();
                }
                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_1403604e0(uVar10);
  }
  else {
    FUN_14036f6f0();
  }
  FUN_14035f6d0(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_14034f800();
      }
      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_14034f800();
        }
        iVar23 = *(int *)(*(longlong *)(param_1 + 0x17d8) + (longlong)iVar14 * 4);
        if ((iVar23 == (int)uVar10) || (iVar23 == local_b0._4_4_)) goto LAB_140371cff;
      }
      local_a8._4_4_ = (int)((ulonglong)uVar4 >> 0x20);
      if ((int)uVar4 < local_a8._4_4_) {
        if (iVar19 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        iVar14 = *(int *)(param_1 + 0x17e0);
        FUN_14035f6d0();
        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_14034f7d0();
        }
        iVar18 = *(int *)(param_1 + 0x17e0);
        FUN_14035f6d0(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_140371cff:
      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_14034f800();
      }
      iVar18 = *(int *)(*(longlong *)(param_1 + 0x17d8) + lVar25 * 4);
      lVar26 = (longlong)iVar18;
      if ((iVar18 < 0) || (param_2[1] <= lVar26)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_14034f800();
            }
            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_14034f7d0();
              }
              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_140371e9d:
                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_14034f7d0();
              }
              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_140371e9d;
              }
            }
            iVar23 = iVar23 + 1;
            lVar26 = lVar26 + 1;
            lVar22 = lVar22 + 0x18;
          } while (lVar26 < iVar14);
        }
      }
      iVar19 = iVar19 + 1;
      lVar25 = lVar25 + 1;
    } while (lVar25 < iVar24);
  }
  FUN_14035e7a0(lVar9,0);
  iVar24 = *(int *)(param_1 + 0x17e0);
  if (iVar24 == 0) {
    return;
  }
  if (-1 < *(int *)(param_1 + 0x17e4)) goto LAB_140372001;
  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_140371f75:
    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_140371f75;
    }
    if (iVar19 != 2) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    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_14034fef0((longlong)(int)uVar17 << 2);
    }
    else {
      lVar9 = (**(code **)(*plVar7 + 8))(plVar7,(longlong)(int)uVar17 << 2);
    }
  }
  else {
    if (plVar7 == (longlong *)0x0) {
      lVar9 = FUN_14034ff20(*(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_14034f420(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_90,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  *(longlong *)(param_1 + 0x17d8) = lVar9;
  *(uint *)(param_1 + 0x17e4) = uVar17;
LAB_140372001:
  *(undefined4 *)(param_1 + 0x17e0) = 0;
  return;
}



void FUN_140372030(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_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  uVar4 = 0;
  uVar3 = uVar4;
  if (*param_2 != 0) {
    uVar3 = *(undefined8 *)(*param_2 + 0x38);
  }
  plVar2 = (longlong *)FUN_14035bff0(uVar3,local_res18);
  puVar5 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar5 = PTR_DAT_1405d8010;
  }
  FUN_140017720(&local_res8,L"WARNING: %s",puVar5,param_4,uVar7);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar3);
  }
  puVar5 = local_res8;
  if (*(longlong *)(param_1 + 0x17f0) != 0) {
    puVar6 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1405d8010;
    }
    FUN_1403935f0(*(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_1405d8010)) &&
     (puVar5 + -8 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    FUN_14034ed40(uVar4);
    piVar1 = (int *)(puVar5 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar5 + -8);
    }
    FUN_14034edd0(uVar4);
  }
  FUN_14012c7f0(param_2);
  return;
}



void FUN_1403721a0(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1403a2180(param_1 + 5);
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14036f5c0(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2],plVar1,param_4,uVar2);
    }
  }
  return;
}



void FUN_140372210(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_14034ed40(uVar5);
  if (DAT_1405f064f != '\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_1403722d3;
      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_1403722d3:
  FUN_14034fe70();
  local_res8 = (uint *)PTR_DAT_1405d8010;
  uVar2 = FUN_14034fcf0(param_3);
  uVar10 = 0;
  if ((local_res8 != (uint *)0x0) && (uVar12 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar12 = (ulonglong)local_res8[-2];
  }
  uVar4 = uVar2;
  if ((((int)uVar2 <= (int)uVar12) && (uVar4 = uVar10, local_res8 != (uint *)0x0)) &&
     (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    uVar4 = local_res8[-2];
  }
  if ((int)uVar4 < (int)uVar11) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar11 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar4 = uVar3;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar4 = local_res8[-2];
      }
      if (uVar11 != uVar4) {
        puVar6 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar3 = local_res8[-2];
        }
        puVar9 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar11 < (int)uVar3) {
LAB_1403723c4:
          if (local_res8 != (uint *)0x0) {
            puVar9 = local_res8;
          }
        }
        else {
          uVar11 = uVar10;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1405d8010) {
              uVar11 = local_res8[-2];
            }
            goto LAB_1403723c4;
          }
        }
        FUN_14034fd20(puVar6 + 2,puVar9,uVar11);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar6 + 2;
      }
    }
  }
  uVar10 = 0;
  FUN_140002e10(&local_res8);
  puVar6 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_3,uVar2);
  puVar6 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8010;
  }
  uVar4 = FUN_14034fcf0(puVar6);
  uVar11 = 0;
  uVar2 = uVar10;
  if (0 < (int)uVar4) {
    uVar2 = uVar4;
  }
  uVar4 = uVar11;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar4 = local_res8[-2];
  }
  if (((int)uVar4 <= (int)uVar2) && (uVar2 = uVar11, local_res8 != (uint *)0x0)) {
    if (local_res8 == (uint *)PTR_DAT_1405d8010) goto LAB_140372472;
    uVar2 = local_res8[-2];
  }
  if (((local_res8 != (uint *)PTR_DAT_1405d8010) && (local_res8 != (uint *)0x0)) &&
     (local_res8 + -2 != (uint *)0x0)) {
    local_res8[-2] = uVar2;
    *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar2 * 2) = 0;
  }
LAB_140372472:
  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_14035bed0(local_res10,0x1f,uVar10,&local_res8,&local_60);
  (**(code **)(*param_1 + 0x88))(param_1,uVar7);
  FUN_1403555d0(&local_60);
  puVar6 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar9 = local_res8 + -2, puVar9 != (uint *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_14034ff60(puVar9);
    }
    FUN_14034edd0(uVar7);
  }
  FUN_14034edd0(uVar5);
  return;
}



longlong FUN_140372550(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_14036ff50(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_140360e30(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_140360e30(local_res8);
    }
  }
  return local_28[0];
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140372610(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_14039bd30(*(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_1405d8194 < (int)param_2[0x3d]) {
      param_2[0x44] = (longlong)dVar10;
    }
  }
  else if (DAT_1405d8194 < (int)param_2[0x3d]) {
    if (_DAT_1405d81b0 < dVar10 - (double)param_2[0x44]) {
      FUN_14034fe70();
      local_res8 = PTR_DAT_1405d8010;
      FUN_140017720(&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_14035bed0(local_res10,0x25,uVar7,&local_res8,&local_50);
      (**(code **)(*param_1 + 0x88))(param_1,uVar8);
      FUN_1403555d0(&local_50);
      puVar5 = local_res8;
      param_2[0x44] = (longlong)dVar10;
      if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
         (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
        ppuVar9 = (undefined **)FUN_14034fe70();
        local_60 = ppuVar9;
        FUN_14034ed40(ppuVar9);
        local_58 = CONCAT31(local_58._1_3_,1);
        piVar2 = (int *)(puVar5 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(ppuVar9);
      }
    }
  }
  else {
    param_2[0x44] = 0;
  }
  return;
}



void FUN_140372820(void)

{
  FUN_140370170();
  return;
}



void FUN_140372840(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_14035d100(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_1403555d0((longlong)pvVar3 + 0x148);
        FUN_1403555d0((longlong)pvVar3 + 0x120);
        operator_delete(pvVar3);
      }
      FUN_14034ff60(puVar2);
    }
    plVar4 = *(longlong **)(param_1 + 0x50);
    if (plVar4 == (longlong *)0x0) {
      FUN_14034ff60(lVar7);
    }
    else {
      (**(code **)(*plVar4 + 0x18))(plVar4,lVar7);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar7 = lVar1;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar5 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



longlong FUN_1403729f0(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_1403704a0(param_1,param_2,uVar1,uVar3);
  return lVar2 + 0x10;
}



undefined8 FUN_140372aa0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035d100(param_1);
  uVar2 = FUN_140370520(param_1,param_2,param_3,param_4);
  FUN_14035d100(param_1);
  return uVar2;
}



longlong FUN_140372b20(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_14034fef0(0x28);
  }
  else {
    lVar4 = (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (lVar4 != 0) {
    FUN_14036f660(lVar4,param_2,param_4);
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (param_3 & 0xffffffff) * 8);
  FUN_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar3);
  }
  FUN_14035d100(param_1);
  return lVar4;
}



void FUN_140372c70(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_14000d450(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_140370670(param_1,param_2,param_3);
  FUN_14035d100(param_1);
  return;
}



undefined8 FUN_140372d70(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_14034fef0(0x400);
  uVar15 = 0;
  uVar14 = 0;
  uVar8 = uVar15;
  if (local_res8 != (uint *)0x0) {
    uVar8 = param_1 + 0x60;
    if (param_1 == 0) {
      uVar8 = uVar15;
    }
    uVar8 = FUN_140355800(local_res8,0,uVar8);
  }
  if (uVar8 == 0) {
    local_98 = (ulonglong *)0x0;
  }
  else {
    local_98 = (ulonglong *)FUN_14034fef0(0x10);
    local_98[1] = 1;
    *local_98 = uVar8;
  }
  puVar1 = local_98;
  FUN_140351ba0(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_1403556b0(uVar8);
        FUN_14034ff60(uVar8);
      }
      FUN_14034ff60(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_1405d8008;
  }
  uVar8 = uVar15;
  if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
    uVar8 = **(ulonglong **)(param_1 + 0x748);
  }
  cVar4 = FUN_140356e40(uVar8,puVar11,param_2);
  if (cVar4 != '\0') {
    uVar8 = uVar15;
    if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
      uVar8 = **(ulonglong **)(param_1 + 0x748);
    }
    FUN_140356810(uVar8);
    uVar8 = uVar15;
    if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
      uVar8 = **(ulonglong **)(param_1 + 0x748);
    }
    FUN_1403549c0(uVar8,param_1 + 0xb0);
    if (*(ulonglong **)(param_1 + 0x748) != (ulonglong *)0x0) {
      uVar15 = **(ulonglong **)(param_1 + 0x748);
    }
    FUN_1403598f0(*(undefined8 *)(param_1 + 0x790),uVar15);
    return 1;
  }
  FUN_14034fe70();
  local_res8 = (uint *)PTR_DAT_1405d8010;
  uVar5 = FUN_14034fcf0(&DAT_140477960);
  if ((local_res8 != (uint *)0x0) && (uVar15 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    uVar7 = local_res8[-2];
  }
  uVar13 = 1;
  if (1 < (int)uVar7) {
    uVar13 = uVar7;
  }
  uVar7 = uVar6;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar7 = local_res8[-2];
  }
  if ((int)uVar7 < (int)uVar13) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar13 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar13 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar7 = uVar14;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar7 = local_res8[-2];
      }
      if (uVar13 != uVar7) {
        puVar9 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar7 = local_res8[-2];
        }
        puVar12 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar13 < (int)uVar7) {
LAB_140372f8d:
          if (local_res8 != (uint *)0x0) {
            puVar12 = local_res8;
          }
        }
        else {
          uVar13 = uVar14;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1405d8010) {
              uVar13 = local_res8[-2];
            }
            goto LAB_140372f8d;
          }
        }
        FUN_14034fd20(puVar9 + 2,puVar12,uVar13);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar9 + 2;
      }
    }
  }
  FUN_140002e10(&local_res8);
  puVar9 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar9 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar9,&DAT_140477960,uVar5);
  puVar9 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar9 = (uint *)PTR_DAT_1405d8010;
  }
  uVar5 = FUN_14034fcf0(puVar9);
  uVar14 = 0;
  if (0 < (int)uVar5) {
    uVar14 = uVar5;
  }
  uVar5 = uVar6;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar5 = local_res8[-2];
  }
  if (((int)uVar5 <= (int)uVar14) && (uVar14 = uVar6, local_res8 != (uint *)0x0)) {
    if (local_res8 == (uint *)PTR_DAT_1405d8010) goto LAB_14037303d;
    uVar14 = local_res8[-2];
  }
  if (((local_res8 != (uint *)PTR_DAT_1405d8010) && (local_res8 != (uint *)0x0)) &&
     (local_res8 + -2 != (uint *)0x0)) {
    local_res8[-2] = uVar14;
    *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar14 * 2) = 0;
  }
LAB_14037303d:
  local_60 = 0;
  local_58 = 0;
  local_50 = 0;
  local_48 = 0;
  local_68 = Proud::ByteArray::vftable;
  uVar10 = FUN_14035bed0(&local_res20,0x10,1,&local_res8,&local_68);
  FUN_14035bda0(param_3,uVar10);
  lVar2 = local_res20;
  if (local_res20 != 0) {
    local_88 = local_res20;
    FUN_14034ed40(local_res20);
    local_80 = 1;
    *(longlong *)(local_res20 + 0x40) = *(longlong *)(local_res20 + 0x40) + -1;
    if (*(longlong *)(local_res20 + 0x40) == 0) {
      FUN_14034edd0(lVar2);
      local_80 = 0;
      FUN_14012c7d0(local_res20);
    }
    else {
      FUN_14034edd0(lVar2);
    }
  }
  FUN_1403555d0(&local_68);
  puVar9 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar12 = local_res8 + -2, puVar12 != (uint *)0x0)) {
    uVar10 = FUN_14034fe70();
    local_78 = uVar10;
    FUN_14034ed40(uVar10);
    local_70 = 1;
    puVar9 = puVar9 + -1;
    *puVar9 = *puVar9 - 1;
    if (*puVar9 == 0) {
      FUN_14034ff60(puVar12);
    }
    FUN_14034edd0(uVar10);
  }
  return 0;
}



void FUN_1403731c0(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_14035bff0(uVar3,&local_res8,param_3,param_4,0xfffffffffffffffe);
    puVar4 = (undefined *)*plVar2;
    if ((undefined *)*plVar2 == (undefined *)0x0) {
      puVar4 = PTR_DAT_1405d8010;
    }
    FUN_1403935f0(*(undefined8 *)(param_1 + 0x17f0),0,puVar4);
    if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
       (local_res8 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      FUN_14034ed40(uVar3);
      piVar1 = (int *)(local_res8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_res8 + -8);
      }
      FUN_14034edd0(uVar3);
    }
  }
  local_res8 = (undefined *)0x0;
  FUN_14035bda0(&local_res8,param_2);
  FUN_140386f80(param_1,&local_res8);
  FUN_14012c7f0(param_2);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403732b0(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_1405d84f0 ^ (ulonglong)auStack_1138;
  FUN_1403a2790(&local_1100);
  local_78 = param_1;
  FUN_1403a2800(&local_1100);
  FUN_1403a2180(local_10d8);
  local_1100 = Proud::CFastArray<>::vftable;
  if (0 < local_10e8) {
    FUN_14036f5c0(local_10f0,(longlong)local_10e8);
  }
  if (local_10f0 != 0) {
    if (local_10f8 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*local_10f8 + 0x18))(local_10f8,local_10f0);
    }
  }
  return;
}



void FUN_140373380(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_140364170(lVar1);
        FUN_14034ff60(lVar1);
      }
      FUN_14034ff60(param_1);
    }
  }
  return;
}



void FUN_1403733f0(void)

{
  FUN_140372840();
  return;
}



undefined8 FUN_140373410(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_1403729f0(param_1,param_2);
  FUN_1403aca30(uVar3,param_3);
  return 1;
}



void FUN_1403734c0(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_140364170(lVar1);
        FUN_14034ff60(lVar1);
      }
      FUN_14034ff60(plVar2);
    }
  }
  return;
}



int * FUN_140373550(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_140372aa0(param_1,param_2,uVar2,uVar4);
  return (int *)(lVar3 + 8);
}



undefined8 FUN_140373600(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035d100(param_1);
  uVar2 = FUN_140372b20(param_1,param_2,param_3,param_4);
  FUN_14035d100(param_1);
  return uVar2;
}



void FUN_140373680(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_140364170(lVar2);
        FUN_14034ff60(lVar2);
      }
      FUN_14034ff60(plVar1);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403737b3)
// WARNING: Removing unreachable block (ram,0x0001403737ba)
// WARNING: Removing unreachable block (ram,0x0001403737c6)
// WARNING: Removing unreachable block (ram,0x0001403737f0)
// WARNING: Removing unreachable block (ram,0x000140373810)

undefined8
FUN_1403736f0(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_14034ed40(uVar9);
  local_118 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::CreateAndInitUdpSockets");
  }
  if (param_2 == 0) {
    FUN_14012c3e0(param_3,param_1 + 0x309);
    FUN_14034edd0(uVar9);
  }
  else {
    if (*(int *)(param_3 + 3) == 0) {
      local_fc = *(int *)(param_3 + 3);
      FUN_14012c550(param_3,1);
      puVar10 = (undefined4 *)FUN_14012c6a0(param_3);
      *puVar10 = 0;
    }
    local_138 = param_1 + 0xd9;
    FUN_14036db90(local_138,0);
    local_130 = param_1 + 0xde;
    FUN_140370170(local_130);
    local_res10 = 0;
    local_148 = 0;
    if (0 < *(int *)(param_3 + 3)) {
      do {
        lVar13 = local_148;
        local_150 = (longlong *)FUN_14034fef0(0x180);
        if (local_150 == (longlong *)0x0) {
          lVar11 = 0;
        }
        else {
          lVar11 = FUN_1403a1340(local_150,param_1);
        }
        if (lVar11 == 0) {
          plVar12 = (longlong *)0x0;
        }
        else {
          plVar12 = (longlong *)FUN_14034fef0(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_14034f800();
        }
        uVar1 = *(undefined4 *)(param_3[2] + lVar13 * 4);
        puVar3 = (undefined *)param_1[0x43];
        local_100 = uVar1;
        if (((puVar3 == (undefined *)0x0) || (puVar3 == PTR_DAT_1405d8008)) ||
           (*(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_140356df0(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_140356e40(lVar14,puVar3,uVar1);
        }
        if (cVar6 == '\0') {
          if (*(char *)((longlong)param_1 + 0x255) == '\0') {
            FUN_14034fe70();
            local_158 = (uint *)PTR_DAT_1405d8010;
            uVar7 = FUN_14034fcf0(&DAT_140477960);
            uVar18 = 0;
            uVar19 = 0;
            if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1405d8010)) {
              uVar19 = local_158[-2];
            }
            uVar8 = uVar7;
            if ((((int)uVar7 <= (int)uVar19) && (uVar8 = uVar18, local_158 != (uint *)0x0)) &&
               (local_158 != (uint *)PTR_DAT_1405d8010)) {
              uVar8 = local_158[-2];
            }
            uVar19 = 1;
            if (1 < (int)uVar8) {
              uVar19 = uVar8;
            }
            uVar8 = uVar18;
            if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1405d8010)) {
              uVar8 = local_158[-2];
            }
            if ((int)uVar8 < (int)uVar19) {
              if (local_158 == (uint *)0x0) {
                local_158 = (uint *)PTR_DAT_1405d8010;
              }
              if ((int)uVar19 < 0) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              if (uVar19 == 0) {
                FUN_1400031d0(&local_158);
              }
              else {
                uVar8 = uVar18;
                if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1405d8010)) {
                  uVar8 = local_158[-2];
                }
                if (uVar19 != uVar8) {
                  puVar15 = (uint *)FUN_14034fef0((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_1405d8010)) {
                    uVar8 = local_158[-2];
                  }
                  puVar16 = (uint *)PTR_DAT_1405d8010;
                  if ((int)uVar19 < (int)uVar8) {
LAB_140373db3:
                    if (local_158 != (uint *)0x0) {
                      puVar16 = local_158;
                    }
                  }
                  else {
                    uVar19 = uVar18;
                    if (local_158 != (uint *)0x0) {
                      if (local_158 != (uint *)PTR_DAT_1405d8010) {
                        uVar19 = local_158[-2];
                      }
                      goto LAB_140373db3;
                    }
                  }
                  FUN_14034fd20(puVar15 + 2,puVar16,uVar19);
                  FUN_1400031d0(&local_158);
                  local_158 = puVar15 + 2;
                }
              }
            }
            FUN_140002e10(&local_158);
            puVar15 = local_158;
            if (local_158 == (uint *)0x0) {
              puVar15 = (uint *)PTR_DAT_1405d8010;
            }
            FUN_14034fd20(puVar15,&DAT_140477960,uVar7);
            puVar15 = local_158;
            if (local_158 == (uint *)0x0) {
              puVar15 = (uint *)PTR_DAT_1405d8010;
            }
            uVar7 = FUN_14034fcf0(puVar15);
            uVar18 = 0;
            uVar19 = 0;
            if (0 < (int)uVar7) {
              uVar19 = uVar7;
            }
            uVar7 = uVar18;
            if ((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1405d8010)) {
              uVar7 = local_158[-2];
            }
            if (((int)uVar7 <= (int)uVar19) && (uVar19 = uVar18, local_158 != (uint *)0x0)) {
              if (local_158 == (uint *)PTR_DAT_1405d8010) goto LAB_140373e70;
              uVar19 = local_158[-2];
            }
            if (((local_158 != (uint *)PTR_DAT_1405d8010) && (local_158 != (uint *)0x0)) &&
               (local_158 + -2 != (uint *)0x0)) {
              local_158[-2] = uVar19;
              *(undefined2 *)((longlong)local_158 + (longlong)(int)uVar19 * 2) = 0;
            }
LAB_140373e70:
            local_f0 = 0;
            local_e8 = 0;
            local_e0 = 0;
            local_d8 = 0;
            local_f8 = Proud::ByteArray::vftable;
            uVar9 = FUN_14035bed0(&local_140,0x10,1,&local_158,&local_f8);
            FUN_14035bda0(param_5,uVar9);
            lVar13 = local_140;
            if (local_140 != 0) {
              local_110 = local_140;
              FUN_14034ed40(local_140);
              local_108 = 1;
              *(longlong *)(local_140 + 0x40) = *(longlong *)(local_140 + 0x40) + -1;
              if (*(longlong *)(local_140 + 0x40) == 0) {
                FUN_14034edd0(lVar13);
                local_108 = 0;
                FUN_14012c7d0(local_140);
              }
              else {
                FUN_14034edd0(lVar13);
                local_108 = 0;
              }
            }
            FUN_1403555d0(&local_f8);
            puVar15 = local_158;
            if (((local_158 != (uint *)0x0) && (local_158 != (uint *)PTR_DAT_1405d8010)) &&
               (puVar16 = local_158 + -2, puVar16 != (uint *)0x0)) {
              uVar9 = FUN_14034fe70();
              local_c0 = uVar9;
              FUN_14034ed40(uVar9);
              local_b8 = 1;
              puVar15 = puVar15 + -1;
              *puVar15 = *puVar15 - 1;
              if (*puVar15 == 0) {
                FUN_14034ff60(puVar16);
              }
              FUN_14034edd0(uVar9);
              local_b8 = 0;
            }
            local_158 = (uint *)PTR_DAT_1405d8010;
            FUN_14036db90(local_138,0);
            FUN_140370170(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_14034ff60(plVar5);
              }
            }
            FUN_14034edd0(local_120);
            *param_3 = Proud::CFastArray<int,0>::vftable;
            if (param_3[2] != 0) {
              if ((longlong *)param_3[1] == (longlong *)0x0) {
                FUN_14034ff60(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_14034f7d0();
          }
          iVar17 = *(int *)(param_4 + 0x18);
          FUN_14012c550(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_14012c6a0(param_4);
              lVar14 = FUN_14012c6a0(param_4);
              *(undefined4 *)(lVar14 + lVar20) = *(undefined4 *)(lVar13 + -4 + lVar20);
              lVar20 = lVar20 + -4;
              lVar11 = lVar11 + -1;
              lVar13 = local_148;
            } while (-1 < lVar11);
          }
          lVar11 = FUN_14012c6a0(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_14034ff60(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_140354860(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_14037400d:
            FUN_14034f420(local_98,L"m_cachedLocalAddr has an unexpected value!");
                    // WARNING: Subroutine does not return
            _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
          }
          if (plVar12 == (longlong *)0x0) {
            lVar13 = 0;
          }
          else {
            lVar13 = *plVar12;
          }
          if (*(short *)(lVar13 + 0x164) == -1) goto LAB_14037400d;
          iVar2 = (int)local_138[3];
          if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          lVar13 = local_138[3];
          FUN_14036db90(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_1403a2c90(plVar5);
              lVar14 = FUN_1403a2c90(plVar5);
              FUN_1403aca30(lVar13 + lVar14,lVar11 + lVar20);
              lVar11 = lVar11 + -8;
              lVar13 = lVar13 + -8;
              iVar17 = iVar17 + -1;
            } while (-1 < iVar17);
          }
          lVar13 = FUN_1403a2c90(local_138);
          FUN_1403aca30(lVar13 + (longlong)iVar2 * 8,&local_150);
          lVar13 = 0;
          lVar11 = lVar13;
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          FUN_140373410(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_1403549c0(lVar20,lVar11);
          lVar11 = lVar13;
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          lVar20 = lVar13;
          if (*(longlong **)(lVar11 + 0x150) != (longlong *)0x0) {
            lVar20 = **(longlong **)(lVar11 + 0x150);
          }
          FUN_1403598f0(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_1403a2c60(lVar20);
          if ((plVar12 == (longlong *)0x0) || (lVar11 = *plVar12 + 0x40, *plVar12 == 0)) {
            lVar11 = lVar13;
          }
          FUN_1403a0570(local_128,lVar11);
          lVar11 = lVar13;
          if (plVar12 != (longlong *)0x0) {
            lVar11 = *plVar12;
          }
          lVar11 = lVar11 + 0xa8;
          local_d0 = lVar11;
          FUN_14034ed40(lVar11);
          local_c8 = 1;
          if (plVar12 != (longlong *)0x0) {
            lVar13 = *plVar12;
          }
          FUN_1403a0850(lVar13);
          FUN_14034edd0(lVar11);
          local_c8 = 0;
          FUN_1403a0580(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_14034ff60(plVar5);
              lVar13 = local_148;
            }
          }
        }
        local_res10 = local_res10 + 1;
        local_148 = lVar13 + 1;
        uVar9 = local_120;
      } while (local_res10 < *(int *)(param_3 + 3));
    }
    FUN_14034edd0(uVar9);
  }
  *param_3 = Proud::CFastArray<int,0>::vftable;
  if (param_3[2] != 0) {
    if ((longlong *)param_3[1] == (longlong *)0x0) {
      FUN_14034ff60(param_3[2]);
    }
    else {
      (**(code **)(*(longlong *)param_3[1] + 0x18))();
    }
  }
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001403740ea)
// WARNING: Removing unreachable block (ram,0x0001403740f3)
// WARNING: Removing unreachable block (ram,0x000140374111)
// WARNING: Removing unreachable block (ram,0x00014037411a)

undefined1 * FUN_140374080(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_1403741a0(longlong param_1)

{
  FUN_1403733f0(param_1 + 0x58);
  FUN_1403733f0(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403741d0(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_1405d84f0 ^ (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_14036b8f0(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_14034ff60();
      plVar17 = local_e38;
    }
    goto LAB_1403748dd;
  }
  local_df8 = FUN_14034fef0(0x180);
  plVar10 = plVar17;
  if (local_df8 != 0) {
    plVar10 = (longlong *)FUN_1403a1340(local_df8,param_1);
  }
  if (plVar10 == (longlong *)0x0) {
    local_e18 = (longlong *)0x0;
  }
  else {
    local_e18 = (longlong *)FUN_14034fef0(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_14034ff60(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_14034f7d0();
    }
    uVar6 = *(uint *)(param_1[0x30b] + -4 + (longlong)iVar1 * 4);
    local_e28 = uVar6;
    FUN_14012c550(param_1 + 0x309,iVar1 + -1);
    local_e24 = uVar6;
  }
  uVar6 = local_e24;
  puVar3 = (undefined *)param_1[0x43];
  if (((puVar3 == (undefined *)0x0) || (puVar3 == PTR_DAT_1405d8008)) ||
     (*(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_140356df0(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_140356e40(plVar16,puVar3,local_e24);
  }
  if (cVar4 == '\0') {
    if ((int)uVar6 < 1) goto LAB_140374838;
    FUN_14034fe70();
    local_e30 = (uint *)PTR_DAT_1405d8010;
    uVar6 = FUN_14034fcf0(
                         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_1405d8010)) {
      plVar17 = (longlong *)(ulonglong)local_e30[-2];
    }
    uVar7 = uVar6;
    if ((((int)uVar6 <= (int)plVar17) && (uVar7 = uVar23, local_e30 != (uint *)0x0)) &&
       (local_e30 != (uint *)PTR_DAT_1405d8010)) {
      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_1405d8010)) {
      uVar7 = local_e30[-2];
    }
    if ((int)uVar7 < (int)uVar19) {
      if (local_e30 == (uint *)0x0) {
        local_e30 = (uint *)PTR_DAT_1405d8010;
      }
      if ((int)uVar19 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (uVar19 == 0) {
        FUN_1400031d0(&local_e30);
      }
      else {
        uVar7 = uVar8;
        if ((local_e30 != (uint *)0x0) && (local_e30 != (uint *)PTR_DAT_1405d8010)) {
          uVar7 = local_e30[-2];
        }
        if (uVar19 != uVar7) {
          puVar12 = (uint *)FUN_14034fef0((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_1405d8010)) {
            uVar7 = local_e30[-2];
          }
          puVar18 = (uint *)PTR_DAT_1405d8010;
          if ((int)uVar19 < (int)uVar7) {
LAB_1403744c4:
            if (local_e30 != (uint *)0x0) {
              puVar18 = local_e30;
            }
          }
          else {
            uVar19 = uVar23;
            if (local_e30 != (uint *)0x0) {
              if (local_e30 != (uint *)PTR_DAT_1405d8010) {
                uVar19 = local_e30[-2];
              }
              goto LAB_1403744c4;
            }
          }
          FUN_14034fd20(puVar12 + 2,puVar18,uVar19);
          FUN_1400031d0(&local_e30);
          local_e30 = puVar12 + 2;
        }
      }
    }
    FUN_140002e10(&local_e30);
    puVar12 = local_e30;
    if (local_e30 == (uint *)0x0) {
      puVar12 = (uint *)PTR_DAT_1405d8010;
    }
    FUN_14034fd20(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_1405d8010;
    }
    uVar6 = FUN_14034fcf0(puVar12);
    uVar23 = 0;
    if (0 < (int)uVar6) {
      uVar23 = uVar6;
    }
    uVar6 = uVar8;
    if ((local_e30 != (uint *)0x0) && (local_e30 != (uint *)PTR_DAT_1405d8010)) {
      uVar6 = local_e30[-2];
    }
    if (((int)uVar23 < (int)uVar6) || (uVar23 = uVar8, local_e30 == (uint *)0x0)) {
LAB_140374563:
      if (((local_e30 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
      uVar23 = local_e30[-2];
      goto LAB_140374563;
    }
    local_da8 = 0;
    local_da0 = 0;
    local_d98 = 0;
    local_d90 = 0;
    local_db0 = Proud::ByteArray::vftable;
    local_e48 = &local_db0;
    uVar13 = FUN_14035bed0(local_d40,0x11,(int)param_2[0xdf],&local_e30);
    (**(code **)(*param_1 + 0x88))(param_1,uVar13);
    FUN_1403555d0(&local_db0);
    puVar12 = local_e30;
    if (((local_e30 != (uint *)0x0) && (local_e30 != (uint *)PTR_DAT_1405d8010)) &&
       (puVar18 = local_e30 + -2, puVar18 != (uint *)0x0)) {
      uVar13 = FUN_14034fe70();
      local_d58 = uVar13;
      FUN_14034ed40(uVar13);
      local_d50 = 1;
      puVar12 = puVar12 + -1;
      *puVar12 = *puVar12 - 1;
      if (*puVar12 == 0) {
        FUN_14034ff60(puVar18);
      }
      FUN_14034edd0(uVar13);
      local_d50 = 0;
    }
    local_e30 = (uint *)PTR_DAT_1405d8010;
    plVar17 = param_1 + 0x309;
    iVar1 = (int)param_1[0x30c];
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    lVar22 = param_1[0x30c];
    FUN_14012c550(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_14012c6a0(plVar17);
        lVar14 = FUN_14012c6a0(plVar17);
        *(undefined4 *)(lVar14 + lVar21) = *(undefined4 *)(lVar15 + -4 + lVar21);
        lVar21 = lVar21 + -4;
        lVar22 = lVar22 + -1;
      } while (-1 < lVar22);
    }
    lVar22 = FUN_14012c6a0(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_1405d8008)) ||
       (*(int *)(puVar3 + -8) == 0)) {
      lVar21 = lVar22;
      if (plVar10 != (longlong *)0x0) {
        lVar21 = *plVar10;
      }
      if (*(longlong **)(lVar21 + 0x150) != (longlong *)0x0) {
        lVar22 = **(longlong **)(lVar21 + 0x150);
      }
      cVar4 = FUN_140356df0(lVar22,0);
    }
    else {
      lVar21 = lVar22;
      if (plVar10 != (longlong *)0x0) {
        lVar21 = *plVar10;
      }
      if (*(longlong **)(lVar21 + 0x150) != (longlong *)0x0) {
        lVar22 = **(longlong **)(lVar21 + 0x150);
      }
      cVar4 = FUN_140356e40(lVar22,puVar3,0);
    }
    if (cVar4 == '\0') {
LAB_140374838:
      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_14034ff60(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_140354860(lVar15,local_d38);
  *(undefined4 *)(lVar21 + 0x160) = *(undefined4 *)(lVar15 + 8);
  *(undefined2 *)(lVar21 + 0x164) = *(undefined2 *)(lVar15 + 0xc);
  lVar21 = lVar22;
  if (plVar10 != (longlong *)0x0) {
    lVar21 = *plVar10;
  }
  FUN_140373410(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_1403549c0(lVar15,lVar21);
  lVar21 = lVar22;
  if (plVar10 != (longlong *)0x0) {
    lVar21 = *plVar10;
  }
  if (*(longlong **)(lVar21 + 0x150) != (longlong *)0x0) {
    lVar22 = **(longlong **)(lVar21 + 0x150);
  }
  FUN_1403598f0(param_1[0xf1],lVar22);
  FUN_1403a2c60();
  plVar17 = plVar10;
LAB_1403748dd:
  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_14034ff60();
    }
  }
  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_14034ff60(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_1403a0570(&local_df8,plVar11);
    plVar11 = plVar10;
    if ((undefined8 *)param_2[0xec] != (undefined8 *)0x0) {
      plVar11 = *(longlong **)param_2[0xec];
    }
    plVar11 = plVar11 + 0x15;
    local_d68 = plVar11;
    FUN_14034ed40(plVar11);
    local_d60 = 1;
    plVar16 = plVar10;
    if ((longlong *)param_2[0xec] != (longlong *)0x0) {
      plVar16 = *(longlong **)param_2[0xec];
    }
    FUN_1403a0850(plVar16);
    FUN_14034edd0(plVar11);
    local_d60 = 0;
    FUN_1403a0580();
  }
  local_d70 = 0;
  local_d6f = DAT_1405d81cc;
  local_d78 = 0;
  local_d88[0] = 0;
  local_d80 = 0;
  local_d74 = 0xffffffff;
  if ((char)param_1[0x4d] == '\0') {
    local_d74 = 0;
  }
  FUN_1403841b0(local_df0);
  FUN_140383c40(local_df0);
  FUN_140058870(local_df0,0x2d);
  if (((longlong *)param_2[0xe8] == (longlong *)0x0) ||
     (lVar22 = *(longlong *)param_2[0xe8], plVar11 = (longlong *)(lVar22 + 0x40), lVar22 == 0)) {
    plVar11 = plVar10;
  }
  FUN_1403a0570(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_140399790();
    }
  }
  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_140399790();
    }
    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_14039b1d0(1);
  uVar9 = (**(code **)(*param_2 + 0x10))(param_2);
  local_e40 = local_d88;
  local_e48 = (undefined ***)&local_cd8;
  FUN_1403a0a50(plVar10,uVar9,uVar5,&local_dc8);
  if (local_58 != (undefined4 *)0x0) {
    if (local_4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_50 = 0;
    FUN_1403a0580(local_db8);
    local_e08 = &local_de8;
    FUN_140399690(&local_de8);
    plVar10 = local_e38;
    if (local_de0 != (longlong *)0x0) {
      if (local_dd4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_14034ff60(plVar10);
      }
    }
    return 1;
  }
  FUN_14034f420(local_d28,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_d28,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_140374cb0(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_1403741d0();
    if (cVar2 != '\0') {
      if (*(undefined8 **)(param_2 + 0x740) == (undefined8 *)0x0) {
        uVar3 = 0;
      }
      else {
        uVar3 = **(undefined8 **)(param_2 + 0x740);
      }
      FUN_1403a0c70(uVar3,local_30,param_2);
      (**(code **)(*(longlong *)(param_1 + 0x4a8) + 0x140))
                ((longlong *)(param_1 + 0x4a8),*(undefined4 *)(param_2 + 0x6f8),&DAT_1405f2490,
                 local_30,uVar4);
      *(undefined1 *)(param_2 + 0x701) = 1;
      if (((local_30[0] != (undefined *)0x0) && (local_30[0] != PTR_DAT_1405d8008)) &&
         (local_30[0] + -8 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_20 = uVar4;
        FUN_14034ed40(uVar4);
        local_18 = 1;
        piVar1 = (int *)(local_30[0] + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_30[0] + -8);
        }
        FUN_14034edd0(uVar4);
      }
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140374f2d)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140374db0(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_1405d80d0) {
      if (lVar4 != 0) {
        lVar4 = *(longlong *)(lVar4 + 0x10);
      }
    }
    else {
      if (lVar4 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar3 = *(longlong *)(lVar4 + 0x10);
      FUN_1403703a0(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_1403555d0((longlong)pvVar2 + 0x148);
          FUN_1403555d0((longlong)pvVar2 + 0x120);
          operator_delete(pvVar2);
        }
        FUN_14034ff60(local_res8);
      }
    }
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



// WARNING: Removing unreachable block (ram,0x00014037503d)
// WARNING: Removing unreachable block (ram,0x000140375006)

longlong * FUN_140374f60(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_1403703a0(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_140360e30(puVar3);
      }
    }
    if (local_res8 != 0) {
      plVar1 = (longlong *)(local_res8 + 8);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_140360e30(local_res8);
      }
    }
  }
  return param_2;
}



undefined8 FUN_1403750e0(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_140373550(param_1,param_2);
  FUN_14036da30(uVar3,param_3);
  return 1;
}



longlong * FUN_140375190(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_140373600(param_1,param_2,uVar6);
  return (longlong *)(lVar4 + 8);
}



void FUN_140375240(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (lVar1 != 0) {
    FUN_1400031d0(lVar1 + 0x98);
    FUN_1403638e0(lVar1 + 0x38);
    FUN_14034ff60(lVar1);
  }
  FUN_14034edf0(param_1);
  FUN_14034ff60(param_1);
  return;
}



void FUN_1403752b0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (lVar1 != 0) {
    FUN_1403638e0(lVar1 + 0x28);
    FUN_14034ff60(lVar1);
  }
  FUN_14034edf0(param_1);
  FUN_14034ff60(param_1);
  return;
}



void FUN_140375300(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  if (lVar1 != 0) {
    FUN_1403638e0(lVar1 + 8);
    FUN_14034ff60(lVar1);
  }
  FUN_14034edf0(param_1);
  FUN_14034ff60(param_1);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140375446)
// WARNING: Removing unreachable block (ram,0x000140375454)

void FUN_140375350(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_14034ed40(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034ed40(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_14034edd0(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034edd0(uVar3);
    }
    if (uVar4 != 0) {
      FUN_140375300(uVar4);
    }
  }
  return;
}



undefined8 FUN_140375480(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_14034ed40(uVar5);
  if (DAT_1405f064f != '\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_14036ff50(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_140360e30(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_140374cb0(*(undefined8 *)(param_1 + 0x20));
                FUN_140374cb0(*(undefined8 *)(param_1 + 0x20),*(undefined8 *)(lVar9 + 0x108));
                plVar6 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
                (**(code **)(*plVar6 + 0x120))(plVar6,*param_4,&DAT_1405f2490,local_res10);
                plVar6 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
                (**(code **)(*plVar6 + 0x120))(plVar6,local_res10[0],&DAT_1405f2490,param_4);
                *(undefined1 *)(lVar9 + 0x110) = 1;
                if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x17f0) != 0) {
                  FUN_14034fe70();
                  local_res20 = PTR_DAT_1405d8010;
                  FUN_140017720(&local_res20,&DAT_140454090,local_res10[0],*param_4);
                  puVar4 = local_res20;
                  puVar10 = local_res20;
                  if (local_res20 == (undefined *)0x0) {
                    puVar10 = PTR_DAT_1405d8010;
                  }
                  FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x17f0),1,puVar10);
                  if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
                     (puVar4 + -8 != (undefined *)0x0)) {
                    uVar7 = FUN_14034fe70();
                    FUN_14034ed40(uVar7);
                    piVar1 = (int *)(puVar4 + -4);
                    *piVar1 = *piVar1 + -1;
                    if (*piVar1 == 0) {
                      FUN_14034ff60(puVar4 + -8);
                    }
                    FUN_14034edd0(uVar7);
                  }
                }
              }
            }
          }
        }
        break;
      }
      puVar8 = *(uint **)(puVar8 + 4);
      if (puVar8 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar5);
  return 1;
}



undefined8 FUN_140375760(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_14034ed40(uVar6);
  local_68 = 1;
  if (DAT_1405f064f != '\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_1403741d0(lVar2,lVar3);
          FUN_14034fe70();
          local_80 = PTR_DAT_1405d8008;
          if (local_res10[0] != '\0') {
            if (*(undefined8 **)(lVar3 + 0x740) == (undefined8 *)0x0) {
              uVar8 = 0;
            }
            else {
              uVar8 = **(undefined8 **)(lVar3 + 0x740);
            }
            plVar7 = (longlong *)FUN_1403a0c70(uVar8,&local_40,lVar3);
            if (local_80 == (undefined *)0x0) {
              local_80 = PTR_DAT_1405d8008;
            }
            if ((undefined *)*plVar7 != local_80) {
              uVar6 = FUN_14034fe70();
              local_60 = uVar6;
              FUN_14034ed40(uVar6);
              puVar5 = local_80;
              local_58 = 1;
              if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1405d8008)) &&
                 (puVar11 = local_80 + -8, puVar11 != (undefined *)0x0)) {
                uVar8 = FUN_14034fe70();
                local_50 = uVar8;
                FUN_14034ed40(uVar8);
                local_48 = 1;
                piVar1 = (int *)(puVar5 + -4);
                *piVar1 = *piVar1 + -1;
                if (*piVar1 == 0) {
                  FUN_14034ff60(puVar11);
                }
                FUN_14034edd0(uVar8);
              }
              local_80 = (undefined *)*plVar7;
              if (((local_80 != PTR_DAT_1405d8008) && (local_80 != (undefined *)0x0)) &&
                 (local_80 != (undefined *)0x8)) {
                *(int *)(local_80 + -4) = *(int *)(local_80 + -4) + 1;
              }
              FUN_14034edd0(uVar6);
              uVar6 = local_70;
            }
            puVar5 = local_40;
            local_78 = (undefined2)plVar7[1];
            if (((local_40 != (undefined *)0x0) && (local_40 != PTR_DAT_1405d8008)) &&
               (puVar11 = local_40 + -8, puVar11 != (undefined *)0x0)) {
              uVar8 = FUN_14034fe70();
              local_50 = uVar8;
              FUN_14034ed40(uVar8);
              local_48 = 1;
              piVar1 = (int *)(puVar5 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(puVar11);
              }
              FUN_14034edd0(uVar8);
            }
          }
          plVar7 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
          (**(code **)(*plVar7 + 0x150))
                    (plVar7,(ulonglong)param_2,&DAT_1405f2490,local_res10,&local_80);
          if (local_res10[0] != '\0') {
            FUN_14036d2d0(*(undefined8 *)(param_1 + 0x20),lVar3);
          }
          puVar5 = local_80;
          if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1405d8008)) &&
             (puVar11 = local_80 + -8, puVar11 != (undefined *)0x0)) {
            puVar9 = (undefined *)FUN_14034fe70();
            local_40 = puVar9;
            FUN_14034ed40(puVar9);
            local_38 = 1;
            piVar1 = (int *)(puVar5 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar11);
            }
            FUN_14034edd0(puVar9);
          }
        }
        break;
      }
      puVar10 = *(uint **)(puVar10 + 4);
      if (puVar10 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar6);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140375a40(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_1405d84f0 ^ (ulonglong)auStack_488;
  local_2e0 = param_1 + 0xb8;
  local_450 = param_3;
  FUN_14034ed40(local_2e0);
  local_2d8 = 1;
  if ((*(longlong **)(param_1 + 0x6a0) != (longlong *)0x0) &&
     (**(longlong **)(param_1 + 0x6a0) != 0)) goto LAB_140376871;
  iVar8 = *(int *)((longlong)param_2 + 0x54);
  if (iVar8 == 0) {
    iVar8 = FUN_14034f860();
    *(int *)((longlong)param_2 + 0x54) = iVar8;
  }
  if (iVar8 < 0) {
    FUN_14034f420(local_210,L"Invalid thread count");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_210,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f800();
      }
      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_14034f420(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_1405d36c0);
    }
  }
  iVar8 = *(int *)((longlong)param_2 + 0x5c);
  if (((iVar8 != 0x80) && (iVar8 != 0xc0)) && (iVar8 != 0x100)) {
    FUN_14034f420(local_1c8,L"Invalid key length!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_1c8,(ThrowInfo *)&DAT_1405d36c0);
  }
  local_3d8 = Proud::CFastArray<int,0>::vftable;
  if (DAT_1405d8848 != 5) {
    FUN_14035b550();
  }
  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_14034f7d0();
  }
  FUN_14012c550(&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_140370720(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_14034f800();
      }
      if ((longlong)puVar16 + 1 < 0) {
LAB_140375cbc:
                    // WARNING: Subroutine does not return
        FUN_14034f800();
      }
      uVar19 = (int)puVar21 + 1;
      puVar21 = (undefined4 *)(ulonglong)uVar19;
      if (iVar6 <= (int)uVar19) goto LAB_140375cbc;
      if ((puVar18[(longlong)puVar16] == puVar18[(longlong)puVar16 + 1]) &&
         (puVar18[(longlong)puVar16] != 0)) {
        FUN_14034f420(local_2a0,L"Cannot add duplicated UDP port number!");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_2a0,(ThrowInfo *)&DAT_1405d36c0);
      }
      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_140354510(&local_430);
  if ((1 < (int)local_418) &&
     (((puVar20 = (undefined *)param_2[1], puVar20 == (undefined *)0x0 ||
       (puVar20 == PTR_DAT_1405d8010)) || (*(int *)(puVar20 + -8) == 0)))) {
    FUN_14034fe70();
    local_458 = (uint *)PTR_DAT_1405d8010;
    uVar19 = FUN_14034fcf0(
                          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_1405d8010)) {
      puVar16 = (undefined4 *)(ulonglong)local_458[-2];
    }
    uVar9 = uVar19;
    if ((((int)uVar19 <= (int)puVar16) && (uVar9 = uVar11, local_458 != (uint *)0x0)) &&
       (local_458 != (uint *)PTR_DAT_1405d8010)) {
      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_1405d8010)) {
      uVar9 = local_458[-2];
    }
    if ((int)uVar9 < (int)uVar25) {
      if (local_458 == (uint *)0x0) {
        local_458 = (uint *)PTR_DAT_1405d8010;
      }
      if ((int)uVar25 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (uVar25 == 0) {
        FUN_1400031d0(&local_458);
      }
      else {
        uVar9 = uVar10;
        if ((local_458 != (uint *)0x0) && (local_458 != (uint *)PTR_DAT_1405d8010)) {
          uVar9 = local_458[-2];
        }
        if (uVar25 != uVar9) {
          puVar13 = (uint *)FUN_14034fef0((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_1405d8010)) {
            uVar9 = local_458[-2];
          }
          puVar24 = (uint *)PTR_DAT_1405d8010;
          if ((int)uVar25 < (int)uVar9) {
LAB_140375e21:
            if (local_458 != (uint *)0x0) {
              puVar24 = local_458;
            }
          }
          else {
            uVar25 = uVar11;
            if (local_458 != (uint *)0x0) {
              if (local_458 != (uint *)PTR_DAT_1405d8010) {
                uVar25 = local_458[-2];
              }
              goto LAB_140375e21;
            }
          }
          FUN_14034fd20(puVar13 + 2,puVar24,uVar25);
          FUN_1400031d0(&local_458);
          local_458 = puVar13 + 2;
        }
      }
    }
    FUN_140002e10(&local_458);
    puVar13 = local_458;
    if (local_458 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1405d8010;
    }
    FUN_14034fd20(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_1405d8010;
    }
    uVar19 = FUN_14034fcf0(puVar13);
    uVar11 = 0;
    if (0 < (int)uVar19) {
      uVar11 = uVar19;
    }
    uVar19 = uVar10;
    if ((local_458 != (uint *)0x0) && (local_458 != (uint *)PTR_DAT_1405d8010)) {
      uVar19 = local_458[-2];
    }
    if (((int)uVar11 < (int)uVar19) || (uVar11 = uVar10, local_458 == (uint *)0x0)) {
LAB_140375ec4:
      if (((local_458 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
      uVar11 = local_458[-2];
      goto LAB_140375ec4;
    }
    local_348 = 0;
    local_340 = 0;
    local_338 = 0;
    local_330 = 0;
    local_350 = Proud::ByteArray::vftable;
    local_468 = &local_350;
    uVar14 = FUN_14035bed0(&local_360,1,0,&local_458);
    FUN_140372030(param_1 + -0xa8,uVar14);
    FUN_1403555d0(&local_350);
    puVar13 = local_458;
    if (((local_458 != (uint *)0x0) && (local_458 != (uint *)PTR_DAT_1405d8010)) &&
       (puVar24 = local_458 + -2, puVar24 != (uint *)0x0)) {
      uVar14 = FUN_14034fe70();
      local_2f8 = uVar14;
      FUN_14034ed40(uVar14);
      local_2f0 = 1;
      puVar13 = puVar13 + -1;
      *puVar13 = *puVar13 - 1;
      if (*puVar13 == 0) {
        FUN_14034ff60(puVar24);
      }
      FUN_14034edd0(uVar14);
      local_2f0 = 0;
    }
    local_458 = (uint *)PTR_DAT_1405d8010;
    FUN_14034fe70();
    local_438 = (undefined4 *)PTR_DAT_1405d8010;
    plVar15 = (longlong *)FUN_14034fc50(&local_408);
    puVar20 = (undefined *)*plVar15;
    if ((undefined *)*plVar15 == (undefined *)0x0) {
      puVar20 = PTR_DAT_1405d8010;
    }
    FUN_140017720(&local_438,L"No NIC binding though multiple NIC detected##Process=%s",puVar20);
    if (((local_408 != (undefined *)0x0) && (local_408 != PTR_DAT_1405d8010)) &&
       (local_408 + -8 != (undefined *)0x0)) {
      uVar14 = FUN_14034fe70();
      local_318 = uVar14;
      FUN_14034ed40(uVar14);
      local_310 = 1;
      piVar1 = (int *)(local_408 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_408 + -8);
      }
      FUN_14034edd0(uVar14);
      local_310 = 0;
    }
    local_408 = PTR_DAT_1405d8010;
    FUN_14034fe70();
    puVar16 = local_438;
    local_448 = (undefined4 *)PTR_DAT_1405d8010;
    if (PTR_DAT_1405d8010 == (undefined *)0x0) {
      local_448 = puVar17;
    }
    if (local_438 != (undefined4 *)PTR_DAT_1405d8010) {
      uVar14 = FUN_14034fe70();
      local_308 = uVar14;
      FUN_14034ed40(uVar14);
      local_300 = 1;
      FUN_1400031d0(&local_448);
      local_448 = puVar16;
      if (((puVar16 != (undefined4 *)PTR_DAT_1405d8010) && (puVar16 != (undefined4 *)0x0)) &&
         (puVar16 != (undefined4 *)0x8)) {
        puVar16[-1] = puVar16[-1] + 1;
      }
      FUN_14034edd0(uVar14);
      local_300 = 0;
    }
    FUN_140352d80(&local_448);
    if (((puVar16 != (undefined4 *)0x0) && (puVar16 != (undefined4 *)PTR_DAT_1405d8010)) &&
       (puVar16 + -2 != (undefined4 *)0x0)) {
      uVar14 = FUN_14034fe70();
      local_328 = uVar14;
      FUN_14034ed40(uVar14);
      local_320 = 1;
      piVar1 = puVar16 + -1;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar16 + -2);
      }
      FUN_14034edd0(uVar14);
      local_320 = 0;
    }
    local_438 = (undefined4 *)PTR_DAT_1405d8010;
  }
  dVar27 = (double)param_2[0x16];
  if ((double)param_2[0x16] <= 0.0) {
    dVar27 = DAT_1405d81a0;
  }
  *(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_1405d3570);
  }
  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_1405d3570);
  }
  *(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_1403a51c0(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_1403a5090(&local_3b0,*(undefined4 *)(param_1 + 0x19c));
  puVar16 = local_3a0;
  if ((int)local_398 == 0) {
    puVar16 = puVar17;
  }
  FUN_140394f20(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_1403a5090(&local_400,*(undefined4 *)(param_1 + 0x1a0));
  puVar16 = local_3f0;
  if ((int)local_3e8 == 0) {
    puVar16 = puVar17;
  }
  FUN_1403a4780(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_1403594e0(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_1403594e0(local_440,puVar16,1);
  }
  *(undefined4 **)(param_1 + 0x6e8) = puVar16;
  FUN_14035a200(param_1 + 0x6b8);
  uVar14 = FUN_14035a290(param_1 + 0x6b8);
  *(undefined8 *)(param_1 + 0x158) = uVar14;
  *(undefined8 *)(param_1 + 0x118) = 0;
  puVar16 = (undefined4 *)FUN_140357570(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_1405d8010;
  }
  local_168 = local_160;
  FUN_14034ef40(&local_168,puVar20,3);
  FUN_14034f220(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_1405d8010;
  }
  local_d8 = local_d0;
  FUN_14034ef40(&local_d8,puVar20,3);
  FUN_14034f220(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_1405d8848 != 5) {
    FUN_14035b550();
  }
  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_14034f7d0();
  }
  FUN_14012c550(&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_1403736f0(param_1 + -0xa8,(int)param_2[8],&local_388,param_2 + 0x11);
  if ((cVar7 != '\0') &&
     (cVar7 = FUN_140372d70(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_1403a3c50(local_450);
      }
    }
    else {
      local_450 = operator_new(0x90);
      if (local_450 != (void *)0x0) {
        puVar16 = (undefined4 *)FUN_1403a4010(local_450,DAT_1405d81a8);
      }
    }
    *(undefined4 **)(param_1 + 0x3d0) = puVar16;
    *(undefined4 *)(param_1 + 0x175c) = 0;
    FUN_14000d470(param_1 + 0x1760,&DAT_140477960);
    *(undefined8 *)(param_1 + 0x1768) = 0;
    *(undefined4 *)(param_1 + 0x1798) = 0;
    uVar11 = *(uint *)(param_2 + 0xb);
    iVar8 = FUN_14034f860();
    if (iVar8 <= (int)uVar11) {
      uVar11 = FUN_14034f860();
    }
    puVar16 = puVar17;
    if (0 < (int)uVar11) {
      puVar16 = (undefined4 *)(ulonglong)uVar11;
    }
    *(int *)(param_2 + 0xb) = (int)puVar16;
    if ((int)puVar16 == 0) {
      uVar12 = FUN_14034f860();
      *(undefined4 *)(param_2 + 0xb) = uVar12;
    }
    local_360 = operator_new(0x280);
    if (local_360 != (void *)0x0) {
      puVar17 = (undefined4 *)FUN_14038e680(local_360,param_1 + -0xa8);
    }
    *(undefined4 **)(param_1 + 0x338) = puVar17;
    FUN_140392740(puVar17,*(undefined4 *)((longlong)param_2 + 0x54),(int)param_2[0xb]);
    Sleep(100);
    FUN_1403555d0(&local_400);
    FUN_1403555d0(&local_3b0);
    local_430 = Proud::CFastArray<>::vftable;
    if (0 < (int)local_418) {
      uVar22 = local_418 & 0xffffffff;
      lVar26 = local_420;
      do {
        FUN_14000d2c0(lVar26);
        lVar26 = lVar26 + 8;
        uVar22 = uVar22 - 1;
      } while (uVar22 != 0);
    }
    if (local_420 != 0) {
      if (local_428 == (longlong *)0x0) {
        FUN_14034ff60();
      }
      else {
        (**(code **)(*local_428 + 0x18))(local_428,local_420);
      }
    }
    if (puVar18 != (undefined4 *)0x0) {
      if (local_3d0 == (longlong *)0x0) {
        FUN_14034ff60(puVar18);
      }
      else {
        (**(code **)(*local_3d0 + 0x18))(local_3d0,puVar18);
      }
    }
    FUN_14034edd0(param_1 + 0xb8);
    return 1;
  }
  FUN_14035a250(param_1 + 0x6b8);
  pvVar2 = *(void **)(param_1 + 0x6e0);
  if (pvVar2 != (void *)0x0) {
    FUN_1403596c0(pvVar2);
    operator_delete(pvVar2);
  }
  *(undefined8 *)(param_1 + 0x6e0) = 0;
  pvVar2 = *(void **)(param_1 + 0x6e8);
  if (pvVar2 != (void *)0x0) {
    FUN_1403596c0(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_1403555d0(&local_400);
  FUN_1403555d0(&local_3b0);
  local_430 = Proud::CFastArray<>::vftable;
  if (0 < (int)local_418) {
    uVar22 = local_418 & 0xffffffff;
    lVar26 = local_420;
    do {
      FUN_14000d2c0(lVar26);
      lVar26 = lVar26 + 8;
      uVar22 = uVar22 - 1;
    } while (uVar22 != 0);
  }
  if (local_420 != 0) {
    if (local_428 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*local_428 + 0x18))(local_428,local_420);
    }
  }
  if (puVar18 != (undefined4 *)0x0) {
    if (local_3d0 == (longlong *)0x0) {
      FUN_14034ff60(puVar18);
    }
    else {
      (**(code **)(*local_3d0 + 0x18))(local_3d0,puVar18);
    }
  }
LAB_140376871:
  FUN_14034edd0(param_1 + 0xb8);
  return 0;
}



void FUN_1403768b0(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_1403750e0(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_140360e30(*param_4);
  }
  return;
}



void FUN_140376970(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_1403750e0(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_140360e30(*param_4);
  }
  return;
}



void FUN_140376a30(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_14034ed40(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_14034edd0(lVar1);
      FUN_140375240(*param_1);
    }
    else {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



void FUN_140376ab0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_14034ed40(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_14034edd0(lVar1);
      FUN_1403752b0(*param_1);
    }
    else {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



void FUN_140376b30(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_14034ed40(lVar1);
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_14034edd0(lVar1);
      FUN_140375300(*param_1);
    }
    else {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140376ca6)
// WARNING: Removing unreachable block (ram,0x000140376cb4)

void FUN_140376bb0(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_14034ed40(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034ed40(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_14034edd0(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034edd0(uVar3);
    }
    if (uVar4 != 0) {
      FUN_140375240(uVar4);
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140376dd6)
// WARNING: Removing unreachable block (ram,0x000140376de4)

void FUN_140376ce0(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_14034ed40(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034ed40(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_14034edd0(uVar2);
    }
    if (uVar3 != 0) {
      FUN_14034edd0(uVar3);
    }
    if (uVar4 != 0) {
      FUN_1403752b0(uVar4);
    }
  }
  return;
}



longlong FUN_140376e10(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_140376ec0(longlong param_1)

{
  FUN_1403555d0(param_1 + 0xc0);
  FUN_1403555d0(param_1 + 0x78);
  FUN_140399690(param_1 + 0x50);
  if (*(longlong *)(param_1 + 0x58) != 0) {
    if (*(int *)(param_1 + 100) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0x60) = 0;
  }
  FUN_1403555d0(param_1 + 0x28);
  FUN_140376ab0(param_1 + 0x20);
  FUN_140376a30(param_1 + 0x18);
  FUN_14012c7f0(param_1 + 8);
  return;
}



undefined4 * FUN_140376f50(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_1403841e0(param_1 + 2);
  FUN_140376e10(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_140399790();
      }
      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_140399790();
        }
        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_1400179d0(lVar1,*(int *)(lVar1 + 0x18) - iVar3);
      }
      else {
        pvVar4 = *(void **)(param_1 + 6);
        if (pvVar4 == (void *)0x0) {
          FUN_14034f420(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
        }
        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_14034f420(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
        }
        iVar3 = param_1[8] - iVar3;
        if ((iVar3 < 0) || ((int)param_1[9] < iVar3)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        param_1[8] = iVar3;
      }
    }
  }
  *param_1 = param_3;
  return param_1;
}



void FUN_1403770d0(longlong param_1)

{
  FUN_140376ec0(param_1 + 0x30);
  FUN_140399690(param_1 + 0x10);
  if (*(longlong *)(param_1 + 0x18) != 0) {
    if (*(int *)(param_1 + 0x24) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0x20) = 0;
  }
  return;
}



undefined8 * FUN_140377130(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_1403734c0(param_2,puVar1 + 2,param_3,uVar2,0xfffffffffffffffe);
  }
  return param_2;
}



undefined8 FUN_1403771c0(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_14034ed40(uVar3);
  uVar5 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1,L"Proud::CNetServerImpl::GetP2PGroupInfo");
  }
  FUN_140377130(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_140364170(lVar2);
        FUN_14034ff60(lVar2);
      }
      FUN_14034ff60(local_res8);
    }
    FUN_14034edd0(uVar3);
    uVar3 = 0;
  }
  else {
    FUN_1403a5bc0(*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_140364170(lVar2);
        FUN_14034ff60(lVar2);
      }
      FUN_14034ff60(local_res8);
    }
    FUN_14034edd0(uVar3);
    uVar3 = 1;
  }
  return uVar3;
}



longlong * FUN_140377300(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_140377130(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_140364170(lVar4);
      FUN_14034ff60(lVar4);
    }
    local_res20 = (longlong *)FUN_14034ff60(local_res20);
  }
  if (puVar6 == (undefined4 *)0x0) {
    if ((param_2 != 1) && (lVar4 = FUN_140361850(param_1,param_2), lVar4 == 0)) {
      return (longlong *)0x0;
    }
    local_res20 = (longlong *)FUN_14035ffc0(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_14034f7d0();
      }
      FUN_14035eed0(param_3,lVar4 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar4) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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,0x0001403778fb)
// WARNING: Removing unreachable block (ram,0x000140377902)
// WARNING: Removing unreachable block (ram,0x000140377910)
// WARNING: Removing unreachable block (ram,0x00014037791d)
// WARNING: Removing unreachable block (ram,0x000140377915)
// WARNING: Removing unreachable block (ram,0x000140377923)
// WARNING: Removing unreachable block (ram,0x000140377935)
// WARNING: Removing unreachable block (ram,0x00014037759a)

undefined8 FUN_140377420(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_14034ed40(uVar6);
  if (DAT_1405f064f != '\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_14034edd0(uVar6);
          return 1;
        }
        break;
      }
      puVar14 = *(uint **)(puVar14 + 4);
      if (puVar14 == (uint *)0x0) break;
    }
  }
  plVar8 = (longlong *)FUN_140377130(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_140364170(lVar1);
      FUN_14034ff60(lVar1);
    }
    FUN_14034ff60(local_res8);
  }
  if (plVar7 == (longlong *)0x0) {
    FUN_14034edd0(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_140377770:
        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_140377824;
                }
                break;
              }
              puVar14 = *(uint **)(puVar14 + 6);
              if (puVar14 == (uint *)0x0) break;
            }
          }
          goto LAB_140377954;
        }
        if (lStack_50 != lVar13) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
      }
    }
    if (plVar17 != (longlong *)0x0) {
      if (local_88 == (longlong *)0x0) {
        FUN_14034ff60(plVar17);
      }
      else {
        (**(code **)(*local_88 + 0x18))(local_88,plVar17);
      }
    }
    FUN_14034edd0(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_14037788b;
        puVar9 = (undefined8 *)FUN_1403a2c90(&local_90);
        plVar16 = plVar15;
        goto LAB_140377870;
      }
      break;
    }
    puVar14 = *(uint **)(puVar14 + 6);
    if (puVar14 == (uint *)0x0) break;
LAB_140377824:
    if ((uint)uVar3 != puVar14[10] % uVar12) break;
  }
  goto LAB_140377954;
  while( true ) {
    uVar12 = (int)plVar16 + 1;
    plVar16 = (longlong *)(ulonglong)uVar12;
    puVar9 = puVar9 + 1;
    if (iVar5 <= (int)uVar12) break;
LAB_140377870:
    if (plVar11 == (longlong *)*puVar9) {
      if ((int)plVar16 != -1) goto LAB_140377954;
      break;
    }
  }
LAB_14037788b:
  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_14034f7d0();
  }
  FUN_140394870(&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_140377954:
  plVar18 = (longlong *)plVar18[2];
  goto LAB_140377770;
}



void FUN_1403779e0(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_140377300(param_1,*param_3,param_4);
      }
      param_3 = param_3 + 1;
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0);
  }
  FUN_140360310(param_4);
  return;
}



undefined4 FUN_140377a40(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_14034ed40(uVar5);
  if (DAT_1405f064f != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1,L"Proud::CNetServerImpl::GetMostSuitableSuperPeerInGroup");
  }
  plVar6 = (longlong *)FUN_140377130(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_140364170(lVar8);
      FUN_14034ff60(lVar8);
    }
    FUN_14034ff60(local_res8);
  }
  if (lVar12 != 0) {
    FUN_14036c910(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_14034f800();
        }
        iVar9 = 0;
        lVar7 = 0;
        iVar3 = *(int *)(param_4 + 0x18);
        if (iVar3 < 1) {
LAB_140377b9b:
          if ((-1 < iVar11) && (iVar11 < iVar2)) {
            uVar4 = *(undefined4 *)((longlong)iVar11 * 0x40 + *(longlong *)(lVar12 + 0x70));
            FUN_14034edd0(uVar5);
            return uVar4;
          }
                    // WARNING: Subroutine does not return
          FUN_14034f800();
        }
        while( true ) {
          if ((lVar7 < 0) || (iVar3 <= iVar9)) {
                    // WARNING: Subroutine does not return
            FUN_14034f800();
          }
          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_140377b9b;
        }
        iVar11 = iVar11 + 1;
        lVar8 = lVar8 + 1;
        lVar10 = lVar10 + 0x40;
      } while (iVar11 < iVar2);
    }
  }
  FUN_14034edd0(uVar5);
  return 0;
}



bool FUN_140377bf0(longlong param_1,uint param_2)

{
  uint *puVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong *plVar4;
  longlong lVar5;
  longlong *local_res8;
  
  if (DAT_1405f064f != '\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_140377c93;
      if (*puVar1 == param_2) break;
      puVar1 = *(uint **)(puVar1 + 4);
    }
    if (*(longlong *)(puVar1 + 2) != 0) {
      return true;
    }
  }
LAB_140377c93:
  plVar4 = (longlong *)FUN_140377130(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_140364170(lVar2);
      FUN_14034ff60(lVar2);
    }
    FUN_14034ff60(local_res8);
  }
  return lVar5 != 0;
}



int FUN_140377d10(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_14034ed40(uVar3);
  local_40 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(*plVar4 + 200))
              (plVar4,L"Proud::CNetServerImpl::GetSuitableSuperPeerRankListInGroup");
  }
  plVar4 = (longlong *)FUN_140377130(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_140364170(lVar7);
      FUN_14034ff60(lVar7);
    }
    FUN_14034ff60(local_58);
    uVar3 = local_48;
  }
  if (lVar11 == 0) {
    FUN_14034edd0(uVar3);
    local_res8 = 0;
  }
  else {
    FUN_14036c910();
    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_14034f800();
          }
          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_14034f800();
              }
              iVar5 = local_res8;
              if (*(int *)(*(longlong *)(param_6 + 0x10) + lVar6 * 4) == *(int *)(lVar2 + lVar9))
              goto LAB_140377f10;
              iVar8 = iVar8 + 1;
              lVar6 = lVar6 + 1;
            } while (iVar8 < iVar1);
          }
          if (*(int *)(lVar11 + 0x78) <= iVar10) {
                    // WARNING: Subroutine does not return
            FUN_14034f800();
          }
          *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_140377f10:
        iVar10 = iVar10 + 1;
        lVar7 = lVar7 + 1;
        lVar9 = lVar9 + 0x40;
      } while (iVar10 < *(int *)(lVar11 + 0x78));
    }
    FUN_14034edd0(uVar3);
  }
  return local_res8;
}



// WARNING: Removing unreachable block (ram,0x000140378343)
// WARNING: Removing unreachable block (ram,0x00014037835f)

void FUN_140377f70(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_14000d450(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_140378031:
      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_1403780ca;
          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_140372c70(lVar6 + 0x6a0,plVar2,0,lVar6,uVar9);
      }
LAB_1403780ca:
      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_14037815a;
          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_140372c70(lVar6 + 0x6a0,plVar2,0,lVar6,uVar9);
      }
LAB_14037815a:
      if (lVar8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar6 = *(longlong *)(lVar8 + 0x10);
      FUN_1403703a0(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_140378031;
      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_1403555d0((longlong)pvVar3 + 0x148);
          FUN_1403555d0((longlong)pvVar3 + 0x120);
          operator_delete(pvVar3);
        }
        FUN_14034ff60(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_14000d450(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_r0x0001403782a6:
      if (lVar8 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar6 = *(longlong *)(lVar8 + 0x10);
      FUN_1403703a0(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_r0x0001403782a6;
      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_1403555d0((longlong)pvVar3 + 0x148);
          FUN_1403555d0((longlong)pvVar3 + 0x120);
          operator_delete(pvVar3);
        }
        FUN_14034ff60(local_res18);
      }
    }
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x0001403786e0)
// WARNING: Removing unreachable block (ram,0x0001403786bf)
// WARNING: Removing unreachable block (ram,0x0001403786ce)
// WARNING: Removing unreachable block (ram,0x000140378438)

undefined8 * FUN_140378380(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_1403787e7;
      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_14037852c;
        puVar11 = *(undefined8 **)(*(longlong *)(lVar4 + 0x6a8) + uVar5 * 8);
        goto joined_r0x0001403784d3;
      }
    }
  }
  goto LAB_1403787e7;
joined_r0x0001403784d3:
  if ((puVar11 == (undefined8 *)0x0) ||
     ((uint)uVar5 != *(uint *)(puVar11 + 4) % *(uint *)(lVar4 + 0x6c8))) goto LAB_14037852c;
  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_r0x0001403784d3;
  }
  FUN_140372c70(lVar4 + 0x6a0,puVar11,0,lVar4,puVar12,0xfffffffffffffffe);
LAB_14037852c:
  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_1403785bd;
      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_140372c70(lVar4 + 0x6a0,puVar11,0,lVar4,puVar19,uVar20);
  }
LAB_1403785bd:
  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_1405d83d4;
    uVar6 = DAT_1405d83d0;
    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_1405d83d4;
      uVar6 = DAT_1405d83d0;
      *(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_140376970(param_1,puVar14[0x20],puVar14[0x21],&local_res8);
  }
  if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  puVar10 = (undefined8 *)FUN_1403703a0(param_1,puVar13,0);
  if (*(longlong *)(param_2 + 0x17f0) != 0) {
    FUN_14034fe70();
    local_res20 = PTR_DAT_1405d8010;
    FUN_140017720(&local_res20,&DAT_140454b40,*(undefined4 *)(param_3 + 0x6f8),
                  *(undefined4 *)(param_4 + 0x6f8));
    puVar8 = local_res20;
    puVar16 = local_res20;
    if (local_res20 == (undefined *)0x0) {
      puVar16 = PTR_DAT_1405d8010;
    }
    FUN_1403935f0(*(undefined8 *)(param_2 + 0x17f0),1,puVar16);
    if (((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1405d8010)) &&
       (puVar8 + -8 != (undefined *)0x0)) {
      uVar20 = FUN_14034fe70();
      FUN_14034ed40(uVar20);
      piVar1 = (int *)(puVar8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar8 + -8);
      }
      FUN_14034edd0(uVar20);
    }
    local_res20 = PTR_DAT_1405d8010;
    puVar10 = (undefined8 *)PTR_DAT_1405d8010;
  }
LAB_1403787e7:
  if (puVar12 != (undefined8 *)0x0) {
    plVar2 = puVar12 + 1;
    *plVar2 = *plVar2 + -1;
    puVar10 = (undefined8 *)puVar12[1];
    if (*plVar2 == 0) {
      puVar10 = (undefined8 *)FUN_140360e30(puVar19);
    }
  }
  return puVar10;
}



undefined4 *
FUN_140378820(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  longlong *plVar1;
  
  *param_1 = *param_2;
  *(undefined8 *)(param_1 + 2) = 0;
  FUN_14035bda0(param_1 + 2,param_2 + 2,param_3,param_4,0xfffffffffffffffe);
  param_1[4] = param_2[4];
  *(undefined8 *)(param_1 + 6) = 0;
  FUN_140376bb0(param_1 + 6,param_2 + 6);
  *(undefined8 *)(param_1 + 8) = 0;
  FUN_140376ce0(param_1 + 8,param_2 + 8);
  FUN_1401e6450(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_1401e6450(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_1401e6450(param_1 + 0x30,param_2 + 0x30);
  *(undefined ***)(param_1 + 0x30) = Proud::ByteArray::vftable;
  return param_1;
}



void FUN_140378970(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_14034fef0(0x60);
    puVar3 = puVar8;
    if (local_res8 != (undefined4 *)0x0) {
      puVar3 = (undefined4 *)FUN_14035bca0(local_res8);
    }
    if (puVar3 == (undefined4 *)0x0) {
      local_res8 = (undefined4 *)0x0;
      puVar4 = puVar8;
    }
    else {
      puVar4 = (undefined4 *)FUN_14034fef0(0x48);
      if (puVar4 != (undefined4 *)0x0) {
        local_res8 = puVar4;
        uVar2 = FUN_1403c0cc0();
        FUN_14034ec60(puVar4,uVar2,1);
      }
      local_res8 = puVar4;
      FUN_14034ed40(puVar4);
      *(undefined8 *)(puVar4 + 0x10) = 1;
      *(undefined4 **)(puVar4 + 0xe) = puVar3;
      FUN_14034edd0(puVar4);
    }
    FUN_14035bda0(local_120,&local_res8);
    if (puVar4 != (undefined4 *)0x0) {
      FUN_14034ed40(puVar4);
      plVar6 = (longlong *)(puVar4 + 0x10);
      *plVar6 = *plVar6 + -1;
      if (*plVar6 == 0) {
        FUN_14034edd0(puVar4);
        FUN_14012c7d0(puVar4);
      }
      else {
        FUN_14034edd0(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_14039a7f0(param_2,&local_res8);
    FUN_140376bb0(&local_110,uVar5);
    puVar3 = local_res8;
    if (local_res8 != (undefined4 *)0x0) {
      FUN_14034ed40(local_res8);
      *(longlong *)(local_res8 + 0x10) = *(longlong *)(local_res8 + 0x10) + -1;
      if (*(longlong *)(local_res8 + 0x10) == 0) {
        FUN_14034edd0(puVar3);
        FUN_140375240(local_res8);
      }
      else {
        FUN_14034edd0(puVar3);
      }
    }
    local_128[0] = 6;
    iVar1 = *(int *)(param_5 + 0x18);
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_1400179d0(&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_14000d3f0(puVar4,puVar3,(longlong)iVar1);
    local_b8 = *(undefined4 *)(param_2 + 0x6f8);
    FUN_14039b030(param_2,local_128);
    FUN_140376ec0(local_128);
  }
  if (*(longlong *)(param_1 + 0x58) != 0) {
    lVar7 = *(longlong *)(param_1 + 0x58) + 0x98;
    lVar9 = lVar7;
    FUN_14034ed40(lVar7);
    plVar6 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x68);
    (**(code **)(*plVar6 + 0xb0))(plVar6,1,&DAT_1405f2490,param_2 + 0x6f8,lVar9,1);
    FUN_14034edd0(lVar7);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140378c90(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_1405d84f0 ^ (ulonglong)auStack_ea8;
  if (param_2 == 0) {
    FUN_14034f420(local_e68,L"Unexpected at candidate remote client removal!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_e68,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_140363a40(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_140378dbe:
    cVar4 = FUN_14035f5e0(param_1 + 0xc78,(ulonglong)uVar1,CONCAT71((int7)((ulonglong)lVar9 >> 8),1)
                         );
    if (cVar4 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_140378e15;
    }
    if (lVar9 == 0) goto LAB_140378dbe;
    for (puVar6 = *(uint **)(lVar9 + uVar3 * 8);
        (puVar6 != (uint *)0x0 && ((uint)uVar3 == puVar6[8] % uVar1));
        puVar6 = *(uint **)(puVar6 + 4)) {
      if (*puVar6 == uVar5) goto LAB_140378e11;
    }
    if (lVar9 == 0) goto LAB_140378dbe;
  }
  FUN_14035d100(param_1 + 0xc78);
  puVar6 = (uint *)FUN_1403acb30(param_1 + 0xc78,&local_e88,uVar3,uVar5);
  FUN_14035d100(param_1 + 0xc78);
LAB_140378e11:
  *(longlong *)(puVar6 + 2) = param_2;
LAB_140378e15:
  FUN_1403841b0(local_e68);
  FUN_140383c40(local_e68);
  FUN_140384310(local_e68,0x800);
  FUN_140384310(local_e68,0);
  FUN_140058870(local_e68,10);
  FUN_140058470(local_e68,(ulonglong)uVar5);
  local_e78 = *(longlong **)(param_1 + 0x26c);
  uStack_e70 = *(undefined4 *)(param_1 + 0x274);
  uStack_e6c = *(undefined4 *)(param_1 + 0x278);
  FUN_140090370(local_e68,&local_e78);
  iVar2 = *(int *)(param_3 + 0x18);
  FUN_140385580(local_e68,(longlong)iVar2);
  lVar9 = 0;
  if (*(int *)(param_3 + 0x18) != 0) {
    lVar9 = *(longlong *)(param_3 + 0x10);
  }
  if (iVar2 == 0) goto LAB_140378eed;
  local_e64 = 0;
  if (local_e60 == 0) {
    if (local_e58 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,lVar9);
    }
LAB_140378ebf:
    FUN_1400178c0(&local_e58,lVar9,iVar2);
  }
  else {
    if (local_e58 != 0) goto LAB_140378ebf;
    if (local_e60 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,lVar9);
    }
    FUN_140017a90(local_e60,lVar9,iVar2);
  }
  FUN_140017b00(local_e68);
LAB_140378eed:
  FUN_140384db0(local_e68,*(longlong *)(param_2 + 0x748) + 0x128);
  plVar7 = (longlong *)(**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
  local_e78 = plVar7;
  FUN_14034ed40(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_140399790();
    }
  }
  else {
    local_e50 = *(undefined4 *)(local_e60 + 0x18);
  }
  lVar9 = local_e58;
  if (local_e58 == 0) {
    if (local_e60 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_1403a03a0(*(undefined8 *)(param_2 + 0x748),&local_cd8,&local_e88);
  if (local_58 == (undefined4 *)0x0) {
    FUN_14034f420(local_d20,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d20,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_4c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_14034edd0(plVar7);
  local_e88 = &local_e60;
  FUN_140399690(&local_e60);
  if ((local_e58 != 0) && (local_e4c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  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_14039a7f0(param_2,&local_e88);
  FUN_140376bb0(&local_e00,uVar8);
  plVar7 = local_e88;
  if (local_e88 != (longlong *)0x0) {
    local_e78 = local_e88;
    FUN_14034ed40(local_e88);
    uStack_e70._0_1_ = 1;
    local_e88[8] = local_e88[8] + -1;
    if (local_e88[8] == 0) {
      FUN_14034edd0(plVar7);
      uStack_e70._0_1_ = 0;
      FUN_140375240(local_e88);
    }
    else {
      FUN_14034edd0(plVar7);
    }
  }
  local_da8 = *(undefined4 *)(param_2 + 0x6f8);
  FUN_14039b030(param_2,local_e18);
  FUN_1403555d0(&local_d58);
  FUN_1403555d0(&local_da0);
  local_e88 = &local_dc8;
  FUN_140399690(&local_dc8);
  if (local_dc0 != 0) {
    if ((longlong)local_db8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_db8 = local_db8 & 0xffffffff00000000;
  }
  FUN_1403555d0(&local_df0);
  FUN_140376ab0(&local_df8);
  FUN_140376a30(&local_e00);
  FUN_14012c7f0(local_e10);
  if (*(longlong *)(param_1 + 0x58) != 0) {
    plVar10 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x98);
    local_e78 = plVar10;
    FUN_14034ed40(plVar10);
    uStack_e70 = CONCAT31(uStack_e70._1_3_,1);
    plVar7 = (longlong *)(*(longlong *)(param_1 + 0x58) + 0x68);
    (**(code **)(*plVar7 + 0xa0))(plVar7,1,&DAT_1405f2490,param_2 + 0x6f8);
    FUN_14034edd0(plVar10);
  }
  return;
}



void FUN_140379230(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_14034ed40(uVar7);
      local_70 = 1;
      if (DAT_1405f064f != '\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_14035fcf0(param_1,&local_188);
      if (lVar8 != 0) {
        if (cVar5 == '\0') {
          FUN_14036ef70(param_1,lVar8,&local_128);
        }
        else {
          FUN_140378c90();
        }
      }
      FUN_14034edd0(uVar7);
      FUN_1403555d0(&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_14034fe70();
      local_res18 = PTR_DAT_1405d8010;
      uVar7 = FUN_14035bed0(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_1405d8010)) &&
         (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
        ppuVar6 = (undefined **)FUN_14034fe70();
        local_180 = local_180 & 0xffffff00;
        local_188 = ppuVar6;
        FUN_14034ed40(ppuVar6);
        local_180 = CONCAT31(local_180._1_3_,1);
        piVar2 = (int *)(puVar4 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(ppuVar6);
      }
      local_res18 = PTR_DAT_1405d8010;
      FUN_1403555d0(&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_14035bed0(local_60,0x19,1,lVar8 + 0x10,&local_a0);
      (**(code **)(*param_1 + 0x38))(param_1,uVar7);
      FUN_1403555d0(&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_14035bed0(local_50,*puVar9,param_2[0x1c],puVar3 + 4,&local_c8);
      (**(code **)(*param_1 + 0x38))(param_1,uVar7);
      FUN_1403555d0(&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_14035bed0(local_38,*puVar9,param_2[0x1c],puVar3 + 4,&local_178);
      FUN_140372030(param_1,uVar7);
      FUN_1403555d0(&local_178);
    }
  }
  return;
}



void FUN_140379750(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_14035d100();
  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_140364170(lVar2);
        FUN_14034ff60(lVar2);
      }
      FUN_14034ff60(plVar1);
    }
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60(lVar5);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar5);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar5 = lVar6;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar3 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_1403798e0(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_140373680(param_2);
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar2);
  }
  return;
}



void FUN_140379970(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_14000d450(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_1403798e0(param_1,param_2,param_3);
  FUN_14035d100(param_1);
  return;
}



void FUN_140379a70(void)

{
  FUN_140379750();
  return;
}



void FUN_140379a90(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_140376ec0(param_2 + 0x40);
  FUN_140399690(param_2 + 0x20);
  if (*(longlong *)(param_2 + 0x28) != 0) {
    if (*(int *)(param_2 + 0x34) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_2 + 0x30) = 0;
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
  }
  param_1[3] = param_1[3] + -1;
  return;
}



undefined4 * FUN_140379b00(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_14034fef0(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_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar3);
  }
  FUN_14035d100(param_1);
  return puVar4;
}



undefined4 *
FUN_140379c50(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_14000d450(0x80004005);
  }
  *param_2 = (int)plVar1[2];
  FUN_1403841e0(param_2 + 2,plVar1 + 3,param_3,param_4,0xfffffffffffffffe);
  FUN_140378820(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_140379a90(param_1,plVar1);
  return param_2;
}



void FUN_140379d00(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_14035d100(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_14034ed40(lVar3);
      bVar6 = true;
      plVar1 = (longlong *)(*(longlong *)(lVar9 + 8) + 0x40);
      *plVar1 = *plVar1 + -1;
      if (*(longlong *)(*(longlong *)(lVar9 + 8) + 0x40) == 0) {
        FUN_14034edd0(lVar3);
        bVar6 = false;
        lVar4 = *(longlong *)(lVar9 + 8);
        lVar5 = *(longlong *)(lVar4 + 0x38);
        if (lVar5 != 0) {
          FUN_1403638e0(lVar5 + 8);
          FUN_14034ff60(lVar5);
        }
        FUN_14034edf0(lVar4);
        FUN_14034ff60(lVar4);
      }
      if (bVar6) {
        FUN_14034edd0(lVar3);
      }
    }
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60(lVar9);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar9);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar9 = lVar2;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar7 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_140379ee0(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_140376ec0(plVar2 + 8);
    FUN_140399690(plVar2 + 4);
    if (plVar2[5] != 0) {
      if (*(int *)((longlong)plVar2 + 0x34) < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(undefined4 *)(plVar2 + 6) = 0;
    }
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_14034ff60(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



undefined8 *
FUN_140379f90(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_14034fef0(0x128);
  }
  else {
    puVar2 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x128,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar2 != (undefined8 *)0x0) {
    *(undefined4 *)(puVar2 + 2) = *param_2;
    FUN_1403841e0(puVar2 + 3,param_2 + 2);
    FUN_140378820(puVar2 + 8,param_2 + 0xc);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



undefined8 FUN_14037a040(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035d100(param_1);
  uVar2 = FUN_140379b00(param_1,param_2,param_3,param_4);
  FUN_14035d100(param_1);
  return uVar2;
}



void FUN_14037a0c0(undefined8 *param_1)

{
  *param_1 = Proud::CP2PGroupMemberBase_S::vftable;
  FUN_140379a70();
  return;
}



undefined8 * FUN_14037a0e0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CP2PGroupMemberBase_S::vftable;
  FUN_140379a70();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014037a186)
// WARNING: Removing unreachable block (ram,0x00014037a18f)
// WARNING: Removing unreachable block (ram,0x00014037a1ad)
// WARNING: Removing unreachable block (ram,0x00014037a1b6)

undefined8 * FUN_14037a120(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_14037a1e0(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_140379c50(param_1 + 0x3e0,local_120,param_3,param_4,0xfffffffffffffffe);
    FUN_1403a61c0(param_2,uVar1,1);
    FUN_140376ec0(local_f0);
    FUN_140399690(local_110);
    if ((local_108 != 0) && (local_fc < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    uVar1 = 1;
  }
  return uVar1;
}



void FUN_14037a270(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_140379ee0();
  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_14037a2a0(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 = 0x14037a2b7;
  puVar21 = auStack_2aa8;
  local_29d8 = 0xfffffffffffffffe;
  local_68 = DAT_1405d84f0 ^ (ulonglong)local_2a88;
  local_2a50 = param_2;
  local_2a48 = param_3;
  local_2a08 = (**(code **)(*param_1 + 0x58))();
  FUN_14034ed40(local_2a08);
  local_2a00 = 1;
  if (DAT_1405f064f != '\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_140362bf0(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_14037a428:
      local_2a80 = local_2a80 + 2;
    }
  }
  else {
    local_2a80 = malloc(uVar2);
    if (local_2a80 != (undefined8 *)0x0) {
      *(undefined4 *)local_2a80 = 0xdddd;
      puVar21 = auStack_2aa8;
      goto LAB_14037a428;
    }
  }
  lVar13 = (longlong)iVar25 * 8;
  uVar2 = lVar13 + 0x10;
  if (uVar2 < 0x401) {
    uVar10 = lVar13 + 0x1f;
    if (uVar10 <= uVar2) {
      uVar10 = 0xffffffffffffff0;
    }
    *(undefined8 *)(puVar21 + -8) = 0x14037a456;
    lVar13 = -(uVar10 & 0xfffffffffffffff0);
    puVar20 = puVar21 + lVar13;
    plVar11 = (longlong *)(puVar21 + lVar13 + 0x20);
    puVar21 = puVar21 + lVar13;
    local_2a38 = plVar11;
    if (plVar11 == (longlong *)0x0) goto LAB_14037a48f;
    *(undefined4 *)plVar11 = 0xcccc;
    puVar21 = puVar20;
  }
  else {
    *(undefined8 *)(puVar21 + -8) = 0x14037a475;
    plVar11 = malloc(uVar2);
    local_2a38 = plVar11;
    if (plVar11 == (longlong *)0x0) goto LAB_14037a48f;
    *(undefined4 *)plVar11 = 0xdddd;
  }
  local_2a38 = plVar11 + 2;
LAB_14037a48f:
  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_14037a639;
          FUN_14034f7d0();
        }
        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) = 0x14037a50e;
          FUN_1403841b0(local_2a78);
          uVar12 = local_2a50;
          *(undefined8 *)(puVar21 + -8) = 0x14037a51c;
          FUN_1403a65d0(uVar12,local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14037a525;
          uVar8 = FUN_1403a5d90(local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14037a53b;
          uVar12 = FUN_140376f50(&local_2988,local_2a78,uVar8,1);
          lVar13 = param_1[0x8d];
          *(undefined8 *)(puVar21 + -8) = 0x14037a557;
          lVar13 = FUN_140379f90(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) = 0x14037a585;
          FUN_140376ec0(local_2958);
          local_2a48 = &local_2978;
          *(undefined8 *)(puVar21 + -8) = 0x14037a59d;
          FUN_140399690(&local_2978);
          if ((local_2970 != 0) && (local_2968[1] < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x14037a625;
            FUN_14034f7d0();
          }
          lVar13 = param_1[0x7c];
          *(undefined8 *)(puVar21 + -8) = 0x14037a5ca;
          FUN_1403a6a50(lVar13 + 0x160,param_1 + 0xf);
          local_2a48 = &local_2a70;
          *(undefined8 *)(puVar21 + -8) = 0x14037a5dc;
          FUN_140399690(&local_2a70);
          if (((ulonglong *)local_2a68 != (ulonglong *)0x0) && (local_2a5c < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar21 + -8) = &UNK_14037a62b;
            FUN_14034f7d0();
          }
        }
        else if (plVar11 != (longlong *)0x0) {
          *(undefined8 *)(puVar21 + -8) = 0x14037a5f9;
          lVar13 = FUN_1403a69e0(plVar11);
          if (lVar13 != 0) {
            *(undefined8 *)(puVar21 + -8) = 0x14037a60a;
            FUN_1403a0550(plVar11 + 0x18);
            *puVar22 = plVar11;
            iVar9 = iVar9 + 1;
            puVar22 = puVar22 + 1;
          }
        }
        iVar23 = iVar23 + 1;
        iVar24 = local_2a88[0];
      } while (iVar23 < iVar25);
    }
  }
  else {
    *(undefined8 *)(puVar21 + -8) = 0x14037a650;
    FUN_1403718a0(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_14037a84c;
          FUN_14034f7d0();
        }
        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) = 0x14037a6d8;
          FUN_1403841b0(local_2a78);
          uVar12 = local_2a50;
          *(undefined8 *)(puVar21 + -8) = 0x14037a6e6;
          FUN_1403a65d0(uVar12,local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14037a6ef;
          uVar8 = FUN_1403a5d90(local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14037a705;
          uVar12 = FUN_140376f50(&local_2988,local_2a78,uVar8,1);
          lVar13 = param_1[0x8d];
          *(undefined8 *)(puVar21 + -8) = 0x14037a721;
          lVar13 = FUN_140379f90(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) = 0x14037a74f;
          FUN_140376ec0(local_2958);
          local_2a30 = &local_2978;
          *(undefined8 *)(puVar21 + -8) = 0x14037a767;
          FUN_140399690(&local_2978);
          if ((local_2970 != 0) && (local_2968[1] < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x14037a834;
            FUN_14034f7d0();
          }
          lVar13 = param_1[0x7c];
          *(undefined8 *)(puVar21 + -8) = 0x14037a798;
          FUN_1403a6a50(lVar13 + 0x160,param_1 + 0xf);
          local_2a30 = &local_2a70;
          *(undefined8 *)(puVar21 + -8) = 0x14037a7aa;
          FUN_140399690(&local_2a70);
          if (((ulonglong *)local_2a68 != (ulonglong *)0x0) && (local_2a5c < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar21 + -8) = &UNK_14037a83a;
            FUN_14034f7d0();
          }
        }
        else if (plVar4 != (longlong *)0x0) {
          *(undefined8 *)(puVar21 + -8) = 0x14037a7cb;
          lVar18 = FUN_1403a69e0(plVar4);
          if (lVar18 != 0) {
            *(undefined8 *)(puVar21 + -8) = 0x14037a7db;
            FUN_140374cb0(param_1,plVar4);
            *(undefined8 *)(puVar21 + -8) = 0x14037a7e7;
            FUN_1403a0550(plVar4 + 0x18);
            if (local_2620 <= lVar13) {
                    // WARNING: Subroutine does not return
              *(undefined **)(puVar21 + -8) = &UNK_14037a840;
              FUN_14034f7d0();
            }
            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) = 0x14037a863;
  FUN_14034edd0(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) = 0x14037a895;
        puVar14 = (ulonglong *)(*pcVar5)();
        local_2a48 = puVar14;
        *(undefined8 *)(puVar21 + -8) = 0x14037a8a4;
        FUN_14034ed40(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) = 0x14037a8c8;
        FUN_1403a03a0(uVar12,uVar17,&local_2a30);
        *(undefined8 *)(puVar21 + -8) = 0x14037a8d0;
        FUN_14034edd0(puVar14);
        iStack_2a40 = (uint)iStack_2a40._1_3_ << 8;
        *(undefined8 *)(puVar21 + -8) = 0x14037a8e0;
        FUN_1403a0560(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) = 0x14037ac21;
          uVar17 = (*pcVar5)();
          local_29f8 = uVar17;
          *(undefined8 *)(puVar21 + -8) = 0x14037ac33;
          FUN_14034ed40(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) = 0x14037ac72;
          uVar8 = (*pcVar5)(plVar11);
          uVar12 = local_2a50;
          *(undefined8 *)(puVar21 + -8) = 0x14037ac88;
          FUN_1403a1dc0(plVar11 + 0xe0,uVar8,uVar12,&local_2a30);
          *(undefined8 *)(puVar21 + -8) = 0x14037ac90;
          FUN_14034edd0(uVar17);
          local_29f0 = 0;
        }
        else {
          *(undefined8 *)(puVar21 + -8) = 0x14037a92b;
          FUN_1403841b0(local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14037a935;
          FUN_140383c40(local_2a78);
          *(undefined8 *)(puVar21 + -8) = 0x14037a940;
          FUN_140058870(local_2a78,0x22);
          uVar2 = param_3[4];
          *(undefined8 *)(puVar21 + -8) = 0x14037a94e;
          FUN_140058870(local_2a78,(char)uVar2);
          uVar2 = param_3[3];
          *(undefined8 *)(puVar21 + -8) = 0x14037a95b;
          FUN_140385580(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) = 0x14037ad31;
              FUN_14034f7d0();
            }
            lVar1 = local_2980 + 1;
            *(undefined8 *)(puVar21 + -8) = 0x14037a99f;
            FUN_14035eed0(&local_2988,lVar1,0xffffffffffffffff);
            if (local_2980 <= lVar18) {
                    // WARNING: Subroutine does not return
              *(undefined **)(puVar21 + -8) = &UNK_14037ad2b;
              FUN_14034f7d0();
            }
            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) = 0x14037a9ef;
          FUN_140385580(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) = 0x14037acb9;
                FUN_14034f7d0();
              }
              if (local_2978 < 0x65) {
                piVar16 = local_2968 + lVar18;
              }
              else {
                piVar16 = (int *)((longlong)local_2988 + lVar18 * 4);
              }
              iVar9 = *piVar16;
              *(undefined8 *)(puVar21 + -8) = 0x14037aa3d;
              FUN_140058470(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) = 0x14037aa5a;
          iVar9 = FUN_1403a62c0(uVar12);
          *(undefined8 *)(puVar21 + -8) = 0x14037aa66;
          FUN_140385580(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) = 0x14037ad25;
              FUN_140399790();
            }
          }
          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_14037ad1f;
              FUN_140399790();
            }
            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) = 0x14037ab09;
          iStack_cf0 = iVar9;
          FUN_1403607b0(local_1988,&local_cf8);
          if (local_78 == (undefined4 *)0x0) {
            *(undefined8 *)(puVar21 + -8) = 0x14037ad06;
            FUN_14034f420(local_29d0,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x14037ad19;
            _CxxThrowException(local_29d0,(ThrowInfo *)&DAT_1405d36c0);
          }
          if (local_6c < 0) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar21 + -8) = &UNK_14037acf2;
            FUN_14034f7d0();
          }
          *(undefined8 *)(puVar21 + -8) = 0x14037ab34;
          FUN_1403607b0(local_1988,uVar12);
          pcVar5 = *(code **)(plVar11[0x21] + 0x10);
          *(undefined8 *)(puVar21 + -8) = 0x14037ab41;
          uVar12 = (*pcVar5)();
          local_29e8 = uVar12;
          *(undefined8 *)(puVar21 + -8) = 0x14037ab53;
          FUN_14034ed40(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) = 0x14037aba1;
          FUN_1403a1dc0(plVar11 + 0xe0,0,local_1988,&local_2a30);
          *(undefined8 *)(puVar21 + -8) = 0x14037aba9;
          FUN_14034edd0(uVar12);
          pvVar7 = local_2988;
          local_29e0 = 0;
          if (local_d08 == (undefined1 *)0x0) {
            *(undefined8 *)(puVar21 + -8) = 0x14037acd9;
            FUN_14034f420(local_29d0,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x14037acec;
            _CxxThrowException(local_29d0,(ThrowInfo *)&DAT_1405d36c0);
          }
          if (local_cfc < 0) {
                    // WARNING: Subroutine does not return
            *(undefined **)(puVar21 + -8) = &UNK_14037acc5;
            FUN_14034f7d0();
          }
          local_d00 = 0;
          if (100 < local_2978) {
            *(undefined8 *)(puVar21 + -8) = 0x14037abe7;
            operator_delete__(pvVar7);
          }
          local_2a30 = &local_2a70;
          *(undefined8 *)(puVar21 + -8) = 0x14037abf9;
          FUN_140399690(&local_2a70);
          if (((ulonglong *)local_2a68 != (ulonglong *)0x0) && (local_2a5c < 0)) {
                    // WARNING: Subroutine does not return
            *(undefined8 *)(puVar21 + -8) = 0x14037acbf;
            FUN_14034f7d0();
          }
        }
      }
      *(undefined8 *)(puVar21 + -8) = 0x14037aca3;
      FUN_1403a0560(plVar11 + 0x18);
      lVar13 = lVar13 + 1;
    } while (lVar13 < iVar24);
  }
  if ((local_2a80 != (undefined8 *)0x0) && (piVar16 = (int *)(local_2a80 + -2), *piVar16 == 0xdddd))
  {
    *(undefined8 *)(puVar21 + -8) = 0x14037ad4d;
    free(piVar16);
  }
  if ((local_2a38 != (longlong *)0x0) && (plVar11 = local_2a38 + -2, (int)*plVar11 == 0xdddd)) {
    *(undefined8 *)(puVar21 + -8) = 0x14037ad68;
    free(plVar11);
  }
  puVar6 = local_2628;
  if (100 < local_2618) {
    *(undefined8 *)(puVar21 + -8) = 0x14037ad7f;
    operator_delete__(puVar6);
  }
  pvVar7 = local_27d8;
  if (100 < local_27c8) {
    *(undefined8 *)(puVar21 + -8) = 0x14037ad96;
    operator_delete__(pvVar7);
  }
  *(undefined8 *)(puVar21 + -8) = 0x14037ada8;
  return 1;
}



// WARNING: Removing unreachable block (ram,0x00014037afe2)
// WARNING: Removing unreachable block (ram,0x00014037afeb)
// WARNING: Removing unreachable block (ram,0x00014037b00c)
// WARNING: Removing unreachable block (ram,0x00014037b015)

undefined8 *
FUN_14037add0(undefined8 *param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined8 *local_res10;
  
  FUN_140386400(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_1403a6cf0(param_1 + 0xf);
  param_1[0x15] = Proud::CNetServer::vftable;
  param_1[0x16] = Proud::ICompletionContext::vftable;
  FUN_14037a120(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_1403c0cc0();
  FUN_14034ec60(param_1 + 0x25,uVar3,1);
  uVar3 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x2c,uVar3,1);
  param_1[0x41] = 0;
  FUN_14034fe70();
  param_1[0x42] = PTR_DAT_1405d8008;
  FUN_14034fe70();
  param_1[0x43] = PTR_DAT_1405d8008;
  FUN_1403a6d70(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_140374080(param_1 + 0x5b);
  FUN_14036d530(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_140388e70(param_1 + 0x90);
  param_1[0x90] = Proud::CNetServerImpl::C2SStub::vftable;
  puVar1 = param_1 + 0x95;
  local_res10 = puVar1;
  FUN_140385af0(puVar1);
  *puVar1 = ProudS2C::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x4bc) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *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_14035a1b0(param_1 + 0xec);
  param_1[0xf1] = 0;
  param_1[0xf2] = 0;
  uVar3 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0xf3,uVar3,1);
  uVar3 = FUN_1403c0cc0();
  FUN_14034ec60(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_1403a4f50();
  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_140359a20(puVar2);
  FUN_140359b40(puVar2);
  FUN_14036d530(param_1 + 0x2dd);
  FUN_14036d530(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_14034fe70();
  param_1[0x301] = PTR_DAT_1405d8010;
  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_14036f200(&local_res10);
  FUN_140363b70(param_1 + 0xea,uVar4);
  puVar2 = local_res10;
  if (local_res10 != (undefined8 *)0x0) {
    FUN_14034ed40(local_res10);
    local_res10[8] = local_res10[8] + -1;
    if (local_res10[8] == 0) {
      FUN_14034edd0(puVar2);
      FUN_140360e90(local_res10);
    }
    else {
      FUN_14034edd0(puVar2);
    }
  }
  *(undefined4 *)(param_1 + 0x44) = DAT_1405d8110;
  FUN_14034fa80();
  param_1[0xeb] = 0;
  FUN_14035a200(param_1 + 0xec);
  FUN_140386850(param_1,puVar1);
  FUN_140386a50(param_1,param_1 + 0x90);
  param_1[0x94] = param_1;
  *(undefined1 *)(param_1 + 0x7f) = 0;
  param_1[0x2ff] = 0x3ff0000000000000;
  FUN_1403eb740(param_1 + 0x8b);
  *(undefined1 *)(param_1 + 0x300) = 1;
  *(undefined1 *)(param_1 + 0x97) = 1;
  *(undefined1 *)(param_1 + 0x93) = 1;
  FUN_14035df60(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_14037b5f0(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(double *)(param_1 + 0xe8) != 0.0) {
    return *(undefined8 *)(param_1 + 0xe8);
  }
  uVar1 = FUN_14035a290(param_1 + 0x648);
  *(undefined8 *)(param_1 + 0xe8) = uVar1;
  return *(undefined8 *)(param_1 + 0xe8);
}



void thunk_FUN_140386660(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_14034f800();
      }
      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_14034f7d0();
    }
    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_1403a2c90(lVar1);
        lVar4 = FUN_1403a2c90(lVar1);
        *(undefined8 *)(lVar4 + lVar6) = *(undefined8 *)((longlong)iVar8 * 8 + lVar3 + lVar6);
        lVar6 = lVar6 + 8;
        lVar7 = lVar7 + -1;
      } while (lVar7 != 0);
    }
    FUN_140394870(lVar1,*(int *)(param_1 + 0x48) - iVar8);
    *(undefined8 *)(param_2 + 0x10) = 0;
  }
  return;
}



void FUN_14037b650(longlong param_1)

{
  FUN_140386c10(param_1 + -0xa8);
  return;
}



longlong FUN_14037b680(longlong param_1)

{
  return param_1 + -0x118;
}



void FUN_14037b690(longlong param_1)

{
  thunk_FUN_140386660(param_1 + -0xa8);
  return;
}



void FUN_14037b6a0(longlong param_1)

{
  FUN_140383b90(param_1 + -0x120);
  return;
}



void FUN_14037b6b0(longlong param_1)

{
  thunk_FUN_140385b50(param_1 + -0xa8);
  return;
}



void FUN_14037b6c0(longlong param_1)

{
  FUN_140383b90(param_1 + -0x68);
  return;
}



void FUN_14037b6d0(longlong param_1)

{
  FUN_1403aae10(param_1 + -0xa8);
  return;
}



void FUN_14037b6e0(longlong param_1)

{
  FUN_140383b90(param_1 + -0xa8);
  return;
}



void FUN_14037b6f0(longlong param_1)

{
  thunk_FUN_140386a50(param_1 + -0xa8);
  return;
}



void FUN_14037b700(longlong param_1)

{
  FUN_1403aae10(param_1 + -8);
  return;
}



void FUN_14037b710(longlong param_1)

{
  FUN_140383b90(param_1 + -0x70);
  return;
}



void FUN_14037b720(longlong param_1)

{
  FUN_1403aae10(param_1 + -0x48);
  return;
}



void FUN_14037b730(longlong param_1)

{
  FUN_140383b90(param_1 + -0xb0);
  return;
}



void FUN_14037b740(longlong param_1)

{
  FUN_14035c5d0(param_1 + -0x120);
  return;
}



void FUN_14037b750(longlong param_1)

{
  FUN_14035c5d0(param_1 + -0xa8);
  return;
}



void FUN_14037b760(longlong param_1)

{
  thunk_FUN_140386500(param_1 + -0xa8);
  return;
}



void FUN_14037b770(longlong param_1)

{
  FUN_140383b90(param_1 + -0x78);
  return;
}



void FUN_14037b780(longlong param_1)

{
  FUN_140383b90(param_1 + -0xb8);
  return;
}



void FUN_14037b790(longlong param_1)

{
  thunk_FUN_1403862c0(param_1 + -0xa8);
  return;
}



void FUN_14037b7a0(longlong param_1)

{
  thunk_FUN_140386850(param_1 + -0xa8);
  return;
}



void FUN_14037b7b0(longlong param_1)

{
  FUN_140383b90(param_1 + -0x118);
  return;
}



void FUN_14037b7c0(longlong param_1)

{
  FUN_140383b90(param_1 + -0x60);
  return;
}



void FUN_14037b7d0(longlong param_1)

{
  FUN_14035d590(param_1 + -0xa8);
  return;
}



void FUN_14037b7e0(longlong param_1)

{
  FUN_14035da50(param_1 + -0xa8);
  return;
}



void FUN_14037b7f0(longlong param_1)

{
  FUN_14036ccc0(param_1 + -0xa8);
  return;
}



void FUN_14037b800(longlong param_1)

{
  FUN_14036cb40(param_1 + -0xa8);
  return;
}



void FUN_14037b810(longlong param_1)

{
  FUN_1403731c0(param_1 + -0xa8);
  return;
}



void FUN_14037b820(longlong param_1)

{
  FUN_1403779e0(param_1 + -0xa8);
  return;
}



void FUN_14037b830(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_1403841b0(local_128);
    FUN_140378820(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_14034fef0(0x128);
    }
    else {
      puVar2 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x128);
    }
    if (puVar2 != (undefined8 *)0x0) {
      *(undefined4 *)(puVar2 + 2) = 0;
      FUN_1403841e0(puVar2 + 3,local_128);
      FUN_140378820(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_140376ec0(local_100);
    FUN_140399690(local_120);
    if ((local_118 != 0) && (local_10c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_1403a6a50(*(longlong *)(param_1 + 0x3e0) + 0x160,param_1 + 0x78);
  }
  return;
}



void FUN_14037b990(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_14034fe70();
  local_150 = (undefined8 *)PTR_DAT_1405d8010;
  uVar4 = FUN_14035bed0(&local_158,param_4,0,&local_150,&local_138);
  FUN_14035bda0(local_100,uVar4);
  lVar5 = local_158;
  if (local_158 != 0) {
    local_148 = local_158;
    FUN_14034ed40(local_158);
    local_140 = 1;
    *(longlong *)(local_158 + 0x40) = *(longlong *)(local_158 + 0x40) + -1;
    if (*(longlong *)(local_158 + 0x40) == 0) {
      FUN_14034edd0(lVar5);
      local_140 = 0;
      FUN_14012c7d0(local_158);
    }
    else {
      FUN_14034edd0(lVar5);
    }
  }
  puVar3 = local_150;
  if (((local_150 != (undefined8 *)0x0) && (local_150 != (undefined8 *)PTR_DAT_1405d8010)) &&
     (puVar1 = local_150 + -1, puVar1 != (undefined8 *)0x0)) {
    lVar5 = FUN_14034fe70();
    local_148 = lVar5;
    FUN_14034ed40(lVar5);
    local_140 = 1;
    piVar2 = (int *)((longlong)puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(lVar5);
  }
  local_150 = (undefined8 *)PTR_DAT_1405d8010;
  FUN_1403555d0(&local_138);
  FUN_14037b830(param_1,local_108);
  FUN_1403555d0(&local_48);
  FUN_1403555d0(&local_90);
  local_150 = &local_b8;
  FUN_140399690(&local_b8);
  if (local_b0 != 0) {
    if ((longlong)local_a8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_a8 = local_a8 & 0xffffffff00000000;
  }
  FUN_1403555d0(&local_e0);
  FUN_140376ab0(&local_e8);
  FUN_140376a30(&local_f0);
  FUN_14012c7f0(local_100);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014037bca8)
// WARNING: Removing unreachable block (ram,0x00014037bcb1)
// WARNING: Removing unreachable block (ram,0x00014037bccf)
// WARNING: Removing unreachable block (ram,0x00014037bcd8)
// WARNING: Removing unreachable block (ram,0x00014037bd65)
// WARNING: Removing unreachable block (ram,0x00014037bd6c)
// WARNING: Removing unreachable block (ram,0x00014037bd74)
// WARNING: Removing unreachable block (ram,0x00014037bd81)
// WARNING: Removing unreachable block (ram,0x00014037bd79)
// WARNING: Removing unreachable block (ram,0x00014037bd87)
// WARNING: Removing unreachable block (ram,0x00014037bd98)
// WARNING: Removing unreachable block (ram,0x00014037bf9a)

void FUN_14037bbe0(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_14034f800();
          }
          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_14034f7d0();
          }
          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_14035e7a0(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_1403a5930(param_2 + 0x32,uVar4);
        if (cVar7 == '\0') {
          FUN_14037b990(param_1,*param_2,uVar4,param_4);
        }
      }
      FUN_1403638e0(local_b8);
      if (uVar18 != 0) {
        if (plVar6 == (longlong *)0x0) {
          FUN_14034ff60(uVar18);
        }
        else {
          (**(code **)(*plVar6 + 0x18))(plVar6,uVar18);
        }
      }
      return;
    }
    if ((iVar2 < 0) || ((int)param_2[0x38] <= iVar2)) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    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_14034f7d0();
      }
      FUN_14012c550(&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_14037be66;
        }
      }
      uVar5 = (ulonglong)uVar15 % uVar16;
      if (local_b0 == 0) {
        cVar7 = FUN_14035f5e0(local_b8,uVar16,CONCAT71((int7)(uVar13 >> 8),1));
        if (cVar7 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(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_14037be58;
        }
      }
      FUN_14035eb50(local_b8);
      puVar8 = (uint *)FUN_140360ee0(local_b8,puVar1,uVar5,uVar15);
      FUN_14035eb50(local_b8);
LAB_14037be58:
      *(undefined1 *)(puVar8 + 1) = 0;
    }
LAB_14037be66:
    iVar11 = (int)uVar12;
    plVar6 = local_e0;
  } while( true );
}



longlong FUN_14037bff0(void)

{
  void *pvVar1;
  longlong lVar2;
  
  pvVar1 = operator_new(0x1880);
  lVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    lVar2 = FUN_14037add0(pvVar1);
  }
  if (lVar2 != 0) {
    lVar2 = lVar2 + 0xa8;
  }
  return lVar2;
}



undefined8
FUN_14037c030(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_14034ed40(local_158);
  local_150 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x20) + 200))
              (*(longlong **)(param_1 + 0x20),
               L"Proud::CNetServerImpl::C2SStub::P2PGroup_MemberJoin_Ack");
  }
  FUN_140377130(*(undefined8 *)(param_1 + 0x20),&local_178,*param_4);
  uVar18 = 0;
  if (((local_178 != (ulonglong *)0x0) && (*local_178 != 0)) &&
     (cVar4 = FUN_1403a59a0(*local_178 + 200,local_res10[0],*param_5,*param_6), cVar4 == '\x01')) {
    uVar12 = uVar18;
    if (local_178 != (ulonglong *)0x0) {
      uVar12 = *local_178;
    }
    cVar4 = FUN_1403a58b0(uVar12 + 200,*param_5,*param_6);
    if (cVar4 == '\0') {
      FUN_14037b990(*(undefined8 *)(param_1 + 0x20),*param_4,*param_5,0);
    }
  }
  FUN_14036ff50(*(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_140360e30(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_140364170(uVar18);
        FUN_14034ff60(uVar18);
      }
      FUN_14034ff60(local_178);
    }
    goto LAB_14037c6e6;
  }
  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_14035db90(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_14037c425:
        local_res8 = local_res8 & 0xffffffffffffff00;
        plVar14 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
        (**(code **)(*plVar14 + 0x50))
                  (plVar14,uVar13 & 0xffffffff,&DAT_1405f2490,param_5,&local_res8,
                   &PTR_vftable_1405d83c8,&PTR_vftable_1405d83c8,&PTR_vftable_1405d83c8,
                   &PTR_vftable_1405d83c8);
        local_17f = 0;
        plVar14 = (longlong *)(*(longlong *)(param_1 + 0x20) + 0x4a8);
        (**(code **)(*plVar14 + 0x50))
                  (plVar14,*param_5,&DAT_1405f2490,local_res10,&local_17f,&PTR_vftable_1405d83c8,
                   &PTR_vftable_1405d83c8,&PTR_vftable_1405d83c8,&PTR_vftable_1405d83c8);
        uVar3 = DAT_1405d83d4;
        uVar1 = DAT_1405d83d0;
        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_1405d83d4;
          uVar1 = DAT_1405d83d0;
          local_d0 = Proud::AddrPort::vftable;
          local_c0 = Proud::AddrPort::vftable;
          local_d8 = 0;
          local_b0 = 0;
          local_c8 = DAT_1405d83d0;
          local_c4 = DAT_1405d83d4;
          local_b8 = DAT_1405d83d0;
          local_b4 = DAT_1405d83d4;
          *(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_1405d83d4;
        uVar1 = DAT_1405d83d0;
        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_1405d83d0;
        local_f4 = DAT_1405d83d4;
        local_e8 = DAT_1405d83d0;
        local_e4 = DAT_1405d83d4;
        *(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_1405d83d4;
        uVar1 = DAT_1405d83d0;
        local_130 = Proud::AddrPort::vftable;
        local_120 = Proud::AddrPort::vftable;
        local_138 = 0;
        local_110 = 0;
        local_128 = DAT_1405d83d0;
        local_124 = DAT_1405d83d4;
        local_118 = DAT_1405d83d0;
        local_114 = DAT_1405d83d4;
        *(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_14035ca60(uVar12);
        if (iVar5 != 2) goto LAB_14037c425;
        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_14035cdd0(local_148[0],local_50,local_res10[0]);
        uVar9 = FUN_14035cd50(local_148[0],local_90);
        uVar10 = FUN_14035c9e0(local_170,local_148,uVar1);
        uVar11 = FUN_14035c8e0(local_168[0],local_70);
        (**(code **)(lVar2 + 0x50))
                  (lVar16 + 0x4a8,local_res10[0],&DAT_1405f2490,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_14035cdd0(local_168[0],local_a0,uVar1);
        uVar9 = FUN_14035cd50(uVar12,local_80);
        uVar10 = FUN_14035c9e0(local_168[0],local_60,local_res10[0]);
        uVar11 = FUN_14035c8e0(local_170,local_168);
        (**(code **)(lVar2 + 0x50))
                  (lVar16 + 0x4a8,uVar1,&DAT_1405f2490,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_140360e30(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_140364170(uVar18);
      FUN_14034ff60(uVar18);
    }
    FUN_14034ff60(local_178);
  }
LAB_14037c6e6:
  FUN_14034edd0(local_158);
  return 1;
}



void FUN_14037c710(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_140379d00(param_2);
  uVar9 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
  FUN_14034ed40(uVar9);
  if (DAT_1405f064f != '\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_14034edd0(uVar9);
      return;
    }
    if (lVar13 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_1403a5d10(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_14037c8b2;
      }
    }
    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_14037c899;
      }
    }
    puVar10 = (uint *)FUN_14037a040(param_2,puVar12);
LAB_14037c899:
    FUN_140375350(puVar10 + 2,local_res8);
LAB_14037c8b2:
    lVar11 = local_res8[0];
    if (local_res8[0] != 0) {
      FUN_14034ed40(local_res8[0]);
      bVar6 = true;
      *(longlong *)(local_res8[0] + 0x40) = *(longlong *)(local_res8[0] + 0x40) + -1;
      if (*(longlong *)(local_res8[0] + 0x40) == 0) {
        FUN_14034edd0(lVar11);
        lVar7 = local_res8[0];
        bVar6 = false;
        local_res20 = local_res8[0];
        lVar4 = *(longlong *)(local_res8[0] + 0x38);
        if (lVar4 != 0) {
          FUN_1403638e0(lVar4 + 8);
          FUN_14034ff60(lVar4);
        }
        FUN_14034edf0(lVar7);
        FUN_14034ff60(lVar7);
      }
      if (bVar6) {
        FUN_14034edd0(lVar11);
      }
    }
    plVar8 = local_res18;
    if (plVar1 != (longlong *)0x0) {
      plVar1 = plVar1 + 1;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        lVar11 = *local_res18;
        if (lVar11 != 0) {
          FUN_140364170(lVar11);
          FUN_14034ff60(lVar11);
        }
        FUN_14034ff60(plVar8);
      }
    }
    if (lVar13 != 0) {
      lVar13 = *(longlong *)(lVar13 + 0x10);
    }
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x00014037cc7d)

void FUN_14037c9c0(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_14034ed40(uVar5);
  if (DAT_1405f064f != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::PurgeTooOldAddMemberAckItem");
  }
  dVar18 = (double)FUN_14035a290(param_1 + 0xec);
  puVar12 = (undefined4 *)0x0;
  puVar13 = puVar12;
  if (param_1[0x84] != 0) {
    puVar13 = (undefined4 *)param_1[0x82];
  }
  do {
    if (puVar13 == (undefined4 *)0x0) {
LAB_14037cc88:
      FUN_14034edd0(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_14034f800();
      }
      if (DAT_1405d80a8 <
          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_14034f7d0();
        }
        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_1403a2c90(puVar7);
            lVar8 = lVar8 + (longlong)iVar11 * 0x18;
            lVar9 = FUN_1403a2c90(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_14035e7a0(puVar7,puVar13[0x38] - iVar11);
        puVar13 = puVar12;
        if (local_res18 != (longlong *)0x0) {
          puVar13 = (undefined4 *)*local_res18;
        }
        cVar4 = FUN_1403a5930(puVar13 + 0x32,uVar2);
        if (cVar4 == '\0') {
          if (local_res18 != (longlong *)0x0) {
            puVar12 = (undefined4 *)*local_res18;
          }
          FUN_14037b990(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_140364170(lVar16);
              FUN_14034ff60(lVar16);
            }
            FUN_14034ff60(local_res18);
          }
        }
        goto LAB_14037cc88;
      }
      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_140364170(lVar16);
          FUN_14034ff60(lVar16);
        }
        FUN_14034ff60(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,0x00014037d931)
// WARNING: Removing unreachable block (ram,0x00014037d944)
// WARNING: Removing unreachable block (ram,0x00014037d962)
// WARNING: Type propagation algorithm not settling

undefined8
FUN_14037ccb0(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_1405d84f0 ^ (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_140377130();
  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_140364170(lVar24);
        FUN_14034ff60(lVar24);
      }
      FUN_14034ff60(local_688);
    }
LAB_14037e97b:
    FUN_1403555d0(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_14037b990(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_140364170(lVar24);
            FUN_14034ff60(lVar24);
          }
          FUN_14034ff60(local_688);
        }
        FUN_1403555d0(param_4);
        return 1;
      }
    }
  }
  if ((*(char *)(param_1 + 0x24c) == '\0') || (local_68c != 1)) {
    plVar21 = local_688;
    lVar24 = FUN_140361850(param_1,local_68c);
    if ((lVar24 == 0) ||
       ((puVar23 = (undefined8 *)(lVar24 + 0x40), local_658 = puVar23, puVar23 == (undefined8 *)0x0
        || (cVar8 = FUN_1403637b0(param_1), cVar8 != '\0')))) {
      plVar21[1] = plVar21[1] + -1;
      if (local_688[1] == 0) {
        lVar24 = *local_688;
        if (lVar24 != 0) {
          FUN_140364170(lVar24);
          FUN_14034ff60(lVar24);
        }
        FUN_14034ff60(local_688);
      }
      goto LAB_14037e97b;
    }
  }
  else {
    puVar23 = (undefined8 *)(param_1 + 0xb8);
    local_658 = puVar23;
  }
  dVar31 = (double)FUN_14035a290(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_14037cf93;
    }
    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_14037cf7b;
      }
    }
  }
  if ((lVar24 == 0) && (cVar8 = FUN_14035f5e0(plVar13,(ulonglong)uVar2,1), cVar8 == '\0')) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
  FUN_14035ec80(plVar13);
  puVar12 = (uint *)FUN_140361020(plVar13,&local_68c,uVar5,uVar30);
  FUN_14035ec80(plVar13);
LAB_14037cf7b:
  *(double *)(puVar12 + 2) = local_508;
  *(undefined8 **)(puVar12 + 4) = puVar23;
LAB_14037cf93:
  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_14037d114;
    }
    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_14037d08e;
      }
      if (lVar24 != 0) goto LAB_14037d055;
    }
  }
  cVar8 = FUN_14035f5e0(puVar23 + 1,(ulonglong)uVar30,1);
  if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
LAB_14037d055:
  FUN_14035d100(puVar23 + 1);
  puVar12 = (uint *)FUN_1403be080(puVar23 + 1,local_678,uVar5,local_678[0]);
  FUN_14035d100(puVar23 + 1);
LAB_14037d08e:
  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_140364170(lVar24);
        FUN_14034ff60(lVar24);
      }
      FUN_14034ff60(plVar13);
    }
  }
LAB_14037d114:
  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_14036c160(param_1,plVar29);
      if (local_693 == '\0') {
        FUN_14037b990(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_140364170(lVar24);
            FUN_14034ff60(lVar24);
          }
          FUN_14034ff60(plVar29);
        }
      }
      if ((local_688 != (longlong *)0x0) && (local_688[1] = local_688[1] + -1, local_688[1] == 0)) {
        lVar24 = *local_688;
        if (lVar24 != 0) {
          FUN_140364170(lVar24);
          FUN_14034ff60(lVar24);
        }
        FUN_14034ff60(local_688);
      }
      FUN_1403555d0(local_648);
      return 1;
    }
    if (local_4f8 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14035edb0(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_14035edb0(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_14036ff50(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_140360e30(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_140374f60(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_140360e30();
          }
        }
        if (local_5d8 != 0) {
          *(longlong *)(local_5d8 + 8) = *(longlong *)(local_5d8 + 8) + -1;
          if (*(longlong *)(local_5d8 + 8) == 0) {
            FUN_140360e30(local_5d8);
          }
          plVar21 = (longlong *)(ulonglong)local_698;
          plVar13 = local_680;
        }
        if (((plVar13 == (longlong *)0x0) || (*plVar13 == 0)) ||
           (DAT_1405d80e0 < dVar31 - *(double *)(*plVar13 + 400))) {
          pvVar16 = operator_new(0x1b0);
          if ((pvVar16 == (void *)0x0) ||
             (lVar24 = FUN_14035fd60(pvVar16,local_668,
                                     *(int *)(puVar23 + 0xd7) == *(int *)(puVar7 + 0xd7)),
             lVar24 == 0)) {
            local_610 = (longlong *)0x0;
          }
          else {
            local_610 = (longlong *)FUN_14034fef0(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_140360e30();
            }
          }
          if (plVar14 != (longlong *)0x0) {
            plVar14 = plVar14 + 1;
            *plVar14 = *plVar14 + -1;
            if (*plVar14 == 0) {
              FUN_140360e30(local_610);
            }
            plVar21 = (longlong *)(ulonglong)local_698;
            plVar13 = local_680;
          }
          lVar24 = local_668;
          uVar6 = DAT_1405d83d4;
          uVar11 = DAT_1405d83d0;
          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_1405d83d4;
            uVar11 = DAT_1405d83d0;
            local_350 = Proud::AddrPort::vftable;
            local_340 = Proud::AddrPort::vftable;
            local_358 = 0;
            local_330 = 0;
            local_348 = DAT_1405d83d0;
            local_344 = DAT_1405d83d4;
            local_338 = DAT_1405d83d0;
            local_334 = DAT_1405d83d4;
            *(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_14035bd40(plVar14 + 0x24,&local_4b0);
            FUN_1403555d0(&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_14035bd40(plVar14 + 0x29,&local_488);
            FUN_1403555d0(&local_488);
          }
          else {
            plVar14 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar14 = (longlong *)*plVar13;
            }
            FUN_1403a5090(plVar14 + 0x24,*(undefined4 *)(local_668 + 0x244));
            plVar14 = plVar29;
            if (plVar13 != (longlong *)0x0) {
              plVar14 = (longlong *)*plVar13;
            }
            FUN_1403a5090(plVar14 + 0x29,*(undefined4 *)(lVar24 + 0x248));
          }
          plVar14 = plVar29;
          if (plVar13 != (longlong *)0x0) {
            plVar14 = (longlong *)*plVar13;
          }
          uVar11 = FUN_1403a6de0(lVar24 + 0xcd0);
          *(undefined4 *)(plVar14 + 0x2e) = uVar11;
          plVar14 = plVar29;
          if (plVar13 != (longlong *)0x0) {
            plVar14 = (longlong *)*plVar13;
          }
          puVar17 = (undefined4 *)FUN_14035a110(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_1403768b0(local_668 + 0x2d8,puVar23 + -8,pppuVar26,&local_640);
        uVar6 = DAT_1405d83d4;
        uVar11 = DAT_1405d83d0;
        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_1405d83d0;
        local_374 = DAT_1405d83d4;
        local_368 = DAT_1405d83d0;
        local_364 = DAT_1405d83d4;
        *(undefined4 *)(plVar14 + 4) = DAT_1405d83d0;
        *(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_1405d83d4;
        uVar11 = DAT_1405d83d0;
        local_3b0 = Proud::AddrPort::vftable;
        local_3a0 = Proud::AddrPort::vftable;
        local_3b8 = 0;
        local_390 = 0;
        local_3a8 = DAT_1405d83d0;
        local_3a4 = DAT_1405d83d4;
        local_398 = DAT_1405d83d0;
        local_394 = DAT_1405d83d4;
        *(undefined4 *)(plVar14 + 10) = DAT_1405d83d0;
        *(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_14037db12;
          }
        }
        puVar18 = (undefined1 *)FUN_140375190(puVar23 + 0xcc);
        *puVar18 = 0;
LAB_14037db12:
        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_14037db92;
          }
        }
        puVar18 = (undefined1 *)FUN_140375190(puVar7 + 0xcc,&local_680);
        *puVar18 = 0;
LAB_14037db92:
        param_1 = local_668;
        puVar23 = puVar22;
        if (*(longlong *)(local_668 + 0x17f0) != 0) {
          FUN_14034fe70();
          local_5f8 = PTR_DAT_1405d8010;
          uVar11 = (**(code **)*local_658)();
          uVar10 = (**(code **)*puVar22)(puVar22);
          FUN_140017720(&local_5f8,&DAT_140455670,uVar10,uVar11);
          puVar28 = local_5f8;
          puVar27 = local_5f8;
          if (local_5f8 == (undefined *)0x0) {
            puVar27 = PTR_DAT_1405d8010;
          }
          FUN_1403935f0(*(undefined8 *)(param_1 + 0x17f0),1,puVar27);
          if (((puVar28 != (undefined *)0x0) && (puVar28 != PTR_DAT_1405d8010)) &&
             (puVar28 + -8 != (undefined *)0x0)) {
            uVar19 = FUN_14034fe70();
            local_3e8 = uVar19;
            FUN_14034ed40(uVar19);
            local_3e0 = 1;
            piVar1 = (int *)(puVar28 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar28 + -8);
            }
            FUN_14034edd0(uVar19);
            local_3e0 = 0;
            puVar23 = local_660;
          }
          local_5f8 = PTR_DAT_1405d8010;
          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_14035c960(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_1405f2490,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_1405d8848 != 5) {
            FUN_14035b550();
          }
          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_14034f7d0();
          }
          FUN_1400179d0(&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_14000d3f0(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_1405d8848 != 5) {
            FUN_14035b550();
          }
          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_14034f7d0();
          }
          FUN_1400179d0(&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_14000d3f0(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_1405f2550,plVar21);
        if ((uVar30 & 8) != 0) {
          uVar30 = uVar30 & 0xfffffff7;
          local_698 = uVar30;
          FUN_1403555d0(&local_460);
        }
        if ((uVar30 & 4) != 0) {
          uVar30 = uVar30 & 0xfffffffb;
          local_698 = uVar30;
          FUN_1403555d0(&local_580);
        }
        if ((uVar30 & 2) != 0) {
          uVar30 = uVar30 & 0xfffffffd;
          local_698 = uVar30;
          FUN_1403555d0(&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_1403555d0(&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_14035c960(*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_1405f2490,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_1405d8848 != 5) {
            FUN_14035b550();
          }
          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_14034f7d0();
          }
          FUN_1400179d0(&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_14000d3f0(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_1405d8848 != 5) {
            FUN_14035b550();
          }
          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_14034f7d0();
          }
          FUN_1400179d0(&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_14000d3f0(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_1405f2550,plVar21);
        if ((char)uVar30 < '\0') {
          uVar30 = uVar30 & 0xffffff7f;
          local_698 = uVar30;
          FUN_1403555d0(&local_438);
        }
        if ((uVar30 & 0x40) != 0) {
          uVar30 = uVar30 & 0xffffffbf;
          local_698 = uVar30;
          FUN_1403555d0(&local_5a8);
        }
        if ((uVar30 & 0x20) != 0) {
          uVar30 = uVar30 & 0xffffffdf;
          local_698 = uVar30;
          FUN_1403555d0(&local_4d8);
        }
        if ((uVar30 & 0x10) != 0) {
          uVar30 = uVar30 & 0xffffffef;
          local_698 = uVar30;
          FUN_1403555d0(&local_558);
        }
        plVar21 = (longlong *)(ulonglong)uVar30;
        param_1 = local_668;
      }
    }
    if (((*(longlong *)(param_1 + 0x17f0) != 0) && (plVar13 != (longlong *)0x0)) && (*plVar13 != 0))
    {
      FUN_14034fe70();
      local_5f0 = PTR_DAT_1405d8010;
      plVar14 = (longlong *)FUN_140357770(*plVar13 + 0x174,&local_5c8);
      puVar28 = (undefined *)*plVar14;
      if ((undefined *)*plVar14 == (undefined *)0x0) {
        puVar28 = PTR_DAT_1405d8010;
      }
      FUN_140017720(&local_5f0,&DAT_140455638,puVar28);
      puVar28 = local_5c8;
      if (((local_5c8 != (undefined *)0x0) && (local_5c8 != PTR_DAT_1405d8010)) &&
         (puVar27 = local_5c8 + -8, puVar27 != (undefined *)0x0)) {
        uVar19 = FUN_14034fe70();
        local_3d8 = uVar19;
        FUN_14034ed40(uVar19);
        local_3d0 = 1;
        piVar1 = (int *)(puVar28 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar27);
        }
        FUN_14034edd0(uVar19);
        local_3d0 = 0;
      }
      puVar28 = local_5f0;
      puVar27 = local_5f0;
      if (local_5f0 == (undefined *)0x0) {
        puVar27 = PTR_DAT_1405d8010;
      }
      local_5c8 = PTR_DAT_1405d8010;
      FUN_1403935f0(*(undefined8 *)(param_1 + 0x17f0),1,puVar27);
      if (((puVar28 != (undefined *)0x0) && (puVar28 != PTR_DAT_1405d8010)) &&
         (puVar28 + -8 != (undefined *)0x0)) {
        dVar20 = (double)FUN_14034fe70();
        local_508 = dVar20;
        FUN_14034ed40(dVar20);
        local_500 = 1;
        piVar1 = (int *)(puVar28 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar28 + -8);
        }
        FUN_14034edd0(dVar20);
        local_500 = 0;
      }
      local_5f0 = PTR_DAT_1405d8010;
    }
    if (plVar13 != (longlong *)0x0) {
      plVar13 = plVar13 + 1;
      *plVar13 = *plVar13 + -1;
      if (*plVar13 == 0) {
        FUN_140360e30(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_14037e9b0(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1,L"Proud::CNetServerImpl::JoinP2PGroup");
  }
  *(int *)(param_1 + 0x16f0) = *(int *)(param_1 + 0x16f0) + 1;
  uVar2 = *(undefined4 *)(param_1 + 0x16f0);
  FUN_1401e6450(local_40,param_4);
  local_40[0] = Proud::ByteArray::vftable;
  uVar3 = FUN_14037ccb0(plVar1,param_2,param_3,local_40,uVar2);
  FUN_14034edd0(uVar4);
  FUN_1403555d0(param_4);
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14037ea90(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_1405d84f0 ^ (ulonglong)auStack_2b8;
  uVar3 = (**(code **)(*param_1 + 0x58))();
  local_188 = uVar3;
  FUN_14034ed40(uVar3);
  local_180 = 1;
  if (DAT_1405f064f != '\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_14034fef0(0x60);
    puVar4 = puVar5;
    if (local_298 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_14035bca0(local_298);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_298 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_14034fef0(0x48);
      local_290 = puVar5;
      if (puVar5 != (undefined8 *)0x0) {
        local_298 = puVar5;
        uVar2 = FUN_1403c0cc0();
        FUN_14034ec60(puVar5,uVar2,1);
      }
      local_298 = puVar5;
      FUN_14034ed40(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_14034edd0(puVar5);
    }
    FUN_14035bda0(&local_270,&local_298);
    if (puVar5 != (undefined8 *)0x0) {
      local_290 = puVar5;
      FUN_14034ed40(puVar5);
      local_288 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(puVar5);
        local_288 = 0;
        FUN_14012c7d0(puVar5);
      }
      else {
        FUN_14034edd0(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_14012a1d0(&local_168,param_3,3);
    lVar6 = 0;
    if (local_270 != 0) {
      lVar6 = *(longlong *)(local_270 + 0x38);
    }
    FUN_14000d470(lVar6 + 0x10,local_168);
    if (local_168 != local_160) {
      free(local_168);
    }
    FUN_14037b830(param_1,local_278);
    FUN_1403555d0(&local_1b8);
    FUN_1403555d0(&local_200);
    local_290 = &local_228;
    FUN_140399690(&local_228);
    if (local_220 != 0) {
      if ((longlong)local_218 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_218 = local_218 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_250);
    FUN_140376ab0(&local_258);
    FUN_140376a30(&local_260);
    FUN_14012c7f0(&local_270);
  }
  FUN_14034edd0(uVar3);
  return;
}



void FUN_14037ed80(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_14034ed40(uVar1);
  local_30 = 1;
  if (DAT_1405f064f != '\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_14037b830(param_1,local_128);
    FUN_1403555d0(&local_68);
    FUN_1403555d0(&local_b0);
    FUN_140399690(&local_d8);
    if (local_d0 != 0) {
      if ((longlong)local_c8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_c8 = local_c8 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_100);
    FUN_140376ab0(&local_108);
    FUN_140376a30(&local_110);
    FUN_14012c7f0(local_120);
  }
  FUN_14034edd0(uVar1);
  return;
}



void FUN_14037ef10(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_14034ed40(uVar3);
  local_50 = 1;
  if (DAT_1405f064f != '\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_14034fef0(0x60);
    puVar4 = puVar6;
    if (local_res8 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_14035bca0(local_res8);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar5 = puVar6;
    }
    else {
      puVar5 = (undefined8 *)FUN_14034fef0(0x48);
      local_res18 = puVar5;
      if (puVar5 != (undefined8 *)0x0) {
        local_res8 = puVar5;
        uVar2 = FUN_1403c0cc0();
        FUN_14034ec60(puVar5,uVar2,1);
      }
      local_res8 = puVar5;
      FUN_14034ed40(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_14034edd0(puVar5);
    }
    FUN_14035bda0(local_150,&local_res8);
    if (puVar5 != (undefined8 *)0x0) {
      local_68 = puVar5;
      FUN_14034ed40(puVar5);
      local_60 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(puVar5);
        local_60 = 0;
        FUN_14012c7d0(puVar5);
      }
      else {
        FUN_14034edd0(puVar5);
      }
    }
    local_158[0] = 0x13;
    if (local_150[0] != 0) {
      puVar6 = *(undefined8 **)(local_150[0] + 0x38);
    }
    FUN_140003100(puVar6 + 2,param_2);
    FUN_14037b830(param_1,local_158);
    FUN_1403555d0(&local_98);
    FUN_1403555d0(&local_e0);
    local_res8 = &local_108;
    FUN_140399690(&local_108);
    if (local_100 != 0) {
      if ((longlong)local_f8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_f8 = local_f8 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_130);
    FUN_140376ab0(&local_138);
    FUN_140376a30(&local_140);
    FUN_14012c7f0(local_150);
  }
  FUN_14034edd0(uVar3);
  FUN_1400031d0(param_2);
  return;
}



// WARNING: Removing unreachable block (ram,0x00014037f317)
// WARNING: Removing unreachable block (ram,0x00014037f323)
// WARNING: Removing unreachable block (ram,0x00014037f330)
// WARNING: Removing unreachable block (ram,0x00014037f328)
// WARNING: Removing unreachable block (ram,0x00014037f336)
// WARNING: Removing unreachable block (ram,0x00014037f347)
// WARNING: Removing unreachable block (ram,0x00014037f2a6)
// WARNING: Removing unreachable block (ram,0x00014037f2b2)
// WARNING: Removing unreachable block (ram,0x00014037f2be)
// WARNING: Removing unreachable block (ram,0x00014037f2b6)
// WARNING: Removing unreachable block (ram,0x00014037f2c4)
// WARNING: Removing unreachable block (ram,0x00014037f2d5)
// WARNING: Removing unreachable block (ram,0x00014037f23b)
// WARNING: Removing unreachable block (ram,0x00014037f247)
// WARNING: Removing unreachable block (ram,0x00014037f253)
// WARNING: Removing unreachable block (ram,0x00014037f24b)
// WARNING: Removing unreachable block (ram,0x00014037f259)
// WARNING: Removing unreachable block (ram,0x00014037f26a)
// WARNING: Removing unreachable block (ram,0x00014037f234)
// WARNING: Removing unreachable block (ram,0x00014037f29f)
// WARNING: Removing unreachable block (ram,0x00014037f310)
// WARNING: Removing unreachable block (ram,0x00014037f3c9)
// WARNING: Removing unreachable block (ram,0x00014037f3d0)
// WARNING: Removing unreachable block (ram,0x00014037f3e0)
// WARNING: Removing unreachable block (ram,0x00014037f3ec)
// WARNING: Removing unreachable block (ram,0x00014037f3e4)
// WARNING: Removing unreachable block (ram,0x00014037f3f2)
// WARNING: Removing unreachable block (ram,0x00014037f403)

void FUN_14037f1a0(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_14012c550(&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_14034f7d0();
  }
  FUN_14012c550(&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_14034f7d0();
  }
  FUN_14012c550(&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_14034f7d0();
  }
  FUN_14012c550(&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_14034f800();
    }
    iVar2 = piVar11[iVar10];
    if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_14012c550(&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_14037f47a;
        iVar7 = iVar7 + 1;
        piVar5 = piVar5 + 1;
      } while (iVar7 < iVar1);
    }
    goto LAB_14037f58d;
  }
LAB_14037f47a:
  FUN_14034fe70();
  local_res10 = PTR_DAT_1405d8010;
  iVar1 = FUN_14034fcf0(L"CFastArray iterator failed!");
  iVar10 = 0;
  iVar7 = iVar10;
  if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(local_res10 + -8);
  }
  iVar3 = 0;
  iVar2 = iVar1;
  if (((iVar1 <= iVar7) && (iVar2 = iVar3, local_res10 != (undefined *)0x0)) &&
     (local_res10 != PTR_DAT_1405d8010)) {
    iVar2 = *(int *)(local_res10 + -8);
  }
  iVar7 = 1;
  if (1 < iVar2) {
    iVar7 = iVar2;
  }
  if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res10 + -8);
  }
  if (iVar3 < iVar7) {
    FUN_140002d30(&local_res10,iVar7);
  }
  FUN_140002e10(&local_res10);
  puVar6 = local_res10;
  if (local_res10 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,L"CFastArray iterator failed!",iVar1);
  puVar6 = local_res10;
  if (local_res10 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8010;
  }
  iVar1 = FUN_14034fcf0(puVar6);
  iVar7 = 0;
  if (0 < iVar1) {
    iVar7 = iVar1;
  }
  iVar1 = iVar10;
  if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) {
    iVar1 = *(int *)(local_res10 + -8);
  }
  if ((iVar7 < iVar1) || (iVar7 = iVar10, local_res10 == (undefined *)0x0)) {
LAB_14037f561:
    if (((local_res10 != PTR_DAT_1405d8010) && (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_1405d8010) {
    iVar7 = *(int *)(local_res10 + -8);
    goto LAB_14037f561;
  }
  FUN_14037ef10(param_1,&local_res10);
LAB_14037f58d:
  if (lVar8 != 0) {
    if (local_60 == (longlong *)0x0) {
      FUN_14034ff60(lVar8);
    }
    else {
      (**(code **)(*local_60 + 0x18))(local_60,lVar8);
    }
  }
  if (piVar11 != (int *)0x0) {
    if (local_88 == (longlong *)0x0) {
      FUN_14034ff60(piVar11);
    }
    else {
      (**(code **)(*local_88 + 0x18))(local_88,piVar11);
    }
  }
  return;
}



void FUN_14037f600(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_14034fe70();
  local_res10 = (uint *)PTR_DAT_1405d8008;
  uVar1 = FUN_14034fd90();
  if (local_res10 == (uint *)0x0) {
    uVar3 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1405d8008) {
    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_1405d8008) {
      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_1405d8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  if ((int)uVar3 <= (int)uVar2) goto LAB_14037f75a;
  if (local_res10 == (uint *)0x0) {
    local_res10 = (uint *)PTR_DAT_1405d8008;
  }
  if ((int)uVar3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (uVar3 == 0) {
    FUN_14000d2c0(&local_res10);
    goto LAB_14037f75a;
  }
  if (local_res10 == (uint *)0x0) {
    uVar2 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1405d8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  if (uVar3 == uVar2) goto LAB_14037f75a;
  puVar6 = (uint *)FUN_14034fef0((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_1405d8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  puVar7 = (uint *)PTR_DAT_1405d8008;
  if ((int)uVar3 < (int)uVar2) {
LAB_14037f736:
    if (local_res10 != (uint *)0x0) {
      puVar7 = local_res10;
    }
  }
  else {
    if (local_res10 != (uint *)0x0) {
      if (local_res10 == (uint *)PTR_DAT_1405d8008) {
        uVar3 = 0;
      }
      else {
        uVar3 = local_res10[-2];
      }
      goto LAB_14037f736;
    }
    uVar3 = 0;
  }
  FUN_14034fdc0(puVar6 + 2,puVar7,uVar3,param_4,uVar8);
  FUN_14000d2c0(&local_res10);
  local_res10 = puVar6 + 2;
LAB_14037f75a:
  FUN_140057970(&local_res10);
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar6,&DAT_1404559b8,uVar1,param_4,uVar8);
  uVar3 = FUN_14034fd90();
  uVar1 = 0;
  if (0 < (int)uVar3) {
    uVar1 = uVar3;
  }
  if (local_res10 == (uint *)0x0) {
    uVar3 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1405d8008) {
    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_1405d8008) {
      uVar1 = 0;
    }
    else {
      uVar1 = local_res10[-2];
    }
  }
  if (((local_res10 != (uint *)PTR_DAT_1405d8008) && (local_res10 != (uint *)0x0)) &&
     (puVar6 = local_res10 + -2, puVar6 != (uint *)0x0)) {
    *puVar6 = uVar1;
    *(undefined1 *)((longlong)(int)uVar1 + 8 + (longlong)puVar6) = 0;
  }
  FUN_14034fe70();
  local_res18 = (uint *)PTR_DAT_1405d8008;
  FUN_1403841b0(local_50);
  FUN_140383c40(local_50);
  FUN_140385940(local_50,&local_res10);
  FUN_140383db0(local_50,0);
  thunk_FUN_140384ec0(local_50,&local_res18);
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8008;
  }
  if (puVar6 != local_res18) {
    puVar6 = local_res18;
    if (local_res18 == (uint *)0x0) {
      puVar6 = (uint *)PTR_DAT_1405d8008;
    }
    puVar7 = local_res10;
    if (local_res10 == (uint *)0x0) {
      puVar7 = (uint *)PTR_DAT_1405d8008;
    }
    iVar4 = FUN_14034fdf0(puVar7,puVar6);
    if (iVar4 != 0) {
      FUN_14034fe70();
      local_res20 = PTR_DAT_1405d8010;
      uVar5 = FUN_14034fcf0(L"Proud.StringA serialization failed!");
      uVar8 = FUN_140002f00(&local_res20,uVar5);
      FUN_14034fd20(uVar8,L"Proud.StringA serialization failed!",uVar5);
      FUN_140002fe0(&local_res20);
      FUN_14037ef10(param_1,&local_res20);
    }
  }
  local_res20 = local_48;
  FUN_140399690(local_48);
  puVar6 = local_res18;
  if (local_40 != 0) {
    if (local_34 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_38 = 0;
  }
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar7 = local_res18 + -2, puVar7 != (uint *)0x0)) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_14034ff60(puVar7);
    }
    FUN_14034edd0(uVar8);
  }
  puVar6 = local_res10;
  if (((local_res10 != (uint *)0x0) && (local_res10 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar7 = local_res10 + -2, puVar7 != (uint *)0x0)) {
    local_res18 = (uint *)PTR_DAT_1405d8008;
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_14034ff60(puVar7);
    }
    FUN_14034edd0(uVar8);
  }
  return;
}



void FUN_14037f9a0(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_14034fe70();
  local_res10 = (uint *)PTR_DAT_1405d8008;
  uVar1 = FUN_14034fd90();
  if (local_res10 == (uint *)0x0) {
    uVar3 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1405d8008) {
    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_1405d8008) {
      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_1405d8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  if ((int)uVar3 <= (int)uVar2) goto LAB_14037fafa;
  if (local_res10 == (uint *)0x0) {
    local_res10 = (uint *)PTR_DAT_1405d8008;
  }
  if ((int)uVar3 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (uVar3 == 0) {
    FUN_14000d2c0(&local_res10);
    goto LAB_14037fafa;
  }
  if (local_res10 == (uint *)0x0) {
    uVar2 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1405d8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  if (uVar3 == uVar2) goto LAB_14037fafa;
  puVar6 = (uint *)FUN_14034fef0((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_1405d8008) {
    uVar2 = 0;
  }
  else {
    uVar2 = local_res10[-2];
  }
  puVar7 = (uint *)PTR_DAT_1405d8008;
  if ((int)uVar3 < (int)uVar2) {
LAB_14037fad6:
    if (local_res10 != (uint *)0x0) {
      puVar7 = local_res10;
    }
  }
  else {
    if (local_res10 != (uint *)0x0) {
      if (local_res10 == (uint *)PTR_DAT_1405d8008) {
        uVar3 = 0;
      }
      else {
        uVar3 = local_res10[-2];
      }
      goto LAB_14037fad6;
    }
    uVar3 = 0;
  }
  FUN_14034fdc0(puVar6 + 2,puVar7,uVar3,param_4,uVar8);
  FUN_14000d2c0(&local_res10);
  local_res10 = puVar6 + 2;
LAB_14037fafa:
  FUN_140057970(&local_res10);
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar6,&DAT_1404559b8,uVar1,param_4,uVar8);
  uVar3 = FUN_14034fd90();
  uVar1 = 0;
  if (0 < (int)uVar3) {
    uVar1 = uVar3;
  }
  if (local_res10 == (uint *)0x0) {
    uVar3 = 0;
  }
  else if (local_res10 == (uint *)PTR_DAT_1405d8008) {
    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_1405d8008) {
      uVar1 = 0;
    }
    else {
      uVar1 = local_res10[-2];
    }
  }
  if (((local_res10 != (uint *)PTR_DAT_1405d8008) && (local_res10 != (uint *)0x0)) &&
     (puVar6 = local_res10 + -2, puVar6 != (uint *)0x0)) {
    *puVar6 = uVar1;
    *(undefined1 *)((longlong)(int)uVar1 + 8 + (longlong)puVar6) = 0;
  }
  FUN_14034fe70();
  local_res18 = (uint *)PTR_DAT_1405d8008;
  FUN_1403841b0(local_50);
  FUN_140383c40(local_50);
  FUN_140385940(local_50,&local_res10);
  FUN_140383db0(local_50,0);
  thunk_FUN_140384ec0(local_50,&local_res18);
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8008;
  }
  if (puVar6 != local_res18) {
    puVar6 = local_res18;
    if (local_res18 == (uint *)0x0) {
      puVar6 = (uint *)PTR_DAT_1405d8008;
    }
    puVar7 = local_res10;
    if (local_res10 == (uint *)0x0) {
      puVar7 = (uint *)PTR_DAT_1405d8008;
    }
    iVar4 = FUN_14034fdf0(puVar7,puVar6);
    if (iVar4 != 0) {
      FUN_14034fe70();
      local_res20 = PTR_DAT_1405d8010;
      uVar5 = FUN_14034fcf0(L"Proud.String serialization failed!");
      uVar8 = FUN_140002f00(&local_res20,uVar5);
      FUN_14034fd20(uVar8,L"Proud.String serialization failed!",uVar5);
      FUN_140002fe0(&local_res20);
      FUN_14037ef10(param_1,&local_res20);
    }
  }
  local_res20 = local_48;
  FUN_140399690(local_48);
  puVar6 = local_res18;
  if (local_40 != 0) {
    if (local_34 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_38 = 0;
  }
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar7 = local_res18 + -2, puVar7 != (uint *)0x0)) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_14034ff60(puVar7);
    }
    FUN_14034edd0(uVar8);
  }
  puVar6 = local_res10;
  if (((local_res10 != (uint *)0x0) && (local_res10 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar7 = local_res10 + -2, puVar7 != (uint *)0x0)) {
    local_res18 = (uint *)PTR_DAT_1405d8008;
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_14034ff60(puVar7);
    }
    FUN_14034edd0(uVar8);
  }
  return;
}



void FUN_14037fd40(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_14034fe70();
  local_res10 = PTR_DAT_1405d8008;
  uVar1 = FUN_14034fd90("1.2.3.4");
  uVar2 = FUN_140057a60(&local_res10,uVar1);
  FUN_14034fdc0(uVar2,"1.2.3.4",uVar1);
  FUN_140057b50(&local_res10);
  FUN_140353210(local_28,&local_res10,1);
  FUN_14034fe70();
  local_res10 = PTR_DAT_1405d8008;
  uVar1 = FUN_14034fd90("1.2.3.5");
  uVar2 = FUN_140057a60(&local_res10,uVar1);
  FUN_14034fdc0(uVar2,"1.2.3.5",uVar1);
  FUN_140057b50(&local_res10);
  FUN_140353210(local_38,&local_res10,1);
  FUN_14034fe70();
  local_res10 = PTR_DAT_1405d8008;
  uVar1 = FUN_14034fd90("5.6.7.8");
  uVar2 = FUN_140057a60(&local_res10,uVar1);
  FUN_14034fdc0(uVar2,"5.6.7.8",uVar1);
  FUN_140057b50(&local_res10);
  FUN_140353210(local_18,&local_res10,1);
  if (((local_30 != local_20) || (local_2f != local_1f)) || (local_2e != local_1e)) {
    FUN_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    uVar1 = FUN_14034fcf0(L"AddrPort.IsSameLan fail!");
    uVar2 = FUN_140002f00(&local_res10,uVar1);
    FUN_14034fd20(uVar2,L"AddrPort.IsSameLan fail!",uVar1);
    FUN_140002fe0(&local_res10);
    FUN_14037ef10(param_1,&local_res10);
  }
  if (((local_10 == local_30) && (local_f == local_2f)) && (local_e == local_2e)) {
    FUN_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    uVar1 = FUN_14034fcf0(L"AddrPort.IsSameLan fail!");
    uVar2 = FUN_140002f00(&local_res10,uVar1);
    FUN_14034fd20(uVar2,L"AddrPort.IsSameLan fail!",uVar1);
    FUN_140002fe0(&local_res10);
    FUN_14037ef10(param_1,&local_res10);
  }
  return;
}



void FUN_14037ff40(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_14034ed40(uVar4);
  local_50 = 1;
  if (DAT_1405f064f != '\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_14034fef0(0x60);
    puVar5 = puVar7;
    if (local_res8 != (undefined8 *)0x0) {
      puVar5 = (undefined8 *)FUN_14035bca0(local_res8);
    }
    if (puVar5 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar6 = puVar7;
    }
    else {
      puVar6 = (undefined8 *)FUN_14034fef0(0x48);
      local_res18 = puVar6;
      if (puVar6 != (undefined8 *)0x0) {
        local_res8 = puVar6;
        uVar3 = FUN_1403c0cc0();
        FUN_14034ec60(puVar6,uVar3,1);
      }
      local_res8 = puVar6;
      FUN_14034ed40(puVar6);
      puVar6[8] = 1;
      puVar6[7] = puVar5;
      FUN_14034edd0(puVar6);
    }
    FUN_14035bda0(local_150,&local_res8);
    if (puVar6 != (undefined8 *)0x0) {
      local_68 = puVar6;
      FUN_14034ed40(puVar6);
      local_60 = 1;
      plVar1 = puVar6 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(puVar6);
        local_60 = 0;
        FUN_14012c7d0(puVar6);
      }
      else {
        FUN_14034edd0(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_14037b830(param_1,local_158);
    FUN_1403555d0(&local_98);
    FUN_1403555d0(&local_e0);
    local_res8 = &local_108;
    FUN_140399690(&local_108);
    if (local_100 != 0) {
      if ((longlong)local_f8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_f8 = local_f8 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_130);
    FUN_140376ab0(&local_138);
    FUN_140376a30(&local_140);
    FUN_14012c7f0(local_150);
  }
  FUN_14034edd0(uVar4);
  FUN_14012c7f0(param_2);
  return;
}



void FUN_140380240(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_14034ed40(uVar4);
  local_50 = 1;
  if (DAT_1405f064f != '\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_14034fef0(0x60);
    puVar5 = puVar7;
    if (local_res8 != (undefined8 *)0x0) {
      puVar5 = (undefined8 *)FUN_14035bca0(local_res8);
    }
    if (puVar5 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar6 = puVar7;
    }
    else {
      puVar6 = (undefined8 *)FUN_14034fef0(0x48);
      local_res18 = puVar6;
      if (puVar6 != (undefined8 *)0x0) {
        local_res8 = puVar6;
        uVar3 = FUN_1403c0cc0();
        FUN_14034ec60(puVar6,uVar3,1);
      }
      local_res8 = puVar6;
      FUN_14034ed40(puVar6);
      puVar6[8] = 1;
      puVar6[7] = puVar5;
      FUN_14034edd0(puVar6);
    }
    FUN_14035bda0(local_150,&local_res8);
    if (puVar6 != (undefined8 *)0x0) {
      local_68 = puVar6;
      FUN_14034ed40(puVar6);
      local_60 = 1;
      plVar1 = puVar6 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(puVar6);
        local_60 = 0;
        FUN_14012c7d0(puVar6);
      }
      else {
        FUN_14034edd0(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_14037b830(param_1,local_158);
    FUN_1403555d0(&local_98);
    FUN_1403555d0(&local_e0);
    local_res8 = &local_108;
    FUN_140399690(&local_108);
    if (local_100 != 0) {
      if ((longlong)local_f8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_f8 = local_f8 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_130);
    FUN_140376ab0(&local_138);
    FUN_140376a30(&local_140);
    FUN_14012c7f0(local_150);
  }
  FUN_14034edd0(uVar4);
  FUN_14012c7f0(param_2);
  return;
}



void FUN_140380540(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_14034f7d0();
    }
    FUN_1400179d0(&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_14000d3f0(uVar2,uVar3,(longlong)iVar1);
    FUN_14037b830(param_1,local_118);
    FUN_1403555d0(&local_58);
    FUN_1403555d0(&local_a0);
    FUN_140399690(&local_c8);
    if (local_c0 != 0) {
      if ((longlong)local_b8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_b8 = local_b8 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_f0);
    FUN_140376ab0(&local_f8);
    FUN_140376a30(&local_100);
    FUN_14012c7f0(local_110);
  }
  return;
}



undefined8 FUN_1403806e0(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\0') {
    (**(code **)(param_1[-0x15] + 200))(param_1 + -0x15,L"Proud::CNetServerImpl::DestroyP2PGroup");
  }
  FUN_140377130(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_140364170(lVar5);
        FUN_14034ff60(lVar5);
      }
      FUN_14034ff60(local_res8);
    }
    FUN_14034edd0(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_14000d450(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_140380864;
        if (*piVar1 == (int)param_2) break;
        piVar1 = *(int **)(piVar1 + 4);
      }
      FUN_140379970(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_14037ed80(param_1 + -0x15,param_2 & 0xffffffff);
    }
LAB_140380864:
    if ((local_res8 != (longlong *)0x0) && (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0))
    {
      lVar5 = *local_res8;
      if (lVar5 != 0) {
        FUN_140364170(lVar5);
        FUN_14034ff60(lVar5);
      }
      FUN_14034ff60(local_res8);
    }
    FUN_14034edd0(uVar4);
    uVar4 = 1;
  }
  return uVar4;
}



undefined8 FUN_140380910(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_14034ed40(uVar5);
  if (DAT_1405f064f != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1,L"Proud::CNetServerImpl::LeaveP2PGroup");
  }
  FUN_140377130(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_140364170(lVar2);
        FUN_14034ff60(lVar2);
      }
      FUN_14034ff60(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_140380db6;
        if (*puVar11 == local_res10[0]) break;
        puVar11 = *(uint **)(puVar11 + 6);
        if (puVar11 == (uint *)0x0) goto LAB_140380db6;
      }
      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_140361850(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_140364170(lVar2);
              FUN_14034ff60(lVar2);
            }
            FUN_14034ff60(local_res8);
          }
          goto LAB_140380e29;
        }
      }
      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_1405f2490,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_1405f2490,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_14000d450(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_140378380(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_14000d450(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_140380be1;
          if (*puVar7 == uVar13) break;
          puVar7 = *(uint **)(puVar7 + 6);
        }
        FUN_14039c290(puVar9 + 2,puVar7,0);
        plVar14 = local_res8;
        uVar13 = local_res10[0];
      }
LAB_140380be1:
      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_140380c44;
          if (*puVar9 == local_res18[0]) break;
          puVar9 = *(uint **)(puVar9 + 4);
        }
        FUN_140379970(puVar10 + 2,puVar9,0);
        plVar14 = local_res8;
        uVar13 = local_res10[0];
      }
LAB_140380c44:
      puVar10 = puVar11;
      if (plVar14 != (longlong *)0x0) {
        puVar10 = (uint *)*plVar14;
      }
      FUN_14037bbe0(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_140380d33;
            if (*puVar11 == uVar12) break;
            puVar11 = *(uint **)(puVar11 + 4);
          }
          FUN_140379970(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_14037ed80(plVar1,uVar12);
        }
      }
      else {
        if (local_res8 != (longlong *)0x0) {
          puVar11 = (uint *)*local_res8;
        }
        FUN_14036c160(plVar1,puVar11);
      }
LAB_140380d33:
      if ((local_res8 != (longlong *)0x0) &&
         (local_res8[1] = local_res8[1] + -1, local_res8[1] == 0)) {
        lVar2 = *local_res8;
        if (lVar2 != 0) {
          FUN_140364170(lVar2);
          FUN_14034ff60(lVar2);
        }
        FUN_14034ff60(local_res8);
      }
      FUN_14034edd0(uVar5);
      return 1;
    }
LAB_140380db6:
    local_res8[1] = local_res8[1] + -1;
    if (local_res8[1] == 0) {
      lVar2 = *local_res8;
      if (lVar2 != 0) {
        FUN_140364170(lVar2);
        FUN_14034ff60(lVar2);
      }
      FUN_14034ff60(local_res8);
    }
  }
LAB_140380e29:
  FUN_14034edd0(uVar5);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

uint FUN_140380e50(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_1405d84f0 ^ (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_14034ed40(pppuVar7);
  local_288 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(*plVar1 + 200))(plVar1);
  }
  if ((param_3 < 0) || (*(longlong *)(param_1 + 0x3d0) == 0)) {
    FUN_14034edd0(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_140360b40(&local_208,param_2,(longlong)param_3);
        FUN_140360310(&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_14034f7d0();
            }
            piVar12 = local_1e8 + lVar8;
            if (100 < uVar20) {
              piVar12 = (int *)((longlong)pvVar14 + lVar8 * 4);
            }
            if (*piVar12 != 1) {
              lVar8 = FUN_140361850(plVar1);
              if (lVar8 == 0) {
                if (100 < uVar20) {
                  operator_delete__(pvVar14);
                }
                FUN_14034edd0(local_2a8);
                param_4 = local_298;
                goto LAB_14038154d;
              }
              cVar2 = FUN_1403953f0(lVar8 + 0x288);
              if ((cVar2 != '\0') &&
                 ((pvVar14 = local_208, uVar20 = local_1f8, *(char *)(lVar8 + 0x680) != '\0' ||
                  (*(int *)(lVar8 + 0x670) != 0)))) goto LAB_14038125d;
              FUN_14034fe70();
              local_2b8 = (uint *)PTR_DAT_1405d8010;
              uVar3 = FUN_14034fcf0(&DAT_140455d00);
              puVar10 = puVar16;
              if ((local_2b8 != (uint *)0x0) &&
                 (puVar10 = (uint *)0x0, local_2b8 != (uint *)PTR_DAT_1405d8010)) {
                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_1405d8010)) {
                uVar5 = local_2b8[-2];
              }
              uVar17 = 1;
              if (1 < (int)uVar5) {
                uVar17 = uVar5;
              }
              uVar5 = uVar4;
              if ((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1405d8010)) {
                uVar5 = local_2b8[-2];
              }
              if ((int)uVar5 < (int)uVar17) {
                if (local_2b8 == (uint *)0x0) {
                  local_2b8 = (uint *)PTR_DAT_1405d8010;
                }
                if ((int)uVar17 < 0) {
                    // WARNING: Subroutine does not return
                  FUN_14034f7d0();
                }
                if (uVar17 == 0) {
                  FUN_1400031d0(&local_2b8);
                }
                else {
                  uVar5 = uVar6;
                  if ((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1405d8010)) {
                    uVar5 = local_2b8[-2];
                  }
                  if (uVar17 != uVar5) {
                    puVar10 = (uint *)FUN_14034fef0((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_1405d8010)) {
                      uVar5 = local_2b8[-2];
                    }
                    puVar19 = (uint *)PTR_DAT_1405d8010;
                    if ((int)uVar17 < (int)uVar5) {
LAB_1403810e4:
                      if (local_2b8 != (uint *)0x0) {
                        puVar19 = local_2b8;
                      }
                    }
                    else {
                      uVar17 = uVar6;
                      if (local_2b8 != (uint *)0x0) {
                        if (local_2b8 != (uint *)PTR_DAT_1405d8010) {
                          uVar17 = local_2b8[-2];
                        }
                        goto LAB_1403810e4;
                      }
                    }
                    FUN_14034fd20(puVar10 + 2,puVar19,uVar17);
                    FUN_1400031d0(&local_2b8);
                    local_2b8 = puVar10 + 2;
                  }
                }
              }
              FUN_140002e10(&local_2b8);
              puVar10 = local_2b8;
              if (local_2b8 == (uint *)0x0) {
                puVar10 = (uint *)PTR_DAT_1405d8010;
              }
              FUN_14034fd20(puVar10,&DAT_140455d00,uVar3);
              puVar10 = local_2b8;
              if (local_2b8 == (uint *)0x0) {
                puVar10 = (uint *)PTR_DAT_1405d8010;
              }
              uVar5 = FUN_14034fcf0(puVar10);
              uVar3 = 0;
              if (0 < (int)uVar5) {
                uVar3 = uVar5;
              }
              uVar5 = uVar4;
              if ((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1405d8010)) {
                uVar5 = local_2b8[-2];
              }
              if (((int)uVar3 < (int)uVar5) || (uVar3 = uVar4, local_2b8 == (uint *)0x0)) {
LAB_140381180:
                if (((local_2b8 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
                uVar3 = local_2b8[-2];
                goto LAB_140381180;
              }
              local_278 = 0;
              local_270 = 0;
              local_268 = 0;
              local_260 = 0;
              local_280 = Proud::ByteArray::vftable;
              local_2c8 = &local_280;
              FUN_14035bed0(local_238,1,*(undefined4 *)(lVar8 + 0x6f8),&local_2b8);
              (**(code **)(*plVar1 + 0x80))(plVar1);
              FUN_1403555d0(&local_280);
              puVar10 = local_2b8;
              if (((local_2b8 != (uint *)0x0) && (local_2b8 != (uint *)PTR_DAT_1405d8010)) &&
                 (puVar19 = local_2b8 + -2, puVar19 != (uint *)0x0)) {
                uVar9 = FUN_14034fe70();
                local_258 = uVar9;
                FUN_14034ed40(uVar9);
                local_250 = 1;
                puVar10 = puVar10 + -1;
                *puVar10 = *puVar10 - 1;
                if (*puVar10 == 0) {
                  FUN_14034ff60(puVar19);
                }
                FUN_14034edd0(uVar9);
                local_250 = 0;
              }
              local_2b8 = (uint *)PTR_DAT_1405d8010;
              pvVar14 = local_208;
              uVar20 = local_1f8;
            }
LAB_14038125d:
            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_14034fef0(0xf8);
      puVar10 = puVar16;
      if (local_2b0 != (longlong *)0x0) {
        puVar10 = (uint *)FUN_1403a5a20(local_2b0);
      }
      if (puVar10 == (uint *)0x0) {
        local_2b0 = (longlong *)0x0;
      }
      else {
        local_2b0 = (longlong *)FUN_14034fef0(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_140381428;
        }
      }
      plVar11 = (longlong *)FUN_1403bf850(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_140364170(lVar8);
            FUN_14034ff60(lVar8);
          }
          FUN_14034ff60(puVar10);
          lVar8 = local_2a0;
        }
      }
LAB_140381428:
      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_1401e6450(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_14034f7d0();
          }
          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_14037ccb0(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_140364170(lVar8);
            FUN_14034ff60(lVar8);
          }
          FUN_14034ff60(plVar1);
          pppuVar7 = local_290;
        }
      }
      if (100 < local_1f8) {
        operator_delete__(local_208);
      }
      FUN_14034edd0(pppuVar7);
      FUN_1403555d0(local_298);
      return uVar6;
    }
    FUN_14034edd0(pppuVar7);
  }
LAB_14038154d:
  FUN_1403555d0(param_4);
  return 0;
}



ulonglong FUN_140381580(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_1403555d0((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_14034f7d0();
    }
    FUN_1400179d0(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_14000d3f0(puVar7,puVar9,(longlong)iVar1);
    *(undefined4 *)(*(longlong *)(param_2 + 0x228) + 0x38) = param_7;
    if (*(longlong *)(param_1 + 0x17f0) != 0) {
      FUN_140393880(*(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_140378970(param_1,param_2,0xc,7,&local_68,0);
    FUN_1403555d0(&local_68);
  }
  else {
    puVar9 = *(undefined4 **)(param_2 + 0x228);
    FUN_140378970(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_14038187a;
      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_140381875;
        puVar8 = (ulonglong *)puVar8[2];
      }
      if (lVar4 != 0) goto LAB_140381840;
    }
  }
  cVar6 = FUN_14035f5e0(param_1 + 0x280,(ulonglong)uVar2,CONCAT71((int7)((ulonglong)lVar4 >> 8),1));
  if (cVar6 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
LAB_140381840:
  FUN_14035d100(param_1 + 0x280);
  puVar8 = (ulonglong *)FUN_140361160(param_1 + 0x280,&local_res10,uVar13,param_2 & 0xffffffff);
  FUN_14035d100(param_1 + 0x280);
LAB_140381875:
  puVar8[1] = uVar16;
LAB_14038187a:
  FUN_1403552c0(*(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_1403552c0(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_140379750(lVar4);
      uVar13 = FUN_140377f70(param_1 + 0x2d8,param_2);
      return uVar13;
    }
    if (puVar15 == (undefined4 *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14037bbe0(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_1405f2490,param_2 + 0x6f8,lVar11);
      }
      piVar14 = *(int **)(piVar14 + 6);
    }
    if (lVar10 + 8 != lVar11 + 8) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_140381a3b;
        if (*puVar12 == *(uint *)(param_2 + 0x6f8)) break;
        puVar12 = *(uint **)(puVar12 + 6);
      }
      FUN_14039c290(lVar10 + 8,puVar12,0);
    }
LAB_140381a3b:
    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_140381b12;
          if (*puVar12 == uVar2) break;
          puVar12 = *(uint **)(puVar12 + 4);
        }
        FUN_140379970(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_14037ed80(param_1,uVar2);
      }
    }
    else {
      if (local_78 == (longlong *)0x0) {
        lVar10 = 0;
      }
      else {
        lVar10 = *local_78;
      }
      FUN_14036c160(param_1,lVar10);
    }
LAB_140381b12:
    if (local_78 == (longlong *)0x0) {
      lVar10 = 0;
    }
    else {
      lVar10 = *local_78;
    }
    FUN_14012c460(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_140364170(lVar10);
          FUN_14034ff60(lVar10);
        }
        FUN_14034ff60(local_78);
        param_2 = local_res10;
      }
    }
    if (puVar15 != (undefined4 *)0x0) {
      puVar15 = *(undefined4 **)(puVar15 + 4);
    }
  } while( true );
}



// WARNING: Removing unreachable block (ram,0x000140381dd0)

void FUN_140381be0(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_14034edd0(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_14000d450(0x80004005);
      }
      lVar5 = *(longlong *)(lVar7 + 0x10);
      FUN_140379970(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_14037ed80(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_140364170(lVar5);
          FUN_14034ff60(lVar5);
        }
        FUN_14034ff60(local_res8);
      }
    }
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



// WARNING: Removing unreachable block (ram,0x000140381f61)
// WARNING: Removing unreachable block (ram,0x000140381f6d)
// WARNING: Removing unreachable block (ram,0x000140381f65)
// WARNING: Removing unreachable block (ram,0x000140381f73)
// WARNING: Removing unreachable block (ram,0x000140381f03)
// WARNING: Removing unreachable block (ram,0x000140381f0f)
// WARNING: Removing unreachable block (ram,0x000140381f07)
// WARNING: Removing unreachable block (ram,0x000140381f15)
// WARNING: Removing unreachable block (ram,0x000140381fc1)
// WARNING: Removing unreachable block (ram,0x000140381fcd)
// WARNING: Removing unreachable block (ram,0x000140381fc6)
// WARNING: Removing unreachable block (ram,0x000140381fd3)

void FUN_140381e00(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_14034ed40(local_70);
  local_68 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::TestReliableUdpFrame");
  }
  uVar7 = FUN_140352e50(local_58);
  plVar8 = (longlong *)FUN_14034ffc0(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_14034f7d0();
  }
  local_150 = plVar8;
  FUN_14035f6d0(&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_14034f7d0();
  }
  FUN_14035f6d0(&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_14034f7d0();
  }
  FUN_14035f6d0(&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_14034f7d0();
  }
  FUN_14035f6d0(&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_14035faa0(piVar12,4);
  if (iVar4 < 1) {
                    // WARNING: Subroutine does not return
    FUN_14034f800();
  }
  if (*piVar20 == 1) {
    if (iVar4 < 2) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    if (piVar20[1] != 2) goto LAB_140382057;
    if (iVar4 < 3) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    if (piVar20[2] != 4) goto LAB_140382057;
    if (iVar4 < 4) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    if (piVar20[3] != 5) goto LAB_140382057;
  }
  else {
LAB_140382057:
    FUN_14034fe70();
    local_res10 = (longlong *)PTR_DAT_1405d8010;
    uVar3 = FUN_14034fcf0(L"Proud.QuickSort() failed!");
    uVar7 = FUN_140002f00(&local_res10,uVar3);
    FUN_14034fd20(uVar7,L"Proud.QuickSort() failed!",uVar3);
    FUN_140002fe0(&local_res10);
    FUN_14037ef10(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_14036dde0(&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_14034ff60(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_14034ff60(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_14034f800();
    }
    plVar11 = plVar18;
    if (local_110 != (longlong *)0x0) {
      plVar11 = (longlong *)*local_110;
    }
    FUN_1403a7520(plVar11,piVar20[(longlong)plVar19]);
    uVar13 = (int)plVar15 + 1;
    plVar15 = (longlong *)(ulonglong)uVar13;
    plVar19 = (longlong *)((longlong)plVar19 + 1);
  } while ((int)uVar13 < iVar4);
  FUN_1403841b0(local_98);
  FUN_140383c40(local_98);
  plVar11 = plVar18;
  if (local_110 != (longlong *)0x0) {
    plVar11 = (longlong *)*local_110;
  }
  FUN_1403a7790(plVar11,local_98);
  FUN_140383db0(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_14036dde0(&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_14034ff60(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_14034ff60(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_1403a72e0(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_1403a7670(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_14038253a;
  }
  FUN_14034fe70();
  local_res10 = (longlong *)PTR_DAT_1405d8010;
  iVar5 = FUN_14034fcf0(L"FrameNumberList pack/unpack failed!");
  iVar4 = iVar21;
  if ((local_res10 != (longlong *)0x0) && (local_res10 != (longlong *)PTR_DAT_1405d8010)) {
    iVar4 = (int)local_res10[-1];
  }
  iVar6 = iVar5;
  if (((iVar5 <= iVar4) && (iVar6 = iVar21, local_res10 != (longlong *)0x0)) &&
     (local_res10 != (longlong *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar21 = (int)local_res10[-1];
  }
  if (iVar21 < iVar4) {
    FUN_140002d30(&local_res10);
  }
  FUN_140002e10(&local_res10);
  plVar11 = local_res10;
  if (local_res10 == (longlong *)0x0) {
    plVar11 = (longlong *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(plVar11,L"FrameNumberList pack/unpack failed!",iVar5);
  plVar11 = local_res10;
  if (local_res10 == (longlong *)0x0) {
    plVar11 = (longlong *)PTR_DAT_1405d8010;
  }
  uVar13 = FUN_14034fcf0(plVar11);
  if (0 < (int)uVar13) {
    piVar12 = (int *)(ulonglong)uVar13;
  }
  iVar4 = iVar6;
  if ((local_res10 != (longlong *)0x0) && (local_res10 != (longlong *)PTR_DAT_1405d8010)) {
    iVar4 = (int)local_res10[-1];
  }
  iVar21 = (int)piVar12;
  if (((int)piVar12 < iVar4) || (iVar21 = iVar6, local_res10 == (longlong *)0x0)) {
LAB_140382505:
    if (((local_res10 != (longlong *)PTR_DAT_1405d8010) && (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_1405d8010) {
    iVar21 = (int)local_res10[-1];
    goto LAB_140382505;
  }
  FUN_14037ef10(param_1,&local_res10);
  piVar10 = local_b0;
LAB_14038253a:
  local_c0 = Proud::CFastArray<>::vftable;
  if (piVar10 != (int *)0x0) {
    if (local_b8 == (longlong *)0x0) {
      FUN_14034ff60(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_140363af0(&local_d8,local_d8);
    }
  }
  FUN_140399690(&local_f0);
  if (local_e8 != 0) {
    if ((longlong)local_e0 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_e0 = local_e0 & 0xffffffff00000000;
  }
  FUN_140399690(local_90);
  if (local_88 != 0) {
    if (local_7c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_80 = 0;
  }
  if (local_110 != (longlong *)0x0) {
    plVar11 = local_110 + 1;
    *plVar11 = *plVar11 + -1;
    if (*plVar11 == 0) {
      FUN_140363af0(&local_110,local_110);
    }
  }
  FUN_140399690(&local_128);
  if (local_120 != 0) {
    if ((longlong)local_118 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_118 = local_118 & 0xffffffff00000000;
  }
  if (local_150 == (longlong *)0x0) {
    FUN_14034ff60(piVar20);
  }
  else {
    (**(code **)(*local_150 + 0x18))(local_150,piVar20);
  }
  (**(code **)*plVar8)(plVar8,1);
  FUN_14034edd0(local_70);
  return;
}



void FUN_1403826a0(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_140381580(param_1,param_2,0xc,7,&local_30,
                    L"Proud::CNetServerImpl::HardDisconnect_AutoPruneGoesTooLongClient",0);
      FUN_1403555d0(&local_30);
    }
  }
  return;
}



undefined8 FUN_140382770(longlong param_1,uint param_2)

{
  longlong lVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  uint *puVar5;
  
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_140381580(lVar1,lVar2,0xb,3,lVar2 + 0x1f8,
                        L"Proud::CNetServerImpl::C2SStub::ShutdownTcpHandshake",0);
        }
        break;
      }
      puVar5 = *(uint **)(puVar5 + 4);
      if (puVar5 == (uint *)0x0) break;
    }
  }
  FUN_14034edd0(uVar4);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x000140382a79)
// WARNING: Removing unreachable block (ram,0x000140382b0d)

void FUN_140382880(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_14034ed40(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_14034ed40(uVar6);
    if (DAT_1405f064f != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::Stop");
    }
    if ((*(longlong *)(param_1 + 0x338) != 0) && (cVar5 = FUN_14038a370(), cVar5 != '\0')) {
      FUN_14034edd0(lVar1);
      FUN_14034edd0(uVar6);
      FUN_14034f420(local_80,L"Call Stop in UserWorker");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_80,(ThrowInfo *)&DAT_1405d36c0);
    }
    FUN_14034edd0(uVar6);
    if ((*(longlong **)(param_1 + 0x6a0) != (longlong *)0x0) &&
       (**(longlong **)(param_1 + 0x6a0) != 0)) {
      FUN_1403552c0();
    }
    uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
    FUN_14034ed40(uVar6);
    if (DAT_1405f064f != '\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_140381580(param_1 + -0xa8);
      FUN_1403555d0(&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_140381580(param_1 + -0xa8);
      FUN_1403555d0(&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_14034f800();
        }
        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_1403552c0(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_14034ff60(local_res8);
          }
        }
        uVar12 = (int)uVar13 + 1;
        uVar11 = uVar11 + 1;
        uVar13 = (ulonglong)uVar12;
      } while ((int)uVar12 < *(int *)(param_1 + 0x638));
    }
    FUN_14034edd0(uVar6);
    iVar10 = 0;
    do {
      uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
      FUN_14034ed40(uVar6);
      if (DAT_1405f064f != '\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_14034edd0(uVar6);
        break;
      }
      FUN_14034edd0(uVar6);
      Sleep(100);
      iVar10 = iVar10 + 1;
    } while (iVar10 < 10000);
    pvVar4 = *(void **)(param_1 + 0x338);
    if (pvVar4 != (void *)0x0) {
      FUN_14038e820(pvVar4);
      operator_delete(pvVar4);
    }
    plVar8 = (longlong *)0x0;
    *(undefined8 *)(param_1 + 0x338) = 0;
    uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
    FUN_14034ed40(uVar6);
    if (DAT_1405f064f != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::Stop");
    }
    pvVar4 = *(void **)(param_1 + 0x6e0);
    if (pvVar4 != (void *)0x0) {
      FUN_1403596c0(pvVar4);
      operator_delete(pvVar4);
    }
    *(undefined8 *)(param_1 + 0x6e0) = 0;
    pvVar4 = *(void **)(param_1 + 0x6e8);
    if (pvVar4 != (void *)0x0) {
      FUN_1403596c0(pvVar4);
      operator_delete(pvVar4);
    }
    *(undefined8 *)(param_1 + 0x6e8) = 0;
    FUN_14035a250(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_1403556b0(lVar9);
          FUN_14034ff60(lVar9);
        }
        FUN_14034ff60(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_14000d450(0x80004005);
      }
      FUN_14036ec20(param_1 + -0xa8,*(undefined8 *)(lVar9 + 8));
      lVar9 = *(longlong *)(param_1 + 0xbf0);
    }
    FUN_14039c160(param_1 + 0xbd0);
    lVar9 = *(longlong *)(param_1 + 0x1660);
    while (lVar9 != 0) {
      if (*(longlong *)(param_1 + 0x1650) == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      FUN_14036ec20(param_1 + -0xa8,*(undefined8 *)(*(longlong *)(param_1 + 0x1650) + 0x10));
      lVar9 = *(longlong *)(param_1 + 0x1660);
    }
    FUN_140360d00(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_14000d450(0x80004005);
    }
    FUN_14039c160(lVar9);
    FUN_140379750(param_1 + 0x358);
    FUN_14036db90(param_1 + 0x620,0);
    FUN_140370170(param_1 + 0x648);
    FUN_14034edd0(uVar6);
    uVar6 = (**(code **)(*(longlong *)(param_1 + -0xa8) + 0x58))(param_1 + -0xa8);
    local_98 = uVar6;
    FUN_14034ed40(uVar6);
    local_90 = 1;
    if (DAT_1405f064f != '\0') {
      (**(code **)(*(longlong *)(param_1 + -0xa8) + 200))
                (param_1 + -0xa8,L"Proud::CNetServerImpl::Stop");
    }
    FUN_140379ee0(param_1 + 0x3b0);
    FUN_14039c160(param_1 + 0xbd0);
    FUN_140372840(param_1 + 0x230);
    FUN_140372840(param_1 + 0x288);
    FUN_140360d00(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_14034edd0(uVar6);
  }
  FUN_14034edd0(lVar1);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140383389)
// WARNING: Removing unreachable block (ram,0x00014038337e)

void FUN_140383020(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_14034ed40(uVar10);
  if (DAT_1405f064f != '\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_14034edd0(uVar10);
      return;
    }
    if (puVar13 == (ulonglong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    plVar1 = (longlong *)*puVar13;
    FUN_1403826a0(param_1,plVar1);
    uVar11 = (**(code **)(plVar1[0x21] + 0x10))();
    FUN_14034ed40(uVar11);
    local_b0 = 0;
    bVar6 = false;
    if (((longlong *)plVar1[0xe8] != (longlong *)0x0) &&
       (lVar12 = *(longlong *)plVar1[0xe8], lVar12 != 0)) {
      local_b0 = lVar12 + 0xa8;
      FUN_14034ed40();
      bVar6 = true;
    }
    FUN_14034ed40();
    FUN_14034ed40();
    iVar8 = FUN_1403a0540(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_1403831f5:
      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_1403a0540(lVar12 + 0x40);
          if (iVar9 == 0) goto LAB_1403831f5;
        }
      }
      bVar4 = false;
    }
    if (((plVar1[4] == 0) && (cVar7 = (**(code **)(plVar1[1] + 0x18))(), cVar7 == '\0')) &&
       (plVar1[0x24] == 0)) {
      bVar5 = false;
    }
    else {
      bVar5 = true;
    }
    FUN_14034edd0(uVar11);
    if (((iVar8 != 0) || (!bVar3)) || ((!bVar4 || (bVar5)))) {
      puVar14 = (ulonglong *)puVar13[2];
    }
    else {
      FUN_14036ec20(param_1,plVar1);
      puVar14 = (ulonglong *)puVar13[2];
      FUN_140360170(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_1403832ff;
          if ((longlong *)*puVar13 == plVar1) break;
          puVar13 = (ulonglong *)puVar13[2];
        }
        FUN_140360170(param_1 + 0x2e8,puVar13,0);
      }
LAB_1403832ff:
      if (bVar6) {
        FUN_14034edd0(local_b0);
        bVar6 = false;
      }
      (**(code **)(*plVar1 + 8))(plVar1,1);
    }
    FUN_14034edd0(param_1 + 0xfa);
    FUN_14034edd0(param_1 + 0xf3);
    puVar13 = puVar14;
    if (bVar6) {
      FUN_14034edd0(local_b0);
    }
  } while( true );
}



void FUN_1403833c0(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_140382880(param_1 + 0x15);
  plVar1 = param_1 + 0x25;
  FUN_14034ed40(plVar1);
  if (DAT_1405f064f != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetServerImpl::~CNetServerImpl");
  }
  FUN_1403867b0(param_1);
  FUN_14034edd0(plVar1);
  param_1[0x309] = (longlong)Proud::CFastArray<int,0>::vftable;
  if (param_1[0x30b] != 0) {
    if ((longlong *)param_1[0x30a] == (longlong *)0x0) {
      FUN_14034ff60(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_140394590(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_14034ff60();
    }
    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_14034ff60();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,param_1[0x2f6]);
    }
  }
  FUN_140360b20(param_1 + 0x2e8);
  FUN_140363ad0(param_1 + 0x2dd);
  FUN_140359a60(param_1 + 0x19a);
  FUN_140360b20(param_1 + 399);
  FUN_1403555d0(param_1 + 0x18a);
  FUN_1403a4fa0(param_1 + 0x189);
  FUN_1403555d0(param_1 + 0x182);
  FUN_14035e690(param_1 + 0x105);
  FUN_14035e580(param_1 + 0x101);
  FUN_14034edf0(param_1 + 0xfa);
  FUN_14034edf0(param_1 + 0xf3);
  pvVar2 = (void *)param_1[0xf2];
  if (pvVar2 != (void *)0x0) {
    FUN_1403596c0(pvVar2);
    operator_delete(pvVar2);
  }
  pvVar2 = (void *)param_1[0xf1];
  if (pvVar2 != (void *)0x0) {
    FUN_1403596c0(pvVar2);
    operator_delete(pvVar2);
  }
  FUN_1403639c0(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_1403556b0(lVar4);
      FUN_14034ff60(lVar4);
    }
    FUN_14034ff60(plVar3);
  }
  FUN_140372820(param_1 + 0xde);
  param_1[0xd9] = (longlong)Proud::CFastArray<>::vftable;
  if (0 < (int)param_1[0xdc]) {
    FUN_1403d8da0(param_1[0xdb],(longlong)(int)param_1[0xdc]);
  }
  if (param_1[0xdb] != 0) {
    plVar3 = (longlong *)param_1[0xda];
    if (plVar3 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,param_1[0xdb]);
    }
  }
  FUN_140385b20(param_1 + 0x95);
  FUN_140388ea0(param_1 + 0x90);
  puVar5 = (undefined8 *)param_1[0x8f];
  if (puVar5 != (undefined8 *)0x0) {
    (**(code **)*puVar5)(puVar5,1);
  }
  FUN_140379ee0(param_1 + 0x8b);
  puVar5 = (undefined8 *)param_1[0x8b];
  if (puVar5 != (undefined8 *)0x0) {
    (**(code **)*puVar5)(puVar5,1);
  }
  FUN_140379a70(param_1 + 0x80);
  pvVar2 = (void *)param_1[0x7c];
  if (pvVar2 != (void *)0x0) {
    FUN_14038e820(pvVar2);
    operator_delete(pvVar2);
  }
  FUN_140363ad0(param_1 + 0x71);
  FUN_1403733f0(param_1 + 0x66);
  FUN_1403733f0(param_1 + 0x5b);
  FUN_140360b20(param_1 + 0x50);
  FUN_14000d2c0(param_1 + 0x43);
  FUN_14000d2c0(param_1 + 0x42);
  FUN_14034edf0(param_1 + 0x2c);
  FUN_14034edf0(plVar1);
  param_1[0x24] = (longlong)Proud::IUserTaskQueueOwner::vftable;
  param_1[0x23] = (longlong)Proud::IVizAgentDg::vftable;
  param_1[0x17] = (longlong)Proud::CP2PGroupMemberBase_S::vftable;
  FUN_140379a70(param_1 + 0x18);
  param_1[0x16] = (longlong)Proud::ICompletionContext::vftable;
  param_1[0x15] = (longlong)Proud::IRmiHost::vftable;
  FUN_1403a6c70(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_140386450(param_1);
  return;
}



// WARNING: Removing unreachable block (ram,0x000140383afd)

void FUN_1403838a0(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_14034ed40(uVar6);
  if (DAT_1405f064f != '\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_1403826a0(param_1,plVar2);
      if (((char)plVar2[0xe0] != '\0') && (DAT_1405d80f8 * 10.0 < dVar10 - (double)plVar2[0x33])) {
        (**(code **)(param_1[0x95] + 0xd0))(param_1 + 0x95,(int)plVar2[0xdf],&DAT_1405f2490);
      }
      FUN_14036bf20(param_1,plVar2,dVar10);
      FUN_140372610(param_1,plVar2);
    }
    else {
      if (param_1[0x2fe] != 0) {
        FUN_14034fe70();
        local_res8 = PTR_DAT_1405d8010;
        uVar5 = (**(code **)(*plVar2 + 0x10))(plVar2);
        FUN_140017720(&local_res8,&DAT_140455e00,uVar5);
        puVar3 = local_res8;
        puVar9 = local_res8;
        if (local_res8 == (undefined *)0x0) {
          puVar9 = PTR_DAT_1405d8010;
        }
        FUN_1403935f0(param_1[0x2fe],0,puVar9);
        if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
           (puVar3 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_14034fe70();
          FUN_14034ed40(uVar7);
          piVar1 = (int *)(puVar3 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar3 + -8);
          }
          FUN_14034edd0(uVar7);
        }
      }
      local_68 = 0;
      local_60 = 0;
      local_58 = 0;
      local_50 = 0;
      local_70 = Proud::ByteArray::vftable;
      FUN_140381580(param_1,plVar2,0xb,7,&local_70,L"Proud::CNetServerImpl::HeartBeat_PerClient",0);
      FUN_1403555d0(&local_70);
    }
    lVar4 = 0;
    if (lVar8 != 0) {
      lVar4 = *(longlong *)(lVar8 + 0x10);
    }
  }
  FUN_14034edd0(uVar6);
  return;
}



void FUN_140383b40(undefined8 param_1)

{
  FUN_14037fd40();
  FUN_140381e00(param_1);
  FUN_14037f1a0(param_1);
  FUN_14037f600(param_1);
  FUN_14037f9a0(param_1);
  FUN_1403732b0(param_1);
  FUN_14035c790(param_1);
  return;
}



void * FUN_140383b90(void *param_1,uint param_2)

{
  FUN_1403833c0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



longlong * FUN_140383bc0(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_140383be0(longlong *param_1)

{
  *(char *)(*param_1 + 0x20) = (char)param_1[1];
  return;
}



void FUN_140383bf0(longlong *param_1)

{
  longlong lVar1;
  undefined1 local_58 [80];
  
  if (param_1[1] != 0) {
    FUN_14034f420(local_58,PTR_u_Cannot_use_internal_buffer_becau_1405d94e0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*param_1 == 0) {
    lVar1 = FUN_1403996d0();
    *param_1 = lVar1;
    *(undefined8 *)(lVar1 + 0x28) = 1;
  }
  return;
}



void FUN_140383c40(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined1 local_58 [80];
  
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14034f420(local_58,PTR_u_Cannot_use_internal_buffer_becau_1405d94e0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*(longlong *)(param_1 + 8) == 0) {
    lVar2 = FUN_1403996d0();
    *(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_140383cc0(undefined8 *param_1)

{
  *param_1 = 0;
  FUN_140399690(param_1 + 1);
  param_1[3] = 0;
  param_1[2] = 0;
  return;
}



void FUN_140383cf0(longlong *param_1,longlong param_2,int param_3)

{
  undefined1 local_58 [88];
  
  if (*param_1 != 0) {
    FUN_14034f420(local_58,PTR_u_Cannot_use_external_buffer_becau_1405d94d8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (param_1[1] != 0) {
    FUN_14034f420(local_58,PTR_u_Cannot_use_internal_buffer_becau_1405d94e0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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;
}



longlong FUN_140383d70(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_140399790();
    }
    if (*(int *)(lVar1 + 0x18) != 0) {
      return *(longlong *)(lVar1 + 0x10);
    }
    lVar1 = 0;
  }
  return lVar1;
}



void FUN_140383db0(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_140399790();
    }
    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_140399790();
      }
      iVar1 = param_1[6];
    }
    else {
      iVar1 = *(int *)(lVar2 + 0x18);
    }
    FUN_14034f420(local_50,&DAT_140456410,iVar1,param_2);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  *param_1 = param_2 * 8;
  return;
}



void FUN_140383e30(longlong param_1,undefined8 param_2,int param_3)

{
  undefined1 local_58 [88];
  
  if (DAT_1405d8140 < param_3) {
    FUN_14034f420(local_58,L"UseExternalBuffer failed due to too large capacity");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  FUN_140383cf0(param_1 + 8);
  return;
}



undefined8 FUN_140383e70(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_14034f420(local_58,L"Cannot read from Null pointer message!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  uVar4 = *param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar4;
  iVar5 = (int)uVar2 >> 3;
  if ((uVar2 & 7) != uVar4) {
    FUN_14034f420(local_58,L"Read offset is not byte aligned!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (lVar3 == 0) {
    if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
    }
    if (*(int *)(lVar3 + 0x18) == 0) {
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(lVar3 + 0x10);
    }
  }
  else {
    lVar3 = *(longlong *)(param_1 + 4);
    if (lVar3 == 0) {
      FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  FUN_14000d3f0(param_2,iVar5 + lVar3,(longlong)param_3);
  *param_1 = *param_1 + param_3 * 8;
  return 1;
}



undefined4 FUN_140383fa0(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_14034f420(local_58,L"Cannot read from Null pointer message!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  uVar3 = *param_1 >> 0x1f & 7;
  uVar2 = *param_1 + uVar3;
  iVar4 = (int)uVar2 >> 3;
  if ((uVar2 & 7) != uVar3) {
    FUN_14034f420(local_58,L"Read offset is not byte aligned!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_140399790();
}



void FUN_140384050(int *param_1)

{
  int iVar1;
  char cVar2;
  char local_res8 [32];
  undefined1 local_58 [80];
  
  if ((char)param_1[8] != '\0') {
    cVar2 = FUN_140383e70(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_140399790();
        }
        iVar1 = param_1[6];
      }
      else {
        iVar1 = *(int *)(*(longlong *)(param_1 + 2) + 0x18);
      }
      FUN_14034f420(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_1405d36c0);
    }
  }
  return;
}



undefined1 FUN_1403840e0(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_140383e70(param_1,param_2);
    if (cVar1 == '\0') {
      return 0;
    }
    FUN_140384050(param_1);
  }
  return 1;
}



undefined1 FUN_140384140(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_140383fa0(param_1,param_2);
  if (cVar2 == '\0') {
    *param_1 = uVar1;
    return 0;
  }
  FUN_140384050(param_1);
  *param_1 = uVar1;
  return 1;
}



undefined4 * FUN_1403841b0(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_1403841e0(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_140399690(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_140384280(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_140399690(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_140399690(param_2);
  if (param_2[1] != 0) {
    if (*(int *)((longlong)param_2 + 0x14) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_2 + 2) = 0;
  }
  return;
}



void FUN_140384310(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_14034f7d0();
      }
      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_140399790();
    }
    FUN_1400179d0(lVar1,param_2);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



longlong FUN_140384370(int *param_1,int param_2)

{
  longlong lVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined1 local_58 [80];
  
  FUN_140384050();
  lVar1 = *(longlong *)(param_1 + 2);
  if ((lVar1 == 0) && (*(longlong *)(param_1 + 4) == 0)) {
    FUN_14034f420(local_58,&DAT_140456620);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar3 = *param_1;
  if (lVar1 == 0) {
    if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140384410(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_140399790();
    }
    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_140399790();
    }
    if (*(int *)(lVar2 + 0x18) == 0) {
      lVar2 = 0;
    }
    else {
      lVar2 = *(longlong *)(lVar2 + 0x10);
    }
  }
  else {
    lVar2 = *(longlong *)(param_1 + 4);
    if (lVar2 == 0) {
      FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  if (DAT_1405d8140 < param_3) {
    FUN_14034f420(local_58,L"UseExternalBuffer failed due to too large capacity");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  FUN_140383cf0(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_14034f7d0();
  }
  if (*(longlong *)(param_2 + 4) == 0) {
    lVar2 = *(longlong *)(param_2 + 2);
    if (param_3 < 1) {
      if (lVar2 == 0) goto LAB_140384553;
      iVar3 = 0;
    }
    else {
      iVar3 = param_3;
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
    }
    FUN_1400179d0(lVar2,iVar3);
  }
  else {
    if (param_2[7] < param_3) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    param_2[6] = param_3;
  }
LAB_140384553:
  FUN_140384370(param_1,param_3);
  return 1;
}



void FUN_140384590(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_14034f420(local_b8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_b8,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (lVar8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_140399790();
        }
        if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        if (iVar1 != 0) {
          iVar2 = *(int *)(lVar5 + 0x18);
          FUN_1400179d0(lVar5,iVar2 + iVar1);
          if (*(int *)(lVar5 + 0x18) == 0) {
            lVar5 = 0;
          }
          else {
            lVar5 = *(longlong *)(lVar5 + 0x10);
          }
          lVar5 = lVar5 + iVar2;
          goto LAB_14038467f;
        }
      }
      else {
        if (iVar1 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        if (iVar1 != 0) {
          if (*(longlong *)(param_1 + 0x10) == 0) {
            FUN_14034f420(local_70,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
            _CxxThrowException(local_70,(ThrowInfo *)&DAT_1405d36c0);
          }
          iVar2 = *(int *)(param_1 + 0x18);
          iVar4 = iVar2 + iVar1;
          if ((iVar4 < 0) || (*(int *)(param_1 + 0x1c) < iVar4)) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          *(int *)(param_1 + 0x18) = iVar4;
          lVar5 = (longlong)iVar2 + *(longlong *)(param_1 + 0x10);
LAB_14038467f:
          FUN_14000d3f0(lVar5,uVar3,(longlong)iVar1);
        }
      }
      lVar5 = *(longlong *)(param_2 + 0xc80);
      iVar7 = iVar7 + 1;
      lVar8 = lVar8 + 1;
      lVar6 = lVar6 + 0x10;
    } while (lVar5 != 0);
  }
  FUN_14034f420(local_b8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_b8,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_140384750(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1400178c0(param_1 + 0x10);
    return;
  }
  if (*(longlong *)(param_1 + 8) != 0) {
    FUN_140017a90();
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_140399790();
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140384780(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_1405d84f0 ^ (ulonglong)auStack_158;
  lVar5 = *(longlong *)(param_1 + 2);
  if (lVar5 == 0) {
    if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
    }
    if (*(int *)(lVar5 + 0x18) == 0) {
      lVar5 = 0;
    }
    else {
      lVar5 = *(longlong *)(lVar5 + 0x10);
    }
  }
  else {
    lVar5 = *(longlong *)(param_1 + 4);
    if (lVar5 == 0) {
      FUN_14034f420(local_138,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_138,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  uVar4 = FUN_1403a7bc0(local_a8,iVar2 + lVar5,iVar1 - iVar2);
  if ((char)uVar4 != '\0') {
    *param_2 = local_30;
    FUN_140384050(param_1);
    lVar5 = *(longlong *)(param_1 + 2);
    if ((lVar5 == 0) && (*(longlong *)(param_1 + 4) == 0)) {
      FUN_14034f420(local_138,&DAT_140456620);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_138,(ThrowInfo *)&DAT_1405d36c0);
    }
    iVar1 = *param_1;
    if (lVar5 == 0) {
      if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_1403848f0(undefined8 *param_1)

{
  FUN_140057b50(*param_1);
  return;
}



void FUN_140384900(undefined8 *param_1)

{
  FUN_140002fe0(*param_1);
  return;
}



undefined8 FUN_140384910(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_140383e70(param_1,local_res8,1);
  if (cVar1 != '\0') {
    FUN_140384050(param_1);
    *param_2 = (uint)local_res8[0];
    return 1;
  }
  return 0;
}



undefined8 FUN_140384990(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_140383e70(param_1,local_res8,1);
  if (cVar1 != '\0') {
    FUN_140384050(param_1);
    *param_2 = (uint)local_res8[0];
    return 1;
  }
  return 0;
}



undefined8 FUN_140384a10(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_140383e70(param_1,local_res8,1);
  if (cVar1 != '\0') {
    FUN_140384050(param_1);
    *param_2 = (uint)local_res8[0];
    return 1;
  }
  return 0;
}



undefined8 FUN_140384a90(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_140383e70(param_1,local_res8,2);
  if (cVar1 != '\0') {
    FUN_140384050(param_1);
    *param_2 = (uint)local_res8[0];
    return 1;
  }
  return 0;
}



ulonglong FUN_140384b10(undefined8 param_1,longlong param_2)

{
  ulonglong uVar1;
  
  *(undefined4 *)(param_2 + 8) = DAT_1405d83d0;
  *(undefined2 *)(param_2 + 0xc) = DAT_1405d83d4;
  uVar1 = FUN_140017880();
  if ((char)uVar1 == '\x01') {
    uVar1 = FUN_1400581b0(param_1,(undefined2 *)(param_2 + 0xc));
    if ((char)uVar1 == '\x01') {
      return uVar1;
    }
  }
  return uVar1 & 0xffffffffffffff00;
}



undefined8 FUN_140384b70(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_140383e70(param_1,local_res8,4);
  if (cVar1 != '\0') {
    FUN_140384050(param_1);
    *param_2 = local_res8[0];
    return 1;
  }
  return 0;
}



undefined1 FUN_140384bf0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  
  cVar1 = FUN_140384a10();
  if (cVar1 != '\0') {
    cVar1 = FUN_140017880(param_1,param_2 + 4);
    if (cVar1 != '\0') {
      cVar1 = FUN_140058000(param_1,param_2 + 8);
      if (cVar1 != '\0') {
        cVar1 = FUN_140384990(param_1,param_2 + 0x10);
        if (cVar1 != '\0') {
          cVar1 = FUN_140017880(param_1,param_2 + 0x14);
          if (cVar1 != '\0') {
            cVar1 = FUN_1400581f0(param_1,param_2 + 0x18);
            if (cVar1 != '\0') {
              cVar1 = FUN_140017880(param_1,param_2 + 0x1c);
              if (cVar1 != '\0') {
                cVar1 = FUN_140017880(param_1,param_2 + 0x20);
                if (cVar1 != '\0') {
                  cVar1 = FUN_1400581f0(param_1,param_2 + 0x24);
                  if (cVar1 != '\0') {
                    cVar1 = FUN_1400581f0(param_1,param_2 + 0x25);
                    if (cVar1 != '\0') {
                      cVar1 = FUN_1400581f0(param_1,param_2 + 0x26);
                      if (cVar1 != '\0') {
                        cVar1 = FUN_1400581f0(param_1,param_2 + 0x27);
                        if (cVar1 != '\0') {
                          cVar1 = FUN_140017880(param_1,param_2 + 0x28);
                          if (cVar1 != '\0') {
                            cVar1 = FUN_1400581f0(param_1,param_2 + 0x2c);
                            if (cVar1 != '\0') {
                              cVar1 = FUN_1400581f0(param_1,param_2 + 0x2d);
                              if (cVar1 != '\0') {
                                return 1;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return 0;
}



undefined1 FUN_140384d20(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  int iVar4;
  ulonglong local_res18 [2];
  
  cVar1 = FUN_140384780(param_1,local_res18);
  if (cVar1 == '\0') {
    return 0;
  }
  iVar4 = (int)local_res18[0];
  if ((-1 < iVar4) && (iVar4 <= DAT_1405d8140)) {
    FUN_140394870(param_2,local_res18[0] & 0xffffffff);
    if (*(int *)(param_2 + 0x18) == 0) {
      uVar3 = 0;
    }
    else {
      uVar3 = *(undefined8 *)(param_2 + 0x10);
    }
    uVar2 = FUN_1403840e0(param_1,uVar3,iVar4 * 8);
    return uVar2;
  }
  return 0;
}



void FUN_140384db0(undefined8 param_1,longlong param_2)

{
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 8));
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 0xc));
  return;
}



undefined1 thunk_FUN_140384d20(undefined8 param_1,longlong param_2)

{
  char cVar1;
  undefined1 uVar2;
  undefined8 uVar3;
  int iVar4;
  ulonglong auStackX_18 [2];
  
  cVar1 = FUN_140384780(param_1,auStackX_18);
  if (cVar1 == '\0') {
    return 0;
  }
  iVar4 = (int)auStackX_18[0];
  if ((-1 < iVar4) && (iVar4 <= DAT_1405d8140)) {
    FUN_140394870(param_2,auStackX_18[0] & 0xffffffff);
    if (*(int *)(param_2 + 0x18) == 0) {
      uVar3 = 0;
    }
    else {
      uVar3 = *(undefined8 *)(param_2 + 0x10);
    }
    uVar2 = FUN_1403840e0(param_1,uVar3,iVar4 * 8);
    return uVar2;
  }
  return 0;
}



void FUN_140384df0(undefined8 param_1,undefined1 *param_2)

{
  FUN_140058870(param_1,*param_2);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 4));
  FUN_140058670(param_1,*(undefined8 *)(param_2 + 8));
  FUN_140058870(param_1,param_2[0x10]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x14));
  FUN_140058870(param_1,param_2[0x18]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x1c));
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x20));
  FUN_140058870(param_1,param_2[0x24]);
  FUN_140058870(param_1,param_2[0x25]);
  FUN_140058870(param_1,param_2[0x26]);
  FUN_140058870(param_1,param_2[0x27]);
  FUN_140058470(param_1,*(undefined4 *)(param_2 + 0x28));
  FUN_140058870(param_1,param_2[0x2c]);
  FUN_140058870(param_1,param_2[0x2d]);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 FUN_140384ec0(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_1405d84f0 ^ (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_140383e70(param_1,local_f8,1);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_140384050(param_1);
  cVar1 = FUN_140384780(param_1,&local_f0);
  piVar5 = local_f0;
  if (cVar1 == '\0') {
    return 0;
  }
  iVar10 = (int)local_f0;
  if ((iVar10 < 0) || (0x100000 < iVar10)) {
    FUN_14034f420(&local_c8,L"CMessage.ReadString failed! length=%d",
                  (ulonglong)local_f0 & 0xffffffff);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&local_c8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_f8[0] == '\x01') {
    local_f0 = param_2;
    local_e8 = (undefined1 *)FUN_140057a60(param_2,iVar10 + 1);
    *local_e8 = 0;
    local_e8[iVar10] = 0;
    uVar2 = FUN_1403840e0(param_1,local_e8,(ulonglong)piVar5 & 0xffffffff);
    FUN_140057b50(param_2);
    return uVar2;
  }
  FUN_14034fe70();
  local_f0 = (int *)PTR_DAT_1405d8010;
  iVar4 = iVar10 + 1;
  local_e0 = &local_f0;
  if (iVar4 < 1) {
    iVar4 = 0;
  }
  iVar11 = 1;
  if (1 < iVar4) {
    iVar11 = iVar4;
  }
  if (iVar11 < 1) goto LAB_140385083;
  local_f0 = (int *)PTR_DAT_1405d8010;
  if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (iVar11 == 0) {
    FUN_1400031d0(&local_f0);
    goto LAB_140385083;
  }
  piVar5 = (int *)FUN_14034fef0((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_1405d8010)) {
    iVar4 = local_f0[-2];
  }
  piVar9 = (int *)PTR_DAT_1405d8010;
  if (iVar11 < iVar4) {
LAB_14038505d:
    if (local_f0 != (int *)0x0) {
      piVar9 = local_f0;
    }
  }
  else {
    iVar11 = 0;
    if (local_f0 != (int *)0x0) {
      if (local_f0 != (int *)PTR_DAT_1405d8010) {
        iVar11 = local_f0[-2];
      }
      goto LAB_14038505d;
    }
  }
  FUN_14034fd20(piVar5 + 2,piVar9,iVar11);
  FUN_1400031d0(&local_f0);
  local_f0 = piVar5 + 2;
LAB_140385083:
  FUN_140002e10(&local_f0);
  local_d8 = local_f0;
  if (local_f0 == (int *)0x0) {
    local_d8 = (int *)PTR_DAT_1405d8010;
  }
  *(undefined2 *)local_d8 = 0;
  *(undefined2 *)((longlong)local_d8 + (longlong)iVar10 * 2) = 0;
  cVar1 = FUN_1403840e0(param_1,local_d8,iVar10 * 2);
  if (cVar1 == '\0') {
    FUN_140002fe0(&local_f0);
    piVar5 = local_f0;
    if (((local_f0 != (int *)0x0) && (local_f0 != (int *)PTR_DAT_1405d8010)) &&
       (piVar9 = local_f0 + -2, piVar9 != (int *)0x0)) {
      uVar6 = FUN_14034fe70();
      local_e0 = (int **)uVar6;
      FUN_14034ed40(uVar6);
      local_d8 = (int *)CONCAT71(local_d8._1_7_,1);
      piVar5 = piVar5 + -1;
      *piVar5 = *piVar5 + -1;
      if (*piVar5 == 0) {
        FUN_14034ff60(piVar9);
      }
      FUN_14034edd0(uVar6);
    }
    return 0;
  }
  FUN_140002fe0(&local_f0);
  piVar5 = local_f0;
  if (local_f0 == (int *)0x0) {
    piVar5 = (int *)PTR_DAT_1405d8010;
  }
  local_c8 = local_c0;
  FUN_14034ef40(&local_c8,piVar5,3);
  FUN_14034f220(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_1405d8010)) &&
     (piVar9 = local_f0 + -2, piVar9 != (int *)0x0)) {
    uVar6 = FUN_14034fe70();
    local_e0 = (int **)uVar6;
    FUN_14034ed40(uVar6);
    local_d8 = (int *)CONCAT71(local_d8._1_7_,1);
    piVar5 = piVar5 + -1;
    *piVar5 = *piVar5 + -1;
    if (*piVar5 == 0) {
      FUN_14034ff60(piVar9);
    }
    FUN_14034edd0(uVar6);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 FUN_140385220(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_1405d84f0 ^ (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_140383e70(param_1,local_1c8,1);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_140384050(param_1);
  cVar1 = FUN_140384780(param_1,&local_1c0);
  piVar10 = local_1c0;
  if (cVar1 == '\0') {
    return 0;
  }
  iVar11 = (int)local_1c0;
  if ((iVar11 < 0) || (0x100000 < iVar11)) {
    FUN_14034f420(local_198,L"CMessage.ReadString failed! length=%d",
                  (ulonglong)local_1c0 & 0xffffffff);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_198,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_1c8[0] == '\x02') {
    local_1c0 = param_2;
    local_1b8 = (undefined2 *)FUN_140002f00(param_2,iVar11 + 1);
    *local_1b8 = 0;
    local_1b8[iVar11] = 0;
    uVar2 = FUN_1403840e0(param_1,local_1b8,iVar11 * 2);
    FUN_140002fe0(param_2);
    return uVar2;
  }
  FUN_14034fe70();
  local_1c0 = (int *)PTR_DAT_1405d8008;
  iVar4 = iVar11 + 1;
  local_1b0 = &local_1c0;
  if (iVar4 < 1) {
    iVar4 = 0;
  }
  iVar12 = 1;
  if (1 < iVar4) {
    iVar12 = iVar4;
  }
  if (iVar12 < 1) goto LAB_1403853e6;
  local_1c0 = (int *)PTR_DAT_1405d8008;
  if (iVar12 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (iVar12 == 0) {
    FUN_14000d2c0(&local_1c0);
    goto LAB_1403853e6;
  }
  piVar5 = (int *)FUN_14034fef0((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_1405d8008)) {
    iVar4 = local_1c0[-2];
  }
  piVar9 = (int *)PTR_DAT_1405d8008;
  if (iVar12 < iVar4) {
LAB_1403853c0:
    if (local_1c0 != (int *)0x0) {
      piVar9 = local_1c0;
    }
  }
  else {
    iVar12 = 0;
    if (local_1c0 != (int *)0x0) {
      if (local_1c0 != (int *)PTR_DAT_1405d8008) {
        iVar12 = local_1c0[-2];
      }
      goto LAB_1403853c0;
    }
  }
  FUN_14034fdc0(piVar5 + 2,piVar9,iVar12);
  FUN_14000d2c0(&local_1c0);
  local_1c0 = piVar5 + 2;
LAB_1403853e6:
  FUN_140057970(&local_1c0);
  local_1a8 = local_1c0;
  if (local_1c0 == (int *)0x0) {
    local_1a8 = (int *)PTR_DAT_1405d8008;
  }
  *(undefined1 *)local_1a8 = 0;
  *(undefined1 *)((longlong)iVar11 + (longlong)local_1a8) = 0;
  cVar1 = FUN_1403840e0(param_1,local_1a8,(ulonglong)piVar10 & 0xffffffff);
  if (cVar1 == '\0') {
    FUN_140057b50(&local_1c0);
    piVar10 = local_1c0;
    if (((local_1c0 != (int *)0x0) && (local_1c0 != (int *)PTR_DAT_1405d8008)) &&
       (piVar5 = local_1c0 + -2, piVar5 != (int *)0x0)) {
      uVar6 = FUN_14034fe70();
      local_1b0 = (int **)uVar6;
      FUN_14034ed40(uVar6);
      local_1a8 = (int *)CONCAT71(local_1a8._1_7_,1);
      piVar10 = piVar10 + -1;
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_14034ff60(piVar5);
      }
      FUN_14034edd0(uVar6);
    }
    return 0;
  }
  FUN_140057b50(&local_1c0);
  piVar10 = local_1c0;
  if (local_1c0 == (int *)0x0) {
    piVar10 = (int *)PTR_DAT_1405d8008;
  }
  local_148 = local_140;
  FUN_14012a1d0(&local_148,piVar10,3);
  FUN_14000d470(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_1405d8008)) &&
     (piVar5 = local_1c0 + -2, piVar5 != (int *)0x0)) {
    uVar6 = FUN_14034fe70();
    local_1b0 = (int **)uVar6;
    FUN_14034ed40(uVar6);
    local_1a8 = (int *)CONCAT71(local_1a8._1_7_,1);
    piVar10 = piVar10 + -1;
    *piVar10 = *piVar10 + -1;
    if (*piVar10 == 0) {
      FUN_14034ff60(piVar5);
    }
    FUN_14034edd0(uVar6);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140385580(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_1405d84f0 ^ (ulonglong)auStack_128;
  FUN_1403a7b30(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_140399790();
    }
LAB_1403855ed:
    if ((int)local_48 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (*(longlong *)(param_1 + 0x10) == 0) {
      FUN_14034f420(local_108,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_108,(ThrowInfo *)&DAT_1405d36c0);
    }
    iVar2 = *(int *)(param_1 + 0x18);
    iVar5 = iVar2 + local_48;
    if ((iVar5 < 0) || (*(int *)(param_1 + 0x1c) < iVar5)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(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_14038573f;
    }
  }
  else {
    if (*(longlong *)(param_1 + 0x10) != 0) goto LAB_1403855ed;
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    if ((int)local_48 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    iVar2 = *(int *)(lVar3 + 0x18);
    FUN_1400179d0(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_14038573f;
    }
  }
  memcpy(_Dst,local_ac,uVar10);
LAB_14038573f:
  FUN_140017b00(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 thunk_FUN_140384ec0(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_1405d84f0 ^ (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_140383e70(param_1,acStack_f8,1);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_140384050(param_1);
  cVar1 = FUN_140384780(param_1,&piStack_f0);
  piVar5 = piStack_f0;
  if (cVar1 == '\0') {
    return 0;
  }
  iVar10 = (int)piStack_f0;
  if ((iVar10 < 0) || (0x100000 < iVar10)) {
    FUN_14034f420(&puStack_c8,L"CMessage.ReadString failed! length=%d",
                  (ulonglong)piStack_f0 & 0xffffffff);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&puStack_c8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (acStack_f8[0] == '\x01') {
    piStack_f0 = param_2;
    puStack_e8 = (undefined1 *)FUN_140057a60(param_2,iVar10 + 1);
    *puStack_e8 = 0;
    puStack_e8[iVar10] = 0;
    uVar2 = FUN_1403840e0(param_1,puStack_e8,(ulonglong)piVar5 & 0xffffffff);
    FUN_140057b50(param_2);
    return uVar2;
  }
  FUN_14034fe70();
  piStack_f0 = (int *)PTR_DAT_1405d8010;
  iVar4 = iVar10 + 1;
  ppiStack_e0 = &piStack_f0;
  if (iVar4 < 1) {
    iVar4 = 0;
  }
  iVar11 = 1;
  if (1 < iVar4) {
    iVar11 = iVar4;
  }
  if (iVar11 < 1) goto LAB_140385083;
  piStack_f0 = (int *)PTR_DAT_1405d8010;
  if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (iVar11 == 0) {
    FUN_1400031d0(&piStack_f0);
    goto LAB_140385083;
  }
  piVar5 = (int *)FUN_14034fef0((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_1405d8010)) {
    iVar4 = piStack_f0[-2];
  }
  piVar9 = (int *)PTR_DAT_1405d8010;
  if (iVar11 < iVar4) {
LAB_14038505d:
    if (piStack_f0 != (int *)0x0) {
      piVar9 = piStack_f0;
    }
  }
  else {
    iVar11 = 0;
    if (piStack_f0 != (int *)0x0) {
      if (piStack_f0 != (int *)PTR_DAT_1405d8010) {
        iVar11 = piStack_f0[-2];
      }
      goto LAB_14038505d;
    }
  }
  FUN_14034fd20(piVar5 + 2,piVar9,iVar11);
  FUN_1400031d0(&piStack_f0);
  piStack_f0 = piVar5 + 2;
LAB_140385083:
  FUN_140002e10(&piStack_f0);
  piStack_d8 = piStack_f0;
  if (piStack_f0 == (int *)0x0) {
    piStack_d8 = (int *)PTR_DAT_1405d8010;
  }
  *(undefined2 *)piStack_d8 = 0;
  *(undefined2 *)((longlong)piStack_d8 + (longlong)iVar10 * 2) = 0;
  cVar1 = FUN_1403840e0(param_1,piStack_d8,iVar10 * 2);
  if (cVar1 == '\0') {
    FUN_140002fe0(&piStack_f0);
    piVar5 = piStack_f0;
    if (((piStack_f0 != (int *)0x0) && (piStack_f0 != (int *)PTR_DAT_1405d8010)) &&
       (piVar9 = piStack_f0 + -2, piVar9 != (int *)0x0)) {
      uVar6 = FUN_14034fe70();
      ppiStack_e0 = (int **)uVar6;
      FUN_14034ed40(uVar6);
      piStack_d8 = (int *)CONCAT71(piStack_d8._1_7_,1);
      piVar5 = piVar5 + -1;
      *piVar5 = *piVar5 + -1;
      if (*piVar5 == 0) {
        FUN_14034ff60(piVar9);
      }
      FUN_14034edd0(uVar6);
    }
    return 0;
  }
  FUN_140002fe0(&piStack_f0);
  piVar5 = piStack_f0;
  if (piStack_f0 == (int *)0x0) {
    piVar5 = (int *)PTR_DAT_1405d8010;
  }
  puStack_c8 = auStack_c0;
  FUN_14034ef40(&puStack_c8,piVar5,3);
  FUN_14034f220(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_1405d8010)) &&
     (piVar9 = piStack_f0 + -2, piVar9 != (int *)0x0)) {
    uVar6 = FUN_14034fe70();
    ppiStack_e0 = (int **)uVar6;
    FUN_14034ed40(uVar6);
    piStack_d8 = (int *)CONCAT71(piStack_d8._1_7_,1);
    piVar5 = piVar5 + -1;
    *piVar5 = *piVar5 + -1;
    if (*piVar5 == 0) {
      FUN_14034ff60(piVar9);
    }
    FUN_14034edd0(uVar6);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 thunk_FUN_140385220(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_1405d84f0 ^ (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_140383e70(param_1,acStack_1c8,1);
  if (cVar1 == '\0') {
    return 0;
  }
  FUN_140384050(param_1);
  cVar1 = FUN_140384780(param_1,&piStack_1c0);
  piVar10 = piStack_1c0;
  if (cVar1 == '\0') {
    return 0;
  }
  iVar11 = (int)piStack_1c0;
  if ((iVar11 < 0) || (0x100000 < iVar11)) {
    FUN_14034f420(auStack_198,L"CMessage.ReadString failed! length=%d",
                  (ulonglong)piStack_1c0 & 0xffffffff);
                    // WARNING: Subroutine does not return
    _CxxThrowException(auStack_198,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (acStack_1c8[0] == '\x02') {
    piStack_1c0 = param_2;
    puStack_1b8 = (undefined2 *)FUN_140002f00(param_2,iVar11 + 1);
    *puStack_1b8 = 0;
    puStack_1b8[iVar11] = 0;
    uVar2 = FUN_1403840e0(param_1,puStack_1b8,iVar11 * 2);
    FUN_140002fe0(param_2);
    return uVar2;
  }
  FUN_14034fe70();
  piStack_1c0 = (int *)PTR_DAT_1405d8008;
  iVar4 = iVar11 + 1;
  ppiStack_1b0 = &piStack_1c0;
  if (iVar4 < 1) {
    iVar4 = 0;
  }
  iVar12 = 1;
  if (1 < iVar4) {
    iVar12 = iVar4;
  }
  if (iVar12 < 1) goto LAB_1403853e6;
  piStack_1c0 = (int *)PTR_DAT_1405d8008;
  if (iVar12 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (iVar12 == 0) {
    FUN_14000d2c0(&piStack_1c0);
    goto LAB_1403853e6;
  }
  piVar5 = (int *)FUN_14034fef0((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_1405d8008)) {
    iVar4 = piStack_1c0[-2];
  }
  piVar9 = (int *)PTR_DAT_1405d8008;
  if (iVar12 < iVar4) {
LAB_1403853c0:
    if (piStack_1c0 != (int *)0x0) {
      piVar9 = piStack_1c0;
    }
  }
  else {
    iVar12 = 0;
    if (piStack_1c0 != (int *)0x0) {
      if (piStack_1c0 != (int *)PTR_DAT_1405d8008) {
        iVar12 = piStack_1c0[-2];
      }
      goto LAB_1403853c0;
    }
  }
  FUN_14034fdc0(piVar5 + 2,piVar9,iVar12);
  FUN_14000d2c0(&piStack_1c0);
  piStack_1c0 = piVar5 + 2;
LAB_1403853e6:
  FUN_140057970(&piStack_1c0);
  piStack_1a8 = piStack_1c0;
  if (piStack_1c0 == (int *)0x0) {
    piStack_1a8 = (int *)PTR_DAT_1405d8008;
  }
  *(undefined1 *)piStack_1a8 = 0;
  *(undefined1 *)((longlong)iVar11 + (longlong)piStack_1a8) = 0;
  cVar1 = FUN_1403840e0(param_1,piStack_1a8,(ulonglong)piVar10 & 0xffffffff);
  if (cVar1 == '\0') {
    FUN_140057b50(&piStack_1c0);
    piVar10 = piStack_1c0;
    if (((piStack_1c0 != (int *)0x0) && (piStack_1c0 != (int *)PTR_DAT_1405d8008)) &&
       (piVar5 = piStack_1c0 + -2, piVar5 != (int *)0x0)) {
      uVar6 = FUN_14034fe70();
      ppiStack_1b0 = (int **)uVar6;
      FUN_14034ed40(uVar6);
      piStack_1a8 = (int *)CONCAT71(piStack_1a8._1_7_,1);
      piVar10 = piVar10 + -1;
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_14034ff60(piVar5);
      }
      FUN_14034edd0(uVar6);
    }
    return 0;
  }
  FUN_140057b50(&piStack_1c0);
  piVar10 = piStack_1c0;
  if (piStack_1c0 == (int *)0x0) {
    piVar10 = (int *)PTR_DAT_1405d8008;
  }
  puStack_148 = auStack_140;
  FUN_14012a1d0(&puStack_148,piVar10,3);
  FUN_14000d470(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_1405d8008)) &&
     (piVar5 = piStack_1c0 + -2, piVar5 != (int *)0x0)) {
    uVar6 = FUN_14034fe70();
    ppiStack_1b0 = (int **)uVar6;
    FUN_14034ed40(uVar6);
    piStack_1a8 = (int *)CONCAT71(piStack_1a8._1_7_,1);
    piVar10 = piVar10 + -1;
    *piVar10 = *piVar10 + -1;
    if (*piVar10 == 0) {
      FUN_14034ff60(piVar5);
    }
    FUN_14034edd0(uVar6);
  }
  return 1;
}



void FUN_1403857a0(undefined8 param_1,undefined8 param_2,uint param_3)

{
  undefined1 local_58 [80];
  
  if (param_3 < 0x100001) {
    FUN_140058870(param_1,1);
    FUN_140385580(param_1,(longlong)(int)param_3);
    FUN_140017be0(param_1,param_2,param_3);
    return;
  }
  FUN_14034f420(local_58,L"CMessage.WriteString failed! length=%d",param_3);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_140385820(undefined8 param_1,undefined8 param_2,uint param_3)

{
  undefined1 local_58 [80];
  
  if (param_3 < 0x100001) {
    FUN_140058870(param_1,2);
    FUN_140385580(param_1,(longlong)(int)param_3);
    FUN_140017be0(param_1,param_2,param_3 * 2);
    return;
  }
  FUN_14034f420(local_58,L"CMessage.WriteString failed! length=%d",param_3);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_1403858a0(undefined8 param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  
  iVar1 = *(int *)(param_2 + 0x18);
  FUN_140385580(param_1,(longlong)iVar1);
  if (*(int *)(param_2 + 0x18) == 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = *(undefined8 *)(param_2 + 0x10);
  }
  FUN_140017be0(param_1,uVar2,iVar1 * 8);
  return;
}



undefined1 FUN_1403858f0(undefined8 param_1,longlong param_2)

{
  char cVar1;
  
  cVar1 = FUN_140384ec0();
  if (cVar1 != '\0') {
    cVar1 = FUN_1400581b0(param_1,param_2 + 8);
    if (cVar1 != '\0') {
      return 1;
    }
  }
  return 0;
}



void FUN_140385940(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined *puVar2;
  
  puVar1 = (undefined *)*param_2;
  if ((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1405d8008)) {
    puVar2 = puVar1;
    if (puVar1 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1405d8008;
    }
    FUN_1403857a0(param_1,puVar2,*(undefined4 *)(puVar1 + -8));
    return;
  }
  if (puVar1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8008;
  }
  FUN_1403857a0(param_1,puVar1,0);
  return;
}



void FUN_140385980(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_14034f420(local_58,L"WriteString failed! length=%I64d",uVar2);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  FUN_1403857a0(param_1,param_2,uVar2 & 0xffffffff);
  return;
}



void FUN_1403859e0(undefined8 param_1,longlong *param_2)

{
  undefined *puVar1;
  undefined *puVar2;
  
  puVar1 = (undefined *)*param_2;
  if ((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1405d8010)) {
    puVar2 = puVar1;
    if (puVar1 == (undefined *)0x0) {
      puVar2 = PTR_DAT_1405d8010;
    }
    FUN_140385820(param_1,puVar2,*(undefined4 *)(puVar1 + -8));
    return;
  }
  if (puVar1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8010;
  }
  FUN_140385820(param_1,puVar1,0);
  return;
}



void FUN_140385a20(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_14034f420(local_58,L"WriteString failed! length=%I64d",uVar2);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  FUN_140385820(param_1,param_2,uVar2 & 0xffffffff);
  return;
}



void FUN_140385a80(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_1405d8008)) {
    uVar2 = 0;
  }
  else {
    uVar2 = *(undefined4 *)(puVar1 + -8);
  }
  if (puVar1 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8008;
  }
  FUN_1403857a0(param_1,puVar1,uVar2,param_4,0xfffffffffffffffe);
  FUN_140017c50(param_1,(short)param_2[1]);
  FUN_14000d2c0(param_2);
  return;
}



undefined8 * FUN_140385af0(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_140385b20(undefined8 *param_1)

{
  *param_1 = Proud::IRmiProxy::vftable;
  if (param_1[1] != 0) {
    FUN_14034fa20(
                 L"RMI Proxy which is still in use by ProudNet core cannot be destroyed! Destroy CNetClient or CNetServer instance first."
                 );
  }
  return;
}



void FUN_140385b50(void)

{
  return;
}



undefined8 * FUN_140385b60(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::IRmiProxy::vftable;
  if (param_1[1] != 0) {
    FUN_14034fa20(
                 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;
}



void FUN_140385bb0(longlong param_1)

{
  FUN_140399690(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0x18) = 0;
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140385c00(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 = 0x140385c1f;
  local_1a38 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_1ac8;
  if (param_1[1] == 0) {
    uVar3 = FUN_14034fa20(L"ProudNet RMI Proxy is not attached yet!");
    uVar3 = uVar3 & 0xffffffffffffff00;
  }
  else {
    FUN_14035b350(param_4);
    FUN_1403841b0(local_1a28);
    FUN_140383e30(local_1a28,local_1a00);
    FUN_140058870(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_140399790();
      }
    }
    else {
      local_1a10 = *(undefined4 *)(local_1a20 + 0x18);
    }
    lVar4 = local_1a18;
    if (local_1a18 == 0) {
      if (local_1a20 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_1403607b0(local_ce8,&local_1978);
    if (local_cf8 == (undefined4 *)0x0) {
      FUN_14034f420(&local_1a80,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_1a80,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_cec < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_140361500(&local_1978,param_5);
    FUN_1403607b0(local_ce8,&local_1978);
    if (local_cf8 == (undefined4 *)0x0) {
      FUN_14034f420(&local_1a80,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_1a80,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_cec < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    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_1405d81cc;
    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_1403a62c0(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_14034f420(&local_1a80,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(&local_1a80,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_5c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_60 = 0;
    local_1a98 = &local_1a20;
    FUN_140399690(&local_1a20);
    if ((local_1a18 != 0) && (local_1a0c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    uVar3 = (ulonglong)bVar1;
  }
  return uVar3;
}



void FUN_140385fa0(undefined8 param_1,double param_2)

{
  undefined1 local_58 [88];
  
  if (param_2 < DAT_1405d80f8 * 10.0 * 2.0) {
    FUN_14034f420(local_58,L"No ping timeout value is too small!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  return;
}



int FUN_140385ff0(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_14034f7d0();
    }
    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_140386090(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 0x0001403860b7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void FUN_1403860d0(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 0x0001403860f7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 * FUN_140386110(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140386170(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403861d0(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_140394870(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_1403a2c90(param_1);
        lVar3 = FUN_1403a2c90(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_1403a2c90(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_14034f7d0();
}



void FUN_1403862c0(undefined8 param_1,longlong param_2)

{
  if ((*(longlong *)(param_2 + 8) == 0) && (*(longlong *)(param_2 + 0x10) == 0)) {
                    // WARNING: Subroutine does not return
    FUN_140399790(param_1,param_2,param_2);
  }
  return;
}



undefined8 FUN_1403862f0(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_140384780(param_2,local_28);
  if (cVar3 != '\0') {
    cVar3 = FUN_140384780(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_140383c40(param_3);
        FUN_140384310(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_140399790();
          }
          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_140399790();
          }
          if (*(int *)(lVar2 + 0x18) != 0) {
            lVar5 = *(longlong *)(lVar2 + 0x10);
          }
        }
        iVar4 = FUN_1403a7d60(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_140383db0(param_2,(int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3);
  return 0;
}



undefined8 * FUN_140386400(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_140386450(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_14034ff60();
    }
    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_14034ff60();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,param_1[3]);
    }
  }
  *param_1 = Proud::IRmiHost::vftable;
  return;
}



void FUN_140386500(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_14034f420(local_68,PTR_u_Already_async_callback_may_occur_1405d9010);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f800();
      }
      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_14034f7d0();
    }
    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_1403a2c90(plVar7);
        lVar4 = FUN_1403a2c90(plVar7);
        *(undefined8 *)(lVar4 + lVar6) = *(undefined8 *)((longlong)iVar9 * 8 + lVar3 + lVar6);
        lVar6 = lVar6 + 8;
        lVar8 = lVar8 + -1;
      } while (lVar8 != 0);
    }
    FUN_140394870(plVar7,(int)param_1[4] - iVar9);
    *(undefined8 *)(param_2 + 8) = 0;
  }
  return;
}



void FUN_140386660(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_14034f800();
      }
      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_14034f7d0();
    }
    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_1403a2c90(lVar1);
        lVar4 = FUN_1403a2c90(lVar1);
        *(undefined8 *)(lVar4 + lVar6) = *(undefined8 *)((longlong)iVar8 * 8 + lVar3 + lVar6);
        lVar6 = lVar6 + 8;
        lVar7 = lVar7 + -1;
      } while (lVar7 != 0);
    }
    FUN_140394870(lVar1,*(int *)(param_1 + 0x48) - iVar8);
    *(undefined8 *)(param_2 + 0x10) = 0;
  }
  return;
}



void * FUN_140386780(void *param_1,uint param_2)

{
  FUN_140386450();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403867b0(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_14034f800();
      }
      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_140394870(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_14034f800();
      }
      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_140394870(param_1 + 0x30,0);
  return;
}



void FUN_140386850(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_14034f420(local_78,PTR_u_Already_async_callback_may_occur_1405d9010);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f800();
      }
      plVar1 = *(longlong **)(param_1[3] + lVar11 * 8);
      iVar6 = (**(code **)*plVar1)(plVar1);
      if (0xfff9 < iVar6) {
LAB_140386a1b:
        FUN_14034f420(local_78,PTR_u_Wrong_RMI_ID_is_found__RMI_ID_sh_1405d9008);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
      }
      iVar6 = (**(code **)(*plVar1 + 8))(plVar1);
      if (iVar6 < 1) goto LAB_140386a1b;
      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_140386974:
        if ((uVar8 <= uVar9) || ((uVar4 <= uVar9 && (uVar9 <= uVar8)))) goto LAB_1403869f8;
        if (uVar4 <= uVar5) goto LAB_140386989;
      }
      else {
        if (uVar9 <= uVar8) goto LAB_1403869f8;
        if (uVar5 <= uVar4) goto LAB_140386974;
LAB_140386989:
        if ((uVar5 <= uVar8) && (uVar8 <= uVar9)) {
LAB_1403869f8:
          FUN_14034f420(local_78,PTR_u_Duplicated_RMI_ID_is_found__Revi_1405d9000);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      iVar10 = iVar10 + 1;
      lVar11 = lVar11 + 1;
    } while (iVar10 < (int)param_1[4]);
  }
  param_2[1] = (longlong)param_1;
  FUN_1403861d0(param_1 + 1,(int)param_1[4],&local_res10,1);
  return;
}



void FUN_140386a50(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_14034f800();
      }
      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_140386afd:
        if ((uVar8 <= uVar9) || ((uVar3 <= uVar9 && (uVar9 <= uVar8)))) goto LAB_140386bd2;
        if (uVar3 <= uVar4) goto LAB_140386b1a;
      }
      else {
        if (uVar9 <= uVar8) goto LAB_140386bd2;
        if (uVar4 <= uVar3) goto LAB_140386afd;
LAB_140386b1a:
        if ((uVar4 <= uVar8) && (uVar8 <= uVar9)) {
LAB_140386bd2:
          FUN_14034f420(local_78,PTR_u_Duplicated_RMI_ID_is_found__Revi_1405d9000);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      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_140394870(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_1403a2c90(param_1 + 0x30);
        lVar6 = FUN_1403a2c90(param_1 + 0x30);
        *(undefined8 *)(lVar6 + lVar11) = *(undefined8 *)(lVar5 + -8 + lVar11);
        lVar11 = lVar11 + -8;
        lVar13 = lVar13 + -1;
      } while (-1 < lVar13);
    }
    lVar13 = FUN_1403a2c90(param_1 + 0x30);
    *(longlong **)(lVar13 + (longlong)iVar12 * 8) = param_2;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1
FUN_140386c10(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 = 0x140386c2f;
  local_1a38 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_1ad8;
  FUN_14035b350(param_4);
  FUN_1403841b0(local_1a28);
  FUN_140383e30(local_1a28,local_1a00,0x80);
  FUN_140058870(local_1a28,2);
  FUN_140385580(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_140399790();
    }
  }
  else {
    local_1a10 = *(undefined4 *)(local_1a20 + 0x18);
  }
  lVar3 = local_1a18;
  if (local_1a18 == 0) {
    if (local_1a20 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_1403607b0(local_1978,&local_ce8);
  if (local_68 == (undefined4 *)0x0) {
    FUN_14034f420(&local_1a98,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&local_1a98,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_5c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  iStack_1aa0 = param_6;
  if (local_cf8 == (undefined1 *)0x0) {
    FUN_14034f420(&local_1a98,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&local_1a98,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_cf0 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  iVar2 = local_cf0 + 1;
  if ((iVar2 < 0) || (local_cec < iVar2)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(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_1405d81cc;
  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_1403a62c0(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_14034f420(&local_1a98,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(&local_1a98,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (-1 < local_cec) {
    local_cf0 = 0;
    local_1aa8 = &local_1a20;
    FUN_140399690(&local_1a20);
    if ((local_1a18 != 0) && (local_1a0c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    return uVar1;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_140386f80(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_14012c7f0(param_2);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140386fe0(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 = 0x140386fff;
  local_1be0 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (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_14034ed40(uVar9);
    local_1c38 = 1;
    if (DAT_1405f064f != '\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_14034edd0(uVar9);
    local_1c38 = 0;
    FUN_14034fe70();
    local_1d00 = PTR_DAT_1405d8010;
    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_14034f7d0();
        }
        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_14034ed40(uVar9);
            local_1ca0 = 1;
            if (DAT_1405f064f != '\0') {
              (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::Send_SecureLayer");
            }
            if (((local_1d00 == (undefined *)0x0) || (local_1d00 == PTR_DAT_1405d8010)) ||
               (*(int *)(local_1d00 + -8) < 1)) {
              FUN_14034fe70();
              local_1d28 = (uint *)PTR_DAT_1405d8010;
              uVar6 = FUN_14034fcf0(
                                   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_1405d8010)) {
                uVar18 = local_1d28[-2];
              }
              uVar7 = uVar6;
              if ((((int)uVar6 <= (int)uVar18) && (uVar7 = uVar17, local_1d28 != (uint *)0x0)) &&
                 (local_1d28 != (uint *)PTR_DAT_1405d8010)) {
                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_1405d8010)) {
                uVar7 = local_1d28[-2];
              }
              if ((int)uVar7 < (int)uVar18) {
                if (local_1d28 == (uint *)0x0) {
                  local_1d28 = (uint *)PTR_DAT_1405d8010;
                }
                if ((int)uVar18 < 0) {
                    // WARNING: Subroutine does not return
                  FUN_14034f7d0();
                }
                if (uVar18 == 0) {
                  FUN_1400031d0(&local_1d28);
                }
                else {
                  uVar7 = uVar8;
                  if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1405d8010)) {
                    uVar7 = local_1d28[-2];
                  }
                  if (uVar18 != uVar7) {
                    puVar11 = (uint *)FUN_14034fef0((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_1405d8010)) {
                      uVar8 = local_1d28[-2];
                    }
                    puVar16 = (uint *)PTR_DAT_1405d8010;
                    if ((int)uVar18 < (int)uVar8) {
LAB_140387937:
                      if (local_1d28 != (uint *)0x0) {
                        puVar16 = local_1d28;
                      }
                    }
                    else {
                      uVar18 = uVar17;
                      if (local_1d28 != (uint *)0x0) {
                        if (local_1d28 != (uint *)PTR_DAT_1405d8010) {
                          uVar18 = local_1d28[-2];
                        }
                        goto LAB_140387937;
                      }
                    }
                    FUN_14034fd20(puVar11 + 2,puVar16,uVar18);
                    FUN_1400031d0(&local_1d28);
                    local_1d28 = puVar11 + 2;
                  }
                }
              }
              FUN_140002e10(&local_1d28);
              puVar11 = local_1d28;
              if (local_1d28 == (uint *)0x0) {
                puVar11 = (uint *)PTR_DAT_1405d8010;
              }
              FUN_14034fd20(puVar11,
                            L"CStartServerParameter.m_enableP2PEncryptedMessaging=false. P2P Messaging can not encrypted!!"
                            ,uVar6);
              puVar11 = local_1d28;
              if (local_1d28 == (uint *)0x0) {
                puVar11 = (uint *)PTR_DAT_1405d8010;
              }
              uVar6 = FUN_14034fcf0(puVar11);
              uVar17 = 0;
              uVar18 = 0;
              if (0 < (int)uVar6) {
                uVar18 = uVar6;
              }
              uVar6 = uVar17;
              if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1405d8010)) {
                uVar6 = local_1d28[-2];
              }
              if (((int)uVar18 < (int)uVar6) || (uVar18 = uVar17, local_1d28 == (uint *)0x0)) {
LAB_1403879d5:
                if (((local_1d28 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
                uVar18 = local_1d28[-2];
                goto LAB_1403879d5;
              }
              local_1cf0 = 0;
              local_1ce8 = 0;
              local_1ce0 = 0;
              local_1cd8 = 0;
              local_1cf8 = Proud::ByteArray::vftable;
              local_1d38 = &local_1cf8;
              uVar12 = FUN_14035bed0(&local_1c70,5,local_1d20,&local_1d28);
              (**(code **)(*param_1 + 0x80))(param_1,uVar12);
              FUN_1403555d0(&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_14035bed0(local_1be8,5,local_1d20,&local_1d00);
              (**(code **)(*param_1 + 0x80))(param_1,uVar12);
              FUN_1403555d0(&local_1cf8);
            }
            FUN_14034edd0(uVar9);
            local_1ca0 = 0;
          }
          else {
            uVar9 = (**(code **)(*param_1 + 0x58))();
            local_1c20 = uVar9;
            FUN_14034ed40(uVar9);
            local_1c18 = 1;
            if (DAT_1405f064f != '\0') {
              (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::Send_SecureLayer");
            }
            FUN_1403841b0(local_1c98);
            FUN_140383c40(local_1c98);
            if (*param_3 == 1) {
              cVar4 = (**(code **)(*param_1 + 0xa0))(param_1,local_1d20,local_1d08);
              if (cVar4 == '\0') {
                FUN_14034fe70();
                local_1d28 = (uint *)PTR_DAT_1405d8010;
                uVar6 = FUN_14034fcf0(&DAT_140456e60);
                uVar17 = 0;
                uVar18 = 0;
                if ((local_1d28 != (uint *)0x0) &&
                   (uVar18 = 0, local_1d28 != (uint *)PTR_DAT_1405d8010)) {
                  uVar18 = local_1d28[-2];
                }
                uVar7 = uVar6;
                if ((((int)uVar6 <= (int)uVar18) && (uVar7 = uVar17, local_1d28 != (uint *)0x0)) &&
                   (local_1d28 != (uint *)PTR_DAT_1405d8010)) {
                  uVar7 = local_1d28[-2];
                }
                uVar18 = 1;
                if (1 < (int)uVar7) {
                  uVar18 = uVar7;
                }
                uVar7 = uVar17;
                if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1405d8010)) {
                  uVar7 = local_1d28[-2];
                }
                uVar8 = 0;
                if ((int)uVar7 < (int)uVar18) {
                  if (local_1d28 == (uint *)0x0) {
                    local_1d28 = (uint *)PTR_DAT_1405d8010;
                  }
                  if ((int)uVar18 < 0) {
                    // WARNING: Subroutine does not return
                    FUN_14034f7d0();
                  }
                  if (uVar18 == 0) {
                    FUN_1400031d0(&local_1d28);
                  }
                  else {
                    uVar7 = uVar17;
                    if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1405d8010)) {
                      uVar7 = local_1d28[-2];
                    }
                    if (uVar18 != uVar7) {
                      puVar11 = (uint *)FUN_14034fef0((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_1405d8010))
                      {
                        uVar7 = local_1d28[-2];
                      }
                      puVar16 = (uint *)PTR_DAT_1405d8010;
                      if ((int)uVar18 < (int)uVar7) {
LAB_140387b8d:
                        if (local_1d28 != (uint *)0x0) {
                          puVar16 = local_1d28;
                        }
                      }
                      else {
                        uVar18 = uVar17;
                        if (local_1d28 != (uint *)0x0) {
                          if (local_1d28 != (uint *)PTR_DAT_1405d8010) {
                            uVar18 = local_1d28[-2];
                          }
                          goto LAB_140387b8d;
                        }
                      }
                      FUN_14034fd20(puVar11 + 2,puVar16,uVar18);
                      FUN_1400031d0(&local_1d28);
                      local_1d28 = puVar11 + 2;
                    }
                  }
                }
                FUN_140002e10(&local_1d28);
                puVar11 = local_1d28;
                if (local_1d28 == (uint *)0x0) {
                  puVar11 = (uint *)PTR_DAT_1405d8010;
                }
                FUN_14034fd20(puVar11,&DAT_140456e60,uVar6);
                puVar11 = local_1d28;
                if (local_1d28 == (uint *)0x0) {
                  puVar11 = (uint *)PTR_DAT_1405d8010;
                }
                uVar6 = FUN_14034fcf0(puVar11);
                uVar18 = 0;
                if (0 < (int)uVar6) {
                  uVar18 = uVar6;
                }
                uVar6 = uVar8;
                if ((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1405d8010)) {
                  uVar6 = local_1d28[-2];
                }
                if (((int)uVar6 <= (int)uVar18) && (uVar18 = uVar8, local_1d28 != (uint *)0x0)) {
                  if (local_1d28 == (uint *)PTR_DAT_1405d8010) goto LAB_140387c47;
                  uVar18 = local_1d28[-2];
                }
                if (((local_1d28 != (uint *)PTR_DAT_1405d8010) && (local_1d28 != (uint *)0x0)) &&
                   (local_1d28 + -2 != (uint *)0x0)) {
                  local_1d28[-2] = uVar18;
                  *(undefined2 *)((longlong)local_1d28 + (longlong)(int)uVar18 * 2) = 0;
                }
LAB_140387c47:
                local_1cf0 = 0;
                local_1ce8 = 0;
                local_1ce0 = 0;
                local_1cd8 = 0;
                local_1cf8 = Proud::ByteArray::vftable;
                local_1d38 = &local_1cf8;
                uVar12 = FUN_14035bed0(&local_1c70,5,local_1d20,&local_1d28);
                (**(code **)(*param_1 + 0x80))(param_1,uVar12);
                FUN_1403555d0(&local_1cf8);
                puVar11 = local_1d28;
                if (((local_1d28 != (uint *)0x0) && (local_1d28 != (uint *)PTR_DAT_1405d8010)) &&
                   (puVar16 = local_1d28 + -2, puVar16 != (uint *)0x0)) {
                  uVar12 = FUN_14034fe70();
                  local_1ca8 = uVar12;
                  FUN_14034ed40(uVar12);
                  local_1ca0 = 1;
                  puVar11 = puVar11 + -1;
                  *puVar11 = *puVar11 - 1;
                  if (*puVar11 == 0) {
                    FUN_14034ff60(puVar16);
                  }
                  FUN_14034edd0(uVar12);
                }
                local_1c70 = local_1c90;
                FUN_140399690(local_1c90);
                if (local_1c88 != 0) {
                  if (local_1c7c < 0) {
                    // WARNING: Subroutine does not return
                    FUN_14034f7d0();
                  }
                  local_1c80 = 0;
                }
                FUN_14034edd0(uVar9);
                puVar13 = local_1d00;
                if (((local_1d00 != (undefined *)0x0) && (local_1d00 != PTR_DAT_1405d8010)) &&
                   (puVar1 = local_1d00 + -8, puVar1 != (undefined *)0x0)) {
                  uVar9 = FUN_14034fe70();
                  local_1ca8 = uVar9;
                  FUN_14034ed40(uVar9);
                  local_1ca0 = 1;
                  piVar10 = (int *)(puVar13 + -4);
                  *piVar10 = *piVar10 + -1;
                  if (*piVar10 == 0) {
                    FUN_14034ff60(puVar1);
                  }
                  FUN_14034edd0(uVar9);
                }
                local_1d00 = PTR_DAT_1405d8010;
                puVar13 = PTR_DAT_1405d8010;
                if (100 < local_1b18) {
                  operator_delete__(local_1b28);
                  puVar13 = extraout_RAX;
                }
                return (ulonglong)puVar13 & 0xffffffffffffff00;
              }
              FUN_140017c50(local_1c98,local_1d08[0]);
            }
            FUN_140384590(local_1c98,param_2);
            FUN_1403841b0(local_1c68);
            FUN_140383c40(local_1c68);
            if (param_3[9] == 1) {
              cVar4 = FUN_140397130(local_1c98,local_1c68,lVar15);
            }
            else {
              cVar4 = FUN_1403a48d0(local_1c98,local_1c68,lVar15 + 0x3d0,0);
            }
            if (cVar4 == '\0') {
              FUN_14034fe70();
              local_1d18 = (uint *)PTR_DAT_1405d8010;
              uVar6 = FUN_14034fcf0(L"Encrypt Error");
              uVar17 = 0;
              uVar18 = 0;
              if ((local_1d18 != (uint *)0x0) &&
                 (uVar18 = 0, local_1d18 != (uint *)PTR_DAT_1405d8010)) {
                uVar18 = local_1d18[-2];
              }
              uVar7 = uVar6;
              if ((((int)uVar6 <= (int)uVar18) && (uVar7 = uVar17, local_1d18 != (uint *)0x0)) &&
                 (local_1d18 != (uint *)PTR_DAT_1405d8010)) {
                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_1405d8010)) {
                uVar7 = local_1d18[-2];
              }
              if ((int)uVar7 < (int)uVar18) {
                if (local_1d18 == (uint *)0x0) {
                  local_1d18 = (uint *)PTR_DAT_1405d8010;
                }
                if ((int)uVar18 < 0) {
                    // WARNING: Subroutine does not return
                  FUN_14034f7d0();
                }
                if (uVar18 == 0) {
                  FUN_1400031d0(&local_1d18);
                }
                else {
                  uVar7 = uVar8;
                  if ((local_1d18 != (uint *)0x0) && (local_1d18 != (uint *)PTR_DAT_1405d8010)) {
                    uVar7 = local_1d18[-2];
                  }
                  if (uVar18 != uVar7) {
                    puVar11 = (uint *)FUN_14034fef0((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_1405d8010)) {
                      uVar8 = local_1d18[-2];
                    }
                    puVar16 = (uint *)PTR_DAT_1405d8010;
                    if ((int)uVar18 < (int)uVar8) {
LAB_14038759c:
                      if (local_1d18 != (uint *)0x0) {
                        puVar16 = local_1d18;
                      }
                    }
                    else {
                      uVar18 = uVar17;
                      if (local_1d18 != (uint *)0x0) {
                        if (local_1d18 != (uint *)PTR_DAT_1405d8010) {
                          uVar18 = local_1d18[-2];
                        }
                        goto LAB_14038759c;
                      }
                    }
                    FUN_14034fd20(puVar11 + 2,puVar16,uVar18);
                    FUN_1400031d0(&local_1d18);
                    local_1d18 = puVar11 + 2;
                  }
                }
              }
              FUN_140002e10(&local_1d18);
              puVar11 = local_1d18;
              if (local_1d18 == (uint *)0x0) {
                puVar11 = (uint *)PTR_DAT_1405d8010;
              }
              FUN_14034fd20(puVar11,L"Encrypt Error",uVar6);
              puVar11 = local_1d18;
              if (local_1d18 == (uint *)0x0) {
                puVar11 = (uint *)PTR_DAT_1405d8010;
              }
              uVar6 = FUN_14034fcf0(puVar11);
              uVar17 = 0;
              uVar18 = 0;
              if (0 < (int)uVar6) {
                uVar18 = uVar6;
              }
              uVar6 = uVar17;
              if ((local_1d18 != (uint *)0x0) && (local_1d18 != (uint *)PTR_DAT_1405d8010)) {
                uVar6 = local_1d18[-2];
              }
              if (((int)uVar18 < (int)uVar6) || (uVar18 = uVar17, local_1d18 == (uint *)0x0)) {
LAB_14038763a:
                if (((local_1d18 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
                uVar18 = local_1d18[-2];
                goto LAB_14038763a;
              }
              local_1cf0 = 0;
              local_1ce8 = 0;
              local_1ce0 = 0;
              local_1cd8 = 0;
              local_1cf8 = Proud::ByteArray::vftable;
              local_1d38 = &local_1cf8;
              uVar12 = FUN_14035bed0(local_1bf0,5,local_1d20);
              (**(code **)(*param_1 + 0x80))(param_1,uVar12);
              FUN_1403555d0(&local_1cf8);
              puVar11 = local_1d18;
              if (((local_1d18 != (uint *)0x0) && (local_1d18 != (uint *)PTR_DAT_1405d8010)) &&
                 (puVar16 = local_1d18 + -2, puVar16 != (uint *)0x0)) {
                uVar12 = FUN_14034fe70();
                local_1c30 = uVar12;
                FUN_14034ed40(uVar12);
                local_1c28 = 1;
                puVar11 = puVar11 + -1;
                *puVar11 = *puVar11 - 1;
                if (*puVar11 == 0) {
                  FUN_14034ff60(puVar16);
                }
                FUN_14034edd0(uVar12);
                local_1c28 = 0;
              }
              local_1d18 = (uint *)PTR_DAT_1405d8010;
              if (*param_3 == 1) {
                (**(code **)(*param_1 + 0xa8))(param_1,local_1d20);
              }
              param_2 = local_1cb0;
              iVar19 = (int)local_1d10;
            }
            else {
              FUN_1403841b0(local_1bd8);
              FUN_140383e30(local_1bd8,local_1bb0,0x80);
              uVar12 = 0x24;
              if (*param_3 != 1) {
                uVar12 = 0x25;
              }
              FUN_140058870(local_1bd8,uVar12);
              FUN_140058870(local_1bd8,(char)param_3[9]);
              if (local_1c60 == 0) {
                iVar5 = local_1c50;
                if (local_1c58 == 0) {
                    // WARNING: Subroutine does not return
                  FUN_140399790();
                }
              }
              else {
                iVar5 = *(int *)(local_1c60 + 0x18);
              }
              FUN_140385580(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_140399790();
                }
              }
              else {
                uVar2 = *(undefined4 *)(local_1bd0 + 0x18);
              }
              lVar15 = local_1bc8;
              if (local_1bc8 == 0) {
                if (local_1bd0 == 0) {
                    // WARNING: Subroutine does not return
                  FUN_140399790();
                }
                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_1403607b0(local_ce8,&local_1978);
              if (local_cf8 == (undefined4 *)0x0) {
                FUN_14034f420(&local_1cf8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
                _CxxThrowException(&local_1cf8,(ThrowInfo *)&DAT_1405d36c0);
              }
              if (local_cec < 0) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              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_140399790();
                }
              }
              else {
                iVar5 = *(int *)(local_1c60 + 0x18);
              }
              lVar15 = local_1c58;
              if (local_1c58 == 0) {
                if (local_1c60 == 0) {
                    // WARNING: Subroutine does not return
                  FUN_140399790();
                }
                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_1403607b0(local_ce8,&local_1978);
              if (local_cf8 == (undefined4 *)0x0) {
                FUN_14034f420(&local_1cf8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
                _CxxThrowException(&local_1cf8,(ThrowInfo *)&DAT_1405d36c0);
              }
              if (local_cec < 0) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              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_14034f420(&local_1cf8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
                _CxxThrowException(&local_1cf8,(ThrowInfo *)&DAT_1405d36c0);
              }
              if (local_5c < 0) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              local_60 = 0;
              local_1d10 = &local_1bd0;
              FUN_140399690(&local_1bd0);
              if ((local_1bc8 != 0) && (local_1bbc < 0)) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
            }
            local_1d10 = &local_1c60;
            FUN_140399690(&local_1c60);
            if (local_1c58 != 0) {
              if (local_1c4c < 0) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              local_1c50 = 0;
            }
            local_1d10 = (longlong *)local_1c90;
            FUN_140399690(local_1c90);
            if (local_1c88 != 0) {
              if (local_1c7c < 0) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              local_1c80 = 0;
            }
            FUN_14034edd0(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_140387ec0(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_140384a10(param_3,&local_64);
  if ((cVar4 == '\0') || (cVar4 = FUN_140384780(param_3,local_res18), cVar4 == '\0')) {
    FUN_140383db0(param_3,iVar5);
    return 0;
  }
  FUN_14034fe70();
  local_b0 = PTR_DAT_1405d8010;
  lVar8 = (**(code **)(*param_1 + 0xc0))(param_1,param_3[10],&local_b0);
  if (((lVar8 == 0) || (local_64 == 0)) || (local_64 == 3)) goto LAB_140388645;
  if (local_64 == 1) {
    cVar4 = FUN_140396b80(param_3,param_4,lVar8,(int)((*param_3 >> 0x1f & 7U) + *param_3) >> 3);
LAB_140387fbe:
    if (cVar4 == '\0') {
LAB_140388645:
      uVar9 = (**(code **)(*param_1 + 0x58))(param_1);
      local_a8 = uVar9;
      FUN_14034ed40(uVar9);
      local_a0 = 1;
      if (DAT_1405f064f != '\0') {
        (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::ProcessMessage_Encrypted");
      }
      FUN_140017790(&local_b0,L" decrypt failed");
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_90 = Proud::ByteArray::vftable;
      uVar11 = FUN_14035bed0(local_res18,6,param_3[10],&local_b0,&local_90);
      (**(code **)(*param_1 + 0x80))(param_1,uVar11);
      FUN_1403555d0(&local_90);
      FUN_140383db0(param_3,iVar5);
      FUN_14034edd0(uVar9);
      puVar3 = local_b0;
      if (local_b0 == (undefined *)0x0) {
        return 0;
      }
      if (local_b0 == PTR_DAT_1405d8010) {
        return 0;
      }
      puVar1 = local_b0 + -8;
      if (puVar1 == (undefined *)0x0) {
        return 0;
      }
      uVar9 = FUN_14034fe70();
      local_a8 = uVar9;
      FUN_14034ed40(uVar9);
      local_a0 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar9);
      return 0;
    }
  }
  else if (local_64 == 2) {
    cVar4 = FUN_1403a4bb0(param_3,param_4,lVar8 + 0x3d0,
                          (int)((*param_3 >> 0x1f & 7U) + *param_3) >> 3);
    goto LAB_140387fbe;
  }
  if (param_2 != 0x24) {
LAB_1403885f5:
    puVar3 = local_b0;
    if (((local_b0 != (undefined *)0x0) && (local_b0 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_b0 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_14034fe70();
      local_a8 = uVar9;
      FUN_14034ed40(uVar9);
      local_a0 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar9);
    }
    return 1;
  }
  cVar4 = FUN_1403840e0(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_14034ed40(uVar9);
      local_a0 = 1;
      if (DAT_1405f064f != '\0') {
        (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::ProcessMessage_Encrypted");
      }
      FUN_14034fe70();
      local_b8 = (uint *)PTR_DAT_1405d8010;
      FUN_140017720(&local_b8,L"GetExpectedDecryptCount failed!!");
      local_88 = 0;
      local_80 = 0;
      local_78 = 0;
      local_70 = 0;
      local_90 = Proud::ByteArray::vftable;
      uVar11 = FUN_14035bed0(local_50,6,param_3[10],&local_b8,&local_90);
      (**(code **)(*param_1 + 0x80))(param_1,uVar11);
      FUN_1403555d0(&local_90);
      FUN_140383db0(param_4,iVar5);
      puVar10 = local_b8;
      if (((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1405d8010)) &&
         (puVar12 = local_b8 + -2, puVar12 != (uint *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_60 = uVar11;
        FUN_14034ed40(uVar11);
        local_58 = 1;
        puVar10 = puVar10 + -1;
        *puVar10 = *puVar10 - 1;
        if (*puVar10 == 0) {
          FUN_14034ff60(puVar12);
        }
        FUN_14034edd0(uVar11);
      }
      local_b8 = (uint *)PTR_DAT_1405d8010;
      FUN_14034edd0(uVar9);
      puVar3 = local_b0;
      if (local_b0 == (undefined *)0x0) {
        return 0;
      }
      if (local_b0 == PTR_DAT_1405d8010) {
        return 0;
      }
      puVar1 = local_b0 + -8;
      if (puVar1 == (undefined *)0x0) {
        return 0;
      }
      uVar9 = FUN_14034fe70();
      local_a8 = uVar9;
      FUN_14034ed40(uVar9);
      local_a0 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar9);
      return 0;
    }
    if (local_98[0] != local_res18[0]) {
      uVar9 = (**(code **)(lVar8 + 0x58))();
      local_a8 = uVar9;
      FUN_14034ed40(uVar9);
      local_a0 = 1;
      if (DAT_1405f064f != '\0') {
        (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::ProcessMessage_Encrypted");
      }
      FUN_14034fe70();
      local_b8 = (uint *)PTR_DAT_1405d8010;
      FUN_140017720(&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_14035bed0(local_50,6,param_3[10],&local_b8,&local_90);
      (**(code **)(*param_1 + 0x80))(param_1,uVar11);
      FUN_1403555d0(&local_90);
      FUN_140383db0(param_4,iVar5);
      puVar10 = local_b8;
      if (((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1405d8010)) &&
         (puVar12 = local_b8 + -2, puVar12 != (uint *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_60 = uVar11;
        FUN_14034ed40(uVar11);
        local_58 = 1;
        puVar10 = puVar10 + -1;
        *puVar10 = *puVar10 - 1;
        if (*puVar10 == 0) {
          FUN_14034ff60(puVar12);
        }
        FUN_14034edd0(uVar11);
      }
      local_b8 = (uint *)PTR_DAT_1405d8010;
      FUN_14034edd0(uVar9);
      puVar3 = local_b0;
      if (local_b0 == (undefined *)0x0) {
        return 0;
      }
      if (local_b0 == PTR_DAT_1405d8010) {
        return 0;
      }
      puVar1 = local_b0 + -8;
      if (puVar1 == (undefined *)0x0) {
        return 0;
      }
      uVar9 = FUN_14034fe70();
      local_a8 = uVar9;
      FUN_14034ed40(uVar9);
      local_a0 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar9);
      return 0;
    }
    (**(code **)(lVar8 + 0xb8))(param_1,param_3[10]);
    goto LAB_1403885f5;
  }
  uVar9 = (**(code **)(*param_1 + 0x58))();
  local_60 = uVar9;
  FUN_14034ed40(uVar9);
  local_58 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(*param_1 + 200))(param_1,L"Proud::CNetCoreImpl::ProcessMessage_Encrypted");
  }
  FUN_14034fe70();
  local_b8 = (uint *)PTR_DAT_1405d8010;
  uVar6 = FUN_14034fcf0(L"decryptCount1 read failed!!");
  uVar13 = 0;
  uVar15 = 0;
  if ((local_b8 != (uint *)0x0) && (uVar15 = 0, local_b8 != (uint *)PTR_DAT_1405d8010)) {
    uVar15 = local_b8[-2];
  }
  uVar7 = uVar6;
  if ((((int)uVar6 <= (int)uVar15) && (uVar7 = uVar13, local_b8 != (uint *)0x0)) &&
     (local_b8 != (uint *)PTR_DAT_1405d8010)) {
    uVar7 = local_b8[-2];
  }
  uVar15 = 1;
  if (1 < (int)uVar7) {
    uVar15 = uVar7;
  }
  uVar7 = uVar13;
  if ((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1405d8010)) {
    uVar7 = local_b8[-2];
  }
  uVar14 = 0;
  if ((int)uVar7 < (int)uVar15) {
    if (local_b8 == (uint *)0x0) {
      local_b8 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar15 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar15 == 0) {
      FUN_1400031d0(&local_b8);
    }
    else {
      uVar7 = uVar13;
      if ((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1405d8010)) {
        uVar7 = local_b8[-2];
      }
      if (uVar15 != uVar7) {
        puVar10 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar7 = local_b8[-2];
        }
        puVar12 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar15 < (int)uVar7) {
LAB_140388125:
          if (local_b8 != (uint *)0x0) {
            puVar12 = local_b8;
          }
        }
        else {
          uVar15 = uVar13;
          if (local_b8 != (uint *)0x0) {
            if (local_b8 != (uint *)PTR_DAT_1405d8010) {
              uVar15 = local_b8[-2];
            }
            goto LAB_140388125;
          }
        }
        FUN_14034fd20(puVar10 + 2,puVar12,uVar15);
        FUN_1400031d0(&local_b8);
        local_b8 = puVar10 + 2;
      }
    }
  }
  FUN_140002e10(&local_b8);
  puVar10 = local_b8;
  if (local_b8 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,L"decryptCount1 read failed!!",uVar6);
  puVar10 = local_b8;
  if (local_b8 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1405d8010;
  }
  uVar6 = FUN_14034fcf0(puVar10);
  uVar15 = 0;
  if (0 < (int)uVar6) {
    uVar15 = uVar6;
  }
  uVar6 = uVar14;
  if ((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1405d8010)) {
    uVar6 = local_b8[-2];
  }
  if (((int)uVar6 <= (int)uVar15) && (uVar15 = uVar14, local_b8 != (uint *)0x0)) {
    if (local_b8 == (uint *)PTR_DAT_1405d8010) goto LAB_1403881d5;
    uVar15 = local_b8[-2];
  }
  if (((local_b8 != (uint *)PTR_DAT_1405d8010) && (local_b8 != (uint *)0x0)) &&
     (local_b8 + -2 != (uint *)0x0)) {
    local_b8[-2] = uVar15;
    *(undefined2 *)((longlong)local_b8 + (longlong)(int)uVar15 * 2) = 0;
  }
LAB_1403881d5:
  local_88 = 0;
  local_80 = 0;
  local_78 = 0;
  local_70 = 0;
  local_90 = Proud::ByteArray::vftable;
  uVar11 = FUN_14035bed0(local_50,6,param_3[10],&local_b8,&local_90);
  (**(code **)(*param_1 + 0x80))(param_1,uVar11);
  FUN_1403555d0(&local_90);
  puVar10 = local_b8;
  if (((local_b8 != (uint *)0x0) && (local_b8 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar12 = local_b8 + -2, puVar12 != (uint *)0x0)) {
    uVar11 = FUN_14034fe70();
    local_a8 = uVar11;
    FUN_14034ed40(uVar11);
    local_a0 = 1;
    puVar10 = puVar10 + -1;
    *puVar10 = *puVar10 - 1;
    if (*puVar10 == 0) {
      FUN_14034ff60(puVar12);
    }
    FUN_14034edd0(uVar11);
  }
  FUN_140383db0(local_res20,local_68);
  FUN_14034edd0(uVar9);
  puVar3 = local_b0;
  if (((local_b0 != (undefined *)0x0) && (local_b0 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_b0 + -8, puVar1 != (undefined *)0x0)) {
    uVar9 = FUN_14034fe70();
    local_a8 = uVar9;
    FUN_14034ed40(uVar9);
    local_a0 = 1;
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar9);
  }
  return 0;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_140388770(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 = 0x14038878f;
  local_1a30 = 0xfffffffffffffffe;
  local_58 = DAT_1405d84f0 ^ (ulonglong)auStack_1b18;
  local_1a80 = param_4;
  local_1a78 = param_3;
  if ((*(int *)(param_3 + 0x28) == 0) || (iVar4 = FUN_1403a62c0(param_2), iVar4 < 0x33))
  goto LAB_140388e26;
  FUN_1403841b0(local_1aa8);
  FUN_140383c40(local_1aa8);
  FUN_140384590(local_1aa8,param_2);
  if (local_1aa0 == 0) {
    uVar12 = local_1a90;
    if (local_1a98 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else {
    uVar12 = *(undefined4 *)(local_1aa0 + 0x18);
  }
  FUN_1403841b0(local_1ad0);
  FUN_140383c40(local_1ad0);
  FUN_140384310(local_1ad0,uVar12);
  local_1ad8[0] = FUN_1403a7e30(uVar12);
  uVar9 = 0;
  uVar14 = local_1a98;
  if (local_1a98 == 0) {
    if (local_1aa0 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
    }
    uVar10 = uVar9;
    if (*(int *)(local_1ac8 + 0x18) != 0) {
      uVar10 = *(ulonglong *)(local_1ac8 + 0x10);
    }
  }
  iVar4 = FUN_1403a7ca0(uVar10,local_1ad8,uVar14,uVar12);
  if (iVar4 == 0) {
    uVar5 = FUN_1403a62c0(param_2);
    if (local_1ad8[0] + 9U < uVar5) {
      FUN_140384310(local_1ad0);
      FUN_1403841b0(local_1a28);
      FUN_140383e30(local_1a28,local_1a00,0x80);
      FUN_140058870(local_1a28,0x26);
      if (local_1ac8 == 0) {
        iVar4 = local_1ab8;
        if (local_1ac0 == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
      }
      else {
        iVar4 = *(int *)(local_1ac8 + 0x18);
      }
      FUN_140385580(local_1a28,(longlong)iVar4);
      iVar4 = FUN_1403a62c0(param_2);
      FUN_140385580(local_1a28,(longlong)iVar4);
      local_cec = 200;
      local_cf0 = 0;
      local_cf8 = local_1978;
      FUN_140361500(local_ce8,local_1a28);
      FUN_1403607b0(local_1978,local_ce8);
      FUN_1403606a0(local_ce8);
      FUN_140361500(local_ce8,local_1ad0);
      FUN_1403607b0(local_1978,local_ce8);
      FUN_1403606a0(local_ce8);
      local_1af8 = (undefined ***)CONCAT44(local_1af8._4_4_,param_5);
      bVar3 = FUN_140386fe0(param_1,local_1978,local_1a78,param_4);
      FUN_1403606a0(local_1978);
      local_1ae0 = &local_1a20;
      FUN_140399690(&local_1a20);
      if (local_1a18 != 0) {
        if (local_1a0c < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_1a10 = 0;
      }
      local_1ae0 = &local_1ac8;
      FUN_140399690(&local_1ac8);
      if (local_1ac0 != 0) {
        if (local_1ab4 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_1ab8 = 0;
      }
      local_1ae0 = &local_1aa0;
      FUN_140399690(&local_1aa0);
      if ((local_1a98 != 0) && (local_1a8c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      return (ulonglong)bVar3;
    }
    local_1ae0 = &local_1ac8;
    FUN_140399690(&local_1ac8);
    if (local_1ac0 != 0) {
      if (local_1ab4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_1ab8 = 0;
    }
    local_1ae0 = &local_1aa0;
    FUN_140399690(&local_1aa0);
    if ((local_1a98 != 0) && (local_1a8c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    goto LAB_140388e26;
  }
  FUN_14034fe70();
  local_1a70 = PTR_DAT_1405d8010;
  FUN_140017720(&local_1a70,L"Packet compression failed! Error code=%d",iVar4);
  puVar2 = local_1a70;
  puVar15 = local_1a70;
  if (local_1a70 == (undefined *)0x0) {
    puVar15 = PTR_DAT_1405d8010;
  }
  FUN_14034fe70();
  local_1ae8 = (uint *)PTR_DAT_1405d8010;
  uVar5 = FUN_14034fcf0(puVar15);
  if ((local_1ae8 != (uint *)0x0) && (uVar9 = 0, local_1ae8 != (uint *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    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_1405d8010) {
    uVar6 = 0;
  }
  else {
    uVar6 = local_1ae8[-2];
  }
  if ((int)uVar6 < (int)uVar13) {
    if (local_1ae8 == (uint *)0x0) {
      local_1ae8 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar13 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar13 == 0) {
      FUN_1400031d0(&local_1ae8);
    }
    else {
      if (local_1ae8 == (uint *)0x0) {
        uVar6 = 0;
      }
      else if (local_1ae8 == (uint *)PTR_DAT_1405d8010) {
        uVar6 = 0;
      }
      else {
        uVar6 = local_1ae8[-2];
      }
      if (uVar13 != uVar6) {
        puVar7 = (uint *)FUN_14034fef0((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_1405d8010) {
          uVar6 = 0;
        }
        else {
          uVar6 = local_1ae8[-2];
        }
        puVar11 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar13 < (int)uVar6) {
LAB_1403889f5:
          if (local_1ae8 != (uint *)0x0) {
            puVar11 = local_1ae8;
          }
        }
        else {
          if (local_1ae8 != (uint *)0x0) {
            if (local_1ae8 == (uint *)PTR_DAT_1405d8010) {
              uVar13 = 0;
            }
            else {
              uVar13 = local_1ae8[-2];
            }
            goto LAB_1403889f5;
          }
          uVar13 = 0;
        }
        FUN_14034fd20(puVar7 + 2,puVar11,uVar13);
        FUN_1400031d0(&local_1ae8);
        param_4 = local_1a80;
        local_1ae8 = puVar7 + 2;
      }
    }
  }
  FUN_140002e10(&local_1ae8);
  puVar7 = local_1ae8;
  if (local_1ae8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,puVar15,uVar5);
  puVar7 = local_1ae8;
  if (local_1ae8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8010;
  }
  uVar6 = FUN_14034fcf0(puVar7);
  uVar13 = 0;
  uVar5 = 0;
  if (0 < (int)uVar6) {
    uVar5 = uVar6;
  }
  uVar6 = uVar13;
  if ((local_1ae8 != (uint *)0x0) && (local_1ae8 != (uint *)PTR_DAT_1405d8010)) {
    uVar6 = local_1ae8[-2];
  }
  if (((int)uVar5 < (int)uVar6) || (uVar5 = uVar13, local_1ae8 == (uint *)0x0)) {
LAB_140388a90:
    if (((local_1ae8 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
    uVar5 = local_1ae8[-2];
    goto LAB_140388a90;
  }
  local_1a50 = 0;
  local_1a48 = 0;
  local_1a40 = 0;
  local_1a38 = 0;
  local_1a58 = Proud::ByteArray::vftable;
  local_1af8 = &local_1a58;
  uVar8 = FUN_14035bed0(&local_1ae0,0x27,*param_4,&local_1ae8);
  (**(code **)(*param_1 + 0x80))(param_1,uVar8);
  FUN_1403555d0(&local_1a58);
  puVar7 = local_1ae8;
  if (((local_1ae8 != (uint *)0x0) && (local_1ae8 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar11 = local_1ae8 + -2, puVar11 != (uint *)0x0)) {
    uVar8 = FUN_14034fe70();
    local_1a68 = uVar8;
    FUN_14034ed40(uVar8);
    local_1a60 = 1;
    puVar7 = puVar7 + -1;
    *puVar7 = *puVar7 - 1;
    if (*puVar7 == 0) {
      FUN_14034ff60(puVar11);
    }
    FUN_14034edd0(uVar8);
  }
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar8 = FUN_14034fe70();
    local_1a68 = uVar8;
    FUN_14034ed40(uVar8);
    local_1a60 = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar8);
  }
  local_1ae0 = &local_1ac8;
  FUN_140399690(&local_1ac8);
  if (local_1ac0 != 0) {
    if (local_1ab4 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_1ab8 = 0;
  }
  local_1ae0 = &local_1aa0;
  FUN_140399690(&local_1aa0);
  param_4 = local_1a80;
  if ((local_1a98 != 0) && (local_1a8c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
LAB_140388e26:
  local_1af8 = (undefined ***)CONCAT44(local_1af8._4_4_,param_5);
  uVar9 = FUN_140386fe0(param_1,param_2,local_1a78,param_4);
  return uVar9;
}



undefined8 * FUN_140388e70(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_140388ea0(undefined8 *param_1)

{
  *param_1 = Proud::IRmiStub::vftable;
  if (param_1[2] != 0) {
    FUN_14034fa20(
                 L"RMI Stub which is still in use by ProudNet core cannot be destroyed! Destroy CNetClient or CNetServer instance first."
                 );
  }
  return;
}



undefined8 * FUN_140388ed0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::IRmiStub::vftable;
  if (param_1[2] != 0) {
    FUN_14034fa20(
                 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_140388f20(undefined8 *param_1)

{
  *param_1 = Proud::CTestUdpConnReset::vftable;
  param_1[1] = 0;
  memset(param_1 + 2,0,100);
  return param_1;
}



void FUN_140388f60(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_1403556b0(lVar2);
        FUN_14034ff60(lVar2);
      }
      FUN_14034ff60(plVar1);
    }
  }
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void * FUN_140388ff0(void *param_1,uint param_2)

{
  FUN_140388f60();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140389020(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  if (lVar1 != 0) {
    FUN_1403556b0(lVar1);
    FUN_14034ff60(lVar1);
  }
  return;
}



void FUN_140389050(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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_140389130(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_14034f7d0();
}



int FUN_1403891d0(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_14034f7d0();
    }
    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_140389270(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_1405d83d0;
        *puVar1 = DAT_1405d83d4;
      }
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 0x1c;
    } while (iVar2 < param_2);
  }
  return;
}



void FUN_1403892e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  FUN_1403a9c50(param_1 + 0x188,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0),param_3,
                param_4,0xfffffffffffffffe);
  if (*(char *)(param_1 + 0x198) == '\x01') {
    FUN_14036ae30(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1403a9c50(param_1 + 0x1a0,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 0x1b0) == '\x01') {
    FUN_14037c9c0(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1403a9c50(param_1 + 0x1b8,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 0x1c8) == '\x01') {
    FUN_140383020(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1403a9c50(param_1 + 0x1d0,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 0x1e0) == '\x01') {
    FUN_14036c7c0(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1403a9c50(param_1 + 0xa0,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 0xb0) == '\x01') {
    FUN_140361ce0(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1403a9c50(param_1 + 0xb8,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 200) == '\x01') {
    FUN_1403838a0(*(undefined8 *)(param_1 + 0x148));
  }
  FUN_1403a9c50(param_1 + 0x248,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
  if (*(char *)(param_1 + 600) == '\x01') {
    uVar1 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    FUN_14034ed40(uVar1);
    if (DAT_1405f064f != '\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_140374db0(*(longlong *)(param_1 + 0x148) + 0x2d8,uVar2);
    FUN_14034edd0(uVar1);
  }
  if (*(int *)(*(longlong *)(param_1 + 0x148) + 600) != 0) {
    FUN_1403a9c50(param_1 + 0x1e8,*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0));
    if (*(char *)(param_1 + 0x1f8) == '\x01') {
      LOCK();
      *(undefined4 *)(param_1 + 0x200) = 1;
      UNLOCK();
    }
  }
  FUN_14036f1c0(*(undefined8 *)(param_1 + 0x148));
  return;
}



void FUN_140389500(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_1403a0570(local_res10,lVar1,param_3,param_4,0xfffffffffffffffe);
  FUN_14034ed40(param_3 + 0xa8);
  if ((*(longlong **)(param_3 + 0x150) != (longlong *)0x0) &&
     (**(longlong **)(param_3 + 0x150) != 0)) {
    FUN_140356dc0();
  }
  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_1403a0720(param_3);
  FUN_14034edd0(param_3 + 0xa8);
  FUN_1403a0580(local_res10);
  return;
}



void FUN_140389600(longlong param_1,undefined8 param_2,longlong param_3,undefined8 param_4)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_140385b50(param_3 + 0xc0);
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  uVar4 = uVar2;
  FUN_14034ed40(uVar2);
  if (DAT_1405f064f != '\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_140399920(param_3);
  FUN_14034edd0(uVar2);
  return;
}



void FUN_140389690(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_1403840e0(param_2,&local_res18,8,param_4,0xfffffffffffffffe), cVar1 != '\0')) {
    uVar2 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_40 = uVar2;
    FUN_14034ed40(uVar2);
    local_38 = 1;
    if (DAT_1405f064f != '\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_1403a0570(local_res20,lVar4);
    lVar3 = lVar5;
    if (*(longlong **)(param_3 + 0x740) != (longlong *)0x0) {
      lVar3 = **(longlong **)(param_3 + 0x740);
    }
    lVar3 = lVar3 + 0xa8;
    local_30 = lVar3;
    FUN_14034ed40(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_14039bcd0(*(undefined8 *)(lVar5 + 0x168),&local_50,local_res18);
    FUN_14034edd0(lVar3);
    FUN_1403a0580(local_res20);
    FUN_14034edd0(uVar2);
  }
  return;
}



void FUN_1403897f0(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 0x000140389817. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void FUN_140389830(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 0x000140389857. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 * FUN_140389870(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1403898d0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140389930(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_140389990(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403899f0(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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      *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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                L"Proud::CListNode<class Proud::ITaskSubject::CNode>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_140389ae0(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_1403891d0();
      plVar1 = *(longlong **)(param_1 + 8);
      lVar3 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_14034fef0(lVar3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar3);
        }
      }
      else {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_14034ff20(*(undefined8 *)(param_1 + 0x10),lVar3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,*(undefined8 *)(param_1 + 0x10),lVar3);
        }
        if (lVar3 == 0) {
          FUN_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      *(longlong *)(param_1 + 0x10) = lVar3;
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_140389ba0(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;
}



void FUN_140389c20(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 0x000140389c47. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void FUN_140389c60(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 0x000140389c87. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x000140389fda)

void FUN_140389ca0(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_14034ed40(lVar5);
  lVar8 = *(longlong *)(param_1 + 0x148) + 2000;
  FUN_14034ed40(lVar8);
  iVar6 = 0;
  iVar10 = *(int *)(*(longlong *)(param_1 + 0x148) + 0x818) +
           *(int *)(*(longlong *)(param_1 + 0x148) + 0x838);
  FUN_140394870(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_1403a0550(lVar4 + 0x40);
    if (lVar4 == 0) {
      lVar2 = 0;
    }
    else {
      lVar2 = lVar4 + 0x88;
    }
    *plVar7 = lVar2;
    if (*(longlong *)(lVar4 + 0xa0) != 0) {
      FUN_14035d230(*(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_1403a0550(lVar4 + 0xc0);
      if (lVar4 == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = lVar4 + 0x108;
      }
      *plVar7 = lVar2;
      if (*(longlong *)(lVar4 + 0x120) != 0) {
        FUN_14035cf30(*(longlong *)(lVar4 + 0x120),lVar4);
      }
      plVar7 = plVar7 + 1;
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x808);
    } while (lVar4 != 0);
  }
  FUN_14034edd0(lVar8);
  FUN_14034edd0(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_14034ed40(uVar3);
          iVar6 = (**(code **)(*plVar7 + 8))(plVar7);
          FUN_14034edd0(uVar3);
          if (iVar6 != 0) {
            uVar3 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
            FUN_14034ed40(uVar3);
            if (DAT_1405f064f != '\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_14034edd0(uVar3);
          }
          (**(code **)(*plVar7 + 0x18))(plVar7);
          *plVar9 = plVar9[lVar5 + -1];
LAB_140389fd2:
          lVar5 = lVar5 + -1;
        }
        else {
          cVar1 = FUN_14034ed90();
          if (cVar1 != '\0') {
            iVar6 = (**(code **)(*plVar7 + 8))(plVar7);
            FUN_14034edd0(uVar3);
            if (iVar6 != 0) {
              uVar3 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
              FUN_14034ed40(uVar3);
              if (DAT_1405f064f != '\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_14034edd0(uVar3);
            }
            (**(code **)(*plVar7 + 0x18))(plVar7);
            plVar9[lVar8] = plVar9[lVar5 + -1];
            goto LAB_140389fd2;
          }
        }
        lVar8 = lVar8 + 1;
      } while (lVar8 < lVar5);
    } while (0 < lVar5);
  }
  return;
}



void thunk_FUN_1403899f0(void)

{
  FUN_1403899f0();
  return;
}



void FUN_14038a040(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_14034f7d0();
  }
  iVar2 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar2) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_14035ce90(param_1,param_2);
      plVar1 = *(longlong **)(param_1 + 8);
      lVar4 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          uVar3 = FUN_14034fef0(lVar4 * 0x38);
        }
        else {
          uVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar4 * 0x38);
        }
        *(undefined8 *)(param_1 + 0x10) = uVar3;
        FUN_140389270(uVar3,(longlong)param_2);
      }
      else {
        uVar3 = *(undefined8 *)(param_1 + 0x10);
        if (plVar1 == (longlong *)0x0) {
          lVar4 = FUN_14034fef0(lVar4 * 0x38);
        }
        else {
          lVar4 = (**(code **)(*plVar1 + 8))(plVar1,lVar4 * 0x38);
        }
        FUN_140389ba0(lVar4,uVar3,(longlong)*(int *)(param_1 + 0x18));
        FUN_140389270((longlong)*(int *)(param_1 + 0x18) * 0x38 + lVar4,
                      (longlong)(param_2 - *(int *)(param_1 + 0x18)));
        if (lVar4 == 0) {
          FUN_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_14034ff60(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_140389270((longlong)iVar2 * 0x38 + *(longlong *)(param_1 + 0x10),
                    (longlong)(param_2 - iVar2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_14038a1d0(longlong param_1)

{
  CloseHandle(*(HANDLE *)(param_1 + 0x20));
  FUN_1403899f0(param_1 + 8);
  return;
}



void FUN_14038a200(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_14037ea90(*(undefined8 *)(param_1 + 0x148),0,
                  "Proud::CNetThreads_S::UserWorkerThread_FinalReceiveRmi",2);
  }
  local_res20 = 0;
  iVar5 = 0;
  local_a0[0] = 0;
  cVar2 = FUN_140384a90(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_14034f800();
      }
      plVar1 = *(longlong **)
                (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x40) + (longlong)iVar5 * 8);
      FUN_140383db0(local_98,iVar4);
      bVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,param_2 + 8);
      local_res20 = local_res20 | bVar3;
    }
    if (local_res20 == 0) {
      FUN_140383db0(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_1403a6bc0(param_1 + 0x160,*(undefined4 *)(param_2 + 0x30),0);
  }
  return;
}



undefined8 FUN_14038a370(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  DWORD DVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  
  FUN_14034ed40();
  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_14034f800();
        }
        plVar2 = *(longlong **)(*(longlong *)(param_1 + 0x70) + lVar6 * 8);
        lVar4 = 0;
        if (plVar2 != (longlong *)0x0) {
          lVar4 = *plVar2;
        }
        if (*(DWORD *)(lVar4 + 8) == DVar3) {
          FUN_14034edd0(param_1);
          return 1;
        }
        iVar5 = iVar5 + 1;
        lVar6 = lVar6 + 1;
      } while (iVar5 < iVar1);
    }
  }
  FUN_14034edd0(param_1);
  return 0;
}



void FUN_14038a400(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_1403841b0();
        *(undefined ***)(puVar1 + -6) = Proud::AddrPort::vftable;
        *(undefined4 *)(puVar1 + -2) = 0;
        *puVar1 = 0;
        *(undefined1 *)(puVar1 + 2) = 0;
        *(undefined4 *)(puVar1 + -10) = 0;
        *(undefined4 *)(puVar1 + -2) = DAT_1405d83d0;
        *puVar1 = DAT_1405d83d4;
      }
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 0x24;
    } while (iVar2 < param_2);
  }
  return;
}



void FUN_14038a4a0(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_1403841e0(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;
}



void FUN_14038a540(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  undefined *puVar3;
  
  uVar2 = 0xfffffffffffffffe;
  puVar3 = &DAT_1405f28a8;
  FUN_14034ed40(&DAT_1405f28a8);
  *(undefined4 *)(param_1 + 0x50) = 0;
  *(undefined8 *)(param_1 + 0x58) = 0;
  FUN_140389ae0(param_1,0,param_3,param_4,uVar2,puVar3,1);
  FUN_1400179d0(param_1 + 0x28,0);
  puVar1 = DAT_1405f28a0;
  if ((*(short *)(param_1 + -8) == 0x1de6) && (*(longlong *)(param_1 + 0x60) == 0)) {
    *(undefined8 *)(param_1 + 0x60) = *DAT_1405f28a0;
    *puVar1 = (short *)(param_1 + -8);
    FUN_14034edd0(&DAT_1405f28a8);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_14038a5d0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_14038a540();
  }
  return;
}



void FUN_14038a5f0(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_1403574e0(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(puVar3);
    }
  }
  return;
}



void FUN_14038a680(longlong param_1,longlong param_2)

{
  undefined4 *puVar1;
  int iVar2;
  
  if (0 < param_2) {
    iVar2 = 0;
    puVar1 = (undefined4 *)(param_1 + 0x18);
    do {
      FUN_140399690(puVar1 + -4);
      if (*(longlong *)(puVar1 + -2) != 0) {
        if ((int)puVar1[1] < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        *puVar1 = 0;
      }
      iVar2 = iVar2 + 1;
      puVar1 = puVar1 + 0x12;
    } while (iVar2 < param_2);
  }
  return;
}



void FUN_14038a6f0(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_1403a9d00(local_res8);
  cVar2 = *(char *)(param_1 + 0x140);
  while (cVar2 == '\0') {
    FUN_140359f50(param_1 + 0x150,100);
    uVar6 = FUN_14035a2f0(*(longlong *)(param_1 + 0x148) + 0x760);
    *(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x1c0) = uVar6;
    uVar6 = FUN_14035a290(*(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_1403892e0(param_1);
    cVar2 = *(char *)(param_1 + 0x140);
  }
  FUN_14036c870(*(undefined8 *)(param_1 + 0x148));
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
    FUN_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    FUN_140017720(&local_res10,&DAT_1404578d0,L"Proud::CNetThreads_S::Heartbeat_Main");
    puVar3 = local_res10;
    puVar5 = local_res10;
    if (local_res10 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8010;
    }
    FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar5);
    if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
       (puVar3 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      FUN_14034ed40(uVar6);
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar3 + -8);
      }
      FUN_14034edd0(uVar6);
    }
  }
  FUN_1403a9d30(local_res8);
  return;
}



void FUN_14038a880(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_1403a0570(local_res18,lVar8);
  uVar5 = (**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
  FUN_14034ed40(uVar5);
  bVar2 = true;
  **(undefined1 **)(param_3 + 0x748) = 0;
  if (*(int *)(param_2 + 8) < 0) {
    FUN_14034edd0(uVar5);
    bVar2 = false;
    FUN_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    FUN_140017720(&local_res10,L"%s:%d",
                  L"Proud::CNetThreads_S::NetWorkerThread_TcpSendCompletionCase",
                  *(undefined4 *)(param_2 + 0xc));
    local_68 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    FUN_14034ed40(local_68);
    local_60 = 1;
    if (DAT_1405f064f != '\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_1405d8010;
    }
    FUN_140381580(*(undefined8 *)(param_1 + 0x148),param_3,0xb,3,&local_a0,puVar7,
                  *(undefined4 *)(param_2 + 0xc));
    FUN_1403555d0(&local_a0);
    FUN_14034edd0(local_68);
    if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
       (puVar3 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      local_58 = uVar6;
      FUN_14034ed40(uVar6);
      local_50 = 1;
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar3 + -8);
      }
      FUN_14034edd0(uVar6);
    }
  }
  else {
    FUN_1403a3090(*(longlong *)(param_3 + 0x748) + 0x48);
    iVar4 = FUN_1403a0220(*(undefined8 *)(param_3 + 0x748));
    if (iVar4 != 0) {
      FUN_14034edd0(uVar5);
      bVar2 = false;
      uVar6 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_78 = uVar6;
      FUN_14034ed40(uVar6);
      local_70 = 1;
      if (DAT_1405f064f != '\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_1403555d0(&local_c8);
      (**(code **)(*(longlong *)(param_3 + 0xa0) + 0x40))
                (param_3 + 0xa0,L"Proud::CNetThreads_S::NetWorkerThread_TcpSendCompletionCase");
      FUN_14034edd0(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_14034edd0(uVar5);
  }
  FUN_1403a0580(local_res18);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038aba0(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_1405d84f0 ^ (ulonglong)auStack_da8;
  FUN_140385b50(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_1403840e0(param_2,&local_ce8,0x10);
  if (cVar5 == '\0') {
    return;
  }
  cVar5 = FUN_140384b10(param_2,&local_d68);
  if (cVar5 != '\0') {
    cVar5 = FUN_140384b10(param_2,&local_d78);
    if (cVar5 == '\0') {
      return;
    }
    uVar7 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_d00 = uVar7;
    FUN_14034ed40(uVar7);
    local_cf8 = 1;
    if (DAT_1405f064f != '\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_1403a2080(param_3 + 0x700,&local_ce8);
      *(undefined4 *)(param_3 + 0x720) = local_d60;
      *(undefined2 *)(param_3 + 0x724) = local_d5c;
      FUN_14036c760(*(undefined8 *)(param_1 + 0x148),param_3);
      FUN_1403841b0(local_d30);
      FUN_140383c40(local_d30);
      FUN_140384310(local_d30,0x800);
      FUN_140384310(local_d30,0);
      FUN_140058870(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_140090370(local_d30,&local_ce8);
      puVar8 = (undefined *)(**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
      local_d40 = puVar8;
      FUN_14034ed40(puVar8);
      local_d38 = 1;
      uVar9 = FUN_140361500(local_cd8,local_d30);
      local_ce8 = (undefined **)0x0;
      uStack_ce0 = CONCAT31(uStack_ce0._1_3_,1);
      FUN_1403a03a0(*(undefined8 *)(param_3 + 0x748),uVar9,&local_ce8);
      FUN_1403606a0(local_cd8);
      FUN_14034edd0(puVar8);
      if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
        FUN_14034fe70();
        local_d40 = PTR_DAT_1405d8010;
        plVar10 = (longlong *)FUN_140353960(&local_d78,&local_ce8);
        plVar11 = (longlong *)FUN_140353960(&local_d68,&local_d48);
        local_d88 = (undefined *)*plVar10;
        if ((undefined *)*plVar10 == (undefined *)0x0) {
          local_d88 = PTR_DAT_1405d8010;
        }
        puVar8 = (undefined *)*plVar11;
        if ((undefined *)*plVar11 == (undefined *)0x0) {
          puVar8 = PTR_DAT_1405d8010;
        }
        FUN_140017720(&local_d40,&DAT_140457a20,*(undefined4 *)(param_3 + 0x6f8),puVar8);
        if (((local_d48 != (undefined *)0x0) && (local_d48 != PTR_DAT_1405d8010)) &&
           (local_d48 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_d58 = uVar9;
          FUN_14034ed40(uVar9);
          local_d50 = 1;
          piVar1 = (int *)(local_d48 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_d48 + -8);
          }
          FUN_14034edd0(uVar9);
        }
        ppuVar4 = local_ce8;
        local_d48 = PTR_DAT_1405d8010;
        if (((local_ce8 != (undefined **)0x0) && (local_ce8 != (undefined **)PTR_DAT_1405d8010)) &&
           (ppuVar2 = local_ce8 + -1, ppuVar2 != (undefined **)0x0)) {
          uVar9 = FUN_14034fe70();
          local_d58 = uVar9;
          FUN_14034ed40(uVar9);
          local_d50 = 1;
          piVar1 = (int *)((longlong)ppuVar4 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppuVar2);
          }
          FUN_14034edd0(uVar9);
        }
        puVar8 = local_d40;
        puVar12 = local_d40;
        if (local_d40 == (undefined *)0x0) {
          puVar12 = PTR_DAT_1405d8010;
        }
        FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),1,puVar12);
        if (((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1405d8010)) &&
           (puVar8 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_d58 = uVar9;
          FUN_14034ed40(uVar9);
          local_d50 = 1;
          piVar1 = (int *)(puVar8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar8 + -8);
          }
          FUN_14034edd0(uVar9);
        }
      }
      local_ce8 = &local_d28;
      FUN_140399690(&local_d28);
      if ((local_d20 != 0) && (local_d14 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
    FUN_14034edd0(uVar7);
    return;
  }
  return;
}



void FUN_14038b020(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_140385b50(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_140384b10(param_2,&local_118);
  if (((cVar4 != '\0') && (cVar4 = FUN_140384b10(param_2,&local_130), cVar4 != '\0')) &&
     (cVar4 = FUN_140384b70(param_2,local_res18), cVar4 != '\0')) {
    uVar7 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_f8 = uVar7;
    FUN_14034ed40(uVar7);
    local_f0 = 1;
    if (DAT_1405f064f != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),
                 L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_PeerUdp_NotifyHolepunchSuccess"
                );
    }
    lVar8 = FUN_140361850(*(undefined8 *)(param_1 + 0x148),local_res18[0]);
    if (lVar8 != 0) {
      plVar9 = (longlong *)
               FUN_14036ff50(*(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_14035caa0(pvVar2);
          operator_delete(pvVar2);
        }
        FUN_14034ff60(local_res20);
        uVar7 = local_f8;
      }
      if (((lVar16 != 0) && (*(char *)(lVar16 + 0x1a0) == '\0')) &&
         (cVar4 = FUN_14035cae0(lVar16), cVar4 != '\0')) {
        iVar5 = FUN_14035ca60(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_14035c800(lVar16,*(undefined4 *)(param_3 + 0x6f8),&local_108,&local_e0);
        iVar6 = FUN_14035ca60(lVar16);
        if ((iVar6 == 2) && (iVar5 == 1)) {
          lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x4a8);
          uVar10 = FUN_14035c9e0(lVar16,local_78,*(undefined4 *)(lVar8 + 0x6f8));
          uVar11 = FUN_14035c8e0(lVar16,local_98,*(undefined4 *)(lVar8 + 0x6f8));
          (**(code **)(lVar3 + 0x60))
                    (*(longlong *)(param_1 + 0x148) + 0x4a8,*(undefined4 *)(param_3 + 0x6f8),
                     &DAT_1405f2490,lVar8 + 0x6f8,uVar11,uVar10);
          lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x148) + 0x4a8);
          uVar10 = FUN_14035c9e0(lVar16,local_58,*(undefined4 *)(param_3 + 0x6f8));
          uVar11 = FUN_14035c8e0(lVar16,local_88,*(undefined4 *)(param_3 + 0x6f8));
          (**(code **)(lVar3 + 0x60))
                    (*(longlong *)(param_1 + 0x148) + 0x4a8,*(undefined4 *)(lVar8 + 0x6f8),
                     &DAT_1405f2490,param_3 + 0x6f8,uVar11,uVar10);
          uVar18 = (undefined4)((ulonglong)uVar11 >> 0x20);
          if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
            FUN_14034fe70();
            local_138 = PTR_DAT_1405d8010;
            puVar12 = (undefined8 *)FUN_14035c9e0(lVar16,local_68,*(undefined4 *)(lVar8 + 0x6f8));
            puVar13 = (undefined8 *)FUN_14035c9e0(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_1405d8010;
            }
            puVar15 = (undefined *)*plVar14;
            if ((undefined *)*plVar14 == (undefined *)0x0) {
              puVar15 = PTR_DAT_1405d8010;
            }
            FUN_140017720(&local_138,&DAT_140457b80,*(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_1405d8010)) &&
               (local_120 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_14034fe70();
              local_b0 = uVar10;
              FUN_14034ed40(uVar10);
              local_a8 = 1;
              piVar1 = (int *)(local_120 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_120 + -8);
              }
              FUN_14034edd0(uVar10);
            }
            local_120 = PTR_DAT_1405d8010;
            if (((local_e8 != (undefined *)0x0) && (local_e8 != PTR_DAT_1405d8010)) &&
               (local_e8 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_14034fe70();
              local_c0 = uVar10;
              FUN_14034ed40(uVar10);
              local_b8 = 1;
              piVar1 = (int *)(local_e8 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_e8 + -8);
              }
              FUN_14034edd0(uVar10);
            }
            puVar17 = local_138;
            puVar15 = local_138;
            if (local_138 == (undefined *)0x0) {
              puVar15 = PTR_DAT_1405d8010;
            }
            FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),1,puVar15);
            if (((puVar17 != (undefined *)0x0) && (puVar17 != PTR_DAT_1405d8010)) &&
               (puVar17 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_14034fe70();
              local_d0 = uVar10;
              FUN_14034ed40(uVar10);
              local_c8 = 1;
              piVar1 = (int *)(puVar17 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(puVar17 + -8);
              }
              FUN_14034edd0(uVar10);
            }
          }
        }
      }
    }
    FUN_14034edd0(uVar7);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038b500(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_1405d84f0 ^ (ulonglong)auStack_db8;
  FUN_140385b50(param_4 + 0x40);
  local_cd8 = (undefined **)0x0;
  uStack_cd0 = 0;
  cVar4 = FUN_1403840e0(param_2,&local_cd8);
  if (cVar4 != '\0') {
    FUN_1403841b0(local_d80);
    FUN_140383c40(local_d80);
    FUN_140384310(local_d80,0x800);
    FUN_140384310(local_d80,0);
    FUN_140058870(local_d80,0xd);
    FUN_140090370(local_d80,&local_cd8);
    FUN_140384db0(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_140399790();
      }
    }
    else {
      local_d68 = *(undefined4 *)(local_d78 + 0x18);
    }
    lVar9 = local_d70;
    if (local_d70 == 0) {
      if (local_d78 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_1405d81cc;
    local_cd8 = Proud::AddrPort::vftable;
    uStack_cd0 = CONCAT26(uStack_cd0._6_2_,*(undefined6 *)(param_3 + 8));
    uStack_cc0 = local_d68;
    uVar5 = FUN_14039b1d0(1);
    local_d90 = &local_d58;
    local_d98 = &local_cc8;
    FUN_1403a0a50(param_4,0,uVar5,&local_cd8);
    if (local_48 == (undefined4 *)0x0) {
      FUN_14034f420(local_d20,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d20,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_3c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    uVar6 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_d38 = uVar6;
    FUN_14034ed40(uVar6);
    local_d30 = 1;
    if (DAT_1405f064f != '\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_14034fe70();
      local_d88 = PTR_DAT_1405d8010;
      plVar7 = (longlong *)FUN_140353960(param_3,&local_cd8);
      puVar10 = (undefined *)*plVar7;
      if ((undefined *)*plVar7 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1405d8010;
      }
      FUN_140017720(&local_d88,L"MessageType_ServerHolepunch from %s",puVar10);
      ppuVar3 = local_cd8;
      if (((local_cd8 != (undefined **)0x0) && (local_cd8 != (undefined **)PTR_DAT_1405d8010)) &&
         (ppuVar1 = local_cd8 + -1, ppuVar1 != (undefined **)0x0)) {
        uVar8 = FUN_14034fe70();
        local_d58 = uVar8;
        FUN_14034ed40(uVar8);
        local_d50 = CONCAT71(local_d50._1_7_,1);
        piVar2 = (int *)((longlong)ppuVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(ppuVar1);
        }
        FUN_14034edd0(uVar8);
      }
      puVar10 = local_d88;
      puVar11 = local_d88;
      if (local_d88 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),1,puVar11);
      if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
         (puVar10 + -8 != (undefined *)0x0)) {
        uVar8 = FUN_14034fe70();
        local_d58 = uVar8;
        FUN_14034ed40(uVar8);
        local_d50 = CONCAT71(local_d50._1_7_,1);
        piVar2 = (int *)(puVar10 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar10 + -8);
        }
        FUN_14034edd0(uVar8);
      }
    }
    FUN_14034edd0(uVar6);
    local_cd8 = (undefined **)&local_d78;
    FUN_140399690(&local_d78);
    if ((local_d70 != 0) && (local_d64 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038b8a0(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_1405d84f0 ^ (ulonglong)auStack_dc8;
  FUN_140385b50(param_4 + 0x40);
  local_cd8 = (undefined **)0x0;
  uStack_cd0 = 0;
  cVar4 = FUN_1403840e0(param_2,&local_cd8);
  if ((cVar4 != '\0') && (cVar4 = FUN_140384b70(param_2,local_d98), cVar4 != '\0')) {
    FUN_1403841b0(local_d88);
    FUN_140383c40(local_d88);
    FUN_140384310(local_d88,0x800);
    FUN_140384310(local_d88,0);
    FUN_140058870(local_d88,0x11);
    FUN_140090370(local_d88,&local_cd8);
    FUN_140384db0(local_d88,param_3);
    FUN_140058470(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_140399790();
      }
    }
    else {
      local_d70 = *(undefined4 *)(local_d80 + 0x18);
    }
    lVar6 = local_d78;
    if (local_d78 == 0) {
      if (local_d80 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_1405d81cc;
    local_cd8 = Proud::AddrPort::vftable;
    uStack_cd0 = CONCAT26(uStack_cd0._6_2_,*(undefined6 *)(param_3 + 8));
    uStack_cc0 = local_d70;
    uVar5 = FUN_14039b1d0(1);
    local_da0 = &local_d60;
    local_da8 = &local_cc8;
    FUN_1403a0a50(param_4,0,uVar5,&local_cd8);
    if (local_48 == (undefined4 *)0x0) {
      FUN_14034f420(local_d28,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d28,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_3c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    uVar7 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_d40 = uVar7;
    FUN_14034ed40(uVar7);
    local_d38 = 1;
    if (DAT_1405f064f != '\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_14034fe70();
      local_d90 = PTR_DAT_1405d8010;
      plVar8 = (longlong *)FUN_140353960(param_3,&local_cd8);
      puVar10 = (undefined *)*plVar8;
      if ((undefined *)*plVar8 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1405d8010;
      }
      FUN_140017720(&local_d90,L"MessageType_PeerUdp_ServerHolepunch from %s",puVar10);
      ppuVar3 = local_cd8;
      if (((local_cd8 != (undefined **)0x0) && (local_cd8 != (undefined **)PTR_DAT_1405d8010)) &&
         (ppuVar1 = local_cd8 + -1, ppuVar1 != (undefined **)0x0)) {
        uVar9 = FUN_14034fe70();
        local_d60 = uVar9;
        FUN_14034ed40(uVar9);
        local_d58 = CONCAT71(local_d58._1_7_,1);
        piVar2 = (int *)((longlong)ppuVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(ppuVar1);
        }
        FUN_14034edd0(uVar9);
      }
      puVar10 = local_d90;
      puVar11 = local_d90;
      if (local_d90 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),1,puVar11);
      if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
         (puVar10 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_d60 = uVar9;
        FUN_14034ed40(uVar9);
        local_d58 = CONCAT71(local_d58._1_7_,1);
        piVar2 = (int *)(puVar10 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar10 + -8);
        }
        FUN_14034edd0(uVar9);
      }
    }
    FUN_14034edd0(uVar7);
    local_cd8 = (undefined **)&local_d80;
    FUN_140399690(&local_d80);
    if ((local_d78 != 0) && (local_d6c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return;
}



void FUN_14038bc60(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_140357920(DVar1,"PNSrv Heartbeat");
  FUN_14038a6f0(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,0x00014038c33c)

void FUN_14038bc90(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 = 0x14038bca6;
  puVar15 = auStack_1b88;
  puVar17 = auStack_1b88;
  local_1a80 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (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_140384d20(param_2,&local_1b50);
  puVar16 = auStack_1b88;
  if ((cVar6 == '\0') ||
     (cVar6 = FUN_140384780(param_2,&local_1b58), plVar3 = local_1b58, puVar16 = auStack_1b88,
     cVar6 == '\0')) {
LAB_14038c48b:
    lVar8 = local_1b40;
    plVar3 = local_1b48;
    local_1b50 = Proud::CFastArray<>::vftable;
    if (local_1b40 == 0) goto LAB_14038c4bb;
    puVar17 = puVar16;
    if (local_1b48 != (longlong *)0x0) {
      pcVar5 = *(code **)(*local_1b48 + 0x18);
      *(undefined8 *)(puVar16 + -8) = 0x14038c4b4;
      (*pcVar5)(plVar3,lVar8);
      goto LAB_14038c4bb;
    }
  }
  else {
    iVar18 = (int)local_1b58;
    if ((-1 < iVar18) && (iVar18 < DAT_1405d8140)) {
      iVar1 = *param_2;
      iVar7 = FUN_14035fc20(param_2);
      if (((int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3) + iVar18 != iVar7) {
        FUN_14037ea90(*(undefined8 *)(param_1 + 0x148),param_3,
                      "msg.GetReadOffset() + payloadLength == msg.GetLength()",2);
      }
      FUN_1403841b0(local_1b20);
      cVar6 = FUN_140384410(param_2,local_1b20,(ulonglong)plVar3 & 0xffffffff);
      if (cVar6 == '\0') {
        FUN_14037ea90(*(undefined8 *)(param_1 + 0x148),param_3,&DAT_140457fe8,2);
        local_1b58 = &local_1b18;
        FUN_140399690(&local_1b18);
        puVar16 = auStack_1b88;
        if (local_1b10 != 0) {
          if (local_1b04 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          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_140399690(&local_1b18);
          puVar16 = auStack_1b88;
          if (local_1b10 != 0) {
            if (local_1b04 < 0) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            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_14038be6b:
              puVar21 = (undefined8 *)(puVar10 + 4);
            }
          }
          else {
            puVar10 = malloc(uVar22);
            puVar21 = (undefined8 *)0x0;
            if (puVar10 != (undefined4 *)0x0) {
              *puVar10 = 0xdddd;
              puVar15 = auStack_1b88;
              goto LAB_14038be6b;
            }
          }
          pcVar5 = *(code **)(**(longlong **)(param_1 + 0x148) + 0x58);
          *(undefined8 *)(puVar15 + -8) = 0x14038be7c;
          uVar11 = (*pcVar5)();
          local_1ad0 = uVar11;
          *(undefined8 *)(puVar15 + -8) = 0x14038be8b;
          FUN_14034ed40(uVar11);
          local_1ac8 = 1;
          plVar3 = *(longlong **)(param_1 + 0x148);
          if (DAT_1405f064f != '\0') {
            pcVar5 = *(code **)(*plVar3 + 200);
            *(undefined8 *)(puVar15 + -8) = 0x14038beb3;
            (*pcVar5)(plVar3,L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_ReliableRelay1")
            ;
          }
          pcVar5 = *(code **)(*param_3 + 0x10);
          *(undefined8 *)(puVar15 + -8) = 0x14038bebd;
          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_14038bf5e:
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar15 + -8) = &UNK_14038bf63;
                FUN_14034f800();
              }
              if ((int)local_1b38 <= (int)uVar22) goto LAB_14038bf5e;
              uVar2 = *(undefined4 *)(local_1b40 + uVar14 * 8);
              uVar11 = *(undefined8 *)(param_1 + 0x148);
              *(undefined8 *)(puVar15 + -8) = 0x14038beff;
              lVar12 = FUN_140361850(uVar11,uVar2);
              if (lVar12 != 0) {
                *(undefined8 *)(puVar15 + -8) = 0x14038bf13;
                FUN_1403a0550(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) = 0x14038bf70;
          FUN_14034edd0(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) = 0x14038bfcb;
              uVar11 = (*pcVar5)();
              local_1af0 = 0;
              local_1af8 = uVar11;
              *(undefined8 *)(puVar15 + -8) = 0x14038bfe2;
              FUN_1403841b0(local_1a18);
              *(undefined8 *)(puVar15 + -8) = 0x14038bffc;
              FUN_140383e30(local_1a18,local_19f0,0x80);
              *(undefined8 *)(puVar15 + -8) = 0x14038c00b;
              FUN_140058870(local_1a18,0x17);
              uVar2 = local_1b28;
              *(undefined8 *)(puVar15 + -8) = 0x14038c01a;
              FUN_140058470(local_1a18,uVar2);
              *(undefined8 *)(puVar15 + -8) = 0x14038c028;
              FUN_140058470(local_1a18,uVar14 & 0xffffffff);
              *(undefined8 *)(puVar15 + -8) = 0x14038c03b;
              FUN_140383bc0(&local_1ae8,local_1a18);
              lVar13 = (longlong)(int)local_1b58;
              *(undefined8 *)(puVar15 + -8) = 0x14038c04c;
              FUN_140385580(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) = 0x14038c3fd;
                  FUN_140399790();
                }
              }
              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_14038c3f7;
                  FUN_140399790();
                }
                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) = 0x14038c103;
              FUN_1403607b0(local_cd8,&local_1968);
              if (local_ce8 == (undefined4 *)0x0) {
                *(undefined8 *)(puVar15 + -8) = 0x14038c3de;
                FUN_14034f420(local_1a78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
                *(undefined8 *)(puVar15 + -8) = 0x14038c3f1;
                _CxxThrowException(local_1a78,(ThrowInfo *)&DAT_1405d36c0);
              }
              if (local_cdc < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar15 + -8) = &UNK_14038c3ca;
                FUN_14034f7d0();
              }
              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) = 0x14038c3c4;
                  FUN_140399790();
                }
              }
              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_14038c3be;
                  FUN_140399790();
                }
                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) = 0x14038c1ad;
              FUN_1403607b0(local_cd8,&local_1968);
              if (local_ce8 == (undefined4 *)0x0) {
                *(undefined8 *)(puVar15 + -8) = 0x14038c3a5;
                FUN_14034f420(local_1a78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
                *(undefined8 *)(puVar15 + -8) = 0x14038c3b8;
                _CxxThrowException(local_1a78,(ThrowInfo *)&DAT_1405d36c0);
              }
              if (local_cdc < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar15 + -8) = &UNK_14038c391;
                FUN_14034f7d0();
              }
              if (lVar12 == 0) {
                local_1af0 = 1;
                *(undefined8 *)(puVar15 + -8) = 0x14038c265;
                FUN_14034ed40(uVar11);
                plVar3 = local_1b60;
                local_1aa0 = 0;
                local_1a98 = 1;
                uVar4 = *(undefined8 *)((longlong)local_1b60 + 0x748);
                *(undefined8 *)(puVar15 + -8) = 0x14038c291;
                FUN_1403a03a0(uVar4,local_cd8,&local_1aa0);
                *(undefined8 *)(puVar15 + -8) = 0x14038c299;
                FUN_14034edd0(uVar11);
                local_1af0 = '\0';
                *(undefined8 *)(puVar15 + -8) = 0x14038c2aa;
                FUN_1403a0560((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_14038c2cb:
                local_1b68[0] = local_1b68[0] + -1;
                lVar8 = lVar8 + -1;
                lVar20 = lVar20 + -0x18;
              }
              else {
                *(undefined8 *)(puVar15 + -8) = 0x14038c1da;
                local_1af0 = FUN_14034ed90();
                if (local_1af0 != '\0') {
                  local_1ac0 = 0;
                  local_1ab8 = 1;
                  uVar4 = *(undefined8 *)((longlong)local_1b60 + 0x748);
                  *(undefined8 *)(puVar15 + -8) = 0x14038c218;
                  FUN_1403a03a0(uVar4,local_cd8,&local_1ac0);
                  *(undefined8 *)(puVar15 + -8) = 0x14038c220;
                  FUN_14034edd0(uVar11);
                  local_1af0 = '\0';
                  lVar13 = (longlong)local_1b60 + 0xc0;
                  *(undefined8 *)(puVar15 + -8) = 0x14038c235;
                  FUN_1403a0560(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_14038c2cb;
                }
              }
              if (local_58 == (undefined1 *)0x0) {
                *(undefined8 *)(puVar15 + -8) = 0x14038c378;
                FUN_14034f420(local_1a78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
                *(undefined8 *)(puVar15 + -8) = 0x14038c38b;
                _CxxThrowException(local_1a78,(ThrowInfo *)&DAT_1405d36c0);
              }
              if (local_4c < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar15 + -8) = &UNK_14038c364;
                FUN_14034f7d0();
              }
              local_50 = 0;
              *(undefined8 *)(puVar15 + -8) = 0x14038c302;
              FUN_140383be0(&local_1ae8);
              local_1b60 = &local_1a10;
              *(undefined8 *)(puVar15 + -8) = 0x14038c31a;
              FUN_140399690(&local_1a10);
              if (local_1a08 != 0) {
                if (local_19fc < 0) {
                    // WARNING: Subroutine does not return
                  *(undefined8 *)(puVar15 + -8) = 0x14038c35e;
                  FUN_14034f7d0();
                }
                local_1a00 = 0;
              }
              lVar12 = lVar12 + 1;
            } while (lVar12 < lVar8);
          }
          if ((puVar21 != (undefined8 *)0x0) && (*(int *)(puVar21 + -2) == 0xdddd)) {
            *(undefined8 *)(puVar15 + -8) = 0x14038c415;
            free(puVar21 + -2);
          }
          local_1b58 = &local_1b18;
          *(undefined8 *)(puVar15 + -8) = 0x14038c427;
          FUN_140399690(&local_1b18);
          puVar16 = puVar15;
          if (local_1b10 != 0) {
            if (local_1b04 < 0) {
                    // WARNING: Subroutine does not return
              *(undefined **)(puVar15 + -8) = &UNK_14038c43a;
              FUN_14034f7d0();
            }
            local_1b08 = 0;
          }
        }
      }
      goto LAB_14038c48b;
    }
    FUN_14037ea90(*(undefined8 *)(param_1 + 0x148),param_3,&DAT_140457fe8,2);
    local_1b50 = Proud::CFastArray<>::vftable;
    puVar16 = auStack_1b88;
    if (local_1b40 == 0) goto LAB_14038c4bb;
    if (local_1b48 != (longlong *)0x0) {
      (**(code **)(*local_1b48 + 0x18))();
      puVar16 = auStack_1b88;
      goto LAB_14038c4bb;
    }
  }
  lVar8 = local_1b40;
  local_1b50 = Proud::CFastArray<>::vftable;
  *(undefined8 *)(puVar17 + -8) = 0x14038c4bb;
  FUN_14034ff60(lVar8);
  puVar16 = puVar17;
LAB_14038c4bb:
  *(undefined8 *)(puVar16 + -8) = 0x14038c4ca;
  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,0x00014038cb1e)

void FUN_14038c4f0(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 = 0x14038c506;
  puVar17 = auStack_1b18;
  local_1a30 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)&local_1af8;
  local_1a58 = param_1;
  cVar5 = FUN_140384910(param_2,local_1ab0);
  puVar16 = auStack_1b18;
  if ((cVar5 == '\0') ||
     (cVar5 = FUN_140384780(param_2,&local_1a48), puVar16 = auStack_1b18, cVar5 == '\0'))
  goto LAB_14038cc2f;
  plVar19 = (longlong *)0x0;
  local_1aa0 = (longlong *)0x0;
  local_1a98 = (longlong *)0x0;
  local_1a90 = 0;
  local_1a88 = 0;
  local_1aa8 = Proud::HostIDArray::vftable;
  cVar5 = FUN_140384780(param_2,&local_1ae8);
  plVar13 = plVar19;
  plVar21 = plVar19;
  if ((cVar5 == '\0') ||
     ((iVar14 = (int)local_1ae8, plVar21 = (longlong *)0x0, iVar14 < 0 || (DAT_1405d8140 < iVar14)))
     ) {
LAB_14038cc0f:
    puVar16 = auStack_1b18;
    if (plVar21 == (longlong *)0x0) goto LAB_14038cc2f;
    puVar16 = auStack_1b18;
    if (plVar13 == (longlong *)0x0) {
LAB_14038cc27:
      *(undefined8 *)(puVar16 + -8) = 0x14038cc2f;
      FUN_14034ff60(plVar21);
      goto LAB_14038cc2f;
    }
    lVar10 = *plVar13;
    puVar16 = auStack_1b18;
  }
  else {
    FUN_14035f6d0(&local_1aa8,local_1ae8 & 0xffffffff);
    plVar21 = local_1a98;
    plVar13 = local_1a98;
    if ((int)local_1a90 == 0) {
      plVar13 = plVar19;
    }
    cVar5 = FUN_1403840e0(param_2,plVar13,iVar14 * 4);
    plVar13 = local_1aa0;
    if (cVar5 == '\0') goto LAB_14038cc0f;
    cVar5 = FUN_140384780(param_2,&local_1ae8);
    uVar15 = local_1ae8;
    puVar16 = auStack_1b18;
    if (cVar5 != '\0') {
      iVar14 = (int)local_1ae8;
      if ((iVar14 < 0) || (DAT_1405d8140 <= iVar14)) {
        FUN_14037ea90(*(undefined8 *)(param_1 + 0x148),param_3,
                      "Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_UnreliableRelay1",2);
        puVar16 = auStack_1b18;
      }
      else {
        iVar1 = *param_2;
        iVar6 = FUN_14035fc20(param_2);
        if (((int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3) + iVar14 != iVar6) {
          FUN_14037ea90(*(undefined8 *)(param_1 + 0x148),param_3,
                        "msg.GetReadOffset() + payloadLength == msg.GetLength()",2);
        }
        FUN_1403841b0(local_1a80);
        cVar5 = FUN_140384410(param_2,local_1a80,uVar15 & 0xffffffff);
        if (cVar5 == '\0') {
          FUN_14037ea90(*(undefined8 *)(param_1 + 0x148),param_3,
                        "Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_UnreliableRelay1",2);
          local_1ae0 = local_1a78;
          FUN_140399690(local_1a78);
          puVar16 = auStack_1b18;
          if (local_1a70 != 0) {
            if (local_1a64 < 0) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            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_140399690(local_1a78);
            puVar16 = auStack_1b18;
            if (local_1a70 != 0) {
              if (local_1a64 < 0) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              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_14038c782:
                plVar13 = (longlong *)(puVar8 + 4);
              }
            }
            else {
              puVar8 = malloc(uVar11);
              plVar13 = (longlong *)0x0;
              if (puVar8 != (undefined4 *)0x0) {
                *puVar8 = 0xdddd;
                puVar17 = auStack_1b18;
                goto LAB_14038c782;
              }
            }
            pcVar3 = *(code **)(**(longlong **)(param_1 + 0x148) + 0x58);
            *(undefined8 *)(puVar17 + -8) = 0x14038c793;
            uVar9 = (*pcVar3)();
            local_1a40 = uVar9;
            *(undefined8 *)(puVar17 + -8) = 0x14038c7a2;
            FUN_14034ed40(uVar9);
            local_1a38 = 1;
            plVar22 = *(longlong **)(param_1 + 0x148);
            if (DAT_1405f064f != '\0') {
              pcVar3 = *(code **)(*plVar22 + 200);
              *(undefined8 *)(puVar17 + -8) = 0x14038c7ca;
              (*pcVar3)(plVar22,
                        L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_UnreliableRelay1");
            }
            pcVar3 = *(code **)(*param_3 + 0x10);
            *(undefined8 *)(puVar17 + -8) = 0x14038c7d4;
            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_14038c877;
                  FUN_14034f800();
                }
                uVar2 = *(undefined4 *)((longlong)plVar21 + (longlong)plVar19 * 4);
                uVar9 = *(undefined8 *)(param_1 + 0x148);
                *(undefined8 *)(puVar17 + -8) = 0x14038c80d;
                lVar10 = FUN_140361850(uVar9,uVar2);
                local_1ac8 = CONCAT44(local_1ac8._4_4_,uVar2);
                if (lVar10 != 0) {
                  *(undefined8 *)(puVar17 + -8) = 0x14038c824;
                  FUN_1403a0550(lVar10 + 0xc0);
                  uVar9 = *(undefined8 *)(local_1a58 + 0x148);
                  *(undefined8 *)(puVar17 + -8) = 0x14038c83a;
                  FUN_140374cb0(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) = 0x14038c884;
            FUN_14034edd0(uVar9);
            local_1a38 = 0;
            *(undefined8 *)(puVar17 + -8) = 0x14038c897;
            FUN_1403841b0(local_1a18);
            *(undefined8 *)(puVar17 + -8) = 0x14038c8b1;
            FUN_140383e30(local_1a18,local_19f0,0x80);
            *(undefined8 *)(puVar17 + -8) = 0x14038c8c0;
            FUN_140058870(local_1a18,0x18);
            uVar2 = local_1af4;
            *(undefined8 *)(puVar17 + -8) = 0x14038c8cf;
            FUN_140058470(local_1a18,uVar2);
            *(undefined8 *)(puVar17 + -8) = 0x14038c8e2;
            FUN_140383bc0(local_1a28,local_1a18);
            lVar10 = (longlong)(int)local_1ae8;
            *(undefined8 *)(puVar17 + -8) = 0x14038c8f3;
            FUN_140385580(local_1a18,lVar10);
            local_cdc = 200;
            local_ce0 = 0;
            local_ce8 = local_1968;
            *(undefined8 *)(puVar17 + -8) = 0x14038c924;
            FUN_140361500(local_cd8,local_1a18);
            *(undefined8 *)(puVar17 + -8) = 0x14038c938;
            FUN_1403607b0(local_1968,local_cd8);
            *(undefined8 *)(puVar17 + -8) = 0x14038c945;
            FUN_1403606a0(local_cd8);
            *(undefined8 *)(puVar17 + -8) = 0x14038c955;
            FUN_140361500(local_cd8,local_1a80);
            *(undefined8 *)(puVar17 + -8) = 0x14038c969;
            FUN_1403607b0(local_1968,local_cd8);
            *(undefined8 *)(puVar17 + -8) = 0x14038c976;
            FUN_1403606a0(local_cd8);
            local_1af8._1_1_ = DAT_1405f2520;
            local_1af8._0_1_ = DAT_1405f2540;
            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) = 0x14038c9e4;
                uVar15 = (*pcVar3)();
                local_1ad8 = 0;
                local_1ae0 = (undefined1 *)uVar15;
                if (lVar20 == 0) {
                  local_1ad8 = 1;
                  *(undefined8 *)(puVar17 + -8) = 0x14038ca9b;
                  FUN_14034ed40(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) = 0x14038cadf;
                  FUN_1403a1dc0(lVar12 + 0x700,uVar11,local_1968,local_1ad0);
                  *(undefined8 *)(puVar17 + -8) = 0x14038cae7;
                  FUN_14034edd0(uVar15);
                  local_1ad8 = '\0';
                  lVar12 = local_1af0 + 0xc0;
                  *(undefined8 *)(puVar17 + -8) = 0x14038cafc;
                  FUN_1403a0560(lVar12);
                  *plVar13 = 0;
                  *plVar13 = *(longlong *)(lVar18 + (longlong)plVar13);
                  plVar13[1] = *(longlong *)(lVar18 + 8 + (longlong)plVar13);
LAB_14038cb13:
                  lVar10 = lVar10 + -1;
                  lVar18 = lVar18 + -0x10;
                }
                else {
                  *(undefined8 *)(puVar17 + -8) = 0x14038ca00;
                  local_1ad8 = FUN_14034ed90();
                  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) = 0x14038ca56;
                    FUN_1403a1dc0(lVar12,uVar11,local_1968,local_1ad0);
                    *(undefined8 *)(puVar17 + -8) = 0x14038ca5e;
                    FUN_14034edd0(uVar15);
                    local_1ad8 = '\0';
                    lVar12 = local_1af0 + 0xc0;
                    *(undefined8 *)(puVar17 + -8) = 0x14038ca73;
                    FUN_1403a0560(lVar12);
                    plVar13[lVar20 * 2] = 0;
                    plVar13[lVar20 * 2] = *(longlong *)(lVar18 + (longlong)plVar13);
                    plVar13[lVar20 * 2 + 1] = *(longlong *)(lVar18 + 8 + (longlong)plVar13);
                    goto LAB_14038cb13;
                  }
                }
                lVar20 = lVar20 + 1;
                plVar21 = local_1a98;
              } while (lVar20 < lVar10);
            }
            if ((plVar13 != (longlong *)0x0) && ((int)plVar13[-2] == 0xdddd)) {
              *(undefined8 *)(puVar17 + -8) = 0x14038cb5f;
              free(plVar13 + -2);
            }
            *(undefined8 *)(puVar17 + -8) = 0x14038cb6c;
            FUN_1403606a0(local_1968);
            *(undefined8 *)(puVar17 + -8) = 0x14038cb79;
            FUN_140383be0(local_1a28);
            local_1ae0 = local_1a10;
            *(undefined8 *)(puVar17 + -8) = 0x14038cb91;
            FUN_140399690(local_1a10);
            if (local_1a08 != 0) {
              if (local_19fc < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar17 + -8) = &UNK_14038cbaa;
                FUN_14034f7d0();
              }
              local_1a00 = 0;
            }
            local_1ae0 = local_1a78;
            *(undefined8 *)(puVar17 + -8) = 0x14038cbc8;
            FUN_140399690(local_1a78);
            puVar16 = puVar17;
            if (local_1a70 != 0) {
              if (local_1a64 < 0) {
                    // WARNING: Subroutine does not return
                *(undefined **)(puVar17 + -8) = &UNK_14038cbe1;
                FUN_14034f7d0();
              }
              local_1a68 = 0;
            }
          }
        }
      }
    }
    if (plVar21 == (longlong *)0x0) goto LAB_14038cc2f;
    if (local_1aa0 == (longlong *)0x0) goto LAB_14038cc27;
    lVar10 = *local_1aa0;
    plVar13 = local_1aa0;
  }
  pcVar3 = *(code **)(lVar10 + 0x18);
  *(undefined8 *)(puVar16 + -8) = 0x14038cc25;
  (*pcVar3)(plVar13,plVar21);
LAB_14038cc2f:
  *(undefined8 *)(puVar16 + -8) = 0x14038cc3e;
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038cc60(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 = 0x14038cc7a;
  local_1a18 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_1aa8;
  FUN_140385b50(param_3 + 0x18);
  cVar2 = FUN_140384b70(param_2,&local_1a78);
  if (cVar2 != '\0') {
    cVar2 = FUN_1403840e0(param_2,&local_1a74,4);
    if (cVar2 != '\0') {
      cVar2 = FUN_140384780(param_2,&local_1a88);
      if (cVar2 != '\0') {
        iVar7 = (int)local_1a88;
        if ((iVar7 < 0) || (DAT_1405d8140 <= iVar7)) {
          FUN_14037ea90(*(undefined8 *)(param_1 + 0x148),param_3,
                        "Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_LingerDataFrame1",2);
        }
        else {
          iVar1 = *param_2;
          iVar3 = FUN_14035fc20(param_2);
          if (((int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3) + iVar7 != iVar3) {
            FUN_14037ea90(*(undefined8 *)(param_1 + 0x148),param_3,
                          "msg.GetReadOffset() + frameLength == msg.GetLength()",2);
          }
          FUN_1403841b0(local_1a70);
          cVar2 = FUN_140384410(param_2,local_1a70,(ulonglong)local_1a88 & 0xffffffff);
          if (cVar2 == '\0') {
            FUN_14037ea90(*(longlong **)(param_1 + 0x148),param_3,
                          "Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_LingerDataFrame1",2)
            ;
            local_1a88 = local_1a68;
            FUN_140399690(local_1a68);
            if ((local_1a60 != 0) && (local_1a54 < 0)) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
          }
          else {
            uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
            local_1a48 = uVar5;
            FUN_14034ed40(uVar5);
            local_1a40 = 1;
            if (DAT_1405f064f != '\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_140361850(*(undefined8 *)(param_1 + 0x148),local_1a78);
            if (lVar6 == 0) {
              FUN_14034edd0(uVar5);
              local_1a88 = local_1a68;
              FUN_140399690(local_1a68);
              if ((local_1a60 != 0) && (local_1a54 < 0)) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
            }
            else {
              FUN_14034edd0(uVar5);
              local_1a40 = 0;
              FUN_1403841b0(local_1a08);
              FUN_140383e30(local_1a08,local_19e0,0x80);
              FUN_140058870(local_1a08,0x19);
              FUN_140058470(local_1a08,uVar4);
              FUN_140058470(local_1a08,local_1a74);
              FUN_140383bc0(local_1a28,local_1a08);
              FUN_140385580(local_1a08,(longlong)iVar7);
              local_ccc = 200;
              local_cd0 = 0;
              local_cd8 = local_1958;
              FUN_140361500(local_cc8,local_1a08);
              FUN_1403607b0(local_1958,local_cc8);
              FUN_1403606a0(local_cc8);
              FUN_140361500(local_cc8,local_1a70);
              FUN_1403607b0(local_1958,local_cc8);
              FUN_1403606a0(local_cc8);
              uVar5 = (**(code **)(*(longlong *)(lVar6 + 0x108) + 0x10))();
              local_1a38 = uVar5;
              FUN_14034ed40(uVar5);
              local_1a30 = 1;
              local_1a88 = (undefined1 *)0x0;
              local_1a80 = 1;
              FUN_1403a03a0(*(undefined8 *)(lVar6 + 0x748),local_1958,&local_1a88);
              FUN_14034edd0(uVar5);
              FUN_1403606a0(local_1958);
              FUN_140383be0(local_1a28);
              local_1a88 = local_1a00;
              FUN_140399690(local_1a00);
              if (local_19f8 != 0) {
                if (local_19ec < 0) {
                    // WARNING: Subroutine does not return
                  FUN_14034f7d0();
                }
                local_19f0 = 0;
              }
              local_1a88 = local_1a68;
              FUN_140399690(local_1a68);
              if ((local_1a60 != 0) && (local_1a54 < 0)) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
            }
          }
        }
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038d030(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_1405d84f0 ^ (ulonglong)auStack_da8;
  FUN_140385b50(param_3 + 0x18);
  cVar2 = FUN_1403840e0(param_2,&local_d88,8);
  if (cVar2 != '\0') {
    cVar2 = FUN_1403840e0(param_2,&local_d40,8);
    if (cVar2 != '\0') {
      uVar4 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_d30 = uVar4;
      FUN_14034ed40(uVar4);
      local_d28 = 1;
      if (DAT_1405f064f != '\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_1403841b0(local_d68);
      FUN_140383c40(local_d68);
      FUN_140058870(local_d68,0x1c);
      FUN_140058670(local_d68,local_d88);
      uVar1 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x118) + 8))();
      FUN_140058670(local_d68,uVar1);
      dVar5 = (double)(**(code **)(param_3[0x21] + 0x10))();
      local_d40 = dVar5;
      FUN_14034ed40(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_140399790();
        }
      }
      else {
        uStack_cc0 = *(undefined4 *)(local_d60 + 0x18);
      }
      lVar6 = local_d58;
      if (local_d58 == 0) {
        if (local_d60 == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        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_1405d81cc;
      uVar3 = (**(code **)(*param_3 + 0x10))(param_3);
      FUN_1403a1dc0(param_3 + 0xe0,uVar3,&local_cc8,&local_d88);
      if (local_48 == (undefined4 *)0x0) {
        FUN_14034f420(local_d18,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_d18,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (local_3c < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      FUN_14034edd0(dVar5);
      local_d88 = &local_d60;
      FUN_140399690(&local_d60);
      if (local_d58 != 0) {
        if (local_d4c < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_d50 = 0;
      }
      FUN_14034edd0(uVar4);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038d330(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_1405d84f0 ^ (ulonglong)auStack_d68;
  FUN_1403841b0(local_d38);
  FUN_140383c40(local_d38);
  FUN_140384310(local_d38,0x800);
  FUN_140384310(local_d38,0);
  FUN_140058870(local_d38,8);
  uVar1 = (**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
  local_d10 = uVar1;
  FUN_14034ed40(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_140399790();
    }
  }
  else {
    local_d20 = *(undefined4 *)(local_d30 + 0x18);
  }
  lVar2 = local_d28;
  if (local_d28 == 0) {
    if (local_d30 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_1403a03a0(*(undefined8 *)(param_2 + 0x748),&local_ca8,&local_d48);
  if (local_28 == (undefined4 *)0x0) {
    FUN_14034f420(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_1c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_14034edd0(uVar1);
  local_d48 = &local_d30;
  FUN_140399690(&local_d30);
  if ((local_d28 != 0) && (local_d1c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038d500(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_1405d84f0 ^ (ulonglong)auStack_da8;
  FUN_140385b50(param_3 + 0x18);
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_d30 = uVar3;
  FUN_14034ed40(uVar3);
  local_d28 = 1;
  if (DAT_1405f064f != '\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_14039bb20(*(undefined8 *)(*plVar1 + 0x178),&local_d88);
    if (0.0 < dVar6) {
      FUN_1403841b0(local_d68);
      FUN_140383c40(local_d68);
      FUN_140384310(local_d68,0x800);
      FUN_140384310(local_d68,0);
      FUN_140058870(local_d68,0x28);
      FUN_140058670(local_d68,dVar6);
      uVar4 = (**(code **)(param_3[0x21] + 0x10))();
      local_d40 = uVar4;
      FUN_14034ed40(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_140399790();
        }
      }
      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_140399790();
        }
        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_1405d81cc;
      uStack_cc0 = local_d50;
      uVar2 = (**(code **)(*param_3 + 0x10))(param_3);
      FUN_1403a1dc0(param_3 + 0xe0,uVar2,&local_cc8,&local_d88);
      if (local_48 == (undefined4 *)0x0) {
        FUN_14034f420(local_d18,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_d18,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (local_3c < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      FUN_14034edd0(uVar4);
      local_d88 = &local_d60;
      FUN_140399690(&local_d60);
      if ((local_d58 != 0) && (local_d4c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
  }
  FUN_14034edd0(uVar3);
  return;
}



void FUN_14038d7d0(undefined8 *param_1)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14038a680(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 0x00014038d817. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_14034ff60();
  }
  return;
}



undefined8 * FUN_14038d830(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14038a680(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



longlong FUN_14038d8a0(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_14039d160(param_1,param_2,uVar1,uVar3);
  return lVar2 + 0x10;
}



void FUN_14038d950(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_14034f7d0();
  }
  iVar2 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar2) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_140389130(param_1,param_2);
      plVar1 = *(longlong **)(param_1 + 8);
      lVar4 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          uVar3 = FUN_14034fef0(lVar4 * 0x48);
        }
        else {
          uVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar4 * 0x48);
        }
        *(undefined8 *)(param_1 + 0x10) = uVar3;
        FUN_14038a400(uVar3,(longlong)param_2);
      }
      else {
        uVar3 = *(undefined8 *)(param_1 + 0x10);
        if (plVar1 == (longlong *)0x0) {
          lVar4 = FUN_14034fef0(lVar4 * 0x48);
        }
        else {
          lVar4 = (**(code **)(*plVar1 + 8))(plVar1,lVar4 * 0x48);
        }
        FUN_14038a4a0(lVar4,uVar3,(longlong)*(int *)(param_1 + 0x18));
        FUN_14038a400(lVar4 + (longlong)*(int *)(param_1 + 0x18) * 0x48,
                      (longlong)(param_2 - *(int *)(param_1 + 0x18)));
        if (lVar4 == 0) {
          FUN_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        FUN_14038a680(uVar3,(longlong)*(int *)(param_1 + 0x18));
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_14034ff60(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_14038a400(*(longlong *)(param_1 + 0x10) + (longlong)iVar2 * 0x48,
                      (longlong)(param_2 - iVar2));
      }
    }
    else {
      FUN_14038a680(*(longlong *)(param_1 + 0x10) + (longlong)param_2 * 0x48,
                    (longlong)(iVar2 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



undefined8 FUN_14038db00(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_140384a10(param_3,local_res18);
  if (cVar2 == '\0') {
LAB_14038db3c:
    FUN_140383db0(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_14038b500(param_1,param_3,&local_28,param_4);
    }
    else {
      if (local_res18[0] != 0x10) goto LAB_14038db3c;
      local_38 = Proud::AddrPort::vftable;
      local_30 = *(undefined4 *)(param_2 + 8);
      local_2c = *(undefined2 *)(param_2 + 0xc);
      FUN_14038b8a0(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_14038dbd0(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_1405d84f0 ^ (ulonglong)auStack_da8;
  FUN_140385b50(param_3 + 0xc0);
  uVar3 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_d10 = uVar3;
  FUN_14034ed40(uVar3);
  local_d08 = 1;
  if (DAT_1405f064f != '\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_14038d330(param_1,param_3);
LAB_14038dfaf:
      FUN_14034edd0(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_140384780(param_2,&local_cf8);
      ppuVar5 = local_cf8;
      if (((cVar1 != '\0') && (-1 < (int)local_cf8)) && ((int)local_cf8 <= DAT_1405d8140)) {
        FUN_1400179d0(&local_d60,(ulonglong)local_cf8 & 0xffffffff);
        lVar4 = local_d50;
        if ((int)local_d48 == 0) {
          lVar4 = 0;
        }
        cVar1 = FUN_1403840e0(param_2,lVar4,(ulonglong)ppuVar5 & 0xffffffff);
        if (cVar1 != '\0') {
          local_cf8 = (undefined **)0x0;
          uStack_cf0 = 0;
          uStack_cec = 0;
          cVar1 = FUN_1403840e0(param_2,&local_cf8,0x10);
          if (cVar1 == '\0') {
            FUN_14038d330(param_1,param_3);
            FUN_1403555d0(&local_d60);
          }
          else {
            local_ce8 = local_cf8;
            uStack_ce0 = uStack_cf0;
            uStack_cdc = uStack_cec;
            cVar1 = FUN_1403840e0(param_2,&local_cf8,4);
            if (cVar1 == '\0') {
              FUN_14038d330(param_1,param_3);
              FUN_1403555d0(&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_14035d4c0(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_140378c90(lVar4,param_3,&local_d88);
                    FUN_1403555d0(&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_140380540(lVar4,&local_cf8,&local_d60);
                  }
                  FUN_1403555d0(&local_d60);
                }
                else {
                  FUN_1403841b0(&local_d88);
                  FUN_140383c40(&local_d88);
                  FUN_140384310(&local_d88,0x800);
                  FUN_140384310(&local_d88,0);
                  FUN_140058870(&local_d88,9);
                  local_d30 = 0;
                  local_d28 = 0;
                  local_d20 = 0;
                  local_d18 = 0;
                  local_d38 = Proud::ByteArray::vftable;
                  FUN_140385580(&local_d88,0);
                  FUN_1403555d0(&local_d38);
                  ppuVar5 = (undefined **)(**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
                  local_ce8 = ppuVar5;
                  FUN_14034ed40(ppuVar5);
                  uStack_ce0 = CONCAT31(uStack_ce0._1_3_,1);
                  uVar6 = FUN_140361500(local_cd8,&local_d88);
                  local_cf8 = (undefined **)0x0;
                  uStack_cf0 = CONCAT31(uStack_cf0._1_3_,1);
                  FUN_1403a03a0(*(undefined8 *)(param_3 + 0x748),uVar6,&local_cf8);
                  FUN_1403606a0(local_cd8);
                  FUN_14034edd0(ppuVar5);
                  local_cf8 = &local_d80;
                  FUN_140399690(&local_d80);
                  if (local_d78 != 0) {
                    if ((longlong)local_d70 < 0) {
                    // WARNING: Subroutine does not return
                      FUN_14034f7d0();
                    }
                    local_d70 = local_d70 & 0xffffffff00000000;
                  }
                  FUN_1403555d0(&local_d60);
                }
              }
              else {
                FUN_14038d330(param_1,param_3);
                FUN_1403555d0(&local_d60);
              }
            }
          }
          goto LAB_14038dfaf;
        }
      }
      FUN_14038d330(param_1,param_3);
      FUN_1403555d0(&local_d60);
      goto LAB_14038dfaf;
    }
    lVar4 = *(longlong *)(lVar4 + 0x18);
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038dff0(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_1405d84f0 ^ (ulonglong)auStack_db8;
  FUN_140385b50(param_2 + 0xc0);
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_d40 = uVar2;
  FUN_14034ed40(uVar2);
  local_d38 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_NewClientCase");
  }
  FUN_1403598f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x788),
                *(undefined8 *)(*(longlong *)(param_2 + 0x748) + 0x110));
  FUN_1403841b0(local_d88);
  FUN_140383c40(local_d88);
  FUN_140384310(local_d88,0x800);
  FUN_140384310(local_d88,0);
  FUN_140058870(local_d88,4);
  FUN_140058870(local_d88,*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0);
  FUN_140384df0(local_d88,*(longlong *)(param_1 + 0x148) + 0x228);
  lVar4 = *(longlong *)(param_1 + 0x148);
  iVar1 = *(int *)(lVar4 + 0xc68);
  FUN_140385580(local_d88,(longlong)iVar1);
  lVar5 = 0;
  if (*(int *)(lVar4 + 0xc68) != 0) {
    lVar5 = *(longlong *)(lVar4 + 0xc60);
  }
  if (iVar1 == 0) goto LAB_14038e19c;
  local_d84 = 0;
  if (local_d80 == 0) {
    if (local_d78 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,lVar5);
    }
LAB_14038e16e:
    FUN_1400178c0(&local_d78,lVar5,iVar1);
  }
  else {
    if (local_d78 != 0) goto LAB_14038e16e;
    if (local_d80 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,lVar5);
    }
    FUN_140017a90(local_d80,lVar5,iVar1);
  }
  FUN_140017b00(local_d88);
LAB_14038e19c:
  FUN_14034edd0(uVar2);
  local_d38 = 0;
  uVar3 = (**(code **)(*(longlong *)(param_2 + 0x108) + 0x10))();
  local_d50 = (longlong *)uVar3;
  FUN_14034ed40(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_140399790();
    }
  }
  else {
    uStack_cd0 = *(undefined4 *)(local_d80 + 0x18);
  }
  lVar4 = local_d78;
  if (local_d78 == 0) {
    if (local_d80 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_1403a03a0(*(undefined8 *)(param_2 + 0x748),&local_cd8,&local_d60);
  if (local_58 != (undefined4 *)0x0) {
    if (local_4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    iVar1 = FUN_1403a0010(*(undefined8 *)(param_2 + 0x748));
    if (iVar1 == 0) {
      FUN_14034edd0(uVar3);
      local_d48 = 0;
    }
    else {
      FUN_14034edd0(uVar3);
      local_d48 = 0;
      local_d38 = 1;
      FUN_14034ed40(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_1403555d0(&local_d30);
      (**(code **)(*(longlong *)(param_2 + 0xa0) + 0x40))
                (param_2 + 0xa0,L"Proud::CNetThreads_S::NetWorkerThread_NewClientCase");
    }
    FUN_1403a0560(param_2 + 0xc0);
    local_d50 = &local_d80;
    FUN_140399690(&local_d80);
    if (local_d78 != 0) {
      if (local_d6c < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_d70 = 0;
    }
    if (iVar1 != 0) {
      FUN_14034edd0(uVar2);
    }
    return;
  }
  FUN_14034f420(&local_d30,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
  _CxxThrowException(&local_d30,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14038e3d0(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_14034f7d0();
  }
  iVar5 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar5) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar5 = FUN_140385ff0(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_14034fef0(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_14034fef0(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_14038a5f0(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_14034f420(local_c8,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_c8,(ThrowInfo *)&DAT_1405d36c0);
        }
        FUN_14036f5c0(lVar11,(longlong)*(int *)(param_1 + 0x18));
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_14034ff60(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_14036f5c0(*(longlong *)(param_1 + 0x10) + lVar11 * 8,(longlong)(iVar5 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



undefined8 * FUN_14038e610(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_14038a680(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    FUN_14034ff60(param_1);
  }
  return param_1;
}



longlong FUN_14038e680(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  
  FUN_14034ec60(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_1403a9ce0(param_1 + 0xa0,DAT_1405d8180);
  FUN_1403a9ce0(param_1 + 0xb8,DAT_1405d80f8);
  FUN_14035a030(param_1 + 0x150);
  FUN_140357510(param_1 + 0x158,*(undefined8 *)(param_1 + 0x150),DAT_1405d806c);
  lVar1 = param_2 + 0x120;
  if (param_2 == 0) {
    lVar1 = 0;
  }
  FUN_1403a6ca0(param_1 + 0x160,lVar1);
  FUN_1403a9ce0(param_1 + 0x188,DAT_1405d80a8);
  FUN_1403a9ce0(param_1 + 0x1a0,DAT_1405d80a8);
  FUN_1403a9ce0(param_1 + 0x1b8,DAT_1405d80b0);
  FUN_1403a9ce0(param_1 + 0x1d0,DAT_1405d8150);
  FUN_1403a9ce0(param_1 + 0x1e8,0x3ff0000000000000);
  *(undefined4 *)(param_1 + 0x200) = 0;
  *(undefined4 *)(param_1 + 0x240) = 0;
  FUN_1403a9ce0(param_1 + 0x248,DAT_1405d80d8);
  *(undefined8 *)(param_1 + 0x100) = 0;
  *(longlong *)(param_1 + 0x148) = param_2;
  *(undefined1 *)(param_1 + 0x140) = 0;
  return param_1;
}



void FUN_14038e820(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_14034ed40(uVar4);
  if (DAT_1405f064f != '\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_14034edd0(uVar4);
  uVar5 = 0;
  if (*(undefined8 **)(param_1 + 0x88) != (undefined8 *)0x0) {
    uVar5 = **(undefined8 **)(param_1 + 0x88);
  }
  FUN_140357460(uVar5);
  if (*(undefined8 **)(param_1 + 0x90) == (undefined8 *)0x0) {
    uVar5 = 0;
  }
  else {
    uVar5 = **(undefined8 **)(param_1 + 0x90);
  }
  FUN_140357460(uVar5);
  FUN_14034ed40(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_14034f800();
      }
      puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x70) + lVar7 * 8);
      uVar5 = 0;
      if (puVar1 != (undefined8 *)0x0) {
        uVar5 = *puVar1;
      }
      FUN_140357460(uVar5);
      iVar6 = iVar6 + 1;
      lVar7 = lVar7 + 1;
    } while (iVar6 < *(int *)(param_1 + 0x78));
  }
  FUN_14034edd0(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_14034f800();
      }
      puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x48) + lVar7 * 8);
      uVar5 = 0;
      if (puVar1 != (undefined8 *)0x0) {
        uVar5 = *puVar1;
      }
      FUN_140357460(uVar5);
      iVar6 = iVar6 + 1;
      lVar7 = lVar7 + 1;
    } while (iVar6 < *(int *)(param_1 + 0x50));
  }
  CloseHandle(*(HANDLE *)(param_1 + 0x180));
  FUN_1403899f0(param_1 + 0x168);
  FUN_140357550(param_1 + 0x158);
  FUN_14035a020(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_1403574e0(pvVar2);
      operator_delete(pvVar2);
    }
    FUN_14034ff60(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_1403574e0(pvVar2);
      operator_delete(pvVar2);
    }
    FUN_14034ff60(puVar1);
  }
  *(undefined ***)(param_1 + 0x60) = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 0x78)) {
    FUN_14036f5c0(*(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_14034ff60();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,*(longlong *)(param_1 + 0x70));
    }
  }
  *(undefined ***)(param_1 + 0x38) = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 0x50)) {
    FUN_14036f5c0(*(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_14034ff60();
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,*(longlong *)(param_1 + 0x48));
    }
  }
  FUN_14034edf0(param_1);
  return;
}



undefined8 FUN_14038eae0(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_14034ed40(uVar6);
  local_48 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))();
  }
  FUN_14035a290(*(longlong *)(param_1 + 0x148) + 0x760);
  local_res8 = (undefined *)FUN_14034fef0(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_14039a910(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_14038ec89;
    }
    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_14038ec85;
      }
      if (lVar3 != 0) goto LAB_14038ec5c;
    }
  }
  cVar5 = FUN_14035f5e0(lVar11,(ulonglong)uVar2,CONCAT71((int7)((ulonglong)lVar3 >> 8),1));
  if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
LAB_14038ec5c:
  FUN_14035d100(lVar11);
  plVar8 = (longlong *)FUN_140361160(lVar11,&local_res8,uVar4,(ulonglong)puVar7 & 0xffffffff);
  FUN_14035d100(lVar11);
LAB_14038ec85:
  *(undefined1 *)(plVar8 + 1) = 0;
LAB_14038ec89:
  if (puVar7 != (undefined *)0x0) {
    puVar12 = puVar7 + 0x38;
  }
  FUN_1403549c0(*(undefined8 *)(*(longlong *)(puVar7 + 0x748) + 0x110),puVar12);
  FUN_1403a0550(puVar7 + 0xc0);
  FUN_140359280(*(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_14038ed48;
    }
  }
  puVar9 = (undefined8 *)FUN_14038d8a0(lVar3 + 0x16e8,param_3);
  *puVar9 = puVar7;
LAB_14038ed48:
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
    FUN_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    plVar8 = (longlong *)FUN_140353960(param_3,&local_res20);
    puVar12 = (undefined *)*plVar8;
    if ((undefined *)*plVar8 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1405d8010;
    }
    FUN_140017720(&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_1405d8010)) &&
       (local_res20 + -8 != (undefined *)0x0)) {
      ppuVar10 = (undefined **)FUN_14034fe70();
      local_60 = ppuVar10;
      FUN_14034ed40(ppuVar10);
      local_58 = CONCAT31(local_58._1_3_,1);
      piVar1 = (int *)(local_res20 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_res20 + -8);
      }
      FUN_14034edd0(ppuVar10);
    }
    puVar12 = local_res8;
    puVar7 = local_res8;
    if (local_res8 == (undefined *)0x0) {
      puVar7 = PTR_DAT_1405d8010;
    }
    FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar7);
    if (((puVar12 != (undefined *)0x0) && (puVar12 != PTR_DAT_1405d8010)) &&
       (puVar12 + -8 != (undefined *)0x0)) {
      ppuVar10 = (undefined **)FUN_14034fe70();
      local_60 = ppuVar10;
      FUN_14034ed40(ppuVar10);
      local_58 = CONCAT31(local_58._1_3_,1);
      piVar1 = (int *)(puVar12 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar12 + -8);
      }
      FUN_14034edd0(ppuVar10);
    }
  }
  FUN_14034edd0(uVar6);
  return 1;
}



longlong FUN_14038ee90(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_140394a70(uVar12,uVar13);
    if (lVar9 == 0) {
      FUN_14034fe70();
      local_res8 = (uint *)PTR_DAT_1405d8010;
      uVar6 = FUN_14034fcf0(L"FATAL: Cannot create TCP socket for AcceptEx!");
      uVar8 = 0;
      if ((local_res8 != (uint *)0x0) && (uVar17 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar17 = (ulonglong)local_res8[-2];
      }
      uVar7 = uVar6;
      if ((((int)uVar6 <= (int)uVar17) && (uVar7 = uVar8, local_res8 != (uint *)0x0)) &&
         (local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar7 = local_res8[-2];
      }
      uVar15 = 1;
      if (1 < (int)uVar7) {
        uVar15 = uVar7;
      }
      uVar7 = uVar8;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar7 = local_res8[-2];
      }
      uVar16 = 0;
      if ((int)uVar7 < (int)uVar15) {
        if (local_res8 == (uint *)0x0) {
          local_res8 = (uint *)PTR_DAT_1405d8010;
        }
        if ((int)uVar15 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        if (uVar15 == 0) {
          FUN_1400031d0(&local_res8);
        }
        else {
          uVar7 = uVar8;
          if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
            uVar7 = local_res8[-2];
          }
          if (uVar15 != uVar7) {
            puVar11 = (uint *)FUN_14034fef0((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_1405d8010)) {
              uVar7 = local_res8[-2];
            }
            puVar14 = (uint *)PTR_DAT_1405d8010;
            if ((int)uVar15 < (int)uVar7) {
LAB_14038f137:
              if (local_res8 != (uint *)0x0) {
                puVar14 = local_res8;
              }
            }
            else {
              uVar15 = uVar8;
              if (local_res8 != (uint *)0x0) {
                if (local_res8 != (uint *)PTR_DAT_1405d8010) {
                  uVar15 = local_res8[-2];
                }
                goto LAB_14038f137;
              }
            }
            FUN_14034fd20(puVar11 + 2,puVar14,uVar15);
            FUN_1400031d0(&local_res8);
            local_res8 = puVar11 + 2;
          }
        }
      }
      FUN_140002e10(&local_res8);
      puVar11 = local_res8;
      if (local_res8 == (uint *)0x0) {
        puVar11 = (uint *)PTR_DAT_1405d8010;
      }
      FUN_14034fd20(puVar11,L"FATAL: Cannot create TCP socket for AcceptEx!",uVar6);
      puVar11 = local_res8;
      if (local_res8 == (uint *)0x0) {
        puVar11 = (uint *)PTR_DAT_1405d8010;
      }
      uVar8 = FUN_14034fcf0(puVar11);
      uVar6 = 0;
      if (0 < (int)uVar8) {
        uVar6 = uVar8;
      }
      uVar8 = uVar16;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar8 = local_res8[-2];
      }
      if (((int)uVar8 <= (int)uVar6) && (uVar6 = uVar16, local_res8 != (uint *)0x0)) {
        if (local_res8 == (uint *)PTR_DAT_1405d8010) goto LAB_14038f1eb;
        uVar6 = local_res8[-2];
      }
      if (((local_res8 != (uint *)PTR_DAT_1405d8010) && (local_res8 != (uint *)0x0)) &&
         (local_res8 + -2 != (uint *)0x0)) {
        local_res8[-2] = uVar6;
        *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar6 * 2) = 0;
      }
LAB_14038f1eb:
      local_b0 = 0;
      local_a8 = 0;
      local_a0 = 0;
      local_98 = 0;
      local_b8 = Proud::ByteArray::vftable;
      uVar10 = FUN_14035bed0(local_res20,1,1,&local_res8,&local_b8);
      (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))(*(longlong **)(param_1 + 0x148),uVar10)
      ;
      FUN_1403555d0(&local_b8);
      puVar11 = local_res8;
      if (local_res8 == (uint *)0x0) {
        return 0;
      }
      if (local_res8 == (uint *)PTR_DAT_1405d8010) {
        return 0;
      }
      puVar14 = local_res8 + -2;
      if (puVar14 == (uint *)0x0) {
        return 0;
      }
      uVar10 = FUN_14034fe70();
      local_68 = uVar10;
      FUN_14034ed40(uVar10);
      local_60 = 1;
      puVar11 = puVar11 + -1;
      *puVar11 = *puVar11 - 1;
      if (*puVar11 == 0) {
        FUN_14034ff60(puVar14);
      }
      FUN_14034edd0(uVar10);
      return 0;
    }
    puVar3 = *(ulonglong **)(*(longlong *)(param_1 + 0x148) + 0x748);
    uVar13 = uVar17;
    if (puVar3 != (ulonglong *)0x0) {
      uVar13 = *puVar3;
    }
    iVar5 = FUN_140356910(uVar13,lVar9);
    if (iVar5 == 0) {
      return lVar9;
    }
    if (iVar5 != 0x2746) {
      if (iVar5 != 0x2736) {
        FUN_14034fe70();
        local_res10 = PTR_DAT_1405d8010;
        FUN_140017720(&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_14035bed0(local_res18,1,1,&local_res10,&local_90);
        (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))
                  (*(longlong **)(param_1 + 0x148),uVar10);
        FUN_1403555d0(&local_90);
        puVar4 = local_res10;
        if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
          uVar10 = FUN_14034fe70();
          local_58 = uVar10;
          FUN_14034ed40(uVar10);
          local_50 = 1;
          piVar2 = (int *)(puVar4 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(uVar10);
        }
      }
LAB_14038f023:
      FUN_1403556b0(lVar9);
      FUN_14034ff60(lVar9);
      return 0;
    }
    if (*(char *)(param_1 + 0x140) != '\0') goto LAB_14038f023;
    FUN_1403556b0(lVar9);
    FUN_14034ff60(lVar9);
  } while( true );
}



void FUN_14038f2a0(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_14034ed40(uVar4);
    local_58 = 1;
    if (DAT_1405f064f != '\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_14034fe70();
        local_res8 = PTR_DAT_1405d8010;
        FUN_140017720(&local_res8,&DAT_140458910,param_3,param_4);
        local_48 = 0;
        local_40 = 0;
        local_38 = 0;
        local_30 = 0;
        local_50 = Proud::ByteArray::vftable;
        uVar5 = FUN_14035bed0(&local_70,1,0,&local_res8,&local_50);
        (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))
                  (*(longlong **)(param_1 + 0x148),uVar5);
        FUN_1403555d0(&local_50);
        puVar3 = local_res8;
        if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
          uVar5 = FUN_14034fe70();
          local_70 = uVar5;
          FUN_14034ed40(uVar5);
          local_68 = 1;
          piVar2 = (int *)(puVar3 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(uVar5);
        }
      }
    }
    else {
      if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
        FUN_14034fe70();
        local_res8 = PTR_DAT_1405d8010;
        FUN_140017720(&local_res8,&DAT_140458950,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_14035bed0(&local_70,1,*(undefined4 *)(param_2 + 0x6f8),&local_res8,&local_50);
        (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))
                  (*(longlong **)(param_1 + 0x148),uVar5);
        FUN_1403555d0(&local_50);
        puVar3 = local_res8;
        if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
          uVar5 = FUN_14034fe70();
          local_70 = uVar5;
          FUN_14034ed40(uVar5);
          local_68 = 1;
          piVar2 = (int *)(puVar3 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(uVar5);
        }
      }
      local_48 = 0;
      local_40 = 0;
      local_38 = 0;
      local_30 = 0;
      local_50 = Proud::ByteArray::vftable;
      FUN_140381580(*(undefined8 *)(param_1 + 0x148),param_2,1,3,&local_50,
                    L"Proud::CNetThreads_S::ShowThreadExceptionAndPurgeClient",0);
      FUN_1403555d0(&local_50);
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038f570(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_1405d84f0 ^ (ulonglong)auStack_e68;
  local_e38 = param_3;
  local_db0 = param_1;
  FUN_140385b50(param_3 + 0xc0);
  lVar4 = 0;
  local_df8 = 0;
  local_df0 = 0;
  local_de8 = 0;
  local_de0 = 0;
  local_e00 = Proud::ByteArray::vftable;
  cVar1 = FUN_140384780(param_2,&local_e48);
  uVar2 = local_e48;
  if (((cVar1 != '\0') && (-1 < (int)local_e48)) && ((int)local_e48 <= DAT_1405d8140)) {
    FUN_1400179d0(&local_e00,local_e48 & 0xffffffff);
    lVar3 = local_df0;
    if ((int)local_de8 == 0) {
      lVar3 = lVar4;
    }
    cVar1 = FUN_1403840e0(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_140384780(param_2,&local_e48);
      uVar2 = local_e48;
      if (((cVar1 != '\0') && (-1 < (int)local_e48)) && ((int)local_e48 <= DAT_1405d8140)) {
        FUN_1400179d0(&local_dd8,local_e48 & 0xffffffff);
        lVar3 = local_dc8;
        if ((int)local_dc0 == 0) {
          lVar3 = lVar4;
        }
        cVar1 = FUN_1403840e0(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_1403a5450(&local_e48,&local_da0,&local_e00,*(longlong *)(param_1 + 0x148) + 0xc48);
          if ((local_e48 == 0) || (*(longlong *)(local_e48 + 0x38) == 0)) {
            FUN_14012c7f0(&local_e48);
            uVar2 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
            local_e48 = uVar2;
            FUN_14034ed40(uVar2);
            local_e40 = 1;
            if (DAT_1405f064f != '\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_140394f20(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_140396990(&local_dd8,&local_e28,param_3 + 0x288);
                if (cVar1 == '\0') {
                  FUN_14034f420(local_d18,L"Decrypt Fast EncryptKey Error");
                    // WARNING: Subroutine does not return
                  _CxxThrowException(local_d18,(ThrowInfo *)&DAT_1405d36c0);
                }
                lVar3 = local_e18;
                if ((int)local_e10 == 0) {
                  lVar3 = lVar4;
                }
                FUN_1403a4780(param_3 + 0x658,lVar3,
                              *(uint *)(*(longlong *)(param_1 + 0x148) + 0x248) >> 3);
                FUN_1403555d0(&local_e28);
                param_3[0x688] = 1;
                FUN_14034edd0(uVar2);
                local_e40 = 0;
                FUN_1403841b0(local_d78);
                FUN_140383c40(local_d78);
                FUN_140384310(local_d78,0x800);
                FUN_140384310(local_d78,0);
                FUN_140058870(local_d78,6);
                lVar4 = (**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
                local_db0 = lVar4;
                FUN_14034ed40(lVar4);
                local_da8 = 1;
                uVar5 = FUN_140361500(local_cc8,local_d78);
                local_e38 = (undefined1 *)0x0;
                local_e30 = 1;
                FUN_1403a03a0(*(undefined8 *)(param_3 + 0x748),uVar5,&local_e38);
                FUN_1403606a0(local_cc8);
                FUN_14034edd0(lVar4);
                local_e38 = local_d70;
                FUN_140399690(local_d70);
                if (local_d68 != 0) {
                  if (local_d5c < 0) {
                    // WARNING: Subroutine does not return
                    FUN_14034f7d0();
                  }
                  local_d60 = 0;
                }
                FUN_1403555d0(&local_da0);
                FUN_1403555d0(&local_dd8);
                goto LAB_14038fa43;
              }
            }
            FUN_14034edd0(uVar2);
            FUN_1403555d0(&local_da0);
            FUN_1403555d0(&local_dd8);
          }
          else {
            FUN_14012c7f0(&local_e48);
            FUN_1403555d0(&local_da0);
            FUN_1403555d0(&local_dd8);
          }
          goto LAB_14038fa43;
        }
      }
      FUN_1403555d0(&local_dd8);
    }
  }
LAB_14038fa43:
  FUN_1403555d0(&local_e00);
  return;
}



void FUN_14038fa80(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_14034fe70();
    local_78 = PTR_DAT_1405d8010;
    FUN_140017720(&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_14035bed0(&local_res8,1,1,&local_78,&local_48);
    FUN_1403555d0(&local_48);
    local_70 = (undefined *)0x0;
    FUN_14035bda0(&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_14035bff0(uVar4,&local_70);
      puVar5 = (undefined *)*plVar3;
      if ((undefined *)*plVar3 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1405d8010;
      }
      FUN_14034fa20(puVar5);
      puVar5 = local_70;
      if (((local_70 != (undefined *)0x0) && (local_70 != PTR_DAT_1405d8010)) &&
         (puVar1 = local_70 + -8, puVar1 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_58 = uVar4;
        FUN_14034ed40(uVar4);
        local_50 = 1;
        piVar2 = (int *)(puVar5 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar4);
      }
    }
    puVar5 = local_res8;
    if (local_res8 != (undefined *)0x0) {
      local_70 = local_res8;
      FUN_14034ed40(local_res8);
      local_68 = 1;
      *(longlong *)(local_res8 + 0x40) = *(longlong *)(local_res8 + 0x40) + -1;
      if (*(longlong *)(local_res8 + 0x40) == 0) {
        FUN_14034edd0(puVar5);
        local_68 = 0;
        FUN_14012c7d0(local_res8);
      }
      else {
        FUN_14034edd0(puVar5);
      }
    }
    puVar5 = local_78;
    if (((local_78 != (undefined *)0x0) && (local_78 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_78 + -8, puVar1 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_58 = uVar4;
      FUN_14034ed40(uVar4);
      local_50 = 1;
      piVar2 = (int *)(puVar5 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar4);
    }
  }
  return;
}



void FUN_14038fc90(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_14037ea90(*(undefined8 *)(param_1 + 0x148),0,
                  "Proud::CNetThreads_S::UserWorkerThread_FinalReceiveUserMessage",2);
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x758) != 0) {
    FUN_14035b390(local_118);
    local_114 = *(undefined4 *)(param_2 + 0x30);
    local_118[0] = *(undefined1 *)(param_2 + 0x48);
    local_e0 = param_3;
    cVar2 = FUN_140384780(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_140399790();
        }
        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_140399790();
          }
          if (*(int *)(lVar5 + 0x18) == 0) {
            lVar5 = 0;
          }
          else {
            lVar5 = *(longlong *)(lVar5 + 0x10);
          }
        }
        else {
          lVar5 = *(longlong *)(param_2 + 0x18);
          if (lVar5 == 0) {
            FUN_14034f420(local_70,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
            _CxxThrowException(local_70,(ThrowInfo *)&DAT_1405d36c0);
          }
        }
        plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x148) + 0x758);
        (**(code **)(*plVar1 + 0x30))
                  (plVar1,*(undefined4 *)(param_2 + 0x30),local_118,lVar5 + iVar3,(int)local_res20);
        goto LAB_14038ff57;
      }
    }
    local_res20 = (undefined4 *)FUN_14034fef0(0x60);
    if (local_res20 == (undefined4 *)0x0) {
      lVar5 = 0;
    }
    else {
      lVar5 = FUN_14035bca0(local_res20);
    }
    puVar8 = (undefined4 *)0x0;
    if (lVar5 == 0) {
      local_res20 = (undefined4 *)0x0;
      puVar6 = puVar8;
    }
    else {
      puVar6 = (undefined4 *)FUN_14034fef0(0x48);
      local_198 = puVar6;
      if (puVar6 != (undefined4 *)0x0) {
        local_res20 = puVar6;
        uVar4 = FUN_1403c0cc0();
        FUN_14034ec60(puVar6,uVar4,1);
      }
      local_res20 = puVar6;
      FUN_14034ed40(puVar6);
      *(undefined8 *)(puVar6 + 0x10) = 1;
      *(longlong *)(puVar6 + 0xe) = lVar5;
      FUN_14034edd0(puVar6);
    }
    puVar7 = puVar8;
    if (puVar6 != (undefined4 *)0x0) {
      puVar7 = *(undefined4 **)(puVar6 + 0xe);
    }
    *puVar7 = 0x1f;
    if (puVar6 != (undefined4 *)0x0) {
      puVar8 = *(undefined4 **)(puVar6 + 0xe);
    }
    FUN_14000d470(puVar8 + 4,L"Invalid payload size in User Message!");
    local_198 = (undefined4 *)0x0;
    FUN_14035bda0(&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_14034ed40(puVar6);
      local_190 = 1;
      plVar1 = (longlong *)(puVar6 + 0x10);
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(puVar6);
        local_190 = 0;
        FUN_14012c7d0(puVar6);
      }
      else {
        FUN_14034edd0(puVar6);
      }
    }
  }
LAB_14038ff57:
  FUN_1403a6bc0(param_1 + 0x160,*(undefined4 *)(param_2 + 0x30),0);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14038ff80(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_1405d84f0 ^ (ulonglong)auStack_2a8;
  local_260 = param_1;
  FUN_1403a9d00(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_14034fe70();
            local_238[0] = PTR_DAT_1405d8010;
            FUN_140017720(local_238,&DAT_140458cd0,L"Proud::CNetThreads_S::TcpListenerProc");
            puVar3 = local_238[0];
            puVar13 = local_238[0];
            if (local_238[0] == (undefined *)0x0) {
              puVar13 = PTR_DAT_1405d8010;
            }
            FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar13);
            if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
               (puVar3 + -8 != (undefined *)0x0)) {
              uVar8 = FUN_14034fe70();
              local_1c8 = 0;
              local_1d0 = uVar8;
              FUN_14034ed40(uVar8);
              local_1c8 = 1;
              piVar7 = (int *)(puVar3 + -4);
              *piVar7 = *piVar7 + -1;
              if (*piVar7 == 0) {
                FUN_14034ff60(puVar3 + -8);
              }
              FUN_14034edd0(uVar8);
            }
          }
          lVar2 = local_268;
          if (local_268 != 0) {
            FUN_1403556b0(local_268);
            FUN_14034ff60(lVar2);
          }
          FUN_1403a9d30(local_278);
          return;
        }
        iVar15 = 0;
        if (((local_268 == 0) && ((char)uVar14 != '\0')) &&
           (local_268 = FUN_14038ee90(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_1405d83d0;
        local_18c = DAT_1405d83d4;
        cVar4 = FUN_140358730(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x790),&local_1c0,
                              DAT_1405d8068);
        if (cVar4 == '\x01') break;
        puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x148) + 0x748);
        uVar11 = uVar16;
        if (puVar1 != (ulonglong *)0x0) {
          uVar11 = *puVar1;
        }
        FUN_140355560(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_1403553b0(lVar2,uVar11,&local_208,&local_258);
      cVar4 = FUN_140352ee0(&local_258);
      if (cVar4 == '\0') {
LAB_140390142:
        FUN_1403556b0(lVar2);
        FUN_14034ff60(lVar2);
      }
      else {
        local_228 = Proud::AddrPort::vftable;
        local_220 = local_250;
        local_21c = local_24c;
        cVar4 = FUN_14038eae0(param_1,lVar2,&local_228);
        if (cVar4 == '\0') goto LAB_140390142;
      }
      local_268 = 0;
    }
    FUN_14034fe70();
    local_270 = (int *)PTR_DAT_1405d8010;
    iVar5 = FUN_14034fcf0(L"acceptex getqueued but socket null");
    iVar6 = iVar15;
    if ((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1405d8010)) {
      iVar6 = local_270[-2];
    }
    iVar9 = 0;
    iVar10 = iVar5;
    if (((iVar5 <= iVar6) && (iVar10 = iVar9, local_270 != (int *)0x0)) &&
       (local_270 != (int *)PTR_DAT_1405d8010)) {
      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_1405d8010)) {
      uVar11 = (ulonglong)(uint)local_270[-2];
    }
    if ((int)uVar11 < iVar6) {
      if (local_270 == (int *)0x0) {
        local_270 = (int *)PTR_DAT_1405d8010;
      }
      if (iVar6 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (iVar6 == 0) {
        FUN_1400031d0(&local_270);
      }
      else {
        iVar10 = iVar9;
        if ((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1405d8010)) {
          iVar10 = local_270[-2];
        }
        if (iVar6 != iVar10) {
          piVar7 = (int *)FUN_14034fef0((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_1405d8010)) {
            iVar10 = local_270[-2];
          }
          piVar12 = (int *)PTR_DAT_1405d8010;
          if (iVar6 < iVar10) {
LAB_140390267:
            if (local_270 != (int *)0x0) {
              piVar12 = local_270;
            }
          }
          else {
            iVar6 = iVar15;
            if (local_270 != (int *)0x0) {
              if (local_270 != (int *)PTR_DAT_1405d8010) {
                iVar6 = local_270[-2];
              }
              goto LAB_140390267;
            }
          }
          FUN_14034fd20(piVar7 + 2,piVar12,iVar6);
          FUN_1400031d0(&local_270);
          local_270 = piVar7 + 2;
        }
      }
    }
    FUN_140002e10(&local_270);
    piVar7 = local_270;
    if (local_270 == (int *)0x0) {
      piVar7 = (int *)PTR_DAT_1405d8010;
    }
    FUN_14034fd20(piVar7,L"acceptex getqueued but socket null",iVar5);
    piVar7 = local_270;
    if (local_270 == (int *)0x0) {
      piVar7 = (int *)PTR_DAT_1405d8010;
    }
    iVar6 = FUN_14034fcf0(piVar7);
    iVar15 = 0;
    if (0 < iVar6) {
      iVar15 = iVar6;
    }
    iVar6 = iVar9;
    if ((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1405d8010)) {
      iVar6 = local_270[-2];
    }
    if ((iVar15 < iVar6) || (iVar15 = iVar9, local_270 == (int *)0x0)) {
LAB_14039030a:
      if (((local_270 != (int *)PTR_DAT_1405d8010) && (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_1405d8010) {
      iVar15 = local_270[-2];
      goto LAB_14039030a;
    }
    local_1f0 = 0;
    local_1e8 = 0;
    local_1e0 = 0;
    local_1d8 = 0;
    local_1f8 = Proud::ByteArray::vftable;
    local_288 = &local_1f8;
    uVar8 = FUN_14035bed0(local_158,1,0,&local_270);
    (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))(*(longlong **)(param_1 + 0x148),uVar8);
    FUN_1403555d0(&local_1f8);
    piVar7 = local_270;
    if (((local_270 != (int *)0x0) && (local_270 != (int *)PTR_DAT_1405d8010)) &&
       (piVar12 = local_270 + -2, piVar12 != (int *)0x0)) {
      uVar8 = FUN_14034fe70();
      local_210 = 0;
      local_218 = uVar8;
      FUN_14034ed40(uVar8);
      local_210 = 1;
      piVar7 = piVar7 + -1;
      *piVar7 = *piVar7 + -1;
      if (*piVar7 == 0) {
        FUN_14034ff60(piVar12);
      }
      FUN_14034edd0(uVar8);
      local_210 = 0;
    }
    local_270 = (int *)PTR_DAT_1405d8010;
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140390550(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_1405d84f0 ^ (ulonglong)auStack_1d8;
  FUN_1403a9d00(&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_1403a61f0(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_14034ed40(uVar5);
    local_198 = 1;
    if (DAT_1405f064f != '\0') {
      (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
                (*(longlong **)(param_1 + 0x148),L"Proud::CNetThreads_S::UserWorkerThread_Main");
    }
    cVar4 = FUN_1403a6ad0(param_1 + 0x160,local_40,&local_1b0);
    FUN_14034edd0(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_14038a200(param_1,local_40,local_1b0);
      }
      else if (*local_40 == 2) {
        FUN_14038fc90(param_1,local_40,local_1b0);
      }
      else {
        FUN_140379230(*(undefined8 *)(param_1 + 0x148),local_40 + 0x14);
        FUN_1403a6bc0(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_1403a6a40(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_14034fe70();
    local_1a8 = PTR_DAT_1405d8010;
    FUN_140017720(&local_1a8,&DAT_140458cd0,L"Proud::CNetThreads_S::UserWorkerThread_Main");
    puVar3 = local_1a8;
    puVar6 = local_1a8;
    if (local_1a8 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1405d8010;
    }
    FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar6);
    if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
       (puVar3 + -8 != (undefined *)0x0)) {
      uVar5 = FUN_14034fe70();
      local_190 = uVar5;
      FUN_14034ed40(uVar5);
      local_188 = 1;
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar3 + -8);
      }
      FUN_14034edd0(uVar5);
    }
  }
  FUN_1403a6230(local_178);
  FUN_1403a9d30(&local_1b8);
  return;
}



void FUN_140390890(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_140357920(DVar1,"PNSrv TcpListener");
  FUN_14038ff80(param_1);
  return;
}



void FUN_1403908c0(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_140357920(DVar1,"PNSrv UserWorker");
  FUN_140390550(param_1);
  return;
}



void FUN_1403908f0(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_14034f420(local_58,PTR_u_exception_due_to_not_using_Inter_1405d94c0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  FUN_1403841e0(local_168,param_3,param_3,param_4,0xfffffffffffffffe);
  FUN_140376e10(local_140);
  local_170[0] = (undefined4)param_4;
  uVar1 = FUN_140379f90(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_140376ec0(local_140);
  FUN_140399690(local_160);
  if ((local_158 != 0) && (local_14c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (param_2 == 0) {
    param_2 = 0;
  }
  else {
    param_2 = param_2 + 8;
  }
  FUN_1403a6a50(param_1 + 0x160,param_2);
  return;
}



void FUN_140390a20(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_140385b50(param_4 + 0xc0);
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  FUN_14034ed40(uVar5);
  if (DAT_1405f064f != '\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_140383db0(param_2,(int)((iVar1 >> 0x1f & 7U) + iVar1) >> 3);
    FUN_1403841b0(local_68);
    local_38 = Proud::AddrPort::vftable;
    local_40 = 0;
    local_30 = DAT_1405d83d0;
    local_2c = DAT_1405d83d4;
    local_28 = param_3 | bVar3;
    FUN_140383c40(local_68);
    if (*(longlong *)(param_2 + 2) == 0) {
      if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_140399790();
      }
      if (*(int *)(lVar2 + 0x18) != 0) {
        lVar7 = *(longlong *)(lVar2 + 0x10);
      }
    }
    FUN_140384750(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_1403908f0(param_1,param_4,local_68,1,param_5);
    FUN_140399690(local_60);
    if ((local_58 != 0) && (local_4c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  FUN_14034edd0(uVar5);
  return;
}



void FUN_140390c40(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_1403841b0(local_58);
  local_28 = Proud::AddrPort::vftable;
  local_18 = 0;
  local_30 = 0;
  local_20 = DAT_1405d83d0;
  local_1c = DAT_1405d83d4;
  FUN_140383c40(local_58);
  if (*(longlong *)(param_2 + 2) == 0) {
    if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
    }
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar5 = *(longlong *)(lVar2 + 0x10);
    }
  }
  FUN_140384750(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_140385b50(param_4 + 0xc0);
  uVar4 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  FUN_14034ed40(uVar4);
  if (DAT_1405f064f != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x148) + 200))
              (*(longlong **)(param_1 + 0x148),
               L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_UserMessage");
  }
  FUN_1403908f0(param_1,param_4,local_58,2,param_5);
  FUN_14034edd0(uVar4);
  FUN_140399690(local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



undefined8 FUN_140390e10(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_140384a10(param_2,&local_bc);
  if (cVar1 == '\0') goto switchD_140390e97_caseD_3;
  local_res10[0] = local_res10[0] & 0xffffffffffffff00;
  switch(local_bc) {
  case 1:
    FUN_140390a20(param_1,param_2,0,param_3,local_res20 != 0);
  default:
switchD_140390e97_caseD_3:
    FUN_140383db0(param_2,local_c0);
    return 0;
  case 2:
    FUN_140390c40(param_1,param_2,0,param_3,local_res20 != 0);
    goto switchD_140390e97_caseD_3;
  case 5:
    FUN_14038f570(param_1,param_2,param_3);
    break;
  case 7:
    FUN_14038dbd0(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_140352ee0(&local_58);
    if (cVar1 == '\0') {
      FUN_14037ea90(*(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_14038b500(param_1,param_2,&local_48);
    break;
  case 0xe:
    FUN_14038aba0(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_140352ee0(&local_38);
    if (cVar1 == '\0') {
      FUN_14037ea90(*(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_14038b8a0(param_1,param_2,&local_68);
    break;
  case 0x12:
    FUN_14038b020(param_1,param_2,param_3);
    break;
  case 0x14:
    FUN_14038bc90(param_1,param_2,param_3);
    break;
  case 0x15:
    FUN_14038c4f0(param_1,param_2,param_3);
    break;
  case 0x16:
    FUN_14038cc60(param_1,param_2,param_3);
    break;
  case 0x1a:
    FUN_14038d030(param_1,param_2,param_3);
    break;
  case 0x1b:
    FUN_140389600(param_1,param_2,param_3);
    break;
  case 0x24:
  case 0x25:
    FUN_1403841b0(&local_b8);
    local_88 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_90 = 0;
    local_80 = DAT_1405d83d0;
    local_7c = DAT_1405d83d4;
    cVar1 = FUN_140387ec0(*(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_140390e10(param_1,&local_b8,param_3);
      local_res10[0] = CONCAT71(local_res10[0]._1_7_,uVar2);
    }
    local_c8 = local_b0;
    FUN_140399690(local_b0);
    if ((local_a8 != 0) && (local_a0._4_4_ < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    goto LAB_1403911a5;
  case 0x26:
    FUN_1403841b0(&local_b8);
    local_88 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_90 = 0;
    local_80 = DAT_1405d83d0;
    local_7c = DAT_1405d83d4;
    cVar1 = FUN_1403862f0(*(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_140390e10(param_1,&local_b8,param_3);
      local_res10[0] = CONCAT71(local_res10[0]._1_7_,uVar2);
    }
    local_c8 = local_b0;
    FUN_140399690(local_b0);
    if ((local_a8 != 0) && (local_a0._4_4_ < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
LAB_1403911a5:
    if ((char)local_res10[0] != '\x01') {
      if ((char)local_res10[0] != '\0') {
        return 1;
      }
      goto switchD_140390e97_caseD_3;
    }
    break;
  case 0x27:
    FUN_14038d500(param_1,param_2,param_3);
    break;
  case 0x28:
    FUN_140389690(param_1,param_2,param_3);
  }
  if (*(longlong *)(param_2 + 2) == 0) {
    if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_14034fe70();
  local_c8 = (int *)PTR_DAT_1405d8010;
  local_c0 = FUN_14034fcf0(L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_ProudNetLayer");
  iVar5 = 0;
  if ((local_c8 != (int *)0x0) && (iVar5 = 0, local_c8 != (int *)PTR_DAT_1405d8010)) {
    iVar5 = local_c8[-2];
  }
  iVar4 = local_c0;
  if (((local_c0 <= iVar5) && (iVar4 = 0, local_c8 != (int *)0x0)) &&
     (local_c8 != (int *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar4 = local_c8[-2];
  }
  if (iVar4 < iVar5) {
    if (local_c8 == (int *)0x0) {
      local_c8 = (int *)PTR_DAT_1405d8010;
    }
    if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (iVar5 == 0) {
      FUN_1400031d0(&local_c8);
    }
    else {
      if ((local_c8 != (int *)0x0) && (local_c8 != (int *)PTR_DAT_1405d8010)) {
        iVar3 = local_c8[-2];
      }
      if (iVar5 != iVar3) {
        piVar6 = (int *)FUN_14034fef0((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_1405d8010)) {
          iVar4 = local_c8[-2];
        }
        piVar10 = (int *)PTR_DAT_1405d8010;
        if (iVar5 < iVar4) {
LAB_140391322:
          iVar3 = iVar5;
          if (local_c8 != (int *)0x0) {
            piVar10 = local_c8;
          }
        }
        else if (local_c8 != (int *)0x0) {
          iVar5 = iVar3;
          if (local_c8 != (int *)PTR_DAT_1405d8010) {
            iVar5 = local_c8[-2];
          }
          goto LAB_140391322;
        }
        FUN_14034fd20(piVar6 + 2,piVar10,iVar3);
        FUN_1400031d0(&local_c8);
        local_c8 = piVar6 + 2;
      }
    }
  }
  FUN_140002e10(&local_c8);
  piVar6 = local_c8;
  if (local_c8 == (int *)0x0) {
    piVar6 = (int *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(piVar6,L"Proud::CNetThreads_S::NetWorkerThread_ProcessMessage_ProudNetLayer",
                local_c0);
  piVar6 = local_c8;
  if (local_c8 == (int *)0x0) {
    piVar6 = (int *)PTR_DAT_1405d8010;
  }
  iVar4 = FUN_14034fcf0(piVar6);
  iVar5 = 0;
  if (0 < iVar4) {
    iVar5 = iVar4;
  }
  iVar4 = 0;
  if ((local_c8 != (int *)0x0) && (iVar4 = 0, local_c8 != (int *)PTR_DAT_1405d8010)) {
    iVar4 = local_c8[-2];
  }
  if ((iVar4 <= iVar5) && (iVar5 = 0, local_c8 != (int *)0x0)) {
    if (local_c8 == (int *)PTR_DAT_1405d8010) goto LAB_1403913d7;
    iVar5 = local_c8[-2];
  }
  if (((local_c8 != (int *)PTR_DAT_1405d8010) && (local_c8 != (int *)0x0)) &&
     (local_c8 + -2 != (int *)0x0)) {
    local_c8[-2] = iVar5;
    *(undefined2 *)((longlong)local_c8 + (longlong)iVar5 * 2) = 0;
  }
LAB_1403913d7:
  iVar5 = FUN_14035fc20(param_2);
  local_res10[0] = FUN_140383d70(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_1400179d0(&local_b8,iVar5);
    lVar9 = local_a8;
    if ((int)local_a0 == 0) {
      lVar9 = 0;
    }
    FUN_14000d3f0(lVar9,local_res10[0],(longlong)iVar5);
    local_b8 = Proud::ByteArray::vftable;
    uVar7 = FUN_14035bed0(local_res10,0x1f,param_2[10],&local_c8,&local_b8);
    (**(code **)(**(longlong **)(param_1 + 0x148) + 0x80))(*(longlong **)(param_1 + 0x148),uVar7);
    FUN_1403555d0(&local_b8);
    piVar6 = local_c8;
    if (((local_c8 != (int *)0x0) && (local_c8 != (int *)PTR_DAT_1405d8010)) &&
       (piVar10 = local_c8 + -2, piVar10 != (int *)0x0)) {
      ppuVar8 = (undefined **)FUN_14034fe70();
      local_68 = ppuVar8;
      FUN_14034ed40(ppuVar8);
      local_60 = CONCAT31(local_60._1_3_,1);
      piVar6 = piVar6 + -1;
      *piVar6 = *piVar6 + -1;
      if (*piVar6 == 0) {
        FUN_14034ff60(piVar10);
      }
      FUN_14034edd0(ppuVar8);
    }
    return 1;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_140391570(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_14037ea90(*(undefined8 *)(param_1 + 0x148),param_2,
                    "ri.m_unsafeMessage.GetReadOffset() == 0",2);
    }
    FUN_140390e10(param_1,lVar2 + (longlong)iVar3 * 0x48,param_2,param_4);
    if (*(int *)(param_3 + 0x18) <= iVar3) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    iVar3 = iVar3 + 1;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f800();
}



void FUN_140391620(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_1403a0570(local_118,uVar8);
  if (*(int *)(param_2 + 8) < 1) {
    lVar6 = param_3 + 0xa8;
    local_68 = lVar6;
    FUN_14034ed40(lVar6);
    local_60 = 1;
    *(undefined1 *)(param_3 + 0x140) = 0;
    FUN_1403a0850(param_3);
    FUN_14034edd0(lVar6);
    goto LAB_140391c2d;
  }
  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_14034fe70();
  local_168 = PTR_DAT_1405d8010;
  uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
  local_c0 = uVar5;
  FUN_14034ed40(uVar5);
  local_b8 = 1;
  if (DAT_1405f064f != '\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_14035fc90(*(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_140360a00(*(undefined8 *)(param_1 + 0x148),&local_100);
  uVar3 = *(undefined4 *)(*(longlong *)(param_1 + 0x148) + 0x22c);
  if (lVar6 != 0) {
    FUN_1403a0550(lVar6 + 0xc0);
    local_140 = *(undefined4 *)(lVar6 + 0x710);
    local_13c = *(undefined2 *)(lVar6 + 0x714);
  }
  FUN_14034edd0(uVar5);
  local_b8 = 0;
  local_e0 = param_3 + 0xa8;
  FUN_14034ed40(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_140355540(uVar8);
  iVar4 = FUN_14039e640(uVar5,uVar7,*(undefined4 *)(param_2 + 8),&local_128,local_170[0],uVar12,
                        &local_160,&local_168);
  FUN_14034edd0(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_14038d950(param_4,0);
      if (*(int *)(local_160 + 0x40) != 0) {
        uVar10 = *(ulonglong *)(local_160 + 0x38);
      }
      FUN_140399de0(lVar6,uVar10,*(int *)(local_160 + 0x40),&local_148,uVar3,param_4);
      FUN_140391570(param_1,lVar6,param_4,param_3);
      goto LAB_140391b3c;
    }
    FUN_14038d950(param_4,0);
    FUN_1403a2ba0(&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_1403a35c0(&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_14034f800();
        }
        lVar6 = *(longlong *)(param_4 + 0x10) + (longlong)iVar9 * 0x48;
        FUN_140383db0(lVar6,0);
        local_138 = Proud::AddrPort::vftable;
        local_130 = local_150;
        local_12c = local_14c;
        FUN_14038db00(param_1,&local_138,lVar6,param_3);
        iVar4 = *(int *)(param_4 + 0x18);
        if (iVar4 <= iVar9) {
                    // WARNING: Subroutine does not return
          FUN_14034f800();
        }
        uVar10 = (ulonglong)(iVar9 + 1);
      }
    }
  }
  else {
    if (iVar4 == 2) {
      uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_d0 = uVar5;
      FUN_14034ed40(uVar5);
      local_c8 = 1;
      if (DAT_1405f064f != '\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_1405d8010;
      }
      local_110 = Proud::AddrPort::vftable;
      local_108 = *(undefined4 *)(param_2 + 0x30);
      local_104 = *(undefined2 *)(param_2 + 0x34);
      FUN_140372210(*(undefined8 *)(param_1 + 0x148),&local_110,puVar11);
      FUN_14034edd0(uVar5);
      local_c8 = 0;
    }
LAB_140391b3c:
    if (lVar6 != 0) {
      FUN_1403a0560(lVar6 + 0xc0);
    }
  }
  lVar6 = param_3 + 0xa8;
  local_78 = lVar6;
  FUN_14034ed40(lVar6);
  local_70 = 1;
  *(undefined1 *)(param_3 + 0x140) = 0;
  FUN_1403a0850(param_3);
  FUN_14034edd0(lVar6);
  puVar11 = local_168;
  if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_168 + -8, puVar1 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    local_88 = uVar5;
    FUN_14034ed40(uVar5);
    local_80 = 1;
    piVar2 = (int *)(puVar11 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar5);
  }
  local_168 = PTR_DAT_1405d8010;
  if (local_160 != 0) {
    FUN_14038a540();
  }
LAB_140391c2d:
  FUN_1403a0580(local_118);
  return;
}



void FUN_140391c60(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_1403a0570(local_res18,lVar9);
  uVar4 = (**(code **)(*(longlong *)(param_3 + 0x108) + 0x10))();
  FUN_14034ed40(uVar4);
  iVar3 = *(int *)(param_2 + 8);
  if (iVar3 < 1) {
    *(undefined1 *)(*(longlong *)(param_3 + 0x748) + 0x40) = 0;
    FUN_14034edd0(uVar4);
    uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
    local_88 = uVar5;
    FUN_14034ed40(uVar5);
    local_80 = 1;
    if (DAT_1405f064f != '\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_140381580(*(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_1403555d0(&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_14034fe70();
      local_res10 = PTR_DAT_1405d8010;
      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_1405d8010;
      }
      FUN_140017720(&local_res10,&DAT_1404591d0,*(undefined4 *)(param_3 + 0x6f8),puVar11,
                    CONCAT44(uVar13,*(undefined4 *)(param_2 + 0xc)));
      if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1405d8010)) &&
         (local_118 + -8 != (undefined *)0x0)) {
        uVar7 = FUN_14034fe70();
        local_68 = uVar7;
        FUN_14034ed40(uVar7);
        local_60 = 1;
        piVar1 = (int *)(local_118 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_118 + -8);
        }
        FUN_14034edd0(uVar7);
      }
      puVar11 = local_res10;
      puVar10 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar10 = PTR_DAT_1405d8010;
      }
      FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar10);
      if (((puVar11 != (undefined *)0x0) && (puVar11 != PTR_DAT_1405d8010)) &&
         (puVar11 + -8 != (undefined *)0x0)) {
        uVar7 = FUN_14034fe70();
        local_98 = uVar7;
        FUN_14034ed40(uVar7);
        local_90 = 1;
        piVar1 = (int *)(puVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar11 + -8);
        }
        FUN_14034edd0(uVar7);
      }
    }
LAB_140392144:
    bVar2 = false;
    FUN_14034edd0(uVar5);
  }
  else {
    uVar5 = FUN_140355540(*(undefined8 *)(*(longlong *)(param_3 + 0x748) + 0x110));
    FUN_1403a9e50(*(longlong *)(param_3 + 0x748) + 200,uVar5,iVar3);
    FUN_14038d950(param_4,0);
    iVar3 = FUN_140399d70(param_3,param_4);
    if (iVar3 != 0) {
      *(undefined1 *)(*(longlong *)(param_3 + 0x748) + 0x40) = 0;
      FUN_14034edd0(uVar4);
      uVar4 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_78 = uVar4;
      FUN_14034ed40(uVar4);
      local_70 = 1;
      if (DAT_1405f064f != '\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_140381580(*(undefined8 *)(param_1 + 0x148),param_3,iVar3,3,&local_c0,
                    L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase",0);
      FUN_1403555d0(&local_c0);
      FUN_14034edd0(uVar4);
      goto LAB_14039215b;
    }
    FUN_14034edd0(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_140391570(param_1,param_3,param_4,0);
    bVar2 = true;
    FUN_14034ed40(uVar4);
    *(undefined1 *)(*(longlong *)(param_3 + 0x748) + 0x40) = 0;
    iVar3 = FUN_1403a0010(*(undefined8 *)(param_3 + 0x748));
    if (iVar3 != 0) {
      FUN_14034edd0(uVar4);
      uVar5 = (**(code **)(**(longlong **)(param_1 + 0x148) + 0x58))();
      local_58 = uVar5;
      FUN_14034ed40(uVar5);
      local_50 = 1;
      if (DAT_1405f064f != '\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_1403555d0(&local_e8);
      (**(code **)(*(longlong *)(param_3 + 0xa0) + 0x40))
                (param_3 + 0xa0,L"Proud::CNetThreads_S::NetWorkerThread_TcpRecvCompletionCase");
      goto LAB_140392144;
    }
  }
  if (bVar2) {
    FUN_14034edd0(uVar4);
  }
LAB_14039215b:
  FUN_1403a0580(local_res18);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140392190(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_1405d84f0 ^ (ulonglong)auStack_188;
  local_168 = 0;
  local_160 = param_1;
  local_168 = FUN_1403a6a10(*param_2);
  if (local_168 != 0) {
    iVar1 = *(int *)(param_2 + 2);
    if (iVar1 == 2) {
      FUN_140391c60(param_1,param_2,local_168,param_3);
    }
    else if (iVar1 == 1) {
      FUN_14038a880(param_1,param_2,local_168);
    }
    else if (((iVar1 == 0) && (*(int *)(param_2 + 3) == -1)) &&
            (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x788) != 0)) {
      FUN_14038dff0(param_1);
    }
  }
  return;
}



void FUN_140392260(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_1403a9d00(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_14034fb20();
  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_1405d83d0;
      local_5c = DAT_1405d83d4;
      cVar5 = FUN_140358730(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x788),&local_90,
                            DAT_1405d8068);
      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_140389ca0(param_1,&local_b8);
      }
      if (cVar5 != '\0') {
        FUN_140392190(param_1,&local_90,&local_e0);
        lVar6 = FUN_1403a69b0(local_90);
        if (lVar6 != 0) {
          if (local_80 == 2) {
            FUN_140391620(param_1,&local_90,lVar6,&local_e0);
          }
          else if (local_80 == 1) {
            FUN_140389500(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_14038a040(&local_108,10);
    local_res18 = (undefined4 *)((ulonglong)local_res18 & 0xffffffff00000000);
    while (*(char *)(param_1 + 0x140) == '\0') {
      cVar5 = FUN_140358b80(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x788),&local_108,
                            &local_res18,DAT_1405d8068);
      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_140389ca0(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_14034f800();
          }
          FUN_140392190(param_1,(longlong)iVar8 * 0x38 + local_f8,&local_e0);
          if ((int)local_f0 <= iVar8) {
                    // WARNING: Subroutine does not return
            FUN_14034f800();
          }
          puVar3 = (undefined8 *)(uVar13 + local_f8);
          lVar6 = FUN_1403a69b0(*puVar3);
          if (lVar6 != 0) {
            if (*(int *)(puVar3 + 2) == 2) {
              FUN_140391620(param_1,puVar3,lVar6,&local_e0);
            }
            else if (*(int *)(puVar3 + 2) == 1) {
              FUN_140389500(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_14034ff60();
      }
      else {
        (**(code **)(*local_100 + 0x18))(local_100,local_f8);
      }
    }
  }
  if (*(longlong *)(*(longlong *)(param_1 + 0x148) + 0x17f0) != 0) {
    FUN_14034fe70();
    local_res20 = PTR_DAT_1405d8010;
    FUN_140017720(&local_res20,&DAT_140458cd0,L"Proud::CNetThreads_S::NetWorkerThread_Main");
    puVar4 = local_res20;
    puVar12 = local_res20;
    if (local_res20 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1405d8010;
    }
    FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x148) + 0x17f0),0,puVar12);
    if (((puVar4 != (undefined *)0x0) && (puVar4 != PTR_DAT_1405d8010)) &&
       (puVar4 + -8 != (undefined *)0x0)) {
      uVar7 = FUN_14034fe70();
      local_58 = uVar7;
      FUN_14034ed40(uVar7);
      local_50 = 1;
      piVar1 = (int *)(puVar4 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar4 + -8);
      }
      FUN_14034edd0(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_140399690();
      if (*(longlong *)(puVar10 + -2) != 0) {
        if ((int)puVar10[1] < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        *puVar10 = 0;
      }
      uVar11 = uVar11 + 1;
      puVar10 = puVar10 + 0x12;
    } while ((longlong)uVar11 < lVar6);
  }
  if (local_d0 != 0) {
    if (local_d8 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*local_d8 + 0x18))(local_d8,local_d0);
    }
  }
  if (local_a8 != 0) {
    if (local_b0 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*local_b0 + 0x18))(local_b0,local_a8);
    }
  }
  FUN_1403a9d30(local_res10);
  return;
}



void FUN_140392710(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_140357920(DVar1,"PNSrv NetWorker");
  FUN_140392260(param_1);
  return;
}



void FUN_140392740(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_1403a9c90(param_1 + 0x1e8,(double)uVar2 * 0.001);
  }
  pvVar4 = operator_new(0x28);
  if (pvVar4 == (void *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = FUN_1403573d0(pvVar4,FUN_140390890,param_1);
  }
  if (lVar5 == 0) {
    local_80 = (longlong *)0x0;
  }
  else {
    local_80 = (longlong *)FUN_14034fef0(0x10);
    local_80[1] = 1;
    *local_80 = lVar5;
  }
  plVar1 = local_80;
  FUN_14038a5f0(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_1403574e0(pvVar4);
        operator_delete(pvVar4);
      }
      FUN_14034ff60(plVar3);
    }
  }
  pvVar4 = operator_new(0x28);
  if (pvVar4 == (void *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = FUN_1403573d0(pvVar4,FUN_14038bc60,param_1);
  }
  if (lVar5 == 0) {
    local_78 = (longlong *)0x0;
  }
  else {
    local_78 = (longlong *)FUN_14034fef0(0x10);
    local_78[1] = 1;
    *local_78 = lVar5;
  }
  plVar1 = local_78;
  FUN_14038a5f0(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_1403574e0(pvVar4);
        operator_delete(pvVar4);
      }
      FUN_14034ff60(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_1403573d0(local_70,FUN_140392710,param_1);
      }
      if (lVar6 == 0) {
        local_70 = (longlong *)0x0;
      }
      else {
        local_70 = (longlong *)FUN_14034fef0(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_14034f7d0();
      }
      iVar12 = *(int *)(param_1 + 0x50);
      FUN_14038e3d0(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_1403a2c90(lVar5);
          lVar8 = FUN_1403a2c90(lVar5);
          FUN_14038a5f0(lVar6 + lVar8,lVar14 + lVar7);
          lVar14 = lVar14 + -8;
          lVar6 = lVar6 + -8;
          iVar12 = iVar12 + -1;
        } while (-1 < iVar12);
      }
      lVar6 = FUN_1403a2c90(lVar5);
      FUN_14038a5f0(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_1403574e0(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_14034ff60(plVar3);
        }
      }
      iVar13 = iVar13 + 1;
    } while (iVar13 < param_3);
  }
  local_60 = param_1;
  FUN_14034ed40(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_1403573d0(pvVar4,FUN_1403908c0,param_1);
      }
      if (lVar5 == 0) {
        local_88 = (longlong *)0x0;
      }
      else {
        local_88 = (longlong *)FUN_14034fef0(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_14034f7d0();
      }
      iVar11 = *(int *)(param_1 + 0x78);
      FUN_14038e3d0(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_1403a2c90(param_1 + 0x60);
          lVar7 = FUN_1403a2c90(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_1403574e0(pvVar4);
                operator_delete(pvVar4);
              }
              FUN_14034ff60(puVar10);
            }
          }
          lVar14 = lVar14 + -8;
          lVar6 = lVar6 + -1;
        } while (-1 < lVar6);
      }
      lVar6 = FUN_1403a2c90(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_1403574e0(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_14034ff60(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_1403574e0(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_14034ff60(local_88);
        }
      }
      local_res18 = local_res18 + 1;
    } while (local_res18 < param_2);
  }
  FUN_14034edd0(param_1);
  uVar9 = 0;
  if (*(undefined8 **)(param_1 + 0x88) != (undefined8 *)0x0) {
    uVar9 = **(undefined8 **)(param_1 + 0x88);
  }
  FUN_1403575d0(uVar9);
  uVar9 = 0;
  if (*(undefined8 **)(param_1 + 0x90) != (undefined8 *)0x0) {
    uVar9 = **(undefined8 **)(param_1 + 0x90);
  }
  FUN_1403575d0(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_14034f800();
      }
      puVar10 = *(undefined8 **)(*(longlong *)(param_1 + 0x48) + lVar5 * 8);
      uVar9 = 0;
      if (puVar10 != (undefined8 *)0x0) {
        uVar9 = *puVar10;
      }
      FUN_1403575d0(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_14034f800();
      }
      puVar10 = *(undefined8 **)(*(longlong *)(param_1 + 0x70) + lVar5 * 8);
      uVar9 = 0;
      if (puVar10 != (undefined8 *)0x0) {
        uVar9 = *puVar10;
      }
      FUN_1403575d0(uVar9);
      iVar13 = iVar13 + 1;
      lVar5 = lVar5 + 1;
    } while (iVar13 < *(int *)(param_1 + 0x78));
  }
  return;
}



DWORD FUN_140392d10(void)

{
  DWORD DVar1;
  
  DVar1 = GetLastError();
  if (0 < (int)DVar1) {
    DVar1 = DVar1 & 0xffff | 0x80070000;
  }
  return DVar1;
}



HANDLE FUN_140392d30(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_140392e30(undefined8 *param_1)

{
  if ((undefined8 *)*param_1 != param_1 + 1) {
    free((undefined8 *)*param_1);
  }
  return;
}



void FUN_140392e50(undefined8 *param_1)

{
  if ((HANDLE)*param_1 != (HANDLE)0x0) {
    CloseHandle((HANDLE)*param_1);
    *param_1 = 0;
  }
  return;
}



ulonglong FUN_140392e80(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_14034fcf0(param_2);
  iVar2 = (int)uVar8;
  if (iVar2 != 0) {
    iVar3 = FUN_14034fcf0(param_3);
    pwVar18 = (wchar_t *)*param_1;
    uVar4 = 0;
    local_58 = 0;
    uVar11 = uVar4;
    pwVar15 = (wchar_t *)PTR_DAT_1405d8010;
    if ((pwVar18 != (wchar_t *)0x0) && (pwVar15 = pwVar18, pwVar18 != (wchar_t *)PTR_DAT_1405d8010))
    {
      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_14034fcf0(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_1405d8010)) {
          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_1405d8010)) {
          iVar14 = *(int *)(puVar1 + -8);
        }
        iVar6 = 0;
        if (((iVar7 <= iVar14) && (iVar7 = iVar13, puVar1 != (undefined *)0x0)) &&
           (iVar7 = iVar6, puVar1 != PTR_DAT_1405d8010)) {
          iVar7 = *(int *)(puVar1 + -8);
        }
        iVar14 = 1;
        if (1 < iVar7) {
          iVar14 = iVar7;
        }
        if ((puVar1 != (undefined *)0x0) && (puVar1 != PTR_DAT_1405d8010)) {
          iVar6 = *(int *)(puVar1 + -8);
        }
        if (iVar6 < iVar14) {
          FUN_140002d30(param_1);
        }
        FUN_140002e10(param_1);
        lVar10 = (longlong)iVar5;
        pwVar15 = (wchar_t *)*param_1;
        if ((wchar_t *)*param_1 == (wchar_t *)0x0) {
          pwVar15 = (wchar_t *)PTR_DAT_1405d8010;
        }
        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_14034fcf0(pwVar18);
          uVar4 = local_58;
        }
        FUN_140002f80(param_1,iVar12);
      }
    }
    return (ulonglong)uVar4;
  }
  return uVar8;
}



void FUN_140393130(void)

{
  FUN_140360bd0();
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403931bf)
// WARNING: Removing unreachable block (ram,0x0001403931c8)
// WARNING: Removing unreachable block (ram,0x0001403931e6)
// WARNING: Removing unreachable block (ram,0x0001403931ef)

undefined1 *
FUN_140393150(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_1403c0cc0();
  FUN_14034ec60(param_1 + 0x58,uVar1,1,param_4,uVar2);
  param_1[0x88] = 1;
  return param_1;
}



void FUN_140393230(longlong param_1)

{
  FUN_14034edf0(param_1 + 0x58);
  FUN_140393130(param_1);
  return;
}



void FUN_140393260(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_14034ff60(puVar3);
    }
  }
  return;
}



void FUN_1403932f0(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_14034ff60(puVar1);
    }
  }
  return;
}



void FUN_140393360(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_14034ff60(puVar1);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403933d0(__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_1405d84f0 ^ (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_14000d450(0x80070057);
    }
    sVar2 = wcsftime(local_128,0x80,param_3,&local_150);
    if (sVar2 == 0) {
      local_128[0] = L'\0';
    }
    pwVar3 = local_128;
  }
  FUN_1403070c0(param_2,pwVar3);
  return param_2;
}



undefined8 * FUN_140393470(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_14000d450(0x80004005);
  }
  *param_2 = 0;
  FUN_140393260(param_2,plVar1 + 2);
  lVar2 = *plVar1;
  param_1[1] = lVar2;
  if (lVar2 == 0) {
    param_1[2] = 0;
  }
  else {
    *(undefined8 *)(lVar2 + 8) = 0;
  }
  FUN_140393360(plVar1);
  plVar3 = (longlong *)*param_1;
  if (plVar3 == (longlong *)0x0) {
    FUN_14034ff60(plVar1);
  }
  else {
    (**(code **)(*plVar3 + 0x10))(plVar3,plVar1);
  }
  param_1[3] = param_1[3] + -1;
  return param_2;
}



void FUN_140393510(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_14034ff60(puVar3);
    }
    plVar5 = (longlong *)*param_1;
    if (plVar5 == (longlong *)0x0) {
      FUN_14034ff60(plVar2);
    }
    else {
      (**(code **)(*plVar5 + 0x10))(plVar5,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_1403935f0(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_14034ed40();
  if (*(char *)(param_1 + 0x50) != '\0') {
    FUN_14034f420(local_78,L"LogFile Creation Failed");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  pvVar3 = operator_new(0x20);
  if (pvVar3 == (void *)0x0) {
    pvVar3 = (void *)0x0;
  }
  else {
    FUN_14034fe70();
    *(undefined **)((longlong)pvVar3 + 8) = PTR_DAT_1405d8010;
  }
  if (pvVar3 == (void *)0x0) {
    local_res8 = (longlong *)0x0;
  }
  else {
    local_res8 = (longlong *)FUN_14034fef0();
    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_14000d470(lVar5 + 8,param_3);
  if (local_res8 == (longlong *)0x0) {
    lVar5 = 0;
  }
  else {
    lVar5 = *local_res8;
  }
  FUN_140392e80(lVar5 + 8,&DAT_1404765b0,&DAT_140477960);
  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_14034fef0(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_14034ff60(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_1403aa0a0(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_14034ff60(local_res8);
    }
  }
  FUN_14034edd0(param_1 + 0x18);
  return;
}



void FUN_140393880(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_14034ed40();
  if (*(char *)(param_1 + 0x50) != '\0') {
    FUN_14034f420(local_80,L"LogFile Creation Failed");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_80,(ThrowInfo *)&DAT_1405d36c0);
  }
  pvVar3 = operator_new(0x20);
  if (pvVar3 == (void *)0x0) {
    pvVar3 = (void *)0x0;
  }
  else {
    FUN_14034fe70();
    *(undefined **)((longlong)pvVar3 + 8) = PTR_DAT_1405d8010;
  }
  if (pvVar3 == (void *)0x0) {
    local_b8 = (longlong *)0x0;
  }
  else {
    local_b8 = (longlong *)FUN_14034fef0(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_140017690(lVar6 + 8,param_2,&local_res18);
  if (local_b8 == (longlong *)0x0) {
    lVar6 = 0;
  }
  else {
    lVar6 = *local_b8;
  }
  FUN_140392e80(lVar6 + 8,&DAT_1404765b0,&DAT_140477960);
  if (local_b8 == (longlong *)0x0) {
    lVar6 = 0;
  }
  else {
    lVar6 = *local_b8;
  }
  FUN_140017790(lVar6 + 8,&DAT_1404ad0dc);
  uVar1 = *(undefined8 *)(param_1 + 0x98);
  plVar2 = *(longlong **)(param_1 + 0x88);
  if (plVar2 == (longlong *)0x0) {
    puVar5 = (undefined8 *)FUN_14034fef0(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_14034ff60(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_1403aa0a0(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_14034ff60(local_b8);
    }
  }
  FUN_14034edd0(param_1 + 0x18);
  return;
}



void FUN_140393b00(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_140393510();
  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_140393b30(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_1405d84f0 ^ (ulonglong)auStackY_3b8;
  local_320 = GetFileSize((HANDLE)*param_1,&DStack_31c);
  if ((local_320 != 0xffffffff) || (iVar5 = FUN_140392d10(), 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_140392d10();
  }
  FUN_14034fe70();
  local_350 = PTR_DAT_1405d8010;
  local_2c0 = _time64((__time64_t *)0x0);
  puVar9 = (undefined8 *)FUN_1403933d0(&local_2c0,&local_310,&DAT_1404595d8);
  pWVar17 = (LPCWSTR)*puVar9;
  local_258 = local_250;
  if (pWVar17 == (LPCWSTR)0x0) {
    local_258 = (undefined1 *)0x0;
    goto LAB_140393cef;
  }
  iVar5 = lstrlenW(pWVar17);
  iVar5 = iVar5 + 1;
  if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80070057);
  }
  if (local_258 == local_250) {
    if (0x80 < iVar5) {
      puVar16 = calloc((longlong)iVar5,2);
      goto LAB_140393c81;
    }
LAB_140393c95:
    puVar16 = local_250;
  }
  else {
    if (iVar5 < 0x81) {
      free(local_258);
      goto LAB_140393c95;
    }
    puVar16 = _recalloc(local_258,(longlong)iVar5,2);
    if (puVar16 == (undefined1 *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
LAB_140393c81:
    if (puVar16 == (undefined1 *)0x0) {
      local_258 = puVar16;
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_14000d450(0x8007000e);
    }
    if ((eVar8 == 0x16) || (eVar8 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar8 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
LAB_140393cef:
  piVar19 = (int *)0x0;
  FUN_140017720(&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_1405d8010;
  iVar5 = 0;
  if (local_350 != (undefined *)0x0) {
    piVar13 = piVar19;
    if (local_350 != PTR_DAT_1405d8010) {
      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_140392d10();
  }
  if (((puVar20 != (undefined *)0x0) && (puVar20 != PTR_DAT_1405d8010)) &&
     (puVar20 + -8 != (undefined *)0x0)) {
    uVar10 = FUN_14034fe70();
    local_2a8 = uVar10;
    FUN_14034ed40(uVar10);
    local_2a0 = 1;
    piVar13 = (int *)(puVar20 + -4);
    *piVar13 = *piVar13 + -1;
    if (*piVar13 == 0) {
      FUN_14034ff60(puVar20 + -8);
    }
    FUN_14034edd0(uVar10);
    local_2a0 = 0;
  }
  cVar4 = *(char *)(param_1 + 0x10);
  local_350 = PTR_DAT_1405d8010;
  lVar22 = local_348;
  do {
    if (cVar4 != '\0') {
      return;
    }
    cVar4 = FUN_140359f50(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_14034ed40(puVar9);
      local_2c8 = 1;
      if (*(char *)(param_1 + 10) == '\0') {
        lVar1 = param_1[0x14];
        while (lVar1 != 0) {
          plVar11 = (longlong *)FUN_140393470(param_1 + 0x11,&local_360);
          puVar9 = (undefined8 *)FUN_14034fef0(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_14034ff60(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_14034ff60(puVar12);
          }
          puVar9 = local_2d0;
          lVar1 = param_1[0x14];
        }
      }
      FUN_14034edd0(puVar9);
      local_2c8 = 0;
      FUN_14034fe70();
      local_370 = PTR_DAT_1405d8010;
      puVar20 = PTR_DAT_1405d8010;
      while (local_328 != 0) {
        FUN_140393470(&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_1405d8010;
          }
          if (param_1[1] == 0) {
            pvVar15 = CreateFileW(pWVar17,0x40000000,1,(LPSECURITY_ATTRIBUTES)0x0,4,0x80,(HANDLE)0x0
                                 );
          }
          else {
            pvVar15 = (HANDLE)FUN_140392d30(param_1[1],pWVar17,0x40000000);
          }
          if (pvVar15 == (HANDLE)0xffffffffffffffff) {
            iVar5 = FUN_140392d10();
            if (iVar5 < 0) {
              *(undefined1 *)(param_1 + 10) = 1;
              goto LAB_140394449;
            }
          }
          else {
            *param_1 = pvVar15;
          }
          local_378[0] = 0xfeff;
          BVar7 = WriteFile((HANDLE)*param_1,local_378,2,local_308,(LPOVERLAPPED)0x0);
          if (BVar7 == 0) {
            FUN_140392d10();
          }
          local_318 = GetFileSize((HANDLE)*param_1,&DStack_314);
          if ((local_318 != 0xffffffff) || (iVar5 = FUN_140392d10(), -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_140392d10();
          }
          FUN_14034fe70();
          local_358 = PTR_DAT_1405d8010;
          local_2f8 = _time64((__time64_t *)0x0);
          puVar9 = (undefined8 *)FUN_1403933d0(&local_2f8,&local_348,&DAT_1404595d8);
          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_14000d450(0x80070057);
            }
            if (local_148 == local_140) {
              if (0x80 < iVar5) {
                puVar16 = calloc((longlong)iVar5,2);
                goto LAB_1403942f8;
              }
LAB_14039430a:
              puVar16 = local_140;
            }
            else {
              if (iVar5 < 0x81) {
                free(local_148);
                goto LAB_14039430a;
              }
              puVar16 = _recalloc(local_148,(longlong)iVar5,2);
              if (puVar16 == (undefined1 *)0x0) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x8007000e);
              }
LAB_1403942f8:
              if (puVar16 == (undefined1 *)0x0) {
                local_148 = puVar16;
                    // WARNING: Subroutine does not return
                FUN_14000d450(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_14000d450(0x8007000e);
              }
              if ((eVar8 == 0x16) || (eVar8 == 0x22)) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80070057);
              }
              if (eVar8 != 0x50) {
                    // WARNING: Subroutine does not return
                FUN_14000d450(0x80004005);
              }
            }
          }
          FUN_140017720(&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_1405d8010;
          if (local_358 != (undefined *)0x0) {
            piVar13 = piVar19;
            if (local_358 != PTR_DAT_1405d8010) {
              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_140392d10();
          }
          if (((puVar20 != (undefined *)0x0) && (puVar20 != PTR_DAT_1405d8010)) &&
             (puVar20 + -8 != (undefined *)0x0)) {
            uVar10 = FUN_14034fe70();
            local_298 = uVar10;
            FUN_14034ed40(uVar10);
            local_290 = 1;
            piVar13 = (int *)(puVar20 + -4);
            *piVar13 = *piVar13 + -1;
            if (*piVar13 == 0) {
              FUN_14034ff60(puVar20 + -8);
            }
            FUN_14034edd0(uVar10);
            local_290 = 0;
          }
          local_358 = PTR_DAT_1405d8010;
          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_1403933d0(&local_2b0,&local_2d8,&DAT_1404595d8);
          uVar10 = *puVar12;
          piVar13 = piVar19;
          if (puVar9 != (undefined8 *)0x0) {
            piVar13 = (int *)*puVar9;
          }
          uVar14 = FUN_1403a1680(piVar13[4]);
          FUN_140017720(&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_1405d8010;
          if (local_370 != (undefined *)0x0) {
            piVar13 = piVar19;
            if (local_370 != PTR_DAT_1405d8010) {
              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_140392d10();
            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_1405d8010)) {
            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_1405d8010;
          }
          BVar7 = WriteFile((HANDLE)*param_1,puVar18,iVar5 * 2,local_2e0,(LPOVERLAPPED)0x0);
          if (BVar7 == 0) {
            FUN_140392d10();
          }
        }
LAB_140394449:
        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_14034ff60(puVar12);
            puVar20 = local_370;
          }
        }
      }
      if (((puVar20 != (undefined *)0x0) && (puVar20 != PTR_DAT_1405d8010)) &&
         (puVar20 + -8 != (undefined *)0x0)) {
        uVar10 = FUN_14034fe70();
        local_288 = uVar10;
        FUN_14034ed40(uVar10);
        local_280 = 1;
        piVar13 = (int *)(puVar20 + -4);
        *piVar13 = *piVar13 + -1;
        if (*piVar13 == 0) {
          FUN_14034ff60(puVar20 + -8);
        }
        FUN_14034edd0(uVar10);
        local_280 = 0;
      }
      local_370 = PTR_DAT_1405d8010;
      FUN_140393510(&local_340);
      if (local_340 != (undefined8 *)0x0) {
        (**(code **)*local_340)(local_340,1);
      }
    }
    cVar4 = *(char *)(param_1 + 0x10);
  } while( true );
}



void FUN_140394590(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  *(undefined1 *)(param_1 + 0x10) = 1;
  FUN_140357460(param_1 + 0xb);
  FUN_140393510(param_1 + 0x11);
  puVar1 = (undefined8 *)param_1[0x11];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar2);
  }
  FUN_1403574e0(param_1 + 0xb);
  FUN_14034edf0(param_1 + 3);
  CloseHandle((HANDLE)param_1[2]);
  if ((HANDLE)*param_1 != (HANDLE)0x0) {
    CloseHandle((HANDLE)*param_1);
    *param_1 = 0;
  }
  return;
}



undefined8 *
FUN_140394640(undefined8 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  
  *param_1 = 0;
  param_1[1] = 0;
  FUN_1403aa080(param_1 + 2,0,0x7fffffff,param_4,0xfffffffffffffffe);
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 3,uVar1,1);
  *(undefined1 *)(param_1 + 10) = 0;
  FUN_1403573d0(param_1 + 0xb,&LAB_140394630,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_1403946e0(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_140392d10(), 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_140392d10();
    }
    local_res18[0] = operator_new(0xc0);
    if (local_res18[0] != (void *)0x0) {
      puVar3 = (undefined8 *)FUN_140394640(local_res18[0]);
    }
    *puVar3 = hFile;
    FUN_1403575d0(puVar3 + 0xb);
    CloseHandle((HANDLE)0xffffffffffffffff);
  }
  return puVar3;
}



void FUN_1403947d0(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 0x0001403947f7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 * FUN_140394810(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_140394870(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_140385ff0();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_14034fef0(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_14034fef0(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_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_14034ff60(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_1403949c0(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_1403a2c90(param_1);
        lVar3 = FUN_1403a2c90(param_1);
        *(undefined8 *)(lVar3 + lVar4) = *(undefined8 *)((longlong)param_3 * 8 + lVar2 + lVar4);
        lVar4 = lVar4 + 8;
        lVar5 = lVar5 + -1;
      } while (lVar5 != 0);
    }
    FUN_140394870(param_1,*(int *)(param_1 + 0x18) - param_3);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



undefined8 FUN_140394a70(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_14034f420(local_50,L"ServerSocketPool is already destructed!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  DVar2 = GetTickCount();
  DVar3 = GetTickCount();
  if (DVar3 - DVar2 < 10000) {
    pcVar1 = param_1 + 0x30;
    do {
      pcVar8 = pcVar1;
      FUN_14034ed40(pcVar1);
      if (0 < *(int *)(param_1 + 0x80)) {
        lVar4 = FUN_14034fef0(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_14034f800();
          }
          uVar7 = FUN_140355a20(lVar4,*(undefined8 *)
                                       (*(longlong *)(param_1 + 0x78) + (longlong)iVar6 * 8),param_2
                                ,param_4,uVar7,pcVar8);
        }
        FUN_1403949c0(param_1 + 0x68,*(int *)(param_1 + 0x80) + -1,1);
        FUN_14034edd0(pcVar1);
        return uVar7;
      }
      FUN_14034edd0(pcVar1);
      Sleep(1);
      DVar3 = GetTickCount();
    } while (DVar3 - DVar2 < 10000);
  }
  lVar4 = Ordinal_23(2,1,6);
  if (lVar4 == -1) {
    uVar7 = 0;
  }
  else {
    lVar5 = FUN_14034fef0(0x400);
    if (lVar5 == 0) {
      uVar7 = 0;
    }
    else {
      uVar7 = FUN_140355a20(lVar5,lVar4,param_2);
    }
  }
  return uVar7;
}



void FUN_140394c00(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_140357460(param_1 + 8);
  puVar1 = param_1 + 0x30;
  puVar6 = puVar1;
  FUN_14034ed40(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_14034f800();
      }
      FUN_140358460(*(undefined8 *)(*(longlong *)(param_1 + 0x78) + uVar2 * 8));
      if (*(int *)(param_1 + 0x80) <= iVar3) {
                    // WARNING: Subroutine does not return
        FUN_14034f800();
      }
      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_140394870(param_1 + 0x68,0,param_3,param_4,uVar5,puVar6,uVar7);
  FUN_14034edd0(puVar1);
  *(undefined ***)(param_1 + 0x68) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x78) != 0) {
    if (*(longlong **)(param_1 + 0x70) == (longlong *)0x0) {
      FUN_14034ff60(*(longlong *)(param_1 + 0x78));
    }
    else {
      (**(code **)(**(longlong **)(param_1 + 0x70) + 0x18))();
    }
  }
  FUN_14034edf0(puVar1);
  FUN_1403574e0(param_1 + 8);
  return;
}



void FUN_140394d10(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_14034ed40(pcVar1);
      if (*(int *)(param_1 + 0x80) < 100) {
        FUN_14034edd0(pcVar1);
        bVar3 = false;
        lVar4 = Ordinal_23(2,1,6,param_4,uVar10,pcVar11);
        if (lVar4 != -1) {
          bVar3 = true;
          FUN_14034ed40(pcVar1);
          iVar2 = *(int *)(param_1 + 0x80);
          if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          iVar7 = *(int *)(param_1 + 0x80);
          FUN_140394870(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_1403a2c90(param_1 + 0x68);
              lVar6 = FUN_1403a2c90(param_1 + 0x68);
              *(undefined8 *)(lVar6 + lVar9) = *(undefined8 *)(lVar5 + -8 + lVar9);
              lVar9 = lVar9 + -8;
              lVar8 = lVar8 + -1;
            } while (-1 < lVar8);
          }
          lVar8 = FUN_1403a2c90(param_1 + 0x68);
          *(longlong *)(lVar8 + (longlong)iVar2 * 8) = lVar4;
        }
      }
      else {
        FUN_14034edd0(pcVar1);
        bVar3 = false;
        Sleep(10);
      }
      if (bVar3) {
        FUN_14034edd0(pcVar1);
      }
    } while (*param_1 == '\0');
  }
  return;
}



undefined1 *
FUN_140394ea0(undefined1 *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  
  FUN_1403573d0(param_1 + 8,&LAB_140394e90,param_1,param_4,0xfffffffffffffffe);
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(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_1403575d0(param_1 + 8);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140394f20(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_1405d84f0 ^ (ulonglong)auStack_d8;
  local_b8 = param_3;
  if (((param_3 != 0x10) && (param_3 != 0x18)) && (param_3 != 0x20)) {
    FUN_14034f0d0(local_a8,"Incorrect key length");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (((param_4 != 0x10) && (param_4 != 0x18)) && (param_4 != 0x20)) {
    FUN_14034f0d0(local_a8,"Incorrect block length");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a8,(ThrowInfo *)&DAT_1405d36c0);
  }
  *(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_14039502f;
    }
    uVar3 = 0xe;
    if (param_4 != 0x20) {
      uVar3 = 0xc;
    }
  }
  *(undefined4 *)((longlong)param_1 + 0x3c8) = uVar3;
LAB_14039502f:
  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_14045d250;
    do {
      uVar11 = (ulonglong)(int)auStack_64[lVar17];
      auStack_64[1] =
           auStack_64[1] ^
           CONCAT31(CONCAT21(CONCAT11((&DAT_14045a050)[(longlong)uVar11 >> 0x10 & 0xff] ^ *pbVar16,
                                      (&DAT_14045a050)[(longlong)uVar11 >> 8 & 0xff]),
                             (&DAT_14045a050)[uVar11 & 0xff]),
                    (&DAT_14045a050)[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_14045a050)[auStack_64[4] >> 0x18],
                                        (&DAT_14045a050)[(longlong)uVar11 >> 0x10 & 0xff]),
                               (&DAT_14045a050)[(longlong)uVar11 >> 8 & 0xff]),
                      (&DAT_14045a050)[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_140395315;
          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_140395315:
  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_14045c250 + (ulonglong)(*puVar14 >> 0x18) * 4) ^
                     *(uint *)(&DAT_14045c650 + ((longlong)uVar11 >> 0x10 & 0xffU) * 4) ^
                     *(uint *)(&DAT_14045ca50 + ((longlong)uVar11 >> 8 & 0xffU) * 4) ^
                     *(uint *)(&DAT_14045ce50 + (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_1403953f0(longlong param_1)

{
  return 0 < *(int *)(param_1 + 0x3c0);
}



void FUN_140395400(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x3c0) = 0;
  return;
}



void FUN_140395410(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_14034f420(local_78,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14045a250 + ((longlong)uVar5 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045a650 + ((longlong)uVar6 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045aa50 + ((longlong)uVar7 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045ae50 + (uVar4 & 0xff) * 4) ^ puVar9[-1];
      uVar2 = *(uint *)(&DAT_14045aa50 + ((longlong)uVar4 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045a250 + ((longlong)uVar6 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045a650 + ((longlong)uVar7 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045ae50 + (uVar5 & 0xff) * 4) ^ *puVar9;
      uVar8 = *(uint *)(&DAT_14045a650 + ((longlong)uVar4 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045aa50 + ((longlong)uVar5 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045a250 + ((longlong)uVar7 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045ae50 + (uVar6 & 0xff) * 4) ^ puVar9[1];
      uVar1 = *(uint *)(&DAT_14045a250 + (ulonglong)(uVar1 >> 0x18) * 4) ^
              *(uint *)(&DAT_14045a650 + ((longlong)uVar5 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045aa50 + ((longlong)uVar6 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045ae50 + (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_14045a050)[(longlong)uVar4 >> 0x18 & 0xff] ^ (byte)(uVar10 >> 0x18);
  param_2[1] = (&DAT_14045a050)[(longlong)uVar11 >> 0x10 & 0xff] ^ (byte)(uVar10 >> 0x10);
  param_2[2] = (&DAT_14045a050)[(longlong)uVar6 >> 8 & 0xff] ^ (byte)(uVar10 >> 8);
  param_2[3] = (&DAT_14045a050)[uVar5 & 0xff] ^ (byte)uVar10;
  uVar10 = param_3[1];
  param_2[4] = (&DAT_14045a050)[(longlong)uVar11 >> 0x18 & 0xff] ^ (byte)(uVar10 >> 0x18);
  param_2[5] = (&DAT_14045a050)[(longlong)uVar6 >> 0x10 & 0xff] ^ (byte)(uVar10 >> 0x10);
  param_2[6] = (&DAT_14045a050)[(longlong)uVar5 >> 8 & 0xff] ^ (byte)(uVar10 >> 8);
  param_2[7] = (&DAT_14045a050)[uVar4 & 0xff] ^ (byte)uVar10;
  uVar10 = param_3[2];
  param_2[8] = (&DAT_14045a050)[(longlong)uVar6 >> 0x18 & 0xff] ^ (byte)(uVar10 >> 0x18);
  param_2[9] = (&DAT_14045a050)[(longlong)uVar5 >> 0x10 & 0xff] ^ (byte)(uVar10 >> 0x10);
  param_2[10] = (&DAT_14045a050)[(longlong)uVar4 >> 8 & 0xff] ^ (byte)(uVar10 >> 8);
  param_2[0xb] = (&DAT_14045a050)[uVar11 & 0xff] ^ (byte)uVar10;
  uVar10 = param_3[3];
  param_2[0xc] = (&DAT_14045a050)[(longlong)uVar5 >> 0x18 & 0xff] ^ (byte)(uVar10 >> 0x18);
  param_2[0xd] = (&DAT_14045a050)[(longlong)uVar4 >> 0x10 & 0xff] ^ (byte)(uVar10 >> 0x10);
  param_2[0xe] = (&DAT_14045a050)[(longlong)uVar11 >> 8 & 0xff] ^ (byte)(uVar10 >> 8);
  param_2[0xf] = (&DAT_14045a050)[uVar6 & 0xff] ^ (byte)uVar10;
  return;
}



void FUN_140395890(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_14034f420(local_78,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14045b650 + ((longlong)uVar7 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045b250 + ((longlong)uVar10 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045ba50 + ((longlong)uVar9 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045be50 + (uVar8 & 0xff) * 4) ^ puVar2[-1];
      uVar4 = *(uint *)(&DAT_14045b250 + ((longlong)uVar8 >> 0x18 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045ba50 + ((longlong)uVar7 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045b650 + ((longlong)uVar10 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045be50 + (uVar9 & 0xff) * 4) ^ *puVar2;
      uVar11 = *(uint *)(&DAT_14045b650 + ((longlong)uVar8 >> 0x10 & 0xffU) * 4) ^
               *(uint *)(&DAT_14045ba50 + ((longlong)uVar10 >> 8 & 0xffU) * 4) ^
               *(uint *)(&DAT_14045b250 + ((longlong)uVar9 >> 0x18 & 0xffU) * 4) ^
               *(uint *)(&DAT_14045be50 + (uVar7 & 0xff) * 4) ^ puVar2[1];
      uVar6 = *(uint *)(&DAT_14045b250 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_14045ba50 + ((longlong)uVar8 >> 8 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045b650 + ((longlong)uVar9 >> 0x10 & 0xffU) * 4) ^
              *(uint *)(&DAT_14045be50 + (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_14045a150)[(longlong)uVar13 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_2[1] = (&DAT_14045a150)[(longlong)uVar9 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_2[2] = (&DAT_14045a150)[(longlong)uVar8 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_2[3] = (&DAT_14045a150)[uVar7 & 0xff] ^ (byte)uVar1;
  uVar1 = puVar3[1];
  param_2[4] = (&DAT_14045a150)[(longlong)uVar7 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_2[5] = (&DAT_14045a150)[(longlong)uVar13 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_2[6] = (&DAT_14045a150)[(longlong)uVar9 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_2[7] = (&DAT_14045a150)[uVar8 & 0xff] ^ (byte)uVar1;
  uVar1 = puVar3[2];
  param_2[8] = (&DAT_14045a150)[(longlong)uVar8 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_2[9] = (&DAT_14045a150)[(longlong)uVar7 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_2[10] = (&DAT_14045a150)[(longlong)uVar13 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_2[0xb] = (&DAT_14045a150)[uVar9 & 0xff] ^ (byte)uVar1;
  uVar1 = puVar3[3];
  param_2[0xc] = (&DAT_14045a150)[(longlong)uVar9 >> 0x18 & 0xff] ^ (byte)((uint)uVar1 >> 0x18);
  param_2[0xd] = (&DAT_14045a150)[(longlong)uVar8 >> 0x10 & 0xff] ^ (byte)((uint)uVar1 >> 0x10);
  param_2[0xe] = (&DAT_14045a150)[(longlong)uVar7 >> 8 & 0xff] ^ (byte)((uint)uVar1 >> 8);
  param_2[0xf] = (&DAT_14045a150)[uVar13 & 0xff] ^ (byte)uVar1;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

void FUN_140395d20(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_1405d84f0 ^ (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_140395410();
    }
    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_14045d278 + lVar5);
      local_f8 = *(int *)(&DAT_14045d280 + lVar5);
      iVar9 = *(int *)(&DAT_14045d288 + 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_14045aa50 +
                            ((longlong)(ulonglong)(uint)(&local_80)[(iVar10 + iVar1) % iVar4] >> 8 &
                            0xffU) * 4) ^
                   *(uint *)(&DAT_14045ae50 +
                            (ulonglong)*(byte *)(&local_80 + (iVar8 + iVar1) % iVar4) * 4) ^
                   *(uint *)(&DAT_14045a650 +
                            ((longlong)(ulonglong)(uint)(&local_80)[iVar1 % iVar4] >> 0x10 & 0xffU)
                            * 4) ^
                   *(uint *)(&DAT_14045a250 +
                            (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_14045a050)[*(byte *)((longlong)&local_80 + lVar13 + 3)] ^
                     (byte)((uint)uVar3 >> 0x18);
          param_2[1] = (&DAT_14045a050)
                       [(longlong)(ulonglong)(uint)(&local_80)[(local_f8 + iVar6) % iVar4] >> 0x10 &
                        0xff] ^ (byte)((uint)uVar3 >> 0x10);
          param_2[2] = (&DAT_14045a050)
                       [(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_14045a050)[*(byte *)(&local_80 + iVar1 % iVar4)] ^ (byte)uVar3;
          param_2 = param_2 + 4;
        } while (lVar11 < lVar12);
      }
    }
    return;
  }
  FUN_14034f420(local_c8,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_c8,(ThrowInfo *)&DAT_1405d36c0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

void FUN_1403960d0(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_1405d84f0 ^ (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_140395890();
    }
    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_14045d27c + lVar4);
      local_f4 = *(int *)(&DAT_14045d284 + lVar4);
      local_f8 = *(int *)(&DAT_14045d28c + 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_14045ba50 +
                            ((longlong)(ulonglong)(uint)(&local_88)[(iVar10 + iVar7) % iVar3] >> 8 &
                            0xffU) * 4) ^
                   *(uint *)(&DAT_14045be50 +
                            (ulonglong)*(byte *)(&local_88 + (iVar8 + iVar7) % iVar3) * 4) ^
                   *(uint *)(&DAT_14045b650 +
                            ((longlong)(ulonglong)(uint)(&local_88)[iVar7 % iVar3] >> 0x10 & 0xffU)
                            * 4) ^
                   *(uint *)(&DAT_14045b250 +
                            (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_14045a150)[*(byte *)((longlong)&local_88 + lVar1 + 3)] ^
                     (byte)((uint)uVar2 >> 0x18);
          param_2[1] = (&DAT_14045a150)
                       [(longlong)(ulonglong)(uint)(&local_88)[(local_f4 + iVar5) % iVar3] >> 0x10 &
                        0xff] ^ (byte)((uint)uVar2 >> 0x10);
          param_2[2] = (&DAT_14045a150)
                       [(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_14045a150)[*(byte *)(&local_88 + iVar7 % iVar3)] ^ (byte)uVar2;
          param_2 = param_2 + 4;
        } while (lVar4 < lVar11);
      }
    }
    return;
  }
  FUN_14034f420(local_d0,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_d0,(ThrowInfo *)&DAT_1405d36c0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140396480(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_1405d84f0 ^ (ulonglong)auStack_c8;
  if (*(int *)(param_1 + 0x3c0) < 1) {
    FUN_14034f420(local_a8,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a8,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_140395d20(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_140395d20(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_140395d20(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_14034f420(local_a8,L"block size is not 16byte or 24byte or 32byte");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_a8,(ThrowInfo *)&DAT_1405d36c0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140396710(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_1405d84f0 ^ (ulonglong)auStack_b8;
  if (*(int *)(param_1 + 0x3c0) < 1) {
    FUN_14034f420(local_98,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_1403960d0(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_140395d20(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_1403960d0(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_14034f420(local_98,L"block size is not 16byte or 24byte or 32byte");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
}



undefined8 FUN_140396990(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_14034f0d0(local_e8,&DAT_14045d430);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_e8,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_1400179d0(&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_140396710(param_3,pbVar5,pbVar4,(longlong)*(int *)(param_1 + 0x18),0);
    if ((int)local_120 < 1) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    bVar1 = *local_128;
    if ((int)local_120 < (int)(bVar1 + 5)) {
      FUN_14034f0d0(local_a0,&DAT_14045d400);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
    }
    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_1403aa0d0(pbVar4 + 5,((int)local_120 - (uint)bVar1) + -5);
    if (iVar2 != iVar3) {
      FUN_14034f0d0(local_58,&DAT_14045d3c8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    FUN_1400179d0(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_140399690(&local_110);
    if (local_108 != 0) {
      if ((longlong)local_100 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_100 = local_100 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_138);
  }
  return 1;
}



undefined8 FUN_140396b80(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_14034f0d0(local_a0,&DAT_14045d430);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
  }
  lVar3 = *(longlong *)(param_1 + 8);
  if (lVar3 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
      }
      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_140399790();
    }
    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_140399790();
      }
      if (*(int *)(lVar3 + 0x18) == 0) {
        lVar3 = 0;
      }
      else {
        lVar3 = *(longlong *)(lVar3 + 0x10);
      }
    }
    else {
      lVar3 = *(longlong *)(param_1 + 0x10);
      if (lVar3 == 0) {
        FUN_14034f420(local_178,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_178,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    pbVar7 = (byte *)0x0;
    local_250 = 0;
    local_248 = (byte *)0x0;
    local_240 = 0;
    local_238 = 0;
    local_258 = Proud::ByteArray::vftable;
    FUN_1400179d0(&local_258,iVar8);
    pbVar4 = local_248;
    if ((int)local_240 == 0) {
      pbVar4 = pbVar7;
    }
    FUN_140396710(param_3,param_4 + lVar3,pbVar4,iVar8,0);
    if ((int)local_240 < 1) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    bVar1 = *local_248;
    if ((int)local_240 < (int)(bVar1 + 5)) {
      FUN_14034f0d0(local_e8,&DAT_14045d400);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_e8,(ThrowInfo *)&DAT_1405d36c0);
    }
    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_1403aa0d0(pbVar4 + 5,((int)local_240 - (uint)bVar1) + -5);
    if (iVar8 != iVar2) {
      FUN_14034f0d0(local_58,&DAT_14045d3c8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    FUN_140383c40(param_2);
    FUN_140384310(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_140383d70(param_2);
    memcpy(_Dst,pbVar4 + 5,(longlong)(int)((iVar8 - (uint)bVar1) + -5));
    FUN_140399690(&local_230);
    if (local_228 != 0) {
      if ((longlong)local_220 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_220 = local_220 & 0xffffffff00000000;
    }
    uVar5 = FUN_1403555d0(&local_258);
    uVar6 = (undefined7)((ulonglong)uVar5 >> 8);
  }
  return CONCAT71(uVar6,1);
}



// WARNING: Removing unreachable block (ram,0x000140396f45)
// WARNING: Removing unreachable block (ram,0x000140396f53)
// WARNING: Removing unreachable block (ram,0x000140396f4b)
// WARNING: Removing unreachable block (ram,0x000140396f5a)

void FUN_140396e40(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_1400179d0(&local_50,1);
  uVar2 = local_40;
  if ((int)local_38 == 0) {
    uVar2 = uVar6;
  }
  FUN_14000d3f0(uVar2,pbVar1,1);
  lVar4 = (longlong)(int)local_38;
  FUN_1400179d0(&local_50,(int)local_38 + 4);
  uVar2 = local_40;
  if ((int)local_38 == 0) {
    uVar2 = uVar6;
  }
  FUN_14000d3f0(uVar2 + lVar4,param_4 + 0xc,4);
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (param_2 != 0) {
    lVar4 = (longlong)(int)local_38;
    FUN_1400179d0(&local_50,(int)local_38 + param_2);
    uVar2 = local_40;
    if ((int)local_38 == 0) {
      uVar2 = uVar6;
    }
    FUN_14000d3f0(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_14034f7d0();
      }
      FUN_1400179d0(&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_140396480(param_5,uVar2,param_3,(longlong)(int)local_38,0);
  FUN_1403555d0(&local_50);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140396fe0(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_1405d84f0 ^ (ulonglong)auStack_118;
  if (*(int *)(param_3 + 0x3c0) < 1) {
    FUN_14034f0d0(local_90,&DAT_14045d430);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_90,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  uVar4 = 0;
  uVar3 = uVar4;
  if (iVar1 != 0) {
    uVar3 = *(undefined8 *)(param_1 + 0x10);
  }
  local_3c = FUN_1403aa0d0(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_1400179d0(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_140396e40(uVar4,*(int *)(param_1 + 0x18),uVar3,&local_48);
    return 1;
  }
  FUN_14034f420(local_d8,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_d8,(ThrowInfo *)&DAT_1405d36c0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140397130(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_1405d84f0 ^ (ulonglong)auStack_238;
  if (*(int *)(param_3 + 0x3c0) < 1) {
    FUN_14034f0d0(local_120,&DAT_14045d430);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_120,(ThrowInfo *)&DAT_1405d36c0);
  }
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
      }
      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_140399790();
    }
    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_140399790();
      }
      if (*(int *)(lVar2 + 0x18) == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = *(longlong *)(lVar2 + 0x10);
      }
    }
    else {
      lVar2 = *(longlong *)(param_1 + 0x10);
      if (lVar2 == 0) {
        FUN_14034f420(local_90,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_90,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    local_3c = FUN_1403aa0d0(param_4 + lVar2,iVar5);
    if (*(int *)(param_3 + 0x3c0) < 1) {
      FUN_14034f420(local_d8,L"aes key is not initialized");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_d8,(ThrowInfo *)&DAT_1405d36c0);
    }
    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_140383c40(param_2);
    FUN_140384310(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_140399790();
      }
      if (*(int *)(lVar6 + 0x18) == 0) {
        lVar6 = 0;
      }
      else {
        lVar6 = *(longlong *)(lVar6 + 0x10);
      }
    }
    local_218 = param_3;
    uVar3 = FUN_140396e40(param_4 + lVar2,iVar5,lVar6,&local_48);
    uVar4 = (undefined7)((ulonglong)uVar3 >> 8);
  }
  return CONCAT71(uVar4,1);
}



undefined8 FUN_140397360(void)

{
  return 1000;
}



undefined8 FUN_140397370(void)

{
  return 0x3f2;
}



void FUN_140397380(undefined8 *param_1)

{
  *param_1 = Proud::IHeartbeatWork::vftable;
  return;
}



undefined8 * FUN_140397390(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::IHeartbeatWork::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined1 FUN_1403973c0(void)

{
  return 0;
}



undefined8 FUN_1403973d0(void)

{
  return 2000;
}



undefined8 FUN_1403973e0(void)

{
  return 0x7d3;
}



void thunk_FUN_140388ea0(void)

{
  FUN_140388ea0();
  return;
}



void FUN_140397400(longlong param_1,int *param_2)

{
  longlong lVar1;
  uint local_res8 [2];
  
  FUN_14034ed40();
  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_1405f2550,param_1 + 0x60,local_res8);
  }
  else {
    *(undefined4 *)(param_1 + 0x88) = 0;
  }
  FUN_14034edd0(param_1 + 0x98);
  return;
}



void FUN_1403974c0(longlong param_1)

{
  FUN_14034ed40(param_1 + 0x98);
  *(undefined4 *)(param_1 + 0x88) = 0;
  FUN_14034edd0(param_1 + 0x98);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_140397500(longlong param_1)

{
  double dVar1;
  
  FUN_14034ed40(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_1405f0698;
  FUN_14034edd0(param_1 + 0x88);
  return 1;
}



undefined * FUN_140397580(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_14034ede0(&DAT_1405f2788);
  if (cVar2 != '\0') {
    if (DAT_1405d9480 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_14034ed40(&DAT_1405f2788);
    }
  }
  if ((DAT_1405f2780 & 1) == 0) {
    DAT_1405f2780 = DAT_1405f2780 | 1;
    FUN_1403aa6e0(&DAT_1405f26c0);
    atexit((_func_5014 *)&LAB_1404494c0);
  }
  DAT_1405d9480 = 0;
  if (bVar1) {
    FUN_14034edd0(&DAT_1405f2788);
  }
  return &DAT_1405f26c0;
}



void FUN_140397640(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_140397580();
  FUN_1403aa500(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_14034edf0(param_1 + 0x13);
  FUN_140385b20(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_140388ea0(param_1 + 2);
  *param_1 = Proud::INetClientEvent::vftable;
  FUN_14035b3e0(param_1);
  return;
}



void FUN_140397730(longlong param_1)

{
  FUN_140397750(param_1 + -0x10);
  return;
}



void FUN_140397740(longlong param_1)

{
  FUN_140397750(param_1 + -0x30);
  return;
}



void * FUN_140397750(void *param_1,uint param_2)

{
  FUN_140397640();
  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_140397780(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_1405d84f0 ^ (ulonglong)auStack_b8;
  dVar7 = (double)(**(code **)(**(longlong **)(param_1 + 0x40) + 8))();
  if (*(double *)(param_1 + 0x90) <= dVar7 && dVar7 != *(double *)(param_1 + 0x90)) {
    FUN_14035b3f0(&local_68);
    if (local_68 == (undefined *)0x0) {
      local_68 = PTR_DAT_1405d8010;
    }
    if (*(undefined **)(param_1 + 0x50) != local_68) {
      uVar3 = FUN_14034fe70();
      local_88 = uVar3;
      FUN_14034ed40(uVar3);
      puVar2 = local_68;
      local_80 = 1;
      if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) &&
         (puVar6 = local_68 + -8, puVar6 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_98 = uVar4;
        FUN_14034ed40(uVar4);
        local_90 = 1;
        piVar1 = (int *)(puVar2 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar6);
        }
        FUN_14034edd0(uVar4);
      }
      local_68 = *(undefined **)(param_1 + 0x50);
      if (((local_68 != PTR_DAT_1405d8010) && (local_68 != (undefined *)0x0)) &&
         (local_68 != (undefined *)0x8)) {
        *(int *)(local_68 + -4) = *(int *)(local_68 + -4) + 1;
      }
      FUN_14034edd0(uVar3);
    }
    local_60 = *(undefined2 *)(param_1 + 0x58);
    local_5c = DAT_1405d93f0;
    local_58 = DAT_1405d93f4;
    local_54 = DAT_1405d93f8;
    local_50 = DAT_1405d93fc;
    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_1405f0698;
    *(undefined4 *)(param_1 + 0x88) = 1;
    FUN_1403555d0(local_48);
    puVar2 = local_68;
    if (((local_68 != (undefined *)0x0) && (local_68 != PTR_DAT_1405d8010)) &&
       (puVar6 = local_68 + -8, puVar6 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      local_98 = uVar3;
      FUN_14034ed40(uVar3);
      local_90 = 1;
      piVar1 = (int *)(puVar2 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar6);
      }
      FUN_14034edd0(uVar3);
    }
  }
  return;
}



void FUN_140397970(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_14034ed40(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_1405f2490,*(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_1405f2490,*(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_1405f2490,local_res10);
    (**(code **)(*plVar1 + 0x70))(plVar1,1,&DAT_1405f2490);
    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_1405f2490,lVar3 + 0x56c);
    }
  }
  FUN_14034edd0(lVar2);
  return;
}



undefined1
FUN_140397af0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3e9);
  FUN_1403859e0(local_30,param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_RequestLogin_1405d9340,0x3e9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140397be0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3e9);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_u_RequestLogin_1405d9340,0x3e9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140397cd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3eb);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_NotifyCommon_ReceiveRmi_1405d9350,
                     0x3eb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140397dd0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3eb);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifyCommon_ReceiveRmi_1405d9350,0x3eb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140397ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3ec);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     PTR_u_NotifyCli_ConnectionState_1405d9358,0x3ec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140397fc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3ec);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifyCli_ConnectionState_1405d9358,0x3ec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403980a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3ed);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_NotifyCli_Peers_Clear_1405d9360,
                     0x3ed);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_140398160(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3ed);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_u_NotifyCli_Peers_Clear_1405d9360,
                     0x3ed);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140398230(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3ee);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     PTR_u_NotifyCli_Peers_AddOrEdit_1405d9368,0x3ee);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140398310(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3ee);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifyCli_Peers_AddOrEdit_1405d9368,0x3ee);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403983f0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3ef);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_NotifySrv_ClientEmpty_1405d9370,
                     0x3ef);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403984b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3ef);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_u_NotifySrv_ClientEmpty_1405d9370,
                     0x3ef);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140398580(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3f0);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,
                     PTR_u_NotifySrv_Clients_AddOrEdit_1405d9378,0x3f0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140398660(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3f0);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifySrv_Clients_AddOrEdit_1405d9378,0x3f0);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140398740(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3f1);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_u_NotifySrv_Clients_Remove_1405d9380
                     ,0x3f1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_140398820(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0x3f1);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,
                     PTR_u_NotifySrv_Clients_Remove_1405d9380,0x3f1);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined8 FUN_140398900(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_140385b50(param_1,0);
  }
  iVar11 = *param_2;
  cVar3 = FUN_140384a90(param_2,local_res20);
  if (cVar3 == '\0') {
LAB_140399102:
    FUN_140383db0(param_2,(int)((iVar11 >> 0x1f & 7U) + iVar11) >> 3);
    uVar7 = 0;
  }
  else {
    local_60 = param_3;
    if (local_res20[0] == 0x7d1) {
      FUN_14035b390(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_1405d93e0);
      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_1405d93e0,&DAT_140477960
                    );
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        puVar10 = PTR_DAT_1405d8010;
        local_res10 = PTR_DAT_1405d8010;
        plVar8 = (longlong *)FUN_1400174a0(&local_res10,&local_b0,0xfffffffe);
        if (puVar10 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        local_res10 = puVar10;
        if ((undefined *)*plVar8 != puVar10) {
          uVar7 = FUN_14034fe70();
          local_110 = uVar7;
          FUN_14034ed40(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
             (puVar10 + -8 != (undefined *)0x0)) {
            ppuVar9 = (undefined **)FUN_14034fe70();
            local_c0 = ppuVar9;
            FUN_14034ed40(ppuVar9);
            local_b8 = 1;
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar10 + -8);
            }
            FUN_14034edd0(ppuVar9);
          }
          puVar10 = (undefined *)*plVar8;
          if (((puVar10 != PTR_DAT_1405d8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_res10 = puVar10;
          FUN_14034edd0(uVar7);
        }
        if (((local_b0 != (undefined *)0x0) && (local_b0 != PTR_DAT_1405d8010)) &&
           (local_b0 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_14034fe70();
          local_110 = uVar7;
          FUN_14034ed40(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          piVar1 = (int *)(local_b0 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_b0 + -8);
          }
          FUN_14034edd0(uVar7);
        }
        local_c0 = &local_e8;
        local_b0 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_e8 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_e8 = (undefined *)0x0;
        }
        if (puVar10 != PTR_DAT_1405d8010) {
          uVar7 = FUN_14034fe70();
          local_110 = uVar7;
          FUN_14034ed40(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          FUN_1400031d0(&local_e8);
          if (((puVar10 != PTR_DAT_1405d8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_e8 = puVar10;
          FUN_14034edd0(uVar7);
        }
        puVar12 = PTR_u_NotifyLoginOk_1405d93e0;
        FUN_14034fe70();
        local_d8 = PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar12);
        uVar7 = FUN_140002f00(&local_d8,uVar4);
        FUN_14034fd20(uVar7,puVar12,uVar4);
        FUN_140002fe0(&local_d8);
        (**(code **)(*param_1 + 0x28))(param_1,0x7d1,&local_d8,&local_e8);
        puVar12 = puVar10;
        if (puVar10 == (undefined *)0x0) {
          puVar12 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x7d1,PTR_u_NotifyLoginOk_1405d93e0,puVar12);
        param_3 = local_res18;
        if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
           (puVar10 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_14034fe70();
          local_110 = uVar7;
          FUN_14034ed40(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar10 + -8);
          }
          FUN_14034edd0(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_1405d93e0;
        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_1405d93e0);
      }
      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_1405d93e0;
LAB_1403990d3:
        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_140399102;
      FUN_14035b390(local_98);
      local_94 = param_2[10];
      local_98[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_1403840e0(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_1405d93e8);
      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_1405d93e8,
                     &DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_118 = PTR_DAT_1405d8010;
        uVar7 = FUN_14035bc60((ulonglong)local_res10 & 0xffffffff);
        FUN_140017790(&local_118,uVar7);
        FUN_140017790(&local_118,&DAT_14047edb0);
        puVar10 = local_118;
        iVar11 = 0;
        if ((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1405d8010)) {
          iVar11 = *(int *)(local_118 + -8);
        }
        plVar8 = (longlong *)FUN_1400174a0(&local_118,&local_c8,iVar11 + -2);
        if (puVar10 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        local_118 = puVar10;
        if ((undefined *)*plVar8 != puVar10) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_c0 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_b8 = 1;
          if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
             (puVar10 + -8 != (undefined *)0x0)) {
            uVar7 = FUN_14034fe70();
            local_110 = uVar7;
            FUN_14034ed40(uVar7);
            local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar10 + -8);
            }
            FUN_14034edd0(uVar7);
          }
          puVar10 = (undefined *)*plVar8;
          if (((puVar10 != PTR_DAT_1405d8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_118 = puVar10;
          FUN_14034edd0(ppuVar9);
        }
        if (((local_c8 != (undefined *)0x0) && (local_c8 != PTR_DAT_1405d8010)) &&
           (local_c8 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_14034fe70();
          local_110 = uVar7;
          FUN_14034ed40(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          piVar1 = (int *)(local_c8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_c8 + -8);
          }
          FUN_14034edd0(uVar7);
        }
        local_c0 = &local_e0;
        local_c8 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_e0 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_e0 = (undefined *)0x0;
        }
        if (puVar10 != PTR_DAT_1405d8010) {
          uVar7 = FUN_14034fe70();
          local_110 = uVar7;
          FUN_14034ed40(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          FUN_1400031d0(&local_e0);
          if (((puVar10 != PTR_DAT_1405d8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_e0 = puVar10;
          FUN_14034edd0(uVar7);
        }
        puVar12 = PTR_u_NotifyLoginFailed_1405d93e8;
        FUN_14034fe70();
        local_d0 = PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar12);
        uVar7 = FUN_140002f00(&local_d0,uVar4);
        FUN_14034fd20(uVar7,puVar12,uVar4);
        FUN_140002fe0(&local_d0);
        (**(code **)(*param_1 + 0x28))(param_1,0x7d2,&local_d0,&local_e0);
        puVar12 = puVar10;
        if (puVar10 == (undefined *)0x0) {
          puVar12 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0x7d2,PTR_u_NotifyLoginFailed_1405d93e8,puVar12);
        param_3 = local_res18;
        if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
           (puVar10 + -8 != (undefined *)0x0)) {
          uVar7 = FUN_14034fe70();
          local_110 = uVar7;
          FUN_14034ed40(uVar7);
          local_108 = (undefined *)CONCAT71(local_108._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar10 + -8);
          }
          FUN_14034edd0(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_1405d93e8;
        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_1405d93e8);
      }
      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_1405d93e8;
        goto LAB_1403990d3;
      }
    }
    uVar7 = 1;
  }
  return uVar7;
}



undefined8 *
FUN_140399130(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_140388e70(param_1 + 2);
  param_1[2] = VizS2C::Stub::vftable;
  FUN_1403aa120(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_14034fe70();
  param_1[10] = PTR_DAT_1405d8010;
  FUN_14034fe70();
  param_1[0xc] = PTR_DAT_1405d8010;
  puVar1 = param_1 + 0xd;
  FUN_140385af0(puVar1);
  *puVar1 = VizC2S::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x7c) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  uVar2 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x13,uVar2,1);
  param_1[8] = param_2;
  FUN_14000d470(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_1403c33e0(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_140397580();
  FUN_1403aa420(uVar5,param_1 + 6,10);
  return param_1;
}



void FUN_1403992e0(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_14034ed40(param_1 + 0x68);
  if (*(int *)(param_1 + 0x58) == 0) {
    FUN_140397780(param_1 + -0x30);
  }
  FUN_14034edd0(param_1 + 0x68);
  return;
}



undefined1 FUN_140399350(longlong param_1)

{
  FUN_14034ed40(param_1 + 0x88);
  FUN_140397970(param_1 + -0x10);
  FUN_14034edd0(param_1 + 0x88);
  return 1;
}



undefined1
FUN_1403993a0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x3ea);
  FUN_140058470(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_14034f800();
      }
      FUN_140058470(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_1403aa930(local_40,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,PTR_u_NotifyCommon_SendRmi_1405d9348,
                     0x3ea);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403994d0(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0x3ea);
  FUN_140058470(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_14034f800();
      }
      FUN_140058470(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_1403aa930(local_40,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,PTR_u_NotifyCommon_SendRmi_1405d9348,
                     0x3ea);
  FUN_140399690(local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



void FUN_140399610(longlong param_1)

{
  FUN_14034ed40(&DAT_1405f2850);
  if ((*(short *)(param_1 + -8) == 0x1de6) && (*(longlong *)(param_1 + 0x30) == 0)) {
    *(short **)(param_1 + 0x30) = DAT_1405f2888;
    DAT_1405f2888 = (short *)(param_1 + -8);
    FUN_14034edd0(&DAT_1405f2850);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_140399690(longlong *param_1)

{
  longlong *plVar1;
  
  if (*param_1 != 0) {
    plVar1 = (longlong *)(*param_1 + 0x28);
    *plVar1 = *plVar1 + -1;
    if (*(longlong *)(*param_1 + 0x28) == 0) {
      FUN_140399610();
    }
    *param_1 = 0;
  }
  return;
}



undefined2 *
FUN_1403996d0(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_1405f2850;
  FUN_14034ed40();
  puVar3 = DAT_1405f2888;
  uVar6 = 1;
  if (DAT_1405f2888 == (undefined2 *)0x0) {
    puVar2 = (undefined2 *)FUN_14034fef0();
    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_1405f2888 + 0x1c);
    DAT_1405f2888 = *(undefined2 **)(DAT_1405f2888 + 0x1c);
    *puVar1 = 0;
  }
  FUN_1400179d0(puVar3 + 4,0,param_3,param_4,uVar4,puVar5,uVar6);
  FUN_14034edd0(&DAT_1405f2850);
  return puVar3 + 4;
}



void FUN_140399790(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_14034fc50(local_res8);
  FUN_140017790(local_res8,L".dmp",param_3,param_4,uVar1);
  if (local_res8[0] == (undefined *)0x0) {
    local_res8[0] = PTR_DAT_1405d8010;
  }
  FUN_1403c6170(local_res8[0],0);
  FUN_14034f420(local_50,PTR_u_error__ArrayPtr_is_null__1405d94b0);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_140399800(undefined8 *param_1)

{
  *param_1 = Proud::ISendIssueObject::vftable;
  return;
}



undefined8 * FUN_140399810(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_140399840(longlong param_1)

{
  return *(int *)(param_1 + 0x710) != *(int *)(param_1 + 0x720);
}



undefined1 FUN_140399850(longlong param_1)

{
  return *(undefined1 *)(param_1 + 0x228);
}



void FUN_140399860(longlong param_1,undefined1 param_2)

{
  *(undefined1 *)(param_1 + 0x228) = param_2;
  return;
}



void FUN_140399870(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x000140399881. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x198) + 0x118) + 8))();
  return;
}



void FUN_140399890(longlong param_1,undefined4 param_2,undefined4 param_3,undefined8 param_4,
                  undefined8 param_5,undefined4 param_6)

{
  FUN_140381580(*(undefined8 *)(param_1 + 0x198),param_1 + -0xa0,param_2,param_3,param_4,param_5,
                param_6);
  return;
}



void FUN_1403998d0(longlong param_1)

{
  FUN_1403a0220(*(undefined8 *)(param_1 + 0x640));
  return;
}



void FUN_1403998e0(longlong param_1)

{
  FUN_1403a0560(param_1 + -0x48);
  return;
}



void FUN_1403998f0(undefined8 *param_1)

{
  if ((void *)*param_1 != (void *)0x0) {
    operator_delete((void *)*param_1);
  }
  return;
}



bool FUN_140399910(longlong param_1)

{
  return *(longlong *)(param_1 + 0x278) == 0;
}



void FUN_140399920(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_14037ea90(*(undefined8 *)(param_1 + 0x238),param_1,"Speedhack",1);
      }
      *(double *)(*(longlong *)(param_1 + 0x750) + 8) = dVar4;
    }
  }
  return;
}



bool FUN_140399a80(longlong param_1)

{
  return *(longlong *)(param_1 + 0x188) != 0;
}



bool FUN_140399a90(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x198) + 0x748);
  if (plVar1 != (longlong *)0x0) {
    return *plVar1 == 0;
  }
  return true;
}



void FUN_140399ac0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14035cf30(*(longlong *)(param_1 + 0x10),param_1 + -0x110);
  }
  return;
}



void FUN_140399af0(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_14034ed40(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_14035cf30(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_14034edd0(lVar4);
  return;
}



void FUN_140399bb0(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_1403555d0(&local_30);
                    // WARNING: Could not recover jumptable at 0x000140399c25. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*plVar1 + 0x40))(plVar1,param_2);
  return;
}



void FUN_140399c30(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1403555d0((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_140399c60(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_14034fe70();
      local_res8 = PTR_DAT_1405d8010;
      FUN_140017720(&local_res8,&DAT_14045e510,param_2);
      puVar2 = local_res8;
      puVar5 = local_res8;
      if (local_res8 == (undefined *)0x0) {
        puVar5 = PTR_DAT_1405d8010;
      }
      FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_1 + 0x198) + 0x17f0),0,puVar5);
      if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) &&
         (puVar2 + -8 != (undefined *)0x0)) {
        uVar3 = FUN_14034fe70();
        FUN_14034ed40(uVar3);
        piVar1 = (int *)(puVar2 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar2 + -8);
        }
        FUN_14034edd0(uVar3);
      }
    }
  }
  return;
}



undefined4 FUN_140399d70(longlong param_1,undefined8 param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 local_res8 [2];
  
  FUN_14038d950(param_2,0);
  iVar1 = FUN_1403a3ba0(*(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_140399de0(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_14038d950(param_6,0);
  uVar5 = (ulonglong)*(int *)(param_6 + 0x18);
  FUN_1403a2ba0(&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_1403a35c0(&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_14034f800();
      }
      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_140399ee0(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_14039a031;
      }
    }
    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_14039a02d;
      }
    }
    puVar10 = (uint *)FUN_140363ca0(param_2 + 0x38,puVar13,uVar6);
LAB_14039a02d:
    *(undefined1 *)(puVar10 + 1) = 0;
LAB_14039a031:
  }
  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_14034f800();
      }
      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_14039a12e;
        }
      }
      uVar7 = (ulonglong)uVar16 % uVar15;
      if (lVar4 == 0) {
LAB_14039a0ef:
        cVar8 = FUN_14035f5e0(lVar3,uVar15,CONCAT71((int7)(uVar6 >> 8),1),uVar15,uVar17);
        if (cVar8 == '\0') {
                    // WARNING: Subroutine does not return
          FUN_14000d450(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_14039a125;
        }
        if (lVar4 == 0) goto LAB_14039a0ef;
      }
      FUN_14035eb50(lVar3);
      puVar11 = (uint *)FUN_140360ee0(lVar3,puVar10,uVar7,uVar16);
      FUN_14035eb50(lVar3);
LAB_14039a125:
      *(undefined1 *)(puVar11 + 1) = 0;
LAB_14039a12e:
      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_1405d8010;
  }
  *(undefined **)(param_2 + 0x98) = puVar12;
  if (*(undefined **)(param_1 + 0x1f0) != puVar12) {
    uVar17 = FUN_14034fe70();
    FUN_14034ed40(uVar17);
    FUN_1400031d0(param_2 + 0x98);
    puVar12 = *(undefined **)(param_1 + 0x1f0);
    *(undefined **)(param_2 + 0x98) = puVar12;
    if (((puVar12 != PTR_DAT_1405d8010) && (puVar12 != (undefined *)0x0)) &&
       (puVar12 != (undefined *)0x8)) {
      *(int *)(puVar12 + -4) = *(int *)(puVar12 + -4) + 1;
    }
    FUN_14034edd0(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_14039a260(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_14000d450(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_14036f390(param_1,param_2,param_3);
  FUN_14035ec80(param_1);
  return;
}



undefined8 FUN_14039a360(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_14039a260(param_1,lVar1,param_3);
        return 1;
      }
    }
  }
  return 0;
}



void FUN_14039a3f0(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_14035d100();
  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_14035caa0(pvVar3);
        operator_delete(pvVar3);
      }
      FUN_14034ff60(puVar2);
    }
    plVar4 = *(longlong **)(param_1 + 0x50);
    if (plVar4 == (longlong *)0x0) {
      FUN_14034ff60(plVar5);
    }
    else {
      (**(code **)(*plVar4 + 0x18))(plVar4,plVar5);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    plVar5 = plVar1;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar6 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_14039a580(void)

{
  FUN_14039a3f0();
  return;
}



void thunk_FUN_14039a580(void)

{
  FUN_14039a580();
  return;
}



void FUN_14039a5b0(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_14034ed40(uVar3);
  uVar9 = 1;
  if (DAT_1405f064f != '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x238) + 200))
              (*(longlong **)(param_1 + 0x238),L"Proud::CRemoteClient_S::GetP2PGroupTotalRecentPing"
              );
  }
  FUN_140377130(*(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_14000d450(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_140364170(lVar1);
          FUN_14034ff60(lVar1);
        }
        FUN_14034ff60(local_res8);
      }
      FUN_14034edd0(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_140364170(lVar1);
      FUN_14034ff60(lVar1);
    }
    FUN_14034ff60(local_res8);
  }
  FUN_14034edd0(uVar3);
  return;
}



longlong * FUN_14039a7f0(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_14034fef0(0xd0);
  uVar2 = uVar3;
  if (lVar1 != 0) {
    uVar2 = FUN_1403c61e0(lVar1);
  }
  FUN_1403612a0(param_2,uVar2,param_3,param_4,uVar4);
  if (*param_2 != 0) {
    uVar3 = *(undefined8 *)(*param_2 + 0x38);
  }
  FUN_140399ee0(param_1,uVar3);
  return param_2;
}



undefined8 FUN_14039a870(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_140379c50(param_1 + 0x260,local_120,param_3,param_4,0xfffffffffffffffe);
    FUN_1403a61c0(param_2,uVar1,*(undefined4 *)(param_1 + 0x6f0));
    FUN_140376ec0(local_f0);
    FUN_140399690(local_110);
    if ((local_108 != 0) && (local_fc < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    uVar1 = 1;
  }
  return uVar1;
}



undefined8 * FUN_14039a910(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_1403a6cf0(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_14037a120(param_1 + 8);
  param_1[0x14] = Proud::ITcpLayerOwner_S::vftable;
  param_1[0x15] = 0;
  FUN_1403a0510(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_1403c0cc0();
  FUN_14034ec60(param_1 + 0x25,uVar1,1);
  puVar4 = (undefined1 *)0x0;
  param_1[0x3c] = 0;
  FUN_14034fe70();
  param_1[0x3e] = PTR_DAT_1405d8010;
  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_14036d530(param_1 + 0xd4);
  FUN_1403a1f70(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_1403a00d0(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_1405d8148;
  *(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_1403eb740(param_1 + 0x4d);
  FUN_1403a00c0(param_1[0xe9],*(undefined1 *)(param_2 + 0x240));
  return param_1;
}



longlong FUN_14039aca0(longlong param_1)

{
  return param_1 + 0x20;
}



undefined4 FUN_14039acb0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x6f8);
}



void FUN_14039acc0(longlong param_1)

{
  FUN_14039acb0(param_1 + -8);
  return;
}



void FUN_14039acd0(longlong param_1)

{
  FUN_14039b1a0(param_1 + -0x38);
  return;
}



void FUN_14039ace0(longlong param_1)

{
  FUN_14039b1a0(param_1 + -0x40);
  return;
}



void FUN_14039acf0(longlong param_1)

{
  FUN_14039b1a0(param_1 + -0xc0);
  return;
}



void FUN_14039ad00(longlong param_1)

{
  FUN_1403aae10(param_1 + -0x38);
  return;
}



void FUN_14039ad10(longlong param_1)

{
  FUN_14039b1a0(param_1 + -8);
  return;
}



void FUN_14039ad20(longlong param_1)

{
  FUN_14039b1a0(param_1 + -0x108);
  return;
}



void FUN_14039ad30(longlong param_1)

{
  FUN_14039acb0(param_1 + -0x40);
  return;
}



void FUN_14039ad40(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_14039a3f0(param_1 + 0xd4);
  if (param_1[0x24] != 0) {
    FUN_14035cf30(param_1[0x24],param_1);
  }
  if (param_1[4] != 0) {
    FUN_140389050();
  }
  plVar1 = (longlong *)param_1[0xec];
  if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
    if (plVar1 == (longlong *)0x0) {
      lVar4 = 0;
    }
    else {
      lVar4 = *plVar1;
    }
    FUN_14039a360(param_1[0x47] + 0x6f0,lVar4 + 0x158,0);
    if (0 < *(int *)(param_1 + 0xed)) {
      FUN_14012c460(param_1[0x47] + 0x1848,*(undefined4 *)(param_1[0x47] + 0x1860),param_1 + 0xed,1,
                    uVar5);
    }
    local_res10 = 0;
    FUN_1403aca30(param_1 + 0xec,&local_res10);
  }
  pvVar2 = (void *)param_1[0xe9];
  if (pvVar2 != (void *)0x0) {
    FUN_1403a01a0(pvVar2);
    operator_delete(pvVar2);
  }
  FUN_140379ee0(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_14034ff60(plVar1);
  }
  if ((void *)param_1[0xea] != (void *)0x0) {
    operator_delete((void *)param_1[0xea]);
  }
  FUN_1403a2020(param_1 + 0xe0);
  FUN_14039a580(param_1 + 0xd4);
  FUN_1403555d0(param_1 + 0xcb);
  FUN_140379ee0(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_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[0x4a]);
    }
  }
  pvVar2 = (void *)param_1[0x45];
  if (pvVar2 != (void *)0x0) {
    FUN_1403555d0((longlong)pvVar2 + 8);
    operator_delete(pvVar2);
  }
  FUN_1403555d0(param_1 + 0x3f);
  FUN_1400031d0(param_1 + 0x3e);
  FUN_14034edf0(param_1 + 0x25);
  param_1[0x21] = Proud::ISendIssueObject::vftable;
  FUN_1403a0530(param_1 + 0x18);
  param_1[8] = Proud::CP2PGroupMemberBase_S::vftable;
  FUN_140379a70(param_1 + 9);
  if (param_1[0x24] != 0) {
    FUN_14035cf30(param_1[0x24],param_1);
  }
  param_1[7] = Proud::ICompletionContext::vftable;
  FUN_1403a6c70(param_1 + 1);
  *param_1 = Proud::ISendDest_S::vftable;
  return;
}



void FUN_14039b030(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_1403841b0(local_128);
    FUN_140378820(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_14034fef0(0x128);
    }
    else {
      puVar2 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x128);
    }
    if (puVar2 != (undefined8 *)0x0) {
      *(undefined4 *)(puVar2 + 2) = 0;
      FUN_1403841e0(puVar2 + 3,local_128);
      FUN_140378820(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_140376ec0(local_100);
    FUN_140399690(local_120);
    if ((local_118 != 0) && (local_10c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_1403a6a50(*(longlong *)(*(longlong *)(param_1 + 0x238) + 0x3e0) + 0x160,param_1 + 8);
  }
  return;
}



undefined8 FUN_14039b1a0(undefined8 param_1,uint param_2)

{
  FUN_14039ad40();
  if ((param_2 & 1) != 0) {
    FUN_14034ff60(param_1);
  }
  return param_1;
}



undefined2 FUN_14039b1d0(undefined1 param_1,undefined1 param_2)

{
  return CONCAT11(param_1,param_2);
}



void FUN_14039b1e0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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_14039b2c0(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                 );
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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_14039b3a0(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_1403c62d0(param_1 + 0x1d8,param_2,*(undefined8 *)(param_1 + 0x208));
  return cVar1 == '\0';
}



void FUN_14039b440(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14039b1e0(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_14039b460(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14039b2c0(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_14039b480(undefined8 *param_1,undefined8 *param_2)

{
  if (param_2[2] != 0) {
    FUN_14039b1e0();
  }
  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_14039b4d0(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 0x00014039b4f7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



void FUN_14039b510(undefined8 *param_1,undefined8 *param_2)

{
  if (param_2[2] != 0) {
    FUN_14039b2c0();
  }
  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_14039b560(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 0x00014039b587. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



longlong FUN_14039b5a0(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_14039b600(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_14039b660(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_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_14039b6c0(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_14034f7d0();
  }
  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_14034f7d0();
  }
  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_14039b830(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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      *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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                L"Proud::CListNode<class Proud::UdpPacketCtx>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14039b920(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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                     );
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
                     );
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      *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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                L"Proud::CListNode<class Proud::CUdpPacketFragBoard::CPacketQueue>::CListOwner::Erase"
               );
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_14039ba10(longlong param_1)

{
  FUN_14035f5e0(param_1 + 0x20,3,1);
  return;
}



void FUN_14039ba30(undefined8 *param_1,undefined8 *param_2,undefined8 param_3)

{
  char cVar1;
  
  if (param_2[2] == 0) {
    cVar1 = FUN_14039b3a0(param_2,param_3);
    if (cVar1 != '\0') {
      if (param_2[2] != 0) {
        FUN_14039b2c0(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_14039baa0(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_14034f800();
    }
    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_14039bb20(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 FUN_14039bb80(undefined8 *param_1)

{
  if (100 < (ulonglong)param_1[2]) {
    operator_delete__((void *)*param_1);
  }
  return;
}



void thunk_FUN_14039b830(void)

{
  FUN_14039b830();
  return;
}



void thunk_FUN_14039b920(void)

{
  FUN_14039b920();
  return;
}



void FUN_14039bbc0(longlong param_1,longlong param_2,char param_3)

{
  undefined4 uVar1;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (*(longlong **)(param_1 + 0x50) == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f7a0(param_1,uVar1);
  }
  return;
}



int FUN_14039bc30(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_14039bcd0(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_14039bd30(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_14039baa0(*(undefined8 *)(lVar3 + 0x10));
        return uVar2;
      }
    }
  }
  return 0;
}



void FUN_14039bdb0(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_14034f800();
      }
      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_14034f7d0();
      }
      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_1403a7100(param_1 + 0x198,0);
  return;
}



void FUN_14039be40(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_14039b830(param_1 + 3);
          FUN_14039b830(param_1);
          return;
        }
        if (*(longlong *)(lVar2 + 0x10) != 0) {
          FUN_14039b1e0(*(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_14034f7d0();
    }
    if (*(longlong *)(lVar2 + 0x10) != 0) {
      FUN_14039b1e0(*(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_14034f7d0();
}



void FUN_14039bf30(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_14034f7d0();
        }
        lVar4 = lVar4 + 1;
        *(undefined8 *)(lVar3 + 0x50) = *(undefined8 *)(lVar2 + 0x80);
        *(short **)(lVar2 + 0x80) = (short *)(lVar3 + -8);
      } while (lVar4 < iVar1);
    }
  }
  FUN_1403a7100(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_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x6ac) = DAT_1405d83d4;
  param_1[0xce] = 0;
  *(undefined4 *)(param_1 + 0xd6) = 0xffffffff;
  return;
}



undefined2 * FUN_14039c030(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_14034fef0();
  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_14039c0c0(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_14034fef0(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_14039c160(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_14035d100();
  lVar4 = *(longlong *)(param_1 + 0x10);
  while (lVar4 != 0) {
    plVar1 = *(longlong **)(param_1 + 0x50);
    lVar5 = *(longlong *)(lVar4 + 0x10);
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_14039c290(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_14000d450(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_14039bbc0(param_1,param_2,param_3);
  FUN_14035ec80(param_1);
  return;
}



undefined8 * FUN_14039c390(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_14034fef0(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_14035ec80(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_14035ec80(param_1);
    FUN_14035ec80(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_14035ec80(param_1);
  FUN_14035ec80(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar5 = FUN_1403d7ac0(param_1);
    FUN_14035f7a0(param_1,uVar5);
  }
  FUN_14035ec80(param_1);
  return puVar6;
}



void FUN_14039c4e0(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_14034f7d0();
  }
  FUN_14039b6c0(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_14034f7d0();
}



undefined8 FUN_14039c560(void)

{
  undefined8 uVar1;
  
  FUN_14034ed40(&DAT_1405f28a8);
  uVar1 = FUN_14039c0c0(DAT_1405f28a0);
  FUN_14034edd0(&DAT_1405f28a8);
  return uVar1;
}



void FUN_14039c5c0(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_14039b3a0(plVar1,param_2), cVar2 != '\0')) break;
LAB_14039c655:
      lVar3 = *(longlong *)(lVar3 + 0x18);
    }
    if (plVar1[2] != 0) {
      FUN_14039b2c0(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_14039c655;
    }
    *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,0x00014039cbd9)
// WARNING: Removing unreachable block (ram,0x00014039cbe0)
// WARNING: Removing unreachable block (ram,0x00014039cbef)

void FUN_14039c670(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_14034f800();
    }
    lVar2 = *plVar9;
    if (lVar2 != 0) {
      FUN_14039bf30(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_14034f7d0();
      }
      FUN_14039b6c0(param_3,lVar3 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar3) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_14034f7d0();
      }
      FUN_14039b6c0(param_3,lVar3 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar3) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_1403a7100(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_14039b1e0(*(longlong *)(lVar2 + 0x10),lVar2);
        return;
      }
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    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_14034f800();
      }
      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_14034f7d0();
          }
          iVar13 = *(int *)(param_1 + 0x1b0);
          FUN_1403a7100(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_1405d8118 <= *(int *)(lVar2 + 0x30) + *(int *)(param_1 + 0x1c0)) ||
             (iVar14 != *(int *)(lVar2 + 0x48))) goto LAB_14039c8bd;
          iVar13 = *(int *)(param_1 + 0x1b0);
          if (iVar13 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          iVar11 = *(int *)(param_1 + 0x1b0);
          FUN_1403a7100(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_14039b1e0(*(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_14039c8bd:
  }
  if (*(int *)(param_1 + 0x1c0) < 1) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_14039bf30(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_1405d8118 < iVar13) {
    iVar13 = DAT_1405d8118;
  }
  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_14039b6c0(param_3,lVar2 + 1,0xffffffffffffffff);
    if (param_3[1] <= lVar2) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    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_14034f7d0();
          }
          if (iVar14 != 0) {
            lVar2 = param_3[0xd2];
            FUN_1403a7100(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_1403a7100(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_14034f7d0();
            }
            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_1403c6310(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_14034f800();
      }
      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_14034f7d0();
      }
      FUN_14039b6c0(param_3,lVar3 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar3) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_14039bdb0(param_1);
    FUN_14034f420(local_98,L"Unexpected at PacketQueue Pop!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_14039cea0(void *param_1)

{
  _eh_vector_destructor_iterator_(param_1,0x38,6,FUN_14039be40);
  return;
}



void FUN_14039cec0(longlong param_1)

{
  FUN_14039bdb0();
  *(undefined ***)(param_1 + 0x198) = Proud::CFastArray<>::vftable;
  if (*(longlong *)(param_1 + 0x1a8) != 0) {
    if (*(longlong **)(param_1 + 0x1a0) == (longlong *)0x0) {
      FUN_14034ff60(*(longlong *)(param_1 + 0x1a8));
    }
    else {
      (**(code **)(**(longlong **)(param_1 + 0x1a0) + 0x18))();
    }
  }
  _eh_vector_destructor_iterator_((void *)(param_1 + 0x18),0x38,6,FUN_14039be40);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14039b2c0(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_14039cf50(undefined8 *param_1)

{
  FUN_14039bf30();
  param_1[0xcf] = Proud::CFastArray<>::vftable;
  if (param_1[0xd1] != 0) {
    if ((longlong *)param_1[0xd0] == (longlong *)0x0) {
      FUN_14034ff60(param_1[0xd1]);
    }
    else {
      (**(code **)(*(longlong *)param_1[0xd0] + 0x18))();
    }
  }
  if (100 < (ulonglong)param_1[2]) {
    operator_delete__((void *)*param_1);
  }
  return;
}



void FUN_14039cfc0(void)

{
  FUN_140360d00();
  return;
}



void FUN_14039cfe0(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_1403555d0(lVar1 + 0x20);
    if (*(longlong *)(lVar1 + 0x18) != 0) {
      FUN_14039b1e0(*(longlong *)(lVar1 + 0x18),lVar1 + 8,param_3,param_4,uVar2);
    }
    FUN_14034ff60(lVar1);
    lVar1 = *param_1;
  }
  return;
}



void FUN_14039d070(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_14034ff60(*(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_14034ff60();
      }
      else {
        (**(code **)(*plVar2 + 0x18))(plVar2,*(longlong *)(lVar1 + 0x18),plVar2,param_4,uVar3);
      }
    }
    FUN_14034ff60(lVar1);
    lVar1 = *param_1;
  }
  return;
}



void FUN_14039d140(void)

{
  FUN_14039c160();
  return;
}



undefined8 FUN_14039d160(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035ec80(param_1);
  uVar2 = FUN_14039c390(param_1,param_2,param_3,param_4);
  FUN_14035ec80(param_1);
  return uVar2;
}



// WARNING: Removing unreachable block (ram,0x00014039d23b)
// WARNING: Removing unreachable block (ram,0x00014039d244)
// WARNING: Removing unreachable block (ram,0x00014039d262)
// WARNING: Removing unreachable block (ram,0x00014039d26b)

undefined1 * FUN_14039d1e0(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,0x00014039d310)
// WARNING: Removing unreachable block (ram,0x00014039d319)
// WARNING: Removing unreachable block (ram,0x00014039d337)
// WARNING: Removing unreachable block (ram,0x00014039d340)
// WARNING: Removing unreachable block (ram,0x00014039d37b)
// WARNING: Removing unreachable block (ram,0x00014039d384)
// WARNING: Removing unreachable block (ram,0x00014039d3a2)
// WARNING: Removing unreachable block (ram,0x00014039d3ab)

undefined1 * FUN_14039d2a0(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_14034f7d0();
  }
  *(longlong *)(param_1 + 0x50) = param_2;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x00014039d447)
// WARNING: Removing unreachable block (ram,0x00014039d450)
// WARNING: Removing unreachable block (ram,0x00014039d46e)
// WARNING: Removing unreachable block (ram,0x00014039d477)
// WARNING: Removing unreachable block (ram,0x00014039d4b2)
// WARNING: Removing unreachable block (ram,0x00014039d4bb)
// WARNING: Removing unreachable block (ram,0x00014039d4d9)
// WARNING: Removing unreachable block (ram,0x00014039d4e2)

undefined1 * FUN_14039d3e0(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_14039d510(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_14034f420(local_68,L"Unexpected state in RemoteToPacketSendMap!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d36c0);
    }
    uVar3 = (**(code **)(*(longlong *)param_1[3] + 8))();
    FUN_14039c670(lVar1,uVar3,param_2);
    if (*(longlong *)(param_2 + 8) == 0) {
      FUN_14034f420(local_68,L"Unexpected state in RemoteToPacketSendMap #2!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d36c0);
    }
    cVar2 = FUN_14039b3a0(lVar1,param_3);
    if ((cVar2 == '\0') && (*(longlong *)(lVar1 + 0x10) != 0)) {
      FUN_14039b2c0(*(longlong *)(lVar1 + 0x10),lVar1);
    }
    else {
      if (*(longlong *)(lVar1 + 0x10) != 0) {
        FUN_14039b2c0(*(longlong *)(lVar1 + 0x10),lVar1);
      }
      FUN_14039b510(param_1,lVar1);
    }
    *(undefined8 *)(lVar1 + 0x168) = param_3;
    uVar3 = 1;
  }
  return uVar3;
}



undefined8 * FUN_14039d650(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_14039bd90,FUN_14039be40);
  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_1403c6340(param_1 + 0x3b);
  param_1[0x3e] = 0;
  param_1[0x3f] = 0;
  param_1[0x3d] = 0;
  param_1[0x40] = 0;
  FUN_1403c6420(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_14034f800();
    }
    *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_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x17c) = DAT_1405d83d4;
  *(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_14039d7b0(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_1403adbc0(param_1,param_2,uVar2,(ulonglong)uVar1,0xfffffffffffffffe);
  *(undefined8 *)(puVar3 + 2) = *param_3;
  return puVar3;
}



longlong FUN_14039d850(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_14039d160(param_1,param_2,uVar1,uVar3,0xfffffffffffffffe);
  *(undefined8 *)(lVar2 + 0x10) = *param_3;
  return lVar2;
}



// WARNING: Removing unreachable block (ram,0x00014039db28)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14039d900(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_14000d450(0x80004005);
      }
      lVar3 = *(longlong *)(lVar6 + 0x10);
      FUN_1403c6320(lVar3 + 0x1d8,param_2);
      FUN_1403c6490(lVar3 + 0x1e8,param_2);
      FUN_1403c6440(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_1403c63a0(lVar3 + 0x208,*(undefined8 *)(lVar3 + 0x1e8),*(undefined8 *)(lVar3 + 0x210));
      if (_DAT_1405d8120 < param_2 - *(double *)(lVar3 + 0x168)) break;
      if (lVar6 != 0) {
        lVar6 = *(longlong *)(lVar6 + 0x18);
      }
    }
    if (*(longlong *)(lVar3 + 0x10) != 0) {
      FUN_14039b2c0(*(longlong *)(lVar3 + 0x10),lVar3);
    }
    plVar4 = *(longlong **)(param_1 + 0x78);
    FUN_14039bdb0(lVar3);
    *(undefined ***)(lVar3 + 0x198) = Proud::CFastArray<>::vftable;
    if (*(longlong *)(lVar3 + 0x1a8) != 0) {
      if (*(longlong **)(lVar3 + 0x1a0) == (longlong *)0x0) {
        FUN_14034ff60(*(longlong *)(lVar3 + 0x1a8));
      }
      else {
        (**(code **)(**(longlong **)(lVar3 + 0x1a0) + 0x18))();
      }
    }
    _eh_vector_destructor_iterator_((void *)(lVar3 + 0x18),0x38,6,FUN_14039be40);
    if (*(longlong *)(lVar3 + 0x10) != 0) {
      FUN_14039b2c0(*(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_14000d450(0x80004005);
    }
    local_58 = *(longlong *)(lVar6 + 0x18);
    FUN_14039c290(lVar1,lVar6,0);
    lVar6 = local_58;
    lVar7 = lStack_50;
    lStack_70 = lStack_50;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



ulonglong FUN_14039db80(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_14039b2c0();
        }
        uVar2 = *(undefined8 *)(lVar6 + 0x10);
        plVar3 = *(longlong **)(param_1 + 0x78);
        FUN_14039cec0(uVar2);
        (**(code **)(*plVar3 + 0x18))(plVar3,uVar2);
        uVar4 = FUN_14039c290(param_1 + 0x20,lVar6,0);
        return uVar4;
      }
      lVar6 = *(longlong *)(lVar6 + 0x18);
      if (lVar6 == 0) {
        return uVar5;
      }
    }
  }
  return uVar5;
}



// WARNING: Removing unreachable block (ram,0x00014039ddb7)

void FUN_14039dc60(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_14039b2c0(*(longlong *)(lVar1 + 0x10),lVar1);
    }
    plVar2 = *(longlong **)(param_1 + 0x78);
    FUN_14039bdb0(lVar1);
    *(undefined ***)(lVar1 + 0x198) = Proud::CFastArray<>::vftable;
    if (*(longlong *)(lVar1 + 0x1a8) != 0) {
      if (*(longlong **)(lVar1 + 0x1a0) == (longlong *)0x0) {
        FUN_14034ff60(*(longlong *)(lVar1 + 0x1a8));
      }
      else {
        (**(code **)(**(longlong **)(lVar1 + 0x1a0) + 0x18))();
      }
    }
    _eh_vector_destructor_iterator_((void *)(lVar1 + 0x18),0x38,6,FUN_14039be40);
    if (*(longlong *)(lVar1 + 0x10) != 0) {
      FUN_14039b2c0(*(longlong *)(lVar1 + 0x10),lVar1);
    }
    (**(code **)(*plVar2 + 0x18))(plVar2,lVar1);
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    lVar1 = *(longlong *)(lVar3 + 0x18);
    FUN_14039c290(param_1 + 0x20,lVar3,0);
    lVar3 = lVar1;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_14039ddf0(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_14039cec0(uVar2);
      (**(code **)(*plVar1 + 0x18))(plVar1,uVar2);
    }
  }
  FUN_140360d00(param_1);
  return;
}



undefined8 FUN_14039de70(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_14038d8a0(param_1,param_2);
  *puVar3 = *param_3;
  return 1;
}



longlong FUN_14039df20(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_14039d650(lVar1);
  }
  return lVar1;
}



void FUN_14039df60(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_14038a540(*(undefined8 *)(lVar1 + 8));
  }
  FUN_14039d140(param_2);
                    // WARNING: Could not recover jumptable at 0x00014039dfc6. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*param_1 + 0x18))(param_1,param_2);
  return;
}



void FUN_14039dfd0(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_1405f28a8;
        FUN_14034ed40(&DAT_1405f28a8);
        *(undefined4 *)(lVar2 + 0x50) = 0;
        *(undefined8 *)(lVar2 + 0x58) = 0;
        if (*(int *)(lVar2 + 0x18) != 0) {
          if (*(int *)(lVar2 + 0x1c) < 0) {
            iVar6 = FUN_1403891d0(lVar2,0);
            plVar3 = *(longlong **)(lVar2 + 8);
            if (*(int *)(lVar2 + 0x1c) == 0) {
              if (plVar3 == (longlong *)0x0) {
                lVar7 = FUN_14034fef0((longlong)iVar6);
              }
              else {
                lVar7 = (**(code **)(*plVar3 + 8))();
              }
            }
            else {
              uVar4 = *(undefined8 *)(lVar2 + 0x10);
              if (plVar3 == (longlong *)0x0) {
                lVar7 = FUN_14034ff20(uVar4);
              }
              else {
                lVar7 = (**(code **)(*plVar3 + 0x10))
                                  (plVar3,uVar4,(longlong)iVar6,uVar4,uVar10,puVar11);
              }
              if (lVar7 == 0) {
                FUN_14034f420(local_70,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_70,(ThrowInfo *)&DAT_1405d36c0);
              }
            }
            *(longlong *)(lVar2 + 0x10) = lVar7;
            *(int *)(lVar2 + 0x1c) = iVar6;
          }
          *(undefined4 *)(lVar2 + 0x18) = 0;
        }
        if (*(int *)(lVar2 + 0x40) != 0) {
          if (*(int *)(lVar2 + 0x44) < 0) {
            iVar6 = FUN_140017930(lVar2 + 0x28);
            plVar3 = *(longlong **)(lVar2 + 0x30);
            if (*(int *)(lVar2 + 0x44) == 0) {
              if (plVar3 == (longlong *)0x0) {
                lVar7 = FUN_14034fef0((longlong)iVar6);
              }
              else {
                lVar7 = (**(code **)(*plVar3 + 8))();
              }
            }
            else {
              if (plVar3 == (longlong *)0x0) {
                lVar7 = FUN_14034ff20(*(undefined8 *)(lVar2 + 0x38));
              }
              else {
                lVar7 = (**(code **)(*plVar3 + 0x10))
                                  (plVar3,*(undefined8 *)(lVar2 + 0x38),(longlong)iVar6);
              }
              if (lVar7 == 0) {
                FUN_14034f420(local_70,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_70,(ThrowInfo *)&DAT_1405d36c0);
              }
            }
            *(longlong *)(lVar2 + 0x38) = lVar7;
            *(int *)(lVar2 + 0x44) = iVar6;
          }
          *(undefined4 *)(lVar2 + 0x40) = 0;
        }
        puVar5 = DAT_1405f28a0;
        if ((*(short *)(lVar2 + -8) != 0x1de6) || (*(longlong *)(lVar2 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        *(undefined8 *)(lVar2 + 0x60) = *DAT_1405f28a0;
        *puVar5 = (short *)(lVar2 + -8);
        FUN_14034edd0(&DAT_1405f28a8);
      }
      FUN_14039d140(lVar1);
      (**(code **)(*param_2 + 0x18))(param_2,lVar1);
    }
    lVar9 = *(longlong *)(lVar9 + 0x18);
  } while( true );
}



longlong FUN_14039e230(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_14039d1e0();
  }
  *(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_14034f420(local_50,PTR_u_Collection_object_can_use_fast_h_1405d81d0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  *(longlong **)(lVar1 + 0x50) = param_1;
  return lVar1;
}



void FUN_14039e350(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_140352ee0(param_4);
  if ((cVar2 != '\0') && (iVar3 = FUN_1403a62c0(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_14039e468;
        }
      }
    }
    lVar5 = FUN_14039df20(*(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_14039de70(param_1 + 0x20,param_4,&local_78);
LAB_14039e468:
    if ((*(int *)(lVar5 + 0x178) != *(int *)(param_4 + 8)) ||
       (*(short *)(lVar5 + 0x17c) != *(short *)(param_4 + 0xc))) {
      FUN_14034f420(local_70,L"PacketQueue consistency failed!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_70,(ThrowInfo *)&DAT_1405d36c0);
    }
    uVar4 = *param_7;
    if (((int)uVar4 < 0) || (5 < (int)uVar4)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (DAT_1405d8144 == '\0') {
      uVar4 = 0;
    }
    *param_7 = uVar4;
    if (5 < uVar4) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    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_14039e54b;
      }
    }
    lVar6 = FUN_14039c030(param_1 + 0x80);
    if (*(char *)((longlong)param_7 + 0x19) == '\0') {
      plVar7 = plVar7 + 3;
    }
    FUN_14039b480(plVar7,lVar6);
    *(undefined8 *)(lVar6 + 0x40) = *(undefined8 *)(param_7 + 2);
    uVar4 = param_7[5];
    *(int *)(lVar6 + 0x4c) = param_2;
    *(uint *)(lVar6 + 0x48) = uVar4;
LAB_14039e54b:
    thunk_FUN_1403a6430(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_14034f420(local_70,L"PacketQueue consistency 2 failed!");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_70,(ThrowInfo *)&DAT_1405d36c0);
    }
    *(undefined8 *)(lVar5 + 0x168) = param_6;
    FUN_14039ba30(param_1,lVar5,param_6);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_14039e640(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_1405d84f0 ^ (ulonglong)auStack_108;
  local_90 = param_7;
  local_a8 = param_3;
  local_a0 = param_4;
  FUN_1403841b0(local_d0);
  FUN_140383e30(local_d0,param_2,param_3);
  FUN_140384310(local_d0,param_3);
  FUN_140383db0(local_d0,0);
  cVar3 = FUN_1403840e0(local_d0,local_78,0x10);
  if (cVar3 == '\0') {
    FUN_14000d470(param_8,L"UDP frag header missing!");
    local_d8 = &local_c8;
    FUN_140399690(&local_c8);
    if (local_c0 == (uint *)0x0) {
      return 2;
    }
    if (-1 < local_b4) {
      return 2;
    }
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (local_78[0] == -0x5433) {
    if ((((local_74 < 1) || (iVar4 = (**(code **)(*(longlong *)*param_1 + 8))(), iVar4 < local_74))
        || (local_6c < 0)) || (local_74 / DAT_1405d8118 < local_6c)) {
      uVar5 = (**(code **)(*(longlong *)*param_1 + 8))();
      local_e8 = local_6c;
      FUN_140017720(param_8,L"UDP frag length is wrong #1! packetlength=%d, maxlength=%d, fragID=%d"
                    ,local_74,uVar5);
      local_d8 = &local_c8;
      FUN_140399690(&local_c8);
      if (local_c0 == (uint *)0x0) {
        return 2;
      }
      if (-1 < local_b4) {
        return 2;
      }
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (local_78[0] != -0x5432) goto LAB_14039e81f;
  }
  else if (local_78[0] != -0x5432) {
    FUN_140017720(param_8,L"Cannot identify UDP fragment nor full packet! fragheaderSplitter=%u",
                  local_78[0]);
    local_d8 = &local_c8;
    FUN_140399690(&local_c8);
    if (local_c0 == (uint *)0x0) {
      return 2;
    }
    if (-1 < local_b4) {
      return 2;
    }
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if ((local_74 < 1) || (iVar4 = (**(code **)(*(longlong *)*param_1 + 8))(), iVar4 < local_74)) {
    FUN_14000d470(param_8,L"UDP full packet length is wrong!");
    local_d8 = &local_c8;
    FUN_140399690(&local_c8);
    if (local_c0 == (uint *)0x0) {
      return 2;
    }
    if (-1 < local_b4) {
      return 2;
    }
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
LAB_14039e81f:
  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_1405d8118 * local_6c;
    iVar2 = local_74 - local_98;
    if (DAT_1405d8118 < local_74 - local_98) {
      iVar2 = DAT_1405d8118;
    }
    if (local_c8 == 0) {
      if (local_c0 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
    }
    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_140017720(param_8,
                    L"UDP frag length is wrong #2! desiredFragLength=%d, fragPayloadLength=%d",iVar2
                    ,iVar14);
      local_d8 = &local_c8;
      FUN_140399690(&local_c8);
      if (local_c0 == (uint *)0x0) {
        return 2;
      }
      if (-1 < local_b4) {
        return 2;
      }
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d8 = param_1 + 1;
    lVar6 = FUN_14039b5a0(local_d8);
    if (lVar6 == 0) {
      uVar7 = (**(code **)(*(longlong *)*param_1 + 0x18))();
      lVar6 = FUN_14039e230(uVar7);
      *(longlong *)(lVar6 + 0x70) = param_6;
      local_88[0] = lVar6;
      FUN_14039d850(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_14039c560();
        local_d8 = plVar8;
        FUN_1400179d0(plVar8 + 5,local_74);
        FUN_140389ae0(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_14039d7b0(lVar6,&local_70,&local_d8);
        iVar4 = local_6c;
      }
      else {
        plVar8 = *(longlong **)(puVar9 + 2);
        if ((int)plVar8[8] != local_74) {
          FUN_140017720(param_8,
                        L"UDP frag length is wrong #3! assembledDataCount=%d, packetLength=%d",
                        (int)plVar8[8],local_74);
          FUN_140360170(lVar6,puVar9,0);
          FUN_14038a540(plVar8);
          local_d8 = &local_c8;
          FUN_140399690(&local_c8);
          if (local_c0 == (uint *)0x0) {
            return 2;
          }
          if (-1 < local_b4) {
            return 2;
          }
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
      }
      iVar2 = (int)plVar8[3];
      if (iVar2 <= iVar4) {
        FUN_14000d470(param_8,L"UDP FragID is wrong!");
        local_d8 = &local_c8;
        FUN_140399690(&local_c8);
        if ((local_c0 != (uint *)0x0) && (local_b4 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        return 2;
      }
      if ((int)plVar8[8] < iVar14 + local_98) {
        FUN_14000d470(param_8,L"UDP Frag Payload Length is wrong!");
        local_d8 = &local_c8;
        FUN_140399690(&local_c8);
        if (local_c0 == (uint *)0x0) {
          return 2;
        }
        if (-1 < local_b4) {
          return 2;
        }
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if ((iVar4 < 0) || (iVar2 <= iVar4)) {
                    // WARNING: Subroutine does not return
        FUN_14034f800();
      }
      if (*(char *)(plVar8[2] + (longlong)iVar4) == '\0') {
        if (iVar2 <= iVar4) {
                    // WARNING: Subroutine does not return
          FUN_14034f800();
        }
        *(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_140399790();
          }
          puVar12 = puVar13;
          if (*(int *)(local_c8 + 0x18) != 0) {
            puVar12 = *(uint **)(local_c8 + 0x10);
          }
        }
        if ((int)plVar8[8] != 0) {
          puVar13 = (uint *)plVar8[7];
        }
        FUN_14000d3f0((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_14000d450(0x80004005);
        }
        FUN_140360170(lVar6,puVar9,0);
        local_d8 = &local_c8;
        FUN_140399690(&local_c8);
        if (local_c0 == (uint *)0x0) {
          return 0;
        }
        if (-1 < local_b4) {
          return 0;
        }
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
    else if ((local_78[0] == -0x5432) && (0 < iVar14)) {
      puVar9 = (uint *)0x0;
      if (puVar13 == (uint *)0x0) {
        if (lVar10 == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        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_14039c560();
      FUN_1400179d0(lVar10 + 0x28,iVar14);
      if (*(int *)(lVar10 + 0x40) != 0) {
        puVar9 = *(uint **)(lVar10 + 0x38);
      }
      FUN_14000d3f0(puVar9,(longlong)((int)(local_d0[0] + (local_d0[0] >> 0x1f & 7U)) >> 3) +
                           (longlong)puVar13,(longlong)iVar14);
      *plVar8 = lVar10;
      local_d8 = &local_c8;
      FUN_140399690(&local_c8);
      if ((local_c0 != (uint *)0x0) && (local_b4 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      return 0;
    }
    local_d8 = &local_c8;
    FUN_140399690(&local_c8);
    if ((local_c0 != (uint *)0x0) && (local_b4 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  else {
    local_d8 = &local_c8;
    FUN_140399690(&local_c8);
    if ((local_c0 != (uint *)0x0) && (local_b4 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return 1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_14039ee10(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_14000d450(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_14000d450(0x80004005);
      }
      lVar14 = *(longlong *)(uVar24 + 8);
      if (dVar20 - *(double *)(lVar14 + 0x58) <= _DAT_1405d8128) {
        if (uVar24 != 0) {
          uVar16 = *(ulonglong *)(uVar24 + 0x10);
        }
      }
      else {
        puVar27 = &DAT_1405f28a8;
        uVar25 = uVar24;
        FUN_14034ed40(&DAT_1405f28a8);
        *(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_14039ef83:
              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_14039ef83;
              }
              if (iVar3 != 2) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              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_14034fef0((longlong)iVar15);
              }
              else {
                lVar12 = (**(code **)(*plVar13 + 8))(plVar13,(longlong)iVar15);
              }
            }
            else {
              uVar4 = *(undefined8 *)(lVar14 + 0x10);
              if (plVar13 == (longlong *)0x0) {
                lVar12 = FUN_14034ff20(uVar4,(longlong)iVar15,iVar2,uVar4,uVar22,puVar23,uVar25,
                                       lVar26,puVar27,1);
              }
              else {
                lVar12 = (**(code **)(*plVar13 + 0x10))(plVar13,uVar4);
              }
              if (lVar12 == 0) {
                FUN_14034f420(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_90,(ThrowInfo *)&DAT_1405d36c0);
              }
            }
            *(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_14039f057:
              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_14039f057;
              }
              if (iVar2 != 2) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              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_14034fef0((longlong)(int)uVar10);
              }
              else {
                lVar12 = (**(code **)(*plVar13 + 8))(plVar13,(longlong)(int)uVar10);
              }
            }
            else {
              if (plVar13 == (longlong *)0x0) {
                lVar12 = FUN_14034ff20(*(undefined8 *)(lVar14 + 0x38),(longlong)(int)uVar10);
              }
              else {
                lVar12 = (**(code **)(*plVar13 + 0x10))(plVar13,*(undefined8 *)(lVar14 + 0x38));
              }
              if (lVar12 == 0) {
                FUN_14034f420(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_90,(ThrowInfo *)&DAT_1405d36c0);
              }
            }
            *(longlong *)(lVar14 + 0x38) = lVar12;
            *(uint *)(lVar14 + 0x44) = uVar10;
          }
          *(undefined4 *)(lVar14 + 0x40) = 0;
        }
        puVar7 = DAT_1405f28a0;
        if ((*(short *)(lVar14 + -8) != 0x1de6) || (*(longlong *)(lVar14 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        *(undefined8 *)(lVar14 + 0x60) = *DAT_1405f28a0;
        *puVar7 = (short *)(lVar14 + -8);
        FUN_14034edd0(&DAT_1405f28a8);
        if (lVar17 != *(longlong *)(uVar21 + 0x10)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        if (uVar24 == 0) {
                    // WARNING: Subroutine does not return
          FUN_14000d450(0x80004005);
        }
        uVar16 = *(ulonglong *)(uVar24 + 0x10);
        FUN_140360170();
        lVar17 = lVar26;
      }
    }
    if ((*(longlong *)(*(longlong *)(uVar21 + 0x10) + 0x20) == 0) &&
       (cVar8 = FUN_1403c6370(*(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_14034ed40(&DAT_1405f28a8);
        *(undefined4 *)(lVar26 + 0x50) = 0;
        *(undefined8 *)(lVar26 + 0x58) = 0;
        if (*(int *)(lVar26 + 0x18) != 0) {
          if (*(int *)(lVar26 + 0x1c) < 0) {
            iVar11 = FUN_1403891d0(lVar26,0);
            plVar5 = *(longlong **)(lVar26 + 8);
            if (*(int *)(lVar26 + 0x1c) == 0) {
              if (plVar5 == (longlong *)0x0) {
                lVar14 = FUN_14034fef0((longlong)iVar11);
              }
              else {
                lVar14 = (**(code **)(*plVar5 + 8))();
              }
            }
            else {
              if (plVar5 == (longlong *)0x0) {
                lVar14 = FUN_14034ff20(*(undefined8 *)(lVar26 + 0x10));
              }
              else {
                lVar14 = (**(code **)(*plVar5 + 0x10))();
              }
              if (lVar14 == 0) {
                FUN_14034f420(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_90,(ThrowInfo *)&DAT_1405d36c0);
              }
            }
            *(longlong *)(lVar26 + 0x10) = lVar14;
            *(int *)(lVar26 + 0x1c) = iVar11;
          }
          *(undefined4 *)(lVar26 + 0x18) = 0;
        }
        if (*(int *)(lVar26 + 0x40) != 0) {
          if (*(int *)(lVar26 + 0x44) < 0) {
            iVar11 = FUN_140017930(lVar26 + 0x28);
            plVar5 = *(longlong **)(lVar26 + 0x30);
            if (*(int *)(lVar26 + 0x44) == 0) {
              if (plVar5 == (longlong *)0x0) {
                lVar14 = FUN_14034fef0((longlong)iVar11);
              }
              else {
                lVar14 = (**(code **)(*plVar5 + 8))();
              }
            }
            else {
              if (plVar5 == (longlong *)0x0) {
                lVar14 = FUN_14034ff20(*(undefined8 *)(lVar26 + 0x38));
              }
              else {
                lVar14 = (**(code **)(*plVar5 + 0x10))();
              }
              if (lVar14 == 0) {
                FUN_14034f420(local_90,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
                _CxxThrowException(local_90,(ThrowInfo *)&DAT_1405d36c0);
              }
            }
            *(longlong *)(lVar26 + 0x38) = lVar14;
            *(int *)(lVar26 + 0x44) = iVar11;
          }
          *(undefined4 *)(lVar26 + 0x40) = 0;
        }
        puVar7 = DAT_1405f28a0;
        if ((*(short *)(lVar26 + -8) != 0x1de6) || (*(longlong *)(lVar26 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        *(undefined8 *)(lVar26 + 0x60) = *DAT_1405f28a0;
        *puVar7 = (short *)(lVar26 + -8);
        FUN_14034edd0(&DAT_1405f28a8);
      }
      FUN_14039d140(lVar17);
      (**(code **)(*plVar13 + 0x18))(plVar13,lVar17);
      if (puVar23 != puVar1) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (uVar21 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      uVar16 = *(ulonglong *)(uVar21 + 0x18);
      FUN_14039c290(puVar1,uVar21,0);
    }
    else if (uVar21 != 0) {
      uVar16 = *(ulonglong *)(uVar21 + 0x18);
    }
  } while( true );
}



void FUN_14039f4a0(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_1403c6490(*(longlong *)(lVar1 + 0x10) + 0x58,param_2);
  }
  FUN_14039ee10(param_1);
  return;
}



ulonglong FUN_14039f500(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_14039df60(uVar2,*(undefined8 *)(lVar5 + 0x10));
        uVar3 = FUN_14039c290(param_1 + 1,lVar5,0);
        return uVar3;
      }
      lVar5 = *(longlong *)(lVar5 + 0x18);
      if (lVar5 == 0) {
        return uVar4;
      }
    }
  }
  return uVar4;
}



void FUN_14039f5b0(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_14000d450(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_14000d450(0x80004005);
      }
      lVar5 = *(longlong *)(lVar19 + 8);
      puVar25 = &DAT_1405f28a8;
      lVar14 = lVar19;
      lVar24 = lVar4;
      FUN_14034ed40(&DAT_1405f28a8);
      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_14039f6fe:
            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_14039f6fe;
            }
            if (iVar3 != 2) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            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_14034fef0((longlong)iVar17);
            }
            else {
              lVar13 = (**(code **)(*plVar15 + 8))(plVar15,(longlong)iVar17);
            }
          }
          else {
            uVar6 = *(undefined8 *)(lVar5 + 0x10);
            if (plVar15 == (longlong *)0x0) {
              lVar13 = FUN_14034ff20(uVar6,(longlong)iVar17,iVar2,uVar6,lVar16,puVar23,lVar14,lVar24
                                     ,puVar25,1);
            }
            else {
              lVar13 = (**(code **)(*plVar15 + 0x10))(plVar15,uVar6);
            }
            if (lVar13 == 0) {
              FUN_14034f420(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
            }
          }
          *(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_14039f7d2:
            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_14039f7d2;
            }
            if (iVar3 != 2) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            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_14034fef0((longlong)(int)uVar12);
            }
            else {
              lVar14 = (**(code **)(*plVar15 + 8))(plVar15,(longlong)(int)uVar12);
            }
          }
          else {
            uVar6 = *(undefined8 *)(lVar5 + 0x38);
            if (plVar15 == (longlong *)0x0) {
              lVar14 = FUN_14034ff20(uVar6,(longlong)(int)uVar12,iVar2,uVar6,lVar16,puVar23,lVar14,
                                     lVar24,puVar25,uVar26);
            }
            else {
              lVar14 = (**(code **)(*plVar15 + 0x10))(plVar15,uVar6);
            }
            if (lVar14 == 0) {
              FUN_14034f420(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
            }
          }
          *(longlong *)(lVar5 + 0x38) = lVar14;
          *(uint *)(lVar5 + 0x44) = uVar12;
        }
        *(undefined4 *)(lVar5 + 0x40) = 0;
      }
      puVar9 = DAT_1405f28a0;
      if ((*(short *)(lVar5 + -8) != 0x1de6) || (*(longlong *)(lVar5 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(undefined8 *)(lVar5 + 0x60) = *DAT_1405f28a0;
      *puVar9 = (short *)(lVar5 + -8);
      FUN_14034edd0(&DAT_1405f28a8);
      if (lVar4 != *(longlong *)(lVar18 + 0x10)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (lVar19 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar5 = *(longlong *)(lVar19 + 0x10);
      FUN_140360170(*(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_14034ed40(&DAT_1405f28a8);
      *(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_14039f982:
            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_14039f982;
            }
            if (iVar2 != 2) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            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_14034fef0((longlong)(int)uVar12);
            }
            else {
              lVar16 = (**(code **)(*plVar7 + 8))(plVar7,(longlong)(int)uVar12);
            }
          }
          else {
            if (plVar7 == (longlong *)0x0) {
              lVar16 = FUN_14034ff20(*(undefined8 *)(lVar4 + 0x10),(longlong)(int)uVar12);
            }
            else {
              lVar16 = (**(code **)(*plVar7 + 0x10))(plVar7,*(undefined8 *)(lVar4 + 0x10));
            }
            if (lVar16 == 0) {
              FUN_14034f420(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
            }
          }
          *(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_14039fa56:
            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_14039fa56;
            }
            if (iVar2 != 2) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            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_14034fef0((longlong)(int)uVar12);
            }
            else {
              lVar16 = (**(code **)(*plVar7 + 8))(plVar7,(longlong)(int)uVar12);
            }
          }
          else {
            if (plVar7 == (longlong *)0x0) {
              lVar16 = FUN_14034ff20(*(undefined8 *)(lVar4 + 0x38),(longlong)(int)uVar12);
            }
            else {
              lVar16 = (**(code **)(*plVar7 + 0x10))(plVar7,*(undefined8 *)(lVar4 + 0x38));
            }
            if (lVar16 == 0) {
              FUN_14034f420(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
              _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
            }
          }
          *(longlong *)(lVar4 + 0x38) = lVar16;
          *(uint *)(lVar4 + 0x44) = uVar12;
        }
        *(undefined4 *)(lVar4 + 0x40) = 0;
      }
      puVar9 = DAT_1405f28a0;
      if ((*(short *)(lVar4 + -8) != 0x1de6) || (*(longlong *)(lVar4 + 0x60) != 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(undefined8 *)(lVar4 + 0x60) = *DAT_1405f28a0;
      *puVar9 = (short *)(lVar4 + -8);
      FUN_14034edd0(&DAT_1405f28a8);
    }
    FUN_14039d140(lVar19);
    (**(code **)(*plVar15 + 0x18))(plVar15,lVar19);
    if (puVar23 != puVar1) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (lVar18 == 0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    lVar19 = *(longlong *)(lVar18 + 0x18);
    FUN_14039c290(puVar1,lVar18,0);
    lVar18 = lVar19;
  } while( true );
}



void FUN_14039fc70(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  FUN_14039dfd0(param_1,*(undefined8 *)(param_1 + 0x50),param_3,param_4,0xfffffffffffffffe);
  FUN_14039cfc0(param_1);
  return;
}



void FUN_14039fca0(undefined8 param_1)

{
  FUN_14039ddf0();
  FUN_14039cfc0(param_1);
  return;
}



undefined8 *
FUN_14039fcd0(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_14039d2a0(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_14039fdd0(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = param_1 + 0x20;
  FUN_14039ddf0(lVar1);
  FUN_14039cfe0(param_1 + 0x80);
  FUN_14039ddf0(lVar1);
  FUN_14039cfc0(lVar1);
  FUN_14039b920(param_1);
  return;
}



undefined8 *
FUN_14039fe30(undefined8 *param_1,longlong *param_2,undefined4 param_3,undefined8 param_4)

{
  longlong lVar1;
  float fVar2;
  undefined1 local_50 [72];
  
  FUN_14039d3e0(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_14034f7d0();
  }
  if (param_1[5] != 0) {
    FUN_14034f420(local_50,PTR_u_Collection_object_can_use_fast_h_1405d81d0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  param_1[0xb] = lVar1;
  return param_1;
}



ulonglong FUN_14039ff50(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_1403c6350(param_1 + 0x90,param_2,*(undefined8 *)(param_1 + 0xa0));
  if (iVar2 < (int)uVar1) {
    uVar3 = FUN_1403c6350(param_1 + 0x90,param_2,*(undefined8 *)(param_1 + 0xa0));
  }
  else {
    uVar3 = (ulonglong)uVar1;
  }
  return uVar3;
}



void FUN_14039ffd0(longlong param_1,undefined8 param_2)

{
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x10))();
  FUN_1403a2bc0(param_1 + 0x48,param_2);
  return;
}



int FUN_1403a0010(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_140356130(*(undefined8 *)(param_1 + 0x110),DAT_1405d8048);
      if (iVar2 != 0) {
        *(undefined1 *)(param_1 + 0x40) = 0;
        FUN_1403552c0(*(undefined8 *)(param_1 + 0x110));
        return iVar2;
      }
      *(undefined8 *)(param_1 + 0x118) = 0;
    }
  }
  return 0;
}



void FUN_1403a00c0(longlong param_1)

{
  FUN_140354ad0(*(undefined8 *)(param_1 + 0x110));
  return;
}



undefined1 * FUN_1403a00d0(undefined1 *param_1,undefined8 param_2,longlong param_3,longlong param_4)

{
  FUN_1403a32b0(param_1 + 0x48);
  FUN_1403a9d50(param_1 + 200,(longlong)DAT_1405d80ec);
  *(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_1403a2c30(param_3);
  }
  *(undefined8 *)(param_1 + 0x118) = 0;
  *(undefined8 *)(param_1 + 0x120) = 0;
  return param_1;
}



void FUN_1403a01a0(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_1403556b0(lVar1);
    FUN_14034ff60(lVar1);
  }
  FUN_1403a9d90(param_1 + 200);
  FUN_1403a3340(param_1 + 0x48);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1403a0220(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_1405d84f0 ^ (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_14039ff50(param_1,uVar4);
    if (0 < iVar2) {
      *param_1 = '\x01';
      local_678 = (void *)0x0;
      local_660 = 0;
      local_670 = 0;
      local_668 = 100;
      FUN_1403a2f40(param_1 + 0x48,&local_678,iVar2);
      iVar3 = FUN_140356640(*(undefined8 *)(param_1 + 0x110),&local_678);
      FUN_1403c6310(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_1403a03a0(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_1405d84f0 ^ (ulonglong)auStack_de8;
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x10))();
  local_2c = 200;
  local_30 = 0;
  local_38 = local_cb8;
  FUN_1403841b0(local_d68);
  FUN_140383e30(local_d68,local_d40,0x80);
  FUN_1403a3190(param_2,local_cb8,local_d68);
  FUN_1403a2e90(param_1 + 0x48,local_cb8,param_3);
  if (*param_1 == '\0') {
    (**(code **)(**(longlong **)(param_1 + 0x108) + 0x20))();
  }
  local_dc0 = local_d60;
  FUN_140399690(local_d60);
  if (local_d58 != 0) {
    if (local_d4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d50 = 0;
  }
  if (local_38 == (undefined1 *)0x0) {
    FUN_14034f420(local_db8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_db8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



undefined8 * FUN_1403a0510(undefined8 *param_1)

{
  *param_1 = Proud::CUseCount::vftable;
  *(undefined4 *)(param_1 + 8) = 0;
  return param_1;
}



void FUN_1403a0530(undefined8 *param_1)

{
  *param_1 = Proud::CUseCount::vftable;
  return;
}



undefined4 FUN_1403a0540(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x40);
}



void FUN_1403a0550(longlong param_1)

{
  LOCK();
  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
  UNLOCK();
  return;
}



void FUN_1403a0560(longlong param_1)

{
  LOCK();
  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + -1;
  UNLOCK();
  return;
}



longlong * FUN_1403a0570(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_1403a0580(longlong *param_1)

{
  LOCK();
  *(int *)(*param_1 + 0x40) = *(int *)(*param_1 + 0x40) + -1;
  UNLOCK();
  return;
}



undefined8 * FUN_1403a0590(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_1403a05c0(undefined8 *param_1)

{
  *param_1 = Proud::IUdpPacketFragBoardDg::vftable;
  return;
}



undefined8 * FUN_1403a05d0(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_1403a0600(undefined8 *param_1)

{
  *param_1 = Proud::IUdpPacketDefragBoardDg::vftable;
  return;
}



undefined8 * FUN_1403a0610(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_1403a0640(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001403a0651. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x140) + 0x118) + 8))();
  return;
}



undefined4 FUN_1403a0660(longlong param_1)

{
  return *(undefined4 *)(*(longlong *)(param_1 + 0x140) + 0x23c);
}



void FUN_1403a0670(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_140372210(*(undefined8 *)(param_1 + 0x138),&local_18);
  return;
}



void FUN_1403a06b0(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001403a06ba. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_1 + 0x138) + 0xd0))();
  return;
}



void FUN_1403a06d0(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_140360a00(*(undefined8 *)(param_1 + 0x148),&local_18);
  return;
}



void FUN_1403a0710(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001403a071a. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(**(longlong **)(param_1 + 0x138) + 0x30))();
  return;
}



void FUN_1403a0720(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_140385b50(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_14039d510(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_140356f00(lVar6,lVar5,&local_18,*(undefined4 *)(lVar5 + 0x6b0));
        if (iVar4 != 0) {
          *(undefined1 *)(param_1 + 0x100) = 0;
        }
      }
    }
  }
  return;
}



undefined8 FUN_1403a0830(longlong param_1)

{
  FUN_1403a0720(param_1 + -0x88);
  return 0;
}



void FUN_1403a0850(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  
  FUN_140385b50();
  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_1403562a0(lVar3,DAT_1405d804c);
      if (iVar1 != 0) {
        *(undefined1 *)(param_1 + 0x140) = 0;
      }
    }
  }
  return;
}



void FUN_1403a08c0(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_14039d900(uVar3,uVar2);
  lVar1 = *(longlong *)(param_1 + 0x178);
  if (lVar1 != 0) {
    uVar3 = (**(code **)(*(longlong *)(param_1 + 8) + 8))(param_1 + 8);
    FUN_14039f4a0(lVar1,uVar3);
  }
  return;
}



void FUN_1403a0930(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_14035d230(*(longlong *)(param_1 + 0x10),param_1 + -0x90);
  }
  return;
}



void FUN_1403a0960(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_14039fdd0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1403a0990(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_14039cf50(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



void FUN_1403a09c0(longlong *param_1,longlong param_2)

{
  if (*(longlong *)(param_2 + 0xa0) != 0) {
    FUN_14035d230();
  }
  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_1403a0a20(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_14039fc70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a0a50(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_1405d84f0 ^ (ulonglong)auStack_e78;
  FUN_140385b50(param_1 + 0x40);
  local_4c = 200;
  local_50 = 0;
  local_58 = local_cd8;
  FUN_1403841b0(local_d88);
  FUN_140383e30(local_d88,local_d60,0x80);
  FUN_1403a3190(param_5,local_cd8,local_d88);
  local_e28 = param_1 + 0xa8;
  FUN_14034ed40();
  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_14039e350(uVar1,param_2,param_3,&local_e38);
  if (*(char *)(param_1 + 0x100) == '\0') {
    lVar2 = *(longlong *)(param_1 + 0x148) + 2000;
    local_e18 = lVar2;
    FUN_14034ed40(lVar2);
    local_e10 = 1;
    if (*(longlong *)(param_1 + 0xa0) == 0) {
      FUN_1403a09c0(*(longlong *)(param_1 + 0x148) + 0x828,param_1);
    }
    FUN_14034edd0(lVar2);
  }
  FUN_14034edd0(local_e28);
  local_e38 = &local_d80;
  FUN_140399690(&local_d80);
  if (local_d78 != 0) {
    if (local_d6c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d70 = 0;
  }
  if (local_58 == (undefined1 *)0x0) {
    FUN_14034f420(local_dd8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_dd8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_4c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403a0c70(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_1405d84f0 ^ (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_140354860(uVar4,local_d8);
  FUN_140353d20(param_2,uVar4);
  local_100 = 1;
  uVar4 = FUN_140354860(*(undefined8 *)(*(longlong *)(param_3 + 0x748) + 0x110),local_c8);
  plVar5 = (longlong *)FUN_140353c30(uVar4,&local_108);
  puVar6 = (undefined *)*plVar5;
  if ((undefined *)*plVar5 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8008;
  }
  FUN_140353f50(param_2,puVar6);
  puVar6 = local_108;
  if (((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1405d8008)) &&
     (puVar1 = local_108 + -8, puVar1 != (undefined *)0x0)) {
    uVar4 = FUN_14034fe70();
    local_f8 = uVar4;
    FUN_14034ed40(uVar4);
    local_f0 = 1;
    piVar2 = (int *)(puVar6 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar4);
  }
  puVar6 = *(undefined **)(*(longlong *)(param_1 + 0x148) + 0x218);
  if (puVar6 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8008;
  }
  FUN_140353f50(param_2,puVar6);
  puVar6 = *(undefined **)(*(longlong *)(param_1 + 0x148) + 0x210);
  if (puVar6 == (undefined *)0x0) {
    puVar6 = PTR_DAT_1405d8008;
  }
  FUN_140353f50(param_2,puVar6);
  cVar3 = FUN_140354370(param_2);
  if (cVar3 == '\0') {
    plVar5 = (longlong *)FUN_140353f90(&local_108);
    puVar6 = (undefined *)*plVar5;
    if ((undefined *)*plVar5 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1405d8010;
    }
    local_b8 = local_b0;
    FUN_14034ef40(&local_b8,puVar6,3);
    FUN_14034f220(param_2,local_b8);
    if (local_b8 != local_b0) {
      free(local_b8);
    }
    if (((local_108 != (undefined *)0x0) && (local_108 != PTR_DAT_1405d8010)) &&
       (local_108 + -8 != (undefined *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_f8 = uVar4;
      FUN_14034ed40(uVar4);
      local_f0 = 1;
      piVar2 = (int *)(local_108 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(local_108 + -8);
      }
      FUN_14034edd0(uVar4);
    }
  }
  return param_2;
}



void FUN_1403a0e90(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_14039fc70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  param_1[0x2f] = 0;
  pvVar1 = (void *)param_1[0x2e];
  if (pvVar1 != (void *)0x0) {
    FUN_14039cf50(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x2e] = 0;
  pvVar1 = (void *)param_1[0x2d];
  if (pvVar1 != (void *)0x0) {
    FUN_14039fdd0(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x2d] = 0;
  if (param_1[0x14] != 0) {
    FUN_14035d230(param_1[0x14],param_1,param_3,param_4,uVar5);
  }
  pvVar1 = (void *)param_1[0x2f];
  if (pvVar1 != (void *)0x0) {
    FUN_14039fc70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  pvVar1 = (void *)param_1[0x2e];
  if (pvVar1 != (void *)0x0) {
    FUN_14039cf50(pvVar1);
    operator_delete(pvVar1);
  }
  pvVar1 = (void *)param_1[0x2d];
  if (pvVar1 != (void *)0x0) {
    FUN_14039fdd0(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_1403556b0(lVar3);
      FUN_14034ff60(lVar3);
    }
    FUN_14034ff60(plVar2);
  }
  puVar4 = (undefined8 *)param_1[0x1c];
  if (puVar4 != (undefined8 *)0x0) {
    (**(code **)*puVar4)(puVar4,1);
  }
  FUN_14034edf0(param_1 + 0x15);
  param_1[0x11] = Proud::ISendIssueObject::vftable;
  FUN_1403a0530(param_1 + 8);
  param_1[2] = Proud::IUdpPacketDefragBoardDg::vftable;
  param_1[1] = Proud::IUdpPacketFragBoardDg::vftable;
  if (param_1[0x14] != 0) {
    FUN_14035d230(param_1[0x14],param_1);
  }
  *param_1 = Proud::ICompletionContext::vftable;
  return;
}



undefined8 FUN_1403a10b0(void)

{
  return 4;
}



void FUN_1403a10c0(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(*(longlong *)(param_1 + 0x48) + 0x10))(param_1 + 0x48);
  FUN_14034ee70(uVar1);
  return;
}



void FUN_1403a10e0(longlong param_1)

{
  FUN_1403a1650(param_1 + -0x40);
  return;
}



void FUN_1403a10f0(longlong param_1)

{
  FUN_1403a1650(param_1 + -8);
  return;
}



void FUN_1403a1100(longlong param_1)

{
  FUN_1403a1650(param_1 + -0x88);
  return;
}



void FUN_1403a1110(longlong param_1)

{
  FUN_1403a1650(param_1 + -0x10);
  return;
}



void FUN_1403a1120(longlong param_1)

{
  FUN_1403a0640(param_1 + -8);
  return;
}



undefined8 FUN_1403a1130(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0xd0);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1140(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_1405d84f0 ^ (ulonglong)auStack_d88;
  FUN_1403841b0(local_d48);
  FUN_140383c40(local_d48);
  FUN_140384310(local_d48,0x800);
  FUN_140384310(local_d48,0);
  FUN_140058870(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_140399790();
    }
  }
  else {
    local_d30 = *(undefined4 *)(local_d40 + 0x18);
  }
  lVar2 = local_d38;
  if (local_d38 == 0) {
    if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_1405d81cc;
  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_14039b1d0(1);
  local_d60 = local_d20;
  local_d68 = &local_ca8;
  FUN_1403a0a50(param_1 + -8,0,uVar1,&local_d58);
  if (local_28 == (undefined4 *)0x0) {
    FUN_14034f420(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_1c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  local_d58 = (undefined **)&local_d40;
  FUN_140399690(&local_d40);
  if ((local_d38 != 0) && (local_d2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



undefined8 *
FUN_1403a1340(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_1403a0510(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_1403c0cc0();
  FUN_14034ec60(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_140352e50(&local_50);
  local_50 = 0;
  local_44 = 1;
  local_40 = param_1 + 0x15;
  uVar8 = FUN_14034ffc0(0x800,&local_50);
  param_1[0x1c] = uVar8;
  local_res10 = operator_new(0x90);
  puVar5 = puVar7;
  if (local_res10 != (longlong *)0x0) {
    puVar5 = (undefined8 *)FUN_14039fcd0(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_14034fef0(0x400);
  puVar5 = puVar7;
  if (local_res10 != (longlong *)0x0) {
    puVar5 = (undefined8 *)(param_2 + 0x60);
    if (param_2 == 0) {
      puVar5 = puVar7;
    }
    puVar5 = (undefined8 *)FUN_140355800(local_res10,1,puVar5);
  }
  if (puVar5 == (undefined8 *)0x0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_14034fef0(0x10);
    local_res10[1] = 1;
    *local_res10 = (longlong)puVar5;
  }
  plVar1 = local_res10;
  FUN_140351ba0(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_1403556b0(lVar2);
        FUN_14034ff60(lVar2);
      }
      FUN_14034ff60(plVar3);
    }
  }
  param_1[0x29] = param_2;
  *(undefined4 *)(param_1 + 0x2c) = DAT_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x164) = DAT_1405d83d4;
  local_res10 = operator_new(0x60);
  if (local_res10 != (longlong *)0x0) {
    puVar7 = (undefined8 *)FUN_14039fe30(local_res10,param_1 + 2);
  }
  param_1[0x2f] = puVar7;
  return param_1;
}



undefined8 FUN_1403a1650(undefined8 param_1,uint param_2)

{
  FUN_1403a0e90();
  if ((param_2 & 1) != 0) {
    FUN_14034ff60(param_1);
  }
  return param_1;
}



wchar_t * FUN_1403a1680(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_1403a16b0(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_1403a16f0(undefined8 param_1)

{
  FUN_1403858f0();
  return param_1;
}



undefined8 FUN_1403a1710(undefined8 param_1,undefined8 param_2)

{
  FUN_1403840e0(param_1,param_2,0x10);
  return param_1;
}



void FUN_1403a1730(undefined4 param_1)

{
  undefined1 local_58 [88];
  
  FUN_14034f420(local_58,&DAT_14045f690,param_1);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



undefined8 FUN_1403a1760(undefined8 param_1,longlong param_2)

{
  undefined *local_18;
  undefined2 local_10;
  
  FUN_14034fe70();
  local_18 = PTR_DAT_1405d8008;
  FUN_14000d220(&local_18,param_2);
  local_10 = *(undefined2 *)(param_2 + 8);
  FUN_140385a80(param_1,&local_18);
  return param_1;
}



longlong FUN_1403a17c0(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_140399790();
    }
  }
  else if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(lVar2 + 0x18);
    FUN_1400179d0(lVar2,iVar1 + 0x10);
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar4 = *(longlong *)(lVar2 + 0x10);
    }
    FUN_14000d3f0(lVar4 + iVar1,param_2,0x10);
    goto LAB_1403a1892;
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    FUN_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = *(int *)(param_1 + 0x18);
  iVar3 = iVar1 + 0x10;
  if ((iVar3 < 0) || (*(int *)(param_1 + 0x1c) < iVar3)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(int *)(param_1 + 0x18) = iVar3;
  FUN_14000d3f0((longlong)iVar1 + *(longlong *)(param_1 + 0x10),param_2,0x10);
LAB_1403a1892:
  FUN_140017b00(param_1);
  return param_1;
}



void FUN_1403a18c0(undefined8 param_1,char *param_2)

{
  wchar_t *pwVar1;
  
  pwVar1 = L"false";
  if (*param_2 != '\0') {
    pwVar1 = L"true";
  }
  FUN_140017790(param_1,pwVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a18e0(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1940(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a19a0(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1a00(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1a60(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%d");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1ac0(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%ld");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1b20(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%I64d");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1b80(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%f");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1bf0(undefined8 param_1)

{
  undefined1 auStack_108 [32];
  wchar_t local_e8 [104];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_108;
  swprintf_s(local_e8,99,L"%lf");
  FUN_140017790(param_1,local_e8);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a1c60(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_1405d84f0 ^ (ulonglong)auStack_158;
  FUN_140017790(param_1,&DAT_14045f738);
  puVar1 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar1 = PTR_DAT_1405d8008;
  }
  local_128 = local_120;
  FUN_14012a1d0(&local_128,puVar1,3);
  FUN_140017790(param_1,local_128);
  if (local_128 != local_120) {
    free(local_128);
  }
  FUN_140017790(param_1,&DAT_14045f738);
  return;
}



void FUN_1403a1d20(undefined8 param_1,undefined8 param_2)

{
  FUN_140017790(param_1,&DAT_14045f738);
  FUN_140017520(param_1,param_2);
  FUN_140017790(param_1,&DAT_14045f738);
  return;
}



void FUN_1403a1d60(undefined8 param_1)

{
  FUN_140017790(param_1,L"<ByteArray>");
  return;
}



void FUN_1403a1d70(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_140017790(param_1,pwVar2);
  RpcStringFreeW((RPC_WSTR *)local_res18);
  return;
}



void FUN_1403a1dc0(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_14039b1d0(1,uVar2);
    FUN_1403a0a50(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_1403a03a0(*(undefined8 *)(*(longlong *)(param_1 + 0x38) + 0x748),param_3,&local_18);
  return;
}



void FUN_1403a1e90(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_140352ee0(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_14039db80(*(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_14039f500(*(undefined8 *)(lVar4 + 0x178),&local_18);
    }
  }
  return;
}



undefined2 * FUN_1403a1f70(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_1405d83d0;
  param_1[10] = DAT_1405d83d4;
  *(undefined4 *)(param_1 + 0x10) = DAT_1405d83d0;
  param_1[0x12] = DAT_1405d83d4;
  *(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_1403a2020(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_14034ff60(plVar1);
  }
  return;
}



void FUN_1403a2080(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_140363a40(*(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_1405d83d0) || (sVar1 != DAT_1405d83d4)) {
      puVar3 = (undefined8 *)
               FUN_14038d8a0(*(longlong *)(*(longlong *)(param_1 + 0x38) + 0x238) + 0x388,
                             param_1 + 8);
      *puVar3 = *(undefined8 *)(param_1 + 0x38);
    }
  }
  return;
}



longlong FUN_1403a2120(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(param_1,uVar1,1,param_4,uVar2);
  FUN_14035a060(param_1 + 0x48,1);
  FUN_14035a060(param_1 + 0x50,1);
  *(undefined8 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x40) = 0;
  return param_1;
}



void FUN_1403a2180(longlong param_1)

{
  FUN_14035a020(param_1 + 0x50);
  FUN_14035a020(param_1 + 0x48);
  FUN_14034edf0(param_1);
  return;
}



undefined4 FUN_1403a21c0(longlong param_1)

{
  undefined4 uVar1;
  
  while( true ) {
    FUN_14034ed40(param_1);
    if (*(int *)(param_1 + 0x3c) < 1) break;
    FUN_14034edd0(param_1);
    FUN_140359f70(param_1 + 0x50);
  }
  *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + 1;
  ResetEvent(*(HANDLE *)(param_1 + 0x48));
  uVar1 = *(undefined4 *)(param_1 + 0x38);
  FUN_14034edd0(param_1);
  return uVar1;
}



void FUN_1403a2240(longlong param_1)

{
  FUN_14034ed40();
  *(int *)(param_1 + 0x38) = *(int *)(param_1 + 0x38) + -1;
  if (*(int *)(param_1 + 0x38) < 1) {
    SetEvent(*(HANDLE *)(param_1 + 0x48));
  }
  FUN_14034edd0(param_1);
  return;
}



void FUN_1403a2270(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  longlong local_20;
  longlong local_18;
  
  uVar1 = 0xfffffffffffffffe;
  while( true ) {
    lVar2 = param_1;
    FUN_14034ed40(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_14034edd0(param_1);
    FUN_140359f90(&local_20,2,0xffffffff,1,uVar1,lVar2,0);
  }
  *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + 1;
  ResetEvent(*(HANDLE *)(param_1 + 0x50));
  FUN_14034edd0(param_1);
  return;
}



void FUN_1403a2300(longlong param_1)

{
  FUN_14034ed40();
  *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
  if (*(int *)(param_1 + 0x3c) < 1) {
    SetEvent(*(HANDLE *)(param_1 + 0x50));
  }
  FUN_14034edd0(param_1);
  return;
}



void FUN_1403a2330(undefined8 *param_1)

{
  if (*(char *)(param_1 + 1) != '\0') {
    FUN_1403a2240(*param_1);
    *(undefined1 *)(param_1 + 1) = 0;
  }
  return;
}



void FUN_1403a2360(undefined8 *param_1)

{
  if (*(char *)(param_1 + 1) != '\0') {
    FUN_1403a2300(*param_1);
    *(undefined1 *)(param_1 + 1) = 0;
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a2390(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_1405d84f0 ^ (ulonglong)auStack_ab8;
  FUN_140359a20(local_a58);
  FUN_140359b40(local_a58);
  if (*(char *)(param_1 + 0x1040) == '\0') {
    do {
      dVar11 = (double)FUN_14035a090(local_a58);
      lVar1 = param_1 + 0x28;
      iVar10 = 0;
      iVar5 = 0;
      if (dVar11 <= 0.9) {
        local_a88 = lVar1;
        local_a7c = FUN_1403a21c0(lVar1);
        local_a80 = 1;
        piVar7 = (int *)(param_1 + 0x80);
        iVar10 = *piVar7;
        uVar9 = 0;
        do {
          if (iVar10 != *piVar7) {
            FUN_14034fe70();
            local_a98 = PTR_DAT_1405d8010;
            iVar4 = FUN_14034fcf0(&DAT_14045f860);
            iVar10 = iVar5;
            if ((local_a98 != (undefined *)0x0) && (local_a98 != PTR_DAT_1405d8010)) {
              iVar10 = *(int *)(local_a98 + -8);
            }
            iVar2 = iVar4;
            if (((iVar4 <= iVar10) && (iVar2 = iVar5, local_a98 != (undefined *)0x0)) &&
               (local_a98 != PTR_DAT_1405d8010)) {
              iVar2 = *(int *)(local_a98 + -8);
            }
            iVar10 = 1;
            if (1 < iVar2) {
              iVar10 = iVar2;
            }
            iVar2 = iVar5;
            if ((local_a98 != (undefined *)0x0) && (local_a98 != PTR_DAT_1405d8010)) {
              iVar2 = *(int *)(local_a98 + -8);
            }
            if (iVar2 < iVar10) {
              FUN_140002d30(&local_a98);
            }
            FUN_140002e10(&local_a98);
            puVar6 = local_a98;
            if (local_a98 == (undefined *)0x0) {
              puVar6 = PTR_DAT_1405d8010;
            }
            FUN_14034fd20(puVar6,&DAT_14045f860,iVar4);
            puVar6 = local_a98;
            if (local_a98 == (undefined *)0x0) {
              puVar6 = PTR_DAT_1405d8010;
            }
            iVar4 = FUN_14034fcf0(puVar6);
            iVar10 = 0;
            if (0 < iVar4) {
              iVar10 = iVar4;
            }
            iVar4 = iVar5;
            if ((local_a98 != (undefined *)0x0) && (local_a98 != PTR_DAT_1405d8010)) {
              iVar4 = *(int *)(local_a98 + -8);
            }
            if ((iVar10 < iVar4) || (iVar10 = iVar5, local_a98 == (undefined *)0x0)) {
LAB_1403a26fe:
              if (((local_a98 != PTR_DAT_1405d8010) && (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_1405d8010) {
              iVar10 = *(int *)(local_a98 + -8);
              goto LAB_1403a26fe;
            }
            FUN_14037ef10(*(undefined8 *)(param_1 + 0x1088),&local_a98);
            *(undefined1 *)(param_1 + 0x1040) = 1;
            FUN_1403a2240(lVar1);
            goto LAB_1403a273f;
          }
          uVar9 = uVar9 + 1;
          piVar7 = piVar7 + 1;
        } while ((longlong)uVar9 < 1000);
        if (1 < local_a7c) {
          *(undefined1 *)(param_1 + 0x1080) = 1;
        }
        FUN_1403a2240(lVar1);
        local_a80 = 0;
      }
      else {
        local_a78 = lVar1;
        FUN_1403a2270();
        local_a70 = 1;
        piVar7 = (int *)(param_1 + 0x80);
        iVar4 = *piVar7;
        uVar9 = 0;
        do {
          iVar2 = *piVar7;
          *piVar7 = iVar2 + 1;
          if (iVar4 + 1 != iVar2 + 1) {
            FUN_14034fe70();
            local_a90 = PTR_DAT_1405d8010;
            iVar2 = FUN_14034fcf0(&DAT_14045f8d0);
            iVar4 = iVar10;
            if ((local_a90 != (undefined *)0x0) && (local_a90 != PTR_DAT_1405d8010)) {
              iVar4 = *(int *)(local_a90 + -8);
            }
            iVar3 = iVar2;
            if (((iVar2 <= iVar4) && (iVar3 = iVar10, local_a90 != (undefined *)0x0)) &&
               (local_a90 != PTR_DAT_1405d8010)) {
              iVar3 = *(int *)(local_a90 + -8);
            }
            iVar10 = 1;
            if (1 < iVar3) {
              iVar10 = iVar3;
            }
            iVar4 = iVar5;
            if ((local_a90 != (undefined *)0x0) && (local_a90 != PTR_DAT_1405d8010)) {
              iVar4 = *(int *)(local_a90 + -8);
            }
            if (iVar4 < iVar10) {
              FUN_140002d30(&local_a90);
            }
            FUN_140002e10(&local_a90);
            puVar6 = local_a90;
            if (local_a90 == (undefined *)0x0) {
              puVar6 = PTR_DAT_1405d8010;
            }
            FUN_14034fd20(puVar6,&DAT_14045f8d0,iVar2);
            puVar6 = local_a90;
            if (local_a90 == (undefined *)0x0) {
              puVar6 = PTR_DAT_1405d8010;
            }
            iVar4 = FUN_14034fcf0(puVar6);
            iVar10 = 0;
            if (0 < iVar4) {
              iVar10 = iVar4;
            }
            iVar4 = iVar5;
            if ((local_a90 != (undefined *)0x0) && (local_a90 != PTR_DAT_1405d8010)) {
              iVar4 = *(int *)(local_a90 + -8);
            }
            if ((iVar10 < iVar4) || (iVar10 = iVar5, local_a90 == (undefined *)0x0)) {
LAB_1403a25cd:
              if (((local_a90 != PTR_DAT_1405d8010) && (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_1405d8010) {
              iVar10 = *(int *)(local_a90 + -8);
              goto LAB_1403a25cd;
            }
            FUN_14037ef10(*(undefined8 *)(param_1 + 0x1088),&local_a90);
            *(undefined1 *)(param_1 + 0x1040) = 1;
            FUN_1403a2300(lVar1);
            goto LAB_1403a273f;
          }
          uVar8 = (int)uVar9 + 1;
          uVar9 = (ulonglong)uVar8;
          piVar7 = piVar7 + 1;
        } while ((int)uVar8 < 1000);
        FUN_1403a2300(lVar1);
        local_a70 = 0;
      }
      Sleep(0);
    } while (*(char *)(param_1 + 0x1040) == '\0');
  }
LAB_1403a273f:
  FUN_140359a60(local_a58);
  return;
}



undefined8 * FUN_1403a2790(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_1403a2120(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,0x0001403a28c0)
// WARNING: Removing unreachable block (ram,0x0001403a28c4)
// WARNING: Removing unreachable block (ram,0x0001403a28e0)
// WARNING: Removing unreachable block (ram,0x0001403a290d)

void FUN_1403a2800(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_1403573d0(local_res18[0],&LAB_1403a2780,param_1,param_4,uVar14);
    }
    if (lVar8 == 0) {
      local_res18[0] = (longlong *)0x0;
    }
    else {
      local_res18[0] = (longlong *)FUN_14034fef0(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_14034f7d0();
    }
    FUN_14038e3d0(param_1,iVar10 + 1);
    lVar11 = 0;
    lVar8 = FUN_1403a2c90(param_1);
    FUN_14038a5f0(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_1403574e0(pvVar3);
          operator_delete(pvVar3);
        }
        FUN_14034ff60(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_14034f800();
    }
    puVar4 = *(undefined8 **)(*(longlong *)(param_1 + 0x10) + lVar8 * 8);
    if (puVar4 == (undefined8 *)0x0) {
      uVar14 = 0;
    }
    else {
      uVar14 = *puVar4;
    }
    FUN_1403575d0(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_14034f800();
    }
    puVar4 = *(undefined8 **)(*(longlong *)(param_1 + 0x10) + lVar11 * 8);
    if (puVar4 == (undefined8 *)0x0) {
      uVar14 = 0;
    }
    else {
      uVar14 = *puVar4;
    }
    FUN_140357460(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_14034fe70();
      local_res10 = PTR_DAT_1405d8010;
      iVar6 = FUN_14034fcf0(&DAT_14045f990);
      iVar10 = 0;
      iVar13 = iVar10;
      if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) {
        iVar13 = *(int *)(local_res10 + -8);
      }
      iVar7 = iVar6;
      if (((iVar6 <= iVar13) && (iVar7 = 0, local_res10 != (undefined *)0x0)) &&
         (iVar7 = iVar10, local_res10 != PTR_DAT_1405d8010)) {
        iVar7 = *(int *)(local_res10 + -8);
      }
      iVar13 = 1;
      if (1 < iVar7) {
        iVar13 = iVar7;
      }
      iVar7 = iVar10;
      if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) {
        iVar7 = *(int *)(local_res10 + -8);
      }
      if (iVar7 < iVar13) {
        FUN_140002d30(&local_res10);
      }
      FUN_140002e10(&local_res10);
      puVar9 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1405d8010;
      }
      FUN_14034fd20(puVar9,&DAT_14045f990,iVar6);
      puVar9 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar9 = PTR_DAT_1405d8010;
      }
      iVar6 = FUN_14034fcf0(puVar9);
      iVar13 = 0;
      if (0 < iVar6) {
        iVar13 = iVar6;
      }
      if ((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) {
        iVar10 = *(int *)(local_res10 + -8);
      }
      if ((iVar13 < iVar10) || (iVar13 = 0, local_res10 == (undefined *)0x0)) {
LAB_1403a2b31:
        if (((local_res10 != PTR_DAT_1405d8010) && (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_1405d8010) {
        iVar13 = *(int *)(local_res10 + -8);
        goto LAB_1403a2b31;
      }
      FUN_14037ef10(*(undefined8 *)(param_1 + 0x1088),&local_res10);
    }
    piVar12 = piVar12 + 1;
    lVar8 = lVar8 + -1;
    if (lVar8 == 0) {
      return;
    }
  } while( true );
}



undefined8 * FUN_1403a2ba0(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_1403a2bc0(longlong param_1,undefined8 param_2)

{
  FUN_1403c6320(param_1 + 0x48);
  FUN_1403c6490(param_1 + 0x60,param_2);
  FUN_1403c6440(param_1 + 0x38,param_2);
  FUN_1403c63a0(param_1 + 0x58,*(undefined8 *)(param_1 + 0x60),*(undefined8 *)(param_1 + 0x38));
  return;
}



void FUN_1403a2c30(undefined8 param_1)

{
  FUN_1403568b0(param_1,DAT_1405d8048);
  FUN_140356850(param_1,DAT_1405d8050);
  return;
}



void FUN_1403a2c60(undefined8 param_1)

{
  FUN_1403568b0(param_1,DAT_1405d804c);
  FUN_140356850(param_1,DAT_1405d8054);
  return;
}



undefined8 FUN_1403a2c90(longlong param_1)

{
  if (*(int *)(param_1 + 0x18) == 0) {
    return 0;
  }
  return *(undefined8 *)(param_1 + 0x10);
}



undefined4 * FUN_1403a2ca0(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_140399690(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;
}



undefined2 * FUN_1403a2d20(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_14034fef0();
  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_1403a2da0(longlong *param_1)

{
  longlong lVar1;
  
  lVar1 = *param_1;
  while (lVar1 != 0) {
    lVar1 = *param_1;
    *param_1 = *(longlong *)(lVar1 + 0x38);
    *(undefined8 *)(lVar1 + 0x38) = 0;
    FUN_1403555d0(lVar1 + 8);
    FUN_14034ff60(lVar1);
    lVar1 = *param_1;
  }
  return;
}



longlong FUN_1403a2e00(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_14000d450(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_14034ff60();
  param_1[3] = param_1[3] + -1;
  return lVar3;
}



void FUN_1403a2e90(longlong param_1,undefined8 param_2,undefined8 *param_3)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined8 *puVar4;
  
  lVar3 = FUN_1403a2d20();
  *(undefined8 *)(lVar3 + 0x28) = *param_3;
  thunk_FUN_1403a6430(param_2,lVar3);
  plVar1 = *(longlong **)(param_1 + 8);
  uVar2 = *(undefined8 *)(param_1 + 0x18);
  if (plVar1 == (longlong *)0x0) {
    puVar4 = (undefined8 *)FUN_14034fef0(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_1403a2f40(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_14039c4e0(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_14000d450(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_14039b6c0(param_2,lVar3 + 1,0xffffffffffffffff);
    if (param_2[1] <= lVar3) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    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_14034f7d0();
}



void FUN_1403a3090(longlong *param_1,int param_2)

{
  longlong lVar1;
  int iVar2;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  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_14034f7d0();
      }
      *(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_1403a2e00(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_14034f7d0();
        }
        *(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_1403a3190(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_1405d84f0 ^ (ulonglong)auStack_d28;
  FUN_140017c50(param_3,0x5713);
  iVar1 = FUN_1403a62c0(param_1);
  FUN_140385580(param_3,(longlong)iVar1);
  if (*(longlong *)(param_2 + 0xc80) == 0) {
    FUN_14034f420(local_d00,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d00,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*(int *)(param_2 + 0xc8c) < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  *(undefined4 *)(param_2 + 0xc88) = 0;
  FUN_140361500(local_cb8,param_3);
  FUN_1403607b0(param_2,local_cb8);
  if (local_38 == 0) {
    FUN_14034f420(local_d00,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d00,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_1403607b0(param_2,param_1);
  return;
}



undefined8 * FUN_1403a32b0(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_1403c6340(param_1 + 9);
  FUN_1403c6420(param_1 + 0xb);
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  param_1[0xc] = 0;
  param_1[0xf] = 0;
  param_1[6] = 0;
  FUN_1403eb740(param_1 + 1);
  param_1[5] = 0;
  return param_1;
}



// WARNING: Removing unreachable block (ram,0x0001403a33a4)

void FUN_1403a3340(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_1403555d0(lVar1 + 8);
            FUN_14034ff60(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_14034ff60();
        }
        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_14000d450(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_14034f7d0();
}



void FUN_1403a3470(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_14038d950(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_1403a2c90(param_1);
        lVar4 = lVar2 * -0x48 + lVar1 + lVar7;
        lVar1 = FUN_1403a2c90(param_1);
        lVar1 = lVar7 + lVar1;
        FUN_1403a2ca0(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_1403a2c90(param_1);
        lVar6 = ((longlong)param_2 * 0x48 - param_3) + -0x3c + lVar6 + (longlong)puVar5;
        FUN_1403a2ca0(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_14034f7d0();
}



ulonglong FUN_1403a35c0(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_1403841b0(local_120);
    FUN_140383e30(local_120,*param_1,*(undefined4 *)(param_1 + 1));
    FUN_140384310(local_120,*(undefined4 *)(param_1 + 1));
    FUN_140383db0(local_120,0);
    uVar6 = uVar2;
    uVar7 = uVar2;
    while( true ) {
      local_128 = 0;
      iStack_124 = 0;
      local_130 = 0;
      local_138 = 0;
      cVar1 = FUN_1403840e0(local_120,&local_res8,2);
      uVar5 = (undefined4)uVar6;
      if (cVar1 == '\0') {
        *(undefined4 *)(param_1 + 4) = uVar5;
        FUN_140399690(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_140399690(&local_118);
        if (local_110 == 0) {
          return uVar7;
        }
        if (-1 < local_104) {
          return uVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if ((short)local_res8 != 0x5713) break;
      cVar1 = FUN_140384780(local_120,&local_res10);
      uVar6 = local_res10;
      if (cVar1 == '\0') {
        *(undefined4 *)(param_1 + 4) = uVar5;
        FUN_140399690(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_140399690(&local_118);
        if (local_110 == 0) {
          return uVar7;
        }
        if (-1 < local_104) {
          return uVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      iVar4 = (int)local_res10;
      if (iVar4 < 0) {
        if (local_118 == 0) {
          if (local_110 == 0) {
                    // WARNING: Subroutine does not return
            FUN_140399790();
          }
        }
        else {
          local_108 = *(undefined4 *)(local_118 + 0x18);
        }
        *(undefined4 *)(param_1 + 4) = local_108;
        *param_2 = 0x1f;
        FUN_140399690(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_140399690(&local_118);
        if ((local_110 != 0) && (local_104 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        goto LAB_1403a3b1b;
      }
      if (*(int *)((longlong)param_1 + 0x1c) < iVar4) {
        if (local_118 == 0) {
          if (local_110 == 0) {
                    // WARNING: Subroutine does not return
            FUN_140399790();
          }
        }
        else {
          local_108 = *(undefined4 *)(local_118 + 0x18);
        }
        *(undefined4 *)(param_1 + 4) = local_108;
        *param_2 = 0x20;
        FUN_140399690(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_140399690(&local_118);
        if ((local_110 != 0) && (local_104 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        goto LAB_1403a3b1b;
      }
      cVar1 = FUN_140384140(local_120,local_res10 & 0xffffffff);
      if (cVar1 == '\0') {
        *(undefined4 *)(param_1 + 4) = uVar5;
        FUN_140399690(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_140399690(&local_118);
        if (local_110 == 0) {
          return uVar7;
        }
        if (-1 < local_104) {
          return uVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (local_130 != 0) {
        FUN_14034f420(local_80,PTR_u_Cannot_use_internal_buffer_becau_1405d94e0);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_80,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (local_138 == 0) {
        local_138 = FUN_1403996d0();
        *(undefined8 *)(local_138 + 0x28) = 1;
        if (local_130 == 0) goto LAB_1403a370c;
        if (iStack_124 < iVar4) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
      }
      else {
LAB_1403a370c:
        if (iVar4 < 1) {
          if (local_138 == 0) goto LAB_1403a38ca;
          uVar3 = 0;
        }
        else {
          if (local_138 == 0) {
                    // WARNING: Subroutine does not return
            FUN_140399790();
          }
          uVar3 = uVar6 & 0xffffffff;
        }
        FUN_1400179d0(local_138,uVar3);
        iVar4 = local_128;
      }
      local_128 = iVar4;
      uVar3 = local_130;
      if (local_130 == 0) {
        if (local_138 == 0) {
LAB_1403a38ca:
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        uVar3 = uVar2;
        if (*(int *)(local_138 + 0x18) != 0) {
          uVar3 = *(ulonglong *)(local_138 + 0x10);
        }
      }
      cVar1 = FUN_1403840e0(local_120,uVar3,uVar6 & 0xffffffff);
      if (cVar1 == '\0') {
        *(undefined4 *)(param_1 + 4) = uVar5;
        FUN_140399690(&local_138);
        if (local_130 != 0) {
          if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          local_128 = 0;
        }
        local_res8 = &local_118;
        FUN_140399690(&local_118);
        if (local_110 == 0) {
          return uVar7;
        }
        if (-1 < local_104) {
          return uVar7;
        }
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      FUN_1403841b0(local_d8);
      local_a8 = Proud::AddrPort::vftable;
      local_98 = 0;
      local_a0 = DAT_1405d83d0;
      local_9c = DAT_1405d83d4;
      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_140384280(local_d8,&local_f8);
      FUN_1403a3470(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_140399690(local_d0);
      if (local_c8 != 0) {
        if (local_bc < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_c0 = 0;
      }
      FUN_140399690(&local_138);
      if ((local_130 != 0) && (iStack_124 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
    if (local_118 == 0) {
      if (local_110 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
    }
    else {
      local_108 = *(undefined4 *)(local_118 + 0x18);
    }
    *(undefined4 *)(param_1 + 4) = local_108;
    *param_2 = 0x1f;
    FUN_140399690(&local_138);
    if (local_130 != 0) {
      if (iStack_124 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_128 = 0;
    }
    local_res8 = &local_118;
    FUN_140399690(&local_118);
    if ((local_110 != 0) && (local_104 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
LAB_1403a3b1b:
    uVar2 = 0xffffffff;
  }
  return uVar2;
}



undefined4
FUN_1403a3ba0(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_1403a35c0(&local_38,param_5);
  FUN_1403aa040(param_1,(longlong)local_18);
  return uVar1;
}



void FUN_1403a3c10(undefined8 *param_1)

{
  *param_1 = Proud::IHostIDFactory::vftable;
  return;
}



undefined8 * FUN_1403a3c20(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_1403a3c50(undefined8 *param_1)

{
  *(undefined4 *)(param_1 + 1) = 2;
  *param_1 = Proud::CHostIDFactory::vftable;
  return param_1;
}



void FUN_1403a3c70(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_1403a3c90(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_1403a3cdd;
    }
  }
  puVar2 = (uint *)0x0;
LAB_1403a3cdd:
  if (puVar2 != (uint *)0x0) {
    return puVar2[3];
  }
  return 0;
}



undefined4 FUN_1403a3cf0(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_14000d450(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_14034ff60();
  param_1[3] = param_1[3] + -1;
  return (int)lVar4;
}



undefined8 * FUN_1403a3d70(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_14034fef0(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;
}



undefined4 * FUN_1403a3df0(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_14034fef0(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_14035ec80(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_14035ec80(param_1);
    FUN_14035ec80(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_14035ec80(param_1);
  FUN_14035ec80(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_1403d7ac0(param_1);
    FUN_14035f7a0(param_1,uVar4);
  }
  FUN_14035ec80(param_1);
  return puVar5;
}



ulonglong FUN_1403a3f30(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_14000d450(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_1403a3fad;
      }
    }
    puVar6 = (uint *)0x0;
LAB_1403a3fad:
    if (puVar6 == (uint *)0x0) {
      FUN_1403a3cf0(param_1 + 0x70);
      piVar1 = (int *)(param_1 + 0x10);
      *piVar1 = *piVar1 + 1;
      if (*piVar1 == 0) {
        *(undefined4 *)(param_1 + 0x10) = 3;
        return 3;
      }
      goto LAB_1403a4006;
    }
    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_1403a3cf0(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_1403a4006:
  return (ulonglong)*(uint *)(param_1 + 0x10);
}



// WARNING: Removing unreachable block (ram,0x0001403a4087)
// WARNING: Removing unreachable block (ram,0x0001403a4090)
// WARNING: Removing unreachable block (ram,0x0001403a40ae)
// WARNING: Removing unreachable block (ram,0x0001403a40b7)

undefined8 * FUN_1403a4010(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_1403a4100(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_140360d00(param_1 + 3);
  lVar1 = param_1[0x11];
  while( true ) {
    if (lVar1 == 0) {
      param_1[0xf] = 0;
      param_1[0x10] = 0;
      FUN_140359460(param_1 + 0xe);
      FUN_14039cfc0(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_14034ff60();
    }
    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_14000d450(0x80004005);
}



void * FUN_1403a41f0(void *param_1,uint param_2)

{
  FUN_1403a4100();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1403a4220(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_1403a427b;
    }
  }
  puVar8 = (uint *)0x0;
LAB_1403a427b:
  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_1403a3d70(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_1403a4387;
    }
    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_1403a4375;
      }
      if (lVar2 != 0) goto LAB_1403a434c;
    }
  }
  cVar6 = FUN_14035f5e0(param_1 + 0x18,uVar10,CONCAT71((int7)((ulonglong)lVar2 >> 8),1));
  if (cVar6 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
LAB_1403a434c:
  FUN_14035ec80(param_1 + 0x18);
  puVar8 = (uint *)FUN_1403a3df0(param_1 + 0x18,local_res18,uVar5,param_3);
  FUN_14035ec80(param_1 + 0x18);
LAB_1403a4375:
  *(ulonglong *)(puVar8 + 2) = (ulonglong)param_3;
  *(undefined8 *)(puVar8 + 4) = param_2;
LAB_1403a4387:
  plVar3 = *(longlong **)(param_1 + 0x70);
  uVar4 = *(undefined8 *)(param_1 + 0x80);
  if (plVar3 == (longlong *)0x0) {
    puVar7 = (undefined8 *)FUN_14034fef0(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,0x0001403a44b4)

void FUN_1403a4400(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_1405d84f0 ^ (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,0x0001403a45d4)

void FUN_1403a44f0(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_1405d84f0 ^ (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,0x0001403a46cc)

void FUN_1403a4620(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_1405d84f0 ^ (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_1403a4720(longlong param_1)

{
  int iVar1;
  undefined1 local_58 [88];
  
  iVar1 = *(int *)(param_1 + 0x18) << 3;
  if (iVar1 == 0x200) {
    FUN_1403a4400();
    return;
  }
  if (iVar1 != 0x400) {
    if (iVar1 != 0x800) {
      FUN_14034f420(local_58,L"RC4 Encrypt Error. FastEncryptLevel is correct");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    FUN_1403a4620();
    return;
  }
  FUN_1403a44f0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403a4780(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_1405d84f0 ^ (ulonglong)auStack_198;
  if (param_3 == 0) {
    *(undefined1 *)(param_1 + 0x28) = 1;
  }
  else {
    if (param_2 == 0) {
      FUN_14034f420(local_178,L"RC4 ExpandFrom Error. inputkey is NULL");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_178,(ThrowInfo *)&DAT_1405d36c0);
    }
    FUN_1400179d0(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_14034f800();
        }
        *(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_1403a48c2:
                    // WARNING: Subroutine does not return
          FUN_14034f800();
        }
        if (*(int *)(param_1 + 0x18) <= (int)uVar7) goto LAB_1403a48c2;
        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_14034f800();
        }
        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_1403a48d0(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_14034f0d0(local_1b8,&DAT_14045fcf8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_1b8,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  else if (*(int *)(param_3 + 0x18) == 0) {
    FUN_14034f420(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_1405d36c0);
  }
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
      }
      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_140399790();
    }
    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_140399790();
      }
      if (*(int *)(lVar2 + 0x18) == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = *(longlong *)(lVar2 + 0x10);
      }
    }
    else {
      lVar2 = *(longlong *)(param_1 + 0x10);
      if (lVar2 == 0) {
        FUN_14034f420(local_290,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8,param_3,param_4,
                      0xfffffffffffffffe);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_290,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    puVar8 = (undefined4 *)0x0;
    _Src = (void *)((int)param_4 + lVar2);
    FUN_140383c40(param_2);
    FUN_140384310(param_2,uVar6 + 4);
    uVar1 = FUN_1403aa0d0(_Src,uVar6);
    if (*(longlong *)(param_2 + 0x10) == 0) {
      lVar2 = *(longlong *)(param_2 + 8);
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_14034f420(local_200,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_200,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    *puVar5 = uVar1;
    if (*(longlong *)(param_2 + 0x10) == 0) {
      lVar2 = *(longlong *)(param_2 + 8);
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_14034f420(local_170,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_170,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    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_140399790();
    }
    if (*(longlong *)(param_2 + 0x10) == 0) {
      if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      if (*(int *)(lVar2 + 0x18) != 0) {
        puVar8 = *(undefined4 **)(lVar2 + 0x10);
      }
    }
    else {
      puVar8 = *(undefined4 **)(param_2 + 0x10);
      if (puVar8 == (undefined4 *)0x0) {
        FUN_14034f420(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    uVar3 = FUN_1403a4720(param_3,puVar8);
    uVar4 = (undefined7)((ulonglong)uVar3 >> 8);
  }
  return CONCAT71(uVar4,1);
}



undefined8 FUN_1403a4bb0(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_14034f0d0(local_98,&DAT_14045fd78);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  else if (*(int *)(param_3 + 0x18) == 0) {
    FUN_14034f420(local_200,
                  L"FastEncrypt Key Length is 0, Check ServerStartParameters m_fastEncryptedMessageKeyLength"
                 );
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_200,(ThrowInfo *)&DAT_1405d36c0);
  }
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
      }
      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_140399790();
    }
    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_140399790();
      }
      if (*(int *)(lVar2 + 0x18) == 0) {
        lVar2 = 0;
      }
      else {
        lVar2 = *(longlong *)(lVar2 + 0x10);
      }
    }
    else {
      lVar2 = *(longlong *)(param_1 + 0x10);
      if (lVar2 == 0) {
        FUN_14034f420(local_e0,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_e0,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    piVar6 = (int *)0x0;
    FUN_140383c40(param_2);
    FUN_140384310(param_2,uVar7 - 4);
    local_230 = 0;
    local_228 = (int *)0x0;
    local_220 = 0;
    local_218 = 0;
    local_238 = Proud::ByteArray::vftable;
    FUN_1400179d0(&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_1403a4720(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_1403aa0d0(piVar3 + 1,uVar7 - 4);
    if (iVar8 != iVar1) {
      FUN_14034f0d0(local_50,&DAT_14045fd40);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
    }
    piVar3 = local_228;
    if ((int)local_220 == 0) {
      piVar3 = piVar6;
    }
    _Dst = (void *)FUN_140383d70(param_2);
    memcpy(_Dst,piVar3 + 1,(ulonglong)(uVar7 - 4));
    uVar4 = FUN_1403555d0(&local_238);
    uVar5 = (undefined7)((ulonglong)uVar4 >> 8);
  }
  return CONCAT71(uVar5,1);
}



longlong FUN_1403a4e30(longlong param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined1 local_58 [80];
  
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14060d240);
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
  iVar1 = FUN_1403c7d50(&PTR_s_fortuna_140467040);
  if (iVar1 == -1) {
    FUN_14034f420(local_58,L"REGISTER PRNG ERROR : SPRNG");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  iVar1 = FUN_1403c74f0(&PTR_DAT_140466fc0);
  if (iVar1 == -1) {
    FUN_14034f420(local_58,L"REGISTER HASH ERROR : SHA1");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  memcpy(&DAT_14060d300,&PTR_s_LibTomMath_140466e30,0x188);
  uVar2 = FUN_1403c66a0("fortuna");
  *(undefined4 *)(param_1 + 0x1058) = uVar2;
  uVar2 = FUN_1403c6600(&DAT_14045fdb8);
  *(undefined4 *)(param_1 + 0x105c) = uVar2;
  iVar1 = FUN_1403c6500(0x80,*(undefined4 *)(param_1 + 0x1058),param_1,0);
  if (iVar1 != 0) {
    FUN_14034f420(local_58,L"PRNG MAKE ERROR");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  return param_1;
}



undefined8 * FUN_1403a4f50(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_1403a4fa0(longlong *param_1)

{
  if (*param_1 != 0) {
    FUN_1403c8710();
    operator_delete((void *)*param_1);
  }
  *param_1 = 0;
  return;
}



undefined * FUN_1403a4fd0(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_14034ede0(&DAT_1405f3988);
  if (cVar2 != '\0') {
    if (DAT_1405d97c0 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_14034ed40(&DAT_1405f3988);
    }
  }
  if ((DAT_1405f3980 & 1) == 0) {
    DAT_1405f3980 = DAT_1405f3980 | 1;
    FUN_1403a4e30(&DAT_1405f2920);
    atexit(FUN_140449600);
  }
  DAT_1405d97c0 = 0;
  if (bVar1) {
    FUN_14034edd0(&DAT_1405f3988);
  }
  return &DAT_1405f2920;
}



void FUN_1403a5090(longlong param_1,int param_2)

{
  undefined8 uVar1;
  int iVar2;
  undefined8 uVar3;
  undefined1 local_58 [80];
  
  FUN_1400179d0(param_1,param_2 >> 3);
  if (*(int *)(param_1 + 0x18) == 0) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined8 *)(param_1 + 0x10);
  }
  uVar1 = FUN_1403a4fd0();
  iVar2 = FUN_1403c8250(uVar3,param_2 >> 3,uVar1);
  if (iVar2 == 0) {
    FUN_14034f420(local_58,L"Create Random Block Read Error");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  return;
}



void FUN_1403a5100(undefined8 *param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  uint local_res10 [6];
  undefined1 local_58 [80];
  
  FUN_1400179d0(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_1403c8c40(uVar2,local_res10,0,*param_1);
  if (iVar1 != 0) {
    FUN_14034f420(local_58,L"PUBLIC KEY EXPORT ERROR");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*(uint *)(param_2 + 0x18) < local_res10[0]) {
    FUN_14034f420(local_58,L"PublicKey To Blob result is larger! Memory corruption may occur!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  FUN_1400179d0(param_2);
  return;
}



void FUN_1403a51c0(undefined8 *param_1,undefined8 param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  int iVar3;
  undefined1 local_58 [80];
  
  lVar1 = FUN_1403a4fd0();
  uVar2 = FUN_1403a4fd0();
  iVar3 = FUN_1403c8df0(uVar2,*(undefined4 *)(lVar1 + 0x1058),0x80,0x10001,*param_1);
  if (iVar3 != 0) {
    FUN_14034f420(local_58,L"RSA MAKE KEY ERROR");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  FUN_1403a5100(param_1,param_2);
  return;
}



void FUN_1403a5250(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_1403c8760(uVar7,*(int *)(param_3 + 0x18),puVar3);
  if (iVar2 != 0) {
    FUN_14034f420(local_80,L"%s fail: %d",L"Proud::CRsaKey::FromBlob");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_80,(ThrowInfo *)&DAT_1405d36c0);
  }
  uVar1 = *(uint *)(param_2 + 0x18);
  local_res18[0] = uVar1;
  local_res18[0] = (*DAT_14060d390)(puVar3[3]);
  FUN_1400179d0(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_1403a4fd0();
  lVar5 = FUN_1403a4fd0();
  uVar6 = FUN_1403a4fd0();
  iVar2 = FUN_1403c91d0(uVar8,uVar1,uVar7,local_res18,0,0,uVar6,*(undefined4 *)(lVar5 + 0x1058),
                        *(undefined4 *)(lVar4 + 0x105c),2,puVar3);
  if (iVar2 != 0) {
    FUN_14034f420(local_80,L"%s fail: %d",L"Proud::CRsa::EncryptSessionKeyByPublicKey",1);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_80,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*(uint *)(param_1 + 0x18) < local_res18[0]) {
    FUN_14034f420(local_80,L"Encryption result is larger! Memory corruption may occur!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_80,(ThrowInfo *)&DAT_1405d36c0);
  }
  FUN_1400179d0(param_1);
  FUN_1403c8710(puVar3);
  operator_delete(puVar3);
  return;
}



undefined8 *
FUN_1403a5450(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_1400179d0(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_1403a4fd0();
  iVar4 = FUN_1403c9390(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_14034fe70();
        local_80 = PTR_DAT_1405d8010;
        FUN_140017720(&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_14035bed0(&local_88,6,0,&local_80,&local_60);
        FUN_1403555d0(&local_60);
        *param_1 = 0;
        FUN_14035bda0(param_1,&local_88);
        FUN_14012c7f0(&local_88);
        puVar3 = local_80;
        if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_80 + -8, puVar1 != (undefined *)0x0)) {
          uVar6 = FUN_14034fe70();
          local_70 = uVar6;
          FUN_14034ed40(uVar6);
          local_68 = 1;
          piVar2 = (int *)(puVar3 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(uVar6);
        }
      }
      else {
        FUN_1400179d0(param_2);
        *param_1 = 0;
      }
    }
    else {
      FUN_14034fe70();
      local_80 = PTR_DAT_1405d8010;
      FUN_140017720(&local_80,L"Incorrect Packet");
      local_58 = 0;
      local_50 = 0;
      local_48 = 0;
      local_40 = 0;
      local_60 = Proud::ByteArray::vftable;
      FUN_14035bed0(&local_88,6,0,&local_80,&local_60);
      FUN_1403555d0(&local_60);
      *param_1 = 0;
      FUN_14035bda0(param_1,&local_88);
      lVar5 = local_88;
      if (local_88 != 0) {
        local_70 = local_88;
        FUN_14034ed40(local_88);
        local_68 = 1;
        *(longlong *)(local_88 + 0x40) = *(longlong *)(local_88 + 0x40) + -1;
        if (*(longlong *)(local_88 + 0x40) == 0) {
          FUN_14034edd0(lVar5);
          local_68 = 0;
          FUN_14012c7d0(local_88);
        }
        else {
          FUN_14034edd0(lVar5);
        }
      }
      puVar3 = local_80;
      if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1405d8010)) &&
         (puVar1 = local_80 + -8, puVar1 != (undefined *)0x0)) {
        uVar6 = FUN_14034fe70();
        local_70 = uVar6;
        FUN_14034ed40(uVar6);
        local_68 = 1;
        piVar2 = (int *)(puVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar6);
      }
    }
  }
  else {
    FUN_14034fe70();
    local_80 = PTR_DAT_1405d8010;
    FUN_140017720(&local_80,L"Error");
    local_58 = 0;
    local_50 = 0;
    local_48 = 0;
    local_40 = 0;
    local_60 = Proud::ByteArray::vftable;
    FUN_14035bed0(&local_88,6,0,&local_80,&local_60);
    FUN_1403555d0(&local_60);
    *param_1 = 0;
    FUN_14035bda0(param_1,&local_88);
    lVar5 = local_88;
    if (local_88 != 0) {
      local_70 = local_88;
      FUN_14034ed40(local_88);
      local_68 = 1;
      *(longlong *)(local_88 + 0x40) = *(longlong *)(local_88 + 0x40) + -1;
      if (*(longlong *)(local_88 + 0x40) == 0) {
        FUN_14034edd0(lVar5);
        local_68 = 0;
        FUN_14012c7d0(local_88);
      }
      else {
        FUN_14034edd0(lVar5);
      }
    }
    puVar3 = local_80;
    if (((local_80 != (undefined *)0x0) && (local_80 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_80 + -8, puVar1 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      local_70 = uVar6;
      FUN_14034ed40(uVar6);
      local_68 = 1;
      piVar2 = (int *)(puVar3 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar6);
    }
  }
  return param_1;
}



undefined8 * FUN_1403a5850(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



ulonglong FUN_1403a58b0(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_14034f800();
      }
      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_1403a5930(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_14034f800();
      }
      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_1403a59a0(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_14034f800();
      }
      lVar2 = *(longlong *)(param_1 + 0x10);
      if (((*(int *)(lVar3 + 4 + lVar2) == param_2) && (*(int *)(lVar3 + lVar2) == param_3)) &&
         (*(int *)(lVar3 + 8 + lVar2) == param_4)) {
        FUN_14035e2d0(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,0x0001403a5a9d)
// WARNING: Removing unreachable block (ram,0x0001403a5aa6)
// WARNING: Removing unreachable block (ram,0x0001403a5ac4)
// WARNING: Removing unreachable block (ram,0x0001403a5acd)

undefined4 *
FUN_1403a5a20(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_14035ce50(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_14035ce80(param_1 + 0x3c);
  *param_1 = 0;
  puVar1 = (undefined8 *)FUN_14035ce50(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_1403a5bc0(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_14000d450(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_1403a5c7e:
      cVar5 = FUN_14035f5e0(param_2 + 2,(ulonglong)uVar2,CONCAT71((int7)((ulonglong)lVar3 >> 8),1));
      if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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_1403a5cbe;
      }
      if (lVar3 == 0) goto LAB_1403a5c7e;
      for (puVar6 = *(uint **)(lVar3 + uVar4 * 8);
          (puVar6 != (uint *)0x0 && ((uint)uVar4 == puVar6[6] % uVar2));
          puVar6 = *(uint **)(puVar6 + 2)) {
        if (*puVar6 == uVar1) goto LAB_1403a5cba;
      }
      if (lVar3 == 0) goto LAB_1403a5c7e;
    }
    FUN_14035eb50(param_2 + 2);
    puVar6 = (uint *)FUN_140360ee0(param_2 + 2,local_res8,uVar4,uVar1);
    FUN_14035eb50(param_2 + 2);
LAB_1403a5cba:
    *(undefined1 *)(puVar6 + 1) = 0;
LAB_1403a5cbe:
    puVar7 = *(uint **)(puVar7 + 6);
  } while( true );
}



longlong * FUN_1403a5d10(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_14034fef0(0x60);
  uVar2 = uVar3;
  if (lVar1 != 0) {
    uVar2 = FUN_1403c9570(lVar1);
  }
  FUN_1403612a0(param_2,uVar2,param_3,param_4,uVar4);
  if (*param_2 != 0) {
    uVar3 = *(undefined8 *)(*param_2 + 0x38);
  }
  FUN_1403a5bc0(param_1,uVar3);
  return param_2;
}



undefined8 FUN_1403a5d90(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_1403841b0(local_c8);
  lVar3 = *(longlong *)(param_1 + 8);
  if ((lVar3 == 0) && (*(longlong *)(param_1 + 0x10) == 0)) {
                    // WARNING: Subroutine does not return
    FUN_140399790();
  }
  if (*(longlong *)(param_1 + 0x10) == 0) {
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    if (*(int *)(lVar3 + 0x18) == 0) {
      lVar3 = 0;
    }
    else {
      lVar3 = *(longlong *)(lVar3 + 0x10);
    }
  }
  else {
    lVar3 = *(longlong *)(param_1 + 0x10);
    if (lVar3 == 0) {
      FUN_14034f420(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  FUN_140383e30(local_c8,lVar3);
  if (*(longlong *)(param_1 + 8) == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    uVar1 = *(undefined4 *)(param_1 + 0x18);
  }
  else {
    uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 8) + 0x18);
  }
  FUN_140384310(local_c8,uVar1);
  cVar2 = FUN_140384a10(local_c8,local_res8);
  if (cVar2 != '\0') {
    if (local_res8[0] == 1) {
      local_res10 = local_c0;
      FUN_140399690(local_c0);
      if ((local_b8 != 0) && (local_ac < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      return 1;
    }
    if (local_res8[0] == 2) {
      local_res10 = local_c0;
      FUN_140399690(local_c0);
      if ((local_b8 != 0) && (local_ac < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      return 2;
    }
  }
  local_res10 = local_c0;
  FUN_140399690(local_c0);
  if ((local_b8 != 0) && (local_ac < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return 3;
}



void FUN_1403a5f20(longlong param_1)

{
  FUN_140376ec0(param_1 + 0x50);
  FUN_140399690(param_1 + 0x10);
  if (*(longlong *)(param_1 + 0x18) != 0) {
    if (*(int *)(param_1 + 0x24) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_1 + 0x20) = 0;
  }
  return;
}



undefined4 * FUN_1403a5f80(undefined4 *param_1)

{
  FUN_1403841b0(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_1405d83d0;
  *(undefined2 *)(param_1 + 0x11) = DAT_1405d83d4;
  FUN_140376e10(param_1 + 0x14);
  *param_1 = 3;
  return param_1;
}



undefined4 * FUN_1403a5ff0(undefined4 *param_1,undefined4 *param_2)

{
  longlong *plVar1;
  int iVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  
  *param_1 = *param_2;
  FUN_14035bda0(param_1 + 2,param_2 + 2);
  param_1[4] = param_2[4];
  FUN_140376bb0(param_1 + 6,param_2 + 6);
  FUN_140376ce0(param_1 + 8,param_2 + 8);
  iVar2 = param_2[0x10];
  if (iVar2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_1400179d0(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_14000d3f0(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_140399690(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_1400179d0(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_14000d3f0(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_1400179d0(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_14000d3f0(uVar5,uVar4,(longlong)iVar2);
      return param_1;
    }
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_1403a61c0(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_1403a5ff0(param_1 + 0x14,param_2 + 0xc);
    return;
  }
  FUN_1403a2ca0(param_1 + 2,param_2 + 2);
  return;
}



longlong FUN_1403a61f0(longlong param_1,undefined8 param_2)

{
  *(undefined8 *)(param_1 + 0x140) = param_2;
  *(longlong *)(param_1 + 0x138) = param_1;
  FUN_1403a5f80();
  return param_1;
}



void FUN_1403a6230(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  
  uVar1 = *(undefined8 *)(param_1 + 0x140);
  FUN_14034ed40(uVar1);
  lVar2 = *(longlong *)(param_1 + 0x138);
  FUN_140376ec0(lVar2 + 0x50);
  FUN_140399690(lVar2 + 0x10);
  if (*(longlong *)(lVar2 + 0x18) != 0) {
    if (*(int *)(lVar2 + 0x24) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(lVar2 + 0x20) = 0;
  }
  FUN_14034edd0(uVar1);
  return;
}



int FUN_1403a62c0(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_14034f420(local_58,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_1403a6360(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_14034f7d0();
  }
  if (*param_1 == 0) {
    FUN_14034f420(local_50,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*param_2 == 0) {
    FUN_14034f420(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
  }
  if ((-1 < iVar1) && (iVar1 <= *(int *)((longlong)param_2 + 0xc))) {
    *(int *)(param_2 + 1) = iVar1;
    if (*param_1 == 0) {
      FUN_14034f420(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
    }
    FUN_14000d3f0(*param_2,*param_1,(longlong)(int)param_1[1] << 4);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_1403a6430(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_1403a62c0();
  FUN_1400179d0(param_2,uVar6);
  uVar8 = 0;
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_14034f420(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (((longlong)uVar8 < 0) || (*(int *)(param_1 + 0xc88) <= (int)uVar10)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_1403a65d0(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_140383cc0(param_2);
  FUN_140383c40(param_2);
  uVar7 = FUN_1403a62c0(param_1);
  FUN_140384310(param_2,uVar7);
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_14034f420(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
      }
      if ((lVar10 < 0) || (*(int *)(param_1 + 0xc88) <= iVar12)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_140399790();
        }
        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_1403a6430(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_1403a62c0();
  FUN_1400179d0(param_2,uVar6);
  uVar8 = 0;
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_14034f420(auStack_78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(auStack_78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (((longlong)uVar8 < 0) || (*(int *)(param_1 + 0xc88) <= (int)uVar10)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_1403a67b0(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_1403a62c0();
  if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (param_2[1] == 0) {
    lVar3 = *param_2;
    if (iVar5 < 1) {
      if (lVar3 == 0) goto LAB_1403a6809;
      iVar5 = 0;
    }
    else if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    FUN_1400179d0(lVar3,iVar5);
  }
  else {
    if (*(int *)((longlong)param_2 + 0x14) < iVar5) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(int *)(param_2 + 2) = iVar5;
  }
LAB_1403a6809:
  uVar7 = 0;
  if (*(longlong *)(param_1 + 0xc80) == 0) {
    FUN_14034f420(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  uVar13 = param_2[1];
  if (param_2[1] == 0) {
    lVar3 = *param_2;
    if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_14034f420(local_78,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_78,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (((longlong)uVar7 < 0) || (*(int *)(param_1 + 0xc88) <= (int)uVar9)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_1403a67b0(void)

{
  FUN_1403a67b0();
  return;
}



longlong * FUN_1403a69b0(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_1403a69e0(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_1403a6a10(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_1403a6a40(longlong param_1)

{
  FUN_140359f50(param_1 + 0x20,DAT_1405d8070);
  return;
}



void FUN_1403a6a50(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_140389050(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_1403aa0a0(param_1 + 0x20,1);
  return;
}



undefined8 FUN_1403a6ad0(undefined8 *param_1,longlong param_2,longlong *param_3)

{
  longlong *plVar1;
  char cVar2;
  undefined8 uVar3;
  
  uVar3 = (**(code **)(*(longlong *)*param_1 + 8))();
  FUN_14034ed40(uVar3);
  do {
    do {
      if (*(int *)(param_1 + 3) < 1) {
        FUN_14034edd0(uVar3);
        return 0;
      }
      plVar1 = *(longlong **)(param_1[1] + 0x18);
      if (plVar1[3] != 0) {
        FUN_140389050();
      }
      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_14034edd0(uVar3);
  return 1;
}



void FUN_1403a6bc0(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_14034ed40(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_1403a6a50(param_1,plVar4);
      }
    }
  }
  FUN_14034edd0(uVar3);
  return;
}



void FUN_1403a6c70(undefined8 *param_1)

{
  *param_1 = Proud::ITaskSubject::vftable;
  if (param_1[3] != 0) {
    FUN_140389050();
  }
  return;
}



undefined8 *
FUN_1403a6ca0(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_1403aa080(param_1 + 4,0,0x7fffffff,param_4,0xfffffffffffffffe);
  *param_1 = param_2;
  return param_1;
}



undefined8 * FUN_1403a6cf0(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_1403a6d20(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::ITaskSubject::vftable;
  if (param_1[3] != 0) {
    FUN_140389050();
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined4 * FUN_1403a6d70(undefined4 *param_1)

{
  undefined4 uVar1;
  
  *(double *)(param_1 + 2) = DAT_1405d80f8 * 10.0 * 2.0;
  uVar1 = DAT_1405f0644;
  *param_1 = 0;
  param_1[4] = uVar1;
  param_1[1] = 0x10000;
  param_1[5] = DAT_1405d8190;
  *(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_1405d8145;
  param_1[10] = 0;
  *(undefined1 *)((longlong)param_1 + 0x2d) = 0;
  return param_1;
}



int FUN_1403a6de0(undefined8 param_1)

{
  int iVar1;
  
  iVar1 = FUN_14035a0c0(param_1,0x7fffffff);
  if (iVar1 == 0) {
    iVar1 = 1;
  }
  return iVar1;
}



// WARNING: Removing unreachable block (ram,0x0001403a6e30)

void FUN_1403a6e00(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_140399690(plVar1);
  *(undefined8 *)(param_4 + 6) = 0;
  *(undefined8 *)(param_4 + 4) = 0;
  if (*plVar1 == 0) {
    lVar2 = FUN_1403996d0();
    *plVar1 = lVar2;
    *(undefined8 *)(lVar2 + 0x28) = 1;
  }
  thunk_FUN_1403a67b0(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_1403a6e80(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 = 0x1403a6e8e;
  local_19a0 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_1a08;
  if (*(longlong *)(param_2 + 0xc80) == 0) {
    FUN_14034f420(local_19e8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_19e8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*(int *)(param_2 + 0xc8c) < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  lVar3 = 0;
  *(undefined4 *)(param_2 + 0xc88) = 0;
  FUN_140058870(param_3,0x13);
  FUN_140058870(param_3,(char)*param_1);
  if (*param_1 == 1) {
    FUN_140058470(param_3,param_1[1]);
    if (*(longlong *)(param_1 + 2) == 0) {
      if (*(longlong *)(param_1 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      iVar2 = param_1[6];
    }
    else {
      iVar2 = *(int *)(*(longlong *)(param_1 + 2) + 0x18);
    }
    FUN_140385580(param_3,(longlong)iVar2);
    FUN_140361500(local_1948,param_3);
    FUN_1403607b0(param_2,local_1948);
    if (local_cc8 == 0) {
      FUN_14034f420(local_19e8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_19e8,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_cbc < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_cc0 = 0;
    lVar1 = *(longlong *)(param_1 + 2);
    if ((lVar1 == 0) && (*(longlong *)(param_1 + 4) == 0)) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    if (*(longlong *)(param_1 + 4) == 0) {
      if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      if (*(int *)(lVar1 + 0x18) != 0) {
        lVar3 = *(longlong *)(lVar1 + 0x10);
      }
    }
    else {
      lVar3 = *(longlong *)(param_1 + 4);
      if (lVar3 == 0) {
        FUN_14034f420(local_1998,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_1998,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    FUN_140360720(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_14034f7d0();
    }
    FUN_1403a7790(lVar3,param_3);
    FUN_140058470(param_3,param_1[0xd]);
    FUN_140058470(param_3,param_1[0xc]);
    FUN_140361500(local_cb8,param_3);
    FUN_1403607b0(param_2,local_cb8);
    if (local_38 == 0) {
      FUN_14034f420(local_19e8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_19e8,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_2c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return;
}



void FUN_1403a7100(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar2 = FUN_140385ff0();
      plVar1 = *(longlong **)(param_1 + 8);
      lVar3 = (longlong)iVar2;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_14034fef0(lVar3 << 3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 8))(plVar1,lVar3 << 3);
        }
      }
      else {
        if (plVar1 == (longlong *)0x0) {
          lVar3 = FUN_14034ff20(*(undefined8 *)(param_1 + 0x10),lVar3 << 3);
        }
        else {
          lVar3 = (**(code **)(*plVar1 + 0x10))(plVar1,*(undefined8 *)(param_1 + 0x10),lVar3 << 3);
        }
        if (lVar3 == 0) {
          FUN_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      *(longlong *)(param_1 + 0x10) = lVar3;
      *(int *)(param_1 + 0x1c) = iVar2;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_1403a71d0(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_140399790();
    }
    iVar4 = (int)param_2[2];
  }
  else {
    iVar4 = *(int *)(lVar1 + 0x18);
  }
  if (iVar4 < param_3 + param_4) {
                    // WARNING: Subroutine does not return
    FUN_14034f800();
  }
  if ((0 < param_4) && (param_1[1] == 0)) {
    lVar2 = *param_1;
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    if (*(int *)(lVar2 + 0x18) == 0) {
      lVar2 = 0;
    }
    else {
      lVar2 = *(longlong *)(lVar2 + 0x10);
    }
    if (lVar2 == 0) goto LAB_1403a725e;
  }
  _Dst = (void *)param_2[1];
  pvVar3 = _Dst;
  if (_Dst == (void *)0x0) {
    if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
      }
      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_140399790();
      }
      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_1403a725e:
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



ulonglong FUN_1403a72e0(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_140384780(param_2,local_res18);
  if ((char)uVar3 == '\0') {
    return uVar3;
  }
  FUN_1403a7100(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_14034f800();
      }
      lVar1 = *(longlong *)(param_1 + 0x10);
      uVar3 = FUN_1403840e0(param_2,local_res18,1);
      if ((char)uVar3 == '\0') goto LAB_1403a73fd;
      if ((char)local_res18[0] == '\0') {
        uVar3 = FUN_1403840e0(param_2,local_res20,4);
        if ((char)uVar3 == '\0') {
LAB_1403a73f6:
          *(undefined4 *)(lVar1 + lVar4 * 8) = 0;
LAB_1403a73fd:
          return uVar3 & 0xffffffffffffff00;
        }
        *(undefined4 *)(lVar1 + lVar4 * 8) = local_res20[0];
        uVar2 = local_res20[0];
      }
      else {
        uVar3 = FUN_1403840e0(param_2,&local_28,4);
        if ((char)uVar3 == '\0') goto LAB_1403a73f6;
        *(undefined4 *)(lVar1 + lVar4 * 8) = local_28;
        uVar3 = FUN_1403840e0(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_1403a7410(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_14034f420(local_50,PTR_u_exception_due_to_using_external_b_1405d94c8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  param_2[2] = 0;
  param_2[1] = 0;
  *param_2 = 0;
  if (*param_1 != 0) {
    FUN_140383bf0(param_2);
    if (*param_1 == 0) {
      if (param_1[1] == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      iVar3 = (int)param_1[2];
    }
    else {
      iVar3 = *(int *)(*param_1 + 0x18);
    }
    if (iVar3 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (param_2[1] == 0) {
      lVar2 = *param_2;
      if (iVar3 < 1) {
        if (lVar2 == 0) goto LAB_1403a74d8;
        iVar3 = 0;
      }
      else if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      FUN_1400179d0(lVar2,iVar3);
    }
    else {
      if (*(int *)((longlong)param_2 + 0x14) < iVar3) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(int *)(param_2 + 2) = iVar3;
    }
LAB_1403a74d8:
    if (*param_1 != 0) {
      uVar1 = *(undefined4 *)(*param_1 + 0x18);
      goto LAB_1403a74f7;
    }
  }
  if (param_1[1] == 0) {
                    // WARNING: Subroutine does not return
    FUN_140399790();
  }
  uVar1 = (undefined4)param_1[2];
LAB_1403a74f7:
  FUN_1403a71d0(param_1,param_2,0,uVar1,uVar4);
  return param_2;
}



void FUN_1403a7520(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_1403a7100(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_14034f800();
    }
    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_14034f7d0();
        }
        iVar3 = *(int *)(param_1 + 0x18);
        FUN_1403a7100(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_1403a7670(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_14035f6d0(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_14034f800();
      }
      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_14034f7d0();
        }
        iVar3 = *(int *)(param_2 + 0x18);
        FUN_14035f6d0(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_1403a7790(longlong param_1,undefined8 param_2)

{
  ulonglong uVar1;
  int iVar2;
  ulonglong uVar3;
  uint uVar4;
  ulonglong uVar5;
  
  FUN_140385580(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_14034f800();
      }
      uVar1 = *(ulonglong *)(*(longlong *)(param_1 + 0x10) + uVar3 * 8);
      if ((int)uVar1 == (int)(uVar1 >> 0x20)) {
        FUN_140058870(param_2,0);
      }
      else {
        FUN_140058870(param_2,1);
        FUN_140058470(param_2,uVar1 & 0xffffffff);
      }
      FUN_140058470(param_2);
      iVar2 = *(int *)(param_1 + 0x18);
      uVar4 = (int)uVar5 + 1;
      uVar3 = uVar3 + 1;
      uVar5 = (ulonglong)uVar4;
    } while ((int)uVar4 < iVar2);
  }
  return;
}



longlong * FUN_1403a7840(longlong param_1,longlong *param_2,undefined8 param_3,undefined8 param_4)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  
  lVar4 = 0;
  FUN_14036dde0(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_1403a7100(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_14000d3f0(lVar4,lVar2,(longlong)iVar1 << 3);
    return param_2;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_1403a78f0(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_140399690(param_2 + 2);
      if (local_30 != (longlong *)0x0) {
        local_30[5] = local_30[5] + 1;
        *(longlong **)(param_2 + 2) = local_30;
      }
    }
    FUN_140399690(&local_30);
    if ((local_28 != (longlong *)0x0) && (local_20 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  else {
    plVar5 = (longlong *)FUN_1403a7410(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_140399690(param_2 + 2);
      if (*plVar5 != 0) {
        plVar1 = (longlong *)(*plVar5 + 0x28);
        *plVar1 = *plVar1 + 1;
        *(longlong *)(param_2 + 2) = *plVar5;
      }
    }
    FUN_140399690(&local_30);
    if ((local_28 != (longlong *)0x0) && (local_20 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  *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_140363af0(param_2 + 8,*(undefined8 *)(param_2 + 8));
      }
    }
    *(undefined8 *)(param_2 + 8) = 0;
    *(undefined8 *)(param_2 + 10) = param_3;
  }
  else {
    plVar5 = (longlong *)FUN_1403a7840(*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_140363af0(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_14034ff60();
          }
          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_1403a7b30(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_1403a7bc0(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_1403a7ca0(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_1403a7c80;
  local_30 = &LAB_1403a7c90;
  local_28 = 0;
  local_68 = param_3;
  local_60 = param_4;
  local_58 = param_1;
  uVar2 = FUN_1403cbc90(&local_68,0xffffffff,"1.2.5",0x58);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1403cb0e0(&local_68,4);
    uVar2 = (ulonglong)uVar1;
    if (uVar1 != 1) {
      FUN_1403c9930(&local_68);
      if (uVar1 == 0) {
        uVar2 = 0xfffffffb;
      }
      return uVar2;
    }
    *param_2 = local_4c;
    uVar2 = FUN_1403c9930(&local_68);
  }
  return uVar2;
}



ulonglong FUN_1403a7d60(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_1403a7c80;
  local_30 = &LAB_1403a7c90;
  local_68 = param_3;
  local_60 = param_4;
  local_58 = param_1;
  uVar2 = FUN_1403a8070(&local_68,"1.2.5",0x58);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1403a8510(&local_68,4);
    if (uVar1 != 1) {
      FUN_1403a8180(&local_68);
      if ((uVar1 != 2) && ((uVar1 != 0xfffffffb || (local_60 != 0)))) {
        return (ulonglong)uVar1;
      }
      return 0xfffffffd;
    }
    *param_2 = local_4c;
    uVar2 = FUN_1403a8180(&local_68);
  }
  return uVar2;
}



int FUN_1403a7e30(uint param_1)

{
  return (param_1 >> 0xc) + 0xd + (param_1 >> 0xe) + param_1 + (param_1 >> 0x19);
}



undefined8 FUN_1403a7e50(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_1403a7ed0(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_1403a7e50(param_1);
    }
    else {
      uVar2 = 0xfffffffe;
    }
    return uVar2;
  }
  return 0xfffffffe;
}



int FUN_1403a7f80(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_1403cbcd0;
      }
      pcVar2 = *(code **)(param_1 + 0x38);
      if (pcVar2 == (code *)0x0) {
        pcVar2 = FUN_1403cbce0;
      }
      *(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_1403a7ed0(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_1403a8070(undefined8 param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_1403a7f80(param_1,0xf,param_2,param_3);
  return;
}



undefined8 FUN_1403a8080(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_1403a8180(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_1403a81e0(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_140460ce0 + (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_1404610e0 + (ulonglong)(byte)(param_1 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(param_1 >> 8) * 4) ^
              *(uint *)(&DAT_140460ce0 + (ulonglong)(param_1 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404618e0 + (ulonglong)(param_1 & 0xff) * 4) ^ puVar3[1];
      uVar2 = *(uint *)(&DAT_1404610e0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140460ce0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404618e0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[2];
      uVar2 = *(uint *)(&DAT_1404610e0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140460ce0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404618e0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[3];
      uVar2 = *(uint *)(&DAT_1404610e0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140460ce0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404618e0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[4];
      uVar2 = *(uint *)(&DAT_1404610e0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140460ce0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404618e0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[5];
      param_2 = puVar3 + 8;
      param_3 = param_3 - 0x20;
      uVar2 = *(uint *)(&DAT_1404610e0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140460ce0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404618e0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[6];
      uVar2 = *(uint *)(&DAT_1404610e0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
              *(uint *)(&DAT_140460ce0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404618e0 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar3[7];
      param_1 = *(uint *)(&DAT_1404610e0 + (ulonglong)(byte)(uVar2 >> 0x10) * 4) ^
                *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(uVar2 >> 8) * 4) ^
                *(uint *)(&DAT_140460ce0 + (ulonglong)(uVar2 >> 0x18) * 4) ^
                *(uint *)(&DAT_1404618e0 + (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_1404610e0 + (ulonglong)(byte)(param_1 >> 0x10) * 4) ^
                *(uint *)(&DAT_1404614e0 + (ulonglong)(byte)(param_1 >> 8) * 4) ^
                *(uint *)(&DAT_140460ce0 + (ulonglong)(param_1 >> 0x18) * 4) ^
                *(uint *)(&DAT_1404618e0 + (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_140460ce0 + (ulonglong)(byte)((byte)uVar2 ^ (byte)param_1) * 4) ^
              param_1 >> 8;
  }
  return ~param_1;
}



undefined8 FUN_1403a8500(undefined8 param_1,longlong param_2)

{
  undefined8 uVar1;
  
  if (param_2 == 0) {
    return 0;
  }
  uVar1 = FUN_1403a81e0();
  return uVar1;
}



int FUN_1403a8510(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_1403a8dae;
          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_1403a86af;
            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_1403c95a0(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_1403a8500(0,0,0);
          puVar2[6] = uVar16;
          local_68 = 0x8b1f;
          uVar16 = FUN_1403a81e0(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_1403a8dae;
        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_1403a81e0(puVar2[6],&local_68);
            puVar2[6] = uVar16;
          }
          *puVar2 = 2;
          uVar7 = uVar21;
          uVar8 = uVar21;
          do {
            uVar13 = 0;
            uVar12 = local_64;
            if (uVar15 == 0) goto LAB_1403a8dae;
            bVar1 = *_Src;
            uVar16 = uVar7 + 8;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
joined_r0x0001403a87f6:
            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_1403a81e0(puVar2[6],&local_68);
            puVar2[6] = uVar16;
          }
          *puVar2 = 3;
          uVar7 = uVar21;
          uVar8 = uVar21;
          do {
            uVar13 = 0;
            uVar12 = local_64;
            if (uVar15 == 0) goto LAB_1403a8dae;
            bVar1 = *_Src;
            uVar16 = uVar7 + 8;
            uVar15 = uVar15 - 1;
            _Src = _Src + 1;
            uVar8 = uVar8 + ((uint)bVar1 << ((byte)uVar7 & 0x1f));
joined_r0x0001403a8877:
            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_1403a81e0(puVar2[6],&local_68);
            puVar2[6] = uVar16;
          }
          *puVar2 = 4;
          uVar7 = uVar21;
          uVar8 = uVar21;
          goto switchD_1403a85d1_caseD_4;
        }
        param_1[4] = (longlong)"unknown header flags set";
        *puVar2 = 0x1d;
      }
      else {
LAB_1403a86af:
        param_1[4] = (longlong)"unknown compression method";
        *puVar2 = 0x1d;
      }
      break;
    case 2:
      uVar16 = uVar7;
      goto joined_r0x0001403a87f6;
    case 3:
      uVar16 = uVar7;
      goto joined_r0x0001403a8877;
    case 4:
switchD_1403a85d1_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_1403a8dae;
          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_1403a81e0(puVar2[6],&local_68);
          puVar2[6] = uVar8;
        }
      }
      uVar8 = uVar16;
      *puVar2 = 5;
    case 5:
      if ((puVar2[4] & 0x400) == 0) {
LAB_1403a8a13:
        puVar2[0x12] = 0;
        *puVar2 = 6;
switchD_1403a85d1_caseD_6:
        if ((puVar2[4] & 0x800) == 0) {
          if (*(longlong *)(puVar2 + 8) != 0) {
            *(undefined8 *)(*(longlong *)(puVar2 + 8) + 0x20) = 0;
          }
LAB_1403a8abe:
          puVar2[0x12] = 0;
          *puVar2 = 7;
switchD_1403a85d1_caseD_7:
          uVar22 = 0;
          if ((puVar2[4] & 0x1000) == 0) {
            if (*(longlong *)(puVar2 + 8) != 0) {
              *(undefined8 *)(*(longlong *)(puVar2 + 8) + 0x30) = 0;
            }
LAB_1403a8b5e:
            *puVar2 = 8;
            puVar19 = local_58;
            uVar11 = local_res20;
switchD_1403a85d1_caseD_8:
            if ((puVar2[4] & 0x200) != 0) {
              for (; uVar7 < 0x10; uVar7 = uVar7 + 8) {
                uVar13 = 0;
                uVar12 = local_64;
                if (uVar15 == 0) goto LAB_1403a8dae;
                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_1403a8500(0,0,0);
            puVar2[6] = uVar16;
            *(uint *)((longlong)param_1 + 0x4c) = uVar16;
LAB_1403a8bf9:
            *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_1403a81e0(puVar2[6],_Src);
              }
              puVar2[6] = uVar11;
            }
            uVar15 = uVar15 - uVar16;
            _Src = _Src + uVar22;
            uVar13 = uVar15;
            uVar12 = local_64;
            if (bVar1 == 0) goto LAB_1403a8b5e;
          }
        }
        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_1403a81e0(puVar2[6],_Src);
              }
              puVar2[6] = uVar16;
            }
            uVar13 = uVar15 - uVar13;
            _Src = _Src + uVar22;
            uVar15 = uVar13;
            uVar12 = local_64;
            if (bVar1 == 0) goto LAB_1403a8abe;
          }
        }
      }
      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_1403a81e0(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_1403a8a13;
      }
LAB_1403a8dae:
      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_1403a8080(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_1403c95a0(puVar2[6],param_1[2] - (ulonglong)uVar16);
          }
          else if (param_1[2] == (ulonglong)uVar16) {
            uVar8 = 0;
          }
          else {
            uVar8 = FUN_1403a81e0();
          }
          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_1403a8e09:
      return -4;
    case 6:
      goto switchD_1403a85d1_caseD_6;
    case 7:
      goto switchD_1403a85d1_caseD_7;
    case 8:
      goto switchD_1403a85d1_caseD_8;
    case 9:
      for (; uVar7 < 0x20; uVar7 = uVar7 + 8) {
        uVar13 = 0;
        if (uVar15 == 0) goto LAB_1403a8dae;
        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_1403c95a0(0,0);
      puVar2[6] = uVar16;
      *(uint *)((longlong)param_1 + 0x4c) = uVar16;
      *puVar2 = 0xb;
      puVar19 = local_58;
      uVar11 = local_res20;
switchD_1403a85d1_caseD_b:
      uVar13 = uVar15;
      uVar12 = local_64;
      if ((param_2 != 5) && (param_2 != 6)) {
switchD_1403a85d1_caseD_c:
        if (puVar2[1] == 0) {
          for (; uVar12 = local_64, uVar7 < 3; uVar7 = uVar7 + 8) {
            uVar13 = 0;
            if (uVar15 == 0) goto LAB_1403a8dae;
            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_1403a8e35;
                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_140460430;
            *puVar2 = 0x13;
            *(undefined **)(puVar2 + 0x18) = &DAT_140460c30;
            if (param_2 == 6) {
              uVar8 = uVar8 >> 3;
              uVar7 = uVar7 - 3;
              uVar13 = uVar15;
              goto LAB_1403a8dae;
            }
          }
LAB_1403a8e35:
          uVar7 = uVar7 - 3;
          uVar8 = uVar8 >> 3;
        }
        else {
          *puVar2 = 0x1a;
          uVar16 = uVar7 & 7;
          uVar7 = uVar7 - uVar16;
          uVar8 = uVar8 >> (sbyte)uVar16;
        }
        break;
      }
      goto LAB_1403a8dae;
    case 0xb:
      goto switchD_1403a85d1_caseD_b;
    case 0xc:
      goto switchD_1403a85d1_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_1403a8dae;
        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_1403a85d1_caseD_e;
        goto LAB_1403a8dae;
      }
      param_1[4] = (longlong)"invalid stored block lengths";
      *puVar2 = 0x1d;
      break;
    case 0xe:
switchD_1403a85d1_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_1403a8dae;
    case 0x10:
      for (; uVar7 < 0xe; uVar7 = uVar7 + 8) {
        uVar13 = 0;
        if (uVar15 == 0) goto LAB_1403a8dae;
        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_1403a85d1_caseD_11;
      }
      param_1[4] = (longlong)"too many length or distance symbols";
      *puVar2 = 0x1d;
      break;
    case 0x11:
switchD_1403a85d1_caseD_11:
      if (puVar2[0x1f] < puVar2[0x1c]) {
        do {
          for (; uVar7 < 3; uVar7 = uVar7 + 8) {
            uVar13 = 0;
            if (uVar15 == 0) goto LAB_1403a8dae;
            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_140460cb0 + (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_140460cb0 + (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_1403cd4d0(0,puVar2 + 0x22,0x13,puVar2 + 0x20,puVar2 + 0x1a,puVar2 + 0xc2);
      if (local_res18 == 0) {
        puVar2[0x1f] = 0;
        *puVar2 = 0x12;
        uVar11 = local_res20;
        goto switchD_1403a85d1_caseD_12;
      }
      param_1[4] = (longlong)"invalid code lengths set";
      *puVar2 = 0x1d;
      puVar19 = local_58;
      uVar11 = local_res20;
      break;
    case 0x12:
switchD_1403a85d1_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_1403a8dae;
              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_1403a8dae;
                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_1403a92b0;
              }
            }
            else {
              if (uVar10 == 0x11) {
                for (; uVar7 < local_64._1_1_ + 3; uVar7 = uVar7 + 8) {
                  uVar13 = 0;
                  if (uVar15 == 0) goto LAB_1403a8dae;
                  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_1403a8dae;
                  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_1403a92b0:
              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_1403a92e5;
              }
            }
            param_1[4] = (longlong)"invalid bit length repeat";
            *puVar2 = 0x1d;
            goto LAB_1403a8c08;
          }
          uVar16 = uVar7;
          if (uVar7 < (uVar12 >> 8 & 0xff)) {
            do {
              uVar7 = uVar16;
              uVar13 = 0;
              if (uVar15 == 0) goto LAB_1403a8dae;
              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_1403a92e5:
        } 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_1403cd4d0(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_1403cd4d0(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_1403a85d1_caseD_13;
              goto LAB_1403a8dae;
            }
            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_1403a85d1_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_1403cbcf0(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_1403a8dae;
          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_1403a8dae;
            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_1403a8bf9;
      }
      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_1403a85d1_caseD_15:
      uVar16 = puVar2[0x14];
      if (uVar16 != 0) {
        uVar11 = uVar7;
        if (uVar7 < uVar16) {
          do {
            uVar13 = 0;
            uVar12 = local_64;
            if (uVar15 == 0) goto LAB_1403a8dae;
            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_1403a85d1_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_1403a8dae;
          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_1403a8dae;
            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_1403a85d1_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_1403a8dae;
            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_1403a85d1_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_1403a9905;
        }
        else {
          lVar14 = (longlong)puVar19 - (ulonglong)uVar16;
          uVar12 = puVar2[0x12];
LAB_1403a9905:
          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_1403a8dae;
    case 0x15:
      goto switchD_1403a85d1_caseD_15;
    case 0x16:
      goto switchD_1403a85d1_caseD_16;
    case 0x17:
      goto switchD_1403a85d1_caseD_17;
    case 0x18:
      goto switchD_1403a85d1_caseD_18;
    case 0x19:
      if (uVar11 == 0) goto LAB_1403a8dae;
      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_1403a8dae;
          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_1403c95a0(puVar2[6],(longlong)puVar19 - (longlong)(ulonglong)uVar8);
            puVar19 = local_58;
            uVar11 = local_res20;
          }
          else {
            uVar7 = uVar21;
            if (puVar19 != (undefined1 *)(ulonglong)uVar8) {
              uVar7 = FUN_1403a81e0(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_1403a8dae;
          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_1403a85d1_caseD_1c:
      local_res18 = 1;
      uVar13 = uVar15;
      uVar12 = local_64;
      goto LAB_1403a8dae;
    case 0x1c:
      goto switchD_1403a85d1_caseD_1c;
    case 0x1d:
      local_res18 = -3;
      goto LAB_1403a8dae;
    case 0x1e:
      goto LAB_1403a8e09;
    }
LAB_1403a8c08:
    uVar16 = *puVar2;
  } while( true );
}



void FUN_1403a9c50(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_1403a9c90(double *param_1,double param_2)

{
  double dVar1;
  
  if (param_2 <= 0.0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  dVar1 = param_1[1];
  param_1[1] = param_2;
  *param_1 = (param_2 / dVar1) * *param_1;
  return;
}



void FUN_1403a9cc0(double *param_1)

{
  *(undefined1 *)(param_1 + 2) = 0;
  *param_1 = param_1[1] * 0.3;
  return;
}



double * FUN_1403a9ce0(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;
}



undefined8 FUN_1403a9d00(undefined8 param_1)

{
  HRESULT HVar1;
  
  HVar1 = CoInitialize((LPVOID)0x0);
  *(bool *)param_1 = -1 < HVar1;
  return param_1;
}



void FUN_1403a9d30(char *param_1)

{
  if (*param_1 != '\0') {
    CoUninitialize();
  }
  return;
}



undefined8 * FUN_1403a9d50(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_1403a9d90(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 0x0001403a9db8. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(**(longlong **)(param_1 + 0x10) + 0x18))();
      return;
    }
    FUN_14034ff60(*(longlong *)(param_1 + 0x18));
  }
  return;
}



void FUN_1403a9dd0(longlong param_1)

{
  int iVar1;
  
  if (0xffffffff < *(longlong *)(param_1 + 0x30) + 0x80000000U) {
                    // WARNING: Subroutine does not return
    FUN_14034f830(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_14034f800();
        }
        memmove(*(void **)(param_1 + 0x18),
                (void *)((longlong)*(void **)(param_1 + 0x18) + (longlong)iVar1),
                *(size_t *)(param_1 + 0x38));
        goto LAB_1403a9e22;
      }
    }
                    // WARNING: Subroutine does not return
    FUN_14034f800();
  }
LAB_1403a9e22:
  *(undefined8 *)(param_1 + 0x30) = 0;
  return;
}



void FUN_1403a9e50(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_14034f830(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_14034f800();
    }
    _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_1403a9f19;
    }
  }
  else {
    if ((0 < lVar2) && (0 < (int)param_1[4])) {
      FUN_1403a9dd0(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_14034f830(L"Proud::CStreamQueue::PushBack_Copy");
      }
      FUN_1400179d0(param_1 + 1,(int)*param_1 + param_3 + (int)param_1[7]);
    }
    if (0xffffffff < param_1[7] + 0x80000000U) {
                    // WARNING: Subroutine does not return
      FUN_14034f830(L"Proud::CStreamQueue::PushBack_Copy");
    }
    iVar4 = (int)param_1[7];
    if ((iVar4 < 0) || ((int)param_1[4] <= iVar4)) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    _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_1403a9f19;
    }
  }
  memcpy(_Dst,param_2,_Size);
LAB_1403a9f19:
  param_1[7] = param_1[7] + _Size;
  return;
}



longlong FUN_1403aa040(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_1403a9dd0();
  }
  return param_2;
}



undefined8 * FUN_1403aa080(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;
}



long FUN_1403aa0a0(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_1403aa0d0(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_140463380 + (ulonglong)((bVar1 ^ uVar2) & 0xff) * 4) ^ uVar2 >> 8;
  }
  return ~uVar2;
}



undefined8 * FUN_1403aa120(undefined8 *param_1)

{
  param_1[1] = 0;
  *param_1 = Proud::IHeartbeatWork::vftable;
  return param_1;
}



void FUN_1403aa140(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                 );
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                   );
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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_1403aa220(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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                     );
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase"
                     );
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      *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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                L"Proud::CListNode<class Proud::CHeartbeatWorkThread::WorkData>::CListOwner::Erase")
  ;
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_1403aa310(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_14034ed40(param_1);
      uVar6 = 1;
      DVar3 = GetTickCount();
      puVar2 = (undefined8 *)*plVar1;
      if ((puVar2 == (undefined8 *)0x0) ||
         (DVar3 - *(int *)(puVar2 + 4) <= *(uint *)((longlong)puVar2 + 0x24))) {
        FUN_14034edd0(param_1);
      }
      else {
        *(DWORD *)(puVar2 + 4) = DVar3;
        if (puVar2[2] != 0) {
          FUN_1403aa140(puVar2[2],puVar2,param_3,param_4,uVar4,lVar5,uVar6);
        }
        if (puVar2[2] != 0) {
          FUN_1403aa140(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_14034edd0(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_1403aa220(void)

{
  FUN_1403aa220();
  return;
}



void FUN_1403aa420(longlong param_1,longlong param_2,undefined4 param_3)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  FUN_14034ed40();
  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_1403aa140(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_14034edd0(param_1);
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_1403aa500(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_14034ed40();
  if (*(longlong *)(param_2 + 8) != 0) {
    if (*(longlong *)(param_2 + 8) != param_1) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    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_1403aa140(*(longlong *)((longlong)pvVar2 + 0x10),pvVar2,param_3,param_4,uVar3,lVar4,1)
          ;
        }
        FUN_14034edd0(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_1403aa140(*(longlong *)((longlong)pvVar2 + 0x10),pvVar2,param_3,param_4,uVar3,lVar4,
                        uVar5);
        }
        operator_delete(pvVar2);
        return;
      }
    }
  }
  FUN_14034edd0(param_1);
  return;
}



void FUN_1403aa5e0(longlong param_1)

{
  undefined8 *puVar1;
  longlong *plVar2;
  undefined8 uVar3;
  int iVar4;
  longlong lVar5;
  
  FUN_14034ed40();
  if (0 < *(int *)(param_1 + 0x48)) {
    FUN_14034fa20(
                 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_14034f800();
      }
      puVar1 = *(undefined8 **)(*(longlong *)(param_1 + 0x60) + lVar5 * 8);
      uVar3 = 0;
      if (puVar1 != (undefined8 *)0x0) {
        uVar3 = *puVar1;
      }
      FUN_140357460(uVar3);
      iVar4 = iVar4 + 1;
      lVar5 = lVar5 + 1;
    } while (iVar4 < *(int *)(param_1 + 0x68));
  }
  FUN_14034edd0(param_1);
  *(undefined ***)(param_1 + 0x50) = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 0x68)) {
    FUN_14036f5c0(*(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_14034ff60();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,*(longlong *)(param_1 + 0x60));
    }
  }
  FUN_1403aa220(param_1 + 0x38);
  FUN_14034edf0(param_1);
  return;
}



longlong FUN_1403aa6e0(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_1403c0cc0();
  FUN_14034ec60(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_14034f860();
  if (0 < iVar8) {
    do {
      lVar9 = 0;
      local_res18 = operator_new(0x28);
      if (local_res18 != (longlong *)0x0) {
        lVar9 = FUN_1403573d0(local_res18,&LAB_1403aa4f0,param_1);
      }
      if (lVar9 == 0) {
        local_res18 = (longlong *)0x0;
      }
      else {
        local_res18 = (longlong *)FUN_14034fef0(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_14034f7d0();
      }
      iVar14 = *(int *)(param_1 + 0x68);
      FUN_14038e3d0(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_1403a2c90(puVar2);
          lVar11 = FUN_1403a2c90(puVar2);
          FUN_14038a5f0(lVar9 + lVar11,lVar16 + lVar10);
          lVar16 = lVar16 + -8;
          lVar9 = lVar9 + -8;
          iVar14 = iVar14 + -1;
        } while (-1 < iVar14);
      }
      lVar9 = FUN_1403a2c90(puVar2);
      FUN_14038a5f0(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_1403574e0(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_14034ff60(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_14034f800();
      }
      puVar5 = *(ulonglong **)(*(longlong *)(param_1 + 0x60) + uVar13 * 8);
      uVar12 = uVar17;
      if (puVar5 != (ulonglong *)0x0) {
        uVar12 = *puVar5;
      }
      FUN_1403575d0(uVar12);
      uVar15 = (ulonglong)((int)uVar15 + 1);
      uVar13 = uVar13 + 1;
    } while ((longlong)uVar13 < (longlong)iVar8);
  }
  return param_1;
}



undefined8 FUN_1403aa930(undefined8 param_1,undefined4 *param_2)

{
  FUN_140058470(param_1,*param_2);
  FUN_140017c50(param_1,*(undefined2 *)(param_2 + 1));
  FUN_1403859e0(param_1,param_2 + 2);
  FUN_140058870(param_1,*(undefined1 *)(param_2 + 4));
  return param_1;
}



void FUN_1403aa980(undefined8 *param_1)

{
  *param_1 = Proud::ISendDest_C::vftable;
  return;
}



undefined8 * FUN_1403aa990(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_1403aa9c0(undefined8 *param_1)

{
  *param_1 = Proud::IP2PGroupMember::vftable;
  return;
}



undefined8 * FUN_1403aa9d0(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_1403aaa00(undefined8 *param_1)

{
  *param_1 = Proud::CP2PConnectionTrialContext::StateBase::vftable;
  return;
}



undefined8 * FUN_1403aaa10(undefined8 *param_1,byte param_2)

{
  *param_1 = Proud::CP2PConnectionTrialContext::StateBase::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403aaa40(undefined8 *param_1)

{
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



undefined8 FUN_1403aaa50(void)

{
  return 64000;
}



void FUN_1403aaa60(undefined8 *param_1)

{
  param_1[2] = 0;
  param_1[1] = Proud::IP2PGroupMember::vftable;
  *param_1 = Proud::ISendDest_C::vftable;
  return;
}



void thunk_FUN_140386850(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_14034f420(auStack_78,PTR_u_Already_async_callback_may_occur_1405d9010);
                    // WARNING: Subroutine does not return
    _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f800();
      }
      plVar1 = *(longlong **)(param_1[3] + lVar11 * 8);
      iVar6 = (**(code **)*plVar1)(plVar1);
      if (0xfff9 < iVar6) {
LAB_140386a1b:
        FUN_14034f420(auStack_78,PTR_u_Wrong_RMI_ID_is_found__RMI_ID_sh_1405d9008);
                    // WARNING: Subroutine does not return
        _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1405d36c0);
      }
      iVar6 = (**(code **)(*plVar1 + 8))(plVar1);
      if (iVar6 < 1) goto LAB_140386a1b;
      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_140386974:
        if ((uVar8 <= uVar9) || ((uVar4 <= uVar9 && (uVar9 <= uVar8)))) goto LAB_1403869f8;
        if (uVar4 <= uVar5) goto LAB_140386989;
      }
      else {
        if (uVar9 <= uVar8) goto LAB_1403869f8;
        if (uVar5 <= uVar4) goto LAB_140386974;
LAB_140386989:
        if ((uVar5 <= uVar8) && (uVar8 <= uVar9)) {
LAB_1403869f8:
          FUN_14034f420(auStack_78,PTR_u_Duplicated_RMI_ID_is_found__Revi_1405d9000);
                    // WARNING: Subroutine does not return
          _CxxThrowException(auStack_78,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      iVar10 = iVar10 + 1;
      lVar11 = lVar11 + 1;
    } while (iVar10 < (int)param_1[4]);
  }
  param_2[1] = (longlong)param_1;
  FUN_1403861d0(param_1 + 1,(int)param_1[4],&plStackX_10,1);
  return;
}



void thunk_FUN_140385b20(void)

{
  FUN_140385b20();
  return;
}



undefined8 FUN_1403aaaa0(void)

{
  return 65000;
}



undefined8 FUN_1403aaab0(void)

{
  return 0xfded;
}



undefined8 FUN_1403aaac0(void)

{
  return 0xfbf4;
}



undefined8 FUN_1403aaad0(void)

{
  return 0xfc08;
}



undefined8 FUN_1403aaae0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x1580);
}



void FUN_1403aaaf0(longlong param_1,double param_2)

{
  undefined1 local_58 [88];
  
  if (param_2 <= 0.0) {
    FUN_14034f420(local_58,L"Invalid parameter!");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  *(double *)(param_1 + 0x1728) = param_2;
  return;
}



undefined4 FUN_1403aab30(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x628);
}



void FUN_1403aab40(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_14034f420(local_58,PTR_u_Already_async_callback_may_occur_1405d9010);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  (**(code **)(*(longlong *)(param_1 + 8) + 0x18))(param_1 + 8);
  *(undefined8 *)(param_1 + 0x1510) = param_2;
  return;
}



undefined4 FUN_1403aabb0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x6a4);
}



undefined4 FUN_1403aabc0(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x624);
}



void FUN_1403aabd0(longlong param_1,undefined2 *param_2)

{
  *param_2 = *(undefined2 *)(param_1 + 0x1858);
  *(undefined1 *)(param_2 + 1) = *(undefined1 *)(param_1 + 0x185a);
  return;
}



void FUN_1403aabf0(longlong param_1,undefined8 *param_2)

{
  *(undefined8 *)(param_1 + 0x1800) = *param_2;
  return;
}



void FUN_1403aac00(longlong param_1,undefined8 *param_2)

{
  *param_2 = *(undefined8 *)(param_1 + 0x1870);
  return;
}



undefined8 FUN_1403aac10(longlong *param_1)

{
  if ((undefined8 *)*param_1 != (undefined8 *)0x0) {
    return *(undefined8 *)*param_1;
  }
  return 0;
}



void FUN_1403aac20(longlong *param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if (*(longlong **)(param_2 + 0xb0) != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::CNetClientImpl>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CNetClientImpl>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if (*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CNetClientImpl>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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;
}



void FUN_1403aad10(longlong *param_1)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 * FUN_1403aad30(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_1405d84f0 ^ (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_1405d80e8;
  *(undefined4 *)(param_1 + 1) = 1;
  param_1[2] = 0;
  param_1[3] = 0;
  local_38 = param_1;
  puVar1 = (undefined4 *)FUN_140357640(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_1403aade0(void *param_1,uint param_2)

{
  FUN_140385b20();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1403aae10(void)

{
  return 1;
}



void FUN_1403aae20(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001403aae2c. 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_1403aae30(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_1403aae70(longlong param_1)

{
  FUN_1403aae30(param_1 + -8);
  return;
}



undefined8 FUN_1403aae80(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_14034ed40(uVar1);
  FUN_14034edd0(uVar1);
  return 1;
}



undefined8 FUN_1403aaeb0(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_14034ed40(uVar1);
  *(undefined1 *)(*(longlong *)(param_1 + 0x20) + 0x1790) = 1;
  FUN_14034edd0(uVar1);
  return 1;
}



undefined8 FUN_1403aaf00(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_14034ed40(uVar1);
  *(undefined1 *)(*(longlong *)(param_1 + 0x20) + 0x1790) = 0;
  FUN_14034edd0(uVar1);
  return 1;
}



void * FUN_1403aaf50(void *param_1,uint param_2)

{
  FUN_140388ea0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403aaf80(longlong param_1)

{
  if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
    FUN_1403d7450(**(undefined8 **)(param_1 + 0x1570),0);
    return;
  }
  FUN_1403d7450(0,0);
  return;
}



undefined8 FUN_1403aafa0(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_14034ed40(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_1405f2490,param_4,uVar7,uVar8,uVar9);
  FUN_14034edd0(uVar2);
  return 1;
}



undefined8 FUN_1403ab0a0(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_14034ed40(uVar2);
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0x5d8);
  uVar3 = 0;
  if (lVar1 != 0) {
    uVar3 = *(undefined8 *)(lVar1 + 0x38);
  }
  FUN_1403d1210(uVar3,*param_4);
  FUN_14034edd0(uVar2);
  return 1;
}



undefined8 FUN_1403ab120(longlong param_1,undefined8 param_2,undefined8 param_3,char *param_4)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_14034ed40(uVar1);
  if (*param_4 == '\0') {
    *(double *)(*(longlong *)(param_1 + 0x20) + 0x1890) = DAT_1405d8078;
  }
  else if (*(double *)(*(longlong *)(param_1 + 0x20) + 0x1890) == DAT_1405d8078) {
    *(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x1890) = 0;
  }
  FUN_14034edd0(uVar1);
  return 1;
}



double FUN_1403ab1b0(longlong param_1)

{
  double dVar1;
  undefined8 uVar2;
  double dVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_14034ed40(uVar2);
  dVar3 = (double)FUN_14035a290(param_1 + 0x15b0);
  dVar1 = *(double *)(param_1 + 0x480);
  FUN_14034edd0(uVar2);
  return dVar3 - dVar1;
}



void FUN_1403ab220(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x568) != 0) {
    FUN_1403ce970(*(undefined8 *)(*(longlong *)(param_1 + 0x568) + 0x38));
    return;
  }
  FUN_1403ce970();
  return;
}



undefined8 FUN_1403ab240(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x5d8) != 0) {
    return *(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38) + 0x100);
  }
  return uRam0000000000000100;
}



ulonglong FUN_1403ab270(longlong param_1)

{
  longlong *plVar1;
  ulonglong uVar2;
  
  plVar1 = *(longlong **)(param_1 + 0x5d0);
  if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
    uVar2 = FUN_140388770();
    return uVar2;
  }
  return (ulonglong)plVar1 & 0xffffffffffffff00;
}



undefined4 FUN_1403ab2a0(longlong *param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  
  uVar2 = (**(code **)(*param_1 + 0x58))();
  FUN_14034ed40(uVar2);
  lVar1 = param_1[0x2af];
  FUN_14034edd0(uVar2);
  return (int)lVar1;
}



undefined8 FUN_1403ab2e0(longlong param_1,undefined1 *param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined1 uVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_14034ed40();
  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_1403ab379_default;
  switch(*(undefined4 *)(lVar1 + 0x100)) {
  case 0:
    FUN_14034edd0(uVar2);
    uVar2 = 1;
    break;
  case 1:
    FUN_14034edd0(uVar2);
    uVar2 = 1;
    break;
  case 2:
    FUN_14034edd0(uVar2);
    uVar2 = 2;
    break;
  case 3:
    FUN_14034edd0(uVar2);
    uVar2 = 2;
    break;
  case 4:
    FUN_14034edd0(uVar2);
    uVar2 = 3;
    break;
  case 5:
  default:
switchD_1403ab379_default:
    FUN_14034edd0(uVar2);
    uVar2 = 0;
  }
  return uVar2;
}



longlong FUN_1403ab410(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_1403ab430(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_1403ab450(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_1403ab520(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_1405d83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  return param_2;
}



longlong FUN_1403ab590(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x5d8) != 0) {
    return *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38) + 0x10;
  }
  return 0x10;
}



undefined8 FUN_1403ab5b0(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_14034ed40(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_14034edd0(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_14034edd0(lVar2);
  }
  return uVar5;
}



longlong FUN_1403ab670(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_1403ab690(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))((longlong *)(param_1 + -0x70));
  FUN_14034ed40(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_1405d83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  }
  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_14034edd0(uVar2);
  return param_2;
}



void FUN_1403ab770(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_14034ed40(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_1403db470(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_14034edd0(uVar1);
  return;
}



void FUN_1403ab840(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_140399130(pvVar1,param_1 + 0x98,param_2,param_3,param_4);
    }
    *(undefined8 *)(param_1 + 0x58) = uVar2;
  }
  return;
}



void FUN_1403ab8c0(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_1405f2490);
      if (*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) {
        lVar2 = **(longlong **)(param_1 + 0x1570);
      }
      *(undefined1 *)(lVar2 + 0x40) = 1;
    }
  }
  return;
}



void FUN_1403ab950(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_1403ab9b0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x560) != 0) {
    FUN_1403598f0(*(undefined8 *)(*(longlong *)(*(longlong *)(param_1 + 0x560) + 0x38) + 0x2b8));
    return;
  }
  FUN_1403598f0(uRam00000000000002b8);
  return;
}



undefined8 * FUN_1403ab9e0(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))((longlong *)(param_1 + -0x70));
  FUN_14034ed40(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_1405d83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  }
  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_14034edd0(uVar2);
  return param_2;
}



undefined8 * FUN_1403abac0(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  uVar2 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))((longlong *)(param_1 + -0x70));
  FUN_14034ed40(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_1405d83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  }
  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_14034edd0(uVar2);
  return param_2;
}



void FUN_1403abba0(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_14034ed40(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_14034edd0(uVar2);
  return;
}



void FUN_1403abcb0(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1403aac20(*(longlong *)(param_1 + 0x10),param_1 + -0xa0);
  }
  return;
}



undefined8 * FUN_1403abce0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403abd40(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_14034f7d0();
  }
  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_14034f7d0();
  }
  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;
}



void FUN_1403abea0(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_14035d3c0();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_14034fef0(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_14034fef0(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_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_14034ff60(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_1403ac000(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_1405d8130,&local_30,param_4,0xfffffffffffffffe);
  FUN_1403555d0(&local_30);
  return;
}



void FUN_1403ac060(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 0x0001403ac087. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 *
FUN_1403ac0a0(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_14034ed40();
  plVar1 = *(longlong **)(param_1 + 0x1568);
  if ((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1405d83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  }
  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_140354900(lVar4,param_2,param_3,param_4,uVar5,uVar6,1);
  }
  FUN_14034edd0(uVar2);
  return param_2;
}



ulonglong FUN_1403ac170(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_1405d83d0;
    sVar6 = DAT_1405d83d4;
    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_1405d83d0;
    sVar8 = DAT_1405d83d4;
    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;
}



longlong * FUN_1403ac2a0(longlong *param_1,longlong param_2,longlong param_3)

{
  longlong lVar1;
  
  if (param_2 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (param_1[1] <= param_2) {
    FUN_1403abd40(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_14034f7d0();
}



void FUN_1403ac320(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_1403ac320(param_1,iVar7 + -2,uVar5 & 0xffffffff);
        uVar5 = uVar9;
        local_28 = uVar4;
      }
      else {
        FUN_1403ac320(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_1403ac430(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_1405d84f0 ^ (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_1403dda40(lVar2,param_4,&local_48);
  }
  else {
    FUN_1403ab8c0();
    uVar3 = 0;
    if (*(undefined8 **)(param_1 + 0x1570) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(param_1 + 0x1570);
    }
    FUN_1403d74d0(uVar3,param_2,param_4,param_5);
  }
  FUN_1403606a0(param_4);
  return;
}



void thunk_FUN_1400031d0(void)

{
  FUN_1400031d0();
  return;
}



undefined8 * FUN_1403ac500(undefined8 param_1,undefined8 *param_2)

{
  FUN_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  return param_2;
}



undefined8 * FUN_1403ac530(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_14034fe70();
    *param_2 = PTR_DAT_1405d8010;
    return param_2;
  }
  if (lVar1 != 0) {
    lVar3 = *(longlong *)(lVar1 + 0x38);
  }
  FUN_1403d8790(*(undefined8 *)(lVar3 + 0x2b0));
  return param_2;
}



void FUN_1403ac5a0(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_14034ed40(lVar1);
    bVar4 = true;
    *(longlong *)(*param_1 + 0x40) = *(longlong *)(*param_1 + 0x40) + -1;
    if (*(longlong *)(*param_1 + 0x40) == 0) {
      FUN_14034edd0(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_14034edf0(lVar2);
      FUN_14034ff60(lVar2);
    }
    if (bVar4) {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



void FUN_1403ac650(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_14034ff60(puVar1);
  }
  return;
}



longlong * FUN_1403ac6a0(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_1405d8010;
  }
  iVar3 = iswspace(*pwVar4);
  while (iVar3 != 0) {
    pwVar4 = (wint_t *)FUN_14034fd70(pwVar4);
    iVar3 = iswspace(*pwVar4);
  }
  pwVar1 = (wint_t *)*param_1;
  pwVar5 = pwVar1;
  if (pwVar1 == (wint_t *)0x0) {
    pwVar5 = (wint_t *)PTR_DAT_1405d8010;
  }
  if (pwVar4 == pwVar5) {
    return param_1;
  }
  pwVar5 = pwVar1;
  if (pwVar1 == (wint_t *)0x0) {
    pwVar5 = (wint_t *)PTR_DAT_1405d8010;
  }
  iVar6 = 0;
  iVar3 = 0;
  if (pwVar1 != (wint_t *)0x0) {
    if (pwVar1 != (wint_t *)PTR_DAT_1405d8010) {
      iVar3 = *(int *)(pwVar1 + -4);
    }
    if (pwVar1 != (wint_t *)0x0) {
      iVar7 = 0;
      if (pwVar1 != (wint_t *)PTR_DAT_1405d8010) {
        iVar7 = *(int *)(pwVar1 + -4);
      }
      goto LAB_1403ac73c;
    }
  }
  iVar7 = 0;
LAB_1403ac73c:
  if (((iVar3 <= iVar7) && (iVar3 = iVar6, pwVar1 != (wint_t *)0x0)) &&
     (iVar3 = 0, pwVar1 != (wint_t *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar3 = *(int *)(pwVar1 + -4);
  }
  if (iVar3 < iVar7) {
    FUN_140002d30(param_1,iVar7);
  }
  FUN_140002e10(param_1);
  puVar2 = (undefined *)*param_1;
  iVar3 = (int)((longlong)pwVar4 - (longlong)pwVar5 >> 1);
  _Dst = puVar2;
  if (puVar2 == (undefined *)0x0) {
    _Dst = PTR_DAT_1405d8010;
  }
  iVar7 = 0;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) {
    iVar7 = *(int *)(puVar2 + -8);
  }
  iVar7 = iVar7 - iVar3;
  if (puVar2 == (undefined *)0x0) {
    iVar6 = 0;
  }
  else if (puVar2 != PTR_DAT_1405d8010) {
    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_1405d8010)) {
    iVar3 = *(int *)(puVar2 + -8);
  }
  if ((iVar3 <= iVar6) && (iVar6 = 0, puVar2 != (undefined *)0x0)) {
    if (puVar2 == PTR_DAT_1405d8010) {
      return param_1;
    }
    iVar6 = *(int *)(puVar2 + -8);
  }
  if (((puVar2 != PTR_DAT_1405d8010) && (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,0x0001403ac97d)
// WARNING: Removing unreachable block (ram,0x0001403ac98b)

void FUN_1403ac860(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_14034ed40(uVar3);
    }
    if (uVar4 != 0) {
      uVar10 = 1;
      FUN_14034ed40(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_14034edd0(uVar3);
      uVar8 = 0;
    }
    if (uVar4 != 0) {
      FUN_14034edd0(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_14034edf0(uVar5);
      FUN_14034ff60(uVar5);
    }
  }
  return;
}



void FUN_1403ac9b0(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_14034ff60(puVar2);
    }
  }
  return;
}



void FUN_1403aca30(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_14034ff60(plVar3);
    }
  }
  return;
}



void FUN_1403acab0(longlong *param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  
  FUN_140002f00();
  puVar1 = (undefined *)*param_1;
  iVar2 = 0;
  if (0 < param_2) {
    iVar2 = param_2;
  }
  iVar3 = 0;
  if ((puVar1 != (undefined *)0x0) && (iVar3 = 0, puVar1 != PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(puVar1 + -8);
  }
  if ((iVar3 <= iVar2) && (iVar2 = 0, puVar1 != (undefined *)0x0)) {
    if (puVar1 == PTR_DAT_1405d8010) {
      return;
    }
    iVar2 = *(int *)(puVar1 + -8);
  }
  if (((puVar1 != PTR_DAT_1405d8010) && (puVar1 != (undefined *)0x0)) &&
     ((int *)(puVar1 + -8) != (int *)0x0)) {
    *(int *)(puVar1 + -8) = iVar2;
    *(undefined2 *)(puVar1 + (longlong)iVar2 * 2) = 0;
  }
  return;
}



undefined4 * FUN_1403acb30(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_14034fef0(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_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar4 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar4);
  }
  FUN_14035d100(param_1);
  return puVar5;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403acc70(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_1405d84f0 ^ (ulonglong)local_18;
  if ((ulonglong)param_1[2] < 0x65) {
    plVar4 = param_1 + 4;
  }
  else {
    plVar4 = (longlong *)*param_1;
  }
  FUN_1403ac320(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_1403acd20;
    *puVar3 = 0xcccc;
    puVar9 = auStack_38 + lVar1;
  }
  else {
    puVar3 = malloc(uVar5);
    puVar12 = (undefined8 *)0x0;
    if (puVar3 == (undefined4 *)0x0) goto LAB_1403acd20;
    *puVar3 = 0xdddd;
    puVar9 = auStack_38;
  }
  puVar12 = (undefined8 *)(puVar3 + 4);
LAB_1403acd20:
  uVar5 = param_1[1];
  uVar13 = 0;
  uVar6 = uVar13;
  uVar10 = uVar13;
  uVar11 = uVar13;
  if (uVar5 != 0) {
    do {
      if (uVar10 == 0) {
LAB_1403acd69:
        if (((longlong)uVar6 < 0) || (param_1[1] <= (longlong)uVar6)) {
                    // WARNING: Subroutine does not return
          *(undefined **)(puVar9 + -8) = &UNK_1403acde4;
          FUN_14034f7d0();
        }
        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_1403acdde;
          FUN_14034f7d0();
        }
        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_1403acd69;
      }
      uVar6 = uVar6 + 1;
      uVar10 = uVar11;
    } while (uVar6 < uVar5);
  }
  *(undefined8 *)(puVar9 + -8) = 0x1403acdab;
  FUN_1403abd40(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_1403ace3d;
        FUN_14034f7d0();
      }
      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) = 0x1403ace16;
    free(puVar12 + -2);
  }
  *(undefined8 *)(puVar9 + -8) = 0x1403ace22;
  return;
}



longlong FUN_1403ace40(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_1400179d0(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_14000d3f0(uVar2,uVar3,(longlong)iVar1);
    *(undefined8 *)(param_1 + 0x48) = *(undefined8 *)(param_2 + 0x48);
    return param_1;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_1403acee0(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_14034ed40(uVar2);
  FUN_14035f6d0(param_2,0);
  if (*(longlong *)(param_1 + 0x590) == 0) {
    lVar6 = 0;
  }
  else {
    lVar6 = *(longlong *)(param_1 + 0x580);
  }
  while( true ) {
    if (lVar6 == 0) {
      FUN_14034edd0(uVar2);
      return;
    }
    iVar1 = *(int *)(param_2 + 0x18);
    lVar8 = (longlong)iVar1;
    if (iVar1 < 0) break;
    iVar7 = *(int *)(param_2 + 0x18);
    FUN_14035f6d0(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_14034f7d0();
}



void FUN_1403ad010(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_14034ed40(uVar2);
  uVar7 = 1;
  dVar5 = (double)(**(code **)(param_1[0xe] + 0x1c0))();
  lVar4 = 0;
  if (param_1[0xbb] != 0) {
    lVar4 = *(longlong *)(param_1[0xbb] + 0x38);
  }
  FUN_1403a9c50(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_1403e1d60(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_1403de1c0(lVar3);
            FUN_1403e1d60(uVar6,dVar5);
          }
          uVar1 = FUN_1403de2f0(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_1403dd720(lVar4,dVar5);
    }
  }
  if (DAT_1405d8058 < dVar5 - (double)param_1[0x1a]) {
    if (((longlong *)param_1[0x2a4] != (longlong *)0x0) &&
       (lVar4 = *(longlong *)param_1[0x2a4], lVar4 != 0)) {
      FUN_14039c5c0(*(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_1403de1c0();
        FUN_14039c5c0(*(undefined8 *)(lVar3 + 0x108),dVar5);
      }
    }
    param_1[0x1a] = (longlong)dVar5;
  }
  FUN_14034edd0(uVar2);
  return;
}



undefined8 * FUN_1403ad200(longlong param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  
  lVar2 = 0;
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_14034ed40(uVar1);
  if (*(longlong *)(param_1 + 0x1600) != 0) {
    lVar2 = *(longlong *)(param_1 + 0x15f0);
  }
  for (; lVar2 != 0; lVar2 = *(longlong *)(lVar2 + 0x10)) {
  }
  FUN_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  FUN_14034edd0(uVar1);
  return param_2;
}



void FUN_1403ad290(longlong param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined1 uVar3;
  longlong lVar4;
  
  uVar1 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))();
  FUN_14034ed40(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_14034edd0(uVar1);
  return;
}



void FUN_1403ad3b0(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_140394870(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_14034f800();
      }
      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_14034f7d0();
      }
      iVar6 = *(int *)(param_2 + 0x18);
      FUN_140394870(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_1403a2c90(param_2);
          lVar5 = FUN_1403a2c90(param_2);
          *(undefined8 *)(lVar5 + lVar7) = *(undefined8 *)(lVar4 + -8 + lVar7);
          lVar7 = lVar7 + -8;
          lVar8 = lVar8 + -1;
        } while (-1 < lVar8);
      }
      lVar8 = FUN_1403a2c90(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_1403ad4e0(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_1403e0360(0,1,param_2);
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
    else {
      FUN_1403e0360(**(undefined8 **)(lVar1 + 8),1,param_2);
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
  }
  return;
}



void FUN_1403ad540(longlong *param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  
  uVar1 = (**(code **)(*param_1 + 0x58))();
  FUN_14034ed40(uVar1);
  if ((((longlong *)param_1[699] != (longlong *)0x0) &&
      (lVar3 = *(longlong *)param_1[699], lVar3 != 0)) && (lVar3 != 0x40)) {
    if (lVar3 != 0) {
      lVar3 = lVar3 + -0x40;
    }
    FUN_1403dd8c0(lVar3);
  }
  if ((((longlong *)param_1[0x2a4] != (longlong *)0x0) &&
      (lVar3 = *(longlong *)param_1[0x2a4], lVar3 != 0)) && (lVar3 != 0x40)) {
    if (lVar3 != 0) {
      lVar3 = lVar3 + -0x40;
    }
    FUN_1403e1ab0(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_1403de1c0();
      FUN_1403e1ab0(uVar2);
    }
  }
  FUN_14034edd0(uVar1);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403ad630(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_1405d8168 < 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_14000d450(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_1405f2490,lVar2 + 0x56c,local_res8);
        }
      }
    }
  }
  return;
}



void FUN_1403ad790(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_14034ed40(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_1405d8100 < 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_1405f2490,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_1405f2490,lVar2 + 0x48);
        }
      }
    }
  }
  FUN_14034edd0(uVar1);
  return;
}



undefined4 FUN_1403ad8c0(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_140352ee0(param_2), cVar1 != '\0')) {
    if ((*(longlong **)(param_1 + 0x1570) != (longlong *)0x0) &&
       ((lVar3 = **(longlong **)(param_1 + 0x1570), lVar3 != 0 &&
        (cVar1 = FUN_140352ee0(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_1405d83d0;
    sVar2 = DAT_1405d83d4;
    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_1403ada20(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_1403cfad0(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(puVar1);
    }
  }
  return;
}



longlong * FUN_1403ada90(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_1405d8010;
  }
  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_14034fd70(pwVar2);
      _C = *pwVar2;
    } while (_C != 0);
    if (pwVar4 != (wint_t *)0x0) {
      puVar3 = (undefined *)*param_1;
      if ((undefined *)*param_1 == (undefined *)0x0) {
        puVar3 = PTR_DAT_1405d8010;
      }
      FUN_1403acab0(param_1,(longlong)pwVar4 - (longlong)puVar3 >> 1 & 0xffffffff);
    }
  }
  return param_1;
}



void FUN_1403adb30(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_1403cfad0(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(puVar3);
    }
  }
  return;
}



undefined8 FUN_1403adbc0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035d100(param_1);
  uVar2 = FUN_1403acb30(param_1,param_2,param_3,param_4);
  FUN_14035d100(param_1);
  return uVar2;
}



void FUN_1403adc40(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  undefined8 uVar2;
  undefined *local_res18 [2];
  
  uVar2 = FUN_140353de0(param_2,local_res18,param_3,param_4,0xfffffffffffffffe);
  FUN_140017520(param_1,uVar2);
  if (((local_res18[0] != (undefined *)0x0) && (local_res18[0] != PTR_DAT_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar2 = FUN_14034fe70();
    FUN_14034ed40(uVar2);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403add2c)
// WARNING: Removing unreachable block (ram,0x0001403add35)
// WARNING: Removing unreachable block (ram,0x0001403add53)
// WARNING: Removing unreachable block (ram,0x0001403add5c)

undefined4 * FUN_1403adcd0(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_1403add80(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_1405d84f0 ^ (ulonglong)auStack_4b8;
  iVar2 = param_2[10];
  if (iVar2 == 0) {
    FUN_140385b50(param_1,0);
  }
  iVar15 = *param_2;
  cVar4 = FUN_140384a90(param_2,local_2c8);
  if (cVar4 == '\0') {
switchD_1403ade24_default:
    FUN_140383db0(param_2,(int)((iVar15 >> 0x1f & 7U) + iVar15) >> 3);
    return 0;
  }
  local_370 = param_3;
  switch(local_2c8[0]) {
  case 0xfbf5:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_440);
    FUN_140384b70(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_140384780(param_2,&local_420);
    ppppppuVar11 = local_420;
    if (((cVar4 != '\0') && (-1 < (int)local_420)) && ((int)local_420 <= DAT_1405d8140)) {
      FUN_1400179d0(&local_400,(ulonglong)local_420 & 0xffffffff);
      ppppppuVar14 = local_3f0;
      if ((int)local_3e8 == 0) {
        ppppppuVar14 = ppppppuVar10;
      }
      FUN_1403840e0(param_2,ppppppuVar14,(ulonglong)ppppppuVar11 & 0xffffffff);
    }
    cVar4 = FUN_1403840e0(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_140384780(param_2,&local_420);
    ppppppuVar11 = local_420;
    if (((cVar4 != '\0') && (-1 < (int)local_420)) && ((int)local_420 <= DAT_1405d8140)) {
      FUN_1400179d0(&local_218,(ulonglong)local_420 & 0xffffffff);
      ppppppuVar14 = local_208;
      if ((int)local_200 == 0) {
        ppppppuVar14 = ppppppuVar10;
      }
      FUN_1403840e0(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_140384780(param_2,&local_420);
    ppppppuVar11 = local_420;
    if (((cVar4 != '\0') && (-1 < (int)local_420)) && ((int)local_420 <= DAT_1405d8140)) {
      FUN_1400179d0(&local_1e0,(ulonglong)local_420 & 0xffffffff);
      ppppppuVar14 = local_1d0;
      if ((int)local_1c8 == 0) {
        ppppppuVar14 = ppppppuVar10;
      }
      FUN_1403840e0(param_2,ppppppuVar14,(ulonglong)ppppppuVar11 & 0xffffffff);
    }
    cVar4 = FUN_1403840e0(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_1403840e0(param_2,&local_78,0x10);
    if (cVar4 != '\0') {
      local_98 = local_78;
      uStack_90 = uStack_70;
    }
    cVar4 = FUN_1403840e0(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    cVar4 = FUN_1403840e0(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_1405d9810);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] != '\0') goto LAB_1403ae51a;
      local_498 = (undefined ********)&DAT_140477960;
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf5,PTR_DAT_1405d9810);
    }
    else {
      ppppppuVar16 = ppppppuVar10;
      if ((char)param_1[3] != '\0') goto LAB_1403ae51a;
      FUN_14034fe70();
      local_420 = (undefined ******)PTR_DAT_1405d8010;
      local_2b8[0] = local_440._0_4_;
      FUN_1403a1a60(&local_420,local_2b8);
      FUN_140017790(&local_420,&DAT_14047edb0);
      local_240 = local_438._0_4_;
      FUN_1403a1a60(&local_420,&local_240);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1d60(&local_420,&local_400);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1ac0(&local_420,local_3d8);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1d60(&local_420,&local_218);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1d60(&local_420,&local_1e0);
      FUN_140017790(&local_420,&DAT_14047edb0);
      local_238[0] = local_3d0._0_4_;
      FUN_1403a1a60(&local_420,local_238);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1d70(&local_420,&local_98);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a18c0(&local_420,&local_448);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1a00(&local_420,local_430);
      FUN_140017790(&local_420,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_420 != (undefined ******)0x0) && (local_420 != (undefined ******)PTR_DAT_1405d8010)
         ) {
        iVar15 = *(int *)(local_420 + -1);
      }
      local_428 = (undefined ******)FUN_1400174a0(&local_420,&local_1f0,iVar15 + -2);
      if (local_420 == (undefined ******)0x0) {
        local_420 = (undefined ******)PTR_DAT_1405d8010;
      }
      if ((undefined ******)*local_428 != local_420) {
        pppppppuVar8 = (undefined *******)FUN_14034fe70();
        local_78 = pppppppuVar8;
        FUN_14034ed40(pppppppuVar8);
        ppppppuVar11 = local_420;
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        if (((local_420 != (undefined ******)0x0) &&
            (local_420 != (undefined ******)PTR_DAT_1405d8010)) &&
           (ppppppuVar16 = local_420 + -1, ppppppuVar16 != (undefined ******)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_348 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_340 = (undefined *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)ppppppuVar11 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppppppuVar16);
          }
          FUN_14034edd0(ppuVar9);
        }
        local_420 = (undefined ******)*local_428;
        if (((local_420 != (undefined ******)PTR_DAT_1405d8010) &&
            (local_420 != (undefined ******)0x0)) && (local_420 != (undefined ******)0x8)) {
          *(int *)((longlong)local_420 + -4) = *(int *)((longlong)local_420 + -4) + 1;
        }
        FUN_14034edd0(pppppppuVar8);
      }
      if (((local_1f0 != (undefined *)0x0) && (local_1f0 != PTR_DAT_1405d8010)) &&
         (local_1f0 + -8 != (undefined *)0x0)) {
        pppppppuVar8 = (undefined *******)FUN_14034fe70();
        local_78 = pppppppuVar8;
        FUN_14034ed40(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        piVar1 = (int *)(local_1f0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_1f0 + -8);
        }
        FUN_14034edd0(pppppppuVar8);
      }
      local_428 = (undefined ******)&local_318;
      local_1f0 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_318 = (undefined ******)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_318 = ppppppuVar10;
      }
      if (local_420 != (undefined ******)PTR_DAT_1405d8010) {
        pppppppuVar8 = (undefined *******)FUN_14034fe70();
        local_78 = pppppppuVar8;
        FUN_14034ed40(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        FUN_1400031d0(&local_318);
        local_318 = local_420;
        if (((local_420 != (undefined ******)PTR_DAT_1405d8010) &&
            (local_420 != (undefined ******)0x0)) && (local_420 != (undefined ******)0x8)) {
          *(int *)((longlong)local_420 + -4) = *(int *)((longlong)local_420 + -4) + 1;
        }
        FUN_14034edd0(pppppppuVar8);
      }
      puVar3 = PTR_DAT_1405d9810;
      FUN_14034fe70();
      local_258 = PTR_DAT_1405d8010;
      uVar5 = FUN_14034fcf0(puVar3);
      uVar12 = FUN_140002f00(&local_258,uVar5);
      FUN_14034fd20(uVar12,puVar3,uVar5);
      FUN_140002fe0(&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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf5,PTR_DAT_1405d9810);
      ppppppuVar11 = local_420;
      if (((local_420 != (undefined ******)0x0) &&
          (local_420 != (undefined ******)PTR_DAT_1405d8010)) &&
         (ppppppuVar16 = local_420 + -1, ppppppuVar16 != (undefined ******)0x0)) {
        pppppppuVar8 = (undefined *******)FUN_14034fe70();
        local_78 = pppppppuVar8;
        FUN_14034ed40(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        piVar1 = (int *)((longlong)ppppppuVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(ppppppuVar16);
        }
        FUN_14034edd0(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_1405d9810;
      local_68 = iVar2;
      local_60 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_78);
      DVar6 = GetTickCount();
      ppppppuVar16 = (undefined ******)(ulonglong)DVar6;
    }
LAB_1403ae51a:
    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_1405d9810);
    }
    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_1405d9810;
      local_68 = iVar2;
      local_60 = param_3;
      DVar6 = GetTickCount();
      local_58 = DVar6 - (int)ppppppuVar16;
      (**(code **)(*param_1 + 0x18))(param_1,&local_78);
    }
    FUN_1403555d0(&local_1e0);
    FUN_1403555d0(&local_218);
    FUN_1403555d0(&local_400);
    return 1;
  case 0xfbf6:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_3d0);
    FUN_140384b70(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_140384780(param_2,&local_428);
    ppppppuVar11 = local_428;
    if (((cVar4 != '\0') && (-1 < (int)local_428)) && ((int)local_428 <= DAT_1405d8140)) {
      FUN_1400179d0(&local_400,(ulonglong)local_428 & 0xffffffff);
      ppppppuVar14 = local_3f0;
      if ((int)local_3e8 == 0) {
        ppppppuVar14 = ppppppuVar10;
      }
      FUN_1403840e0(param_2,ppppppuVar14,(ulonglong)ppppppuVar11 & 0xffffffff);
    }
    cVar4 = FUN_1403840e0(param_2,&local_420,4);
    if (cVar4 != '\0') {
      local_3d8[0] = local_420._0_4_;
    }
    cVar4 = FUN_1403840e0(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_1403840e0(param_2,&local_78,0x10);
    if (cVar4 != '\0') {
      local_98 = local_78;
      uStack_90 = uStack_70;
    }
    cVar4 = FUN_1403840e0(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    cVar4 = FUN_1403840e0(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_1405d9818);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] != '\0') goto LAB_1403aebec;
      local_498 = (undefined ********)&DAT_140477960;
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf6,PTR_DAT_1405d9818);
    }
    else {
      ppppppuVar16 = ppppppuVar10;
      if ((char)param_1[3] != '\0') goto LAB_1403aebec;
      FUN_14034fe70();
      local_420 = (undefined ******)PTR_DAT_1405d8010;
      local_228 = local_3d0._0_4_;
      FUN_1403a1a60(&local_420,&local_228);
      FUN_140017790(&local_420,&DAT_14047edb0);
      local_220 = local_438._0_4_;
      FUN_1403a1a60(&local_420,&local_220);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1d60(&local_420,&local_400);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1ac0(&local_420,local_3d8);
      FUN_140017790(&local_420,&DAT_14047edb0);
      local_288[0] = local_440._0_4_;
      FUN_1403a1a60(&local_420,local_288);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1d70(&local_420,&local_98);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a18c0(&local_420,&local_448);
      FUN_140017790(&local_420,&DAT_14047edb0);
      FUN_1403a1a00(&local_420,local_430);
      FUN_140017790(&local_420,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_420 != (undefined ******)0x0) && (local_420 != (undefined ******)PTR_DAT_1405d8010)
         ) {
        iVar15 = *(int *)(local_420 + -1);
      }
      local_428 = (undefined ******)FUN_1400174a0(&local_420,&local_1e8,iVar15 + -2);
      if (local_420 == (undefined ******)0x0) {
        local_420 = (undefined ******)PTR_DAT_1405d8010;
      }
      if ((undefined ******)*local_428 != local_420) {
        pppppppuVar8 = (undefined *******)FUN_14034fe70();
        local_78 = pppppppuVar8;
        FUN_14034ed40(pppppppuVar8);
        ppppppuVar11 = local_420;
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        if (((local_420 != (undefined ******)0x0) &&
            (local_420 != (undefined ******)PTR_DAT_1405d8010)) &&
           (ppppppuVar16 = local_420 + -1, ppppppuVar16 != (undefined ******)0x0)) {
          ppuVar9 = (undefined **)FUN_14034fe70();
          local_348 = ppuVar9;
          FUN_14034ed40(ppuVar9);
          local_340 = (undefined *)CONCAT71(local_340._1_7_,1);
          piVar1 = (int *)((longlong)ppppppuVar11 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(ppppppuVar16);
          }
          FUN_14034edd0(ppuVar9);
        }
        local_420 = (undefined ******)*local_428;
        if (((local_420 != (undefined ******)PTR_DAT_1405d8010) &&
            (local_420 != (undefined ******)0x0)) && (local_420 != (undefined ******)0x8)) {
          *(int *)((longlong)local_420 + -4) = *(int *)((longlong)local_420 + -4) + 1;
        }
        FUN_14034edd0(pppppppuVar8);
      }
      if (((local_1e8 != (undefined *)0x0) && (local_1e8 != PTR_DAT_1405d8010)) &&
         (local_1e8 + -8 != (undefined *)0x0)) {
        pppppppuVar8 = (undefined *******)FUN_14034fe70();
        local_78 = pppppppuVar8;
        FUN_14034ed40(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        piVar1 = (int *)(local_1e8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_1e8 + -8);
        }
        FUN_14034edd0(pppppppuVar8);
      }
      local_428 = (undefined ******)&local_320;
      local_1e8 = PTR_DAT_1405d8010;
      FUN_14034fe70();
      local_320 = (undefined ******)PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_320 = ppppppuVar10;
      }
      if (local_420 != (undefined ******)PTR_DAT_1405d8010) {
        pppppppuVar8 = (undefined *******)FUN_14034fe70();
        local_78 = pppppppuVar8;
        FUN_14034ed40(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        FUN_1400031d0(&local_320);
        local_320 = local_420;
        if (((local_420 != (undefined ******)PTR_DAT_1405d8010) &&
            (local_420 != (undefined ******)0x0)) && (local_420 != (undefined ******)0x8)) {
          *(int *)((longlong)local_420 + -4) = *(int *)((longlong)local_420 + -4) + 1;
        }
        FUN_14034edd0(pppppppuVar8);
      }
      puVar3 = PTR_DAT_1405d9818;
      FUN_14034fe70();
      local_2a8 = PTR_DAT_1405d8010;
      uVar5 = FUN_14034fcf0(puVar3);
      uVar12 = FUN_140002f00(&local_2a8,uVar5);
      FUN_14034fd20(uVar12,puVar3,uVar5);
      FUN_140002fe0(&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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf6,PTR_DAT_1405d9818);
      ppppppuVar11 = local_420;
      if (((local_420 != (undefined ******)0x0) &&
          (local_420 != (undefined ******)PTR_DAT_1405d8010)) &&
         (ppppppuVar16 = local_420 + -1, ppppppuVar16 != (undefined ******)0x0)) {
        pppppppuVar8 = (undefined *******)FUN_14034fe70();
        local_78 = pppppppuVar8;
        FUN_14034ed40(pppppppuVar8);
        uStack_70 = (undefined *)CONCAT71(uStack_70._1_7_,1);
        piVar1 = (int *)((longlong)ppppppuVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(ppppppuVar16);
        }
        FUN_14034edd0(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_1405d9818;
      local_68 = iVar2;
      local_60 = param_3;
      (**(code **)(*param_1 + 0x20))(param_1,&local_78);
      DVar6 = GetTickCount();
      ppppppuVar16 = (undefined ******)(ulonglong)DVar6;
    }
LAB_1403aebec:
    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_1405d9818);
    }
    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_1405d9818;
      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_1403555d0(&local_400);
    return 1;
  case 0xfbf7:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_440);
    cVar4 = FUN_1403840e0(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_1403840e0(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_1403840e0(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_1403840e0(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_1403840e0(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_1403840e0(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_1403840e0(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_1403840e0(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_1403840e0(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_1405d9820);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbf7,PTR_DAT_1405d9820);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_438 = (undefined ********)PTR_DAT_1405d8010;
      local_224 = local_440._0_4_;
      FUN_1403a1a60(&local_438,&local_224);
      FUN_140017790(&local_438,&DAT_14047edb0);
      FUN_1403a18c0(&local_438,&local_448);
      FUN_140017790(&local_438,&DAT_14047edb0);
      uVar12 = (*(code *)*local_78)(&local_78,&local_428);
      FUN_140017520(&local_438,uVar12);
      ppppppuVar11 = local_428;
      if (((local_428 != (undefined ******)0x0) &&
          (local_428 != (undefined ******)PTR_DAT_1405d8010)) &&
         (ppppppuVar16 = local_428 + -1, ppppppuVar16 != (undefined ******)0x0)) {
        ppppppuVar10 = (undefined ******)FUN_14034fe70();
        local_420 = ppppppuVar10;
        FUN_14034ed40(ppppppuVar10);
        local_418 = (undefined *)CONCAT71(local_418._1_7_,1);
        piVar1 = (int *)((longlong)ppppppuVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(ppppppuVar16);
        }
        FUN_14034edd0(ppppppuVar10);
      }
      FUN_140017790(&local_438,&DAT_14047edb0);
      uVar12 = (*(code *)*local_348)(&local_348,&local_428);
      FUN_140017520(&local_438,uVar12);
      ppppppuVar11 = local_428;
      if (((local_428 != (undefined ******)0x0) &&
          (local_428 != (undefined ******)PTR_DAT_1405d8010)) &&
         (ppppppuVar16 = local_428 + -1, ppppppuVar16 != (undefined ******)0x0)) {
        ppppppuVar10 = (undefined ******)FUN_14034fe70();
        local_420 = ppppppuVar10;
        FUN_14034ed40(ppppppuVar10);
        local_418 = (undefined *)CONCAT71(local_418._1_7_,1);
        piVar1 = (int *)((longlong)ppppppuVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(ppppppuVar16);
        }
        FUN_14034edd0(ppppppuVar10);
      }
      FUN_140017790(&local_438,&DAT_14047edb0);
      uVar12 = (*(code *)*local_3d0)(&local_3d0,&local_428);
      FUN_140017520(&local_438,uVar12);
      if (((local_428 != (undefined ******)0x0) &&
          (local_428 != (undefined ******)PTR_DAT_1405d8010)) &&
         (local_428 + -1 != (undefined ******)0x0)) {
        ppppppuVar11 = (undefined ******)FUN_14034fe70();
        local_420 = ppppppuVar11;
        FUN_14034ed40(ppppppuVar11);
        local_418 = (undefined *)CONCAT71(local_418._1_7_,1);
        piVar1 = (int *)((longlong)local_428 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_428 + -1);
        }
        FUN_14034edd0(ppppppuVar11);
      }
      FUN_140017790(&local_438,&DAT_14047edb0);
      FUN_140364340(&local_438,&local_98);
      FUN_140017790(&local_438,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_438 != (undefined ********)0x0) &&
         (iVar15 = 0, local_438 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_438 + -1);
      }
      uVar12 = FUN_1400174a0(&local_438,local_148,iVar15 + -2);
      FUN_140003100(&local_438,uVar12);
      FUN_1400031d0(local_148);
      local_428 = &local_230;
      FUN_14034fe70();
      local_230 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_230,&local_438);
      uVar12 = FUN_140003060(local_f8,PTR_DAT_1405d9820,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf7,PTR_DAT_1405d9820);
      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_1405d9820;
      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_1405d9820);
    }
    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_1405d9820;
    break;
  case 0xfbf8:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_440);
    local_78 = (undefined *******)Proud::AddrPort::vftable;
    DVar6 = 0;
    uStack_70 = (undefined *)((ulonglong)uStack_70._6_2_ << 0x30);
    FUN_14035d460(param_2,&local_78);
    local_98 = (undefined *******)Proud::AddrPort::vftable;
    uStack_90 = (undefined *)((ulonglong)uStack_90._6_2_ << 0x30);
    FUN_14035d460(param_2,&local_98);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_1405d9828);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbf8,PTR_DAT_1405d9828);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_438 = (undefined ********)PTR_DAT_1405d8010;
      local_21c = local_440._0_4_;
      FUN_1403a1a60(&local_438,&local_21c);
      FUN_140017790(&local_438,&DAT_14047edb0);
      FUN_140364340(&local_438,&local_78);
      FUN_140017790(&local_438,&DAT_14047edb0);
      FUN_140364340(&local_438,&local_98);
      FUN_140017790(&local_438,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_438 != (undefined ********)0x0) &&
         (local_438 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_438 + -1);
      }
      uVar12 = FUN_1400174a0(&local_438,local_138,iVar15 + -2);
      FUN_140003100(&local_438,uVar12);
      FUN_1400031d0(local_138);
      local_428 = &local_298;
      FUN_14034fe70();
      local_298 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_298,&local_438);
      uVar12 = FUN_140003060(local_b8,PTR_DAT_1405d9828,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf8,PTR_DAT_1405d9828);
      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_1405d9828;
      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_1405d9828);
    }
    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_1405d9828;
    break;
  case 0xfbf9:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_438);
    cVar4 = FUN_1403840e0(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_1405d9830);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbf9,PTR_DAT_1405d9830);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3d0 = (undefined ********)PTR_DAT_1405d8010;
      local_2f8[0] = local_438._0_4_;
      FUN_1403a1a60(&local_3d0,local_2f8);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      uVar12 = FUN_14035bc60((ulonglong)local_440 & 0xffffffff);
      FUN_140017790(&local_3d0,uVar12);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_3d0 != (undefined ********)0x0) &&
         (local_3d0 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_3d0 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3d0,local_140,iVar15 + -2);
      FUN_140003100(&local_3d0,uVar12);
      FUN_1400031d0(local_140);
      local_428 = &local_248;
      FUN_14034fe70();
      local_248 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_248,&local_3d0);
      uVar12 = FUN_140003060(local_a8,PTR_DAT_1405d9830,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbf9,PTR_DAT_1405d9830);
      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_1405d9830;
      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_1405d9830);
    }
    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_1405d9830;
    break;
  case 0xfbfa:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_438);
    FUN_140384b70(param_2,&local_440);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_1405d9838);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfa,PTR_DAT_1405d9838);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3d0 = (undefined ********)PTR_DAT_1405d8010;
      local_278[0] = local_438._0_4_;
      FUN_1403a1a60(&local_3d0,local_278);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      local_2e8[0] = local_440._0_4_;
      FUN_1403a1a60(&local_3d0,local_2e8);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_3d0 != (undefined ********)0x0) &&
         (local_3d0 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_3d0 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3d0,local_178,iVar15 + -2);
      FUN_140003100(&local_3d0,uVar12);
      FUN_1400031d0(local_178);
      local_428 = &local_310;
      FUN_14034fe70();
      local_310 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_310,&local_3d0);
      uVar12 = FUN_140003060(local_b0,PTR_DAT_1405d9838,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfa,PTR_DAT_1405d9838);
      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_1405d9838;
      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_1405d9838);
    }
    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_1405d9838;
    break;
  case 0xfbfb:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_438);
    FUN_140384b70(param_2,&local_440);
    local_420 = (undefined ******)Proud::AddrPort::vftable;
    DVar6 = 0;
    local_418 = (undefined *)((ulonglong)local_418._6_2_ << 0x30);
    FUN_14035d460(param_2,&local_420);
    local_348 = Proud::AddrPort::vftable;
    local_340 = (undefined *)((ulonglong)local_340._6_2_ << 0x30);
    FUN_14035d460(param_2,&local_348);
    local_78 = (undefined *******)Proud::AddrPort::vftable;
    uStack_70 = (undefined *)((ulonglong)uStack_70._6_2_ << 0x30);
    FUN_14035d460(param_2,&local_78);
    local_98 = (undefined *******)Proud::AddrPort::vftable;
    uStack_90 = (undefined *)((ulonglong)uStack_90._6_2_ << 0x30);
    FUN_14035d460(param_2,&local_98);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_1405d9840);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfb,PTR_DAT_1405d9840);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_3d0 = (undefined ********)PTR_DAT_1405d8010;
      local_23c = local_438._0_4_;
      FUN_1403a1a60(&local_3d0,&local_23c);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      local_2d8[0] = local_440._0_4_;
      FUN_1403a1a60(&local_3d0,local_2d8);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      FUN_140364340(&local_3d0,&local_420);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      FUN_140364340(&local_3d0,&local_348);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      FUN_140364340(&local_3d0,&local_78);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      FUN_140364340(&local_3d0,&local_98);
      FUN_140017790(&local_3d0,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_3d0 != (undefined ********)0x0) &&
         (local_3d0 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_3d0 + -1);
      }
      uVar12 = FUN_1400174a0(&local_3d0,local_168,iVar15 + -2);
      FUN_140003100(&local_3d0,uVar12);
      FUN_1400031d0(local_168);
      local_428 = &local_308;
      FUN_14034fe70();
      local_308 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_308,&local_3d0);
      uVar12 = FUN_140003060(local_130,PTR_DAT_1405d9840,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfb,PTR_DAT_1405d9840);
      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_1405d9840;
      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_1405d9840);
    }
    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_1405d9840;
    break;
  case 0xfbfc:
    FUN_14035b390(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_1405d9848);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfc,PTR_DAT_1405d9848);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      uVar12 = FUN_1400174a0(&local_440,local_158,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_158);
      local_428 = &local_300;
      FUN_14034fe70();
      local_300 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_300,&local_440);
      uVar12 = FUN_140003060(local_120,PTR_DAT_1405d9848,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfc,PTR_DAT_1405d9848);
      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_1405d9848;
      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_1405d9848);
    }
    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_1405d9848;
    break;
  case 0xfbfd:
    FUN_14035b390(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_1405d9850);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfd,PTR_DAT_1405d9850);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      uVar12 = FUN_1400174a0(&local_440,local_170,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_170);
      local_428 = &local_2f0;
      FUN_14034fe70();
      local_2f0 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_2f0,&local_440);
      uVar12 = FUN_140003060(local_d8,PTR_DAT_1405d9850,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfd,PTR_DAT_1405d9850);
      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_1405d9850;
      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_1405d9850);
    }
    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_1405d9850;
    break;
  case 0xfbfe:
    FUN_14035b390(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_1405d9858);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbfe,PTR_DAT_1405d9858);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      uVar12 = FUN_1400174a0(&local_440,local_1a0,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_1a0);
      local_428 = &local_2e0;
      FUN_14034fe70();
      local_2e0 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_2e0,&local_440);
      uVar12 = FUN_140003060(local_110,PTR_DAT_1405d9858,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbfe,PTR_DAT_1405d9858);
      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_1405d9858;
      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_1405d9858);
    }
    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_1405d9858;
    break;
  case 0xfbff:
    FUN_14035b390(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_1405d9860);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfbff,PTR_DAT_1405d9860);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      uVar12 = FUN_1400174a0(&local_440,local_150,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_150);
      local_428 = &local_2d0;
      FUN_14034fe70();
      local_2d0 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_2d0,&local_440);
      uVar12 = FUN_140003060(local_d0,PTR_DAT_1405d9860,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfbff,PTR_DAT_1405d9860);
      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_1405d9860;
      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_1405d9860);
    }
    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_1405d9860;
    break;
  case 0xfc00:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    cVar4 = FUN_1403840e0(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_1405d9868);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc00,PTR_DAT_1405d9868);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      FUN_1403a18c0(&local_440,&local_448);
      FUN_140017790(&local_440,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_440 != (undefined ********)0x0) &&
         (local_440 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_440 + -1);
      }
      uVar12 = FUN_1400174a0(&local_440,local_190,iVar15 + -2);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_190);
      local_428 = &local_2c0;
      FUN_14034fe70();
      local_2c0 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_2c0,&local_440);
      uVar12 = FUN_140003060(local_100,PTR_DAT_1405d9868,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc00,PTR_DAT_1405d9868);
      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_1405d9868;
      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_1405d9868);
    }
    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_1405d9868;
    break;
  case 0xfc01:
    FUN_14035b390(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_1405d9870);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc01,PTR_DAT_1405d9870);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      uVar12 = FUN_1400174a0(&local_440,local_160,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_160);
      local_428 = &local_2b0;
      FUN_14034fe70();
      local_2b0 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_2b0,&local_440);
      uVar12 = FUN_140003060(local_c8,PTR_DAT_1405d9870,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc01,PTR_DAT_1405d9870);
      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_1405d9870;
      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_1405d9870);
    }
    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_1405d9870;
    break;
  case 0xfc02:
    FUN_14035b390(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_1405d9878);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc02,PTR_DAT_1405d9878);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      uVar12 = FUN_1400174a0(&local_440,local_180,0xfffffffe);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_180);
      local_428 = &local_2a0;
      FUN_14034fe70();
      local_2a0 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_2a0,&local_440);
      uVar12 = FUN_140003060(local_f0,PTR_DAT_1405d9878,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc02,PTR_DAT_1405d9878);
      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_1405d9878;
      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_1405d9878);
    }
    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_1405d9878;
    break;
  case 0xfc03:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_440);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_1405d9880);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc03,PTR_DAT_1405d9880);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_438 = (undefined ********)PTR_DAT_1405d8010;
      local_268[0] = local_440._0_4_;
      FUN_1403a1a60(&local_438,local_268);
      FUN_140017790(&local_438,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_438 != (undefined ********)0x0) &&
         (local_438 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_438 + -1);
      }
      uVar12 = FUN_1400174a0(&local_438,local_1b8,iVar15 + -2);
      FUN_140003100(&local_438,uVar12);
      FUN_1400031d0(local_1b8);
      local_428 = &local_290;
      FUN_14034fe70();
      local_290 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_290,&local_438);
      uVar12 = FUN_140003060(local_e8,PTR_DAT_1405d9880,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc03,PTR_DAT_1405d9880);
      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_1405d9880;
      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_1405d9880);
    }
    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_1405d9880;
    break;
  case 0xfc04:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_140384b70(param_2,&local_440);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_1405d9888);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc04,PTR_DAT_1405d9888);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_438 = (undefined ********)PTR_DAT_1405d8010;
      local_328[0] = local_440._0_4_;
      FUN_1403a1a60(&local_438,local_328);
      FUN_140017790(&local_438,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_438 != (undefined ********)0x0) &&
         (local_438 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_438 + -1);
      }
      uVar12 = FUN_1400174a0(&local_438,local_1b0,iVar15 + -2);
      FUN_140003100(&local_438,uVar12);
      FUN_1400031d0(local_1b0);
      local_428 = &local_280;
      FUN_14034fe70();
      local_280 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_280,&local_438);
      uVar12 = FUN_140003060(local_e0,PTR_DAT_1405d9888,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc04,PTR_DAT_1405d9888);
      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_1405d9888;
      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_1405d9888);
    }
    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_1405d9888;
    break;
  case 0xfc05:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    cVar4 = FUN_1403840e0(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_1405d9890);
    DVar6 = 0;
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc05,PTR_DAT_1405d9890);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      FUN_1403a18c0(&local_440,&local_448);
      FUN_140017790(&local_440,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_440 != (undefined ********)0x0) &&
         (local_440 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_440 + -1);
      }
      uVar12 = FUN_1400174a0(&local_440,local_1a8,iVar15 + -2);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_1a8);
      local_428 = &local_270;
      FUN_14034fe70();
      local_270 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_270,&local_440);
      uVar12 = FUN_140003060(local_128,PTR_DAT_1405d9890,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc05,PTR_DAT_1405d9890);
      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_1405d9890;
      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_1405d9890);
    }
    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_1405d9890;
    break;
  case 0xfc06:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    FUN_14034fe70();
    local_98 = (undefined *******)PTR_DAT_1405d8008;
    FUN_1403a16f0(param_2,&local_98);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_1405d9898);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc06,PTR_DAT_1405d9898);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      FUN_1403adc40(&local_440,&local_98);
      FUN_140017790(&local_440,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_440 != (undefined ********)0x0) &&
         (local_440 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_440 + -1);
      }
      uVar12 = FUN_1400174a0(&local_440,local_198,iVar15 + -2);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_198);
      local_428 = &local_260;
      FUN_14034fe70();
      local_260 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_260,&local_440);
      uVar12 = FUN_140003060(local_118,PTR_DAT_1405d9898,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc06,PTR_DAT_1405d9898);
      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_1405d9898;
      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_1405d9898);
    }
    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_1405d9898;
      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_1403b1757;
  case 0xfc07:
    FUN_14035b390(local_3a8);
    local_3a4 = param_2[10];
    local_3a8[0] = (undefined1)param_2[0x10];
    cVar4 = FUN_1403840e0(param_2,&local_420,1);
    if (cVar4 != '\0') {
      local_448._0_1_ = local_420._0_1_;
    }
    FUN_14034fe70();
    local_98 = (undefined *******)PTR_DAT_1405d8008;
    FUN_1403a16f0(param_2,&local_98);
    (**(code **)(*(longlong *)param_1[2] + 0x48))((longlong *)param_1[2],param_2,PTR_DAT_1405d98a0);
    if (*(char *)((longlong)param_1 + 0x19) == '\0') {
      if ((char)param_1[3] == '\0') {
        local_498 = (undefined ********)&DAT_140477960;
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfc07,PTR_DAT_1405d98a0);
      }
    }
    else if ((char)param_1[3] == '\0') {
      FUN_14034fe70();
      local_440 = (undefined ********)PTR_DAT_1405d8010;
      FUN_1403a18c0(&local_440,&local_448);
      FUN_140017790(&local_440,&DAT_14047edb0);
      FUN_1403adc40(&local_440,&local_98);
      FUN_140017790(&local_440,&DAT_14047edb0);
      iVar15 = 0;
      if ((local_440 != (undefined ********)0x0) &&
         (local_440 != (undefined ********)PTR_DAT_1405d8010)) {
        iVar15 = *(int *)(local_440 + -1);
      }
      uVar12 = FUN_1400174a0(&local_440,local_188,iVar15 + -2);
      FUN_140003100(&local_440,uVar12);
      FUN_1400031d0(local_188);
      local_428 = &local_250;
      FUN_14034fe70();
      local_250 = (undefined *****)PTR_DAT_1405d8010;
      FUN_140003100(&local_250,&local_440);
      uVar12 = FUN_140003060(local_108,PTR_DAT_1405d98a0,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_1405d8010;
      }
      (**(code **)(*(longlong *)param_1[2] + 0x70))
                ((longlong *)param_1[2],iVar2,0xfc07,PTR_DAT_1405d98a0);
      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_1405d98a0;
      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_1405d98a0);
    }
    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_1405d98a0;
      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_1403b1757:
    FUN_14000d2c0(&local_98);
    return 1;
  default:
    goto switchD_1403ade24_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_1403b17f0(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_140385b50(param_1,0);
  }
  iVar11 = *param_2;
  cVar3 = FUN_140384a90(param_2,local_res20);
  if (cVar3 != '\0') {
    local_70 = param_3;
    if (local_res20[0] == 0xfde9) {
      FUN_14035b390(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_1405d98a8);
      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_1405d98a8,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        puVar10 = PTR_DAT_1405d8010;
        local_res10 = PTR_DAT_1405d8010;
        plVar7 = (longlong *)FUN_1400174a0(&local_res10,&local_c8,0xfffffffe);
        if (puVar10 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        local_res10 = puVar10;
        if ((undefined *)*plVar7 != puVar10) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
             (puVar10 + -8 != (undefined *)0x0)) {
            ppuVar8 = (undefined **)FUN_14034fe70();
            local_138 = ppuVar8;
            FUN_14034ed40(ppuVar8);
            local_130 = 1;
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar10 + -8);
            }
            FUN_14034edd0(ppuVar8);
          }
          puVar10 = (undefined *)*plVar7;
          if (((puVar10 != PTR_DAT_1405d8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_res10 = puVar10;
          FUN_14034edd0(uVar9);
        }
        if (((local_c8 != (undefined *)0x0) && (local_c8 != PTR_DAT_1405d8010)) &&
           (local_c8 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(local_c8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_c8 + -8);
          }
          FUN_14034edd0(uVar9);
        }
        local_138 = &local_120;
        local_c8 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_120 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_120 = (undefined *)0x0;
        }
        if (puVar10 != PTR_DAT_1405d8010) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          FUN_1400031d0(&local_120);
          if (((puVar10 != PTR_DAT_1405d8010) && (puVar10 != (undefined *)0x0)) &&
             (puVar10 != (undefined *)0x8)) {
            *(int *)(puVar10 + -4) = *(int *)(puVar10 + -4) + 1;
          }
          local_120 = puVar10;
          FUN_14034edd0(uVar9);
        }
        puVar12 = PTR_DAT_1405d98a8;
        FUN_14034fe70();
        local_f0 = PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar12);
        uVar9 = FUN_140002f00(&local_f0,uVar4);
        FUN_14034fd20(uVar9,puVar12,uVar4);
        FUN_140002fe0(&local_f0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfde9,&local_f0,&local_120);
        puVar12 = puVar10;
        if (puVar10 == (undefined *)0x0) {
          puVar12 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfde9,PTR_DAT_1405d98a8,puVar12);
        param_3 = local_res18;
        if (((puVar10 != (undefined *)0x0) && (puVar10 != PTR_DAT_1405d8010)) &&
           (puVar10 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar10 + -8);
          }
          FUN_14034edd0(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_1405d98a8;
        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_1405d98a8);
      }
      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_1405d98a8;
    }
    else if (local_res20[0] == 0xfdea) {
      FUN_14035b390(local_a8);
      local_a4 = param_2[10];
      local_a8[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_1403840e0(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_1405d98b0);
      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_1405d98b0,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_168 = PTR_DAT_1405d8010;
        FUN_1403a1ac0(&local_168,&local_res10);
        FUN_140017790(&local_168,&DAT_14047edb0);
        iVar11 = 0;
        if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) {
          iVar11 = *(int *)(local_168 + -8);
        }
        plVar7 = (longlong *)FUN_1400174a0(&local_168,&local_d0,iVar11 + -2);
        if (local_168 == (undefined *)0x0) {
          local_168 = PTR_DAT_1405d8010;
        }
        if ((undefined *)*plVar7 != local_168) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          puVar10 = local_168;
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
             (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
            ppuVar8 = (undefined **)FUN_14034fe70();
            local_138 = ppuVar8;
            FUN_14034ed40(ppuVar8);
            local_130 = 1;
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar12);
            }
            FUN_14034edd0(ppuVar8);
          }
          local_168 = (undefined *)*plVar7;
          if (((local_168 != PTR_DAT_1405d8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_14034edd0(uVar9);
        }
        if (((local_d0 != (undefined *)0x0) && (local_d0 != PTR_DAT_1405d8010)) &&
           (local_d0 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(local_d0 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_d0 + -8);
          }
          FUN_14034edd0(uVar9);
        }
        local_138 = &local_118;
        local_d0 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_118 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_118 = (undefined *)0x0;
        }
        if (local_168 != PTR_DAT_1405d8010) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          FUN_1400031d0(&local_118);
          local_118 = local_168;
          if (((local_168 != PTR_DAT_1405d8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_14034edd0(uVar9);
        }
        puVar10 = PTR_DAT_1405d98b0;
        FUN_14034fe70();
        local_e8 = PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar10);
        uVar9 = FUN_140002f00(&local_e8,uVar4);
        FUN_14034fd20(uVar9,puVar10,uVar4);
        FUN_140002fe0(&local_e8);
        (**(code **)(*param_1 + 0x28))(param_1,0xfdea,&local_e8,&local_118);
        puVar10 = local_168;
        if (local_168 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfdea,PTR_DAT_1405d98b0,puVar10);
        puVar10 = local_168;
        param_3 = local_res18;
        if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
           (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar12);
          }
          FUN_14034edd0(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_1405d98b0;
        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_1405d98b0);
      }
      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_1405d98b0;
    }
    else if (local_res20[0] == 0xfdeb) {
      FUN_14035b390(local_a8);
      local_a4 = param_2[10];
      local_a8[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_1403840e0(param_2,&local_110,8);
      if (cVar3 != '\0') {
        local_128 = local_110;
      }
      cVar3 = FUN_1403840e0(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_1405d98b8);
      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_1405d98b8,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_168 = PTR_DAT_1405d8010;
        FUN_1403a1bf0(&local_168,&local_128);
        FUN_140017790(&local_168,&DAT_14047edb0);
        FUN_1403a1b80(&local_168,&local_res10);
        FUN_140017790(&local_168,&DAT_14047edb0);
        iVar11 = 0;
        if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) {
          iVar11 = *(int *)(local_168 + -8);
        }
        plVar7 = (longlong *)FUN_1400174a0(&local_168,&local_c0,iVar11 + -2);
        if (local_168 == (undefined *)0x0) {
          local_168 = PTR_DAT_1405d8010;
        }
        if ((undefined *)*plVar7 != local_168) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          puVar10 = local_168;
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
             (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
            ppuVar8 = (undefined **)FUN_14034fe70();
            local_138 = ppuVar8;
            FUN_14034ed40(ppuVar8);
            local_130 = 1;
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar12);
            }
            FUN_14034edd0(ppuVar8);
          }
          local_168 = (undefined *)*plVar7;
          if (((local_168 != PTR_DAT_1405d8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_14034edd0(uVar9);
        }
        if (((local_c0 != (undefined *)0x0) && (local_c0 != PTR_DAT_1405d8010)) &&
           (local_c0 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(local_c0 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_c0 + -8);
          }
          FUN_14034edd0(uVar9);
        }
        local_138 = &local_108;
        local_c0 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_108 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_108 = (undefined *)0x0;
        }
        if (local_168 != PTR_DAT_1405d8010) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          FUN_1400031d0(&local_108);
          local_108 = local_168;
          if (((local_168 != PTR_DAT_1405d8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_14034edd0(uVar9);
        }
        puVar10 = PTR_DAT_1405d98b8;
        FUN_14034fe70();
        local_f8 = PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar10);
        uVar9 = FUN_140002f00(&local_f8,uVar4);
        FUN_14034fd20(uVar9,puVar10,uVar4);
        FUN_140002fe0(&local_f8);
        (**(code **)(*param_1 + 0x28))(param_1,0xfdeb,&local_f8,&local_108);
        puVar10 = local_168;
        if (local_168 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfdeb,PTR_DAT_1405d98b8,puVar10);
        puVar10 = local_168;
        param_3 = local_res18;
        if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
           (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar12);
          }
          FUN_14034edd0(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_1405d98b8;
        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_1405d98b8);
      }
      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_1405d98b8;
    }
    else {
      if (local_res20[0] != 0xfdec) goto LAB_1403b2970;
      FUN_14035b390(local_a8);
      local_a4 = param_2[10];
      local_a8[0] = (undefined1)param_2[0x10];
      cVar3 = FUN_1403840e0(param_2,&local_168,8);
      if (cVar3 != '\0') {
        local_128 = local_168;
      }
      cVar3 = FUN_1403840e0(param_2,&local_168,8);
      if (cVar3 != '\0') {
        local_110 = local_168;
      }
      cVar3 = FUN_1403840e0(param_2,&local_168,8);
      if (cVar3 != '\0') {
        local_b8[0] = local_168;
      }
      cVar3 = FUN_1403840e0(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_1405d98c0);
      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_1405d98c0,&DAT_140477960);
        }
      }
      else if ((char)param_1[3] == '\0') {
        FUN_14034fe70();
        local_168 = PTR_DAT_1405d8010;
        FUN_1403a1bf0(&local_168,&local_128);
        FUN_140017790(&local_168,&DAT_14047edb0);
        FUN_1403a1bf0(&local_168,&local_110);
        FUN_140017790(&local_168,&DAT_14047edb0);
        FUN_1403a1bf0(&local_168,local_b8);
        FUN_140017790(&local_168,&DAT_14047edb0);
        FUN_1403a1b80(&local_168,&local_res10);
        FUN_140017790(&local_168,&DAT_14047edb0);
        iVar11 = 0;
        if ((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) {
          iVar11 = *(int *)(local_168 + -8);
        }
        plVar7 = (longlong *)FUN_1400174a0(&local_168,&local_d8,iVar11 + -2);
        if (local_168 == (undefined *)0x0) {
          local_168 = PTR_DAT_1405d8010;
        }
        if ((undefined *)*plVar7 != local_168) {
          ppuVar8 = (undefined **)FUN_14034fe70();
          local_138 = ppuVar8;
          FUN_14034ed40(ppuVar8);
          puVar10 = local_168;
          local_130 = 1;
          if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
             (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
            uVar9 = FUN_14034fe70();
            local_160 = uVar9;
            FUN_14034ed40(uVar9);
            local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
            piVar1 = (int *)(puVar10 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar12);
            }
            FUN_14034edd0(uVar9);
          }
          local_168 = (undefined *)*plVar7;
          if (((local_168 != PTR_DAT_1405d8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_14034edd0(ppuVar8);
        }
        if (((local_d8 != (undefined *)0x0) && (local_d8 != PTR_DAT_1405d8010)) &&
           (local_d8 + -8 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(local_d8 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(local_d8 + -8);
          }
          FUN_14034edd0(uVar9);
        }
        local_138 = &local_100;
        local_d8 = PTR_DAT_1405d8010;
        FUN_14034fe70();
        local_100 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_100 = (undefined *)0x0;
        }
        if (local_168 != PTR_DAT_1405d8010) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          FUN_1400031d0(&local_100);
          local_100 = local_168;
          if (((local_168 != PTR_DAT_1405d8010) && (local_168 != (undefined *)0x0)) &&
             (local_168 != (undefined *)0x8)) {
            *(int *)(local_168 + -4) = *(int *)(local_168 + -4) + 1;
          }
          FUN_14034edd0(uVar9);
        }
        puVar10 = PTR_DAT_1405d98c0;
        FUN_14034fe70();
        local_e0 = PTR_DAT_1405d8010;
        uVar4 = FUN_14034fcf0(puVar10);
        uVar9 = FUN_140002f00(&local_e0,uVar4);
        FUN_14034fd20(uVar9,puVar10,uVar4);
        FUN_140002fe0(&local_e0);
        (**(code **)(*param_1 + 0x28))(param_1,0xfdec,&local_e0,&local_100);
        puVar10 = local_168;
        if (local_168 == (undefined *)0x0) {
          puVar10 = PTR_DAT_1405d8010;
        }
        (**(code **)(*(longlong *)param_1[2] + 0x70))
                  ((longlong *)param_1[2],iVar2,0xfdec,PTR_DAT_1405d98c0,puVar10);
        puVar10 = local_168;
        param_3 = local_res18;
        if (((local_168 != (undefined *)0x0) && (local_168 != PTR_DAT_1405d8010)) &&
           (puVar12 = local_168 + -8, puVar12 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_160 = uVar9;
          FUN_14034ed40(uVar9);
          local_158 = (undefined *)CONCAT71(local_158._1_7_,1);
          piVar1 = (int *)(puVar10 + -4);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 == 0) {
            FUN_14034ff60(puVar12);
          }
          FUN_14034edd0(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_1405d98c0;
        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_1405d98c0);
      }
      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_1405d98c0;
    }
    local_150 = iVar2;
    local_148 = param_3;
    DVar6 = GetTickCount();
    local_140 = DVar6 - DVar5;
    (**(code **)(*param_1 + 0x18))(param_1,&local_160);
    return 1;
  }
LAB_1403b2970:
  FUN_140383db0(param_2,(int)((iVar11 >> 0x1f & 7U) + iVar11) >> 3);
  return 0;
}



undefined1
FUN_1403b29a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa01);
  FUN_140058570(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d98c8,0xfa01);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b2a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa01);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d98c8,0xfa01);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b2b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa02);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d98d0,0xfa02);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b2c50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa02);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d98d0,0xfa02);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b2d50(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa03);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d98d8,0xfa03);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b2e10(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa03);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d98d8,0xfa03);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b2ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa04);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058870(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d98e0,0xfa04);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b3000(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa04);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  FUN_140058870(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d98e0,0xfa04);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b3120(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa05);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = *(undefined2 *)(param_6 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_6 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_8 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_9 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d98e8,0xfa05);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1403b32b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa05);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = *(undefined2 *)(param_7 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_7 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_8 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_8 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_9 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_9 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar1 = *(undefined2 *)(param_10 + 0xc);
  FUN_140058470(local_30,*(undefined4 *)(param_10 + 8));
  FUN_140017c50(local_30,uVar1);
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d98e8,0xfa05);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1 FUN_1403b3450(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa07);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d98f8,0xfa07);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b3510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa07);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d98f8,0xfa07);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b35e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa08);
  FUN_140058870(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9900,0xfa08);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b36d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa08);
  FUN_140058870(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9900,0xfa08);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b37c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa09);
  FUN_140058470(local_30,*param_4);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9908,0xfa09);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b38b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa09);
  FUN_140058470(local_30,*param_5);
  FUN_1403859e0(local_30,param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9908,0xfa09);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b39a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0a);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9910,0xfa0a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b3a80(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0a);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9910,0xfa0a);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b3b60(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0b);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9918,0xfa0b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b3c40(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0b);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9918,0xfa0b);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b3d20(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0c);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9920,0xfa0c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b3e00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0c);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9920,0xfa0c);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b3ee0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0d);
  FUN_1403859e0(local_30,param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9928,0xfa0d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b3fc0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0d);
  FUN_1403859e0(local_30,param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9928,0xfa0d);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b40a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0e);
  FUN_140058670(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9930,0xfa0e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b4180(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0e);
  FUN_140058670(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9930,0xfa0e);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b4260(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0f);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9938,0xfa0f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b4350(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa0f);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9938,0xfa0f);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b4450(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9940,0xfa10);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b4510(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa10);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9940,0xfa10);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b45e0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa11);
  FUN_140058870(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9948,0xfa11);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b46c0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa11);
  FUN_140058870(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9948,0xfa11);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b47a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa12);
  FUN_140058470(local_30,*param_4);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9950,0xfa12);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b48a0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa12);
  FUN_140058470(local_30,*param_5);
  FUN_140058470(local_30,*param_6);
  FUN_140058470(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9950,0xfa12);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b49b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa13);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9958,0xfa13);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b4a90(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfa13);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9958,0xfa13);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b4b70(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfde9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9960,0xfde9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1 FUN_1403b4c30(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfde9);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9960,0xfde9);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b4d00(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfdea);
  FUN_140058470(local_30,*param_4);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9968,0xfdea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b4de0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfdea);
  FUN_140058470(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9968,0xfdea);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b4ec0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfdeb);
  FUN_140058670(local_30,*param_4);
  FUN_140058570(local_30,*param_5);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9970,0xfdeb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b4fb0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfdeb);
  FUN_140058670(local_30,*param_5);
  FUN_140058570(local_30,*param_6);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9970,0xfdeb);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b50b0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfdec);
  FUN_140058670(local_30,*param_4);
  FUN_140058670(local_30,*param_5);
  FUN_140058670(local_30,*param_6);
  FUN_140058570(local_30,*param_7);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_30,PTR_DAT_1405d9978,0xfdec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined1
FUN_1403b51d0(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_1403841b0(local_30);
  FUN_140383c40(local_30);
  FUN_140017c50(local_30,0xfdec);
  FUN_140058670(local_30,*param_5);
  FUN_140058670(local_30,*param_6);
  FUN_140058670(local_30,*param_7);
  FUN_140058570(local_30,*param_8);
  uVar1 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_30,PTR_DAT_1405d9978,0xfdec);
  FUN_140399690(local_28);
  if ((local_20 != 0) && (local_14 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar1;
}



undefined8 * FUN_1403b5300(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_14000d450(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_14034ff60(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_14034ff60(local_res8);
      }
    }
    if (lVar4 != 0) {
      lVar4 = *(longlong *)(lVar4 + 0x10);
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403b5470(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_1405d84f0 ^ (ulonglong)auStack_d78;
  if (*(int *)(param_1 + 0x1578) == 0) {
    FUN_1403ab450();
  }
  else {
    dVar1 = (double)(**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
    lVar5 = 0;
    if (DAT_1405d80f8 / *(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_1403841b0(local_d48);
      FUN_140383c40(local_d48);
      FUN_140384310(local_d48,0x800);
      FUN_140384310(local_d48,0);
      FUN_140058870(local_d48,0x1a);
      uVar2 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
      FUN_140058670(local_d48,uVar2);
      FUN_140058670(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_140399790();
        }
      }
      else {
        local_d30 = *(undefined4 *)(local_d40 + 0x18);
      }
      lVar3 = local_d38;
      if (local_d38 == 0) {
        if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        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_1405d81cc;
      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_1403d74d0(lVar4,1,&local_ca8,local_d20);
      if (local_28 == (undefined4 *)0x0) {
        FUN_14034f420(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (local_1c < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_d58 = &local_d40;
      FUN_140399690(&local_d40);
      if ((local_d38 != 0) && (local_d2c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
    FUN_1403a9c90(param_1 + 0xb8,DAT_1405d80f8 * 10.0 * 2.0 * 0.3);
    if (*(longlong *)(param_1 + 0x5d8) != 0) {
      lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
    }
    FUN_1403a9c50(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_1405f2490,&local_d58);
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403b5760(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_1405d84f0 ^ (ulonglong)auStack_d78;
  if ((*(int *)(param_1 + 0x1578) != 0) && (*(double *)(param_1 + 0x1890) != DAT_1405d8078)) {
    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_1403841b0(local_d58);
      FUN_140383c40(local_d58);
      FUN_140384310(local_d58,0x800);
      FUN_140384310(local_d58,0);
      FUN_140058870(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_140399790();
        }
      }
      else {
        local_d40 = *(undefined4 *)(local_d50 + 0x18);
      }
      lVar1 = local_d48;
      if (local_d48 == 0) {
        if (local_d50 == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        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_1405d81cc;
      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_1403d74d0(lVar2,1,&local_ca8,local_d20);
      if (local_28 == (undefined4 *)0x0) {
        FUN_14034f420(local_cf8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_cf8,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (local_1c < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_d30 = &local_d50;
      FUN_140399690(&local_d50);
      if ((local_d48 != 0) && (local_d3c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001403b5d41)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403b59c0(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_1405d84f0 ^ (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_1405d80f0;
        uVar4 = (**(code **)(*(longlong *)(param_1 + 0x70) + 0x1c0))(param_1 + 0x70);
        *(undefined8 *)(lVar3 + 0x80) = uVar4;
        if (*(char *)(lVar3 + 0x608) == '\0') {
          FUN_1403841b0(local_d78);
          FUN_140383c40(local_d78);
          FUN_140384310(local_d78,0x800);
          FUN_140384310(local_d78,0);
          FUN_140058870(local_d78,0x20);
          uVar4 = FUN_14035a290(param_1 + 0x1620);
          FUN_140058670(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_140399790();
            }
          }
          else {
            uVar2 = *(undefined4 *)(local_d70 + 0x18);
          }
          lVar5 = local_d68;
          if (local_d68 == 0) {
            if (local_d70 == 0) {
                    // WARNING: Subroutine does not return
              FUN_140399790();
            }
            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_1405d81cc;
          local_d30 = lVar5;
          uStack_d28 = uVar2;
          uStack_cc0 = uVar2;
          FUN_1403de1e0(lVar3 + 0x668,&local_cc8,local_d50);
          if (local_48 == (undefined4 *)0x0) {
            FUN_14034f420(local_d10,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
            _CxxThrowException(local_d10,(ThrowInfo *)&DAT_1405d36c0);
          }
          if (local_3c < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          local_40 = 0;
          local_d20 = &local_d70;
          FUN_140399690(&local_d70);
          if (local_d68 != 0) {
            if (local_d5c < 0) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            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_1405d8108 + dVar1;
          }
        }
      }
    }
    lVar3 = lVar7;
    if (lVar6 != 0) {
      lVar3 = *(longlong *)(lVar6 + 0x10);
    }
  } while( true );
}



void FUN_1403b5d80(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_14034ed40(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_1403841b0(local_50);
      FUN_140383c40(local_50);
      FUN_140384310(local_50,0x800);
      FUN_140384310(local_50,0);
      FUN_140058870(local_50,0x27);
      local_70[0] = 1;
      local_68 = 0;
      local_60 = 1;
      local_5c = 0xffffffff;
      local_58 = 1;
      local_57 = DAT_1405d81cc;
      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_14039b1d0(uVar4,1);
      FUN_1403e2100(lVar7,1,uVar3,&local_90,local_50,uVar8,local_70);
      FUN_140399690(local_48);
      if ((local_40 != 0) && (local_34 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
  }
  FUN_14034edd0(uVar5);
  return;
}



undefined8 FUN_1403b5f90(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_1403e2200(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_14034fef0(0x10);
        local_res10[1] = 1;
        *local_res10 = lVar6 + 0x40;
      }
      plVar1 = local_res10;
      FUN_1403aca30(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_14034ff60(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_14034fa20(&DAT_140464f50);
      }
      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_1403e25e0(lVar7,&local_38);
      if (cVar5 == '\0') {
        local_res18[0] = 0;
        FUN_1403aca30(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_1403e1be0(lVar8);
    }
    uVar9 = 1;
  }
  else {
    uVar9 = 0;
  }
  return uVar9;
}



undefined8 * FUN_1403b6140(undefined8 *param_1)

{
  undefined4 uVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  bool bVar5;
  longlong local_res10;
  
  LOCK();
  bVar5 = DAT_1405f39c0 == 0;
  if (bVar5) {
    DAT_1405f39c0 = 1;
  }
  UNLOCK();
  if (bVar5) {
    lVar3 = FUN_14034fef0(0x2c0);
    if (lVar3 == 0) {
      lVar3 = 0;
    }
    else {
      lVar3 = FUN_1403d7100(lVar3);
    }
    if (lVar3 == 0) {
      local_res10 = 0;
    }
    else {
      lVar4 = FUN_14034fef0(0x48);
      if (lVar4 != 0) {
        local_res10 = lVar4;
        uVar1 = FUN_1403c0cc0();
        FUN_14034ec60(lVar4,uVar1,1);
      }
      local_res10 = lVar4;
      FUN_14034ed40(lVar4);
      *(undefined8 *)(lVar4 + 0x40) = 1;
      *(longlong *)(lVar4 + 0x38) = lVar3;
      FUN_14034edd0(lVar4);
    }
    FUN_1403ac860(&DAT_1405f39c8,&local_res10);
    FUN_1403ac5a0(&local_res10);
    LOCK();
    UNLOCK();
    DAT_1405f39c0 = 2;
  }
  else {
    LOCK();
    iVar2 = DAT_1405f39c0;
    if (DAT_1405f39c0 == 9999) {
      DAT_1405f39c0 = 999;
      iVar2 = 9999;
    }
    UNLOCK();
    while (iVar2 != 2) {
      Sleep(5);
      LOCK();
      iVar2 = DAT_1405f39c0;
      if (DAT_1405f39c0 == 9999) {
        DAT_1405f39c0 = 999;
        iVar2 = 9999;
      }
      UNLOCK();
    }
  }
  *param_1 = 0;
  FUN_1403ac860(param_1,&DAT_1405f39c8);
  return param_1;
}



uint * FUN_1403b62a0(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_1403adbc0(param_1,param_2,uVar2);
  return (uint *)(lVar3 + 8);
}



void FUN_1403b6310(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_14034ff60(plVar1);
    }
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 != (longlong *)0x0) {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
    param_1[3] = param_1[3] + -1;
    return;
  }
  FUN_14034ff60(param_2);
  param_1[3] = param_1[3] + -1;
  return;
}



void FUN_1403b63b0(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_140399690(param_2 + 0x18);
  if (*(longlong *)(param_2 + 0x20) != 0) {
    if (*(int *)(param_2 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_2 + 0x28) = 0;
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
  }
  param_1[3] = param_1[3] + -1;
  return;
}



undefined1 FUN_1403b6420(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0xfa06);
  iVar1 = *(int *)(param_4 + 0x18);
  FUN_140385580(local_40,(longlong)iVar1);
  if (*(int *)(param_4 + 0x18) == 0) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined8 *)(param_4 + 0x10);
  }
  if (iVar1 == 0) goto LAB_1403b64e1;
  local_3c = 0;
  if (local_38 == 0) {
    if (local_30 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,uVar3);
    }
LAB_1403b64b3:
    FUN_1400178c0(&local_30,uVar3,iVar1);
  }
  else {
    if (local_30 != 0) goto LAB_1403b64b3;
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,uVar3);
    }
    FUN_140017a90(local_38,uVar3,iVar1);
  }
  FUN_140017b00(local_40);
LAB_1403b64e1:
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,local_res10,1,param_3,local_40,PTR_DAT_1405d98f0,0xfa06);
  local_res20 = &local_38;
  FUN_140399690(&local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined1
FUN_1403b6560(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_1403841b0(local_40);
  FUN_140383c40(local_40);
  FUN_140017c50(local_40,0xfa06);
  iVar1 = *(int *)(param_5 + 0x18);
  FUN_140385580(local_40,(longlong)iVar1);
  if (*(int *)(param_5 + 0x18) == 0) {
    uVar3 = 0;
  }
  else {
    uVar3 = *(undefined8 *)(param_5 + 0x10);
  }
  if (iVar1 == 0) goto LAB_1403b6630;
  local_3c = 0;
  if (local_38 == 0) {
    if (local_30 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,uVar3);
    }
LAB_1403b6602:
    FUN_1400178c0(&local_30,uVar3,iVar1);
  }
  else {
    if (local_30 != 0) goto LAB_1403b6602;
    if (local_38 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790(0,uVar3);
    }
    FUN_140017a90(local_38,uVar3,iVar1);
  }
  FUN_140017b00(local_40);
LAB_1403b6630:
  uVar2 = (**(code **)(*param_1 + 0x18))
                    (param_1,param_2,param_3,param_4,local_40,PTR_DAT_1405d98f0,0xfa06);
  FUN_140399690(&local_38);
  if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return uVar2;
}



undefined8 FUN_1403b66b0(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_14034ed40(uVar1);
  local_10 = 1;
  local_res8[0] = FUN_1403b5f90(*(undefined8 *)(param_1 + 0x20));
  if (local_res8[0] != '\0') {
    FUN_1403ab770(*(undefined8 *)(param_1 + 0x20));
    puVar5 = (undefined *)*param_4;
    if ((undefined *)*param_4 == (undefined *)0x0) {
      puVar5 = PTR_DAT_1405d8008;
    }
    uVar2 = FUN_140358200(local_30,puVar5);
    FUN_140353210(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_1405f2490,local_res8,uVar6);
  FUN_14034edd0(uVar1);
  return 1;
}



undefined8
FUN_1403b67a0(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_14034ed40(uVar3);
  local_18 = 1;
  lVar7 = 0;
  if ((*param_4 != '\0') && (cVar2 = FUN_1403b5f90(*(undefined8 *)(param_1 + 0x20)), cVar2 != '\0'))
  {
    FUN_1403ab770(*(undefined8 *)(param_1 + 0x20));
    puVar6 = (undefined *)*param_5;
    if ((undefined *)*param_5 == (undefined *)0x0) {
      puVar6 = PTR_DAT_1405d8008;
    }
    uVar4 = FUN_140358200(local_res8,puVar6);
    FUN_140353210(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_14034edd0(uVar3);
  return 1;
}



undefined8 * FUN_1403b68a0(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_14034ed40(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_1403b6948;
      if (*puVar2 == param_3) break;
      puVar2 = *(uint **)(puVar2 + 4);
    }
    FUN_1403aca30(param_2,puVar2 + 2,uVar3,(ulonglong)uVar1,uVar5,uVar6,1);
  }
LAB_1403b6948:
  FUN_14035d100(param_1 + 0x2ca);
  FUN_14034edd0(uVar4);
  return param_2;
}



longlong * FUN_1403b6970(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_14034ed40(uVar3);
  uVar8 = 1;
  FUN_1403b68a0(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_1403b69ff;
    }
    plVar5 = plVar4;
    if (param_2 == 1) {
      plVar5 = param_1 + 0xe1;
      goto LAB_1403b69ff;
    }
  }
  else {
    plVar5 = (longlong *)(*local_res8 + 0x168);
LAB_1403b69ff:
    if (plVar5 != (longlong *)0x0) {
      cVar2 = FUN_1403953f0(plVar5);
      if ((cVar2 == '\0') || (((char)plVar5[0x7f] == '\0' && ((int)plVar5[0x7d] == 0)))) {
        FUN_140017720(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_14034ff60(local_res8);
        }
        FUN_14034edd0(uVar3);
        return (longlong *)0x0;
      }
      goto LAB_1403b6ab8;
    }
  }
  if (local_res8 != (longlong *)0x0) {
    plVar4 = (longlong *)*local_res8;
  }
  pwVar6 = L"not NULL";
  if (plVar4 == (longlong *)0x0) {
    pwVar6 = L"NULL";
  }
  FUN_140017720(param_3,L"%d remote rp is %s in netclient!",param_2,pwVar6,uVar7,uVar3,uVar8);
LAB_1403b6ab8:
  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_14034ff60(local_res8);
  }
  FUN_14034edd0(uVar3);
  return plVar5;
}



undefined8 FUN_1403b6b20(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_14034ed40(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_14035d100(param_1 + 0x15e0);
        if (local_res8 != (longlong *)0x0) {
          lVar6 = *local_res8;
        }
        FUN_1403e0a90(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_14034ff60(local_res8);
          }
        }
        FUN_14034edd0(uVar5);
        return 1;
      }
    }
  }
  FUN_14035d100(param_1 + 0x15e0);
  FUN_14034edd0(uVar5);
  return 0;
}



double FUN_1403b6c80(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_14034ed40(uVar2);
  uVar7 = 1;
  dVar4 = (double)FUN_14035a290(param_1 + 0x15b0);
  FUN_1403b68a0(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_14034ff60(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_14034ff60(local_res8);
    }
  }
  FUN_14034edd0(uVar2);
  return dVar4;
}



undefined8 FUN_1403b6dc0(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_14034ed40(uVar2);
  if ((((longlong *)param_1[699] != (longlong *)0x0) && (*(longlong *)param_1[699] != 0)) &&
     ((int)param_1[0x2af] != 0)) {
    FUN_1403b68a0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
    }
  }
  FUN_14034edd0(uVar2);
  return 0;
}



void FUN_1403b6fc0(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_14034ed40(uVar3);
  if ((((longlong *)param_1[699] != (longlong *)0x0) && (*(longlong *)param_1[699] != 0)) &&
     ((int)param_1[0x2af] != 0)) {
    FUN_1403b68a0(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_14034ff60(local_res8);
    }
  }
  FUN_14034edd0(uVar3);
  return;
}



undefined8 FUN_1403b70e0(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_14034ed40(uVar2);
  FUN_1403b68a0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
    }
    FUN_14034edd0(uVar2);
    uVar2 = 1;
  }
  return uVar2;
}



undefined8 FUN_1403b7290(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_14034ed40(uVar3);
  FUN_1403b68a0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
    }
    FUN_14034edd0(uVar3);
    uVar3 = 1;
  }
  return uVar3;
}



undefined8 *
FUN_1403b7430(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_14034ed40(uVar2);
  plVar3 = (longlong *)FUN_1403b68a0(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_14034ff60(local_res8);
  }
  if (((lVar4 == 0) || (*(longlong **)(lVar4 + 0x18) == (longlong *)0x0)) ||
     (**(longlong **)(lVar4 + 0x18) == 0)) {
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = DAT_1405d83d0;
    *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  }
  else {
    lVar4 = FUN_1403de1c0(lVar4);
    *param_2 = Proud::AddrPort::vftable;
    *(undefined4 *)(param_2 + 1) = *(undefined4 *)(lVar4 + 0x130);
    *(undefined2 *)((longlong)param_2 + 0xc) = *(undefined2 *)(lVar4 + 0x134);
  }
  FUN_14034edd0(uVar2);
  return param_2;
}



undefined8 FUN_1403b7550(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_14034ed40(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_1403b7681;
      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_1403e2870(*(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_14034ff60(local_res8);
        }
      }
      FUN_14034edd0(uVar6);
      return 1;
    }
  }
LAB_1403b7681:
  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_14034ff60(local_res8);
    }
  }
  FUN_14034edd0(uVar6);
  return 0;
}



bool FUN_1403b76e0(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_14034ed40(uVar2);
  plVar3 = (longlong *)FUN_1403b68a0(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_14034ff60(local_res8);
  }
  if (lVar4 == 0) {
    FUN_14034edd0(uVar2);
  }
  else {
    *(undefined1 *)(lVar4 + 0x20) = 1;
    FUN_14034edd0(uVar2);
  }
  return lVar4 != 0;
}



ulonglong FUN_1403b77b0(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_14034ed40(uVar3);
  if (param_2 != 1) {
    plVar4 = (longlong *)FUN_1403b68a0(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_14034ff60(local_res8);
    }
    if (lVar6 != 0) {
      *(undefined1 *)(lVar6 + 0x21) = 1;
      FUN_1403de480(lVar6,param_3);
      cVar2 = FUN_140352ee0(param_3);
      if (((cVar2 == '\0') || (cVar2 = FUN_140352ee0(param_3 + 0x10), cVar2 == '\0')) ||
         (cVar2 = FUN_140352ee0(param_3 + 0x20), cVar2 == '\0')) {
        uVar5 = 0;
      }
      else {
        uVar5 = 1;
      }
      FUN_14034edd0(uVar3);
      return uVar5;
    }
  }
  uVar5 = FUN_14034edd0(uVar3);
  return uVar5 & 0xffffffffffffff00;
}



ulonglong FUN_1403b78d0(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_14034ed40(uVar3);
  if (param_2 != 1) {
    plVar4 = (longlong *)FUN_1403b68a0(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_14034ff60(local_res8);
    }
    if (lVar9 != 0) {
      FUN_1403de480(lVar9,param_3);
      cVar2 = FUN_140352ee0(param_3);
      if (((cVar2 == '\0') || (cVar2 = FUN_140352ee0(param_3 + 0x10), cVar2 == '\0')) ||
         (cVar2 = FUN_140352ee0(param_3 + 0x20), cVar2 == '\0')) {
        uVar7 = 0;
      }
      else {
        uVar7 = 1;
      }
      if ((*(longlong **)(lVar9 + 0x18) != (longlong *)0x0) && (**(longlong **)(lVar9 + 0x18) != 0))
      {
        lVar5 = FUN_1403de1c0(lVar9);
        lVar6 = lVar8;
        if (*(longlong **)(lVar5 + 0x100) != (longlong *)0x0) {
          lVar6 = **(longlong **)(lVar5 + 0x100);
        }
        cVar2 = FUN_140355560(lVar6);
        if (cVar2 == '\0') {
          (**(code **)(*(longlong *)(param_1 + 8) + 0x10))();
          lVar6 = FUN_1403de1c0(lVar9);
          if (*(longlong **)(lVar6 + 0x100) != (longlong *)0x0) {
            lVar8 = **(longlong **)(lVar6 + 0x100);
          }
          FUN_1403552c0(lVar8);
          FUN_1403e0360(lVar9,1,0x1e);
        }
      }
      FUN_14034edd0(uVar3);
      return uVar7;
    }
  }
  uVar7 = FUN_14034edd0(uVar3);
  return uVar7 & 0xffffffffffffff00;
}



undefined8 * FUN_1403b7a60(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_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  plVar2 = (longlong *)(**(code **)(*plVar2 + 0xb0))(plVar2,local_res18);
  puVar4 = (undefined *)*plVar2;
  if ((undefined *)*plVar2 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8010;
  }
  FUN_140017720(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_1405d8010)) &&
     (local_res18[0] + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    FUN_14034ed40(uVar3);
    piVar1 = (int *)(local_res18[0] + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_res18[0] + -8);
    }
    FUN_14034edd0(uVar3);
  }
  return param_2;
}



void FUN_1403b7b90(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_14034ed40(uVar3);
  FUN_1403b68a0(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_14034ff60(local_res8);
    }
  }
  FUN_14034edd0(uVar3);
  return;
}



undefined4 FUN_1403b7c50(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_14034ed40(uVar3);
  if (param_2 == 1) {
    *(undefined8 *)(param_1 + 0x14f8) = param_3;
    FUN_14034edd0(uVar3);
    uVar2 = 1;
  }
  else if (param_2 == *(int *)(param_1 + 0x1508)) {
    *(undefined8 *)(param_1 + 0x17f8) = param_3;
    FUN_14034edd0(uVar3);
    uVar2 = 1;
  }
  else {
    FUN_1403b68a0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(uVar3);
      uVar2 = 1;
    }
  }
  return uVar2;
}



longlong FUN_1403b7da0(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_14034ed40(uVar2);
  if (param_2 == 1) {
    lVar3 = param_1[0x2ad];
    FUN_14034edd0(uVar2);
  }
  else if (param_2 == (int)param_1[0x2af]) {
    lVar3 = param_1[0x30d];
    FUN_14034edd0(uVar2);
  }
  else {
    FUN_1403b68a0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(uVar5);
    }
  }
  return lVar3;
}



undefined8 FUN_1403b7ee0(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_1403b62a0(param_1,param_2);
  *puVar3 = *param_3;
  return 1;
}



void FUN_1403b7f70(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_14034ff60(puVar1);
  }
  return;
}



undefined8 * FUN_1403b7fe0(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_14000d450(0x80004005);
  }
  FUN_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  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_14034ff60(plVar1);
  }
  else {
    (**(code **)(*plVar3 + 0x10))(plVar3,plVar1);
  }
  param_1[3] = param_1[3] + -1;
  return param_2;
}



void FUN_1403b80b0(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_14034ff60(puVar4);
    }
  }
  return;
}



void FUN_1403b8150(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_14034ff60(plVar3);
    }
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_14034ff60(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



longlong FUN_1403b8220(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  
  if (param_2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1403b6310(param_1,param_2);
  return lVar1;
}



undefined8 *
FUN_1403b8290(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_14034fef0(0x18);
  }
  else {
    puVar2 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x18,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar2 != (undefined8 *)0x0) {
    puVar2[2] = 0;
    FUN_1403aca30(puVar2 + 2,param_2);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



void FUN_1403b8320(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_140399690(plVar2 + 3);
    if (plVar2[4] != 0) {
      if (*(int *)((longlong)plVar2 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(undefined4 *)(plVar2 + 5) = 0;
    }
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_14034ff60(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_1403b83c0(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_14034ff60(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_1403b8440(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_14000d450(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_14034ff60(plVar1);
  }
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar3);
  }
  return;
}



void FUN_1403b8510(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_14000d450(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_1403b8440(param_1,param_2,param_3);
  FUN_14035d100(param_1);
  return;
}



undefined2 * FUN_1403b8610(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_14034fef0(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_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar3);
  }
  FUN_14035d100(param_1);
  return puVar4;
}



undefined8
FUN_1403b8760(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_14034ed40(uVar2);
  plVar3 = (longlong *)FUN_1403b68a0(*(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_14034ff60(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_1403b8901;
    }
    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_1403aad30(pvVar4);
    }
    *(undefined2 *)(lVar5 + 0x34) = *(undefined2 *)(param_6 + 0xc);
    if (*(longlong **)(lVar6 + 0x28) != (longlong *)0x0) {
      lVar7 = **(longlong **)(lVar6 + 0x28);
    }
    *(longlong *)(lVar7 + 0x10) = lVar5;
  }
LAB_1403b8901:
  FUN_14034edd0(uVar2);
  return 1;
}



undefined8
FUN_1403b8920(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_14034ed40(uVar2);
  plVar3 = (longlong *)FUN_1403b68a0(*(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_14034ff60(local_res8);
  }
  if (((lVar4 != 0) && (*(char *)(lVar4 + 0x684) == '\0')) && (*(char *)(lVar4 + 0x608) == '\0')) {
    FUN_1403e0360(lVar4,0,*param_5);
  }
  FUN_14034edd0(uVar2);
  return 1;
}



undefined8 FUN_1403b8a00(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_14034ed40(uVar2);
  uVar7 = 1;
  plVar3 = (longlong *)FUN_1403b68a0(*(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_14034ff60(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_1405f2490,lVar4 + 0x56c,lVar4 + 0x40,(undefined4 *)(lVar4 + 0x44),uVar5
               ,uVar6,uVar7);
  }
  FUN_14034edd0(uVar2);
  return 1;
}



undefined8
FUN_1403b8b10(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_14034ed40(uVar2);
  local_20 = 1;
  plVar3 = (longlong *)FUN_1403b68a0(*(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_14034ff60(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_1405f2490,param_4,&local_38,*(longlong *)(param_1 + 0x20) + 0x4f8
               ,local_res8);
  }
  FUN_14034edd0(uVar2);
  return 1;
}



undefined8
FUN_1403b8c80(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_14034ed40(uVar2);
  plVar3 = (longlong *)
           FUN_1403b68a0(*(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_14034ff60(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_14035a290(*(longlong *)(param_1 + 0x20) + 0x1620);
    *(double *)(lVar4 + 0x150) = dVar5 - (*(double *)(lVar4 + 0x50) + *param_5);
  }
  FUN_14034edd0(uVar2);
  return 1;
}



undefined ** FUN_1403b8da0(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_14034ed40(uVar2);
  if (param_2 == 1) {
    FUN_14034edd0(uVar2);
    ppuVar3 = (undefined **)(param_1 + 0x2aa);
  }
  else if (param_2 == 0) {
    FUN_14034edd0(uVar2);
    ppuVar3 = &PTR_vftable_1405da130;
  }
  else if (param_2 == (int)param_1[0x2af]) {
    FUN_14034edd0(uVar2);
    ppuVar3 = (undefined **)(param_1 + 0xc);
  }
  else {
    FUN_1403b68a0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(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_14034ff60(local_res8);
      }
      FUN_14034edd0(uVar5);
    }
  }
  return ppuVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403b8ef0(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_1405d84f0 ^ (ulonglong)auStack_918;
  local_res20 = param_4;
  local_8e0 = param_2;
  FUN_14034fe70();
  local_8e8 = (int *)PTR_DAT_1405d8010;
  if (param_3 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1405d8010)) {
    iVar11 = local_8e8[-2];
  }
  iVar3 = iVar2;
  if (((iVar2 <= iVar11) && (iVar3 = iVar13, local_8e8 != (int *)0x0)) &&
     (local_8e8 != (int *)PTR_DAT_1405d8010)) {
    iVar3 = local_8e8[-2];
  }
  iVar11 = 1;
  if (1 < iVar3) {
    iVar11 = iVar3;
  }
  iVar3 = iVar13;
  if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1405d8010)) {
    iVar3 = local_8e8[-2];
  }
  if (iVar3 < iVar11) {
    if (local_8e8 == (int *)0x0) {
      local_8e8 = (int *)PTR_DAT_1405d8010;
    }
    if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (iVar11 == 0) {
      FUN_1400031d0(&local_8e8);
    }
    else {
      iVar3 = iVar13;
      if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1405d8010)) {
        iVar3 = local_8e8[-2];
      }
      if (iVar11 != iVar3) {
        piVar4 = (int *)FUN_14034fef0((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_1405d8010)) {
          iVar3 = local_8e8[-2];
        }
        piVar10 = (int *)PTR_DAT_1405d8010;
        if (iVar11 < iVar3) {
LAB_1403b9056:
          if (local_8e8 != (int *)0x0) {
            piVar10 = local_8e8;
          }
        }
        else {
          iVar11 = iVar13;
          if (local_8e8 != (int *)0x0) {
            if (local_8e8 != (int *)PTR_DAT_1405d8010) {
              iVar11 = local_8e8[-2];
            }
            goto LAB_1403b9056;
          }
        }
        FUN_14034fd20(piVar4 + 2,piVar10,iVar11);
        FUN_1400031d0(&local_8e8);
        local_8e8 = piVar4 + 2;
      }
    }
  }
  FUN_140002e10(&local_8e8);
  piVar4 = local_8e8;
  if (local_8e8 == (int *)0x0) {
    piVar4 = (int *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(piVar4,local_878,iVar2);
  piVar4 = local_8e8;
  if (local_8e8 == (int *)0x0) {
    piVar4 = (int *)PTR_DAT_1405d8010;
  }
  iVar2 = FUN_14034fcf0(piVar4);
  iVar11 = 0;
  if (0 < iVar2) {
    iVar11 = iVar2;
  }
  iVar2 = iVar13;
  if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1405d8010)) {
    iVar2 = local_8e8[-2];
  }
  if ((iVar2 <= iVar11) && (iVar11 = iVar13, local_8e8 != (int *)0x0)) {
    if (local_8e8 == (int *)PTR_DAT_1405d8010) goto LAB_1403b9118;
    iVar11 = local_8e8[-2];
  }
  if (((local_8e8 != (int *)PTR_DAT_1405d8010) && (local_8e8 != (int *)0x0)) &&
     (local_8e8 + -2 != (int *)0x0)) {
    local_8e8[-2] = iVar11;
    *(undefined2 *)((longlong)local_8e8 + (longlong)iVar11 * 2) = 0;
  }
LAB_1403b9118:
  if (*(char *)(param_1 + 0x1790) != '\0') {
    local_8f8 = &local_8e8;
    (**(code **)(*(longlong *)(param_1 + 0x1818) + 0xa0))
              ((longlong *)(param_1 + 0x1818),1,&DAT_1405f2490,&local_8e0);
  }
  if (*(int *)(param_1 + 0x6c8) != 0) {
    (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
    FUN_14034fe70();
    puVar8 = PTR_DAT_1405d8010;
    local_8dc = local_8e0;
    local_890 = local_8e0;
    local_898 = (int *)PTR_DAT_1405d8010;
    piVar4 = (int *)PTR_DAT_1405d8010;
    if (local_8e8 != (int *)PTR_DAT_1405d8010) {
      puVar5 = (undefined8 *)FUN_14034fe70();
      local_8a8 = puVar5;
      FUN_14034ed40(puVar5);
      local_8a0 = 1;
      if (((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1405d8010)) &&
         (puVar8 + -8 != (undefined *)0x0)) {
        uVar6 = FUN_14034fe70();
        local_8c0 = uVar6;
        FUN_14034ed40(uVar6);
        local_8b8 = 1;
        piVar4 = (int *)(puVar8 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(puVar8 + -8);
        }
        FUN_14034edd0(uVar6);
      }
      piVar4 = local_8e8;
      local_898 = local_8e8;
      if (((local_8e8 != (int *)PTR_DAT_1405d8010) && (local_8e8 != (int *)0x0)) &&
         (local_8e8 != (int *)0x8)) {
        local_8e8[-1] = local_8e8[-1] + 1;
      }
      FUN_14034edd0(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_14034fef0(0x28);
    }
    else {
      puVar5 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x28);
    }
    local_8b0 = puVar5;
    local_8a8 = puVar5;
    if (puVar5 != (undefined8 *)0x0) {
      FUN_14034fe70();
      puVar8 = PTR_DAT_1405d8010;
      puVar5[2] = PTR_DAT_1405d8010;
      if (puVar8 == (undefined *)0x0) {
        puVar5[2] = PTR_DAT_1405d8010;
      }
      if (piVar4 != (int *)puVar5[2]) {
        puVar8 = (undefined *)FUN_14034fe70();
        local_8d8 = puVar8;
        FUN_14034ed40(puVar8);
        local_8d0 = 1;
        FUN_1400031d0(puVar5 + 2);
        puVar5[2] = piVar4;
        if (((piVar4 != (int *)PTR_DAT_1405d8010) && (piVar4 != (int *)0x0)) &&
           (piVar4 != (int *)0x8)) {
          piVar4[-1] = piVar4[-1] + 1;
        }
        FUN_14034edd0(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_1403b7fe0(param_1 + 0x17b0,&local_8d8), puVar8 = local_8d8,
        local_8d8 != (undefined *)0x0)) &&
       ((local_8d8 != PTR_DAT_1405d8010 && (puVar12 = local_8d8 + -8, puVar12 != (undefined *)0x0)))
       ) {
      puVar9 = (undefined *)FUN_14034fe70();
      local_8d8 = puVar9;
      FUN_14034ed40(puVar9);
      local_8d0 = 1;
      piVar10 = (int *)(puVar8 + -4);
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_14034ff60(puVar12);
      }
      FUN_14034edd0(puVar9);
    }
    if (((piVar4 != (int *)0x0) && (piVar4 != (int *)PTR_DAT_1405d8010)) &&
       (piVar4 + -2 != (int *)0x0)) {
      puVar8 = (undefined *)FUN_14034fe70();
      local_8d8 = puVar8;
      FUN_14034ed40(puVar8);
      local_8d0 = 1;
      piVar10 = piVar4 + -1;
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_14034ff60(piVar4 + -2);
      }
      FUN_14034edd0(puVar8);
    }
  }
  piVar4 = local_8e8;
  if (((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1405d8010)) &&
     (piVar10 = local_8e8 + -2, piVar10 != (int *)0x0)) {
    puVar8 = (undefined *)FUN_14034fe70();
    local_8d8 = puVar8;
    FUN_14034ed40(puVar8);
    local_8d0 = 1;
    piVar4 = piVar4 + -1;
    *piVar4 = *piVar4 + -1;
    if (*piVar4 == 0) {
      FUN_14034ff60(piVar10);
    }
    FUN_14034edd0(puVar8);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403b9440(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_1405d84f0 ^ (ulonglong)auStack_918;
  local_res20 = param_4;
  local_8e0[0] = param_2;
  FUN_14034fe70();
  local_8e8 = (int *)PTR_DAT_1405d8010;
  if (param_3 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1405d8010)) {
    iVar11 = local_8e8[-2];
  }
  iVar3 = iVar2;
  if (((iVar2 <= iVar11) && (iVar3 = iVar13, local_8e8 != (int *)0x0)) &&
     (local_8e8 != (int *)PTR_DAT_1405d8010)) {
    iVar3 = local_8e8[-2];
  }
  iVar11 = 1;
  if (1 < iVar3) {
    iVar11 = iVar3;
  }
  iVar3 = iVar13;
  if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1405d8010)) {
    iVar3 = local_8e8[-2];
  }
  if (iVar3 < iVar11) {
    if (local_8e8 == (int *)0x0) {
      local_8e8 = (int *)PTR_DAT_1405d8010;
    }
    if (iVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (iVar11 == 0) {
      FUN_1400031d0(&local_8e8);
    }
    else {
      iVar3 = iVar13;
      if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1405d8010)) {
        iVar3 = local_8e8[-2];
      }
      if (iVar11 != iVar3) {
        piVar4 = (int *)FUN_14034fef0((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_1405d8010)) {
          iVar3 = local_8e8[-2];
        }
        piVar10 = (int *)PTR_DAT_1405d8010;
        if (iVar11 < iVar3) {
LAB_1403b95a6:
          if (local_8e8 != (int *)0x0) {
            piVar10 = local_8e8;
          }
        }
        else {
          iVar11 = iVar13;
          if (local_8e8 != (int *)0x0) {
            if (local_8e8 != (int *)PTR_DAT_1405d8010) {
              iVar11 = local_8e8[-2];
            }
            goto LAB_1403b95a6;
          }
        }
        FUN_14034fd20(piVar4 + 2,piVar10,iVar11);
        FUN_1400031d0(&local_8e8);
        local_8e8 = piVar4 + 2;
      }
    }
  }
  FUN_140002e10(&local_8e8);
  piVar4 = local_8e8;
  if (local_8e8 == (int *)0x0) {
    piVar4 = (int *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(piVar4,local_878,iVar2);
  piVar4 = local_8e8;
  if (local_8e8 == (int *)0x0) {
    piVar4 = (int *)PTR_DAT_1405d8010;
  }
  iVar2 = FUN_14034fcf0(piVar4);
  iVar11 = 0;
  if (0 < iVar2) {
    iVar11 = iVar2;
  }
  iVar2 = iVar13;
  if ((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1405d8010)) {
    iVar2 = local_8e8[-2];
  }
  if ((iVar2 <= iVar11) && (iVar11 = iVar13, local_8e8 != (int *)0x0)) {
    if (local_8e8 == (int *)PTR_DAT_1405d8010) goto LAB_1403b9668;
    iVar11 = local_8e8[-2];
  }
  if (((local_8e8 != (int *)PTR_DAT_1405d8010) && (local_8e8 != (int *)0x0)) &&
     (local_8e8 + -2 != (int *)0x0)) {
    local_8e8[-2] = iVar11;
    *(undefined2 *)((longlong)local_8e8 + (longlong)iVar11 * 2) = 0;
  }
LAB_1403b9668:
  if (*(char *)(param_1 + 0x1790) != '\0') {
    local_8f8 = &local_8e8;
    (**(code **)(*(longlong *)(param_1 + 0x1818) + 0xb0))
              ((longlong *)(param_1 + 0x1818),1,&DAT_1405f2490,local_8e0);
  }
  if (*(int *)(param_1 + 0x6c8) != 0) {
    (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
    FUN_14034fe70();
    puVar8 = PTR_DAT_1405d8010;
    local_890 = 2;
    local_898 = (int *)PTR_DAT_1405d8010;
    piVar4 = (int *)PTR_DAT_1405d8010;
    if (local_8e8 != (int *)PTR_DAT_1405d8010) {
      puVar5 = (undefined8 *)FUN_14034fe70();
      local_8a8 = puVar5;
      FUN_14034ed40(puVar5);
      local_8a0 = 1;
      if (((puVar8 != (undefined *)0x0) && (puVar8 != PTR_DAT_1405d8010)) &&
         (puVar8 + -8 != (undefined *)0x0)) {
        uVar6 = FUN_14034fe70();
        local_8c0 = uVar6;
        FUN_14034ed40(uVar6);
        local_8b8 = 1;
        piVar4 = (int *)(puVar8 + -4);
        *piVar4 = *piVar4 + -1;
        if (*piVar4 == 0) {
          FUN_14034ff60(puVar8 + -8);
        }
        FUN_14034edd0(uVar6);
      }
      piVar4 = local_8e8;
      local_898 = local_8e8;
      if (((local_8e8 != (int *)PTR_DAT_1405d8010) && (local_8e8 != (int *)0x0)) &&
         (local_8e8 != (int *)0x8)) {
        local_8e8[-1] = local_8e8[-1] + 1;
      }
      FUN_14034edd0(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_14034fef0(0x28);
    }
    else {
      puVar5 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x28);
    }
    local_8b0 = puVar5;
    local_8a8 = puVar5;
    if (puVar5 != (undefined8 *)0x0) {
      FUN_14034fe70();
      puVar8 = PTR_DAT_1405d8010;
      puVar5[2] = PTR_DAT_1405d8010;
      if (puVar8 == (undefined *)0x0) {
        puVar5[2] = PTR_DAT_1405d8010;
      }
      if (piVar4 != (int *)puVar5[2]) {
        puVar8 = (undefined *)FUN_14034fe70();
        local_8d8 = puVar8;
        FUN_14034ed40(puVar8);
        local_8d0 = 1;
        FUN_1400031d0(puVar5 + 2);
        puVar5[2] = piVar4;
        if (((piVar4 != (int *)PTR_DAT_1405d8010) && (piVar4 != (int *)0x0)) &&
           (piVar4 != (int *)0x8)) {
          piVar4[-1] = piVar4[-1] + 1;
        }
        FUN_14034edd0(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_1403b7fe0(param_1 + 0x17b0,&local_8d8), puVar8 = local_8d8,
        local_8d8 != (undefined *)0x0)) &&
       ((local_8d8 != PTR_DAT_1405d8010 && (puVar12 = local_8d8 + -8, puVar12 != (undefined *)0x0)))
       ) {
      puVar9 = (undefined *)FUN_14034fe70();
      local_8d8 = puVar9;
      FUN_14034ed40(puVar9);
      local_8d0 = 1;
      piVar10 = (int *)(puVar8 + -4);
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_14034ff60(puVar12);
      }
      FUN_14034edd0(puVar9);
    }
    if (((piVar4 != (int *)0x0) && (piVar4 != (int *)PTR_DAT_1405d8010)) &&
       (piVar4 + -2 != (int *)0x0)) {
      puVar8 = (undefined *)FUN_14034fe70();
      local_8d8 = puVar8;
      FUN_14034ed40(puVar8);
      local_8d0 = 1;
      piVar10 = piVar4 + -1;
      *piVar10 = *piVar10 + -1;
      if (*piVar10 == 0) {
        FUN_14034ff60(piVar4 + -2);
      }
      FUN_14034edd0(puVar8);
    }
  }
  piVar4 = local_8e8;
  if (((local_8e8 != (int *)0x0) && (local_8e8 != (int *)PTR_DAT_1405d8010)) &&
     (piVar10 = local_8e8 + -2, piVar10 != (int *)0x0)) {
    puVar8 = (undefined *)FUN_14034fe70();
    local_8d8 = puVar8;
    FUN_14034ed40(puVar8);
    local_8d0 = 1;
    piVar4 = piVar4 + -1;
    *piVar4 = *piVar4 + -1;
    if (*piVar4 == 0) {
      FUN_14034ff60(piVar10);
    }
    FUN_14034edd0(puVar8);
  }
  return;
}



undefined8 FUN_1403b9990(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_14034ed40(uVar3);
  plVar4 = (longlong *)FUN_1403b68a0(*(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_14034ff60(local_res8);
  }
  if (lVar5 != 0) {
    FUN_1403de040(lVar5,1);
    *(undefined4 *)(lVar5 + 0x61c) = 0;
    uVar6 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x70) + 0x1c0))();
    *(undefined8 *)(lVar5 + 0x620) = uVar6;
    *(undefined1 *)(lVar5 + 0x20) = 0;
    FUN_1403e0270(lVar5);
    lVar2 = *(longlong *)(param_1 + 0x20);
    if ((*(char *)(lVar2 + 0x1790) != '\0') || (*(int *)(lVar2 + 0x6c8) != 0)) {
      FUN_1403b8ef0(lVar2,1,&DAT_1404656d0,*(undefined4 *)(lVar5 + 0x56c));
    }
  }
  FUN_14034edd0(uVar3);
  return 1;
}



undefined8 FUN_1403b9ac0(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_14034ed40(uVar3);
  uVar8 = 1;
  plVar4 = (longlong *)FUN_1403b68a0(*(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_14034ff60(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_1403b8ef0(lVar2,1,&DAT_140465748,*(undefined4 *)(lVar5 + 0x56c),uVar6,uVar7,uVar8);
    }
  }
  FUN_14034edd0(uVar3);
  return 1;
}



void FUN_1403b9bc0(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_14034ed40(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_1405d8010;
    }
    FUN_1403b8ef0(param_1 + -0x78,0,L"Socket Warning: %s",puVar2,uVar3,uVar4,1);
  }
  FUN_14034edd0(uVar1);
  FUN_1400031d0(param_3);
  return;
}



void FUN_1403b9c60(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_1403b8150();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_1403b9c90(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_1403b8320();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_1403b9cc0(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_1403b83c0();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_1403b9cf0(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_14035d100();
  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_14034ff60(plVar1);
    }
    plVar1 = *(longlong **)(param_1 + 0x50);
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60(lVar5);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar5);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar5 = lVar6;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar3 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



undefined8 FUN_1403b9e70(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035d100(param_1);
  uVar2 = FUN_1403b8610(param_1,param_2,param_3,param_4);
  FUN_14035d100(param_1);
  return uVar2;
}



undefined8 FUN_1403b9ef0(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_14034ed40(uVar2);
  plVar3 = (longlong *)
           FUN_1403b68a0(*(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_14034ff60(local_res8);
  }
  if ((lVar4 != 0) && (*(char *)(lVar4 + 0x684) == '\0')) {
    local_res20 = 0;
    FUN_1403b80b0(lVar4 + 0x28,&local_res20);
  }
  FUN_14034edd0(uVar2);
  return 1;
}



void FUN_1403b9fd0(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_14038d950(param_5,0);
  uVar17 = (ulonglong)*(int *)(lVar3 + 0x18);
  FUN_1403a2ba0(&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_1403a35c0(&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_1403b5300(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_14034ff60(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_14034f800();
      }
      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_1403ab450(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_14034fe70();
  param_5 = (int *)PTR_DAT_1405d8010;
  iVar5 = FUN_14034fcf0(L"ExtractMessageFromUdpRecvQueue : addedCount < 0");
  iVar16 = 0;
  iVar4 = 0;
  if ((param_5 != (int *)0x0) && (iVar4 = 0, param_5 != (int *)PTR_DAT_1405d8010)) {
    iVar4 = param_5[-2];
  }
  iVar6 = iVar5;
  if (((iVar5 <= iVar4) && (iVar6 = iVar16, param_5 != (int *)0x0)) &&
     (param_5 != (int *)PTR_DAT_1405d8010)) {
    iVar6 = param_5[-2];
  }
  iVar4 = 1;
  if (1 < iVar6) {
    iVar4 = iVar6;
  }
  iVar6 = iVar16;
  if ((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1405d8010)) {
    iVar6 = param_5[-2];
  }
  iVar15 = 0;
  if (iVar6 < iVar4) {
    if (param_5 == (int *)0x0) {
      param_5 = (int *)PTR_DAT_1405d8010;
    }
    if (iVar4 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (iVar4 == 0) {
      FUN_1400031d0(&param_5);
    }
    else {
      iVar6 = iVar16;
      if ((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1405d8010)) {
        iVar6 = param_5[-2];
      }
      if (iVar4 != iVar6) {
        piVar7 = (int *)FUN_14034fef0((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_1405d8010)) {
          iVar6 = param_5[-2];
        }
        piVar11 = (int *)PTR_DAT_1405d8010;
        if (iVar4 < iVar6) {
LAB_1403ba152:
          if (param_5 != (int *)0x0) {
            piVar11 = param_5;
          }
        }
        else {
          iVar4 = iVar16;
          if (param_5 != (int *)0x0) {
            if (param_5 != (int *)PTR_DAT_1405d8010) {
              iVar4 = param_5[-2];
            }
            goto LAB_1403ba152;
          }
        }
        FUN_14034fd20(piVar7 + 2,piVar11,iVar4);
        FUN_1400031d0(&param_5);
        param_5 = piVar7 + 2;
      }
    }
  }
  FUN_140002e10(&param_5);
  piVar7 = param_5;
  if (param_5 == (int *)0x0) {
    piVar7 = (int *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(piVar7,L"ExtractMessageFromUdpRecvQueue : addedCount < 0",iVar5);
  piVar7 = param_5;
  if (param_5 == (int *)0x0) {
    piVar7 = (int *)PTR_DAT_1405d8010;
  }
  iVar5 = FUN_14034fcf0(piVar7);
  iVar4 = 0;
  if (0 < iVar5) {
    iVar4 = iVar5;
  }
  iVar5 = iVar15;
  if ((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1405d8010)) {
    iVar5 = param_5[-2];
  }
  if ((iVar5 <= iVar4) && (iVar4 = iVar15, param_5 != (int *)0x0)) {
    if (param_5 == (int *)PTR_DAT_1405d8010) goto LAB_1403ba20a;
    iVar4 = param_5[-2];
  }
  if (((param_5 != (int *)PTR_DAT_1405d8010) && (param_5 != (int *)0x0)) &&
     (param_5 + -2 != (int *)0x0)) {
    param_5[-2] = iVar4;
    *(undefined2 *)((longlong)param_5 + (longlong)iVar4 * 2) = 0;
  }
LAB_1403ba20a:
  local_b0 = 0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  local_b8 = Proud::ByteArray::vftable;
  uVar8 = FUN_14035bed0(local_68,*param_6,(int)param_1[0x2af],&param_5,&local_b8);
  (**(code **)(*param_1 + 0x88))(param_1,uVar8);
  FUN_1403555d0(&local_b8);
  piVar7 = param_5;
  if (((param_5 != (int *)0x0) && (param_5 != (int *)PTR_DAT_1405d8010)) &&
     (piVar11 = param_5 + -2, piVar11 != (int *)0x0)) {
    uVar8 = FUN_14034fe70();
    local_58 = uVar8;
    FUN_14034ed40(uVar8);
    local_50 = 1;
    piVar7 = piVar7 + -1;
    *piVar7 = *piVar7 + -1;
    if (*piVar7 == 0) {
      FUN_14034ff60(piVar11);
    }
    FUN_14034edd0(uVar8);
  }
  return;
}



void FUN_1403ba480(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_14038d950(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_1403a3ba0(uVar9 + 0x130,param_2,1,*(undefined4 *)((longlong)param_1 + 0x6a4),
                        local_res8);
  if (-1 < iVar3) {
    return;
  }
  FUN_14034fe70();
  local_res18 = (uint *)PTR_DAT_1405d8010;
  uVar4 = FUN_14034fcf0(L"Received stream from TCP server became inconsistent!");
  uVar6 = 0;
  uVar9 = uVar12;
  if ((local_res18 != (uint *)0x0) && (uVar9 = 0, local_res18 != (uint *)PTR_DAT_1405d8010)) {
    uVar9 = (ulonglong)local_res18[-2];
  }
  uVar5 = uVar4;
  if ((((int)uVar4 <= (int)uVar9) && (uVar5 = uVar6, local_res18 != (uint *)0x0)) &&
     (local_res18 != (uint *)PTR_DAT_1405d8010)) {
    uVar5 = local_res18[-2];
  }
  uVar11 = 1;
  if (1 < (int)uVar5) {
    uVar11 = uVar5;
  }
  uVar5 = uVar6;
  if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
    uVar5 = local_res18[-2];
  }
  uVar13 = 0;
  if ((int)uVar5 < (int)uVar11) {
    if (local_res18 == (uint *)0x0) {
      local_res18 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar11 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar11 == 0) {
      FUN_1400031d0(&local_res18);
    }
    else {
      uVar5 = uVar6;
      if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
        uVar5 = local_res18[-2];
      }
      if (uVar11 != uVar5) {
        puVar7 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar5 = local_res18[-2];
        }
        puVar10 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar11 < (int)uVar5) {
LAB_1403ba5fb:
          if (local_res18 != (uint *)0x0) {
            puVar10 = local_res18;
          }
        }
        else {
          uVar11 = uVar6;
          if (local_res18 != (uint *)0x0) {
            if (local_res18 != (uint *)PTR_DAT_1405d8010) {
              uVar11 = local_res18[-2];
            }
            goto LAB_1403ba5fb;
          }
        }
        FUN_14034fd20(puVar7 + 2,puVar10,uVar11);
        FUN_1400031d0(&local_res18);
        local_res18 = puVar7 + 2;
      }
    }
  }
  FUN_140002e10(&local_res18);
  puVar7 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,L"Received stream from TCP server became inconsistent!",uVar4);
  puVar7 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8010;
  }
  uVar6 = FUN_14034fcf0(puVar7);
  uVar4 = 0;
  if (0 < (int)uVar6) {
    uVar4 = uVar6;
  }
  uVar6 = uVar13;
  if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
    uVar6 = local_res18[-2];
  }
  if (((int)uVar6 <= (int)uVar4) && (uVar4 = uVar13, local_res18 != (uint *)0x0)) {
    if (local_res18 == (uint *)PTR_DAT_1405d8010) goto LAB_1403ba6ab;
    uVar4 = local_res18[-2];
  }
  if (((local_res18 != (uint *)PTR_DAT_1405d8010) && (local_res18 != (uint *)0x0)) &&
     (local_res18 + -2 != (uint *)0x0)) {
    local_res18[-2] = uVar4;
    *(undefined2 *)((longlong)local_res18 + (longlong)(int)uVar4 * 2) = 0;
  }
LAB_1403ba6ab:
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_30 = 0;
  local_50 = Proud::ByteArray::vftable;
  uVar8 = FUN_14035bed0(local_res20,local_res8[0],1,&local_res18,&local_50);
  (**(code **)(*param_1 + 0x80))(param_1,uVar8);
  FUN_1403555d0(&local_50);
  puVar7 = local_res18;
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar10 = local_res18 + -2, puVar10 != (uint *)0x0)) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    puVar7 = puVar7 + -1;
    *puVar7 = *puVar7 - 1;
    if (*puVar7 == 0) {
      FUN_14034ff60(puVar10);
    }
    FUN_14034edd0(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_1403552c0(uVar12);
  }
  return;
}



void FUN_1403ba7a0(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_1403841b0(local_58);
  FUN_140383c40(local_58);
  FUN_140384310(local_58,0x800);
  FUN_140384310(local_58,0);
  FUN_140058870(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_140399790();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar2 = *(int *)(local_50 + 0x18);
    FUN_1400179d0(local_50,iVar2 + 0x10);
    lVar8 = lVar9;
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar8 = *(longlong *)(local_50 + 0x10);
    }
    puVar7 = (undefined8 *)(lVar8 + iVar2);
    goto LAB_1403ba888;
  }
  lVar8 = (longlong)local_40;
  local_40 = local_40 + 0x10;
  if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  puVar7 = (undefined8 *)(local_48 + lVar8);
LAB_1403ba888:
  *puVar7 = local_88;
  puVar7[1] = CONCAT26(uStack_7a,CONCAT24(uStack_7c,uStack_80));
  FUN_140017b00(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_1403b8ef0(param_1,1,L"Sending ServerHolepunch: %s",local_res8);
    if (((local_res8 != (longlong *)0x0) && (local_res8 != (longlong *)PTR_DAT_1405d8010)) &&
       (local_res8 + -1 != (longlong *)0x0)) {
      ppuVar6 = (undefined **)FUN_14034fe70();
      local_88 = ppuVar6;
      FUN_14034ed40(ppuVar6);
      uStack_80 = CONCAT31(uStack_80._1_3_,1);
      piVar1 = (int *)((longlong)local_res8 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_res8 + -1);
      }
      FUN_14034edd0(ppuVar6);
    }
  }
  local_78[0] = 5;
  local_70 = 0;
  local_68 = 1;
  local_64 = 0xffffffff;
  local_60 = 1;
  local_5f = DAT_1405d81cc;
  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_14039b1d0(uVar5,1);
  FUN_1403e2100(lVar9,1,uVar4,&local_88,local_58,uVar3,local_78);
  local_res8 = &local_50;
  FUN_140399690(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



void FUN_1403baa50(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_14034ed40(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_1405d8078) {
          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_1405d8080;
            FUN_1403ba7a0(param_1);
          }
        }
      }
    }
  }
  FUN_14034edd0(uVar3);
  return;
}



void FUN_1403bac20(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_14034ed40(uVar6);
  local_78 = 1;
  local_90 = Proud::AddrPort::vftable;
  local_88 = *(undefined4 *)(param_2 + 8);
  local_84 = *(undefined2 *)(param_2 + 0xc);
  FUN_1403b5300(plVar2,&local_res10,&local_90);
  FUN_14034fe70();
  local_res8 = (uint *)PTR_DAT_1405d8010;
  uVar4 = FUN_14034fcf0(param_3);
  uVar12 = 0;
  uVar13 = 0;
  uVar10 = uVar12;
  if ((local_res8 != (uint *)0x0) && (uVar10 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar10 = local_res8[-2];
  }
  uVar5 = uVar4;
  if ((((int)uVar4 <= (int)uVar10) && (uVar5 = uVar13, local_res8 != (uint *)0x0)) &&
     (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar5 = local_res8[-2];
  }
  uVar10 = 1;
  if (1 < (int)uVar5) {
    uVar10 = uVar5;
  }
  uVar5 = uVar13;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar5 = local_res8[-2];
  }
  uVar11 = 0;
  if ((int)uVar5 < (int)uVar10) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar10 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar10 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar5 = uVar13;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar5 = local_res8[-2];
      }
      if (uVar10 != uVar5) {
        puVar7 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar5 = local_res8[-2];
        }
        puVar9 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar10 < (int)uVar5) {
LAB_1403bad93:
          if (local_res8 != (uint *)0x0) {
            puVar9 = local_res8;
          }
        }
        else {
          uVar10 = uVar13;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1405d8010) {
              uVar10 = local_res8[-2];
            }
            goto LAB_1403bad93;
          }
        }
        FUN_14034fd20(puVar7 + 2,puVar9,uVar10);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar7 + 2;
      }
    }
  }
  FUN_140002e10(&local_res8);
  puVar7 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,param_3,uVar4);
  puVar7 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8010;
  }
  uVar4 = FUN_14034fcf0(puVar7);
  plVar1 = local_res10;
  uVar10 = 0;
  if (0 < (int)uVar4) {
    uVar10 = uVar4;
  }
  uVar4 = uVar11;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar4 = local_res8[-2];
  }
  if (((int)uVar4 <= (int)uVar10) && (uVar10 = uVar11, local_res8 != (uint *)0x0)) {
    if (local_res8 == (uint *)PTR_DAT_1405d8010) goto LAB_1403bae43;
    uVar10 = local_res8[-2];
  }
  if (((local_res8 != (uint *)PTR_DAT_1405d8010) && (local_res8 != (uint *)0x0)) &&
     (local_res8 + -2 != (uint *)0x0)) {
    local_res8[-2] = uVar10;
    *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar10 * 2) = 0;
  }
LAB_1403bae43:
  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_14035bed0(local_res20,0x1f,uVar12,&local_res8,&local_60);
  (**(code **)(*plVar2 + 0x88))(plVar2,uVar8);
  FUN_1403555d0(&local_60);
  puVar7 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar9 = local_res8 + -2, puVar9 != (uint *)0x0)) {
    uVar8 = FUN_14034fe70();
    local_70 = uVar8;
    FUN_14034ed40(uVar8);
    local_68 = 1;
    puVar7 = puVar7 + -1;
    *puVar7 = *puVar7 - 1;
    if (*puVar7 == 0) {
      FUN_14034ff60(puVar9);
    }
    FUN_14034edd0(uVar8);
    local_68 = 0;
  }
  local_res8 = (uint *)PTR_DAT_1405d8010;
  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_14034ff60(local_res10);
      uVar6 = local_80;
    }
  }
  FUN_14034edd0(uVar6);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403bb36c)
// WARNING: Removing unreachable block (ram,0x0001403bb37b)
// WARNING: Removing unreachable block (ram,0x0001403bb380)
// WARNING: Removing unreachable block (ram,0x0001403bb3be)
// WARNING: Removing unreachable block (ram,0x0001403bb390)
// WARNING: Removing unreachable block (ram,0x0001403bb3af)
// WARNING: Removing unreachable block (ram,0x0001403bb3a1)
// WARNING: Removing unreachable block (ram,0x0001403bb3b7)
// WARNING: Removing unreachable block (ram,0x0001403bb3bc)

undefined8 FUN_1403baf60(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_14034ed40(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_1403b7fe0(param_1 + 0x2e8,local_68);
    puVar10 = (undefined8 *)FUN_14034fef0(0x28);
    local_res8 = puVar10;
    local_res20 = puVar10;
    if (puVar10 != (undefined8 *)0x0) {
      FUN_14034fe70();
      puVar10[2] = PTR_DAT_1405d8010;
      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_1405d8010)) &&
       (puVar13 = local_68[0] + -8, puVar13 != (undefined *)0x0)) {
      uVar11 = FUN_14034fe70();
      local_90 = uVar11;
      FUN_14034ed40(uVar11);
      local_88 = 1;
      piVar1 = (int *)(puVar16 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar13);
      }
      FUN_14034edd0(uVar11);
      local_88 = 0;
    }
    puVar2 = puVar10;
    puVar3 = puVar15;
    param_1 = puVar4;
    puVar10 = local_110;
    lVar9 = puVar4[0x2eb];
  }
  FUN_14034edd0(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_140392d10(), 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_14000d450(0x80004005);
      }
      puVar2 = (undefined8 *)*puVar3;
      FUN_1400031d0(puVar3 + 2);
      FUN_14034ff60(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_140392d10();
    }
    local_res18[0] = 0xfeff;
    BVar8 = WriteFile(hFile,local_res18,2,(LPDWORD)&local_res8,(LPOVERLAPPED)0x0);
    if (BVar8 == 0) {
      FUN_140392d10();
    }
    FUN_14034fe70();
    local_118 = PTR_DAT_1405d8010;
    puVar16 = PTR_DAT_1405d8010;
    while (puVar14 != (undefined8 *)0x0) {
      FUN_1403b7fe0(&local_110,&local_b8);
      local_c8 = local_a8;
      puVar14 = (undefined8 *)FUN_1403933d0(&local_c8,&local_c0,&DAT_1404595d8);
      puVar16 = local_b8;
      if (local_b8 == (undefined *)0x0) {
        puVar16 = PTR_DAT_1405d8010;
      }
      uVar11 = *puVar14;
      uVar12 = FUN_1403a1680(local_b0);
      FUN_140017720(&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_1405d8010;
      if (local_118 != (undefined *)0x0) {
        pvVar18 = (HANDLE)0x0;
        if (local_118 != PTR_DAT_1405d8010) {
          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_140392d10();
      }
      puVar13 = local_b8;
      puVar10 = local_110;
      puVar14 = local_f8;
      if (((local_b8 != (undefined *)0x0) && (local_b8 != PTR_DAT_1405d8010)) &&
         (puVar17 = local_b8 + -8, puVar17 != (undefined *)0x0)) {
        uVar11 = FUN_14034fe70();
        local_a0 = uVar11;
        FUN_14034ed40(uVar11);
        local_98 = 1;
        piVar1 = (int *)(puVar13 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar17);
        }
        FUN_14034edd0(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_1405d8010)) &&
       (puVar16 + -8 != (undefined *)0x0)) {
      uVar11 = FUN_14034fe70();
      local_78 = uVar11;
      FUN_14034ed40(uVar11);
      local_70 = 1;
      piVar1 = (int *)(puVar16 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar16 + -8);
      }
      FUN_14034edd0(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_1403bb400(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_1405d81b8 < 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_14039bd30(*(undefined8 *)(lVar10 + 0x108),&local_50);
      iVar11 = iVar11 + iVar5;
    }
    if ((double)param_1[0x2f5] == 0.0) {
      if (DAT_1405d8194 < iVar11) {
        param_1[0x2f5] = (longlong)dVar12;
      }
    }
    else if (DAT_1405d8194 < iVar11) {
      if (_DAT_1405d81b0 < dVar12 - (double)param_1[0x2f5]) {
        param_1[0x2f5] = (longlong)dVar12;
        FUN_14034fe70();
        local_res8 = PTR_DAT_1405d8010;
        FUN_140017720(&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_14035bed0(local_res10,0x25,1,&local_res8,&local_40);
        (**(code **)(*param_1 + 0x88))(param_1,uVar6);
        FUN_1403555d0(&local_40);
        puVar4 = local_res8;
        if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
          ppuVar7 = (undefined **)FUN_14034fe70();
          local_50 = ppuVar7;
          FUN_14034ed40(ppuVar7);
          local_48 = CONCAT31(local_48._1_3_,1);
          piVar2 = (int *)(puVar4 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(ppuVar7);
        }
      }
    }
    else {
      param_1[0x2f5] = 0;
    }
    param_1[0x2f4] = (longlong)dVar12;
  }
  return;
}



void FUN_1403bb660(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_1403b8290(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_14034ff60(param_2);
  }
  return;
}



undefined8 FUN_1403bb720(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_1403b8510(param_1,puVar1);
        return 1;
      }
    }
  }
  return 0;
}



void FUN_1403bb790(void)

{
  FUN_1403b9cf0();
  return;
}



ushort * FUN_1403bb7b0(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_1403b9e70(param_1,param_2,uVar2);
  return (ushort *)(lVar3 + 8);
}



// WARNING: Removing unreachable block (ram,0x0001403bbccd)
// WARNING: Removing unreachable block (ram,0x0001403bbca6)
// WARNING: Removing unreachable block (ram,0x0001403bb909)
// WARNING: Removing unreachable block (ram,0x0001403bb918)
// WARNING: Removing unreachable block (ram,0x0001403bb99e)
// WARNING: Removing unreachable block (ram,0x0001403bbc9b)
// WARNING: Removing unreachable block (ram,0x0001403bb92a)
// WARNING: Removing unreachable block (ram,0x0001403bb932)
// WARNING: Removing unreachable block (ram,0x0001403bb93c)
// WARNING: Removing unreachable block (ram,0x0001403bbcac)
// WARNING: Removing unreachable block (ram,0x0001403bb993)

void FUN_1403bb820(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_14034ed40(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_1405d80e0 + 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_1403bb660(param_1,&local_res8);
      plVar11 = (longlong *)plVar10[2];
      FUN_1403b8510(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_14000d450(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_14000d450(0x80004005);
      }
      plVar9 = (longlong *)plVar10[2];
      FUN_1403b8510(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_1403bbaee;
          if (*puVar1 == uVar7) break;
          puVar1 = *(uint **)(puVar1 + 4);
        }
        FUN_1403b8510(param_1 + 0x2ca,puVar1,0);
      }
    }
    else {
      plVar9 = plVar12;
      if (plVar10 != (longlong *)0x0) {
        plVar9 = (longlong *)plVar10[2];
      }
    }
LAB_1403bbaee:
    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_14034ff60(plVar5);
      }
    }
  }
  plVar10 = (longlong *)param_1[0x2e1];
  do {
    if (plVar10 == (longlong *)0x0) {
      FUN_14034edd0(uVar8);
      return;
    }
    if (plVar10 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(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_1403bbc4a:
      plVar9 = (longlong *)*plVar10;
    }
    else {
      plVar9 = plVar12;
      if (plVar11 != (longlong *)0x0) {
        plVar9 = (longlong *)*plVar11;
      }
      plVar11 = local_res10;
      if ((char)plVar9[0x10] != '\0') goto LAB_1403bbc4a;
      plVar9 = plVar12;
      if (local_res10 != (longlong *)0x0) {
        plVar9 = (longlong *)*local_res10;
      }
      if ((char)plVar9[8] != '\0') goto LAB_1403bbc4a;
      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_1403b6310(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_14034ff60(plVar5);
      }
    }
  } while( true );
}



void FUN_1403bbd00(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_1403b7da0(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_140384a90(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_14034f800();
          }
          plVar8 = *(longlong **)(param_1[8] + (longlong)iVar15 * 8);
          FUN_140383db0(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_140383db0(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_1403b7da0(param_1,param_2[0xc]);
    (**(code **)(param_1[0xf] + 0x18))();
    if (param_1[0x2b0] == 0) {
      return;
    }
    cVar1 = FUN_140384780(piVar7,&local_res10);
    if (cVar1 != '\0') {
      iVar15 = *piVar7;
      iVar3 = FUN_14035fc20(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_14035b390(&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_140383d70(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_14034fef0(0x60);
    if (local_188 == 0) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_14035bca0(local_188);
    }
    puVar10 = (undefined4 *)0x0;
    FUN_14012c880(&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_14000d470(puVar10 + 4,L"Invalid payload size in User Message!");
    local_170 = 0;
    FUN_14035bda0(&local_170,&local_res10);
    (**(code **)(*param_1 + 0x80))(param_1,&local_170);
    FUN_14012c7f0(&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_14035fbb0(param_2 + 0x28);
    uVar6 = FUN_14035fbe0(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_14034f7d0();
    }
    FUN_1400179d0(&local_1e8,iVar15);
    uVar11 = local_1d8;
    if ((int)local_1d0 == 0) {
      uVar11 = uVar4;
    }
    FUN_14000d3f0(uVar11,uVar6,(longlong)iVar15);
    local_1e8 = Proud::ByteArray::vftable;
    local_res10 = FUN_14034fef0(0x60);
    uVar6 = uVar4;
    if (local_res10 != 0) {
      uVar6 = FUN_14035bca0(local_res10);
    }
    plVar8 = (longlong *)FUN_14012c880(local_158,uVar6);
    if (*plVar8 != 0) {
      uVar4 = *(undefined8 *)(*plVar8 + 0x38);
    }
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x38))((longlong *)param_1[0x2b0],uVar4,&local_1e8);
    FUN_14012c7f0(local_158);
    FUN_1403555d0(&local_1e8);
    break;
  case 2:
    FUN_14034fe70();
    local_210 = (int *)PTR_DAT_1405d8010;
    iVar3 = FUN_14034fcf0(&DAT_140477960);
    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_1405d8010)) {
      iVar15 = local_210[-2];
    }
    iVar17 = 0;
    iVar9 = iVar3;
    if (((iVar3 <= iVar15) && (iVar9 = iVar17, local_210 != (int *)0x0)) &&
       (local_210 != (int *)PTR_DAT_1405d8010)) {
      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_1405d8010)) {
      puVar12 = (undefined4 *)(ulonglong)(uint)local_210[-2];
    }
    if ((int)puVar12 < iVar15) {
      if (local_210 == (int *)0x0) {
        local_210 = (int *)PTR_DAT_1405d8010;
      }
      if (iVar15 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (iVar15 == 0) {
        FUN_1400031d0(&local_210);
      }
      else {
        iVar9 = iVar17;
        if ((local_210 != (int *)0x0) && (local_210 != (int *)PTR_DAT_1405d8010)) {
          iVar9 = local_210[-2];
        }
        if (iVar15 != iVar9) {
          piVar7 = (int *)FUN_14034fef0((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_1405d8010)) {
            iVar3 = local_210[-2];
          }
          piVar14 = (int *)PTR_DAT_1405d8010;
          if (iVar15 < iVar3) {
LAB_1403bc2f4:
            if (local_210 != (int *)0x0) {
              piVar14 = local_210;
            }
          }
          else {
            iVar15 = iVar16;
            if (local_210 != (int *)0x0) {
              if (local_210 != (int *)PTR_DAT_1405d8010) {
                iVar15 = local_210[-2];
              }
              goto LAB_1403bc2f4;
            }
          }
          FUN_14034fd20(piVar7 + 2,piVar14,iVar15);
          FUN_1400031d0(&local_210);
          local_210 = piVar7 + 2;
          iVar3 = (int)local_res10;
        }
      }
    }
    FUN_140002e10(&local_210);
    piVar7 = local_210;
    if (local_210 == (int *)0x0) {
      piVar7 = (int *)PTR_DAT_1405d8010;
    }
    FUN_14034fd20(piVar7,&DAT_140477960,iVar3);
    piVar7 = local_210;
    if (local_210 == (int *)0x0) {
      piVar7 = (int *)PTR_DAT_1405d8010;
    }
    iVar3 = FUN_14034fcf0(piVar7);
    iVar15 = 0;
    if (0 < iVar3) {
      iVar15 = iVar3;
    }
    if ((local_210 != (int *)0x0) && (local_210 != (int *)PTR_DAT_1405d8010)) {
      iVar17 = local_210[-2];
    }
    if ((iVar15 < iVar17) || (iVar15 = iVar16, local_210 == (int *)0x0)) {
LAB_1403bc398:
      if (((local_210 != (int *)PTR_DAT_1405d8010) && (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_1405d8010) {
      iVar15 = local_210[-2];
      goto LAB_1403bc398;
    }
    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_14035bed0(&local_218,*puVar12,1,&local_210,&local_128);
    FUN_1403555d0(&local_128);
    piVar7 = local_210;
    if (((local_210 != (int *)0x0) && (local_210 != (int *)PTR_DAT_1405d8010)) &&
       (piVar14 = local_210 + -2, piVar14 != (int *)0x0)) {
      uVar4 = FUN_14034fe70();
      local_180 = 0;
      local_188 = uVar4;
      FUN_14034ed40(uVar4);
      local_180 = 1;
      piVar7 = piVar7 + -1;
      *piVar7 = *piVar7 + -1;
      if (*piVar7 == 0) {
        FUN_14034ff60(piVar14);
      }
      FUN_14034edd0(uVar4);
      param_3 = local_res18;
    }
    local_210 = (int *)PTR_DAT_1405d8010;
    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_1403bc56b:
      if (iVar15 < 1) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    if (*(longlong *)(param_2 + 0x2a) != 0) {
      if (*(longlong *)(param_2 + 0x2a) == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      iVar15 = param_2[0x2c];
      goto LAB_1403bc56b;
    }
    if (local_218 != (int *)0x0) {
      puVar10 = *(undefined4 **)(local_218 + 0xe);
    }
    (**(code **)(*(longlong *)param_1[0x2b0] + 0x38))((longlong *)param_1[0x2b0],puVar10,&local_1e8)
    ;
    FUN_1403555d0(&local_1e8);
    FUN_14012c7f0(&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_1403bc0eb_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_1403b7b90(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_14035bed0(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_14012c7f0(local_160);
    FUN_1403555d0(&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_14035bed0(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_14012c7f0(local_168);
    FUN_1403555d0(&local_150);
  }
  *param_3 = *(byte *)(param_1[0x2b0] + 8);
  *param_4 = *(byte *)(param_1[0x2b0] + 9);
  *param_6 = *param_6 + 1;
switchD_1403bc0eb_caseD_4:
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403bc969)
// WARNING: Removing unreachable block (ram,0x0001403bc8e3)
// WARNING: Removing unreachable block (ram,0x0001403bc8f3)
// WARNING: Removing unreachable block (ram,0x0001403bc974)
// WARNING: Removing unreachable block (ram,0x0001403bc907)
// WARNING: Removing unreachable block (ram,0x0001403bc90f)
// WARNING: Removing unreachable block (ram,0x0001403bc919)

void FUN_1403bc860(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_1403bb660(param_1,&local_res8);
    lVar1 = *(longlong *)(lVar2 + 0x10);
    FUN_1403b8510(param_1 + 0x1720,lVar2,0,param_4,lVar3);
    lVar2 = lVar1;
  }
  FUN_1403b9cf0(param_1 + 0x1720);
  return;
}



void FUN_1403bc9b0(longlong param_1)

{
  FUN_1403b9cf0(param_1 + 0x16a8);
  return;
}



undefined8 FUN_1403bc9c0(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_1403bf850(param_1,param_2);
  FUN_1403aca30(uVar3,param_3);
  return 1;
}



undefined8 FUN_1403bca50(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_1403bb7b0(param_1,param_2);
  FUN_1403aca30(uVar3,param_3);
  return 1;
}



void FUN_1403bcae0(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_140360b20((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(puVar1);
    }
  }
  return;
}



void FUN_1403bcb50(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_140360b20((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(puVar3);
    }
  }
  return;
}



void FUN_1403bcbe0(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_140360b20((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(puVar1);
    }
  }
  return;
}



void FUN_1403bcc50(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_1403bca50(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_1403e1da0(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_14034ff60(param_2);
  }
  return;
}



ulonglong FUN_1403bcd20(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_1403aca30(&local_res18,lVar7 + 0x18);
      FUN_1403bcc50(param_1,&local_res18);
    }
    else {
      lVar7 = lVar9;
      if (plVar3 != (longlong *)0x0) {
        lVar7 = *plVar3;
      }
      local_res8 = 0;
      FUN_1403aca30(&local_res8,lVar7 + 0x18);
      FUN_1403bb660(param_1,&local_res8);
    }
    local_res20 = 0;
    lVar7 = lVar9;
    if ((longlong *)*param_2 != (longlong *)0x0) {
      lVar7 = *(longlong *)*param_2;
    }
    FUN_1403aca30(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_1403bce82;
      if (*puVar4 == uVar1) break;
      puVar4 = *(uint **)(puVar4 + 4);
    }
    uVar8 = FUN_1403b8510(param_1 + 0x1650,puVar4,0,uVar6,uVar10);
  }
LAB_1403bce82:
  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_14034ff60(plVar3);
    }
  }
  return uVar8;
}



void FUN_1403bced0(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_1403aca30(&local_res18,lVar3 + 0x18);
          FUN_1403bcc50(param_1,&local_res18);
        }
        else {
          lVar3 = lVar4;
          if (plVar1 != (longlong *)0x0) {
            lVar3 = *plVar1;
          }
          local_res8 = 0;
          FUN_1403aca30(&local_res8,lVar3 + 0x18);
          FUN_1403bb660(param_1,&local_res8);
        }
        local_res20 = 0;
        lVar3 = lVar4;
        if ((longlong *)*param_2 != (longlong *)0x0) {
          lVar3 = *(longlong *)*param_2;
        }
        FUN_1403aca30(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_1403b80b0(lVar3 + 0x28,&local_28);
      if ((longlong *)*param_2 != (longlong *)0x0) {
        lVar4 = *(longlong *)*param_2;
      }
      FUN_1403bc9c0(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_14034ff60(param_2);
  }
  return;
}



undefined8 * FUN_1403bd0b0(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_14034ed40(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_1403bd159;
      if (*puVar2 == param_3) break;
      puVar2 = *(uint **)(puVar2 + 4);
    }
    FUN_1403bcb50(param_2,puVar2 + 2,uVar3,(ulonglong)uVar1,uVar5,uVar6,1);
  }
LAB_1403bd159:
  FUN_14034edd0(uVar4);
  return param_2;
}



undefined8 FUN_1403bd180(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_1403bd0b0(param_1,&local_res8,param_2,param_4,uVar7);
  if ((local_res8 == (longlong *)0x0) || (lVar1 = *local_res8, lVar1 == 0)) {
    uVar7 = FUN_1403b8da0(param_1,param_2);
    FUN_1403ac2a0(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_1403b8da0(param_1,*puVar6);
      lVar5 = param_3[1];
      if (lVar5 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      FUN_1403abd40(param_3,lVar5 + 1,0xffffffffffffffff);
      if (param_3[1] <= lVar5) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      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_14000d450(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_140360b20((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(local_res8);
    }
  }
  return 1;
}



void FUN_1403bd2f0(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_14034ed40(uVar3);
  uVar8 = 1;
  (**(code **)(*param_1 + 0x100))(param_1);
  FUN_1403bd0b0(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_140360b20((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(local_res8);
    }
    FUN_14034edd0(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_14000d450(0x80004005);
    }
    FUN_14035a290(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_140360b20((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(local_res8);
    }
    FUN_14034edd0(uVar3);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403bd74b)
// WARNING: Removing unreachable block (ram,0x0001403bd75e)
// WARNING: Removing unreachable block (ram,0x0001403bd66d)
// WARNING: Removing unreachable block (ram,0x0001403bd777)
// WARNING: Removing unreachable block (ram,0x0001403bd77f)
// WARNING: Removing unreachable block (ram,0x0001403bd789)

longlong FUN_1403bd4d0(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_1403de040(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_1405f2490,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_1403b8ef0(param_1,1,&DAT_140465ca0,*(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_1403bced0(param_1,&local_res18);
      lVar9 = FUN_14035d100(param_1 + 0x1650);
LAB_1403bd7ae:
      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_14034ff60(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_1403aac10(&local_res20);
    while ((lVar12 = lVar9, plVar5 = local_res20, lVar12 != 0 || (lVar6 + 8 != lVar7 + 8))) {
      if (lVar12 == 0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      lVar8 = FUN_1403aac10(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_140360b20((longlong)pvVar3 + 8);
              operator_delete(pvVar3);
            }
            lVar9 = FUN_14034ff60(plVar5);
          }
        }
        goto LAB_1403bd7ae;
      }
      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_140360b20((longlong)pvVar3 + 8);
          operator_delete(pvVar3);
        }
        FUN_14034ff60(plVar5);
      }
    }
    if (lVar11 == 0) {
      lVar11 = 0;
    }
    else {
      lVar11 = *(longlong *)(lVar11 + 0x10);
    }
  } while( true );
}



void FUN_1403bd800(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_14035f6d0(param_3,0,param_3,param_4,0xfffffffffffffffe);
  uVar5 = (**(code **)(*(longlong *)(param_1 + -0x70) + 0x58))(param_1 + -0x70);
  FUN_14034ed40(uVar5);
  FUN_1403bd0b0(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_14034f7d0();
      }
      iVar9 = *(int *)(param_3 + 0x18);
      FUN_14035f6d0(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_14000d450(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_140360b20((longlong)pvVar4 + 8);
      operator_delete(pvVar4);
    }
    FUN_14034ff60(local_res20);
  }
  FUN_14034edd0(uVar5);
  return;
}



double FUN_1403bd9b0(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_14034ed40(uVar4);
  if (param_2 == 1) {
    dVar10 = (double)param_1[0x92];
    FUN_14034edd0(uVar4);
  }
  else {
    plVar5 = (longlong *)FUN_1403b68a0(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_14034ff60(local_res18);
    }
    if (lVar7 == 0) {
      FUN_1403bd0b0(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_14000d450(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_140360b20((longlong)pvVar2 + 8);
              operator_delete(pvVar2);
            }
            FUN_14034ff60(local_res8);
          }
          FUN_14034edd0(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_140360b20((longlong)pvVar2 + 8);
          operator_delete(pvVar2);
        }
        FUN_14034ff60(local_res8);
      }
      FUN_14034edd0(uVar12);
      dVar10 = -1.0;
    }
    else {
      *(undefined1 *)(lVar7 + 0x21) = 1;
      dVar10 = *(double *)(lVar7 + 0x158);
      FUN_14034edd0(uVar12);
    }
  }
  return dVar10;
}



double FUN_1403bdc50(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_14034ed40(uVar4);
  if (param_2 == 1) {
    dVar10 = (double)param_1[0x91];
    FUN_14034edd0(uVar4);
  }
  else {
    plVar5 = (longlong *)FUN_1403b68a0(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_14034ff60(local_res18);
    }
    if (lVar7 == 0) {
      FUN_1403bd0b0(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_14000d450(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_140360b20((longlong)pvVar2 + 8);
              operator_delete(pvVar2);
            }
            FUN_14034ff60(local_res8);
          }
          FUN_14034edd0(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_140360b20((longlong)pvVar2 + 8);
          operator_delete(pvVar2);
        }
        FUN_14034ff60(local_res8);
      }
      FUN_14034edd0(uVar12);
      dVar10 = -1.0;
    }
    else {
      *(undefined1 *)(lVar7 + 0x21) = 1;
      dVar10 = *(double *)(lVar7 + 0x50);
      FUN_14034edd0(uVar12);
    }
  }
  return dVar10;
}



void FUN_1403bdef0(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1403bcbe0(param_2);
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar2);
  }
  return;
}



void FUN_1403bdf80(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_14000d450(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_1403bdef0(param_1,param_2,param_3);
  FUN_14035d100(param_1);
  return;
}



undefined4 * FUN_1403be080(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_14034fef0(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_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar3);
  }
  FUN_14035d100(param_1);
  return puVar4;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001403be910)
// WARNING: Removing unreachable block (ram,0x0001403be91c)
// WARNING: Removing unreachable block (ram,0x0001403be914)
// WARNING: Removing unreachable block (ram,0x0001403be922)
// WARNING: Removing unreachable block (ram,0x0001403be7a7)
// WARNING: Removing unreachable block (ram,0x0001403be7ae)
// WARNING: Removing unreachable block (ram,0x0001403be7c6)
// WARNING: Removing unreachable block (ram,0x0001403be7d2)
// WARNING: Removing unreachable block (ram,0x0001403be7ca)
// WARNING: Removing unreachable block (ram,0x0001403be7d8)
// WARNING: Removing unreachable block (ram,0x0001403be7f4)
// WARNING: Removing unreachable block (ram,0x0001403be6f0)
// WARNING: Removing unreachable block (ram,0x0001403be6f7)
// WARNING: Removing unreachable block (ram,0x0001403be710)
// WARNING: Removing unreachable block (ram,0x0001403be71c)
// WARNING: Removing unreachable block (ram,0x0001403be714)
// WARNING: Removing unreachable block (ram,0x0001403be722)
// WARNING: Removing unreachable block (ram,0x0001403be73e)

undefined8 FUN_1403be1d0(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_1405d84f0 ^ (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_14034ed40(local_2b20);
  puVar1 = PTR_u_Cannot_send_messages_unless_conn_1405d9980;
  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_1403bd180(param_1,*param_4,&local_2948);
        }
        param_4 = param_4 + 1;
        uVar19 = uVar19 - 1;
      } while (uVar19 != 0);
    }
    FUN_1403acc70(&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_14034f7d0();
      }
      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_1403841b0(&local_2c00);
        FUN_1403a65d0(local_2ba0,&local_2c00);
        lVar14 = param_1[0x2a8];
        plVar11 = (longlong *)local_2b68[0x2a6];
        if (plVar11 == (longlong *)0x0) {
          puVar7 = (undefined8 *)FUN_14034fef0(0x38);
        }
        else {
          puVar7 = (undefined8 *)(**(code **)(*plVar11 + 8))(plVar11,0x38);
        }
        local_2b00 = puVar7;
        if (puVar7 != (undefined8 *)0x0) {
          local_2bd8 = (longlong **)puVar7;
          FUN_1403841e0(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_140399690(&local_2bf8);
        if ((local_2bf0 != (longlong *)0x0) && ((longlong)local_2be8 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
      }
      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_1403a6360(local_2ba0 + 0xc80,&local_68);
        local_2c18 = (undefined ***)local_2b98;
        FUN_1403ac430(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_1403e4120(*(longlong *)(lVar14 + 0x640) + 8,1);
              uVar2 = FUN_1403e2a80(lVar14 + 0x638);
              local_2af0 = CONCAT44(local_2af0._4_4_,uVar2);
              if (iVar17 < 0) {
                    // WARNING: Subroutine does not return
                FUN_14034f7d0();
              }
              FUN_1403abea0(&local_2b60);
              plVar9 = local_2b50;
              if (local_2b48 == 0) {
                plVar9 = plVar15;
              }
              plVar9[(longlong)iVar17 * 2] = lVar14;
              lVar8 = local_2af0;
LAB_1403be825:
              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_14034f7d0();
              }
              FUN_1403abea0(&local_2b60);
              plVar9 = local_2b50;
              if (local_2b48 == 0) {
                plVar9 = plVar15;
              }
              plVar9[(longlong)iVar17 * 2] = lVar14;
              lVar8 = CONCAT44(uStack_2b24,local_2b28);
              goto LAB_1403be825;
            }
            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_1403e2ae0(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_1403de1e0(lVar14 + 0x668,local_2ba0,local_2b98);
            }
          }
        }
      }
      plVar9 = (longlong *)(ulonglong)((int)local_2c08 + 1);
    }
    if (iVar17 < 1) goto LAB_1403bf0db;
    if (*param_3 != 0) {
      local_5c = 200;
      local_60 = 0;
      local_68 = local_ce8;
      FUN_1403841b0(local_29f8);
      FUN_140383e30(local_29f8,local_29d0,0x80);
      FUN_1403a3190(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_1403ad3b0(&local_2b60,&local_2c00);
      local_cec = 200;
      local_cf0 = 0;
      local_cf8 = local_1978;
      FUN_1403841b0(local_2bc8);
      FUN_140383c40(local_2bc8);
      FUN_140058870(local_2bc8,0x14);
      FUN_1403858a0(local_2bc8,&local_2c00);
      FUN_140383bc0(&local_2b30,local_2bc8);
      iVar4 = FUN_1403a62c0(local_ce8);
      FUN_140385580(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_140399790();
        }
      }
      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_140399790();
        }
        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_1403607b0(local_1978,&local_2608);
      if (local_1988 == (undefined4 *)0x0) {
        FUN_14034f420(local_2ad8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_2ad8,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (local_197c < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      FUN_1403607b0(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_1403a6360(&local_cf8,&local_1988);
      local_2c18 = (undefined ***)local_2b98;
      FUN_1403ac430(param_1,0,1,&local_2608);
      FUN_140383be0(&local_2b30);
      local_2bd8 = &local_2bc0;
      FUN_140399690(&local_2bc0);
      if (local_2bb8 != (longlong *)0x0) {
        if (local_2bac < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_2bb0 = 0;
      }
      FUN_1403606a0(local_1978);
      local_2c00 = Proud::CFastArray<>::vftable;
      if (local_2bf0 != (longlong *)0x0) {
        if (local_2bf8 == (longlong *)0x0) {
          FUN_14034ff60();
        }
        else {
          (**(code **)(*local_2bf8 + 0x18))(local_2bf8,local_2bf0);
        }
      }
      local_2bd8 = &local_29f0;
      FUN_140399690(&local_29f0);
      if (local_29e8 != 0) {
        if (local_29dc < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_29e0 = 0;
      }
      FUN_1403606a0(local_ce8);
      goto LAB_1403bf0db;
    }
    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_14034f800();
        }
        local_2af0 = plVar11[1];
        local_2b38 = (int *)(*plVar11 + 0x56c);
        iVar4 = (int)plVar20;
        if (iVar4 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        FUN_14035f6d0(&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_14000d3f0((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_1403841b0(local_2bc8);
    FUN_140383c40(local_2bc8);
    FUN_140058870(local_2bc8,0x15);
    FUN_140058870(local_2bc8,(char)param_3[8]);
    FUN_140385580(local_2bc8,*(undefined8 *)(param_3 + 6));
    FUN_140385580(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_140399790(0,plVar11);
        }
LAB_1403bea2e:
        FUN_1400178c0(&local_2bb8);
      }
      else {
        if (local_2bb8 != (longlong *)0x0) goto LAB_1403bea2e;
        if (local_2bc0 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
          FUN_140399790(0,plVar11);
        }
        FUN_140017a90();
      }
      FUN_140017b00(local_2bc8);
    }
    FUN_140383bc0(&local_2b30,local_2bc8);
    lVar14 = local_2ba0;
    iVar4 = FUN_1403a62c0(local_2ba0);
    FUN_140385580(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_140399790();
      }
    }
    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_140399790();
      }
      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_1403607b0(local_1978,&local_2608);
    if (local_1988 == (undefined4 *)0x0) {
      FUN_14034f420(local_2a90,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2a90,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_197c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_1403607b0(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_1403a6360(&local_cf8,&local_1988);
    plVar11 = local_2b68;
    local_2bd8 = (longlong **)&local_2608;
    FUN_1403ab8c0(local_2b68);
    if ((undefined8 *)plVar11[0x2ae] != (undefined8 *)0x0) {
      plVar15 = *(longlong **)plVar11[0x2ae];
    }
    FUN_1403d74d0(plVar15,0,&local_2608,local_2b98);
    FUN_1403606a0(&local_2608);
    if (local_cf8 == (undefined1 *)0x0) {
      FUN_14034f420(local_2a48,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2a48,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_cec < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_cf0 = 0;
    FUN_140383be0(&local_2b30);
    local_2bd8 = &local_2bc0;
    FUN_140399690(&local_2bc0);
    if (local_2bb8 != (longlong *)0x0) {
      if (local_2bac < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_2bb0 = 0;
    }
    if (plVar9 != (longlong *)0x0) {
      if (plVar10 == (longlong *)0x0) {
        FUN_14034ff60(plVar9);
      }
      else {
        (**(code **)(*plVar10 + 0x18))(plVar10,plVar9);
      }
    }
LAB_1403bf0db:
    if (plVar22 != (longlong *)0x0) {
      if (local_2b58 == (longlong *)0x0) {
        FUN_14034ff60(plVar22);
      }
      else {
        (**(code **)(*local_2b58 + 0x18))(local_2b58,plVar22);
      }
    }
    if (100 < local_2938) {
      operator_delete__(local_2948);
    }
    if (local_2b18 != '\0') {
      FUN_14034edd0(local_2b20);
    }
    return 1;
  }
  FUN_14034fe70();
  local_2c08 = (uint *)PTR_DAT_1405d8010;
  uVar3 = FUN_14034fcf0(puVar1);
  if ((local_2c08 != (uint *)0x0) &&
     (plVar15 = (longlong *)0x0, local_2c08 != (uint *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    uVar6 = local_2c08[-2];
  }
  uVar18 = 1;
  if (1 < (int)uVar6) {
    uVar18 = uVar6;
  }
  uVar6 = uVar5;
  if ((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1405d8010)) {
    uVar6 = local_2c08[-2];
  }
  if ((int)uVar6 < (int)uVar18) {
    if (local_2c08 == (uint *)0x0) {
      local_2c08 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar18 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar18 == 0) {
      FUN_1400031d0(&local_2c08);
    }
    else {
      uVar6 = uVar5;
      if ((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1405d8010)) {
        uVar6 = local_2c08[-2];
      }
      if (uVar18 != uVar6) {
        puVar12 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar6 = local_2c08[-2];
        }
        puVar16 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar18 < (int)uVar6) {
LAB_1403bf235:
          if (local_2c08 != (uint *)0x0) {
            puVar16 = local_2c08;
          }
        }
        else {
          uVar18 = uVar21;
          if (local_2c08 != (uint *)0x0) {
            if (local_2c08 != (uint *)PTR_DAT_1405d8010) {
              uVar18 = local_2c08[-2];
            }
            goto LAB_1403bf235;
          }
        }
        FUN_14034fd20(puVar12 + 2,puVar16,uVar18);
        FUN_1400031d0(&local_2c08);
        local_2c08 = puVar12 + 2;
      }
    }
  }
  FUN_140002e10(&local_2c08);
  puVar12 = local_2c08;
  if (local_2c08 == (uint *)0x0) {
    puVar12 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar12,puVar1,uVar3);
  puVar12 = local_2c08;
  if (local_2c08 == (uint *)0x0) {
    puVar12 = (uint *)PTR_DAT_1405d8010;
  }
  uVar3 = FUN_14034fcf0(puVar12);
  uVar21 = 0;
  if (0 < (int)uVar3) {
    uVar21 = uVar3;
  }
  uVar3 = uVar5;
  if ((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = local_2c08[-2];
  }
  if (((int)uVar3 <= (int)uVar21) && (uVar21 = uVar5, local_2c08 != (uint *)0x0)) {
    if (local_2c08 == (uint *)PTR_DAT_1405d8010) goto LAB_1403bf2ea;
    uVar21 = local_2c08[-2];
  }
  if (((local_2c08 != (uint *)PTR_DAT_1405d8010) && (local_2c08 != (uint *)0x0)) &&
     (local_2c08 + -2 != (uint *)0x0)) {
    local_2c08[-2] = uVar21;
    *(undefined2 *)((longlong)local_2c08 + (longlong)(int)uVar21 * 2) = 0;
  }
LAB_1403bf2ea:
  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_14035bed0(&local_2bd8,0x12,0,&local_2c08);
  (**(code **)(*param_1 + 0x80))(param_1,uVar13);
  FUN_1403555d0(&local_2c00);
  puVar12 = local_2c08;
  if (((local_2c08 != (uint *)0x0) && (local_2c08 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar16 = local_2c08 + -2, puVar16 != (uint *)0x0)) {
    uVar13 = FUN_14034fe70();
    local_2b30 = uVar13;
    FUN_14034ed40(uVar13);
    local_2b28 = CONCAT31(local_2b28._1_3_,1);
    puVar12 = puVar12 + -1;
    *puVar12 = *puVar12 - 1;
    if (*puVar12 == 0) {
      FUN_14034ff60(puVar16);
    }
    FUN_14034edd0(uVar13);
  }
  FUN_14034edd0(local_2b20);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403bf3e0(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_1405d84f0 ^ (ulonglong)auStack_3b8;
  uVar7 = (ulonglong)param_2;
  uVar2 = (**(code **)(*param_1 + 0x58))();
  local_398 = uVar2;
  FUN_14034ed40(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_1403bd180(param_1,*param_3,&local_378);
      }
      param_3 = param_3 + 1;
      uVar7 = uVar7 - 1;
    } while (uVar7 != 0);
  }
  FUN_1403acc70(&local_378);
  FUN_14035eed0(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_14034f7d0();
      }
      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_14034f7d0();
        }
        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_14034f7d0();
        }
        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_14034edd0(uVar2);
  return;
}



void FUN_1403bf590(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_14035d100();
  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_140360b20((longlong)pvVar2 + 8);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(puVar1);
    }
    plVar3 = *(longlong **)(param_1 + 0x50);
    if (plVar3 == (longlong *)0x0) {
      FUN_14034ff60(lVar6);
    }
    else {
      (**(code **)(*plVar3 + 0x18))(plVar3,lVar6);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar6 = lVar7;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar4 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



undefined8 FUN_1403bf720(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035d100(param_1);
  uVar2 = FUN_1403be080(param_1,param_2,param_3,param_4);
  FUN_14035d100(param_1);
  return uVar2;
}



void FUN_1403bf7a0(void)

{
  FUN_1403bf590();
  return;
}



undefined4 *
FUN_1403bf7c0(undefined4 *param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)

{
  *param_1 = *param_2;
  FUN_1403841e0(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_140378820(param_1 + 0x14,param_2 + 0x14);
  return param_1;
}



uint * FUN_1403bf850(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_1403bf720(param_1,param_2,uVar2);
  return (uint *)(lVar3 + 8);
}



undefined4 * FUN_1403bf8c0(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  FUN_1403a2ca0(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_1403a5ff0(param_1 + 0x14,param_2 + 0x14);
  return param_1;
}



undefined8 FUN_1403bf930(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_1403bf850(param_1,param_2);
  FUN_1403bcb50(uVar3,param_3);
  return 1;
}



void FUN_1403bf9c0(longlong *param_1,longlong param_2)

{
  longlong *plVar1;
  
  FUN_140376ec0(param_2 + 0x60);
  FUN_140399690(param_2 + 0x20);
  if (*(longlong *)(param_2 + 0x28) != 0) {
    if (*(int *)(param_2 + 0x34) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_2 + 0x30) = 0;
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
  }
  param_1[3] = param_1[3] + -1;
  return;
}



longlong * FUN_1403bfa30(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_14034ed40(uVar4);
  uVar12 = 1;
  local_res20 = operator_new(0x60);
  puVar5 = puVar7;
  if (local_res20 != (void *)0x0) {
    puVar5 = (uint *)FUN_1403adcd0(local_res20);
  }
  if (puVar5 == (uint *)0x0) {
    *param_2 = 0;
  }
  else {
    lVar6 = FUN_14034fef0(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_1403bfbb1;
    }
    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_1403bfba4;
      }
      if (lVar6 != 0) goto LAB_1403bfb7b;
    }
  }
  cVar3 = FUN_14035f5e0(plVar9,uVar8,CONCAT71((int7)((ulonglong)lVar6 >> 8),1),uVar8,uVar10,uVar11,
                        uVar12);
  if (cVar3 == '\0') {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x8007000e);
  }
LAB_1403bfb7b:
  FUN_14035d100(plVar9);
  puVar7 = (uint *)FUN_1403be080(plVar9,local_res18,uVar2,param_3);
  FUN_14035d100(plVar9);
LAB_1403bfba4:
  FUN_1403bcb50(puVar7 + 2,param_2);
LAB_1403bfbb1:
  FUN_14034edd0(uVar4);
  return param_2;
}



undefined8 FUN_1403bfbd0(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_14000d450(0x80004005);
  }
  FUN_1403bf7c0(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_1403bf9c0(param_1,plVar1);
  return param_2;
}



void FUN_1403bfc50(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_140376ec0(plVar2 + 0xc);
    FUN_140399690(plVar2 + 4);
    if (plVar2[5] != 0) {
      if (*(int *)((longlong)plVar2 + 0x34) < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(undefined4 *)(plVar2 + 6) = 0;
    }
    plVar3 = (longlong *)*param_1;
    if (plVar3 == (longlong *)0x0) {
      FUN_14034ff60(plVar2);
    }
    else {
      (**(code **)(*plVar3 + 0x10))(plVar3,plVar2);
    }
    param_1[3] = param_1[3] + -1;
    lVar1 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



undefined8 *
FUN_1403bfd00(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_14034fef0(0x148);
  }
  else {
    puVar2 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x148,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar2 != (undefined8 *)0x0) {
    FUN_1403bf7c0(puVar2 + 2,param_2);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



undefined8 FUN_1403bfd90(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_14034ed40(uVar1);
  if (param_1[0x2bf] == 0) {
    FUN_14034edd0(uVar1);
    uVar2 = 0;
  }
  else {
    uVar2 = FUN_1403bfbd0(param_1 + 700,local_140,param_3,param_4,uVar2,1,uVar3);
    FUN_1403bf8c0(param_2,uVar2);
    FUN_140376ec0(local_f0);
    FUN_140399690(local_130);
    if ((local_128 != 0) && (local_11c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_14034edd0(uVar1);
    uVar2 = 1;
  }
  return uVar2;
}



void FUN_1403bfe60(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_1403bfc50();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



undefined8 FUN_1403bfe90(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_14034ed40();
  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_14034ed40(local_160);
  local_158 = 1;
  local_res8[0] = 0;
  iVar7 = (**(code **)(*param_1 + 0x108))(param_1,local_res8);
  if (iVar7 != 0) {
    uVar8 = FUN_1403a16b0(iVar7);
    FUN_14034f420(local_c8,
                  L"Wrong state(%s)! Disconnect() or GetServerConnectionState() may be required.",
                  uVar8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_c8,(ThrowInfo *)&DAT_1405d36c0);
  }
  plVar11 = (longlong *)0x0;
  if (((longlong *)param_1[0xac] != (longlong *)0x0) && (*(longlong *)param_1[0xac] != 0)) {
    FUN_14034fe70();
    local_res20 = (longlong *)PTR_DAT_1405d8010;
    plVar9 = (longlong *)FUN_14034fc50(&local_1a0);
    puVar12 = (undefined *)*plVar9;
    if ((undefined *)*plVar9 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1405d8010;
    }
    FUN_140017720(&local_res20,L"Unstability in Connect #3! Process=%s",puVar12);
    if (((local_1a0 != (undefined *)0x0) && (local_1a0 != PTR_DAT_1405d8010)) &&
       (local_1a0 + -8 != (undefined *)0x0)) {
      uVar8 = FUN_14034fe70();
      local_170 = uVar8;
      FUN_14034ed40(uVar8);
      local_168 = 1;
      piVar2 = (int *)(local_1a0 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(local_1a0 + -8);
      }
      FUN_14034edd0(uVar8);
      local_168 = 0;
    }
    local_1a0 = PTR_DAT_1405d8010;
    FUN_14034fe70();
    plVar9 = local_res20;
    local_res18 = (longlong *)PTR_DAT_1405d8010;
    if (PTR_DAT_1405d8010 == (undefined *)0x0) {
      local_res18 = plVar11;
    }
    if (local_res20 != (longlong *)PTR_DAT_1405d8010) {
      uVar8 = FUN_14034fe70();
      local_190 = uVar8;
      FUN_14034ed40(uVar8);
      local_188 = 1;
      FUN_1400031d0(&local_res18);
      local_res18 = plVar9;
      if (((plVar9 != (longlong *)PTR_DAT_1405d8010) && (plVar9 != (longlong *)0x0)) &&
         (plVar9 != (longlong *)0x8)) {
        *(int *)((longlong)plVar9 + -4) = *(int *)((longlong)plVar9 + -4) + 1;
      }
      FUN_14034edd0(uVar8);
      local_188 = 0;
    }
    FUN_140352d80(&local_res18);
    if (((plVar9 != (longlong *)0x0) && (plVar9 != (longlong *)PTR_DAT_1405d8010)) &&
       (plVar9 + -1 != (longlong *)0x0)) {
      uVar8 = FUN_14034fe70();
      local_150 = uVar8;
      FUN_14034ed40(uVar8);
      local_148 = 1;
      piVar2 = (int *)((longlong)plVar9 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(plVar9 + -1);
      }
      FUN_14034edd0(uVar8);
      local_148 = 0;
    }
    local_res20 = (longlong *)PTR_DAT_1405d8010;
  }
  if ((((longlong *)param_1[0x296] != (longlong *)0x0) && (*(longlong *)param_1[0x296] != 0)) ||
     (((longlong *)param_1[0x2a0] != (longlong *)0x0 && (*(longlong *)param_1[0x2a0] != 0)))) {
    FUN_14034fe70();
    local_1a8 = (longlong *)PTR_DAT_1405d8010;
    plVar9 = (longlong *)FUN_14034fc50(&local_198);
    puVar12 = (undefined *)*plVar9;
    if ((undefined *)*plVar9 == (undefined *)0x0) {
      puVar12 = PTR_DAT_1405d8010;
    }
    FUN_140017720(&local_1a8,L"Unstability in Connect #1! Process=%s",puVar12);
    if (((local_198 != (undefined *)0x0) && (local_198 != PTR_DAT_1405d8010)) &&
       (local_198 + -8 != (undefined *)0x0)) {
      uVar8 = FUN_14034fe70();
      local_120 = uVar8;
      FUN_14034ed40(uVar8);
      local_118 = 1;
      piVar2 = (int *)(local_198 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(local_198 + -8);
      }
      FUN_14034edd0(uVar8);
      local_118 = 0;
    }
    local_198 = PTR_DAT_1405d8010;
    FUN_14034fe70();
    plVar9 = local_1a8;
    local_1b0 = (longlong *)PTR_DAT_1405d8010;
    if (PTR_DAT_1405d8010 == (undefined *)0x0) {
      local_1b0 = plVar11;
    }
    if (local_1a8 != (longlong *)PTR_DAT_1405d8010) {
      uVar8 = FUN_14034fe70();
      local_130 = uVar8;
      FUN_14034ed40(uVar8);
      local_128 = 1;
      FUN_1400031d0(&local_1b0);
      local_1b0 = plVar9;
      if (((plVar9 != (longlong *)PTR_DAT_1405d8010) && (plVar9 != (longlong *)0x0)) &&
         (plVar9 != (longlong *)0x8)) {
        *(int *)((longlong)plVar9 + -4) = *(int *)((longlong)plVar9 + -4) + 1;
      }
      FUN_14034edd0(uVar8);
      local_128 = 0;
    }
    FUN_140352d80(&local_1b0);
    if (((plVar9 != (longlong *)0x0) && (plVar9 != (longlong *)PTR_DAT_1405d8010)) &&
       (plVar9 + -1 != (longlong *)0x0)) {
      uVar8 = FUN_14034fe70();
      local_180 = uVar8;
      FUN_14034ed40(uVar8);
      local_178 = 1;
      piVar2 = (int *)((longlong)plVar9 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(plVar9 + -1);
      }
      FUN_14034edd0(uVar8);
      local_178 = 0;
    }
    local_1a8 = (longlong *)PTR_DAT_1405d8010;
  }
  puVar12 = (undefined *)*param_2;
  if ((undefined *)*param_2 == (undefined *)0x0) {
    puVar12 = PTR_DAT_1405d8010;
  }
  iVar7 = FUN_14034fd30(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_1405d8010;
    }
    iVar7 = FUN_14034fd30(puVar12,L"255.255.255.255");
    if (iVar7 != 0) {
      dVar13 = (double)param_2[9];
      if ((double)param_2[9] <= 0.0) {
        dVar13 = DAT_1405d81a0;
      }
      param_1[0x2fe] = (longlong)dVar13;
      FUN_1403a9cc0(param_1 + 0x2e1);
      FUN_1403a9c90(param_1 + 0x301,param_1[0x2fe]);
      FUN_1403a9cc0(param_1 + 0x301);
      FUN_1403a9cc0(param_1 + 9);
      FUN_1403bfc50(param_1 + 0x2ae);
      FUN_1403bfc50(param_1 + 0x2b2);
      lVar14 = (**(code **)(*param_1 + 0x1c0))(param_1);
      param_1[0x30a] = lVar14;
      *(undefined1 *)(param_1 + 0xbc) = 0;
      lVar14 = FUN_140350020();
      param_1[0xba] = lVar14;
      param_1[0xbb] = DAT_1405d8090;
      cVar6 = FUN_14035a350(param_1 + 0x2b6);
      if (cVar6 == '\0') {
        FUN_14035a250(param_1 + 0x2b6);
      }
      FUN_14035a200(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_1403ddca0(local_1b8,plVar9);
      }
      if ((plVar9 == (longlong *)0x0) || (plVar9 + 8 == (longlong *)0x0)) {
        local_1b8 = (longlong *)0x0;
      }
      else {
        local_1b8 = (longlong *)FUN_14034fef0(0x10);
        local_1b8[1] = 1;
        *local_1b8 = (longlong)(plVar9 + 8);
      }
      plVar10 = local_1b8;
      FUN_1403aca30(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_14034ff60(plVar9);
        }
      }
      *(undefined1 *)(param_1 + 0x8f) = 0;
      FUN_1403ace40(param_1 + 0x2a3,param_2);
      uVar8 = FUN_1403ada90(param_1 + 0x2a3);
      uVar8 = FUN_1403ac6a0(uVar8);
      FUN_140003100(param_1 + 0x2a3,uVar8);
      puVar12 = (undefined *)param_1[0x2a3];
      if (((puVar12 == (undefined *)0x0) || (puVar12 == PTR_DAT_1405d8010)) ||
         (*(int *)(puVar12 + -8) == 0)) {
        FUN_14000d470(param_1 + 0x2a3,L"localhost");
      }
      local_1c8 = operator_new(0x240);
      plVar10 = plVar11;
      if (local_1c8 != (undefined8 *)0x0) {
        plVar10 = (longlong *)FUN_1403d7380(local_1c8,plVar1);
      }
      if (plVar10 == (longlong *)0x0) {
        local_1c8 = (undefined8 *)0x0;
      }
      else {
        local_1c8 = (undefined8 *)FUN_14034fef0(0x10);
        local_1c8[1] = 1;
        *local_1c8 = plVar10;
      }
      puVar3 = local_1c8;
      FUN_1403ac9b0(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_14034ff60(puVar5);
        }
      }
      local_1c0 = operator_new(0x140);
      if (local_1c0 != (undefined8 *)0x0) {
        plVar11 = (longlong *)FUN_1403ced90(local_1c0,plVar1);
      }
      if (plVar11 == (longlong *)0x0) {
        local_1c0 = (undefined8 *)0x0;
      }
      else {
        local_1c0 = (undefined8 *)FUN_14034fef0(0x10);
        local_1c0[1] = 1;
        *local_1c0 = plVar11;
      }
      puVar3 = local_1c0;
      FUN_1403adb30(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_1403cfad0(pvVar4);
            operator_delete(pvVar4);
          }
          FUN_14034ff60(puVar5);
        }
      }
      FUN_14034edd0(local_160);
      FUN_14034edd0(local_140);
      return 1;
    }
  }
  uVar8 = FUN_14035bc60(0xe);
  FUN_14034f420(local_80,uVar8);
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_80,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_1403c06d0(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_1405d8130,&local_70,param_4,0xfffffffffffffffe);
  FUN_1403555d0(&local_70);
  FUN_1403867b0(param_1);
  if (param_1[0xbb] != 0) {
    lVar3 = *(longlong *)(param_1[0xbb] + 0x38);
  }
  FUN_14034ed40(lVar3 + 0x10);
  FUN_1403bf590(param_1 + 0xbc);
  local_res10 = 0;
  FUN_1403ac9b0(param_1 + 0x2ae,&local_res10);
  FUN_1403bfc50(param_1 + 700);
  FUN_1403bfc50(param_1 + 0x2c0);
  FUN_1403b8150(param_1 + 0x2e0);
  FUN_1403b8320(param_1 + 0x2a6);
  FUN_1403b8320(param_1 + 0xdc);
  FUN_1403b9cf0(param_1 + 0x2ca);
  local_res18 = 0;
  FUN_1403aca30(param_1 + 0x2a4,&local_res18);
  if (param_1[0x16] != 0) {
    FUN_1403aac20(param_1[0x16],param_1);
  }
  FUN_14034edd0(lVar3 + 0x10);
  puVar1 = (undefined8 *)param_1[0xb];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  param_1[0xb] = 0;
  FUN_140388ea0(param_1 + 0x307);
  FUN_140385b20(param_1 + 0x303);
  FUN_140388ea0(param_1 + 0x2fe);
  FUN_140385b20(param_1 + 0x2fa);
  FUN_1403b83c0(param_1 + 0x2f6);
  puVar1 = (undefined8 *)param_1[0x2f6];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1403bb790(param_1 + 0x2e4);
  FUN_1403b8150(param_1 + 0x2e0);
  puVar1 = (undefined8 *)param_1[0x2e0];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1403bb790(param_1 + 0x2d5);
  FUN_1403bb790(param_1 + 0x2ca);
  FUN_1403bfc50(param_1 + 0x2c0);
  puVar1 = (undefined8 *)param_1[0x2c0];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1403bfc50(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_14034ff60(plVar4);
  }
  local_res20 = param_1 + 0x2b1;
  FUN_1403555d0(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_14034ff60(puVar1);
  }
  param_1[0x2ac] = 0;
  param_1[0x2ab] = Proud::IP2PGroupMember::vftable;
  param_1[0x2aa] = Proud::ISendDest_C::vftable;
  FUN_1403b8320(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_14034ff60(plVar4);
  }
  FUN_140359a60(param_1 + 0x161);
  FUN_1403555d0(param_1 + 0x15b);
  FUN_1403b8320(param_1 + 0xdc);
  puVar1 = (undefined8 *)param_1[0xdc];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1403bf7a0(param_1 + 0xbc);
  FUN_1403ac5a0(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_1403cfad0(pvVar2);
      operator_delete(pvVar2);
    }
    FUN_14034ff60(puVar1);
  }
  FUN_14034edf0(param_1 + 0xa3);
  puVar1 = (undefined8 *)param_1[0x9c];
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1403555d0(param_1 + 0x95);
  param_1[0x13] = Proud::IVizAgentDg::vftable;
  if (param_1[0x16] != 0) {
    FUN_1403aac20(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_140386450(param_1);
  return;
}



undefined8 FUN_1403c0c20(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x480);
}



undefined4 FUN_1403c0c30(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x1518);
}



undefined8 FUN_1403c0c40(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x488);
}



void thunk_FUN_140386500(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_14034f420(auStack_68,PTR_u_Already_async_callback_may_occur_1405d9010);
                    // WARNING: Subroutine does not return
    _CxxThrowException(auStack_68,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f800();
      }
      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_14034f7d0();
    }
    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_1403a2c90(plVar7);
        lVar4 = FUN_1403a2c90(plVar7);
        *(undefined8 *)(lVar4 + lVar6) = *(undefined8 *)((longlong)iVar9 * 8 + lVar3 + lVar6);
        lVar6 = lVar6 + 8;
        lVar8 = lVar8 + -1;
      } while (lVar8 != 0);
    }
    FUN_140394870(plVar7,(int)param_1[4] - iVar9);
    *(undefined8 *)(param_2 + 8) = 0;
  }
  return;
}



void thunk_FUN_140385b50(void)

{
  return;
}



void thunk_FUN_1403862c0(undefined8 param_1,longlong param_2)

{
  if ((*(longlong *)(param_2 + 8) == 0) && (*(longlong *)(param_2 + 0x10) == 0)) {
                    // WARNING: Subroutine does not return
    FUN_140399790(param_1,param_2,param_2);
  }
  return;
}



void FUN_1403c0c80(longlong param_1)

{
  FUN_140386c10(param_1 + -0x70);
  return;
}



longlong FUN_1403c0cb0(longlong param_1)

{
  return param_1 + -0x98;
}



undefined8 FUN_1403c0cc0(void)

{
  return 0;
}



void FUN_1403c0cd0(longlong param_1)

{
  FUN_1403c3c40(param_1 + -0x90);
  return;
}



void FUN_1403c0ce0(longlong param_1)

{
  thunk_FUN_140386a50(param_1 + -0x70);
  return;
}



void FUN_1403c0cf0(longlong param_1)

{
  FUN_1403aabb0(param_1 + -0x88);
  return;
}



void FUN_1403c0d00(longlong param_1)

{
  FUN_1403c3c40(param_1 + -0x78);
  return;
}



void FUN_1403c0d10(longlong param_1)

{
  FUN_1403c3c40(param_1 + -0x98);
  return;
}



void FUN_1403c0d20(longlong param_1)

{
  thunk_FUN_140386500(param_1 + -0x70);
  return;
}



void FUN_1403c0d30(longlong param_1)

{
  FUN_1403aabb0(param_1 + -0x70);
  return;
}



void FUN_1403c0d40(longlong param_1)

{
  FUN_1403c3c40(param_1 + -0x60);
  return;
}



void FUN_1403c0d50(longlong param_1)

{
  thunk_FUN_1403862c0(param_1 + -0x70);
  return;
}



void FUN_1403c0d60(longlong param_1)

{
  thunk_FUN_140386850(param_1 + -0x70);
  return;
}



void FUN_1403c0d70(longlong param_1)

{
  FUN_1403c3c40(param_1 + -0x68);
  return;
}



void FUN_1403c0d80(longlong param_1)

{
  FUN_1403c3c40(param_1 + -0x88);
  return;
}



void FUN_1403c0d90(longlong param_1)

{
  thunk_FUN_140386660(param_1 + -0x70);
  return;
}



void FUN_1403c0da0(longlong param_1)

{
  thunk_FUN_140385b50(param_1 + -0x70);
  return;
}



void FUN_1403c0db0(longlong param_1)

{
  FUN_1403c0c30(param_1 + -8);
  return;
}



void FUN_1403c0dc0(longlong param_1)

{
  FUN_1403c3c40(param_1 + -0x70);
  return;
}



undefined8 FUN_1403c0dd0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x458);
}



undefined8 FUN_1403c0de0(longlong param_1)

{
  if (*(undefined8 **)(param_1 + 0x558) != (undefined8 *)0x0) {
    return **(undefined8 **)(param_1 + 0x558);
  }
  return 0;
}



void FUN_1403c0e00(longlong param_1)

{
  FUN_1403ab220(param_1 + -0x18);
  return;
}



void FUN_1403c0e10(longlong param_1)

{
  FUN_1403ab590(param_1 + -0x70);
  return;
}



void FUN_1403c0e20(longlong param_1)

{
  FUN_1403ab220(param_1 + -0x20);
  return;
}



void FUN_1403c0e30(longlong param_1)

{
  FUN_1403ab2a0(param_1 + -0x88);
  return;
}



void FUN_1403c0e40(longlong param_1)

{
  FUN_1403ab220(param_1 + -8);
  return;
}



void FUN_1403c0e50(longlong param_1)

{
  FUN_1403ab220(param_1 + -0x28);
  return;
}



void FUN_1403c0e60(longlong param_1)

{
  FUN_1403ab270(param_1 + -0x70);
  return;
}



void FUN_1403c0e70(longlong param_1)

{
  FUN_1403ab840(param_1 + -0x70);
  return;
}



void FUN_1403c0e80(longlong param_1)

{
  FUN_1403ab2a0(param_1 + -0x70);
  return;
}



void FUN_1403c0e90(longlong param_1)

{
  FUN_14036ccc0(param_1 + -0x70);
  return;
}



void FUN_1403c0ea0(longlong param_1)

{
  FUN_14036cb40(param_1 + -0x70);
  return;
}



void FUN_1403c0eb0(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_14035bda0(local_res18);
  FUN_140386f80(param_1,local_res18,param_3,param_4,uVar1);
  FUN_14012c7f0(param_2);
  return;
}



void FUN_1403c0f10(longlong param_1)

{
  FUN_1403c0eb0(param_1 + -0x70);
  return;
}



void FUN_1403c0f20(longlong param_1)

{
  FUN_1403bf3e0(param_1 + -0x70);
  return;
}



void FUN_1403c0f30(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_14034ed40(uVar1);
  uVar4 = 1;
  local_140[0] = 0;
  FUN_1403841b0(local_138);
  local_108 = Proud::AddrPort::vftable;
  local_f8 = 0;
  local_110 = 0;
  local_100 = DAT_1405d83d0;
  local_fc = DAT_1405d83d4;
  FUN_140378820(local_f0,param_2);
  lVar2 = FUN_1403bfd00(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_140376ec0(local_f0);
  FUN_140399690(local_130);
  if ((local_128 != 0) && (local_11c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_14034edd0(uVar1);
  return;
}



void FUN_1403c1060(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_14035bda0(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_1403c0f30(param_1,local_118);
  FUN_1403555d0(&local_58);
  FUN_1403555d0(&local_a0);
  FUN_140399690(&local_c8);
  if (local_c0 != 0) {
    if ((longlong)local_b8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_b8 = local_b8 & 0xffffffff00000000;
  }
  FUN_1403555d0(&local_f0);
  FUN_140376ab0(&local_f8);
  FUN_140376a30(&local_100);
  FUN_14012c7f0(local_110);
  FUN_14012c7f0(param_2);
  return;
}



void FUN_1403c11e0(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_14035bda0(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_1403c0f30(param_1,local_118);
  FUN_1403555d0(&local_58);
  FUN_1403555d0(&local_a0);
  FUN_140399690(&local_c8);
  if (local_c0 != 0) {
    if ((longlong)local_b8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_b8 = local_b8 & 0xffffffff00000000;
  }
  FUN_1403555d0(&local_f0);
  FUN_140376ab0(&local_f8);
  FUN_140376a30(&local_100);
  FUN_14012c7f0(local_110);
  FUN_14012c7f0(param_2);
  return;
}



void FUN_1403c1360(longlong *param_1,longlong param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  uVar3 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_1 + 0x58))();
  uVar4 = uVar1;
  FUN_14034ed40(uVar1);
  lVar2 = FUN_1403bfd00(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_140383db0(param_2 + 8,0);
  FUN_14034edd0(uVar1);
  return;
}



void FUN_1403c1400(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_14034ed40(uVar6);
  lVar1 = param_1[0x2c3];
  while( true ) {
    if (lVar1 == 0) {
      FUN_14034edd0(uVar6);
      return;
    }
    puVar7 = (undefined4 *)FUN_1403bfbd0(param_1 + 0x2c0,local_188);
    lVar1 = param_1[0x2be];
    plVar2 = (longlong *)param_1[700];
    if (plVar2 == (longlong *)0x0) {
      puVar8 = (undefined8 *)FUN_14034fef0(0x148);
    }
    else {
      puVar8 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x148);
    }
    if (puVar8 != (undefined8 *)0x0) {
      *(undefined4 *)(puVar8 + 2) = *puVar7;
      FUN_1403841e0(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_140378820(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_1403555d0(local_78);
    FUN_1403555d0(local_c0);
    FUN_140399690(local_e8);
    if (local_e0 != 0) {
      if (local_d4 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_d8 = 0;
    }
    FUN_1403555d0(local_110);
    lVar1 = local_118;
    if (local_118 != 0) {
      FUN_14034ed40(local_118);
      bVar4 = true;
      *(longlong *)(local_118 + 0x40) = *(longlong *)(local_118 + 0x40) + -1;
      if (*(longlong *)(local_118 + 0x40) == 0) {
        FUN_14034edd0(lVar1);
        lVar5 = local_118;
        bVar4 = false;
        lVar3 = *(longlong *)(local_118 + 0x38);
        if (lVar3 != 0) {
          FUN_1403638e0(lVar3 + 0x28);
          FUN_14034ff60(lVar3);
        }
        FUN_14034edf0(lVar5);
        FUN_14034ff60(lVar5);
      }
      if (bVar4) {
        FUN_14034edd0(lVar1);
      }
    }
    lVar1 = local_120;
    if (local_120 != 0) {
      FUN_14034ed40(local_120);
      bVar4 = true;
      *(longlong *)(local_120 + 0x40) = *(longlong *)(local_120 + 0x40) + -1;
      if (*(longlong *)(local_120 + 0x40) == 0) {
        FUN_14034edd0(lVar1);
        lVar5 = local_120;
        bVar4 = false;
        lVar3 = *(longlong *)(local_120 + 0x38);
        if (lVar3 != 0) {
          FUN_1400031d0(lVar3 + 0x98);
          FUN_1403638e0(lVar3 + 0x38);
          FUN_14034ff60(lVar3);
        }
        FUN_14034edf0(lVar5);
        FUN_14034ff60(lVar5);
      }
      if (bVar4) {
        FUN_14034edd0(lVar1);
      }
    }
    lVar1 = local_130;
    if (local_130 != 0) {
      FUN_14034ed40(local_130);
      bVar4 = true;
      *(longlong *)(local_130 + 0x40) = *(longlong *)(local_130 + 0x40) + -1;
      if (*(longlong *)(local_130 + 0x40) == 0) {
        FUN_14034edd0(lVar1);
        lVar5 = local_130;
        bVar4 = false;
        lVar3 = *(longlong *)(local_130 + 0x38);
        if (lVar3 != 0) {
          FUN_1400031d0(lVar3 + 0x58);
          FUN_1403555d0(lVar3 + 0x28);
          FUN_1400031d0(lVar3 + 0x10);
          FUN_14034ff60(lVar3);
        }
        FUN_14034edf0(lVar5);
        FUN_14034ff60(lVar5);
      }
      if (bVar4) {
        FUN_14034edd0(lVar1);
      }
    }
    FUN_140399690(local_178);
    if ((local_170 != 0) && (local_164 < 0)) break;
    lVar1 = param_1[0x2c3];
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Removing unreachable block (ram,0x0001403c1af8)
// WARNING: Removing unreachable block (ram,0x0001403c19f9)
// WARNING: Removing unreachable block (ram,0x0001403c1a09)
// WARNING: Removing unreachable block (ram,0x0001403c1b03)
// WARNING: Removing unreachable block (ram,0x0001403c1a1d)
// WARNING: Removing unreachable block (ram,0x0001403c1a25)
// WARNING: Removing unreachable block (ram,0x0001403c1a2f)
// WARNING: Removing unreachable block (ram,0x0001403c1aed)

void FUN_1403c17c0(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_1405d84f0 ^ (ulonglong)auStack_1a8;
  (**(code **)(*(longlong *)(param_1 + 0x78) + 0x10))();
  lVar7 = 0;
  local_158 = 0;
  FUN_1403ac9b0(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_1403c189b;
    }
    local_170 = 0;
    FUN_1403aca30(&local_170,param_1 + 0x15d8);
    lVar6 = lVar7;
    if (*(longlong *)(param_1 + 0x5d8) != 0) {
      lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
    }
    FUN_1403d3e30(lVar6,&local_170);
  }
LAB_1403c189b:
  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_1403c190f;
    }
    local_168 = 0;
    FUN_1403aca30(&local_168,param_1 + 0x1520);
    lVar6 = lVar7;
    if (*(longlong *)(param_1 + 0x5d8) != 0) {
      lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x5d8) + 0x38);
    }
    FUN_1403d3e30(lVar6,&local_168);
  }
LAB_1403c190f:
  local_150 = 0;
  FUN_1403aca30(param_1 + 0x15d8,&local_150);
  local_160 = 0;
  FUN_1403aca30(param_1 + 0x1520,&local_160);
  FUN_1403bc860(param_1);
  plVar3 = *(longlong **)(param_1 + 0x1708);
  do {
    if (plVar3 == (longlong *)0x0) {
      FUN_1403b8150(param_1 + 0x1700);
      if (param_2 != '\0') {
        FUN_1403bfc50(param_1 + 0x15e0);
      }
      FUN_140395400(param_1 + 0xd8);
      FUN_1400179d0(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_1403bf590(param_1 + 0x5e0);
      uVar8 = FUN_140350020();
      *(undefined8 *)(param_1 + 0x640) = uVar8;
      *(undefined8 *)(param_1 + 0x648) = DAT_1405d8090;
      *(undefined8 *)(param_1 + 0x510) = DAT_1405d8100;
      *(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_1405d8110;
      puVar5 = (undefined8 *)FUN_1403a6d70(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_1403b8320(param_1 + 0x6e0);
      *(undefined4 *)(param_1 + 0x700) = 0;
      *(undefined1 *)(param_1 + 0x1528) = 0;
      FUN_1403b8320(param_1 + 0x1530);
      *(undefined4 *)(param_1 + 0x1578) = 0;
      uVar8 = FUN_14035b3f0(local_88);
      FUN_1403ace40(param_1 + 0x1588,uVar8);
      FUN_1403555d0(local_68);
      if (((local_88[0] != (undefined *)0x0) && (local_88[0] != PTR_DAT_1405d8010)) &&
         (local_88[0] + -8 != (undefined *)0x0)) {
        uVar8 = FUN_14034fe70();
        local_148 = uVar8;
        FUN_14034ed40(uVar8);
        local_140 = 1;
        piVar2 = (int *)(local_88[0] + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(local_88[0] + -8);
        }
        FUN_14034edd0(uVar8);
        local_140 = 0;
      }
      local_88[0] = PTR_DAT_1405d8010;
      FUN_1403bfc50(param_1 + 0x1600);
      FUN_14035a250(param_1 + 0x1620);
      *(undefined8 *)(param_1 + 0x1648) = 0;
      FUN_1403b9cf0(param_1 + 0x1650);
      FUN_1403b9cf0(param_1 + 0x16a8);
      puVar5 = (undefined8 *)FUN_1403a9ce0(local_f0,DAT_1405d8180);
      *(undefined8 *)(param_1 + 0x1778) = *puVar5;
      *(undefined8 *)(param_1 + 0x1780) = puVar5[1];
      *(undefined8 *)(param_1 + 0x1788) = puVar5[2];
      puVar5 = (undefined8 *)FUN_1403a9ce0(local_d8,DAT_1405d81a0);
      *(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_r0x0001403c19cf;
    }
    else {
code_r0x0001403c19cf:
      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_1403d3e30(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_1403b6310(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_14034ff60(plVar4);
      }
    }
  } while( true );
}



void FUN_1403c1ea0(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_1403bd0b0(param_1,&local_160,*param_2);
    plVar8 = (longlong *)0x0;
    if ((local_160 == (longlong *)0x0) || (*local_160 == 0)) {
      plVar5 = (longlong *)FUN_1403bfa30(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_140360b20((longlong)pvVar3 + 8);
            operator_delete(pvVar3);
          }
          FUN_14034ff60(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_140360b20((longlong)pvVar3 + 8);
          operator_delete(pvVar3);
        }
        FUN_14034ff60(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_1403b7ee0(plVar6 + 1,param_3,&local_140);
    }
    else {
      FUN_1403b68a0(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_1403e1840(local_158,param_1);
          }
          if (plVar5 == (longlong *)0x0) {
            local_158 = (longlong *)0x0;
          }
          else {
            local_158 = (longlong *)FUN_14034fef0(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_14034ff60(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_14034ff60(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_1403bc9c0(param_1 + 0x1650,(longlong)plVar5 + 0x56c,&local_168);
          FUN_14035d100(param_1 + 0x1650);
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          FUN_1403de040(plVar5,1);
          if (*(int *)(param_8 + 0x18) == 0) {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_140395400(plVar5 + 0x2d);
          }
          else {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_140394f20(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_1403a4780(plVar5 + 0xa7,*(undefined8 *)(param_9 + 0x10),
                          *(uint *)(param_1 + 0x6c0) >> 3);
          }
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          FUN_1403e37f0(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_1403e1080(plVar5);
          }
        }
        else if (*(char *)(lVar2 + 0x684) != '\0') {
          FUN_1403e00a0(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_1403de040(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_140395400(plVar5 + 0x2d);
            FUN_1400179d0(plVar5 + 0xa7,0);
          }
          else {
            plVar5 = plVar8;
            if (local_168 != (longlong *)0x0) {
              plVar5 = (longlong *)*local_168;
            }
            FUN_140394f20(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_1403a4780(plVar5 + 0xa7,*(undefined8 *)(param_9 + 0x10),
                          *(uint *)(param_1 + 0x6c0) >> 3);
          }
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          FUN_1403e37f0(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_1403e1080(plVar5);
          }
          plVar5 = plVar8;
          if (local_168 != (longlong *)0x0) {
            plVar5 = (longlong *)*local_168;
          }
          *(undefined1 *)((longlong)plVar5 + 0x684) = 0;
          FUN_1403bb720(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_1403bf930(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_1403b7ee0(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_14034ff60(plVar6);
      }
    }
    (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x60))
              ((longlong *)(param_1 + 0x1818),1,&DAT_1405f2490,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_14034f7d0();
    }
    FUN_1400179d0(&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_14000d3f0(plVar5,plVar6,(longlong)iVar1);
    FUN_1403c0f30(param_1,local_128);
    FUN_140376ec0(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_140360b20((longlong)pvVar3 + 8);
        operator_delete(pvVar3);
      }
      FUN_14034ff60(plVar8);
    }
  }
  return;
}



undefined8
FUN_1403c2790(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_14034ed40(uVar1);
  FUN_1403c1ea0(*(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_14034edd0(uVar1);
  return 1;
}



undefined8
FUN_1403c2870(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_14034ed40();
  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_1403c1ea0(*(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_1403555d0(&local_60);
  FUN_1403555d0(&local_38);
  FUN_14034edd0(uVar1);
  return 1;
}



undefined8
FUN_1403c29c0(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_14034ed40(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_1403b68a0(*(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_14034ff60(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_1403de040(lVar6,0);
    param_6 = 0;
    FUN_1403b80b0(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_1403c0f30(*(undefined8 *)(param_1 + 0x20),local_138);
    FUN_140376ec0(local_138);
  }
  FUN_14034edd0(uVar4);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001403c2df2)
// WARNING: Removing unreachable block (ram,0x0001403c2e04)
// WARNING: Removing unreachable block (ram,0x0001403c2e1f)
// WARNING: Removing unreachable block (ram,0x0001403c2e27)
// WARNING: Removing unreachable block (ram,0x0001403c2e31)

undefined8
FUN_1403c2c30(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_14034ed40(local_48);
  local_40 = 1;
  lVar6 = *(longlong *)(param_1 + 0x20);
  if ((*(char *)(lVar6 + 0x1790) != '\0') || (*(int *)(lVar6 + 0x6c8) != 0)) {
    FUN_1403b8ef0(lVar6,1,&DAT_1404666f0,*(undefined4 *)(lVar6 + 0x1578),*param_4,*param_5);
  }
  FUN_1403b68a0(*(undefined8 *)(param_1 + 0x20),&local_res20,*param_4);
  FUN_1403bd0b0(*(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_1403c2d4f;
        if (*puVar1 == *param_4) break;
        puVar1 = *(uint **)(puVar1 + 4);
      }
      FUN_140360170(lVar6 + 8,puVar1,0);
    }
  }
LAB_1403c2d4f:
  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_1403c2dd3;
        if (*puVar1 == *param_5) break;
        puVar1 = *(uint **)(puVar1 + 4);
      }
      FUN_1403bdf80(lVar2 + 0x5b0,puVar1,0);
    }
LAB_1403c2dd3:
    if (local_res20 != (longlong *)0x0) {
      local_res20[1] = local_res20[1] + 1;
    }
    FUN_1403bd4d0(*(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_1403c2ed0;
        if (*puVar1 == *param_5) break;
        puVar1 = *(uint **)(puVar1 + 4);
      }
      FUN_1403bdf80(lVar6 + 0x5e0,puVar1,0);
    }
  }
LAB_1403c2ed0:
  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_1403c0f30(*(undefined8 *)(param_1 + 0x20),local_138);
  FUN_1403555d0(&local_78);
  FUN_1403555d0(&local_c0);
  local_38 = &local_e8;
  FUN_140399690(&local_e8);
  if (local_e0 != 0) {
    if ((longlong)local_d8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d8 = local_d8 & 0xffffffff00000000;
  }
  FUN_1403555d0(&local_110);
  FUN_140376ab0(&local_118);
  FUN_140376a30(&local_120);
  FUN_14012c7f0(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_140360b20((longlong)pvVar3 + 8);
      operator_delete(pvVar3);
    }
    FUN_14034ff60(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_14034ff60(local_res20);
  }
  FUN_14034edd0(local_48);
  return 1;
}



undefined8
FUN_1403c30a0(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_14034ed40(uVar2);
  local_128 = 1;
  FUN_1403b68a0(*(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_1403de180(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_1403aca30(&local_148,lVar4 + 0x18);
        FUN_1403bb660(*(undefined8 *)(param_1 + 0x20),&local_148);
        local_140 = 0;
        lVar4 = lVar5;
        if (local_res8 != (longlong *)0x0) {
          lVar4 = *local_res8;
        }
        FUN_1403aca30(lVar4 + 0x18,&local_140);
      }
      if (local_res8 != (longlong *)0x0) {
        lVar5 = *local_res8;
      }
      FUN_1403de040(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_1403de040(lVar4,0);
      local_138 = 0;
      lVar4 = lVar5;
      if (local_res8 != (longlong *)0x0) {
        lVar4 = *local_res8;
      }
      FUN_1403b80b0(lVar4 + 0x28,&local_138);
      if (local_res8 != (longlong *)0x0) {
        lVar5 = *local_res8;
      }
      uVar3 = FUN_1403de1c0(lVar5);
      FUN_1403e1be0(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_1403c0f30(*(undefined8 *)(param_1 + 0x20),local_118);
      FUN_140376ec0(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_14034ff60(local_res8);
    uVar2 = local_130;
  }
  FUN_14034edd0(uVar2);
  return 1;
}



// WARNING: Removing unreachable block (ram,0x0001403c358c)
// WARNING: Removing unreachable block (ram,0x0001403c3595)
// WARNING: Removing unreachable block (ram,0x0001403c35b6)
// WARNING: Removing unreachable block (ram,0x0001403c35bf)

undefined8 *
FUN_1403c33e0(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_140386400(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_1403a9ce0(param_1 + 0x17,DAT_1405d80f8 * 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_1403c0cc0();
  FUN_14034ec60(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_1403a6d70(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_140359a20(puVar1);
  FUN_140359b40(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_14035b3f0(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_14035a1b0(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_1403a9ce0(param_1 + 0x2ef,DAT_1405d8180);
  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_140385af0(puVar1);
  *puVar1 = ProudC2C::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x17e4) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar1 = Proud::CNetClientImpl::C2CProxy::vftable;
  FUN_140388e70(param_1 + 0x2fe);
  param_1[0x2fe] = Proud::CNetClientImpl::C2CStub::vftable;
  puVar2 = param_1 + 0x303;
  local_res10 = puVar2;
  FUN_140385af0(puVar2);
  *puVar2 = ProudC2S::Proxy::vftable;
  if (*(int *)((longlong)param_1 + 0x182c) != 1) {
    FUN_14034fa20(PTR_u_PIDL_compiler_is_incompatible_to_1405d8ff8);
  }
  *puVar2 = Proud::CNetClientImpl::C2SProxy::vftable;
  FUN_140388e70(param_1 + 0x307);
  param_1[0x307] = Proud::CNetClientImpl::S2CStub::vftable;
  param_1[0x30d] = 0;
  param_1[0x30e] = 0;
  FUN_1403a9ce0(param_1 + 0x30f,DAT_1405d81a0);
  *(undefined2 *)(param_1 + 0x319) = 0;
  *(undefined1 *)((longlong)param_1 + 0x18ca) = 0;
  param_1[0x30c] = DAT_1405d81a0;
  uVar8 = FUN_1403b6140(&local_res10);
  FUN_1403ac860(param_1 + 0xbb,uVar8);
  puVar5 = local_res10;
  if (local_res10 != (undefined8 *)0x0) {
    FUN_14034ed40(local_res10);
    bVar4 = true;
    local_res10[8] = local_res10[8] + -1;
    if (local_res10[8] == 0) {
      FUN_14034edd0(puVar5);
      puVar6 = local_res10;
      bVar4 = false;
      local_res18 = local_res10;
      puVar3 = (undefined8 *)local_res10[7];
      if (puVar3 != (undefined8 *)0x0) {
        (**(code **)*puVar3)(puVar3,1);
      }
      FUN_14034edf0(puVar6);
      FUN_14034ff60(puVar6);
    }
    if (bVar4) {
      FUN_14034edd0(puVar5);
    }
  }
  FUN_14034fa80();
  *(undefined1 *)(param_1 + 0xca) = 0;
  *(undefined4 *)(param_1 + 0xd3) = DAT_1405d8110;
  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_1403ce970(lVar9);
  param_1[0xa2] = dVar11 + DAT_1405d8100;
  FUN_140386850(param_1,puVar1);
  FUN_140386850(param_1,puVar2);
  FUN_140386a50(param_1,param_1 + 0x307);
  FUN_140386a50(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_140352e50(&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_14034ffc0(0x800,&local_50);
  param_1[0x9c] = uVar8;
  FUN_1403eb740(param_1 + 0xdc);
  FUN_1403eb740(param_1 + 700);
  FUN_1403eb740(param_1 + 0x2c0);
  FUN_1403eb740(param_1 + 0x2a6);
  return param_1;
}



void * FUN_1403c3c40(void *param_1,uint param_2)

{
  FUN_1403c06d0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403c3c70(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_14034ed40(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_14034fef0(0x60);
    puVar4 = puVar5;
    if (local_res8 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_14035bca0(local_res8);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
    }
    else {
      puVar5 = (undefined8 *)FUN_14034fef0(0x48);
      local_158 = puVar5;
      if (puVar5 != (undefined8 *)0x0) {
        local_res8 = puVar5;
        uVar2 = FUN_1403c0cc0();
        FUN_14034ec60(puVar5,uVar2,1);
      }
      local_res8 = puVar5;
      FUN_14034ed40(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_14034edd0(puVar5);
    }
    FUN_14035bda0(local_140,&local_res8);
    if (puVar5 != (undefined8 *)0x0) {
      local_158 = puVar5;
      FUN_14034ed40();
      local_150 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(puVar5);
        local_150 = 0;
        FUN_14012c7d0();
      }
      else {
        FUN_14034edd0();
      }
    }
    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_1403c0f30(param_1,local_148);
    *(undefined1 *)(param_1 + 0x9d) = 1;
    if (param_1[0xb] != 0) {
      lVar7 = param_1[0xb] + 0x98;
      local_48 = lVar7;
      FUN_14034ed40(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_1405f2490,&local_158);
      FUN_14034edd0(lVar7);
    }
    FUN_1403555d0(&local_88);
    FUN_1403555d0(&local_d0);
    local_res8 = &local_f8;
    FUN_140399690(&local_f8);
    if (local_f0 != 0) {
      if ((longlong)local_e8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_e8 = local_e8 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_120);
    FUN_140376ab0(&local_128);
    FUN_140376a30(&local_130);
    FUN_14012c7f0(local_140);
  }
  FUN_14034edd0(uVar3);
  return;
}



void FUN_1403c3f90(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_14034ed40(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_14034fef0(0x60);
    puVar4 = puVar7;
    if (local_res8 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_14035bca0(local_res8);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar5 = puVar7;
    }
    else {
      puVar5 = (undefined8 *)FUN_14034fef0(0x48);
      if (puVar5 != (undefined8 *)0x0) {
        local_res8 = puVar5;
        uVar2 = FUN_1403c0cc0();
        FUN_14034ec60(puVar5,uVar2,1);
      }
      local_res8 = puVar5;
      FUN_14034ed40(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_14034edd0(puVar5);
    }
    FUN_14035bda0(local_140,&local_res8);
    if (puVar5 != (undefined8 *)0x0) {
      local_158 = puVar5;
      FUN_14034ed40(puVar5);
      local_150 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(puVar5);
        local_150 = 0;
        FUN_14012c7d0(puVar5);
      }
      else {
        FUN_14034edd0(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_14034fe70();
    local_res8 = (undefined8 *)PTR_DAT_1405d8010;
    FUN_140003100(&local_res8,param_1 + 0x2b1);
    lVar6 = FUN_140353280(&local_158,&local_res8,(short)param_1[0x2b2]);
    local_98 = *(undefined4 *)(lVar6 + 8);
    local_94 = *(undefined2 *)(lVar6 + 0xc);
    local_90 = 0;
    FUN_1403c0f30(param_1,local_148);
    *(undefined1 *)(param_1 + 0x9d) = 1;
    FUN_1403555d0(&local_88);
    FUN_1403555d0(&local_d0);
    local_res8 = &local_f8;
    FUN_140399690(&local_f8);
    if (local_f0 != 0) {
      if ((longlong)local_e8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_e8 = local_e8 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_120);
    FUN_140376ab0(&local_128);
    FUN_140376a30(&local_130);
    FUN_14012c7f0(local_140);
  }
  FUN_14034edd0(uVar3);
  FUN_14012c7f0(param_3);
  return;
}



void FUN_1403c42b0(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_14034ed40(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_14034fef0(0x60);
    puVar4 = puVar7;
    if (local_res8 != (undefined8 *)0x0) {
      puVar4 = (undefined8 *)FUN_14035bca0(local_res8);
    }
    if (puVar4 == (undefined8 *)0x0) {
      local_res8 = (undefined8 *)0x0;
      puVar5 = puVar7;
    }
    else {
      puVar5 = (undefined8 *)FUN_14034fef0(0x48);
      if (puVar5 != (undefined8 *)0x0) {
        local_res8 = puVar5;
        uVar2 = FUN_1403c0cc0();
        FUN_14034ec60(puVar5,uVar2,1);
      }
      local_res8 = puVar5;
      FUN_14034ed40(puVar5);
      puVar5[8] = 1;
      puVar5[7] = puVar4;
      FUN_14034edd0(puVar5);
    }
    FUN_14035bda0(local_140,&local_res8);
    if (puVar5 != (undefined8 *)0x0) {
      local_158 = puVar5;
      FUN_14034ed40(puVar5);
      local_150 = 1;
      plVar1 = puVar5 + 8;
      *plVar1 = *plVar1 + -1;
      if (*plVar1 == 0) {
        FUN_14034edd0(puVar5);
        local_150 = 0;
        FUN_14012c7d0(puVar5);
      }
      else {
        FUN_14034edd0(puVar5);
      }
    }
    local_148[0] = 2;
    if (local_140[0] != 0) {
      puVar7 = *(undefined8 **)(local_140[0] + 0x38);
    }
    *(undefined4 *)puVar7 = param_2;
    local_d8 = 1;
    FUN_14034fe70();
    local_res8 = (undefined8 *)PTR_DAT_1405d8010;
    FUN_140003100(&local_res8,param_1 + 0x2b1);
    lVar6 = FUN_140353280(&local_158,&local_res8,(short)param_1[0x2b2]);
    local_98 = *(undefined4 *)(lVar6 + 8);
    local_94 = *(undefined2 *)(lVar6 + 0xc);
    local_90 = param_3;
    FUN_1403c0f30(param_1,local_148);
    *(undefined1 *)(param_1 + 0x9d) = 1;
    FUN_1403555d0(&local_88);
    FUN_1403555d0(&local_d0);
    local_res8 = &local_f8;
    FUN_140399690(&local_f8);
    if (local_f0 != 0) {
      if ((longlong)local_e8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_e8 = local_e8 & 0xffffffff00000000;
    }
    FUN_1403555d0(&local_120);
    FUN_140376ab0(&local_128);
    FUN_140376a30(&local_130);
    FUN_14012c7f0(local_140);
  }
  FUN_14034edd0(uVar3);
  return;
}



undefined8 FUN_1403c4590(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_14034ed40(uVar5);
  puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x20) + 0x5d0);
  if ((puVar1 == (ulonglong *)0x0) || (*puVar1 == 0)) goto LAB_1403c4829;
  uVar13 = 0;
  uVar6 = uVar13;
  if (puVar1 != (ulonglong *)0x0) {
    uVar6 = *puVar1;
  }
  if (3 < *(int *)(uVar6 + 0x100)) goto LAB_1403c4829;
  FUN_14034fe70();
  puVar11 = (uint *)PTR_DAT_1405d8010;
  local_res8 = (uint *)PTR_DAT_1405d8010;
  uVar2 = FUN_14034fcf0(L"Autoprune");
  uVar4 = 0;
  uVar6 = uVar13;
  if ((puVar11 != (uint *)0x0) && (uVar6 = 0, puVar11 != (uint *)PTR_DAT_1405d8010)) {
    uVar6 = (ulonglong)*(uint *)((longlong)puVar11 + -8);
  }
  uVar3 = uVar2;
  if ((((int)uVar2 <= (int)uVar6) && (uVar3 = uVar4, puVar11 != (uint *)0x0)) &&
     (puVar11 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = *(uint *)((longlong)puVar11 + -8);
  }
  uVar12 = 1;
  if (1 < (int)uVar3) {
    uVar12 = uVar3;
  }
  uVar3 = uVar4;
  if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = *(uint *)((longlong)puVar11 + -8);
  }
  uVar9 = 0;
  if ((int)uVar3 < (int)uVar12) {
    if (puVar11 == (uint *)0x0) {
      puVar11 = (uint *)PTR_DAT_1405d8010;
    }
    local_res8 = puVar11;
    if ((int)uVar12 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar12 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar3 = uVar4;
      if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8010)) {
        uVar3 = puVar11[-2];
      }
      if (uVar12 != uVar3) {
        puVar7 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar3 = puVar11[-2];
        }
        puVar10 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar12 < (int)uVar3) {
LAB_1403c46f4:
          if (puVar11 != (uint *)0x0) {
            puVar10 = puVar11;
          }
        }
        else {
          uVar12 = uVar4;
          if (puVar11 != (uint *)0x0) {
            if (puVar11 != (uint *)PTR_DAT_1405d8010) {
              uVar12 = puVar11[-2];
            }
            goto LAB_1403c46f4;
          }
        }
        FUN_14034fd20(puVar7 + 2,puVar10,uVar12);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar7 + 2;
      }
    }
  }
  FUN_140002e10(&local_res8);
  puVar11 = local_res8;
  puVar7 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar7,L"Autoprune",uVar2);
  puVar7 = puVar11;
  if (puVar11 == (uint *)0x0) {
    puVar7 = (uint *)PTR_DAT_1405d8010;
  }
  uVar4 = FUN_14034fcf0(puVar7);
  uVar2 = 0;
  if (0 < (int)uVar4) {
    uVar2 = uVar4;
  }
  uVar4 = uVar9;
  if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8010)) {
    uVar4 = puVar11[-2];
  }
  if (((int)uVar2 < (int)uVar4) || (uVar2 = uVar9, puVar11 == (uint *)0x0)) {
LAB_1403c4789:
    if (((puVar11 != (uint *)PTR_DAT_1405d8010) && (puVar11 != (uint *)0x0)) &&
       (puVar11 + -2 != (uint *)0x0)) {
      puVar11[-2] = uVar2;
      *(undefined2 *)((longlong)puVar11 + (longlong)(int)uVar2 * 2) = 0;
    }
  }
  else if (puVar11 != (uint *)PTR_DAT_1405d8010) {
    uVar2 = puVar11[-2];
    goto LAB_1403c4789;
  }
  FUN_1403c3c70(*(undefined8 *)(param_1 + 0x20),0xb,3,&local_res8);
  if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar11 + -2 != (uint *)0x0)) {
    uVar8 = FUN_14034fe70();
    FUN_14034ed40(uVar8);
    puVar7 = puVar11 + -1;
    *puVar7 = *puVar7 - 1;
    if (*puVar7 == 0) {
      FUN_14034ff60(puVar11 + -2);
    }
    FUN_14034edd0(uVar8);
  }
  puVar1 = *(ulonglong **)(*(longlong *)(param_1 + 0x20) + 0x5d0);
  if (puVar1 != (ulonglong *)0x0) {
    uVar13 = *puVar1;
  }
  FUN_1403ce3b0(uVar13,4);
LAB_1403c4829:
  FUN_14034edd0(uVar5);
  return 1;
}



void FUN_1403c4850(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_14034ed40();
  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_14034ed40(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_14034edd0(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_14034ed40(puVar14);
    local_80 = 1;
    FUN_1403b8ef0(param_1 + -0xe,0,&DAT_140466a40,(int)param_1[0x2a1]);
    FUN_14034edd0(puVar14);
  }
  plVar1 = param_1 + -0xe;
  puVar14 = puVar15;
  do {
    uVar9 = (**(code **)(*plVar1 + 0x58))(plVar1);
    local_160 = uVar9;
    FUN_14034ed40(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_14034fe70();
        local_140 = PTR_DAT_1405d8010;
        plVar11 = (longlong *)FUN_14034fc50(&local_118);
        puVar14 = (undefined *)*plVar11;
        if ((undefined *)*plVar11 == (undefined *)0x0) {
          puVar14 = PTR_DAT_1405d8010;
        }
        FUN_140017720(&local_140,L"Unstability in Disconnect #1! Process=%s",puVar14);
        if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1405d8010)) &&
           (local_118 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_b8 = uVar12;
          FUN_14034ed40(uVar12);
          local_b0 = 1;
          piVar2 = (int *)(local_118 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(local_118 + -8);
          }
          FUN_14034edd0(uVar12);
        }
        FUN_14034fe70();
        puVar14 = local_140;
        local_168 = PTR_DAT_1405d8010;
        if (PTR_DAT_1405d8010 == (undefined *)0x0) {
          local_168 = puVar15;
        }
        if (local_140 != PTR_DAT_1405d8010) {
          uVar12 = FUN_14034fe70();
          local_98 = uVar12;
          FUN_14034ed40(uVar12);
          local_90 = 1;
          FUN_1400031d0(&local_168);
          local_168 = puVar14;
          if (((puVar14 != PTR_DAT_1405d8010) && (puVar14 != (undefined *)0x0)) &&
             (puVar14 != (undefined *)0x8)) {
            *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
          }
          FUN_14034edd0(uVar12);
        }
        FUN_140352d80(&local_168);
        if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1405d8010)) &&
           (puVar14 + -8 != (undefined *)0x0)) {
          uVar12 = FUN_14034fe70();
          local_78 = uVar12;
          FUN_14034ed40(uVar12);
          local_70 = 1;
          piVar2 = (int *)(puVar14 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar14 + -8);
          }
          FUN_14034edd0(uVar12);
        }
      }
      FUN_1403c17c0(plVar1,1);
      FUN_14034edd0(uVar9);
LAB_1403c503d:
      FUN_14034edd0(local_150);
      return;
    }
    if ((*(int *)(lVar3 + 0x100) == 5) && (param_1[0x2d5] == 0)) {
      FUN_1403c17c0(plVar1,1);
      FUN_14034edd0(local_160);
      goto LAB_1403c503d;
    }
    if (DAT_1405f0950 != '\0') {
      FUN_1403c17c0(plVar1,1);
      FUN_14034edd0(local_160);
      goto LAB_1403c503d;
    }
    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_1403ce3b0(puVar14,5);
      FUN_14034fe70();
      local_138 = PTR_DAT_1405d8010;
      plVar11 = (longlong *)FUN_14034fc50(&local_128);
      puVar14 = (undefined *)*plVar11;
      if ((undefined *)*plVar11 == (undefined *)0x0) {
        puVar14 = PTR_DAT_1405d8010;
      }
      FUN_140017720(&local_138,L"Unstability in Disconnect #2! Process=%s",puVar14);
      if (((local_128 != (undefined *)0x0) && (local_128 != PTR_DAT_1405d8010)) &&
         (local_128 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_100 = uVar9;
        FUN_14034ed40(uVar9);
        local_f8 = 1;
        piVar2 = (int *)(local_128 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(local_128 + -8);
        }
        FUN_14034edd0(uVar9);
      }
      FUN_14034fe70();
      puVar14 = local_138;
      local_res20 = PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_res20 = puVar15;
      }
      if (local_138 != PTR_DAT_1405d8010) {
        uVar9 = FUN_14034fe70();
        local_f0 = uVar9;
        FUN_14034ed40(uVar9);
        local_e8 = 1;
        FUN_1400031d0(&local_res20);
        local_res20 = puVar14;
        if (((puVar14 != PTR_DAT_1405d8010) && (puVar14 != (undefined *)0x0)) &&
           (puVar14 != (undefined *)0x8)) {
          *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
        }
        FUN_14034edd0(uVar9);
      }
      FUN_140352d80(&local_res20);
      if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1405d8010)) &&
         (puVar14 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_d8 = uVar9;
        FUN_14034ed40(uVar9);
        local_d0 = 1;
        piVar2 = (int *)(puVar14 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar14 + -8);
        }
        FUN_14034edd0(uVar9);
      }
      FUN_1403c17c0(plVar1,1);
      FUN_14034edd0(local_160);
      goto LAB_1403c503d;
    }
    DVar8 = GetTickCount();
    if (dVar5 < (double)(DVar8 - DVar7)) {
      FUN_14034fe70();
      local_130 = PTR_DAT_1405d8010;
      plVar11 = (longlong *)FUN_14034fc50(&local_120);
      puVar14 = (undefined *)*plVar11;
      if ((undefined *)*plVar11 == (undefined *)0x0) {
        puVar14 = PTR_DAT_1405d8010;
      }
      puVar10 = puVar15;
      if ((undefined8 *)param_1[0xac] != (undefined8 *)0x0) {
        puVar10 = *(undefined **)param_1[0xac];
      }
      FUN_140017720(&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_1405d8010)) &&
         (local_120 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_110 = uVar9;
        FUN_14034ed40(uVar9);
        local_108 = 1;
        piVar2 = (int *)(local_120 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(local_120 + -8);
        }
        FUN_14034edd0(uVar9);
      }
      FUN_14034fe70();
      puVar14 = local_130;
      local_res10 = PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_res10 = puVar15;
      }
      if (local_130 != PTR_DAT_1405d8010) {
        uVar9 = FUN_14034fe70();
        local_a8 = uVar9;
        FUN_14034ed40(uVar9);
        local_a0 = 1;
        FUN_1400031d0(&local_res10);
        local_res10 = puVar14;
        if (((puVar14 != PTR_DAT_1405d8010) && (puVar14 != (undefined *)0x0)) &&
           (puVar14 != (undefined *)0x8)) {
          *(int *)(puVar14 + -4) = *(int *)(puVar14 + -4) + 1;
        }
        FUN_14034edd0(uVar9);
      }
      FUN_140352d80(&local_res10);
      if ((undefined8 *)param_1[0xac] != (undefined8 *)0x0) {
        puVar15 = *(undefined **)param_1[0xac];
      }
      FUN_1403ce3b0(puVar15,5);
      FUN_1403c17c0(plVar1,1);
      if (((puVar14 != (undefined *)0x0) && (puVar14 != PTR_DAT_1405d8010)) &&
         (puVar14 + -8 != (undefined *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_c8 = uVar9;
        FUN_14034ed40(uVar9);
        local_c0 = 1;
        piVar2 = (int *)(puVar14 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar14 + -8);
        }
        FUN_14034edd0(uVar9);
      }
      FUN_14034edd0(local_160);
      goto LAB_1403c503d;
    }
    if (!bVar6) {
      bVar6 = true;
      puVar10 = puVar15;
      if (param_1[0xad] != 0) {
        puVar10 = *(undefined **)(param_1[0xad] + 0x38);
      }
      FUN_14034ee70(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_1405f2490,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_1403ce3b0(puVar10,4);
        }
      }
    }
    uVar9 = local_160;
    cVar13 = local_158;
    if (0 < (int)puVar14) {
      FUN_14034edd0(local_160);
      Sleep(10);
      cVar13 = '\0';
    }
    puVar14 = (undefined *)(ulonglong)((int)puVar14 + 1);
    if (cVar13 != '\0') {
      FUN_14034edd0(uVar9);
    }
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403c5070(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_1405d84f0 ^ (ulonglong)auStack_1b8;
  (**(code **)(param_1[0xf] + 0x18))();
  local_184 = 0;
  local_180[0] = 0;
  uVar2 = (**(code **)(*param_1 + 0x58))(param_1);
  FUN_1403a61f0(local_168,uVar2);
  cVar1 = FUN_1403bfd90(param_1,local_30);
  while (cVar1 != '\0') {
    local_187[0] = '\0';
    local_188 = '\0';
    local_190 = local_180;
    local_198 = &local_184;
    FUN_1403bbd00(param_1,local_30,local_187,&local_188);
    if (local_188 != '\0') {
      FUN_1403c1360(param_1,local_30);
    }
    if (local_187[0] != '\0') break;
    FUN_1403a6230(local_168);
    uVar2 = (**(code **)(*param_1 + 0x58))(param_1);
    FUN_1403a61f0(local_168,uVar2);
    cVar1 = FUN_1403bfd90(param_1,local_30);
  }
  FUN_1403a6230(local_168);
  if (param_2 != (undefined4 *)0x0) {
    *param_2 = local_184;
    param_2[1] = local_180[0];
  }
  return;
}



void FUN_1403c51c0(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_1403d7450(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_14034fef0(0x60);
  puVar11 = puVar30;
  if (local_res20 != (undefined4 *)0x0) {
    puVar11 = (undefined4 *)FUN_14035bca0(local_res20);
  }
  if (puVar11 == (undefined4 *)0x0) {
    local_res20 = (undefined4 *)0x0;
    puVar12 = puVar30;
  }
  else {
    puVar12 = (undefined4 *)FUN_14034fef0(0x48);
    local_70 = puVar12;
    if (puVar12 != (undefined4 *)0x0) {
      local_res20 = puVar12;
      uVar5 = FUN_1403c0cc0();
      FUN_14034ec60(puVar12,uVar5,1);
    }
    local_res20 = puVar12;
    FUN_14034ed40(puVar12);
    *(undefined8 *)(puVar12 + 0x10) = 1;
    *(undefined4 **)(puVar12 + 0xe) = puVar11;
    FUN_14034edd0(puVar12);
  }
  FUN_14035bda0(local_1d0,&local_res20);
  if (puVar12 != (undefined4 *)0x0) {
    local_1f8 = puVar12;
    FUN_14034ed40(puVar12);
    local_1f0 = 1;
    plVar16 = (longlong *)(puVar12 + 0x10);
    *plVar16 = *plVar16 + -1;
    if (*plVar16 == 0) {
      FUN_14034edd0(puVar12);
      local_1f0 = 0;
      FUN_14012c7d0(puVar12);
    }
    else {
      FUN_14034edd0(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_1403c0f30(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_1405d8088) {
    puVar11 = puVar30;
    if (puVar3 != (undefined8 *)0x0) {
      puVar11 = (undefined4 *)*puVar3;
    }
    *(undefined8 *)(puVar11 + 0x40) = DAT_1405f0690;
    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_1405d8078;
  }
  if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) goto LAB_1403c5b12;
  FUN_1403b7a60(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_1405d83d0;
    local_21c = DAT_1405d83d4;
  }
  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_140353960(&local_228,&local_200);
  puVar27 = (undefined *)*plVar13;
  if ((undefined *)*plVar13 == (undefined *)0x0) {
    puVar27 = PTR_DAT_1405d8010;
  }
  FUN_14034fe70();
  puVar20 = (uint *)PTR_DAT_1405d8010;
  local_res18 = (uint *)PTR_DAT_1405d8010;
  uVar6 = FUN_14034fcf0(puVar27);
  puVar11 = puVar30;
  if ((puVar20 != (uint *)0x0) &&
     (puVar11 = (undefined4 *)0x0, puVar20 != (uint *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    uVar7 = *(uint *)((longlong)puVar20 + -8);
  }
  uVar22 = 1;
  if (1 < (int)uVar7) {
    uVar22 = uVar7;
  }
  uVar7 = uVar9;
  if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8010)) {
    uVar7 = *(uint *)((longlong)puVar20 + -8);
  }
  if ((int)uVar7 < (int)uVar22) {
    if (puVar20 == (uint *)0x0) {
      puVar20 = (uint *)PTR_DAT_1405d8010;
    }
    local_res18 = puVar20;
    if ((int)uVar22 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar22 == 0) {
      FUN_1400031d0(&local_res18);
    }
    else {
      uVar7 = uVar9;
      if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8010)) {
        uVar7 = puVar20[-2];
      }
      if (uVar22 != uVar7) {
        puVar14 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar7 = puVar20[-2];
        }
        puVar18 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar22 < (int)uVar7) {
LAB_1403c565a:
          if (puVar20 != (uint *)0x0) {
            puVar18 = puVar20;
          }
        }
        else {
          uVar22 = uVar8;
          if (puVar20 != (uint *)0x0) {
            if (puVar20 != (uint *)PTR_DAT_1405d8010) {
              uVar22 = puVar20[-2];
            }
            goto LAB_1403c565a;
          }
        }
        FUN_14034fd20(puVar14 + 2,puVar18,uVar22);
        FUN_1400031d0(&local_res18);
        local_res18 = puVar14 + 2;
      }
    }
  }
  FUN_140002e10(&local_res18);
  puVar20 = local_res18;
  puVar14 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar14 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar14,puVar27,uVar6);
  puVar14 = puVar20;
  if (puVar20 == (uint *)0x0) {
    puVar14 = (uint *)PTR_DAT_1405d8010;
  }
  uVar8 = FUN_14034fcf0(puVar14);
  puVar11 = puVar30;
  if (0 < (int)uVar8) {
    puVar11 = (undefined4 *)(ulonglong)uVar8;
  }
  if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8010)) {
    uVar9 = puVar20[-2];
  }
  if (((int)puVar11 < (int)uVar9) || (puVar11 = puVar30, puVar20 == (uint *)0x0)) {
LAB_1403c56f6:
    if (((puVar20 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
    puVar11 = (undefined4 *)(ulonglong)puVar20[-2];
    goto LAB_1403c56f6;
  }
  if (((local_200 != (undefined *)0x0) && (local_200 != PTR_DAT_1405d8010)) &&
     (local_200 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_14034fe70();
    local_a0 = uVar15;
    FUN_14034ed40(uVar15);
    local_98 = 1;
    piVar1 = (int *)(local_200 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_200 + -8);
    }
    FUN_14034edd0(uVar15);
  }
  if (puVar20 == (uint *)0x0) {
    puVar20 = (uint *)PTR_DAT_1405d8010;
  }
  puVar27 = local_210;
  if (local_210 == (undefined *)0x0) {
    puVar27 = PTR_DAT_1405d8010;
  }
  local_res8 = (undefined8 *)((ulonglong)local_res8 & 0xffffffffffffff00);
  local_200 = PTR_DAT_1405d8010;
  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_1405d8010) {
    iVar10 = 0;
  }
  else {
    iVar10 = *(int *)(puVar28 + -8);
  }
  if (((local_1e8 != (undefined *)0x0) && (local_1e8 != PTR_DAT_1405d8010)) &&
     (local_1e8 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_14034fe70();
    local_e8 = uVar15;
    FUN_14034ed40(uVar15);
    local_e0 = 1;
    piVar1 = (int *)(local_1e8 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_1e8 + -8);
    }
    FUN_14034edd0(uVar15);
  }
  if (iVar10 != 0) {
    iVar26 = iVar26 + 1;
  }
  FUN_14034fe70();
  local_218 = PTR_DAT_1405d8010;
  plVar16 = (longlong *)FUN_14034fc50(&local_1e0);
  plVar13 = (longlong *)(**(code **)(*(longlong *)(param_1 + 0x70) + 0xb0))();
  puVar28 = (undefined *)*plVar16;
  if ((undefined *)*plVar16 == (undefined *)0x0) {
    puVar28 = PTR_DAT_1405d8010;
  }
  puVar29 = (undefined *)*plVar13;
  if ((undefined *)*plVar13 == (undefined *)0x0) {
    puVar29 = PTR_DAT_1405d8010;
  }
  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_140017720(&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_1405d8010)) &&
     (local_208 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_14034fe70();
    local_80 = uVar15;
    FUN_14034ed40(uVar15);
    local_78 = 1;
    piVar1 = (int *)(local_208 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_208 + -8);
    }
    FUN_14034edd0(uVar15);
  }
  local_208 = PTR_DAT_1405d8010;
  if (((local_1e0 != (undefined *)0x0) && (local_1e0 != PTR_DAT_1405d8010)) &&
     (local_1e0 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_14034fe70();
    local_d8 = uVar15;
    FUN_14034ed40(uVar15);
    local_d0 = 1;
    piVar1 = (int *)(local_1e0 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_1e0 + -8);
    }
    FUN_14034edd0(uVar15);
  }
  puVar27 = local_218;
  FUN_1403b9440(param_1,iVar26,&DAT_140475be8,local_218);
  if (((puVar27 != (undefined *)0x0) && (puVar27 != PTR_DAT_1405d8010)) &&
     (puVar27 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_14034fe70();
    local_c8 = uVar15;
    FUN_14034ed40(uVar15);
    local_c0 = 1;
    piVar1 = (int *)(puVar27 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar27 + -8);
    }
    FUN_14034edd0(uVar15);
  }
  puVar20 = local_res18;
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar14 = local_res18 + -2, puVar14 != (uint *)0x0)) {
    uVar15 = FUN_14034fe70();
    local_b0 = uVar15;
    FUN_14034ed40(uVar15);
    local_a8 = 1;
    puVar20 = puVar20 + -1;
    *puVar20 = *puVar20 - 1;
    if (*puVar20 == 0) {
      FUN_14034ff60(puVar14);
    }
    FUN_14034edd0(uVar15);
  }
  if (((local_210 != (undefined *)0x0) && (local_210 != PTR_DAT_1405d8010)) &&
     (local_210 + -8 != (undefined *)0x0)) {
    uVar15 = FUN_14034fe70();
    local_90 = uVar15;
    FUN_14034ed40(uVar15);
    local_88 = 1;
    piVar1 = (int *)(local_210 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(local_210 + -8);
    }
    FUN_14034edd0(uVar15);
  }
LAB_1403c5b12:
  (**(code **)(*(longlong *)(param_1 + 0x1818) + 0x50))
            ((longlong *)(param_1 + 0x1818),1,&DAT_1405f2490);
  FUN_1403555d0(&local_118);
  FUN_1403555d0(&local_160);
  local_res8 = &local_188;
  FUN_140399690(&local_188);
  if (local_180 != 0) {
    if ((longlong)local_178 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_178 = local_178 & 0xffffffff00000000;
  }
  FUN_1403555d0(&local_1b0);
  FUN_140376ab0(&local_1b8);
  FUN_140376a30(&local_1c0);
  FUN_14012c7f0(local_1d0);
  return;
}



void FUN_1403c5bc0(longlong *param_1,undefined8 param_2)

{
  char cVar1;
  longlong lVar2;
  
  if (((double)param_1[699] != -1.0) && (cVar1 = FUN_14035a350(param_1 + 0x2b6), cVar1 == '\0')) {
    lVar2 = (**(code **)(*param_1 + 0x1c0))(param_1);
    param_1[699] = lVar2;
  }
  FUN_1403c1400(param_1 + -0xe);
  FUN_1403c5070(param_1 + -0xe,param_2);
  return;
}



void FUN_1403c5c30(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_14034fef0(0x60);
  puVar3 = puVar5;
  if (local_res20 != (undefined8 *)0x0) {
    puVar3 = (undefined8 *)FUN_14035bca0(local_res20);
  }
  if (puVar3 == (undefined8 *)0x0) {
    local_res20 = (undefined8 *)0x0;
    puVar4 = puVar5;
  }
  else {
    puVar4 = (undefined8 *)FUN_14034fef0(0x48);
    if (puVar4 != (undefined8 *)0x0) {
      local_res20 = puVar4;
      uVar2 = FUN_1403c0cc0();
      FUN_14034ec60(puVar4,uVar2,1);
    }
    local_res20 = puVar4;
    FUN_14034ed40(puVar4);
    puVar4[8] = 1;
    puVar4[7] = puVar3;
    FUN_14034edd0(puVar4);
  }
  FUN_14035bda0(local_120,&local_res20);
  if (puVar4 != (undefined8 *)0x0) {
    FUN_14034ed40(puVar4);
    plVar1 = puVar4 + 8;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_14034edd0(puVar4);
      FUN_14012c7d0(puVar4);
    }
    else {
      FUN_14034edd0(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_1403c0f30(param_1,local_128);
  FUN_1403555d0(&local_68);
  FUN_1403555d0(&local_b0);
  local_res20 = &local_d8;
  FUN_140399690(&local_d8);
  if (local_d0 != 0) {
    if ((longlong)local_c8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_c8 = local_c8 & 0xffffffff00000000;
  }
  FUN_1403555d0(&local_100);
  FUN_140376ab0(&local_108);
  FUN_140376a30(&local_110);
  FUN_14012c7f0(local_120);
  return;
}



longlong FUN_1403c5e60(void)

{
  void *pvVar1;
  longlong lVar2;
  
  pvVar1 = operator_new(0x1900);
  lVar2 = 0;
  if (pvVar1 != (void *)0x0) {
    lVar2 = FUN_1403c33e0(pvVar1);
  }
  if (lVar2 != 0) {
    lVar2 = lVar2 + 0x70;
  }
  return lVar2;
}



void FUN_1403c5ea0(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_1405d80f8 * 10.0 < dVar3 - *(double *)(lVar2 + 0x180)) {
      FUN_1403c51c0(param_1,0x1c);
    }
  }
  return;
}



void FUN_1403c5f20(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_14034ed40(uVar2);
    if (param_2 == 1) {
      FUN_1403ad4e0(param_1 + -0xe,0x1e);
    }
    else if (param_2 == 2) {
      FUN_1403c51c0(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_1403552c0(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_1403de1c0();
          (**(code **)(*plVar4 + 0x10))(plVar4);
        }
      }
    }
    FUN_14034edd0(uVar2);
  }
  return;
}



undefined8 FUN_1403c6090(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x20) + 0x58))();
  FUN_14034ed40(uVar1);
  FUN_1403c5ea0(*(undefined8 *)(param_1 + 0x20));
  FUN_14034edd0(uVar1);
  return 1;
}



undefined8 FUN_1403c60f0(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_1403c6170(LPCWSTR param_1)

{
  HANDLE hObject;
  
  SetErrorMode(2);
  hObject = CreateFileW(param_1,0x40000000,2,(LPSECURITY_ATTRIBUTES)0x0,2,0x80,(HANDLE)0x0);
  if (hObject != (HANDLE)0xffffffffffffffff) {
    uRam0000000000000000 = 1;
    CloseHandle(hObject);
  }
  return;
}



undefined8 * FUN_1403c61e0(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_14036d530(param_1 + 7);
  FUN_14034fe70();
  param_1[0x13] = PTR_DAT_1405d8010;
  *(undefined1 *)((longlong)param_1 + 0x91) = 0;
  *(undefined1 *)((longlong)param_1 + 0x34) = 1;
  *(undefined4 *)(param_1 + 6) = 0;
  *(undefined4 *)(param_1 + 3) = DAT_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x1c) = DAT_1405d83d4;
  *(undefined4 *)(param_1 + 1) = *(undefined4 *)(param_1 + 3);
  *(undefined2 *)((longlong)param_1 + 0xc) = *(undefined2 *)((longlong)param_1 + 0x1c);
  *(undefined4 *)(param_1 + 5) = DAT_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x2c) = DAT_1405d83d4;
  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_1403c62d0(double *param_1,double param_2,double param_3)

{
  int iVar1;
  ulonglong in_RAX;
  
  if (DAT_1405f064c != '\0') {
    if (*param_1 == 0.0) {
      *param_1 = param_2;
    }
    else if (DAT_1405d814c <= *(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_1403c6310(longlong param_1,int param_2)

{
  *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + param_2;
  return;
}



void FUN_1403c6320(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_1403c6340(undefined8 *param_1)

{
  *param_1 = 0;
  *(undefined4 *)(param_1 + 1) = 0;
  return param_1;
}



undefined8 FUN_1403c6350(double *param_1,double param_2)

{
  if (*param_1 == 0.0) {
    *param_1 = param_2;
  }
  return 0x6400000;
}



undefined1 FUN_1403c6370(longlong param_1,double param_2)

{
  if (DAT_1405d8180 * 3.0 < param_2 - *(double *)(param_1 + 0x18)) {
    return 1;
  }
  return 0;
}



void FUN_1403c63a0(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_1405d814c) {
    *param_1 = (double)DAT_1405d814c;
    return;
  }
  *param_1 = *param_1;
  return;
}



undefined8 * FUN_1403c6420(undefined8 *param_1)

{
  *param_1 = 0x41dffc2f6fc00000;
  return param_1;
}



void FUN_1403c6440(undefined8 *param_1,double param_2)

{
  if ((double)param_1[1] == 0.0) {
    param_1[1] = param_2;
  }
  if (DAT_1405d8180 * 3.0 < param_2 - (double)param_1[1]) {
    param_1[1] = param_2;
    *param_1 = 0;
  }
  return;
}



void FUN_1403c6490(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_1405d8180 * 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_1403c6500(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_1405d84f0 ^ (ulonglong)auStack_168;
  lVar4 = (longlong)param_2;
  if (param_3 == 0) {
    uVar3 = 0x10;
  }
  else {
    uVar3 = FUN_1403e4810(param_2);
    if ((int)uVar3 == 0) {
      if (param_1 - 0x40 < 0x3c1) {
        uVar3 = (**(code **)(lVar4 * 0x50 + 0x1405f3a10))(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_1403e47b0(local_148,iVar1,param_4);
          if (iVar2 == iVar1) {
            uVar3 = (**(code **)(lVar4 * 0x50 + 0x1405f3a18))(local_148,iVar1,param_3);
            if ((int)uVar3 == 0) {
              uVar3 = (**(code **)(lVar4 * 0x50 + 0x1405f3a20))(param_3);
            }
          }
          else {
            uVar3 = 9;
          }
        }
      }
      else {
        uVar3 = 8;
      }
    }
  }
  return uVar3;
}



int FUN_1403c6600(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_14060d280);
  iVar4 = 0;
  puVar5 = &DAT_1405f4400;
  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_14060d280);
        return iVar4;
      }
    }
    iVar4 = iVar4 + 1;
    puVar5 = puVar5 + 0x10;
    if (0x1f < iVar4) {
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
      return -1;
    }
  } while( true );
}



int FUN_1403c66a0(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_14060d2c0);
  iVar4 = 0;
  puVar5 = &DAT_1405f3a00;
  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_14060d2c0);
        return iVar4;
      }
    }
    iVar4 = iVar4 + 1;
    puVar5 = puVar5 + 10;
    if (0x1f < iVar4) {
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
      return -1;
    }
  } while( true );
}



undefined4 FUN_1403c6740(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_140466e10;
  do {
    if (param_1 == *piVar1) {
      return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar2 * 8);
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x140466e28);
  return 1;
}



int FUN_1403c6780(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_1403e4ac0();
  iVar4 = 0;
  piVar3 = &DAT_140466e10;
  do {
    if (iVar1 == *piVar3) {
      iVar5 = *(int *)(&DAT_140466e14 + (longlong)iVar4 * 8);
      if (iVar5 == 0) {
        return 0;
      }
      break;
    }
    piVar3 = piVar3 + 2;
    iVar4 = iVar4 + 1;
  } while ((longlong)piVar3 < 0x140466e28);
  free((void *)*param_1);
  return iVar5;
}



void FUN_1403c6820(void *param_1)

{
  if (param_1 != (void *)0x0) {
    FUN_1403e4b20();
    free(param_1);
  }
  return;
}



undefined4 FUN_1403c6850(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e4b80();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c68b0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e4bc0();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6910(longlong *param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  iVar1 = FUN_1403c6780();
  if (iVar1 != 0) {
    return 0xd;
  }
  if ((param_2 != 0) && (*param_1 != 0)) {
    iVar1 = FUN_1403e4bc0(param_2);
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c69b0(longlong param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (param_1 == 0) {
    return 0x10;
  }
  iVar1 = FUN_1403e4c50();
  iVar3 = 0;
  piVar2 = &DAT_140466e10;
  do {
    if (iVar1 == *piVar2) {
      return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
    }
    piVar2 = piVar2 + 2;
    iVar3 = iVar3 + 1;
  } while ((longlong)piVar2 < 0x140466e28);
  return 1;
}



ulonglong FUN_1403c6a60(longlong param_1,longlong param_2)

{
  int iVar1;
  
  if ((param_1 == 0) || (param_2 == 0)) {
    return 0x10;
  }
  iVar1 = FUN_1403e4d10();
  if (iVar1 == -1) {
    return 0xffffffff;
  }
  if (iVar1 != 0) {
    return (ulonglong)(iVar1 == 1);
  }
  return 0;
}



uint FUN_1403c6ab0(longlong param_1)

{
  int iVar1;
  
  if (param_1 == 0) {
    return 0x10;
  }
  iVar1 = FUN_1403e4d40();
  if (iVar1 != -1) {
    if (iVar1 != 0) {
      return (uint)(iVar1 == 1);
    }
    return 0;
  }
  return 0xffffffff;
}



undefined4 FUN_1403c6b10(longlong param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (param_1 == 0) {
    return 0x10;
  }
  iVar1 = FUN_1403e4e10();
  iVar3 = 0;
  piVar2 = &DAT_140466e10;
  do {
    if (iVar1 == *piVar2) {
      return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
    }
    piVar2 = piVar2 + 2;
    iVar3 = iVar3 + 1;
  } while ((longlong)piVar2 < 0x140466e28);
  return 1;
}



undefined4 FUN_1403c6b70(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e4e90();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6bd0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e4f90();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6c40(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e50c0();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6ca0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e5170();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6d00(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_1403e5200();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6d60(longlong param_1,undefined8 param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_3 != 0)) {
    iVar1 = FUN_1403e5280();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6dc0(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_1403e53c0();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6e20(longlong param_1,undefined8 param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_3 != 0)) {
    iVar1 = FUN_1403e5440();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6e80(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_1403e5580();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6ee0(longlong param_1,undefined8 param_2,longlong param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_3 != 0)) {
    iVar1 = FUN_1403e5630();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6f40(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e56f0();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c6fa0(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e5770();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c7000(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e5ca0();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



int FUN_1403c7060(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_1403e5d50(param_1,param_2,local_res8);
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        iVar1 = *(int *)(&DAT_140466e14 + (longlong)iVar3 * 8);
        if (iVar1 == 0) {
          *param_3 = local_res8[0];
          iVar1 = 0;
        }
        return iVar1;
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c70e0(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_1403e5d60();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c7140(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_1403e5f40();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined8 FUN_1403c71a0(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_1403e6010();
    uVar2 = FUN_1403c6740(uVar1);
    return uVar2;
  }
  return 0x10;
}



undefined4 FUN_1403c71e0(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_1403e6090();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c7240(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_1403e6100();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



int FUN_1403c72a0(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_1403e6130(param_1);
  iVar4 = 0;
  piVar3 = &DAT_140466e10;
  do {
    if (iVar1 == *piVar3) {
      iVar5 = *(int *)(&DAT_140466e14 + (longlong)iVar4 * 8);
      if (iVar5 == 0) {
        return 0;
      }
      break;
    }
    piVar3 = piVar3 + 2;
    iVar4 = iVar4 + 1;
  } while ((longlong)piVar3 < 0x140466e28);
  free((void *)*param_2);
  return iVar5;
}



undefined4 FUN_1403c7360(longlong param_1,longlong param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if ((param_1 != 0) && (param_2 != 0)) {
    iVar1 = FUN_1403e6190();
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined4 FUN_1403c73c0(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_1403e6260(param_1,param_2,*param_3);
    iVar3 = 0;
    piVar2 = &DAT_140466e10;
    do {
      if (iVar1 == *piVar2) {
        return *(undefined4 *)(&DAT_140466e14 + (longlong)iVar3 * 8);
      }
      piVar2 = piVar2 + 2;
      iVar3 = iVar3 + 1;
    } while ((longlong)piVar2 < 0x140466e28);
    return 1;
  }
  return 0x10;
}



undefined8 FUN_1403c7430(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_1403e63d0();
    uVar2 = FUN_1403c6740(uVar1);
    return uVar2;
  }
  return 0x10;
}



undefined4 FUN_1403c7470(longlong param_1,uint *param_2)

{
  undefined4 uVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  
  if ((param_1 != 0) && (param_2 != (uint *)0x0)) {
    iVar2 = FUN_1403e6530(param_1,8);
    iVar4 = 0;
    piVar3 = &DAT_140466e10;
    do {
      if (iVar2 == *piVar3) {
        uVar1 = *(undefined4 *)(&DAT_140466e14 + (longlong)iVar4 * 8);
        *param_2 = (uint)(*param_2 == 1);
        return uVar1;
      }
      piVar3 = piVar3 + 2;
      iVar4 = iVar4 + 1;
    } while ((longlong)piVar3 < 0x140466e28);
    *param_2 = (uint)(*param_2 == 1);
    return 1;
  }
  return 0x10;
}



int FUN_1403c74f0(void *param_1)

{
  int iVar1;
  longlong *plVar2;
  int iVar3;
  int iVar4;
  
  if (param_1 == (void *)0x0) {
    return 0x10;
  }
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
  iVar4 = 0;
  iVar3 = 0;
  do {
    iVar1 = memcmp(&DAT_1405f4400 + (longlong)iVar3 * 0x10,param_1,0x80);
    if (iVar1 == 0) {
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
      return iVar3;
    }
    iVar3 = iVar3 + 1;
  } while (iVar3 < 0x20);
  plVar2 = &DAT_1405f4400;
  do {
    if (*plVar2 == 0) {
      memcpy(&DAT_1405f4400 + (longlong)iVar4 * 0x10,param_1,0x80);
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
      return iVar4;
    }
    plVar2 = plVar2 + 0x10;
    iVar4 = iVar4 + 1;
  } while ((longlong)plVar2 < 0x1405f5400);
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
  return -1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403c75d0(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_1405d84f0 ^ (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_1403c7ae0(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_1403c75d0(param_1,param_1 + 4);
          if ((int)uVar1 != 0) {
            return uVar1;
          }
          *param_1 = *param_1 + 0x200;
          *(undefined4 *)((longlong)param_1 + 0x1c) = 0;
        }
      }
      uVar1 = FUN_1403c75d0(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_1403c7bc0(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_1403c75d0(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_1403c75d0(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_1403c7d50(void *param_1)

{
  int iVar1;
  longlong *plVar2;
  int iVar3;
  int iVar4;
  
  if (param_1 == (void *)0x0) {
    return 0x10;
  }
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
  iVar4 = 0;
  iVar3 = 0;
  do {
    iVar1 = memcmp(&DAT_1405f3a00 + (longlong)iVar3 * 10,param_1,0x50);
    if (iVar1 == 0) {
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
      return iVar3;
    }
    iVar3 = iVar3 + 1;
  } while (iVar3 < 0x20);
  plVar2 = &DAT_1405f3a00;
  do {
    if (*plVar2 == 0) {
      memcpy(&DAT_1405f3a00 + (longlong)iVar4 * 10,param_1,0x50);
      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
      return iVar4;
    }
    plVar2 = plVar2 + 10;
    iVar4 = iVar4 + 1;
  } while ((longlong)plVar2 < 0x1405f4400);
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
  return -1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1403c7e40(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_1405d84f0 ^ (ulonglong)auStack_138;
  *(longlong *)(param_1 + 0x1028) = *(longlong *)(param_1 + 0x1028) + 1;
  FUN_1403e93f0(local_118);
  uVar1 = FUN_1403e9440(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_1403e9520(lVar5,local_a8);
      if ((uVar1 != 0) ||
         ((uVar1 = FUN_1403e9440(local_118,local_a8,0x20), uVar1 != 0 ||
          (uVar1 = FUN_1403e93f0(lVar5), uVar1 != 0)))) {
        FUN_1403e9520(local_118,local_a8);
        return (ulonglong)uVar1;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 < 0x20);
    uVar2 = FUN_1403e9520(local_118,param_1 + 0xfe8);
    if (((int)uVar2 == 0) &&
       (uVar2 = FUN_1403e6650(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_1403e9520(local_118,local_a8);
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1403c7fd0(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_1405d84f0 ^ (ulonglong)auStack_b8;
  if (param_1 == 0) {
    iVar1 = 0x10;
  }
  else {
    uVar3 = 0;
    do {
      iVar2 = (int)uVar3;
      iVar1 = FUN_1403e93f0((longlong)iVar2 * 0x70 + param_1);
      if (iVar1 != 0) {
        if (iVar2 < 1) {
          return iVar1;
        }
        do {
          FUN_1403e9520(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_1403e96f0(param_1 + 0xfe8,0x20);
    iVar1 = FUN_1403e6650(param_1 + 0xfe8,0x20,0,param_1 + 0xe00);
    if (iVar1 == 0) {
      FUN_1403e96f0(param_1 + 0x1008,0x10);
      InitializeCriticalSection((LPCRITICAL_SECTION)(param_1 + 0x1030));
      iVar1 = 0;
    }
    else {
      do {
        FUN_1403e9520(param_1,local_98);
        param_1 = param_1 + 0x70;
        lVar4 = lVar4 + -1;
      } while (lVar4 != 0);
    }
  }
  return iVar1;
}



int FUN_1403c8120(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_1403e9440((ulonglong)*(uint *)(param_3 + 0x1018) * 0x70 + param_3,&local_res8,2);
    if (iVar1 == 0) {
      iVar1 = FUN_1403e9440((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_1403c8250(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_1405d84f0 ^ (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_1403c7e40(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_1403e6df0(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_1403e6df0(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_1403e6df0(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_1403e6df0(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_1403e6650(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_1403c8460(longlong param_1)

{
  int iVar1;
  int iVar2;
  undefined1 auStack_58 [32];
  undefined1 local_38 [32];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  if (param_1 == 0) {
    return 0x10;
  }
  EnterCriticalSection((LPCRITICAL_SECTION)(param_1 + 0x1030));
  iVar2 = 0;
  do {
    iVar1 = FUN_1403e9520((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_1403c8520(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_1403e9520(_Dst,lVar3);
      if (iVar1 != 0) goto LAB_1403c8642;
      iVar1 = FUN_1403e93f0(_Dst);
      if (iVar1 != 0) goto LAB_1403c8642;
      iVar1 = FUN_1403e9440(_Dst,lVar3,0x20);
      if (iVar1 != 0) goto LAB_1403c8642;
      iVar1 = FUN_1403e9520(_Dst,lVar3);
      if (iVar1 != 0) goto LAB_1403c8642;
      iVar2 = iVar2 + 0x20;
      param_3 = (void *)((longlong)param_3 + 0x70);
    } while (iVar2 < 0x400);
    *param_2 = 0x400;
LAB_1403c8642:
    free(_Dst);
    LeaveCriticalSection(lpCriticalSection);
  }
  return iVar1;
}



undefined8 FUN_1403c8680(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_1403c7fd0(param_3);
    if ((int)uVar1 == 0) {
      iVar2 = 0;
      do {
        uVar1 = FUN_1403c8120(iVar2 + param_1,0x20,param_3);
        if ((int)uVar1 != 0) {
          return uVar1;
        }
        iVar2 = iVar2 + 0x20;
      } while (iVar2 < 0x400);
    }
    return uVar1;
  }
  return 0x10;
}



void FUN_1403c8710(longlong param_1)

{
  if (param_1 != 0) {
    FUN_1403e97a0(*(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_1403c8760(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_1405d84f0 ^ (ulonglong)auStack_2a8;
  if (((param_1 == 0) || (param_3 == (undefined4 *)0x0)) || (DAT_14060d300 == 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_1403e9710(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_1403e9930(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_1403e97f0(_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_1403e97f0(param_1,param_2,2,1);
          puVar4 = local_1a8;
          if (uVar5 == 0) {
            iVar1 = (*DAT_14060d360)(*(undefined8 *)(param_3 + 6),0);
            if (iVar1 == 0) {
              uVar5 = (*DAT_14060d310)(&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_1403e97f0(param_1,param_2,2,1);
                if (uVar5 == 0) {
                  (*DAT_14060d320)(local_1a0);
                  *param_3 = 1;
                  return 0;
                }
                (*DAT_14060d320)();
                puVar4 = (undefined8 *)(param_3 + 10);
              }
            }
            else {
              iVar1 = (*DAT_14060d360)(*(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_1403e97f0(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_1403e97a0(*local_190,*(undefined8 *)(param_3 + 2),*(undefined8 *)(param_3 + 6),*local_178)
      ;
      uVar2 = (ulonglong)uVar5;
    }
  }
  return uVar2;
}



undefined8 FUN_1403c8c40(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_1403e9e70(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_1403e9e70(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_1403c8df0(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_14060d300 == 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_1403e4810(param_2);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar5 = FUN_1403e9710(&local_48,&local_40,&local_58,&local_50,local_38,0);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar3 = (*DAT_14060d338)(local_38[0],param_4);
  uVar5 = (ulonglong)uVar3;
  if (uVar3 == 0) {
    do {
      uVar3 = FUN_1403e9fd0(local_48,param_3 / 2,param_1,param_2);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403c9122;
      uVar3 = (*DAT_14060d3c0)(local_48,1,local_58);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403c9122;
      uVar3 = (*DAT_14060d3f8)(local_58,local_38[0],local_50);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403c9122;
      iVar4 = (*DAT_14060d360)(local_50,1);
    } while (iVar4 != 0);
    do {
      uVar3 = FUN_1403e9fd0(local_40,param_3 / 2,param_1,param_2);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403c9122;
      uVar3 = (*DAT_14060d3c0)(local_40,1,local_58);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403c9122;
      uVar3 = (*DAT_14060d3f8)(local_58,local_38[0],local_50);
      uVar5 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403c9122;
      iVar4 = (*DAT_14060d360)(local_50,1);
    } while (iVar4 != 0);
    uVar3 = (*DAT_14060d3c0)(local_48,1,local_50);
    uVar5 = (ulonglong)uVar3;
    if (uVar3 == 0) {
      uVar3 = (*DAT_14060d400)(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_1403e9710(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_14060d338)(*(undefined8 *)(param_5 + 2),param_4);
          uVar5 = (ulonglong)uVar3;
          if (uVar3 == 0) {
            uVar3 = (*DAT_14060d418)(*(undefined8 *)(param_5 + 2),local_58,
                                     *(undefined8 *)(param_5 + 4));
            uVar5 = (ulonglong)uVar3;
            if (uVar3 == 0) {
              uVar3 = (*DAT_14060d3c8)(local_48,local_40,*(undefined8 *)(param_5 + 6));
              uVar5 = (ulonglong)uVar3;
              if (uVar3 == 0) {
                uVar3 = (*DAT_14060d3c0)(local_48,1,local_58);
                uVar5 = (ulonglong)uVar3;
                if (uVar3 == 0) {
                  uVar3 = (*DAT_14060d3c0)(local_40,1,local_50);
                  uVar5 = (ulonglong)uVar3;
                  if (uVar3 == 0) {
                    uVar3 = (*DAT_14060d3e0)(*(undefined8 *)(param_5 + 4),local_58,0,
                                             *(undefined8 *)(param_5 + 0xe));
                    uVar5 = (ulonglong)uVar3;
                    if (uVar3 == 0) {
                      uVar3 = (*DAT_14060d3e0)(*(undefined8 *)(param_5 + 4),local_50,0,
                                               *(undefined8 *)(param_5 + 0x10));
                      uVar5 = (ulonglong)uVar3;
                      if (uVar3 == 0) {
                        uVar3 = (*DAT_14060d418)(local_40,local_48,*(undefined8 *)(param_5 + 0xc));
                        uVar5 = (ulonglong)uVar3;
                        if (uVar3 == 0) {
                          uVar3 = (*DAT_14060d330)(local_48,*puVar2);
                          uVar5 = (ulonglong)uVar3;
                          if (uVar3 == 0) {
                            uVar3 = (*DAT_14060d330)(local_40,*puVar1);
                            uVar5 = (ulonglong)uVar3;
                            if (uVar3 == 0) {
                              *param_5 = 1;
                              goto LAB_1403c9164;
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
LAB_1403c9122:
  puVar7 = *(undefined8 **)(param_5 + 10);
  uVar8 = 0;
  puVar6 = *(undefined8 **)(param_5 + 8);
  FUN_1403e97a0(*(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_1403c9164:
  FUN_1403e97a0(local_38[0],local_50,local_58,local_48,local_40,0,puVar6,puVar7,uVar8);
  return uVar5;
}



undefined8
FUN_1403c91d0(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_1403e4810(param_8);
        if (((int)uVar4 == 0) &&
           ((param_10 != 2 || (uVar4 = FUN_1403ea690(param_9), (int)uVar4 == 0)))) {
          uVar1 = (*DAT_14060d368)(*(undefined8 *)(param_11 + 0x18));
          uVar2 = (*DAT_14060d390)(*(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_1403ea300(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_1403ea130(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_14060d480)(param_3,local_res8[0],param_3,param_4,
                                       uVar5 & 0xffffffff00000000,param_11);
            }
          }
        }
      }
      else {
        uVar4 = 0x18;
      }
      return uVar4;
    }
    return 0x10;
  }
  return 0x10;
}



ulonglong FUN_1403c9390(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_1403ea690(param_7);
      if ((int)uVar3 != 0) {
        return uVar3;
      }
    }
    uVar1 = (*DAT_14060d368)(*(undefined8 *)(param_10 + 0x18));
    uVar2 = (*DAT_14060d390)(*(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_14060d480)(param_1,param_2,_Memory,local_res18,CONCAT44(uVar4,1),param_10);
        uVar3 = (ulonglong)uVar2;
        if (uVar2 == 0) {
          if (param_8 == 2) {
            uVar2 = FUN_1403ea820(_Memory,local_res18[0],param_5,param_6,uVar1,param_7,param_3,
                                  param_4,param_9);
          }
          else {
            uVar2 = FUN_1403ea6f0(_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_1403c9570(undefined4 *param_1)

{
  FUN_14036d530(param_1 + 2);
  *param_1 = 0;
  return param_1;
}



uint FUN_1403c95a0(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_1403c98b0(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_1403c9930(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_1403c9a10(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_1403c95a0(*(undefined4 *)((longlong)param_1 + 0x4c),*param_1,uVar3);
  }
  else {
    if (*(int *)(param_1[5] + 0x2c) != 2) goto LAB_1403c9a83;
    uVar2 = FUN_1403a8500(*(undefined4 *)((longlong)param_1 + 0x4c),*param_1,uVar3);
  }
  *(undefined4 *)((longlong)param_1 + 0x4c) = uVar2;
LAB_1403c9a83:
  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_1403c9ab0(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_1403c9c60(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_1403c9a10(*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_1403c9e20(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_1403c9c60(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_1403ce070(param_1,lVar6,*(int *)((longlong)param_1 + 0x94) - uVar3,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403c98b0(*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_1403ce070(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_1403ce070(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_1403ca0a0(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_1403c9c60(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_1403ce070(param_1,lVar7,*(int *)((longlong)param_1 + 0x94) - uVar10,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403c98b0(*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_1403c9ab0(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_1403ca37c:
      *(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_140468380)[bVar5] * 4 + 0x4c0);
      *psVar3 = *psVar3 + 1;
      if (uVar9 < 0x100) {
        bVar5 = (&DAT_140468180)[uVar9];
      }
      else {
        bVar5 = (&DAT_140468280)[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_1403ca37c;
      }
      *(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_1403ce070(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_1403ca4c0(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_1403c9c60(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_1403ce070(param_1,uVar11,*(int *)((longlong)param_1 + 0x94) - uVar14,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403c98b0(*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_1403c9ab0(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_1403ce070(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_140468380)[bVar9] * 4 + 0x4c0);
      *psVar3 = *psVar3 + 1;
      if (uVar13 < 0x100) {
        bVar9 = (&DAT_140468180)[uVar13];
      }
      else {
        bVar9 = (&DAT_140468280)[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_1403ce070(param_1,uVar10,*(int *)((longlong)param_1 + 0x94) - uVar14,0);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403c98b0(*param_1);
        if (*(int *)(*param_1 + 0x18) == 0) {
          return 0;
        }
      }
    }
  } while( true );
}



undefined4 FUN_1403caa10(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_1403c9c60(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_1403ce070(param_1,lVar13,*(int *)((longlong)param_1 + 0x94) - uVar14,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403c98b0(*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_140468380)[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_1403ce070(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_1403cad90(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_1403c9c60(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_1403ce070(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_1403ce070(param_1,lVar6,*(int *)((longlong)param_1 + 0x94) - uVar7,param_2 == 4);
  *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
  FUN_1403c98b0(*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_1403caf70(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_1403a8500(0,0,0);
    }
    else {
      uVar3 = 1;
    }
    *(undefined4 *)(param_1 + 0x4c) = uVar3;
    *(undefined4 *)(lVar2 + 0x40) = 0;
    FUN_1403cd9b0(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_1404670e2 + lVar4 * 0x10);
    *(uint *)(lVar2 + 0xb4) = (uint)*(ushort *)(&DAT_1404670e0 + lVar4 * 0x10);
    *(uint *)(lVar2 + 0xb8) = (uint)*(ushort *)(&DAT_1404670e4 + lVar4 * 0x10);
    uVar1 = *(ushort *)(&DAT_1404670e6 + 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_1403cb0e0(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_1403a8500(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_1403a8500(*(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_1403a8500(*(undefined4 *)((longlong)param_1 + 0x4c),
                                    (ulonglong)uVar12 + puVar4[2],uVar9 - uVar12);
              *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
            }
            FUN_1403c98b0(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_1403a8500(*(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_1403cb570;
      *(undefined4 *)(puVar4 + 7) = 0;
    }
    *(undefined4 *)(puVar4 + 1) = 0x49;
  }
LAB_1403cb570:
  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_1403a8500(*(undefined4 *)((longlong)param_1 + 0x4c),uVar11 + puVar4[2],
                                  uVar12 - (uint)uVar11);
            *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
          }
          FUN_1403c98b0(param_1);
          uVar11 = (ulonglong)*(uint *)(puVar4 + 5);
          uVar14 = uVar11;
          if (*(uint *)(puVar4 + 5) == *(uint *)(puVar4 + 3)) {
            bVar6 = true;
            goto LAB_1403cb600;
          }
        }
        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_1403cb600:
      if (*(int *)(puVar4[6] + 0x3c) != 0) {
        if ((uint)uVar11 < *(uint *)(puVar4 + 5)) {
          uVar7 = FUN_1403a8500(*(undefined4 *)((longlong)param_1 + 0x4c),uVar11 + puVar4[2],
                                *(uint *)(puVar4 + 5) - (uint)uVar11);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
        }
      }
      if (bVar6) goto LAB_1403cb634;
      *(undefined4 *)(puVar4 + 7) = 0;
    }
    *(undefined4 *)(puVar4 + 1) = 0x5b;
  }
LAB_1403cb634:
  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_1403a8500(*(undefined4 *)((longlong)param_1 + 0x4c),uVar11 + puVar4[2],
                                  uVar12 - (uint)uVar11);
            *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
          }
          FUN_1403c98b0(param_1);
          uVar11 = (ulonglong)*(uint *)(puVar4 + 5);
          uVar14 = uVar11;
          if (*(uint *)(puVar4 + 5) == *(uint *)(puVar4 + 3)) {
            bVar6 = true;
            goto LAB_1403cb6c0;
          }
        }
        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_1403cb6c0:
      if (*(int *)(puVar4[6] + 0x3c) != 0) {
        if ((uint)uVar11 < *(uint *)(puVar4 + 5)) {
          uVar7 = FUN_1403a8500(*(undefined4 *)((longlong)param_1 + 0x4c),uVar11 + puVar4[2],
                                *(uint *)(puVar4 + 5) - (uint)uVar11);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
        }
      }
      if (bVar6) goto LAB_1403cb6f0;
    }
    *(undefined4 *)(puVar4 + 1) = 0x67;
  }
LAB_1403cb6f0:
  if (*(int *)(puVar4 + 1) == 0x67) {
    if (*(int *)(puVar4[6] + 0x3c) != 0) {
      if (*(uint *)(puVar4 + 3) < *(int *)(puVar4 + 5) + 2U) {
        FUN_1403c98b0(param_1);
      }
      if (*(uint *)(puVar4 + 3) < *(uint *)(puVar4 + 5) + 2) goto LAB_1403cb75a;
      *(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_1403a8500(0,0,0);
      *(undefined4 *)((longlong)param_1 + 0x4c) = uVar7;
    }
    *(undefined4 *)(puVar4 + 1) = 0x71;
  }
LAB_1403cb75a:
  if (*(int *)(puVar4 + 5) == 0) {
    if ((((int)param_1[1] == 0) && ((int)param_2 <= iVar8)) && (param_2 != 4)) goto LAB_1403cb7a9;
LAB_1403cb799:
    if (*(int *)(puVar4 + 1) == 0x29a) {
      if ((int)param_1[1] != 0) {
LAB_1403cb7a9:
        param_1[4] = (longlong)"buffer error";
        return 0xfffffffb;
      }
LAB_1403cb7c1:
      if ((*(int *)((longlong)puVar4 + 0x9c) != 0) ||
         ((param_2 != 0 && (*(int *)(puVar4 + 1) != 0x29a)))) goto LAB_1403cb7dd;
    }
    else {
      if ((int)param_1[1] == 0) goto LAB_1403cb7c1;
LAB_1403cb7dd:
      if (*(int *)(puVar4 + 0x16) == 2) {
        iVar8 = FUN_1403cad90();
      }
      else if (*(int *)(puVar4 + 0x16) == 3) {
        iVar8 = FUN_1403caa10();
      }
      else {
        iVar8 = (*(code *)(&PTR_FUN_1404670e8)[(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_1403cb76e;
      }
      if (iVar8 == 1) {
        if (param_2 == 1) {
          FUN_1403cde50(puVar4);
        }
        else if ((param_2 != 5) && (FUN_1403cddb0(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_1403c98b0(param_1);
        if ((int)param_1[3] == 0) goto LAB_1403cb76e;
      }
    }
    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_1403c98b0(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_1403c98b0(param_1);
    if ((int)param_1[3] != 0) goto LAB_1403cb799;
LAB_1403cb76e:
    *(undefined4 *)(puVar4 + 8) = 0xffffffff;
  }
  return 0;
}



undefined8
FUN_1403cba00(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_1403cbcd0;
  }
  pcVar3 = *(code **)(param_1 + 0x38);
  if (pcVar3 == (code *)0x0) {
    pcVar3 = FUN_1403cbce0;
  }
  *(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_1403caf70(param_1);
        return uVar6;
      }
      *(undefined4 *)(plVar4 + 1) = 0x29a;
      *(char **)(param_1 + 0x20) = "insufficient memory";
      FUN_1403c9930(param_1);
    }
    uVar6 = 0xfffffffc;
  }
  else {
    uVar6 = 0xfffffffe;
  }
  return uVar6;
}



void FUN_1403cbc90(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4)

{
  FUN_1403cba00(param_1,param_2,8,0xf,8,0,param_3,param_4);
  return;
}



void FUN_1403cbcd0(undefined8 param_1,int param_2,int param_3)

{
                    // WARNING: Could not recover jumptable at 0x0001403cbcd6. Too many branches
                    // WARNING: Treating indirect jump as call
  malloc((ulonglong)(uint)(param_2 * param_3));
  return;
}



void FUN_1403cbce0(undefined8 param_1,void *param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001403cbce3. Too many branches
                    // WARNING: Treating indirect jump as call
  free(param_2);
  return;
}



void FUN_1403cbcf0(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_1403cbda0:
  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_r0x0001403cbead;
    }
    if ((uVar12 & 0x40) != 0) {
      if ((uVar12 & 0x20) == 0) {
        param_1[4] = (longlong)"invalid literal/length code";
        *puVar6 = 0x1d;
      }
      else {
        *puVar6 = 0xb;
      }
      goto LAB_1403cc175;
    }
    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_1403cc0f7;
joined_r0x0001403cbead:
  pbVar15 = pbVar16;
  if ((uVar12 & 0x10) != 0) goto LAB_1403cbef2;
  if ((uVar12 & 0x40) != 0) {
    param_1[4] = (longlong)"invalid distance code";
    *puVar6 = 0x1d;
    goto LAB_1403cc175;
  }
  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_r0x0001403cbead;
LAB_1403cbef2:
  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_1403cc0f7;
  }
  uVar12 = uVar10 - uVar12;
  if ((uVar4 < uVar12) && (puVar6[0x6f6] != 0)) {
    param_1[4] = (longlong)"invalid distance too far back";
    *puVar6 = 0x1d;
LAB_1403cc175:
    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_1403cc022:
      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_1403cc022;
      }
    }
  }
  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_1403cc022;
    }
  }
  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_1403cc0f7:
  if ((pbVar27 <= pbVar15) || (puVar20 = puVar19, puVar18 + ((int)lVar9 - 0x101) <= puVar19))
  goto LAB_1403cc175;
  goto LAB_1403cbda0;
}



void FUN_1403cc1e0(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_1403cc260(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_1403cc350(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_1403cc570(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_1403cc660(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_1403ccb6e:
                *(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_1403ccb6e;
              }
              *(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_1403ccb6e;
            }
            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_1403ccbd0(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_140467c60;
    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_1403cc660(param_1,param_1 + 0xbc,param_2 + -1);
  FUN_1403cc660(param_1,param_1 + 0x9b0,param_3 + -1);
  return;
}



void FUN_1403cce40(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_1403cd1c7:
        *(int *)(param_1 + 0x1714) = iVar3;
      }
      else {
        bVar2 = (&DAT_140468380)[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_140467b10 + (ulonglong)bVar2 * 4);
        if (iVar4 != 0) {
          uVar12 = (ushort)bVar1 - (short)*(undefined4 *)(&DAT_140468480 + (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_140468180)[uVar11];
        }
        else {
          bVar1 = (&DAT_140468180)[(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_140467b90 + uVar6 * 4);
        if (iVar3 != 0) {
          uVar10 = (short)uVar11 - (short)*(undefined4 *)(&DAT_140468500 + 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_1403cd1c7;
        }
      }
    } 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_1403cd2b0(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_1403cd330(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_1403cd3c0(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_1403cd41a;
    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_1403cd41a:
  *(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_1403cd4d0(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_1405d84f0 ^ (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_1403cd97c;
      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_1404683a6;
        local_a8 = &DAT_1404683e6;
      }
      else {
        iVar15 = -1;
        local_b0 = &DAT_140468630;
        local_a8 = &DAT_140468670;
      }
      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_1403cd740:
          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_r0x0001403cd90c;
                }
                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_1403cd8ae:
            if (!bVar23) goto LAB_1403cd71a;
          }
          else if (param_1 == 2) {
            bVar23 = local_cc < 0x250;
            goto LAB_1403cd8ae;
          }
          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_1403cd740;
        }
      }
      else if ((param_1 != 2) || (uVar16 = 0, uVar10 = 0, uVar11 = 0, local_cc < 0x250))
      goto LAB_1403cd740;
LAB_1403cd71a:
      uVar7 = 1;
    }
    else {
LAB_1403cd97c:
      uVar7 = 0xffffffff;
    }
  }
  return uVar7;
joined_r0x0001403cd90c:
  if (uVar13 == 0) {
LAB_1403cd968:
    *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_1403cd968;
  uVar13 = (uVar20 & uVar13 - 1) + uVar13;
  uVar16 = (ulonglong)uVar13;
  goto joined_r0x0001403cd90c;
}



void FUN_1403cd9b0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x170c) = 8;
  *(longlong *)(param_1 + 0xb40) = param_1 + 0xbc;
  *(undefined ***)(param_1 + 0xb50) = &PTR_DAT_1405d9de0;
  *(longlong *)(param_1 + 0xb58) = param_1 + 0x9b0;
  *(undefined ***)(param_1 + 0xb68) = &PTR_DAT_1405d9e00;
  *(longlong *)(param_1 + 0xb70) = param_1 + 0xaa4;
  *(undefined **)(param_1 + 0xb80) = &DAT_1405d9e20;
  *(undefined2 *)(param_1 + 0x1710) = 0;
  *(undefined4 *)(param_1 + 0x1714) = 0;
  FUN_1403cc1e0();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie
// WARNING: Type propagation algorithm not settling

void FUN_1403cda30(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_1405d84f0 ^ (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_1403cdae0(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_1403cc260(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_1403cc260(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_1403cc260(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_1403cc350();
  FUN_1403cda30(lVar2,iVar7,param_1 + 0xb88);
  return;
}



int FUN_1403cdd30(longlong param_1)

{
  longlong lVar1;
  int iVar2;
  
  FUN_1403cc570(param_1,param_1 + 0xbc,*(undefined4 *)(param_1 + 0xb48));
  FUN_1403cc570();
  FUN_1403cdae0();
  iVar2 = 0x12;
  lVar1 = 0x12;
  do {
    if (*(short *)(param_1 + 0xaa6 + (ulonglong)(byte)(&DAT_140467c60)[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_1403cddb0(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_1403cd3c0(param_1,param_2,param_3,1);
  return;
}



void FUN_1403cde50(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_1403cd330(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_1403cd330(param_1);
  }
  *(undefined4 *)(param_1 + 0x170c) = 7;
  return;
}



void FUN_1403ce070(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_1403ce103:
    uVar6 = uVar7;
    uVar7 = uVar6;
  }
  else {
    lVar10 = *param_1;
    if (*(int *)(lVar10 + 0x48) == 2) {
      uVar3 = FUN_1403cd2b0();
      *(undefined4 *)(lVar10 + 0x48) = uVar3;
    }
    FUN_1403cdae0(param_1,param_1 + 0x168);
    FUN_1403cdae0(param_1,param_1 + 0x16b);
    iVar4 = FUN_1403cdd30(param_1);
    uVar6 = (int)param_1[0x2e0] + 10U >> 3;
    uVar7 = *(int *)((longlong)param_1 + 0x1704) + 10U >> 3;
    if (uVar7 <= uVar6) goto LAB_1403ce103;
  }
  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_140468100;
      puVar8 = &DAT_140467c80;
    }
    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_1403ccbd0(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_1403cce40(param_1,puVar8,plVar9);
  }
  else {
    FUN_1403cddb0(param_1,param_2,param_3,param_4);
  }
  FUN_1403cc1e0(param_1);
  if (param_4 == 0) {
    return;
  }
  if (*(int *)((longlong)param_1 + 0x1714) < 9) {
    if (*(int *)((longlong)param_1 + 0x1714) < 1) goto LAB_1403ce2c0;
    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_1403ce2c0:
  *(undefined2 *)(param_1 + 0x2e2) = 0;
  *(undefined4 *)((longlong)param_1 + 0x1714) = 0;
  return;
}



void FUN_1403ce2f0(undefined8 *param_1)

{
  *param_1 = Proud::ISendSpeedMeasurerDg::vftable;
  return;
}



undefined8 * FUN_1403ce300(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_1403ce330(longlong param_1,undefined8 param_2)

{
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x108) + 0x78);
  FUN_1403df450(*(undefined8 *)(param_1 + 0x108),param_2);
  return;
}



void FUN_1403ce370(longlong param_1,undefined8 param_2)

{
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x108) + 0x78);
  FUN_1403dfbf0(*(undefined8 *)(param_1 + 0x108),param_2);
  return;
}



void FUN_1403ce3b0(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_1403ce410(longlong *param_1,longlong *param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 local_58 [88];
  
  if ((longlong *)param_2[2] != param_1) {
    FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                  L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    param_1[1] = lVar2;
  }
  if (lVar2 == 0) {
    if ((longlong *)*param_1 != param_2) {
      FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                    L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
    }
    *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_1403ce4f0(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_1400902d0(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_1403ce570(longlong param_1)

{
  undefined8 uVar1;
  
  FUN_1403c42b0(*(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_1403ce5e0(longlong param_1)

{
  undefined8 uVar1;
  
  FUN_1403c42b0(*(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_1403ce650(longlong param_1)

{
  undefined8 uVar1;
  
  FUN_1403c42b0(*(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_1403ce6c0(longlong param_1,longlong param_2,longlong param_3)

{
  longlong *plVar1;
  undefined8 uVar2;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
  FUN_14034ed40(uVar2);
  *(undefined1 *)(param_2 + 0x80) = 0;
  if ((*(longlong **)(param_2 + 0x100) != (longlong *)0x0) &&
     (**(longlong **)(param_2 + 0x100) != 0)) {
    FUN_140356dc0();
  }
  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_1403e1ab0(param_2);
  FUN_14034edd0(uVar2);
  return;
}



void FUN_1403ce780(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
  uVar2 = 0;
  if (*(undefined8 **)(lVar1 + 0x128) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(lVar1 + 0x128);
  }
  FUN_140354aa0(uVar2,1);
  lVar1 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
  uVar2 = 0;
  if (*(undefined8 **)(lVar1 + 0x128) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(lVar1 + 0x128);
  }
  FUN_1403549b0(uVar2,1);
  FUN_1403c42b0(*(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_1403ce840(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_14034ed40(uVar2);
  uVar6 = 1;
  uVar3 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
  iVar1 = FUN_1403dd730(uVar3);
  if ((iVar1 != 0) &&
     (uVar2 = uVar4,
     FUN_1403c42b0(*(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_14034edd0(uVar2);
  return;
}



void FUN_1403ce900(longlong param_1)

{
  undefined8 uVar1;
  
  FUN_1403aaf80(*(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_1403ce840(param_1);
  FUN_1403bb820(*(undefined8 *)(param_1 + 0x108));
  return;
}



undefined8 FUN_1403ce970(longlong param_1)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(char *)(param_1 + 0x1c0) == '\0') {
    FUN_14034ed40();
    FUN_14034ed40();
    if (*(char *)(param_1 + 0x1c0) == '\0') {
      cVar1 = FUN_14035a350(param_1 + 0x48);
      if (cVar1 != '\0') {
        FUN_14035a200(param_1 + 0x48);
        uVar2 = FUN_14035a290(param_1 + 0x48);
        *(undefined8 *)(param_1 + 0xc0) = uVar2;
      }
    }
    *(undefined1 *)(param_1 + 0x1c0) = 1;
    FUN_14034edd0(param_1 + 0x88);
    FUN_14034edd0(param_1 + 0x1c8);
    uVar2 = *(undefined8 *)(param_1 + 0xc0);
  }
  else {
    uVar2 = *(undefined8 *)(param_1 + 0xc0);
  }
  return uVar2;
}



void FUN_1403cea30(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_1405f2490,local_res10);
  }
  return;
}



void FUN_1403cea90(longlong param_1)

{
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1403ce410(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_1403ceab0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1403db5d0(pvVar1);
    operator_delete(pvVar1);
  }
  return;
}



undefined * FUN_1403ceae0(void)

{
  bool bVar1;
  char cVar2;
  
  bVar1 = false;
  cVar2 = FUN_14034ede0(&DAT_1405f6a98);
  if (cVar2 != '\0') {
    if (DAT_1405d9e80 == '\0') {
      bVar1 = false;
    }
    else {
      bVar1 = true;
      FUN_14034ed40(&DAT_1405f6a98);
    }
  }
  if ((DAT_1405f6a90 & 1) == 0) {
    DAT_1405f6a90 = DAT_1405f6a90 | 1;
    FUN_140393150(&DAT_1405f6a00);
    atexit((_func_5014 *)&LAB_140449660);
  }
  DAT_1405d9e80 = 0;
  if (bVar1) {
    FUN_14034edd0(&DAT_1405f6a98);
  }
  return &DAT_1405f6a00;
}



void FUN_1403ceba0(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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      param_1[1] = lVar1;
    }
    if (lVar1 == 0) {
      if ((longlong *)*param_1 != plVar2) {
        FUN_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                      L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
      }
      *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_14034f420(local_58,PTR_u_CListNode_reports_a_consistency_p_1405d8470,
                L"Proud::CListNode<class Proud::CNetClientWorker>::CListOwner::Erase");
                    // WARNING: Subroutine does not return
  _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
}



void FUN_1403cec90(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_14034ed40(lVar1);
  uVar5 = 1;
  if (param_2[2] != 0) {
    FUN_1403ce410(param_2[2],param_2,param_3,param_4,uVar3,lVar4,1);
  }
  puVar2 = (undefined8 *)(param_1 + 0x298);
  if (param_2[2] != 0) {
    FUN_1403ce410(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_14034edd0(lVar1);
  return;
}



void thunk_FUN_1403ceba0(void)

{
  FUN_1403ceba0();
  return;
}



void FUN_1403ced40(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)*param_1;
  if (pvVar1 != (void *)0x0) {
    FUN_1403596c0(pvVar1);
    operator_delete(pvVar1);
    *param_1 = 0;
    return;
  }
  *param_1 = 0;
  return;
}



undefined8 *
FUN_1403ced90(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_1403cec90(uVar1,param_1,param_3,param_4,0xfffffffffffffffe);
  return param_1;
}



void FUN_1403cee00(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_1405d8010 && (0 < *(int *)(puVar3 + -8))))) {
        *(undefined1 *)(*(longlong *)(param_1 + 0x108) + 0x650) = 1;
        plVar5 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x1818);
        (**(code **)(*plVar5 + 0xf0))(plVar5,1,&DAT_1405f2490,&local_res8);
        puVar3 = (undefined *)CONCAT71(uStackX_9,local_res8);
      }
      if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
         (puVar3 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        FUN_14034ed40(uVar4);
        piVar1 = (int *)(puVar3 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar3 + -8);
        }
        FUN_14034edd0(uVar4);
      }
    }
  }
  return;
}



void FUN_1403cef20(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_140399790();
    }
    iVar5 = *(int *)(param_1 + 0x18);
  }
  else {
    iVar5 = *(int *)(*(longlong *)(param_1 + 8) + 0x18);
  }
  if (iVar5 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (param_2[1] == 0) {
    lVar2 = *param_2;
    if (iVar5 < 1) {
      if (lVar2 == 0) goto LAB_1403cef8e;
      iVar5 = 0;
    }
    else if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    FUN_1400179d0(lVar2,iVar5);
  }
  else {
    if (*(int *)((longlong)param_2 + 0x14) < iVar5) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(int *)(param_2 + 2) = iVar5;
  }
LAB_1403cef8e:
  lVar2 = *(longlong *)(param_1 + 8);
  if (lVar2 == 0) {
    if (*(longlong *)(param_1 + 0x10) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
    }
    if (*(int *)(lVar2 + 0x18) == 0) {
      _Src = (undefined8 *)0x0;
    }
    else {
      _Src = *(undefined8 **)(lVar2 + 0x10);
    }
  }
  else {
    _Src = *(undefined8 **)(param_1 + 0x10);
    if (_Src == (undefined8 *)0x0) {
      FUN_14034f420(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
    }
  }
  _Dst = (undefined8 *)param_2[1];
  if (_Dst == (undefined8 *)0x0) {
    lVar2 = *param_2;
    if (lVar2 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_1403cf0a0(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_1403e0c40(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_1405d8090 * dVar2;
    dVar7 = (double)FUN_140350020();
    *(double *)(*(longlong *)(param_1 + 0x108) + 0x640) = dVar7 * dVar2;
    return;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403cf1e0(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_1405d84f0 ^ (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_1403840e0(param_2,&local_38,0x10);
  if (cVar2 != '\0') {
    cVar2 = FUN_140384b10(param_2,&local_68);
    if (cVar2 != '\0') {
      cVar2 = FUN_140384b70(param_2,local_78);
      if (cVar2 != '\0') {
        plVar3 = (longlong *)FUN_1403b68a0(*(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_14034ff60(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_1403de4f0(*plVar3,param_2,&local_48,&local_58);
        }
      }
    }
  }
  return;
}



void FUN_1403cf350(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_140384b70(param_3,local_res18);
    if ((((cVar2 != '\0') && (cVar2 = FUN_140384780(param_3,&local_b8), cVar2 != '\0')) &&
        (-1 < (int)local_b8)) && ((int)local_b8 < DAT_1405d8140)) {
      FUN_1403841b0(local_b0);
      cVar2 = FUN_140384410(param_3,local_b0,(ulonglong)local_b8 & 0xffffffff);
      if (cVar2 == '\0') {
        local_b8 = local_a8;
        FUN_140399690(local_a8);
        if ((local_a0 != 0) && (local_94 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
      }
      else {
        FUN_1403b68a0(*(undefined8 *)(param_1 + 0x108),&local_res20,local_res18[0]);
        if (((local_res20 != (longlong *)0x0) && (*local_res20 != 0)) &&
           (*(char *)(*local_res20 + 0x684) == '\0')) {
          FUN_1403841b0(local_78);
          local_48 = Proud::AddrPort::vftable;
          local_38 = 0;
          local_50 = 0;
          local_40 = DAT_1405d83d0;
          local_3c = DAT_1405d83d4;
          FUN_140383c40(local_78);
          local_38 = 1;
          FUN_1403cef20(local_b0,local_70);
          local_78[0] = local_b0[0];
          FUN_140383db0(local_78,0);
          local_50 = local_res18[0];
          FUN_1403d5440(param_1,param_2,local_78);
          local_88 = local_70;
          FUN_140399690(local_70);
          if (local_68 != 0) {
            if (local_5c < 0) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            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_14034ff60(local_res20);
        }
        local_88 = local_a8;
        FUN_140399690(local_a8);
        if ((local_a0 != 0) && (local_94 < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
      }
    }
  }
  return;
}



undefined8 FUN_1403cf570(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_14034fe70();
  local_res8 = PTR_DAT_1405d8010;
  FUN_140003100(&local_res8,lVar2 + 0x1588);
  lVar2 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
  uVar3 = 0;
  if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
    uVar3 = **(undefined8 **)(lVar2 + 0x128);
  }
  iVar1 = FUN_140355d00(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_1403cf620(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_1405d84f0 ^ (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_1405d8060) {
    FUN_140354b20(local_638);
    lVar2 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    uVar3 = 0;
    if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(lVar2 + 0x128);
    }
    FUN_140354b40(local_638,uVar3);
    lVar2 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    uVar3 = 0;
    if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(lVar2 + 0x128);
    }
    FUN_140354ba0(local_638,uVar3);
    FUN_140354c00(local_638,0);
    lVar2 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    uVar3 = 0;
    if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
      uVar3 = **(undefined8 **)(lVar2 + 0x128);
    }
    cVar1 = FUN_140354c60(local_638,uVar3,local_648);
    if (cVar1 == '\0') {
      return;
    }
    if (local_648[0] == 0) {
      lVar2 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
      uVar3 = 0;
      if (*(undefined8 **)(lVar2 + 0x128) != (undefined8 *)0x0) {
        uVar3 = **(undefined8 **)(lVar2 + 0x128);
      }
      FUN_140354aa0(uVar3,1);
      uVar3 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
      FUN_1403dd830(uVar3);
      lVar2 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
      cVar1 = FUN_140352ee0(lVar2 + 0x110);
      if (cVar1 == '\0') {
        FUN_14034fa20(&DAT_1404688c0);
      }
      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_1403cf570(param_1,local_648);
    if (cVar1 != '\0') {
      return;
    }
  }
  else {
    local_648[0] = 0x274c;
  }
  FUN_1403ce780(param_1,local_648[0]);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403cf7f0(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_1403840e0(param_2,&local_res20,8,param_4,0xfffffffffffffffe);
  if (cVar3 != '\0') {
    uVar4 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
    FUN_14034ed40(uVar4);
    local_20 = Proud::AddrPort::vftable;
    local_18 = *(undefined4 *)(param_2 + 0x38);
    local_14 = *(undefined2 *)(param_2 + 0x3c);
    plVar5 = (longlong *)FUN_1403b5300(*(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_14034ff60(local_res18);
    }
    if ((lVar6 != 0) && (*(int *)(lVar6 + 0x56c) != 1)) {
      dVar7 = (double)FUN_14035a290(*(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_1405d8108 + dVar1;
      }
      *(double *)(lVar6 + 0x50) = dVar8;
      if (0.0 < dVar7) {
        *(double *)(lVar6 + 0xc0) = dVar7;
        *(int *)(lVar6 + 0x100) = *(int *)(lVar6 + 0x100) + 1;
      }
    }
    FUN_14034edd0(uVar4);
  }
  return;
}



void FUN_1403cf960(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_1403840e0(param_2,&local_res10,8);
  if (cVar3 != '\0') {
    lVar5 = 0;
    uVar8 = 0;
    uVar7 = 0;
    if ((*(int *)(param_2 + 0x28) == 1) &&
       (lVar4 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108)), lVar4 != 0)) {
      lVar5 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108));
      plVar1 = *(longlong **)(lVar5 + 0x108);
      lVar5 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108));
      uVar8 = *(undefined4 *)(lVar5 + 0x140);
      uVar7 = *(undefined2 *)(lVar5 + 0x144);
      local_res8 = plVar1;
    }
    else {
      plVar6 = (longlong *)
               FUN_1403b68a0(*(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_14034ff60(plVar1);
      }
      if (((lVar5 != 0) && (*(longlong **)(lVar5 + 0x18) != (longlong *)0x0)) &&
         (**(longlong **)(lVar5 + 0x18) != 0)) {
        lVar4 = FUN_1403de1c0(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_14039bcd0(local_res8,&local_28,local_res10);
    }
  }
  return;
}



void FUN_1403cfad0(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_14034ed40(puVar3 + 0x10);
  bVar5 = *(longlong *)(param_1 + 0x10) == 0;
  FUN_14034edd0(puVar3 + 0x10);
  if ((!bVar4) || (!bVar5)) {
    FUN_14034fe70();
    local_res18[0] = PTR_DAT_1405d8010;
    FUN_140017720(local_res18,L"CNetClientManager.dtor assert fail: %d %d",bVar4,bVar5,uVar6);
    FUN_14034fe70();
    puVar3 = local_res18[0];
    local_res10 = PTR_DAT_1405d8010;
    if (PTR_DAT_1405d8010 == (undefined *)0x0) {
      local_res10 = (undefined *)0x0;
    }
    if (local_res18[0] != PTR_DAT_1405d8010) {
      uVar6 = FUN_14034fe70();
      FUN_14034ed40(uVar6);
      FUN_1400031d0(&local_res10);
      local_res10 = puVar3;
      if (((puVar3 != PTR_DAT_1405d8010) && (puVar3 != (undefined *)0x0)) &&
         (puVar3 != (undefined *)0x8)) {
        *(int *)(puVar3 + -4) = *(int *)(puVar3 + -4) + 1;
      }
      FUN_14034edd0(uVar6);
    }
    FUN_140352d80(&local_res10);
    if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
       (puVar3 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      FUN_14034ed40(uVar6);
      piVar1 = (int *)(puVar3 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar3 + -8);
      }
      FUN_14034edd0(uVar6);
    }
  }
  if (*(longlong *)(param_1 + 0x10) != 0) {
    FUN_1403ce410(*(longlong *)(param_1 + 0x10),param_1);
  }
  return;
}



void FUN_1403cfc70(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_14034ed40(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_1403b8ef0(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_1403b8ef0(lVar7,0,&DAT_1404689e0,*(undefined8 *)(lVar7 + 0x6a8),
                    *(undefined4 *)(lVar7 + 0x1578));
    }
    FUN_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    FUN_1403c3c70(*(undefined8 *)(param_1 + 0x108),0xc,7,&local_res8);
    puVar4 = local_res8;
    if (((local_res8 != (undefined *)0x0) && (local_res8 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_res8 + -8, puVar1 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      FUN_14034ed40(uVar6);
      piVar2 = (int *)(puVar4 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar6);
    }
    local_res8 = PTR_DAT_1405d8010;
    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_1403cf0a0(param_1);
  FUN_1403baa50(*(undefined8 *)(param_1 + 0x108));
  FUN_1403b5470(*(undefined8 *)(param_1 + 0x108));
  FUN_1403b5760(*(undefined8 *)(param_1 + 0x108));
  FUN_1403b59c0(*(undefined8 *)(param_1 + 0x108));
  FUN_1403c5ea0(*(undefined8 *)(param_1 + 0x108));
  FUN_1403ad630(*(undefined8 *)(param_1 + 0x108));
  FUN_1403ad790(*(undefined8 *)(param_1 + 0x108));
  FUN_1403bb400(*(undefined8 *)(param_1 + 0x108));
  FUN_14034edd0(uVar5);
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403cff20(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 = 0x1403cff36;
  local_1960 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (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_1403840e0(param_2,&local_1958,0x10);
  if ((cVar5 != '\0') && (cVar5 = FUN_140384b10(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_1403841b0(local_1998);
        FUN_140383c40(local_1998);
        FUN_140384310(local_1998,0x800);
        FUN_140384310(local_1998,0);
        FUN_140058870(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_140090370(local_1998,&local_1958);
        uVar8 = FUN_1403ab520(*(undefined8 *)(param_1 + 0x108),&local_1970);
        FUN_140384db0(local_1998,uVar8);
        FUN_140384db0(local_1998,&local_19a8);
        local_cbc = 200;
        local_cc0 = 0;
        local_cc8 = local_1948;
        FUN_140361500(local_cb8,local_1998);
        FUN_1403607b0(local_1948,local_cb8);
        FUN_1403606a0(local_cb8);
        lVar9 = FUN_1403ab410(*(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_1403ab430(*(undefined8 *)(param_1 + 0x108));
        FUN_1403dda40(uVar8,local_1948,&local_1958);
        if ((*(char *)(*(longlong *)(param_1 + 0x108) + 0x1790) != '\0') ||
           (*(int *)(*(longlong *)(param_1 + 0x108) + 0x6c8) != 0)) {
          puVar10 = (undefined8 *)FUN_140353960(&local_19a8,&local_1958);
          FUN_1403b8ef0(*(undefined8 *)(param_1 + 0x108),1,
                        L"Message_ServerHolepunchAck. AddrOfHereAtServer=%s",*puVar10);
          puVar4 = local_1958;
          if ((local_1958 != (undefined *)0x0) &&
             ((local_1958 != PTR_DAT_1405d8010 &&
              (puVar1 = local_1958 + -8, puVar1 != (undefined *)0x0)))) {
            uVar8 = FUN_14034fe70();
            local_1970 = uVar8;
            FUN_14034ed40(uVar8);
            local_1968 = 1;
            piVar2 = (int *)(puVar4 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(uVar8);
          }
        }
        FUN_1403606a0(local_1948);
        local_1958 = local_1990;
        FUN_140399690(local_1990);
        if ((local_1988 != 0) && (local_197c < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
      }
    }
  }
  return;
}



undefined8 FUN_1403d0250(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_140384780(param_3,&local_res18);
  if (((cVar1 == '\0') || ((int)local_res18 < 0)) || (DAT_1405d8140 < (int)local_res18)) {
LAB_1403d03d7:
    FUN_1403555d0(&local_a8);
    return 0;
  }
  FUN_1400179d0(&local_a8,(ulonglong)local_res18 & 0xffffffff);
  uVar2 = local_98;
  if ((int)local_90 == 0) {
    uVar2 = 0;
  }
  cVar1 = FUN_1403840e0(param_3,uVar2,(ulonglong)local_res18 & 0xffffffff);
  if (cVar1 == '\0') goto LAB_1403d03d7;
  FUN_1403841b0(local_78);
  local_48 = Proud::AddrPort::vftable;
  local_38 = 0;
  local_40 = DAT_1405d83d0;
  local_3c = DAT_1405d83d4;
  local_50 = 1;
  FUN_140383c40(local_78);
  if ((int)local_90 < 1) {
                    // WARNING: Subroutine does not return
    FUN_14034f800();
  }
  local_74 = 0;
  if (local_70 == 0) {
    if (local_68 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else if (local_68 == 0) {
    if (local_70 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    FUN_140017a90(local_70,local_98);
    goto LAB_1403d037c;
  }
  FUN_1400178c0(&local_68,local_98);
LAB_1403d037c:
  FUN_140017b00(local_78);
  local_38 = 1;
  FUN_1403d5440(param_1,param_2,local_78);
  local_res18 = &local_70;
  FUN_140399690(&local_70);
  if (local_68 != 0) {
    if (local_5c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_60 = 0;
  }
  FUN_1403555d0(&local_a8);
  return 1;
}



void FUN_1403d0400(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_1403ab430(*(undefined8 *)(param_1 + 0x108));
  *(undefined1 *)(lVar5 + 0x80) = 0;
  iVar2 = *(int *)(param_2 + 8);
  if (-1 < iVar2) {
    if (0 < iVar2) {
      lVar5 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
      FUN_1403a3090(lVar5 + 0x170,iVar2);
      plVar1 = (longlong *)(*(longlong *)(param_1 + 0x108) + 0x660);
      *plVar1 = *plVar1 + (longlong)*(int *)(param_2 + 8);
    }
    uVar7 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    FUN_1403dd8c0(uVar7);
    return;
  }
  FUN_14034fe70();
  local_res8 = (uint *)PTR_DAT_1405d8010;
  uVar3 = FUN_14034fcf0(L"compdatalength < 0 sendcomplete");
  uVar11 = 0;
  uVar9 = 0;
  if ((local_res8 != (uint *)0x0) && (uVar9 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar9 = local_res8[-2];
  }
  uVar4 = uVar3;
  if ((((int)uVar3 <= (int)uVar9) && (uVar4 = uVar11, local_res8 != (uint *)0x0)) &&
     (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar4 = local_res8[-2];
  }
  uVar9 = 1;
  if (1 < (int)uVar4) {
    uVar9 = uVar4;
  }
  uVar4 = uVar11;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar4 = local_res8[-2];
  }
  uVar10 = 0;
  if ((int)uVar4 < (int)uVar9) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar9 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar9 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar4 = uVar11;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar4 = local_res8[-2];
      }
      if (uVar9 != uVar4) {
        puVar6 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar4 = local_res8[-2];
        }
        puVar8 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar9 < (int)uVar4) {
LAB_1403d0552:
          if (local_res8 != (uint *)0x0) {
            puVar8 = local_res8;
          }
        }
        else {
          uVar9 = uVar11;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1405d8010) {
              uVar9 = local_res8[-2];
            }
            goto LAB_1403d0552;
          }
        }
        FUN_14034fd20(puVar6 + 2,puVar8,uVar9);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar6 + 2;
      }
    }
  }
  FUN_140002e10(&local_res8);
  puVar6 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,L"compdatalength < 0 sendcomplete",uVar3);
  puVar6 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8010;
  }
  uVar3 = FUN_14034fcf0(puVar6);
  uVar9 = 0;
  if (0 < (int)uVar3) {
    uVar9 = uVar3;
  }
  uVar3 = uVar10;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = local_res8[-2];
  }
  if (((int)uVar3 <= (int)uVar9) && (uVar9 = uVar10, local_res8 != (uint *)0x0)) {
    if (local_res8 == (uint *)PTR_DAT_1405d8010) goto LAB_1403d060c;
    uVar9 = local_res8[-2];
  }
  if (((local_res8 != (uint *)PTR_DAT_1405d8010) && (local_res8 != (uint *)0x0)) &&
     (local_res8 + -2 != (uint *)0x0)) {
    local_res8[-2] = uVar9;
    *(undefined2 *)((longlong)local_res8 + (longlong)(int)uVar9 * 2) = 0;
  }
LAB_1403d060c:
  FUN_1403c3c70(*(undefined8 *)(param_1 + 0x108),0xb,3,&local_res8);
  puVar6 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar8 = local_res8 + -2, puVar8 != (uint *)0x0)) {
    uVar7 = FUN_14034fe70();
    FUN_14034ed40(uVar7);
    puVar6 = puVar6 + -1;
    *puVar6 = *puVar6 - 1;
    if (*puVar6 == 0) {
      FUN_14034ff60(puVar8);
    }
    FUN_14034edd0(uVar7);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403d07fa)
// WARNING: Removing unreachable block (ram,0x0001403d080d)
// WARNING: Removing unreachable block (ram,0x0001403d0827)
// WARNING: Removing unreachable block (ram,0x0001403d082f)
// WARNING: Removing unreachable block (ram,0x0001403d0836)

void FUN_1403d06d0(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_14034ed40(uVar3);
  *(int *)(param_1 + 0x40) = *(int *)(param_1 + 0x40) + 1;
  if (*(longlong *)(*(longlong *)(param_1 + 0x108) + 0xb0) != 0) {
    FUN_1403aac20();
  }
  puVar7 = (undefined *)0x0;
  uVar8 = 1;
  if (*(int *)(param_1 + 0x40) == 1) {
    (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
    lVar4 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108));
    if (lVar4 != 0) {
      lVar4 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108));
      puVar6 = puVar7;
      if (*(undefined8 **)(lVar4 + 0x100) != (undefined8 *)0x0) {
        puVar6 = (undefined *)**(undefined8 **)(lVar4 + 0x100);
      }
      FUN_1403552c0(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_14000d450(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_1403bcd20(*(undefined8 *)(param_1 + 0x108),&local_res8);
      lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x108) + 0x1670);
    }
    FUN_1403bc860(*(undefined8 *)(param_1 + 0x108));
    FUN_1403bc9b0(*(undefined8 *)(param_1 + 0x108));
    lVar4 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    if (lVar4 != 0) {
      lVar4 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
      puVar6 = puVar7;
      if (*(undefined8 **)(lVar4 + 0x128) != (undefined8 *)0x0) {
        puVar6 = (undefined *)**(undefined8 **)(lVar4 + 0x128);
      }
      FUN_1403552c0(puVar6);
    }
  }
  FUN_1403bb820(*(undefined8 *)(param_1 + 0x108));
  if (*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x1718) == 0) {
    lVar4 = FUN_1403ab410();
    if (lVar4 != 0) {
      lVar4 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108));
      if ((*(longlong **)(lVar4 + 0x100) != (longlong *)0x0) &&
         (**(longlong **)(lVar4 + 0x100) != 0)) {
        lVar4 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108));
        puVar6 = puVar7;
        if (*(undefined8 **)(lVar4 + 0x100) != (undefined8 *)0x0) {
          puVar6 = (undefined *)**(undefined8 **)(lVar4 + 0x100);
        }
        cVar2 = FUN_140355560(puVar6);
        if (((cVar2 == '\0') ||
            (lVar4 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108)),
            *(char *)(lVar4 + 0x80) != '\0')) ||
           (lVar4 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108)), *(char *)(lVar4 + 0xc0) != '\0'
           )) {
          uVar8 = 2;
          goto LAB_1403d0a03;
        }
      }
    }
    lVar4 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    if (lVar4 != 0) {
      lVar4 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
      if ((*(longlong **)(lVar4 + 0x128) != (longlong *)0x0) &&
         (**(longlong **)(lVar4 + 0x128) != 0)) {
        lVar4 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
        puVar6 = puVar7;
        if (*(undefined8 **)(lVar4 + 0x128) != (undefined8 *)0x0) {
          puVar6 = (undefined *)**(undefined8 **)(lVar4 + 0x128);
        }
        cVar2 = FUN_140355560(puVar6);
        if (((cVar2 == '\0') ||
            (lVar4 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108)),
            *(char *)(lVar4 + 0x80) != '\0')) ||
           (lVar4 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108)), *(char *)(lVar4 + 0xc0) != '\0'
           )) {
          uVar8 = 3;
          goto LAB_1403d0a03;
        }
      }
    }
    cVar2 = FUN_14035a350(*(longlong *)(param_1 + 0x108) + 0x1620);
    if (cVar2 == '\0') {
      FUN_14035a250(*(longlong *)(param_1 + 0x108) + 0x1620);
    }
    FUN_1403c17c0(*(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_1403d0a03:
    dVar9 = (double)(**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    if ((5.0 < dVar9 - *(double *)(param_1 + 0x80)) && (*(char *)(param_1 + 0xc0) == '\0')) {
      FUN_14034fe70();
      local_res18 = PTR_DAT_1405d8010;
      FUN_140017720(&local_res18,
                    L"Too long time elapsed since disconnecting mode! unsafeDisconnectReason=%d",
                    uVar8);
      FUN_14034fe70();
      puVar6 = local_res18;
      local_res10 = PTR_DAT_1405d8010;
      if (PTR_DAT_1405d8010 == (undefined *)0x0) {
        local_res10 = puVar7;
      }
      if (local_res18 != PTR_DAT_1405d8010) {
        uVar5 = FUN_14034fe70();
        FUN_14034ed40(uVar5);
        FUN_1400031d0(&local_res10);
        local_res10 = puVar6;
        if (((puVar6 != PTR_DAT_1405d8010) && (puVar6 != (undefined *)0x0)) &&
           (puVar6 != (undefined *)0x8)) {
          *(int *)(puVar6 + -4) = *(int *)(puVar6 + -4) + 1;
        }
        FUN_14034edd0(uVar5);
      }
      FUN_140352d80(&local_res10);
      *(undefined1 *)(param_1 + 0xc0) = 1;
      if (((puVar6 != (undefined *)0x0) && (puVar6 != PTR_DAT_1405d8010)) &&
         (puVar6 + -8 != (undefined *)0x0)) {
        uVar5 = FUN_14034fe70();
        FUN_14034ed40(uVar5);
        piVar1 = (int *)(puVar6 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar6 + -8);
        }
        FUN_14034edd0(uVar5);
      }
    }
  }
  FUN_14034edd0(uVar3);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403d0be0(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_1405d84f0 ^ (ulonglong)auStack_da8;
  cVar2 = FUN_1403840e0(param_2,&local_d80,8);
  if (cVar2 != '\0') {
    uVar3 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
    local_d48 = uVar3;
    FUN_14034ed40(uVar3);
    local_d40 = 1;
    local_d38 = Proud::AddrPort::vftable;
    local_d30 = *(undefined4 *)(param_2 + 0x38);
    local_d2c = *(undefined2 *)(param_2 + 0x3c);
    plVar4 = (longlong *)FUN_1403b5300(*(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_14034ff60(local_d88);
      uVar3 = local_d48;
    }
    if ((lVar6 != 0) && (*(int *)(lVar6 + 0x56c) != 1)) {
      FUN_1403841b0(local_d70);
      FUN_140383c40(local_d70);
      FUN_140384310(local_d70,0x800);
      FUN_140384310(local_d70,0);
      FUN_140058870(local_d70,0x21);
      FUN_140058670(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_140399790();
        }
      }
      else {
        uStack_d78 = *(undefined4 *)(local_d68 + 0x18);
      }
      lVar5 = local_d60;
      if (local_d60 == 0) {
        if (local_d68 == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        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_1405d81cc;
      local_d80 = (longlong *)lVar5;
      uStack_cb0 = uStack_d78;
      FUN_1403de1e0(lVar6 + 0x668,&local_cb8,local_d28);
      if (local_38 == (undefined4 *)0x0) {
        FUN_14034f420(local_d00,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_d00,(ThrowInfo *)&DAT_1405d36c0);
      }
      if (local_2c < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_30 = 0;
      local_d80 = &local_d68;
      FUN_140399690(&local_d68);
      if (local_d60 != 0) {
        if (local_d54 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_d58 = 0;
      }
    }
    FUN_14034edd0(uVar3);
  }
  return;
}



void FUN_1403d0e90(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_14039bb20(*(undefined8 *)(param_2 + 0x188),&local_a0);
  if (dVar10 <= 0.0) {
    return;
  }
  FUN_1403841b0(local_d8);
  FUN_140383c40(local_d8);
  FUN_140384310(local_d8,0x800);
  FUN_140384310(local_d8,0);
  FUN_140058870(local_d8,0x28);
  FUN_140058670(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_1405d81cc;
    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_14039b1d0(uVar4,1);
    uVar11 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108));
    piVar7 = local_80;
    pppuVar9 = &local_90;
    uVar4 = 1;
  }
  else {
    if (iVar1 == 0) goto LAB_1403d1116;
    plVar6 = (longlong *)FUN_1403b68a0(*(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_14034ff60(local_res10);
    }
    if ((*(longlong **)(lVar8 + 0x18) == (longlong *)0x0) || (**(longlong **)(lVar8 + 0x18) == 0))
    goto LAB_1403d1116;
    local_60[0] = 1;
    local_58 = 0;
    local_50 = 1;
    local_4c = 0xffffffff;
    local_48 = 1;
    local_47 = DAT_1405d81cc;
    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_14039b1d0(uVar5,uVar4);
    uVar11 = FUN_1403de1c0(lVar8);
    piVar7 = local_60;
    pppuVar9 = &local_b0;
  }
  FUN_1403e2100(uVar11,uVar4,uVar3,pppuVar9,local_d8,CONCAT44(uVar13,uVar12),piVar7);
LAB_1403d1116:
  local_res10 = &local_d0;
  FUN_140399690(&local_d0);
  if ((local_c8 != 0) && (local_bc < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



void FUN_1403d1160(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  undefined4 uVar1;
  undefined8 uVar2;
  undefined *local_res8;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_14034ed40();
  if (*(int *)(param_2 + 0x100) != 5) {
    FUN_14034fe70();
    local_res8 = PTR_DAT_1405d8010;
    uVar1 = FUN_14034fcf0(L"Unexpected at CNetClientManager::Unregister");
    uVar2 = FUN_140002f00(&local_res8,uVar1);
    FUN_14034fd20(uVar2,L"Unexpected at CNetClientManager::Unregister",uVar1,param_4,uVar3);
    FUN_140002fe0(&local_res8);
    FUN_140352d80(&local_res8);
  }
  if (*(longlong *)(param_2 + 0x10) != 0) {
    FUN_1403ce410(*(longlong *)(param_2 + 0x10),param_2);
  }
  FUN_14034edd0(param_1 + 0x10);
  return;
}



void FUN_1403d1210(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_14034ed40(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_1403eb040(local_res8,param_1 + 8,param_3,param_4,uVar8,lVar9,uVar10);
    }
    if (lVar5 == 0) {
      local_res8 = (longlong *)0x0;
    }
    else {
      local_res8 = (longlong *)FUN_14034fef0(0x10);
      local_res8[1] = 1;
      *local_res8 = lVar5;
    }
    plVar2 = local_res8;
    FUN_1403aca30(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_14034ff60(plVar4);
      }
    }
    if ((longlong *)*plVar1 != (longlong *)0x0) {
      lVar7 = *(longlong *)*plVar1;
    }
    FUN_1403eac00(lVar7);
  }
  else if (((plVar2 != (longlong *)0x0) && (*plVar2 != 0)) && (param_2 == '\0')) {
    FUN_1403eaba0();
  }
  FUN_14034edd0(lVar6);
  return;
}



undefined8 * FUN_1403d1350(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_14034fef0(0x58);
  }
  else {
    puVar2 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x58,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar2 != (undefined8 *)0x0) {
    FUN_1403841e0(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_1403d1400(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_140384910(param_3,local_res18);
  if (cVar4 == '\0') {
    return 0;
  }
  cVar4 = FUN_140384780(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_140384780(param_3,&local_90);
  plVar11 = plVar12;
  plVar10 = plVar12;
  if (((cVar4 != '\0') && (iVar13 = (int)local_90, plVar11 = (longlong *)0x0, -1 < iVar13)) &&
     (iVar13 <= DAT_1405d8140)) {
    FUN_14035f6d0(&local_128,local_90 & 0xffffffff);
    plVar11 = local_118;
    iVar15 = (int)local_110;
    plVar10 = local_118;
    if ((int)local_110 == 0) {
      plVar10 = plVar12;
    }
    cVar4 = FUN_1403840e0(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_140384780(param_3,&local_88);
      if (((cVar4 != '\0') && (-1 < (int)local_88)) && ((int)local_88 <= DAT_1405d8140)) {
        FUN_1400179d0(&local_150,local_88 & 0xffffffff);
        plVar10 = local_140;
        if ((int)local_138 == 0) {
          plVar10 = plVar12;
        }
        cVar4 = FUN_1403840e0(param_3,plVar10,local_88 & 0xffffffff);
        if (cVar4 != '\0') {
          FUN_1403841b0(local_178);
          FUN_140383c40(local_178);
          FUN_140384310(local_178,0x800);
          FUN_140384310(local_178,0);
          FUN_140058870(local_178,0x23);
          uVar3 = local_138;
          iVar13 = (int)local_138;
          FUN_140385580(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_140399790(0,plVar10);
              }
LAB_1403d15ee:
              FUN_1400178c0(&local_168,plVar10,uVar3 & 0xffffffff);
            }
            else {
              if (local_168 != 0) goto LAB_1403d15ee;
              if (local_170 == 0) {
                    // WARNING: Subroutine does not return
                FUN_140399790(0,plVar10);
              }
              FUN_140017a90(local_170,plVar10,uVar3 & 0xffffffff);
            }
            FUN_140017b00(local_178);
          }
          local_70 = DAT_1405f2520;
          local_6c = 0xffffffff;
          local_68 = DAT_1405f2540;
          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_14034f800();
              }
              local_100 = (int *)((longlong)plVar11 + (longlong)plVar17 * 4);
              if (*local_100 != *(int *)(*(longlong *)(param_1 + 0x108) + 0x1578)) {
                plVar7 = (longlong *)
                         FUN_1403b68a0(*(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_14034ff60(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_14039b1d0(uVar6,*local_100);
                  uVar8 = FUN_1403de1c0(plVar14);
                  FUN_1403e2100(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_1403841b0(local_f8);
          local_c8 = Proud::AddrPort::vftable;
          local_b8 = 0;
          local_c0 = DAT_1405d83d0;
          local_bc = DAT_1405d83d4;
          local_d0 = 1;
          FUN_140383c40(local_f8);
          if ((int)local_138 < 1) {
                    // WARNING: Subroutine does not return
            FUN_14034f800();
          }
          local_f4 = 0;
          if (local_f0 == 0) {
            if (local_e8 == 0) {
                    // WARNING: Subroutine does not return
              FUN_140399790();
            }
          }
          else if (local_e8 == 0) {
            if (local_f0 == 0) {
                    // WARNING: Subroutine does not return
              FUN_140399790();
            }
            FUN_140017a90(local_f0,local_140);
            goto LAB_1403d1879;
          }
          FUN_1400178c0(&local_e8,local_140);
LAB_1403d1879:
          FUN_140017b00(local_f8);
          FUN_1403d5440(param_1,param_2,local_f8);
          local_res20 = &local_f0;
          FUN_140399690(&local_f0);
          if (local_e8 != 0) {
            if (local_dc < 0) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            local_e0 = 0;
          }
          local_res20 = &local_170;
          FUN_140399690(&local_170);
          if (local_168 != 0) {
            if (local_15c < 0) {
                    // WARNING: Subroutine does not return
              FUN_14034f7d0();
            }
            local_160 = 0;
          }
          FUN_1403555d0(&local_150);
          if (plVar11 != (longlong *)0x0) {
            if (local_120 == (longlong *)0x0) {
              FUN_14034ff60(plVar11);
            }
            else {
              (**(code **)(*local_120 + 0x18))(local_120,plVar11);
            }
          }
          return 1;
        }
      }
      FUN_1403555d0(&local_150);
      if (plVar11 == (longlong *)0x0) {
        return 0;
      }
      if (local_120 == (longlong *)0x0) goto LAB_1403d1963;
      lVar9 = *local_120;
      plVar10 = local_120;
      goto LAB_1403d195b;
    }
  }
  if (plVar11 == (longlong *)0x0) {
    return 0;
  }
  if (plVar10 == (longlong *)0x0) {
LAB_1403d1963:
    FUN_14034ff60(plVar11);
    return 0;
  }
  lVar9 = *plVar10;
LAB_1403d195b:
  (**(code **)(lVar9 + 0x18))(plVar10,plVar11);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403d1990(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_1405d84f0 ^ (ulonglong)auStack_ec8;
  local_ea0 = param_1;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  cVar8 = FUN_1403840e0(param_2,local_ea8,1);
  if (cVar8 == '\0') {
    FUN_14034fe70();
    local_e70 = PTR_DAT_1405d8010;
    FUN_1403c3c70(*(undefined8 *)(param_1 + 0x108),8,3,&local_e70);
    puVar5 = local_e70;
    if (((local_e70 != (undefined *)0x0) && (local_e70 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_e70 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_14034fe70();
      local_d68 = uVar9;
      FUN_14034ed40(uVar9);
      local_d60 = 1;
      piVar2 = (int *)(puVar5 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar9);
      local_d60 = 0;
    }
    local_e70 = PTR_DAT_1405d8010;
LAB_1403d1a8e:
    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_1403a6d70(&local_d48);
  cVar8 = FUN_140384bf0(param_2,&local_d48);
  if (cVar8 == '\0') {
    FUN_14034fe70();
    local_e60 = PTR_DAT_1405d8010;
    FUN_1403c3c70(*(undefined8 *)(param_1 + 0x108),8,3,&local_e60);
    puVar5 = local_e60;
    if (((local_e60 != (undefined *)0x0) && (local_e60 != PTR_DAT_1405d8010)) &&
       (puVar1 = local_e60 + -8, puVar1 != (undefined *)0x0)) {
      uVar9 = FUN_14034fe70();
      local_d78 = uVar9;
      FUN_14034ed40(uVar9);
      local_d70 = 1;
      piVar2 = (int *)(puVar5 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar9);
      local_d70 = 0;
    }
    local_e60 = PTR_DAT_1405d8010;
    goto LAB_1403d1a8e;
  }
  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_140384780(param_2,&local_dd0);
  plVar6 = local_dd0;
  if (((cVar8 != '\0') && (-1 < (int)local_dd0)) && ((int)local_dd0 <= DAT_1405d8140)) {
    FUN_1400179d0(&local_e08,(ulonglong)local_dd0 & 0xffffffff);
    uVar10 = local_df8;
    if ((int)local_df0 == 0) {
      uVar10 = uVar9;
    }
    cVar8 = FUN_1403840e0(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_1403a5090(&local_e58,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x6bc));
      uVar10 = local_e48;
      if ((int)local_e40 == 0) {
        uVar10 = uVar9;
      }
      FUN_140394f20(*(longlong *)(param_1 + 0x108) + 0xd8,uVar10,
                    *(uint *)(*(longlong *)(param_1 + 0x108) + 0x6bc) >> 3,0x10);
      FUN_1403a5090(&local_e30,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x6c0));
      uVar10 = local_e20;
      if ((int)local_e18 == 0) {
        uVar10 = uVar9;
      }
      FUN_1403a4780(*(longlong *)(param_1 + 0x108) + 0x4a8,uVar10,
                    *(uint *)(*(longlong *)(param_1 + 0x108) + 0x6c0) >> 3);
      uVar10 = FUN_140350040();
      FUN_14034ed40(uVar10);
      if (iStack_d44 < DAT_1405d8140) {
        iStack_d44 = DAT_1405d8140;
      }
      DAT_1405d8140 = iStack_d44;
      FUN_14034edd0(uVar10);
      if (*(longlong *)(param_2 + 2) == 0) {
        if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        iVar3 = param_2[6];
      }
      else {
        iVar3 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
      }
      if ((int)(*param_2 + (*param_2 >> 0x1f & 7U)) >> 3 != iVar3) {
        FUN_14034fe70();
        local_ea0 = PTR_DAT_1405d8010;
        FUN_1403c3c70(*(undefined8 *)(param_1 + 0x108),8,3,&local_ea0);
        puVar5 = local_ea0;
        if (((local_ea0 != (undefined *)0x0) && (local_ea0 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_ea0 + -8, puVar1 != (undefined *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_d08 = uVar9;
          FUN_14034ed40(uVar9);
          local_d00 = 1;
          piVar2 = (int *)(puVar5 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(uVar9);
        }
        FUN_1403ce3b0(param_1,4);
        FUN_1403555d0(&local_e30);
        FUN_1403555d0(&local_e58);
        goto LAB_1403d2327;
      }
      *(undefined1 *)(*(longlong *)(param_1 + 0x108) + 0x1790) = local_ea8[0];
      lVar4 = *(longlong *)(param_1 + 0x108);
      uVar10 = FUN_1403ab430(lVar4);
      FUN_1403dd810(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_1403a5090(&local_e58,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x6bc));
      uVar10 = local_e48;
      if ((int)local_e40 == 0) {
        uVar10 = uVar9;
      }
      FUN_140394f20(*(longlong *)(param_1 + 0x108) + 0x708,uVar10,
                    *(uint *)(*(longlong *)(param_1 + 0x108) + 0x6bc) >> 3,0x10);
      FUN_1403a5250(&local_dc8,&local_e58,&local_e08);
      FUN_1403a5090(&local_e30,*(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x6c0));
      uVar10 = local_e20;
      if ((int)local_e18 == 0) {
        uVar10 = uVar9;
      }
      FUN_1403a4780(*(longlong *)(param_1 + 0x108) + 0xad8,uVar10,
                    *(uint *)(*(longlong *)(param_1 + 0x108) + 0x6c0) >> 3);
      FUN_140396fe0(&local_e30,&local_da0,*(longlong *)(param_1 + 0x108) + 0x708);
      FUN_1403841b0(local_e98);
      FUN_140383c40(local_e98);
      FUN_140384310(local_e98,0x800);
      FUN_140384310(local_e98,0);
      FUN_140058870(local_e98,5);
      uVar7 = local_db0;
      iVar3 = (int)local_db0;
      FUN_140385580(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_140399790(0,uVar10);
          }
LAB_1403d2092:
          FUN_1400178c0(&local_e88,uVar10,uVar7 & 0xffffffff);
        }
        else {
          if (local_e88 != 0) goto LAB_1403d2092;
          if (local_e90 == 0) {
                    // WARNING: Subroutine does not return
            FUN_140399790(0,uVar10);
          }
          FUN_140017a90(local_e90,uVar10,uVar7 & 0xffffffff);
        }
        FUN_140017b00(local_e98);
      }
      uVar7 = local_d88;
      iVar3 = (int)local_d88;
      FUN_140385580(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_140399790(0,uVar10);
          }
LAB_1403d2110:
          FUN_1400178c0(&local_e88,uVar10,uVar7 & 0xffffffff);
        }
        else {
          if (local_e88 != 0) goto LAB_1403d2110;
          if (local_e90 == 0) {
                    // WARNING: Subroutine does not return
            FUN_140399790(0,uVar10);
          }
          FUN_140017a90(local_e90,uVar10,uVar7 & 0xffffffff);
        }
        FUN_140017b00(local_e98);
      }
      uVar9 = FUN_140361500(local_cb8,local_e98);
      local_d58 = 0;
      local_d50 = 1;
      uVar10 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
      FUN_1403dda40(uVar10,uVar9,&local_d58);
      FUN_1403606a0(local_cb8);
      local_dd0 = &local_e90;
      FUN_140399690(&local_e90);
      if (local_e88 != 0) {
        if (local_e7c < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_e80 = 0;
      }
      FUN_1403555d0(&local_da0);
      FUN_1403555d0(&local_dc8);
      FUN_1403555d0(&local_e30);
      FUN_1403555d0(&local_e58);
      goto LAB_1403d2327;
    }
  }
  FUN_14034fe70();
  local_e68 = PTR_DAT_1405d8010;
  FUN_1403c3c70(*(undefined8 *)(param_1 + 0x108),8,3,&local_e68);
  puVar5 = local_e68;
  if (((local_e68 != (undefined *)0x0) && (local_e68 != PTR_DAT_1405d8010)) &&
     (puVar1 = local_e68 + -8, puVar1 != (undefined *)0x0)) {
    uVar9 = FUN_14034fe70();
    local_d18 = uVar9;
    FUN_14034ed40(uVar9);
    local_d10 = 1;
    piVar2 = (int *)(puVar5 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar1);
    }
    FUN_14034edd0(uVar9);
    local_d10 = 0;
  }
  local_e68 = PTR_DAT_1405d8010;
  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_1403d2327:
  FUN_1403555d0(&local_e08);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403d2360(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_1405d84f0 ^ (ulonglong)auStack_d68;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  FUN_1403841b0(local_d48);
  FUN_140383c40(local_d48);
  FUN_140384310(local_d48,0x800);
  FUN_140384310(local_d48,0);
  FUN_140058870(local_d48,7);
  lVar5 = *(longlong *)(param_1 + 0x108);
  iVar1 = *(int *)(lVar5 + 0x15c0);
  FUN_140385580(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_140399790(0,lVar4);
      }
LAB_1403d2440:
      FUN_1400178c0(&local_d38,lVar4,iVar1);
    }
    else {
      if (local_d38 != 0) goto LAB_1403d2440;
      if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790(0,lVar4);
      }
      FUN_140017a90(local_d40,lVar4,iVar1);
    }
    FUN_140017b00(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_140399790();
    }
  }
  else if (local_d38 == 0) {
    if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar1 = *(int *)(local_d40 + 0x18);
    FUN_1400179d0(local_d40,iVar1 + 0x10);
    lVar5 = lVar6;
    if (*(int *)(lVar4 + 0x18) != 0) {
      lVar5 = *(longlong *)(lVar4 + 0x10);
    }
    puVar3 = (undefined8 *)(lVar5 + iVar1);
    goto LAB_1403d24f0;
  }
  lVar5 = (longlong)local_d30;
  local_d30 = local_d30 + 0x10;
  if ((local_d30 < 0) || (local_d2c < local_d30)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  puVar3 = (undefined8 *)(local_d38 + lVar5);
LAB_1403d24f0:
  *puVar3 = local_d18;
  puVar3[1] = CONCAT44(uStack_d0c,uStack_d10);
  FUN_140017b00(local_d48);
  FUN_140058470(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_140399790();
    }
  }
  else {
    iStack_cb0 = *(int *)(local_d40 + 0x18);
  }
  lVar5 = local_d38;
  if (local_d38 == 0) {
    if (local_d40 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_1403ab430(*(undefined8 *)(param_1 + 0x108));
  FUN_1403dda40(uVar2,&local_cb8,&local_d18);
  if (local_38 == (undefined4 *)0x0) {
    FUN_14034f420(local_d00,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d00,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  local_d18 = &local_d40;
  FUN_140399690(&local_d40);
  if ((local_d38 != 0) && (local_d2c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



undefined8 FUN_1403d2660(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_14000d450(0x80004005);
  }
  FUN_1403841e0(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_1403b63b0(param_1,plVar1);
  return param_2;
}



void FUN_1403d26e0(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_1403b5300(*(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_14034ff60(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_140399790();
      }
      iVar10 = param_3[6];
    }
    else {
      iVar10 = *(int *)(*(longlong *)(param_3 + 2) + 0x18);
    }
    FUN_140384370(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_1403e3270(uVar13 + 0x638,param_3,&local_c8,local_res8);
  if (local_res8[0] == 0) goto LAB_1403d2a42;
  FUN_14034fe70();
  local_res18 = (uint *)PTR_DAT_1405d8010;
  uVar2 = FUN_14034fcf0(L"Stream Extract Error at Reliable UDP");
  uVar9 = 0;
  uVar12 = uVar11;
  if ((local_res18 != (uint *)0x0) && (uVar12 = 0, local_res18 != (uint *)PTR_DAT_1405d8010)) {
    uVar12 = (ulonglong)local_res18[-2];
  }
  uVar3 = uVar2;
  if ((((int)uVar2 <= (int)uVar12) && (uVar3 = uVar9, local_res18 != (uint *)0x0)) &&
     (local_res18 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = local_res18[-2];
  }
  uVar8 = 1;
  if (1 < (int)uVar3) {
    uVar8 = uVar3;
  }
  uVar3 = uVar9;
  if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = local_res18[-2];
  }
  if ((int)uVar3 < (int)uVar8) {
    if (local_res18 == (uint *)0x0) {
      local_res18 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar8 == 0) {
      FUN_1400031d0(&local_res18);
    }
    else {
      uVar3 = uVar9;
      if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
        uVar3 = local_res18[-2];
      }
      if (uVar8 != uVar3) {
        puVar5 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar3 = local_res18[-2];
        }
        puVar7 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar8 < (int)uVar3) {
LAB_1403d28eb:
          if (local_res18 != (uint *)0x0) {
            puVar7 = local_res18;
          }
        }
        else {
          uVar8 = uVar9;
          if (local_res18 != (uint *)0x0) {
            if (local_res18 != (uint *)PTR_DAT_1405d8010) {
              uVar8 = local_res18[-2];
            }
            goto LAB_1403d28eb;
          }
        }
        FUN_14034fd20(puVar5 + 2,puVar7,uVar8);
        FUN_1400031d0(&local_res18);
        local_res18 = puVar5 + 2;
      }
    }
  }
  FUN_140002e10(&local_res18);
  puVar5 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar5 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar5,L"Stream Extract Error at Reliable UDP",uVar2);
  puVar5 = local_res18;
  if (local_res18 == (uint *)0x0) {
    puVar5 = (uint *)PTR_DAT_1405d8010;
  }
  uVar3 = FUN_14034fcf0(puVar5);
  uVar2 = 0;
  if (0 < (int)uVar3) {
    uVar2 = uVar3;
  }
  uVar3 = uVar9;
  if ((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = local_res18[-2];
  }
  if (((int)uVar2 < (int)uVar3) || (uVar2 = uVar9, local_res18 == (uint *)0x0)) {
LAB_1403d297e:
    if (((local_res18 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
    uVar2 = local_res18[-2];
    goto LAB_1403d297e;
  }
  local_88 = 0;
  local_80 = 0;
  local_78 = 0;
  local_70 = 0;
  local_90 = Proud::ByteArray::vftable;
  uVar6 = FUN_14035bed0(local_58,local_res8[0],*(undefined4 *)(uVar13 + 0x56c),&local_res18,
                        &local_90);
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar6);
  FUN_1403555d0(&local_90);
  puVar5 = local_res18;
  param_2 = local_res10;
  if (((local_res18 != (uint *)0x0) && (local_res18 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar7 = local_res18 + -2, puVar7 != (uint *)0x0)) {
    uVar6 = FUN_14034fe70();
    local_68 = uVar6;
    FUN_14034ed40(uVar6);
    local_60 = 1;
    puVar5 = puVar5 + -1;
    *puVar5 = *puVar5 - 1;
    if (*puVar5 == 0) {
      FUN_14034ff60(puVar7);
    }
    FUN_14034edd0(uVar6);
    param_2 = local_res10;
  }
LAB_1403d2a42:
  while( true ) {
    iVar10 = (int)uVar11;
    if (iVar10 == (int)local_b0) {
      FUN_14038d7d0(&local_c8);
      return;
    }
    if ((iVar10 < 0) || ((int)local_b0 <= iVar10)) break;
    *(char *)(local_b8 + (longlong)iVar10 * 0x48 + 0x40) = (char)param_3[0x10];
    FUN_1403d5440(param_1,param_2);
    if ((int)local_b0 <= iVar10) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    uVar11 = (ulonglong)(iVar10 + 1);
  }
                    // WARNING: Subroutine does not return
  FUN_14034f800();
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403d2af0(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_1405d84f0 ^ (ulonglong)auStack_df8;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  cVar4 = FUN_140384b70(param_2,local_db0);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = FUN_1403840e0(param_2,&local_db4,4);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = FUN_140384780(param_2,&local_da8);
  if (cVar4 == '\0') {
    return;
  }
  if ((int)local_da8 < 0) {
    return;
  }
  if (DAT_1405d8140 <= (int)local_da8) {
    return;
  }
  FUN_1403841b0(local_d40);
  cVar4 = FUN_140384410(param_2,local_d40,(ulonglong)local_da8 & 0xffffffff);
  if (cVar4 == '\0') {
    local_da8 = local_d38;
    FUN_140399690(local_d38);
    if (local_d30 == 0) {
      return;
    }
    if (-1 < local_d24) {
      return;
    }
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_1403b68a0(*(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_1403d3030;
  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_140361500(local_cc8,local_d40);
  FUN_1403a6e00(*(undefined8 *)(*(longlong *)(param_1 + 0x108) + 0x4e0),local_db4,local_cc8,
                &local_da0);
  FUN_1403606a0(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_1403e31e0(uVar10 + 0x638,&local_da0,&local_d68,&local_db8);
  if (local_db8 != 0) {
    FUN_14034fe70();
    local_dc8 = (uint *)PTR_DAT_1405d8010;
    uVar5 = FUN_14034fcf0(L"Stream Extract Error at Reliable UDP");
    uVar10 = uVar14;
    if ((local_dc8 != (uint *)0x0) && (uVar10 = 0, local_dc8 != (uint *)PTR_DAT_1405d8010)) {
      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_1405d8010)) {
      uVar7 = local_dc8[-2];
    }
    uVar12 = 1;
    if (1 < (int)uVar7) {
      uVar12 = uVar7;
    }
    uVar7 = uVar6;
    if ((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1405d8010)) {
      uVar7 = local_dc8[-2];
    }
    if ((int)uVar7 < (int)uVar12) {
      if (local_dc8 == (uint *)0x0) {
        local_dc8 = (uint *)PTR_DAT_1405d8010;
      }
      if ((int)uVar12 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (uVar12 == 0) {
        FUN_1400031d0(&local_dc8);
      }
      else {
        uVar7 = uVar15;
        if ((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1405d8010)) {
          uVar7 = local_dc8[-2];
        }
        if (uVar12 != uVar7) {
          puVar8 = (uint *)FUN_14034fef0((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_1405d8010)) {
            uVar7 = local_dc8[-2];
          }
          puVar11 = (uint *)PTR_DAT_1405d8010;
          if ((int)uVar12 < (int)uVar7) {
LAB_1403d2dfe:
            if (local_dc8 != (uint *)0x0) {
              puVar11 = local_dc8;
            }
          }
          else {
            uVar12 = uVar15;
            if (local_dc8 != (uint *)0x0) {
              if (local_dc8 != (uint *)PTR_DAT_1405d8010) {
                uVar12 = local_dc8[-2];
              }
              goto LAB_1403d2dfe;
            }
          }
          FUN_14034fd20(puVar8 + 2,puVar11,uVar12);
          FUN_1400031d0(&local_dc8);
          local_dc8 = puVar8 + 2;
        }
      }
    }
    FUN_140002e10(&local_dc8);
    puVar8 = local_dc8;
    if (local_dc8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar8,L"Stream Extract Error at Reliable UDP",uVar5);
    puVar8 = local_dc8;
    if (local_dc8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1405d8010;
    }
    uVar5 = FUN_14034fcf0(puVar8);
    uVar15 = 0;
    if (0 < (int)uVar5) {
      uVar15 = uVar5;
    }
    uVar5 = uVar6;
    if ((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1405d8010)) {
      uVar5 = local_dc8[-2];
    }
    if (((int)uVar15 < (int)uVar5) || (uVar15 = uVar6, local_dc8 == (uint *)0x0)) {
LAB_1403d2e9a:
      if (((local_dc8 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
      uVar15 = local_dc8[-2];
      goto LAB_1403d2e9a;
    }
    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_14035bed0(local_cd8,local_db8,*(undefined4 *)(uVar10 + 0x56c),&local_dc8);
    (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar9);
    FUN_1403555d0(&local_d10);
    puVar8 = local_dc8;
    if (((local_dc8 != (uint *)0x0) && (local_dc8 != (uint *)PTR_DAT_1405d8010)) &&
       (puVar11 = local_dc8 + -2, puVar11 != (uint *)0x0)) {
      uVar9 = FUN_14034fe70();
      local_ce8 = uVar9;
      FUN_14034ed40(uVar9);
      local_ce0 = 1;
      puVar8 = puVar8 + -1;
      *puVar8 = *puVar8 - 1;
      if (*puVar8 == 0) {
        FUN_14034ff60(puVar11);
      }
      FUN_14034edd0(uVar9);
      local_ce0 = 0;
    }
    local_dc8 = (uint *)PTR_DAT_1405d8010;
  }
  while (iVar13 = (int)uVar14, iVar13 != (int)local_d50) {
    if ((iVar13 < 0) || ((int)local_d50 <= iVar13)) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    lVar2 = local_d58 + (longlong)iVar13 * 0x48;
    *(undefined1 *)(lVar2 + 0x40) = 1;
    FUN_140383db0(lVar2,0);
    FUN_1403d5440(param_1,0,lVar2);
    if ((int)local_d50 <= iVar13) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    uVar14 = (ulonglong)(iVar13 + 1);
  }
  FUN_14038d7d0(&local_d68);
  if (local_d80 != 0) {
    plVar1 = (longlong *)(local_d80 + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140363af0(&local_d80,local_d80);
    }
  }
  local_d18 = &local_d98;
  FUN_140399690(&local_d98);
  if (local_d90 != 0) {
    if ((longlong)local_d88 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d88 = local_d88 & 0xffffffff00000000;
  }
LAB_1403d3030:
  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_14034ff60(local_dc0);
  }
  local_d18 = (undefined8 *)local_d38;
  FUN_140399690(local_d38);
  if ((local_d30 != 0) && (local_d24 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



void FUN_1403d30c0(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_140384b70(param_3,local_res20);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = FUN_1403840e0(param_3,local_e0,4);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = FUN_140384780(param_3,&local_88);
  if (cVar4 == '\0') {
    return;
  }
  if ((int)local_88 < 0) {
    return;
  }
  if (DAT_1405d8140 <= (int)local_88) {
    return;
  }
  FUN_1403841b0(local_d8);
  cVar4 = FUN_140384410(param_3,local_d8,local_88 & 0xffffffff);
  if (cVar4 == '\0') {
    local_res18 = &local_d0;
    FUN_140399690(&local_d0);
    if (local_c8 == (void *)0x0) {
      return;
    }
    if (-1 < local_bc) {
      return;
    }
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  FUN_1403b68a0(*(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_1403d36c9;
  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_1403996d0();
  *(undefined8 *)(local_110 + 0x28) = 1;
  if (local_d0 == 0) {
    iVar12 = local_c0;
    if (local_c8 == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  else {
    iVar12 = *(int *)(local_d0 + 0x18);
  }
  if (iVar12 < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (local_108 == (void *)0x0) {
    if (iVar12 < 1) {
      if (local_110 == 0) goto LAB_1403d32d5;
      iVar12 = 0;
    }
    else if (local_110 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    FUN_1400179d0(local_110,iVar12);
  }
  else {
    if (local_100._4_4_ < iVar12) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_100 = CONCAT44(local_100._4_4_,iVar12);
  }
LAB_1403d32d5:
  if (local_d0 == 0) {
    if (local_c8 == (void *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
  }
  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_140399790();
    }
    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_140399790();
    }
    _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_1403e31e0((longlong)pvVar10 + 0x638,&local_118,&local_b0,&local_res18);
  if ((int)local_res18 != 0) {
    FUN_14034fe70();
    local_128 = (uint *)PTR_DAT_1405d8010;
    uVar5 = FUN_14034fcf0(L"Stream Extract Error at Reliable UDP");
    pvVar10 = pvVar13;
    if ((local_128 != (uint *)0x0) &&
       (pvVar10 = (void *)0x0, local_128 != (uint *)PTR_DAT_1405d8010)) {
      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_1405d8010)) {
      uVar7 = local_128[-2];
    }
    uVar14 = 1;
    if (1 < (int)uVar7) {
      uVar14 = uVar7;
    }
    uVar7 = uVar6;
    if ((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1405d8010)) {
      uVar7 = local_128[-2];
    }
    if ((int)uVar7 < (int)uVar14) {
      if (local_128 == (uint *)0x0) {
        local_128 = (uint *)PTR_DAT_1405d8010;
      }
      if ((int)uVar14 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (uVar14 == 0) {
        FUN_1400031d0(&local_128);
      }
      else {
        uVar7 = uVar15;
        if ((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1405d8010)) {
          uVar7 = local_128[-2];
        }
        if (uVar14 != uVar7) {
          puVar8 = (uint *)FUN_14034fef0((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_1405d8010)) {
            uVar7 = local_128[-2];
          }
          puVar11 = (uint *)PTR_DAT_1405d8010;
          if ((int)uVar14 < (int)uVar7) {
LAB_1403d3485:
            if (local_128 != (uint *)0x0) {
              puVar11 = local_128;
            }
          }
          else {
            uVar14 = uVar15;
            if (local_128 != (uint *)0x0) {
              if (local_128 != (uint *)PTR_DAT_1405d8010) {
                uVar14 = local_128[-2];
              }
              goto LAB_1403d3485;
            }
          }
          FUN_14034fd20(puVar8 + 2,puVar11,uVar14);
          FUN_1400031d0(&local_128);
          local_128 = puVar8 + 2;
        }
      }
    }
    FUN_140002e10(&local_128);
    puVar8 = local_128;
    if (local_128 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar8,L"Stream Extract Error at Reliable UDP",uVar5);
    puVar8 = local_128;
    if (local_128 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1405d8010;
    }
    uVar5 = FUN_14034fcf0(puVar8);
    uVar15 = 0;
    if (0 < (int)uVar5) {
      uVar15 = uVar5;
    }
    uVar5 = uVar6;
    if ((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1405d8010)) {
      uVar5 = local_128[-2];
    }
    if (((int)uVar15 < (int)uVar5) || (uVar15 = uVar6, local_128 == (uint *)0x0)) {
LAB_1403d3521:
      if (((local_128 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
      uVar15 = local_128[-2];
      goto LAB_1403d3521;
    }
    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_14035bed0(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_1403555d0(&local_80);
    puVar8 = local_128;
    if (((local_128 != (uint *)0x0) && (local_128 != (uint *)PTR_DAT_1405d8010)) &&
       (puVar11 = local_128 + -2, puVar11 != (uint *)0x0)) {
      uVar9 = FUN_14034fe70();
      local_58 = uVar9;
      FUN_14034ed40(uVar9);
      local_50 = 1;
      puVar8 = puVar8 + -1;
      *puVar8 = *puVar8 - 1;
      if (*puVar8 == 0) {
        FUN_14034ff60(puVar11);
      }
      FUN_14034edd0(uVar9);
      local_50 = 0;
    }
    local_128 = (uint *)PTR_DAT_1405d8010;
  }
  while (iVar12 = (int)pvVar13, iVar12 != (int)local_98) {
    if ((iVar12 < 0) || ((int)local_98 <= iVar12)) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    *(undefined1 *)(local_a0 + (longlong)iVar12 * 0x48 + 0x40) = 1;
    FUN_1403d5440(param_1,param_2);
    if ((int)local_98 <= iVar12) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    pvVar13 = (void *)(ulonglong)(iVar12 + 1);
  }
  FUN_14038d7d0(&local_b0);
  if (local_f8 != 0) {
    plVar1 = (longlong *)(local_f8 + 8);
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_140363af0(&local_f8,local_f8);
    }
  }
  local_40 = &local_110;
  FUN_140399690(&local_110);
  if (local_108 != (void *)0x0) {
    if ((longlong)local_100 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_100 = local_100 & 0xffffffff00000000;
  }
LAB_1403d36c9:
  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_14034ff60(local_120);
  }
  local_res18 = &local_d0;
  FUN_140399690(&local_d0);
  if ((local_c8 != (void *)0x0) && (local_bc < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



void FUN_1403d3750(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_1403b8ef0(lVar7,0,&DAT_140469008);
  }
  lVar7 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
  uVar12 = 0;
  uVar11 = uVar12;
  if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
    uVar11 = **(ulonglong **)(lVar7 + 0x128);
  }
  cVar2 = FUN_140357380(uVar11);
  iVar6 = 0;
  if (cVar2 != '\0') {
    uVar9 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    FUN_1403dd830(uVar9);
    uVar9 = FUN_14035a290(*(longlong *)(param_1 + 0x108) + 0x1620);
    *(undefined8 *)(param_1 + 200) = uVar9;
    lVar7 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    uVar11 = uVar12;
    if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
      uVar11 = **(ulonglong **)(lVar7 + 0x128);
    }
    FUN_1403549a0(uVar11);
    lVar7 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    uVar11 = uVar12;
    if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
      uVar11 = **(ulonglong **)(lVar7 + 0x128);
    }
    FUN_1403549b0(uVar11,0);
    lVar7 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    uVar11 = uVar12;
    if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
      uVar11 = **(ulonglong **)(lVar7 + 0x128);
    }
    FUN_140354aa0(uVar11,0);
    local_res8 = &local_res10;
    lVar7 = *(longlong *)(param_1 + 0x108);
    FUN_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    FUN_140003100(&local_res10,lVar7 + 0x1588);
    lVar7 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    if (*(ulonglong **)(lVar7 + 0x128) != (ulonglong *)0x0) {
      uVar12 = **(ulonglong **)(lVar7 + 0x128);
    }
    iVar6 = FUN_140355d00(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_1403d3a1d;
  }
  FUN_14034fe70();
  local_res8 = (undefined **)PTR_DAT_1405d8010;
  iVar3 = FUN_14034fcf0(L"Cannot bind TCP socket to a local address!");
  if ((local_res8 != (undefined **)0x0) &&
     (uVar12 = 0, local_res8 != (undefined **)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    iVar5 = *(int *)(local_res8 + -1);
  }
  iVar13 = 1;
  if (1 < iVar5) {
    iVar13 = iVar5;
  }
  iVar5 = iVar4;
  if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1405d8010)) {
    iVar5 = *(int *)(local_res8 + -1);
  }
  if (iVar5 < iVar13) {
    if (local_res8 == (undefined **)0x0) {
      local_res8 = (undefined **)PTR_DAT_1405d8010;
    }
    if (iVar13 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (iVar13 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      iVar5 = iVar6;
      if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1405d8010)) {
        iVar5 = *(int *)(local_res8 + -1);
      }
      if (iVar13 != iVar5) {
        piVar8 = (int *)FUN_14034fef0((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_1405d8010)) {
          iVar5 = *(int *)(local_res8 + -1);
        }
        ppuVar10 = (undefined **)PTR_DAT_1405d8010;
        if (iVar13 < iVar5) {
LAB_1403d38c3:
          if (local_res8 != (undefined **)0x0) {
            ppuVar10 = local_res8;
          }
        }
        else {
          iVar13 = iVar6;
          if (local_res8 != (undefined **)0x0) {
            if (local_res8 != (undefined **)PTR_DAT_1405d8010) {
              iVar13 = *(int *)(local_res8 + -1);
            }
            goto LAB_1403d38c3;
          }
        }
        FUN_14034fd20(piVar8 + 2,ppuVar10,iVar13);
        FUN_1400031d0(&local_res8);
        local_res8 = (undefined **)(piVar8 + 2);
      }
    }
  }
  FUN_140002e10(&local_res8);
  ppuVar10 = local_res8;
  if (local_res8 == (undefined **)0x0) {
    ppuVar10 = (undefined **)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(ppuVar10,L"Cannot bind TCP socket to a local address!",iVar3);
  ppuVar10 = local_res8;
  if (local_res8 == (undefined **)0x0) {
    ppuVar10 = (undefined **)PTR_DAT_1405d8010;
  }
  iVar3 = FUN_14034fcf0(ppuVar10);
  iVar6 = 0;
  if (0 < iVar3) {
    iVar6 = iVar3;
  }
  iVar3 = iVar4;
  if ((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1405d8010)) {
    iVar3 = *(int *)(local_res8 + -1);
  }
  if ((iVar6 < iVar3) || (iVar6 = iVar4, local_res8 == (undefined **)0x0)) {
LAB_1403d3959:
    if (((local_res8 != (undefined **)PTR_DAT_1405d8010) && (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_1405d8010) {
    iVar6 = *(int *)(local_res8 + -1);
    goto LAB_1403d3959;
  }
  local_48 = 0;
  local_40 = 0;
  local_38 = 0;
  local_30 = 0;
  local_50 = Proud::ByteArray::vftable;
  uVar9 = FUN_14035bed0(local_res18,3,0,&local_res8,&local_50);
  (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar9);
  FUN_1403555d0(&local_50);
  ppuVar10 = local_res8;
  if (((local_res8 != (undefined **)0x0) && (local_res8 != (undefined **)PTR_DAT_1405d8010)) &&
     (ppuVar1 = local_res8 + -1, ppuVar1 != (undefined **)0x0)) {
    uVar9 = FUN_14034fe70();
    FUN_14034ed40(uVar9);
    piVar8 = (int *)((longlong)ppuVar10 + -4);
    *piVar8 = *piVar8 + -1;
    if (*piVar8 == 0) {
      FUN_14034ff60(ppuVar1);
    }
    FUN_14034edd0(uVar9);
  }
  iVar6 = Ordinal_111();
LAB_1403d3a1d:
  FUN_1403ce780(param_1,iVar6);
  return;
}



void FUN_1403d3ba0(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_1403d8830();
    FUN_1403d8950(param_1[0x56]);
  }
  plVar1 = (longlong *)param_1[0x52];
  if ((plVar1 != (longlong *)0x0) && (*plVar1 != 0)) {
    if (plVar1 == (longlong *)0x0) {
      lVar4 = 0;
    }
    else {
      lVar4 = *plVar1;
    }
    FUN_1403eac60(lVar4);
    uVar5 = 0;
    if ((undefined8 *)param_1[0x52] != (undefined8 *)0x0) {
      uVar5 = *(undefined8 *)param_1[0x52];
    }
    FUN_1403eb450(uVar5);
  }
  *(undefined1 *)(param_1 + 0x10) = 1;
  if ((undefined8 *)param_1[0xf] == (undefined8 *)0x0) {
    uVar5 = 0;
  }
  else {
    uVar5 = *(undefined8 *)param_1[0xf];
  }
  FUN_140357460(uVar5);
  pvVar2 = (void *)param_1[0x57];
  if (pvVar2 != (void *)0x0) {
    FUN_1403596c0(pvVar2);
    operator_delete(pvVar2);
  }
  param_1[0x57] = 0;
  timeKillEvent(*(UINT *)(param_1 + 0x4c));
  pvVar2 = (void *)param_1[0x56];
  if (pvVar2 != (void *)0x0) {
    FUN_1403db5d0(pvVar2);
    operator_delete(pvVar2);
  }
  param_1[0x56] = 0;
  FUN_1403b8150(param_1 + 0x45);
  pvVar2 = (void *)param_1[0x57];
  if (pvVar2 != (void *)0x0) {
    FUN_1403596c0(pvVar2);
    operator_delete(pvVar2);
  }
  param_1[0x57] = 0;
  pvVar2 = (void *)param_1[0x56];
  if (pvVar2 != (void *)0x0) {
    FUN_1403db5d0(pvVar2);
    operator_delete(pvVar2);
  }
  FUN_1403ceba0(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_14034ff60(plVar1);
  }
  FUN_1403b8150(param_1 + 0x45);
  puVar3 = (undefined8 *)param_1[0x45];
  if (puVar3 != (undefined8 *)0x0) {
    (**(code **)*puVar3)(puVar3,1);
  }
  FUN_140359460(param_1 + 0x41);
  FUN_14034edf0(param_1 + 0x39);
  FUN_14034edf0(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_1403574e0(pvVar2);
      operator_delete(pvVar2);
    }
    FUN_14034ff60(puVar3);
  }
  FUN_14034edf0(param_1 + 2);
  param_1[1] = Proud::ISendSpeedMeasurerDg::vftable;
  *param_1 = Proud::ICompletionPortEventSink::vftable;
  return;
}



void FUN_1403d3e10(longlong param_1)

{
  FUN_1403d3ff0(param_1 + -8);
  return;
}



void FUN_1403d3e20(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1400031d0(param_3);
  return;
}



void FUN_1403d3e30(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_1403b8290(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_14034ff60(param_2);
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403d3fcf)
// WARNING: Removing unreachable block (ram,0x0001403d3fda)
// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403d3f10(longlong param_1)

{
  undefined8 *puVar1;
  longlong lVar2;
  undefined8 *puVar3;
  
  if (*(double *)(param_1 + 0xc0) - *(double *)(param_1 + 0x248) <= _DAT_1405d81c0) {
    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_1403d3fca:
      puVar3 = (undefined8 *)*puVar3;
    }
    lVar2 = 0;
    if ((longlong *)puVar3[2] != (longlong *)0x0) {
      lVar2 = *(longlong *)puVar3[2];
    }
    if (*(char *)(lVar2 + 0x40) != '\0') goto LAB_1403d3fca;
    puVar1 = (undefined8 *)*puVar3;
    FUN_1403b8220(param_1 + 0x228,puVar3);
    puVar3 = puVar1;
  } while( true );
}



undefined8 FUN_1403d3ff0(undefined8 param_1,uint param_2)

{
  FUN_1403d3ba0();
  if ((param_2 & 1) != 0) {
    FUN_14034ff60(param_1);
  }
  return param_1;
}



void FUN_1403d4020(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_1400902d0(param_2,puVar4 + 1);
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x1570);
  puVar4 = puVar5;
  if (plVar1 != (longlong *)0x0) {
    puVar4 = (undefined8 *)*plVar1;
  }
  FUN_1403d7450(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_14034fef0(0x60);
  puVar4 = puVar5;
  if (local_res8 != (undefined8 *)0x0) {
    puVar4 = (undefined8 *)FUN_14035bca0(local_res8);
  }
  if (puVar4 == (undefined8 *)0x0) {
    local_res8 = (undefined8 *)0x0;
  }
  else {
    puVar5 = (undefined8 *)FUN_14034fef0(0x48);
    if (puVar5 != (undefined8 *)0x0) {
      local_res8 = puVar5;
      uVar3 = FUN_1403c0cc0();
      FUN_14034ec60(puVar5,uVar3,1);
    }
    local_res8 = puVar5;
    FUN_14034ed40(puVar5);
    puVar5[8] = 1;
    puVar5[7] = puVar4;
    FUN_14034edd0(puVar5);
  }
  FUN_14035bda0(local_120,&local_res8);
  if (puVar5 != (undefined8 *)0x0) {
    local_38 = puVar5;
    FUN_14034ed40(puVar5);
    local_30 = 1;
    plVar1 = puVar5 + 8;
    *plVar1 = *plVar1 + -1;
    if (*plVar1 == 0) {
      FUN_14034edd0(puVar5);
      local_30 = 0;
      FUN_14012c7d0(puVar5);
    }
    else {
      FUN_14034edd0(puVar5);
    }
  }
  local_128[0] = 0xd;
  local_b8 = 1;
  FUN_1403c0f30(*(undefined8 *)(param_1 + 0x108),local_128);
  lVar2 = *(longlong *)(param_1 + 0x108);
  if ((*(char *)(lVar2 + 0x1790) != '\0') || (*(int *)(lVar2 + 0x6c8) != 0)) {
    FUN_1403b8ef0(lVar2,1,&DAT_1404690f0,*(undefined4 *)(lVar2 + 0x1578));
  }
  FUN_1403555d0(&local_68);
  FUN_1403555d0(&local_b0);
  local_res8 = &local_d8;
  FUN_140399690(&local_d8);
  if (local_d0 != 0) {
    if ((longlong)local_c8 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_c8 = local_c8 & 0xffffffff00000000;
  }
  FUN_1403555d0(&local_100);
  FUN_140376ab0(&local_108);
  FUN_140376a30(&local_110);
  FUN_14012c7f0(local_120);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403d42c0(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_1405d84f0 ^ (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_1403996d0();
  *(undefined8 *)(local_468 + 0x28) = 1;
  local_428 = Proud::AddrPort::vftable;
  local_420 = 0;
  local_41c = 0;
  cVar2 = FUN_140384b70(param_2,local_440);
  if (cVar2 != '\0') {
    local_258 = 0;
    local_254 = 0;
    local_250 = 0;
    local_24c = 0;
    cVar2 = FUN_1403840e0(param_2,&local_258,0x10);
    if ((((cVar2 != '\0') && (cVar2 = FUN_140384780(param_2,&local_410), cVar2 != '\0')) &&
        (iVar3 = (int)local_410, -1 < iVar3)) && (iVar3 <= DAT_1405d8140)) {
      if (local_460 == (undefined *)0x0) {
        if (iVar3 < 1) {
          if (local_468 == 0) goto LAB_1403d48f7;
          uVar12 = 0;
        }
        else {
          if (local_468 == 0) {
                    // WARNING: Subroutine does not return
            FUN_140399790();
          }
          uVar12 = local_410 & 0xffffffff;
        }
        FUN_1400179d0(local_468,uVar12);
      }
      else {
        if (local_458._4_4_ < iVar3) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_458 = CONCAT44(local_458._4_4_,iVar3);
      }
      puVar13 = local_460;
      if (local_460 == (undefined *)0x0) {
        if (local_468 == 0) {
LAB_1403d48f7:
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        puVar13 = puVar17;
        if (*(int *)(local_468 + 0x18) != 0) {
          puVar13 = *(undefined **)(local_468 + 0x10);
        }
      }
      cVar2 = FUN_1403840e0(param_2,puVar13,local_410 & 0xffffffff);
      if ((cVar2 != '\0') && (cVar2 = FUN_140384b10(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_1403ab430();
          *(undefined4 *)(lVar6 + 0x108) = local_420;
          *(undefined2 *)(lVar6 + 0x10c) = local_41c;
        }
        uVar7 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
        local_3a8 = uVar7;
        FUN_14034ed40(uVar7);
        local_3a0 = 1;
        FUN_140376e10(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_140399690(&local_2f8);
          if (local_468 != 0) {
            *(longlong *)(local_468 + 0x28) = *(longlong *)(local_468 + 0x28) + 1;
            local_2f8 = local_468;
          }
        }
        local_2d8 = 1;
        uVar8 = FUN_140017750(local_368,*(longlong *)(param_1 + 0x108) + 0x1588);
        lVar6 = FUN_140353280(local_358,uVar8,
                              *(undefined2 *)(*(longlong *)(param_1 + 0x108) + 0x1590));
        local_298 = *(undefined4 *)(lVar6 + 8);
        local_294 = *(undefined2 *)(lVar6 + 0xc);
        FUN_1403c0f30(*(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_14034ed40(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_1405f2490,local_450);
          FUN_14034edd0(lVar6);
        }
        FUN_140376ec0(local_348);
        FUN_14034edd0(uVar7);
        lVar6 = *(longlong *)(param_1 + 0x108);
        if ((*(char *)(lVar6 + 0x1790) != '\0') || (*(int *)(lVar6 + 0x6c8) != 0)) {
          FUN_1403b8ef0(lVar6,1,&DAT_1404691d8,*(undefined4 *)(lVar6 + 0x1578));
        }
        if ((*(int *)(*(longlong *)(param_1 + 0x108) + 0x1578) == 0x32) &&
           (iVar3 = FUN_140359f30(),
           iVar3 == (iVar3 / 3 + (iVar3 >> 0x1f) +
                    (int)(((longlong)iVar3 / 3 + ((longlong)iVar3 >> 0x3f) & 0xffffffffU) >> 0x1f))
                    * 3)) {
          FUN_14034fe70();
          puVar13 = PTR_DAT_1405d8010;
          local_438 = PTR_DAT_1405d8010;
          GetModuleFileNameW((HMODULE)0x0,local_248,0x104);
          plVar11 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x15d8);
          if ((plVar11 != (longlong *)0x0) && (*plVar11 != 0)) {
            lVar6 = FUN_1403ab430();
            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_1405d8010;
            }
            puVar16 = (undefined *)*plVar9;
            if ((undefined *)*plVar9 == (undefined *)0x0) {
              puVar16 = PTR_DAT_1405d8010;
            }
            local_488 = (undefined ***)local_248;
            FUN_140017720(&local_438,L"Usage: %s ## %s ## %s",puVar16,puVar13);
            if (((local_430 != (undefined *)0x0) && (local_430 != PTR_DAT_1405d8010)) &&
               (local_430 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_14034fe70();
              local_388 = uVar7;
              FUN_14034ed40(uVar7);
              local_380 = 1;
              piVar1 = (int *)(local_430 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_430 + -8);
              }
              FUN_14034edd0(uVar7);
            }
            local_430 = PTR_DAT_1405d8010;
            if (((local_418 != (undefined *)0x0) && (local_418 != PTR_DAT_1405d8010)) &&
               (local_418 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_14034fe70();
              local_3c8 = uVar7;
              FUN_14034ed40(uVar7);
              local_3c0 = 1;
              piVar1 = (int *)(local_418 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_418 + -8);
              }
              FUN_14034edd0(uVar7);
            }
            FUN_14034fe70();
            puVar13 = local_438;
            local_448 = PTR_DAT_1405d8010;
            if (PTR_DAT_1405d8010 == (undefined *)0x0) {
              local_448 = puVar17;
            }
            if (local_438 != PTR_DAT_1405d8010) {
              uVar7 = FUN_14034fe70();
              local_3b8 = uVar7;
              FUN_14034ed40(uVar7);
              local_3b0 = 1;
              FUN_1400031d0(&local_448);
              local_448 = puVar13;
              if (((puVar13 != PTR_DAT_1405d8010) && (puVar13 != (undefined *)0x0)) &&
                 (puVar13 != (undefined *)0x8)) {
                *(int *)(puVar13 + -4) = *(int *)(puVar13 + -4) + 1;
              }
              FUN_14034edd0(uVar7);
            }
            FUN_140352d80(&local_448);
          }
          if (((puVar13 != (undefined *)0x0) && (puVar13 != PTR_DAT_1405d8010)) &&
             (puVar13 + -8 != (undefined *)0x0)) {
            uVar7 = FUN_14034fe70();
            local_398 = uVar7;
            FUN_14034ed40(uVar7);
            local_390 = 1;
            piVar1 = (int *)(puVar13 + -4);
            *piVar1 = *piVar1 + -1;
            if (*piVar1 == 0) {
              FUN_14034ff60(puVar13 + -8);
            }
            FUN_14034edd0(uVar7);
          }
        }
        FUN_140399690(&local_468);
        if (local_460 == (undefined *)0x0) {
          return;
        }
        if (-1 < local_458) {
          return;
        }
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
  }
  FUN_14034fe70();
  local_470 = (uint *)PTR_DAT_1405d8010;
  uVar4 = FUN_14034fcf0(L"Bad format in NotifyServerConnectSuccess");
  if ((local_470 != (uint *)0x0) &&
     (puVar17 = (undefined *)0x0, local_470 != (uint *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    uVar5 = local_470[-2];
  }
  uVar15 = 1;
  if (1 < (int)uVar5) {
    uVar15 = uVar5;
  }
  uVar5 = uVar18;
  if ((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1405d8010)) {
    uVar5 = local_470[-2];
  }
  if ((int)uVar5 < (int)uVar15) {
    if (local_470 == (uint *)0x0) {
      local_470 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar15 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar15 == 0) {
      FUN_1400031d0(&local_470);
    }
    else {
      uVar5 = uVar18;
      if ((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1405d8010)) {
        uVar5 = local_470[-2];
      }
      if (uVar15 != uVar5) {
        puVar10 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar5 = local_470[-2];
        }
        puVar14 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar15 < (int)uVar5) {
LAB_1403d49fc:
          if (local_470 != (uint *)0x0) {
            puVar14 = local_470;
          }
        }
        else {
          uVar15 = uVar18;
          if (local_470 != (uint *)0x0) {
            if (local_470 != (uint *)PTR_DAT_1405d8010) {
              uVar15 = local_470[-2];
            }
            goto LAB_1403d49fc;
          }
        }
        FUN_14034fd20(puVar10 + 2,puVar14,uVar15);
        FUN_1400031d0(&local_470);
        local_470 = puVar10 + 2;
      }
    }
  }
  FUN_140002e10(&local_470);
  puVar10 = local_470;
  if (local_470 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar10,L"Bad format in NotifyServerConnectSuccess",uVar4);
  puVar10 = local_470;
  if (local_470 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1405d8010;
  }
  uVar5 = FUN_14034fcf0(puVar10);
  uVar4 = 0;
  if (0 < (int)uVar5) {
    uVar4 = uVar5;
  }
  uVar5 = uVar18;
  if ((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1405d8010)) {
    uVar5 = local_470[-2];
  }
  if (((int)uVar5 <= (int)uVar4) && (uVar4 = uVar18, local_470 != (uint *)0x0)) {
    if (local_470 == (uint *)PTR_DAT_1405d8010) goto LAB_1403d4ab6;
    uVar4 = local_470[-2];
  }
  if (((local_470 != (uint *)PTR_DAT_1405d8010) && (local_470 != (uint *)0x0)) &&
     (local_470 + -2 != (uint *)0x0)) {
    local_470[-2] = uVar4;
    *(undefined2 *)((longlong)local_470 + (longlong)(int)uVar4 * 2) = 0;
  }
LAB_1403d4ab6:
  local_400 = 0;
  local_3f8 = 0;
  local_3f0 = 0;
  local_3e8 = 0;
  local_408 = Proud::ByteArray::vftable;
  local_488 = &local_408;
  uVar7 = FUN_14035bed0(local_3d0,8,1,&local_470);
  FUN_1403c3f90(*(undefined8 *)(param_1 + 0x108),0x1f,uVar7);
  FUN_1403555d0(&local_408);
  puVar10 = local_470;
  if (((local_470 != (uint *)0x0) && (local_470 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar14 = local_470 + -2, puVar14 != (uint *)0x0)) {
    uVar7 = FUN_14034fe70();
    local_3e0 = uVar7;
    FUN_14034ed40(uVar7);
    local_3d8 = 1;
    puVar10 = puVar10 + -1;
    *puVar10 = *puVar10 - 1;
    if (*puVar10 == 0) {
      FUN_14034ff60(puVar14);
    }
    FUN_14034edd0(uVar7);
    local_3d8 = 0;
  }
  local_470 = (uint *)PTR_DAT_1405d8010;
  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_140399690(&local_468);
  if ((local_460 != (undefined *)0x0) && (local_458 < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403d4bf0(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_1403840e0(param_2,&local_res18,8);
  if ((cVar2 != '\0') && (cVar2 = FUN_1403840e0(param_2,&local_res20,8), cVar2 != '\0')) {
    uVar3 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
    local_28 = uVar3;
    FUN_14034ed40(uVar3);
    local_20 = 1;
    dVar4 = (double)FUN_14035a290(*(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_1405d8108 + *(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_1403c0f30(*(undefined8 *)(param_1 + 0x108),local_118);
    FUN_140376ec0(local_118);
    FUN_14034edd0(uVar3);
  }
  return;
}



void FUN_1403d4dc0(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_1403b7da0(*(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_140383db0(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_140383db0(param_2,iVar9);
      FUN_1403841b0(local_1b8);
      local_188 = Proud::AddrPort::vftable;
      local_178 = 0;
      lVar8 = 0;
      local_190 = 0;
      local_180 = DAT_1405d83d0;
      local_17c = DAT_1405d83d4;
      FUN_140383c40(local_1b8);
      if (*(longlong *)(param_2 + 2) == 0) {
        if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        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_140399790();
        }
        lVar7 = lVar8;
        if (*(int *)(lVar1 + 0x18) != 0) {
          lVar7 = *(longlong *)(lVar1 + 0x10);
        }
      }
      FUN_140384750(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_1403996d0();
        *(undefined8 *)(local_1b0 + 0x28) = 1;
      }
      (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
      FUN_1403841e0(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_140376e10(local_100);
      local_150[0] = 1;
      lVar7 = *(longlong *)(param_1 + 0x108);
      uVar5 = FUN_1403bfd00(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_140376ec0(local_100);
      local_res8 = &local_140;
      FUN_140399690(&local_140);
      if (local_138 != 0) {
        if (local_12c < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_130 = 0;
      }
      if ((local_190 != 1) && (local_190 != 0)) {
        uVar5 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
        local_168 = uVar5;
        FUN_14034ed40(uVar5);
        local_160 = 1;
        plVar6 = (longlong *)FUN_1403b68a0(*(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_14034ff60(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_14034edd0(uVar5);
      }
      local_res8 = &local_1b0;
      FUN_140399690(&local_1b0);
      if ((local_1a8 != 0) && (local_19c < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    }
  }
  return;
}



void FUN_1403d5140(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_1403841b0(local_208);
  local_1d8 = Proud::AddrPort::vftable;
  local_1c8 = 0;
  lVar8 = 0;
  local_1e0 = 0;
  local_1d0 = DAT_1405d83d0;
  local_1cc = DAT_1405d83d4;
  FUN_140383c40(local_208);
  if (*(longlong *)(param_2 + 2) == 0) {
    if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_140399790();
    }
    lVar7 = lVar8;
    if (*(int *)(lVar2 + 0x18) != 0) {
      lVar7 = *(longlong *)(lVar2 + 0x10);
    }
  }
  FUN_140384750(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_14034f420(local_68,PTR_u_exception_due_to_not_using_Inter_1405d94c0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_68,(ThrowInfo *)&DAT_1405d36c0);
  }
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x78) + 0x10))();
  FUN_1403841e0(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_140376e10(local_150);
  local_1a0[0] = 2;
  lVar7 = *(longlong *)(param_1 + 0x108);
  uVar5 = FUN_1403bfd00(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_140376ec0(local_150);
  local_res10 = &local_190;
  FUN_140399690(&local_190);
  if (local_188 != 0) {
    if (local_17c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_180 = 0;
  }
  if ((local_1e0 != 1) && (local_1e0 != 0)) {
    uVar5 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
    local_1b8 = uVar5;
    FUN_14034ed40(uVar5);
    local_1b0 = 1;
    plVar6 = (longlong *)FUN_1403b68a0(*(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_14034ff60(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_14034edd0(uVar5);
  }
  local_res10 = &local_200;
  FUN_140399690(&local_200);
  if ((local_1f8 != 0) && (local_1ec < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



undefined8 FUN_1403d5440(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_140384a10(param_3,local_res18);
  if (cVar4 == '\0') goto LAB_1403d5a30;
  cVar4 = '\0';
  local_res8 = (undefined8 *)((ulonglong)local_res8 & 0xffffffffffffff00);
  switch(local_res18[0]) {
  case 1:
    FUN_1403d4dc0(param_1,param_3,&local_res8);
    cVar4 = (char)local_res8;
    goto switchD_1403d54c3_caseD_5;
  case 2:
    FUN_1403d5140(param_1,param_3,&local_res8);
    goto switchD_1403d54c3_caseD_5;
  case 3:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403ce570(param_1,param_3);
    }
    break;
  case 4:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403d1990(param_1,param_3);
    }
    break;
  default:
    goto switchD_1403d54c3_caseD_5;
  case 6:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403d2360(param_1,param_3);
    }
    break;
  case 8:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403ce5e0(param_1,param_3);
    }
    break;
  case 9:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403ce650(param_1,param_3);
    }
    break;
  case 10:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403d42c0(param_1,param_3);
    }
    break;
  case 0xb:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403ce4f0(param_1,param_3);
    }
    break;
  case 0xd:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403cff20(param_1,param_3);
    }
    break;
  case 0xf:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403d4020(param_1,param_3);
    }
    break;
  case 0x11:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403cf1e0(param_1,param_3);
    }
    break;
  case 0x13:
    FUN_1403d26e0(param_1,local_res10,param_3);
    break;
  case 0x17:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403d2af0(param_1,param_3);
    }
    break;
  case 0x18:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403cf350(param_1,local_res10,param_3);
    }
    break;
  case 0x19:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403d30c0(param_1,local_res10,param_3);
    }
    break;
  case 0x1c:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403d4bf0(param_1,param_3);
    }
    break;
  case 0x1d:
    break;
  case 0x1e:
    FUN_1403ce330(param_1,param_3);
    break;
  case 0x1f:
    FUN_1403ce370(param_1,param_3);
    break;
  case 0x20:
    FUN_1403d0be0(param_1,param_3);
    break;
  case 0x21:
    FUN_1403cf7f0(param_1,param_3);
    break;
  case 0x22:
    if ((param_3[10] == 1) || (param_3[10] == 0)) {
      FUN_1403d1400(param_1,local_res10,param_3);
    }
    break;
  case 0x23:
    FUN_1403d0250(param_1,local_res10,param_3);
    break;
  case 0x24:
  case 0x25:
    FUN_1403841b0(&local_78);
    local_48 = Proud::AddrPort::vftable;
    local_38 = 0;
    local_50 = 0;
    local_40 = DAT_1405d83d0;
    local_3c = DAT_1405d83d4;
    cVar5 = FUN_140387ec0(*(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_1403d5440(param_1,local_res10,&local_78);
    }
    local_res8 = &local_70;
    FUN_140399690(&local_70);
    if ((local_68 != 0) && (local_60._4_4_ < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    goto switchD_1403d54c3_caseD_5;
  case 0x26:
    FUN_1403841b0(&local_78);
    local_48 = Proud::AddrPort::vftable;
    local_38 = 0;
    local_50 = 0;
    local_40 = DAT_1405d83d0;
    local_3c = DAT_1405d83d4;
    cVar5 = FUN_1403862f0(*(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_1403d5440(param_1,local_res10,&local_78);
    }
    local_res8 = &local_70;
    FUN_140399690(&local_70);
    if ((local_68 != 0) && (local_60._4_4_ < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    goto switchD_1403d54c3_caseD_5;
  case 0x27:
    FUN_1403d0e90(param_1,local_res10,param_3);
    break;
  case 0x28:
    FUN_1403cf960(param_1,param_3);
  }
  cVar4 = '\x01';
switchD_1403d54c3_caseD_5:
  if (*(longlong *)(param_3 + 2) == 0) {
    if (*(longlong *)(param_3 + 4) == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    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_14034fe70();
      local_res8 = (undefined8 *)PTR_DAT_1405d8010;
      FUN_140017720(&local_res8,&DAT_1404692a8,
                    L"Proud::CNetClientWorker::ProcessMessage_ProudNetLayer",local_res18[0]);
      iVar6 = FUN_14035fc20(param_3);
      local_res20 = FUN_140383d70(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_14034f7d0();
      }
      FUN_1400179d0(&local_78,iVar6);
      lVar8 = local_68;
      if ((int)local_60 == 0) {
        lVar8 = 0;
      }
      FUN_14000d3f0(lVar8,local_res20,(longlong)iVar6);
      local_78 = Proud::ByteArray::vftable;
      uVar7 = FUN_14035bed0(&local_res20,0x1f,param_3[10],&local_res8,&local_78);
      (**(code **)(**(longlong **)(param_1 + 0x108) + 0x80))(*(longlong **)(param_1 + 0x108),uVar7);
      FUN_1403555d0(&local_78);
      puVar3 = local_res8;
      if (((local_res8 != (undefined8 *)0x0) && (local_res8 != (undefined8 *)PTR_DAT_1405d8010)) &&
         (puVar1 = local_res8 + -1, puVar1 != (undefined8 *)0x0)) {
        uVar7 = FUN_14034fe70();
        FUN_14034ed40(uVar7);
        piVar2 = (int *)((longlong)puVar3 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar7);
      }
    }
  }
  else if (cVar4 == '\0') {
    iVar6 = (int)local_res20;
LAB_1403d5a30:
    FUN_140383db0(param_3,iVar6);
    return 0;
  }
  return 1;
}



void FUN_1403d5af0(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_14000d450(0x80004005);
    }
    FUN_1403841e0(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_1403d5440(param_1,param_2,local_78,param_4,uVar5);
    plVar3 = *(longlong **)(lVar1 + 0x6e8);
    if (plVar3 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    lVar2 = *plVar3;
    *(longlong *)(lVar1 + 0x6e8) = lVar2;
    if (lVar2 == 0) {
      *(undefined8 *)(lVar1 + 0x6f0) = 0;
    }
    else {
      *(undefined8 *)(lVar2 + 8) = 0;
    }
    FUN_140399690(plVar3 + 3);
    if (plVar3[4] != 0) {
      if (*(int *)((longlong)plVar3 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(undefined4 *)(plVar3 + 5) = 0;
    }
    plVar4 = *(longlong **)(lVar1 + 0x6e0);
    if (plVar4 == (longlong *)0x0) {
      FUN_14034ff60(plVar3);
    }
    else {
      (**(code **)(*plVar4 + 0x10))(plVar4,plVar3);
    }
    *(longlong *)(lVar1 + 0x6f8) = *(longlong *)(lVar1 + 0x6f8) + -1;
    FUN_140399690(local_70);
    if ((local_68 != 0) && (local_5c < 0)) break;
    lVar2 = *(longlong *)(lVar1 + 0x6f8);
  }
                    // WARNING: Subroutine does not return
  FUN_14034f7d0();
}



void FUN_1403d5ca0(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_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    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_140355540(uVar10);
    iVar6 = FUN_14039e640(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_1403b9fd0(*(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_14034f800();
        }
        lVar8 = *(longlong *)(param_1 + 0x108);
        uVar13 = FUN_1403d1350(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_14034f800();
        }
        uVar11 = (ulonglong)(iVar6 + 1);
      }
      if ((*(longlong *)(param_2 + 0x120) != 0) ||
         (lVar8 = FUN_1403ab410(*(undefined8 *)(param_1 + 0x108)), param_2 == lVar8)) {
        FUN_1403d5af0(param_1,param_2);
      }
      FUN_14038d7d0(&local_d0);
    }
    else if (iVar6 == 2) {
      puVar12 = local_res10;
      if (local_res10 == (undefined *)0x0) {
        puVar12 = PTR_DAT_1405d8010;
      }
      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_1405d8010)) &&
       (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
      uVar13 = FUN_14034fe70();
      local_68 = uVar13;
      FUN_14034ed40(uVar13);
      local_60 = 1;
      piVar2 = (int *)(puVar12 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar13);
    }
    local_res10 = PTR_DAT_1405d8010;
    if (local_e8 != 0) {
      FUN_14038a540();
    }
  }
  FUN_1403e1be0(param_2);
  return;
}



undefined8 FUN_1403d6000(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_14034ed40(uVar4);
  local_60 = 1;
  if (*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x1548) == 0) {
    FUN_14034edd0(uVar4);
    uVar4 = 0;
  }
  else {
    FUN_1403841b0(&local_b8);
    local_88 = Proud::AddrPort::vftable;
    local_78 = 0;
    local_80 = DAT_1405d83d0;
    local_7c = DAT_1405d83d4;
    local_90 = *(undefined4 *)(*(longlong *)(param_1 + 0x108) + 0x1578);
    puVar5 = (undefined4 *)FUN_1403d2660(*(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_140399690(&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_140399690(local_50);
    if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_140383db0(&local_b8,0);
    lVar2 = *(longlong *)(param_1 + 0x108);
    uVar3 = *(undefined8 *)(lVar2 + 0x6f0);
    plVar1 = *(longlong **)(lVar2 + 0x6e0);
    if (plVar1 == (longlong *)0x0) {
      puVar6 = (undefined8 *)FUN_14034fef0(0x58);
    }
    else {
      puVar6 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x58);
    }
    if (puVar6 != (undefined8 *)0x0) {
      FUN_1403841e0(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_1403d5af0(param_1,0);
    FUN_140399690(&local_b0);
    if (local_a8 != 0) {
      if (local_9c < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_a0 = 0;
    }
    FUN_14034edd0(uVar4);
    uVar4 = 1;
  }
  return uVar4;
}



void FUN_1403d6250(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_1403ab430(*(undefined8 *)(param_1 + 0x108));
  *(undefined1 *)(lVar10 + 0xc0) = 0;
  if (*(int *)(param_2 + 8) < 1) {
    FUN_14034fe70();
    local_res10 = PTR_DAT_1405d8010;
    FUN_140017720(&local_res10,L"compeltedlength < 0 recvcomplete errorcode:%d",
                  *(undefined4 *)(param_2 + 0xc));
    FUN_1403c3c70(*(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_1405d8010)) &&
       (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
      uVar17 = FUN_14034fe70();
      FUN_14034ed40(uVar17);
      piVar2 = (int *)(puVar4 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar1);
      }
      FUN_14034edd0(uVar17);
    }
    local_res10 = PTR_DAT_1405d8010;
    goto LAB_1403d6767;
  }
  lVar10 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
  uVar14 = 0;
  uVar12 = uVar14;
  if (*(ulonglong **)(lVar10 + 0x128) != (ulonglong *)0x0) {
    uVar12 = **(ulonglong **)(lVar10 + 0x128);
  }
  cVar5 = FUN_140355560(uVar12);
  uVar15 = 0;
  if (cVar5 == '\0') {
    uVar17 = (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x108) + 0x70) + 0x1c0))();
    *(undefined8 *)(*(longlong *)(param_1 + 0x108) + 0x18c0) = uVar17;
    lVar10 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    uVar12 = uVar14;
    if (*(ulonglong **)(lVar10 + 0x128) != (ulonglong *)0x0) {
      uVar12 = **(ulonglong **)(lVar10 + 0x128);
    }
    uVar17 = FUN_140355540(uVar12);
    lVar10 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    FUN_1403a9e50(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_1403ba480(*(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_14034f800();
      }
      lVar10 = *(longlong *)(param_1 + 0x108);
      uVar17 = FUN_1403d1350(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_14034f800();
      }
      uVar14 = (ulonglong)(iVar9 + 1);
    }
    FUN_1403d5af0(param_1,0);
    FUN_14038d7d0(&local_50);
    goto LAB_1403d6767;
  }
  if (3 < *(int *)(param_1 + 0x100)) goto LAB_1403d6767;
  FUN_14034fe70();
  local_res8 = (uint *)PTR_DAT_1405d8010;
  uVar6 = FUN_14034fcf0(L"close socket completion");
  if ((local_res8 != (uint *)0x0) && (uVar14 = 0, local_res8 != (uint *)PTR_DAT_1405d8010)) {
    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_1405d8010)) {
    uVar8 = local_res8[-2];
  }
  uVar16 = 1;
  if (1 < (int)uVar8) {
    uVar16 = uVar8;
  }
  uVar8 = uVar7;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar8 = local_res8[-2];
  }
  if ((int)uVar8 < (int)uVar16) {
    if (local_res8 == (uint *)0x0) {
      local_res8 = (uint *)PTR_DAT_1405d8010;
    }
    if ((int)uVar16 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar16 == 0) {
      FUN_1400031d0(&local_res8);
    }
    else {
      uVar8 = uVar15;
      if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
        uVar8 = local_res8[-2];
      }
      if (uVar16 != uVar8) {
        puVar11 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar8 = local_res8[-2];
        }
        puVar13 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar16 < (int)uVar8) {
LAB_1403d64bc:
          if (local_res8 != (uint *)0x0) {
            puVar13 = local_res8;
          }
        }
        else {
          uVar16 = uVar15;
          if (local_res8 != (uint *)0x0) {
            if (local_res8 != (uint *)PTR_DAT_1405d8010) {
              uVar16 = local_res8[-2];
            }
            goto LAB_1403d64bc;
          }
        }
        FUN_14034fd20(puVar11 + 2,puVar13,uVar16);
        FUN_1400031d0(&local_res8);
        local_res8 = puVar11 + 2;
      }
    }
  }
  FUN_140002e10(&local_res8);
  puVar11 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar11,L"close socket completion",uVar6);
  puVar11 = local_res8;
  if (local_res8 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1405d8010;
  }
  uVar6 = FUN_14034fcf0(puVar11);
  uVar15 = 0;
  if (0 < (int)uVar6) {
    uVar15 = uVar6;
  }
  uVar6 = uVar7;
  if ((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) {
    uVar6 = local_res8[-2];
  }
  if (((int)uVar15 < (int)uVar6) || (uVar15 = uVar7, local_res8 == (uint *)0x0)) {
LAB_1403d654f:
    if (((local_res8 != (uint *)PTR_DAT_1405d8010) && (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_1405d8010) {
    uVar15 = local_res8[-2];
    goto LAB_1403d654f;
  }
  FUN_1403c3c70(*(undefined8 *)(param_1 + 0x108),0xb,3,&local_res8);
  puVar11 = local_res8;
  if (((local_res8 != (uint *)0x0) && (local_res8 != (uint *)PTR_DAT_1405d8010)) &&
     (puVar13 = local_res8 + -2, puVar13 != (uint *)0x0)) {
    uVar17 = FUN_14034fe70();
    FUN_14034ed40(uVar17);
    puVar11 = puVar11 + -1;
    *puVar11 = *puVar11 - 1;
    if (*puVar11 == 0) {
      FUN_14034ff60(puVar13);
    }
    FUN_14034edd0(uVar17);
  }
  local_res8 = (uint *)PTR_DAT_1405d8010;
  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_1403d6767:
  lVar10 = 0;
  plVar3 = *(longlong **)(*(longlong *)(param_1 + 0x108) + 0x5d0);
  if (plVar3 != (longlong *)0x0) {
    lVar10 = *plVar3;
  }
  if (*(int *)(lVar10 + 0x100) < 4) {
    uVar17 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x108));
    iVar9 = FUN_1403dd730(uVar17);
    if (iVar9 != 0) {
      FUN_14034fe70();
      local_res18 = PTR_DAT_1405d8010;
      FUN_140017720(&local_res18,L"%d Tcp issueRecv Failed SocketErrorCode",iVar9);
      FUN_1403c3c70(*(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_1405d8010)) &&
         (puVar1 = local_res18 + -8, puVar1 != (undefined *)0x0)) {
        uVar17 = FUN_14034fe70();
        FUN_14034ed40(uVar17);
        piVar2 = (int *)(puVar4 + -4);
        *piVar2 = *piVar2 + -1;
        if (*piVar2 == 0) {
          FUN_14034ff60(puVar1);
        }
        FUN_14034edd0(uVar17);
      }
    }
  }
  return;
}



void FUN_1403d6890(longlong param_1)

{
  char cVar1;
  double dVar2;
  undefined8 uVar3;
  
  FUN_1403bb820(*(undefined8 *)(param_1 + 0x108));
  FUN_1403cfc70(param_1);
  FUN_1403cee00(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_1403d6000(param_1);
    if (*(int *)(param_1 + 0x100) == 4) {
      return;
    }
  } while (cVar1 != '\0');
  return;
}



undefined8 FUN_1403d6960(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_14034ed40(param_1);
    bVar1 = true;
    if (*(int *)(param_2 + 2) == 1) {
      uVar4 = (**(code **)(**(longlong **)(puVar3 + 0x120) + 0x38))();
      FUN_1403d0400(uVar4,param_2);
    }
    else if (*(int *)(param_2 + 2) == 2) {
      uVar4 = (**(code **)(**(longlong **)(puVar3 + 0x120) + 0x38))();
      FUN_1403d6250(uVar4,param_2);
    }
    else {
      FUN_14034edd0(param_1);
      bVar1 = false;
      FUN_14034fe70();
      local_res18 = PTR_DAT_1405d8010;
      uVar2 = FUN_14034fcf0(L"Unexpected at Client IOCP TCP completion!");
      uVar4 = FUN_140002f00(&local_res18,uVar2);
      FUN_14034fd20(uVar4,L"Unexpected at Client IOCP TCP completion!",uVar2);
      FUN_140002fe0(&local_res18);
      FUN_140352d80(&local_res18);
    }
    if (bVar1) {
      FUN_14034edd0(param_1);
    }
    uVar4 = 1;
  }
  return uVar4;
}



undefined8 FUN_1403d6ac0(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_14034ed40(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_1403ce6c0(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_1403d5ca0(uVar4,puVar3,param_2);
    }
    else {
      FUN_14034edd0(param_1);
      bVar1 = false;
      FUN_14034fe70();
      local_res18[0] = PTR_DAT_1405d8010;
      uVar2 = FUN_14034fcf0(L"Unexpected at Client IOCP UDP completion!");
      uVar4 = FUN_140002f00(local_res18,uVar2);
      FUN_14034fd20(uVar4,L"Unexpected at Client IOCP UDP completion!",uVar2);
      FUN_140002fe0(local_res18);
      FUN_140352d80(local_res18);
    }
    if (bVar1) {
      FUN_14034edd0(param_1);
    }
    uVar4 = 1;
  }
  return uVar4;
}



void FUN_1403d6c40(longlong param_1)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_1 + 0x108) + 0x58))();
  FUN_14034ed40(uVar1);
  FUN_1403d6890(param_1);
  FUN_14034edd0(uVar1);
  return;
}



void FUN_1403d6ca0(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_1405d83d0;
  local_14 = DAT_1405d83d4;
  local_38 = 5;
  cVar1 = FUN_140358730(*(undefined8 *)(param_1 + 0x2b8),&local_48,param_2);
  if (cVar1 != '\0') {
    cVar1 = FUN_1403d6960(param_1,&local_48);
    if (cVar1 == '\0') {
      cVar1 = FUN_1403d6ac0(param_1,&local_48);
      if (cVar1 == '\0') {
        FUN_14034fe70();
        local_res8[0] = PTR_DAT_1405d8010;
        uVar2 = FUN_14034fcf0(L"Unexpected at Client IOCP completion!");
        uVar3 = FUN_140002f00(local_res8,uVar2);
        FUN_14034fd20(uVar3,L"Unexpected at Client IOCP completion!",uVar2);
        FUN_140002fe0(local_res8);
        FUN_140352d80(local_res8);
      }
    }
  }
  return;
}



void FUN_1403d6d80(longlong param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  iVar1 = *(int *)(param_1 + 0x100);
  if (iVar1 == 0) {
    FUN_1403d3750();
  }
  else if (iVar1 == 1) {
    FUN_1403cf620();
  }
  else if (iVar1 == 2) {
    FUN_1403ce900();
  }
  else if (iVar1 == 3) {
    FUN_1403d6c40();
  }
  else if (iVar1 == 4) {
    FUN_1403d06d0();
  }
  FUN_1403ad010(*(undefined8 *)(param_1 + 0x108));
  uVar2 = FUN_1403ab240(*(undefined8 *)(param_1 + 0x108));
  FUN_1403a9c50(*(longlong *)(param_1 + 0x108) + 0x1878,uVar2);
  if (*(char *)(*(longlong *)(param_1 + 0x108) + 0x1888) != '\0') {
    FUN_1403ad540();
  }
  return;
}



void FUN_1403d6e10(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_14034ed40(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_1403d6d80(lVar4);
      }
      if (*(int *)(lVar4 + 0x100) == 5) {
        lVar5 = *(longlong *)(lVar4 + 8);
        FUN_1403d1160(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_1403cfad0(pvVar1);
              operator_delete(pvVar1);
            }
            FUN_14034ff60(puVar2);
          }
        }
      }
      else {
        lVar5 = *(longlong *)(lVar4 + 8);
      }
      lVar4 = lVar5;
    } while (lVar5 != 0);
  }
  FUN_1403d3f10(param_1);
  FUN_14034edd0(lVar3);
  return;
}



void FUN_1403d6f80(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_140357920(DVar2,"PNCliWorker",param_3,param_4,uVar3);
  DVar2 = GetCurrentThreadId();
  *(DWORD *)(param_1 + 0x284) = DVar2;
  if (DAT_1405d8147 != '\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_1405f0950 != '\0') break;
    FUN_1403d6ca0(param_1,DAT_1405d8074);
    if (*(char *)(param_1 + 0x280) != '\0') {
      *(undefined1 *)(param_1 + 0x280) = 0;
      FUN_14034ed40();
      uVar3 = FUN_14035a290(param_1 + 0x48);
      *(undefined8 *)(param_1 + 0xc0) = uVar3;
      uVar3 = FUN_14035a2f0(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_14034edd0(param_1 + 0x88);
      FUN_1403d6e10(param_1);
      if (*(longlong *)(param_1 + 0x2b0) != 0) {
        FUN_1403dd5d0();
      }
    }
    cVar1 = *(char *)(param_1 + 0x80);
  }
  return;
}



undefined8 * FUN_1403d7100(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_1403c0cc0();
  FUN_14034ec60(param_1 + 2,uVar4,1);
  FUN_14035a1b0(param_1 + 9);
  lVar7 = 0;
  param_1[0xf] = 0;
  uVar4 = FUN_1403c0cc0();
  FUN_14034ec60(param_1 + 0x11,uVar4,1);
  uVar4 = FUN_1403c0cc0();
  FUN_14034ec60(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_1403ceae0();
  *(undefined1 *)(param_1 + 0x38) = 0;
  FUN_14035a200(param_1 + 9);
  uVar8 = FUN_14035a290(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_1403594e0(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_1405d8074) {
    uDelay = DAT_1405d8074;
  }
  MVar5 = timeSetEvent(uDelay,uDelay,&LAB_1403ce400,(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_1403573d0(local_res10,&LAB_1403d70f0,param_1);
  }
  if (lVar6 == 0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_14034fef0(0x10);
    local_res10[1] = 1;
    *local_res10 = lVar6;
  }
  plVar1 = local_res10;
  FUN_14038a5f0(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_1403574e0(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(plVar3);
    }
  }
  if ((longlong *)param_1[0xf] != (longlong *)0x0) {
    lVar7 = *(longlong *)param_1[0xf];
  }
  FUN_1403575d0(lVar7);
  return param_1;
}



longlong * FUN_1403d7380(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_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0xd4) = DAT_1405d83d4;
  *param_1 = param_2;
  param_1[0x20] = DAT_1405d8078;
  *(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_1403d7450(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_1403d74d0(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_1403ab410(*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_14039b1d0(uVar4,1);
      uVar6 = FUN_1403ab410(*param_1);
      FUN_1403e1f50(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_1403ab430(*param_1);
  FUN_1403dda40(uVar6,param_3,&local_28);
  return;
}



undefined8 FUN_1403d7620(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_1403d7660(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_14000d450(0x80004005);
  }
  if (param_2 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1403d7771;
            }
          }
          iVar5 = 0;
          goto LAB_1403d7794;
        }
        *param_2 = cVar2;
LAB_1403d7771:
        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_1403d7794;
  }
  if (uVar6 < param_4) {
    *param_2 = '\0';
  }
LAB_1403d7794:
  if (param_3 != (int *)0x0) {
    *param_3 = uVar6 + 1;
  }
  if (param_4 < uVar6 + 1) {
    iVar5 = 0;
  }
  return iVar5;
}



undefined8 FUN_1403d77d0(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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x2458) = (uint)sVar2;
  return 1;
}



undefined8 FUN_1403d7880(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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x245c) = (uint)sVar2;
  return 1;
}



undefined8 FUN_1403d7930(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_14000d450(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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x2460) = (uint)sVar2;
  return 1;
}



undefined8 FUN_1403d7a10(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_14000d450(0x8007000e);
    }
    if ((eVar1 == 0x16) || (eVar1 == 0x22)) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80070057);
    }
    if (eVar1 != 0x50) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
  }
  *(uint *)(param_1 + 0x2468) = (uint)sVar2;
  return 1;
}



uint FUN_1403d7ac0(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_1404c5240;
    do {
      puVar3 = puVar3 + 1;
      iVar4 = iVar4 + 1;
    } while (*puVar3 < uVar5);
  }
  uVar1 = (&DAT_1404c5240)[iVar4];
  if ((&DAT_1404c5240)[iVar4] == 0xffffffff) {
    uVar1 = uVar5;
  }
  return uVar1;
}



undefined8 FUN_1403d7b40(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_14000d450(0x80004005);
  }
  ppuVar6 = &PTR_DAT_14044cb20;
  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_14044cb28 + (longlong)(int)uVar7 * 0x10);
          param_1[0x1226] = *(wchar_t *)(&DAT_14044cb2c + (longlong)(int)uVar7 * 0x10);
          goto LAB_1403d7bd4;
        }
        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_1403d7bd4:
    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_14000d450(0x8007000e);
      }
      if ((eVar3 == 0x16) || (eVar3 == 0x22)) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80070057);
      }
      if (eVar3 != 0x50) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
    }
    param_1[*(uint *)(param_1 + 0x122a)] = L'\0';
    uVar4 = 1;
  }
  return uVar4;
}



void FUN_1403d7c80(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 0x0001403d7ca7. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
      return;
    }
    FUN_14034ff60(param_1[2]);
  }
  return;
}



undefined8 * FUN_1403d7cc0(undefined8 *param_1,uint param_2)

{
  *param_1 = Proud::CFastArray<>::vftable;
  if (param_1[2] != 0) {
    if ((longlong *)param_1[1] == (longlong *)0x0) {
      FUN_14034ff60(param_1[2]);
    }
    else {
      (**(code **)(*(longlong *)param_1[1] + 0x18))();
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403d7d20(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_14034f7d0();
  }
  if (param_2 != *(int *)(param_1 + 0x18)) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar4 = FUN_1403891d0();
      plVar2 = *(longlong **)(param_1 + 8);
      lVar9 = (longlong)iVar4;
      if (*(int *)(param_1 + 0x1c) == 0) {
        if (plVar2 == (longlong *)0x0) {
          uVar5 = FUN_14034fef0(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_14034fef0(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_14034f420(local_58,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_58,(ThrowInfo *)&DAT_1405d36c0);
        }
        plVar2 = *(longlong **)(param_1 + 8);
        if (plVar2 == (longlong *)0x0) {
          FUN_14034ff60(lVar3);
        }
        else {
          (**(code **)(*plVar2 + 0x18))(plVar2,lVar3);
        }
        *(undefined1 **)(param_1 + 0x10) = puVar6;
      }
      *(int *)(param_1 + 0x1c) = iVar4;
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



undefined8 FUN_1403d7e60(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_1405d8008)) {
    iVar1 = *(int *)(puVar3 + -8);
  }
  *(undefined1 *)(param_2 + 0x24c0) = 1;
  puVar3 = *(undefined **)(param_2 + 0x2488);
  if (*(undefined **)(param_2 + 0x2488) == (undefined *)0x0) {
    puVar3 = PTR_DAT_1405d8008;
  }
  if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(param_2 + 0x2480);
  }
  iVar1 = FUN_140356460(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_1403d7ee0(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_1403d7d20(param_1,iVar2 + param_3);
      lVar4 = 0;
      if (0 < param_3) {
        do {
          lVar3 = FUN_1403a2c90(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_14034f7d0();
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_1403d7f60(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 = 0x1403d7f76;
  local_11c0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_1208;
  iVar3 = 0;
  local_11d8 = param_2;
  local_11c8 = param_3;
  if (param_1 == (short *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_140350a50(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_140350a50(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_1403d7660(puVar4,puVar5,local_11e8,param_4);
        if (iVar3 != 0) {
          local_11b8 = local_11b0;
          FUN_14012a1d0(&local_11b8,puVar5,3);
          FUN_140306c30(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_1403d8190(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  
  if (*(longlong *)(param_1 + 0x20) == 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  lVar1 = *(longlong *)(param_1 + 0x10);
  if (lVar1 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_14034fe70();
  *param_2 = PTR_DAT_1405d8010;
  FUN_140003100(param_2,lVar1);
  return param_2;
}



void FUN_1403d81f0(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_14034ff60(param_1);
  }
  return;
}



void FUN_1403d8250(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_14034ff60(plVar1);
  }
  FUN_14000d2c0(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403d82d0(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_1405d84f0 ^ (ulonglong)auStack_188;
  if (param_2 == (wchar_t *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  bVar2 = false;
  bVar1 = false;
  local_164 = 0;
  local_168 = 0;
  lVar7 = (**(code **)(PTR_PTR_1405d8520 + 0x18))(&PTR_PTR_1405d8520);
  local_160 = (wchar_t *)(lVar7 + 0x18);
  if ((int)(*(int *)(lVar7 + 0xc) - 0x82aU | 1U - *(int *)(lVar7 + 0x10)) < 0) {
    FUN_140306f70(&local_160,0x82a);
  }
  pwVar3 = local_160;
  uVar8 = 0;
  wVar4 = *param_2;
  pwVar9 = local_160;
  uVar11 = uVar8;
  if (wVar4 != L'\0') {
LAB_1403d8392:
    uVar10 = 0;
    if (0x828 < uVar8) goto LAB_1403d872c;
    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_1403d872c;
              *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_1403d77d0(param_1,pwVar3);
              if (iVar6 == 0) goto LAB_1403d872c;
              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_1403d7880(param_1,pwVar3), iVar6 == 0)) ||
                  (iVar6 = FUN_1403d7930(param_1,local_148), iVar6 == 0)))) goto LAB_1403d872c;
              bVar1 = true;
              param_2 = param_2 + 1;
              pwVar9 = pwVar3;
            }
          }
        }
        else {
          iVar6 = FUN_1403d7b40(param_1,pwVar3);
          if (iVar6 == 0) goto LAB_1403d872c;
          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_1403d8610;
            }
            if (*(int *)(param_1 + 0x2450) == 6) goto LAB_1403d872c;
          }
          uVar8 = 0;
          param_2 = pwVar9 + 1;
          pwVar9 = pwVar3;
          if (*(int *)(param_1 + 0x2450) == 4) goto LAB_1403d8610;
        }
      }
      else {
LAB_1403d8562:
        if (param_2[1] == L'\0') {
LAB_1403d85bc:
          if ((wVar4 != L'/') && (wVar4 != L'?')) {
            if (uVar8 < 0x828) {
              *pwVar9 = wVar4;
              pwVar9 = pwVar9 + 1;
              param_2 = param_2 + 1;
              goto LAB_1403d85e0;
            }
            goto LAB_1403d872c;
          }
          goto LAB_1403d85e0;
        }
        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_1403d8562;
        if (param_2[1] == L'\0') goto LAB_1403d85bc;
LAB_1403d85e0:
        *pwVar9 = L'\0';
        if ((local_164 == 0) && (iVar6 = FUN_1403d77d0(param_1,pwVar3), iVar6 == 0))
        goto LAB_1403d872c;
        uVar8 = 0;
        pwVar9 = pwVar3;
        goto LAB_1403d8607;
      }
      if (bVar1) goto LAB_1403d872c;
      *pwVar9 = L'\0';
      iVar6 = FUN_1403d7880(param_1,pwVar3);
      if (iVar6 == 0) goto LAB_1403d872c;
      uVar11 = 0;
      bVar1 = true;
      param_2 = param_2 + 1;
      uVar8 = 0;
      pwVar9 = pwVar3;
    }
    wVar4 = *param_2;
    if (wVar4 == L'\0') goto LAB_1403d8607;
    goto LAB_1403d8392;
  }
  goto LAB_1403d872c;
LAB_1403d8607:
  if (bVar2) {
LAB_1403d8610:
    wVar4 = *param_2;
    while (wVar4 != L'\0') {
      if (0x828 < uVar8) goto LAB_1403d872c;
      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_140351040(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_1403d872c;
        *pwVar9 = wVar4;
        pwVar9 = pwVar9 + 1;
        uVar8 = uVar8 + 1;
        wVar4 = *param_2;
      }
      *pwVar9 = L'\0';
      if ((*pwVar3 == L'\0') || (iVar6 = FUN_1403d7a10(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_1403d7620();
          *(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_1403d872c:
  FUN_1403510f0();
  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_1403d8790(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_14034ed40(lVar1);
  if (*(longlong *)(param_1 + 200) == 0) {
    FUN_14034fe70();
    *param_2 = PTR_DAT_1405d8010;
  }
  else {
    FUN_1403d8190(param_1 + 0xa8,param_2,param_3,param_4,uVar2,lVar3,1);
  }
  FUN_14034edd0(lVar1);
  return param_2;
}



void FUN_1403d8830(longlong param_1)

{
  ulonglong *puVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  int iVar4;
  ulonglong uVar5;
  
  FUN_14034ed40(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_14034edd0(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_1403552c0(uVar3);
    }
    if (*(int *)(param_1 + 0x118) <= iVar4) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    uVar2 = (ulonglong)(iVar4 + 1);
  }
                    // WARNING: Subroutine does not return
  FUN_14034f800();
}



// WARNING: Removing unreachable block (ram,0x0001403d8b4e)

void FUN_1403d8950(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_14034ed40(lVar1);
    uVar11 = 1;
    lVar5 = lVar1;
    if (DAT_1405f0950 != '\0') break;
    local_38 = Proud::AddrPort::vftable;
    local_28 = 0;
    local_40 = 0;
    local_30 = DAT_1405d83d0;
    local_2c = DAT_1405d83d4;
    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_14034f800();
      }
      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_140354f80(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_1403551f0(uVar4,0,&local_40);
        if (cVar3 != '\0') {
          *(undefined1 *)(uVar6 + 0x80) = 0;
        }
      }
      if (((*(longlong **)(uVar6 + 0x10) != (longlong *)0x0) && (**(longlong **)(uVar6 + 0x10) != 0)
          ) && ((cVar3 = FUN_140355560(), cVar3 == '\0' ||
                ((*(char *)(uVar6 + 0xc0) != '\0' || (*(char *)(uVar6 + 0x80) != '\0'))))))
      goto LAB_1403d8b27;
      if (*(int *)(param_1 + 0x118) <= iVar7) {
                    // WARNING: Subroutine does not return
        FUN_14034f800();
      }
      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_1403d8b63;
      uVar6 = uVar8;
      if (*(ulonglong **)(uVar4 + 8) != (ulonglong *)0x0) {
        uVar6 = **(ulonglong **)(uVar4 + 8);
      }
      if (((*(longlong **)(uVar6 + 0x2480) != (longlong *)0x0) &&
          (**(longlong **)(uVar6 + 0x2480) != 0)) &&
         ((cVar3 = FUN_140355560(), cVar3 == '\0' ||
          ((*(char *)(uVar6 + 0x2500) != '\0' || (*(char *)(uVar6 + 0x24c0) != '\0')))))) break;
      uVar6 = uVar8;
      if (uVar4 != 0) {
        uVar6 = *(ulonglong *)(uVar4 + 0x10);
      }
    }
LAB_1403d8b27:
    FUN_14034edd0(lVar5);
    Sleep(10);
  }
LAB_1403d8b63:
  FUN_14034edd0(lVar5);
  return;
}



longlong * FUN_1403d8b90(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_1405d8008) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar4 + -8);
  }
  if (puVar4 == (undefined *)0x0) {
    iVar2 = 0;
  }
  else if (puVar4 == PTR_DAT_1405d8008) {
    iVar2 = 0;
  }
  else {
    iVar2 = *(int *)(puVar4 + -8);
  }
  iVar3 = iVar5;
  if (iVar5 <= iVar2) {
    if (puVar4 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (puVar4 == PTR_DAT_1405d8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar4 + -8);
    }
  }
  iVar2 = 1;
  if (1 < iVar3) {
    iVar2 = iVar3;
  }
  iVar3 = 0;
  if (puVar4 != (undefined *)0x0) {
    if (puVar4 == PTR_DAT_1405d8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar4 + -8);
    }
  }
  if (iVar3 < iVar2) {
    FUN_140057890(param_1,iVar2);
  }
  FUN_140057970(param_1);
  puVar4 = (undefined *)*param_1;
  if ((undefined *)*param_1 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8008;
  }
  FUN_14034fe20(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_1405d8008) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar4 + -8);
  }
  if (iVar5 <= iVar2) {
    if (puVar4 == (undefined *)0x0) {
      iVar2 = 0;
    }
    else if (puVar4 == PTR_DAT_1405d8008) {
      iVar2 = 0;
    }
    else {
      iVar2 = *(int *)(puVar4 + -8);
    }
  }
  if (((puVar4 != PTR_DAT_1405d8008) && (puVar4 != (undefined *)0x0)) &&
     (piVar1 = (int *)(puVar4 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar2;
    *(undefined1 *)((longlong)iVar2 + 8 + (longlong)piVar1) = 0;
  }
  return param_1;
}



undefined8 * FUN_1403d8cb0(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_1405d8008)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 < param_3 + param_4) {
    param_4 = iVar3;
    if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8008)) {
      param_4 = *(int *)(puVar2 + -8);
    }
    param_4 = param_4 - param_3;
  }
  iVar1 = iVar3;
  if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8008)) {
    iVar1 = *(int *)(puVar2 + -8);
  }
  if (iVar1 < param_3) {
    param_4 = iVar3;
  }
  if (param_3 == 0) {
    if ((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8008)) {
      iVar4 = *(int *)(puVar2 + -8);
    }
    if (param_4 == iVar4) {
      FUN_14034fe70();
      *param_2 = PTR_DAT_1405d8008;
      FUN_14000d220(param_2,param_1);
      return param_2;
    }
  }
  if (puVar2 == (undefined *)0x0) {
    puVar2 = PTR_DAT_1405d8008;
  }
  FUN_140057b80(param_2,puVar2 + param_3,param_4);
  return param_2;
}



void FUN_1403d8da0(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_14034ff60(plVar1);
      }
      iVar3 = iVar3 + 1;
      param_1 = param_1 + 1;
    } while (iVar3 < param_2);
  }
  return;
}



void FUN_1403d8e30(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_14034ff60(plVar4);
          }
        }
      }
      uVar2 = (int)plVar3 + 1;
      plVar3 = (longlong *)(ulonglong)uVar2;
      param_1 = param_1 + 1;
    } while ((int)uVar2 < param_3);
  }
  return;
}



void FUN_1403d8f10(longlong param_1,undefined8 param_2,ulonglong param_3)

{
  int iVar1;
  
  FUN_1403510f0();
  iVar1 = FUN_1403d82d0(param_1,param_2);
  if ((((param_3 & 1) != 0) || ((param_3 & 4) != 0)) && (iVar1 != 0)) {
    if (*(int *)(param_1 + 0x245c) != 0) {
      iVar1 = FUN_1403d7f60(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_1403d7f60(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_1403d7f60(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_1403d7f60(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_1403d7f60(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_1403d9050(wchar_t *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_1405d84f0 ^ (ulonglong)auStack_1a8;
  local_168 = param_2;
  FUN_14034fe70();
  puVar9 = PTR_DAT_1405d8008;
  local_178 = PTR_DAT_1405d8008;
  pcVar3 = (char *)*param_2;
  pcVar8 = PTR_DAT_1405d8008;
  if (((pcVar3 == (char *)0x0) || (pcVar8 = pcVar3, pcVar3 == PTR_DAT_1405d8008)) ||
     (-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_1405d8008;
      }
      iVar2 = (int)pcVar3 - (int)puVar4;
    }
  }
  else {
    iVar2 = -1;
  }
  pcVar3 = (char *)*param_2;
  pcVar8 = PTR_DAT_1405d8008;
  if ((((pcVar3 == (char *)0x0) || (pcVar8 = pcVar3, pcVar3 == PTR_DAT_1405d8008)) ||
      (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_1405d8008;
    }
    iVar10 = (int)pcVar3 - (int)puVar4;
  }
  if ((iVar2 < iVar10) && (-1 < iVar2)) {
    plVar5 = (longlong *)FUN_1403d8cb0(param_2,&local_170,iVar2,(iVar10 - iVar2) + 4);
    if (puVar9 == (undefined *)0x0) {
      puVar9 = PTR_DAT_1405d8008;
    }
    local_178 = puVar9;
    if ((undefined *)*plVar5 != puVar9) {
      uVar6 = FUN_14034fe70();
      local_158 = uVar6;
      FUN_14034ed40(uVar6);
      local_150 = 1;
      if (((puVar9 != (undefined *)0x0) && (puVar9 != PTR_DAT_1405d8008)) &&
         (puVar9 + -8 != (undefined *)0x0)) {
        uVar7 = FUN_14034fe70();
        local_188 = uVar7;
        FUN_14034ed40(uVar7);
        local_180 = 1;
        piVar1 = (int *)(puVar9 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar9 + -8);
        }
        FUN_14034edd0(uVar7);
      }
      puVar9 = (undefined *)*plVar5;
      if (((puVar9 != PTR_DAT_1405d8008) && (puVar9 != (undefined *)0x0)) &&
         (puVar9 != (undefined *)0x8)) {
        *(int *)(puVar9 + -4) = *(int *)(puVar9 + -4) + 1;
      }
      local_178 = puVar9;
      FUN_14034edd0(uVar6);
    }
    if (((local_170 != (undefined *)0x0) && (local_170 != PTR_DAT_1405d8008)) &&
       (local_170 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      local_188 = uVar6;
      FUN_14034ed40(uVar6);
      local_180 = 1;
      piVar1 = (int *)(local_170 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_170 + -8);
      }
      FUN_14034edd0(uVar6);
    }
  }
  puVar4 = puVar9;
  if (puVar9 == (undefined *)0x0) {
    puVar4 = PTR_DAT_1405d8008;
  }
  local_148 = local_140;
  FUN_14012a1d0(&local_148,puVar4,3);
  iVar2 = FUN_1403d8f10(param_1 + 8,local_148,0);
  if (local_148 != local_140) {
    free(local_148);
  }
  if (iVar2 == 0) {
    if (((puVar9 != (undefined *)0x0) && (puVar9 != PTR_DAT_1405d8008)) &&
       (puVar9 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      local_188 = uVar6;
      FUN_14034ed40(uVar6);
      local_180 = 1;
      piVar1 = (int *)(puVar9 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar9 + -8);
      }
      FUN_14034edd0(uVar6);
    }
    FUN_14000d2c0(param_2);
    uVar6 = 0;
  }
  else if (param_1 == L"Motion2") {
    if (((puVar9 != (undefined *)0x0) && (puVar9 != PTR_DAT_1405d8008)) &&
       (puVar9 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      local_188 = uVar6;
      FUN_14034ed40(uVar6);
      local_180 = 1;
      piVar1 = (int *)(puVar9 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar9 + -8);
      }
      FUN_14034edd0(uVar6);
    }
    FUN_14000d2c0(param_2);
    uVar6 = 0;
  }
  else {
    if (((puVar9 != (undefined *)0x0) && (puVar9 != PTR_DAT_1405d8008)) &&
       (puVar9 + -8 != (undefined *)0x0)) {
      uVar6 = FUN_14034fe70();
      local_188 = uVar6;
      FUN_14034ed40(uVar6);
      local_180 = 1;
      piVar1 = (int *)(puVar9 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar9 + -8);
      }
      FUN_14034edd0(uVar6);
    }
    FUN_14000d2c0(param_2);
    uVar6 = 1;
  }
  return uVar6;
}



void FUN_1403d93e0(undefined8 *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  *param_1 = Proud::CDiscoveringNatDevice::vftable;
  FUN_14000d2c0(param_1 + 0x4a7);
  param_1[0x4a2] = Proud::CFastArray<>::vftable;
  if (param_1[0x4a4] != 0) {
    if ((longlong *)param_1[0x4a3] == (longlong *)0x0) {
      FUN_14034ff60(param_1[0x4a4]);
    }
    else {
      (**(code **)(*(longlong *)param_1[0x4a3] + 0x18))();
    }
  }
  FUN_14000d2c0(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_1403556b0(lVar2);
      FUN_14034ff60(lVar2);
    }
    FUN_14034ff60(plVar1);
  }
  FUN_14000d2c0(param_1 + 1);
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void * FUN_1403d94e0(void *param_1,uint param_2)

{
  FUN_1403d93e0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 * FUN_1403d9510(undefined8 *param_1)

{
  *param_1 = Proud::CDiscoveringNatDevice::vftable;
  FUN_14034fe70();
  param_1[1] = PTR_DAT_1405d8008;
  FUN_140351280(param_1 + 2);
  param_1[0x490] = 0;
  FUN_14034fe70();
  param_1[0x491] = PTR_DAT_1405d8008;
  param_1[0x4a2] = Proud::CFastArray<>::vftable;
  param_1[0x4a3] = 0;
  param_1[0x4a4] = 0;
  param_1[0x4a5] = 0;
  param_1[0x4a6] = 0;
  FUN_14034fe70();
  param_1[0x4a7] = PTR_DAT_1405d8008;
  *(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_1403d95e0(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_14034fe70();
  puVar8 = (uint *)PTR_DAT_1405d8010;
  local_res10 = (uint *)PTR_DAT_1405d8010;
  uVar2 = FUN_14034fcf0(param_2 + 0x52);
  puVar11 = (uint *)0x0;
  uVar10 = 0;
  puVar6 = puVar11;
  if ((puVar8 != (uint *)0x0) && (puVar6 = (uint *)0x0, puVar8 != (uint *)PTR_DAT_1405d8010)) {
    puVar6 = (uint *)(ulonglong)*(uint *)((longlong)puVar8 + -8);
  }
  uVar3 = uVar2;
  if ((((int)uVar2 <= (int)puVar6) && (uVar3 = uVar10, puVar8 != (uint *)0x0)) &&
     (puVar8 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = *(uint *)((longlong)puVar8 + -8);
  }
  uVar9 = 1;
  if (1 < (int)uVar3) {
    uVar9 = uVar3;
  }
  uVar3 = uVar10;
  if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1405d8010)) {
    uVar3 = *(uint *)((longlong)puVar8 + -8);
  }
  uVar4 = 0;
  if ((int)uVar3 < (int)uVar9) {
    if (puVar8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1405d8010;
    }
    local_res10 = puVar8;
    if ((int)uVar9 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar9 == 0) {
      FUN_1400031d0(&local_res10);
    }
    else {
      uVar3 = uVar10;
      if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1405d8010)) {
        uVar3 = puVar8[-2];
      }
      if (uVar9 != uVar3) {
        puVar6 = (uint *)FUN_14034fef0((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_1405d8010)) {
          uVar3 = puVar8[-2];
        }
        puVar7 = (uint *)PTR_DAT_1405d8010;
        if ((int)uVar9 < (int)uVar3) {
LAB_1403d96e3:
          if (puVar8 != (uint *)0x0) {
            puVar7 = puVar8;
          }
        }
        else {
          uVar9 = uVar10;
          if (puVar8 != (uint *)0x0) {
            if (puVar8 != (uint *)PTR_DAT_1405d8010) {
              uVar9 = puVar8[-2];
            }
            goto LAB_1403d96e3;
          }
        }
        FUN_14034fd20(puVar6 + 2,puVar7,uVar9,param_4,uVar12);
        FUN_1400031d0(&local_res10);
        local_res10 = puVar6 + 2;
      }
    }
  }
  FUN_140002e10(&local_res10);
  puVar8 = local_res10;
  puVar6 = local_res10;
  if (local_res10 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8010;
  }
  FUN_14034fd20(puVar6,param_2 + 0x52,uVar2,param_4,uVar12);
  puVar6 = puVar8;
  if (puVar8 == (uint *)0x0) {
    puVar6 = (uint *)PTR_DAT_1405d8010;
  }
  uVar2 = FUN_14034fcf0(puVar6);
  puVar6 = puVar11;
  if (0 < (int)uVar2) {
    puVar6 = (uint *)(ulonglong)uVar2;
  }
  if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1405d8010)) {
    uVar4 = puVar8[-2];
  }
  if (((int)uVar4 <= (int)puVar6) && (puVar6 = puVar11, puVar8 != (uint *)0x0)) {
    if (puVar8 == (uint *)PTR_DAT_1405d8010) goto LAB_1403d9793;
    puVar6 = (uint *)(ulonglong)puVar8[-2];
  }
  if (((puVar8 != (uint *)PTR_DAT_1405d8010) && (puVar8 != (uint *)0x0)) &&
     (puVar8 + -2 != (uint *)0x0)) {
    puVar8[-2] = (uint)puVar6;
    *(undefined2 *)((longlong)puVar8 + (longlong)(int)(uint)puVar6 * 2) = 0;
  }
LAB_1403d9793:
  uVar1 = *(undefined2 *)(param_2 + 0x245c);
  FUN_14034fe70();
  local_res18[0] = (uint *)PTR_DAT_1405d8010;
  if (PTR_DAT_1405d8010 == (undefined *)0x0) {
    local_res18[0] = puVar11;
  }
  if (puVar8 != (uint *)PTR_DAT_1405d8010) {
    uVar12 = FUN_14034fe70();
    FUN_14034ed40(uVar12);
    FUN_1400031d0(local_res18);
    local_res18[0] = puVar8;
    if (((puVar8 != (uint *)PTR_DAT_1405d8010) && (puVar8 != (uint *)0x0)) &&
       (puVar8 != (uint *)0x8)) {
      puVar8[-1] = puVar8[-1] + 1;
    }
    FUN_14034edd0(uVar12);
  }
  if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
    puVar11 = (uint *)**(undefined8 **)(param_2 + 0x2480);
  }
  iVar5 = FUN_140355d00(puVar11,local_res18,uVar1);
  if ((iVar5 == 0) || (iVar5 == 0x2733)) {
    if ((puVar8 != (uint *)0x0) &&
       ((puVar8 != (uint *)PTR_DAT_1405d8010 && (puVar8 + -2 != (uint *)0x0)))) {
      uVar12 = FUN_14034fe70();
      FUN_14034ed40(uVar12);
      puVar11 = puVar8 + -1;
      *puVar11 = *puVar11 - 1;
      if (*puVar11 == 0) {
        FUN_14034ff60(puVar8 + -2);
      }
      FUN_14034edd0(uVar12);
    }
    uVar12 = 1;
  }
  else {
    if (((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1405d8010)) &&
       (puVar8 + -2 != (uint *)0x0)) {
      uVar12 = FUN_14034fe70();
      FUN_14034ed40(uVar12);
      puVar11 = puVar8 + -1;
      *puVar11 = *puVar11 - 1;
      if (*puVar11 == 0) {
        FUN_14034ff60(puVar8 + -2);
      }
      FUN_14034edd0(uVar12);
    }
    uVar12 = 0;
  }
  return uVar12;
}



undefined8 *
FUN_1403d98e0(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_14034fe70();
  local_48 = PTR_DAT_1405d8008;
  puVar3 = (undefined *)*param_4;
  if ((undefined *)*param_4 == (undefined *)0x0) {
    puVar3 = PTR_DAT_1405d8008;
  }
  FUN_140351b00(&local_48,&DAT_14047e32c,puVar3);
  pcVar2 = local_48;
  pcVar5 = local_48;
  if (local_48 == (char *)0x0) {
    pcVar5 = PTR_DAT_1405d8008;
  }
  if (pcVar5 == (char *)0x0) {
    iVar7 = -1;
  }
  else {
    pcVar4 = (char *)*param_3;
    pcVar6 = PTR_DAT_1405d8008;
    if (((pcVar4 == (char *)0x0) || (pcVar6 = pcVar4, pcVar4 == PTR_DAT_1405d8008)) ||
       (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_1405d8008;
        }
        iVar7 = (int)pcVar5 - (int)puVar3;
        if (-1 < iVar7) {
          iVar8 = 0;
          if ((pcVar2 != (char *)0x0) && (iVar8 = 0, pcVar2 != PTR_DAT_1405d8008)) {
            iVar8 = *(int *)(pcVar2 + -8);
          }
          iVar7 = iVar7 + iVar8;
        }
      }
    }
  }
  FUN_14034fe70();
  local_40 = PTR_DAT_1405d8008;
  puVar3 = (undefined *)*param_4;
  if ((undefined *)*param_4 == (undefined *)0x0) {
    puVar3 = PTR_DAT_1405d8008;
  }
  FUN_140351b00(&local_40,"</%s>",puVar3);
  pcVar5 = local_40;
  pcVar4 = local_40;
  if (local_40 == (char *)0x0) {
    pcVar4 = PTR_DAT_1405d8008;
  }
  iVar8 = -1;
  if ((pcVar4 != (char *)0x0) &&
     ((((pcVar6 = (char *)*param_3, _Str = PTR_DAT_1405d8008, iVar8 = -1, pcVar6 == (char *)0x0 ||
        (_Str = pcVar6, pcVar6 == PTR_DAT_1405d8008)) || (-1 < *(int *)(pcVar6 + -8))) &&
      (pcVar4 = strstr(_Str,pcVar4), pcVar4 != (char *)0x0)))) {
    puVar3 = (undefined *)*param_3;
    if ((undefined *)*param_3 == (undefined *)0x0) {
      puVar3 = PTR_DAT_1405d8008;
    }
    iVar8 = (int)pcVar4 - (int)puVar3;
  }
  if (((iVar7 < 0) || (iVar8 < 0)) || (iVar8 <= iVar7)) {
    FUN_14034fe70();
    *param_2 = PTR_DAT_1405d8008;
    if (((pcVar5 != (char *)0x0) && (pcVar5 != PTR_DAT_1405d8008)) && (pcVar5 + -8 != (char *)0x0))
    {
      pcVar4 = (char *)FUN_14034fe70();
      local_40 = pcVar4;
      FUN_14034ed40(pcVar4);
      local_38 = 1;
      piVar1 = (int *)(pcVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(pcVar5 + -8);
      }
      FUN_14034edd0(pcVar4);
    }
    if (pcVar2 == (char *)0x0) {
      return param_2;
    }
    if (pcVar2 == PTR_DAT_1405d8008) {
      return param_2;
    }
    if (pcVar2 + -8 == (char *)0x0) {
      return param_2;
    }
    pcVar5 = (char *)FUN_14034fe70();
    local_40 = pcVar5;
    FUN_14034ed40(pcVar5);
    local_38 = 1;
    piVar1 = (int *)(pcVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(pcVar2 + -8);
    }
  }
  else {
    FUN_1403d8cb0(param_3,param_2,iVar7,iVar8 - iVar7);
    if (((pcVar5 != (char *)0x0) && (pcVar5 != PTR_DAT_1405d8008)) && (pcVar5 + -8 != (char *)0x0))
    {
      pcVar4 = (char *)FUN_14034fe70();
      local_40 = pcVar4;
      FUN_14034ed40(pcVar4);
      local_38 = 1;
      piVar1 = (int *)(pcVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(pcVar5 + -8);
      }
      FUN_14034edd0(pcVar4);
    }
    if (pcVar2 == (char *)0x0) {
      return param_2;
    }
    if (pcVar2 == PTR_DAT_1405d8008) {
      return param_2;
    }
    if (pcVar2 + -8 == (char *)0x0) {
      return param_2;
    }
    pcVar5 = (char *)FUN_14034fe70();
    local_40 = pcVar5;
    FUN_14034ed40(pcVar5);
    local_38 = 1;
    piVar1 = (int *)(pcVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(pcVar2 + -8);
    }
  }
  FUN_14034edd0(pcVar5);
  return param_2;
}



void FUN_1403d9bc0(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_14034ed40(param_1 + 0x10);
  dVar10 = (double)FUN_1403ce970(*(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_14034f800();
      }
      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_1403552c0(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_14034ff60(local_res8);
        }
      }
      if (*(int *)(param_1 + 0x118) <= iVar9) {
                    // WARNING: Subroutine does not return
        FUN_14034f800();
      }
      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_14034edd0(param_1 + 0x10);
  return;
}



void FUN_1403d9d70(undefined8 *param_1)

{
  longlong *plVar1;
  longlong lVar2;
  
  FUN_1403555d0(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_1403556b0(lVar2);
      FUN_14034ff60(lVar2);
    }
    FUN_14034ff60(plVar1);
  }
  FUN_14000d2c0(param_1 + 1);
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void FUN_1403d9e10(undefined8 *param_1)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_1403d8da0(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 0x0001403d9e57. Too many branches
                    // WARNING: Treating indirect jump as call
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
      return;
    }
    FUN_14034ff60();
  }
  return;
}



undefined8 * FUN_1403d9e70(undefined8 *param_1,uint param_2)

{
  longlong *plVar1;
  
  *param_1 = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 3)) {
    FUN_1403d8da0(param_1[2],(longlong)*(int *)(param_1 + 3));
  }
  if (param_1[2] != 0) {
    plVar1 = (longlong *)param_1[1];
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,param_1[2]);
    }
  }
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403d9ee0(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_14034f7d0();
  }
  iVar5 = *(int *)(param_1 + 0x18);
  if (param_2 != iVar5) {
    if (*(int *)(param_1 + 0x1c) < param_2) {
      iVar5 = FUN_140385ff0(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_14034fef0(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_14034fef0(lVar8 << 3);
        }
        else {
          lVar7 = (**(code **)(*plVar1 + 8))(plVar1,lVar8 << 3);
        }
        FUN_1403d8e30(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_14034f420(local_a0,L"Memory allocation failure!");
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_a0,(ThrowInfo *)&DAT_1405d36c0);
        }
        FUN_1403d8da0(uVar2,(longlong)*(int *)(param_1 + 0x18));
        plVar1 = *(longlong **)(param_1 + 8);
        if (plVar1 == (longlong *)0x0) {
          FUN_14034ff60(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_1403d8da0(*(longlong *)(param_1 + 0x10) + lVar7 * 8,(longlong)(iVar5 - param_2));
    }
    *(int *)(param_1 + 0x18) = param_2;
  }
  return;
}



void FUN_1403da0d0(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_1405f6ae0;
  local_14 = DAT_1405f6ae4;
  if (DAT_1405f6ad0 == (undefined *)0x0) {
    iVar1 = 0;
    puVar3 = PTR_DAT_1405d8008;
  }
  else {
    puVar3 = DAT_1405f6ad0;
    if (DAT_1405f6ad0 == PTR_DAT_1405d8008) {
      iVar1 = 0;
    }
    else {
      iVar1 = *(int *)(DAT_1405f6ad0 + -8);
    }
  }
  if (*(undefined8 **)(param_2 + 0x10) == (undefined8 *)0x0) {
    uVar2 = 0;
  }
  else {
    uVar2 = **(undefined8 **)(param_2 + 0x10);
  }
  iVar1 = FUN_140357140(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_140351ba0(param_2 + 0x10,local_res10);
    *(undefined4 *)(param_2 + 0x18) = 3;
  }
  return;
}



void FUN_1403da1a0(undefined8 param_1,longlong param_2)

{
  int iVar1;
  void *_Dst;
  undefined8 uVar2;
  undefined8 local_res10 [3];
  
  FUN_1400179d0();
  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_1403562a0(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_140351ba0(param_2 + 0x10,local_res10);
    *(undefined4 *)(param_2 + 0x18) = 3;
  }
  return;
}



void * FUN_1403da240(void *param_1,uint param_2)

{
  FUN_1403d9d70();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403da270(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_14035d100();
  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_14034ff60(lVar4);
    }
    else {
      (**(code **)(*plVar1 + 0x18))(plVar1,lVar4);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar4 = lVar5;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar2 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



void FUN_1403da3a0(longlong param_1,longlong param_2,char param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  if (param_2 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  FUN_1403d8250(param_2);
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(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_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar2);
  }
  return;
}



void FUN_1403da430(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_14000d450(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_1403da3a0(param_1,param_2,param_3);
  FUN_14035d100(param_1);
  return;
}



undefined8 * FUN_1403da530(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_14034fef0(0x28);
  }
  else {
    puVar4 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined8 *)0x0) {
    FUN_14034fe70();
    *puVar4 = PTR_DAT_1405d8008;
    FUN_14000d220(puVar4,param_2);
    puVar4[1] = 0;
    *(undefined4 *)(puVar4 + 4) = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar3);
  }
  FUN_14035d100(param_1);
  return puVar4;
}



undefined8 * FUN_1403da6a0(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_14034fef0(0x28);
  }
  else {
    puVar4 = (undefined8 *)
             (**(code **)(*plVar1 + 8))(plVar1,0x28,param_3,param_4,0xfffffffffffffffe);
  }
  if (puVar4 != (undefined8 *)0x0) {
    FUN_14034fe70();
    *puVar4 = PTR_DAT_1405d8010;
    FUN_140003100(puVar4,param_2);
    *(undefined4 *)(puVar4 + 4) = param_4;
  }
  lVar2 = *(longlong *)(*(longlong *)(param_1 + 8) + (ulonglong)param_3 * 8);
  FUN_14035d100(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_14035d100(param_1);
    FUN_14035d100(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_14035d100(param_1);
  FUN_14035d100(param_1);
  if ((*(ulonglong *)(param_1 + 0x38) < *(ulonglong *)(param_1 + 0x20)) &&
     (*(int *)(param_1 + 0x48) == 0)) {
    uVar3 = FUN_1403d7ac0(param_1);
    FUN_14035f390(param_1,uVar3);
  }
  FUN_14035d100(param_1);
  return puVar4;
}



void FUN_1403da800(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_14034fef0(0x400);
  lVar7 = 0;
  lVar6 = lVar7;
  if (local_res10 != (longlong *)0x0) {
    lVar6 = FUN_140355800(local_res10,1,param_2);
  }
  if (lVar6 == 0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_14034fef0(0x10);
    local_res10[1] = 1;
    *local_res10 = lVar6;
  }
  plVar1 = local_res10;
  FUN_140351ba0(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_1403556b0(lVar6);
        FUN_14034ff60(lVar6);
      }
      FUN_14034ff60(plVar3);
    }
  }
  lVar6 = lVar7;
  if (*(longlong **)(param_2 + 0x10) != (longlong *)0x0) {
    lVar6 = **(longlong **)(param_2 + 0x10);
  }
  iVar5 = FUN_140356a80(lVar6,1);
  if (iVar5 == 0) {
    puVar2 = *(undefined **)(param_2 + 8);
    if (((puVar2 == (undefined *)0x0) || (puVar2 == PTR_DAT_1405d8008)) ||
       (*(int *)(puVar2 + -8) < 1)) {
      lVar6 = lVar7;
      if (*(longlong **)(param_2 + 0x10) != (longlong *)0x0) {
        lVar6 = **(longlong **)(param_2 + 0x10);
      }
      cVar4 = FUN_140357380(lVar6);
      if (cVar4 == '\0') {
        local_38 = 0;
        FUN_140351ba0(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_140356e40(lVar6,puVar2,0);
      if (cVar4 == '\0') {
        local_res20 = 0;
        FUN_140351ba0(param_2 + 0x10,&local_res20);
        *(undefined4 *)(param_2 + 0x18) = 3;
        return;
      }
    }
    if (*(longlong **)(param_2 + 0x10) != (longlong *)0x0) {
      lVar7 = **(longlong **)(param_2 + 0x10);
    }
    FUN_140354aa0(lVar7,0);
    FUN_1403da0d0(param_1,param_2);
  }
  else {
    local_res18 = 0;
    FUN_140351ba0(param_2 + 0x10,&local_res18);
    *(undefined4 *)(param_2 + 0x18) = 3;
  }
  return;
}



void FUN_1403da9d0(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_1405d83d0;
    local_2c = DAT_1405d83d4;
    uVar2 = 0;
    if (*(undefined8 **)(param_2 + 0x10) != (undefined8 *)0x0) {
      uVar2 = **(undefined8 **)(param_2 + 0x10);
    }
    cVar1 = FUN_1403551f0(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_140351ba0(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_1403ce970(*(undefined8 *)(param_1 + 8));
        *(undefined8 *)(param_2 + 200) = uVar3;
      }
      FUN_1403da1a0(param_1,param_2);
      return;
    }
    FUN_1403da0d0(param_1);
  }
  return;
}



void FUN_1403daae0(void)

{
  FUN_1403da270();
  return;
}



void FUN_1403dab00(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_14035d100(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_14034ff60(plVar2);
    }
    FUN_14000d2c0(lVar6);
    plVar2 = *(longlong **)(param_1 + 0x50);
    if (plVar2 == (longlong *)0x0) {
      FUN_14034ff60(lVar6);
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,lVar6);
    }
    *(longlong *)(param_1 + 0x20) = *(longlong *)(param_1 + 0x20) + -1;
    lVar6 = lVar1;
  }
  FUN_14034ff60(*(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_14035d100(param_1);
  if (*(int *)(param_1 + 0x48) == 0) {
    uVar4 = FUN_1403d7ac0(param_1,*(undefined8 *)(param_1 + 0x20));
    if (*(longlong *)(param_1 + 8) != 0) {
      FUN_14034ff60();
      *(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_14035d100(param_1);
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + -1;
  return;
}



undefined8 FUN_1403daca0(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035d100(param_1);
  uVar2 = FUN_1403da530(param_1,param_2,param_3,param_4);
  FUN_14035d100(param_1);
  return uVar2;
}



undefined8 FUN_1403dad20(longlong param_1,undefined8 param_2,undefined4 param_3,undefined4 param_4)

{
  char cVar1;
  undefined8 uVar2;
  
  if (*(longlong *)(param_1 + 8) == 0) {
    cVar1 = FUN_14035f5e0(param_1,*(undefined4 *)(param_1 + 0x28),1);
    if (cVar1 == '\0') {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x8007000e);
    }
  }
  FUN_14035d100(param_1);
  uVar2 = FUN_1403da6a0(param_1,param_2,param_3,param_4);
  FUN_14035d100(param_1);
  return uVar2;
}



void thunk_FUN_1403daae0(void)

{
  FUN_1403daae0();
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403dae50)
// WARNING: Removing unreachable block (ram,0x0001403dae54)
// WARNING: Removing unreachable block (ram,0x0001403dae70)
// WARNING: Removing unreachable block (ram,0x0001403dae7e)
// WARNING: Removing unreachable block (ram,0x0001403dae76)
// WARNING: Removing unreachable block (ram,0x0001403dae85)
// WARNING: Removing unreachable block (ram,0x0001403dae9d)

void FUN_1403dadb0(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_14034ed40(lVar9);
  local_80 = 1;
  local_b8 = Proud::CFastArray<>::vftable;
  local_b0 = (longlong *)0x0;
  local_a8 = 0;
  local_a0 = 0;
  local_98 = 0;
  FUN_140354510(&local_b8);
  if ((uint)local_a0 == 0) {
    FUN_14034fe70();
    puVar5 = PTR_DAT_1405d8008;
    local_90 = PTR_DAT_1405d8008;
    lVar15 = (longlong)(int)(uint)local_a0;
    if ((int)(uint)local_a0 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    FUN_140353770(&local_b8,(uint)local_a0 + 1);
    lVar16 = local_a8;
    if ((uint)local_a0 == 0) {
      lVar16 = 0;
    }
    FUN_14000d220(lVar16 + lVar15 * 8,&local_90);
    if (((puVar5 != (undefined *)0x0) && (puVar5 != PTR_DAT_1405d8008)) &&
       (puVar5 + -8 != (undefined *)0x0)) {
      uVar3 = FUN_14034fe70();
      local_78 = uVar3;
      FUN_14034ed40(uVar3);
      local_70 = 1;
      piVar1 = (int *)(puVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(puVar5 + -8);
      }
      FUN_14034edd0(uVar3);
      local_70 = 0;
    }
    local_90 = PTR_DAT_1405d8008;
  }
  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_14034fe70();
        puVar4[1] = PTR_DAT_1405d8008;
        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_14034fef0(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_14034f800();
      }
      if (local_res18 != (longlong *)0x0) {
        puVar8 = (undefined8 *)*local_res18;
      }
      puVar5 = (undefined *)puVar8[1];
      if ((undefined *)puVar8[1] == (undefined *)0x0) {
        puVar5 = PTR_DAT_1405d8008;
      }
      puVar8[1] = puVar5;
      if (*(undefined **)(local_a8 + local_res20 * 8) != puVar5) {
        uVar3 = FUN_14034fe70();
        local_68 = uVar3;
        FUN_14034ed40(uVar3);
        local_60 = 1;
        FUN_14000d2c0(puVar8 + 1);
        puVar5 = *(undefined **)(lVar9 + local_res20 * 8);
        puVar8[1] = puVar5;
        if (((puVar5 != PTR_DAT_1405d8008) && (puVar5 != (undefined *)0x0)) &&
           (puVar5 != (undefined *)0x8)) {
          *(int *)(puVar5 + -4) = *(int *)(puVar5 + -4) + 1;
        }
        FUN_14034edd0(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_14034f7d0();
      }
      iVar11 = *(int *)(param_1 + 0x118);
      FUN_1403d9ee0(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_1403a2c90(lVar15);
          lVar7 = FUN_1403a2c90(lVar15);
          FUN_1403aca30(lVar16 + lVar7,lVar17 + lVar6);
          lVar17 = lVar17 + -8;
          lVar16 = lVar16 + -8;
          iVar11 = iVar11 + -1;
        } while (-1 < iVar11);
      }
      lVar15 = FUN_1403a2c90(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_14034ff60(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_14034ff60(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_14000d2c0(lVar15);
      lVar15 = lVar15 + 8;
      uVar13 = uVar13 - 1;
    } while (uVar13 != 0);
  }
  if (local_a8 != 0) {
    if (local_b0 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*local_b0 + 0x18))(local_b0,local_a8);
    }
  }
  FUN_14034edd0(lVar9);
  return;
}



void FUN_1403db250(void)

{
  FUN_1403dab00();
  return;
}



longlong * FUN_1403db270(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_1405d8008;
  }
  if (pcVar4 == (char *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar7 = 0;
  if (pcVar8 == (char *)0x0) {
    pcVar8 = PTR_DAT_1405d8008;
  }
  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_1405d8008;
      }
      iVar3 = FUN_14034fdf0(puVar6);
      if (iVar3 == 0) goto LAB_1403db350;
    }
  }
  plVar5 = (longlong *)FUN_1403daca0(param_1,param_2,uVar2,uVar7);
LAB_1403db350:
  return plVar5 + 1;
}



longlong * FUN_1403db370(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_1405d8010;
  }
  if (puVar4 == (ushort *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  uVar7 = 0;
  if (puVar8 == (ushort *)0x0) {
    puVar8 = (ushort *)PTR_DAT_1405d8010;
  }
  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_1405d8010;
      }
      iVar3 = FUN_14034fd30(puVar6);
      if (iVar3 == 0) goto LAB_1403db450;
    }
  }
  plVar5 = (longlong *)FUN_1403dad20(param_1,param_2,uVar2,uVar7);
LAB_1403db450:
  return plVar5 + 1;
}



// WARNING: Removing unreachable block (ram,0x0001403db517)
// WARNING: Removing unreachable block (ram,0x0001403db520)
// WARNING: Removing unreachable block (ram,0x0001403db541)
// WARNING: Removing unreachable block (ram,0x0001403db54a)

undefined8 *
FUN_1403db470(undefined8 *param_1,undefined8 param_2,undefined1 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined4 uVar2;
  
  *param_1 = Proud::CUpnp::vftable;
  uVar2 = FUN_1403c0cc0(param_1,param_2,param_3,param_4,0xfffffffffffffffe);
  FUN_14034ec60(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_14036d530(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_1403ce970(param_2);
  param_1[0x25] = uVar1;
  return param_1;
}



void FUN_1403db5d0(undefined8 *param_1)

{
  undefined8 *puVar1;
  longlong *plVar2;
  
  *param_1 = Proud::CUpnp::vftable;
  puVar1 = param_1 + 2;
  FUN_14034ed40(puVar1);
  FUN_1403dab00(param_1 + 10);
  FUN_1403da270(param_1 + 0x15);
  FUN_1403d9ee0(param_1 + 0x20,0);
  FUN_14034edd0(puVar1);
  param_1[0x20] = Proud::CFastArray<>::vftable;
  if (0 < *(int *)(param_1 + 0x23)) {
    FUN_1403d8da0(param_1[0x22],(longlong)*(int *)(param_1 + 0x23));
  }
  if (param_1[0x22] != 0) {
    plVar2 = (longlong *)param_1[0x21];
    if (plVar2 == (longlong *)0x0) {
      FUN_14034ff60();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,param_1[0x22]);
    }
  }
  FUN_1403daae0(param_1 + 0x15);
  FUN_1403db250(param_1 + 10);
  FUN_14034edf0(puVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403db6d0(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_1405d84f0 ^ (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_1405d83d0;
    local_1bc = DAT_1405d83d4;
    puVar8 = puVar18;
    if ((undefined8 *)*puVar12 != (undefined8 *)0x0) {
      puVar8 = *(uint **)*puVar12;
    }
    cVar3 = FUN_140354f80(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_140351ba0(puVar12,&local_1a8);
      return;
    }
    FUN_14034fe70();
    local_1f8 = (uint *)PTR_DAT_1405d8008;
    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_14034f7d0();
      }
      if (uVar4 == 0) {
        puVar8 = local_1f8;
      }
      else {
        puVar8 = (uint *)FUN_14034fef0((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_1405d8008)) {
          uVar5 = local_1f8[-2];
        }
        puVar10 = (uint *)PTR_DAT_1405d8008;
        if ((int)uVar4 < (int)uVar5) {
LAB_1403db847:
          if (local_1f8 != (uint *)0x0) {
            puVar10 = local_1f8;
          }
        }
        else {
          uVar4 = uVar17;
          if (local_1f8 != (uint *)0x0) {
            if (local_1f8 != (uint *)PTR_DAT_1405d8008) {
              uVar4 = local_1f8[-2];
            }
            goto LAB_1403db847;
          }
        }
        puVar8 = puVar8 + 2;
        FUN_14034fdc0(puVar8,puVar10,uVar4);
        puVar10 = local_1f8;
        if (((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1405d8008)) &&
           (puVar11 = local_1f8 + -2, puVar11 != (uint *)0x0)) {
          uVar9 = FUN_14034fe70();
          local_138 = uVar9;
          FUN_14034ed40(uVar9);
          local_130 = 1;
          puVar10 = puVar10 + -1;
          *puVar10 = *puVar10 - 1;
          if (*puVar10 == 0) {
            FUN_14034ff60(puVar11);
          }
          FUN_14034edd0(uVar9);
          local_130 = 0;
        }
      }
    }
    local_1f8 = puVar8;
    puVar8 = (uint *)PTR_DAT_1405d8008;
    if (((local_1f8 == (uint *)0x0) || (puVar8 = local_1f8, local_1f8 == (uint *)PTR_DAT_1405d8008))
       || (local_1f8 + -2 == (uint *)0x0)) {
      local_1f8 = puVar8;
      puVar7 = (undefined8 *)FUN_14034fef0();
      *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_14034f7d0();
      }
      puVar8 = (uint *)FUN_14034fef0((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_1405d8008)) {
        uVar5 = local_1f8[-2];
      }
      *puVar8 = uVar5;
      puVar10 = (uint *)PTR_DAT_1405d8008;
      puVar11 = puVar18;
      if ((local_1f8 != (uint *)0x0) &&
         (puVar10 = local_1f8, puVar11 = (uint *)0x0, local_1f8 != (uint *)PTR_DAT_1405d8008)) {
        puVar11 = (uint *)(ulonglong)local_1f8[-2];
      }
      puVar8 = puVar8 + 2;
      FUN_14034fdc0(puVar8,puVar10,puVar11);
      puVar10 = local_1f8;
      if (((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1405d8008)) &&
         (puVar11 = local_1f8 + -2, puVar11 != (uint *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_198 = uVar9;
        FUN_14034ed40(uVar9);
        local_190 = 1;
        puVar10 = puVar10 + -1;
        *puVar10 = *puVar10 - 1;
        if (*puVar10 == 0) {
          FUN_14034ff60(puVar11);
        }
        FUN_14034edd0(uVar9);
        local_190 = 0;
      }
    }
    local_1f8 = puVar8;
    puVar8 = local_1f8;
    if (local_1f8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1405d8008;
    }
    puVar10 = puVar18;
    if ((undefined8 *)*puVar12 != (undefined8 *)0x0) {
      puVar10 = *(uint **)*puVar12;
    }
    _Size = (size_t)local_1b8;
    local_108 = puVar8;
    _Src = (void *)FUN_140355540(puVar10);
    memcpy(puVar8,_Src,_Size);
    *(undefined1 *)((longlong)local_1b8 + (longlong)puVar8) = 0;
    puVar8 = local_1f8;
    if (local_1f8 == (uint *)0x0) {
      puVar8 = (uint *)PTR_DAT_1405d8008;
    }
    uVar4 = FUN_14034fd90(puVar8);
    uVar5 = uVar16;
    if (0 < (int)uVar4) {
      uVar5 = uVar4;
    }
    uVar15 = 0;
    uVar4 = uVar15;
    if ((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1405d8008)) {
      uVar4 = local_1f8[-2];
    }
    if (((int)uVar5 < (int)uVar4) || (uVar5 = uVar15, local_1f8 == (uint *)0x0)) {
LAB_1403dba6a:
      if (((local_1f8 != (uint *)PTR_DAT_1405d8008) && (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_1405d8008) {
      uVar5 = local_1f8[-2];
      goto LAB_1403dba6a;
    }
    local_1e8 = operator_new(0x2540);
    puVar8 = puVar18;
    if (local_1e8 != (void *)0x0) {
      puVar8 = (uint *)FUN_1403d9510(local_1e8);
    }
    if (puVar8 == (uint *)0x0) {
      local_1e8 = (longlong *)0x0;
    }
    else {
      local_1e8 = (longlong *)FUN_14034fef0(0x10);
      local_1e8[1] = 1;
      *local_1e8 = (longlong)puVar8;
    }
    plVar19 = local_1e8;
    FUN_14034fe70();
    local_1e0 = (uint *)PTR_DAT_1405d8008;
    if (PTR_DAT_1405d8008 == (undefined *)0x0) {
      local_1e0 = puVar18;
    }
    if (local_1f8 != (uint *)PTR_DAT_1405d8008) {
      uVar9 = FUN_14034fe70();
      local_148 = uVar9;
      FUN_14034ed40(uVar9);
      local_140 = 1;
      FUN_14000d2c0(&local_1e0);
      local_1e0 = local_1f8;
      if (((local_1f8 != (uint *)PTR_DAT_1405d8008) && (local_1f8 != (uint *)0x0)) &&
         (local_1f8 != (uint *)0x8)) {
        local_1f8[-1] = local_1f8[-1] + 1;
      }
      FUN_14034edd0(uVar9);
      local_140 = 0;
    }
    puVar8 = puVar18;
    if (plVar19 != (longlong *)0x0) {
      puVar8 = (uint *)*plVar19;
    }
    cVar3 = FUN_1403d9050(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_14034ef40(&local_e8,(undefined1 *)((longlong)puVar8 + 0x52),3);
      puVar2 = local_e8;
      FUN_14034fe70();
      puVar8 = (uint *)PTR_DAT_1405d8008;
      local_1f0 = (uint *)PTR_DAT_1405d8008;
      uVar5 = FUN_14034fd90(puVar2);
      puVar10 = puVar18;
      if ((puVar8 != (uint *)0x0) && (puVar10 = (uint *)0x0, puVar8 != (uint *)PTR_DAT_1405d8008)) {
        puVar10 = (uint *)(ulonglong)*(uint *)((longlong)puVar8 + -8);
      }
      uVar4 = uVar5;
      if ((((int)uVar5 <= (int)puVar10) && (uVar4 = uVar15, puVar8 != (uint *)0x0)) &&
         (puVar8 != (uint *)PTR_DAT_1405d8008)) {
        uVar4 = *(uint *)((longlong)puVar8 + -8);
      }
      uVar21 = 1;
      if (1 < (int)uVar4) {
        uVar21 = uVar4;
      }
      uVar4 = uVar15;
      if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1405d8008)) {
        uVar4 = *(uint *)((longlong)puVar8 + -8);
      }
      if ((int)uVar4 < (int)uVar21) {
        if (puVar8 == (uint *)0x0) {
          puVar8 = (uint *)PTR_DAT_1405d8008;
        }
        local_1f0 = puVar8;
        if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        if (uVar21 == 0) {
          FUN_14000d2c0(&local_1f0);
          puVar8 = local_1f0;
        }
        else {
          uVar4 = uVar15;
          if ((puVar8 != (uint *)0x0) && (puVar8 != (uint *)PTR_DAT_1405d8008)) {
            uVar4 = puVar8[-2];
          }
          if (uVar21 != uVar4) {
            puVar10 = (uint *)FUN_14034fef0((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_1405d8008)) {
              uVar4 = puVar8[-2];
            }
            puVar11 = (uint *)PTR_DAT_1405d8008;
            if ((int)uVar21 < (int)uVar4) {
LAB_1403dbc92:
              if (puVar8 != (uint *)0x0) {
                puVar11 = puVar8;
              }
            }
            else {
              uVar21 = uVar17;
              if (puVar8 != (uint *)0x0) {
                if (puVar8 != (uint *)PTR_DAT_1405d8008) {
                  uVar21 = puVar8[-2];
                }
                goto LAB_1403dbc92;
              }
            }
            puVar8 = puVar10 + 2;
            FUN_14034fdc0(puVar8,puVar11,uVar21);
            FUN_14000d2c0(&local_1f0);
            local_1f0 = puVar8;
          }
        }
      }
      if (((puVar8 == (uint *)0x0) || (puVar8 == (uint *)PTR_DAT_1405d8008)) ||
         (puVar10 = puVar8 + -2, puVar10 == (uint *)0x0)) {
        puVar12 = (undefined8 *)FUN_14034fef0();
        *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_14034f7d0();
          }
          puVar11 = (uint *)FUN_14034fef0((longlong)(int)*puVar10 + 9);
          if (puVar11 != (uint *)0x0) {
            *puVar11 = 0;
            puVar11[1] = 1;
          }
          uVar17 = uVar16;
          if (puVar8 != (uint *)PTR_DAT_1405d8008) {
            uVar17 = *puVar10;
          }
          *puVar11 = uVar17;
          puVar20 = puVar18;
          if (puVar8 != (uint *)PTR_DAT_1405d8008) {
            puVar20 = (uint *)(ulonglong)*puVar10;
          }
          puVar11 = puVar11 + 2;
          FUN_14034fdc0(puVar11,puVar8,puVar20);
          param_1 = local_1d8;
          puVar20 = puVar11;
          if ((puVar8 != (uint *)PTR_DAT_1405d8008) && (puVar10 != (uint *)0x0)) {
            uVar9 = FUN_14034fe70();
            local_158 = uVar9;
            FUN_14034ed40(uVar9);
            local_150 = 1;
            puVar8 = puVar8 + -1;
            *puVar8 = *puVar8 - 1;
            if (*puVar8 == 0) {
              FUN_14034ff60(puVar10);
            }
            FUN_14034edd0(uVar9);
            local_150 = 0;
            param_1 = local_1d8;
          }
        }
      }
      local_1f0 = puVar20;
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1405d8008;
      }
      FUN_14034fdc0(puVar8,puVar2,uVar5);
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1405d8008;
      }
      uVar5 = FUN_14034fd90(puVar8);
      uVar17 = uVar16;
      if (0 < (int)uVar5) {
        uVar17 = uVar5;
      }
      uVar5 = uVar15;
      if ((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) {
        uVar5 = puVar11[-2];
      }
      if (((int)uVar17 < (int)uVar5) || (uVar17 = uVar15, puVar11 == (uint *)0x0)) {
LAB_1403dbe1d:
        if (((puVar11 != (uint *)PTR_DAT_1405d8008) && (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_1405d8008) {
        uVar17 = puVar11[-2];
        goto LAB_1403dbe1d;
      }
      if (local_e8 != local_e0) {
        free(local_e8);
      }
      lVar22 = param_1 + 0x50;
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1405d8008;
      }
      local_170 = lVar22;
      if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1405d8008;
      }
      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_1405d8008;
          }
          iVar6 = FUN_14034fdf0(puVar14);
          if (iVar6 == 0) {
            local_178 = plVar13;
            if (plVar13 != (longlong *)0x0) goto LAB_1403dc052;
            goto LAB_1403dbf1b;
          }
        }
      }
      local_178 = (longlong *)0x0;
LAB_1403dbf1b:
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1405d8008;
      }
      local_160 = lVar22;
      if (puVar8 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
        FUN_14000d450(0x80004005);
      }
      puVar8 = puVar11;
      if (puVar11 == (uint *)0x0) {
        puVar8 = (uint *)PTR_DAT_1405d8008;
      }
      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_1405d8008;
          }
          iVar6 = FUN_14034fdf0(puVar14);
          if (iVar6 == 0) {
            local_168 = plVar13;
            if (plVar13 != (longlong *)0x0) goto LAB_1403dc052;
            goto LAB_1403dbfd4;
          }
        }
      }
      local_168 = (longlong *)0x0;
LAB_1403dbfd4:
      plVar13 = (longlong *)FUN_1403db270(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_14034ff60(puVar8);
        }
      }
LAB_1403dc052:
      if (((puVar11 != (uint *)0x0) && (puVar11 != (uint *)PTR_DAT_1405d8008)) &&
         (puVar11 + -2 != (uint *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_188 = uVar9;
        FUN_14034ed40(uVar9);
        local_180 = 1;
        puVar8 = puVar11 + -1;
        *puVar8 = *puVar8 - 1;
        if (*puVar8 == 0) {
          FUN_14034ff60(puVar11 + -2);
        }
        FUN_14034edd0(uVar9);
        local_180 = 0;
      }
      local_1f0 = (uint *)PTR_DAT_1405d8008;
      param_1 = local_1d8;
      puVar12 = local_1a0;
    }
    dVar23 = (double)FUN_1403ce970(*(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_1403552c0(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_14034ff60(plVar13);
        }
      }
      puVar18 = local_1f8;
      if (((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1405d8008)) &&
         (puVar8 = local_1f8 + -2, puVar8 != (uint *)0x0)) {
        uVar9 = FUN_14034fe70();
        local_100 = uVar9;
        FUN_14034ed40(uVar9);
        local_f8 = 1;
        puVar18 = puVar18 + -1;
        *puVar18 = *puVar18 - 1;
        if (*puVar18 == 0) {
          FUN_14034ff60(puVar8);
        }
        FUN_14034edd0(uVar9);
      }
      return;
    }
    FUN_1403da1a0(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_14034ff60(plVar13);
      }
    }
    puVar8 = local_1f8;
    if (((local_1f8 != (uint *)0x0) && (local_1f8 != (uint *)PTR_DAT_1405d8008)) &&
       (puVar10 = local_1f8 + -2, puVar10 != (uint *)0x0)) {
      uVar9 = FUN_14034fe70();
      local_128 = uVar9;
      FUN_14034ed40(uVar9);
      local_120 = 1;
      puVar8 = puVar8 + -1;
      *puVar8 = *puVar8 - 1;
      if (*puVar8 == 0) {
        FUN_14034ff60(puVar10);
      }
      FUN_14034edd0(uVar9);
      local_120 = 0;
    }
    local_1f8 = (uint *)PTR_DAT_1405d8008;
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403dc280(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_1405d84f0 ^ (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_14034fef0(0x400);
      lVar16 = lVar19;
      if (local_9d8 != (undefined *)0x0) {
        lVar16 = FUN_140355800(local_9d8,0,param_2);
      }
      if (lVar16 == 0) {
        local_9e0 = (longlong *)0x0;
      }
      else {
        local_9e0 = (longlong *)FUN_14034fef0(0x10);
        local_9e0[1] = 1;
        *local_9e0 = lVar16;
      }
      plVar1 = local_9e0;
      FUN_140351ba0(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_1403556b0(lVar16);
            FUN_14034ff60(lVar16);
          }
          FUN_14034ff60(plVar4);
        }
      }
      lVar16 = lVar19;
      if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
        lVar16 = **(longlong **)(param_2 + 0x2480);
      }
      FUN_140357380(lVar16);
      lVar16 = lVar19;
      if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
        lVar16 = **(longlong **)(param_2 + 0x2480);
      }
      FUN_140354aa0(lVar16,0);
      cVar5 = FUN_1403d95e0(param_1,param_2);
      if (cVar5 == '\0') goto LAB_1403dd3ca;
    }
    FUN_140354b20(local_668);
    lVar16 = lVar19;
    if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
      lVar16 = **(longlong **)(param_2 + 0x2480);
    }
    FUN_140354b40(local_668,lVar16);
    lVar16 = lVar19;
    if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
      lVar16 = **(longlong **)(param_2 + 0x2480);
    }
    FUN_140354ba0(local_668,lVar16);
    FUN_140354c00(local_668,0);
    if (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0) {
      lVar19 = **(longlong **)(param_2 + 0x2480);
    }
    cVar5 = FUN_140354c60(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_1403d95e0(param_1,param_2);
      if (cVar5 != '\0') goto LAB_1403dd49c;
      goto LAB_1403dd3ca;
    }
    goto LAB_1403dd49c;
  }
  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_140354aa0(uVar15,1);
      local_808 = local_800;
      FUN_14034ef40(&local_808,param_2 + 0x52,3);
      local_898 = local_890;
      FUN_14034ef40(&local_898,param_2 + 0x458,3);
      local_a18 = (uint)*(ushort *)(param_2 + 0x245c);
      FUN_140351b00(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_1403d7e60(param_1,param_2);
      if (cVar5 == '\0') goto LAB_1403dd3ca;
    }
    local_988 = Proud::AddrPort::vftable;
    local_978 = 0;
    local_990 = 0;
    local_980 = DAT_1405d83d0;
    local_97c = DAT_1405d83d4;
    if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
      uVar12 = **(undefined8 **)(param_2 + 0x2480);
    }
    cVar5 = FUN_1403551f0(uVar12,0,&local_990);
    if (cVar5 != '\0') {
      *(undefined1 *)(param_2 + 0x24c0) = 0;
      if (local_978 == 0) goto LAB_1403dd3ca;
      *(int *)(param_2 + 0x2504) = *(int *)(param_2 + 0x2504) + local_978;
      puVar22 = *(undefined **)(param_2 + 0x2488);
      if (puVar22 != (undefined *)0x0) {
        if (puVar22 == PTR_DAT_1405d8008) {
          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_1403d7e60(param_1,param_2);
    }
    goto LAB_1403dd49c;
  }
  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_140356130(uVar15,0x8000);
      if (iVar9 == 0) goto LAB_1403dd037;
    }
    else {
LAB_1403dd037:
      local_9a8 = Proud::AddrPort::vftable;
      local_998 = 0;
      local_9b0 = 0;
      local_9a0 = DAT_1405d83d0;
      local_99c = DAT_1405d83d4;
      uVar15 = uVar12;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar15 = **(undefined8 **)(param_2 + 0x2480);
      }
      cVar5 = FUN_140354f80(uVar15,0,&local_9b0);
      if (cVar5 == '\0') {
LAB_1403dd49c:
        *(int *)(param_2 + 0x2494) = *(int *)(param_2 + 0x2494) + 1;
        return;
      }
      *(undefined1 *)(param_2 + 0x2500) = 0;
      if (local_998 == 0) {
LAB_1403dd3ca:
        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_140355540(uVar15);
      FUN_1403d7ee0(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_1403dd3ca;
      *(undefined1 *)(param_2 + 0x2500) = 1;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar12 = **(undefined8 **)(param_2 + 0x2480);
      }
      iVar9 = FUN_140356130(uVar12,iVar9);
      if (iVar9 == 0) goto LAB_1403dd49c;
    }
    *(undefined1 *)(param_2 + 0x2500) = 0;
    goto LAB_1403dd10d;
  }
  if (iVar9 != 3) {
    if (iVar9 == 4) {
      if (((*(int *)(param_2 + 0x2494) == 0) &&
          (*(longlong **)(param_2 + 0x2480) != (longlong *)0x0)) &&
         (**(longlong **)(param_2 + 0x2480) != 0)) {
        FUN_1403552c0();
      }
      local_968 = Proud::AddrPort::vftable;
      uVar12 = 0;
      local_958 = 0;
      local_970 = 0;
      local_960 = DAT_1405d83d0;
      local_95c = DAT_1405d83d4;
      uVar15 = uVar12;
      if (*(undefined8 **)(param_2 + 0x2480) != (undefined8 *)0x0) {
        uVar15 = **(undefined8 **)(param_2 + 0x2480);
      }
      cVar5 = FUN_140354f80(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_1403551f0(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_1403dd49c;
  }
  uVar8 = 0;
  if (*(int *)(param_2 + 0x2528) == 0) goto LAB_1403dd10d;
  _Dst = (void *)FUN_140057a60(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_140057b50(param_2 + 0x2538);
  FUN_14034fe70();
  puVar22 = PTR_DAT_1405d8008;
  local_9d8 = PTR_DAT_1405d8008;
  FUN_1403d8b90(param_2 + 0x2538);
  FUN_14034fe70();
  puVar20 = (uint *)PTR_DAT_1405d8008;
  local_9f0 = (uint *)PTR_DAT_1405d8008;
  uVar6 = FUN_14034fd90("MODELDESCRIPTION");
  iVar9 = 0;
  if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8008)) {
    iVar9 = *(int *)((longlong)puVar20 + -8);
  }
  uVar7 = uVar6;
  if ((int)uVar6 <= iVar9) {
    uVar7 = 0;
    if ((puVar20 != (uint *)0x0) && (uVar7 = 0, puVar20 != (uint *)PTR_DAT_1405d8008)) {
      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_1405d8008)) {
    iVar9 = *(int *)((longlong)puVar20 + -8);
  }
  if (iVar9 < (int)uVar21) {
    if (puVar20 == (uint *)0x0) {
      puVar20 = (uint *)PTR_DAT_1405d8008;
    }
    local_9f0 = puVar20;
    if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar21 == 0) {
      FUN_14000d2c0(&local_9f0);
    }
    else {
      uVar7 = 0;
      if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8008)) {
        uVar7 = puVar20[-2];
      }
      if (uVar21 != uVar7) {
        puVar13 = (uint *)FUN_14034fef0((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_1405d8008)) {
          uVar7 = puVar20[-2];
        }
        puVar10 = (uint *)PTR_DAT_1405d8008;
        if ((int)uVar21 < (int)uVar7) {
LAB_1403dc545:
          if (puVar20 != (uint *)0x0) {
            puVar10 = puVar20;
          }
        }
        else {
          uVar21 = uVar8;
          if (puVar20 != (uint *)0x0) {
            if (puVar20 != (uint *)PTR_DAT_1405d8008) {
              uVar21 = puVar20[-2];
            }
            goto LAB_1403dc545;
          }
        }
        FUN_14034fdc0(puVar13 + 2,puVar10,uVar21);
        FUN_14000d2c0(&local_9f0);
        local_9f0 = puVar13 + 2;
      }
    }
  }
  FUN_140057970(&local_9f0);
  puVar20 = local_9f0;
  puVar13 = local_9f0;
  if (local_9f0 == (uint *)0x0) {
    puVar13 = (uint *)PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar13,"MODELDESCRIPTION",uVar6);
  puVar13 = puVar20;
  if (puVar20 == (uint *)0x0) {
    puVar13 = (uint *)PTR_DAT_1405d8008;
  }
  uVar7 = FUN_14034fd90(puVar13);
  uVar6 = 0;
  if (0 < (int)uVar7) {
    uVar6 = uVar7;
  }
  uVar7 = 0;
  if ((puVar20 != (uint *)0x0) && (uVar7 = 0, puVar20 != (uint *)PTR_DAT_1405d8008)) {
    uVar7 = puVar20[-2];
  }
  if (((int)uVar6 < (int)uVar7) || (uVar6 = 0, puVar20 == (uint *)0x0)) {
LAB_1403dc5dd:
    if (((puVar20 != (uint *)PTR_DAT_1405d8008) && (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_1405d8008) {
    uVar6 = puVar20[-2];
    goto LAB_1403dc5dd;
  }
  FUN_14034fe70();
  puVar13 = (uint *)PTR_DAT_1405d8008;
  local_a00 = (uint *)PTR_DAT_1405d8008;
  uVar6 = FUN_14034fd90("FRIENDLYNAME");
  iVar9 = 0;
  if ((puVar13 != (uint *)0x0) && (puVar13 != (uint *)PTR_DAT_1405d8008)) {
    iVar9 = *(int *)((longlong)puVar13 + -8);
  }
  uVar7 = uVar6;
  if ((int)uVar6 <= iVar9) {
    uVar7 = 0;
    if ((puVar13 != (uint *)0x0) && (uVar7 = 0, puVar13 != (uint *)PTR_DAT_1405d8008)) {
      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_1405d8008)) {
    iVar9 = *(int *)((longlong)puVar13 + -8);
  }
  if (iVar9 < (int)uVar21) {
    if (puVar13 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1405d8008;
    }
    local_a00 = puVar13;
    if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar21 == 0) {
      FUN_14000d2c0(&local_a00);
    }
    else {
      uVar7 = 0;
      if ((puVar13 != (uint *)0x0) && (puVar13 != (uint *)PTR_DAT_1405d8008)) {
        uVar7 = puVar13[-2];
      }
      if (uVar21 != uVar7) {
        puVar10 = (uint *)FUN_14034fef0((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_1405d8008)) {
          uVar7 = puVar13[-2];
        }
        puVar11 = (uint *)PTR_DAT_1405d8008;
        if ((int)uVar21 < (int)uVar7) {
LAB_1403dc6ea:
          if (puVar13 != (uint *)0x0) {
            puVar11 = puVar13;
          }
        }
        else {
          uVar21 = uVar8;
          if (puVar13 != (uint *)0x0) {
            if (puVar13 != (uint *)PTR_DAT_1405d8008) {
              uVar21 = puVar13[-2];
            }
            goto LAB_1403dc6ea;
          }
        }
        FUN_14034fdc0(puVar10 + 2,puVar11,uVar21);
        FUN_14000d2c0(&local_a00);
        local_a00 = puVar10 + 2;
      }
    }
  }
  FUN_140057970(&local_a00);
  puVar13 = local_a00;
  puVar10 = local_a00;
  if (local_a00 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar10,"FRIENDLYNAME",uVar6);
  puVar10 = puVar13;
  if (puVar13 == (uint *)0x0) {
    puVar10 = (uint *)PTR_DAT_1405d8008;
  }
  uVar7 = FUN_14034fd90(puVar10);
  uVar6 = 0;
  if (0 < (int)uVar7) {
    uVar6 = uVar7;
  }
  uVar7 = 0;
  if ((puVar13 != (uint *)0x0) && (uVar7 = 0, puVar13 != (uint *)PTR_DAT_1405d8008)) {
    uVar7 = puVar13[-2];
  }
  if (((int)uVar6 < (int)uVar7) || (uVar6 = 0, puVar13 == (uint *)0x0)) {
LAB_1403dc782:
    if (((puVar13 != (uint *)PTR_DAT_1405d8008) && (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_1405d8008) {
    uVar6 = puVar13[-2];
    goto LAB_1403dc782;
  }
  local_a08 = (uint *)FUN_1403d98e0(local_9e0,&local_9d0,param_2 + 0x2538,&local_9f0);
  FUN_14034fe70();
  puVar10 = (uint *)PTR_DAT_1405d8008;
  local_9f8 = (uint *)PTR_DAT_1405d8008;
  local_9e8[0] = FUN_14034fd90(&DAT_140469c08);
  iVar9 = 0;
  if ((puVar10 != (uint *)0x0) && (puVar10 != (uint *)PTR_DAT_1405d8008)) {
    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_1405d8008)) {
      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_1405d8008)) {
    iVar9 = *(int *)((longlong)puVar10 + -8);
  }
  if (iVar9 < (int)uVar7) {
    if (puVar10 == (uint *)0x0) {
      puVar10 = (uint *)PTR_DAT_1405d8008;
    }
    local_9f8 = puVar10;
    if ((int)uVar7 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    if (uVar7 == 0) {
      FUN_14000d2c0(&local_9f8);
    }
    else {
      uVar6 = 0;
      if ((puVar10 != (uint *)0x0) && (puVar10 != (uint *)PTR_DAT_1405d8008)) {
        uVar6 = puVar10[-2];
      }
      if (uVar7 != uVar6) {
        puVar11 = (uint *)FUN_14034fef0((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_1405d8008)) {
          uVar6 = puVar10[-2];
        }
        puVar18 = (uint *)PTR_DAT_1405d8008;
        if ((int)uVar7 < (int)uVar6) {
LAB_1403dc8b9:
          if (puVar10 != (uint *)0x0) {
            puVar18 = puVar10;
          }
        }
        else {
          uVar7 = uVar8;
          if (puVar10 != (uint *)0x0) {
            if (puVar10 != (uint *)PTR_DAT_1405d8008) {
              uVar7 = puVar10[-2];
            }
            goto LAB_1403dc8b9;
          }
        }
        FUN_14034fdc0(puVar11 + 2,puVar18,uVar7);
        FUN_14000d2c0(&local_9f8);
        local_9f8 = puVar11 + 2;
      }
    }
  }
  FUN_140057970(&local_9f8);
  puVar10 = local_9f8;
  puVar11 = local_9f8;
  if (local_9f8 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(puVar11,&DAT_140469c08,local_9e8[0]);
  puVar11 = puVar10;
  if (puVar10 == (uint *)0x0) {
    puVar11 = (uint *)PTR_DAT_1405d8008;
  }
  uVar7 = FUN_14034fd90(puVar11);
  uVar6 = 0;
  if (0 < (int)uVar7) {
    uVar6 = uVar7;
  }
  uVar7 = 0;
  if ((puVar10 != (uint *)0x0) && (uVar7 = 0, puVar10 != (uint *)PTR_DAT_1405d8008)) {
    uVar7 = puVar10[-2];
  }
  if (((int)uVar6 < (int)uVar7) || (uVar6 = 0, puVar10 == (uint *)0x0)) {
LAB_1403dc953:
    if (((puVar10 != (uint *)PTR_DAT_1405d8008) && (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_1405d8008) {
    uVar6 = puVar10[-2];
    goto LAB_1403dc953;
  }
  uVar12 = FUN_1403d98e0(local_9e0,&local_9b8,param_2 + 0x2538,&local_a00);
  uVar12 = FUN_140352090(&local_9c0,uVar12,&local_9f8);
  local_a08 = (uint *)FUN_140352090(&local_9c8,uVar12,local_a08);
  if (puVar22 == (undefined *)0x0) {
    puVar22 = PTR_DAT_1405d8008;
  }
  local_9d8 = puVar22;
  if (*(undefined **)local_a08 != puVar22) {
    uVar12 = FUN_14034fe70();
    local_920 = uVar12;
    FUN_14034ed40(uVar12);
    local_918 = 1;
    if (((puVar22 != (undefined *)0x0) && (puVar22 != PTR_DAT_1405d8008)) &&
       (puVar22 + -8 != (undefined *)0x0)) {
      uVar12 = FUN_14034fe70();
      local_8a8 = uVar12;
      FUN_14034ed40(uVar12);
      local_8a0 = 1;
      piVar2 = (int *)(puVar22 + -4);
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_14034ff60(puVar22 + -8);
      }
      FUN_14034edd0(uVar12);
      uVar12 = local_920;
    }
    puVar22 = *(undefined **)local_a08;
    if (((puVar22 != PTR_DAT_1405d8008) && (puVar22 != (undefined *)0x0)) &&
       (puVar22 != (undefined *)0x8)) {
      *(int *)(puVar22 + -4) = *(int *)(puVar22 + -4) + 1;
    }
    local_9d8 = puVar22;
    FUN_14034edd0(uVar12);
  }
  if (((local_9c8 != (undefined *)0x0) && (local_9c8 != PTR_DAT_1405d8008)) &&
     (local_9c8 + -8 != (undefined *)0x0)) {
    local_930 = FUN_14034fe70();
    FUN_14034ed40(local_930);
    local_928 = 1;
    piVar2 = (int *)(local_9c8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(local_9c8 + -8);
    }
    FUN_14034edd0(local_930);
  }
  local_9c8 = PTR_DAT_1405d8008;
  if (((local_9c0 != (undefined *)0x0) && (local_9c0 != PTR_DAT_1405d8008)) &&
     (local_9c0 + -8 != (undefined *)0x0)) {
    local_950 = FUN_14034fe70();
    FUN_14034ed40(local_950);
    local_948 = 1;
    piVar2 = (int *)(local_9c0 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(local_9c0 + -8);
    }
    FUN_14034edd0(local_950);
  }
  local_9c0 = PTR_DAT_1405d8008;
  if (((local_9b8 != (undefined *)0x0) && (local_9b8 != PTR_DAT_1405d8008)) &&
     (local_9b8 + -8 != (undefined *)0x0)) {
    local_940 = FUN_14034fe70();
    FUN_14034ed40(local_940);
    local_938 = 1;
    piVar2 = (int *)(local_9b8 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(local_9b8 + -8);
    }
    FUN_14034edd0(local_940);
  }
  local_9b8 = PTR_DAT_1405d8008;
  if (((puVar10 != (uint *)0x0) && (puVar10 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar10 + -2 != (uint *)0x0)) {
    uVar12 = FUN_14034fe70();
    local_8b8 = uVar12;
    FUN_14034ed40(uVar12);
    local_8b0 = 1;
    puVar11 = puVar10 + -1;
    *puVar11 = *puVar11 - 1;
    if (*puVar11 == 0) {
      FUN_14034ff60(puVar10 + -2);
    }
    FUN_14034edd0(uVar12);
  }
  if (((local_9d0 != (undefined *)0x0) && (local_9d0 != PTR_DAT_1405d8008)) &&
     (local_9d0 + -8 != (undefined *)0x0)) {
    uVar12 = FUN_14034fe70();
    local_900 = uVar12;
    FUN_14034ed40(uVar12);
    local_8f8 = 1;
    piVar2 = (int *)(local_9d0 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(local_9d0 + -8);
    }
    FUN_14034edd0(uVar12);
  }
  local_9d0 = PTR_DAT_1405d8008;
  if (((puVar13 != (uint *)0x0) && (puVar13 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar13 + -2 != (uint *)0x0)) {
    uVar12 = FUN_14034fe70();
    local_8f0 = uVar12;
    FUN_14034ed40(uVar12);
    local_8e8 = 1;
    puVar10 = puVar13 + -1;
    *puVar10 = *puVar10 - 1;
    if (*puVar10 == 0) {
      FUN_14034ff60(puVar13 + -2);
    }
    FUN_14034edd0(uVar12);
  }
  if (((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8008)) &&
     (puVar20 + -2 != (uint *)0x0)) {
    uVar12 = FUN_14034fe70();
    local_8c8 = uVar12;
    FUN_14034ed40(uVar12);
    local_8c0 = 1;
    puVar13 = puVar20 + -1;
    *puVar13 = *puVar13 - 1;
    if (*puVar13 == 0) {
      FUN_14034ff60(puVar20 + -2);
    }
    FUN_14034edd0(uVar12);
  }
  if (((puVar22 != (undefined *)0x0) && (puVar22 != PTR_DAT_1405d8008)) &&
     (2 < *(int *)(puVar22 + -8))) {
    local_778 = local_770;
    FUN_14012a1d0(&local_778,puVar22,3);
    puVar14 = local_778;
    FUN_14034fe70();
    puVar20 = (uint *)PTR_DAT_1405d8010;
    local_a08 = (uint *)PTR_DAT_1405d8010;
    uVar6 = FUN_14034fcf0(puVar14);
    iVar9 = 0;
    if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8010)) {
      iVar9 = *(int *)((longlong)puVar20 + -8);
    }
    uVar7 = uVar6;
    if ((int)uVar6 <= iVar9) {
      uVar7 = 0;
      if ((puVar20 != (uint *)0x0) && (uVar7 = 0, puVar20 != (uint *)PTR_DAT_1405d8010)) {
        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_1405d8010)) {
      iVar9 = *(int *)((longlong)puVar20 + -8);
    }
    if (iVar9 < (int)uVar21) {
      if (puVar20 == (uint *)0x0) {
        puVar20 = (uint *)PTR_DAT_1405d8010;
      }
      local_a08 = puVar20;
      if ((int)uVar21 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (uVar21 == 0) {
        FUN_1400031d0(&local_a08);
      }
      else {
        uVar7 = 0;
        if ((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8010)) {
          uVar7 = puVar20[-2];
        }
        if (uVar21 != uVar7) {
          puVar13 = (uint *)FUN_14034fef0((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_1405d8010)) {
            uVar7 = puVar20[-2];
          }
          puVar10 = (uint *)PTR_DAT_1405d8010;
          if ((int)uVar21 < (int)uVar7) {
LAB_1403dcdbc:
            if (puVar20 != (uint *)0x0) {
              puVar10 = puVar20;
            }
          }
          else {
            uVar21 = uVar8;
            if (puVar20 != (uint *)0x0) {
              if (puVar20 != (uint *)PTR_DAT_1405d8010) {
                uVar21 = puVar20[-2];
              }
              goto LAB_1403dcdbc;
            }
          }
          FUN_14034fd20(puVar13 + 2,puVar10,uVar21);
          FUN_1400031d0(&local_a08);
          local_a08 = puVar13 + 2;
        }
      }
    }
    FUN_140002e10(&local_a08);
    puVar20 = local_a08;
    puVar13 = local_a08;
    if (local_a08 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1405d8010;
    }
    FUN_14034fd20(puVar13,puVar14,uVar6);
    puVar13 = puVar20;
    if (puVar20 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1405d8010;
    }
    uVar6 = FUN_14034fcf0(puVar13);
    plVar1 = local_9e0;
    uVar8 = 0;
    if (0 < (int)uVar6) {
      uVar8 = uVar6;
    }
    uVar6 = 0;
    if ((puVar20 != (uint *)0x0) && (uVar6 = 0, puVar20 != (uint *)PTR_DAT_1405d8010)) {
      uVar6 = puVar20[-2];
    }
    if (((int)uVar8 < (int)uVar6) || (uVar8 = 0, puVar20 == (uint *)0x0)) {
LAB_1403dce50:
      if (((puVar20 != (uint *)PTR_DAT_1405d8010) && (puVar20 != (uint *)0x0)) &&
         (puVar20 + -2 != (uint *)0x0)) {
        puVar20[-2] = uVar8;
        *(ushort *)((longlong)puVar20 + (longlong)(int)uVar8 * 2) = 0;
      }
    }
    else if (puVar20 != (uint *)PTR_DAT_1405d8010) {
      uVar8 = puVar20[-2];
      goto LAB_1403dce50;
    }
    puVar13 = puVar20;
    if (puVar20 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1405d8010;
    }
    if (puVar13 == (uint *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    uVar8 = 0;
    puVar13 = puVar20;
    if (puVar20 == (uint *)0x0) {
      puVar13 = (uint *)PTR_DAT_1405d8010;
    }
    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_1403dcf34;
        puVar17 = (undefined *)*plVar4;
        if ((undefined *)*plVar4 == (undefined *)0x0) {
          puVar17 = PTR_DAT_1405d8010;
        }
        iVar9 = FUN_14034fd30(puVar17);
        if (iVar9 == 0) break;
        plVar4 = (longlong *)plVar4[2];
      }
      if (plVar4 != (longlong *)0x0) goto LAB_1403dcf48;
    }
LAB_1403dcf34:
    puVar14 = (undefined1 *)FUN_1403db370(plVar1 + 0x15,&local_a08);
    *puVar14 = 0;
LAB_1403dcf48:
    if (((puVar20 != (uint *)0x0) && (puVar20 != (uint *)PTR_DAT_1405d8010)) &&
       (puVar20 + -2 != (uint *)0x0)) {
      uVar12 = FUN_14034fe70();
      local_8d8 = uVar12;
      FUN_14034ed40(uVar12);
      local_8d0 = 1;
      puVar13 = puVar20 + -1;
      *puVar13 = *puVar13 - 1;
      if (*puVar13 == 0) {
        FUN_14034ff60(puVar20 + -2);
      }
      FUN_14034edd0(uVar12);
    }
    if (local_778 != local_770) {
      free(local_778);
    }
  }
  if (((puVar22 != (undefined *)0x0) && (puVar22 != PTR_DAT_1405d8008)) &&
     (puVar22 + -8 != (undefined *)0x0)) {
    uVar12 = FUN_14034fe70();
    local_910 = uVar12;
    FUN_14034ed40(uVar12);
    local_908 = 1;
    piVar2 = (int *)(puVar22 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar22 + -8);
    }
    FUN_14034edd0(uVar12);
  }
LAB_1403dd10d:
  if (3 < *(int *)(param_2 + 0x2490)) {
    return;
  }
  *(undefined8 *)(param_2 + 0x2490) = 4;
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403dd599)
// WARNING: Removing unreachable block (ram,0x0001403dd5a4)

void FUN_1403dd4d0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_14034ed40(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_1403dc280(param_1,lVar2);
    if (*(int *)(lVar2 + 0x2490) == 5) {
      lVar2 = *(longlong *)(lVar1 + 0x10);
      FUN_1403da430(param_1 + 0x50,lVar1,0,param_4,uVar3);
      lVar1 = lVar2;
    }
    else {
      lVar1 = *(longlong *)(lVar1 + 0x10);
    }
  }
  FUN_14034edd0(param_1 + 0x10);
  return;
}



void FUN_1403dd5d0(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  int iVar4;
  
  FUN_14034ed40(param_1 + 0x10);
  if (*(int *)(param_1 + 0x48) == 0) {
    FUN_1403dadb0(param_1);
  }
  *(int *)(param_1 + 0x48) = *(int *)(param_1 + 0x48) + 1;
  iVar4 = 0;
  while( true ) {
    if (iVar4 == *(int *)(param_1 + 0x118)) {
      FUN_1403dd4d0(param_1);
      FUN_1403d9bc0(param_1);
      FUN_14034edd0(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_1403da800(param_1);
    }
    else if (iVar1 == 1) {
      FUN_1403da9d0(param_1);
    }
    else if (iVar1 == 2) {
      FUN_1403db6d0(param_1);
    }
    if (*(int *)(param_1 + 0x118) <= iVar4) {
                    // WARNING: Subroutine does not return
      FUN_14034f800();
    }
    iVar4 = iVar4 + 1;
  }
                    // WARNING: Subroutine does not return
  FUN_14034f800();
}



ulonglong FUN_1403dd6b0(longlong param_1,undefined8 param_2)

{
  uint uVar1;
  int iVar2;
  ulonglong uVar3;
  
  uVar1 = *(uint *)(param_1 + 0x1a4);
  iVar2 = FUN_1403c6350(param_1 + 0x1b8,param_2,*(undefined8 *)(param_1 + 0x1c8));
  if (iVar2 < (int)uVar1) {
    uVar3 = FUN_1403c6350(param_1 + 0x1b8,param_2,*(undefined8 *)(param_1 + 0x1c8));
  }
  else {
    uVar3 = (ulonglong)uVar1;
  }
  return uVar3;
}



void FUN_1403dd720(longlong param_1)

{
  FUN_1403a2bc0(param_1 + 0x170);
  return;
}



int FUN_1403dd730(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_140355560(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_140356130(uVar3,DAT_1405d8048);
      if (iVar2 != 0) {
        *(undefined1 *)(param_1 + 0xc0) = 0;
        if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
          uVar4 = **(undefined8 **)(param_1 + 0x128);
        }
        FUN_1403552c0(uVar4);
        return iVar2;
      }
      *(undefined8 *)(param_1 + 0x1f0) = 0;
    }
  }
  return 0;
}



void FUN_1403dd7f0(longlong param_1)

{
  if (*(undefined8 **)(param_1 + 0xe8) != (undefined8 *)0x0) {
    FUN_1403552c0(**(undefined8 **)(param_1 + 0xe8));
    return;
  }
  FUN_1403552c0();
  return;
}



void FUN_1403dd810(longlong param_1)

{
  if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
    FUN_140354ad0(**(undefined8 **)(param_1 + 0x128));
    return;
  }
  FUN_140354ad0();
  return;
}



void FUN_1403dd830(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_140354860(uVar1,local_28);
  FUN_1403544e0(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_1403dd890(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_1403dd8c0(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_1405d84f0 ^ (ulonglong)auStack_6a8;
  uVar4 = 0;
  uVar5 = uVar4;
  if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
    uVar5 = **(undefined8 **)(param_1 + 0x128);
  }
  cVar1 = FUN_140355560(uVar5);
  if ((cVar1 == '\0') && (*(char *)(param_1 + 0x80) == '\0')) {
    uVar5 = (**(code **)(**(longlong **)(param_1 + 0x120) + 0x30))();
    iVar2 = FUN_1403dd6b0(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_1403a2f40(param_1 + 0x170,&local_678,iVar2);
      uVar5 = uVar4;
      if (*(undefined8 **)(param_1 + 0x128) != (undefined8 *)0x0) {
        uVar5 = **(undefined8 **)(param_1 + 0x128);
      }
      iVar3 = FUN_140356640(uVar5,&local_678);
      FUN_1403c6310(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_1403552c0(uVar4);
      }
      if (100 < local_668) {
        operator_delete__(local_678);
      }
    }
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403dda40(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_1405d84f0 ^ (ulonglong)auStack_de8;
  (**(code **)(**(longlong **)(param_1 + 0x120) + 0x20))();
  local_2c = 200;
  local_30 = 0;
  local_38 = local_cb8;
  FUN_1403841b0(local_d68);
  FUN_140383e30(local_d68,local_d40,0x80);
  FUN_1403a3190(param_2,local_cb8,local_d68);
  FUN_1403a2e90(param_1 + 0x170,local_cb8,param_3);
  local_dc0 = local_d60;
  FUN_140399690(local_d60);
  if (local_d58 != 0) {
    if (local_d4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d50 = 0;
  }
  if (local_38 == (undefined1 *)0x0) {
    FUN_14034f420(local_db8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_db8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



void FUN_1403ddba0(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_1403a3340(param_1 + 0x2e);
  FUN_1403a9d90(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_1403556b0(lVar2);
      FUN_14034ff60(lVar2);
    }
    FUN_14034ff60(plVar1);
  }
  param_1[8] = Proud::IHasOverlappedIo::vftable;
  *param_1 = Proud::ICompletionContext::vftable;
  return;
}



undefined8 FUN_1403ddc80(void)

{
  return 3;
}



void FUN_1403ddc90(longlong param_1)

{
  FUN_1403dde80(param_1 + -0x40);
  return;
}



undefined8 *
FUN_1403ddca0(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_140354d60(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_1403a9d50(param_1 + 0x26,(longlong)DAT_1405d80ec);
  FUN_1403a32b0(param_1 + 0x2e);
  *(undefined1 *)(param_1 + 0x10) = 0;
  *(undefined1 *)(param_1 + 0x18) = 0;
  param_1[0x24] = param_2;
  local_res10 = (longlong *)FUN_14034fef0(0x400);
  lVar3 = lVar4;
  if (local_res10 != (longlong *)0x0) {
    lVar3 = FUN_140355800(local_res10,0,param_2,param_4,uVar5);
  }
  if (lVar3 == 0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_14034fef0(0x10);
    local_res10[1] = 1;
    *local_res10 = lVar3;
  }
  plVar1 = local_res10;
  FUN_140351ba0(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_1403556b0(lVar3);
        FUN_14034ff60(lVar3);
      }
      FUN_14034ff60(plVar2);
    }
  }
  lVar3 = lVar4;
  if ((longlong *)param_1[0x25] != (longlong *)0x0) {
    lVar3 = *(longlong *)param_1[0x25];
  }
  FUN_1403549c0(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_1403a2c30(lVar4);
  param_1[0x3e] = 0;
  param_1[0x3f] = 0;
  return param_1;
}



void * FUN_1403dde80(void *param_1,uint param_2)

{
  FUN_1403ddba0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403ddeb0(undefined8 *param_1)

{
  *param_1 = Proud::IReliableUdpHostDelegate::vftable;
  return;
}



undefined8 * FUN_1403ddec0(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_1403ddef0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x148);
}



undefined4 FUN_1403ddf00(longlong param_1)

{
  return *(undefined4 *)(*(longlong *)(param_1 + 0x660) + 0x6b4);
}



void FUN_1403ddf10(longlong param_1)

{
                    // WARNING: Could not recover jumptable at 0x0001403ddf1f. 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_1403ddf30(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_1405d84f0 ^ (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_140357640(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_1403ddfd0(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_1405d83d0;
  *(undefined2 *)((longlong)param_2 + 0xc) = DAT_1405d83d4;
  return param_2;
}



void FUN_1403de040(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_1403de0e0(longlong param_1)

{
  longlong *plVar1;
  undefined8 uVar2;
  double dVar3;
  double dVar4;
  
  uVar2 = (**(code **)(**(longlong **)(param_1 + 0x670) + 0x58))();
  FUN_14034ed40(uVar2);
  plVar1 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x70);
  dVar3 = (double)FUN_14035a090(*(longlong *)(param_1 + 0x670) + 0xb08);
  dVar4 = (double)(**(code **)(*plVar1 + 0x1c0))(plVar1);
  FUN_14034edd0(uVar2);
  return dVar3 * 2.0 + dVar4 + 1.0;
}



void FUN_1403de180(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;
      }
    }
    uRam0000000000000000 = 1;
  }
  return;
}



longlong FUN_1403de1c0(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_1403de1e0(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_14039b1d0(uVar4,*(undefined4 *)(lVar1 + 0x56c));
    FUN_1403e1f50(lVar5,*(undefined4 *)(*param_1 + 0x56c),uVar3,&local_38,param_2,uVar6,param_3);
  }
  return;
}



undefined8 FUN_1403de2f0(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_1403e1c80(lVar1 + -0x40,&local_18);
    return uVar2;
  }
  uVar2 = FUN_1403e1c80(0,&local_18);
  return uVar2;
}



void FUN_1403de370(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_140355560(lVar3);
    if (cVar2 != '\0') {
      lVar3 = lVar5;
      if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
         (lVar1 = **(longlong **)(param_1 + 0x18), lVar1 != 0)) {
        lVar3 = lVar1 + -0x40;
      }
      FUN_1403e1e00(lVar3);
      if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
         (lVar3 = **(longlong **)(param_1 + 0x18), lVar3 != 0)) {
        lVar5 = lVar3 + -0x40;
      }
      FUN_1403e1be0(lVar5);
      plVar4 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x1818);
      (**(code **)(*plVar4 + 0xd0))(plVar4,1,&DAT_1405f2490,param_1 + 0x56c);
      lVar5 = *(longlong *)(param_1 + 0x670);
      if ((*(char *)(lVar5 + 0x1790) != '\0') || (*(int *)(lVar5 + 0x6c8) != 0)) {
        FUN_1403b8ef0(lVar5,1,&DAT_140469e90,*(undefined4 *)(param_1 + 0x56c));
      }
    }
    *(undefined1 *)(param_1 + 0x20) = 0;
  }
  return;
}



void FUN_1403de480(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_1405d83d0;
  *(undefined2 *)(param_2 + 0xc) = DAT_1405d83d4;
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403de4f0(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 = 0x1403de506;
  local_1950 = 0xfffffffffffffffe;
  local_28 = DAT_1405d84f0 ^ (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_1405d83d4;
      iVar4 = DAT_1405d83d0;
      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_1403841b0(local_1988);
        FUN_140383c40(local_1988);
        FUN_140384310(local_1988,0x800);
        FUN_140384310(local_1988,0);
        FUN_140058870(local_1988,0x12);
        if ((*(longlong **)(*param_1 + 0x18) == (longlong *)0x0) ||
           (lVar5 = **(longlong **)(*param_1 + 0x18), lVar5 == 0)) {
          lVar5 = 0;
        }
        else {
          lVar5 = lVar5 + -0x40;
        }
        FUN_140384db0(local_1988,lVar5 + 0x128);
        FUN_140384db0(local_1988,param_4);
        FUN_140058470(local_1988,*(undefined4 *)(*param_1 + 0x56c));
        local_cbc = 200;
        local_cc0 = 0;
        local_cc8 = local_1948;
        FUN_140361500(local_cb8,local_1988);
        FUN_1403607b0(local_1948,local_cb8);
        FUN_1403606a0();
        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_1403ab430(*(undefined8 *)(*param_1 + 0x670));
        FUN_1403dda40(uVar6,local_1948,&local_1998);
        if ((*(char *)(*(longlong *)(*param_1 + 0x670) + 0x1790) != '\0') ||
           (*(int *)(*(longlong *)(*param_1 + 0x670) + 0x6c8) != 0)) {
          plVar7 = (longlong *)FUN_140353960(param_4,&local_1998);
          puVar9 = (undefined *)*plVar7;
          if ((undefined *)*plVar7 == (undefined *)0x0) {
            puVar9 = PTR_DAT_1405d8010;
          }
          FUN_1403b8ef0(*(undefined8 *)(*param_1 + 0x670),1,
                        L"Message_PeerUdp_ServerHolepunchAck. AddrOfHereAtServer=%s",puVar9);
          puVar9 = local_1998;
          if (((local_1998 != (undefined *)0x0) && (local_1998 != PTR_DAT_1405d8010)) &&
             (puVar1 = local_1998 + -8, puVar1 != (undefined *)0x0)) {
            uVar6 = FUN_14034fe70();
            local_1960 = uVar6;
            FUN_14034ed40(uVar6);
            local_1958 = 1;
            piVar2 = (int *)(puVar9 + -4);
            *piVar2 = *piVar2 + -1;
            if (*piVar2 == 0) {
              FUN_14034ff60(puVar1);
            }
            FUN_14034edd0(uVar6);
          }
        }
        *(int *)(lVar3 + 0x18) = *(int *)(lVar3 + 0x18) + 1;
        FUN_1403606a0(local_1948);
        local_1998 = local_1980;
        FUN_140399690(local_1980);
        if ((local_1978 != 0) && (local_196c < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
      }
    }
  }
  return;
}



void FUN_1403de820(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_1403841b0(local_58);
  FUN_140383c40(local_58);
  FUN_140384310(local_58,0x800);
  FUN_140384310(local_58,0);
  FUN_140058870(local_58,0x1e);
  FUN_140058470(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_140399790();
    }
LAB_1403de8cf:
    lVar8 = (longlong)local_40;
    local_40 = local_40 + 0x10;
    if ((local_40 < 0) || (local_3c < local_40)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    puVar7 = (undefined8 *)(local_48 + lVar8);
  }
  else {
    if (local_48 != 0) goto LAB_1403de8cf;
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar6 = *(int *)(local_50 + 0x18);
    FUN_1400179d0(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_140017b00(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_140399790();
    }
  }
  else if (local_48 == 0) {
    if (local_50 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar6 = *(int *)(local_50 + 0x18);
    FUN_1400179d0(local_50,iVar6 + 0x10);
    lVar8 = lVar9;
    if (*(int *)(local_50 + 0x18) != 0) {
      lVar8 = *(longlong *)(local_50 + 0x10);
    }
    puVar7 = (undefined8 *)(lVar8 + iVar6);
    goto LAB_1403de9ae;
  }
  iVar6 = local_40 + 0x10;
  if ((iVar6 < 0) || (local_3c < iVar6)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  puVar7 = (undefined8 *)(local_48 + local_40);
  local_40 = iVar6;
LAB_1403de9ae:
  *puVar7 = local_88;
  puVar7[1] = CONCAT26(uStack_7a,CONCAT24(uStack_7c,uStack_80));
  FUN_140017b00(local_58);
  FUN_140384db0(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_1405d81cc;
  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_14039b1d0(uVar4,*(undefined4 *)(lVar8 + 0x56c));
  FUN_1403e2100(lVar9,*(undefined4 *)(*param_1 + 0x56c),uVar3,&local_88,local_58,uVar2,local_78);
  FUN_140399690(&local_50);
  if ((local_48 != 0) && (local_3c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



void FUN_1403deaf0(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_1403841b0(local_98);
  FUN_140383c40(local_98);
  FUN_140384310(local_98,0x800);
  FUN_140384310(local_98,0);
  FUN_140058870(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_140399790();
    }
  }
  else if (local_88 == 0) {
    if (local_90 == 0) {
                    // WARNING: Subroutine does not return
      FUN_140399790();
    }
    iVar3 = *(int *)(local_90 + 0x18);
    FUN_1400179d0(local_90,iVar3 + 0x10);
    lVar13 = lVar15;
    if (*(int *)(local_90 + 0x18) != 0) {
      lVar13 = *(longlong *)(local_90 + 0x10);
    }
    puVar12 = (undefined8 *)(lVar13 + iVar3);
    goto LAB_1403debce;
  }
  lVar13 = (longlong)local_80;
  local_80 = local_80 + 0x10;
  if ((local_80 < 0) || (local_7c < local_80)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  puVar12 = (undefined8 *)(local_88 + lVar13);
LAB_1403debce:
  *puVar12 = local_a8;
  puVar12[1] = CONCAT26(uStack_9a,CONCAT24(uStack_9c,uStack_a0));
  FUN_140017b00(local_98);
  FUN_140058470(local_98,*(undefined4 *)(*(longlong *)(*param_1 + 0x670) + 0x1578));
  FUN_140384db0(local_98,param_4);
  FUN_140384db0(local_98,param_5);
  FUN_140384db0(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_1405d81cc;
  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_14039b1d0(uVar7,*(undefined4 *)(lVar13 + 0x56c));
  FUN_1403e2100(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_140353960(param_2,&local_a8);
    plVar9 = (longlong *)FUN_140353960(param_5,&local_50);
    plVar10 = (longlong *)FUN_140353960(param_4,local_res18);
    puVar16 = (undefined *)*plVar8;
    if ((undefined *)*plVar8 == (undefined *)0x0) {
      puVar16 = PTR_DAT_1405d8010;
    }
    puVar14 = (undefined *)*plVar9;
    if ((undefined *)*plVar9 == (undefined *)0x0) {
      puVar14 = PTR_DAT_1405d8010;
    }
    puVar17 = (undefined *)*plVar10;
    if ((undefined *)*plVar10 == (undefined *)0x0) {
      puVar17 = PTR_DAT_1405d8010;
    }
    FUN_1403b8ef0(*(undefined8 *)(*param_1 + 0x670),1,&DAT_140469ff0,puVar17,puVar14,puVar16);
    if (((local_res18[0] != (longlong *)0x0) && (local_res18[0] != (longlong *)PTR_DAT_1405d8010))
       && (local_res18[0] + -1 != (longlong *)0x0)) {
      uVar11 = FUN_14034fe70();
      local_70 = uVar11;
      FUN_14034ed40(uVar11);
      local_68 = CONCAT71(local_68._1_7_,1);
      piVar1 = (int *)((longlong)local_res18[0] + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_res18[0] + -1);
      }
      FUN_14034edd0(uVar11);
    }
    local_res18[0] = (longlong *)PTR_DAT_1405d8010;
    if (((local_50 != (undefined *)0x0) && (local_50 != PTR_DAT_1405d8010)) &&
       (local_50 + -8 != (undefined *)0x0)) {
      uVar11 = FUN_14034fe70();
      local_70 = uVar11;
      FUN_14034ed40(uVar11);
      local_68 = CONCAT71(local_68._1_7_,1);
      piVar1 = (int *)(local_50 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(local_50 + -8);
      }
      FUN_14034edd0(uVar11);
    }
    ppuVar5 = local_a8;
    local_50 = PTR_DAT_1405d8010;
    if (((local_a8 != (undefined **)0x0) && (local_a8 != (undefined **)PTR_DAT_1405d8010)) &&
       (ppuVar2 = local_a8 + -1, ppuVar2 != (undefined **)0x0)) {
      uVar11 = FUN_14034fe70();
      local_70 = uVar11;
      FUN_14034ed40(uVar11);
      local_68 = CONCAT71(local_68._1_7_,1);
      piVar1 = (int *)((longlong)ppuVar5 + -4);
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_14034ff60(ppuVar2);
      }
      FUN_14034edd0(uVar11);
    }
  }
  local_res18[0] = &local_90;
  FUN_140399690(&local_90);
  if ((local_88 != 0) && (local_7c < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



void FUN_1403deec0(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_1403841b0(local_40);
    FUN_140383c40(local_40);
    FUN_140384310(local_40,0x800);
    FUN_140384310(local_40,0);
    FUN_140058870(local_40,0x27);
    local_60[0] = 1;
    lVar5 = 0;
    local_58 = 0;
    local_50 = 1;
    local_4c = 0xffffffff;
    local_48 = 1;
    local_47 = DAT_1405d81cc;
    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_14039b1d0(uVar4,*(undefined4 *)((longlong)param_1 + 0x55c));
    FUN_1403e2100(lVar5,*(undefined4 *)((longlong)param_1 + 0x55c),uVar3,&local_70,local_40,uVar6,
                  local_60);
    FUN_140399690(local_38);
    if ((local_30 != 0) && (local_24 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 FUN_1403df050(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_1403ab240(*(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_1403ab240(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_1405d8080;
        FUN_1403841b0(local_c8);
        FUN_140383c40(local_c8);
        FUN_140384310(local_c8,0x800);
        FUN_140384310(local_c8,0);
        FUN_140058870(local_c8,0x10);
        local_d8 = *(undefined4 *)(lVar2 + 0x1c);
        uStack_d4 = *(undefined4 *)(lVar2 + 0x20);
        uStack_d0 = *(undefined4 *)(lVar2 + 0x24);
        uStack_cc = *(undefined4 *)(lVar2 + 0x28);
        FUN_140090370(local_c8,&local_d8);
        FUN_140058470(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_1405d81cc;
        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_1403ddfd0(param_1,local_48);
        uVar6 = (**(code **)(*plVar3 + 0x30))(plVar3);
        uVar5 = FUN_14039b1d0(uVar6,1);
        FUN_1403e2100(lVar13,1,uVar5,uVar8,local_c8,uVar7,local_70);
        FUN_140399690(local_c0);
        if ((local_b8 != 0) && (local_ac < 0)) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
      }
    }
    else if (*(int *)(lVar2 + 8) == 1) {
      FUN_1403ab240(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_1403de820(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_1403de820(param_1,&local_80,&local_d8);
            }
          }
        }
        if (DAT_1405d808c < *(int *)(lVar2 + 0x18)) {
          piVar1 = (int *)(lVar2 + 0x30);
          *piVar1 = *piVar1 + -1;
          if (*piVar1 < 0) {
            *(undefined4 *)(lVar2 + 0x30) = DAT_1405d80e8;
            *(short *)(lVar2 + 0x34) = *(short *)(lVar2 + 0x34) + (short)_DAT_1405f0640;
            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_1405f0640) {
            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_1403de820(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_1405f0640);
          }
        }
      }
    }
    uVar7 = 1;
  }
  else {
    uVar7 = 0;
  }
  return uVar7;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403df450(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_1405d84f0 ^ (ulonglong)auStack_628;
  local_5f8 = Proud::AddrPort::vftable;
  lVar11 = 0;
  iVar4 = 0;
  local_5f0 = 0;
  local_5ec = 0;
  cVar3 = FUN_140384b70(param_2,local_5d0);
  if (cVar3 == '\0') {
    if ((*(char *)(param_1 + 0x1790) == '\0') && (*(int *)(param_1 + 0x6c8) == 0)) {
      return;
    }
    local_488 = local_480;
    FUN_14012a1d0(&local_488,"RemotePeer.cpp",3);
    local_608 = (undefined ***)CONCAT44(local_608._4_4_,0x9b);
    FUN_1403b8ef0(param_1,1,&DAT_14046a108,local_488);
    puVar8 = local_480;
    _Memory = local_488;
  }
  else {
    local_4c8 = 0;
    uStack_4c4 = 0;
    uStack_4c0 = 0;
    uStack_4bc = 0;
    cVar3 = FUN_1403840e0(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_14012a1d0(&local_158,"RemotePeer.cpp",3);
      local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xa0);
      FUN_1403b8ef0(param_1,1,&DAT_14046a108,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_1403840e0(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_14012a1d0(&local_378,"RemotePeer.cpp",3);
        local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xa5);
        FUN_1403b8ef0(param_1,1,&DAT_14046a108,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_140384b10(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_1403b68a0(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_14034ff60(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_140353960(&local_5e8,&local_5a0);
            plVar6 = (longlong *)FUN_140353960(&local_5f8,&local_5c8);
            local_608 = (undefined ***)*plVar5;
            if ((undefined ***)*plVar5 == (undefined ***)0x0) {
              local_608 = (undefined ***)PTR_DAT_1405d8010;
            }
            puVar12 = (undefined *)*plVar6;
            if ((undefined *)*plVar6 == (undefined *)0x0) {
              puVar12 = PTR_DAT_1405d8010;
            }
            FUN_1403b8ef0(param_1,1,&DAT_14046a0c0,puVar12);
            if (((local_5c8 != (undefined *)0x0) && (local_5c8 != PTR_DAT_1405d8010)) &&
               (local_5c8 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_14034fe70();
              local_518 = uVar7;
              FUN_14034ed40(uVar7);
              local_510 = 1;
              piVar1 = (int *)(local_5c8 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_5c8 + -8);
              }
              FUN_14034edd0(uVar7);
            }
            local_5c8 = PTR_DAT_1405d8010;
            if (((local_5a0 != (undefined *)0x0) && (local_5a0 != PTR_DAT_1405d8010)) &&
               (local_5a0 + -8 != (undefined *)0x0)) {
              uVar7 = FUN_14034fe70();
              local_4f8 = uVar7;
              FUN_14034ed40(uVar7);
              local_4f0 = 1;
              piVar1 = (int *)(local_5a0 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_5a0 + -8);
              }
              FUN_14034edd0(uVar7);
            }
          }
          FUN_140352ee0(lVar13 + 0x570);
          cVar3 = FUN_140352ee0(lVar13 + 0x580);
          if (cVar3 != '\0') {
            if ((*(longlong **)(lVar13 + 0x18) == (longlong *)0x0) ||
               (lVar10 = **(longlong **)(lVar13 + 0x18), lVar9 = lVar10 + -0x40, lVar10 == 0)) {
              lVar9 = lVar11;
            }
            cVar3 = FUN_140352ee0(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_1403deaf0(lVar10,&local_568,&local_4d8,&local_558);
                }
              }
            }
          }
          cVar3 = FUN_140352ee0(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_1403deaf0(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_1403deaf0(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_14012a1d0(&local_268,"RemotePeer.cpp",3);
        local_608 = (undefined ***)CONCAT44(local_608._4_4_,0xaa);
        FUN_1403b8ef0(param_1,1,&DAT_14046a108,local_268);
        puVar8 = local_260;
        _Memory = local_268;
      }
    }
  }
  if (_Memory != puVar8) {
    free(_Memory);
  }
  return;
}



void FUN_1403dfb80(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_140363af0(plVar2,*plVar2,param_3,param_4,0xfffffffffffffffe);
    }
  }
  FUN_140399690(param_1 + 8);
  if (*(longlong *)(param_1 + 0x10) != 0) {
    if (*(int *)(param_1 + 0x1c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(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_1403dfbf0(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_1405d84f0 ^ (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_1403840e0(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_140384b70(param_2,local_168);
    if ((((cVar4 != '\0') && (cVar4 = FUN_140384b10(param_2,&local_148), cVar4 != '\0')) &&
        (cVar4 = FUN_140384b10(param_2,&local_158), cVar4 != '\0')) &&
       (cVar4 = FUN_140384b10(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_1403b68a0(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_14034ff60(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_1403b80b0(lVar11 + 0x28,&local_120);
          FUN_1403b7f70(&local_120);
          local_a8 = _DAT_1405f2490;
          uStack_a0 = uRam00000001405f2498;
          local_98 = _DAT_1405f24a0;
          local_88 = _DAT_1405f24b0;
          uStack_80 = _DAT_1405f24b8;
          local_78 = _DAT_1405f24c0;
          uStack_70 = _DAT_1405f24c8;
          local_68 = _DAT_1405f24d0;
          uStack_64 = uRam00000001405f24d4;
          uStack_60 = _DAT_1405f24d8;
          uStack_5c = uRam00000001405f24dc;
          local_58 = _DAT_1405f24e0;
          uStack_54 = _DAT_1405f24e4;
          uStack_50 = uRam00000001405f24e8;
          uStack_4c = uRam00000001405f24ec;
          uStack_90 = _DAT_1405f24a8 & 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_1405f2490,param_1 + 0x1578);
          if ((*(char *)(param_1 + 0x1790) != '\0') || (*(int *)(param_1 + 0x6c8) != 0)) {
            plVar6 = (longlong *)FUN_140353960(&local_108,&local_f8);
            plVar7 = (longlong *)FUN_140353960(&local_138,&local_118);
            plVar8 = (longlong *)FUN_140353960(&local_158,&local_128);
            plVar9 = (longlong *)FUN_140353960(&local_148,&local_110);
            local_188 = (undefined ***)*plVar6;
            if ((undefined *)*plVar6 == (undefined *)0x0) {
              local_188 = (undefined ***)PTR_DAT_1405d8010;
            }
            local_190 = (undefined ***)*plVar7;
            if ((undefined *)*plVar7 == (undefined *)0x0) {
              local_190 = (undefined ***)PTR_DAT_1405d8010;
            }
            local_198 = (undefined4 *)*plVar8;
            if ((undefined *)*plVar8 == (undefined *)0x0) {
              local_198 = (undefined4 *)PTR_DAT_1405d8010;
            }
            puVar12 = (undefined *)*plVar9;
            if ((undefined *)*plVar9 == (undefined *)0x0) {
              puVar12 = PTR_DAT_1405d8010;
            }
            FUN_1403b8ef0(param_1,1,L"HolepunchAck OK. ABS=%s ABR=%s BAS=%s BAR=%s",puVar12);
            if (((local_110 != (undefined *)0x0) && (local_110 != PTR_DAT_1405d8010)) &&
               (local_110 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_14034fe70();
              local_f0 = uVar10;
              FUN_14034ed40(uVar10);
              local_e8 = 1;
              piVar1 = (int *)(local_110 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_110 + -8);
              }
              FUN_14034edd0(uVar10);
            }
            local_110 = PTR_DAT_1405d8010;
            if (((local_128 != (undefined *)0x0) && (local_128 != PTR_DAT_1405d8010)) &&
               (local_128 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_14034fe70();
              local_e0 = uVar10;
              FUN_14034ed40(uVar10);
              local_d8 = 1;
              piVar1 = (int *)(local_128 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_128 + -8);
              }
              FUN_14034edd0(uVar10);
            }
            local_128 = PTR_DAT_1405d8010;
            if (((local_118 != (undefined *)0x0) && (local_118 != PTR_DAT_1405d8010)) &&
               (local_118 + -8 != (undefined *)0x0)) {
              uVar10 = FUN_14034fe70();
              local_c8 = uVar10;
              FUN_14034ed40(uVar10);
              local_c0 = 1;
              piVar1 = (int *)(local_118 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_118 + -8);
              }
              FUN_14034edd0(uVar10);
            }
            if (((local_f8 != (undefined *)0x0) && (local_f8 != PTR_DAT_1405d8010)) &&
               (local_f8 + -8 != (undefined *)0x0)) {
              local_118 = PTR_DAT_1405d8010;
              uVar10 = FUN_14034fe70();
              local_b8 = uVar10;
              FUN_14034ed40(uVar10);
              local_b0 = 1;
              piVar1 = (int *)(local_f8 + -4);
              *piVar1 = *piVar1 + -1;
              if (*piVar1 == 0) {
                FUN_14034ff60(local_f8 + -8);
              }
              FUN_14034edd0(uVar10);
            }
          }
        }
      }
    }
  }
  return;
}



void FUN_1403e00a0(longlong param_1,longlong param_2,undefined8 param_3,undefined8 param_4)

{
  double dVar1;
  undefined8 uVar2;
  undefined8 local_res8;
  
  *(undefined1 *)(param_1 + 0x25) = DAT_1405d89b8;
  *(bool *)(param_1 + 0x21) = *(int *)(param_2 + 0x6b0) == 1;
  *(undefined1 *)(param_1 + 0x22) = 0;
  *(undefined1 *)(param_1 + 0x24) = 0;
  local_res8 = 0;
  FUN_1403b80b0(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_1405d83d0;
  *(undefined2 *)(param_1 + 0x59c) = DAT_1405d83d4;
  *(undefined4 *)(param_1 + 0x5a8) = DAT_1405d83d0;
  *(undefined2 *)(param_1 + 0x5ac) = DAT_1405d83d4;
  *(undefined4 *)(param_1 + 0x578) = DAT_1405d83d0;
  *(undefined2 *)(param_1 + 0x57c) = DAT_1405d83d4;
  *(undefined4 *)(param_1 + 0x588) = DAT_1405d83d0;
  *(undefined2 *)(param_1 + 0x58c) = DAT_1405d83d4;
  *(longlong *)(param_1 + 0x670) = param_2;
  *(undefined1 *)(param_1 + 0x608) = 1;
  *(undefined8 *)(param_1 + 0x610) = 0;
  dVar1 = (double)FUN_14035a090(param_2 + 0xb08);
  *(double *)(param_1 + 0x148) = (DAT_1405d80f0 - DAT_1405d80f0 * 0.5) * dVar1 + DAT_1405d80f0 * 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_1403de0e0(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_1403e0270(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_1403ddf30(local_res10);
    }
    plVar4[2] = (longlong)plVar5;
    plVar5 = plVar4;
  }
  if (plVar5 == (longlong *)0x0) {
    local_res8 = (longlong *)0x0;
  }
  else {
    local_res8 = (longlong *)FUN_14034fef0(0x10);
    local_res8[1] = 1;
    *local_res8 = (longlong)plVar5;
  }
  plVar5 = local_res8;
  lVar6 = FUN_1403b80b0(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_14034ff60(plVar4);
    }
  }
  return lVar6;
}



void FUN_1403e0360(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_1403b7a60(*(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_1405d8010) {
        iVar3 = 0;
      }
      else {
        iVar3 = *(int *)(puVar11 + -8);
      }
      if (((local_d8 != (undefined *)0x0) && (local_d8 != PTR_DAT_1405d8010)) &&
         (local_d8 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_78 = uVar4;
        FUN_14034ed40(uVar4);
        local_70 = 1;
        piVar1 = (int *)(local_d8 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_d8 + -8);
        }
        FUN_14034edd0(uVar4);
      }
      if (iVar3 != 0) {
        iVar14 = iVar14 + 1;
      }
      FUN_14034fe70();
      local_e8 = PTR_DAT_1405d8010;
      puVar5 = (undefined8 *)FUN_1403ab520(*(undefined8 *)(param_1 + 0x670),local_68);
      plVar7 = (longlong *)FUN_14034fc50(&local_d0);
      plVar6 = (longlong *)(**(code **)*puVar5)(puVar5);
      puVar11 = (undefined *)*plVar7;
      if ((undefined *)*plVar7 == (undefined *)0x0) {
        puVar11 = PTR_DAT_1405d8010;
      }
      puVar12 = local_e0;
      if (local_e0 == (undefined *)0x0) {
        puVar12 = PTR_DAT_1405d8010;
      }
      puVar13 = (undefined *)*plVar6;
      if ((undefined *)*plVar6 == (undefined *)0x0) {
        puVar13 = PTR_DAT_1405d8010;
      }
      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_140017720(&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_1405d8010)) &&
         (local_res20 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_98 = uVar4;
        FUN_14034ed40(uVar4);
        local_90 = 1;
        piVar1 = (int *)(local_res20 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_res20 + -8);
        }
        FUN_14034edd0(uVar4);
      }
      local_res20 = PTR_DAT_1405d8010;
      if (((local_d0 != (undefined *)0x0) && (local_d0 != PTR_DAT_1405d8010)) &&
         (local_d0 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_b8 = uVar4;
        FUN_14034ed40(uVar4);
        local_b0 = 1;
        piVar1 = (int *)(local_d0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_d0 + -8);
        }
        FUN_14034edd0(uVar4);
      }
      puVar11 = local_e8;
      FUN_1403b9440(*(undefined8 *)(param_1 + 0x670),iVar14,&DAT_140475be8,local_e8);
      if (((puVar11 != (undefined *)0x0) && (puVar11 != PTR_DAT_1405d8010)) &&
         (puVar11 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_a8 = uVar4;
        FUN_14034ed40(uVar4);
        local_a0 = 1;
        piVar1 = (int *)(puVar11 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(puVar11 + -8);
        }
        FUN_14034edd0(uVar4);
      }
      if (((local_e0 != (undefined *)0x0) && (local_e0 != PTR_DAT_1405d8010)) &&
         (local_e0 + -8 != (undefined *)0x0)) {
        uVar4 = FUN_14034fe70();
        local_88 = uVar4;
        FUN_14034ed40(uVar4);
        local_80 = 1;
        piVar1 = (int *)(local_e0 + -4);
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_14034ff60(local_e0 + -8);
        }
        FUN_14034edd0(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_1405f2490,param_1 + 0x56c,local_res18);
    }
    local_c8 = 0;
    FUN_1403b80b0(param_1 + 0x28,&local_c8);
    if (local_res18[0] != 0x1d) {
      FUN_1403c5c30(*(undefined8 *)(param_1 + 0x670),*(undefined4 *)(param_1 + 0x56c));
    }
    if (*(int *)(param_1 + 0x61c) < DAT_1405d8088) {
      *(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_1405f0690;
    }
  }
  return;
}



void FUN_1403e0870(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_1403ab410(*(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_1403e090b;
    }
    uRam0000000000000000 = 1;
  }
LAB_1403e090b:
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x18) != 0))
  {
    local_res10 = 0;
    FUN_1403aca30(&local_res10,param_1 + 0x18);
    FUN_1403bb660(*(undefined8 *)(param_1 + 0x670),&local_res10);
    local_res18[0] = 0;
    FUN_1403aca30(param_1 + 0x18,local_res18);
  }
  local_res8 = operator_new(0x1c0);
  lVar5 = lVar4;
  if (local_res8 != (longlong *)0x0) {
    lVar5 = FUN_1403e2200(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_14034fef0(0x10);
    local_res8[1] = 1;
    *local_res8 = lVar5 + 0x40;
  }
  plVar1 = local_res8;
  FUN_1403aca30(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_14034ff60(plVar3);
    }
  }
  lVar5 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x670));
  local_38 = *(int *)(lVar5 + 0x118);
  if ((local_38 == 0) || (local_38 == -1)) {
    FUN_14034fa20(&DAT_140464f50);
  }
  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_1403e25e0(lVar6,&local_40);
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) &&
     (lVar5 = **(longlong **)(param_1 + 0x18), lVar5 != 0)) {
    lVar4 = lVar5 + -0x40;
  }
  FUN_1403e1be0(lVar4);
  FUN_1403e0270(param_1);
  return;
}



void FUN_1403e0a90(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_1403e0b7e:
      cVar5 = FUN_14035f5e0(param_2 + 0x28,(ulonglong)uVar2,
                            CONCAT71((int7)((ulonglong)lVar3 >> 8),1));
      if (cVar5 == '\0') {
                    // WARNING: Subroutine does not return
        FUN_14000d450(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_1403e0bbe;
      }
      if (lVar3 == 0) goto LAB_1403e0b7e;
      for (puVar6 = *(uint **)(lVar3 + uVar4 * 8);
          (puVar6 != (uint *)0x0 && ((uint)uVar4 == puVar6[6] % uVar2));
          puVar6 = *(uint **)(puVar6 + 2)) {
        if (*puVar6 == uVar1) goto LAB_1403e0bba;
      }
      if (lVar3 == 0) goto LAB_1403e0b7e;
    }
    FUN_14035eb50(param_2 + 0x28);
    puVar6 = (uint *)FUN_140360ee0(param_2 + 0x28,local_res8,uVar4,uVar1);
    FUN_14035eb50(param_2 + 0x28);
LAB_1403e0bba:
    *(undefined1 *)(puVar6 + 1) = 0;
LAB_1403e0bbe:
    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_1403e0c40(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_1405d8058 < param_2 - *(double *)(param_1 + 0x658)) {
    FUN_1403e2a90(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_1405f2490,param_1 + 0x56c);
    }
    FUN_1403de370(param_1);
    FUN_1403e0870(param_1);
  }
  lVar9 = 0;
  if (((*(longlong **)(param_1 + 0x28) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x28) != 0)
      ) && (cVar5 = FUN_1403df050(), cVar5 == '\0')) {
    local_res18[1] = 0.0;
    FUN_1403b80b0(param_1 + 0x28,local_res18 + 1);
  }
  if (_DAT_1405d8170 < 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_14035a290(*(longlong *)(param_1 + 0x670) + 0x1620);
    plVar7 = (longlong *)(*(longlong *)(param_1 + 0x670) + 0x17d0);
    (**(code **)(*plVar7 + 0x50))
              (plVar7,*(undefined4 *)(param_1 + 0x56c),&DAT_1405f2490,&local_a8,local_res8);
    *(double *)(param_1 + 0x660) = param_2;
  }
  if (*(char *)(param_1 + 0x608) == '\0') {
    if (param_2 - *(double *)(param_1 + 0xc0) <= DAT_1405d80f0 * 10.0) {
      if (*(char *)(param_1 + 0x608) != '\0') goto LAB_1403e0e6a;
      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_1403e0e57;
      }
    }
    else {
      uVar10 = 0x1a;
LAB_1403e0e57:
      FUN_1403e0360(param_1,1,uVar10);
    }
    if (*(char *)(param_1 + 0x608) == '\0') goto LAB_1403e0ebb;
  }
LAB_1403e0e6a:
  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_140355560(lVar8);
    if (cVar5 == '\0') {
      *(undefined8 *)(param_1 + 0x620) = 0;
      FUN_1403e0270(param_1);
    }
  }
LAB_1403e0ebb:
  plVar7 = *(longlong **)(param_1 + 0x18);
  if (((plVar7 != (longlong *)0x0) && (*plVar7 != 0)) &&
     (_DAT_1405d81b8 < 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_14039bd30(*(undefined8 *)(lVar9 + 0x108),&local_90);
    if (*(double *)(param_1 + 0x630) == 0.0) {
      if (DAT_1405d8194 < iVar6) {
        *(double *)(param_1 + 0x630) = param_2;
      }
    }
    else if (DAT_1405d8194 < iVar6) {
      if (_DAT_1405d81b0 < param_2 - *(double *)(param_1 + 0x630)) {
        *(double *)(param_1 + 0x630) = param_2;
        FUN_14034fe70();
        local_res10 = PTR_DAT_1405d8010;
        FUN_140017720(&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_14035bed0(local_98,0x25,*(undefined4 *)(param_1 + 0x56c),&local_res10,&local_70
                              );
        (**(code **)(**(longlong **)(param_1 + 0x670) + 0x88))
                  (*(longlong **)(param_1 + 0x670),uVar10);
        FUN_1403555d0(&local_70);
        puVar4 = local_res10;
        if (((local_res10 != (undefined *)0x0) && (local_res10 != PTR_DAT_1405d8010)) &&
           (puVar1 = local_res10 + -8, puVar1 != (undefined *)0x0)) {
          uVar10 = FUN_14034fe70();
          local_80 = uVar10;
          FUN_14034ed40(uVar10);
          local_78 = 1;
          piVar2 = (int *)(puVar4 + -4);
          *piVar2 = *piVar2 + -1;
          if (*piVar2 == 0) {
            FUN_14034ff60(puVar1);
          }
          FUN_14034edd0(uVar10);
        }
      }
    }
    else {
      *(undefined8 *)(param_1 + 0x630) = 0;
    }
    *(double *)(param_1 + 0x628) = param_2;
  }
  return;
}



undefined8 FUN_1403e1080(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_1403e10ee;
    }
    uRam0000000000000000 = 1;
  }
LAB_1403e10ee:
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x18) != 0))
  {
    local_res18 = 0;
    FUN_1403aca30(&local_res18,param_1 + 0x18);
    FUN_1403bb660(*(undefined8 *)(param_1 + 0x670),&local_res18);
    local_res20 = 0;
    FUN_1403aca30(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_1403aca30(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_1403e1392;
        puVar3 = *(ushort **)(*(longlong *)(lVar11 + 0x1728) + uVar5 * 8);
        goto joined_r0x0001403e1230;
      }
    }
  }
  local_res8 = operator_new(0x1c0);
  lVar8 = lVar11;
  if (local_res8 != (longlong *)0x0) {
    lVar8 = FUN_1403e2200(local_res8,*(undefined8 *)(param_1 + 0x670),param_1);
  }
  if ((lVar8 == 0) || (lVar8 + 0x40 == 0)) {
    local_res8 = (longlong *)0x0;
  }
  else {
    local_res8 = (longlong *)FUN_14034fef0(0x10);
    local_res8[1] = 1;
    *local_res8 = lVar8 + 0x40;
  }
  plVar1 = local_res8;
  FUN_1403aca30(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_14034ff60(plVar6);
    }
  }
  lVar8 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x670));
  local_30 = *(int *)(lVar8 + 0x118);
  if ((local_30 == 0) || (local_30 == -1)) {
    FUN_14034fa20(&DAT_140464f50);
  }
  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_1403e25e0(lVar10,&local_38);
  if (cVar7 == '\0') {
    local_48 = 0;
    FUN_1403aca30(param_1 + 0x18,&local_48);
    uVar9 = 0;
  }
  else {
LAB_1403e1392:
    uVar9 = 1;
  }
  return uVar9;
joined_r0x0001403e1230:
  if ((puVar3 == (ushort *)0x0) ||
     ((uint)uVar5 != *(uint *)(puVar3 + 0x10) % *(uint *)(lVar11 + 0x1748))) goto LAB_1403e1392;
  if (*puVar3 == param_2) {
    FUN_1403b8510(lVar11 + 0x1720,puVar3,0);
    goto LAB_1403e1392;
  }
  puVar3 = *(ushort **)(puVar3 + 8);
  goto joined_r0x0001403e1230;
}



void FUN_1403e13b0(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_140363af0((undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x30));
    }
  }
  FUN_140399690(param_2 + 0x18);
  if (*(longlong *)(param_2 + 0x20) != 0) {
    if (*(int *)(param_2 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(undefined4 *)(param_2 + 0x28) = 0;
  }
  plVar1 = (longlong *)*param_1;
  if (plVar1 == (longlong *)0x0) {
    FUN_14034ff60(param_2);
  }
  else {
    (**(code **)(*plVar1 + 0x10))(plVar1,param_2);
  }
  param_1[3] = param_1[3] + -1;
  return;
}



void FUN_1403e1440(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_140363af0(plVar4,*plVar4);
      }
    }
    FUN_140399690(plVar3 + 3);
    if (plVar3[4] != 0) {
      if (*(int *)((longlong)plVar3 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(undefined4 *)(plVar3 + 5) = 0;
    }
    plVar4 = (longlong *)*param_1;
    if (plVar4 == (longlong *)0x0) {
      FUN_14034ff60(plVar3);
    }
    else {
      (**(code **)(*plVar4 + 0x10))(plVar4,plVar3);
    }
    param_1[3] = param_1[3] + -1;
    lVar2 = param_1[3];
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_1403e1500(longlong *param_1)

{
  undefined8 *puVar1;
  
  FUN_1403e1440();
  puVar1 = (undefined8 *)*param_1;
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  return;
}



void FUN_1403e1530(longlong param_1)

{
  undefined8 *puVar1;
  
  FUN_1403e1440(param_1 + 0x90);
  puVar1 = *(undefined8 **)(param_1 + 0x90);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1403e1440(param_1 + 0x70);
  puVar1 = *(undefined8 **)(param_1 + 0x70);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1403a9d90(param_1 + 0x30);
  return;
}



void FUN_1403e1590(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  longlong *plVar2;
  undefined8 uVar3;
  
  uVar3 = 0xfffffffffffffffe;
  FUN_1403a9d90(param_1 + 0x60);
  FUN_1403e1440(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_14034ff60();
    }
    else {
      (**(code **)(*plVar2 + 0x18))(plVar2,*(longlong *)(param_1 + 0x28),plVar2,param_4,uVar3);
    }
  }
  return;
}



void FUN_1403e1610(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  FUN_1403e1590(param_1 + 0xf0);
  FUN_1403e1440(param_1 + 0x98);
  puVar1 = *(undefined8 **)(param_1 + 0x98);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1,param_3,param_4,uVar2);
  }
  FUN_1403e1440(param_1 + 0x78);
  puVar1 = *(undefined8 **)(param_1 + 0x78);
  if (puVar1 != (undefined8 *)0x0) {
    (**(code **)*puVar1)(puVar1,1);
  }
  FUN_1403a9d90(param_1 + 0x38);
  return;
}



void FUN_1403e16a0(undefined8 *param_1)

{
  void *pvVar1;
  
  pvVar1 = (void *)param_1[1];
  if (pvVar1 != (void *)0x0) {
    FUN_1403e1610(pvVar1);
    operator_delete(pvVar1);
  }
  *param_1 = Proud::IReliableUdpHostDelegate::vftable;
  return;
}



void FUN_1403e16f0(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_1403e1610(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[199] = Proud::IReliableUdpHostDelegate::vftable;
  FUN_1403bf7a0(param_1 + 0xb6);
  FUN_1403555d0(param_1 + 0xa7);
  FUN_1403b7f70(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_14034ff60(plVar2);
  }
  param_1[2] = Proud::IUdpPacketFragBoardDg::vftable;
  param_1[1] = Proud::IP2PGroupMember::vftable;
  *param_1 = Proud::ISendDest_C::vftable;
  return;
}



undefined4 FUN_1403e1800(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x56c);
}



void FUN_1403e1810(longlong param_1)

{
  FUN_1403e1a50(param_1 + -8);
  return;
}



void FUN_1403e1820(longlong param_1)

{
  FUN_1403e1a50(param_1 + -0x10);
  return;
}



void FUN_1403e1830(longlong param_1)

{
  FUN_1403e1800(param_1 + -8);
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403e19b8)
// WARNING: Removing unreachable block (ram,0x0001403e19c1)
// WARNING: Removing unreachable block (ram,0x0001403e19e2)
// WARNING: Removing unreachable block (ram,0x0001403e19eb)

undefined8 *
FUN_1403e1840(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_1403e37d0(param_1 + 199,param_1,param_3,param_4,0xfffffffffffffffe);
  param_1[0xcd] = param_1;
  FUN_1403e00a0(param_1,param_2);
  *(undefined4 *)(param_1 + 0xd0) = 0;
  *(undefined1 *)((longlong)param_1 + 0x684) = 0;
  return param_1;
}



void * FUN_1403e1a50(void *param_1,uint param_2)

{
  FUN_1403e16f0();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403e1a80(longlong param_1)

{
  (**(code **)(*(longlong *)(param_1 + -0x40) + 0x10))(param_1 + -0x40);
  *(undefined8 *)(param_1 + 0xe0) = 0;
  return;
}



void FUN_1403e1ab0(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_140355560(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_14039d510(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_140356f00(uVar6,lVar2,&local_18,*(undefined4 *)(lVar2 + 0x6b0));
        if (iVar4 != 0) {
          *(undefined1 *)(param_1 + 0x80) = 0;
        }
      }
    }
  }
  return;
}



void FUN_1403e1be0(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_1403562a0(lVar2,DAT_1405d804c);
      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_1403e1c80(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_14039bc30(*(undefined8 *)(param_1 + 0x108),&local_18);
  return;
}



void FUN_1403e1cc0(longlong param_1)

{
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x78) + 0x10))
            (*(longlong *)(param_1 + 0x118) + 0x78);
  if (*(undefined8 **)(param_1 + 0x100) != (undefined8 *)0x0) {
    FUN_1403552c0(**(undefined8 **)(param_1 + 0x100));
    return;
  }
  FUN_1403552c0();
  return;
}



void FUN_1403e1d00(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_140354860(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_14034fa20(&DAT_14046a660);
  }
  return;
}



void FUN_1403e1d60(longlong param_1,undefined8 param_2)

{
  FUN_14039d900(*(undefined8 *)(param_1 + 0x108));
  if (*(longlong *)(param_1 + 0x188) != 0) {
    FUN_14039f4a0(*(longlong *)(param_1 + 0x188),param_2);
  }
  return;
}



void FUN_1403e1da0(longlong param_1)

{
  FUN_14039dc60(*(undefined8 *)(param_1 + 0x108));
  if (*(longlong *)(param_1 + 0x188) != 0) {
    FUN_14039f5b0();
  }
  return;
}



undefined8 FUN_1403e1dd0(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_1403e1e00(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_140354ea0(lVar3,0);
  lVar3 = FUN_1403ab430(*(undefined8 *)(param_1 + 0x118));
  local_10 = *(int *)(lVar3 + 0x118);
  if ((local_10 == 0) || (local_10 == -1)) {
    FUN_14034fa20(&DAT_140464f50);
  }
  local_18 = Proud::AddrPort::vftable;
  local_c = 0;
  lVar3 = lVar5;
  if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
    lVar3 = **(longlong **)(param_1 + 0x100);
  }
  FUN_140356eb0(lVar3,&local_18);
  lVar3 = lVar5;
  if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
    lVar3 = **(longlong **)(param_1 + 0x100);
  }
  lVar3 = FUN_140354860(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_14034fa20(&DAT_14046a660);
  }
  (**(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_1403598f0(*(undefined8 *)(lVar4 + 0x2b8),lVar3);
  if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
    lVar5 = **(longlong **)(param_1 + 0x100);
  }
  FUN_1403a2c60(lVar5);
  FUN_1403e1be0(param_1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403e1f50(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_1405d84f0 ^ (ulonglong)auStack_e58;
  (**(code **)(*(longlong *)(*(longlong *)(param_1 + 0x118) + 0x78) + 0x10))();
  local_4c = 200;
  local_50 = 0;
  local_58 = local_cd8;
  FUN_1403841b0(local_d88);
  FUN_140383e30(local_d88,local_d60,0x80);
  FUN_1403a3190(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_14039e350(*(undefined8 *)(param_1 + 0x108),param_2,param_3,&local_e18);
  local_e18 = &local_d80;
  FUN_140399690(&local_d80);
  if (local_d78 != 0) {
    if (local_d6c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d70 = 0;
  }
  if (local_58 == (undefined1 *)0x0) {
    FUN_14034f420(local_dd8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_dd8,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_4c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403e2100(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_1405d84f0 ^ (ulonglong)auStack_d68;
  local_d48 = FUN_140361500(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_1403e1f50(param_1,param_2,param_3,&local_d28);
  if (local_48 == 0) {
    FUN_14034f420(local_d10,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_d10,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_3c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



undefined8 * FUN_1403e2200(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_140354d60(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_1405d83d0;
  *(undefined2 *)((longlong)param_1 + 0x144) = DAT_1405d83d4;
  *(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_14039fcd0(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_14039ba10(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_14039fe30(pvVar1,puVar4);
  }
  param_1[0x31] = puVar4;
  return param_1;
}



void FUN_1403e2420(longlong param_1)

{
  FUN_1403e25b0(param_1 + -0x40);
  return;
}



void FUN_1403e2430(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_14039fc70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  param_1[0x31] = 0;
  pvVar1 = (void *)param_1[0x22];
  if (pvVar1 != (void *)0x0) {
    FUN_14039cf50(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x22] = 0;
  pvVar1 = (void *)param_1[0x21];
  if (pvVar1 != (void *)0x0) {
    FUN_14039fdd0(pvVar1);
    operator_delete(pvVar1);
  }
  param_1[0x21] = 0;
  pvVar1 = (void *)param_1[0x31];
  if (pvVar1 != (void *)0x0) {
    FUN_14039fc70((longlong)pvVar1 + 8);
    operator_delete(pvVar1);
  }
  pvVar1 = (void *)param_1[0x22];
  if (pvVar1 != (void *)0x0) {
    FUN_14039cf50(pvVar1);
    operator_delete(pvVar1);
  }
  pvVar1 = (void *)param_1[0x21];
  if (pvVar1 != (void *)0x0) {
    FUN_14039fdd0(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_1403556b0(lVar3);
      FUN_14034ff60(lVar3);
    }
    FUN_14034ff60(plVar2);
  }
  param_1[8] = Proud::IHasOverlappedIo::vftable;
  *param_1 = Proud::ICompletionContext::vftable;
  return;
}



void * FUN_1403e25b0(void *param_1,uint param_2)

{
  FUN_1403e2430();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



undefined8 FUN_1403e25e0(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_14034fef0(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_140355800(local_res8,1,lVar5,param_4,uVar8);
    }
    if (lVar5 == 0) {
      local_res8 = (longlong *)0x0;
    }
    else {
      local_res8 = (longlong *)FUN_14034fef0(0x10);
      local_res8[1] = 1;
      *local_res8 = lVar5;
    }
    plVar1 = local_res8;
    FUN_140351ba0(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_1403556b0(lVar5);
          FUN_14034ff60(lVar5);
        }
        FUN_14034ff60(plVar3);
      }
    }
    lVar5 = lVar7;
    if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
      lVar5 = **(longlong **)(param_1 + 0x100);
    }
    FUN_1403549c0(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_140356eb0(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_1403598f0(*(undefined8 *)(lVar6 + 0x2b8),lVar5);
      FUN_1403e1d00(param_1);
      if (*(longlong **)(param_1 + 0x100) != (longlong *)0x0) {
        lVar7 = **(longlong **)(param_1 + 0x100);
      }
      FUN_1403a2c60(lVar7);
      return 1;
    }
    local_res18[0] = 0;
    FUN_140351ba0(param_1 + 0x100,local_res18);
  }
  return 0;
}



longlong FUN_1403e27c0(longlong param_1)

{
  return param_1 + 0x150;
}



void FUN_1403e27d0(longlong param_1,undefined4 param_2)

{
  FUN_1403ec340(param_1 + 0xf0);
  FUN_1403e4580(param_1 + 8,param_2);
  return;
}



void FUN_1403e2810(longlong param_1,undefined8 param_2,int param_3)

{
  FUN_1403a9e50(param_1 + 0x38);
  *(int *)(param_1 + 0xb8) = *(int *)(param_1 + 0xb8) + param_3;
  FUN_1403e4120(param_1 + 8,0);
  return;
}



void FUN_1403e2850(longlong param_1)

{
  FUN_1403eca50(param_1 + 0xf0);
  return;
}



void FUN_1403e2860(longlong param_1)

{
  FUN_1403e38e0(param_1 + 8);
  return;
}



void FUN_1403e2870(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_14000d450(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_14000d450(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_1403e2980(undefined8 *param_1,longlong *param_2,undefined4 param_3)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = (**(code **)(*param_2 + 0x38))(param_2);
  FUN_1403e4480(param_1 + 1,param_1,param_3,uVar1,uVar2);
  uVar1 = (**(code **)(*param_2 + 0x38))(param_2);
  FUN_1403ec700(param_1 + 0x1e,param_1,param_3,uVar1);
  *param_1 = param_2;
  return param_1;
}



undefined1 FUN_1403e2a00(longlong param_1)

{
  return *(undefined1 *)(*(longlong *)(param_1 + 0x10) + 0x608);
}



void FUN_1403e2a10(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x10) + 0x670);
                    // WARNING: Could not recover jumptable at 0x0001403e2a23. Too many branches
                    // WARNING: Treating indirect jump as call
  (**(code **)(*(longlong *)(lVar1 + 0x70) + 0x1c0))(lVar1 + 0x70);
  return;
}



undefined8 FUN_1403e2a30(longlong param_1)

{
  undefined8 uVar1;
  
  if (*(char *)(*(longlong *)(param_1 + 0x10) + 0x608) == '\0') {
    uVar1 = FUN_1403de2f0(*(longlong *)(param_1 + 0x10) + 0x668);
    return uVar1;
  }
  return 1;
}



undefined4 FUN_1403e2a50(longlong param_1)

{
  return *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 0x56c);
}



double FUN_1403e2a60(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_1403e2a80(longlong param_1)

{
  FUN_1403e2860(*(undefined8 *)(param_1 + 8));
  return;
}



void FUN_1403e2a90(longlong param_1)

{
  undefined8 uVar1;
  double dVar2;
  
  uVar1 = *(undefined8 *)(param_1 + 8);
  dVar2 = (double)FUN_1403ab240(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x670));
  FUN_1403e27d0(uVar1,(float)dVar2);
  return;
}



undefined8 FUN_1403e2ac0(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_1403e2ae0(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_1405d84f0 ^ (ulonglong)auStack_e08;
  local_2c = 200;
  local_30 = 0;
  local_38 = local_cb8;
  FUN_1403841b0(local_d68);
  FUN_140383e30(local_d68,local_d40,0x80);
  FUN_1403a3190(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_14034f7d0();
  }
  local_de0 = lVar1;
  thunk_FUN_1403a6430(local_cb8,&local_de8);
  uVar2 = local_dd8;
  if ((int)local_dd0 == 0) {
    uVar2 = 0;
  }
  FUN_1403e2810(*(undefined8 *)(param_1 + 8),uVar2);
  FUN_1403555d0(&local_de8);
  local_dc0 = local_d60;
  FUN_140399690(local_d60);
  if (local_d58 != 0) {
    if (local_d4c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d50 = 0;
  }
  if (local_38 == (undefined1 *)0x0) {
    FUN_14034f420(local_db0,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_db0,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (local_2c < 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403e2c70(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 = 0x1403e2c8a;
  local_2780 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_2808;
  iVar1 = *param_2;
  uVar2 = DAT_1405f2518;
  if (iVar1 == 1) {
    if (DAT_1405da1e2 != '\0') {
      uVar2 = 1;
    }
  }
  else if ((iVar1 == 2) && (DAT_1405da1e1 != '\0')) {
    uVar2 = 1;
  }
  if (*(char *)(*(longlong *)(param_1 + 0x10) + 0x608) == '\0') {
    local_ccc = 200;
    local_cd0 = 0;
    local_cd8 = &local_1958;
    FUN_1403841b0(local_27c8);
    FUN_140383c40(local_27c8);
    FUN_140384310(local_27c8,0x800);
    FUN_140384310(local_27c8,0);
    FUN_1403a6e80(param_2,&local_1958,local_27c8);
    local_2798 = 0;
    local_2790 = 1;
    local_278c = 0xffffffff;
    local_2788 = 1;
    local_2787 = DAT_1405d81cc;
    local_27a0[0] = uVar2;
    FUN_1403de1e0(*(longlong *)(param_1 + 0x10) + 0x668,&local_1958,local_27a0);
    local_27d8 = &local_27c0;
    FUN_140399690(&local_27c0);
    if (CONCAT44(uStack_27b4,local_27b8) != 0) {
      if (local_27ac < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      local_27b0 = 0;
    }
    if (local_cd8 == (undefined4 *)0x0) {
      FUN_14034f420(local_2778,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2778,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_ccc < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  else if (iVar1 == 1) {
    FUN_1403841b0(local_1a08);
    FUN_140383e30(local_1a08,local_19e0,0x80);
    FUN_140058870(local_1a08,0x16);
    FUN_140058470(local_1a08,*(undefined4 *)(*(longlong *)(param_1 + 0x10) + 0x56c));
    FUN_140058470(local_1a08,param_2[1]);
    FUN_140383bc0(local_27a0,local_1a08);
    if (*(longlong *)(param_2 + 2) == 0) {
      if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      iVar1 = param_2[6];
    }
    else {
      iVar1 = *(int *)(*(longlong *)(param_2 + 2) + 0x18);
    }
    FUN_140385580(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_140399790();
      }
    }
    else {
      local_19f0 = *(undefined4 *)(local_1a00 + 0x18);
    }
    lVar3 = local_19f8;
    if (local_19f8 == 0) {
      if (local_1a00 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      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_1403607b0(local_cc8,&local_1958);
    if (local_cd8 == (undefined4 *)0x0) {
      FUN_14034f420(local_2778,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2778,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_ccc < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_cd0 = 0;
    lVar3 = *(longlong *)(param_2 + 2);
    if (lVar3 == 0) {
      if (*(longlong *)(param_2 + 4) == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      iVar1 = param_2[6];
    }
    else {
      iVar1 = *(int *)(lVar3 + 0x18);
    }
    if (*(longlong *)(param_2 + 4) == 0) {
      if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
        FUN_140399790();
      }
      if (*(int *)(lVar3 + 0x18) != 0) {
        lVar4 = *(longlong *)(lVar3 + 0x10);
      }
    }
    else {
      lVar4 = *(longlong *)(param_2 + 4);
      if (lVar4 == 0) {
        FUN_14034f420(local_26e8,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
        _CxxThrowException(local_26e8,(ThrowInfo *)&DAT_1405d36c0);
      }
    }
    iStack_27d0 = iVar1;
    if (local_48 == (undefined1 *)0x0) {
      FUN_14034f420(local_2730,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2730,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_40 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    iVar5 = local_40 + 1;
    if ((iVar5 < 0) || (local_3c < iVar5)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    *(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_1403a6360(&local_48,&local_1a20);
    local_27c8[0] = DAT_1405f2518;
    local_27c0 = DAT_1405f2510;
    local_27b8 = CONCAT31(local_27b8._1_3_,DAT_1405f2520);
    uStack_27b4 = 0xffffffff;
    local_27b0._0_2_ = CONCAT11(DAT_1405d81cc,DAT_1405f2540);
    uVar2 = (**(code **)(**(longlong **)(param_1 + 0x10) + 8))();
    local_27e8 = local_27c8;
    FUN_1403ac430(*(undefined8 *)(*(longlong *)(param_1 + 0x10) + 0x670),uVar2,1,local_26a0);
    if (local_48 == (undefined1 *)0x0) {
      FUN_14034f420(local_2730,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_2730,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_3c < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_40 = 0;
    FUN_140383be0(local_27a0);
    local_27d8 = &local_1a00;
    FUN_140399690(&local_1a00);
    if ((local_19f8 != 0) && (local_19ec < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return;
}



void FUN_1403e31e0(longlong param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  int iVar2;
  
  FUN_14038d950(param_3,0);
  FUN_1403e2850(*(undefined8 *)(param_1 + 8),param_2);
  uVar1 = FUN_1403e27c0(*(undefined8 *)(param_1 + 8));
  iVar2 = FUN_1403a3ba0(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_1403e3270(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_140384a10(param_2,&local_d8);
  if (cVar4 == '\0') {
    if (local_b8 != (longlong *)0x0) {
      plVar11 = local_b8 + 1;
      *plVar11 = *plVar11 + -1;
      if (*plVar11 == 0) {
        FUN_140363af0(&local_b8,local_b8);
      }
    }
    local_res8 = &local_d0;
    FUN_140399690(&local_d0);
    if ((local_c8 != (longlong *)0x0) && (local_c0 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  else {
    if ((int)local_d8 != 1) {
      if ((int)local_d8 == 2) {
        uVar6 = (**(code **)(*(longlong *)(*(longlong *)(param_1[2] + 0x670) + 0x88) + 0x18))();
        plVar7 = (longlong *)FUN_14036dde0(&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_14034ff60(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_14034ff60(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_1403a72e0(lVar8,param_2);
        if (cVar4 == '\0') {
          if (local_b8 != (longlong *)0x0) {
            plVar11 = local_b8 + 1;
            *plVar11 = *plVar11 + -1;
            if (*plVar11 == 0) {
              FUN_140363af0(&local_b8,local_b8);
            }
          }
          local_res8 = &local_d0;
          FUN_140399690(&local_d0);
          if (local_c8 == (longlong *)0x0) {
            return 0;
          }
          if (-1 < local_c0) {
            return 0;
          }
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        cVar4 = FUN_1403840e0(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_140363af0(&local_b8,local_b8);
            }
          }
          local_res8 = &local_d0;
          FUN_140399690(&local_d0);
          if (local_c8 == (longlong *)0x0) {
            return 0;
          }
          if (-1 < local_c0) {
            return 0;
          }
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_a4 = local_res8._0_4_;
        cVar4 = FUN_1403840e0(param_2,&local_res8,4);
        if (cVar4 == '\0') {
          if (local_b8 != (longlong *)0x0) {
            plVar11 = local_b8 + 1;
            *plVar11 = *plVar11 + -1;
            if (*plVar11 == 0) {
              FUN_140363af0(&local_b8,local_b8);
            }
          }
          local_res8 = &local_d0;
          FUN_140399690(&local_d0);
          if (local_c8 == (longlong *)0x0) {
            return 0;
          }
          if (-1 < local_c0) {
            return 0;
          }
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_a8 = local_res8._0_4_;
      }
LAB_1403e3681:
      FUN_14038d950(param_3,0);
      FUN_1403e2850(param_1[1],&local_d8);
      uVar6 = FUN_1403e27c0(param_1[1]);
      iVar5 = FUN_1403a3ba0(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_140363af0(&local_b8,local_b8);
        }
      }
      local_res8 = &local_d0;
      FUN_140399690(&local_d0);
      if ((local_c8 != (longlong *)0x0) && (local_c0 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      return 1;
    }
    cVar4 = FUN_1403840e0(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_140363af0(&local_b8,local_b8);
        }
      }
      local_res8 = &local_d0;
      FUN_140399690(&local_d0);
      if (local_c8 == (longlong *)0x0) {
        return 0;
      }
      if (-1 < local_c0) {
        return 0;
      }
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    local_d8 = CONCAT44(local_res8._0_4_,(int)local_d8);
    if (local_c8 != (longlong *)0x0) {
      FUN_14034f420(local_88,PTR_u_Cannot_use_internal_buffer_becau_1405d94e0);
                    // WARNING: Subroutine does not return
      _CxxThrowException(local_88,(ThrowInfo *)&DAT_1405d36c0);
    }
    if (local_d0 == 0) {
      local_d0 = FUN_1403996d0();
      *(undefined8 *)(local_d0 + 0x28) = 1;
    }
    cVar4 = FUN_140384780(param_2,&local_res8);
    if (((cVar4 != '\0') && (iVar5 = (int)local_res8, -1 < iVar5)) && (iVar5 <= DAT_1405d8140)) {
      if (local_c8 == (longlong *)0x0) {
        if (iVar5 < 1) {
          if (local_d0 == 0) goto LAB_1403e3720;
          uVar9 = 0;
        }
        else {
          if (local_d0 == 0) {
                    // WARNING: Subroutine does not return
            FUN_140399790();
          }
          uVar9 = (ulonglong)local_res8 & 0xffffffff;
        }
        FUN_1400179d0(local_d0,uVar9);
      }
      else {
        if (local_c0._4_4_ < iVar5) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_c0 = CONCAT44(local_c0._4_4_,iVar5);
      }
      plVar10 = local_c8;
      if (local_c8 == (longlong *)0x0) {
        if (local_d0 == 0) {
LAB_1403e3720:
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        plVar10 = plVar11;
        if (*(int *)(local_d0 + 0x18) != 0) {
          plVar10 = *(longlong **)(local_d0 + 0x10);
        }
      }
      cVar4 = FUN_1403840e0(param_2,plVar10,(ulonglong)local_res8 & 0xffffffff);
      if (cVar4 != '\0') goto LAB_1403e3681;
    }
    if (local_b8 != (longlong *)0x0) {
      plVar11 = local_b8 + 1;
      *plVar11 = *plVar11 + -1;
      if (*plVar11 == 0) {
        FUN_140363af0(&local_b8,local_b8);
      }
    }
    local_res8 = &local_d0;
    FUN_140399690(&local_d0);
    if ((local_c8 != (longlong *)0x0) && (local_c0 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
  }
  return 0;
}



undefined8 * FUN_1403e37d0(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_1403e37f0(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_1403e1610(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_1403e2980(pvVar1,param_1,param_2,param_4,uVar2);
    *(undefined8 *)(param_1 + 8) = uVar2;
  }
  return;
}



undefined8 * FUN_1403e3870(undefined8 *param_1,uint param_2)

{
  void *pvVar1;
  
  pvVar1 = (void *)param_1[1];
  if (pvVar1 != (void *)0x0) {
    FUN_1403e1610(pvVar1);
    operator_delete(pvVar1);
  }
  *param_1 = Proud::IReliableUdpHostDelegate::vftable;
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403e38e0(longlong param_1)

{
  *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + 1;
  return;
}



void FUN_1403e38f0(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_1403e3930(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_1405da228 < 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_1403e39d0(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_1403e3a60(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  
  if (param_2 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(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_1403e13b0(param_1,param_2);
  return lVar1;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403e3ad0(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_1405da240;
  if (dVar7 * _DAT_1405da240 <= (double)DAT_1405da248) {
    dVar8 = (double)DAT_1405da248;
  }
  if ((double)DAT_1405da24c <= dVar8) {
    dVar8 = (double)DAT_1405da24c;
  }
  dVar8 = dVar8 * param_2;
  if (DAT_1405d8058 * 5.0 < param_2) {
    dVar8 = dVar8 / (param_2 / DAT_1405d8058);
  }
  iVar5 = (int)dVar8;
  if ((int)dVar8 < 1) {
    iVar5 = 1;
  }
  cVar3 = (**(code **)(**(longlong **)*param_1 + 0x10))();
  plVar1 = (longlong *)param_1[0x13];
joined_r0x0001403e3ba9:
  if ((plVar1 == (longlong *)0x0) || (iVar5 < 1)) {
    return;
  }
  if (plVar1 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
    FUN_14000d450(0x80004005);
  }
  bVar2 = false;
  plVar4 = plVar1;
  if ((double)plVar1[10] <= dVar6 - (double)plVar1[9] &&
      dVar6 - (double)plVar1[9] != (double)plVar1[10]) goto code_r0x0001403e3bed;
  goto LAB_1403e3cbf;
code_r0x0001403e3bed:
  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_1405da200 * (double)plVar1[10];
  plVar1[10] = (longlong)dVar7;
  if (DAT_1405da1f0 <= dVar7) {
    dVar7 = DAT_1405da1f0;
  }
  *(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_1403e13b0(param_1 + 0x12,plVar1);
    bVar2 = true;
  }
  iVar5 = iVar5 + -1;
  plVar1 = plVar4;
  if (!bVar2) {
LAB_1403e3cbf:
    if (plVar4 == (longlong *)0x0) {
                    // WARNING: Subroutine does not return
      FUN_14000d450(0x80004005);
    }
    plVar1 = (longlong *)*plVar4;
  }
  goto joined_r0x0001403e3ba9;
}



undefined8 FUN_1403e3d10(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_1403e3a60(param_1 + 0x90);
  return 1;
}



void FUN_1403e3d50(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_14000d450(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_140363af0(plVar2 + 6,plVar2[6]);
          }
        }
        FUN_140399690(plVar2 + 3);
        if (plVar2[4] != 0) {
          if (*(int *)((longlong)plVar2 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
            FUN_14034f7d0();
          }
          *(undefined4 *)(plVar2 + 5) = 0;
        }
        plVar1 = *(longlong **)(param_1 + 0x90);
        if (plVar1 == (longlong *)0x0) {
          FUN_14034ff60(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_1403e3e80(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_1405da1e8;
    }
    else {
      plVar4[10] = (longlong)(dVar8 * 2.0);
    }
    dVar9 = (double)plVar4[10];
    if ((double)plVar4[10] <= DAT_1405da1f8) {
      dVar9 = DAT_1405da1f8;
    }
    plVar4[10] = (longlong)dVar9;
    if (DAT_1405da1f0 <= dVar9) {
      dVar9 = DAT_1405da1f0;
    }
    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_14034fef0(0x68);
      }
      else {
        puVar6 = (undefined8 *)(**(code **)(*plVar2 + 8))(plVar2,0x68);
      }
      if (puVar6 != (undefined8 *)0x0) {
        FUN_1403e39d0(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_140363af0(plVar4 + 6,plVar4[6]);
      }
    }
    FUN_140399690(plVar4 + 3);
    if (plVar4[4] != 0) {
      if (*(int *)((longlong)plVar4 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      *(undefined4 *)(plVar4 + 5) = 0;
    }
    plVar1 = (longlong *)param_1[0xe];
    if (plVar1 == (longlong *)0x0) {
      FUN_14034ff60(plVar4);
    }
    else {
      (**(code **)(*plVar1 + 0x10))(plVar1,plVar4);
    }
    param_1[0x11] = param_1[0x11] + -1;
    plVar4 = plVar2;
  }
                    // WARNING: Subroutine does not return
  FUN_14000d450(0x80004005);
}



void FUN_1403e4120(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_1405da238 < 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_1405f6d58;
      if ((int)(uint)param_1[0xd] <= (int)DAT_1405f6d58) {
        uVar8 = (uint)param_1[0xd];
      }
      local_80 = FUN_1403996d0();
      *(undefined8 *)(local_80 + 0x28) = 1;
      if ((int)uVar8 < 0) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      if (local_78 == (undefined8 *)0x0) {
        if ((int)uVar8 < 1) {
          if (local_80 == 0) goto LAB_1403e425b;
          uVar6 = 0;
        }
        else {
          uVar6 = uVar8;
          if (local_80 == 0) {
                    // WARNING: Subroutine does not return
            FUN_140399790();
          }
        }
        FUN_1400179d0(local_80,uVar6);
      }
      else {
        if (local_70._4_4_ < (int)uVar8) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        local_70 = CONCAT44(local_70._4_4_,uVar8);
      }
LAB_1403e425b:
      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_140399790();
        }
        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_14034fef0(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_1403aa040(param_1 + 6);
      if (local_68 != (undefined8 *)0x0) {
        plVar2 = local_68 + 1;
        *plVar2 = *plVar2 + -1;
        if (*plVar2 == 0) {
          FUN_140363af0(&local_68);
        }
      }
      FUN_140399690(&local_80);
      if ((local_78 != (undefined8 *)0x0) && (local_70 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
    } while (0 < (longlong)param_1[0xd]);
  }
  return;
}



undefined8 *
FUN_1403e4480(undefined8 *param_1,undefined8 param_2,undefined4 param_3,undefined8 param_4)

{
  FUN_1403a9d50(param_1 + 6,(longlong)DAT_1405d80ec,param_3,param_4,0xfffffffffffffffe);
  param_1[0xe] = 0;
  param_1[0x11] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  FUN_1403eb740();
  param_1[0x12] = 0;
  param_1[0x15] = 0;
  param_1[0x13] = 0;
  param_1[0x14] = 0;
  FUN_1403eb740();
  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_1405da214;
  param_1[0x18] = 0;
  *(undefined4 *)(param_1 + 0x19) = DAT_1405da214;
  *(undefined4 *)((longlong)param_1 + 0x2c) = DAT_1405f6d60;
  *(undefined4 *)((longlong)param_1 + 0xc) = DAT_1405da214;
  *(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_1403e4580(longlong param_1,float param_2)

{
  int iVar1;
  
  FUN_1403e3930();
  *(double *)(param_1 + 0x10) = (double)param_2 + *(double *)(param_1 + 0x10);
  *(double *)(param_1 + 0x18) = (double)param_2 + *(double *)(param_1 + 0x18);
  iVar1 = DAT_1405f6d60;
  if ((double)*(int *)(param_1 + 0xc) < (double)*(int *)(param_1 + 200) * _DAT_1405da230) {
    iVar1 = (int)(double)*(int *)(param_1 + 0xc) + 1;
  }
  *(int *)(param_1 + 0x2c) = iVar1;
  FUN_1403e4120(param_1,0);
  FUN_1403e3ad0(param_1,(double)param_2);
  FUN_1403e3e80(param_1);
  return;
}



int FUN_1403e4620(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_1403e4700(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_1403e47b0(longlong param_1,undefined4 param_2,undefined8 param_3)

{
  undefined8 uVar1;
  
  if (param_1 == 0) {
    return 0x10;
  }
  uVar1 = FUN_1403e4700();
  if ((int)uVar1 == 0) {
    uVar1 = FUN_1403e4620(param_1,param_2,param_3);
  }
  return uVar1;
}



undefined8 FUN_1403e4810(uint param_1)

{
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
  if ((param_1 < 0x20) && ((&DAT_1405f3a00)[(longlong)(int)param_1 * 10] != 0)) {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
    return 0;
  }
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
  return 0xc;
}



ulonglong FUN_1403e4870(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_1403e9710(&local_res8,&local_20,&local_28,0);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar1 = (*DAT_14060d3a0)(local_res8,param_1,param_2);
  uVar5 = (ulonglong)uVar1;
  if (uVar1 == 0) {
    iVar2 = (*DAT_14060d358)(*(undefined8 *)(param_6 + 6),local_res8);
    if (iVar2 == -1) {
      uVar5 = 0x16;
    }
    else {
      if (param_5 == 1) {
        uVar1 = (*DAT_14060d440)(local_res8,*(undefined8 *)(param_6 + 0xe),
                                 *(undefined8 *)(param_6 + 8),local_20);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1403e4a80;
        uVar1 = (*DAT_14060d440)(local_res8,*(undefined8 *)(param_6 + 0x10),
                                 *(undefined8 *)(param_6 + 10),local_28);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1403e4a80;
        uVar1 = (*DAT_14060d3b8)(local_20,local_28,local_res8);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1403e4a80;
        uVar1 = (*DAT_14060d408)(local_res8,*(undefined8 *)(param_6 + 0xc),
                                 *(undefined8 *)(param_6 + 8),local_res8);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1403e4a80;
        uVar1 = (*DAT_14060d3c8)(local_res8,*(undefined8 *)(param_6 + 10),local_res8);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 != 0) goto LAB_1403e4a80;
        uVar1 = (*DAT_14060d3a8)(local_res8,local_28,local_res8);
      }
      else {
        uVar1 = (*DAT_14060d440)(local_res8,*(undefined8 *)(param_6 + 2),
                                 *(undefined8 *)(param_6 + 6),local_res8);
      }
      uVar5 = (ulonglong)uVar1;
      if (uVar1 == 0) {
        uVar1 = (*DAT_14060d390)(*(undefined8 *)(param_6 + 6));
        if (*param_4 < uVar1) {
          *param_4 = uVar1;
          uVar5 = 6;
        }
        else {
          uVar3 = (*DAT_14060d390)(local_res8);
          uVar4 = (*DAT_14060d390)(*(undefined8 *)(param_6 + 6));
          if (uVar4 < uVar3) {
            uVar5 = 1;
          }
          else {
            *param_4 = uVar1;
            FUN_1403e96f0(param_3,uVar1);
            iVar2 = (*DAT_14060d390)(local_res8);
            uVar1 = (*DAT_14060d398)(local_res8,(ulonglong)(uVar1 - iVar2) + param_3);
            uVar5 = (ulonglong)uVar1;
          }
        }
      }
    }
  }
LAB_1403e4a80:
  FUN_1403e97a0(local_res8,local_20,local_28,0);
  return uVar5;
}



undefined8 FUN_1403e4ac0(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_1403e4b20(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_1403e4b80(int *param_1,int *param_2)

{
  uint uVar1;
  undefined8 uVar2;
  
  if ((param_1 != param_2) && (uVar2 = FUN_1403e4bc0(), (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_1403e4bc0(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_1403eca80(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_1403e4c50(int *param_1,ulonglong param_2)

{
  ulonglong uVar1;
  undefined8 uVar2;
  int iVar3;
  
  param_2 = param_2 & 0xffffffff;
  FUN_1403ecc60();
  iVar3 = 0;
  do {
    uVar2 = FUN_1403ecb60(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_1403ecb20(param_1);
  return 0;
}



undefined8 FUN_1403e4d10(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_1403ecc90(lVar3,param_2);
  return uVar2;
}



int FUN_1403e4d40(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_1403e4d70(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_1403e4da0(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_14046a9a0 + (ulonglong)uVar3 * 4);
    uVar1 = uVar1 >> 4;
  }
  return iVar5;
}



undefined8 FUN_1403e4e10(int *param_1,int param_2)

{
  int iVar1;
  undefined8 uVar2;
  
  FUN_1403ecc60();
  iVar1 = param_2 / 0x1c;
  uVar2 = FUN_1403eca80(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_1403e4e90(int *param_1,char *param_2,int param_3)

{
  char *pcVar1;
  char cVar2;
  int iVar3;
  longlong lVar4;
  undefined8 uVar5;
  char cVar6;
  
  FUN_1403ecc60();
  if (0x3e < param_3 - 2U) {
    return 0xfffffffd;
  }
  cVar2 = *param_2;
  if (cVar2 == '-') {
    param_2 = param_2 + 1;
  }
  FUN_1403ecc60(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_1405da250[lVar4]) break;
      lVar4 = lVar4 + 1;
      iVar3 = iVar3 + 1;
    } while (lVar4 < 0x40);
    if (param_3 <= iVar3) break;
    uVar5 = FUN_1403e5630(param_1,param_3,param_1);
    if ((int)uVar5 != 0) {
      return uVar5;
    }
    uVar5 = FUN_1403e5280(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_1403e4f90(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_1403ecec0(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_1403ecd40(local_38,param_3,local_38,local_res18);
        if (uVar2 != 0) {
          FUN_1403e4b20(local_38);
          return (ulonglong)uVar2;
        }
        iVar4 = iVar4 + 1;
        *(undefined *)puVar1 = PTR_s_0123456789ABCDEFGHIJKLMNOPQRSTUV_1405da250[local_res18[0]];
        puVar1 = (undefined2 *)((longlong)puVar1 + 1);
      }
      FUN_1403eccf0(param_2,iVar4);
      *(undefined1 *)puVar1 = 0;
      FUN_1403e4b20(local_38);
      uVar3 = 0;
    }
    return uVar3;
  }
  *param_2 = 0x30;
  return 0;
}



int FUN_1403e5090(void)

{
  uint uVar1;
  
  uVar1 = FUN_1403e4d70();
  return ((int)(uVar1 + ((int)uVar1 >> 0x1f & 7U)) >> 3) + (uint)((uVar1 & 7) != 0);
}



ulonglong FUN_1403e50c0(undefined8 param_1,undefined1 *param_2)

{
  uint uVar1;
  ulonglong uVar2;
  int iVar3;
  undefined1 *puVar4;
  int local_28 [4];
  undefined1 *local_18;
  
  uVar2 = FUN_1403ecec0(local_28,param_1);
  if ((int)uVar2 == 0) {
    iVar3 = 0;
    puVar4 = param_2;
    do {
      if (local_28[0] == 0) {
        FUN_1403eccf0(param_2,iVar3);
        FUN_1403e4b20(local_28);
        return 0;
      }
      iVar3 = iVar3 + 1;
      *puVar4 = *local_18;
      puVar4 = puVar4 + 1;
      uVar1 = FUN_1403ecef0(local_28,8,local_28);
      uVar2 = (ulonglong)uVar1;
    } while (uVar1 == 0);
    FUN_1403e4b20(local_28);
  }
  return uVar2;
}



undefined8 FUN_1403e5170(int *param_1,byte *param_2,int param_3)

{
  byte bVar1;
  undefined8 uVar2;
  
  if ((1 < param_1[1]) || (uVar2 = FUN_1403eca80(param_1,2), (int)uVar2 == 0)) {
    FUN_1403ecc60(param_1);
    while (0 < param_3) {
      param_3 = param_3 + -1;
      uVar2 = FUN_1403ecb60(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_1403ecb20(param_1);
    uVar2 = 0;
  }
  return uVar2;
}



void FUN_1403e5200(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_1403ed170();
  }
  else {
    iVar3 = FUN_1403ecc90();
    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_1403ed070(lVar4,param_2,param_3);
  }
  return;
}



ulonglong FUN_1403e5280(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_1403eca80(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_1403e5440(param_1,param_2,param_3);
    param_3[2] = 1;
    param_1[2] = 1;
    FUN_1403ecb20(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_1403ecb20(param_3);
  return 0;
}



void FUN_1403e53c0(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_1403ecc90();
    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_1403ed070(lVar3,param_1,param_3);
  }
  else {
    *(int *)(param_3 + 8) = iVar1;
    FUN_1403ed170();
  }
  return;
}



ulonglong FUN_1403e5440(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_1403eca80(param_3), (int)uVar3 == 0)) {
    if (param_1[2] == 1) {
      param_1[2] = 0;
      uVar2 = FUN_1403e5280(param_1,param_2,param_3);
      param_3[2] = 1;
      param_1[2] = 1;
      FUN_1403ecb20(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_1403ecb20(param_3);
    uVar3 = 0;
  }
  return uVar3;
}



void FUN_1403e5580(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_1405da260) {
    iVar4 = iVar6;
    if (iVar3 < iVar6) {
      iVar4 = iVar3;
    }
    if (iVar4 < DAT_1405da258) {
      iVar4 = iVar6 + 1 + iVar3;
      if (iVar4 < 0x200) {
        if (iVar3 < iVar6) {
          iVar6 = iVar3;
        }
        if (iVar6 < 0x101) {
          FUN_1403ed400(param_1,param_2,param_3,iVar4);
          goto LAB_1403e5612;
        }
      }
      FUN_1403ed2a0(param_1,param_2,param_3,iVar4);
    }
    else {
      FUN_1403ed5a0(param_1,param_2,param_3);
    }
  }
  else {
    FUN_1403ed880(param_1,param_2,param_3);
  }
LAB_1403e5612:
  if (0 < *param_3) {
    uVar5 = (uint)(iVar2 != iVar1);
  }
  param_3[2] = uVar5;
  return;
}



undefined8 FUN_1403e5630(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_1403eca80(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_1403ecb20(param_3);
    uVar4 = 0;
  }
  return uVar4;
}



void FUN_1403e56f0(int *param_1,longlong param_2)

{
  int iVar1;
  
  iVar1 = *param_1;
  if (DAT_1405da264 <= iVar1) {
    FUN_1403ee5a0();
    *(undefined4 *)(param_2 + 8) = 0;
    return;
  }
  if (DAT_1405da25c <= iVar1) {
    FUN_1403ee360();
    *(undefined4 *)(param_2 + 8) = 0;
    return;
  }
  if ((iVar1 * 2 + 1 < 0x200) && (iVar1 < 0x80)) {
    FUN_1403ee190();
    *(undefined4 *)(param_2 + 8) = 0;
    return;
  }
  FUN_1403ee020();
  *(undefined4 *)(param_2 + 8) = 0;
  return;
}



ulonglong FUN_1403e5770(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_1403ecc90();
  if (iVar3 == -1) {
    uVar6 = 0;
    if (param_4 != 0) {
      uVar4 = FUN_1403e4bc0(param_1,param_4);
      uVar6 = (ulonglong)uVar4;
    }
    if (param_3 != 0) {
      FUN_1403ecc60(param_3);
    }
    return uVar6;
  }
  uVar6 = FUN_1403eeca0(local_88,*param_1 + 2);
  if ((int)uVar6 != 0) {
    return uVar6;
  }
  local_88[0] = *param_1 + 2;
  uVar4 = FUN_1403e4ac0(local_a0);
  uVar6 = (ulonglong)uVar4;
  if (uVar4 != 0) goto LAB_1403e5c79;
  uVar4 = FUN_1403e4ac0(local_68);
  uVar6 = (ulonglong)uVar4;
  if (uVar4 == 0) {
    uVar4 = FUN_1403ecec0(local_d8,param_1);
    uVar6 = (ulonglong)uVar4;
    if (uVar4 == 0) {
      uVar4 = FUN_1403ecec0(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_1403e4d70(local_b8);
        if (iVar3 % 0x1c < 0x1b) {
          iVar3 = 0x1b - iVar3 % 0x1c;
          local_c0 = iVar3;
          uVar4 = FUN_1403ecb60(local_d8,iVar3,local_d8);
          uVar6 = (ulonglong)uVar4;
          if (uVar4 == 0) {
            uVar4 = FUN_1403ecb60(local_b8,iVar3,local_b8);
            uVar6 = (ulonglong)uVar4;
            if (uVar4 == 0) goto LAB_1403e58ea;
          }
        }
        else {
          local_c0 = 0;
LAB_1403e58ea:
          iVar3 = local_b8[0] + -1;
          iVar11 = local_d8[0] + -1;
          uVar4 = FUN_1403eec10(local_b8,iVar11 - iVar3);
          uVar6 = (ulonglong)uVar4;
          if (uVar4 == 0) {
            lVar10 = (longlong)iVar11;
            lVar12 = (longlong)iVar3;
            iVar5 = FUN_1403e4d10(local_d8,local_b8);
            if (iVar5 != -1) {
              do {
                piVar1 = (int *)(local_78 + (lVar10 - lVar12) * 4);
                *piVar1 = *piVar1 + 1;
                uVar4 = FUN_1403e53c0(local_d8,local_b8,local_d8);
                uVar6 = (ulonglong)uVar4;
                if (uVar4 != 0) goto LAB_1403e5c55;
                iVar5 = FUN_1403e4d10(local_d8,local_b8);
              } while (iVar5 != -1);
            }
            FUN_1403eeb90(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_1403ecc60(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_1403e5630(local_a0,*(undefined4 *)(lVar9 + local_78),local_a0);
                    uVar6 = (ulonglong)uVar4;
                    if (uVar4 != 0) goto LAB_1403e5c55;
                    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_1403ecc90(local_a0,local_68);
                  } while (iVar5 == 1);
                  uVar4 = FUN_1403e5630(local_b8,*(undefined4 *)(lVar9 + local_78),local_a0);
                  uVar6 = (ulonglong)uVar4;
                  if (uVar4 != 0) goto LAB_1403e5c55;
                  uVar4 = FUN_1403eec10(local_a0,(iVar11 - iVar3) + -1);
                  uVar6 = (ulonglong)uVar4;
                  if (uVar4 != 0) goto LAB_1403e5c55;
                  uVar4 = FUN_1403e53c0(local_d8,local_a0,local_d8);
                  uVar6 = (ulonglong)uVar4;
                  if (uVar4 != 0) goto LAB_1403e5c55;
                  iVar5 = local_bc;
                  if (local_d0 == 1) {
                    uVar4 = FUN_1403e4bc0(local_b8,local_a0);
                    uVar6 = (ulonglong)uVar4;
                    if (uVar4 != 0) goto LAB_1403e5c55;
                    uVar4 = FUN_1403eec10(local_a0,(iVar11 - iVar3) + -1);
                    uVar6 = (ulonglong)uVar4;
                    if (uVar4 != 0) goto LAB_1403e5c55;
                    uVar4 = FUN_1403e5200(local_d8,local_a0,local_d8);
                    uVar6 = (ulonglong)uVar4;
                    if (uVar4 != 0) goto LAB_1403e5c55;
                    *(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_1403ecb20(local_88);
              FUN_1403eeb60(local_88,param_3);
              *(uint *)(param_3 + 8) = local_70;
            }
            if (param_4 != 0) {
              FUN_1403ecef0(local_d8,local_c0,local_d8,0);
              FUN_1403eeb60(local_d8,param_4);
            }
            uVar6 = 0;
          }
        }
LAB_1403e5c55:
        FUN_1403e4b20(local_b8);
      }
      FUN_1403e4b20(local_d8);
    }
    FUN_1403e4b20(local_68);
  }
  FUN_1403e4b20(local_a0);
LAB_1403e5c79:
  FUN_1403e4b20(local_88);
  return uVar6;
}



undefined8 FUN_1403e5ca0(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_1403eca80(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_1403ecb20(param_2);
    uVar5 = 0;
  }
  return uVar5;
}



void FUN_1403e5d50(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  FUN_1403ecd40(param_1,param_2,0,param_3);
  return;
}



ulonglong FUN_1403e5d60(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_1403eed50(param_2,param_3);
    return uVar5;
  }
  if (*param_2 == 0) {
    uVar5 = FUN_1403eed50(param_1,param_3);
    return uVar5;
  }
  uVar5 = FUN_1403ecec0(local_30,param_1);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar1 = FUN_1403ecec0(local_48,param_2);
  uVar5 = (ulonglong)uVar1;
  if (uVar1 != 0) goto LAB_1403e5f1f;
  local_40 = uVar1;
  local_28 = uVar1;
  iVar2 = FUN_1403e4da0(local_30);
  iVar3 = FUN_1403e4da0(local_48);
  iVar6 = iVar3;
  if (iVar2 < iVar3) {
    iVar6 = iVar2;
  }
  if (iVar6 < 1) {
LAB_1403e5e3f:
    if (iVar2 != iVar6) {
      uVar1 = FUN_1403ecef0(local_30,iVar2 - iVar6,local_30,0);
      uVar5 = (ulonglong)uVar1;
      if (uVar1 != 0) goto LAB_1403e5f04;
    }
    if (iVar3 != iVar6) {
      uVar1 = FUN_1403ecef0(local_48,iVar3 - iVar6,local_48,0);
      uVar5 = (ulonglong)uVar1;
      if (uVar1 != 0) goto LAB_1403e5f04;
    }
    do {
      if (local_48[0] == 0) {
        uVar1 = FUN_1403ecb60(local_30,iVar6,param_3);
        uVar5 = (ulonglong)uVar1;
        if (uVar1 == 0) {
          *(undefined4 *)(param_3 + 8) = 0;
        }
        break;
      }
      iVar2 = FUN_1403ecc90(local_30,local_48);
      if (iVar2 == 1) {
        FUN_1403eeb60(local_30,local_48);
      }
      uVar1 = FUN_1403ed070(local_48,local_30,local_48);
      uVar5 = (ulonglong)uVar1;
      if (uVar1 != 0) break;
      uVar4 = FUN_1403e4da0(local_48);
      uVar1 = FUN_1403ecef0(local_48,uVar4,local_48,0);
      uVar5 = (ulonglong)uVar1;
    } while (uVar1 == 0);
  }
  else {
    uVar1 = FUN_1403ecef0(local_30,iVar6,local_30,0);
    uVar5 = (ulonglong)uVar1;
    if (uVar1 == 0) {
      uVar1 = FUN_1403ecef0(local_48,iVar6,local_48,0);
      uVar5 = (ulonglong)uVar1;
      if (uVar1 == 0) goto LAB_1403e5e3f;
    }
  }
LAB_1403e5f04:
  FUN_1403e4b20(local_30);
LAB_1403e5f1f:
  FUN_1403e4b20(local_48);
  return uVar5;
}



ulonglong FUN_1403e5f40(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_1403eedc0(local_20,local_38,0);
  if ((int)uVar3 == 0) {
    uVar1 = FUN_1403e5d60(param_1,param_2,local_20);
    uVar3 = (ulonglong)uVar1;
    if (uVar1 == 0) {
      iVar2 = FUN_1403ecc90(param_1,param_2);
      if (iVar2 == -1) {
        uVar1 = FUN_1403e5770(param_1,local_20,local_38,0);
      }
      else {
        uVar1 = FUN_1403e5770(param_2,local_20,local_38,0);
        param_2 = param_1;
      }
      uVar3 = (ulonglong)uVar1;
      if (uVar1 == 0) {
        uVar1 = FUN_1403e5580(param_2,local_38,param_3);
        *(undefined4 *)(param_3 + 8) = 0;
        uVar3 = (ulonglong)uVar1;
      }
    }
    FUN_1403eed80(local_20,local_38,0);
  }
  return uVar3;
}



ulonglong FUN_1403e6010(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  uint uVar1;
  ulonglong uVar2;
  undefined1 local_28 [32];
  
  uVar2 = FUN_1403e4ac0(local_28);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1403e5580(param_1,param_2,local_28);
    if (uVar1 == 0) {
      uVar1 = FUN_1403eee40(local_28,param_3,param_4);
    }
    uVar2 = (ulonglong)uVar1;
    FUN_1403e4b20(local_28);
  }
  return uVar2;
}



ulonglong FUN_1403e6090(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  undefined1 local_28 [32];
  
  uVar2 = FUN_1403e4ac0(local_28);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1403e56f0(param_1,local_28);
    if (uVar1 == 0) {
      uVar1 = FUN_1403eee40(local_28,param_2,param_3);
    }
    uVar2 = (ulonglong)uVar1;
    FUN_1403e4b20(local_28);
  }
  return uVar2;
}



undefined8 FUN_1403e6100(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_1403ef340();
    return uVar1;
  }
  uVar1 = FUN_1403eeef0();
  return uVar1;
}



undefined8 FUN_1403e6130(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_1403e6190(undefined8 param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  
  iVar1 = FUN_1403e4d70(param_2);
  iVar1 = iVar1 % 0x1c;
  if (*param_2 < 2) {
    iVar1 = 1;
    FUN_1403ef6c0(param_1,1);
  }
  else {
    uVar3 = FUN_1403e4e10(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_1403ef610(param_1,param_1);
    if ((int)uVar3 != 0) break;
    iVar2 = FUN_1403ecc90(param_1,param_2);
    if ((iVar2 != -1) && (uVar3 = FUN_1403ed070(param_1,param_2,param_1), (int)uVar3 != 0)) {
      return uVar3;
    }
    iVar1 = iVar1 + 1;
  }
  return uVar3;
}



undefined8 FUN_1403e6260(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_1403ef700();
    return uVar3;
  }
  if ((iVar2 <= param_1[1]) || (uVar3 = FUN_1403eca80(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_1403ecb20(param_1);
    FUN_1403eeb90(param_1,*param_2);
    iVar2 = FUN_1403ecc90(param_1,param_2);
    if (iVar2 != -1) {
      uVar3 = FUN_1403ed070(param_1,param_2,param_1);
      return uVar3;
    }
    uVar3 = 0;
  }
  return uVar3;
}



ulonglong FUN_1403e63d0(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_1403e4ac0(local_38);
    if ((int)uVar3 == 0) {
      uVar1 = FUN_1403e6100(param_1,param_3,local_38);
      if ((uVar1 == 0) && (uVar1 = FUN_1403e4ac0(local_20), uVar1 == 0)) {
        uVar1 = FUN_1403eed50(param_2,local_20);
        if (uVar1 != 0) {
          FUN_1403eed80(local_38,local_20,0);
          return (ulonglong)uVar1;
        }
        uVar1 = FUN_1403e63d0(local_38,local_20,param_3,param_4);
        FUN_1403eed80(local_38,local_20,0);
        return (ulonglong)uVar1;
      }
      uVar3 = (ulonglong)uVar1;
      FUN_1403e4b20(local_38);
    }
  }
  else {
    iVar2 = FUN_1403f0540(param_3);
    if (iVar2 == 1) {
      uVar4 = 1;
    }
    else {
      iVar2 = FUN_1403eff80(param_3);
      if (iVar2 == 0) {
        iVar2 = FUN_1403eff10(param_3);
        iVar2 = iVar2 * 2;
      }
      if (((0 < *param_3) && ((**(byte **)(param_3 + 4) & 1) != 0)) || (iVar2 != 0)) {
        uVar3 = FUN_1403ef950(param_1,param_2,param_3,param_4,iVar2);
        return uVar3;
      }
      uVar4 = 0;
    }
    uVar3 = FUN_1403effc0(param_1,param_2,param_3,param_4,uVar4);
  }
  return uVar3;
}



ulonglong FUN_1403e6530(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_14046f6b0;
  do {
    iVar1 = FUN_1403e4d40(param_1,*puVar5);
    if (iVar1 == 0) {
      *param_3 = 1;
      goto LAB_1403e663c;
    }
    puVar5 = puVar5 + 1;
  } while ((longlong)puVar5 < 0x14046fab0);
  uVar3 = FUN_1403f0750(param_1,local_res10);
  if ((int)uVar3 == 0) {
    if (local_res10[0] == 1) {
LAB_1403e663c:
      uVar3 = 0;
    }
    else {
      uVar3 = FUN_1403e4ac0(local_48);
      if ((int)uVar3 == 0) {
        uVar3 = uVar3 & 0xffffffff;
        if (0 < (longlong)param_2) {
          do {
            FUN_1403ef6c0(local_48,(&DAT_14046f6b0)[lVar4]);
            uVar2 = FUN_1403f0590(param_1,local_48,local_res10);
            uVar3 = (ulonglong)uVar2;
            if ((uVar2 != 0) || (local_res10[0] == 0)) goto LAB_1403e660c;
            lVar4 = lVar4 + 1;
          } while (lVar4 < param_2);
        }
        *param_3 = 1;
LAB_1403e660c:
        FUN_1403e4b20(local_48);
      }
    }
  }
  return uVar3;
}



undefined8 FUN_1403e6650(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_14046c760 + (ulonglong)bVar1 * 4) ^
            *(uint *)(&DAT_14046d360 + (ulonglong)(((uVar3 & 0xff00) << 8) >> 0x10) * 4) ^
            *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar3 & 0xff) * 4) ^
            *(uint *)(&DAT_14046cb60 + (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_14046f364;
    do {
      uVar4 = puVar5[6];
      puVar6 = puVar7 + 1;
      uVar4 = *(uint *)(&DAT_14046c760 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d360 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046cb60 + (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 *)"sha256");
  }
  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_14046c760 + (ulonglong)bVar1 * 4) ^
            *(uint *)(&DAT_14046d360 + (ulonglong)(((uVar3 & 0xff00) << 8) >> 0x10) * 4) ^
            *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar3 & 0xff) * 4) ^
            *(uint *)(&DAT_14046cb60 + (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_14046f364;
    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_14046c760 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d360 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046cb60 + (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_14046f380);
  }
  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_14046c760 + (ulonglong)bVar1 * 4) ^
            *(uint *)(&DAT_14046d360 + (ulonglong)(((uVar3 & 0xff00) << 8) >> 0x10) * 4) ^
            *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar3 & 0xff) * 4) ^
            *(uint *)(&DAT_14046cb60 + (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_14046f364;
    puVar7 = param_4 + 0xc;
    do {
      uVar4 = puVar7[-1];
      puVar6 = puVar5 + 1;
      uVar9 = *(uint *)(&DAT_14046c760 + (ulonglong)(uVar4 & 0xff) * 4) ^
              *(uint *)(&DAT_14046d360 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046cf60 + (ulonglong)((uVar4 >> 8 & 0xff00) >> 8) * 4) ^
              *(uint *)(&DAT_14046cb60 + (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_14046c760 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d360 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046cb60 + (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_14046f37c);
  }
  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_14046e360 + (ulonglong)(uVar4 >> 0x18) * 4) ^
                *(uint *)(&DAT_14046e760 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
                *(uint *)(&DAT_14046eb60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
                *(uint *)(&DAT_14046ef60 + (ulonglong)(uVar4 & 0xff) * 4);
      uVar4 = puVar6[-3];
      puVar10[5] = *(uint *)(&DAT_14046e360 + (ulonglong)(uVar4 >> 0x18) * 4) ^
                   *(uint *)(&DAT_14046e760 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
                   *(uint *)(&DAT_14046eb60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
                   *(uint *)(&DAT_14046ef60 + (ulonglong)(uVar4 & 0xff) * 4);
      uVar4 = puVar6[-2];
      puVar10[6] = *(uint *)(&DAT_14046e360 + (ulonglong)(uVar4 >> 0x18) * 4) ^
                   *(uint *)(&DAT_14046e760 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
                   *(uint *)(&DAT_14046eb60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
                   *(uint *)(&DAT_14046ef60 + (ulonglong)(uVar4 & 0xff) * 4);
      uVar4 = puVar6[-1];
      puVar10[7] = *(uint *)(&DAT_14046e360 + (ulonglong)(uVar4 >> 0x18) * 4) ^
                   *(uint *)(&DAT_14046e760 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
                   *(uint *)(&DAT_14046eb60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
                   *(uint *)(&DAT_14046ef60 + (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_1403e6df0(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_14046bf60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar6 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046c360 + (ulonglong)(uVar3 & 0xff) * 4) ^ param_3[4];
    uVar1 = *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar5 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046c360 + (ulonglong)(uVar6 & 0xff) * 4) ^ param_3[5];
    uVar8 = *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar4 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046c360 + (ulonglong)(uVar5 & 0xff) * 4) ^ param_3[6];
    uVar3 = *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar3 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046c360 + (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_14046bf60 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar1 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046c360 + (ulonglong)(uVar3 & 0xff) * 4) ^ *param_3;
      uVar5 = *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar1 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046c360 + (ulonglong)(uVar2 & 0xff) * 4) ^ param_3[1];
      uVar4 = *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar8 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046c360 + (ulonglong)(uVar1 & 0xff) * 4) ^ param_3[2];
      uVar3 = *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar1 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046c360 + (ulonglong)(uVar8 & 0xff) * 4) ^ param_3[3];
      uVar2 = *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046c360 + (ulonglong)(uVar3 & 0xff) * 4) ^ param_3[4];
      uVar1 = *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar5 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046c360 + (ulonglong)(uVar6 & 0xff) * 4) ^ param_3[5];
      uVar8 = *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046c360 + (ulonglong)(uVar5 & 0xff) * 4) ^ param_3[6];
      uVar3 = *(uint *)(&DAT_14046ab60 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046bf60 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046bb60 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046c360 + (ulonglong)(uVar4 & 0xff) * 4) ^ param_3[7];
    }
    uVar4 = *(uint *)(&DAT_14046cb60 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar1 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046d360 + (ulonglong)(uVar2 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046c760 + (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_14046cb60 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046d360 + (ulonglong)(uVar1 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046c760 + (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_14046cf60 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046d360 + (ulonglong)(uVar8 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046cb60 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046c760 + (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_14046d360 + (ulonglong)(uVar3 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046cb60 + (ulonglong)(uVar1 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046cf60 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046c760 + (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_1403e73d0(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_14046d760 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046db60 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046b360 + (ulonglong)(uVar7 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046df60 + (ulonglong)(uVar6 & 0xff) * 4) ^ *(uint *)(param_3 + 0x100);
    uVar3 = *(uint *)(&DAT_14046db60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046b360 + (ulonglong)(uVar6 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046d760 + (ulonglong)(uVar7 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046df60 + (ulonglong)(uVar5 & 0xff) * 4) ^ *(uint *)(param_3 + 0x104);
    iVar9 = *(int *)(param_3 + 0x1e0) >> 1;
    uVar2 = *(uint *)(&DAT_14046b360 + (ulonglong)(uVar5 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046d760 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046db60 + (ulonglong)(uVar7 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046df60 + (ulonglong)(uVar4 & 0xff) * 4) ^ *(uint *)(param_3 + 0x108);
    uVar4 = *(uint *)(&DAT_14046b360 + (ulonglong)(uVar4 >> 0x18) * 4) ^
            *(uint *)(&DAT_14046d760 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
            *(uint *)(&DAT_14046db60 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
            *(uint *)(&DAT_14046df60 + (ulonglong)(uVar7 & 0xff) * 4) ^ *(uint *)(param_3 + 0x10c);
    puVar1 = (uint *)(param_3 + 0x110);
    while (iVar9 = iVar9 + -1, iVar9 != 0) {
      uVar7 = *(uint *)(&DAT_14046d760 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046db60 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046b360 + (ulonglong)(uVar8 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046df60 + (ulonglong)(uVar3 & 0xff) * 4) ^ *puVar1;
      uVar6 = *(uint *)(&DAT_14046db60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046b360 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d760 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046df60 + (ulonglong)(uVar2 & 0xff) * 4) ^ puVar1[1];
      uVar5 = *(uint *)(&DAT_14046b360 + (ulonglong)(uVar2 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d760 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046db60 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046df60 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[2];
      uVar4 = *(uint *)(&DAT_14046b360 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d760 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046db60 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046df60 + (ulonglong)(uVar8 & 0xff) * 4) ^ puVar1[3];
      uVar8 = *(uint *)(&DAT_14046d760 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046db60 + (ulonglong)(uVar5 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046b360 + (ulonglong)(uVar7 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046df60 + (ulonglong)(uVar6 & 0xff) * 4) ^ puVar1[4];
      uVar3 = *(uint *)(&DAT_14046db60 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046b360 + (ulonglong)(uVar6 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d760 + (ulonglong)(uVar7 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046df60 + (ulonglong)(uVar5 & 0xff) * 4) ^ puVar1[5];
      uVar2 = *(uint *)(&DAT_14046b360 + (ulonglong)(uVar5 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d760 + (ulonglong)(uVar6 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046db60 + (ulonglong)(uVar7 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046df60 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[6];
      uVar4 = *(uint *)(&DAT_14046b360 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_14046d760 + (ulonglong)(uVar5 >> 0x10 & 0xff) * 4) ^
              *(uint *)(&DAT_14046db60 + (ulonglong)(uVar6 >> 8 & 0xff) * 4) ^
              *(uint *)(&DAT_14046df60 + (ulonglong)(uVar7 & 0xff) * 4) ^ puVar1[7];
      puVar1 = puVar1 + 8;
    }
    uVar5 = *(uint *)(&DAT_14046b760 + (ulonglong)(uVar4 >> 0x10 & 0xff) * 4) & 0xff0000 ^
            *(uint *)(&DAT_14046b760 + (ulonglong)(uVar2 >> 8 & 0xff) * 4) & 0xff00 ^
            *(uint *)(&DAT_14046b760 + (ulonglong)(uVar8 >> 0x18) * 4) & 0xff000000 ^
            (uint)(byte)(&DAT_14046b760)[(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_14046b760 + (ulonglong)(uVar8 >> 0x10 & 0xff) * 4) & 0xff0000 ^
            *(uint *)(&DAT_14046b760 + (ulonglong)(uVar4 >> 8 & 0xff) * 4) & 0xff00 ^
            *(uint *)(&DAT_14046b760 + (ulonglong)(uVar3 >> 0x18) * 4) & 0xff000000 ^
            (uint)(byte)(&DAT_14046b760)[(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_14046b760 + (ulonglong)(uVar3 >> 0x10 & 0xff) * 4) & 0xff0000 ^
            *(uint *)(&DAT_14046b760 + (ulonglong)(uVar2 >> 0x18) * 4) & 0xff000000 ^
            *(uint *)(&DAT_14046b760 + (ulonglong)(uVar8 >> 8 & 0xff) * 4) & 0xff00 ^
            (uint)(byte)(&DAT_14046b760)[(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_14046b760 + (ulonglong)(uVar2 >> 0x10 & 0xff) * 4) & 0xff0000 ^
            *(uint *)(&DAT_14046b760 + (ulonglong)(uVar4 >> 0x18) * 4) & 0xff000000 ^
            *(uint *)(&DAT_14046b760 + (ulonglong)(uVar3 >> 8 & 0xff) * 4) & 0xff00 ^
            (uint)(byte)(&DAT_14046b760)[(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_1403e7a30(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_1405d84f0 ^ (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_1403e93f0(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_1403e9440(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_1403e7a30(param_1,(longlong)param_1 + 0x2c);
          if ((int)uVar1 != 0) {
            return uVar1;
          }
          *param_1 = *param_1 + 0x200;
          *(undefined4 *)(param_1 + 5) = 0;
        }
      }
      uVar1 = FUN_1403e7a30(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_1403e9520(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_1403e7a30(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_1403e7a30(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_1403e96f0(void *param_1,size_t param_2)

{
  if ((param_1 != (void *)0x0) && (param_2 != 0)) {
    memset(param_1,0,param_2);
  }
  return;
}



undefined8 FUN_1403e9710(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_14060d310)();
    if (iVar3 != 0) break;
    puVar1 = *(undefined8 **)(puVar2 + 0x10);
    iVar4 = iVar4 + 1;
    puVar2 = puVar2 + 8;
  }
  for (; iVar4 != 0; iVar4 = iVar4 + -1) {
    (*DAT_14060d320)(*param_1);
    param_1 = *(undefined8 **)((longlong)register0x00000020 + 0x10);
    register0x00000020 = (BADSPACEBASE *)((longlong)register0x00000020 + 8);
  }
  return 0xd;
}



void FUN_1403e97a0(longlong param_1)

{
  undefined1 *puVar1;
  longlong local_res10 [3];
  
  puVar1 = (undefined1 *)register0x00000020;
  while (param_1 != 0) {
    (*DAT_14060d320)();
    param_1 = *(longlong *)(puVar1 + 0x10);
    puVar1 = puVar1 + 8;
  }
  return;
}



undefined4
FUN_1403e97f0(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_1403e990a;
      }
      *(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_1403e9930(param_1,param_2,_Memory,uVar4,1);
LAB_1403e990a:
  free(_Memory);
  return uVar2;
}



undefined8 FUN_1403e9930(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_1403e9b30;
      if (iVar2 == 0) break;
      local_38 = local_res8;
      switch(iVar2) {
      case 1:
        uVar4 = FUN_1403f2100(param_1 + local_34);
        if ((int)uVar4 != 0) {
          return uVar4;
        }
        uVar4 = FUN_1403f20e0(&local_38);
        break;
      case 2:
        uVar4 = FUN_1403f1f50(param_1 + local_34,local_res8);
        if ((int)uVar4 == 0) {
          uVar4 = FUN_1403f1e50(puVar3);
          break;
        }
        goto LAB_1403e9b14;
      case 3:
        uVar4 = FUN_1403f1df0(param_1 + local_34,local_res8);
        if ((int)uVar4 != 0) goto LAB_1403e9b14;
        uVar4 = FUN_1403f1da0(*puVar3);
        break;
      case 4:
        uVar4 = FUN_1403f1c40(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1403e9b14;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1403f1bf0();
        break;
      case 5:
        uVar4 = FUN_1403f1af0(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1403e9b14;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1403f1aa0();
        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_1403e9b30;
        }
        local_38 = 2;
        goto LAB_1403e9ad8;
      case 7:
        uVar4 = FUN_1403f1920(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1403e9b14;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1403f17f0(puVar3);
        break;
      case 8:
        uVar4 = FUN_1403f16b0(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1403e9b14;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1403f1610(puVar3);
        break;
      case 9:
        uVar4 = FUN_1403f1470(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1403e9b14;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1403f13d0(puVar3);
        break;
      case 10:
        uVar4 = FUN_1403f11d0(param_1 + local_34,local_res8,puVar3,&local_2c);
        if ((int)uVar4 != 0) goto LAB_1403e9b14;
        *(undefined4 *)(lVar9 + 0x10 + param_3) = local_2c;
        uVar4 = FUN_1403f10c0(puVar3);
        break;
      case 0xb:
        uVar4 = FUN_1403f0dc0(param_1 + local_34);
        iVar2 = (int)uVar4;
        goto joined_r0x0001403e9dd6;
      case 0xc:
        uVar4 = FUN_1403f07d0(param_1 + local_34);
        iVar2 = (int)uVar4;
joined_r0x0001403e9dd6:
        if (iVar2 == 0) goto LAB_1403e9ad8;
LAB_1403e9b14:
        if (param_5 != 0) {
          return uVar4;
        }
        goto LAB_1403e9b30;
      case 0xd:
      case 0xf:
        if (iVar2 == 0xf) {
          bVar10 = (param_1[local_34] & 0x3fU) == 0x31;
LAB_1403e9db2:
          if (!bVar10) {
            return 7;
          }
        }
        else if (iVar2 == 0xd) {
          bVar10 = (param_1[local_34] & 0x3fU) == 0x30;
          goto LAB_1403e9db2;
        }
        uVar11 = 1;
        goto LAB_1403e9d54;
      case 0xe:
        uVar11 = 0;
LAB_1403e9d54:
        uVar4 = FUN_1403e9930(param_1 + local_34,local_res8,puVar3,local_2c,uVar11);
        if ((int)uVar4 == 0) {
          uVar4 = FUN_1403f0b40(puVar3);
          break;
        }
        goto LAB_1403e9b14;
      default:
        return 0x10;
      }
      if ((int)uVar4 != 0) {
        return uVar4;
      }
LAB_1403e9ad8:
      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_1403e9b30:
      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_1403e9e70(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_1403e9f9f;
      }
      *(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_1403f2140(_Memory,uVar4,param_1,param_2,0xd);
LAB_1403e9f9f:
  free(_Memory);
  return uVar2;
}



ulonglong FUN_1403e9fd0(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_1403e4810(param_4);
  if ((int)uVar3 == 0) {
    _Memory = calloc(1,(longlong)param_2);
    if (_Memory == (byte *)0x0) {
      uVar3 = 0xd;
    }
    else {
      do {
        iVar1 = (**(code **)(&DAT_1405f3a28 + (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_14060d3a0)(param_1,_Memory,param_2);
        if ((uVar2 != 0) || (uVar2 = (*DAT_14060d448)(param_1,local_res8), uVar2 != 0)) {
          free(_Memory);
          return (ulonglong)uVar2;
        }
      } while (local_res8[0] == 0);
      free(_Memory);
      uVar3 = 0;
    }
  }
  return uVar3;
}



undefined8
FUN_1403ea130(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_1403e4810(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_1405f3a28 + (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_1405f3a28 + (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_1403ea300(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_1403ea690(param_8);
    if (((int)uVar3 == 0) && (uVar3 = FUN_1403e4810(param_7), (int)uVar3 == 0)) {
      uVar1 = *(uint *)(&DAT_1405f440c + (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_1403f2800(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_1405f3a28 + (longlong)param_7 * 0x50))
                                (_Memory_01,uVar3,param_6);
              if (uVar2 == uVar1) {
                uVar8 = (uVar6 - uVar1) - 1;
                uVar2 = FUN_1403f2640(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_1403f2640(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_1403ea690(uint param_1)

{
  EnterCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
  if ((param_1 < 0x20) && ((&DAT_1405f4400)[(longlong)(int)param_1 * 0x10] != 0)) {
    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
    return 0;
  }
  LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
  return 0xb;
}



undefined8
FUN_1403ea6f0(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_1403ea7ab:
        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_1403ea7ab;
      }
    }
  }
  return 7;
}



ulonglong FUN_1403ea820(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_1403ea690(param_6);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  uVar1 = *(uint *)(&DAT_1405f440c + (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_1403f2640(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_1403f2640(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_1403f2800(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_1403eab20;
                }
                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_1403eab20;
                }
                memcpy(param_7,_Memory + local_48[0],(ulonglong)uVar9);
                local_48[0] = uVar2 + (uVar8 - uVar1);
                *param_9 = 1;
              }
              uVar7 = 0;
            }
          }
        }
      }
      else {
        uVar7 = 0;
      }
LAB_1403eab20:
      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;
}



void FUN_1403eaba0(longlong param_1)

{
  *(undefined1 *)(param_1 + 0x30) = 0;
  return;
}



void FUN_1403eabb0(longlong param_1)

{
  FUN_14035a290(param_1 + 0x388);
  return;
}



void FUN_1403eac00(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_140355560();
    if (cVar1 == '\0') {
      *(undefined1 *)(param_1 + 0x30) = 1;
      *(undefined4 *)(param_1 + 0x34) = 0;
      uVar2 = FUN_14035a290(param_1 + 0x388);
      *(undefined4 *)(param_1 + 0x38) = 0;
      *(undefined8 *)(param_1 + 0x28) = uVar2;
    }
  }
  return;
}



void FUN_1403eac60(longlong param_1)

{
  FUN_14034ed40(param_1 + 0x310);
  if ((*(longlong **)(param_1 + 0x18) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x18) != 0))
  {
    FUN_1403552c0();
  }
  if ((*(longlong **)(param_1 + 0x20) != (longlong *)0x0) && (**(longlong **)(param_1 + 0x20) != 0))
  {
    FUN_1403552c0();
  }
  FUN_14034edd0(param_1 + 0x310);
  return;
}



void FUN_1403eacd0(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_1405f6d50;
  local_c = DAT_1405f6d54;
  uVar2 = 0;
  if (*(undefined8 **)(param_1 + 0x18) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(param_1 + 0x18);
  }
  iVar1 = FUN_140357140(uVar2,&DAT_1405f6af0,600,&local_18);
  if (iVar1 != 0) {
    *(undefined1 *)(param_1 + 0x2c0) = 0;
    *(undefined1 *)(param_1 + 0x30) = 0;
  }
  return;
}



void FUN_1403ead40(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_1403562a0(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_1403eada0(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_14034ed40(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_1403eacd0(param_1);
      FUN_1403ead40(param_1);
    }
    else {
      dVar3 = (double)FUN_14035a290(param_1 + 0x388);
      if ((_DAT_1405d8160 < dVar3 - *(double *)(param_1 + 0x28)) ||
         (*(char *)(param_1 + 0x48) != '\0')) {
        uVar4 = FUN_1403eabb0(param_1);
        *(undefined8 *)(param_1 + 0x40) = uVar4;
        *(undefined1 *)(param_1 + 0x48) = 0;
        *(undefined1 *)(param_1 + 0x30) = 0;
        FUN_14034edd0(lVar1);
        bVar2 = false;
        (**(code **)(**(longlong **)(param_1 + 0x3b0) + 0x10))
                  (*(longlong **)(param_1 + 0x3b0),uVar4,param_3,param_4,uVar5,lVar6,0);
      }
    }
  }
  if (bVar2) {
    FUN_14034edd0(lVar1);
  }
  return;
}



void FUN_1403eae80(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_1403eada0(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_1405d83d0;
      local_c = DAT_1405d83d4;
      cVar1 = FUN_140358730(*(undefined8 *)(param_1 + 0x308),&local_40,10,param_4,uVar4);
      if (cVar1 != '\0') {
        FUN_14034ed40(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_1403eacd0(param_1);
            goto LAB_1403eaf6b;
          }
        }
        else {
LAB_1403eaf6b:
          if (local_30 == 2) {
            if (*(char *)(param_1 + 0x30) == '\0') {
LAB_1403eafca:
              *(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_1403562a0(lVar3,600);
                if (iVar2 != 0) {
                  *(undefined1 *)(param_1 + 0x30) = 0;
                  goto LAB_1403eafca;
                }
              }
            }
          }
        }
        FUN_14034edd0(param_1 + 0x310);
      }
    } while (*(char *)(param_1 + 0x380) != '\0');
  }
  return;
}



void FUN_1403eb010(undefined8 param_1)

{
  DWORD DVar1;
  
  DVar1 = GetCurrentThreadId();
  FUN_140357920(DVar1,"PNSendSpeedMeasurer");
  FUN_1403eae80(param_1);
  return;
}



undefined8 *
FUN_1403eb040(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_1403c0cc0();
  FUN_14034ec60(param_1 + 0x62,uVar4,1,param_4,uVar7);
  param_1[0x69] = 0;
  FUN_14035a1b0(param_1 + 0x71);
  local_res10 = operator_new(0xa8);
  lVar5 = lVar6;
  if (local_res10 != (longlong *)0x0) {
    lVar5 = FUN_1403594e0(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_14034fef0(0x400);
  lVar5 = lVar6;
  if (local_res10 != (longlong *)0x0) {
    lVar5 = FUN_140355800(local_res10,1,param_1);
  }
  if (lVar5 == 0) {
    local_res10 = (longlong *)0x0;
  }
  else {
    local_res10 = (longlong *)FUN_14034fef0(0x10);
    local_res10[1] = 1;
    *local_res10 = lVar5;
  }
  plVar1 = local_res10;
  FUN_140351ba0(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_1403556b0(lVar5);
        FUN_14034ff60(lVar5);
      }
      FUN_14034ff60(plVar3);
    }
  }
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_140357380(lVar5);
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_140356850(lVar5,0);
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_140356b00(lVar5,4);
  local_res18 = (longlong *)FUN_14034fef0(0x400);
  lVar5 = lVar6;
  if (local_res18 != (longlong *)0x0) {
    lVar5 = FUN_140355800(local_res18,2,param_1);
  }
  if (lVar5 == 0) {
    local_res18 = (longlong *)0x0;
  }
  else {
    local_res18 = (longlong *)FUN_14034fef0(0x10);
    local_res18[1] = 1;
    *local_res18 = lVar5;
  }
  plVar1 = local_res18;
  FUN_140351ba0(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_1403556b0(lVar5);
        FUN_14034ff60(lVar5);
      }
      FUN_14034ff60(plVar3);
    }
  }
  lVar5 = lVar6;
  if ((longlong *)param_1[4] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[4];
  }
  FUN_140357380(lVar5);
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_1403549c0(lVar5,param_1 + 2);
  lVar5 = lVar6;
  if ((longlong *)param_1[3] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[3];
  }
  FUN_1403598f0(param_1[0x61],lVar5);
  lVar5 = lVar6;
  if ((longlong *)param_1[4] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[4];
  }
  FUN_1403549c0(lVar5,param_1 + 2);
  lVar5 = lVar6;
  if ((longlong *)param_1[4] != (longlong *)0x0) {
    lVar5 = *(longlong *)param_1[4];
  }
  FUN_1403598f0(param_1[0x61],lVar5);
  param_1[5] = 0;
  *(undefined1 *)(param_1 + 6) = 0;
  param_1[8] = 0;
  FUN_14035a200(param_1 + 0x71);
  local_res20 = operator_new(0x28);
  lVar5 = lVar6;
  if (local_res20 != (longlong *)0x0) {
    lVar5 = FUN_1403573d0(local_res20,FUN_1403eb010,param_1);
  }
  if (lVar5 == 0) {
    local_res20 = (longlong *)0x0;
  }
  else {
    local_res20 = (longlong *)FUN_14034fef0(0x10);
    local_res20[1] = 1;
    *local_res20 = lVar5;
  }
  plVar1 = local_res20;
  FUN_14038a5f0(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_1403574e0(pvVar2);
        operator_delete(pvVar2);
      }
      FUN_14034ff60(plVar3);
    }
  }
  if ((longlong *)param_1[0x69] != (longlong *)0x0) {
    lVar6 = *(longlong *)param_1[0x69];
  }
  FUN_1403575d0(lVar6);
  return param_1;
}



void FUN_1403eb430(longlong param_1)

{
  FUN_1403eb710(param_1 + -8);
  return;
}



void FUN_1403eb440(longlong param_1)

{
  FUN_1403eb710(param_1 + -0x10);
  return;
}



void FUN_1403eb450(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_14034ed40(lVar1);
    if (DAT_1405f0950 != '\0') {
      FUN_14034edd0(lVar1);
      return;
    }
    if ((*(char *)(param_1 + 0x2c0) == '\0') && (*(char *)(param_1 + 0x300) == '\0')) break;
    FUN_14034edd0(lVar4);
    Sleep(10);
  }
  *(undefined1 *)(param_1 + 0x30) = 0;
  uVar2 = 0;
  local_res8 = 0;
  FUN_140351ba0(param_1 + 0x18,&local_res8,param_3,param_4,uVar3,lVar4,1);
  local_res10 = 0;
  FUN_140351ba0(param_1 + 0x20,&local_res10);
  FUN_14034edd0(lVar4);
  *(undefined1 *)(param_1 + 0x380) = 0;
  if (*(undefined8 **)(param_1 + 0x348) != (undefined8 *)0x0) {
    uVar2 = **(undefined8 **)(param_1 + 0x348);
  }
  FUN_140357460(uVar2);
  return;
}



void FUN_1403eb530(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_1403eac60();
  FUN_1403eb450(param_1);
  local_res10 = 0;
  FUN_140351ba0(param_1 + 4,&local_res10,param_3,param_4,uVar5);
  local_res18[0] = 0;
  FUN_140351ba0(param_1 + 3,local_res18);
  pvVar1 = (void *)param_1[0x61];
  if (pvVar1 != (void *)0x0) {
    FUN_1403596c0(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_1403574e0(pvVar1);
      operator_delete(pvVar1);
    }
    FUN_14034ff60(puVar2);
  }
  FUN_14034edf0(param_1 + 0x62);
  pvVar1 = (void *)param_1[0x61];
  if (pvVar1 != (void *)0x0) {
    FUN_1403596c0(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_1403556b0(lVar4);
      FUN_14034ff60(lVar4);
    }
    FUN_14034ff60(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_1403556b0(lVar4);
      FUN_14034ff60(lVar4);
    }
    FUN_14034ff60(plVar3);
  }
  param_1[2] = Proud::ICompletionContext::vftable;
  param_1[1] = Proud::ICompletionPortEventSink::vftable;
  *param_1 = Proud::IFastSocketDelegate::vftable;
  return;
}



void * FUN_1403eb710(void *param_1,uint param_2)

{
  FUN_1403eb530();
  if ((param_2 & 1) != 0) {
    operator_delete(param_1);
  }
  return param_1;
}



void FUN_1403eb740(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_14034f420(local_50,PTR_u_Collection_object_can_use_fast_h_1405d81d0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_50,(ThrowInfo *)&DAT_1405d36c0);
  }
  if (*param_1 == 0) {
    FUN_140352e50(local_68);
    local_5c = 0;
    local_60 = 0;
    lVar1 = FUN_140352dc0(local_68);
    *param_1 = lVar1;
  }
  return;
}



void FUN_1403eb7b0(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_14034f7d0();
  }
  uVar5 = uVar4;
  if (*(ulonglong **)(param_2 + 0x20) != (ulonglong *)0x0) {
    uVar5 = **(ulonglong **)(param_2 + 0x20);
  }
  local_28 = plVar2;
  FUN_1403a7670(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_14034f800();
    }
    *(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_1403e3d50(*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_14034f800();
      }
      FUN_1403e3d10(*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_14034ff60(local_20);
    }
    else {
      (**(code **)(*local_28 + 0x18))();
    }
  }
  return;
}



// WARNING: Removing unreachable block (ram,0x0001403ebf33)
// WARNING: Removing unreachable block (ram,0x0001403ebf3b)
// WARNING: Removing unreachable block (ram,0x0001403ebf3f)
// WARNING: Removing unreachable block (ram,0x0001403ebf49)

void FUN_1403eb950(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_1405d3608);
    }
    *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_140364200(&local_128,local_res10);
    FUN_140364200(&local_128,local_res18);
    lVar10 = local_108;
    while (lVar14 = 0, uVar8 = local_118, lVar10 != 0) {
      uVar5 = FUN_140361340(&local_128,local_70);
      plVar6 = (longlong *)FUN_1403642f0(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_140361340(&local_128,local_58);
      plVar6 = (longlong *)FUN_1403642f0(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_1403ebb17:
          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_1403ebb65;
                  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_1403ebb17;
            }
          } while (iVar12 < iVar9);
        }
LAB_1403ebb65:
        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_140361360(&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_1405d3608);
              }
              *(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_140361360(&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_1405d3608);
              }
              *(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_140361360(&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_1405d3608);
            }
            *(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_140361360(&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_1405d3608);
            }
            *(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_1403ec010(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_14036dde0(&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_14034ff60(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_14034ff60(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_14035faa0(lVar7,iVar11,0);
    }
    else {
      FUN_1403eb950();
    }
    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_14034f800();
        }
        if (local_40 == (longlong *)0x0) {
          lVar7 = 0;
        }
        else {
          lVar7 = *local_40;
        }
        FUN_1403a7520(lVar7,*(undefined4 *)(param_1[5] + lVar10 * 4));
        iVar12 = iVar11 + 1;
        lVar7 = FUN_1403aac10(&local_40);
        if (DAT_1405f6d5c <= *(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_1403e38f0(*param_1 + 8,&local_60);
    *(undefined8 *)(*param_1 + 0x18) = 0;
    if (iVar12 < 0) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    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_14035f6d0(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_14034ff60(puVar3[2]);
          }
          else {
            (**(code **)(*(longlong *)puVar3[1] + 0x18))();
          }
        }
        (**(code **)(*plVar4 + 0x18))(plVar4,puVar3);
        (**(code **)(*local_38 + 0x18))(local_38,plVar2);
      }
    }
    FUN_140399690(&local_58);
    if ((local_50 != 0) && (local_48 < 0)) {
                    // WARNING: Subroutine does not return
      FUN_14034f7d0();
    }
    iVar11 = (int)param_1[6];
  } while( true );
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1403ec340(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_1405da228 < 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_1405da238 * 0.2 < dVar3 - (double)param_1[1]) {
    FUN_1403ec010(param_1);
    param_1[1] = dVar3;
  }
  return;
}



undefined8 *
FUN_1403ec420(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_14034fef0(0x48);
  }
  else {
    puVar2 = (undefined8 *)(**(code **)(*plVar1 + 8))(plVar1,0x48);
  }
  if (puVar2 != (undefined8 *)0x0) {
    FUN_1403e39d0(puVar2 + 2,param_2);
  }
  puVar2[1] = param_3;
  *puVar2 = param_4;
  param_1[3] = param_1[3] + 1;
  return puVar2;
}



void FUN_1403ec4b0(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_14000d450(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_140399790();
      }
      if (*(longlong *)(lVar2 + 0x20) == 0) {
        if (lVar3 == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        lVar6 = 0;
        if (*(int *)(lVar3 + 0x18) != 0) {
          lVar6 = *(longlong *)(lVar3 + 0x10);
        }
      }
      else {
        lVar6 = *(longlong *)(lVar2 + 0x20);
        if (*(longlong *)(lVar2 + 0x20) == 0) {
          FUN_14034f420(local_98,PTR_u_ArrayWithExternalBuffer_is_unini_1405d92f8);
                    // WARNING: Subroutine does not return
          _CxxThrowException(local_98,(ThrowInfo *)&DAT_1405d36c0);
        }
      }
      FUN_1403a9e50(param_1 + 0x60,lVar6);
      if (*(longlong *)(lVar2 + 0x18) == 0) {
        if (*(longlong *)(lVar2 + 0x20) == 0) {
                    // WARNING: Subroutine does not return
          FUN_140399790();
        }
        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_14000d450(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_140363af0(plVar4 + 6,plVar4[6]);
        }
      }
      FUN_140399690(plVar4 + 3);
      if (plVar4[4] != 0) {
        if (*(int *)((longlong)plVar4 + 0x2c) < 0) {
                    // WARNING: Subroutine does not return
          FUN_14034f7d0();
        }
        *(undefined4 *)(plVar4 + 5) = 0;
      }
      plVar1 = *(longlong **)(param_1 + 0x40);
      if (plVar1 == (longlong *)0x0) {
        FUN_14034ff60(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_1403ec660(longlong param_1,longlong param_2,undefined8 param_3)

{
  undefined8 uVar1;
  
  if (param_2 != 0) {
    uVar1 = FUN_1403ec420(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_1403ec420(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_1403ec700(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_1403eb740();
  FUN_1403a9d50(param_1 + 0xc,(longlong)DAT_1405d80ec);
  if (param_4 == 0) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  if (0 < *(int *)((longlong)param_1 + 0x34)) {
    FUN_14034f420(local_60,PTR_u_Collection_object_can_use_fast_h_1405d81d0);
                    // WARNING: Subroutine does not return
    _CxxThrowException(local_60,(ThrowInfo *)&DAT_1405d36c0);
  }
  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_1405da214;
  *(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_1403ec810(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_1403a78f0(param_2,&local_40,uVar4);
      uVar4 = FUN_1403ec420(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_140363af0(&local_20,local_20);
        }
      }
      FUN_140399690(&local_38);
      if ((local_30 != 0) && (local_28 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
LAB_1403ec9a4:
      *(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_1403a78f0(param_2,&local_40,uVar4);
      FUN_1403ec660(param_1 + 8,puVar5,&local_40);
      if (local_20 != 0) {
        plVar1 = (longlong *)(local_20 + 8);
        *plVar1 = *plVar1 + -1;
        if (*plVar1 == 0) {
          FUN_140363af0(&local_20,local_20);
        }
      }
      FUN_140399690(&local_38);
      if ((local_30 != 0) && (local_28 < 0)) {
                    // WARNING: Subroutine does not return
        FUN_14034f7d0();
      }
      goto LAB_1403ec9a4;
    }
    puVar5 = (undefined8 *)*puVar5;
  } while( true );
}



void FUN_1403ec9c0(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_140360040(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_1403ec810(param_1,param_2);
    FUN_1403ec4b0(param_1);
  }
  return;
}



void FUN_1403eca50(undefined8 param_1,int *param_2)

{
  if (*param_2 == 1) {
    FUN_1403ec9c0();
  }
  else if (*param_2 == 2) {
    FUN_1403eb7b0();
    return;
  }
  return;
}



undefined8 FUN_1403eca80(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_1403ecb20(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_1403ecb60(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_1403e4bc0(param_1,param_3), (int)uVar1 == 0)) &&
      ((param_2 / 0x1c + 1 + *param_3 <= param_3[1] ||
       (uVar1 = FUN_1403eca80(param_3), (int)uVar1 == 0)))) &&
     ((param_2 < 0x1c || (uVar1 = FUN_1403eec10(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_1403ecb20(param_3);
    uVar1 = 0;
  }
  return uVar1;
}



void FUN_1403ecc60(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_1403ecc90(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_1403eccf0(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_1403ecd40(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_1403e4bc0(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_1403ecef0(param_1,iVar3,param_3,0);
          return uVar2;
        }
        iVar3 = iVar3 + 1;
      } while (iVar3 < 0x1c);
    }
    if (param_2 == 3) {
      uVar2 = FUN_1403f2910(param_1,param_3,param_4);
      return uVar2;
    }
    uVar2 = FUN_1403eeca0(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_1403ecb20(local_28);
      FUN_1403eeb60(local_28,param_3);
    }
    FUN_1403e4b20(local_28);
  }
  return 0;
}



void FUN_1403ecec0(undefined8 param_1,undefined8 param_2)

{
  int iVar1;
  
  iVar1 = FUN_1403e4ac0();
  if (iVar1 == 0) {
    FUN_1403e4bc0(param_2,param_1);
  }
  return;
}



ulonglong FUN_1403ecef0(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_1403e4bc0(param_1,param_3);
    uVar3 = (ulonglong)uVar2;
    if (param_4 != 0) {
      FUN_1403ecc60(param_4);
    }
  }
  else {
    uVar3 = FUN_1403e4ac0(local_28);
    if ((int)uVar3 == 0) {
      if (param_4 != 0) {
        uVar2 = FUN_1403f2a00(param_1,param_2,local_28);
        if (uVar2 != 0) {
          FUN_1403e4b20(local_28);
          return (ulonglong)uVar2;
        }
      }
      uVar2 = FUN_1403e4bc0(param_1,param_3);
      uVar3 = (ulonglong)uVar2;
      if (uVar2 == 0) {
        if (0x1b < param_2) {
          FUN_1403eeb90(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_1403ecb20(param_3);
        if (param_4 != 0) {
          FUN_1403eeb60(local_28,param_4);
        }
        FUN_1403e4b20(local_28);
        uVar3 = 0;
      }
      else {
        FUN_1403e4b20(local_28);
      }
    }
  }
  return uVar3;
}



undefined8 FUN_1403ed070(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_1403eca80(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_1403ecb20(param_3);
    uVar6 = 0;
  }
  return uVar6;
}



undefined8 FUN_1403ed170(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_1403eca80(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_1403ecb20(param_3);
    uVar5 = 0;
  }
  return uVar5;
}



undefined8 FUN_1403ed2a0(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_1403ed400();
      return uVar4;
    }
  }
  uVar4 = FUN_1403eeca0(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_1403ecb20(local_48);
    FUN_1403eeb60(local_48,param_3);
    FUN_1403e4b20(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_1403ed400(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_1405d84f0 ^ (ulonglong)auStack_878;
  local_858 = param_3;
  if ((param_4 <= param_3[1]) || (uVar7 = FUN_1403eca80(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_1403ecb20(param_3);
    uVar7 = 0;
  }
  return uVar7;
}



undefined4 FUN_1403ed5a0(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_1403eeca0(local_c8,uVar5);
  if (iVar1 == 0) {
    iVar1 = FUN_1403eeca0(local_68,*param_1 - uVar5);
    if (iVar1 == 0) {
      iVar1 = FUN_1403eeca0(local_98,uVar5);
      if (iVar1 == 0) {
        iVar1 = FUN_1403eeca0(local_50,*param_2 - uVar5);
        if (iVar1 == 0) {
          iVar1 = uVar5 * 2;
          iVar2 = FUN_1403eeca0(local_b0,iVar1);
          if (iVar2 == 0) {
            iVar2 = FUN_1403eeca0(local_38,iVar1);
            if (iVar2 == 0) {
              iVar2 = FUN_1403eeca0(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_1403ecb20(local_c8);
                FUN_1403ecb20(local_98);
                iVar2 = FUN_1403e5580(local_c8,local_98,local_38);
                if ((((((iVar2 == 0) &&
                       (iVar2 = FUN_1403e5580(local_68,local_50,local_80), iVar2 == 0)) &&
                      (iVar2 = FUN_1403ed170(local_68,local_c8,local_b0), iVar2 == 0)) &&
                     ((iVar2 = FUN_1403ed170(local_50,local_98,local_c8), iVar2 == 0 &&
                      (iVar2 = FUN_1403e5580(local_b0,local_c8,local_b0), iVar2 == 0)))) &&
                    ((iVar2 = FUN_1403e5200(local_38,local_80,local_c8), iVar2 == 0 &&
                     ((iVar2 = FUN_1403ed070(local_b0,local_c8,local_b0), iVar2 == 0 &&
                      (iVar2 = FUN_1403eec10(local_b0,uVar5), iVar2 == 0)))))) &&
                   ((iVar1 = FUN_1403eec10(local_80,iVar1), iVar1 == 0 &&
                    (iVar1 = FUN_1403e5200(local_38,local_b0,local_b0), iVar1 == 0)))) {
                  iVar1 = FUN_1403e5200(local_b0,local_80,param_3);
                  uVar8 = 0xfffffffe;
                  if (iVar1 == 0) {
                    uVar8 = 0;
                  }
                }
                FUN_1403e4b20(local_80);
              }
              FUN_1403e4b20(local_38);
            }
            FUN_1403e4b20(local_b0);
          }
          FUN_1403e4b20(local_50);
        }
        FUN_1403e4b20(local_98);
      }
      FUN_1403e4b20(local_68);
    }
    FUN_1403e4b20(local_c8);
  }
  return uVar8;
}



ulonglong FUN_1403ed880(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_1403eedc0(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_1403f2a00(param_1,iVar5,local_50);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 == 0) {
      uVar3 = FUN_1403e4bc0(param_1,local_e0);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 == 0) {
        FUN_1403eeb90(local_e0,iVar1);
        FUN_1403f2a00(local_e0,iVar5,local_e0);
        uVar3 = FUN_1403e4bc0(param_1,local_98);
        uVar4 = (ulonglong)uVar3;
        if (uVar3 == 0) {
          iVar2 = iVar1 * 2;
          FUN_1403eeb90(local_98,iVar2);
          uVar3 = FUN_1403f2a00(param_2,iVar5,local_68);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 == 0) {
            uVar3 = FUN_1403e4bc0(param_2,local_c8);
            uVar4 = (ulonglong)uVar3;
            if (uVar3 == 0) {
              FUN_1403eeb90(local_c8,iVar1);
              FUN_1403f2a00(local_c8,iVar5,local_c8);
              uVar3 = FUN_1403e4bc0(param_2,local_80);
              uVar4 = (ulonglong)uVar3;
              if (uVar3 == 0) {
                FUN_1403eeb90(local_80,iVar2);
                uVar3 = FUN_1403e5580(local_50,local_68,local_38);
                uVar4 = (ulonglong)uVar3;
                if (uVar3 == 0) {
                  uVar3 = FUN_1403e5580(local_98,local_80,local_b0);
                  uVar4 = (ulonglong)uVar3;
                  if (uVar3 == 0) {
                    uVar3 = FUN_1403ef610(local_50,local_158);
                    uVar4 = (ulonglong)uVar3;
                    if (uVar3 == 0) {
                      uVar3 = FUN_1403e5200(local_158,local_e0,local_158);
                      uVar4 = (ulonglong)uVar3;
                      if (uVar3 == 0) {
                        uVar3 = FUN_1403ef610(local_158,local_158);
                        uVar4 = (ulonglong)uVar3;
                        if (uVar3 == 0) {
                          uVar3 = FUN_1403e5200(local_158,local_98,local_158);
                          uVar4 = (ulonglong)uVar3;
                          if (uVar3 == 0) {
                            uVar3 = FUN_1403ef610(local_68,local_140);
                            uVar4 = (ulonglong)uVar3;
                            if (uVar3 == 0) {
                              uVar3 = FUN_1403e5200(local_140,local_c8,local_140);
                              uVar4 = (ulonglong)uVar3;
                              if (uVar3 == 0) {
                                uVar3 = FUN_1403ef610(local_140,local_140);
                                uVar4 = (ulonglong)uVar3;
                                if (uVar3 == 0) {
                                  uVar3 = FUN_1403e5200(local_140,local_80,local_140);
                                  uVar4 = (ulonglong)uVar3;
                                  if (uVar3 == 0) {
                                    uVar3 = FUN_1403e5580(local_158,local_140,local_f8);
                                    uVar4 = (ulonglong)uVar3;
                                    if (uVar3 == 0) {
                                      uVar3 = FUN_1403ef610(local_98,local_158);
                                      uVar4 = (ulonglong)uVar3;
                                      if (uVar3 == 0) {
                                        uVar3 = FUN_1403e5200(local_158,local_e0,local_158);
                                        uVar4 = (ulonglong)uVar3;
                                        if (uVar3 == 0) {
                                          uVar3 = FUN_1403ef610(local_158,local_158);
                                          uVar4 = (ulonglong)uVar3;
                                          if (uVar3 == 0) {
                                            uVar3 = FUN_1403e5200(local_158,local_50,local_158);
                                            uVar4 = (ulonglong)uVar3;
                                            if (uVar3 == 0) {
                                              uVar3 = FUN_1403ef610(local_80,local_140);
                                              uVar4 = (ulonglong)uVar3;
                                              if (uVar3 == 0) {
                                                uVar3 = FUN_1403e5200(local_140,local_c8,local_140);
                                                uVar4 = (ulonglong)uVar3;
                                                if (uVar3 == 0) {
                                                  uVar3 = FUN_1403ef610(local_140,local_140);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1403e5200(local_140,local_68,
                                                                          local_140);
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1403e5580(local_158,local_140,
                                                                            local_110);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1403e5200(local_98,local_e0,
                                                                              local_158);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1403e5200(local_158,local_50,
                                                                                local_158);
                                                          uVar4 = (ulonglong)uVar3;
                                                          if (uVar3 == 0) {
                                                            uVar3 = FUN_1403e5200(local_80,local_c8,
                                                                                  local_140);
                                                            uVar4 = (ulonglong)uVar3;
                                                            if (uVar3 == 0) {
                                                              uVar3 = FUN_1403e5200(local_140,
                                                                                    local_68,
                                                  local_140);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1403e5580(local_158,local_140,
                                                                          local_128);
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1403e53c0(local_f8,local_b0,
                                                                            local_f8);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1403e53c0(local_110,local_38,
                                                                              local_110);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1403e5ca0(local_f8,local_f8);
                                                          uVar4 = (ulonglong)uVar3;
                                                          if (uVar3 == 0) {
                                                            uVar3 = FUN_1403e5ca0(local_110,
                                                                                  local_110);
                                                            uVar4 = (ulonglong)uVar3;
                                                            if (uVar3 == 0) {
                                                              uVar3 = FUN_1403e53c0(local_128,
                                                                                    local_38,
                                                  local_128);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1403e53c0(local_128,local_b0,
                                                                          local_128);
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1403e53c0(local_f8,local_128,
                                                                            local_f8);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1403e53c0(local_110,local_128,
                                                                              local_110);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1403ecb60(local_38,3,local_158
                                                                               );
                                                          uVar4 = (ulonglong)uVar3;
                                                          if (uVar3 == 0) {
                                                            uVar3 = FUN_1403e53c0(local_f8,local_158
                                                                                  ,local_f8);
                                                            uVar4 = (ulonglong)uVar3;
                                                            if (uVar3 == 0) {
                                                              uVar3 = FUN_1403ecb60(local_b0,3,
                                                                                    local_158);
                                                              uVar4 = (ulonglong)uVar3;
                                                              if (uVar3 == 0) {
                                                                uVar3 = FUN_1403e53c0(local_110,
                                                                                      local_158,
                                                                                      local_110);
                                                                uVar4 = (ulonglong)uVar3;
                                                                if (uVar3 == 0) {
                                                                  uVar3 = FUN_1403e5630(local_128,3,
                                                                                        local_128);
                                                                  uVar4 = (ulonglong)uVar3;
                                                                  if (uVar3 == 0) {
                                                                    uVar3 = FUN_1403e53c0(local_128,
                                                                                          local_f8,
                                                  local_128);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1403e53c0(local_128,local_110,
                                                                          local_128);
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1403e53c0(local_f8,local_128,
                                                                            local_f8);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1403e53c0(local_110,local_128,
                                                                              local_110);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1403f2910(local_f8,local_f8,0)
                                                          ;
                                                          uVar4 = (ulonglong)uVar3;
                                                          if (uVar3 == 0) {
                                                            uVar3 = FUN_1403f2910(local_110,
                                                                                  local_110,0);
                                                            uVar4 = (ulonglong)uVar3;
                                                            if (uVar3 == 0) {
                                                              uVar3 = FUN_1403eec10(local_f8,iVar1);
                                                              uVar4 = (ulonglong)uVar3;
                                                              if (uVar3 == 0) {
                                                                uVar3 = FUN_1403eec10(local_128,
                                                                                      iVar2);
                                                                uVar4 = (ulonglong)uVar3;
                                                                if (uVar3 == 0) {
                                                                  uVar3 = FUN_1403eec10(local_110,
                                                                                        iVar1 * 3);
                                                                  uVar4 = (ulonglong)uVar3;
                                                                  if (uVar3 == 0) {
                                                                    uVar3 = FUN_1403eec10(local_b0,
                                                  iVar1 * 4);
                                                  uVar4 = (ulonglong)uVar3;
                                                  if (uVar3 == 0) {
                                                    uVar3 = FUN_1403e5200(local_38,local_f8,param_3)
                                                    ;
                                                    uVar4 = (ulonglong)uVar3;
                                                    if (uVar3 == 0) {
                                                      uVar3 = FUN_1403e5200(local_128,local_110,
                                                                            local_158);
                                                      uVar4 = (ulonglong)uVar3;
                                                      if (uVar3 == 0) {
                                                        uVar3 = FUN_1403e5200(local_b0,local_158,
                                                                              local_158);
                                                        uVar4 = (ulonglong)uVar3;
                                                        if (uVar3 == 0) {
                                                          uVar3 = FUN_1403e5200(local_158,param_3,
                                                                                param_3);
                                                          uVar4 = (ulonglong)uVar3;
                                                        }
                                                      }
                                                    }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    FUN_1403eed80(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_1403ee020(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_1403eeca0(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_1403ecb20(local_48);
    FUN_1403eeb60(local_48,param_2);
    FUN_1403e4b20(local_48);
    uVar3 = 0;
  }
  return uVar3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403ee190(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_1405d84f0 ^ (ulonglong)auStack_878;
  iVar3 = *param_1 * 2;
  local_858 = param_2;
  if ((iVar3 <= param_2[1]) || (uVar5 = FUN_1403eca80(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_1403ecb20(param_2);
    uVar5 = 0;
  }
  return uVar5;
}



undefined4 FUN_1403ee360(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_1403eeca0(local_90,uVar5);
  if (iVar2 == 0) {
    iVar2 = FUN_1403eeca0(local_60,*param_1 - uVar5);
    if (iVar2 == 0) {
      iVar2 = FUN_1403eeca0(local_a8,*param_1 * 2);
      if (iVar2 == 0) {
        iVar2 = FUN_1403eeca0(local_30,*param_1 * 2);
        if (iVar2 == 0) {
          iVar2 = FUN_1403eeca0(local_48,uVar5 * 2);
          if (iVar2 == 0) {
            iVar2 = FUN_1403eeca0(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_1403ecb20(local_90);
              iVar2 = FUN_1403e56f0(local_90,local_48);
              if (iVar2 == 0) {
                iVar2 = FUN_1403e56f0(local_60,local_78);
                if (iVar2 == 0) {
                  iVar2 = FUN_1403ed170(local_60,local_90,local_a8);
                  if (iVar2 == 0) {
                    iVar2 = FUN_1403e56f0(local_a8,local_a8);
                    if (iVar2 == 0) {
                      iVar2 = FUN_1403ed170(local_48,local_78,local_30);
                      if (iVar2 == 0) {
                        iVar2 = FUN_1403ed070(local_a8,local_30,local_a8);
                        if (iVar2 == 0) {
                          iVar2 = FUN_1403eec10(local_a8,uVar5);
                          if (iVar2 == 0) {
                            iVar2 = FUN_1403eec10(local_78,uVar5 * 2);
                            if (iVar2 == 0) {
                              iVar2 = FUN_1403e5200(local_48,local_a8,local_a8);
                              if (iVar2 == 0) {
                                iVar2 = FUN_1403e5200(local_a8,local_78,param_2);
                                uVar4 = 0xfffffffe;
                                if (iVar2 == 0) {
                                  uVar4 = 0;
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
              FUN_1403e4b20(local_78);
            }
            FUN_1403e4b20(local_48);
          }
          FUN_1403e4b20(local_30);
        }
        FUN_1403e4b20(local_a8);
      }
      FUN_1403e4b20(local_60);
    }
    FUN_1403e4b20(local_90);
  }
  return uVar4;
}



ulonglong FUN_1403ee5a0(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_1403eedc0(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_1403f2a00(param_1,iVar1 * 0x1c,local_50);
    uVar3 = (ulonglong)uVar2;
    if (uVar2 == 0) {
      uVar2 = FUN_1403e4bc0(param_1,local_98);
      uVar3 = (ulonglong)uVar2;
      if (uVar2 == 0) {
        FUN_1403eeb90(local_98,iVar1);
        FUN_1403f2a00(local_98,iVar1 * 0x1c,local_98);
        uVar2 = FUN_1403e4bc0(param_1,local_68);
        uVar3 = (ulonglong)uVar2;
        if (uVar2 == 0) {
          FUN_1403eeb90(local_68,iVar1 * 2);
          uVar2 = FUN_1403e56f0(local_50,local_38);
          uVar3 = (ulonglong)uVar2;
          if (uVar2 == 0) {
            uVar2 = FUN_1403e56f0(local_68,local_80);
            uVar3 = (ulonglong)uVar2;
            if (uVar2 == 0) {
              uVar2 = FUN_1403ef610(local_50,local_f8);
              uVar3 = (ulonglong)uVar2;
              if (uVar2 == 0) {
                uVar2 = FUN_1403e5200(local_f8,local_98,local_f8);
                uVar3 = (ulonglong)uVar2;
                if (uVar2 == 0) {
                  uVar2 = FUN_1403ef610(local_f8,local_f8);
                  uVar3 = (ulonglong)uVar2;
                  if (uVar2 == 0) {
                    uVar2 = FUN_1403e5200(local_f8,local_68,local_f8);
                    uVar3 = (ulonglong)uVar2;
                    if (uVar2 == 0) {
                      uVar2 = FUN_1403e56f0(local_f8,local_b0);
                      uVar3 = (ulonglong)uVar2;
                      if (uVar2 == 0) {
                        uVar2 = FUN_1403ef610(local_68,local_f8);
                        uVar3 = (ulonglong)uVar2;
                        if (uVar2 == 0) {
                          uVar2 = FUN_1403e5200(local_f8,local_98,local_f8);
                          uVar3 = (ulonglong)uVar2;
                          if (uVar2 == 0) {
                            uVar2 = FUN_1403ef610(local_f8,local_f8);
                            uVar3 = (ulonglong)uVar2;
                            if (uVar2 == 0) {
                              uVar2 = FUN_1403e5200(local_f8,local_50,local_f8);
                              uVar3 = (ulonglong)uVar2;
                              if (uVar2 == 0) {
                                uVar2 = FUN_1403e56f0(local_f8,local_c8);
                                uVar3 = (ulonglong)uVar2;
                                if (uVar2 == 0) {
                                  uVar2 = FUN_1403e5200(local_68,local_98,local_f8);
                                  uVar3 = (ulonglong)uVar2;
                                  if (uVar2 == 0) {
                                    uVar2 = FUN_1403e5200(local_f8,local_50,local_f8);
                                    uVar3 = (ulonglong)uVar2;
                                    if (uVar2 == 0) {
                                      uVar2 = FUN_1403e56f0(local_f8,local_e0);
                                      uVar3 = (ulonglong)uVar2;
                                      if (uVar2 == 0) {
                                        uVar2 = FUN_1403e53c0(local_b0,local_80,local_b0);
                                        uVar3 = (ulonglong)uVar2;
                                        if (uVar2 == 0) {
                                          uVar2 = FUN_1403e53c0(local_c8,local_38,local_c8);
                                          uVar3 = (ulonglong)uVar2;
                                          if (uVar2 == 0) {
                                            uVar2 = FUN_1403e5ca0(local_b0,local_b0);
                                            uVar3 = (ulonglong)uVar2;
                                            if (uVar2 == 0) {
                                              uVar2 = FUN_1403e5ca0(local_c8,local_c8);
                                              uVar3 = (ulonglong)uVar2;
                                              if (uVar2 == 0) {
                                                uVar2 = FUN_1403e53c0(local_e0,local_38,local_e0);
                                                uVar3 = (ulonglong)uVar2;
                                                if (uVar2 == 0) {
                                                  uVar2 = FUN_1403e53c0(local_e0,local_80,local_e0);
                                                  uVar3 = (ulonglong)uVar2;
                                                  if (uVar2 == 0) {
                                                    uVar2 = FUN_1403e53c0(local_b0,local_e0,local_b0
                                                                         );
                                                    uVar3 = (ulonglong)uVar2;
                                                    if (uVar2 == 0) {
                                                      uVar2 = FUN_1403e53c0(local_c8,local_e0,
                                                                            local_c8);
                                                      uVar3 = (ulonglong)uVar2;
                                                      if (uVar2 == 0) {
                                                        uVar2 = FUN_1403ecb60(local_38,3,local_f8);
                                                        uVar3 = (ulonglong)uVar2;
                                                        if (uVar2 == 0) {
                                                          uVar2 = FUN_1403e53c0(local_b0,local_f8,
                                                                                local_b0);
                                                          uVar3 = (ulonglong)uVar2;
                                                          if (uVar2 == 0) {
                                                            uVar2 = FUN_1403ecb60(local_80,3,
                                                                                  local_f8);
                                                            uVar3 = (ulonglong)uVar2;
                                                            if (uVar2 == 0) {
                                                              uVar2 = FUN_1403e53c0(local_c8,
                                                  local_f8,local_c8);
                                                  uVar3 = (ulonglong)uVar2;
                                                  if (uVar2 == 0) {
                                                    uVar2 = FUN_1403e5630(local_e0,3,local_e0);
                                                    uVar3 = (ulonglong)uVar2;
                                                    if (uVar2 == 0) {
                                                      uVar2 = FUN_1403e53c0(local_e0,local_b0,
                                                                            local_e0);
                                                      uVar3 = (ulonglong)uVar2;
                                                      if (uVar2 == 0) {
                                                        uVar2 = FUN_1403e53c0(local_e0,local_c8,
                                                                              local_e0);
                                                        uVar3 = (ulonglong)uVar2;
                                                        if (uVar2 == 0) {
                                                          uVar2 = FUN_1403e53c0(local_b0,local_e0,
                                                                                local_b0);
                                                          uVar3 = (ulonglong)uVar2;
                                                          if (uVar2 == 0) {
                                                            uVar2 = FUN_1403e53c0(local_c8,local_e0,
                                                                                  local_c8);
                                                            uVar3 = (ulonglong)uVar2;
                                                            if (uVar2 == 0) {
                                                              uVar2 = FUN_1403f2910(local_b0,
                                                  local_b0,0);
                                                  uVar3 = (ulonglong)uVar2;
                                                  if (uVar2 == 0) {
                                                    uVar2 = FUN_1403f2910(local_c8,local_c8,0);
                                                    uVar3 = (ulonglong)uVar2;
                                                    if (uVar2 == 0) {
                                                      uVar2 = FUN_1403eec10(local_b0,iVar1);
                                                      uVar3 = (ulonglong)uVar2;
                                                      if (uVar2 == 0) {
                                                        uVar2 = FUN_1403eec10(local_e0,iVar1 * 2);
                                                        uVar3 = (ulonglong)uVar2;
                                                        if (uVar2 == 0) {
                                                          uVar2 = FUN_1403eec10(local_c8,iVar1 * 3);
                                                          uVar3 = (ulonglong)uVar2;
                                                          if (uVar2 == 0) {
                                                            uVar2 = FUN_1403eec10(local_80,iVar1 * 4
                                                                                 );
                                                            uVar3 = (ulonglong)uVar2;
                                                            if (uVar2 == 0) {
                                                              uVar2 = FUN_1403e5200(local_38,
                                                  local_b0,param_2);
                                                  uVar3 = (ulonglong)uVar2;
                                                  if (uVar2 == 0) {
                                                    uVar2 = FUN_1403e5200(local_e0,local_c8,local_f8
                                                                         );
                                                    uVar3 = (ulonglong)uVar2;
                                                    if (uVar2 == 0) {
                                                      uVar2 = FUN_1403e5200(local_80,local_f8,
                                                                            local_f8);
                                                      uVar3 = (ulonglong)uVar2;
                                                      if (uVar2 == 0) {
                                                        uVar2 = FUN_1403e5200(local_f8,param_2,
                                                                              param_2);
                                                        uVar3 = (ulonglong)uVar2;
                                                      }
                                                    }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    FUN_1403eed80(local_38,local_b0,local_e0,local_c8,local_80,local_50,local_98,local_68,local_f8,0
                 );
  }
  return uVar3;
}



void FUN_1403eeb60(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_1403eeb90(int *param_1,int param_2)

{
  int iVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  if (0 < param_2) {
    if (*param_1 <= param_2) {
      FUN_1403ecc60();
      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_1403eec10(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_1403eca80(), (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_1403eeca0(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_1403eed50(longlong param_1,longlong param_2)

{
  undefined8 uVar1;
  
  if ((param_1 != param_2) && (uVar1 = FUN_1403e4bc0(), (int)uVar1 != 0)) {
    return uVar1;
  }
  *(undefined4 *)(param_2 + 8) = 0;
  return 0;
}



void FUN_1403eed80(longlong param_1)

{
  undefined1 *puVar1;
  longlong local_res10 [3];
  
  puVar1 = (undefined1 *)register0x00000020;
  while (param_1 != 0) {
    FUN_1403e4b20();
    param_1 = *(longlong *)(puVar1 + 0x10);
    puVar1 = puVar1 + 8;
  }
  return;
}



undefined8 FUN_1403eedc0(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_1403e4ac0();
    if (iVar3 != 0) break;
    lVar1 = *(longlong *)(puVar2 + 0x10);
    iVar4 = iVar4 + 1;
    puVar2 = puVar2 + 8;
  }
  for (; iVar4 != 0; iVar4 = iVar4 + -1) {
    FUN_1403e4b20(param_1);
    param_1 = *(longlong *)((longlong)register0x00000020 + 0x10);
    register0x00000020 = (BADSPACEBASE *)((longlong)register0x00000020 + 8);
  }
  return 0xfffffffe;
}



ulonglong FUN_1403eee40(undefined8 param_1,longlong param_2,undefined8 param_3)

{
  uint uVar1;
  ulonglong uVar2;
  undefined1 local_28 [8];
  int local_20;
  
  uVar2 = FUN_1403e4ac0(local_28);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1403e5770(param_1,param_2,0,local_28);
    if (uVar1 != 0) {
      FUN_1403e4b20(local_28);
      return (ulonglong)uVar1;
    }
    if (local_20 == *(int *)(param_2 + 8)) {
      uVar2 = 0;
      FUN_1403eeb60(local_28,param_3);
    }
    else {
      uVar1 = FUN_1403e5200(param_2,local_28,param_3);
      uVar2 = (ulonglong)uVar1;
    }
    FUN_1403e4b20(local_28);
  }
  return uVar2;
}



ulonglong FUN_1403eeef0(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_1403eedc0(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_1403eee40(param_1,param_2,local_20);
  uVar3 = (ulonglong)uVar1;
  if (uVar1 == 0) {
    uVar1 = FUN_1403e4bc0(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_1403e4bc0(local_20,local_98);
        uVar3 = (ulonglong)uVar1;
        if (uVar1 == 0) {
          uVar1 = FUN_1403e4bc0(local_38,local_b0);
          uVar3 = (ulonglong)uVar1;
          if (uVar1 == 0) {
            FUN_1403ef6c0(local_68,1);
            FUN_1403ef6c0(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_1403e5ca0(local_b0,local_b0);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1403ef2d9;
                  if (((0 < local_c8[0]) && ((*local_b8 & 1) != 0)) ||
                     ((0 < local_80[0] && ((*local_70 & 1) != 0)))) {
                    uVar1 = FUN_1403e5200(local_c8,local_38,local_c8);
                    uVar3 = (ulonglong)uVar1;
                    if (uVar1 != 0) goto LAB_1403ef2d9;
                    uVar1 = FUN_1403e53c0(local_80,local_20,local_80);
                    uVar3 = (ulonglong)uVar1;
                    if (uVar1 != 0) goto LAB_1403ef2d9;
                  }
                  uVar1 = FUN_1403e5ca0(local_c8,local_c8);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1403ef2d9;
                  uVar1 = FUN_1403e5ca0(local_80,local_80);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1403ef2d9;
                }
                iVar2 = FUN_1403e4d10(local_98,local_b0);
                if (iVar2 == -1) {
                  uVar1 = FUN_1403e53c0(local_b0,local_98,local_b0);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1403ef2d9;
                  uVar1 = FUN_1403e53c0(local_c8,local_68,local_c8);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1403ef2d9;
                  piVar6 = local_80;
                  piVar5 = local_50;
                  piVar4 = local_80;
                }
                else {
                  uVar1 = FUN_1403e53c0(local_98,local_b0,local_98);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1403ef2d9;
                  uVar1 = FUN_1403e53c0(local_68,local_c8,local_68);
                  uVar3 = (ulonglong)uVar1;
                  if (uVar1 != 0) goto LAB_1403ef2d9;
                  piVar6 = local_50;
                  piVar5 = local_80;
                  piVar4 = local_50;
                }
                uVar1 = FUN_1403e53c0(piVar4,piVar5,piVar6);
                uVar3 = (ulonglong)uVar1;
                if (uVar1 != 0) goto LAB_1403ef2d9;
                bVar7 = false;
                if (local_98[0] == 0) {
                  iVar2 = FUN_1403e4d40(local_b0,1);
                  if (iVar2 != 0) goto LAB_1403eefbf;
                  iVar2 = FUN_1403e4d40(local_c8,0);
                  goto joined_r0x0001403ef260;
                }
              }
              uVar1 = FUN_1403e5ca0(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_1403e5200(local_68,local_38,local_68);
                uVar3 = (ulonglong)uVar1;
                if (uVar1 != 0) break;
                uVar1 = FUN_1403e53c0(local_50,local_20,local_50);
                uVar3 = (ulonglong)uVar1;
                if (uVar1 != 0) break;
              }
              uVar1 = FUN_1403e5ca0(local_68,local_68);
              uVar3 = (ulonglong)uVar1;
              if (uVar1 != 0) break;
              uVar1 = FUN_1403e5ca0(local_50,local_50);
              uVar3 = (ulonglong)uVar1;
            } while (uVar1 == 0);
          }
        }
      }
      else {
LAB_1403eefbf:
        uVar3 = 0xfffffffd;
      }
    }
  }
  goto LAB_1403ef2d9;
joined_r0x0001403ef260:
  if (iVar2 != -1) goto LAB_1403ef28b;
  uVar1 = FUN_1403e5200(local_c8,param_2,local_c8);
  uVar3 = (ulonglong)uVar1;
  if (uVar1 != 0) goto LAB_1403ef2d9;
  iVar2 = FUN_1403e4d40(local_c8,0);
  goto joined_r0x0001403ef260;
LAB_1403ef28b:
  iVar2 = FUN_1403ecc90(local_c8,param_2);
  while (iVar2 != -1) {
    uVar1 = FUN_1403e53c0(local_c8,param_2,local_c8);
    uVar3 = (ulonglong)uVar1;
    if (uVar1 != 0) goto LAB_1403ef2d9;
    iVar2 = FUN_1403ecc90(local_c8,param_2);
  }
  FUN_1403eeb60(local_c8,param_3);
  uVar3 = 0;
LAB_1403ef2d9:
  FUN_1403eed80(local_20,local_38,local_98,local_b0,local_68,local_50,local_c8,local_80,0);
  return uVar3;
}



ulonglong FUN_1403ef340(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_1403eedc0(local_38,local_20,local_80,local_68,local_50,local_98,0);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  uVar2 = FUN_1403e4bc0(param_2,local_38);
  uVar4 = (ulonglong)uVar2;
  if (uVar2 == 0) {
    uVar2 = FUN_1403eee40(param_1,param_2,local_20);
    uVar4 = (ulonglong)uVar2;
    if (uVar2 == 0) {
      uVar2 = FUN_1403e4bc0(local_38,local_80);
      uVar4 = (ulonglong)uVar2;
      if (uVar2 == 0) {
        uVar2 = FUN_1403e4bc0(local_20,local_68);
        uVar4 = (ulonglong)uVar2;
        if (uVar2 == 0) {
          FUN_1403ef6c0(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_1403e5ca0(local_68,local_68);
                uVar4 = (ulonglong)uVar2;
                if (uVar2 != 0) goto LAB_1403ef5bf;
                if ((0 < local_98[0]) && ((*local_88 & 1) != 0)) {
                  uVar2 = FUN_1403e53c0(local_98,local_38,local_98);
                  uVar4 = (ulonglong)uVar2;
                  if (uVar2 != 0) goto LAB_1403ef5bf;
                }
                uVar2 = FUN_1403e5ca0(local_98,local_98);
                uVar4 = (ulonglong)uVar2;
                if (uVar2 != 0) goto LAB_1403ef5bf;
              }
              iVar3 = FUN_1403e4d10(local_80,local_68);
              if (iVar3 == -1) {
                uVar2 = FUN_1403e53c0(local_68,local_80,local_68);
                uVar4 = (ulonglong)uVar2;
                if (uVar2 != 0) goto LAB_1403ef5bf;
                piVar7 = local_98;
                piVar6 = local_50;
                piVar5 = local_98;
              }
              else {
                uVar2 = FUN_1403e53c0(local_80,local_68,local_80);
                uVar4 = (ulonglong)uVar2;
                if (uVar2 != 0) goto LAB_1403ef5bf;
                piVar7 = local_50;
                piVar6 = local_98;
                piVar5 = local_50;
              }
              uVar2 = FUN_1403e53c0(piVar5,piVar6,piVar7);
              uVar4 = (ulonglong)uVar2;
              if (uVar2 != 0) goto LAB_1403ef5bf;
              bVar8 = false;
              if (local_80[0] == 0) {
                iVar3 = FUN_1403e4d40(local_68,1);
                if (iVar3 == 0) {
                  uVar1 = *(undefined4 *)(param_1 + 8);
                  goto joined_r0x0001403ef58a;
                }
                uVar4 = 0xfffffffd;
                goto LAB_1403ef5bf;
              }
            }
            uVar2 = FUN_1403e5ca0(local_80,local_80);
            uVar4 = (ulonglong)uVar2;
            if (uVar2 != 0) break;
            if ((0 < local_50[0]) && ((*local_40 & 1) != 0)) {
              uVar2 = FUN_1403e53c0(local_50,local_38,local_50);
              uVar4 = (ulonglong)uVar2;
              if (uVar2 != 0) break;
            }
            uVar2 = FUN_1403e5ca0(local_50,local_50);
            uVar4 = (ulonglong)uVar2;
          } while (uVar2 == 0);
        }
      }
    }
  }
  goto LAB_1403ef5bf;
  while( true ) {
    uVar2 = FUN_1403e5200(local_98,param_2,local_98);
    uVar4 = (ulonglong)uVar2;
    if (uVar2 != 0) break;
joined_r0x0001403ef58a:
    if (local_90 != 1) {
      FUN_1403eeb60(local_98,param_3);
      *(undefined4 *)(param_3 + 8) = uVar1;
      uVar4 = 0;
      break;
    }
  }
LAB_1403ef5bf:
  FUN_1403eed80(local_38,local_20,local_80,local_68,local_50,local_98,0);
  return uVar4;
}



undefined8 FUN_1403ef610(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_1403eca80(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_1403ef6c0(uint *param_1,uint param_2)

{
  FUN_1403ecc60();
  **(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_1403ef700(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_1405d84f0 ^ (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_1403eca80(), (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_1403ecb20(param_1);
    iVar9 = FUN_1403ecc90(param_1,param_2);
    if (iVar9 == -1) {
      uVar4 = 0;
    }
    else {
      uVar4 = FUN_1403ed070(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_1403ef950(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_1405d84f0 ^ (ulonglong)auStack_18c8;
  local_1898 = param_3;
  local_1868 = param_2;
  local_1860 = param_4;
  iVar2 = FUN_1403e4d70(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_1403e4ac0(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_1403e4ac0(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_1403e4b20(puVar10);
          puVar10 = puVar10 + 0x18;
          uVar4 = uVar4 - 1;
        } while (uVar4 != 0);
      }
      FUN_1403e4b20(local_1840);
      return (ulonglong)uVar3;
    }
    param_3 = local_1898;
  }
  if (param_5 == 0) {
    uVar3 = FUN_1403e6130();
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1403efe9d;
    if ((*param_3 * 2 + 1 < 0x200) && (*param_3 < 0x100)) {
      pcVar12 = FUN_1403ef700;
    }
    else {
      pcVar12 = FUN_1403e6260;
    }
  }
  else if (param_5 == 1) {
    FUN_1403f2d90();
    pcVar12 = FUN_1403f2c80;
  }
  else {
    uVar3 = FUN_1403f2be0(param_3,&local_18a8);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1403efe9d;
    pcVar12 = FUN_1403f2af0;
  }
  uVar3 = FUN_1403e4ac0(local_1888);
  uVar4 = (ulonglong)uVar3;
  uVar11 = local_18a4;
  if (uVar3 != 0) goto LAB_1403efe9d;
  if (param_5 == 0) {
    uVar11 = FUN_1403e6190(local_1888,param_3);
    uVar4 = (ulonglong)uVar11;
    if (uVar11 != 0) goto LAB_1403efe8e;
    uVar11 = FUN_1403e6010(param_1,local_1888,param_3);
  }
  else {
    FUN_1403ef6c0(local_1888,1);
    uVar11 = FUN_1403eee40(param_1,param_3,local_1840);
  }
  uVar4 = (ulonglong)uVar11;
  if (uVar11 == 0) {
    puVar10 = auStack_1858 + (longlong)local_18a0 * 0x18;
    uVar11 = FUN_1403e4bc0(local_1840,puVar10);
    piVar1 = local_1898;
    uVar4 = (ulonglong)uVar11;
    if (uVar11 == 0) {
      iVar9 = 0;
      if (0 < iVar7) {
        do {
          uVar11 = FUN_1403e56f0(puVar10,puVar10);
          uVar4 = (ulonglong)uVar11;
          if (uVar11 != 0) goto LAB_1403efe8e;
          uVar11 = (*pcVar12)(puVar10,piVar1,local_18a8);
          uVar4 = (ulonglong)uVar11;
          if (uVar11 != 0) goto LAB_1403efe8e;
          iVar9 = iVar9 + 1;
        } while (iVar9 < iVar7);
      }
      iVar9 = local_18a0 + 1;
      iVar7 = local_18a0;
      if (iVar9 < (int)local_18a4) {
        do {
          uVar11 = FUN_1403e5580(auStack_1858 + (longlong)iVar7 * 0x18,local_1840,
                                 auStack_1858 + (longlong)iVar9 * 0x18);
          uVar4 = (ulonglong)uVar11;
          if (uVar11 != 0) goto LAB_1403efe8e;
          uVar11 = (*pcVar12)(auStack_1858 + (longlong)iVar9 * 0x18,piVar1,local_18a8);
          uVar4 = (ulonglong)uVar11;
          if (uVar11 != 0) goto LAB_1403efe8e;
          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_1403efc76:
      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_1403efe5e;
            goto LAB_1403efdf0;
          }
          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_r0x0001403efcbf;
        if ((iVar9 != 1) || ((uVar8 & 1) != 0)) goto LAB_1403efcc3;
        uVar3 = FUN_1403e56f0(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_1403efe8e;
code_r0x0001403efcbf:
  if ((uVar8 & 1) != 0) {
LAB_1403efcc3:
    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_1403e56f0(local_1888,local_1888);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 != 0) goto LAB_1403efe8e;
          uVar3 = (*pcVar12)(local_1888,piVar1,local_18a8);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 != 0) goto LAB_1403efe8e;
          iVar7 = iVar7 + 1;
        } while (iVar7 < iVar2);
      }
      uVar11 = FUN_1403e5580(local_1888,auStack_1858 + (longlong)(int)uVar11 * 0x18,local_1888);
      uVar4 = (ulonglong)uVar11;
      if (uVar11 != 0) goto LAB_1403efe8e;
      uVar11 = (*pcVar12)(local_1888,piVar1,local_18a8);
      uVar4 = (ulonglong)uVar11;
      if (uVar11 != 0) goto LAB_1403efe8e;
      uVar4 = (ulonglong)local_1870;
      iVar7 = 0;
      iVar9 = 1;
      uVar11 = 0;
      piVar5 = local_1898;
    }
  }
  goto LAB_1403efc76;
  while( true ) {
    uVar3 = (*pcVar12)(local_1888,piVar1,local_18a8);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1403efe8e;
    uVar11 = uVar11 * 2;
    if ((local_18a4 & uVar11) != 0) {
      uVar3 = FUN_1403e5580(local_1888,local_1840,local_1888);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403efe8e;
      uVar3 = (*pcVar12)(local_1888,piVar1,local_18a8);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403efe8e;
    }
    iVar2 = iVar2 + 1;
    if (iVar7 <= iVar2) break;
LAB_1403efdf0:
    uVar3 = FUN_1403e56f0(local_1888,local_1888);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1403efe8e;
  }
LAB_1403efe5e:
  if (param_5 == 0) {
    uVar11 = (*pcVar12)(local_1888,piVar1,local_18a8);
    uVar4 = (ulonglong)uVar11;
    if (uVar11 != 0) goto LAB_1403efe8e;
  }
  FUN_1403eeb60(local_1888,local_1860);
  uVar4 = 0;
LAB_1403efe8e:
  FUN_1403e4b20(local_1888);
  uVar11 = local_18a4;
LAB_1403efe9d:
  FUN_1403e4b20(local_1840);
  if (local_18a0 < (int)uVar11) {
    puVar10 = auStack_1858 + (longlong)local_18a0 * 0x18;
    uVar8 = (ulonglong)(uVar11 - local_18a0);
    do {
      FUN_1403e4b20(puVar10);
      puVar10 = puVar10 + 0x18;
      uVar8 = uVar8 - 1;
    } while (uVar8 != 0);
  }
  return uVar4;
}



undefined8 FUN_1403eff10(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_1403e4d70();
    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_1403eff80(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_1403effc0(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_1405d84f0 ^ (ulonglong)auStack_18d8;
  local_18b0 = param_3;
  local_1888 = param_2;
  local_1860 = param_4;
  iVar2 = FUN_1403e4d70(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_1403e4ac0(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_1403e4ac0(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_1403e4b20(puVar10);
          puVar10 = puVar10 + 0x18;
          uVar4 = uVar4 - 1;
        } while (uVar4 != 0);
      }
      FUN_1403e4b20(local_1840);
      return (ulonglong)uVar3;
    }
    param_3 = local_18b0;
  }
  uVar3 = FUN_1403e4ac0(local_1878);
  uVar4 = (ulonglong)uVar3;
  if (uVar3 != 0) goto LAB_1403f04c4;
  if (param_5 == 0) {
    uVar3 = FUN_1403f3080(local_1878,param_3);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 == 0) {
      pcVar12 = FUN_1403f2f00;
LAB_1403f0172:
      uVar3 = FUN_1403eee40(param_1,param_3,local_1840);
      uVar4 = (ulonglong)uVar3;
      uVar11 = local_18b8;
      if (uVar3 == 0) {
        puVar10 = auStack_1858 + (longlong)local_18b4 * 0x18;
        uVar3 = FUN_1403e4bc0(local_1840,puVar10);
        lVar1 = local_18b0;
        uVar4 = (ulonglong)uVar3;
        uVar11 = local_18b8;
        if (uVar3 == 0) {
          iVar9 = 0;
          if (0 < iVar7) {
            do {
              uVar3 = FUN_1403e56f0(puVar10,puVar10);
              uVar4 = (ulonglong)uVar3;
              uVar11 = local_18b8;
              if (uVar3 != 0) goto LAB_1403f04ba;
              uVar3 = (*pcVar12)(puVar10,lVar1,local_1878);
              uVar4 = (ulonglong)uVar3;
              uVar11 = local_18b8;
              if (uVar3 != 0) goto LAB_1403f04ba;
              iVar9 = iVar9 + 1;
            } while (iVar9 < iVar7);
          }
          iVar9 = local_18b4 + 1;
          iVar7 = local_18b4;
          if (iVar9 < (int)local_18b8) {
            do {
              uVar3 = FUN_1403e5580(auStack_1858 + (longlong)iVar7 * 0x18,local_1840,
                                    auStack_1858 + (longlong)iVar9 * 0x18);
              uVar4 = (ulonglong)uVar3;
              uVar11 = local_18b8;
              if (uVar3 != 0) goto LAB_1403f04ba;
              uVar3 = (*pcVar12)(auStack_1858 + (longlong)iVar9 * 0x18,lVar1,local_1878);
              uVar4 = (ulonglong)uVar3;
              uVar11 = local_18b8;
              if (uVar3 != 0) goto LAB_1403f04ba;
              iVar9 = iVar9 + 1;
              iVar7 = iVar7 + 1;
            } while (iVar9 < (int)local_18b8);
          }
          uVar3 = FUN_1403e4ac0(local_18a0);
          uVar4 = (ulonglong)uVar3;
          uVar11 = local_18b8;
          if (uVar3 == 0) {
            FUN_1403ef6c0(local_18a0,1);
            iVar9 = 0;
            uVar4 = 0;
            iVar7 = 0;
            local_18a8 = 1;
            uVar11 = 0;
            local_18b0 = (longlong)(*local_1888 + -1);
            lVar5 = local_18b0;
LAB_1403f02b5:
            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_1403f049a;
                  goto LAB_1403f0430;
                }
                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_r0x0001403f02fe;
              if ((iVar9 != 1) || ((uVar8 & 1) != 0)) goto LAB_1403f0302;
              uVar3 = FUN_1403e56f0(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_1403f04ab;
          }
        }
      }
    }
  }
  else {
    uVar3 = FUN_1403f2e90(param_3,local_1878);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 == 0) {
      pcVar12 = FUN_1403f2da0;
      goto LAB_1403f0172;
    }
  }
LAB_1403f04ba:
  FUN_1403e4b20(local_1878);
LAB_1403f04c4:
  FUN_1403e4b20(local_1840);
  if (local_18b4 < (int)uVar11) {
    puVar10 = auStack_1858 + (longlong)local_18b4 * 0x18;
    uVar8 = (ulonglong)(uVar11 - local_18b4);
    do {
      FUN_1403e4b20(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_1403f04ab;
    uVar11 = uVar11 * 2;
    if ((local_18b8 & uVar11) != 0) {
      uVar3 = FUN_1403e5580(local_18a0,local_1840,local_18a0);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403f04ab;
      uVar3 = (*pcVar12)(local_18a0,lVar1,local_1878);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403f04ab;
    }
    iVar2 = iVar2 + 1;
    if (iVar7 <= iVar2) break;
LAB_1403f0430:
    uVar3 = FUN_1403e56f0(local_18a0,local_18a0);
    uVar4 = (ulonglong)uVar3;
    if (uVar3 != 0) goto LAB_1403f04ab;
  }
LAB_1403f049a:
  FUN_1403eeb60(local_18a0,local_1860);
  uVar4 = 0;
LAB_1403f04ab:
  FUN_1403e4b20(local_18a0);
  uVar11 = local_18b8;
  goto LAB_1403f04ba;
code_r0x0001403f02fe:
  if ((uVar8 & 1) != 0) {
LAB_1403f0302:
    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_1403e56f0(local_18a0,local_18a0);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 != 0) goto LAB_1403f04ab;
          uVar3 = (*pcVar12)(local_18a0,lVar1,local_1878);
          uVar4 = (ulonglong)uVar3;
          if (uVar3 != 0) goto LAB_1403f04ab;
          iVar7 = iVar7 + 1;
        } while (iVar7 < iVar2);
      }
      uVar11 = FUN_1403e5580(local_18a0,auStack_1858 + (longlong)(int)uVar11 * 0x18,local_18a0);
      uVar4 = (ulonglong)uVar11;
      if (uVar11 != 0) goto LAB_1403f04ab;
      uVar11 = (*pcVar12)(local_18a0,lVar1,local_1878);
      uVar4 = (ulonglong)uVar11;
      if (uVar11 != 0) goto LAB_1403f04ab;
      uVar4 = (ulonglong)local_1880;
      iVar7 = 0;
      iVar9 = 1;
      uVar11 = 0;
      lVar5 = local_18b0;
    }
  }
  goto LAB_1403f02b5;
}



bool FUN_1403f0540(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_1403f0590(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_1403e4d40(param_2,1);
  if (iVar1 != 1) {
    return 0xfffffffd;
  }
  uVar5 = FUN_1403ecec0(local_50,param_1);
  if ((int)uVar5 != 0) {
    return uVar5;
  }
  uVar2 = FUN_1403e5440(local_50,1,local_50);
  uVar5 = (ulonglong)uVar2;
  if (uVar2 != 0) goto LAB_1403f0722;
  uVar2 = FUN_1403ecec0(local_38,local_50);
  uVar5 = (ulonglong)uVar2;
  if (uVar2 != 0) goto LAB_1403f0722;
  iVar1 = FUN_1403e4da0(local_38);
  uVar2 = FUN_1403ecef0(local_38,iVar1,local_38,0);
  uVar5 = (ulonglong)uVar2;
  if (uVar2 == 0) {
    uVar2 = FUN_1403e4ac0(local_68);
    uVar5 = (ulonglong)uVar2;
    if (uVar2 == 0) {
      uVar2 = FUN_1403e63d0(param_2,local_38,param_1,local_68);
      uVar5 = (ulonglong)uVar2;
      if (uVar2 == 0) {
        iVar3 = FUN_1403e4d40(local_68,1);
        if ((iVar3 != 0) && (iVar3 = FUN_1403e4d10(local_68,local_50), iVar3 != 0)) {
          iVar3 = 1;
          if (0 < iVar1 + -1) {
            do {
              iVar4 = FUN_1403e4d10(local_68,local_50);
              if (iVar4 == 0) break;
              uVar2 = FUN_1403e6090(local_68,param_1,local_68);
              uVar5 = (ulonglong)uVar2;
              if ((uVar2 != 0) || (iVar4 = FUN_1403e4d40(local_68,1), iVar4 == 0))
              goto LAB_1403f0708;
              iVar3 = iVar3 + 1;
            } while (iVar3 <= iVar1 + -1);
          }
          iVar1 = FUN_1403e4d10(local_68,local_50);
          if (iVar1 != 0) goto LAB_1403f0708;
        }
        *param_3 = 1;
      }
LAB_1403f0708:
      FUN_1403e4b20(local_68);
    }
  }
  FUN_1403e4b20(local_38);
LAB_1403f0722:
  FUN_1403e4b20(local_50);
  return uVar5;
}



undefined8 FUN_1403f0750(undefined8 param_1,undefined4 *param_2)

{
  undefined8 uVar1;
  undefined4 *puVar2;
  int local_res10 [2];
  
  *param_2 = 0;
  puVar2 = &DAT_14046f6b0;
  while( true ) {
    uVar1 = FUN_1403e5d50(param_1,*puVar2,local_res10);
    if ((int)uVar1 != 0) {
      return uVar1;
    }
    if (local_res10[0] == 0) break;
    puVar2 = puVar2 + 1;
    if (0x14046faaf < (longlong)puVar2) {
      return 0;
    }
  }
  *param_2 = 1;
  return 0;
}



undefined8 FUN_1403f07d0(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_1403f1f50(param_1,*param_2,uVar1);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f1e50(uVar1,local_48);
          goto LAB_1403f0aa5;
        }
        break;
      case 3:
        iVar2 = FUN_1403f1df0(param_1,*param_2,uVar1);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f1da0(local_res8[0],local_48);
          goto LAB_1403f0aa5;
        }
        break;
      case 4:
        iVar2 = FUN_1403f1c40(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f1bf0(local_res8[0],local_48);
joined_r0x0001403f0a5f:
          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_1403f1af0(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f1aa0(local_res8[0],local_48);
          goto joined_r0x0001403f0a5f;
        }
        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_1403f1920(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f17f0(uVar1,local_res8[0],local_48);
          goto joined_r0x0001403f0a5f;
        }
        break;
      case 8:
        iVar2 = FUN_1403f16b0(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f1610(uVar1,local_res8[0],local_48);
          goto joined_r0x0001403f0a5f;
        }
        break;
      case 9:
        iVar2 = FUN_1403f1470(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f13d0(uVar1,local_res8[0],local_48);
          goto joined_r0x0001403f0a5f;
        }
        break;
      case 10:
        iVar2 = FUN_1403f11d0(param_1,*param_2,uVar1,local_res8);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f10c0(uVar1,local_res8[0],local_48);
          goto joined_r0x0001403f0a5f;
        }
        break;
      case 0xb:
        local_48[0] = *param_2;
        iVar2 = FUN_1403f0dc0(param_1,local_48,uVar1);
LAB_1403f0aa5:
        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_1403e9930(param_1,*param_2,uVar1,local_res8[0],1);
        if (iVar2 == 0) {
          iVar2 = FUN_1403f0b40(uVar1,local_res8[0],local_48);
          goto LAB_1403f0aa5;
        }
      }
      uVar5 = (int)uVar6 + 1;
      uVar6 = (ulonglong)uVar5;
      uVar4 = uVar4 + 1;
      puVar7 = puVar7 + 7;
    } while (uVar5 < param_4);
  }
  return 7;
}



undefined8 FUN_1403f0b40(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_1403f20e0(local_res8);
        break;
      case 2:
        uVar3 = FUN_1403f1e50(puVar2,local_res8);
        break;
      case 3:
        uVar3 = FUN_1403f1da0(*puVar2,local_res8);
        break;
      case 4:
        uVar3 = FUN_1403f1bf0(uVar1,local_res8);
        break;
      case 5:
        uVar3 = FUN_1403f1aa0(uVar1,local_res8);
        break;
      case 6:
        uVar4 = uVar4 + 2;
        goto LAB_1403f0c87;
      case 7:
        uVar3 = FUN_1403f17f0(puVar2,uVar1,local_res8);
        break;
      case 8:
        uVar3 = FUN_1403f1610(puVar2,uVar1,local_res8);
        break;
      case 9:
        uVar3 = FUN_1403f13d0(puVar2,uVar1,local_res8);
        break;
      case 10:
        uVar3 = FUN_1403f10c0(puVar2,uVar1,local_res8);
        break;
      case 0xb:
        uVar3 = FUN_1403f30c0(puVar2,local_res8);
        break;
      default:
        goto LAB_1403f0cd5;
      case 0xd:
      case 0xe:
      case 0xf:
        uVar3 = FUN_1403f0b40(puVar2,uVar1,local_res8);
      }
      if ((int)uVar3 != 0) {
        return uVar3;
      }
      uVar4 = uVar4 + local_res8[0];
LAB_1403f0c87:
      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_1403f0cd5:
          return 0x10;
        }
        iVar5 = uVar4 + 5;
      }
      goto LAB_1403f0cd0;
    }
  }
  iVar5 = uVar4 + 2;
LAB_1403f0cd0:
  *param_3 = iVar5;
  return 0;
}



undefined8 FUN_1403f0d30(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_1403f0dc0(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_1405d84f0 ^ (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_1403f15d0(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_1403f0d30(local_68[0]);
  iVar2 = iVar2 * 5;
  iVar3 = FUN_1403f0d30(local_68[1]);
  uVar6 = iVar3 + iVar2 * 2;
  *param_3 = uVar6;
  if (uVar6 < 100) {
    iVar2 = FUN_1403f0d30(local_68[2]);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1403f0d30(local_68[3]);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[1] = uVar6;
    if (0xc < uVar6) {
      return 7;
    }
    iVar2 = FUN_1403f0d30(local_64);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1403f0d30(local_63);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[2] = uVar6;
    if (0x1f < uVar6) {
      return 7;
    }
    iVar2 = FUN_1403f0d30(local_62);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1403f0d30(local_61);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[3] = uVar6;
    if (0x17 < uVar6) {
      return 7;
    }
    iVar2 = FUN_1403f0d30(local_60);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1403f0d30(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_1403f0d30();
        iVar2 = iVar2 * 5;
        iVar3 = FUN_1403f0d30(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_1403f0d30(local_5b);
        iVar2 = iVar2 * 5;
        iVar3 = FUN_1403f0d30(local_5a);
        uVar6 = iVar3 + iVar2 * 2;
        param_3[7] = uVar6;
        if (0x17 < uVar6) {
          return 7;
        }
        iVar2 = FUN_1403f0d30(local_59);
        goto LAB_1403f0fe8;
      }
      uVar6 = 1;
    }
    param_3[6] = uVar6;
    iVar2 = FUN_1403f0d30(local_5d);
    iVar2 = iVar2 * 5;
    iVar3 = FUN_1403f0d30(local_5c);
    uVar6 = iVar3 + iVar2 * 2;
    param_3[7] = uVar6;
    if (uVar6 < 0x18) {
      iVar2 = FUN_1403f0d30(local_5b);
      local_58 = local_5a;
LAB_1403f0fe8:
      iVar2 = iVar2 * 5;
      iVar3 = FUN_1403f0d30(local_58);
      uVar6 = iVar3 + iVar2 * 2;
      param_3[8] = uVar6;
      if (0x3b < uVar6) {
        return 7;
      }
      return 0;
    }
  }
  return 7;
}



undefined8 FUN_1403f1090(ushort param_1)

{
  if (param_1 < 0x80) {
    return 1;
  }
  if (param_1 < 0x800) {
    return 2;
  }
  return 3;
}



undefined8 FUN_1403f10c0(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_1403f11d0(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_1403f1323:
          *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_1403f1323;
        }
        *param_3 = uVar4;
        param_3 = param_3 + 1;
        uVar3 = uVar3 + 1;
      } while( true );
    }
  }
  return 7;
}



undefined4 FUN_1403f1360(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_14046fab0;
  do {
    if (*piVar1 == param_1) {
      return (&DAT_14046fab4)[(longlong)iVar2 * 2];
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x14046fd00);
  return 0xffffffff;
}



undefined4 FUN_1403f1390(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_14046fab4;
  do {
    if (*piVar1 == param_1) {
      return (&DAT_14046fab0)[(longlong)iVar2 * 2];
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x14046fd04);
  return 0xffffffff;
}



undefined8 FUN_1403f13d0(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_14046fab0)[lVar1 * 2] != (uint)*param_1) {
          lVar1 = lVar1 + 1;
          if (0x49 < lVar1) {
            return 0x10;
          }
        }
        if ((&DAT_14046fab4)[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_1403f1470(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_1403f1390(*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_1403f15a0(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_14046fd00;
  do {
    if (*piVar1 == param_1) {
      return (&DAT_14046fd04)[(longlong)iVar2 * 2];
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x140470030);
  return 0xffffffff;
}



undefined4 FUN_1403f15d0(int param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  piVar1 = &DAT_14046fd04;
  do {
    if (*piVar1 == param_1) {
      return (&DAT_14046fd00)[(longlong)iVar2 * 2];
    }
    piVar1 = piVar1 + 2;
    iVar2 = iVar2 + 1;
  } while ((longlong)piVar1 < 0x140470034);
  return 0xffffffff;
}



undefined8 FUN_1403f1610(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_14046fd00)[lVar1 * 2] != (uint)*param_1) {
          lVar1 = lVar1 + 1;
          if (0x65 < lVar1) {
            return 0x10;
          }
        }
        if ((&DAT_14046fd04)[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_1403f16b0(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_1403f15d0(*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_1403f17e0(uint param_1)

{
  int iVar1;
  
  iVar1 = 0;
  for (; param_1 != 0; param_1 = param_1 >> 1) {
    iVar1 = iVar1 + 1;
  }
  return iVar1;
}



undefined8 FUN_1403f17f0(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_1403f1920(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_1403f1aa0(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_1403f1af0(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_1403f1bf0(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_1403f1c40(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_1403f1da0(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_1403f1dd2;
  }
  iVar3 = 1;
LAB_1403f1dd2:
  *param_2 = ((param_1 >> (iVar3 * 8 - 1U & 0x1f) & 1) != 0) + 2 + iVar3;
  return 0;
}



undefined8 FUN_1403f1df0(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_1403f1e50(longlong param_1,int *param_2)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar4;
  
  if ((param_1 != 0) && (param_2 != (int *)0x0)) {
    iVar1 = (*DAT_14060d360)(param_1,0);
    if (iVar1 == -1) {
      uVar2 = (*DAT_14060d368)(param_1);
      uVar2 = (8 - (uVar2 & 7)) + uVar2;
      iVar1 = (*DAT_14060d370)(param_1);
      iVar3 = (*DAT_14060d368)(param_1);
      if ((iVar1 + 1 == iVar3) && (uVar4 = (*DAT_14060d368)(param_1), (uVar4 & 7) == 0)) {
        uVar2 = uVar2 - 1;
      }
      uVar2 = uVar2 >> 3;
    }
    else {
      uVar4 = (*DAT_14060d368)();
      if (((uVar4 & 7) == 0) || (iVar1 = (*DAT_14060d360)(param_1,0), iVar1 == 0)) {
        iVar1 = (*DAT_14060d390)(param_1);
        uVar2 = iVar1 + 1;
      }
      else {
        uVar2 = (*DAT_14060d390)(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_1403f1f50(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_14060d3a0)(param_3,param_1 + uVar7);
        if ((int)uVar5 != 0) {
          return uVar5;
        }
        goto LAB_1403f2044;
      }
    }
  }
  else if (bVar2 + 2 <= param_2) {
    uVar5 = (*DAT_14060d3a0)(param_3,param_1 + 2,(uint)bVar2);
    if ((int)uVar5 != 0) {
      return uVar5;
    }
LAB_1403f2044:
    if ((param_1[uVar7] & 0x80) == 0) {
      return 0;
    }
    iVar3 = (*DAT_14060d310)(local_res18);
    if (iVar3 == 0) {
      uVar4 = (*DAT_14060d368)(param_3);
      iVar3 = (*DAT_14060d378)(local_res18[0],uVar4);
      if ((iVar3 == 0) && (iVar3 = (*DAT_14060d3b8)(param_3,local_res18[0],param_3), iVar3 == 0)) {
        (*DAT_14060d320)(local_res18[0]);
        return 0;
      }
      (*DAT_14060d320)(local_res18[0]);
    }
    return 0xd;
  }
  return 7;
}



undefined8 FUN_1403f20e0(undefined4 *param_1)

{
  if (param_1 == (undefined4 *)0x0) {
    return 0x10;
  }
  *param_1 = 3;
  return 0;
}



undefined8 FUN_1403f2100(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_1403f2140(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_1403f20e0(&local_28);
        break;
      case 2:
        uVar4 = FUN_1403f1e50(puVar3,&local_28);
        break;
      case 3:
        uVar4 = FUN_1403f1da0(*puVar3,&local_28);
        break;
      case 4:
        uVar4 = FUN_1403f1bf0(uVar1,&local_28);
        break;
      case 5:
        uVar4 = FUN_1403f1aa0(uVar1,&local_28);
        break;
      case 6:
        uVar6 = uVar6 + 2;
        goto LAB_1403f228f;
      case 7:
        uVar4 = FUN_1403f17f0(puVar3,uVar1,&local_28);
        break;
      case 8:
        uVar4 = FUN_1403f1610(puVar3,uVar1,&local_28);
        break;
      case 9:
        uVar4 = FUN_1403f13d0(puVar3,uVar1,&local_28);
        break;
      case 10:
        uVar4 = FUN_1403f10c0(puVar3,uVar1,&local_28);
        break;
      case 0xb:
        uVar4 = FUN_1403f30c0(puVar3,&local_28);
        break;
      default:
        goto LAB_1403f25b7;
      case 0xd:
      case 0xe:
      case 0xf:
        uVar4 = FUN_1403f0b40(puVar3,uVar1,&local_28);
      }
      if ((int)uVar4 != 0) {
        return uVar4;
      }
      uVar6 = uVar6 + local_28;
LAB_1403f228f:
      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_1403f25b7:
      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_1403f2394;
        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_1403f2394:
  *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_1403f4620(*puVar3,param_3 + uVar5,&local_24);
        break;
      case 2:
        local_24 = *param_4;
        uVar4 = FUN_1403f4380(puVar3,param_3 + uVar5,&local_24);
        break;
      case 3:
        local_24 = *param_4;
        uVar4 = FUN_1403f4260(*puVar3,param_3 + uVar5,&local_24);
        break;
      case 4:
        local_24 = *param_4;
        uVar4 = FUN_1403f40f0(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 5:
        local_24 = *param_4;
        uVar4 = FUN_1403f3fc0(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_1403f2589;
      case 7:
        local_24 = *param_4;
        uVar4 = FUN_1403f3d60(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 8:
        local_24 = *param_4;
        uVar4 = FUN_1403f3c30(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 9:
        local_24 = *param_4;
        uVar4 = FUN_1403f3b00(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 10:
        local_24 = *param_4;
        uVar4 = FUN_1403f3900(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 0xb:
        local_24 = *param_4;
        uVar4 = FUN_1403f3570(puVar3,param_3 + uVar5,&local_24);
        break;
      default:
        goto LAB_1403f25b7;
      case 0xd:
        local_24 = *param_4;
        uVar4 = FUN_1403f2140(puVar3,uVar1,param_3 + uVar5,&local_24,iVar2);
        break;
      case 0xe:
        local_24 = *param_4;
        uVar4 = FUN_1403f3470(puVar3,uVar1,param_3 + uVar5,&local_24);
        break;
      case 0xf:
        local_24 = *param_4;
        uVar4 = FUN_1403f3180(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_1403f2589:
      uVar5 = (ulonglong)local_28;
      puVar8 = puVar8 + 7;
      uVar6 = uVar6 + 1;
    } while (uVar6 < param_2);
  }
  *param_4 = (uint)uVar5;
  return 0;
}



ulonglong FUN_1403f2640(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_1403ea690(param_1);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  lVar7 = (longlong)param_1 * 0x80;
  uVar1 = *(uint *)(&DAT_1405f440c + 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 + 0x1405f4458))(_Memory);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403f27ac;
      uVar3 = (**(code **)(lVar7 + 0x1405f4460))(_Memory,param_2,param_3);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403f27ac;
      uVar3 = (**(code **)(lVar7 + 0x1405f4460))(_Memory,_Memory_00,4);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403f27ac;
      uVar3 = (**(code **)(lVar7 + 0x1405f4468))(_Memory,_Memory_00);
      uVar4 = (ulonglong)uVar3;
      if (uVar3 != 0) goto LAB_1403f27ac;
      uVar3 = 0;
      iVar2 = iVar8;
      if (uVar1 != 0) {
        lVar5 = (longlong)_Memory_00 - (longlong)param_4;
        puVar6 = param_4;
        do {
          if (param_5 == 0) goto LAB_1403f27aa;
          uVar3 = uVar3 + 1;
          param_4 = puVar6 + 1;
          *puVar6 = puVar6[lVar5];
          param_5 = param_5 + -1;
          puVar6 = param_4;
        } while (uVar3 < uVar1);
      }
    }
LAB_1403f27aa:
    uVar4 = 0;
LAB_1403f27ac:
    free(_Memory_00);
    free(_Memory);
    return uVar4;
  }
  free(_Memory);
  return 0xd;
}



ulonglong FUN_1403f2800(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_1403ea690(param_1);
      if ((int)uVar2 == 0) {
        lVar3 = (longlong)param_1 * 0x80;
        if (*param_5 < *(uint *)(&DAT_1405f440c + lVar3)) {
          *param_5 = *(uint *)(&DAT_1405f440c + lVar3);
          uVar2 = 6;
        }
        else {
          _Memory = malloc(0x70);
          if (_Memory == (void *)0x0) {
            uVar2 = 0xd;
          }
          else {
            uVar1 = (**(code **)(lVar3 + 0x1405f4458))(_Memory);
            uVar2 = (ulonglong)uVar1;
            if (uVar1 == 0) {
              uVar1 = (**(code **)(lVar3 + 0x1405f4460))(_Memory,param_2,param_3);
              uVar2 = (ulonglong)uVar1;
              if (uVar1 == 0) {
                uVar1 = (**(code **)(lVar3 + 0x1405f4468))(_Memory,param_4);
                uVar2 = (ulonglong)uVar1;
                *param_5 = *(uint *)(&DAT_1405f440c + lVar3);
              }
            }
            free(_Memory);
          }
        }
      }
      return uVar2;
    }
    return 0x10;
  }
  return 0x10;
}



undefined8 FUN_1403f2910(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_1403eeca0(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_1403ecb20(local_28);
      FUN_1403eeb60(local_28,param_2);
    }
    FUN_1403e4b20(local_28);
    uVar1 = 0;
  }
  return uVar1;
}



undefined8 FUN_1403f2a00(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_1403ecc60(param_3);
    return 0;
  }
  if (*param_1 * 0x1c <= (int)param_2) {
    uVar3 = FUN_1403e4bc0(param_1,param_3);
    return uVar3;
  }
  uVar3 = FUN_1403e4bc0(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_1403ecb20(param_3);
    uVar3 = 0;
  }
  return uVar3;
}



ulonglong FUN_1403f2af0(undefined8 param_1,undefined8 param_2,int param_3)

{
  undefined4 uVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar4;
  undefined1 local_28 [32];
  
  uVar4 = FUN_1403e4ac0(local_28);
  if ((int)uVar4 == 0) {
    uVar1 = FUN_1403e4d70(param_2);
    uVar2 = FUN_1403ecef0(param_1,uVar1,local_28,param_1);
    while (uVar4 = (ulonglong)uVar2, uVar2 == 0) {
      if (param_3 != 1) {
        uVar2 = FUN_1403e5630(local_28,param_3,local_28);
        uVar4 = (ulonglong)uVar2;
        if (uVar2 != 0) break;
      }
      uVar2 = FUN_1403ed170(param_1,local_28,param_1);
      uVar4 = (ulonglong)uVar2;
      if ((uVar2 != 0) || (iVar3 = FUN_1403ecc90(param_1,param_2), iVar3 == -1)) break;
      FUN_1403ed070(param_1,param_2,param_1);
      uVar2 = FUN_1403ecef0(param_1,uVar1,local_28,param_1);
    }
    FUN_1403e4b20(local_28);
  }
  return uVar4;
}



ulonglong FUN_1403f2be0(undefined8 param_1,undefined4 *param_2)

{
  undefined4 uVar1;
  uint uVar2;
  ulonglong uVar3;
  undefined1 local_28 [16];
  undefined4 *local_18;
  
  uVar3 = FUN_1403e4ac0(local_28);
  if ((int)uVar3 == 0) {
    uVar1 = FUN_1403e4d70(param_1);
    uVar2 = FUN_1403e4e10(local_28,uVar1);
    if ((uVar2 != 0) || (uVar2 = FUN_1403ed070(local_28,param_1,local_28), uVar2 != 0)) {
      FUN_1403e4b20(local_28);
      return (ulonglong)uVar2;
    }
    *param_2 = *local_18;
    FUN_1403e4b20(local_28);
    uVar3 = 0;
  }
  return uVar3;
}



undefined8 FUN_1403f2c80(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_1403eca80(), (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_1403ecb20(param_1);
      iVar2 = FUN_1403ecc90(param_1,param_2);
      if (iVar2 == -1) break;
      FUN_1403ed070(param_1,param_2,param_1);
    }
    uVar3 = 0;
  }
  return uVar3;
}



void FUN_1403f2d90(longlong param_1,int *param_2)

{
  *param_2 = 0x10000000 - **(int **)(param_1 + 0x10);
  return;
}



ulonglong FUN_1403f2da0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 uVar1;
  uint uVar2;
  int iVar3;
  ulonglong uVar4;
  undefined1 local_28 [32];
  
  uVar4 = FUN_1403e4ac0(local_28);
  if ((int)uVar4 == 0) {
    uVar1 = FUN_1403e4d70(param_2);
    uVar2 = FUN_1403ecef0(param_1,uVar1,local_28,param_1);
    uVar4 = (ulonglong)uVar2;
    if (uVar2 == 0) {
      while( true ) {
        uVar2 = FUN_1403e5580(local_28,param_3,local_28);
        uVar4 = (ulonglong)uVar2;
        if (uVar2 != 0) break;
        uVar2 = FUN_1403ed170(param_1,local_28,param_1);
        uVar4 = (ulonglong)uVar2;
        if ((uVar2 != 0) || (iVar3 = FUN_1403ecc90(param_1,param_2), iVar3 == -1)) break;
        FUN_1403ed070(param_1,param_2,param_1);
        uVar2 = FUN_1403ecef0(param_1,uVar1,local_28,param_1);
        uVar4 = (ulonglong)uVar2;
        if (uVar2 != 0) break;
      }
    }
    FUN_1403e4b20(local_28);
  }
  return uVar4;
}



ulonglong FUN_1403f2e90(undefined8 param_1,undefined8 param_2)

{
  undefined4 uVar1;
  uint uVar2;
  ulonglong uVar3;
  undefined1 local_28 [32];
  
  uVar3 = FUN_1403e4ac0(local_28);
  if ((int)uVar3 == 0) {
    uVar1 = FUN_1403e4d70(param_1);
    uVar2 = FUN_1403e4e10(local_28,uVar1);
    if (uVar2 == 0) {
      uVar2 = FUN_1403ed070(local_28,param_1,param_2);
    }
    uVar3 = (ulonglong)uVar2;
    FUN_1403e4b20(local_28);
  }
  return uVar3;
}



ulonglong FUN_1403f2f00(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_1403ecec0(local_28,param_1);
  if ((int)uVar4 != 0) {
    return uVar4;
  }
  FUN_1403eeb90(local_28,uVar3 - 1);
  if (uVar3 < 0x8000001) {
    uVar1 = FUN_1403f4660(local_28,param_3,local_28,uVar3);
  }
  else {
    uVar1 = FUN_1403e5580();
  }
  uVar4 = (ulonglong)uVar1;
  if (uVar1 == 0) {
    FUN_1403eeb90(local_28,uVar3 + 1);
    uVar1 = FUN_1403f2a00(param_1,(uVar3 + 1) * 0x1c,param_1);
    uVar4 = (ulonglong)uVar1;
    if (uVar1 == 0) {
      uVar1 = FUN_1403ed2a0(local_28,param_2,local_28,uVar3 + 1);
      uVar4 = (ulonglong)uVar1;
      if (uVar1 == 0) {
        uVar1 = FUN_1403e53c0(param_1,local_28,param_1);
        uVar4 = (ulonglong)uVar1;
        if (uVar1 == 0) {
          iVar2 = FUN_1403e4d40(param_1,0);
          if (iVar2 == -1) {
            FUN_1403ef6c0(local_28,1);
            uVar3 = FUN_1403eec10(local_28,uVar3 + 1);
            uVar4 = (ulonglong)uVar3;
            if (uVar3 != 0) goto LAB_1403f3059;
            uVar3 = FUN_1403e5200(param_1,local_28,param_1);
            uVar4 = (ulonglong)uVar3;
            if (uVar3 != 0) goto LAB_1403f3059;
          }
          iVar2 = FUN_1403e4d10(param_1,param_2);
          while (iVar2 != -1) {
            uVar3 = FUN_1403ed070(param_1,param_2,param_1);
            uVar4 = (ulonglong)uVar3;
            if (uVar3 != 0) break;
            iVar2 = FUN_1403e4d10(param_1,param_2);
          }
        }
      }
    }
  }
LAB_1403f3059:
  FUN_1403e4b20(local_28);
  return uVar4;
}



void FUN_1403f3080(undefined8 param_1,int *param_2)

{
  int iVar1;
  
  iVar1 = FUN_1403e4e10(param_1,*param_2 * 0x38);
  if (iVar1 == 0) {
    FUN_1403e5770(param_1,param_2,param_1,0);
  }
  return;
}



undefined8 FUN_1403f30c0(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_1403f30f0(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_1403f3180(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_1403f2140(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_1403f30f0);
        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_1403f3380(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_1403f3430(undefined4 *param_1,undefined4 *param_2)

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_1403f3380(*param_1);
  iVar2 = FUN_1403f3380(*param_2);
  if (iVar1 - iVar2 == 0) {
    return param_1[5] - param_2[5];
  }
  return iVar1 - iVar2;
}



undefined4 FUN_1403f3470(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_1403f3430);
    uVar1 = FUN_1403f2140(_Base,param_2,param_3,param_4,0xe);
    free(_Base);
  }
  return uVar1;
}



undefined8 FUN_1403f3570(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_1403f30c0(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_1403f15a0((int)(char)PTR_DAT_1405da268
                                       [(uint)((int)((ulonglong)*param_1 / 10) +
                                              (int)(((ulonglong)*param_1 / 10) / 10) * -10)]);
      param_2[2] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[*param_1 % 10]);
      param_2[3] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268
                                       [(uint)((int)((ulonglong)param_1[1] / 10) +
                                              (int)(((ulonglong)param_1[1] / 10) / 10) * -10)]);
      param_2[4] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[param_1[1] % 10]);
      param_2[5] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268
                                       [(uint)((int)((ulonglong)param_1[2] / 10) +
                                              (int)(((ulonglong)param_1[2] / 10) / 10) * -10)]);
      param_2[6] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[param_1[2] % 10]);
      param_2[7] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268
                                       [(uint)((int)((ulonglong)param_1[3] / 10) +
                                              (int)(((ulonglong)param_1[3] / 10) / 10) * -10)]);
      param_2[8] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[param_1[3] % 10]);
      param_2[9] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268
                                       [(uint)((int)((ulonglong)param_1[4] / 10) +
                                              (int)(((ulonglong)param_1[4] / 10) / 10) * -10)]);
      param_2[10] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[param_1[4] % 10]);
      param_2[0xb] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268
                                       [(uint)((int)((ulonglong)param_1[5] / 10) +
                                              (int)(((ulonglong)param_1[5] / 10) / 10) * -10)]);
      param_2[0xc] = uVar1;
      uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[param_1[5] % 10]);
      param_2[0xd] = uVar1;
      if ((param_1[8] == 0) && (param_1[7] == 0)) {
        uVar1 = FUN_1403f15a0(0x5a);
        uVar3 = 0xf;
        param_2[0xe] = uVar1;
      }
      else {
        uVar2 = 0x2b;
        if (param_1[6] != 0) {
          uVar2 = 0x2d;
        }
        uVar1 = FUN_1403f15a0(uVar2);
        param_2[0xe] = uVar1;
        uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268
                                         [(uint)((int)((ulonglong)param_1[7] / 10) +
                                                (int)(((ulonglong)param_1[7] / 10) / 10) * -10)]);
        param_2[0xf] = uVar1;
        uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[param_1[7] % 10]);
        param_2[0x10] = uVar1;
        uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[(param_1[8] / 10) % 10]);
        param_2[0x11] = uVar1;
        uVar1 = FUN_1403f15a0((int)(char)PTR_DAT_1405da268[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_1403f3900(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_1403f39b7:
    uVar10 = uVar5 + 2;
LAB_1403f39ba:
    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_1403f3ace;
        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_1403f1090(*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_1403f3ace;
      iVar2 = FUN_1403f1090(*puVar9);
      uVar10 = uVar10 + 1;
      uVar5 = uVar5 + iVar2;
      puVar9 = puVar9 + 1;
    } while (uVar10 < param_2);
    if (uVar5 < 0x80) goto LAB_1403f39b7;
    if (uVar5 < 0x100) {
      uVar10 = uVar5 + 3;
      goto LAB_1403f39ba;
    }
    if (uVar5 < 0x10000) {
      uVar10 = uVar5 + 4;
      goto LAB_1403f39ba;
    }
    if (uVar5 < 0x1000000) {
      uVar10 = uVar5 + 5;
      goto LAB_1403f39ba;
    }
LAB_1403f3ace:
    uVar3 = 0x10;
  }
  return uVar3;
}



undefined8 FUN_1403f3b00(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_1403f13d0(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_1403f1360(*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_1403f3c30(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_1403f1610(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_1403f15a0(*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_1403f3d60(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_1403f17f0(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_1403f17e0(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_1403f3fc0(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_1403f40c9:
    uVar2 = 0x10;
  }
  else {
    uVar2 = FUN_1403f1aa0(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_1403f40c9;
        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_1403f40f0(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_1403f1bf0(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_1403f4260(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_1403f1da0(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_1403f42e5;
  }
  iVar5 = 1;
LAB_1403f42e5:
  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_1403f4380(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_1403f1e50(param_1,local_res8);
  if ((int)uVar6 == 0) {
    if (*param_3 < local_res8[0]) {
      *param_3 = local_res8[0];
      return 6;
    }
    iVar3 = (*DAT_14060d360)(param_1,0);
    if (iVar3 == -1) {
      uVar4 = (*DAT_14060d368)(param_1);
      uVar4 = (uVar4 - (uVar4 & 7)) + 8 >> 3;
      iVar3 = (*DAT_14060d370)(param_1);
      iVar5 = (*DAT_14060d368)(param_1);
      bVar1 = false;
      if ((iVar3 + 1 == iVar5) &&
         (uVar6 = (*DAT_14060d368)(param_1), bVar1 = false, (uVar6 & 7) == 0)) {
        uVar4 = uVar4 - 1;
      }
    }
    else {
      uVar6 = (*DAT_14060d368)();
      if (((uVar6 & 7) == 0) || (iVar3 = (*DAT_14060d360)(param_1,0), iVar3 == 0)) {
        iVar3 = (*DAT_14060d390)(param_1);
        uVar4 = iVar3 + 1;
        bVar1 = true;
      }
      else {
        uVar4 = (*DAT_14060d390)(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_14060d360)(param_1,0);
    if (iVar3 == 1) {
      uVar6 = (*DAT_14060d398)(param_1,puVar9);
      if ((int)uVar6 != 0) {
        return uVar6;
      }
    }
    else {
      iVar3 = (*DAT_14060d360)(param_1,0);
      if (iVar3 != 0) {
        iVar3 = (*DAT_14060d310)(&local_res20);
        if (iVar3 == 0) {
          uVar4 = (*DAT_14060d368)(param_1);
          iVar8 = (8 - (uVar4 & 7)) + uVar4;
          iVar3 = (*DAT_14060d370)(param_1);
          iVar5 = (*DAT_14060d368)(param_1);
          if ((iVar3 + 1 == iVar5) && (uVar6 = (*DAT_14060d368)(param_1), (uVar6 & 7) == 0)) {
            iVar8 = iVar8 + -8;
          }
          iVar3 = (*DAT_14060d378)(local_res20,iVar8);
          if ((iVar3 == 0) &&
             (iVar3 = (*DAT_14060d3a8)(local_res20,param_1,local_res20), iVar3 == 0)) {
            uVar4 = (*DAT_14060d398)(local_res20,puVar9);
            if (uVar4 != 0) {
              (*DAT_14060d320)();
              return (ulonglong)uVar4;
            }
            (*DAT_14060d320)(local_res20);
            *param_3 = local_res8[0];
            return 0;
          }
          (*DAT_14060d320)(local_res20);
        }
        return 0xd;
      }
    }
    *param_3 = local_res8[0];
    uVar6 = 0;
  }
  return uVar6;
}



undefined8 FUN_1403f4620(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_1403f4660(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_1403f47c0(param_1,param_2,param_3,param_4);
      return uVar4;
    }
  }
  uVar4 = FUN_1403eeca0(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_1403ecb20(local_48);
    FUN_1403eeb60(local_48,param_3);
    FUN_1403e4b20(local_48);
    uVar4 = 0;
  }
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403f47c0(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_1405d84f0 ^ (ulonglong)auStack_888;
  lVar17 = (longlong)param_4;
  local_860 = param_3;
  if ((*param_2 + *param_1 <= param_3[1]) || (uVar8 = FUN_1403eca80(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_1403ecb20(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 0x0001403f4962. 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 0x0001403f4968. Too many branches
                    // WARNING: Treating indirect jump as call
  p_Var1 = RtlLookupFunctionEntry(ControlPc,ImageBase,HistoryTable);
  return p_Var1;
}



ulonglong FUN_1403f4970(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_1403f4ca8(&local_68,"1.2.3",0x58);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1403f4e08(&local_68,4);
    uVar2 = (ulonglong)uVar1;
    if (uVar1 == 1) {
      *param_2 = local_4c;
      uVar2 = FUN_1403f6378(&local_68);
    }
    else {
      FUN_1403f6378(&local_68);
      if ((uVar1 == 2) || ((uVar1 == 0xfffffffb && (local_60 == 0)))) {
        uVar2 = 0xfffffffd;
      }
    }
  }
  return uVar2;
}



ulonglong FUN_1403f4a14(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_1403f8a5c(&local_68,param_5,"1.2.3",0x58);
  if ((int)uVar2 == 0) {
    uVar1 = FUN_1403f6b0c(&local_68,4);
    uVar2 = (ulonglong)uVar1;
    if (uVar1 == 1) {
      *param_2 = local_4c;
      uVar2 = FUN_1403f735c(&local_68);
    }
    else {
      FUN_1403f735c(&local_68);
      if (uVar1 == 0) {
        uVar2 = 0xfffffffb;
      }
    }
  }
  return uVar2;
}



void FUN_1403f4ac4(void)

{
  FUN_1403f4a14();
  return;
}



undefined8 FUN_1403f4af8(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_1403f4bb8(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_1403f8ac8;
    }
    pcVar1 = *(code **)(param_1 + 0x38);
    if (pcVar1 == (code *)0x0) {
      pcVar1 = FUN_1403f8ae8;
    }
    *(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_1403f4af8(param_1);
      return uVar3;
    }
    (**(code **)(param_1 + 0x38))(*(undefined8 *)(param_1 + 0x40));
    *(undefined8 *)(param_1 + 0x28) = 0;
  }
  return 0xfffffffe;
}



void FUN_1403f4ca8(undefined8 param_1,undefined8 param_2,undefined4 param_3)

{
  FUN_1403f4bb8(param_1,0xf,param_2,param_3);
  return;
}



void FUN_1403f4cc8(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x68) = 9;
  *(undefined4 *)(param_1 + 0x6c) = 5;
  *(undefined **)(param_1 + 0x58) = &DAT_1404700b0;
  *(undefined **)(param_1 + 0x60) = &DAT_1404708b0;
  return;
}



undefined8 FUN_1403f4cf8(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_1403f4dd4;
    }
    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_1403f4dd4:
  *(int *)(lVar1 + 0x30) = iVar2;
  return 0;
}



int FUN_1403f4e08(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_1403f4e8e:
  uVar21 = 0;
  uVar11 = 0x10;
  pbVar16 = local_58;
LAB_1403f4e93:
  local_res18 = (uint)uVar14;
  puVar19 = local_50;
LAB_1403f4e9b:
  uVar13 = 7;
LAB_1403f4ea0:
  do {
    uVar9 = (uint)uVar11;
    uVar4 = *puVar2;
    uVar20 = (uint)uVar21;
    uVar24 = (uint)uVar14;
    uVar10 = local_64;
    if ((int)uVar4 < 0xf) {
      if (uVar4 == 0xe) {
LAB_1403f557c:
        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_1403f55d2;
          }
          goto LAB_1403f52f6;
        }
        *puVar2 = 0xb;
        pbVar16 = local_58;
        goto LAB_1403f4ea0;
      }
      if ((int)uVar4 <= (int)uVar13) {
        if (uVar4 == uVar13) goto LAB_1403f5276;
        if (uVar4 == 0) {
          uVar4 = uVar23;
          if (puVar2[2] != uVar20) goto LAB_1403f5382;
          *puVar2 = 0xc;
          goto LAB_1403f4e9b;
        }
        if (uVar4 == 1) goto LAB_1403f4f2b;
        if (uVar4 == 2) goto LAB_1403f4fcb;
        if (uVar4 == 3) goto LAB_1403f5051;
        if (uVar4 == 4) goto LAB_1403f50af;
        if (uVar4 == 5) goto LAB_1403f50cf;
        if (uVar4 != 6) {
          return -2;
        }
        goto LAB_1403f51dd;
      }
      if (uVar4 == 8) goto LAB_1403f54da;
      if (uVar4 == 9) {
        for (; uVar15 < 0x20; uVar15 = uVar15 + 8) {
          uVar13 = uVar25;
          if (uVar25 == 0) goto LAB_1403f52f6;
          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_1403f563e:
        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_1403f93bc(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_1403f5674:
        uVar13 = uVar25;
        uVar10 = local_64;
        if (param_2 == 5) goto LAB_1403f52f6;
      }
      else {
        if (uVar4 == 10) goto LAB_1403f563e;
        if (uVar4 == 0xb) goto LAB_1403f5674;
        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_1403f52f6;
            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_1403f557c;
          }
          pcVar6 = "invalid stored block lengths";
          goto LAB_1403f54a0;
        }
      }
      if (puVar2[1] != (uint)uVar21) {
        uVar13 = 7;
        *puVar2 = 0x18;
        uVar23 = uVar23 >> (sbyte)(uVar15 & 7);
        uVar15 = uVar15 - (uVar15 & 7);
        goto LAB_1403f4ea0;
      }
      goto LAB_1403f56be;
    }
    if (0x16 < (int)uVar4) {
      uVar13 = uVar25;
      if (uVar4 == 0x17) {
        if (uVar24 == 0) goto LAB_1403f52f6;
        *puVar19 = (char)puVar2[0x12];
        local_50 = puVar19 + 1;
        uVar14 = (ulonglong)(uVar24 - 1);
        *puVar2 = 0x12;
        goto LAB_1403f4e93;
      }
      if (uVar4 == 0x18) {
        uVar13 = uVar23;
        uVar4 = uVar15;
        if (puVar2[2] != uVar20) goto LAB_1403f6190;
        goto LAB_1403f6228;
      }
      if (uVar4 == 0x19) goto LAB_1403f622e;
      if (uVar4 == 0x1a) goto LAB_1403f62d4;
      if (uVar4 != 0x1b) {
        if (uVar4 == 0x1c) {
          return -4;
        }
        return -2;
      }
      local_res8 = -3;
      goto LAB_1403f52f6;
    }
    if (uVar4 == 0x16) goto LAB_1403f6098;
    if (uVar4 != 0xf) {
      if (uVar4 == 0x10) goto LAB_1403f588f;
      if (uVar4 == 0x11) goto LAB_1403f5980;
      if (uVar4 == 0x12) goto LAB_1403f5ca1;
      if (uVar4 == 0x13) goto LAB_1403f5e76;
      if (uVar4 == 0x14) goto LAB_1403f5ec4;
      if (uVar4 != 0x15) {
        return -2;
      }
      goto LAB_1403f6030;
    }
    for (; uVar15 < 0xe; uVar15 = uVar15 + 8) {
      uVar13 = uVar25;
      if (uVar25 == 0) goto LAB_1403f52f6;
      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_1403f5436;
    }
    puVar2[0x1f] = uVar20;
    *puVar2 = 0x10;
LAB_1403f588f:
    while (uVar4 = uVar23, puVar2[0x1f] < puVar2[0x1c]) {
      for (; uVar15 < 3; uVar15 = uVar15 + 8) {
        uVar23 = uVar4;
        uVar13 = uVar25;
        if (uVar25 == 0) goto LAB_1403f52f6;
        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_140470930 + (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_140470930 + (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_1403f8f54(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_1403f4e9b;
    }
    puVar2[0x1f] = 0;
    *puVar2 = 0x11;
LAB_1403f5980:
    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_1403f52f6;
          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_1403f52f6;
              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_1403f52f6;
              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_1403f53d1;
            }
            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_1403f52f6;
                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_1403f52f6;
                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_1403f8f54(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_1403f53cd;
  }
  *(undefined8 *)(puVar2 + 0x18) = *(undefined8 *)(puVar2 + 0x20);
  puVar2[0x1b] = 6;
  local_res8 = FUN_1403f8f54(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_1403f5436;
  }
  *puVar2 = 0x12;
  uVar24 = local_res18;
LAB_1403f5ca1:
  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_1403f8af4(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_1403f55d2:
    uVar14 = (ulonglong)local_res18;
    uVar17 = (ulonglong)local_res20;
    goto LAB_1403f4e8e;
  }
  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_1403f52f6;
    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_1403f52f6;
      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_1403f53cd;
  }
  if ((uVar13 & 0x20) != 0) {
    *puVar2 = 0xb;
    goto LAB_1403f53cd;
  }
  if ((uVar13 & 0x40) != 0) {
    param_1[4] = (longlong)"invalid literal/length code";
    *puVar2 = 0x1b;
    goto LAB_1403f53cd;
  }
  *puVar2 = 0x13;
  puVar2[0x14] = uVar13 & 0xf;
LAB_1403f5e76:
  uVar4 = puVar2[0x14];
  if (uVar4 != 0) {
    if (uVar15 < uVar4) {
      do {
        uVar13 = 0;
        uVar10 = local_64;
        if (uVar25 == 0) goto LAB_1403f52f6;
        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_1403f5ec4:
  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_1403f52f6;
    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_1403f52f6;
      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_1403f57a8;
  }
  *puVar2 = 0x15;
  puVar2[0x13] = uVar13 >> 0x10;
  uVar21 = 0;
  puVar2[0x14] = uVar13 & 0xf;
  puVar19 = local_50;
LAB_1403f6030:
  uVar24 = (uint)uVar14;
  uVar4 = puVar2[0x14];
  if (uVar4 != 0) {
    if (uVar15 < uVar4) {
      do {
        uVar13 = 0;
        uVar10 = local_64;
        if (uVar25 == 0) goto LAB_1403f52f6;
        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_1403f5436;
  }
  *puVar2 = 0x16;
LAB_1403f6098:
  uVar13 = uVar25;
  uVar10 = local_64;
  if (uVar24 == 0) goto LAB_1403f52f6;
  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_1403f60e8;
  }
  else {
    lVar12 = (longlong)puVar19 - (ulonglong)uVar4;
    uVar13 = puVar2[0x12];
  }
  uVar4 = uVar13;
  uVar13 = uVar4;
LAB_1403f60e8:
  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_1403f4ea0;
LAB_1403f6190:
  if (0x1f < uVar15) goto code_r0x0001403f6195;
  uVar13 = uVar25;
  if (uVar25 == 0) goto LAB_1403f52f6;
  bVar1 = *pbVar16;
  pbVar16 = pbVar16 + 1;
  uVar25 = uVar25 - 1;
  uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
  uVar15 = uVar15 + 8;
  local_58 = pbVar16;
  goto LAB_1403f6190;
code_r0x0001403f6195:
  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_1403f93bc(puVar2[6],(longlong)puVar19 - (ulonglong)uVar24);
    }
    else {
      uVar13 = FUN_1403f9f48();
    }
    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_1403f6228:
    uVar15 = uVar4;
    uVar23 = uVar13;
    *puVar2 = 0x19;
LAB_1403f622e:
    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_1403f52f6;
        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_1403f54a0;
      }
    }
    uVar15 = uVar4;
    uVar23 = uVar13;
    *puVar2 = 0x1a;
LAB_1403f62d4:
    local_res8 = 1;
    uVar13 = uVar25;
    uVar10 = local_64;
LAB_1403f52f6:
    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_1403f4cf8(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_1403f93bc(puVar2[6],param_1[2] - (ulonglong)local_res20,local_res20);
      }
      else {
        uVar25 = FUN_1403f9f48();
      }
      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_1403f54a0;
LAB_1403f5382:
  uVar23 = uVar4;
  if (uVar9 <= uVar15) goto code_r0x0001403f5386;
  uVar13 = uVar25;
  if (uVar25 == 0) goto LAB_1403f52f6;
  bVar1 = *pbVar16;
  pbVar16 = pbVar16 + 1;
  uVar25 = uVar25 - 1;
  uVar4 = uVar4 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
  uVar15 = uVar15 + 8;
  local_58 = pbVar16;
  goto LAB_1403f5382;
code_r0x0001403f5386:
  if (((puVar2[2] & 2) != 0) && (uVar4 == 0x8b1f)) {
    uVar23 = FUN_1403f9f48(0,0,0);
    puVar2[6] = uVar23;
    local_68 = 0x8b1f;
    uVar23 = FUN_1403f9f48(puVar2[6],&local_68,2);
    *puVar2 = 1;
    puVar2[6] = uVar23;
LAB_1403f53c4:
    uVar23 = 0;
    uVar15 = uVar23;
LAB_1403f53cd:
    uVar21 = 0;
    puVar19 = local_50;
LAB_1403f53d1:
    uVar17 = (ulonglong)local_res20;
    uVar14 = (ulonglong)local_res18;
LAB_1403f53d9:
    uVar11 = 0x10;
    goto LAB_1403f4e9b;
  }
  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_1403f93bc(0,0,0);
          puVar2[6] = uVar23;
          *(uint *)((longlong)param_1 + 0x4c) = uVar23;
          *puVar2 = ~(uVar4 >> 0xc) & 2 | 9;
          goto LAB_1403f53c4;
        }
        pcVar6 = "invalid window size";
      }
      else {
        pcVar6 = "unknown compression method";
      }
LAB_1403f5436:
      param_1[4] = (longlong)pcVar6;
      *puVar2 = 0x1b;
      goto LAB_1403f53d9;
    }
    uVar11 = 0x10;
  }
  pcVar6 = "incorrect header check";
  goto LAB_1403f54a0;
LAB_1403f4f2b:
  if (uVar9 <= uVar15) goto code_r0x0001403f4f2f;
  uVar13 = uVar25;
  if (uVar25 == 0) goto LAB_1403f52f6;
  bVar1 = *pbVar16;
  pbVar16 = pbVar16 + 1;
  uVar25 = uVar25 - 1;
  uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
  uVar15 = uVar15 + 8;
  local_58 = pbVar16;
  goto LAB_1403f4f2b;
code_r0x0001403f4f2f:
  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_1403f9f48(puVar2[6],&local_68,2);
        uVar21 = 0;
        puVar2[6] = uVar23;
      }
      uVar23 = (uint)uVar21;
      *puVar2 = 2;
      uVar15 = uVar23;
LAB_1403f4fcb:
      do {
        if (0x1f < uVar15) goto code_r0x0001403f4fd0;
        uVar13 = uVar25;
        uVar10 = local_64;
        if (uVar25 == 0) goto LAB_1403f52f6;
        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_1403f54a0:
  param_1[4] = (longlong)pcVar6;
  *puVar2 = 0x1b;
  goto LAB_1403f4e9b;
code_r0x0001403f4fd0:
  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_1403f9f48(puVar2[6],&local_68,4);
    uVar21 = 0;
    puVar2[6] = uVar23;
  }
  uVar23 = (uint)uVar21;
  *puVar2 = 3;
  uVar11 = 0x10;
  uVar15 = uVar23;
LAB_1403f5051:
  do {
    uVar9 = (uint)uVar11;
    if (uVar9 <= uVar15) break;
    uVar13 = uVar25;
    uVar10 = local_64;
    if (uVar25 == 0) goto LAB_1403f52f6;
    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_1403f9f48(puVar2[6],&local_68,2);
    uVar21 = 0;
    puVar2[6] = uVar23;
    uVar9 = 0x10;
  }
  uVar23 = (uint)uVar21;
  *puVar2 = 4;
  uVar15 = uVar23;
LAB_1403f50af:
  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_1403f52f6;
      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_1403f9f48(puVar2[6],&local_68,2);
      uVar21 = 0;
      puVar2[6] = uVar23;
    }
    uVar23 = (uint)uVar21;
    uVar15 = uVar23;
  }
  *puVar2 = 5;
LAB_1403f50cf:
  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_1403f9f48(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_1403f52f6;
  }
  puVar2[0x12] = (uint)uVar21;
  *puVar2 = 6;
LAB_1403f51dd:
  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_1403f52f6;
    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_1403f9f48(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_1403f52f6;
  }
  puVar2[0x12] = (uint)uVar21;
  *puVar2 = 7;
LAB_1403f5276:
  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_1403f52f6;
    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_1403f9f48(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_1403f52f6;
  }
  uVar17 = (ulonglong)local_res20;
  uVar14 = (ulonglong)local_res18;
  *puVar2 = 8;
  uVar11 = 0x10;
  puVar19 = local_50;
  pbVar16 = local_58;
LAB_1403f54da:
  if ((puVar2[4] & 0x200) != 0) {
    for (; uVar15 < (uint)uVar11; uVar15 = uVar15 + 8) {
      uVar13 = uVar25;
      uVar10 = local_64;
      if (uVar25 == 0) goto LAB_1403f52f6;
      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_1403f54a0;
    }
    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_1403f9f48(0,0,0);
  puVar2[6] = uVar13;
  *(uint *)((longlong)param_1 + 0x4c) = uVar13;
  *puVar2 = 0xb;
LAB_1403f57a8:
  uVar14 = (ulonglong)local_res18;
  uVar17 = (ulonglong)local_res20;
  uVar21 = 0;
  puVar19 = local_50;
  goto LAB_1403f53d9;
LAB_1403f56be:
  if (2 < uVar15) goto code_r0x0001403f56c3;
  uVar13 = uVar25;
  uVar10 = local_64;
  if (uVar25 == 0) goto LAB_1403f52f6;
  bVar1 = *pbVar16;
  pbVar16 = pbVar16 + 1;
  uVar25 = uVar25 - 1;
  uVar23 = uVar23 + ((uint)bVar1 << ((byte)uVar15 & 0x1f));
  uVar15 = uVar15 + 8;
  local_58 = pbVar16;
  goto LAB_1403f56be;
code_r0x0001403f56c3:
  puVar2[1] = uVar23 & 1;
  uVar13 = uVar23 >> 1 & 3;
  if (uVar13 == 0) {
    *puVar2 = 0xd;
  }
  else if (uVar13 == 1) {
    FUN_1403f4cc8(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_1403f4e9b;
}



undefined8 FUN_1403f6378(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_1403f63d8(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_1403f6452;
  }
  else if (*piVar1 != 10) {
    return 0xfffffffe;
  }
  uVar2 = FUN_1403f93bc(0,0,0);
  iVar3 = FUN_1403f93bc(uVar2,param_2,_Size);
  if (iVar3 != piVar1[6]) {
    return 0xfffffffd;
  }
LAB_1403f6452:
  iVar3 = FUN_1403f4cf8(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_1403f64f8(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_1403f6558(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_1403f64f8(piVar1 + 0x1f,local_res8,iVar5);
    }
    uVar3 = FUN_1403f64f8(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_1403f4af8(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_1403f6688(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_1403f680c(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_1403f93bc(*(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_1403f6a5c(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_1403f6a8c(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_1403f6b0c(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_1403f9f48(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_1403f9f48(*(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_1403f6a5c(puVar3,(uVar7 / 0x1f + 1) * 0x1f);
      if (*(int *)((longlong)puVar3 + 0x94) != 0) {
        FUN_1403f6a5c();
        FUN_1403f6a5c();
      }
      uVar5 = FUN_1403f93bc(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_1403f9f48(*(undefined4 *)((longlong)param_1 + 0x4c),
                                    (ulonglong)uVar7 + puVar3[2],uVar8 - uVar7);
              *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
            }
            FUN_1403f6a8c(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_1403f9f48(*(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_1403f6f50;
      *(undefined4 *)(puVar3 + 7) = 0;
    }
    *(undefined4 *)(puVar3 + 1) = 0x49;
  }
LAB_1403f6f50:
  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_1403f9f48(*(undefined4 *)((longlong)param_1 + 0x4c),uVar10 + puVar3[2],
                                  uVar7 - (uint)uVar10);
            *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
          }
          FUN_1403f6a8c(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_1403f9f48(*(undefined4 *)((longlong)param_1 + 0x4c),uVar10 + puVar3[2],
                                *(uint *)(puVar3 + 5) - (uint)uVar10);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
        }
      }
      if (uVar7 != 0) goto LAB_1403f700e;
      *(undefined4 *)(puVar3 + 7) = 0;
    }
    *(undefined4 *)(puVar3 + 1) = 0x5b;
  }
LAB_1403f700e:
  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_1403f9f48(*(undefined4 *)((longlong)param_1 + 0x4c),uVar10 + puVar3[2],
                                  uVar7 - (uint)uVar10);
            *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
          }
          FUN_1403f6a8c(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_1403f9f48(*(undefined4 *)((longlong)param_1 + 0x4c),uVar10 + puVar3[2],
                                *(uint *)(puVar3 + 5) - (uint)uVar10);
          *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
        }
      }
      if (uVar7 != 0) goto LAB_1403f70c9;
    }
    *(undefined4 *)(puVar3 + 1) = 0x67;
  }
LAB_1403f70c9:
  if (*(int *)(puVar3 + 1) == 0x67) {
    if (*(int *)(puVar3[6] + 0x3c) != 0) {
      if (*(uint *)(puVar3 + 3) < *(int *)(puVar3 + 5) + 2U) {
        FUN_1403f6a8c(param_1);
      }
      if (*(uint *)(puVar3 + 3) < *(uint *)(puVar3 + 5) + 2) goto LAB_1403f712d;
      *(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_1403f9f48(0,0,0);
      *(undefined4 *)((longlong)param_1 + 0x4c) = uVar5;
    }
    *(undefined4 *)(puVar3 + 1) = 0x71;
  }
LAB_1403f712d:
  if (*(int *)(puVar3 + 5) == 0) {
    if ((((int)param_1[1] == 0) && ((int)param_2 <= iVar6)) && (param_2 != 4)) goto LAB_1403f7159;
LAB_1403f7169:
    if (*(int *)(puVar3 + 1) == 0x29a) {
      if ((int)param_1[1] != 0) {
LAB_1403f7159:
        param_1[4] = (longlong)"buffer error";
        return 0xfffffffb;
      }
LAB_1403f7181:
      if ((*(int *)((longlong)puVar3 + 0x9c) != 0) ||
         ((param_2 != 0 && (*(int *)(puVar3 + 1) != 0x29a)))) goto LAB_1403f719b;
    }
    else {
      if ((int)param_1[1] == 0) goto LAB_1403f7181;
LAB_1403f719b:
      iVar6 = (*(code *)(&PTR_FUN_1404709a8)[(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_1403f713f;
      }
      if (iVar6 == 1) {
        if (param_2 == 1) {
          FUN_1403fb738();
        }
        else {
          FUN_1403fb698(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_1403f6a8c(param_1);
        if ((int)param_1[3] == 0) goto LAB_1403f713f;
      }
    }
    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_1403f6a5c(puVar3,*(undefined2 *)((longlong)param_1 + 0x4e));
          FUN_1403f6a5c();
        }
        FUN_1403f6a8c(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_1403f6a8c(param_1);
    if ((int)param_1[3] != 0) goto LAB_1403f7169;
LAB_1403f713f:
    *(undefined4 *)(puVar3 + 8) = 0xffffffff;
  }
  return 0;
}



undefined8 FUN_1403f735c(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_1403f743c(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_1403f735c(param_1);
    }
    uVar1 = 0xfffffffc;
  }
  return uVar1;
}



uint FUN_1403f761c(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_1403f93bc(*(undefined4 *)((longlong)param_1 + 0x4c),*param_1,uVar3);
  }
  else {
    if (*(int *)(param_1[5] + 0x2c) != 2) goto LAB_1403f7681;
    uVar2 = FUN_1403f9f48(*(undefined4 *)((longlong)param_1 + 0x4c),*param_1,uVar3);
  }
  *(undefined4 *)((longlong)param_1 + 0x4c) = uVar2;
LAB_1403f7681:
  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_1403f76bc(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_1404709a2 + lVar2 * 0x10);
  *(uint *)(param_1 + 0xb4) = (uint)*(ushort *)(&DAT_1404709a0 + lVar2 * 0x10);
  *(uint *)(param_1 + 0xb8) = (uint)*(ushort *)(&DAT_1404709a4 + lVar2 * 0x10);
  uVar1 = *(ushort *)(&DAT_1404709a6 + 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_1403f776c(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_1403f78db:
          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_1403f78db;
  } while( true );
}



uint FUN_1403f790c(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_1403f79fc(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_1403f761c(*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_1403f7b4c(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_1403f79fc(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_1403fb958(param_1,lVar5,*(int *)((longlong)param_1 + 0x94) - uVar2,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403f6a8c(*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_1403fb958(param_1,lVar4,uVar7 - uVar8,0);
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      FUN_1403f6a8c(*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_1403fb958(param_1,lVar4,uVar8,0);
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      FUN_1403f6a8c(*param_1);
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
  } while( true );
}



undefined4 FUN_1403f7d0c(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_1403f79fc(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_1403fb958(param_1,uVar7,*(int *)((longlong)param_1 + 0x94) - uVar11,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403f6a8c(*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_1403f7e3a;
        uVar4 = FUN_1403f790c(param_1,uVar8);
      }
      else {
        uVar4 = FUN_1403f776c(param_1,uVar8);
      }
      *(undefined4 *)(param_1 + 0x11) = uVar4;
    }
LAB_1403f7e3a:
    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_1403f8027:
      *(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_140473440)[bVar5] * 4 + 0x4c0);
      *psVar2 = *psVar2 + 1;
      if (uVar10 < 0x100) {
        bVar5 = (&DAT_140473240)[uVar10];
      }
      else {
        bVar5 = (&DAT_140473340)[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_1403f8027;
      }
      *(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_1403fb958(param_1,uVar6,*(int *)((longlong)param_1 + 0x94) - uVar11,0);
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      FUN_1403f6a8c(*param_1);
      if (*(int *)(*param_1 + 0x18) == 0) {
        return 0;
      }
    }
  } while( true );
}



undefined4 FUN_1403f812c(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_1403f815e:
  do {
    uVar13 = *(uint *)((longlong)param_1 + 0x9c);
    if (uVar13 < 0x106) {
      FUN_1403f79fc(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_1403fb958(param_1,uVar10,*(int *)((longlong)param_1 + 0x94) - uVar13,param_2 == 4);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403f6a8c(*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_1403f827a;
          uVar7 = FUN_1403f790c(param_1,uVar15);
        }
        else {
          uVar7 = FUN_1403f776c(param_1,uVar15);
        }
        *(undefined4 *)(param_1 + 0x11) = uVar7;
      }
LAB_1403f827a:
      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_1403f815e;
      }
      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_1403fb958(param_1,uVar9,*(int *)((longlong)param_1 + 0x94) - uVar13,0);
        *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
        FUN_1403f6a8c(*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_140473440)[bVar8] * 4 + 0x4c0);
      *psVar2 = *psVar2 + 1;
      if (uVar12 < 0x100) {
        bVar8 = (&DAT_140473240)[uVar12];
      }
      else {
        bVar8 = (&DAT_140473340)[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_1403f815e;
      uVar13 = *(uint *)((longlong)param_1 + 0x84);
      uVar9 = uVar10;
      if (-1 < (int)uVar13) {
        uVar9 = (ulonglong)uVar13 + param_1[10];
      }
      FUN_1403fb958(param_1,uVar9,*(int *)((longlong)param_1 + 0x94) - uVar13,0);
      *(undefined4 *)((longlong)param_1 + 0x84) = *(undefined4 *)((longlong)param_1 + 0x94);
      FUN_1403f6a8c(*param_1);
      iVar3 = *(int *)(*param_1 + 0x18);
    }
    if (iVar3 == 0) {
      return 0;
    }
  } while( true );
}



undefined8 FUN_1403f862c(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_1403f9f48();
    }
    else {
      uVar2 = FUN_1403f93bc(0,0,0);
    }
    *(undefined4 *)(param_1 + 0x4c) = uVar2;
    *(undefined4 *)(lVar1 + 0x40) = 0;
    FUN_1403fb2a8(lVar1);
    FUN_1403f76bc(lVar1);
    uVar3 = 0;
  }
  return uVar3;
}



undefined4 FUN_1403f86ec(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_1404709a8)[(longlong)*(int *)(lVar1 + 0xac) * 2] !=
           (&PTR_FUN_1404709a8)[lVar3 * 2]) && (*(int *)(param_1 + 0xc) != 0)) {
        uVar2 = FUN_1403f6b0c(param_1,1);
      }
      if (*(uint *)(lVar1 + 0xac) != param_2) {
        *(uint *)(lVar1 + 0xac) = param_2;
        *(uint *)(lVar1 + 0xa8) = (uint)*(ushort *)(&DAT_1404709a2 + lVar3 * 0x10);
        *(uint *)(lVar1 + 0xb4) = (uint)*(ushort *)(&DAT_1404709a0 + lVar3 * 0x10);
        *(uint *)(lVar1 + 0xb8) = (uint)*(ushort *)(&DAT_1404709a4 + lVar3 * 0x10);
        *(uint *)(lVar1 + 0xa4) = (uint)*(ushort *)(&DAT_1404709a6 + lVar3 * 0x10);
      }
      *(uint *)(lVar1 + 0xb0) = param_3;
      return uVar2;
    }
  }
  return 0xfffffffe;
}



undefined8
FUN_1403f87ec(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_1403f8ac8;
      }
      pcVar4 = *(code **)(param_1 + 0x38);
      if (pcVar4 == (code *)0x0) {
        pcVar4 = FUN_1403f8ae8;
      }
      *(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_1403f862c(param_1);
            return uVar3;
          }
          *(undefined4 *)(plVar5 + 1) = 0x29a;
          *(char **)(param_1 + 0x20) = "insufficient memory";
          FUN_1403f735c(param_1);
        }
        return 0xfffffffc;
      }
    }
    uVar3 = 0xfffffffe;
  }
  return uVar3;
}



void FUN_1403f8a5c(void)

{
  FUN_1403f87ec();
  return;
}



void FUN_1403f8ac8(undefined8 param_1,int param_2,int param_3)

{
                    // WARNING: Could not recover jumptable at 0x0001403f8ace. Too many branches
                    // WARNING: Treating indirect jump as call
  malloc((ulonglong)(uint)(param_2 * param_3));
  return;
}



void FUN_1403f8ae8(undefined8 param_1,void *param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001403f8aeb. Too many branches
                    // WARNING: Treating indirect jump as call
  free(param_2);
  return;
}



void FUN_1403f8af4(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_1403f8bae:
  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_1403f8cb5;
    }
    if ((uVar9 & 0x40) != 0) {
      if ((uVar9 & 0x20) == 0) {
        pcVar11 = "invalid literal/length code";
        goto LAB_1403f8ee0;
      }
      *puVar5 = 0xb;
      goto LAB_1403f8eec;
    }
    uVar9 = ((1 << ((byte)uVar9 & 0x1f)) - 1U & uVar14) + (uVar9 >> 0x10);
  }
  puVar19[1] = (char)(uVar9 >> 0x10);
  puVar20 = puVar19 + 1;
  goto LAB_1403f8ea4;
LAB_1403f8cb5:
  uVar14 = uVar14 >> ((byte)(uVar9 >> 8) & 0x1f);
  uVar24 = uVar24 - (uVar9 >> 8 & 0xff);
  if ((uVar9 & 0x10) != 0) goto code_r0x0001403f8cd2;
  if ((uVar9 & 0x40) != 0) {
    pcVar11 = "invalid distance code";
    goto LAB_1403f8ee0;
  }
  uVar9 = *(uint *)(lVar6 + (ulonglong)
                            (((1 << ((byte)uVar9 & 0x1f)) - 1U & uVar14) + (uVar9 >> 0x10)) * 4);
  goto LAB_1403f8cb5;
code_r0x0001403f8cd2:
  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_1403f8ea4;
  }
  uVar9 = uVar10 - uVar9;
  if (uVar3 < uVar9) {
    pcVar11 = "invalid distance too far back";
    pbVar16 = pbVar15;
LAB_1403f8ee0:
    param_1[4] = (longlong)pcVar11;
    *puVar5 = 0x1b;
LAB_1403f8eec:
    *(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_1403f8ddc:
      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_1403f8ddc;
      }
    }
  }
  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_1403f8ddc;
    }
  }
  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_1403f8ea4:
  pbVar16 = pbVar15;
  puVar19 = puVar20;
  if ((pbVar27 <= pbVar15) || (puVar18 + ((int)lVar8 - 0x101) <= puVar20)) goto LAB_1403f8eec;
  goto LAB_1403f8bae;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8
FUN_1403f8f54(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_1405d84f0 ^ (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_1403f9022:
    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_1403f9391;
      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_14047090e;
        puVar24 = &UNK_1404708ce;
      }
      else {
        iVar13 = -1;
        local_b0 = &DAT_140470b90;
        puVar24 = &DAT_140470b50;
      }
      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_1403f9174:
        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_1403f923e;
        if (uVar15 != uVar10) {
          uVar15 = (uint)param_2[*(ushort *)(param_6 + uVar9 * 2)];
          goto LAB_1403f923e;
        }
        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_1403f9022;
      }
LAB_1403f9165:
      uVar4 = 1;
    }
    else {
LAB_1403f9391:
      uVar4 = 0xffffffff;
    }
  }
  return uVar4;
LAB_1403f923e:
  if (uVar16 < uVar15) {
    uVar19 = uVar23 & uVar19;
    uVar20 = (ulonglong)uVar19;
    if (uVar19 == local_c4) goto LAB_1403f9174;
    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_1403f9174;
    }
    goto LAB_1403f9165;
  }
  goto LAB_1403f9174;
}



uint FUN_1403f93bc(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_1403f969c(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_1403f9748(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_140470bd0 + (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_140470fd0 + (ulonglong)(byte)(param_1 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(param_1 >> 8) * 4) ^
              *(uint *)(&DAT_140470bd0 + (ulonglong)(param_1 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404717d0 + (ulonglong)(param_1 & 0xff) * 4) ^ puVar1[1];
      uVar3 = *(uint *)(&DAT_140470fd0 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_140470bd0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404717d0 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[2];
      uVar3 = *(uint *)(&DAT_140470fd0 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_140470bd0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404717d0 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[3];
      uVar3 = *(uint *)(&DAT_140470fd0 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_140470bd0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404717d0 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[4];
      uVar3 = *(uint *)(&DAT_140470fd0 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_140470bd0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404717d0 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[5];
      param_2 = puVar1 + 8;
      uVar4 = (ulonglong)((int)uVar4 - 0x20);
      uVar3 = *(uint *)(&DAT_140470fd0 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_140470bd0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404717d0 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[6];
      uVar3 = *(uint *)(&DAT_140470fd0 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
              *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
              *(uint *)(&DAT_140470bd0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
              *(uint *)(&DAT_1404717d0 + (ulonglong)(uVar3 & 0xff) * 4) ^ puVar1[7];
      param_1 = *(uint *)(&DAT_140470fd0 + (ulonglong)(byte)(uVar3 >> 0x10) * 4) ^
                *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(uVar3 >> 8) * 4) ^
                *(uint *)(&DAT_140470bd0 + (ulonglong)(uVar3 >> 0x18) * 4) ^
                *(uint *)(&DAT_1404717d0 + (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_140470fd0 + (ulonglong)(byte)(param_1 >> 0x10) * 4) ^
                *(uint *)(&DAT_1404713d0 + (ulonglong)(byte)(param_1 >> 8) * 4) ^
                *(uint *)(&DAT_140470bd0 + (ulonglong)(param_1 >> 0x18) * 4) ^
                *(uint *)(&DAT_1404717d0 + (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_140470bd0 + (ulonglong)(byte)((byte)uVar3 ^ (byte)param_1) * 4) ^
              param_1 >> 8;
    uVar3 = (int)uVar4 - 1;
    uVar4 = (ulonglong)uVar3;
  }
  return ~param_1;
}



int FUN_1403f9a58(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_140471bd0 + ((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_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[2];
      uVar4 = *(uint *)(&DAT_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[3];
      uVar4 = *(uint *)(&DAT_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[4];
      uVar4 = *(uint *)(&DAT_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[5];
      uVar4 = *(uint *)(&DAT_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[6];
      puVar2 = puVar1 + 8;
      uVar6 = (ulonglong)((int)uVar6 - 0x20);
      uVar4 = *(uint *)(&DAT_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (ulonglong)(uVar4 & 0xff) * 4) ^ puVar1[7];
      uVar4 = *(uint *)(&DAT_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (ulonglong)(uVar4 & 0xff) * 4) ^ *puVar2;
      uVar4 = *(uint *)(&DAT_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (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_1404723d0 + (ulonglong)(byte)(uVar4 >> 0x10) * 4) ^
              *(uint *)(&DAT_140471fd0 + (ulonglong)(byte)(uVar4 >> 8) * 4) ^
              *(uint *)(&DAT_1404727d0 + (ulonglong)(uVar4 >> 0x18) * 4) ^
              *(uint *)(&DAT_140471bd0 + (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_140471bd0 + ((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_1403f9df8(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_1403f9e18(undefined4 *param_1,longlong param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar2 = param_2 - (longlong)param_1;
  lVar3 = 0x20;
  do {
    uVar1 = FUN_1403f9df8(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_1403f9e58(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_1405d84f0 ^ (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_1403f9e18(local_98,local_118);
    FUN_1403f9e18(local_118,local_98);
    do {
      FUN_1403f9e18(local_98,local_118);
      if ((param_3 & 1) != 0) {
        param_1 = FUN_1403f9df8(local_98,param_1);
      }
      if ((int)param_3 >> 1 == 0) break;
      FUN_1403f9e18(local_118,local_98);
      if (((int)param_3 >> 1 & 1U) != 0) {
        param_1 = FUN_1403f9df8(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_1403f9f48(undefined8 param_1,longlong param_2)

{
  undefined8 uVar1;
  
  if (param_2 == 0) {
    return 0;
  }
  uVar1 = FUN_1403f9748();
  return uVar1;
}



void FUN_1403f9f68(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_1403f9fe8(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_1403fa0a8(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_1403fa37c;
          }
          iVar3 = 6;
        }
        iVar9 = 3;
      }
LAB_1403fa37c:
      puVar5 = puVar5 + 2;
      lVar4 = lVar4 + -1;
      uVar7 = uVar8;
    } while (lVar4 != 0);
  }
  return;
}



void FUN_1403fa3a8(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_1403fa894:
                *(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_1403fa894;
              }
              *(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_1403fa894;
            }
            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_1403fa908(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_140472d20;
    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_1403fa3a8(param_1,param_1 + 0xbc,param_2 + -1);
  FUN_1403fa3a8(param_1,param_1 + 0x9b0,param_3 + -1);
  return;
}



void FUN_1403fac38(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_1403fafa8:
        *(int *)(param_1 + 0x1714) = iVar3;
      }
      else {
        bVar2 = (&DAT_140473440)[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_140472bd0 + (ulonglong)bVar2 * 4);
        if (iVar4 != 0) {
          uVar11 = (ushort)bVar1 - (short)*(undefined4 *)(&DAT_140473540 + (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_140473240)[uVar13];
        }
        else {
          bVar1 = (&DAT_140473240)[(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_140472c50 + uVar6 * 4);
        if (iVar3 != 0) {
          uVar12 = (short)uVar13 - (short)*(undefined4 *)(&DAT_1404735c0 + 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_1403fafa8;
        }
      }
    } 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_1403fb088(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_1403fb0f8(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_1403fb118(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_1403fb198(longlong param_1)

{
  undefined1 uVar1;
  
  if (*(int *)(param_1 + 0x1714) < 9) {
    if (*(int *)(param_1 + 0x1714) < 1) goto LAB_1403fb1df;
    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_1403fb1df:
  *(undefined2 *)(param_1 + 0x1710) = 0;
  *(undefined4 *)(param_1 + 0x1714) = 0;
  return;
}



void FUN_1403fb1f8(longlong param_1,undefined1 *param_2,int param_3,int param_4)

{
  byte bVar1;
  
  FUN_1403fb198();
  *(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_1403fb2a8(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x170c) = 8;
  *(longlong *)(param_1 + 0xb40) = param_1 + 0xbc;
  *(undefined ***)(param_1 + 0xb50) = &PTR_DAT_1405da270;
  *(longlong *)(param_1 + 0xb58) = param_1 + 0x9b0;
  *(undefined ***)(param_1 + 0xb68) = &PTR_DAT_1405da290;
  *(longlong *)(param_1 + 0xb70) = param_1 + 0xaa4;
  *(undefined **)(param_1 + 0xb80) = &DAT_1405da2b0;
  *(undefined2 *)(param_1 + 0x1710) = 0;
  *(undefined4 *)(param_1 + 0x1714) = 0;
  FUN_1403f9f68();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403fb328(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_1405d84f0 ^ (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_1403fb0f8();
        *(undefined2 *)(param_1 + lVar5 * 4) = uVar2;
      }
      lVar5 = lVar5 + 1;
    } while (lVar5 <= lVar4);
  }
  return;
}



void FUN_1403fb3c8(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_1403f9fe8(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_1403f9fe8(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_1403f9fe8(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_1403fa0a8();
  FUN_1403fb328(lVar2,iVar7,param_1 + 0xb88);
  return;
}



int FUN_1403fb608(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_1403fb3c8(param_1,param_1 + 0xb70);
  iVar2 = 0x12;
  lVar1 = 0x12;
  do {
    if (*(short *)(param_1 + 0xaa6 + (ulonglong)(byte)(&DAT_140472d20)[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_1403fb698(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_1403fb1f8(param_1,param_2,param_3,1);
  return;
}



void FUN_1403fb738(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_1403fb118(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_1403fb118(param_1);
  }
  *(undefined4 *)(param_1 + 0x170c) = 7;
  return;
}



void FUN_1403fb958(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_1403fb088();
    }
    FUN_1403fb3c8(param_1,param_1 + 0x168);
    FUN_1403fb3c8(param_1,param_1 + 0x16b);
    iVar2 = FUN_1403fb608(param_1);
    uVar4 = (int)param_1[0x2e0] + 10U >> 3;
    uVar5 = *(int *)((longlong)param_1 + 0x1704) + 10U >> 3;
    if (uVar4 < uVar5) goto LAB_1403fb9ed;
  }
  uVar4 = uVar5;
  uVar5 = uVar4;
LAB_1403fb9ed:
  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_1404731c0;
      puVar6 = &DAT_140472d40;
    }
    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_1403fa908(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_1403fac38(param_1,puVar6,plVar7);
  }
  else {
    FUN_1403fb698(param_1,param_2,param_3,param_4);
  }
  FUN_1403f9f68(param_1);
  if (param_4 != 0) {
    FUN_1403fb198();
  }
  return;
}



int __thiscall std::basic_streambuf<>::sync(basic_streambuf<> *this)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001403fbb8c. 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 0x0001403fbb92. 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 0x0001403fbb98. Too many branches
                    // WARNING: Treating indirect jump as call
  _Lock(this);
  return;
}



int __thiscall std::basic_streambuf<>::sync(basic_streambuf<> *this)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001403fbb9e. 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 0x0001403fbba4. 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 0x0001403fbbaa. 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 0x0001403fbbb0. 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 0x0001403fbbb6. 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 0x0001403fbbbc. 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 0x0001403fbbc2. 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 0x0001403fbbc8. 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 0x0001403fbbce. Too many branches
                    // WARNING: Treating indirect jump as call
  imbue(this,param_1);
  return;
}



__int64 __thiscall std::basic_streambuf<>::showmanyc(basic_streambuf<> *this)

{
  __int64 _Var1;
  
                    // WARNING: Could not recover jumptable at 0x0001403fbbd4. Too many branches
                    // WARNING: Treating indirect jump as call
  _Var1 = showmanyc(this);
  return _Var1;
}



ushort __thiscall std::basic_streambuf<>::uflow(basic_streambuf<> *this)

{
  ushort uVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001403fbbda. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar1 = uflow(this);
  return uVar1;
}



__int64 __thiscall
std::basic_streambuf<>::xsgetn(basic_streambuf<> *this,wchar_t *param_1,__int64 param_2)

{
  __int64 _Var1;
  
                    // WARNING: Could not recover jumptable at 0x0001403fbbe0. 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,wchar_t *param_1,__int64 param_2)

{
  __int64 _Var1;
  
                    // WARNING: Could not recover jumptable at 0x0001403fbbe6. 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,wchar_t *param_1,__int64 param_2)

{
  basic_streambuf<> *pbVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001403fbbec. 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 0x0001403fbbf2. Too many branches
                    // WARNING: Treating indirect jump as call
  imbue(this,param_1);
  return;
}



// public: __cdecl std::_Mutex::_Mutex(enum std::_Uninitialized) __ptr64

_Mutex * __thiscall std::_Mutex::_Mutex(_Mutex *this,_Uninitialized param_1)

{
                    // 0x3fbbf8  1  ??0_Mutex@std@@QEAA@W4_Uninitialized@1@@Z
                    // 0x3fbbf8  2  ??4_Init_locks@std@@QEAAAEAV01@AEBV01@@Z
  return this;
}



int __cdecl memcmp(void *_Buf1,void *_Buf2,size_t _Size)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x0001403fbbfc. 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 0x0001403fbc02. Too many branches
                    // WARNING: Treating indirect jump as call
  __RTDynamicCast();
  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;
}



void thunk_FUN_1403fbcdc(__uint64 param_1)

{
  operator_new(param_1);
  return;
}



// Library Function - Single Match
//  void __cdecl `eh vector copy constructor iterator'(void * __ptr64,void * __ptr64,unsigned
// __int64,int,void (__cdecl*)(void * __ptr64,void * __ptr64),void (__cdecl*)(void * __ptr64))
// 
// Library: Visual Studio 2010 Release

void __cdecl
_eh_vector_copy_constructor_iterator_
          (void *param_1,void *param_2,__uint64 param_3,int param_4,
          _func_void_void_ptr_void_ptr *param_5,_func_void_void_ptr *param_6)

{
  int iVar1;
  
  for (iVar1 = 0; iVar1 < param_4; iVar1 = iVar1 + 1) {
    (*param_5)(param_1,param_2);
    param_1 = (void *)((longlong)param_1 + param_3);
    param_2 = (void *)((longlong)param_2 + param_3);
  }
  return;
}



void FUN_1403fbcdc(__uint64 param_1)

{
  operator_new(param_1);
  return;
}



void MiniDumpWriteDump(void)

{
                    // WARNING: Could not recover jumptable at 0x0001403fbcfc. Too many branches
                    // WARNING: Treating indirect jump as call
  MiniDumpWriteDump();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403fbd10(undefined8 param_1,undefined8 param_2)

{
  int iVar1;
  undefined1 auStack_b8 [32];
  undefined1 local_98 [40];
  int local_70;
  undefined1 local_60 [72];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  iVar1 = FUN_140404510(param_1,param_2,local_98);
  if ((iVar1 != 0) && (FUN_140405510(param_1,&DAT_140473668,local_98), 0 < local_70)) {
    FUN_140403800(param_1,"%s:%d: ",local_60);
    return;
  }
  FUN_1404036f0(param_1,&DAT_14047e238,0);
  return;
}



void FUN_1403fbda0(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_1403fbd10(param_1,1);
  FUN_1404037b0(param_1,param_2,&local_res18);
  FUN_140404260(param_1,2);
  FUN_140404210(param_1);
  return;
}



void FUN_1403fbe00(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  
  iVar1 = FUN_140402f40();
  if (iVar1 == 0) {
    FUN_1403fbda0(param_1,"stack overflow (%s)",param_3);
  }
  return;
}



undefined8 FUN_1403fbe40(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  int iVar1;
  
  iVar1 = FUN_140403b10();
  if (iVar1 != 0) {
    FUN_140403760(param_1,param_3);
    FUN_140403a20(param_1,0xfffffffe);
    iVar1 = FUN_1404032b0(param_1,0xffffffff);
    if (iVar1 != 0) {
      FUN_140403100(param_1,0xfffffffe);
      return 1;
    }
    FUN_1404030a0(param_1,0xfffffffd);
  }
  return 0;
}



undefined8 FUN_1403fbec0(undefined8 param_1,int param_2,undefined8 param_3)

{
  int iVar1;
  undefined8 uVar2;
  
  if (param_2 + 9999U < 10000) {
    iVar1 = FUN_140403090();
    param_2 = param_2 + 1 + iVar1;
  }
  uVar2 = FUN_1403fbe40(param_1,param_2,param_3);
  if ((int)uVar2 == 0) {
    return uVar2;
  }
  FUN_140403280(param_1,param_2);
  FUN_140403ed0(param_1,1,1);
  return 1;
}



void FUN_1403fbf40(longlong param_1)

{
  undefined8 uVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  int iVar4;
  int iVar5;
  
  if (1 < *(int *)(param_1 + 8)) {
    uVar1 = *(undefined8 *)(param_1 + 0x10);
    iVar4 = 1;
    uVar2 = FUN_140403580(uVar1,0xffffffff);
    iVar5 = -2;
    do {
      uVar3 = FUN_140403580(uVar1,iVar5);
      if (((*(int *)(param_1 + 8) - iVar4) + 1 < 10) && (uVar2 <= uVar3)) break;
      iVar4 = iVar4 + 1;
      uVar2 = uVar2 + uVar3;
      iVar5 = iVar5 + -1;
    } while (iVar4 < *(int *)(param_1 + 8));
    FUN_140404260(uVar1,iVar4);
    *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + (1 - iVar4);
  }
  return;
}



longlong * FUN_1403fbff0(longlong *param_1)

{
  if (*param_1 - (longlong)param_1 != 0x18) {
    FUN_1404036f0(param_1[2],param_1 + 3);
    *(int *)(param_1 + 1) = (int)param_1[1] + 1;
    *param_1 = (longlong)(param_1 + 3);
    FUN_1403fbf40(param_1);
    return param_1 + 3;
  }
  return param_1 + 3;
}



void FUN_1403fc050(longlong *param_1,undefined1 *param_2,longlong param_3)

{
  undefined1 uVar1;
  
  if (param_3 != 0) {
    do {
      param_3 = param_3 + -1;
      if ((param_1 + 0x43 <= (longlong *)*param_1) && (*param_1 - (longlong)param_1 != 0x18)) {
        FUN_1404036f0(param_1[2],param_1 + 3);
        *(int *)(param_1 + 1) = (int)param_1[1] + 1;
        *param_1 = (longlong)(param_1 + 3);
        FUN_1403fbf40(param_1);
      }
      uVar1 = *param_2;
      param_2 = param_2 + 1;
      *(undefined1 *)*param_1 = uVar1;
      *param_1 = *param_1 + 1;
    } while (param_3 != 0);
  }
  return;
}



void FUN_1403fc0f0(longlong *param_1)

{
  if (*param_1 - (longlong)param_1 != 0x18) {
    FUN_1404036f0(param_1[2],param_1 + 3);
    *(int *)(param_1 + 1) = (int)param_1[1] + 1;
    *param_1 = (longlong)(param_1 + 3);
  }
  FUN_140404260(param_1[2],(int)param_1[1]);
  *(undefined4 *)(param_1 + 1) = 1;
  return;
}



void FUN_1403fc140(longlong *param_1)

{
  longlong lVar1;
  void *_Dst;
  void *_Src;
  longlong lVar2;
  ulonglong local_res8;
  
  lVar1 = param_1[2];
  _Src = (void *)FUN_1404034e0(lVar1,0xffffffff,&local_res8);
  _Dst = (void *)*param_1;
  if (local_res8 <= (ulonglong)((longlong)param_1 + (0x218 - (longlong)_Dst))) {
    memcpy(_Dst,_Src,local_res8);
    *param_1 = *param_1 + local_res8;
    FUN_1404030a0(lVar1,0xfffffffe);
    return;
  }
  lVar2 = (longlong)_Dst + (-0x18 - (longlong)param_1);
  if (lVar2 != 0) {
    FUN_1404036f0(param_1[2],param_1 + 3,lVar2);
    *(int *)(param_1 + 1) = (int)param_1[1] + 1;
    *param_1 = (longlong)(param_1 + 3);
    FUN_140403150(lVar1,0xfffffffe);
  }
  *(int *)(param_1 + 1) = (int)param_1[1] + 1;
  FUN_1403fbf40(param_1);
  return;
}



void FUN_1403fc200(longlong param_1,longlong *param_2)

{
  param_2[2] = param_1;
  *(undefined4 *)(param_2 + 1) = 0;
  *param_2 = (longlong)(param_2 + 3);
  return;
}



int * FUN_1403fc220(undefined8 param_1,int *param_2,size_t *param_3)

{
  int iVar1;
  size_t sVar2;
  int *piVar3;
  
  if (*param_2 != 0) {
    *param_2 = 0;
    *param_3 = 1;
    return (int *)&DAT_14047e244;
  }
  iVar1 = feof(*(FILE **)(param_2 + 2));
  if (iVar1 != 0) {
    return (int *)0x0;
  }
  sVar2 = fread(param_2 + 4,1,0x200,*(FILE **)(param_2 + 2));
  *param_3 = sVar2;
  piVar3 = (int *)0x0;
  if (sVar2 != 0) {
    piVar3 = param_2 + 4;
  }
  return piVar3;
}



undefined8 FUN_1403fc2b0(undefined8 param_1,undefined8 param_2,undefined4 param_3)

{
  int *piVar1;
  char *pcVar2;
  longlong lVar3;
  
  piVar1 = _errno();
  pcVar2 = strerror(*piVar1);
  lVar3 = FUN_1404034e0(param_1,param_3,0);
  FUN_140403800(param_1,"cannot %s %s: %s",param_2,lVar3 + 1,pcVar2);
  FUN_140403100(param_1,param_3);
  return 6;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1403fc330(undefined8 param_1,char *param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  ulonglong uVar4;
  undefined8 uVar5;
  int *piVar6;
  char *pcVar7;
  longlong lVar8;
  undefined1 auStack_268 [32];
  char *local_248;
  undefined4 local_238 [2];
  FILE *local_230;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_268;
  iVar1 = FUN_140403090();
  iVar1 = iVar1 + 1;
  local_238[0] = 0;
  if (param_2 == (char *)0x0) {
    FUN_1404036f0(param_1,"=stdin",6);
    local_230 = __iob_func();
  }
  else {
    FUN_140403800(param_1,&DAT_1404736a8,param_2);
    local_230 = fopen(param_2,"r");
    if (local_230 == (FILE *)0x0) {
      uVar4 = FUN_1403fc2b0(param_1,&DAT_1404b7eec,iVar1);
      return uVar4;
    }
  }
  iVar2 = getc(local_230);
  if (iVar2 == 0x23) {
    local_238[0] = 1;
    do {
      iVar2 = getc(local_230);
      if (iVar2 == -1) goto LAB_1403fc470;
    } while (iVar2 != 10);
    iVar2 = getc(local_230);
  }
  if ((iVar2 == 0x1b) && (param_2 != (char *)0x0)) {
    local_230 = freopen(param_2,"rb",local_230);
    if (local_230 == (FILE *)0x0) {
      uVar4 = FUN_1403fc2b0(param_1,"reopen",iVar1);
      return uVar4;
    }
    do {
      iVar2 = getc(local_230);
      if (iVar2 == -1) break;
    } while (iVar2 != 0x1b);
    local_238[0] = 0;
  }
LAB_1403fc470:
  ungetc(iVar2,local_230);
  uVar5 = FUN_1404034e0(param_1,0xffffffff,0);
  uVar3 = FUN_140403fc0(param_1,FUN_1403fc220,local_238,uVar5);
  uVar4 = (ulonglong)uVar3;
  iVar2 = ferror(local_230);
  if (param_2 != (char *)0x0) {
    fclose(local_230);
  }
  if (iVar2 == 0) {
    FUN_140403100(param_1,iVar1);
  }
  else {
    FUN_1404030a0();
    piVar6 = _errno();
    pcVar7 = strerror(*piVar6);
    lVar8 = FUN_1404034e0(param_1,iVar1,0);
    local_248 = pcVar7;
    FUN_140403800(param_1,"cannot %s %s: %s",&DAT_14047369c,lVar8 + 1);
    FUN_140403100(param_1,iVar1);
    uVar4 = 6;
  }
  return uVar4;
}



void FUN_1403fc580(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 local_18;
  undefined8 local_10;
  
  local_18 = param_2;
  local_10 = param_3;
  FUN_140403fc0(param_1,&LAB_1403fc560,&local_18);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403fc5b0(undefined8 param_1,int param_2,undefined8 param_3)

{
  int iVar1;
  longlong lVar2;
  char *pcVar3;
  undefined *puVar4;
  undefined1 uVar5;
  undefined1 auStack_e8 [32];
  undefined8 local_c8;
  undefined1 local_b8 [8];
  undefined *local_b0;
  char *local_a8;
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_e8;
  iVar1 = FUN_140404510(param_1,0,local_b8);
  uVar5 = iVar1 == 0;
  if ((bool)uVar5) {
    FUN_1403fbda0(param_1,"bad argument #%d (%s)",param_2,param_3);
  }
  else {
    FUN_140405510(param_1,&DAT_140473710,local_b8);
    lVar2 = 7;
    pcVar3 = "method";
    do {
      if (lVar2 == 0) break;
      lVar2 = lVar2 + -1;
      uVar5 = *local_a8 == *pcVar3;
      local_a8 = local_a8 + 1;
      pcVar3 = pcVar3 + 1;
    } while ((bool)uVar5);
    if (((bool)uVar5) && (param_2 = param_2 + -1, param_2 == 0)) {
      FUN_1403fbda0(param_1,"calling \'%s\' on bad self (%s)",local_b0,param_3);
    }
    else {
      puVar4 = &DAT_1404736e0;
      if (local_b0 != (undefined *)0x0) {
        puVar4 = local_b0;
      }
      local_c8 = param_3;
      local_b0 = puVar4;
      FUN_1403fbda0(param_1,"bad argument #%d to \'%s\' (%s)",param_2);
    }
  }
  return;
}



void FUN_1403fc6b0(undefined8 param_1,undefined4 param_2,undefined4 param_3)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined4 uVar3;
  
  uVar1 = FUN_1404032e0(param_1,param_3);
  uVar3 = FUN_1404032b0(param_1,param_2);
  uVar2 = FUN_1404032e0(param_1,uVar3);
  uVar1 = FUN_140403800(param_1,"%s expected, got %s",uVar1,uVar2);
  FUN_1403fc5b0(param_1,param_2,uVar1);
  return;
}



void FUN_1403fc720(undefined8 param_1,undefined4 param_2,int param_3)

{
  int iVar1;
  
  iVar1 = FUN_1404032b0();
  if (iVar1 != param_3) {
    FUN_1403fc6b0(param_1,param_2,param_3);
  }
  return;
}



void FUN_1403fc760(undefined8 param_1,undefined4 param_2)

{
  int iVar1;
  
  iVar1 = FUN_1404032b0();
  if (iVar1 == -1) {
    FUN_1403fc5b0(param_1,param_2,"value expected");
  }
  return;
}



longlong FUN_1403fc7a0(undefined8 param_1,undefined4 param_2)

{
  undefined4 uVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  
  lVar2 = FUN_1404034e0();
  if (lVar2 == 0) {
    uVar3 = FUN_1404032e0(param_1,4);
    uVar1 = FUN_1404032b0(param_1,param_2);
    uVar4 = FUN_1404032e0(param_1,uVar1);
    uVar3 = FUN_140403800(param_1,"%s expected, got %s",uVar3,uVar4);
    FUN_1403fc5b0(param_1,param_2,uVar3);
  }
  return lVar2;
}



char * FUN_1403fc830(undefined8 param_1,undefined4 param_2,char *param_3,longlong *param_4)

{
  char cVar1;
  int iVar2;
  ulonglong uVar3;
  char *pcVar4;
  
  iVar2 = FUN_1404032b0();
  if (iVar2 < 1) {
    if (param_4 != (longlong *)0x0) {
      if (param_3 == (char *)0x0) {
        *param_4 = 0;
      }
      else {
        uVar3 = 0xffffffffffffffff;
        pcVar4 = param_3;
        do {
          if (uVar3 == 0) break;
          uVar3 = uVar3 - 1;
          cVar1 = *pcVar4;
          pcVar4 = pcVar4 + 1;
        } while (cVar1 != '\0');
        *param_4 = ~uVar3 - 1;
      }
    }
  }
  else {
    param_3 = (char *)FUN_1403fc7a0(param_1,param_2,param_4);
  }
  return param_3;
}



double FUN_1403fc8b0(undefined8 param_1,undefined4 param_2)

{
  int iVar1;
  double dVar2;
  
  dVar2 = (double)FUN_140403440();
  if (dVar2 != 0.0) {
    return dVar2;
  }
  iVar1 = FUN_140403330(param_1,param_2);
  if (iVar1 == 0) {
    FUN_1403fc6b0(param_1,param_2,3);
  }
  return dVar2;
}



undefined8 FUN_1403fc920(undefined8 param_1,undefined4 param_2,undefined8 param_3)

{
  int iVar1;
  undefined8 uVar2;
  
  iVar1 = FUN_1404032b0();
  if (iVar1 < 1) {
    return param_3;
  }
  uVar2 = FUN_1403fc8b0(param_1,param_2);
  return uVar2;
}



longlong FUN_1403fc970(undefined8 param_1,undefined4 param_2)

{
  int iVar1;
  longlong lVar2;
  
  lVar2 = FUN_140403480();
  if ((lVar2 == 0) && (iVar1 = FUN_140403330(param_1,param_2), iVar1 == 0)) {
    FUN_1403fc6b0(param_1,param_2,3);
  }
  return lVar2;
}



longlong FUN_1403fc9c0(undefined8 param_1,undefined4 param_2,longlong param_3)

{
  int iVar1;
  
  iVar1 = FUN_1404032b0();
  if (0 < iVar1) {
    param_3 = FUN_140403480(param_1,param_2);
    if (param_3 == 0) {
      iVar1 = FUN_140403330(param_1,param_2);
      if (iVar1 == 0) {
        FUN_1403fc6b0(param_1,param_2,3);
      }
    }
  }
  return param_3;
}



ulonglong FUN_1403fca30(undefined8 param_1,ulonglong param_2,longlong param_3,undefined8 *param_4)

{
  char cVar1;
  char cVar2;
  int iVar3;
  char *pcVar4;
  undefined8 uVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  
  uVar7 = param_2;
  if ((param_3 == 0) || (iVar3 = FUN_1404032b0(), uVar7 = param_2 & 0xffffffff, 0 < iVar3)) {
    param_3 = FUN_1403fc7a0(param_1,uVar7,0);
  }
  pcVar4 = (char *)*param_4;
  uVar7 = 0;
  uVar8 = uVar7;
  do {
    if (pcVar4 == (char *)0x0) {
      uVar5 = FUN_140403800(param_1,"invalid option \'%s\'",param_3);
      uVar7 = FUN_1403fc5b0(param_1,param_2 & 0xffffffff,uVar5);
      return uVar7;
    }
    lVar6 = param_3 - (longlong)pcVar4;
    do {
      cVar1 = *pcVar4;
      cVar2 = pcVar4[lVar6];
      if (cVar1 != cVar2) break;
      pcVar4 = pcVar4 + 1;
    } while (cVar2 != '\0');
    if (cVar1 == cVar2) {
      return uVar8;
    }
    pcVar4 = (char *)param_4[uVar7 + 1];
    uVar7 = uVar7 + 1;
    uVar8 = (ulonglong)((int)uVar8 + 1);
  } while( true );
}



undefined8 FUN_1403fcaf0(undefined8 param_1)

{
  int iVar1;
  char *_Str;
  FILE *pFVar2;
  undefined8 uVar3;
  int iVar4;
  
  iVar1 = FUN_140403090();
  FUN_1404039b0(param_1,0xffffd8ee,"tostring");
  iVar4 = 1;
  if (0 < iVar1) {
    do {
      FUN_140403280(param_1,0xffffffff);
      FUN_140403280(param_1,iVar4);
      FUN_140403ed0(param_1,1,1);
      _Str = (char *)FUN_1404034e0(param_1,0xffffffff,0);
      if (_Str == (char *)0x0) {
        uVar3 = FUN_1403fbda0(param_1,"\'tostring\' must return a string to \'print\'");
        return uVar3;
      }
      if (1 < iVar4) {
        pFVar2 = __iob_func();
        fputs("\t",pFVar2 + 1);
      }
      pFVar2 = __iob_func();
      fputs(_Str,pFVar2 + 1);
      FUN_1404030a0(param_1);
      iVar4 = iVar4 + 1;
    } while (iVar4 <= iVar1);
  }
  pFVar2 = __iob_func();
  fputs("\n",pFVar2 + 1);
  return 0;
}



undefined8 FUN_1403fcbf0(undefined8 param_1)

{
  int iVar1;
  ulong uVar2;
  byte *_Str;
  undefined8 uVar3;
  byte *local_res10;
  
  iVar1 = FUN_1403fc9c0(param_1,2,10);
  if (iVar1 == 10) {
    FUN_1403fc760();
    iVar1 = FUN_140403330(param_1,1);
    if (iVar1 != 0) {
      uVar3 = FUN_140403440(param_1,1);
      FUN_1404036b0(param_1,uVar3);
      return 1;
    }
  }
  else {
    _Str = (byte *)FUN_1403fc7a0(param_1,1,0);
    if ((iVar1 < 2) || (0x24 < iVar1)) {
      FUN_1403fc5b0(param_1,2,"base out of range");
    }
    uVar2 = strtoul((char *)_Str,(char **)&local_res10,iVar1);
    if (_Str != local_res10) {
      iVar1 = isspace((uint)*local_res10);
      while (iVar1 != 0) {
        local_res10 = local_res10 + 1;
        iVar1 = isspace((uint)*local_res10);
      }
      if (*local_res10 == 0) {
        FUN_1404036b0(param_1,(double)uVar2);
        return 1;
      }
    }
  }
  FUN_140403690(param_1);
  return 1;
}



void FUN_1403fcd20(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_1403fc9c0(param_1,2,1);
  FUN_1404030a0(param_1,1);
  iVar2 = FUN_140403360(param_1,1);
  if ((iVar2 != 0) && (0 < iVar1)) {
    FUN_1403fbd10(param_1,iVar1);
    FUN_140403280(param_1,1);
    FUN_140404260(param_1,2);
  }
  FUN_140404210(param_1);
  return;
}



undefined8 FUN_1403fcda0(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fc760(param_1,1);
  iVar1 = FUN_140403b10(param_1,1);
  if (iVar1 == 0) {
    FUN_140403690();
    return 1;
  }
  FUN_1403fbe40(param_1,1,"__metatable");
  return 1;
}



undefined8 FUN_1403fce00(undefined8 param_1)

{
  int iVar1;
  
  iVar1 = FUN_1404032b0(param_1,2);
  FUN_1403fc720(param_1,1,5);
  if ((iVar1 != 0) && (iVar1 != 5)) {
    FUN_1403fc5b0(param_1,2,"nil or table expected");
  }
  iVar1 = FUN_1403fbe40(param_1,1,"__metatable");
  if (iVar1 != 0) {
    FUN_1403fbda0(param_1,"cannot change a protected metatable");
  }
  FUN_1404030a0(param_1,2);
  FUN_140403d70(param_1,1);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1403fcea0(undefined8 param_1,int param_2)

{
  int iVar1;
  int iVar2;
  undefined1 auStack_b8 [32];
  undefined1 local_98 [128];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  iVar1 = FUN_1404032b0(param_1,1);
  if (iVar1 == 6) {
    FUN_140403280();
  }
  else {
    if (param_2 == 0) {
      iVar1 = FUN_1403fc970(param_1);
    }
    else {
      iVar1 = FUN_1403fc9c0(param_1,1,1);
    }
    if (iVar1 < 0) {
      FUN_1403fc5b0(param_1,1,"level must be non-negative");
    }
    iVar2 = FUN_140404510(param_1,iVar1,local_98);
    if (iVar2 == 0) {
      FUN_1403fc5b0(param_1,1,"invalid level");
    }
    FUN_140405510(param_1,&DAT_140473c3c,local_98);
    iVar2 = FUN_1404032b0(param_1,0xffffffff);
    if (iVar2 == 0) {
      FUN_1403fbda0(param_1,"no function environment for tail call at level %d",iVar1);
    }
  }
  return;
}



undefined8 FUN_1403fcf90(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fcea0(param_1,1);
  iVar1 = FUN_140403300(param_1,0xffffffff);
  if (iVar1 != 0) {
    FUN_140403280(param_1,0xffffd8ee);
    return 1;
  }
  FUN_140403b70(param_1,0xffffffff);
  return 1;
}



undefined8 FUN_1403fcfe0(undefined8 param_1)

{
  int iVar1;
  double dVar2;
  
  FUN_1403fc720(param_1,2,5);
  FUN_1403fcea0(param_1,0);
  FUN_140403280(param_1,2);
  iVar1 = FUN_140403330(param_1,1);
  if ((iVar1 != 0) && (dVar2 = (double)FUN_140403440(param_1,1), dVar2 == 0.0)) {
    FUN_140403950(param_1);
    FUN_140403150(param_1,0xfffffffe);
    FUN_140403e30(param_1,0xfffffffe);
    return 0;
  }
  iVar1 = FUN_140403300(param_1,0xfffffffe);
  if ((iVar1 != 0) || (iVar1 = FUN_140403e30(param_1,0xfffffffe), iVar1 == 0)) {
    FUN_1403fbda0(param_1,"\'setfenv\' cannot change environment of given object");
  }
  return 1;
}



undefined8 FUN_1403fd0a0(undefined8 param_1)

{
  undefined4 uVar1;
  
  FUN_1403fc760(param_1,1);
  FUN_1403fc760(param_1,2);
  uVar1 = FUN_1404033a0(param_1,1,2);
  FUN_140403910(param_1,uVar1);
  return 1;
}



undefined8 FUN_1403fd0f0(undefined8 param_1)

{
  FUN_1403fc720(param_1,1,5);
  FUN_1403fc760(param_1,2);
  FUN_1404030a0(param_1,2);
  FUN_140403a20(param_1,1);
  return 1;
}



undefined8 FUN_1403fd140(undefined8 param_1)

{
  FUN_1403fc720(param_1,1,5);
  FUN_1403fc760(param_1,2);
  FUN_1403fc760(param_1,3);
  FUN_1404030a0(param_1,3);
  FUN_140403c70(param_1,1);
  return 1;
}



undefined8 FUN_1403fd1a0(undefined8 param_1)

{
  int iVar1;
  
  iVar1 = FUN_140404070(param_1,3);
  FUN_1404036d0(param_1,(longlong)iVar1);
  return 1;
}



undefined8 FUN_1403fd1d0(undefined8 param_1)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  double dVar4;
  
  iVar1 = FUN_1403fca30(param_1,1,"collect",&PTR_DAT_1404738f0);
  uVar2 = FUN_1403fc9c0(param_1,2);
  iVar3 = FUN_140404070(param_1,*(undefined4 *)(&DAT_140473930 + (longlong)iVar1 * 4),uVar2);
  if (*(int *)(&DAT_140473930 + (longlong)iVar1 * 4) == 3) {
    iVar1 = FUN_140404070(param_1,4);
    dVar4 = (double)iVar1 * 0.0009765625 + (double)iVar3;
  }
  else {
    if (*(int *)(&DAT_140473930 + (longlong)iVar1 * 4) == 5) {
      FUN_140403910(param_1,iVar3);
      return 1;
    }
    dVar4 = (double)iVar3;
  }
  FUN_1404036b0(param_1,dVar4);
  return 1;
}



undefined8 FUN_1403fd2a0(undefined8 param_1)

{
  undefined4 uVar1;
  undefined8 uVar2;
  
  FUN_1403fc760(param_1,1);
  uVar1 = FUN_1404032b0(param_1,1);
  uVar2 = FUN_1404032e0(param_1,uVar1);
  FUN_140403760(param_1,uVar2);
  return 1;
}



undefined8 FUN_1403fd2e0(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fc720(param_1,1,5);
  FUN_1404030a0(param_1,2);
  iVar1 = FUN_140404220(param_1,1);
  if (iVar1 != 0) {
    return 2;
  }
  FUN_140403690(param_1);
  return 1;
}



undefined8 FUN_1403fd340(undefined8 param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  undefined8 local_res10 [3];
  
  uVar2 = FUN_1403fc7a0(param_1,1,local_res10);
  uVar3 = FUN_1403fc830(param_1,2,uVar2);
  iVar1 = FUN_1403fc580(param_1,uVar2,local_res10[0],uVar3);
  if (iVar1 == 0) {
    return 1;
  }
  FUN_140403690(param_1);
  FUN_140403150(param_1,0xfffffffe);
  return 2;
}



undefined8 FUN_1403fd3c0(undefined8 param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  uVar2 = FUN_1403fc830(param_1,1,0);
  iVar1 = FUN_1403fc330(param_1,uVar2);
  if (iVar1 == 0) {
    return 1;
  }
  FUN_140403690(param_1);
  FUN_140403150(param_1,0xfffffffe);
  return 2;
}



undefined8 FUN_1403fd420(undefined8 param_1,undefined8 param_2,undefined8 *param_3)

{
  int iVar1;
  undefined8 uVar2;
  
  FUN_1403fbe00(param_1,2,"too many nested functions");
  FUN_140403280(param_1,1);
  FUN_140403ed0(param_1,0,1);
  iVar1 = FUN_1404032b0(param_1,0xffffffff);
  if (iVar1 == 0) {
    *param_3 = 0;
    return 0;
  }
  iVar1 = FUN_140403360(param_1,0xffffffff);
  if (iVar1 != 0) {
    FUN_1404031b0(param_1,3);
    uVar2 = FUN_1404034e0(param_1,3,param_3);
    return uVar2;
  }
  FUN_1403fbda0(param_1,"reader function must return a string");
  return 0;
}



undefined8 FUN_1403fd4d0(undefined8 param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  uVar2 = FUN_1403fc830(param_1,2,"=(load)");
  FUN_1403fc720(param_1,1,6);
  FUN_1404030a0(param_1,3);
  iVar1 = FUN_140403fc0(param_1,FUN_1403fd420,0,uVar2);
  if (iVar1 == 0) {
    return 1;
  }
  FUN_140403690(param_1);
  FUN_140403150(param_1,0xfffffffe);
  return 2;
}



int FUN_1403fd560(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  
  uVar3 = FUN_1403fc830(param_1,1,0);
  iVar1 = FUN_140403090(param_1);
  iVar2 = FUN_1403fc330(param_1,uVar3);
  if (iVar2 != 0) {
    FUN_140404210(param_1);
  }
  FUN_140403ed0(param_1,0,0xffffffff);
  iVar2 = FUN_140403090(param_1);
  return iVar2 - iVar1;
}



void FUN_1403fd5d0(undefined8 param_1)

{
  undefined8 uVar1;
  int iVar2;
  
  FUN_1403fc760(param_1,1);
  iVar2 = FUN_1404034b0(param_1,1);
  if (iVar2 == 0) {
    uVar1 = FUN_1403fc830(param_1,2,"assertion failed!",0);
    FUN_1403fbda0(param_1,&DAT_1404765ac,uVar1);
    return;
  }
  FUN_140403090(param_1);
  return;
}



ulonglong FUN_1403fd630(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  ulonglong uVar4;
  uint uVar5;
  
  FUN_1403fc720(param_1,1,5);
  iVar1 = FUN_1403fc9c0(param_1,2,1);
  iVar2 = FUN_1404032b0(param_1,3);
  if (iVar2 < 1) {
    iVar2 = FUN_140403580(param_1,1);
  }
  else {
    iVar2 = FUN_1403fc970(param_1,3);
  }
  if (iVar2 < iVar1) {
    return 0;
  }
  uVar5 = (iVar2 - iVar1) + 1;
  if (((int)uVar5 < 1) || (iVar3 = FUN_140402f40(param_1,uVar5), iVar3 == 0)) {
    uVar4 = FUN_1403fbda0(param_1,"too many results to unpack");
  }
  else {
    FUN_140403a60(param_1,1,iVar1);
    while (iVar1 < iVar2) {
      iVar1 = iVar1 + 1;
      FUN_140403a60(param_1,1,iVar1);
    }
    uVar4 = (ulonglong)uVar5;
  }
  return uVar4;
}



int FUN_1403fd720(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  char *pcVar3;
  
  iVar1 = FUN_140403090();
  iVar2 = FUN_1404032b0(param_1,1);
  if (iVar2 == 4) {
    pcVar3 = (char *)FUN_1404034e0(param_1,1,0);
    if (*pcVar3 == '#') {
      FUN_1404036d0(param_1,(longlong)(iVar1 + -1));
      return 1;
    }
  }
  iVar2 = FUN_1403fc970(param_1,1);
  if (iVar2 < 0) {
    iVar2 = iVar2 + iVar1;
  }
  else if (iVar1 < iVar2) {
    iVar2 = iVar1;
  }
  if (iVar2 < 1) {
    FUN_1403fc5b0(param_1,1,"index out of range");
  }
  return iVar1 - iVar2;
}



void FUN_1403fd7d0(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fc760(param_1,1);
  iVar1 = FUN_140403090(param_1);
  iVar1 = FUN_140403f30(param_1,iVar1 + -1,0xffffffff,0);
  FUN_140403910(param_1,iVar1 == 0);
  FUN_140403150(param_1,1);
  FUN_140403090(param_1);
  return;
}



void FUN_1403fd830(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fc760(param_1,2);
  FUN_1404030a0(param_1,2);
  FUN_140403150(param_1,1);
  iVar1 = FUN_140403f30(param_1,0,0xffffffff,1);
  FUN_140403910(param_1,iVar1 == 0);
  FUN_1404031b0(param_1,1);
  FUN_140403090(param_1);
  return;
}



undefined8 FUN_1403fd8a0(undefined8 param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  undefined8 uVar4;
  char *pcVar5;
  
  FUN_1403fc760(param_1,1);
  iVar1 = FUN_1403fbec0(param_1,1,"__tostring");
  if (iVar1 == 0) {
    iVar1 = FUN_1404032b0(param_1,1);
    if (iVar1 != 0) {
      if (iVar1 == 1) {
        iVar1 = FUN_1404034b0(param_1,1);
        pcVar5 = "false";
        if (iVar1 != 0) {
          pcVar5 = "true";
        }
        FUN_140403760(param_1,pcVar5);
        return 1;
      }
      if (iVar1 != 3) {
        if (iVar1 != 4) {
          uVar3 = FUN_140403620();
          uVar2 = FUN_1404032b0(param_1,1);
          uVar4 = FUN_1404032e0(param_1,uVar2);
          FUN_140403800(param_1,"%s: %p",uVar4,uVar3);
          return 1;
        }
        FUN_140403280();
        return 1;
      }
      uVar3 = FUN_1404034e0(param_1,1,0);
      FUN_140403760(param_1,uVar3);
      return 1;
    }
    FUN_1404036f0(param_1,&DAT_140473d4c,3);
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403fd9c0(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined1 auStack_b8 [32];
  undefined1 local_98 [128];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  if (param_1 == param_2) {
    uVar2 = 0;
  }
  else {
    iVar1 = FUN_140404060(param_2);
    if (iVar1 == 0) {
      iVar1 = FUN_140404510(param_2,0,local_98);
      if (iVar1 < 1) {
        iVar1 = FUN_140403090(param_2);
        uVar2 = 1;
        if (iVar1 == 0) {
          uVar2 = 3;
        }
      }
      else {
        uVar2 = 2;
      }
    }
    else if (iVar1 == 1) {
      uVar2 = 1;
    }
    else {
      uVar2 = 3;
    }
  }
  return uVar2;
}



undefined8 FUN_1403fda60(undefined8 param_1)

{
  int iVar1;
  longlong lVar2;
  
  lVar2 = FUN_140403600(param_1,1);
  if (lVar2 == 0) {
    FUN_1403fc5b0(param_1,1,"coroutine expected");
  }
  iVar1 = FUN_1403fd9c0(param_1,lVar2);
  FUN_140403760(param_1,(&PTR_s_running_140473ae0)[iVar1]);
  return 1;
}



int FUN_1403fdad0(undefined8 param_1,undefined8 param_2,undefined4 param_3)

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_1403fd9c0();
  iVar2 = FUN_140402f40(param_2,param_3);
  if (iVar2 == 0) {
    FUN_1403fbda0(param_1,"too many arguments to resume");
  }
  if (iVar1 == 1) {
    FUN_140402fe0(param_1,param_2,param_3);
    FUN_140403040(param_1,param_2);
    iVar1 = FUN_140406790(param_2,param_3);
    if ((iVar1 == 0) || (iVar1 == 1)) {
      iVar2 = FUN_140403090(param_2);
      iVar1 = FUN_140402f40(param_1,iVar2 + 1);
      if (iVar1 == 0) {
        FUN_1403fbda0(param_1,"too many results to resume");
      }
      FUN_140402fe0(param_2,param_1,iVar2);
    }
    else {
      FUN_140402fe0(param_2,param_1,1);
      iVar2 = -1;
    }
  }
  else {
    FUN_140403800(param_1,"cannot resume %s coroutine",(&PTR_s_running_140473ae0)[iVar1]);
    iVar2 = -1;
  }
  return iVar2;
}



int FUN_1403fdbd0(undefined8 param_1)

{
  int iVar1;
  longlong lVar2;
  
  lVar2 = FUN_140403600(param_1,1);
  if (lVar2 == 0) {
    FUN_1403fc5b0(param_1,1,"coroutine expected");
  }
  iVar1 = FUN_140403090(param_1);
  iVar1 = FUN_1403fdad0(param_1,lVar2,iVar1 + -1);
  if (iVar1 < 0) {
    FUN_140403910(param_1,0);
    FUN_140403150(param_1,0xfffffffe);
    return 2;
  }
  FUN_140403910(param_1,1);
  FUN_140403150(param_1,-1 - iVar1);
  return iVar1 + 1;
}



ulonglong FUN_1403fdc70(undefined8 param_1)

{
  undefined4 uVar1;
  int iVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  
  uVar3 = FUN_140403600(param_1,0xffffd8ed);
  uVar1 = FUN_140403090(param_1);
  uVar4 = FUN_1403fdad0(param_1,uVar3,uVar1);
  if ((int)uVar4 < 0) {
    iVar2 = FUN_140403360(param_1,0xffffffff);
    if (iVar2 != 0) {
      FUN_1403fbd10(param_1,1);
      FUN_140403150(param_1,0xfffffffe);
      FUN_140404260(param_1,2);
    }
    FUN_140404210(param_1);
    uVar4 = uVar4 & 0xffffffff;
  }
  return uVar4;
}



undefined8 FUN_1403fdd00(undefined8 param_1)

{
  int iVar1;
  undefined8 uVar2;
  
  uVar2 = FUN_140403050();
  iVar1 = FUN_1404032b0(param_1,1);
  if (iVar1 == 6) {
    iVar1 = FUN_140403300(param_1,1);
    if (iVar1 == 0) goto LAB_1403fdd4a;
  }
  FUN_1403fc5b0(param_1,1,"Lua function expected");
LAB_1403fdd4a:
  FUN_140403280(param_1,1);
  FUN_140402fe0(param_1,uVar2,1);
  return 1;
}



undefined8 FUN_1403fdd80(undefined8 param_1)

{
  FUN_1403fdd00();
  FUN_140403850(param_1,FUN_1403fdc70,1);
  return 1;
}



void FUN_1403fddb0(undefined8 param_1)

{
  undefined4 uVar1;
  
  uVar1 = FUN_140403090();
  FUN_140406160(param_1,uVar1);
  return;
}



undefined8 FUN_1403fddd0(undefined8 param_1)

{
  int iVar1;
  
  iVar1 = FUN_140403950();
  if (iVar1 != 0) {
    FUN_140403690(param_1);
  }
  return 1;
}



undefined8 FUN_1403fde00(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  FUN_1403fc720(param_1,1,5);
  iVar1 = FUN_140403580(param_1,1);
  FUN_1403fc720(param_1,2,6);
  iVar3 = 1;
  if (0 < iVar1) {
    do {
      FUN_140403280(param_1,2);
      FUN_1404036d0(param_1,(longlong)iVar3);
      FUN_140403a60(param_1,1,iVar3);
      FUN_140403ed0(param_1,2,1);
      iVar2 = FUN_1404032b0(param_1,0xffffffff);
      if (iVar2 != 0) {
        return 1;
      }
      FUN_1404030a0(param_1,0xfffffffe);
      iVar3 = iVar3 + 1;
    } while (iVar3 <= iVar1);
  }
  return 0;
}



undefined8 FUN_1403fded0(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fc720(param_1,1,5);
  FUN_1403fc720(param_1,2,6);
  FUN_140403690(param_1);
  iVar1 = FUN_140404220(param_1,1);
  while( true ) {
    if (iVar1 == 0) {
      return 0;
    }
    FUN_140403280(param_1,2);
    FUN_140403280(param_1,0xfffffffd);
    FUN_140403280(param_1,0xfffffffd);
    FUN_140403ed0(param_1,2,1);
    iVar1 = FUN_1404032b0(param_1,0xffffffff);
    if (iVar1 != 0) break;
    FUN_1404030a0(param_1,0xfffffffd);
    iVar1 = FUN_140404220(param_1,1);
  }
  return 1;
}



undefined8 FUN_1403fdf90(undefined8 param_1)

{
  int iVar1;
  double dVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  
  uVar3 = 0;
  uVar4 = 0;
  FUN_1403fc720(param_1,1,5);
  FUN_140403690(param_1);
  iVar1 = FUN_140404220(param_1,1);
  while (iVar1 != 0) {
    FUN_1404030a0(param_1,0xfffffffe);
    iVar1 = FUN_1404032b0(param_1,0xffffffff);
    if ((iVar1 == 3) &&
       (dVar2 = (double)FUN_140403440(param_1,0xffffffff),
       (double)CONCAT44(uVar4,uVar3) <= dVar2 && dVar2 != (double)CONCAT44(uVar4,uVar3))) {
      uVar3 = SUB84(dVar2,0);
      uVar4 = (undefined4)((ulonglong)dVar2 >> 0x20);
    }
    iVar1 = FUN_140404220(param_1,1);
  }
  FUN_1404036b0(param_1,CONCAT44(uVar4,uVar3));
  return 1;
}



undefined8 FUN_1403fe030(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fc720(param_1,1,5);
  iVar1 = FUN_140403580(param_1,1);
  FUN_1404036d0(param_1,(longlong)iVar1);
  return 1;
}



undefined8 FUN_1403fe070(undefined8 param_1)

{
  FUN_1403fc720(param_1,1,5);
  FUN_1403fbda0(param_1,"\'setn\' is obsolete");
  FUN_140403280(param_1,1);
  return 1;
}



undefined8 FUN_1403fe0b0(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined8 uVar4;
  
  FUN_1403fc720(param_1,1,5);
  iVar1 = FUN_140403580(param_1,1);
  iVar1 = iVar1 + 1;
  iVar2 = FUN_140403090(param_1);
  if (iVar2 != 2) {
    if (iVar2 != 3) {
      uVar4 = FUN_1403fbda0(param_1,"wrong number of arguments to \'insert\'");
      return uVar4;
    }
    iVar3 = FUN_1403fc970(param_1,2);
    iVar2 = iVar1;
    if (iVar1 < iVar3) {
      iVar2 = iVar3;
    }
    while (iVar1 = iVar3, iVar3 < iVar2) {
      FUN_140403a60(param_1,1,iVar2 + -1);
      FUN_140403cf0(param_1,1,iVar2);
      iVar2 = iVar2 + -1;
    }
  }
  FUN_140403cf0(param_1,1,iVar1);
  return 0;
}



undefined8 FUN_1403fe190(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  
  FUN_1403fc720(param_1,1,5);
  iVar1 = FUN_140403580(param_1,1);
  iVar2 = FUN_1403fc9c0(param_1,2,(longlong)iVar1);
  if ((0 < iVar2) && (iVar2 <= iVar1)) {
    FUN_140403a60(param_1,1,iVar2);
    while (iVar2 < iVar1) {
      FUN_140403a60(param_1,1,iVar2 + 1);
      FUN_140403cf0(param_1,1,iVar2);
      iVar2 = iVar2 + 1;
    }
    FUN_140403690(param_1);
    FUN_140403cf0(param_1,1,iVar1);
    return 1;
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403fe270(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined8 uVar6;
  undefined1 auStack_268 [32];
  undefined8 local_248 [2];
  undefined1 local_238 [544];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_268;
  uVar5 = FUN_1403fc830(param_1,2,&DAT_14047e238,local_248);
  FUN_1403fc720(param_1,1,5);
  iVar1 = FUN_1403fc9c0(param_1,3,1);
  iVar2 = FUN_1404032b0(param_1,4);
  if (iVar2 < 1) {
    iVar2 = FUN_140403580(param_1,1);
  }
  else {
    iVar2 = FUN_1403fc970(param_1,4);
  }
  FUN_1403fc200(param_1,local_238);
  for (; iVar1 < iVar2; iVar1 = iVar1 + 1) {
    FUN_140403a60(param_1,1,iVar1);
    iVar3 = FUN_140403360(param_1,0xffffffff);
    if (iVar3 == 0) {
      uVar4 = FUN_1404032b0(param_1,0xffffffff);
      uVar6 = FUN_1404032e0(param_1,uVar4);
      FUN_1403fbda0(param_1,"invalid value (%s) at index %d in table for \'concat\'",uVar6,iVar1);
    }
    FUN_1403fc140(local_238);
    FUN_1403fc050(local_238,uVar5,local_248[0]);
  }
  if (iVar1 == iVar2) {
    FUN_140403a60(param_1,1,iVar1);
    iVar2 = FUN_140403360(param_1,0xffffffff);
    if (iVar2 == 0) {
      uVar4 = FUN_1404032b0(param_1,0xffffffff);
      uVar5 = FUN_1404032e0(param_1,uVar4);
      FUN_1403fbda0(param_1,"invalid value (%s) at index %d in table for \'concat\'",uVar5,iVar1);
    }
    FUN_1403fc140(local_238);
  }
  FUN_1403fc0f0(local_238);
  return 1;
}



void FUN_1403fe420(undefined8 param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int local_res10;
  int local_res18;
  
  local_res10 = param_2;
  local_res18 = param_3;
  if (param_2 < param_3) {
    do {
      FUN_140403a60(param_1,1,local_res10);
      FUN_140403a60(param_1,1,local_res18);
      iVar1 = FUN_1404032b0(param_1,2);
      if (iVar1 == 0) {
        iVar1 = FUN_1404033f0(param_1,0xffffffff,0xfffffffe);
      }
      else {
        FUN_140403280(param_1,2);
        FUN_140403280(param_1,0xfffffffe);
        FUN_140403280(param_1,0xfffffffc);
        FUN_140403ed0(param_1,2,1);
        iVar1 = FUN_1404034b0(param_1,0xffffffff);
        FUN_1404030a0(param_1,0xfffffffe);
      }
      if (iVar1 == 0) {
        FUN_1404030a0(param_1,0xfffffffd);
      }
      else {
        FUN_140403cf0(param_1,1,local_res10);
        FUN_140403cf0(param_1,1,local_res18);
      }
      if (local_res18 - local_res10 == 1) {
        return;
      }
      iVar1 = (local_res10 + local_res18) / 2;
      FUN_140403a60(param_1,1,iVar1);
      FUN_140403a60(param_1,1,local_res10);
      iVar2 = FUN_1404032b0(param_1,2);
      if (iVar2 == 0) {
        iVar2 = FUN_1404033f0(param_1,0xfffffffe);
      }
      else {
        FUN_140403280(param_1,2);
        FUN_140403280(param_1,0xfffffffd);
        FUN_140403280(param_1,0xfffffffd);
        FUN_140403ed0(param_1,2,1);
        iVar2 = FUN_1404034b0(param_1,0xffffffff);
        FUN_1404030a0(param_1,0xfffffffe);
      }
      if (iVar2 == 0) {
        FUN_1404030a0(param_1,0xfffffffe);
        FUN_140403a60(param_1,1,local_res18);
        iVar2 = FUN_1404032b0(param_1,2);
        if (iVar2 == 0) {
          iVar2 = FUN_1404033f0(param_1,0xffffffff,0xfffffffe);
        }
        else {
          FUN_140403280(param_1,2);
          FUN_140403280(param_1,0xfffffffe);
          FUN_140403280(param_1,0xfffffffc);
          FUN_140403ed0(param_1,2,1);
          iVar2 = FUN_1404034b0(param_1,0xffffffff);
          FUN_1404030a0(param_1,0xfffffffe);
        }
        if (iVar2 == 0) {
          FUN_1404030a0(param_1,0xfffffffd);
        }
        else {
          FUN_140403cf0(param_1,1,iVar1);
          FUN_140403cf0(param_1,1,local_res18);
        }
      }
      else {
        FUN_140403cf0(param_1,1,iVar1);
        FUN_140403cf0(param_1,1,local_res10);
      }
      if (local_res18 - local_res10 == 2) {
        return;
      }
      FUN_140403a60(param_1,1,iVar1);
      FUN_140403280(param_1,0xffffffff);
      iVar4 = local_res18 + -1;
      FUN_140403a60(param_1,1,iVar4);
      FUN_140403cf0(param_1,1,iVar1);
      FUN_140403cf0(param_1,1,iVar4);
      iVar1 = local_res10;
      iVar2 = iVar4;
      while( true ) {
        while( true ) {
          iVar5 = iVar1 + 1;
          FUN_140403a60(param_1,1,iVar5);
          iVar3 = FUN_1404032b0(param_1,2);
          if (iVar3 == 0) {
            iVar3 = FUN_1404033f0(param_1,0xffffffff,0xfffffffe);
          }
          else {
            FUN_140403280(param_1,2);
            FUN_140403280(param_1,0xfffffffe);
            FUN_140403280(param_1,0xfffffffc);
            FUN_140403ed0(param_1,2,1);
            iVar3 = FUN_1404034b0(param_1,0xffffffff);
            FUN_1404030a0(param_1,0xfffffffe);
          }
          if (iVar3 == 0) break;
          if (local_res18 < iVar5) {
            FUN_1403fbda0(param_1,"invalid order function for sorting");
          }
          FUN_1404030a0(param_1,0xfffffffe);
          iVar1 = iVar5;
        }
        while( true ) {
          iVar2 = iVar2 + -1;
          FUN_140403a60(param_1,1,iVar2);
          iVar3 = FUN_1404032b0(param_1,2);
          if (iVar3 == 0) {
            iVar3 = FUN_1404033f0(param_1,0xfffffffd);
          }
          else {
            FUN_140403280(param_1,2);
            FUN_140403280(param_1,0xfffffffc);
            FUN_140403280(param_1,0xfffffffd);
            FUN_140403ed0(param_1,2,1);
            iVar3 = FUN_1404034b0(param_1,0xffffffff);
            FUN_1404030a0(param_1,0xfffffffe);
          }
          if (iVar3 == 0) break;
          if (iVar2 < local_res10) {
            FUN_1403fbda0(param_1,"invalid order function for sorting");
          }
          FUN_1404030a0(param_1,0xfffffffe);
        }
        if (iVar2 < iVar5) break;
        FUN_140403cf0(param_1,1,iVar5);
        FUN_140403cf0(param_1,1,iVar2);
        iVar1 = iVar5;
      }
      FUN_1404030a0(param_1,0xfffffffc);
      FUN_140403a60(param_1,1,iVar4);
      FUN_140403a60(param_1,1,iVar5);
      FUN_140403cf0(param_1,1,iVar4);
      FUN_140403cf0(param_1,1,iVar5);
      if (iVar5 - local_res10 < local_res18 - iVar5) {
        iVar4 = iVar1;
        iVar2 = local_res10;
        local_res10 = iVar1 + 2;
      }
      else {
        iVar2 = iVar1 + 2;
        iVar4 = local_res18;
        local_res18 = iVar1;
      }
      FUN_1403fe420(param_1,iVar2,iVar4);
    } while (local_res10 < local_res18);
  }
  return;
}



undefined8 FUN_1403fe960(undefined8 param_1)

{
  undefined4 uVar1;
  int iVar2;
  
  FUN_1403fc720(param_1,1,5);
  uVar1 = FUN_140403580(param_1,1);
  FUN_1403fbe00(param_1,0x28,&DAT_14047e238);
  iVar2 = FUN_1404032b0(param_1,2);
  if (0 < iVar2) {
    FUN_1403fc720(param_1,2,6);
  }
  FUN_1404030a0(param_1,2);
  FUN_1403fe420(param_1,1,uVar1);
  return 0;
}



undefined8 FUN_1403fe9f0(undefined8 param_1,int param_2,undefined8 param_3)

{
  int iVar1;
  int *piVar2;
  undefined8 uVar3;
  char *pcVar4;
  
  piVar2 = _errno();
  iVar1 = *piVar2;
  if (param_2 == 0) {
    FUN_140403690(param_1);
    pcVar4 = strerror(iVar1);
    FUN_140403800(param_1,"%s: %s",param_3,pcVar4);
    FUN_1404036d0(param_1,(longlong)iVar1);
    uVar3 = 3;
  }
  else {
    FUN_140403910(param_1,1);
    uVar3 = 1;
  }
  return uVar3;
}



undefined8 FUN_1403fea80(undefined8 param_1)

{
  int iVar1;
  char *_Command;
  
  _Command = (char *)FUN_1403fc830(param_1,1,0);
  iVar1 = system(_Command);
  FUN_1404036d0(param_1,(longlong)iVar1);
  return 1;
}



void FUN_1403feac0(undefined8 param_1)

{
  int iVar1;
  char *_Filename;
  
  _Filename = (char *)FUN_1403fc7a0(param_1,1);
  iVar1 = remove(_Filename);
  FUN_1403fe9f0(param_1,iVar1 == 0,_Filename);
  return;
}



void FUN_1403feb10(undefined8 param_1)

{
  char *_OldFilename;
  char *_NewFilename;
  int iVar1;
  
  _OldFilename = (char *)FUN_1403fc7a0(param_1,1);
  _NewFilename = (char *)FUN_1403fc7a0(param_1,2);
  iVar1 = rename(_OldFilename,_NewFilename);
  FUN_1403fe9f0(param_1,iVar1 == 0,_OldFilename);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403feb70(undefined8 param_1)

{
  char *pcVar1;
  undefined8 uVar2;
  undefined1 auStack_48 [32];
  char local_28 [16];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_48;
  pcVar1 = tmpnam(local_28);
  if (pcVar1 == (char *)0x0) {
    uVar2 = FUN_1403fbda0(param_1,"unable to generate a unique filename");
    return uVar2;
  }
  FUN_140403760(param_1,local_28);
  return 1;
}



undefined8 FUN_1403febe0(undefined8 param_1)

{
  char *pcVar1;
  
  pcVar1 = (char *)FUN_1403fc7a0(param_1,1);
  pcVar1 = getenv(pcVar1);
  FUN_140403760(param_1,pcVar1);
  return 1;
}



undefined8 FUN_1403fec20(undefined8 param_1)

{
  clock_t cVar1;
  
  cVar1 = clock();
  FUN_1404036b0(param_1,(double)cVar1 / 1000.0);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403fec60(undefined8 param_1)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  tm *_Tm;
  size_t sVar4;
  longlong lVar5;
  char *pcVar6;
  char *pcVar7;
  bool bVar8;
  double dVar9;
  undefined1 auStack_348 [32];
  char local_328;
  char local_327;
  undefined1 local_326;
  __time64_t local_320;
  char *local_318 [67];
  char local_100 [8];
  char local_f8 [208];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_348;
  pcVar3 = (char *)FUN_1403fc830(param_1,1,&DAT_1404741b4);
  iVar2 = FUN_1404032b0(param_1,2);
  if (iVar2 < 1) {
    local_320 = _time64((__time64_t *)0x0);
  }
  else {
    dVar9 = (double)FUN_1403fc8b0(param_1,2);
    local_320 = (__time64_t)dVar9;
  }
  if (*pcVar3 == '!') {
    _Tm = _gmtime64(&local_320);
    pcVar3 = pcVar3 + 1;
  }
  else {
    _Tm = _localtime64(&local_320);
  }
  bVar8 = _Tm == (tm *)0x0;
  if (bVar8) {
    FUN_140403690(param_1);
  }
  else {
    lVar5 = 3;
    pcVar6 = pcVar3;
    pcVar7 = "*t";
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      bVar8 = *pcVar6 == *pcVar7;
      pcVar6 = pcVar6 + 1;
      pcVar7 = pcVar7 + 1;
    } while (bVar8);
    if (bVar8) {
      FUN_140403aa0(param_1,0,9);
      FUN_1404036d0(param_1,(longlong)_Tm->tm_sec);
      FUN_140403bf0(param_1,0xfffffffe,&DAT_1404741ac);
      FUN_1404036d0(param_1,(longlong)_Tm->tm_min);
      FUN_140403bf0(param_1,0xfffffffe,&DAT_1404741a8);
      FUN_1404036d0(param_1,(longlong)_Tm->tm_hour);
      FUN_140403bf0(param_1,0xfffffffe,&DAT_1404741a0);
      FUN_1404036d0(param_1,(longlong)_Tm->tm_mday);
      FUN_140403bf0(param_1,0xfffffffe,&DAT_14047419c);
      FUN_1404036d0(param_1,(longlong)(_Tm->tm_mon + 1));
      FUN_140403bf0(param_1,0xfffffffe,"month");
      FUN_1404036d0(param_1,(longlong)(_Tm->tm_year + 0x76c));
      FUN_140403bf0(param_1,0xfffffffe,&DAT_14047418c);
      FUN_1404036d0(param_1,(longlong)(_Tm->tm_wday + 1));
      FUN_140403bf0(param_1,0xfffffffe,&DAT_140474184);
      FUN_1404036d0(param_1,(longlong)(_Tm->tm_yday + 1));
      FUN_140403bf0(param_1,0xfffffffe,&DAT_14047417c);
      if (-1 < _Tm->tm_isdst) {
        FUN_140403910(param_1);
        FUN_140403bf0(param_1,0xfffffffe,"isdst");
      }
    }
    else {
      local_328 = '%';
      local_326 = 0;
      FUN_1403fc200(param_1,local_318);
      cVar1 = *pcVar3;
      while (cVar1 != '\0') {
        if ((cVar1 == '%') && (pcVar3[1] != '\0')) {
          local_327 = pcVar3[1];
          sVar4 = strftime(local_f8,200,&local_328,_Tm);
          FUN_1403fc050(local_318,local_f8,sVar4);
          pcVar3 = pcVar3 + 1;
        }
        else {
          if (local_100 <= local_318[0]) {
            FUN_1403fbff0(local_318);
          }
          *local_318[0] = *pcVar3;
          local_318[0] = local_318[0] + 1;
        }
        pcVar6 = pcVar3 + 1;
        pcVar3 = pcVar3 + 1;
        cVar1 = *pcVar6;
      }
      FUN_1403fc0f0(local_318);
    }
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403fef50(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  undefined1 auStack_58 [32];
  tm local_38;
  ulonglong local_10;
  
  local_10 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  iVar1 = FUN_1404032b0(param_1,1);
  if (iVar1 < 1) {
    lVar3 = _time64((__time64_t *)0x0);
  }
  else {
    FUN_1403fc720(param_1,1,5);
    FUN_1404030a0(param_1,1);
    iVar2 = -1;
    FUN_1404039b0(param_1,0xffffffff,&DAT_1404741ac);
    iVar1 = FUN_140403330(param_1,0xffffffff);
    if (iVar1 == 0) {
      local_38.tm_sec = 0;
    }
    else {
      local_38.tm_sec = FUN_140403480(param_1,0xffffffff);
    }
    FUN_1404030a0(param_1,0xfffffffe);
    FUN_1404039b0(param_1,0xffffffff,&DAT_1404741a8);
    iVar1 = FUN_140403330(param_1,0xffffffff);
    if (iVar1 == 0) {
      local_38.tm_min = 0;
    }
    else {
      local_38.tm_min = FUN_140403480(param_1,0xffffffff);
    }
    FUN_1404030a0(param_1,0xfffffffe);
    FUN_1404039b0(param_1,0xffffffff,&DAT_1404741a0);
    iVar1 = FUN_140403330(param_1,0xffffffff);
    if (iVar1 == 0) {
      local_38.tm_hour = 0xc;
    }
    else {
      local_38.tm_hour = FUN_140403480(param_1,0xffffffff);
    }
    FUN_1404030a0(param_1,0xfffffffe);
    FUN_1404039b0(param_1,0xffffffff,&DAT_14047419c);
    iVar1 = FUN_140403330(param_1,0xffffffff);
    if (iVar1 == 0) {
      local_38.tm_mday = FUN_1403fbda0(param_1,"field \'%s\' missing in date table",&DAT_14047419c);
    }
    else {
      local_38.tm_mday = FUN_140403480(param_1,0xffffffff);
      FUN_1404030a0(param_1,0xfffffffe);
    }
    FUN_1404039b0(param_1,0xffffffff,"month");
    iVar1 = FUN_140403330(param_1,0xffffffff);
    if (iVar1 == 0) {
      local_38.tm_mon = FUN_1403fbda0(param_1,"field \'%s\' missing in date table","month");
    }
    else {
      local_38.tm_mon = FUN_140403480(param_1,0xffffffff);
      FUN_1404030a0(param_1,0xfffffffe);
    }
    local_38.tm_mon = local_38.tm_mon + -1;
    FUN_1404039b0(param_1,0xffffffff,&DAT_14047418c);
    iVar1 = FUN_140403330(param_1,0xffffffff);
    if (iVar1 == 0) {
      local_38.tm_year = FUN_1403fbda0(param_1,"field \'%s\' missing in date table",&DAT_14047418c);
    }
    else {
      local_38.tm_year = FUN_140403480(param_1,0xffffffff);
      FUN_1404030a0(param_1,0xfffffffe);
    }
    local_38.tm_year = local_38.tm_year + -0x76c;
    FUN_1404039b0(param_1,0xffffffff,"isdst");
    iVar1 = FUN_1404032b0(param_1,0xffffffff);
    if (iVar1 != 0) {
      iVar2 = FUN_1404034b0(param_1,0xffffffff);
    }
    FUN_1404030a0(param_1,0xfffffffe);
    local_38.tm_isdst = iVar2;
    lVar3 = _mktime64(&local_38);
  }
  if (lVar3 == -1) {
    FUN_140403690();
  }
  else {
    FUN_1404036b0(param_1,(double)lVar3);
  }
  return 1;
}



undefined8 FUN_1403ff200(undefined8 param_1)

{
  double dVar1;
  double dVar2;
  
  dVar1 = (double)FUN_1403fc920(param_1,2,0);
  dVar2 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = _difftime64((longlong)dVar2,(longlong)dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_1403ff260(undefined8 param_1)

{
  int iVar1;
  char *pcVar2;
  
  pcVar2 = (char *)FUN_1403fc830(param_1,1,0);
  iVar1 = FUN_1403fca30(param_1,2,&DAT_140474008,&PTR_DAT_140474028);
  pcVar2 = setlocale(*(int *)(&DAT_140474010 + (longlong)iVar1 * 4),pcVar2);
  FUN_140403760(param_1,pcVar2);
  return 1;
}



void FUN_1403ff2d0(undefined8 param_1)

{
  int _Code;
  
  _Code = FUN_1403fc9c0(param_1,1);
                    // WARNING: Subroutine does not return
  exit(_Code);
}



undefined8 FUN_1403ff2f0(undefined8 param_1)

{
  undefined8 local_res10 [3];
  
  FUN_1403fc7a0(param_1,1,local_res10);
  FUN_1404036d0(param_1,local_res10[0]);
  return 1;
}



undefined8 FUN_1403ff320(undefined8 param_1)

{
  longlong lVar1;
  longlong lVar2;
  undefined1 *puVar3;
  longlong lVar4;
  longlong lVar5;
  bool bVar6;
  longlong local_res10;
  
  lVar1 = FUN_1403fc7a0(param_1,1,&local_res10);
  lVar5 = local_res10;
  lVar2 = FUN_1403fc970(param_1,2);
  lVar4 = local_res10;
  if (lVar2 < 0) {
    lVar2 = lVar2 + 1 + lVar5;
  }
  lVar5 = 0;
  if (-1 < lVar2) {
    lVar5 = lVar2;
  }
  lVar2 = FUN_1403fc9c0(param_1,3,0xffffffffffffffff);
  bVar6 = false;
  if (lVar2 < 0) {
    lVar2 = lVar2 + 1 + lVar4;
    bVar6 = lVar2 < 0;
  }
  lVar4 = 0;
  if (!bVar6) {
    lVar4 = lVar2;
  }
  if (lVar5 < 1) {
    lVar5 = 1;
  }
  if (local_res10 < lVar4) {
    lVar4 = local_res10;
  }
  if (lVar4 < lVar5) {
    lVar2 = 0;
    puVar3 = &DAT_14047e238;
  }
  else {
    puVar3 = (undefined1 *)(lVar5 + -1 + lVar1);
    lVar2 = (lVar4 - lVar5) + 1;
  }
  FUN_1404036f0(param_1,puVar3,lVar2);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403ff3f0(undefined8 param_1)

{
  longlong lVar1;
  undefined1 auStack_268 [32];
  longlong local_248 [2];
  undefined1 *local_238 [67];
  undefined1 local_20 [8];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_268;
  lVar1 = FUN_1403fc7a0(param_1,1,local_248);
  FUN_1403fc200(param_1,local_238);
  while (local_248[0] != 0) {
    local_248[0] = local_248[0] + -1;
    if (local_20 <= local_238[0]) {
      FUN_1403fbff0(local_238);
    }
    *local_238[0] = *(undefined1 *)(local_248[0] + lVar1);
    local_238[0] = local_238[0] + 1;
  }
  local_248[0] = -1;
  FUN_1403fc0f0(local_238);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403ff4c0(undefined8 param_1)

{
  int iVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined1 auStack_268 [32];
  ulonglong local_248 [2];
  undefined1 *local_238 [67];
  undefined1 local_20 [8];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_268;
  lVar2 = FUN_1403fc7a0(param_1,1,local_248);
  FUN_1403fc200(param_1,local_238);
  uVar3 = 0;
  if (local_248[0] != 0) {
    do {
      if (local_20 <= local_238[0]) {
        FUN_1403fbff0(local_238);
      }
      iVar1 = tolower((uint)*(byte *)(uVar3 + lVar2));
      uVar3 = uVar3 + 1;
      *local_238[0] = (char)iVar1;
      local_238[0] = local_238[0] + 1;
    } while (uVar3 < local_248[0]);
  }
  FUN_1403fc0f0(local_238);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403ff580(undefined8 param_1)

{
  int iVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined1 auStack_268 [32];
  ulonglong local_248 [2];
  undefined1 *local_238 [67];
  undefined1 local_20 [8];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_268;
  lVar2 = FUN_1403fc7a0(param_1,1,local_248);
  FUN_1403fc200(param_1,local_238);
  uVar3 = 0;
  if (local_248[0] != 0) {
    do {
      if (local_20 <= local_238[0]) {
        FUN_1403fbff0(local_238);
      }
      iVar1 = toupper((uint)*(byte *)(uVar3 + lVar2));
      uVar3 = uVar3 + 1;
      *local_238[0] = (char)iVar1;
      local_238[0] = local_238[0] + 1;
    } while (uVar3 < local_248[0]);
  }
  FUN_1403fc0f0(local_238);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403ff640(undefined8 param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined1 auStack_268 [32];
  undefined8 local_248 [2];
  undefined1 local_238 [544];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_268;
  uVar2 = FUN_1403fc7a0(param_1,1,local_248);
  iVar1 = FUN_1403fc970(param_1,2);
  FUN_1403fc200(param_1,local_238);
  for (; 0 < iVar1; iVar1 = iVar1 + -1) {
    FUN_1403fc050(local_238,uVar2,local_248[0]);
  }
  FUN_1403fc0f0(local_238);
  return 1;
}



int FUN_1403ff6f0(undefined8 param_1)

{
  longlong lVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  int iVar5;
  ulonglong uVar6;
  ulonglong local_res10;
  
  lVar1 = FUN_1403fc7a0(param_1,1,&local_res10);
  uVar6 = local_res10;
  uVar2 = FUN_1403fc9c0(param_1,2,1);
  uVar3 = local_res10;
  if ((longlong)uVar2 < 0) {
    uVar2 = uVar2 + 1 + uVar6;
  }
  uVar4 = 0;
  uVar6 = uVar4;
  if (-1 < (longlong)uVar2) {
    uVar6 = uVar2;
  }
  uVar2 = FUN_1403fc9c0(param_1,3,uVar6);
  if ((longlong)uVar2 < 0) {
    uVar2 = uVar2 + 1 + uVar3;
  }
  uVar3 = uVar4;
  if (-1 < (longlong)uVar2) {
    uVar3 = uVar2;
  }
  if ((longlong)uVar6 < 1) {
    uVar6 = 1;
  }
  if (local_res10 < uVar3) {
    uVar3 = local_res10;
  }
  if ((longlong)uVar3 < (longlong)uVar6) {
    iVar5 = 0;
  }
  else {
    iVar5 = ((int)uVar3 - (int)uVar6) + 1;
    if ((longlong)((longlong)iVar5 + uVar6) <= (longlong)uVar3) {
      FUN_1403fbda0(param_1,"string slice too long");
    }
    FUN_1403fbe00(param_1,iVar5,"string slice too long");
    if (0 < iVar5) {
      do {
        FUN_1404036d0(param_1,*(undefined1 *)((uVar6 - 1) + lVar1 + uVar4));
        uVar4 = uVar4 + 1;
      } while ((longlong)uVar4 < (longlong)iVar5);
    }
  }
  return iVar5;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403ff800(undefined8 param_1)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  undefined1 auStack_258 [32];
  undefined1 *local_238 [67];
  undefined1 local_20 [8];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  iVar1 = FUN_140403090();
  FUN_1403fc200(param_1,local_238);
  iVar3 = 1;
  if (0 < iVar1) {
    do {
      uVar2 = FUN_1403fc970(param_1,iVar3);
      if ((uVar2 & 0xff) != uVar2) {
        FUN_1403fc5b0(param_1,iVar3,"invalid value");
      }
      if (local_20 <= local_238[0]) {
        FUN_1403fbff0(local_238);
      }
      iVar3 = iVar3 + 1;
      *local_238[0] = (char)uVar2;
      local_238[0] = local_238[0] + 1;
    } while (iVar3 <= iVar1);
  }
  FUN_1403fc0f0(local_238);
  return 1;
}



undefined8 FUN_1403ff8e0(void)

{
  undefined8 in_R9;
  
  FUN_1403fc050(in_R9);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1403ff900(undefined8 param_1)

{
  int iVar1;
  undefined1 auStack_258 [32];
  undefined1 local_238 [544];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_258;
  FUN_1403fc720(param_1,1,6);
  FUN_1404030a0(param_1,1);
  FUN_1403fc200(param_1,local_238);
  iVar1 = FUN_140404010(param_1,FUN_1403ff8e0,local_238);
  if (iVar1 != 0) {
    FUN_1403fbda0(param_1,"unable to dump given function");
  }
  FUN_1403fc0f0(local_238);
  return 1;
}



char * FUN_1403ff9a0(longlong param_1,char *param_2)

{
  char *pcVar1;
  char *pcVar2;
  
  pcVar1 = param_2 + 1;
  if (*param_2 == '%') {
    if (*pcVar1 == '\0') {
      FUN_1403fbda0(*(undefined8 *)(param_1 + 0x10),"malformed pattern (ends with \'%%\')");
    }
    return param_2 + 2;
  }
  if (*param_2 != '[') {
    return pcVar1;
  }
  if (*pcVar1 == '^') {
    pcVar1 = param_2 + 2;
  }
  do {
    if (*pcVar1 == '\0') {
      FUN_1403fbda0(*(undefined8 *)(param_1 + 0x10),"malformed pattern (missing \']\')");
    }
    pcVar2 = pcVar1 + 1;
    if ((*pcVar1 == '%') && (*pcVar2 != '\0')) {
      pcVar2 = pcVar1 + 2;
    }
    pcVar1 = pcVar2;
  } while (*pcVar2 != ']');
  return pcVar2 + 1;
}



uint FUN_1403ffa40(int param_1,int param_2)

{
  int iVar1;
  uint uVar2;
  
  iVar1 = tolower(param_2);
  switch(iVar1) {
  case 0x61:
    uVar2 = isalpha(param_1);
    break;
  default:
    return (uint)(param_2 == param_1);
  case 99:
    uVar2 = iscntrl(param_1);
    break;
  case 100:
    uVar2 = isdigit(param_1);
    break;
  case 0x6c:
    uVar2 = islower(param_1);
    break;
  case 0x70:
    uVar2 = ispunct(param_1);
    break;
  case 0x73:
    uVar2 = isspace(param_1);
    break;
  case 0x75:
    uVar2 = isupper(param_1);
    break;
  case 0x77:
    uVar2 = isalnum(param_1);
    break;
  case 0x78:
    uVar2 = isxdigit(param_1);
    break;
  case 0x7a:
    uVar2 = (uint)(param_1 == 0);
  }
  iVar1 = islower(param_2);
  if (iVar1 == 0) {
    uVar2 = (uint)(uVar2 == 0);
  }
  return uVar2;
}



bool FUN_1403ffba0(uint param_1,char *param_2,byte *param_3)

{
  byte bVar1;
  int iVar2;
  uint uVar3;
  byte *pbVar4;
  byte *pbVar5;
  bool bVar6;
  
  bVar6 = param_2[1] != '^';
  if (!bVar6) {
    param_2 = param_2 + 1;
  }
  pbVar4 = (byte *)(param_2 + 1);
  if (pbVar4 < param_3) {
    pbVar5 = (byte *)(param_2 + 3);
    do {
      if (*pbVar4 == 0x25) {
        bVar1 = pbVar4[1];
        pbVar4 = pbVar4 + 1;
        pbVar5 = pbVar5 + 1;
        iVar2 = tolower((uint)bVar1);
        switch(iVar2) {
        case 0x61:
          uVar3 = isalpha(param_1);
          break;
        default:
          uVar3 = (uint)(bVar1 == param_1);
          goto LAB_1403ffcc4;
        case 99:
          uVar3 = iscntrl(param_1);
          break;
        case 100:
          uVar3 = isdigit(param_1);
          break;
        case 0x6c:
          uVar3 = islower(param_1);
          break;
        case 0x70:
          uVar3 = ispunct(param_1);
          break;
        case 0x73:
          uVar3 = isspace(param_1);
          break;
        case 0x75:
          uVar3 = isupper(param_1);
          break;
        case 0x77:
          uVar3 = isalnum(param_1);
          break;
        case 0x78:
          uVar3 = isxdigit(param_1);
          break;
        case 0x7a:
          uVar3 = (uint)(param_1 == 0);
        }
        iVar2 = islower((uint)bVar1);
        if (iVar2 == 0) {
          uVar3 = (uint)(uVar3 == 0);
        }
LAB_1403ffcc4:
        if (uVar3 != 0) {
          return bVar6;
        }
      }
      else if ((pbVar4[1] == 0x2d) && (pbVar5 < param_3)) {
        bVar1 = *pbVar4;
        pbVar4 = pbVar4 + 2;
        pbVar5 = pbVar5 + 2;
        if (((int)(uint)bVar1 <= (int)param_1) && ((int)param_1 <= (int)(uint)*pbVar4)) {
          return bVar6;
        }
      }
      else if (*pbVar4 == param_1) {
        return bVar6;
      }
      pbVar4 = pbVar4 + 1;
      pbVar5 = pbVar5 + 1;
    } while (pbVar4 < param_3);
  }
  return !bVar6;
}



char * FUN_1403ffda0(longlong param_1,char *param_2,char *param_3)

{
  char *pcVar1;
  int iVar2;
  
  if ((*param_3 == '\0') || (param_3[1] == '\0')) {
    FUN_1403fbda0(*(undefined8 *)(param_1 + 0x10),"unbalanced pattern");
  }
  if (*param_2 == *param_3) {
    iVar2 = 1;
    while (pcVar1 = param_2, param_2 = pcVar1 + 1, param_2 < *(char **)(param_1 + 8)) {
      if (*param_2 == param_3[1]) {
        iVar2 = iVar2 + -1;
        if (iVar2 == 0) {
          return pcVar1 + 2;
        }
      }
      else if (*param_2 == *param_3) {
        iVar2 = iVar2 + 1;
      }
    }
  }
  return (char *)0x0;
}



longlong FUN_1403ffe40(longlong param_1,char *param_2,char *param_3,longlong param_4)

{
  char cVar1;
  char cVar2;
  uint uVar3;
  longlong lVar4;
  longlong lVar5;
  char *pcVar6;
  
  lVar5 = 0;
  pcVar6 = param_2;
  if (param_2 < *(char **)(param_1 + 8)) {
    do {
      cVar1 = *param_3;
      cVar2 = *pcVar6;
      if (cVar1 == '%') {
        uVar3 = FUN_1403ffa40(cVar2,param_3[1]);
LAB_1403ffeb8:
        if (uVar3 == 0) break;
      }
      else if (cVar1 != '.') {
        if (cVar1 == '[') {
          uVar3 = FUN_1403ffba0(cVar2,param_3,param_4 + -1);
        }
        else {
          uVar3 = (uint)(cVar1 == cVar2);
        }
        goto LAB_1403ffeb8;
      }
      pcVar6 = pcVar6 + 1;
      lVar5 = lVar5 + 1;
    } while (pcVar6 < *(char **)(param_1 + 8));
    if (lVar5 < 0) {
      return 0;
    }
  }
  do {
    lVar4 = FUN_1404001b0(param_1,param_2 + lVar5,param_4 + 1);
    if (lVar4 != 0) {
      return lVar4;
    }
    lVar5 = lVar5 + -1;
  } while (-1 < lVar5);
  return 0;
}



longlong FUN_1403fff10(longlong param_1,char *param_2,char *param_3,longlong param_4)

{
  char cVar1;
  char cVar2;
  uint uVar3;
  longlong lVar4;
  
  lVar4 = FUN_1404001b0(param_1,param_2,param_4 + 1);
  do {
    if (lVar4 != 0) {
      return lVar4;
    }
    if (*(char **)(param_1 + 8) <= param_2) {
      return 0;
    }
    cVar1 = *param_3;
    cVar2 = *param_2;
    if (cVar1 == '%') {
      uVar3 = FUN_1403ffa40(cVar2,param_3[1]);
LAB_1403fff8e:
      if (uVar3 == 0) {
        return 0;
      }
    }
    else if (cVar1 != '.') {
      if (cVar1 == '[') {
        uVar3 = FUN_1403ffba0(cVar2,param_3,param_4 + -1);
      }
      else {
        uVar3 = (uint)(cVar1 == cVar2);
      }
      goto LAB_1403fff8e;
    }
    param_2 = param_2 + 1;
    lVar4 = FUN_1404001b0(param_1,param_2,param_4 + 1);
  } while( true );
}



void FUN_1403fffd0(longlong param_1,undefined8 param_2,undefined8 param_3,int param_4)

{
  int iVar1;
  longlong lVar2;
  
  iVar1 = *(int *)(param_1 + 0x18);
  if (0x1f < iVar1) {
    FUN_1403fbda0(*(undefined8 *)(param_1 + 0x10),"too many captures");
  }
  *(undefined8 *)(param_1 + ((longlong)iVar1 + 2) * 0x10) = param_2;
  *(longlong *)(param_1 + 0x28 + (longlong)iVar1 * 0x10) = (longlong)param_4;
  *(int *)(param_1 + 0x18) = iVar1 + 1;
  lVar2 = FUN_1404001b0(param_1,param_2,param_3);
  if (lVar2 == 0) {
    *(int *)(param_1 + 0x18) = *(int *)(param_1 + 0x18) + -1;
  }
  return;
}



void FUN_140400060(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  int iVar4;
  
  iVar4 = *(int *)(param_1 + 0x18) + -1;
  lVar2 = (longlong)iVar4;
  if (-1 < iVar4) {
    plVar3 = (longlong *)(param_1 + 0x28 + lVar2 * 0x10);
    do {
      if (*plVar3 == -1) goto LAB_1404000b9;
      iVar4 = iVar4 + -1;
      plVar3 = plVar3 + -2;
      lVar2 = lVar2 + -1;
    } while (-1 < lVar2);
  }
  iVar4 = FUN_1403fbda0(*(undefined8 *)(param_1 + 0x10),"invalid pattern capture");
LAB_1404000b9:
  lVar1 = (longlong)iVar4;
  *(longlong *)(param_1 + 0x28 + lVar1 * 0x10) =
       param_2 - *(longlong *)(param_1 + (lVar1 + 2) * 0x10);
  lVar2 = FUN_1404001b0(param_1,param_2,param_3);
  if (lVar2 == 0) {
    *(undefined8 *)(param_1 + 0x28 + lVar1 * 0x10) = 0xffffffffffffffff;
  }
  return;
}



longlong FUN_140400110(longlong param_1,void *param_2,int param_3)

{
  ulonglong _Size;
  int iVar1;
  
  param_3 = param_3 + -0x31;
  if (((param_3 < 0) || (*(int *)(param_1 + 0x18) <= param_3)) ||
     (*(longlong *)(param_1 + 0x28 + (longlong)param_3 * 0x10) == -1)) {
    param_3 = FUN_1403fbda0(*(undefined8 *)(param_1 + 0x10),"invalid capture index");
  }
  _Size = *(ulonglong *)(param_1 + 0x28 + (longlong)param_3 * 0x10);
  if (_Size <= (ulonglong)(*(longlong *)(param_1 + 8) - (longlong)param_2)) {
    iVar1 = memcmp(*(void **)(param_1 + ((longlong)param_3 + 2) * 0x10),param_2,_Size);
    if (iVar1 == 0) {
      return _Size + (longlong)param_2;
    }
  }
  return 0;
}



char * FUN_1404001b0(undefined8 *param_1,char *param_2,char *param_3)

{
  byte bVar1;
  char cVar2;
  bool bVar3;
  int iVar4;
  uint uVar5;
  char *pcVar6;
  char *pcVar7;
  char cVar8;
  
  do {
    while( true ) {
      cVar8 = *param_3;
      if (cVar8 == '\0') {
        return param_2;
      }
      if (cVar8 == '$') break;
      if (cVar8 != '%') {
        if (cVar8 == '(') {
          if (param_3[1] != ')') {
            pcVar6 = (char *)FUN_1403fffd0(param_1,param_2,param_3 + 1,0xffffffff);
            return pcVar6;
          }
          pcVar6 = (char *)FUN_1403fffd0(param_1,param_2,param_3 + 2,0xfffffffe);
          return pcVar6;
        }
        if (cVar8 == ')') {
          pcVar6 = (char *)FUN_140400060(param_1,param_2,param_3 + 1);
          return pcVar6;
        }
        goto LAB_1404002f6;
      }
      bVar1 = param_3[1];
      if (bVar1 == 0x62) {
        param_2 = (char *)FUN_1403ffda0(param_1,param_2,param_3 + 2);
        if (param_2 == (char *)0x0) {
          return (char *)0x0;
        }
        param_3 = param_3 + 4;
      }
      else if (bVar1 == 0x66) {
        pcVar6 = param_3 + 2;
        if (*pcVar6 != '[') {
          FUN_1403fbda0(param_1[2],"missing \'[\' after \'%%f\' in pattern");
        }
        param_3 = (char *)FUN_1403ff9a0(param_1,pcVar6);
        if (param_2 == (char *)*param_1) {
          cVar8 = '\0';
        }
        else {
          cVar8 = param_2[-1];
        }
        iVar4 = FUN_1403ffba0(cVar8,pcVar6,param_3 + -1);
        if (iVar4 != 0) {
          return (char *)0x0;
        }
        iVar4 = FUN_1403ffba0(*param_2,pcVar6,param_3 + -1);
        if (iVar4 == 0) {
          return (char *)0x0;
        }
      }
      else {
        iVar4 = isdigit((uint)bVar1);
        if (iVar4 == 0) goto LAB_1404002f6;
        param_2 = (char *)FUN_140400110(param_1,param_2,param_3[1]);
        if (param_2 == (char *)0x0) {
          return (char *)0x0;
        }
        param_3 = param_3 + 2;
      }
    }
    if (param_3[1] == '\0') {
      if (param_2 == (char *)param_1[1]) {
        return param_2;
      }
      return (char *)0x0;
    }
LAB_1404002f6:
    pcVar6 = (char *)FUN_1403ff9a0(param_1,param_3);
    if (param_2 < (char *)param_1[1]) {
      cVar8 = *param_3;
      cVar2 = *param_2;
      if (cVar8 == '%') {
        uVar5 = FUN_1403ffa40(cVar2,param_3[1]);
LAB_14040034d:
        if (uVar5 == 0) goto LAB_14040035b;
      }
      else if (cVar8 != '.') {
        if (cVar8 == '[') {
          uVar5 = FUN_1403ffba0(cVar2,param_3,pcVar6 + -1);
        }
        else {
          uVar5 = (uint)(cVar8 == cVar2);
        }
        goto LAB_14040034d;
      }
      bVar3 = true;
    }
    else {
LAB_14040035b:
      bVar3 = false;
    }
    cVar8 = *pcVar6;
    if (cVar8 == '*') {
      pcVar6 = (char *)FUN_1403ffe40(param_1,param_2,param_3,pcVar6);
      return pcVar6;
    }
    if (cVar8 == '+') {
      if (bVar3) {
        pcVar6 = (char *)FUN_1403ffe40(param_1,param_2 + 1,param_3,pcVar6);
        return pcVar6;
      }
      return (char *)0x0;
    }
    if (cVar8 == '-') {
      pcVar6 = (char *)FUN_1403fff10(param_1,param_2,param_3,pcVar6);
      return pcVar6;
    }
    if (cVar8 == '?') {
      if ((bVar3) &&
         (pcVar7 = (char *)FUN_1404001b0(param_1,param_2 + 1,pcVar6 + 1), pcVar7 != (char *)0x0)) {
        return pcVar7;
      }
      param_3 = pcVar6 + 1;
    }
    else {
      if (!bVar3) {
        return (char *)0x0;
      }
      param_2 = param_2 + 1;
      param_3 = pcVar6;
    }
  } while( true );
}



void * FUN_140400450(void *param_1,ulonglong param_2,char *param_3,ulonglong param_4)

{
  int iVar1;
  void *pvVar2;
  size_t _MaxCount;
  void *_Buf1;
  
  if (param_4 != 0) {
    if (param_2 < param_4) {
      param_1 = (void *)0x0;
    }
    else {
      _MaxCount = param_2 - (param_4 - 1);
      while ((_MaxCount != 0 &&
             (pvVar2 = memchr(param_1,(int)*param_3,_MaxCount), pvVar2 != (void *)0x0))) {
        _Buf1 = (void *)((longlong)pvVar2 + 1);
        iVar1 = memcmp(_Buf1,param_3 + 1,param_4 - 1);
        if (iVar1 == 0) {
          return pvVar2;
        }
        _MaxCount = (longlong)param_1 + (_MaxCount - (longlong)_Buf1);
        param_1 = _Buf1;
      }
      param_1 = (void *)0x0;
    }
  }
  return param_1;
}



void FUN_1404004f0(longlong *param_1,int param_2,longlong param_3,longlong param_4)

{
  longlong lVar1;
  longlong lVar2;
  
  if (param_2 < (int)param_1[3]) {
    lVar2 = (longlong)param_2;
    lVar1 = param_1[lVar2 * 2 + 5];
    if (lVar1 == -1) {
      FUN_1403fbda0(param_1[2],"unfinished capture");
    }
    else if (lVar1 == -2) {
      FUN_1404036d0(param_1[2],(param_1[(lVar2 + 2) * 2] - *param_1) + 1);
      return;
    }
    FUN_1404036f0(param_1[2],param_1[(lVar2 + 2) * 2],lVar1);
    return;
  }
  if (param_2 == 0) {
    FUN_1404036f0(param_1[2],param_3,param_4 - param_3);
    return;
  }
  FUN_1403fbda0(param_1[2],"invalid capture index");
  return;
}



int FUN_1404005b0(longlong *param_1,longlong param_2,longlong param_3)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  longlong lVar4;
  longlong lVar5;
  int iVar6;
  
  iVar6 = (int)param_1[3];
  if ((iVar6 == 0) && (param_2 != 0)) {
    iVar6 = 1;
  }
  FUN_1403fbe00(param_1[2],iVar6,"too many captures");
  iVar3 = 0;
  lVar4 = 0;
  if (0 < iVar6) {
    do {
      if (iVar3 < (int)param_1[3]) {
        lVar5 = param_1[lVar4 * 2 + 5];
        if (lVar5 == -1) {
          FUN_1403fbda0(param_1[2],"unfinished capture");
        }
        else if (lVar5 == -2) {
          FUN_1404036d0(param_1[2],(param_1[(lVar4 + 2) * 2] - *param_1) + 1);
          goto LAB_140400667;
        }
        lVar1 = param_1[2];
        lVar2 = param_1[(lVar4 + 2) * 2];
LAB_140400662:
        FUN_1404036f0(lVar1,lVar2,lVar5);
      }
      else {
        lVar1 = param_1[2];
        if (lVar4 == 0) {
          lVar5 = param_3 - param_2;
          lVar2 = param_2;
          goto LAB_140400662;
        }
        FUN_1403fbda0(lVar1,"invalid capture index");
      }
LAB_140400667:
      lVar4 = lVar4 + 1;
      iVar3 = iVar3 + 1;
    } while (lVar4 < iVar6);
  }
  return iVar6;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

ulonglong FUN_1404006c0(undefined8 param_1,int param_2)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  char *_Str;
  ulonglong uVar4;
  char *pcVar5;
  longlong lVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined1 auStack_288 [32];
  ulonglong local_268;
  longlong local_260;
  longlong local_258;
  ulonglong local_250;
  undefined8 local_248;
  undefined4 local_240;
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_288;
  lVar3 = FUN_1403fc7a0(param_1,1,&local_268);
  _Str = (char *)FUN_1403fc7a0(param_1,2,&local_260);
  uVar8 = local_268;
  uVar4 = FUN_1403fc9c0(param_1,3,1);
  if ((longlong)uVar4 < 0) {
    uVar4 = uVar4 + 1 + uVar8;
  }
  uVar8 = 0;
  uVar7 = uVar8;
  if (-1 < (longlong)uVar4) {
    uVar7 = uVar4;
  }
  uVar7 = uVar7 - 1;
  if ((-1 < (longlong)uVar7) && (uVar8 = uVar7, local_268 < uVar7)) {
    uVar8 = local_268;
  }
  if ((param_2 == 0) ||
     ((iVar2 = FUN_1404034b0(param_1,4), iVar2 == 0 &&
      (pcVar5 = strpbrk(_Str,"^$*+?.([%-"), pcVar5 != (char *)0x0)))) {
    cVar1 = *_Str;
    if (cVar1 == '^') {
      _Str = _Str + 1;
    }
    local_250 = local_268 + lVar3;
    uVar4 = uVar8 + lVar3;
    local_258 = lVar3;
    local_248 = param_1;
    do {
      local_240 = 0;
      lVar6 = FUN_1404001b0(&local_258,uVar4,_Str);
      if (lVar6 != 0) {
        if (param_2 != 0) {
          FUN_1404036d0(param_1,(uVar4 - lVar3) + 1);
          FUN_1404036d0(param_1,lVar6 - lVar3);
          iVar2 = FUN_1404005b0(&local_258,0,0);
          return (ulonglong)(iVar2 + 2);
        }
        uVar4 = FUN_1404005b0(&local_258,uVar4,lVar6);
        return uVar4;
      }
    } while ((uVar4 < local_250) && (uVar4 = uVar4 + 1, cVar1 != '^'));
  }
  else {
    lVar6 = FUN_140400450(uVar8 + lVar3,local_268 - uVar8,_Str,local_260);
    if (lVar6 != 0) {
      FUN_1404036d0(param_1,(lVar6 - lVar3) + 1);
      FUN_1404036d0(param_1,(lVar6 - lVar3) + local_260);
      return 2;
    }
  }
  FUN_140403690(param_1);
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1404008f0(undefined8 param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  longlong lVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  undefined1 auStack_278 [32];
  longlong local_258 [2];
  longlong local_248;
  ulonglong local_240;
  undefined8 local_238;
  undefined4 local_230;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_278;
  lVar1 = FUN_1404034e0(param_1,0xffffd8ed,local_258);
  uVar2 = FUN_1404034e0(param_1,0xffffd8ec,0);
  local_240 = local_258[0] + lVar1;
  local_248 = lVar1;
  local_238 = param_1;
  lVar3 = FUN_140403480(param_1,0xffffd8eb);
  uVar5 = lVar1 + lVar3;
  if (uVar5 <= local_240) {
    do {
      local_230 = 0;
      uVar4 = FUN_1404001b0(&local_248,uVar5,uVar2);
      if (uVar4 != 0) {
        lVar1 = uVar4 - lVar1;
        if (uVar4 == uVar5) {
          lVar1 = lVar1 + 1;
        }
        FUN_1404036d0(param_1,lVar1);
        FUN_1404031b0(param_1,0xffffd8eb);
        uVar2 = FUN_1404005b0(&local_248,uVar5,uVar4);
        return uVar2;
      }
      uVar5 = uVar5 + 1;
    } while (uVar5 <= local_240);
  }
  return 0;
}



undefined8 FUN_140400a10(undefined8 param_1)

{
  FUN_1403fc7a0(param_1,1);
  FUN_1403fc7a0(param_1,2);
  FUN_1404030a0(param_1,2);
  FUN_1404036d0(param_1,0);
  FUN_140403850(param_1,FUN_1404008f0,3);
  return 1;
}



void FUN_140400a80(longlong param_1,longlong *param_2,longlong param_3,longlong param_4)

{
  longlong lVar1;
  int iVar2;
  longlong lVar3;
  ulonglong uVar4;
  ulonglong local_res8;
  
  lVar3 = FUN_1404034e0(*(undefined8 *)(param_1 + 0x10),3,&local_res8);
  uVar4 = 0;
  if (local_res8 != 0) {
    do {
      if (*(char *)(uVar4 + lVar3) == '%') {
        lVar1 = uVar4 + 1;
        uVar4 = uVar4 + 1;
        iVar2 = isdigit((uint)*(byte *)(lVar1 + lVar3));
        if (iVar2 == 0) {
          if (param_2 + 0x43 <= (longlong *)*param_2) {
            FUN_1403fbff0(param_2);
          }
          goto LAB_140400b15;
        }
        if (*(char *)(uVar4 + lVar3) == '0') {
          FUN_1403fc050(param_2,param_3,param_4 - param_3);
        }
        else {
          FUN_1404004f0(param_1,*(char *)(uVar4 + lVar3) + -0x31,param_3,param_4);
          FUN_1403fc140(param_2);
        }
      }
      else if ((longlong *)*param_2 < param_2 + 0x43) {
LAB_140400b15:
        *(undefined1 *)*param_2 = *(undefined1 *)(uVar4 + lVar3);
        *param_2 = *param_2 + 1;
      }
      else {
        FUN_1403fbff0(param_2);
        *(undefined1 *)*param_2 = *(undefined1 *)(uVar4 + lVar3);
        *param_2 = *param_2 + 1;
      }
      uVar4 = uVar4 + 1;
    } while (uVar4 < local_res8);
  }
  return;
}



void FUN_140400b90(longlong param_1,undefined8 param_2,longlong param_3,longlong param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  int iVar3;
  undefined4 uVar4;
  
  uVar1 = *(undefined8 *)(param_1 + 0x10);
  iVar3 = FUN_1404032b0(uVar1,3);
  if (2 < iVar3) {
    if (iVar3 < 5) {
      FUN_140400a80(param_1,param_2,param_3,param_4);
      return;
    }
    if (iVar3 == 5) {
      FUN_1404004f0(param_1,0,param_3,param_4);
      FUN_140403980(uVar1,3);
    }
    else if (iVar3 == 6) {
      FUN_140403280(uVar1,3);
      uVar4 = FUN_1404005b0(param_1,param_3,param_4);
      FUN_140403ed0(uVar1,uVar4,1);
    }
  }
  iVar3 = FUN_1404034b0(uVar1,0xffffffff);
  if (iVar3 == 0) {
    FUN_1404030a0(uVar1,0xfffffffe);
    FUN_1404036f0(uVar1,param_3,param_4 - param_3);
  }
  else {
    iVar3 = FUN_140403360(uVar1,0xffffffff);
    if (iVar3 == 0) {
      uVar4 = FUN_1404032b0(uVar1,0xffffffff);
      uVar2 = FUN_1404032e0(uVar1,uVar4);
      FUN_1403fbda0(uVar1,"invalid replacement value (a %s)",uVar2);
    }
  }
  FUN_1403fc140(param_2);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140400cc0(undefined8 param_1)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined1 *puVar4;
  char *pcVar5;
  undefined1 *puVar6;
  int iVar7;
  undefined1 auStack_4a8 [32];
  longlong local_488 [2];
  undefined1 *local_478 [67];
  undefined1 local_260 [8];
  undefined1 *local_258;
  undefined1 *local_250;
  undefined8 local_248;
  undefined4 local_240;
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_4a8;
  puVar4 = (undefined1 *)FUN_1403fc7a0(param_1,1,local_488);
  pcVar5 = (char *)FUN_1403fc7a0(param_1,2,0);
  iVar2 = FUN_1404032b0(param_1,3);
  iVar3 = FUN_1403fc9c0(param_1,4,local_488[0] + 1);
  cVar1 = *pcVar5;
  if (cVar1 == '^') {
    pcVar5 = pcVar5 + 1;
  }
  iVar7 = 0;
  if ((((iVar2 != 3) && (iVar2 != 4)) && (iVar2 != 6)) && (iVar2 != 5)) {
    FUN_1403fc5b0(param_1,3,"string/function/table expected");
  }
  FUN_1403fc200(param_1,local_478);
  local_250 = puVar4 + local_488[0];
  puVar6 = puVar4;
  local_258 = puVar4;
  local_248 = param_1;
  if (iVar3 < 1) {
LAB_140400e4a:
    FUN_1403fc050(local_478,puVar6,(longlong)local_250 - (longlong)puVar6);
    FUN_1403fc0f0(local_478);
    FUN_1404036d0(param_1,(longlong)iVar7);
    return 2;
  }
  do {
    local_240 = 0;
    puVar6 = (undefined1 *)FUN_1404001b0(&local_258,puVar4,pcVar5);
    if (puVar6 == (undefined1 *)0x0) {
LAB_140400df9:
      puVar6 = puVar4;
      if (local_250 <= puVar4) goto LAB_140400e4a;
      if (local_260 <= local_478[0]) {
        FUN_1403fbff0(local_478);
      }
      *local_478[0] = *puVar4;
      local_478[0] = local_478[0] + 1;
      puVar6 = puVar4 + 1;
    }
    else {
      iVar7 = iVar7 + 1;
      FUN_140400b90(&local_258,local_478,puVar4,puVar6);
      if (puVar6 <= puVar4) goto LAB_140400df9;
    }
    if ((cVar1 == '^') || (puVar4 = puVar6, iVar3 <= iVar7)) goto LAB_140400e4a;
  } while( true );
}



void FUN_140400eb0(undefined8 param_1,longlong *param_2,undefined4 param_3)

{
  longlong *plVar1;
  char cVar2;
  char *pcVar3;
  undefined *puVar4;
  undefined8 uVar5;
  longlong local_res10;
  
  pcVar3 = (char *)FUN_1403fc7a0(param_1,param_3,&local_res10);
  plVar1 = param_2 + 0x43;
  if (plVar1 <= (longlong *)*param_2) {
    FUN_1403fbff0(param_2);
  }
  *(undefined1 *)*param_2 = 0x22;
  *param_2 = *param_2 + 1;
  do {
    if (local_res10 == 0) {
      local_res10 = -1;
      if (plVar1 <= (longlong *)*param_2) {
        FUN_1403fbff0(param_2);
      }
      *(undefined1 *)*param_2 = 0x22;
      *param_2 = *param_2 + 1;
      return;
    }
    local_res10 = local_res10 + -1;
    cVar2 = *pcVar3;
    if (cVar2 == '\0') {
      uVar5 = 4;
      puVar4 = &DAT_1404744d8;
LAB_140400f85:
      FUN_1403fc050(param_2,puVar4,uVar5);
    }
    else if (cVar2 == '\n') {
LAB_140400f48:
      if (plVar1 <= (longlong *)*param_2) {
        FUN_1403fbff0(param_2);
      }
      *(undefined1 *)*param_2 = 0x5c;
      *param_2 = *param_2 + 1;
      if (plVar1 <= (longlong *)*param_2) {
        FUN_1403fbff0(param_2);
      }
LAB_140400f6b:
      *(char *)*param_2 = *pcVar3;
      *param_2 = *param_2 + 1;
    }
    else {
      if (cVar2 == '\r') {
        uVar5 = 2;
        puVar4 = &DAT_1404744e0;
        goto LAB_140400f85;
      }
      if ((cVar2 == '\"') || (cVar2 == '\\')) goto LAB_140400f48;
      if ((longlong *)*param_2 < plVar1) goto LAB_140400f6b;
      FUN_1403fbff0(param_2);
      *(char *)*param_2 = *pcVar3;
      *param_2 = *param_2 + 1;
    }
    pcVar3 = pcVar3 + 1;
  } while( true );
}



byte * FUN_140400fd0(undefined8 param_1,byte *param_2,undefined1 *param_3)

{
  byte bVar1;
  byte *pbVar2;
  int iVar3;
  char *pcVar4;
  byte *pbVar5;
  
  bVar1 = *param_2;
  pbVar5 = param_2;
  while ((bVar1 != 0 && (pcVar4 = strchr("-+ #0",(int)(char)*pbVar5), pcVar4 != (char *)0x0))) {
    pbVar5 = pbVar5 + 1;
    bVar1 = *pbVar5;
  }
  if (5 < (ulonglong)((longlong)pbVar5 - (longlong)param_2)) {
    FUN_1403fbda0(param_1,"invalid format (repeated flags)");
  }
  iVar3 = isdigit((uint)*pbVar5);
  if (iVar3 != 0) {
    pbVar5 = pbVar5 + 1;
  }
  iVar3 = isdigit((uint)*pbVar5);
  if (iVar3 != 0) {
    pbVar5 = pbVar5 + 1;
  }
  if (*pbVar5 == 0x2e) {
    iVar3 = isdigit((uint)pbVar5[1]);
    pbVar2 = pbVar5 + 1;
    if (iVar3 != 0) {
      pbVar2 = pbVar5 + 2;
    }
    pbVar5 = pbVar2;
    iVar3 = isdigit((uint)*pbVar5);
    if (iVar3 != 0) {
      pbVar5 = pbVar5 + 1;
    }
  }
  iVar3 = isdigit((uint)*pbVar5);
  if (iVar3 != 0) {
    FUN_1403fbda0(param_1,"invalid format (width or precision too long)");
  }
  *param_3 = 0x25;
  strncpy(param_3 + 1,(char *)param_2,(size_t)(pbVar5 + (1 - (longlong)param_2)));
  param_3[(longlong)(pbVar5 + (2 - (longlong)param_2))] = 0;
  return pbVar5;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1404010e0(undefined8 param_1)

{
  char cVar1;
  undefined1 uVar2;
  char *pcVar3;
  char *pcVar4;
  undefined8 uVar5;
  ulonglong uVar6;
  int iVar7;
  char *pcVar8;
  undefined1 auStack_4a8 [32];
  ulonglong local_488;
  longlong local_480;
  char *local_478 [67];
  char local_260 [6];
  undefined2 uStack_25a;
  char local_258 [32];
  char local_238 [512];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_4a8;
  iVar7 = 1;
  pcVar3 = (char *)FUN_1403fc7a0(param_1,1,&local_480);
  pcVar8 = pcVar3 + local_480;
  FUN_1403fc200(param_1,local_478);
joined_r0x000140401149:
  while( true ) {
    while( true ) {
      if (pcVar8 <= pcVar3) {
        FUN_1403fc0f0(local_478);
        return 1;
      }
      if (*pcVar3 == '%') break;
      if (local_260 <= local_478[0]) {
        FUN_1403fbff0(local_478);
      }
      *local_478[0] = *pcVar3;
      local_478[0] = local_478[0] + 1;
      pcVar3 = pcVar3 + 1;
    }
    if (pcVar3[1] != '%') break;
    if (local_260 <= local_478[0]) {
      FUN_1403fbff0(local_478);
    }
    *local_478[0] = pcVar3[1];
    local_478[0] = local_478[0] + 1;
    pcVar3 = pcVar3 + 2;
  }
  iVar7 = iVar7 + 1;
  pcVar4 = (char *)FUN_140400fd0(param_1,pcVar3 + 1,local_258);
  pcVar3 = pcVar4 + 1;
  switch(*pcVar4) {
  case 'E':
  case 'G':
  case 'e':
  case 'f':
  case 'g':
    FUN_1403fc8b0(param_1,iVar7);
    sprintf(local_238,local_258);
    break;
  default:
    uVar5 = FUN_1403fbda0(param_1,"invalid option \'%%%c\' to \'format\'",(int)*pcVar4);
    return uVar5;
  case 'X':
  case 'o':
  case 'u':
  case 'x':
    uVar6 = 0xffffffffffffffff;
    pcVar4 = local_258;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    uVar6 = ~uVar6;
    uVar2 = *(undefined1 *)((longlong)&uStack_25a + uVar6);
    *(undefined2 *)((longlong)&uStack_25a + uVar6) = 0x6c;
    local_258[uVar6] = '\0';
    *(undefined1 *)((longlong)&uStack_25a + uVar6 + 1) = uVar2;
    FUN_1403fc8b0(param_1,iVar7);
    sprintf(local_238,local_258);
    break;
  case 'c':
    FUN_1403fc8b0(param_1,iVar7);
    sprintf(local_238,local_258);
    break;
  case 'd':
  case 'i':
    uVar6 = 0xffffffffffffffff;
    pcVar4 = local_258;
    do {
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    uVar6 = ~uVar6;
    uVar2 = *(undefined1 *)((longlong)&uStack_25a + uVar6);
    *(undefined2 *)((longlong)&uStack_25a + uVar6) = 0x6c;
    local_258[uVar6] = '\0';
    *(undefined1 *)((longlong)&uStack_25a + uVar6 + 1) = uVar2;
    FUN_1403fc8b0(param_1,iVar7);
    sprintf(local_238,local_258);
    break;
  case 'q':
    FUN_140400eb0(param_1,local_478,iVar7);
    goto joined_r0x000140401149;
  case 's':
    FUN_1403fc7a0(param_1,iVar7,&local_488);
    pcVar4 = strchr(local_258,0x2e);
    if ((pcVar4 != (char *)0x0) || (local_488 < 100)) {
      sprintf(local_238,local_258);
      break;
    }
    FUN_140403280(param_1,iVar7);
    FUN_1403fc140(local_478);
    goto joined_r0x000140401149;
  }
  uVar6 = 0xffffffffffffffff;
  pcVar4 = local_238;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  FUN_1403fc050(local_478,local_238,~uVar6 - 1);
  goto joined_r0x000140401149;
}



undefined8 FUN_140401460(undefined8 param_1)

{
  ulonglong uVar1;
  
  uVar1 = FUN_1403fc8b0(param_1,1);
  FUN_1404036b0(param_1,uVar1 & 0x7fffffffffffffff);
  return 1;
}



undefined8 FUN_1404014a0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = sin(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_1404014d0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = sinh(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401500(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = cos(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401530(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = cosh(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401560(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = tan(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401590(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = tanh(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_1404015c0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = asin(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_1404015f0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = acos(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401620(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = atan(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401650(undefined8 param_1)

{
  double dVar1;
  double _X;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  _X = (double)FUN_1403fc8b0(param_1,2);
  dVar1 = atan2(dVar1,_X);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_1404016b0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = ceil(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_1404016e0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = floor(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401710(undefined8 param_1)

{
  double dVar1;
  double _Y;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  _Y = (double)FUN_1403fc8b0(param_1,2);
  dVar1 = fmod(dVar1,_Y);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401770(undefined8 param_1)

{
  double dVar1;
  double local_res10 [3];
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = modf(dVar1,local_res10);
  FUN_1404036b0(param_1,local_res10[0]);
  FUN_1404036b0(param_1,dVar1);
  return 2;
}



undefined8 FUN_1404017d0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = sqrt(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401800(undefined8 param_1)

{
  double dVar1;
  double _Y;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  _Y = (double)FUN_1403fc8b0(param_1,2);
  dVar1 = pow(dVar1,_Y);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401860(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = log(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401890(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = log10(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_1404018c0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = exp(dVar1);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_1404018f0(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  FUN_1404036b0(param_1,dVar1 / 0.017453292519943295);
  return 1;
}



undefined8 FUN_140401930(undefined8 param_1)

{
  double dVar1;
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  FUN_1404036b0(param_1,dVar1 * 0.017453292519943295);
  return 1;
}



undefined8 FUN_140401970(undefined8 param_1)

{
  double dVar1;
  int local_res10 [6];
  
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = frexp(dVar1,local_res10);
  FUN_1404036b0(param_1,dVar1);
  FUN_1404036d0(param_1,(longlong)local_res10[0]);
  return 2;
}



undefined8 FUN_1404019c0(undefined8 param_1)

{
  int _Y;
  double dVar1;
  
  _Y = FUN_1403fc970(param_1,2);
  dVar1 = (double)FUN_1403fc8b0(param_1,1);
  dVar1 = ldexp(dVar1,_Y);
  FUN_1404036b0(param_1,dVar1);
  return 1;
}



undefined8 FUN_140401a10(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  double dVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  
  iVar1 = FUN_140403090();
  uVar3 = FUN_1403fc8b0(param_1,1);
  iVar2 = 2;
  uVar5 = (undefined4)uVar3;
  uVar6 = (undefined4)((ulonglong)uVar3 >> 0x20);
  if (1 < iVar1) {
    do {
      dVar4 = (double)FUN_1403fc8b0(param_1,iVar2);
      if (dVar4 <= (double)CONCAT44(uVar6,uVar5) && (double)CONCAT44(uVar6,uVar5) != dVar4) {
        uVar5 = SUB84(dVar4,0);
        uVar6 = (undefined4)((ulonglong)dVar4 >> 0x20);
      }
      iVar2 = iVar2 + 1;
    } while (iVar2 <= iVar1);
  }
  FUN_1404036b0(param_1,CONCAT44(uVar6,uVar5));
  return 1;
}



undefined8 FUN_140401a90(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  double dVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  
  iVar1 = FUN_140403090();
  uVar3 = FUN_1403fc8b0(param_1,1);
  iVar2 = 2;
  uVar5 = (undefined4)uVar3;
  uVar6 = (undefined4)((ulonglong)uVar3 >> 0x20);
  if (1 < iVar1) {
    do {
      dVar4 = (double)FUN_1403fc8b0(param_1,iVar2);
      if ((double)CONCAT44(uVar6,uVar5) <= dVar4 && dVar4 != (double)CONCAT44(uVar6,uVar5)) {
        uVar5 = SUB84(dVar4,0);
        uVar6 = (undefined4)((ulonglong)dVar4 >> 0x20);
      }
      iVar2 = iVar2 + 1;
    } while (iVar2 <= iVar1);
  }
  FUN_1404036b0(param_1,CONCAT44(uVar6,uVar5));
  return 1;
}



undefined8 FUN_140401b10(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  double dVar4;
  
  iVar1 = rand();
  dVar4 = (double)(iVar1 % 0x7fff) / 32767.0;
  iVar1 = FUN_140403090(param_1);
  if (iVar1 != 0) {
    if (iVar1 != 1) {
      if (iVar1 == 2) {
        iVar1 = FUN_1403fc970(param_1,1);
        iVar2 = FUN_1403fc970(param_1,2);
        if (iVar2 < iVar1) {
          FUN_1403fc5b0(param_1,2,"interval is empty");
        }
        dVar4 = floor((double)((iVar2 - iVar1) + 1) * dVar4);
        FUN_1404036b0(param_1,dVar4 + (double)iVar1);
        return 1;
      }
      uVar3 = FUN_1403fbda0(param_1,"wrong number of arguments");
      return uVar3;
    }
    iVar1 = FUN_1403fc970(param_1,1);
    if (iVar1 < 1) {
      FUN_1403fc5b0(param_1,1,"interval is empty");
    }
    floor((double)iVar1 * dVar4);
  }
  FUN_1404036b0(param_1);
  return 1;
}



undefined8 FUN_140401c70(undefined8 param_1)

{
  uint _Seed;
  
  _Seed = FUN_1403fc970(param_1,1);
  srand(_Seed);
  return 0;
}



undefined8 FUN_140401c90(undefined8 param_1)

{
  FUN_140403280(param_1,0xffffd8f0);
  return 1;
}



undefined8 FUN_140401cb0(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fc760(param_1,1);
  iVar1 = FUN_140403b10(param_1,1);
  if (iVar1 == 0) {
    FUN_140403690(param_1);
  }
  return 1;
}



undefined8 FUN_140401cf0(undefined8 param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = FUN_1404032b0(param_1,2);
  if ((iVar1 != 0) && (iVar1 != 5)) {
    FUN_1403fc5b0(param_1,2,"nil or table expected");
  }
  FUN_1404030a0(param_1,2);
  uVar2 = FUN_140403d70(param_1,1);
  FUN_140403910(param_1,uVar2);
  return 1;
}



undefined8 FUN_140401d50(undefined8 param_1)

{
  FUN_140403b70(param_1,1);
  return 1;
}



undefined8 FUN_140401d70(undefined8 param_1)

{
  int iVar1;
  
  FUN_1403fc720(param_1,2,5);
  FUN_1404030a0(param_1,2);
  iVar1 = FUN_140403e30(param_1,1);
  if (iVar1 == 0) {
    FUN_1403fbda0(param_1,"\'setfenv\' cannot change environment of given object");
  }
  return 1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140401dc0(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  char *pcVar3;
  undefined8 uVar4;
  char *pcVar5;
  char cVar6;
  bool bVar7;
  undefined1 auStack_c8 [32];
  undefined1 local_a8 [8];
  undefined8 local_a0;
  undefined8 local_98;
  undefined8 local_90;
  undefined8 local_88;
  int local_80;
  int local_7c;
  int local_78;
  int local_74;
  undefined1 local_70 [72];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  iVar1 = FUN_1404032b0(param_1,1);
  bVar7 = iVar1 == 8;
  lVar2 = param_1;
  if (bVar7) {
    lVar2 = FUN_140403600(param_1,1);
  }
  pcVar3 = (char *)FUN_1403fc830(param_1,bVar7 + '\x02',"flnSu",0);
  cVar6 = bVar7 + '\x01';
  iVar1 = FUN_140403330(param_1,cVar6);
  if (iVar1 == 0) {
    iVar1 = FUN_1404032b0(param_1,cVar6);
    if (iVar1 != 6) {
      pcVar3 = "function or level expected";
      goto LAB_140402126;
    }
    FUN_140403800(param_1,&DAT_140474ab0,pcVar3);
    pcVar3 = (char *)FUN_1404034e0(param_1,0xffffffff,0);
    FUN_140403280(param_1,cVar6);
    FUN_140402fe0(param_1,lVar2,1);
  }
  else {
    uVar4 = FUN_140403480();
    iVar1 = FUN_140404510(lVar2,uVar4,local_a8);
    if (iVar1 == 0) {
      FUN_140403690(param_1);
      return 1;
    }
  }
  iVar1 = FUN_140405510(lVar2,pcVar3,local_a8);
  if (iVar1 != 0) {
    FUN_140403aa0(param_1,0,2);
    pcVar5 = strchr(pcVar3,0x53);
    if (pcVar5 != (char *)0x0) {
      FUN_140403760(param_1,local_88);
      FUN_140403bf0(param_1,0xfffffffe,"source");
      FUN_140403760(param_1,local_70);
      FUN_140403bf0(param_1,0xfffffffe,"short_src");
      FUN_1404036d0(param_1,(longlong)local_78);
      FUN_140403bf0(param_1,0xfffffffe,"linedefined");
      FUN_1404036d0(param_1,(longlong)local_74);
      FUN_140403bf0(param_1,0xfffffffe,"lastlinedefined");
      FUN_140403760(param_1,local_90);
      FUN_140403bf0(param_1,0xfffffffe,&DAT_140474a5c);
    }
    pcVar5 = strchr(pcVar3,0x6c);
    if (pcVar5 != (char *)0x0) {
      FUN_1404036d0(param_1,(longlong)local_80);
      FUN_140403bf0(param_1,0xfffffffe,"currentline");
    }
    pcVar5 = strchr(pcVar3,0x75);
    if (pcVar5 != (char *)0x0) {
      FUN_1404036d0(param_1,(longlong)local_7c);
      FUN_140403bf0(param_1,0xfffffffe,&DAT_140474a44);
    }
    pcVar5 = strchr(pcVar3,0x6e);
    if (pcVar5 != (char *)0x0) {
      FUN_140403760(param_1,local_a0);
      FUN_140403bf0(param_1,0xfffffffe,&DAT_14049a5e4);
      FUN_140403760(param_1,local_98);
      FUN_140403bf0(param_1,0xfffffffe,"namewhat");
    }
    pcVar5 = strchr(pcVar3,0x4c);
    if (pcVar5 != (char *)0x0) {
      if (param_1 == lVar2) {
        FUN_140403280(param_1,0xfffffffe);
        FUN_140403100(param_1,0xfffffffd);
      }
      else {
        FUN_140402fe0(lVar2,param_1,1);
      }
      FUN_140403bf0(param_1,0xfffffffe,"activelines");
    }
    pcVar3 = strchr(pcVar3,0x66);
    if (pcVar3 != (char *)0x0) {
      if (param_1 == lVar2) {
        FUN_140403280(param_1,0xfffffffe);
        FUN_140403100(param_1,0xfffffffd);
      }
      else {
        FUN_140402fe0(lVar2,param_1,1);
      }
      FUN_140403bf0(param_1,0xfffffffe,&DAT_140474a1c);
    }
    return 1;
  }
  pcVar3 = "invalid option";
  cVar6 = bVar7 + '\x02';
LAB_140402126:
  uVar4 = FUN_1403fc5b0(param_1,cVar6,pcVar3);
  return uVar4;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140402160(undefined8 param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  longlong lVar4;
  bool bVar5;
  undefined1 auStack_b8 [32];
  undefined1 local_98 [128];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  iVar1 = FUN_1404032b0(param_1,1);
  bVar5 = iVar1 == 8;
  uVar2 = param_1;
  if (bVar5) {
    uVar2 = FUN_140403600(param_1,1);
  }
  uVar3 = FUN_1403fc970(param_1,bVar5 + '\x01');
  iVar1 = FUN_140404510(uVar2,uVar3,local_98);
  if (iVar1 == 0) {
    uVar2 = FUN_1403fc5b0(param_1,bVar5 + '\x01',"level out of range");
  }
  else {
    uVar3 = FUN_1403fc970(param_1,bVar5 + '\x02');
    lVar4 = FUN_140404640(uVar2,local_98,uVar3);
    if (lVar4 == 0) {
      FUN_140403690(param_1);
      uVar2 = 1;
    }
    else {
      FUN_140402fe0(uVar2,param_1,1);
      FUN_140403760(param_1,lVar4);
      FUN_140403280(param_1,0xfffffffe);
      uVar2 = 2;
    }
  }
  return uVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140402270(undefined8 param_1)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  bool bVar4;
  undefined1 auStack_b8 [32];
  undefined1 local_98 [128];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  iVar1 = FUN_1404032b0(param_1,1);
  bVar4 = iVar1 == 8;
  uVar2 = param_1;
  if (bVar4) {
    uVar2 = FUN_140403600(param_1,1);
  }
  uVar3 = FUN_1403fc970(param_1,bVar4 + '\x01');
  iVar1 = FUN_140404510(uVar2,uVar3,local_98);
  if (iVar1 == 0) {
    uVar2 = FUN_1403fc5b0(param_1,bVar4 + '\x01',"level out of range");
  }
  else {
    FUN_1403fc760(param_1,bVar4 + '\x03');
    FUN_1404030a0(param_1,bVar4 + '\x03');
    FUN_140402fe0(param_1,uVar2,1);
    uVar3 = FUN_1403fc970(param_1,bVar4 + '\x02');
    uVar2 = FUN_1404046b0(uVar2,local_98,uVar3);
    FUN_140403760(param_1,uVar2);
    uVar2 = 1;
  }
  return uVar2;
}



undefined8 FUN_140402370(undefined8 param_1)

{
  undefined4 uVar1;
  int iVar2;
  longlong lVar3;
  
  uVar1 = FUN_1403fc970(param_1,2);
  FUN_1403fc720(param_1,1,6);
  iVar2 = FUN_140403300(param_1,1);
  if (iVar2 == 0) {
    lVar3 = FUN_1404042f0(param_1,1,uVar1);
    if (lVar3 != 0) {
      FUN_140403760(param_1,lVar3);
      FUN_140403150(param_1,0xfffffffe);
      return 2;
    }
  }
  return 0;
}



undefined8 FUN_140402400(undefined8 param_1)

{
  undefined4 uVar1;
  int iVar2;
  longlong lVar3;
  
  FUN_1403fc760(param_1,3);
  uVar1 = FUN_1403fc970(param_1,2);
  FUN_1403fc720(param_1,1,6);
  iVar2 = FUN_140403300(param_1,1);
  if (iVar2 == 0) {
    lVar3 = FUN_140404380(param_1,1,uVar1);
    if (lVar3 != 0) {
      FUN_140403760(param_1,lVar3);
      FUN_140403150(param_1,0xffffffff);
      return 1;
    }
  }
  return 0;
}



void FUN_1404024a0(undefined8 param_1,int *param_2)

{
  int iVar1;
  
  FUN_140403930(param_1,&DAT_1404748e0);
  FUN_140403a20(param_1,0xffffd8f0);
  FUN_140403930(param_1,param_1);
  FUN_140403a20(param_1,0xfffffffe);
  iVar1 = FUN_1404032b0(param_1,0xffffffff);
  if (iVar1 == 6) {
    FUN_140403760(param_1,(&PTR_DAT_1404748e8)[*param_2]);
    if (param_2[10] < 0) {
      FUN_140403690(param_1);
    }
    else {
      FUN_1404036d0(param_1,(longlong)param_2[10]);
    }
    FUN_140403ed0(param_1,2);
  }
  return;
}



void FUN_140402540(undefined8 param_1)

{
  int iVar1;
  
  FUN_140403930(param_1,&DAT_1404748e0);
  FUN_140403a20(param_1,0xffffd8f0);
  iVar1 = FUN_1404032b0(param_1,0xffffffff);
  if (iVar1 != 5) {
    FUN_1404030a0(param_1,0xfffffffe);
    FUN_140403aa0(param_1,0,1);
    FUN_140403930(param_1,&DAT_1404748e0);
    FUN_140403280(param_1,0xfffffffe);
    FUN_140403c70(param_1,0xffffd8f0);
  }
  return;
}



undefined8 FUN_1404025c0(undefined8 param_1)

{
  int iVar1;
  int iVar2;
  undefined8 uVar3;
  char *pcVar4;
  char *pcVar5;
  char cVar6;
  code *pcVar7;
  bool bVar8;
  byte bVar9;
  
  iVar1 = FUN_1404032b0(param_1,1);
  pcVar7 = (code *)0x0;
  bVar9 = 0;
  bVar8 = iVar1 == 8;
  iVar1 = 0;
  uVar3 = param_1;
  if (bVar8) {
    uVar3 = FUN_140403600(param_1,1);
  }
  cVar6 = bVar8 + '\x01';
  iVar2 = FUN_1404032b0(param_1,cVar6);
  if (iVar2 < 1) {
    FUN_1404030a0(param_1,cVar6);
  }
  else {
    pcVar4 = (char *)FUN_1403fc7a0(param_1,bVar8 + '\x02',0);
    FUN_1403fc720(param_1,cVar6,6);
    iVar1 = FUN_1403fc9c0(param_1,bVar8 + '\x03',0);
    pcVar7 = FUN_1404024a0;
    pcVar5 = strchr(pcVar4,99);
    bVar9 = pcVar5 != (char *)0x0;
    pcVar5 = strchr(pcVar4,0x72);
    if (pcVar5 != (char *)0x0) {
      bVar9 = bVar9 | 2;
    }
    pcVar4 = strchr(pcVar4,0x6c);
    if (pcVar4 != (char *)0x0) {
      bVar9 = bVar9 | 4;
    }
    if (0 < iVar1) {
      bVar9 = bVar9 | 8;
    }
  }
  FUN_140402540(param_1);
  FUN_140403930(param_1,uVar3);
  FUN_140403280(param_1,cVar6);
  FUN_140403c70(param_1,0xfffffffd);
  FUN_1404030a0(param_1,0xfffffffe);
  FUN_1404044b0(uVar3,pcVar7,bVar9,iVar1);
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140402720(undefined8 param_1)

{
  int iVar1;
  uint uVar2;
  undefined8 uVar3;
  code *pcVar4;
  longlong lVar5;
  uint uVar6;
  bool bVar7;
  undefined1 auStack_38 [32];
  undefined1 local_18 [8];
  ulonglong local_10;
  
  local_10 = DAT_1405d84f0 ^ (ulonglong)auStack_38;
  iVar1 = FUN_1404032b0(param_1,1);
  uVar3 = param_1;
  if (iVar1 == 8) {
    uVar3 = FUN_140403600(param_1,1);
  }
  uVar2 = FUN_1404044f0(uVar3);
  pcVar4 = (code *)FUN_1404044e0(uVar3);
  if ((pcVar4 == (code *)0x0) || (pcVar4 == FUN_1404024a0)) {
    FUN_140402540(param_1);
    FUN_140403930(param_1,uVar3);
    FUN_140403a20(param_1,0xfffffffe);
    FUN_140403100(param_1,0xfffffffe);
  }
  else {
    FUN_1404036f0(param_1,"external hook",0xd);
  }
  bVar7 = (uVar2 & 1) != 0;
  if (bVar7) {
    local_18[0] = 99;
  }
  uVar6 = (uint)bVar7;
  if ((uVar2 & 2) != 0) {
    lVar5 = (longlong)(int)uVar6;
    uVar6 = uVar6 + 1;
    local_18[lVar5] = 0x72;
  }
  if ((uVar2 & 4) != 0) {
    lVar5 = (longlong)(int)uVar6;
    uVar6 = uVar6 + 1;
    local_18[lVar5] = 0x6c;
  }
  local_18[(int)uVar6] = 0;
  FUN_140403760(param_1,local_18);
  iVar1 = FUN_140404500(uVar3);
  FUN_1404036d0(param_1,(longlong)iVar1);
  return 3;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_140402850(undefined8 param_1)

{
  char cVar1;
  int iVar2;
  FILE *pFVar3;
  char *pcVar4;
  longlong lVar5;
  ulonglong uVar6;
  char *pcVar7;
  bool bVar8;
  undefined1 auStack_138 [32];
  char local_118 [256];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_138;
  pFVar3 = __iob_func();
  fputs("lua_debug> ",pFVar3 + 2);
  pFVar3 = __iob_func();
  pcVar4 = fgets(local_118,0xfa,pFVar3);
  if (pcVar4 != (char *)0x0) {
    bVar8 = false;
    do {
      lVar5 = 6;
      pcVar4 = local_118;
      pcVar7 = "cont\n";
      do {
        if (lVar5 == 0) break;
        lVar5 = lVar5 + -1;
        bVar8 = *pcVar4 == *pcVar7;
        pcVar4 = pcVar4 + 1;
        pcVar7 = pcVar7 + 1;
      } while (bVar8);
      if (bVar8) {
        return 0;
      }
      uVar6 = 0xffffffffffffffff;
      pcVar4 = local_118;
      do {
        if (uVar6 == 0) break;
        uVar6 = uVar6 - 1;
        cVar1 = *pcVar4;
        pcVar4 = pcVar4 + 1;
      } while (cVar1 != '\0');
      iVar2 = FUN_1403fc580(param_1,local_118,~uVar6 - 1,"=(debug command)");
      if ((iVar2 != 0) || (iVar2 = FUN_140403f30(param_1,0,0,0), iVar2 != 0)) {
        pFVar3 = __iob_func();
        pcVar4 = (char *)FUN_1404034e0(param_1,0xffffffff,0);
        fputs(pcVar4,pFVar3 + 2);
        pFVar3 = __iob_func();
        fputs("\n",pFVar3 + 2);
      }
      FUN_1404030a0(param_1,0);
      pFVar3 = __iob_func();
      fputs("lua_debug> ",pFVar3 + 2);
      pFVar3 = __iob_func();
      pcVar4 = fgets(local_118,0xfa,pFVar3);
      bVar8 = pcVar4 == (char *)0x0;
    } while (!bVar8);
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_1404029d0(longlong param_1)

{
  char cVar1;
  bool bVar2;
  int iVar3;
  uint uVar4;
  uint uVar5;
  longlong lVar6;
  undefined1 *puVar7;
  undefined8 uVar8;
  uint uVar9;
  undefined1 auStack_c8 [32];
  undefined1 local_a8 [8];
  undefined8 local_a0;
  char *local_98;
  char *local_90;
  int local_80;
  undefined4 local_78;
  undefined1 local_70 [72];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  bVar2 = true;
  iVar3 = FUN_1404032b0(param_1,1);
  lVar6 = param_1;
  if (iVar3 == 8) {
    lVar6 = FUN_140403600(param_1);
  }
  uVar9 = (uint)(iVar3 == 8);
  iVar3 = FUN_140403330(param_1,uVar9 + 2);
  if (iVar3 == 0) {
    uVar4 = (uint)(param_1 == lVar6);
  }
  else {
    uVar4 = FUN_140403480(param_1,uVar9 + 2);
    FUN_1404030a0(param_1,0xfffffffe);
  }
  uVar5 = FUN_140403090(param_1);
  if (uVar5 == uVar9) {
    uVar8 = 0;
    puVar7 = &DAT_14047e238;
  }
  else {
    iVar3 = FUN_140403360(param_1,uVar9 + 1);
    if (iVar3 == 0) {
      return 1;
    }
    uVar8 = 1;
    puVar7 = &DAT_14047e244;
  }
  FUN_1404036f0(param_1,puVar7,uVar8);
  FUN_1404036f0(param_1,"stack traceback:",0x10);
  iVar3 = FUN_140404510(lVar6,uVar4,local_a8);
  while (iVar3 != 0) {
    uVar5 = uVar4 + 1;
    if (((int)uVar5 < 0xd) || (!bVar2)) {
      FUN_1404036f0(param_1,&DAT_140474b60,2);
      FUN_140405510(lVar6,&DAT_140474b5c,local_a8);
      FUN_140403800(param_1,&DAT_140474b58,local_70);
      if (0 < local_80) {
        FUN_140403800(param_1,&DAT_140474b54);
      }
      if (*local_98 == '\0') {
        cVar1 = *local_90;
        if (cVar1 == 'm') {
          FUN_140403800(param_1," in main chunk");
        }
        else if ((cVar1 == 'C') || (cVar1 == 't')) {
          FUN_1404036f0(param_1,&DAT_140474b14,2);
        }
        else {
          FUN_140403800(param_1," in function <%s:%d>",local_70,local_78);
        }
      }
      else {
        FUN_140403800(param_1," in function \'%s\'",local_a0);
      }
      iVar3 = FUN_140403090(param_1);
      FUN_140404260(param_1,iVar3 - uVar9);
      uVar4 = uVar5;
    }
    else {
      iVar3 = FUN_140404510(lVar6,uVar4 + 0xb,local_a8);
      if (iVar3 == 0) {
        bVar2 = false;
      }
      else {
        FUN_1404036f0(param_1,"\n\t...",5);
        iVar3 = FUN_140404510(lVar6,uVar4 + 0xb,local_a8);
        while (iVar3 != 0) {
          iVar3 = FUN_140404510(lVar6,uVar5 + 0xb,local_a8);
          uVar5 = uVar5 + 1;
        }
        bVar2 = false;
        uVar4 = uVar5;
      }
    }
    iVar3 = FUN_140404510(lVar6,uVar4,local_a8);
  }
  iVar3 = FUN_140403090(param_1);
  FUN_140404260(param_1,iVar3 - uVar9);
  return 1;
}



void FUN_140402c80(longlong param_1,undefined8 param_2)

{
  longlong lVar1;
  
  lVar1 = FUN_1404069e0(param_2,0,0,0x140);
  *(longlong *)(param_1 + 0x50) = lVar1;
  *(longlong *)(param_1 + 0x28) = lVar1;
  *(undefined4 *)(param_1 + 0x5c) = 8;
  *(longlong *)(param_1 + 0x48) = lVar1 + 0x118;
  lVar1 = FUN_1404069e0(param_2,0,0,0x2d0);
  *(longlong *)(param_1 + 0x10) = lVar1;
  *(longlong *)(param_1 + 0x40) = lVar1;
  *(longlong *)(param_1 + 0x38) = lVar1 + 0x270;
  *(undefined4 *)(param_1 + 0x58) = 0x2d;
  *(longlong *)(*(longlong *)(param_1 + 0x28) + 8) = lVar1;
  *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 8) = 0;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  **(undefined8 **)(param_1 + 0x28) = *(undefined8 *)(param_1 + 0x10);
  *(undefined8 *)(param_1 + 0x18) = **(undefined8 **)(param_1 + 0x28);
  (*(undefined8 **)(param_1 + 0x28))[2] = *(longlong *)(param_1 + 0x10) + 0x140;
  return;
}



longlong FUN_140402d30(longlong param_1)

{
  undefined4 uVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  lVar3 = FUN_1404069e0(param_1,0,0,0xb8);
  FUN_14040ad20(param_1,lVar3,8);
  uVar2 = *(undefined8 *)(param_1 + 0x20);
  *(undefined8 *)(lVar3 + 0x40) = 0;
  *(undefined8 *)(lVar3 + 0x20) = uVar2;
  *(undefined8 *)(lVar3 + 0xa8) = 0;
  *(undefined8 *)(lVar3 + 0x70) = 0;
  *(undefined8 *)(lVar3 + 0x68) = 0;
  *(undefined8 *)(lVar3 + 0x98) = 0;
  *(undefined8 *)(lVar3 + 0x58) = 0;
  *(undefined4 *)(lVar3 + 0x62) = 0x1000000;
  *(undefined2 *)(lVar3 + 0x60) = 0;
  *(undefined1 *)(lVar3 + 10) = 0;
  *(undefined8 *)(lVar3 + 0x28) = 0;
  *(undefined8 *)(lVar3 + 0x50) = 0;
  *(undefined8 *)(lVar3 + 0x30) = 0;
  *(undefined8 *)(lVar3 + 0xb0) = 0;
  *(undefined4 *)(lVar3 + 0x80) = 0;
  FUN_140402c80(lVar3,param_1);
  *(undefined8 *)(lVar3 + 0x78) = *(undefined8 *)(param_1 + 0x78);
  *(undefined4 *)(lVar3 + 0x80) = *(undefined4 *)(param_1 + 0x80);
  *(undefined1 *)(lVar3 + 100) = *(undefined1 *)(param_1 + 100);
  uVar1 = *(undefined4 *)(param_1 + 0x68);
  *(undefined4 *)(lVar3 + 0x68) = uVar1;
  uVar2 = *(undefined8 *)(param_1 + 0x70);
  *(undefined4 *)(lVar3 + 0x6c) = uVar1;
  *(undefined8 *)(lVar3 + 0x70) = uVar2;
  return lVar3;
}



void FUN_140402e00(undefined8 param_1,longlong param_2)

{
  FUN_14040b010(param_2,*(undefined8 *)(param_2 + 0x40));
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x50),(longlong)*(int *)(param_2 + 0x5c) * 0x28,0)
  ;
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x40),(longlong)*(int *)(param_2 + 0x58) << 4,0);
  FUN_1404069e0(param_1,param_2,0xb8,0);
  return;
}



undefined8 * FUN_140402e70(longlong param_1,int param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  
  if (param_2 < 1) {
    if (-10000 < param_2) {
      return (undefined8 *)((longlong)param_2 * 0x10 + *(longlong *)(param_1 + 0x10));
    }
    if (param_2 == -0x2712) {
      return (undefined8 *)(param_1 + 0x78);
    }
    if (param_2 == -0x2711) {
      uVar2 = *(undefined8 *)(**(longlong **)(*(longlong *)(param_1 + 0x28) + 8) + 0x18);
      *(undefined4 *)(param_1 + 0x90) = 5;
      *(undefined8 *)(param_1 + 0x88) = uVar2;
      return (undefined8 *)(param_1 + 0x88);
    }
    if (param_2 == -10000) {
      return (undefined8 *)(*(longlong *)(param_1 + 0x20) + 0xa0);
    }
    lVar1 = **(longlong **)(*(longlong *)(param_1 + 0x28) + 8);
    if (-param_2 + -0x2712 <= (int)(uint)*(byte *)(lVar1 + 0xb)) {
      return (undefined8 *)(lVar1 + 0x28 + (longlong)(-param_2 + -0x2713) * 0x10);
    }
  }
  else {
    puVar3 = (undefined8 *)((longlong)(param_2 + -1) * 0x10 + *(longlong *)(param_1 + 0x18));
    if (puVar3 < *(undefined8 **)(param_1 + 0x10)) {
      return puVar3;
    }
  }
  return (undefined8 *)&DAT_140475320;
}



void FUN_140402f20(longlong param_1,undefined8 *param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  *puVar1 = *param_2;
  *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(param_2 + 1);
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



undefined8 FUN_140402f40(longlong param_1,int param_2)

{
  ulonglong uVar1;
  
  if (param_2 < 0x1f41) {
    if ((*(longlong *)(param_1 + 0x10) - *(longlong *)(param_1 + 0x18) >> 4) + (longlong)param_2 <
        0x1f41) {
      if (param_2 < 1) {
        return 1;
      }
      if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) <= (longlong)(param_2 << 4))
      {
        FUN_140405ae0(param_1);
      }
      uVar1 = *(longlong *)(param_1 + 0x10) + (longlong)param_2 * 0x10;
      if (uVar1 <= *(ulonglong *)(*(longlong *)(param_1 + 0x28) + 0x10)) {
        return 1;
      }
      *(ulonglong *)(*(longlong *)(param_1 + 0x28) + 0x10) = uVar1;
      return 1;
    }
  }
  return 0;
}



void FUN_140402fe0(longlong param_1,longlong param_2,int param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  longlong lVar3;
  longlong lVar4;
  
  if (param_1 != param_2) {
    lVar4 = (longlong)param_3;
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + lVar4 * -0x10;
    if (0 < param_3) {
      lVar3 = 0;
      do {
        lVar1 = *(longlong *)(param_1 + 0x10);
        puVar2 = *(undefined8 **)(param_2 + 0x10);
        lVar4 = lVar4 + -1;
        *(undefined8 **)(param_2 + 0x10) = puVar2 + 2;
        *puVar2 = *(undefined8 *)(lVar3 + lVar1);
        *(undefined4 *)(puVar2 + 1) = *(undefined4 *)(lVar3 + 8 + lVar1);
        lVar3 = lVar3 + 0x10;
      } while (lVar4 != 0);
    }
  }
  return;
}



void FUN_140403040(longlong param_1,longlong param_2)

{
  *(undefined2 *)(param_2 + 0x60) = *(undefined2 *)(param_1 + 0x60);
  return;
}



void FUN_140403050(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
      *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
    FUN_14040aa00();
  }
  uVar2 = FUN_140402d30(param_1);
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  *puVar1 = uVar2;
  *(undefined4 *)(puVar1 + 1) = 8;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



longlong FUN_140403090(longlong param_1)

{
  return *(longlong *)(param_1 + 0x10) - *(longlong *)(param_1 + 0x18) >> 4;
}



void FUN_1404030a0(longlong param_1,int param_2)

{
  longlong lVar1;
  
  if (param_2 < 0) {
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + (longlong)(param_2 + 1) * 0x10;
    return;
  }
  lVar1 = (longlong)param_2;
  if (*(ulonglong *)(param_1 + 0x10) < (ulonglong)(*(longlong *)(param_1 + 0x18) + lVar1 * 0x10)) {
    do {
      *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 8) = 0;
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
    } while (*(ulonglong *)(param_1 + 0x10) <
             (ulonglong)(*(longlong *)(param_1 + 0x18) + lVar1 * 0x10));
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x18) + lVar1 * 0x10;
  return;
}



void FUN_140403100(longlong param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  
  lVar1 = FUN_140402e70();
  puVar2 = (undefined8 *)(lVar1 + 0x10);
  if (puVar2 < *(undefined8 **)(param_1 + 0x10)) {
    do {
      puVar3 = puVar2 + 2;
      puVar2[-2] = *puVar2;
      *(undefined4 *)(puVar2 + -1) = *(undefined4 *)(puVar2 + 1);
      puVar2 = puVar3;
    } while (puVar3 < *(undefined8 **)(param_1 + 0x10));
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  return;
}



void FUN_140403150(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)FUN_140402e70();
  for (puVar1 = *(undefined8 **)(param_1 + 0x10); puVar2 < puVar1; puVar1 = puVar1 + -2) {
    *puVar1 = puVar1[-2];
    *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar1 + -1);
  }
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  *puVar2 = *puVar1;
  *(undefined4 *)(puVar2 + 1) = *(undefined4 *)(puVar1 + 1);
  return;
}



void FUN_1404031b0(longlong param_1,int param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  if ((param_2 == -0x2711) && (*(longlong *)(param_1 + 0x28) == *(longlong *)(param_1 + 0x50))) {
    FUN_140405330(param_1,"no calling environment");
  }
  puVar1 = (undefined8 *)FUN_140402e70(param_1,param_2);
  if (param_2 == -0x2711) {
    lVar2 = **(longlong **)(*(longlong *)(param_1 + 0x28) + 8);
    *(undefined8 *)(lVar2 + 0x18) = *(undefined8 *)(*(longlong *)(param_1 + 0x10) + -0x10);
    if ((*(int *)(*(longlong *)(param_1 + 0x10) + -8) < 4) ||
       ((*(byte *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10) + 9) & 3) == 0))
    goto LAB_140403269;
  }
  else {
    lVar2 = *(longlong *)(param_1 + 0x10);
    *puVar1 = *(undefined8 *)(lVar2 + -0x10);
    *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(lVar2 + -8);
    if (((-0x2713 < param_2) || (*(int *)(*(longlong *)(param_1 + 0x10) + -8) < 4)) ||
       ((*(byte *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10) + 9) & 3) == 0))
    goto LAB_140403269;
    lVar2 = **(longlong **)(*(longlong *)(param_1 + 0x28) + 8);
  }
  if ((*(byte *)(lVar2 + 9) & 4) != 0) {
    FUN_14040acd0(param_1);
  }
LAB_140403269:
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  return;
}



void FUN_140403280(longlong param_1)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)FUN_140402e70();
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  *puVar1 = *puVar2;
  *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar2 + 1);
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



undefined4 FUN_1404032b0(void)

{
  undefined *puVar1;
  
  puVar1 = (undefined *)FUN_140402e70();
  if (puVar1 == &DAT_140475320) {
    return 0xffffffff;
  }
  return *(undefined4 *)(puVar1 + 8);
}



char * FUN_1404032e0(undefined8 param_1,int param_2)

{
  if (param_2 == -1) {
    return "no value";
  }
  return (&PTR_DAT_1404751b0)[param_2];
}



undefined8 FUN_140403300(void)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)FUN_140402e70();
  if (((int)plVar1[1] == 6) && (*(char *)(*plVar1 + 10) != '\0')) {
    return 1;
  }
  return 0;
}



undefined8 FUN_140403330(void)

{
  longlong lVar1;
  undefined1 local_18 [24];
  
  lVar1 = FUN_140402e70();
  if (*(int *)(lVar1 + 8) != 3) {
    lVar1 = FUN_14040b9f0(lVar1,local_18);
    if (lVar1 == 0) {
      return 0;
    }
  }
  return 1;
}



undefined8 FUN_140403360(void)

{
  undefined *puVar1;
  
  puVar1 = (undefined *)FUN_140402e70();
  if ((puVar1 != &DAT_140475320) && ((*(int *)(puVar1 + 8) == 4 || (*(int *)(puVar1 + 8) == 3)))) {
    return 1;
  }
  return 0;
}



undefined8 FUN_1404033a0(undefined8 param_1,undefined8 param_2,uint param_3)

{
  undefined *puVar1;
  undefined *puVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  
  uVar4 = (ulonglong)param_3;
  puVar1 = (undefined *)FUN_140402e70();
  puVar2 = (undefined *)FUN_140402e70(param_1,uVar4 & 0xffffffff);
  if ((puVar1 != &DAT_140475320) && (puVar2 != &DAT_140475320)) {
    uVar3 = FUN_14040b340(puVar1,puVar2);
    return uVar3;
  }
  return 0;
}



undefined8 FUN_1404033f0(undefined8 param_1,undefined8 param_2,ulonglong param_3)

{
  undefined *puVar1;
  undefined *puVar2;
  undefined8 uVar3;
  
  param_3 = param_3 & 0xffffffff;
  puVar1 = (undefined *)FUN_140402e70();
  puVar2 = (undefined *)FUN_140402e70(param_1,param_3 & 0xffffffff);
  if ((puVar1 != &DAT_140475320) && (puVar2 != &DAT_140475320)) {
    uVar3 = FUN_14040c280(param_1,puVar1,puVar2);
    return uVar3;
  }
  return 0;
}



undefined8 FUN_140403440(void)

{
  undefined8 *puVar1;
  undefined1 local_18 [24];
  
  puVar1 = (undefined8 *)FUN_140402e70();
  if (*(int *)(puVar1 + 1) != 3) {
    puVar1 = (undefined8 *)FUN_14040b9f0(puVar1,local_18);
    if (puVar1 == (undefined8 *)0x0) {
      return 0;
    }
  }
  return *puVar1;
}



longlong FUN_140403480(void)

{
  double *pdVar1;
  undefined1 local_18 [24];
  
  pdVar1 = (double *)FUN_140402e70();
  if (*(int *)(pdVar1 + 1) != 3) {
    pdVar1 = (double *)FUN_14040b9f0(pdVar1,local_18);
    if (pdVar1 == (double *)0x0) {
      return 0;
    }
  }
  return (longlong)*pdVar1;
}



undefined8 FUN_1404034b0(void)

{
  int *piVar1;
  
  piVar1 = (int *)FUN_140402e70();
  if ((piVar1[2] != 0) && ((piVar1[2] != 1 || (*piVar1 != 0)))) {
    return 1;
  }
  return 0;
}



longlong FUN_1404034e0(longlong param_1,undefined4 param_2,undefined8 *param_3)

{
  int iVar1;
  longlong *plVar2;
  
  plVar2 = (longlong *)FUN_140402e70();
  if ((int)plVar2[1] != 4) {
    iVar1 = FUN_14040ba50(param_1,plVar2);
    if (iVar1 == 0) {
      if (param_3 != (undefined8 *)0x0) {
        *param_3 = 0;
      }
      return 0;
    }
    if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
        *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
      FUN_14040aa00(param_1);
    }
    plVar2 = (longlong *)FUN_140402e70(param_1,param_2);
  }
  if (param_3 != (undefined8 *)0x0) {
    *param_3 = *(undefined8 *)(*plVar2 + 0x10);
  }
  return *plVar2 + 0x18;
}



longlong FUN_140403580(undefined8 param_1)

{
  int iVar1;
  longlong *plVar2;
  
  plVar2 = (longlong *)FUN_140402e70();
  iVar1 = (int)plVar2[1];
  if (iVar1 == 3) {
    iVar1 = FUN_14040ba50(param_1,plVar2);
    if (iVar1 != 0) {
      return *(longlong *)(*plVar2 + 0x10);
    }
  }
  else {
    if (iVar1 == 4) {
      return *(longlong *)(*plVar2 + 0x10);
    }
    if (iVar1 == 5) {
      iVar1 = FUN_140409060(*plVar2);
      return (longlong)iVar1;
    }
    if (iVar1 == 7) {
      return *(longlong *)(*plVar2 + 0x20);
    }
  }
  return 0;
}



undefined8 FUN_140403600(void)

{
  undefined8 *puVar1;
  
  puVar1 = (undefined8 *)FUN_140402e70();
  if (*(int *)(puVar1 + 1) != 8) {
    return 0;
  }
  return *puVar1;
}



longlong FUN_140403620(undefined8 param_1,ulonglong param_2)

{
  int iVar1;
  longlong *plVar2;
  
  param_2 = param_2 & 0xffffffff;
  plVar2 = (longlong *)FUN_140402e70();
  iVar1 = (int)plVar2[1];
  if (iVar1 != 2) {
    if ((iVar1 == 5) || (iVar1 == 6)) goto LAB_140403679;
    if (iVar1 != 7) {
      if (iVar1 != 8) {
        return 0;
      }
      goto LAB_140403679;
    }
  }
  plVar2 = (longlong *)FUN_140402e70(param_1,param_2 & 0xffffffff);
  if ((int)plVar2[1] != 2) {
    if ((int)plVar2[1] != 7) {
      return 0;
    }
    return *plVar2 + 0x28;
  }
LAB_140403679:
  return *plVar2;
}



void FUN_140403690(longlong param_1)

{
  *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 8) = 0;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_1404036b0(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  *puVar1 = param_2;
  *(undefined4 *)(puVar1 + 1) = 3;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_1404036d0(longlong param_1,longlong param_2)

{
  double *pdVar1;
  
  pdVar1 = *(double **)(param_1 + 0x10);
  *(undefined4 *)(pdVar1 + 1) = 3;
  *pdVar1 = (double)param_2;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_1404036f0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
      *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
    FUN_14040aa00();
  }
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  uVar2 = FUN_140406c30(param_1,param_2,param_3);
  *puVar1 = uVar2;
  *(undefined4 *)(puVar1 + 1) = 4;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_140403760(longlong param_1,char *param_2)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  
  if (param_2 == (char *)0x0) {
    *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 8) = 0;
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
    return;
  }
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_2;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_1404036f0(param_1,(int)param_2,~uVar2 - 1);
  return;
}



void FUN_1404037b0(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
      *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
    FUN_14040aa00();
  }
  FUN_14040b4f0(param_1,param_2,param_3);
  return;
}



void FUN_140403800(longlong 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;
  if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
      *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
    FUN_14040aa00();
  }
  FUN_14040b4f0(param_1,param_2,&local_res18);
  return;
}



void FUN_140403850(longlong param_1,undefined8 param_2,int param_3)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  undefined8 *puVar5;
  uint uVar6;
  ulonglong uVar7;
  undefined8 uVar8;
  
  uVar7 = (ulonglong)param_3;
  if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
      *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
    FUN_14040aa00();
  }
  if (*(longlong *)(param_1 + 0x28) == *(longlong *)(param_1 + 0x50)) {
    uVar8 = *(undefined8 *)(param_1 + 0x78);
  }
  else {
    uVar8 = *(undefined8 *)(**(longlong **)(*(longlong *)(param_1 + 0x28) + 8) + 0x18);
  }
  lVar2 = FUN_14040add0(param_1,param_3,uVar8);
  *(undefined8 *)(lVar2 + 0x20) = param_2;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + uVar7 * -0x10;
  if (param_3 != 0) {
    puVar4 = (undefined8 *)(lVar2 + 0x28 + uVar7 * 0x10);
    do {
      puVar5 = puVar4 + -2;
      lVar3 = *(longlong *)(param_1 + 0x10) + (-0x28 - lVar2);
      uVar6 = (int)uVar7 - 1;
      uVar7 = (ulonglong)uVar6;
      *puVar5 = *(undefined8 *)(lVar3 + (longlong)puVar5);
      *(undefined4 *)(puVar4 + -1) = *(undefined4 *)(lVar3 + 8 + (longlong)puVar5);
      puVar4 = puVar5;
    } while (uVar6 != 0);
  }
  plVar1 = *(longlong **)(param_1 + 0x10);
  *plVar1 = lVar2;
  *(undefined4 *)(plVar1 + 1) = 6;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_140403910(longlong param_1,int param_2)

{
  uint *puVar1;
  
  puVar1 = *(uint **)(param_1 + 0x10);
  puVar1[2] = 1;
  *puVar1 = (uint)(param_2 != 0);
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_140403930(longlong param_1,undefined8 param_2)

{
  undefined8 *puVar1;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  *puVar1 = param_2;
  *(undefined4 *)(puVar1 + 1) = 2;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



bool FUN_140403950(longlong param_1)

{
  longlong *plVar1;
  
  plVar1 = *(longlong **)(param_1 + 0x10);
  *plVar1 = param_1;
  *(undefined4 *)(plVar1 + 1) = 8;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xb0) == param_1;
}



void FUN_140403980(longlong param_1)

{
  undefined8 uVar1;
  longlong lVar2;
  
  uVar1 = FUN_140402e70();
  lVar2 = *(longlong *)(param_1 + 0x10) + -0x10;
  FUN_14040bd00(param_1,uVar1,lVar2,lVar2);
  return;
}



void FUN_1404039b0(longlong param_1,undefined8 param_2,char *param_3)

{
  char cVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  char *pcVar4;
  undefined8 local_18;
  undefined4 local_10;
  
  uVar2 = FUN_140402e70();
  uVar3 = 0xffffffffffffffff;
  pcVar4 = param_3;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  local_18 = FUN_140406c30(param_1,param_3,~uVar3 - 1);
  local_10 = 4;
  FUN_14040bd00(param_1,uVar2,&local_18,*(undefined8 *)(param_1 + 0x10));
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_140403a20(longlong param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  
  puVar2 = (undefined8 *)FUN_140402e70();
  puVar2 = (undefined8 *)FUN_140408c50(*puVar2,*(longlong *)(param_1 + 0x10) + -0x10);
  lVar1 = *(longlong *)(param_1 + 0x10);
  *(undefined8 *)(lVar1 + -0x10) = *puVar2;
  *(undefined4 *)(lVar1 + -8) = *(undefined4 *)(puVar2 + 1);
  return;
}



void FUN_140403a60(longlong param_1,undefined8 param_2,ulonglong param_3)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  
  param_3 = param_3 & 0xffffffff;
  puVar1 = (undefined8 *)FUN_140402e70();
  puVar2 = (undefined8 *)FUN_140408b70(*puVar1,param_3 & 0xffffffff);
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  *puVar1 = *puVar2;
  *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(puVar2 + 1);
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_140403aa0(longlong param_1,undefined4 param_2,undefined4 param_3)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
      *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
    FUN_14040aa00();
  }
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  uVar2 = FUN_140408a50(param_1,param_2,param_3);
  *puVar1 = uVar2;
  *(undefined4 *)(puVar1 + 1) = 5;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



undefined8 FUN_140403b10(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  
  plVar2 = (longlong *)FUN_140402e70();
  iVar1 = (int)plVar2[1];
  if ((iVar1 == 5) || (iVar1 == 7)) {
    lVar3 = *(longlong *)(*plVar2 + 0x10);
  }
  else {
    lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xe0 + (longlong)iVar1 * 8);
  }
  if (lVar3 == 0) {
    return 0;
  }
  plVar2 = *(longlong **)(param_1 + 0x10);
  *plVar2 = lVar3;
  *(undefined4 *)(plVar2 + 1) = 5;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return 1;
}



void FUN_140403b70(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined8 *puVar3;
  undefined8 uVar4;
  longlong *plVar5;
  
  plVar5 = (longlong *)FUN_140402e70();
  iVar1 = (int)plVar5[1];
  if ((iVar1 != 6) && (iVar1 != 7)) {
    if (iVar1 != 8) {
      *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 8) = 0;
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
      return;
    }
    lVar2 = *plVar5;
    puVar3 = *(undefined8 **)(param_1 + 0x10);
    *puVar3 = *(undefined8 *)(lVar2 + 0x78);
    *(undefined4 *)(puVar3 + 1) = *(undefined4 *)(lVar2 + 0x80);
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
    return;
  }
  puVar3 = *(undefined8 **)(param_1 + 0x10);
  uVar4 = *(undefined8 *)(*plVar5 + 0x18);
  *(undefined4 *)(puVar3 + 1) = 5;
  *puVar3 = uVar4;
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_140403bf0(longlong param_1,undefined8 param_2,char *param_3)

{
  char cVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  char *pcVar4;
  undefined8 local_18;
  undefined4 local_10;
  
  uVar2 = FUN_140402e70();
  uVar3 = 0xffffffffffffffff;
  pcVar4 = param_3;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + 1;
  } while (cVar1 != '\0');
  local_18 = FUN_140406c30(param_1,param_3,~uVar3 - 1);
  local_10 = 4;
  FUN_14040be90(param_1,uVar2,&local_18,*(longlong *)(param_1 + 0x10) + -0x10);
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  return;
}



void FUN_140403c70(longlong param_1)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  
  plVar2 = (longlong *)FUN_140402e70();
  lVar1 = *(longlong *)(param_1 + 0x10);
  puVar3 = (undefined8 *)FUN_140408d20(param_1,*plVar2,lVar1 + -0x20);
  *puVar3 = *(undefined8 *)(lVar1 + -0x10);
  *(undefined4 *)(puVar3 + 1) = *(undefined4 *)(lVar1 + -8);
  if (((3 < *(int *)(*(longlong *)(param_1 + 0x10) + -8)) &&
      ((*(byte *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10) + 9) & 3) != 0)) &&
     ((*(byte *)(*plVar2 + 9) & 4) != 0)) {
    FUN_14040ad00(param_1);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x20;
  return;
}



void FUN_140403cf0(longlong param_1,undefined8 param_2,ulonglong param_3)

{
  longlong lVar1;
  longlong *plVar2;
  undefined8 *puVar3;
  
  param_3 = param_3 & 0xffffffff;
  plVar2 = (longlong *)FUN_140402e70();
  lVar1 = *(longlong *)(param_1 + 0x10);
  puVar3 = (undefined8 *)FUN_140408db0(param_1,*plVar2,param_3 & 0xffffffff);
  *puVar3 = *(undefined8 *)(lVar1 + -0x10);
  *(undefined4 *)(puVar3 + 1) = *(undefined4 *)(lVar1 + -8);
  if (((3 < *(int *)(*(longlong *)(param_1 + 0x10) + -8)) &&
      ((*(byte *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10) + 9) & 3) != 0)) &&
     ((*(byte *)(*plVar2 + 9) & 4) != 0)) {
    FUN_14040ad00(param_1);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  return;
}



undefined8 FUN_140403d70(longlong param_1)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  
  plVar2 = (longlong *)FUN_140402e70();
  if (*(int *)(*(longlong *)(param_1 + 0x10) + -8) == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10);
  }
  iVar1 = (int)plVar2[1];
  if (iVar1 == 5) {
    *(longlong *)(*plVar2 + 0x10) = lVar3;
    if (((lVar3 != 0) && ((*(byte *)(lVar3 + 9) & 3) != 0)) && ((*(byte *)(*plVar2 + 9) & 4) != 0))
    {
      FUN_14040ad00(param_1);
    }
  }
  else {
    if (iVar1 != 7) {
      *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xe0 + (longlong)iVar1 * 8) = lVar3;
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
      return 1;
    }
    *(longlong *)(*plVar2 + 0x10) = lVar3;
    if (((lVar3 != 0) && ((*(byte *)(lVar3 + 9) & 3) != 0)) && ((*(byte *)(*plVar2 + 9) & 4) != 0))
    {
      FUN_14040acd0(param_1,*plVar2,lVar3);
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
      return 1;
    }
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  return 1;
}



undefined8 FUN_140403e30(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  longlong *plVar4;
  
  plVar4 = (longlong *)FUN_140402e70();
  iVar1 = (int)plVar4[1];
  if ((iVar1 == 6) || (iVar1 == 7)) {
    *(undefined8 *)(*plVar4 + 0x18) = *(undefined8 *)(*(longlong *)(param_1 + 0x10) + -0x10);
  }
  else {
    if (iVar1 != 8) {
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
      return 0;
    }
    lVar2 = *plVar4;
    uVar3 = *(undefined8 *)(*(longlong *)(param_1 + 0x10) + -0x10);
    *(undefined4 *)(lVar2 + 0x80) = 5;
    *(undefined8 *)(lVar2 + 0x78) = uVar3;
  }
  if (((*(byte *)(*(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10) + 9) & 3) != 0) &&
     ((*(byte *)(*plVar4 + 9) & 4) != 0)) {
    FUN_14040acd0(param_1);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  return 1;
}



void FUN_140403ed0(longlong param_1,int param_2,int param_3)

{
  FUN_140406660(param_1,*(longlong *)(param_1 + 0x10) + (longlong)(param_2 + 1) * -0x10);
  if (param_3 == -1) {
    if (*(ulonglong *)(*(longlong *)(param_1 + 0x28) + 0x10) <= *(ulonglong *)(param_1 + 0x10)) {
      *(ulonglong *)(*(longlong *)(param_1 + 0x28) + 0x10) = *(ulonglong *)(param_1 + 0x10);
    }
  }
  return;
}



void FUN_140403f30(longlong param_1,int param_2,int param_3,int param_4)

{
  longlong lVar1;
  longlong local_18;
  int local_10;
  
  if (param_4 == 0) {
    lVar1 = 0;
  }
  else {
    lVar1 = FUN_140402e70(param_1,param_4);
    lVar1 = lVar1 - *(longlong *)(param_1 + 0x40);
  }
  local_18 = *(longlong *)(param_1 + 0x10) + (longlong)(param_2 + 1) * -0x10;
  local_10 = param_3;
  FUN_140406850(param_1,&LAB_140403f20,&local_18,local_18 - *(longlong *)(param_1 + 0x40),lVar1);
  if (param_3 == -1) {
    if (*(ulonglong *)(*(longlong *)(param_1 + 0x28) + 0x10) <= *(ulonglong *)(param_1 + 0x10)) {
      *(ulonglong *)(*(longlong *)(param_1 + 0x28) + 0x10) = *(ulonglong *)(param_1 + 0x10);
    }
  }
  return;
}



void FUN_140403fc0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined *param_4)

{
  undefined *puVar1;
  undefined1 local_38 [48];
  
  puVar1 = &DAT_1404736e0;
  if (param_4 != (undefined *)0x0) {
    puVar1 = param_4;
  }
  FUN_14040e120(param_1,local_38,param_2,param_3);
  FUN_140406950(param_1,local_38,puVar1);
  return;
}



undefined8 FUN_140404010(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  undefined8 uVar2;
  
  if ((*(int *)(*(longlong *)(param_1 + 0x10) + -8) == 6) &&
     (lVar1 = *(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10), *(char *)(lVar1 + 10) == '\0'))
  {
    uVar2 = FUN_14040e860(param_1,*(undefined8 *)(lVar1 + 0x20),param_2,param_3,0);
    return uVar2;
  }
  return 1;
}



undefined1 FUN_140404060(longlong param_1)

{
  return *(undefined1 *)(param_1 + 10);
}



ulonglong FUN_140404070(longlong param_1,undefined4 param_2,int param_3)

{
  uint uVar1;
  longlong lVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  
  lVar2 = *(longlong *)(param_1 + 0x20);
  uVar4 = 0;
  switch(param_2) {
  case 0:
    *(undefined8 *)(lVar2 + 0x70) = 0xfffffffffffffffd;
    return 0;
  case 1:
    *(undefined8 *)(lVar2 + 0x70) = *(undefined8 *)(lVar2 + 0x78);
    return 0;
  case 2:
    FUN_14040ac20(param_1);
    return 0;
  case 3:
    return *(ulonglong *)(lVar2 + 0x78) >> 10 & 0xffffffff;
  case 4:
    return (ulonglong)(*(uint *)(lVar2 + 0x78) & 0x3ff);
  case 5:
    uVar3 = *(ulonglong *)(lVar2 + 0x78);
    if (uVar3 < (ulonglong)((longlong)param_3 * 0x400)) {
      *(undefined8 *)(lVar2 + 0x70) = 0;
    }
    else {
      *(ulonglong *)(lVar2 + 0x70) = uVar3 + (longlong)param_3 * -0x400;
    }
    if (*(ulonglong *)(lVar2 + 0x70) <= uVar3) {
      do {
        FUN_14040aa00(param_1);
        if (*(char *)(lVar2 + 0x21) == '\0') {
          return 1;
        }
      } while (*(ulonglong *)(lVar2 + 0x70) <= *(ulonglong *)(lVar2 + 0x78));
      return 0;
    }
    break;
  case 6:
    uVar1 = *(uint *)(lVar2 + 0x90);
    *(int *)(lVar2 + 0x90) = param_3;
    return (ulonglong)uVar1;
  case 7:
    uVar1 = *(uint *)(lVar2 + 0x94);
    *(int *)(lVar2 + 0x94) = param_3;
    return (ulonglong)uVar1;
  default:
    uVar4 = 0xffffffff;
  }
  return uVar4;
}



undefined8 FUN_140404210(void)

{
  FUN_140405280();
  return 0;
}



void FUN_140404220(longlong param_1)

{
  undefined8 *puVar1;
  int iVar2;
  
  puVar1 = (undefined8 *)FUN_140402e70();
  iVar2 = FUN_1404087c0(param_1,*puVar1,*(longlong *)(param_1 + 0x10) + -0x10);
  if (iVar2 != 0) {
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
    return;
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  return;
}



void FUN_140404260(longlong param_1,int param_2)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  
  if (1 < param_2) {
    if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
        *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
      FUN_14040aa00();
    }
    FUN_14040c580(param_1,param_2,
                  (int)(*(longlong *)(param_1 + 0x10) - *(longlong *)(param_1 + 0x18) >> 4) + -1);
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + (longlong)(param_2 + -1) * -0x10
    ;
    return;
  }
  if (param_2 == 0) {
    puVar1 = *(undefined8 **)(param_1 + 0x10);
    uVar2 = FUN_140406c30(param_1,&DAT_14047e238,0);
    *(undefined4 *)(puVar1 + 1) = 4;
    *puVar1 = uVar2;
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  }
  return;
}



undefined1 * FUN_1404042f0(longlong param_1,undefined8 param_2,int param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  undefined1 *puVar4;
  undefined8 *puVar5;
  int iVar6;
  longlong lVar7;
  
  lVar7 = (longlong)param_3;
  plVar3 = (longlong *)FUN_140402e70();
  if ((int)plVar3[1] == 6) {
    lVar1 = *plVar3;
    iVar6 = (int)lVar7;
    if (*(char *)(lVar1 + 10) == '\0') {
      if ((0 < iVar6) && (iVar6 <= *(int *)(*(longlong *)(lVar1 + 0x20) + 0x48))) {
        puVar5 = *(undefined8 **)(*(longlong *)(lVar1 + 0x20 + lVar7 * 8) + 0x10);
        puVar4 = (undefined1 *)
                 (*(longlong *)(*(longlong *)(*(longlong *)(lVar1 + 0x20) + 0x38) + -8 + lVar7 * 8)
                 + 0x18);
        if (puVar4 != (undefined1 *)0x0) goto LAB_14040435d;
      }
    }
    else if ((0 < iVar6) && (iVar6 <= (int)(uint)*(byte *)(lVar1 + 0xb))) {
      puVar4 = &DAT_14047e238;
      puVar5 = (undefined8 *)(lVar1 + 0x28 + (longlong)(iVar6 + -1) * 0x10);
LAB_14040435d:
      puVar2 = *(undefined8 **)(param_1 + 0x10);
      *puVar2 = *puVar5;
      *(undefined4 *)(puVar2 + 1) = *(undefined4 *)(puVar5 + 1);
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
      return puVar4;
    }
  }
  return (undefined1 *)0x0;
}



undefined1 * FUN_140404380(longlong param_1,undefined8 param_2,int param_3)

{
  longlong lVar1;
  undefined8 *puVar2;
  longlong *plVar3;
  undefined1 *puVar4;
  undefined8 *puVar5;
  int iVar6;
  longlong lVar7;
  
  lVar7 = (longlong)param_3;
  plVar3 = (longlong *)FUN_140402e70();
  if ((int)plVar3[1] != 6) {
    return (undefined1 *)0x0;
  }
  lVar1 = *plVar3;
  iVar6 = (int)lVar7;
  if (*(char *)(lVar1 + 10) == '\0') {
    if (iVar6 < 1) {
      return (undefined1 *)0x0;
    }
    if (*(int *)(*(longlong *)(lVar1 + 0x20) + 0x48) < iVar6) {
      return (undefined1 *)0x0;
    }
    puVar5 = *(undefined8 **)(*(longlong *)(lVar1 + 0x20 + lVar7 * 8) + 0x10);
    puVar4 = (undefined1 *)
             (*(longlong *)(*(longlong *)(*(longlong *)(lVar1 + 0x20) + 0x38) + -8 + lVar7 * 8) +
             0x18);
    if (puVar4 == (undefined1 *)0x0) {
      return (undefined1 *)0x0;
    }
  }
  else {
    if ((iVar6 < 1) || ((int)(uint)*(byte *)(lVar1 + 0xb) < iVar6)) {
      return (undefined1 *)0x0;
    }
    puVar4 = &DAT_14047e238;
    puVar5 = (undefined8 *)(lVar1 + 0x28 + (longlong)(iVar6 + -1) * 0x10);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  puVar2 = *(undefined8 **)(param_1 + 0x10);
  *puVar5 = *puVar2;
  *(undefined4 *)(puVar5 + 1) = *(undefined4 *)(puVar2 + 1);
  if (((3 < (int)(*(longlong **)(param_1 + 0x10))[1]) &&
      ((*(byte *)(**(longlong **)(param_1 + 0x10) + 9) & 3) != 0)) &&
     ((*(byte *)(*plVar3 + 9) & 4) != 0)) {
    FUN_14040acd0(param_1);
  }
  return puVar4;
}



undefined4 FUN_140404460(longlong param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  int iVar3;
  
  plVar1 = *(longlong **)(param_2 + 8);
  if (((int)plVar1[1] == 6) && (*(char *)(*plVar1 + 10) == '\0')) {
    if (param_2 == *(longlong *)(param_1 + 0x28)) {
      *(undefined8 *)(param_2 + 0x18) = *(undefined8 *)(param_1 + 0x30);
    }
    iVar3 = (int)(*(longlong *)(param_2 + 0x18) -
                  *(longlong *)(*(longlong *)(*plVar1 + 0x20) + 0x18) >> 2) + -1;
    if (-1 < iVar3) {
      lVar2 = *(longlong *)(*(longlong *)(*plVar1 + 0x20) + 0x28);
      if (lVar2 != 0) {
        return *(undefined4 *)(lVar2 + (longlong)iVar3 * 4);
      }
      return 0;
    }
  }
  return 0xffffffff;
}



undefined8 FUN_1404044b0(longlong param_1,longlong param_2,int param_3,undefined4 param_4)

{
  if ((param_2 == 0) || (param_3 == 0)) {
    param_3 = 0;
    param_2 = 0;
  }
  *(char *)(param_1 + 100) = (char)param_3;
  *(longlong *)(param_1 + 0x70) = param_2;
  *(undefined4 *)(param_1 + 0x68) = param_4;
  *(undefined4 *)(param_1 + 0x6c) = param_4;
  return 1;
}



undefined8 FUN_1404044e0(longlong param_1)

{
  return *(undefined8 *)(param_1 + 0x70);
}



undefined1 FUN_1404044f0(longlong param_1)

{
  return *(undefined1 *)(param_1 + 100);
}



undefined4 FUN_140404500(longlong param_1)

{
  return *(undefined4 *)(param_1 + 0x68);
}



undefined8 FUN_140404510(longlong param_1,int param_2,longlong param_3)

{
  ulonglong uVar1;
  
  uVar1 = *(ulonglong *)(param_1 + 0x28);
  if (0 < param_2) {
    do {
      if (uVar1 <= *(ulonglong *)(param_1 + 0x50)) break;
      param_2 = param_2 + -1;
      if (*(char *)(**(longlong **)(uVar1 + 8) + 10) == '\0') {
        param_2 = param_2 - *(int *)(uVar1 + 0x24);
      }
      uVar1 = uVar1 - 0x28;
    } while (0 < param_2);
  }
  if (param_2 == 0) {
    if (*(ulonglong *)(param_1 + 0x50) < uVar1) {
      *(int *)(param_3 + 0x74) = (int)((longlong)(uVar1 - *(ulonglong *)(param_1 + 0x50)) / 0x28);
      return 1;
    }
  }
  else if (param_2 < 0) {
    *(undefined4 *)(param_3 + 0x74) = 0;
    return 1;
  }
  return 0;
}



char * FUN_140404590(longlong param_1,longlong *param_2,int param_3)

{
  longlong *plVar1;
  char *pcVar2;
  longlong lVar3;
  
  plVar1 = (longlong *)param_2[1];
  if ((((int)plVar1[1] == 6) && (*(char *)(*plVar1 + 10) == '\0')) &&
     (lVar3 = *(longlong *)(*plVar1 + 0x20), lVar3 != 0)) {
    if (param_2 == *(longlong **)(param_1 + 0x28)) {
      param_2[3] = *(longlong *)(param_1 + 0x30);
    }
    pcVar2 = (char *)FUN_14040b270(lVar3,param_3,
                                   (int)(param_2[3] -
                                         *(longlong *)(*(longlong *)(*plVar1 + 0x20) + 0x18) >> 2) +
                                   -1);
    if (pcVar2 != (char *)0x0) {
      return pcVar2;
    }
  }
  if (param_2 == *(longlong **)(param_1 + 0x28)) {
    lVar3 = *(longlong *)(param_1 + 0x10);
  }
  else {
    lVar3 = param_2[6];
  }
  if (((longlong)param_3 <= lVar3 - *param_2 >> 4) && (0 < param_3)) {
    return "(*temporary)";
  }
  return (char *)0x0;
}



longlong FUN_140404640(longlong param_1,longlong param_2,int param_3)

{
  longlong *plVar1;
  longlong lVar2;
  
  plVar1 = (longlong *)(*(longlong *)(param_1 + 0x50) + (longlong)*(int *)(param_2 + 0x74) * 0x28);
  lVar2 = FUN_140404590(param_1,plVar1);
  if (lVar2 != 0) {
    FUN_140402f20(param_1,(longlong)(param_3 + -1) * 0x10 + *plVar1);
  }
  return lVar2;
}



longlong FUN_1404046b0(longlong param_1,longlong param_2,int param_3)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  
  plVar1 = (longlong *)(*(longlong *)(param_1 + 0x50) + (longlong)*(int *)(param_2 + 0x74) * 0x28);
  lVar3 = FUN_140404590(param_1,plVar1);
  if (lVar3 != 0) {
    lVar2 = *(longlong *)(param_1 + 0x10);
    puVar4 = (undefined8 *)((longlong)(param_3 + -1) * 0x10 + *plVar1);
    *puVar4 = *(undefined8 *)(lVar2 + -0x10);
    *(undefined4 *)(puVar4 + 1) = *(undefined4 *)(lVar2 + -8);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  return lVar3;
}



void FUN_140404720(longlong param_1,longlong param_2)

{
  int iVar1;
  undefined *puVar2;
  
  if (*(char *)(param_2 + 10) == '\0') {
    *(longlong *)(param_1 + 0x20) = *(longlong *)(*(longlong *)(param_2 + 0x20) + 0x40) + 0x18;
    iVar1 = *(int *)(*(longlong *)(param_2 + 0x20) + 0x60);
    *(int *)(param_1 + 0x30) = iVar1;
    puVar2 = &DAT_140474c70;
    *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(*(longlong *)(param_2 + 0x20) + 100);
    if (iVar1 == 0) {
      puVar2 = &DAT_140474c68;
    }
    *(undefined **)(param_1 + 0x18) = puVar2;
  }
  else {
    *(undefined8 *)(param_1 + 0x30) = 0xffffffffffffffff;
    *(undefined **)(param_1 + 0x20) = &DAT_140474c78;
    *(undefined **)(param_1 + 0x18) = &DAT_140474c74;
  }
  FUN_14040b890(param_1 + 0x38,*(undefined8 *)(param_1 + 0x20),0x3c);
  return;
}



void FUN_1404047a0(longlong param_1,longlong param_2)

{
  undefined8 *puVar1;
  undefined8 uVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  int iVar5;
  
  if ((param_2 == 0) || (*(char *)(param_2 + 10) != '\0')) {
    *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 8) = 0;
  }
  else {
    uVar2 = FUN_140408a50(param_1,0,0);
    puVar4 = *(undefined4 **)(*(longlong *)(param_2 + 0x20) + 0x28);
    iVar5 = 0;
    if (0 < *(int *)(*(longlong *)(param_2 + 0x20) + 0x54)) {
      do {
        puVar3 = (undefined4 *)FUN_140408db0(param_1,uVar2,*puVar4);
        iVar5 = iVar5 + 1;
        puVar4 = puVar4 + 1;
        *puVar3 = 1;
        puVar3[2] = 1;
      } while (iVar5 < *(int *)(*(longlong *)(param_2 + 0x20) + 0x54));
    }
    puVar1 = *(undefined8 **)(param_1 + 0x10);
    *puVar1 = uVar2;
    *(undefined4 *)(puVar1 + 1) = 5;
  }
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
    FUN_140405ae0(param_1,1);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



bool FUN_140404870(uint param_1)

{
  uint uVar1;
  
  uVar1 = param_1 & 0x3f;
  if ((0x1b < uVar1) && ((uVar1 < 0x1f || (uVar1 == 0x22)))) {
    return (param_1 & 0xff800000) == 0;
  }
  return false;
}



undefined8 FUN_1404048a0(longlong param_1,uint param_2,int param_3)

{
  int iVar1;
  bool bVar2;
  
  if (param_3 == 0) {
    if (param_2 != 0) {
      return 0;
    }
  }
  else if (param_3 == 2) {
    if ((int)(uint)*(byte *)(param_1 + 0x73) <= (int)param_2) {
      return 0;
    }
  }
  else if (param_3 == 3) {
    if ((param_2 >> 8 & 1) == 0) {
      bVar2 = SBORROW4(param_2,(uint)*(byte *)(param_1 + 0x73));
      iVar1 = param_2 - *(byte *)(param_1 + 0x73);
    }
    else {
      bVar2 = SBORROW4(param_2 & 0xfffffeff,*(int *)(param_1 + 0x4c));
      iVar1 = (param_2 & 0xfffffeff) - *(int *)(param_1 + 0x4c);
    }
    if (bVar2 == iVar1 < 0) {
      return 0;
    }
  }
  return 1;
}



undefined4 FUN_1404048f0(longlong param_1,int param_2,uint param_3)

{
  byte bVar1;
  byte bVar2;
  longlong lVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  int iVar7;
  uint uVar8;
  uint *puVar9;
  uint uVar10;
  ulonglong uVar11;
  uint uVar12;
  ulonglong uVar13;
  longlong lVar14;
  uint uVar15;
  ulonglong uVar16;
  uint uVar17;
  uint uVar18;
  longlong lVar19;
  bool bVar20;
  bool bVar21;
  uint local_res20;
  
  iVar6 = *(int *)(param_1 + 0x50);
  uVar16 = (ulonglong)iVar6;
  uVar4 = iVar6 - 1;
  uVar13 = (ulonglong)uVar4;
  if (*(byte *)(param_1 + 0x73) < 0xfb) {
    bVar1 = *(byte *)(param_1 + 0x72);
    uVar8 = (uint)*(byte *)(param_1 + 0x73);
    if (((((bVar1 & 1) + (uint)*(byte *)(param_1 + 0x71) <= uVar8) &&
         (((((bVar1 & 4) == 0 || ((bVar1 & 1) != 0)) &&
           (*(int *)(param_1 + 0x48) <= (int)(uint)*(byte *)(param_1 + 0x70))) &&
          ((*(int *)(param_1 + 0x54) == iVar6 || (*(int *)(param_1 + 0x54) == 0)))))) && (0 < iVar6)
        ) && (lVar3 = *(longlong *)(param_1 + 0x18),
             ((byte)*(undefined4 *)(lVar3 + -4 + uVar16 * 4) & 0x3f) == 0x1e)) {
      uVar11 = 0;
      local_res20 = uVar4;
      if (param_2 < 1) {
LAB_140404e0e:
        return *(undefined4 *)(lVar3 + (longlong)(int)uVar4 * 4);
      }
LAB_1404049d0:
      uVar10 = (uint)uVar11;
      lVar19 = (longlong)(int)uVar10;
      uVar15 = 0;
      uVar17 = 0;
      uVar18 = 0;
      uVar4 = *(uint *)(lVar3 + lVar19 * 4);
      uVar5 = uVar4 >> 6;
      uVar12 = uVar4 & 0x3f;
      if (0x25 < uVar12) {
        return 0;
      }
      if (uVar8 <= (uVar5 & 0xff)) {
        return 0;
      }
      bVar2 = (&DAT_1404757b8)[(int)uVar12];
      if ((bVar2 & 3) == 0) {
        uVar15 = uVar4 >> 0x17;
        uVar18 = uVar4 >> 0xe & 0x1ff;
        iVar6 = FUN_1404048a0(param_1,uVar15,bVar2 >> 4 & 3);
        if (iVar6 == 0) {
          return 0;
        }
        iVar6 = FUN_1404048a0(param_1,uVar18,bVar2 >> 2 & 3);
        if (iVar6 == 0) {
          return 0;
        }
LAB_140404b2e:
        uVar13 = (ulonglong)local_res20;
      }
      else if ((bVar2 & 3) == 1) {
        uVar15 = uVar4 >> 0xe;
        if (((bVar2 & 0x30) == 0x30) && (*(int *)(param_1 + 0x4c) <= (int)uVar15)) {
          return 0;
        }
      }
      else {
        uVar18 = uVar17;
        if ((bVar2 & 3) == 2) {
          uVar15 = (uVar4 >> 0xe) - 0x1ffff;
          if ((bVar2 & 0x30) == 0x20) {
            iVar6 = ((uVar4 >> 0xe) - 0x1fffe) + uVar10;
            if (iVar6 < 0) {
              return 0;
            }
            if ((int)uVar16 <= iVar6) {
              return 0;
            }
            if (0 < iVar6) {
              bVar20 = false;
              lVar14 = 0;
              if (0 < iVar6) {
                puVar9 = (uint *)(lVar3 + -4 + (longlong)iVar6 * 4);
                do {
                  if ((((byte)*puVar9 & 0x3f) != 0x22) || ((*puVar9 & 0x7fc000) != 0)) break;
                  lVar14 = lVar14 + 1;
                  bVar20 = (bool)(bVar20 ^ 1);
                  puVar9 = puVar9 + -1;
                } while (lVar14 < iVar6);
              }
              if (bVar20) {
                return 0;
              }
              uVar16 = (ulonglong)*(uint *)(param_1 + 0x50);
              uVar18 = 0;
              goto LAB_140404b2e;
            }
          }
        }
      }
      uVar4 = uVar5 & 0xff;
      if ((bVar2 & 0x40) != 0) {
        uVar13 = uVar13 & 0xffffffff;
        if (uVar4 == param_3) {
          uVar13 = uVar11;
        }
        local_res20 = (uint)uVar13;
      }
      iVar6 = (int)uVar16;
      if ((char)bVar2 < '\0') {
        if (iVar6 <= (int)(uVar10 + 2)) {
          return 0;
        }
        if (((byte)*(undefined4 *)(lVar3 + 4 + lVar19 * 4) & 0x3f) != 0x16) {
          return 0;
        }
      }
      uVar17 = uVar8;
      switch(uVar12) {
      case 2:
        if (uVar18 == 1) {
          if (iVar6 <= (int)(uVar10 + 2)) {
            return 0;
          }
          uVar4 = *(uint *)(lVar3 + 4 + lVar19 * 4);
          if ((((byte)uVar4 & 0x3f) == 0x22) && ((uVar4 & 0x7fc000) == 0)) {
            return 0;
          }
        }
        break;
      case 3:
        if (((int)uVar4 <= (int)param_3) && ((int)param_3 <= (int)uVar15)) {
          uVar13 = uVar11;
          local_res20 = uVar10;
        }
        break;
      case 4:
      case 8:
        bVar21 = SBORROW4(uVar15,(uint)*(byte *)(param_1 + 0x70));
        bVar20 = (int)(uVar15 - *(byte *)(param_1 + 0x70)) < 0;
        goto LAB_140404df9;
      case 5:
      case 7:
        if (*(int *)(*(longlong *)(param_1 + 0x10) + 8 + (longlong)(int)uVar15 * 0x10) != 4) {
          return 0;
        }
        break;
      case 0xb:
        uVar4 = (uVar5 & 0xff) + 1;
        if (uVar8 <= uVar4) {
          return 0;
        }
        if (param_3 == uVar4) {
          uVar13 = uVar11;
          local_res20 = uVar10;
        }
        break;
      case 0x15:
        bVar21 = SBORROW4(uVar15,uVar18);
        bVar20 = (int)(uVar15 - uVar18) < 0;
        goto LAB_140404df9;
      case 0x16:
        goto switchD_140404b9e_caseD_16;
      case 0x1c:
      case 0x1d:
        if ((uVar15 != 0) && ((int)uVar8 <= (int)((uVar15 - 1) + (uVar5 & 0xff)))) {
          return 0;
        }
        uVar12 = param_3;
        if (uVar18 == 0) {
          iVar6 = FUN_140404870(*(undefined4 *)(lVar3 + 4 + lVar19 * 4));
          if (iVar6 == 0) {
            return 0;
          }
        }
        else if ((uVar18 != 1) && ((int)uVar8 <= (int)((uVar18 - 2) + (uVar5 & 0xff)))) {
          return 0;
        }
        if ((int)uVar4 <= (int)uVar12) {
          uVar13 = uVar11;
          local_res20 = uVar10;
        }
        break;
      case 0x1e:
        iVar6 = uVar15 - 1;
        if (0 < iVar6) goto LAB_140404df1;
        break;
      case 0x1f:
      case 0x20:
        if (uVar8 <= (uVar5 & 0xff) + 3) {
          return 0;
        }
        goto switchD_140404b9e_caseD_16;
      case 0x21:
        if (uVar18 == 0) {
          return 0;
        }
        if (uVar8 <= uVar18 + 2 + (uVar5 & 0xff)) {
          return 0;
        }
        if ((int)((uVar5 & 0xff) + 2) <= (int)param_3) {
          uVar13 = uVar11;
          local_res20 = uVar10;
        }
        break;
      case 0x22:
        if ((0 < (int)uVar15) && ((int)uVar8 <= (int)(uVar15 + (uVar5 & 0xff)))) {
          return 0;
        }
        if (uVar18 == 0) {
          uVar10 = uVar10 + 1;
          bVar21 = SBORROW4(uVar10,iVar6 + -1);
          bVar20 = (int)(uVar10 - (iVar6 + -1)) < 0;
          goto LAB_140404df9;
        }
        break;
      case 0x24:
        if (*(int *)(param_1 + 0x58) <= (int)uVar15) {
          return 0;
        }
        bVar2 = *(byte *)(*(longlong *)(*(longlong *)(param_1 + 0x20) + (longlong)(int)uVar15 * 8) +
                         0x70);
        if (iVar6 <= (int)(bVar2 + uVar10)) {
          return 0;
        }
        lVar14 = 1;
        if (bVar2 != 0) {
          puVar9 = (uint *)(lVar3 + 4 + lVar19 * 4);
          do {
            if (((*puVar9 & 0x3f) != 4) && ((*puVar9 & 0x3f) != 0)) {
              return 0;
            }
            lVar14 = lVar14 + 1;
            puVar9 = puVar9 + 1;
          } while (lVar14 <= (longlong)(ulonglong)bVar2);
        }
        uVar13 = (ulonglong)local_res20;
        if (param_3 != 0xff) {
          uVar10 = bVar2 + uVar10;
        }
        break;
      case 0x25:
        if ((*(byte *)(param_1 + 0x72) & 2) == 0) {
          return 0;
        }
        if ((bVar1 & 4) != 0) {
          return 0;
        }
        iVar6 = uVar15 - 1;
        if ((iVar6 == -1) &&
           (iVar7 = FUN_140404870(*(undefined4 *)(lVar3 + 4 + lVar19 * 4)), iVar7 == 0)) {
          return 0;
        }
LAB_140404df1:
        iVar6 = iVar6 + -1 + (uVar5 & 0xff);
        bVar21 = SBORROW4(iVar6,uVar17);
        bVar20 = (int)(iVar6 - uVar17) < 0;
LAB_140404df9:
        if (bVar21 == bVar20) {
          return 0;
        }
      }
      goto switchD_140404b9e_caseD_6;
    }
  }
  return 0;
switchD_140404b9e_caseD_16:
  iVar6 = uVar15 + uVar10 + 1;
  if (((param_3 != 0xff) && ((int)uVar10 < iVar6)) && (iVar6 <= param_2)) {
    uVar10 = uVar15 + uVar10;
  }
switchD_140404b9e_caseD_6:
  uVar4 = (uint)uVar13;
  uVar11 = (ulonglong)(uVar10 + 1);
  if (param_2 <= (int)(uVar10 + 1)) goto LAB_140404e0e;
  goto LAB_1404049d0;
}



bool FUN_140404e90(longlong param_1)

{
  int iVar1;
  
  iVar1 = FUN_1404048f0(param_1,*(undefined4 *)(param_1 + 0x50),0xff);
  return iVar1 != 0;
}



char * FUN_140404eb0(longlong param_1,longlong param_2,uint param_3,longlong *param_4)

{
  longlong *plVar1;
  longlong lVar2;
  uint uVar3;
  longlong lVar4;
  ulonglong uVar5;
  uint uVar6;
  int iVar7;
  
  if (*(int *)(*(longlong *)(param_2 + 8) + 8) == 6) {
    while( true ) {
      plVar1 = *(longlong **)(param_2 + 8);
      if (*(char *)(*plVar1 + 10) != '\0') break;
      lVar2 = *(longlong *)(*plVar1 + 0x20);
      if ((int)plVar1[1] == 6) {
        if (param_2 == *(longlong *)(param_1 + 0x28)) {
          *(undefined8 *)(param_2 + 0x18) = *(undefined8 *)(param_1 + 0x30);
        }
        iVar7 = (int)(*(longlong *)(param_2 + 0x18) -
                      *(longlong *)(*(longlong *)(*plVar1 + 0x20) + 0x18) >> 2) + -1;
      }
      else {
        iVar7 = -1;
      }
      lVar4 = FUN_14040b270(lVar2,param_3 + 1,iVar7);
      *param_4 = lVar4;
      if (lVar4 != 0) {
        return "local";
      }
      uVar3 = FUN_1404048f0(lVar2,iVar7,param_3);
      uVar6 = uVar3 & 0x3f;
      if (uVar6 != 0) {
        if (uVar6 == 4) {
          if (*(longlong *)(lVar2 + 0x38) == 0) {
            *param_4 = (longlong)&DAT_1404736e0;
            return "upvalue";
          }
          *param_4 = *(longlong *)(*(longlong *)(lVar2 + 0x38) + (ulonglong)(uVar3 >> 0x17) * 8) +
                     0x18;
          return "upvalue";
        }
        if (uVar6 == 5) {
          *param_4 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + (ulonglong)(uVar3 >> 0xe) * 0x10) +
                     0x18;
          return "global";
        }
        if (uVar6 == 6) {
          uVar3 = uVar3 >> 0xe & 0x1ff;
          if (uVar3 >> 8 != 0) {
            uVar5 = (longlong)(int)uVar3 & 0xfffffffffffffeff;
            if (*(int *)(*(longlong *)(lVar2 + 0x10) + 8 + uVar5 * 0x10) == 4) {
              *param_4 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + uVar5 * 0x10) + 0x18;
              return "field";
            }
          }
          *param_4 = (longlong)&DAT_1404736e0;
          return "field";
        }
        if (uVar6 != 0xb) {
          return (char *)0x0;
        }
        uVar3 = uVar3 >> 0xe & 0x1ff;
        if (uVar3 >> 8 != 0) {
          uVar5 = (longlong)(int)uVar3 & 0xfffffffffffffeff;
          if (*(int *)(*(longlong *)(lVar2 + 0x10) + 8 + uVar5 * 0x10) == 4) {
            *param_4 = *(longlong *)(*(longlong *)(lVar2 + 0x10) + uVar5 * 0x10) + 0x18;
            return "method";
          }
        }
        *param_4 = (longlong)&DAT_1404736e0;
        return "method";
      }
      param_3 = uVar3 >> 0x17;
      if ((uVar3 >> 6 & 0xff) <= param_3) {
        return (char *)0x0;
      }
      if (*(int *)(*(longlong *)(param_2 + 8) + 8) != 6) {
        return (char *)0x0;
      }
    }
  }
  return (char *)0x0;
}



undefined8 FUN_1404050c0(longlong param_1,longlong param_2,undefined8 param_3)

{
  uint uVar1;
  longlong *plVar2;
  int iVar3;
  uint uVar4;
  undefined8 uVar5;
  
  if (((((int)(*(longlong **)(param_2 + 8))[1] != 6) ||
       (*(char *)(**(longlong **)(param_2 + 8) + 10) != '\0')) || (*(int *)(param_2 + 0x24) < 1)) &&
     (((int)(*(longlong **)(param_2 + -0x20))[1] == 6 &&
      (*(char *)(**(longlong **)(param_2 + -0x20) + 10) == '\0')))) {
    plVar2 = *(longlong **)(param_2 + -0x20);
    if (((int)plVar2[1] == 6) && (*(char *)(*plVar2 + 10) == '\0')) {
      if (param_2 + -0x28 == *(longlong *)(param_1 + 0x28)) {
        *(undefined8 *)(param_2 + -0x10) = *(undefined8 *)(param_1 + 0x30);
      }
      iVar3 = (int)(*(longlong *)(param_2 + -0x10) -
                    *(longlong *)(*(longlong *)(*plVar2 + 0x20) + 0x18) >> 2) + -1;
    }
    else {
      iVar3 = -1;
    }
    uVar1 = *(uint *)(*(longlong *)(*(longlong *)(*plVar2 + 0x20) + 0x18) + (longlong)iVar3 * 4);
    uVar4 = uVar1 & 0x3f;
    if (((uVar4 == 0x1c) || (uVar4 == 0x1d)) || (uVar4 == 0x21)) {
      uVar5 = FUN_140404eb0(param_1,param_2 + -0x28,uVar1 >> 6 & 0xff,param_3);
      return uVar5;
    }
  }
  return 0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140405180(longlong param_1,undefined8 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  longlong lVar4;
  int iVar5;
  undefined1 auStack_88 [32];
  undefined8 local_68;
  undefined1 local_58 [64];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  plVar1 = *(longlong **)(*(longlong *)(param_1 + 0x28) + 8);
  if ((int)plVar1[1] != 6) {
    return;
  }
  if (*(char *)(*plVar1 + 10) != '\0') {
    return;
  }
  lVar4 = 0;
  if (((int)plVar1[1] == 6) && (*(char *)(*plVar1 + 10) == '\0')) {
    lVar2 = *(longlong *)(param_1 + 0x30);
    *(longlong *)(*(longlong *)(param_1 + 0x28) + 0x18) = lVar2;
    iVar5 = (int)(lVar2 - *(longlong *)(*(longlong *)(*plVar1 + 0x20) + 0x18) >> 2) + -1;
    if (-1 < iVar5) {
      lVar2 = *(longlong *)(*(longlong *)(*plVar1 + 0x20) + 0x28);
      if (lVar2 == 0) {
        uVar3 = 0;
      }
      else {
        uVar3 = *(undefined4 *)(lVar2 + (longlong)iVar5 * 4);
      }
      goto LAB_14040520b;
    }
  }
  uVar3 = 0xffffffff;
LAB_14040520b:
  if (((int)plVar1[1] == 6) && (*(char *)(*plVar1 + 10) == '\0')) {
    lVar4 = *(longlong *)(*plVar1 + 0x20);
  }
  FUN_14040b890(local_58,*(longlong *)(lVar4 + 0x40) + 0x18,0x3c);
  local_68 = param_2;
  FUN_14040b860(param_1,"%s:%d: %s",local_58,uVar3);
  return;
}



void FUN_140405280(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  undefined8 *puVar3;
  longlong lVar4;
  
  lVar1 = *(longlong *)(param_1 + 0xb0);
  if (lVar1 != 0) {
    lVar2 = *(longlong *)(param_1 + 0x40);
    if (*(int *)(lVar1 + 8 + lVar2) != 6) {
      FUN_140406350(param_1,5);
    }
    puVar3 = *(undefined8 **)(param_1 + 0x10);
    *puVar3 = puVar3[-2];
    *(undefined4 *)(puVar3 + 1) = *(undefined4 *)(puVar3 + -1);
    lVar4 = *(longlong *)(param_1 + 0x10);
    *(undefined8 *)(lVar4 + -0x10) = *(undefined8 *)(lVar1 + lVar2);
    *(undefined4 *)(lVar4 + -8) = *(undefined4 *)(lVar1 + 8 + lVar2);
    if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
      FUN_140405ae0(param_1,1);
    }
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
    FUN_140406660(param_1,*(longlong *)(param_1 + 0x10) + -0x20,1);
  }
  FUN_140406350(param_1,2);
  return;
}



void FUN_140405330(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  undefined8 uVar1;
  undefined8 local_res18;
  undefined8 local_res20;
  
  local_res18 = param_3;
  local_res20 = param_4;
  uVar1 = FUN_14040b4f0(param_1,param_2,&local_res18);
  FUN_140405180(param_1,uVar1);
  FUN_140405280(param_1);
  return;
}



undefined8
FUN_140405370(undefined8 param_1,char *param_2,longlong param_3,longlong param_4,longlong param_5)

{
  char *pcVar1;
  char cVar2;
  undefined4 uVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  uVar5 = 1;
  if (param_4 == 0) {
    *(undefined4 *)(param_3 + 0x28) = 0xffffffff;
    *(undefined8 *)(param_3 + 0x30) = 0xffffffffffffffff;
    *(undefined1 **)(param_3 + 0x10) = &DAT_14047e238;
    *(undefined1 **)(param_3 + 8) = &DAT_14047e238;
    *(undefined **)(param_3 + 0x18) = &DAT_140474c80;
    *(char **)(param_3 + 0x20) = "=(tail call)";
    FUN_14040b890(param_3 + 0x38,"=(tail call)",0x3c);
    *(undefined4 *)(param_3 + 0x2c) = 0;
  }
  else {
    cVar2 = *param_2;
    while (cVar2 != '\0') {
      switch(cVar2) {
      case 'L':
      case 'f':
        break;
      default:
        uVar5 = 0;
        break;
      case 'S':
        FUN_140404720(param_3,param_4);
        break;
      case 'l':
        if (param_5 == 0) {
          *(undefined4 *)(param_3 + 0x28) = 0xffffffff;
        }
        else {
          uVar3 = FUN_140404460(param_1,param_5);
          *(undefined4 *)(param_3 + 0x28) = uVar3;
        }
        break;
      case 'n':
        if (param_5 == 0) {
          lVar4 = 0;
        }
        else {
          lVar4 = FUN_1404050c0(param_1,param_5,param_3 + 8);
        }
        *(longlong *)(param_3 + 0x10) = lVar4;
        if (lVar4 == 0) {
          *(undefined1 **)(param_3 + 0x10) = &DAT_14047e238;
          *(undefined8 *)(param_3 + 8) = 0;
        }
        break;
      case 'u':
        *(uint *)(param_3 + 0x2c) = (uint)*(byte *)(param_4 + 0xb);
      }
      pcVar1 = param_2 + 1;
      param_2 = param_2 + 1;
      cVar2 = *pcVar1;
    }
  }
  return uVar5;
}



undefined4 FUN_140405510(longlong param_1,char *param_2,longlong param_3)

{
  longlong *plVar1;
  undefined4 uVar2;
  char *pcVar3;
  longlong lVar4;
  longlong lVar5;
  
  lVar5 = 0;
  lVar4 = 0;
  if (*param_2 == '>') {
    param_2 = param_2 + 1;
    lVar5 = *(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10);
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  }
  else if (*(int *)(param_3 + 0x74) != 0) {
    lVar4 = *(longlong *)(param_1 + 0x50) + (longlong)*(int *)(param_3 + 0x74) * 0x28;
    lVar5 = **(longlong **)(lVar4 + 8);
  }
  uVar2 = FUN_140405370(param_1,param_2,param_3,lVar5,lVar4);
  pcVar3 = strchr(param_2,0x66);
  if (pcVar3 != (char *)0x0) {
    if (lVar5 == 0) {
      *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 8) = 0;
    }
    else {
      plVar1 = *(longlong **)(param_1 + 0x10);
      *plVar1 = lVar5;
      *(undefined4 *)(plVar1 + 1) = 6;
    }
    if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
      FUN_140405ae0(param_1,1);
    }
    *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  }
  pcVar3 = strchr(param_2,0x4c);
  if (pcVar3 != (char *)0x0) {
    FUN_1404047a0(param_1,lVar5);
  }
  return uVar2;
}



void FUN_140405600(longlong param_1,ulonglong param_2,undefined8 param_3)

{
  ulonglong *puVar1;
  undefined *puVar2;
  ulonglong uVar3;
  longlong lVar4;
  undefined8 local_res8;
  
  local_res8 = 0;
  puVar1 = *(ulonglong **)(param_1 + 0x28);
  puVar2 = (&PTR_DAT_1404751b0)[*(int *)(param_2 + 8)];
  uVar3 = *puVar1;
  do {
    if (puVar1[2] <= uVar3) {
LAB_14040564e:
      FUN_140405330(param_1,"attempt to %s a %s value",param_3,puVar2);
      return;
    }
    if (param_2 == uVar3) {
      lVar4 = FUN_140404eb0(param_1,puVar1,
                            (longlong)(param_2 - *(longlong *)(param_1 + 0x18)) >> 4 & 0xffffffff,
                            &local_res8);
      if (lVar4 != 0) {
        FUN_140405330(param_1,"attempt to %s %s \'%s\' (a %s value)",param_3,lVar4,local_res8,puVar2
                     );
        return;
      }
      goto LAB_14040564e;
    }
    uVar3 = uVar3 + 0x10;
  } while( true );
}



void FUN_1404056d0(undefined8 param_1,longlong param_2,longlong param_3)

{
  if ((*(int *)(param_2 + 8) == 4) || (*(int *)(param_2 + 8) == 3)) {
    param_2 = param_3;
  }
  FUN_140405600(param_1,param_2,"concatenate");
  return;
}



void FUN_1404056f0(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  longlong lVar1;
  undefined1 local_18 [16];
  
  lVar1 = FUN_14040b9f0(param_2,local_18);
  if (lVar1 == 0) {
    param_3 = param_2;
  }
  FUN_140405600(param_1,param_3,"perform arithmetic on");
  return;
}



undefined8 FUN_140405740(undefined8 param_1,longlong param_2,longlong param_3)

{
  undefined *puVar1;
  
  puVar1 = (&PTR_DAT_1404751b0)[*(int *)(param_2 + 8)];
  if (puVar1[2] == (&PTR_DAT_1404751b0)[*(int *)(param_3 + 8)][2]) {
    FUN_140405330(param_1,"attempt to compare two %s values",puVar1);
    return 0;
  }
  FUN_140405330(param_1,"attempt to compare %s with %s",puVar1);
  return 0;
}



void FUN_140405790(longlong param_1,int param_2,undefined8 *param_3)

{
  longlong lVar1;
  undefined8 uVar2;
  
  if (1 < param_2) {
    if (param_2 < 4) {
      lVar1 = *(longlong *)(param_1 + 0x10);
      *param_3 = *(undefined8 *)(lVar1 + -0x10);
      *(undefined4 *)(param_3 + 1) = *(undefined4 *)(lVar1 + -8);
    }
    else {
      if (param_2 == 4) {
        uVar2 = FUN_140406c30(param_1,"not enough memory",0x11);
        *(undefined4 *)(param_3 + 1) = 4;
        *param_3 = uVar2;
        *(undefined8 **)(param_1 + 0x10) = param_3 + 2;
        return;
      }
      if (param_2 == 5) {
        uVar2 = FUN_140406c30(param_1,"error in error handling",0x17);
        *(undefined4 *)(param_3 + 1) = 4;
        *param_3 = uVar2;
        *(undefined8 **)(param_1 + 0x10) = param_3 + 2;
        return;
      }
    }
  }
  *(undefined8 **)(param_1 + 0x10) = param_3 + 2;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_140405840(longlong param_1,code *param_2,undefined8 param_3)

{
  longlong lVar1;
  int iVar2;
  undefined1 auStack_178 [32];
  longlong local_158;
  undefined8 local_150;
  code *local_148;
  undefined8 local_138 [2];
  _JBTYPE local_128 [16];
  undefined4 local_28;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_178;
  local_28 = 0;
  local_138[0] = *(undefined8 *)(param_1 + 0xa8);
  *(undefined8 **)(param_1 + 0xa8) = local_138;
  local_158 = param_1;
  local_150 = param_3;
  local_148 = param_2;
  iVar2 = _setjmp(local_128);
  lVar1 = local_158;
  if (iVar2 == 0) {
    (*local_148)(local_158,local_150);
    *(undefined8 *)(lVar1 + 0xa8) = local_138[0];
  }
  else {
    *(undefined8 *)(local_158 + 0xa8) = local_138[0];
  }
  return local_28;
}



void FUN_1404059a0(longlong param_1,int param_2)

{
  undefined8 *puVar1;
  longlong lVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong *plVar5;
  
  lVar2 = *(longlong *)(param_1 + 0x40);
  if ((ulonglong)(longlong)(param_2 + 7) < 0x1000000000000000) {
    lVar3 = FUN_1404069e0(param_1,lVar2,(longlong)*(int *)(param_1 + 0x58) << 4,
                          (longlong)(param_2 + 6) << 4);
  }
  else {
    lVar3 = FUN_1404069c0();
  }
  *(longlong *)(param_1 + 0x40) = lVar3;
  *(int *)(param_1 + 0x58) = param_2 + 6;
  *(longlong *)(param_1 + 0x38) = (longlong)param_2 * 0x10 + lVar3;
  puVar1 = *(undefined8 **)(param_1 + 0x98);
  *(ulonglong *)(param_1 + 0x10) =
       (*(longlong *)(param_1 + 0x10) - lVar2 & 0xfffffffffffffff0U) + *(longlong *)(param_1 + 0x40)
  ;
  for (; puVar1 != (undefined8 *)0x0; puVar1 = (undefined8 *)*puVar1) {
    puVar1[2] = (puVar1[2] - lVar2 & 0xfffffffffffffff0U) + *(longlong *)(param_1 + 0x40);
  }
  plVar4 = *(longlong **)(param_1 + 0x50);
  if (plVar4 <= *(longlong **)(param_1 + 0x28)) {
    do {
      plVar5 = plVar4 + 5;
      plVar4[2] = (plVar4[2] - lVar2 & 0xfffffffffffffff0U) + *(longlong *)(param_1 + 0x40);
      *plVar4 = (*plVar4 - lVar2 & 0xfffffffffffffff0U) + *(longlong *)(param_1 + 0x40);
      plVar4[1] = (plVar4[1] - lVar2 & 0xfffffffffffffff0U) + *(longlong *)(param_1 + 0x40);
      plVar4 = plVar5;
    } while (plVar5 <= *(longlong **)(param_1 + 0x28));
  }
  *(ulonglong *)(param_1 + 0x18) =
       (*(longlong *)(param_1 + 0x18) - lVar2 & 0xfffffffffffffff0U) + *(longlong *)(param_1 + 0x40)
  ;
  return;
}



void FUN_140405a30(longlong param_1,int param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_1 + 0x50);
  if ((ulonglong)(longlong)(param_2 + 1) < 0x666666666666667) {
    lVar2 = FUN_1404069e0(param_1,lVar1,(longlong)*(int *)(param_1 + 0x5c) * 0x28,
                          (longlong)param_2 * 0x28);
  }
  else {
    lVar2 = FUN_1404069c0();
  }
  *(longlong *)(param_1 + 0x50) = lVar2;
  *(int *)(param_1 + 0x5c) = param_2;
  *(longlong *)(param_1 + 0x28) = lVar2 + ((*(longlong *)(param_1 + 0x28) - lVar1) / 0x28) * 0x28;
  *(longlong *)(param_1 + 0x48) = lVar2 + -0x28 + (longlong)param_2 * 0x28;
  return;
}



void FUN_140405ae0(longlong param_1,int param_2)

{
  int iVar1;
  
  iVar1 = *(int *)(param_1 + 0x58);
  if (param_2 <= iVar1) {
    FUN_1404059a0(param_1,iVar1 * 2);
    return;
  }
  FUN_1404059a0(param_1,param_2 + iVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140405b00(longlong param_1,int param_2,undefined4 param_3)

{
  code *pcVar1;
  longlong lVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  undefined1 auStack_c8 [32];
  int local_a8 [10];
  undefined4 local_80;
  undefined4 local_34;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  pcVar1 = *(code **)(param_1 + 0x70);
  if ((pcVar1 != (code *)0x0) && (*(char *)(param_1 + 0x65) != '\0')) {
    lVar2 = *(longlong *)(param_1 + 0x40);
    lVar3 = *(longlong *)(param_1 + 0x10);
    lVar4 = *(longlong *)(*(longlong *)(param_1 + 0x28) + 0x10);
    if (param_2 == 4) {
      local_34 = 0;
    }
    else {
      local_34 = (undefined4)
                 ((*(longlong *)(param_1 + 0x28) - *(longlong *)(param_1 + 0x50)) / 0x28);
    }
    local_a8[0] = param_2;
    local_80 = param_3;
    if (*(longlong *)(param_1 + 0x38) - lVar3 < 0x141) {
      iVar5 = *(int *)(param_1 + 0x58);
      if (iVar5 < 0x14) {
        iVar5 = iVar5 + 0x14;
      }
      else {
        iVar5 = iVar5 * 2;
      }
      FUN_1404059a0(param_1,iVar5);
    }
    *(longlong *)(*(longlong *)(param_1 + 0x28) + 0x10) = *(longlong *)(param_1 + 0x10) + 0x140;
    *(undefined1 *)(param_1 + 0x65) = 0;
    (*pcVar1)(param_1,local_a8);
    *(undefined1 *)(param_1 + 0x65) = 1;
    *(longlong *)(*(longlong *)(param_1 + 0x28) + 0x10) =
         *(longlong *)(param_1 + 0x40) + (lVar4 - lVar2);
    *(longlong *)(param_1 + 0x10) = (lVar3 - lVar2) + *(longlong *)(param_1 + 0x40);
  }
  return;
}



longlong FUN_140405c30(longlong param_1,longlong param_2,int param_3)

{
  byte bVar1;
  longlong lVar2;
  longlong *plVar3;
  uint uVar4;
  longlong lVar5;
  undefined8 *puVar6;
  undefined8 uVar7;
  double *pdVar8;
  ulonglong uVar9;
  undefined4 *puVar10;
  longlong lVar11;
  int iVar12;
  longlong lVar13;
  int iVar14;
  
  lVar5 = 0;
  bVar1 = *(byte *)(param_2 + 0x71);
  if (param_3 < (int)(uint)bVar1) {
    uVar4 = (uint)bVar1 - param_3;
    uVar9 = (ulonglong)uVar4;
    param_3 = param_3 + uVar4;
    do {
      *(undefined4 *)(*(longlong *)(param_1 + 0x10) + 8) = 0;
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
      uVar9 = uVar9 - 1;
    } while (uVar9 != 0);
  }
  if ((*(byte *)(param_2 + 0x72) & 4) != 0) {
    iVar12 = param_3 - (uint)bVar1;
    if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
        *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
      FUN_14040aa00(param_1);
    }
    lVar5 = FUN_140408a50(param_1,iVar12,1);
    lVar13 = (longlong)iVar12;
    if (0 < iVar12) {
      iVar14 = 1;
      lVar11 = lVar13 * -0x10;
      do {
        lVar2 = *(longlong *)(param_1 + 0x10);
        puVar6 = (undefined8 *)FUN_140408db0(param_1,lVar5,iVar14);
        iVar14 = iVar14 + 1;
        *puVar6 = *(undefined8 *)(lVar2 + lVar11);
        puVar10 = (undefined4 *)(lVar2 + 8 + lVar11);
        lVar11 = lVar11 + 0x10;
        lVar13 = lVar13 + -1;
        *(undefined4 *)(puVar6 + 1) = *puVar10;
      } while (lVar13 != 0);
    }
    uVar7 = FUN_140406c30(param_1,&DAT_140473710,1);
    pdVar8 = (double *)FUN_1404096b0(param_1,lVar5,uVar7);
    *(undefined4 *)(pdVar8 + 1) = 3;
    *pdVar8 = (double)iVar12;
  }
  lVar13 = *(longlong *)(param_1 + 0x10);
  lVar11 = (longlong)(int)(uint)bVar1;
  if (lVar11 != 0) {
    puVar10 = (undefined4 *)(lVar13 + (longlong)param_3 * -0x10 + 8);
    do {
      puVar6 = *(undefined8 **)(param_1 + 0x10);
      lVar11 = lVar11 + -1;
      *(undefined8 **)(param_1 + 0x10) = puVar6 + 2;
      *puVar6 = *(undefined8 *)(puVar10 + -2);
      *(undefined4 *)(puVar6 + 1) = *puVar10;
      *puVar10 = 0;
      puVar10 = puVar10 + 4;
    } while (lVar11 != 0);
  }
  if (lVar5 != 0) {
    plVar3 = *(longlong **)(param_1 + 0x10);
    *(longlong **)(param_1 + 0x10) = plVar3 + 2;
    *plVar3 = lVar5;
    *(undefined4 *)(plVar3 + 1) = 5;
  }
  return lVar13;
}



void FUN_140405df0(longlong param_1,undefined8 *param_2)

{
  longlong lVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  int iVar4;
  
  puVar3 = (undefined8 *)FUN_140408570(param_1,param_2,0x10);
  lVar1 = *(longlong *)(param_1 + 0x40);
  if (*(int *)(puVar3 + 1) != 6) {
    FUN_140405600(param_1,param_2,&DAT_1404748cc);
  }
  for (puVar2 = *(undefined8 **)(param_1 + 0x10); param_2 < puVar2; puVar2 = puVar2 + -2) {
    *puVar2 = puVar2[-2];
    *(undefined4 *)(puVar2 + 1) = *(undefined4 *)(puVar2 + -1);
  }
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
    iVar4 = *(int *)(param_1 + 0x58);
    if (iVar4 < 1) {
      iVar4 = iVar4 + 1;
    }
    else {
      iVar4 = iVar4 * 2;
    }
    FUN_1404059a0(param_1,iVar4);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  param_2 = (undefined8 *)((longlong)param_2 + (*(longlong *)(param_1 + 0x40) - lVar1));
  *param_2 = *puVar3;
  *(undefined4 *)(param_2 + 1) = *(undefined4 *)(puVar3 + 1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_140405eb0(longlong param_1,longlong param_2)

{
  byte bVar1;
  longlong lVar2;
  code *pcVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  int iVar7;
  undefined1 auStack_c8 [32];
  undefined4 local_a8 [10];
  undefined4 local_80;
  undefined4 local_34;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  lVar2 = *(longlong *)(param_1 + 0x40);
  FUN_140405b00(param_1,1);
  if (*(char *)(**(longlong **)(*(longlong *)(param_1 + 0x28) + 8) + 10) == '\0') {
    bVar1 = *(byte *)(param_1 + 100);
    while (((bVar1 & 2) != 0 &&
           (iVar7 = *(int *)(*(longlong *)(param_1 + 0x28) + 0x24),
           *(int *)(*(longlong *)(param_1 + 0x28) + 0x24) = iVar7 + -1, iVar7 != 0))) {
      pcVar3 = *(code **)(param_1 + 0x70);
      if ((pcVar3 != (code *)0x0) && (*(char *)(param_1 + 0x65) != '\0')) {
        lVar4 = *(longlong *)(param_1 + 0x10);
        lVar5 = *(longlong *)(param_1 + 0x40);
        lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x28) + 0x10);
        local_a8[0] = 4;
        local_80 = 0xffffffff;
        local_34 = 0;
        if (*(longlong *)(param_1 + 0x38) - lVar4 < 0x141) {
          iVar7 = *(int *)(param_1 + 0x58);
          if (iVar7 < 0x14) {
            iVar7 = iVar7 + 0x14;
          }
          else {
            iVar7 = iVar7 * 2;
          }
          FUN_1404059a0(param_1,iVar7);
        }
        *(longlong *)(*(longlong *)(param_1 + 0x28) + 0x10) = *(longlong *)(param_1 + 0x10) + 0x140;
        *(undefined1 *)(param_1 + 0x65) = 0;
        (*pcVar3)(param_1,local_a8);
        *(undefined1 *)(param_1 + 0x65) = 1;
        *(longlong *)(*(longlong *)(param_1 + 0x28) + 0x10) =
             *(longlong *)(param_1 + 0x40) + (lVar6 - lVar5);
        *(longlong *)(param_1 + 0x10) = (lVar4 - lVar5) + *(longlong *)(param_1 + 0x40);
      }
      bVar1 = *(byte *)(param_1 + 100);
    }
  }
  return *(longlong *)(param_1 + 0x40) + (param_2 - lVar2);
}



int FUN_140406040(longlong param_1,undefined8 *param_2)

{
  int iVar1;
  longlong lVar2;
  undefined8 *puVar3;
  int iVar4;
  
  if ((*(byte *)(param_1 + 100) & 2) != 0) {
    param_2 = (undefined8 *)FUN_140405eb0();
  }
  lVar2 = *(longlong *)(param_1 + 0x28);
  *(undefined8 **)(param_1 + 0x28) = (undefined8 *)(lVar2 + -0x28);
  iVar1 = *(int *)(lVar2 + 0x20);
  puVar3 = *(undefined8 **)(lVar2 + 8);
  *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(lVar2 + -0x28);
  *(undefined8 *)(param_1 + 0x30) = *(undefined8 *)(lVar2 + -0x10);
  iVar4 = iVar1;
  for (; (iVar4 != 0 && (param_2 < *(undefined8 **)(param_1 + 0x10))); param_2 = param_2 + 2) {
    iVar4 = iVar4 + -1;
    *puVar3 = *param_2;
    *(undefined4 *)(puVar3 + 1) = *(undefined4 *)(param_2 + 1);
    puVar3 = puVar3 + 2;
  }
  for (; 0 < iVar4; iVar4 = iVar4 + -1) {
    *(undefined4 *)(puVar3 + 1) = 0;
    puVar3 = puVar3 + 2;
  }
  *(undefined8 **)(param_1 + 0x10) = puVar3;
  return iVar1 + 1;
}



undefined8 FUN_1404060e0(longlong param_1,char *param_2)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  int iVar5;
  char *pcVar6;
  
  puVar2 = (undefined8 *)**(longlong **)(param_1 + 0x28);
  *(undefined8 **)(param_1 + 0x10) = puVar2;
  uVar4 = 0xffffffffffffffff;
  pcVar6 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar6;
    pcVar6 = pcVar6 + 1;
  } while (cVar1 != '\0');
  uVar3 = FUN_140406c30(param_1,param_2,~uVar4 - 1);
  *(undefined4 *)(puVar2 + 1) = 4;
  *puVar2 = uVar3;
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
    iVar5 = *(int *)(param_1 + 0x58);
    if (iVar5 < 1) {
      iVar5 = iVar5 + 1;
    }
    else {
      iVar5 = iVar5 * 2;
    }
    FUN_1404059a0(param_1,iVar5);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return 2;
}



undefined8 FUN_140406160(longlong param_1,int param_2)

{
  if (*(ushort *)(param_1 + 0x62) < *(ushort *)(param_1 + 0x60)) {
    FUN_140405330(param_1,"attempt to yield across metamethod/C-call boundary");
  }
  *(undefined1 *)(param_1 + 10) = 1;
  *(longlong *)(param_1 + 0x18) = *(longlong *)(param_1 + 0x10) + (longlong)param_2 * -0x10;
  return 0xffffffff;
}



void FUN_1404061b0(longlong param_1,undefined8 *param_2)

{
  longlong *plVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  undefined8 *puVar6;
  code *pcVar7;
  
  iVar2 = FUN_14040e0b0(*param_2);
  if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
      *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
    FUN_14040aa00(param_1);
  }
  pcVar7 = FUN_140411fa0;
  if (iVar2 == 0x1b) {
    pcVar7 = FUN_140412cd0;
  }
  lVar3 = (*pcVar7)(param_1,*param_2,param_2 + 1,param_2[4]);
  lVar4 = FUN_14040ae40(param_1,*(undefined1 *)(lVar3 + 0x70),*(undefined8 *)(param_1 + 0x78));
  iVar2 = 0;
  *(longlong *)(lVar4 + 0x20) = lVar3;
  if (*(char *)(lVar3 + 0x70) != '\0') {
    puVar6 = (undefined8 *)(lVar4 + 0x28);
    do {
      uVar5 = FUN_14040aec0(param_1);
      iVar2 = iVar2 + 1;
      *puVar6 = uVar5;
      puVar6 = puVar6 + 1;
    } while (iVar2 < (int)(uint)*(byte *)(lVar3 + 0x70));
  }
  plVar1 = *(longlong **)(param_1 + 0x10);
  *plVar1 = lVar4;
  *(undefined4 *)(plVar1 + 1) = 6;
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
    iVar2 = *(int *)(param_1 + 0x58);
    if (iVar2 < 1) {
      iVar2 = iVar2 + 1;
    }
    else {
      iVar2 = iVar2 * 2;
    }
    FUN_1404059a0(param_1,iVar2);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



void FUN_1404062b0(longlong param_1,undefined4 param_2)

{
  *(undefined8 **)(param_1 + 0x28) = *(undefined8 **)(param_1 + 0x50);
  *(undefined8 *)(param_1 + 0x18) = **(undefined8 **)(param_1 + 0x50);
  FUN_14040b010();
  FUN_140405790(param_1,param_2,*(undefined8 *)(param_1 + 0x18));
  *(undefined2 *)(param_1 + 0x60) = *(undefined2 *)(param_1 + 0x62);
  *(undefined1 *)(param_1 + 0x65) = 1;
  if ((20000 < *(int *)(param_1 + 0x5c)) &&
     ((int)((*(longlong *)(param_1 + 0x28) - *(longlong *)(param_1 + 0x50)) / 0x28) + 1 < 20000)) {
    FUN_140405a30(param_1,20000);
  }
  *(undefined8 *)(param_1 + 0xb0) = 0;
  *(undefined8 *)(param_1 + 0xa8) = 0;
  return;
}



void FUN_140406350(longlong param_1,undefined4 param_2)

{
  if (*(longlong *)(param_1 + 0xa8) != 0) {
    *(undefined4 *)(*(longlong *)(param_1 + 0xa8) + 0x110) = param_2;
                    // WARNING: Subroutine does not return
    longjmp((_JBTYPE *)(*(longlong *)(param_1 + 0xa8) + 0x10),1);
  }
  *(char *)(param_1 + 10) = (char)param_2;
  if (*(longlong *)(*(longlong *)(param_1 + 0x20) + 0x98) != 0) {
    FUN_1404062b0();
    (**(code **)(*(longlong *)(param_1 + 0x20) + 0x98))(param_1);
  }
                    // WARNING: Subroutine does not return
  exit(1);
}



void FUN_1404063c0(longlong param_1)

{
  code *pcVar1;
  
  if (20000 < *(int *)(param_1 + 0x5c)) {
    FUN_140406350(param_1,5);
    pcVar1 = (code *)swi(3);
    (*pcVar1)();
    return;
  }
  FUN_140405a30(param_1,*(int *)(param_1 + 0x5c) * 2);
  if (20000 < *(int *)(param_1 + 0x5c)) {
    FUN_140405330(param_1,"stack overflow");
  }
  *(longlong *)(param_1 + 0x28) = *(longlong *)(param_1 + 0x28) + 0x28;
  return;
}



undefined8 FUN_140406410(longlong param_1,longlong *param_2,undefined4 param_3)

{
  byte bVar1;
  uint uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong *plVar5;
  ulonglong uVar6;
  longlong lVar7;
  int iVar8;
  longlong lVar9;
  
  if ((int)param_2[1] != 6) {
    param_2 = (longlong *)FUN_140405df0();
  }
  lVar7 = *param_2;
  lVar3 = *(longlong *)(param_1 + 0x40);
  *(undefined8 *)(*(longlong *)(param_1 + 0x28) + 0x18) = *(undefined8 *)(param_1 + 0x30);
  if (*(char *)(lVar7 + 10) == '\0') {
    lVar7 = *(longlong *)(lVar7 + 0x20);
    bVar1 = *(byte *)(lVar7 + 0x73);
    if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) <=
        (longlong)(int)((uint)bVar1 << 4)) {
      uVar2 = *(uint *)(param_1 + 0x58);
      if (bVar1 == uVar2 || (int)(uint)bVar1 < (int)uVar2) {
        iVar8 = uVar2 * 2;
      }
      else {
        iVar8 = bVar1 + uVar2;
      }
      FUN_1404059a0(param_1,iVar8);
    }
    lVar9 = (longlong)param_2 + (*(longlong *)(param_1 + 0x40) - lVar3);
    if (*(char *)(lVar7 + 0x72) == '\0') {
      lVar4 = lVar9 + 0x10;
      uVar6 = (ulonglong)*(byte *)(lVar7 + 0x71) * 0x10 + lVar4;
      if (uVar6 < *(ulonglong *)(param_1 + 0x10)) {
        *(ulonglong *)(param_1 + 0x10) = uVar6;
      }
    }
    else {
      lVar4 = FUN_140405c30(param_1,lVar7,(int)(*(longlong *)(param_1 + 0x10) - lVar9 >> 4) + -1);
      lVar9 = (longlong)param_2 + (*(longlong *)(param_1 + 0x40) - lVar3);
    }
    if (*(longlong *)(param_1 + 0x28) == *(longlong *)(param_1 + 0x48)) {
      plVar5 = (longlong *)FUN_1404063c0();
    }
    else {
      plVar5 = (longlong *)(*(longlong *)(param_1 + 0x28) + 0x28);
      *(longlong **)(param_1 + 0x28) = plVar5;
    }
    plVar5[1] = lVar9;
    *plVar5 = lVar4;
    *(longlong *)(param_1 + 0x18) = lVar4;
    plVar5[2] = (ulonglong)*(byte *)(lVar7 + 0x73) * 0x10 + lVar4;
    *(undefined8 *)(param_1 + 0x30) = *(undefined8 *)(lVar7 + 0x18);
    *(undefined4 *)((longlong)plVar5 + 0x24) = 0;
    *(undefined4 *)(plVar5 + 4) = param_3;
    uVar6 = *(ulonglong *)(param_1 + 0x10);
    if (uVar6 < (ulonglong)plVar5[2]) {
      do {
        *(undefined4 *)(uVar6 + 8) = 0;
        uVar6 = uVar6 + 0x10;
      } while (uVar6 < (ulonglong)plVar5[2]);
    }
    *(longlong *)(param_1 + 0x10) = plVar5[2];
    if ((*(byte *)(param_1 + 100) & 1) != 0) {
      *(longlong *)(param_1 + 0x30) = *(longlong *)(param_1 + 0x30) + 4;
      FUN_140405b00(param_1,0,0xffffffff);
      *(longlong *)(param_1 + 0x30) = *(longlong *)(param_1 + 0x30) + -4;
    }
    return 0;
  }
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x141) {
    iVar8 = *(int *)(param_1 + 0x58);
    if (iVar8 < 0x14) {
      iVar8 = iVar8 + 0x14;
    }
    else {
      iVar8 = iVar8 * 2;
    }
    FUN_1404059a0(param_1,iVar8);
  }
  if (*(longlong *)(param_1 + 0x28) == *(longlong *)(param_1 + 0x48)) {
    plVar5 = (longlong *)FUN_1404063c0(param_1);
  }
  else {
    plVar5 = (longlong *)(*(longlong *)(param_1 + 0x28) + 0x28);
    *(longlong **)(param_1 + 0x28) = plVar5;
  }
  lVar7 = (longlong)param_2 + (*(longlong *)(param_1 + 0x40) - lVar3);
  plVar5[1] = lVar7;
  lVar7 = lVar7 + 0x10;
  *plVar5 = lVar7;
  lVar3 = *(longlong *)(param_1 + 0x10);
  *(longlong *)(param_1 + 0x18) = lVar7;
  *(undefined4 *)(plVar5 + 4) = param_3;
  plVar5[2] = lVar3 + 0x140;
  if ((*(byte *)(param_1 + 100) & 1) != 0) {
    FUN_140405b00(param_1,0,0xffffffff);
  }
  iVar8 = (**(code **)(**(longlong **)(*(longlong *)(param_1 + 0x28) + 8) + 0x20))(param_1);
  if (-1 < iVar8) {
    FUN_140406040(param_1,*(longlong *)(param_1 + 0x10) + (longlong)iVar8 * -0x10);
    return 1;
  }
  return 2;
}



void FUN_140406660(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  ushort uVar1;
  code *pcVar2;
  int iVar3;
  
  *(short *)(param_1 + 0x60) = *(short *)(param_1 + 0x60) + 1;
  uVar1 = *(ushort *)(param_1 + 0x60);
  if (199 < uVar1) {
    if (uVar1 == 200) {
      FUN_140405330(param_1,"C stack overflow");
    }
    else if (0xe0 < uVar1) {
      FUN_140406350(param_1,5);
      pcVar2 = (code *)swi(3);
      (*pcVar2)();
      return;
    }
  }
  iVar3 = FUN_140406410(param_1,param_2,param_3);
  if (iVar3 == 0) {
    FUN_14040c990(param_1,1);
  }
  *(short *)(param_1 + 0x60) = *(short *)(param_1 + 0x60) + -1;
  if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
      *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
    FUN_14040aa00(param_1);
  }
  return;
}



void FUN_140406700(longlong param_1,longlong param_2)

{
  int iVar1;
  
  if (*(char *)(param_1 + 10) == '\0') {
    iVar1 = FUN_140406410(param_1,param_2 + -0x10,0xffffffff);
    if (iVar1 != 0) {
      return;
    }
  }
  else {
    *(undefined1 *)(param_1 + 10) = 0;
    if (*(char *)(*(longlong *)(*(undefined8 **)(param_1 + 0x28))[1] + 10) == '\0') {
      *(undefined8 *)(param_1 + 0x18) = **(undefined8 **)(param_1 + 0x28);
    }
    else {
      iVar1 = FUN_140406040(param_1);
      if (iVar1 != 0) {
        *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(*(longlong *)(param_1 + 0x28) + 0x10);
      }
    }
  }
  FUN_14040c990(param_1,(*(longlong *)(param_1 + 0x28) - *(longlong *)(param_1 + 0x50)) / 0x28);
  return;
}



ulonglong FUN_140406790(longlong param_1,int param_2)

{
  short sVar1;
  uint uVar2;
  ulonglong uVar3;
  
  if ((*(char *)(param_1 + 10) != '\x01') &&
     ((*(char *)(param_1 + 10) != '\0' ||
      (*(longlong *)(param_1 + 0x28) != *(longlong *)(param_1 + 0x50))))) {
    uVar3 = FUN_1404060e0(param_1,"cannot resume non-suspended coroutine");
    return uVar3;
  }
  if (199 < *(ushort *)(param_1 + 0x60)) {
    uVar3 = FUN_1404060e0(param_1,"C stack overflow");
    return uVar3;
  }
  sVar1 = *(ushort *)(param_1 + 0x60) + 1;
  *(short *)(param_1 + 0x60) = sVar1;
  *(short *)(param_1 + 0x62) = sVar1;
  uVar2 = FUN_140405840(param_1,FUN_140406700,
                        *(longlong *)(param_1 + 0x10) + (longlong)param_2 * -0x10);
  uVar3 = (ulonglong)uVar2;
  if (uVar2 == 0) {
    uVar3 = (ulonglong)*(byte *)(param_1 + 10);
  }
  else {
    *(char *)(param_1 + 10) = (char)uVar2;
    FUN_140405790(param_1,uVar2,*(undefined8 *)(param_1 + 0x10));
    *(undefined8 *)(*(longlong *)(param_1 + 0x28) + 0x10) = *(undefined8 *)(param_1 + 0x10);
  }
  *(short *)(param_1 + 0x60) = *(short *)(param_1 + 0x60) + -1;
  return uVar3;
}



ulonglong FUN_140406850(longlong param_1,undefined8 param_2,undefined8 param_3,longlong param_4,
                       undefined8 param_5)

{
  undefined8 *puVar1;
  undefined1 uVar2;
  undefined2 uVar3;
  longlong lVar4;
  undefined8 uVar5;
  longlong lVar6;
  undefined8 uVar7;
  ulonglong uVar8;
  
  lVar4 = *(longlong *)(param_1 + 0x28);
  uVar5 = *(undefined8 *)(param_1 + 0xb0);
  lVar6 = *(longlong *)(param_1 + 0x50);
  uVar3 = *(undefined2 *)(param_1 + 0x60);
  uVar2 = *(undefined1 *)(param_1 + 0x65);
  *(undefined8 *)(param_1 + 0xb0) = param_5;
  uVar8 = FUN_140405840();
  if ((int)uVar8 != 0) {
    param_4 = param_4 + *(longlong *)(param_1 + 0x40);
    FUN_14040b010(param_1,param_4);
    FUN_140405790(param_1,uVar8 & 0xffffffff,param_4);
    puVar1 = (undefined8 *)(*(longlong *)(param_1 + 0x50) + (lVar4 - lVar6));
    *(undefined2 *)(param_1 + 0x60) = uVar3;
    *(undefined8 **)(param_1 + 0x28) = puVar1;
    *(undefined8 *)(param_1 + 0x18) = *puVar1;
    uVar7 = puVar1[3];
    *(undefined1 *)(param_1 + 0x65) = uVar2;
    *(undefined8 *)(param_1 + 0x30) = uVar7;
    if ((20000 < *(int *)(param_1 + 0x5c)) &&
       ((int)(((longlong)puVar1 - *(longlong *)(param_1 + 0x50)) / 0x28) + 1 < 20000)) {
      FUN_140405a30(param_1,20000);
    }
    uVar8 = uVar8 & 0xffffffff;
  }
  *(undefined8 *)(param_1 + 0xb0) = uVar5;
  return uVar8;
}



undefined4 FUN_140406950(longlong param_1,undefined8 param_2,undefined8 param_3)

{
  undefined4 uVar1;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_20;
  undefined8 local_18;
  
  local_30 = 0;
  local_20 = 0;
  local_38 = param_2;
  local_18 = param_3;
  uVar1 = FUN_140406850(param_1,FUN_1404061b0,&local_38,
                        *(longlong *)(param_1 + 0x10) - *(longlong *)(param_1 + 0x40),
                        *(undefined8 *)(param_1 + 0xb0));
  FUN_1404069e0(param_1,local_30,local_20,0);
  return uVar1;
}



undefined8 FUN_1404069c0(undefined8 param_1)

{
  FUN_140405330(param_1,"memory allocation error: block too big");
  return 0;
}



longlong FUN_1404069e0(longlong param_1,undefined8 param_2,longlong param_3,longlong param_4)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_1 + 0x20);
  lVar2 = (**(code **)(lVar1 + 0x10))(*(undefined8 *)(lVar1 + 0x18));
  if ((lVar2 == 0) && (param_4 != 0)) {
    FUN_140406350(param_1,4);
  }
  *(longlong *)(lVar1 + 0x78) = *(longlong *)(lVar1 + 0x78) + (param_4 - param_3);
  return lVar2;
}



longlong FUN_140406a50(longlong param_1,undefined8 param_2,int *param_3,ulonglong param_4,
                      int param_5)

{
  int iVar1;
  longlong lVar2;
  undefined1 auVar3 [16];
  longlong lVar4;
  longlong lVar5;
  
  iVar1 = *param_3;
  if (iVar1 < param_5 / 2) {
    param_5 = iVar1 * 2;
    if (param_5 < 4) {
      param_5 = 4;
    }
  }
  else if (param_5 <= iVar1) {
    FUN_140405330(param_1);
  }
  auVar3._8_8_ = 0;
  auVar3._0_8_ = param_4;
  if (SUB168((ZEXT816(0) << 0x40 | ZEXT816(0xfffffffffffffffd)) / auVar3,0) <
      (ulonglong)(longlong)(param_5 + 1)) {
    FUN_140405330(param_1,"memory allocation error: block too big");
    lVar4 = 0;
  }
  else {
    iVar1 = *param_3;
    lVar5 = (longlong)param_5 * param_4;
    lVar2 = *(longlong *)(param_1 + 0x20);
    lVar4 = (**(code **)(lVar2 + 0x10))
                      (*(undefined8 *)(lVar2 + 0x18),param_2,(longlong)iVar1 * param_4,lVar5);
    if ((lVar4 == 0) && (lVar5 != 0)) {
      FUN_140406350(param_1,4);
    }
    *(longlong *)(lVar2 + 0x78) = *(longlong *)(lVar2 + 0x78) + (lVar5 - (longlong)iVar1 * param_4);
  }
  *param_3 = param_5;
  return lVar4;
}



void FUN_140406b40(longlong param_1,int param_2)

{
  longlong *plVar1;
  longlong *plVar2;
  void *_Dst;
  longlong lVar3;
  longlong *plVar4;
  int iVar5;
  longlong lVar6;
  
  if (*(char *)(*(longlong *)(param_1 + 0x20) + 0x21) != '\x02') {
    if ((ulonglong)(longlong)(param_2 + 1) < 0x2000000000000000) {
      _Dst = (void *)FUN_1404069e0(param_1,0,0);
    }
    else {
      _Dst = (void *)FUN_1404069c0();
    }
    plVar1 = *(longlong **)(param_1 + 0x20);
    if (0 < param_2) {
      memset(_Dst,0,(longlong)param_2 << 3);
    }
    iVar5 = 0;
    if (0 < *(int *)((longlong)plVar1 + 0xc)) {
      lVar6 = 0;
      do {
        if (*(longlong **)(lVar6 + *plVar1) != (longlong *)0x0) {
          plVar4 = *(longlong **)(lVar6 + *plVar1);
          do {
            plVar2 = (longlong *)*plVar4;
            lVar3 = (longlong)(int)(*(uint *)((longlong)plVar4 + 0xc) & param_2 - 1U);
            *plVar4 = *(longlong *)((longlong)_Dst + lVar3 * 8);
            *(longlong **)((longlong)_Dst + lVar3 * 8) = plVar4;
            plVar4 = plVar2;
          } while (plVar2 != (longlong *)0x0);
        }
        iVar5 = iVar5 + 1;
        lVar6 = lVar6 + 8;
      } while (iVar5 < *(int *)((longlong)plVar1 + 0xc));
    }
    FUN_1404069e0(param_1,*plVar1,(longlong)*(int *)((longlong)plVar1 + 0xc) << 3,0);
    *plVar1 = (longlong)_Dst;
    *(int *)((longlong)plVar1 + 0xc) = param_2;
  }
  return;
}



undefined8 * FUN_140406c30(longlong param_1,void *param_2,ulonglong param_3)

{
  byte bVar1;
  longlong *plVar2;
  int iVar3;
  undefined8 *puVar4;
  ulonglong uVar5;
  uint uVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  
  uVar5 = param_3 & 0xffffffff;
  uVar6 = (uint)param_3;
  uVar7 = (param_3 >> 5) + 1;
  for (uVar8 = param_3; uVar7 <= uVar8; uVar8 = uVar8 - uVar7) {
    uVar6 = (uint)uVar5 ^
            (uint)*(byte *)((uVar8 - 1) + (longlong)param_2) + (uint)uVar5 * 0x20 +
            (int)(uVar5 >> 2);
    uVar5 = (ulonglong)uVar6;
  }
  puVar4 = *(undefined8 **)
            (**(longlong **)(param_1 + 0x20) +
            (longlong)(int)(*(int *)((longlong)*(longlong **)(param_1 + 0x20) + 0xc) - 1U & uVar6) *
            8);
  while( true ) {
    if (puVar4 == (undefined8 *)0x0) {
      if (0xffffffffffffffe5 < param_3 + 1) {
        FUN_1404069c0(param_1);
      }
      puVar4 = (undefined8 *)FUN_1404069e0(param_1,0,0,param_3 + 0x19);
      puVar4[2] = param_3;
      *(uint *)((longlong)puVar4 + 0xc) = uVar6;
      bVar1 = *(byte *)(*(longlong *)(param_1 + 0x20) + 0x20);
      *(undefined1 *)(puVar4 + 1) = 4;
      *(undefined1 *)((longlong)puVar4 + 10) = 0;
      *(byte *)((longlong)puVar4 + 9) = bVar1 & 3;
      memcpy(puVar4 + 3,param_2,param_3);
      *(undefined1 *)((longlong)puVar4 + param_3 + 0x18) = 0;
      plVar2 = *(longlong **)(param_1 + 0x20);
      uVar5 = (ulonglong)(*(int *)((longlong)plVar2 + 0xc) - 1U & uVar6);
      *puVar4 = *(undefined8 *)(*plVar2 + uVar5 * 8);
      *(undefined8 **)(*plVar2 + uVar5 * 8) = puVar4;
      uVar6 = *(uint *)((longlong)plVar2 + 0xc);
      *(int *)(plVar2 + 1) = (int)plVar2[1] + 1;
      if ((uVar6 < *(uint *)(plVar2 + 1)) && ((int)uVar6 < 0x3fffffff)) {
        FUN_140406b40(param_1,uVar6 * 2);
      }
      return puVar4;
    }
    if ((puVar4[2] == param_3) && (iVar3 = memcmp(param_2,puVar4 + 3,param_3), iVar3 == 0)) break;
    puVar4 = (undefined8 *)*puVar4;
  }
  if ((*(byte *)((longlong)puVar4 + 9) & 3 & ~*(byte *)(*(longlong *)(param_1 + 0x20) + 0x20)) == 0)
  {
    return puVar4;
  }
  *(byte *)((longlong)puVar4 + 9) = *(byte *)((longlong)puVar4 + 9) ^ 3;
  return puVar4;
}



void FUN_140406db0(longlong param_1,undefined1 param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  
  plVar1 = *(longlong **)(param_1 + 0x48);
  if ((ulonglong)plVar1[2] < plVar1[1] + 1U) {
    if (0x7ffffffffffffffd < (ulonglong)plVar1[2]) {
      FUN_140406f70(param_1,"lexical element too long",0);
    }
    lVar2 = plVar1[2] * 2;
    if (lVar2 + 1U < 0xfffffffffffffffe) {
      lVar3 = FUN_1404069e0(*(undefined8 *)(param_1 + 0x38),*plVar1,plVar1[2],lVar2);
    }
    else {
      lVar3 = FUN_1404069c0(*(undefined8 *)(param_1 + 0x38));
    }
    plVar1[2] = lVar2;
    *plVar1 = lVar3;
  }
  *(undefined1 *)(plVar1[1] + *plVar1) = param_2;
  plVar1[1] = plVar1[1] + 1;
  return;
}



undefined * FUN_140406e60(longlong param_1,int param_2)

{
  int iVar1;
  undefined *puVar2;
  char *pcVar3;
  
  if (param_2 < 0x101) {
    iVar1 = iscntrl(param_2);
    pcVar3 = "char(%d)";
    if (iVar1 == 0) {
      pcVar3 = "%c";
    }
    puVar2 = (undefined *)FUN_14040b860(*(undefined8 *)(param_1 + 0x38),pcVar3,param_2);
    return puVar2;
  }
  return (&PTR_FUN_1404746e8)[param_2];
}



undefined * FUN_140406ed0(longlong param_1,int param_2)

{
  int iVar1;
  undefined *puVar2;
  
  if ((0x11b < param_2) && (param_2 < 0x11f)) {
    FUN_140406db0(param_1,0);
    return (undefined *)**(undefined8 **)(param_1 + 0x48);
  }
  if (0x100 < param_2) {
    return (&PTR_FUN_1404746e8)[param_2];
  }
  iVar1 = iscntrl(param_2);
  if (iVar1 != 0) {
    puVar2 = (undefined *)FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"char(%d)",param_2);
    return puVar2;
  }
  puVar2 = (undefined *)FUN_14040b860(*(undefined8 *)(param_1 + 0x38),&DAT_1404741b4,param_2);
  return puVar2;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140406f70(longlong param_1,undefined8 param_2,int param_3)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined1 auStack_a8 [32];
  undefined8 local_88;
  undefined1 local_78 [80];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  FUN_14040b890(local_78,*(longlong *)(param_1 + 0x50) + 0x18,0x50);
  local_88 = param_2;
  uVar1 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"%s:%d: %s",local_78,
                        *(undefined4 *)(param_1 + 4));
  if (param_3 != 0) {
    uVar2 = FUN_140406ed0(param_1,param_3);
    FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"%s near \'%s\'",uVar1,uVar2);
  }
  FUN_140406350(*(undefined8 *)(param_1 + 0x38),3);
  return;
}



void FUN_140407020(longlong param_1,undefined8 param_2)

{
  FUN_140406f70(param_1,param_2,*(undefined4 *)(param_1 + 0x10));
  return;
}



undefined8 FUN_140407030(longlong param_1)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined4 *puVar3;
  
  uVar1 = *(undefined8 *)(param_1 + 0x38);
  uVar2 = FUN_140406c30(uVar1);
  puVar3 = (undefined4 *)
           FUN_1404096b0(uVar1,*(undefined8 *)(*(longlong *)(param_1 + 0x30) + 8),uVar2);
  if (puVar3[2] == 0) {
    *puVar3 = 1;
    puVar3[2] = 1;
  }
  return uVar2;
}



void FUN_140407090(uint *param_1)

{
  longlong lVar1;
  byte *pbVar2;
  uint uVar3;
  uint uVar4;
  
  uVar4 = *param_1;
  lVar1 = **(longlong **)(param_1 + 0x10);
  **(longlong **)(param_1 + 0x10) = lVar1 + -1;
  if (lVar1 == 0) {
    uVar3 = FUN_14040e060(*(undefined8 *)(param_1 + 0x10));
  }
  else {
    pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
    uVar3 = (uint)*pbVar2;
    *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
  }
  *param_1 = uVar3;
  if (((uVar3 == 10) || (uVar3 == 0xd)) && (uVar3 != uVar4)) {
    lVar1 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar1 + -1;
    if (lVar1 == 0) {
      uVar4 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar4 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar4;
  }
  param_1[1] = param_1[1] + 1;
  if (0x7ffffffc < (int)param_1[1]) {
    FUN_140406f70(param_1,"chunk has too many lines",param_1[4]);
  }
  return;
}



void FUN_140407140(undefined8 param_1,uint *param_2,undefined8 param_3,undefined8 param_4)

{
  byte bVar1;
  longlong lVar2;
  byte *pbVar3;
  uint uVar4;
  undefined8 uVar5;
  
  *(undefined8 *)(param_2 + 0x14) = param_4;
  *(undefined1 *)(param_2 + 0x16) = 0x2e;
  *(undefined8 *)(param_2 + 0xe) = param_1;
  param_2[8] = 0x11f;
  *(undefined8 *)(param_2 + 0x10) = param_3;
  param_2[0xc] = 0;
  param_2[0xd] = 0;
  param_2[1] = 1;
  param_2[2] = 1;
  uVar5 = FUN_1404069e0(param_1,**(undefined8 **)(param_2 + 0x12),
                        (*(undefined8 **)(param_2 + 0x12))[2],0x20);
  **(undefined8 **)(param_2 + 0x12) = uVar5;
  *(undefined8 *)(*(longlong *)(param_2 + 0x12) + 0x10) = 0x20;
  lVar2 = **(longlong **)(param_2 + 0x10);
  **(longlong **)(param_2 + 0x10) = lVar2 + -1;
  if (lVar2 != 0) {
    pbVar3 = *(byte **)(*(longlong *)(param_2 + 0x10) + 8);
    bVar1 = *pbVar3;
    *(byte **)(*(longlong *)(param_2 + 0x10) + 8) = pbVar3 + 1;
    *param_2 = (uint)bVar1;
    return;
  }
  uVar4 = FUN_14040e060(*(undefined8 *)(param_2 + 0x10));
  *param_2 = uVar4;
  return;
}



void FUN_1404071e0(longlong param_1,undefined8 param_2)

{
  char *pcVar1;
  char cVar2;
  longlong lVar3;
  undefined1 uVar4;
  int iVar5;
  lconv *plVar6;
  char cVar7;
  longlong lVar8;
  char cVar9;
  
  plVar6 = localeconv();
  cVar2 = *(char *)(param_1 + 0x58);
  if (plVar6 == (lconv *)0x0) {
    cVar9 = '.';
  }
  else {
    cVar9 = *plVar6->decimal_point;
  }
  *(char *)(param_1 + 0x58) = cVar9;
  lVar8 = (*(longlong **)(param_1 + 0x48))[1];
  lVar3 = **(longlong **)(param_1 + 0x48);
  while (lVar8 != 0) {
    pcVar1 = (char *)(lVar3 + -1 + lVar8);
    lVar8 = lVar8 + -1;
    cVar7 = *pcVar1;
    if (*(char *)(lVar3 + lVar8) == cVar2) {
      cVar7 = cVar9;
    }
    *(char *)(lVar3 + lVar8) = cVar7;
  }
  iVar5 = FUN_14040b3b0(**(undefined8 **)(param_1 + 0x48),param_2);
  if (iVar5 == 0) {
    cVar2 = *(char *)(param_1 + 0x58);
    lVar8 = (*(longlong **)(param_1 + 0x48))[1];
    lVar3 = **(longlong **)(param_1 + 0x48);
    while (lVar8 != 0) {
      uVar4 = *(undefined1 *)(lVar3 + -1 + lVar8);
      lVar8 = lVar8 + -1;
      if (*(char *)(lVar3 + lVar8) == cVar2) {
        uVar4 = 0x2e;
      }
      *(undefined1 *)(lVar3 + lVar8) = uVar4;
    }
    FUN_140406f70(param_1,"malformed number",0x11c);
  }
  return;
}



void FUN_1404072c0(uint *param_1,undefined8 param_2)

{
  undefined1 *puVar1;
  byte *pbVar2;
  longlong lVar3;
  int iVar4;
  uint uVar5;
  char *pcVar6;
  undefined1 uVar7;
  longlong lVar8;
  
  do {
    FUN_140406db0(param_1,*param_1);
    lVar8 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar8 + -1;
    if (lVar8 == 0) {
      uVar5 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar5 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar5;
    iVar4 = isdigit(uVar5);
  } while ((iVar4 != 0) || (*param_1 == 0x2e));
  pcVar6 = strchr("Ee",*param_1);
  if (pcVar6 == (char *)0x0) goto LAB_1404073c0;
  FUN_140406db0(param_1,*param_1);
  lVar8 = **(longlong **)(param_1 + 0x10);
  **(longlong **)(param_1 + 0x10) = lVar8 + -1;
  if (lVar8 == 0) {
    uVar5 = FUN_14040e060();
  }
  else {
    pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
    uVar5 = (uint)*pbVar2;
    *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
  }
  *param_1 = uVar5;
  pcVar6 = strchr("+-",uVar5);
  if (pcVar6 == (char *)0x0) goto LAB_1404073c0;
  do {
    FUN_140406db0(param_1,*param_1);
    lVar8 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar8 + -1;
    if (lVar8 == 0) {
      uVar5 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar5 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar5;
LAB_1404073c0:
    iVar4 = isalnum(*param_1);
  } while ((iVar4 != 0) || (*param_1 == 0x5f));
  FUN_140406db0(param_1,0);
  uVar5 = param_1[0x16];
  lVar8 = (*(longlong **)(param_1 + 0x12))[1];
  lVar3 = **(longlong **)(param_1 + 0x12);
  while (lVar8 != 0) {
    puVar1 = (undefined1 *)(lVar3 + -1 + lVar8);
    lVar8 = lVar8 + -1;
    uVar7 = *puVar1;
    if (*(char *)(lVar3 + lVar8) == '.') {
      uVar7 = (char)uVar5;
    }
    *(undefined1 *)(lVar3 + lVar8) = uVar7;
  }
  iVar4 = FUN_14040b3b0(**(undefined8 **)(param_1 + 0x12),param_2);
  if (iVar4 == 0) {
    FUN_1404071e0(param_1,param_2);
  }
  return;
}



int FUN_140407440(uint *param_1)

{
  uint uVar1;
  longlong lVar2;
  byte *pbVar3;
  longlong *plVar4;
  uint uVar5;
  longlong lVar6;
  int iVar7;
  
  uVar1 = *param_1;
  iVar7 = 0;
  FUN_140406db0(param_1,uVar1);
  lVar2 = **(longlong **)(param_1 + 0x10);
  **(longlong **)(param_1 + 0x10) = lVar2 + -1;
  if (lVar2 == 0) {
    uVar5 = FUN_14040e060();
  }
  else {
    pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
    uVar5 = (uint)*pbVar3;
    *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
  }
  *param_1 = uVar5;
  while (uVar5 == 0x3d) {
    plVar4 = *(longlong **)(param_1 + 0x12);
    uVar5 = *param_1;
    if ((ulonglong)plVar4[2] < plVar4[1] + 1U) {
      if (0x7ffffffffffffffd < (ulonglong)plVar4[2]) {
        FUN_140406f70(param_1,"lexical element too long",0);
      }
      lVar2 = plVar4[2] * 2;
      if (lVar2 + 1U < 0xfffffffffffffffe) {
        lVar6 = FUN_1404069e0(*(undefined8 *)(param_1 + 0xe),*plVar4,plVar4[2],lVar2);
      }
      else {
        lVar6 = FUN_1404069c0(*(undefined8 *)(param_1 + 0xe));
      }
      *plVar4 = lVar6;
      plVar4[2] = lVar2;
    }
    *(char *)(*plVar4 + plVar4[1]) = (char)uVar5;
    plVar4[1] = plVar4[1] + 1;
    lVar2 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar2 + -1;
    if (lVar2 == 0) {
      uVar5 = FUN_14040e060();
    }
    else {
      pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar5 = (uint)*pbVar3;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
    }
    iVar7 = iVar7 + 1;
    *param_1 = uVar5;
  }
  if (*param_1 == uVar1) {
    return iVar7;
  }
  return -1 - iVar7;
}



void FUN_1404075a0(uint *param_1,undefined8 *param_2,int param_3)

{
  byte bVar1;
  longlong lVar2;
  byte *pbVar3;
  undefined8 uVar4;
  uint uVar5;
  int iVar6;
  undefined8 uVar7;
  undefined4 *puVar8;
  char *pcVar9;
  
  FUN_140406db0(param_1,*param_1);
  lVar2 = **(longlong **)(param_1 + 0x10);
  **(longlong **)(param_1 + 0x10) = lVar2 + -1;
  if (lVar2 == 0) {
    uVar5 = FUN_14040e060(*(undefined8 *)(param_1 + 0x10));
  }
  else {
    pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
    uVar5 = (uint)*pbVar3;
    *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
  }
  *param_1 = uVar5;
  if ((uVar5 == 10) || (uVar5 == 0xd)) {
    FUN_140407090(param_1);
  }
LAB_140407620:
  do {
    while( true ) {
      while( true ) {
        while( true ) {
          while (uVar5 = *param_1, uVar5 == 0xffffffff) {
            pcVar9 = "unfinished long comment";
            if (param_2 != (undefined8 *)0x0) {
              pcVar9 = "unfinished long string";
            }
            FUN_140406f70(param_1,pcVar9,0x11f);
          }
          if ((uVar5 != 10) && (uVar5 != 0xd)) break;
          FUN_140406db0(param_1,10);
          FUN_140407090(param_1);
          if (param_2 == (undefined8 *)0x0) {
            *(undefined8 *)(*(longlong *)(param_1 + 0x12) + 8) = 0;
          }
        }
        if (uVar5 != 0x5b) break;
        iVar6 = FUN_140407440(param_1);
        if (iVar6 == param_3) {
          FUN_140406db0(param_1,*param_1);
          lVar2 = **(longlong **)(param_1 + 0x10);
          **(longlong **)(param_1 + 0x10) = lVar2 + -1;
          if (lVar2 == 0) {
            uVar5 = FUN_14040e060();
          }
          else {
            pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
            uVar5 = (uint)*pbVar3;
            *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
          }
          *param_1 = uVar5;
          if (param_3 == 0) {
            FUN_140406f70(param_1,"nesting of [[...]] is deprecated",0x5b);
          }
        }
      }
      if (uVar5 != 0x5d) break;
      iVar6 = FUN_140407440(param_1);
      if (iVar6 == param_3) {
        FUN_140406db0(param_1,*param_1);
        lVar2 = **(longlong **)(param_1 + 0x10);
        **(longlong **)(param_1 + 0x10) = lVar2 + -1;
        if (lVar2 == 0) {
          uVar5 = FUN_14040e060();
        }
        else {
          pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
          uVar5 = (uint)*pbVar3;
          *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
        }
        *param_1 = uVar5;
        if (param_2 != (undefined8 *)0x0) {
          uVar4 = *(undefined8 *)(param_1 + 0xe);
          uVar7 = FUN_140406c30(uVar4,(longlong)(param_3 + 2) + **(longlong **)(param_1 + 0x12),
                                (*(longlong **)(param_1 + 0x12))[1] - (longlong)((param_3 + 2) * 2))
          ;
          puVar8 = (undefined4 *)
                   FUN_1404096b0(uVar4,*(undefined8 *)(*(longlong *)(param_1 + 0xc) + 8),uVar7);
          if (puVar8[2] == 0) {
            *puVar8 = 1;
            puVar8[2] = 1;
          }
          *param_2 = uVar7;
        }
        return;
      }
    }
    if (param_2 == (undefined8 *)0x0) {
      lVar2 = **(longlong **)(param_1 + 0x10);
      **(longlong **)(param_1 + 0x10) = lVar2 + -1;
      if (lVar2 != 0) {
        pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
        bVar1 = *pbVar3;
        *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
        *param_1 = (uint)bVar1;
        goto LAB_140407620;
      }
    }
    else {
      FUN_140406db0(param_1);
      lVar2 = **(longlong **)(param_1 + 0x10);
      **(longlong **)(param_1 + 0x10) = lVar2 + -1;
      if (lVar2 != 0) {
        pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
        bVar1 = *pbVar3;
        *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
        *param_1 = (uint)bVar1;
        goto LAB_140407620;
      }
    }
    uVar5 = FUN_14040e060(*(undefined8 *)(param_1 + 0x10));
    *param_1 = uVar5;
  } while( true );
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140407840(uint *param_1,uint param_2,undefined8 *param_3)

{
  byte bVar1;
  longlong lVar2;
  byte *pbVar3;
  int iVar4;
  int iVar5;
  uint uVar6;
  undefined8 uVar7;
  undefined8 uVar8;
  undefined4 *puVar9;
  int iVar10;
  char *pcVar11;
  undefined1 auStack_b8 [32];
  char *local_98;
  undefined1 local_88 [80];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_b8;
  FUN_140406db0(param_1,*param_1);
  lVar2 = **(longlong **)(param_1 + 0x10);
  **(longlong **)(param_1 + 0x10) = lVar2 + -1;
  if (lVar2 == 0) {
    uVar6 = FUN_14040e060();
  }
  else {
    pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
    uVar6 = (uint)*pbVar3;
    *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
  }
  *param_1 = uVar6;
  do {
    if (uVar6 == param_2) {
      FUN_140406db0(param_1,*param_1);
      lVar2 = **(longlong **)(param_1 + 0x10);
      **(longlong **)(param_1 + 0x10) = lVar2 + -1;
      if (lVar2 == 0) {
        uVar6 = FUN_14040e060();
      }
      else {
        pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
        uVar6 = (uint)*pbVar3;
        *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
      }
      uVar7 = *(undefined8 *)(param_1 + 0xe);
      *param_1 = uVar6;
      uVar8 = FUN_140406c30(uVar7,**(longlong **)(param_1 + 0x12) + 1,
                            (*(longlong **)(param_1 + 0x12))[1] + -2);
      puVar9 = (undefined4 *)
               FUN_1404096b0(uVar7,*(undefined8 *)(*(longlong *)(param_1 + 0xc) + 8),uVar8);
      if (puVar9[2] == 0) {
        *puVar9 = 1;
        puVar9[2] = 1;
      }
      *param_3 = uVar8;
      return;
    }
    uVar6 = *param_1;
    if (uVar6 == 0xffffffff) {
      FUN_14040b890(local_88,*(longlong *)(param_1 + 0x14) + 0x18,0x50);
      local_98 = "unfinished string";
      uVar7 = FUN_14040b860(*(undefined8 *)(param_1 + 0xe),"%s:%d: %s",local_88,param_1[1]);
      pcVar11 = "<eof>";
LAB_140407b18:
      FUN_14040b860(*(undefined8 *)(param_1 + 0xe),"%s near \'%s\'",uVar7,pcVar11);
      FUN_140406350(*(undefined8 *)(param_1 + 0xe),3);
      goto switchD_14040798a_caseD_ffffffff;
    }
    if ((uVar6 == 10) || (uVar6 == 0xd)) {
      FUN_14040b890(local_88,*(longlong *)(param_1 + 0x14) + 0x18,0x50);
      local_98 = "unfinished string";
      uVar7 = FUN_14040b860(*(undefined8 *)(param_1 + 0xe),"%s:%d: %s",local_88,param_1[1]);
      FUN_140406db0(param_1,0);
      pcVar11 = (char *)**(undefined8 **)(param_1 + 0x12);
      goto LAB_140407b18;
    }
    if (uVar6 != 0x5c) goto LAB_1404078f3;
    lVar2 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar2 + -1;
    if (lVar2 == 0) {
      uVar6 = FUN_14040e060();
    }
    else {
      pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar6 = (uint)*pbVar3;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
    }
    *param_1 = uVar6;
    switch(uVar6) {
    default:
      iVar4 = isdigit(uVar6);
      if (iVar4 == 0) {
        uVar6 = *param_1;
        break;
      }
      iVar10 = 0;
      iVar4 = 0;
      do {
        iVar4 = (*param_1 - 0x30) + iVar4 * 10;
        lVar2 = **(longlong **)(param_1 + 0x10);
        **(longlong **)(param_1 + 0x10) = lVar2 + -1;
        if (lVar2 == 0) {
          uVar6 = FUN_14040e060();
        }
        else {
          pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
          uVar6 = (uint)*pbVar3;
          *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
        }
        iVar10 = iVar10 + 1;
        *param_1 = uVar6;
      } while ((iVar10 < 3) && (iVar5 = isdigit(uVar6), iVar5 != 0));
      if (0xff < iVar4) {
        FUN_140406f70(param_1,"escape sequence too large",0x11e);
      }
      FUN_140406db0(param_1,iVar4);
      goto switchD_14040798a_caseD_ffffffff;
    case 10:
    case 0xd:
      FUN_140406db0(param_1,10);
      FUN_140407090(param_1);
      goto switchD_14040798a_caseD_ffffffff;
    case 0x61:
      uVar6 = 7;
      break;
    case 0x62:
      uVar6 = 8;
      break;
    case 0x66:
      uVar6 = 0xc;
      break;
    case 0x6e:
      uVar6 = 10;
      break;
    case 0x72:
      uVar6 = 0xd;
      break;
    case 0x74:
      uVar6 = 9;
      break;
    case 0x76:
      uVar6 = 0xb;
      break;
    case 0xffffffff:
      goto switchD_14040798a_caseD_ffffffff;
    }
LAB_1404078f3:
    FUN_140406db0(param_1,uVar6);
    lVar2 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar2 + -1;
    if (lVar2 == 0) {
      uVar6 = FUN_14040e060();
      *param_1 = uVar6;
    }
    else {
      pbVar3 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      bVar1 = *pbVar3;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar3 + 1;
      *param_1 = (uint)bVar1;
    }
switchD_14040798a_caseD_ffffffff:
    uVar6 = *param_1;
  } while( true );
}



uint FUN_140407cb0(uint *param_1,longlong *param_2)

{
  byte bVar1;
  byte *pbVar2;
  int iVar3;
  uint uVar4;
  uint uVar5;
  char *pcVar6;
  longlong lVar7;
  
  *(undefined8 *)(*(longlong *)(param_1 + 0x12) + 8) = 0;
LAB_140407ce0:
  switch(*param_1) {
  default:
    iVar3 = isspace(*param_1);
    if (iVar3 != 0) {
      lVar7 = **(longlong **)(param_1 + 0x10);
      **(longlong **)(param_1 + 0x10) = lVar7 + -1;
      if (lVar7 == 0) {
        uVar4 = FUN_14040e060();
        *param_1 = uVar4;
      }
      else {
        pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
        bVar1 = *pbVar2;
        *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
        *param_1 = (uint)bVar1;
      }
      goto LAB_140407ce0;
    }
    iVar3 = isdigit(*param_1);
    if (iVar3 == 0) {
      iVar3 = isalpha(*param_1);
      if ((iVar3 == 0) && (uVar4 = *param_1, uVar4 != 0x5f)) {
        lVar7 = **(longlong **)(param_1 + 0x10);
        **(longlong **)(param_1 + 0x10) = lVar7 + -1;
        if (lVar7 != 0) {
          pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
          bVar1 = *pbVar2;
          *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
          *param_1 = (uint)bVar1;
          return uVar4;
        }
        uVar5 = FUN_14040e060();
        *param_1 = uVar5;
        return uVar4;
      }
      do {
        FUN_140406db0(param_1,*param_1);
        lVar7 = **(longlong **)(param_1 + 0x10);
        **(longlong **)(param_1 + 0x10) = lVar7 + -1;
        if (lVar7 == 0) {
          uVar4 = FUN_14040e060();
        }
        else {
          pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
          uVar4 = (uint)*pbVar2;
          *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
        }
        *param_1 = uVar4;
        iVar3 = isalnum(uVar4);
      } while ((iVar3 != 0) || (*param_1 == 0x5f));
      lVar7 = FUN_140407030(param_1,**(undefined8 **)(param_1 + 0x12),
                            (*(undefined8 **)(param_1 + 0x12))[1]);
      if (*(byte *)(lVar7 + 10) != 0) {
        return *(byte *)(lVar7 + 10) + 0x100;
      }
      *param_2 = lVar7;
      return 0x11d;
    }
    break;
  case 10:
  case 0xd:
    FUN_140407090(param_1);
    goto LAB_140407ce0;
  case 0x22:
  case 0x27:
    FUN_140407840(param_1,*param_1,param_2);
    return 0x11e;
  case 0x2d:
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 == 0) {
      uVar4 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar4 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar4;
    if (uVar4 != 0x2d) {
      return 0x2d;
    }
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 == 0) {
      uVar4 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar4 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar4;
    if (uVar4 == 0x5b) {
      iVar3 = FUN_140407440(param_1);
      *(undefined8 *)(*(longlong *)(param_1 + 0x12) + 8) = 0;
      if (iVar3 < 0) goto LAB_140407db6;
      FUN_1404075a0(param_1,0,iVar3);
      *(undefined8 *)(*(longlong *)(param_1 + 0x12) + 8) = 0;
    }
    else {
LAB_140407db6:
      uVar4 = *param_1;
      while (((uVar4 != 10 && (*param_1 != 0xd)) && (*param_1 != 0xffffffff))) {
        lVar7 = **(longlong **)(param_1 + 0x10);
        **(longlong **)(param_1 + 0x10) = lVar7 + -1;
        if (lVar7 == 0) {
          uVar4 = FUN_14040e060();
        }
        else {
          pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
          uVar4 = (uint)*pbVar2;
          *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
        }
        *param_1 = uVar4;
      }
    }
    goto LAB_140407ce0;
  case 0x2e:
    FUN_140406db0(param_1,*param_1);
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 == 0) {
      uVar4 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar4 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar4;
    pcVar6 = strchr(".",uVar4);
    if (pcVar6 != (char *)0x0) {
      FUN_140406db0(param_1,*param_1);
      lVar7 = **(longlong **)(param_1 + 0x10);
      **(longlong **)(param_1 + 0x10) = lVar7 + -1;
      if (lVar7 == 0) {
        uVar4 = FUN_14040e060();
      }
      else {
        pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
        uVar4 = (uint)*pbVar2;
        *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
      }
      *param_1 = uVar4;
      pcVar6 = strchr(".",uVar4);
      if (pcVar6 != (char *)0x0) {
        FUN_140406db0(param_1,*param_1);
        lVar7 = **(longlong **)(param_1 + 0x10);
        **(longlong **)(param_1 + 0x10) = lVar7 + -1;
        if (lVar7 != 0) {
          pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
          bVar1 = *pbVar2;
          *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
          *param_1 = (uint)bVar1;
          return 0x117;
        }
        uVar4 = FUN_14040e060();
        *param_1 = uVar4;
        return 0x117;
      }
      return 0x116;
    }
    iVar3 = isdigit(*param_1);
    if (iVar3 == 0) {
      return 0x2e;
    }
    break;
  case 0x3c:
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 == 0) {
      uVar4 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar4 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar4;
    if (uVar4 != 0x3d) {
      return 0x3c;
    }
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 != 0) {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      bVar1 = *pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
      *param_1 = (uint)bVar1;
      return 0x11a;
    }
    uVar4 = FUN_14040e060();
    *param_1 = uVar4;
    return 0x11a;
  case 0x3d:
    goto switchD_140407d04_caseD_3d;
  case 0x3e:
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 == 0) {
      uVar4 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar4 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar4;
    if (uVar4 != 0x3d) {
      return 0x3e;
    }
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 != 0) {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      bVar1 = *pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
      *param_1 = (uint)bVar1;
      return 0x119;
    }
    uVar4 = FUN_14040e060();
    *param_1 = uVar4;
    return 0x119;
  case 0x5b:
    iVar3 = FUN_140407440(param_1);
    if (-1 < iVar3) {
      FUN_1404075a0(param_1,param_2,iVar3);
      return 0x11e;
    }
    if (iVar3 == -1) {
      return 0x5b;
    }
    FUN_140406f70(param_1,"invalid long string delimiter",0x11e);
    goto switchD_140407d04_caseD_3d;
  case 0x7e:
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 == 0) {
      uVar4 = FUN_14040e060();
    }
    else {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      uVar4 = (uint)*pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    }
    *param_1 = uVar4;
    if (uVar4 != 0x3d) {
      return 0x7e;
    }
    lVar7 = **(longlong **)(param_1 + 0x10);
    **(longlong **)(param_1 + 0x10) = lVar7 + -1;
    if (lVar7 != 0) {
      pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
      bVar1 = *pbVar2;
      *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
      *param_1 = (uint)bVar1;
      return 0x11b;
    }
    uVar4 = FUN_14040e060();
    *param_1 = uVar4;
    return 0x11b;
  case 0xffffffff:
    return 0x11f;
  }
  FUN_1404072c0(param_1,param_2);
  return 0x11c;
switchD_140407d04_caseD_3d:
  lVar7 = **(longlong **)(param_1 + 0x10);
  **(longlong **)(param_1 + 0x10) = lVar7 + -1;
  if (lVar7 == 0) {
    uVar4 = FUN_14040e060();
  }
  else {
    pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
    uVar4 = (uint)*pbVar2;
    *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
  }
  *param_1 = uVar4;
  if (uVar4 != 0x3d) {
    return 0x3d;
  }
  lVar7 = **(longlong **)(param_1 + 0x10);
  **(longlong **)(param_1 + 0x10) = lVar7 + -1;
  if (lVar7 != 0) {
    pbVar2 = *(byte **)(*(longlong *)(param_1 + 0x10) + 8);
    bVar1 = *pbVar2;
    *(byte **)(*(longlong *)(param_1 + 0x10) + 8) = pbVar2 + 1;
    *param_1 = (uint)bVar1;
    return 0x118;
  }
  uVar4 = FUN_14040e060();
  *param_1 = uVar4;
  return 0x118;
}



void FUN_1404084c0(longlong param_1)

{
  undefined4 uVar1;
  
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(param_1 + 4);
  if (*(int *)(param_1 + 0x20) != 0x11f) {
    *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(param_1 + 0x20);
    *(undefined4 *)(param_1 + 0x20) = 0x11f;
    *(undefined8 *)(param_1 + 0x18) = *(undefined8 *)(param_1 + 0x28);
    return;
  }
  uVar1 = FUN_140407cb0(param_1,param_1 + 0x18);
  *(undefined4 *)(param_1 + 0x10) = uVar1;
  return;
}



void FUN_140408510(longlong param_1)

{
  undefined4 uVar1;
  
  uVar1 = FUN_140407cb0(param_1,param_1 + 0x28);
  *(undefined4 *)(param_1 + 0x20) = uVar1;
  return;
}



longlong FUN_140408530(longlong param_1,byte param_2,undefined8 param_3)

{
  longlong lVar1;
  
  lVar1 = FUN_140408c00(param_1,param_3);
  if (*(int *)(lVar1 + 8) == 0) {
    *(byte *)(param_1 + 10) = *(byte *)(param_1 + 10) | '\x01' << (param_2 & 0x1f);
    lVar1 = 0;
  }
  return lVar1;
}



undefined * FUN_140408570(longlong param_1,longlong *param_2,int param_3)

{
  int iVar1;
  undefined *puVar2;
  longlong lVar3;
  
  iVar1 = (int)param_2[1];
  if ((iVar1 == 5) || (iVar1 == 7)) {
    lVar3 = *(longlong *)(*param_2 + 0x10);
  }
  else {
    lVar3 = *(longlong *)(*(longlong *)(param_1 + 0x20) + 0xe0 + (longlong)iVar1 * 8);
  }
  if (lVar3 != 0) {
    puVar2 = (undefined *)
             FUN_140408c00(lVar3,*(undefined8 *)
                                  (*(longlong *)(param_1 + 0x20) + 0x128 + (longlong)param_3 * 8));
    return puVar2;
  }
  return &DAT_140475320;
}



longlong FUN_1404085c0(longlong param_1,double *param_2)

{
  double dVar1;
  int iVar2;
  byte bVar3;
  int local_res10;
  int iStackX_14;
  
  iVar2 = *(int *)(param_2 + 1);
  if (iVar2 == 1) {
    return *(longlong *)(param_1 + 0x20) +
           (longlong)(int)((1 << (*(byte *)(param_1 + 0xb) & 0x1f)) - 1U & *(uint *)param_2) * 0x28;
  }
  if (iVar2 == 2) {
    bVar3 = *(byte *)(param_1 + 0xb);
  }
  else {
    if (iVar2 == 3) {
      dVar1 = *param_2;
      if (dVar1 != 0.0) {
        iStackX_14 = (int)((ulonglong)dVar1 >> 0x20);
        local_res10 = SUB84(dVar1,0);
        return *(longlong *)(param_1 + 0x20) +
               ((ulonglong)(uint)(iStackX_14 + local_res10) %
               (ulonglong)((1 << (*(byte *)(param_1 + 0xb) & 0x1f)) - 1U | 1)) * 0x28;
      }
      return *(longlong *)(param_1 + 0x20);
    }
    bVar3 = *(byte *)(param_1 + 0xb);
    if (iVar2 == 4) {
      return *(longlong *)(param_1 + 0x20) +
             (longlong)(int)((1 << (bVar3 & 0x1f)) - 1U & *(uint *)((longlong)*param_2 + 0xc)) *
             0x28;
    }
  }
  return *(longlong *)(param_1 + 0x20) +
         ((ulonglong)*(uint *)param_2 % (ulonglong)((1 << (bVar3 & 0x1f)) - 1U | 1)) * 0x28;
}



int FUN_1404086b0(undefined8 param_1,longlong param_2,double *param_3)

{
  int iVar1;
  longlong lVar2;
  
  if (*(int *)(param_3 + 1) == 0) {
    return -1;
  }
  if ((((*(int *)(param_3 + 1) == 3) && (iVar1 = (int)*param_3, (double)iVar1 == *param_3)) &&
      (0 < iVar1)) && (iVar1 <= *(int *)(param_2 + 0x38))) {
    return iVar1 + -1;
  }
  lVar2 = FUN_1404085c0(param_2,param_3);
  while ((iVar1 = FUN_14040b340(lVar2 + 0x10,param_3), iVar1 == 0 &&
         (((*(int *)(lVar2 + 0x18) != 0xb || (*(int *)(param_3 + 1) < 4)) ||
          (*(double *)(lVar2 + 0x10) != *param_3))))) {
    lVar2 = *(longlong *)(lVar2 + 0x20);
    if (lVar2 == 0) {
      FUN_140405330(param_1,"invalid key to \'next\'");
      return 0;
    }
  }
  return (int)((lVar2 - *(longlong *)(param_2 + 0x20)) / 0x28) + *(int *)(param_2 + 0x38);
}



undefined8 FUN_1404087c0(undefined8 param_1,longlong param_2,double *param_3)

{
  longlong lVar1;
  int iVar2;
  int *piVar3;
  longlong lVar4;
  double *pdVar5;
  int iVar6;
  
  iVar2 = FUN_1404086b0();
  iVar6 = *(int *)(param_2 + 0x38);
  iVar2 = iVar2 + 1;
  if (iVar2 < iVar6) {
    piVar3 = (int *)(*(longlong *)(param_2 + 0x18) + 8 + (longlong)iVar2 * 0x10);
    do {
      if (*piVar3 != 0) {
        *(undefined4 *)(param_3 + 1) = 3;
        *param_3 = (double)(iVar2 + 1);
        pdVar5 = (double *)((longlong)iVar2 * 0x10 + *(longlong *)(param_2 + 0x18));
        param_3[2] = *pdVar5;
        *(undefined4 *)(param_3 + 3) = *(undefined4 *)(pdVar5 + 1);
        return 1;
      }
      iVar2 = iVar2 + 1;
      piVar3 = piVar3 + 4;
    } while (iVar2 < iVar6);
  }
  iVar2 = iVar2 - iVar6;
  iVar6 = 1 << (*(byte *)(param_2 + 0xb) & 0x1f);
  if (iVar2 < iVar6) {
    lVar1 = *(longlong *)(param_2 + 0x20);
    piVar3 = (int *)(lVar1 + 8 + (longlong)iVar2 * 0x28);
    do {
      if (*piVar3 != 0) {
        lVar4 = (longlong)iVar2;
        *param_3 = *(double *)(lVar1 + 0x10 + lVar4 * 0x28);
        *(undefined4 *)(param_3 + 1) = *(undefined4 *)(lVar1 + 0x18 + lVar4 * 0x28);
        lVar1 = *(longlong *)(param_2 + 0x20);
        param_3[2] = *(double *)(lVar1 + lVar4 * 0x28);
        *(undefined4 *)(param_3 + 3) = *(undefined4 *)(lVar1 + 8 + lVar4 * 0x28);
        return 1;
      }
      iVar2 = iVar2 + 1;
      piVar3 = piVar3 + 10;
    } while (iVar2 < iVar6);
  }
  return 0;
}



void FUN_1404088c0(undefined8 param_1,longlong param_2,int param_3)

{
  undefined8 uVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar3 = (longlong)param_3;
  if ((ulonglong)(longlong)(param_3 + 1) < 0x1000000000000000) {
    uVar1 = FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x18),
                          (longlong)*(int *)(param_2 + 0x38) << 4,lVar3 << 4);
  }
  else {
    uVar1 = FUN_1404069c0();
  }
  *(undefined8 *)(param_2 + 0x18) = uVar1;
  lVar2 = (longlong)*(int *)(param_2 + 0x38);
  if (lVar2 < lVar3) {
    lVar3 = lVar3 - lVar2;
    lVar2 = lVar2 << 4;
    do {
      lVar2 = lVar2 + 0x10;
      lVar3 = lVar3 + -1;
      *(undefined4 *)(*(longlong *)(param_2 + 0x18) + -8 + lVar2) = 0;
    } while (lVar3 != 0);
  }
  *(int *)(param_2 + 0x38) = param_3;
  return;
}



void FUN_140408950(undefined8 param_1,longlong param_2,int param_3)

{
  longlong lVar1;
  int iVar2;
  undefined8 uVar3;
  longlong lVar4;
  longlong lVar5;
  int iVar6;
  
  if (param_3 == 0) {
    *(undefined **)(param_2 + 0x20) = &DAT_140475298;
    iVar2 = 0;
    iVar6 = 0;
  }
  else {
    iVar2 = FUN_14040b310(param_3 + -1);
    iVar2 = iVar2 + 1;
    if (0x1a < iVar2) {
      FUN_140405330(param_1,"table overflow");
    }
    iVar6 = 1 << ((byte)iVar2 & 0x1f);
    if ((ulonglong)(longlong)(iVar6 + 1) < 0x666666666666667) {
      uVar3 = FUN_1404069e0(param_1,0,0);
    }
    else {
      uVar3 = FUN_1404069c0(param_1);
    }
    *(undefined8 *)(param_2 + 0x20) = uVar3;
    lVar5 = (longlong)iVar6;
    if (0 < iVar6) {
      lVar4 = 0;
      do {
        lVar1 = *(longlong *)(param_2 + 0x20);
        lVar5 = lVar5 + -1;
        *(undefined8 *)(lVar4 + 0x20 + lVar1) = 0;
        *(undefined4 *)(lVar4 + 0x18 + lVar1) = 0;
        *(undefined4 *)(lVar4 + 8 + lVar1) = 0;
        lVar4 = lVar4 + 0x28;
      } while (lVar5 != 0);
    }
  }
  *(char *)(param_2 + 0xb) = (char)iVar2;
  *(longlong *)(param_2 + 0x28) = *(longlong *)(param_2 + 0x20) + (longlong)iVar6 * 0x28;
  return;
}



longlong FUN_140408a50(undefined8 param_1,undefined4 param_2,undefined4 param_3)

{
  longlong lVar1;
  
  lVar1 = FUN_1404069e0(param_1,0,0,0x40);
  FUN_14040ad20(param_1,lVar1,5);
  *(undefined **)(lVar1 + 0x20) = &DAT_140475298;
  *(undefined8 *)(lVar1 + 0x10) = 0;
  *(undefined8 *)(lVar1 + 0x18) = 0;
  *(undefined4 *)(lVar1 + 0x38) = 0;
  *(undefined2 *)(lVar1 + 10) = 0xff;
  FUN_1404088c0(param_1,lVar1,param_2);
  FUN_140408950(param_1,lVar1,param_3);
  return lVar1;
}



void FUN_140408af0(undefined8 param_1,longlong param_2)

{
  if (*(undefined **)(param_2 + 0x20) != &DAT_140475298) {
    FUN_1404069e0(param_1,*(undefined **)(param_2 + 0x20),
                  (longlong)(1 << (*(byte *)(param_2 + 0xb) & 0x1f)) * 0x28,0);
  }
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x18),(longlong)*(int *)(param_2 + 0x38) << 4,0);
  FUN_1404069e0(param_1,param_2,0x40);
  return;
}



undefined * FUN_140408b70(longlong param_1,int param_2)

{
  undefined *puVar1;
  double dVar2;
  int local_res8;
  int iStackX_c;
  
  if (param_2 - 1U < *(uint *)(param_1 + 0x38)) {
    return (undefined *)((longlong)(param_2 + -1) * 0x10 + *(longlong *)(param_1 + 0x18));
  }
  dVar2 = (double)param_2;
  if (dVar2 == 0.0) {
    puVar1 = *(undefined **)(param_1 + 0x20);
  }
  else {
    iStackX_c = (int)((ulonglong)dVar2 >> 0x20);
    local_res8 = SUB84(dVar2,0);
    puVar1 = (undefined *)
             (*(longlong *)(param_1 + 0x20) +
             ((ulonglong)(uint)(iStackX_c + local_res8) %
             (ulonglong)((1 << (*(byte *)(param_1 + 0xb) & 0x1f)) - 1U | 1)) * 0x28);
  }
  while ((*(int *)(puVar1 + 0x18) != 3 || (*(double *)(puVar1 + 0x10) != dVar2))) {
    puVar1 = *(undefined **)(puVar1 + 0x20);
    if (puVar1 == (undefined *)0x0) {
      return &DAT_140475320;
    }
  }
  return puVar1;
}



undefined * FUN_140408c00(longlong param_1,longlong param_2)

{
  undefined *puVar1;
  
  puVar1 = (undefined *)
           (*(longlong *)(param_1 + 0x20) +
           (longlong)(int)((1 << (*(byte *)(param_1 + 0xb) & 0x1f)) - 1U & *(uint *)(param_2 + 0xc))
           * 0x28);
  while ((*(int *)(puVar1 + 0x18) != 4 || (*(longlong *)(puVar1 + 0x10) != param_2))) {
    puVar1 = *(undefined **)(puVar1 + 0x20);
    if (puVar1 == (undefined *)0x0) {
      return &DAT_140475320;
    }
  }
  return puVar1;
}



undefined * FUN_140408c50(longlong param_1,double *param_2)

{
  int iVar1;
  undefined *puVar2;
  
  iVar1 = *(int *)(param_2 + 1);
  if (iVar1 == 0) {
LAB_140408ca7:
    return &DAT_140475320;
  }
  if (iVar1 == 3) {
    if ((double)(int)*param_2 == *param_2) {
      puVar2 = (undefined *)FUN_140408b70();
      return puVar2;
    }
  }
  else if (iVar1 == 4) {
    puVar2 = (undefined *)
             (*(longlong *)(param_1 + 0x20) +
             (longlong)
             (int)((1 << (*(byte *)(param_1 + 0xb) & 0x1f)) - 1U &
                  *(uint *)((longlong)*param_2 + 0xc)) * 0x28);
    do {
      if ((*(int *)(puVar2 + 0x18) == 4) && (*(double *)(puVar2 + 0x10) == *param_2)) {
        return puVar2;
      }
      puVar2 = *(undefined **)(puVar2 + 0x20);
    } while (puVar2 != (undefined *)0x0);
    goto LAB_140408ca7;
  }
  puVar2 = (undefined *)FUN_1404085c0(param_1,param_2);
  do {
    iVar1 = FUN_14040b340(puVar2 + 0x10,param_2);
    if (iVar1 != 0) {
      return puVar2;
    }
    puVar2 = *(undefined **)(puVar2 + 0x20);
  } while (puVar2 != (undefined *)0x0);
  return &DAT_140475320;
}



void FUN_140408d20(undefined8 param_1,longlong param_2,double *param_3)

{
  undefined *puVar1;
  char *pcVar2;
  
  puVar1 = (undefined *)FUN_140408c50(param_2,param_3);
  *(undefined1 *)(param_2 + 10) = 0;
  if (puVar1 != &DAT_140475320) {
    return;
  }
  if (*(int *)(param_3 + 1) == 0) {
    pcVar2 = "table index is nil";
  }
  else {
    if ((*(int *)(param_3 + 1) != 3) || (!NAN(*param_3))) goto LAB_140408d83;
    pcVar2 = "table index is NaN";
  }
  FUN_140405330(param_1,pcVar2);
LAB_140408d83:
  FUN_140409560(param_1,param_2,param_3);
  return;
}



void FUN_140408db0(undefined8 param_1,undefined8 param_2,int param_3)

{
  undefined *puVar1;
  double local_18;
  undefined4 local_10;
  
  puVar1 = (undefined *)FUN_140408b70(param_2,param_3);
  if (puVar1 == &DAT_140475320) {
    local_10 = 3;
    local_18 = (double)param_3;
    FUN_140409560(param_1,param_2,&local_18);
  }
  return;
}



uint FUN_140408e10(longlong param_1,uint param_2)

{
  uint uVar1;
  undefined *puVar2;
  uint uVar3;
  uint uVar4;
  int iVar5;
  uint uVar6;
  double dVar7;
  int local_res8;
  int iStackX_c;
  
  uVar1 = *(uint *)(param_1 + 0x38);
  uVar3 = param_2 + 1;
  do {
    uVar4 = uVar3;
    if (uVar4 - 1 < uVar1) {
      puVar2 = (undefined *)((longlong)(int)(uVar4 - 1) * 0x10 + *(longlong *)(param_1 + 0x18));
    }
    else {
      dVar7 = (double)(int)uVar4;
      if (dVar7 == 0.0) {
        puVar2 = *(undefined **)(param_1 + 0x20);
      }
      else {
        iStackX_c = (int)((ulonglong)dVar7 >> 0x20);
        local_res8 = SUB84(dVar7,0);
        puVar2 = (undefined *)
                 (*(longlong *)(param_1 + 0x20) +
                 ((ulonglong)(uint)(iStackX_c + local_res8) %
                 (ulonglong)((1 << (*(byte *)(param_1 + 0xb) & 0x1f)) - 1U | 1)) * 0x28);
      }
      do {
        if ((*(int *)(puVar2 + 0x18) == 3) && (*(double *)(puVar2 + 0x10) == dVar7))
        goto LAB_140408ebf;
        puVar2 = *(undefined **)(puVar2 + 0x20);
      } while (puVar2 != (undefined *)0x0);
      puVar2 = &DAT_140475320;
    }
LAB_140408ebf:
    if (*(int *)(puVar2 + 8) == 0) {
      uVar3 = uVar4 - param_2;
      do {
        if (uVar3 < 2) {
          return param_2;
        }
        uVar3 = param_2 + uVar4 >> 1;
        if (uVar3 - 1 < uVar1) {
          puVar2 = (undefined *)((longlong)(int)(uVar3 - 1) * 0x10 + *(longlong *)(param_1 + 0x18));
        }
        else {
          dVar7 = (double)uVar3;
          if (dVar7 == 0.0) {
            puVar2 = *(undefined **)(param_1 + 0x20);
          }
          else {
            iStackX_c = (int)((ulonglong)dVar7 >> 0x20);
            local_res8 = SUB84(dVar7,0);
            puVar2 = (undefined *)
                     (*(longlong *)(param_1 + 0x20) +
                     ((ulonglong)(uint)(iStackX_c + local_res8) %
                     (ulonglong)((1 << (*(byte *)(param_1 + 0xb) & 0x1f)) - 1U | 1)) * 0x28);
          }
          do {
            if ((*(int *)(puVar2 + 0x18) == 3) && (*(double *)(puVar2 + 0x10) == dVar7))
            goto LAB_14040902f;
            puVar2 = *(undefined **)(puVar2 + 0x20);
          } while (puVar2 != (undefined *)0x0);
          puVar2 = &DAT_140475320;
        }
LAB_14040902f:
        uVar6 = uVar3;
        if (*(int *)(puVar2 + 8) == 0) {
          uVar6 = param_2;
          uVar4 = uVar3;
        }
        uVar3 = uVar4 - uVar6;
        param_2 = uVar6;
      } while( true );
    }
    uVar3 = uVar4 * 2;
    param_2 = uVar4;
  } while (uVar4 * 2 < 0x7ffffffe);
  iVar5 = 1;
  uVar3 = 0;
  do {
    if (uVar3 < uVar1) {
      puVar2 = (undefined *)((longlong)(int)uVar3 * 0x10 + *(longlong *)(param_1 + 0x18));
    }
    else {
      dVar7 = (double)iVar5;
      if (dVar7 == 0.0) {
        puVar2 = *(undefined **)(param_1 + 0x20);
      }
      else {
        iStackX_c = (int)((ulonglong)dVar7 >> 0x20);
        local_res8 = SUB84(dVar7,0);
        puVar2 = (undefined *)
                 (*(longlong *)(param_1 + 0x20) +
                 ((ulonglong)(uint)(iStackX_c + local_res8) %
                 (ulonglong)((1 << (*(byte *)(param_1 + 0xb) & 0x1f)) - 1U | 1)) * 0x28);
      }
      do {
        if ((*(int *)(puVar2 + 0x18) == 3) && (*(double *)(puVar2 + 0x10) == dVar7))
        goto LAB_140408f60;
        puVar2 = *(undefined **)(puVar2 + 0x20);
      } while (puVar2 != (undefined *)0x0);
      puVar2 = &DAT_140475320;
    }
LAB_140408f60:
    if (*(int *)(puVar2 + 8) == 0) {
      return iVar5 - 1;
    }
    iVar5 = iVar5 + 1;
    uVar3 = uVar3 + 1;
  } while( true );
}



ulonglong FUN_140409060(longlong param_1)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  
  uVar4 = *(uint *)(param_1 + 0x38);
  if ((uVar4 != 0) &&
     (*(int *)(*(longlong *)(param_1 + 0x18) + 8 + (ulonglong)(uVar4 - 1) * 0x10) == 0)) {
    uVar1 = 0;
    uVar3 = uVar4;
    while (1 < uVar3) {
      uVar3 = uVar1 + uVar4 >> 1;
      uVar5 = uVar3;
      if (*(int *)(*(longlong *)(param_1 + 0x18) + 8 + (ulonglong)(uVar3 - 1) * 0x10) == 0) {
        uVar5 = uVar1;
        uVar4 = uVar3;
      }
      uVar1 = uVar5;
      uVar3 = uVar4 - uVar5;
    }
    return (ulonglong)uVar1;
  }
  if (*(undefined **)(param_1 + 0x20) == &DAT_140475298) {
    return (ulonglong)uVar4;
  }
  uVar2 = FUN_140408e10(param_1,uVar4);
  return uVar2;
}



void FUN_1404090e0(undefined8 param_1,longlong param_2,int param_3,undefined4 param_4)

{
  byte bVar1;
  undefined *puVar2;
  longlong lVar3;
  undefined8 *puVar4;
  undefined8 uVar5;
  double *pdVar6;
  char *pcVar7;
  longlong lVar8;
  longlong lVar9;
  double *pdVar10;
  undefined8 *puVar11;
  int iVar12;
  int iVar13;
  longlong lVar14;
  longlong lVar15;
  double local_50;
  undefined4 local_48;
  
  bVar1 = *(byte *)(param_2 + 0xb);
  puVar2 = *(undefined **)(param_2 + 0x20);
  iVar12 = *(int *)(param_2 + 0x38);
  lVar8 = (longlong)iVar12;
  lVar15 = (longlong)param_3;
  if (iVar12 < param_3) {
    FUN_1404088c0(param_1,param_2,param_3);
  }
  FUN_140408950(param_1,param_2,param_4);
  puVar11 = (undefined8 *)&DAT_140475320;
  if (param_3 < iVar12) {
    *(int *)(param_2 + 0x38) = param_3;
    if (lVar15 < lVar8) {
      lVar9 = lVar15 << 4;
      lVar14 = lVar8 - lVar15;
      iVar12 = param_3;
      do {
        iVar12 = iVar12 + 1;
        lVar3 = *(longlong *)(param_2 + 0x18);
        if (*(int *)(lVar9 + 8 + lVar3) != 0) {
          puVar4 = (undefined8 *)FUN_140408b70(param_2,iVar12);
          if (puVar4 == puVar11) {
            local_48 = 3;
            local_50 = (double)iVar12;
            puVar4 = (undefined8 *)FUN_140409560(param_1,param_2,&local_50);
            puVar11 = (undefined8 *)&DAT_140475320;
          }
          *puVar4 = *(undefined8 *)(lVar9 + lVar3);
          *(undefined4 *)(puVar4 + 1) = *(undefined4 *)(lVar9 + 8 + lVar3);
        }
        lVar9 = lVar9 + 0x10;
        lVar14 = lVar14 + -1;
      } while (lVar14 != 0);
    }
    if ((ulonglong)(longlong)(param_3 + 1) < 0x1000000000000000) {
      uVar5 = FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x18),lVar8 << 4,lVar15 << 4);
    }
    else {
      uVar5 = FUN_1404069c0(param_1);
    }
    *(undefined8 *)(param_2 + 0x18) = uVar5;
  }
  iVar13 = 1 << (bVar1 & 0x1f);
  iVar12 = iVar13 + -1;
  lVar8 = (longlong)iVar12;
  if (-1 < iVar12) {
    pdVar10 = (double *)(puVar2 + lVar8 * 0x28 + 0x10);
    do {
      if (*(int *)(pdVar10 + -1) != 0) {
        pdVar6 = (double *)FUN_140408c50(param_2,pdVar10);
        *(undefined1 *)(param_2 + 10) = 0;
        if (pdVar6 == (double *)&DAT_140475320) {
          if (*(int *)(pdVar10 + 1) == 0) {
            pcVar7 = "table index is nil";
LAB_1404092a2:
            FUN_140405330(param_1,pcVar7);
          }
          else if ((*(int *)(pdVar10 + 1) == 3) && (NAN(*pdVar10))) {
            pcVar7 = "table index is NaN";
            goto LAB_1404092a2;
          }
          pdVar6 = (double *)FUN_140409560(param_1,param_2,pdVar10);
        }
        *pdVar6 = pdVar10[-2];
        *(undefined4 *)(pdVar6 + 1) = *(undefined4 *)(pdVar10 + -1);
      }
      pdVar10 = pdVar10 + -5;
      lVar8 = lVar8 + -1;
    } while (-1 < lVar8);
  }
  if (puVar2 != &DAT_140475298) {
    FUN_1404069e0(param_1,puVar2,(longlong)iVar13 * 0x28,0);
  }
  return;
}



void FUN_140409320(undefined8 param_1,longlong param_2,undefined8 param_3)

{
  if (*(undefined **)(param_2 + 0x20) == &DAT_140475298) {
    FUN_1404090e0(param_1,param_2,param_3,0);
    return;
  }
  FUN_1404090e0(param_1,param_2,param_3,1 << (*(byte *)(param_2 + 0xb) & 0x1f));
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140409350(undefined8 param_1,longlong param_2,double *param_3)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  int *piVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  int iVar9;
  int iVar10;
  longlong lVar11;
  int iVar12;
  int iVar13;
  int iVar14;
  undefined1 auStack_e8 [32];
  undefined8 local_c8;
  double *local_c0;
  int local_b8 [28];
  ulonglong local_48;
  
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_e8;
  local_c8 = param_1;
  local_c0 = param_3;
  memset(local_b8,0,0x6c);
  iVar12 = *(int *)(param_2 + 0x38);
  iVar13 = 1;
  iVar9 = 0;
  iVar7 = 0;
  iVar2 = 1;
  iVar6 = 1;
  iVar14 = 0;
  iVar5 = 1;
  lVar8 = 1;
  lVar11 = 0;
  do {
    iVar10 = 0;
    iVar1 = iVar2;
    if ((iVar12 < iVar2) && (iVar1 = iVar12, iVar12 < iVar6)) break;
    if (lVar8 <= iVar1) {
      piVar4 = (int *)(*(longlong *)(param_2 + 0x18) + -8 + lVar8 * 0x10);
      lVar3 = (iVar1 - lVar8) + 1;
      iVar6 = iVar6 + (int)lVar3;
      lVar8 = lVar8 + lVar3;
      do {
        if (*piVar4 != 0) {
          iVar10 = iVar10 + 1;
        }
        piVar4 = piVar4 + 4;
        lVar3 = lVar3 + -1;
      } while (lVar3 != 0);
    }
    local_b8[lVar11] = local_b8[lVar11] + iVar10;
    lVar11 = lVar11 + 1;
    iVar14 = iVar14 + iVar10;
    iVar2 = iVar2 * 2;
  } while (lVar11 < 0x1b);
  iVar2 = 1 << (*(byte *)(param_2 + 0xb) & 0x1f);
  lVar8 = (longlong)iVar2;
  iVar12 = iVar9;
  if (iVar2 != 0) {
    lVar11 = lVar8 * 0x28;
    do {
      lVar3 = *(longlong *)(param_2 + 0x20);
      lVar8 = lVar8 + -1;
      if (*(int *)(lVar11 + -0x20 + lVar3) != 0) {
        if (((*(int *)(lVar11 + -0x10 + lVar3) == 3) &&
            (iVar2 = (int)*(double *)(lVar11 + -0x18 + lVar3),
            (double)iVar2 == *(double *)(lVar11 + -0x18 + lVar3))) && (iVar2 - 1U < 0x4000000)) {
          iVar2 = FUN_14040b310(iVar2 + -1);
          local_b8[iVar2 + 1] = local_b8[iVar2 + 1] + 1;
          iVar2 = iVar5;
        }
        else {
          iVar2 = 0;
        }
        iVar12 = iVar12 + iVar2;
        iVar7 = iVar7 + 1;
      }
      lVar11 = lVar11 + -0x28;
    } while (lVar8 != 0);
  }
  if (((*(int *)(local_c0 + 1) == 3) && (iVar2 = (int)*local_c0, (double)iVar2 == *local_c0)) &&
     ((0 < iVar2 && (iVar2 < 0x4000001)))) {
    iVar2 = FUN_14040b310(iVar2 + -1);
    local_b8[iVar2 + 1] = local_b8[iVar2 + 1] + 1;
  }
  else {
    iVar5 = 0;
  }
  iVar5 = iVar12 + iVar14 + iVar5;
  iVar12 = 0;
  iVar2 = 0;
  if (0 < iVar5) {
    piVar4 = local_b8;
    do {
      if ((0 < *piVar4) && (iVar9 = iVar9 + *piVar4, iVar13 / 2 < iVar9)) {
        iVar12 = iVar9;
        iVar2 = iVar13;
      }
      if (iVar9 == iVar5) break;
      iVar13 = iVar13 * 2;
      piVar4 = piVar4 + 1;
    } while (iVar13 / 2 < iVar5);
  }
  FUN_1404090e0(local_c8,param_2,iVar2,(iVar7 + 1 + iVar14) - iVar12);
  return;
}



undefined8 * FUN_140409560(undefined8 param_1,longlong param_2,longlong *param_3)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  undefined8 *puVar3;
  undefined8 *puVar4;
  
  puVar2 = (undefined8 *)FUN_1404085c0(param_2,param_3);
  if ((*(int *)(puVar2 + 1) != 0) || (puVar4 = puVar2, puVar2 == (undefined8 *)&DAT_140475298)) {
    puVar4 = *(undefined8 **)(param_2 + 0x28);
    do {
      if (puVar4 <= *(undefined8 **)(param_2 + 0x20)) {
        *(longlong *)(param_2 + 0x28) = *(longlong *)(param_2 + 0x28) + -0x28;
        goto LAB_1404095ca;
      }
      *(longlong *)(param_2 + 0x28) = *(longlong *)(param_2 + 0x28) + -0x28;
      puVar4 = *(undefined8 **)(param_2 + 0x28);
    } while (*(int *)(puVar4 + 3) != 0);
    if (puVar4 == (undefined8 *)0x0) {
LAB_1404095ca:
      FUN_140409350(param_1,param_2,param_3);
      puVar2 = (undefined8 *)FUN_140408d20(param_1,param_2,param_3);
      return puVar2;
    }
    puVar3 = (undefined8 *)FUN_1404085c0(param_2,puVar2 + 2);
    if (puVar3 == puVar2) {
      puVar4[4] = puVar2[4];
      puVar2[4] = puVar4;
    }
    else {
      puVar1 = (undefined8 *)puVar3[4];
      while (puVar1 != puVar2) {
        puVar3 = (undefined8 *)puVar3[4];
        puVar1 = (undefined8 *)puVar3[4];
      }
      puVar3[4] = puVar4;
      *puVar4 = *puVar2;
      puVar4[1] = puVar2[1];
      puVar4[2] = puVar2[2];
      puVar4[3] = puVar2[3];
      puVar4[4] = puVar2[4];
      puVar2[4] = 0;
      *(undefined4 *)(puVar2 + 1) = 0;
      puVar4 = puVar2;
    }
  }
  puVar4[2] = *param_3;
  *(int *)(puVar4 + 3) = (int)param_3[1];
  if (((3 < (int)param_3[1]) && ((*(byte *)(*param_3 + 9) & 3) != 0)) &&
     ((*(byte *)(param_2 + 9) & 4) != 0)) {
    FUN_14040ad00(param_1,param_2);
  }
  return puVar4;
}



void FUN_1404096b0(undefined8 param_1,longlong param_2,longlong param_3)

{
  undefined *puVar1;
  longlong local_18;
  undefined4 local_10;
  
  puVar1 = (undefined *)
           (*(longlong *)(param_2 + 0x20) +
           (longlong)(int)((1 << (*(byte *)(param_2 + 0xb) & 0x1f)) - 1U & *(uint *)(param_3 + 0xc))
           * 0x28);
  while ((*(int *)(puVar1 + 0x18) != 4 || (*(longlong *)(puVar1 + 0x10) != param_3))) {
    puVar1 = *(undefined **)(puVar1 + 0x20);
    if (puVar1 == (undefined *)0x0) {
LAB_140409703:
      local_10 = 4;
      local_18 = param_3;
      FUN_140409560(param_1,param_2,&local_18);
      return;
    }
  }
  if (puVar1 != &DAT_140475320) {
    return;
  }
  goto LAB_140409703;
}



void FUN_140409730(longlong param_1,longlong param_2)

{
  uint uVar1;
  
  *(byte *)(param_2 + 9) = *(byte *)(param_2 + 9) & 0xfc;
  uVar1 = *(byte *)(param_2 + 8) - 4;
  if (6 < uVar1) {
    return;
  }
LAB_140409760:
  switch(uVar1) {
  case 0:
    goto LAB_140409822;
  case 1:
    *(undefined8 *)(param_2 + 0x30) = *(undefined8 *)(param_1 + 0x38);
    break;
  case 2:
    *(undefined8 *)(param_2 + 0x10) = *(undefined8 *)(param_1 + 0x38);
    break;
  case 3:
    goto switchD_14040976c_caseD_3;
  case 4:
    *(undefined8 *)(param_2 + 0xa0) = *(undefined8 *)(param_1 + 0x38);
    break;
  case 5:
    *(undefined8 *)(param_2 + 0x68) = *(undefined8 *)(param_1 + 0x38);
    break;
  case 6:
    if ((3 < (int)(*(longlong **)(param_2 + 0x10))[1]) &&
       ((*(byte *)(**(longlong **)(param_2 + 0x10) + 9) & 3) != 0)) {
      FUN_140409730(param_1);
    }
    if (*(longlong *)(param_2 + 0x10) != param_2 + 0x18) {
      return;
    }
    *(byte *)(param_2 + 9) = *(byte *)(param_2 + 9) | 4;
    return;
  }
  *(longlong *)(param_1 + 0x38) = param_2;
LAB_140409822:
  return;
switchD_14040976c_caseD_3:
  *(byte *)(param_2 + 9) = *(byte *)(param_2 + 9) | 4;
  if ((*(longlong *)(param_2 + 0x10) != 0) &&
     ((*(byte *)(*(longlong *)(param_2 + 0x10) + 9) & 3) != 0)) {
    FUN_140409730(param_1);
  }
  param_2 = *(longlong *)(param_2 + 0x18);
  if ((*(byte *)(param_2 + 9) & 3) == 0) {
    return;
  }
  *(byte *)(param_2 + 9) = *(byte *)(param_2 + 9) & 0xfc;
  uVar1 = *(byte *)(param_2 + 8) - 4;
  if (6 < uVar1) {
    return;
  }
  goto LAB_140409760;
}



void FUN_140409850(longlong param_1)

{
  longlong *plVar1;
  IMAGE_DOS_HEADER *pIVar2;
  
  plVar1 = *(longlong **)(param_1 + 0x50);
  if (plVar1 != (longlong *)0x0) {
    pIVar2 = &IMAGE_DOS_HEADER_140000000;
    do {
      plVar1 = (longlong *)*plVar1;
      *(byte *)((longlong)plVar1 + 9) = *(byte *)((longlong)plVar1 + 9) & 0xf8;
      if (6 < *(byte *)(plVar1 + 1) - 4) goto switchD_14040989b_caseD_40409929;
      switch(pIVar2->e_magic +
             *(uint *)(pIVar2[0x8132].e_program +
                      (longlong)(int)(*(byte *)(plVar1 + 1) - 4) * 4 + -8)) {
      case (char *)0x14040989d:
        *(byte *)((longlong)plVar1 + 9) = *(byte *)((longlong)plVar1 + 9) | 4;
        if ((plVar1[2] != 0) && ((*(byte *)(plVar1[2] + 9) & 3) != 0)) {
          FUN_140409730(param_1);
        }
        if ((*(byte *)(plVar1[3] + 9) & 3) != 0) {
          FUN_140409730(param_1);
        }
        goto switchD_14040989b_caseD_40409929;
      case (char *)0x1404098d0:
        if ((3 < (int)((longlong *)plVar1[2])[1]) &&
           ((*(byte *)(*(longlong *)plVar1[2] + 9) & 3) != 0)) {
          FUN_140409730(param_1);
        }
        if ((longlong *)plVar1[2] == plVar1 + 3) {
          *(byte *)((longlong)plVar1 + 9) = *(byte *)((longlong)plVar1 + 9) | 4;
        }
        goto switchD_14040989b_caseD_40409929;
      case (char *)0x1404098fc:
        plVar1[2] = *(undefined8 *)(param_1 + 0x38);
        break;
      case (char *)0x140409906:
        plVar1[6] = *(undefined8 *)(param_1 + 0x38);
        break;
      case (char *)0x140409910:
        plVar1[0x14] = *(undefined8 *)(param_1 + 0x38);
        break;
      case (char *)0x14040991d:
        plVar1[0xd] = *(undefined8 *)(param_1 + 0x38);
        break;
      case (char *)0x140409929:
        goto switchD_14040989b_caseD_40409929;
      }
      *(longlong **)(param_1 + 0x38) = plVar1;
switchD_14040989b_caseD_40409929:
    } while (plVar1 != *(longlong **)(param_1 + 0x50));
  }
  return;
}



undefined8 FUN_140409960(longlong param_1,longlong param_2)

{
  bool bVar1;
  bool bVar2;
  int iVar3;
  longlong *plVar4;
  char *pcVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  longlong lVar9;
  undefined8 uVar10;
  bool bVar11;
  bool bVar12;
  
  uVar10 = 0;
  bVar1 = false;
  bVar2 = false;
  if ((*(longlong *)(param_2 + 0x10) != 0) &&
     ((*(byte *)(*(longlong *)(param_2 + 0x10) + 9) & 3) != 0)) {
    FUN_140409730();
  }
  lVar9 = *(longlong *)(param_2 + 0x10);
  bVar11 = false;
  bVar12 = false;
  if ((((lVar9 != 0) && (bVar11 = bVar1, bVar12 = bVar2, (*(byte *)(lVar9 + 10) & 8) == 0)) &&
      (plVar4 = (longlong *)FUN_140408530(lVar9,3,*(undefined8 *)(param_1 + 0x140)),
      plVar4 != (longlong *)0x0)) && ((int)plVar4[1] == 4)) {
    pcVar5 = strchr((char *)(*plVar4 + 0x18),0x6b);
    bVar11 = pcVar5 != (char *)0x0;
    pcVar5 = strchr((char *)(*plVar4 + 0x18),0x76);
    bVar12 = pcVar5 != (char *)0x0;
    if ((bVar11) || (bVar12)) {
      *(byte *)(param_2 + 9) = *(byte *)(param_2 + 9) & 0xe7;
      *(byte *)(param_2 + 9) = *(byte *)(param_2 + 9) | (bVar12 * '\x02' | bVar11) << 3;
      *(undefined8 *)(param_2 + 0x30) = *(undefined8 *)(param_1 + 0x48);
      *(longlong *)(param_1 + 0x48) = param_2;
      if (bVar11) {
        if (bVar12) {
          return 1;
        }
      }
      else if (bVar12) goto LAB_140409a7c;
    }
  }
  lVar9 = (longlong)*(int *)(param_2 + 0x38);
  if (lVar9 != 0) {
    lVar6 = lVar9 << 4;
    do {
      lVar7 = lVar6 + -0x10;
      lVar9 = lVar9 + -1;
      if ((3 < *(int *)(lVar6 + -8 + *(longlong *)(param_2 + 0x18))) &&
         ((*(byte *)(*(longlong *)(lVar7 + *(longlong *)(param_2 + 0x18)) + 9) & 3) != 0)) {
        FUN_140409730(param_1);
      }
      lVar6 = lVar7;
    } while (lVar9 != 0);
  }
LAB_140409a7c:
  iVar3 = 1 << (*(byte *)(param_2 + 0xb) & 0x1f);
  lVar9 = (longlong)iVar3;
  if (iVar3 != 0) {
    lVar6 = lVar9 * 0x28;
    do {
      lVar7 = *(longlong *)(param_2 + 0x20);
      lVar8 = lVar6 + -0x28;
      lVar9 = lVar9 + -1;
      if (*(int *)(lVar6 + -0x20 + lVar7) == 0) {
        if (3 < *(int *)(lVar6 + -0x10 + lVar7)) {
          *(undefined4 *)(lVar6 + -0x10 + lVar7) = 0xb;
        }
      }
      else {
        if (((!bVar11) && (3 < *(int *)(lVar6 + -0x10 + lVar7))) &&
           ((*(byte *)(*(longlong *)(lVar6 + -0x18 + lVar7) + 9) & 3) != 0)) {
          FUN_140409730(param_1);
        }
        if (((!bVar12) && (3 < *(int *)(lVar8 + 8 + lVar7))) &&
           ((*(byte *)(*(longlong *)(lVar8 + lVar7) + 9) & 3) != 0)) {
          FUN_140409730(param_1);
        }
      }
      lVar6 = lVar8;
    } while (lVar9 != 0);
  }
  if ((bVar11) || (bVar12)) {
    uVar10 = 1;
  }
  return uVar10;
}



void FUN_140409b40(undefined8 param_1,longlong param_2)

{
  byte *pbVar1;
  longlong lVar2;
  uint uVar3;
  ulonglong uVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  int iVar7;
  
  if (*(longlong *)(param_2 + 0x40) != 0) {
    pbVar1 = (byte *)(*(longlong *)(param_2 + 0x40) + 9);
    *pbVar1 = *pbVar1 & 0xfc;
  }
  uVar4 = 0;
  uVar5 = uVar4;
  uVar6 = uVar4;
  if (0 < *(int *)(param_2 + 0x4c)) {
    do {
      iVar7 = (int)uVar6;
      if ((3 < *(int *)(*(longlong *)(param_2 + 0x10) + 8 + uVar4)) &&
         ((*(byte *)(*(longlong *)(*(longlong *)(param_2 + 0x10) + uVar4) + 9) & 3) != 0)) {
        FUN_140409730(param_1);
      }
      uVar4 = uVar4 + 0x10;
      uVar6 = (ulonglong)(iVar7 + 1U);
    } while ((int)(iVar7 + 1U) < *(int *)(param_2 + 0x4c));
  }
  uVar4 = uVar5 & 0xffffffff;
  uVar6 = uVar5;
  if ((int)uVar5 < *(int *)(param_2 + 0x48)) {
    do {
      if (*(ulonglong *)(uVar6 + *(longlong *)(param_2 + 0x38)) != uVar5) {
        pbVar1 = (byte *)(*(longlong *)(*(longlong *)(param_2 + 0x38) + uVar6) + 9);
        *pbVar1 = *pbVar1 & 0xfc;
      }
      uVar3 = (int)uVar4 + 1;
      uVar4 = (ulonglong)uVar3;
      uVar6 = uVar6 + 8;
    } while ((int)uVar3 < *(int *)(param_2 + 0x48));
  }
  uVar4 = uVar5 & 0xffffffff;
  uVar6 = uVar5;
  if ((int)uVar5 < *(int *)(param_2 + 0x58)) {
    do {
      iVar7 = (int)uVar4;
      if ((*(ulonglong *)(uVar5 + *(longlong *)(param_2 + 0x20)) != uVar6) &&
         ((*(byte *)(*(longlong *)(uVar5 + *(longlong *)(param_2 + 0x20)) + 9) & 3) != 0)) {
        FUN_140409730(param_1);
      }
      uVar4 = (ulonglong)(iVar7 + 1U);
      uVar5 = uVar5 + 8;
    } while ((int)(iVar7 + 1U) < *(int *)(param_2 + 0x58));
  }
  uVar5 = uVar6;
  if ((int)uVar6 < *(int *)(param_2 + 0x5c)) {
    do {
      if (*(longlong *)(uVar6 + *(longlong *)(param_2 + 0x30)) != 0) {
        lVar2 = *(longlong *)(*(longlong *)(param_2 + 0x30) + uVar6);
        *(byte *)(lVar2 + 9) = *(byte *)(lVar2 + 9) & 0xfc;
      }
      uVar3 = (int)uVar5 + 1;
      uVar6 = uVar6 + 0x10;
      uVar5 = (ulonglong)uVar3;
    } while ((int)uVar3 < *(int *)(param_2 + 0x5c));
  }
  return;
}



void FUN_140409c40(undefined8 param_1,longlong param_2)

{
  int iVar1;
  longlong *plVar2;
  
  if ((*(byte *)(*(longlong *)(param_2 + 0x18) + 9) & 3) != 0) {
    FUN_140409730();
  }
  if (*(char *)(param_2 + 10) == '\0') {
    if ((*(byte *)(*(longlong *)(param_2 + 0x20) + 9) & 3) != 0) {
      FUN_140409730(param_1);
    }
    iVar1 = 0;
    if (*(char *)(param_2 + 0xb) != '\0') {
      plVar2 = (longlong *)(param_2 + 0x28);
      do {
        if ((*(byte *)(*plVar2 + 9) & 3) != 0) {
          FUN_140409730(param_1);
        }
        iVar1 = iVar1 + 1;
        plVar2 = plVar2 + 1;
      } while (iVar1 < (int)(uint)*(byte *)(param_2 + 0xb));
    }
  }
  else {
    iVar1 = 0;
    if (*(char *)(param_2 + 0xb) != '\0') {
      plVar2 = (longlong *)(param_2 + 0x28);
      do {
        if ((3 < (int)plVar2[1]) && ((*(byte *)(*plVar2 + 9) & 3) != 0)) {
          FUN_140409730(param_1);
        }
        iVar1 = iVar1 + 1;
        plVar2 = plVar2 + 2;
      } while (iVar1 < (int)(uint)*(byte *)(param_2 + 0xb));
      return;
    }
  }
  return;
}



void FUN_140409cf0(undefined8 param_1,longlong param_2)

{
  int iVar1;
  longlong lVar2;
  ulonglong uVar3;
  longlong *plVar4;
  longlong *plVar5;
  
  if ((3 < *(int *)(param_2 + 0x80)) && ((*(byte *)(*(longlong *)(param_2 + 0x78) + 9) & 3) != 0)) {
    FUN_140409730();
  }
  plVar4 = *(longlong **)(param_2 + 0x10);
  for (uVar3 = *(ulonglong *)(param_2 + 0x50); uVar3 <= *(ulonglong *)(param_2 + 0x28);
      uVar3 = uVar3 + 0x28) {
    if (plVar4 < *(longlong **)(uVar3 + 0x10)) {
      plVar4 = *(longlong **)(uVar3 + 0x10);
    }
  }
  plVar5 = *(longlong **)(param_2 + 0x40);
  if (plVar5 < *(longlong **)(param_2 + 0x10)) {
    do {
      if ((3 < (int)plVar5[1]) && ((*(byte *)(*plVar5 + 9) & 3) != 0)) {
        FUN_140409730(param_1);
      }
      plVar5 = plVar5 + 2;
    } while (plVar5 < *(longlong **)(param_2 + 0x10));
  }
  for (; plVar5 <= plVar4; plVar5 = plVar5 + 2) {
    *(undefined4 *)(plVar5 + 1) = 0;
  }
  lVar2 = *(longlong *)(param_2 + 0x40);
  iVar1 = *(int *)(param_2 + 0x5c);
  if (iVar1 < 0x4e21) {
    if (((int)((*(longlong *)(param_2 + 0x28) - *(longlong *)(param_2 + 0x50)) / 0x28) * 4 < iVar1)
       && (0x10 < iVar1)) {
      FUN_140405a30(param_2,iVar1 / 2);
    }
    iVar1 = *(int *)(param_2 + 0x58);
    if (((int)((longlong)plVar4 - lVar2 >> 4) * 4 < iVar1) && (0x5a < iVar1)) {
      FUN_1404059a0(param_2,iVar1 / 2);
    }
  }
  return;
}



longlong FUN_140409e20(longlong param_1)

{
  char cVar1;
  longlong lVar2;
  int iVar3;
  
  lVar2 = *(longlong *)(param_1 + 0x38);
  cVar1 = *(char *)(lVar2 + 8);
  *(byte *)(lVar2 + 9) = *(byte *)(lVar2 + 9) | 4;
  if (cVar1 == '\x05') {
    *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(lVar2 + 0x30);
    iVar3 = FUN_140409960(param_1,lVar2);
    if (iVar3 != 0) {
      *(byte *)(lVar2 + 9) = *(byte *)(lVar2 + 9) & 0xfb;
    }
    return ((longlong)*(int *)(lVar2 + 0x38) + 4) * 0x10 +
           (longlong)(1 << (*(byte *)(lVar2 + 0xb) & 0x1f)) * 0x28;
  }
  if (cVar1 == '\x06') {
    *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(lVar2 + 0x10);
    FUN_140409c40(param_1,lVar2);
    if (*(char *)(lVar2 + 10) != '\0') {
      return (longlong)(int)((uint)*(byte *)(lVar2 + 0xb) * 0x10 + 0x28);
    }
    return (longlong)(int)((uint)*(byte *)(lVar2 + 0xb) * 8 + 0x28);
  }
  if (cVar1 == '\b') {
    *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(lVar2 + 0xa0);
    *(undefined8 *)(lVar2 + 0xa0) = *(undefined8 *)(param_1 + 0x40);
    *(longlong *)(param_1 + 0x40) = lVar2;
    *(byte *)(lVar2 + 9) = *(byte *)(lVar2 + 9) & 0xfb;
    FUN_140409cf0(param_1,lVar2);
    return (longlong)*(int *)(lVar2 + 0x58) * 0x10 + 0xb8 + (longlong)*(int *)(lVar2 + 0x5c) * 0x28;
  }
  if (cVar1 != '\t') {
    return 0;
  }
  *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(lVar2 + 0x68);
  FUN_140409b40(param_1,lVar2);
  return ((longlong)*(int *)(lVar2 + 0x54) + 0x1e +
          ((longlong)*(int *)(lVar2 + 0x58) +
           ((longlong)*(int *)(lVar2 + 0x5c) + (longlong)*(int *)(lVar2 + 0x4c)) * 2 +
          (longlong)*(int *)(lVar2 + 0x48)) * 2 + (longlong)*(int *)(lVar2 + 0x50)) * 4;
}



longlong FUN_140409f60(longlong param_1)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  longlong lVar4;
  
  lVar4 = 0;
  lVar3 = *(longlong *)(param_1 + 0x38);
  while (lVar3 != 0) {
    lVar3 = *(longlong *)(param_1 + 0x38);
    cVar1 = *(char *)(lVar3 + 8);
    *(byte *)(lVar3 + 9) = *(byte *)(lVar3 + 9) | 4;
    if (cVar1 == '\x05') {
      *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(lVar3 + 0x30);
      iVar2 = FUN_140409960(param_1,lVar3);
      if (iVar2 != 0) {
        *(byte *)(lVar3 + 9) = *(byte *)(lVar3 + 9) & 0xfb;
      }
      lVar3 = ((longlong)*(int *)(lVar3 + 0x38) + 4) * 0x10 +
              (longlong)(1 << (*(byte *)(lVar3 + 0xb) & 0x1f)) * 0x28;
    }
    else if (cVar1 == '\x06') {
      *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(lVar3 + 0x10);
      FUN_140409c40(param_1,lVar3);
      if (*(char *)(lVar3 + 10) == '\0') {
        lVar3 = (longlong)(int)((uint)*(byte *)(lVar3 + 0xb) * 8 + 0x28);
      }
      else {
        lVar3 = (longlong)(int)((uint)*(byte *)(lVar3 + 0xb) * 0x10 + 0x28);
      }
    }
    else if (cVar1 == '\b') {
      *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(lVar3 + 0xa0);
      *(undefined8 *)(lVar3 + 0xa0) = *(undefined8 *)(param_1 + 0x40);
      *(longlong *)(param_1 + 0x40) = lVar3;
      *(byte *)(lVar3 + 9) = *(byte *)(lVar3 + 9) & 0xfb;
      FUN_140409cf0(param_1,lVar3);
      lVar3 = (longlong)*(int *)(lVar3 + 0x58) * 0x10 + 0xb8 +
              (longlong)*(int *)(lVar3 + 0x5c) * 0x28;
    }
    else if (cVar1 == '\t') {
      *(undefined8 *)(param_1 + 0x38) = *(undefined8 *)(lVar3 + 0x68);
      FUN_140409b40(param_1,lVar3);
      lVar3 = ((longlong)*(int *)(lVar3 + 0x54) + 0x1e +
               ((longlong)*(int *)(lVar3 + 0x58) +
                ((longlong)*(int *)(lVar3 + 0x5c) + (longlong)*(int *)(lVar3 + 0x4c)) * 2 +
               (longlong)*(int *)(lVar3 + 0x48)) * 2 + (longlong)*(int *)(lVar3 + 0x50)) * 4;
    }
    else {
      lVar3 = 0;
    }
    lVar4 = lVar4 + lVar3;
    lVar3 = *(longlong *)(param_1 + 0x38);
  }
  return lVar4;
}



void FUN_14040a0d0(longlong param_1)

{
  byte *pbVar1;
  byte bVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  
  do {
    if (param_1 == 0) {
      return;
    }
    if (((*(byte *)(param_1 + 9) & 0x10) != 0) &&
       (lVar7 = (longlong)*(int *)(param_1 + 0x38), lVar7 != 0)) {
      lVar6 = lVar7 << 4;
      do {
        lVar3 = *(longlong *)(param_1 + 0x18);
        lVar7 = lVar7 + -1;
        iVar5 = *(int *)(lVar6 + -8 + lVar3);
        if (3 < iVar5) {
          lVar4 = *(longlong *)(lVar6 + -0x10 + lVar3);
          if (iVar5 == 4) {
            pbVar1 = (byte *)(lVar4 + 9);
            *pbVar1 = *pbVar1 & 0xfc;
          }
          else {
            bVar2 = *(byte *)(lVar4 + 9);
            if (((bVar2 & 3) != 0) || ((iVar5 == 7 && ((bVar2 & 8) != 0)))) {
              *(undefined4 *)(lVar6 + -8 + lVar3) = 0;
            }
          }
        }
        lVar6 = lVar6 + -0x10;
      } while (lVar7 != 0);
    }
    iVar5 = 1 << (*(byte *)(param_1 + 0xb) & 0x1f);
    lVar7 = (longlong)iVar5;
    if (iVar5 != 0) {
      lVar6 = lVar7 * 0x28;
      do {
        lVar3 = *(longlong *)(param_1 + 0x20);
        lVar7 = lVar7 + -1;
        if (*(int *)(lVar6 + -0x20 + lVar3) != 0) {
          iVar5 = *(int *)(lVar6 + -0x10 + lVar3);
          if (iVar5 < 4) {
LAB_14040a19d:
            iVar5 = *(int *)(lVar6 + -0x20 + lVar3);
            if (3 < iVar5) {
              lVar4 = *(longlong *)(lVar6 + -0x28 + lVar3);
              if (iVar5 == 4) {
                pbVar1 = (byte *)(lVar4 + 9);
                *pbVar1 = *pbVar1 & 0xfc;
              }
              else {
                bVar2 = *(byte *)(lVar4 + 9);
                if (((bVar2 & 3) != 0) || ((iVar5 == 7 && ((bVar2 & 8) != 0)))) goto LAB_14040a1cb;
              }
            }
          }
          else {
            lVar4 = *(longlong *)(lVar6 + -0x18 + lVar3);
            if (iVar5 == 4) {
              pbVar1 = (byte *)(lVar4 + 9);
              *pbVar1 = *pbVar1 & 0xfc;
              goto LAB_14040a19d;
            }
            if ((*(byte *)(lVar4 + 9) & 3) == 0) goto LAB_14040a19d;
LAB_14040a1cb:
            iVar5 = *(int *)(lVar6 + -0x10 + lVar3);
            *(undefined4 *)(lVar6 + -0x20 + lVar3) = 0;
            if (3 < iVar5) {
              iVar5 = 0xb;
            }
            *(int *)(lVar6 + -0x10 + lVar3) = iVar5;
          }
        }
        lVar6 = lVar6 + -0x28;
      } while (lVar7 != 0);
    }
    param_1 = *(longlong *)(param_1 + 0x30);
  } while( true );
}



undefined8 * FUN_14040a200(longlong param_1,undefined8 *param_2,longlong param_3)

{
  int *piVar1;
  byte bVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong lVar5;
  
  lVar3 = *(longlong *)(param_1 + 0x20);
  puVar4 = (undefined8 *)*param_2;
  bVar2 = *(byte *)(lVar3 + 0x20);
  do {
    if ((puVar4 == (undefined8 *)0x0) || (param_3 == 0)) {
      return param_2;
    }
    if (*(char *)(puVar4 + 1) == '\b') {
      FUN_14040a200(param_1,puVar4 + 0x13,0xfffffffffffffffd);
    }
    if ((byte)((bVar2 ^ 3) & (*(byte *)((longlong)puVar4 + 9) ^ 3)) != 0) {
      *(byte *)((longlong)puVar4 + 9) =
           *(byte *)(lVar3 + 0x20) & 3 | *(byte *)((longlong)puVar4 + 9) & 0xf8;
      param_2 = puVar4;
      goto switchD_14040a2c8_default;
    }
    *param_2 = *puVar4;
    if (puVar4 == *(undefined8 **)(lVar3 + 0x28)) {
      *(undefined8 *)(lVar3 + 0x28) = *puVar4;
    }
    switch(*(undefined1 *)(puVar4 + 1)) {
    case 4:
      piVar1 = (int *)(*(longlong *)(param_1 + 0x20) + 8);
      *piVar1 = *piVar1 + -1;
      lVar5 = puVar4[2] + 0x19;
      goto LAB_14040a324;
    case 5:
      FUN_140408af0(param_1,puVar4);
      break;
    case 6:
      FUN_14040b240(param_1,puVar4);
      break;
    case 7:
      lVar5 = puVar4[4] + 0x28;
LAB_14040a324:
      FUN_1404069e0(param_1,puVar4,lVar5,0);
      break;
    case 8:
      FUN_140402e00(param_1,puVar4);
      break;
    case 9:
      FUN_14040b180(param_1,puVar4);
      break;
    case 10:
      FUN_14040afe0(param_1,puVar4);
    }
switchD_14040a2c8_default:
    puVar4 = (undefined8 *)*param_2;
    param_3 = param_3 + -1;
  } while( true );
}



void FUN_14040a380(longlong param_1)

{
  int iVar1;
  longlong lVar2;
  ulonglong uVar3;
  undefined8 uVar4;
  ulonglong uVar5;
  
  lVar2 = *(longlong *)(param_1 + 0x20);
  iVar1 = *(int *)(lVar2 + 0xc);
  if ((*(uint *)(lVar2 + 8) < (uint)((int)(iVar1 + (iVar1 >> 0x1f & 3U)) >> 2)) && (0x40 < iVar1)) {
    FUN_140406b40(param_1,iVar1 / 2);
  }
  uVar3 = *(ulonglong *)(lVar2 + 0x68);
  if (0x40 < uVar3) {
    uVar5 = uVar3 >> 1;
    if (uVar5 + 1 < 0xfffffffffffffffe) {
      uVar4 = FUN_1404069e0(param_1,*(undefined8 *)(lVar2 + 0x58),uVar3,uVar5);
    }
    else {
      uVar4 = FUN_1404069c0(param_1);
    }
    *(ulonglong *)(lVar2 + 0x68) = uVar5;
    *(undefined8 *)(lVar2 + 0x58) = uVar4;
  }
  return;
}



void FUN_14040a410(longlong param_1)

{
  undefined1 uVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined8 *puVar7;
  undefined8 *puVar8;
  
  lVar2 = *(longlong *)(param_1 + 0x20);
  plVar3 = *(longlong **)(lVar2 + 0x50);
  plVar4 = (longlong *)*plVar3;
  if (plVar4 == plVar3) {
    *(undefined8 *)(lVar2 + 0x50) = 0;
  }
  else {
    *plVar3 = *plVar4;
  }
  *plVar4 = **(undefined8 **)(lVar2 + 0xb0);
  **(longlong **)(lVar2 + 0xb0) = (longlong)plVar4;
  *(byte *)((longlong)plVar4 + 9) =
       *(byte *)(lVar2 + 0x20) & 3 | *(byte *)((longlong)plVar4 + 9) & 0xf8;
  lVar5 = plVar4[2];
  if ((lVar5 != 0) && ((*(byte *)(lVar5 + 10) & 4) == 0)) {
    puVar8 = (undefined8 *)
             FUN_140408530(lVar5,2,*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x138));
    if (puVar8 != (undefined8 *)0x0) {
      uVar6 = *(undefined8 *)(lVar2 + 0x70);
      uVar1 = *(undefined1 *)(param_1 + 0x65);
      *(undefined1 *)(param_1 + 0x65) = 0;
      *(longlong *)(lVar2 + 0x70) = *(longlong *)(lVar2 + 0x78) * 2;
      puVar7 = *(undefined8 **)(param_1 + 0x10);
      *puVar7 = *puVar8;
      *(undefined4 *)(puVar7 + 1) = *(undefined4 *)(puVar8 + 1);
      lVar5 = *(longlong *)(param_1 + 0x10);
      *(longlong **)(lVar5 + 0x10) = plVar4;
      *(undefined4 *)(lVar5 + 0x18) = 7;
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x20;
      FUN_140406660(param_1,*(longlong *)(param_1 + 0x10) + -0x20,0);
      *(undefined1 *)(param_1 + 0x65) = uVar1;
      *(undefined8 *)(lVar2 + 0x70) = uVar6;
    }
  }
  return;
}



void FUN_14040a530(longlong param_1)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong lVar4;
  
  plVar3 = (longlong *)(param_1 + 0xe0);
  lVar4 = 9;
  do {
    lVar2 = *plVar3;
    if ((lVar2 == 0) || ((*(byte *)(lVar2 + 9) & 3) == 0)) goto switchD_14040a58e_caseD_4;
    *(byte *)(lVar2 + 9) = *(byte *)(lVar2 + 9) & 0xfc;
    switch(*(undefined1 *)(lVar2 + 8)) {
    default:
      goto switchD_14040a58e_caseD_4;
    case 5:
      *(undefined8 *)(lVar2 + 0x30) = *(undefined8 *)(param_1 + 0x38);
      break;
    case 6:
      *(undefined8 *)(lVar2 + 0x10) = *(undefined8 *)(param_1 + 0x38);
      break;
    case 7:
      lVar1 = *(longlong *)(lVar2 + 0x10);
      *(byte *)(lVar2 + 9) = *(byte *)(lVar2 + 9) | 4;
      if ((lVar1 != 0) && ((*(byte *)(lVar1 + 9) & 3) != 0)) {
        FUN_140409730(param_1,lVar1);
      }
      if ((*(byte *)(*(longlong *)(lVar2 + 0x18) + 9) & 3) != 0) {
        FUN_140409730(param_1);
      }
      goto switchD_14040a58e_caseD_4;
    case 8:
      *(undefined8 *)(lVar2 + 0xa0) = *(undefined8 *)(param_1 + 0x38);
      break;
    case 9:
      *(undefined8 *)(lVar2 + 0x68) = *(undefined8 *)(param_1 + 0x38);
      break;
    case 10:
      if ((3 < (int)(*(longlong **)(lVar2 + 0x10))[1]) &&
         ((*(byte *)(**(longlong **)(lVar2 + 0x10) + 9) & 3) != 0)) {
        FUN_140409730(param_1);
      }
      if (*(longlong *)(lVar2 + 0x10) == lVar2 + 0x18) {
        *(byte *)(lVar2 + 9) = *(byte *)(lVar2 + 9) | 4;
      }
      goto switchD_14040a58e_caseD_4;
    }
    *(longlong *)(param_1 + 0x38) = lVar2;
switchD_14040a58e_caseD_4:
    plVar3 = plVar3 + 1;
    lVar4 = lVar4 + -1;
    if (lVar4 == 0) {
      return;
    }
  } while( true );
}



void FUN_14040a650(longlong param_1)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x20);
  *(undefined8 *)(lVar1 + 0x38) = 0;
  *(undefined8 *)(lVar1 + 0x40) = 0;
  *(undefined8 *)(lVar1 + 0x48) = 0;
  if ((*(byte *)(*(longlong *)(lVar1 + 0xb0) + 9) & 3) != 0) {
    FUN_140409730(lVar1);
  }
  if ((3 < *(int *)(*(longlong *)(lVar1 + 0xb0) + 0x80)) &&
     ((*(byte *)(*(longlong *)(*(longlong *)(lVar1 + 0xb0) + 0x78) + 9) & 3) != 0)) {
    FUN_140409730(lVar1);
  }
  if ((3 < *(int *)(*(longlong *)(param_1 + 0x20) + 0xa8)) &&
     ((*(byte *)(*(longlong *)(*(longlong *)(param_1 + 0x20) + 0xa0) + 9) & 3) != 0)) {
    FUN_140409730(lVar1);
  }
  FUN_14040a530(lVar1);
  *(undefined1 *)(lVar1 + 0x21) = 1;
  return;
}



void FUN_14040a6e0(longlong param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined8 *puVar3;
  longlong lVar4;
  longlong lVar5;
  undefined8 *puVar6;
  longlong lVar7;
  
  lVar1 = *(longlong *)(param_1 + 0x20);
  lVar5 = *(longlong *)(lVar1 + 0xd8);
  lVar7 = lVar1 + 0xb8;
  if (lVar5 != lVar7) {
    do {
      if (((((*(byte *)(lVar5 + 9) & 4) == 0) && ((*(byte *)(lVar5 + 9) & 3) == 0)) &&
          (3 < (int)(*(longlong **)(lVar5 + 0x10))[1])) &&
         ((*(byte *)(**(longlong **)(lVar5 + 0x10) + 9) & 3) != 0)) {
        FUN_140409730(lVar1);
      }
      lVar5 = *(longlong *)(lVar5 + 0x20);
    } while (lVar5 != lVar7);
  }
  FUN_140409f60(lVar1);
  uVar2 = *(undefined8 *)(lVar1 + 0x48);
  *(undefined8 *)(lVar1 + 0x48) = 0;
  *(undefined8 *)(lVar1 + 0x38) = uVar2;
  if ((*(byte *)(param_1 + 9) & 3) != 0) {
    FUN_140409730(lVar1,param_1);
  }
  FUN_14040a530(lVar1);
  FUN_140409f60(lVar1);
  *(undefined8 *)(lVar1 + 0x38) = *(undefined8 *)(lVar1 + 0x40);
  *(undefined8 *)(lVar1 + 0x40) = 0;
  FUN_140409f60(lVar1);
  lVar5 = *(longlong *)(param_1 + 0x20);
  lVar7 = 0;
  puVar3 = *(undefined8 **)(lVar5 + 0xb0);
  for (puVar6 = (undefined8 *)**(undefined8 **)(lVar5 + 0xb0); puVar6 != (undefined8 *)0x0;
      puVar6 = (undefined8 *)*puVar6) {
    if (((*(byte *)((longlong)puVar6 + 9) & 3) != 0) && ((*(byte *)((longlong)puVar6 + 9) & 8) == 0)
       ) {
      lVar4 = puVar6[2];
      if ((lVar4 == 0) ||
         (((*(byte *)(lVar4 + 10) & 4) != 0 ||
          (lVar4 = FUN_140408530(lVar4,2,*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x138)),
          lVar4 == 0)))) {
        *(byte *)((longlong)puVar6 + 9) = *(byte *)((longlong)puVar6 + 9) | 8;
      }
      else {
        *(byte *)((longlong)puVar6 + 9) = *(byte *)((longlong)puVar6 + 9) | 8;
        lVar7 = lVar7 + 0x28 + puVar6[4];
        *puVar3 = *puVar6;
        if (*(undefined8 **)(lVar5 + 0x50) == (undefined8 *)0x0) {
          *puVar6 = puVar6;
          *(undefined8 **)(lVar5 + 0x50) = puVar6;
          puVar6 = puVar3;
        }
        else {
          *puVar6 = **(undefined8 **)(lVar5 + 0x50);
          **(undefined8 **)(lVar5 + 0x50) = puVar6;
          *(undefined8 **)(lVar5 + 0x50) = puVar6;
          puVar6 = puVar3;
        }
      }
    }
    puVar3 = puVar6;
  }
  FUN_140409850(lVar1);
  lVar5 = FUN_140409f60(lVar1);
  FUN_14040a0d0(*(undefined8 *)(lVar1 + 0x48));
  *(byte *)(lVar1 + 0x20) = *(byte *)(lVar1 + 0x20) ^ 3;
  *(longlong *)(lVar1 + 0x30) = lVar1 + 0x28;
  *(undefined4 *)(lVar1 + 0x24) = 0;
  *(undefined1 *)(lVar1 + 0x21) = 2;
  *(longlong *)(lVar1 + 0x80) = *(longlong *)(lVar1 + 0x78) - (lVar7 + lVar5);
  return;
}



undefined8 FUN_14040a890(longlong param_1)

{
  char cVar1;
  int iVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  
  plVar3 = *(longlong **)(param_1 + 0x20);
  cVar1 = *(char *)((longlong)plVar3 + 0x21);
  if (cVar1 == '\0') {
    FUN_14040a650();
    return 0;
  }
  if (cVar1 == '\x01') {
    if (plVar3[7] != 0) {
      uVar6 = FUN_140409e20(plVar3);
      return uVar6;
    }
    FUN_14040a6e0();
    return 0;
  }
  if (cVar1 == '\x02') {
    iVar2 = *(int *)((longlong)plVar3 + 0x24);
    lVar4 = plVar3[0xf];
    *(int *)((longlong)plVar3 + 0x24) = iVar2 + 1;
    FUN_14040a200(param_1,*plVar3 + (longlong)iVar2 * 8,0xfffffffffffffffd);
    if (*(int *)((longlong)plVar3 + 0xc) <= *(int *)((longlong)plVar3 + 0x24)) {
      *(undefined1 *)((longlong)plVar3 + 0x21) = 3;
    }
    plVar3[0x10] = plVar3[0x10] + (plVar3[0xf] - lVar4);
    return 10;
  }
  if (cVar1 != '\x03') {
    if (cVar1 == '\x04') {
      if (plVar3[10] != 0) {
        FUN_14040a410();
        if (100 < (ulonglong)plVar3[0x10]) {
          plVar3[0x10] = plVar3[0x10] - 100;
        }
        return 100;
      }
      *(undefined1 *)((longlong)plVar3 + 0x21) = 0;
      plVar3[0x11] = 0;
    }
    return 0;
  }
  lVar4 = plVar3[0xf];
  plVar5 = (longlong *)FUN_14040a200(param_1,plVar3[6],0x28);
  plVar3[6] = (longlong)plVar5;
  if (*plVar5 == 0) {
    FUN_14040a380(param_1);
    *(undefined1 *)((longlong)plVar3 + 0x21) = 4;
  }
  plVar3[0x10] = plVar3[0x10] + (plVar3[0xf] - lVar4);
  return 400;
}



void FUN_14040aa00(longlong param_1)

{
  char cVar1;
  int iVar2;
  longlong lVar3;
  longlong *plVar4;
  undefined1 auVar5 [16];
  uint uVar6;
  longlong *plVar7;
  longlong lVar8;
  longlong lVar9;
  ulonglong uVar10;
  
  lVar3 = *(longlong *)(param_1 + 0x20);
  uVar6 = *(int *)(lVar3 + 0x94) * 10;
  uVar10 = (ulonglong)uVar6;
  if (uVar6 == 0) {
    uVar10 = 0x7ffffffffffffffe;
  }
  *(longlong *)(lVar3 + 0x88) =
       *(longlong *)(lVar3 + 0x88) + (*(longlong *)(lVar3 + 0x78) - *(longlong *)(lVar3 + 0x70));
  lVar9 = 0;
  do {
    plVar4 = *(longlong **)(param_1 + 0x20);
    cVar1 = *(char *)((longlong)plVar4 + 0x21);
    lVar8 = lVar9;
    if (cVar1 == '\0') {
      FUN_14040a650(param_1);
    }
    else if (cVar1 == '\x01') {
      if (plVar4[7] == 0) {
        FUN_14040a6e0(param_1);
      }
      else {
        lVar8 = FUN_140409e20(plVar4);
      }
    }
    else if (cVar1 == '\x02') {
      iVar2 = *(int *)((longlong)plVar4 + 0x24);
      lVar8 = plVar4[0xf];
      *(int *)((longlong)plVar4 + 0x24) = iVar2 + 1;
      FUN_14040a200(param_1,*plVar4 + (longlong)iVar2 * 8,0xfffffffffffffffd);
      if (*(int *)((longlong)plVar4 + 0xc) <= *(int *)((longlong)plVar4 + 0x24)) {
        *(undefined1 *)((longlong)plVar4 + 0x21) = 3;
      }
      plVar4[0x10] = plVar4[0x10] + (plVar4[0xf] - lVar8);
      lVar8 = 10;
    }
    else if (cVar1 == '\x03') {
      lVar8 = plVar4[0xf];
      plVar7 = (longlong *)FUN_14040a200(param_1,plVar4[6],0x28);
      plVar4[6] = (longlong)plVar7;
      if (*plVar7 == 0) {
        FUN_14040a380(param_1);
        *(undefined1 *)((longlong)plVar4 + 0x21) = 4;
      }
      plVar4[0x10] = plVar4[0x10] + (plVar4[0xf] - lVar8);
      lVar8 = 400;
    }
    else if (cVar1 == '\x04') {
      if (plVar4[10] == 0) {
        *(undefined1 *)((longlong)plVar4 + 0x21) = 0;
        plVar4[0x11] = 0;
      }
      else {
        FUN_14040a410(param_1);
        if (100 < (ulonglong)plVar4[0x10]) {
          plVar4[0x10] = plVar4[0x10] - 100;
        }
        lVar8 = 100;
      }
    }
    uVar10 = uVar10 - lVar8;
  } while ((*(char *)(lVar3 + 0x21) != '\0') && (0 < (longlong)uVar10));
  if (*(char *)(lVar3 + 0x21) != '\0') {
    if (0x3ff < *(ulonglong *)(lVar3 + 0x88)) {
      *(ulonglong *)(lVar3 + 0x88) = *(ulonglong *)(lVar3 + 0x88) - 0x400;
      *(undefined8 *)(lVar3 + 0x70) = *(undefined8 *)(lVar3 + 0x78);
      return;
    }
    *(longlong *)(lVar3 + 0x70) = *(longlong *)(lVar3 + 0x78) + 0x400;
    return;
  }
  auVar5._8_8_ = 0;
  auVar5._0_8_ = *(ulonglong *)(lVar3 + 0x80);
  lVar9 = SUB168(ZEXT816(0x47ae147ae147ae15) * auVar5,8);
  *(ulonglong *)(lVar3 + 0x70) =
       ((*(ulonglong *)(lVar3 + 0x80) - lVar9 >> 1) + lVar9 >> 6) * (longlong)*(int *)(lVar3 + 0x90)
  ;
  return;
}



void FUN_14040ac20(longlong param_1)

{
  char cVar1;
  longlong lVar2;
  undefined1 auVar3 [16];
  longlong lVar4;
  
  lVar2 = *(longlong *)(param_1 + 0x20);
  if (*(byte *)(lVar2 + 0x21) < 2) {
    *(undefined1 *)(lVar2 + 0x21) = 2;
    *(longlong *)(lVar2 + 0x30) = lVar2 + 0x28;
    *(undefined4 *)(lVar2 + 0x24) = 0;
    *(undefined8 *)(lVar2 + 0x38) = 0;
    *(undefined8 *)(lVar2 + 0x40) = 0;
    *(undefined8 *)(lVar2 + 0x48) = 0;
  }
  cVar1 = *(char *)(lVar2 + 0x21);
  while (cVar1 != '\x04') {
    FUN_14040a890(param_1);
    cVar1 = *(char *)(lVar2 + 0x21);
  }
  FUN_14040a650(param_1);
  cVar1 = *(char *)(lVar2 + 0x21);
  while (cVar1 != '\0') {
    FUN_14040a890(param_1);
    cVar1 = *(char *)(lVar2 + 0x21);
  }
  auVar3._8_8_ = 0;
  auVar3._0_8_ = *(ulonglong *)(lVar2 + 0x80);
  lVar4 = SUB168(ZEXT816(0x47ae147ae147ae15) * auVar3,8);
  *(ulonglong *)(lVar2 + 0x70) =
       ((*(ulonglong *)(lVar2 + 0x80) - lVar4 >> 1) + lVar4 >> 6) * (longlong)*(int *)(lVar2 + 0x90)
  ;
  return;
}



void FUN_14040acd0(longlong param_1,longlong param_2,undefined8 param_3)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x20);
  if (*(char *)(lVar1 + 0x21) == '\x01') {
    FUN_140409730(lVar1,param_3);
    return;
  }
  *(byte *)(param_2 + 9) = *(byte *)(lVar1 + 0x20) & 3 | *(byte *)(param_2 + 9) & 0xf8;
  return;
}



void FUN_14040ad00(longlong param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_1 + 0x20);
  *(byte *)(param_2 + 9) = *(byte *)(param_2 + 9) & 0xfb;
  *(undefined8 *)(param_2 + 0x30) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = param_2;
  return;
}



void FUN_14040ad20(longlong param_1,undefined8 *param_2,undefined1 param_3)

{
  byte bVar1;
  longlong lVar2;
  
  lVar2 = *(longlong *)(param_1 + 0x20);
  *param_2 = *(undefined8 *)(lVar2 + 0x28);
  bVar1 = *(byte *)(lVar2 + 0x20);
  *(undefined8 **)(lVar2 + 0x28) = param_2;
  *(undefined1 *)(param_2 + 1) = param_3;
  *(byte *)((longlong)param_2 + 9) = bVar1 & 3;
  return;
}



void FUN_14040ad40(longlong param_1,undefined8 *param_2)

{
  byte bVar1;
  longlong lVar2;
  longlong lVar3;
  
  lVar2 = *(longlong *)(param_1 + 0x20);
  *param_2 = *(undefined8 *)(lVar2 + 0x28);
  *(undefined8 **)(lVar2 + 0x28) = param_2;
  bVar1 = *(byte *)((longlong)param_2 + 9);
  if (((bVar1 & 4) == 0) && ((bVar1 & 3) == 0)) {
    if (*(char *)(lVar2 + 0x21) == '\x01') {
      *(byte *)((longlong)param_2 + 9) = bVar1 | 4;
      if ((3 < (int)((longlong *)param_2[2])[1]) &&
         (lVar2 = *(longlong *)param_2[2], (*(byte *)(lVar2 + 9) & 3) != 0)) {
        lVar3 = *(longlong *)(param_1 + 0x20);
        if (*(char *)(lVar3 + 0x21) != '\x01') {
          *(byte *)((longlong)param_2 + 9) = *(byte *)(lVar3 + 0x20) & 3 | bVar1 & 0xf8;
          return;
        }
        FUN_140409730(lVar3,lVar2);
        return;
      }
    }
    else {
      *(byte *)((longlong)param_2 + 9) = *(byte *)(lVar2 + 0x20) & 3 | bVar1 & 0xf8;
    }
  }
  return;
}



longlong FUN_14040add0(undefined8 param_1,int param_2,undefined8 param_3)

{
  longlong lVar1;
  
  lVar1 = FUN_1404069e0(param_1,0,0,(longlong)(param_2 * 0x10 + 0x28));
  FUN_14040ad20(param_1,lVar1,6);
  *(undefined8 *)(lVar1 + 0x18) = param_3;
  *(char *)(lVar1 + 0xb) = (char)param_2;
  *(undefined1 *)(lVar1 + 10) = 1;
  return lVar1;
}



longlong FUN_14040ae40(undefined8 param_1,int param_2,undefined8 param_3)

{
  longlong lVar1;
  
  lVar1 = FUN_1404069e0(param_1,0,0,(longlong)(param_2 * 8 + 0x28));
  FUN_14040ad20(param_1,lVar1,6);
  *(undefined1 *)(lVar1 + 10) = 0;
  *(undefined8 *)(lVar1 + 0x18) = param_3;
  *(char *)(lVar1 + 0xb) = (char)param_2;
  while (param_2 != 0) {
    param_2 = param_2 + -1;
    *(undefined8 *)(lVar1 + 0x28 + (longlong)param_2 * 8) = 0;
  }
  return lVar1;
}



longlong FUN_14040aec0(undefined8 param_1)

{
  longlong lVar1;
  
  lVar1 = FUN_1404069e0(param_1,0,0,0x28);
  FUN_14040ad20(param_1,lVar1,10);
  *(longlong *)(lVar1 + 0x10) = lVar1 + 0x18;
  *(undefined4 *)(lVar1 + 0x20) = 0;
  return lVar1;
}



void FUN_14040af10(longlong param_1,ulonglong param_2)

{
  byte bVar1;
  longlong lVar2;
  longlong lVar3;
  longlong *plVar4;
  longlong *plVar5;
  
  lVar2 = *(longlong *)(param_1 + 0x20);
  lVar3 = *(longlong *)(param_1 + 0x98);
  plVar4 = (longlong *)(param_1 + 0x98);
  while (lVar3 != 0) {
    plVar5 = (longlong *)*plVar4;
    if ((ulonglong)plVar5[2] < param_2) break;
    if (plVar5[2] == param_2) {
      if ((~*(byte *)(lVar2 + 0x20) & *(byte *)((longlong)plVar5 + 9) & 3) == 0) {
        return;
      }
      *(byte *)((longlong)plVar5 + 9) = *(byte *)((longlong)plVar5 + 9) ^ 3;
      return;
    }
    plVar4 = plVar5;
    lVar3 = *plVar5;
  }
  plVar5 = (longlong *)FUN_1404069e0(param_1,0,0,0x28);
  *(undefined1 *)(plVar5 + 1) = 10;
  bVar1 = *(byte *)(lVar2 + 0x20);
  plVar5[2] = param_2;
  *(byte *)((longlong)plVar5 + 9) = bVar1 & 3;
  *plVar5 = *plVar4;
  *plVar4 = (longlong)plVar5;
  plVar5[3] = lVar2 + 0xb8;
  lVar3 = *(longlong *)(lVar2 + 0xd8);
  plVar5[4] = lVar3;
  *(longlong **)(lVar3 + 0x18) = plVar5;
  *(longlong **)(lVar2 + 0xd8) = plVar5;
  return;
}



void FUN_14040afe0(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  
  plVar1 = (longlong *)(param_2 + 0x18);
  if (*(longlong **)(param_2 + 0x10) != plVar1) {
    *(longlong *)(*(longlong *)(param_2 + 0x20) + 0x18) = *plVar1;
    *(undefined8 *)(*plVar1 + 0x20) = *(undefined8 *)(param_2 + 0x20);
  }
  FUN_1404069e0(param_1,param_2,0x28);
  return;
}



void FUN_14040b010(longlong param_1,ulonglong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong lVar3;
  undefined8 *puVar4;
  
  lVar2 = *(longlong *)(param_1 + 0x98);
  lVar3 = *(longlong *)(param_1 + 0x20);
  while ((lVar2 != 0 && (puVar4 = *(undefined8 **)(param_1 + 0x98), param_2 <= (ulonglong)puVar4[2])
         )) {
    plVar1 = puVar4 + 3;
    *(undefined8 *)(param_1 + 0x98) = *puVar4;
    if ((~*(byte *)(lVar3 + 0x20) & *(byte *)((longlong)puVar4 + 9) & 3) == 0) {
      *(longlong *)(puVar4[4] + 0x18) = *plVar1;
      *(undefined8 *)(*plVar1 + 0x20) = puVar4[4];
      *plVar1 = *(longlong *)puVar4[2];
      *(int *)(puVar4 + 4) = (int)((longlong *)puVar4[2])[1];
      puVar4[2] = plVar1;
      FUN_14040ad40(param_1,puVar4);
    }
    else {
      if ((longlong *)puVar4[2] != plVar1) {
        *(longlong *)(puVar4[4] + 0x18) = *plVar1;
        *(undefined8 *)(*plVar1 + 0x20) = puVar4[4];
      }
      FUN_1404069e0(param_1,puVar4,0x28);
    }
    lVar2 = *(longlong *)(param_1 + 0x98);
  }
  return;
}



longlong FUN_14040b100(undefined8 param_1)

{
  longlong lVar1;
  
  lVar1 = FUN_1404069e0(param_1,0,0,0x78);
  FUN_14040ad20(param_1,lVar1,9);
  *(undefined8 *)(lVar1 + 0x10) = 0;
  *(undefined8 *)(lVar1 + 0x20) = 0;
  *(undefined8 *)(lVar1 + 0x18) = 0;
  *(undefined8 *)(lVar1 + 0x4c) = 0;
  *(undefined8 *)(lVar1 + 0x54) = 0;
  *(undefined4 *)(lVar1 + 0x48) = 0;
  *(undefined8 *)(lVar1 + 0x38) = 0;
  *(undefined4 *)(lVar1 + 0x70) = 0;
  *(undefined8 *)(lVar1 + 0x28) = 0;
  *(undefined8 *)(lVar1 + 0x30) = 0;
  *(undefined8 *)(lVar1 + 0x5c) = 0;
  *(undefined4 *)(lVar1 + 100) = 0;
  *(undefined8 *)(lVar1 + 0x40) = 0;
  return lVar1;
}



void FUN_14040b180(undefined8 param_1,longlong param_2)

{
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x18),(longlong)*(int *)(param_2 + 0x50) << 2,0);
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x20),(longlong)*(int *)(param_2 + 0x58) << 3,0);
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x10),(longlong)*(int *)(param_2 + 0x4c) << 4,0);
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x28),(longlong)*(int *)(param_2 + 0x54) << 2,0);
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x30),(longlong)*(int *)(param_2 + 0x5c) << 4,0);
  FUN_1404069e0(param_1,*(undefined8 *)(param_2 + 0x38),(longlong)*(int *)(param_2 + 0x48) << 3,0);
  FUN_1404069e0(param_1,param_2,0x78);
  return;
}



void FUN_14040b240(undefined8 param_1,longlong param_2)

{
  if (*(char *)(param_2 + 10) != '\0') {
    FUN_1404069e0(param_1,param_2,(uint)*(byte *)(param_2 + 0xb) * 0x10 + 0x28,0);
    return;
  }
  FUN_1404069e0(param_1,param_2,(uint)*(byte *)(param_2 + 0xb) * 8 + 0x28,0);
  return;
}



longlong FUN_14040b270(longlong param_1,int param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  if (0 < *(int *)(param_1 + 0x5c)) {
    piVar1 = (int *)(*(longlong *)(param_1 + 0x30) + 0xc);
    do {
      if (param_3 < piVar1[-1]) {
        return 0;
      }
      if ((param_3 < *piVar1) && (param_2 = param_2 + -1, param_2 == 0)) {
        return *(longlong *)(*(longlong *)(param_1 + 0x30) + (longlong)iVar2 * 0x10) + 0x18;
      }
      iVar2 = iVar2 + 1;
      piVar1 = piVar1 + 4;
    } while (iVar2 < *(int *)(param_1 + 0x5c));
  }
  return 0;
}



uint FUN_14040b2c0(uint param_1)

{
  int iVar1;
  
  iVar1 = 0;
  for (; 0xf < param_1; param_1 = param_1 + 1 >> 1) {
    iVar1 = iVar1 + 1;
  }
  if (param_1 < 8) {
    return param_1;
  }
  return iVar1 * 8 + 8U | param_1 - 8;
}



uint FUN_14040b2f0(uint param_1)

{
  uint uVar1;
  
  uVar1 = (int)param_1 >> 3 & 0x1f;
  if (uVar1 != 0) {
    param_1 = (param_1 & 7) + 8 << ((char)uVar1 - 1U & 0x1f);
  }
  return param_1;
}



int FUN_14040b310(uint param_1)

{
  int iVar1;
  
  iVar1 = -1;
  for (; 0xff < param_1; param_1 = param_1 >> 8) {
    iVar1 = iVar1 + 8;
  }
  return (uint)(byte)(&DAT_140475330)[param_1] + iVar1;
}



bool FUN_14040b340(double *param_1,double *param_2)

{
  int iVar1;
  
  iVar1 = *(int *)(param_1 + 1);
  if (iVar1 != *(int *)(param_2 + 1)) {
    return false;
  }
  if (iVar1 == 0) {
    return true;
  }
  if (iVar1 == 1) {
    return *(int *)param_1 == *(int *)param_2;
  }
  if ((iVar1 != 2) && (iVar1 == 3)) {
    if (*param_1 != *param_2) {
      return false;
    }
    return true;
  }
  return *param_1 == *param_2;
}



bool FUN_14040b3b0(byte *param_1,double *param_2)

{
  ulong uVar1;
  int iVar2;
  double dVar3;
  byte *local_res8;
  
  dVar3 = strtod((char *)param_1,(char **)&local_res8);
  *param_2 = dVar3;
  if (local_res8 == param_1) {
    return false;
  }
  if ((*local_res8 == 0x78) || (*local_res8 == 0x58)) {
    uVar1 = strtoul((char *)param_1,(char **)&local_res8,0x10);
    *param_2 = (double)uVar1;
  }
  if (*local_res8 != 0) {
    iVar2 = isspace((uint)*local_res8);
    while (iVar2 != 0) {
      local_res8 = local_res8 + 1;
      iVar2 = isspace((uint)*local_res8);
    }
    return *local_res8 == 0;
  }
  return true;
}



void FUN_14040b480(longlong param_1,char *param_2)

{
  char cVar1;
  undefined8 *puVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  char *pcVar5;
  
  puVar2 = *(undefined8 **)(param_1 + 0x10);
  uVar4 = 0xffffffffffffffff;
  pcVar5 = param_2;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
  } while (cVar1 != '\0');
  uVar3 = FUN_140406c30(param_1,param_2,~uVar4 - 1);
  *(undefined4 *)(puVar2 + 1) = 4;
  *puVar2 = uVar3;
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
    FUN_140405ae0(param_1,1);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_14040b4f0(longlong param_1,char *param_2,longlong param_3)

{
  longlong *plVar1;
  char *pcVar2;
  char cVar3;
  int iVar4;
  undefined8 *puVar5;
  undefined8 uVar6;
  char *pcVar7;
  double dVar8;
  ulonglong uVar9;
  char *pcVar10;
  double *pdVar11;
  char *pcVar12;
  longlong lVar13;
  int iVar14;
  undefined1 auStack_98 [32];
  char local_78 [4];
  char local_74;
  char local_73;
  undefined1 local_72;
  char local_70 [40];
  ulonglong local_48;
  
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  puVar5 = *(undefined8 **)(param_1 + 0x10);
  iVar14 = 1;
  uVar6 = FUN_140406c30(param_1,&DAT_14047e238,0);
  *puVar5 = uVar6;
  *(undefined4 *)(puVar5 + 1) = 4;
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
    FUN_140405ae0(param_1,1);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  pcVar7 = strchr(param_2,0x25);
  if (pcVar7 != (char *)0x0) {
    param_3 = param_3 + -8;
    do {
      puVar5 = *(undefined8 **)(param_1 + 0x10);
      uVar6 = FUN_140406c30(param_1,param_2,(longlong)pcVar7 - (longlong)param_2);
      *(undefined4 *)(puVar5 + 1) = 4;
      *puVar5 = uVar6;
      if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
        FUN_140405ae0(param_1,1);
      }
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
      pdVar11 = *(double **)(param_1 + 0x10);
      switch(pcVar7[1]) {
      case '%':
        lVar13 = 1;
        pcVar10 = "%";
        goto LAB_14040b6e3;
      default:
        local_73 = pcVar7[1];
        local_74 = '%';
        local_72 = 0;
        pcVar10 = &local_74;
        pcVar12 = &local_74;
        break;
      case 'c':
        pcVar2 = (char *)(param_3 + 8);
        param_3 = param_3 + 8;
        local_78[1] = 0;
        pcVar12 = local_78;
        pcVar10 = local_78;
        local_78[0] = *pcVar2;
        break;
      case 'd':
        iVar4 = *(int *)(param_3 + 8);
        param_3 = param_3 + 8;
        *(undefined4 *)(pdVar11 + 1) = 3;
        *pdVar11 = (double)iVar4;
        goto LAB_14040b6f5;
      case 'f':
        dVar8 = *(double *)(param_3 + 8);
        param_3 = param_3 + 8;
        *(undefined4 *)(pdVar11 + 1) = 3;
        *pdVar11 = dVar8;
        goto LAB_14040b6f5;
      case 'p':
        param_3 = param_3 + 8;
        sprintf(local_70,"%p");
        pdVar11 = *(double **)(param_1 + 0x10);
        pcVar12 = local_70;
        pcVar10 = local_70;
        break;
      case 's':
        plVar1 = (longlong *)(param_3 + 8);
        param_3 = param_3 + 8;
        pcVar10 = "(null)";
        if ((char *)*plVar1 != (char *)0x0) {
          pcVar10 = (char *)*plVar1;
        }
        FUN_14040b480(param_1,pcVar10);
        goto LAB_14040b715;
      }
      uVar9 = 0xffffffffffffffff;
      do {
        if (uVar9 == 0) break;
        uVar9 = uVar9 - 1;
        cVar3 = *pcVar12;
        pcVar12 = pcVar12 + 1;
      } while (cVar3 != '\0');
      lVar13 = ~uVar9 - 1;
LAB_14040b6e3:
      dVar8 = (double)FUN_140406c30(param_1,pcVar10,lVar13);
      *pdVar11 = dVar8;
      *(undefined4 *)(pdVar11 + 1) = 4;
LAB_14040b6f5:
      if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
        FUN_140405ae0(param_1,1);
      }
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
LAB_14040b715:
      param_2 = pcVar7 + 2;
      iVar14 = iVar14 + 2;
      pcVar7 = strchr(param_2,0x25);
    } while (pcVar7 != (char *)0x0);
  }
  puVar5 = *(undefined8 **)(param_1 + 0x10);
  uVar9 = 0xffffffffffffffff;
  pcVar7 = param_2;
  do {
    if (uVar9 == 0) break;
    uVar9 = uVar9 - 1;
    cVar3 = *pcVar7;
    pcVar7 = pcVar7 + 1;
  } while (cVar3 != '\0');
  uVar6 = FUN_140406c30(param_1,param_2,~uVar9 - 1);
  *puVar5 = uVar6;
  *(undefined4 *)(puVar5 + 1) = 4;
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x11) {
    FUN_140405ae0(param_1,1);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x10;
  FUN_14040c580(param_1,iVar14 + 1,
                (int)(*(longlong *)(param_1 + 0x10) - *(longlong *)(param_1 + 0x18) >> 4) + -1);
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + (longlong)iVar14 * -0x10;
  return *(longlong *)(*(longlong *)(param_1 + 0x10) + -0x10) + 0x18;
}



void FUN_14040b860(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_14040b4f0(param_1,param_2,&local_res18);
  return;
}



void FUN_14040b890(char *param_1,char *param_2,size_t param_3)

{
  char cVar1;
  size_t _Count;
  ulonglong uVar2;
  longlong lVar3;
  char *pcVar4;
  char *pcVar5;
  
  if (*param_2 == '=') {
    strncpy(param_1,param_2 + 1,param_3);
    param_1[param_3 - 1] = '\0';
    return;
  }
  if (*param_2 == '@') {
    uVar2 = 0xffffffffffffffff;
    param_2 = param_2 + 1;
    pcVar5 = param_2;
    do {
      if (uVar2 == 0) break;
      uVar2 = uVar2 - 1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar5 + 1;
    } while (cVar1 != '\0');
    *param_1 = '\0';
    if (param_3 - 8 < ~uVar2 - 1) {
      param_2 = param_2 + ((~uVar2 - 1) - (param_3 - 8));
      lVar3 = -1;
      pcVar5 = param_1;
      do {
        pcVar4 = pcVar5;
        if (lVar3 == 0) break;
        lVar3 = lVar3 + -1;
        pcVar4 = pcVar5 + 1;
        cVar1 = *pcVar5;
        pcVar5 = pcVar4;
      } while (cVar1 != '\0');
      builtin_strncpy(pcVar4 + -1,"...",4);
    }
    lVar3 = -1;
    do {
      pcVar5 = param_1;
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      pcVar5 = param_1 + 1;
      cVar1 = *param_1;
      param_1 = pcVar5;
    } while (cVar1 != '\0');
    lVar3 = 0;
    do {
      cVar1 = param_2[lVar3];
      pcVar5[lVar3 + -1] = cVar1;
      lVar3 = lVar3 + 1;
    } while (cVar1 != '\0');
  }
  else {
    _Count = strcspn(param_2,"\n\r");
    builtin_strncpy(param_1,"[string ",8);
    if (param_3 - 0x11 < _Count) {
      _Count = param_3 - 0x11;
    }
    param_1[8] = '\"';
    param_1[9] = '\0';
    if (param_2[_Count] == '\0') {
      lVar3 = -1;
      pcVar5 = param_1;
      do {
        pcVar4 = pcVar5;
        if (lVar3 == 0) break;
        lVar3 = lVar3 + -1;
        pcVar4 = pcVar5 + 1;
        cVar1 = *pcVar5;
        pcVar5 = pcVar4;
      } while (cVar1 != '\0');
      lVar3 = 0;
      do {
        cVar1 = param_2[lVar3];
        pcVar4[lVar3 + -1] = cVar1;
        lVar3 = lVar3 + 1;
      } while (cVar1 != '\0');
    }
    else {
      strncat(param_1,param_2,_Count);
      lVar3 = -1;
      pcVar5 = param_1;
      do {
        pcVar4 = pcVar5;
        if (lVar3 == 0) break;
        lVar3 = lVar3 + -1;
        pcVar4 = pcVar5 + 1;
        cVar1 = *pcVar5;
        pcVar5 = pcVar4;
      } while (cVar1 != '\0');
      builtin_strncpy(pcVar4 + -1,"...",4);
    }
    lVar3 = -1;
    do {
      pcVar5 = param_1;
      if (lVar3 == 0) break;
      lVar3 = lVar3 + -1;
      pcVar5 = param_1 + 1;
      cVar1 = *param_1;
      param_1 = pcVar5;
    } while (cVar1 != '\0');
    pcVar5[-1] = '\"';
    pcVar5[0] = ']';
    pcVar5[1] = '\0';
  }
  return;
}



longlong * FUN_14040b9f0(longlong *param_1,longlong *param_2)

{
  int iVar1;
  longlong local_res8 [4];
  
  if ((int)param_1[1] == 3) {
    return param_1;
  }
  if ((int)param_1[1] == 4) {
    iVar1 = FUN_14040b3b0(*param_1 + 0x18,local_res8);
    if (iVar1 != 0) {
      *(undefined4 *)(param_2 + 1) = 3;
      *param_2 = local_res8[0];
      return param_2;
    }
  }
  return (longlong *)0x0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined8 FUN_14040ba50(undefined8 param_1,undefined8 *param_2)

{
  char cVar1;
  undefined8 uVar2;
  ulonglong uVar3;
  char *pcVar4;
  undefined1 auStack_58 [32];
  char local_38 [32];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  if (*(int *)(param_2 + 1) == 3) {
    sprintf(local_38,"%.14g");
    uVar3 = 0xffffffffffffffff;
    pcVar4 = local_38;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + 1;
    } while (cVar1 != '\0');
    uVar2 = FUN_140406c30(param_1,local_38,~uVar3 - 1);
    *(undefined4 *)(param_2 + 1) = 4;
    *param_2 = uVar2;
    uVar2 = 1;
  }
  else {
    uVar2 = 0;
  }
  return uVar2;
}



void FUN_14040baf0(longlong param_1,ulonglong param_2)

{
  byte bVar1;
  ulonglong uVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  
  bVar1 = *(byte *)(param_1 + 100);
  uVar2 = *(ulonglong *)(param_1 + 0x30);
  *(ulonglong *)(param_1 + 0x30) = param_2;
  if (((bVar1 & 8) != 0) && (*(int *)(param_1 + 0x6c) == 0)) {
    *(undefined4 *)(param_1 + 0x6c) = *(undefined4 *)(param_1 + 0x68);
    FUN_140405b00(param_1,3);
  }
  if ((bVar1 & 4) != 0) {
    lVar3 = *(longlong *)(**(longlong **)(*(longlong *)(param_1 + 0x28) + 8) + 0x20);
    lVar4 = *(longlong *)(lVar3 + 0x18);
    lVar3 = *(longlong *)(lVar3 + 0x28);
    iVar5 = 0;
    iVar7 = (int)((longlong)(param_2 - lVar4) >> 2) + -1;
    if (lVar3 == 0) {
      iVar6 = 0;
    }
    else {
      iVar6 = *(int *)(lVar3 + (longlong)iVar7 * 4);
    }
    if ((iVar7 != 0) && (uVar2 < param_2)) {
      if (lVar3 != 0) {
        iVar5 = *(int *)(lVar3 + -4 + (longlong)(int)((longlong)(uVar2 - lVar4) >> 2) * 4);
      }
      if (iVar6 == iVar5) {
        return;
      }
    }
    FUN_140405b00(param_1,2);
  }
  return;
}



void FUN_14040bbc0(longlong param_1,longlong param_2,undefined8 *param_3,undefined8 *param_4,
                  undefined8 *param_5)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  param_2 = param_2 - *(longlong *)(param_1 + 0x40);
  *puVar1 = *param_3;
  *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(param_3 + 1);
  lVar2 = *(longlong *)(param_1 + 0x10);
  *(undefined8 *)(lVar2 + 0x10) = *param_4;
  *(undefined4 *)(lVar2 + 0x18) = *(undefined4 *)(param_4 + 1);
  lVar2 = *(longlong *)(param_1 + 0x10);
  *(undefined8 *)(lVar2 + 0x20) = *param_5;
  *(undefined4 *)(lVar2 + 0x28) = *(undefined4 *)(param_5 + 1);
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x31) {
    FUN_140405ae0(param_1,3);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x30;
  FUN_140406660(param_1,*(longlong *)(param_1 + 0x10) + -0x30,1);
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  lVar2 = *(longlong *)(param_1 + 0x40);
  *(undefined8 *)(param_2 + lVar2) = *puVar1;
  *(undefined4 *)(param_2 + 8 + lVar2) = *(undefined4 *)(puVar1 + 1);
  return;
}



void FUN_14040bc70(longlong param_1,undefined8 *param_2,undefined8 *param_3,undefined8 *param_4,
                  undefined8 *param_5)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  puVar1 = *(undefined8 **)(param_1 + 0x10);
  *puVar1 = *param_2;
  *(undefined4 *)(puVar1 + 1) = *(undefined4 *)(param_2 + 1);
  lVar2 = *(longlong *)(param_1 + 0x10);
  *(undefined8 *)(lVar2 + 0x10) = *param_3;
  *(undefined4 *)(lVar2 + 0x18) = *(undefined4 *)(param_3 + 1);
  lVar2 = *(longlong *)(param_1 + 0x10);
  *(undefined8 *)(lVar2 + 0x20) = *param_4;
  *(undefined4 *)(lVar2 + 0x28) = *(undefined4 *)(param_4 + 1);
  lVar2 = *(longlong *)(param_1 + 0x10);
  *(undefined8 *)(lVar2 + 0x30) = *param_5;
  *(undefined4 *)(lVar2 + 0x38) = *(undefined4 *)(param_5 + 1);
  if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x41) {
    FUN_140405ae0(param_1,4);
  }
  *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x40;
  FUN_140406660(param_1,*(longlong *)(param_1 + 0x10) + -0x40,0);
  return;
}



void FUN_14040bd00(longlong param_1,longlong *param_2,undefined8 *param_3,undefined8 *param_4)

{
  longlong lVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 *puVar4;
  longlong *plVar5;
  int iVar6;
  
  iVar6 = 0;
  do {
    if ((int)param_2[1] == 5) {
      lVar1 = *param_2;
      puVar4 = (undefined8 *)FUN_140408c50(lVar1,param_3);
      if ((((*(int *)(puVar4 + 1) != 0) || (lVar1 = *(longlong *)(lVar1 + 0x10), lVar1 == 0)) ||
          ((*(byte *)(lVar1 + 10) & 1) != 0)) ||
         (plVar5 = (longlong *)FUN_140408530(lVar1,0), plVar5 == (longlong *)0x0)) {
        *param_4 = *puVar4;
        *(undefined4 *)(param_4 + 1) = *(undefined4 *)(puVar4 + 1);
        return;
      }
    }
    else {
      plVar5 = (longlong *)FUN_140408570(param_1,param_2,0);
      if ((int)plVar5[1] == 0) {
        FUN_140405600(param_1,param_2);
      }
    }
    if ((int)plVar5[1] == 6) {
      plVar2 = *(longlong **)(param_1 + 0x10);
      lVar1 = *(longlong *)(param_1 + 0x40);
      *plVar2 = *plVar5;
      *(int *)(plVar2 + 1) = (int)plVar5[1];
      lVar3 = *(longlong *)(param_1 + 0x10);
      *(longlong *)(lVar3 + 0x10) = *param_2;
      *(int *)(lVar3 + 0x18) = (int)param_2[1];
      lVar3 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(lVar3 + 0x20) = *param_3;
      *(undefined4 *)(lVar3 + 0x28) = *(undefined4 *)(param_3 + 1);
      if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) < 0x31) {
        FUN_140405ae0(param_1,3);
      }
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + 0x30;
      FUN_140406660(param_1,*(longlong *)(param_1 + 0x10) + -0x30,1);
      *(longlong *)(param_1 + 0x10) = *(longlong *)(param_1 + 0x10) + -0x10;
      puVar4 = *(undefined8 **)(param_1 + 0x10);
      lVar3 = *(longlong *)(param_1 + 0x40);
      *(undefined8 *)((longlong)param_4 + (lVar3 - lVar1)) = *puVar4;
      *(undefined4 *)((longlong)param_4 + lVar3 + (8 - lVar1)) = *(undefined4 *)(puVar4 + 1);
      return;
    }
    iVar6 = iVar6 + 1;
    param_2 = plVar5;
  } while (iVar6 < 100);
  FUN_140405330(param_1,"loop in gettable");
  return;
}



void FUN_14040be90(longlong param_1,longlong *param_2,undefined8 param_3,longlong *param_4)

{
  longlong lVar1;
  longlong lVar2;
  longlong *plVar3;
  longlong *plVar4;
  int iVar5;
  
  iVar5 = 0;
  do {
    if ((int)param_2[1] == 5) {
      lVar1 = *param_2;
      plVar3 = (longlong *)FUN_140408d20(param_1,lVar1,param_3);
      if (((((int)plVar3[1] != 0) || (lVar2 = *(longlong *)(lVar1 + 0x10), lVar2 == 0)) ||
          ((*(byte *)(lVar2 + 10) & 2) != 0)) ||
         (plVar4 = (longlong *)
                   FUN_140408530(lVar2,1,*(undefined8 *)(*(longlong *)(param_1 + 0x20) + 0x130)),
         plVar4 == (longlong *)0x0)) {
        *plVar3 = *param_4;
        *(int *)(plVar3 + 1) = (int)param_4[1];
        if ((int)param_4[1] < 4) {
          return;
        }
        if ((*(byte *)(*param_4 + 9) & 3) == 0) {
          return;
        }
        if ((*(byte *)(lVar1 + 9) & 4) == 0) {
          return;
        }
        FUN_14040ad00(param_1,lVar1);
        return;
      }
    }
    else {
      plVar4 = (longlong *)FUN_140408570(param_1,param_2,1);
      if ((int)plVar4[1] == 0) {
        FUN_140405600(param_1,param_2,"index");
      }
    }
    if ((int)plVar4[1] == 6) {
      FUN_14040bc70(param_1,plVar4,param_2,param_3,param_4);
      return;
    }
    iVar5 = iVar5 + 1;
    param_2 = plVar4;
  } while (iVar5 < 100);
  FUN_140405330(param_1,"loop in settable");
  return;
}



undefined8
FUN_14040bfd0(undefined8 param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4,
             undefined4 param_5)

{
  longlong lVar1;
  
  lVar1 = FUN_140408570(param_1,param_2,param_5);
  if ((*(int *)(lVar1 + 8) == 0) &&
     (lVar1 = FUN_140408570(param_1,param_3,param_5), *(int *)(lVar1 + 8) == 0)) {
    return 0;
  }
  FUN_14040bbc0(param_1,param_4,lVar1,param_2,param_3);
  return 1;
}



longlong FUN_14040c050(longlong param_1,longlong param_2,longlong param_3,int param_4)

{
  int iVar1;
  longlong lVar2;
  longlong lVar3;
  byte bVar4;
  
  if (((param_2 != 0) &&
      (bVar4 = (byte)(1 << ((byte)param_4 & 0x1f)), (*(byte *)(param_2 + 10) & bVar4) == 0)) &&
     (lVar2 = FUN_140408530(param_2,param_4,
                            *(undefined8 *)
                             (*(longlong *)(param_1 + 0x20) + 0x128 + (longlong)param_4 * 8)),
     lVar2 != 0)) {
    if (param_2 == param_3) {
      return lVar2;
    }
    if (((param_3 != 0) && ((*(byte *)(param_3 + 10) & bVar4) == 0)) &&
       (lVar3 = FUN_140408530(param_3,param_4,
                              *(undefined8 *)
                               (*(longlong *)(param_1 + 0x20) + 0x128 + (longlong)param_4 * 8)),
       lVar3 != 0)) {
      iVar1 = FUN_14040b340(lVar2,lVar3);
      if (iVar1 == 0) {
        return 0;
      }
      return lVar2;
    }
  }
  return 0;
}



undefined8 FUN_14040c120(longlong param_1,undefined8 param_2,undefined8 param_3,undefined4 param_4)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  
  lVar2 = FUN_140408570(param_1,param_2,param_4);
  if (*(int *)(lVar2 + 8) != 0) {
    uVar3 = FUN_140408570(param_1,param_3,param_4);
    iVar1 = FUN_14040b340(lVar2,uVar3);
    if (iVar1 != 0) {
      FUN_14040bbc0(param_1,*(undefined8 *)(param_1 + 0x10),lVar2,param_2,param_3);
      iVar1 = (*(int **)(param_1 + 0x10))[2];
      if ((iVar1 != 0) && ((iVar1 != 1 || (**(int **)(param_1 + 0x10) != 0)))) {
        return 1;
      }
      return 0;
    }
  }
  return 0xffffffff;
}



uint FUN_14040c1d0(longlong param_1,longlong param_2)

{
  char cVar1;
  uint uVar2;
  ulonglong uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  char *_Str1;
  char *pcVar7;
  char *_Str2;
  
  lVar5 = *(longlong *)(param_1 + 0x10);
  lVar6 = *(longlong *)(param_2 + 0x10);
  _Str1 = (char *)(param_1 + 0x18);
  _Str2 = (char *)(param_2 + 0x18);
  uVar2 = strcoll(_Str1,_Str2);
  do {
    if (uVar2 != 0) {
      return uVar2;
    }
    uVar3 = 0xffffffffffffffff;
    pcVar7 = _Str1;
    do {
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      cVar1 = *pcVar7;
      pcVar7 = pcVar7 + 1;
    } while (cVar1 != '\0');
    uVar3 = ~uVar3;
    lVar4 = uVar3 - 1;
    if (lVar4 == lVar6) {
      return (uint)(lVar4 != lVar5);
    }
    if (lVar4 == lVar5) {
      return 0xffffffff;
    }
    _Str2 = _Str2 + uVar3;
    _Str1 = _Str1 + uVar3;
    lVar5 = lVar5 - uVar3;
    lVar6 = lVar6 - uVar3;
    uVar2 = strcoll(_Str1,_Str2);
  } while( true );
}



ulonglong FUN_14040c280(undefined8 param_1,double *param_2,double *param_3)

{
  int iVar1;
  ulonglong uVar2;
  
  iVar1 = *(int *)(param_2 + 1);
  if (iVar1 == *(int *)(param_3 + 1)) {
    if (iVar1 == 3) {
      if (*param_2 <= *param_3 && *param_3 != *param_2) {
        return 1;
      }
      return 0;
    }
    if (iVar1 == 4) {
      iVar1 = FUN_14040c1d0(*param_2,*param_3);
      return (ulonglong)(iVar1 < 0);
    }
    uVar2 = FUN_14040c120(param_1,param_2,param_3,0xd);
    if ((int)uVar2 != -1) {
      return uVar2;
    }
  }
  uVar2 = FUN_140405740(param_1,param_2,param_3);
  return uVar2;
}



ulonglong FUN_14040c340(undefined8 param_1,double *param_2,double *param_3)

{
  int iVar1;
  ulonglong uVar2;
  
  iVar1 = *(int *)(param_2 + 1);
  if (iVar1 == *(int *)(param_3 + 1)) {
    if (iVar1 == 3) {
      if (*param_2 <= *param_3) {
        return 1;
      }
      return 0;
    }
    if (iVar1 == 4) {
      iVar1 = FUN_14040c1d0(*param_2,*param_3);
      return (ulonglong)(iVar1 < 1);
    }
    uVar2 = FUN_14040c120(param_1,param_2,param_3,0xe);
    if ((int)uVar2 != -1) {
      return uVar2;
    }
    iVar1 = FUN_14040c120(param_1,param_3,param_2,0xd);
    if (iVar1 != -1) {
      return (ulonglong)(iVar1 == 0);
    }
  }
  uVar2 = FUN_140405740(param_1,param_2,param_3);
  return uVar2;
}



bool FUN_14040c430(longlong param_1,double *param_2,double *param_3)

{
  int iVar1;
  longlong lVar2;
  bool bVar3;
  
  switch(*(undefined4 *)(param_2 + 1)) {
  case 0:
    return true;
  case 1:
    bVar3 = *(int *)param_2 == *(int *)param_3;
    break;
  case 2:
    bVar3 = *param_2 == *param_3;
    break;
  case 3:
    if (*param_2 != *param_3) {
      return false;
    }
    return true;
  default:
    bVar3 = *param_2 == *param_3;
    break;
  case 5:
  case 7:
    if (*param_2 == *param_3) {
      return true;
    }
    lVar2 = FUN_14040c050(param_1,*(undefined8 *)((longlong)*param_2 + 0x10),
                          *(undefined8 *)((longlong)*param_3 + 0x10),4);
    if (lVar2 == 0) {
      return false;
    }
    FUN_14040bbc0(param_1,*(undefined8 *)(param_1 + 0x10),lVar2,param_2,param_3);
    iVar1 = (*(int **)(param_1 + 0x10))[2];
    if (iVar1 == 0) {
      return false;
    }
    if (iVar1 == 1) {
      if (**(int **)(param_1 + 0x10) == 0) {
        return false;
      }
      return true;
    }
    return true;
  }
  return bVar3;
}



void FUN_14040c580(longlong param_1,int param_2,int param_3)

{
  ulonglong uVar1;
  size_t _Size;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  longlong lVar6;
  undefined8 *puVar7;
  longlong lVar8;
  longlong lVar9;
  longlong *plVar10;
  longlong lVar11;
  int local_res18;
  
  lVar5 = (longlong)param_3;
  do {
    local_res18 = 2;
    lVar11 = 2;
    lVar6 = (lVar5 + 1) * 0x10 + *(longlong *)(param_1 + 0x18);
    if (((*(int *)(lVar6 + -0x18) == 4) || (*(int *)(lVar6 + -0x18) == 3)) &&
       ((*(int *)(lVar6 + -8) == 4 || (iVar2 = FUN_14040ba50(param_1,lVar6 + -0x10), iVar2 != 0))))
    {
      lVar8 = *(longlong *)(*(longlong *)(lVar6 + -0x10) + 0x10);
      if (lVar8 == 0) {
        if (*(int *)(lVar6 + -0x18) != 4) {
          FUN_14040ba50(param_1,lVar6 + -0x20);
        }
      }
      else {
        local_res18 = 1;
        lVar11 = 1;
        if (1 < (longlong)param_2) {
          plVar10 = (longlong *)(lVar6 + -0x20);
          local_res18 = 1;
          do {
            if (((int)plVar10[1] != 4) &&
               (iVar2 = FUN_14040ba50(param_1,lVar6 + ((longlong)local_res18 + 1) * -0x10),
               iVar2 == 0)) break;
            uVar1 = *(ulonglong *)(*plVar10 + 0x10);
            if (-lVar8 - 3U <= uVar1) {
              FUN_140405330(param_1,"string length overflow");
            }
            lVar11 = lVar11 + 1;
            lVar8 = lVar8 + uVar1;
            local_res18 = local_res18 + 1;
            plVar10 = plVar10 + -2;
          } while (lVar11 < param_2);
        }
        lVar8 = FUN_14040e200(param_1,*(longlong *)(param_1 + 0x20) + 0x58,lVar8);
        lVar3 = 0;
        if (0 < lVar11) {
          plVar10 = (longlong *)(lVar6 + lVar11 * -0x10);
          lVar9 = lVar11;
          do {
            _Size = *(size_t *)(*plVar10 + 0x10);
            memcpy((void *)(lVar8 + lVar3),(void *)(*plVar10 + 0x18),_Size);
            lVar9 = lVar9 + -1;
            lVar3 = lVar3 + _Size;
            plVar10 = plVar10 + 2;
          } while (0 < lVar9);
        }
        puVar7 = (undefined8 *)(lVar6 + lVar11 * -0x10);
        uVar4 = FUN_140406c30(param_1,lVar8,lVar3);
        *puVar7 = uVar4;
        *(undefined4 *)(puVar7 + 1) = 4;
      }
    }
    else {
      lVar8 = lVar6 + -0x10;
      lVar6 = lVar6 + -0x20;
      lVar3 = FUN_140408570(param_1,lVar6,0xf);
      if ((*(int *)(lVar3 + 8) == 0) &&
         (lVar3 = FUN_140408570(param_1,lVar8,0xf), *(int *)(lVar3 + 8) == 0)) {
        FUN_1404056d0(param_1,lVar6,lVar8);
      }
      else {
        FUN_14040bbc0(param_1,lVar6,lVar3,lVar6,lVar8);
      }
    }
    param_2 = param_2 + (1 - local_res18);
    lVar5 = lVar5 + (1 - lVar11);
    if (param_2 < 2) {
      return;
    }
  } while( true );
}



void FUN_14040c7d0(undefined8 param_1,double *param_2,double *param_3,double *param_4,
                  undefined4 param_5)

{
  double _Y;
  int iVar1;
  double *pdVar2;
  double dVar3;
  double dVar4;
  double local_res18 [2];
  double local_58;
  undefined4 local_50;
  double local_48;
  undefined4 local_40;
  
  pdVar2 = param_3;
  if (*(int *)(param_3 + 1) != 3) {
    if ((*(int *)(param_3 + 1) != 4) ||
       (iVar1 = FUN_14040b3b0((longlong)*param_3 + 0x18,local_res18), iVar1 == 0))
    goto LAB_14040c939;
    local_50 = 3;
    local_58 = local_res18[0];
    pdVar2 = &local_58;
  }
  if (*(int *)(param_4 + 1) != 3) {
    if ((*(int *)(param_4 + 1) != 4) ||
       (iVar1 = FUN_14040b3b0((longlong)*param_4 + 0x18,local_res18), iVar1 == 0)) {
LAB_14040c939:
      iVar1 = FUN_14040bfd0(param_1,param_3,param_4,param_2,param_5);
      if (iVar1 != 0) {
        return;
      }
      FUN_1404056f0(param_1,param_3,param_4);
      return;
    }
    local_40 = 3;
    param_4 = &local_48;
    local_48 = local_res18[0];
  }
  dVar4 = *pdVar2;
  _Y = *param_4;
  switch(param_5) {
  case 5:
    *param_2 = _Y + dVar4;
    goto LAB_14040c8cf;
  case 6:
    dVar4 = dVar4 - _Y;
    break;
  case 7:
    *param_2 = _Y * dVar4;
    goto LAB_14040c8cf;
  case 8:
    dVar4 = dVar4 / _Y;
    break;
  case 9:
    dVar3 = floor(dVar4 / _Y);
    dVar4 = dVar4 - dVar3 * _Y;
    break;
  case 10:
    dVar4 = pow(dVar4,_Y);
    *param_2 = dVar4;
    goto LAB_14040c8cf;
  case 0xb:
    dVar4 = -dVar4;
    break;
  default:
    goto switchD_14040c8bb_default;
  }
  *param_2 = dVar4;
LAB_14040c8cf:
  *(undefined4 *)(param_2 + 1) = 3;
switchD_14040c8bb_default:
  return;
}



void FUN_14040c990(longlong param_1,int param_2)

{
  int *piVar1;
  double dVar2;
  undefined4 uVar3;
  uint uVar4;
  double *pdVar5;
  double dVar6;
  undefined8 uVar7;
  double *pdVar8;
  longlong lVar9;
  undefined4 *puVar10;
  longlong lVar11;
  longlong lVar12;
  char *pcVar13;
  ulonglong uVar14;
  uint uVar15;
  longlong *plVar16;
  double *pdVar17;
  int iVar18;
  double *pdVar19;
  ulonglong uVar20;
  longlong lVar21;
  int iVar22;
  undefined8 *puVar23;
  uint *puVar24;
  uint *puVar25;
  uint uVar26;
  bool bVar27;
  double dVar28;
  int local_res10;
  longlong local_res18;
  double local_180;
  double local_178;
  double local_170;
  double local_168;
  double local_160;
  double local_158;
  double local_150;
  double local_148;
  double local_140;
  double local_138;
  undefined8 local_130;
  undefined4 local_128;
  double local_120;
  undefined4 local_118;
  double local_110;
  undefined4 local_108;
  undefined8 local_100;
  undefined4 local_f8;
  double local_f0;
  undefined4 local_e8;
  double local_e0;
  undefined4 local_d8;
  double local_d0;
  undefined4 local_c8;
  double local_c0;
  undefined4 local_b8;
  double local_b0;
  undefined4 local_a8;
  undefined1 local_a0 [96];
  
  local_res10 = param_2;
LAB_14040c9f0:
  local_res18 = *(longlong *)(param_1 + 0x18);
  lVar11 = **(longlong **)(*(longlong *)(param_1 + 0x28) + 8);
  lVar9 = *(longlong *)(*(longlong *)(lVar11 + 0x20) + 0x10);
  lVar12 = local_res18;
  puVar25 = *(uint **)(param_1 + 0x30);
switchD_14040cab2_default:
  puVar24 = puVar25;
  uVar4 = *puVar24;
  puVar25 = puVar24 + 1;
  if ((*(byte *)(param_1 + 100) & 0xc) != 0) {
    piVar1 = (int *)(param_1 + 0x6c);
    *piVar1 = *piVar1 + -1;
    if ((*piVar1 == 0) || ((*(byte *)(param_1 + 100) & 4) != 0)) {
      FUN_14040baf0(param_1,puVar25);
      if (*(char *)(param_1 + 10) == '\x01') {
        *(uint **)(param_1 + 0x30) = puVar24;
        return;
      }
      lVar12 = *(longlong *)(param_1 + 0x18);
      local_res18 = lVar12;
    }
  }
  uVar26 = uVar4 >> 6 & 0xff;
  uVar20 = (ulonglong)uVar26;
  pdVar17 = (double *)(lVar12 + uVar20 * 0x10);
  switch(uVar4 & 0x3f) {
  case 0:
    *pdVar17 = *(double *)(lVar12 + (ulonglong)(uVar4 >> 0x17) * 0x10);
    *(undefined4 *)(pdVar17 + 1) = *(undefined4 *)(lVar12 + 8 + (ulonglong)(uVar4 >> 0x17) * 0x10);
    goto switchD_14040cab2_default;
  case 1:
    *pdVar17 = *(double *)(lVar9 + (ulonglong)(uVar4 >> 0xe) * 0x10);
    *(undefined4 *)(pdVar17 + 1) = *(undefined4 *)(lVar9 + 8 + (ulonglong)(uVar4 >> 0xe) * 0x10);
    goto switchD_14040cab2_default;
  case 2:
    *(undefined4 *)(pdVar17 + 1) = 1;
    *(uint *)pdVar17 = uVar4 >> 0x17;
    if ((uVar4 & 0x7fc000) != 0) {
      puVar25 = puVar24 + 2;
    }
    goto switchD_14040cab2_default;
  case 3:
    pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    do {
      *(undefined4 *)(pdVar5 + 1) = 0;
      pdVar5 = pdVar5 + -2;
    } while (pdVar17 <= pdVar5);
    goto switchD_14040cab2_default;
  case 4:
    pdVar5 = *(double **)(*(longlong *)(lVar11 + 0x28 + (ulonglong)(uVar4 >> 0x17) * 8) + 0x10);
    *pdVar17 = *pdVar5;
    *(undefined4 *)(pdVar17 + 1) = *(undefined4 *)(pdVar5 + 1);
    goto switchD_14040cab2_default;
  case 5:
    local_130 = *(undefined8 *)(lVar11 + 0x18);
    local_128 = 5;
    *(uint **)(param_1 + 0x30) = puVar25;
    FUN_14040bd00(param_1,&local_130,(ulonglong)(uVar4 >> 0xe) * 0x10 + lVar9,pdVar17);
    local_res18 = *(longlong *)(param_1 + 0x18);
    lVar12 = local_res18;
    goto switchD_14040cab2_default;
  case 6:
    *(uint **)(param_1 + 0x30) = puVar25;
    if ((uVar4 >> 0x16 & 1) == 0) {
      lVar21 = (ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12;
    }
    else {
      lVar21 = (ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9;
    }
    FUN_14040bd00(param_1,(ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12,lVar21,pdVar17);
    local_res18 = *(longlong *)(param_1 + 0x18);
    lVar12 = local_res18;
    goto switchD_14040cab2_default;
  case 7:
    local_100 = *(undefined8 *)(lVar11 + 0x18);
    local_f8 = 5;
    *(uint **)(param_1 + 0x30) = puVar25;
    FUN_14040be90(param_1,&local_100,(ulonglong)(uVar4 >> 0xe) * 0x10 + lVar9,pdVar17);
    local_res18 = *(longlong *)(param_1 + 0x18);
    lVar12 = local_res18;
    goto switchD_14040cab2_default;
  case 8:
    lVar21 = *(longlong *)(lVar11 + 0x28 + (ulonglong)(uVar4 >> 0x17) * 8);
    pdVar5 = *(double **)(lVar21 + 0x10);
    *pdVar5 = *pdVar17;
    *(undefined4 *)(pdVar5 + 1) = *(undefined4 *)(pdVar17 + 1);
    if (((3 < *(int *)(pdVar17 + 1)) && ((*(byte *)((longlong)*pdVar17 + 9) & 3) != 0)) &&
       ((*(byte *)(lVar21 + 9) & 4) != 0)) {
      FUN_14040acd0(param_1);
      lVar12 = local_res18;
    }
    goto switchD_14040cab2_default;
  case 9:
    *(uint **)(param_1 + 0x30) = puVar25;
    if ((uVar4 >> 0x16 & 1) == 0) {
      lVar21 = (ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12;
    }
    else {
      lVar21 = (ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9;
    }
    if ((int)uVar4 < 0) {
      FUN_14040be90(param_1,pdVar17,(ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9,lVar21);
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
    }
    else {
      FUN_14040be90(param_1,pdVar17,(ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12,lVar21);
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
    }
    goto switchD_14040cab2_default;
  case 10:
    FUN_14040b2f0(uVar4 >> 0xe & 0x1ff);
    uVar3 = FUN_14040b2f0(uVar4 >> 0x17);
    dVar6 = (double)FUN_140408a50(param_1,uVar3);
    *(undefined4 *)(pdVar17 + 1) = 5;
    *pdVar17 = dVar6;
    goto LAB_14040dd7b;
  case 0xb:
    pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    pdVar17[2] = *pdVar5;
    *(undefined4 *)(pdVar17 + 3) = *(undefined4 *)(pdVar5 + 1);
    *(uint **)(param_1 + 0x30) = puVar25;
    if ((uVar4 >> 0x16 & 1) == 0) {
      FUN_14040bd00(param_1,pdVar5,(ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12,pdVar17);
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
    }
    else {
      FUN_14040bd00(param_1,pdVar5,(ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9,pdVar17);
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
    }
    goto switchD_14040cab2_default;
  case 0xc:
    if ((int)uVar4 < 0) {
      pdVar5 = (double *)((ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9);
    }
    else {
      pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    }
    if ((uVar4 >> 0x16 & 1) == 0) {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12);
    }
    else {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9);
    }
    if ((*(int *)(pdVar5 + 1) == 3) && (*(int *)(pdVar8 + 1) == 3)) {
      dVar6 = *pdVar8;
      dVar2 = *pdVar5;
      *(undefined4 *)(pdVar17 + 1) = 3;
      *pdVar17 = dVar6 + dVar2;
    }
    else {
      *(uint **)(param_1 + 0x30) = puVar25;
      FUN_14040c7d0(param_1,pdVar17,pdVar5,pdVar8,5);
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
    }
    goto switchD_14040cab2_default;
  case 0xd:
    if ((int)uVar4 < 0) {
      pdVar5 = (double *)((ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9);
    }
    else {
      pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    }
    if ((uVar4 >> 0x16 & 1) == 0) {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12);
    }
    else {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9);
    }
    if ((*(int *)(pdVar5 + 1) == 3) && (*(int *)(pdVar8 + 1) == 3)) {
      dVar6 = *pdVar5;
      dVar2 = *pdVar8;
      *(undefined4 *)(pdVar17 + 1) = 3;
      *pdVar17 = dVar6 - dVar2;
    }
    else {
      *(uint **)(param_1 + 0x30) = puVar25;
      FUN_14040c7d0(param_1,pdVar17,pdVar5,pdVar8,6);
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
    }
    goto switchD_14040cab2_default;
  case 0xe:
    if ((int)uVar4 < 0) {
      pdVar5 = (double *)((ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9);
    }
    else {
      pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    }
    if ((uVar4 >> 0x16 & 1) == 0) {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12);
    }
    else {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9);
    }
    if ((*(int *)(pdVar5 + 1) == 3) && (*(int *)(pdVar8 + 1) == 3)) {
      dVar6 = *pdVar8;
      dVar2 = *pdVar5;
      *(undefined4 *)(pdVar17 + 1) = 3;
      *pdVar17 = dVar6 * dVar2;
    }
    else {
      *(uint **)(param_1 + 0x30) = puVar25;
      FUN_14040c7d0(param_1,pdVar17,pdVar5,pdVar8,7);
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
    }
    goto switchD_14040cab2_default;
  case 0xf:
    if ((int)uVar4 < 0) {
      pdVar5 = (double *)((ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9);
    }
    else {
      pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    }
    if ((uVar4 >> 0x16 & 1) == 0) {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12);
    }
    else {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9);
    }
    if ((*(int *)(pdVar5 + 1) == 3) && (*(int *)(pdVar8 + 1) == 3)) {
      dVar6 = *pdVar5;
      dVar2 = *pdVar8;
      *(undefined4 *)(pdVar17 + 1) = 3;
      *pdVar17 = dVar6 / dVar2;
      goto switchD_14040cab2_default;
    }
    *(uint **)(param_1 + 0x30) = puVar25;
    pdVar19 = pdVar5;
    if (*(int *)(pdVar5 + 1) == 3) {
LAB_14040d0e5:
      if (*(int *)(pdVar8 + 1) != 3) {
        if ((*(int *)(pdVar8 + 1) != 4) ||
           (iVar18 = FUN_14040b3b0((longlong)*pdVar8 + 0x18,&local_178), iVar18 == 0))
        goto LAB_14040d14b;
        local_118 = 3;
        pdVar8 = &local_120;
        local_120 = local_178;
      }
      dVar6 = *pdVar19;
      dVar2 = *pdVar8;
      *(undefined4 *)(pdVar17 + 1) = 3;
      *pdVar17 = dVar6 / dVar2;
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
      goto switchD_14040cab2_default;
    }
    if ((*(int *)(pdVar5 + 1) == 4) &&
       (iVar18 = FUN_14040b3b0((longlong)*pdVar5 + 0x18,&local_180), iVar18 != 0)) {
      local_b8 = 3;
      local_c0 = local_180;
      pdVar19 = &local_c0;
      goto LAB_14040d0e5;
    }
LAB_14040d14b:
    uVar7 = 8;
    break;
  case 0x10:
    if ((int)uVar4 < 0) {
      pdVar5 = (double *)((ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9);
    }
    else {
      pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    }
    if ((uVar4 >> 0x16 & 1) == 0) {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12);
    }
    else {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9);
    }
    if ((*(int *)(pdVar5 + 1) == 3) && (*(int *)(pdVar8 + 1) == 3)) {
      dVar6 = *pdVar5;
      dVar28 = floor(dVar6 / *pdVar8);
      dVar2 = *pdVar8;
      *(undefined4 *)(pdVar17 + 1) = 3;
      *pdVar17 = dVar6 - dVar28 * dVar2;
      lVar12 = local_res18;
      goto switchD_14040cab2_default;
    }
    *(uint **)(param_1 + 0x30) = puVar25;
    pdVar19 = pdVar5;
    if (*(int *)(pdVar5 + 1) == 3) {
LAB_14040d235:
      if (*(int *)(pdVar8 + 1) != 3) {
        if ((*(int *)(pdVar8 + 1) != 4) ||
           (iVar18 = FUN_14040b3b0((longlong)*pdVar8 + 0x18,&local_168), iVar18 == 0))
        goto LAB_14040d2ac;
        local_e8 = 3;
        pdVar8 = &local_f0;
        local_f0 = local_168;
      }
      dVar6 = *pdVar19;
      dVar28 = floor(dVar6 / *pdVar8);
      dVar2 = *pdVar8;
      *(undefined4 *)(pdVar17 + 1) = 3;
      *pdVar17 = dVar6 - dVar28 * dVar2;
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
      goto switchD_14040cab2_default;
    }
    if ((*(int *)(pdVar5 + 1) == 4) &&
       (iVar18 = FUN_14040b3b0((longlong)*pdVar5 + 0x18,&local_170), iVar18 != 0)) {
      local_108 = 3;
      local_110 = local_170;
      pdVar19 = &local_110;
      goto LAB_14040d235;
    }
LAB_14040d2ac:
    uVar7 = 9;
    break;
  case 0x11:
    if ((int)uVar4 < 0) {
      pdVar5 = (double *)((ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9);
    }
    else {
      pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    }
    if ((uVar4 >> 0x16 & 1) == 0) {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12);
    }
    else {
      pdVar8 = (double *)((ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9);
    }
    if ((*(int *)(pdVar5 + 1) == 3) && (*(int *)(pdVar8 + 1) == 3)) {
      dVar6 = pow(*pdVar5,*pdVar8);
      goto LAB_14040d31d;
    }
    *(uint **)(param_1 + 0x30) = puVar25;
    pdVar19 = pdVar5;
    if (*(int *)(pdVar5 + 1) == 3) {
LAB_14040d388:
      if (*(int *)(pdVar8 + 1) != 3) {
        if ((*(int *)(pdVar8 + 1) != 4) ||
           (iVar18 = FUN_14040b3b0((longlong)*pdVar8 + 0x18,&local_140), iVar18 == 0))
        goto LAB_14040d3f3;
        local_a8 = 3;
        pdVar8 = &local_b0;
        local_b0 = local_140;
      }
      dVar6 = pow(*pdVar19,*pdVar8);
      *(undefined4 *)(pdVar17 + 1) = 3;
      *pdVar17 = dVar6;
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
      goto switchD_14040cab2_default;
    }
    if ((*(int *)(pdVar5 + 1) == 4) &&
       (iVar18 = FUN_14040b3b0((longlong)*pdVar5 + 0x18,&local_138), iVar18 != 0)) {
      local_c8 = 3;
      local_d0 = local_138;
      pdVar19 = &local_d0;
      goto LAB_14040d388;
    }
LAB_14040d3f3:
    uVar7 = 10;
    break;
  case 0x12:
    pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    if (*(int *)(pdVar5 + 1) != 3) {
      *(uint **)(param_1 + 0x30) = puVar25;
      pdVar8 = pdVar5;
      if (*(int *)(pdVar5 + 1) == 3) {
LAB_14040d4a5:
        if ((*(int *)(pdVar5 + 1) == 3) ||
           ((*(int *)(pdVar5 + 1) == 4 &&
            (iVar18 = FUN_14040b3b0((longlong)*pdVar5 + 0x18,local_a0), iVar18 != 0)))) {
          dVar6 = *pdVar8;
          *(undefined4 *)(pdVar17 + 1) = 3;
          *pdVar17 = -dVar6;
          local_res18 = *(longlong *)(param_1 + 0x18);
          lVar12 = local_res18;
          goto switchD_14040cab2_default;
        }
      }
      else if ((*(int *)(pdVar5 + 1) == 4) &&
              (iVar18 = FUN_14040b3b0((longlong)*pdVar5 + 0x18,&local_150), iVar18 != 0)) {
        local_d8 = 3;
        local_e0 = local_150;
        pdVar8 = &local_e0;
        goto LAB_14040d4a5;
      }
      iVar18 = FUN_14040bfd0(param_1,pdVar5,pdVar5,pdVar17,0xb);
      if (iVar18 == 0) {
        FUN_1404056f0(param_1,pdVar5);
      }
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
      goto switchD_14040cab2_default;
    }
    dVar6 = *pdVar5;
    *(undefined4 *)(pdVar17 + 1) = 3;
    *pdVar17 = -dVar6;
    goto switchD_14040cab2_default;
  case 0x13:
    iVar18 = *(int *)(lVar12 + 8 + (ulonglong)(uVar4 >> 0x17) * 0x10);
    if ((iVar18 == 0) ||
       ((iVar18 == 1 && (*(int *)(lVar12 + (ulonglong)(uVar4 >> 0x17) * 0x10) == 0)))) {
      *(undefined4 *)pdVar17 = 1;
      *(undefined4 *)(pdVar17 + 1) = 1;
    }
    else {
      *(undefined4 *)(pdVar17 + 1) = 1;
      *(undefined4 *)pdVar17 = 0;
    }
    goto switchD_14040cab2_default;
  case 0x14:
    plVar16 = (longlong *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    if ((int)plVar16[1] == 4) {
      dVar6 = (double)*(longlong *)(*plVar16 + 0x10);
      if (*(longlong *)(*plVar16 + 0x10) < 0) {
        dVar6 = dVar6 + 1.8446744073709552e+19;
      }
      *pdVar17 = dVar6;
      *(undefined4 *)(pdVar17 + 1) = 3;
    }
    else if ((int)plVar16[1] == 5) {
      iVar18 = FUN_140409060(*plVar16);
      dVar6 = (double)iVar18;
LAB_14040d31d:
      *pdVar17 = dVar6;
      *(undefined4 *)(pdVar17 + 1) = 3;
      lVar12 = local_res18;
    }
    else {
      *(uint **)(param_1 + 0x30) = puVar25;
      lVar12 = FUN_140408570(param_1,plVar16,0xc);
      if (*(int *)(lVar12 + 8) == 0) {
        lVar12 = FUN_140408570(param_1,&DAT_140475320,0xc);
      }
      if (*(int *)(lVar12 + 8) == 0) {
        FUN_140405600(param_1,plVar16);
        local_res18 = *(longlong *)(param_1 + 0x18);
        lVar12 = local_res18;
      }
      else {
        FUN_14040bbc0(param_1,pdVar17,lVar12,plVar16,&DAT_140475320);
        local_res18 = *(longlong *)(param_1 + 0x18);
        lVar12 = local_res18;
      }
    }
    goto switchD_14040cab2_default;
  case 0x15:
    uVar26 = uVar4 >> 0x17;
    *(uint **)(param_1 + 0x30) = puVar25;
    FUN_14040c580(param_1,((uVar4 >> 0xe & 0x1ff) - uVar26) + 1);
    if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
        *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
      FUN_14040aa00(param_1);
    }
    local_res18 = *(longlong *)(param_1 + 0x18);
    *(undefined8 *)(local_res18 + uVar20 * 0x10) =
         *(undefined8 *)(local_res18 + (ulonglong)uVar26 * 0x10);
    *(undefined4 *)(local_res18 + 8 + uVar20 * 0x10) =
         *(undefined4 *)(local_res18 + 8 + (ulonglong)uVar26 * 0x10);
    lVar12 = local_res18;
    goto switchD_14040cab2_default;
  case 0x16:
    puVar25 = puVar25 + (int)((uVar4 >> 0xe) - 0x1ffff);
    goto switchD_14040cab2_default;
  case 0x17:
    if ((int)uVar4 < 0) {
      lVar21 = (ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9;
    }
    else {
      lVar21 = (ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12;
    }
    if ((uVar4 >> 0x16 & 1) == 0) {
      lVar12 = (ulonglong)(uVar4 >> 0xe & 0x1ff) * 0x10 + lVar12;
    }
    else {
      lVar12 = (ulonglong)(uVar4 >> 0xe & 0xff) * 0x10 + lVar9;
    }
    *(uint **)(param_1 + 0x30) = puVar25;
    if ((*(int *)(lVar21 + 8) == *(int *)(lVar12 + 8)) &&
       (iVar18 = FUN_14040c430(param_1), iVar18 != 0)) {
      uVar4 = 1;
    }
    else {
      uVar4 = 0;
    }
    if (uVar4 != uVar26) goto LAB_14040d881;
    local_res18 = *(longlong *)(param_1 + 0x18);
    lVar12 = local_res18;
    puVar25 = puVar25 + (longlong)(int)((*puVar25 >> 0xe) - 0x1ffff) + 1;
    goto switchD_14040cab2_default;
  case 0x18:
    *(uint **)(param_1 + 0x30) = puVar25;
    if ((int)uVar4 < 0) {
      lVar12 = (ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9;
    }
    else {
      lVar12 = (ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12;
    }
    uVar4 = FUN_14040c280(param_1,lVar12);
    if (uVar4 != uVar26) goto LAB_14040d881;
    local_res18 = *(longlong *)(param_1 + 0x18);
    lVar12 = local_res18;
    puVar25 = puVar25 + (longlong)(int)((*puVar25 >> 0xe) - 0x1ffff) + 1;
    goto switchD_14040cab2_default;
  case 0x19:
    *(uint **)(param_1 + 0x30) = puVar25;
    if ((int)uVar4 < 0) {
      lVar12 = (ulonglong)(byte)(uVar4 >> 0x17) * 0x10 + lVar9;
    }
    else {
      lVar12 = (ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12;
    }
    uVar4 = FUN_14040c340(param_1,lVar12);
    if (uVar4 == uVar26) {
      puVar25 = puVar25 + (int)((*puVar25 >> 0xe) - 0x1ffff);
    }
LAB_14040d881:
    local_res18 = *(longlong *)(param_1 + 0x18);
    lVar12 = local_res18;
    puVar25 = puVar25 + 1;
    goto switchD_14040cab2_default;
  case 0x1a:
    if ((*(int *)(pdVar17 + 1) == 0) || ((*(int *)(pdVar17 + 1) == 1 && (*(int *)pdVar17 == 0)))) {
      uVar26 = 1;
    }
    else {
      uVar26 = 0;
    }
    if (uVar26 != (uVar4 >> 0xe & 0x1ff)) {
LAB_14040d90b:
      puVar25 = puVar25 + (int)((*puVar25 >> 0xe) - 0x1ffff);
    }
    goto LAB_14040d91c;
  case 0x1b:
    pdVar5 = (double *)((ulonglong)(uVar4 >> 0x17) * 0x10 + lVar12);
    if ((*(int *)(pdVar5 + 1) == 0) || ((*(int *)(pdVar5 + 1) == 1 && (*(int *)pdVar5 == 0)))) {
      uVar26 = 1;
    }
    else {
      uVar26 = 0;
    }
    if (uVar26 != (uVar4 >> 0xe & 0x1ff)) {
      *pdVar17 = *pdVar5;
      *(undefined4 *)(pdVar17 + 1) = *(undefined4 *)(pdVar5 + 1);
      goto LAB_14040d90b;
    }
LAB_14040d91c:
    puVar25 = puVar25 + 1;
    goto switchD_14040cab2_default;
  case 0x1c:
    iVar18 = (uVar4 >> 0xe & 0x1ff) - 1;
    if (uVar4 >> 0x17 != 0) {
      *(double **)(param_1 + 0x10) = pdVar17 + (ulonglong)(uVar4 >> 0x17) * 2;
    }
    *(uint **)(param_1 + 0x30) = puVar25;
    iVar22 = FUN_140406410(param_1,pdVar17,iVar18);
    if (iVar22 == 0) {
      local_res10 = local_res10 + 1;
      goto LAB_14040c9f0;
    }
    if (iVar22 != 1) {
      return;
    }
    if (-1 < iVar18) {
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(*(longlong *)(param_1 + 0x28) + 0x10);
    }
    local_res18 = *(longlong *)(param_1 + 0x18);
    lVar12 = local_res18;
    goto switchD_14040cab2_default;
  case 0x1d:
    if (uVar4 >> 0x17 != 0) {
      *(double **)(param_1 + 0x10) = pdVar17 + (ulonglong)(uVar4 >> 0x17) * 2;
    }
    *(uint **)(param_1 + 0x30) = puVar25;
    iVar18 = FUN_140406410(param_1,pdVar17,0xffffffff);
    if (iVar18 != 0) {
      if (iVar18 != 1) {
        return;
      }
      local_res18 = *(longlong *)(param_1 + 0x18);
      lVar12 = local_res18;
      goto switchD_14040cab2_default;
    }
    plVar16 = *(longlong **)(param_1 + 0x28);
    lVar11 = plVar16[-4];
    uVar20 = plVar16[1];
    if (*(longlong *)(param_1 + 0x98) != 0) {
      FUN_14040b010(param_1);
    }
    iVar18 = 0;
    lVar9 = (*plVar16 - uVar20 & 0xfffffffffffffff0) + plVar16[-4];
    plVar16[-5] = lVar9;
    *(longlong *)(param_1 + 0x18) = lVar9;
    if (uVar20 < *(ulonglong *)(param_1 + 0x10)) {
      puVar10 = (undefined4 *)(lVar11 + 8);
      do {
        iVar18 = iVar18 + 1;
        *(undefined8 *)(puVar10 + -2) = *(undefined8 *)((uVar20 - lVar11) + -8 + (longlong)puVar10);
        *puVar10 = *(undefined4 *)((uVar20 - lVar11) + -0x10 + (longlong)(puVar10 + 4));
        puVar10 = puVar10 + 4;
      } while ((longlong)iVar18 * 0x10 + uVar20 < *(ulonglong *)(param_1 + 0x10));
    }
    lVar11 = (longlong)iVar18 * 0x10 + lVar11;
    *(longlong *)(param_1 + 0x10) = lVar11;
    plVar16[-3] = lVar11;
    lVar11 = *(longlong *)(param_1 + 0x30);
    *(int *)((longlong)plVar16 + -4) = *(int *)((longlong)plVar16 + -4) + 1;
    plVar16[-2] = lVar11;
    *(longlong *)(param_1 + 0x28) = *(longlong *)(param_1 + 0x28) + -0x28;
    goto LAB_14040c9f0;
  case 0x1e:
    goto switchD_14040cab2_caseD_1e;
  case 0x1f:
    dVar6 = pdVar17[4] + *pdVar17;
    if (pdVar17[4] <= 0.0) {
      bVar27 = dVar6 < pdVar17[2];
    }
    else {
      bVar27 = pdVar17[2] < dVar6;
    }
    if (!bVar27) {
      *pdVar17 = dVar6;
      *(undefined4 *)(pdVar17 + 1) = 3;
      pdVar17[6] = dVar6;
      *(undefined4 *)(pdVar17 + 7) = 3;
      puVar25 = puVar25 + (int)((uVar4 >> 0xe) - 0x1ffff);
    }
    goto switchD_14040cab2_default;
  case 0x20:
    *(uint **)(param_1 + 0x30) = puVar25;
    pdVar5 = pdVar17 + 2;
    pdVar8 = pdVar17 + 4;
    if (*(int *)(pdVar17 + 1) == 3) {
LAB_14040da85:
      if (*(int *)(pdVar17 + 3) != 3) {
        if ((*(int *)(pdVar17 + 3) == 4) &&
           (iVar18 = FUN_14040b3b0((longlong)*pdVar5 + 0x18,&local_158), iVar18 != 0)) {
          *(undefined4 *)(pdVar17 + 3) = 3;
          *pdVar5 = local_158;
          if (pdVar5 != (double *)0x0) goto LAB_14040dad4;
        }
        pcVar13 = "\'for\' limit must be a number";
        goto LAB_14040db17;
      }
LAB_14040dad4:
      if (*(int *)(pdVar17 + 5) != 3) {
        if ((*(int *)(pdVar17 + 5) == 4) &&
           (iVar18 = FUN_14040b3b0((longlong)*pdVar8 + 0x18,&local_148), iVar18 != 0)) {
          *(undefined4 *)(pdVar17 + 5) = 3;
          *pdVar8 = local_148;
          if (pdVar8 != (double *)0x0) goto LAB_14040db1f;
        }
        else {
          pdVar8 = (double *)0x0;
        }
        pcVar13 = "\'for\' step must be a number";
        goto LAB_14040db17;
      }
    }
    else {
      if ((*(int *)(pdVar17 + 1) == 4) &&
         (iVar18 = FUN_14040b3b0((longlong)*pdVar17 + 0x18,&local_160), iVar18 != 0)) {
        *(undefined4 *)(pdVar17 + 1) = 3;
        *pdVar17 = local_160;
        goto LAB_14040da85;
      }
      pcVar13 = "\'for\' initial value must be a number";
LAB_14040db17:
      FUN_140405330(param_1,pcVar13);
    }
LAB_14040db1f:
    dVar6 = *pdVar8;
    *(undefined4 *)(pdVar17 + 1) = 3;
    *pdVar17 = *pdVar17 - dVar6;
    lVar12 = local_res18;
    puVar25 = puVar25 + (int)((uVar4 >> 0xe) - 0x1ffff);
    goto switchD_14040cab2_default;
  case 0x21:
    pdVar17[10] = pdVar17[4];
    *(undefined4 *)(pdVar17 + 0xb) = *(undefined4 *)(pdVar17 + 5);
    pdVar17[8] = pdVar17[2];
    *(undefined4 *)(pdVar17 + 9) = *(undefined4 *)(pdVar17 + 3);
    pdVar17[6] = *pdVar17;
    *(undefined4 *)(pdVar17 + 7) = *(undefined4 *)(pdVar17 + 1);
    *(uint **)(param_1 + 0x30) = puVar25;
    *(double **)(param_1 + 0x10) = pdVar17 + 0xc;
    FUN_140406660(param_1,pdVar17 + 6,uVar4 >> 0xe & 0x1ff);
    local_res18 = *(longlong *)(param_1 + 0x18);
    puVar23 = (undefined8 *)(((ulonglong)uVar26 + 3) * 0x10 + local_res18);
    *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(*(longlong *)(param_1 + 0x28) + 0x10);
    if (*(int *)(puVar23 + 1) != 0) {
      puVar23[-2] = *puVar23;
      *(undefined4 *)(puVar23 + -1) = *(undefined4 *)(puVar23 + 1);
      puVar25 = puVar25 + (int)((*puVar25 >> 0xe) - 0x1ffff);
    }
    lVar12 = local_res18;
    puVar25 = puVar25 + 1;
    goto switchD_14040cab2_default;
  case 0x22:
    uVar15 = uVar4 >> 0x17;
    uVar26 = uVar4 >> 0xe & 0x1ff;
    if (uVar4 >> 0x17 == 0) {
      lVar21 = *(longlong *)(param_1 + 0x10);
      *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(*(longlong *)(param_1 + 0x28) + 0x10);
      uVar15 = (int)(lVar21 - (longlong)pdVar17 >> 4) - 1;
    }
    if (uVar26 == 0) {
      uVar26 = *puVar25;
      puVar25 = puVar24 + 2;
    }
    if (*(int *)(pdVar17 + 1) == 5) {
      dVar6 = *pdVar17;
      iVar18 = uVar26 * 0x32 + -0x32 + uVar15;
      if (*(int *)((longlong)dVar6 + 0x38) < iVar18) {
        FUN_140409320(param_1,dVar6,iVar18);
        lVar12 = local_res18;
      }
      lVar21 = (longlong)(int)uVar15;
      if (0 < (int)uVar15) {
        pdVar17 = pdVar17 + lVar21 * 2;
        do {
          pdVar5 = (double *)FUN_140408db0(param_1,dVar6,iVar18);
          iVar18 = iVar18 + -1;
          *pdVar5 = *pdVar17;
          *(undefined4 *)(pdVar5 + 1) = *(undefined4 *)(pdVar17 + 1);
          if (((3 < *(int *)(pdVar17 + 1)) && ((*(byte *)((longlong)*pdVar17 + 9) & 3) != 0)) &&
             ((*(byte *)((longlong)dVar6 + 9) & 4) != 0)) {
            FUN_14040ad00(param_1,dVar6);
          }
          lVar21 = lVar21 + -1;
          pdVar17 = pdVar17 + -2;
          lVar12 = local_res18;
        } while (0 < lVar21);
      }
    }
    goto switchD_14040cab2_default;
  case 0x23:
    FUN_14040b010(param_1,pdVar17);
    lVar12 = local_res18;
    goto switchD_14040cab2_default;
  case 0x24:
    lVar12 = *(longlong *)
              (*(longlong *)(*(longlong *)(lVar11 + 0x20) + 0x20) + (ulonglong)(uVar4 >> 0xe) * 8);
    uVar20 = (ulonglong)*(byte *)(lVar12 + 0x70);
    dVar6 = (double)FUN_14040ae40(param_1,uVar20,*(undefined8 *)(lVar11 + 0x18));
    *(longlong *)((longlong)dVar6 + 0x20) = lVar12;
    if (uVar20 != 0) {
      puVar23 = (undefined8 *)((longlong)dVar6 + 0x28);
      do {
        uVar14 = (ulonglong)(*puVar25 >> 0x17);
        if (((byte)*puVar25 & 0x3f) == 4) {
          *puVar23 = *(undefined8 *)(lVar11 + 0x28 + uVar14 * 8);
        }
        else {
          uVar7 = FUN_14040af10(param_1,uVar14 * 0x10 + local_res18);
          *puVar23 = uVar7;
        }
        puVar23 = puVar23 + 1;
        puVar25 = puVar25 + 1;
        uVar20 = uVar20 - 1;
      } while (uVar20 != 0);
    }
    *pdVar17 = dVar6;
    *(undefined4 *)(pdVar17 + 1) = 6;
LAB_14040dd7b:
    *(uint **)(param_1 + 0x30) = puVar25;
    if (*(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x70) <=
        *(ulonglong *)(*(longlong *)(param_1 + 0x20) + 0x78)) {
      FUN_14040aa00(param_1);
    }
    local_res18 = *(longlong *)(param_1 + 0x18);
    lVar12 = local_res18;
    goto switchD_14040cab2_default;
  case 0x25:
    plVar16 = *(longlong **)(param_1 + 0x28);
    iVar18 = (uVar4 >> 0x17) - 1;
    iVar22 = ((int)(*plVar16 - plVar16[1] >> 4) -
             (uint)*(byte *)(*(longlong *)(lVar11 + 0x20) + 0x71)) + -1;
    if (iVar18 == -1) {
      *(uint **)(param_1 + 0x30) = puVar25;
      if (*(longlong *)(param_1 + 0x38) - *(longlong *)(param_1 + 0x10) <= (longlong)(iVar22 * 0x10)
         ) {
        FUN_140405ae0(param_1,iVar22);
      }
      local_res18 = *(longlong *)(param_1 + 0x18);
      pdVar17 = (double *)(local_res18 + uVar20 * 0x10);
      *(double **)(param_1 + 0x10) = pdVar17 + (longlong)iVar22 * 2;
      iVar18 = iVar22;
    }
    lVar21 = 0;
    lVar12 = local_res18;
    if (0 < iVar18) {
      pdVar5 = pdVar17 + 1;
      do {
        if (lVar21 < iVar22) {
          pdVar8 = (double *)
                   ((longlong)pdVar5 +
                   *plVar16 + (((longlong)iVar22 * -0x10 + -8) - (longlong)pdVar17));
          pdVar5[-1] = *pdVar8;
          *(undefined4 *)pdVar5 = *(undefined4 *)(pdVar8 + 1);
        }
        else {
          *(undefined4 *)pdVar5 = 0;
        }
        lVar21 = lVar21 + 1;
        pdVar5 = pdVar5 + 2;
      } while (lVar21 < iVar18);
    }
  default:
    goto switchD_14040cab2_default;
  }
  iVar18 = FUN_14040bfd0(param_1,pdVar5,pdVar8,pdVar17,uVar7);
  if (iVar18 == 0) {
    FUN_1404056f0(param_1,pdVar5);
  }
  local_res18 = *(longlong *)(param_1 + 0x18);
  lVar12 = local_res18;
  goto switchD_14040cab2_default;
switchD_14040cab2_caseD_1e:
  if (uVar4 >> 0x17 != 0) {
    *(double **)(param_1 + 0x10) = pdVar17 + (ulonglong)(uVar4 >> 0x17) * 2 + -2;
  }
  if (*(longlong *)(param_1 + 0x98) != 0) {
    FUN_14040b010(param_1,lVar12);
  }
  *(uint **)(param_1 + 0x30) = puVar25;
  iVar18 = FUN_140406040(param_1,pdVar17);
  local_res10 = local_res10 + -1;
  if (local_res10 == 0) {
    return;
  }
  if (iVar18 != 0) {
    *(undefined8 *)(param_1 + 0x10) = *(undefined8 *)(*(longlong *)(param_1 + 0x28) + 0x10);
  }
  goto LAB_14040c9f0;
}



ulonglong FUN_14040e060(longlong *param_1)

{
  byte bVar1;
  byte *pbVar2;
  longlong local_res8 [4];
  
  pbVar2 = (byte *)(*(code *)param_1[2])(param_1[4],param_1[3],local_res8);
  if ((pbVar2 != (byte *)0x0) && (local_res8[0] != 0)) {
    param_1[1] = (longlong)pbVar2;
    *param_1 = local_res8[0] + -1;
    bVar1 = *pbVar2;
    param_1[1] = (longlong)(pbVar2 + 1);
    return (ulonglong)bVar1;
  }
  return 0xffffffff;
}



ulonglong FUN_14040e0b0(longlong *param_1)

{
  byte bVar1;
  byte *pbVar2;
  longlong local_res8 [4];
  
  if (*param_1 != 0) {
LAB_14040e108:
    return (ulonglong)*(byte *)param_1[1];
  }
  pbVar2 = (byte *)(*(code *)param_1[2])(param_1[4],param_1[3],local_res8);
  if ((pbVar2 != (byte *)0x0) && (local_res8[0] != 0)) {
    param_1[1] = (longlong)pbVar2;
    *param_1 = local_res8[0] + -1;
    bVar1 = *pbVar2;
    param_1[1] = (longlong)(pbVar2 + 1);
    if (bVar1 != 0xffffffff) {
      *param_1 = local_res8[0];
      param_1[1] = (longlong)pbVar2;
      goto LAB_14040e108;
    }
  }
  return 0xffffffff;
}



void FUN_14040e120(undefined8 param_1,undefined8 *param_2,undefined8 param_3,undefined8 param_4)

{
  param_2[4] = param_1;
  param_2[2] = param_3;
  *param_2 = 0;
  param_2[1] = 0;
  param_2[3] = param_4;
  return;
}



ulonglong FUN_14040e140(ulonglong *param_1,void *param_2,ulonglong param_3)

{
  byte bVar1;
  byte *pbVar2;
  ulonglong _Size;
  ulonglong local_res18;
  
  do {
    if (param_3 == 0) {
      return 0;
    }
    if (*param_1 == 0) {
      pbVar2 = (byte *)(*(code *)param_1[2])(param_1[4],param_1[3],&local_res18);
      if (pbVar2 == (byte *)0x0) {
        return param_3;
      }
      if (local_res18 == 0) {
        return param_3;
      }
      param_1[1] = (ulonglong)pbVar2;
      *param_1 = local_res18 - 1;
      bVar1 = *pbVar2;
      param_1[1] = (ulonglong)(pbVar2 + 1);
      if (bVar1 == 0xffffffff) {
        return param_3;
      }
      *param_1 = local_res18;
      param_1[1] = (ulonglong)pbVar2;
    }
    if (*(byte *)param_1[1] == 0xffffffff) {
      return param_3;
    }
    _Size = *param_1;
    if (param_3 <= *param_1) {
      _Size = param_3;
    }
    memcpy(param_2,(byte *)param_1[1],_Size);
    *param_1 = *param_1 - _Size;
    param_1[1] = param_1[1] + _Size;
    param_2 = (void *)((longlong)param_2 + _Size);
    param_3 = param_3 - _Size;
  } while( true );
}



undefined8 FUN_14040e200(undefined8 param_1,undefined8 *param_2,ulonglong param_3)

{
  undefined8 uVar1;
  
  if (param_3 <= (ulonglong)param_2[2]) {
    return *param_2;
  }
  if (param_3 < 0x20) {
    param_3 = 0x20;
  }
  if (param_3 + 1 < 0xfffffffffffffffe) {
    uVar1 = FUN_1404069e0(param_1,*param_2,param_2[2],param_3);
    param_2[2] = param_3;
    *param_2 = uVar1;
    return uVar1;
  }
  uVar1 = FUN_1404069c0();
  param_2[2] = param_3;
  *param_2 = uVar1;
  return uVar1;
}



void FUN_14040e280(longlong param_1,undefined8 *param_2)

{
  undefined4 uVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong local_res8;
  
  if ((param_1 == 0) || (plVar2 = (longlong *)(param_1 + 0x18), plVar2 == (longlong *)0x0)) {
    local_res8 = 0;
    if (*(int *)((longlong)param_2 + 0x1c) != 0) {
      return;
    }
    uVar4 = param_2[2];
    lVar3 = 8;
    plVar2 = &local_res8;
  }
  else {
    local_res8 = *(longlong *)(param_1 + 0x10) + 1;
    if (*(int *)((longlong)param_2 + 0x1c) == 0) {
      uVar1 = (*(code *)param_2[1])(*param_2,&local_res8,8,param_2[2]);
      *(undefined4 *)((longlong)param_2 + 0x1c) = uVar1;
    }
    if (*(int *)((longlong)param_2 + 0x1c) != 0) {
      return;
    }
    uVar4 = param_2[2];
    lVar3 = local_res8;
  }
  uVar1 = (*(code *)param_2[1])(*param_2,plVar2,lVar3,uVar4);
  *(undefined4 *)((longlong)param_2 + 0x1c) = uVar1;
  return;
}



void FUN_14040e310(longlong param_1,undefined8 *param_2)

{
  int iVar1;
  longlong lVar2;
  undefined4 uVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  undefined8 uVar7;
  undefined8 local_res8;
  
  iVar1 = *(int *)(param_1 + 0x4c);
  lVar5 = (longlong)iVar1;
  local_res8 = CONCAT44(local_res8._4_4_,iVar1);
  if (*(int *)((longlong)param_2 + 0x1c) == 0) {
    uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,4,param_2[2]);
    *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
  }
  lVar4 = 0;
  lVar6 = lVar4;
  if (0 < iVar1) {
    do {
      lVar2 = *(longlong *)(param_1 + 0x10);
      local_res8 = CONCAT71(local_res8._1_7_,*(undefined1 *)(lVar6 + 8 + lVar2));
      if (*(int *)((longlong)param_2 + 0x1c) == 0) {
        uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,1,param_2[2]);
        *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
      }
      iVar1 = *(int *)(lVar6 + 8 + lVar2);
      if (iVar1 == 1) {
        local_res8 = CONCAT71(local_res8._1_7_,*(undefined1 *)(lVar6 + lVar2));
        if (*(int *)((longlong)param_2 + 0x1c) == 0) {
          uVar7 = 1;
LAB_14040e3e1:
          uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,uVar7,param_2[2]);
          *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
        }
      }
      else if (iVar1 == 3) {
        local_res8 = *(undefined8 *)(lVar6 + lVar2);
        if (*(int *)((longlong)param_2 + 0x1c) == 0) {
          uVar7 = 8;
          goto LAB_14040e3e1;
        }
      }
      else if (iVar1 == 4) {
        FUN_14040e280(*(undefined8 *)(lVar6 + lVar2),param_2);
      }
      lVar5 = lVar5 + -1;
      lVar6 = lVar6 + 0x10;
    } while (lVar5 != 0);
  }
  iVar1 = *(int *)(param_1 + 0x58);
  local_res8 = CONCAT44(local_res8._4_4_,iVar1);
  if (*(int *)((longlong)param_2 + 0x1c) == 0) {
    uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,4,param_2[2]);
    *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
  }
  if (0 < (longlong)iVar1) {
    do {
      FUN_14040e6d0(*(undefined8 *)(*(longlong *)(param_1 + 0x20) + lVar4 * 8),
                    *(undefined8 *)(param_1 + 0x40),param_2);
      lVar4 = lVar4 + 1;
    } while (lVar4 < iVar1);
  }
  return;
}



void FUN_14040e460(longlong param_1,undefined8 *param_2)

{
  undefined8 uVar1;
  longlong lVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  longlong lVar6;
  longlong lVar7;
  longlong lVar8;
  longlong local_res8;
  undefined4 local_res10 [2];
  longlong local_res18;
  
  lVar7 = 0;
  iVar5 = 0;
  iVar4 = iVar5;
  if (*(int *)(param_2 + 3) == 0) {
    iVar4 = *(int *)(param_1 + 0x54);
  }
  uVar1 = *(undefined8 *)(param_1 + 0x28);
  local_res8 = CONCAT44(local_res8._4_4_,iVar4);
  if (*(int *)((longlong)param_2 + 0x1c) == 0) {
    uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,4,param_2[2]);
    *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
  }
  if (*(int *)((longlong)param_2 + 0x1c) == 0) {
    uVar3 = (*(code *)param_2[1])(*param_2,uVar1,(longlong)iVar4 << 2,param_2[2]);
    *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
  }
  if (*(int *)(param_2 + 3) == 0) {
    iVar5 = *(int *)(param_1 + 0x5c);
  }
  local_res8 = CONCAT44(local_res8._4_4_,iVar5);
  if (*(int *)((longlong)param_2 + 0x1c) == 0) {
    uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,4,param_2[2]);
    *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
  }
  lVar8 = (longlong)iVar5;
  lVar6 = lVar7;
  if (0 < iVar5) {
    do {
      lVar2 = *(longlong *)(lVar6 + *(longlong *)(param_1 + 0x30));
      if ((lVar2 == 0) || (lVar2 + 0x18 == 0)) {
        local_res18 = 0;
        if (*(int *)((longlong)param_2 + 0x1c) == 0) {
          uVar3 = (*(code *)param_2[1])(*param_2,&local_res18,8,param_2[2]);
LAB_14040e588:
          *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
        }
      }
      else {
        local_res18 = *(longlong *)(lVar2 + 0x10) + 1;
        if (*(int *)((longlong)param_2 + 0x1c) == 0) {
          iVar4 = (*(code *)param_2[1])(*param_2,&local_res18,8,param_2[2]);
          *(int *)((longlong)param_2 + 0x1c) = iVar4;
          if (iVar4 == 0) {
            uVar3 = (*(code *)param_2[1])(*param_2,lVar2 + 0x18,local_res18,param_2[2]);
            goto LAB_14040e588;
          }
        }
      }
      local_res8 = CONCAT44(local_res8._4_4_,
                            *(undefined4 *)(*(longlong *)(param_1 + 0x30) + 8 + lVar6));
      if (*(int *)((longlong)param_2 + 0x1c) == 0) {
        uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,4,param_2[2]);
        *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
      }
      local_res10[0] = *(undefined4 *)(*(longlong *)(param_1 + 0x30) + 0xc + lVar6);
      if (*(int *)((longlong)param_2 + 0x1c) == 0) {
        uVar3 = (*(code *)param_2[1])(*param_2,local_res10,4,param_2[2]);
        *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
      }
      lVar8 = lVar8 + -1;
      lVar6 = lVar6 + 0x10;
    } while (lVar8 != 0);
  }
  iVar4 = 0;
  if (*(int *)(param_2 + 3) == 0) {
    iVar4 = *(int *)(param_1 + 0x48);
  }
  local_res8 = CONCAT44(local_res8._4_4_,iVar4);
  if (*(int *)((longlong)param_2 + 0x1c) == 0) {
    uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,4,param_2[2]);
    *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
  }
  if (0 < iVar4) {
    do {
      lVar6 = *(longlong *)(*(longlong *)(param_1 + 0x38) + lVar7 * 8);
      if ((lVar6 == 0) || (lVar6 + 0x18 == 0)) {
        local_res8 = 0;
        if (*(int *)((longlong)param_2 + 0x1c) == 0) {
          uVar3 = (*(code *)param_2[1])(*param_2,&local_res8,8,param_2[2]);
LAB_14040e6a8:
          *(undefined4 *)((longlong)param_2 + 0x1c) = uVar3;
        }
      }
      else {
        local_res8 = *(longlong *)(lVar6 + 0x10) + 1;
        if (*(int *)((longlong)param_2 + 0x1c) == 0) {
          iVar5 = (*(code *)param_2[1])(*param_2,&local_res8,8,param_2[2]);
          *(int *)((longlong)param_2 + 0x1c) = iVar5;
          if (iVar5 == 0) {
            uVar3 = (*(code *)param_2[1])(*param_2,lVar6 + 0x18,local_res8,param_2[2]);
            goto LAB_14040e6a8;
          }
        }
      }
      lVar7 = lVar7 + 1;
    } while (lVar7 < iVar4);
  }
  return;
}



void FUN_14040e6d0(longlong param_1,longlong param_2,undefined8 *param_3)

{
  undefined8 uVar1;
  undefined4 uVar2;
  int iVar3;
  longlong lVar4;
  int local_res8 [2];
  
  lVar4 = *(longlong *)(param_1 + 0x40);
  if ((lVar4 == param_2) || (*(int *)(param_3 + 3) != 0)) {
    lVar4 = 0;
  }
  FUN_14040e280(lVar4,param_3);
  local_res8[0] = *(int *)(param_1 + 0x60);
  if (*(int *)((longlong)param_3 + 0x1c) == 0) {
    uVar2 = (*(code *)param_3[1])(*param_3,local_res8,4,param_3[2]);
    *(undefined4 *)((longlong)param_3 + 0x1c) = uVar2;
  }
  local_res8[0] = *(int *)(param_1 + 100);
  if (*(int *)((longlong)param_3 + 0x1c) == 0) {
    uVar2 = (*(code *)param_3[1])(*param_3,local_res8,4,param_3[2]);
    *(undefined4 *)((longlong)param_3 + 0x1c) = uVar2;
  }
  if (*(int *)((longlong)param_3 + 0x1c) == 0) {
    local_res8[0]._0_1_ = *(undefined1 *)(param_1 + 0x70);
    uVar2 = (*(code *)param_3[1])(*param_3,local_res8,1,param_3[2]);
    *(undefined4 *)((longlong)param_3 + 0x1c) = uVar2;
  }
  local_res8[0]._0_1_ = *(undefined1 *)(param_1 + 0x71);
  if (*(int *)((longlong)param_3 + 0x1c) == 0) {
    uVar2 = (*(code *)param_3[1])(*param_3,local_res8,1,param_3[2]);
    *(undefined4 *)((longlong)param_3 + 0x1c) = uVar2;
  }
  local_res8[0]._0_1_ = *(undefined1 *)(param_1 + 0x72);
  if (*(int *)((longlong)param_3 + 0x1c) == 0) {
    uVar2 = (*(code *)param_3[1])(*param_3,local_res8,1,param_3[2]);
    *(undefined4 *)((longlong)param_3 + 0x1c) = uVar2;
  }
  local_res8[0] = CONCAT31(local_res8[0]._1_3_,*(undefined1 *)(param_1 + 0x73));
  if (*(int *)((longlong)param_3 + 0x1c) == 0) {
    uVar2 = (*(code *)param_3[1])(*param_3,local_res8,1,param_3[2]);
    *(undefined4 *)((longlong)param_3 + 0x1c) = uVar2;
  }
  local_res8[0] = *(int *)(param_1 + 0x50);
  lVar4 = (longlong)local_res8[0];
  uVar1 = *(undefined8 *)(param_1 + 0x18);
  if (*(int *)((longlong)param_3 + 0x1c) == 0) {
    iVar3 = (*(code *)param_3[1])(*param_3,local_res8,4,param_3[2]);
    *(int *)((longlong)param_3 + 0x1c) = iVar3;
    if (iVar3 == 0) {
      uVar2 = (*(code *)param_3[1])(*param_3,uVar1,lVar4 << 2,param_3[2]);
      *(undefined4 *)((longlong)param_3 + 0x1c) = uVar2;
    }
  }
  FUN_14040e310(param_1,param_3);
  FUN_14040e460(param_1,param_3);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_14040e860(undefined8 param_1,undefined8 param_2,code *param_3,undefined8 param_4,
                 undefined4 param_5)

{
  undefined1 auStack_68 [32];
  undefined8 local_48;
  code *local_40;
  undefined8 local_38;
  undefined4 local_30;
  int local_2c;
  undefined1 local_28 [16];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  local_30 = param_5;
  local_2c = 0;
  local_48 = param_1;
  local_40 = param_3;
  local_38 = param_4;
  FUN_140412bd0(local_28);
  if (local_2c == 0) {
    local_2c = (*local_40)(local_48,local_28,0xc,local_38);
  }
  FUN_14040e6d0(param_2,0,&local_48);
  return local_2c;
}



void FUN_14040e8f0(longlong param_1,int param_2,undefined4 param_3,int param_4)

{
  undefined8 uVar1;
  undefined8 uVar2;
  
  if (*(int *)(param_1 + 0x10) == param_2) {
    FUN_1404084c0();
    return;
  }
  if (param_4 == *(int *)(param_1 + 4)) {
    uVar1 = FUN_140406e60();
    uVar1 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar1);
    FUN_140407020(param_1,uVar1);
    return;
  }
  uVar1 = FUN_140406e60(param_1,param_3);
  uVar2 = FUN_140406e60(param_1,param_2);
  uVar1 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),
                        "\'%s\' expected (to close \'%s\' at line %d)",uVar2,uVar1,param_4);
  FUN_140407020(param_1,uVar1);
  return;
}



int FUN_14040e9b0(longlong param_1,longlong param_2)

{
  int iVar1;
  longlong *plVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  uint uVar6;
  ulonglong uVar7;
  
  plVar2 = *(longlong **)(param_1 + 0x30);
  lVar3 = *plVar2;
  iVar1 = *(int *)(lVar3 + 0x5c);
  uVar7 = (ulonglong)iVar1;
  if (iVar1 < (short)plVar2[9] + 1) {
    uVar4 = FUN_140406a50(*(undefined8 *)(param_1 + 0x38),*(undefined8 *)(lVar3 + 0x30),lVar3 + 0x5c
                          ,0x10,0x7fff,"too many local variables");
    *(undefined8 *)(lVar3 + 0x30) = uVar4;
  }
  if (iVar1 < *(int *)(lVar3 + 0x5c)) {
    lVar5 = uVar7 << 4;
    do {
      uVar6 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar6;
      *(undefined8 *)(lVar5 + *(longlong *)(lVar3 + 0x30)) = 0;
      lVar5 = lVar5 + 0x10;
    } while ((int)uVar6 < *(int *)(lVar3 + 0x5c));
  }
  *(longlong *)(*(longlong *)(lVar3 + 0x30) + (longlong)(short)plVar2[9] * 0x10) = param_2;
  if (((*(byte *)(param_2 + 9) & 3) != 0) && ((*(byte *)(lVar3 + 9) & 4) != 0)) {
    FUN_14040acd0(*(undefined8 *)(param_1 + 0x38),lVar3,param_2);
  }
  lVar3 = plVar2[9];
  *(short *)(plVar2 + 9) = (short)lVar3 + 1;
  return (int)(short)lVar3;
}



void FUN_14040ea90(longlong param_1,undefined8 param_2,int param_3)

{
  longlong *plVar1;
  undefined2 uVar2;
  undefined8 uVar3;
  
  plVar1 = *(longlong **)(param_1 + 0x30);
  if (200 < (int)(*(byte *)((longlong)plVar1 + 0x4a) + 1 + param_3)) {
    if (*(int *)(*plVar1 + 0x60) == 0) {
      uVar3 = FUN_14040b860(plVar1[4],"main function has more than %d %s",200,"local variables");
    }
    else {
      uVar3 = FUN_14040b860(plVar1[4],"function at line %d has more than %d %s",
                            *(int *)(*plVar1 + 0x60),200,"local variables");
    }
    FUN_140406f70(plVar1[3],uVar3,0);
  }
  uVar2 = FUN_14040e9b0(param_1,param_2);
  *(undefined2 *)
   ((longlong)plVar1 +
   ((ulonglong)*(byte *)((longlong)plVar1 + 0x4a) + (longlong)param_3) * 2 + 0xc4) = uVar2;
  return;
}



uint FUN_14040eb50(longlong *param_1,longlong param_2,uint *param_3)

{
  byte bVar1;
  int iVar2;
  longlong lVar3;
  undefined8 uVar4;
  longlong lVar5;
  byte *pbVar6;
  ulonglong uVar7;
  uint uVar8;
  
  lVar3 = *param_1;
  uVar8 = 0;
  iVar2 = *(int *)(lVar3 + 0x48);
  uVar7 = (ulonglong)iVar2;
  if (*(byte *)(lVar3 + 0x70) != 0) {
    pbVar6 = (byte *)((longlong)param_1 + 0x4c);
    do {
      if (((uint)pbVar6[-1] == *param_3) && ((uint)*pbVar6 == param_3[2])) {
        return uVar8;
      }
      uVar8 = uVar8 + 1;
      pbVar6 = pbVar6 + 2;
    } while ((int)uVar8 < (int)(uint)*(byte *)(lVar3 + 0x70));
  }
  if (0x3c < *(byte *)(lVar3 + 0x70) + 1) {
    if (*(int *)(lVar3 + 0x60) == 0) {
      uVar4 = FUN_14040b860(param_1[4],"main function has more than %d %s",0x3c,"upvalues");
    }
    else {
      uVar4 = FUN_14040b860(param_1[4],"function at line %d has more than %d %s",
                            *(int *)(lVar3 + 0x60),0x3c,"upvalues");
    }
    FUN_140406f70(param_1[3],uVar4,0);
  }
  if (*(int *)(lVar3 + 0x48) < (int)(*(byte *)(lVar3 + 0x70) + 1)) {
    uVar4 = FUN_140406a50(param_1[4],*(undefined8 *)(lVar3 + 0x38),lVar3 + 0x48,8,0x7ffffffd,
                          &DAT_14047e238);
    *(undefined8 *)(lVar3 + 0x38) = uVar4;
  }
  if (iVar2 < *(int *)(lVar3 + 0x48)) {
    lVar5 = uVar7 << 3;
    do {
      uVar8 = (int)uVar7 + 1;
      uVar7 = (ulonglong)uVar8;
      *(undefined8 *)(lVar5 + *(longlong *)(lVar3 + 0x38)) = 0;
      lVar5 = lVar5 + 8;
    } while ((int)uVar8 < *(int *)(lVar3 + 0x48));
  }
  *(longlong *)(*(longlong *)(lVar3 + 0x38) + (ulonglong)*(byte *)(lVar3 + 0x70) * 8) = param_2;
  if (((*(byte *)(param_2 + 9) & 3) != 0) && ((*(byte *)(lVar3 + 9) & 4) != 0)) {
    FUN_14040acd0(param_1[4],lVar3,param_2);
  }
  *(char *)((longlong)param_1 + (ulonglong)*(byte *)(lVar3 + 0x70) * 2 + 0x4b) = (char)*param_3;
  *(char *)((longlong)param_1 + (ulonglong)*(byte *)(lVar3 + 0x70) * 2 + 0x4c) = (char)param_3[2];
  bVar1 = *(byte *)(lVar3 + 0x70);
  *(byte *)(lVar3 + 0x70) = bVar1 + 1;
  return (uint)bVar1;
}



undefined4 FUN_14040ecf0(longlong *param_1,longlong param_2,undefined4 *param_3,int param_4)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong *plVar3;
  int iVar4;
  ushort *puVar5;
  
  if (param_1 == (longlong *)0x0) {
    *(undefined8 *)(param_3 + 4) = 0xffffffffffffffff;
    *param_3 = 8;
    param_3[2] = 0xff;
  }
  else {
    iVar4 = *(byte *)((longlong)param_1 + 0x4a) - 1;
    lVar2 = (longlong)iVar4;
    if (-1 < iVar4) {
      puVar5 = (ushort *)((longlong)param_1 + lVar2 * 2 + 0xc4);
      do {
        if (param_2 == *(longlong *)(*(longlong *)(*param_1 + 0x30) + (ulonglong)*puVar5 * 0x10)) {
          if (-1 < iVar4) {
            *(undefined8 *)(param_3 + 4) = 0xffffffffffffffff;
            *param_3 = 6;
            param_3[2] = iVar4;
            if ((param_4 == 0) && (plVar3 = (longlong *)param_1[5], plVar3 != (longlong *)0x0)) {
              while (iVar4 < (int)(uint)*(byte *)((longlong)plVar3 + 0xc)) {
                plVar3 = (longlong *)*plVar3;
                if (plVar3 == (longlong *)0x0) {
                  return 6;
                }
              }
              *(undefined1 *)((longlong)plVar3 + 0xd) = 1;
            }
            return 6;
          }
          break;
        }
        iVar4 = iVar4 + -1;
        puVar5 = puVar5 + -1;
        lVar2 = lVar2 + -1;
      } while (-1 < lVar2);
    }
    iVar4 = FUN_14040ecf0(param_1[2],param_2,param_3,0);
    if (iVar4 != 8) {
      uVar1 = FUN_14040eb50(param_1,param_2,param_3);
      *param_3 = 7;
      param_3[2] = uVar1;
      return 7;
    }
  }
  return 8;
}



void FUN_14040ee20(longlong param_1,longlong param_2)

{
  undefined8 uVar1;
  undefined8 uVar2;
  int iVar3;
  undefined4 uVar4;
  
  if (*(int *)(param_1 + 0x10) != 0x11d) {
    uVar2 = FUN_140406e60(param_1,0x11d);
    uVar2 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar2);
    FUN_140407020(param_1,uVar2);
  }
  uVar2 = *(undefined8 *)(param_1 + 0x18);
  FUN_1404084c0(param_1);
  uVar1 = *(undefined8 *)(param_1 + 0x30);
  iVar3 = FUN_14040ecf0(uVar1,uVar2,param_2,1);
  if (iVar3 == 8) {
    uVar4 = FUN_140413250(uVar1,uVar2);
    *(undefined4 *)(param_2 + 8) = uVar4;
  }
  return;
}



void FUN_14040eeb0(longlong param_1)

{
  byte bVar1;
  byte bVar2;
  undefined8 *puVar3;
  longlong *plVar4;
  
  puVar3 = *(undefined8 **)(param_1 + 0x28);
  *(undefined8 *)(param_1 + 0x28) = *puVar3;
  bVar1 = *(byte *)((longlong)puVar3 + 0xc);
  plVar4 = *(longlong **)(*(longlong *)(param_1 + 0x18) + 0x30);
  bVar2 = *(byte *)((longlong)plVar4 + 0x4a);
  while (bVar1 < bVar2) {
    *(char *)((longlong)plVar4 + 0x4a) = *(char *)((longlong)plVar4 + 0x4a) + -1;
    *(int *)(*(longlong *)(*plVar4 + 0x30) + 0xc +
            (ulonglong)
            *(ushort *)((longlong)plVar4 + (ulonglong)*(byte *)((longlong)plVar4 + 0x4a) * 2 + 0xc4)
            * 0x10) = (int)plVar4[6];
    bVar2 = *(byte *)((longlong)plVar4 + 0x4a);
  }
  if (*(char *)((longlong)puVar3 + 0xd) != '\0') {
    FUN_140413660(param_1,0x23,*(undefined1 *)((longlong)puVar3 + 0xc),0,0);
  }
  *(uint *)(param_1 + 0x3c) = (uint)*(byte *)(param_1 + 0x4a);
  FUN_1404138b0(param_1,*(undefined4 *)(puVar3 + 1));
  return;
}



void FUN_14040ef50(longlong param_1,longlong *param_2,undefined4 *param_3)

{
  longlong *plVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  longlong lVar5;
  int iVar6;
  uint uVar7;
  ulonglong uVar8;
  char *pcVar9;
  int iVar10;
  
  plVar1 = *(longlong **)(param_1 + 0x30);
  lVar2 = *plVar1;
  iVar10 = *(int *)(lVar2 + 0x58);
  uVar8 = (ulonglong)iVar10;
  if (iVar10 < *(int *)((longlong)plVar1 + 0x44) + 1) {
    uVar4 = FUN_140406a50(*(undefined8 *)(param_1 + 0x38),*(undefined8 *)(lVar2 + 0x20),lVar2 + 0x58
                          ,8,0x3ffff,"constant table overflow");
    *(undefined8 *)(lVar2 + 0x20) = uVar4;
  }
  if (iVar10 < *(int *)(lVar2 + 0x58)) {
    lVar5 = uVar8 << 3;
    do {
      uVar7 = (int)uVar8 + 1;
      uVar8 = (ulonglong)uVar7;
      *(undefined8 *)(lVar5 + *(longlong *)(lVar2 + 0x20)) = 0;
      lVar5 = lVar5 + 8;
    } while ((int)uVar7 < *(int *)(lVar2 + 0x58));
  }
  *(longlong *)(*(longlong *)(lVar2 + 0x20) + (longlong)*(int *)((longlong)plVar1 + 0x44) * 8) =
       *param_2;
  *(int *)((longlong)plVar1 + 0x44) = *(int *)((longlong)plVar1 + 0x44) + 1;
  if (((*(byte *)(*param_2 + 9) & 3) != 0) && ((*(byte *)(lVar2 + 9) & 4) != 0)) {
    FUN_14040acd0(*(undefined8 *)(param_1 + 0x38),lVar2);
  }
  uVar3 = FUN_140413690(plVar1,0x24,0,*(int *)((longlong)plVar1 + 0x44) + -1);
  *(undefined8 *)(param_3 + 4) = 0xffffffffffffffff;
  *param_3 = 0xb;
  param_3[2] = uVar3;
  if (*(char *)(*param_2 + 0x70) != '\0') {
    pcVar9 = (char *)((longlong)param_2 + 0x4b);
    iVar10 = 0;
    do {
      iVar6 = 4;
      if (*pcVar9 == '\x06') {
        iVar6 = 0;
      }
      FUN_140413660(plVar1,iVar6,0,pcVar9[1],0);
      iVar10 = iVar10 + 1;
      pcVar9 = pcVar9 + 2;
    } while (iVar10 < (int)(uint)*(byte *)(*param_2 + 0x70));
  }
  return;
}



void FUN_14040f0a0(longlong param_1,longlong *param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  longlong *plVar3;
  longlong lVar4;
  longlong lVar5;
  
  lVar1 = *(longlong *)(param_1 + 0x38);
  lVar4 = FUN_14040b100(lVar1);
  *param_2 = lVar4;
  param_2[2] = *(longlong *)(param_1 + 0x30);
  param_2[3] = param_1;
  param_2[4] = lVar1;
  *(longlong **)(param_1 + 0x30) = param_2;
  *(undefined4 *)(param_2 + 6) = 0;
  *(undefined8 *)((longlong)param_2 + 0x34) = 0xffffffffffffffff;
  *(undefined8 *)((longlong)param_2 + 0x3c) = 0;
  *(undefined4 *)((longlong)param_2 + 0x44) = 0;
  *(undefined2 *)(param_2 + 9) = 0;
  *(undefined1 *)((longlong)param_2 + 0x4a) = 0;
  param_2[5] = 0;
  uVar2 = *(undefined8 *)(param_1 + 0x50);
  *(undefined1 *)(lVar4 + 0x73) = 2;
  *(undefined8 *)(lVar4 + 0x40) = uVar2;
  lVar5 = FUN_140408a50(lVar1,0,0);
  param_2[1] = lVar5;
  plVar3 = *(longlong **)(lVar1 + 0x10);
  *plVar3 = lVar5;
  *(undefined4 *)(plVar3 + 1) = 5;
  if (*(longlong *)(lVar1 + 0x38) - *(longlong *)(lVar1 + 0x10) < 0x11) {
    FUN_140405ae0(lVar1,1);
  }
  *(longlong *)(lVar1 + 0x10) = *(longlong *)(lVar1 + 0x10) + 0x10;
  plVar3 = *(longlong **)(lVar1 + 0x10);
  *plVar3 = lVar4;
  *(undefined4 *)(plVar3 + 1) = 9;
  if (*(longlong *)(lVar1 + 0x38) - *(longlong *)(lVar1 + 0x10) < 0x11) {
    FUN_140405ae0(lVar1,1);
  }
  *(longlong *)(lVar1 + 0x10) = *(longlong *)(lVar1 + 0x10) + 0x10;
  return;
}



void FUN_14040f190(longlong param_1)

{
  char cVar1;
  longlong *plVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  
  plVar2 = *(longlong **)(param_1 + 0x30);
  lVar3 = *(longlong *)(param_1 + 0x38);
  lVar4 = *plVar2;
  cVar1 = *(char *)((longlong)plVar2 + 0x4a);
  while (cVar1 != '\0') {
    *(char *)((longlong)plVar2 + 0x4a) = *(char *)((longlong)plVar2 + 0x4a) + -1;
    *(int *)(*(longlong *)(*plVar2 + 0x30) + 0xc +
            (ulonglong)
            *(ushort *)((longlong)plVar2 + (ulonglong)*(byte *)((longlong)plVar2 + 0x4a) * 2 + 0xc4)
            * 0x10) = (int)plVar2[6];
    cVar1 = *(char *)((longlong)plVar2 + 0x4a);
  }
  FUN_140413890(plVar2,0,0);
  if ((ulonglong)(longlong)((int)plVar2[6] + 1) < 0x4000000000000000) {
    uVar5 = FUN_1404069e0(lVar3,*(undefined8 *)(lVar4 + 0x18),(longlong)*(int *)(lVar4 + 0x50) << 2,
                          (longlong)(int)plVar2[6] << 2);
  }
  else {
    uVar5 = FUN_1404069c0(lVar3);
  }
  *(undefined8 *)(lVar4 + 0x18) = uVar5;
  *(int *)(lVar4 + 0x50) = (int)plVar2[6];
  if ((ulonglong)(longlong)((int)plVar2[6] + 1) < 0x4000000000000000) {
    uVar5 = FUN_1404069e0(lVar3,*(undefined8 *)(lVar4 + 0x28),(longlong)*(int *)(lVar4 + 0x54) << 2,
                          (longlong)(int)plVar2[6] << 2);
  }
  else {
    uVar5 = FUN_1404069c0(lVar3);
  }
  *(undefined8 *)(lVar4 + 0x28) = uVar5;
  *(int *)(lVar4 + 0x54) = (int)plVar2[6];
  if ((ulonglong)(longlong)((int)plVar2[8] + 1) < 0x1000000000000000) {
    uVar5 = FUN_1404069e0(lVar3,*(undefined8 *)(lVar4 + 0x10),(longlong)*(int *)(lVar4 + 0x4c) << 4,
                          (longlong)(int)plVar2[8] << 4);
  }
  else {
    uVar5 = FUN_1404069c0(lVar3);
  }
  *(undefined8 *)(lVar4 + 0x10) = uVar5;
  *(int *)(lVar4 + 0x4c) = (int)plVar2[8];
  if ((ulonglong)(longlong)(*(int *)((longlong)plVar2 + 0x44) + 1) < 0x2000000000000000) {
    uVar5 = FUN_1404069e0(lVar3,*(undefined8 *)(lVar4 + 0x20),(longlong)*(int *)(lVar4 + 0x58) << 3,
                          (longlong)*(int *)((longlong)plVar2 + 0x44) << 3);
  }
  else {
    uVar5 = FUN_1404069c0(lVar3);
  }
  *(undefined8 *)(lVar4 + 0x20) = uVar5;
  *(undefined4 *)(lVar4 + 0x58) = *(undefined4 *)((longlong)plVar2 + 0x44);
  if ((ulonglong)(longlong)((short)plVar2[9] + 1) < 0x1000000000000000) {
    uVar5 = FUN_1404069e0(lVar3,*(undefined8 *)(lVar4 + 0x30),(longlong)*(int *)(lVar4 + 0x5c) << 4,
                          (longlong)(short)plVar2[9] << 4);
  }
  else {
    uVar5 = FUN_1404069c0(lVar3);
  }
  *(undefined8 *)(lVar4 + 0x30) = uVar5;
  *(int *)(lVar4 + 0x5c) = (int)(short)plVar2[9];
  if ((ulonglong)(longlong)(int)(*(byte *)(lVar4 + 0x70) + 1) < 0x2000000000000000) {
    uVar5 = FUN_1404069e0(lVar3,*(undefined8 *)(lVar4 + 0x38),(longlong)*(int *)(lVar4 + 0x48) << 3,
                          (ulonglong)*(byte *)(lVar4 + 0x70) << 3);
  }
  else {
    uVar5 = FUN_1404069c0(lVar3);
  }
  *(undefined8 *)(lVar4 + 0x38) = uVar5;
  *(uint *)(lVar4 + 0x48) = (uint)*(byte *)(lVar4 + 0x70);
  *(longlong *)(param_1 + 0x30) = plVar2[2];
  *(longlong *)(lVar3 + 0x10) = *(longlong *)(lVar3 + 0x10) + -0x20;
  if ((*(int *)(param_1 + 0x10) == 0x11d) || (*(int *)(param_1 + 0x10) == 0x11e)) {
    FUN_140407030(param_1,*(longlong *)(param_1 + 0x18) + 0x18,
                  *(undefined8 *)(*(longlong *)(param_1 + 0x18) + 0x10));
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14040f3c0(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  undefined8 uVar2;
  undefined1 auStack_58 [32];
  undefined4 local_38 [2];
  undefined4 local_30;
  undefined8 local_28;
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  uVar1 = *(undefined8 *)(param_1 + 0x30);
  FUN_140413e20(uVar1);
  FUN_1404084c0(param_1);
  if (*(int *)(param_1 + 0x10) != 0x11d) {
    uVar2 = FUN_140406e60(param_1,0x11d);
    uVar2 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar2);
    FUN_140407020(param_1,uVar2);
  }
  uVar2 = *(undefined8 *)(param_1 + 0x18);
  FUN_1404084c0(param_1);
  local_30 = FUN_140413250(*(undefined8 *)(param_1 + 0x30),uVar2);
  local_28 = 0xffffffffffffffff;
  local_38[0] = 4;
  FUN_140414690(uVar1,param_2,local_38);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14040f480(longlong param_1,longlong param_2)

{
  undefined4 uVar1;
  longlong *plVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined1 auStack_88 [32];
  char *local_68;
  undefined4 local_58 [2];
  undefined4 local_50;
  undefined8 local_48;
  undefined1 local_40 [24];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  plVar2 = *(longlong **)(param_1 + 0x30);
  uVar1 = *(undefined4 *)((longlong)plVar2 + 0x3c);
  if (*(int *)(param_1 + 0x10) == 0x11d) {
    if (0x7ffffffd < *(int *)(param_2 + 0x20)) {
      if (*(int *)(*plVar2 + 0x60) == 0) {
        uVar5 = FUN_14040b860(plVar2[4],"main function has more than %d %s",0x7ffffffd,
                              "items in a constructor");
      }
      else {
        local_68 = "items in a constructor";
        uVar5 = FUN_14040b860(plVar2[4],"function at line %d has more than %d %s",
                              *(int *)(*plVar2 + 0x60),0x7ffffffd);
      }
      FUN_140406f70(plVar2[3],uVar5,0);
    }
    if (*(int *)(param_1 + 0x10) != 0x11d) {
      uVar5 = FUN_140406e60(param_1,0x11d);
      uVar5 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar5);
      FUN_140407020(param_1,uVar5);
    }
    uVar5 = *(undefined8 *)(param_1 + 0x18);
    FUN_1404084c0(param_1);
    local_50 = FUN_140413250(*(undefined8 *)(param_1 + 0x30),uVar5);
    local_48 = 0xffffffffffffffff;
    local_58[0] = 4;
  }
  else {
    FUN_1404084c0();
    FUN_140410540(param_1,local_58,0);
    FUN_140413e90(*(undefined8 *)(param_1 + 0x30),local_58);
    if (*(int *)(param_1 + 0x10) != 0x5d) {
      uVar5 = FUN_140406e60(param_1,0x5d);
      uVar5 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar5);
      FUN_140407020(param_1,uVar5);
    }
    FUN_1404084c0(param_1);
  }
  *(int *)(param_2 + 0x20) = *(int *)(param_2 + 0x20) + 1;
  if (*(int *)(param_1 + 0x10) != 0x3d) {
    uVar5 = FUN_140406e60(param_1,0x3d);
    uVar5 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar5);
    FUN_140407020(param_1,uVar5);
  }
  FUN_1404084c0(param_1);
  uVar3 = FUN_140413f10(plVar2,local_58);
  FUN_140410540(param_1,local_40,0);
  uVar4 = FUN_140413f10(plVar2,local_40);
  local_68 = (char *)CONCAT44(local_68._4_4_,uVar4);
  FUN_140413660(plVar2,9,*(undefined4 *)(*(longlong *)(param_2 + 0x18) + 8),uVar3);
  *(undefined4 *)((longlong)plVar2 + 0x3c) = uVar1;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14040f690(longlong param_1,undefined4 *param_2)

{
  uint *puVar1;
  undefined4 uVar2;
  longlong *plVar3;
  longlong *plVar4;
  longlong lVar5;
  int iVar6;
  undefined8 uVar7;
  longlong lVar8;
  undefined1 auStack_a8 [32];
  char *local_88;
  int local_78 [2];
  undefined4 local_70;
  undefined8 local_68;
  undefined4 *local_60;
  undefined4 local_58;
  int iStack_54;
  int local_50;
  ulonglong local_48;
  
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  plVar3 = *(longlong **)(param_1 + 0x30);
  uVar2 = *(undefined4 *)(param_1 + 4);
  local_88 = (char *)((ulonglong)local_88 & 0xffffffff00000000);
  iVar6 = FUN_140413660(plVar3,10,0,0);
  *(undefined8 *)(param_2 + 4) = 0xffffffffffffffff;
  lVar8 = (longlong)iVar6;
  *param_2 = 0xb;
  param_2[2] = iVar6;
  local_50 = 0;
  local_58 = 0;
  iStack_54 = 0;
  local_68 = 0xffffffffffffffff;
  local_78[0] = 0;
  local_70 = 0;
  local_60 = param_2;
  FUN_140413d90(*(undefined8 *)(param_1 + 0x30),param_2);
  if (*(int *)(param_1 + 0x10) != 0x7b) {
    uVar7 = FUN_140406e60(param_1,0x7b);
    uVar7 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar7);
    FUN_140407020(param_1,uVar7);
  }
  FUN_1404084c0(param_1);
  while (*(int *)(param_1 + 0x10) != 0x7d) {
    if (local_78[0] != 0) {
      FUN_140413d90(plVar3,local_78);
      local_78[0] = 0;
      if (local_50 == 0x32) {
        FUN_1404136b0(plVar3,local_60[2],iStack_54,0x32);
        local_50 = 0;
      }
    }
    if ((*(int *)(param_1 + 0x10) == 0x5b) ||
       ((*(int *)(param_1 + 0x10) == 0x11d &&
        (FUN_140408510(param_1), *(int *)(param_1 + 0x20) == 0x3d)))) {
      FUN_14040f480(param_1,local_78);
    }
    else {
      FUN_140410540(param_1,local_78,0);
      if (0x7ffffffd < iStack_54) {
        plVar4 = *(longlong **)(param_1 + 0x30);
        if (*(int *)(*plVar4 + 0x60) == 0) {
          uVar7 = FUN_14040b860(plVar4[4],"main function has more than %d %s",0x7ffffffd,
                                "items in a constructor");
        }
        else {
          local_88 = "items in a constructor";
          uVar7 = FUN_14040b860(plVar4[4],"function at line %d has more than %d %s",
                                *(int *)(*plVar4 + 0x60),0x7ffffffd);
        }
        FUN_140406f70(plVar4[3],uVar7);
      }
      iStack_54 = 1;
      local_50 = local_50 + 1;
    }
    if (*(int *)(param_1 + 0x10) == 0x2c) {
      FUN_1404084c0(param_1);
    }
    else {
      if (*(int *)(param_1 + 0x10) != 0x3b) break;
      FUN_1404084c0(param_1);
    }
  }
  FUN_14040e8f0(param_1,0x7d,0x7b,uVar2);
  if (local_50 != 0) {
    if ((local_78[0] == 0xd) || (local_78[0] == 0xe)) {
      FUN_1404132b0(plVar3,local_78,0xffffffff);
      FUN_1404136b0(plVar3,local_60[2],iStack_54,0xffffffff);
      iStack_54 = iStack_54 + -1;
    }
    else {
      if (local_78[0] != 0) {
        FUN_140413d90(plVar3,local_78);
      }
      FUN_1404136b0(plVar3,local_60[2],iStack_54,local_50);
    }
  }
  lVar5 = *(longlong *)(*plVar3 + 0x18);
  iVar6 = FUN_14040b2c0(iStack_54);
  *(uint *)(lVar5 + lVar8 * 4) = iVar6 << 0x17 | *(uint *)(lVar5 + lVar8 * 4) & 0x7fffff;
  lVar5 = *(longlong *)(*plVar3 + 0x18);
  iVar6 = FUN_14040b2c0(local_58);
  puVar1 = (uint *)(lVar5 + lVar8 * 4);
  *puVar1 = *puVar1 ^ (iVar6 << 0xe ^ *(uint *)(lVar5 + lVar8 * 4)) & 0x7fc000;
  return;
}



void FUN_14040f960(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined8 uVar4;
  int iVar5;
  
  plVar1 = *(longlong **)(param_1 + 0x30);
  iVar5 = 0;
  lVar2 = *plVar1;
  *(undefined1 *)(lVar2 + 0x72) = 0;
  if (*(int *)(param_1 + 0x10) != 0x29) {
    while (*(int *)(param_1 + 0x10) != 0x117) {
      if (*(int *)(param_1 + 0x10) == 0x11d) {
        uVar4 = *(undefined8 *)(param_1 + 0x18);
        FUN_1404084c0(param_1);
        FUN_14040ea90(param_1,uVar4,iVar5);
        iVar5 = iVar5 + 1;
      }
      else {
        FUN_140407020(param_1,"<name> or \'...\' expected");
      }
      if ((*(char *)(lVar2 + 0x72) != '\0') || (*(int *)(param_1 + 0x10) != 0x2c))
      goto LAB_14040fa1b;
      FUN_1404084c0(param_1);
    }
    FUN_1404084c0(param_1);
    uVar4 = FUN_140407030(param_1,&DAT_140475928,3);
    FUN_14040ea90(param_1,uVar4,iVar5);
    iVar5 = iVar5 + 1;
    *(undefined1 *)(lVar2 + 0x72) = 7;
  }
LAB_14040fa1b:
  plVar3 = *(longlong **)(param_1 + 0x30);
  *(char *)((longlong)plVar3 + 0x4a) = *(char *)((longlong)plVar3 + 0x4a) + (char)iVar5;
  for (; iVar5 != 0; iVar5 = iVar5 + -1) {
    *(int *)(*(longlong *)(*plVar3 + 0x30) + 8 +
            (ulonglong)
            *(ushort *)
             ((longlong)plVar3 +
             ((ulonglong)*(byte *)((longlong)plVar3 + 0x4a) - (longlong)iVar5) * 2 + 0xc4) * 0x10) =
         (int)plVar3[6];
  }
  *(byte *)(lVar2 + 0x71) = *(char *)((longlong)plVar1 + 0x4a) - (*(byte *)(lVar2 + 0x72) & 1);
  FUN_1404130c0(plVar1,*(undefined1 *)((longlong)plVar1 + 0x4a));
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14040fa90(longlong param_1,undefined8 param_2,int param_3,undefined4 param_4)

{
  longlong *plVar1;
  undefined8 uVar2;
  undefined1 auStack_2a8 [32];
  longlong local_288 [76];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_2a8;
  FUN_14040f0a0(param_1,local_288);
  *(undefined4 *)(local_288[0] + 0x60) = param_4;
  if (*(int *)(param_1 + 0x10) != 0x28) {
    uVar2 = FUN_140406e60(param_1,0x28);
    uVar2 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar2);
    FUN_140407020(param_1,uVar2);
  }
  FUN_1404084c0(param_1);
  if (param_3 != 0) {
    uVar2 = FUN_140407030(param_1,&DAT_14047594c,4);
    FUN_14040ea90(param_1,uVar2,0);
    plVar1 = *(longlong **)(param_1 + 0x30);
    *(char *)((longlong)plVar1 + 0x4a) = *(char *)((longlong)plVar1 + 0x4a) + '\x01';
    *(int *)(*(longlong *)(*plVar1 + 0x30) + 8 +
            (ulonglong)
            *(ushort *)((longlong)plVar1 + (ulonglong)*(byte *)((longlong)plVar1 + 0x4a) * 2 + 0xc2)
            * 0x10) = (int)plVar1[6];
  }
  FUN_14040f960(param_1);
  if (*(int *)(param_1 + 0x10) != 0x29) {
    uVar2 = FUN_140406e60(param_1,0x29);
    uVar2 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar2);
    FUN_140407020(param_1,uVar2);
  }
  FUN_1404084c0(param_1);
  FUN_140411f00(param_1);
  *(undefined4 *)(local_288[0] + 100) = *(undefined4 *)(param_1 + 4);
  FUN_14040e8f0(param_1,0x106,0x109,param_4);
  FUN_14040f190(param_1);
  FUN_14040ef50(param_1,local_288,param_2);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14040fc00(longlong param_1,undefined4 *param_2)

{
  int iVar1;
  int iVar2;
  longlong lVar3;
  undefined4 uVar4;
  int iVar5;
  undefined1 auStack_68 [32];
  undefined4 local_48;
  int local_38 [2];
  undefined4 local_30;
  undefined8 local_28;
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  iVar1 = *(int *)(param_1 + 0x10);
  lVar3 = *(longlong *)(param_1 + 0x30);
  iVar2 = *(int *)(param_1 + 4);
  if (iVar1 == 0x28) {
    if (iVar2 != *(int *)(param_1 + 8)) {
      FUN_140407020(param_1,"ambiguous syntax (function call x new statement)");
    }
    FUN_1404084c0(param_1);
    if (*(int *)(param_1 + 0x10) == 0x29) {
      local_38[0] = 0;
    }
    else {
      while (FUN_140410540(param_1,local_38,0), *(int *)(param_1 + 0x10) == 0x2c) {
        FUN_1404084c0(param_1);
        FUN_140413d90(*(undefined8 *)(param_1 + 0x30),local_38);
      }
      FUN_1404132b0(lVar3,local_38,0xffffffff);
    }
    FUN_14040e8f0(param_1,0x29,0x28,iVar2);
  }
  else if (iVar1 == 0x7b) {
    FUN_14040f690(param_1,local_38);
  }
  else {
    if (iVar1 != 0x11e) {
      FUN_140407020(param_1,"function arguments expected");
      return;
    }
    local_30 = FUN_140413250(lVar3,*(undefined8 *)(param_1 + 0x18));
    local_28 = 0xffffffffffffffff;
    local_38[0] = 4;
    FUN_1404084c0(param_1);
  }
  iVar1 = param_2[2];
  if ((local_38[0] == 0xd) || (local_38[0] == 0xe)) {
    iVar5 = -1;
  }
  else {
    if (local_38[0] != 0) {
      FUN_140413d90(lVar3,local_38);
    }
    iVar5 = (*(int *)(lVar3 + 0x3c) - iVar1) + -1;
  }
  local_48 = 2;
  uVar4 = FUN_140413660(lVar3,0x1c,iVar1,iVar5 + 1);
  *(undefined8 *)(param_2 + 4) = 0xffffffffffffffff;
  *param_2 = 0xd;
  param_2[2] = uVar4;
  FUN_140413550(lVar3,iVar2);
  *(int *)(lVar3 + 0x3c) = iVar1 + 1;
  return;
}



void FUN_14040fda0(longlong param_1,undefined8 param_2)

{
  undefined4 uVar1;
  
  if (*(int *)(param_1 + 0x10) == 0x28) {
    uVar1 = *(undefined4 *)(param_1 + 4);
    FUN_1404084c0();
    FUN_140410540(param_1,param_2,0);
    FUN_14040e8f0(param_1,0x29,0x28,uVar1);
    FUN_140413910(*(undefined8 *)(param_1 + 0x30),param_2);
    return;
  }
  if (*(int *)(param_1 + 0x10) != 0x11d) {
    FUN_140407020(param_1,"unexpected symbol");
    return;
  }
  FUN_14040ee20();
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_14040fe30(longlong param_1,undefined8 param_2)

{
  undefined8 uVar1;
  uint uVar2;
  undefined8 uVar3;
  undefined1 auStack_58 [32];
  undefined4 local_38 [2];
  undefined4 local_30;
  undefined8 local_28;
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  uVar1 = *(undefined8 *)(param_1 + 0x30);
  FUN_14040fda0();
  uVar2 = *(int *)(param_1 + 0x10) - 0x28;
  if (uVar2 < 0xf7) {
    do {
      switch(uVar2) {
      case 0:
      case 0x53:
      case 0xf6:
        FUN_140413d90(uVar1,param_2);
        goto LAB_14040ffad;
      default:
        goto switchD_14040fe96_caseD_1;
      case 6:
        FUN_14040f3c0(param_1,param_2);
        break;
      case 0x12:
        FUN_1404084c0(param_1);
        if (*(int *)(param_1 + 0x10) != 0x11d) {
          uVar3 = FUN_140406e60(param_1,0x11d);
          uVar3 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar3);
          FUN_140407020(param_1,uVar3);
        }
        uVar3 = *(undefined8 *)(param_1 + 0x18);
        FUN_1404084c0(param_1);
        local_30 = FUN_140413250(*(undefined8 *)(param_1 + 0x30),uVar3);
        local_28 = 0xffffffffffffffff;
        local_38[0] = 4;
        FUN_140414150(uVar1,param_2);
LAB_14040ffad:
        FUN_14040fc00(param_1,param_2);
        break;
      case 0x33:
        FUN_140413e20(uVar1,param_2);
        FUN_1404084c0(param_1);
        FUN_140410540(param_1,local_38,0);
        FUN_140413e90(*(undefined8 *)(param_1 + 0x30),local_38);
        if (*(int *)(param_1 + 0x10) != 0x5d) {
          uVar3 = FUN_140406e60(param_1,0x5d);
          uVar3 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar3);
          FUN_140407020(param_1,uVar3);
        }
        FUN_1404084c0(param_1);
        FUN_140414690(uVar1,param_2);
      }
      uVar2 = *(int *)(param_1 + 0x10) - 0x28;
    } while (uVar2 < 0xf7);
switchD_14040fe96_caseD_1:
  }
  return;
}



void FUN_140410100(longlong param_1,undefined4 *param_2)

{
  longlong *plVar1;
  undefined4 uVar2;
  
  switch(*(undefined4 *)(param_1 + 0x10)) {
  case 0x7b:
    FUN_14040f690(param_1);
    return;
  default:
    FUN_14040fe30(param_1);
    return;
  case 0x107:
    *(undefined8 *)(param_2 + 4) = 0xffffffffffffffff;
    *param_2 = 3;
    param_2[2] = 0;
    FUN_1404084c0(param_1);
    return;
  case 0x109:
    FUN_1404084c0(param_1);
    FUN_14040fa90(param_1,param_2,0,*(undefined4 *)(param_1 + 4));
    return;
  case 0x10d:
    *(undefined8 *)(param_2 + 4) = 0xffffffffffffffff;
    *param_2 = 1;
    param_2[2] = 0;
    FUN_1404084c0(param_1);
    return;
  case 0x113:
    *(undefined8 *)(param_2 + 4) = 0xffffffffffffffff;
    *param_2 = 2;
    param_2[2] = 0;
    FUN_1404084c0(param_1);
    return;
  case 0x117:
    plVar1 = *(longlong **)(param_1 + 0x30);
    if (*(char *)(*plVar1 + 0x72) == '\0') {
      FUN_140407020(param_1,"cannot use \'...\' outside a vararg function");
    }
    *(byte *)(*plVar1 + 0x72) = *(byte *)(*plVar1 + 0x72) & 0xfb;
    uVar2 = FUN_140413660(plVar1,0x25,0,1,0);
    *param_2 = 0xe;
    break;
  case 0x11c:
    param_2[2] = 0;
    *(undefined8 *)(param_2 + 4) = 0xffffffffffffffff;
    *param_2 = 5;
    *(undefined8 *)(param_2 + 2) = *(undefined8 *)(param_1 + 0x18);
    FUN_1404084c0(param_1);
    return;
  case 0x11e:
    uVar2 = FUN_140413250(*(undefined8 *)(param_1 + 0x30),*(undefined8 *)(param_1 + 0x18));
    *param_2 = 4;
  }
  param_2[2] = uVar2;
  *(undefined8 *)(param_2 + 4) = 0xffffffffffffffff;
  FUN_1404084c0(param_1);
  return;
}



undefined8 FUN_140410380(undefined4 param_1)

{
  switch(param_1) {
  case 0x25:
    return 4;
  default:
    return 0xf;
  case 0x2a:
    return 2;
  case 0x2b:
    return 0;
  case 0x2d:
    return 1;
  case 0x2f:
    return 3;
  case 0x3c:
    return 9;
  case 0x3e:
    return 0xb;
  case 0x5e:
    return 5;
  case 0x101:
    return 0xd;
  case 0x10f:
    return 0xe;
  case 0x116:
    return 6;
  case 0x118:
    return 8;
  case 0x119:
    return 0xc;
  case 0x11a:
    return 10;
  case 0x11b:
    return 7;
  }
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

int FUN_140410540(longlong param_1,undefined8 param_2,uint param_3)

{
  short *psVar1;
  longlong lVar2;
  int iVar3;
  int iVar4;
  undefined8 uVar5;
  undefined1 auStack_68 [32];
  undefined8 local_48;
  undefined1 local_40 [24];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  lVar2 = *(longlong *)(param_1 + 0x38);
  psVar1 = (short *)(lVar2 + 0x60);
  *psVar1 = *psVar1 + 1;
  local_48 = param_2;
  if (200 < *(ushort *)(lVar2 + 0x60)) {
    FUN_140406f70(param_1,"chunk has too many syntax levels",0);
  }
  iVar3 = *(int *)(param_1 + 0x10);
  if (iVar3 == 0x23) {
    uVar5 = 2;
  }
  else if (iVar3 == 0x2d) {
    uVar5 = 0;
  }
  else {
    if (iVar3 != 0x10e) {
      FUN_140410100(param_1,param_2);
      goto LAB_1404105ea;
    }
    uVar5 = 1;
  }
  FUN_1404084c0(param_1);
  FUN_140410540(param_1,param_2,8);
  FUN_1404148a0(*(undefined8 *)(param_1 + 0x30),uVar5,param_2);
LAB_1404105ea:
  iVar3 = FUN_140410380(*(undefined4 *)(param_1 + 0x10));
  while ((iVar3 != 0xf && (param_3 < (byte)(&DAT_1404757e0)[(longlong)iVar3 * 2]))) {
    FUN_1404084c0(param_1);
    FUN_1404149b0(*(undefined8 *)(param_1 + 0x30),iVar3,local_48);
    iVar4 = FUN_140410540(param_1,local_40,(&DAT_1404757e1)[(longlong)iVar3 * 2]);
    FUN_140414a20(*(undefined8 *)(param_1 + 0x30),iVar3,local_48,local_40);
    iVar3 = iVar4;
  }
  psVar1 = (short *)(*(longlong *)(param_1 + 0x38) + 0x60);
  *psVar1 = *psVar1 + -1;
  return iVar3;
}



void FUN_140410690(longlong param_1)

{
  longlong lVar1;
  undefined8 local_18;
  undefined4 local_10;
  undefined1 local_c;
  undefined1 local_b;
  undefined1 local_a;
  
  lVar1 = *(longlong *)(param_1 + 0x30);
  local_10 = 0xffffffff;
  local_a = 0;
  local_c = *(undefined1 *)(lVar1 + 0x4a);
  local_b = 0;
  local_18 = *(undefined8 *)(lVar1 + 0x28);
  *(undefined8 **)(lVar1 + 0x28) = &local_18;
  FUN_140411f00();
  FUN_14040eeb0(lVar1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1404106e0(longlong param_1,longlong *param_2,int param_3)

{
  int *piVar1;
  undefined4 uVar2;
  longlong *plVar3;
  bool bVar4;
  undefined8 uVar5;
  longlong lVar6;
  int iVar7;
  undefined1 auStack_a8 [32];
  char *local_88;
  longlong local_78;
  int local_70;
  longlong *local_68;
  longlong *local_60;
  int local_58 [2];
  int local_50;
  int local_40 [2];
  int local_38;
  undefined8 local_30;
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_a8;
  local_68 = param_2 + 1;
  local_70 = param_3;
  if (((int)*local_68 < 6) || (9 < (int)*local_68)) {
    FUN_140407020(param_1,"syntax error");
  }
  if (*(int *)(param_1 + 0x10) == 0x2c) {
    FUN_1404084c0(param_1);
    local_60 = param_2;
    FUN_14040fe30(param_1,local_58);
    if (local_58[0] == 6) {
      local_78 = *(longlong *)(param_1 + 0x30);
      uVar2 = *(undefined4 *)(local_78 + 0x3c);
      bVar4 = false;
      do {
        if ((int)param_2[1] == 9) {
          if ((int)param_2[2] == local_50) {
            *(undefined4 *)(param_2 + 2) = uVar2;
            bVar4 = true;
          }
          if (*(int *)((longlong)param_2 + 0x14) == local_50) {
            *(undefined4 *)((longlong)param_2 + 0x14) = uVar2;
            bVar4 = true;
          }
        }
        param_2 = (longlong *)*param_2;
      } while (param_2 != (longlong *)0x0);
      if (bVar4) {
        local_88 = (char *)((ulonglong)local_88 & 0xffffffff00000000);
        FUN_140413660(local_78,0,*(undefined4 *)(local_78 + 0x3c));
        FUN_1404130c0(local_78,1);
      }
    }
    iVar7 = 200 - (uint)*(ushort *)(*(longlong *)(param_1 + 0x38) + 0x60);
    if (iVar7 < param_3) {
      plVar3 = *(longlong **)(param_1 + 0x30);
      if (*(int *)(*plVar3 + 0x60) == 0) {
        uVar5 = FUN_14040b860(plVar3[4],"main function has more than %d %s",iVar7,
                              "variables in assignment");
      }
      else {
        local_88 = "variables in assignment";
        uVar5 = FUN_14040b860(plVar3[4],"function at line %d has more than %d %s",
                              *(int *)(*plVar3 + 0x60),iVar7);
      }
      FUN_140406f70(plVar3[3],uVar5,0);
    }
    FUN_1404106e0(param_1,&local_60,param_3 + 1);
  }
  else {
    if (*(int *)(param_1 + 0x10) != 0x3d) {
      uVar5 = FUN_140406e60(param_1,0x3d);
      uVar5 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar5);
      FUN_140407020(param_1,uVar5);
    }
    FUN_1404084c0(param_1);
    iVar7 = 1;
    FUN_140410540(param_1,local_40,0);
    while (*(int *)(param_1 + 0x10) == 0x2c) {
      FUN_1404084c0(param_1);
      FUN_140413d90(*(undefined8 *)(param_1 + 0x30),local_40);
      FUN_140410540(param_1,local_40,0);
      iVar7 = iVar7 + 1;
    }
    lVar6 = *(longlong *)(param_1 + 0x30);
    if (iVar7 == param_3) {
      FUN_140413340(lVar6,local_40);
      lVar6 = *(longlong *)(param_1 + 0x30);
      goto LAB_14041098d;
    }
    param_3 = param_3 - iVar7;
    local_78 = lVar6;
    if ((local_40[0] == 0xd) || (local_40[0] == 0xe)) {
      param_3 = param_3 + 1;
      if (param_3 < 0) {
        param_3 = 0;
      }
      FUN_1404132b0(lVar6,local_40,param_3);
      if (1 < param_3) {
        FUN_1404130c0(local_78,param_3 + -1);
      }
    }
    else {
      if (local_40[0] != 0) {
        FUN_140413d90(lVar6,local_40);
      }
      if (0 < param_3) {
        uVar2 = *(undefined4 *)(local_78 + 0x3c);
        FUN_1404130c0(local_78,param_3);
        FUN_140413750(local_78,uVar2,param_3);
      }
    }
    if (local_70 < iVar7) {
      piVar1 = (int *)(*(longlong *)(param_1 + 0x30) + 0x3c);
      *piVar1 = *piVar1 + (local_70 - iVar7);
    }
  }
  lVar6 = *(longlong *)(param_1 + 0x30);
  local_30 = 0xffffffffffffffff;
  local_40[0] = 0xc;
  local_38 = *(int *)(lVar6 + 0x3c) + -1;
LAB_14041098d:
  FUN_140414050(lVar6,local_68,local_40);
  return;
}



void FUN_1404109c0(longlong param_1)

{
  longlong lVar1;
  undefined8 *puVar2;
  undefined4 uVar3;
  byte bVar4;
  
  lVar1 = *(longlong *)(param_1 + 0x30);
  bVar4 = 0;
  for (puVar2 = *(undefined8 **)(lVar1 + 0x28); puVar2 != (undefined8 *)0x0;
      puVar2 = (undefined8 *)*puVar2) {
    if (*(char *)((longlong)puVar2 + 0xe) != '\0') goto LAB_140410a00;
    bVar4 = bVar4 | *(byte *)((longlong)puVar2 + 0xd);
  }
  FUN_140407020(param_1,"no loop to break");
LAB_140410a00:
  if (bVar4 != 0) {
    FUN_140413660(lVar1,0x23,*(undefined1 *)((longlong)puVar2 + 0xc),0,0);
  }
  uVar3 = FUN_1404137f0(lVar1);
  FUN_140413010(lVar1,puVar2 + 1,uVar3);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140410a50(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined1 auStack_78 [32];
  undefined8 local_58;
  undefined4 local_50;
  undefined1 local_4c;
  undefined1 local_4b;
  undefined1 local_4a;
  undefined8 local_48;
  undefined4 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined1 local_3a;
  int local_38 [5];
  undefined4 local_24;
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_78;
  lVar1 = *(longlong *)(param_1 + 0x30);
  FUN_1404084c0();
  uVar3 = FUN_140412dc0(lVar1);
  FUN_140410540(param_1,local_38,0);
  if (local_38[0] == 1) {
    local_38[0] = 3;
  }
  FUN_140414350(*(undefined8 *)(param_1 + 0x30),local_38);
  local_40 = 0xffffffff;
  local_3a = 1;
  local_3c = *(undefined1 *)(lVar1 + 0x4a);
  local_3b = 0;
  local_48 = *(undefined8 *)(lVar1 + 0x28);
  *(undefined8 **)(lVar1 + 0x28) = &local_48;
  if (*(int *)(param_1 + 0x10) != 0x103) {
    uVar5 = FUN_140406e60(param_1,0x103);
    uVar5 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar5);
    FUN_140407020(param_1,uVar5);
  }
  FUN_1404084c0(param_1);
  lVar2 = *(longlong *)(param_1 + 0x30);
  local_50 = 0xffffffff;
  local_4a = 0;
  local_4c = *(undefined1 *)(lVar2 + 0x4a);
  local_4b = 0;
  local_58 = *(undefined8 *)(lVar2 + 0x28);
  *(undefined8 **)(lVar2 + 0x28) = &local_58;
  FUN_140411f00(param_1);
  FUN_14040eeb0(lVar2);
  uVar4 = FUN_1404137f0(lVar1);
  FUN_140414cb0(lVar1,uVar4,uVar3);
  FUN_14040e8f0(param_1,0x106,0x115,param_2);
  FUN_14040eeb0(lVar1);
  FUN_1404138b0(lVar1,local_24);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140410bd0(longlong param_1,undefined4 param_2)

{
  longlong lVar1;
  undefined4 uVar2;
  undefined1 auStack_78 [32];
  undefined8 local_58;
  undefined4 local_50;
  undefined1 local_4c;
  char local_4b;
  undefined1 local_4a;
  undefined8 local_48;
  undefined4 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined1 local_3a;
  int local_38 [5];
  undefined4 local_24;
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_78;
  lVar1 = *(longlong *)(param_1 + 0x30);
  uVar2 = FUN_140412dc0(lVar1);
  local_40 = 0xffffffff;
  local_3a = 1;
  local_3c = *(undefined1 *)(lVar1 + 0x4a);
  local_3b = 0;
  local_48 = *(undefined8 *)(lVar1 + 0x28);
  *(undefined8 **)(lVar1 + 0x28) = &local_48;
  local_50 = 0xffffffff;
  local_4a = 0;
  local_4c = *(undefined1 *)(lVar1 + 0x4a);
  local_4b = '\0';
  local_58 = *(undefined8 *)(lVar1 + 0x28);
  *(undefined8 **)(lVar1 + 0x28) = &local_58;
  FUN_1404084c0(param_1);
  FUN_140411f00(param_1);
  FUN_14040e8f0(param_1,0x114,0x110,param_2);
  FUN_140410540(param_1,local_38,0);
  if (local_38[0] == 1) {
    local_38[0] = 3;
  }
  FUN_140414350(*(undefined8 *)(param_1 + 0x30),local_38);
  if (local_4b == '\0') {
    FUN_14040eeb0(lVar1);
  }
  else {
    FUN_1404109c0(param_1);
    FUN_1404138b0(*(undefined8 *)(param_1 + 0x30),local_24);
    FUN_14040eeb0(lVar1);
    local_24 = FUN_1404137f0(lVar1);
  }
  FUN_140414cb0(*(undefined8 *)(param_1 + 0x30),local_24,uVar2);
  FUN_14040eeb0(lVar1);
  return;
}



void FUN_140410d20(longlong param_1,undefined4 param_2,undefined4 param_3,int param_4,int param_5)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined4 uVar3;
  longlong lVar4;
  undefined8 uVar5;
  int iVar6;
  int iVar7;
  longlong lVar8;
  longlong local_38;
  undefined4 local_30;
  undefined1 local_2c;
  undefined1 local_2b;
  undefined1 local_2a;
  undefined8 local_28;
  undefined4 local_20;
  undefined1 local_1c;
  undefined1 local_1b;
  undefined1 local_1a;
  
  plVar1 = *(longlong **)(param_1 + 0x30);
  iVar7 = 3;
  *(char *)((longlong)plVar1 + 0x4a) = *(char *)((longlong)plVar1 + 0x4a) + '\x03';
  lVar8 = 3;
  do {
    lVar4 = (ulonglong)*(byte *)((longlong)plVar1 + 0x4a) - lVar8;
    lVar8 = lVar8 + -1;
    iVar7 = iVar7 + -1;
    *(int *)(*(longlong *)(*plVar1 + 0x30) + 8 +
            (ulonglong)*(ushort *)((longlong)plVar1 + lVar4 * 2 + 0xc4) * 0x10) = (int)plVar1[6];
  } while (iVar7 != 0);
  if (*(int *)(param_1 + 0x10) != 0x103) {
    uVar5 = FUN_140406e60(param_1,0x103);
    uVar5 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar5);
    FUN_140407020(param_1,uVar5);
  }
  FUN_1404084c0(param_1);
  if (param_5 == 0) {
    iVar7 = FUN_1404137f0(plVar1);
  }
  else {
    iVar7 = FUN_140413690(plVar1,0x20,param_2,0x1fffe);
  }
  local_30 = 0xffffffff;
  local_2a = 0;
  local_2c = *(undefined1 *)((longlong)plVar1 + 0x4a);
  local_2b = 0;
  local_38 = plVar1[5];
  plVar1[5] = (longlong)&local_38;
  plVar2 = *(longlong **)(param_1 + 0x30);
  *(char *)((longlong)plVar2 + 0x4a) = *(char *)((longlong)plVar2 + 0x4a) + (char)param_4;
  for (iVar6 = param_4; iVar6 != 0; iVar6 = iVar6 + -1) {
    *(int *)(*(longlong *)(*plVar2 + 0x30) + 8 +
            (ulonglong)
            *(ushort *)
             ((longlong)plVar2 +
             ((ulonglong)*(byte *)((longlong)plVar2 + 0x4a) - (longlong)iVar6) * 2 + 0xc4) * 0x10) =
         (int)plVar2[6];
  }
  FUN_1404130c0(plVar1,param_4);
  lVar8 = *(longlong *)(param_1 + 0x30);
  local_20 = 0xffffffff;
  local_1a = 0;
  local_1c = *(undefined1 *)(lVar8 + 0x4a);
  local_1b = 0;
  local_28 = *(undefined8 *)(lVar8 + 0x28);
  *(undefined8 **)(lVar8 + 0x28) = &local_28;
  FUN_140411f00(param_1);
  FUN_14040eeb0(lVar8);
  FUN_14040eeb0(plVar1);
  FUN_1404138b0(plVar1,iVar7);
  if (param_5 == 0) {
    uVar3 = FUN_140413660(plVar1,0x21,param_2,0,param_4);
  }
  else {
    uVar3 = FUN_140413690(plVar1,0x1f,param_2,0x1fffe);
  }
  FUN_140413550(plVar1,param_3);
  if (param_5 == 0) {
    uVar3 = FUN_1404137f0(plVar1);
  }
  FUN_140414cb0(plVar1,uVar3,iVar7 + 1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140410f40(longlong param_1,undefined8 param_2,undefined4 param_3)

{
  undefined4 uVar1;
  longlong lVar2;
  undefined4 uVar3;
  undefined8 uVar4;
  undefined1 auStack_78 [32];
  undefined4 local_58;
  undefined1 local_48 [24];
  ulonglong local_30;
  
  local_30 = DAT_1405d84f0 ^ (ulonglong)auStack_78;
  lVar2 = *(longlong *)(param_1 + 0x30);
  uVar1 = *(undefined4 *)(lVar2 + 0x3c);
  uVar4 = FUN_140407030(param_1,"(for index)",0xb);
  FUN_14040ea90(param_1,uVar4,0);
  uVar4 = FUN_140407030(param_1,"(for limit)",0xb);
  FUN_14040ea90(param_1,uVar4,1);
  uVar4 = FUN_140407030(param_1,"(for step)",10);
  FUN_14040ea90(param_1,uVar4,2);
  FUN_14040ea90(param_1,param_2,3);
  if (*(int *)(param_1 + 0x10) != 0x3d) {
    uVar4 = FUN_140406e60(param_1,0x3d);
    uVar4 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar4);
    FUN_140407020(param_1,uVar4);
  }
  FUN_1404084c0(param_1);
  FUN_140410540(param_1,local_48,0);
  FUN_140413d90(*(undefined8 *)(param_1 + 0x30),local_48);
  if (*(int *)(param_1 + 0x10) != 0x2c) {
    uVar4 = FUN_140406e60(param_1,0x2c);
    uVar4 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar4);
    FUN_140407020(param_1,uVar4);
  }
  FUN_1404084c0(param_1);
  FUN_140410540(param_1,local_48,0);
  FUN_140413d90(*(undefined8 *)(param_1 + 0x30),local_48);
  if (*(int *)(param_1 + 0x10) == 0x2c) {
    FUN_1404084c0(param_1);
    FUN_140410540(param_1,local_48,0);
    FUN_140413d90(*(undefined8 *)(param_1 + 0x30),local_48);
  }
  else {
    uVar3 = FUN_140413280(lVar2,0x3ff0000000000000);
    FUN_140413690(lVar2,1,*(undefined4 *)(lVar2 + 0x3c),uVar3);
    FUN_1404130c0(lVar2,1);
  }
  local_58 = 1;
  FUN_140410d20(param_1,uVar1,param_3,1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140411130(longlong param_1,undefined8 param_2)

{
  undefined4 uVar1;
  undefined4 uVar2;
  longlong lVar3;
  longlong lVar4;
  undefined8 uVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  undefined1 auStack_98 [32];
  undefined4 local_78;
  undefined4 local_68;
  int local_60 [6];
  ulonglong local_48;
  
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  lVar3 = *(longlong *)(param_1 + 0x30);
  local_68 = *(undefined4 *)(lVar3 + 0x3c);
  uVar5 = FUN_140407030(param_1,"(for generator)",0xf);
  FUN_14040ea90(param_1,uVar5,0);
  uVar5 = FUN_140407030(param_1,"(for state)",0xb);
  iVar8 = 1;
  FUN_14040ea90(param_1,uVar5,1);
  uVar5 = FUN_140407030(param_1,"(for control)",0xd);
  FUN_14040ea90(param_1,uVar5,2);
  FUN_14040ea90(param_1,param_2,3);
  iVar6 = 4;
  while (*(int *)(param_1 + 0x10) == 0x2c) {
    FUN_1404084c0(param_1);
    if (*(int *)(param_1 + 0x10) != 0x11d) {
      uVar5 = FUN_140406e60(param_1,0x11d);
      uVar5 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar5);
      FUN_140407020(param_1,uVar5);
    }
    uVar5 = *(undefined8 *)(param_1 + 0x18);
    FUN_1404084c0(param_1);
    FUN_14040ea90(param_1,uVar5);
    iVar6 = iVar6 + 1;
  }
  if (*(int *)(param_1 + 0x10) != 0x10b) {
    uVar5 = FUN_140406e60(param_1,0x10b);
    uVar5 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar5);
    FUN_140407020(param_1,uVar5);
  }
  FUN_1404084c0(param_1);
  uVar1 = *(undefined4 *)(param_1 + 4);
  FUN_140410540(param_1,local_60,0);
  while (*(int *)(param_1 + 0x10) == 0x2c) {
    FUN_1404084c0(param_1);
    FUN_140413d90(*(undefined8 *)(param_1 + 0x30),local_60);
    FUN_140410540(param_1,local_60,0);
    iVar8 = iVar8 + 1;
  }
  lVar4 = *(longlong *)(param_1 + 0x30);
  iVar7 = -iVar8 + 3;
  if ((local_60[0] == 0xd) || (local_60[0] == 0xe)) {
    iVar8 = -iVar8 + 4;
    if (iVar8 < 0) {
      iVar8 = 0;
    }
    FUN_1404132b0(lVar4,local_60,iVar8);
    if (1 < iVar8) {
      FUN_1404130c0(lVar4,iVar8 + -1);
    }
  }
  else {
    if (local_60[0] != 0) {
      FUN_140413d90(lVar4,local_60);
    }
    if (0 < iVar7) {
      uVar2 = *(undefined4 *)(lVar4 + 0x3c);
      FUN_1404130c0(lVar4,iVar7);
      FUN_140413750(lVar4,uVar2,iVar7);
    }
  }
  FUN_140413070(lVar3,3);
  local_78 = 0;
  FUN_140410d20(param_1,local_68,uVar1,iVar6 + -3);
  return;
}



void FUN_140411390(longlong param_1,undefined4 param_2)

{
  int iVar1;
  longlong lVar2;
  undefined8 uVar3;
  undefined8 local_18;
  undefined4 local_10;
  undefined1 local_c;
  undefined1 local_b;
  undefined1 local_a;
  
  lVar2 = *(longlong *)(param_1 + 0x30);
  local_10 = 0xffffffff;
  local_a = 1;
  local_c = *(undefined1 *)(lVar2 + 0x4a);
  local_b = 0;
  local_18 = *(undefined8 *)(lVar2 + 0x28);
  *(undefined8 **)(lVar2 + 0x28) = &local_18;
  FUN_1404084c0();
  if (*(int *)(param_1 + 0x10) != 0x11d) {
    uVar3 = FUN_140406e60(param_1,0x11d);
    uVar3 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar3);
    FUN_140407020(param_1,uVar3);
  }
  uVar3 = *(undefined8 *)(param_1 + 0x18);
  FUN_1404084c0(param_1);
  iVar1 = *(int *)(param_1 + 0x10);
  if (iVar1 != 0x2c) {
    if (iVar1 == 0x3d) {
      FUN_140410f40(param_1,uVar3,param_2);
      goto LAB_140411463;
    }
    if (iVar1 != 0x10b) {
      FUN_140407020(param_1,"\'=\' or \'in\' expected");
      goto LAB_140411463;
    }
  }
  FUN_140411130(param_1,uVar3);
LAB_140411463:
  FUN_14040e8f0(param_1,0x106,0x108,param_2);
  FUN_14040eeb0(lVar2);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined4 FUN_1404114a0(longlong param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  undefined1 auStack_58 [32];
  undefined8 local_38;
  undefined4 local_30;
  undefined1 local_2c;
  undefined1 local_2b;
  undefined1 local_2a;
  int local_28 [5];
  undefined4 local_14;
  ulonglong local_10;
  
  local_10 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  FUN_1404084c0();
  FUN_140410540(param_1,local_28,0);
  if (local_28[0] == 1) {
    local_28[0] = 3;
  }
  FUN_140414350(*(undefined8 *)(param_1 + 0x30),local_28);
  if (*(int *)(param_1 + 0x10) != 0x112) {
    uVar2 = FUN_140406e60(param_1,0x112);
    uVar2 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar2);
    FUN_140407020(param_1,uVar2);
  }
  FUN_1404084c0(param_1);
  lVar1 = *(longlong *)(param_1 + 0x30);
  local_30 = 0xffffffff;
  local_2a = 0;
  local_2c = *(undefined1 *)(lVar1 + 0x4a);
  local_2b = 0;
  local_38 = *(undefined8 *)(lVar1 + 0x28);
  *(undefined8 **)(lVar1 + 0x28) = &local_38;
  FUN_140411f00(param_1);
  FUN_14040eeb0(lVar1);
  return local_14;
}



void FUN_140411590(longlong param_1,undefined4 param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 local_res8 [2];
  undefined8 local_18;
  undefined4 local_10;
  undefined1 local_c;
  undefined1 local_b;
  undefined1 local_a;
  
  uVar2 = *(undefined8 *)(param_1 + 0x30);
  local_res8[0] = 0xffffffff;
  uVar4 = FUN_1404114a0();
  iVar1 = *(int *)(param_1 + 0x10);
  while (iVar1 == 0x105) {
    uVar5 = FUN_1404137f0(uVar2);
    FUN_140413010(uVar2,local_res8,uVar5);
    FUN_1404138b0(uVar2,uVar4);
    uVar4 = FUN_1404114a0(param_1);
    iVar1 = *(int *)(param_1 + 0x10);
  }
  if (*(int *)(param_1 + 0x10) == 0x104) {
    uVar5 = FUN_1404137f0();
    FUN_140413010(uVar2,local_res8,uVar5);
    FUN_1404138b0(uVar2,uVar4);
    FUN_1404084c0(param_1);
    lVar3 = *(longlong *)(param_1 + 0x30);
    local_10 = 0xffffffff;
    local_a = 0;
    local_c = *(undefined1 *)(lVar3 + 0x4a);
    local_b = 0;
    local_18 = *(undefined8 *)(lVar3 + 0x28);
    *(undefined8 **)(lVar3 + 0x28) = &local_18;
    FUN_140411f00(param_1);
    FUN_14040eeb0(lVar3);
  }
  else {
    FUN_140413010(uVar2,local_res8,uVar4);
  }
  FUN_1404138b0(uVar2,local_res8[0]);
  FUN_14040e8f0(param_1,0x106,0x10a,param_2);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1404116c0(longlong param_1)

{
  longlong *plVar1;
  longlong *plVar2;
  undefined8 uVar3;
  undefined1 auStack_68 [32];
  undefined4 local_48 [2];
  undefined4 local_40;
  undefined8 local_38;
  undefined1 local_30 [24];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_68;
  plVar1 = *(longlong **)(param_1 + 0x30);
  if (*(int *)(param_1 + 0x10) != 0x11d) {
    uVar3 = FUN_140406e60(param_1,0x11d);
    uVar3 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar3);
    FUN_140407020(param_1,uVar3);
  }
  uVar3 = *(undefined8 *)(param_1 + 0x18);
  FUN_1404084c0(param_1);
  FUN_14040ea90(param_1,uVar3,0);
  local_40 = *(undefined4 *)((longlong)plVar1 + 0x3c);
  local_38 = 0xffffffffffffffff;
  local_48[0] = 6;
  FUN_1404130c0(plVar1,1);
  plVar2 = *(longlong **)(param_1 + 0x30);
  *(char *)((longlong)plVar2 + 0x4a) = *(char *)((longlong)plVar2 + 0x4a) + '\x01';
  *(int *)(*(longlong *)(*plVar2 + 0x30) + 8 +
          (ulonglong)
          *(ushort *)((longlong)plVar2 + (ulonglong)*(byte *)((longlong)plVar2 + 0x4a) * 2 + 0xc2) *
          0x10) = (int)plVar2[6];
  FUN_14040fa90(param_1,local_30,0,*(undefined4 *)(param_1 + 4));
  FUN_140414050(plVar1,local_48,local_30);
  *(int *)(*(longlong *)(*plVar1 + 0x30) + 8 +
          (ulonglong)
          *(ushort *)((longlong)plVar1 + (ulonglong)*(byte *)((longlong)plVar1 + 0x4a) * 2 + 0xc2) *
          0x10) = (int)plVar1[6];
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1404117f0(longlong param_1)

{
  undefined4 uVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined8 uVar4;
  int iVar5;
  int iVar6;
  undefined1 auStack_58 [32];
  int local_38 [6];
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  iVar5 = 0;
  iVar6 = 0;
  while( true ) {
    if (*(int *)(param_1 + 0x10) != 0x11d) {
      uVar4 = FUN_140406e60(param_1,0x11d);
      uVar4 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar4);
      FUN_140407020(param_1,uVar4);
    }
    uVar4 = *(undefined8 *)(param_1 + 0x18);
    FUN_1404084c0(param_1);
    FUN_14040ea90(param_1,uVar4,iVar6);
    iVar6 = iVar6 + 1;
    if (*(int *)(param_1 + 0x10) != 0x2c) break;
    FUN_1404084c0(param_1);
  }
  if (*(int *)(param_1 + 0x10) == 0x3d) {
    FUN_1404084c0(param_1);
    iVar5 = 1;
    FUN_140410540(param_1,local_38,0);
    while (*(int *)(param_1 + 0x10) == 0x2c) {
      FUN_1404084c0(param_1);
      FUN_140413d90(*(undefined8 *)(param_1 + 0x30),local_38);
      FUN_140410540(param_1,local_38,0);
      iVar5 = iVar5 + 1;
    }
  }
  else {
    local_38[0] = 0;
  }
  lVar2 = *(longlong *)(param_1 + 0x30);
  iVar5 = iVar6 - iVar5;
  if ((local_38[0] == 0xd) || (local_38[0] == 0xe)) {
    iVar5 = iVar5 + 1;
    if (iVar5 < 0) {
      iVar5 = 0;
    }
    FUN_1404132b0(lVar2,local_38,iVar5);
    if (1 < iVar5) {
      FUN_1404130c0(lVar2,iVar5 + -1);
    }
  }
  else {
    if (local_38[0] != 0) {
      FUN_140413d90(lVar2,local_38);
    }
    if (0 < iVar5) {
      uVar1 = *(undefined4 *)(lVar2 + 0x3c);
      FUN_1404130c0(lVar2,iVar5);
      FUN_140413750(lVar2,uVar1,iVar5);
    }
  }
  plVar3 = *(longlong **)(param_1 + 0x30);
  *(char *)((longlong)plVar3 + 0x4a) = *(char *)((longlong)plVar3 + 0x4a) + (char)iVar6;
  for (; iVar6 != 0; iVar6 = iVar6 + -1) {
    *(int *)(*(longlong *)(*plVar3 + 0x30) + 8 +
            (ulonglong)
            *(ushort *)
             ((longlong)plVar3 +
             ((ulonglong)*(byte *)((longlong)plVar3 + 0x4a) - (longlong)iVar6) * 2 + 0xc4) * 0x10) =
         (int)plVar3[6];
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1404119b0(longlong param_1,undefined4 param_2)

{
  int iVar1;
  undefined8 uVar2;
  undefined8 uVar3;
  bool bVar4;
  undefined1 auStack_88 [32];
  undefined1 local_68 [8];
  undefined4 local_60;
  undefined4 local_50 [2];
  undefined4 local_48;
  undefined8 local_40;
  undefined1 local_38 [24];
  ulonglong local_20;
  
  local_20 = DAT_1405d84f0 ^ (ulonglong)auStack_88;
  FUN_1404084c0();
  if (*(int *)(param_1 + 0x10) != 0x11d) {
    uVar2 = FUN_140406e60(param_1,0x11d);
    uVar2 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar2);
    FUN_140407020(param_1,uVar2);
  }
  uVar2 = *(undefined8 *)(param_1 + 0x18);
  FUN_1404084c0(param_1);
  uVar3 = *(undefined8 *)(param_1 + 0x30);
  iVar1 = FUN_14040ecf0(uVar3,uVar2,local_68,1);
  if (iVar1 == 8) {
    local_60 = FUN_140413250(uVar3,uVar2);
  }
  iVar1 = *(int *)(param_1 + 0x10);
  while (iVar1 == 0x2e) {
    uVar2 = *(undefined8 *)(param_1 + 0x30);
    FUN_140413e20(uVar2,local_68);
    FUN_1404084c0(param_1);
    if (*(int *)(param_1 + 0x10) != 0x11d) {
      uVar3 = FUN_140406e60(param_1,0x11d);
      uVar3 = FUN_14040b860(*(undefined8 *)(param_1 + 0x38),"\'%s\' expected",uVar3);
      FUN_140407020(param_1,uVar3);
    }
    uVar3 = *(undefined8 *)(param_1 + 0x18);
    FUN_1404084c0(param_1);
    local_48 = FUN_140413250(*(undefined8 *)(param_1 + 0x30),uVar3);
    local_40 = 0xffffffffffffffff;
    local_50[0] = 4;
    FUN_140414690(uVar2,local_68,local_50);
    iVar1 = *(int *)(param_1 + 0x10);
  }
  bVar4 = *(int *)(param_1 + 0x10) == 0x3a;
  if (bVar4) {
    FUN_14040f3c0(param_1,local_68);
  }
  FUN_14040fa90(param_1,local_38,bVar4,param_2);
  FUN_140414050(*(undefined8 *)(param_1 + 0x30),local_68,local_38);
  FUN_140413550(*(undefined8 *)(param_1 + 0x30),param_2);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140411b70(longlong param_1)

{
  longlong *plVar1;
  longlong lVar2;
  undefined1 auStack_58 [32];
  undefined8 local_38;
  int local_30 [2];
  int local_28;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  plVar1 = *(longlong **)(param_1 + 0x30);
  FUN_14040fe30(param_1,local_30);
  if (local_30[0] == 0xd) {
    lVar2 = *(longlong *)(*plVar1 + 0x18);
    *(uint *)(lVar2 + (longlong)local_28 * 4) =
         *(uint *)(lVar2 + (longlong)local_28 * 4) & 0xff807fff | 0x4000;
  }
  else {
    local_38 = 0;
    FUN_1404106e0(param_1,&local_38,1);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140411c00(longlong param_1)

{
  longlong *plVar1;
  uint uVar2;
  int iVar3;
  undefined1 auStack_48 [32];
  int local_28 [2];
  int local_20;
  ulonglong local_10;
  
  local_10 = DAT_1405d84f0 ^ (ulonglong)auStack_48;
  plVar1 = *(longlong **)(param_1 + 0x30);
  FUN_1404084c0();
  iVar3 = *(int *)(param_1 + 0x10);
  if (((iVar3 < 0x104) || (((0x106 < iVar3 && (iVar3 != 0x114)) && (iVar3 != 0x11f)))) &&
     (iVar3 != 0x3b)) {
    iVar3 = 1;
    FUN_140410540(param_1,local_28,0);
    while (*(int *)(param_1 + 0x10) == 0x2c) {
      FUN_1404084c0(param_1);
      FUN_140413d90(*(undefined8 *)(param_1 + 0x30),local_28);
      FUN_140410540(param_1,local_28);
      iVar3 = iVar3 + 1;
    }
    if ((local_28[0] == 0xd) || (local_28[0] == 0xe)) {
      FUN_1404132b0(plVar1,local_28,0xffffffff);
      if ((local_28[0] == 0xd) && (iVar3 == 1)) {
        *(uint *)(*(longlong *)(*plVar1 + 0x18) + (longlong)local_20 * 4) =
             *(uint *)(*(longlong *)(*plVar1 + 0x18) + (longlong)local_20 * 4) & 0xffffffdd | 0x1d;
      }
      uVar2 = (uint)*(byte *)((longlong)plVar1 + 0x4a);
      iVar3 = -1;
    }
    else if (iVar3 == 1) {
      uVar2 = FUN_140413e20();
    }
    else {
      FUN_140413d90(plVar1,local_28);
      uVar2 = (uint)*(byte *)((longlong)plVar1 + 0x4a);
    }
  }
  else {
    iVar3 = 0;
    uVar2 = 0;
  }
  FUN_140413890(plVar1,uVar2,iVar3);
  return;
}



undefined8 FUN_140411d40(longlong param_1)

{
  undefined4 uVar1;
  
  uVar1 = *(undefined4 *)(param_1 + 4);
  switch(*(undefined4 *)(param_1 + 0x10)) {
  case 0x102:
    FUN_1404084c0(param_1);
    FUN_1404109c0(param_1);
    return 1;
  case 0x103:
    FUN_1404084c0(param_1);
    FUN_140410690(param_1);
    FUN_14040e8f0(param_1,0x106,0x103,uVar1);
    return 0;
  default:
    FUN_140411b70(param_1);
    return 0;
  case 0x108:
    FUN_140411390(param_1,uVar1);
    return 0;
  case 0x109:
    FUN_1404119b0(param_1,uVar1);
    return 0;
  case 0x10a:
    FUN_140411590(param_1,uVar1);
    return 0;
  case 0x10c:
    break;
  case 0x110:
    FUN_140410bd0(param_1,uVar1);
    return 0;
  case 0x111:
    FUN_140411c00(param_1);
    return 1;
  case 0x115:
    FUN_140410a50(param_1,uVar1);
    return 0;
  }
  FUN_1404084c0(param_1);
  if (*(int *)(param_1 + 0x10) == 0x109) {
    FUN_1404084c0();
    FUN_1404116c0(param_1);
    return 0;
  }
  FUN_1404117f0(param_1);
  return 0;
}



void FUN_140411f00(longlong param_1)

{
  short *psVar1;
  longlong lVar2;
  int iVar3;
  
  lVar2 = *(longlong *)(param_1 + 0x38);
  psVar1 = (short *)(lVar2 + 0x60);
  *psVar1 = *psVar1 + 1;
  if (200 < *(ushort *)(lVar2 + 0x60)) {
    FUN_140406f70(param_1,"chunk has too many syntax levels",0);
  }
  do {
    iVar3 = *(int *)(param_1 + 0x10);
    if ((0x103 < iVar3) && (((iVar3 < 0x107 || (iVar3 == 0x114)) || (iVar3 == 0x11f)))) break;
    iVar3 = FUN_140411d40(param_1);
    if (*(int *)(param_1 + 0x10) == 0x3b) {
      FUN_1404084c0(param_1);
    }
    *(uint *)(*(longlong *)(param_1 + 0x30) + 0x3c) =
         (uint)*(byte *)(*(longlong *)(param_1 + 0x30) + 0x4a);
  } while (iVar3 == 0);
  psVar1 = (short *)(*(longlong *)(param_1 + 0x38) + 0x60);
  *psVar1 = *psVar1 + -1;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

longlong FUN_140411fa0(undefined8 param_1,undefined8 param_2,undefined8 param_3,char *param_4)

{
  char cVar1;
  int iVar2;
  undefined8 uVar3;
  ulonglong uVar4;
  char *pcVar5;
  undefined1 auStack_308 [32];
  undefined1 local_2e8 [16];
  int local_2d8;
  longlong local_2b8;
  longlong local_2b0;
  undefined8 local_2a0;
  longlong local_288 [76];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_308;
  uVar4 = 0xffffffffffffffff;
  pcVar5 = param_4;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar5 + 1;
  } while (cVar1 != '\0');
  local_2a0 = param_3;
  uVar3 = FUN_140406c30(param_1,param_4,~uVar4 - 1);
  FUN_140407140(param_1,local_2e8,param_2,uVar3);
  FUN_14040f0a0(local_2e8,local_288);
  *(undefined1 *)(local_288[0] + 0x72) = 2;
  FUN_1404084c0(local_2e8);
  *(short *)(local_2b0 + 0x60) = *(short *)(local_2b0 + 0x60) + 1;
  if (200 < *(ushort *)(local_2b0 + 0x60)) {
    FUN_140406f70(local_2e8,"chunk has too many syntax levels",0);
  }
  do {
    if ((0x103 < local_2d8) &&
       (((local_2d8 < 0x107 || (local_2d8 == 0x114)) || (local_2d8 == 0x11f)))) break;
    iVar2 = FUN_140411d40(local_2e8);
    if (local_2d8 == 0x3b) {
      FUN_1404084c0(local_2e8);
    }
    *(uint *)(local_2b8 + 0x3c) = (uint)*(byte *)(local_2b8 + 0x4a);
  } while (iVar2 == 0);
  *(short *)(local_2b0 + 0x60) = *(short *)(local_2b0 + 0x60) + -1;
  if (local_2d8 != 0x11f) {
    uVar3 = FUN_140406e60(local_2e8,0x11f);
    uVar3 = FUN_14040b860(local_2b0,"\'%s\' expected",uVar3);
    FUN_140407020(local_2e8,uVar3);
  }
  FUN_14040f190(local_2e8);
  return local_288[0];
}



int FUN_140412120(undefined8 *param_1)

{
  longlong lVar1;
  int local_res8 [8];
  
  lVar1 = FUN_14040e140(param_1[1],local_res8,4);
  if (lVar1 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  if (local_res8[0] < 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"bad integer");
    FUN_140406350(*param_1,3);
  }
  return local_res8[0];
}



undefined8 FUN_1404121b0(undefined8 *param_1)

{
  longlong lVar1;
  undefined8 uVar2;
  longlong local_res8;
  
  lVar1 = FUN_14040e140(param_1[1],&local_res8,8);
  if (lVar1 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  if (local_res8 == 0) {
    return 0;
  }
  uVar2 = FUN_14040e200(*param_1,param_1[2]);
  lVar1 = FUN_14040e140(param_1[1],uVar2,local_res8);
  if (lVar1 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  uVar2 = FUN_140406c30(*param_1,uVar2,local_res8 + -1);
  return uVar2;
}



void FUN_140412280(undefined8 *param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  
  iVar1 = FUN_140412120();
  if ((ulonglong)(longlong)(iVar1 + 1) < 0x4000000000000000) {
    uVar2 = FUN_1404069e0(*param_1,0,0,(longlong)iVar1 << 2);
  }
  else {
    uVar2 = FUN_1404069c0(*param_1);
  }
  *(undefined8 *)(param_2 + 0x18) = uVar2;
  *(int *)(param_2 + 0x50) = iVar1;
  lVar3 = FUN_14040e140(param_1[1],uVar2,(longlong)iVar1 << 2);
  if (lVar3 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  return;
}



void FUN_140412330(undefined8 *param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  longlong lVar7;
  int local_res8 [2];
  char local_res10 [8];
  undefined8 local_res18;
  
  iVar1 = FUN_140412120();
  lVar5 = (longlong)iVar1;
  if ((ulonglong)(longlong)(iVar1 + 1) < 0x1000000000000000) {
    uVar2 = FUN_1404069e0(*param_1,0,0,lVar5 << 4);
  }
  else {
    uVar2 = FUN_1404069c0(*param_1);
  }
  *(int *)(param_2 + 0x4c) = iVar1;
  lVar6 = 0;
  *(undefined8 *)(param_2 + 0x10) = uVar2;
  lVar7 = lVar6;
  lVar4 = lVar5;
  if (0 < lVar5) {
    do {
      lVar4 = lVar4 + -1;
      *(undefined4 *)(*(longlong *)(param_2 + 0x10) + -8 + lVar7 + 0x10) = 0;
      lVar7 = lVar7 + 0x10;
    } while (lVar4 != 0);
    lVar7 = lVar6;
    if (0 < lVar5) {
      do {
        lVar4 = *(longlong *)(param_2 + 0x10);
        lVar3 = FUN_14040e140(param_1[1],local_res8,1);
        if (lVar3 != 0) {
          FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
          FUN_140406350(*param_1,3);
        }
        if ((char)local_res8[0] == '\0') {
          *(undefined4 *)(lVar7 + 8 + lVar4) = 0;
        }
        else if ((char)local_res8[0] == '\x01') {
          lVar3 = FUN_14040e140(param_1[1],local_res10,1);
          if (lVar3 != 0) {
            FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
            FUN_140406350(*param_1,3);
          }
          *(undefined4 *)(lVar7 + 8 + lVar4) = 1;
          *(uint *)(lVar7 + lVar4) = (uint)(local_res10[0] != '\0');
        }
        else if ((char)local_res8[0] == '\x03') {
          lVar3 = FUN_14040e140(param_1[1],&local_res18,8);
          if (lVar3 != 0) {
            FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
            FUN_140406350(*param_1,3);
          }
          *(undefined4 *)(lVar7 + 8 + lVar4) = 3;
          *(undefined8 *)(lVar7 + lVar4) = local_res18;
        }
        else if ((char)local_res8[0] == '\x04') {
          uVar2 = FUN_1404121b0(param_1);
          *(undefined4 *)(lVar7 + 8 + lVar4) = 4;
          *(undefined8 *)(lVar7 + lVar4) = uVar2;
        }
        else {
          FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"bad constant");
          FUN_140406350(*param_1,3);
        }
        lVar5 = lVar5 + -1;
        lVar7 = lVar7 + 0x10;
      } while (lVar5 != 0);
    }
  }
  lVar5 = FUN_14040e140(param_1[1],local_res8,4);
  if (lVar5 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  iVar1 = local_res8[0];
  if (local_res8[0] < 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"bad integer");
    FUN_140406350(*param_1,3);
    iVar1 = local_res8[0];
  }
  if ((ulonglong)(longlong)(iVar1 + 1) < 0x2000000000000000) {
    uVar2 = FUN_1404069e0(*param_1,0,0,(longlong)iVar1 << 3);
  }
  else {
    uVar2 = FUN_1404069c0(*param_1);
  }
  *(int *)(param_2 + 0x58) = iVar1;
  lVar7 = (longlong)iVar1;
  *(undefined8 *)(param_2 + 0x20) = uVar2;
  lVar5 = lVar6;
  if (0 < lVar7) {
    do {
      lVar5 = lVar5 + 1;
      *(undefined8 *)(*(longlong *)(param_2 + 0x20) + -8 + lVar5 * 8) = 0;
    } while (lVar5 < lVar7);
    if (0 < lVar7) {
      do {
        uVar2 = FUN_140412970(param_1,*(undefined8 *)(param_2 + 0x40));
        lVar6 = lVar6 + 1;
        *(undefined8 *)(*(longlong *)(param_2 + 0x20) + -8 + lVar6 * 8) = uVar2;
      } while (lVar6 < lVar7);
    }
  }
  return;
}



void FUN_140412640(undefined8 *param_1,longlong param_2)

{
  int iVar1;
  undefined8 uVar2;
  longlong lVar3;
  longlong lVar4;
  longlong lVar5;
  longlong lVar6;
  int local_res8 [2];
  int local_res10 [2];
  
  iVar1 = FUN_140412120();
  if ((ulonglong)(longlong)(iVar1 + 1) < 0x4000000000000000) {
    uVar2 = FUN_1404069e0(*param_1,0,0,(longlong)iVar1 << 2);
  }
  else {
    uVar2 = FUN_1404069c0(*param_1);
  }
  *(undefined8 *)(param_2 + 0x28) = uVar2;
  *(int *)(param_2 + 0x54) = iVar1;
  lVar3 = FUN_14040e140(param_1[1],uVar2,(longlong)iVar1 << 2);
  if (lVar3 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  iVar1 = FUN_140412120(param_1);
  lVar3 = (longlong)iVar1;
  if ((ulonglong)(longlong)(iVar1 + 1) < 0x1000000000000000) {
    uVar2 = FUN_1404069e0(*param_1,0,0,lVar3 << 4);
  }
  else {
    uVar2 = FUN_1404069c0(*param_1);
  }
  *(int *)(param_2 + 0x5c) = iVar1;
  lVar6 = 0;
  *(undefined8 *)(param_2 + 0x30) = uVar2;
  lVar5 = lVar6;
  lVar4 = lVar3;
  if (0 < lVar3) {
    do {
      lVar4 = lVar4 + -1;
      *(undefined8 *)(lVar5 + *(longlong *)(param_2 + 0x30)) = 0;
      lVar5 = lVar5 + 0x10;
    } while (lVar4 != 0);
    lVar5 = lVar6;
    if (0 < lVar3) {
      do {
        uVar2 = FUN_1404121b0(param_1);
        *(undefined8 *)(*(longlong *)(param_2 + 0x30) + lVar5) = uVar2;
        lVar4 = FUN_14040e140(param_1[1],local_res8,4);
        if (lVar4 != 0) {
          FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
          FUN_140406350(*param_1,3);
        }
        if (local_res8[0] < 0) {
          FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"bad integer");
          FUN_140406350(*param_1,3);
        }
        *(int *)(*(longlong *)(param_2 + 0x30) + 8 + lVar5) = local_res8[0];
        lVar4 = FUN_14040e140(param_1[1],local_res10,4);
        if (lVar4 != 0) {
          FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
          FUN_140406350(*param_1,3);
        }
        if (local_res10[0] < 0) {
          FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"bad integer");
          FUN_140406350(*param_1,3);
        }
        lVar3 = lVar3 + -1;
        *(int *)(*(longlong *)(param_2 + 0x30) + -4 + lVar5 + 0x10) = local_res10[0];
        lVar5 = lVar5 + 0x10;
      } while (lVar3 != 0);
    }
  }
  lVar3 = FUN_14040e140(param_1[1],local_res8,4);
  if (lVar3 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  iVar1 = local_res8[0];
  if (local_res8[0] < 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"bad integer");
    FUN_140406350(*param_1,3);
    iVar1 = local_res8[0];
  }
  if ((ulonglong)(longlong)(iVar1 + 1) < 0x2000000000000000) {
    uVar2 = FUN_1404069e0(*param_1,0,0,(longlong)iVar1 << 3);
  }
  else {
    uVar2 = FUN_1404069c0(*param_1);
  }
  *(int *)(param_2 + 0x48) = iVar1;
  lVar5 = (longlong)iVar1;
  *(undefined8 *)(param_2 + 0x38) = uVar2;
  lVar3 = lVar6;
  if (0 < lVar5) {
    do {
      lVar3 = lVar3 + 1;
      *(undefined8 *)(*(longlong *)(param_2 + 0x38) + -8 + lVar3 * 8) = 0;
    } while (lVar3 < lVar5);
    if (0 < lVar5) {
      do {
        uVar2 = FUN_1404121b0(param_1);
        lVar6 = lVar6 + 1;
        *(undefined8 *)(*(longlong *)(param_2 + 0x38) + -8 + lVar6 * 8) = uVar2;
      } while (lVar6 < lVar5);
    }
  }
  return;
}



longlong FUN_140412970(longlong *param_1,undefined8 param_2)

{
  short *psVar1;
  longlong *plVar2;
  undefined4 uVar3;
  int iVar4;
  longlong lVar5;
  longlong lVar6;
  undefined1 local_res8 [8];
  
  lVar6 = *param_1;
  psVar1 = (short *)(lVar6 + 0x60);
  *psVar1 = *psVar1 + 1;
  if (200 < *(ushort *)(lVar6 + 0x60)) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"code too deep");
    FUN_140406350(*param_1,3);
  }
  lVar5 = FUN_14040b100(*param_1);
  plVar2 = *(longlong **)(*param_1 + 0x10);
  *plVar2 = lVar5;
  *(undefined4 *)(plVar2 + 1) = 9;
  lVar6 = *param_1;
  if (*(longlong *)(lVar6 + 0x38) - *(longlong *)(lVar6 + 0x10) < 0x11) {
    FUN_140405ae0(lVar6,1);
  }
  *(longlong *)(*param_1 + 0x10) = *(longlong *)(*param_1 + 0x10) + 0x10;
  lVar6 = FUN_1404121b0(param_1);
  *(longlong *)(lVar5 + 0x40) = lVar6;
  if (lVar6 == 0) {
    *(undefined8 *)(lVar5 + 0x40) = param_2;
  }
  uVar3 = FUN_140412120(param_1);
  *(undefined4 *)(lVar5 + 0x60) = uVar3;
  uVar3 = FUN_140412120(param_1);
  *(undefined4 *)(lVar5 + 100) = uVar3;
  lVar6 = FUN_14040e140(param_1[1],local_res8,1);
  if (lVar6 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  *(undefined1 *)(lVar5 + 0x70) = local_res8[0];
  lVar6 = FUN_14040e140(param_1[1],local_res8,1);
  if (lVar6 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  *(undefined1 *)(lVar5 + 0x71) = local_res8[0];
  lVar6 = FUN_14040e140(param_1[1],local_res8,1);
  if (lVar6 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  *(undefined1 *)(lVar5 + 0x72) = local_res8[0];
  lVar6 = FUN_14040e140(param_1[1],local_res8,1);
  if (lVar6 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  *(undefined1 *)(lVar5 + 0x73) = local_res8[0];
  FUN_140412280(param_1,lVar5);
  FUN_140412330(param_1,lVar5);
  FUN_140412640(param_1,lVar5);
  iVar4 = FUN_140404e90(lVar5);
  if (iVar4 == 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"bad code");
    FUN_140406350(*param_1,3);
  }
  *(longlong *)(*param_1 + 0x10) = *(longlong *)(*param_1 + 0x10) + -0x10;
  *(short *)(*param_1 + 0x60) = *(short *)(*param_1 + 0x60) + -1;
  return lVar5;
}



void FUN_140412bd0(undefined4 *param_1)

{
  *param_1 = 0x61754c1b;
  *(undefined2 *)(param_1 + 1) = 0x51;
  *(undefined2 *)((longlong)param_1 + 6) = 0x401;
  *(undefined2 *)(param_1 + 2) = 0x408;
  *(undefined2 *)((longlong)param_1 + 10) = 8;
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140412bf0(undefined8 *param_1)

{
  int iVar1;
  longlong lVar2;
  bool bVar3;
  undefined1 auStack_58 [32];
  undefined4 local_38;
  undefined4 uStack_34;
  uint local_30;
  ulonglong local_28;
  uint local_20;
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_58;
  local_38 = 0x61754c1b;
  uStack_34 = 0x4010051;
  local_30 = 0x80408;
  lVar2 = FUN_14040e140(param_1[1],&local_28,0xc);
  if (lVar2 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"unexpected end");
    FUN_140406350(*param_1,3);
  }
  bVar3 = CONCAT44(uStack_34,local_38) < local_28;
  if ((CONCAT44(uStack_34,local_38) == local_28) &&
     (bVar3 = local_30 < local_20, local_30 == local_20)) {
    iVar1 = 0;
  }
  else {
    iVar1 = (1 - (uint)bVar3) - (uint)(bVar3 != 0);
  }
  if (iVar1 != 0) {
    FUN_14040b860(*param_1,"%s: %s in precompiled chunk",param_1[3],"bad header");
    FUN_140406350(*param_1,3);
  }
  return;
}



void FUN_140412cd0(undefined8 param_1,undefined8 param_2,undefined8 param_3,char *param_4)

{
  char cVar1;
  undefined8 uVar2;
  undefined8 local_28;
  undefined8 local_20;
  undefined8 local_18;
  char *local_10;
  
  cVar1 = *param_4;
  if ((cVar1 == '@') || (cVar1 == '=')) {
    local_10 = param_4 + 1;
  }
  else {
    local_10 = "binary string";
    if (cVar1 != '\x1b') {
      local_10 = param_4;
    }
  }
  local_28 = param_1;
  local_20 = param_2;
  local_18 = param_3;
  FUN_140412bf0(&local_28);
  uVar2 = FUN_140406c30(param_1,&DAT_140475b2c,2);
  FUN_140412970(&local_28,uVar2);
  return;
}



void FUN_140412d50(longlong *param_1,int param_2,int param_3)

{
  uint uVar1;
  uint *puVar2;
  longlong lVar3;
  uint uVar4;
  
  lVar3 = *(longlong *)(*param_1 + 0x18);
  uVar1 = (param_3 - param_2) - 1;
  uVar4 = (int)uVar1 >> 0x1f;
  if (0x1ffff < (int)((uVar1 ^ uVar4) - uVar4)) {
    FUN_140407020(param_1[3],"control structure too long");
  }
  puVar2 = (uint *)(lVar3 + (longlong)param_2 * 4);
  *puVar2 = *puVar2 & 0x3fff;
  puVar2 = (uint *)(lVar3 + (longlong)param_2 * 4);
  *puVar2 = *puVar2 | ((param_3 - param_2) + 0x1fffe) * 0x4000;
  return;
}



void FUN_140412dc0(longlong param_1)

{
  *(undefined4 *)(param_1 + 0x34) = *(undefined4 *)(param_1 + 0x30);
  return;
}



void FUN_140412dd0(longlong *param_1,int param_2)

{
  uint *puVar1;
  uint uVar2;
  int iVar3;
  uint *puVar4;
  
  while( true ) {
    if (param_2 == -1) {
      return;
    }
    puVar1 = (uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2 * 4);
    if ((param_2 < 1) || (puVar4 = puVar1 + -1, ((&DAT_1404757b8)[puVar1[-1] & 0x3f] & 0x80) == 0))
    {
      puVar4 = puVar1;
    }
    uVar2 = *puVar4;
    if (((byte)uVar2 & 0x3f) == 0x1b) {
      *puVar4 = (uVar2 & 0xffb5ffff | 0x340000) >> 0x11 | uVar2 & 0x7fc000;
    }
    iVar3 = (*(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2 * 4) >> 0xe) - 0x1ffff;
    if (iVar3 == -1) break;
    param_2 = param_2 + 1 + iVar3;
  }
  return;
}



void FUN_140412e60(longlong *param_1,int param_2,int param_3,uint param_4,int param_5)

{
  uint *puVar1;
  longlong lVar2;
  uint uVar3;
  uint uVar4;
  uint *puVar5;
  int iVar6;
  longlong lVar7;
  
  while (param_2 != -1) {
    lVar7 = (longlong)param_2;
    uVar3 = *(uint *)(*(longlong *)(*param_1 + 0x18) + lVar7 * 4) >> 0xe;
    puVar1 = (uint *)(*(longlong *)(*param_1 + 0x18) + lVar7 * 4);
    if (uVar3 == 0x1fffe) {
      iVar6 = -1;
    }
    else {
      iVar6 = (uVar3 - 0x1fffe) + param_2;
    }
    if ((param_2 < 1) || (puVar5 = puVar1 + -1, ((&DAT_1404757b8)[puVar1[-1] & 0x3f] & 0x80) == 0))
    {
      puVar5 = puVar1;
    }
    uVar3 = *puVar5;
    if (((byte)uVar3 & 0x3f) == 0x1b) {
      if ((param_4 == 0xff) || (param_4 == uVar3 >> 0x17)) {
        uVar3 = (uVar3 & 0xffb5ffff | 0x340000) >> 0x11 | uVar3 & 0x7fc000;
      }
      else {
        uVar3 = (param_4 << 6 ^ uVar3) & 0x3fc0 ^ uVar3;
      }
      *puVar5 = uVar3;
      lVar2 = *(longlong *)(*param_1 + 0x18);
      uVar3 = (param_3 - param_2) - 1;
      uVar4 = (int)uVar3 >> 0x1f;
      if (0x1ffff < (int)((uVar3 ^ uVar4) - uVar4)) {
        FUN_140407020(param_1[3],"control structure too long");
      }
      puVar1 = (uint *)(lVar2 + lVar7 * 4);
      *puVar1 = *puVar1 & 0x3fff;
      puVar1 = (uint *)(lVar2 + lVar7 * 4);
      *puVar1 = *puVar1 | ((param_3 - param_2) + 0x1fffe) * 0x4000;
      param_2 = iVar6;
    }
    else {
      uVar3 = (param_5 - param_2) - 1;
      uVar4 = (int)uVar3 >> 0x1f;
      if (0x1ffff < (int)((uVar3 ^ uVar4) - uVar4)) {
        FUN_140407020(param_1[3],"control structure too long");
      }
      *puVar1 = *puVar1 & 0x3fff;
      *puVar1 = *puVar1 | ((param_5 - param_2) + 0x1fffe) * 0x4000;
      param_2 = iVar6;
    }
  }
  return;
}



void FUN_140413010(longlong *param_1,int *param_2,int param_3)

{
  int iVar1;
  uint uVar2;
  
  if (param_3 != -1) {
    iVar1 = *param_2;
    if (iVar1 == -1) {
      *param_2 = param_3;
      return;
    }
    do {
      uVar2 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar1 * 4) >> 0xe;
      if (uVar2 == 0x1fffe) break;
      iVar1 = (uVar2 - 0x1fffe) + iVar1;
    } while (iVar1 != -1);
    FUN_140412d50(param_1);
  }
  return;
}



void FUN_140413070(longlong *param_1,int param_2)

{
  param_2 = param_2 + *(int *)((longlong)param_1 + 0x3c);
  if ((int)(uint)*(byte *)(*param_1 + 0x73) < param_2) {
    if (0xf9 < param_2) {
      FUN_140407020(param_1[3],"function or expression too complex");
    }
    *(char *)(*param_1 + 0x73) = (char)param_2;
  }
  return;
}



void FUN_1404130c0(longlong *param_1,int param_2)

{
  int iVar1;
  
  iVar1 = param_2 + *(int *)((longlong)param_1 + 0x3c);
  if ((int)(uint)*(byte *)(*param_1 + 0x73) < iVar1) {
    if (0xf9 < iVar1) {
      FUN_140407020(param_1[3],"function or expression too complex");
    }
    *(char *)(*param_1 + 0x73) = (char)iVar1;
    *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + param_2;
    return;
  }
  *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + param_2;
  return;
}



int FUN_140413130(longlong *param_1,undefined8 param_2,longlong *param_3)

{
  longlong lVar1;
  longlong lVar2;
  int iVar3;
  double *pdVar4;
  undefined8 uVar5;
  longlong lVar6;
  longlong *plVar7;
  uint uVar8;
  ulonglong uVar9;
  
  lVar1 = param_1[4];
  pdVar4 = (double *)FUN_140408d20(lVar1,param_1[1],param_2);
  lVar2 = *param_1;
  iVar3 = *(int *)(lVar2 + 0x4c);
  uVar9 = (ulonglong)iVar3;
  if (*(int *)(pdVar4 + 1) == 3) {
    iVar3 = (int)*pdVar4;
  }
  else {
    lVar6 = param_1[8];
    *(undefined4 *)(pdVar4 + 1) = 3;
    *pdVar4 = (double)(int)lVar6;
    if (*(int *)(lVar2 + 0x4c) < (int)param_1[8] + 1) {
      uVar5 = FUN_140406a50(lVar1,*(undefined8 *)(lVar2 + 0x10),lVar2 + 0x4c,0x10,0x3ffff,
                            "constant table overflow");
      *(undefined8 *)(lVar2 + 0x10) = uVar5;
    }
    if (iVar3 < *(int *)(lVar2 + 0x4c)) {
      lVar6 = uVar9 << 4;
      do {
        uVar8 = (int)uVar9 + 1;
        uVar9 = (ulonglong)uVar8;
        *(undefined4 *)(lVar6 + 8 + *(longlong *)(lVar2 + 0x10)) = 0;
        lVar6 = lVar6 + 0x10;
      } while ((int)uVar8 < *(int *)(lVar2 + 0x4c));
    }
    plVar7 = (longlong *)((longlong)(int)param_1[8] * 0x10 + *(longlong *)(lVar2 + 0x10));
    *plVar7 = *param_3;
    *(int *)(plVar7 + 1) = (int)param_3[1];
    if (((3 < (int)param_3[1]) && ((*(byte *)(*param_3 + 9) & 3) != 0)) &&
       ((*(byte *)(lVar2 + 9) & 4) != 0)) {
      FUN_14040acd0(lVar1,lVar2);
    }
    iVar3 = (int)param_1[8];
    *(int *)(param_1 + 8) = iVar3 + 1;
  }
  return iVar3;
}



void FUN_140413250(undefined8 param_1,undefined8 param_2)

{
  undefined8 local_18;
  undefined4 local_10;
  
  local_10 = 4;
  local_18 = param_2;
  FUN_140413130(param_1,&local_18,&local_18);
  return;
}



void FUN_140413280(undefined8 param_1,undefined8 param_2)

{
  undefined8 local_18;
  undefined4 local_10;
  
  local_10 = 3;
  local_18 = param_2;
  FUN_140413130(param_1,&local_18,&local_18);
  return;
}



void FUN_1404132b0(longlong *param_1,int *param_2,int param_3)

{
  uint *puVar1;
  
  if (*param_2 == 0xd) {
    puVar1 = (uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4);
    *puVar1 = *puVar1 ^ ((param_3 + 1) * 0x4000 ^
                        *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4)) &
                        0x7fc000;
    return;
  }
  if (*param_2 == 0xe) {
    *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4) =
         (param_3 + 1) * 0x800000 ^
         *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4) & 0x7fffff;
    puVar1 = (uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4);
    *puVar1 = *puVar1 ^ (*(int *)((longlong)param_1 + 0x3c) << 6 ^
                        *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4)) &
                        0x3fc0;
    FUN_1404130c0(param_1,1);
  }
  return;
}



void FUN_140413340(longlong *param_1,int *param_2)

{
  if (*param_2 == 0xd) {
    *param_2 = 0xc;
    param_2[2] = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4) >> 6 & 0xff;
    return;
  }
  if (*param_2 == 0xe) {
    *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4) =
         *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4) & 0x7fffff | 0x1000000
    ;
    *param_2 = 0xb;
  }
  return;
}



void FUN_1404133a0(longlong *param_1,longlong param_2)

{
  uint *puVar1;
  uint uVar2;
  uint *puVar3;
  
  puVar1 = (uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)*(int *)(param_2 + 8) * 4);
  if ((*(int *)(param_2 + 8) < 1) ||
     (puVar3 = puVar1 + -1, ((&DAT_1404757b8)[puVar1[-1] & 0x3f] & 0x80) == 0)) {
    puVar3 = puVar1;
  }
  uVar2 = *puVar3;
  *puVar3 = ((uint)((uVar2 & 0x3fc0) == 0) << 6 ^ uVar2) & 0x3fc0 ^ uVar2;
  return;
}



undefined8 FUN_1404133f0(undefined4 param_1,int *param_2,int *param_3)

{
  double _Y;
  double dVar1;
  double dVar2;
  
  if ((((*param_2 != 5) || (param_2[4] != -1)) || (param_2[5] != -1)) ||
     (((*param_3 != 5 || (param_3[4] != -1)) || (param_3[5] != -1)))) {
    return 0;
  }
  _Y = *(double *)(param_3 + 2);
  dVar2 = *(double *)(param_2 + 2);
  switch(param_1) {
  case 0xc:
    dVar2 = _Y + dVar2;
    break;
  case 0xd:
    dVar2 = dVar2 - _Y;
    break;
  case 0xe:
    dVar2 = _Y * dVar2;
    break;
  case 0xf:
    if (_Y == 0.0) {
      return 0;
    }
    dVar2 = dVar2 / _Y;
    break;
  case 0x10:
    if (_Y == 0.0) {
      return 0;
    }
    dVar1 = floor(dVar2 / _Y);
    dVar2 = dVar2 - dVar1 * _Y;
    break;
  case 0x11:
    dVar2 = pow(dVar2,_Y);
    break;
  case 0x12:
    dVar2 = -dVar2;
    break;
  default:
    dVar2 = 0.0;
    goto LAB_1404134fc;
  case 0x14:
    goto switchD_14041346a_caseD_14;
  }
  if (NAN(dVar2)) {
switchD_14041346a_caseD_14:
    return 0;
  }
LAB_1404134fc:
  *(double *)(param_2 + 2) = dVar2;
  return 1;
}



void FUN_140413550(longlong *param_1,undefined4 param_2)

{
  *(undefined4 *)(*(longlong *)(*param_1 + 0x28) + -4 + (longlong)(int)param_1[6] * 4) = param_2;
  return;
}



void FUN_140413570(longlong *param_1,undefined4 param_2,undefined4 param_3)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = *param_1;
  FUN_140412e60(param_1,(int)param_1[7],(int)param_1[6],0xff,(int)param_1[6]);
  *(undefined4 *)(param_1 + 7) = 0xffffffff;
  if (*(int *)(lVar1 + 0x50) < (int)param_1[6] + 1) {
    uVar2 = FUN_140406a50(param_1[4],*(undefined8 *)(lVar1 + 0x18),(int *)(lVar1 + 0x50),4,
                          0x7ffffffd,"code size overflow");
    *(undefined8 *)(lVar1 + 0x18) = uVar2;
  }
  *(undefined4 *)(*(longlong *)(lVar1 + 0x18) + (longlong)(int)param_1[6] * 4) = param_2;
  if (*(int *)(lVar1 + 0x54) < (int)param_1[6] + 1) {
    uVar2 = FUN_140406a50(param_1[4],*(undefined8 *)(lVar1 + 0x28),(int *)(lVar1 + 0x54),4,
                          0x7ffffffd,"code size overflow");
    *(undefined8 *)(lVar1 + 0x28) = uVar2;
  }
  *(undefined4 *)(*(longlong *)(lVar1 + 0x28) + (longlong)(int)param_1[6] * 4) = param_3;
  *(int *)(param_1 + 6) = (int)param_1[6] + 1;
  return;
}



void FUN_140413660(longlong param_1,uint param_2,uint param_3,int param_4,uint param_5)

{
  FUN_140413570(param_1,param_2 | ((param_4 << 9 | param_5) << 8 | param_3) << 6,
                *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
  return;
}



void FUN_140413690(longlong param_1,uint param_2,uint param_3,int param_4)

{
  FUN_140413570(param_1,param_2 | (param_4 << 8 | param_3) << 6,
                *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
  return;
}



void FUN_1404136b0(longlong param_1,uint param_2,int param_3,int param_4)

{
  undefined4 uVar1;
  uint uVar2;
  
  uVar2 = (param_3 + -1) / 0x32 + 1;
  if (param_4 == -1) {
    param_4 = 0;
  }
  uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8);
  if ((int)uVar2 < 0x200) {
    uVar2 = ((param_4 << 9 | uVar2) << 8 | param_2) << 6 | 0x22;
  }
  else {
    FUN_140413570(param_1,(param_4 << 0x11 | param_2) << 6 | 0x22,uVar1);
    uVar1 = *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8);
  }
  FUN_140413570(param_1,uVar2,uVar1);
  *(uint *)(param_1 + 0x3c) = param_2 + 1;
  return;
}



void FUN_140413750(longlong *param_1,uint param_2,int param_3)

{
  int iVar1;
  uint uVar2;
  
  iVar1 = (int)param_1[6];
  if (*(int *)((longlong)param_1 + 0x34) < iVar1) {
    if (iVar1 == 0) {
      if ((int)(uint)*(byte *)((longlong)param_1 + 0x4a) <= (int)param_2) {
        return;
      }
    }
    else {
      uVar2 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)(iVar1 + -1) * 4);
      if (((((byte)uVar2 & 0x3f) == 3) && ((int)(uVar2 >> 6 & 0xff) <= (int)param_2)) &&
         ((int)param_2 <= (int)((uVar2 >> 0x17) + 1))) {
        if ((int)(param_3 + -1 + param_2) <= (int)(uVar2 >> 0x17)) {
          return;
        }
        *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)(iVar1 + -1) * 4) =
             (param_3 + -1 + param_2) * 0x800000 | uVar2 & 0x7fffff;
        return;
      }
    }
  }
  FUN_140413570(param_1,(((param_2 - 1) + param_3) * 0x20000 | param_2) << 6 | 3,
                *(undefined4 *)(param_1[3] + 8));
  return;
}



ulonglong FUN_1404137f0(longlong *param_1)

{
  uint uVar1;
  ulonglong uVar2;
  uint uVar3;
  ulonglong uVar4;
  
  uVar1 = *(uint *)(param_1 + 7);
  *(undefined4 *)(param_1 + 7) = 0xffffffff;
  uVar2 = FUN_140413570(param_1,0x7fff8016,*(undefined4 *)(param_1[3] + 8));
  if (uVar1 != 0xffffffff) {
    if ((int)uVar2 == -1) {
      return (ulonglong)uVar1;
    }
    uVar4 = uVar2 & 0xffffffff;
    while ((uVar3 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)(int)uVar4 * 4) >> 0xe,
           uVar3 != 0x1fffe && (uVar3 = (uVar3 - 0x1fffe) + (int)uVar4, uVar3 != 0xffffffff))) {
      uVar4 = (ulonglong)uVar3;
    }
    FUN_140412d50(param_1,uVar4,uVar1);
    uVar2 = uVar2 & 0xffffffff;
  }
  return uVar2;
}



void FUN_140413890(longlong param_1,int param_2,int param_3)

{
  FUN_140413570(param_1,param_2 << 6 | (param_3 + 1) * 0x800000 | 0x1e,
                *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
  return;
}



void FUN_1404138b0(longlong *param_1,int param_2)

{
  int iVar1;
  uint uVar2;
  
  *(int *)((longlong)param_1 + 0x34) = (int)param_1[6];
  if (param_2 != -1) {
    iVar1 = (int)param_1[7];
    if (iVar1 == -1) {
      *(int *)(param_1 + 7) = param_2;
      return;
    }
    do {
      uVar2 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar1 * 4) >> 0xe;
      if (uVar2 == 0x1fffe) break;
      iVar1 = (uVar2 - 0x1fffe) + iVar1;
    } while (iVar1 != -1);
    FUN_140412d50(param_1);
  }
  return;
}



void FUN_140413910(longlong param_1,undefined4 *param_2)

{
  undefined4 uVar1;
  uint uVar2;
  
  switch(*param_2) {
  case 6:
    *param_2 = 0xc;
    return;
  case 7:
    uVar2 = param_2[2] << 0x17 | 4;
    break;
  case 8:
    uVar2 = param_2[2] << 0xe | 5;
    break;
  case 9:
    if ((((uint)param_2[3] >> 8 & 1) == 0) &&
       ((int)(uint)*(byte *)(param_1 + 0x4a) <= (int)param_2[3])) {
      *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
    }
    if ((((uint)param_2[2] >> 8 & 1) == 0) &&
       ((int)(uint)*(byte *)(param_1 + 0x4a) <= (int)param_2[2])) {
      *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
    }
    uVar2 = (param_2[2] << 9 | param_2[3]) << 0xe | 6;
    break;
  default:
    return;
  case 0xd:
  case 0xe:
    FUN_140413340(param_1,param_2);
    return;
  }
  uVar1 = FUN_140413570(param_1,uVar2,*(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
  *param_2 = 0xb;
  param_2[2] = uVar1;
  return;
}



void FUN_1404139f0(longlong *param_1,int *param_2,uint param_3)

{
  uint *puVar1;
  undefined4 uVar2;
  longlong lVar3;
  int iVar4;
  uint uVar5;
  undefined8 local_18;
  undefined4 local_10;
  
  FUN_140413910();
  switch(*param_2) {
  case 1:
    FUN_140413750(param_1,param_3,1);
    break;
  case 2:
  case 3:
    uVar5 = ((uint)(*param_2 == 2) << 0x11 | param_3) << 6 | 2;
    goto LAB_140413ad8;
  case 4:
    uVar5 = (param_2[2] << 8 | param_3) << 6 | 1;
LAB_140413ad8:
    uVar2 = *(undefined4 *)(param_1[3] + 8);
LAB_140413ae0:
    FUN_140413570(param_1,uVar5,uVar2);
    break;
  case 5:
    local_18 = *(undefined8 *)(param_2 + 2);
    local_10 = 3;
    iVar4 = FUN_140413130(param_1,&local_18,&local_18);
    uVar2 = *(undefined4 *)(param_1[3] + 8);
    uVar5 = (iVar4 << 8 | param_3) << 6 | 1;
    goto LAB_140413ae0;
  default:
    goto switchD_140413a31_caseD_6;
  case 0xb:
    iVar4 = param_2[2];
    lVar3 = *(longlong *)(*param_1 + 0x18);
    puVar1 = (uint *)(lVar3 + (longlong)iVar4 * 4);
    *puVar1 = *puVar1 & 0xffffc03f;
    puVar1 = (uint *)(lVar3 + (longlong)iVar4 * 4);
    *puVar1 = *puVar1 | (param_3 & 0xff) << 6;
    break;
  case 0xc:
    if (param_3 != param_2[2]) {
      uVar5 = (param_2[2] << 0x11 | param_3) << 6;
      goto LAB_140413ad8;
    }
  }
  param_2[2] = param_3;
  *param_2 = 0xc;
switchD_140413a31_caseD_6:
  return;
}



void FUN_140413b40(longlong param_1,int *param_2)

{
  if (*param_2 != 0xc) {
    FUN_1404130c0(param_1,1);
    FUN_1404139f0(param_1,param_2,*(int *)(param_1 + 0x3c) + -1);
  }
  return;
}



void FUN_140413b80(longlong *param_1,int *param_2,int param_3)

{
  uint *puVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  uint uVar7;
  int iVar8;
  uint *puVar9;
  
  FUN_1404139f0();
  if ((*param_2 == 10) && (iVar3 = param_2[2], iVar3 != -1)) {
    if (param_2[4] == -1) {
      param_2[4] = iVar3;
    }
    else {
      iVar8 = param_2[4];
      do {
        iVar2 = iVar8;
        uVar7 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar2 * 4) >> 0xe;
        if (uVar7 == 0x1fffe) break;
        iVar8 = (uVar7 - 0x1fffe) + iVar2;
      } while (iVar8 != -1);
      FUN_140412d50(param_1,iVar2,iVar3);
    }
  }
  iVar3 = param_2[4];
  iVar8 = param_2[5];
  if (iVar3 == iVar8) goto LAB_140413d75;
  if (iVar3 != -1) {
    do {
      puVar1 = (uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar3 * 4);
      if ((iVar3 < 1) || (puVar9 = puVar1 + -1, ((&DAT_1404757b8)[puVar1[-1] & 0x3f] & 0x80) == 0))
      {
        puVar9 = puVar1;
      }
      if (((byte)*puVar9 & 0x3f) != 0x1b) goto LAB_140413cc4;
      iVar2 = (*puVar1 >> 0xe) - 0x1ffff;
    } while ((iVar2 != -1) && (iVar3 = iVar3 + 1 + iVar2, iVar3 != -1));
  }
  uVar5 = 0xffffffff;
  uVar6 = 0xffffffff;
  if (iVar8 != -1) {
    do {
      puVar1 = (uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar8 * 4);
      if ((iVar8 < 1) || (puVar9 = puVar1 + -1, ((&DAT_1404757b8)[puVar1[-1] & 0x3f] & 0x80) == 0))
      {
        puVar9 = puVar1;
      }
      if (((byte)*puVar9 & 0x3f) != 0x1b) goto LAB_140413cc4;
      iVar3 = (*puVar1 >> 0xe) - 0x1ffff;
      uVar5 = 0xffffffff;
      uVar6 = 0xffffffff;
    } while ((iVar3 != -1) && (iVar8 = iVar8 + 1 + iVar3, uVar6 = 0xffffffff, iVar8 != -1));
  }
LAB_140413d34:
  uVar4 = (undefined4)param_1[6];
  *(undefined4 *)((longlong)param_1 + 0x34) = uVar4;
  FUN_140412e60(param_1,param_2[5],uVar4,param_3,uVar5);
  FUN_140412e60(param_1,param_2[4],uVar4,param_3,uVar6);
LAB_140413d75:
  param_2[4] = -1;
  param_2[5] = -1;
  param_2[2] = param_3;
  *param_2 = 0xc;
  return;
LAB_140413cc4:
  if (*param_2 == 10) {
    uVar4 = 0xffffffff;
  }
  else {
    uVar4 = FUN_1404137f0(param_1);
  }
  *(int *)((longlong)param_1 + 0x34) = (int)param_1[6];
  uVar5 = FUN_140413570(param_1,param_3 << 6 | 0x4002,*(undefined4 *)(param_1[3] + 8));
  *(int *)((longlong)param_1 + 0x34) = (int)param_1[6];
  uVar6 = FUN_140413570(param_1,param_3 << 6 | 0x800002,*(undefined4 *)(param_1[3] + 8));
  FUN_1404138b0(param_1,uVar4);
  goto LAB_140413d34;
}



void FUN_140413d90(longlong *param_1,int *param_2)

{
  int iVar1;
  
  FUN_140413910();
  if (((*param_2 == 0xc) && (((uint)param_2[2] >> 8 & 1) == 0)) &&
     ((int)(uint)*(byte *)((longlong)param_1 + 0x4a) <= param_2[2])) {
    *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + -1;
  }
  iVar1 = *(int *)((longlong)param_1 + 0x3c) + 1;
  if ((int)(uint)*(byte *)(*param_1 + 0x73) < iVar1) {
    if (0xf9 < iVar1) {
      FUN_140407020(param_1[3],"function or expression too complex");
    }
    *(char *)(*param_1 + 0x73) = (char)iVar1;
  }
  *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + 1;
  FUN_140413b80(param_1,param_2,*(int *)((longlong)param_1 + 0x3c) + -1);
  return;
}



int FUN_140413e20(longlong param_1,int *param_2)

{
  FUN_140413910();
  if (*param_2 == 0xc) {
    if (param_2[4] == param_2[5]) goto LAB_140413e73;
    if ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_2[2]) {
      FUN_140413b80(param_1,param_2);
      return param_2[2];
    }
  }
  FUN_140413d90(param_1,param_2);
LAB_140413e73:
  return param_2[2];
}



void FUN_140413e90(longlong param_1,int *param_2)

{
  if (param_2[4] == param_2[5]) {
    FUN_140413910();
    return;
  }
  FUN_140413910();
  if (*param_2 == 0xc) {
    if (param_2[4] == param_2[5]) {
      return;
    }
    if ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_2[2]) {
      FUN_140413b80(param_1,param_2);
      return;
    }
  }
  FUN_140413d90(param_1,param_2);
  return;
}



uint FUN_140413f10(longlong param_1,int *param_2)

{
  int iVar1;
  uint uVar2;
  undefined8 *puVar3;
  undefined8 local_28;
  undefined4 local_20;
  undefined8 local_18;
  undefined4 local_10;
  
  FUN_140413e90();
  iVar1 = *param_2;
  if (0 < iVar1) {
    if (iVar1 < 4) {
LAB_140413fa2:
      if (*(int *)(param_1 + 0x40) < 0x100) {
        if (iVar1 == 1) {
          local_20 = 5;
          puVar3 = &local_18;
          local_10 = 0;
          local_28 = *(undefined8 *)(param_1 + 8);
        }
        else {
          puVar3 = &local_28;
          if (iVar1 == 5) {
            local_28 = *(undefined8 *)(param_2 + 2);
            local_20 = 3;
          }
          else {
            local_20 = 1;
            local_28 = CONCAT44(local_28._4_4_,(uint)(iVar1 == 2));
          }
        }
        uVar2 = FUN_140413130(param_1,&local_28,puVar3);
        *param_2 = 4;
        param_2[2] = uVar2;
        return uVar2 | 0x100;
      }
    }
    else if (iVar1 == 4) {
      if (param_2[2] < 0x100) {
        return param_2[2] | 0x100;
      }
    }
    else if (iVar1 == 5) goto LAB_140413fa2;
  }
  FUN_140413910(param_1,param_2);
  if (*param_2 == 0xc) {
    if (param_2[4] == param_2[5]) goto LAB_140414034;
    if ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_2[2]) {
      FUN_140413b80(param_1,param_2);
      return param_2[2];
    }
  }
  FUN_140413d90(param_1,param_2);
LAB_140414034:
  return param_2[2];
}



void FUN_140414050(longlong param_1,int *param_2,int *param_3)

{
  int iVar1;
  uint uVar2;
  
  iVar1 = *param_2;
  if (iVar1 == 6) {
    if (((*param_3 == 0xc) && (((uint)param_3[2] >> 8 & 1) == 0)) &&
       ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_3[2])) {
      *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
    }
    FUN_140413b80(param_1,param_3,param_2[2]);
    return;
  }
  if (iVar1 == 7) {
    uVar2 = FUN_140413e20(param_1,param_3);
    uVar2 = (param_2[2] << 0x11 | uVar2) << 6 | 8;
  }
  else if (iVar1 == 8) {
    uVar2 = FUN_140413e20(param_1,param_3);
    uVar2 = (param_2[2] << 8 | uVar2) << 6 | 7;
  }
  else {
    if (iVar1 != 9) goto LAB_1404140e4;
    uVar2 = FUN_140413f10(param_1,param_3);
    uVar2 = ((param_2[3] << 9 | uVar2) << 8 | param_2[2]) << 6 | 9;
  }
  FUN_140413570(param_1,uVar2,*(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
LAB_1404140e4:
  if (((*param_3 == 0xc) && (((uint)param_3[2] >> 8 & 1) == 0)) &&
     ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_3[2])) {
    *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
    return;
  }
  return;
}



void FUN_140414150(longlong *param_1,int *param_2,int *param_3)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  
  FUN_140413910();
  if (*param_2 == 0xc) {
    if (param_2[4] == param_2[5]) goto LAB_1404141aa;
    if ((int)(uint)*(byte *)((longlong)param_1 + 0x4a) <= param_2[2]) {
      FUN_140413b80(param_1,param_2);
      goto LAB_1404141aa;
    }
  }
  FUN_140413d90(param_1,param_2);
LAB_1404141aa:
  if (((*param_2 == 0xc) && (((uint)param_2[2] >> 8 & 1) == 0)) &&
     ((int)(uint)*(byte *)((longlong)param_1 + 0x4a) <= param_2[2])) {
    *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + -1;
  }
  uVar2 = *(uint *)((longlong)param_1 + 0x3c);
  iVar1 = uVar2 + 2;
  if ((int)(uint)*(byte *)(*param_1 + 0x73) < iVar1) {
    if (0xf9 < iVar1) {
      FUN_140407020(param_1[3],"function or expression too complex");
    }
    *(char *)(*param_1 + 0x73) = (char)iVar1;
  }
  *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + 2;
  uVar3 = FUN_140413f10(param_1,param_3);
  FUN_140413570(param_1,((param_2[2] << 9 | uVar3) << 8 | uVar2) << 6 | 0xb,
                *(undefined4 *)(param_1[3] + 8));
  if (((*param_3 == 0xc) && (((uint)param_3[2] >> 8 & 1) == 0)) &&
     ((int)(uint)*(byte *)((longlong)param_1 + 0x4a) <= param_3[2])) {
    *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + -1;
  }
  param_2[2] = uVar2;
  *param_2 = 0xc;
  return;
}



void FUN_140414270(longlong *param_1,int *param_2,uint param_3)

{
  undefined4 uVar1;
  uint uVar2;
  
  if (*param_2 == 0xb) {
    uVar2 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_2[2] * 4);
    if (((byte)uVar2 & 0x3f) == 0x13) {
      *(int *)(param_1 + 6) = (int)param_1[6] + -1;
      uVar1 = *(undefined4 *)(param_1[3] + 8);
      uVar2 = (uVar2 & 0xffb5ffff | 0x340000) >> 0x11 | (uint)(param_3 == 0) << 0xe;
      goto LAB_140414326;
    }
  }
  if (*param_2 == 0xc) {
LAB_1404142f9:
    if ((((uint)param_2[2] >> 8 & 1) == 0) &&
       ((int)(uint)*(byte *)((longlong)param_1 + 0x4a) <= param_2[2])) {
      *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + -1;
    }
  }
  else {
    FUN_1404130c0(param_1,1);
    FUN_1404139f0(param_1,param_2,*(int *)((longlong)param_1 + 0x3c) + -1);
    if (*param_2 == 0xc) goto LAB_1404142f9;
  }
  uVar1 = *(undefined4 *)(param_1[3] + 8);
  uVar2 = (param_2[2] << 9 | param_3) << 0xe | 0x3fdb;
LAB_140414326:
  FUN_140413570(param_1,uVar2,uVar1);
  FUN_1404137f0(param_1);
  return;
}



void FUN_140414350(longlong *param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  
  FUN_140413910();
  iVar1 = *param_2;
  if (iVar1 == 2) {
LAB_1404143b3:
    iVar1 = -1;
  }
  else {
    if (iVar1 == 3) {
      iVar1 = FUN_1404137f0(param_1);
      goto LAB_1404143b7;
    }
    if (3 < iVar1) {
      if (iVar1 < 6) goto LAB_1404143b3;
      if (iVar1 == 10) {
        FUN_1404133a0(param_1,param_2);
        iVar1 = param_2[2];
        goto LAB_1404143b7;
      }
    }
    iVar1 = FUN_140414270(param_1,param_2,0);
  }
LAB_1404143b7:
  if (iVar1 != -1) {
    iVar2 = param_2[5];
    if (iVar2 == -1) {
      param_2[5] = iVar1;
    }
    else {
      do {
        uVar3 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar2 * 4) >> 0xe;
        if (uVar3 == 0x1fffe) break;
        iVar2 = (uVar3 - 0x1fffe) + iVar2;
      } while (iVar2 != -1);
      FUN_140412d50(param_1);
    }
  }
  iVar1 = param_2[4];
  *(int *)((longlong)param_1 + 0x34) = (int)param_1[6];
  if (iVar1 != -1) {
    iVar2 = (int)param_1[7];
    if (iVar2 == -1) {
      *(int *)(param_1 + 7) = iVar1;
      param_2[4] = -1;
      return;
    }
    do {
      uVar3 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar2 * 4) >> 0xe;
      if (uVar3 == 0x1fffe) break;
      iVar2 = (uVar3 - 0x1fffe) + iVar2;
    } while (iVar2 != -1);
    FUN_140412d50(param_1);
  }
  param_2[4] = -1;
  return;
}



void FUN_140414480(longlong *param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  
  FUN_140413910();
  iVar1 = *param_2;
  if (iVar1 != 1) {
    if (iVar1 == 2) {
      iVar1 = FUN_1404137f0(param_1);
      goto LAB_1404144d5;
    }
    if (iVar1 != 3) {
      if (iVar1 == 10) {
        iVar1 = param_2[2];
      }
      else {
        iVar1 = FUN_140414270(param_1,param_2,1);
      }
      goto LAB_1404144d5;
    }
  }
  iVar1 = -1;
LAB_1404144d5:
  if (iVar1 != -1) {
    iVar2 = param_2[4];
    if (iVar2 == -1) {
      param_2[4] = iVar1;
    }
    else {
      do {
        uVar3 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar2 * 4) >> 0xe;
        if (uVar3 == 0x1fffe) break;
        iVar2 = (uVar3 - 0x1fffe) + iVar2;
      } while (iVar2 != -1);
      FUN_140412d50(param_1);
    }
  }
  iVar1 = param_2[5];
  *(int *)((longlong)param_1 + 0x34) = (int)param_1[6];
  if (iVar1 != -1) {
    iVar2 = (int)param_1[7];
    if (iVar2 == -1) {
      *(int *)(param_1 + 7) = iVar1;
      param_2[5] = -1;
      return;
    }
    do {
      uVar3 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar2 * 4) >> 0xe;
      if (uVar3 == 0x1fffe) break;
      iVar2 = (uVar3 - 0x1fffe) + iVar2;
    } while (iVar2 != -1);
    FUN_140412d50(param_1);
  }
  param_2[5] = -1;
  return;
}



void FUN_140414590(longlong param_1,int *param_2)

{
  int iVar1;
  
  FUN_140413910();
  switch(*param_2) {
  case 1:
  case 3:
    *param_2 = 2;
    break;
  case 2:
  case 4:
  case 5:
    *param_2 = 3;
    break;
  case 10:
    FUN_1404133a0(param_1,param_2);
    break;
  case 0xb:
  case 0xc:
    FUN_140413b40(param_1,param_2);
    if (((*param_2 == 0xc) && (((uint)param_2[2] >> 8 & 1) == 0)) &&
       ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_2[2])) {
      *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
    }
    iVar1 = FUN_140413570(param_1,param_2[2] << 0x17 | 0x13,
                          *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
    *param_2 = 0xb;
    param_2[2] = iVar1;
  }
  iVar1 = param_2[5];
  param_2[5] = param_2[4];
  param_2[4] = iVar1;
  FUN_140412dd0(param_1);
  FUN_140412dd0(param_1,param_2[4]);
  return;
}



void FUN_140414690(undefined8 param_1,undefined4 *param_2,undefined8 param_3)

{
  undefined4 uVar1;
  
  uVar1 = FUN_140413f10(param_1,param_3);
  *param_2 = 9;
  param_2[3] = uVar1;
  return;
}



void FUN_1404146b0(longlong param_1,uint param_2,int *param_3,int *param_4)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  
  iVar1 = FUN_1404133f0(param_2,param_3,param_4);
  if (iVar1 != 0) {
    return;
  }
  if ((param_2 == 0x12) || (param_2 == 0x14)) {
    uVar2 = 0;
  }
  else {
    uVar2 = FUN_140413f10(param_1,param_4);
  }
  iVar1 = FUN_140413f10(param_1,param_3);
  if ((int)uVar2 < iVar1) {
    if (((*param_3 == 0xc) && (((uint)param_3[2] >> 8 & 1) == 0)) &&
       ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_3[2])) {
      *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
    }
    if (*param_4 != 0xc) goto LAB_14041476e;
    uVar3 = param_4[2];
  }
  else {
    if (((*param_4 == 0xc) && (((uint)param_4[2] >> 8 & 1) == 0)) &&
       ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_4[2])) {
      *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
    }
    if (*param_3 != 0xc) goto LAB_14041476e;
    uVar3 = param_3[2];
  }
  if (((uVar3 >> 8 & 1) == 0) && ((int)(uint)*(byte *)(param_1 + 0x4a) <= (int)uVar3)) {
    *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
  }
LAB_14041476e:
  iVar1 = FUN_140413570(param_1,(iVar1 << 9 | uVar2) << 0xe | param_2,
                        *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
  *param_3 = 0xb;
  param_3[2] = iVar1;
  return;
}



void FUN_1404147c0(longlong param_1,uint param_2,uint param_3,int *param_4,int *param_5)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  
  uVar1 = FUN_140413f10(param_1,param_4);
  uVar2 = FUN_140413f10(param_1,param_5);
  if (((*param_5 == 0xc) && (((uint)param_5[2] >> 8 & 1) == 0)) &&
     ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_5[2])) {
    *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
  }
  if (((*param_4 == 0xc) && (((uint)param_4[2] >> 8 & 1) == 0)) &&
     ((int)(uint)*(byte *)(param_1 + 0x4a) <= param_4[2])) {
    *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
  }
  uVar4 = uVar1;
  if ((param_3 == 0) && (param_2 != 0x17)) {
    param_3 = 1;
    uVar4 = uVar2;
    uVar2 = uVar1;
  }
  FUN_140413570(param_1,((uVar4 << 9 | uVar2) << 8 | param_3) << 6 | param_2,
                *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
  iVar3 = FUN_1404137f0(param_1);
  param_4[2] = iVar3;
  *param_4 = 10;
  return;
}



void FUN_1404148a0(longlong param_1,int param_2,int *param_3)

{
  uint uVar1;
  int iVar2;
  int iVar3;
  bool bVar4;
  undefined4 local_28 [2];
  undefined8 local_20;
  undefined8 local_18;
  
  local_18 = 0xffffffffffffffff;
  local_28[0] = 5;
  local_20 = 0;
  if (param_2 == 0) {
    if (((*param_3 != 5) || (param_3[4] != -1)) || (param_3[5] != -1)) {
      FUN_140413e20(0,param_3);
    }
    FUN_1404146b0(param_1,0x12,param_3,local_28);
    return;
  }
  if (param_2 == 1) {
    FUN_140414590(0,param_3);
    return;
  }
  if (param_2 != 2) {
    return;
  }
  FUN_140413e20(0,param_3);
  iVar3 = FUN_140413f10(param_1,param_3);
  if (iVar3 < 1) {
    if ((*param_3 != 0xc) || (uVar1 = param_3[2], (uVar1 >> 8 & 1) != 0)) goto LAB_14041492c;
    bVar4 = SBORROW4(uVar1,(uint)*(byte *)(param_1 + 0x4a));
    iVar2 = uVar1 - *(byte *)(param_1 + 0x4a);
  }
  else {
    if ((*param_3 != 0xc) || (uVar1 = param_3[2], (uVar1 >> 8 & 1) != 0)) goto LAB_14041492c;
    bVar4 = SBORROW4(uVar1,(uint)*(byte *)(param_1 + 0x4a));
    iVar2 = uVar1 - *(byte *)(param_1 + 0x4a);
  }
  if (bVar4 == iVar2 < 0) {
    *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + -1;
  }
LAB_14041492c:
  iVar3 = FUN_140413570(param_1,iVar3 << 0x17 | 0x14,
                        *(undefined4 *)(*(longlong *)(param_1 + 0x18) + 8));
  *param_3 = 0xb;
  param_3[2] = iVar3;
  return;
}



void FUN_1404149b0(undefined8 param_1,int param_2,int *param_3)

{
  if (-1 < param_2) {
    if (param_2 < 6) {
      if (((*param_3 == 5) && (param_3[4] == -1)) && (param_3[5] == -1)) {
        return;
      }
    }
    else {
      if (param_2 == 6) {
        FUN_140413d90(param_1,param_3);
        return;
      }
      if (param_2 == 0xd) {
        FUN_140414350(param_1,param_3);
        return;
      }
      if (param_2 == 0xe) {
        FUN_140414480(param_1,param_3);
        return;
      }
    }
  }
  FUN_140413f10(param_1,param_3);
  return;
}



void FUN_140414a20(longlong *param_1,undefined4 param_2,int *param_3,int *param_4)

{
  int iVar1;
  longlong lVar2;
  int *piVar3;
  undefined8 uVar4;
  undefined8 uVar5;
  
  switch(param_2) {
  case 0:
    FUN_1404146b0(param_1,0xc);
    return;
  case 1:
    FUN_1404146b0(param_1,0xd);
    return;
  case 2:
    FUN_1404146b0(param_1,0xe);
    return;
  case 3:
    FUN_1404146b0(param_1,0xf);
    return;
  case 4:
    FUN_1404146b0(param_1,0x10);
    return;
  case 5:
    FUN_1404146b0(param_1,0x11);
    return;
  case 6:
    FUN_140413e90(param_1,param_4);
    if ((*param_4 == 0xb) &&
       (((byte)*(undefined4 *)(*(longlong *)(*param_1 + 0x18) + (longlong)param_4[2] * 4) & 0x3f) ==
        0x15)) {
      if ((*param_3 == 0xc) &&
         ((((uint)param_3[2] >> 8 & 1) == 0 &&
          ((int)(uint)*(byte *)((longlong)param_1 + 0x4a) <= param_3[2])))) {
        *(int *)((longlong)param_1 + 0x3c) = *(int *)((longlong)param_1 + 0x3c) + -1;
      }
      lVar2 = *(longlong *)(*param_1 + 0x18);
      *(uint *)(lVar2 + (longlong)param_4[2] * 4) =
           *(uint *)(lVar2 + (longlong)param_4[2] * 4) & 0x7fffff | param_3[2] << 0x17;
      *param_3 = 0xb;
      param_3[2] = param_4[2];
      return;
    }
    FUN_140413d90(param_1,param_4);
    FUN_1404146b0(param_1,0x15,param_3,param_4);
    return;
  case 7:
    uVar4 = 0x17;
    goto LAB_140414c47;
  case 8:
    uVar4 = 0x17;
    uVar5 = 1;
    break;
  case 9:
    uVar4 = 0x18;
    uVar5 = 1;
    break;
  case 10:
    uVar4 = 0x19;
    uVar5 = 1;
    break;
  case 0xb:
    uVar4 = 0x18;
    goto LAB_140414c47;
  case 0xc:
    uVar4 = 0x19;
LAB_140414c47:
    uVar5 = 0;
    break;
  case 0xd:
    FUN_140413910(param_1,param_4);
    iVar1 = param_3[5];
    piVar3 = param_4 + 5;
    goto LAB_140414a6a;
  case 0xe:
    FUN_140413910(param_1,param_4);
    iVar1 = param_3[4];
    piVar3 = param_4 + 4;
LAB_140414a6a:
    FUN_140413010(param_1,piVar3,iVar1);
    *(undefined8 *)param_3 = *(undefined8 *)param_4;
    *(undefined8 *)(param_3 + 2) = *(undefined8 *)(param_4 + 2);
    *(undefined8 *)(param_3 + 4) = *(undefined8 *)(param_4 + 4);
    return;
  default:
    goto switchD_140414a55_default;
  }
  FUN_1404147c0(param_1,uVar4,uVar5,param_3,param_4);
switchD_140414a55_default:
  return;
}



void FUN_140414cb0(longlong *param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  
  if (param_3 == (int)param_1[6]) {
    *(int *)((longlong)param_1 + 0x34) = (int)param_1[6];
    if (param_2 != -1) {
      if ((int)param_1[7] == -1) {
        *(int *)(param_1 + 7) = param_2;
        return;
      }
      iVar2 = (int)param_1[7];
      do {
        iVar1 = iVar2;
        uVar3 = *(uint *)(*(longlong *)(*param_1 + 0x18) + (longlong)iVar1 * 4) >> 0xe;
        if (uVar3 == 0x1fffe) break;
        iVar2 = (uVar3 - 0x1fffe) + iVar1;
      } while (iVar2 != -1);
      FUN_140412d50(param_1,iVar1,param_2);
      return;
    }
  }
  else {
    FUN_140412e60();
  }
  return;
}



ushort __thiscall std::basic_streambuf<>::underflow(basic_streambuf<> *this)

{
  ushort uVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414d36. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar1 = underflow(this);
  return uVar1;
}



ushort __thiscall std::basic_streambuf<>::overflow(basic_streambuf<> *this,ushort param_1)

{
  ushort uVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414d3c. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar1 = overflow(this,param_1);
  return uVar1;
}



// Library Function - Multiple Matches With Same Base Name
//  private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *
// __ptr64)
//  void __cdecl std::_Facet_Register(class std::_Facet_base * __ptr64)
// 
// Libraries: Visual Studio 2010 Release, Visual Studio 2012 Release

void Facet_Register(undefined8 param_1)

{
  undefined8 *puVar1;
  
  puVar1 = operator_new(0x10);
  if (puVar1 != (undefined8 *)0x0) {
    puVar1[1] = param_1;
    *puVar1 = DAT_1405f6d68;
  }
  DAT_1405f6d68 = puVar1;
  return;
}



// Library Function - Single Match
//  public: __cdecl std::_Fac_tidy_reg_t::~_Fac_tidy_reg_t(void) __ptr64
// 
// Library: Visual Studio 2010 Release

void __thiscall std::_Fac_tidy_reg_t::~_Fac_tidy_reg_t(_Fac_tidy_reg_t *this)

{
  undefined8 *puVar1;
  undefined8 *puVar2;
  facet *pfVar3;
  undefined8 in_R9;
  _Lockit local_res10 [24];
  undefined8 uVar4;
  
  uVar4 = 0xfffffffffffffffe;
  std::_Lockit::_Lockit(local_res10,0);
  while (puVar2 = DAT_1405f6d68, DAT_1405f6d68 != (undefined8 *)0x0) {
    puVar1 = DAT_1405f6d68 + 1;
    DAT_1405f6d68 = (undefined8 *)*DAT_1405f6d68;
    pfVar3 = std::locale::facet::_Decref((facet *)*puVar1);
    if (pfVar3 != (facet *)0x0) {
      (*(code *)**(undefined8 **)pfVar3)(pfVar3,1,*(undefined8 **)pfVar3,in_R9,uVar4);
    }
    operator_delete(puVar2);
  }
  std::_Lockit::~_Lockit(local_res10);
  return;
}



ushort __thiscall std::basic_streambuf<>::pbackfail(basic_streambuf<> *this,ushort param_1)

{
  ushort uVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414de4. Too many branches
                    // WARNING: Treating indirect jump as call
  uVar1 = pbackfail(this,param_1);
  return uVar1;
}



void __thiscall
std::basic_streambuf<>::seekoff(basic_streambuf<> *this,__int64 param_1,int param_2,int param_3)

{
                    // WARNING: Could not recover jumptable at 0x000140414dea. Too many branches
                    // WARNING: Treating indirect jump as call
  seekoff(this,param_1,param_2,param_3);
  return;
}



void __thiscall std::basic_streambuf<>::seekpos(void)

{
                    // WARNING: Could not recover jumptable at 0x000140414df0. Too many branches
                    // WARNING: Treating indirect jump as call
  seekpos();
  return;
}



double __cdecl sin(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414df6. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = sin(_X);
  return dVar1;
}



double __cdecl sinh(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414dfc. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = sinh(_X);
  return dVar1;
}



double __cdecl cos(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e02. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = cos(_X);
  return dVar1;
}



double __cdecl cosh(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e08. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = cosh(_X);
  return dVar1;
}



double __cdecl tan(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e0e. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = tan(_X);
  return dVar1;
}



double __cdecl tanh(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e14. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = tanh(_X);
  return dVar1;
}



double __cdecl asin(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e1a. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = asin(_X);
  return dVar1;
}



double __cdecl acos(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e20. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = acos(_X);
  return dVar1;
}



double __cdecl atan(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e26. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = atan(_X);
  return dVar1;
}



double __cdecl atan2(double _Y,double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e2c. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = atan2(_Y,_X);
  return dVar1;
}



double __cdecl ceil(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e32. 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 0x000140414e38. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = floor(_X);
  return dVar1;
}



double __cdecl fmod(double _X,double _Y)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e3e. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = fmod(_X,_Y);
  return dVar1;
}



double __cdecl sqrt(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e44. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = sqrt(_X);
  return dVar1;
}



double __cdecl pow(double _X,double _Y)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e4a. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = pow(_X,_Y);
  return dVar1;
}



double __cdecl log(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e50. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = log(_X);
  return dVar1;
}



double __cdecl log10(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e56. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = log10(_X);
  return dVar1;
}



double __cdecl exp(double _X)

{
  double dVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e5c. Too many branches
                    // WARNING: Treating indirect jump as call
  dVar1 = exp(_X);
  return dVar1;
}



int __cdecl _setjmp(_JBTYPE *_Buf)

{
  int iVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140414e62. Too many branches
                    // WARNING: Treating indirect jump as call
  iVar1 = _setjmp(_Buf);
  return iVar1;
}



void FUN_140414e80(int *param_1)

{
  int iVar1;
  longlong lVar2;
  int iVar3;
  
  if (*param_1 < 1) {
    DAT_1405ecf50 = -*param_1;
    if (DAT_1405ecf50 < 1) {
      DAT_1405ecf50 = 1;
    }
    lVar2 = 0x27;
    *param_1 = DAT_1405ecf50;
    do {
      iVar3 = *param_1 * 0x9c4e + (*param_1 / 0xd1a4) * -0x7fffffab;
      *param_1 = iVar3;
      if (iVar3 < 0) {
        *param_1 = iVar3 + 0x7fffffab;
      }
      if (lVar2 < 0x20) {
        (&DAT_140608750)[lVar2] = *param_1;
      }
      lVar2 = lVar2 + -1;
      DAT_140608288 = DAT_140608750;
    } while (-1 < lVar2);
  }
  iVar3 = *param_1 * 0x9c4e + (*param_1 / 0xd1a4) * -0x7fffffab;
  *param_1 = iVar3;
  if (iVar3 < 0) {
    *param_1 = iVar3 + 0x7fffffab;
  }
  iVar3 = DAT_1405ecf50 * 0x9ef4 + (DAT_1405ecf50 / 0xce26) * -0x7fffff07;
  if (iVar3 < 0) {
    iVar3 = iVar3 + 0x7fffff07;
  }
  iVar1 = (&DAT_140608750)[DAT_140608288 / 0x3fffffe];
  DAT_1405ecf50 = iVar3;
  (&DAT_140608750)[DAT_140608288 / 0x3fffffe] = *param_1;
  DAT_140608288 = iVar1 - iVar3;
  if (DAT_140608288 < 1) {
    DAT_140608288 = DAT_140608288 + 0x7fffffaa;
  }
  return;
}



double FUN_140414fe0(void)

{
  double dVar1;
  longlong lVar2;
  double dVar3;
  
  lVar2 = DAT_140607cf8;
  dVar3 = (double)FUN_1402d5be0(DAT_140607cf8);
  dVar1 = *(double *)(lVar2 + 0x1390);
  return ((dVar3 - 0.0) / 1.0) * (*(double *)(lVar2 + 0x1398) - dVar1) + dVar1;
}



undefined8 FUN_140415080(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_1404150b0(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;
}



void FUN_1404151b0(undefined8 *param_1)

{
  short *psVar1;
  ulonglong uVar2;
  ulonglong uVar3;
  ulonglong uVar4;
  undefined8 *puVar5;
  
  uVar2 = param_1[2];
  uVar4 = 0;
  if (uVar2 != 0) {
    do {
      uVar3 = param_1[3];
      puVar5 = param_1;
      if (7 < uVar3) {
        puVar5 = (undefined8 *)*param_1;
      }
      if (0x40 < *(ushort *)((longlong)puVar5 + uVar4 * 2)) {
        puVar5 = param_1;
        if (7 < uVar3) {
          puVar5 = (undefined8 *)*param_1;
        }
        if (*(ushort *)((longlong)puVar5 + uVar4 * 2) < 0x5b) {
          puVar5 = param_1;
          if (7 < uVar3) {
            puVar5 = (undefined8 *)*param_1;
          }
          psVar1 = (short *)((longlong)puVar5 + uVar4 * 2);
          *psVar1 = *psVar1 + 0x20;
        }
      }
      uVar4 = uVar4 + 1;
    } while (uVar4 < uVar2);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 * FUN_140415220(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_1405d84f0 ^ (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_140003e50(param_1,local_428,~uVar4 - 1);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined2 * FUN_140415310(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_1405d84f0 ^ (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_140001710(param_1,&local_828,~uVar4 - 1);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1404153f0(undefined8 param_1,longlong param_2,ulonglong param_3)

{
  short sVar1;
  ulonglong uVar2;
  short *psVar3;
  undefined1 auStack_248 [32];
  short local_228 [264];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_248;
  memset(local_228,0,0x208);
  uVar2 = 0;
  if (param_3 != 0) {
    do {
      sVar1 = *(short *)(param_2 + uVar2 * 2);
      if (sVar1 == 0x2e) break;
      local_228[uVar2] = sVar1;
      uVar2 = uVar2 + 1;
    } while (uVar2 < param_3);
  }
  uVar2 = 0xffffffffffffffff;
  psVar3 = local_228;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    sVar1 = *psVar3;
    psVar3 = psVar3 + 1;
  } while (sVar1 != 0);
  FUN_140001710(param_1,local_228,~uVar2 - 1);
  FUN_140002aa0(param_1,L".height",7);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined2 *
FUN_1404154c0(undefined2 *param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t wVar1;
  short sVar2;
  int iVar3;
  longlong lVar4;
  ulonglong uVar5;
  wchar_t *pwVar6;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_868 [32];
  undefined4 local_848;
  wchar_t local_838;
  undefined1 local_836 [2046];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_868;
  lVar4 = 0;
  local_848 = 0;
  local_838 = L'\0';
  local_res18 = param_3;
  local_res20 = param_4;
  memset(local_836,0,0x7fe);
  iVar3 = _vscwprintf(param_2,(va_list)&local_res18);
  if (iVar3 + 1 < 0x400) {
    vswprintf_s(&local_838,(longlong)(iVar3 + 1),param_2,(va_list)&local_res18);
  }
  else {
    do {
      sVar2 = *(short *)((longlong)L"Over Run Buffer 1024" + lVar4);
      *(short *)(local_836 + lVar4 + -2) = sVar2;
      lVar4 = lVar4 + 2;
    } while (sVar2 != 0);
  }
  uVar5 = 0xffffffffffffffff;
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  pwVar6 = &local_838;
  do {
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    wVar1 = *pwVar6;
    pwVar6 = pwVar6 + 1;
  } while (wVar1 != L'\0');
  FUN_140001710(param_1,&local_838,~uVar5 - 1);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1404155d0(undefined8 param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  wchar_t wVar1;
  short sVar2;
  int iVar3;
  ulonglong uVar4;
  longlong lVar5;
  wchar_t *pwVar6;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_848 [32];
  wchar_t local_828 [1024];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_848;
  local_res18 = param_3;
  local_res20 = param_4;
  iVar3 = _vscwprintf(param_2,(va_list)&local_res18);
  if (iVar3 + 1 < 0x400) {
    vswprintf_s(local_828,(longlong)(iVar3 + 1),param_2,(va_list)&local_res18);
  }
  else {
    lVar5 = 0;
    do {
      sVar2 = *(short *)((longlong)L"Over Run Buffer 1024" + lVar5);
      *(short *)((longlong)local_828 + lVar5) = sVar2;
      lVar5 = lVar5 + 2;
    } while (sVar2 != 0);
  }
  uVar4 = 0xffffffffffffffff;
  pwVar6 = local_828;
  do {
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    wVar1 = *pwVar6;
    pwVar6 = pwVar6 + 1;
  } while (wVar1 != L'\0');
  FUN_140001710(param_1,local_828,~uVar4 - 1);
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined1 * FUN_1404156a0(undefined1 *param_1)

{
  char cVar1;
  ulonglong uVar2;
  char *pcVar3;
  undefined1 auStack_c8 [32];
  uint local_a8;
  uint local_a0;
  uint local_98;
  uint local_90;
  uint local_88;
  uint local_80;
  uint local_78;
  uint local_70;
  uint local_68;
  uint local_60;
  undefined4 local_58;
  char local_50 [56];
  ulonglong local_18;
  
  local_18 = DAT_1405d84f0 ^ (ulonglong)auStack_c8;
  local_70 = (uint)DAT_140607dc4._1_1_;
  local_80 = (uint)DAT_140607dc0._3_1_;
  local_88 = (uint)DAT_140607dc0._2_1_;
  local_78 = (uint)(byte)DAT_140607dc4;
  local_90 = (uint)DAT_140607dc0._1_1_;
  local_a0 = (uint)DAT_140607dbc._2_2_;
  local_a8 = (uint)(ushort)DAT_140607dbc;
  local_50[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';
  local_50[0x20] = '\0';
  local_50[0x21] = '\0';
  local_50[0x22] = '\0';
  local_50[0x23] = '\0';
  local_50[0x24] = '\0';
  local_50[0x25] = '\0';
  local_50[0x26] = '\0';
  local_50[0x27] = '\0';
  local_50[0x28] = '\0';
  local_50[0x29] = '\0';
  local_50[0x2a] = '\0';
  local_50[0x2b] = '\0';
  local_50[0x2c] = '\0';
  local_50[0x2d] = '\0';
  local_50[0x2e] = '\0';
  local_50[0x2f] = '\0';
  local_50[0x30] = '\0';
  local_50[0x31] = 0;
  local_60 = (uint)DAT_140607dc4._3_1_;
  local_98 = (uint)(byte)DAT_140607dc0;
  local_68 = (uint)DAT_140607dc4._2_1_;
  local_58 = 0;
  sprintf_s(local_50,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_50;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_140003e50(param_1,local_50,~uVar2 - 1);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

undefined2 * FUN_140415800(undefined2 *param_1,longlong param_2)

{
  wchar_t wVar1;
  ulonglong uVar2;
  wchar_t *pwVar3;
  undefined1 auStack_128 [32];
  uint local_108;
  uint local_100;
  uint local_f8;
  uint local_f0;
  uint local_e8;
  uint local_e0;
  uint local_d8;
  uint local_d0;
  uint local_c8;
  uint local_c0;
  undefined4 local_b8;
  wchar_t local_a8;
  undefined1 local_a6 [110];
  ulonglong local_38;
  
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_128;
  local_b8 = 0;
  local_a8 = L'\0';
  memset(local_a6,0,0x62);
  local_c0 = (uint)*(byte *)(param_2 + 0xf);
  local_c8 = (uint)*(byte *)(param_2 + 0xe);
  local_d0 = (uint)*(byte *)(param_2 + 0xd);
  local_d8 = (uint)*(byte *)(param_2 + 0xc);
  local_e0 = (uint)*(byte *)(param_2 + 0xb);
  local_e8 = (uint)*(byte *)(param_2 + 10);
  local_f0 = (uint)*(byte *)(param_2 + 9);
  local_f8 = (uint)*(byte *)(param_2 + 8);
  local_100 = (uint)*(ushort *)(param_2 + 6);
  local_108 = (uint)*(ushort *)(param_2 + 4);
  swprintf_s(&local_a8,0x32,L"%.8X-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X");
  uVar2 = 0xffffffffffffffff;
  *(undefined8 *)(param_1 + 0xc) = 7;
  *(undefined8 *)(param_1 + 8) = 0;
  *param_1 = 0;
  pwVar3 = &local_a8;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    wVar1 = *pwVar3;
    pwVar3 = pwVar3 + 1;
  } while (wVar1 != L'\0');
  FUN_140001710(param_1,&local_a8,~uVar2 - 1);
  return param_1;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140415930(undefined8 param_1,short *param_2,short *param_3)

{
  short sVar1;
  code *pcVar2;
  ulonglong uVar3;
  undefined2 *puVar4;
  longlong lVar5;
  ulonglong uVar6;
  longlong lVar7;
  int iVar8;
  uint uVar9;
  short *psVar10;
  ulonglong uVar12;
  undefined1 auStack_98 [32];
  longlong local_78;
  undefined8 local_70;
  undefined8 local_68;
  undefined2 local_60;
  undefined6 uStack_5e;
  ulonglong local_50;
  ulonglong local_48;
  ulonglong local_38;
  ulonglong uVar11;
  
  local_68 = 0xfffffffffffffffe;
  local_38 = DAT_1405d84f0 ^ (ulonglong)auStack_98;
  lVar5 = -1;
  psVar10 = param_2;
  do {
    if (lVar5 == 0) break;
    lVar5 = lVar5 + -1;
    sVar1 = *psVar10;
    psVar10 = psVar10 + 1;
  } while (sVar1 != 0);
  uVar6 = 0xffffffffffffffff;
  psVar10 = param_3;
  do {
    if (uVar6 == 0) break;
    uVar6 = uVar6 - 1;
    sVar1 = *psVar10;
    psVar10 = psVar10 + 1;
  } while (sVar1 != 0);
  lVar7 = ~uVar6 - 1;
  local_48 = 7;
  uVar6 = 0;
  local_50 = 0;
  local_60 = 0;
  iVar8 = (int)lVar7;
  uVar12 = uVar6;
  local_78 = lVar7;
  local_70 = param_1;
  if (0 < (int)~(uint)lVar5) {
    do {
      uVar3 = 0;
      uVar9 = 0;
      if (0 < (longlong)iVar8) {
        uVar11 = uVar3;
        do {
          uVar9 = (uint)uVar11;
          if (*param_2 == param_3[uVar3]) {
            if (uVar6 != 0) {
              FUN_14008ec00(local_70,&local_60);
              FUN_140001710(&local_60,&DAT_140477960,0);
              uVar6 = local_50;
            }
            break;
          }
          uVar9 = uVar9 + 1;
          uVar11 = (ulonglong)uVar9;
          uVar3 = uVar3 + 1;
        } while ((longlong)uVar3 < (longlong)iVar8);
      }
      if (((uVar9 == (uint)lVar7) && (sVar1 = *param_2, lVar7 = local_78, sVar1 != 0)) &&
         ((uVar6 != 0 || (sVar1 != 0x20)))) {
        if (-uVar6 - 1 < 2) {
          std::_Xlength_error("string too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        uVar3 = uVar6 + 1;
        if (0x7ffffffffffffffe < uVar3) {
          std::_Xlength_error("string too long");
          pcVar2 = (code *)swi(3);
          (*pcVar2)();
          return;
        }
        if (local_48 < uVar3) {
          FUN_1400019f0(&local_60,uVar3,uVar6);
          uVar6 = local_50;
        }
        else if (uVar3 == 0) {
          local_50 = 0;
          puVar4 = &local_60;
          if (7 < local_48) {
            puVar4 = (undefined2 *)CONCAT62(uStack_5e,local_60);
          }
          *puVar4 = 0;
          uVar6 = local_50;
        }
        lVar7 = local_78;
        if (uVar3 != 0) {
          puVar4 = &local_60;
          if (7 < local_48) {
            puVar4 = (undefined2 *)CONCAT62(uStack_5e,local_60);
          }
          puVar4[uVar6] = sVar1;
          puVar4 = &local_60;
          if (7 < local_48) {
            puVar4 = (undefined2 *)CONCAT62(uStack_5e,local_60);
          }
          local_50 = uVar3;
          puVar4[uVar3] = 0;
          uVar6 = local_50;
        }
      }
      uVar9 = (int)uVar12 + 1;
      uVar12 = (ulonglong)uVar9;
      param_2 = param_2 + 1;
    } while ((int)uVar9 < (int)~(uint)lVar5);
    if (uVar6 != 0) {
      FUN_14008ec00(local_70,&local_60);
      FUN_140001710(&local_60,&DAT_140477960,0);
    }
  }
  if (7 < local_48) {
    operator_delete((void *)CONCAT62(uStack_5e,local_60));
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140415b90(undefined8 param_1,undefined8 param_2,undefined8 param_3)

{
  short sVar1;
  ushort uVar2;
  ushort uVar3;
  code *pcVar4;
  longlong lVar5;
  undefined8 uVar6;
  undefined2 *puVar7;
  undefined8 *puVar8;
  undefined8 *puVar9;
  undefined8 *puVar10;
  int iVar11;
  ulonglong uVar12;
  short *psVar13;
  ulonglong uVar14;
  undefined8 *puVar15;
  undefined8 *puVar16;
  ulonglong uVar17;
  undefined8 *puVar18;
  undefined1 auStack_308 [32];
  undefined8 local_2e8;
  undefined8 *local_2e0;
  undefined8 *local_2d8;
  undefined8 local_2d0;
  undefined8 *local_2c0;
  undefined8 *local_2b8;
  undefined8 local_2b0;
  undefined8 local_2a0;
  undefined2 local_298;
  undefined6 uStack_296;
  ulonglong local_288;
  ulonglong local_280;
  undefined2 local_270;
  undefined6 uStack_26e;
  undefined8 local_260;
  ulonglong local_258;
  short local_248 [256];
  ulonglong local_48;
  
  local_2a0 = 0xfffffffffffffffe;
  local_48 = DAT_1405d84f0 ^ (ulonglong)auStack_308;
  local_2e8 = param_1;
  FUN_140123dc0();
  puVar16 = (undefined8 *)0x0;
  local_2e0 = (undefined8 *)0x0;
  local_2d8 = (undefined8 *)0x0;
  local_2d0 = 0;
  local_2c0 = (undefined8 *)0x0;
  local_2b8 = (undefined8 *)0x0;
  local_2b0 = 0;
  FUN_140415930(&local_2e0,param_2,param_3);
  puVar18 = puVar16;
  puVar9 = puVar16;
  puVar8 = local_2b8;
  puVar15 = puVar16;
  puVar10 = local_2e0;
  if (local_2e0 != local_2d8) {
    do {
      for (; puVar16 != puVar18; puVar16 = puVar16 + 5) {
        if (7 < (ulonglong)puVar16[3]) {
          operator_delete((void *)*puVar16);
        }
        puVar16[3] = 7;
        puVar16[2] = 0;
        *(undefined2 *)puVar16 = 0;
        puVar8 = puVar15;
      }
      puVar9 = puVar10;
      if (7 < (ulonglong)puVar10[3]) {
        puVar9 = (undefined8 *)*puVar10;
      }
      local_2b8 = puVar8;
      FUN_140415930(&local_2c0,puVar9,&DAT_14049b9cc);
      puVar18 = local_2b8;
      puVar16 = local_2c0;
      lVar5 = ((longlong)local_2b8 - (longlong)local_2c0) / 0x28;
      if (lVar5 == 1) {
        FUN_14008ec00(param_1,local_2c0);
      }
      else if (lVar5 == 2) {
        puVar9 = (undefined8 *)local_2c0[2];
        local_280 = 7;
        local_288 = 0;
        local_298 = 0;
        FUN_1400015e0(&local_298,local_2c0,0,0xffffffffffffffff);
        uVar17 = (ulonglong)((int)puVar9 + -2);
        if (local_288 < uVar17) {
          std::_Xout_of_range("invalid string position");
          break;
        }
        uVar14 = local_288 - uVar17;
        uVar12 = 2;
        if ((1 < uVar14) || (uVar12 = uVar14, uVar14 != 0)) {
          puVar7 = &local_298;
          if (7 < local_280) {
            puVar7 = (undefined2 *)CONCAT62(uStack_296,local_298);
          }
          memmove(puVar7 + uVar17,puVar7 + uVar17 + uVar12,(uVar14 - uVar12) * 2);
          local_288 = local_288 - uVar12;
          puVar7 = &local_298;
          if (7 < local_280) {
            puVar7 = (undefined2 *)CONCAT62(uStack_296,local_298);
          }
          puVar7[local_288] = 0;
        }
        uVar6 = local_2e8;
        if ((ulonglong)puVar16[2] <= uVar17) {
          std::_Xout_of_range("invalid string position");
          pcVar4 = (code *)swi(3);
          (*pcVar4)();
          return;
        }
        puVar8 = puVar16;
        if (7 < (ulonglong)puVar16[3]) {
          puVar8 = (undefined8 *)*puVar16;
        }
        uVar12 = (ulonglong)((int)puVar9 + -1);
        if ((ulonglong)puVar16[2] <= uVar12) {
          std::_Xout_of_range("invalid string position");
          pcVar4 = (code *)swi(3);
          (*pcVar4)();
          return;
        }
        puVar9 = puVar16;
        if (7 < (ulonglong)puVar16[3]) {
          puVar9 = (undefined8 *)*puVar16;
        }
        uVar2 = *(ushort *)((longlong)puVar8 + uVar17 * 2);
        iVar11 = (*(ushort *)((longlong)puVar9 + uVar12 * 2) - 0x210) +
                 ((uint)uVar2 + (uint)uVar2 * 4) * 2;
        puVar9 = puVar16 + 5;
        if ((ulonglong)puVar16[7] <= uVar17) {
          std::_Xout_of_range("invalid string position");
          pcVar4 = (code *)swi(3);
          (*pcVar4)();
          return;
        }
        puVar8 = puVar9;
        if (7 < (ulonglong)puVar16[8]) {
          puVar8 = (undefined8 *)*puVar9;
        }
        if ((ulonglong)puVar16[7] <= uVar12) {
          std::_Xout_of_range("invalid string position");
          pcVar4 = (code *)swi(3);
          (*pcVar4)();
          return;
        }
        if (7 < (ulonglong)puVar16[8]) {
          puVar9 = (undefined8 *)*puVar9;
        }
        uVar2 = *(ushort *)((longlong)puVar8 + uVar17 * 2);
        uVar3 = *(ushort *)((longlong)puVar9 + uVar12 * 2);
        for (; iVar11 <= (int)((uVar3 - 0x210) + ((uint)uVar2 + (uint)uVar2 * 4) * 2);
            iVar11 = iVar11 + 1) {
          FUN_14012f380(local_248,L"%02d",iVar11);
          local_258 = 7;
          local_260 = 0;
          local_270 = 0;
          FUN_1400015e0(&local_270,&local_298,0,0xffffffffffffffff);
          uVar17 = 0xffffffffffffffff;
          psVar13 = local_248;
          do {
            if (uVar17 == 0) break;
            uVar17 = uVar17 - 1;
            sVar1 = *psVar13;
            psVar13 = psVar13 + 1;
          } while (sVar1 != 0);
          FUN_140002aa0(&local_270,local_248,~uVar17 - 1);
          FUN_14008ec00(uVar6,&local_270);
          if (7 < local_258) {
            operator_delete((void *)CONCAT62(uStack_26e,local_270));
          }
          puVar18 = local_2b8;
        }
        param_1 = local_2e8;
        if (7 < local_280) {
          operator_delete((void *)CONCAT62(uStack_296,local_298));
          param_1 = local_2e8;
        }
      }
      puVar9 = (undefined8 *)0x0;
      puVar10 = puVar10 + 5;
      puVar8 = local_2b8;
      puVar15 = puVar16;
    } while (puVar10 != local_2d8);
  }
  puVar15 = local_2e0;
  puVar8 = puVar16;
  if (puVar16 != (undefined8 *)0x0) {
    for (; puVar8 != puVar18; puVar8 = puVar8 + 5) {
      if (7 < (ulonglong)puVar8[3]) {
        operator_delete((void *)*puVar8);
      }
      puVar8[3] = 7;
      puVar8[2] = puVar9;
      *(short *)puVar8 = (short)puVar9;
    }
    operator_delete(puVar16);
  }
  puVar8 = local_2d8;
  puVar16 = puVar15;
  if (puVar15 != (undefined8 *)0x0) {
    for (; puVar16 != puVar8; puVar16 = puVar16 + 5) {
      if (7 < (ulonglong)puVar16[3]) {
        operator_delete((void *)*puVar16);
      }
      puVar16[3] = 7;
      puVar16[2] = puVar9;
      *(short *)puVar16 = (short)puVar9;
    }
    operator_delete(puVar15);
  }
  return;
}



void FUN_140416000(ulonglong *param_1,undefined8 param_2,undefined8 param_3,undefined8 param_4)

{
  int *piVar1;
  int *piVar2;
  longlong lVar3;
  wchar_t *pwVar4;
  wchar_t *pwVar5;
  int iVar6;
  wchar_t *_Str;
  ulonglong uVar7;
  wchar_t *pwVar8;
  longlong lVar9;
  int local_res18 [2];
  wchar_t *local_50;
  wchar_t *local_48;
  undefined8 local_40;
  
  uVar7 = 0;
  local_50 = (wchar_t *)0x0;
  local_48 = (wchar_t *)0x0;
  local_40 = 0;
  FUN_140415930(&local_50,param_2,&DAT_14049c7b8,param_4,0xfffffffffffffffe);
  pwVar5 = local_48;
  pwVar4 = local_50;
  lVar3 = (longlong)local_48 - (longlong)local_50 >> 0x3f;
  lVar9 = ((longlong)local_48 - (longlong)local_50) / 0x28 + lVar3;
  pwVar8 = local_50;
  if (lVar9 != lVar3) {
    do {
      _Str = pwVar8;
      if (7 < *(ulonglong *)(pwVar8 + 0xc)) {
        _Str = *(wchar_t **)pwVar8;
      }
      iVar6 = _wtoi(_Str);
      piVar1 = (int *)param_1[1];
      local_res18[0] = iVar6;
      if ((local_res18 < piVar1) && (piVar2 = (int *)*param_1, piVar2 <= local_res18)) {
        if (piVar1 == (int *)param_1[2]) {
          FUN_1400556a0(param_1,1);
        }
        if ((undefined4 *)param_1[1] != (undefined4 *)0x0) {
          *(undefined4 *)param_1[1] =
               *(undefined4 *)(*param_1 + ((longlong)local_res18 - (longlong)piVar2 >> 2) * 4);
        }
      }
      else {
        if (piVar1 == (int *)param_1[2]) {
          FUN_1400556a0(param_1,1);
        }
        if ((int *)param_1[1] != (int *)0x0) {
          *(int *)param_1[1] = iVar6;
        }
      }
      param_1[1] = param_1[1] + 4;
      uVar7 = (ulonglong)((int)uVar7 + 1);
      pwVar8 = pwVar8 + 0x14;
    } while (uVar7 < (ulonglong)(lVar9 - lVar3));
  }
  pwVar8 = pwVar4;
  if (pwVar4 != (wchar_t *)0x0) {
    for (; pwVar8 != pwVar5; pwVar8 = pwVar8 + 0x14) {
      if (7 < *(ulonglong *)(pwVar8 + 0xc)) {
        operator_delete(*(void **)pwVar8);
      }
      pwVar8[0xc] = L'\a';
      pwVar8[0xd] = L'\0';
      pwVar8[0xe] = L'\0';
      pwVar8[0xf] = L'\0';
      pwVar8[8] = L'\0';
      pwVar8[9] = L'\0';
      pwVar8[10] = L'\0';
      pwVar8[0xb] = L'\0';
      *pwVar8 = L'\0';
    }
    operator_delete(pwVar4);
  }
  return;
}



void FUN_140416190(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_1404161d0(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_140416220(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_140416280(longlong param_1)

{
  LARGE_INTEGER local_res8 [4];
  
  QueryPerformanceCounter(local_res8);
  return (double)local_res8[0].QuadPart * *(double *)(param_1 + 8);
}



undefined8 * FUN_1404162b0(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_140416310(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_140416380(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_1404163d8;
  }
  plVar1 = _Dst;
  if (_Dst == _Src) {
    return;
  }
  while (plVar1 = plVar1 + 1, plVar1 != _Src) {
    if (*plVar1 != param_2) {
      *_Dst = *plVar1;
      _Dst = _Dst + 1;
    }
  }
LAB_1404163d8:
  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_140416420(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_140195b20(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_140195b20(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_140416520(longlong param_1,double param_2)

{
  void *_Dst;
  double local_res10 [3];
  
  local_res10[0] = param_2;
  if (param_2 < 0.0) {
    local_res10[0] = 0.05;
  }
  FUN_140013b60(param_1 + 0x50,local_res10);
  _Dst = *(void **)(param_1 + 0x50);
  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_1404165a0(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_1404165f0(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_140416520(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_1404166d0(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_140607ff8 = 0;
  *param_1 = ISubject::vftable;
  return;
}



void FUN_140416780(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_140013b60((undefined8 *)(param_1 + 0x50),param_1 + 0x48);
  return;
}



undefined8 *
FUN_140416800(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_140416780(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_140416d30(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 0x000140417093. 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_1404170a0(void)

{
  if (0xf < DAT_140609eb0) {
    operator_delete((void *)CONCAT71(DAT_140609e98._1_7_,(undefined1)DAT_140609e98));
  }
  DAT_140609eb0 = 0xf;
  _DAT_140609ea8 = 0;
  DAT_140609e98._0_1_ = 0;
  if (0xf < DAT_140609e88) {
    operator_delete((void *)CONCAT71(DAT_140609e70._1_7_,(undefined1)DAT_140609e70));
  }
  DAT_140609e88 = 0xf;
  _DAT_140609e80 = 0;
  DAT_140609e70._0_1_ = 0;
  if (0xf < DAT_140609e60) {
    operator_delete((void *)CONCAT71(DAT_140609e48._1_7_,(undefined1)DAT_140609e48));
  }
  DAT_140609e60 = 0xf;
  _DAT_140609e58 = 0;
  DAT_140609e48._0_1_ = 0;
  if (0xf < DAT_140609e38) {
    operator_delete((void *)CONCAT71(DAT_140609e20._1_7_,(undefined1)DAT_140609e20));
  }
  DAT_140609e38 = 0xf;
  _DAT_140609e30 = 0;
  DAT_140609e20._0_1_ = 0;
  if (0xf < DAT_140609e10) {
    operator_delete((void *)CONCAT71(DAT_140609df8._1_7_,(undefined1)DAT_140609df8));
  }
  DAT_140609e10 = 0xf;
  _DAT_140609e08 = 0;
  DAT_140609df8._0_1_ = 0;
  if (0xf < DAT_140609de8) {
    operator_delete((void *)CONCAT71(DAT_140609dd0._1_7_,(undefined1)DAT_140609dd0));
  }
  DAT_140609de8 = 0xf;
  _DAT_140609de0 = 0;
  DAT_140609dd0._0_1_ = 0;
  if (0xf < DAT_140609dc0) {
    operator_delete((void *)CONCAT71(DAT_140609da8._1_7_,(undefined1)DAT_140609da8));
  }
  DAT_140609dc0 = 0xf;
  _DAT_140609db8 = 0;
  DAT_140609da8._0_1_ = 0;
  if (0xf < DAT_140609d98) {
    operator_delete((void *)CONCAT71(DAT_140609d80._1_7_,(undefined1)DAT_140609d80));
  }
  DAT_140609d98 = 0xf;
  _DAT_140609d90 = 0;
  DAT_140609d80._0_1_ = 0;
  if (0xf < DAT_140609d70) {
    operator_delete((void *)CONCAT71(DAT_140609d58._1_7_,(undefined1)DAT_140609d58));
  }
  DAT_140609d70 = 0xf;
  _DAT_140609d68 = 0;
  DAT_140609d58._0_1_ = 0;
  if (0xf < DAT_140609d48) {
    operator_delete((void *)CONCAT71(DAT_140609d30._1_7_,(undefined1)DAT_140609d30));
  }
  DAT_140609d48 = 0xf;
  _DAT_140609d40 = 0;
  DAT_140609d30._0_1_ = 0;
  if (0xf < DAT_140609d20) {
    operator_delete((void *)CONCAT71(DAT_140609d08._1_7_,(undefined1)DAT_140609d08));
  }
  DAT_140609d20 = 0xf;
  _DAT_140609d18 = 0;
  DAT_140609d08._0_1_ = 0;
  if (0xf < DAT_140609cf8) {
    operator_delete((void *)CONCAT71(DAT_140609ce0._1_7_,(undefined1)DAT_140609ce0));
  }
  DAT_140609cf8 = 0xf;
  _DAT_140609cf0 = 0;
  DAT_140609ce0._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404172f0(void)

{
  if (0xf < DAT_14060a160) {
    operator_delete((void *)CONCAT71(DAT_14060a148._1_7_,(undefined1)DAT_14060a148));
  }
  DAT_14060a160 = 0xf;
  _DAT_14060a158 = 0;
  DAT_14060a148._0_1_ = 0;
  FUN_140003bb0(&DAT_14060a128);
  FUN_140003700(&DAT_140609ef8);
  if (0xf < DAT_140609ee8) {
    operator_delete((void *)CONCAT71(DAT_140609ed0._1_7_,(undefined1)DAT_140609ed0));
  }
  DAT_140609ee8 = 0xf;
  _DAT_140609ee0 = 0;
  DAT_140609ed0._0_1_ = 0;
  return;
}



void FUN_140417380(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_140003e50(&DAT_140609ed0,pcVar5,~uVar4 - 1);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140417410(void)

{
  undefined8 in_R9;
  
  DAT_140609cf8 = 0xf;
  _DAT_140609cf0 = 0;
  DAT_140609ce0._0_1_ = 0;
  DAT_140609d20 = 0xf;
  _DAT_140609d18 = 0;
  DAT_140609d08._0_1_ = 0;
  DAT_140609d48 = 0xf;
  _DAT_140609d40 = 0;
  DAT_140609d30._0_1_ = 0;
  DAT_140609d70 = 0xf;
  _DAT_140609d68 = 0;
  DAT_140609d58._0_1_ = 0;
  DAT_140609d98 = 0xf;
  _DAT_140609d90 = 0;
  DAT_140609d80._0_1_ = 0;
  DAT_140609dc0 = 0xf;
  _DAT_140609db8 = 0;
  DAT_140609da8._0_1_ = 0;
  DAT_140609de8 = 0xf;
  _DAT_140609de0 = 0;
  DAT_140609dd0._0_1_ = 0;
  DAT_140609e10 = 0xf;
  _DAT_140609e08 = 0;
  DAT_140609df8._0_1_ = 0;
  DAT_140609e38 = 0xf;
  _DAT_140609e30 = 0;
  DAT_140609e20._0_1_ = 0;
  DAT_140609e60 = 0xf;
  _DAT_140609e58 = 0;
  DAT_140609e48._0_1_ = 0;
  DAT_140609e88 = 0xf;
  _DAT_140609e80 = 0;
  DAT_140609e70._0_1_ = 0;
  DAT_140609eb0 = 0xf;
  _DAT_140609ea8 = 0;
  DAT_140609e98._0_1_ = 0;
  FUN_140003e50(&DAT_140609e98,&DAT_140476668,3,in_R9,0xfffffffffffffffe);
  DAT_140609ec0 = 1000;
  return &DAT_140609ce0;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_140417580(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_1405d84f0 ^ (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_r0x00014041761d;
    }
  }
  local_328 = (char *)0x0;
joined_r0x00014041761d:
  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_r0x00014041765d;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_320 = (char *)0x0;
joined_r0x00014041765d:
  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_r0x00014041769b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2c8 = (char *)0x0;
joined_r0x00014041769b:
  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_r0x0001404176dd;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_308 = (char *)0x0;
joined_r0x0001404176dd:
  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_r0x00014041771b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2b8 = (char *)0x0;
joined_r0x00014041771b:
  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_r0x00014041775d;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2f8 = (char *)0x0;
joined_r0x00014041775d:
  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_r0x00014041779d;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2f0 = (char *)0x0;
joined_r0x00014041779d:
  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_r0x0001404177dd;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_318 = (char *)0x0;
joined_r0x0001404177dd:
  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_r0x00014041781b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_298 = (char *)0x0;
joined_r0x00014041781b:
  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_r0x00014041785d;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_300 = (char *)0x0;
joined_r0x00014041785d:
  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_r0x00014041789d;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_310 = (char *)0x0;
joined_r0x00014041789d:
  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_r0x0001404178dd;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2e0 = (char *)0x0;
joined_r0x0001404178dd:
  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_r0x00014041791d;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2d0 = (char *)0x0;
joined_r0x00014041791d:
  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_r0x00014041795b;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2c0 = (char *)0x0;
joined_r0x00014041795b:
  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_r0x00014041799b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_280 = (char *)0x0;
joined_r0x00014041799b:
  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_r0x0001404179dd;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2e8 = (char *)0x0;
joined_r0x0001404179dd:
  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_r0x000140417a1b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2a8 = (char *)0x0;
joined_r0x000140417a1b:
  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_r0x000140417a5d;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2d8 = (char *)0x0;
joined_r0x000140417a5d:
  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_r0x000140417a9b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_288 = (char *)0x0;
joined_r0x000140417a9b:
  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_r0x000140417adb;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_2b0 = (char *)0x0;
joined_r0x000140417adb:
  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_r0x000140417b1b;
    }
    lVar7 = *(longlong *)(lVar7 + 0x48);
  } while( true );
  local_2a0 = (char *)0x0;
joined_r0x000140417b1b:
  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_r0x000140417b5b;
    }
    lVar6 = *(longlong *)(lVar6 + 0x48);
  } while( true );
  local_290 = (char *)0x0;
joined_r0x000140417b5b:
  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_r0x000140417b96:
  lVar7 = lVar3;
  pcVar11 = pcVar16;
  if (lVar6 == lVar1) goto joined_r0x000140417bd6;
  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_r0x000140417bd6;
  }
  lVar6 = *(longlong *)(lVar6 + 0x48);
  goto joined_r0x000140417b96;
joined_r0x000140417bd6:
  lVar6 = lVar3;
  pcVar12 = pcVar16;
  if (lVar7 == lVar1) goto joined_r0x000140417c16;
  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_r0x000140417c16;
  }
  lVar7 = *(longlong *)(lVar7 + 0x48);
  goto joined_r0x000140417bd6;
joined_r0x000140417c16:
  lVar7 = lVar3;
  pcVar13 = pcVar16;
  if (lVar6 == lVar1) goto joined_r0x000140417c56;
  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_r0x000140417c56;
  }
  lVar6 = *(longlong *)(lVar6 + 0x48);
  goto joined_r0x000140417c16;
joined_r0x000140417c56:
  pcVar14 = pcVar16;
  if (lVar7 == lVar1) goto joined_r0x000140417c93;
  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_r0x000140417c93;
  }
  lVar7 = *(longlong *)(lVar7 + 0x48);
  goto joined_r0x000140417c56;
joined_r0x000140417c93:
  if (lVar3 == lVar1) goto LAB_140417cd0;
  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_140417cd0;
  }
  lVar3 = *(longlong *)(lVar3 + 0x48);
  goto joined_r0x000140417c93;
LAB_140417cd0:
  FUN_140003590();
  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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140003e50(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_140609ed0;
  if (0xf < DAT_140609ee8) {
    pcVar16 = DAT_140609ed0;
  }
  iVar4 = _stricmp(pcVar16,(char *)_Str2);
  if (iVar4 == 0) {
    FUN_140003960(&DAT_140609ef8,local_268);
    FUN_140416d30(&DAT_140609ed0);
  }
  FUN_140003c10(&DAT_14060a128,local_268);
  FUN_140003700(local_268);
  return;
}



void FUN_1404182c0(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_14060a148;
  if (0xf < DAT_14060a160) {
    puVar5 = DAT_14060a148;
  }
  FUN_14000ff80(local_98,puVar5);
  DAT_1405e0652 = 0;
  cVar1 = FUN_140010050(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_140607be8) {
      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_140607be8) {
      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_140418406;
  }
  goto LAB_1404184fd;
LAB_140418406:
  while (lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3), lVar4 == 0) {
    do {
      plVar3 = (longlong *)plVar3[10];
      if (plVar3 == (longlong *)0x0) goto LAB_1404184fd;
      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_140417380(plVar3);
          }
          else {
            iVar2 = _stricmp((char *)(lVar4 + 0x10),"area");
            if (iVar2 == 0) {
              FUN_140417580(plVar3);
            }
          }
          do {
            plVar3 = (longlong *)plVar3[10];
            if (plVar3 == (longlong *)0x0) goto LAB_1404184fd;
            lVar4 = (**(code **)(*plVar3 + 0x30))(plVar3);
          } while (lVar4 == 0);
        }
        break;
      }
    }
  }
LAB_1404184fd:
  local_98[0] = TiXmlDocument::vftable;
  if (local_38 != &DAT_140607be8) {
    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_140607be8) {
    operator_delete__(local_58);
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

undefined8 * FUN_140418590(void)

{
  undefined8 in_R9;
  
  DAT_140609ee8 = 0xf;
  _DAT_140609ee0 = 0;
  DAT_140609ed0._0_1_ = 0;
  FUN_140003e50(&DAT_140609ed0,&DAT_140476668,3,in_R9,0xfffffffffffffffe);
  FUN_140003590(&DAT_140609ef8);
  _DAT_14060a128 = 0;
  _DAT_14060a130 = 0;
  _DAT_14060a138 = 0;
  DAT_14060a160 = 0xf;
  _DAT_14060a158 = 0;
  DAT_14060a148._0_1_ = 0;
  FUN_140003e50(&DAT_14060a148,"option\\service_control.xml",0x1a);
  FUN_1404182c0();
  return &DAT_140609ed0;
}



undefined8 * FUN_140418650(void)

{
  if ((DAT_14060b7c0 & 1) == 0) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
  }
  return &DAT_140609ce0;
}



undefined8 * FUN_1404186a0(void)

{
  if ((DAT_14060b7c4 & 1) == 0) {
    DAT_14060b7c4 = DAT_14060b7c4 | 1;
    FUN_140418590();
    atexit((_func_5014 *)&LAB_140448470);
  }
  return &DAT_140609ed0;
}



// WARNING: Function: __chkstk replaced with injection: alloca_probe
// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1404186f0(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 = 0x14041870e;
  local_18 = DAT_1405d84f0 ^ (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_140418780(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_1405d84f0 ^ (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_140418830(longlong param_1,wchar_t *param_2,undefined8 param_3,undefined8 param_4)

{
  errno_t eVar1;
  int iVar2;
  wchar_t *_Filename;
  undefined8 local_res18;
  undefined8 local_res20;
  undefined1 auStack_448 [32];
  wchar_t local_428 [512];
  ulonglong local_28;
  
  local_28 = DAT_1405d84f0 ^ (ulonglong)auStack_448;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection(DAT_140607fe8);
  if (*(ulonglong *)(param_1 + 0xa0) < 3) {
    LeaveCriticalSection(DAT_140607fe8);
  }
  else {
    _Filename = (wchar_t *)(param_1 + 0x90);
    if (7 < *(ulonglong *)(param_1 + 0xa8)) {
      _Filename = *(wchar_t **)_Filename;
    }
    eVar1 = _wfopen_s((FILE **)(param_1 + 0xe0),_Filename,L"a");
    if (eVar1 == 0) {
      iVar2 = _vscwprintf(param_2,(va_list)&local_res18);
      vswprintf_s(local_428,(longlong)(iVar2 + 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 (*(FILE **)(param_1 + 0xe0) != (FILE *)0x0) {
        fwprintf(*(FILE **)(param_1 + 0xe0),L"%s");
        fflush(*(FILE **)(param_1 + 0xe0));
        fclose(*(FILE **)(param_1 + 0xe0));
      }
    }
    LeaveCriticalSection(DAT_140607fe8);
  }
  return;
}



// WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie

void FUN_1404189a0(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_1405d84f0 ^ (ulonglong)auStack_248;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection(DAT_140607fe8);
  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_140607fe8);
  return;
}



void FUN_140418a90(longlong param_1)

{
  undefined8 *puVar1;
  longlong lVar2;
  
  EnterCriticalSection(DAT_140607fe8);
  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 0x000140418af0. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140607fe8);
  return;
}



void FUN_140418b00(undefined8 *param_1)

{
  DWORD DVar1;
  
  DVar1 = timeGetTime();
  if (0x32 < DVar1 - *(int *)(param_1 + 1)) {
    FUN_1404189a0(DAT_140607fd8,"% 9d [ ms ] %s\n",DVar1 - *(int *)(param_1 + 1),*param_1);
  }
  return;
}



undefined8 * FUN_140418b40(undefined8 *param_1,undefined8 param_2)

{
  DWORD DVar1;
  
  *param_1 = param_2;
  DVar1 = timeGetTime();
  *(DWORD *)(param_1 + 1) = DVar1;
  return param_1;
}



void FUN_140418b70(undefined8 *param_1)

{
  LPCRITICAL_SECTION lpCriticalSection;
  
  *param_1 = MBCLog::vftable;
  param_1[1] = MBCLog::vftable;
  FUN_140418a90();
  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_140607fe8;
  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_140607fe8 = (LPCRITICAL_SECTION)0x0;
  DAT_140607fd8 = 0;
  *param_1 = MBISingleton<>::vftable;
  return;
}



undefined8 * FUN_140418c90(undefined8 *param_1)

{
  LPCRITICAL_SECTION p_Var1;
  LPCRITICAL_SECTION lpCriticalSection;
  
  *param_1 = MBISingleton<>::vftable;
  param_1[1] = MBMultiThreadSync<>::vftable;
  p_Var1 = DAT_140607fe8;
  if ((DAT_140607fe8 == (LPCRITICAL_SECTION)0x0) &&
     (lpCriticalSection = operator_new(0x28), p_Var1 = (LPCRITICAL_SECTION)0x0,
     lpCriticalSection != (LPCRITICAL_SECTION)0x0)) {
    InitializeCriticalSection(lpCriticalSection);
    p_Var1 = lpCriticalSection;
  }
  DAT_140607fe8 = 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_140418da0(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_1405d84f0 ^ (ulonglong)auStack_458;
  local_res18 = param_3;
  local_res20 = param_4;
  EnterCriticalSection(DAT_140607fe8);
  if ((DAT_14060b7c0 & 1) == 0) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
  }
  if ((DAT_140609ec0 == 200) && ((DAT_14060b7c0 & 1) == 0)) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
    if (DAT_140609ec0 == 1000) goto LAB_140418edd;
  }
  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_140418edd:
  LeaveCriticalSection(DAT_140607fe8);
  return;
}



void FUN_140418f10(longlong param_1)

{
  errno_t eVar1;
  
  EnterCriticalSection(DAT_140607fe8);
  if ((DAT_14060b7c0 & 1) == 0) {
    DAT_14060b7c0 = DAT_14060b7c0 | 1;
    FUN_140417410();
    atexit((_func_5014 *)&LAB_140448480);
  }
  if (DAT_140609ec0 != 200) {
    if ((DAT_14060b7c0 & 1) == 0) {
      DAT_14060b7c0 = DAT_14060b7c0 | 1;
      FUN_140417410();
      atexit((_func_5014 *)&LAB_140448480);
    }
    if (DAT_140609ec0 != 1000) goto LAB_140418faa;
  }
  _wsetlocale(0,L"korean");
LAB_140418faa:
  setlocale(0,(char *)0x0);
  printf("Locale is: %s\n");
  eVar1 = fopen_s((FILE **)(param_1 + 0xb8),"AuctionServer.log","w");
  if (eVar1 != 0) {
    *(undefined8 *)(param_1 + 0xb8) = 0;
    FUN_140418da0(param_1,L"MBLOG open error");
  }
  FUN_1404189a0(DAT_140607fd8,"MBLOG %s writting\n","AuctionServer.log");
                    // WARNING: Could not recover jumptable at 0x000140419029. Too many branches
                    // WARNING: Treating indirect jump as call
  LeaveCriticalSection(DAT_140607fe8);
  return;
}



ushort * FUN_140419030(ushort *param_1,ushort *param_2,int *param_3)

{
  ushort uVar1;
  ushort uVar2;
  ushort *puVar3;
  ushort *puVar4;
  
  puVar4 = (ushort *)0x0;
  *param_3 = 0;
  uVar1 = *param_1;
  puVar3 = param_2;
  while (uVar1 != 0) {
    uVar1 = *param_1;
    if ((((uVar1 < 0x7f) && ((uVar1 < 0x30 || (0x39 < uVar1)))) &&
        ((uVar1 < 0x61 || (0x7a < uVar1)))) && ((uVar1 < 0x41 || (0x5a < uVar1)))) {
      if (puVar4 != (ushort *)0x0) {
        *param_3 = *param_3 + 1;
      }
    }
    else {
      uVar2 = *puVar3;
      if (((uVar1 == uVar2) || (((ushort)(uVar1 - 0x41) < 0x1a && (uVar1 + 0x20 == (uint)uVar2))))
         || (((ushort)(uVar2 - 0x41) < 0x1a && (uVar2 + 0x20 == (uint)uVar1)))) {
        if (puVar4 == (ushort *)0x0) {
          puVar4 = param_1;
        }
        *param_3 = *param_3 + 1;
        puVar3 = puVar3 + 1;
        if (*puVar3 == 0) {
          return puVar4;
        }
      }
      else {
        if (puVar4 != (ushort *)0x0) {
          uVar2 = *param_2;
          if (((uVar1 == uVar2) ||
              (((ushort)(uVar1 - 0x41) < 0x1a && (uVar1 + 0x20 == (uint)uVar2)))) ||
             ((puVar3 = param_2, puVar4 = (ushort *)0x0, (ushort)(uVar2 - 0x41) < 0x1a &&
              (uVar2 + 0x20 == (uint)uVar1)))) {
            *param_3 = *param_3 + 1;
            puVar3 = param_2 + 1;
            puVar4 = param_1;
            if (param_2[1] == 0) {
              return param_1;
            }
          }
        }
        if (uVar1 == 0) break;
      }
    }
    param_1 = param_1 + 1;
    uVar1 = *param_1;
  }
  if (*puVar3 == 0) {
    return puVar4;
  }
  return (ushort *)0x0;
}



void FUN_140419190(void)

{
  undefined8 *puVar1;
  longlong *plVar2;
  void *pvVar3;
  void *pvVar4;
  ulonglong uVar5;
  ulonglong uVar6;
  ulonglong uVar7;
  
  uVar5 = 0;
  pvVar3 = DAT_140607f90;
  pvVar4 = DAT_140607f88;
  uVar6 = uVar5;
  uVar7 = uVar5;
  if ((longlong)DAT_140607f90 - (longlong)DAT_140607f88 >> 3 != 0) {
    do {
      puVar1 = *(undefined8 **)(uVar6 + (longlong)pvVar4);
      if (puVar1 != (undefined8 *)0x0) {
        operator_delete__((void *)*puVar1);
        operator_delete(puVar1);
        pvVar3 = DAT_140607f90;
        pvVar4 = DAT_140607f88;
      }
      uVar7 = (ulonglong)((int)uVar7 + 1);
      uVar6 = uVar6 + 8;
    } while (uVar7 < (ulonglong)((longlong)pvVar3 - (longlong)pvVar4 >> 3));
  }
  if (pvVar4 != pvVar3) {
    memmove(pvVar4,pvVar3,0);
    DAT_140607f90 = pvVar4;
  }
  pvVar3 = DAT_140607f70;
  uVar6 = uVar5;
  pvVar4 = DAT_140607f68;
  if ((longlong)DAT_140607f70 - (longlong)DAT_140607f68 >> 3 != 0) {
    do {
      puVar1 = *(undefined8 **)(uVar6 + (longlong)pvVar4);
      if (puVar1 != (undefined8 *)0x0) {
        operator_delete__((void *)*puVar1);
        operator_delete__((void *)puVar1[1]);
        operator_delete(puVar1);
        pvVar3 = DAT_140607f70;
        pvVar4 = DAT_140607f68;
      }
      uVar5 = (ulonglong)((int)uVar5 + 1);
      uVar6 = uVar6 + 8;
    } while (uVar5 < (ulonglong)((longlong)pvVar3 - (longlong)pvVar4 >> 3));
  }
  if (pvVar4 != pvVar3) {
    memmove(pvVar4,pvVar3,0);
    DAT_140607f70 = pvVar4;
  }
  while (DAT_140607fb0 != 0) {
    operator_delete__(*(void **)(*DAT_140607fa8 + 0x10));
    plVar2 = (longlong *)*DAT_140607fa8;
    if (plVar2 != DAT_140607fa8) {
      *(longlong *)plVar2[1] = *plVar2;
      *(longlong *)(*plVar2 + 8) = plVar2[1];
      operator_delete(plVar2);
      DAT_140607fb0 = DAT_140607fb0 + -1;
    }
  }
  return;
}



undefined8 FUN_140419350(short *param_1,int param_2,undefined8 param_3)

{
  short sVar1;
  undefined1 auVar2 [16];
  __uint64 _Var3;
  wchar_t *_String;
  longlong lVar4;
  short *psVar5;
  undefined8 *puVar6;
  ulonglong uVar7;
  ulonglong uVar8;
  undefined1 local_res10 [8];
  
  uVar7 = CONCAT44(0,param_2 + 1);
  auVar2._8_8_ = 0;
  auVar2._0_8_ = uVar7;
  _Var3 = SUB168(ZEXT816(2) * auVar2,0);
  if (SUB168(ZEXT816(2) * auVar2,8) != 0) {
    _Var3 = 0xffffffffffffffff;
  }
  _String = operator_new(_Var3);
  memset(_String,0,uVar7 * 2);
  psVar5 = param_1;
  do {
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
    *(short *)((longlong)_String + (-2 - (longlong)param_1) + (longlong)psVar5) = sVar1;
  } while (sVar1 != 0);
  _wcslwr(_String);
  uVar8 = 0;
  uVar7 = DAT_140607f90 - (longlong)DAT_140607f88 >> 3;
  puVar6 = DAT_140607f88;
  if (uVar7 != 0) {
    do {
      lVar4 = FUN_140419030(_String,*(undefined8 *)*puVar6,local_res10);
      if (lVar4 != 0) {
        operator_delete__(_String);
        uVar7 = 0xffffffffffffffff;
        psVar5 = *(short **)DAT_140607f88[uVar8];
        goto code_r0x000140419458;
      }
      uVar8 = (ulonglong)((int)uVar8 + 1);
      puVar6 = puVar6 + 1;
    } while (uVar8 < uVar7);
  }
  operator_delete__(_String);
  return 0;
  while( true ) {
    uVar7 = uVar7 - 1;
    sVar1 = *psVar5;
    psVar5 = psVar5 + 1;
    if (sVar1 == 0) break;
code_r0x000140419458:
    if (uVar7 == 0) break;
  }
  FUN_140001710(param_3,*(short **)DAT_140607f88[uVar8],~uVar7 - 1);
  return 1;
}



float __cdecl sqrtf(float _X)

{
  float fVar1;
  
                    // WARNING: Could not recover jumptable at 0x00014041946e. Too many branches
                    // WARNING: Treating indirect jump as call
  fVar1 = sqrtf(_X);
  return fVar1;
}



float __cdecl atan2f(float _Y,float _X)

{
  float fVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140419474. Too many branches
                    // WARNING: Treating indirect jump as call
  fVar1 = atan2f(_Y,_X);
  return fVar1;
}



float __cdecl sinf(float _X)

{
  float fVar1;
  
                    // WARNING: Could not recover jumptable at 0x00014041947a. Too many branches
                    // WARNING: Treating indirect jump as call
  fVar1 = sinf(_X);
  return fVar1;
}



float __cdecl cosf(float _X)

{
  float fVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140419480. Too many branches
                    // WARNING: Treating indirect jump as call
  fVar1 = cosf(_X);
  return fVar1;
}



float __cdecl ceilf(float _X)

{
  float fVar1;
  
                    // WARNING: Could not recover jumptable at 0x000140419486. Too many branches
                    // WARNING: Treating indirect jump as call
  fVar1 = ceilf(_X);
  return fVar1;
}



void Unwind_140419490(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140419497. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(*(exception **)(param_2 + 0x40));
  return;
}



void Unwind_1404194a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1404194b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x50);
  return;
}



void Unwind_1404194c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404194d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404194e0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404194e7. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(*(exception **)(param_2 + 0x30));
  return;
}



void Unwind_1404194f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x30) + 0x40);
  return;
}



void Unwind_140419500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_140419510(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x40);
  return;
}



void Unwind_140419520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140419530(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140419537. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(*(exception **)(param_2 + 0x40));
  return;
}



void Unwind_140419540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_140419550(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140419557. Too many branches
                    // WARNING: Treating indirect jump as call
  std::exception::~exception(*(exception **)(param_2 + 0x50));
  return;
}



void Unwind_140419560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x50) + 0x40);
  return;
}



void Unwind_140419570(undefined8 param_1,longlong param_2)

{
  FUN_14034f130(param_2 + 0x58);
  return;
}



void Unwind_140419580(void)

{
  DAT_1405f0568 = DAT_1405f0568 & 0xfffffffe;
  return;
}



void Unwind_1404195a0(void)

{
  DAT_1405f0568 = DAT_1405f0568 & 0xfffffffe;
  return;
}



void Unwind_1404195c0(void)

{
  DAT_1405f0568 = DAT_1405f0568 & 0xfffffffe;
  return;
}



void Unwind_1404195e0(void)

{
  DAT_1405f0638 = DAT_1405f0638 & 0xfffffffe;
  return;
}



void Unwind_140419600(undefined8 param_1,longlong param_2)

{
  FUN_14034ff60(*(undefined8 *)(param_2 + 0x50),0x80);
  return;
}



void Unwind_140419620(undefined8 param_1,longlong param_2)

{
  FUN_14034fee0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140419630(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419640(void)

{
  DAT_1405f06a8 = DAT_1405f06a8 & 0xfffffffe;
  return;
}



void Unwind_140419660(undefined8 param_1,longlong param_2)

{
  FUN_14034fee0(*(undefined8 *)(param_2 + 0xd0));
  return;
}



void Unwind_140419670(undefined8 param_1,longlong param_2)

{
  FUN_140351260(param_2 + 0x40);
  return;
}



void Unwind_140419680(undefined8 param_1,longlong param_2)

{
  FUN_140351260(param_2 + 0x38);
  return;
}



void Unwind_140419690(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x60);
  return;
}



undefined * Catch_All_1404196a0(undefined8 param_1,longlong param_2)

{
  *(undefined4 *)(param_2 + 0x30) = 0;
  return &DAT_140351557;
}



void Unwind_1404196d0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x58) & 1) != 0) {
    *(uint *)(param_2 + 0x58) = *(uint *)(param_2 + 0x58) & 0xfffffffe;
    thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x40));
  }
  return;
}



void Unwind_140419700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x50),0x400);
  return;
}



void Unwind_140419720(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x50);
  return;
}



void Unwind_140419730(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x58);
  return;
}



void Unwind_140419740(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x60);
  return;
}



void Unwind_140419750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x28);
  return;
}



void Unwind_140419760(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x70);
  return;
}



void Unwind_140419770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x20);
  return;
}



void Unwind_140419780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x48);
  return;
}



void Unwind_140419790(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x100);
  return;
}



void Unwind_1404197a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x40);
  return;
}



void Unwind_1404197b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x58);
  return;
}



void Unwind_1404197c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404197d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404197e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404197f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140419800(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140419810(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x40);
  return;
}



void Unwind_140419820(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x60);
  return;
}



void Unwind_140419830(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x60);
  return;
}



void Unwind_140419840(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



undefined8 Catch_140419850(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_1403552c0();
  }
  *puVar1 = 3;
  return 0x140352baa;
}



void Unwind_140419890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1404198a0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1404198b0(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1404198c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1404198d0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1404198e0(undefined8 param_1,longlong param_2)

{
  FUN_1403574e0(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140419900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419910(void)

{
  DAT_1405f07c0 = DAT_1405f07c0 & 0xfffffffe;
  return;
}



void Unwind_140419930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140419940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x48),0x80);
  return;
}



void Unwind_140419960(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419970(void)

{
  DAT_1405f0804 = DAT_1405f0804 & 0xfffffffe;
  return;
}



void Unwind_140419990(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x60),
                *(longlong *)(param_2 + 0x50) + (longlong)*(int *)(param_2 + 0x58) * 8);
  return;
}



void Unwind_1404199c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1404199d0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),
                *(longlong *)(param_2 + 0xd8) + (longlong)*(int *)(param_2 + 200) * 8);
  return;
}



void Unwind_140419a00(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x50) & 1) != 0) {
    *(uint *)(param_2 + 0x50) = *(uint *)(param_2 + 0x50) & 0xfffffffe;
    thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x40));
  }
  return;
}



void Unwind_140419a30(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x68) & 1) != 0) {
    *(uint *)(param_2 + 0x68) = *(uint *)(param_2 + 0x68) & 0xfffffffe;
    thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x60));
  }
  return;
}



void Unwind_140419a60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x70);
  return;
}



void Unwind_140419a70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419a80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x28);
  return;
}



void Unwind_140419a90(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x50);
  return;
}



void Unwind_140419aa0(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_140419ad0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419ae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x28);
  return;
}



void Unwind_140419af0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x20);
  return;
}



void Unwind_140419b00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140419b10(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x50);
  return;
}



void Unwind_140419b20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140419b30(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x38));
  return;
}



void Unwind_140419b40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_140419b50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140419b60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419b70(void)

{
  DAT_1405f0858 = DAT_1405f0858 & 0xfffffffe;
  return;
}



void Unwind_140419b90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x20);
  return;
}



void Unwind_140419ba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x28);
  return;
}



void Unwind_140419bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140419bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140419bd0(undefined8 param_1,longlong param_2)

{
  FUN_1403555b0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140419be0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x90) + 0x28);
  return;
}



void Unwind_140419bf0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x90) + 0x140);
  return;
}



void Unwind_140419c10(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x90) + 0x200);
  return;
}



void Unwind_140419c30(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x90) + 0x2c0);
  return;
}



void Unwind_140419c50(undefined8 param_1,longlong param_2)

{
  FUN_1403555b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140419c60(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_140419c70(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_140419c90(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x40) + 0x200);
  return;
}



void Unwind_140419cb0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x40) + 0x2c0);
  return;
}



void Unwind_140419cd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_140419ce0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140419cf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140419d00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_140419d10(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x50);
  return;
}



void Unwind_140419d20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x20);
  return;
}



void Unwind_140419d30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140419d40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140419d50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140419d60(undefined8 param_1,longlong param_2)

{
  FUN_14035a020(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_140419d70(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x40);
  return;
}



void Unwind_140419d80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140419d90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419da0(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_140419dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419df0(void)

{
  FUN_140359a60(&DAT_1405f0990);
  return;
}



void Unwind_140419e00(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x50) + 0x70);
  return;
}



void Unwind_140419e10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419e20(void)

{
  DAT_1405f13f0 = DAT_1405f13f0 & 0xfffffffe;
  return;
}



void Unwind_140419e40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419e50(undefined8 param_1,longlong param_2)

{
  FUN_140352e00(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_140419e60(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140419e70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140419e80(undefined8 param_1,longlong param_2)

{
  FUN_140352e00(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140419e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x88);
  return;
}



void Unwind_140419ea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x80);
  return;
}



void Unwind_140419eb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419ee0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_140419ef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140358500(*(longlong *)(param_2 + 0x80) + 0x38);
  return;
}



void Unwind_140419f00(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x80) + 0x50);
  return;
}



void Unwind_140419f10(undefined8 param_1,longlong param_2)

{
  FUN_140359460(*(longlong *)(param_2 + 0x80) + 0x88);
  return;
}



void Unwind_140419f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140358500(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_140419f40(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_140419f50(undefined8 param_1,longlong param_2)

{
  FUN_140359460(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140419f70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140419f80(void)

{
  DAT_1405f1e18 = DAT_1405f1e18 & 0xfffffffe;
  return;
}



void FUN_140419f96(void)

{
  _unlock(8);
  return;
}



void FUN_140419fb1(_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_14041a040(undefined8 *param_1)

{
  return *(int *)*param_1 == -0x3ffffffb;
}



undefined8 Catch_All_14041a070(void)

{
  return 0x14035b205;
}



void Unwind_14041a090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041a0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041a0b0(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_14041a0c0(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_14041a0e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041a0f0(void)

{
  DAT_1405f2618 = DAT_1405f2618 & 0xfffffffe;
  return;
}



void Unwind_14041a110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_14041a120(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_14041a130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x28),0x60);
  return;
}



void Unwind_14041a150(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x58) & 1) != 0) {
    *(uint *)(param_2 + 0x58) = *(uint *)(param_2 + 0x58) & 0xfffffffe;
    FUN_14012c7f0(*(undefined8 *)(param_2 + 0x50));
  }
  return;
}



void Unwind_14041a180(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_14041a1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_14041a1c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_14041a1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x118);
  return;
}



void Unwind_14041a1e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_14041a1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x28);
  return;
}



void Unwind_14041a200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041a210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_14041a220(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041a230(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041a240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041a250(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0x38);
  return;
}



void Unwind_14041a260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_14041a270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_14041a280(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0x40);
  return;
}



void Unwind_14041a290(undefined8 param_1,longlong param_2)

{
  FUN_140388f60(param_2 + 0x30);
  return;
}



void Unwind_14041a2a0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x40) + 0x120);
  return;
}



void Unwind_14041a2c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_14041a2d0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(*(longlong *)(param_2 + 0x80) + 0xc80);
  return;
}



undefined8 Catch_All_14041a2f0(void)

{
  return 0x140360b33;
}



void Unwind_14041a310(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(*(longlong *)(param_2 + 0xd0) + 0xc80);
  return;
}



void Unwind_14041a330(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041a340(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14041a350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14041a360(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14041a370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041a380(undefined8 param_1,longlong param_2)

{
  FUN_14012c340(param_2 + 0x60);
  return;
}



void Unwind_14041a390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041a3a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041a3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14041a3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_14041a3d0(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(param_2 + 0x78);
  return;
}



void Unwind_14041a3e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041a3f0(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x28);
  return;
}



undefined8 Catch_All_14041a400(void)

{
  return 0x1403638f3;
}



undefined8 Catch_All_14041a420(void)

{
  return 0x140363ae3;
}



void Unwind_14041a440(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_14041a470(undefined8 param_1,longlong param_2)

{
  FUN_140363ad0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041a480(undefined8 param_1,longlong param_2)

{
  FUN_14035dcb0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_14041a490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041a4a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x260);
  return;
}



void Unwind_14041a4b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a4c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_14041a4d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a4e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14041a520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x268);
  return;
}



void Unwind_14041a530(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a540(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_14041a550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a560(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a580(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a5a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 600);
  return;
}



void Unwind_14041a5b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a5c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_14041a5d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a5e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a5f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x3c8));
  return;
}



void Unwind_14041a600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041a620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x270);
  return;
}



void Unwind_14041a630(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a640(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_14041a650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a680(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041a690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14041a6b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041a6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14041a6d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041a6e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14041a6f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041a700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14041a710(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041a720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d8);
  return;
}



void Unwind_14041a730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a740(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_14041a750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2e8);
  return;
}



void Unwind_14041a770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x3c8));
  return;
}



void Unwind_14041a780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2e0);
  return;
}



void Unwind_14041a7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x3c8));
  return;
}



void Unwind_14041a7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14041a7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x298);
  return;
}



void Unwind_14041a7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a7f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14041a800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041a810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a8);
  return;
}



void Unwind_14041a820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041a840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_14041a860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041a880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_14041a890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a8a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041a8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d0);
  return;
}



void Unwind_14041a8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a8d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041a8e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x290);
  return;
}



void Unwind_14041a900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_14041a930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14041a950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a0);
  return;
}



void Unwind_14041a960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14041a980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x278);
  return;
}



void Unwind_14041a990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x3c8));
  return;
}



void Unwind_14041a9a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041a9b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b0);
  return;
}



void Unwind_14041a9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041a9d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_14041a9e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x280);
  return;
}



void Unwind_14041a9f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041aa00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14041aa10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x288);
  return;
}



void Unwind_14041aa20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041aa30(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_14041aa40(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xa0) + 8);
  return;
}



void Unwind_14041aa50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041aa60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14041aa70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041aa80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041aa90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x160);
  return;
}



void Unwind_14041aaa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14041aab0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_14041aac0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_14041aad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_14041aae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_14041aaf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_14041ab00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_14041ab10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_14041ab20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_14041ab30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041ab40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_14041ab50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041ab60(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_14041ab70(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x20);
  return;
}



void Unwind_14041ab80(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd80);
  return;
}



void Unwind_14041aba0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x100);
  return;
}



void Unwind_14041abb0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd80);
  return;
}



void Unwind_14041abd0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x58) + 8);
  return;
}



void Unwind_14041abe0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_14041abf0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x20);
  return;
}



void Unwind_14041ac00(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd80);
  return;
}



void Unwind_14041ac20(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x100);
  return;
}



void Unwind_14041ac30(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd80);
  return;
}



void Unwind_14041ac50(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x58) + 8);
  return;
}



void Unwind_14041ac60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x28);
  return;
}



void Unwind_14041ac70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x20);
  return;
}



void Unwind_14041ac80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041ac90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_14041aca0(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x70);
  return;
}



void Unwind_14041acb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041acc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041acd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041ace0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_14041acf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041ad00(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd50);
  return;
}



void Unwind_14041ad20(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd0);
  return;
}



void Unwind_14041ad30(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd50);
  return;
}



void Unwind_14041ad50(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



undefined * Catch_14041ad60(undefined8 param_1,longlong param_2)

{
  LPCWSTR lpOutputString;
  
  lpOutputString = (LPCWSTR)(**(code **)(**(longlong **)(param_2 + 0x70) + 8))();
  OutputDebugStringW(lpOutputString);
  uRam0000000000000000 = 1;
  return &DAT_14036c583;
}



undefined * Catch_14041ada0(undefined8 param_1,longlong param_2)

{
  LPCWSTR lpOutputString;
  
  lpOutputString = (LPCWSTR)(**(code **)(**(longlong **)(param_2 + 0x68) + 8))();
  OutputDebugStringW(lpOutputString);
  uRam0000000000000000 = 1;
  return &DAT_14036c4c7;
}



undefined * Catch_14041ade0(undefined8 param_1,longlong param_2)

{
  LPCWSTR lpOutputString;
  
  lpOutputString = (LPCWSTR)(**(code **)(**(longlong **)(param_2 + 0x40) + 8))();
  OutputDebugStringW(lpOutputString);
  uRam0000000000000000 = 1;
  return &DAT_14036ca52;
}



void Unwind_14041ae20(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x50);
  return;
}



void Unwind_14041ae30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_14041ae40(undefined8 param_1,longlong param_2)

{
  FUN_140360b10(param_2 + 0x38);
  return;
}



void Unwind_14041ae50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041ae60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041ae70(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_14041ae80(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x20);
  return;
}



void Unwind_14041ae90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041aea0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd40);
  return;
}



void Unwind_14041aec0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xc0);
  return;
}



void Unwind_14041aed0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd40);
  return;
}



void Unwind_14041aef0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xa0) + 8);
  return;
}



void Unwind_14041af00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_14041af10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14041af20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_14041af30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041af40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_14041af50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041af60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_14041af70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041af80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_14041af90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041afa0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014041afa7. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12(*(_Container_base12 **)(param_2 + 0x40));
  return;
}



void Unwind_14041afb0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x88) & 1) != 0) {
    *(uint *)(param_2 + 0x88) = *(uint *)(param_2 + 0x88) & 0xfffffffe;
    FUN_14036daa0(*(undefined8 *)(param_2 + 0x80));
  }
  return;
}



void Unwind_14041afe0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041aff0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041b000(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x60);
  return;
}



void Unwind_14041b010(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_14041b020(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14041b030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14041b040(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041b050(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x20);
  return;
}



void Unwind_14041b060(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_14041b070(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x20);
  return;
}



void Unwind_14041b080(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041b090(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd40);
  return;
}



void Unwind_14041b0b0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xc0);
  return;
}



void Unwind_14041b0c0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd40);
  return;
}



void Unwind_14041b0e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_14041b0f0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_14041b100(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x68),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14041b120(undefined8 param_1,longlong param_2)

{
  FUN_1403639c0(param_2 + 0x68);
  return;
}



void Unwind_14041b130(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041b140(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x50);
  return;
}



void Unwind_14041b150(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x60) & 1) != 0) {
    *(uint *)(param_2 + 0x60) = *(uint *)(param_2 + 0x60) & 0xfffffffe;
    FUN_140363900(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_14041b180(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_14041b190(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x160);
  return;
}



void Unwind_14041b1a0(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x50);
  return;
}



void Unwind_14041b1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14041b1c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_14041b1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_14041b1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14041b1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14041b200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_14041b210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_14041b220(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_14041b230(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_14041b240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_14041b250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041b260(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0xb0);
  return;
}



void Unwind_14041b270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_14041b280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041b290(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041b2a0(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0xa0);
  return;
}



void Unwind_14041b2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_14041b2c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041b2d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x70) + 0x120);
  return;
}



void Unwind_14041b2f0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14041b300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14041b310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_14041b320(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041b330(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041b340(undefined8 param_1,longlong param_2)

{
  FUN_1403700a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041b350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041b360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_14041b370(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_14041b380(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041b390(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x50);
  return;
}



void Unwind_14041b3a0(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x20);
  return;
}



void Unwind_14041b3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_14041b3c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_14041b3d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



undefined8 Catch_All_14041b3e0(void)

{
  return 0x140372833;
}



void Unwind_14041b400(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x50) + 0x120);
  return;
}



void Unwind_14041b420(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_14041b440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0xd0),0x400);
  return;
}



void Unwind_14041b460(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x30);
  return;
}



void Unwind_14041b470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_14041b480(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_14041b490(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0xe8);
  return;
}



void Unwind_14041b4a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041b4b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041b4c0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14041b4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14041b4e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041b4f0(undefined8 param_1,longlong param_2)

{
  FUN_1403721a0(param_2 + 0x60U & 0xffffffffffffffc0);
  return;
}



void Unwind_14041b520(undefined8 param_1,longlong param_2)

{
  FUN_1403700a0(param_2 + 0x60U & 0xffffffffffffffc0);
  return;
}



undefined8 Catch_All_14041b550(void)

{
  return 0x140373403;
}



void Unwind_14041b570(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(*(undefined8 *)(param_2 + 0x1a0));
  return;
}



void Unwind_14041b580(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041b590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x38),0x180);
  return;
}



void Unwind_14041b5b0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x38);
  return;
}



void Unwind_14041b5c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041b5d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x90);
  return;
}



void Unwind_14041b5e0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x48);
  return;
}



void Unwind_14041b5f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_14041b600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_14041b610(undefined8 param_1,longlong param_2)

{
  FUN_1403a0580(param_2 + 0x60);
  return;
}



void Unwind_14041b620(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_14041b630(undefined8 param_1,longlong param_2)

{
  FUN_1403733f0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_14041b640(undefined8 param_1,longlong param_2)

{
  FUN_1403733f0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041b650(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x30);
  return;
}



void Unwind_14041b660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x70),0x180);
  return;
}



void Unwind_14041b680(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x50);
  return;
}



void Unwind_14041b690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_14041b6a0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xb8);
  return;
}



void Unwind_14041b6b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_14041b6c0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x58);
  return;
}



void Unwind_14041b6d0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0580(param_2 + 0x70);
  return;
}



void Unwind_14041b6e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_14041b6f0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x78);
  return;
}



void Unwind_14041b700(undefined8 param_1,longlong param_2)

{
  FUN_1403a0580(param_2 + 0xb0);
  return;
}



void Unwind_14041b710(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xe10);
  return;
}



void Unwind_14041b730(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 400);
  return;
}



void Unwind_14041b740(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xe10);
  return;
}



void Unwind_14041b760(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_14041b770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x28);
  return;
}



void Unwind_14041b780(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041b790(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x80);
  return;
}



void Unwind_14041b7a0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x80) + 0x120);
  return;
}



void Unwind_14041b7c0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041b7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403638e0(*(longlong *)(param_2 + 0x48) + 0x38);
  return;
}



void Unwind_14041b7e0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041b7f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041b800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_14041b810(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041b820(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041b830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x38);
  return;
}



void Unwind_14041b840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x78);
  return;
}



void Unwind_14041b850(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041b860(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041b870(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041b880(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_14041b890(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1a8);
  return;
}



void Unwind_14041b8a0(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(param_2 + 0xb0);
  return;
}



void Unwind_14041b8b0(undefined8 param_1,longlong param_2)

{
  FUN_1401282f0(param_2 + 0x58);
  return;
}



void Unwind_14041b8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041b8d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x138);
  return;
}



void Unwind_14041b8e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 400);
  return;
}



void Unwind_14041b8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14041b900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_14041b910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_14041b920(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x180);
  return;
}



void Unwind_14041b930(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_14041b940(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xd8);
  return;
}



void Unwind_14041b950(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x88);
  return;
}



void Unwind_14041b960(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_14041b970(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_14041b980(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 800);
  return;
}



void Unwind_14041b990(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x3b0);
  return;
}



void Unwind_14041b9a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_14041b9b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_14041b9c0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x128));
  return;
}



void Unwind_14041b9d0(undefined8 param_1,longlong param_2)

{
  FUN_140363900(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14041b9e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041b9f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041ba00(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041ba10(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(*(longlong *)(param_2 + 0x20) + 0x18);
  return;
}



void Unwind_14041ba20(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041ba30(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_14041ba40(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_14041ba50(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_14041ba60(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_14041ba70(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_14041ba80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_14041ba90(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_14041baa0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(*(longlong *)(param_2 + 0x80) + 0x30);
  return;
}



void Unwind_14041bab0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041bac0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041bad0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x50) & 1) != 0) {
    *(uint *)(param_2 + 0x50) = *(uint *)(param_2 + 0x50) & 0xfffffffe;
    FUN_140373380(*(undefined8 *)(param_2 + 0x48));
  }
  return;
}



void Unwind_14041bb00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041bb10(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x50);
  return;
}



void Unwind_14041bb20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041bb30(undefined8 param_1,longlong param_2)

{
  FUN_14035e050(param_2 + 0x48);
  return;
}



void Unwind_14041bb40(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0xa0);
  return;
}



void Unwind_14041bb50(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0xb8) + 0x120);
  return;
}



void Unwind_14041bb70(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0xb0);
  return;
}



void Unwind_14041bb80(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0xb0) + 0x120);
  return;
}



void Unwind_14041bba0(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x20);
  return;
}



void Unwind_14041bbb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_14041bbc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14041bbd0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_14041bbe0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(*(longlong *)(param_2 + 0x50) + 0x18);
  return;
}



void Unwind_14041bbf0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(*(longlong *)(param_2 + 0x50) + 0x20);
  return;
}



void Unwind_14041bc00(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x50) + 0x28);
  return;
}



void Unwind_14041bc10(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(*(longlong *)(param_2 + 0x50) + 0x50);
  return;
}



void Unwind_14041bc20(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x50) + 0x78);
  return;
}



void Unwind_14041bc30(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_14041bc40(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_14041bc50(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x30);
  return;
}



void Unwind_14041bc60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x160),0x60);
  return;
}



void Unwind_14041bc80(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x20),*(undefined8 *)(param_2 + 0x160));
  return;
}



void Unwind_14041bca0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x160);
  return;
}



void Unwind_14041bcb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14041bcc0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x160);
  return;
}



void Unwind_14041bcd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14041bce0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14041bcf0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_14041bd00(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x40);
  return;
}



void Unwind_14041bd10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14041bd20(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xe50);
  return;
}



void Unwind_14041bd40(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1d0);
  return;
}



void Unwind_14041bd50(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xe50);
  return;
}



void Unwind_14041bd70(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041bd80(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x98);
  return;
}



void Unwind_14041bd90(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0xa8);
  return;
}



void Unwind_14041bda0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x90);
  return;
}



void Unwind_14041bdb0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x20);
  return;
}



void Unwind_14041bdc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14041bdd0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x98);
  return;
}



void Unwind_14041bde0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0xa8);
  return;
}



void Unwind_14041bdf0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0xb0);
  return;
}



void Unwind_14041be00(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xb8);
  return;
}



void Unwind_14041be10(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0xe0);
  return;
}



void Unwind_14041be20(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x108);
  return;
}



void Unwind_14041be30(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041be40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14041be50(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 200);
  return;
}



void Unwind_14041be60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_14041be70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14041be80(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x118);
  return;
}



void Unwind_14041be90(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xf0);
  return;
}



void Unwind_14041bea0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x40);
  return;
}



void Unwind_14041beb0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x90);
  return;
}



void Unwind_14041bec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x140);
  return;
}



undefined8 Catch_14041bed0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1c0);
  if (*(longlong *)(lVar1 + 0x758) != 0) {
    FUN_14034f0d0(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_14034f090(param_2 + 0x40);
  }
  return 0x1403796ec;
}



void Unwind_14041bf40(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



undefined8 Catch_14041bf50(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1c0);
  if (*(longlong *)(lVar1 + 0x758) != 0) {
    FUN_14034f670(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_14034f090(param_2 + 0x40);
  }
  return 0x1403796ec;
}



void Unwind_14041bfc0(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



undefined8 Catch_14041bfd0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1c0);
  if (*(longlong *)(lVar1 + 0x758) != 0) {
    FUN_14034f6f0(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_14034f090(param_2 + 0x40);
  }
  return 0x1403796ec;
}



void Unwind_14041c040(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



undefined8 Catch_All_14041c050(void)

{
  return 0x140379a83;
}



void Unwind_14041c070(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_14041c080(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041c090(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_14041c0a0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x70),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14041c0c0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_14041c0d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_14041c0e0(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(param_2 + 0x2d0);
  return;
}



void Unwind_14041c0f0(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(param_2 + 0x480);
  return;
}



void Unwind_14041c100(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_14041c110(undefined8 param_1,longlong param_2)

{
  FUN_1403770d0(param_2 + 0x120);
  return;
}



void Unwind_14041c120(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x128);
  return;
}



void Unwind_14041c130(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_14041c140(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_14041c150(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_14041c160(undefined8 param_1,longlong param_2)

{
  FUN_1403770d0(param_2 + 0x120);
  return;
}



void Unwind_14041c170(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x128);
  return;
}



void Unwind_14041c180(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_14041c190(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_14041c1a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_14041c1b0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_14041c1c0(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(param_2 + 0x120);
  return;
}



void Unwind_14041c1d0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1120);
  return;
}



void Unwind_14041c1e0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x2a30);
  return;
}



void Unwind_14041c200(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1db0);
  return;
}



void Unwind_14041c210(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x2a30);
  return;
}



void Unwind_14041c230(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_14041c240(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1da0);
  return;
}



void Unwind_14041c260(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_14041c270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041c280(undefined8 param_1,longlong param_2)

{
  FUN_140386450(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_14041c290(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(longlong *)(param_2 + 0x80) + 0x60);
  return;
}



void Unwind_14041c2a0(undefined8 param_1,longlong param_2)

{
  FUN_14035c4c0(*(longlong *)(param_2 + 0x80) + 0x68);
  return;
}



void Unwind_14041c2b0(undefined8 param_1,longlong param_2)

{
  FUN_14035c510(*(longlong *)(param_2 + 0x80) + 0x70);
  return;
}



void Unwind_14041c2c0(undefined8 param_1,longlong param_2)

{
  FUN_1403a6c70(*(longlong *)(param_2 + 0x80) + 0x78);
  return;
}



void Unwind_14041c2d0(undefined8 param_1,longlong param_2)

{
  FUN_14035c470(*(longlong *)(param_2 + 0x80) + 0xa8);
  return;
}



void Unwind_14041c2f0(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(longlong *)(param_2 + 0x80) + 0xb0);
  return;
}



void Unwind_14041c310(undefined8 param_1,longlong param_2)

{
  FUN_14037a0c0(*(longlong *)(param_2 + 0x80) + 0xb8);
  return;
}



void Unwind_14041c330(undefined8 param_1,longlong param_2)

{
  FUN_14035c590(*(longlong *)(param_2 + 0x80) + 0x118);
  return;
}



void Unwind_14041c350(undefined8 param_1,longlong param_2)

{
  FUN_14035c550(*(longlong *)(param_2 + 0x80) + 0x120);
  return;
}



void Unwind_14041c370(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x80) + 0x128);
  return;
}



void Unwind_14041c390(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x80) + 0x160);
  return;
}



void Unwind_14041c3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x80) + 0x210);
  return;
}



void Unwind_14041c3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x80) + 0x218);
  return;
}



void Unwind_14041c3f0(undefined8 param_1,longlong param_2)

{
  FUN_140360b20(*(longlong *)(param_2 + 0x80) + 0x280);
  return;
}



void Unwind_14041c410(undefined8 param_1,longlong param_2)

{
  FUN_1403741a0(*(longlong *)(param_2 + 0x80) + 0x2d8);
  return;
}



void Unwind_14041c430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140363ad0(*(longlong *)(param_2 + 0x80) + 0x388);
  return;
}



void Unwind_14041c450(undefined8 param_1,longlong param_2)

{
  FUN_14035deb0(*(longlong *)(param_2 + 0x80) + 0x3e0);
  return;
}



void Unwind_14041c470(undefined8 param_1,longlong param_2)

{
  FUN_140379a70(*(longlong *)(param_2 + 0x80) + 0x400);
  return;
}



void Unwind_14041c490(undefined8 param_1,longlong param_2)

{
  FUN_14037a270(*(longlong *)(param_2 + 0x80) + 0x458);
  return;
}



void Unwind_14041c4b0(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0x80) + 0x478);
  return;
}



void Unwind_14041c4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140388ea0(*(longlong *)(param_2 + 0x80) + 0x480);
  return;
}



void Unwind_14041c4f0(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_14041c500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140385b20(*(longlong *)(param_2 + 0x80) + 0x4a8);
  return;
}



void Unwind_14041c520(undefined8 param_1,longlong param_2)

{
  FUN_14036dac0(*(longlong *)(param_2 + 0x80) + 0x6c8);
  return;
}



void Unwind_14041c540(undefined8 param_1,longlong param_2)

{
  FUN_140372820(*(longlong *)(param_2 + 0x80) + 0x6f0);
  return;
}



void Unwind_14041c560(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x80) + 0x748);
  return;
}



void Unwind_14041c580(undefined8 param_1,longlong param_2)

{
  FUN_1403639c0(*(longlong *)(param_2 + 0x80) + 0x750);
  return;
}



void Unwind_14041c5a0(undefined8 param_1,longlong param_2)

{
  FUN_14035de80(*(longlong *)(param_2 + 0x80) + 0x788);
  return;
}



void Unwind_14041c5c0(undefined8 param_1,longlong param_2)

{
  FUN_14035de80(*(longlong *)(param_2 + 0x80) + 0x790);
  return;
}



void Unwind_14041c5e0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x80) + 0x798);
  return;
}



void Unwind_14041c600(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x80) + 2000);
  return;
}



void Unwind_14041c620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14035e580(*(longlong *)(param_2 + 0x80) + 0x808);
  return;
}



void Unwind_14041c640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14035e690(*(longlong *)(param_2 + 0x80) + 0x828);
  return;
}



void Unwind_14041c660(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0x80) + 0x840);
  return;
}



void Unwind_14041c680(undefined8 param_1,longlong param_2)

{
  FUN_1403a4fa0(*(longlong *)(param_2 + 0x80) + 0xc48);
  return;
}



void Unwind_14041c6a0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x80) + 0xc50);
  return;
}



void Unwind_14041c6c0(undefined8 param_1,longlong param_2)

{
  FUN_140360b20(*(longlong *)(param_2 + 0x80) + 0xc78);
  return;
}



void Unwind_14041c6e0(undefined8 param_1,longlong param_2)

{
  FUN_140359a60(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_14041c6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140359a60(*(longlong *)(param_2 + 0x80) + 0xcd0);
  return;
}



void Unwind_14041c710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140363ad0(*(longlong *)(param_2 + 0x80) + 0x16e8);
  return;
}



void Unwind_14041c730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140360b20(*(longlong *)(param_2 + 0x80) + 0x1740);
  return;
}



void Unwind_14041c750(undefined8 param_1,longlong param_2)

{
  FUN_14035dee0(*(longlong *)(param_2 + 0x80) + 0x17a0);
  return;
}



void Unwind_14041c770(undefined8 param_1,longlong param_2)

{
  FUN_14035df20(*(longlong *)(param_2 + 0x80) + 0x17c8);
  return;
}



void Unwind_14041c790(undefined8 param_1,longlong param_2)

{
  FUN_14035e020(*(longlong *)(param_2 + 0x80) + 0x17f0);
  return;
}



void Unwind_14041c7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x80) + 0x1808);
  return;
}



void Unwind_14041c7d0(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(*(longlong *)(param_2 + 0x80) + 0x1848);
  return;
}



void Unwind_14041c7f0(undefined8 param_1,longlong param_2)

{
  FUN_1403639c0(param_2 + 0x88);
  return;
}



void Unwind_14041c800(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041c810(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x88);
  return;
}



void Unwind_14041c820(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x98);
  return;
}



void Unwind_14041c830(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x80);
  return;
}



void Unwind_14041c840(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x50);
  return;
}



void Unwind_14041c850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_14041c860(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x30);
  return;
}



void Unwind_14041c870(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041c880(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041c890(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x88);
  return;
}



void Unwind_14041c8a0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x98);
  return;
}



void Unwind_14041c8b0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0xa0);
  return;
}



void Unwind_14041c8c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa8);
  return;
}



void Unwind_14041c8d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0xd0);
  return;
}



void Unwind_14041c8e0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xf8);
  return;
}



void Unwind_14041c8f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041c900(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(param_2 + 0x30);
  return;
}



void Unwind_14041c910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403638e0(param_2 + 0x60);
  return;
}



void Unwind_14041c920(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_14041c930(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x60);
  return;
}



void Unwind_14041c940(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x50);
  return;
}



void Unwind_14041c950(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041c960(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0xa0);
  return;
}



void Unwind_14041c970(undefined8 param_1,longlong param_2)

{
  FUN_140376b30(param_2 + 0x90);
  return;
}



void Unwind_14041c980(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041c990(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0xa8));
  return;
}



void Unwind_14041c9a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041c9b0(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0xa0);
  return;
}



void Unwind_14041c9c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(undefined8 *)(param_2 + 0x228));
  return;
}



void Unwind_14041c9d0(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x80);
  return;
}



void Unwind_14041c9e0(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0xd8);
  return;
}



void Unwind_14041c9f0(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x88);
  return;
}



void Unwind_14041ca00(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x128);
  return;
}



void Unwind_14041ca10(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0x130);
  return;
}



void Unwind_14041ca20(undefined8 param_1,longlong param_2)

{
  FUN_140363900(param_2 + 0xf8);
  return;
}



undefined * Catch_14041ca30(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  undefined *puVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined *puVar6;
  
  FUN_14034fe70();
  *(undefined **)(param_2 + 0x108) = PTR_DAT_1405d8010;
  uVar5 = (**(code **)(**(longlong **)(param_2 + 0x3e0) + 8))();
  *(longlong *)(param_2 + 0x5a0) = param_2 + 0x5a8;
  FUN_14012a1d0(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_140017720(param_2 + 0x108,&DAT_1404555e0,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_1405d8010;
  }
  FUN_1403935f0(*(undefined8 *)(*(longlong *)(param_2 + 0x150) + 0x17f0),1,puVar6);
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    *(undefined8 *)(param_2 + 0x340) = uVar5;
    FUN_14034ed40(uVar5);
    *(undefined1 *)(param_2 + 0x348) = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar5);
    *(undefined1 *)(param_2 + 0x348) = 0;
  }
  *(undefined **)(param_2 + 0x108) = PTR_DAT_1405d8010;
  return &DAT_14037d74e;
}



void Unwind_14041cb90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x108);
  return;
}



void Unwind_14041cba0(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x5a0);
  return;
}



void Unwind_14041cbb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x340);
  return;
}



void Unwind_14041cbc0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 600);
  return;
}



void Unwind_14041cbd0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x280);
  return;
}



void Unwind_14041cbe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_14041cbf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 800);
  return;
}



void Unwind_14041cc00(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    FUN_1403555d0(param_2 + 0x1d8);
  }
  return;
}



void Unwind_14041cc30(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 2) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffd;
    FUN_1403555d0(param_2 + 0x2f8);
  }
  return;
}



void Unwind_14041cc60(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 4) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffb;
    FUN_1403555d0(param_2 + 0x188);
  }
  return;
}



void Unwind_14041cc90(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 8) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffff7;
    FUN_1403555d0(param_2 + 0x2a8);
  }
  return;
}



void Unwind_14041ccc0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 0x10) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xffffffef;
    FUN_1403555d0(param_2 + 0x1b0);
  }
  return;
}



void Unwind_14041ccf0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 0x20) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xffffffdf;
    FUN_1403555d0(param_2 + 0x230);
  }
  return;
}



void Unwind_14041cd20(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 0x40) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xffffffbf;
    FUN_1403555d0(param_2 + 0x160);
  }
  return;
}



void Unwind_14041cd50(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 0x80) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xffffff7f;
    FUN_1403555d0(param_2 + 0x2d0);
  }
  return;
}



void Unwind_14041cd80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x118);
  return;
}



void Unwind_14041cd90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x140);
  return;
}



void Unwind_14041cda0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x330);
  return;
}



void Unwind_14041cdb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x200);
  return;
}



void Unwind_14041cdc0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(undefined8 *)(param_2 + 0xa8));
  return;
}



void Unwind_14041cdd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041cde0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_14041cdf0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x48);
  return;
}



void Unwind_14041ce00(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x58);
  return;
}



void Unwind_14041ce10(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x40);
  return;
}



void Unwind_14041ce20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x20),0x60);
  return;
}



void Unwind_14041ce40(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_14041ce60(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x20);
  return;
}



void Unwind_14041ce70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041ce80(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x150);
  return;
}



void Unwind_14041ce90(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x48);
  return;
}



void Unwind_14041cea0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x58);
  return;
}



void Unwind_14041ceb0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x60);
  return;
}



void Unwind_14041cec0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_14041ced0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x90);
  return;
}



void Unwind_14041cee0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xb8);
  return;
}



void Unwind_14041cef0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_14041cf00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_14041cf10(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_14041cf20(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_14041cf30(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x20);
  return;
}



void Unwind_14041cf40(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_14041cf50(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_14041cf60(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x40);
  return;
}



void Unwind_14041cf70(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_14041cf80(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x70);
  return;
}



void Unwind_14041cf90(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x98);
  return;
}



void Unwind_14041cfa0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x150) + 8);
  return;
}



void Unwind_14041cfb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x188));
  return;
}



void Unwind_14041cfc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_14041cfd0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_14041cfe0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_14041cff0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x20);
  return;
}



void Unwind_14041d000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_14041d020(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 400),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_14041d050(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x180);
  return;
}



void Unwind_14041d060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_14041d070(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_14041d080(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_14041d090(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x40);
  return;
}



void Unwind_14041d0a0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_14041d0b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x70);
  return;
}



void Unwind_14041d0c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x98);
  return;
}



void Unwind_14041d0d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_14041d0e0(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(param_2 + 0x28);
  return;
}



void Unwind_14041d0f0(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(param_2 + 0x50);
  return;
}



void Unwind_14041d100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x98);
  return;
}



void Unwind_14041d110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0xa0);
  return;
}



void Unwind_14041d120(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x38);
  return;
}



void Unwind_14041d130(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xa8) + 8);
  return;
}



void Unwind_14041d140(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041d150(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041d160(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(undefined8 *)(param_2 + 0x188));
  return;
}



void Unwind_14041d170(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_14041d180(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_14041d190(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_14041d1a0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x20);
  return;
}



void Unwind_14041d1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_14041d1d0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 400),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_14041d200(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x180);
  return;
}



void Unwind_14041d210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_14041d220(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_14041d230(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_14041d240(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x40);
  return;
}



void Unwind_14041d250(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_14041d260(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x70);
  return;
}



void Unwind_14041d270(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x98);
  return;
}



void Unwind_14041d280(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_14041d290(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_14041d2a0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_14041d2b0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x20);
  return;
}



void Unwind_14041d2c0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_14041d2d0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_14041d2e0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x40);
  return;
}



void Unwind_14041d2f0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_14041d300(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x70);
  return;
}



void Unwind_14041d310(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x98);
  return;
}



void Unwind_14041d320(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x140) + 8);
  return;
}



void Unwind_14041d330(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041d340(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x60);
  return;
}



void Unwind_14041d350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041d360(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x90);
  return;
}



void Unwind_14041d370(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_14041d380(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041d390(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(param_2 + 0xe0);
  return;
}



void Unwind_14041d3a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041d3b0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_14041d3c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_14041d3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x38),0xf8);
  return;
}



void Unwind_14041d3f0(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x38);
  return;
}



void Unwind_14041d400(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041d410(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x40);
  return;
}



void Unwind_14041d420(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x30);
  return;
}



void Unwind_14041d430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041d440(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x90);
  return;
}



void Unwind_14041d450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_14041d460(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(param_2 + 0x1a0);
  return;
}



void Unwind_14041d470(undefined8 param_1,longlong param_2)

{
  FUN_14035fc50(param_2 + 0x30);
  return;
}



void Unwind_14041d480(undefined8 param_1,longlong param_2)

{
  FUN_14035fc50(param_2 + 0x30);
  return;
}



void Unwind_14041d490(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x60);
  return;
}



void Unwind_14041d4a0(undefined8 param_1,longlong param_2)

{
  FUN_14036dec0(param_2 + 0x58);
  return;
}



void Unwind_14041d4b0(undefined8 param_1,longlong param_2)

{
  FUN_14036daa0(param_2 + 0x20);
  return;
}



void Unwind_14041d4c0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xf0);
  return;
}



void Unwind_14041d4d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x98);
  return;
}



void Unwind_14041d4e0(undefined8 param_1,longlong param_2)

{
  FUN_14036dec0(param_2 + 0x90);
  return;
}



void Unwind_14041d4f0(undefined8 param_1,longlong param_2)

{
  FUN_14036daa0(param_2 + 0x20);
  return;
}



void Unwind_14041d500(undefined8 param_1,longlong param_2)

{
  FUN_14035fc50(param_2 + 200);
  return;
}



void Unwind_14041d510(undefined8 param_1,longlong param_2)

{
  FUN_14035fc50(param_2 + 200);
  return;
}



void Unwind_14041d520(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x98);
  return;
}



void Unwind_14041d530(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 400) + 8);
  return;
}



void Unwind_14041d540(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 400) + 8);
  return;
}



void Unwind_14041d550(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x60);
  return;
}



void Unwind_14041d560(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 400) + 8);
  return;
}



void Unwind_14041d570(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_14041d580(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041d590(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_14041d5a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_14041d5b0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xb8);
  return;
}



void Unwind_14041d5c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x90);
  return;
}



void Unwind_14041d5d0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 400);
  return;
}



void Unwind_14041d5e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041d5f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_14041d600(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x198);
  return;
}



void Unwind_14041d610(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_14041d620(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_14041d630(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041d640(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041d650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_14041d660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_14041d670(undefined8 param_1,longlong param_2)

{
  FUN_140386450(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_14041d680(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(longlong *)(param_2 + 0x70) + 0x60);
  return;
}



void Unwind_14041d690(undefined8 param_1,longlong param_2)

{
  FUN_14035c4c0(*(longlong *)(param_2 + 0x70) + 0x68);
  return;
}



void Unwind_14041d6a0(undefined8 param_1,longlong param_2)

{
  FUN_14035c510(*(longlong *)(param_2 + 0x70) + 0x70);
  return;
}



void Unwind_14041d6b0(undefined8 param_1,longlong param_2)

{
  FUN_1403a6c70(*(longlong *)(param_2 + 0x70) + 0x78);
  return;
}



void Unwind_14041d6c0(undefined8 param_1,longlong param_2)

{
  FUN_14035c470(*(longlong *)(param_2 + 0x70) + 0xa8);
  return;
}



void Unwind_14041d6e0(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(longlong *)(param_2 + 0x70) + 0xb0);
  return;
}



void Unwind_14041d700(undefined8 param_1,longlong param_2)

{
  FUN_14037a0c0(*(longlong *)(param_2 + 0x70) + 0xb8);
  return;
}



void Unwind_14041d720(undefined8 param_1,longlong param_2)

{
  FUN_14035c590(*(longlong *)(param_2 + 0x70) + 0x118);
  return;
}



void Unwind_14041d740(undefined8 param_1,longlong param_2)

{
  FUN_14035c550(*(longlong *)(param_2 + 0x70) + 0x120);
  return;
}



void Unwind_14041d760(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 0x128);
  return;
}



void Unwind_14041d780(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 0x160);
  return;
}



void Unwind_14041d7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x70) + 0x210);
  return;
}



void Unwind_14041d7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x70) + 0x218);
  return;
}



void Unwind_14041d7e0(undefined8 param_1,longlong param_2)

{
  FUN_140360b20(*(longlong *)(param_2 + 0x70) + 0x280);
  return;
}



void Unwind_14041d800(undefined8 param_1,longlong param_2)

{
  FUN_1403741a0(*(longlong *)(param_2 + 0x70) + 0x2d8);
  return;
}



void Unwind_14041d820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140363ad0(*(longlong *)(param_2 + 0x70) + 0x388);
  return;
}



void Unwind_14041d840(undefined8 param_1,longlong param_2)

{
  FUN_14035deb0(*(longlong *)(param_2 + 0x70) + 0x3e0);
  return;
}



void Unwind_14041d860(undefined8 param_1,longlong param_2)

{
  FUN_140379a70(*(longlong *)(param_2 + 0x70) + 0x400);
  return;
}



void Unwind_14041d880(undefined8 param_1,longlong param_2)

{
  FUN_14037a270(*(longlong *)(param_2 + 0x70) + 0x458);
  return;
}



void Unwind_14041d8a0(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0x70) + 0x478);
  return;
}



void Unwind_14041d8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140388ea0(*(longlong *)(param_2 + 0x70) + 0x480);
  return;
}



void Unwind_14041d8e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140385b20(*(longlong *)(param_2 + 0x70) + 0x4a8);
  return;
}



void Unwind_14041d900(undefined8 param_1,longlong param_2)

{
  FUN_14036dac0(*(longlong *)(param_2 + 0x70) + 0x6c8);
  return;
}



void Unwind_14041d920(undefined8 param_1,longlong param_2)

{
  FUN_140372820(*(longlong *)(param_2 + 0x70) + 0x6f0);
  return;
}



void Unwind_14041d940(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x70) + 0x748);
  return;
}



void Unwind_14041d960(undefined8 param_1,longlong param_2)

{
  FUN_1403639c0(*(longlong *)(param_2 + 0x70) + 0x750);
  return;
}



void Unwind_14041d980(undefined8 param_1,longlong param_2)

{
  FUN_14035de80(*(longlong *)(param_2 + 0x70) + 0x788);
  return;
}



void Unwind_14041d9a0(undefined8 param_1,longlong param_2)

{
  FUN_14035de80(*(longlong *)(param_2 + 0x70) + 0x790);
  return;
}



void Unwind_14041d9c0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 0x798);
  return;
}



void Unwind_14041d9e0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 2000);
  return;
}



void Unwind_14041da00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14035e580(*(longlong *)(param_2 + 0x70) + 0x808);
  return;
}



void Unwind_14041da20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14035e690(*(longlong *)(param_2 + 0x70) + 0x828);
  return;
}



void Unwind_14041da40(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0x70) + 0x840);
  return;
}



void Unwind_14041da60(undefined8 param_1,longlong param_2)

{
  FUN_1403a4fa0(*(longlong *)(param_2 + 0x70) + 0xc48);
  return;
}



void Unwind_14041da80(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x70) + 0xc50);
  return;
}



void Unwind_14041daa0(undefined8 param_1,longlong param_2)

{
  FUN_140360b20(*(longlong *)(param_2 + 0x70) + 0xc78);
  return;
}



void Unwind_14041dac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140359a60(*(longlong *)(param_2 + 0x70) + 0xcd0);
  return;
}



void Unwind_14041dae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140363ad0(*(longlong *)(param_2 + 0x70) + 0x16e8);
  return;
}



void Unwind_14041db00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140360b20(*(longlong *)(param_2 + 0x70) + 0x1740);
  return;
}



void Unwind_14041db20(undefined8 param_1,longlong param_2)

{
  FUN_14035dee0(*(longlong *)(param_2 + 0x70) + 0x17a0);
  return;
}



void Unwind_14041db40(undefined8 param_1,longlong param_2)

{
  FUN_14035df20(*(longlong *)(param_2 + 0x70) + 0x17c8);
  return;
}



void Unwind_14041db60(undefined8 param_1,longlong param_2)

{
  FUN_14035e020(*(longlong *)(param_2 + 0x70) + 0x17f0);
  return;
}



void Unwind_14041db80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x70) + 0x1808);
  return;
}



void Unwind_14041dba0(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(*(longlong *)(param_2 + 0x70) + 0x1848);
  return;
}



void Unwind_14041dbc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041dbd0(undefined8 param_1,longlong param_2)

{
  FUN_1403733f0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14041dbe0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041dbf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_14041dc00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041dc10(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_14041dc20(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041dc30(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_14041dc40(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_14041dc50(undefined8 param_1,longlong param_2)

{
  FUN_1403848f0(param_2 + 0x28);
  return;
}



void Unwind_14041dc60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x28);
  return;
}



void Unwind_14041dc70(undefined8 param_1,longlong param_2)

{
  FUN_140384900(param_2 + 0x38);
  return;
}



void Unwind_14041dc80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041dc90(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x50);
  return;
}



void Unwind_14041dca0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041dcb0(undefined8 param_1,longlong param_2)

{
  FUN_140384900(param_2 + 0x28);
  return;
}



void Unwind_14041dcc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x28);
  return;
}



void Unwind_14041dcd0(undefined8 param_1,longlong param_2)

{
  FUN_1403848f0(param_2 + 0x38);
  return;
}



void Unwind_14041dce0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041dcf0(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0xa0);
  return;
}



void Unwind_14041dd00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041dd10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_14041dd20(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xa0);
  return;
}



void Unwind_14041dd30(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xa0);
  return;
}



void Unwind_14041dd40(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xde0);
  return;
}



void Unwind_14041dd50(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xdd0);
  return;
}



void Unwind_14041dd70(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x150);
  return;
}



void Unwind_14041dd80(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xdd0);
  return;
}



void Unwind_14041dda0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x150);
  return;
}



void Unwind_14041ddb0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xdd0);
  return;
}



void Unwind_14041ddd0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1a60);
  return;
}



void Unwind_14041ddf0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041de00(undefined8 param_1,longlong param_2)

{
  FUN_14035c470(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041de10(undefined8 param_1,longlong param_2)

{
  FUN_140386090(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14041de20(undefined8 param_1,longlong param_2)

{
  FUN_1403860d0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_14041de30(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xb0);
  return;
}



void Unwind_14041de40(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xb0);
  return;
}



void Unwind_14041de50(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x160);
  return;
}



void Unwind_14041de60(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1a70);
  return;
}



void Unwind_14041de80(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xdf0);
  return;
}



void Unwind_14041de90(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1a70);
  return;
}



void Unwind_14041deb0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xde0);
  return;
}



void Unwind_14041ded0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041dee0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_14041def0(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(param_2 + 0x230);
  return;
}



void Unwind_14041df00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14041df10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x138);
  return;
}



void Unwind_14041df20(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xc0);
  return;
}



void Unwind_14041df30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041df40(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_14041df50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041df60(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe8) + 8);
  return;
}



void Unwind_14041df70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041df80(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xf0);
  return;
}



void Unwind_14041df90(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x180);
  return;
}



void Unwind_14041dfa0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x180);
  return;
}



void Unwind_14041dfb0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1070);
  return;
}



void Unwind_14041dfc0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1060);
  return;
}



void Unwind_14041dfe0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x3e0);
  return;
}



void Unwind_14041dff0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1060);
  return;
}



void Unwind_14041e010(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1060);
  return;
}



void Unwind_14041e030(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x3e0);
  return;
}



void Unwind_14041e040(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1060);
  return;
}



void Unwind_14041e060(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1cf0);
  return;
}



void Unwind_14041e080(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_14041e090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_14041e0a0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_14041e0b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



void Unwind_14041e0c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_14041e0d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_14041e0e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041e0f0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_14041e100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041e110(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_14041e120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_14041e130(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e140(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_14041e150(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e160(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041e170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041e180(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_14041e190(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e1a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e1b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e1c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041e1d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_14041e1e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041e1f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041e220(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_14041e230(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041e240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e260(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x70);
  return;
}



void Unwind_14041e270(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_14041e280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_14041e290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041e2a0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xc0);
  return;
}



void Unwind_14041e2b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041e2c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041e2d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041e2e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041e2f0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xf0);
  return;
}



void Unwind_14041e300(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xf0);
  return;
}



void Unwind_14041e310(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1a0);
  return;
}



void Unwind_14041e320(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xe30);
  return;
}



void Unwind_14041e330(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xe30);
  return;
}



void Unwind_14041e340(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041e350(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041e360(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041e370(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041e380(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041e390(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041e3a0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0580(param_2 + 0x58);
  return;
}



void Unwind_14041e3b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041e3c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041e3d0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0580(param_2 + 0x98);
  return;
}



void Unwind_14041e3e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041e3f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041e400(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041e410(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041e420(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041e430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



undefined * Catch_14041e440(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0xd0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_14034f670(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_14034f090(param_2 + 0x40);
  }
  return &DAT_14038a2ec;
}



void Unwind_14041e4c0(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



undefined * Catch_14041e4d0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0xd0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_14034f0d0(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_14034f090(param_2 + 0x40);
  }
  return &DAT_14038a2ec;
}



void Unwind_14041e550(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



undefined * Catch_14041e560(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0xd0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_14034f6f0(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_14034f090(param_2 + 0x40);
  }
  return &DAT_14038a2ec;
}



void Unwind_14041e5e0(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



void Unwind_14041e5f0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x70),
                *(longlong *)(param_2 + 0x60) + (longlong)*(int *)(param_2 + 0x68) * 0x48);
  return;
}



void Unwind_14041e620(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x78),
                *(longlong *)(param_2 + 0x60) + (longlong)*(int *)(param_2 + 0x70) * 0x48);
  return;
}



void Unwind_14041e650(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d30(param_2 + 0x50);
  return;
}



void Unwind_14041e660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14041e670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041e680(undefined8 param_1,longlong param_2)

{
  FUN_1403a0580(param_2 + 0x130);
  return;
}



void Unwind_14041e690(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041e6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x128);
  return;
}



void Unwind_14041e6b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_14041e6c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x78);
  return;
}



void Unwind_14041e6d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_14041e6e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_14041e6f0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x50);
  return;
}



void Unwind_14041e700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_14041e710(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x78);
  return;
}



void Unwind_14041e720(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x78);
  return;
}



void Unwind_14041e730(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041e740(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd0);
  return;
}



void Unwind_14041e750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_14041e760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_14041e770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14041e780(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041e790(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041e7a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041e7b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_14041e7c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_14041e7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_14041e7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_14041e7f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14041e800(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_14041e810(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_14041e820(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_14041e830(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x38);
  return;
}



void Unwind_14041e840(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x38);
  return;
}



void Unwind_14041e850(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd70);
  return;
}



void Unwind_14041e870(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xf0);
  return;
}



void Unwind_14041e880(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd70);
  return;
}



void Unwind_14041e8a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_14041e8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041e8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_14041e8d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_14041e8e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_14041e8f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_14041e900(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_14041e910(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x40);
  return;
}



void Unwind_14041e920(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd80);
  return;
}



void Unwind_14041e940(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x100);
  return;
}



void Unwind_14041e950(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd80);
  return;
}



void Unwind_14041e970(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14041e980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_14041e990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_14041e9a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041e9b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041e9c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xf0) + 8);
  return;
}



void Unwind_14041e9d0(undefined8 param_1,longlong param_2)

{
  FUN_140389c20(param_2 + 0x38);
  return;
}



void Unwind_14041e9e0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x68);
  return;
}



void Unwind_14041e9f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041ea00(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041ea10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_14041ea20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_14041ea30(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x170);
  return;
}



void Unwind_14041ea40(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x170);
  return;
}



void Unwind_14041ea50(undefined8 param_1,longlong param_2)

{
  FUN_140383be0(param_2 + 0xa0);
  return;
}



void Unwind_14041ea60(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xeb0);
  return;
}



void Unwind_14041ea70(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xea0);
  return;
}



void Unwind_14041ea90(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x220);
  return;
}



void Unwind_14041eaa0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xea0);
  return;
}



void Unwind_14041eac0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xea0);
  return;
}



void Unwind_14041eae0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x220);
  return;
}



void Unwind_14041eaf0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xea0);
  return;
}



void Unwind_14041eb10(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1b30);
  return;
}



void Unwind_14041eb30(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_14041eb40(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041eb50(undefined8 param_1,longlong param_2)

{
  FUN_140389c60(param_2 + 0x70);
  return;
}



void Unwind_14041eb60(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x98);
  return;
}



void Unwind_14041eb70(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041eb80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041eb90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_14041eba0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x100);
  return;
}



void Unwind_14041ebb0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x100);
  return;
}



void Unwind_14041ebc0(undefined8 param_1,longlong param_2)

{
  FUN_140383be0(param_2 + 0xf0);
  return;
}



void Unwind_14041ebd0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1b0);
  return;
}



void Unwind_14041ebe0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xe40);
  return;
}



void Unwind_14041ebf0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xe40);
  return;
}



void Unwind_14041ec00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041ec10(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041ec20(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x38) + 8);
  return;
}



void Unwind_14041ec30(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x38);
  return;
}



void Unwind_14041ec40(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041ec50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_14041ec60(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041ec70(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xa0);
  return;
}



void Unwind_14041ec80(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xa0);
  return;
}



void Unwind_14041ec90(undefined8 param_1,longlong param_2)

{
  FUN_140383be0(param_2 + 0x80);
  return;
}



void Unwind_14041eca0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x150);
  return;
}



void Unwind_14041ecb0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xde0);
  return;
}



void Unwind_14041ecc0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xde0);
  return;
}



void Unwind_14041ecd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_14041ece0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041ecf0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041ed00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_14041ed10(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_14041ed20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041ed30(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd60);
  return;
}



void Unwind_14041ed50(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xe0);
  return;
}



void Unwind_14041ed60(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd60);
  return;
}



void Unwind_14041ed80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041ed90(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_14041eda0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x30);
  return;
}



void Unwind_14041edb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041edc0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd40);
  return;
}



void Unwind_14041ede0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xc0);
  return;
}



void Unwind_14041edf0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd40);
  return;
}



void Unwind_14041ee10(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041ee20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_14041ee30(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_14041ee40(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x40);
  return;
}



void Unwind_14041ee50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041ee60(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd60);
  return;
}



void Unwind_14041ee80(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xe0);
  return;
}



void Unwind_14041ee90(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd60);
  return;
}



void Unwind_14041eeb0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14041eec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_14041eed0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_14041eee0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_14041eef0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x20);
  return;
}



void Unwind_14041ef00(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x70);
  return;
}



void Unwind_14041ef10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_14041ef20(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd0);
  return;
}



void Unwind_14041ef30(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xb0) + 8);
  return;
}



void Unwind_14041ef40(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x20);
  return;
}



void Unwind_14041ef50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_14041ef60(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_14041ef70(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x30);
  return;
}



void Unwind_14041ef80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_14041ef90(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd60);
  return;
}



void Unwind_14041efb0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xe0);
  return;
}



void Unwind_14041efc0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd60);
  return;
}



void Unwind_14041efe0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x88);
  return;
}



void Unwind_14041eff0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x68) + 8);
  return;
}



void Unwind_14041f000(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x88),
                *(longlong *)(param_2 + 0x80) + (longlong)*(int *)(param_2 + 0x78) * 8);
  return;
}



void Unwind_14041f030(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0xa0),
                *(longlong *)(param_2 + 0x98) + (longlong)*(int *)(param_2 + 0x90) * 8);
  return;
}



void Unwind_14041f060(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),
                *(longlong *)(param_2 + 0x118) + (longlong)*(int *)(param_2 + 0x108) * 8);
  return;
}



void Unwind_14041f090(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0xb8),
                *(longlong *)(param_2 + 0xb0) + (longlong)*(int *)(param_2 + 0xa8) * 8);
  return;
}



void Unwind_14041f0c0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14041f0d0(undefined8 param_1,longlong param_2)

{
  FUN_1403700a0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_14041f0e0(undefined8 param_1,longlong param_2)

{
  FUN_1403700a0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_14041f0f0(undefined8 param_1,longlong param_2)

{
  FUN_140364100(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_14041f110(undefined8 param_1,longlong param_2)

{
  FUN_140364100(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_14041f130(undefined8 param_1,longlong param_2)

{
  FUN_14035a020(*(longlong *)(param_2 + 0x40) + 0x150);
  return;
}



void Unwind_14041f150(undefined8 param_1,longlong param_2)

{
  FUN_140357550(*(longlong *)(param_2 + 0x40) + 0x158);
  return;
}



void Unwind_14041f170(undefined8 param_1,longlong param_2)

{
  FUN_14038a1d0(*(longlong *)(param_2 + 0x40) + 0x160);
  return;
}



void Unwind_14041f190(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14041f1a0(undefined8 param_1,longlong param_2)

{
  FUN_1403700a0(*(longlong *)(param_2 + 0x60) + 0x38);
  return;
}



void Unwind_14041f1b0(undefined8 param_1,longlong param_2)

{
  FUN_1403700a0(*(longlong *)(param_2 + 0x60) + 0x60);
  return;
}



void Unwind_14041f1c0(undefined8 param_1,longlong param_2)

{
  FUN_140364100(*(longlong *)(param_2 + 0x60) + 0x88);
  return;
}



void Unwind_14041f1e0(undefined8 param_1,longlong param_2)

{
  FUN_140364100(*(longlong *)(param_2 + 0x60) + 0x90);
  return;
}



void Unwind_14041f200(undefined8 param_1,longlong param_2)

{
  FUN_14035a020(*(longlong *)(param_2 + 0x60) + 0x150);
  return;
}



void Unwind_14041f220(undefined8 param_1,longlong param_2)

{
  FUN_140357550(*(longlong *)(param_2 + 0x60) + 0x158);
  return;
}



void Unwind_14041f240(undefined8 param_1,longlong param_2)

{
  FUN_14038a1d0(*(longlong *)(param_2 + 0x60) + 0x160);
  return;
}



void Unwind_14041f260(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041f270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041f280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041f290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x90),0x780);
  return;
}



void Unwind_14041f2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_14041f2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_14041f2d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041f2e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14041f2f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_14041f300(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x30);
  return;
}



void Unwind_14041f310(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_14041f320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf8);
  return;
}



void Unwind_14041f330(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_14041f340(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_14041f350(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14041f360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_14041f370(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_14041f380(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041f390(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_14041f3a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_14041f3b0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_14041f3c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041f3d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_14041f3e0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x90);
  return;
}



void Unwind_14041f3f0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 200);
  return;
}



void Unwind_14041f400(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x20);
  return;
}



void Unwind_14041f410(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14041f420(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x40);
  return;
}



undefined * Catch_14041f430(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_1403841b0(param_2 + 0x40);
  FUN_140383c40(param_2 + 0x40);
  FUN_140384310(param_2 + 0x40,0x800);
  FUN_140384310(param_2 + 0x40,0);
  FUN_140058870(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_140385580(param_2 + 0x40,0);
  FUN_1403555d0(param_2 + 0x118);
  lVar2 = *(longlong *)(param_2 + 0x30);
  uVar3 = (**(code **)(*(longlong *)(lVar2 + 0x108) + 0x10))();
  *(undefined8 *)(param_2 + 0xb8) = uVar3;
  FUN_14034ed40(uVar3);
  *(undefined1 *)(param_2 + 0xc0) = 1;
  uVar4 = FUN_140361500(param_2 + 0x1a0,param_2 + 0x40);
  *(undefined8 *)(param_2 + 0x30) = 0;
  *(undefined1 *)(param_2 + 0x38) = 1;
  FUN_1403a03a0(*(undefined8 *)(lVar2 + 0x748),uVar4,param_2 + 0x30);
  FUN_1403606a0(param_2 + 0x1a0);
  FUN_14034edd0(uVar3);
  *(longlong *)(param_2 + 0x30) = param_2 + 0x48;
  FUN_140399690(param_2 + 0x48);
  if ((*(longlong *)(param_2 + 0x50) != 0) && (*(int *)(param_2 + 0x5c) < 0)) {
                    // WARNING: Subroutine does not return
    FUN_14034f7d0();
  }
  return &DAT_14038f9e3;
}



void Unwind_14041f5a0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_14041f5b0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x40);
  return;
}



void Unwind_14041f5c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x118);
  return;
}



void Unwind_14041f5d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_14041f5e0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1a0);
  return;
}



void Unwind_14041f5f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041f600(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xf0);
  return;
}



void Unwind_14041f610(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0xf0);
  return;
}



void Unwind_14041f620(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_14041f630(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1a0);
  return;
}



void Unwind_14041f640(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041f650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041f660(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_14041f670(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0xb0);
  return;
}



void Unwind_14041f680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_14041f690(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041f6a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041f6b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_14041f6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x1e8),0x60);
  return;
}



void Unwind_14041f6e0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x1e8));
  return;
}



void Unwind_14041f700(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x1e8);
  return;
}



void Unwind_14041f710(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



undefined * Catch_14041f720(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1d0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_14034f670(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_14034f090(param_2 + 0x40);
  }
  return &DAT_14038ff47;
}



void Unwind_14041f7a0(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



undefined * Catch_14041f7b0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1d0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_14034f0d0(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_14034f090(param_2 + 0x40);
  }
  return &DAT_14038ff47;
}



void Unwind_14041f830(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



undefined * Catch_14041f840(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x1d0);
  if (*(longlong *)(*(longlong *)(lVar1 + 0x148) + 0x758) != 0) {
    FUN_14034f6f0(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_14034f090(param_2 + 0x40);
  }
  return &DAT_14038ff47;
}



void Unwind_14041f8c0(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x40);
  return;
}



void Unwind_14041f8d0(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d30(param_2 + 0x30);
  return;
}



void Unwind_14041f8e0(undefined8 param_1,longlong param_2)

{
  FUN_140389020(param_2 + 0x40);
  return;
}



void Unwind_14041f8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_14041f900(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xb0);
  return;
}



void Unwind_14041f910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_14041f920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14041f930(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



undefined8 Catch_14041f940(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  undefined *puVar2;
  undefined8 uVar3;
  undefined *puVar4;
  
  FUN_14034fe70();
  *(undefined **)(param_2 + 0x68) = PTR_DAT_1405d8010;
  uVar3 = (**(code **)(**(longlong **)(param_2 + 0x138) + 8))();
  *(longlong *)(param_2 + 0x160) = param_2 + 0x168;
  FUN_14012a1d0(param_2 + 0x160,uVar3,3);
  FUN_140017720(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_1405d8010;
  }
  FUN_14038fa80(*(undefined8 *)(param_2 + 0x48),L"Proud::CNetThreads_S::TcpListenerProc",puVar4,0);
  if (((puVar2 != (undefined *)0x0) && (puVar2 != PTR_DAT_1405d8010)) &&
     (puVar2 + -8 != (undefined *)0x0)) {
    uVar3 = FUN_14034fe70();
    *(undefined8 *)(param_2 + 0x128) = uVar3;
    FUN_14034ed40(uVar3);
    *(undefined1 *)(param_2 + 0x130) = 1;
    piVar1 = (int *)(puVar2 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar2 + -8);
    }
    FUN_14034edd0(uVar3);
  }
  return 0x140390511;
}



void Unwind_14041fa40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_14041fa50(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x160);
  return;
}



void Unwind_14041fa60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



undefined8 Catch_14041fa70(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  int *piVar2;
  undefined *puVar3;
  longlong lVar4;
  longlong *plVar5;
  undefined8 uVar6;
  undefined *puVar7;
  
  FUN_14034fe70();
  *(undefined **)(param_2 + 0x60) = PTR_DAT_1405d8010;
  plVar5 = (longlong *)FUN_14034f190(*(undefined8 *)(param_2 + 0x120),param_2 + 0x78);
  uVar6 = 0;
  if ((undefined8 *)*plVar5 != (undefined8 *)0x0) {
    uVar6 = *(undefined8 *)*plVar5;
  }
  FUN_140017720(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_1405d8010;
  }
  FUN_14038fa80(*(undefined8 *)(param_2 + 0x48),L"Proud::CNetThreads_S::TcpListenerProc",puVar7,0);
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    uVar6 = FUN_14034fe70();
    *(undefined8 *)(param_2 + 0x140) = uVar6;
    FUN_14034ed40(uVar6);
    *(undefined1 *)(param_2 + 0x148) = 1;
    piVar2 = (int *)(puVar3 + -4);
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_14034ff60(puVar3 + -8);
    }
    FUN_14034edd0(uVar6);
  }
  return 0x140390511;
}



void Unwind_14041fb80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14041fb90(undefined8 param_1,longlong param_2)

{
  FUN_14034f130(param_2 + 0x78);
  return;
}



void Unwind_14041fba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x140);
  return;
}



undefined8 Catch_14041fbb0(undefined8 param_1,longlong param_2)

{
  FUN_14038fa80(*(undefined8 *)(param_2 + 0x48),L"Proud::CNetThreads_S::TcpListenerProc",L"void*",0)
  ;
  return 0x140390511;
}



void Unwind_14041fbf0(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d30(param_2 + 0x20);
  return;
}



void Unwind_14041fc00(undefined8 param_1,longlong param_2)

{
  FUN_1403a6230(param_2 + 0x60);
  return;
}



void Unwind_14041fc10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041fc20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041fc30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14041fc40(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_14041fc50(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x58);
  return;
}



void Unwind_14041fc60(undefined8 param_1,longlong param_2)

{
  FUN_1403770d0(param_2 + 0x28);
  return;
}



void Unwind_14041fc70(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_14041fc80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x1a8) + 8);
  return;
}



void Unwind_14041fc90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041fca0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x50);
  return;
}



void Unwind_14041fcb0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_14041fcc0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x50);
  return;
}



void Unwind_14041fcd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14041fce0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xb8) + 8);
  return;
}



void Unwind_14041fcf0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x40);
  return;
}



void Unwind_14041fd00(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041fd10(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x40);
  return;
}



void Unwind_14041fd20(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_14041fd30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_14041fd40(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x40);
  return;
}



void Unwind_14041fd50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_14041fd60(undefined8 param_1,longlong param_2)

{
  FUN_1403a0580(param_2 + 0xa0);
  return;
}



void Unwind_14041fd70(undefined8 param_1,longlong param_2)

{
  FUN_14038a5d0(param_2 + 0x58);
  return;
}



void Unwind_14041fd80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14041fd90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf8);
  return;
}



void Unwind_14041fda0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



undefined * Catch_14041fdb0(undefined8 param_1,longlong param_2)

{
  FUN_14038f2a0(*(undefined8 *)(param_2 + 0x1c0),*(undefined8 *)(param_2 + 0x40),
                L"Proud::CNetThreads_S::NetWorkerThread_UdpRecvCompletionCase",L"std.exception");
  return &DAT_140391983;
}



undefined * Catch_14041fdf0(undefined8 param_1,longlong param_2)

{
  FUN_14038f2a0(*(undefined8 *)(param_2 + 0x1c0),*(undefined8 *)(param_2 + 0x40),
                L"Proud::CNetThreads_S::NetWorkerThread_UdpRecvCompletionCase",L"_com_error");
  return &DAT_140391983;
}



undefined * Catch_14041fe30(undefined8 param_1,longlong param_2)

{
  FUN_14038f2a0(*(undefined8 *)(param_2 + 0x1c0),*(undefined8 *)(param_2 + 0x40),
                L"Proud::CNetThreads_S::NetWorkerThread_UdpRecvCompletionCase",L"void*");
  return &DAT_140391983;
}



void Unwind_14041fe70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_14041fe80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x140);
  return;
}



void Unwind_14041fe90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_14041fea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x150);
  return;
}



void Unwind_14041feb0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0580(param_2 + 0x180);
  return;
}



void Unwind_14041fec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14041fed0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_14041fee0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_14041fef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_14041ff00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14041ff10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_14041ff20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_14041ff30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_14041ff40(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa8);
  return;
}



void Unwind_14041ff50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_14041ff60(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x80);
  return;
}



undefined8 Catch_14041ff70(undefined8 param_1,longlong param_2)

{
  undefined8 uVar1;
  
  uVar1 = (**(code **)(**(longlong **)(param_2 + 0x48) + 8))();
  *(longlong *)(param_2 + 0x50) = param_2 + 0x58;
  FUN_14012a1d0(param_2 + 0x50,uVar1,3);
  FUN_14038f2a0(*(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 0x140392236;
}



void Unwind_14041ffe0(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x50);
  return;
}



undefined8 Catch_14041fff0(undefined8 param_1,longlong param_2)

{
  longlong *plVar1;
  longlong lVar2;
  longlong *plVar3;
  undefined8 uVar4;
  
  plVar3 = (longlong *)FUN_14034f190(*(undefined8 *)(param_2 + 0x40),param_2 + 0x30);
  uVar4 = 0;
  if ((undefined8 *)*plVar3 != (undefined8 *)0x0) {
    uVar4 = *(undefined8 *)*plVar3;
  }
  FUN_14038f2a0(*(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 0x140392236;
}



void Unwind_140420080(undefined8 param_1,longlong param_2)

{
  FUN_14034f130(param_2 + 0x30);
  return;
}



undefined8 Catch_140420090(undefined8 param_1,longlong param_2)

{
  FUN_14038f2a0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20),
                L"Proud::CNetThreads_S::NetWorkerThread_PerRemoteClient",L"void*");
  return 0x140392236;
}



void Unwind_1404200d0(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d30(param_2 + 0x138);
  return;
}



void Unwind_1404200e0(undefined8 param_1,longlong param_2)

{
  FUN_1403897f0(param_2 + 0x70);
  return;
}



void Unwind_1404200f0(undefined8 param_1,longlong param_2)

{
  FUN_14038d7d0(param_2 + 0x48);
  return;
}



void Unwind_140420100(undefined8 param_1,longlong param_2)

{
  FUN_140389830(param_2 + 0x20);
  return;
}



void Unwind_140420110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x148);
  return;
}



void Unwind_140420120(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_140420130(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x140) + 8);
  return;
}



void Unwind_140420140(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 200));
  return;
}



void Unwind_140420150(undefined8 param_1,longlong param_2)

{
  FUN_140364100(param_2 + 0x28);
  return;
}



void Unwind_140420160(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 200));
  return;
}



void Unwind_140420170(undefined8 param_1,longlong param_2)

{
  FUN_140364100(param_2 + 0x30);
  return;
}



void Unwind_140420180(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_140420190(undefined8 param_1,longlong param_2)

{
  FUN_140364100(param_2 + 0x38);
  return;
}



void Unwind_1404201a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404201b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0xb0));
  return;
}



void Unwind_1404201c0(undefined8 param_1,longlong param_2)

{
  FUN_140364100(param_2 + 0x20);
  return;
}



undefined8 Catch_All_1404201d0(void)

{
  return 0x140393143;
}



void Unwind_1404201f0(undefined8 param_1,longlong param_2)

{
  FUN_140393130(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140420200(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140420210(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0xc0));
  return;
}



void Unwind_140420220(undefined8 param_1,longlong param_2)

{
  FUN_1403932f0(param_2 + 0xc0);
  return;
}



void Unwind_140420230(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0xd8));
  return;
}



void Unwind_140420250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140420260(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_140420270(undefined8 param_1,longlong param_2)

{
  FUN_1403932f0(param_2 + 0x20);
  return;
}



void Unwind_140420280(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x50),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_1404202a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_1404202b0(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0xa8);
  return;
}



void Unwind_1404202c0(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x160);
  return;
}



void Unwind_1404202d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1404202e0(undefined8 param_1,longlong param_2)

{
  FUN_140393b00(param_2 + 0x78);
  return;
}



void Unwind_1404202f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_140420300(undefined8 param_1,longlong param_2)

{
  FUN_1403932f0(param_2 + 0x58);
  return;
}



void Unwind_140420310(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x150),*(undefined8 *)(param_2 + 0x148));
  return;
}



void Unwind_140420340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_140420350(undefined8 param_1,longlong param_2)

{
  FUN_1403932f0(param_2 + 0x50);
  return;
}



void Unwind_140420360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_140420370(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0x70);
  return;
}



void Unwind_140420380(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x270);
  return;
}



void Unwind_140420390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1404203a0(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0xe0);
  return;
}



void Unwind_1404203b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_1404203c0(undefined8 param_1,longlong param_2)

{
  FUN_140392e50(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404203d0(undefined8 param_1,longlong param_2)

{
  FUN_14035a020(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1404203e0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1404203f0(undefined8 param_1,longlong param_2)

{
  FUN_1403574e0(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_140420400(undefined8 param_1,longlong param_2)

{
  FUN_140393b00(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140420420(undefined8 param_1,longlong param_2)

{
  FUN_140392e50(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140420430(undefined8 param_1,longlong param_2)

{
  FUN_14035a020(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140420440(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140420450(undefined8 param_1,longlong param_2)

{
  FUN_140392e50(param_2 + 0x48);
  return;
}



void Unwind_140420460(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_140420470(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140420480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x90),0x400);
  return;
}



void Unwind_1404204a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x90),0x400);
  return;
}



void Unwind_1404204c0(undefined8 param_1,longlong param_2)

{
  FUN_1403574e0(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1404204d0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x60) + 0x30);
  return;
}



void Unwind_1404204e0(undefined8 param_1,longlong param_2)

{
  FUN_1403947d0(*(longlong *)(param_2 + 0x60) + 0x68);
  return;
}



void Unwind_1404204f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140420500(undefined8 param_1,longlong param_2)

{
  FUN_1403574e0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140420510(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_140420520(undefined8 param_1,longlong param_2)

{
  FUN_1403947d0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_140420530(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x30);
  return;
}



void Unwind_140420540(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x58);
  return;
}



void Unwind_140420550(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x60);
  return;
}



undefined * Catch_140420560(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x78) + 8))();
  return &DAT_140396b62;
}



void Unwind_140420590(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x30);
  return;
}



void Unwind_1404205a0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x58);
  return;
}



void Unwind_1404205b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x60);
  return;
}



undefined * Catch_1404205c0(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x70) + 8))();
  return &DAT_140396e16;
}



void Unwind_1404205f0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x38);
  return;
}



undefined * Catch_140420600(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x30) + 8))();
  return &DAT_14039710d;
}



undefined * Catch_140420630(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x38) + 8))();
  return &DAT_140397332;
}



void Unwind_140420660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140420670(void)

{
  DAT_1405f2780 = DAT_1405f2780 & 0xfffffffe;
  return;
}



void Unwind_140420690(undefined8 param_1,longlong param_2)

{
  FUN_1400032a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404206a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140388ea0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1404206b0(undefined8 param_1,longlong param_2)

{
  FUN_140397380(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1404206c0(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1404206d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1404206e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1404206f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140385b20(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_140420700(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_140420720(undefined8 param_1,longlong param_2)

{
  FUN_1400022f0(param_2 + 0x50);
  return;
}



void Unwind_140420730(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140420740(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140420750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_140420760(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140420770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x158);
  return;
}



void Unwind_140420780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140420790(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404207a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404207b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404207c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404207d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_1404207e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404207f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_140420800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140420810(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140420820(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140420830(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140420840(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140420850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140420860(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140420870(undefined8 param_1,longlong param_2)

{
  FUN_1400032a0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140420880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140388ea0(*(longlong *)(param_2 + 0x70) + 0x10);
  return;
}



void Unwind_140420890(undefined8 param_1,longlong param_2)

{
  FUN_140397380(*(longlong *)(param_2 + 0x70) + 0x30);
  return;
}



void Unwind_1404208a0(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_1404208b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x70) + 0x50);
  return;
}



void Unwind_1404208c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x70) + 0x60);
  return;
}



void Unwind_1404208d0(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1404208e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140385b20(*(longlong *)(param_2 + 0x70) + 0x68);
  return;
}



void Unwind_1404208f0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 0x98);
  return;
}



void Unwind_140420910(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_140420920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



undefined8 Catch_All_140420930(void)

{
  return 0x14039a593;
}



void Unwind_140420950(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140420960(undefined8 param_1,longlong param_2)

{
  FUN_140373380(param_2 + 0x90);
  return;
}



void Unwind_140420970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x68),0xd0);
  return;
}



void Unwind_140420990(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x60) & 1) != 0) {
    *(uint *)(param_2 + 0x60) = *(uint *)(param_2 + 0x60) & 0xfffffffe;
    FUN_140376a30(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_1404209c0(undefined8 param_1,longlong param_2)

{
  FUN_1403770d0(param_2 + 0x28);
  return;
}



void Unwind_1404209d0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_1404209e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x150) + 8);
  return;
}



void Unwind_1404209f0(undefined8 param_1,longlong param_2)

{
  FUN_14035c510(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140420a00(undefined8 param_1,longlong param_2)

{
  FUN_1403a6c70(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_140420a10(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(longlong *)(param_2 + 0x80) + 0x38);
  return;
}



void Unwind_140420a20(undefined8 param_1,longlong param_2)

{
  FUN_140399ac0(*(longlong *)(param_2 + 0x80) + 0x110);
  return;
}



void Unwind_140420a40(undefined8 param_1,longlong param_2)

{
  FUN_14037a0c0(*(longlong *)(param_2 + 0x80) + 0x40);
  return;
}



void Unwind_140420a50(undefined8 param_1,longlong param_2)

{
  FUN_1403a0530(*(longlong *)(param_2 + 0x80) + 0xc0);
  return;
}



void Unwind_140420a70(undefined8 param_1,longlong param_2)

{
  FUN_140399800(*(longlong *)(param_2 + 0x80) + 0x108);
  return;
}



void Unwind_140420a90(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x80) + 0x128);
  return;
}



void Unwind_140420ab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x80) + 0x1f0);
  return;
}



void Unwind_140420ad0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x80) + 0x1f8);
  return;
}



void Unwind_140420af0(undefined8 param_1,longlong param_2)

{
  FUN_140399c30(*(longlong *)(param_2 + 0x80) + 0x228);
  return;
}



void Unwind_140420b10(undefined8 param_1,longlong param_2)

{
  FUN_140007830(*(longlong *)(param_2 + 0x80) + 0x240);
  return;
}



void Unwind_140420b30(undefined8 param_1,longlong param_2)

{
  FUN_14037a270(*(longlong *)(param_2 + 0x80) + 0x268);
  return;
}



void Unwind_140420b50(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0x80) + 0x288);
  return;
}



void Unwind_140420b70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14039a580(*(longlong *)(param_2 + 0x80) + 0x6a0);
  return;
}



void Unwind_140420b90(undefined8 param_1,longlong param_2)

{
  FUN_1403a2020(*(longlong *)(param_2 + 0x80) + 0x700);
  return;
}



void Unwind_140420bb0(undefined8 param_1,longlong param_2)

{
  FUN_1403998f0(*(longlong *)(param_2 + 0x80) + 0x750);
  return;
}



void Unwind_140420bd0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0x80) + 0x760);
  return;
}



void Unwind_140420bf0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_140420c00(undefined8 param_1,longlong param_2)

{
  FUN_14035c510(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140420c10(undefined8 param_1,longlong param_2)

{
  FUN_1403a6c70(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_140420c20(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(longlong *)(param_2 + 0x60) + 0x38);
  return;
}



void Unwind_140420c30(undefined8 param_1,longlong param_2)

{
  FUN_140399ac0(*(longlong *)(param_2 + 0x60) + 0x110);
  return;
}



void Unwind_140420c50(undefined8 param_1,longlong param_2)

{
  FUN_14037a0c0(*(longlong *)(param_2 + 0x60) + 0x40);
  return;
}



void Unwind_140420c60(undefined8 param_1,longlong param_2)

{
  FUN_1403a0530(*(longlong *)(param_2 + 0x60) + 0xc0);
  return;
}



void Unwind_140420c80(undefined8 param_1,longlong param_2)

{
  FUN_140399800(*(longlong *)(param_2 + 0x60) + 0x108);
  return;
}



void Unwind_140420ca0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x60) + 0x128);
  return;
}



void Unwind_140420cc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x60) + 0x1f0);
  return;
}



void Unwind_140420ce0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x60) + 0x1f8);
  return;
}



void Unwind_140420d00(undefined8 param_1,longlong param_2)

{
  FUN_140399c30(*(longlong *)(param_2 + 0x60) + 0x228);
  return;
}



void Unwind_140420d20(undefined8 param_1,longlong param_2)

{
  FUN_140007830(*(longlong *)(param_2 + 0x60) + 0x240);
  return;
}



void Unwind_140420d40(undefined8 param_1,longlong param_2)

{
  FUN_14037a270(*(longlong *)(param_2 + 0x60) + 0x268);
  return;
}



void Unwind_140420d60(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0x60) + 0x288);
  return;
}



void Unwind_140420d80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14039a580(*(longlong *)(param_2 + 0x60) + 0x6a0);
  return;
}



void Unwind_140420da0(undefined8 param_1,longlong param_2)

{
  FUN_1403a2020(*(longlong *)(param_2 + 0x60) + 0x700);
  return;
}



void Unwind_140420dc0(undefined8 param_1,longlong param_2)

{
  FUN_1403998f0(*(longlong *)(param_2 + 0x60) + 0x750);
  return;
}



void Unwind_140420de0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0x60) + 0x760);
  return;
}



void Unwind_140420e00(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x68);
  return;
}



void Unwind_140420e10(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_140420e20(undefined8 param_1,longlong param_2)

{
  FUN_1403770d0(param_2 + 0x28);
  return;
}



void Unwind_140420e30(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x170),*(undefined8 *)(param_2 + 0x160));
  return;
}



void Unwind_140420e60(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(*(longlong *)(param_2 + 0x178) + 8);
  return;
}



void Unwind_140420e70(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_140420e80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_140420e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14039b830(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140420ea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14039b830(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140420eb0(undefined8 param_1,longlong param_2)

{
  FUN_14039b460(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140420ec0(undefined8 param_1,longlong param_2)

{
  FUN_14039cea0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140420ed0(undefined8 param_1,longlong param_2)

{
  FUN_14039b4d0(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_140420ef0(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140420f00(undefined8 param_1,longlong param_2)

{
  FUN_14039b4d0(*(longlong *)(param_2 + 0x40) + 0x678);
  return;
}



undefined8 Catch_All_140420f20(void)

{
  return 0x14039cfd3;
}



void Unwind_140420f40(undefined8 param_1,longlong param_2)

{
  FUN_14039b440(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140420f50(undefined8 param_1,longlong param_2)

{
  FUN_14039b560(*(undefined8 *)(param_2 + 0x50));
  return;
}



undefined8 Catch_All_140420f60(void)

{
  return 0x14039d153;
}



void Unwind_140420f80(undefined8 param_1,longlong param_2)

{
  FUN_14039cfc0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140420f90(undefined8 param_1,longlong param_2)

{
  FUN_14039cfc0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140420fa0(undefined8 param_1,longlong param_2)

{
  FUN_14039b460(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_140420fb0(undefined8 param_1,longlong param_2)

{
  FUN_14039cea0(*(longlong *)(param_2 + 0x50) + 0x18);
  return;
}



void Unwind_140420fc0(undefined8 param_1,longlong param_2)

{
  FUN_14039b4d0(*(longlong *)(param_2 + 0x50) + 0x198);
  return;
}



void Catch_All_140420fe0(undefined8 param_1,longlong param_2)

{
  FUN_140360170(*(undefined8 *)(param_2 + 0x40),*(undefined8 *)(param_2 + 0x48),0);
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140421010(undefined8 param_1,longlong param_2)

{
  FUN_14039c290(*(undefined8 *)(param_2 + 0x50),*(undefined8 *)(param_2 + 0x58),0);
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140421040(undefined8 param_1,longlong param_2)

{
  FUN_14039b460(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_140421050(undefined8 param_1,longlong param_2)

{
  FUN_14039cea0(*(longlong *)(param_2 + 0xb0) + 0x18);
  return;
}



void Unwind_140421060(undefined8 param_1,longlong param_2)

{
  FUN_14039b4d0(*(longlong *)(param_2 + 0xb0) + 0x198);
  return;
}



void Unwind_140421080(undefined8 param_1,longlong param_2)

{
  FUN_14039b460(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140421090(undefined8 param_1,longlong param_2)

{
  FUN_14039cea0(*(longlong *)(param_2 + 0x90) + 0x18);
  return;
}



void Unwind_1404210a0(undefined8 param_1,longlong param_2)

{
  FUN_14039b4d0(*(longlong *)(param_2 + 0x90) + 0x198);
  return;
}



void Unwind_1404210c0(undefined8 param_1,longlong param_2)

{
  FUN_14039d140(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1404210d0(undefined8 param_1,longlong param_2)

{
  FUN_14039d140(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1404210e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404210f0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x88),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140421120(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x38);
  return;
}



void Unwind_140421130(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140421140(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140421150(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140421160(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140421170(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140421180(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140421190(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1404211a0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1404211b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1404211c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1404211d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1404211e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1404211f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140421200(undefined8 param_1,longlong param_2)

{
  FUN_14039d140(*(undefined8 *)(param_2 + 0x130));
  return;
}



void Unwind_140421210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140421220(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140421230(undefined8 param_1,longlong param_2)

{
  FUN_14039d140(*(undefined8 *)(param_2 + 0x138));
  return;
}



void Unwind_140421240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140421250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14039b920(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140421260(undefined8 param_1,longlong param_2)

{
  FUN_14039fca0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_140421270(undefined8 param_1,longlong param_2)

{
  FUN_14039cfe0(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_140421290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14039b920(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404212a0(undefined8 param_1,longlong param_2)

{
  FUN_14039fca0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1404212b0(undefined8 param_1,longlong param_2)

{
  FUN_14039cfe0(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_1404212d0(undefined8 param_1,longlong param_2)

{
  FUN_14039cfc0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1404212e0(undefined8 param_1,longlong param_2)

{
  FUN_14039fc70(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_1404212f0(void)

{
  FUN_14034edf0(&DAT_1405f28a8);
  return;
}



void Unwind_140421300(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140421310(undefined8 param_1,longlong param_2)

{
  FUN_1403a3340(*(longlong *)(param_2 + 0x50) + 0x48);
  return;
}



void Unwind_140421320(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d90(*(longlong *)(param_2 + 0x50) + 200);
  return;
}



void Unwind_140421340(undefined8 param_1,longlong param_2)

{
  FUN_140389020(*(longlong *)(param_2 + 0x50) + 0x110);
  return;
}



void Unwind_140421360(undefined8 param_1,longlong param_2)

{
  FUN_1403a3340(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_140421370(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d90(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_140421390(undefined8 param_1,longlong param_2)

{
  FUN_140389020(*(longlong *)(param_2 + 0x40) + 0x110);
  return;
}



void Unwind_1404213b0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x130);
  return;
}



void Unwind_1404213c0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x80);
  return;
}



void Unwind_1404213d0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x80);
  return;
}



void Unwind_1404213e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_1404213f0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xdb0);
  return;
}



void Unwind_140421410(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1a0);
  return;
}



void Unwind_140421420(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xf0);
  return;
}



void Unwind_140421430(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xf0);
  return;
}



void Unwind_140421440(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140421450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140421460(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140421470(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xe20);
  return;
}



void Unwind_140421490(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x28) & 1) != 0) {
    *(uint *)(param_2 + 0x28) = *(uint *)(param_2 + 0x28) & 0xfffffffe;
    thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x40));
  }
  return;
}



void Unwind_1404214c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x20);
  return;
}



void Unwind_1404214d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404214e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_1404214f0(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x70);
  return;
}



void Unwind_140421500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140421510(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140421520(undefined8 param_1,longlong param_2)

{
  FUN_1403a0930(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_140421540(undefined8 param_1,longlong param_2)

{
  FUN_1403a05c0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140421550(undefined8 param_1,longlong param_2)

{
  FUN_1403a0600(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140421560(undefined8 param_1,longlong param_2)

{
  FUN_1403a0530(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_140421570(undefined8 param_1,longlong param_2)

{
  FUN_140399800(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140421590(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_1404215b0(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0x40) + 0xe0);
  return;
}



void Unwind_1404215d0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x40) + 0x150);
  return;
}



void Unwind_1404215f0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0960(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_140421610(undefined8 param_1,longlong param_2)

{
  FUN_1403a0990(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_140421630(undefined8 param_1,longlong param_2)

{
  FUN_1403a0a20(*(longlong *)(param_2 + 0x40) + 0x178);
  return;
}



void Unwind_140421650(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_140421660(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x40);
  return;
}



void Unwind_140421670(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd60);
  return;
}



void Unwind_140421690(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xe0);
  return;
}



void Unwind_1404216a0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd60);
  return;
}



void Unwind_1404216c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_1404216d0(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1404216e0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0930(*(longlong *)(param_2 + 0x80) + 0x90);
  return;
}



void Unwind_140421700(undefined8 param_1,longlong param_2)

{
  FUN_1403a05c0(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_140421710(undefined8 param_1,longlong param_2)

{
  FUN_1403a0600(*(longlong *)(param_2 + 0x80) + 0x10);
  return;
}



void Unwind_140421720(undefined8 param_1,longlong param_2)

{
  FUN_1403a0530(*(longlong *)(param_2 + 0x80) + 0x40);
  return;
}



void Unwind_140421730(undefined8 param_1,longlong param_2)

{
  FUN_140399800(*(longlong *)(param_2 + 0x80) + 0x88);
  return;
}



void Unwind_140421750(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x80) + 0xa8);
  return;
}



void Unwind_140421770(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0x80) + 0xe0);
  return;
}



void Unwind_140421790(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x80) + 0x150);
  return;
}



void Unwind_1404217b0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0960(*(longlong *)(param_2 + 0x80) + 0x168);
  return;
}



void Unwind_1404217d0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0990(*(longlong *)(param_2 + 0x80) + 0x170);
  return;
}



void Unwind_1404217f0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0a20(*(longlong *)(param_2 + 0x80) + 0x178);
  return;
}



void Unwind_140421810(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_140421820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x88),0x400);
  return;
}



void Unwind_140421840(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x88);
  return;
}



void Unwind_140421850(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_140421860(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x30);
  return;
}



void Unwind_140421870(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140421880(undefined8 param_1,longlong param_2)

{
  FUN_14035a020(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_140421890(undefined8 param_1,longlong param_2)

{
  FUN_140359a60(param_2 + 0x60);
  return;
}



void Unwind_1404218a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140359a60(param_2 + 0x60);
  return;
}



void Unwind_1404218b0(undefined8 param_1,longlong param_2)

{
  FUN_1403a2360(param_2 + 0x40);
  return;
}



void Unwind_1404218c0(undefined8 param_1,longlong param_2)

{
  FUN_1403a2330(param_2 + 0x30);
  return;
}



void Unwind_1404218d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1404218e0(undefined8 param_1,longlong param_2)

{
  FUN_140364100(param_2 + 0x80);
  return;
}



void Unwind_1404218f0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x70);
  return;
}



void Unwind_140421900(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xcf0);
  return;
}



void Unwind_140421920(undefined8 param_1,longlong param_2)

{
  FUN_1403a2da0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140421930(undefined8 param_1,longlong param_2)

{
  FUN_140359460(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140421940(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x38);
  return;
}



void Unwind_140421950(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x20);
  return;
}



void Unwind_140421960(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x28);
  return;
}



void Unwind_140421970(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_140421980(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x28);
  return;
}



void Unwind_140421990(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1404219a0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x28);
  return;
}



void Unwind_1404219b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1404219c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x28);
  return;
}



void Unwind_1404219d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_1404219e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x28);
  return;
}



void Unwind_1404219f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_140421a00(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x28);
  return;
}



void Unwind_140421a10(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_140421a20(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x28);
  return;
}



void Unwind_140421a30(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x160) + 8);
  return;
}



void Unwind_140421a40(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x80);
  return;
}



void Unwind_140421a50(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x170) + 8);
  return;
}



void Unwind_140421a60(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x28);
  return;
}



void Unwind_140421a70(undefined8 param_1,longlong param_2)

{
  FUN_1403a3c10(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140421a80(undefined8 param_1,longlong param_2)

{
  FUN_1403a3c10(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140421a90(undefined8 param_1,longlong param_2)

{
  FUN_14039cfc0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140421aa0(undefined8 param_1,longlong param_2)

{
  FUN_140359460(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



undefined * Catch_140421ab0(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x28) + 8))();
  return &DAT_1403a4b80;
}



void Unwind_140421ae0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x20);
  return;
}



undefined * Catch_140421af0(undefined8 param_1,longlong param_2)

{
  (**(code **)(**(longlong **)(param_2 + 0x48) + 8))();
  return &DAT_1403a4e08;
}



void Unwind_140421b20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140421b30(void)

{
  DAT_1405f3980 = DAT_1405f3980 & 0xfffffffe;
  return;
}



void Unwind_140421b50(undefined8 param_1,longlong param_2)

{
  FUN_1403a4fa0(param_2 + 0x108);
  return;
}



void Unwind_140421b60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_140421b70(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x78);
  return;
}



void Unwind_140421b80(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x50);
  return;
}



void Unwind_140421b90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140421ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140421bb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_140421bc0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x78);
  return;
}



void Unwind_140421bd0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x50);
  return;
}



void Unwind_140421be0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140421bf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140421c00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_140421c10(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x78);
  return;
}



void Unwind_140421c20(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x50);
  return;
}



void Unwind_140421c30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140421c40(undefined8 param_1,longlong param_2)

{
  FUN_140363ad0(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void Unwind_140421c50(undefined8 param_1,longlong param_2)

{
  FUN_14035dcb0(*(longlong *)(param_2 + 0x70) + 0x60);
  return;
}



void Unwind_140421c60(undefined8 param_1,longlong param_2)

{
  FUN_14035f9f0(*(longlong *)(param_2 + 0x70) + 200);
  return;
}



void Unwind_140421c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x68),0x60);
  return;
}



void Unwind_140421ca0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x60) & 1) != 0) {
    *(uint *)(param_2 + 0x60) = *(uint *)(param_2 + 0x60) & 0xfffffffe;
    FUN_140376b30(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_140421cd0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_140421ce0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xf8) + 8);
  return;
}



void Unwind_140421cf0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xf8) + 8);
  return;
}



void Unwind_140421d00(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xf8) + 8);
  return;
}



void Unwind_140421d10(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140421d20(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140421d30(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140421d50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140421d60(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_140421d70(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_140421d80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403899f0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140421d90(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd50);
  return;
}



void Unwind_140421da0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x19d0);
  return;
}



void Unwind_140421dc0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xc0);
  return;
}



void Unwind_140421dd0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd40);
  return;
}



void Unwind_140421df0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x80) & 1) != 0) {
    *(uint *)(param_2 + 0x80) = *(uint *)(param_2 + 0x80) & 0xfffffffe;
    FUN_140017d80(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Unwind_140421e20(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x50) & 1) != 0) {
    *(uint *)(param_2 + 0x50) = *(uint *)(param_2 + 0x50) & 0xfffffffe;
    FUN_14036daa0(*(undefined8 *)(param_2 + 0x58));
  }
  return;
}



void Unwind_140421e50(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x28);
  return;
}



void Unwind_140421e60(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x30);
  return;
}



void Unwind_140421e70(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x28);
  return;
}



void Unwind_140421e80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x30);
  return;
}



void Unwind_140421e90(undefined8 param_1,longlong param_2)

{
  FUN_14036daa0(param_2 + 0x28);
  return;
}



void Unwind_140421ea0(undefined8 param_1,longlong param_2)

{
  FUN_14036daa0(param_2 + 0x28);
  return;
}



void Unwind_140421eb0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_140421ec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403aa220(*(longlong *)(param_2 + 0x50) + 0x38);
  return;
}



void Unwind_140421ed0(undefined8 param_1,longlong param_2)

{
  FUN_1403700a0(*(longlong *)(param_2 + 0x50) + 0x50);
  return;
}



void Unwind_140421ee0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140421ef0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140421f00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403aa220(*(longlong *)(param_2 + 0x70) + 0x38);
  return;
}



void Unwind_140421f10(undefined8 param_1,longlong param_2)

{
  FUN_1403700a0(*(longlong *)(param_2 + 0x70) + 0x50);
  return;
}



void Unwind_140421f20(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_140421f30(undefined8 param_1,longlong param_2)

{
  FUN_140364100(param_2 + 0x80);
  return;
}



void Unwind_140421f40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140421f50(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_140421f60(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x28);
  return;
}



void Unwind_140421f70(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(*(undefined8 *)(param_2 + 0x38));
  return;
}



void Unwind_140421f80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140421f90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140421fa0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140421fb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140421fc0(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_140421ff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_140422000(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140422010(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xb8);
  return;
}



void Unwind_140422020(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x2a0);
  return;
}



void Unwind_140422030(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x2d8);
  return;
}



void Unwind_140422040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140422050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140422060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_140422070(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_140422080(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_140422090(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1404220a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1404220b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_1404220c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xb8);
  return;
}



void Unwind_1404220d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_1404220e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d0);
  return;
}



void Unwind_1404220f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_140422100(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_140422110(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_140422120(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_140422130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422140(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x440);
  return;
}



void Unwind_140422150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140422160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140422170(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140422180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140422190(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1404221a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1404221b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1404221c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x370);
  return;
}



void Unwind_1404221d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1404221e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_1404221f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x380);
  return;
}



void Unwind_140422200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_140422220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x378);
  return;
}



void Unwind_140422230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_140422250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x340);
  return;
}



void Unwind_140422260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_140422280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x350);
  return;
}



void Unwind_140422290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1404222a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1404222b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x360);
  return;
}



void Unwind_1404222c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1404222d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1404222e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x348);
  return;
}



void Unwind_1404222f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140422310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x318);
  return;
}



void Unwind_140422320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140422340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x368);
  return;
}



void Unwind_140422350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140422370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x328);
  return;
}



void Unwind_140422380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1404223a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x358);
  return;
}



void Unwind_1404223b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1404223c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1404223d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x338);
  return;
}



void Unwind_1404223e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1404223f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140422400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x300);
  return;
}



void Unwind_140422410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140422430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x308);
  return;
}



void Unwind_140422440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140422460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x310);
  return;
}



void Unwind_140422470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x420);
  return;
}



void Unwind_140422490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1404224a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 800);
  return;
}



void Unwind_1404224b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1404224c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x420);
  return;
}



void Unwind_1404224d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_1404224e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x330);
  return;
}



void Unwind_1404224f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140422500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b8);
  return;
}



void Unwind_140422510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_140422520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422530(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140422540(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140422570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140422590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd8);
  return;
}



void Unwind_1404225a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404225b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1404225c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404225d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404225e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1404225f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140422610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_140422620(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422630(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140422640(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140422670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140422690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_1404226a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1404226b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404226c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404226d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404226e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1404226f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422700(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x40);
  return;
}



void Unwind_140422710(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_140422720(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x30);
  return;
}



void Unwind_140422730(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd50);
  return;
}



void Unwind_140422750(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd0);
  return;
}



void Unwind_140422760(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd50);
  return;
}



void Unwind_140422780(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_140422790(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_1404227a0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x20);
  return;
}



void Unwind_1404227b0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd50);
  return;
}



void Unwind_1404227d0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd0);
  return;
}



void Unwind_1404227e0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd50);
  return;
}



void Unwind_140422800(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_140422810(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_140422820(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x20);
  return;
}



void Unwind_140422830(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd50);
  return;
}



void Unwind_140422850(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd0);
  return;
}



void Unwind_140422860(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd50);
  return;
}



void Unwind_140422880(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x78) + 8);
  return;
}



void Unwind_140422890(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1404228a0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x88);
  return;
}



void Unwind_1404228b0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x88);
  return;
}



void Unwind_1404228c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1404228d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_1404228e0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x78);
  return;
}



void Unwind_1404228f0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x80);
  return;
}



undefined8 Catch_140422900(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_1403aca30(lVar1 + 0x1520,param_2 + 0x88);
  *(undefined1 *)(lVar1 + 0x1528) = 1;
  return 0x1403b6130;
}



void Unwind_140422960(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x88);
  return;
}



void Unwind_140422970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x50),0x2c0);
  return;
}



void Unwind_140422990(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1404229b0(undefined8 param_1,longlong param_2)

{
  FUN_1403ac5a0(param_2 + 0x58);
  return;
}



void Unwind_1404229c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404229d0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    FUN_1403d81f0(*(undefined8 *)(param_2 + 0x68));
  }
  return;
}



void Unwind_140422a00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140422a10(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x60);
  return;
}



void Unwind_140422a20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140422a30(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x50);
  return;
}



void Unwind_140422a40(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_140422a70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_140422a80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422a90(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x60),*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_140422ab0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140422ac0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_140422ad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_140422ae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140422af0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140422b00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140422b10(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x70),*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_140422b30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140422b40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140422b50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140422b60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140422b70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140422b80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140422b90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140422ba0(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0x68);
  return;
}



void Unwind_140422bb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x130);
  return;
}



void Unwind_140422bc0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x50);
  return;
}



void Unwind_140422bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140422be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_140422bf0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_140422c00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140422c10(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x80);
  return;
}



void Unwind_140422c20(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x80);
  return;
}



void Unwind_140422c30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_140422c40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140422c50(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_140422c60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140422c70(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0xd8);
  return;
}



void Unwind_140422c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_140422c90(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_140422ca0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140422cb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_140422cc0(undefined8 param_1,longlong param_2)

{
  FUN_1403b9cc0(param_2 + 0x48);
  return;
}



void Unwind_140422cd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_140422ce0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x178),*(undefined8 *)(param_2 + 0x160));
  return;
}



void Unwind_140422d10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_140422d20(undefined8 param_1,longlong param_2)

{
  FUN_140392e50(param_2 + 0x68);
  return;
}



void Unwind_140422d30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140422d40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_140422d50(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0x98);
  return;
}



void Unwind_140422d60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_140422d70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140422d80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140422d90(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_140422da0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



undefined8 Catch_All_140422db0(void)

{
  return 0x1403bb7a3;
}



void Unwind_140422dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140422de0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0xf0);
  return;
}



void Unwind_140422df0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0xe8);
  return;
}



undefined * Catch_140422e00(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f0d0(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_14034f090(param_2 + 0x60);
  }
  return &DAT_1403bc019;
}



void Unwind_140422e70(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



undefined * Catch_140422e80(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f670(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_14034f090(param_2 + 0x60);
  }
  return &DAT_1403bc019;
}



void Unwind_140422ef0(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



undefined * Catch_140422f00(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f6f0(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_14034f090(param_2 + 0x60);
  }
  return &DAT_1403bc019;
}



void Unwind_140422f70(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



void Unwind_140422f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0xc0),0x60);
  return;
}



void Unwind_140422fa0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 600);
  return;
}



undefined * Catch_140422fb0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f0d0(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_14034f090(param_2 + 0x60);
  }
  return &DAT_1403bbf15;
}



void Unwind_140423020(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



undefined * Catch_140423030(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f670(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_14034f090(param_2 + 0x60);
  }
  return &DAT_1403bbf1a;
}



void Unwind_1404230a0(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



undefined * Catch_1404230b0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f6f0(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_14034f090(param_2 + 0x60);
  }
  return &DAT_1403bbf1f;
}



void Unwind_140423120(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



void Unwind_140423130(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_140423140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 600),0x60);
  return;
}



void Unwind_140423160(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0xf0);
  return;
}



void Unwind_140423170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_140423180(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x120);
  return;
}



void Unwind_140423190(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x30);
  return;
}



void Unwind_1404231a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1404231b0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x60);
  return;
}



void Unwind_1404231c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x148);
  return;
}



void Unwind_1404231d0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0xe8);
  return;
}



void Unwind_1404231e0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xf8);
  return;
}



void Unwind_1404231f0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0xe0);
  return;
}



undefined8 Catch_140423200(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f0d0(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_14034f090(param_2 + 0x60);
  }
  return 0x1403bc7f6;
}



void Unwind_140423270(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



undefined8 Catch_140423280(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f670(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_14034f090(param_2 + 0x60);
  }
  return 0x1403bc7f6;
}



void Unwind_1404232f0(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



undefined8 Catch_140423300(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong *plVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x250);
  if (*(longlong *)(lVar1 + 0x1580) != 0) {
    FUN_14034f6f0(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_14034f090(param_2 + 0x60);
  }
  return 0x1403bc7f6;
}



void Unwind_140423370(undefined8 param_1,longlong param_2)

{
  FUN_14034f090(param_2 + 0x60);
  return;
}



void Unwind_140423380(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140423390(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1404233a0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x68);
  return;
}



void Unwind_1404233b0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1404233c0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x68);
  return;
}



void Unwind_1404233d0(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0x20);
  return;
}



void Unwind_1404233e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404233f0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    FUN_1403bcae0(*(undefined8 *)(param_2 + 0x68));
  }
  return;
}



void Unwind_140423420(undefined8 param_1,longlong param_2)

{
  FUN_1403bcae0(param_2 + 0x50);
  return;
}



void Unwind_140423430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140423440(undefined8 param_1,longlong param_2)

{
  FUN_1403bcae0(param_2 + 0x70);
  return;
}



void Unwind_140423450(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140423460(undefined8 param_1,longlong param_2)

{
  FUN_1403bcae0(param_2 + 0xa8);
  return;
}



void Unwind_140423470(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140423480(undefined8 param_1,longlong param_2)

{
  FUN_1403bcae0(param_2 + 0x88);
  return;
}



void Unwind_140423490(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404234a0(undefined8 param_1,longlong param_2)

{
  FUN_1403bcae0(param_2 + 0xa0);
  return;
}



void Unwind_1404234b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_1404234d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1404234e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1404234f0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x38);
  return;
}



void Unwind_140423500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x108);
  return;
}



void Unwind_140423510(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(param_2 + 0x2f0);
  return;
}



void Unwind_140423520(undefined8 param_1,longlong param_2)

{
  FUN_1403ac060(param_2 + 0xd8);
  return;
}



void Unwind_140423530(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x38);
  return;
}



void Unwind_140423540(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x60),*(undefined8 *)(param_2 + 0x138));
  return;
}



void Unwind_140423560(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_140423570(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(*(longlong *)(param_2 + 0x60) + 0xc80);
  return;
}



undefined * Catch_140423590(undefined8 param_1,longlong param_2)

{
  LPCWSTR lpOutputString;
  
  lpOutputString = (LPCWSTR)(**(code **)(**(longlong **)(param_2 + 0x150) + 8))();
  OutputDebugStringW(lpOutputString);
  uRam0000000000000000 = 1;
  return &DAT_1403be56f;
}



void Unwind_1404235d0(undefined8 param_1,longlong param_2)

{
  FUN_140389c60(param_2 + 0x38);
  return;
}



void Unwind_1404235e0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x70);
  return;
}



void Unwind_1404235f0(undefined8 param_1,longlong param_2)

{
  FUN_140383be0(param_2 + 0x108);
  return;
}



void Unwind_140423600(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x12c0);
  return;
}



void Unwind_140423610(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x12b0);
  return;
}



void Unwind_140423630(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x630);
  return;
}



void Unwind_140423640(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x12b0);
  return;
}



void Unwind_140423660(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(*(longlong *)(param_2 + 0x60) + 0xc80);
  return;
}



void Unwind_140423680(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140423690(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 8000);
  return;
}



void Unwind_1404236b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1404236c0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1f50);
  return;
}



void Unwind_1404236d0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x240);
  return;
}



void Unwind_1404236e0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x240);
  return;
}



void Unwind_1404236f0(undefined8 param_1,longlong param_2)

{
  FUN_140389c20(param_2 + 0x38);
  return;
}



void Unwind_140423700(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x12c0);
  return;
}



void Unwind_140423710(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x70);
  return;
}



void Unwind_140423720(undefined8 param_1,longlong param_2)

{
  FUN_140383be0(param_2 + 0x108);
  return;
}



void Unwind_140423730(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x12b0);
  return;
}



void Unwind_140423750(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x630);
  return;
}



void Unwind_140423760(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x12b0);
  return;
}



void Unwind_140423780(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(*(longlong *)(param_2 + 0x60) + 0xc80);
  return;
}



void Unwind_1404237a0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1404237b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_1404237c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404237d0(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(param_2 + 0x40);
  return;
}



undefined8 Catch_All_1404237e0(void)

{
  return 0x1403bf7b3;
}



void Unwind_140423800(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140423810(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140423820(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_140423830(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x80) & 1) != 0) {
    *(uint *)(param_2 + 0x80) = *(uint *)(param_2 + 0x80) & 0xfffffffe;
    FUN_1403bcae0(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Unwind_140423860(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140423870(undefined8 param_1,longlong param_2)

{
  FUN_1403a5f20(param_2 + 0x38);
  return;
}



void Unwind_140423880(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x40);
  return;
}



void Unwind_140423890(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1404238a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_1404238b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404238c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_1404238d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_1404238e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1404238f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140423900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140423910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140423920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_140423930(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_140423940(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_140423950(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140423960(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_140423970(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x30);
  return;
}



void Unwind_140423980(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_140423990(undefined8 param_1,longlong param_2)

{
  FUN_1403ac650(param_2 + 0x20);
  return;
}



void Unwind_1404239a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1404239b0(undefined8 param_1,longlong param_2)

{
  FUN_1403ada20(param_2 + 0x28);
  return;
}



void Unwind_1404239c0(undefined8 param_1,longlong param_2)

{
  FUN_140386450(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1404239d0(undefined8 param_1,longlong param_2)

{
  FUN_1403aa980(*(longlong *)(param_2 + 0xb0) + 0x60);
  return;
}



void Unwind_1404239e0(undefined8 param_1,longlong param_2)

{
  FUN_1403aa9c0(*(longlong *)(param_2 + 0xb0) + 0x68);
  return;
}



void Unwind_1404239f0(undefined8 param_1,longlong param_2)

{
  FUN_14035c470(*(longlong *)(param_2 + 0xb0) + 0x70);
  return;
}



void Unwind_140423a00(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(longlong *)(param_2 + 0xb0) + 0x78);
  return;
}



void Unwind_140423a10(undefined8 param_1,longlong param_2)

{
  FUN_1403a0600(*(longlong *)(param_2 + 0xb0) + 0x88);
  return;
}



void Unwind_140423a30(undefined8 param_1,longlong param_2)

{
  FUN_1403a05c0(*(longlong *)(param_2 + 0xb0) + 0x90);
  return;
}



void Unwind_140423a50(undefined8 param_1,longlong param_2)

{
  FUN_1403abcb0(*(longlong *)(param_2 + 0xb0) + 0xa0);
  return;
}



void Unwind_140423a70(undefined8 param_1,longlong param_2)

{
  FUN_14035c590(*(longlong *)(param_2 + 0xb0) + 0x98);
  return;
}



void Unwind_140423a90(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0xb0) + 0xd8);
  return;
}



void Unwind_140423ab0(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0xb0) + 0x4e0);
  return;
}



void Unwind_140423ad0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0xb0) + 0x518);
  return;
}



void Unwind_140423af0(undefined8 param_1,longlong param_2)

{
  FUN_1403ada20(*(longlong *)(param_2 + 0xb0) + 0x5d0);
  return;
}



void Unwind_140423b10(undefined8 param_1,longlong param_2)

{
  FUN_1403ac5a0(*(longlong *)(param_2 + 0xb0) + 0x5d8);
  return;
}



void Unwind_140423b30(undefined8 param_1,longlong param_2)

{
  FUN_1403bf7a0(*(longlong *)(param_2 + 0xb0) + 0x5e0);
  return;
}



void Unwind_140423b50(undefined8 param_1,longlong param_2)

{
  FUN_1403b9c90(*(longlong *)(param_2 + 0xb0) + 0x6e0);
  return;
}



void Unwind_140423b70(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0xb0) + 0x708);
  return;
}



void Unwind_140423b90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140359a60(*(longlong *)(param_2 + 0xb0) + 0xb08);
  return;
}



void Unwind_140423bb0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0xb0) + 0x1520);
  return;
}



void Unwind_140423bd0(undefined8 param_1,longlong param_2)

{
  FUN_1403b9c90(*(longlong *)(param_2 + 0xb0) + 0x1530);
  return;
}



void Unwind_140423bf0(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa60(*(longlong *)(param_2 + 0xb0) + 0x1550);
  return;
}



void Unwind_140423c10(undefined8 param_1,longlong param_2)

{
  FUN_1403ac650(*(longlong *)(param_2 + 0xb0) + 0x1570);
  return;
}



void Unwind_140423c30(undefined8 param_1,longlong param_2)

{
  FUN_1400022f0(*(longlong *)(param_2 + 0xb0) + 0x1588);
  return;
}



void Unwind_140423c50(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0xb0) + 0x15d8);
  return;
}



void Unwind_140423c70(undefined8 param_1,longlong param_2)

{
  FUN_1403bfe60(*(longlong *)(param_2 + 0xb0) + 0x15e0);
  return;
}



void Unwind_140423c90(undefined8 param_1,longlong param_2)

{
  FUN_1403bfe60(*(longlong *)(param_2 + 0xb0) + 0x1600);
  return;
}



void Unwind_140423cb0(undefined8 param_1,longlong param_2)

{
  FUN_1403bb790(*(longlong *)(param_2 + 0xb0) + 0x1650);
  return;
}



void Unwind_140423cd0(undefined8 param_1,longlong param_2)

{
  FUN_1403bb790(*(longlong *)(param_2 + 0xb0) + 0x16a8);
  return;
}



void Unwind_140423cf0(undefined8 param_1,longlong param_2)

{
  FUN_1403b9c60(*(longlong *)(param_2 + 0xb0) + 0x1700);
  return;
}



void Unwind_140423d10(undefined8 param_1,longlong param_2)

{
  FUN_1403bb790(*(longlong *)(param_2 + 0xb0) + 0x1720);
  return;
}



void Unwind_140423d30(undefined8 param_1,longlong param_2)

{
  FUN_1403b9cc0(*(longlong *)(param_2 + 0xb0) + 0x17b0);
  return;
}



void Unwind_140423d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140385b20(*(longlong *)(param_2 + 0xb0) + 0x17d0);
  return;
}



void Unwind_140423d70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140388ea0(*(longlong *)(param_2 + 0xb0) + 0x17f0);
  return;
}



void Unwind_140423d90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140385b20(*(longlong *)(param_2 + 0xb0) + 0x1818);
  return;
}



void Unwind_140423db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140388ea0(*(longlong *)(param_2 + 0xb0) + 0x1838);
  return;
}



void Unwind_140423dd0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x38);
  return;
}



void Unwind_140423de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140423df0(undefined8 param_1,longlong param_2)

{
  FUN_1403ac650(param_2 + 0xb8);
  return;
}



void Unwind_140423e00(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0xc0);
  return;
}



void Unwind_140423e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 200));
  return;
}



void Unwind_140423e20(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140423e30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140423e40(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x40);
  return;
}



void Unwind_140423e50(undefined8 param_1,longlong param_2)

{
  FUN_1403a5f20(param_2 + 0x38);
  return;
}



void Unwind_140423e60(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x40);
  return;
}



void Unwind_140423e70(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_140423e80(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(undefined8 *)(param_2 + 0x148));
  return;
}



void Unwind_140423e90(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_140423ea0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_140423eb0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x20);
  return;
}



void Unwind_140423ec0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_140423ed0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_140423ee0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x40);
  return;
}



void Unwind_140423ef0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_140423f00(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x70);
  return;
}



void Unwind_140423f10(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x98);
  return;
}



void Unwind_140423f20(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x150) + 8);
  return;
}



void Unwind_140423f30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140423f40(undefined8 param_1,longlong param_2)

{
  FUN_1403a5f20(param_2 + 0x70);
  return;
}



void Unwind_140423f50(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x218),*(undefined8 *)(param_2 + 0x200));
  return;
}



void Unwind_140423f80(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(*(longlong *)(param_2 + 0x68) + 8);
  return;
}



void Unwind_140423f90(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x78);
  return;
}



void Unwind_140423fa0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(longlong *)(param_2 + 0x208) + 8);
  return;
}



void Unwind_140423fb0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(*(longlong *)(param_2 + 0x208) + 0x18);
  return;
}



void Unwind_140423fc0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(*(longlong *)(param_2 + 0x208) + 0x20);
  return;
}



void Unwind_140423fd0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x208) + 0x28);
  return;
}



void Unwind_140423fe0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(*(longlong *)(param_2 + 0x208) + 0x50);
  return;
}



void Unwind_140423ff0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x208) + 0x78);
  return;
}



void Unwind_140424000(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x210) + 8);
  return;
}



void Unwind_140424010(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140424020(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x200));
  return;
}



void Unwind_140424030(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140424040(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x200));
  return;
}



void Unwind_140424050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403638e0(*(longlong *)(param_2 + 0x218) + 0x38);
  return;
}



void Unwind_140424060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140424070(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x200));
  return;
}



void Unwind_140424080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x218) + 0x10);
  return;
}



void Unwind_140424090(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x218) + 0x28);
  return;
}



void Unwind_1404240a0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x200) + 8);
  return;
}



void Unwind_1404240b0(undefined8 param_1,longlong param_2)

{
  FUN_1403ac650(param_2 + 0x50);
  return;
}



void Unwind_1404240c0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x58);
  return;
}



void Unwind_1404240d0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x48);
  return;
}



void Unwind_1404240e0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x30);
  return;
}



void Unwind_1404240f0(undefined8 param_1,longlong param_2)

{
  FUN_1400022f0(param_2 + 0x120);
  return;
}



void Unwind_140424100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x120);
  return;
}



void Unwind_140424110(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140424120(undefined8 param_1,longlong param_2)

{
  FUN_1403bcae0(param_2 + 0x48);
  return;
}



void Unwind_140424130(undefined8 param_1,longlong param_2)

{
  FUN_1403bcae0(param_2 + 0x58);
  return;
}



void Unwind_140424140(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x40);
  return;
}



void Unwind_140424150(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_140424160(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x50);
  return;
}



void Unwind_140424170(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x88);
  return;
}



void Unwind_140424180(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x98);
  return;
}



void Unwind_140424190(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x80);
  return;
}



void Unwind_1404241a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1404241b0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa0);
  return;
}



void Unwind_1404241c0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x78);
  return;
}



void Unwind_1404241d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404241e0(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0x198);
  return;
}



void Unwind_1404241f0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424200(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_140424210(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x30);
  return;
}



void Unwind_140424220(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_140424230(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x188);
  return;
}



void Unwind_140424240(undefined8 param_1,longlong param_2)

{
  FUN_1403bcae0(param_2 + 0x170);
  return;
}



void Unwind_140424250(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424260(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_140424270(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x30);
  return;
}



void Unwind_140424280(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424290(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_1404242a0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x50);
  return;
}



void Unwind_1404242b0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_1404242c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x80);
  return;
}



void Unwind_1404242d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa8);
  return;
}



void Unwind_1404242e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x130) + 8);
  return;
}



void Unwind_1404242f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140424300(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x170);
  return;
}



void Unwind_140424310(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0x30);
  return;
}



void Unwind_140424320(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x58);
  return;
}



void Unwind_140424330(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x68);
  return;
}



void Unwind_140424340(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x50);
  return;
}



void Unwind_140424350(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x28);
  return;
}



void Unwind_140424360(undefined8 param_1,longlong param_2)

{
  FUN_140386450(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140424370(undefined8 param_1,longlong param_2)

{
  FUN_1403aa980(*(longlong *)(param_2 + 0x90) + 0x60);
  return;
}



void Unwind_140424380(undefined8 param_1,longlong param_2)

{
  FUN_1403aa9c0(*(longlong *)(param_2 + 0x90) + 0x68);
  return;
}



void Unwind_140424390(undefined8 param_1,longlong param_2)

{
  FUN_14035c470(*(longlong *)(param_2 + 0x90) + 0x70);
  return;
}



void Unwind_1404243a0(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(longlong *)(param_2 + 0x90) + 0x78);
  return;
}



void Unwind_1404243b0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0600(*(longlong *)(param_2 + 0x90) + 0x88);
  return;
}



void Unwind_1404243d0(undefined8 param_1,longlong param_2)

{
  FUN_1403a05c0(*(longlong *)(param_2 + 0x90) + 0x90);
  return;
}



void Unwind_1404243f0(undefined8 param_1,longlong param_2)

{
  FUN_1403abcb0(*(longlong *)(param_2 + 0x90) + 0xa0);
  return;
}



void Unwind_140424410(undefined8 param_1,longlong param_2)

{
  FUN_14035c590(*(longlong *)(param_2 + 0x90) + 0x98);
  return;
}



void Unwind_140424430(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0x90) + 0xd8);
  return;
}



void Unwind_140424450(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0x90) + 0x4e0);
  return;
}



void Unwind_140424470(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x90) + 0x518);
  return;
}



void Unwind_140424490(undefined8 param_1,longlong param_2)

{
  FUN_1403ada20(*(longlong *)(param_2 + 0x90) + 0x5d0);
  return;
}



void Unwind_1404244b0(undefined8 param_1,longlong param_2)

{
  FUN_1403ac5a0(*(longlong *)(param_2 + 0x90) + 0x5d8);
  return;
}



void Unwind_1404244d0(undefined8 param_1,longlong param_2)

{
  FUN_1403bf7a0(*(longlong *)(param_2 + 0x90) + 0x5e0);
  return;
}



void Unwind_1404244f0(undefined8 param_1,longlong param_2)

{
  FUN_1403b9c90(*(longlong *)(param_2 + 0x90) + 0x6e0);
  return;
}



void Unwind_140424510(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0x90) + 0x708);
  return;
}



void Unwind_140424530(undefined8 param_1,longlong param_2)

{
  FUN_140359a60(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140424540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140359a60(*(longlong *)(param_2 + 0x90) + 0xb08);
  return;
}



void Unwind_140424560(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0x90) + 0x1520);
  return;
}



void Unwind_140424580(undefined8 param_1,longlong param_2)

{
  FUN_1403b9c90(*(longlong *)(param_2 + 0x90) + 0x1530);
  return;
}



void Unwind_1404245a0(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa60(*(longlong *)(param_2 + 0x90) + 0x1550);
  return;
}



void Unwind_1404245c0(undefined8 param_1,longlong param_2)

{
  FUN_1403ac650(*(longlong *)(param_2 + 0x90) + 0x1570);
  return;
}



void Unwind_1404245e0(undefined8 param_1,longlong param_2)

{
  FUN_1400022f0(*(longlong *)(param_2 + 0x90) + 0x1588);
  return;
}



void Unwind_140424600(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0x90) + 0x15d8);
  return;
}



void Unwind_140424620(undefined8 param_1,longlong param_2)

{
  FUN_1403bfe60(*(longlong *)(param_2 + 0x90) + 0x15e0);
  return;
}



void Unwind_140424640(undefined8 param_1,longlong param_2)

{
  FUN_1403bfe60(*(longlong *)(param_2 + 0x90) + 0x1600);
  return;
}



void Unwind_140424660(undefined8 param_1,longlong param_2)

{
  FUN_1403bb790(*(longlong *)(param_2 + 0x90) + 0x1650);
  return;
}



void Unwind_140424680(undefined8 param_1,longlong param_2)

{
  FUN_1403bb790(*(longlong *)(param_2 + 0x90) + 0x16a8);
  return;
}



void Unwind_1404246a0(undefined8 param_1,longlong param_2)

{
  FUN_1403b9c60(*(longlong *)(param_2 + 0x90) + 0x1700);
  return;
}



void Unwind_1404246c0(undefined8 param_1,longlong param_2)

{
  FUN_1403bb790(*(longlong *)(param_2 + 0x90) + 0x1720);
  return;
}



void Unwind_1404246e0(undefined8 param_1,longlong param_2)

{
  FUN_1403b9cc0(*(longlong *)(param_2 + 0x90) + 0x17b0);
  return;
}



void Unwind_140424700(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140424710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140385b20(*(longlong *)(param_2 + 0x90) + 0x17d0);
  return;
}



void Unwind_140424730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140388ea0(*(longlong *)(param_2 + 0x90) + 0x17f0);
  return;
}



void Unwind_140424750(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140424760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140385b20(*(longlong *)(param_2 + 0x90) + 0x1818);
  return;
}



void Unwind_140424780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140388ea0(*(longlong *)(param_2 + 0x90) + 0x1838);
  return;
}



void Unwind_1404247a0(undefined8 param_1,longlong param_2)

{
  FUN_1403ac5a0(param_2 + 0x98);
  return;
}



void Unwind_1404247b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404247c0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_1404247d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_1404247e0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_1404247f0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_140424800(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x30);
  return;
}



void Unwind_140424810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_140424830(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x20),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_140424850(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x180);
  return;
}



void Unwind_140424860(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140424870(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_140424880(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424890(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_1404248a0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x50);
  return;
}



void Unwind_1404248b0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_1404248c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x80);
  return;
}



void Unwind_1404248d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa8);
  return;
}



void Unwind_1404248e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_1404248f0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(*(undefined8 *)(param_2 + 400));
  return;
}



void Unwind_140424900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_140424910(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424920(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_140424930(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x30);
  return;
}



void Unwind_140424940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_140424960(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x198),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_140424990(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x180);
  return;
}



void Unwind_1404249a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404249b0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_1404249c0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_1404249d0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x50);
  return;
}



void Unwind_1404249e0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_1404249f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x80);
  return;
}



void Unwind_140424a00(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa8);
  return;
}



void Unwind_140424a10(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_140424a20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_140424a30(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424a40(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_140424a50(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x30);
  return;
}



void Unwind_140424a60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x180),0x60);
  return;
}



void Unwind_140424a80(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x198),*(undefined8 *)(param_2 + 0x180));
  return;
}



void Unwind_140424ab0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x180);
  return;
}



void Unwind_140424ac0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140424ad0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424ae0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_140424af0(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x50);
  return;
}



void Unwind_140424b00(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_140424b10(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x80);
  return;
}



void Unwind_140424b20(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa8);
  return;
}



void Unwind_140424b30(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x180) + 8);
  return;
}



void Unwind_140424b40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140424b50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140424b60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140424b70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140424b80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_140424b90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140424ba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_140424bb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140424bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140424bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_140424be0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_140424bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_140424c00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140424c10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140424c20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_140424c30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_140424c40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_140424c50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140424c60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140424c70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_140424c80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_140424c90(undefined8 param_1,longlong param_2)

{
  FUN_1403a6230(param_2 + 0x50);
  return;
}



void Unwind_140424ca0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0xd8);
  return;
}



void Unwind_140424cb0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0xe8);
  return;
}



void Unwind_140424cc0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0xd0);
  return;
}



void Unwind_140424cd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x2c8),0x60);
  return;
}



void Unwind_140424cf0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x238),*(undefined8 *)(param_2 + 0x2c8));
  return;
}



void Unwind_140424d20(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x2c8);
  return;
}



void Unwind_140424d30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140424d40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140424d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_140424d60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_140424d70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x208);
  return;
}



void Unwind_140424d80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1c0);
  return;
}



void Unwind_140424d90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140424da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140424db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_140424dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x228);
  return;
}



void Unwind_140424dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1d0);
  return;
}



void Unwind_140424de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1e0);
  return;
}



void Unwind_140424df0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1f8);
  return;
}



void Unwind_140424e00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140424e10(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0xd8);
  return;
}



void Unwind_140424e20(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0xe8);
  return;
}



void Unwind_140424e30(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0xf0);
  return;
}



void Unwind_140424e40(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xf8);
  return;
}



void Unwind_140424e50(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x120);
  return;
}



void Unwind_140424e60(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x148);
  return;
}



void Unwind_140424e70(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x2b0) + 8);
  return;
}



void Unwind_140424e80(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424e90(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_140424ea0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x30);
  return;
}



void Unwind_140424eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x178),0x60);
  return;
}



void Unwind_140424ed0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x20),*(undefined8 *)(param_2 + 0x178));
  return;
}



void Unwind_140424ef0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x178);
  return;
}



void Unwind_140424f00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140424f10(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x38);
  return;
}



void Unwind_140424f20(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x48);
  return;
}



void Unwind_140424f30(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x50);
  return;
}



void Unwind_140424f40(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x58);
  return;
}



void Unwind_140424f50(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x80);
  return;
}



void Unwind_140424f60(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa8);
  return;
}



void Unwind_140424f70(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x178) + 8);
  return;
}



void FUN_140424f80(undefined8 *param_1,longlong param_2)

{
  FUN_1403c60f0(*(undefined4 *)*param_1,param_1,*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140424fb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403638e0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_140424fc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140424fd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140424fe0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140424ff0(void)

{
  DAT_1405f6a90 = DAT_1405f6a90 & 0xfffffffe;
  return;
}



void Unwind_140425010(undefined8 param_1,longlong param_2)

{
  FUN_1403cea90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140425020(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x28);
  return;
}



void Unwind_140425030(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_140425040(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0xf8);
  return;
}



void Unwind_140425050(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x60);
  return;
}



void Unwind_140425060(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_140425070(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_140425080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_140425090(undefined8 param_1,longlong param_2)

{
  FUN_1403cea90(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1404250a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1404250b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404250c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404250d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404250e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1404250f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140425100(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_140425110(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x30);
  return;
}



void Unwind_140425120(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x80);
  return;
}



void Unwind_140425130(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd10);
  return;
}



void Unwind_140425140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140425150(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140425160(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void Unwind_140425170(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x20);
  return;
}



void Unwind_140425180(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x50);
  return;
}



void Unwind_140425190(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1404251a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404251b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_1404251c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404251d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404251e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1404251f0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x38);
  return;
}



void Unwind_140425200(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x38);
  return;
}



void Unwind_140425210(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd70);
  return;
}



void Unwind_140425230(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xf0);
  return;
}



void Unwind_140425240(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd70);
  return;
}



void Unwind_140425260(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_140425270(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_140425280(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x40);
  return;
}



void Unwind_140425290(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x128) + 8);
  return;
}



void Unwind_1404252a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404252b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_1404252c0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x60);
  return;
}



void Unwind_1404252d0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x70),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1404252f0(undefined8 param_1,longlong param_2)

{
  FUN_140389c60(param_2 + 0x90);
  return;
}



void Unwind_140425300(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_140425310(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_140425320(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x40);
  return;
}



void Unwind_140425330(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xc0);
  return;
}



void Unwind_140425340(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x1d8) + 8);
  return;
}



void Unwind_140425350(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x1d8) + 8);
  return;
}



void Unwind_140425360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_140425370(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_140425380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_140425390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x150);
  return;
}



void Unwind_1404253a0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xc0);
  return;
}



void Unwind_1404253b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1404253c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1b0);
  return;
}



void Unwind_1404253d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x70);
  return;
}



void Unwind_1404253e0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x98);
  return;
}



undefined * Catch_1404253f0(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  longlong lVar2;
  undefined *puVar3;
  longlong *plVar4;
  undefined8 uVar5;
  
  FUN_14034fe70();
  *(undefined **)(param_2 + 0xe8) = PTR_DAT_1405d8010;
  lVar2 = *(longlong *)(param_2 + 0x28);
  FUN_1403c3c70(*(undefined8 *)(lVar2 + 0x108),5,3,param_2 + 0xe8);
  puVar3 = *(undefined **)(param_2 + 0xe8);
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    *(undefined8 *)(param_2 + 0x1d0) = uVar5;
    FUN_14034ed40(uVar5);
    *(undefined1 *)(param_2 + 0x1d8) = 1;
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar3 + -8);
    }
    FUN_14034edd0(uVar5);
  }
  if (*(longlong *)(*(longlong *)(lVar2 + 0x108) + 0x1580) != 0) {
    plVar4 = *(longlong **)(*(longlong *)(lVar2 + 0x108) + 0x1580);
    (**(code **)(*plVar4 + 0x20))(plVar4,*(undefined8 *)(param_2 + 0x1f0));
  }
  FUN_1403ce3b0(lVar2,4);
  return &DAT_1403d223c;
}



void Unwind_1404254d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_1404254e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1d0);
  return;
}



void Unwind_1404254f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x28);
  return;
}



void Unwind_140425500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1c0);
  return;
}



void Unwind_140425510(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x100);
  return;
}



void Unwind_140425520(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x128);
  return;
}



undefined * Catch_140425530(undefined8 param_1,longlong param_2)

{
  int *piVar1;
  longlong lVar2;
  undefined *puVar3;
  longlong *plVar4;
  undefined8 uVar5;
  
  FUN_14034fe70();
  *(undefined **)(param_2 + 0xf0) = PTR_DAT_1405d8010;
  lVar2 = *(longlong *)(param_2 + 0x28);
  FUN_1403c3c70(*(undefined8 *)(lVar2 + 0x108),5,3,param_2 + 0xf0);
  puVar3 = *(undefined **)(param_2 + 0xf0);
  if (((puVar3 != (undefined *)0x0) && (puVar3 != PTR_DAT_1405d8010)) &&
     (puVar3 + -8 != (undefined *)0x0)) {
    uVar5 = FUN_14034fe70();
    *(undefined8 *)(param_2 + 0x1f8) = uVar5;
    FUN_14034ed40(uVar5);
    *(undefined1 *)(param_2 + 0x200) = 1;
    piVar1 = (int *)(puVar3 + -4);
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_14034ff60(puVar3 + -8);
    }
    FUN_14034edd0(uVar5);
  }
  if (*(longlong *)(*(longlong *)(lVar2 + 0x108) + 0x1580) != 0) {
    plVar4 = *(longlong **)(*(longlong *)(lVar2 + 0x108) + 0x1580);
    (**(code **)(*plVar4 + 0x20))(plVar4,*(undefined8 *)(param_2 + 0x1e0));
  }
  FUN_1403ce3b0(lVar2,4);
  return &DAT_1403d21fc;
}



void Unwind_140425610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_140425620(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1f8);
  return;
}



void Unwind_140425630(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_140425640(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x30);
  return;
}



void Unwind_140425650(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x210);
  return;
}



void Unwind_140425660(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xf8) + 8);
  return;
}



void Unwind_140425670(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x20);
  return;
}



void Unwind_140425680(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x20);
  return;
}



void Unwind_140425690(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd30);
  return;
}



void Unwind_1404256b0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xb0);
  return;
}



void Unwind_1404256c0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd30);
  return;
}



void Unwind_1404256e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_1404256f0(undefined8 param_1,longlong param_2)

{
  FUN_14038d7d0(param_2 + 0x30);
  return;
}



void Unwind_140425700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_140425710(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_140425720(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_140425730(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xb8);
  return;
}



void Unwind_140425740(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_140425750(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x38);
  return;
}



void Unwind_140425760(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x60);
  return;
}



void Unwind_140425770(undefined8 param_1,longlong param_2)

{
  FUN_14036dec0(param_2 + 0x58);
  return;
}



void Unwind_140425780(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x130);
  return;
}



void Unwind_140425790(undefined8 param_1,longlong param_2)

{
  FUN_14038d7d0(param_2 + 0x90);
  return;
}



void Unwind_1404257a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1404257b0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xe8);
  return;
}



void Unwind_1404257c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1404257d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x60);
  return;
}



void Unwind_1404257e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_1404257f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_140425800(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x80);
  return;
}



void Unwind_140425810(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x170) + 8);
  return;
}



void Unwind_140425820(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x38);
  return;
}



void Unwind_140425830(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x48);
  return;
}



void Unwind_140425840(undefined8 param_1,longlong param_2)

{
  FUN_14036dec0(param_2 + 0x40);
  return;
}



void Unwind_140425850(undefined8 param_1,longlong param_2)

{
  FUN_14038d7d0(param_2 + 0xa8);
  return;
}



void Unwind_140425860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_140425870(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xd8);
  return;
}



void Unwind_140425880(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_140425890(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x48);
  return;
}



void Unwind_1404258a0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x118) + 8);
  return;
}



void Unwind_1404258b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x170) + 8);
  return;
}



void Unwind_1404258c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_1404258d0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_1404258e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404258f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_140425900(undefined8 param_1,longlong param_2)

{
  FUN_14035c4c0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140425910(undefined8 param_1,longlong param_2)

{
  FUN_1403ce2f0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140425920(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140425930(undefined8 param_1,longlong param_2)

{
  FUN_140364100(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_140425940(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140425960(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x1c8);
  return;
}



void Unwind_140425980(undefined8 param_1,longlong param_2)

{
  FUN_140359460(*(longlong *)(param_2 + 0x40) + 0x208);
  return;
}



void Unwind_1404259a0(undefined8 param_1,longlong param_2)

{
  FUN_1403b9c60(*(longlong *)(param_2 + 0x40) + 0x228);
  return;
}



void Unwind_1404259c0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0x40) + 0x290);
  return;
}



void Unwind_1404259e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403ceba0(*(longlong *)(param_2 + 0x40) + 0x298);
  return;
}



void Unwind_140425a00(undefined8 param_1,longlong param_2)

{
  FUN_1403ceab0(*(longlong *)(param_2 + 0x40) + 0x2b0);
  return;
}



void Unwind_140425a20(undefined8 param_1,longlong param_2)

{
  FUN_1403ced40(*(longlong *)(param_2 + 0x40) + 0x2b8);
  return;
}



void Unwind_140425a40(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_140425a50(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_140425a60(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x20);
  return;
}



void Unwind_140425a70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x150),0x60);
  return;
}



void Unwind_140425a90(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x160),*(undefined8 *)(param_2 + 0x150));
  return;
}



void Unwind_140425ac0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x150);
  return;
}



void Unwind_140425ad0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_140425ae0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_140425af0(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_140425b00(undefined8 param_1,longlong param_2)

{
  FUN_140376ab0(param_2 + 0x40);
  return;
}



void Unwind_140425b10(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x48);
  return;
}



void Unwind_140425b20(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x70);
  return;
}



void Unwind_140425b30(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x98);
  return;
}



void Unwind_140425b40(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x150) + 8);
  return;
}



void Unwind_140425b50(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x40);
  return;
}



void Unwind_140425b60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_140425b70(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0xa0);
  return;
}



void Unwind_140425b80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_140425b90(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x48);
  return;
}



void Unwind_140425ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_140425bb0(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x160);
  return;
}



void Unwind_140425bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_140425bd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140425be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140425bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140425c00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x120);
  return;
}



void Unwind_140425c10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140425c20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_140425c30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_140425c40(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(param_2 + 0x48);
  return;
}



void Unwind_140425c50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_140425c60(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x28);
  return;
}



void Unwind_140425c70(undefined8 param_1,longlong param_2)

{
  FUN_140376a30(param_2 + 0x38);
  return;
}



void Unwind_140425c80(undefined8 param_1,longlong param_2)

{
  FUN_140376ec0(param_2 + 0x20);
  return;
}



void Unwind_140425c90(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x20);
  return;
}



void Unwind_140425ca0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x90);
  return;
}



void Unwind_140425cb0(undefined8 param_1,longlong param_2)

{
  FUN_1403a5f20(param_2 + 0x88);
  return;
}



void Unwind_140425cc0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x90);
  return;
}



void Unwind_140425cd0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x1e0) + 8);
  return;
}



void Unwind_140425ce0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140425cf0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x1e0) + 8);
  return;
}



void Unwind_140425d00(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x20);
  return;
}



void Unwind_140425d10(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x90);
  return;
}



void Unwind_140425d20(undefined8 param_1,longlong param_2)

{
  FUN_1403a5f20(param_2 + 0x88);
  return;
}



void Unwind_140425d30(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x90);
  return;
}



void Unwind_140425d40(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x238) + 8);
  return;
}



void Unwind_140425d50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140425d60(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x238) + 8);
  return;
}



void Unwind_140425d70(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x50);
  return;
}



void Unwind_140425d80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xd0) + 8);
  return;
}



void Unwind_140425d90(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x50);
  return;
}



void Unwind_140425da0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xd0) + 8);
  return;
}



void Unwind_140425db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_140425dc0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x50);
  return;
}



void Unwind_140425dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140425de0(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x30);
  return;
}



void Unwind_140425df0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xb0) + 8);
  return;
}



void Unwind_140425e00(undefined8 param_1,longlong param_2)

{
  FUN_14038a5d0(param_2 + 0x40);
  return;
}



void Unwind_140425e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x138);
  return;
}



void Unwind_140425e20(undefined8 param_1,longlong param_2)

{
  FUN_14038d7d0(param_2 + 0x58);
  return;
}



void Unwind_140425e30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_140425e40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140425e50(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0x20);
  return;
}



void Unwind_140425e60(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x80);
  return;
}



void Unwind_140425e70(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_140425e80(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0xe8),*(undefined8 *)(param_2 + 0xe0));
  return;
}



void Unwind_140425eb0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_140425ec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_140425ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140425ee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_140425ef0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140425f00(undefined8 param_1,longlong param_2)

{
  FUN_14038d7d0(param_2 + 0x58);
  return;
}



void Unwind_140425f10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_140425f20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



undefined * Catch_140425f30(undefined8 param_1,longlong param_2)

{
  LPCSTR lpOutputString;
  
  lpOutputString = (LPCSTR)(**(code **)(**(longlong **)(param_2 + 0x38) + 8))();
  OutputDebugStringA(lpOutputString);
  uRam0000000000000000 = 1;
  return &DAT_1403d69b2;
}



void Unwind_140425f70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



undefined * Catch_140425f80(undefined8 param_1,longlong param_2)

{
  LPCSTR lpOutputString;
  
  lpOutputString = (LPCSTR)(**(code **)(**(longlong **)(param_2 + 0x38) + 8))();
  OutputDebugStringA(lpOutputString);
  uRam0000000000000000 = 1;
  return &DAT_1403d6b0f;
}



void Unwind_140425fc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140425fd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140425fe0(undefined8 param_1,longlong param_2)

{
  FUN_1403ada20(param_2 + 0x60);
  return;
}



void Unwind_140425ff0(undefined8 param_1,longlong param_2)

{
  FUN_14035c4c0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140426000(undefined8 param_1,longlong param_2)

{
  FUN_1403ce2f0(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void Unwind_140426010(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 0x10);
  return;
}



void Unwind_140426020(undefined8 param_1,longlong param_2)

{
  FUN_140364100(*(longlong *)(param_2 + 0x70) + 0x78);
  return;
}



void Unwind_140426030(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 0x88);
  return;
}



void Unwind_140426050(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 0x1c8);
  return;
}



void Unwind_140426070(undefined8 param_1,longlong param_2)

{
  FUN_140359460(*(longlong *)(param_2 + 0x70) + 0x208);
  return;
}



void Unwind_140426090(undefined8 param_1,longlong param_2)

{
  FUN_1403b9c60(*(longlong *)(param_2 + 0x70) + 0x228);
  return;
}



void Unwind_1404260b0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0x70) + 0x290);
  return;
}



void Unwind_1404260d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403ceba0(*(longlong *)(param_2 + 0x70) + 0x298);
  return;
}



void Unwind_1404260f0(undefined8 param_1,longlong param_2)

{
  FUN_1403ceab0(*(longlong *)(param_2 + 0x70) + 0x2b0);
  return;
}



void Unwind_140426110(undefined8 param_1,longlong param_2)

{
  FUN_1403ced40(*(longlong *)(param_2 + 0x70) + 0x2b8);
  return;
}



void Unwind_140426130(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_140426140(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_140426150(undefined8 param_1,longlong param_2)

{
  FUN_140364100(param_2 + 0x78);
  return;
}



void Unwind_140426160(undefined8 param_1,longlong param_2)

{
  FUN_140351260(param_2 + 0x38);
  return;
}



void Unwind_140426170(undefined8 param_1,longlong param_2)

{
  FUN_140351260(param_2 + 0x28);
  return;
}



void Unwind_140426180(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x50);
  return;
}



undefined * Catch_All_140426190(undefined8 param_1,longlong param_2)

{
  *(undefined4 *)(param_2 + 0x30) = 0;
  return &DAT_1403d812d;
}



void Unwind_1404261c0(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0x28);
  return;
}



void Unwind_1404261d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404261e0(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_140426210(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x78),
                *(longlong *)(param_2 + 0x60) + (longlong)*(int *)(param_2 + 0x70) * 8);
  return;
}



void Unwind_140426240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140426250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x30);
  return;
}



void Unwind_140426260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x38);
  return;
}



void Unwind_140426270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140426280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140426290(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404262a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404262b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404262c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404262d0(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404262e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1404262f0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x40) + 0x2480);
  return;
}



void Unwind_140426310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x40) + 0x2488);
  return;
}



void Unwind_140426330(undefined8 param_1,longlong param_2)

{
  FUN_1403d7c80(*(longlong *)(param_2 + 0x40) + 0x2510);
  return;
}



void Unwind_140426350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140426360(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140426370(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140426380(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140426390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x20);
  return;
}



void Unwind_1404263a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(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_1404263b0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x88) & 1) != 0) {
    *(uint *)(param_2 + 0x88) = *(uint *)(param_2 + 0x88) & 0xfffffffe;
    thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x78));
  }
  return;
}



void Unwind_1404263e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404263f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140426400(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140426410(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140426420(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140426430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140426440(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140426450(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x80),
                *(longlong *)(param_2 + 0x78) + (longlong)*(int *)(param_2 + 0x70) * 8);
  return;
}



void Unwind_140426480(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x98),
                *(longlong *)(param_2 + 0x90) + (longlong)*(int *)(param_2 + 0x88) * 8);
  return;
}



void Unwind_1404264b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0xb0),
                *(longlong *)(param_2 + 0xa8) + (longlong)*(int *)(param_2 + 0xa0) * 8);
  return;
}



void Unwind_1404264e0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x58);
  return;
}



void Unwind_1404264f0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x48);
  return;
}



void Unwind_140426500(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_140426520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_140426530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x68),0x400);
  return;
}



void Unwind_140426550(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x68);
  return;
}



void Unwind_140426560(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x70);
  return;
}



void Unwind_140426570(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x78);
  return;
}



void Unwind_140426580(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x20);
  return;
}



void Unwind_140426590(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x78);
  return;
}



undefined8 Catch_All_1404265a0(void)

{
  return 0x1403daaf3;
}



void Unwind_1404265c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404265d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1404265e0(undefined8 param_1,longlong param_2)

{
  FUN_1401282f0(param_2 + 0x20);
  return;
}



void Unwind_1404265f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x48);
  return;
}



void Unwind_140426600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140426610(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_140426620(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140426630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(*(longlong *)(param_2 + 0x88) + 8);
  return;
}



void Unwind_140426640(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0xf0);
  return;
}



void Unwind_140426650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



undefined8 Catch_All_140426660(void)

{
  return 0x1403db263;
}



void Unwind_140426680(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140426690(undefined8 param_1,longlong param_2)

{
  FUN_1403db250(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1404266a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403daae0(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_1404266c0(undefined8 param_1,longlong param_2)

{
  FUN_1403d9e10(*(longlong *)(param_2 + 0x40) + 0x100);
  return;
}



void Unwind_1404266e0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x50) + 0x10);
  return;
}



void Unwind_1404266f0(undefined8 param_1,longlong param_2)

{
  FUN_1403db250(*(longlong *)(param_2 + 0x50) + 0x50);
  return;
}



void Unwind_140426700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1403daae0(*(longlong *)(param_2 + 0x50) + 0xa8);
  return;
}



void Unwind_140426720(undefined8 param_1,longlong param_2)

{
  FUN_1403d9e10(*(longlong *)(param_2 + 0x50) + 0x100);
  return;
}



void Unwind_140426740(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140426750(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x70);
  return;
}



void Unwind_140426760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x20);
  return;
}



void Unwind_140426770(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140426780(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_140426790(undefined8 param_1,longlong param_2)

{
  FUN_1403848f0(param_2 + 0x108);
  return;
}



void Unwind_1404267a0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x30));
  return;
}



void Unwind_1404267b0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x30);
  return;
}



void Unwind_1404267c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1404267d0(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x130);
  return;
}



void Unwind_1404267e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1404267f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x28);
  return;
}



void Unwind_140426800(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_140426810(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_140426820(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_140426830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x60),0x400);
  return;
}



void Unwind_140426850(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x58);
  return;
}



void Unwind_140426860(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x230);
  return;
}



void Unwind_140426870(undefined8 param_1,longlong param_2)

{
  FUN_140392e30(param_2 + 0x1a0);
  return;
}



void Unwind_140426880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x60);
  return;
}



void Unwind_140426890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x48);
  return;
}



void Unwind_1404268a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x38);
  return;
}



void Unwind_1404268b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x68);
  return;
}



void Unwind_1404268c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x40);
  return;
}



void Unwind_1404268d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x80);
  return;
}



void Unwind_1404268e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x78);
  return;
}



void Unwind_1404268f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x70);
  return;
}



void Unwind_140426900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_140426910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 400);
  return;
}



void Unwind_140426920(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x108);
  return;
}



void Unwind_140426930(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_140426940(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf8);
  return;
}



void Unwind_140426950(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x180);
  return;
}



void Unwind_140426960(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x138);
  return;
}



void Unwind_140426970(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x148);
  return;
}



void Unwind_140426980(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_140426990(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x2c0);
  return;
}



void Unwind_1404269a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_1404269b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_1404269c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



void Unwind_1404269d0(undefined8 param_1,longlong param_2)

{
  FUN_14039bb80(param_2 + 0x30);
  return;
}



void Unwind_1404269e0(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404269f0(undefined8 param_1,longlong param_2)

{
  FUN_140354d80(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_140426a00(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x40) + 0x128);
  return;
}



void Unwind_140426a20(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d90(*(longlong *)(param_2 + 0x40) + 0x130);
  return;
}



void Unwind_140426a40(undefined8 param_1,longlong param_2)

{
  FUN_1403a3340(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_140426a60(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140426a70(undefined8 param_1,longlong param_2)

{
  FUN_140354d80(*(longlong *)(param_2 + 0x60) + 0x40);
  return;
}



void Unwind_140426a80(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x60) + 0x128);
  return;
}



void Unwind_140426aa0(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d90(*(longlong *)(param_2 + 0x60) + 0x130);
  return;
}



void Unwind_140426ac0(undefined8 param_1,longlong param_2)

{
  FUN_1403a3340(*(longlong *)(param_2 + 0x60) + 0x170);
  return;
}



void Unwind_140426ae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x68),0x400);
  return;
}



void Unwind_140426b00(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x68);
  return;
}



void Unwind_140426b10(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa00(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140426b20(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x30);
  return;
}



void Unwind_140426b30(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x30);
  return;
}



void Unwind_140426b40(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x70);
  return;
}



void Unwind_140426b50(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xd00);
  return;
}



void Unwind_140426b60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_140426b70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140426b80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_140426b90(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x80);
  return;
}



void Unwind_140426ba0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x80);
  return;
}



void Unwind_140426bb0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe0) + 8);
  return;
}



void Unwind_140426bc0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x50);
  return;
}



void Unwind_140426bd0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x50);
  return;
}



void Unwind_140426be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140426bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140426c00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_140426c10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_140426c20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_140426c30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_140426c40(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x100) + 8);
  return;
}



void Unwind_140426c50(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x78);
  return;
}



void Unwind_140426c60(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x78);
  return;
}



void Unwind_140426c70(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_140426c80(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x50);
  return;
}



void Unwind_140426c90(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x50);
  return;
}



void Unwind_140426ca0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x120) + 8);
  return;
}



void Unwind_140426cb0(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x1a0);
  return;
}



void Unwind_140426cc0(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x4d0);
  return;
}



void Unwind_140426cd0(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x2b0);
  return;
}



void Unwind_140426ce0(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0x3c0);
  return;
}



void Unwind_140426cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140426d00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_140426d10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_140426d20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x130);
  return;
}



void Unwind_140426d30(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0x98);
  return;
}



void Unwind_140426d40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_140426d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_140426d60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140426d70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_140426d80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_140426d90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_140426da0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_140426db0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_140426dc0(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0x40);
  return;
}



void Unwind_140426dd0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_140426de0(undefined8 param_1,longlong param_2)

{
  FUN_1403aad10(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140426df0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140426e00(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0x40);
  return;
}



void Unwind_140426e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140426e20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_140426e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140426e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140426e50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x188);
  return;
}



void Unwind_140426e60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_140426e70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140426e80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_140426e90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140426ea0(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0xa0);
  return;
}



void Unwind_140426eb0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x80);
  return;
}



void Unwind_140426ec0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_140426ed0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x70);
  return;
}



void Unwind_140426ee0(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(param_2 + 0xf8);
  return;
}



void Unwind_140426ef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_140426f00(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x68);
  return;
}



void Unwind_140426f10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140426f20(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x88);
  return;
}



void Unwind_140426f30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_140426f40(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x70);
  return;
}



void Unwind_140426f50(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(param_2 + 0x20);
  return;
}



void Unwind_140426f60(undefined8 param_1,longlong param_2)

{
  FUN_14035fc50(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140426f70(undefined8 param_1,longlong param_2)

{
  FUN_1403e1500(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_140426f80(undefined8 param_1,longlong param_2)

{
  FUN_1403e1530(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140426f90(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_140426fa0(undefined8 param_1,longlong param_2)

{
  FUN_1403e1500(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_140426fb0(undefined8 param_1,longlong param_2)

{
  FUN_1403ddeb0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140426fc0(undefined8 param_1,longlong param_2)

{
  FUN_1403aa980(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140426fd0(undefined8 param_1,longlong param_2)

{
  FUN_1403aa9c0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140426fe0(undefined8 param_1,longlong param_2)

{
  FUN_1403a05c0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140426ff0(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140427000(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_140427010(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_140427030(undefined8 param_1,longlong param_2)

{
  FUN_1403bf7a0(*(longlong *)(param_2 + 0x40) + 0x5b0);
  return;
}



void Unwind_140427050(undefined8 param_1,longlong param_2)

{
  FUN_1403ddeb0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140427060(undefined8 param_1,longlong param_2)

{
  FUN_1403aa980(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140427070(undefined8 param_1,longlong param_2)

{
  FUN_1403aa9c0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140427080(undefined8 param_1,longlong param_2)

{
  FUN_1403a05c0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140427090(undefined8 param_1,longlong param_2)

{
  FUN_1403d81f0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1404270a0(undefined8 param_1,longlong param_2)

{
  FUN_1403b7f70(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1404270b0(undefined8 param_1,longlong param_2)

{
  FUN_14035c600(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_1404270d0(undefined8 param_1,longlong param_2)

{
  FUN_1403bf7a0(*(longlong *)(param_2 + 0x40) + 0x5b0);
  return;
}



void Unwind_1404270f0(undefined8 param_1,longlong param_2)

{
  FUN_1403e16a0(*(longlong *)(param_2 + 0x40) + 0x638);
  return;
}



void Unwind_140427110(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x180);
  return;
}



void Unwind_140427120(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xd0);
  return;
}



void Unwind_140427130(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xd0);
  return;
}



void Unwind_140427140(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140427150(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xe00);
  return;
}



void Unwind_140427170(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xa0);
  return;
}



void Unwind_140427180(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xd20);
  return;
}



void Unwind_1404271a0(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1404271b0(undefined8 param_1,longlong param_2)

{
  FUN_140354d80(*(longlong *)(param_2 + 0x60) + 0x40);
  return;
}



void Unwind_1404271c0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x60) + 0x100);
  return;
}



void Unwind_1404271e0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0960(*(longlong *)(param_2 + 0x60) + 0x108);
  return;
}



void Unwind_140427200(undefined8 param_1,longlong param_2)

{
  FUN_1403a0990(*(longlong *)(param_2 + 0x60) + 0x110);
  return;
}



void Unwind_140427220(undefined8 param_1,longlong param_2)

{
  FUN_1403a0a20(*(longlong *)(param_2 + 0x60) + 0x188);
  return;
}



void Unwind_140427240(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_140427250(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_140427260(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140427270(undefined8 param_1,longlong param_2)

{
  FUN_140354d80(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_140427280(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x40) + 0x100);
  return;
}



void Unwind_1404272a0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0960(*(longlong *)(param_2 + 0x40) + 0x108);
  return;
}



void Unwind_1404272c0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0990(*(longlong *)(param_2 + 0x40) + 0x110);
  return;
}



void Unwind_1404272e0(undefined8 param_1,longlong param_2)

{
  FUN_1403a0a20(*(longlong *)(param_2 + 0x40) + 0x188);
  return;
}



void Unwind_140427300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x70),0x400);
  return;
}



void Unwind_140427320(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x70);
  return;
}



void Unwind_140427330(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x80);
  return;
}



void Unwind_140427340(undefined8 param_1,longlong param_2)

{
  FUN_1403e1530(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140427350(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x150);
  return;
}



void Unwind_140427360(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xa0);
  return;
}



void Unwind_140427370(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xa0);
  return;
}



void Unwind_140427380(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(param_2 + 0x20);
  return;
}



void Unwind_140427390(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_1404273a0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0xdd0);
  return;
}



void Unwind_1404273c0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xeb0);
  return;
}



void Unwind_1404273d0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_1404273e0(undefined8 param_1,longlong param_2)

{
  FUN_140360960(param_2 + 0x40);
  return;
}



void Unwind_1404273f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140427400(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1b30);
  return;
}



void Unwind_140427420(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0xe00);
  return;
}



void Unwind_140427430(undefined8 param_1,longlong param_2)

{
  FUN_140385bb0(param_2 + 0xe00);
  return;
}



void Unwind_140427440(undefined8 param_1,longlong param_2)

{
  FUN_140383be0(param_2 + 0x68);
  return;
}



void Unwind_140427450(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0x1b40);
  return;
}



void Unwind_140427460(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1b30);
  return;
}



void Unwind_140427480(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(param_2 + 0xeb0);
  return;
}



void Unwind_140427490(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x1b30);
  return;
}



void Unwind_1404274b0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(*(longlong *)(param_2 + 0x30) + 0xc80);
  return;
}



void Unwind_1404274d0(undefined8 param_1,longlong param_2)

{
  FUN_1403606a0(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_1404274e0(undefined8 param_1,longlong param_2)

{
  FUN_14035ff70(param_2 + 0x27c0);
  return;
}



void Unwind_140427500(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140427510(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_140427520(undefined8 param_1,longlong param_2)

{
  FUN_14036dec0(param_2 + 0x30);
  return;
}



void Unwind_140427530(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_140427540(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_140427550(undefined8 param_1,longlong param_2)

{
  FUN_14036daa0(param_2 + 0x68);
  return;
}



void Unwind_140427560(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_140427570(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_140427580(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_140427590(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1404275a0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_1404275b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1404275c0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_1404275d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_1404275e0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_1404275f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_140427600(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_140427610(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x110) + 8);
  return;
}



void Unwind_140427620(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_140427630(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_140427640(undefined8 param_1,longlong param_2)

{
  FUN_1403dfb80(param_2 + 0x30);
  return;
}



void Unwind_140427650(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x38);
  return;
}



void Unwind_140427660(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_140427670(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d90(*(longlong *)(param_2 + 0x50) + 0x30);
  return;
}



void Unwind_140427680(undefined8 param_1,longlong param_2)

{
  FUN_1403e1500(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_140427690(undefined8 param_1,longlong param_2)

{
  FUN_1403e1500(*(longlong *)(param_2 + 0x50) + 0x70);
  return;
}



void Unwind_1404276a0(undefined8 param_1,longlong param_2)

{
  FUN_1403e1500(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1404276b0(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1404276c0(undefined8 param_1,longlong param_2)

{
  FUN_14035c4c0(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_1404276d0(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(longlong *)(param_2 + 0x80) + 0x10);
  return;
}



void Unwind_1404276e0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x80) + 0x18);
  return;
}



void Unwind_1404276f0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x80) + 0x20);
  return;
}



void Unwind_140427700(undefined8 param_1,longlong param_2)

{
  FUN_14035de80(*(longlong *)(param_2 + 0x80) + 0x308);
  return;
}



void Unwind_140427720(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x80) + 0x310);
  return;
}



void Unwind_140427740(undefined8 param_1,longlong param_2)

{
  FUN_140364100(*(longlong *)(param_2 + 0x80) + 0x348);
  return;
}



void Unwind_140427760(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_140427770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x88),0x400);
  return;
}



void Unwind_140427790(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x88);
  return;
}



void Unwind_1404277a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14034ff60(*(undefined8 *)(param_2 + 0x90),0x400);
  return;
}



void Unwind_1404277c0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x90);
  return;
}



void Unwind_1404277d0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_1404277e0(undefined8 param_1,longlong param_2)

{
  FUN_140364100(param_2 + 0x98);
  return;
}



void Unwind_1404277f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140427800(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x50);
  return;
}



void Unwind_140427810(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x58);
  return;
}



void Unwind_140427820(undefined8 param_1,longlong param_2)

{
  FUN_1403aaa40(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140427830(undefined8 param_1,longlong param_2)

{
  FUN_14035c4c0(*(longlong *)(param_2 + 0x60) + 8);
  return;
}



void Unwind_140427840(undefined8 param_1,longlong param_2)

{
  FUN_14035c480(*(longlong *)(param_2 + 0x60) + 0x10);
  return;
}



void Unwind_140427850(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x60) + 0x18);
  return;
}



void Unwind_140427860(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(*(longlong *)(param_2 + 0x60) + 0x20);
  return;
}



void Unwind_140427870(undefined8 param_1,longlong param_2)

{
  FUN_14035de80(*(longlong *)(param_2 + 0x60) + 0x308);
  return;
}



void Unwind_140427890(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x60) + 0x310);
  return;
}



void Unwind_1404278b0(undefined8 param_1,longlong param_2)

{
  FUN_140364100(*(longlong *)(param_2 + 0x60) + 0x348);
  return;
}



void Unwind_1404278d0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x68);
  return;
}



void Unwind_1404278e0(undefined8 param_1,longlong param_2)

{
  FUN_140351b30(param_2 + 0x70);
  return;
}



void Unwind_1404278f0(undefined8 param_1,longlong param_2)

{
  FUN_14035fc50(param_2 + 0x28);
  return;
}



void Unwind_140427900(undefined8 param_1,longlong param_2)

{
  FUN_14035fc50(param_2 + 0x28);
  return;
}



void Unwind_140427910(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140427917. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12((_Container_base12 *)(param_2 + 0x20));
  return;
}



void Unwind_140427920(undefined8 param_1,longlong param_2)

{
  FUN_14036dd80(param_2 + 0x20);
  return;
}



void Unwind_140427930(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140427937. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12((_Container_base12 *)(param_2 + 0x20));
  return;
}



void Unwind_140427940(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x40);
  return;
}



void Unwind_140427950(undefined8 param_1,longlong param_2)

{
  FUN_14036dec0(param_2 + 0x38);
  return;
}



void Unwind_140427960(undefined8 param_1,longlong param_2)

{
  FUN_14036daa0(param_2 + 0x28);
  return;
}



void Unwind_140427970(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x40);
  return;
}



void Unwind_140427980(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xa0) + 8);
  return;
}



void Unwind_140427990(undefined8 param_1,longlong param_2)

{
  FUN_14035fc50(*(longlong *)(param_2 + 0x90) + 0x18);
  return;
}



void Unwind_1404279a0(undefined8 param_1,longlong param_2)

{
  FUN_1403e1500(*(undefined8 *)(param_2 + 0xa8));
  return;
}



void Unwind_1404279b0(undefined8 param_1,longlong param_2)

{
  FUN_1403e1500(*(longlong *)(param_2 + 0x90) + 0x40);
  return;
}



void Unwind_1404279c0(undefined8 param_1,longlong param_2)

{
  FUN_1403a9d90(*(longlong *)(param_2 + 0x90) + 0x60);
  return;
}



void Unwind_1404279d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x30);
  return;
}



void Unwind_1404279e0(undefined8 param_1,longlong param_2)

{
  FUN_14036dec0(param_2 + 0x28);
  return;
}



void Unwind_1404279f0(undefined8 param_1,longlong param_2)

{
  FUN_1403dfb80(param_2 + 0x28);
  return;
}



void Unwind_140427a00(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x30);
  return;
}



void Unwind_140427a10(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void Unwind_140427a20(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x30);
  return;
}



void Unwind_140427a30(undefined8 param_1,longlong param_2)

{
  FUN_14036dec0(param_2 + 0x28);
  return;
}



void Unwind_140427a40(undefined8 param_1,longlong param_2)

{
  FUN_1403dfb80(param_2 + 0x28);
  return;
}



void Unwind_140427a50(undefined8 param_1,longlong param_2)

{
  FUN_140017d80(param_2 + 0x30);
  return;
}



void Unwind_140427a60(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x70) + 8);
  return;
}



void FUN_140427a70(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 FUN_140427a9c(undefined8 param_1,longlong param_2)

{
  if (*(int *)(param_2 + 0x20) == 0) {
    __ArrayUnwind(*(void **)(param_2 + 0x60),*(__uint64 *)(param_2 + 0x70),*(int *)(param_2 + 0x24),
                  *(_func_void_void_ptr **)(param_2 + 0x88));
  }
  return;
}



undefined * Catch_All_140427acb(undefined8 param_1,longlong param_2)

{
  *(undefined8 *)(param_2 + 0x50) = 0;
  return &DAT_1403fbcf1;
}



void Unwind_140427aeb(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140427af2. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Lockit::~_Lockit((_Lockit *)(param_2 + 0x48));
  return;
}



void Unwind_140427b00(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140427b07. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Lockit::~_Lockit((_Lockit *)(param_2 + 0x50));
  return;
}



void Unwind_140427b10(undefined8 param_1,longlong param_2)

{
  FUN_140313fc0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140427b20(undefined8 param_1,longlong param_2)

{
  FUN_140168620(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140427b30(undefined8 param_1,longlong param_2)

{
  FUN_14012cc50(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Catch_All_140427b40(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_140427b70(void)

{
  FUN_14034b680();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427ba0(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_140427bd0(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_140427c00(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_140427c30(void)

{
  FUN_14033b080();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427c80(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_140427cb0(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_140427ce0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140427d00(undefined8 param_1,longlong param_2)

{
  FUN_140313fc0(param_2 + 0x28);
  return;
}



void Unwind_140427d10(undefined8 param_1,longlong param_2)

{
  FUN_140313f70(param_2 + 0x28);
  return;
}



void Unwind_140427d20(undefined8 param_1,longlong param_2)

{
  FUN_140314100(param_2 + 0x98);
  return;
}



undefined * Catch_All_140427d30(undefined8 param_1,longlong param_2)

{
  std::basic_ios<>::setstate
            ((basic_ios<> *)
             ((longlong)*(int *)(**(longlong **)(param_2 + 0x80) + 4) +
             (longlong)*(longlong **)(param_2 + 0x80)),4,true);
  return &DAT_140313bb1;
}



void Unwind_140427d70(undefined8 param_1,longlong param_2)

{
  FUN_140313fc0(param_2 + 0x28);
  return;
}



void Catch_All_140427d80(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_140427db0(void)

{
  FUN_140311880();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427e00(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427e20(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_140427e50(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_140427e80(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427ea0(undefined8 param_1,longlong param_2)

{
  if (*(undefined8 **)(param_2 + 0x48) != (undefined8 *)0x0) {
    (**(code **)**(undefined8 **)(param_2 + 0x48))();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427ed0(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_140427f00(undefined8 param_1,longlong param_2)

{
  if (*(undefined8 **)(param_2 + 0x48) != (undefined8 *)0x0) {
    (**(code **)**(undefined8 **)(param_2 + 0x48))();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427f30(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427f50(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_140427f80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x78));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427fb0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140427fd0(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_140428000(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_140428030(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428050(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_140428080(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404280a0(undefined8 param_1,longlong param_2)

{
  if (*(undefined8 **)(param_2 + 0x48) != (undefined8 *)0x0) {
    (**(code **)**(undefined8 **)(param_2 + 0x48))();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404280d0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404280f0(undefined8 param_1,longlong param_2)

{
  if (*(void **)(param_2 + 0x48) != (void *)0x0) {
    operator_delete(*(void **)(param_2 + 0x48));
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428120(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_140428150(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428170(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428190(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_1404281c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404281e0(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_140428210(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140428240(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Catch_All_140428250(undefined8 param_1,longlong param_2)

{
  if (*(undefined8 **)(param_2 + 0x48) != (undefined8 *)0x0) {
    (**(code **)**(undefined8 **)(param_2 + 0x48))();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428280(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_1404282b0(undefined8 param_1,longlong param_2)

{
  if (*(undefined8 **)(param_2 + 0x48) != (undefined8 *)0x0) {
    (**(code **)**(undefined8 **)(param_2 + 0x48))();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404282e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x50));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140428310(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140428322. 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_140428330(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428350(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428370(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428390(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404283b0(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_1404283e0(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_140428410(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_140428440(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_140428470(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428490(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404284b0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404284d0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404284f0(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_140428520(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_140428550(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_140428580(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_1404285b0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404285d0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404285f0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428610(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428630(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_140428660(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_140428690(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_1404286c0(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_1404286f0(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_140428720(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_140428750(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 Catch_All_1404287a0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404287c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404287e0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428800(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428820(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428840(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428860(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428880(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404288a0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404288c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404288e0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428900(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428920(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428940(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428960(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428980(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404289a0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404289c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404289e0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428a00(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428a20(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428a40(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428a60(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428a80(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428aa0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428ac0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428ae0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428b00(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140428b20(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_140428b50(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_140428b80(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_140428bb0(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_140428be0(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_140428c10(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_140428c40(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_140428c70(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_140428ca0(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_140428cd0(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_140428d00(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_140428d30(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_140428d60(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_140428d90(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_140428dc0(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_140428df0(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_140428e20(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_140428e50(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_140428e80(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_140428eb0(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_140428ee0(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_140428f10(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_140428f40(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_140428f70(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_140428fa0(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_140428fd0(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_140429000(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_140429030(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140429071(undefined8 param_1,longlong param_2)

{
  FUN_140013c70(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140429091(undefined8 param_1,longlong param_2)

{
  FUN_140013ac0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404290a1(undefined8 param_1,longlong param_2)

{
  FUN_140013b40(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1404290b1(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_1404290c1(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_1404290e1(undefined8 param_1,longlong param_2)

{
  FUN_140013ac0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404290f1(undefined8 param_1,longlong param_2)

{
  FUN_140013b40(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140429101(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_140429111(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_140429131(undefined8 param_1,longlong param_2)

{
  FUN_140003350(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140429151(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140429161(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_140429171(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_140429181(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_140429191(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0xa0);
  return;
}



void Unwind_1404291b1(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_1404291d1(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0xf0);
  return;
}



void Unwind_1404291f1(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_140429211(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_140429231(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_140429251(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 400);
  return;
}



void Unwind_140429271(undefined8 param_1,longlong param_2)

{
  FUN_140003700(param_2 + 0xe0);
  return;
}



void Unwind_140429291(undefined8 param_1,longlong param_2)

{
  FUN_1400034f0(param_2 + 0x20);
  return;
}



void Unwind_1404292a1(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x20);
  return;
}



void Unwind_1404292b1(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x58);
  return;
}



void Unwind_1404292c1(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x20);
  return;
}



void Unwind_1404292d1(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x58);
  return;
}



void Unwind_1404292f1(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140429301(undefined8 param_1,longlong param_2)

{
  FUN_140003700(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_140429311(undefined8 param_1,longlong param_2)

{
  FUN_140003bb0(*(longlong *)(param_2 + 0x40) + 600);
  return;
}



void Unwind_140429331(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x278);
  return;
}



void Unwind_140429351(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140429371(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140429391(undefined8 param_1,longlong param_2)

{
  FUN_140003370(param_2 + 0x430);
  return;
}



void Unwind_1404293a1(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_1404293c1(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_1404293e1(undefined8 param_1,longlong param_2)

{
  FUN_140003370(param_2 + 0x28);
  return;
}



void Unwind_1404293f1(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140429411(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140429431(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_140429451(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x28);
  return;
}



void Unwind_140429461(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x48);
  return;
}



void Unwind_140429471(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_140429481(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x98);
  return;
}



void Unwind_1404294a1(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x28);
  return;
}



void Unwind_1404294b0(undefined8 param_1,longlong param_2)

{
  FUN_140013c70(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404294c0(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404294d0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1404294e0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x28);
  return;
}



void Catch_All_1404294f0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140429510(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140429540(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140429550(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_140429560(undefined8 param_1,longlong param_2)

{
  FUN_1400078b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140429570(undefined8 param_1,longlong param_2)

{
  FUN_140001ca0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140429580(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Catch_All_1404295a0(void)

{
  FUN_14034c280();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140429630(void)

{
  FUN_14033ea10();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140429650(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14033a4f0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140429690(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14034acf0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404296d0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14034a080(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_140429710(void)

{
  return &DAT_140331d59;
}



undefined * Catch_All_140429730(void)

{
  return &DAT_140331a49;
}



undefined * Catch_All_140429750(void)

{
  return &DAT_140331719;
}



void Catch_All_140429770(void)

{
  FUN_14032f040();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140429790(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14032a1b0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404297d0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_1404297f0(void)

{
  return &DAT_14031fa39;
}



undefined * Catch_All_140429810(void)

{
  return &DAT_14031f3f9;
}



void Catch_All_140429830(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 Catch_All_140429880(void)

{
  FUN_14031b7d0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_1404298c0(void)

{
  return &DAT_140319425;
}



undefined * Catch_All_1404298e0(void)

{
  return &DAT_1403180c9;
}



void Catch_All_140429900(void)

{
  FUN_1403118c0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_140429940(void)

{
  return &DAT_140306509;
}



void Catch_All_140429960(void)

{
  FUN_1402f4410();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_140429990(void)

{
  return &DAT_1402ea5a9;
}



void Unwind_1404299b0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_((void *)(*(longlong *)(param_2 + 0x40) + 8),0x28,5,FUN_14023be90);
  return;
}



void Unwind_1404299e0(undefined8 param_1,longlong param_2)

{
  FUN_1402ce3c0(param_2 + 0x28);
  return;
}



void Unwind_1404299f0(undefined8 param_1,longlong param_2)

{
  FUN_1402cdda0(param_2 + 0x28);
  return;
}



void Catch_All_140429a00(undefined8 param_1,longlong param_2)

{
  **(undefined8 **)(param_2 + 0x40) = 0;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140429a30(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(param_2 + 0x28);
  return;
}



void Unwind_140429a40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_140429a50(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_140429a70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xa0);
  return;
}



void Unwind_140429a90(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(*(longlong *)(param_2 + 0x40) + 0xc0);
  return;
}



void Unwind_140429ab0(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(*(longlong *)(param_2 + 0x40) + 0xe8);
  return;
}



undefined * Catch_All_140429ad0(void)

{
  return &DAT_1402c6db4;
}



void Catch_All_140429af0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_1402cbae0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140429b30(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_140429b40(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140429b50(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140429b60(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140429b70(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140429b80(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_140429bd0(undefined8 param_1,longlong param_2)

{
  FUN_14027dc20(param_2 + 0x28);
  return;
}



void Unwind_140429be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x28);
  return;
}



void Unwind_140429bf0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 400);
  return;
}



void Catch_All_140429c10(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14027de90(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140429c50(void)

{
  DAT_140609408 = DAT_140609408 & 0xfffffffe;
  return;
}



void Unwind_140429c70(void)

{
  FUN_140385b20(&DAT_1406093e8);
  return;
}



void Unwind_140429c80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140429c90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Catch_All_140429ca0(void)

{
  FUN_140215b50();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140429d20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x50);
  return;
}



void Unwind_140429d30(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x60);
  return;
}



void Unwind_140429d40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140429d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dee60(param_2 + 0x38);
  return;
}



void Unwind_140429d60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140429d70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_140429d80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140429d90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401defb0(param_2 + 0x38);
  return;
}



void Unwind_140429da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x58);
  return;
}



void Unwind_140429db0(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x68);
  return;
}



void Unwind_140429dc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_140429dd0(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x58);
  return;
}



void Unwind_140429de0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x70);
  return;
}



void Unwind_140429df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_140429e00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x58);
  return;
}



void Unwind_140429e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x38);
  return;
}



void Unwind_140429e20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140429e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x58);
  return;
}



void Unwind_140429e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_140429e50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140429e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_140429e70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140429e80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_140429e90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_140429ea0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140429ec0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_140429ee0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_140429f00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140429f10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x38);
  return;
}



void Unwind_140429f20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140429f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x50);
  return;
}



void Unwind_140429f40(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140429f47. Too many branches
                    // WARNING: Treating indirect jump as call
  std::_Container_base12::~_Container_base12(*(_Container_base12 **)(param_2 + 0x50));
  return;
}



void Unwind_140429f50(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x38);
  return;
}



void Unwind_140429f60(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140429f70(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140429f80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140429f90(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x38);
  return;
}



void Unwind_140429fa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140429fb0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x48);
  return;
}



void Unwind_140429fc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_140429fe0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_14042a000(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x120);
  return;
}



void Unwind_14042a020(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x148);
  return;
}



void Unwind_14042a040(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_14042a060(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_14042a080(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1c0);
  return;
}



void Unwind_14042a0a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1e8);
  return;
}



void Unwind_14042a0c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x210);
  return;
}



void Unwind_14042a0e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x238);
  return;
}



void Unwind_14042a100(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x260);
  return;
}



void Unwind_14042a120(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x288);
  return;
}



void Unwind_14042a140(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x2b0);
  return;
}



void Unwind_14042a160(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x2d8);
  return;
}



void Unwind_14042a180(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x300);
  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_14042a1a0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x328),0x28,4,FUN_14023be90);
  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_14042a1e0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x3c8),0x28,4,FUN_14023be90);
  return;
}



void Unwind_14042a220(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x468);
  return;
}



void Unwind_14042a240(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x490);
  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_14042a260(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x4b8),0x28,4,FUN_14023be90);
  return;
}



void Catch_All_14042a2a0(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_14042a2d0(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_14042a300(undefined8 param_1,longlong param_2)

{
  operator_delete__(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_14042a330(void)

{
  return &DAT_140159379;
}



undefined * Catch_All_14042a350(void)

{
  return &DAT_140158d19;
}



undefined * Catch_All_14042a370(void)

{
  return &DAT_1401586d9;
}



undefined * Catch_All_14042a390(void)

{
  return &DAT_140158109;
}



undefined * Catch_All_14042a3b0(void)

{
  return &DAT_140157ac9;
}



undefined * Catch_All_14042a3d0(void)

{
  return &DAT_1401574f9;
}



undefined * Catch_All_14042a3f0(void)

{
  return &DAT_140156509;
}



undefined * Catch_All_14042a410(void)

{
  return &DAT_140155b09;
}



undefined * Catch_All_14042a430(void)

{
  return &DAT_140155539;
}



undefined * Catch_All_14042a450(void)

{
  return &DAT_140154f19;
}



undefined * Catch_All_14042a470(void)

{
  return &DAT_1401548a9;
}



undefined * Catch_All_14042a490(void)

{
  return &DAT_140153e99;
}



undefined * Catch_All_14042a4b0(void)

{
  return &DAT_140153879;
}



undefined * Catch_All_14042a4d0(void)

{
  return &DAT_140152f39;
}



undefined * Catch_All_14042a4f0(void)

{
  return &DAT_140152879;
}



undefined * Catch_All_14042a510(void)

{
  return &DAT_14014f339;
}



undefined * Catch_All_14042a530(void)

{
  return &DAT_14014f009;
}



undefined * Catch_All_14042a550(void)

{
  return &DAT_14014ecf9;
}



undefined * Catch_All_14042a570(void)

{
  return &DAT_14014e849;
}



undefined * Catch_All_14042a590(void)

{
  return &DAT_14014cc99;
}



void Unwind_14042a5b0(undefined8 param_1,longlong param_2)

{
  FUN_14012d5c0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042a5c0(undefined8 param_1,longlong param_2)

{
  FUN_14027dc20(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14042a5d0(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_14042a600(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014042a60b. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_ostream<>::~basic_ostream<>((basic_ostream<> *)(*(longlong *)(param_2 + 0x40) + 8));
  return;
}



void Unwind_14042a620(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014042a627. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(*(basic_streambuf<> **)(param_2 + 0x28));
  return;
}



void Catch_All_14042a630(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x70));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042a660(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042a680(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_14042a6b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042a6e0(void)

{
  return 0x14000c883;
}



void Unwind_14042a700(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Unwind_14042a710(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042a720(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x50));
  return;
}



undefined * Catch_All_14042a730(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x78);
  *(longlong *)(param_2 + 0x78) = lVar1;
  uVar2 = FUN_1400042e0(lVar1 + 1);
  *(undefined8 *)(param_2 + 0x88) = uVar2;
  return &DAT_14000426c;
}



void Catch_All_14042a770(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_14042a7b0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  undefined8 uVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(param_2 + 0x68) = lVar1;
  uVar2 = FUN_140001ae0(lVar1 + 1);
  *(undefined8 *)(param_2 + 0x78) = uVar2;
  return &DAT_140001a71;
}



void Catch_All_14042a7e0(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 Unwind_14042a830(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_14042a840(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_14042a860(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_14042a880(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_14042a8a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_14042a8c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x120);
  return;
}



void Unwind_14042a8e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x148);
  return;
}



void Unwind_14042a900(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_14042a920(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_14042a940(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1c0);
  return;
}



void Unwind_14042a960(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1e8);
  return;
}



void Unwind_14042a980(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x210);
  return;
}



void Unwind_14042a9a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x58);
  return;
}



void Unwind_14042a9b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x80);
  return;
}



void Unwind_14042a9d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xa8);
  return;
}



void Unwind_14042a9f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xd0);
  return;
}



void Unwind_14042aa10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xf8);
  return;
}



void Unwind_14042aa30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x120);
  return;
}



void Unwind_14042aa50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x148);
  return;
}



void Unwind_14042aa70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x170);
  return;
}



void Unwind_14042aa90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x198);
  return;
}



void Unwind_14042aab0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1c0);
  return;
}



void Unwind_14042aad0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1e8);
  return;
}



void Unwind_14042aaf0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x210);
  return;
}



void Catch_All_14042ab10(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14034cab0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ab50(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14034d320(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ab90(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14033d3c0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042abd0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_140339be0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_14042ac10(void)

{
  return &DAT_140332855;
}



undefined * Catch_All_14042ac30(void)

{
  return &DAT_1403324f5;
}



undefined * Catch_All_14042ac50(void)

{
  return &DAT_140332125;
}



void Unwind_14042ac70(undefined8 param_1,longlong param_2)

{
  FUN_14032aa60(*(longlong *)(param_2 + 0x50) + 0x200);
  return;
}



undefined * Catch_All_14042ac90(void)

{
  return &DAT_140320032;
}



undefined * Catch_All_14042acb0(void)

{
  return &DAT_14031fba5;
}



undefined * Catch_All_14042acd0(void)

{
  return &DAT_14031f565;
}



undefined * Catch_All_14042acf0(void)

{
  return &DAT_140318235;
}



void Unwind_14042ad10(undefined8 param_1,longlong param_2)

{
  FUN_140308d90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042ad20(undefined8 param_1,longlong param_2)

{
  std::exception::~exception(*(exception **)(param_2 + 0x40));
  return;
}



undefined * Catch_All_14042ad30(void)

{
  return &DAT_1403119b3;
}



undefined * Catch_All_14042ad50(void)

{
  return &DAT_140311532;
}



void Catch_All_14042ad70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042ada0(undefined8 param_1,longlong param_2)

{
  FUN_14030d9d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042adb0(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_14042adc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



undefined * Catch_All_14042add0(void)

{
  return &DAT_140308835;
}



undefined * Catch_All_14042adf0(void)

{
  return &DAT_140306675;
}



undefined * Catch_All_14042ae10(void)

{
  return &DAT_140305f42;
}



undefined * Catch_All_14042ae30(void)

{
  return &DAT_1402fd482;
}



undefined * Catch_All_14042ae50(void)

{
  return &DAT_1402f4852;
}



undefined8 Catch_All_14042ae70(void)

{
  return 0x1402f4473;
}



void Catch_All_14042ae90(void)

{
  FUN_1402f43c0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined * Catch_All_14042aef0(void)

{
  return &DAT_1402ea202;
}



undefined * Catch_All_14042af10(void)

{
  return &DAT_1402e4922;
}



undefined * Catch_All_14042af30(void)

{
  return &DAT_1402e4152;
}



undefined * Catch_All_14042af50(void)

{
  return &DAT_1402e3e22;
}



undefined * Catch_All_14042af70(void)

{
  return &DAT_1402e3b02;
}



void Unwind_14042af90(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_((void *)(*(longlong *)(param_2 + 0x48) + 8),0x28,5,FUN_14023be90);
  return;
}



void Unwind_14042afc0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_((void *)(*(longlong *)(param_2 + 0x50) + 8),0x28,5,FUN_14023be90);
  return;
}



undefined * Catch_All_14042aff0(void)

{
  return &DAT_1402db2c2;
}



undefined * Catch_All_14042b010(void)

{
  return &DAT_1402daed2;
}



undefined * Catch_All_14042b030(void)

{
  return &DAT_1402daba2;
}



undefined * Catch_All_14042b050(void)

{
  return &DAT_1402da892;
}



void Catch_All_14042b070(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x80) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042b0a0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042b0c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_14042b0d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042b0e0(undefined8 param_1,longlong param_2)

{
  FUN_1402c86b0(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_14042b0f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x20);
  return;
}



void Unwind_14042b100(undefined8 param_1,longlong param_2)

{
  FUN_1402bf180(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042b110(undefined8 param_1,longlong param_2)

{
  FUN_1402bf4d0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_14042b120(undefined8 param_1,longlong param_2)

{
  FUN_1402bf180(param_2 + 0x70);
  return;
}



void Unwind_14042b130(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x68);
  return;
}



void Unwind_14042b140(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_14042b150(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_14042b160(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x38);
  return;
}



void Unwind_14042b170(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x60);
  return;
}



void Unwind_14042b180(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x88);
  return;
}



void Unwind_14042b1a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x118);
  return;
}



void Unwind_14042b1c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x140);
  return;
}



void Unwind_14042b1e0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Catch_All_14042b200(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042b230(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_14042b240(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_14042b250(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



undefined * Catch_All_14042b260(void)

{
  return &DAT_14025ec72;
}



undefined * Catch_All_14042b280(void)

{
  return &DAT_14025e932;
}



void Unwind_14042b2a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_14042b2b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x20);
  return;
}



void Unwind_14042b2c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_14042b2d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_14042b2e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



undefined * Catch_All_14042b2f0(void)

{
  return &DAT_140254072;
}



undefined * Catch_All_14042b310(void)

{
  return &DAT_1402481c2;
}



void Catch_All_14042b330(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x70));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042b360(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_14042b3b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042b3c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042b3d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x21420);
  return;
}



void Unwind_14042b3f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042b400(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



undefined * Catch_All_14042b410(void)

{
  return &DAT_14020e122;
}



void Unwind_14042b430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14042b440(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x20);
  return;
}



undefined * Catch_All_14042b450(void)

{
  return &DAT_1401e5f62;
}



undefined * Catch_All_14042b470(void)

{
  return &DAT_1401e5c42;
}



undefined * Catch_All_14042b490(void)

{
  return &DAT_1401e575f;
}



undefined * Catch_All_14042b4b0(void)

{
  return &DAT_1401dfbd2;
}



void Unwind_14042b4d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x20);
  return;
}



void Unwind_14042b4e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x38);
  return;
}



void Unwind_14042b4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xe0);
  return;
}



void Unwind_14042b500(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0xf0);
  return;
}



void Unwind_14042b510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x28);
  return;
}



void Unwind_14042b520(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Unwind_14042b530(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x40);
  return;
}



void Catch_All_14042b540(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  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_14042b570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_14042b580(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xe0);
  return;
}



void Unwind_14042b590(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x150);
  return;
}



void Unwind_14042b5a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x170);
  return;
}



void Unwind_14042b5b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x70);
  return;
}



void Unwind_14042b5c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xf0);
  return;
}



void Unwind_14042b5d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x100);
  return;
}



void Unwind_14042b5e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x50);
  return;
}



void Unwind_14042b5f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x160);
  return;
}



void Unwind_14042b600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_14042b610(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xe0);
  return;
}



void Unwind_14042b620(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x150);
  return;
}



void Unwind_14042b630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x170);
  return;
}



void Unwind_14042b640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_14042b650(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xf0);
  return;
}



void Unwind_14042b660(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x100);
  return;
}



void Unwind_14042b670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x50);
  return;
}



void Unwind_14042b680(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x160);
  return;
}



void Unwind_14042b690(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042b6a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042b6b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Catch_All_14042b6c0(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042b6e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14042b6f0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x48);
  return;
}



void Unwind_14042b700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



undefined * Catch_All_14042b710(void)

{
  return &DAT_1401670c2;
}



void Unwind_14042b730(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xd0);
  return;
}



void Unwind_14042b750(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xf8);
  return;
}



void Unwind_14042b770(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x120);
  return;
}



void Unwind_14042b790(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x148);
  return;
}



void Unwind_14042b7b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x170);
  return;
}



void Unwind_14042b7d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x198);
  return;
}



void Unwind_14042b7f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1c0);
  return;
}



void Unwind_14042b810(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1e8);
  return;
}



void Unwind_14042b830(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x210);
  return;
}



void Unwind_14042b850(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x238);
  return;
}



void Unwind_14042b870(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x260);
  return;
}



void Unwind_14042b890(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x288);
  return;
}



void Unwind_14042b8b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x2b0);
  return;
}



void Unwind_14042b8d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x2d8);
  return;
}



void Unwind_14042b8f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x300);
  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_14042b910(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x328),0x28,4,FUN_14023be90);
  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_14042b950(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x3c8),0x28,4,FUN_14023be90);
  return;
}



void Unwind_14042b990(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x468);
  return;
}



void Unwind_14042b9b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x490);
  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_14042b9d0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x4b8),0x28,4,FUN_14023be90);
  return;
}



undefined * Catch_All_14042ba10(void)

{
  return &DAT_1401594e5;
}



undefined * Catch_All_14042ba30(void)

{
  return &DAT_140158e85;
}



undefined * Catch_All_14042ba50(void)

{
  return &DAT_140158845;
}



undefined * Catch_All_14042ba70(void)

{
  return &DAT_140158275;
}



undefined * Catch_All_14042ba90(void)

{
  return &DAT_140157c35;
}



undefined * Catch_All_14042bab0(void)

{
  return &DAT_140157665;
}



undefined * Catch_All_14042bad0(void)

{
  return &DAT_1401571b5;
}



undefined * Catch_All_14042baf0(void)

{
  return &DAT_140156e75;
}



undefined * Catch_All_14042bb10(void)

{
  return &DAT_140156b35;
}



undefined * Catch_All_14042bb30(void)

{
  return &DAT_140156675;
}



undefined * Catch_All_14042bb50(void)

{
  return &DAT_1401561c5;
}



undefined * Catch_All_14042bb70(void)

{
  return &DAT_140155c75;
}



undefined * Catch_All_14042bb90(void)

{
  return &DAT_1401556a5;
}



undefined * Catch_All_14042bbb0(void)

{
  return &DAT_140155085;
}



undefined * Catch_All_14042bbd0(void)

{
  return &DAT_140154a15;
}



undefined * Catch_All_14042bbf0(void)

{
  return &DAT_1401544d2;
}



undefined * Catch_All_14042bc10(void)

{
  return &DAT_140154005;
}



undefined * Catch_All_14042bc30(void)

{
  return &DAT_1401539e5;
}



undefined * Catch_All_14042bc50(void)

{
  return &DAT_140153552;
}



undefined * Catch_All_14042bc70(void)

{
  return &DAT_1401530a5;
}



undefined * Catch_All_14042bc90(void)

{
  return &DAT_1401529e5;
}



undefined * Catch_All_14042bcb0(void)

{
  return &DAT_140151f22;
}



undefined * Catch_All_14042bcd0(void)

{
  return &DAT_140151a72;
}



undefined * Catch_All_14042bcf0(void)

{
  return &DAT_140151752;
}



undefined * Catch_All_14042bd10(void)

{
  return &DAT_1401512b5;
}



undefined * Catch_All_14042bd30(void)

{
  return &DAT_140150f82;
}



void Catch_All_14042bd50(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042bd70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Catch_All_14042bd80(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042bda0(undefined8 param_1,longlong param_2)

{
  FUN_14000f470(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042bdb0(undefined8 param_1,longlong param_2)

{
  FUN_140011410(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_14042bdc0(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_14042bdd0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(*(longlong *)(param_2 + 0x50) + 0x20);
  return;
}



void Unwind_14042bde0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(*(longlong *)(param_2 + 0x50) + 0x30);
  return;
}



void Unwind_14042bdf0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042be00(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_14042be10(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_14042be20(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_14042be30(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0xa0);
  return;
}



void Unwind_14042be50(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_14042be70(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0xf0);
  return;
}



void Unwind_14042be90(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_14042beb0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_14042bed0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_14042bef0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_14042bf10(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x1c0);
  return;
}



void Unwind_14042bf30(undefined8 param_1,longlong param_2)

{
  FUN_1400032a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042bf40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_14042bf50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Catch_All_14042bf60(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x98) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042bf90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042bfc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14042bfd0(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_14042bfe0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Catch_All_14042bff0(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_14033a390();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042c030(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Catch_All_14042c040(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14033a700(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042c080(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14033a700(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042c0c0(undefined8 param_1,longlong param_2)

{
  if (*(longlong *)(param_2 + 0x48) != 0) {
    FUN_140339060();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042c0f0(undefined8 param_1,longlong param_2)

{
  if (*(longlong *)(param_2 + 0x48) != 0) {
    FUN_140339060();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042c120(undefined8 param_1,longlong param_2)

{
  if (*(longlong *)(param_2 + 0x48) != 0) {
    FUN_140333d00();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042c150(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_14042c160(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_14042c180(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_14042c1a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_14042c1c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_14042c1e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x120);
  return;
}



void Unwind_14042c200(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x148);
  return;
}



void Unwind_14042c220(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_14042c240(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_14042c260(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1c0);
  return;
}



void Catch_All_14042c280(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x58);
  *(longlong *)(lVar1 + 0x30) = DAT_140608300;
  DAT_140608300 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042c2b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x68));
  return;
}



void Catch_All_14042c2d0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x1e8) = DAT_140608350;
  DAT_140608350 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042c340(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_14042c350(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_14042c360(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



undefined8 Catch_All_14042c380(void)

{
  return 0x1403313b3;
}



void Catch_All_14042c3a0(void)

{
  FUN_140331c70();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042c3e0(void)

{
  return 0x140330e23;
}



undefined8 Catch_All_14042c400(void)

{
  return 0x14032ce63;
}



void Unwind_14042c420(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042c430(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_14042c440(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_14042c450(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_14042c460(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xa0);
  return;
}



void Unwind_14042c480(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_14042c4a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xf0);
  return;
}



void Unwind_14042c4c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_14042c4e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x158);
  return;
}



void Unwind_14042c500(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x180);
  return;
}



void Unwind_14042c520(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1a8);
  return;
}



void Unwind_14042c540(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x1d0);
  return;
}



void Unwind_14042c560(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x240);
  return;
}



void Unwind_14042c580(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x2b0);
  return;
}



void Unwind_14042c5a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x348);
  return;
}



void Unwind_14042c5c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x368);
  return;
}



void Unwind_14042c5e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x390);
  return;
}



void Unwind_14042c600(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x3b8);
  return;
}



void Unwind_14042c620(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x3e0);
  return;
}



void Unwind_14042c640(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x408);
  return;
}



void Unwind_14042c660(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x430);
  return;
}



void Unwind_14042c680(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x458);
  return;
}



void Unwind_14042c6a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x480);
  return;
}



void Unwind_14042c6c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x4a8);
  return;
}



void Unwind_14042c6e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x4d0);
  return;
}



void Unwind_14042c700(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x4f8);
  return;
}



void Unwind_14042c720(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x520);
  return;
}



void Unwind_14042c740(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x548);
  return;
}



void Unwind_14042c760(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x570);
  return;
}



void Unwind_14042c780(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x598);
  return;
}



void Unwind_14042c7a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x5c0);
  return;
}



void Unwind_14042c7c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x5e8);
  return;
}



void Unwind_14042c7e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x610);
  return;
}



void Unwind_14042c800(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x638);
  return;
}



void Unwind_14042c820(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x660);
  return;
}



void Unwind_14042c840(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x688);
  return;
}



void Unwind_14042c860(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x6b0);
  return;
}



void Unwind_14042c880(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x6d8);
  return;
}



void Unwind_14042c8a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x700);
  return;
}



void Unwind_14042c8c0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x728);
  return;
}



void Unwind_14042c8e0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x748);
  return;
}



void Unwind_14042c900(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x768);
  return;
}



void Unwind_14042c920(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x868);
  return;
}



void Unwind_14042c940(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x890);
  return;
}



void Unwind_14042c960(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x8b8);
  return;
}



void Unwind_14042c980(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x900);
  return;
}



void Unwind_14042c9a0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x930);
  return;
}



void Unwind_14042c9c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x948);
  return;
}



void Catch_All_14042c9e0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x58) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ca10(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x40) = DAT_140608430;
  DAT_140608430 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042ca40(void)

{
  return 0x14031e813;
}



undefined8 Catch_All_14042ca60(void)

{
  return 0x14031e733;
}



undefined8 Catch_All_14042ca80(void)

{
  return 0x14031e583;
}



void Catch_All_14042caa0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0xa8) = DAT_140608560;
  DAT_140608560 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042cae0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



undefined8 Catch_All_14042caf0(void)

{
  return 0x140317813;
}



void Unwind_14042cb10(undefined8 param_1,longlong param_2)

{
  FUN_140313370(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042cb20(undefined8 param_1,longlong param_2)

{
  FUN_1402bf4d0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_14042cb30(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) + 0x18));
  }
  return;
}



void Unwind_14042cb60(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042cb70(undefined8 param_1,longlong param_2)

{
  std::exception::~exception((exception *)(param_2 + 0x28));
  return;
}



void Unwind_14042cb80(undefined8 param_1,longlong param_2)

{
  FUN_1403120d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042cb90(undefined8 param_1,longlong param_2)

{
  FUN_1402bf4d0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_14042cba0(undefined8 param_1,longlong param_2)

{
  FUN_140311f00(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042cbb0(undefined8 param_1,longlong param_2)

{
  FUN_1402bf4d0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_14042cbc0(undefined8 param_1,longlong param_2)

{
  FUN_140308d90(param_2 + 0x28);
  return;
}



void Unwind_14042cbd0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014042cbd7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_14042cbe0(undefined8 param_1,longlong param_2)

{
  FUN_14030e9a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042cbf0(undefined8 param_1,longlong param_2)

{
  FUN_1402bf4d0(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_14042cc00(undefined8 param_1,longlong param_2)

{
  std::basic_streambuf<>::~basic_streambuf<>((basic_streambuf<> *)(param_2 + 0xc0));
  return;
}



void Unwind_14042cc10(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014042cc17. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_istream<>::_vbase_destructor_((basic_istream<> *)(param_2 + 0x50));
  return;
}



void Unwind_14042cc20(undefined8 param_1,longlong param_2)

{
  FUN_140308d90(param_2 + 0x20);
  return;
}



void Unwind_14042cc30(undefined8 param_1,longlong param_2)

{
  FUN_1403120d0(param_2 + 0x140);
  return;
}



undefined8 Catch_All_14042cc40(void)

{
  return 0x14030e773;
}



undefined8 Catch_All_14042cc60(void)

{
  return 0x14030e493;
}



void Unwind_14042cc80(undefined8 param_1,longlong param_2)

{
  FUN_14030e9a0(param_2 + 0x80);
  return;
}



void Catch_All_14042cc90(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x58);
  *(longlong *)(lVar1 + 0xb0) = DAT_140608620;
  DAT_140608620 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042cce0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x110) = DAT_140608670;
  DAT_140608670 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042cd40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042cd50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_14042cd60(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14042cd70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_14042cd80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_14042cd90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_14042cdb0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_14042cdd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_14042cdf0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_14042ce10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x120);
  return;
}



void Unwind_14042ce30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x150);
  return;
}



void Unwind_14042ce50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x178);
  return;
}



void Unwind_14042ce70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1a8);
  return;
}



void Unwind_14042ce90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1e0);
  return;
}



void Unwind_14042ceb0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x248);
  return;
}



void Unwind_14042ced0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x340);
  return;
}



void Unwind_14042cef0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x380);
  return;
}



void Unwind_14042cf10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x3a8);
  return;
}



void Unwind_14042cf30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x3d0);
  return;
}



void Unwind_14042cf50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x430);
  return;
}



void Unwind_14042cf70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x458);
  return;
}



void Unwind_14042cf90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x488);
  return;
}



void Unwind_14042cfb0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x4b0);
  return;
}



void Unwind_14042cfd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x4d8);
  return;
}



void Unwind_14042cff0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x500);
  return;
}



void Unwind_14042d010(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x528);
  return;
}



void Unwind_14042d030(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x550);
  return;
}



void Unwind_14042d050(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x578);
  return;
}



void Unwind_14042d070(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x5a0);
  return;
}



void Unwind_14042d090(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x5c8);
  return;
}



void Unwind_14042d0b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x600);
  return;
}



void Unwind_14042d0d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x628);
  return;
}



void Unwind_14042d0f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x650);
  return;
}



void Unwind_14042d110(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x678);
  return;
}



void Unwind_14042d130(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x6b0);
  return;
}



void Unwind_14042d150(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x6d8);
  return;
}



void Unwind_14042d170(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x700);
  return;
}



void Unwind_14042d190(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x760);
  return;
}



void Unwind_14042d1b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x788);
  return;
}



void Unwind_14042d1d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x7b0);
  return;
}



void Unwind_14042d1f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x7d8);
  return;
}



void Unwind_14042d210(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x800);
  return;
}



void Unwind_14042d230(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x828);
  return;
}



void Unwind_14042d250(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x850);
  return;
}



void Unwind_14042d270(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x878);
  return;
}



void Unwind_14042d290(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x8a0);
  return;
}



undefined8 Catch_All_14042d2b0(void)

{
  return 0x140303eb3;
}



undefined8 Catch_All_14042d2d0(void)

{
  return 0x140303d03;
}



undefined8 Catch_All_14042d2f0(void)

{
  return 0x140303bd3;
}



void Unwind_14042d310(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_14042d320(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Catch_All_14042d330(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x70) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d360(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x68) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042d390(void)

{
  return 0x1402fce73;
}



undefined8 Catch_All_14042d3b0(void)

{
  return 0x1402fce53;
}



undefined8 Catch_All_14042d3d0(void)

{
  return 0x1402fccd3;
}



undefined8 Catch_All_14042d3f0(void)

{
  return 0x1402fcac3;
}



undefined8 Catch_All_14042d410(void)

{
  return 0x1402fca83;
}



void Catch_All_14042d430(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_140343fc0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d470(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_140320990(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d4b0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_140343110(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d4f0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14033a700(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d530(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14033a700(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d570(void)

{
  FUN_1402f4310();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d590(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_1403218b0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042d5d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042d5e0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_14042d5f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Catch_All_14042d600(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x90) = DAT_1406086f0;
  DAT_1406086f0 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042d660(void)

{
  return 0x1402e96c3;
}



undefined8 Catch_All_14042d680(void)

{
  return 0x1402e9513;
}



void Unwind_14042d6a0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14042d6b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Catch_All_14042d6d0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x1a0) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d700(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x58) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042d730(void)

{
  return 0x1402e255a;
}



undefined8 Catch_All_14042d750(void)

{
  return 0x1402e22ca;
}



undefined8 Catch_All_14042d770(void)

{
  return 0x1402e2013;
}



void Unwind_14042d790(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_14042d7a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_14042d7b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_14042d7c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_14042d7e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xb0);
  return;
}



void Unwind_14042d800(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xd8);
  return;
}



void Unwind_14042d820(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x100);
  return;
}



void Catch_All_14042d840(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  for (lVar2 = *(longlong *)(param_2 + 0x58); lVar2 != lVar1; lVar2 = lVar2 + 0x10) {
    FUN_14033a390();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d880(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x48) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d8b0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x20) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d8e0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  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 Catch_All_14042d910(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x20) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d940(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x28) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d970(void)

{
  FUN_1402d9ff0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d9a0(void)

{
  FUN_140253ec0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042d9d0(void)

{
  FUN_1402d9ff0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042da00(void)

{
  FUN_1402d9d30();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042da30(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_14042da60(void)

{
  FUN_14030d950();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042da90(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(param_2 + 0x58);
  return;
}



void Unwind_14042daa0(undefined8 param_1,longlong param_2)

{
  FUN_1402c43f0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042dab0(undefined8 param_1,longlong param_2)

{
  FUN_1402c61f0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_14042dac0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Catch_All_14042dae0(undefined8 param_1,longlong param_2)

{
  if (*(longlong *)(param_2 + 0x48) != 0) {
    FUN_140339060();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042db10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Catch_All_14042db20(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  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 Catch_All_14042db50(void)

{
  FUN_140253ec0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042db80(undefined8 param_1,longlong param_2)

{
  FUN_1402caf20(param_2 + 0x38);
  return;
}



void Unwind_14042db90(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 8);
  return;
}



void Unwind_14042dba0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x40) & 1) != 0) {
    *(uint *)(param_2 + 0x40) = *(uint *)(param_2 + 0x40) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0x38));
  }
  return;
}



void Catch_All_14042dbd0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 8) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042dc00(void)

{
  FUN_1402c0690();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042dc30(undefined8 param_1,longlong param_2)

{
  FUN_14026b4e0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042dc40(undefined8 param_1,longlong param_2)

{
  FUN_140273260(*(longlong *)(param_2 + 0x50) + 0x240);
  return;
}



void Unwind_14042dc60(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x50) + 0x270);
  return;
}



void Unwind_14042dc80(undefined8 param_1,longlong param_2)

{
  FUN_1401e04b0(param_2 + 0x30);
  return;
}



void Catch_All_14042dc90(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x1e8) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042dcc0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x38) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042dcf0(void)

{
  return 0x14025e6c3;
}



undefined8 Catch_All_14042dd10(void)

{
  return 0x14025e613;
}



void Catch_All_14042dd30(void)

{
  FUN_14025e6d0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042dd60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14042dd70(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14042dd80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_14042dd90(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0xd8);
  return;
}



void Unwind_14042ddb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_14042ddd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_14042ddf0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_14042de10(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_14042de30(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x178);
  return;
}



void Unwind_14042de50(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x188);
  return;
}



void Unwind_14042de70(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x1b8);
  return;
}



void Unwind_14042de90(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x88),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_14042dec0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    FUN_140129b90(param_2 + 0x28);
  }
  return;
}



void Unwind_14042def0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(undefined8 *)(param_2 + 0x88));
  return;
}



undefined8 Catch_All_14042df00(void)

{
  return 0x1402475d3;
}



void Unwind_14042df20(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_14042df40(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 + 0x30) {
    FUN_14023be90();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042df80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_14042df90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_14042dfa0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_14042dfb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Catch_All_14042dfc0(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_14042dff0(void)

{
  FUN_14020dde0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042e020(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042e030(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_14042e040(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x98);
  return;
}



void Unwind_14042e050(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_14042e060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14042e070(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Catch_All_14042e080(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x3c8) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042e0b0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0xf8) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042e0e0(void)

{
  return 0x1401e50f3;
}



void Catch_All_14042e100(void)

{
  FUN_1401e5510();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042e130(void)

{
  return 0x1401e4f33;
}



void Catch_All_14042e150(void)

{
  FUN_1401e53f0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042e180(void)

{
  return 0x1401e4c63;
}



undefined8 Catch_All_14042e1a0(void)

{
  return 0x1401e4c43;
}



void Unwind_14042e1c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_14042e1d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_14042e1f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xc0);
  return;
}



void Unwind_14042e210(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xe8);
  return;
}



void Unwind_14042e230(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x110);
  return;
}



void Unwind_14042e250(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x138);
  return;
}



void Unwind_14042e270(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x160);
  return;
}



void Unwind_14042e290(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x188);
  return;
}



void Unwind_14042e2b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1b0);
  return;
}



void Unwind_14042e2d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1d8);
  return;
}



void Unwind_14042e2f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x200);
  return;
}



void Unwind_14042e310(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x228);
  return;
}



void Unwind_14042e330(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x250);
  return;
}



void Unwind_14042e350(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x278);
  return;
}



void Unwind_14042e370(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x2a0);
  return;
}



void Unwind_14042e390(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x2c8);
  return;
}



void Unwind_14042e3b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x2e8);
  return;
}



void Unwind_14042e3d0(undefined8 param_1,longlong param_2)

{
  FUN_1401e02b0(*(longlong *)(param_2 + 0x40) + 0x308);
  return;
}



void Catch_All_14042e3f0(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_14042e420(void)

{
  return 0x1401df5c3;
}



void Unwind_14042e440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042e450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_14042e460(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14042e470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df030(param_2 + 0x48);
  return;
}



void Unwind_14042e480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_14042e490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(longlong *)(param_2 + 0x80) + 0x20);
  return;
}



void Unwind_14042e4a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xc0);
  return;
}



void Unwind_14042e4b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14042e4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df030(param_2 + 0x48);
  return;
}



void Unwind_14042e4d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_14042e4e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x68);
  return;
}



void Unwind_14042e4f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14042e500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(undefined8 *)(param_2 + 0xf0));
  return;
}



void Unwind_14042e510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(longlong *)(param_2 + 0xf0) + 0x20);
  return;
}



void Unwind_14042e520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x48);
  return;
}



void Unwind_14042e530(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042e540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df030(param_2 + 0x38);
  return;
}



void Unwind_14042e550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14042e560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(longlong *)(param_2 + 0x60) + 0x20);
  return;
}



void Unwind_14042e570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x30);
  return;
}



void Unwind_14042e580(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x40);
  return;
}



void Unwind_14042e590(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042e5a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df220(param_2 + 0x38);
  return;
}



void Catch_All_14042e5b0(void)

{
  FUN_140253ec0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042e5e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_14042e5f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x20);
  return;
}



void Unwind_14042e600(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_14042e610(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042e620(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x90) & 1) != 0) {
    *(uint *)(param_2 + 0x90) = *(uint *)(param_2 + 0x90) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Catch_All_14042e650(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x20) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042e680(void)

{
  return 0x140176263;
}



undefined8 Catch_All_14042e6a0(void)

{
  return 0x140176243;
}



void Catch_All_14042e6c0(void)

{
  FUN_140176340();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042e6f0(undefined8 param_1,longlong param_2)

{
  FUN_1400022f0(param_2 + 0x50);
  return;
}



void Unwind_14042e700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14042e710(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_14042e720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14042e730(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14042e740(undefined8 param_1,longlong param_2)

{
  FUN_140002070(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042e750(undefined8 param_1,longlong param_2)

{
  FUN_14004b8e0(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_14042e760(undefined8 param_1,longlong param_2)

{
  FUN_14004b960(*(longlong *)(param_2 + 0x40) + 0x70);
  return;
}



void Unwind_14042e770(undefined8 param_1,longlong param_2)

{
  FUN_1400032a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042e780(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Catch_All_14042e790(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x28) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042e7c0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Catch_All_14042e7e0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x7b8) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042e810(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0xd0);
  return;
}



void Unwind_14042e830(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0xf8);
  return;
}



void Unwind_14042e850(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x120);
  return;
}



void Unwind_14042e870(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x148);
  return;
}



void Unwind_14042e890(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x170);
  return;
}



void Unwind_14042e8b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x198);
  return;
}



void Unwind_14042e8d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1c0);
  return;
}



void Unwind_14042e8f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1e8);
  return;
}



void Unwind_14042e910(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x210);
  return;
}



void Unwind_14042e930(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x238);
  return;
}



void Unwind_14042e950(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x260);
  return;
}



void Unwind_14042e970(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x288);
  return;
}



void Unwind_14042e990(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x2b0);
  return;
}



void Unwind_14042e9b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x2d8);
  return;
}



void Unwind_14042e9d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x300);
  return;
}



void Unwind_14042e9f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x468);
  return;
}



void Unwind_14042ea10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x490);
  return;
}



void Unwind_14042ea30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x5f8);
  return;
}



void Unwind_14042ea50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x620);
  return;
}



void Unwind_14042ea70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x648);
  return;
}



void Unwind_14042ea90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x670);
  return;
}



void Unwind_14042eab0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x698);
  return;
}



void Unwind_14042ead0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x6c0);
  return;
}



void Unwind_14042eaf0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x6e8);
  return;
}



void Unwind_14042eb10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x710);
  return;
}



void Unwind_14042eb30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x738);
  return;
}



void Unwind_14042eb50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x760);
  return;
}



undefined8 Catch_All_14042eb70(void)

{
  return 0x140166103;
}



undefined8 Catch_All_14042eb90(void)

{
  return 0x1401625f3;
}



void Catch_All_14042ebb0(void)

{
  FUN_140253ec0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ebe0(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_14042ec10(void)

{
  return 0x14015fdf3;
}



void Catch_All_14042ec30(void)

{
  FUN_140160350();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042ec60(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x38);
  return;
}



void Unwind_14042ec70(undefined8 param_1,longlong param_2)

{
  FUN_14015b970(param_2 + 0x70);
  return;
}



void Unwind_14042ec80(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x20) + 8);
  return;
}



void Unwind_14042ec90(undefined8 param_1,longlong param_2)

{
  FUN_14015b9d0(param_2 + 0x150);
  return;
}



void Unwind_14042eca0(undefined8 param_1,longlong param_2)

{
  FUN_14015b810(param_2 + 0x28);
  return;
}



void Unwind_14042ecb0(undefined8 param_1,longlong param_2)

{
  FUN_14015b7d0(param_2 + 0x28);
  return;
}



void Unwind_14042ecc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xa0);
  return;
}



void Unwind_14042ece0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_14042ed00(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_14023be90();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042ed40(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Catch_All_14042ed60(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x70);
  for (lVar2 = *(longlong *)(param_2 + 0x78); lVar2 != lVar1; lVar2 = lVar2 + 0x28) {
    FUN_14023be90();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042eda0(void)

{
  FUN_14008d060();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042edd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Catch_All_14042ede0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x20) = DAT_140608810;
  DAT_140608810 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ee10(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0xd0) = DAT_140608860;
  DAT_140608860 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042eea0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x78) = DAT_140608950;
  DAT_140608950 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042eed0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x18) = DAT_140608b00;
  DAT_140608b00 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ef00(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x90) = DAT_140608b50;
  DAT_140608b50 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ef60(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x28) = DAT_140608c80;
  DAT_140608c80 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ef90(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x78) = DAT_140608cd0;
  DAT_140608cd0 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042efc0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x58);
  *(longlong *)(lVar1 + 0x50) = DAT_140608d20;
  DAT_140608d20 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042eff0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0xc0) = DAT_140608d70;
  DAT_140608d70 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f050(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x140) = DAT_140608ea0;
  DAT_140608ea0 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f0b0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0xa8) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f0e0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0xe0) = DAT_140608f90;
  DAT_140608f90 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f140(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x90) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f170(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x60) = DAT_140609150;
  DAT_140609150 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f1a0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0xf0) = DAT_1406091a0;
  DAT_1406091a0 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f200(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x108) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f230(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x80) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f260(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x298) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f290(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x30) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f2c0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x38) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f2f0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x18) = DAT_140609290;
  DAT_140609290 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042f320(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Catch_All_14042f340(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  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);
}



void Catch_All_14042f370(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x20) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042f3a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14042f3b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_14042f3c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_14042f3d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_14042f3f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xb0);
  return;
}



undefined8 Catch_All_14042f410(void)

{
  return 0x14014b583;
}



undefined8 Catch_All_14042f430(void)

{
  return 0x14014b373;
}



undefined8 Catch_All_14042f450(void)

{
  return 0x14014b193;
}



undefined8 Catch_All_14042f470(void)

{
  return 0x14014afe3;
}



undefined8 Catch_All_14042f490(void)

{
  return 0x14014ae03;
}



undefined8 Catch_All_14042f4b0(void)

{
  return 0x14014ac53;
}



undefined8 Catch_All_14042f4d0(void)

{
  return 0x14014aa83;
}



void Catch_All_14042f4f0(void)

{
  FUN_14014f230();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f530(void)

{
  FUN_14014ef20();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f570(void)

{
  FUN_14014ec10();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042f5b0(void)

{
  return 0x140149f73;
}



undefined8 Catch_All_14042f5d0(void)

{
  return 0x140149cc3;
}



undefined8 Catch_All_14042f5f0(void)

{
  return 0x140149a73;
}



undefined8 Catch_All_14042f610(void)

{
  return 0x140149883;
}



undefined8 Catch_All_14042f630(void)

{
  return 0x1401496a3;
}



undefined8 Catch_All_14042f650(void)

{
  return 0x1401494c3;
}



undefined8 Catch_All_14042f670(void)

{
  return 0x1401492d3;
}



undefined8 Catch_All_14042f690(void)

{
  return 0x140149053;
}



undefined8 Catch_All_14042f6b0(void)

{
  return 0x140148e73;
}



undefined8 Catch_All_14042f6d0(void)

{
  return 0x140148cb3;
}



undefined8 Catch_All_14042f6f0(void)

{
  return 0x140148b03;
}



undefined8 Catch_All_14042f710(void)

{
  return 0x140148a53;
}



undefined8 Catch_All_14042f730(void)

{
  return 0x140148803;
}



undefined8 Catch_All_14042f750(void)

{
  return 0x1401486f3;
}



undefined8 Catch_All_14042f770(void)

{
  return 0x140148533;
}



undefined8 Catch_All_14042f790(void)

{
  return 0x140148373;
}



undefined8 Catch_All_14042f7b0(void)

{
  return 0x140148123;
}



undefined8 Catch_All_14042f7d0(void)

{
  return 0x140147f93;
}



undefined8 Catch_All_14042f7f0(void)

{
  return 0x140147dd3;
}



void Catch_All_14042f810(void)

{
  FUN_14014cbb0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14042f850(void)

{
  return 0x14014795a;
}



void Catch_All_14042f870(void)

{
  FUN_1402d9ff0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042f8a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_14042f8b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Unwind_14042f8c0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_14042f8e0(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_140129b90();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042f920(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042f950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042f960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14042f970(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_14042f980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14042f990(undefined8 param_1,longlong param_2)

{
  FUN_140002070(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042f9a0(undefined8 param_1,longlong param_2)

{
  FUN_14029ca80(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_14042f9b0(undefined8 param_1,longlong param_2)

{
  FUN_14029cad0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_14042f9c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_14042f9e0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0xb8);
  return;
}



void Unwind_14042fa00(undefined8 param_1,longlong param_2)

{
  FUN_1400032a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042fa10(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x30);
  return;
}



void Unwind_14042fa20(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x30);
  return;
}



void Unwind_14042fa30(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x30);
  return;
}



void Unwind_14042fa40(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x50);
  return;
}



void Unwind_14042fa50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x78);
  return;
}



void Unwind_14042fa60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_14042fa70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fa80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_14042fa90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042faa0(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_14042fad0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fae0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042faf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_14042fb00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14042fb10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14042fb20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fb30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fb40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fb50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_14042fb60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_14042fb70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_14042fb80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fb90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fbb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_14042fbc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14042fbd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_14042fbe0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fbf0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fc00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fc10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_14042fc20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_14042fc30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fc40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fc50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x20);
  return;
}



void Unwind_14042fc60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fc70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14042fc80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_14042fc90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fca0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14042fcb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14042fcc0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x40);
  return;
}



void Unwind_14042fcd0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x50);
  return;
}



void Unwind_14042fce0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x60);
  return;
}



void Unwind_14042fcf0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x70);
  return;
}



void Unwind_14042fd00(undefined8 param_1,longlong param_2)

{
  FUN_14000f470(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042fd10(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_14042fd20(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014042fd27. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_14042fd30(undefined8 param_1,longlong param_2)

{
  FUN_14000f470(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14042fd40(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_14042fd60(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_140003700();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042fda0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042fdd0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_14042fdf0(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_140136590();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042fe30(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_14042fe60(void)

{
  FUN_1403451e0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042fe90(void)

{
  FUN_140344b60();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042fec0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14033a700(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14042ff00(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Catch_All_14042ff10(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_14042ff40(void)

{
  FUN_140331940();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14042ffe0(void)

{
  FUN_14031ecb0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140430030(void)

{
  FUN_1402f39f0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140430060(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  
  lVar1 = *(longlong *)(param_2 + 0x68);
  *(longlong *)(lVar1 + 0x3a0) = DAT_140608510;
  DAT_140608510 = lVar1;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404300d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xc0);
  return;
}



void Unwind_1404300f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xe8);
  return;
}



void Unwind_140430110(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x110);
  return;
}



void Unwind_140430130(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x138);
  return;
}



void Unwind_140430150(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x160);
  return;
}



void Unwind_140430170(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x188);
  return;
}



void Unwind_140430190(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1b0);
  return;
}



void Unwind_1404301b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1d8);
  return;
}



void Unwind_1404301d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x200);
  return;
}



void Unwind_1404301f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x228);
  return;
}



void Unwind_140430210(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x250);
  return;
}



void Unwind_140430230(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x278);
  return;
}



void Unwind_140430250(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x2a0);
  return;
}



void Unwind_140430270(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x2c8);
  return;
}



void Unwind_140430290(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x2e8);
  return;
}



void Unwind_1404302b0(undefined8 param_1,longlong param_2)

{
  FUN_1401e02b0(*(longlong *)(param_2 + 0x50) + 0x308);
  return;
}



void Unwind_1404302d0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1404302f0(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 + 0x98) {
    FUN_14030faa0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430330(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x68));
  return;
}



void Catch_All_140430350(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  for (lVar2 = *(longlong *)(param_2 + 0x58); lVar2 != lVar1; lVar2 = lVar2 + 0x98) {
    FUN_14030faa0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430390(undefined8 param_1,longlong param_2)

{
  FUN_1403130f0(param_2 + 0x60);
  return;
}



void Unwind_1404303a0(undefined8 param_1,longlong param_2)

{
  FUN_1403130f0(param_2 + 0xf0);
  return;
}



void Catch_All_1404303b0(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_1404303e0(undefined8 param_1,longlong param_2)

{
  std::exception::~exception((exception *)(param_2 + 0x30));
  return;
}



void Unwind_1404303f0(undefined8 param_1,longlong param_2)

{
  FUN_140313370(param_2 + 0xb8);
  return;
}



void Unwind_140430400(undefined8 param_1,longlong param_2)

{
  std::exception::~exception((exception *)(param_2 + 0x38));
  return;
}



void Catch_All_140430410(undefined8 param_1,longlong param_2)

{
  int iVar1;
  longlong lVar2;
  void *pvVar3;
  
  iVar1 = *(int *)(param_2 + 0x20);
  lVar2 = *(longlong *)(param_2 + 0x30);
  pvVar3 = *(void **)(param_2 + 0x38);
  if (1 < iVar1) {
    FUN_14030dbf0(pvVar3);
  }
  if (0 < iVar1) {
    FUN_14030dbf0((void *)((longlong)pvVar3 + lVar2 * 0x98));
  }
  operator_delete(pvVar3);
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430480(undefined8 param_1,longlong param_2)

{
  FUN_14030faa0(param_2 + 0x60);
  return;
}



void Catch_All_140430490(void)

{
  FUN_14030dbf0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404304d0(undefined8 param_1,longlong param_2)

{
  FUN_14030faa0(param_2 + 0x60);
  return;
}



void Unwind_1404304e0(undefined8 param_1,longlong param_2)

{
  FUN_14030faa0(*(undefined8 *)(param_2 + 0x28));
  return;
}



undefined8 Catch_All_1404304f0(void)

{
  return 0x14030e583;
}



void Catch_All_140430510(void)

{
  FUN_1402f39f0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140430540(void)

{
  FUN_1403084d0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404305b0(void)

{
  FUN_1402fd080();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404305e0(void)

{
  FUN_140344b60();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_140430610(void)

{
  return 0x1402fca63;
}



void Catch_All_140430630(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14032b8b0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430670(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140430680(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x98);
  return;
}



void Unwind_1404306a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xc0);
  return;
}



void Unwind_1404306c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xe8);
  return;
}



void Unwind_1404306e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x110);
  return;
}



void Unwind_140430700(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x138);
  return;
}



void Unwind_140430720(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x160);
  return;
}



void Unwind_140430740(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x188);
  return;
}



void Unwind_140430760(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1b0);
  return;
}



void Unwind_140430780(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1d8);
  return;
}



void Unwind_1404307a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x200);
  return;
}



void Unwind_1404307c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x228);
  return;
}



void Unwind_1404307e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x250);
  return;
}



void Unwind_140430800(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x278);
  return;
}



void Unwind_140430820(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x2a0);
  return;
}



void Unwind_140430840(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x2c8);
  return;
}



void Unwind_140430860(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x2e8);
  return;
}



void Catch_All_140430880(void)

{
  FUN_1402e9d40();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404308d0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Catch_All_1404308f0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x70);
  for (lVar2 = *(longlong *)(param_2 + 0x78); lVar2 != lVar1; lVar2 = lVar2 + 0x28) {
    FUN_140129b90();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430930(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140430950(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_140129b90();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430990(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x40),*(undefined8 *)(param_2 + 0x30));
  return;
}



void Catch_All_1404309b0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x70);
  lVar2 = *(longlong *)(param_2 + 0x30);
  *(undefined8 *)(lVar2 + 0x188) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404309e0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x68) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140430a10(void)

{
  FUN_140129050();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140430a60(void)

{
  FUN_1402e3330();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_140430a90(void)

{
  return 0x1402e1e53;
}



undefined8 Catch_All_140430ab0(void)

{
  return 0x1402e1e33;
}



void Catch_All_140430ad0(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_140430b00(void)

{
  FUN_1402da100();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430b30(undefined8 param_1,longlong param_2)

{
  FUN_1400034f0(param_2 + 0x20);
  return;
}



void Unwind_140430b40(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x20);
  return;
}



void Unwind_140430b50(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x58);
  return;
}



void Unwind_140430b60(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x20);
  return;
}



void Unwind_140430b70(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x58);
  return;
}



void Catch_All_140430b80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430bb0(undefined8 param_1,longlong param_2)

{
  FUN_1402ce3c0(param_2 + 0x40);
  return;
}



void Unwind_140430bc0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x28);
  return;
}



void Unwind_140430bd0(undefined8 param_1,longlong param_2)

{
  FUN_1402cdda0(param_2 + 0x40);
  return;
}



void Unwind_140430be0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x28);
  return;
}



void Unwind_140430bf0(undefined8 param_1,longlong param_2)

{
  FUN_1402bc9e0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140430c00(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xe0);
  return;
}



void Unwind_140430c20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xf0);
  return;
}



void Unwind_140430c40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_140430c60(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x1b0);
  return;
}



void Unwind_140430c80(undefined8 param_1,longlong param_2)

{
  FUN_140167bd0(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140430c90(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x58),0x10,10,FUN_14033a390);
  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_140430cc0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0xf8),0x10,10,FUN_14033a390);
  return;
}



void Unwind_140430d00(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_140430d20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1b8);
  return;
}



void Unwind_140430d40(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x1f0);
  return;
}



void Unwind_140430d60(undefined8 param_1,longlong param_2)

{
  FUN_14031e8c0(*(longlong *)(param_2 + 0x40) + 0x200);
  return;
}



void Unwind_140430d80(undefined8 param_1,longlong param_2)

{
  FUN_1402c70c0(*(longlong *)(param_2 + 0x40) + 0x248);
  return;
}



void Unwind_140430da0(undefined8 param_1,longlong param_2)

{
  FUN_140167bd0(*(longlong *)(param_2 + 0x50) + 0x10);
  return;
}



void Unwind_140430db0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x58),0x10,10,FUN_14033a390);
  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_140430de0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0xf8),0x10,10,FUN_14033a390);
  return;
}



void Unwind_140430e20(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x198);
  return;
}



void Unwind_140430e40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x1b8);
  return;
}



void Unwind_140430e60(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x1f0);
  return;
}



void Unwind_140430e80(undefined8 param_1,longlong param_2)

{
  FUN_14031e8c0(*(longlong *)(param_2 + 0x50) + 0x200);
  return;
}



void Unwind_140430ea0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Unwind_140430eb0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x58);
  return;
}



void Unwind_140430ec0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xb8);
  return;
}



void Unwind_140430ed0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_140430ee0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x88);
  return;
}



void Catch_All_140430ef0(undefined8 param_1,longlong param_2)

{
  if (*(longlong *)(param_2 + 0x48) != 0) {
    FUN_1402bc3e0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140430f20(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x60);
  return;
}



void Unwind_140430f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175470(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140430f40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_140430f50(undefined8 param_1,longlong param_2)

{
  FUN_14027bda0(*(longlong *)(param_2 + 0x40) + 0xd8);
  return;
}



void Unwind_140430f70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x108);
  return;
}



void Unwind_140430f90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x128);
  return;
}



void Unwind_140430fb0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140430fd0(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 + 0x68) {
    FUN_14023ba90();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140431010(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431040(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_140431050(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x90);
  return;
}



void Unwind_140431060(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_140431070(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140431080(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_140431090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x180);
  return;
}



void Unwind_1404310a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1404310b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1404310c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404310d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x170);
  return;
}



void Unwind_1404310e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1404310f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_140431100(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



void Unwind_140431110(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x80);
  return;
}



void Unwind_140431120(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_140431130(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_140431140(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140431150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 400);
  return;
}



void Unwind_140431160(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_140431170(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_140431180(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140431190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x180);
  return;
}



void Unwind_1404311a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_1404311b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_1404311c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_1404311d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_1404311e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1404311f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140431200(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140431220(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 + 0x150) {
    _eh_vector_destructor_iterator_((void *)(lVar2 + 0x70),0x28,5,FUN_140129b90);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140431270(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404312a0(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(param_2 + 0x60);
  return;
}



void Unwind_1404312b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_1404312d0(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 + 0x78) {
    FUN_140139500();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140431310(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431340(void)

{
  DAT_14060ab70 = DAT_14060ab70 & 0xfffffffe;
  return;
}



void Unwind_140431360(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x70);
  return;
}



void Unwind_140431370(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0x98);
  return;
}



void Unwind_140431390(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xc0);
  return;
}



void Unwind_1404313b0(undefined8 param_1,longlong param_2)

{
  FUN_140216250(*(longlong *)(param_2 + 0x50) + 0xe8);
  return;
}



void Unwind_1404313d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x108);
  return;
}



void Unwind_1404313f0(undefined8 param_1,longlong param_2)

{
  FUN_140216290(*(longlong *)(param_2 + 0x50) + 0x128);
  return;
}



void Unwind_140431410(undefined8 param_1,longlong param_2)

{
  FUN_140215c40(*(longlong *)(param_2 + 0x50) + 0x148);
  return;
}



void Unwind_140431430(undefined8 param_1,longlong param_2)

{
  FUN_1401e28a0(*(longlong *)(param_2 + 0x50) + 0x168);
  return;
}



void Unwind_140431450(undefined8 param_1,longlong param_2)

{
  FUN_140215f70(*(longlong *)(param_2 + 0x50) + 400);
  return;
}



void Unwind_140431470(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x58) + 0x21420);
  return;
}



void Unwind_140431490(undefined8 param_1,longlong param_2)

{
  FUN_1402163b0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1404314a0(undefined8 param_1,longlong param_2)

{
  FUN_1402163b0(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_1404314b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020ff10(param_2 + 0x28);
  return;
}



void Unwind_1404314c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404314d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020ff10(param_2 + 0x28);
  return;
}



void Unwind_1404314e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404314f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020ff10(param_2 + 0x28);
  return;
}



void Unwind_140431500(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140431520(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 + 0xe0) {
    FUN_14020e400();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140431560(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431590(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404315a0(undefined8 param_1,longlong param_2)

{
  FUN_14020e400(param_2 + 0x40);
  return;
}



void Unwind_1404315b0(undefined8 param_1,longlong param_2)

{
  FUN_14020e400(param_2 + 0x40);
  return;
}



void Unwind_1404315c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404315d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1404315e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_1404315f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140431600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_140431610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140431620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140431630(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140431640(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140431650(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140431660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_140431670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140431680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_140431690(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1404316a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_1404316b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404316c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1404316d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1404316e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x68);
  return;
}



void Unwind_1404316f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_140431700(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Catch_All_140431710(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_140431740(void)

{
  FUN_1401dfad0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e600(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140431780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_140431790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df320(param_2 + 0x28);
  return;
}



void Unwind_1404317a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404317b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df220(param_2 + 0x58);
  return;
}



void Unwind_1404317c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x78);
  return;
}



void Unwind_1404317d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1404317e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_1404317f0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x28);
  return;
}



void Unwind_140431800(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x50);
  return;
}



void Unwind_140431810(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_140431820(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x70);
  return;
}



void Unwind_140431830(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x20);
  return;
}



void Unwind_140431840(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x70);
  return;
}



void Unwind_140431850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x50);
  return;
}



void Unwind_140431860(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x60);
  return;
}



void Unwind_140431870(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x88);
  return;
}



void Unwind_140431880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140431890(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404318a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_1404318b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x78);
  return;
}



void Unwind_1404318c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_1404318d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_1404318e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x80);
  return;
}



void Unwind_1404318f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_140431900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140431910(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140431920(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_140431930(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x58);
  return;
}



void Unwind_140431940(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x78);
  return;
}



void Unwind_140431950(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_140431960(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x70);
  return;
}



void Unwind_140431970(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x90);
  return;
}



void Unwind_140431980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x28);
  return;
}



void Unwind_140431990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x38);
  return;
}



void Unwind_1404319a0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_1404319b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x58);
  return;
}



void Unwind_1404319c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_1404319d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404319e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df220(param_2 + 0x38);
  return;
}



void Unwind_1404319f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df2a0(param_2 + 0x58);
  return;
}



void Unwind_140431a00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140431a10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df220(param_2 + 0x50);
  return;
}



void Unwind_140431a20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df2a0(param_2 + 0x70);
  return;
}



void Unwind_140431a30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140431a40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140431a50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140431a60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140431a70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_140431a80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_140431a90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140431aa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140431ab0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140431ac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_140431ad0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Catch_All_140431ae0(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_140431b10(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_140196aa0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431b50(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x58) & 1) != 0) {
    *(uint *)(param_2 + 0x58) = *(uint *)(param_2 + 0x58) & 0xfffffffe;
    FUN_1403352a0(*(undefined8 *)(param_2 + 0x50));
  }
  return;
}



void Catch_All_140431b80(void)

{
  FUN_1402f39f0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431bb0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140431bc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x28);
  return;
}



void Unwind_140431bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140431be0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x38);
  return;
}



void Unwind_140431bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140431c00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140431c10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x38);
  return;
}



void Unwind_140431c20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140431c30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140431c40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_140431c50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140431c60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140431c70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140431c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_140431c90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140431ca0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140431cb0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140431cd0(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 + 0x50) {
    FUN_140176a20();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431d10(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140431d30(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 + 0x50) {
    FUN_140176a20();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140431d70(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_140431da0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140431de0(undefined8 param_1,longlong param_2)

{
  FUN_140176a20(param_2 + 0x40);
  return;
}



void Unwind_140431df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Catch_All_140431e00(void)

{
  FUN_140166860();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140431e30(undefined8 param_1,longlong param_2)

{
  FUN_140147000(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140431e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401660f0(*(longlong *)(param_2 + 0x40) + 0x40);
  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_140431e50(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0xe0),0x38,8,FUN_14023be90);
  return;
}



void Unwind_140431e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14032ce50(*(longlong *)(param_2 + 0x40) + 0x2a0);
  return;
}



void Unwind_140431eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14032ce50(*(longlong *)(param_2 + 0x40) + 0x2e8);
  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_140431ed0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x330),0x48,4,thunk_FUN_1401625e0);
  return;
}



void Unwind_140431f10(undefined8 param_1,longlong param_2)

{
  FUN_1400034f0(param_2 + 0x30);
  return;
}



void Unwind_140431f20(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x30);
  return;
}



void Unwind_140431f30(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x68);
  return;
}



void Unwind_140431f40(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x30);
  return;
}



void Unwind_140431f50(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x68);
  return;
}



void Unwind_140431f60(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(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_140431f70(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0xa0),0x38,4,FUN_14015b7d0);
  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_140431fb0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x180),0x38,8,FUN_14015b7d0);
  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_140431ff0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x340),0x30,0x19,FUN_14015b810);
  return;
}



void Unwind_140432030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14015fde0(*(longlong *)(param_2 + 0x40) + 0x7f0);
  return;
}



void Unwind_140432050(undefined8 param_1,longlong param_2)

{
  FUN_140215c40(*(longlong *)(param_2 + 0x40) + 0x848);
  return;
}



void Unwind_140432070(undefined8 param_1,longlong param_2)

{
  FUN_1402163b0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140432080(undefined8 param_1,longlong param_2)

{
  FUN_1402163b0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140432090(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(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_1404320a0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0xa0),0x38,4,FUN_14015b7d0);
  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_1404320e0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x180),0x38,8,FUN_14015b7d0);
  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_140432120(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x340),0x30,0x19,FUN_14015b810);
  return;
}



void Unwind_140432160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14015fde0(*(longlong *)(param_2 + 0x50) + 0x7f0);
  return;
}



void Unwind_140432180(undefined8 param_1,longlong param_2)

{
  FUN_140215c40(*(longlong *)(param_2 + 0x50) + 0x848);
  return;
}



void Unwind_1404321a0(undefined8 param_1,longlong param_2)

{
  FUN_140215c40(*(longlong *)(param_2 + 0x50) + 0x868);
  return;
}



void Unwind_1404321c0(undefined8 param_1,longlong param_2)

{
  FUN_140147000(param_2 + 0x28);
  return;
}



void Unwind_1404321d0(undefined8 param_1,longlong param_2)

{
  FUN_140159960(param_2 + 0x30);
  return;
}



void Unwind_1404321e0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Catch_All_140432200(void)

{
  FUN_14014fe20();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404323b0(void)

{
  FUN_140149220();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140432420(void)

{
  FUN_14014dbd0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140432490(void)

{
  FUN_14014d400();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404324c0(void)

{
  FUN_14014d2d0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404324f0(void)

{
  FUN_1401482d0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140432520(void)

{
  FUN_14014d080();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140432550(void)

{
  FUN_14025e6d0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140432580(void)

{
  FUN_14014ca50();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404325b0(undefined8 param_1,longlong param_2)

{
  FUN_140147000(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404325c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148110(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1404325d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148360(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_1404325f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148520(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_140432610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401486e0(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_140432630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401487f0(*(longlong *)(param_2 + 0x40) + 0x160);
  return;
}



void Unwind_140432650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401487f0(*(longlong *)(param_2 + 0x40) + 0x1a8);
  return;
}



void Unwind_140432670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148360(*(longlong *)(param_2 + 0x40) + 0x1f0);
  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_140432690(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x40) + 0x238),0x20,0xc,FUN_140162300);
  return;
}



void Unwind_1404326d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1404326e0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140432700(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_14012d9d0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140432740(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140432770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140432780(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140432790(undefined8 param_1,longlong param_2)

{
  FUN_14012af40(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404327a0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1404327b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Catch_All_1404327d0(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_140136590();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140432810(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140432830(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_140136590();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140432870(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140432890(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 Catch_All_1404328f0(void)

{
  FUN_140129010();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140432940(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140432970(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140432990(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404329b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd0);
  return;
}



void Unwind_1404329c0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0xa8);
  return;
}



void Unwind_1404329d0(undefined8 param_1,longlong param_2)

{
  FUN_1400034f0(param_2 + 0x20);
  return;
}



void Unwind_1404329e0(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x20);
  return;
}



void Unwind_1404329f0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x58);
  return;
}



void Unwind_140432a00(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x20);
  return;
}



void Unwind_140432a10(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x58);
  return;
}



void Unwind_140432a20(undefined8 param_1,longlong param_2)

{
  FUN_14012a320(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140432a30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_140432a40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x48) + 0x30);
  return;
}



void Unwind_140432a50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x48) + 0x58);
  return;
}



void Unwind_140432a60(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x48) + 0x90);
  return;
}



void Unwind_140432a80(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x48) + 0xb8);
  return;
}



void Unwind_140432aa0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x48) + 0xe0);
  return;
}



void Unwind_140432ac0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(longlong *)(param_2 + 0x48) + 0x108);
  return;
}



void Unwind_140432ae0(undefined8 param_1,longlong param_2)

{
  FUN_140128210(*(longlong *)(param_2 + 0x48) + 0x188);
  return;
}



void Unwind_140432b00(undefined8 param_1,longlong param_2)

{
  FUN_1401293d0(*(longlong *)(param_2 + 0x48) + 0x1a8);
  return;
}



void Unwind_140432b20(undefined8 param_1,longlong param_2)

{
  FUN_1401282f0(param_2 + 0x20);
  return;
}



void Unwind_140432b30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x58);
  return;
}



void Unwind_140432b40(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x80);
  return;
}



void Unwind_140432b50(undefined8 param_1,longlong param_2)

{
  FUN_14012a0e0(param_2 + 0xb0);
  return;
}



void Unwind_140432b60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_140432b70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140432b80(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140432ba0(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_14023be90();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140432be0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140432c10(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140432c30(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_140432c70(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140432ca0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140432cb0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x38);
  return;
}



void Unwind_140432cc0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140432cc7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140432cd0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140432cd7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140432ce0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x38);
  return;
}



void Unwind_140432cf0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x28);
  return;
}



void Unwind_140432d00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140432d10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140432d20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_140432d30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140432d40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140432d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140432d60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140432d70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_140432d80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_140432d90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 200);
  return;
}



void Unwind_140432da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_140432db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140432dc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_140432dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_140432de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_140432df0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_140432e00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x50);
  return;
}



void Unwind_140432e10(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x80);
  return;
}



void Unwind_140432e20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_140432e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_140432e40(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x80);
  return;
}



void Unwind_140432e50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_140432e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_140432e70(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x80);
  return;
}



void Unwind_140432e80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 200);
  return;
}



void Unwind_140432e90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x88);
  return;
}



void Unwind_140432ea0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_140432eb0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x60);
  return;
}



void Unwind_140432ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400032a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140432ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_140432ee0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140432f00(undefined8 param_1,longlong param_2)

{
  FUN_1402f4480(param_2 + 0x28);
  return;
}



void Unwind_140432f10(undefined8 param_1,longlong param_2)

{
  FUN_140345db0(param_2 + 0x30);
  return;
}



void Unwind_140432f20(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140432f40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x28);
  return;
}



void Unwind_140432f50(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140432f70(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_140342fb0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140432fb0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140432fd0(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_140176a20();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140433010(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140433030(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 + 0x78) {
    FUN_140340960();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140433070(void)

{
  FUN_140338d00();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404330d0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14030e480(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140433110(void)

{
  FUN_140338d00();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404331a0(undefined8 param_1,longlong param_2)

{
  FUN_140320420(param_2 + 0x30);
  return;
}



void Unwind_1404331b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1404331d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x28));
  return;
}



void Catch_All_1404331e0(void)

{
  FUN_14031a3c0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140433250(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Catch_All_140433270(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x60);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x418) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404332a0(void)

{
  FUN_140312c70();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404332d0(undefined8 param_1,longlong param_2)

{
  FUN_14030faa0(param_2 + 0x30);
  return;
}



void Unwind_1404332e0(undefined8 param_1,longlong param_2)

{
  std::exception::~exception((exception *)(param_2 + 0x28));
  return;
}



void Unwind_1404332f0(undefined8 param_1,longlong param_2)

{
  FUN_140311f00(param_2 + 0xb0);
  return;
}



void Unwind_140433300(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x100);
  return;
}



void Unwind_140433310(undefined8 param_1,longlong param_2)

{
  FUN_140314100(param_2 + 0x48);
  return;
}



void Unwind_140433320(undefined8 param_1,longlong param_2)

{
  std::exception::~exception((exception *)(param_2 + 0x58));
  return;
}



void Catch_All_140433330(void)

{
  FUN_14030f6a0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140433360(undefined8 param_1,longlong param_2)

{
  FUN_14030d9d0(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_140433370(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(*(longlong *)(param_2 + 0x30) + 0x20);
  return;
}



void Unwind_140433380(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x30) + 0x58);
  return;
}



void Unwind_140433390(undefined8 param_1,longlong param_2)

{
  FUN_14030da30(*(longlong *)(param_2 + 0x30) + 0x88);
  return;
}



void Unwind_1404333b0(undefined8 param_1,longlong param_2)

{
  FUN_14030d990(*(longlong *)(param_2 + 0x30) + 0x110);
  return;
}



void Unwind_1404333d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_1404333e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14030e480(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404333f0(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_140433400(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_140433410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148110(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140433430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14030e480(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_140433450(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



undefined8 Catch_All_140433470(void)

{
  return 0x1402fcaa3;
}



void Catch_All_140433490(void)

{
  FUN_14031a3c0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404334e0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_14030b0e0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140433520(undefined8 param_1,longlong param_2)

{
  FUN_1402ca690(param_2 + 0x30);
  return;
}



void Unwind_140433530(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140433550(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140433570(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 + 0x410) {
    FUN_1401dfef0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404335b0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404335e0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Catch_All_140433600(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 + 0x150) {
    FUN_1402df330();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140433640(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_140433660(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 + 0x150) {
    FUN_1402df330();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404336a0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x40),*(undefined8 *)(param_2 + 0x30));
  return;
}



void Catch_All_1404336c0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x70);
  lVar2 = *(longlong *)(param_2 + 0x30);
  *(undefined8 *)(lVar2 + 0x188) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404336f0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x240) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140433720(void)

{
  FUN_1402e15a0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_140433770(void)

{
  return 0x1402e1c3a;
}



void Unwind_140433790(undefined8 param_1,longlong param_2)

{
  FUN_1402df330(*(undefined8 *)(param_2 + 0x38));
  return;
}



void Unwind_1404337a0(undefined8 param_1,longlong param_2)

{
  FUN_1402dfa30(param_2 + 0x1d0);
  return;
}



void Unwind_1404337b0(undefined8 param_1,longlong param_2)

{
  Concurrency::details::SubAllocator::~SubAllocator((SubAllocator *)(param_2 + 0x40));
  return;
}



void Catch_All_1404337c0(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x50);
  lVar2 = *(longlong *)(param_2 + 0x20);
  *(undefined8 *)(lVar2 + 0x28) = *(undefined8 *)(lVar1 + 0x40);
  *(longlong *)(lVar1 + 0x40) = lVar2;
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404337f0(void)

{
  FUN_1402d9eb0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140433820(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_140433850(void)

{
  FUN_14030d950();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140433880(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140433890(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x20) & 1) != 0) {
    *(uint *)(param_2 + 0x20) = *(uint *)(param_2 + 0x20) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0x68));
  }
  return;
}



void Unwind_1404338c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1404338d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_1404338e0(undefined8 param_1,longlong param_2)

{
  FUN_1402ca690(param_2 + 0x20);
  return;
}



void Unwind_1404338f0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x38),*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140433910(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x38));
  return;
}



void Unwind_140433930(undefined8 param_1,longlong param_2)

{
  FUN_1402c61f0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140433940(undefined8 param_1,longlong param_2)

{
  FUN_140167bd0(param_2 + 0x28);
  return;
}



void Unwind_140433950(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x70);
  return;
}



void Unwind_140433960(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140433970(undefined8 param_1,longlong param_2)

{
  FUN_14012d9d0(param_2 + 0x30);
  return;
}



void Catch_All_140433980(void)

{
  FUN_140295680();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404339b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140295170(param_2 + 0x70);
  return;
}



void Unwind_1404339c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xb0);
  return;
}



void Unwind_1404339d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd8);
  return;
}



void Unwind_1404339e0(undefined8 param_1,longlong param_2)

{
  FUN_140292350(param_2 + 0x90);
  return;
}



void Unwind_1404339f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Unwind_140433a00(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433a20(undefined8 param_1,longlong param_2)

{
  FUN_140168220(param_2 + 0x28);
  return;
}



void Unwind_140433a30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x58);
  return;
}



void Unwind_140433a40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0xb8);
  return;
}



void Unwind_140433a50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x20);
  return;
}



void Unwind_140433a60(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x128) & 1) != 0) {
    *(uint *)(param_2 + 0x128) = *(uint *)(param_2 + 0x128) & 0xfffffffe;
    thunk_FUN_1401975d0(*(undefined8 *)(param_2 + 0x118));
  }
  return;
}



void Unwind_140433a90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x48);
  return;
}



void Catch_All_140433aa0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140433ad0(undefined8 param_1,longlong param_2)

{
  FUN_140168220(param_2 + 0x28);
  return;
}



void Unwind_140433ae0(undefined8 param_1,longlong param_2)

{
  FUN_140168220(param_2 + 0x28);
  return;
}



void Unwind_140433af0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140433b00(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x38);
  return;
}



void Unwind_140433b10(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_140433b20(void)

{
  DAT_14060b7f0 = DAT_14060b7f0 & 0xfffffffe;
  return;
}



void Unwind_140433b40(undefined8 param_1,longlong param_2)

{
  FUN_1402479f0(param_2 + 0x28);
  return;
}



void Unwind_140433b50(undefined8 param_1,longlong param_2)

{
  FUN_1402479d0(param_2 + 0x28);
  return;
}



void Unwind_140433b60(undefined8 param_1,longlong param_2)

{
  FUN_1401625e0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140433b70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x48);
  return;
}



void Unwind_140433b80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x68);
  return;
}



void Unwind_140433b90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x78);
  return;
}



void Unwind_140433ba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14023ae90(param_2 + 0x58);
  return;
}



void Unwind_140433bb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x58);
  return;
}



void Unwind_140433bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140433bd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x48);
  return;
}



void Unwind_140433be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140433bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140433c00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140433c10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x70);
  return;
}



void Unwind_140433c20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140433c30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140433c40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140433c50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140433c60(void)

{
  DAT_14060b7cc = DAT_14060b7cc & 0xfffffffe;
  return;
}



void Unwind_140433c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x48);
  return;
}



void Unwind_140433c90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140433ca0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140433cb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140433cc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x40);
  return;
}



void Unwind_140433cd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140433ce0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140433cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140188b00(param_2 + 0x48);
  return;
}



void Unwind_140433d00(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x80) & 1) != 0) {
    *(uint *)(param_2 + 0x80) = *(uint *)(param_2 + 0x80) & 0xfffffffe;
    thunk_FUN_140188b00(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Unwind_140433d30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140433d40(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433d60(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433d80(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433da0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433dc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x50);
  return;
}



void Unwind_140433dd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x38);
  return;
}



void Unwind_140433de0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_140433df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_140433e00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140433e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x38);
  return;
}



void Unwind_140433e20(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433e40(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_140433e70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140433e80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_140433e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x58);
  return;
}



void Unwind_140433ea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x68);
  return;
}



void Unwind_140433eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xd8);
  return;
}



void Unwind_140433ec0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x128);
  return;
}



void Unwind_140433ed0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_140433ee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x68);
  return;
}



void Unwind_140433ef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x50);
  return;
}



void Unwind_140433f00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x108);
  return;
}



void Unwind_140433f10(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x78);
  return;
}



void Unwind_140433f40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_140433f50(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433f70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x38);
  return;
}



void Unwind_140433f80(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x48);
  return;
}



void Unwind_140433f90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x40);
  return;
}



void Unwind_140433fa0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433fc0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140433fe0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434000(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434020(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434040(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434060(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140434070(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140434080(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x40);
  return;
}



void Unwind_140434090(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1404340a0(undefined8 param_1,longlong param_2)

{
  FUN_14012cc70(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404340b0(undefined8 param_1,longlong param_2)

{
  FUN_14012bcb0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1404340c0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_1404340d0(undefined8 param_1,longlong param_2)

{
  FUN_14008cfd0(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_1404340e0(undefined8 param_1,longlong param_2)

{
  FUN_1401625e0(*(longlong *)(param_2 + 0x40) + 0x158);
  return;
}



void Unwind_140434100(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1a0);
  return;
}



void Unwind_140434120(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1c0);
  return;
}



void Unwind_140434140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_140434150(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140434160(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434180(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_1404341a0(undefined8 param_1,longlong param_2)

{
  FUN_140176eb0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1404341b0(undefined8 param_1,longlong param_2)

{
  FUN_14008cf80(*(longlong *)(param_2 + 0x70) + 0x2c0);
  return;
}



void Unwind_1404341d0(undefined8 param_1,longlong param_2)

{
  FUN_1400a43a0(*(longlong *)(param_2 + 0x70) + 0x2e0);
  return;
}



void Unwind_1404341f0(undefined8 param_1,longlong param_2)

{
  FUN_1400d3eb0(*(longlong *)(param_2 + 0x70) + 0x300);
  return;
}



void Unwind_140434210(undefined8 param_1,longlong param_2)

{
  FUN_1400ed980(*(longlong *)(param_2 + 0x70) + 800);
  return;
}



void Unwind_140434230(undefined8 param_1,longlong param_2)

{
  FUN_1401168e0(*(longlong *)(param_2 + 0x70) + 0x340);
  return;
}



void Unwind_140434250(undefined8 param_1,longlong param_2)

{
  FUN_1400a4350(*(longlong *)(param_2 + 0x70) + 0x360);
  return;
}



void Unwind_140434270(undefined8 param_1,longlong param_2)

{
  FUN_1400d3f00(*(longlong *)(param_2 + 0x70) + 0x380);
  return;
}



void Unwind_140434290(undefined8 param_1,longlong param_2)

{
  FUN_1400ed9d0(*(longlong *)(param_2 + 0x70) + 0x3a0);
  return;
}



void Unwind_1404342b0(undefined8 param_1,longlong param_2)

{
  FUN_140116840(*(longlong *)(param_2 + 0x70) + 0x3c0);
  return;
}



void Unwind_1404342d0(undefined8 param_1,longlong param_2)

{
  FUN_1402b76c0(*(longlong *)(param_2 + 0x70) + 0x3e0);
  return;
}



void Unwind_1404342f0(undefined8 param_1,longlong param_2)

{
  FUN_140116890(*(longlong *)(param_2 + 0x70) + 0x400);
  return;
}



void Unwind_140434310(undefined8 param_1,longlong param_2)

{
  FUN_140116930(*(longlong *)(param_2 + 0x70) + 0x420);
  return;
}



void Unwind_140434330(undefined8 param_1,longlong param_2)

{
  FUN_140116980(*(longlong *)(param_2 + 0x70) + 0x440);
  return;
}



void Unwind_140434350(undefined8 param_1,longlong param_2)

{
  FUN_1401169d0(*(longlong *)(param_2 + 0x70) + 0x460);
  return;
}



void Unwind_140434370(undefined8 param_1,longlong param_2)

{
  FUN_140116a30(*(longlong *)(param_2 + 0x70) + 0x480);
  return;
}



void Unwind_140434390(undefined8 param_1,longlong param_2)

{
  FUN_140116a80(*(longlong *)(param_2 + 0x70) + 0x4a0);
  return;
}



void Unwind_1404343b0(undefined8 param_1,longlong param_2)

{
  FUN_1401e28a0(*(longlong *)(param_2 + 0x70) + 0x500);
  return;
}



void Unwind_1404343d0(undefined8 param_1,longlong param_2)

{
  FUN_140176230(*(longlong *)(param_2 + 0x70) + 0x530);
  return;
}



void Unwind_1404343f0(undefined8 param_1,longlong param_2)

{
  FUN_140174f90(*(longlong *)(param_2 + 0x70) + 0x5a8);
  return;
}



void Unwind_140434410(undefined8 param_1,longlong param_2)

{
  FUN_140174f90(*(longlong *)(param_2 + 0x70) + 0x5d0);
  return;
}



void Unwind_140434430(undefined8 param_1,longlong param_2)

{
  FUN_140175150(*(longlong *)(param_2 + 0x70) + 0x5f8);
  return;
}



void Unwind_140434450(undefined8 param_1,longlong param_2)

{
  FUN_1401751b0(*(longlong *)(param_2 + 0x70) + 0x618);
  return;
}



void Unwind_140434470(undefined8 param_1,longlong param_2)

{
  FUN_140175210(*(longlong *)(param_2 + 0x70) + 0x638);
  return;
}



void Unwind_140434490(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x658);
  return;
}



void Unwind_1404344b0(undefined8 param_1,longlong param_2)

{
  FUN_140175250(*(longlong *)(param_2 + 0x70) + 0x678);
  return;
}



void Unwind_1404344d0(undefined8 param_1,longlong param_2)

{
  FUN_140175290(*(longlong *)(param_2 + 0x70) + 0x698);
  return;
}



void Unwind_1404344f0(undefined8 param_1,longlong param_2)

{
  FUN_1401752d0(*(longlong *)(param_2 + 0x70) + 0x6b8);
  return;
}



void Unwind_140434510(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x6d8);
  return;
}



void Unwind_140434530(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x6f8);
  return;
}



void Unwind_140434550(undefined8 param_1,longlong param_2)

{
  FUN_140175310(*(longlong *)(param_2 + 0x70) + 0x718);
  return;
}



void Unwind_140434570(undefined8 param_1,longlong param_2)

{
  FUN_140175350(*(longlong *)(param_2 + 0x70) + 0x738);
  return;
}



void Unwind_140434590(undefined8 param_1,longlong param_2)

{
  FUN_140175390(*(longlong *)(param_2 + 0x70) + 0x758);
  return;
}



void Unwind_1404345b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175850(*(longlong *)(param_2 + 0x70) + 0x778);
  return;
}



void Unwind_1404345d0(undefined8 param_1,longlong param_2)

{
  FUN_1401753e0(*(longlong *)(param_2 + 0x70) + 0x798);
  return;
}



void Unwind_1404345f0(undefined8 param_1,longlong param_2)

{
  FUN_1401753e0(*(longlong *)(param_2 + 0x70) + 0x7b8);
  return;
}



void Unwind_140434610(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x7d8);
  return;
}



void Unwind_140434630(undefined8 param_1,longlong param_2)

{
  FUN_140175420(*(longlong *)(param_2 + 0x70) + 0x7f8);
  return;
}



void Unwind_140434650(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x818);
  return;
}



void Unwind_140434670(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x838);
  return;
}



void Unwind_140434690(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x858);
  return;
}



void Unwind_1404346b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x878);
  return;
}



void Unwind_1404346d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x898);
  return;
}



void Unwind_1404346f0(undefined8 param_1,longlong param_2)

{
  FUN_140176250(*(longlong *)(param_2 + 0x70) + 0x8b8);
  return;
}



void Unwind_140434710(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x900);
  return;
}



void Unwind_140434730(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x920);
  return;
}



void Unwind_140434750(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x940);
  return;
}



void Unwind_140434770(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x70) + 0x968);
  return;
}



void Unwind_140434790(undefined8 param_1,longlong param_2)

{
  FUN_1402163b0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1404347a0(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x48);
  return;
}



void Unwind_1404347b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x80);
  return;
}



void Unwind_1404347c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404347d0(undefined8 param_1,longlong param_2)

{
  FUN_14012cc70(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404347e0(undefined8 param_1,longlong param_2)

{
  FUN_14012bcb0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_1404347f0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_140434800(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140434810(undefined8 param_1,longlong param_2)

{
  FUN_14008cfd0(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_140434820(undefined8 param_1,longlong param_2)

{
  FUN_1401625e0(*(longlong *)(param_2 + 0x40) + 0x158);
  return;
}



void Unwind_140434840(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1a0);
  return;
}



void Unwind_140434860(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1c0);
  return;
}



void Unwind_140434880(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x1e0);
  return;
}



void Unwind_1404348a0(undefined8 param_1,longlong param_2)

{
  FUN_140002070(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404348b0(undefined8 param_1,longlong param_2)

{
  FUN_14004b8e0(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1404348c0(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_1404348d0(undefined8 param_1,longlong param_2)

{
  FUN_140168080(param_2 + 0x30);
  return;
}



void Unwind_1404348e0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140434900(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434920(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434940(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434960(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140434980(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_1404349a0(undefined8 param_1,longlong param_2)

{
  FUN_140159960(param_2 + 0x28);
  return;
}



void Unwind_1404349b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1404349d0(undefined8 param_1,longlong param_2)

{
  FUN_14013c120(param_2 + 0x50);
  return;
}



void Unwind_1404349e0(undefined8 param_1,longlong param_2)

{
  FUN_14013c1a0(param_2 + 0x130);
  return;
}



void Catch_All_1404349f0(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_140434a40(undefined8 param_1,longlong param_2)

{
  FUN_140168220(param_2 + 0x20);
  return;
}



void Unwind_140434a50(undefined8 param_1,longlong param_2)

{
  FUN_14012cc50(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140434a60(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140434a67. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140434a70(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140434a77. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140434a80(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140434a87. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140434a90(undefined8 param_1,longlong param_2)

{
  FUN_14012d5c0(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140434aa0(undefined8 param_1,longlong param_2)

{
  FUN_14027dc20(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_140434ab0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140434ac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(longlong *)(param_2 + 0x48) + 0x10);
  return;
}



void Unwind_140434ad0(undefined8 param_1,longlong param_2)

{
  FUN_1403555d0(*(longlong *)(param_2 + 0x48) + 0x28);
  return;
}



void Unwind_140434ae0(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 0x40);
  return;
}



void Unwind_140434af0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_140434b00(undefined8 param_1,longlong param_2)

{
  FUN_140002070(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140434b10(undefined8 param_1,longlong param_2)

{
  FUN_14029ca80(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_140434b20(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_140434b30(undefined8 param_1,longlong param_2)

{
  FUN_14029cad0(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_140434b40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_140434b60(undefined8 param_1,longlong param_2)

{
  FUN_1401293d0(param_2 + 0x28);
  return;
}



void Unwind_140434b70(undefined8 param_1,longlong param_2)

{
  FUN_140129a20(param_2 + 0x28);
  return;
}



void Unwind_140434b80(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x80),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140434ba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x68);
  return;
}



void Unwind_140434bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140434bc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x148);
  return;
}



void Unwind_140434bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_140434be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_140434bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_140434c00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140434c10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140434c20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_140434c30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140434c40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_140434c50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140434c60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_140434c70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2d0);
  return;
}



void Unwind_140434c80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434c90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434ca0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434cb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140434cc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434cd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434ce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140434cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_140434d00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140434d10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c0);
  return;
}



void Unwind_140434d20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434d30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2d0);
  return;
}



void Unwind_140434d40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434d50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434d60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140434d70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434d80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434d90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140434db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d8);
  return;
}



void Unwind_140434dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434dd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2d0);
  return;
}



void Unwind_140434de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434df0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434e00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140434e10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434e20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_140434e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140434e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c8);
  return;
}



void Unwind_140434e50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434e60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2d0);
  return;
}



void Unwind_140434e70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434e80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140434ea0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434eb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434ec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140434ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_140434ee0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434ef0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x2d0);
  return;
}



void Unwind_140434f00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434f10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434f20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140434f30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140434f40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140434f50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_140434f60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140434f70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140434f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_140434f90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140434fa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x248);
  return;
}



void Unwind_140434fb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140434fc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_140434fd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140434fe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_140434ff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140435000(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_140435010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140435020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_140435030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140435040(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_140435050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140435060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x240);
  return;
}



void Unwind_140435070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140435080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x78);
  return;
}



void Unwind_140435090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404350a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_1404350b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2c0));
  return;
}



void Unwind_1404350c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404350d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x230);
  return;
}



void Unwind_1404350e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1404350f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140435100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_140435110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140435120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140435130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_140435140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140435150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140435160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_140435170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140435180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140435190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_1404351a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1404351b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404351c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_1404351d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_1404351e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_1404351f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140435200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x238);
  return;
}



void Unwind_140435210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Catch_All_140435220(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x48));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140435250(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140435270(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140435290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x70);
  return;
}



void Unwind_1404352a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404352b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1404352c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_1404352d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_1404352e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x160);
  return;
}



void Unwind_1404352f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435300(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x238);
  return;
}



void Unwind_140435310(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435320(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_140435340(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_140435360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140435370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x170);
  return;
}



void Unwind_140435380(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x238);
  return;
}



void Unwind_1404353a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_1404353b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_1404353c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1404353d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_1404353e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_1404353f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140435400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x158);
  return;
}



void Unwind_140435410(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435420(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x238);
  return;
}



void Unwind_140435430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435440(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_140435460(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x218);
  return;
}



void Unwind_140435470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_140435480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140435490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x188);
  return;
}



void Unwind_1404354a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x178);
  return;
}



void Unwind_1404354b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404354c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404354d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404354e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_1404354f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140435500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140435510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_140435520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140435530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x168);
  return;
}



void Unwind_140435540(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140435550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x178);
  return;
}



void Unwind_140435560(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140435570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140435580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_140435590(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404355a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404355b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_1404355c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_1404355d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404355e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x178);
  return;
}



void Unwind_1404355f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_140435600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_140435610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140435620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_140435630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_140435640(undefined8 param_1,longlong param_2)

{
  FUN_140011410(param_2 + 0x30);
  return;
}



void Unwind_140435650(undefined8 param_1,longlong param_2)

{
  FUN_140011410(param_2 + 0x30);
  return;
}



void Unwind_140435660(undefined8 param_1,longlong param_2)

{
  FUN_140011410(param_2 + 0x30);
  return;
}



void Unwind_140435670(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140435677. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x60));
  return;
}



void Unwind_140435680(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x40);
  return;
}



void Unwind_140435690(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x50);
  return;
}



void Unwind_1404356a0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x50);
  return;
}



void Unwind_1404356b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_1404356c0(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x68);
  return;
}



void Unwind_1404356d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1404356e0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xb0);
  return;
}



void Unwind_1404356f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140435700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_140435710(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x70);
  return;
}



void Unwind_140435720(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_140435730(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x58);
  return;
}



void Unwind_140435740(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140435750(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xd0);
  return;
}



void Unwind_140435760(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_140435770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_140435780(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x70);
  return;
}



void Unwind_140435790(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404357a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_1404357b0(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x70);
  return;
}



void Unwind_1404357c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404357d0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x38);
  return;
}



void Unwind_1404357e0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x78);
  return;
}



void Unwind_1404357f0(undefined8 param_1,longlong param_2)

{
  FUN_14016ec80(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140435800(undefined8 param_1,longlong param_2)

{
  FUN_14000d690(*(longlong *)(param_2 + 0x40) + 0x9a0);
  return;
}



void Unwind_140435820(undefined8 param_1,longlong param_2)

{
  FUN_140017490(*(longlong *)(param_2 + 0x40) + 0x9a8);
  return;
}



void Unwind_140435840(undefined8 param_1,longlong param_2)

{
  FUN_140017440(*(longlong *)(param_2 + 0x40) + 0x9c8);
  return;
}



void Unwind_140435860(undefined8 param_1,longlong param_2)

{
  FUN_14000c870(*(longlong *)(param_2 + 0x40) + 0x9e8);
  return;
}



void Unwind_140435880(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0xa58);
  return;
}



void Unwind_1404358a0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_1404358c0(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_1404358e0(undefined8 param_1,longlong param_2)

{
  FUN_140345db0(param_2 + 0x28);
  return;
}



void Unwind_1404358f0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x68),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140435910(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_140435920(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_140435940(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_140435960(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_140435980(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_1404359a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x120);
  return;
}



void Unwind_1404359c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x148);
  return;
}



void Unwind_1404359e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_140435a00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_140435a20(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140435a30(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_140435a40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_140435a50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_140435a60(undefined8 param_1,longlong param_2)

{
  FUN_140320420(param_2 + 0x28);
  return;
}



void Unwind_140435a70(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x80),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140435a90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140435aa0(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140435ac0(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140435ae0(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140435b00(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140435b20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x128);
  return;
}



void Unwind_140435b40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x150);
  return;
}



void Unwind_140435b60(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x178);
  return;
}



void Unwind_140435b80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1a0);
  return;
}



void Unwind_140435ba0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1c8);
  return;
}



void Unwind_140435bc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1f0);
  return;
}



void Unwind_140435be0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x218);
  return;
}



void Unwind_140435c00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x240);
  return;
}



void Unwind_140435c20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x268);
  return;
}



void Unwind_140435c40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x290);
  return;
}



void Unwind_140435c60(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x2b8);
  return;
}



void Unwind_140435c80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x2e0);
  return;
}



void Unwind_140435ca0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x308);
  return;
}



void Unwind_140435cc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x330);
  return;
}



void Unwind_140435ce0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x358);
  return;
}



void Unwind_140435d00(undefined8 param_1,longlong param_2)

{
  FUN_14030ac20(param_2 + 0xe0);
  return;
}



void Unwind_140435d10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xb0);
  return;
}



void Unwind_140435d20(undefined8 param_1,longlong param_2)

{
  FUN_14030d9d0(param_2 + 0xe0);
  return;
}



void Unwind_140435d30(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(param_2 + 0x100);
  return;
}



void Unwind_140435d40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x138);
  return;
}



void Unwind_140435d50(undefined8 param_1,longlong param_2)

{
  FUN_14030da30(param_2 + 0x168);
  return;
}



void Unwind_140435d70(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140435d77. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(*(basic_streambuf<> **)(param_2 + 0x48));
  return;
}



void Unwind_140435d80(undefined8 param_1,longlong param_2)

{
  FUN_14030ac20(param_2 + 0x200);
  return;
}



void Unwind_140435d90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x88);
  return;
}



void Unwind_140435da0(undefined8 param_1,longlong param_2)

{
  FUN_14030d9d0(param_2 + 0x200);
  return;
}



void Unwind_140435db0(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(param_2 + 0x220);
  return;
}



void Unwind_140435dc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 600);
  return;
}



void Unwind_140435dd0(undefined8 param_1,longlong param_2)

{
  FUN_14030da30(param_2 + 0x288);
  return;
}



void Unwind_140435df0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140435df7. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(*(basic_streambuf<> **)(param_2 + 0x50));
  return;
}



void Unwind_140435e00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x60);
  return;
}



void Unwind_140435e10(undefined8 param_1,longlong param_2)

{
  FUN_1402ca690(param_2 + 0x28);
  return;
}



void Unwind_140435e20(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140435e40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140435e50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_140435e60(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_140435e70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_140435e90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_140435eb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x138);
  return;
}



void Unwind_140435ed0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x158);
  return;
}



void Unwind_140435ef0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x178);
  return;
}



void Unwind_140435f10(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x198);
  return;
}



void Unwind_140435f30(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1c0);
  return;
}



void Unwind_140435f50(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1e0);
  return;
}



void Unwind_140435f70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x200);
  return;
}



void Unwind_140435f90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x220);
  return;
}



void Unwind_140435fb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x270);
  return;
}



void Unwind_140435fd0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x290);
  return;
}



void Unwind_140435ff0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x2b0);
  return;
}



void Unwind_140436010(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140436020(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xb8);
  return;
}



void Unwind_140436040(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xd8);
  return;
}



void Unwind_140436060(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_140436080(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x118);
  return;
}



void Unwind_1404360a0(undefined8 param_1,longlong param_2)

{
  FUN_140129050(*(longlong *)(param_2 + 0x40) + 0x138);
  return;
}



void Unwind_1404360c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x168);
  return;
}



void Unwind_1404360e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x188);
  return;
}



void Unwind_140436100(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1d0);
  return;
}



void Unwind_140436120(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1f8);
  return;
}



void Catch_All_140436140(void)

{
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140436160(undefined8 param_1,longlong param_2)

{
  FUN_1402cb090(param_2 + 0x28);
  return;
}



void Unwind_140436170(undefined8 param_1,longlong param_2)

{
  FUN_1402cb750(param_2 + 0x30);
  return;
}



void Unwind_140436180(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1404361a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_1404361b0(undefined8 param_1,longlong param_2)

{
  FUN_1402c3270(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404361c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1404361d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_1404361e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140436200(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xb0);
  return;
}



void Unwind_140436220(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xd8);
  return;
}



void Unwind_140436240(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xe8);
  return;
}



void Unwind_140436260(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x40);
  return;
}



void Unwind_140436270(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd0);
  return;
}



void Unwind_140436280(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_140436290(undefined8 param_1,longlong param_2)

{
  FUN_140167b70(param_2 + 0x70);
  return;
}



void Unwind_1404362a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_1404362b0(undefined8 param_1,longlong param_2)

{
  FUN_140167b70(param_2 + 0x110);
  return;
}



void Unwind_1404362c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x20);
  return;
}



void Unwind_1404362d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x50);
  return;
}



void Unwind_1404362e0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1404362f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_140436300(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x40);
  return;
}



void Unwind_140436310(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_140436320(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(*(longlong *)(param_2 + 0x40) + 0xd8);
  return;
}



void Unwind_140436340(undefined8 param_1,longlong param_2)

{
  FUN_1402c61f0(*(longlong *)(param_2 + 0x40) + 0x100);
  return;
}



void Unwind_140436360(undefined8 param_1,longlong param_2)

{
  FUN_14012dd10(param_2 + 0x58);
  return;
}



void Unwind_140436370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140436390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_1404363a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_1404363b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404363c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404363d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404363e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404363f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140436400(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140436410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_140436430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140436440(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140436450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140436460(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140436470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140436480(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140436490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1404364a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404364b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_1404364c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404364d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1404364e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1404364f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140436510(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436520(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_140436550(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436560(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140436570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436580(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1404365a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1404365b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404365c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_1404365d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1404365e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404365f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140436620(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140436640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x230);
  return;
}



void Unwind_140436660(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140436670(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140436680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140436690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404366a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x238);
  return;
}



void Unwind_1404366b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1404366c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1404366d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404366e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x248);
  return;
}



void Unwind_1404366f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140436700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_140436720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140436730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140436740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_140436760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_140436770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140436780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_1404367a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1404367b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1404367c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_1404367d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x240);
  return;
}



void Unwind_1404367e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1404367f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140436800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_140436820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140436830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_140436840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x40);
  return;
}



void Unwind_140436850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_140436860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140436870(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x40);
  return;
}



void Unwind_140436880(undefined8 param_1,longlong param_2)

{
  FUN_14027aa80(param_2 + 0x28);
  return;
}



void Unwind_140436890(undefined8 param_1,longlong param_2)

{
  FUN_14027b040(param_2 + 0x30);
  return;
}



void Unwind_1404368a0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_1404368c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x98));
  return;
}



void Unwind_1404368d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404368e0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_1404368f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x40);
  return;
}



void Unwind_140436900(undefined8 param_1,longlong param_2)

{
  FUN_1402731e0(param_2 + 0x38);
  return;
}



void Unwind_140436910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140436920(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x40);
  return;
}



void Unwind_140436930(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x40);
  return;
}



void Catch_All_140436940(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_140253d30();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140436980(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404369b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404369c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140253d30(param_2 + 0x38);
  return;
}



void Unwind_1404369d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x70);
  return;
}



void Unwind_1404369e0(undefined8 param_1,longlong param_2)

{
  FUN_140247e00(param_2 + 0x28);
  return;
}



void Unwind_1404369f0(undefined8 param_1,longlong param_2)

{
  FUN_140247e00(param_2 + 0x28);
  return;
}



void Unwind_140436a00(undefined8 param_1,longlong param_2)

{
  FUN_140247c60(param_2 + 0x28);
  return;
}



void Unwind_140436a10(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x90),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140436a40(undefined8 param_1,longlong param_2)

{
  FUN_140247c60(param_2 + 0x28);
  return;
}



void Unwind_140436a50(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x98),*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140436a80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_140436a90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(param_2 + 0x70);
  return;
}



void Unwind_140436aa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_140436ab0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x28);
  return;
}



void Unwind_140436ac0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_140436ad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x30);
  return;
}



void Unwind_140436ae0(void)

{
  DAT_14060b7cc = DAT_14060b7cc & 0xfffffffe;
  return;
}



void Unwind_140436b00(undefined8 param_1,longlong param_2)

{
  FUN_1402163b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140436b10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140436b20(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436b40(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140436b60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140436b70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140436b80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_140436b90(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x38);
  return;
}



void Unwind_140436ba0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436bc0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436be0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436c00(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436c20(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140436c30(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140436c50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x28);
  return;
}



void Unwind_140436c60(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x88);
  return;
}



void Unwind_140436c70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_140436c80(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x78);
  return;
}



void Unwind_140436c90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140436ca0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xb0);
  return;
}



void Unwind_140436cb0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xa0);
  return;
}



void Unwind_140436cc0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x58);
  return;
}



void Unwind_140436cd0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_140436ce0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x38);
  return;
}



void Unwind_140436cf0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140436d00(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x50);
  return;
}



void Unwind_140436d10(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_140436d20(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xf0);
  return;
}



void Unwind_140436d30(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x70);
  return;
}



void Unwind_140436d40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xe0);
  return;
}



void Unwind_140436d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xd0);
  return;
}



void Unwind_140436d60(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x78);
  return;
}



void Unwind_140436d70(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_140436d80(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x90);
  return;
}



void Unwind_140436d90(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x80);
  return;
}



void Unwind_140436da0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xf0);
  return;
}



void Unwind_140436db0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x88);
  return;
}



void Unwind_140436dc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xd0);
  return;
}



void Unwind_140436dd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xe0);
  return;
}



void Unwind_140436de0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xa8);
  return;
}



void Unwind_140436df0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x50);
  return;
}



void Unwind_140436e00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x98);
  return;
}



void Unwind_140436e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x88);
  return;
}



void Unwind_140436e20(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xe0);
  return;
}



void Unwind_140436e30(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x80);
  return;
}



void Unwind_140436e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xd0);
  return;
}



void Unwind_140436e50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xc0);
  return;
}



void Unwind_140436e60(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xb0);
  return;
}



void Unwind_140436e70(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x58);
  return;
}



void Unwind_140436e80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x90);
  return;
}



void Unwind_140436e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xa0);
  return;
}



void Unwind_140436ea0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0xb8);
  return;
}



void Unwind_140436eb0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x60);
  return;
}



void Unwind_140436ec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x98);
  return;
}



void Unwind_140436ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xa8);
  return;
}



void Unwind_140436ee0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436f00(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x38);
  return;
}



void Unwind_140436f10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140436f20(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x38);
  return;
}



void Unwind_140436f30(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436f50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140436f60(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436f80(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x38);
  return;
}



void Unwind_140436f90(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140436fb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140436fc0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x58);
  return;
}



void Unwind_140436fd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140436fe0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x38);
  return;
}



void Unwind_140436ff0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140437000(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x98);
  return;
}



void Unwind_140437010(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_140437020(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x78);
  return;
}



void Unwind_140437030(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_140437040(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437050(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437060(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437070(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437080(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437090(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404370a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404370b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404370c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404370d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404370e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404370f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437100(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437110(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437120(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437130(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437140(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437150(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437160(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437170(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437180(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437190(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404371a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404371b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404371c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404371d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404371e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404371f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437200(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437210(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437220(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437230(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437240(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437250(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437260(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437270(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437280(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437290(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404372a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404372b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404372c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404372d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404372e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_1404372f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437300(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437310(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437320(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437330(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437340(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437350(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140437360(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140437380(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_1404373a0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404373b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404373c0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x38);
  return;
}



void Unwind_1404373d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404373e0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140437400(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140437420(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x48);
  return;
}



void Unwind_140437430(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140437440(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x28);
  return;
}



void Unwind_140437450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Catch_All_140437460(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_1404374b0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404374b7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_1404374c0(undefined8 param_1,longlong param_2)

{
  FUN_140168080(param_2 + 0x28);
  return;
}



void Unwind_1404374d0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x68),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1404374f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_140437500(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_140437510(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_140437520(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_140437540(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_140437550(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_140437560(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_140437570(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x78);
  return;
}



void Unwind_140437580(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140437590(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1404375a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1404375b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1404375c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1404375d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_1404375e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1404375f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x60);
  return;
}



void Unwind_140437600(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_140437620(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0x1a8);
  return;
}



void Unwind_140437640(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x200);
  return;
}



void Unwind_140437660(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x228);
  return;
}



void Unwind_140437680(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x248);
  return;
}



void Unwind_1404376a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x10);
  return;
}



void Unwind_1404376b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x30);
  return;
}



void Unwind_1404376c0(undefined8 param_1,longlong param_2)

{
  FUN_140129a20(param_2 + 0x28);
  return;
}



void Unwind_1404376d0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x68),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_1404376f0(undefined8 param_1,longlong param_2)

{
  FUN_140129010(param_2 + 0x48);
  return;
}



void Unwind_140437700(undefined8 param_1,longlong param_2)

{
  FUN_140127c40(param_2 + 0x20);
  return;
}



void Unwind_140437710(undefined8 param_1,longlong param_2)

{
  FUN_140127c40(param_2 + 0x68);
  return;
}



void Unwind_140437720(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 0xb0);
  return;
}



void Unwind_140437730(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x88);
  return;
}



void Unwind_140437740(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_140437750(undefined8 param_1,longlong param_2)

{
  FUN_140129010(param_2 + 0x20);
  return;
}



void Unwind_140437760(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140437780(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x48) + 8);
  return;
}



void Unwind_140437790(undefined8 param_1,longlong param_2)

{
  FUN_140127c40(param_2 + 0x88);
  return;
}



void Unwind_1404377a0(undefined8 param_1,longlong param_2)

{
  FUN_140127c40(param_2 + 0x110);
  return;
}



void Unwind_1404377b0(undefined8 param_1,longlong param_2)

{
  FUN_14000f470(param_2 + 0x60);
  return;
}



void Unwind_1404377c0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0xc0);
  return;
}



void Unwind_1404377d0(undefined8 param_1,longlong param_2)

{
  FUN_1400034f0(param_2 + 0x60);
  return;
}



void Unwind_1404377e0(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x60);
  return;
}



void Unwind_1404377f0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x98);
  return;
}



void Unwind_140437800(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x150);
  return;
}



void Unwind_140437810(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_140437820(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x150);
  return;
}



void Unwind_140437830(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_140437840(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x150);
  return;
}



void Unwind_140437850(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_140437860(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x150);
  return;
}



void Unwind_140437870(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_140437880(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x150);
  return;
}



void Unwind_140437890(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_1404378a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_1404378b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_1404378c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_1404378d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_1404378e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_1404378f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437910(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437930(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x80);
  return;
}



void Unwind_140437950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c0);
  return;
}



void Unwind_140437970(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437980(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437990(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404379a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404379b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_1404379c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404379d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404379e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_1404379f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b8);
  return;
}



void Unwind_140437a00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437a10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437a20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437a30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437a40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2c8));
  return;
}



void Unwind_140437a50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437a60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_140437a70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_140437a80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437a90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437aa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437ab0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437ac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2c8));
  return;
}



void Unwind_140437ad0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437ae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437af0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c8);
  return;
}



void Unwind_140437b00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437b10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437b20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437b30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437b40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437b50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437b60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437b70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d8);
  return;
}



void Unwind_140437b80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437b90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437bb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437bc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437bd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_140437c00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140437c10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140437c20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437c30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437c40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_140437c50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437c60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437c70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_140437c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437c90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437ca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_140437cb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437cc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x2c8);
  return;
}



void Unwind_140437cd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_140437ce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_140437cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437d00(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(param_2 + 0x58);
  return;
}



void Unwind_140437d10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_140437d20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_140437d30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x2c8));
  return;
}



void Unwind_140437d40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_140437d60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437d70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_140437d80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_140437d90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x88));
  return;
}



void Unwind_140437da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4c0);
  return;
}



void Unwind_140437db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1120);
  return;
}



void Unwind_140437dc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 200));
  return;
}



void Unwind_140437dd0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1750);
  return;
}



void Unwind_140437de0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140437df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd30);
  return;
}



void Unwind_140437e00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140437e20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd40);
  return;
}



void Unwind_140437e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437e40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1690);
  return;
}



void Unwind_140437e50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 600);
  return;
}



void Unwind_140437e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd50);
  return;
}



void Unwind_140437e70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437e80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x308);
  return;
}



void Unwind_140437e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd60);
  return;
}



void Unwind_140437ea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa88);
  return;
}



void Unwind_140437ec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a0);
  return;
}



void Unwind_140437ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd70);
  return;
}



void Unwind_140437ee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437ef0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x17d0);
  return;
}



void Unwind_140437f00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140437f10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd80);
  return;
}



void Unwind_140437f20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0xab0);
  return;
}



void Unwind_140437f40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x658);
  return;
}



void Unwind_140437f50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd90);
  return;
}



void Unwind_140437f60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437f70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a8);
  return;
}



void Unwind_140437f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xda0);
  return;
}



void Unwind_140437f90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437fa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5d0);
  return;
}



void Unwind_140437fb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdb0);
  return;
}



void Unwind_140437fc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140437fd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x298);
  return;
}



void Unwind_140437fe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdc0);
  return;
}



void Unwind_140437ff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x580);
  return;
}



void Unwind_140438010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdd0);
  return;
}



void Unwind_140438020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438030(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1710);
  return;
}



void Unwind_140438040(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1790);
  return;
}



void Unwind_140438050(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x16d0);
  return;
}



void Unwind_140438060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_140438070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xde0);
  return;
}



void Unwind_140438080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b8);
  return;
}



void Unwind_1404380a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdf0);
  return;
}



void Unwind_1404380b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404380c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x160);
  return;
}



void Unwind_1404380d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe00);
  return;
}



void Unwind_1404380e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404380f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_140438100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe10);
  return;
}



void Unwind_140438110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x330);
  return;
}



void Unwind_140438130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe20);
  return;
}



void Unwind_140438140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438150(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1630);
  return;
}



void Unwind_140438160(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1810);
  return;
}



void Unwind_140438170(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(param_2 + 0x4508);
  return;
}



void Unwind_140438180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x170);
  return;
}



void Unwind_140438190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe30);
  return;
}



void Unwind_1404381a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404381b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x370);
  return;
}



void Unwind_1404381c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe40);
  return;
}



void Unwind_1404381d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404381e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x558);
  return;
}



void Unwind_1404381f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe50);
  return;
}



void Unwind_140438200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x290);
  return;
}



void Unwind_140438220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe60);
  return;
}



void Unwind_140438230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_140438250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe70);
  return;
}



void Unwind_140438260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4d8);
  return;
}



void Unwind_140438280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe80);
  return;
}



void Unwind_140438290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404382a0(undefined8 param_1,longlong param_2)

{
  FUN_1400d3df0(param_2 + 0x8240);
  return;
}



void Unwind_1404382b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_1404382c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe90);
  return;
}



void Unwind_1404382d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404382e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x268);
  return;
}



void Unwind_1404382f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xea0);
  return;
}



void Unwind_140438300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x568);
  return;
}



void Unwind_140438320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xeb0);
  return;
}



void Unwind_140438330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4e8);
  return;
}



void Unwind_140438350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xec0);
  return;
}



void Unwind_140438360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140438380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xed0);
  return;
}



void Unwind_140438390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404383a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x628);
  return;
}



void Unwind_1404383b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xee0);
  return;
}



void Unwind_1404383c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404383d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x578);
  return;
}



void Unwind_1404383e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xef0);
  return;
}



void Unwind_1404383f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4f8);
  return;
}



void Unwind_140438410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf00);
  return;
}



void Unwind_140438420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x340);
  return;
}



void Unwind_140438440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf10);
  return;
}



void Unwind_140438450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x390);
  return;
}



void Unwind_140438470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf20);
  return;
}



void Unwind_140438480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_1404384a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf30);
  return;
}



void Unwind_1404384b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404384c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_1404384d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf40);
  return;
}



void Unwind_1404384e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404384f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140438500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf50);
  return;
}



void Unwind_140438510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140438530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf60);
  return;
}



void Unwind_140438540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x238);
  return;
}



void Unwind_140438560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf70);
  return;
}



void Unwind_140438570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_140438590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf80);
  return;
}



void Unwind_1404385a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404385b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x288);
  return;
}



void Unwind_1404385c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf90);
  return;
}



void Unwind_1404385d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404385e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x350);
  return;
}



void Unwind_1404385f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 4000);
  return;
}



void Unwind_140438600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5f8);
  return;
}



void Unwind_140438620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfb0);
  return;
}



void Unwind_140438630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a0);
  return;
}



void Unwind_140438650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfc0);
  return;
}



void Unwind_140438660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x498);
  return;
}



void Unwind_140438680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfd0);
  return;
}



void Unwind_140438690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404386a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x380);
  return;
}



void Unwind_1404386b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfe0);
  return;
}



void Unwind_1404386c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404386d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x648);
  return;
}



void Unwind_1404386e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xff0);
  return;
}



void Unwind_1404386f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c8);
  return;
}



void Unwind_140438710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1000);
  return;
}



void Unwind_140438720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x588);
  return;
}



void Unwind_140438740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1010);
  return;
}



void Unwind_140438750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x360);
  return;
}



void Unwind_140438770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1020);
  return;
}



void Unwind_140438780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x608);
  return;
}



void Unwind_1404387a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1030);
  return;
}



void Unwind_1404387b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404387c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_1404387d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1040);
  return;
}



void Unwind_1404387e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404387f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0xaa0);
  return;
}



void Unwind_140438800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_140438810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1050);
  return;
}



void Unwind_140438820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0xac0);
  return;
}



void Unwind_140438840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x248);
  return;
}



void Unwind_140438850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1060);
  return;
}



void Unwind_140438860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5d8);
  return;
}



void Unwind_140438880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1070);
  return;
}



void Unwind_140438890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404388a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d8);
  return;
}



void Unwind_1404388b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1080);
  return;
}



void Unwind_1404388c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404388d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x638);
  return;
}



void Unwind_1404388e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1090);
  return;
}



void Unwind_1404388f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c0);
  return;
}



void Unwind_140438910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10a0);
  return;
}



void Unwind_140438920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x278);
  return;
}



void Unwind_140438940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10b0);
  return;
}



void Unwind_140438950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 800);
  return;
}



void Unwind_140438970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10c0);
  return;
}



void Unwind_140438980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x198);
  return;
}



void Unwind_1404389a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10d0);
  return;
}



void Unwind_1404389b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404389c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x328);
  return;
}



void Unwind_1404389d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10e0);
  return;
}



void Unwind_1404389e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404389f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x338);
  return;
}



void Unwind_140438a00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10f0);
  return;
}



void Unwind_140438a10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438a20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x508);
  return;
}



void Unwind_140438a30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1100);
  return;
}



void Unwind_140438a40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438a50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x618);
  return;
}



void Unwind_140438a60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1110);
  return;
}



void Unwind_140438a70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438a80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x598);
  return;
}



void Unwind_140438a90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd20);
  return;
}



void Unwind_140438aa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438ab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5e0);
  return;
}



void Unwind_140438ac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1130);
  return;
}



void Unwind_140438ad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438ae0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1670);
  return;
}



void Unwind_140438af0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x518);
  return;
}



void Unwind_140438b00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1140);
  return;
}



void Unwind_140438b10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438b20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140438b30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1150);
  return;
}



void Unwind_140438b40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438b50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_140438b60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1160);
  return;
}



void Unwind_140438b70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438b80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf8);
  return;
}



void Unwind_140438b90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1170);
  return;
}



void Unwind_140438ba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438bb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x108);
  return;
}



void Unwind_140438bc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1180);
  return;
}



void Unwind_140438bd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_140438bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1190);
  return;
}



void Unwind_140438c00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438c10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x310);
  return;
}



void Unwind_140438c20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd28);
  return;
}



void Unwind_140438c30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438c40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x318);
  return;
}



void Unwind_140438c50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd48);
  return;
}



void Unwind_140438c60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438c70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5a8);
  return;
}



void Unwind_140438c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd68);
  return;
}



void Unwind_140438c90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438ca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_140438cb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd88);
  return;
}



void Unwind_140438cc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438cd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_140438ce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xda8);
  return;
}



void Unwind_140438cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438d00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3d8);
  return;
}



void Unwind_140438d10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdc8);
  return;
}



void Unwind_140438d20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438d30(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x16b0);
  return;
}



void Unwind_140438d40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x528);
  return;
}



void Unwind_140438d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xde8);
  return;
}



void Unwind_140438d60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438d70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x348);
  return;
}



void Unwind_140438d80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe08);
  return;
}



void Unwind_140438d90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x358);
  return;
}



void Unwind_140438db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe28);
  return;
}



void Unwind_140438dc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438dd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa90);
  return;
}



void Unwind_140438de0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_140438df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe48);
  return;
}



void Unwind_140438e00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438e10(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x16f0);
  return;
}



void Unwind_140438e20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5b8);
  return;
}



void Unwind_140438e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe68);
  return;
}



void Unwind_140438e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438e50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x368);
  return;
}



void Unwind_140438e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe88);
  return;
}



void Unwind_140438e70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438e80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1610);
  return;
}



void Unwind_140438e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140438ea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xea8);
  return;
}



void Unwind_140438eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438ec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5c8);
  return;
}



void Unwind_140438ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xec8);
  return;
}



void Unwind_140438ee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438ef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x540);
  return;
}



void Unwind_140438f00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xee8);
  return;
}



void Unwind_140438f10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438f20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5c0);
  return;
}



void Unwind_140438f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf08);
  return;
}



void Unwind_140438f40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438f50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x188);
  return;
}



void Unwind_140438f60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf28);
  return;
}



void Unwind_140438f70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_140438f90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf48);
  return;
}



void Unwind_140438fa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438fb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x378);
  return;
}



void Unwind_140438fc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf68);
  return;
}



void Unwind_140438fd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140438fe0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1730);
  return;
}



void Unwind_140438ff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140439000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf88);
  return;
}



void Unwind_140439010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x550);
  return;
}



void Unwind_140439030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfa8);
  return;
}



void Unwind_140439040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5e8);
  return;
}



void Unwind_140439060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfc8);
  return;
}



void Unwind_140439070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x590);
  return;
}



void Unwind_140439090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfe8);
  return;
}



void Unwind_1404390a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404390b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5f0);
  return;
}



void Unwind_1404390c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1008);
  return;
}



void Unwind_1404390d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404390e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x560);
  return;
}



void Unwind_1404390f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1028);
  return;
}



void Unwind_140439100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x600);
  return;
}



void Unwind_140439120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1048);
  return;
}



void Unwind_140439130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5b0);
  return;
}



void Unwind_140439150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1068);
  return;
}



void Unwind_140439160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x610);
  return;
}



void Unwind_140439180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1088);
  return;
}



void Unwind_140439190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404391a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x620);
  return;
}



void Unwind_1404391b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10a8);
  return;
}



void Unwind_1404391c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404391d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 6000);
  return;
}



void Unwind_1404391e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_1404391f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10c8);
  return;
}



void Unwind_140439200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x570);
  return;
}



void Unwind_140439220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x10e8);
  return;
}



void Unwind_140439230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x5a0);
  return;
}



void Unwind_140439250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1108);
  return;
}



void Unwind_140439260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x630);
  return;
}



void Unwind_140439280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1128);
  return;
}



void Unwind_140439290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404392a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x17b0);
  return;
}



void Unwind_1404392b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_1404392c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1148);
  return;
}



void Unwind_1404392d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404392e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x17f0);
  return;
}



void Unwind_1404392f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa98);
  return;
}



void Unwind_140439300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 400);
  return;
}



void Unwind_140439310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1168);
  return;
}



void Unwind_140439320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x168);
  return;
}



void Unwind_140439340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1188);
  return;
}



void Unwind_140439350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_140439370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x11a8);
  return;
}



void Unwind_140439380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_1404393a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x11c8);
  return;
}



void Unwind_1404393b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404393c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_1404393d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x11e8);
  return;
}



void Unwind_1404393e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404393f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x230);
  return;
}



void Unwind_140439400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1208);
  return;
}



void Unwind_140439410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x388);
  return;
}



void Unwind_140439430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1228);
  return;
}



void Unwind_140439440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x530);
  return;
}



void Unwind_140439460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1248);
  return;
}



void Unwind_140439470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x538);
  return;
}



void Unwind_140439490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1268);
  return;
}



void Unwind_1404394a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404394b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_1404394c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1288);
  return;
}



void Unwind_1404394d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404394e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x180);
  return;
}



void Unwind_1404394f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x12a8);
  return;
}



void Unwind_140439500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd8);
  return;
}



void Unwind_140439520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x12c8);
  return;
}



void Unwind_140439530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x640);
  return;
}



void Unwind_140439550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x12e8);
  return;
}



void Unwind_140439560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x548);
  return;
}



void Unwind_140439580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1308);
  return;
}



void Unwind_140439590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404395a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x240);
  return;
}



void Unwind_1404395b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1328);
  return;
}



void Unwind_1404395c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404395d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_1404395e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1348);
  return;
}



void Unwind_1404395f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xaa8);
  return;
}



void Unwind_140439610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x398);
  return;
}



void Unwind_140439620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1368);
  return;
}



void Unwind_140439630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x250);
  return;
}



void Unwind_140439650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 5000);
  return;
}



void Unwind_140439660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4c8);
  return;
}



void Unwind_140439680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x13a8);
  return;
}



void Unwind_140439690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404396a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3a8);
  return;
}



void Unwind_1404396b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x13c8);
  return;
}



void Unwind_1404396c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404396d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4d0);
  return;
}



void Unwind_1404396e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x13e8);
  return;
}



void Unwind_1404396f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439700(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1830);
  return;
}



void Unwind_140439710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140439720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1408);
  return;
}



void Unwind_140439730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x260);
  return;
}



void Unwind_140439750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1428);
  return;
}



void Unwind_140439760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4e0);
  return;
}



void Unwind_140439780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1448);
  return;
}



void Unwind_140439790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404397a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4f0);
  return;
}



void Unwind_1404397b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1468);
  return;
}



void Unwind_1404397c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404397d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x650);
  return;
}



void Unwind_1404397e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1488);
  return;
}



void Unwind_1404397f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xac8);
  return;
}



void Unwind_140439810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xab8);
  return;
}



void Unwind_140439820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x270);
  return;
}



void Unwind_140439830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x14a8);
  return;
}



void Unwind_140439840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x660);
  return;
}



void Unwind_140439860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x14c8);
  return;
}



void Unwind_140439870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439880(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1650);
  return;
}



void Unwind_140439890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_1404398a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x14e8);
  return;
}



void Unwind_1404398b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404398c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3a0);
  return;
}



void Unwind_1404398d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1508);
  return;
}



void Unwind_1404398e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404398f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_140439900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1528);
  return;
}



void Unwind_140439910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_140439930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1548);
  return;
}



void Unwind_140439940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x280);
  return;
}



void Unwind_140439960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1568);
  return;
}



void Unwind_140439970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b0);
  return;
}



void Unwind_140439990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1588);
  return;
}



void Unwind_1404399a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404399b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x500);
  return;
}



void Unwind_1404399c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x15a8);
  return;
}



void Unwind_1404399d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_1404399e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x510);
  return;
}



void Unwind_1404399f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x15c8);
  return;
}



void Unwind_140439a00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439a10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x520);
  return;
}



void Unwind_140439a20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x15e8);
  return;
}



void Unwind_140439a30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0xc0));
  return;
}



void Unwind_140439a40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x280);
  return;
}



void Unwind_140439a50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc98);
  return;
}



void Unwind_140439a60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140439a70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_140439a80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x6f8);
  return;
}



void Unwind_140439a90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140439aa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x180);
  return;
}



void Unwind_140439ab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x720);
  return;
}



void Unwind_140439ac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140439ad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140439ae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x718);
  return;
}



void Unwind_140439af0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439b00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a8);
  return;
}



void Unwind_140439b10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x730);
  return;
}



void Unwind_140439b20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439b30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2f0);
  return;
}



void Unwind_140439b40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x740);
  return;
}



void Unwind_140439b50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439b60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x250);
  return;
}



void Unwind_140439b70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x750);
  return;
}



void Unwind_140439b80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439b90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x370);
  return;
}



void Unwind_140439ba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x760);
  return;
}



void Unwind_140439bb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439bc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x260);
  return;
}



void Unwind_140439bd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x770);
  return;
}



void Unwind_140439be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x108);
  return;
}



void Unwind_140439c00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x780);
  return;
}



void Unwind_140439c10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439c20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140439c30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x790);
  return;
}



void Unwind_140439c40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439c50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_140439c60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7a0);
  return;
}



void Unwind_140439c70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_140439c90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7b0);
  return;
}



void Unwind_140439ca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439cb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_140439cc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7c0);
  return;
}



void Unwind_140439cd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439ce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x300);
  return;
}



void Unwind_140439cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 2000);
  return;
}



void Unwind_140439d00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439d10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x270);
  return;
}



void Unwind_140439d20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7e0);
  return;
}



void Unwind_140439d30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439d40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x350);
  return;
}



void Unwind_140439d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7f0);
  return;
}



void Unwind_140439d60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439d70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c8);
  return;
}



void Unwind_140439d80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x800);
  return;
}



void Unwind_140439d90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439da0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x238);
  return;
}



void Unwind_140439db0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x810);
  return;
}



void Unwind_140439dc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439dd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x310);
  return;
}



void Unwind_140439de0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x820);
  return;
}



void Unwind_140439df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439e00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_140439e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x830);
  return;
}



void Unwind_140439e20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x230);
  return;
}



void Unwind_140439e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x840);
  return;
}



void Unwind_140439e50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140439e70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x850);
  return;
}



void Unwind_140439e80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140439ea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x860);
  return;
}



void Unwind_140439eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439ec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x290);
  return;
}



void Unwind_140439ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x870);
  return;
}



void Unwind_140439ee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439ef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x390);
  return;
}



void Unwind_140439f00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x880);
  return;
}



void Unwind_140439f10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439f20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140439f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x890);
  return;
}



void Unwind_140439f40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439f50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140439f60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8a0);
  return;
}



void Unwind_140439f70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_140439f90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8b0);
  return;
}



void Unwind_140439fa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439fb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x670);
  return;
}



void Unwind_140439fc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x168);
  return;
}



void Unwind_140439fd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8c0);
  return;
}



void Unwind_140439fe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_140439ff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x688);
  return;
}



void Unwind_14043a000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x6a8);
  return;
}



void Unwind_14043a010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_14043a020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8d0);
  return;
}



void Unwind_14043a030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a0);
  return;
}



void Unwind_14043a050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8e0);
  return;
}



void Unwind_14043a060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8f0);
  return;
}



void Unwind_14043a090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a0b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x900);
  return;
}



void Unwind_14043a0c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a0d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_14043a0e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x910);
  return;
}



void Unwind_14043a0f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x6c8);
  return;
}



void Unwind_14043a110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 800);
  return;
}



void Unwind_14043a120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x920);
  return;
}



void Unwind_14043a130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd8);
  return;
}



void Unwind_14043a150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x930);
  return;
}



void Unwind_14043a160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b0);
  return;
}



void Unwind_14043a180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x940);
  return;
}



void Unwind_14043a190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a1a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x360);
  return;
}



void Unwind_14043a1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x950);
  return;
}



void Unwind_14043a1c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_14043a1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x960);
  return;
}



void Unwind_14043a1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x148);
  return;
}



void Unwind_14043a210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x970);
  return;
}



void Unwind_14043a220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf8);
  return;
}



void Unwind_14043a240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x980);
  return;
}



void Unwind_14043a250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x990);
  return;
}



void Unwind_14043a280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a2a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9a0);
  return;
}



void Unwind_14043a2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x130);
  return;
}



void Unwind_14043a2d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9b0);
  return;
}



void Unwind_14043a2e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a2f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x330);
  return;
}



void Unwind_14043a300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9c0);
  return;
}



void Unwind_14043a310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d8);
  return;
}



void Unwind_14043a330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9d0);
  return;
}



void Unwind_14043a340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d0);
  return;
}



void Unwind_14043a360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9e0);
  return;
}



void Unwind_14043a370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9f0);
  return;
}



void Unwind_14043a3a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x380);
  return;
}



void Unwind_14043a3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa00);
  return;
}



void Unwind_14043a3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a3e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x698);
  return;
}



void Unwind_14043a3f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2e0);
  return;
}



void Unwind_14043a400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa10);
  return;
}



void Unwind_14043a410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x340);
  return;
}



void Unwind_14043a430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa20);
  return;
}



void Unwind_14043a440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa30);
  return;
}



void Unwind_14043a470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x188);
  return;
}



void Unwind_14043a490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa40);
  return;
}



void Unwind_14043a4a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a4b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x240);
  return;
}



void Unwind_14043a4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa50);
  return;
}



void Unwind_14043a4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a4e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x248);
  return;
}



void Unwind_14043a4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa60);
  return;
}



void Unwind_14043a500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x6b8);
  return;
}



void Unwind_14043a520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 600);
  return;
}



void Unwind_14043a530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa70);
  return;
}



void Unwind_14043a540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x268);
  return;
}



void Unwind_14043a560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa80);
  return;
}



void Unwind_14043a570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_14043a590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa90);
  return;
}



void Unwind_14043a5a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a5b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a5c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xaa0);
  return;
}



void Unwind_14043a5d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a5e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x198);
  return;
}



void Unwind_14043a5f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xab0);
  return;
}



void Unwind_14043a600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x278);
  return;
}



void Unwind_14043a620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x710);
  return;
}



void Unwind_14043a630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x288);
  return;
}



void Unwind_14043a650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x738);
  return;
}



void Unwind_14043a660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x758);
  return;
}



void Unwind_14043a690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a6b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x778);
  return;
}



void Unwind_14043a6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a6d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x298);
  return;
}



void Unwind_14043a6e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x798);
  return;
}



void Unwind_14043a6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a700(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xe60);
  return;
}



void Unwind_14043a710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7b8);
  return;
}



void Unwind_14043a730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043a750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7d8);
  return;
}



void Unwind_14043a760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x120);
  return;
}



void Unwind_14043a780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7f8);
  return;
}



void Unwind_14043a790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_14043a7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x818);
  return;
}



void Unwind_14043a7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x678);
  return;
}



void Unwind_14043a7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c8);
  return;
}



void Unwind_14043a7f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x838);
  return;
}



void Unwind_14043a800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2d8);
  return;
}



void Unwind_14043a820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x858);
  return;
}



void Unwind_14043a830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2e8);
  return;
}



void Unwind_14043a850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x878);
  return;
}



void Unwind_14043a860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x680);
  return;
}



void Unwind_14043a880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_14043a890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x898);
  return;
}



void Unwind_14043a8a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x690);
  return;
}



void Unwind_14043a8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a8);
  return;
}



void Unwind_14043a8d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8b8);
  return;
}



void Unwind_14043a8e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x6a0);
  return;
}



void Unwind_14043a900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_14043a910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8d8);
  return;
}



void Unwind_14043a920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x6b0);
  return;
}



void Unwind_14043a940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2f8);
  return;
}



void Unwind_14043a950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8f8);
  return;
}



void Unwind_14043a960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x6c0);
  return;
}



void Unwind_14043a980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x140);
  return;
}



void Unwind_14043a990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x918);
  return;
}



void Unwind_14043a9a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a9b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x308);
  return;
}



void Unwind_14043a9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x938);
  return;
}



void Unwind_14043a9d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043a9e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x318);
  return;
}



void Unwind_14043a9f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x958);
  return;
}



void Unwind_14043aa00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aa10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_14043aa20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x978);
  return;
}



void Unwind_14043aa30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aa40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x6d0);
  return;
}



void Unwind_14043aa50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b8);
  return;
}



void Unwind_14043aa60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x998);
  return;
}



void Unwind_14043aa70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aa80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_14043aa90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9b8);
  return;
}



void Unwind_14043aaa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x328);
  return;
}



void Unwind_14043aac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9d8);
  return;
}



void Unwind_14043aad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_14043aaf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9f8);
  return;
}



void Unwind_14043ab00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ab10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_14043ab20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa18);
  return;
}



void Unwind_14043ab30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ab40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_14043ab50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa38);
  return;
}



void Unwind_14043ab60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ab70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x158);
  return;
}



void Unwind_14043ab80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa58);
  return;
}



void Unwind_14043ab90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x160);
  return;
}



void Unwind_14043abb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa78);
  return;
}



void Unwind_14043abc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043abd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x170);
  return;
}



void Unwind_14043abe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa98);
  return;
}



void Unwind_14043abf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ac00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x150);
  return;
}



void Unwind_14043ac10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xab8);
  return;
}



void Unwind_14043ac20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ac30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_14043ac40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xad8);
  return;
}



void Unwind_14043ac50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ac60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_14043ac70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xaf8);
  return;
}



void Unwind_14043ac80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ac90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043aca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb18);
  return;
}



void Unwind_14043acb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043acc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x338);
  return;
}



void Unwind_14043acd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb38);
  return;
}



void Unwind_14043ace0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043acf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x348);
  return;
}



void Unwind_14043ad00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb58);
  return;
}



void Unwind_14043ad10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ad20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x118);
  return;
}



void Unwind_14043ad30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb78);
  return;
}



void Unwind_14043ad40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ad50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 400);
  return;
}



void Unwind_14043ad60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb98);
  return;
}



void Unwind_14043ad70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ad80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a0);
  return;
}



void Unwind_14043ad90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 3000);
  return;
}



void Unwind_14043ada0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043adb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b0);
  return;
}



void Unwind_14043adc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbd8);
  return;
}



void Unwind_14043add0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ade0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c0);
  return;
}



void Unwind_14043adf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbf8);
  return;
}



void Unwind_14043ae00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ae10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x128);
  return;
}



void Unwind_14043ae20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc18);
  return;
}



void Unwind_14043ae30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ae40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_14043ae50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc38);
  return;
}



void Unwind_14043ae60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ae70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_14043ae80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc58);
  return;
}



void Unwind_14043ae90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043aeb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc78);
  return;
}



void Unwind_14043aec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x358);
  return;
}



void Unwind_14043aee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x6f0);
  return;
}



void Unwind_14043aef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043af00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_14043af10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcb8);
  return;
}



void Unwind_14043af20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043af30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_14043af40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcd8);
  return;
}



void Unwind_14043af50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043af60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x138);
  return;
}



void Unwind_14043af70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcf8);
  return;
}



void Unwind_14043af80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043af90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x368);
  return;
}



void Unwind_14043afa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd18);
  return;
}



void Unwind_14043afb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043afc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x378);
  return;
}



void Unwind_14043afd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd38);
  return;
}



void Unwind_14043afe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043aff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_14043b000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd58);
  return;
}



void Unwind_14043b010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043b020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x388);
  return;
}



void Unwind_14043b030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd78);
  return;
}



void Unwind_14043b040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043b050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_14043b060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd98);
  return;
}



void Unwind_14043b070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043b080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_14043b090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdb8);
  return;
}



void Unwind_14043b0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043b0b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_14043b0c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdd8);
  return;
}



void Unwind_14043b0d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043b0e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_14043b0f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdf8);
  return;
}



void Unwind_14043b100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043b110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x398);
  return;
}



void Unwind_14043b120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe18);
  return;
}



void Unwind_14043b130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043b140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043b150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe38);
  return;
}



void Unwind_14043b160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043b170(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_14043b180(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_14043b190(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_14043b1a0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_14043b1b0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x90) & 1) != 0) {
    *(uint *)(param_2 + 0x90) = *(uint *)(param_2 + 0x90) & 0xfffffffe;
    FUN_14008d060(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Unwind_14043b1e0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x48);
  return;
}



void Catch_All_14043b1f0(void)

{
  FUN_14031eb10();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14043b230(void)

{
  FUN_140318800();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14043b260(undefined8 param_1,longlong param_2)

{
  FUN_1402bcbd0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14043b270(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_14043b290(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_14043b2b0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x130);
  return;
}



void Unwind_14043b2d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x140);
  return;
}



void Unwind_14043b2f0(undefined8 param_1,longlong param_2)

{
  FUN_1402fc8c0(*(longlong *)(param_2 + 0x40) + 0x578);
  return;
}



void Unwind_14043b310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fca50(*(longlong *)(param_2 + 0x40) + 0x9c8);
  return;
}



void Unwind_14043b330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0x40) + 0xa10);
  return;
}



void Unwind_14043b350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fca70(*(longlong *)(param_2 + 0x40) + 0xa58);
  return;
}



void Unwind_14043b370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fca70(*(longlong *)(param_2 + 0x40) + 0xaa0);
  return;
}



void Unwind_14043b390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fcab0(*(longlong *)(param_2 + 0x40) + 0xae8);
  return;
}



void Unwind_14043b3b0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xbe8);
  return;
}



void Unwind_14043b3d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xbf8);
  return;
}



void Unwind_14043b3f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xc08);
  return;
}



void Unwind_14043b410(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xc18);
  return;
}



void Unwind_14043b430(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xc28);
  return;
}



void Unwind_14043b450(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xc38);
  return;
}



void Unwind_14043b470(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xc48);
  return;
}



void Unwind_14043b490(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x40) + 0xc78);
  return;
}



void Unwind_14043b4b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xcb0);
  return;
}



void Unwind_14043b4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(*(longlong *)(param_2 + 0x40) + 0xce8);
  return;
}



void Unwind_14043b4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(*(longlong *)(param_2 + 0x40) + 0xd30);
  return;
}



void Unwind_14043b510(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0xed0);
  return;
}



void Unwind_14043b530(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xf00);
  return;
}



void Unwind_14043b550(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xf20);
  return;
}



void Unwind_14043b570(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xf48);
  return;
}



void Unwind_14043b590(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xf68);
  return;
}



void Unwind_14043b5b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xf88);
  return;
}



void Unwind_14043b5d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14030e480(*(longlong *)(param_2 + 0x40) + 0xff0);
  return;
}



void Unwind_14043b5f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fca90(*(longlong *)(param_2 + 0x40) + 0x1038);
  return;
}



void Unwind_14043b610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fcab0(*(longlong *)(param_2 + 0x40) + 0x1080);
  return;
}



void Unwind_14043b630(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x10e8);
  return;
}



void Unwind_14043b650(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x10f8);
  return;
}



void Unwind_14043b670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fccc0(*(longlong *)(param_2 + 0x40) + 0x1108);
  return;
}



void Unwind_14043b690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fce40(*(longlong *)(param_2 + 0x40) + 0x1150);
  return;
}



void Unwind_14043b6b0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x1198);
  return;
}



void Unwind_14043b6d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x11b0);
  return;
}



void Unwind_14043b6f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x11c0);
  return;
}



void Unwind_14043b710(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x11e0);
  return;
}



void Unwind_14043b730(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x1200);
  return;
}



void Unwind_14043b750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fce60(*(longlong *)(param_2 + 0x40) + 0x1258);
  return;
}



void Unwind_14043b770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x40) + 0x12a0);
  return;
}



void Unwind_14043b790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140195a40(*(longlong *)(param_2 + 0x40) + 0x12e8);
  return;
}



void Unwind_14043b7b0(undefined8 param_1,longlong param_2)

{
  FUN_1402bcbd0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_14043b7c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xd0);
  return;
}



void Unwind_14043b7e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xf8);
  return;
}



void Unwind_14043b800(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x130);
  return;
}



void Unwind_14043b820(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x140);
  return;
}



void Unwind_14043b840(undefined8 param_1,longlong param_2)

{
  FUN_1402fc8c0(*(longlong *)(param_2 + 0x50) + 0x578);
  return;
}



void Unwind_14043b860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fca50(*(longlong *)(param_2 + 0x50) + 0x9c8);
  return;
}



void Unwind_14043b880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0x50) + 0xa10);
  return;
}



void Unwind_14043b8a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fca70(*(longlong *)(param_2 + 0x50) + 0xa58);
  return;
}



void Unwind_14043b8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fca70(*(longlong *)(param_2 + 0x50) + 0xaa0);
  return;
}



void Unwind_14043b8e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fcab0(*(longlong *)(param_2 + 0x50) + 0xae8);
  return;
}



void Unwind_14043b900(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0xbe8);
  return;
}



void Unwind_14043b920(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0xbf8);
  return;
}



void Unwind_14043b940(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0xc08);
  return;
}



void Unwind_14043b960(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0xc18);
  return;
}



void Unwind_14043b980(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0xc28);
  return;
}



void Unwind_14043b9a0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0xc38);
  return;
}



void Unwind_14043b9c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0xc48);
  return;
}



void Unwind_14043b9e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 0xc78);
  return;
}



void Unwind_14043ba00(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0xcb0);
  return;
}



void Unwind_14043ba20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(*(longlong *)(param_2 + 0x50) + 0xce8);
  return;
}



void Unwind_14043ba40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(*(longlong *)(param_2 + 0x50) + 0xd30);
  return;
}



void Unwind_14043ba60(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0xed0);
  return;
}



void Unwind_14043ba80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0xf00);
  return;
}



void Unwind_14043baa0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0xf20);
  return;
}



void Unwind_14043bac0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0xf48);
  return;
}



void Unwind_14043bae0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0xf68);
  return;
}



void Unwind_14043bb00(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0xf88);
  return;
}



void Unwind_14043bb20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14030e480(*(longlong *)(param_2 + 0x50) + 0xff0);
  return;
}



void Unwind_14043bb40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fca90(*(longlong *)(param_2 + 0x50) + 0x1038);
  return;
}



void Unwind_14043bb60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fcab0(*(longlong *)(param_2 + 0x50) + 0x1080);
  return;
}



void Unwind_14043bb80(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x10e8);
  return;
}



void Unwind_14043bba0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x10f8);
  return;
}



void Unwind_14043bbc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fccc0(*(longlong *)(param_2 + 0x50) + 0x1108);
  return;
}



void Unwind_14043bbe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fce40(*(longlong *)(param_2 + 0x50) + 0x1150);
  return;
}



void Unwind_14043bc00(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x1198);
  return;
}



void Unwind_14043bc20(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x11b0);
  return;
}



void Unwind_14043bc40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x11c0);
  return;
}



void Unwind_14043bc60(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x11e0);
  return;
}



void Unwind_14043bc80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x50) + 0x1200);
  return;
}



void Unwind_14043bca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402fce60(*(longlong *)(param_2 + 0x50) + 0x1258);
  return;
}



void Unwind_14043bcc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x50) + 0x12a0);
  return;
}



void Unwind_14043bce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140195a40(*(longlong *)(param_2 + 0x50) + 0x12e8);
  return;
}



void Unwind_14043bd00(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x50) + 0x12f8);
  return;
}



void Unwind_14043bd20(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_14043bd40(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 + 0x308) {
    FUN_1402e8400();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14043bd80(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x68));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14043bdb0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14043bdd0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(undefined8 *)(param_2 + 0x58));
  return;
}



void Unwind_14043bde0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x58) + 0x20);
  return;
}



void Catch_All_14043bdf0(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 + 0x60) {
    FUN_1402df1d0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14043be30(void)

{
  FUN_1402e2f50();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14043be60(void)

{
  FUN_1402e1b90();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14043be90(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14043bec0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14043bee0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_14043bef0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x48) + 0x20);
  return;
}



void Unwind_14043bf00(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x48),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14043bf20(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_14043bf30(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x48) + 0x20);
  return;
}



void Unwind_14043bf40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x460);
  return;
}



void Unwind_14043bf50(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014043bf57. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_14043bf60(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x88);
  return;
}



void Unwind_14043bf70(undefined8 param_1,longlong param_2)

{
  FUN_1402bf480(param_2 + 0x360);
  return;
}



void Unwind_14043bf80(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014043bf87. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete__(*(void **)(param_2 + 0x118));
  return;
}



void Unwind_14043bf90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x150);
  return;
}



void Unwind_14043bfa0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xc0);
  return;
}



void Unwind_14043bfb0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(undefined8 *)(param_2 + 0x148));
  return;
}



void Unwind_14043bfc0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x400);
  return;
}



void Unwind_14043bfd0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xf0);
  return;
}



void Unwind_14043bfe0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xd0);
  return;
}



void Unwind_14043bff0(undefined8 param_1,longlong param_2)

{
  std::exception::~exception((exception *)(param_2 + 0x28));
  return;
}



void Unwind_14043c000(undefined8 param_1,longlong param_2)

{
  std::exception::~exception((exception *)(param_2 + 0x28));
  return;
}



void Unwind_14043c010(undefined8 param_1,longlong param_2)

{
  FUN_1402cb750(param_2 + 0x28);
  return;
}



void Unwind_14043c020(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_14043c040(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043c050(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14043c060(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x120);
  return;
}



void Unwind_14043c070(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(param_2 + 0x28);
  return;
}



void Unwind_14043c080(undefined8 param_1,longlong param_2)

{
  FUN_1402d83d0(param_2 + 0x70);
  return;
}



void Unwind_14043c090(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd0);
  return;
}



void Unwind_14043c0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402cac40(param_2 + 0xd0);
  return;
}



void Unwind_14043c0b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd0);
  return;
}



void Catch_All_14043c0c0(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_1402c4db0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14043c100(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



undefined8 Catch_All_14043c130(void)

{
  return 0x140297323;
}



void Unwind_14043c150(undefined8 param_1,longlong param_2)

{
  FUN_14027b040(param_2 + 0x28);
  return;
}



void Unwind_14043c160(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_14043c180(undefined8 param_1,longlong param_2)

{
  FUN_140278fa0(param_2 + 0x28);
  return;
}



void Unwind_14043c190(undefined8 param_1,longlong param_2)

{
  FUN_1402794d0(param_2 + 0x30);
  return;
}



void Unwind_14043c1a0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_14043c1c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_14043c1d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x68);
  return;
}



void Unwind_14043c1e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_14043c1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(param_2 + 0x60);
  return;
}



void Unwind_14043c200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_14043c210(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_14043c230(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_14043c250(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_14043c270(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_14043c290(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_14043c2b0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14043c2c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_14043c2d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_14043c2e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_14043c2f0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x28);
  return;
}



void Unwind_14043c300(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_14043c310(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_14043c320(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(param_2 + 0x60);
  return;
}



void Unwind_14043c330(undefined8 param_1,longlong param_2)

{
  FUN_14023ab70(param_2 + 0x88);
  return;
}



void Unwind_14043c340(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_14043c350(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14043c360(undefined8 param_1,longlong param_2)

{
  FUN_140215bd0(*(longlong *)(param_2 + 0x60) + 0x48);
  return;
}



void Unwind_14043c370(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0xa8);
  return;
}



void Unwind_14043c390(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 200);
  return;
}



void Unwind_14043c3b0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x60) + 0x108);
  return;
}



void Unwind_14043c3d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



undefined8 Catch_All_14043c3e0(void)

{
  return 0x1401e4d73;
}



void Unwind_14043c400(undefined8 param_1,longlong param_2)

{
  FUN_1401e4c30(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14043c410(undefined8 param_1,longlong param_2)

{
  FUN_1401e4c50(*(longlong *)(param_2 + 0x40) + 0x50);
  return;
}



void Unwind_14043c420(undefined8 param_1,longlong param_2)

{
  FUN_1401e4d60(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_14043c440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401e4f20(*(longlong *)(param_2 + 0x40) + 0xe0);
  return;
}



void Unwind_14043c460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401e4f20(*(longlong *)(param_2 + 0x40) + 0x128);
  return;
}



void Unwind_14043c480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401e4f20(*(longlong *)(param_2 + 0x40) + 0x170);
  return;
}



void Unwind_14043c4a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401e4f20(*(longlong *)(param_2 + 0x40) + 0x1b8);
  return;
}



void Unwind_14043c4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401e50e0(*(longlong *)(param_2 + 0x40) + 0x200);
  return;
}



void Unwind_14043c4e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401e50e0(*(longlong *)(param_2 + 0x40) + 0x248);
  return;
}



void Unwind_14043c500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401e50e0(*(longlong *)(param_2 + 0x40) + 0x290);
  return;
}



void Unwind_14043c520(undefined8 param_1,longlong param_2)

{
  FUN_1401e28a0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_14043c530(undefined8 param_1,longlong param_2)

{
  FUN_1402163b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14043c540(undefined8 param_1,longlong param_2)

{
  FUN_1401e2af0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14043c550(undefined8 param_1,longlong param_2)

{
  FUN_1401e2960(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_14043c560(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_14043c570(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x88);
  return;
}



void Unwind_14043c590(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0xa8);
  return;
}



void Unwind_14043c5b0(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0xf8);
  return;
}



void Unwind_14043c5d0(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_14043c5f0(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_14043c610(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_14043c620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x30);
  return;
}



void Unwind_14043c630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401def10(param_2 + 0x50);
  return;
}



void Unwind_14043c640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e600(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0x68) + 0x48);
  return;
}



void Unwind_14043c660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e600(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0x68) + 0x48);
  return;
}



void Unwind_14043c680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e600(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0x68) + 0x48);
  return;
}



void Unwind_14043c6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401defb0(param_2 + 0xb0);
  return;
}



void Unwind_14043c6b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e600(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0x68) + 0x48);
  return;
}



void Unwind_14043c6d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_14043c6e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x38);
  return;
}



void Unwind_14043c6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401def10(param_2 + 0x58);
  return;
}



void Unwind_14043c700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401defb0(param_2 + 0x78);
  return;
}



void Unwind_14043c710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e600(*(undefined8 *)(param_2 + 0xd8));
  return;
}



void Unwind_14043c720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0xd8) + 0x48);
  return;
}



void Unwind_14043c730(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x30);
  return;
}



void Unwind_14043c740(undefined8 param_1,longlong param_2)

{
  FUN_140176eb0(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_14043c750(undefined8 param_1,longlong param_2)

{
  FUN_14008cf80(*(longlong *)(param_2 + 0x60) + 0x2c0);
  return;
}



void Unwind_14043c770(undefined8 param_1,longlong param_2)

{
  FUN_1400a43a0(*(longlong *)(param_2 + 0x60) + 0x2e0);
  return;
}



void Unwind_14043c790(undefined8 param_1,longlong param_2)

{
  FUN_1400d3eb0(*(longlong *)(param_2 + 0x60) + 0x300);
  return;
}



void Unwind_14043c7b0(undefined8 param_1,longlong param_2)

{
  FUN_1400ed980(*(longlong *)(param_2 + 0x60) + 800);
  return;
}



void Unwind_14043c7d0(undefined8 param_1,longlong param_2)

{
  FUN_1401168e0(*(longlong *)(param_2 + 0x60) + 0x340);
  return;
}



void Unwind_14043c7f0(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c800(undefined8 param_1,longlong param_2)

{
  FUN_1400a4350(*(longlong *)(param_2 + 0x60) + 0x360);
  return;
}



void Unwind_14043c820(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c830(undefined8 param_1,longlong param_2)

{
  FUN_1400d3f00(*(longlong *)(param_2 + 0x60) + 0x380);
  return;
}



void Unwind_14043c850(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c860(undefined8 param_1,longlong param_2)

{
  FUN_1400ed9d0(*(longlong *)(param_2 + 0x60) + 0x3a0);
  return;
}



void Unwind_14043c880(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c890(undefined8 param_1,longlong param_2)

{
  FUN_140116840(*(longlong *)(param_2 + 0x60) + 0x3c0);
  return;
}



void Unwind_14043c8b0(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c8c0(undefined8 param_1,longlong param_2)

{
  FUN_1402b76c0(*(longlong *)(param_2 + 0x60) + 0x3e0);
  return;
}



void Unwind_14043c8e0(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c8f0(undefined8 param_1,longlong param_2)

{
  FUN_140116890(*(longlong *)(param_2 + 0x60) + 0x400);
  return;
}



void Unwind_14043c910(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c920(undefined8 param_1,longlong param_2)

{
  FUN_140116930(*(longlong *)(param_2 + 0x60) + 0x420);
  return;
}



void Unwind_14043c940(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c950(undefined8 param_1,longlong param_2)

{
  FUN_140116980(*(longlong *)(param_2 + 0x60) + 0x440);
  return;
}



void Unwind_14043c970(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c980(undefined8 param_1,longlong param_2)

{
  FUN_1401169d0(*(longlong *)(param_2 + 0x60) + 0x460);
  return;
}



void Unwind_14043c9a0(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c9b0(undefined8 param_1,longlong param_2)

{
  FUN_140116a30(*(longlong *)(param_2 + 0x60) + 0x480);
  return;
}



void Unwind_14043c9d0(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043c9e0(undefined8 param_1,longlong param_2)

{
  FUN_140116a80(*(longlong *)(param_2 + 0x60) + 0x4a0);
  return;
}



void Unwind_14043ca00(undefined8 param_1,longlong param_2)

{
  FUN_1401e28a0(*(longlong *)(param_2 + 0x60) + 0x500);
  return;
}



void Unwind_14043ca20(undefined8 param_1,longlong param_2)

{
  FUN_140176230(*(longlong *)(param_2 + 0x60) + 0x530);
  return;
}



void Unwind_14043ca40(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014043ca47. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_14043ca50(undefined8 param_1,longlong param_2)

{
  FUN_140174f90(*(longlong *)(param_2 + 0x60) + 0x5a8);
  return;
}



void Unwind_14043ca70(undefined8 param_1,longlong param_2)

{
  FUN_140174f90(*(longlong *)(param_2 + 0x60) + 0x5d0);
  return;
}



void Unwind_14043ca90(undefined8 param_1,longlong param_2)

{
  FUN_140175150(*(longlong *)(param_2 + 0x60) + 0x5f8);
  return;
}



void Unwind_14043cab0(undefined8 param_1,longlong param_2)

{
  FUN_1401751b0(*(longlong *)(param_2 + 0x60) + 0x618);
  return;
}



void Unwind_14043cad0(undefined8 param_1,longlong param_2)

{
  FUN_140175210(*(longlong *)(param_2 + 0x60) + 0x638);
  return;
}



void Unwind_14043caf0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x658);
  return;
}



void Unwind_14043cb10(undefined8 param_1,longlong param_2)

{
  FUN_140175250(*(longlong *)(param_2 + 0x60) + 0x678);
  return;
}



void Unwind_14043cb30(undefined8 param_1,longlong param_2)

{
  FUN_140175290(*(longlong *)(param_2 + 0x60) + 0x698);
  return;
}



void Unwind_14043cb50(undefined8 param_1,longlong param_2)

{
  FUN_1401752d0(*(longlong *)(param_2 + 0x60) + 0x6b8);
  return;
}



void Unwind_14043cb70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x6d8);
  return;
}



void Unwind_14043cb90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x6f8);
  return;
}



void Unwind_14043cbb0(undefined8 param_1,longlong param_2)

{
  FUN_140175310(*(longlong *)(param_2 + 0x60) + 0x718);
  return;
}



void Unwind_14043cbd0(undefined8 param_1,longlong param_2)

{
  FUN_140175350(*(longlong *)(param_2 + 0x60) + 0x738);
  return;
}



void Unwind_14043cbf0(undefined8 param_1,longlong param_2)

{
  FUN_140175390(*(longlong *)(param_2 + 0x60) + 0x758);
  return;
}



void Unwind_14043cc10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175850(*(longlong *)(param_2 + 0x60) + 0x778);
  return;
}



void Unwind_14043cc30(undefined8 param_1,longlong param_2)

{
  FUN_1401753e0(*(longlong *)(param_2 + 0x60) + 0x798);
  return;
}



void Unwind_14043cc50(undefined8 param_1,longlong param_2)

{
  FUN_1401753e0(*(longlong *)(param_2 + 0x60) + 0x7b8);
  return;
}



void Unwind_14043cc70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x7d8);
  return;
}



void Unwind_14043cc90(undefined8 param_1,longlong param_2)

{
  FUN_140175420(*(longlong *)(param_2 + 0x60) + 0x7f8);
  return;
}



void Unwind_14043ccb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x818);
  return;
}



void Unwind_14043ccd0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x838);
  return;
}



void Unwind_14043ccf0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x858);
  return;
}



void Unwind_14043cd10(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x878);
  return;
}



void Unwind_14043cd30(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x898);
  return;
}



void Unwind_14043cd50(undefined8 param_1,longlong param_2)

{
  FUN_140176250(*(longlong *)(param_2 + 0x60) + 0x8b8);
  return;
}



void Unwind_14043cd70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x900);
  return;
}



void Unwind_14043cd90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x920);
  return;
}



void Unwind_14043cdb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x940);
  return;
}



void Unwind_14043cdd0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x58),*(undefined8 *)(param_2 + 0x60));
  return;
}



void Catch_All_14043cdf0(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 + 0x70) {
    FUN_1401435b0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14043ce30(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14043ce60(undefined8 param_1,longlong param_2)

{
  FUN_140132210(param_2 + 0xa0);
  return;
}



void Unwind_14043ce70(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_14043ce80(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_14043ce90(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_14043ceb0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_14043cec0(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_14043cee0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_14043cef0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x360);
  return;
}



void Unwind_14043cf00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x330);
  return;
}



void Unwind_14043cf10(undefined8 param_1,longlong param_2)

{
  FUN_140134f30(param_2 + 0x390);
  return;
}



void Unwind_14043cf20(undefined8 param_1,longlong param_2)

{
  FUN_14012d9d0(param_2 + 0x90);
  return;
}



void Unwind_14043cf30(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 0x30);
  return;
}



void Unwind_14043cf40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1a0);
  return;
}



void Unwind_14043cf50(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x1f0);
  return;
}



void Unwind_14043cf60(undefined8 param_1,longlong param_2)

{
  FUN_1400034f0(param_2 + 0x20);
  return;
}



void Unwind_14043cf70(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x20);
  return;
}



void Unwind_14043cf80(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x58);
  return;
}



void Unwind_14043cf90(undefined8 param_1,longlong param_2)

{
  FUN_140125990(param_2 + 0xb0);
  return;
}



void Unwind_14043cfa0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x1c8);
  return;
}



void Unwind_14043cfb0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x00014043cfc2. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_ostream<>::~basic_ostream<>((basic_ostream<> *)(*(longlong *)(param_2 + 0xa0) + -0x80))
  ;
  return;
}



void Unwind_14043cfd0(undefined8 param_1,longlong param_2)

{
  FUN_14000edf0(param_2 + 0x20);
  return;
}



void Unwind_14043cfe0(undefined8 param_1,longlong param_2)

{
  FUN_1400034d0(param_2 + 0x58);
  return;
}



void Unwind_14043cff0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x50);
  return;
}



void Unwind_14043d000(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0xb0);
  return;
}



void Unwind_14043d010(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x78);
  return;
}



void Unwind_14043d020(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x20);
  return;
}



void Unwind_14043d030(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x40);
  return;
}



void Unwind_14043d040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043d050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfb8);
  return;
}



void Unwind_14043d060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a0);
  return;
}



void Unwind_14043d080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1048);
  return;
}



void Unwind_14043d090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043d0b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1078);
  return;
}



void Unwind_14043d0c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d0d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3b8);
  return;
}



void Unwind_14043d0e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1058);
  return;
}



void Unwind_14043d0f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x120);
  return;
}



void Unwind_14043d110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x860);
  return;
}



void Unwind_14043d120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 400);
  return;
}



void Unwind_14043d140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x870);
  return;
}



void Unwind_14043d150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x538);
  return;
}



void Unwind_14043d170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x880);
  return;
}



void Unwind_14043d180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x768);
  return;
}



void Unwind_14043d1a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x718);
  return;
}



void Unwind_14043d1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x788);
  return;
}



void Unwind_14043d1c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_14043d1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x890);
  return;
}



void Unwind_14043d1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7a8);
  return;
}



void Unwind_14043d200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x728);
  return;
}



void Unwind_14043d210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043d220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8a0);
  return;
}



void Unwind_14043d230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_14043d250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8b0);
  return;
}



void Unwind_14043d260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d270(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x800);
  return;
}



void Unwind_14043d280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043d290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8c0);
  return;
}



void Unwind_14043d2a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d2b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x820);
  return;
}



void Unwind_14043d2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043d2d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8d0);
  return;
}



void Unwind_14043d2e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d2f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b0);
  return;
}



void Unwind_14043d300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8e0);
  return;
}



void Unwind_14043d310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x168);
  return;
}



void Unwind_14043d330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8f0);
  return;
}



void Unwind_14043d340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_14043d360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x900);
  return;
}



void Unwind_14043d370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_14043d390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x910);
  return;
}



void Unwind_14043d3a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_14043d3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x920);
  return;
}



void Unwind_14043d3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d3e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd8);
  return;
}



void Unwind_14043d3f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x930);
  return;
}



void Unwind_14043d400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_14043d420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x940);
  return;
}



void Unwind_14043d430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x108);
  return;
}



void Unwind_14043d450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x950);
  return;
}



void Unwind_14043d460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_14043d480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x960);
  return;
}



void Unwind_14043d490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d4a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_14043d4b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x970);
  return;
}



void Unwind_14043d4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_14043d4e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x980);
  return;
}



void Unwind_14043d4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_14043d510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x990);
  return;
}



void Unwind_14043d520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_14043d540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9a0);
  return;
}



void Unwind_14043d550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf8);
  return;
}



void Unwind_14043d570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9b0);
  return;
}



void Unwind_14043d580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c0);
  return;
}



void Unwind_14043d5a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9c0);
  return;
}



void Unwind_14043d5b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d5c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x130);
  return;
}



void Unwind_14043d5d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9d0);
  return;
}



void Unwind_14043d5e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d5f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_14043d600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9e0);
  return;
}



void Unwind_14043d610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x448);
  return;
}



void Unwind_14043d630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9f0);
  return;
}



void Unwind_14043d640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x410);
  return;
}



void Unwind_14043d660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa00);
  return;
}



void Unwind_14043d670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x458);
  return;
}



void Unwind_14043d690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa10);
  return;
}



void Unwind_14043d6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d6b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3d0);
  return;
}



void Unwind_14043d6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa20);
  return;
}



void Unwind_14043d6d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d6e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x450);
  return;
}



void Unwind_14043d6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa30);
  return;
}



void Unwind_14043d700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x738);
  return;
}



void Unwind_14043d720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_14043d730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa40);
  return;
}



void Unwind_14043d740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x778);
  return;
}



void Unwind_14043d760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x160);
  return;
}



void Unwind_14043d770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa50);
  return;
}



void Unwind_14043d780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x140);
  return;
}



void Unwind_14043d7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa60);
  return;
}



void Unwind_14043d7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x748);
  return;
}



void Unwind_14043d7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x550);
  return;
}



void Unwind_14043d7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa70);
  return;
}



void Unwind_14043d7f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x798);
  return;
}



void Unwind_14043d810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x518);
  return;
}



void Unwind_14043d820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa80);
  return;
}



void Unwind_14043d830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x758);
  return;
}



void Unwind_14043d850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x478);
  return;
}



void Unwind_14043d860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa90);
  return;
}



void Unwind_14043d870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x708);
  return;
}



void Unwind_14043d890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4e8);
  return;
}



void Unwind_14043d8a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xaa0);
  return;
}



void Unwind_14043d8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x488);
  return;
}



void Unwind_14043d8d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xab0);
  return;
}



void Unwind_14043d8e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043d900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xac0);
  return;
}



void Unwind_14043d910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x460);
  return;
}



void Unwind_14043d930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xad0);
  return;
}



void Unwind_14043d940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043d960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xae0);
  return;
}



void Unwind_14043d970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043d990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xaf0);
  return;
}



void Unwind_14043d9a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d9b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x710);
  return;
}



void Unwind_14043d9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x498);
  return;
}



void Unwind_14043d9d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb00);
  return;
}



void Unwind_14043d9e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043d9f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x720);
  return;
}



void Unwind_14043da00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4f8);
  return;
}



void Unwind_14043da10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb10);
  return;
}



void Unwind_14043da20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043da30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x730);
  return;
}



void Unwind_14043da40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3e0);
  return;
}



void Unwind_14043da50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb20);
  return;
}



void Unwind_14043da60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043da70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x420);
  return;
}



void Unwind_14043da80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb30);
  return;
}



void Unwind_14043da90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043daa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043dab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb40);
  return;
}



void Unwind_14043dac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x188);
  return;
}



void Unwind_14043dae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb50);
  return;
}



void Unwind_14043daf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043db00(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1100);
  return;
}



void Unwind_14043db10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x150);
  return;
}



void Unwind_14043db20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb60);
  return;
}



void Unwind_14043db30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043db40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_14043db50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb70);
  return;
}



void Unwind_14043db60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043db70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3f0);
  return;
}



void Unwind_14043db80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb80);
  return;
}



void Unwind_14043db90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_14043dbb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb90);
  return;
}



void Unwind_14043dbc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dbd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_14043dbe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xba0);
  return;
}



void Unwind_14043dbf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dc00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043dc10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbb0);
  return;
}



void Unwind_14043dc20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dc30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x440);
  return;
}



void Unwind_14043dc40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbc0);
  return;
}



void Unwind_14043dc50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dc60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_14043dc70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbd0);
  return;
}



void Unwind_14043dc80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dc90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4a8);
  return;
}



void Unwind_14043dca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbe0);
  return;
}



void Unwind_14043dcb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dcc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043dcd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbf0);
  return;
}



void Unwind_14043dce0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dcf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_14043dd00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc00);
  return;
}



void Unwind_14043dd10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dd20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a8);
  return;
}



void Unwind_14043dd30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc10);
  return;
}



void Unwind_14043dd40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dd50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x400);
  return;
}



void Unwind_14043dd60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc20);
  return;
}



void Unwind_14043dd70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dd80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x430);
  return;
}



void Unwind_14043dd90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc30);
  return;
}



void Unwind_14043dda0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043ddb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x118);
  return;
}



void Unwind_14043ddc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc40);
  return;
}



void Unwind_14043ddd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dde0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b8);
  return;
}



void Unwind_14043ddf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc50);
  return;
}



void Unwind_14043de00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043de10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x528);
  return;
}



void Unwind_14043de20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc60);
  return;
}



void Unwind_14043de30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043de40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x740);
  return;
}



void Unwind_14043de50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4b8);
  return;
}



void Unwind_14043de60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x858);
  return;
}



void Unwind_14043de70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043de80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x508);
  return;
}



void Unwind_14043de90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x878);
  return;
}



void Unwind_14043dea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043deb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x90);
  return;
}



void Unwind_14043dec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x898);
  return;
}



void Unwind_14043ded0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x128);
  return;
}



void Unwind_14043def0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8b8);
  return;
}



void Unwind_14043df00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043df10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4c8);
  return;
}



void Unwind_14043df20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8d8);
  return;
}



void Unwind_14043df30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043df40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043df50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x8f8);
  return;
}



void Unwind_14043df60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043df70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x7e0);
  return;
}



void Unwind_14043df80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c0);
  return;
}



void Unwind_14043df90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x918);
  return;
}



void Unwind_14043dfa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dfb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043dfc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x938);
  return;
}



void Unwind_14043dfd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043dfe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c8);
  return;
}



void Unwind_14043dff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x958);
  return;
}



void Unwind_14043e000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x750);
  return;
}



void Unwind_14043e020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x548);
  return;
}



void Unwind_14043e030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x978);
  return;
}



void Unwind_14043e040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4d8);
  return;
}



void Unwind_14043e060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x998);
  return;
}



void Unwind_14043e070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x468);
  return;
}



void Unwind_14043e090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9b8);
  return;
}



void Unwind_14043e0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e0b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x760);
  return;
}



void Unwind_14043e0c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe0);
  return;
}



void Unwind_14043e0d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9d8);
  return;
}



void Unwind_14043e0e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e0f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x138);
  return;
}



void Unwind_14043e100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x9f8);
  return;
}



void Unwind_14043e110(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e120(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1080);
  return;
}



void Unwind_14043e130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa18);
  return;
}



void Unwind_14043e150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa38);
  return;
}



void Unwind_14043e180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e1a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa58);
  return;
}



void Unwind_14043e1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e1c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x470);
  return;
}



void Unwind_14043e1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa78);
  return;
}



void Unwind_14043e1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x480);
  return;
}



void Unwind_14043e200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa98);
  return;
}



void Unwind_14043e210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x770);
  return;
}



void Unwind_14043e230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3c8);
  return;
}



void Unwind_14043e240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xab8);
  return;
}



void Unwind_14043e250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x780);
  return;
}



void Unwind_14043e270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3d8);
  return;
}



void Unwind_14043e280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xad8);
  return;
}



void Unwind_14043e290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e2a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xaf8);
  return;
}



void Unwind_14043e2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e2d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x490);
  return;
}



void Unwind_14043e2e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb18);
  return;
}



void Unwind_14043e2f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb38);
  return;
}



void Unwind_14043e320(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e330(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x10a0);
  return;
}



void Unwind_14043e340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x148);
  return;
}



void Unwind_14043e350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb58);
  return;
}



void Unwind_14043e360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb78);
  return;
}



void Unwind_14043e390(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e3a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d8);
  return;
}



void Unwind_14043e3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb98);
  return;
}



void Unwind_14043e3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e3d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x158);
  return;
}



void Unwind_14043e3e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 3000);
  return;
}



void Unwind_14043e3f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 1000);
  return;
}



void Unwind_14043e410(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbd8);
  return;
}



void Unwind_14043e420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e430(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x10e0);
  return;
}



void Unwind_14043e440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x3f8);
  return;
}



void Unwind_14043e450(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbf8);
  return;
}



void Unwind_14043e460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4a0);
  return;
}



void Unwind_14043e480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc18);
  return;
}



void Unwind_14043e490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e4a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4b0);
  return;
}



void Unwind_14043e4b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc38);
  return;
}



void Unwind_14043e4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e4e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc58);
  return;
}



void Unwind_14043e4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x790);
  return;
}



void Unwind_14043e510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_14043e520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc78);
  return;
}



void Unwind_14043e530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x170);
  return;
}



void Unwind_14043e550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc98);
  return;
}



void Unwind_14043e560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x408);
  return;
}



void Unwind_14043e580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcb8);
  return;
}



void Unwind_14043e590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e5a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x418);
  return;
}



void Unwind_14043e5b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcd8);
  return;
}



void Unwind_14043e5c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e5d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x428);
  return;
}



void Unwind_14043e5e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcf8);
  return;
}



void Unwind_14043e5f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7a0);
  return;
}



void Unwind_14043e610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x438);
  return;
}



void Unwind_14043e620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd18);
  return;
}



void Unwind_14043e630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x180);
  return;
}



void Unwind_14043e650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd38);
  return;
}



void Unwind_14043e660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x7b0);
  return;
}



void Unwind_14043e680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_14043e690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd58);
  return;
}



void Unwind_14043e6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e6b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd78);
  return;
}



void Unwind_14043e6d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e6e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4c0);
  return;
}



void Unwind_14043e6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd98);
  return;
}



void Unwind_14043e700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e710(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_14043e720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdb8);
  return;
}



void Unwind_14043e730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_14043e750(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdd8);
  return;
}



void Unwind_14043e760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdf8);
  return;
}



void Unwind_14043e790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_14043e7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe18);
  return;
}



void Unwind_14043e7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e7d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1120);
  return;
}



void Unwind_14043e7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e7f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe38);
  return;
}



void Unwind_14043e800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4d0);
  return;
}



void Unwind_14043e820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe58);
  return;
}



void Unwind_14043e830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e840(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4e0);
  return;
}



void Unwind_14043e850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe78);
  return;
}



void Unwind_14043e860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_14043e880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe98);
  return;
}



void Unwind_14043e890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e8a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4f0);
  return;
}



void Unwind_14043e8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xeb8);
  return;
}



void Unwind_14043e8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e8d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e8e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xed8);
  return;
}



void Unwind_14043e8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x500);
  return;
}



void Unwind_14043e910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xef8);
  return;
}



void Unwind_14043e920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf18);
  return;
}



void Unwind_14043e950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x510);
  return;
}



void Unwind_14043e970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf38);
  return;
}



void Unwind_14043e980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x520);
  return;
}



void Unwind_14043e9a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf58);
  return;
}



void Unwind_14043e9b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043e9d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf78);
  return;
}



void Unwind_14043e9e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043e9f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x530);
  return;
}



void Unwind_14043ea00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf98);
  return;
}



void Unwind_14043ea10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043ea20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x700);
  return;
}



void Unwind_14043ea30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x540);
  return;
}



void Unwind_14043ea40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x840);
  return;
}



void Unwind_14043ea50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043ea60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043ea70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfd8);
  return;
}



void Unwind_14043ea80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043ea90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043eaa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xff8);
  return;
}



void Unwind_14043eab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043eac0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x10c0);
  return;
}



void Unwind_14043ead0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_14043eae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1018);
  return;
}



void Unwind_14043eaf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x68));
  return;
}



void Unwind_14043eb00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e0);
  return;
}



void Unwind_14043eb10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcc0);
  return;
}



void Unwind_14043eb20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_14043eb30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x458);
  return;
}



void Unwind_14043eb40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_14043eb50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd90);
  return;
}



void Unwind_14043eb60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_14043eb70(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x6e0);
  return;
}



void Unwind_14043eb80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043eb90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xda0);
  return;
}



void Unwind_14043eba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ebb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x920);
  return;
}



void Unwind_14043ebc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043ebd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdb0);
  return;
}



void Unwind_14043ebe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ebf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe8);
  return;
}



void Unwind_14043ec00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdc0);
  return;
}



void Unwind_14043ec10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ec20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x120);
  return;
}



void Unwind_14043ec30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdd0);
  return;
}



void Unwind_14043ec40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ec50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c8);
  return;
}



void Unwind_14043ec60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xde0);
  return;
}



void Unwind_14043ec70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ec80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x278);
  return;
}



void Unwind_14043ec90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdf0);
  return;
}



void Unwind_14043eca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ecb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x720);
  return;
}



void Unwind_14043ecc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a0);
  return;
}



void Unwind_14043ecd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe00);
  return;
}



void Unwind_14043ece0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ecf0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa20);
  return;
}



void Unwind_14043ed00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d8);
  return;
}



void Unwind_14043ed10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe10);
  return;
}



void Unwind_14043ed20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ed30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x158);
  return;
}



void Unwind_14043ed40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe20);
  return;
}



void Unwind_14043ed50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ed60(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x760);
  return;
}



void Unwind_14043ed70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x238);
  return;
}



void Unwind_14043ed80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe30);
  return;
}



void Unwind_14043ed90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043eda0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x960);
  return;
}



void Unwind_14043edb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1e8);
  return;
}



void Unwind_14043edc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe40);
  return;
}



void Unwind_14043edd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ede0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x268);
  return;
}



void Unwind_14043edf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe50);
  return;
}



void Unwind_14043ee00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ee10(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x7a0);
  return;
}



void Unwind_14043ee20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f8);
  return;
}



void Unwind_14043ee30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe60);
  return;
}



void Unwind_14043ee40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ee50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x248);
  return;
}



void Unwind_14043ee60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe70);
  return;
}



void Unwind_14043ee70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ee80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xac0);
  return;
}



void Unwind_14043ee90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x138);
  return;
}



void Unwind_14043eea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe90);
  return;
}



void Unwind_14043eeb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043eec0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x7e0);
  return;
}



void Unwind_14043eed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x208);
  return;
}



void Unwind_14043eee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xeb0);
  return;
}



void Unwind_14043eef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ef00(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x9a0);
  return;
}



void Unwind_14043ef10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x288);
  return;
}



void Unwind_14043ef20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xed0);
  return;
}



void Unwind_14043ef30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ef40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x820);
  return;
}



void Unwind_14043ef50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x218);
  return;
}



void Unwind_14043ef60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xef0);
  return;
}



void Unwind_14043ef70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043ef80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa80);
  return;
}



void Unwind_14043ef90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 600);
  return;
}



void Unwind_14043efa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf10);
  return;
}



void Unwind_14043efb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043efc0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x860);
  return;
}



void Unwind_14043efd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1a8);
  return;
}



void Unwind_14043efe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf30);
  return;
}



void Unwind_14043eff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b8);
  return;
}



void Unwind_14043f010(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf50);
  return;
}



void Unwind_14043f020(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f030(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x9e0);
  return;
}



void Unwind_14043f040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x178);
  return;
}



void Unwind_14043f050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf70);
  return;
}



void Unwind_14043f060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f070(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a8);
  return;
}



void Unwind_14043f080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf90);
  return;
}



void Unwind_14043f090(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f0a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4b8);
  return;
}



void Unwind_14043f0b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x98);
  return;
}



void Unwind_14043f0c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfb0);
  return;
}



void Unwind_14043f0d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f0e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1c0);
  return;
}



void Unwind_14043f0f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbb0);
  return;
}



void Unwind_14043f100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f110(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x8a0);
  return;
}



void Unwind_14043f120(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x100);
  return;
}



void Unwind_14043f130(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbd0);
  return;
}



void Unwind_14043f140(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1d0);
  return;
}



void Unwind_14043f160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfc0);
  return;
}



void Unwind_14043f170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f180(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xb00);
  return;
}



void Unwind_14043f190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1b0);
  return;
}



void Unwind_14043f1a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfd0);
  return;
}



void Unwind_14043f1b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f1c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x8e0);
  return;
}



void Unwind_14043f1d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x1f0);
  return;
}



void Unwind_14043f1e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfe0);
  return;
}



void Unwind_14043f1f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f200(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x6a0);
  return;
}



void Unwind_14043f210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x200);
  return;
}



void Unwind_14043f220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xff0);
  return;
}



void Unwind_14043f230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x148);
  return;
}



void Unwind_14043f250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xdf8);
  return;
}



void Unwind_14043f260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b8);
  return;
}



void Unwind_14043f280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xff8);
  return;
}



void Unwind_14043f290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f2a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x6c0);
  return;
}



void Unwind_14043f2b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043f2c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe08);
  return;
}



void Unwind_14043f2d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f2e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x700);
  return;
}



void Unwind_14043f2f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x210);
  return;
}



void Unwind_14043f300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf08);
  return;
}



void Unwind_14043f310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f320(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x740);
  return;
}



void Unwind_14043f330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x220);
  return;
}



void Unwind_14043f340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe18);
  return;
}



void Unwind_14043f350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f360(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd0);
  return;
}



void Unwind_14043f370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf88);
  return;
}



void Unwind_14043f380(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f390(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x780);
  return;
}



void Unwind_14043f3a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x230);
  return;
}



void Unwind_14043f3b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe28);
  return;
}



void Unwind_14043f3c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f3d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x7c0);
  return;
}



void Unwind_14043f3e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x240);
  return;
}



void Unwind_14043f3f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf18);
  return;
}



void Unwind_14043f400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f410(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x800);
  return;
}



void Unwind_14043f420(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x168);
  return;
}



void Unwind_14043f430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe38);
  return;
}



void Unwind_14043f440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f450(undefined8 param_1,longlong param_2)

{
  FUN_14004bbc0(param_2 + 0x1008);
  return;
}



void Unwind_14043f460(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x680);
  return;
}



void Unwind_14043f470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043f480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfc8);
  return;
}



void Unwind_14043f490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f4a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x840);
  return;
}



void Unwind_14043f4b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043f4c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe48);
  return;
}



void Unwind_14043f4d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f4e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2a0);
  return;
}



void Unwind_14043f4f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf28);
  return;
}



void Unwind_14043f500(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f510(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x490);
  return;
}



void Unwind_14043f520(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_14043f530(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe58);
  return;
}



void Unwind_14043f540(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f550(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4b0);
  return;
}



void Unwind_14043f560(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x470);
  return;
}



void Unwind_14043f570(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa0);
  return;
}



void Unwind_14043f580(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf98);
  return;
}



void Unwind_14043f590(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f5a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x880);
  return;
}



void Unwind_14043f5b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x108);
  return;
}



void Unwind_14043f5c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe68);
  return;
}



void Unwind_14043f5d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f5e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x8c0);
  return;
}



void Unwind_14043f5f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x110);
  return;
}



void Unwind_14043f600(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf38);
  return;
}



void Unwind_14043f610(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x480);
  return;
}



void Unwind_14043f630(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf8);
  return;
}



void Unwind_14043f640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe78);
  return;
}



void Unwind_14043f650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x4a0);
  return;
}



void Unwind_14043f670(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf0);
  return;
}



void Unwind_14043f680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfe8);
  return;
}



void Unwind_14043f690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f6a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x250);
  return;
}



void Unwind_14043f6b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe88);
  return;
}



void Unwind_14043f6c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f6d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x900);
  return;
}



void Unwind_14043f6e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x118);
  return;
}



void Unwind_14043f6f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf48);
  return;
}



void Unwind_14043f700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f710(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x940);
  return;
}



void Unwind_14043f720(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x130);
  return;
}



void Unwind_14043f730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xe98);
  return;
}



void Unwind_14043f740(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f750(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x980);
  return;
}



void Unwind_14043f760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043f770(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfa8);
  return;
}



void Unwind_14043f780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x460);
  return;
}



void Unwind_14043f7a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x140);
  return;
}



void Unwind_14043f7b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xea8);
  return;
}



void Unwind_14043f7c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f7d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043f7e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf58);
  return;
}



void Unwind_14043f7f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f800(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x468);
  return;
}



void Unwind_14043f810(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x260);
  return;
}



void Unwind_14043f820(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xeb8);
  return;
}



void Unwind_14043f830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f840(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x9c0);
  return;
}



void Unwind_14043f850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043f860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfd8);
  return;
}



void Unwind_14043f870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f880(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa00);
  return;
}



void Unwind_14043f890(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x270);
  return;
}



void Unwind_14043f8a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xec8);
  return;
}



void Unwind_14043f8b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f8c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x478);
  return;
}



void Unwind_14043f8d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x150);
  return;
}



void Unwind_14043f8e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf68);
  return;
}



void Unwind_14043f8f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2b0);
  return;
}



void Unwind_14043f910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xed8);
  return;
}



void Unwind_14043f920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f930(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa60);
  return;
}



void Unwind_14043f940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043f950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xfb8);
  return;
}



void Unwind_14043f960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f970(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb0);
  return;
}



void Unwind_14043f980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xee8);
  return;
}



void Unwind_14043f990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f9a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x488);
  return;
}



void Unwind_14043f9b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x160);
  return;
}



void Unwind_14043f9c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xf78);
  return;
}



void Unwind_14043f9d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043f9e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xaa0);
  return;
}



void Unwind_14043f9f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x280);
  return;
}



void Unwind_14043fa00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xef8);
  return;
}



void Unwind_14043fa10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fa20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x2c0);
  return;
}



void Unwind_14043fa30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xbf0);
  return;
}



void Unwind_14043fa40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fa50(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xae0);
  return;
}



void Unwind_14043fa60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x70);
  return;
}



void Unwind_14043fa70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc10);
  return;
}



void Unwind_14043fa80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fa90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc0);
  return;
}



void Unwind_14043faa0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc30);
  return;
}



void Unwind_14043fab0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x170);
  return;
}



void Unwind_14043fad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc50);
  return;
}



void Unwind_14043fae0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043faf0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xb20);
  return;
}



void Unwind_14043fb00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x180);
  return;
}



void Unwind_14043fb10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc70);
  return;
}



void Unwind_14043fb20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fb30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xb8);
  return;
}



void Unwind_14043fb40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xc90);
  return;
}



void Unwind_14043fb50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fb60(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa40);
  return;
}



void Unwind_14043fb70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x290);
  return;
}



void Unwind_14043fb80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcb0);
  return;
}



void Unwind_14043fb90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 200);
  return;
}



void Unwind_14043fbb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcd0);
  return;
}



void Unwind_14043fbc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fbd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x498);
  return;
}



void Unwind_14043fbe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd8);
  return;
}



void Unwind_14043fbf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xcf0);
  return;
}



void Unwind_14043fc00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fc10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x128);
  return;
}



void Unwind_14043fc20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd10);
  return;
}



void Unwind_14043fc30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fc40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 400);
  return;
}



void Unwind_14043fc50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd30);
  return;
}



void Unwind_14043fc60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fc70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0x4a8);
  return;
}



void Unwind_14043fc80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x228);
  return;
}



void Unwind_14043fc90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd50);
  return;
}



void Unwind_14043fca0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fcb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x298);
  return;
}



void Unwind_14043fcc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xd70);
  return;
}



void Unwind_14043fcd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(*(undefined8 *)(param_2 + 0x78));
  return;
}



void Unwind_14043fce0(undefined8 param_1,longlong param_2)

{
  FUN_14016ec80(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14043fcf0(undefined8 param_1,longlong param_2)

{
  FUN_14000d690(*(longlong *)(param_2 + 0x40) + 0x9a0);
  return;
}



void Unwind_14043fd10(undefined8 param_1,longlong param_2)

{
  FUN_140017490(*(longlong *)(param_2 + 0x40) + 0x9a8);
  return;
}



void Unwind_14043fd30(undefined8 param_1,longlong param_2)

{
  FUN_140385b20(*(undefined8 *)(param_2 + 0x48));
  return;
}



void Unwind_14043fd40(undefined8 param_1,longlong param_2)

{
  FUN_140017440(*(longlong *)(param_2 + 0x40) + 0x9c8);
  return;
}



void Unwind_14043fd60(undefined8 param_1,longlong param_2)

{
  FUN_14000c870(*(longlong *)(param_2 + 0x40) + 0x9e8);
  return;
}



void Catch_All_14043fd80(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_14043fdb0(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_14043fde0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14043fe10(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x28));
  return;
}



void Unwind_14043fe30(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_14043fe40(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x30) + 0x20);
  return;
}



void Catch_All_14043fe50(undefined8 param_1,longlong param_2)

{
  longlong lVar1;
  longlong lVar2;
  
  lVar1 = *(longlong *)(param_2 + 0x70);
  for (lVar2 = *(longlong *)(param_2 + 0x78); lVar2 != lVar1; lVar2 = lVar2 + 0x60) {
    FUN_1402df1d0();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_14043fe90(void)

{
  FUN_1402e1490();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_14043fee0(undefined8 param_1,longlong param_2)

{
  FUN_1402df1d0(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_14043fef0(undefined8 param_1,longlong param_2)

{
  FUN_1402dfdb0(param_2 + 0x1d0);
  return;
}



void Unwind_14043ff00(undefined8 param_1,longlong param_2)

{
  Concurrency::details::SubAllocator::~SubAllocator((SubAllocator *)(param_2 + 0x40));
  return;
}



void Unwind_14043ff10(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x20);
  return;
}



void Unwind_14043ff20(undefined8 param_1,longlong param_2)

{
  FUN_1401682b0(param_2 + 0x20);
  return;
}



void Unwind_14043ff30(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x20);
  return;
}



void Unwind_14043ff40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_14043ff50(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x20);
  return;
}



void Unwind_14043ff60(undefined8 param_1,longlong param_2)

{
  FUN_1402ce3c0(param_2 + 0x80);
  return;
}



void Unwind_14043ff70(undefined8 param_1,longlong param_2)

{
  FUN_1402c43f0(param_2 + 0x30);
  return;
}



void Unwind_14043ff80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_14043ff90(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_14043ffa0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_14043ffb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140297310(*(longlong *)(param_2 + 0x40) + 0x68);
  return;
}



void Unwind_14043ffc0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_14043ffd0(undefined8 param_1,longlong param_2)

{
  FUN_1402794d0(param_2 + 0x28);
  return;
}



void Unwind_14043ffe0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140440000(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140440010(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140440020(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140440030(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140440040(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Catch_All_140440050(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_140440080(void)

{
  FUN_14020f3d0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404400b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404400c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401798f0(param_2 + 0x48);
  return;
}



void Unwind_1404400d0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x80) & 1) != 0) {
    *(uint *)(param_2 + 0x80) = *(uint *)(param_2 + 0x80) & 0xfffffffe;
    thunk_FUN_1401798f0(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Catch_All_140440100(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_140440130(void)

{
  FUN_1401e5370();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140440160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401798f0(param_2 + 0x30);
  return;
}



void Unwind_140440170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x68);
  return;
}



void Unwind_140440180(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140440190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_1404401a0(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x130);
  return;
}



void Unwind_1404401b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x160);
  return;
}



void Unwind_1404401c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140188b00(param_2 + 0xa8);
  return;
}



void Unwind_1404401d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401798f0(param_2 + 0x50);
  return;
}



void Unwind_1404401e0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404401e7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0xb8));
  return;
}



void Unwind_1404401f0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404401f7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0xb8));
  return;
}



void Unwind_140440200(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x20);
  return;
}



void Unwind_140440210(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x50);
  return;
}



void Unwind_140440220(undefined8 param_1,longlong param_2)

{
  FUN_14012c340(param_2 + 0x80);
  return;
}



void Unwind_140440230(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140440240(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140440250(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x58);
  return;
}



void Unwind_140440260(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140440270(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140440280(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140440290(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(param_2 + 0x58);
  return;
}



void Unwind_1404402a0(undefined8 param_1,longlong param_2)

{
  FUN_14012c7f0(param_2 + 0x20);
  return;
}



undefined * Catch_1404402b0(undefined8 param_1,longlong param_2)

{
  char *_Str;
  
  _Str = (char *)(**(code **)(**(longlong **)(param_2 + 0x48) + 8))();
  puts(_Str);
  return &DAT_14012c1ad;
}



void Unwind_1404402e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404402f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x80);
  return;
}



void Unwind_140440300(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_140440310(undefined8 param_1,longlong param_2)

{
  FUN_14012c980(param_2 + 0x98);
  return;
}



void Unwind_140440320(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140440330(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140440337. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_140440340(undefined8 param_1,longlong param_2)

{
  FUN_140007590(param_2 + 0x58);
  return;
}



void Unwind_140440350(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140440370(undefined8 param_1,longlong param_2)

{
  FUN_1400075f0(param_2 + 0x48);
  return;
}



void Unwind_140440380(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1404403a0(undefined8 param_1,longlong param_2)

{
  FUN_1400075f0(param_2 + 0x60);
  return;
}



void Unwind_1404403b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1404403d0(undefined8 param_1,longlong param_2)

{
  FUN_1400075f0(param_2 + 0x40);
  return;
}



void Unwind_1404403e0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140440400(undefined8 param_1,longlong param_2)

{
  FUN_1400075f0(param_2 + 0x50);
  return;
}



void Unwind_140440410(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140440417. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_140440420(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140440440(undefined8 param_1,longlong param_2)

{
  FUN_140007680(param_2 + 0x28);
  return;
}



void Unwind_140440450(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140440460(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140440470(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 0x130);
  return;
}



void Unwind_140440480(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 0x1f0);
  return;
}



void Unwind_140440490(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 400);
  return;
}



void Unwind_1404404a0(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 0x250);
  return;
}



void Unwind_1404404b0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404404b7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_1404404c0(undefined8 param_1,longlong param_2)

{
  FUN_140013c70(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_1404404d0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x108);
  return;
}



void Unwind_1404404e0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0xf8);
  return;
}



void Unwind_1404404f0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x118);
  return;
}



void Unwind_140440500(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd0);
  return;
}



void Unwind_140440510(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(undefined8 *)(param_2 + 0x20));
  return;
}



void Unwind_140440520(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140440527. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete__(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_140440530(undefined8 param_1,longlong param_2)

{
  FUN_1402bf480(param_2 + 0xe0);
  return;
}



void Unwind_140440540(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_140440550(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xf0) + 8);
  return;
}



void Unwind_140440560(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x40);
  return;
}



void Unwind_140440570(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xe8) + 8);
  return;
}



void Unwind_140440580(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x60);
  return;
}



void Unwind_140440590(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xa0) + 8);
  return;
}



void Catch_All_1404405a0(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_140249180();
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_1404405e0(undefined8 param_1,longlong param_2)

{
  operator_delete(*(void **)(param_2 + 0x58));
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140440610(undefined8 param_1,longlong param_2)

{
  FUN_1402950c0(param_2 + 0xd70);
  return;
}



void Unwind_140440620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140249180(param_2 + 0x48);
  return;
}



void Unwind_140440630(undefined8 param_1,longlong param_2)

{
  FUN_140297330(param_2 + 0xb0);
  return;
}



void Unwind_140440640(undefined8 param_1,longlong param_2)

{
  FUN_1401682b0(param_2 + 0x28);
  return;
}



void Unwind_140440650(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x20) & 1) != 0) {
    *(uint *)(param_2 + 0x20) = *(uint *)(param_2 + 0x20) & 0xfffffffe;
    thunk_FUN_140249180(*(undefined8 *)(param_2 + 0xa8));
  }
  return;
}



void Unwind_140440680(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_140440690(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_1404406a0(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_1404406b0(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_1404406c0(undefined8 param_1,longlong param_2)

{
  FUN_140168450(param_2 + 0x60);
  return;
}



void Unwind_1404406d0(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_1404406e0(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_1404406f0(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_140440700(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_140440710(undefined8 param_1,longlong param_2)

{
  FUN_1401e04b0(param_2 + 0x30);
  return;
}



void Unwind_140440720(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140440727. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0xb0));
  return;
}



void Unwind_140440730(undefined8 param_1,longlong param_2)

{
  FUN_1402f6970(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140440740(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x80) + 0x13d8);
  return;
}



void Unwind_140440760(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x80) + 0x13e8);
  return;
}



void Unwind_140440780(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1478);
  return;
}



void Unwind_1404407a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x14a0);
  return;
}



void Unwind_1404407c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x14c8);
  return;
}



void Unwind_1404407e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x14f0);
  return;
}



void Unwind_140440800(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1518);
  return;
}



void Unwind_140440820(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1540);
  return;
}



void Unwind_140440840(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1568);
  return;
}



void Unwind_140440860(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1590);
  return;
}



void Unwind_140440880(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x15b8);
  return;
}



void Unwind_1404408a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x15e0);
  return;
}



void Unwind_1404408c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1608);
  return;
}



void Unwind_1404408e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1630);
  return;
}



void Unwind_140440900(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1658);
  return;
}



void Unwind_140440920(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1680);
  return;
}



void Unwind_140440940(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x16a8);
  return;
}



void Unwind_140440960(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x16d0);
  return;
}



void Unwind_140440980(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x16f8);
  return;
}



void Unwind_1404409a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1720);
  return;
}



void Unwind_1404409c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1748);
  return;
}



void Unwind_1404409e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 6000);
  return;
}



void Unwind_140440a00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14023ae90(*(longlong *)(param_2 + 0x80) + 0x17c0);
  return;
}



void Unwind_140440a20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x17e8);
  return;
}



void Unwind_140440a40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x18a8);
  return;
}



void Unwind_140440a60(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x80) + 0x1af8);
  return;
}



void Unwind_140440a80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1b18);
  return;
}



void Unwind_140440aa0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x80) + 0x1b40),0x28,4,FUN_14023be90);
  return;
}



void Unwind_140440ae0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1be0);
  return;
}



void Unwind_140440b00(undefined8 param_1,longlong param_2)

{
  FUN_14027dc20(*(longlong *)(param_2 + 0x80) + 0x1c10);
  return;
}



void Unwind_140440b20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(*(longlong *)(param_2 + 0x80) + 0x1c78);
  return;
}



void Unwind_140440b40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020f700(*(longlong *)(param_2 + 0x80) + 0x1c88);
  return;
}



void Unwind_140440b60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020f640(*(longlong *)(param_2 + 0x80) + 0x1c98);
  return;
}



void Unwind_140440b80(undefined8 param_1,longlong param_2)

{
  FUN_140217200(*(longlong *)(param_2 + 0x80) + 0x1d58);
  return;
}



void Unwind_140440ba0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1dd0);
  return;
}



void Unwind_140440bc0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1e60);
  return;
}



void Unwind_140440be0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x1ee0);
  return;
}



void Unwind_140440c00(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1f08);
  return;
}



void Unwind_140440c20(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1f28);
  return;
}



void Unwind_140440c40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1f48);
  return;
}



void Unwind_140440c60(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1f68);
  return;
}



void Unwind_140440c80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1f88);
  return;
}



void Unwind_140440ca0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1fa8);
  return;
}



void Unwind_140440cc0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1fc8);
  return;
}



void Unwind_140440ce0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x1fe8);
  return;
}



void Unwind_140440d00(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x80) + 0x2008);
  return;
}



void Unwind_140440d20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x80) + 0x20a0);
  return;
}



void Unwind_140440d40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140440d50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140440d60(undefined8 param_1,longlong param_2)

{
  FUN_1402f6970(*(undefined8 *)(param_2 + 0x60));
  return;
}



void Unwind_140440d70(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x60) + 0x13d8);
  return;
}



void Unwind_140440d90(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x60) + 0x13e8);
  return;
}



void Unwind_140440db0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1478);
  return;
}



void Unwind_140440dd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x14a0);
  return;
}



void Unwind_140440df0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x14c8);
  return;
}



void Unwind_140440e10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x14f0);
  return;
}



void Unwind_140440e30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1518);
  return;
}



void Unwind_140440e50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1540);
  return;
}



void Unwind_140440e70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1568);
  return;
}



void Unwind_140440e90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1590);
  return;
}



void Unwind_140440eb0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x15b8);
  return;
}



void Unwind_140440ed0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x15e0);
  return;
}



void Unwind_140440ef0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1608);
  return;
}



void Unwind_140440f10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1630);
  return;
}



void Unwind_140440f30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1658);
  return;
}



void Unwind_140440f50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1680);
  return;
}



void Unwind_140440f70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x16a8);
  return;
}



void Unwind_140440f90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x16d0);
  return;
}



void Unwind_140440fb0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x16f8);
  return;
}



void Unwind_140440fd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1720);
  return;
}



void Unwind_140440ff0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1748);
  return;
}



void Unwind_140441010(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 6000);
  return;
}



void Unwind_140441030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14023ae90(*(longlong *)(param_2 + 0x60) + 0x17c0);
  return;
}



void Unwind_140441050(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x17e8);
  return;
}



void Unwind_140441070(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x18a8);
  return;
}



void Unwind_140441090(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x60) + 0x1af8);
  return;
}



void Unwind_1404410b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1b18);
  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_1404410d0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x60) + 0x1b40),0x28,4,FUN_14023be90);
  return;
}



void Unwind_140441110(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1be0);
  return;
}



void Unwind_140441130(undefined8 param_1,longlong param_2)

{
  FUN_14027dc20(*(longlong *)(param_2 + 0x60) + 0x1c10);
  return;
}



void Unwind_140441150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(*(longlong *)(param_2 + 0x60) + 0x1c78);
  return;
}



void Unwind_140441170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020f700(*(longlong *)(param_2 + 0x60) + 0x1c88);
  return;
}



void Unwind_140441190(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020f640(*(longlong *)(param_2 + 0x60) + 0x1c98);
  return;
}



void Unwind_1404411b0(undefined8 param_1,longlong param_2)

{
  FUN_140217200(*(longlong *)(param_2 + 0x60) + 0x1d58);
  return;
}



void Unwind_1404411d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1dd0);
  return;
}



void Unwind_1404411f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1e60);
  return;
}



void Unwind_140441210(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x1ee0);
  return;
}



void Unwind_140441230(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1f08);
  return;
}



void Unwind_140441250(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1f28);
  return;
}



void Unwind_140441270(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1f48);
  return;
}



void Unwind_140441290(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1f68);
  return;
}



void Unwind_1404412b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1f88);
  return;
}



void Unwind_1404412d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1fa8);
  return;
}



void Unwind_1404412f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1fc8);
  return;
}



void Unwind_140441310(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x1fe8);
  return;
}



void Unwind_140441330(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x60) + 0x2008);
  return;
}



void Unwind_140441350(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x60) + 0x20a0);
  return;
}



void Unwind_140441370(undefined8 param_1,longlong param_2)

{
  FUN_1402172a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140441380(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x20f0);
  return;
}



void Unwind_1404413a0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x2148);
  return;
}



void Unwind_1404413c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x2158);
  return;
}



void Unwind_1404413e0(undefined8 param_1,longlong param_2)

{
  FUN_1402172a0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1404413f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x20f0);
  return;
}



void Unwind_140441410(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x2148);
  return;
}



void Unwind_140441430(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x2158);
  return;
}



void Unwind_140441450(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x50) + 0x2168);
  return;
}



void Catch_All_140441470(void)

{
  FUN_14020f2b0();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404414a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_1404414b0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404414b7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1404414c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_1404414d0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x60);
  return;
}



void Unwind_1404414e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_1404414f0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404414f7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x1e8));
  return;
}



void Unwind_140441500(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x20);
  return;
}



void Unwind_140441510(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x128);
  return;
}



void Unwind_140441520(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x60);
  return;
}



void Unwind_140441530(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_140441540(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x60);
  return;
}



void Unwind_140441550(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 200) + 8);
  return;
}



void Unwind_140441560(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_140441570(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xc0) + 8);
  return;
}



void Unwind_140441580(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_140441590(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x80) + 8);
  return;
}



void Unwind_1404415a0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x60);
  return;
}



void Unwind_1404415b0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xd0) + 8);
  return;
}



void Unwind_1404415c0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_1404415d0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 200) + 8);
  return;
}



void Unwind_1404415e0(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_1404415f0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xa8) + 8);
  return;
}



void Catch_All_140441600(void)

{
  FUN_140342e90();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140441620(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_140341eb0(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Catch_All_140441660(undefined8 param_1,longlong param_2)

{
  void *pvVar1;
  
  pvVar1 = *(void **)(param_2 + 0x48);
  if (pvVar1 != (void *)0x0) {
    FUN_140340870(pvVar1);
    operator_delete(pvVar1);
  }
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_1404416a0(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404416b0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x30),*(undefined8 *)(param_2 + 0x20));
  return;
}



void Catch_All_1404416d0(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 Catch_All_140441700(void)

{
  FUN_140304d40();
                    // WARNING: Subroutine does not return
  _CxxThrowException((void *)0x0,(ThrowInfo *)0x0);
}



void Unwind_140441730(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_140441740(undefined8 param_1,longlong param_2)

{
  FUN_1401682b0(param_2 + 0x28);
  return;
}



void Unwind_140441750(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_140441760(undefined8 param_1,longlong param_2)

{
  FUN_1402c61f0(*(undefined8 *)(param_2 + 0xb0));
  return;
}



void Unwind_140441770(undefined8 param_1,longlong param_2)

{
  FUN_140168620(param_2 + 0x28);
  return;
}



void Unwind_140441780(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x20) & 1) != 0) {
    *(uint *)(param_2 + 0x20) = *(uint *)(param_2 + 0x20) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0x28));
  }
  return;
}



void Unwind_1404417b0(undefined8 param_1,longlong param_2)

{
  FUN_1402cf630(param_2 + 0x50);
  return;
}



void Unwind_1404417c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_1404417d0(undefined8 param_1,longlong param_2)

{
  FUN_1402c0ba0(param_2 + 0x50);
  return;
}



void Unwind_1404417e0(undefined8 param_1,longlong param_2)

{
  FUN_1402950c0(param_2 + 0x88);
  return;
}



void Unwind_1404417f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_140441800(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x60);
  return;
}



void Unwind_140441810(undefined8 param_1,longlong param_2)

{
  FUN_1402172a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140441820(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x20d0);
  return;
}



void Unwind_140441840(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x2140);
  return;
}



void Unwind_140441860(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x2150);
  return;
}



void Unwind_140441880(undefined8 param_1,longlong param_2)

{
  FUN_140139500(*(longlong *)(param_2 + 0x40) + 0x2170);
  return;
}



void Unwind_1404418a0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x21a8);
  return;
}



void Unwind_1404418c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x21e8);
  return;
}



void Unwind_1404418e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x21f8);
  return;
}



void Unwind_140441900(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x2230);
  return;
}



void Unwind_140441920(undefined8 param_1,longlong param_2)

{
  FUN_1402172a0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140441930(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x20d0);
  return;
}



void Unwind_140441950(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x2140);
  return;
}



void Unwind_140441970(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x2150);
  return;
}



void Unwind_140441990(undefined8 param_1,longlong param_2)

{
  FUN_140139500(*(longlong *)(param_2 + 0x40) + 0x2170);
  return;
}



void Unwind_1404419b0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x21a8);
  return;
}



void Unwind_1404419d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x21e8);
  return;
}



void Unwind_1404419f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x21f8);
  return;
}



void Unwind_140441a10(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x2230);
  return;
}



void Unwind_140441a30(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x2268);
  return;
}



void Unwind_140441a50(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_140441a60(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xb8) + 8);
  return;
}



void Unwind_140441a70(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_140441a80(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0xb0) + 8);
  return;
}



void Unwind_140441a90(undefined8 param_1,longlong param_2)

{
  FUN_140017dc0(param_2 + 0x48);
  return;
}



void Unwind_140441aa0(undefined8 param_1,longlong param_2)

{
  FUN_140017d50(*(longlong *)(param_2 + 0x90) + 8);
  return;
}



void Unwind_140441ab0(undefined8 param_1,longlong param_2)

{
  FUN_14033da50(param_2 + 0x28);
  return;
}



void Unwind_140441ac0(undefined8 param_1,longlong param_2)

{
  FUN_1402cdda0(param_2 + 0x38);
  return;
}



void Unwind_140441ad0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140441ae0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140441af0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x98) & 1) != 0) {
    *(uint *)(param_2 + 0x98) = *(uint *)(param_2 + 0x98) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0x80));
  }
  return;
}



void Unwind_140441b20(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441b27. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_140441b30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140441b40(undefined8 param_1,longlong param_2)

{
  FUN_140296440(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140441b50(undefined8 param_1,longlong param_2)

{
  FUN_1402963c0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140441b60(undefined8 param_1,longlong param_2)

{
  FUN_140294fc0(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140441b70(undefined8 param_1,longlong param_2)

{
  FUN_140167bd0(*(longlong *)(param_2 + 0x40) + 0x58);
  return;
}



void Unwind_140441b80(undefined8 param_1,longlong param_2)

{
  FUN_140294fe0(*(longlong *)(param_2 + 0x40) + 0x98);
  return;
}



void Unwind_140441ba0(undefined8 param_1,longlong param_2)

{
  FUN_140294fe0(*(longlong *)(param_2 + 0x40) + 200);
  return;
}



void Unwind_140441bc0(undefined8 param_1,longlong param_2)

{
  FUN_140296440(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140441bd0(undefined8 param_1,longlong param_2)

{
  FUN_14023c7b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140441be0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x22d8);
  return;
}



void Unwind_140441c00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_140441c10(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140441c20(undefined8 param_1,longlong param_2)

{
  FUN_1400078b0(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140441c30(undefined8 param_1,longlong param_2)

{
  FUN_140001ca0(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140441c40(undefined8 param_1,longlong param_2)

{
  FUN_14034edf0(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_140441c60(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441c67. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x48));
  return;
}



void Unwind_140441c70(undefined8 param_1,longlong param_2)

{
  FUN_140294fc0(param_2 + 0x28);
  return;
}



void Unwind_140441c80(undefined8 param_1,longlong param_2)

{
  FUN_140295d70(param_2 + 0x30);
  return;
}



void Unwind_140441c90(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x28),*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140441cb0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441cb7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_140441cc0(undefined8 param_1,longlong param_2)

{
  FUN_140295d70(param_2 + 0x28);
  return;
}



void Unwind_140441cd0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x78),*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140441cf0(undefined8 param_1,longlong param_2)

{
  FUN_1402950c0(param_2 + 0x160);
  return;
}



void Unwind_140441d00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x78);
  return;
}



void Unwind_140441d10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x100);
  return;
}



void Unwind_140441d20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xa0);
  return;
}



void Unwind_140441d30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140249180(param_2 + 0x20);
  return;
}



void Unwind_140441d40(undefined8 param_1,longlong param_2)

{
  FUN_140295d20(param_2 + 200);
  return;
}



void Unwind_140441d50(undefined8 param_1,longlong param_2)

{
  FUN_140295d20(param_2 + 0x128);
  return;
}



void Unwind_140441d60(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x128);
  return;
}



void Unwind_140441d70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 200);
  return;
}



void Unwind_140441d80(undefined8 param_1,longlong param_2)

{
  FUN_1402950c0(param_2 + 0x140);
  return;
}



void Unwind_140441d90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140249180(param_2 + 0x30);
  return;
}



void Unwind_140441da0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x90);
  return;
}



void Unwind_140441db0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_140441dc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xc0);
  return;
}



void Unwind_140441dd0(undefined8 param_1,longlong param_2)

{
  FUN_140167b70(param_2 + 0xc0);
  return;
}



void Unwind_140441de0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441de7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140441df0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441df7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140441e00(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441e07. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140441e10(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441e17. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140441e20(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441e27. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140441e30(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441e37. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140441e40(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441e47. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140441e50(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441e57. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x58));
  return;
}



void Unwind_140441e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140249180(param_2 + 0x38);
  return;
}



void Unwind_140441e70(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xb0) & 1) != 0) {
    *(uint *)(param_2 + 0xb0) = *(uint *)(param_2 + 0xb0) & 0xfffffffe;
    thunk_FUN_140249180(*(undefined8 *)(param_2 + 0xa8));
  }
  return;
}



void Unwind_140441ea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14023ae90(param_2 + 0x30);
  return;
}



void Unwind_140441eb0(undefined8 param_1,longlong param_2)

{
  FUN_14023ba90(param_2 + 0x80);
  return;
}



void Unwind_140441ec0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x138),*(undefined8 *)(param_2 + 0xdd8));
  return;
}



void Unwind_140441ef0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x138),*(undefined8 *)(param_2 + 0xdd8));
  return;
}



void Unwind_140441f20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(undefined8 *)(param_2 + 0x138));
  return;
}



void Unwind_140441f30(undefined8 param_1,longlong param_2)

{
  FUN_14027a520(param_2 + 0x40);
  return;
}



void Unwind_140441f40(undefined8 param_1,longlong param_2)

{
  FUN_14027a520(param_2 + 0x100);
  return;
}



void Unwind_140441f50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x168);
  return;
}



void Unwind_140441f60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x70);
  return;
}



void Unwind_140441f70(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140441f77. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x50));
  return;
}



void Unwind_140441f80(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xa8);
  return;
}



void Unwind_140441f90(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x30);
  return;
}



void Unwind_140441fa0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x80);
  return;
}



void Unwind_140441fb0(undefined8 param_1,longlong param_2)

{
  FUN_140279800(param_2 + 0x118);
  return;
}



void Unwind_140441fc0(undefined8 param_1,longlong param_2)

{
  FUN_140279800(param_2 + 200);
  return;
}



void Unwind_140441fd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 200);
  return;
}



void Unwind_140441fe0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x118);
  return;
}



void Unwind_140441ff0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020f640(param_2 + 0x28);
  return;
}



void Unwind_140442000(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 200) & 1) != 0) {
    *(uint *)(param_2 + 200) = *(uint *)(param_2 + 200) & 0xfffffffe;
    thunk_FUN_14020f640(*(undefined8 *)(param_2 + 0xb8));
  }
  return;
}



void Unwind_140442030(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140442040(undefined8 param_1,longlong param_2)

{
  FUN_14020eda0(param_2 + 0x48);
  return;
}



void Unwind_140442050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020f700(param_2 + 0x28);
  return;
}



void Unwind_140442060(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xb8) & 1) != 0) {
    *(uint *)(param_2 + 0xb8) = *(uint *)(param_2 + 0xb8) & 0xfffffffe;
    thunk_FUN_14020f700(*(undefined8 *)(param_2 + 0xa8));
  }
  return;
}



void Unwind_140442090(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404420a0(undefined8 param_1,longlong param_2)

{
  FUN_14020ea50(param_2 + 0x48);
  return;
}



void Unwind_1404420b0(undefined8 param_1,longlong param_2)

{
  FUN_140164ed0(param_2 + 0xd0);
  return;
}



void Unwind_1404420c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_1404420d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xa0);
  return;
}



void Unwind_1404420e0(undefined8 param_1,longlong param_2)

{
  FUN_1401654b0(param_2 + 0x880);
  return;
}



void Unwind_1404420f0(undefined8 param_1,longlong param_2)

{
  FUN_140147000(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_140442100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401660f0(*(longlong *)(param_2 + 0x90) + 0x40);
  return;
}



void Unwind_140442110(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x90) + 0xe0),0x38,8,FUN_14023be90);
  return;
}



void Unwind_140442150(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14032ce50(*(longlong *)(param_2 + 0x90) + 0x2a0);
  return;
}



void Unwind_140442170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14032ce50(*(longlong *)(param_2 + 0x90) + 0x2e8);
  return;
}



void Unwind_140442190(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x90) + 0x330),0x48,4,thunk_FUN_1401625e0);
  return;
}



void Unwind_1404421d0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x90) + 0x450),0x48,4,thunk_FUN_1401625e0);
  return;
}



void Unwind_140442210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(*(longlong *)(param_2 + 0x90) + 0x570);
  return;
}



void Unwind_140442230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(*(longlong *)(param_2 + 0x90) + 0x5b8);
  return;
}



void Unwind_140442250(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x50);
  return;
}



void Unwind_140442260(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x98);
  return;
}



void Unwind_140442270(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x70);
  return;
}



void Unwind_140442280(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140442290(undefined8 param_1,longlong param_2)

{
  FUN_1401625e0(*(longlong *)(param_2 + 0x40) + 0x38);
  return;
}



void Unwind_1404422a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(*(longlong *)(param_2 + 0x40) + 0x80);
  return;
}



void Unwind_1404422c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401625e0(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_1404422d0(undefined8 param_1,longlong param_2)

{
  FUN_140145db0(param_2 + 0x80);
  return;
}



void Unwind_1404422e0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x58);
  return;
}



void Unwind_1404422f0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x58);
  return;
}



void Unwind_140442300(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x58);
  return;
}



void Unwind_140442310(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x58);
  return;
}



void Unwind_140442320(undefined8 param_1,longlong param_2)

{
  FUN_140145e70(param_2 + 0x150);
  return;
}



void Unwind_140442330(undefined8 param_1,longlong param_2)

{
  FUN_140144e20(param_2 + 0x80);
  return;
}



void Unwind_140442340(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_140442350(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_140442360(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_140442370(undefined8 param_1,longlong param_2)

{
  FUN_140144ee0(param_2 + 0x140);
  return;
}



void Unwind_140442380(undefined8 param_1,longlong param_2)

{
  FUN_1401435b0(param_2 + 0x30);
  return;
}



void Unwind_140442390(undefined8 param_1,longlong param_2)

{
  FUN_140143600(param_2 + 0xa8);
  return;
}



void Unwind_1404423a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14014adf0(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_1404423b0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x48),0x20,0xb,FUN_140147140);
  return;
}



void Unwind_1404423e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_1404423f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_140442400(undefined8 param_1,longlong param_2)

{
  FUN_140141640(param_2 + 0x50);
  return;
}



void Unwind_140442410(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x140);
  return;
}



void Unwind_140442420(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x140);
  return;
}



void Unwind_140442430(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x140);
  return;
}



void Unwind_140442440(undefined8 param_1,longlong param_2)

{
  FUN_1401416b0(param_2 + 200);
  return;
}



void Unwind_140442450(undefined8 param_1,longlong param_2)

{
  FUN_1401407c0(param_2 + 0x50);
  return;
}



void Unwind_140442460(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xa8);
  return;
}



void Unwind_140442470(undefined8 param_1,longlong param_2)

{
  FUN_140136530(param_2 + 0xa8);
  return;
}



void Unwind_140442480(undefined8 param_1,longlong param_2)

{
  FUN_140140020(param_2 + 0x70);
  return;
}



void Unwind_140442490(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x130);
  return;
}



void Unwind_1404424a0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x40);
  return;
}



void Unwind_1404424b0(undefined8 param_1,longlong param_2)

{
  FUN_140140080(param_2 + 0x160);
  return;
}



void Unwind_1404424c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140149cb0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1404424d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_1404424e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140149a60(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1404424f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_140442500(undefined8 param_1,longlong param_2)

{
  FUN_14013ed60(param_2 + 0x40);
  return;
}



void Unwind_140442510(undefined8 param_1,longlong param_2)

{
  FUN_14013edf0(param_2 + 0x180);
  return;
}



void Unwind_140442520(undefined8 param_1,longlong param_2)

{
  FUN_14013dda0(param_2 + 0x1e0);
  return;
}



void Unwind_140442530(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x188);
  return;
}



void Unwind_140442540(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x138);
  return;
}



void Unwind_140442550(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1b0);
  return;
}



void Unwind_140442560(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x160);
  return;
}



void Unwind_140442570(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xf8);
  return;
}



void Unwind_140442580(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x118);
  return;
}



void Unwind_140442590(undefined8 param_1,longlong param_2)

{
  FUN_14013de00(param_2 + 0x2f0);
  return;
}



void Unwind_1404425a0(undefined8 param_1,longlong param_2)

{
  FUN_140176a20(param_2 + 0xa0);
  return;
}



void Unwind_1404425b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_1404425c0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x48);
  return;
}



void Unwind_1404425d0(undefined8 param_1,longlong param_2)

{
  FUN_1402d8ab0(param_2 + 0x140);
  return;
}



void Unwind_1404425e0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140442600(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140442620(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140442640(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401492c0(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140442650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_140442660(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0x90);
  return;
}



void Unwind_140442680(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0xd8);
  return;
}



void Unwind_1404426a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x120);
  return;
}



void Unwind_1404426c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x70) + 0x140);
  return;
}



void Unwind_1404426e0(undefined8 param_1,longlong param_2)

{
  FUN_140139d00(param_2 + 0x30);
  return;
}



void Unwind_1404426f0(undefined8 param_1,longlong param_2)

{
  FUN_140139d70(param_2 + 200);
  return;
}



void Unwind_140442700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148e60(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140442710(undefined8 param_1,longlong param_2)

{
  FUN_140139500(param_2 + 0x40);
  return;
}



void Unwind_140442720(undefined8 param_1,longlong param_2)

{
  FUN_140176a20(param_2 + 0xa0);
  return;
}



void Unwind_140442730(undefined8 param_1,longlong param_2)

{
  FUN_140138fb0(param_2 + 0x90);
  return;
}



void Unwind_140442740(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x180);
  return;
}



void Unwind_140442750(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x48);
  return;
}



void Unwind_140442760(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1a8);
  return;
}



void Unwind_140442770(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x68);
  return;
}



void Unwind_140442780(undefined8 param_1,longlong param_2)

{
  FUN_140139030(param_2 + 0x1d0);
  return;
}



void Unwind_140442790(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148a40(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1404427a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_1404427b0(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_1404427d0(undefined8 param_1,longlong param_2)

{
  FUN_140136530(param_2 + 0x68);
  return;
}



void Unwind_1404427e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x98);
  return;
}



void Unwind_1404427f0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xd0);
  return;
}



void Unwind_140442800(undefined8 param_1,longlong param_2)

{
  FUN_140136560(param_2 + 0x98);
  return;
}



void Unwind_140442810(undefined8 param_1,longlong param_2)

{
  FUN_140136560(param_2 + 0x98);
  return;
}



void Unwind_140442820(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140442840(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140442860(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 0x100);
  return;
}



void Unwind_140442870(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x50) + 8);
  return;
}



void Unwind_140442880(undefined8 param_1,longlong param_2)

{
  FUN_1401365f0(param_2 + 0x180);
  return;
}



void Unwind_140442890(undefined8 param_1,longlong param_2)

{
  FUN_140136600(param_2 + 0x180);
  return;
}



void Unwind_1404428a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x98);
  return;
}



void Unwind_1404428b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x68);
  return;
}



void Unwind_1404428c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd0);
  return;
}



void Unwind_1404428d0(undefined8 param_1,longlong param_2)

{
  FUN_140136710(param_2 + 0x280);
  return;
}



void Unwind_1404428e0(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140442900(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_140442920(undefined8 param_1,longlong param_2)

{
  FUN_140147000(*(undefined8 *)(param_2 + 0x50));
  return;
}



void Unwind_140442930(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148110(*(longlong *)(param_2 + 0x50) + 0x40);
  return;
}



void Unwind_140442940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148360(*(longlong *)(param_2 + 0x50) + 0x88);
  return;
}



void Unwind_140442960(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148520(*(longlong *)(param_2 + 0x50) + 0xd0);
  return;
}



void Unwind_140442980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401486e0(*(longlong *)(param_2 + 0x50) + 0x118);
  return;
}



void Unwind_1404429a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401487f0(*(longlong *)(param_2 + 0x50) + 0x160);
  return;
}



void Unwind_1404429c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401487f0(*(longlong *)(param_2 + 0x50) + 0x1a8);
  return;
}



void Unwind_1404429e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148360(*(longlong *)(param_2 + 0x50) + 0x1f0);
  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_140442a00(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x238),0x20,0xc,FUN_140162300);
  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_140442a40(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_
            ((void *)(*(longlong *)(param_2 + 0x50) + 0x3b8),0x20,4,FUN_140162300);
  return;
}



void Unwind_140442a80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1d0);
  return;
}



void Unwind_140442aa0(undefined8 param_1,longlong param_2)

{
  FUN_140130a50(param_2 + 0x130);
  return;
}



void Unwind_140442ab0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x238);
  return;
}



void Unwind_140442ac0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x2b0);
  return;
}



void Unwind_140442ad0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x210);
  return;
}



void Unwind_140442ae0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x288);
  return;
}



void Unwind_140442af0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x260);
  return;
}



void Unwind_140442b00(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x70);
  return;
}



void Unwind_140442b10(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x90);
  return;
}



void Unwind_140442b20(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xd0);
  return;
}



void Unwind_140442b30(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x108);
  return;
}



void Unwind_140442b40(undefined8 param_1,longlong param_2)

{
  FUN_140130aa0(param_2 + 0x2e0);
  return;
}



void Unwind_140442b50(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 8);
  return;
}



void Unwind_140442b60(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(longlong *)(param_2 + 0x40) + 0x18);
  return;
}



void Unwind_140442b70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140147b00(*(longlong *)(param_2 + 0x40) + 0x28);
  return;
}



void Unwind_140442b80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x68);
  return;
}



void Unwind_140442b90(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_140442ba0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x38);
  return;
}



void Unwind_140442bb0(undefined8 param_1,longlong param_2)

{
  FUN_140136590(param_2 + 0x90);
  return;
}



void Unwind_140442bc0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x58);
  return;
}



void Unwind_140442bd0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0xb0);
  return;
}



void Unwind_140442be0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140442bf0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xf8);
  return;
}



void Unwind_140442c00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd0);
  return;
}



void Unwind_140442c10(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x88);
  return;
}



void Unwind_140442c20(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0xb8);
  return;
}



void Unwind_140442c30(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442c40(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140442c50(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x68);
  return;
}



void Unwind_140442c60(undefined8 param_1,longlong param_2)

{
  FUN_140139500(param_2 + 0xd0);
  return;
}



void Unwind_140442c70(undefined8 param_1,longlong param_2)

{
  FUN_14023ba90(param_2 + 0x110);
  return;
}



void Unwind_140442c80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_140442c90(undefined8 param_1,longlong param_2)

{
  FUN_14023ba90(param_2 + 0x70);
  return;
}



void Unwind_140442ca0(undefined8 param_1,longlong param_2)

{
  FUN_1402f4740(param_2 + 0x40);
  return;
}



void Unwind_140442cb0(undefined8 param_1,longlong param_2)

{
  FUN_140345050(param_2 + 0xd0);
  return;
}



void Unwind_140442cc0(undefined8 param_1,longlong param_2)

{
  FUN_1402f46e0(param_2 + 0x40);
  return;
}



void Unwind_140442cd0(undefined8 param_1,longlong param_2)

{
  FUN_140344a00(param_2 + 0xa0);
  return;
}



void Unwind_140442ce0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442cf0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_140442d00(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x58);
  return;
}



void Unwind_140442d10(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140442d20(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140442d30(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442d40(undefined8 param_1,longlong param_2)

{
  FUN_140342fb0(param_2 + 0x80);
  return;
}



void Unwind_140442d50(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x68);
  return;
}



void Unwind_140442d60(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442d70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x100);
  return;
}



void Unwind_140442d80(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x98);
  return;
}



void Unwind_140442d90(undefined8 param_1,longlong param_2)

{
  FUN_140176a20(param_2 + 0x128);
  return;
}



void Unwind_140442da0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd8);
  return;
}



void Unwind_140442db0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x70);
  return;
}



void Unwind_140442dc0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0xc0);
  return;
}



void Unwind_140442dd0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442de0(undefined8 param_1,longlong param_2)

{
  FUN_140340960(param_2 + 0x80);
  return;
}



void Unwind_140442df0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x68);
  return;
}



void Unwind_140442e00(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442e10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x98);
  return;
}



void Unwind_140442e20(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x70);
  return;
}



void Unwind_140442e30(undefined8 param_1,longlong param_2)

{
  FUN_14033da50(param_2 + 0x90);
  return;
}



void Unwind_140442e40(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x20);
  return;
}



void Unwind_140442e50(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x30) & 1) != 0) {
    *(uint *)(param_2 + 0x30) = *(uint *)(param_2 + 0x30) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0xe8));
  }
  return;
}



void Unwind_140442e80(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140442e87. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x38));
  return;
}



void Unwind_140442e90(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x78);
  return;
}



void Unwind_140442ea0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x48);
  return;
}



void Unwind_140442eb0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442ec0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x250);
  return;
}



void Unwind_140442ed0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 200);
  return;
}



void Unwind_140442ee0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x200);
  return;
}



void Unwind_140442ef0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x88);
  return;
}



void Unwind_140442f00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1b0);
  return;
}



void Unwind_140442f10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x160);
  return;
}



void Unwind_140442f20(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x108);
  return;
}



void Unwind_140442f30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1d8);
  return;
}



void Unwind_140442f40(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xe8);
  return;
}



void Unwind_140442f50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x228);
  return;
}



void Unwind_140442f60(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xa8);
  return;
}



void Unwind_140442f70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x188);
  return;
}



void Unwind_140442f80(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x68);
  return;
}



void Unwind_140442f90(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x148);
  return;
}



void Unwind_140442fa0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442fb0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x60);
  return;
}



void Unwind_140442fc0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x80);
  return;
}



void Unwind_140442fd0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140442fe0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x80);
  return;
}



void Unwind_140442ff0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x58);
  return;
}



void Unwind_140443000(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_140443010(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 200) & 1) != 0) {
    *(uint *)(param_2 + 200) = *(uint *)(param_2 + 200) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0xb8));
  }
  return;
}



void Unwind_140443040(undefined8 param_1,longlong param_2)

{
  FUN_140338790(param_2 + 0x68);
  return;
}



void Unwind_140443050(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x50);
  return;
}



void Unwind_140443060(undefined8 param_1,longlong param_2)

{
  FUN_140338790(param_2 + 0x50);
  return;
}



void Unwind_140443070(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140443080(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x38);
  return;
}



void Unwind_140443090(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_1404430a0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x60);
  return;
}



void Unwind_1404430b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x88);
  return;
}



void Unwind_1404430c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x60);
  return;
}



void Unwind_1404430d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x80);
  return;
}



void Unwind_1404430e0(undefined8 param_1,longlong param_2)

{
  FUN_140330590(param_2 + 0xb0);
  return;
}



void Unwind_1404430f0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x58);
  return;
}



void Unwind_140443100(undefined8 param_1,longlong param_2)

{
  FUN_140330780(param_2 + 0x290);
  return;
}



void Unwind_140443110(undefined8 param_1,longlong param_2)

{
  FUN_14032f580(param_2 + 0x40);
  return;
}



void Unwind_140443120(undefined8 param_1,longlong param_2)

{
  FUN_14032f670(param_2 + 0x120);
  return;
}



void Unwind_140443130(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140443137. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x40));
  return;
}



void Unwind_140443140(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_140443150(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_140443160(undefined8 param_1,longlong param_2)

{
  FUN_140167b70(param_2 + 0x70);
  return;
}



void Unwind_140443170(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_140443180(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1a8);
  return;
}



void Unwind_140443190(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x158);
  return;
}



void Unwind_1404431a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x90);
  return;
}



void Unwind_1404431b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x108);
  return;
}



void Unwind_1404431c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xe0);
  return;
}



void Unwind_1404431d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x130);
  return;
}



void Unwind_1404431e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xb8);
  return;
}



void Unwind_1404431f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x180);
  return;
}



void Unwind_140443200(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x50);
  return;
}



void Unwind_140443210(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x68);
  return;
}



void Unwind_140443220(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x88);
  return;
}



void Unwind_140443230(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xb0);
  return;
}



void Unwind_140443240(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x40);
  return;
}



void Unwind_140443250(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_140443260(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_140443270(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x48);
  return;
}



void Unwind_140443280(undefined8 param_1,longlong param_2)

{
  FUN_14031e080(param_2 + 0x30);
  return;
}



void Unwind_140443290(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x88);
  return;
}



void Unwind_1404432a0(undefined8 param_1,longlong param_2)

{
  FUN_14031e0b0(param_2 + 0xa8);
  return;
}



void Unwind_1404432b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x38);
  return;
}



void Unwind_1404432c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x30);
  return;
}



void Unwind_1404432d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xc0);
  return;
}



void Unwind_1404432e0(undefined8 param_1,longlong param_2)

{
  FUN_1403207c0(param_2 + 0xc0);
  return;
}



void Unwind_1404432f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x110);
  return;
}



void Unwind_140443300(undefined8 param_1,longlong param_2)

{
  FUN_1403207c0(param_2 + 0x110);
  return;
}



void Unwind_140443310(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_140443320(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x70);
  return;
}



void Unwind_140443330(undefined8 param_1,longlong param_2)

{
  FUN_14031c280(param_2 + 0x50);
  return;
}



void Unwind_140443340(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x120);
  return;
}



void Unwind_140443350(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x40),*(undefined8 *)(param_2 + 0x38));
  return;
}



void Unwind_140443370(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x38),*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140443390(undefined8 param_1,longlong param_2)

{
  FUN_14031c360(param_2 + 0x150);
  return;
}



void Unwind_1404433a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14031e570(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_1404433b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_1404433c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_1404433d0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x58);
  return;
}



void Unwind_1404433e0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_1404433f0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x38);
  return;
}



void Unwind_140443400(undefined8 param_1,longlong param_2)

{
  FUN_14012d9d0(param_2 + 0x40);
  return;
}



void Unwind_140443410(undefined8 param_1,longlong param_2)

{
  FUN_140317500(param_2 + 0xe0);
  return;
}



void Unwind_140443420(undefined8 param_1,longlong param_2)

{
  FUN_140319090(param_2 + 0xe0);
  return;
}



void Unwind_140443430(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xa8);
  return;
}



void Unwind_140443440(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x68);
  return;
}


undefined DAT_140174926;
undefined FUN_140448360;
undefined LAB_1404483a0;
undefined DAT_14060cf88;
undefined LAB_140448490;
undefined FUN_1404484e0;
undefined FUN_140448520;
undefined8 DAT_1405e7418;
undefined FUN_140448560;
undefined FUN_1404485a0;
undefined FUN_1404488f0;
undefined8 DAT_1405e7468;
undefined FUN_140448940;
undefined LAB_140448b10;
undefined DAT_140607e90;
undefined thunk_FUN_140175570;
undefined FUN_140178e00;
undefined DAT_14060d128;
undefined DAT_14060d078;
undefined DAT_14060cfd0;
undefined FUN_140448c90;
undefined DAT_14060d1e8;
undefined LAB_140448d10;
undefined FUN_140448da0;
undefined FUN_140448e10;
undefined LAB_140449260;
undefined LAB_140449250;
undefined DAT_1405f0590;
undefined LAB_140449280;
undefined LAB_1404492c0;
undefined LAB_1404492d0;
undefined LAB_140449330;
undefined LAB_140449310;
undefined LAB_140449300;
undefined LAB_140449340;
undefined LAB_140449350;
undefined LAB_140449370;
undefined LAB_14044939c;
undefined1 DAT_1405f2480;
undefined DAT_1405f2470;
HANDLE DAT_1405f2478;
undefined FUN_1404493a8;
undefined LAB_140449420;
undefined LAB_1404494d0;
undefined LAB_1404494e0;
undefined LAB_140449500;
undefined DAT_1405f2818;
undefined LAB_1404494f0;
undefined DAT_1405f27e0;
undefined FUN_140449580;
undefined LAB_1404495f0;
undefined DAT_1405f28e0;
undefined LAB_140449640;
undefined LAB_140449670;
undefined8 DAT_1405f6ad0;
undefined LAB_140449680;
undefined DAT_1405f6ad8;
undefined DAT_1405f6d48;
undefined DAT_1405e7280;
undefined DAT_1405e7290;
void *DAT_140607d30;
undefined DAT_140607d38;
undefined DAT_140607d40;
void *DAT_140607d50;
undefined DAT_140607d58;
undefined DAT_140607d60;
void *DAT_140607d70;
undefined DAT_140607d78;
undefined DAT_140607d80;
ulonglong DAT_1405f0480;
undefined DAT_1405f0468;
undefined DAT_1405f0478;
undefined DAT_1405e73d8;
undefined DAT_1405e73ca;
undefined DAT_1405e73f0;
undefined DAT_1405e7400;
ulonglong DAT_1405e7430;
undefined DAT_1405e7418;
undefined DAT_1405e7428;
undefined DAT_14060cec0;
undefined DAT_1405e7440;
undefined DAT_1405e7450;
ulonglong DAT_1405e7480;
undefined DAT_1405e7468;
undefined DAT_1405e7478;
void *DAT_140607de8;
undefined DAT_140607df0;
undefined DAT_140607df8;
void *DAT_140607e08;
undefined DAT_140607e10;
undefined DAT_140607e18;
void *DAT_140607e28;
undefined DAT_140607e30;
undefined DAT_140607e38;
void *DAT_140607e48;
undefined DAT_140607e50;
undefined DAT_140607e58;
void *DAT_140607e68;
undefined DAT_140607e70;
undefined DAT_140607e78;
void *DAT_140607ed0;
undefined8 DAT_140607ed8;
undefined DAT_140607ee0;
void *DAT_14060cf58;
undefined8 DAT_14060cf60;
undefined8 DAT_14060cf68;
undefined8 *DAT_14060d130;
undefined8 *DAT_14060d138;
void *DAT_14060ab50;
undefined8 DAT_14060ab58;
void *DAT_14060b7d0;
undefined8 DAT_14060b7d8;
undefined8 DAT_140607f90;
undefined DAT_140607f98;
undefined8 DAT_140607f70;
undefined DAT_140607f78;
undefined DAT_1405e74e0;
undefined DAT_1405e74f0;
void *DAT_140608688;
void *DAT_1406085b8;
ulonglong DAT_1405f04a8;
undefined DAT_1405f0490;
undefined DAT_1405f04a0;
void *DAT_14060d1f0;
undefined8 DAT_14060d1f8;
undefined DAT_14060d200;
void *DAT_14060d210;
undefined8 DAT_14060d218;
undefined DAT_14060d220;
ulonglong DAT_1405f04d0;
undefined DAT_1405f04b8;
undefined DAT_1405f04c8;
longlong *DAT_1405f06a0;
char DAT_1405f2480;
undefined DAT_1405d8558;
undefined8 *DAT_1405f2610;
longlong DAT_1405f2688;
longlong DAT_1405f2888;
undefined *PTR_vftable_1405d95c0;
void *DAT_1405f28a0;
undefined DAT_1405f3950;
undefined *PTR_vftable_1405da130;
undefined DAT_1405f6d70;

void Unwind_140443450(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x88);
  return;
}



void Unwind_140443460(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x48);
  return;
}



void Unwind_140443470(undefined8 param_1,longlong param_2)

{
  FUN_1403161a0(param_2 + 0x480);
  return;
}



void Unwind_140443480(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x270);
  return;
}



void Unwind_140443490(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_1404434a0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x150);
  return;
}



void Unwind_1404434b0(undefined8 param_1,longlong param_2)

{
  FUN_1401dfef0(param_2 + 0x2a0);
  return;
}



void Unwind_1404434c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1a8);
  return;
}



void Unwind_1404434d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1d0);
  return;
}



void Unwind_1404434e0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x128);
  return;
}



void Unwind_1404434f0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x108);
  return;
}



void Unwind_140443500(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x248);
  return;
}



void Unwind_140443510(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x220);
  return;
}



void Unwind_140443520(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x180);
  return;
}



void Unwind_140443530(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x50);
  return;
}



void Unwind_140443540(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_140443550(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1f8);
  return;
}



void Unwind_140443560(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x78);
  return;
}



void Unwind_140443570(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x168);
  return;
}



void Unwind_140443580(undefined8 param_1,longlong param_2)

{
  FUN_140307940(param_2 + 0x30);
  return;
}



void Unwind_140443590(undefined8 param_1,longlong param_2)

{
  FUN_140307980(param_2 + 0xe8);
  return;
}



void Unwind_1404435a0(undefined8 param_1,longlong param_2)

{
  FUN_140303990(param_2 + 0x40);
  return;
}



void Unwind_1404435b0(undefined8 param_1,longlong param_2)

{
  FUN_140303a30(param_2 + 0x150);
  return;
}



void Unwind_1404435c0(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x40);
  return;
}



void Unwind_1404435d0(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x70);
  return;
}



void Unwind_1404435e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_1404435f0(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0xa0);
  return;
}



void Unwind_140443600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140443610(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140443620(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_140443630(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140443640(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_140443650(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xe8) & 1) != 0) {
    *(uint *)(param_2 + 0xe8) = *(uint *)(param_2 + 0xe8) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0xd8));
  }
  return;
}



void Unwind_140443680(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x78);
  return;
}



void Unwind_140443690(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140443697. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_1404436a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x20) + 0x10);
  return;
}



void Unwind_1404436b0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x60);
  return;
}



void Unwind_1404436c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_1404436d0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xe0) & 1) != 0) {
    *(uint *)(param_2 + 0xe0) = *(uint *)(param_2 + 0xe0) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0xd8));
  }
  return;
}



void Unwind_140443700(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x78);
  return;
}



void Unwind_140443710(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x60);
  return;
}



void Unwind_140443720(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_140443730(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xe0) & 1) != 0) {
    *(uint *)(param_2 + 0xe0) = *(uint *)(param_2 + 0xe0) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0xd8));
  }
  return;
}



void Unwind_140443760(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x78);
  return;
}



void Unwind_140443770(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x60);
  return;
}



void Unwind_140443780(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140443790(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xe8) & 1) != 0) {
    *(uint *)(param_2 + 0xe8) = *(uint *)(param_2 + 0xe8) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0xd8));
  }
  return;
}



void Unwind_1404437c0(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x78);
  return;
}



void Unwind_1404437d0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404437d7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x28));
  return;
}



void Unwind_1404437e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(*(longlong *)(param_2 + 0x28) + 8);
  return;
}



void Unwind_1404437f0(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(*(longlong *)(param_2 + 0x28) + 0x30);
  return;
}



void Unwind_140443800(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x60);
  return;
}



void Unwind_140443810(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140443820(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xe0) & 1) != 0) {
    *(uint *)(param_2 + 0xe0) = *(uint *)(param_2 + 0xe0) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0xd8));
  }
  return;
}



void Unwind_140443850(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x78);
  return;
}



void Unwind_140443860(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140443867. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0xe8));
  return;
}



void Unwind_140443870(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x60);
  return;
}



void Unwind_140443880(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140443890(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 200) & 1) != 0) {
    *(uint *)(param_2 + 200) = *(uint *)(param_2 + 200) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0xb8));
  }
  return;
}



void Unwind_1404438c0(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x70);
  return;
}



void Unwind_1404438d0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x58);
  return;
}



void Unwind_1404438e0(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x40);
  return;
}



void Unwind_1404438f0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x70) & 1) != 0) {
    *(uint *)(param_2 + 0x70) = *(uint *)(param_2 + 0x70) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0x78));
  }
  return;
}



void Unwind_140443920(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x28);
  return;
}



void Unwind_140443930(undefined8 param_1,longlong param_2)

{
  FUN_1402edbf0(param_2 + 0xf8);
  return;
}



void Unwind_140443940(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x20) & 1) != 0) {
    *(uint *)(param_2 + 0x20) = *(uint *)(param_2 + 0x20) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0x48));
  }
  return;
}



void Unwind_140443970(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x98);
  return;
}



void Unwind_140443980(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x50);
  return;
}



void Unwind_140443990(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402ca6d0(param_2 + 0xc0);
  return;
}



void Unwind_1404439a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xc0);
  return;
}



void Unwind_1404439b0(undefined8 param_1,longlong param_2)

{
  FUN_1402edbf0(param_2 + 0x78);
  return;
}



void Unwind_1404439c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_1404439d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_1404439e0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x58);
  return;
}



void Unwind_1404439f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_140443a00(undefined8 param_1,longlong param_2)

{
  FUN_1402e8f60(param_2 + 0x40);
  return;
}



void Unwind_140443a10(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x30) + 0x18);
  return;
}



void Unwind_140443a20(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x30) + 0x38);
  return;
}



void Unwind_140443a30(undefined8 param_1,longlong param_2)

{
  FUN_1402e8fe0(param_2 + 0xd0);
  return;
}



void Unwind_140443a40(undefined8 param_1,longlong param_2)

{
  FUN_1402e8400(param_2 + 0x2b0);
  return;
}



void Unwind_140443a50(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x210);
  return;
}



void Unwind_140443a60(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x60);
  return;
}



void Unwind_140443a70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1c0);
  return;
}



void Unwind_140443a80(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x40);
  return;
}



void Unwind_140443a90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x5c0);
  return;
}



void Unwind_140443aa0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x100);
  return;
}



void Unwind_140443ab0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x288);
  return;
}



void Unwind_140443ac0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x120);
  return;
}



void Unwind_140443ad0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x238);
  return;
}



void Unwind_140443ae0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xa0);
  return;
}



void Unwind_140443af0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x260);
  return;
}



void Unwind_140443b00(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x80);
  return;
}



void Unwind_140443b10(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1e8);
  return;
}



void Unwind_140443b20(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xc0);
  return;
}



void Unwind_140443b30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x198);
  return;
}



void Unwind_140443b40(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xe0);
  return;
}



void Unwind_140443b50(undefined8 param_1,longlong param_2)

{
  FUN_1402e86c0(param_2 + 0x650);
  return;
}



void Unwind_140443b60(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x170);
  return;
}



void Unwind_140443b70(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x618);
  return;
}



void Unwind_140443b80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x5e8);
  return;
}



void Unwind_140443b90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148110(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140443ba0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402e9500(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_140443bb0(undefined8 param_1,longlong param_2)

{
  FUN_140147000(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_140443bd0(undefined8 param_1,longlong param_2)

{
  FUN_1402e90e0(*(longlong *)(param_2 + 0x40) + 0xd0);
  return;
}



void Unwind_140443bf0(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_((void *)(param_2 + 0x48),0x28,5,FUN_14023be90);
  return;
}



void Unwind_140443c20(undefined8 param_1,longlong param_2)

{
  FUN_1402e0e40(param_2 + 0x40);
  return;
}



void Unwind_140443c30(undefined8 param_1,longlong param_2)

{
  FUN_1402e0ea0(param_2 + 0x1e0);
  return;
}



void Unwind_140443c40(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_((void *)(*(longlong *)(param_2 + 0x30) + 8),0x28,5,FUN_14023be90);
  return;
}



void Unwind_140443c70(undefined8 param_1,longlong param_2)

{
  _eh_vector_destructor_iterator_((void *)(param_2 + 0x48),0x28,5,FUN_14023be90);
  return;
}



void Unwind_140443ca0(undefined8 param_1,longlong param_2)

{
  FUN_1402e0700(param_2 + 0x50);
  return;
}



void Unwind_140443cb0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(*(longlong *)(param_2 + 0x30) + 8);
  return;
}



void Unwind_140443cc0(undefined8 param_1,longlong param_2)

{
  FUN_1402e0760(param_2 + 0xa0);
  return;
}



void Unwind_140443cd0(undefined8 param_1,longlong param_2)

{
  FUN_1402defd0(param_2 + 0x40);
  return;
}



void Unwind_140443ce0(undefined8 param_1,longlong param_2)

{
  FUN_1402d8ab0(param_2 + 0x40);
  return;
}



void Unwind_140443cf0(undefined8 param_1,longlong param_2)

{
  FUN_1402d8af0(param_2 + 0x80);
  return;
}



void Unwind_140443d00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_140443d10(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140443d20(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_140443d30(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140443d40(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_140443d50(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140443d60(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443d70(void)

{
  DAT_14060ce50 = DAT_14060ce50 & 0xfffffffe;
  return;
}



void Unwind_140443d90(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443da0(void)

{
  DAT_14060ce54 = DAT_14060ce54 & 0xfffffffe;
  return;
}



void Unwind_140443dc0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443dd0(void)

{
  DAT_14060ce58 = DAT_14060ce58 & 0xfffffffe;
  return;
}



void Unwind_140443df0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443e00(void)

{
  DAT_14060ce5c = DAT_14060ce5c & 0xfffffffe;
  return;
}



void Unwind_140443e20(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443e30(void)

{
  DAT_14060ce60 = DAT_14060ce60 & 0xfffffffe;
  return;
}



void Unwind_140443e50(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443e60(void)

{
  DAT_14060ce64 = DAT_14060ce64 & 0xfffffffe;
  return;
}



void Unwind_140443e80(void)

{
  thunk_FUN_14014b570(&DAT_1406087d0);
  return;
}



void Unwind_140443e90(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443ea0(void)

{
  DAT_14060ce68 = DAT_14060ce68 & 0xfffffffe;
  return;
}



void Unwind_140443ec0(void)

{
  thunk_FUN_14014b360(&DAT_140608820);
  return;
}



void Unwind_140443ed0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443ee0(void)

{
  DAT_14060ce6c = DAT_14060ce6c & 0xfffffffe;
  return;
}



void Unwind_140443f00(void)

{
  thunk_FUN_14014b180(&DAT_140608870);
  return;
}



void Unwind_140443f10(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443f20(void)

{
  DAT_14060ce70 = DAT_14060ce70 & 0xfffffffe;
  return;
}



void Unwind_140443f40(void)

{
  thunk_FUN_14014afd0(&DAT_1406088c0);
  return;
}



void Unwind_140443f50(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443f60(void)

{
  DAT_14060ce74 = DAT_14060ce74 & 0xfffffffe;
  return;
}



void Unwind_140443f80(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443f90(void)

{
  DAT_14060ce78 = DAT_14060ce78 & 0xfffffffe;
  return;
}



void Unwind_140443fb0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140443fc0(void)

{
  DAT_14060ce7c = DAT_14060ce7c & 0xfffffffe;
  return;
}



void Unwind_140443fe0(void)

{
  thunk_FUN_14014ac40(&DAT_140608ac0);
  return;
}



void Unwind_140443ff0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444000(void)

{
  DAT_14060ce80 = DAT_14060ce80 & 0xfffffffe;
  return;
}



void Unwind_140444020(void)

{
  thunk_FUN_14014a7b0(&DAT_140608bf0);
  return;
}



void Unwind_140444030(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444040(void)

{
  DAT_14060ce84 = DAT_14060ce84 & 0xfffffffe;
  return;
}



void Unwind_140444060(void)

{
  thunk_FUN_14014a4f0(&DAT_140608c40);
  return;
}



void Unwind_140444070(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444080(void)

{
  DAT_14060ce88 = DAT_14060ce88 & 0xfffffffe;
  return;
}



void Unwind_1404440a0(void)

{
  FUN_140147040(&DAT_140609298);
  return;
}



void Unwind_1404440b0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404440c0(void)

{
  DAT_14060ce8c = DAT_14060ce8c & 0xfffffffe;
  return;
}



void Unwind_1404440e0(void)

{
  thunk_FUN_14014a160(&DAT_140608c90);
  return;
}



void Unwind_1404440f0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444100(void)

{
  DAT_14060ce90 = DAT_14060ce90 & 0xfffffffe;
  return;
}



void Unwind_140444120(void)

{
  thunk_FUN_140149f60(&DAT_140608ce0);
  return;
}



void Unwind_140444130(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444140(void)

{
  DAT_14060ce94 = DAT_14060ce94 & 0xfffffffe;
  return;
}



void Unwind_140444160(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444170(void)

{
  DAT_14060ce98 = DAT_14060ce98 & 0xfffffffe;
  return;
}



void Unwind_140444190(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404441a0(void)

{
  DAT_14060ce9c = DAT_14060ce9c & 0xfffffffe;
  return;
}



void Unwind_1404441c0(void)

{
  thunk_FUN_140149870(&DAT_140608e60);
  return;
}



void Unwind_1404441d0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404441e0(void)

{
  DAT_14060cea0 = DAT_14060cea0 & 0xfffffffe;
  return;
}



void Unwind_140444200(void)

{
  thunk_FUN_140149690(&DAT_140608eb0);
  return;
}



void Unwind_140444210(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444220(void)

{
  DAT_14060cea4 = DAT_14060cea4 & 0xfffffffe;
  return;
}



void Unwind_140444240(void)

{
  thunk_FUN_1401494b0(&DAT_140608f00);
  return;
}



void Unwind_140444250(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444260(void)

{
  DAT_14060cea8 = DAT_14060cea8 & 0xfffffffe;
  return;
}



void Unwind_140444280(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444290(void)

{
  DAT_14060ceac = DAT_14060ceac & 0xfffffffe;
  return;
}



void Unwind_1404442b0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404442c0(void)

{
  DAT_14060ceb0 = DAT_14060ceb0 & 0xfffffffe;
  return;
}



void Unwind_1404442e0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404442f0(void)

{
  DAT_14060ceb4 = DAT_14060ceb4 & 0xfffffffe;
  return;
}



void Unwind_140444310(void)

{
  thunk_FUN_140148ca0(&DAT_140609110);
  return;
}



void Unwind_140444320(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444330(void)

{
  DAT_14060ceb8 = DAT_14060ceb8 & 0xfffffffe;
  return;
}



void Unwind_140444350(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444360(void)

{
  DAT_14060cebc = DAT_14060cebc & 0xfffffffe;
  return;
}



void Unwind_140444380(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444390(void)

{
  DAT_14060ceec = DAT_14060ceec & 0xfffffffe;
  return;
}



void Unwind_1404443b0(void)

{
  thunk_FUN_140147f80(&DAT_140609200);
  return;
}



void Unwind_1404443c0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404443d0(void)

{
  DAT_14060cef0 = DAT_14060cef0 & 0xfffffffe;
  return;
}



void Unwind_1404443f0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444400(void)

{
  DAT_14060cef4 = DAT_14060cef4 & 0xfffffffe;
  return;
}



void Unwind_140444420(void)

{
  thunk_FUN_140147dc0(&DAT_140609250);
  return;
}



void Unwind_140444430(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444440(void)

{
  DAT_14060cef8 = DAT_14060cef8 & 0xfffffffe;
  return;
}



void Unwind_140444460(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444470(void)

{
  DAT_14060cefc = DAT_14060cefc & 0xfffffffe;
  return;
}



void Unwind_140444490(void)

{
  thunk_FUN_140147940(&DAT_14060a450);
  return;
}



void Unwind_1404444a0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x60);
  return;
}



void Unwind_1404444b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1404444c0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_1404444e0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140444500(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140444520(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140444527. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_140444530(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140444537. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_140444540(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140444547. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_140444550(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140444557. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x20));
  return;
}



void Unwind_140444560(undefined8 param_1,longlong param_2)

{
  FUN_1400046f0(param_2 + 0x2078);
  return;
}



void Unwind_140444570(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140444577. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x2070));
  return;
}



void Unwind_140444580(undefined8 param_1,longlong param_2)

{
  FUN_140338790(param_2 + 0x40);
  return;
}



void Unwind_140444590(undefined8 param_1,longlong param_2)

{
  FUN_140338790(param_2 + 0x28);
  return;
}



void Unwind_1404445a0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404445b0(void)

{
  DAT_14060cf00 = DAT_14060cf00 & 0xfffffffe;
  return;
}



void Unwind_1404445d0(void)

{
  thunk_FUN_1403313a0(&DAT_1406082c0);
  return;
}



void Unwind_1404445e0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404445f0(void)

{
  DAT_14060cf04 = DAT_14060cf04 & 0xfffffffe;
  return;
}



void Unwind_140444610(void)

{
  thunk_FUN_1403310c0(&DAT_140608310);
  return;
}



void Unwind_140444620(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444630(void)

{
  DAT_14060cf08 = DAT_14060cf08 & 0xfffffffe;
  return;
}



void Unwind_140444650(void)

{
  thunk_FUN_140330e10(&DAT_140608360);
  return;
}



void Unwind_140444660(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x38);
  return;
}



void Unwind_140444670(void)

{
  DAT_14060cf0c = DAT_14060cf0c & 0xfffffffe;
  return;
}



void Unwind_140444690(void)

{
  _eh_vector_destructor_iterator_(&DAT_14060a500,0x48,0xf,(_func_void_void_ptr *)&LAB_14031d770);
  return;
}



void Unwind_1404446c0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404446d0(void)

{
  DAT_14060cf10 = DAT_14060cf10 & 0xfffffffe;
  return;
}



void Unwind_1404446f0(void)

{
  FUN_14031e1a0(&DAT_1406083b0);
  return;
}



void Unwind_140444700(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444710(void)

{
  DAT_14060cf14 = DAT_14060cf14 & 0xfffffffe;
  return;
}



void Unwind_140444730(void)

{
  thunk_FUN_14031e720(&DAT_1406083f0);
  return;
}



void Unwind_140444740(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444750(void)

{
  DAT_14060cf18 = DAT_14060cf18 & 0xfffffffe;
  return;
}



void Unwind_140444770(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444780(void)

{
  DAT_14060cf1c = DAT_14060cf1c & 0xfffffffe;
  return;
}



void Unwind_1404447a0(void)

{
  thunk_FUN_140317800(&DAT_140608520);
  return;
}



void Unwind_1404447b0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404447c0(void)

{
  DAT_14060cf20 = DAT_14060cf20 & 0xfffffffe;
  return;
}



void Unwind_1404447e0(void)

{
  thunk_FUN_140319910(&DAT_1406084d0);
  return;
}



void Unwind_1404447f0(void)

{
  DAT_14060cf24 = DAT_14060cf24 & 0xfffffffe;
  return;
}



void Unwind_140444810(void)

{
  thunk_FUN_1403082c0(&DAT_1406085e0);
  return;
}



void Unwind_140444820(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444830(void)

{
  DAT_14060cf28 = DAT_14060cf28 & 0xfffffffe;
  return;
}



void Unwind_140444850(void)

{
  thunk_FUN_140303ea0(&DAT_140608630);
  return;
}



void Unwind_140444860(undefined8 param_1,longlong param_2)

{
  FUN_140300830(param_2 + 0x60);
  return;
}



void Unwind_140444870(undefined8 param_1,longlong param_2)

{
  FUN_140301090(param_2 + 0x980);
  return;
}



void Unwind_140444880(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0x30);
  return;
}



void Unwind_140444890(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0x30);
  return;
}



void Unwind_1404448a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148110(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_1404448b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148110(*(longlong *)(param_2 + 0x40) + 0x48);
  return;
}



void Unwind_1404448c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140303bc0(*(longlong *)(param_2 + 0x40) + 0x90);
  return;
}



void Unwind_1404448e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140303cf0(*(longlong *)(param_2 + 0x40) + 0xd8);
  return;
}



void Unwind_140444900(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140444910(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140444920(undefined8 param_1,longlong param_2)

{
  FUN_1402f46e0(param_2 + 0x50);
  return;
}



void Unwind_140444930(undefined8 param_1,longlong param_2)

{
  FUN_140344a00(param_2 + 0xb0);
  return;
}



void Unwind_140444940(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140444950(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140444960(undefined8 param_1,longlong param_2)

{
  FUN_1402fb5c0(param_2 + 0x50);
  return;
}



void Unwind_140444970(undefined8 param_1,longlong param_2)

{
  FUN_1402fb620(param_2 + 0xc0);
  return;
}



void Unwind_140444980(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x50);
  return;
}



void Unwind_140444990(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_1404449a0(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x60);
  return;
}



void Unwind_1404449b0(undefined8 param_1,longlong param_2)

{
  FUN_1402f3910(param_2 + 0x38);
  return;
}



void Unwind_1404449c0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404449d0(void)

{
  DAT_14060cf2c = DAT_14060cf2c & 0xfffffffe;
  return;
}



void Unwind_1404449f0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444a00(void)

{
  DAT_14060cf30 = DAT_14060cf30 & 0xfffffffe;
  return;
}



void Unwind_140444a20(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444a30(void)

{
  DAT_14060cf34 = DAT_14060cf34 & 0xfffffffe;
  return;
}



void Unwind_140444a50(void)

{
  FUN_14033a390(&DAT_14060a4a0);
  return;
}



void Unwind_140444a60(void)

{
  FUN_14033a390(&DAT_14060a4b0);
  return;
}



void Unwind_140444a70(void)

{
  FUN_14033a390(&DAT_14060a4c0);
  return;
}



void Unwind_140444a80(void)

{
  FUN_14033a390(&DAT_14060a4d0);
  return;
}



void Unwind_140444a90(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444aa0(void)

{
  DAT_14060cf38 = DAT_14060cf38 & 0xfffffffe;
  return;
}



void Unwind_140444ac0(void)

{
  FUN_140162300(&DAT_140608688);
  return;
}



void Unwind_140444ad0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444ae0(void)

{
  DAT_14060cf3c = DAT_14060cf3c & 0xfffffffe;
  return;
}



void Unwind_140444b00(void)

{
  thunk_FUN_1402e96b0(&DAT_1406086b0);
  return;
}



void Unwind_140444b10(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444b20(void)

{
  DAT_14060cf40 = DAT_14060cf40 & 0xfffffffe;
  return;
}



void Unwind_140444b40(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444b50(void)

{
  DAT_14060cf44 = DAT_14060cf44 & 0xfffffffe;
  return;
}



void Unwind_140444b70(void)

{
  thunk_FUN_1402e2540(&DAT_14060a170);
  return;
}



void Unwind_140444b80(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140444b90(void)

{
  DAT_14060cf48 = DAT_14060cf48 & 0xfffffffe;
  return;
}



void Unwind_140444bb0(void)

{
  thunk_FUN_1402e22b0(&DAT_14060a1c0);
  return;
}



void Unwind_140444bc0(undefined8 param_1,longlong param_2)

{
  FUN_1402defd0(param_2 + 0x1a0);
  return;
}



void Unwind_140444bd0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x150);
  return;
}



void Unwind_140444be0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x128);
  return;
}



void Unwind_140444bf0(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x38),*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_140444c10(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x38),*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_140444c30(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x178);
  return;
}



void Unwind_140444c40(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x38),*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_140444c60(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0x38),*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_140444c80(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x128);
  return;
}



void Unwind_140444c90(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x128);
  return;
}



void Unwind_140444ca0(undefined8 param_1,longlong param_2)

{
  FUN_1402df1c0(param_2 + 0x3e0);
  return;
}



void Unwind_140444cb0(undefined8 param_1,longlong param_2)

{
  FUN_1402df1d0(param_2 + 0x50);
  return;
}



void Unwind_140444cc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x150);
  return;
}



void Unwind_140444cd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x128);
  return;
}



void Unwind_140444ce0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140444cf0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_140444d00(undefined8 param_1,longlong param_2)

{
  FUN_1402df260(param_2 + 0xb8);
  return;
}



void Unwind_140444d10(undefined8 param_1,longlong param_2)

{
  FUN_1402df1d0(param_2 + 0x50);
  return;
}



void Unwind_140444d20(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x150);
  return;
}



void Unwind_140444d30(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x128);
  return;
}



void Unwind_140444d40(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140444d50(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_140444d60(undefined8 param_1,longlong param_2)

{
  FUN_1402df260(param_2 + 0xb8);
  return;
}



void Unwind_140444d70(undefined8 param_1,longlong param_2)

{
  FUN_1402df330(param_2 + 0x3e0);
  return;
}



void Unwind_140444d80(undefined8 param_1,longlong param_2)

{
  FUN_1402df1d0(param_2 + 0x50);
  return;
}



void Unwind_140444d90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x178);
  return;
}



void Unwind_140444da0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x128);
  return;
}



void Unwind_140444db0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(undefined8 *)(param_2 + 0x30));
  return;
}



void Unwind_140444dc0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x30) + 0x20);
  return;
}



void Unwind_140444dd0(undefined8 param_1,longlong param_2)

{
  FUN_1402df1d0(param_2 + 0x50);
  return;
}



void Unwind_140444de0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x178);
  return;
}



void Unwind_140444df0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x128);
  return;
}



void Unwind_140444e00(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(undefined8 *)(param_2 + 0x40));
  return;
}



void Unwind_140444e10(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(*(longlong *)(param_2 + 0x40) + 0x20);
  return;
}



void Unwind_140444e20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402e1c20(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140444e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402e1e20(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_140444e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402e1e20(*(longlong *)(param_2 + 0x70) + 0x90);
  return;
}



void Unwind_140444e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402e1e40(*(longlong *)(param_2 + 0x70) + 0xd8);
  return;
}



void Unwind_140444e80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402e1e40(*(longlong *)(param_2 + 0x70) + 0x120);
  return;
}



void Unwind_140444ea0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402e2000(*(longlong *)(param_2 + 0x70) + 0x168);
  return;
}



void Unwind_140444ec0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402475c0(*(longlong *)(param_2 + 0x70) + 0x1b0);
  return;
}



void Unwind_140444ee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1402475c0(*(longlong *)(param_2 + 0x70) + 0x1f8);
  return;
}



void Unwind_140444f00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x30);
  return;
}



void Unwind_140444f10(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x70);
  return;
}



void Unwind_140444f20(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0xb0);
  return;
}



void Unwind_140444f30(undefined8 param_1,longlong param_2)

{
  FUN_14030d950(param_2 + 0x50);
  return;
}



void Unwind_140444f40(undefined8 param_1,longlong param_2)

{
  FUN_1402d83d0(param_2 + 0x88);
  return;
}



void Unwind_140444f50(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x28);
  return;
}



void Unwind_140444f60(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_140444f70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x20);
  return;
}



void Unwind_140444f80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x30);
  return;
}



void Unwind_140444f90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x60);
  return;
}



void Unwind_140444fa0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x20);
  return;
}



void Unwind_140444fb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x50);
  return;
}



void Unwind_140444fc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x80);
  return;
}



void Unwind_140444fd0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x20);
  return;
}



void Unwind_140444fe0(undefined8 param_1,longlong param_2)

{
  FUN_1403352a0(param_2 + 0x30);
  return;
}



void Unwind_140444ff0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x90);
  return;
}



void Unwind_140445000(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0xb8);
  return;
}



void Unwind_140445010(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x68);
  return;
}



void Unwind_140445020(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x48);
  return;
}



void Unwind_140445030(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_140445040(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140445050(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140445060(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401e4a30(param_2 + 0x40);
  return;
}



void Unwind_140445070(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xa8);
  return;
}



void Unwind_140445080(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd0);
  return;
}



void Unwind_140445090(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xf8);
  return;
}



void Unwind_1404450a0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_1404450c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x120);
  return;
}



void Unwind_1404450d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1404450e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x168);
  return;
}



void Unwind_1404450f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x88);
  return;
}



void Unwind_140445100(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x78);
  return;
}



void Unwind_140445110(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x110);
  return;
}



void Unwind_140445120(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140445130(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x148);
  return;
}



void Unwind_140445140(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_140445150(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x160);
  return;
}



void Unwind_140445160(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x78);
  return;
}



void Unwind_140445170(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_140445180(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x108);
  return;
}



void Unwind_140445190(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1404451a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x140);
  return;
}



void Unwind_1404451b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df5b0(param_2 + 0x50);
  return;
}



void Unwind_1404451c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa0);
  return;
}



void Unwind_1404451d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_1404451e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x28);
  return;
}



void Unwind_1404451f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401defb0(param_2 + 0x38);
  return;
}



void Unwind_140445200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x58);
  return;
}



void Unwind_140445210(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x68);
  return;
}



void Unwind_140445220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x48);
  return;
}



void Unwind_140445230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x58);
  return;
}



void Unwind_140445240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x78);
  return;
}



void Unwind_140445250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x78);
  return;
}



void Unwind_140445260(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140445280(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_1404452a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x60);
  return;
}



void Unwind_1404452b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x138);
  return;
}



void Unwind_1404452c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x58);
  return;
}



void Unwind_1404452d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x118);
  return;
}



void Unwind_1404452e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x88);
  return;
}



void Unwind_1404452f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



void Unwind_140445300(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xb0);
  return;
}



void Unwind_140445310(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xd0);
  return;
}



void Unwind_140445320(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_140445330(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_140445340(undefined8 param_1,longlong param_2)

{
  FUN_1401decc0(param_2 + 0x68);
  return;
}



void Unwind_140445350(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140445370(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0xa8);
  return;
}



void Unwind_140445380(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140445390(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1404453a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_1404453b0(undefined8 param_1,longlong param_2)

{
  FUN_1401e04b0(param_2 + 0x50);
  return;
}



void Unwind_1404453c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404453d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Unwind_1404453e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_1404453f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140445400(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401758d0(param_2 + 0x28);
  return;
}



void Unwind_140445410(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140445417. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0xb8));
  return;
}



undefined * Catch_All_140445420(void)

{
  return &DAT_140174926;
}



void Unwind_140445440(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x170);
  return;
}



void Unwind_140445450(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x170);
  return;
}



void Unwind_140445460(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x170);
  return;
}



void Unwind_140445470(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14014aa70(*(undefined8 *)(param_2 + 0x70));
  return;
}



void Unwind_140445480(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0x48);
  return;
}



void Unwind_140445490(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140148af0(*(longlong *)(param_2 + 0x70) + 0x90);
  return;
}



void Unwind_1404454b0(undefined8 param_1,longlong param_2)

{
  FUN_140139500(param_2 + 0x50);
  return;
}



void Unwind_1404454c0(void)

{
  DAT_14060b7c0 = DAT_14060b7c0 & 0xfffffffe;
  return;
}



void Unwind_1404454e0(undefined8 param_1,longlong param_2)

{
  FUN_140176a20(param_2 + 0xc0);
  return;
}



void Unwind_1404454f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140445500(undefined8 param_1,longlong param_2)

{
  FUN_140338790(param_2 + 0x28);
  return;
}



void Unwind_140445510(undefined8 param_1,longlong param_2)

{
  FUN_140338790(param_2 + 0x29);
  return;
}



void Unwind_140445520(undefined8 param_1,longlong param_2)

{
  FUN_140338790(param_2 + 0x2a);
  return;
}



void Unwind_140445530(undefined8 param_1,longlong param_2)

{
  FUN_140338790(param_2 + 0x2b);
  return;
}



void Unwind_140445540(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140445550(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0x98) & 1) != 0) {
    *(uint *)(param_2 + 0x98) = *(uint *)(param_2 + 0x98) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 0x88));
  }
  return;
}



void Unwind_140445580(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xa8);
  return;
}



void Unwind_140445590(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd8);
  return;
}



void Unwind_1404455a0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404455b0(void)

{
  DAT_14060cf4c = DAT_14060cf4c & 0xfffffffe;
  return;
}



void Unwind_1404455d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404455e0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404455e7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0xf0));
  return;
}



void Unwind_1404455f0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404455f7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0xf0));
  return;
}



void Unwind_140445600(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x80);
  return;
}



void Unwind_140445610(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x60);
  return;
}



void Unwind_140445620(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140445630(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_140445640(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x50);
  return;
}



void Unwind_140445650(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x70);
  return;
}



void Unwind_140445660(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x90);
  return;
}



void Unwind_140445670(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xa8);
  return;
}



void Unwind_140445680(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140445690(void)

{
  DAT_14060cf50 = DAT_14060cf50 & 0xfffffffe;
  return;
}



void Unwind_1404456b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_1404456c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x90);
  return;
}



void Unwind_1404456d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x340);
  return;
}



void Unwind_1404456e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x100);
  return;
}



void Unwind_1404456f0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe8);
  return;
}



void Unwind_140445700(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x108);
  return;
}



void Unwind_140445710(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x70);
  return;
}



void Unwind_140445720(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_140445730(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x90);
  return;
}



void Unwind_140445740(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x150);
  return;
}



void Unwind_140445750(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x130);
  return;
}



void Unwind_140445760(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x28);
  return;
}



void Unwind_140445770(undefined8 param_1,longlong param_2)

{
  FUN_140129050(param_2 + 0x48);
  return;
}



void Unwind_140445780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x48);
  return;
}



void Unwind_140445790(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_1404457a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Unwind_1404457b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14020f700(param_2 + 0x28);
  return;
}



void Unwind_1404457c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x90);
  return;
}



void Unwind_1404457d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_1404457e0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_1404457f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x58);
  return;
}



void Unwind_140445800(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x78);
  return;
}



void Unwind_140445810(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x20);
  return;
}



void Unwind_140445820(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_140445830(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140445840(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140445850(undefined8 param_1,longlong param_2)

{
  FUN_14020e400(param_2 + 0x30);
  return;
}



void Unwind_140445860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x28);
  return;
}



void Unwind_140445870(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140445877. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_140445880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x68);
  return;
}



void Unwind_140445890(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x40);
  return;
}



void Unwind_1404458a0(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0xb8);
  return;
}



void Unwind_1404458b0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa8);
  return;
}



void Unwind_1404458c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_1404458d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xb0);
  return;
}



void Unwind_1404458e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xd8);
  return;
}



void Unwind_1404458f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_140445900(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x58);
  return;
}



void Unwind_140445910(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x68);
  return;
}



void Unwind_140445920(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x48);
  return;
}



void Unwind_140445930(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf8);
  return;
}



void Unwind_140445940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 200);
  return;
}



void Unwind_140445950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x310);
  return;
}



void Unwind_140445960(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x118);
  return;
}



void Unwind_140445970(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xf8);
  return;
}



void Unwind_140445980(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xe0);
  return;
}



void Unwind_140445990(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404459a0(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 200);
  return;
}



void Unwind_1404459b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb8);
  return;
}



void Unwind_1404459c0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_1404459d0(void)

{
  DAT_14060cf7c = DAT_14060cf7c & 0xfffffffe;
  return;
}



void Unwind_1404459f0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x28);
  return;
}



void Unwind_140445a00(void)

{
  DAT_14060cf80 = DAT_14060cf80 & 0xfffffffe;
  return;
}



void Unwind_140445a20(void)

{
  thunk_FUN_140149040(&DAT_1406090c0);
  return;
}



void Unwind_140445a30(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x30);
  return;
}



void Unwind_140445a40(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x58);
  return;
}



void Unwind_140445a50(undefined8 param_1,longlong param_2)

{
  FUN_14030ac20(param_2 + 0xd0);
  return;
}



void Unwind_140445a60(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xa8);
  return;
}



void Unwind_140445a70(undefined8 param_1,longlong param_2)

{
  FUN_14030ac20(param_2 + 0x1f0);
  return;
}



void Unwind_140445a80(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x80);
  return;
}



void Unwind_140445a90(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x30);
  return;
}



void Unwind_140445aa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_140445ab0(undefined8 param_1,longlong param_2)

{
  Concurrency::details::SubAllocator::~SubAllocator((SubAllocator *)(param_2 + 0x40));
  return;
}



void Unwind_140445ac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x58);
  return;
}



void Unwind_140445ad0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_140445ae0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140445af0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_140445b00(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x88);
  return;
}



void Unwind_140445b10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x40);
  return;
}



void Unwind_140445b20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140445b30(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140445b40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xf0);
  return;
}



void Unwind_140445b50(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 200);
  return;
}



void Unwind_140445b60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xe0);
  return;
}



void Unwind_140445b70(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x208);
  return;
}



void Unwind_140445b80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xf0);
  return;
}



void Unwind_140445b90(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x60);
  return;
}



void Unwind_140445ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140445bb0(undefined8 param_1,longlong param_2)

{
  if ((*(uint *)(param_2 + 0xd8) & 1) != 0) {
    *(uint *)(param_2 + 0xd8) = *(uint *)(param_2 + 0xd8) & 0xfffffffe;
    FUN_14033a390(*(undefined8 *)(param_2 + 200));
  }
  return;
}



void Unwind_140445be0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_140445bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xf8);
  return;
}



void Unwind_140445c00(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(*(undefined8 *)(param_2 + 0x140));
  return;
}



void Unwind_140445c10(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x148);
  return;
}



void Unwind_140445c20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xb8);
  return;
}



void Unwind_140445c30(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x148);
  return;
}



void Unwind_140445c40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1d0);
  return;
}



void Unwind_140445c50(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0x170);
  return;
}



void Unwind_140445c60(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1a8);
  return;
}



void Unwind_140445c70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140188b00(param_2 + 200);
  return;
}



void Unwind_140445c80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401798f0(param_2 + 0x70);
  return;
}



void Unwind_140445c90(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140445c97. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_140445ca0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140445ca7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x88));
  return;
}



void Unwind_140445cb0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140445cc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140445cd0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_140445ce0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_140445cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x90);
  return;
}



void Unwind_140445d00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x50);
  return;
}



void Unwind_140445d10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x98);
  return;
}



void Unwind_140445d20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x50);
  return;
}



void Unwind_140445d30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xa0);
  return;
}



void Unwind_140445d40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x70);
  return;
}



void Unwind_140445d50(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x30);
  return;
}



void Unwind_140445d60(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_140445d70(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_140445d80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_140445d90(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140445da0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_140445db0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_140445dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x128);
  return;
}



void Unwind_140445dd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x88);
  return;
}



void Unwind_140445de0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x98);
  return;
}



void Unwind_140445df0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xa8);
  return;
}



void Unwind_140445e00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140445e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x40);
  return;
}



void Unwind_140445e20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df5b0(param_2 + 0x70);
  return;
}



void Unwind_140445e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x50);
  return;
}



void Unwind_140445e40(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x68);
  return;
}



void Unwind_140445e50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xc0);
  return;
}



void Unwind_140445e60(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x98);
  return;
}



void Unwind_140445e70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x58);
  return;
}



void Unwind_140445e80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x70);
  return;
}



void Unwind_140445e90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 200);
  return;
}



void Unwind_140445ea0(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0xa0);
  return;
}



void Unwind_140445eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x58);
  return;
}



void Unwind_140445ec0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x70);
  return;
}



void Unwind_140445ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dede0(param_2 + 0xb0);
  return;
}



void Unwind_140445ee0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140445ee7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0xa8));
  return;
}



void Unwind_140445ef0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x28);
  return;
}



void Unwind_140445f00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x70);
  return;
}



void Unwind_140445f10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x28);
  return;
}



void Unwind_140445f20(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x38);
  return;
}



void Unwind_140445f30(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_140445f40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x30);
  return;
}



void Unwind_140445f50(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xd8);
  return;
}



void Unwind_140445f60(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_140445f70(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0xf8);
  return;
}



void Unwind_140445f80(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0xb0);
  return;
}



void Unwind_140445f90(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x50);
  return;
}



void Unwind_140445fa0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x1b0);
  return;
}



void Unwind_140445fb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x180);
  return;
}



void Unwind_140445fc0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x40);
  return;
}



void Unwind_140445fd0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x1d0);
  return;
}



void Unwind_140445fe0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 400);
  return;
}



void Unwind_140445ff0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x1c0);
  return;
}



void Unwind_140446000(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x1a0);
  return;
}



void Unwind_140446010(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140446030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_140446040(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xb8);
  return;
}



void Unwind_140446050(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_140446060(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x48);
  return;
}



void Unwind_140446070(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x50);
  return;
}



void Unwind_140446080(undefined8 param_1,longlong param_2)

{
  FUN_1402d8ab0(param_2 + 0x30);
  return;
}



void Unwind_140446090(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x28);
  return;
}



void Unwind_1404460a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_1404460b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_1404460c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dede0(*(undefined8 *)(param_2 + 0x118));
  return;
}



void Unwind_1404460d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_1404460e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dede0(param_2 + 0x70);
  return;
}



void Unwind_1404460f0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404460f7. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x1f0));
  return;
}



void Unwind_140446100(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x98);
  return;
}



void Unwind_140446110(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_140446120(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x30);
  return;
}



void Unwind_140446130(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x70);
  return;
}



void Unwind_140446140(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446147. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x98));
  return;
}



void Unwind_140446150(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xc0);
  return;
}



void Unwind_140446160(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140446170(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x88);
  return;
}



void Unwind_140446180(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_140446190(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x200);
  return;
}



void Unwind_1404461a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_1404461b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x240);
  return;
}



void Unwind_1404461c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x70);
  return;
}



void Unwind_1404461d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xb8);
  return;
}



void Unwind_1404461e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_1404461f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0xa8);
  return;
}



void Unwind_140446200(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x90);
  return;
}



void Unwind_140446210(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_140446220(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x80);
  return;
}



void Unwind_140446230(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xe0);
  return;
}



void Unwind_140446240(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_140446250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x80);
  return;
}



void Unwind_140446260(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xd0);
  return;
}



void Unwind_140446270(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x80);
  return;
}



void Unwind_140446280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x70);
  return;
}



void Unwind_140446290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x78);
  return;
}



void Unwind_1404462a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0xa0);
  return;
}



void Unwind_1404462b0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x50);
  return;
}



void Unwind_1404462c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 200);
  return;
}



void Unwind_1404462d0(undefined8 param_1,longlong param_2)

{
  FUN_14030ac20(param_2 + 0xf0);
  return;
}



void Unwind_1404462e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x78);
  return;
}



void Unwind_1404462f0(undefined8 param_1,longlong param_2)

{
  FUN_14030d9d0(param_2 + 0xf0);
  return;
}



void Unwind_140446300(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(param_2 + 0x110);
  return;
}



void Unwind_140446310(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x148);
  return;
}



void Unwind_140446320(undefined8 param_1,longlong param_2)

{
  FUN_14030da30(param_2 + 0x178);
  return;
}



void Unwind_140446340(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446347. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(*(basic_streambuf<> **)(param_2 + 0x40));
  return;
}



void Unwind_140446350(undefined8 param_1,longlong param_2)

{
  FUN_14030ac20(param_2 + 0x210);
  return;
}



void Unwind_140446360(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xa0);
  return;
}



void Unwind_140446370(undefined8 param_1,longlong param_2)

{
  FUN_14030d9d0(param_2 + 0x210);
  return;
}



void Unwind_140446380(undefined8 param_1,longlong param_2)

{
  FUN_14008d020(param_2 + 0x230);
  return;
}



void Unwind_140446390(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x268);
  return;
}



void Unwind_1404463a0(undefined8 param_1,longlong param_2)

{
  FUN_14030da30(param_2 + 0x298);
  return;
}



void Unwind_1404463c0(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x0001404463c7. Too many branches
                    // WARNING: Treating indirect jump as call
  std::basic_streambuf<>::~basic_streambuf<>(*(basic_streambuf<> **)(param_2 + 0x48));
  return;
}



void Unwind_1404463d0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x50);
  return;
}



void Unwind_1404463e0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x78);
  return;
}



void Unwind_1404463f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x40);
  return;
}



void Unwind_140446400(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x20);
  return;
}



void Unwind_140446410(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x30);
  return;
}



void Unwind_140446420(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x50);
  return;
}



void Unwind_140446430(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_140446440(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dede0(param_2 + 0x78);
  return;
}



void Unwind_140446450(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446457. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x70));
  return;
}



void Unwind_140446460(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x68);
  return;
}



void Unwind_140446470(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1c8);
  return;
}



void Unwind_140446480(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x1b8);
  return;
}



void Unwind_140446490(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 400);
  return;
}



void Unwind_1404464a0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x90);
  return;
}



void Unwind_1404464b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xb0);
  return;
}



void Unwind_1404464c0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x1d0);
  return;
}



void Unwind_1404464d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 400);
  return;
}



void Unwind_1404464e0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x1a0);
  return;
}



void Unwind_1404464f0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_140446500(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xd8);
  return;
}



void Unwind_140446510(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1b0);
  return;
}



void Unwind_140446520(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446527. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_140446530(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x200);
  return;
}



void Unwind_140446540(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446547. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x78));
  return;
}



void Unwind_140446550(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140446570(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa8);
  return;
}



void Unwind_140446580(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_140446590(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1404465a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_1404465b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x68);
  return;
}



void Unwind_1404465c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xc0);
  return;
}



void Unwind_1404465d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x98);
  return;
}



void Unwind_1404465e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xb0);
  return;
}



void Unwind_1404465f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x28);
  return;
}



void Unwind_140446600(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140446610(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x108);
  return;
}



void Unwind_140446620(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x90);
  return;
}



void Unwind_140446630(undefined8 param_1,longlong param_2)

{
  Concurrency::details::SubAllocator::~SubAllocator((SubAllocator *)(param_2 + 0x220));
  return;
}



void Unwind_140446640(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x188);
  return;
}



void Unwind_140446650(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x1d0);
  return;
}



void Unwind_140446660(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x1b0);
  return;
}



void Unwind_140446670(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140446690(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x178);
  return;
}



void Unwind_1404466a0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x28);
  return;
}



void Unwind_1404466b0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x38);
  return;
}



void Unwind_1404466c0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_1404466d0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x78);
  return;
}



void Unwind_1404466e0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_1404466f0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x20);
  return;
}



void Unwind_140446700(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x48);
  return;
}



void Unwind_140446710(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x58);
  return;
}



void Unwind_140446720(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_140446730(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dede0(param_2 + 0x68);
  return;
}



void Unwind_140446740(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446747. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x2e0));
  return;
}



void Unwind_140446750(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x110);
  return;
}



void Unwind_140446760(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dede0(param_2 + 0x78);
  return;
}



void Unwind_140446770(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446777. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x3e0));
  return;
}



void Unwind_140446780(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xd8);
  return;
}



void Unwind_140446790(undefined8 param_1,longlong param_2)

{
  FUN_140129b90(param_2 + 0xe8);
  return;
}



void Unwind_1404467a0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x120);
  return;
}



void Unwind_1404467b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1404467c0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1404467d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x60);
  return;
}



void Unwind_1404467e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x58);
  return;
}



void Unwind_1404467f0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x158);
  return;
}



void Unwind_140446800(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x138);
  return;
}



void Unwind_140446810(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x118);
  return;
}



void Unwind_140446820(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xf8);
  return;
}



void Unwind_140446830(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x80);
  return;
}



void Unwind_140446840(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0xd0);
  return;
}



void Unwind_140446850(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x48);
  return;
}



void Unwind_140446860(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x58);
  return;
}



void Unwind_140446870(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x68);
  return;
}



void Unwind_140446880(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x78);
  return;
}



void Unwind_140446890(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446897. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x80));
  return;
}



void Unwind_1404468a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x28);
  return;
}



void Unwind_1404468b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df150(param_2 + 0x38);
  return;
}



void Unwind_1404468c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_1404468d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_1404468e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x70);
  return;
}



void Unwind_1404468f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df150(param_2 + 0x80);
  return;
}



void Unwind_140446900(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x90);
  return;
}



void Unwind_140446910(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401798f0(param_2 + 0x38);
  return;
}



void Unwind_140446920(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_140446930(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140446940(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x68);
  return;
}



void Unwind_140446950(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x78);
  return;
}



void Unwind_140446960(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x100);
  return;
}



void Unwind_140446970(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140446990(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x20);
  return;
}



void Unwind_1404469a0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_1404469c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df030(param_2 + 0x30);
  return;
}



void Unwind_1404469d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(undefined8 *)(param_2 + 0x150));
  return;
}



void Unwind_1404469e0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(longlong *)(param_2 + 0x150) + 0x20);
  return;
}



void Unwind_1404469f0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140446a10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_140446a20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x40);
  return;
}



void Unwind_140446a30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401defb0(param_2 + 0x50);
  return;
}



void Unwind_140446a40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x80);
  return;
}



void Unwind_140446a50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x50);
  return;
}



void Unwind_140446a60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x68);
  return;
}



void Unwind_140446a70(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140446a90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x38);
  return;
}



void Unwind_140446aa0(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140446ac0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x48);
  return;
}



void Unwind_140446ad0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x80);
  return;
}



void Unwind_140446ae0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x90);
  return;
}



void Unwind_140446af0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0xa0);
  return;
}



void Unwind_140446b00(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140446b20(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140446b40(void)

{
  DAT_14060b7f4 = DAT_14060b7f4 & 0xfffffffe;
  return;
}



void Unwind_140446b60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x78);
  return;
}



void Unwind_140446b70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x88);
  return;
}



void Unwind_140446b80(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xe8);
  return;
}



void Unwind_140446b90(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x50);
  return;
}



void Unwind_140446ba0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140446bb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x90);
  return;
}



void Unwind_140446bc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140446bd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x28);
  return;
}



void Unwind_140446be0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x80);
  return;
}



void Unwind_140446bf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dede0(param_2 + 0x58);
  return;
}



void Unwind_140446c00(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446c07. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x68));
  return;
}



void Unwind_140446c10(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x60);
  return;
}



void Unwind_140446c20(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x40);
  return;
}



void Unwind_140446c30(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140446c40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df0d0(param_2 + 0x50);
  return;
}



void Unwind_140446c50(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x68);
  return;
}



void Unwind_140446c60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140446c70(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x30);
  return;
}



void Unwind_140446c80(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140446c90(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x50);
  return;
}



void Unwind_140446ca0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x40);
  return;
}



void Unwind_140446cb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14000d2c0(param_2 + 0xb0);
  return;
}



void Unwind_140446cc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140446cd0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x78);
  return;
}



void Unwind_140446ce0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x68);
  return;
}



void Unwind_140446cf0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140249180(param_2 + 0x38);
  return;
}



void Unwind_140446d00(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140446d10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1400031d0(param_2 + 0x30);
  return;
}



void Unwind_140446d20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140446d30(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x90);
  return;
}



void Unwind_140446d40(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140446d50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x90);
  return;
}



void Unwind_140446d60(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xd8);
  return;
}



void Unwind_140446d70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401def10(param_2 + 0xe8);
  return;
}



void Unwind_140446d80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401defb0(param_2 + 0x180);
  return;
}



void Unwind_140446d90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x70);
  return;
}



void Unwind_140446da0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x40);
  return;
}



void Unwind_140446db0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x170);
  return;
}



void Unwind_140446dc0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x198);
  return;
}



void Unwind_140446dd0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e600(*(undefined8 *)(param_2 + 0xa0));
  return;
}



void Unwind_140446de0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0xa0) + 0x48);
  return;
}



void Unwind_140446df0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_140446e00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401def10(param_2 + 0x28);
  return;
}



void Unwind_140446e10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401defb0(param_2 + 0x48);
  return;
}



void Unwind_140446e20(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e600(*(undefined8 *)(param_2 + 0x80));
  return;
}



void Unwind_140446e30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025e6b0(*(longlong *)(param_2 + 0x80) + 0x48);
  return;
}



void Unwind_140446e40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x30);
  return;
}



void Unwind_140446e50(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x20);
  return;
}



void Unwind_140446e60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x68);
  return;
}



void Unwind_140446e70(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x68);
  return;
}



void Unwind_140446e80(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x80);
  return;
}



void Unwind_140446e90(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x78);
  return;
}



void Unwind_140446ea0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x58);
  return;
}



void Unwind_140446eb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x78);
  return;
}



void Unwind_140446ec0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xb0);
  return;
}



void Unwind_140446ed0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x50);
  return;
}



void Unwind_140446ee0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x50);
  return;
}



void Unwind_140446ef0(undefined8 param_1,longlong param_2)

{
  FUN_140007830(param_2 + 0x70);
  return;
}



void Unwind_140446f00(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x58);
  return;
}



void Unwind_140446f10(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x88);
  return;
}



void Unwind_140446f20(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140446f30(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_140446f40(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 200);
  return;
}



void Unwind_140446f50(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x210);
  return;
}



void Unwind_140446f60(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401dede0(param_2 + 0x88);
  return;
}



void Unwind_140446f70(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446f77. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x230));
  return;
}



void Unwind_140446f80(undefined8 param_1,longlong param_2)

{
                    // WARNING: Could not recover jumptable at 0x000140446f87. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(*(void **)(param_2 + 0x230));
  return;
}



void Unwind_140446f90(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x50);
  return;
}



void Unwind_140446fa0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140446fb0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x70);
  return;
}



void Unwind_140446fc0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x60);
  return;
}



void Unwind_140446fd0(undefined8 param_1,longlong param_2)

{
  FUN_14033a390(param_2 + 0x50);
  return;
}



void Unwind_140446fe0(undefined8 param_1,longlong param_2)

{
  FUN_140418b00(param_2 + 0x48);
  return;
}



void Unwind_140446ff0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x58);
  return;
}



void Unwind_140447000(undefined8 param_1,longlong param_2)

{
  FUN_14004b970(param_2 + 0x60);
  return;
}



void Unwind_140447010(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_140447020(undefined8 param_1,longlong param_2)

{
  FUN_140139500(param_2 + 0x80);
  return;
}



void Unwind_140447030(undefined8 param_1,longlong param_2)

{
  thunk_FUN_140175570(param_2 + 0x60);
  return;
}



void Unwind_140447040(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x60);
  return;
}



void Unwind_140447050(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x50);
  return;
}



void Unwind_140447060(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x70);
  return;
}



void Unwind_140447070(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0x90);
  return;
}



void Unwind_140447080(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401754f0(param_2 + 0x88);
  return;
}



void Unwind_140447090(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa8);
  return;
}



void Unwind_1404470a0(undefined8 param_1,longlong param_2)

{
  FUN_14008d060(param_2 + 0xd0);
  return;
}



void Unwind_1404470b0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0xa0);
  return;
}



void Unwind_1404470c0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xd8);
  return;
}



void Unwind_1404470d0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x90);
  return;
}



void Unwind_1404470e0(undefined8 param_1,longlong param_2)

{
  FUN_14023adf0(param_2 + 0x20);
  return;
}



void Unwind_1404470f0(undefined8 param_1,longlong param_2)

{
  FUN_1403010a0(param_2 + 0x160);
  return;
}



void Unwind_140447100(undefined8 param_1,longlong param_2)

{
  FUN_140139500(param_2 + 0x60);
  return;
}



void Unwind_140447110(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0xe0),*(undefined8 *)(param_2 + 0x160));
  return;
}



void Unwind_140447140(undefined8 param_1,longlong param_2)

{
  FUN_1401169e0(*(undefined8 *)(param_2 + 0xe0),*(undefined8 *)(param_2 + 0x160));
  return;
}



void Unwind_140447170(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x58);
  return;
}



void Unwind_140447180(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x40);
  return;
}



void Unwind_140447190(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_1404471a0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0xa8);
  return;
}



void Unwind_1404471b0(undefined8 param_1,longlong param_2)

{
  FUN_14023be90(param_2 + 0x50);
  return;
}



void Unwind_1404471c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x40);
  return;
}



void Unwind_1404471d0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x78);
  return;
}



void Unwind_1404471e0(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x98);
  return;
}



void Unwind_1404471f0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401975d0(param_2 + 0x50);
  return;
}



void Unwind_140447200(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x80);
  return;
}



void Unwind_140447210(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x60);
  return;
}



void Unwind_140447220(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x48);
  return;
}



void Unwind_140447230(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140447250(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df030(param_2 + 0x58);
  return;
}



void Unwind_140447260(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x88);
  return;
}



void Unwind_140447270(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x68);
  return;
}



void Unwind_140447280(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(undefined8 *)(param_2 + 0x100));
  return;
}



void Unwind_140447290(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(longlong *)(param_2 + 0x100) + 0x20);
  return;
}



void Unwind_1404472a0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x38);
  return;
}



void Unwind_1404472b0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df030(param_2 + 0x58);
  return;
}



void Unwind_1404472c0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(undefined8 *)(param_2 + 0x90));
  return;
}



void Unwind_1404472d0(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(longlong *)(param_2 + 0x90) + 0x20);
  return;
}



void Unwind_1404472e0(undefined8 param_1,longlong param_2)

{
  FUN_1400031a0(param_2 + 0x50);
  return;
}



void Unwind_1404472f0(void)

{
  DAT_14060b7c4 = DAT_14060b7c4 & 0xfffffffe;
  return;
}



void Unwind_140447310(undefined8 param_1,longlong param_2)

{
  thunk_FUN_1401df030(param_2 + 0x60);
  return;
}



void Unwind_140447320(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x90);
  return;
}



void Unwind_140447330(undefined8 param_1,longlong param_2)

{
  FUN_140162300(param_2 + 0x70);
  return;
}



void Unwind_140447340(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(undefined8 *)(param_2 + 0xf0));
  return;
}



void Unwind_140447350(undefined8 param_1,longlong param_2)

{
  thunk_FUN_14025c370(*(longlong *)(param_2 + 0xf0) + 0x20);
  return;
}



void Unwind_140447360(void)

{
  FUN_14012e930(&DAT_140607dc8);
  return;
}



void Unwind_140447370(void)

{
  thunk_FUN_14014adf0(&DAT_140608910);
  return;
}



void Unwind_140447380(void)

{
  thunk_FUN_14014aa70(&DAT_140608b10);
  return;
}



void Unwind_140447390(void)

{
  thunk_FUN_140148af0(&DAT_140608b58);
  return;
}



void Unwind_1404473a0(void)

{
  thunk_FUN_140148af0(&DAT_140608ba0);
  return;
}



void Unwind_1404473c0(void)

{
  thunk_FUN_14014a7b0(&DAT_140608bf0);
  return;
}



void Unwind_1404473d0(void)

{
  thunk_FUN_14014a4f0(&DAT_140608c40);
  return;
}



void FUN_1404473e0(void)

{
  FUN_140001710(&DAT_1405e7280,L"option\\auction_serveroption.xml",0x1f);
  atexit(FUN_140448360);
  return;
}



void FUN_140447410(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_14060cf88,uVar1,0);
  atexit((_func_5014 *)&LAB_1404483a0);
  return;
}



void FUN_140447470(void)

{
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_140607d90);
  atexit((_func_5014 *)&LAB_140448490);
  return;
}



void FUN_1404474d0(void)

{
  FUN_140001710(&DAT_1405e73c8,L"option\\total_option.xml",0x17);
  atexit(FUN_1404484e0);
  return;
}



void FUN_140447500(void)

{
  FUN_140003e50(&DAT_1405e73f0,"option\\agent.xml",0x10);
  atexit(FUN_140448520);
  return;
}



void FUN_140447530(void)

{
  FUN_140003e50(&DAT_1405e7418,"option\\patch.xml",0x10);
  atexit(FUN_140448560);
  return;
}



void FUN_140447560(void)

{
  FUN_14012e890();
  atexit(FUN_1404485a0);
  return;
}



void FUN_140447580(void)

{
  FUN_140003e50(&DAT_1405e7440,"option\\content_control.xml",0x1a);
  atexit(FUN_1404488f0);
  return;
}



void FUN_1404475b0(void)

{
  FUN_140003e50(&DAT_1405e7468,"option\\shop_control.xml",0x17);
  atexit(FUN_140448940);
  return;
}



void FUN_140447630(void)

{
  _eh_vector_constructor_iterator_(&DAT_140607e90,0x10,4,FUN_140178e00,thunk_FUN_140175570);
  atexit((_func_5014 *)&LAB_140448b10);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140447680(void)

{
  FUN_14000a170(&DAT_14060d080);
  _DAT_14060d128 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404476a0(void)

{
  FUN_14000a170(&DAT_14060cfd0);
  _DAT_14060d078 = 0;
  return;
}



void FUN_1404476d0(void)

{
  FUN_140247a10();
  atexit(FUN_140448c90);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404476f0(void)

{
  FUN_14000a170(&DAT_14060d140);
  _DAT_14060d1e8 = 0;
  return;
}



void FUN_140447710(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_140607f30,uVar1,1);
  atexit((_func_5014 *)&LAB_140448d10);
  return;
}



void FUN_140447760(void)

{
  FUN_1402d5b60();
  atexit(FUN_140448da0);
  return;
}



void FUN_140447780(void)

{
  FUN_140003e50(&DAT_1405e74e0,"option\\log_control.xml",0x16);
  atexit(FUN_140448e10);
  return;
}



void FUN_1404477f0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f05c8,uVar1,0);
  atexit((_func_5014 *)&LAB_140449260);
  return;
}



void FUN_140447820(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f0590,uVar1,0);
  atexit((_func_5014 *)&LAB_140449250);
  return;
}



void FUN_140447850(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f0650,uVar1,1);
  atexit((_func_5014 *)&LAB_140449280);
  return;
}



void FUN_1404478f0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f06b0,uVar1,0);
  atexit((_func_5014 *)&LAB_1404492c0);
  return;
}



void FUN_140447920(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f07c8,uVar1,0);
  atexit((_func_5014 *)&LAB_1404492d0);
  return;
}



void FUN_140447950(void)

{
  FUN_140353cb0(&DAT_1405f08d0,&DAT_14047e238,0xffff);
  atexit((_func_5014 *)&LAB_140449330);
  return;
}



void FUN_140447980(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f0898,uVar1,0);
  atexit((_func_5014 *)&LAB_140449310);
  return;
}



void FUN_1404479b0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f0860,uVar1,0);
  atexit((_func_5014 *)&LAB_140449300);
  return;
}



void FUN_1404479e0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f0958,uVar1,1);
  atexit((_func_5014 *)&LAB_140449340);
  return;
}



void FUN_140447a10(void)

{
  FUN_140359a20(&DAT_1405f0990);
  FUN_140359b40(&DAT_1405f0990);
  atexit((_func_5014 *)&LAB_140449350);
  return;
}



void FUN_140447a50(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f1e20,uVar1,0);
  atexit((_func_5014 *)&LAB_140449370);
  return;
}



void FUN_140447a7c(void)

{
  ATL::CAtlBaseModule::CAtlBaseModule((CAtlBaseModule *)&DAT_1405f2410);
  atexit((_func_5014 *)&LAB_14044939c);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140447a9c(void)

{
  DAT_1405f2478 = GetProcessHeap();
  DAT_1405f2480 = 0;
  _DAT_1405f2470 = &PTR_LAB_14044e4e0;
  atexit(FUN_1404493a8);
  return;
}



void FUN_140447dd0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f2620,uVar1,0);
  atexit((_func_5014 *)&LAB_140449420);
  return;
}



void FUN_140447e70(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f2788,uVar1,0);
  atexit((_func_5014 *)&LAB_1404494d0);
  return;
}



void FUN_140447ea0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f2850,uVar1,1);
  atexit((_func_5014 *)&LAB_1404494e0);
  return;
}



void FUN_140447ee0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f2818,uVar1,0);
  atexit((_func_5014 *)&LAB_140449500);
  return;
}



void FUN_140447f10(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f27e0,uVar1,0);
  atexit((_func_5014 *)&LAB_1404494f0);
  return;
}



void FUN_140447f50(void)

{
  undefined4 uVar1;
  undefined8 in_R9;
  undefined8 uVar2;
  
  uVar2 = 0xfffffffffffffffe;
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f28a8,uVar1,1,in_R9,uVar2);
  FUN_14034ed40(&DAT_1405f28a8);
  DAT_1405f28a0 = operator_new(8);
  if (DAT_1405f28a0 != (undefined8 *)0x0) {
    *DAT_1405f28a0 = 0;
  }
  FUN_14034edd0(&DAT_1405f28a8);
  atexit(FUN_140449580);
  return;
}



void FUN_140447fd0(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f28e0,uVar1,1);
  atexit((_func_5014 *)&LAB_1404495f0);
  return;
}



void FUN_140448000(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f3988,uVar1,0);
  atexit((_func_5014 *)&LAB_140449640);
  return;
}



void FUN_140448080(void)

{
  undefined4 uVar1;
  
  uVar1 = FUN_1403c0cc0();
  FUN_14034ec60(&DAT_1405f6a98,uVar1,0);
  atexit((_func_5014 *)&LAB_140449670);
  return;
}



void FUN_1404480b0(void)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined *puVar5;
  
  FUN_14034fe70();
  DAT_1405f6ad0 = PTR_DAT_1405d8008;
  iVar2 = FUN_14034fd90(
                       "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_1405f6ad0 == (undefined *)0x0) {
    iVar4 = 0;
  }
  else if (DAT_1405f6ad0 == PTR_DAT_1405d8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)(DAT_1405f6ad0 + -8);
  }
  iVar3 = iVar2;
  if (iVar2 <= iVar4) {
    if (DAT_1405f6ad0 == (undefined *)0x0) {
      iVar3 = 0;
    }
    else if (DAT_1405f6ad0 == PTR_DAT_1405d8008) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(DAT_1405f6ad0 + -8);
    }
  }
  iVar4 = 1;
  if (1 < iVar3) {
    iVar4 = iVar3;
  }
  if (DAT_1405f6ad0 == (undefined *)0x0) {
    iVar3 = 0;
  }
  else if (DAT_1405f6ad0 == PTR_DAT_1405d8008) {
    iVar3 = 0;
  }
  else {
    iVar3 = *(int *)(DAT_1405f6ad0 + -8);
  }
  if (iVar3 < iVar4) {
    FUN_140057890(&DAT_1405f6ad0);
  }
  FUN_140057970(&DAT_1405f6ad0);
  puVar5 = DAT_1405f6ad0;
  if (DAT_1405f6ad0 == (undefined *)0x0) {
    puVar5 = PTR_DAT_1405d8008;
  }
  FUN_14034fdc0(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_14034fd90();
  iVar2 = 0;
  if (0 < iVar4) {
    iVar2 = iVar4;
  }
  if (DAT_1405f6ad0 == (undefined *)0x0) {
    iVar4 = 0;
  }
  else if (DAT_1405f6ad0 == PTR_DAT_1405d8008) {
    iVar4 = 0;
  }
  else {
    iVar4 = *(int *)(DAT_1405f6ad0 + -8);
  }
  if (iVar4 <= iVar2) {
    if (DAT_1405f6ad0 == (undefined *)0x0) {
      iVar2 = 0;
    }
    else if (DAT_1405f6ad0 == PTR_DAT_1405d8008) {
      iVar2 = 0;
    }
    else {
      iVar2 = *(int *)(DAT_1405f6ad0 + -8);
    }
  }
  if (((DAT_1405f6ad0 != PTR_DAT_1405d8008) && (DAT_1405f6ad0 != (undefined *)0x0)) &&
     (piVar1 = (int *)(DAT_1405f6ad0 + -8), piVar1 != (int *)0x0)) {
    *piVar1 = iVar2;
    *(undefined1 *)((longlong)iVar2 + 8 + (longlong)piVar1) = 0;
  }
  atexit((_func_5014 *)&LAB_140449680);
  return;
}



void FUN_140448200(void)

{
  undefined8 uVar1;
  undefined4 uVar2;
  undefined *local_res8 [4];
  
  FUN_14034fe70();
  local_res8[0] = PTR_DAT_1405d8008;
  uVar2 = FUN_14034fd90("239.255.255.250");
  uVar1 = FUN_140057a60(local_res8,uVar2);
  FUN_14034fdc0(uVar1,"239.255.255.250",uVar2);
  FUN_140057b50(local_res8);
  FUN_140353210(&DAT_1405f6ad8,local_res8,0x76c);
  return;
}



void FUN_140448280(void)

{
  undefined8 uVar1;
  undefined4 uVar2;
  undefined *local_res8 [4];
  
  FUN_14034fe70();
  local_res8[0] = PTR_DAT_1405d8010;
  uVar2 = FUN_14034fcf0(L"211.214.161.39");
  uVar1 = FUN_140002f00(local_res8,uVar2);
  FUN_14034fd20(uVar1,L"211.214.161.39",uVar2);
  FUN_140002fe0(local_res8);
  FUN_140353280(&DAT_1405f6d48,local_res8,0x50);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448360(void)

{
  if (7 < DAT_1405e7298) {
    operator_delete((void *)CONCAT62(DAT_1405e7280._2_6_,(undefined2)DAT_1405e7280));
  }
  DAT_1405e7298 = 7;
  _DAT_1405e7290 = 0;
  DAT_1405e7280._0_2_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404483b0(void)

{
  if (DAT_140607d30 != (void *)0x0) {
    operator_delete(DAT_140607d30);
  }
  DAT_140607d30 = (void *)0x0;
  _DAT_140607d38 = 0;
  _DAT_140607d40 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404483f0(void)

{
  if (DAT_140607d50 != (void *)0x0) {
    operator_delete(DAT_140607d50);
  }
  DAT_140607d50 = (void *)0x0;
  _DAT_140607d58 = 0;
  _DAT_140607d60 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448430(void)

{
  if (DAT_140607d70 != (void *)0x0) {
    operator_delete(DAT_140607d70);
  }
  DAT_140607d70 = (void *)0x0;
  _DAT_140607d78 = 0;
  _DAT_140607d80 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404484a0(void)

{
  if (7 < DAT_1405f0480) {
    operator_delete((void *)CONCAT62(DAT_1405f0468._2_6_,(undefined2)DAT_1405f0468));
  }
  DAT_1405f0480 = 7;
  _DAT_1405f0478 = 0;
  DAT_1405f0468._0_2_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404484e0(void)

{
  if (7 < DAT_1405e73e0) {
    operator_delete((void *)CONCAT62(_DAT_1405e73ca,DAT_1405e73c8));
  }
  DAT_1405e73e0 = 7;
  _DAT_1405e73d8 = 0;
  DAT_1405e73c8 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448520(void)

{
  if (0xf < DAT_1405e7408) {
    operator_delete((void *)CONCAT71(DAT_1405e73f0._1_7_,(undefined1)DAT_1405e73f0));
  }
  DAT_1405e7408 = 0xf;
  _DAT_1405e7400 = 0;
  DAT_1405e73f0._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448560(void)

{
  if (0xf < DAT_1405e7430) {
    operator_delete((void *)CONCAT71(DAT_1405e7418._1_7_,(undefined1)DAT_1405e7418));
  }
  DAT_1405e7430 = 0xf;
  _DAT_1405e7428 = 0;
  DAT_1405e7418._0_1_ = 0;
  return;
}



void FUN_1404485a0(void)

{
  undefined8 in_R9;
  undefined1 local_res8 [32];
  
  FUN_14012ecd0(local_res8,*DAT_140607dd0,DAT_140607dd0,in_R9,0xfffffffffffffffe);
                    // WARNING: Could not recover jumptable at 0x0001404485d0. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(DAT_140607dd0);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448630(void)

{
  if (7 < DAT_14060ced8) {
    operator_delete((void *)CONCAT62(DAT_14060cec0._2_6_,(undefined2)DAT_14060cec0));
  }
  DAT_14060ced8 = 7;
  _DAT_14060ced0 = 0;
  DAT_14060cec0._0_2_ = 0;
  return;
}



void FUN_140448690(void)

{
  FUN_140148af0(&DAT_1406091a8);
  FUN_140148a40();
  return;
}



void FUN_140448730(void)

{
  FUN_140148af0(&DAT_140608e18);
  FUN_140149a60();
  return;
}



void FUN_140448750(void)

{
  FUN_140148af0(&DAT_140608d78);
  FUN_140149cb0();
  return;
}



void FUN_140448790(void)

{
  if (DAT_140609298 != (void *)0x0) {
    operator_delete(DAT_140609298);
  }
  DAT_140609298 = (void *)0x0;
  DAT_1406092a0 = 0;
  DAT_1406092a8 = 0;
  return;
}



void FUN_1404487d0(void)

{
  FUN_14014a3f0();
  FUN_14014a4f0();
  return;
}



void FUN_1404487f0(void)

{
  FUN_14014a6b0();
  FUN_14014a7b0();
  return;
}



void FUN_140448810(void)

{
  FUN_14014a970();
  FUN_140148af0(&DAT_140608ba0);
  FUN_140148af0(&DAT_140608b58);
  FUN_14014aa70();
  return;
}



void FUN_140448870(void)

{
  _eh_vector_destructor_iterator_(&DAT_140608958,0x20,0xb,FUN_140147140);
  FUN_14014adf0();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404488f0(void)

{
  if (0xf < DAT_1405e7458) {
    operator_delete((void *)CONCAT71(DAT_1405e7440._1_7_,(undefined1)DAT_1405e7440));
  }
  DAT_1405e7458 = 0xf;
  _DAT_1405e7450 = 0;
  DAT_1405e7440._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448940(void)

{
  if (0xf < DAT_1405e7480) {
    operator_delete((void *)CONCAT71(DAT_1405e7468._1_7_,(undefined1)DAT_1405e7468));
  }
  DAT_1405e7480 = 0xf;
  _DAT_1405e7478 = 0;
  DAT_1405e7468._0_1_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404489d0(void)

{
  if (DAT_140607de8 != (void *)0x0) {
    operator_delete(DAT_140607de8);
  }
  DAT_140607de8 = (void *)0x0;
  _DAT_140607df0 = 0;
  _DAT_140607df8 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448a10(void)

{
  if (DAT_140607e08 != (void *)0x0) {
    operator_delete(DAT_140607e08);
  }
  DAT_140607e08 = (void *)0x0;
  _DAT_140607e10 = 0;
  _DAT_140607e18 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448a50(void)

{
  if (DAT_140607e28 != (void *)0x0) {
    operator_delete(DAT_140607e28);
  }
  DAT_140607e28 = (void *)0x0;
  _DAT_140607e30 = 0;
  _DAT_140607e38 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448a90(void)

{
  if (DAT_140607e48 != (void *)0x0) {
    operator_delete(DAT_140607e48);
  }
  DAT_140607e48 = (void *)0x0;
  _DAT_140607e50 = 0;
  _DAT_140607e58 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448ad0(void)

{
  if (DAT_140607e68 != (void *)0x0) {
    operator_delete(DAT_140607e68);
  }
  DAT_140607e68 = (void *)0x0;
  _DAT_140607e70 = 0;
  _DAT_140607e78 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448b30(void)

{
  if (DAT_140607ed0 != (void *)0x0) {
    FUN_1402ce6b0(DAT_140607ed0,DAT_140607ed8);
    operator_delete(DAT_140607ed0);
  }
  DAT_140607ed0 = (void *)0x0;
  DAT_140607ed8 = 0;
  _DAT_140607ee0 = 0;
  return;
}



void FUN_140448b80(void)

{
  if (DAT_14060cf58 != (void *)0x0) {
    operator_delete(DAT_14060cf58);
  }
  DAT_14060cf58 = (void *)0x0;
  DAT_14060cf60 = 0;
  DAT_14060cf68 = 0;
  return;
}



void FUN_140448bc0(void)

{
  int *piVar1;
  void *pvVar2;
  undefined8 *puVar3;
  int iVar4;
  bool bVar5;
  
  puVar3 = DAT_14060d130;
  if (DAT_14060d130 != (undefined8 *)0x0) {
    if (DAT_14060d130 == DAT_14060d138) {
      if (DAT_14060d130 != (undefined8 *)0x0) {
        LOCK();
        piVar1 = (int *)(DAT_14060d130 + 1);
        *piVar1 = *piVar1 + -1;
        UNLOCK();
        if (*piVar1 == 0) {
          DAT_14060d130 = (undefined8 *)0x0;
          pvVar2 = (void *)*puVar3;
          if (pvVar2 != (void *)0x0) {
            FUN_14027b3e0(pvVar2);
            operator_delete(pvVar2);
          }
          operator_delete(puVar3);
        }
      }
    }
    else {
      iVar4 = DAT_140608168 + 1;
      bVar5 = DAT_140608168 == 0;
      DAT_140608168 = iVar4;
      if (bVar5) {
        FUN_140176d60(1);
        return;
      }
    }
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448c50(void)

{
  if (DAT_14060ab50 != (void *)0x0) {
    operator_delete(DAT_14060ab50);
  }
  DAT_14060ab50 = (void *)0x0;
  DAT_14060ab58 = 0;
  _DAT_14060ab60 = 0;
  return;
}



void FUN_140448c90(void)

{
  if (DAT_140607ef0 != 0) {
    FUN_140248050(&DAT_140607ef0);
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448cd0(void)

{
  if (DAT_14060b7d0 != (void *)0x0) {
    operator_delete(DAT_14060b7d0);
  }
  DAT_14060b7d0 = (void *)0x0;
  DAT_14060b7d8 = 0;
  _DAT_14060b7e0 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448d20(void)

{
  if (DAT_140607f88 != (void *)0x0) {
    operator_delete(DAT_140607f88);
  }
  DAT_140607f88 = (void *)0x0;
  DAT_140607f90 = 0;
  _DAT_140607f98 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448d60(void)

{
  if (DAT_140607f68 != (void *)0x0) {
    operator_delete(DAT_140607f68);
  }
  DAT_140607f68 = (void *)0x0;
  DAT_140607f70 = 0;
  _DAT_140607f78 = 0;
  return;
}



void FUN_140448da0(void)

{
  longlong *plVar1;
  longlong *plVar2;
  
  plVar2 = (longlong *)*DAT_140607fa8;
  *DAT_140607fa8 = (longlong)DAT_140607fa8;
  DAT_140607fa8[1] = (longlong)DAT_140607fa8;
  DAT_140607fb0 = 0;
  if (plVar2 != DAT_140607fa8) {
    do {
      plVar1 = (longlong *)*plVar2;
      operator_delete(plVar2);
      plVar2 = plVar1;
    } while (plVar1 != DAT_140607fa8);
  }
                    // WARNING: Could not recover jumptable at 0x000140448e04. Too many branches
                    // WARNING: Treating indirect jump as call
  operator_delete(DAT_140607fa8);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448e10(void)

{
  if (0xf < DAT_1405e74f8) {
    operator_delete((void *)CONCAT71(DAT_1405e74e0._1_7_,(undefined1)DAT_1405e74e0));
  }
  DAT_1405e74f8 = 0xf;
  _DAT_1405e74f0 = 0;
  DAT_1405e74e0._0_1_ = 0;
  return;
}



void FUN_140448e60(void)

{
  FUN_1402475c0(&DAT_14060a408);
  FUN_1402475c0(&DAT_14060a3c0);
  FUN_1402e2000(&DAT_14060a378);
  FUN_1402e1e40(&DAT_14060a330);
  FUN_1402e1e40(&DAT_14060a2e8);
  FUN_1402e1e20(&DAT_14060a2a0);
  FUN_1402e1e20(&DAT_14060a258);
  FUN_1402e1c20();
  return;
}



void FUN_140448ef0(void)

{
  FUN_1402e90e0(&DAT_14060ab30);
  if (DAT_14060aaf0 != 0) {
    FUN_14014ff00(&DAT_14060aaf0);
  }
  FUN_1402e9500(&DAT_14060aaa8);
  FUN_140148110(&DAT_14060aa60);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140448f50(void)

{
  if (DAT_140608688 != (void *)0x0) {
    operator_delete(DAT_140608688);
  }
  DAT_140608688 = (void *)0x0;
  _DAT_140608690 = 0;
  _DAT_140608698 = 0;
  return;
}



void FUN_140448fc0(void)

{
  FUN_140303cf0(&DAT_14060aa18);
  FUN_140303bc0(&DAT_14060a9d0);
  FUN_140148110(&DAT_14060a988);
  FUN_140148110(&DAT_14060a940);
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140449020(void)

{
  if (DAT_1406085b8 != (void *)0x0) {
    FUN_14030dad0(DAT_1406085b8,DAT_1406085c0);
    operator_delete(DAT_1406085b8);
  }
  DAT_1406085b8 = (void *)0x0;
  DAT_1406085c0 = 0;
  _DAT_1406085c8 = 0;
  FUN_14030e760();
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140449070(void)

{
  if (7 < DAT_1405f04a8) {
    operator_delete((void *)CONCAT62(DAT_1405f0490._2_6_,(undefined2)DAT_1405f0490));
  }
  DAT_1405f04a8 = 7;
  _DAT_1405f04a0 = 0;
  DAT_1405f0490._0_2_ = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404490b0(void)

{
  if (DAT_14060d1f0 != (void *)0x0) {
    FUN_1402ce6b0(DAT_14060d1f0,DAT_14060d1f8);
    operator_delete(DAT_14060d1f0);
  }
  DAT_14060d1f0 = (void *)0x0;
  DAT_14060d1f8 = 0;
  _DAT_14060d200 = 0;
  return;
}



void FUN_140449120(void)

{
  FUN_140148af0(&DAT_140608488);
  FUN_14031e570();
  return;
}



void FUN_140449150(void)

{
  if (DAT_1406083b0 != 0) {
    FUN_14031ee80(&DAT_1406083b0);
  }
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404491c0(void)

{
  if (DAT_14060d210 != (void *)0x0) {
    FUN_14008d0a0(DAT_14060d210,DAT_14060d218);
    operator_delete(DAT_14060d210);
  }
  DAT_14060d210 = (void *)0x0;
  DAT_14060d218 = 0;
  _DAT_14060d220 = 0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_140449210(void)

{
  if (7 < DAT_1405f04d0) {
    operator_delete((void *)CONCAT62(DAT_1405f04b8._2_6_,(undefined2)DAT_1405f04b8));
  }
  DAT_1405f04d0 = 7;
  _DAT_1405f04c8 = 0;
  DAT_1405f04b8._0_2_ = 0;
  return;
}



void FUN_140449290(void)

{
  if (DAT_1405f06a0 != (longlong *)0x0) {
    (**(code **)(*DAT_1405f06a0 + 0x20))(DAT_1405f06a0,1);
  }
  DAT_1405f06a0 = (longlong *)0x0;
  return;
}



// WARNING: Globals starting with '_' overlap smaller symbols at the same address

void FUN_1404493a8(void)

{
  _DAT_1405f2470 = &PTR_LAB_14044e4e0;
  if ((DAT_1405f2480 != '\0') && (DAT_1405f2478 != (HANDLE)0x0)) {
    HeapDestroy(DAT_1405f2478);
  }
  return;
}



void FUN_1404493dc(void)

{
  PTR_PTR_1405d8520 = (undefined *)&PTR_Allocate_14044e508;
  return;
}



void FUN_1404493f0(void)

{
                    // WARNING: Could not recover jumptable at 0x0001404493f7. Too many branches
                    // WARNING: Treating indirect jump as call
  Ordinal_9(&DAT_1405d8558);
  return;
}



void FUN_140449400(void)

{
  if (DAT_1405f2610 != (undefined8 *)0x0) {
    (**(code **)*DAT_1405f2610)(DAT_1405f2610,1);
  }
  return;
}



void FUN_140449430(void)

{
  longlong lVar1;
  
  lVar1 = DAT_1405f2688;
  if (DAT_1405f2688 != 0) {
    FUN_14034ed40(DAT_1405f2688);
    *(longlong *)(DAT_1405f2688 + 0x40) = *(longlong *)(DAT_1405f2688 + 0x40) + -1;
    if (*(longlong *)(DAT_1405f2688 + 0x40) == 0) {
      FUN_14034edd0(lVar1);
      FUN_140360e90(DAT_1405f2688);
    }
    else {
      FUN_14034edd0(lVar1);
    }
  }
  return;
}



void FUN_140449510(void)

{
  longlong lVar1;
  
  lVar1 = DAT_1405f2888;
  while (lVar1 != 0) {
    DAT_1405f2888 = *(longlong *)(lVar1 + 0x38);
    *(undefined8 *)(lVar1 + 0x38) = 0;
    FUN_1403555d0(lVar1 + 8);
    FUN_14034ff60(lVar1);
    lVar1 = DAT_1405f2888;
  }
  DAT_1405f2888 = lVar1;
  return;
}



void FUN_140449570(void)

{
  PTR_vftable_1405d95c0 = (undefined *)Proud::ISendDest_S::vftable;
  return;
}



void FUN_140449580(void)

{
  void *pvVar1;
  
  FUN_14034ed40(&DAT_1405f28a8);
  pvVar1 = DAT_1405f28a0;
  if (DAT_1405f28a0 != (void *)0x0) {
    FUN_14039d070(DAT_1405f28a0);
    operator_delete(pvVar1);
  }
  FUN_14034edd0(&DAT_1405f28a8);
  FUN_14034edf0(&DAT_1405f28a8);
  return;
}



void FUN_140449600(void)

{
  DeleteCriticalSection((LPCRITICAL_SECTION)&DAT_14060d240);
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14060d280);
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14060d2c0);
                    // WARNING: Could not recover jumptable at 0x000140449636. Too many branches
                    // WARNING: Treating indirect jump as call
  InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_1405f3950);
  return;
}



void FUN_140449690(void)

{
  PTR_vftable_1405da130 = (undefined *)Proud::ISendDest_C::vftable;
  return;
}



void FUN_1404496a0(void)

{
  std::_Fac_tidy_reg_t::~_Fac_tidy_reg_t((_Fac_tidy_reg_t *)&DAT_1405f6d70);
  return;
}


